From 72ca88f49c1b7f6678a66c09fa5fe5506623ed35 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 6 Nov 2019 15:24:51 +0100 Subject: [PATCH] Reformatted to new style --- channels/audin/client/alsa/audin_alsa.c | 105 +- channels/audin/client/audin_main.c | 207 +- channels/audin/client/audin_main.h | 1 - channels/audin/client/mac/audin_mac.c | 77 +- .../audin/client/opensles/audin_opensl_es.c | 105 +- channels/audin/client/opensles/opensl_io.c | 108 +- channels/audin/client/opensles/opensl_io.h | 46 +- channels/audin/client/oss/audin_oss.c | 63 +- channels/audin/client/pulse/audin_pulse.c | 99 +- channels/audin/client/winmm/audin_winmm.c | 95 +- channels/audin/server/audin.c | 161 +- channels/client/addin.c | 69 +- channels/client/addin.h | 2 - channels/client/tables.h | 4 +- channels/cliprdr/client/cliprdr_format.c | 72 +- channels/cliprdr/client/cliprdr_format.h | 12 +- channels/cliprdr/client/cliprdr_main.c | 327 +- channels/cliprdr/client/cliprdr_main.h | 5 +- channels/cliprdr/cliprdr_common.c | 48 +- channels/cliprdr/cliprdr_common.h | 36 +- channels/cliprdr/server/cliprdr_main.c | 398 +- channels/cliprdr/server/cliprdr_main.h | 2 +- channels/disp/client/disp_main.c | 98 +- channels/disp/client/disp_main.h | 2 - channels/disp/server/disp_main.c | 144 +- channels/drdynvc/client/drdynvc_main.c | 411 +- channels/drdynvc/client/drdynvc_main.h | 10 +- channels/drdynvc/server/drdynvc_main.c | 14 +- channels/drive/client/drive_file.c | 257 +- channels/drive/client/drive_file.h | 4 +- channels/drive/client/drive_main.c | 107 +- channels/echo/client/echo_main.c | 34 +- channels/echo/client/echo_main.h | 6 +- channels/echo/server/echo_main.c | 64 +- channels/encomsp/client/encomsp_main.c | 319 +- channels/encomsp/server/encomsp_main.c | 69 +- channels/geometry/client/geometry_main.c | 96 +- channels/geometry/client/geometry_main.h | 2 - channels/parallel/client/parallel_main.c | 59 +- channels/printer/client/cups/printer_cups.c | 85 +- channels/printer/client/printer_main.c | 341 +- channels/printer/client/win/printer_win.c | 102 +- channels/printer/printer.h | 19 +- channels/rail/client/rail_main.c | 189 +- channels/rail/client/rail_orders.c | 243 +- channels/rail/client/rail_orders.h | 11 +- channels/rail/rail_common.c | 61 +- channels/rail/rail_common.h | 28 +- channels/rdp2tcp/client/rdp2tcp_main.c | 45 +- channels/rdpdr/client/devman.c | 34 +- channels/rdpdr/client/irp.c | 17 +- channels/rdpdr/client/rdpdr_capabilities.c | 10 +- channels/rdpdr/client/rdpdr_main.c | 351 +- channels/rdpdr/server/rdpdr_main.c | 893 +- channels/rdpdr/server/rdpdr_main.h | 20 +- channels/rdpei/client/rdpei_main.c | 235 +- channels/rdpei/client/rdpei_main.h | 14 +- channels/rdpei/rdpei_common.c | 25 +- channels/rdpei/rdpei_common.h | 8 +- channels/rdpei/server/rdpei_main.c | 227 +- channels/rdpei/server/rdpei_main.h | 3 - channels/rdpgfx/client/rdpgfx_codec.c | 52 +- channels/rdpgfx/client/rdpgfx_main.c | 702 +- channels/rdpgfx/client/rdpgfx_main.h | 1 - channels/rdpgfx/rdpgfx_common.c | 85 +- channels/rdpgfx/rdpgfx_common.h | 8 +- channels/rdpgfx/server/rdpgfx_main.c | 431 +- channels/rdpsnd/client/alsa/rdpsnd_alsa.c | 100 +- channels/rdpsnd/client/fake/rdpsnd_fake.c | 26 +- channels/rdpsnd/client/ios/TPCircularBuffer.c | 197 +- channels/rdpsnd/client/ios/TPCircularBuffer.h | 284 +- channels/rdpsnd/client/ios/rdpsnd_ios.c | 59 +- channels/rdpsnd/client/mac/rdpsnd_mac.m | 100 +- channels/rdpsnd/client/opensles/opensl_io.c | 165 +- channels/rdpsnd/client/opensles/opensl_io.h | 131 +- .../rdpsnd/client/opensles/rdpsnd_opensles.c | 135 +- channels/rdpsnd/client/oss/rdpsnd_oss.c | 39 +- channels/rdpsnd/client/proxy/rdpsnd_proxy.c | 14 +- channels/rdpsnd/client/pulse/rdpsnd_pulse.c | 89 +- channels/rdpsnd/client/rdpsnd_main.c | 275 +- channels/rdpsnd/client/rdpsnd_main.h | 5 +- channels/rdpsnd/client/winmm/rdpsnd_winmm.c | 82 +- channels/rdpsnd/server/rdpsnd_main.c | 196 +- channels/remdesk/client/remdesk_main.c | 234 +- channels/remdesk/server/remdesk_main.c | 165 +- channels/remdesk/server/remdesk_main.h | 1 - channels/serial/client/serial_main.c | 207 +- channels/server/channels.h | 2 - channels/smartcard/client/smartcard_main.c | 122 +- channels/smartcard/client/smartcard_main.h | 105 +- .../smartcard/client/smartcard_operations.c | 332 +- channels/smartcard/client/smartcard_pack.c | 1032 +- channels/smartcard/client/smartcard_pack.h | 76 +- channels/sshagent/client/sshagent_main.c | 86 +- channels/sshagent/client/sshagent_main.h | 6 +- channels/tsmf/client/alsa/tsmf_alsa.c | 58 +- channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c | 105 +- channels/tsmf/client/gstreamer/tsmf_X11.c | 99 +- .../tsmf/client/gstreamer/tsmf_gstreamer.c | 560 +- .../tsmf/client/gstreamer/tsmf_platform.h | 28 +- channels/tsmf/client/oss/tsmf_oss.c | 20 +- channels/tsmf/client/pulse/tsmf_pulse.c | 89 +- channels/tsmf/client/tsmf_audio.c | 6 +- channels/tsmf/client/tsmf_audio.h | 6 +- channels/tsmf/client/tsmf_codec.c | 353 +- channels/tsmf/client/tsmf_codec.h | 1 - channels/tsmf/client/tsmf_constants.h | 172 +- channels/tsmf/client/tsmf_decoder.c | 11 +- channels/tsmf/client/tsmf_decoder.h | 37 +- channels/tsmf/client/tsmf_ifman.c | 83 +- channels/tsmf/client/tsmf_ifman.h | 1 - channels/tsmf/client/tsmf_main.c | 136 +- channels/tsmf/client/tsmf_main.h | 4 +- channels/tsmf/client/tsmf_media.c | 272 +- channels/tsmf/client/tsmf_media.h | 17 +- channels/tsmf/client/tsmf_types.h | 6 +- channels/urbdrc/client/data_transfer.c | 1590 +- channels/urbdrc/client/data_transfer.h | 6 +- channels/urbdrc/client/isoch_queue.c | 25 +- channels/urbdrc/client/isoch_queue.h | 41 +- .../urbdrc/client/libusb/libusb_udevice.c | 540 +- .../urbdrc/client/libusb/libusb_udevice.h | 62 +- .../urbdrc/client/libusb/libusb_udevman.c | 131 +- channels/urbdrc/client/libusb/request_queue.c | 45 +- channels/urbdrc/client/libusb/request_queue.h | 31 +- channels/urbdrc/client/searchman.c | 30 +- channels/urbdrc/client/searchman.h | 25 +- channels/urbdrc/client/urbdrc_main.c | 314 +- channels/urbdrc/client/urbdrc_main.h | 140 +- channels/urbdrc/client/urbdrc_types.h | 415 +- channels/video/client/video_main.c | 341 +- channels/video/client/video_main.h | 2 - .../afreerdp/application/GlobalApp.java | 5 +- .../freerdpcore/application/GlobalApp.java | 277 +- .../application/NetworkStateReceiver.java | 59 +- .../application/ScreenReceiver.java | 27 +- .../freerdpcore/application/SessionState.java | 170 +- .../freerdpcore/domain/BookmarkBase.java | 1996 +- .../domain/ConnectionReference.java | 110 +- .../freerdpcore/domain/ManualBookmark.java | 379 +- .../domain/PlaceholderBookmark.java | 110 +- .../domain/QuickConnectBookmark.java | 88 +- .../presentation/AboutActivity.java | 155 +- .../ApplicationSettingsActivity.java | 427 +- .../presentation/BookmarkActivity.java | 1363 +- .../presentation/HelpActivity.java | 86 +- .../presentation/HomeActivity.java | 562 +- .../presentation/ScrollView2D.java | 2385 ++- .../presentation/SessionActivity.java | 2652 +-- .../freerdpcore/presentation/SessionView.java | 594 +- .../presentation/ShortcutsActivity.java | 219 +- .../presentation/TouchPointerView.java | 581 +- .../services/BookmarkBaseGateway.java | 1047 +- .../freerdpcore/services/BookmarkDB.java | 675 +- .../services/FreeRDPSuggestionProvider.java | 174 +- .../freerdpcore/services/HistoryDB.java | 52 +- .../freerdpcore/services/LibFreeRDP.java | 1094 +- .../services/ManualBookmarkGateway.java | 176 +- .../services/QuickConnectHistoryGateway.java | 155 +- .../SessionRequestHandlerActivity.java | 91 +- .../utils/AppCompatPreferenceActivity.java | 153 +- .../utils/BookmarkArrayAdapter.java | 168 +- .../freerdpcore/utils/ButtonPreference.java | 118 +- .../utils/ClipboardManagerProxy.java | 139 +- .../utils/DoubleGestureDetector.java | 560 +- .../freerdpcore/utils/GestureDetector.java | 1011 +- .../utils/IntEditTextPreference.java | 132 +- .../freerdpcore/utils/IntListPreference.java | 38 +- .../freerdpcore/utils/KeyboardMapper.java | 1232 +- .../com/freerdp/freerdpcore/utils/Mouse.java | 77 +- .../freerdpcore/utils/RDPFileParser.java | 142 +- .../utils/SeparatedListAdapter.java | 286 +- client/Android/android_cliprdr.c | 103 +- client/Android/android_cliprdr.h | 9 +- client/Android/android_event.c | 33 +- client/Android/android_event.h | 19 +- client/Android/android_freerdp.c | 363 +- client/Android/android_freerdp.h | 7 +- client/Android/android_freerdp_jni.h | 1 - client/Android/android_jni_callback.c | 29 +- client/Android/android_jni_callback.h | 11 +- client/Android/android_jni_utils.c | 46 +- client/Android/android_jni_utils.h | 13 +- client/Mac/CertificateDialog.h | 46 +- client/Mac/CertificateDialog.m | 46 +- client/Mac/Clipboard.m | 233 +- client/Mac/Keyboard.m | 79 +- client/Mac/MRDPCursor.h | 12 +- client/Mac/MRDPView.h | 90 +- client/Mac/MRDPView.m | 617 +- client/Mac/PasswordDialog.h | 36 +- client/Mac/PasswordDialog.m | 58 +- client/Mac/cli/AppDelegate.h | 14 +- client/Mac/cli/AppDelegate.m | 153 +- client/Mac/mf_client.h | 23 +- client/Mac/mf_client.m | 69 +- client/Mac/mfreerdp.h | 12 +- client/Sample/tf_channels.c | 26 +- client/Sample/tf_channels.h | 12 +- client/Sample/tf_freerdp.c | 30 +- client/Wayland/wlf_channels.c | 26 +- client/Wayland/wlf_channels.h | 12 +- client/Wayland/wlf_cliprdr.c | 165 +- client/Wayland/wlf_disp.c | 11 +- client/Wayland/wlf_input.c | 3 +- client/Wayland/wlf_input.h | 3 +- client/Wayland/wlf_pointer.c | 17 +- client/Wayland/wlfreerdp.c | 55 +- client/Wayland/wlfreerdp.h | 7 +- client/Windows/cli/wfreerdp.c | 11 +- client/Windows/resource.h | 22 +- client/Windows/wf_channels.c | 27 +- client/Windows/wf_channels.h | 6 +- client/Windows/wf_client.c | 307 +- client/Windows/wf_client.h | 147 +- client/Windows/wf_cliprdr.c | 580 +- client/Windows/wf_event.c | 421 +- client/Windows/wf_event.h | 8 +- client/Windows/wf_floatbar.c | 225 +- client/Windows/wf_gdi.c | 135 +- client/Windows/wf_gdi.h | 6 +- client/Windows/wf_graphics.c | 79 +- client/Windows/wf_graphics.h | 8 +- client/Windows/wf_rail.c | 402 +- client/X11/cli/xfreerdp.c | 2 +- client/X11/generate_argument_docbook.c | 28 +- client/X11/xf_channels.c | 26 +- client/X11/xf_client.c | 314 +- client/X11/xf_client.h | 12 +- client/X11/xf_cliprdr.c | 337 +- client/X11/xf_disp.c | 16 +- client/X11/xf_event.c | 143 +- client/X11/xf_floatbar.c | 85 +- client/X11/xf_gdi.c | 234 +- client/X11/xf_gfx.c | 87 +- client/X11/xf_gfx.h | 3 +- client/X11/xf_graphics.c | 114 +- client/X11/xf_input.c | 39 +- client/X11/xf_keyboard.c | 52 +- client/X11/xf_keyboard.h | 3 +- client/X11/xf_monitor.c | 154 +- client/X11/xf_rail.c | 229 +- client/X11/xf_rail.h | 10 +- client/X11/xf_tsmf.c | 76 +- client/X11/xf_video.c | 21 +- client/X11/xf_video.h | 1 - client/X11/xf_window.c | 342 +- client/X11/xf_window.h | 34 +- client/X11/xfreerdp.h | 1 - client/common/client.c | 122 +- client/common/cmdline.c | 354 +- client/common/cmdline.h | 12 +- client/common/compatibility.c | 232 +- client/common/compatibility.h | 4 +- client/common/file.c | 258 +- client/common/test/TestClientChannels.c | 20 +- client/common/test/TestClientCmdLine.c | 254 +- client/common/test/TestClientRdpFile.c | 487 +- client/iOS/Additions/OrderedDictionary.m | 25 +- client/iOS/Additions/TSXAdditions.h | 18 +- client/iOS/Additions/TSXAdditions.m | 271 +- client/iOS/Additions/Toast+UIView.h | 35 +- client/iOS/Additions/Toast+UIView.m | 526 +- client/iOS/AppDelegate.h | 18 +- client/iOS/AppDelegate.m | 133 +- client/iOS/Controllers/AboutController.h | 14 +- client/iOS/Controllers/AboutController.m | 129 +- .../AdvancedBookmarkEditorController.h | 17 +- .../AdvancedBookmarkEditorController.m | 506 +- .../iOS/Controllers/AppSettingsController.h | 9 +- .../iOS/Controllers/AppSettingsController.m | 441 +- .../Controllers/BookmarkEditorController.h | 34 +- .../Controllers/BookmarkEditorController.m | 415 +- .../BookmarkGatewaySettingsController.h | 15 +- .../BookmarkGatewaySettingsController.m | 180 +- .../iOS/Controllers/BookmarkListController.h | 70 +- .../iOS/Controllers/BookmarkListController.m | 1231 +- .../Controllers/CredentialsEditorController.h | 17 +- .../Controllers/CredentialsEditorController.m | 188 +- .../Controllers/CredentialsInputController.h | 36 +- .../Controllers/CredentialsInputController.m | 165 +- client/iOS/Controllers/EditorBaseController.h | 46 +- client/iOS/Controllers/EditorBaseController.m | 162 +- .../Controllers/EditorSelectionController.h | 30 +- .../Controllers/EditorSelectionController.m | 145 +- client/iOS/Controllers/EncryptionController.h | 17 +- client/iOS/Controllers/EncryptionController.m | 134 +- client/iOS/Controllers/HelpController.h | 11 +- client/iOS/Controllers/HelpController.m | 68 +- client/iOS/Controllers/MainTabBarController.h | 13 +- client/iOS/Controllers/MainTabBarController.m | 14 +- .../Controllers/PerformanceEditorController.h | 19 +- .../Controllers/PerformanceEditorController.m | 192 +- .../Controllers/RDPSessionViewController.h | 97 +- .../Controllers/RDPSessionViewController.m | 1354 +- .../Controllers/ScreenSelectionController.h | 33 +- .../Controllers/ScreenSelectionController.m | 317 +- .../Controllers/VerifyCertificateController.h | 30 +- .../Controllers/VerifyCertificateController.m | 79 +- client/iOS/FreeRDP/ios_freerdp.h | 50 +- client/iOS/FreeRDP/ios_freerdp.m | 132 +- client/iOS/FreeRDP/ios_freerdp_events.h | 22 +- client/iOS/FreeRDP/ios_freerdp_events.m | 128 +- client/iOS/FreeRDP/ios_freerdp_ui.h | 29 +- client/iOS/FreeRDP/ios_freerdp_ui.m | 150 +- client/iOS/Misc/Reachability.h | 56 +- client/iOS/Misc/Reachability.m | 168 +- client/iOS/Misc/SFHFKeychainUtils.h | 19 +- client/iOS/Misc/SFHFKeychainUtils.m | 593 +- client/iOS/Misc/TSXTypes.h | 38 +- client/iOS/Misc/Utils.h | 44 +- client/iOS/Misc/Utils.m | 196 +- client/iOS/Models/Bookmark.h | 44 +- client/iOS/Models/Bookmark.m | 229 +- client/iOS/Models/ConnectionParams.h | 55 +- client/iOS/Models/ConnectionParams.m | 152 +- client/iOS/Models/Encryptor.h | 31 +- client/iOS/Models/Encryptor.m | 178 +- client/iOS/Models/GlobalDefaults.h | 29 +- client/iOS/Models/GlobalDefaults.m | 29 +- client/iOS/Models/RDPKeyboard.h | 48 +- client/iOS/Models/RDPKeyboard.m | 296 +- client/iOS/Models/RDPSession.h | 107 +- client/iOS/Models/RDPSession.m | 173 +- client/iOS/Views/AdvancedKeyboardView.h | 50 +- client/iOS/Views/AdvancedKeyboardView.m | 535 +- client/iOS/Views/BlockAlertView.h | 25 +- client/iOS/Views/BlockAlertView.m | 736 +- client/iOS/Views/BlockBackground.h | 13 +- client/iOS/Views/BlockBackground.m | 319 +- client/iOS/Views/BlockUI.h | 82 +- client/iOS/Views/BookmarkTableCell.h | 25 +- client/iOS/Views/BookmarkTableCell.m | 37 +- client/iOS/Views/EditButtonTableViewCell.h | 17 +- client/iOS/Views/EditButtonTableViewCell.m | 24 +- client/iOS/Views/EditFlagTableViewCell.h | 17 +- client/iOS/Views/EditFlagTableViewCell.m | 24 +- .../iOS/Views/EditSecretTextTableViewCell.h | 19 +- .../iOS/Views/EditSecretTextTableViewCell.m | 63 +- client/iOS/Views/EditSelectionTableViewCell.h | 17 +- client/iOS/Views/EditSelectionTableViewCell.m | 24 +- client/iOS/Views/EditSubEditTableViewCell.h | 13 +- client/iOS/Views/EditSubEditTableViewCell.m | 24 +- client/iOS/Views/EditTextTableViewCell.h | 17 +- client/iOS/Views/EditTextTableViewCell.m | 24 +- client/iOS/Views/RDPSessionView.h | 13 +- client/iOS/Views/RDPSessionView.m | 55 +- client/iOS/Views/SessionTableCell.h | 32 +- client/iOS/Views/SessionTableCell.m | 46 +- client/iOS/Views/TouchPointerView.h | 82 +- client/iOS/Views/TouchPointerView.m | 473 +- client/iOS/main.m | 19 +- include/freerdp/addin.h | 55 +- include/freerdp/altsec.h | 60 +- include/freerdp/api.h | 31 +- include/freerdp/assistance.h | 45 +- include/freerdp/autodetect.h | 21 +- include/freerdp/cache/bitmap.h | 23 +- include/freerdp/cache/brush.h | 29 +- include/freerdp/cache/cache.h | 19 +- include/freerdp/cache/glyph.h | 9 +- include/freerdp/cache/nine_grid.h | 17 +- include/freerdp/cache/offscreen.h | 18 +- include/freerdp/cache/palette.h | 11 +- include/freerdp/cache/pointer.h | 11 +- include/freerdp/channels/audin.h | 3 - include/freerdp/channels/channels.h | 39 +- include/freerdp/channels/cliprdr.h | 78 +- include/freerdp/channels/disp.h | 32 +- include/freerdp/channels/encomsp.h | 54 +- include/freerdp/channels/geometry.h | 7 +- include/freerdp/channels/rail.h | 3 - include/freerdp/channels/rdpdr.h | 148 +- include/freerdp/channels/rdpei.h | 33 +- include/freerdp/channels/rdpgfx.h | 141 +- include/freerdp/channels/rdpsnd.h | 1 - include/freerdp/channels/remdesk.h | 127 +- include/freerdp/channels/tsmf.h | 2 +- include/freerdp/channels/video.h | 24 +- include/freerdp/channels/wtsvc.h | 56 +- include/freerdp/client.h | 153 +- include/freerdp/client/audin.h | 5 +- include/freerdp/client/channels.h | 17 +- include/freerdp/client/cliprdr.h | 65 +- include/freerdp/client/cmdline.h | 46 +- include/freerdp/client/disp.h | 9 +- include/freerdp/client/drdynvc.h | 16 +- include/freerdp/client/encomsp.h | 34 +- include/freerdp/client/file.h | 50 +- include/freerdp/client/geometry.h | 20 +- include/freerdp/client/rail.h | 105 +- include/freerdp/client/rdpei.h | 9 +- include/freerdp/client/rdpgfx.h | 123 +- include/freerdp/client/rdpsnd.h | 2 +- include/freerdp/client/remdesk.h | 1 - include/freerdp/client/sshagent.h | 11 +- include/freerdp/client/tsmf.h | 4 +- include/freerdp/client/video.h | 19 +- include/freerdp/codec/audio.h | 281 +- include/freerdp/codec/bitmap.h | 8 +- include/freerdp/codec/bulk.h | 15 +- include/freerdp/codec/clear.h | 24 +- include/freerdp/codec/color.h | 1682 +- include/freerdp/codec/dsp.h | 26 +- include/freerdp/codec/h264.h | 55 +- include/freerdp/codec/interleaved.h | 38 +- include/freerdp/codec/jpeg.h | 8 +- include/freerdp/codec/mppc.h | 17 +- include/freerdp/codec/ncrush.h | 16 +- include/freerdp/codec/nsc.h | 18 +- include/freerdp/codec/planar.h | 47 +- include/freerdp/codec/progressive.h | 32 +- include/freerdp/codec/region.h | 199 +- include/freerdp/codec/rfx.h | 275 +- include/freerdp/codec/xcrush.h | 16 +- include/freerdp/codec/yuv.h | 16 +- include/freerdp/codec/zgfx.h | 31 +- include/freerdp/codecs.h | 38 +- include/freerdp/constants.h | 32 +- include/freerdp/crypto/ber.h | 93 +- include/freerdp/crypto/certificate.h | 41 +- include/freerdp/crypto/crypto.h | 95 +- include/freerdp/crypto/der.h | 23 +- include/freerdp/crypto/er.h | 102 +- include/freerdp/crypto/per.h | 49 +- include/freerdp/crypto/tls.h | 71 +- include/freerdp/display.h | 7 +- include/freerdp/dvc.h | 57 +- include/freerdp/error.h | 447 +- include/freerdp/event.h | 155 +- include/freerdp/extension.h | 18 +- include/freerdp/freerdp.h | 739 +- include/freerdp/gdi/bitmap.h | 34 +- include/freerdp/gdi/dc.h | 17 +- include/freerdp/gdi/gdi.h | 640 +- include/freerdp/gdi/gfx.h | 16 +- include/freerdp/gdi/pen.h | 11 +- include/freerdp/gdi/region.h | 60 +- include/freerdp/gdi/shape.h | 20 +- include/freerdp/gdi/video.h | 1 - include/freerdp/graphics.h | 234 +- include/freerdp/input.h | 84 +- include/freerdp/license.h | 135 +- include/freerdp/listener.h | 60 +- include/freerdp/locale/keyboard.h | 330 +- include/freerdp/locale/locale.h | 409 +- include/freerdp/message.h | 516 +- include/freerdp/metrics.h | 13 +- include/freerdp/peer.h | 33 +- include/freerdp/pointer.h | 38 +- include/freerdp/primary.h | 86 +- include/freerdp/primitives.h | 277 +- include/freerdp/rail.h | 425 +- include/freerdp/scancode.h | 345 +- include/freerdp/secondary.h | 95 +- include/freerdp/server/audin.h | 20 +- include/freerdp/server/channels.h | 1 - include/freerdp/server/cliprdr.h | 72 +- include/freerdp/server/disp.h | 17 +- include/freerdp/server/drdynvc.h | 9 +- include/freerdp/server/echo.h | 16 +- include/freerdp/server/encomsp.h | 43 +- include/freerdp/server/rdpdr.h | 75 +- include/freerdp/server/rdpei.h | 32 +- include/freerdp/server/rdpgfx.h | 105 +- include/freerdp/server/rdpsnd.h | 36 +- include/freerdp/server/remdesk.h | 10 +- include/freerdp/server/shadow.h | 121 +- include/freerdp/session.h | 18 +- include/freerdp/settings.h | 1998 +- include/freerdp/svc.h | 28 +- include/freerdp/types.h | 4 +- include/freerdp/update.h | 60 +- include/freerdp/utils/msusb.h | 165 +- include/freerdp/utils/passphrase.h | 6 +- include/freerdp/utils/pcap.h | 39 +- include/freerdp/utils/profiler.h | 80 +- include/freerdp/utils/ringbuffer.h | 142 +- include/freerdp/utils/signal.h | 5 +- include/freerdp/utils/stopwatch.h | 18 +- include/freerdp/window.h | 216 +- libfreerdp/cache/bitmap.c | 116 +- libfreerdp/cache/bitmap.h | 6 +- libfreerdp/cache/brush.c | 30 +- libfreerdp/cache/brush.h | 2 +- libfreerdp/cache/cache.c | 12 +- libfreerdp/cache/cache.h | 8 +- libfreerdp/cache/glyph.c | 184 +- libfreerdp/cache/glyph.h | 4 +- libfreerdp/cache/nine_grid.c | 18 +- libfreerdp/cache/offscreen.c | 32 +- libfreerdp/cache/palette.c | 18 +- libfreerdp/cache/palette.h | 2 +- libfreerdp/cache/pointer.c | 71 +- libfreerdp/cache/pointer.h | 21 +- libfreerdp/codec/audio.c | 32 +- libfreerdp/codec/bitmap.c | 272 +- libfreerdp/codec/clear.c | 416 +- libfreerdp/codec/color.c | 349 +- libfreerdp/codec/dsp.c | 188 +- libfreerdp/codec/dsp_ffmpeg.c | 61 +- libfreerdp/codec/dsp_ffmpeg.h | 15 +- libfreerdp/codec/h264.c | 144 +- libfreerdp/codec/h264.h | 5 +- libfreerdp/codec/h264_ffmpeg.c | 93 +- libfreerdp/codec/h264_mf.c | 281 +- libfreerdp/codec/h264_openh264.c | 177 +- libfreerdp/codec/h264_x264.c | 54 +- libfreerdp/codec/include/bitmap.c | 54 +- libfreerdp/codec/interleaved.c | 167 +- libfreerdp/codec/jpeg.c | 18 +- libfreerdp/codec/mppc.c | 38 +- libfreerdp/codec/ncrush.c | 1688 +- libfreerdp/codec/nsc.c | 103 +- libfreerdp/codec/nsc_encode.c | 120 +- libfreerdp/codec/nsc_encode.h | 3 +- libfreerdp/codec/nsc_sse2.c | 253 +- libfreerdp/codec/nsc_types.h | 44 +- libfreerdp/codec/progressive.c | 663 +- libfreerdp/codec/progressive.h | 23 +- libfreerdp/codec/region.c | 88 +- libfreerdp/codec/rfx.c | 464 +- libfreerdp/codec/rfx_bitstream.h | 122 +- libfreerdp/codec/rfx_constants.h | 41 +- libfreerdp/codec/rfx_decode.c | 21 +- libfreerdp/codec/rfx_decode.h | 5 +- libfreerdp/codec/rfx_dwt.c | 27 +- libfreerdp/codec/rfx_encode.c | 55 +- libfreerdp/codec/rfx_encode.h | 1 - libfreerdp/codec/rfx_neon.c | 32 +- libfreerdp/codec/rfx_neon.h | 1 - libfreerdp/codec/rfx_quantization.c | 35 +- libfreerdp/codec/rfx_quantization.h | 10 +- libfreerdp/codec/rfx_rlgr.c | 161 +- libfreerdp/codec/rfx_rlgr.h | 4 +- libfreerdp/codec/rfx_sse2.c | 129 +- libfreerdp/codec/rfx_types.h | 5 +- libfreerdp/codec/test/TestFreeRDPCodecClear.c | 29 +- .../codec/test/TestFreeRDPCodecInterleaved.c | 32 +- libfreerdp/codec/test/TestFreeRDPCodecMppc.c | 77 +- .../codec/test/TestFreeRDPCodecNCrush.c | 14 +- .../codec/test/TestFreeRDPCodecPlanar.c | 7941 ++++--- .../codec/test/TestFreeRDPCodecProgressive.c | 511 +- .../codec/test/TestFreeRDPCodecRemoteFX.c | 1126 +- .../codec/test/TestFreeRDPCodecXCrush.c | 36 +- libfreerdp/codec/test/TestFreeRDPCodecZGfx.c | 38 +- libfreerdp/codec/test/TestFreeRDPRegion.c | 240 +- libfreerdp/codec/xcrush.c | 93 +- libfreerdp/codec/yuv.c | 31 +- libfreerdp/codec/zgfx.c | 111 +- libfreerdp/common/addin.c | 53 +- libfreerdp/common/assistance.c | 200 +- libfreerdp/common/settings.c | 97 +- libfreerdp/common/settings_getters.c | 36 +- libfreerdp/common/test/TestCommonAssistance.c | 33 +- libfreerdp/core/activation.c | 80 +- libfreerdp/core/activation.h | 24 +- libfreerdp/core/autodetect.c | 195 +- libfreerdp/core/autodetect.h | 25 +- libfreerdp/core/bulk.c | 45 +- libfreerdp/core/bulk.h | 12 +- libfreerdp/core/capabilities.c | 1408 +- libfreerdp/core/capabilities.h | 185 +- libfreerdp/core/certificate.c | 146 +- libfreerdp/core/certificate.h | 30 +- libfreerdp/core/channels.c | 144 +- libfreerdp/core/channels.h | 9 +- libfreerdp/core/client.c | 221 +- libfreerdp/core/client.h | 12 +- libfreerdp/core/codecs.c | 9 +- libfreerdp/core/connection.c | 224 +- libfreerdp/core/connection.h | 15 +- libfreerdp/core/display.c | 21 +- libfreerdp/core/display.h | 3 +- libfreerdp/core/errbase.c | 13 +- libfreerdp/core/errconnect.c | 75 +- libfreerdp/core/errinfo.c | 459 +- libfreerdp/core/fastpath.c | 211 +- libfreerdp/core/fastpath.h | 21 +- libfreerdp/core/freerdp.c | 135 +- libfreerdp/core/gateway/http.c | 38 +- libfreerdp/core/gateway/http.h | 39 +- libfreerdp/core/gateway/ncacn_http.c | 22 +- libfreerdp/core/gateway/ncacn_http.h | 6 +- libfreerdp/core/gateway/ntlm.c | 80 +- libfreerdp/core/gateway/ntlm.h | 11 +- libfreerdp/core/gateway/rdg.c | 283 +- libfreerdp/core/gateway/rdg.h | 5 +- libfreerdp/core/gateway/rpc.c | 121 +- libfreerdp/core/gateway/rpc.h | 268 +- libfreerdp/core/gateway/rpc_bind.c | 105 +- libfreerdp/core/gateway/rpc_bind.h | 9 +- libfreerdp/core/gateway/rpc_client.c | 125 +- libfreerdp/core/gateway/rpc_client.h | 9 +- libfreerdp/core/gateway/rpc_fault.c | 387 +- libfreerdp/core/gateway/rts.c | 210 +- libfreerdp/core/gateway/rts.h | 95 +- libfreerdp/core/gateway/rts_signature.c | 335 +- libfreerdp/core/gateway/rts_signature.h | 131 +- libfreerdp/core/gateway/tsg.c | 765 +- libfreerdp/core/gateway/tsg.h | 114 +- libfreerdp/core/gcc.c | 453 +- libfreerdp/core/gcc.h | 64 +- libfreerdp/core/graphics.c | 26 +- libfreerdp/core/heartbeat.c | 15 +- libfreerdp/core/info.c | 274 +- libfreerdp/core/info.h | 46 +- libfreerdp/core/input.c | 97 +- libfreerdp/core/license.c | 411 +- libfreerdp/core/license.h | 9 +- libfreerdp/core/listener.c | 62 +- libfreerdp/core/listener.h | 7 +- libfreerdp/core/mcs.c | 113 +- libfreerdp/core/message.c | 1216 +- libfreerdp/core/message.h | 9 +- libfreerdp/core/metrics.c | 7 +- libfreerdp/core/multitransport.c | 6 +- libfreerdp/core/nego.c | 107 +- libfreerdp/core/nego.h | 66 +- libfreerdp/core/nla.c | 448 +- libfreerdp/core/nla.h | 6 +- libfreerdp/core/orders.c | 1462 +- libfreerdp/core/orders.h | 399 +- libfreerdp/core/peer.c | 168 +- libfreerdp/core/peer.h | 1 - libfreerdp/core/proxy.c | 59 +- libfreerdp/core/proxy.h | 6 +- libfreerdp/core/rdp.c | 269 +- libfreerdp/core/rdp.h | 177 +- libfreerdp/core/redirection.c | 59 +- libfreerdp/core/redirection.h | 8 +- libfreerdp/core/security.c | 255 +- libfreerdp/core/security.h | 41 +- libfreerdp/core/server.c | 410 +- libfreerdp/core/server.h | 304 +- libfreerdp/core/settings.c | 379 +- libfreerdp/core/surface.c | 14 +- libfreerdp/core/surface.h | 8 +- libfreerdp/core/tcp.c | 145 +- libfreerdp/core/tcp.h | 43 +- libfreerdp/core/test/TestConnect.c | 32 +- libfreerdp/core/test/TestSettings.c | 1 - libfreerdp/core/test/TestVersion.c | 1 - .../core/test/settings_property_lists.h | 22 +- libfreerdp/core/timezone.c | 48 +- libfreerdp/core/timezone.h | 8 +- libfreerdp/core/tpdu.c | 15 +- libfreerdp/core/tpdu.h | 16 +- libfreerdp/core/tpkt.c | 4 +- libfreerdp/core/tpkt.h | 2 +- libfreerdp/core/transport.c | 162 +- libfreerdp/core/transport.h | 30 +- libfreerdp/core/update.c | 511 +- libfreerdp/core/update.h | 14 +- libfreerdp/core/window.c | 239 +- libfreerdp/core/window.h | 8 +- libfreerdp/crypto/base64.c | 38 +- libfreerdp/crypto/ber.c | 32 +- libfreerdp/crypto/certificate.c | 159 +- libfreerdp/crypto/crypto.c | 117 +- libfreerdp/crypto/der.c | 1 - libfreerdp/crypto/er.c | 6 +- libfreerdp/crypto/opensslcompat.h | 36 +- libfreerdp/crypto/per.c | 15 +- libfreerdp/crypto/test/TestBase64.c | 25 +- libfreerdp/crypto/test/TestKnownHosts.c | 37 +- libfreerdp/crypto/test/Test_x509_cert_info.c | 92 +- libfreerdp/crypto/tls.c | 244 +- libfreerdp/gdi/bitmap.c | 134 +- libfreerdp/gdi/brush.c | 27 +- libfreerdp/gdi/brush.h | 23 +- libfreerdp/gdi/clipping.c | 12 +- libfreerdp/gdi/clipping.h | 15 +- libfreerdp/gdi/dc.c | 30 +- libfreerdp/gdi/drawing.c | 1 - libfreerdp/gdi/drawing.h | 17 +- libfreerdp/gdi/gdi.c | 904 +- libfreerdp/gdi/gdi.h | 44 +- libfreerdp/gdi/gfx.c | 332 +- libfreerdp/gdi/graphics.c | 110 +- libfreerdp/gdi/graphics.h | 5 +- libfreerdp/gdi/line.c | 5 +- libfreerdp/gdi/line.h | 16 +- libfreerdp/gdi/pen.c | 6 +- libfreerdp/gdi/region.c | 66 +- libfreerdp/gdi/shape.c | 38 +- libfreerdp/gdi/test/TestGdiBitBlt.c | 199 +- libfreerdp/gdi/test/TestGdiClip.c | 21 +- libfreerdp/gdi/test/TestGdiCreate.c | 67 +- libfreerdp/gdi/test/TestGdiEllipse.c | 61 +- libfreerdp/gdi/test/TestGdiLine.c | 192 +- libfreerdp/gdi/test/TestGdiRect.c | 10 +- libfreerdp/gdi/test/TestGdiRop3.c | 48 +- libfreerdp/gdi/test/helpers.c | 25 +- libfreerdp/gdi/test/helpers.h | 10 +- libfreerdp/gdi/video.c | 29 +- libfreerdp/locale/keyboard.c | 19 +- libfreerdp/locale/keyboard_layout.c | 321 +- libfreerdp/locale/keyboard_sun.c | 295 +- libfreerdp/locale/keyboard_x11.c | 7 +- libfreerdp/locale/keyboard_x11.h | 3 +- libfreerdp/locale/keyboard_xkbfile.c | 327 +- libfreerdp/locale/keyboard_xkbfile.h | 7 +- libfreerdp/locale/liblocale.h | 10 +- libfreerdp/locale/locale.c | 749 +- libfreerdp/locale/xkb_layout_ids.c | 1223 +- libfreerdp/locale/xkb_layout_ids.h | 3 +- libfreerdp/primitives/prim_YCoCg.c | 24 +- libfreerdp/primitives/prim_YCoCg_opt.c | 212 +- libfreerdp/primitives/prim_YUV.c | 298 +- libfreerdp/primitives/prim_YUV_neon.c | 112 +- libfreerdp/primitives/prim_YUV_ssse3.c | 491 +- libfreerdp/primitives/prim_add.c | 18 +- libfreerdp/primitives/prim_add_opt.c | 17 +- libfreerdp/primitives/prim_alphaComp.c | 27 +- libfreerdp/primitives/prim_alphaComp_opt.c | 63 +- libfreerdp/primitives/prim_andor.c | 17 +- libfreerdp/primitives/prim_andor_opt.c | 23 +- libfreerdp/primitives/prim_colors.c | 158 +- libfreerdp/primitives/prim_colors_opt.c | 600 +- libfreerdp/primitives/prim_copy.c | 93 +- libfreerdp/primitives/prim_internal.h | 40 +- libfreerdp/primitives/prim_set.c | 47 +- libfreerdp/primitives/prim_set_opt.c | 149 +- libfreerdp/primitives/prim_shift.c | 87 +- libfreerdp/primitives/prim_shift_opt.c | 34 +- libfreerdp/primitives/prim_sign.c | 8 +- libfreerdp/primitives/prim_sign_opt.c | 63 +- libfreerdp/primitives/prim_templates.h | 749 +- libfreerdp/primitives/primitives.c | 2 - .../primitives/test/TestPrimitivesAdd.c | 12 +- .../primitives/test/TestPrimitivesAlphaComp.c | 75 +- .../primitives/test/TestPrimitivesAndOr.c | 49 +- .../primitives/test/TestPrimitivesColors.c | 57 +- .../primitives/test/TestPrimitivesCopy.c | 21 +- .../primitives/test/TestPrimitivesSet.c | 27 +- .../primitives/test/TestPrimitivesShift.c | 48 +- .../primitives/test/TestPrimitivesSign.c | 12 +- .../primitives/test/TestPrimitivesYCbCr.c | 2578 +-- .../primitives/test/TestPrimitivesYCoCg.c | 33 +- .../primitives/test/TestPrimitivesYUV.c | 112 +- libfreerdp/primitives/test/measure.h | 121 +- libfreerdp/primitives/test/prim_test.c | 45 +- libfreerdp/primitives/test/prim_test.h | 5 +- libfreerdp/utils/msusb.c | 130 +- libfreerdp/utils/passphrase.c | 36 +- libfreerdp/utils/pcap.c | 23 +- libfreerdp/utils/profiler.c | 18 +- libfreerdp/utils/ringbuffer.c | 30 +- libfreerdp/utils/signal.c | 38 +- libfreerdp/utils/stopwatch.c | 12 +- libfreerdp/utils/test/TestRingBuffer.c | 35 +- rdtk/include/rdtk/api.h | 36 +- rdtk/include/rdtk/rdtk.h | 44 +- rdtk/librdtk/rdtk_button.c | 5 +- rdtk/librdtk/rdtk_button.h | 12 +- rdtk/librdtk/rdtk_engine.c | 2 +- rdtk/librdtk/rdtk_engine.h | 6 +- rdtk/librdtk/rdtk_font.c | 33 +- rdtk/librdtk/rdtk_font.h | 14 +- rdtk/librdtk/rdtk_label.c | 4 +- rdtk/librdtk/rdtk_label.h | 12 +- rdtk/librdtk/rdtk_nine_patch.c | 54 +- rdtk/librdtk/rdtk_nine_patch.h | 17 +- rdtk/librdtk/rdtk_resources.c | 2220 +- rdtk/librdtk/rdtk_resources.h | 6 +- rdtk/librdtk/rdtk_surface.c | 9 +- rdtk/librdtk/rdtk_surface.h | 1 - rdtk/librdtk/rdtk_text_field.c | 4 +- rdtk/librdtk/rdtk_text_field.h | 12 +- rdtk/librdtk/test/TestRdTkNinePatch.c | 11 +- rdtk/sample/rdtk_x11.c | 13 +- resources/FreeRDP_Icon_256px.h | 17558 ++++++++-------- scripts/LECHash.c | 61 +- scripts/LOMHash.c | 22 +- server/Mac/mf_audin.c | 2 +- server/Mac/mf_audin.h | 2 - server/Mac/mf_event.c | 81 +- server/Mac/mf_event.h | 2 +- server/Mac/mf_info.c | 76 +- server/Mac/mf_info.h | 5 +- server/Mac/mf_input.c | 544 +- server/Mac/mf_input.h | 2 +- server/Mac/mf_interface.h | 19 +- server/Mac/mf_mountain_lion.c | 267 +- server/Mac/mf_mountain_lion.h | 3 +- server/Mac/mf_peer.c | 79 +- server/Mac/mf_rdpsnd.c | 84 +- server/Mac/mf_rdpsnd.h | 38 +- server/Mac/mfreerdp.c | 8 +- server/Sample/sf_audin.c | 11 +- server/Sample/sf_audin.h | 1 - server/Sample/sf_rdpsnd.c | 4 +- server/Sample/sf_rdpsnd.h | 1 - server/Sample/sfreerdp.c | 156 +- server/Sample/sfreerdp.h | 1 - server/Windows/cli/wfreerdp.c | 11 +- server/Windows/wf_directsound.c | 43 +- server/Windows/wf_dxgi.c | 91 +- server/Windows/wf_dxgi.h | 1 - server/Windows/wf_info.c | 82 +- server/Windows/wf_info.h | 3 +- server/Windows/wf_input.c | 20 +- server/Windows/wf_input.h | 2 +- server/Windows/wf_interface.c | 24 +- server/Windows/wf_interface.h | 44 +- server/Windows/wf_mirage.c | 44 +- server/Windows/wf_mirage.h | 52 +- server/Windows/wf_peer.c | 83 +- server/Windows/wf_rdpsnd.c | 11 +- server/Windows/wf_rdpsnd.h | 2 - server/Windows/wf_settings.c | 10 +- server/Windows/wf_update.c | 80 +- server/Windows/wf_wasapi.c | 94 +- server/Windows/wf_wasapi.h | 2 +- server/common/server.c | 90 +- server/proxy/freerdp_proxy.c | 1 - server/proxy/modules/demo/demo.c | 6 +- server/proxy/pf_capture.c | 30 +- server/proxy/pf_channels.c | 27 +- server/proxy/pf_channels.h | 6 +- server/proxy/pf_client.c | 54 +- server/proxy/pf_cliprdr.c | 135 +- server/proxy/pf_cliprdr.h | 3 +- server/proxy/pf_config.c | 19 +- server/proxy/pf_config.h | 6 +- server/proxy/pf_context.c | 54 +- server/proxy/pf_context.h | 7 +- server/proxy/pf_disp.c | 17 +- server/proxy/pf_disp.h | 2 +- server/proxy/pf_gdi.c | 20 +- server/proxy/pf_graphics.c | 21 +- server/proxy/pf_input.c | 3 +- server/proxy/pf_modules.c | 32 +- server/proxy/pf_rdpgfx.c | 130 +- server/proxy/pf_server.c | 63 +- server/proxy/pf_update.c | 43 +- server/shadow/Mac/mac_shadow.c | 293 +- server/shadow/Mac/mac_shadow.h | 5 +- server/shadow/Win/win_dxgi.c | 348 +- server/shadow/Win/win_dxgi.h | 15 +- server/shadow/Win/win_rdp.c | 71 +- server/shadow/Win/win_rdp.h | 11 +- server/shadow/Win/win_shadow.c | 60 +- server/shadow/Win/win_shadow.h | 5 +- server/shadow/Win/win_wds.c | 331 +- server/shadow/Win/win_wds.h | 11 +- server/shadow/X11/x11_shadow.c | 177 +- server/shadow/X11/x11_shadow.h | 5 +- server/shadow/shadow.c | 3 +- server/shadow/shadow.h | 6 +- server/shadow/shadow_audin.c | 2 +- server/shadow/shadow_audin.h | 7 +- server/shadow/shadow_capture.c | 13 +- server/shadow/shadow_capture.h | 7 +- server/shadow/shadow_channels.h | 7 +- server/shadow/shadow_client.c | 470 +- server/shadow/shadow_client.h | 7 +- server/shadow/shadow_encoder.c | 61 +- server/shadow/shadow_encoder.h | 13 +- server/shadow/shadow_encomsp.c | 17 +- server/shadow/shadow_encomsp.h | 7 +- server/shadow/shadow_input.c | 13 +- server/shadow/shadow_input.h | 5 +- server/shadow/shadow_lobby.c | 10 +- server/shadow/shadow_lobby.h | 5 +- server/shadow/shadow_mcevent.c | 37 +- server/shadow/shadow_mcevent.h | 27 +- server/shadow/shadow_rdpgfx.h | 7 +- server/shadow/shadow_rdpsnd.h | 7 +- server/shadow/shadow_remdesk.c | 5 +- server/shadow/shadow_remdesk.h | 7 +- server/shadow/shadow_screen.c | 8 +- server/shadow/shadow_screen.h | 7 +- server/shadow/shadow_server.c | 145 +- server/shadow/shadow_subsystem.c | 28 +- server/shadow/shadow_subsystem.h | 16 +- server/shadow/shadow_subsystem_builtin.c | 3 +- server/shadow/shadow_surface.c | 16 +- server/shadow/shadow_surface.h | 10 +- uwac/include/uwac/uwac-tools.h | 10 +- uwac/include/uwac/uwac.h | 580 +- uwac/libuwac/uwac-clipboard.c | 36 +- uwac/libuwac/uwac-display.c | 115 +- uwac/libuwac/uwac-input.c | 473 +- uwac/libuwac/uwac-os.c | 3 +- uwac/libuwac/uwac-os.h | 2 +- uwac/libuwac/uwac-output.c | 76 +- uwac/libuwac/uwac-priv.h | 153 +- uwac/libuwac/uwac-tools.c | 101 +- uwac/libuwac/uwac-utils.c | 20 +- uwac/libuwac/uwac-utils.h | 33 +- uwac/libuwac/uwac-window.c | 128 +- winpr/include/winpr/asn1.h | 953 +- winpr/include/winpr/bcrypt.h | 161 +- winpr/include/winpr/bitstream.h | 217 +- winpr/include/winpr/clipboard.h | 67 +- winpr/include/winpr/cmdline.h | 132 +- winpr/include/winpr/collections.h | 968 +- winpr/include/winpr/comm.h | 725 +- winpr/include/winpr/credentials.h | 245 +- winpr/include/winpr/credui.h | 150 +- winpr/include/winpr/crt.h | 72 +- winpr/include/winpr/crypto.h | 992 +- winpr/include/winpr/debug.h | 18 +- winpr/include/winpr/dsparse.h | 37 +- winpr/include/winpr/endian.h | 221 +- winpr/include/winpr/environment.h | 117 +- winpr/include/winpr/error.h | 5812 ++--- winpr/include/winpr/file.h | 589 +- winpr/include/winpr/handle.h | 35 +- winpr/include/winpr/heap.h | 20 +- winpr/include/winpr/image.h | 20 +- winpr/include/winpr/ini.h | 31 +- winpr/include/winpr/input.h | 1420 +- winpr/include/winpr/interlocked.h | 202 +- winpr/include/winpr/intrin.h | 46 +- winpr/include/winpr/io.h | 244 +- winpr/include/winpr/library.h | 79 +- winpr/include/winpr/locale.h | 855 +- winpr/include/winpr/memory.h | 40 +- winpr/include/winpr/midl.h | 7 +- winpr/include/winpr/ndr.h | 337 +- winpr/include/winpr/nt.h | 2510 +-- winpr/include/winpr/ntlm.h | 45 +- winpr/include/winpr/pack.h | 73 +- winpr/include/winpr/path.h | 395 +- winpr/include/winpr/pipe.h | 112 +- winpr/include/winpr/platform.h | 88 +- winpr/include/winpr/pool.h | 183 +- winpr/include/winpr/print.h | 21 +- winpr/include/winpr/registry.h | 385 +- winpr/include/winpr/rpc.h | 841 +- winpr/include/winpr/sam.h | 18 +- winpr/include/winpr/schannel.h | 248 +- winpr/include/winpr/security.h | 220 +- winpr/include/winpr/shell.h | 46 +- winpr/include/winpr/smartcard.h | 1207 +- winpr/include/winpr/spec.h | 211 +- winpr/include/winpr/ssl.h | 16 +- winpr/include/winpr/sspi.h | 970 +- winpr/include/winpr/sspicli.h | 83 +- winpr/include/winpr/stream.h | 566 +- winpr/include/winpr/string.h | 189 +- winpr/include/winpr/strlst.h | 12 +- winpr/include/winpr/synch.h | 477 +- winpr/include/winpr/sysinfo.h | 484 +- winpr/include/winpr/tchar.h | 48 +- winpr/include/winpr/thread.h | 297 +- winpr/include/winpr/timezone.h | 98 +- winpr/include/winpr/tools/makecert.h | 17 +- winpr/include/winpr/user.h | 142 +- winpr/include/winpr/windows.h | 98 +- winpr/include/winpr/winhttp.h | 907 +- winpr/include/winpr/winpr.h | 11 +- winpr/include/winpr/winsock.h | 310 +- winpr/include/winpr/wlog.h | 255 +- winpr/include/winpr/wnd.h | 780 +- winpr/include/winpr/wtsapi.h | 1149 +- winpr/libwinpr/asn1/asn1.c | 51 +- winpr/libwinpr/asn1/test/TestAsn1BerDec.c | 1 - winpr/libwinpr/asn1/test/TestAsn1BerEnc.c | 1 - winpr/libwinpr/asn1/test/TestAsn1Compare.c | 1 - winpr/libwinpr/asn1/test/TestAsn1Decode.c | 1 - winpr/libwinpr/asn1/test/TestAsn1Decoder.c | 1 - winpr/libwinpr/asn1/test/TestAsn1DerDec.c | 1 - winpr/libwinpr/asn1/test/TestAsn1DerEnc.c | 1 - winpr/libwinpr/asn1/test/TestAsn1Encode.c | 1 - winpr/libwinpr/asn1/test/TestAsn1Encoder.c | 1 - winpr/libwinpr/asn1/test/TestAsn1Integer.c | 1 - winpr/libwinpr/asn1/test/TestAsn1Module.c | 1 - winpr/libwinpr/asn1/test/TestAsn1String.c | 1 - winpr/libwinpr/bcrypt/bcrypt.c | 35 +- winpr/libwinpr/clipboard/clipboard.c | 88 +- winpr/libwinpr/clipboard/posix.c | 47 +- winpr/libwinpr/clipboard/synthetic.c | 141 +- .../clipboard/test/TestClipboardFormats.c | 14 +- winpr/libwinpr/com/com.c | 1 - winpr/libwinpr/com/test/TestComReference.c | 1 - winpr/libwinpr/comm/comm.c | 218 +- winpr/libwinpr/comm/comm.h | 35 +- winpr/libwinpr/comm/comm_io.c | 124 +- winpr/libwinpr/comm/comm_ioctl.c | 115 +- winpr/libwinpr/comm/comm_ioctl.h | 332 +- winpr/libwinpr/comm/comm_sercx2_sys.c | 120 +- winpr/libwinpr/comm/comm_sercx2_sys.h | 5 +- winpr/libwinpr/comm/comm_sercx_sys.c | 152 +- winpr/libwinpr/comm/comm_sercx_sys.h | 7 +- winpr/libwinpr/comm/comm_serial_sys.c | 511 +- winpr/libwinpr/comm/comm_serial_sys.h | 6 +- winpr/libwinpr/comm/test/TestCommConfig.c | 47 +- winpr/libwinpr/comm/test/TestCommDevice.c | 28 +- winpr/libwinpr/comm/test/TestCommMonitor.c | 12 +- .../libwinpr/comm/test/TestControlSettings.c | 8 +- winpr/libwinpr/comm/test/TestGetCommState.c | 11 +- winpr/libwinpr/comm/test/TestHandflow.c | 6 +- winpr/libwinpr/comm/test/TestSerialChars.c | 24 +- winpr/libwinpr/comm/test/TestSetCommState.c | 38 +- winpr/libwinpr/comm/test/TestTimeouts.c | 27 +- winpr/libwinpr/credentials/credentials.c | 42 +- winpr/libwinpr/credui/credui.c | 30 +- .../TestCredUICmdLinePromptForCredentials.c | 11 +- .../test/TestCredUIConfirmCredentials.c | 1 - .../credui/test/TestCredUIParseUserName.c | 13 +- .../test/TestCredUIPromptForCredentials.c | 21 +- winpr/libwinpr/crt/alignment.c | 10 +- winpr/libwinpr/crt/casing.c | 1729 +- winpr/libwinpr/crt/conversion.c | 1 - winpr/libwinpr/crt/string.c | 30 +- winpr/libwinpr/crt/test/TestAlignment.c | 30 +- .../libwinpr/crt/test/TestFormatSpecifiers.c | 99 +- winpr/libwinpr/crt/test/TestString.c | 44 +- winpr/libwinpr/crt/test/TestTypes.c | 92 +- .../libwinpr/crt/test/TestUnicodeConversion.c | 210 +- winpr/libwinpr/crt/unicode.c | 96 +- winpr/libwinpr/crt/utf.c | 112 +- winpr/libwinpr/crt/utf.h | 66 +- winpr/libwinpr/crypto/cert.c | 24 +- winpr/libwinpr/crypto/cipher.c | 55 +- winpr/libwinpr/crypto/crypto.c | 41 +- winpr/libwinpr/crypto/hash.c | 56 +- .../TestCryptoCertEnumCertificatesInStore.c | 18 +- winpr/libwinpr/crypto/test/TestCryptoCipher.c | 58 +- winpr/libwinpr/crypto/test/TestCryptoHash.c | 37 +- .../crypto/test/TestCryptoProtectData.c | 1 - .../crypto/test/TestCryptoProtectMemory.c | 8 +- winpr/libwinpr/crypto/test/TestCryptoRand.c | 2 +- winpr/libwinpr/dsparse/dsparse.c | 16 +- .../libwinpr/dsparse/test/TestDsCrackNames.c | 3 +- winpr/libwinpr/dsparse/test/TestDsMakeSpn.c | 6 +- winpr/libwinpr/environment/environment.c | 79 +- .../TestEnvironmentGetEnvironmentStrings.c | 3 +- .../test/TestEnvironmentGetSetEB.c | 5 +- .../TestEnvironmentMergeEnvironmentStrings.c | 3 +- .../TestEnvironmentSetEnvironmentVariable.c | 3 +- winpr/libwinpr/error/error.c | 8 +- .../error/test/TestErrorSetLastError.c | 25 +- winpr/libwinpr/file/file.c | 475 +- winpr/libwinpr/file/file.h | 3 +- winpr/libwinpr/file/generic.c | 92 +- winpr/libwinpr/file/namedPipeClient.c | 37 +- winpr/libwinpr/file/pattern.c | 37 +- winpr/libwinpr/file/test/TestFileCreateFile.c | 11 +- .../file/test/TestFileFindFirstFile.c | 8 +- .../file/test/TestFileFindFirstFileEx.c | 1 - .../libwinpr/file/test/TestFileFindNextFile.c | 18 +- .../libwinpr/file/test/TestFileGetStdHandle.c | 2 +- .../libwinpr/file/test/TestFilePatternMatch.c | 11 +- winpr/libwinpr/handle/handle.c | 7 +- winpr/libwinpr/handle/handle.h | 83 +- winpr/libwinpr/handle/nonehandle.c | 49 +- winpr/libwinpr/input/keycode.c | 1038 +- winpr/libwinpr/input/scancode.c | 584 +- winpr/libwinpr/input/virtualkey.c | 234 +- winpr/libwinpr/interlocked/interlocked.c | 117 +- .../interlocked/test/TestInterlockedAccess.c | 51 +- .../interlocked/test/TestInterlockedDList.c | 12 +- .../interlocked/test/TestInterlockedSList.c | 12 +- winpr/libwinpr/io/device.c | 21 +- winpr/libwinpr/io/io.c | 51 +- winpr/libwinpr/io/io.h | 1 - winpr/libwinpr/io/test/TestIoDevice.c | 5 +- winpr/libwinpr/library/library.c | 7 +- .../test/TestLibraryGetModuleFileName.c | 20 +- .../library/test/TestLibraryGetProcAddress.c | 10 +- .../library/test/TestLibraryLoadLibrary.c | 6 +- winpr/libwinpr/locale/locale.c | 5 +- .../locale/test/TestLocaleFormatMessage.c | 1 - winpr/libwinpr/memory/memory.c | 9 +- winpr/libwinpr/memory/memory.h | 4 - .../memory/test/TestMemoryCreateFileMapping.c | 1 - winpr/libwinpr/nt/nt.c | 206 +- winpr/libwinpr/nt/test/TestNtCreateFile.c | 13 +- winpr/libwinpr/nt/test/TestNtCurrentTeb.c | 1 - .../libwinpr/path/include/PathAllocCombine.c | 16 +- .../path/include/PathCchAddExtension.c | 1 - .../path/include/PathCchAddSeparator.c | 1 - .../path/include/PathCchAddSeparatorEx.c | 7 +- winpr/libwinpr/path/include/PathCchAppend.c | 15 +- winpr/libwinpr/path/path.c | 290 +- winpr/libwinpr/path/shell.c | 97 +- winpr/libwinpr/path/shell_ios.h | 1 - winpr/libwinpr/path/shell_ios.m | 21 +- .../path/test/TestPathAllocCanonicalize.c | 1 - .../libwinpr/path/test/TestPathAllocCombine.c | 15 +- .../path/test/TestPathCchAddBackslash.c | 15 +- .../path/test/TestPathCchAddBackslashEx.c | 17 +- .../path/test/TestPathCchAddExtension.c | 34 +- winpr/libwinpr/path/test/TestPathCchAppend.c | 28 +- .../libwinpr/path/test/TestPathCchAppendEx.c | 1 - .../path/test/TestPathCchCanonicalize.c | 1 - .../path/test/TestPathCchCanonicalizeEx.c | 1 - winpr/libwinpr/path/test/TestPathCchCombine.c | 1 - .../libwinpr/path/test/TestPathCchCombineEx.c | 1 - .../path/test/TestPathCchFindExtension.c | 32 +- winpr/libwinpr/path/test/TestPathCchIsRoot.c | 1 - .../path/test/TestPathCchRemoveBackslash.c | 1 - .../path/test/TestPathCchRemoveBackslashEx.c | 1 - .../path/test/TestPathCchRemoveExtension.c | 1 - .../path/test/TestPathCchRemoveFileSpec.c | 1 - .../path/test/TestPathCchRenameExtension.c | 1 - .../libwinpr/path/test/TestPathCchSkipRoot.c | 1 - .../path/test/TestPathCchStripPrefix.c | 31 +- .../path/test/TestPathCchStripToRoot.c | 1 - winpr/libwinpr/path/test/TestPathIsUNCEx.c | 9 +- winpr/libwinpr/path/test/TestPathMakePath.c | 1 - winpr/libwinpr/path/test/TestPathShell.c | 29 +- winpr/libwinpr/pipe/pipe.c | 176 +- winpr/libwinpr/pipe/pipe.h | 9 +- .../pipe/test/TestPipeCreateNamedPipe.c | 130 +- .../test/TestPipeCreateNamedPipeOverlapped.c | 98 +- winpr/libwinpr/pipe/test/TestPipeCreatePipe.c | 12 +- winpr/libwinpr/pool/callback.c | 4 +- winpr/libwinpr/pool/callback_cleanup.c | 35 +- winpr/libwinpr/pool/cleanup_group.c | 24 +- winpr/libwinpr/pool/io.c | 7 +- winpr/libwinpr/pool/pool.c | 29 +- winpr/libwinpr/pool/pool.h | 1 - winpr/libwinpr/pool/synch.c | 3 - winpr/libwinpr/pool/test/TestPoolIO.c | 1 - winpr/libwinpr/pool/test/TestPoolSynch.c | 1 - winpr/libwinpr/pool/test/TestPoolTimer.c | 1 - winpr/libwinpr/pool/test/TestPoolWork.c | 17 +- winpr/libwinpr/pool/timer.c | 6 +- winpr/libwinpr/pool/work.c | 27 +- winpr/libwinpr/registry/registry.c | 94 +- winpr/libwinpr/registry/registry_reg.c | 70 +- winpr/libwinpr/registry/registry_reg.h | 5 +- winpr/libwinpr/rpc/midl.c | 2 +- winpr/libwinpr/rpc/ndr.c | 64 +- winpr/libwinpr/rpc/ndr_array.c | 17 +- winpr/libwinpr/rpc/ndr_array.h | 15 +- winpr/libwinpr/rpc/ndr_context.c | 3 +- winpr/libwinpr/rpc/ndr_context.h | 3 +- winpr/libwinpr/rpc/ndr_correlation.c | 47 +- winpr/libwinpr/rpc/ndr_correlation.h | 9 +- winpr/libwinpr/rpc/ndr_pointer.c | 42 +- winpr/libwinpr/rpc/ndr_pointer.h | 15 +- winpr/libwinpr/rpc/ndr_private.c | 755 +- winpr/libwinpr/rpc/ndr_simple.c | 23 +- winpr/libwinpr/rpc/ndr_simple.h | 11 +- winpr/libwinpr/rpc/ndr_string.c | 7 +- winpr/libwinpr/rpc/ndr_string.h | 6 +- winpr/libwinpr/rpc/ndr_structure.c | 34 +- winpr/libwinpr/rpc/ndr_structure.h | 12 +- winpr/libwinpr/rpc/ndr_union.c | 6 +- winpr/libwinpr/rpc/ndr_union.h | 6 +- winpr/libwinpr/rpc/rpc.c | 425 +- winpr/libwinpr/security/security.c | 30 +- .../security/test/TestSecurityToken.c | 1 - winpr/libwinpr/shell/shell.c | 7 +- winpr/libwinpr/smartcard/smartcard.c | 318 +- winpr/libwinpr/smartcard/smartcard_inspect.c | 930 +- winpr/libwinpr/smartcard/smartcard_pcsc.c | 779 +- winpr/libwinpr/smartcard/smartcard_pcsc.h | 113 +- winpr/libwinpr/smartcard/smartcard_winscard.c | 5 +- winpr/libwinpr/smartcard/smartcard_winscard.h | 2 +- .../smartcard/test/TestSmartCardListReaders.c | 9 +- .../smartcard/test/TestSmartCardStatus.c | 16 +- winpr/libwinpr/sspi/CredSSP/credssp.c | 225 +- winpr/libwinpr/sspi/CredSSP/credssp.h | 1 - winpr/libwinpr/sspi/Kerberos/kerberos.c | 304 +- winpr/libwinpr/sspi/NTLM/ntlm.c | 404 +- winpr/libwinpr/sspi/NTLM/ntlm.h | 88 +- winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.c | 115 +- winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.h | 4 +- winpr/libwinpr/sspi/NTLM/ntlm_compute.c | 151 +- winpr/libwinpr/sspi/NTLM/ntlm_message.c | 269 +- winpr/libwinpr/sspi/Negotiate/negotiate.c | 350 +- winpr/libwinpr/sspi/Negotiate/negotiate.h | 3 +- winpr/libwinpr/sspi/Schannel/schannel.c | 281 +- winpr/libwinpr/sspi/Schannel/schannel.h | 1 - .../libwinpr/sspi/Schannel/schannel_openssl.c | 37 +- .../libwinpr/sspi/Schannel/schannel_openssl.h | 16 +- winpr/libwinpr/sspi/sspi.c | 297 +- winpr/libwinpr/sspi/sspi.h | 62 +- winpr/libwinpr/sspi/sspi_export.c | 130 +- winpr/libwinpr/sspi/sspi_gss.c | 751 +- winpr/libwinpr/sspi/sspi_gss.h | 1232 +- winpr/libwinpr/sspi/sspi_winpr.c | 451 +- .../sspi/test/TestAcquireCredentialsHandle.c | 14 +- .../sspi/test/TestEnumerateSecurityPackages.c | 7 +- .../sspi/test/TestInitializeSecurityContext.c | 26 +- winpr/libwinpr/sspi/test/TestNTLM.c | 121 +- .../sspi/test/TestQuerySecurityPackageInfo.c | 1 - winpr/libwinpr/sspi/test/TestSchannel.c | 598 +- winpr/libwinpr/sspicli/sspicli.c | 76 +- winpr/libwinpr/synch/address.c | 5 +- winpr/libwinpr/synch/barrier.c | 32 +- winpr/libwinpr/synch/condition.c | 9 +- winpr/libwinpr/synch/critical.c | 26 +- winpr/libwinpr/synch/event.c | 90 +- winpr/libwinpr/synch/init.c | 9 +- winpr/libwinpr/synch/mutex.c | 53 +- winpr/libwinpr/synch/semaphore.c | 69 +- winpr/libwinpr/synch/sleep.c | 19 +- winpr/libwinpr/synch/srw.c | 5 - winpr/libwinpr/synch/synch.h | 2 +- winpr/libwinpr/synch/test/TestSynchBarrier.c | 78 +- winpr/libwinpr/synch/test/TestSynchCritical.c | 93 +- winpr/libwinpr/synch/test/TestSynchInit.c | 43 +- .../synch/test/TestSynchMultipleThreads.c | 14 +- winpr/libwinpr/synch/test/TestSynchMutex.c | 18 +- .../libwinpr/synch/test/TestSynchSemaphore.c | 1 - winpr/libwinpr/synch/test/TestSynchThread.c | 15 +- .../libwinpr/synch/test/TestSynchTimerQueue.c | 30 +- .../synch/test/TestSynchWaitableTimer.c | 4 +- .../synch/test/TestSynchWaitableTimerAPC.c | 20 +- winpr/libwinpr/synch/timer.c | 105 +- winpr/libwinpr/synch/wait.c | 49 +- .../sysinfo/cpufeatures/cpu-features.c | 321 +- .../sysinfo/cpufeatures/cpu-features.h | 62 +- winpr/libwinpr/sysinfo/sysinfo.c | 441 +- winpr/libwinpr/sysinfo/test/TestCPUFeatures.c | 6 +- .../sysinfo/test/TestGetComputerName.c | 141 +- .../sysinfo/test/TestGetNativeSystemInfo.c | 18 +- winpr/libwinpr/sysinfo/test/TestLocalTime.c | 7 +- winpr/libwinpr/sysinfo/test/TestSystemTime.c | 8 +- winpr/libwinpr/thread/argv.c | 35 +- winpr/libwinpr/thread/process.c | 165 +- winpr/libwinpr/thread/processor.c | 1 - .../thread/test/TestThreadCommandLineToArgv.c | 66 +- .../thread/test/TestThreadCreateProcess.c | 51 +- .../thread/test/TestThreadExitThread.c | 16 +- winpr/libwinpr/thread/thread.c | 128 +- winpr/libwinpr/thread/thread.h | 7 +- winpr/libwinpr/thread/tls.c | 9 +- winpr/libwinpr/timezone/TimeZones.c | 5359 +++-- winpr/libwinpr/timezone/WindowsZones.c | 41 +- winpr/libwinpr/timezone/timezone.c | 54 +- winpr/libwinpr/utils/cmdline.c | 19 +- winpr/libwinpr/utils/collections/ArrayList.c | 31 +- winpr/libwinpr/utils/collections/BipBuffer.c | 13 +- winpr/libwinpr/utils/collections/BitStream.c | 205 +- winpr/libwinpr/utils/collections/BufferPool.c | 38 +- .../utils/collections/CountdownEvent.c | 5 +- winpr/libwinpr/utils/collections/Dictionary.c | 6 +- winpr/libwinpr/utils/collections/HashTable.c | 31 +- .../libwinpr/utils/collections/KeyValuePair.c | 2 +- winpr/libwinpr/utils/collections/LinkedList.c | 4 +- .../utils/collections/ListDictionary.c | 9 +- .../libwinpr/utils/collections/MessagePipe.c | 4 +- .../libwinpr/utils/collections/MessageQueue.c | 17 +- winpr/libwinpr/utils/collections/ObjectPool.c | 9 +- winpr/libwinpr/utils/collections/PubSub.c | 10 +- winpr/libwinpr/utils/collections/Reference.c | 11 +- winpr/libwinpr/utils/collections/Stack.c | 5 +- winpr/libwinpr/utils/collections/StreamPool.c | 36 +- winpr/libwinpr/utils/corkscrew/backtrace.h | 48 +- winpr/libwinpr/utils/corkscrew/demangle.h | 19 +- winpr/libwinpr/utils/corkscrew/map_info.h | 68 +- winpr/libwinpr/utils/corkscrew/ptrace.h | 171 +- winpr/libwinpr/utils/corkscrew/symbol_table.h | 51 +- winpr/libwinpr/utils/debug.c | 98 +- winpr/libwinpr/utils/image.c | 20 +- winpr/libwinpr/utils/ini.c | 31 +- winpr/libwinpr/utils/lodepng/lodepng.c | 9075 ++++---- winpr/libwinpr/utils/lodepng/lodepng.h | 582 +- winpr/libwinpr/utils/ntlm.c | 36 +- winpr/libwinpr/utils/print.c | 20 +- winpr/libwinpr/utils/sam.c | 32 +- winpr/libwinpr/utils/ssl.c | 19 +- winpr/libwinpr/utils/stream.c | 12 +- winpr/libwinpr/utils/strlst.c | 15 +- winpr/libwinpr/utils/test/TestArrayList.c | 25 +- winpr/libwinpr/utils/test/TestBacktrace.c | 2 +- winpr/libwinpr/utils/test/TestBipBuffer.c | 2 +- winpr/libwinpr/utils/test/TestBitStream.c | 13 +- winpr/libwinpr/utils/test/TestBufferPool.c | 9 +- winpr/libwinpr/utils/test/TestCmdLine.c | 122 +- winpr/libwinpr/utils/test/TestHashTable.c | 16 +- winpr/libwinpr/utils/test/TestImage.c | 12 +- winpr/libwinpr/utils/test/TestIni.c | 66 +- winpr/libwinpr/utils/test/TestLinkedList.c | 49 +- .../libwinpr/utils/test/TestListDictionary.c | 39 +- winpr/libwinpr/utils/test/TestMessagePipe.c | 14 +- winpr/libwinpr/utils/test/TestMessageQueue.c | 13 +- winpr/libwinpr/utils/test/TestPrint.c | 11 +- winpr/libwinpr/utils/test/TestPubSub.c | 20 +- winpr/libwinpr/utils/test/TestQueue.c | 16 +- winpr/libwinpr/utils/test/TestStream.c | 117 +- winpr/libwinpr/utils/test/TestStreamPool.c | 1 - winpr/libwinpr/utils/test/TestVersion.c | 1 - winpr/libwinpr/utils/test/TestWLog.c | 12 +- winpr/libwinpr/utils/test/TestWLogCallback.c | 47 +- winpr/libwinpr/utils/trio/strio.h | 61 +- winpr/libwinpr/utils/trio/trio.c | 10268 +++++---- winpr/libwinpr/utils/trio/trio.h | 271 +- winpr/libwinpr/utils/trio/triodef.h | 320 +- winpr/libwinpr/utils/trio/trionan.c | 1494 +- winpr/libwinpr/utils/trio/trionan.h | 145 +- winpr/libwinpr/utils/trio/triop.h | 268 +- winpr/libwinpr/utils/trio/triostr.c | 2039 +- winpr/libwinpr/utils/trio/triostr.h | 671 +- winpr/libwinpr/utils/winpr.c | 11 +- winpr/libwinpr/utils/wlog/Appender.c | 56 +- winpr/libwinpr/utils/wlog/Appender.h | 1 - winpr/libwinpr/utils/wlog/BinaryAppender.c | 48 +- winpr/libwinpr/utils/wlog/CallbackAppender.c | 41 +- winpr/libwinpr/utils/wlog/ConsoleAppender.c | 62 +- winpr/libwinpr/utils/wlog/DataMessage.c | 2 +- winpr/libwinpr/utils/wlog/FileAppender.c | 24 +- winpr/libwinpr/utils/wlog/JournaldAppender.c | 81 +- winpr/libwinpr/utils/wlog/Layout.c | 43 +- winpr/libwinpr/utils/wlog/Layout.h | 1 - winpr/libwinpr/utils/wlog/Message.c | 7 +- winpr/libwinpr/utils/wlog/PacketMessage.c | 33 +- winpr/libwinpr/utils/wlog/PacketMessage.h | 17 +- winpr/libwinpr/utils/wlog/SyslogAppender.c | 46 +- winpr/libwinpr/utils/wlog/UdpAppender.c | 18 +- winpr/libwinpr/utils/wlog/wlog.c | 82 +- winpr/libwinpr/utils/wlog/wlog.h | 54 +- winpr/libwinpr/winhttp/winhttp.c | 53 +- winpr/libwinpr/winsock/winsock.c | 171 +- .../libwinpr/wnd/test/TestWndCreateWindowEx.c | 44 +- winpr/libwinpr/wnd/test/TestWndWmCopyData.c | 23 +- winpr/libwinpr/wnd/wnd.c | 52 +- .../test/TestWtsApiEnumerateProcesses.c | 2 +- .../wtsapi/test/TestWtsApiEnumerateSessions.c | 12 +- .../test/TestWtsApiExtraDisconnectSession.c | 2 +- .../TestWtsApiExtraDynamicVirtualChannel.c | 15 +- .../test/TestWtsApiExtraLogoffSession.c | 2 +- .../wtsapi/test/TestWtsApiExtraSendMessage.c | 7 +- .../TestWtsApiExtraStartRemoteSessionEx.c | 8 +- .../test/TestWtsApiExtraVirtualChannel.c | 14 +- .../test/TestWtsApiQuerySessionInformation.c | 114 +- .../test/TestWtsApiSessionNotification.c | 12 +- .../wtsapi/test/TestWtsApiShutdownSystem.c | 2 +- .../wtsapi/test/TestWtsApiWaitSystemEvent.c | 2 +- winpr/libwinpr/wtsapi/wtsapi.c | 353 +- winpr/libwinpr/wtsapi/wtsapi_win32.c | 162 +- winpr/test/TestIntrinsics.c | 64 +- winpr/test/TestTypes.c | 5 +- winpr/tools/hash-cli/hash.c | 9 +- winpr/tools/makecert/makecert.c | 390 +- 1335 files changed, 118253 insertions(+), 113607 deletions(-) mode change 100755 => 100644 channels/video/client/video_main.c mode change 100755 => 100644 libfreerdp/core/gateway/rdg.h diff --git a/channels/audin/client/alsa/audin_alsa.c b/channels/audin/client/alsa/audin_alsa.c index 2b2571056..60e9fd8d4 100644 --- a/channels/audin/client/alsa/audin_alsa.c +++ b/channels/audin/client/alsa/audin_alsa.c @@ -87,30 +87,26 @@ static snd_pcm_format_t audin_alsa_format(UINT32 wFormatTag, UINT32 bitPerChanne } } -static BOOL audin_alsa_set_params(AudinALSADevice* alsa, - snd_pcm_t* capture_handle) +static BOOL audin_alsa_set_params(AudinALSADevice* alsa, snd_pcm_t* capture_handle) { int error; SSIZE_T s; UINT32 channels = alsa->aformat.nChannels; snd_pcm_hw_params_t* hw_params; - snd_pcm_format_t format = audin_alsa_format(alsa->aformat.wFormatTag, alsa->aformat.wBitsPerSample); + snd_pcm_format_t format = + audin_alsa_format(alsa->aformat.wFormatTag, alsa->aformat.wBitsPerSample); if ((error = snd_pcm_hw_params_malloc(&hw_params)) < 0) { - WLog_Print(alsa->log, WLOG_ERROR, "snd_pcm_hw_params_malloc (%s)", - snd_strerror(error)); + WLog_Print(alsa->log, WLOG_ERROR, "snd_pcm_hw_params_malloc (%s)", snd_strerror(error)); return FALSE; } snd_pcm_hw_params_any(capture_handle, hw_params); - snd_pcm_hw_params_set_access(capture_handle, hw_params, - SND_PCM_ACCESS_RW_INTERLEAVED); + snd_pcm_hw_params_set_access(capture_handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED); snd_pcm_hw_params_set_format(capture_handle, hw_params, format); - snd_pcm_hw_params_set_rate_near(capture_handle, hw_params, - &alsa->aformat.nSamplesPerSec, NULL); - snd_pcm_hw_params_set_channels_near(capture_handle, hw_params, - &channels); + snd_pcm_hw_params_set_rate_near(capture_handle, hw_params, &alsa->aformat.nSamplesPerSec, NULL); + snd_pcm_hw_params_set_channels_near(capture_handle, hw_params, &channels); snd_pcm_hw_params(capture_handle, hw_params); snd_pcm_hw_params_free(hw_params); snd_pcm_prepare(capture_handle); @@ -129,12 +125,11 @@ static DWORD WINAPI audin_alsa_thread_func(LPVOID arg) long error; BYTE* buffer; snd_pcm_t* capture_handle = NULL; - AudinALSADevice* alsa = (AudinALSADevice*) arg; + AudinALSADevice* alsa = (AudinALSADevice*)arg; DWORD status; WLog_Print(alsa->log, WLOG_DEBUG, "in"); - if ((error = snd_pcm_open(&capture_handle, alsa->device_name, - SND_PCM_STREAM_CAPTURE, 0)) < 0) + if ((error = snd_pcm_open(&capture_handle, alsa->device_name, SND_PCM_STREAM_CAPTURE, 0)) < 0) { WLog_Print(alsa->log, WLOG_ERROR, "snd_pcm_open (%s)", snd_strerror(error)); error = CHANNEL_RC_INITIALIZATION_ERROR; @@ -147,7 +142,8 @@ static DWORD WINAPI audin_alsa_thread_func(LPVOID arg) goto out; } - buffer = (BYTE*) calloc(alsa->frames_per_packet + alsa->aformat.nBlockAlign, alsa->bytes_per_frame); + buffer = + (BYTE*)calloc(alsa->frames_per_packet + alsa->aformat.nBlockAlign, alsa->bytes_per_frame); if (!buffer) { @@ -187,12 +183,13 @@ static DWORD WINAPI audin_alsa_thread_func(LPVOID arg) break; } - error = alsa->receive(&alsa->aformat, - buffer, error * alsa->bytes_per_frame, alsa->user_data); + error = + alsa->receive(&alsa->aformat, buffer, error * alsa->bytes_per_frame, alsa->user_data); if (error) { - WLog_Print(alsa->log, WLOG_ERROR, "audin_alsa_thread_receive failed with error %ld", error); + WLog_Print(alsa->log, WLOG_ERROR, "audin_alsa_thread_receive failed with error %ld", + error); break; } } @@ -206,8 +203,7 @@ out: WLog_Print(alsa->log, WLOG_DEBUG, "out"); if (error && alsa->rdpcontext) - setChannelError(alsa->rdpcontext, error, - "audin_alsa_thread_func reported an error"); + setChannelError(alsa->rdpcontext, error, "audin_alsa_thread_func reported an error"); ExitThread(error); return error; @@ -220,7 +216,7 @@ out: */ static UINT audin_alsa_free(IAudinDevice* device) { - AudinALSADevice* alsa = (AudinALSADevice*) device; + AudinALSADevice* alsa = (AudinALSADevice*)device; if (alsa) free(alsa->device_name); @@ -229,8 +225,7 @@ static UINT audin_alsa_free(IAudinDevice* device) return CHANNEL_RC_OK; } -static BOOL audin_alsa_format_supported(IAudinDevice* device, - const AUDIO_FORMAT* format) +static BOOL audin_alsa_format_supported(IAudinDevice* device, const AUDIO_FORMAT* format) { if (!device || !format) return FALSE; @@ -238,8 +233,7 @@ static BOOL audin_alsa_format_supported(IAudinDevice* device, switch (format->wFormatTag) { case WAVE_FORMAT_PCM: - if (format->cbSize == 0 && - (format->nSamplesPerSec <= 48000) && + if (format->cbSize == 0 && (format->nSamplesPerSec <= 48000) && (format->wBitsPerSample == 8 || format->wBitsPerSample == 16) && (format->nChannels == 1 || format->nChannels == 2)) { @@ -267,7 +261,7 @@ static BOOL audin_alsa_format_supported(IAudinDevice* device, static UINT audin_alsa_set_format(IAudinDevice* device, const AUDIO_FORMAT* format, UINT32 FramesPerPacket) { - AudinALSADevice* alsa = (AudinALSADevice*) device; + AudinALSADevice* alsa = (AudinALSADevice*)device; if (!alsa || !format) return ERROR_INVALID_PARAMETER; @@ -286,10 +280,9 @@ static UINT audin_alsa_set_format(IAudinDevice* device, const AUDIO_FORMAT* form * * @return 0 on success, otherwise a Win32 error code */ -static UINT audin_alsa_open(IAudinDevice* device, AudinReceive receive, - void* user_data) +static UINT audin_alsa_open(IAudinDevice* device, AudinReceive receive, void* user_data) { - AudinALSADevice* alsa = (AudinALSADevice*) device; + AudinALSADevice* alsa = (AudinALSADevice*)device; if (!device || !receive || !user_data) return ERROR_INVALID_PARAMETER; @@ -303,8 +296,7 @@ static UINT audin_alsa_open(IAudinDevice* device, AudinReceive receive, goto error_out; } - if (!(alsa->thread = CreateThread(NULL, 0, - audin_alsa_thread_func, alsa, 0, NULL))) + if (!(alsa->thread = CreateThread(NULL, 0, audin_alsa_thread_func, alsa, 0, NULL))) { WLog_Print(alsa->log, WLOG_ERROR, "CreateThread failed!"); goto error_out; @@ -325,7 +317,7 @@ error_out: static UINT audin_alsa_close(IAudinDevice* device) { UINT error = CHANNEL_RC_OK; - AudinALSADevice* alsa = (AudinALSADevice*) device; + AudinALSADevice* alsa = (AudinALSADevice*)device; if (!alsa) return ERROR_INVALID_PARAMETER; @@ -337,7 +329,8 @@ static UINT audin_alsa_close(IAudinDevice* device) if (WaitForSingleObject(alsa->thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_Print(alsa->log, WLOG_ERROR, "WaitForSingleObject failed with error %"PRIu32"", error); + WLog_Print(alsa->log, WLOG_ERROR, "WaitForSingleObject failed with error %" PRIu32 "", + error); return error; } @@ -357,22 +350,19 @@ static UINT audin_alsa_close(IAudinDevice* device) * * @return 0 on success, otherwise a Win32 error code */ -static UINT audin_alsa_parse_addin_args(AudinALSADevice* device, - ADDIN_ARGV* args) +static UINT audin_alsa_parse_addin_args(AudinALSADevice* device, ADDIN_ARGV* args) { int status; DWORD flags; COMMAND_LINE_ARGUMENT_A* arg; - AudinALSADevice* alsa = (AudinALSADevice*) device; - COMMAND_LINE_ARGUMENT_A audin_alsa_args[] = - { - { "dev", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "audio device name" }, - { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } - }; - flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | - COMMAND_LINE_IGN_UNKNOWN_KEYWORD; - status = CommandLineParseArgumentsA(args->argc, args->argv, - audin_alsa_args, flags, alsa, NULL, NULL); + AudinALSADevice* alsa = (AudinALSADevice*)device; + COMMAND_LINE_ARGUMENT_A audin_alsa_args[] = { { "dev", COMMAND_LINE_VALUE_REQUIRED, "", + NULL, NULL, -1, NULL, "audio device name" }, + { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; + flags = + COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; + status = CommandLineParseArgumentsA(args->argc, args->argv, audin_alsa_args, flags, alsa, NULL, + NULL); if (status < 0) return ERROR_INVALID_PARAMETER; @@ -384,8 +374,7 @@ static UINT audin_alsa_parse_addin_args(AudinALSADevice* device, if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "dev") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "dev") { alsa->device_name = _strdup(arg->Value); @@ -396,16 +385,15 @@ static UINT audin_alsa_parse_addin_args(AudinALSADevice* device, } } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); return CHANNEL_RC_OK; } #ifdef BUILTIN_CHANNELS -#define freerdp_audin_client_subsystem_entry alsa_freerdp_audin_client_subsystem_entry +#define freerdp_audin_client_subsystem_entry alsa_freerdp_audin_client_subsystem_entry #else -#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry +#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry #endif /** @@ -413,13 +401,12 @@ static UINT audin_alsa_parse_addin_args(AudinALSADevice* device, * * @return 0 on success, otherwise a Win32 error code */ -UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS - pEntryPoints) +UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints) { ADDIN_ARGV* args; AudinALSADevice* alsa; UINT error; - alsa = (AudinALSADevice*) calloc(1, sizeof(AudinALSADevice)); + alsa = (AudinALSADevice*)calloc(1, sizeof(AudinALSADevice)); if (!alsa) { @@ -438,8 +425,8 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS if ((error = audin_alsa_parse_addin_args(alsa, args))) { - WLog_Print(alsa->log, WLOG_ERROR, "audin_alsa_parse_addin_args failed with errorcode %"PRIu32"!", - error); + WLog_Print(alsa->log, WLOG_ERROR, + "audin_alsa_parse_addin_args failed with errorcode %" PRIu32 "!", error); goto error_out; } @@ -461,10 +448,10 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS alsa->aformat.wFormatTag = WAVE_FORMAT_PCM; alsa->aformat.nSamplesPerSec = 44100; - if ((error = pEntryPoints->pRegisterAudinDevice(pEntryPoints->plugin, - (IAudinDevice*) alsa))) + if ((error = pEntryPoints->pRegisterAudinDevice(pEntryPoints->plugin, (IAudinDevice*)alsa))) { - WLog_Print(alsa->log, WLOG_ERROR, "RegisterAudinDevice failed with error %"PRIu32"!", error); + WLog_Print(alsa->log, WLOG_ERROR, "RegisterAudinDevice failed with error %" PRIu32 "!", + error); goto error_out; } diff --git a/channels/audin/client/audin_main.c b/channels/audin/client/audin_main.c index 0aa34957c..f9a67c17f 100644 --- a/channels/audin/client/audin_main.c +++ b/channels/audin/client/audin_main.c @@ -42,13 +42,13 @@ #include "audin_main.h" -#define MSG_SNDIN_VERSION 0x01 -#define MSG_SNDIN_FORMATS 0x02 -#define MSG_SNDIN_OPEN 0x03 -#define MSG_SNDIN_OPEN_REPLY 0x04 +#define MSG_SNDIN_VERSION 0x01 +#define MSG_SNDIN_FORMATS 0x02 +#define MSG_SNDIN_OPEN 0x03 +#define MSG_SNDIN_OPEN_REPLY 0x04 #define MSG_SNDIN_DATA_INCOMING 0x05 -#define MSG_SNDIN_DATA 0x06 -#define MSG_SNDIN_FORMATCHANGE 0x07 +#define MSG_SNDIN_DATA 0x06 +#define MSG_SNDIN_FORMATCHANGE 0x07 typedef struct _AUDIN_LISTENER_CALLBACK AUDIN_LISTENER_CALLBACK; struct _AUDIN_LISTENER_CALLBACK @@ -105,7 +105,7 @@ struct _AUDIN_PLUGIN static BOOL audin_process_addin_args(AUDIN_PLUGIN* audin, ADDIN_ARGV* args); static UINT audin_channel_write_and_free(AUDIN_CHANNEL_CALLBACK* callback, wStream* out, - BOOL freeStream) + BOOL freeStream) { UINT error; @@ -116,9 +116,8 @@ static UINT audin_channel_write_and_free(AUDIN_CHANNEL_CALLBACK* callback, wStre return ERROR_INTERNAL_ERROR; Stream_SealLength(out); - error = callback->channel->Write(callback->channel, - Stream_Length(out), - Stream_Buffer(out), NULL); + error = + callback->channel->Write(callback->channel, Stream_Length(out), Stream_Buffer(out), NULL); if (freeStream) Stream_Free(out, TRUE); @@ -126,7 +125,6 @@ static UINT audin_channel_write_and_free(AUDIN_CHANNEL_CALLBACK* callback, wStre return error; } - /** * Function description * @@ -142,15 +140,16 @@ static UINT audin_process_version(AUDIN_PLUGIN* audin, AUDIN_CHANNEL_CALLBACK* c return ERROR_INVALID_DATA; Stream_Read_UINT32(s, ServerVersion); - WLog_Print(audin->log, WLOG_DEBUG, "ServerVersion=%"PRIu32", ClientVersion=%"PRIu32, ServerVersion, - ClientVersion); + WLog_Print(audin->log, WLOG_DEBUG, "ServerVersion=%" PRIu32 ", ClientVersion=%" PRIu32, + ServerVersion, ClientVersion); /* Do not answer server packet, we do not support the channel version. */ if (ServerVersion != ClientVersion) { WLog_Print(audin->log, WLOG_WARN, - "Incompatible channel version server=%"PRIu32", client supports version=%"PRIu32, ServerVersion, - ClientVersion); + "Incompatible channel version server=%" PRIu32 + ", client supports version=%" PRIu32, + ServerVersion, ClientVersion); return CHANNEL_RC_OK; } @@ -199,11 +198,11 @@ static UINT audin_process_formats(AUDIN_PLUGIN* audin, AUDIN_CHANNEL_CALLBACK* c return ERROR_INVALID_DATA; Stream_Read_UINT32(s, NumFormats); - WLog_Print(audin->log, WLOG_DEBUG, "NumFormats %"PRIu32"", NumFormats); + WLog_Print(audin->log, WLOG_DEBUG, "NumFormats %" PRIu32 "", NumFormats); if ((NumFormats < 1) || (NumFormats > 1000)) { - WLog_Print(audin->log, WLOG_ERROR, "bad NumFormats %"PRIu32"", NumFormats); + WLog_Print(audin->log, WLOG_ERROR, "bad NumFormats %" PRIu32 "", NumFormats); return ERROR_INVALID_DATA; } @@ -271,11 +270,11 @@ static UINT audin_process_formats(AUDIN_PLUGIN* audin, AUDIN_CHANNEL_CALLBACK* c goto out; } - cbSizeFormatsPacket = (UINT32) Stream_GetPosition(out); + cbSizeFormatsPacket = (UINT32)Stream_GetPosition(out); Stream_SetPosition(out, 0); - Stream_Write_UINT8(out, MSG_SNDIN_FORMATS); /* Header (1 byte) */ + Stream_Write_UINT8(out, MSG_SNDIN_FORMATS); /* Header (1 byte) */ Stream_Write_UINT32(out, callback->formats_count); /* NumFormats (4 bytes) */ - Stream_Write_UINT32(out, cbSizeFormatsPacket); /* cbSizeFormatsPacket (4 bytes) */ + Stream_Write_UINT32(out, cbSizeFormatsPacket); /* cbSizeFormatsPacket (4 bytes) */ Stream_SetPosition(out, cbSizeFormatsPacket); error = audin_channel_write_and_free(callback, out, FALSE); out: @@ -296,7 +295,7 @@ out: * @return 0 on success, otherwise a Win32 error code */ static UINT audin_send_format_change_pdu(AUDIN_PLUGIN* audin, AUDIN_CHANNEL_CALLBACK* callback, - UINT32 NewFormat) + UINT32 NewFormat) { wStream* out = Stream_New(NULL, 5); @@ -337,13 +336,13 @@ static UINT audin_send_open_reply_pdu(AUDIN_PLUGIN* audin, AUDIN_CHANNEL_CALLBAC * * @return 0 on success, otherwise a Win32 error code */ -static UINT audin_receive_wave_data(const AUDIO_FORMAT* format, - const BYTE* data, size_t size, void* user_data) +static UINT audin_receive_wave_data(const AUDIO_FORMAT* format, const BYTE* data, size_t size, + void* user_data) { UINT error; BOOL compatible; AUDIN_PLUGIN* audin; - AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) user_data; + AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*)user_data; if (!callback) return CHANNEL_RC_BAD_CHANNEL_HANDLE; @@ -382,7 +381,7 @@ static UINT audin_receive_wave_data(const AUDIO_FORMAT* format, return CHANNEL_RC_OK; audio_format_print(audin->log, WLOG_TRACE, audin->format); - WLog_Print(audin->log, WLOG_TRACE, "[%"PRIdz"/%"PRIdz"]", size, + WLog_Print(audin->log, WLOG_TRACE, "[%" PRIdz "/%" PRIdz "]", size, Stream_GetPosition(audin->data) - 1); if ((error = audin_send_incoming_data_pdu(callback))) @@ -411,12 +410,7 @@ static BOOL audin_open_device(AUDIN_PLUGIN* audin, AUDIN_CHANNEL_CALLBACK* callb if (!supported) { /* Default sample rates supported by most backends. */ - const UINT32 samplerates[] = { - 96000, - 48000, - 44100, - 22050 - }; + const UINT32 samplerates[] = { 96000, 48000, 44100, 22050 }; BOOL test = FALSE; format.wFormatTag = WAVE_FORMAT_PCM; @@ -425,7 +419,7 @@ static BOOL audin_open_device(AUDIN_PLUGIN* audin, AUDIN_CHANNEL_CALLBACK* callb if (!test) { size_t x; - for (x=0; xdevice->FormatSupported, audin->device, &format); @@ -437,13 +431,11 @@ static BOOL audin_open_device(AUDIN_PLUGIN* audin, AUDIN_CHANNEL_CALLBACK* callb return FALSE; } - IFCALLRET(audin->device->SetFormat, error, - audin->device, &format, - audin->FramesPerPacket); + IFCALLRET(audin->device->SetFormat, error, audin->device, &format, audin->FramesPerPacket); if (error != CHANNEL_RC_OK) { - WLog_ERR(TAG, "SetFormat failed with errorcode %"PRIu32"", error); + WLog_ERR(TAG, "SetFormat failed with errorcode %" PRIu32 "", error); return FALSE; } @@ -453,12 +445,11 @@ static BOOL audin_open_device(AUDIN_PLUGIN* audin, AUDIN_CHANNEL_CALLBACK* callb return FALSE; } - IFCALLRET(audin->device->Open, error, audin->device, - audin_receive_wave_data, callback); + IFCALLRET(audin->device->Open, error, audin->device, audin_receive_wave_data, callback); if (error != CHANNEL_RC_OK) { - WLog_ERR(TAG, "Open failed with errorcode %"PRIu32"", error); + WLog_ERR(TAG, "Open failed with errorcode %" PRIu32 "", error); return FALSE; } @@ -480,13 +471,13 @@ static UINT audin_process_open(AUDIN_PLUGIN* audin, AUDIN_CHANNEL_CALLBACK* call Stream_Read_UINT32(s, FramesPerPacket); Stream_Read_UINT32(s, initialFormat); - WLog_Print(audin->log, WLOG_DEBUG, "FramesPerPacket=%"PRIu32" initialFormat=%"PRIu32"", + WLog_Print(audin->log, WLOG_DEBUG, "FramesPerPacket=%" PRIu32 " initialFormat=%" PRIu32 "", FramesPerPacket, initialFormat); audin->FramesPerPacket = FramesPerPacket; if (initialFormat >= callback->formats_count) { - WLog_Print(audin->log, WLOG_ERROR, "invalid format index %"PRIu32" (total %d)", + WLog_Print(audin->log, WLOG_ERROR, "invalid format index %" PRIu32 " (total %d)", initialFormat, callback->formats_count); return ERROR_INVALID_DATA; } @@ -523,12 +514,12 @@ static UINT audin_process_format_change(AUDIN_PLUGIN* audin, AUDIN_CHANNEL_CALLB return ERROR_INVALID_DATA; Stream_Read_UINT32(s, NewFormat); - WLog_Print(audin->log, WLOG_DEBUG, "NewFormat=%"PRIu32"", NewFormat); + WLog_Print(audin->log, WLOG_DEBUG, "NewFormat=%" PRIu32 "", NewFormat); if (NewFormat >= callback->formats_count) { - WLog_Print(audin->log, WLOG_ERROR, "invalid format index %"PRIu32" (total %d)", - NewFormat, callback->formats_count); + WLog_Print(audin->log, WLOG_ERROR, "invalid format index %" PRIu32 " (total %d)", NewFormat, + callback->formats_count); return ERROR_INVALID_DATA; } @@ -540,7 +531,7 @@ static UINT audin_process_format_change(AUDIN_PLUGIN* audin, AUDIN_CHANNEL_CALLB if (error != CHANNEL_RC_OK) { - WLog_ERR(TAG, "Close failed with errorcode %"PRIu32"", error); + WLog_ERR(TAG, "Close failed with errorcode %" PRIu32 "", error); return error; } } @@ -564,12 +555,12 @@ static UINT audin_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, UINT error; BYTE MessageId; AUDIN_PLUGIN* audin; - AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) pChannelCallback; + AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*)pChannelCallback; if (!callback || !data) return ERROR_INVALID_PARAMETER; - audin = (AUDIN_PLUGIN*) callback->plugin; + audin = (AUDIN_PLUGIN*)callback->plugin; if (!audin) return ERROR_INTERNAL_ERROR; @@ -578,7 +569,7 @@ static UINT audin_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, return ERROR_NO_DATA; Stream_Read_UINT8(data, MessageId); - WLog_Print(audin->log, WLOG_DEBUG, "MessageId=0x%02"PRIx8"", MessageId); + WLog_Print(audin->log, WLOG_DEBUG, "MessageId=0x%02" PRIx8 "", MessageId); switch (MessageId) { @@ -599,7 +590,7 @@ static UINT audin_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, break; default: - WLog_Print(audin->log, WLOG_ERROR, "unknown MessageId=0x%02"PRIx8"", MessageId); + WLog_Print(audin->log, WLOG_ERROR, "unknown MessageId=0x%02" PRIx8 "", MessageId); error = ERROR_INVALID_DATA; break; } @@ -614,8 +605,8 @@ static UINT audin_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, */ static UINT audin_on_close(IWTSVirtualChannelCallback* pChannelCallback) { - AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) pChannelCallback; - AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*) callback->plugin; + AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*)pChannelCallback; + AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*)callback->plugin; UINT error = CHANNEL_RC_OK; WLog_Print(audin->log, WLOG_TRACE, "..."); @@ -624,7 +615,7 @@ static UINT audin_on_close(IWTSVirtualChannelCallback* pChannelCallback) IFCALLRET(audin->device->Close, error, audin->device); if (error != CHANNEL_RC_OK) - WLog_Print(audin->log, WLOG_ERROR, "Close failed with errorcode %"PRIu32"", error); + WLog_Print(audin->log, WLOG_ERROR, "Close failed with errorcode %" PRIu32 "", error); } audin->format = NULL; @@ -639,19 +630,19 @@ static UINT audin_on_close(IWTSVirtualChannelCallback* pChannelCallback) * @return 0 on success, otherwise a Win32 error code */ static UINT audin_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, - IWTSVirtualChannel* pChannel, BYTE* Data, BOOL* pbAccept, - IWTSVirtualChannelCallback** ppCallback) + IWTSVirtualChannel* pChannel, BYTE* Data, + BOOL* pbAccept, IWTSVirtualChannelCallback** ppCallback) { AUDIN_CHANNEL_CALLBACK* callback; AUDIN_PLUGIN* audin; - AUDIN_LISTENER_CALLBACK* listener_callback = (AUDIN_LISTENER_CALLBACK*) pListenerCallback; + AUDIN_LISTENER_CALLBACK* listener_callback = (AUDIN_LISTENER_CALLBACK*)pListenerCallback; if (!listener_callback || !listener_callback->plugin) return ERROR_INTERNAL_ERROR; - audin = (AUDIN_PLUGIN*) listener_callback->plugin; + audin = (AUDIN_PLUGIN*)listener_callback->plugin; WLog_Print(audin->log, WLOG_TRACE, "..."); - callback = (AUDIN_CHANNEL_CALLBACK*) calloc(1, sizeof(AUDIN_CHANNEL_CALLBACK)); + callback = (AUDIN_CHANNEL_CALLBACK*)calloc(1, sizeof(AUDIN_CHANNEL_CALLBACK)); if (!callback) { @@ -664,7 +655,7 @@ static UINT audin_on_new_channel_connection(IWTSListenerCallback* pListenerCallb callback->plugin = listener_callback->plugin; callback->channel_mgr = listener_callback->channel_mgr; callback->channel = pChannel; - *ppCallback = (IWTSVirtualChannelCallback*) callback; + *ppCallback = (IWTSVirtualChannelCallback*)callback; return CHANNEL_RC_OK; } @@ -675,7 +666,7 @@ static UINT audin_on_new_channel_connection(IWTSListenerCallback* pListenerCallb */ static UINT audin_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) { - AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*) pPlugin; + AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*)pPlugin; if (!audin) return CHANNEL_RC_BAD_CHANNEL_HANDLE; @@ -684,7 +675,7 @@ static UINT audin_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManag return ERROR_INVALID_PARAMETER; WLog_Print(audin->log, WLOG_TRACE, "..."); - audin->listener_callback = (AUDIN_LISTENER_CALLBACK*) calloc(1, sizeof(AUDIN_LISTENER_CALLBACK)); + audin->listener_callback = (AUDIN_LISTENER_CALLBACK*)calloc(1, sizeof(AUDIN_LISTENER_CALLBACK)); if (!audin->listener_callback) { @@ -696,7 +687,7 @@ static UINT audin_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManag audin->listener_callback->plugin = pPlugin; audin->listener_callback->channel_mgr = pChannelMgr; return pChannelMgr->CreateListener(pChannelMgr, "AUDIO_INPUT", 0, - (IWTSListenerCallback*) audin->listener_callback, NULL); + (IWTSListenerCallback*)audin->listener_callback, NULL); } /** @@ -706,7 +697,7 @@ static UINT audin_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManag */ static UINT audin_plugin_terminated(IWTSPlugin* pPlugin) { - AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*) pPlugin; + AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*)pPlugin; UINT error = CHANNEL_RC_OK; if (!audin) @@ -721,7 +712,7 @@ static UINT audin_plugin_terminated(IWTSPlugin* pPlugin) if (error != CHANNEL_RC_OK) { - WLog_Print(audin->log, WLOG_ERROR, "Free failed with errorcode %"PRIu32"", error); + WLog_Print(audin->log, WLOG_ERROR, "Free failed with errorcode %" PRIu32 "", error); // dont stop on error } @@ -739,7 +730,7 @@ static UINT audin_plugin_terminated(IWTSPlugin* pPlugin) static UINT audin_plugin_attached(IWTSPlugin* pPlugin) { - AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*) pPlugin; + AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*)pPlugin; UINT error = CHANNEL_RC_OK; if (!audin) @@ -751,7 +742,7 @@ static UINT audin_plugin_attached(IWTSPlugin* pPlugin) static UINT audin_plugin_detached(IWTSPlugin* pPlugin) { - AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*) pPlugin; + AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*)pPlugin; UINT error = CHANNEL_RC_OK; if (!audin) @@ -768,7 +759,7 @@ static UINT audin_plugin_detached(IWTSPlugin* pPlugin) */ static UINT audin_register_device_plugin(IWTSPlugin* pPlugin, IAudinDevice* device) { - AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*) pPlugin; + AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*)pPlugin; if (audin->device) { @@ -791,8 +782,8 @@ static UINT audin_load_device_plugin(AUDIN_PLUGIN* audin, char* name, ADDIN_ARGV PFREERDP_AUDIN_DEVICE_ENTRY entry; FREERDP_AUDIN_DEVICE_ENTRY_POINTS entryPoints; UINT error; - entry = (PFREERDP_AUDIN_DEVICE_ENTRY) freerdp_load_channel_addin_entry("audin", (LPSTR) name, NULL, - 0); + entry = (PFREERDP_AUDIN_DEVICE_ENTRY)freerdp_load_channel_addin_entry("audin", (LPSTR)name, + NULL, 0); if (entry == NULL) { @@ -802,14 +793,14 @@ static UINT audin_load_device_plugin(AUDIN_PLUGIN* audin, char* name, ADDIN_ARGV return ERROR_INVALID_FUNCTION; } - entryPoints.plugin = (IWTSPlugin*) audin; + entryPoints.plugin = (IWTSPlugin*)audin; entryPoints.pRegisterAudinDevice = audin_register_device_plugin; entryPoints.args = args; entryPoints.rdpcontext = audin->rdpcontext; if ((error = entry(&entryPoints))) { - WLog_Print(audin->log, WLOG_ERROR, "%s entry returned error %"PRIu32".", name, error); + WLog_Print(audin->log, WLOG_ERROR, "%s entry returned error %" PRIu32 ".", name, error); return error; } @@ -861,22 +852,22 @@ BOOL audin_process_addin_args(AUDIN_PLUGIN* audin, ADDIN_ARGV* args) DWORD flags; COMMAND_LINE_ARGUMENT_A* arg; UINT error; - COMMAND_LINE_ARGUMENT_A audin_args[] = - { - { "sys", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "subsystem" }, - { "dev", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "device" }, - { "format", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "format" }, - { "rate", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "rate" }, - { "channel", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "channel" }, - { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } - }; + COMMAND_LINE_ARGUMENT_A audin_args[] = { + { "sys", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "subsystem" }, + { "dev", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "device" }, + { "format", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "format" }, + { "rate", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "rate" }, + { "channel", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "channel" }, + { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } + }; if (!args || args->argc == 1) return TRUE; - flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; - status = CommandLineParseArgumentsA(args->argc, args->argv, - audin_args, flags, audin, NULL, NULL); + flags = + COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; + status = + CommandLineParseArgumentsA(args->argc, args->argv, audin_args, flags, audin, NULL, NULL); if (status != 0) return FALSE; @@ -889,12 +880,12 @@ BOOL audin_process_addin_args(AUDIN_PLUGIN* audin, ADDIN_ARGV* args) if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "sys") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "sys") { if ((error = audin_set_subsystem(audin, arg->Value))) { - WLog_Print(audin->log, WLOG_ERROR, "audin_set_subsystem failed with error %"PRIu32"!", error); + WLog_Print(audin->log, WLOG_ERROR, + "audin_set_subsystem failed with error %" PRIu32 "!", error); return FALSE; } } @@ -902,7 +893,8 @@ BOOL audin_process_addin_args(AUDIN_PLUGIN* audin, ADDIN_ARGV* args) { if ((error = audin_set_device_name(audin, arg->Value))) { - WLog_Print(audin->log, WLOG_ERROR, "audin_set_device_name failed with error %"PRIu32"!", error); + WLog_Print(audin->log, WLOG_ERROR, + "audin_set_device_name failed with error %" PRIu32 "!", error); return FALSE; } } @@ -935,16 +927,15 @@ BOOL audin_process_addin_args(AUDIN_PLUGIN* audin, ADDIN_ARGV* args) { } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); return TRUE; } #ifdef BUILTIN_CHANNELS -#define DVCPluginEntry audin_DVCPluginEntry +#define DVCPluginEntry audin_DVCPluginEntry #else -#define DVCPluginEntry FREERDP_API DVCPluginEntry +#define DVCPluginEntry FREERDP_API DVCPluginEntry #endif /** @@ -965,34 +956,34 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) struct SubsystemEntry entries[] = { #if defined(WITH_PULSE) - {"pulse", ""}, + { "pulse", "" }, #endif #if defined(WITH_OSS) - {"oss", "default"}, + { "oss", "default" }, #endif #if defined(WITH_ALSA) - {"alsa", "default"}, + { "alsa", "default" }, #endif #if defined(WITH_OPENSLES) - {"opensles", "default"}, + { "opensles", "default" }, #endif #if defined(WITH_WINMM) - {"winmm", "default"}, + { "winmm", "default" }, #endif #if defined(WITH_MACAUDIO) - {"mac", "default"}, + { "mac", "default" }, #endif - {NULL, NULL} + { NULL, NULL } }; struct SubsystemEntry* entry = &entries[0]; assert(pEntryPoints); assert(pEntryPoints->GetPlugin); - audin = (AUDIN_PLUGIN*) pEntryPoints->GetPlugin(pEntryPoints, "audin"); + audin = (AUDIN_PLUGIN*)pEntryPoints->GetPlugin(pEntryPoints, "audin"); if (audin != NULL) return CHANNEL_RC_ALREADY_INITIALIZED; - audin = (AUDIN_PLUGIN*) calloc(1, sizeof(AUDIN_PLUGIN)); + audin = (AUDIN_PLUGIN*)calloc(1, sizeof(AUDIN_PLUGIN)); if (!audin) { @@ -1023,8 +1014,8 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) audin->iface.Attached = audin_plugin_attached; audin->iface.Detached = audin_plugin_detached; args = pEntryPoints->GetPluginData(pEntryPoints); - audin->rdpcontext = ((freerdp*)((rdpSettings*) pEntryPoints->GetRdpSettings( - pEntryPoints))->instance)->context; + audin->rdpcontext = + ((freerdp*)((rdpSettings*)pEntryPoints->GetRdpSettings(pEntryPoints))->instance)->context; if (args) { @@ -1036,7 +1027,8 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) { if ((error = audin_load_device_plugin(audin, audin->subsystem, args))) { - WLog_Print(audin->log, WLOG_ERROR, "audin_load_device_plugin %s failed with error %"PRIu32"!", + WLog_Print(audin->log, WLOG_ERROR, + "audin_load_device_plugin %s failed with error %" PRIu32 "!", audin->subsystem, error); goto out; } @@ -1047,17 +1039,20 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) { if ((error = audin_set_subsystem(audin, entry->subsystem))) { - WLog_Print(audin->log, WLOG_ERROR, "audin_set_subsystem for %s failed with error %"PRIu32"!", + WLog_Print(audin->log, WLOG_ERROR, + "audin_set_subsystem for %s failed with error %" PRIu32 "!", entry->subsystem, error); } else if ((error = audin_set_device_name(audin, entry->device))) { - WLog_Print(audin->log, WLOG_ERROR, "audin_set_device_name for %s failed with error %"PRIu32"!", + WLog_Print(audin->log, WLOG_ERROR, + "audin_set_device_name for %s failed with error %" PRIu32 "!", entry->subsystem, error); } else if ((error = audin_load_device_plugin(audin, audin->subsystem, args))) { - WLog_Print(audin->log, WLOG_ERROR, "audin_load_device_plugin %s failed with error %"PRIu32"!", + WLog_Print(audin->log, WLOG_ERROR, + "audin_load_device_plugin %s failed with error %" PRIu32 "!", entry->subsystem, error); } @@ -1068,7 +1063,7 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) if (audin->device == NULL) WLog_Print(audin->log, WLOG_ERROR, "no sound device."); - error = pEntryPoints->RegisterPlugin(pEntryPoints, "audin", (IWTSPlugin*) audin); + error = pEntryPoints->RegisterPlugin(pEntryPoints, "audin", (IWTSPlugin*)audin); out: if (error != CHANNEL_RC_OK) diff --git a/channels/audin/client/audin_main.h b/channels/audin/client/audin_main.h index 83a75a456..760d3c8e8 100644 --- a/channels/audin/client/audin_main.h +++ b/channels/audin/client/audin_main.h @@ -33,4 +33,3 @@ #define TAG CHANNELS_TAG("audin.client") #endif /* FREERDP_CHANNEL_AUDIN_CLIENT_MAIN_H */ - diff --git a/channels/audin/client/mac/audin_mac.c b/channels/audin/client/mac/audin_mac.c index 1d7c56239..e34b83528 100644 --- a/channels/audin/client/mac/audin_mac.c +++ b/channels/audin/client/mac/audin_mac.c @@ -34,7 +34,11 @@ #include #define __COREFOUNDATION_CFPLUGINCOM__ 1 -#define IUNKNOWN_C_GUTS void *_reserved; void* QueryInterface; void* AddRef; void* Release +#define IUNKNOWN_C_GUTS \ + void* _reserved; \ + void* QueryInterface; \ + void* AddRef; \ + void* Release #include #include @@ -46,7 +50,7 @@ #include "audin_main.h" -#define MAC_AUDIO_QUEUE_NUM_BUFFERS 100 +#define MAC_AUDIO_QUEUE_NUM_BUFFERS 100 /* Fix for #4462: Provide type alias if not declared (Mac OS < 10.10) * https://developer.apple.com/documentation/coreaudio/audioformatid @@ -133,8 +137,8 @@ static UINT audin_mac_set_format(IAudinDevice* device, const AUDIO_FORMAT* forma mac->FramesPerPacket = FramesPerPacket; mac->format = *format; WLog_INFO(TAG, "Audio Format %s [channels=%d, samples=%d, bits=%d]", - audio_format_get_tag_string(format->wFormatTag), - format->nChannels, format->nSamplesPerSec, format->wBitsPerSample); + audio_format_get_tag_string(format->wFormatTag), format->nChannels, + format->nSamplesPerSec, format->wBitsPerSample); mac->audioFormat.mBitsPerChannel = format->wBitsPerSample; if (format->wBitsPerSample == 0) @@ -151,11 +155,8 @@ static UINT audin_mac_set_format(IAudinDevice* device, const AUDIO_FORMAT* forma return CHANNEL_RC_OK; } -static void mac_audio_queue_input_cb(void* aqData, - AudioQueueRef inAQ, - AudioQueueBufferRef inBuffer, - const AudioTimeStamp* inStartTime, - UInt32 inNumPackets, +static void mac_audio_queue_input_cb(void* aqData, AudioQueueRef inAQ, AudioQueueBufferRef inBuffer, + const AudioTimeStamp* inStartTime, UInt32 inNumPackets, const AudioStreamPacketDescription* inPacketDesc) { AudinMacDevice* mac = (AudinMacDevice*)aqData; @@ -174,7 +175,7 @@ static void mac_audio_queue_input_cb(void* aqData, if (error) { - WLog_ERR(TAG, "mac->receive failed with error %"PRIu32"", error); + WLog_ERR(TAG, "mac->receive failed with error %" PRIu32 "", error); SetLastError(ERROR_INTERNAL_ERROR); } } @@ -196,7 +197,7 @@ static UINT audin_mac_close(IAudinDevice* device) if (devStat != 0) { errCode = GetLastError(); - WLog_ERR(TAG, "AudioQueueStop failed with %s [%"PRIu32"]", + WLog_ERR(TAG, "AudioQueueStop failed with %s [%" PRIu32 "]", winpr_strerror(errCode, errString, sizeof(errString)), errCode); } @@ -210,7 +211,7 @@ static UINT audin_mac_close(IAudinDevice* device) if (devStat != 0) { errCode = GetLastError(); - WLog_ERR(TAG, "AudioQueueDispose failed with %s [%"PRIu32"]", + WLog_ERR(TAG, "AudioQueueDispose failed with %s [%" PRIu32 "]", winpr_strerror(errCode, errString, sizeof(errString)), errCode); } @@ -231,13 +232,13 @@ static UINT audin_mac_open(IAudinDevice* device, AudinReceive receive, void* use size_t index; mac->receive = receive; mac->user_data = user_data; - devStat = AudioQueueNewInput(&(mac->audioFormat), mac_audio_queue_input_cb, - mac, NULL, kCFRunLoopCommonModes, 0, &(mac->audioQueue)); + devStat = AudioQueueNewInput(&(mac->audioFormat), mac_audio_queue_input_cb, mac, NULL, + kCFRunLoopCommonModes, 0, &(mac->audioQueue)); if (devStat != 0) { errCode = GetLastError(); - WLog_ERR(TAG, "AudioQueueNewInput failed with %s [%"PRIu32"]", + WLog_ERR(TAG, "AudioQueueNewInput failed with %s [%" PRIu32 "]", winpr_strerror(errCode, errString, sizeof(errString)), errCode); goto err_out; } @@ -251,20 +252,17 @@ static UINT audin_mac_open(IAudinDevice* device, AudinReceive receive, void* use if (devStat != 0) { errCode = GetLastError(); - WLog_ERR(TAG, "AudioQueueAllocateBuffer failed with %s [%"PRIu32"]", + WLog_ERR(TAG, "AudioQueueAllocateBuffer failed with %s [%" PRIu32 "]", winpr_strerror(errCode, errString, sizeof(errString)), errCode); goto err_out; } - devStat = AudioQueueEnqueueBuffer(mac->audioQueue, - mac->audioBuffers[index], - 0, - NULL); + devStat = AudioQueueEnqueueBuffer(mac->audioQueue, mac->audioBuffers[index], 0, NULL); if (devStat != 0) { errCode = GetLastError(); - WLog_ERR(TAG, "AudioQueueEnqueueBuffer failed with %s [%"PRIu32"]", + WLog_ERR(TAG, "AudioQueueEnqueueBuffer failed with %s [%" PRIu32 "]", winpr_strerror(errCode, errString, sizeof(errString)), errCode); goto err_out; } @@ -275,7 +273,7 @@ static UINT audin_mac_open(IAudinDevice* device, AudinReceive receive, void* use if (devStat != 0) { errCode = GetLastError(); - WLog_ERR(TAG, "AudioQueueStart failed with %s [%"PRIu32"]", + WLog_ERR(TAG, "AudioQueueStart failed with %s [%" PRIu32 "]", winpr_strerror(errCode, errString, sizeof(errString)), errCode); goto err_out; } @@ -309,23 +307,22 @@ static UINT audin_mac_parse_addin_args(AudinMacDevice* device, ADDIN_ARGV* args) DWORD errCode; char errString[1024]; int status; - char* str_num, *eptr; + char *str_num, *eptr; DWORD flags; COMMAND_LINE_ARGUMENT_A* arg; - COMMAND_LINE_ARGUMENT_A audin_mac_args[] = - { - { "dev", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "audio device name" }, - { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } - }; + COMMAND_LINE_ARGUMENT_A audin_mac_args[] = { { "dev", COMMAND_LINE_VALUE_REQUIRED, "", + NULL, NULL, -1, NULL, "audio device name" }, + { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; AudinMacDevice* mac = (AudinMacDevice*)device; if (args->argc == 1) return CHANNEL_RC_OK; - flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; - status = CommandLineParseArgumentsA(args->argc, args->argv, audin_mac_args, flags, - mac, NULL, NULL); + flags = + COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; + status = + CommandLineParseArgumentsA(args->argc, args->argv, audin_mac_args, flags, mac, NULL, NULL); if (status < 0) return ERROR_INVALID_PARAMETER; @@ -337,8 +334,7 @@ static UINT audin_mac_parse_addin_args(AudinMacDevice* device, ADDIN_ARGV* args) if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "dev") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "dev") { str_num = _strdup(arg->Value); @@ -358,16 +354,15 @@ static UINT audin_mac_parse_addin_args(AudinMacDevice* device, ADDIN_ARGV* args) free(str_num); } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); return CHANNEL_RC_OK; } #ifdef BUILTIN_CHANNELS -#define freerdp_audin_client_subsystem_entry mac_freerdp_audin_client_subsystem_entry +#define freerdp_audin_client_subsystem_entry mac_freerdp_audin_client_subsystem_entry #else -#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry +#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry #endif UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints) @@ -382,7 +377,7 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEn if (!mac) { errCode = GetLastError(); - WLog_ERR(TAG, "calloc failed with %s [%"PRIu32"]", + WLog_ERR(TAG, "calloc failed with %s [%" PRIu32 "]", winpr_strerror(errCode, errString, sizeof(errString)), errCode); return CHANNEL_RC_NO_MEMORY; } @@ -398,13 +393,13 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEn if ((error = audin_mac_parse_addin_args(mac, args))) { - WLog_ERR(TAG, "audin_mac_parse_addin_args failed with %"PRIu32"!", error); + WLog_ERR(TAG, "audin_mac_parse_addin_args failed with %" PRIu32 "!", error); goto error_out; } - if ((error = pEntryPoints->pRegisterAudinDevice(pEntryPoints->plugin, (IAudinDevice*) mac))) + if ((error = pEntryPoints->pRegisterAudinDevice(pEntryPoints->plugin, (IAudinDevice*)mac))) { - WLog_ERR(TAG, "RegisterAudinDevice failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "RegisterAudinDevice failed with error %" PRIu32 "!", error); goto error_out; } diff --git a/channels/audin/client/opensles/audin_opensl_es.c b/channels/audin/client/opensles/audin_opensl_es.c index 1021843f1..4e3efdeb2 100644 --- a/channels/audin/client/opensles/audin_opensl_es.c +++ b/channels/audin/client/opensles/audin_opensl_es.c @@ -65,7 +65,7 @@ static UINT audin_opensles_close(IAudinDevice* device); static void audin_receive(void* context, const void* data, size_t size) { UINT error; - AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) context; + AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*)context; if (!opensles || !data) { @@ -86,34 +86,32 @@ static void audin_receive(void* context, const void* data, size_t size) */ static UINT audin_opensles_free(IAudinDevice* device) { - AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device; + AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*)device; if (!opensles) return ERROR_INVALID_PARAMETER; - WLog_Print(opensles->log, WLOG_DEBUG, "device=%p", (void*) device); + WLog_Print(opensles->log, WLOG_DEBUG, "device=%p", (void*)device); free(opensles->device_name); free(opensles); return CHANNEL_RC_OK; } -static BOOL audin_opensles_format_supported(IAudinDevice* device, - const AUDIO_FORMAT* format) +static BOOL audin_opensles_format_supported(IAudinDevice* device, const AUDIO_FORMAT* format) { - AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device; + AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*)device; if (!opensles || !format) return FALSE; - WLog_Print(opensles->log, WLOG_DEBUG, "device=%p, format=%p", (void*) opensles, (void*) format); + WLog_Print(opensles->log, WLOG_DEBUG, "device=%p, format=%p", (void*)opensles, (void*)format); assert(format); switch (format->wFormatTag) { case WAVE_FORMAT_PCM: /* PCM */ - if (format->cbSize == 0 && - (format->nSamplesPerSec <= 48000) && + if (format->cbSize == 0 && (format->nSamplesPerSec <= 48000) && (format->wBitsPerSample == 8 || format->wBitsPerSample == 16) && (format->nChannels >= 1 && format->nChannels <= 2)) { @@ -123,9 +121,8 @@ static BOOL audin_opensles_format_supported(IAudinDevice* device, break; default: - WLog_Print(opensles->log, WLOG_DEBUG, "Encoding '%s' [0x%04X"PRIX16"] not supported", - audio_format_get_tag_string(format->wFormatTag), - format->wFormatTag); + WLog_Print(opensles->log, WLOG_DEBUG, "Encoding '%s' [0x%04X" PRIX16 "] not supported", + audio_format_get_tag_string(format->wFormatTag), format->wFormatTag); break; } @@ -137,16 +134,16 @@ static BOOL audin_opensles_format_supported(IAudinDevice* device, * * @return 0 on success, otherwise a Win32 error code */ -static UINT audin_opensles_set_format(IAudinDevice* device, - const AUDIO_FORMAT* format, UINT32 FramesPerPacket) +static UINT audin_opensles_set_format(IAudinDevice* device, const AUDIO_FORMAT* format, + UINT32 FramesPerPacket) { - AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device; + AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*)device; if (!opensles || !format) return ERROR_INVALID_PARAMETER; - WLog_Print(opensles->log, WLOG_DEBUG, "device=%p, format=%p, FramesPerPacket=%"PRIu32"", - (void*) device, (void*) format, FramesPerPacket); + WLog_Print(opensles->log, WLOG_DEBUG, "device=%p, format=%p, FramesPerPacket=%" PRIu32 "", + (void*)device, (void*)format, FramesPerPacket); assert(format); opensles->format = *format; @@ -177,13 +174,13 @@ static UINT audin_opensles_set_format(IAudinDevice* device, break; default: - WLog_Print(opensles->log, WLOG_ERROR, "Encoding '%"PRIu16"' [%04"PRIX16"] not supported", - format->wFormatTag, + WLog_Print(opensles->log, WLOG_ERROR, + "Encoding '%" PRIu16 "' [%04" PRIX16 "] not supported", format->wFormatTag, format->wFormatTag); return ERROR_UNSUPPORTED_TYPE; } - WLog_Print(opensles->log, WLOG_DEBUG, "frames_per_packet=%"PRIu32, + WLog_Print(opensles->log, WLOG_DEBUG, "frames_per_packet=%" PRIu32, opensles->frames_per_packet); return CHANNEL_RC_OK; } @@ -193,27 +190,22 @@ static UINT audin_opensles_set_format(IAudinDevice* device, * * @return 0 on success, otherwise a Win32 error code */ -static UINT audin_opensles_open(IAudinDevice* device, AudinReceive receive, - void* user_data) +static UINT audin_opensles_open(IAudinDevice* device, AudinReceive receive, void* user_data) { - AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device; + AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*)device; if (!opensles || !receive || !user_data) return ERROR_INVALID_PARAMETER; - WLog_Print(opensles->log, WLOG_DEBUG, "device=%p, receive=%p, user_data=%p", (void*) device, - (void*) receive, - (void*) user_data); + WLog_Print(opensles->log, WLOG_DEBUG, "device=%p, receive=%p, user_data=%p", (void*)device, + (void*)receive, (void*)user_data); if (opensles->stream) goto error_out; if (!(opensles->stream = android_OpenRecDevice( - opensles, audin_receive, - opensles->format.nSamplesPerSec, - opensles->format.nChannels, - opensles->frames_per_packet, - opensles->format.wBitsPerSample))) + opensles, audin_receive, opensles->format.nSamplesPerSec, opensles->format.nChannels, + opensles->frames_per_packet, opensles->format.wBitsPerSample))) { WLog_Print(opensles->log, WLOG_ERROR, "android_OpenRecDevice failed!"); goto error_out; @@ -234,12 +226,12 @@ error_out: */ UINT audin_opensles_close(IAudinDevice* device) { - AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device; + AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*)device; if (!opensles) return ERROR_INVALID_PARAMETER; - WLog_Print(opensles->log, WLOG_DEBUG, "device=%p", (void*) device); + WLog_Print(opensles->log, WLOG_DEBUG, "device=%p", (void*)device); android_CloseRecDevice(opensles->stream); opensles->receive = NULL; opensles->user_data = NULL; @@ -252,26 +244,23 @@ UINT audin_opensles_close(IAudinDevice* device) * * @return 0 on success, otherwise a Win32 error code */ -static UINT audin_opensles_parse_addin_args(AudinOpenSLESDevice* device, - ADDIN_ARGV* args) +static UINT audin_opensles_parse_addin_args(AudinOpenSLESDevice* device, ADDIN_ARGV* args) { UINT status; DWORD flags; COMMAND_LINE_ARGUMENT_A* arg; - AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device; - COMMAND_LINE_ARGUMENT_A audin_opensles_args[] = - { - { - "dev", COMMAND_LINE_VALUE_REQUIRED, "", - NULL, NULL, -1, NULL, "audio device name" - }, + AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*)device; + COMMAND_LINE_ARGUMENT_A audin_opensles_args[] = { + { "dev", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "audio device name" }, { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; - WLog_Print(opensles->log, WLOG_DEBUG, "device=%p, args=%p", (void*) device, (void*) args); - flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; - status = CommandLineParseArgumentsA(args->argc, args->argv, - audin_opensles_args, flags, opensles, NULL, NULL); + WLog_Print(opensles->log, WLOG_DEBUG, "device=%p, args=%p", (void*)device, (void*)args); + flags = + COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; + status = CommandLineParseArgumentsA(args->argc, args->argv, audin_opensles_args, flags, + opensles, NULL, NULL); if (status < 0) return status; @@ -283,8 +272,7 @@ static UINT audin_opensles_parse_addin_args(AudinOpenSLESDevice* device, if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "dev") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "dev") { opensles->device_name = _strdup(arg->Value); @@ -295,18 +283,15 @@ static UINT audin_opensles_parse_addin_args(AudinOpenSLESDevice* device, } } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); return CHANNEL_RC_OK; } #ifdef BUILTIN_CHANNELS -#define freerdp_audin_client_subsystem_entry \ - opensles_freerdp_audin_client_subsystem_entry +#define freerdp_audin_client_subsystem_entry opensles_freerdp_audin_client_subsystem_entry #else -#define freerdp_audin_client_subsystem_entry \ - FREERDP_API freerdp_audin_client_subsystem_entry +#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry #endif /** @@ -314,13 +299,12 @@ static UINT audin_opensles_parse_addin_args(AudinOpenSLESDevice* device, * * @return 0 on success, otherwise a Win32 error code */ -UINT freerdp_audin_client_subsystem_entry( - PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints) +UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints) { ADDIN_ARGV* args; AudinOpenSLESDevice* opensles; UINT error; - opensles = (AudinOpenSLESDevice*) calloc(1, sizeof(AudinOpenSLESDevice)); + opensles = (AudinOpenSLESDevice*)calloc(1, sizeof(AudinOpenSLESDevice)); if (!opensles) { @@ -340,13 +324,14 @@ UINT freerdp_audin_client_subsystem_entry( if ((error = audin_opensles_parse_addin_args(opensles, args))) { WLog_Print(opensles->log, WLOG_ERROR, - "audin_opensles_parse_addin_args failed with errorcode %"PRIu32"!", error); + "audin_opensles_parse_addin_args failed with errorcode %" PRIu32 "!", error); goto error_out; } - if ((error = pEntryPoints->pRegisterAudinDevice(pEntryPoints->plugin, (IAudinDevice*) opensles))) + if ((error = pEntryPoints->pRegisterAudinDevice(pEntryPoints->plugin, (IAudinDevice*)opensles))) { - WLog_Print(opensles->log, WLOG_ERROR, "RegisterAudinDevice failed with error %"PRIu32"!", error); + WLog_Print(opensles->log, WLOG_ERROR, "RegisterAudinDevice failed with error %" PRIu32 "!", + error); goto error_out; } diff --git a/channels/audin/client/opensles/opensl_io.c b/channels/audin/client/opensles/opensl_io.c index 5e7fba603..be3e0b4f1 100644 --- a/channels/audin/client/opensles/opensl_io.c +++ b/channels/audin/client/opensles/opensl_io.c @@ -6,14 +6,14 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -32,7 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "audin_main.h" #include "opensl_io.h" #define CONV16BIT 32768 -#define CONVMYFLT (1./32768.) +#define CONVMYFLT (1. / 32768.) typedef struct { @@ -66,7 +66,6 @@ struct opensl_stream opensl_receive_t receive; }; - static void bqRecorderCallback(SLAndroidSimpleBufferQueueItf bq, void* context); // creates the OpenSL ES audio engine @@ -76,22 +75,24 @@ static SLresult openSLCreateEngine(OPENSL_STREAM* p) // create engine result = slCreateEngine(&(p->engineObject), 0, NULL, 0, NULL, NULL); - if (result != SL_RESULT_SUCCESS) goto engine_end; + if (result != SL_RESULT_SUCCESS) + goto engine_end; // realize the engine result = (*p->engineObject)->Realize(p->engineObject, SL_BOOLEAN_FALSE); - if (result != SL_RESULT_SUCCESS) goto engine_end; + if (result != SL_RESULT_SUCCESS) + goto engine_end; // get the engine interface, which is needed in order to create other objects - result = (*p->engineObject)->GetInterface(p->engineObject, SL_IID_ENGINE, - &(p->engineEngine)); + result = (*p->engineObject)->GetInterface(p->engineObject, SL_IID_ENGINE, &(p->engineEngine)); - if (result != SL_RESULT_SUCCESS) goto engine_end; + if (result != SL_RESULT_SUCCESS) + goto engine_end; // get the volume interface - important, this is optional! - result = (*p->engineObject)->GetInterface(p->engineObject, SL_IID_DEVICEVOLUME, - &(p->deviceVolume)); + result = + (*p->engineObject)->GetInterface(p->engineObject, SL_IID_DEVICEVOLUME, &(p->deviceVolume)); if (result != SL_RESULT_SUCCESS) { @@ -169,10 +170,9 @@ static SLresult openSLRecOpen(OPENSL_STREAM* p) } // configure audio source - SLDataLocator_IODevice loc_dev = {SL_DATALOCATOR_IODEVICE, SL_IODEVICE_AUDIOINPUT, - SL_DEFAULTDEVICEID_AUDIOINPUT, NULL - }; - SLDataSource audioSrc = {&loc_dev, NULL}; + SLDataLocator_IODevice loc_dev = { SL_DATALOCATOR_IODEVICE, SL_IODEVICE_AUDIOINPUT, + SL_DEFAULTDEVICEID_AUDIOINPUT, NULL }; + SLDataSource audioSrc = { &loc_dev, NULL }; // configure audio sink int speakers; @@ -181,7 +181,8 @@ static SLresult openSLRecOpen(OPENSL_STREAM* p) else speakers = SL_SPEAKER_FRONT_CENTER; - SLDataLocator_AndroidSimpleBufferQueue loc_bq = {SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, 2}; + SLDataLocator_AndroidSimpleBufferQueue loc_bq = { SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, + 2 }; SLDataFormat_PCM format_pcm; format_pcm.formatType = SL_DATAFORMAT_PCM; format_pcm.numChannels = channels; @@ -202,41 +203,46 @@ static SLresult openSLRecOpen(OPENSL_STREAM* p) else assert(0); - SLDataSink audioSnk = {&loc_bq, &format_pcm}; + SLDataSink audioSnk = { &loc_bq, &format_pcm }; // create audio recorder // (requires the RECORD_AUDIO permission) - const SLInterfaceID id[] = {SL_IID_ANDROIDSIMPLEBUFFERQUEUE}; - const SLboolean req[] = {SL_BOOLEAN_TRUE}; - result = (*p->engineEngine)->CreateAudioRecorder(p->engineEngine, - &(p->recorderObject), &audioSrc, &audioSnk, 1, id, req); + const SLInterfaceID id[] = { SL_IID_ANDROIDSIMPLEBUFFERQUEUE }; + const SLboolean req[] = { SL_BOOLEAN_TRUE }; + result = (*p->engineEngine) + ->CreateAudioRecorder(p->engineEngine, &(p->recorderObject), &audioSrc, + &audioSnk, 1, id, req); assert(!result); - if (SL_RESULT_SUCCESS != result) goto end_recopen; + if (SL_RESULT_SUCCESS != result) + goto end_recopen; // realize the audio recorder result = (*p->recorderObject)->Realize(p->recorderObject, SL_BOOLEAN_FALSE); assert(!result); - if (SL_RESULT_SUCCESS != result) goto end_recopen; + if (SL_RESULT_SUCCESS != result) + goto end_recopen; // get the record interface - result = (*p->recorderObject)->GetInterface(p->recorderObject, - SL_IID_RECORD, &(p->recorderRecord)); + result = (*p->recorderObject) + ->GetInterface(p->recorderObject, SL_IID_RECORD, &(p->recorderRecord)); assert(!result); - if (SL_RESULT_SUCCESS != result) goto end_recopen; + if (SL_RESULT_SUCCESS != result) + goto end_recopen; // get the buffer queue interface - result = (*p->recorderObject)->GetInterface(p->recorderObject, - SL_IID_ANDROIDSIMPLEBUFFERQUEUE, - &(p->recorderBufferQueue)); + result = (*p->recorderObject) + ->GetInterface(p->recorderObject, SL_IID_ANDROIDSIMPLEBUFFERQUEUE, + &(p->recorderBufferQueue)); assert(!result); - if (SL_RESULT_SUCCESS != result) goto end_recopen; + if (SL_RESULT_SUCCESS != result) + goto end_recopen; // register callback on the buffer queue - result = (*p->recorderBufferQueue)->RegisterCallback(p->recorderBufferQueue, - bqRecorderCallback, p); + result = (*p->recorderBufferQueue) + ->RegisterCallback(p->recorderBufferQueue, bqRecorderCallback, p); assert(!result); if (SL_RESULT_SUCCESS != result) @@ -245,7 +251,8 @@ static SLresult openSLRecOpen(OPENSL_STREAM* p) end_recopen: return result; } - else return SL_RESULT_SUCCESS; + else + return SL_RESULT_SUCCESS; } // close the OpenSL IO and destroy the audio engine @@ -299,17 +306,15 @@ static void opensles_queue_element_free(void* obj) } // open the android audio device for input -OPENSL_STREAM* android_OpenRecDevice(void* context, opensl_receive_t receive, - int sr, - int inchannels, - int bufferframes, int bits_per_sample) +OPENSL_STREAM* android_OpenRecDevice(void* context, opensl_receive_t receive, int sr, + int inchannels, int bufferframes, int bits_per_sample) { OPENSL_STREAM* p; if (!context || !receive) return NULL; - p = (OPENSL_STREAM*) calloc(1, sizeof(OPENSL_STREAM)); + p = (OPENSL_STREAM*)calloc(1, sizeof(OPENSL_STREAM)); if (!p) return NULL; @@ -337,12 +342,9 @@ OPENSL_STREAM* android_OpenRecDevice(void* context, opensl_receive_t receive, if (!p->prep || !p->next) goto fail; - (*p->recorderBufferQueue)->Enqueue(p->recorderBufferQueue, - p->next->data, p->next->size); - (*p->recorderBufferQueue)->Enqueue(p->recorderBufferQueue, - p->prep->data, p->prep->size); - (*p->recorderRecord)->SetRecordState(p->recorderRecord, - SL_RECORDSTATE_RECORDING); + (*p->recorderBufferQueue)->Enqueue(p->recorderBufferQueue, p->next->data, p->next->size); + (*p->recorderBufferQueue)->Enqueue(p->recorderBufferQueue, p->prep->data, p->prep->size); + (*p->recorderRecord)->SetRecordState(p->recorderRecord, SL_RECORDSTATE_RECORDING); return p; fail: android_CloseRecDevice(p); @@ -364,7 +366,7 @@ void android_CloseRecDevice(OPENSL_STREAM* p) // this callback handler is called every time a buffer finishes recording static void bqRecorderCallback(SLAndroidSimpleBufferQueueItf bq, void* context) { - OPENSL_STREAM* p = (OPENSL_STREAM*) context; + OPENSL_STREAM* p = (OPENSL_STREAM*)context; queue_element* e; if (!p) @@ -382,7 +384,5 @@ static void bqRecorderCallback(SLAndroidSimpleBufferQueueItf bq, void* context) p->next = p->prep; p->prep = e; - (*p->recorderBufferQueue)->Enqueue(p->recorderBufferQueue, - e->data, e->size); + (*p->recorderBufferQueue)->Enqueue(p->recorderBufferQueue, e->data, e->size); } - diff --git a/channels/audin/client/opensles/opensl_io.h b/channels/audin/client/opensles/opensl_io.h index 6a54b7cce..e99522cfe 100644 --- a/channels/audin/client/opensles/opensl_io.h +++ b/channels/audin/client/opensles/opensl_io.h @@ -6,14 +6,14 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -38,25 +38,25 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct opensl_stream OPENSL_STREAM; + typedef struct opensl_stream OPENSL_STREAM; -typedef void (*opensl_receive_t)(void* context, const void* data, size_t size); + typedef void (*opensl_receive_t)(void* context, const void* data, size_t size); -/* -Open the audio device with a given sampling rate (sr), input and output channels and IO buffer size -in frames. Returns a handle to the OpenSL stream -*/ -FREERDP_LOCAL OPENSL_STREAM* android_OpenRecDevice(void* context, - opensl_receive_t receive, int sr, - int inchannels, - int bufferframes, int bits_per_sample); -/* -Close the audio device -*/ -FREERDP_LOCAL void android_CloseRecDevice(OPENSL_STREAM* p); + /* + Open the audio device with a given sampling rate (sr), input and output channels and IO buffer + size in frames. Returns a handle to the OpenSL stream + */ + FREERDP_LOCAL OPENSL_STREAM* android_OpenRecDevice(void* context, opensl_receive_t receive, + int sr, int inchannels, int bufferframes, + int bits_per_sample); + /* + Close the audio device + */ + FREERDP_LOCAL void android_CloseRecDevice(OPENSL_STREAM* p); #ifdef __cplusplus }; diff --git a/channels/audin/client/oss/audin_oss.c b/channels/audin/client/oss/audin_oss.c index c39e25d00..97eb3496e 100644 --- a/channels/audin/client/oss/audin_oss.c +++ b/channels/audin/client/oss/audin_oss.c @@ -69,10 +69,9 @@ typedef struct _AudinOSSDevice } AudinOSSDevice; #define OSS_LOG_ERR(_text, _error) \ - if (_error != 0) \ + if (_error != 0) \ WLog_ERR(TAG, "%s: %i - %s\n", _text, _error, strerror(_error)); - static UINT32 audin_oss_get_format(const AUDIO_FORMAT* format) { switch (format->wFormatTag) @@ -99,8 +98,7 @@ static UINT32 audin_oss_get_format(const AUDIO_FORMAT* format) return 0; } -static BOOL audin_oss_format_supported(IAudinDevice* device, - const AUDIO_FORMAT* format) +static BOOL audin_oss_format_supported(IAudinDevice* device, const AUDIO_FORMAT* format) { if (device == NULL || format == NULL) return FALSE; @@ -108,8 +106,7 @@ static BOOL audin_oss_format_supported(IAudinDevice* device, switch (format->wFormatTag) { case WAVE_FORMAT_PCM: - if (format->cbSize != 0 || - format->nSamplesPerSec > 48000 || + if (format->cbSize != 0 || format->nSamplesPerSec > 48000 || (format->wBitsPerSample != 8 && format->wBitsPerSample != 16) || (format->nChannels != 1 && format->nChannels != 2)) return FALSE; @@ -233,8 +230,7 @@ static DWORD WINAPI audin_oss_thread_func(LPVOID arg) if (ioctl(pcm_handle, SNDCTL_DSP_SETFRAGMENT, &tmp) == -1) OSS_LOG_ERR("SNDCTL_DSP_SETFRAGMENT failed", errno); - buffer_size = (oss->FramesPerPacket * oss->format.nChannels * - (oss->format.wBitsPerSample / 8)); + buffer_size = (oss->FramesPerPacket * oss->format.nChannels * (oss->format.wBitsPerSample / 8)); buffer = (BYTE*)calloc((buffer_size + sizeof(void*)), sizeof(BYTE)); if (NULL == buffer) @@ -252,7 +248,7 @@ static DWORD WINAPI audin_oss_thread_func(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", error); goto err_out; } @@ -273,7 +269,7 @@ static DWORD WINAPI audin_oss_thread_func(LPVOID arg) if ((error = oss->receive(&oss->format, buffer, buffer_size, oss->user_data))) { - WLog_ERR(TAG, "oss->receive failed with error %"PRIu32"", error); + WLog_ERR(TAG, "oss->receive failed with error %" PRIu32 "", error); break; } } @@ -281,8 +277,7 @@ static DWORD WINAPI audin_oss_thread_func(LPVOID arg) err_out: if (error && oss && oss->rdpcontext) - setChannelError(oss->rdpcontext, error, - "audin_oss_thread_func reported an error"); + setChannelError(oss->rdpcontext, error, "audin_oss_thread_func reported an error"); if (pcm_handle != -1) { @@ -300,8 +295,7 @@ err_out: * * @return 0 on success, otherwise a Win32 error code */ -static UINT audin_oss_open(IAudinDevice* device, AudinReceive receive, - void* user_data) +static UINT audin_oss_open(IAudinDevice* device, AudinReceive receive, void* user_data) { AudinOSSDevice* oss = (AudinOSSDevice*)device; oss->receive = receive; @@ -344,7 +338,7 @@ static UINT audin_oss_close(IAudinDevice* device) if (WaitForSingleObject(oss->thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", error); return error; } @@ -389,21 +383,18 @@ static UINT audin_oss_free(IAudinDevice* device) static UINT audin_oss_parse_addin_args(AudinOSSDevice* device, ADDIN_ARGV* args) { int status; - char* str_num, *eptr; + char *str_num, *eptr; DWORD flags; COMMAND_LINE_ARGUMENT_A* arg; AudinOSSDevice* oss = (AudinOSSDevice*)device; - COMMAND_LINE_ARGUMENT_A audin_oss_args[] = - { - { "dev", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "audio device name" }, - { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } - }; + COMMAND_LINE_ARGUMENT_A audin_oss_args[] = { { "dev", COMMAND_LINE_VALUE_REQUIRED, "", + NULL, NULL, -1, NULL, "audio device name" }, + { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; - - flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | - COMMAND_LINE_IGN_UNKNOWN_KEYWORD; - status = CommandLineParseArgumentsA(args->argc, args->argv, - audin_oss_args, flags, oss, NULL, NULL); + flags = + COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; + status = + CommandLineParseArgumentsA(args->argc, args->argv, audin_oss_args, flags, oss, NULL, NULL); if (status < 0) return ERROR_INVALID_PARAMETER; @@ -416,8 +407,7 @@ static UINT audin_oss_parse_addin_args(AudinOSSDevice* device, ADDIN_ARGV* args) if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "dev") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "dev") { str_num = _strdup(arg->Value); @@ -445,16 +435,15 @@ static UINT audin_oss_parse_addin_args(AudinOSSDevice* device, ADDIN_ARGV* args) free(str_num); } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); return CHANNEL_RC_OK; } #ifdef BUILTIN_CHANNELS -#define freerdp_audin_client_subsystem_entry oss_freerdp_audin_client_subsystem_entry +#define freerdp_audin_client_subsystem_entry oss_freerdp_audin_client_subsystem_entry #else -#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry +#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry #endif /** @@ -462,8 +451,7 @@ static UINT audin_oss_parse_addin_args(AudinOSSDevice* device, ADDIN_ARGV* args) * * @return 0 on success, otherwise a Win32 error code */ -UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS - pEntryPoints) +UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints) { ADDIN_ARGV* args; AudinOSSDevice* oss; @@ -487,14 +475,13 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS if ((error = audin_oss_parse_addin_args(oss, args))) { - WLog_ERR(TAG, "audin_oss_parse_addin_args failed with errorcode %"PRIu32"!", error); + WLog_ERR(TAG, "audin_oss_parse_addin_args failed with errorcode %" PRIu32 "!", error); goto error_out; } - if ((error = pEntryPoints->pRegisterAudinDevice(pEntryPoints->plugin, - (IAudinDevice*) oss))) + if ((error = pEntryPoints->pRegisterAudinDevice(pEntryPoints->plugin, (IAudinDevice*)oss))) { - WLog_ERR(TAG, "RegisterAudinDevice failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "RegisterAudinDevice failed with error %" PRIu32 "!", error); goto error_out; } diff --git a/channels/audin/client/pulse/audin_pulse.c b/channels/audin/client/pulse/audin_pulse.c index af2ef5d4e..4b3b4dc71 100644 --- a/channels/audin/client/pulse/audin_pulse.c +++ b/channels/audin/client/pulse/audin_pulse.c @@ -65,7 +65,7 @@ typedef struct _AudinPulseDevice static void audin_pulse_context_state_callback(pa_context* context, void* userdata) { pa_context_state_t state; - AudinPulseDevice* pulse = (AudinPulseDevice*) userdata; + AudinPulseDevice* pulse = (AudinPulseDevice*)userdata; state = pa_context_get_state(context); switch (state) @@ -95,7 +95,7 @@ static void audin_pulse_context_state_callback(pa_context* context, void* userda static UINT audin_pulse_connect(IAudinDevice* device) { pa_context_state_t state; - AudinPulseDevice* pulse = (AudinPulseDevice*) device; + AudinPulseDevice* pulse = (AudinPulseDevice*)device; if (!pulse->context) return ERROR_INVALID_PARAMETER; @@ -136,7 +136,7 @@ static UINT audin_pulse_connect(IAudinDevice* device) } pa_threaded_mainloop_unlock(pulse->mainloop); - WLog_Print(pulse->log, WLOG_DEBUG, "connected"); + WLog_Print(pulse->log, WLOG_DEBUG, "connected"); return CHANNEL_RC_OK; } @@ -147,7 +147,7 @@ static UINT audin_pulse_connect(IAudinDevice* device) */ static UINT audin_pulse_free(IAudinDevice* device) { - AudinPulseDevice* pulse = (AudinPulseDevice*) device; + AudinPulseDevice* pulse = (AudinPulseDevice*)device; if (!pulse) return ERROR_INVALID_PARAMETER; @@ -176,7 +176,7 @@ static UINT audin_pulse_free(IAudinDevice* device) static BOOL audin_pulse_format_supported(IAudinDevice* device, const AUDIO_FORMAT* format) { - AudinPulseDevice* pulse = (AudinPulseDevice*) device; + AudinPulseDevice* pulse = (AudinPulseDevice*)device; if (!pulse || !format) return FALSE; @@ -187,8 +187,7 @@ static BOOL audin_pulse_format_supported(IAudinDevice* device, const AUDIO_FORMA switch (format->wFormatTag) { case WAVE_FORMAT_PCM: - if (format->cbSize == 0 && - (format->nSamplesPerSec <= PA_RATE_MAX) && + if (format->cbSize == 0 && (format->nSamplesPerSec <= PA_RATE_MAX) && (format->wBitsPerSample == 8 || format->wBitsPerSample == 16) && (format->nChannels >= 1 && format->nChannels <= PA_CHANNELS_MAX)) { @@ -197,10 +196,9 @@ static BOOL audin_pulse_format_supported(IAudinDevice* device, const AUDIO_FORMA break; - case WAVE_FORMAT_ALAW: /* A-LAW */ + case WAVE_FORMAT_ALAW: /* A-LAW */ case WAVE_FORMAT_MULAW: /* U-LAW */ - if (format->cbSize == 0 && - (format->nSamplesPerSec <= PA_RATE_MAX) && + if (format->cbSize == 0 && (format->nSamplesPerSec <= PA_RATE_MAX) && (format->wBitsPerSample == 8) && (format->nChannels >= 1 && format->nChannels <= PA_CHANNELS_MAX)) { @@ -225,7 +223,7 @@ static UINT audin_pulse_set_format(IAudinDevice* device, const AUDIO_FORMAT* for UINT32 FramesPerPacket) { pa_sample_spec sample_spec = { 0 }; - AudinPulseDevice* pulse = (AudinPulseDevice*) device; + AudinPulseDevice* pulse = (AudinPulseDevice*)device; if (!pulse || !format) return ERROR_INVALID_PARAMETER; @@ -278,7 +276,7 @@ static UINT audin_pulse_set_format(IAudinDevice* device, const AUDIO_FORMAT* for static void audin_pulse_stream_state_callback(pa_stream* stream, void* userdata) { pa_stream_state_t state; - AudinPulseDevice* pulse = (AudinPulseDevice*) userdata; + AudinPulseDevice* pulse = (AudinPulseDevice*)userdata; state = pa_stream_get_state(stream); switch (state) @@ -303,17 +301,17 @@ static void audin_pulse_stream_state_callback(pa_stream* stream, void* userdata) static void audin_pulse_stream_request_callback(pa_stream* stream, size_t length, void* userdata) { const void* data; - AudinPulseDevice* pulse = (AudinPulseDevice*) userdata; + AudinPulseDevice* pulse = (AudinPulseDevice*)userdata; UINT error = CHANNEL_RC_OK; pa_stream_peek(stream, &data, &length); - error = IFCALLRESULT(CHANNEL_RC_OK, pulse->receive, &pulse->format, data, length, pulse->user_data); + error = + IFCALLRESULT(CHANNEL_RC_OK, pulse->receive, &pulse->format, data, length, pulse->user_data); pa_stream_drop(stream); if (error && pulse->rdpcontext) setChannelError(pulse->rdpcontext, error, "audin_pulse_thread_func reported an error"); } - /** * Function description * @@ -321,7 +319,7 @@ static void audin_pulse_stream_request_callback(pa_stream* stream, size_t length */ static UINT audin_pulse_close(IAudinDevice* device) { - AudinPulseDevice* pulse = (AudinPulseDevice*) device; + AudinPulseDevice* pulse = (AudinPulseDevice*)device; if (!pulse) return ERROR_INVALID_PARAMETER; @@ -349,7 +347,7 @@ static UINT audin_pulse_open(IAudinDevice* device, AudinReceive receive, void* u { pa_stream_state_t state; pa_buffer_attr buffer_attr = { 0 }; - AudinPulseDevice* pulse = (AudinPulseDevice*) device; + AudinPulseDevice* pulse = (AudinPulseDevice*)device; if (!pulse || !receive || !user_data) return ERROR_INVALID_PARAMETER; @@ -363,8 +361,7 @@ static UINT audin_pulse_open(IAudinDevice* device, AudinReceive receive, void* u pulse->receive = receive; pulse->user_data = user_data; pa_threaded_mainloop_lock(pulse->mainloop); - pulse->stream = pa_stream_new(pulse->context, "freerdp_audin", - &pulse->sample_spec, NULL); + pulse->stream = pa_stream_new(pulse->context, "freerdp_audin", &pulse->sample_spec, NULL); if (!pulse->stream) { @@ -375,24 +372,21 @@ static UINT audin_pulse_open(IAudinDevice* device, AudinReceive receive, void* u } pulse->bytes_per_frame = pa_frame_size(&pulse->sample_spec); - pa_stream_set_state_callback(pulse->stream, - audin_pulse_stream_state_callback, pulse); - pa_stream_set_read_callback(pulse->stream, - audin_pulse_stream_request_callback, pulse); - buffer_attr.maxlength = (UINT32) - 1; - buffer_attr.tlength = (UINT32) - 1; - buffer_attr.prebuf = (UINT32) - 1; - buffer_attr.minreq = (UINT32) - 1; + pa_stream_set_state_callback(pulse->stream, audin_pulse_stream_state_callback, pulse); + pa_stream_set_read_callback(pulse->stream, audin_pulse_stream_request_callback, pulse); + buffer_attr.maxlength = (UINT32)-1; + buffer_attr.tlength = (UINT32)-1; + buffer_attr.prebuf = (UINT32)-1; + buffer_attr.minreq = (UINT32)-1; /* 500ms latency */ buffer_attr.fragsize = pulse->bytes_per_frame * pulse->frames_per_packet; if (buffer_attr.fragsize % pulse->format.nBlockAlign) - buffer_attr.fragsize += pulse->format.nBlockAlign - buffer_attr.fragsize % - pulse->format.nBlockAlign; + buffer_attr.fragsize += + pulse->format.nBlockAlign - buffer_attr.fragsize % pulse->format.nBlockAlign; - if (pa_stream_connect_record(pulse->stream, - pulse->device_name, - &buffer_attr, PA_STREAM_ADJUST_LATENCY) < 0) + if (pa_stream_connect_record(pulse->stream, pulse->device_name, &buffer_attr, + PA_STREAM_ADJUST_LATENCY) < 0) { pa_threaded_mainloop_unlock(pulse->mainloop); WLog_Print(pulse->log, WLOG_ERROR, "pa_stream_connect_playback failed (%d)", @@ -435,16 +429,15 @@ static UINT audin_pulse_parse_addin_args(AudinPulseDevice* device, ADDIN_ARGV* a int status; DWORD flags; COMMAND_LINE_ARGUMENT_A* arg; - AudinPulseDevice* pulse = (AudinPulseDevice*) device; - COMMAND_LINE_ARGUMENT_A audin_pulse_args[] = - { - { "dev", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "audio device name" }, - { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } - }; + AudinPulseDevice* pulse = (AudinPulseDevice*)device; + COMMAND_LINE_ARGUMENT_A audin_pulse_args[] = { { "dev", COMMAND_LINE_VALUE_REQUIRED, "", + NULL, NULL, -1, NULL, "audio device name" }, + { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; - flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; - status = CommandLineParseArgumentsA(args->argc, args->argv, audin_pulse_args, flags, - pulse, NULL, NULL); + flags = + COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; + status = CommandLineParseArgumentsA(args->argc, args->argv, audin_pulse_args, flags, pulse, + NULL, NULL); if (status < 0) return ERROR_INVALID_PARAMETER; @@ -456,8 +449,7 @@ static UINT audin_pulse_parse_addin_args(AudinPulseDevice* device, ADDIN_ARGV* a if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "dev") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "dev") { pulse->device_name = _strdup(arg->Value); @@ -468,16 +460,15 @@ static UINT audin_pulse_parse_addin_args(AudinPulseDevice* device, ADDIN_ARGV* a } } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); return CHANNEL_RC_OK; } #ifdef BUILTIN_CHANNELS -#define freerdp_audin_client_subsystem_entry pulse_freerdp_audin_client_subsystem_entry +#define freerdp_audin_client_subsystem_entry pulse_freerdp_audin_client_subsystem_entry #else -#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry +#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry #endif /** @@ -490,7 +481,7 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEn ADDIN_ARGV* args; AudinPulseDevice* pulse; UINT error; - pulse = (AudinPulseDevice*) calloc(1, sizeof(AudinPulseDevice)); + pulse = (AudinPulseDevice*)calloc(1, sizeof(AudinPulseDevice)); if (!pulse) { @@ -509,8 +500,8 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEn if ((error = audin_pulse_parse_addin_args(pulse, args))) { - WLog_Print(pulse->log, WLOG_ERROR, "audin_pulse_parse_addin_args failed with error %"PRIu32"!", - error); + WLog_Print(pulse->log, WLOG_ERROR, + "audin_pulse_parse_addin_args failed with error %" PRIu32 "!", error); goto error_out; } @@ -534,15 +525,16 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEn pa_context_set_state_callback(pulse->context, audin_pulse_context_state_callback, pulse); - if ((error = audin_pulse_connect((IAudinDevice*) pulse))) + if ((error = audin_pulse_connect((IAudinDevice*)pulse))) { WLog_Print(pulse->log, WLOG_ERROR, "audin_pulse_connect failed"); goto error_out; } - if ((error = pEntryPoints->pRegisterAudinDevice(pEntryPoints->plugin, (IAudinDevice*) pulse))) + if ((error = pEntryPoints->pRegisterAudinDevice(pEntryPoints->plugin, (IAudinDevice*)pulse))) { - WLog_Print(pulse->log, WLOG_ERROR, "RegisterAudinDevice failed with error %"PRIu32"!", error); + WLog_Print(pulse->log, WLOG_ERROR, "RegisterAudinDevice failed with error %" PRIu32 "!", + error); goto error_out; } @@ -551,4 +543,3 @@ error_out: audin_pulse_free((IAudinDevice*)pulse); return error; } - diff --git a/channels/audin/client/winmm/audin_winmm.c b/channels/audin/client/winmm/audin_winmm.c index 495c9e18c..68e355fd5 100644 --- a/channels/audin/client/winmm/audin_winmm.c +++ b/channels/audin/client/winmm/audin_winmm.c @@ -59,7 +59,7 @@ typedef struct _AudinWinmmDevice static void CALLBACK waveInProc(HWAVEIN hWaveIn, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { - AudinWinmmDevice* winmm = (AudinWinmmDevice*) dwInstance; + AudinWinmmDevice* winmm = (AudinWinmmDevice*)dwInstance; PWAVEHDR pWaveHdr; UINT error = CHANNEL_RC_OK; MMRESULT mmResult; @@ -74,8 +74,8 @@ static void CALLBACK waveInProc(HWAVEIN hWaveIn, UINT uMsg, DWORD_PTR dwInstance if (WHDR_DONE == (WHDR_DONE & pWaveHdr->dwFlags)) { - if (pWaveHdr->dwBytesRecorded - && !(WaitForSingleObject(winmm->stopEvent, 0) == WAIT_OBJECT_0)) + if (pWaveHdr->dwBytesRecorded && + !(WaitForSingleObject(winmm->stopEvent, 0) == WAIT_OBJECT_0)) { AUDIO_FORMAT format; format.cbSize = winmm->pwfx_cur->cbSize; @@ -86,8 +86,8 @@ static void CALLBACK waveInProc(HWAVEIN hWaveIn, UINT uMsg, DWORD_PTR dwInstance format.wBitsPerSample = winmm->pwfx_cur->wBitsPerSample; format.wFormatTag = winmm->pwfx_cur->wFormatTag; - if ((error = winmm->receive(&format, pWaveHdr->lpData, pWaveHdr->dwBytesRecorded, - winmm->user_data))) + if ((error = winmm->receive(&format, pWaveHdr->lpData, + pWaveHdr->dwBytesRecorded, winmm->user_data))) break; mmResult = waveInAddBuffer(hWaveIn, pWaveHdr, sizeof(WAVEHDR)); @@ -112,7 +112,7 @@ static void CALLBACK waveInProc(HWAVEIN hWaveIn, UINT uMsg, DWORD_PTR dwInstance static DWORD WINAPI audin_winmm_thread_func(LPVOID arg) { - AudinWinmmDevice* winmm = (AudinWinmmDevice*) arg; + AudinWinmmDevice* winmm = (AudinWinmmDevice*)arg; char* buffer; int size, i; WAVEHDR waveHdr[4]; @@ -122,7 +122,8 @@ static DWORD WINAPI audin_winmm_thread_func(LPVOID arg) if (!winmm->hWaveIn) { if (MMSYSERR_NOERROR != waveInOpen(&winmm->hWaveIn, WAVE_MAPPER, winmm->pwfx_cur, - (DWORD_PTR)waveInProc, (DWORD_PTR)winmm, CALLBACK_FUNCTION)) + (DWORD_PTR)waveInProc, (DWORD_PTR)winmm, + CALLBACK_FUNCTION)) { if (winmm->rdpcontext) setChannelError(winmm->rdpcontext, ERROR_INTERNAL_ERROR, @@ -132,12 +133,14 @@ static DWORD WINAPI audin_winmm_thread_func(LPVOID arg) } } - size = (winmm->pwfx_cur->wBitsPerSample * winmm->pwfx_cur->nChannels * winmm->frames_per_packet + - 7) / 8; + size = + (winmm->pwfx_cur->wBitsPerSample * winmm->pwfx_cur->nChannels * winmm->frames_per_packet + + 7) / + 8; for (i = 0; i < 4; i++) { - buffer = (char*) malloc(size); + buffer = (char*)malloc(size); if (!buffer) return CHANNEL_RC_NO_MEMORY; @@ -149,7 +152,7 @@ static DWORD WINAPI audin_winmm_thread_func(LPVOID arg) if (MMSYSERR_NOERROR != rc) { - WLog_Print(winmm->log, WLOG_DEBUG, "waveInPrepareHeader failed. %"PRIu32"", rc); + WLog_Print(winmm->log, WLOG_DEBUG, "waveInPrepareHeader failed. %" PRIu32 "", rc); if (winmm->rdpcontext) setChannelError(winmm->rdpcontext, ERROR_INTERNAL_ERROR, @@ -160,7 +163,7 @@ static DWORD WINAPI audin_winmm_thread_func(LPVOID arg) if (MMSYSERR_NOERROR != rc) { - WLog_Print(winmm->log, WLOG_DEBUG, "waveInAddBuffer failed. %"PRIu32"", rc); + WLog_Print(winmm->log, WLOG_DEBUG, "waveInAddBuffer failed. %" PRIu32 "", rc); if (winmm->rdpcontext) setChannelError(winmm->rdpcontext, ERROR_INTERNAL_ERROR, @@ -172,7 +175,7 @@ static DWORD WINAPI audin_winmm_thread_func(LPVOID arg) if (MMSYSERR_NOERROR != rc) { - WLog_Print(winmm->log, WLOG_DEBUG, "waveInStart failed. %"PRIu32"", rc); + WLog_Print(winmm->log, WLOG_DEBUG, "waveInStart failed. %" PRIu32 "", rc); if (winmm->rdpcontext) setChannelError(winmm->rdpcontext, ERROR_INTERNAL_ERROR, @@ -194,7 +197,7 @@ static DWORD WINAPI audin_winmm_thread_func(LPVOID arg) if (MMSYSERR_NOERROR != rc) { - WLog_Print(winmm->log, WLOG_DEBUG, "waveInReset failed. %"PRIu32"", rc); + WLog_Print(winmm->log, WLOG_DEBUG, "waveInReset failed. %" PRIu32 "", rc); if (winmm->rdpcontext) setChannelError(winmm->rdpcontext, ERROR_INTERNAL_ERROR, @@ -207,7 +210,7 @@ static DWORD WINAPI audin_winmm_thread_func(LPVOID arg) if (MMSYSERR_NOERROR != rc) { - WLog_Print(winmm->log, WLOG_DEBUG, "waveInUnprepareHeader failed. %"PRIu32"", rc); + WLog_Print(winmm->log, WLOG_DEBUG, "waveInUnprepareHeader failed. %" PRIu32 "", rc); if (winmm->rdpcontext) setChannelError(winmm->rdpcontext, ERROR_INTERNAL_ERROR, @@ -221,7 +224,7 @@ static DWORD WINAPI audin_winmm_thread_func(LPVOID arg) if (MMSYSERR_NOERROR != rc) { - WLog_Print(winmm->log, WLOG_DEBUG, "waveInClose failed. %"PRIu32"", rc); + WLog_Print(winmm->log, WLOG_DEBUG, "waveInClose failed. %" PRIu32 "", rc); if (winmm->rdpcontext) setChannelError(winmm->rdpcontext, ERROR_INTERNAL_ERROR, @@ -240,7 +243,7 @@ static DWORD WINAPI audin_winmm_thread_func(LPVOID arg) static UINT audin_winmm_free(IAudinDevice* device) { UINT32 i; - AudinWinmmDevice* winmm = (AudinWinmmDevice*) device; + AudinWinmmDevice* winmm = (AudinWinmmDevice*)device; if (!winmm) return ERROR_INVALID_PARAMETER; @@ -265,7 +268,7 @@ static UINT audin_winmm_close(IAudinDevice* device) { DWORD status; UINT error = CHANNEL_RC_OK; - AudinWinmmDevice* winmm = (AudinWinmmDevice*) device; + AudinWinmmDevice* winmm = (AudinWinmmDevice*)device; if (!winmm) return ERROR_INVALID_PARAMETER; @@ -276,7 +279,8 @@ static UINT audin_winmm_close(IAudinDevice* device) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_Print(winmm->log, WLOG_ERROR, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_Print(winmm->log, WLOG_ERROR, "WaitForSingleObject failed with error %" PRIu32 "!", + error); return error; } @@ -298,7 +302,7 @@ static UINT audin_winmm_set_format(IAudinDevice* device, const AUDIO_FORMAT* for UINT32 FramesPerPacket) { UINT32 i; - AudinWinmmDevice* winmm = (AudinWinmmDevice*) device; + AudinWinmmDevice* winmm = (AudinWinmmDevice*)device; if (!winmm || !format) return ERROR_INVALID_PARAMETER; @@ -307,9 +311,9 @@ static UINT audin_winmm_set_format(IAudinDevice* device, const AUDIO_FORMAT* for for (i = 0; i < winmm->cFormats; i++) { - if (winmm->ppwfx[i]->wFormatTag == format->wFormatTag - && winmm->ppwfx[i]->nChannels == format->nChannels - && winmm->ppwfx[i]->wBitsPerSample == format->wBitsPerSample) + if (winmm->ppwfx[i]->wFormatTag == format->wFormatTag && + winmm->ppwfx[i]->nChannels == format->nChannels && + winmm->ppwfx[i]->wBitsPerSample == format->wBitsPerSample) { winmm->pwfx_cur = winmm->ppwfx[i]; break; @@ -321,7 +325,7 @@ static UINT audin_winmm_set_format(IAudinDevice* device, const AUDIO_FORMAT* for static BOOL audin_winmm_format_supported(IAudinDevice* device, const AUDIO_FORMAT* format) { - AudinWinmmDevice* winmm = (AudinWinmmDevice*) device; + AudinWinmmDevice* winmm = (AudinWinmmDevice*)device; PWAVEFORMATEX pwfx; BYTE* data; @@ -376,7 +380,7 @@ static BOOL audin_winmm_format_supported(IAudinDevice* device, const AUDIO_FORMA */ static UINT audin_winmm_open(IAudinDevice* device, AudinReceive receive, void* user_data) { - AudinWinmmDevice* winmm = (AudinWinmmDevice*) device; + AudinWinmmDevice* winmm = (AudinWinmmDevice*)device; if (!winmm || !receive || !user_data) return ERROR_INVALID_PARAMETER; @@ -390,8 +394,7 @@ static UINT audin_winmm_open(IAudinDevice* device, AudinReceive receive, void* u return ERROR_INTERNAL_ERROR; } - if (!(winmm->thread = CreateThread(NULL, 0, - audin_winmm_thread_func, winmm, 0, NULL))) + if (!(winmm->thread = CreateThread(NULL, 0, audin_winmm_thread_func, winmm, 0, NULL))) { WLog_Print(winmm->log, WLOG_ERROR, "CreateThread failed!"); CloseHandle(winmm->stopEvent); @@ -412,16 +415,15 @@ static UINT audin_winmm_parse_addin_args(AudinWinmmDevice* device, ADDIN_ARGV* a int status; DWORD flags; COMMAND_LINE_ARGUMENT_A* arg; - AudinWinmmDevice* winmm = (AudinWinmmDevice*) device; - COMMAND_LINE_ARGUMENT_A audin_winmm_args[] = - { - { "dev", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "audio device name" }, - { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } - }; + AudinWinmmDevice* winmm = (AudinWinmmDevice*)device; + COMMAND_LINE_ARGUMENT_A audin_winmm_args[] = { { "dev", COMMAND_LINE_VALUE_REQUIRED, "", + NULL, NULL, -1, NULL, "audio device name" }, + { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; - flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; - status = CommandLineParseArgumentsA(args->argc, args->argv, audin_winmm_args, flags, - winmm, NULL, NULL); + flags = + COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; + status = CommandLineParseArgumentsA(args->argc, args->argv, audin_winmm_args, flags, winmm, + NULL, NULL); arg = audin_winmm_args; do @@ -429,8 +431,7 @@ static UINT audin_winmm_parse_addin_args(AudinWinmmDevice* device, ADDIN_ARGV* a if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "dev") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "dev") { winmm->device_name = _strdup(arg->Value); @@ -441,16 +442,15 @@ static UINT audin_winmm_parse_addin_args(AudinWinmmDevice* device, ADDIN_ARGV* a } } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); return CHANNEL_RC_OK; } #ifdef BUILTIN_CHANNELS -#define freerdp_audin_client_subsystem_entry winmm_freerdp_audin_client_subsystem_entry +#define freerdp_audin_client_subsystem_entry winmm_freerdp_audin_client_subsystem_entry #else -#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry +#define freerdp_audin_client_subsystem_entry FREERDP_API freerdp_audin_client_subsystem_entry #endif /** @@ -463,7 +463,7 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEn ADDIN_ARGV* args; AudinWinmmDevice* winmm; UINT error; - winmm = (AudinWinmmDevice*) calloc(1, sizeof(AudinWinmmDevice)); + winmm = (AudinWinmmDevice*)calloc(1, sizeof(AudinWinmmDevice)); if (!winmm) { @@ -482,8 +482,8 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEn if ((error = audin_winmm_parse_addin_args(winmm, args))) { - WLog_Print(winmm->log, WLOG_ERROR, "audin_winmm_parse_addin_args failed with error %"PRIu32"!", - error); + WLog_Print(winmm->log, WLOG_ERROR, + "audin_winmm_parse_addin_args failed with error %" PRIu32 "!", error); goto error_out; } @@ -509,9 +509,10 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEn goto error_out; } - if ((error = pEntryPoints->pRegisterAudinDevice(pEntryPoints->plugin, (IAudinDevice*) winmm))) + if ((error = pEntryPoints->pRegisterAudinDevice(pEntryPoints->plugin, (IAudinDevice*)winmm))) { - WLog_Print(winmm->log, WLOG_ERROR, "RegisterAudinDevice failed with error %"PRIu32"!", error); + WLog_Print(winmm->log, WLOG_ERROR, "RegisterAudinDevice failed with error %" PRIu32 "!", + error); goto error_out; } diff --git a/channels/audin/server/audin.c b/channels/audin/server/audin.c index f5216676d..aa1979ce5 100644 --- a/channels/audin/server/audin.c +++ b/channels/audin/server/audin.c @@ -39,13 +39,13 @@ #include #define TAG CHANNELS_TAG("audin.server") -#define MSG_SNDIN_VERSION 0x01 -#define MSG_SNDIN_FORMATS 0x02 -#define MSG_SNDIN_OPEN 0x03 -#define MSG_SNDIN_OPEN_REPLY 0x04 -#define MSG_SNDIN_DATA_INCOMING 0x05 -#define MSG_SNDIN_DATA 0x06 -#define MSG_SNDIN_FORMATCHANGE 0x07 +#define MSG_SNDIN_VERSION 0x01 +#define MSG_SNDIN_FORMATS 0x02 +#define MSG_SNDIN_OPEN 0x03 +#define MSG_SNDIN_OPEN_REPLY 0x04 +#define MSG_SNDIN_DATA_INCOMING 0x05 +#define MSG_SNDIN_DATA 0x06 +#define MSG_SNDIN_FORMATCHANGE 0x07 typedef struct _audin_server { @@ -69,15 +69,13 @@ typedef struct _audin_server * * @return 0 on success, otherwise a Win32 error code */ -static UINT audin_server_select_format(audin_server_context* context, - size_t client_format_index) +static UINT audin_server_select_format(audin_server_context* context, size_t client_format_index) { - audin_server* audin = (audin_server*) context; + audin_server* audin = (audin_server*)context; if (client_format_index >= context->num_client_formats) { - WLog_ERR(TAG, - "error in protocol: client_format_index >= context->num_client_formats!"); + WLog_ERR(TAG, "error in protocol: client_format_index >= context->num_client_formats!"); return ERROR_INVALID_DATA; } @@ -109,7 +107,7 @@ static UINT audin_server_send_version(audin_server* audin, wStream* s) Stream_Write_UINT8(s, MSG_SNDIN_VERSION); Stream_Write_UINT32(s, 1); /* Version (4 bytes) */ - if (!WTSVirtualChannelWrite(audin->audin_channel, (PCHAR) Stream_Buffer(s), + if (!WTSVirtualChannelWrite(audin->audin_channel, (PCHAR)Stream_Buffer(s), Stream_GetPosition(s), &written)) { WLog_ERR(TAG, "WTSVirtualChannelWrite failed!"); @@ -124,14 +122,13 @@ static UINT audin_server_send_version(audin_server* audin, wStream* s) * * @return 0 on success, otherwise a Win32 error code */ -static UINT audin_server_recv_version(audin_server* audin, wStream* s, - UINT32 length) +static UINT audin_server_recv_version(audin_server* audin, wStream* s, UINT32 length) { UINT32 Version; if (length < 4) { - WLog_ERR(TAG, "error parsing version info: expected at least 4 bytes, got %"PRIu32"", + WLog_ERR(TAG, "error parsing version info: expected at least 4 bytes, got %" PRIu32 "", length); return ERROR_INVALID_DATA; } @@ -140,7 +137,7 @@ static UINT audin_server_recv_version(audin_server* audin, wStream* s, if (Version < 1) { - WLog_ERR(TAG, "expected Version > 0 but got %"PRIu32"", Version); + WLog_ERR(TAG, "expected Version > 0 but got %" PRIu32 "", Version); return ERROR_INVALID_DATA; } @@ -158,16 +155,15 @@ static UINT audin_server_send_formats(audin_server* audin, wStream* s) ULONG written; Stream_SetPosition(s, 0); Stream_Write_UINT8(s, MSG_SNDIN_FORMATS); - Stream_Write_UINT32(s, - audin->context.num_server_formats); /* NumFormats (4 bytes) */ - Stream_Write_UINT32(s, - 0); /* cbSizeFormatsPacket (4 bytes), client-to-server only */ + Stream_Write_UINT32(s, audin->context.num_server_formats); /* NumFormats (4 bytes) */ + Stream_Write_UINT32(s, 0); /* cbSizeFormatsPacket (4 bytes), client-to-server only */ for (i = 0; i < audin->context.num_server_formats; i++) { AUDIO_FORMAT format = audin->context.server_formats[i]; // TODO: Eliminate this - format.nAvgBytesPerSec = format.nSamplesPerSec * format.nChannels * format.wBitsPerSample / 8; + format.nAvgBytesPerSec = + format.nSamplesPerSec * format.nChannels * format.wBitsPerSample / 8; if (!audio_format_write(s, &format)) { @@ -176,8 +172,10 @@ static UINT audin_server_send_formats(audin_server* audin, wStream* s) } } - return WTSVirtualChannelWrite(audin->audin_channel, (PCHAR) Stream_Buffer(s), - Stream_GetPosition(s), &written) ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; + return WTSVirtualChannelWrite(audin->audin_channel, (PCHAR)Stream_Buffer(s), + Stream_GetPosition(s), &written) + ? CHANNEL_RC_OK + : ERROR_INTERNAL_ERROR; } /** @@ -185,22 +183,20 @@ static UINT audin_server_send_formats(audin_server* audin, wStream* s) * * @return 0 on success, otherwise a Win32 error code */ -static UINT audin_server_recv_formats(audin_server* audin, wStream* s, - UINT32 length) +static UINT audin_server_recv_formats(audin_server* audin, wStream* s, UINT32 length) { size_t i; UINT success = CHANNEL_RC_OK; if (length < 8) { - WLog_ERR(TAG, "error parsing rec formats: expected at least 8 bytes, got %"PRIu32"", + WLog_ERR(TAG, "error parsing rec formats: expected at least 8 bytes, got %" PRIu32 "", length); return ERROR_INVALID_DATA; } - Stream_Read_UINT32(s, - audin->context.num_client_formats); /* NumFormats (4 bytes) */ - Stream_Seek_UINT32(s); /* cbSizeFormatsPacket (4 bytes) */ + Stream_Read_UINT32(s, audin->context.num_client_formats); /* NumFormats (4 bytes) */ + Stream_Seek_UINT32(s); /* cbSizeFormatsPacket (4 bytes) */ length -= 8; if (audin->context.num_client_formats <= 0) @@ -223,7 +219,7 @@ static UINT audin_server_recv_formats(audin_server* audin, wStream* s, { audio_formats_free(audin->context.client_formats, i); audin->context.client_formats = NULL; - WLog_ERR(TAG, "expected length at least 18, but got %"PRIu32"", length); + WLog_ERR(TAG, "expected length at least 18, but got %" PRIu32 "", length); return ERROR_INVALID_DATA; } @@ -233,7 +229,7 @@ static UINT audin_server_recv_formats(audin_server* audin, wStream* s, IFCALLRET(audin->context.Opening, success, &audin->context); if (success) - WLog_ERR(TAG, "context.Opening failed with error %"PRIu32"", success); + WLog_ERR(TAG, "context.Opening failed with error %" PRIu32 "", success); return success; } @@ -257,24 +253,24 @@ static UINT audin_server_send_open(audin_server* audin, wStream* s) audin->opened = TRUE; Stream_SetPosition(s, 0); Stream_Write_UINT8(s, MSG_SNDIN_OPEN); - Stream_Write_UINT32(s, - audin->context.frames_per_packet); /* FramesPerPacket (4 bytes) */ - Stream_Write_UINT32(s, - audin->context.selected_client_format); /* initialFormat (4 bytes) */ + Stream_Write_UINT32(s, audin->context.frames_per_packet); /* FramesPerPacket (4 bytes) */ + Stream_Write_UINT32(s, audin->context.selected_client_format); /* initialFormat (4 bytes) */ /* * [MS-RDPEAI] 3.2.5.1.6 * The second format specify the format that SHOULD be used to capture data from * the actual audio input device. */ - Stream_Write_UINT16(s, 1); /* wFormatTag = PCM */ - Stream_Write_UINT16(s, 2); /* nChannels */ - Stream_Write_UINT32(s, 44100); /* nSamplesPerSec */ + Stream_Write_UINT16(s, 1); /* wFormatTag = PCM */ + Stream_Write_UINT16(s, 2); /* nChannels */ + Stream_Write_UINT32(s, 44100); /* nSamplesPerSec */ Stream_Write_UINT32(s, 44100 * 2 * 2); /* nAvgBytesPerSec */ - Stream_Write_UINT16(s, 4); /* nBlockAlign */ - Stream_Write_UINT16(s, 16); /* wBitsPerSample */ - Stream_Write_UINT16(s, 0); /* cbSize */ - return WTSVirtualChannelWrite(audin->audin_channel, (PCHAR) Stream_Buffer(s), - Stream_GetPosition(s), &written) ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; + Stream_Write_UINT16(s, 4); /* nBlockAlign */ + Stream_Write_UINT16(s, 16); /* wBitsPerSample */ + Stream_Write_UINT16(s, 0); /* cbSize */ + return WTSVirtualChannelWrite(audin->audin_channel, (PCHAR)Stream_Buffer(s), + Stream_GetPosition(s), &written) + ? CHANNEL_RC_OK + : ERROR_INTERNAL_ERROR; } /** @@ -282,15 +278,14 @@ static UINT audin_server_send_open(audin_server* audin, wStream* s) * * @return 0 on success, otherwise a Win32 error code */ -static UINT audin_server_recv_open_reply(audin_server* audin, wStream* s, - UINT32 length) +static UINT audin_server_recv_open_reply(audin_server* audin, wStream* s, UINT32 length) { UINT32 Result; UINT success = CHANNEL_RC_OK; if (length < 4) { - WLog_ERR(TAG, "error parsing version info: expected at least 4 bytes, got %"PRIu32"", + WLog_ERR(TAG, "error parsing version info: expected at least 4 bytes, got %" PRIu32 "", length); return ERROR_INVALID_DATA; } @@ -299,7 +294,7 @@ static UINT audin_server_recv_open_reply(audin_server* audin, wStream* s, IFCALLRET(audin->context.OpenResult, success, &audin->context, Result); if (success) - WLog_ERR(TAG, "context.OpenResult failed with error %"PRIu32"", success); + WLog_ERR(TAG, "context.OpenResult failed with error %" PRIu32 "", success); return success; } @@ -309,8 +304,7 @@ static UINT audin_server_recv_open_reply(audin_server* audin, wStream* s, * * @return 0 on success, otherwise a Win32 error code */ -static UINT audin_server_recv_data(audin_server* audin, wStream* s, - UINT32 length) +static UINT audin_server_recv_data(audin_server* audin, wStream* s, UINT32 length) { AUDIO_FORMAT* format; int sbytes_per_sample; @@ -346,7 +340,7 @@ static UINT audin_server_recv_data(audin_server* audin, wStream* s, IFCALLRET(audin->context.ReceiveSamples, success, &audin->context, &dformat, out, frames); if (success) - WLog_ERR(TAG, "context.ReceiveSamples failed with error %"PRIu32"", success); + WLog_ERR(TAG, "context.ReceiveSamples failed with error %" PRIu32 "", success); } else WLog_ERR(TAG, "freerdp_dsp_decode failed!"); @@ -365,7 +359,7 @@ static DWORD WINAPI audin_server_thread_func(LPVOID arg) BOOL ready = FALSE; HANDLE ChannelEvent; DWORD BytesReturned = 0; - audin_server* audin = (audin_server*) arg; + audin_server* audin = (audin_server*)arg; UINT error = CHANNEL_RC_OK; DWORD status; buffer = NULL; @@ -395,26 +389,25 @@ static DWORD WINAPI audin_server_thread_func(LPVOID arg) while (1) { - if ((status = WaitForMultipleObjects(nCount, events, FALSE, - 100)) == WAIT_OBJECT_0) + if ((status = WaitForMultipleObjects(nCount, events, FALSE, 100)) == WAIT_OBJECT_0) goto out; if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "", error); goto out; } - if (WTSVirtualChannelQuery(audin->audin_channel, WTSVirtualChannelReady, - &buffer, &BytesReturned) == FALSE) + if (WTSVirtualChannelQuery(audin->audin_channel, WTSVirtualChannelReady, &buffer, + &BytesReturned) == FALSE) { WLog_ERR(TAG, "WTSVirtualChannelQuery failed"); error = ERROR_INTERNAL_ERROR; goto out; } - ready = *((BOOL*) buffer); + ready = *((BOOL*)buffer); WTSFreeMemory(buffer); if (ready) @@ -434,21 +427,20 @@ static DWORD WINAPI audin_server_thread_func(LPVOID arg) { if ((error = audin_server_send_version(audin, s))) { - WLog_ERR(TAG, "audin_server_send_version failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "audin_server_send_version failed with error %" PRIu32 "!", error); goto out_capacity; } } while (ready) { - if ((status = WaitForMultipleObjects(nCount, events, FALSE, - INFINITE)) == WAIT_OBJECT_0) + if ((status = WaitForMultipleObjects(nCount, events, FALSE, INFINITE)) == WAIT_OBJECT_0) break; if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "", error); goto out; } @@ -467,7 +459,7 @@ static DWORD WINAPI audin_server_thread_func(LPVOID arg) if (!Stream_EnsureRemainingCapacity(s, BytesReturned)) break; - if (WTSVirtualChannelRead(audin->audin_channel, 0, (PCHAR) Stream_Buffer(s), + if (WTSVirtualChannelRead(audin->audin_channel, 0, (PCHAR)Stream_Buffer(s), Stream_Capacity(s), &BytesReturned) == FALSE) { WLog_ERR(TAG, "WTSVirtualChannelRead failed!"); @@ -483,13 +475,15 @@ static DWORD WINAPI audin_server_thread_func(LPVOID arg) case MSG_SNDIN_VERSION: if ((error = audin_server_recv_version(audin, s, BytesReturned))) { - WLog_ERR(TAG, "audin_server_recv_version failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "audin_server_recv_version failed with error %" PRIu32 "!", + error); goto out_capacity; } if ((error = audin_server_send_formats(audin, s))) { - WLog_ERR(TAG, "audin_server_send_formats failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "audin_server_send_formats failed with error %" PRIu32 "!", + error); goto out_capacity; } @@ -498,13 +492,14 @@ static DWORD WINAPI audin_server_thread_func(LPVOID arg) case MSG_SNDIN_FORMATS: if ((error = audin_server_recv_formats(audin, s, BytesReturned))) { - WLog_ERR(TAG, "audin_server_recv_formats failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "audin_server_recv_formats failed with error %" PRIu32 "!", + error); goto out_capacity; } if ((error = audin_server_send_open(audin, s))) { - WLog_ERR(TAG, "audin_server_send_open failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "audin_server_send_open failed with error %" PRIu32 "!", error); goto out_capacity; } @@ -513,7 +508,8 @@ static DWORD WINAPI audin_server_thread_func(LPVOID arg) case MSG_SNDIN_OPEN_REPLY: if ((error = audin_server_recv_open_reply(audin, s, BytesReturned))) { - WLog_ERR(TAG, "audin_server_recv_open_reply failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "audin_server_recv_open_reply failed with error %" PRIu32 "!", + error); goto out_capacity; } @@ -525,7 +521,7 @@ static DWORD WINAPI audin_server_thread_func(LPVOID arg) case MSG_SNDIN_DATA: if ((error = audin_server_recv_data(audin, s, BytesReturned))) { - WLog_ERR(TAG, "audin_server_recv_data failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "audin_server_recv_data failed with error %" PRIu32 "!", error); goto out_capacity; }; @@ -535,7 +531,7 @@ static DWORD WINAPI audin_server_thread_func(LPVOID arg) break; default: - WLog_ERR(TAG, "audin_server_thread_func: unknown MessageId %"PRIu8"", MessageId); + WLog_ERR(TAG, "audin_server_thread_func: unknown MessageId %" PRIu8 "", MessageId); break; } } @@ -556,7 +552,7 @@ out: static BOOL audin_server_open(audin_server_context* context) { - audin_server* audin = (audin_server*) context; + audin_server* audin = (audin_server*)context; if (!audin->thread) { @@ -564,15 +560,15 @@ static BOOL audin_server_open(audin_server_context* context) DWORD BytesReturned = 0; audin->SessionId = WTS_CURRENT_SESSION; - if (WTSQuerySessionInformationA(context->vcm, WTS_CURRENT_SESSION, - WTSSessionId, (LPSTR*) &pSessionId, &BytesReturned)) + if (WTSQuerySessionInformationA(context->vcm, WTS_CURRENT_SESSION, WTSSessionId, + (LPSTR*)&pSessionId, &BytesReturned)) { - audin->SessionId = (DWORD) * pSessionId; + audin->SessionId = (DWORD)*pSessionId; WTSFreeMemory(pSessionId); } - audin->audin_channel = WTSVirtualChannelOpenEx(audin->SessionId, - "AUDIO_INPUT", WTS_CHANNEL_OPTION_DYNAMIC); + audin->audin_channel = + WTSVirtualChannelOpenEx(audin->SessionId, "AUDIO_INPUT", WTS_CHANNEL_OPTION_DYNAMIC); if (!audin->audin_channel) { @@ -586,7 +582,8 @@ static BOOL audin_server_open(audin_server_context* context) return FALSE; } - if (!(audin->thread = CreateThread(NULL, 0, audin_server_thread_func, (void*) audin, 0, NULL))) + if (!(audin->thread = + CreateThread(NULL, 0, audin_server_thread_func, (void*)audin, 0, NULL))) { WLog_ERR(TAG, "CreateThread failed!"); CloseHandle(audin->stopEvent); @@ -603,7 +600,7 @@ static BOOL audin_server_open(audin_server_context* context) static BOOL audin_server_is_open(audin_server_context* context) { - audin_server* audin = (audin_server*) context; + audin_server* audin = (audin_server*)context; if (!audin) return FALSE; @@ -613,7 +610,7 @@ static BOOL audin_server_is_open(audin_server_context* context) static BOOL audin_server_close(audin_server_context* context) { - audin_server* audin = (audin_server*) context; + audin_server* audin = (audin_server*)context; if (audin->thread) { @@ -621,7 +618,7 @@ static BOOL audin_server_close(audin_server_context* context) if (WaitForSingleObject(audin->thread, INFINITE) == WAIT_FAILED) { - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", GetLastError()); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", GetLastError()); return FALSE; } @@ -668,12 +665,12 @@ audin_server_context* audin_server_context_new(HANDLE vcm) return NULL; } - return (audin_server_context*) audin; + return (audin_server_context*)audin; } void audin_server_context_free(audin_server_context* context) { - audin_server* audin = (audin_server*) context; + audin_server* audin = (audin_server*)context; if (!audin) return; diff --git a/channels/client/addin.c b/channels/client/addin.c index d3b81b16e..d7c4d9dce 100644 --- a/channels/client/addin.c +++ b/channels/client/addin.c @@ -44,20 +44,20 @@ extern const STATIC_ENTRY_TABLE CLIENT_STATIC_ENTRY_TABLES[]; void* freerdp_channels_find_static_entry_in_table(const STATIC_ENTRY_TABLE* table, - const char* identifier) + const char* identifier) { int index = 0; STATIC_ENTRY* pEntry; - pEntry = (STATIC_ENTRY*) &table->table[index++]; + pEntry = (STATIC_ENTRY*)&table->table[index++]; while (pEntry->entry != NULL) { if (strcmp(pEntry->name, identifier) == 0) { - return (void*) pEntry->entry; + return (void*)pEntry->entry; } - pEntry = (STATIC_ENTRY*) &table->table[index++]; + pEntry = (STATIC_ENTRY*)&table->table[index++]; } return NULL; @@ -67,7 +67,7 @@ void* freerdp_channels_client_find_static_entry(const char* name, const char* id { int index = 0; STATIC_ENTRY_TABLE* pEntry; - pEntry = (STATIC_ENTRY_TABLE*) &CLIENT_STATIC_ENTRY_TABLES[index++]; + pEntry = (STATIC_ENTRY_TABLE*)&CLIENT_STATIC_ENTRY_TABLES[index++]; while (pEntry->table != NULL) { @@ -76,7 +76,7 @@ void* freerdp_channels_client_find_static_entry(const char* name, const char* id return freerdp_channels_find_static_entry_in_table(pEntry, identifier); } - pEntry = (STATIC_ENTRY_TABLE*) &CLIENT_STATIC_ENTRY_TABLES[index++]; + pEntry = (STATIC_ENTRY_TABLE*)&CLIENT_STATIC_ENTRY_TABLES[index++]; } return NULL; @@ -84,15 +84,16 @@ void* freerdp_channels_client_find_static_entry(const char* name, const char* id extern const STATIC_ADDIN_TABLE CLIENT_STATIC_ADDIN_TABLE[]; -static FREERDP_ADDIN** freerdp_channels_list_client_static_addins(LPCSTR pszName, LPCSTR pszSubsystem, - LPCSTR pszType, DWORD dwFlags) +static FREERDP_ADDIN** freerdp_channels_list_client_static_addins(LPCSTR pszName, + LPCSTR pszSubsystem, + LPCSTR pszType, DWORD dwFlags) { size_t i, j; DWORD nAddins; FREERDP_ADDIN** ppAddins = NULL; STATIC_SUBSYSTEM_ENTRY* subsystems; nAddins = 0; - ppAddins = (FREERDP_ADDIN**) calloc(128, sizeof(FREERDP_ADDIN*)); + ppAddins = (FREERDP_ADDIN**)calloc(128, sizeof(FREERDP_ADDIN*)); if (!ppAddins) { @@ -104,7 +105,7 @@ static FREERDP_ADDIN** freerdp_channels_list_client_static_addins(LPCSTR pszName for (i = 0; CLIENT_STATIC_ADDIN_TABLE[i].name != NULL; i++) { - FREERDP_ADDIN* pAddin = (FREERDP_ADDIN*) calloc(1, sizeof(FREERDP_ADDIN)); + FREERDP_ADDIN* pAddin = (FREERDP_ADDIN*)calloc(1, sizeof(FREERDP_ADDIN)); if (!pAddin) { @@ -117,11 +118,11 @@ static FREERDP_ADDIN** freerdp_channels_list_client_static_addins(LPCSTR pszName pAddin->dwFlags |= FREERDP_ADDIN_STATIC; pAddin->dwFlags |= FREERDP_ADDIN_NAME; ppAddins[nAddins++] = pAddin; - subsystems = (STATIC_SUBSYSTEM_ENTRY*) CLIENT_STATIC_ADDIN_TABLE[i].table; + subsystems = (STATIC_SUBSYSTEM_ENTRY*)CLIENT_STATIC_ADDIN_TABLE[i].table; for (j = 0; subsystems[j].name != NULL; j++) { - pAddin = (FREERDP_ADDIN*) calloc(1, sizeof(FREERDP_ADDIN)); + pAddin = (FREERDP_ADDIN*)calloc(1, sizeof(FREERDP_ADDIN)); if (!pAddin) { @@ -129,7 +130,8 @@ static FREERDP_ADDIN** freerdp_channels_list_client_static_addins(LPCSTR pszName goto error_out; } - sprintf_s(pAddin->cName, ARRAYSIZE(pAddin->cName), "%s", CLIENT_STATIC_ADDIN_TABLE[i].name); + sprintf_s(pAddin->cName, ARRAYSIZE(pAddin->cName), "%s", + CLIENT_STATIC_ADDIN_TABLE[i].name); sprintf_s(pAddin->cSubsystem, ARRAYSIZE(pAddin->cSubsystem), "%s", subsystems[j].name); pAddin->dwFlags = FREERDP_ADDIN_CLIENT; pAddin->dwFlags |= FREERDP_ADDIN_STATIC; @@ -146,7 +148,7 @@ error_out: } static FREERDP_ADDIN** freerdp_channels_list_dynamic_addins(LPCSTR pszName, LPCSTR pszSubsystem, - LPCSTR pszType, DWORD dwFlags) + LPCSTR pszType, DWORD dwFlags) { int index; int nDashes; @@ -167,7 +169,7 @@ static FREERDP_ADDIN** freerdp_channels_list_dynamic_addins(LPCSTR pszName, LPCS cchInstallPrefix = strnlen(pszInstallPrefix, sizeof(FREERDP_INSTALL_PREFIX)); pszExtension = PathGetSharedLibraryExtensionA(0); cchPattern = 128 + strnlen(pszExtension, MAX_PATH) + 2; - pszPattern = (LPSTR) malloc(cchPattern + 1); + pszPattern = (LPSTR)malloc(cchPattern + 1); if (!pszPattern) { @@ -177,28 +179,28 @@ static FREERDP_ADDIN** freerdp_channels_list_dynamic_addins(LPCSTR pszName, LPCS if (pszName && pszSubsystem && pszType) { - sprintf_s(pszPattern, cchPattern, FREERDP_SHARED_LIBRARY_PREFIX"%s-client-%s-%s.%s", + sprintf_s(pszPattern, cchPattern, FREERDP_SHARED_LIBRARY_PREFIX "%s-client-%s-%s.%s", pszName, pszSubsystem, pszType, pszExtension); } else if (pszName && pszType) { - sprintf_s(pszPattern, cchPattern, FREERDP_SHARED_LIBRARY_PREFIX"%s-client-?-%s.%s", + sprintf_s(pszPattern, cchPattern, FREERDP_SHARED_LIBRARY_PREFIX "%s-client-?-%s.%s", pszName, pszType, pszExtension); } else if (pszName) { - sprintf_s(pszPattern, cchPattern, FREERDP_SHARED_LIBRARY_PREFIX"%s-client*.%s", - pszName, pszExtension); + sprintf_s(pszPattern, cchPattern, FREERDP_SHARED_LIBRARY_PREFIX "%s-client*.%s", pszName, + pszExtension); } else { - sprintf_s(pszPattern, cchPattern, FREERDP_SHARED_LIBRARY_PREFIX"?-client*.%s", + sprintf_s(pszPattern, cchPattern, FREERDP_SHARED_LIBRARY_PREFIX "?-client*.%s", pszExtension); } cchPattern = strnlen(pszPattern, cchPattern); cchSearchPath = cchInstallPrefix + cchAddinPath + cchPattern + 3; - pszSearchPath = (LPSTR) malloc(cchSearchPath + 1); + pszSearchPath = (LPSTR)malloc(cchSearchPath + 1); if (!pszSearchPath) { @@ -215,7 +217,7 @@ static FREERDP_ADDIN** freerdp_channels_list_dynamic_addins(LPCSTR pszName, LPCS hFind = FindFirstFileA(pszSearchPath, &FindData); free(pszSearchPath); nAddins = 0; - ppAddins = (FREERDP_ADDIN**) calloc(128, sizeof(FREERDP_ADDIN*)); + ppAddins = (FREERDP_ADDIN**)calloc(128, sizeof(FREERDP_ADDIN*)); if (!ppAddins) { @@ -232,7 +234,7 @@ static FREERDP_ADDIN** freerdp_channels_list_dynamic_addins(LPCSTR pszName, LPCS char* p[5]; FREERDP_ADDIN* pAddin; nDashes = 0; - pAddin = (FREERDP_ADDIN*) calloc(1, sizeof(FREERDP_ADDIN)); + pAddin = (FREERDP_ADDIN*)calloc(1, sizeof(FREERDP_ADDIN)); if (!pAddin) { @@ -291,8 +293,7 @@ static FREERDP_ADDIN** freerdp_channels_list_dynamic_addins(LPCSTR pszName, LPCS { free(pAddin); } - } - while (FindNextFileA(hFind, &FindData)); + } while (FindNextFileA(hFind, &FindData)); FindClose(hFind); ppAddins[nAddins] = NULL; @@ -304,7 +305,7 @@ error_out: } FREERDP_ADDIN** freerdp_channels_list_addins(LPCSTR pszName, LPCSTR pszSubsystem, LPCSTR pszType, - DWORD dwFlags) + DWORD dwFlags) { if (dwFlags & FREERDP_ADDIN_STATIC) return freerdp_channels_list_client_static_addins(pszName, pszSubsystem, pszType, dwFlags); @@ -336,7 +337,7 @@ BOOL freerdp_channels_is_virtual_channel_entry_ex(LPCSTR pszName) for (i = 0; CLIENT_VirtualChannelEntryEx_TABLE[i].name != NULL; i++) { - entry = (STATIC_ENTRY*) &CLIENT_VirtualChannelEntryEx_TABLE[i]; + entry = (STATIC_ENTRY*)&CLIENT_VirtualChannelEntryEx_TABLE[i]; if (!strcmp(entry->name, pszName)) return TRUE; @@ -346,7 +347,7 @@ BOOL freerdp_channels_is_virtual_channel_entry_ex(LPCSTR pszName) } PVIRTUALCHANNELENTRY freerdp_channels_load_static_addin_entry(LPCSTR pszName, LPCSTR pszSubsystem, - LPCSTR pszType, DWORD dwFlags) + LPCSTR pszType, DWORD dwFlags) { const STATIC_ADDIN_TABLE* table = CLIENT_STATIC_ADDIN_TABLE; for (; table->name != NULL; table++) @@ -355,21 +356,23 @@ PVIRTUALCHANNELENTRY freerdp_channels_load_static_addin_entry(LPCSTR pszName, LP { if (pszSubsystem != NULL) { - const STATIC_SUBSYSTEM_ENTRY* subsystems = (const STATIC_SUBSYSTEM_ENTRY*) table->table; + const STATIC_SUBSYSTEM_ENTRY* subsystems = + (const STATIC_SUBSYSTEM_ENTRY*)table->table; for (; subsystems->name != NULL; subsystems++) { /* If the pszSubsystem is an empty string use the default backend. */ - if ((strlen(pszSubsystem) == 0) || (strcmp(subsystems->name, pszSubsystem) == 0)) + if ((strlen(pszSubsystem) == 0) || + (strcmp(subsystems->name, pszSubsystem) == 0)) { if (pszType) { if (strcmp(subsystems->type, pszType) == 0) - return (PVIRTUALCHANNELENTRY) subsystems->entry; + return (PVIRTUALCHANNELENTRY)subsystems->entry; } else { - return (PVIRTUALCHANNELENTRY) subsystems->entry; + return (PVIRTUALCHANNELENTRY)subsystems->entry; } } } @@ -382,7 +385,7 @@ PVIRTUALCHANNELENTRY freerdp_channels_load_static_addin_entry(LPCSTR pszName, LP return NULL; } - return (PVIRTUALCHANNELENTRY) table->entry; + return (PVIRTUALCHANNELENTRY)table->entry; } } } diff --git a/channels/client/addin.h b/channels/client/addin.h index f3ad9702a..849b11f29 100644 --- a/channels/client/addin.h +++ b/channels/client/addin.h @@ -16,5 +16,3 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - diff --git a/channels/client/tables.h b/channels/client/tables.h index c84298a7f..378021073 100644 --- a/channels/client/tables.h +++ b/channels/client/tables.h @@ -22,7 +22,7 @@ struct _STATIC_ENTRY { const char* name; - UINT(*entry)(); + UINT (*entry)(); }; typedef struct _STATIC_ENTRY STATIC_ENTRY; @@ -44,7 +44,7 @@ typedef struct _STATIC_SUBSYSTEM_ENTRY STATIC_SUBSYSTEM_ENTRY; struct _STATIC_ADDIN_TABLE { const char* name; - UINT(*entry)(); + UINT (*entry)(); const STATIC_SUBSYSTEM_ENTRY* table; }; typedef struct _STATIC_ADDIN_TABLE STATIC_ADDIN_TABLE; diff --git a/channels/cliprdr/client/cliprdr_format.c b/channels/cliprdr/client/cliprdr_format.c index 151aef188..e2ab39ad8 100644 --- a/channels/cliprdr/client/cliprdr_format.c +++ b/channels/cliprdr/client/cliprdr_format.c @@ -40,7 +40,8 @@ * * @return 0 on success, otherwise a Win32 error code */ -UINT cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags) +UINT cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, + UINT16 msgFlags) { CLIPRDR_FORMAT_LIST formatList; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); @@ -59,13 +60,13 @@ UINT cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 data if ((error = cliprdr_read_format_list(s, &formatList, cliprdr->useLongFormatNames))) goto error_out; - WLog_Print(cliprdr->log, WLOG_DEBUG, "ServerFormatList: numFormats: %"PRIu32"", - formatList.numFormats); + WLog_Print(cliprdr->log, WLOG_DEBUG, "ServerFormatList: numFormats: %" PRIu32 "", + formatList.numFormats); if (context->ServerFormatList) { if ((error = context->ServerFormatList(context, &formatList))) - WLog_ERR(TAG, "ServerFormatList failed with error %"PRIu32"", error); + WLog_ERR(TAG, "ServerFormatList failed with error %" PRIu32 "", error); } error_out: @@ -78,7 +79,8 @@ error_out: * * @return 0 on success, otherwise a Win32 error code */ -UINT cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags) +UINT cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, + UINT16 msgFlags) { CLIPRDR_FORMAT_LIST_RESPONSE formatListResponse; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); @@ -98,7 +100,7 @@ UINT cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, wStream* s, UI IFCALLRET(context->ServerFormatListResponse, error, context, &formatListResponse); if (error) - WLog_ERR(TAG, "ServerFormatListResponse failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "ServerFormatListResponse failed with error %" PRIu32 "!", error); return error; } @@ -108,7 +110,8 @@ UINT cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, wStream* s, UI * * @return 0 on success, otherwise a Win32 error code */ -UINT cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags) +UINT cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, + UINT16 msgFlags) { CLIPRDR_FORMAT_DATA_REQUEST formatDataRequest; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); @@ -132,7 +135,7 @@ UINT cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, wStream* s, UIN context->lastRequestedFormatId = formatDataRequest.requestedFormatId; IFCALLRET(context->ServerFormatDataRequest, error, context, &formatDataRequest); if (error) - WLog_ERR(TAG, "ServerFormatDataRequest failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "ServerFormatDataRequest failed with error %" PRIu32 "!", error); return error; } @@ -142,7 +145,8 @@ UINT cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, wStream* s, UIN * * @return 0 on success, otherwise a Win32 error code */ -UINT cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags) +UINT cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, + UINT16 msgFlags) { CLIPRDR_FORMAT_DATA_RESPONSE formatDataResponse; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); @@ -165,7 +169,7 @@ UINT cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, wStream* s, UI IFCALLRET(context->ServerFormatDataResponse, error, context, &formatDataResponse); if (error) - WLog_ERR(TAG, "ServerFormatDataResponse failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "ServerFormatDataResponse failed with error %" PRIu32 "!", error); return error; } @@ -173,17 +177,17 @@ UINT cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, wStream* s, UI static UINT64 filetime_to_uint64(FILETIME value) { UINT64 converted = 0; - converted |= (UINT32) value.dwHighDateTime; + converted |= (UINT32)value.dwHighDateTime; converted <<= 32; - converted |= (UINT32) value.dwLowDateTime; + converted |= (UINT32)value.dwLowDateTime; return converted; } static FILETIME uint64_to_filetime(UINT64 value) { FILETIME converted; - converted.dwLowDateTime = (UINT32) (value >> 0); - converted.dwHighDateTime = (UINT32) (value >> 32); + converted.dwLowDateTime = (UINT32)(value >> 0); + converted.dwHighDateTime = (UINT32)(value >> 32); return converted; } @@ -202,7 +206,7 @@ static FILETIME uint64_to_filetime(UINT64 value) * @returns 0 on success, otherwise a Win32 error code. */ UINT cliprdr_parse_file_list(const BYTE* format_data, UINT32 format_data_length, - FILEDESCRIPTOR** file_descriptor_array, UINT32* file_descriptor_count) + FILEDESCRIPTOR** file_descriptor_array, UINT32* file_descriptor_count) { UINT result = NO_ERROR; UINT32 i; @@ -212,7 +216,7 @@ UINT cliprdr_parse_file_list(const BYTE* format_data, UINT32 format_data_length, if (!format_data || !file_descriptor_array || !file_descriptor_count) return ERROR_BAD_ARGUMENTS; - s = Stream_New((BYTE*) format_data, format_data_length); + s = Stream_New((BYTE*)format_data, format_data_length); if (!s) return ERROR_NOT_ENOUGH_MEMORY; @@ -228,9 +232,8 @@ UINT cliprdr_parse_file_list(const BYTE* format_data, UINT32 format_data_length, if (Stream_GetRemainingLength(s) / CLIPRDR_FILEDESCRIPTOR_SIZE < count) { - WLog_ERR(TAG, "packed file list is too short: expected %"PRIuz", have %"PRIuz, - ((size_t) count) * CLIPRDR_FILEDESCRIPTOR_SIZE, - Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "packed file list is too short: expected %" PRIuz ", have %" PRIuz, + ((size_t)count) * CLIPRDR_FILEDESCRIPTOR_SIZE, Stream_GetRemainingLength(s)); result = ERROR_INCORRECT_SIZE; goto out; @@ -250,21 +253,21 @@ UINT cliprdr_parse_file_list(const BYTE* format_data, UINT32 format_data_length, UINT64 lastWriteTime; FILEDESCRIPTOR* file = &((*file_descriptor_array)[i]); - Stream_Read_UINT32(s, file->dwFlags); /* flags (4 bytes) */ - Stream_Seek(s, 32); /* reserved1 (32 bytes) */ + Stream_Read_UINT32(s, file->dwFlags); /* flags (4 bytes) */ + Stream_Seek(s, 32); /* reserved1 (32 bytes) */ Stream_Read_UINT32(s, file->dwFileAttributes); /* fileAttributes (4 bytes) */ - Stream_Seek(s, 16); /* reserved2 (16 bytes) */ - Stream_Read_UINT64(s, lastWriteTime); /* lastWriteTime (8 bytes) */ + Stream_Seek(s, 16); /* reserved2 (16 bytes) */ + Stream_Read_UINT64(s, lastWriteTime); /* lastWriteTime (8 bytes) */ file->ftLastWriteTime = uint64_to_filetime(lastWriteTime); Stream_Read_UINT32(s, file->nFileSizeHigh); /* fileSizeHigh (4 bytes) */ - Stream_Read_UINT32(s, file->nFileSizeLow); /* fileSizeLow (4 bytes) */ - for (c = 0; c < 260; c++) /* cFileName (520 bytes) */ + Stream_Read_UINT32(s, file->nFileSizeLow); /* fileSizeLow (4 bytes) */ + for (c = 0; c < 260; c++) /* cFileName (520 bytes) */ Stream_Read_UINT16(s, file->cFileName[c]); } if (Stream_GetRemainingLength(s) > 0) - WLog_WARN(TAG, "packed file list has %"PRIuz" excess bytes", - Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "packed file list has %" PRIuz " excess bytes", + Stream_GetRemainingLength(s)); out: Stream_Free(s, FALSE); @@ -286,7 +289,8 @@ out: * @returns 0 on success, otherwise a Win32 error code. */ UINT cliprdr_serialize_file_list(const FILEDESCRIPTOR* file_descriptor_array, - UINT32 file_descriptor_count, BYTE** format_data, UINT32* format_data_length) + UINT32 file_descriptor_count, BYTE** format_data, + UINT32* format_data_length) { UINT result = NO_ERROR; UINT32 i; @@ -321,15 +325,15 @@ UINT cliprdr_serialize_file_list(const FILEDESCRIPTOR* file_descriptor_array, goto error; } - Stream_Write_UINT32(s, file->dwFlags); /* flags (4 bytes) */ - Stream_Zero(s, 32); /* reserved1 (32 bytes) */ + Stream_Write_UINT32(s, file->dwFlags); /* flags (4 bytes) */ + Stream_Zero(s, 32); /* reserved1 (32 bytes) */ Stream_Write_UINT32(s, file->dwFileAttributes); /* fileAttributes (4 bytes) */ - Stream_Zero(s, 16); /* reserved2 (16 bytes) */ + Stream_Zero(s, 16); /* reserved2 (16 bytes) */ lastWriteTime = filetime_to_uint64(file->ftLastWriteTime); - Stream_Write_UINT64(s, lastWriteTime); /* lastWriteTime (8 bytes) */ + Stream_Write_UINT64(s, lastWriteTime); /* lastWriteTime (8 bytes) */ Stream_Write_UINT32(s, file->nFileSizeHigh); /* fileSizeHigh (4 bytes) */ - Stream_Write_UINT32(s, file->nFileSizeLow); /* fileSizeLow (4 bytes) */ - for (c = 0; c < 260; c++) /* cFileName (520 bytes) */ + Stream_Write_UINT32(s, file->nFileSizeLow); /* fileSizeLow (4 bytes) */ + for (c = 0; c < 260; c++) /* cFileName (520 bytes) */ Stream_Write_UINT16(s, file->cFileName[c]); } diff --git a/channels/cliprdr/client/cliprdr_format.h b/channels/cliprdr/client/cliprdr_format.h index dfe6965bb..a068d6ff4 100644 --- a/channels/cliprdr/client/cliprdr_format.h +++ b/channels/cliprdr/client/cliprdr_format.h @@ -23,9 +23,13 @@ #ifndef FREERDP_CHANNEL_CLIPRDR_CLIENT_FORMAT_H #define FREERDP_CHANNEL_CLIPRDR_CLIENT_FORMAT_H -UINT cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags); -UINT cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags); -UINT cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags); -UINT cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags); +UINT cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, + UINT16 msgFlags); +UINT cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, + UINT16 msgFlags); +UINT cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, + UINT16 msgFlags); +UINT cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, + UINT16 msgFlags); #endif /* FREERDP_CHANNEL_CLIPRDR_CLIENT_FORMAT_H */ diff --git a/channels/cliprdr/client/cliprdr_main.c b/channels/cliprdr/client/cliprdr_main.c index e93f95628..9118b9c64 100644 --- a/channels/cliprdr/client/cliprdr_main.c +++ b/channels/cliprdr/client/cliprdr_main.c @@ -36,21 +36,18 @@ #include "../cliprdr_common.h" #ifdef WITH_DEBUG_CLIPRDR -static const char* const CB_MSG_TYPE_STRINGS[] = -{ - "", - "CB_MONITOR_READY", - "CB_FORMAT_LIST", - "CB_FORMAT_LIST_RESPONSE", - "CB_FORMAT_DATA_REQUEST", - "CB_FORMAT_DATA_RESPONSE", - "CB_TEMP_DIRECTORY", - "CB_CLIP_CAPS", - "CB_FILECONTENTS_REQUEST", - "CB_FILECONTENTS_RESPONSE", - "CB_LOCK_CLIPDATA", - "CB_UNLOCK_CLIPDATA" -}; +static const char* const CB_MSG_TYPE_STRINGS[] = { "", + "CB_MONITOR_READY", + "CB_FORMAT_LIST", + "CB_FORMAT_LIST_RESPONSE", + "CB_FORMAT_DATA_REQUEST", + "CB_FORMAT_DATA_RESPONSE", + "CB_TEMP_DIRECTORY", + "CB_CLIP_CAPS", + "CB_FILECONTENTS_REQUEST", + "CB_FILECONTENTS_RESPONSE", + "CB_LOCK_CLIPDATA", + "CB_UNLOCK_CLIPDATA" }; #endif CliprdrClientContext* cliprdr_get_client_interface(cliprdrPlugin* cliprdr) @@ -60,7 +57,7 @@ CliprdrClientContext* cliprdr_get_client_interface(cliprdrPlugin* cliprdr) if (!cliprdr) return NULL; - pInterface = (CliprdrClientContext*) cliprdr->channelEntryPoints.pInterface; + pInterface = (CliprdrClientContext*)cliprdr->channelEntryPoints.pInterface; return pInterface; } @@ -80,7 +77,7 @@ static UINT cliprdr_packet_send(cliprdrPlugin* cliprdr, wStream* s) Stream_Write_UINT32(s, dataLen); Stream_SetPosition(s, pos); #ifdef WITH_DEBUG_CLIPRDR - WLog_DBG(TAG, "Cliprdr Sending (%"PRIu32" bytes)", dataLen + 8); + WLog_DBG(TAG, "Cliprdr Sending (%" PRIu32 " bytes)", dataLen + 8); winpr_HexDump(TAG, WLOG_DEBUG, Stream_Buffer(s), dataLen + 8); #endif @@ -90,15 +87,15 @@ static UINT cliprdr_packet_send(cliprdrPlugin* cliprdr, wStream* s) } else { - status = cliprdr->channelEntryPoints.pVirtualChannelWriteEx(cliprdr->InitHandle, - cliprdr->OpenHandle, - Stream_Buffer(s), (UINT32) Stream_GetPosition(s), s); + status = cliprdr->channelEntryPoints.pVirtualChannelWriteEx( + cliprdr->InitHandle, cliprdr->OpenHandle, Stream_Buffer(s), + (UINT32)Stream_GetPosition(s), s); } if (status != CHANNEL_RC_OK) { Stream_Free(s, TRUE); - WLog_ERR(TAG, "VirtualChannelWrite failed with %s [%08"PRIX32"]", + WLog_ERR(TAG, "VirtualChannelWrite failed with %s [%08" PRIX32 "]", WTSErrorToString(status), status); } @@ -108,21 +105,21 @@ static UINT cliprdr_packet_send(cliprdrPlugin* cliprdr, wStream* s) #ifdef WITH_DEBUG_CLIPRDR static void cliprdr_print_general_capability_flags(UINT32 flags) { - WLog_INFO(TAG, "generalFlags (0x%08"PRIX32") {", flags); + WLog_INFO(TAG, "generalFlags (0x%08" PRIX32 ") {", flags); if (flags & CB_USE_LONG_FORMAT_NAMES) - WLog_INFO(TAG, "\tCB_USE_LONG_FORMAT_NAMES"); + WLog_INFO(TAG, "\tCB_USE_LONG_FORMAT_NAMES"); if (flags & CB_STREAM_FILECLIP_ENABLED) - WLog_INFO(TAG, "\tCB_STREAM_FILECLIP_ENABLED"); + WLog_INFO(TAG, "\tCB_STREAM_FILECLIP_ENABLED"); if (flags & CB_FILECLIP_NO_FILE_PATHS) - WLog_INFO(TAG, "\tCB_FILECLIP_NO_FILE_PATHS"); + WLog_INFO(TAG, "\tCB_FILECLIP_NO_FILE_PATHS"); if (flags & CB_CAN_LOCK_CLIPDATA) - WLog_INFO(TAG, "\tCB_CAN_LOCK_CLIPDATA"); + WLog_INFO(TAG, "\tCB_CAN_LOCK_CLIPDATA"); - WLog_INFO(TAG, "}"); + WLog_INFO(TAG, "}"); } #endif @@ -131,8 +128,7 @@ static void cliprdr_print_general_capability_flags(UINT32 flags) * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_process_general_capability(cliprdrPlugin* cliprdr, - wStream* s) +static UINT cliprdr_process_general_capability(cliprdrPlugin* cliprdr, wStream* s) { UINT32 version; UINT32 generalFlags; @@ -150,9 +146,9 @@ static UINT cliprdr_process_general_capability(cliprdrPlugin* cliprdr, if (Stream_GetRemainingLength(s) < 8) return ERROR_INVALID_DATA; - Stream_Read_UINT32(s, version); /* version (4 bytes) */ + Stream_Read_UINT32(s, version); /* version (4 bytes) */ Stream_Read_UINT32(s, generalFlags); /* generalFlags (4 bytes) */ - DEBUG_CLIPRDR("Version: %"PRIu32"", version); + DEBUG_CLIPRDR("Version: %" PRIu32 "", version); #ifdef WITH_DEBUG_CLIPRDR cliprdr_print_general_capability_flags(generalFlags); #endif @@ -171,8 +167,7 @@ static UINT cliprdr_process_general_capability(cliprdrPlugin* cliprdr, capabilities.msgType = CB_CLIP_CAPS; capabilities.cCapabilitiesSets = 1; - capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET*) & - (generalCapabilitySet); + capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET*)&(generalCapabilitySet); generalCapabilitySet.capabilitySetType = CB_CAPSTYPE_GENERAL; generalCapabilitySet.capabilitySetLength = 12; generalCapabilitySet.version = version; @@ -180,7 +175,7 @@ static UINT cliprdr_process_general_capability(cliprdrPlugin* cliprdr, IFCALLRET(context->ServerCapabilities, error, context, &capabilities); if (error) - WLog_ERR(TAG, "ServerCapabilities failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "ServerCapabilities failed with error %" PRIu32 "!", error); return error; } @@ -190,8 +185,8 @@ static UINT cliprdr_process_general_capability(cliprdrPlugin* cliprdr, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, wStream* s, - UINT32 length, UINT16 flags) +static UINT cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, wStream* s, UINT32 length, + UINT16 flags) { UINT16 index; UINT16 lengthCapability; @@ -203,7 +198,7 @@ static UINT cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, wStream* s, return ERROR_INVALID_DATA; Stream_Read_UINT16(s, cCapabilitiesSets); /* cCapabilitiesSets (2 bytes) */ - Stream_Seek_UINT16(s); /* pad1 (2 bytes) */ + Stream_Seek_UINT16(s); /* pad1 (2 bytes) */ WLog_Print(cliprdr->log, WLOG_DEBUG, "ServerCapabilities"); for (index = 0; index < cCapabilitiesSets; index++) @@ -212,7 +207,7 @@ static UINT cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, wStream* s, return ERROR_INVALID_DATA; Stream_Read_UINT16(s, capabilitySetType); /* capabilitySetType (2 bytes) */ - Stream_Read_UINT16(s, lengthCapability); /* lengthCapability (2 bytes) */ + Stream_Read_UINT16(s, lengthCapability); /* lengthCapability (2 bytes) */ if ((lengthCapability < 4) || (Stream_GetRemainingLength(s) < (lengthCapability - 4U))) return ERROR_INVALID_DATA; @@ -222,7 +217,8 @@ static UINT cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, wStream* s, case CB_CAPSTYPE_GENERAL: if ((error = cliprdr_process_general_capability(cliprdr, s))) { - WLog_ERR(TAG, "cliprdr_process_general_capability failed with error %"PRIu32"!", + WLog_ERR(TAG, + "cliprdr_process_general_capability failed with error %" PRIu32 "!", error); return error; } @@ -230,7 +226,7 @@ static UINT cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, wStream* s, break; default: - WLog_ERR(TAG, "unknown cliprdr capability set: %"PRIu16"", capabilitySetType); + WLog_ERR(TAG, "unknown cliprdr capability set: %" PRIu16 "", capabilitySetType); return CHANNEL_RC_BAD_PROC; } } @@ -243,8 +239,8 @@ static UINT cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, wStream* s, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_process_monitor_ready(cliprdrPlugin* cliprdr, wStream* s, - UINT32 length, UINT16 flags) +static UINT cliprdr_process_monitor_ready(cliprdrPlugin* cliprdr, wStream* s, UINT32 length, + UINT16 flags) { CLIPRDR_MONITOR_READY monitorReady; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); @@ -260,11 +256,11 @@ static UINT cliprdr_process_monitor_ready(cliprdrPlugin* cliprdr, wStream* s, if (!cliprdr->capabilitiesReceived) { /** - * The clipboard capabilities pdu from server to client is optional, - * but a server using it must send it before sending the monitor ready pdu. - * When the server capabilities pdu is not used, default capabilities - * corresponding to a generalFlags field set to zero are assumed. - */ + * The clipboard capabilities pdu from server to client is optional, + * but a server using it must send it before sending the monitor ready pdu. + * When the server capabilities pdu is not used, default capabilities + * corresponding to a generalFlags field set to zero are assumed. + */ cliprdr->useLongFormatNames = FALSE; cliprdr->streamFileClipEnabled = FALSE; cliprdr->fileClipNoFilePaths = TRUE; @@ -277,7 +273,7 @@ static UINT cliprdr_process_monitor_ready(cliprdrPlugin* cliprdr, wStream* s, IFCALLRET(context->MonitorReady, error, context, &monitorReady); if (error) - WLog_ERR(TAG, "MonitorReady failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "MonitorReady failed with error %" PRIu32 "!", error); return error; } @@ -287,8 +283,8 @@ static UINT cliprdr_process_monitor_ready(cliprdrPlugin* cliprdr, wStream* s, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_process_filecontents_request(cliprdrPlugin* cliprdr, - wStream* s, UINT32 length, UINT16 flags) +static UINT cliprdr_process_filecontents_request(cliprdrPlugin* cliprdr, wStream* s, UINT32 length, + UINT16 flags) { CLIPRDR_FILE_CONTENTS_REQUEST request; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); @@ -311,7 +307,7 @@ static UINT cliprdr_process_filecontents_request(cliprdrPlugin* cliprdr, IFCALLRET(context->ServerFileContentsRequest, error, context, &request); if (error) - WLog_ERR(TAG, "ServerFileContentsRequest failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "ServerFileContentsRequest failed with error %" PRIu32 "!", error); return error; } @@ -321,8 +317,8 @@ static UINT cliprdr_process_filecontents_request(cliprdrPlugin* cliprdr, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_process_filecontents_response(cliprdrPlugin* cliprdr, - wStream* s, UINT32 length, UINT16 flags) +static UINT cliprdr_process_filecontents_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 length, + UINT16 flags) { CLIPRDR_FILE_CONTENTS_RESPONSE response; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); @@ -345,7 +341,7 @@ static UINT cliprdr_process_filecontents_response(cliprdrPlugin* cliprdr, IFCALLRET(context->ServerFileContentsResponse, error, context, &response); if (error) - WLog_ERR(TAG, "ServerFileContentsResponse failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "ServerFileContentsResponse failed with error %" PRIu32 "!", error); return error; } @@ -355,8 +351,8 @@ static UINT cliprdr_process_filecontents_response(cliprdrPlugin* cliprdr, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_process_lock_clipdata(cliprdrPlugin* cliprdr, wStream* s, - UINT32 length, UINT16 flags) +static UINT cliprdr_process_lock_clipdata(cliprdrPlugin* cliprdr, wStream* s, UINT32 length, + UINT16 flags) { CLIPRDR_LOCK_CLIPBOARD_DATA lockClipboardData; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); @@ -382,7 +378,7 @@ static UINT cliprdr_process_lock_clipdata(cliprdrPlugin* cliprdr, wStream* s, IFCALLRET(context->ServerLockClipboardData, error, context, &lockClipboardData); if (error) - WLog_ERR(TAG, "ServerLockClipboardData failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "ServerLockClipboardData failed with error %" PRIu32 "!", error); return error; } @@ -392,8 +388,8 @@ static UINT cliprdr_process_lock_clipdata(cliprdrPlugin* cliprdr, wStream* s, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_process_unlock_clipdata(cliprdrPlugin* cliprdr, wStream* s, - UINT32 length, UINT16 flags) +static UINT cliprdr_process_unlock_clipdata(cliprdrPlugin* cliprdr, wStream* s, UINT32 length, + UINT16 flags) { CLIPRDR_UNLOCK_CLIPBOARD_DATA unlockClipboardData; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); @@ -413,11 +409,10 @@ static UINT cliprdr_process_unlock_clipdata(cliprdrPlugin* cliprdr, wStream* s, unlockClipboardData.msgFlags = flags; unlockClipboardData.dataLen = length; - IFCALLRET(context->ServerUnlockClipboardData, error, context, - &unlockClipboardData); + IFCALLRET(context->ServerUnlockClipboardData, error, context, &unlockClipboardData); if (error) - WLog_ERR(TAG, "ServerUnlockClipboardData failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "ServerUnlockClipboardData failed with error %" PRIu32 "!", error); return error; } @@ -437,15 +432,15 @@ static UINT cliprdr_order_recv(cliprdrPlugin* cliprdr, wStream* s) if (Stream_GetRemainingLength(s) < 8) return ERROR_INVALID_DATA; - Stream_Read_UINT16(s, msgType); /* msgType (2 bytes) */ + Stream_Read_UINT16(s, msgType); /* msgType (2 bytes) */ Stream_Read_UINT16(s, msgFlags); /* msgFlags (2 bytes) */ - Stream_Read_UINT32(s, dataLen); /* dataLen (4 bytes) */ + Stream_Read_UINT32(s, dataLen); /* dataLen (4 bytes) */ if (Stream_GetRemainingLength(s) < dataLen) return ERROR_INVALID_DATA; #ifdef WITH_DEBUG_CLIPRDR - WLog_DBG(TAG, "msgType: %s (%"PRIu16"), msgFlags: %"PRIu16" dataLen: %"PRIu32"", + WLog_DBG(TAG, "msgType: %s (%" PRIu16 "), msgFlags: %" PRIu16 " dataLen: %" PRIu32 "", CB_MSG_TYPE_STRINGS[msgType], msgType, msgFlags, dataLen); winpr_HexDump(TAG, WLOG_DEBUG, Stream_Buffer(s), dataLen + 8); #endif @@ -454,72 +449,76 @@ static UINT cliprdr_order_recv(cliprdrPlugin* cliprdr, wStream* s) { case CB_CLIP_CAPS: if ((error = cliprdr_process_clip_caps(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_clip_caps failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "cliprdr_process_clip_caps failed with error %" PRIu32 "!", error); break; case CB_MONITOR_READY: if ((error = cliprdr_process_monitor_ready(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_monitor_ready failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "cliprdr_process_monitor_ready failed with error %" PRIu32 "!", + error); break; case CB_FORMAT_LIST: if ((error = cliprdr_process_format_list(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_format_list failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "cliprdr_process_format_list failed with error %" PRIu32 "!", error); break; case CB_FORMAT_LIST_RESPONSE: if ((error = cliprdr_process_format_list_response(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_format_list_response failed with error %"PRIu32"!", + WLog_ERR(TAG, "cliprdr_process_format_list_response failed with error %" PRIu32 "!", error); break; case CB_FORMAT_DATA_REQUEST: if ((error = cliprdr_process_format_data_request(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_format_data_request failed with error %"PRIu32"!", + WLog_ERR(TAG, "cliprdr_process_format_data_request failed with error %" PRIu32 "!", error); break; case CB_FORMAT_DATA_RESPONSE: if ((error = cliprdr_process_format_data_response(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_format_data_response failed with error %"PRIu32"!", + WLog_ERR(TAG, "cliprdr_process_format_data_response failed with error %" PRIu32 "!", error); break; case CB_FILECONTENTS_REQUEST: if ((error = cliprdr_process_filecontents_request(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_filecontents_request failed with error %"PRIu32"!", + WLog_ERR(TAG, "cliprdr_process_filecontents_request failed with error %" PRIu32 "!", error); break; case CB_FILECONTENTS_RESPONSE: if ((error = cliprdr_process_filecontents_response(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_filecontents_response failed with error %"PRIu32"!", + WLog_ERR(TAG, + "cliprdr_process_filecontents_response failed with error %" PRIu32 "!", error); break; case CB_LOCK_CLIPDATA: if ((error = cliprdr_process_lock_clipdata(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_lock_clipdata failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "cliprdr_process_lock_clipdata failed with error %" PRIu32 "!", + error); break; case CB_UNLOCK_CLIPDATA: if ((error = cliprdr_process_unlock_clipdata(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_lock_clipdata failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "cliprdr_process_lock_clipdata failed with error %" PRIu32 "!", + error); break; default: error = CHANNEL_RC_BAD_PROC; - WLog_ERR(TAG, "unknown msgType %"PRIu16"", msgType); + WLog_ERR(TAG, "unknown msgType %" PRIu16 "", msgType); break; } @@ -541,7 +540,7 @@ static UINT cliprdr_client_capabilities(CliprdrClientContext* context, { wStream* s; const CLIPRDR_GENERAL_CAPABILITY_SET* generalCapabilitySet; - cliprdrPlugin* cliprdr = (cliprdrPlugin*) context->handle; + cliprdrPlugin* cliprdr = (cliprdrPlugin*)context->handle; s = cliprdr_packet_new(CB_CLIP_CAPS, 0, 4 + CB_CAPSTYPE_GENERAL_LEN); if (!s) @@ -553,10 +552,10 @@ static UINT cliprdr_client_capabilities(CliprdrClientContext* context, Stream_Write_UINT16(s, 1); /* cCapabilitiesSets */ Stream_Write_UINT16(s, 0); /* pad1 */ generalCapabilitySet = (const CLIPRDR_GENERAL_CAPABILITY_SET*)capabilities->capabilitySets; - Stream_Write_UINT16(s, generalCapabilitySet->capabilitySetType); /* capabilitySetType */ + Stream_Write_UINT16(s, generalCapabilitySet->capabilitySetType); /* capabilitySetType */ Stream_Write_UINT16(s, generalCapabilitySet->capabilitySetLength); /* lengthCapability */ - Stream_Write_UINT32(s, generalCapabilitySet->version); /* version */ - Stream_Write_UINT32(s, generalCapabilitySet->generalFlags); /* generalFlags */ + Stream_Write_UINT32(s, generalCapabilitySet->version); /* version */ + Stream_Write_UINT32(s, generalCapabilitySet->generalFlags); /* generalFlags */ WLog_Print(cliprdr->log, WLOG_DEBUG, "ClientCapabilities"); return cliprdr_packet_send(cliprdr, s); } @@ -572,7 +571,7 @@ static UINT cliprdr_temp_directory(CliprdrClientContext* context, int length; wStream* s; WCHAR* wszTempDir = NULL; - cliprdrPlugin* cliprdr = (cliprdrPlugin*) context->handle; + cliprdrPlugin* cliprdr = (cliprdrPlugin*)context->handle; s = cliprdr_packet_new(CB_TEMP_DIRECTORY, 0, 520 * 2); if (!s) @@ -592,8 +591,7 @@ static UINT cliprdr_temp_directory(CliprdrClientContext* context, Stream_Write(s, wszTempDir, (size_t)length * 2); Stream_Zero(s, (520 - (size_t)length) * 2); free(wszTempDir); - WLog_Print(cliprdr->log, WLOG_DEBUG, "TempDirectory: %s", - tempDirectory->szTempDir); + WLog_Print(cliprdr->log, WLOG_DEBUG, "TempDirectory: %s", tempDirectory->szTempDir); return cliprdr_packet_send(cliprdr, s); } @@ -606,7 +604,7 @@ static UINT cliprdr_client_format_list(CliprdrClientContext* context, const CLIPRDR_FORMAT_LIST* formatList) { wStream* s; - cliprdrPlugin* cliprdr = (cliprdrPlugin*) context->handle; + cliprdrPlugin* cliprdr = (cliprdrPlugin*)context->handle; s = cliprdr_packet_format_list_new(formatList, cliprdr->useLongFormatNames); if (!s) @@ -615,7 +613,7 @@ static UINT cliprdr_client_format_list(CliprdrClientContext* context, return ERROR_INTERNAL_ERROR; } - WLog_Print(cliprdr->log, WLOG_DEBUG, "ClientFormatList: numFormats: %"PRIu32"", + WLog_Print(cliprdr->log, WLOG_DEBUG, "ClientFormatList: numFormats: %" PRIu32 "", formatList->numFormats); return cliprdr_packet_send(cliprdr, s); } @@ -625,13 +623,13 @@ static UINT cliprdr_client_format_list(CliprdrClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_client_format_list_response(CliprdrClientContext* context, - const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) +static UINT +cliprdr_client_format_list_response(CliprdrClientContext* context, + const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) { wStream* s; - cliprdrPlugin* cliprdr = (cliprdrPlugin*) context->handle; - s = cliprdr_packet_new(CB_FORMAT_LIST_RESPONSE, - formatListResponse->msgFlags, 0); + cliprdrPlugin* cliprdr = (cliprdrPlugin*)context->handle; + s = cliprdr_packet_new(CB_FORMAT_LIST_RESPONSE, formatListResponse->msgFlags, 0); if (!s) { @@ -649,10 +647,10 @@ static UINT cliprdr_client_format_list_response(CliprdrClientContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT cliprdr_client_lock_clipboard_data(CliprdrClientContext* context, - const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) + const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) { wStream* s; - cliprdrPlugin* cliprdr = (cliprdrPlugin*) context->handle; + cliprdrPlugin* cliprdr = (cliprdrPlugin*)context->handle; s = cliprdr_packet_lock_clipdata_new(lockClipboardData); if (!s) @@ -661,8 +659,7 @@ static UINT cliprdr_client_lock_clipboard_data(CliprdrClientContext* context, return ERROR_INTERNAL_ERROR; } - WLog_Print(cliprdr->log, WLOG_DEBUG, - "ClientLockClipboardData: clipDataId: 0x%08"PRIX32"", + WLog_Print(cliprdr->log, WLOG_DEBUG, "ClientLockClipboardData: clipDataId: 0x%08" PRIX32 "", lockClipboardData->clipDataId); return cliprdr_packet_send(cliprdr, s); } @@ -672,11 +669,12 @@ static UINT cliprdr_client_lock_clipboard_data(CliprdrClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_client_unlock_clipboard_data(CliprdrClientContext* context, - const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) +static UINT +cliprdr_client_unlock_clipboard_data(CliprdrClientContext* context, + const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) { wStream* s; - cliprdrPlugin* cliprdr = (cliprdrPlugin*) context->handle; + cliprdrPlugin* cliprdr = (cliprdrPlugin*)context->handle; s = cliprdr_packet_unlock_clipdata_new(unlockClipboardData); if (!s) @@ -685,8 +683,7 @@ static UINT cliprdr_client_unlock_clipboard_data(CliprdrClientContext* context, return ERROR_INTERNAL_ERROR; } - WLog_Print(cliprdr->log, WLOG_DEBUG, - "ClientUnlockClipboardData: clipDataId: 0x%08"PRIX32"", + WLog_Print(cliprdr->log, WLOG_DEBUG, "ClientUnlockClipboardData: clipDataId: 0x%08" PRIX32 "", unlockClipboardData->clipDataId); return cliprdr_packet_send(cliprdr, s); } @@ -697,10 +694,10 @@ static UINT cliprdr_client_unlock_clipboard_data(CliprdrClientContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT cliprdr_client_format_data_request(CliprdrClientContext* context, - const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) + const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) { wStream* s; - cliprdrPlugin* cliprdr = (cliprdrPlugin*) context->handle; + cliprdrPlugin* cliprdr = (cliprdrPlugin*)context->handle; s = cliprdr_packet_new(CB_FORMAT_DATA_REQUEST, 0, 4); @@ -720,14 +717,15 @@ static UINT cliprdr_client_format_data_request(CliprdrClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_client_format_data_response(CliprdrClientContext* context, - const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) +static UINT +cliprdr_client_format_data_response(CliprdrClientContext* context, + const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) { wStream* s; - cliprdrPlugin* cliprdr = (cliprdrPlugin*) context->handle; + cliprdrPlugin* cliprdr = (cliprdrPlugin*)context->handle; - s = cliprdr_packet_new(CB_FORMAT_DATA_RESPONSE, - formatDataResponse->msgFlags, formatDataResponse->dataLen); + s = cliprdr_packet_new(CB_FORMAT_DATA_RESPONSE, formatDataResponse->msgFlags, + formatDataResponse->dataLen); if (!s) { @@ -735,8 +733,7 @@ static UINT cliprdr_client_format_data_response(CliprdrClientContext* context, return ERROR_INTERNAL_ERROR; } - Stream_Write(s, formatDataResponse->requestedFormatData, - formatDataResponse->dataLen); + Stream_Write(s, formatDataResponse->requestedFormatData, formatDataResponse->dataLen); WLog_Print(cliprdr->log, WLOG_DEBUG, "ClientFormatDataResponse"); return cliprdr_packet_send(cliprdr, s); } @@ -746,11 +743,12 @@ static UINT cliprdr_client_format_data_response(CliprdrClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_client_file_contents_request(CliprdrClientContext* context, - const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +static UINT +cliprdr_client_file_contents_request(CliprdrClientContext* context, + const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { wStream* s; - cliprdrPlugin* cliprdr = (cliprdrPlugin*) context->handle; + cliprdrPlugin* cliprdr = (cliprdrPlugin*)context->handle; s = cliprdr_packet_file_contents_request_new(fileContentsRequest); @@ -760,8 +758,7 @@ static UINT cliprdr_client_file_contents_request(CliprdrClientContext* context, return ERROR_INTERNAL_ERROR; } - WLog_Print(cliprdr->log, WLOG_DEBUG, - "ClientFileContentsRequest: streamId: 0x%08"PRIX32"", + WLog_Print(cliprdr->log, WLOG_DEBUG, "ClientFileContentsRequest: streamId: 0x%08" PRIX32 "", fileContentsRequest->streamId); return cliprdr_packet_send(cliprdr, s); } @@ -771,11 +768,12 @@ static UINT cliprdr_client_file_contents_request(CliprdrClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_client_file_contents_response(CliprdrClientContext* context, - const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) +static UINT +cliprdr_client_file_contents_response(CliprdrClientContext* context, + const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) { wStream* s; - cliprdrPlugin* cliprdr = (cliprdrPlugin*) context->handle; + cliprdrPlugin* cliprdr = (cliprdrPlugin*)context->handle; s = cliprdr_packet_file_contents_response_new(fileContentsResponse); if (!s) @@ -784,8 +782,7 @@ static UINT cliprdr_client_file_contents_response(CliprdrClientContext* context, return ERROR_INTERNAL_ERROR; } - WLog_Print(cliprdr->log, WLOG_DEBUG, - "ClientFileContentsResponse: streamId: 0x%08"PRIX32"", + WLog_Print(cliprdr->log, WLOG_DEBUG, "ClientFileContentsResponse: streamId: 0x%08" PRIX32 "", fileContentsResponse->streamId); return cliprdr_packet_send(cliprdr, s); } @@ -795,8 +792,9 @@ static UINT cliprdr_client_file_contents_response(CliprdrClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_virtual_channel_event_data_received(cliprdrPlugin* cliprdr, - void* pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) +static UINT cliprdr_virtual_channel_event_data_received(cliprdrPlugin* cliprdr, void* pData, + UINT32 dataLength, UINT32 totalLength, + UINT32 dataFlags) { wStream* data_in; @@ -840,7 +838,7 @@ static UINT cliprdr_virtual_channel_event_data_received(cliprdrPlugin* cliprdr, Stream_SealLength(data_in); Stream_SetPosition(data_in, 0); - if (!MessageQueue_Post(cliprdr->queue, NULL, 0, (void*) data_in, NULL)) + if (!MessageQueue_Post(cliprdr->queue, NULL, 0, (void*)data_in, NULL)) { WLog_ERR(TAG, "MessageQueue_Post failed!"); return ERROR_INTERNAL_ERROR; @@ -851,11 +849,12 @@ static UINT cliprdr_virtual_channel_event_data_received(cliprdrPlugin* cliprdr, } static VOID VCAPITYPE cliprdr_virtual_channel_open_event_ex(LPVOID lpUserParam, DWORD openHandle, - UINT event, - LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) + UINT event, LPVOID pData, + UINT32 dataLength, UINT32 totalLength, + UINT32 dataFlags) { UINT error = CHANNEL_RC_OK; - cliprdrPlugin* cliprdr = (cliprdrPlugin*) lpUserParam; + cliprdrPlugin* cliprdr = (cliprdrPlugin*)lpUserParam; if (!cliprdr || (cliprdr->OpenHandle != openHandle)) { @@ -867,7 +866,7 @@ static VOID VCAPITYPE cliprdr_virtual_channel_open_event_ex(LPVOID lpUserParam, { case CHANNEL_EVENT_DATA_RECEIVED: if ((error = cliprdr_virtual_channel_event_data_received(cliprdr, pData, dataLength, - totalLength, dataFlags))) + totalLength, dataFlags))) WLog_ERR(TAG, "failed with error %" PRIu32 "", error); break; @@ -878,7 +877,7 @@ static VOID VCAPITYPE cliprdr_virtual_channel_open_event_ex(LPVOID lpUserParam, wStream* s = (wStream*)pData; Stream_Free(s, TRUE); } - break; + break; case CHANNEL_EVENT_USER: break; @@ -893,7 +892,7 @@ static DWORD WINAPI cliprdr_virtual_channel_client_thread(LPVOID arg) { wStream* data; wMessage message; - cliprdrPlugin* cliprdr = (cliprdrPlugin*) arg; + cliprdrPlugin* cliprdr = (cliprdrPlugin*)arg; UINT error = CHANNEL_RC_OK; while (1) @@ -917,11 +916,11 @@ static DWORD WINAPI cliprdr_virtual_channel_client_thread(LPVOID arg) if (message.id == 0) { - data = (wStream*) message.wParam; + data = (wStream*)message.wParam; if ((error = cliprdr_order_recv(cliprdr, data))) { - WLog_ERR(TAG, "cliprdr_order_recv failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "cliprdr_order_recv failed with error %" PRIu32 "!", error); break; } } @@ -951,18 +950,18 @@ static void cliprdr_free_msg(void* obj) * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_virtual_channel_event_connected(cliprdrPlugin* cliprdr, - LPVOID pData, UINT32 dataLength) +static UINT cliprdr_virtual_channel_event_connected(cliprdrPlugin* cliprdr, LPVOID pData, + UINT32 dataLength) { UINT32 status; wObject obj = { 0 }; - status = cliprdr->channelEntryPoints.pVirtualChannelOpenEx(cliprdr->InitHandle, - &cliprdr->OpenHandle, cliprdr->channelDef.name, - cliprdr_virtual_channel_open_event_ex); + status = cliprdr->channelEntryPoints.pVirtualChannelOpenEx( + cliprdr->InitHandle, &cliprdr->OpenHandle, cliprdr->channelDef.name, + cliprdr_virtual_channel_open_event_ex); if (status != CHANNEL_RC_OK) { - WLog_ERR(TAG, "pVirtualChannelOpen failed with %s [%08"PRIX32"]", + WLog_ERR(TAG, "pVirtualChannelOpen failed with %s [%08" PRIX32 "]", WTSErrorToString(status), status); return status; } @@ -977,8 +976,7 @@ static UINT cliprdr_virtual_channel_event_connected(cliprdrPlugin* cliprdr, } if (!(cliprdr->thread = CreateThread(NULL, 0, cliprdr_virtual_channel_client_thread, - (void*) cliprdr, - 0, NULL))) + (void*)cliprdr, 0, NULL))) { WLog_ERR(TAG, "CreateThread failed!"); MessageQueue_Free(cliprdr->queue); @@ -1001,22 +999,23 @@ static UINT cliprdr_virtual_channel_event_disconnected(cliprdrPlugin* cliprdr) if (cliprdr->OpenHandle == 0) return CHANNEL_RC_OK; - if (MessageQueue_PostQuit(cliprdr->queue, 0) - && (WaitForSingleObject(cliprdr->thread, INFINITE) == WAIT_FAILED)) + if (MessageQueue_PostQuit(cliprdr->queue, 0) && + (WaitForSingleObject(cliprdr->thread, INFINITE) == WAIT_FAILED)) { rc = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", rc); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", rc); return rc; } MessageQueue_Free(cliprdr->queue); CloseHandle(cliprdr->thread); - rc = cliprdr->channelEntryPoints.pVirtualChannelCloseEx(cliprdr->InitHandle, cliprdr->OpenHandle); + rc = cliprdr->channelEntryPoints.pVirtualChannelCloseEx(cliprdr->InitHandle, + cliprdr->OpenHandle); if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "pVirtualChannelClose failed with %s [%08"PRIX32"]", - WTSErrorToString(rc), rc); + WLog_ERR(TAG, "pVirtualChannelClose failed with %s [%08" PRIX32 "]", WTSErrorToString(rc), + rc); return rc; } @@ -1045,10 +1044,11 @@ static UINT cliprdr_virtual_channel_event_terminated(cliprdrPlugin* cliprdr) } static VOID VCAPITYPE cliprdr_virtual_channel_init_event_ex(LPVOID lpUserParam, LPVOID pInitHandle, - UINT event, LPVOID pData, UINT dataLength) + UINT event, LPVOID pData, + UINT dataLength) { UINT error = CHANNEL_RC_OK; - cliprdrPlugin* cliprdr = (cliprdrPlugin*) lpUserParam; + cliprdrPlugin* cliprdr = (cliprdrPlugin*)lpUserParam; if (!cliprdr || (cliprdr->InitHandle != pInitHandle)) { @@ -1060,7 +1060,8 @@ static VOID VCAPITYPE cliprdr_virtual_channel_init_event_ex(LPVOID lpUserParam, { case CHANNEL_EVENT_CONNECTED: if ((error = cliprdr_virtual_channel_event_connected(cliprdr, pData, dataLength))) - WLog_ERR(TAG, "cliprdr_virtual_channel_event_connected failed with error %"PRIu32"!", + WLog_ERR(TAG, + "cliprdr_virtual_channel_event_connected failed with error %" PRIu32 "!", error); break; @@ -1068,13 +1069,16 @@ static VOID VCAPITYPE cliprdr_virtual_channel_init_event_ex(LPVOID lpUserParam, case CHANNEL_EVENT_DISCONNECTED: if ((error = cliprdr_virtual_channel_event_disconnected(cliprdr))) WLog_ERR(TAG, - "cliprdr_virtual_channel_event_disconnected failed with error %"PRIu32"!", error); + "cliprdr_virtual_channel_event_disconnected failed with error %" PRIu32 + "!", + error); break; case CHANNEL_EVENT_TERMINATED: if ((error = cliprdr_virtual_channel_event_terminated(cliprdr))) - WLog_ERR(TAG, "cliprdr_virtual_channel_event_terminated failed with error %"PRIu32"!", + WLog_ERR(TAG, + "cliprdr_virtual_channel_event_terminated failed with error %" PRIu32 "!", error); break; @@ -1086,7 +1090,7 @@ static VOID VCAPITYPE cliprdr_virtual_channel_init_event_ex(LPVOID lpUserParam, } /* cliprdr is always built-in */ -#define VirtualChannelEntryEx cliprdr_VirtualChannelEntryEx +#define VirtualChannelEntryEx cliprdr_VirtualChannelEntryEx BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID pInitHandle) { @@ -1094,7 +1098,7 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p cliprdrPlugin* cliprdr; CliprdrClientContext* context = NULL; CHANNEL_ENTRY_POINTS_FREERDP_EX* pEntryPointsEx; - cliprdr = (cliprdrPlugin*) calloc(1, sizeof(cliprdrPlugin)); + cliprdr = (cliprdrPlugin*)calloc(1, sizeof(cliprdrPlugin)); if (!cliprdr) { @@ -1102,18 +1106,15 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p return FALSE; } - cliprdr->channelDef.options = - CHANNEL_OPTION_INITIALIZED | - CHANNEL_OPTION_ENCRYPT_RDP | - CHANNEL_OPTION_COMPRESS_RDP | - CHANNEL_OPTION_SHOW_PROTOCOL; + cliprdr->channelDef.options = CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP | + CHANNEL_OPTION_COMPRESS_RDP | CHANNEL_OPTION_SHOW_PROTOCOL; sprintf_s(cliprdr->channelDef.name, ARRAYSIZE(cliprdr->channelDef.name), "cliprdr"); - pEntryPointsEx = (CHANNEL_ENTRY_POINTS_FREERDP_EX*) pEntryPoints; + pEntryPointsEx = (CHANNEL_ENTRY_POINTS_FREERDP_EX*)pEntryPoints; if ((pEntryPointsEx->cbSize >= sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX)) && (pEntryPointsEx->MagicNumber == FREERDP_CHANNEL_MAGIC_NUMBER)) { - context = (CliprdrClientContext*) calloc(1, sizeof(CliprdrClientContext)); + context = (CliprdrClientContext*)calloc(1, sizeof(CliprdrClientContext)); if (!context) { @@ -1122,7 +1123,7 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p return FALSE; } - context->handle = (void*) cliprdr; + context->handle = (void*)cliprdr; context->custom = NULL; context->ClientCapabilities = cliprdr_client_capabilities; context->TempDirectory = cliprdr_temp_directory; @@ -1147,14 +1148,14 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p CopyMemory(&(cliprdr->channelEntryPoints), pEntryPoints, sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX)); cliprdr->InitHandle = pInitHandle; - rc = cliprdr->channelEntryPoints.pVirtualChannelInitEx(cliprdr, context, pInitHandle, - &cliprdr->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000, - cliprdr_virtual_channel_init_event_ex); + rc = cliprdr->channelEntryPoints.pVirtualChannelInitEx( + cliprdr, context, pInitHandle, &cliprdr->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000, + cliprdr_virtual_channel_init_event_ex); if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "pVirtualChannelInit failed with %s [%08"PRIX32"]", - WTSErrorToString(rc), rc); + WLog_ERR(TAG, "pVirtualChannelInit failed with %s [%08" PRIX32 "]", WTSErrorToString(rc), + rc); free(cliprdr->context); free(cliprdr); return FALSE; diff --git a/channels/cliprdr/client/cliprdr_main.h b/channels/cliprdr/client/cliprdr_main.h index 25bad1828..a23340786 100644 --- a/channels/cliprdr/client/cliprdr_main.h +++ b/channels/cliprdr/client/cliprdr_main.h @@ -57,7 +57,10 @@ CliprdrClientContext* cliprdr_get_client_interface(cliprdrPlugin* cliprdr); #ifdef WITH_DEBUG_CLIPRDR #define DEBUG_CLIPRDR(...) WLog_DBG(TAG, __VA_ARGS__) #else -#define DEBUG_CLIPRDR(...) do { } while (0) +#define DEBUG_CLIPRDR(...) \ + do \ + { \ + } while (0) #endif #endif /* FREERDP_CHANNEL_CLIPRDR_CLIENT_MAIN_H */ diff --git a/channels/cliprdr/cliprdr_common.c b/channels/cliprdr/cliprdr_common.c index 31180b7d4..9a099423f 100644 --- a/channels/cliprdr/cliprdr_common.c +++ b/channels/cliprdr/cliprdr_common.c @@ -43,7 +43,7 @@ static BOOL cliprdr_validate_file_contents_request(const CLIPRDR_FILE_CONTENTS_R { if (request->cbRequested != sizeof(UINT64)) { - WLog_ERR(TAG, "[%s]: cbRequested must be %"PRIu32", got %"PRIu32"", __FUNCTION__, + WLog_ERR(TAG, "[%s]: cbRequested must be %" PRIu32 ", got %" PRIu32 "", __FUNCTION__, sizeof(UINT64), request->cbRequested); return FALSE; } @@ -58,8 +58,7 @@ static BOOL cliprdr_validate_file_contents_request(const CLIPRDR_FILE_CONTENTS_R return TRUE; } -wStream* cliprdr_packet_new(UINT16 msgType, UINT16 msgFlags, - UINT32 dataLen) +wStream* cliprdr_packet_new(UINT16 msgType, UINT16 msgFlags, UINT32 dataLen) { wStream* s; s = Stream_New(NULL, dataLen + 8); @@ -77,7 +76,8 @@ wStream* cliprdr_packet_new(UINT16 msgType, UINT16 msgFlags, return s; } -static void cliprdr_write_file_contents_request(wStream* s, const CLIPRDR_FILE_CONTENTS_REQUEST* request) +static void cliprdr_write_file_contents_request(wStream* s, + const CLIPRDR_FILE_CONTENTS_REQUEST* request) { Stream_Write_UINT32(s, request->streamId); /* streamId (4 bytes) */ Stream_Write_UINT32(s, request->listIndex); /* listIndex (4 bytes) */ @@ -95,19 +95,20 @@ static INLINE void cliprdr_write_lock_unlock_clipdata(wStream* s, UINT32 clipDat Stream_Write_UINT32(s, clipDataId); } -static void cliprdr_write_lock_clipdata(wStream* s, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) +static void cliprdr_write_lock_clipdata(wStream* s, + const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) { cliprdr_write_lock_unlock_clipdata(s, lockClipboardData->clipDataId); } static void cliprdr_write_unlock_clipdata(wStream* s, - const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) + const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) { cliprdr_write_lock_unlock_clipdata(s, unlockClipboardData->clipDataId); } static void cliprdr_write_file_contents_response(wStream* s, - const CLIPRDR_FILE_CONTENTS_RESPONSE* response) + const CLIPRDR_FILE_CONTENTS_RESPONSE* response) { Stream_Write_UINT32(s, response->streamId); /* streamId (4 bytes) */ Stream_Write(s, response->requestedData, response->cbRequested); @@ -129,7 +130,8 @@ wStream* cliprdr_packet_lock_clipdata_new(const CLIPRDR_LOCK_CLIPBOARD_DATA* loc return s; } -wStream* cliprdr_packet_unlock_clipdata_new(const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) +wStream* +cliprdr_packet_unlock_clipdata_new(const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) { wStream* s; @@ -168,8 +170,7 @@ wStream* cliprdr_packet_file_contents_response_new(const CLIPRDR_FILE_CONTENTS_R if (!response) return NULL; - s = cliprdr_packet_new(CB_FILECONTENTS_RESPONSE, response->msgFlags, - 4 + response->cbRequested); + s = cliprdr_packet_new(CB_FILECONTENTS_RESPONSE, response->msgFlags, 4 + response->cbRequested); if (!s) return NULL; @@ -178,7 +179,8 @@ wStream* cliprdr_packet_file_contents_response_new(const CLIPRDR_FILE_CONTENTS_R return s; } -wStream* cliprdr_packet_format_list_new(const CLIPRDR_FORMAT_LIST* formatList, BOOL useLongFormatNames) +wStream* cliprdr_packet_format_list_new(const CLIPRDR_FORMAT_LIST* formatList, + BOOL useLongFormatNames) { wStream* s; UINT32 index; @@ -191,7 +193,8 @@ wStream* cliprdr_packet_format_list_new(const CLIPRDR_FORMAT_LIST* formatList, B CLIPRDR_FORMAT* format; if (formatList->msgType != CB_FORMAT_LIST) - WLog_WARN(TAG, "[%s] called with invalid type %08"PRIx32, __FUNCTION__, formatList->msgType); + WLog_WARN(TAG, "[%s] called with invalid type %08" PRIx32, __FUNCTION__, + formatList->msgType); if (!useLongFormatNames) { @@ -207,7 +210,7 @@ wStream* cliprdr_packet_format_list_new(const CLIPRDR_FORMAT_LIST* formatList, B for (index = 0; index < formatList->numFormats; index++) { size_t formatNameLength = 0; - format = (CLIPRDR_FORMAT*) & (formatList->formats[index]); + format = (CLIPRDR_FORMAT*)&(formatList->formats[index]); Stream_Write_UINT32(s, format->formatId); /* formatId (4 bytes) */ formatNameSize = 0; @@ -229,8 +232,8 @@ wStream* cliprdr_packet_format_list_new(const CLIPRDR_FORMAT_LIST* formatList, B wszFormatName = NULL; if (szFormatName) - formatNameSize = ConvertToUnicode(CP_UTF8, 0, szFormatName, -1, &wszFormatName, - 0); + formatNameSize = + ConvertToUnicode(CP_UTF8, 0, szFormatName, -1, &wszFormatName, 0); if (formatNameSize < 0) return NULL; @@ -254,13 +257,13 @@ wStream* cliprdr_packet_format_list_new(const CLIPRDR_FORMAT_LIST* formatList, B UINT32 length = 0; for (index = 0; index < formatList->numFormats; index++) { - format = (CLIPRDR_FORMAT*) & (formatList->formats[index]); + format = (CLIPRDR_FORMAT*)&(formatList->formats[index]); length += 4; formatNameSize = 2; if (format->formatName) - formatNameSize = MultiByteToWideChar(CP_UTF8, 0, format->formatName, -1, NULL, - 0) * 2; + formatNameSize = + MultiByteToWideChar(CP_UTF8, 0, format->formatName, -1, NULL, 0) * 2; if (formatNameSize < 0) return NULL; @@ -278,7 +281,7 @@ wStream* cliprdr_packet_format_list_new(const CLIPRDR_FORMAT_LIST* formatList, B for (index = 0; index < formatList->numFormats; index++) { - format = (CLIPRDR_FORMAT*) & (formatList->formats[index]); + format = (CLIPRDR_FORMAT*)&(formatList->formats[index]); Stream_Write_UINT32(s, format->formatId); /* formatId (4 bytes) */ if (format->formatName) @@ -289,10 +292,11 @@ wStream* cliprdr_packet_format_list_new(const CLIPRDR_FORMAT_LIST* formatList, B if ((cap < pos) || ((rem / 2) > INT_MAX)) return NULL; - lpWideCharStr = (LPWSTR) Stream_Pointer(s); + lpWideCharStr = (LPWSTR)Stream_Pointer(s); cchWideChar = (int)(rem / 2); - formatNameSize = MultiByteToWideChar(CP_UTF8, 0, - format->formatName, -1, lpWideCharStr, cchWideChar) * 2; + formatNameSize = MultiByteToWideChar(CP_UTF8, 0, format->formatName, -1, + lpWideCharStr, cchWideChar) * + 2; if (formatNameSize < 0) return NULL; Stream_Seek(s, (size_t)formatNameSize); diff --git a/channels/cliprdr/cliprdr_common.h b/channels/cliprdr/cliprdr_common.h index d2c236967..b5d36b9b4 100644 --- a/channels/cliprdr/cliprdr_common.h +++ b/channels/cliprdr/cliprdr_common.h @@ -30,19 +30,31 @@ #include FREERDP_LOCAL wStream* cliprdr_packet_new(UINT16 msgType, UINT16 msgFlags, UINT32 dataLen); -FREERDP_LOCAL wStream* cliprdr_packet_lock_clipdata_new(const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); -FREERDP_LOCAL wStream* cliprdr_packet_unlock_clipdata_new(const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); -FREERDP_LOCAL wStream* cliprdr_packet_file_contents_request_new(const CLIPRDR_FILE_CONTENTS_REQUEST* request); -FREERDP_LOCAL wStream* cliprdr_packet_file_contents_response_new(const CLIPRDR_FILE_CONTENTS_RESPONSE* response); -FREERDP_LOCAL wStream* cliprdr_packet_format_list_new(const CLIPRDR_FORMAT_LIST* formatList, BOOL useLongFormatNames); +FREERDP_LOCAL wStream* +cliprdr_packet_lock_clipdata_new(const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); +FREERDP_LOCAL wStream* +cliprdr_packet_unlock_clipdata_new(const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); +FREERDP_LOCAL wStream* +cliprdr_packet_file_contents_request_new(const CLIPRDR_FILE_CONTENTS_REQUEST* request); +FREERDP_LOCAL wStream* +cliprdr_packet_file_contents_response_new(const CLIPRDR_FILE_CONTENTS_RESPONSE* response); +FREERDP_LOCAL wStream* cliprdr_packet_format_list_new(const CLIPRDR_FORMAT_LIST* formatList, + BOOL useLongFormatNames); -FREERDP_LOCAL UINT cliprdr_read_lock_clipdata(wStream* s, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); -FREERDP_LOCAL UINT cliprdr_read_unlock_clipdata(wStream* s, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); -FREERDP_LOCAL UINT cliprdr_read_format_data_request(wStream* s, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); -FREERDP_LOCAL UINT cliprdr_read_format_data_response(wStream* s, CLIPRDR_FORMAT_DATA_RESPONSE* response); -FREERDP_LOCAL UINT cliprdr_read_file_contents_request(wStream* s, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); -FREERDP_LOCAL UINT cliprdr_read_file_contents_response(wStream* s, CLIPRDR_FILE_CONTENTS_RESPONSE* response); -FREERDP_LOCAL UINT cliprdr_read_format_list(wStream* s, CLIPRDR_FORMAT_LIST* formatList, BOOL useLongFormatNames); +FREERDP_LOCAL UINT cliprdr_read_lock_clipdata(wStream* s, + CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); +FREERDP_LOCAL UINT cliprdr_read_unlock_clipdata(wStream* s, + CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); +FREERDP_LOCAL UINT cliprdr_read_format_data_request(wStream* s, + CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); +FREERDP_LOCAL UINT cliprdr_read_format_data_response(wStream* s, + CLIPRDR_FORMAT_DATA_RESPONSE* response); +FREERDP_LOCAL UINT +cliprdr_read_file_contents_request(wStream* s, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); +FREERDP_LOCAL UINT cliprdr_read_file_contents_response(wStream* s, + CLIPRDR_FILE_CONTENTS_RESPONSE* response); +FREERDP_LOCAL UINT cliprdr_read_format_list(wStream* s, CLIPRDR_FORMAT_LIST* formatList, + BOOL useLongFormatNames); FREERDP_LOCAL void cliprdr_free_format_list(CLIPRDR_FORMAT_LIST* formatList); diff --git a/channels/cliprdr/server/cliprdr_main.c b/channels/cliprdr/server/cliprdr_main.c index 95b8cb675..d8a733bc5 100644 --- a/channels/cliprdr/server/cliprdr_main.c +++ b/channels/cliprdr/server/cliprdr_main.c @@ -51,16 +51,21 @@ * | |\n * |-------------------------------------------------------------------------|\n _ * |-------------------------------Format List PDU-------------------------->|\n | - * |<--------------------------Format List Response PDU----------------------|\n _| Copy Sequence + * |<--------------------------Format List Response PDU----------------------|\n _| Copy + * Sequence * |<---------------------Lock Clipboard Data PDU (Optional)-----------------|\n * |-------------------------------------------------------------------------|\n * |-------------------------------------------------------------------------|\n _ - * |<--------------------------Format Data Request PDU-----------------------|\n | Paste Sequence Palette, - * |---------------------------Format Data Response PDU--------------------->|\n _| Metafile, File List Data + * |<--------------------------Format Data Request PDU-----------------------|\n | Paste + * Sequence Palette, + * |---------------------------Format Data Response PDU--------------------->|\n _| Metafile, + * File List Data * |-------------------------------------------------------------------------|\n * |-------------------------------------------------------------------------|\n _ - * |<------------------------Format Contents Request PDU---------------------|\n | Paste Sequence - * |-------------------------Format Contents Response PDU------------------->|\n _| File Stream Data + * |<------------------------Format Contents Request PDU---------------------|\n | Paste + * Sequence + * |-------------------------Format Contents Response PDU------------------->|\n _| File + * Stream Data * |<---------------------Lock Clipboard Data PDU (Optional)-----------------|\n * |-------------------------------------------------------------------------|\n * @@ -96,10 +101,10 @@ UINT cliprdr_server_packet_send(CliprdrServerPrivate* cliprdr, wStream* s) goto fail; } - status = WTSVirtualChannelWrite(cliprdr->ChannelHandle, - (PCHAR) Stream_Buffer(s), (UINT32)size, &written); + status = WTSVirtualChannelWrite(cliprdr->ChannelHandle, (PCHAR)Stream_Buffer(s), (UINT32)size, + &written); rc = status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; - fail: +fail: Stream_Free(s, TRUE); return rc; } @@ -115,10 +120,11 @@ static UINT cliprdr_server_capabilities(CliprdrServerContext* context, size_t offset = 0; UINT32 x; wStream* s; - CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; + CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*)context->handle; if (capabilities->msgType != CB_CLIP_CAPS) - WLog_WARN(TAG, "[%s] called with invalid type %08"PRIx32, __FUNCTION__, capabilities->msgType); + WLog_WARN(TAG, "[%s] called with invalid type %08" PRIx32, __FUNCTION__, + capabilities->msgType); if (capabilities->cCapabilitiesSets > UINT16_MAX) { @@ -134,27 +140,33 @@ static UINT cliprdr_server_capabilities(CliprdrServerContext* context, return ERROR_INTERNAL_ERROR; } - Stream_Write_UINT16(s, (UINT16)capabilities->cCapabilitiesSets); /* cCapabilitiesSets (2 bytes) */ - Stream_Write_UINT16(s, 0); /* pad1 (2 bytes) */ + Stream_Write_UINT16(s, + (UINT16)capabilities->cCapabilitiesSets); /* cCapabilitiesSets (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad1 (2 bytes) */ for (x = 0; x < capabilities->cCapabilitiesSets; x++) { - const CLIPRDR_CAPABILITY_SET* cap = (const CLIPRDR_CAPABILITY_SET*) (((const BYTE*)capabilities->capabilitySets) + offset); + const CLIPRDR_CAPABILITY_SET* cap = + (const CLIPRDR_CAPABILITY_SET*)(((const BYTE*)capabilities->capabilitySets) + offset); offset += cap->capabilitySetLength; switch (cap->capabilitySetType) { case CB_CAPSTYPE_GENERAL: { - const CLIPRDR_GENERAL_CAPABILITY_SET* generalCapabilitySet = (const CLIPRDR_GENERAL_CAPABILITY_SET*)cap; - Stream_Write_UINT16(s, generalCapabilitySet->capabilitySetType); /* capabilitySetType (2 bytes) */ - Stream_Write_UINT16(s, generalCapabilitySet->capabilitySetLength); /* lengthCapability (2 bytes) */ + const CLIPRDR_GENERAL_CAPABILITY_SET* generalCapabilitySet = + (const CLIPRDR_GENERAL_CAPABILITY_SET*)cap; + Stream_Write_UINT16( + s, generalCapabilitySet->capabilitySetType); /* capabilitySetType (2 bytes) */ + Stream_Write_UINT16( + s, generalCapabilitySet->capabilitySetLength); /* lengthCapability (2 bytes) */ Stream_Write_UINT32(s, generalCapabilitySet->version); /* version (4 bytes) */ - Stream_Write_UINT32(s, generalCapabilitySet->generalFlags); /* generalFlags (4 bytes) */ + Stream_Write_UINT32( + s, generalCapabilitySet->generalFlags); /* generalFlags (4 bytes) */ } break; default: - WLog_WARN(TAG, "Unknown capability set type %08"PRIx16, cap->capabilitySetType); + WLog_WARN(TAG, "Unknown capability set type %08" PRIx16, cap->capabilitySetType); if (!Stream_SafeSeek(s, cap->capabilitySetLength)) { WLog_ERR(TAG, "%s: short stream", __FUNCTION__); @@ -162,7 +174,6 @@ static UINT cliprdr_server_capabilities(CliprdrServerContext* context, } break; } - } WLog_DBG(TAG, "ServerCapabilities"); return cliprdr_server_packet_send(cliprdr, s); @@ -173,16 +184,17 @@ static UINT cliprdr_server_capabilities(CliprdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_server_monitor_ready(CliprdrServerContext* context, const CLIPRDR_MONITOR_READY* monitorReady) +static UINT cliprdr_server_monitor_ready(CliprdrServerContext* context, + const CLIPRDR_MONITOR_READY* monitorReady) { wStream* s; - CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; + CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*)context->handle; if (monitorReady->msgType != CB_MONITOR_READY) - WLog_WARN(TAG, "[%s] called with invalid type %08"PRIx32, __FUNCTION__, monitorReady->msgType); + WLog_WARN(TAG, "[%s] called with invalid type %08" PRIx32, __FUNCTION__, + monitorReady->msgType); - s = cliprdr_packet_new(CB_MONITOR_READY, - monitorReady->msgFlags, monitorReady->dataLen); + s = cliprdr_packet_new(CB_MONITOR_READY, monitorReady->msgFlags, monitorReady->dataLen); if (!s) { @@ -203,7 +215,7 @@ static UINT cliprdr_server_format_list(CliprdrServerContext* context, const CLIPRDR_FORMAT_LIST* formatList) { wStream* s; - CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; + CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*)context->handle; s = cliprdr_packet_format_list_new(formatList, context->useLongFormatNames); if (!s) @@ -212,8 +224,7 @@ static UINT cliprdr_server_format_list(CliprdrServerContext* context, return ERROR_INTERNAL_ERROR; } - WLog_DBG(TAG, "ServerFormatList: numFormats: %"PRIu32"", - formatList->numFormats); + WLog_DBG(TAG, "ServerFormatList: numFormats: %" PRIu32 "", formatList->numFormats); return cliprdr_server_packet_send(cliprdr, s); } @@ -222,16 +233,18 @@ static UINT cliprdr_server_format_list(CliprdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_server_format_list_response(CliprdrServerContext* context, - const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) +static UINT +cliprdr_server_format_list_response(CliprdrServerContext* context, + const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) { wStream* s; - CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; + CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*)context->handle; if (formatListResponse->msgType != CB_FORMAT_LIST_RESPONSE) - WLog_WARN(TAG, "[%s] called with invalid type %08"PRIx32, __FUNCTION__, formatListResponse->msgType); + WLog_WARN(TAG, "[%s] called with invalid type %08" PRIx32, __FUNCTION__, + formatListResponse->msgType); - s = cliprdr_packet_new(CB_FORMAT_LIST_RESPONSE, - formatListResponse->msgFlags, formatListResponse->dataLen); + s = cliprdr_packet_new(CB_FORMAT_LIST_RESPONSE, formatListResponse->msgFlags, + formatListResponse->dataLen); if (!s) { @@ -249,12 +262,13 @@ static UINT cliprdr_server_format_list_response(CliprdrServerContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT cliprdr_server_lock_clipboard_data(CliprdrServerContext* context, - const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) + const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) { wStream* s; - CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; + CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*)context->handle; if (lockClipboardData->msgType != CB_LOCK_CLIPDATA) - WLog_WARN(TAG, "[%s] called with invalid type %08"PRIx32, __FUNCTION__, lockClipboardData->msgType); + WLog_WARN(TAG, "[%s] called with invalid type %08" PRIx32, __FUNCTION__, + lockClipboardData->msgType); s = cliprdr_packet_lock_clipdata_new(lockClipboardData); if (!s) @@ -263,7 +277,7 @@ static UINT cliprdr_server_lock_clipboard_data(CliprdrServerContext* context, return ERROR_INTERNAL_ERROR; } - WLog_DBG(TAG, "ServerLockClipboardData: clipDataId: 0x%08"PRIX32"", + WLog_DBG(TAG, "ServerLockClipboardData: clipDataId: 0x%08" PRIX32 "", lockClipboardData->clipDataId); return cliprdr_server_packet_send(cliprdr, s); } @@ -273,13 +287,15 @@ static UINT cliprdr_server_lock_clipboard_data(CliprdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_server_unlock_clipboard_data(CliprdrServerContext* context, - const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) +static UINT +cliprdr_server_unlock_clipboard_data(CliprdrServerContext* context, + const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) { wStream* s; - CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; + CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*)context->handle; if (unlockClipboardData->msgType != CB_UNLOCK_CLIPDATA) - WLog_WARN(TAG, "[%s] called with invalid type %08"PRIx32, __FUNCTION__, unlockClipboardData->msgType); + WLog_WARN(TAG, "[%s] called with invalid type %08" PRIx32, __FUNCTION__, + unlockClipboardData->msgType); s = cliprdr_packet_unlock_clipdata_new(unlockClipboardData); @@ -289,7 +305,7 @@ static UINT cliprdr_server_unlock_clipboard_data(CliprdrServerContext* context, return ERROR_INTERNAL_ERROR; } - WLog_DBG(TAG, "ServerUnlockClipboardData: clipDataId: 0x%08"PRIX32"", + WLog_DBG(TAG, "ServerUnlockClipboardData: clipDataId: 0x%08" PRIX32 "", unlockClipboardData->clipDataId); return cliprdr_server_packet_send(cliprdr, s); } @@ -300,15 +316,16 @@ static UINT cliprdr_server_unlock_clipboard_data(CliprdrServerContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT cliprdr_server_format_data_request(CliprdrServerContext* context, - const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) + const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) { wStream* s; - CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; + CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*)context->handle; if (formatDataRequest->msgType != CB_FORMAT_DATA_REQUEST) - WLog_WARN(TAG, "[%s] called with invalid type %08"PRIx32, __FUNCTION__, formatDataRequest->msgType); + WLog_WARN(TAG, "[%s] called with invalid type %08" PRIx32, __FUNCTION__, + formatDataRequest->msgType); - s = cliprdr_packet_new(CB_FORMAT_DATA_REQUEST, - formatDataRequest->msgFlags, formatDataRequest->dataLen); + s = cliprdr_packet_new(CB_FORMAT_DATA_REQUEST, formatDataRequest->msgFlags, + formatDataRequest->dataLen); if (!s) { @@ -316,8 +333,7 @@ static UINT cliprdr_server_format_data_request(CliprdrServerContext* context, return ERROR_INTERNAL_ERROR; } - Stream_Write_UINT32(s, - formatDataRequest->requestedFormatId); /* requestedFormatId (4 bytes) */ + Stream_Write_UINT32(s, formatDataRequest->requestedFormatId); /* requestedFormatId (4 bytes) */ WLog_DBG(TAG, "ClientFormatDataRequest"); return cliprdr_server_packet_send(cliprdr, s); } @@ -327,17 +343,19 @@ static UINT cliprdr_server_format_data_request(CliprdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_server_format_data_response(CliprdrServerContext* context, - const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) +static UINT +cliprdr_server_format_data_response(CliprdrServerContext* context, + const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) { wStream* s; - CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; + CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*)context->handle; if (formatDataResponse->msgType != CB_FORMAT_DATA_RESPONSE) - WLog_WARN(TAG, "[%s] called with invalid type %08"PRIx32, __FUNCTION__, formatDataResponse->msgType); + WLog_WARN(TAG, "[%s] called with invalid type %08" PRIx32, __FUNCTION__, + formatDataResponse->msgType); - s = cliprdr_packet_new(CB_FORMAT_DATA_RESPONSE, - formatDataResponse->msgFlags, formatDataResponse->dataLen); + s = cliprdr_packet_new(CB_FORMAT_DATA_RESPONSE, formatDataResponse->msgFlags, + formatDataResponse->dataLen); if (!s) { @@ -345,8 +363,7 @@ static UINT cliprdr_server_format_data_response(CliprdrServerContext* context, return ERROR_INTERNAL_ERROR; } - Stream_Write(s, formatDataResponse->requestedFormatData, - formatDataResponse->dataLen); + Stream_Write(s, formatDataResponse->requestedFormatData, formatDataResponse->dataLen); WLog_DBG(TAG, "ServerFormatDataResponse"); return cliprdr_server_packet_send(cliprdr, s); } @@ -356,14 +373,16 @@ static UINT cliprdr_server_format_data_response(CliprdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_server_file_contents_request(CliprdrServerContext* context, - const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +static UINT +cliprdr_server_file_contents_request(CliprdrServerContext* context, + const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { wStream* s; - CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; + CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*)context->handle; if (fileContentsRequest->msgType != CB_FILECONTENTS_REQUEST) - WLog_WARN(TAG, "[%s] called with invalid type %08"PRIx32, __FUNCTION__, fileContentsRequest->msgType); + WLog_WARN(TAG, "[%s] called with invalid type %08" PRIx32, __FUNCTION__, + fileContentsRequest->msgType); s = cliprdr_packet_file_contents_request_new(fileContentsRequest); if (!s) @@ -372,7 +391,7 @@ static UINT cliprdr_server_file_contents_request(CliprdrServerContext* context, return ERROR_INTERNAL_ERROR; } - WLog_DBG(TAG, "ServerFileContentsRequest: streamId: 0x%08"PRIX32"", + WLog_DBG(TAG, "ServerFileContentsRequest: streamId: 0x%08" PRIX32 "", fileContentsRequest->streamId); return cliprdr_server_packet_send(cliprdr, s); } @@ -382,14 +401,16 @@ static UINT cliprdr_server_file_contents_request(CliprdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_server_file_contents_response(CliprdrServerContext* context, - const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) +static UINT +cliprdr_server_file_contents_response(CliprdrServerContext* context, + const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) { wStream* s; - CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; + CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*)context->handle; if (fileContentsResponse->msgType != CB_FILECONTENTS_RESPONSE) - WLog_WARN(TAG, "[%s] called with invalid type %08"PRIx32, __FUNCTION__, fileContentsResponse->msgType); + WLog_WARN(TAG, "[%s] called with invalid type %08" PRIx32, __FUNCTION__, + fileContentsResponse->msgType); s = cliprdr_packet_file_contents_response_new(fileContentsResponse); if (!s) @@ -398,7 +419,7 @@ static UINT cliprdr_server_file_contents_response(CliprdrServerContext* context, return ERROR_INTERNAL_ERROR; } - WLog_DBG(TAG, "ServerFileContentsResponse: streamId: 0x%08"PRIX32"", + WLog_DBG(TAG, "ServerFileContentsResponse: streamId: 0x%08" PRIX32 "", fileContentsResponse->streamId); return cliprdr_server_packet_send(cliprdr, s); } @@ -408,23 +429,23 @@ static UINT cliprdr_server_file_contents_response(CliprdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_server_receive_general_capability(CliprdrServerContext* - context, wStream* s, CLIPRDR_GENERAL_CAPABILITY_SET* cap_set) +static UINT cliprdr_server_receive_general_capability(CliprdrServerContext* context, wStream* s, + CLIPRDR_GENERAL_CAPABILITY_SET* cap_set) { - Stream_Read_UINT32(s, cap_set->version); /* version (4 bytes) */ + Stream_Read_UINT32(s, cap_set->version); /* version (4 bytes) */ Stream_Read_UINT32(s, cap_set->generalFlags); /* generalFlags (4 bytes) */ if (context->useLongFormatNames) - context->useLongFormatNames = (cap_set->generalFlags & CB_USE_LONG_FORMAT_NAMES) ? TRUE : - FALSE; + context->useLongFormatNames = + (cap_set->generalFlags & CB_USE_LONG_FORMAT_NAMES) ? TRUE : FALSE; if (context->streamFileClipEnabled) - context->streamFileClipEnabled = (cap_set->generalFlags & CB_STREAM_FILECLIP_ENABLED) ? - TRUE : FALSE; + context->streamFileClipEnabled = + (cap_set->generalFlags & CB_STREAM_FILECLIP_ENABLED) ? TRUE : FALSE; if (context->fileClipNoFilePaths) - context->fileClipNoFilePaths = (cap_set->generalFlags & CB_FILECLIP_NO_FILE_PATHS) ? - TRUE : FALSE; + context->fileClipNoFilePaths = + (cap_set->generalFlags & CB_FILECLIP_NO_FILE_PATHS) ? TRUE : FALSE; if (context->canLockClipData) context->canLockClipData = (cap_set->generalFlags & CB_CAN_LOCK_CLIPDATA) ? TRUE : FALSE; @@ -437,8 +458,8 @@ static UINT cliprdr_server_receive_general_capability(CliprdrServerContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_server_receive_capabilities(CliprdrServerContext* context, - wStream* s, const CLIPRDR_HEADER* header) +static UINT cliprdr_server_receive_capabilities(CliprdrServerContext* context, wStream* s, + const CLIPRDR_HEADER* header) { UINT16 index; UINT16 capabilitySetType; @@ -456,11 +477,11 @@ static UINT cliprdr_server_receive_capabilities(CliprdrServerContext* context, WLog_DBG(TAG, "CliprdrClientCapabilities"); Stream_Read_UINT16(s, capabilities.cCapabilitiesSets); /* cCapabilitiesSets (2 bytes) */ - Stream_Seek_UINT16(s); /* pad1 (2 bytes) */ + Stream_Seek_UINT16(s); /* pad1 (2 bytes) */ for (index = 0; index < capabilities.cCapabilitiesSets; index++) { - Stream_Read_UINT16(s, capabilitySetType); /* capabilitySetType (2 bytes) */ + Stream_Read_UINT16(s, capabilitySetType); /* capabilitySetType (2 bytes) */ Stream_Read_UINT16(s, capabilitySetLength); /* capabilitySetLength (2 bytes) */ cap_sets_size += capabilitySetLength; @@ -473,26 +494,30 @@ static UINT cliprdr_server_receive_capabilities(CliprdrServerContext* context, return CHANNEL_RC_NO_MEMORY; } - capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET*) tmp; + capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET*)tmp; capSet = &(capabilities.capabilitySets[index]); capSet->capabilitySetType = capabilitySetType; - capSet->capabilitySetLength= capabilitySetLength; + capSet->capabilitySetLength = capabilitySetLength; switch (capSet->capabilitySetType) { case CB_CAPSTYPE_GENERAL: - if ((error = cliprdr_server_receive_general_capability(context, s, (CLIPRDR_GENERAL_CAPABILITY_SET*) capSet))) + if ((error = cliprdr_server_receive_general_capability( + context, s, (CLIPRDR_GENERAL_CAPABILITY_SET*)capSet))) { - WLog_ERR(TAG, "cliprdr_server_receive_general_capability failed with error %"PRIu32"", + WLog_ERR(TAG, + "cliprdr_server_receive_general_capability failed with error %" PRIu32 + "", error); goto out; } break; default: - WLog_ERR(TAG, "unknown cliprdr capability set: %"PRIu16"", capSet->capabilitySetType); + WLog_ERR(TAG, "unknown cliprdr capability set: %" PRIu16 "", + capSet->capabilitySetType); error = ERROR_INVALID_DATA; goto out; } @@ -509,25 +534,25 @@ out: * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_server_receive_temporary_directory(CliprdrServerContext* - context, wStream* s, const CLIPRDR_HEADER* header) +static UINT cliprdr_server_receive_temporary_directory(CliprdrServerContext* context, wStream* s, + const CLIPRDR_HEADER* header) { size_t length; WCHAR* wszTempDir; CLIPRDR_TEMP_DIRECTORY tempDirectory; - CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; + CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*)context->handle; size_t slength; UINT error = CHANNEL_RC_OK; WINPR_UNUSED(header); if ((slength = Stream_GetRemainingLength(s)) < 520) { - WLog_ERR(TAG, - "Stream_GetRemainingLength returned %"PRIuz" but should at least be 520", slength); + WLog_ERR(TAG, "Stream_GetRemainingLength returned %" PRIuz " but should at least be 520", + slength); return CHANNEL_RC_NO_MEMORY; } - wszTempDir = (WCHAR*) Stream_Pointer(s); + wszTempDir = (WCHAR*)Stream_Pointer(s); if (wszTempDir[260] != 0) { @@ -538,8 +563,8 @@ static UINT cliprdr_server_receive_temporary_directory(CliprdrServerContext* free(cliprdr->temporaryDirectory); cliprdr->temporaryDirectory = NULL; - if (ConvertFromUnicode(CP_UTF8, 0, wszTempDir, -1, - &(cliprdr->temporaryDirectory), 0, NULL, NULL) < 1) + if (ConvertFromUnicode(CP_UTF8, 0, wszTempDir, -1, &(cliprdr->temporaryDirectory), 0, NULL, + NULL) < 1) { WLog_ERR(TAG, "failed to convert temporary directory name"); return ERROR_INVALID_DATA; @@ -556,7 +581,7 @@ static UINT cliprdr_server_receive_temporary_directory(CliprdrServerContext* IFCALLRET(context->TempDirectory, error, context, &tempDirectory); if (error) - WLog_ERR(TAG, "TempDirectory failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "TempDirectory failed with error %" PRIu32 "!", error); return error; } @@ -566,8 +591,8 @@ static UINT cliprdr_server_receive_temporary_directory(CliprdrServerContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_server_receive_format_list(CliprdrServerContext* context, - wStream* s, const CLIPRDR_HEADER* header) +static UINT cliprdr_server_receive_format_list(CliprdrServerContext* context, wStream* s, + const CLIPRDR_HEADER* header) { CLIPRDR_FORMAT_LIST formatList; UINT error = CHANNEL_RC_OK; @@ -579,12 +604,11 @@ static UINT cliprdr_server_receive_format_list(CliprdrServerContext* context, if ((error = cliprdr_read_format_list(s, &formatList, context->useLongFormatNames))) goto out; - WLog_DBG(TAG, "ClientFormatList: numFormats: %"PRIu32"", - formatList.numFormats); + WLog_DBG(TAG, "ClientFormatList: numFormats: %" PRIu32 "", formatList.numFormats); IFCALLRET(context->ClientFormatList, error, context, &formatList); if (error) - WLog_ERR(TAG, "ClientFormatList failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "ClientFormatList failed with error %" PRIu32 "!", error); out: cliprdr_free_format_list(&formatList); @@ -596,8 +620,8 @@ out: * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_server_receive_format_list_response( - CliprdrServerContext* context, wStream* s, const CLIPRDR_HEADER* header) +static UINT cliprdr_server_receive_format_list_response(CliprdrServerContext* context, wStream* s, + const CLIPRDR_HEADER* header) { CLIPRDR_FORMAT_LIST_RESPONSE formatListResponse; UINT error = CHANNEL_RC_OK; @@ -607,11 +631,10 @@ static UINT cliprdr_server_receive_format_list_response( formatListResponse.msgType = CB_FORMAT_LIST_RESPONSE; formatListResponse.msgFlags = header->msgFlags; formatListResponse.dataLen = header->dataLen; - IFCALLRET(context->ClientFormatListResponse, error, context, - &formatListResponse); + IFCALLRET(context->ClientFormatListResponse, error, context, &formatListResponse); if (error) - WLog_ERR(TAG, "ClientFormatListResponse failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "ClientFormatListResponse failed with error %" PRIu32 "!", error); return error; } @@ -621,8 +644,8 @@ static UINT cliprdr_server_receive_format_list_response( * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_server_receive_lock_clipdata(CliprdrServerContext* context, - wStream* s, const CLIPRDR_HEADER* header) +static UINT cliprdr_server_receive_lock_clipdata(CliprdrServerContext* context, wStream* s, + const CLIPRDR_HEADER* header) { CLIPRDR_LOCK_CLIPBOARD_DATA lockClipboardData; UINT error = CHANNEL_RC_OK; @@ -641,7 +664,7 @@ static UINT cliprdr_server_receive_lock_clipdata(CliprdrServerContext* context, IFCALLRET(context->ClientLockClipboardData, error, context, &lockClipboardData); if (error) - WLog_ERR(TAG, "ClientLockClipboardData failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "ClientLockClipboardData failed with error %" PRIu32 "!", error); return error; } @@ -651,8 +674,8 @@ static UINT cliprdr_server_receive_lock_clipdata(CliprdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_server_receive_unlock_clipdata(CliprdrServerContext* - context, wStream* s, const CLIPRDR_HEADER* header) +static UINT cliprdr_server_receive_unlock_clipdata(CliprdrServerContext* context, wStream* s, + const CLIPRDR_HEADER* header) { CLIPRDR_UNLOCK_CLIPBOARD_DATA unlockClipboardData; UINT error = CHANNEL_RC_OK; @@ -665,11 +688,10 @@ static UINT cliprdr_server_receive_unlock_clipdata(CliprdrServerContext* if ((error = cliprdr_read_unlock_clipdata(s, &unlockClipboardData))) return error; - IFCALLRET(context->ClientUnlockClipboardData, error, context, - &unlockClipboardData); + IFCALLRET(context->ClientUnlockClipboardData, error, context, &unlockClipboardData); if (error) - WLog_ERR(TAG, "ClientUnlockClipboardData failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "ClientUnlockClipboardData failed with error %" PRIu32 "!", error); return error; } @@ -679,8 +701,8 @@ static UINT cliprdr_server_receive_unlock_clipdata(CliprdrServerContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_server_receive_format_data_request(CliprdrServerContext* - context, wStream* s, const CLIPRDR_HEADER* header) +static UINT cliprdr_server_receive_format_data_request(CliprdrServerContext* context, wStream* s, + const CLIPRDR_HEADER* header) { CLIPRDR_FORMAT_DATA_REQUEST formatDataRequest; UINT error = CHANNEL_RC_OK; @@ -696,7 +718,7 @@ static UINT cliprdr_server_receive_format_data_request(CliprdrServerContext* IFCALLRET(context->ClientFormatDataRequest, error, context, &formatDataRequest); if (error) - WLog_ERR(TAG, "ClientFormatDataRequest failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "ClientFormatDataRequest failed with error %" PRIu32 "!", error); return error; } @@ -706,8 +728,8 @@ static UINT cliprdr_server_receive_format_data_request(CliprdrServerContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_server_receive_format_data_response( - CliprdrServerContext* context, wStream* s, const CLIPRDR_HEADER* header) +static UINT cliprdr_server_receive_format_data_response(CliprdrServerContext* context, wStream* s, + const CLIPRDR_HEADER* header) { CLIPRDR_FORMAT_DATA_RESPONSE formatDataResponse; UINT error = CHANNEL_RC_OK; @@ -720,11 +742,10 @@ static UINT cliprdr_server_receive_format_data_response( if ((error = cliprdr_read_format_data_response(s, &formatDataResponse))) return error; - IFCALLRET(context->ClientFormatDataResponse, error, context, - &formatDataResponse); + IFCALLRET(context->ClientFormatDataResponse, error, context, &formatDataResponse); if (error) - WLog_ERR(TAG, "ClientFormatDataResponse failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "ClientFormatDataResponse failed with error %" PRIu32 "!", error); return error; } @@ -734,8 +755,8 @@ static UINT cliprdr_server_receive_format_data_response( * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_server_receive_filecontents_request( - CliprdrServerContext* context, wStream* s, const CLIPRDR_HEADER* header) +static UINT cliprdr_server_receive_filecontents_request(CliprdrServerContext* context, wStream* s, + const CLIPRDR_HEADER* header) { CLIPRDR_FILE_CONTENTS_REQUEST request; UINT error = CHANNEL_RC_OK; @@ -750,7 +771,7 @@ static UINT cliprdr_server_receive_filecontents_request( IFCALLRET(context->ClientFileContentsRequest, error, context, &request); if (error) - WLog_ERR(TAG, "ClientFileContentsRequest failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "ClientFileContentsRequest failed with error %" PRIu32 "!", error); return error; } @@ -760,8 +781,8 @@ static UINT cliprdr_server_receive_filecontents_request( * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_server_receive_filecontents_response( - CliprdrServerContext* context, wStream* s, const CLIPRDR_HEADER* header) +static UINT cliprdr_server_receive_filecontents_response(CliprdrServerContext* context, wStream* s, + const CLIPRDR_HEADER* header) { CLIPRDR_FILE_CONTENTS_RESPONSE response; UINT error = CHANNEL_RC_OK; @@ -777,7 +798,7 @@ static UINT cliprdr_server_receive_filecontents_response( IFCALLRET(context->ClientFileContentsResponse, error, context, &response); if (error) - WLog_ERR(TAG, "ClientFileContentsResponse failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "ClientFileContentsResponse failed with error %" PRIu32 "!", error); return error; } @@ -787,19 +808,20 @@ static UINT cliprdr_server_receive_filecontents_response( * * @return 0 on success, otherwise a Win32 error code */ -static UINT cliprdr_server_receive_pdu(CliprdrServerContext* context, - wStream* s, const CLIPRDR_HEADER* header) +static UINT cliprdr_server_receive_pdu(CliprdrServerContext* context, wStream* s, + const CLIPRDR_HEADER* header) { UINT error; WLog_DBG(TAG, - "CliprdrServerReceivePdu: msgType: %"PRIu16" msgFlags: 0x%04"PRIX16" dataLen: %"PRIu32"", + "CliprdrServerReceivePdu: msgType: %" PRIu16 " msgFlags: 0x%04" PRIX16 + " dataLen: %" PRIu32 "", header->msgType, header->msgFlags, header->dataLen); switch (header->msgType) { case CB_CLIP_CAPS: if ((error = cliprdr_server_receive_capabilities(context, s, header))) - WLog_ERR(TAG, "cliprdr_server_receive_capabilities failed with error %"PRIu32"!", + WLog_ERR(TAG, "cliprdr_server_receive_capabilities failed with error %" PRIu32 "!", error); break; @@ -807,13 +829,15 @@ static UINT cliprdr_server_receive_pdu(CliprdrServerContext* context, case CB_TEMP_DIRECTORY: if ((error = cliprdr_server_receive_temporary_directory(context, s, header))) WLog_ERR(TAG, - "cliprdr_server_receive_temporary_directory failed with error %"PRIu32"!", error); + "cliprdr_server_receive_temporary_directory failed with error %" PRIu32 + "!", + error); break; case CB_FORMAT_LIST: if ((error = cliprdr_server_receive_format_list(context, s, header))) - WLog_ERR(TAG, "cliprdr_server_receive_format_list failed with error %"PRIu32"!", + WLog_ERR(TAG, "cliprdr_server_receive_format_list failed with error %" PRIu32 "!", error); break; @@ -821,20 +845,23 @@ static UINT cliprdr_server_receive_pdu(CliprdrServerContext* context, case CB_FORMAT_LIST_RESPONSE: if ((error = cliprdr_server_receive_format_list_response(context, s, header))) WLog_ERR(TAG, - "cliprdr_server_receive_format_list_response failed with error %"PRIu32"!", error); + "cliprdr_server_receive_format_list_response failed with error %" PRIu32 + "!", + error); break; case CB_LOCK_CLIPDATA: if ((error = cliprdr_server_receive_lock_clipdata(context, s, header))) - WLog_ERR(TAG, "cliprdr_server_receive_lock_clipdata failed with error %"PRIu32"!", + WLog_ERR(TAG, "cliprdr_server_receive_lock_clipdata failed with error %" PRIu32 "!", error); break; case CB_UNLOCK_CLIPDATA: if ((error = cliprdr_server_receive_unlock_clipdata(context, s, header))) - WLog_ERR(TAG, "cliprdr_server_receive_unlock_clipdata failed with error %"PRIu32"!", + WLog_ERR(TAG, + "cliprdr_server_receive_unlock_clipdata failed with error %" PRIu32 "!", error); break; @@ -842,34 +869,42 @@ static UINT cliprdr_server_receive_pdu(CliprdrServerContext* context, case CB_FORMAT_DATA_REQUEST: if ((error = cliprdr_server_receive_format_data_request(context, s, header))) WLog_ERR(TAG, - "cliprdr_server_receive_format_data_request failed with error %"PRIu32"!", error); + "cliprdr_server_receive_format_data_request failed with error %" PRIu32 + "!", + error); break; case CB_FORMAT_DATA_RESPONSE: if ((error = cliprdr_server_receive_format_data_response(context, s, header))) WLog_ERR(TAG, - "cliprdr_server_receive_format_data_response failed with error %"PRIu32"!", error); + "cliprdr_server_receive_format_data_response failed with error %" PRIu32 + "!", + error); break; case CB_FILECONTENTS_REQUEST: if ((error = cliprdr_server_receive_filecontents_request(context, s, header))) WLog_ERR(TAG, - "cliprdr_server_receive_filecontents_request failed with error %"PRIu32"!", error); + "cliprdr_server_receive_filecontents_request failed with error %" PRIu32 + "!", + error); break; case CB_FILECONTENTS_RESPONSE: if ((error = cliprdr_server_receive_filecontents_response(context, s, header))) WLog_ERR(TAG, - "cliprdr_server_receive_filecontents_response failed with error %"PRIu32"!", error); + "cliprdr_server_receive_filecontents_response failed with error %" PRIu32 + "!", + error); break; default: error = ERROR_INVALID_DATA; - WLog_ERR(TAG, "Unexpected clipboard PDU type: %"PRIu16"", header->msgType); + WLog_ERR(TAG, "Unexpected clipboard PDU type: %" PRIu16 "", header->msgType); break; } @@ -909,7 +944,7 @@ static UINT cliprdr_server_init(CliprdrServerContext* context) capabilities.msgFlags = 0; capabilities.dataLen = 4 + CB_CAPSTYPE_GENERAL_LEN; capabilities.cCapabilitiesSets = 1; - capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET*) &generalCapabilitySet; + capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET*)&generalCapabilitySet; generalCapabilitySet.capabilitySetType = CB_CAPSTYPE_GENERAL; generalCapabilitySet.capabilitySetLength = CB_CAPSTYPE_GENERAL_LEN; generalCapabilitySet.version = CB_CAPS_VERSION_2; @@ -917,13 +952,13 @@ static UINT cliprdr_server_init(CliprdrServerContext* context) if ((error = context->ServerCapabilities(context, &capabilities))) { - WLog_ERR(TAG, "ServerCapabilities failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "ServerCapabilities failed with error %" PRIu32 "!", error); return error; } if ((error = context->MonitorReady(context, &monitorReady))) { - WLog_ERR(TAG, "MonitorReady failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "MonitorReady failed with error %" PRIu32 "!", error); return error; } @@ -942,7 +977,7 @@ UINT cliprdr_server_read(CliprdrServerContext* context) DWORD BytesToRead; DWORD BytesReturned; CLIPRDR_HEADER header; - CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; + CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*)context->handle; UINT error; DWORD status; s = cliprdr->s; @@ -956,15 +991,15 @@ UINT cliprdr_server_read(CliprdrServerContext* context) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", error); return error; } if (status == WAIT_TIMEOUT) return CHANNEL_RC_OK; - if (!WTSVirtualChannelRead(cliprdr->ChannelHandle, 0, - (PCHAR) Stream_Pointer(s), BytesToRead, &BytesReturned)) + if (!WTSVirtualChannelRead(cliprdr->ChannelHandle, 0, (PCHAR)Stream_Pointer(s), BytesToRead, + &BytesReturned)) { WLog_ERR(TAG, "WTSVirtualChannelRead failed!"); return ERROR_INTERNAL_ERROR; @@ -977,9 +1012,9 @@ UINT cliprdr_server_read(CliprdrServerContext* context) { position = Stream_GetPosition(s); Stream_SetPosition(s, 0); - Stream_Read_UINT16(s, header.msgType); /* msgType (2 bytes) */ + Stream_Read_UINT16(s, header.msgType); /* msgType (2 bytes) */ Stream_Read_UINT16(s, header.msgFlags); /* msgFlags (2 bytes) */ - Stream_Read_UINT32(s, header.dataLen); /* dataLen (4 bytes) */ + Stream_Read_UINT32(s, header.dataLen); /* dataLen (4 bytes) */ if (!Stream_EnsureCapacity(s, (header.dataLen + CLIPRDR_HEADER_LENGTH))) { @@ -992,21 +1027,22 @@ UINT cliprdr_server_read(CliprdrServerContext* context) if (Stream_GetPosition(s) < (header.dataLen + CLIPRDR_HEADER_LENGTH)) { BytesReturned = 0; - BytesToRead = (UINT32)((header.dataLen + CLIPRDR_HEADER_LENGTH) - Stream_GetPosition(s)); + BytesToRead = + (UINT32)((header.dataLen + CLIPRDR_HEADER_LENGTH) - Stream_GetPosition(s)); status = WaitForSingleObject(cliprdr->ChannelEvent, 0); if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", error); return error; } if (status == WAIT_TIMEOUT) return CHANNEL_RC_OK; - if (!WTSVirtualChannelRead(cliprdr->ChannelHandle, 0, - (PCHAR) Stream_Pointer(s), BytesToRead, &BytesReturned)) + if (!WTSVirtualChannelRead(cliprdr->ChannelHandle, 0, (PCHAR)Stream_Pointer(s), + BytesToRead, &BytesReturned)) { WLog_ERR(TAG, "WTSVirtualChannelRead failed!"); return ERROR_INTERNAL_ERROR; @@ -1023,7 +1059,8 @@ UINT cliprdr_server_read(CliprdrServerContext* context) if ((error = cliprdr_server_receive_pdu(context, s, &header))) { - WLog_ERR(TAG, "cliprdr_server_receive_pdu failed with error code %"PRIu32"!", error); + WLog_ERR(TAG, "cliprdr_server_receive_pdu failed with error code %" PRIu32 "!", + error); return error; } @@ -1034,7 +1071,7 @@ UINT cliprdr_server_read(CliprdrServerContext* context) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", error); return error; } @@ -1044,8 +1081,8 @@ UINT cliprdr_server_read(CliprdrServerContext* context) BytesReturned = 0; BytesToRead = 4; - if (!WTSVirtualChannelRead(cliprdr->ChannelHandle, 0, - (PCHAR) Stream_Pointer(s), BytesToRead, &BytesReturned)) + if (!WTSVirtualChannelRead(cliprdr->ChannelHandle, 0, (PCHAR)Stream_Pointer(s), + BytesToRead, &BytesReturned)) { WLog_ERR(TAG, "WTSVirtualChannelRead failed!"); return ERROR_INTERNAL_ERROR; @@ -1053,7 +1090,7 @@ UINT cliprdr_server_read(CliprdrServerContext* context) if (BytesReturned == 4) { - Stream_Read_UINT16(s, header.msgType); /* msgType (2 bytes) */ + Stream_Read_UINT16(s, header.msgType); /* msgType (2 bytes) */ Stream_Read_UINT16(s, header.msgFlags); /* msgFlags (2 bytes) */ if (!header.msgType) @@ -1078,8 +1115,8 @@ static DWORD WINAPI cliprdr_server_thread(LPVOID arg) DWORD nCount; HANDLE events[8]; HANDLE ChannelEvent; - CliprdrServerContext* context = (CliprdrServerContext*) arg; - CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; + CliprdrServerContext* context = (CliprdrServerContext*)arg; + CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*)context->handle; UINT error = CHANNEL_RC_OK; ChannelEvent = context->GetEventHandle(context); @@ -1091,7 +1128,7 @@ static DWORD WINAPI cliprdr_server_thread(LPVOID arg) { if ((error = cliprdr_server_init(context))) { - WLog_ERR(TAG, "cliprdr_server_init failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "cliprdr_server_init failed with error %" PRIu32 "!", error); goto out; } } @@ -1103,7 +1140,7 @@ static DWORD WINAPI cliprdr_server_thread(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "", error); goto out; } @@ -1112,7 +1149,7 @@ static DWORD WINAPI cliprdr_server_thread(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", error); goto out; } @@ -1124,7 +1161,7 @@ static DWORD WINAPI cliprdr_server_thread(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", error); goto out; } @@ -1132,7 +1169,7 @@ static DWORD WINAPI cliprdr_server_thread(LPVOID arg) { if ((error = context->CheckEventHandle(context))) { - WLog_ERR(TAG, "CheckEventHandle failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "CheckEventHandle failed with error %" PRIu32 "!", error); break; } } @@ -1141,8 +1178,7 @@ static DWORD WINAPI cliprdr_server_thread(LPVOID arg) out: if (error && context->rdpcontext) - setChannelError(context->rdpcontext, error, - "cliprdr_server_thread reported an error"); + setChannelError(context->rdpcontext, error, "cliprdr_server_thread reported an error"); ExitThread(error); return error; @@ -1157,9 +1193,8 @@ static UINT cliprdr_server_open(CliprdrServerContext* context) { void* buffer = NULL; DWORD BytesReturned = 0; - CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; - cliprdr->ChannelHandle = WTSVirtualChannelOpen(cliprdr->vcm, - WTS_CURRENT_SESSION, "cliprdr"); + CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*)context->handle; + cliprdr->ChannelHandle = WTSVirtualChannelOpen(cliprdr->vcm, WTS_CURRENT_SESSION, "cliprdr"); if (!cliprdr->ChannelHandle) { @@ -1169,8 +1204,8 @@ static UINT cliprdr_server_open(CliprdrServerContext* context) cliprdr->ChannelEvent = NULL; - if (WTSVirtualChannelQuery(cliprdr->ChannelHandle, WTSVirtualEventHandle, - &buffer, &BytesReturned)) + if (WTSVirtualChannelQuery(cliprdr->ChannelHandle, WTSVirtualEventHandle, &buffer, + &BytesReturned)) { if (BytesReturned != sizeof(HANDLE)) { @@ -1198,7 +1233,7 @@ static UINT cliprdr_server_open(CliprdrServerContext* context) */ static UINT cliprdr_server_close(CliprdrServerContext* context) { - CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; + CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*)context->handle; if (cliprdr->ChannelHandle) { @@ -1216,7 +1251,7 @@ static UINT cliprdr_server_close(CliprdrServerContext* context) */ static UINT cliprdr_server_start(CliprdrServerContext* context) { - CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; + CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*)context->handle; UINT error; if (!cliprdr->ChannelHandle) @@ -1234,7 +1269,7 @@ static UINT cliprdr_server_start(CliprdrServerContext* context) return ERROR_INTERNAL_ERROR; } - if (!(cliprdr->Thread = CreateThread(NULL, 0, cliprdr_server_thread, (void*) context, 0, NULL))) + if (!(cliprdr->Thread = CreateThread(NULL, 0, cliprdr_server_thread, (void*)context, 0, NULL))) { WLog_ERR(TAG, "CreateThread failed!"); CloseHandle(cliprdr->StopEvent); @@ -1253,7 +1288,7 @@ static UINT cliprdr_server_start(CliprdrServerContext* context) static UINT cliprdr_server_stop(CliprdrServerContext* context) { UINT error = CHANNEL_RC_OK; - CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; + CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*)context->handle; if (cliprdr->StopEvent) { @@ -1262,7 +1297,7 @@ static UINT cliprdr_server_stop(CliprdrServerContext* context) if (WaitForSingleObject(cliprdr->Thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", error); return error; } @@ -1278,7 +1313,7 @@ static UINT cliprdr_server_stop(CliprdrServerContext* context) static HANDLE cliprdr_server_get_event_handle(CliprdrServerContext* context) { - CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; + CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*)context->handle; return cliprdr->ChannelEvent; } @@ -1296,7 +1331,7 @@ CliprdrServerContext* cliprdr_server_context_new(HANDLE vcm) { CliprdrServerContext* context; CliprdrServerPrivate* cliprdr; - context = (CliprdrServerContext*) calloc(1, sizeof(CliprdrServerContext)); + context = (CliprdrServerContext*)calloc(1, sizeof(CliprdrServerContext)); if (context) { @@ -1317,8 +1352,7 @@ CliprdrServerContext* cliprdr_server_context_new(HANDLE vcm) context->ServerFormatDataResponse = cliprdr_server_format_data_response; context->ServerFileContentsRequest = cliprdr_server_file_contents_request; context->ServerFileContentsResponse = cliprdr_server_file_contents_response; - cliprdr = context->handle = (CliprdrServerPrivate*) calloc(1, - sizeof(CliprdrServerPrivate)); + cliprdr = context->handle = (CliprdrServerPrivate*)calloc(1, sizeof(CliprdrServerPrivate)); if (cliprdr) { @@ -1351,7 +1385,7 @@ void cliprdr_server_context_free(CliprdrServerContext* context) if (!context) return; - cliprdr = (CliprdrServerPrivate*) context->handle; + cliprdr = (CliprdrServerPrivate*)context->handle; if (cliprdr) { diff --git a/channels/cliprdr/server/cliprdr_main.h b/channels/cliprdr/server/cliprdr_main.h index 248f34109..fce0ddba5 100644 --- a/channels/cliprdr/server/cliprdr_main.h +++ b/channels/cliprdr/server/cliprdr_main.h @@ -30,7 +30,7 @@ #define TAG CHANNELS_TAG("cliprdr.server") -#define CLIPRDR_HEADER_LENGTH 8 +#define CLIPRDR_HEADER_LENGTH 8 struct _cliprdr_server_private { diff --git a/channels/disp/client/disp_main.c b/channels/disp/client/disp_main.c index 294d20de1..d3e9a22cf 100644 --- a/channels/disp/client/disp_main.c +++ b/channels/disp/client/disp_main.c @@ -81,7 +81,8 @@ typedef struct _DISP_PLUGIN DISP_PLUGIN; * @return 0 on success, otherwise a Win32 error code */ static UINT disp_send_display_control_monitor_layout_pdu(DISP_CHANNEL_CALLBACK* callback, - UINT32 NumMonitors, DISPLAY_CONTROL_MONITOR_LAYOUT* Monitors) + UINT32 NumMonitors, + DISPLAY_CONTROL_MONITOR_LAYOUT* Monitors) { UINT status; wStream* s; @@ -89,7 +90,7 @@ static UINT disp_send_display_control_monitor_layout_pdu(DISP_CHANNEL_CALLBACK* DISP_PLUGIN* disp; UINT32 MonitorLayoutSize; DISPLAY_CONTROL_HEADER header; - disp = (DISP_PLUGIN*) callback->plugin; + disp = (DISP_PLUGIN*)callback->plugin; MonitorLayoutSize = DISPLAY_CONTROL_MONITOR_LAYOUT_SIZE; header.length = 8 + 8 + (NumMonitors * MonitorLayoutSize); header.type = DISPLAY_CONTROL_PDU_TYPE_MONITOR_LAYOUT; @@ -104,7 +105,7 @@ static UINT disp_send_display_control_monitor_layout_pdu(DISP_CHANNEL_CALLBACK* if ((status = disp_write_header(s, &header))) { - WLog_ERR(TAG, "Failed to write header with error %"PRIu32"!", status); + WLog_ERR(TAG, "Failed to write header with error %" PRIu32 "!", status); goto out; } @@ -112,8 +113,9 @@ static UINT disp_send_display_control_monitor_layout_pdu(DISP_CHANNEL_CALLBACK* NumMonitors = disp->MaxNumMonitors; Stream_Write_UINT32(s, MonitorLayoutSize); /* MonitorLayoutSize (4 bytes) */ - Stream_Write_UINT32(s, NumMonitors); /* NumMonitors (4 bytes) */ - WLog_DBG(TAG, "disp_send_display_control_monitor_layout_pdu: NumMonitors=%"PRIu32"", NumMonitors); + Stream_Write_UINT32(s, NumMonitors); /* NumMonitors (4 bytes) */ + WLog_DBG(TAG, "disp_send_display_control_monitor_layout_pdu: NumMonitors=%" PRIu32 "", + NumMonitors); for (index = 0; index < NumMonitors; index++) { @@ -134,27 +136,32 @@ static UINT disp_send_display_control_monitor_layout_pdu(DISP_CHANNEL_CALLBACK* if (Monitors[index].Height > 8192) Monitors[index].Height = 8192; - Stream_Write_UINT32(s, Monitors[index].Flags); /* Flags (4 bytes) */ - Stream_Write_UINT32(s, Monitors[index].Left); /* Left (4 bytes) */ - Stream_Write_UINT32(s, Monitors[index].Top); /* Top (4 bytes) */ - Stream_Write_UINT32(s, Monitors[index].Width); /* Width (4 bytes) */ - Stream_Write_UINT32(s, Monitors[index].Height); /* Height (4 bytes) */ - Stream_Write_UINT32(s, Monitors[index].PhysicalWidth); /* PhysicalWidth (4 bytes) */ + Stream_Write_UINT32(s, Monitors[index].Flags); /* Flags (4 bytes) */ + Stream_Write_UINT32(s, Monitors[index].Left); /* Left (4 bytes) */ + Stream_Write_UINT32(s, Monitors[index].Top); /* Top (4 bytes) */ + Stream_Write_UINT32(s, Monitors[index].Width); /* Width (4 bytes) */ + Stream_Write_UINT32(s, Monitors[index].Height); /* Height (4 bytes) */ + Stream_Write_UINT32(s, Monitors[index].PhysicalWidth); /* PhysicalWidth (4 bytes) */ Stream_Write_UINT32(s, Monitors[index].PhysicalHeight); /* PhysicalHeight (4 bytes) */ - Stream_Write_UINT32(s, Monitors[index].Orientation); /* Orientation (4 bytes) */ - Stream_Write_UINT32(s, Monitors[index].DesktopScaleFactor); /* DesktopScaleFactor (4 bytes) */ + Stream_Write_UINT32(s, Monitors[index].Orientation); /* Orientation (4 bytes) */ + Stream_Write_UINT32(s, + Monitors[index].DesktopScaleFactor); /* DesktopScaleFactor (4 bytes) */ Stream_Write_UINT32(s, Monitors[index].DeviceScaleFactor); /* DeviceScaleFactor (4 bytes) */ WLog_DBG(TAG, - "\t%d : Flags: 0x%08"PRIX32" Left/Top: (%"PRId32",%"PRId32") W/H=%"PRIu32"x%"PRIu32")", index, - Monitors[index].Flags, Monitors[index].Left, Monitors[index].Top, Monitors[index].Width, - Monitors[index].Height); - WLog_DBG(TAG, "\t PhysicalWidth: %"PRIu32" PhysicalHeight: %"PRIu32" Orientation: %"PRIu32"", - Monitors[index].PhysicalWidth, Monitors[index].PhysicalHeight, Monitors[index].Orientation); + "\t%d : Flags: 0x%08" PRIX32 " Left/Top: (%" PRId32 ",%" PRId32 ") W/H=%" PRIu32 + "x%" PRIu32 ")", + index, Monitors[index].Flags, Monitors[index].Left, Monitors[index].Top, + Monitors[index].Width, Monitors[index].Height); + WLog_DBG(TAG, + "\t PhysicalWidth: %" PRIu32 " PhysicalHeight: %" PRIu32 " Orientation: %" PRIu32 + "", + Monitors[index].PhysicalWidth, Monitors[index].PhysicalHeight, + Monitors[index].Orientation); } out: Stream_SealLength(s); - status = callback->channel->Write(callback->channel, (UINT32) Stream_Length(s), Stream_Buffer(s), + status = callback->channel->Write(callback->channel, (UINT32)Stream_Length(s), Stream_Buffer(s), NULL); Stream_Free(s, TRUE); return status; @@ -170,7 +177,7 @@ static UINT disp_recv_display_control_caps_pdu(DISP_CHANNEL_CALLBACK* callback, DISP_PLUGIN* disp; DispClientContext* context; UINT ret = CHANNEL_RC_OK; - disp = (DISP_PLUGIN*) callback->plugin; + disp = (DISP_PLUGIN*)callback->plugin; context = (DispClientContext*)disp->iface.pInterface; if (Stream_GetRemainingLength(s) < 12) @@ -179,13 +186,13 @@ static UINT disp_recv_display_control_caps_pdu(DISP_CHANNEL_CALLBACK* callback, return ERROR_INVALID_DATA; } - Stream_Read_UINT32(s, disp->MaxNumMonitors); /* MaxNumMonitors (4 bytes) */ + Stream_Read_UINT32(s, disp->MaxNumMonitors); /* MaxNumMonitors (4 bytes) */ Stream_Read_UINT32(s, disp->MaxMonitorAreaFactorA); /* MaxMonitorAreaFactorA (4 bytes) */ Stream_Read_UINT32(s, disp->MaxMonitorAreaFactorB); /* MaxMonitorAreaFactorB (4 bytes) */ if (context->DisplayControlCaps) - ret = context->DisplayControlCaps(context, disp->MaxNumMonitors, disp->MaxMonitorAreaFactorA, - disp->MaxMonitorAreaFactorB); + ret = context->DisplayControlCaps(context, disp->MaxNumMonitors, + disp->MaxMonitorAreaFactorA, disp->MaxMonitorAreaFactorB); return ret; } @@ -208,7 +215,7 @@ static UINT disp_recv_pdu(DISP_CHANNEL_CALLBACK* callback, wStream* s) if ((error = disp_read_header(s, &header))) { - WLog_ERR(TAG, "disp_read_header failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "disp_read_header failed with error %" PRIu32 "!", error); return error; } @@ -224,7 +231,7 @@ static UINT disp_recv_pdu(DISP_CHANNEL_CALLBACK* callback, wStream* s) return disp_recv_display_control_caps_pdu(callback, s); default: - WLog_ERR(TAG, "Type %"PRIu32" not recognized!", header.type); + WLog_ERR(TAG, "Type %" PRIu32 " not recognized!", header.type); return ERROR_INTERNAL_ERROR; } } @@ -236,7 +243,7 @@ static UINT disp_recv_pdu(DISP_CHANNEL_CALLBACK* callback, wStream* s) */ static UINT disp_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream* data) { - DISP_CHANNEL_CALLBACK* callback = (DISP_CHANNEL_CALLBACK*) pChannelCallback; + DISP_CHANNEL_CALLBACK* callback = (DISP_CHANNEL_CALLBACK*)pChannelCallback; return disp_recv_pdu(callback, data); } @@ -257,12 +264,12 @@ static UINT disp_on_close(IWTSVirtualChannelCallback* pChannelCallback) * @return 0 on success, otherwise a Win32 error code */ static UINT disp_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, - IWTSVirtualChannel* pChannel, BYTE* Data, BOOL* pbAccept, - IWTSVirtualChannelCallback** ppCallback) + IWTSVirtualChannel* pChannel, BYTE* Data, BOOL* pbAccept, + IWTSVirtualChannelCallback** ppCallback) { DISP_CHANNEL_CALLBACK* callback; - DISP_LISTENER_CALLBACK* listener_callback = (DISP_LISTENER_CALLBACK*) pListenerCallback; - callback = (DISP_CHANNEL_CALLBACK*) calloc(1, sizeof(DISP_CHANNEL_CALLBACK)); + DISP_LISTENER_CALLBACK* listener_callback = (DISP_LISTENER_CALLBACK*)pListenerCallback; + callback = (DISP_CHANNEL_CALLBACK*)calloc(1, sizeof(DISP_CHANNEL_CALLBACK)); if (!callback) { @@ -276,7 +283,7 @@ static UINT disp_on_new_channel_connection(IWTSListenerCallback* pListenerCallba callback->channel_mgr = listener_callback->channel_mgr; callback->channel = pChannel; listener_callback->channel_callback = callback; - *ppCallback = (IWTSVirtualChannelCallback*) callback; + *ppCallback = (IWTSVirtualChannelCallback*)callback; return CHANNEL_RC_OK; } @@ -288,8 +295,8 @@ static UINT disp_on_new_channel_connection(IWTSListenerCallback* pListenerCallba static UINT disp_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) { UINT status; - DISP_PLUGIN* disp = (DISP_PLUGIN*) pPlugin; - disp->listener_callback = (DISP_LISTENER_CALLBACK*) calloc(1, sizeof(DISP_LISTENER_CALLBACK)); + DISP_PLUGIN* disp = (DISP_PLUGIN*)pPlugin; + disp->listener_callback = (DISP_LISTENER_CALLBACK*)calloc(1, sizeof(DISP_LISTENER_CALLBACK)); if (!disp->listener_callback) { @@ -301,7 +308,8 @@ static UINT disp_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManage disp->listener_callback->plugin = pPlugin; disp->listener_callback->channel_mgr = pChannelMgr; status = pChannelMgr->CreateListener(pChannelMgr, DISP_DVC_CHANNEL_NAME, 0, - (IWTSListenerCallback*) disp->listener_callback, &(disp->listener)); + (IWTSListenerCallback*)disp->listener_callback, + &(disp->listener)); disp->listener->pInterface = disp->iface.pInterface; return status; } @@ -313,7 +321,7 @@ static UINT disp_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManage */ static UINT disp_plugin_terminated(IWTSPlugin* pPlugin) { - DISP_PLUGIN* disp = (DISP_PLUGIN*) pPlugin; + DISP_PLUGIN* disp = (DISP_PLUGIN*)pPlugin; free(disp->listener_callback); free(disp->iface.pInterface); free(pPlugin); @@ -330,17 +338,17 @@ static UINT disp_plugin_terminated(IWTSPlugin* pPlugin) * @return 0 on success, otherwise a Win32 error code */ static UINT disp_send_monitor_layout(DispClientContext* context, UINT32 NumMonitors, - DISPLAY_CONTROL_MONITOR_LAYOUT* Monitors) + DISPLAY_CONTROL_MONITOR_LAYOUT* Monitors) { - DISP_PLUGIN* disp = (DISP_PLUGIN*) context->handle; + DISP_PLUGIN* disp = (DISP_PLUGIN*)context->handle; DISP_CHANNEL_CALLBACK* callback = disp->listener_callback->channel_callback; return disp_send_display_control_monitor_layout_pdu(callback, NumMonitors, Monitors); } #ifdef BUILTIN_CHANNELS -#define DVCPluginEntry disp_DVCPluginEntry +#define DVCPluginEntry disp_DVCPluginEntry #else -#define DVCPluginEntry FREERDP_API DVCPluginEntry +#define DVCPluginEntry FREERDP_API DVCPluginEntry #endif /** @@ -353,11 +361,11 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) UINT error = CHANNEL_RC_OK; DISP_PLUGIN* disp; DispClientContext* context; - disp = (DISP_PLUGIN*) pEntryPoints->GetPlugin(pEntryPoints, "disp"); + disp = (DISP_PLUGIN*)pEntryPoints->GetPlugin(pEntryPoints, "disp"); if (!disp) { - disp = (DISP_PLUGIN*) calloc(1, sizeof(DISP_PLUGIN)); + disp = (DISP_PLUGIN*)calloc(1, sizeof(DISP_PLUGIN)); if (!disp) { @@ -372,7 +380,7 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) disp->MaxNumMonitors = 16; disp->MaxMonitorAreaFactorA = 8192; disp->MaxMonitorAreaFactorB = 8192; - context = (DispClientContext*) calloc(1, sizeof(DispClientContext)); + context = (DispClientContext*)calloc(1, sizeof(DispClientContext)); if (!context) { @@ -381,10 +389,10 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) return CHANNEL_RC_NO_MEMORY; } - context->handle = (void*) disp; + context->handle = (void*)disp; context->SendMonitorLayout = disp_send_monitor_layout; - disp->iface.pInterface = (void*) context; - error = pEntryPoints->RegisterPlugin(pEntryPoints, "disp", (IWTSPlugin*) disp); + disp->iface.pInterface = (void*)context; + error = pEntryPoints->RegisterPlugin(pEntryPoints, "disp", (IWTSPlugin*)disp); } else { diff --git a/channels/disp/client/disp_main.h b/channels/disp/client/disp_main.h index 9d4f70251..45a483042 100644 --- a/channels/disp/client/disp_main.h +++ b/channels/disp/client/disp_main.h @@ -33,8 +33,6 @@ #include - #define TAG CHANNELS_TAG("disp.client") #endif /* FREERDP_CHANNEL_DISP_CLIENT_MAIN_H */ - diff --git a/channels/disp/server/disp_main.c b/channels/disp/server/disp_main.c index 8a632d015..06b263aa5 100644 --- a/channels/disp/server/disp_main.c +++ b/channels/disp/server/disp_main.c @@ -34,7 +34,6 @@ #include #include - #include #include "../disp_common.h" @@ -63,7 +62,7 @@ static wStream* disp_server_single_packet_new(UINT32 type, UINT32 length) if ((error = disp_write_header(s, &header))) { - WLog_ERR(TAG, "Failed to write header with error %"PRIu32"!", error); + WLog_ERR(TAG, "Failed to write header with error %" PRIu32 "!", error); goto error; } @@ -78,21 +77,21 @@ static BOOL disp_server_is_monitor_layout_valid(DISPLAY_CONTROL_MONITOR_LAYOUT* if (monitor->Width < DISPLAY_CONTROL_MIN_MONITOR_WIDTH || monitor->Width > DISPLAY_CONTROL_MAX_MONITOR_WIDTH) { - WLog_WARN(TAG, "Received invalid value for monitor->Width: %"PRIu32"", monitor->Width); + WLog_WARN(TAG, "Received invalid value for monitor->Width: %" PRIu32 "", monitor->Width); return FALSE; } if (monitor->Height < DISPLAY_CONTROL_MIN_MONITOR_HEIGHT || monitor->Height > DISPLAY_CONTROL_MAX_MONITOR_HEIGHT) { - WLog_WARN(TAG, "Received invalid value for monitor->Height: %"PRIu32"", monitor->Width); + WLog_WARN(TAG, "Received invalid value for monitor->Height: %" PRIu32 "", monitor->Width); return FALSE; } if (monitor->PhysicalWidth < DISPLAY_CONTROL_MIN_PHYSICAL_MONITOR_WIDTH || monitor->PhysicalWidth > DISPLAY_CONTROL_MAX_PHYSICAL_MONITOR_WIDTH) { - WLog_WARN(TAG, "Received invalid value for monitor->PhysicalWidth: %"PRIu32"", + WLog_WARN(TAG, "Received invalid value for monitor->PhysicalWidth: %" PRIu32 "", monitor->PhysicalWidth); return FALSE; } @@ -100,7 +99,8 @@ static BOOL disp_server_is_monitor_layout_valid(DISPLAY_CONTROL_MONITOR_LAYOUT* if (monitor->PhysicalHeight < DISPLAY_CONTROL_MIN_PHYSICAL_MONITOR_HEIGHT || monitor->PhysicalHeight > DISPLAY_CONTROL_MAX_PHYSICAL_MONITOR_HEIGHT) { - WLog_WARN(TAG, "Received invalid value for monitor->Height: %"PRIu32"", monitor->PhysicalHeight); + WLog_WARN(TAG, "Received invalid value for monitor->Height: %" PRIu32 "", + monitor->PhysicalHeight); return FALSE; } @@ -113,7 +113,7 @@ static BOOL disp_server_is_monitor_layout_valid(DISPLAY_CONTROL_MONITOR_LAYOUT* break; default: - WLog_WARN(TAG, "Received incorrect value for monitor->Orientation: %"PRIu32"", + WLog_WARN(TAG, "Received incorrect value for monitor->Orientation: %" PRIu32 "", monitor->Orientation); return FALSE; } @@ -138,8 +138,8 @@ static UINT disp_recv_display_control_monitor_layout_pdu(wStream* s, DispServerC if (pdu.MonitorLayoutSize != DISPLAY_CONTROL_MONITOR_LAYOUT_SIZE) { - WLog_ERR(TAG, "MonitorLayoutSize is set to %"PRIu32". expected %"PRIu32"", pdu.MonitorLayoutSize, - DISPLAY_CONTROL_MONITOR_LAYOUT_SIZE); + WLog_ERR(TAG, "MonitorLayoutSize is set to %" PRIu32 ". expected %" PRIu32 "", + pdu.MonitorLayoutSize, DISPLAY_CONTROL_MONITOR_LAYOUT_SIZE); return ERROR_INVALID_DATA; } @@ -147,8 +147,8 @@ static UINT disp_recv_display_control_monitor_layout_pdu(wStream* s, DispServerC if (pdu.NumMonitors > context->MaxNumMonitors) { - WLog_ERR(TAG, "NumMonitors (%"PRIu32")> server MaxNumMonitors (%"PRIu32")", pdu.NumMonitors, - context->MaxNumMonitors); + WLog_ERR(TAG, "NumMonitors (%" PRIu32 ")> server MaxNumMonitors (%" PRIu32 ")", + pdu.NumMonitors, context->MaxNumMonitors); return ERROR_INVALID_DATA; } @@ -158,8 +158,8 @@ static UINT disp_recv_display_control_monitor_layout_pdu(wStream* s, DispServerC return ERROR_INVALID_DATA; } - pdu.Monitors = (DISPLAY_CONTROL_MONITOR_LAYOUT*) calloc(pdu.NumMonitors, - sizeof(DISPLAY_CONTROL_MONITOR_LAYOUT)); + pdu.Monitors = (DISPLAY_CONTROL_MONITOR_LAYOUT*)calloc(pdu.NumMonitors, + sizeof(DISPLAY_CONTROL_MONITOR_LAYOUT)); if (!pdu.Monitors) { @@ -167,30 +167,31 @@ static UINT disp_recv_display_control_monitor_layout_pdu(wStream* s, DispServerC return CHANNEL_RC_NO_MEMORY; } - WLog_DBG(TAG, "disp_recv_display_control_monitor_layout_pdu: NumMonitors=%"PRIu32"", + WLog_DBG(TAG, "disp_recv_display_control_monitor_layout_pdu: NumMonitors=%" PRIu32 "", pdu.NumMonitors); for (index = 0; index < pdu.NumMonitors; index++) { monitor = &(pdu.Monitors[index]); - Stream_Read_UINT32(s, monitor->Flags); /* Flags (4 bytes) */ - Stream_Read_UINT32(s, monitor->Left); /* Left (4 bytes) */ - Stream_Read_UINT32(s, monitor->Top); /* Top (4 bytes) */ - Stream_Read_UINT32(s, monitor->Width); /* Width (4 bytes) */ - Stream_Read_UINT32(s, monitor->Height); /* Height (4 bytes) */ - Stream_Read_UINT32(s, monitor->PhysicalWidth); /* PhysicalWidth (4 bytes) */ - Stream_Read_UINT32(s, monitor->PhysicalHeight); /* PhysicalHeight (4 bytes) */ - Stream_Read_UINT32(s, monitor->Orientation); /* Orientation (4 bytes) */ + Stream_Read_UINT32(s, monitor->Flags); /* Flags (4 bytes) */ + Stream_Read_UINT32(s, monitor->Left); /* Left (4 bytes) */ + Stream_Read_UINT32(s, monitor->Top); /* Top (4 bytes) */ + Stream_Read_UINT32(s, monitor->Width); /* Width (4 bytes) */ + Stream_Read_UINT32(s, monitor->Height); /* Height (4 bytes) */ + Stream_Read_UINT32(s, monitor->PhysicalWidth); /* PhysicalWidth (4 bytes) */ + Stream_Read_UINT32(s, monitor->PhysicalHeight); /* PhysicalHeight (4 bytes) */ + Stream_Read_UINT32(s, monitor->Orientation); /* Orientation (4 bytes) */ Stream_Read_UINT32(s, monitor->DesktopScaleFactor); /* DesktopScaleFactor (4 bytes) */ - Stream_Read_UINT32(s, monitor->DeviceScaleFactor); /* DeviceScaleFactor (4 bytes) */ + Stream_Read_UINT32(s, monitor->DeviceScaleFactor); /* DeviceScaleFactor (4 bytes) */ WLog_DBG(TAG, - "\t%d : Flags: 0x%08"PRIX32" Left/Top: (%"PRId32",%"PRId32") W/H=%"PRIu32"x%"PRIu32")", index, - monitor->Flags, monitor->Left, monitor->Top, - monitor->Width, + "\t%d : Flags: 0x%08" PRIX32 " Left/Top: (%" PRId32 ",%" PRId32 ") W/H=%" PRIu32 + "x%" PRIu32 ")", + index, monitor->Flags, monitor->Left, monitor->Top, monitor->Width, monitor->Height); - WLog_DBG(TAG, "\t PhysicalWidth: %"PRIu32" PhysicalHeight: %"PRIu32" Orientation: %"PRIu32"", - monitor->PhysicalWidth, monitor->PhysicalHeight, - monitor->Orientation); + WLog_DBG(TAG, + "\t PhysicalWidth: %" PRIu32 " PhysicalHeight: %" PRIu32 " Orientation: %" PRIu32 + "", + monitor->PhysicalWidth, monitor->PhysicalHeight, monitor->Orientation); if (!disp_server_is_monitor_layout_valid(monitor)) { @@ -207,7 +208,6 @@ out: return error; } - static UINT disp_server_receive_pdu(DispServerContext* context, wStream* s) { UINT error = CHANNEL_RC_OK; @@ -217,7 +217,7 @@ static UINT disp_server_receive_pdu(DispServerContext* context, wStream* s) if ((error = disp_read_header(s, &header))) { - WLog_ERR(TAG, "disp_read_header failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "disp_read_header failed with error %" PRIu32 "!", error); return error; } @@ -225,14 +225,16 @@ static UINT disp_server_receive_pdu(DispServerContext* context, wStream* s) { case DISPLAY_CONTROL_PDU_TYPE_MONITOR_LAYOUT: if ((error = disp_recv_display_control_monitor_layout_pdu(s, context))) - WLog_ERR(TAG, "disp_recv_display_control_monitor_layout_pdu " - "failed with error %"PRIu32"!", error); + WLog_ERR(TAG, + "disp_recv_display_control_monitor_layout_pdu " + "failed with error %" PRIu32 "!", + error); break; default: error = CHANNEL_RC_BAD_PROC; - WLog_WARN(TAG, "Received unknown PDU type: %"PRIu32"", header.type); + WLog_WARN(TAG, "Received unknown PDU type: %" PRIu32 "", header.type); break; } @@ -240,8 +242,8 @@ static UINT disp_server_receive_pdu(DispServerContext* context, wStream* s) if (end != (beg + header.length)) { - WLog_ERR(TAG, "Unexpected DISP pdu end: Actual: %d, Expected: %"PRIu32"", - end, (beg + header.length)); + WLog_ERR(TAG, "Unexpected DISP pdu end: Actual: %d, Expected: %" PRIu32 "", end, + (beg + header.length)); Stream_SetPosition(s, (beg + header.length)); } @@ -259,9 +261,8 @@ static UINT disp_server_handle_messages(DispServerContext* context) /* Check whether the dynamic channel is ready */ if (!priv->isReady) { - if (WTSVirtualChannelQuery(priv->disp_channel, - WTSVirtualChannelReady, - &buffer, &BytesReturned) == FALSE) + if (WTSVirtualChannelQuery(priv->disp_channel, WTSVirtualChannelReady, &buffer, + &BytesReturned) == FALSE) { if (GetLastError() == ERROR_NO_DATA) return ERROR_NO_DATA; @@ -270,15 +271,14 @@ static UINT disp_server_handle_messages(DispServerContext* context) return ERROR_INTERNAL_ERROR; } - priv->isReady = *((BOOL*) buffer); + priv->isReady = *((BOOL*)buffer); WTSFreeMemory(buffer); } /* Consume channel event only after the gfx dynamic channel is ready */ Stream_SetPosition(s, 0); - if (!WTSVirtualChannelRead(priv->disp_channel, - 0, NULL, 0, &BytesReturned)) + if (!WTSVirtualChannelRead(priv->disp_channel, 0, NULL, 0, &BytesReturned)) { if (GetLastError() == ERROR_NO_DATA) return ERROR_NO_DATA; @@ -296,9 +296,8 @@ static UINT disp_server_handle_messages(DispServerContext* context) return CHANNEL_RC_NO_MEMORY; } - if (WTSVirtualChannelRead(priv->disp_channel, 0, - (PCHAR) Stream_Buffer(s), - Stream_Capacity(s), &BytesReturned) == FALSE) + if (WTSVirtualChannelRead(priv->disp_channel, 0, (PCHAR)Stream_Buffer(s), Stream_Capacity(s), + &BytesReturned) == FALSE) { WLog_ERR(TAG, "WTSVirtualChannelRead failed!"); return ERROR_INTERNAL_ERROR; @@ -311,8 +310,10 @@ static UINT disp_server_handle_messages(DispServerContext* context) { if ((ret = disp_server_receive_pdu(context, s))) { - WLog_ERR(TAG, "disp_server_receive_pdu " - "failed with error %"PRIu32"!", ret); + WLog_ERR(TAG, + "disp_server_receive_pdu " + "failed with error %" PRIu32 "!", + ret); return ret; } } @@ -322,7 +323,7 @@ static UINT disp_server_handle_messages(DispServerContext* context) static DWORD WINAPI disp_server_thread_func(LPVOID arg) { - DispServerContext* context = (DispServerContext*) arg; + DispServerContext* context = (DispServerContext*)arg; DispServerPrivate* priv = context->priv; DWORD status; DWORD nCount; @@ -340,7 +341,7 @@ static DWORD WINAPI disp_server_thread_func(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "", error); break; } @@ -350,8 +351,7 @@ static DWORD WINAPI disp_server_thread_func(LPVOID arg) if ((error = disp_server_handle_messages(context))) { - WLog_ERR(TAG, "disp_server_handle_messages failed with error %"PRIu32"", - error); + WLog_ERR(TAG, "disp_server_handle_messages failed with error %" PRIu32 "", error); break; } } @@ -360,7 +360,6 @@ static DWORD WINAPI disp_server_thread_func(LPVOID arg) return error; } - /** * Function description * @@ -376,19 +375,17 @@ static UINT disp_server_open(DispServerContext* context) buffer = NULL; priv->SessionId = WTS_CURRENT_SESSION; - if (WTSQuerySessionInformationA(context->vcm, WTS_CURRENT_SESSION, - WTSSessionId, (LPSTR*) &pSessionId, - &BytesReturned) == FALSE) + if (WTSQuerySessionInformationA(context->vcm, WTS_CURRENT_SESSION, WTSSessionId, + (LPSTR*)&pSessionId, &BytesReturned) == FALSE) { WLog_ERR(TAG, "WTSQuerySessionInformationA failed!"); rc = ERROR_INTERNAL_ERROR; goto out_close; } - priv->SessionId = (DWORD) * pSessionId; - priv->disp_channel = (HANDLE) WTSVirtualChannelOpenEx(priv->SessionId, - DISP_DVC_CHANNEL_NAME, - WTS_CHANNEL_OPTION_DYNAMIC); + priv->SessionId = (DWORD)*pSessionId; + priv->disp_channel = (HANDLE)WTSVirtualChannelOpenEx(priv->SessionId, DISP_DVC_CHANNEL_NAME, + WTS_CHANNEL_OPTION_DYNAMIC); if (!priv->disp_channel) { @@ -398,12 +395,13 @@ static UINT disp_server_open(DispServerContext* context) } /* Query for channel event handle */ - if (!WTSVirtualChannelQuery(priv->disp_channel, WTSVirtualEventHandle, - &buffer, &BytesReturned) - || (BytesReturned != sizeof(HANDLE))) + if (!WTSVirtualChannelQuery(priv->disp_channel, WTSVirtualEventHandle, &buffer, + &BytesReturned) || + (BytesReturned != sizeof(HANDLE))) { - WLog_ERR(TAG, "WTSVirtualChannelQuery failed " - "or invalid returned size(%"PRIu32")", + WLog_ERR(TAG, + "WTSVirtualChannelQuery failed " + "or invalid returned size(%" PRIu32 ")", BytesReturned); if (buffer) @@ -424,7 +422,8 @@ static UINT disp_server_open(DispServerContext* context) rc = ERROR_INTERNAL_ERROR; } - if (!(priv->thread = CreateThread(NULL, 0, disp_server_thread_func, (void*) context, 0, NULL))) + if (!(priv->thread = + CreateThread(NULL, 0, disp_server_thread_func, (void*)context, 0, NULL))) { WLog_ERR(TAG, "CreateEvent failed!"); CloseHandle(priv->stopEvent); @@ -446,8 +445,7 @@ static UINT disp_server_packet_send(DispServerContext* context, wStream* s) UINT ret; ULONG written; - if (!WTSVirtualChannelWrite(context->priv->disp_channel, - (PCHAR) Stream_Buffer(s), + if (!WTSVirtualChannelWrite(context->priv->disp_channel, (PCHAR)Stream_Buffer(s), Stream_GetPosition(s), &written)) { WLog_ERR(TAG, "WTSVirtualChannelWrite failed!"); @@ -457,8 +455,8 @@ static UINT disp_server_packet_send(DispServerContext* context, wStream* s) if (written < Stream_GetPosition(s)) { - WLog_WARN(TAG, "Unexpected bytes written: %"PRIu32"/%"PRIuz"", - written, Stream_GetPosition(s)); + WLog_WARN(TAG, "Unexpected bytes written: %" PRIu32 "/%" PRIuz "", written, + Stream_GetPosition(s)); } ret = CHANNEL_RC_OK; @@ -482,7 +480,7 @@ static UINT disp_server_send_caps_pdu(DispServerContext* context) return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT32(s, context->MaxNumMonitors); /* MaxNumMonitors (4 bytes) */ + Stream_Write_UINT32(s, context->MaxNumMonitors); /* MaxNumMonitors (4 bytes) */ Stream_Write_UINT32(s, context->MaxMonitorAreaFactorA); /* MaxMonitorAreaFactorA (4 bytes) */ Stream_Write_UINT32(s, context->MaxMonitorAreaFactorB); /* MaxMonitorAreaFactorB (4 bytes) */ return disp_server_packet_send(context, s); @@ -505,7 +503,7 @@ static UINT disp_server_close(DispServerContext* context) if (WaitForSingleObject(priv->thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", error); return error; } @@ -522,7 +520,7 @@ DispServerContext* disp_server_context_new(HANDLE vcm) { DispServerContext* context; DispServerPrivate* priv; - context = (DispServerContext*) calloc(1, sizeof(DispServerContext)); + context = (DispServerContext*)calloc(1, sizeof(DispServerContext)); if (!context) { @@ -530,7 +528,7 @@ DispServerContext* disp_server_context_new(HANDLE vcm) goto out_free; } - priv = context->priv = (DispServerPrivate*) calloc(1, sizeof(DispServerPrivate)); + priv = context->priv = (DispServerPrivate*)calloc(1, sizeof(DispServerPrivate)); if (!context->priv) { diff --git a/channels/drdynvc/client/drdynvc_main.c b/channels/drdynvc/client/drdynvc_main.c index dd08c9877..0d2a227b6 100644 --- a/channels/drdynvc/client/drdynvc_main.c +++ b/channels/drdynvc/client/drdynvc_main.c @@ -31,16 +31,15 @@ #define TAG CHANNELS_TAG("drdynvc.client") static void dvcman_channel_free(void* channel); -static UINT drdynvc_write_data(drdynvcPlugin* drdynvc, UINT32 ChannelId, - const BYTE* data, UINT32 dataSize); +static UINT drdynvc_write_data(drdynvcPlugin* drdynvc, UINT32 ChannelId, const BYTE* data, + UINT32 dataSize); /** * Function description * * @return 0 on success, otherwise a Win32 error code */ -static UINT dvcman_get_configuration(IWTSListener* pListener, - void** ppPropertyBag) +static UINT dvcman_get_configuration(IWTSListener* pListener, void** ppPropertyBag) { WINPR_UNUSED(pListener); *ppPropertyBag = NULL; @@ -54,15 +53,16 @@ static UINT dvcman_get_configuration(IWTSListener* pListener, */ static UINT dvcman_create_listener(IWTSVirtualChannelManager* pChannelMgr, const char* pszChannelName, ULONG ulFlags, - IWTSListenerCallback* pListenerCallback, IWTSListener** ppListener) + IWTSListenerCallback* pListenerCallback, + IWTSListener** ppListener) { - DVCMAN* dvcman = (DVCMAN*) pChannelMgr; + DVCMAN* dvcman = (DVCMAN*)pChannelMgr; DVCMAN_LISTENER* listener; if (dvcman->num_listeners < MAX_PLUGINS) { WLog_DBG(TAG, "create_listener: %d.%s.", dvcman->num_listeners, pszChannelName); - listener = (DVCMAN_LISTENER*) calloc(1, sizeof(DVCMAN_LISTENER)); + listener = (DVCMAN_LISTENER*)calloc(1, sizeof(DVCMAN_LISTENER)); if (!listener) { @@ -86,9 +86,9 @@ static UINT dvcman_create_listener(IWTSVirtualChannelManager* pChannelMgr, listener->listener_callback = pListenerCallback; if (ppListener) - *ppListener = (IWTSListener*) listener; + *ppListener = (IWTSListener*)listener; - dvcman->listeners[dvcman->num_listeners++] = (IWTSListener*) listener; + dvcman->listeners[dvcman->num_listeners++] = (IWTSListener*)listener; return CHANNEL_RC_OK; } else @@ -103,10 +103,10 @@ static UINT dvcman_create_listener(IWTSVirtualChannelManager* pChannelMgr, * * @return 0 on success, otherwise a Win32 error code */ -static UINT dvcman_register_plugin(IDRDYNVC_ENTRY_POINTS* pEntryPoints, - const char* name, IWTSPlugin* pPlugin) +static UINT dvcman_register_plugin(IDRDYNVC_ENTRY_POINTS* pEntryPoints, const char* name, + IWTSPlugin* pPlugin) { - DVCMAN* dvcman = ((DVCMAN_ENTRY_POINTS*) pEntryPoints)->dvcman; + DVCMAN* dvcman = ((DVCMAN_ENTRY_POINTS*)pEntryPoints)->dvcman; if (dvcman->num_plugins < MAX_PLUGINS) { @@ -117,22 +117,19 @@ static UINT dvcman_register_plugin(IDRDYNVC_ENTRY_POINTS* pEntryPoints, } else { - WLog_ERR(TAG, "register_plugin: Maximum DVC plugin number %u reached.", - MAX_PLUGINS); + WLog_ERR(TAG, "register_plugin: Maximum DVC plugin number %u reached.", MAX_PLUGINS); return ERROR_INTERNAL_ERROR; } } -static IWTSPlugin* dvcman_get_plugin(IDRDYNVC_ENTRY_POINTS* pEntryPoints, - const char* name) +static IWTSPlugin* dvcman_get_plugin(IDRDYNVC_ENTRY_POINTS* pEntryPoints, const char* name) { int i; - DVCMAN* dvcman = ((DVCMAN_ENTRY_POINTS*) pEntryPoints)->dvcman; + DVCMAN* dvcman = ((DVCMAN_ENTRY_POINTS*)pEntryPoints)->dvcman; for (i = 0; i < dvcman->num_plugins; i++) { - if (dvcman->plugin_names[i] == name || - strcmp(dvcman->plugin_names[i], name) == 0) + if (dvcman->plugin_names[i] == name || strcmp(dvcman->plugin_names[i], name) == 0) { return dvcman->plugins[i]; } @@ -143,30 +140,29 @@ static IWTSPlugin* dvcman_get_plugin(IDRDYNVC_ENTRY_POINTS* pEntryPoints, static ADDIN_ARGV* dvcman_get_plugin_data(IDRDYNVC_ENTRY_POINTS* pEntryPoints) { - return ((DVCMAN_ENTRY_POINTS*) pEntryPoints)->args; + return ((DVCMAN_ENTRY_POINTS*)pEntryPoints)->args; } static void* dvcman_get_rdp_settings(IDRDYNVC_ENTRY_POINTS* pEntryPoints) { - return (void*)((DVCMAN_ENTRY_POINTS*) pEntryPoints)->settings; + return (void*)((DVCMAN_ENTRY_POINTS*)pEntryPoints)->settings; } static UINT32 dvcman_get_channel_id(IWTSVirtualChannel* channel) { - return ((DVCMAN_CHANNEL*) channel)->channel_id; + return ((DVCMAN_CHANNEL*)channel)->channel_id; } -static IWTSVirtualChannel* dvcman_find_channel_by_id(IWTSVirtualChannelManager* - pChannelMgr, - UINT32 ChannelId) +static IWTSVirtualChannel* dvcman_find_channel_by_id(IWTSVirtualChannelManager* pChannelMgr, + UINT32 ChannelId) { int index; BOOL found = FALSE; DVCMAN_CHANNEL* channel; - DVCMAN* dvcman = (DVCMAN*) pChannelMgr; + DVCMAN* dvcman = (DVCMAN*)pChannelMgr; ArrayList_Lock(dvcman->channels); index = 0; - channel = (DVCMAN_CHANNEL*) ArrayList_GetItem(dvcman->channels, index++); + channel = (DVCMAN_CHANNEL*)ArrayList_GetItem(dvcman->channels, index++); while (channel) { @@ -176,17 +172,17 @@ static IWTSVirtualChannel* dvcman_find_channel_by_id(IWTSVirtualChannelManager* break; } - channel = (DVCMAN_CHANNEL*) ArrayList_GetItem(dvcman->channels, index++); + channel = (DVCMAN_CHANNEL*)ArrayList_GetItem(dvcman->channels, index++); } ArrayList_Unlock(dvcman->channels); - return (found) ? ((IWTSVirtualChannel*) channel) : NULL; + return (found) ? ((IWTSVirtualChannel*)channel) : NULL; } static IWTSVirtualChannelManager* dvcman_new(drdynvcPlugin* plugin) { DVCMAN* dvcman; - dvcman = (DVCMAN*) calloc(1, sizeof(DVCMAN)); + dvcman = (DVCMAN*)calloc(1, sizeof(DVCMAN)); if (!dvcman) { @@ -218,7 +214,7 @@ static IWTSVirtualChannelManager* dvcman_new(drdynvcPlugin* plugin) return NULL; } - return (IWTSVirtualChannelManager*) dvcman; + return (IWTSVirtualChannelManager*)dvcman; } /** @@ -226,17 +222,14 @@ static IWTSVirtualChannelManager* dvcman_new(drdynvcPlugin* plugin) * * @return 0 on success, otherwise a Win32 error code */ -static UINT dvcman_load_addin(drdynvcPlugin* drdynvc, - IWTSVirtualChannelManager* pChannelMgr, - ADDIN_ARGV* args, - rdpSettings* settings) +static UINT dvcman_load_addin(drdynvcPlugin* drdynvc, IWTSVirtualChannelManager* pChannelMgr, + ADDIN_ARGV* args, rdpSettings* settings) { DVCMAN_ENTRY_POINTS entryPoints; PDVC_PLUGIN_ENTRY pDVCPluginEntry = NULL; WLog_Print(drdynvc->log, WLOG_INFO, "Loading Dynamic Virtual Channel %s", args->argv[0]); - pDVCPluginEntry = (PDVC_PLUGIN_ENTRY) freerdp_load_channel_addin_entry( - args->argv[0], - NULL, NULL, FREERDP_ADDIN_CHANNEL_DYNAMIC); + pDVCPluginEntry = (PDVC_PLUGIN_ENTRY)freerdp_load_channel_addin_entry( + args->argv[0], NULL, NULL, FREERDP_ADDIN_CHANNEL_DYNAMIC); if (pDVCPluginEntry) { @@ -244,30 +237,30 @@ static UINT dvcman_load_addin(drdynvcPlugin* drdynvc, entryPoints.iface.GetPlugin = dvcman_get_plugin; entryPoints.iface.GetPluginData = dvcman_get_plugin_data; entryPoints.iface.GetRdpSettings = dvcman_get_rdp_settings; - entryPoints.dvcman = (DVCMAN*) pChannelMgr; + entryPoints.dvcman = (DVCMAN*)pChannelMgr; entryPoints.args = args; entryPoints.settings = settings; - return pDVCPluginEntry((IDRDYNVC_ENTRY_POINTS*) &entryPoints); + return pDVCPluginEntry((IDRDYNVC_ENTRY_POINTS*)&entryPoints); } return ERROR_INVALID_FUNCTION; } static DVCMAN_CHANNEL* dvcman_channel_new(drdynvcPlugin* drdynvc, - IWTSVirtualChannelManager* pChannelMgr, - UINT32 ChannelId, const char* ChannelName) + IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId, + const char* ChannelName) { DVCMAN_CHANNEL* channel; if (dvcman_find_channel_by_id(pChannelMgr, ChannelId)) { - WLog_Print(drdynvc->log, WLOG_ERROR, "Protocol error: Duplicated ChannelId %"PRIu32" (%s)!", - ChannelId, + WLog_Print(drdynvc->log, WLOG_ERROR, + "Protocol error: Duplicated ChannelId %" PRIu32 " (%s)!", ChannelId, ChannelName); return NULL; } - channel = (DVCMAN_CHANNEL*) calloc(1, sizeof(DVCMAN_CHANNEL)); + channel = (DVCMAN_CHANNEL*)calloc(1, sizeof(DVCMAN_CHANNEL)); if (!channel) { @@ -275,7 +268,7 @@ static DVCMAN_CHANNEL* dvcman_channel_new(drdynvcPlugin* drdynvc, return NULL; } - channel->dvcman = (DVCMAN*) pChannelMgr; + channel->dvcman = (DVCMAN*)pChannelMgr; channel->channel_id = ChannelId; channel->channel_name = _strdup(ChannelName); @@ -299,20 +292,19 @@ static DVCMAN_CHANNEL* dvcman_channel_new(drdynvcPlugin* drdynvc, static void dvcman_channel_free(void* arg) { - DVCMAN_CHANNEL* channel = (DVCMAN_CHANNEL*) arg; + DVCMAN_CHANNEL* channel = (DVCMAN_CHANNEL*)arg; UINT error = CHANNEL_RC_OK; if (channel) { if (channel->channel_callback) { - IFCALL(channel->channel_callback->OnClose, - channel->channel_callback); + IFCALL(channel->channel_callback->OnClose, channel->channel_callback); } if (channel->status == CHANNEL_RC_OK) { - IWTSVirtualChannel* ichannel = (IWTSVirtualChannel*) channel; + IWTSVirtualChannel* ichannel = (IWTSVirtualChannel*)channel; if (channel->dvcman && channel->dvcman->drdynvc) { @@ -320,8 +312,7 @@ static void dvcman_channel_free(void* arg) if (context) { - IFCALLRET(context->OnChannelDisconnected, error, - context, channel->channel_name, + IFCALLRET(context->OnChannelDisconnected, error, context, channel->channel_name, channel->pInterface); } } @@ -329,7 +320,7 @@ static void dvcman_channel_free(void* arg) error = IFCALLRESULT(CHANNEL_RC_OK, ichannel->Close, ichannel); if (error != CHANNEL_RC_OK) - WLog_ERR(TAG, "Close failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "Close failed with error %" PRIu32 "!", error); } if (channel->dvc_data) @@ -347,13 +338,13 @@ static void dvcman_free(drdynvcPlugin* drdynvc, IWTSVirtualChannelManager* pChan int i; IWTSPlugin* pPlugin; DVCMAN_LISTENER* listener; - DVCMAN* dvcman = (DVCMAN*) pChannelMgr; + DVCMAN* dvcman = (DVCMAN*)pChannelMgr; UINT error; ArrayList_Free(dvcman->channels); for (i = 0; i < dvcman->num_listeners; i++) { - listener = (DVCMAN_LISTENER*) dvcman->listeners[i]; + listener = (DVCMAN_LISTENER*)dvcman->listeners[i]; free(listener->channel_name); free(listener); } @@ -366,7 +357,8 @@ static void dvcman_free(drdynvcPlugin* drdynvc, IWTSVirtualChannelManager* pChan if (pPlugin->Terminated) if ((error = pPlugin->Terminated(pPlugin))) - WLog_Print(drdynvc->log, WLOG_ERROR, "Terminated failed with error %"PRIu32"!", error); + WLog_Print(drdynvc->log, WLOG_ERROR, "Terminated failed with error %" PRIu32 "!", + error); } dvcman->num_plugins = 0; @@ -383,7 +375,7 @@ static UINT dvcman_init(drdynvcPlugin* drdynvc, IWTSVirtualChannelManager* pChan { int i; IWTSPlugin* pPlugin; - DVCMAN* dvcman = (DVCMAN*) pChannelMgr; + DVCMAN* dvcman = (DVCMAN*)pChannelMgr; UINT error; for (i = 0; i < dvcman->num_plugins; i++) @@ -393,7 +385,8 @@ static UINT dvcman_init(drdynvcPlugin* drdynvc, IWTSVirtualChannelManager* pChan if (pPlugin->Initialize) if ((error = pPlugin->Initialize(pPlugin, pChannelMgr))) { - WLog_Print(drdynvc->log, WLOG_ERROR, "Initialize failed with error %"PRIu32"!", error); + WLog_Print(drdynvc->log, WLOG_ERROR, "Initialize failed with error %" PRIu32 "!", + error); return error; } } @@ -406,19 +399,18 @@ static UINT dvcman_init(drdynvcPlugin* drdynvc, IWTSVirtualChannelManager* pChan * * @return 0 on success, otherwise a Win32 error code */ -static UINT dvcman_write_channel(IWTSVirtualChannel* pChannel, ULONG cbSize, - const BYTE* pBuffer, void* pReserved) +static UINT dvcman_write_channel(IWTSVirtualChannel* pChannel, ULONG cbSize, const BYTE* pBuffer, + void* pReserved) { UINT status; - DVCMAN_CHANNEL* channel = (DVCMAN_CHANNEL*) pChannel; + DVCMAN_CHANNEL* channel = (DVCMAN_CHANNEL*)pChannel; WINPR_UNUSED(pReserved); if (!channel || !channel->dvcman) return CHANNEL_RC_BAD_CHANNEL; EnterCriticalSection(&(channel->lock)); - status = drdynvc_write_data(channel->dvcman->drdynvc, - channel->channel_id, pBuffer, cbSize); + status = drdynvc_write_data(channel->dvcman->drdynvc, channel->channel_id, pBuffer, cbSize); LeaveCriticalSection(&(channel->lock)); return status; } @@ -430,12 +422,12 @@ static UINT dvcman_write_channel(IWTSVirtualChannel* pChannel, ULONG cbSize, */ static UINT dvcman_close_channel_iface(IWTSVirtualChannel* pChannel) { - DVCMAN_CHANNEL* channel = (DVCMAN_CHANNEL*) pChannel; + DVCMAN_CHANNEL* channel = (DVCMAN_CHANNEL*)pChannel; if (!channel) return CHANNEL_RC_BAD_CHANNEL; - WLog_DBG(TAG, "close_channel_iface: id=%"PRIu32"", channel->channel_id); + WLog_DBG(TAG, "close_channel_iface: id=%" PRIu32 "", channel->channel_id); return CHANNEL_RC_OK; } @@ -444,8 +436,7 @@ static UINT dvcman_close_channel_iface(IWTSVirtualChannel* pChannel) * * @return 0 on success, otherwise a Win32 error code */ -static UINT dvcman_create_channel(drdynvcPlugin* drdynvc, - IWTSVirtualChannelManager* pChannelMgr, +static UINT dvcman_create_channel(drdynvcPlugin* drdynvc, IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId, const char* ChannelName) { int i; @@ -454,7 +445,7 @@ static UINT dvcman_create_channel(drdynvcPlugin* drdynvc, DVCMAN_CHANNEL* channel; DrdynvcClientContext* context; IWTSVirtualChannelCallback* pCallback; - DVCMAN* dvcman = (DVCMAN*) pChannelMgr; + DVCMAN* dvcman = (DVCMAN*)pChannelMgr; UINT error; if (!(channel = dvcman_channel_new(drdynvc, pChannelMgr, ChannelId, ChannelName))) @@ -468,7 +459,7 @@ static UINT dvcman_create_channel(drdynvcPlugin* drdynvc, for (i = 0; i < dvcman->num_listeners; i++) { - listener = (DVCMAN_LISTENER*) dvcman->listeners[i]; + listener = (DVCMAN_LISTENER*)dvcman->listeners[i]; if (strcmp(listener->channel_name, ChannelName) == 0) { @@ -478,11 +469,11 @@ static UINT dvcman_create_channel(drdynvcPlugin* drdynvc, pCallback = NULL; if ((error = listener->listener_callback->OnNewChannelConnection( - listener->listener_callback, - (IWTSVirtualChannel*) channel, NULL, &bAccept, &pCallback)) == CHANNEL_RC_OK - && bAccept) + listener->listener_callback, (IWTSVirtualChannel*)channel, NULL, &bAccept, + &pCallback)) == CHANNEL_RC_OK && + bAccept) { - WLog_Print(drdynvc->log, WLOG_DEBUG, "listener %s created new channel %"PRIu32"", + WLog_Print(drdynvc->log, WLOG_DEBUG, "listener %s created new channel %" PRIu32 "", listener->channel_name, channel->channel_id); channel->status = CHANNEL_RC_OK; channel->channel_callback = pCallback; @@ -492,8 +483,8 @@ static UINT dvcman_create_channel(drdynvcPlugin* drdynvc, listener->iface.pInterface); if (error) - WLog_Print(drdynvc->log, WLOG_ERROR, "context.OnChannelConnected failed with error %"PRIu32"", - error); + WLog_Print(drdynvc->log, WLOG_ERROR, + "context.OnChannelConnected failed with error %" PRIu32 "", error); return error; } @@ -501,12 +492,14 @@ static UINT dvcman_create_channel(drdynvcPlugin* drdynvc, { if (error) { - WLog_Print(drdynvc->log, WLOG_ERROR, "OnNewChannelConnection failed with error %"PRIu32"!", error); + WLog_Print(drdynvc->log, WLOG_ERROR, + "OnNewChannelConnection failed with error %" PRIu32 "!", error); return error; } else { - WLog_Print(drdynvc->log, WLOG_ERROR, "OnNewChannelConnection returned with bAccept FALSE!"); + WLog_Print(drdynvc->log, WLOG_ERROR, + "OnNewChannelConnection returned with bAccept FALSE!"); return ERROR_INTERNAL_ERROR; } } @@ -521,18 +514,17 @@ static UINT dvcman_create_channel(drdynvcPlugin* drdynvc, * * @return 0 on success, otherwise a Win32 error code */ -static UINT dvcman_open_channel(drdynvcPlugin* drdynvc, - IWTSVirtualChannelManager* pChannelMgr, +static UINT dvcman_open_channel(drdynvcPlugin* drdynvc, IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId) { DVCMAN_CHANNEL* channel; IWTSVirtualChannelCallback* pCallback; UINT error; - channel = (DVCMAN_CHANNEL*) dvcman_find_channel_by_id(pChannelMgr, ChannelId); + channel = (DVCMAN_CHANNEL*)dvcman_find_channel_by_id(pChannelMgr, ChannelId); if (!channel) { - WLog_Print(drdynvc->log, WLOG_ERROR, "ChannelId %"PRIu32" not found!", ChannelId); + WLog_Print(drdynvc->log, WLOG_ERROR, "ChannelId %" PRIu32 " not found!", ChannelId); return ERROR_INTERNAL_ERROR; } @@ -542,11 +534,11 @@ static UINT dvcman_open_channel(drdynvcPlugin* drdynvc, if ((pCallback->OnOpen) && (error = pCallback->OnOpen(pCallback))) { - WLog_Print(drdynvc->log, WLOG_ERROR, "OnOpen failed with error %"PRIu32"!", error); + WLog_Print(drdynvc->log, WLOG_ERROR, "OnOpen failed with error %" PRIu32 "!", error); return error; } - WLog_Print(drdynvc->log, WLOG_DEBUG, "open_channel: ChannelId %"PRIu32"", ChannelId); + WLog_Print(drdynvc->log, WLOG_DEBUG, "open_channel: ChannelId %" PRIu32 "", ChannelId); } return CHANNEL_RC_OK; @@ -557,20 +549,19 @@ static UINT dvcman_open_channel(drdynvcPlugin* drdynvc, * * @return 0 on success, otherwise a Win32 error code */ -static UINT dvcman_close_channel(IWTSVirtualChannelManager* pChannelMgr, - UINT32 ChannelId) +static UINT dvcman_close_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId) { DVCMAN_CHANNEL* channel; UINT error = CHANNEL_RC_OK; - DVCMAN* dvcman = (DVCMAN*) pChannelMgr; - channel = (DVCMAN_CHANNEL*) dvcman_find_channel_by_id(pChannelMgr, ChannelId); + DVCMAN* dvcman = (DVCMAN*)pChannelMgr; + channel = (DVCMAN_CHANNEL*)dvcman_find_channel_by_id(pChannelMgr, ChannelId); if (!channel) { - //WLog_Print(drdynvc->log, WLOG_ERROR, "ChannelId %"PRIu32" not found!", ChannelId); + // WLog_Print(drdynvc->log, WLOG_ERROR, "ChannelId %"PRIu32" not found!", ChannelId); /** - * Windows 8 / Windows Server 2012 send close requests for channels that failed to be created. - * Do not warn, simply return success here. + * Windows 8 / Windows Server 2012 send close requests for channels that failed to be + * created. Do not warn, simply return success here. */ return CHANNEL_RC_OK; } @@ -585,19 +576,20 @@ static UINT dvcman_close_channel(IWTSVirtualChannelManager* pChannelMgr, * @return 0 on success, otherwise a Win32 error code */ static UINT dvcman_receive_channel_data_first(drdynvcPlugin* drdynvc, - IWTSVirtualChannelManager* pChannelMgr, - UINT32 ChannelId, UINT32 length) + IWTSVirtualChannelManager* pChannelMgr, + UINT32 ChannelId, UINT32 length) { DVCMAN_CHANNEL* channel; - channel = (DVCMAN_CHANNEL*) dvcman_find_channel_by_id(pChannelMgr, ChannelId); + channel = (DVCMAN_CHANNEL*)dvcman_find_channel_by_id(pChannelMgr, ChannelId); if (!channel) { /** - * Windows Server 2012 R2 can send some messages over Microsoft::Windows::RDS::Geometry::v08.01 - * even if the dynamic virtual channel wasn't registered on our side. Ignoring it works. + * Windows Server 2012 R2 can send some messages over + * Microsoft::Windows::RDS::Geometry::v08.01 even if the dynamic virtual channel wasn't + * registered on our side. Ignoring it works. */ - WLog_Print(drdynvc->log, WLOG_ERROR, "ChannelId %"PRIu32" not found!", ChannelId); + WLog_Print(drdynvc->log, WLOG_ERROR, "ChannelId %" PRIu32 " not found!", ChannelId); return CHANNEL_RC_OK; } @@ -622,19 +614,19 @@ static UINT dvcman_receive_channel_data_first(drdynvcPlugin* drdynvc, * @return 0 on success, otherwise a Win32 error code */ static UINT dvcman_receive_channel_data(drdynvcPlugin* drdynvc, - IWTSVirtualChannelManager* pChannelMgr, - UINT32 ChannelId, wStream* data) + IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId, + wStream* data) { UINT status = CHANNEL_RC_OK; DVCMAN_CHANNEL* channel; size_t dataSize = Stream_GetRemainingLength(data); - channel = (DVCMAN_CHANNEL*) dvcman_find_channel_by_id(pChannelMgr, ChannelId); + channel = (DVCMAN_CHANNEL*)dvcman_find_channel_by_id(pChannelMgr, ChannelId); if (!channel) { /* Windows 8.1 tries to open channels not created. - * Ignore cases like this. */ - WLog_Print(drdynvc->log, WLOG_ERROR, "ChannelId %"PRIu32" not found!", ChannelId); + * Ignore cases like this. */ + WLog_Print(drdynvc->log, WLOG_ERROR, "ChannelId %" PRIu32 " not found!", ChannelId); return CHANNEL_RC_OK; } @@ -656,15 +648,14 @@ static UINT dvcman_receive_channel_data(drdynvcPlugin* drdynvc, Stream_SealLength(channel->dvc_data); Stream_SetPosition(channel->dvc_data, 0); status = channel->channel_callback->OnDataReceived(channel->channel_callback, - channel->dvc_data); + channel->dvc_data); Stream_Release(channel->dvc_data); channel->dvc_data = NULL; } } else { - status = channel->channel_callback->OnDataReceived(channel->channel_callback, - data); + status = channel->channel_callback->OnDataReceived(channel->channel_callback, data); } return status; @@ -706,8 +697,9 @@ static UINT drdynvc_send(drdynvcPlugin* drdynvc, wStream* s) status = CHANNEL_RC_BAD_CHANNEL_HANDLE; else { - status = drdynvc->channelEntryPoints.pVirtualChannelWriteEx(drdynvc->InitHandle, - drdynvc->OpenHandle, Stream_Buffer(s), (UINT32) Stream_GetPosition(s), s); + status = drdynvc->channelEntryPoints.pVirtualChannelWriteEx( + drdynvc->InitHandle, drdynvc->OpenHandle, Stream_Buffer(s), + (UINT32)Stream_GetPosition(s), s); } switch (status) @@ -726,9 +718,9 @@ static UINT drdynvc_send(drdynvcPlugin* drdynvc, wStream* s) default: Stream_Free(s, TRUE); - WLog_Print(drdynvc->log, WLOG_ERROR, "VirtualChannelWriteEx failed with %s [%08"PRIX32"]", - WTSErrorToString(status), - status); + WLog_Print(drdynvc->log, WLOG_ERROR, + "VirtualChannelWriteEx failed with %s [%08" PRIX32 "]", + WTSErrorToString(status), status); return status; } } @@ -738,8 +730,8 @@ static UINT drdynvc_send(drdynvcPlugin* drdynvc, wStream* s) * * @return 0 on success, otherwise a Win32 error code */ -static UINT drdynvc_write_data(drdynvcPlugin* drdynvc, UINT32 ChannelId, - const BYTE* data, UINT32 dataSize) +static UINT drdynvc_write_data(drdynvcPlugin* drdynvc, UINT32 ChannelId, const BYTE* data, + UINT32 dataSize) { wStream* data_out; size_t pos; @@ -751,8 +743,8 @@ static UINT drdynvc_write_data(drdynvcPlugin* drdynvc, UINT32 ChannelId, if (!drdynvc) return CHANNEL_RC_BAD_CHANNEL_HANDLE; - WLog_Print(drdynvc->log, WLOG_DEBUG, "write_data: ChannelId=%"PRIu32" size=%"PRIu32"", ChannelId, - dataSize); + WLog_Print(drdynvc->log, WLOG_DEBUG, "write_data: ChannelId=%" PRIu32 " size=%" PRIu32 "", + ChannelId, dataSize); data_out = Stream_New(NULL, CHANNEL_CHUNK_LENGTH); if (!data_out) @@ -827,7 +819,7 @@ static UINT drdynvc_write_data(drdynvcPlugin* drdynvc, UINT32 ChannelId, if (status != CHANNEL_RC_OK) { - WLog_Print(drdynvc->log, WLOG_ERROR, "VirtualChannelWriteEx failed with %s [%08"PRIX32"]", + WLog_Print(drdynvc->log, WLOG_ERROR, "VirtualChannelWriteEx failed with %s [%08" PRIX32 "]", WTSErrorToString(status), status); return status; } @@ -857,14 +849,13 @@ static UINT drdynvc_send_capability_response(drdynvcPlugin* drdynvc) return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT16(s, - 0x0050); /* Cmd+Sp+cbChId+Pad. Note: MSTSC sends 0x005c */ + Stream_Write_UINT16(s, 0x0050); /* Cmd+Sp+cbChId+Pad. Note: MSTSC sends 0x005c */ Stream_Write_UINT16(s, drdynvc->version); status = drdynvc_send(drdynvc, s); if (status != CHANNEL_RC_OK) { - WLog_Print(drdynvc->log, WLOG_ERROR, "VirtualChannelWriteEx failed with %s [%08"PRIX32"]", + WLog_Print(drdynvc->log, WLOG_ERROR, "VirtualChannelWriteEx failed with %s [%08" PRIX32 "]", WTSErrorToString(status), status); } @@ -876,8 +867,8 @@ static UINT drdynvc_send_capability_response(drdynvcPlugin* drdynvc) * * @return 0 on success, otherwise a Win32 error code */ -static UINT drdynvc_process_capability_request(drdynvcPlugin* drdynvc, int Sp, - int cbChId, wStream* s) +static UINT drdynvc_process_capability_request(drdynvcPlugin* drdynvc, int Sp, int cbChId, + wStream* s) { UINT status; @@ -952,8 +943,7 @@ static UINT32 drdynvc_read_variable_uint(wStream* s, int cbLen) * * @return 0 on success, otherwise a Win32 error code */ -static UINT drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, - int cbChId, wStream* s) +static UINT drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) { size_t pos; UINT status; @@ -996,8 +986,8 @@ static UINT drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, if (strnlen(name, length) >= length) return ERROR_INVALID_DATA; - WLog_Print(drdynvc->log, WLOG_DEBUG, "process_create_request: ChannelId=%"PRIu32" ChannelName=%s", - ChannelId, name); + WLog_Print(drdynvc->log, WLOG_DEBUG, + "process_create_request: ChannelId=%" PRIu32 " ChannelName=%s", ChannelId, name); channel_status = dvcman_create_channel(drdynvc, drdynvc->channel_mgr, ChannelId, name); data_out = Stream_New(NULL, pos + 4); @@ -1026,7 +1016,7 @@ static UINT drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, if (status != CHANNEL_RC_OK) { - WLog_Print(drdynvc->log, WLOG_ERROR, "VirtualChannelWriteEx failed with %s [%08"PRIX32"]", + WLog_Print(drdynvc->log, WLOG_ERROR, "VirtualChannelWriteEx failed with %s [%08" PRIX32 "]", WTSErrorToString(status), status); return status; } @@ -1035,14 +1025,16 @@ static UINT drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, { if ((status = dvcman_open_channel(drdynvc, drdynvc->channel_mgr, ChannelId))) { - WLog_Print(drdynvc->log, WLOG_ERROR, "dvcman_open_channel failed with error %"PRIu32"!", status); + WLog_Print(drdynvc->log, WLOG_ERROR, + "dvcman_open_channel failed with error %" PRIu32 "!", status); return status; } } else { if ((status = dvcman_close_channel(drdynvc->channel_mgr, ChannelId))) - WLog_Print(drdynvc->log, WLOG_ERROR, "dvcman_close_channel failed with error %"PRIu32"!", status); + WLog_Print(drdynvc->log, WLOG_ERROR, + "dvcman_close_channel failed with error %" PRIu32 "!", status); } return status; @@ -1053,8 +1045,7 @@ static UINT drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, * * @return 0 on success, otherwise a Win32 error code */ -static UINT drdynvc_process_data_first(drdynvcPlugin* drdynvc, int Sp, - int cbChId, wStream* s) +static UINT drdynvc_process_data_first(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) { UINT status; UINT32 Length; @@ -1066,10 +1057,9 @@ static UINT drdynvc_process_data_first(drdynvcPlugin* drdynvc, int Sp, ChannelId = drdynvc_read_variable_uint(s, cbChId); Length = drdynvc_read_variable_uint(s, Sp); WLog_Print(drdynvc->log, WLOG_DEBUG, - "process_data_first: Sp=%d cbChId=%d, ChannelId=%"PRIu32" Length=%"PRIu32"", Sp, + "process_data_first: Sp=%d cbChId=%d, ChannelId=%" PRIu32 " Length=%" PRIu32 "", Sp, cbChId, ChannelId, Length); - status = dvcman_receive_channel_data_first(drdynvc, drdynvc->channel_mgr, ChannelId, - Length); + status = dvcman_receive_channel_data_first(drdynvc, drdynvc->channel_mgr, ChannelId, Length); if (status) return status; @@ -1082,8 +1072,7 @@ static UINT drdynvc_process_data_first(drdynvcPlugin* drdynvc, int Sp, * * @return 0 on success, otherwise a Win32 error code */ -static UINT drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChId, - wStream* s) +static UINT drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) { UINT32 ChannelId; @@ -1091,9 +1080,8 @@ static UINT drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChId, return ERROR_INVALID_DATA; ChannelId = drdynvc_read_variable_uint(s, cbChId); - WLog_Print(drdynvc->log, WLOG_TRACE, "process_data: Sp=%d cbChId=%d, ChannelId=%"PRIu32"", Sp, - cbChId, - ChannelId); + WLog_Print(drdynvc->log, WLOG_TRACE, "process_data: Sp=%d cbChId=%d, ChannelId=%" PRIu32 "", Sp, + cbChId, ChannelId); return dvcman_receive_channel_data(drdynvc, drdynvc->channel_mgr, ChannelId, s); } @@ -1102,8 +1090,7 @@ static UINT drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChId, * * @return 0 on success, otherwise a Win32 error code */ -static UINT drdynvc_process_close_request(drdynvcPlugin* drdynvc, int Sp, - int cbChId, wStream* s) +static UINT drdynvc_process_close_request(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) { UINT8 value; UINT error; @@ -1114,13 +1101,14 @@ static UINT drdynvc_process_close_request(drdynvcPlugin* drdynvc, int Sp, return ERROR_INVALID_DATA; ChannelId = drdynvc_read_variable_uint(s, cbChId); - WLog_Print(drdynvc->log, WLOG_DEBUG, "process_close_request: Sp=%d cbChId=%d, ChannelId=%"PRIu32"", - Sp, - cbChId, ChannelId); + WLog_Print(drdynvc->log, WLOG_DEBUG, + "process_close_request: Sp=%d cbChId=%d, ChannelId=%" PRIu32 "", Sp, cbChId, + ChannelId); if ((error = dvcman_close_channel(drdynvc->channel_mgr, ChannelId))) { - WLog_Print(drdynvc->log, WLOG_ERROR, "dvcman_close_channel failed with error %"PRIu32"!", error); + WLog_Print(drdynvc->log, WLOG_ERROR, "dvcman_close_channel failed with error %" PRIu32 "!", + error); return error; } @@ -1138,7 +1126,7 @@ static UINT drdynvc_process_close_request(drdynvcPlugin* drdynvc, int Sp, error = drdynvc_send(drdynvc, data_out); if (error) - WLog_Print(drdynvc->log, WLOG_ERROR, "VirtualChannelWriteEx failed with %s [%08"PRIX32"]", + WLog_Print(drdynvc->log, WLOG_ERROR, "VirtualChannelWriteEx failed with %s [%08" PRIX32 "]", WTSErrorToString(error), error); return error; @@ -1193,8 +1181,9 @@ static UINT drdynvc_order_recv(drdynvcPlugin* drdynvc, wStream* s) * * @return 0 on success, otherwise a Win32 error code */ -static UINT drdynvc_virtual_channel_event_data_received(drdynvcPlugin* drdynvc, - void* pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) +static UINT drdynvc_virtual_channel_event_data_received(drdynvcPlugin* drdynvc, void* pData, + UINT32 dataLength, UINT32 totalLength, + UINT32 dataFlags) { wStream* data_in; @@ -1239,7 +1228,7 @@ static UINT drdynvc_virtual_channel_event_data_received(drdynvcPlugin* drdynvc, Stream_SealLength(data_in); Stream_SetPosition(data_in, 0); - if (!MessageQueue_Post(drdynvc->queue, NULL, 0, (void*) data_in, NULL)) + if (!MessageQueue_Post(drdynvc->queue, NULL, 0, (void*)data_in, NULL)) { WLog_Print(drdynvc->log, WLOG_ERROR, "MessageQueue_Post failed!"); return ERROR_INTERNAL_ERROR; @@ -1250,10 +1239,12 @@ static UINT drdynvc_virtual_channel_event_data_received(drdynvcPlugin* drdynvc, } static void VCAPITYPE drdynvc_virtual_channel_open_event_ex(LPVOID lpUserParam, DWORD openHandle, - UINT event, LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) + UINT event, LPVOID pData, + UINT32 dataLength, UINT32 totalLength, + UINT32 dataFlags) { UINT error = CHANNEL_RC_OK; - drdynvcPlugin* drdynvc = (drdynvcPlugin*) lpUserParam; + drdynvcPlugin* drdynvc = (drdynvcPlugin*)lpUserParam; if (!drdynvc || (drdynvc->OpenHandle != openHandle)) { @@ -1264,10 +1255,12 @@ static void VCAPITYPE drdynvc_virtual_channel_open_event_ex(LPVOID lpUserParam, switch (event) { case CHANNEL_EVENT_DATA_RECEIVED: - if ((error = drdynvc_virtual_channel_event_data_received(drdynvc, pData, dataLength, totalLength, - dataFlags))) + if ((error = drdynvc_virtual_channel_event_data_received(drdynvc, pData, dataLength, + totalLength, dataFlags))) WLog_Print(drdynvc->log, WLOG_ERROR, - "drdynvc_virtual_channel_event_data_received failed with error %"PRIu32"", error); + "drdynvc_virtual_channel_event_data_received failed with error %" PRIu32 + "", + error); break; @@ -1277,14 +1270,15 @@ static void VCAPITYPE drdynvc_virtual_channel_open_event_ex(LPVOID lpUserParam, wStream* s = (wStream*)pData; Stream_Free(s, TRUE); } - break; + break; case CHANNEL_EVENT_USER: break; } if (error && drdynvc->rdpcontext) - setChannelError(drdynvc->rdpcontext, error, "drdynvc_virtual_channel_open_event reported an error"); + setChannelError(drdynvc->rdpcontext, error, + "drdynvc_virtual_channel_open_event reported an error"); } static DWORD WINAPI drdynvc_virtual_channel_client_thread(LPVOID arg) @@ -1292,11 +1286,11 @@ static DWORD WINAPI drdynvc_virtual_channel_client_thread(LPVOID arg) wStream* data; wMessage message; UINT error = CHANNEL_RC_OK; - drdynvcPlugin* drdynvc = (drdynvcPlugin*) arg; + drdynvcPlugin* drdynvc = (drdynvcPlugin*)arg; if (!drdynvc) { - ExitThread((DWORD) CHANNEL_RC_BAD_CHANNEL_HANDLE); + ExitThread((DWORD)CHANNEL_RC_BAD_CHANNEL_HANDLE); return CHANNEL_RC_BAD_CHANNEL_HANDLE; } @@ -1321,12 +1315,13 @@ static DWORD WINAPI drdynvc_virtual_channel_client_thread(LPVOID arg) if (message.id == 0) { - data = (wStream*) message.wParam; + data = (wStream*)message.wParam; if ((error = drdynvc_order_recv(drdynvc, data))) { Stream_Free(data, TRUE); - WLog_Print(drdynvc->log, WLOG_ERROR, "drdynvc_order_recv failed with error %"PRIu32"!", error); + WLog_Print(drdynvc->log, WLOG_ERROR, + "drdynvc_order_recv failed with error %" PRIu32 "!", error); break; } @@ -1336,14 +1331,14 @@ static DWORD WINAPI drdynvc_virtual_channel_client_thread(LPVOID arg) { /* Disconnect remaining dynamic channels that the server did not. - * This is required to properly shut down channels by calling the appropriate - * event handlers. */ + * This is required to properly shut down channels by calling the appropriate + * event handlers. */ DVCMAN* drdynvcMgr = (DVCMAN*)drdynvc->channel_mgr; while (ArrayList_Count(drdynvcMgr->channels) > 0) { - IWTSVirtualChannel* channel = (IWTSVirtualChannel*) - ArrayList_GetItem(drdynvcMgr->channels, 0); + IWTSVirtualChannel* channel = + (IWTSVirtualChannel*)ArrayList_GetItem(drdynvcMgr->channels, 0); const UINT32 ChannelId = drdynvc->channel_mgr->GetChannelId(channel); dvcman_close_channel(drdynvc->channel_mgr, ChannelId); } @@ -1353,7 +1348,7 @@ static DWORD WINAPI drdynvc_virtual_channel_client_thread(LPVOID arg) setChannelError(drdynvc->rdpcontext, error, "drdynvc_virtual_channel_client_thread reported an error"); - ExitThread((DWORD) error); + ExitThread((DWORD)error); return error; } @@ -1377,7 +1372,7 @@ static void drdynvc_queue_object_free(void* obj) * @return 0 on success, otherwise a Win32 error code */ static UINT drdynvc_virtual_channel_event_connected(drdynvcPlugin* drdynvc, LPVOID pData, - UINT32 dataLength) + UINT32 dataLength) { UINT error; UINT32 status; @@ -1391,12 +1386,13 @@ static UINT drdynvc_virtual_channel_event_connected(drdynvcPlugin* drdynvc, LPVO if (!drdynvc) return CHANNEL_RC_BAD_CHANNEL_HANDLE; - status = drdynvc->channelEntryPoints.pVirtualChannelOpenEx(drdynvc->InitHandle, - &drdynvc->OpenHandle, drdynvc->channelDef.name, drdynvc_virtual_channel_open_event_ex); + status = drdynvc->channelEntryPoints.pVirtualChannelOpenEx( + drdynvc->InitHandle, &drdynvc->OpenHandle, drdynvc->channelDef.name, + drdynvc_virtual_channel_open_event_ex); if (status != CHANNEL_RC_OK) { - WLog_Print(drdynvc->log, WLOG_ERROR, "pVirtualChannelOpen failed with %s [%08"PRIX32"]", + WLog_Print(drdynvc->log, WLOG_ERROR, "pVirtualChannelOpen failed with %s [%08" PRIX32 "]", WTSErrorToString(status), status); return status; } @@ -1420,7 +1416,7 @@ static UINT drdynvc_virtual_channel_event_connected(drdynvcPlugin* drdynvc, LPVO goto error; } - settings = (rdpSettings*) drdynvc->channelEntryPoints.pExtendedData; + settings = (rdpSettings*)drdynvc->channelEntryPoints.pExtendedData; for (index = 0; index < settings->DynamicChannelCount; index++) { @@ -1433,15 +1429,14 @@ static UINT drdynvc_virtual_channel_event_connected(drdynvcPlugin* drdynvc, LPVO if ((error = dvcman_init(drdynvc, drdynvc->channel_mgr))) { - WLog_Print(drdynvc->log, WLOG_ERROR, "dvcman_init failed with error %"PRIu32"!", error); + WLog_Print(drdynvc->log, WLOG_ERROR, "dvcman_init failed with error %" PRIu32 "!", error); goto error; } drdynvc->state = DRDYNVC_STATE_CAPABILITIES; if (!(drdynvc->thread = CreateThread(NULL, 0, drdynvc_virtual_channel_client_thread, - (void*) drdynvc, - 0, NULL))) + (void*)drdynvc, 0, NULL))) { error = ERROR_INTERNAL_ERROR; WLog_Print(drdynvc->log, WLOG_ERROR, "CreateThread failed!"); @@ -1470,14 +1465,16 @@ static UINT drdynvc_virtual_channel_event_disconnected(drdynvcPlugin* drdynvc) if (!MessageQueue_PostQuit(drdynvc->queue, 0)) { status = GetLastError(); - WLog_Print(drdynvc->log, WLOG_ERROR, "MessageQueue_PostQuit failed with error %"PRIu32"", status); + WLog_Print(drdynvc->log, WLOG_ERROR, "MessageQueue_PostQuit failed with error %" PRIu32 "", + status); return status; } if (WaitForSingleObject(drdynvc->thread, INFINITE) != WAIT_OBJECT_0) { status = GetLastError(); - WLog_Print(drdynvc->log, WLOG_ERROR, "WaitForSingleObject failed with error %"PRIu32"", status); + WLog_Print(drdynvc->log, WLOG_ERROR, "WaitForSingleObject failed with error %" PRIu32 "", + status); return status; } @@ -1486,11 +1483,11 @@ static UINT drdynvc_virtual_channel_event_disconnected(drdynvcPlugin* drdynvc) drdynvc->queue = NULL; drdynvc->thread = NULL; status = drdynvc->channelEntryPoints.pVirtualChannelCloseEx(drdynvc->InitHandle, - drdynvc->OpenHandle); + drdynvc->OpenHandle); if (status != CHANNEL_RC_OK) { - WLog_Print(drdynvc->log, WLOG_ERROR, "pVirtualChannelClose failed with %s [%08"PRIX32"]", + WLog_Print(drdynvc->log, WLOG_ERROR, "pVirtualChannelClose failed with %s [%08" PRIX32 "]", WTSErrorToString(status), status); } @@ -1535,7 +1532,7 @@ static UINT drdynvc_virtual_channel_event_attached(drdynvcPlugin* drdynvc) if (!drdynvc) return CHANNEL_RC_BAD_CHANNEL_HANDLE; - dvcman = (DVCMAN*) drdynvc->channel_mgr; + dvcman = (DVCMAN*)drdynvc->channel_mgr; if (!dvcman) return CHANNEL_RC_BAD_CHANNEL_HANDLE; @@ -1548,7 +1545,8 @@ static UINT drdynvc_virtual_channel_event_attached(drdynvcPlugin* drdynvc) if (pPlugin->Attached) if ((error = pPlugin->Attached(pPlugin))) { - WLog_Print(drdynvc->log, WLOG_ERROR, "Attach failed with error %"PRIu32"!", error); + WLog_Print(drdynvc->log, WLOG_ERROR, "Attach failed with error %" PRIu32 "!", + error); return error; } } @@ -1564,7 +1562,7 @@ static UINT drdynvc_virtual_channel_event_detached(drdynvcPlugin* drdynvc) if (!drdynvc) return CHANNEL_RC_BAD_CHANNEL_HANDLE; - dvcman = (DVCMAN*) drdynvc->channel_mgr; + dvcman = (DVCMAN*)drdynvc->channel_mgr; if (!dvcman) return CHANNEL_RC_BAD_CHANNEL_HANDLE; @@ -1577,7 +1575,8 @@ static UINT drdynvc_virtual_channel_event_detached(drdynvcPlugin* drdynvc) if (pPlugin->Detached) if ((error = pPlugin->Detached(pPlugin))) { - WLog_Print(drdynvc->log, WLOG_ERROR, "Detach failed with error %"PRIu32"!", error); + WLog_Print(drdynvc->log, WLOG_ERROR, "Detach failed with error %" PRIu32 "!", + error); return error; } } @@ -1586,10 +1585,11 @@ static UINT drdynvc_virtual_channel_event_detached(drdynvcPlugin* drdynvc) } static VOID VCAPITYPE drdynvc_virtual_channel_init_event_ex(LPVOID lpUserParam, LPVOID pInitHandle, - UINT event, LPVOID pData, UINT dataLength) + UINT event, LPVOID pData, + UINT dataLength) { UINT error = CHANNEL_RC_OK; - drdynvcPlugin* drdynvc = (drdynvcPlugin*) lpUserParam; + drdynvcPlugin* drdynvc = (drdynvcPlugin*)lpUserParam; if (!drdynvc || (drdynvc->InitHandle != pInitHandle)) { @@ -1602,35 +1602,41 @@ static VOID VCAPITYPE drdynvc_virtual_channel_init_event_ex(LPVOID lpUserParam, case CHANNEL_EVENT_CONNECTED: if ((error = drdynvc_virtual_channel_event_connected(drdynvc, pData, dataLength))) WLog_Print(drdynvc->log, WLOG_ERROR, - "drdynvc_virtual_channel_event_connected failed with error %"PRIu32"", error); + "drdynvc_virtual_channel_event_connected failed with error %" PRIu32 "", + error); break; case CHANNEL_EVENT_DISCONNECTED: - if ((error = drdynvc_virtual_channel_event_disconnected(drdynvc))) + if ((error = drdynvc_virtual_channel_event_disconnected(drdynvc))) WLog_Print(drdynvc->log, WLOG_ERROR, - "drdynvc_virtual_channel_event_disconnected failed with error %"PRIu32"", error); + "drdynvc_virtual_channel_event_disconnected failed with error %" PRIu32 + "", + error); break; case CHANNEL_EVENT_TERMINATED: - if ((error = drdynvc_virtual_channel_event_terminated(drdynvc))) + if ((error = drdynvc_virtual_channel_event_terminated(drdynvc))) WLog_Print(drdynvc->log, WLOG_ERROR, - "drdynvc_virtual_channel_event_terminated failed with error %"PRIu32"", error); + "drdynvc_virtual_channel_event_terminated failed with error %" PRIu32 "", + error); break; case CHANNEL_EVENT_ATTACHED: - if ((error = drdynvc_virtual_channel_event_attached(drdynvc))) + if ((error = drdynvc_virtual_channel_event_attached(drdynvc))) WLog_Print(drdynvc->log, WLOG_ERROR, - "drdynvc_virtual_channel_event_attached failed with error %"PRIu32"", error); + "drdynvc_virtual_channel_event_attached failed with error %" PRIu32 "", + error); break; case CHANNEL_EVENT_DETACHED: - if ((error = drdynvc_virtual_channel_event_detached(drdynvc))) + if ((error = drdynvc_virtual_channel_event_detached(drdynvc))) WLog_Print(drdynvc->log, WLOG_ERROR, - "drdynvc_virtual_channel_event_detached failed with error %"PRIu32"", error); + "drdynvc_virtual_channel_event_detached failed with error %" PRIu32 "", + error); break; @@ -1649,12 +1655,12 @@ static VOID VCAPITYPE drdynvc_virtual_channel_init_event_ex(LPVOID lpUserParam, static int drdynvc_get_version(DrdynvcClientContext* context) { - drdynvcPlugin* drdynvc = (drdynvcPlugin*) context->handle; + drdynvcPlugin* drdynvc = (drdynvcPlugin*)context->handle; return drdynvc->version; } /* drdynvc is always built-in */ -#define VirtualChannelEntryEx drdynvc_VirtualChannelEntryEx +#define VirtualChannelEntryEx drdynvc_VirtualChannelEntryEx BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS_EX pEntryPoints, PVOID pInitHandle) { @@ -1662,7 +1668,7 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS_EX pEntryPoints, PVOI drdynvcPlugin* drdynvc; DrdynvcClientContext* context = NULL; CHANNEL_ENTRY_POINTS_FREERDP_EX* pEntryPointsEx; - drdynvc = (drdynvcPlugin*) calloc(1, sizeof(drdynvcPlugin)); + drdynvc = (drdynvcPlugin*)calloc(1, sizeof(drdynvcPlugin)); if (!drdynvc) { @@ -1671,17 +1677,15 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS_EX pEntryPoints, PVOI } drdynvc->channelDef.options = - CHANNEL_OPTION_INITIALIZED | - CHANNEL_OPTION_ENCRYPT_RDP | - CHANNEL_OPTION_COMPRESS_RDP; + CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP | CHANNEL_OPTION_COMPRESS_RDP; sprintf_s(drdynvc->channelDef.name, ARRAYSIZE(drdynvc->channelDef.name), "drdynvc"); drdynvc->state = DRDYNVC_STATE_INITIAL; - pEntryPointsEx = (CHANNEL_ENTRY_POINTS_FREERDP_EX*) pEntryPoints; + pEntryPointsEx = (CHANNEL_ENTRY_POINTS_FREERDP_EX*)pEntryPoints; if ((pEntryPointsEx->cbSize >= sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX)) && (pEntryPointsEx->MagicNumber == FREERDP_CHANNEL_MAGIC_NUMBER)) { - context = (DrdynvcClientContext*) calloc(1, sizeof(DrdynvcClientContext)); + context = (DrdynvcClientContext*)calloc(1, sizeof(DrdynvcClientContext)); if (!context) { @@ -1690,7 +1694,7 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS_EX pEntryPoints, PVOI return FALSE; } - context->handle = (void*) drdynvc; + context->handle = (void*)drdynvc; context->custom = NULL; drdynvc->context = context; context->GetVersion = drdynvc_get_version; @@ -1699,14 +1703,16 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS_EX pEntryPoints, PVOI drdynvc->log = WLog_Get(TAG); WLog_Print(drdynvc->log, WLOG_DEBUG, "VirtualChannelEntryEx"); - CopyMemory(&(drdynvc->channelEntryPoints), pEntryPoints, sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX)); + CopyMemory(&(drdynvc->channelEntryPoints), pEntryPoints, + sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX)); drdynvc->InitHandle = pInitHandle; - rc = drdynvc->channelEntryPoints.pVirtualChannelInitEx(drdynvc, context, pInitHandle, - &drdynvc->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000, drdynvc_virtual_channel_init_event_ex); + rc = drdynvc->channelEntryPoints.pVirtualChannelInitEx( + drdynvc, context, pInitHandle, &drdynvc->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000, + drdynvc_virtual_channel_init_event_ex); if (CHANNEL_RC_OK != rc) { - WLog_Print(drdynvc->log, WLOG_ERROR, "pVirtualChannelInit failed with %s [%08"PRIX32"]", + WLog_Print(drdynvc->log, WLOG_ERROR, "pVirtualChannelInit failed with %s [%08" PRIX32 "]", WTSErrorToString(rc), rc); free(drdynvc->context); free(drdynvc); @@ -1716,4 +1722,3 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS_EX pEntryPoints, PVOI drdynvc->channelEntryPoints.pInterface = context; return TRUE; } - diff --git a/channels/drdynvc/client/drdynvc_main.h b/channels/drdynvc/client/drdynvc_main.h index 7492465c0..4b69f9d51 100644 --- a/channels/drdynvc/client/drdynvc_main.h +++ b/channels/drdynvc/client/drdynvc_main.h @@ -106,11 +106,11 @@ enum _DRDYNVC_STATE }; typedef enum _DRDYNVC_STATE DRDYNVC_STATE; -#define CREATE_REQUEST_PDU 0x01 -#define DATA_FIRST_PDU 0x02 -#define DATA_PDU 0x03 -#define CLOSE_REQUEST_PDU 0x04 -#define CAPABILITY_REQUEST_PDU 0x05 +#define CREATE_REQUEST_PDU 0x01 +#define DATA_FIRST_PDU 0x02 +#define DATA_PDU 0x03 +#define CLOSE_REQUEST_PDU 0x04 +#define CAPABILITY_REQUEST_PDU 0x05 struct drdynvc_plugin { diff --git a/channels/drdynvc/server/drdynvc_main.c b/channels/drdynvc/server/drdynvc_main.c index b9639704b..66440b27b 100644 --- a/channels/drdynvc/server/drdynvc_main.c +++ b/channels/drdynvc/server/drdynvc_main.c @@ -32,7 +32,6 @@ #define TAG CHANNELS_TAG("drdynvc.server") - static DWORD WINAPI drdynvc_server_thread(LPVOID arg) { #if 0 @@ -121,8 +120,8 @@ static DWORD WINAPI drdynvc_server_thread(LPVOID arg) */ static UINT drdynvc_server_start(DrdynvcServerContext* context) { - context->priv->ChannelHandle = WTSVirtualChannelOpen(context->vcm, - WTS_CURRENT_SESSION, "drdynvc"); + context->priv->ChannelHandle = + WTSVirtualChannelOpen(context->vcm, WTS_CURRENT_SESSION, "drdynvc"); if (!context->priv->ChannelHandle) { @@ -136,7 +135,8 @@ static UINT drdynvc_server_start(DrdynvcServerContext* context) return ERROR_INTERNAL_ERROR; } - if (!(context->priv->Thread = CreateThread(NULL, 0, drdynvc_server_thread, (void*) context, 0, NULL))) + if (!(context->priv->Thread = + CreateThread(NULL, 0, drdynvc_server_thread, (void*)context, 0, NULL))) { WLog_ERR(TAG, "CreateThread failed!"); CloseHandle(context->priv->StopEvent); @@ -160,7 +160,7 @@ static UINT drdynvc_server_stop(DrdynvcServerContext* context) if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); return error; } @@ -171,14 +171,14 @@ static UINT drdynvc_server_stop(DrdynvcServerContext* context) DrdynvcServerContext* drdynvc_server_context_new(HANDLE vcm) { DrdynvcServerContext* context; - context = (DrdynvcServerContext*) calloc(1, sizeof(DrdynvcServerContext)); + context = (DrdynvcServerContext*)calloc(1, sizeof(DrdynvcServerContext)); if (context) { context->vcm = vcm; context->Start = drdynvc_server_start; context->Stop = drdynvc_server_stop; - context->priv = (DrdynvcServerPrivate*) calloc(1, sizeof(DrdynvcServerPrivate)); + context->priv = (DrdynvcServerPrivate*)calloc(1, sizeof(DrdynvcServerPrivate)); if (!context->priv) { diff --git a/channels/drive/client/drive_file.c b/channels/drive/client/drive_file.c index c0e36f503..8f03fd858 100644 --- a/channels/drive/client/drive_file.c +++ b/channels/drive/client/drive_file.c @@ -46,9 +46,19 @@ #include "drive_file.h" #ifdef WITH_DEBUG_RDPDR -#define DEBUG_WSTR(msg, wstr) do { LPSTR lpstr; ConvertFromUnicode(CP_UTF8, 0, wstr, -1, &lpstr, 0, NULL, NULL); WLog_DBG(TAG, msg, lpstr); free(lpstr); } while (0) +#define DEBUG_WSTR(msg, wstr) \ + do \ + { \ + LPSTR lpstr; \ + ConvertFromUnicode(CP_UTF8, 0, wstr, -1, &lpstr, 0, NULL, NULL); \ + WLog_DBG(TAG, msg, lpstr); \ + free(lpstr); \ + } while (0) #else -#define DEBUG_WSTR(msg, wstr) do { } while (0) +#define DEBUG_WSTR(msg, wstr) \ + do \ + { \ + } while (0) #endif static void drive_file_fix_path(WCHAR* path) @@ -79,7 +89,7 @@ static void drive_file_fix_path(WCHAR* path) } static WCHAR* drive_file_combine_fullpath(const WCHAR* base_path, const WCHAR* path, - size_t PathLength) + size_t PathLength) { WCHAR* fullpath; size_t base_path_length; @@ -140,8 +150,8 @@ static BOOL drive_file_remove_dir(const WCHAR* path) { size_t len = _wcslen(findFileData.cFileName); - if ((len == 1 && findFileData.cFileName[0] == L'.') || (len == 2 && - findFileData.cFileName[0] == L'.' && findFileData.cFileName[1] == L'.')) + if ((len == 1 && findFileData.cFileName[0] == L'.') || + (len == 2 && findFileData.cFileName[0] == L'.' && findFileData.cFileName[1] == L'.')) { continue; } @@ -162,8 +172,7 @@ static BOOL drive_file_remove_dir(const WCHAR* path) if (!ret) break; - } - while (ret && FindNextFileW(dir, &findFileData) != 0); + } while (ret && FindNextFileW(dir, &findFileData) != 0); FindClose(dir); @@ -238,7 +247,8 @@ static BOOL drive_file_init(DRIVE_FILE* file) if (file->is_dir) { /* Should only create the directory if the disposition allows for it */ - if ((file->CreateDisposition == FILE_OPEN_IF) || (file->CreateDisposition == FILE_CREATE)) + if ((file->CreateDisposition == FILE_OPEN_IF) || + (file->CreateDisposition == FILE_CREATE)) { if (CreateDirectoryW(file->fullpath, NULL) != 0) { @@ -255,27 +265,33 @@ static BOOL drive_file_init(DRIVE_FILE* file) { switch (file->CreateDisposition) { - case FILE_SUPERSEDE: /* If the file already exists, replace it with the given file. If it does not, create the given file. */ + case FILE_SUPERSEDE: /* If the file already exists, replace it with the given file. If + it does not, create the given file. */ CreateDisposition = CREATE_ALWAYS; break; - case FILE_OPEN: /* If the file already exists, open it instead of creating a new file. If it does not, fail the request and do not create a new file. */ + case FILE_OPEN: /* If the file already exists, open it instead of creating a new file. + If it does not, fail the request and do not create a new file. */ CreateDisposition = OPEN_EXISTING; break; - case FILE_CREATE: /* If the file already exists, fail the request and do not create or open the given file. If it does not, create the given file. */ + case FILE_CREATE: /* If the file already exists, fail the request and do not create or + open the given file. If it does not, create the given file. */ CreateDisposition = CREATE_NEW; break; - case FILE_OPEN_IF: /* If the file already exists, open it. If it does not, create the given file. */ + case FILE_OPEN_IF: /* If the file already exists, open it. If it does not, create the + given file. */ CreateDisposition = OPEN_ALWAYS; break; - case FILE_OVERWRITE: /* If the file already exists, open it and overwrite it. If it does not, fail the request. */ + case FILE_OVERWRITE: /* If the file already exists, open it and overwrite it. If it does + not, fail the request. */ CreateDisposition = TRUNCATE_EXISTING; break; - case FILE_OVERWRITE_IF: /* If the file already exists, open it and overwrite it. If it does not, create the given file. */ + case FILE_OVERWRITE_IF: /* If the file already exists, open it and overwrite it. If it + does not, create the given file. */ CreateDisposition = CREATE_ALWAYS; break; @@ -286,9 +302,8 @@ static BOOL drive_file_init(DRIVE_FILE* file) #ifndef WIN32 file->SharedAccess = 0; #endif - file->file_handle = CreateFileW(file->fullpath, file->DesiredAccess, - file->SharedAccess, NULL, CreateDisposition, - file->FileAttributes, NULL); + file->file_handle = CreateFileW(file->fullpath, file->DesiredAccess, file->SharedAccess, + NULL, CreateDisposition, file->FileAttributes, NULL); } #ifdef WIN32 @@ -300,9 +315,11 @@ static BOOL drive_file_init(DRIVE_FILE* file) if (errorMessageID != 0) { LPSTR messageBuffer = NULL; - size_t size = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, errorMessageID, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&messageBuffer, 0, NULL); + size_t size = + FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, errorMessageID, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPSTR)&messageBuffer, 0, NULL); WLog_ERR(TAG, "Error in drive_file_init: %s %s", messageBuffer, file->fullpath); /* Free the buffer. */ LocalFree(messageBuffer); @@ -316,15 +333,15 @@ static BOOL drive_file_init(DRIVE_FILE* file) } DRIVE_FILE* drive_file_new(const WCHAR* base_path, const WCHAR* path, UINT32 PathLength, UINT32 id, - UINT32 DesiredAccess, UINT32 CreateDisposition, - UINT32 CreateOptions, UINT32 FileAttributes, UINT32 SharedAccess) + UINT32 DesiredAccess, UINT32 CreateDisposition, UINT32 CreateOptions, + UINT32 FileAttributes, UINT32 SharedAccess) { DRIVE_FILE* file; if (!base_path || !path) return NULL; - file = (DRIVE_FILE*) calloc(1, sizeof(DRIVE_FILE)); + file = (DRIVE_FILE*)calloc(1, sizeof(DRIVE_FILE)); if (!file) { @@ -465,15 +482,23 @@ BOOL drive_file_query_information(DRIVE_FILE* file, UINT32 FsInformationClass, w goto out_fail; Stream_Write_UINT32(output, 36); /* Length */ - Stream_Write_UINT32(output, fileAttributes.ftCreationTime.dwLowDateTime); /* CreationTime */ - Stream_Write_UINT32(output, fileAttributes.ftCreationTime.dwHighDateTime); /* CreationTime */ - Stream_Write_UINT32(output, fileAttributes.ftLastAccessTime.dwLowDateTime); /* LastAccessTime */ - Stream_Write_UINT32(output, fileAttributes.ftLastAccessTime.dwHighDateTime); /* LastAccessTime */ - Stream_Write_UINT32(output, fileAttributes.ftLastWriteTime.dwLowDateTime); /* LastWriteTime */ - Stream_Write_UINT32(output, fileAttributes.ftLastWriteTime.dwHighDateTime); /* LastWriteTime */ - Stream_Write_UINT32(output, fileAttributes.ftLastWriteTime.dwLowDateTime); /* ChangeTime */ - Stream_Write_UINT32(output, fileAttributes.ftLastWriteTime.dwHighDateTime); /* ChangeTime */ - Stream_Write_UINT32(output, fileAttributes.dwFileAttributes); /* FileAttributes */ + Stream_Write_UINT32(output, + fileAttributes.ftCreationTime.dwLowDateTime); /* CreationTime */ + Stream_Write_UINT32(output, + fileAttributes.ftCreationTime.dwHighDateTime); /* CreationTime */ + Stream_Write_UINT32(output, + fileAttributes.ftLastAccessTime.dwLowDateTime); /* LastAccessTime */ + Stream_Write_UINT32( + output, fileAttributes.ftLastAccessTime.dwHighDateTime); /* LastAccessTime */ + Stream_Write_UINT32(output, + fileAttributes.ftLastWriteTime.dwLowDateTime); /* LastWriteTime */ + Stream_Write_UINT32(output, + fileAttributes.ftLastWriteTime.dwHighDateTime); /* LastWriteTime */ + Stream_Write_UINT32(output, + fileAttributes.ftLastWriteTime.dwLowDateTime); /* ChangeTime */ + Stream_Write_UINT32(output, + fileAttributes.ftLastWriteTime.dwHighDateTime); /* ChangeTime */ + Stream_Write_UINT32(output, fileAttributes.dwFileAttributes); /* FileAttributes */ /* Reserved(4), MUST NOT be added! */ break; @@ -483,15 +508,16 @@ BOOL drive_file_query_information(DRIVE_FILE* file, UINT32 FsInformationClass, w if (!Stream_EnsureRemainingCapacity(output, 4 + 22)) goto out_fail; - Stream_Write_UINT32(output, 22); /* Length */ - Stream_Write_UINT32(output, fileAttributes.nFileSizeLow); /* AllocationSize */ + Stream_Write_UINT32(output, 22); /* Length */ + Stream_Write_UINT32(output, fileAttributes.nFileSizeLow); /* AllocationSize */ Stream_Write_UINT32(output, fileAttributes.nFileSizeHigh); /* AllocationSize */ - Stream_Write_UINT32(output, fileAttributes.nFileSizeLow); /* EndOfFile */ + Stream_Write_UINT32(output, fileAttributes.nFileSizeLow); /* EndOfFile */ Stream_Write_UINT32(output, fileAttributes.nFileSizeHigh); /* EndOfFile */ - Stream_Write_UINT32(output, 0); /* NumberOfLinks */ - Stream_Write_UINT8(output, file->delete_pending ? 1 : 0); /* DeletePending */ - Stream_Write_UINT8(output, fileAttributes.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ? TRUE : - FALSE); /* Directory */ + Stream_Write_UINT32(output, 0); /* NumberOfLinks */ + Stream_Write_UINT8(output, file->delete_pending ? 1 : 0); /* DeletePending */ + Stream_Write_UINT8(output, fileAttributes.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY + ? TRUE + : FALSE); /* Directory */ /* Reserved(2), MUST NOT be added! */ break; @@ -501,9 +527,9 @@ BOOL drive_file_query_information(DRIVE_FILE* file, UINT32 FsInformationClass, w if (!Stream_EnsureRemainingCapacity(output, 4 + 8)) goto out_fail; - Stream_Write_UINT32(output, 8); /* Length */ + Stream_Write_UINT32(output, 8); /* Length */ Stream_Write_UINT32(output, fileAttributes.dwFileAttributes); /* FileAttributes */ - Stream_Write_UINT32(output, 0); /* ReparseTag */ + Stream_Write_UINT32(output, 0); /* ReparseTag */ break; default: @@ -560,7 +586,8 @@ BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UIN if (file->file_handle == INVALID_HANDLE_VALUE) { - WLog_ERR(TAG, "Unable to set file time %s (%"PRId32")", file->fullpath, GetLastError()); + WLog_ERR(TAG, "Unable to set file time %s (%" PRId32 ")", file->fullpath, + GetLastError()); return FALSE; } @@ -595,7 +622,8 @@ BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UIN DEBUG_WSTR("SetFileTime %s", file->fullpath); SetFileAttributesW(file->fullpath, FileAttributes); - if (!SetFileTime(file->file_handle, pftCreationTime, pftLastAccessTime, pftLastWriteTime)) + if (!SetFileTime(file->file_handle, pftCreationTime, pftLastAccessTime, + pftLastWriteTime)) { WLog_ERR(TAG, "Unable to set file time to %s", file->fullpath); return FALSE; @@ -615,8 +643,8 @@ BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UIN if (file->file_handle == INVALID_HANDLE_VALUE) { - WLog_ERR(TAG, "Unable to truncate %s to %"PRId64" (%"PRId32")", file->fullpath, size, - GetLastError()); + WLog_ERR(TAG, "Unable to truncate %s to %" PRId64 " (%" PRId32 ")", file->fullpath, + size, GetLastError()); return FALSE; } @@ -624,7 +652,8 @@ BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UIN if (!SetFilePointerEx(file->file_handle, liSize, NULL, FILE_BEGIN)) { - WLog_ERR(TAG, "Unable to truncate %s to %d (%"PRId32")", file->fullpath, size, GetLastError()); + WLog_ERR(TAG, "Unable to truncate %s to %d (%" PRId32 ")", file->fullpath, size, + GetLastError()); return FALSE; } @@ -632,7 +661,8 @@ BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UIN if (SetEndOfFile(file->file_handle) == 0) { - WLog_ERR(TAG, "Unable to truncate %s to %d (%"PRId32")", file->fullpath, size, GetLastError()); + WLog_ERR(TAG, "Unable to truncate %s to %d (%" PRId32 ")", file->fullpath, size, + GetLastError()); return FALSE; } @@ -703,7 +733,8 @@ BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UIN DEBUG_WSTR("MoveFileExW %s", file->fullpath); if (MoveFileExW(file->fullpath, fullpath, - MOVEFILE_COPY_ALLOWED | (ReplaceIfExists ? MOVEFILE_REPLACE_EXISTING : 0))) + MOVEFILE_COPY_ALLOWED | + (ReplaceIfExists ? MOVEFILE_REPLACE_EXISTING : 0))) { if (!drive_file_set_fullpath(file, fullpath)) return FALSE; @@ -766,22 +797,30 @@ BOOL drive_file_query_directory(DRIVE_FILE* file, UINT32 FsInformationClass, BYT goto out_fail; Stream_Write_UINT32(output, (UINT32)(64 + length)); /* Length */ - Stream_Write_UINT32(output, 0); /* NextEntryOffset */ - Stream_Write_UINT32(output, 0); /* FileIndex */ - Stream_Write_UINT32(output, file->find_data.ftCreationTime.dwLowDateTime); /* CreationTime */ - Stream_Write_UINT32(output, file->find_data.ftCreationTime.dwHighDateTime); /* CreationTime */ - Stream_Write_UINT32(output, file->find_data.ftLastAccessTime.dwLowDateTime); /* LastAccessTime */ - Stream_Write_UINT32(output, file->find_data.ftLastAccessTime.dwHighDateTime); /* LastAccessTime */ - Stream_Write_UINT32(output, file->find_data.ftLastWriteTime.dwLowDateTime); /* LastWriteTime */ - Stream_Write_UINT32(output, file->find_data.ftLastWriteTime.dwHighDateTime); /* LastWriteTime */ - Stream_Write_UINT32(output, file->find_data.ftLastWriteTime.dwLowDateTime); /* ChangeTime */ - Stream_Write_UINT32(output, file->find_data.ftLastWriteTime.dwHighDateTime); /* ChangeTime */ - Stream_Write_UINT32(output, file->find_data.nFileSizeLow); /* EndOfFile */ - Stream_Write_UINT32(output, file->find_data.nFileSizeHigh); /* EndOfFile */ - Stream_Write_UINT32(output, file->find_data.nFileSizeLow); /* AllocationSize */ - Stream_Write_UINT32(output, file->find_data.nFileSizeHigh); /* AllocationSize */ + Stream_Write_UINT32(output, 0); /* NextEntryOffset */ + Stream_Write_UINT32(output, 0); /* FileIndex */ + Stream_Write_UINT32(output, + file->find_data.ftCreationTime.dwLowDateTime); /* CreationTime */ + Stream_Write_UINT32(output, + file->find_data.ftCreationTime.dwHighDateTime); /* CreationTime */ + Stream_Write_UINT32( + output, file->find_data.ftLastAccessTime.dwLowDateTime); /* LastAccessTime */ + Stream_Write_UINT32( + output, file->find_data.ftLastAccessTime.dwHighDateTime); /* LastAccessTime */ + Stream_Write_UINT32(output, + file->find_data.ftLastWriteTime.dwLowDateTime); /* LastWriteTime */ + Stream_Write_UINT32(output, + file->find_data.ftLastWriteTime.dwHighDateTime); /* LastWriteTime */ + Stream_Write_UINT32(output, + file->find_data.ftLastWriteTime.dwLowDateTime); /* ChangeTime */ + Stream_Write_UINT32(output, + file->find_data.ftLastWriteTime.dwHighDateTime); /* ChangeTime */ + Stream_Write_UINT32(output, file->find_data.nFileSizeLow); /* EndOfFile */ + Stream_Write_UINT32(output, file->find_data.nFileSizeHigh); /* EndOfFile */ + Stream_Write_UINT32(output, file->find_data.nFileSizeLow); /* AllocationSize */ + Stream_Write_UINT32(output, file->find_data.nFileSizeHigh); /* AllocationSize */ Stream_Write_UINT32(output, file->find_data.dwFileAttributes); /* FileAttributes */ - Stream_Write_UINT32(output, (UINT32)length); /* FileNameLength */ + Stream_Write_UINT32(output, (UINT32)length); /* FileNameLength */ Stream_Write(output, file->find_data.cFileName, length); break; @@ -795,23 +834,31 @@ BOOL drive_file_query_directory(DRIVE_FILE* file, UINT32 FsInformationClass, BYT goto out_fail; Stream_Write_UINT32(output, (UINT32)(68 + length)); /* Length */ - Stream_Write_UINT32(output, 0); /* NextEntryOffset */ - Stream_Write_UINT32(output, 0); /* FileIndex */ - Stream_Write_UINT32(output, file->find_data.ftCreationTime.dwLowDateTime); /* CreationTime */ - Stream_Write_UINT32(output, file->find_data.ftCreationTime.dwHighDateTime); /* CreationTime */ - Stream_Write_UINT32(output, file->find_data.ftLastAccessTime.dwLowDateTime); /* LastAccessTime */ - Stream_Write_UINT32(output, file->find_data.ftLastAccessTime.dwHighDateTime); /* LastAccessTime */ - Stream_Write_UINT32(output, file->find_data.ftLastWriteTime.dwLowDateTime); /* LastWriteTime */ - Stream_Write_UINT32(output, file->find_data.ftLastWriteTime.dwHighDateTime); /* LastWriteTime */ - Stream_Write_UINT32(output, file->find_data.ftLastWriteTime.dwLowDateTime); /* ChangeTime */ - Stream_Write_UINT32(output, file->find_data.ftLastWriteTime.dwHighDateTime); /* ChangeTime */ - Stream_Write_UINT32(output, file->find_data.nFileSizeLow); /* EndOfFile */ - Stream_Write_UINT32(output, file->find_data.nFileSizeHigh); /* EndOfFile */ - Stream_Write_UINT32(output, file->find_data.nFileSizeLow); /* AllocationSize */ - Stream_Write_UINT32(output, file->find_data.nFileSizeHigh); /* AllocationSize */ + Stream_Write_UINT32(output, 0); /* NextEntryOffset */ + Stream_Write_UINT32(output, 0); /* FileIndex */ + Stream_Write_UINT32(output, + file->find_data.ftCreationTime.dwLowDateTime); /* CreationTime */ + Stream_Write_UINT32(output, + file->find_data.ftCreationTime.dwHighDateTime); /* CreationTime */ + Stream_Write_UINT32( + output, file->find_data.ftLastAccessTime.dwLowDateTime); /* LastAccessTime */ + Stream_Write_UINT32( + output, file->find_data.ftLastAccessTime.dwHighDateTime); /* LastAccessTime */ + Stream_Write_UINT32(output, + file->find_data.ftLastWriteTime.dwLowDateTime); /* LastWriteTime */ + Stream_Write_UINT32(output, + file->find_data.ftLastWriteTime.dwHighDateTime); /* LastWriteTime */ + Stream_Write_UINT32(output, + file->find_data.ftLastWriteTime.dwLowDateTime); /* ChangeTime */ + Stream_Write_UINT32(output, + file->find_data.ftLastWriteTime.dwHighDateTime); /* ChangeTime */ + Stream_Write_UINT32(output, file->find_data.nFileSizeLow); /* EndOfFile */ + Stream_Write_UINT32(output, file->find_data.nFileSizeHigh); /* EndOfFile */ + Stream_Write_UINT32(output, file->find_data.nFileSizeLow); /* AllocationSize */ + Stream_Write_UINT32(output, file->find_data.nFileSizeHigh); /* AllocationSize */ Stream_Write_UINT32(output, file->find_data.dwFileAttributes); /* FileAttributes */ - Stream_Write_UINT32(output, (UINT32)length); /* FileNameLength */ - Stream_Write_UINT32(output, 0); /* EaSize */ + Stream_Write_UINT32(output, (UINT32)length); /* FileNameLength */ + Stream_Write_UINT32(output, 0); /* EaSize */ Stream_Write(output, file->find_data.cFileName, length); break; @@ -825,24 +872,32 @@ BOOL drive_file_query_directory(DRIVE_FILE* file, UINT32 FsInformationClass, BYT goto out_fail; Stream_Write_UINT32(output, (UINT32)(93 + length)); /* Length */ - Stream_Write_UINT32(output, 0); /* NextEntryOffset */ - Stream_Write_UINT32(output, 0); /* FileIndex */ - Stream_Write_UINT32(output, file->find_data.ftCreationTime.dwLowDateTime); /* CreationTime */ - Stream_Write_UINT32(output, file->find_data.ftCreationTime.dwHighDateTime); /* CreationTime */ - Stream_Write_UINT32(output, file->find_data.ftLastAccessTime.dwLowDateTime); /* LastAccessTime */ - Stream_Write_UINT32(output, file->find_data.ftLastAccessTime.dwHighDateTime); /* LastAccessTime */ - Stream_Write_UINT32(output, file->find_data.ftLastWriteTime.dwLowDateTime); /* LastWriteTime */ - Stream_Write_UINT32(output, file->find_data.ftLastWriteTime.dwHighDateTime); /* LastWriteTime */ - Stream_Write_UINT32(output, file->find_data.ftLastWriteTime.dwLowDateTime); /* ChangeTime */ - Stream_Write_UINT32(output, file->find_data.ftLastWriteTime.dwHighDateTime); /* ChangeTime */ - Stream_Write_UINT32(output, file->find_data.nFileSizeLow); /* EndOfFile */ - Stream_Write_UINT32(output, file->find_data.nFileSizeHigh); /* EndOfFile */ - Stream_Write_UINT32(output, file->find_data.nFileSizeLow); /* AllocationSize */ - Stream_Write_UINT32(output, file->find_data.nFileSizeHigh); /* AllocationSize */ + Stream_Write_UINT32(output, 0); /* NextEntryOffset */ + Stream_Write_UINT32(output, 0); /* FileIndex */ + Stream_Write_UINT32(output, + file->find_data.ftCreationTime.dwLowDateTime); /* CreationTime */ + Stream_Write_UINT32(output, + file->find_data.ftCreationTime.dwHighDateTime); /* CreationTime */ + Stream_Write_UINT32( + output, file->find_data.ftLastAccessTime.dwLowDateTime); /* LastAccessTime */ + Stream_Write_UINT32( + output, file->find_data.ftLastAccessTime.dwHighDateTime); /* LastAccessTime */ + Stream_Write_UINT32(output, + file->find_data.ftLastWriteTime.dwLowDateTime); /* LastWriteTime */ + Stream_Write_UINT32(output, + file->find_data.ftLastWriteTime.dwHighDateTime); /* LastWriteTime */ + Stream_Write_UINT32(output, + file->find_data.ftLastWriteTime.dwLowDateTime); /* ChangeTime */ + Stream_Write_UINT32(output, + file->find_data.ftLastWriteTime.dwHighDateTime); /* ChangeTime */ + Stream_Write_UINT32(output, file->find_data.nFileSizeLow); /* EndOfFile */ + Stream_Write_UINT32(output, file->find_data.nFileSizeHigh); /* EndOfFile */ + Stream_Write_UINT32(output, file->find_data.nFileSizeLow); /* AllocationSize */ + Stream_Write_UINT32(output, file->find_data.nFileSizeHigh); /* AllocationSize */ Stream_Write_UINT32(output, file->find_data.dwFileAttributes); /* FileAttributes */ - Stream_Write_UINT32(output, (UINT32)length); /* FileNameLength */ - Stream_Write_UINT32(output, 0); /* EaSize */ - Stream_Write_UINT8(output, 0); /* ShortNameLength */ + Stream_Write_UINT32(output, (UINT32)length); /* FileNameLength */ + Stream_Write_UINT32(output, 0); /* EaSize */ + Stream_Write_UINT8(output, 0); /* ShortNameLength */ /* Reserved(1), MUST NOT be added! */ Stream_Zero(output, 24); /* ShortName */ Stream_Write(output, file->find_data.cFileName, length); @@ -858,14 +913,14 @@ BOOL drive_file_query_directory(DRIVE_FILE* file, UINT32 FsInformationClass, BYT goto out_fail; Stream_Write_UINT32(output, (UINT32)(12 + length)); /* Length */ - Stream_Write_UINT32(output, 0); /* NextEntryOffset */ - Stream_Write_UINT32(output, 0); /* FileIndex */ - Stream_Write_UINT32(output, (UINT32)length); /* FileNameLength */ + Stream_Write_UINT32(output, 0); /* NextEntryOffset */ + Stream_Write_UINT32(output, 0); /* FileIndex */ + Stream_Write_UINT32(output, (UINT32)length); /* FileNameLength */ Stream_Write(output, file->find_data.cFileName, length); break; default: - WLog_ERR(TAG, "unhandled FsInformationClass %"PRIu32, FsInformationClass); + WLog_ERR(TAG, "unhandled FsInformationClass %" PRIu32, FsInformationClass); /* Unhandled FsInformationClass */ goto out_fail; } @@ -873,6 +928,6 @@ BOOL drive_file_query_directory(DRIVE_FILE* file, UINT32 FsInformationClass, BYT return TRUE; out_fail: Stream_Write_UINT32(output, 0); /* Length */ - Stream_Write_UINT8(output, 0); /* Padding */ + Stream_Write_UINT8(output, 0); /* Padding */ return FALSE; } diff --git a/channels/drive/client/drive_file.h b/channels/drive/client/drive_file.h index 45e76128a..ed789d6f0 100644 --- a/channels/drive/client/drive_file.h +++ b/channels/drive/client/drive_file.h @@ -52,8 +52,8 @@ struct _DRIVE_FILE }; DRIVE_FILE* drive_file_new(const WCHAR* base_path, const WCHAR* path, UINT32 PathLength, UINT32 id, - UINT32 DesiredAccess, UINT32 CreateDisposition, - UINT32 CreateOptions, UINT32 FileAttributes, UINT32 SharedAccess); + UINT32 DesiredAccess, UINT32 CreateDisposition, UINT32 CreateOptions, + UINT32 FileAttributes, UINT32 SharedAccess); BOOL drive_file_free(DRIVE_FILE* file); BOOL drive_file_open(DRIVE_FILE* file); diff --git a/channels/drive/client/drive_main.c b/channels/drive/client/drive_main.c index 2b7c3dd03..8340d3071 100644 --- a/channels/drive/client/drive_main.c +++ b/channels/drive/client/drive_main.c @@ -102,7 +102,7 @@ static DWORD drive_map_windows_err(DWORD fs_errno) case ERROR_FILE_EXISTS: case ERROR_ALREADY_EXISTS: - rc = STATUS_OBJECT_NAME_COLLISION; + rc = STATUS_OBJECT_NAME_COLLISION; break; case ERROR_INVALID_NAME: @@ -127,7 +127,7 @@ static DWORD drive_map_windows_err(DWORD fs_errno) default: rc = STATUS_UNSUCCESSFUL; - WLog_ERR(TAG, "Error code not found: %"PRIu32"", fs_errno); + WLog_ERR(TAG, "Error code not found: %" PRIu32 "", fs_errno); break; } @@ -137,12 +137,12 @@ static DWORD drive_map_windows_err(DWORD fs_errno) static DRIVE_FILE* drive_get_file_by_id(DRIVE_DEVICE* drive, UINT32 id) { DRIVE_FILE* file = NULL; - void* key = (void*)(size_t) id; + void* key = (void*)(size_t)id; if (!drive) return NULL; - file = (DRIVE_FILE*) ListDictionary_GetItemValue(drive->files, key); + file = (DRIVE_FILE*)ListDictionary_GetItemValue(drive->files, key); return file; } @@ -182,7 +182,7 @@ static UINT drive_process_irp_create(DRIVE_DEVICE* drive, IRP* irp) if (Stream_GetRemainingLength(irp->input) < PathLength) return ERROR_INVALID_DATA; - path = (WCHAR*) Stream_Pointer(irp->input); + path = (WCHAR*)Stream_Pointer(irp->input); FileId = irp->devman->id_sequence++; file = drive_file_new(drive->path, path, PathLength, FileId, DesiredAccess, CreateDisposition, CreateOptions, FileAttributes, SharedAccess); @@ -195,7 +195,7 @@ static UINT drive_process_irp_create(DRIVE_DEVICE* drive, IRP* irp) } else { - void* key = (void*)(size_t) file->id; + void* key = (void*)(size_t)file->id; if (!ListDictionary_Add(drive->files, key, file)) { @@ -245,7 +245,7 @@ static UINT drive_process_irp_close(DRIVE_DEVICE* drive, IRP* irp) return ERROR_INVALID_PARAMETER; file = drive_get_file_by_id(drive, irp->FileId); - key = (void*)(size_t) irp->FileId; + key = (void*)(size_t)irp->FileId; if (!file) irp->IoStatus = STATUS_UNSUCCESSFUL; @@ -421,8 +421,7 @@ static UINT drive_process_irp_set_information(DRIVE_DEVICE* drive, IRP* irp) { irp->IoStatus = STATUS_UNSUCCESSFUL; } - else if (!drive_file_set_information(file, FsInformationClass, Length, - irp->input)) + else if (!drive_file_set_information(file, FsInformationClass, Length, irp->input)) { irp->IoStatus = drive_map_windows_err(GetLastError()); } @@ -434,19 +433,17 @@ static UINT drive_process_irp_set_information(DRIVE_DEVICE* drive, IRP* irp) return irp->Complete(irp); } - /** * Function description * * @return 0 on success, otherwise a Win32 error code */ -static UINT drive_process_irp_query_volume_information(DRIVE_DEVICE* drive, - IRP* irp) +static UINT drive_process_irp_query_volume_information(DRIVE_DEVICE* drive, IRP* irp) { UINT32 FsInformationClass; wStream* output = NULL; - char* volumeLabel = {"FREERDP"}; - char* diskType = {"FAT32"}; + char* volumeLabel = { "FREERDP" }; + char* diskType = { "FAT32" }; WCHAR* outStr = NULL; int length; DWORD lpSectorsPerCluster; @@ -489,10 +486,11 @@ static UINT drive_process_irp_query_volume_information(DRIVE_DEVICE* drive, GetFileAttributesExW(drive->path, GetFileExInfoStandard, &wfad); Stream_Write_UINT32(output, wfad.ftCreationTime.dwLowDateTime); /* VolumeCreationTime */ - Stream_Write_UINT32(output, wfad.ftCreationTime.dwHighDateTime); /* VolumeCreationTime */ + Stream_Write_UINT32(output, + wfad.ftCreationTime.dwHighDateTime); /* VolumeCreationTime */ Stream_Write_UINT32(output, lpNumberOfFreeClusters & 0xffff); /* VolumeSerialNumber */ - Stream_Write_UINT32(output, length); /* VolumeLabelLength */ - Stream_Write_UINT8(output, 0); /* SupportsObjects */ + Stream_Write_UINT32(output, length); /* VolumeLabelLength */ + Stream_Write_UINT8(output, 0); /* SupportsObjects */ /* Reserved(1), MUST NOT be added! */ Stream_Write(output, outStr, length); /* VolumeLabel (Unicode) */ free(outStr); @@ -509,9 +507,9 @@ static UINT drive_process_irp_query_volume_information(DRIVE_DEVICE* drive, } Stream_Write_UINT64(output, lpTotalNumberOfClusters); /* TotalAllocationUnits */ - Stream_Write_UINT64(output, lpNumberOfFreeClusters); /* AvailableAllocationUnits */ - Stream_Write_UINT32(output, lpSectorsPerCluster); /* SectorsPerAllocationUnit */ - Stream_Write_UINT32(output, lpBytesPerSector); /* BytesPerSector */ + Stream_Write_UINT64(output, lpNumberOfFreeClusters); /* AvailableAllocationUnits */ + Stream_Write_UINT32(output, lpSectorsPerCluster); /* SectorsPerAllocationUnit */ + Stream_Write_UINT32(output, lpBytesPerSector); /* BytesPerSector */ break; case FileFsAttributeInformation: @@ -532,13 +530,11 @@ static UINT drive_process_irp_query_volume_information(DRIVE_DEVICE* drive, return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT32(output, - FILE_CASE_SENSITIVE_SEARCH | - FILE_CASE_PRESERVED_NAMES | - FILE_UNICODE_ON_DISK); /* FileSystemAttributes */ - Stream_Write_UINT32(output, MAX_PATH); /* MaximumComponentNameLength */ - Stream_Write_UINT32(output, length); /* FileSystemNameLength */ - Stream_Write(output, outStr, length); /* FileSystemName (Unicode) */ + Stream_Write_UINT32(output, FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES | + FILE_UNICODE_ON_DISK); /* FileSystemAttributes */ + Stream_Write_UINT32(output, MAX_PATH); /* MaximumComponentNameLength */ + Stream_Write_UINT32(output, length); /* FileSystemNameLength */ + Stream_Write(output, outStr, length); /* FileSystemName (Unicode) */ free(outStr); break; @@ -553,10 +549,11 @@ static UINT drive_process_irp_query_volume_information(DRIVE_DEVICE* drive, } Stream_Write_UINT64(output, lpTotalNumberOfClusters); /* TotalAllocationUnits */ - Stream_Write_UINT64(output, lpNumberOfFreeClusters); /* CallerAvailableAllocationUnits */ + Stream_Write_UINT64(output, + lpNumberOfFreeClusters); /* CallerAvailableAllocationUnits */ Stream_Write_UINT64(output, lpNumberOfFreeClusters); /* AvailableAllocationUnits */ - Stream_Write_UINT32(output, lpSectorsPerCluster); /* SectorsPerAllocationUnit */ - Stream_Write_UINT32(output, lpBytesPerSector); /* BytesPerSector */ + Stream_Write_UINT32(output, lpSectorsPerCluster); /* SectorsPerAllocationUnit */ + Stream_Write_UINT32(output, lpBytesPerSector); /* BytesPerSector */ break; case FileFsDeviceInformation: @@ -570,7 +567,7 @@ static UINT drive_process_irp_query_volume_information(DRIVE_DEVICE* drive, } Stream_Write_UINT32(output, FILE_DEVICE_DISK); /* DeviceType */ - Stream_Write_UINT32(output, 0); /* Characteristics */ + Stream_Write_UINT32(output, 0); /* Characteristics */ break; default: @@ -627,7 +624,7 @@ static UINT drive_process_irp_query_directory(DRIVE_DEVICE* drive, IRP* irp) Stream_Read_UINT8(irp->input, InitialQuery); Stream_Read_UINT32(irp->input, PathLength); Stream_Seek(irp->input, 23); /* Padding */ - path = (WCHAR*) Stream_Pointer(irp->input); + path = (WCHAR*)Stream_Pointer(irp->input); file = drive_get_file_by_id(drive, irp->FileId); if (file == NULL) @@ -754,7 +751,7 @@ static DWORD WINAPI drive_thread_func(LPVOID arg) { IRP* irp; wMessage message; - DRIVE_DEVICE* drive = (DRIVE_DEVICE*) arg; + DRIVE_DEVICE* drive = (DRIVE_DEVICE*)arg; UINT error = CHANNEL_RC_OK; if (!drive) @@ -782,13 +779,13 @@ static DWORD WINAPI drive_thread_func(LPVOID arg) if (message.id == WMQ_QUIT) break; - irp = (IRP*) message.wParam; + irp = (IRP*)message.wParam; if (irp) { if ((error = drive_process_irp(drive, irp))) { - WLog_ERR(TAG, "drive_process_irp failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "drive_process_irp failed with error %" PRIu32 "!", error); break; } } @@ -810,12 +807,12 @@ fail: */ static UINT drive_irp_request(DEVICE* device, IRP* irp) { - DRIVE_DEVICE* drive = (DRIVE_DEVICE*) device; + DRIVE_DEVICE* drive = (DRIVE_DEVICE*)device; if (!drive) return ERROR_INVALID_PARAMETER; - if (!MessageQueue_Post(drive->IrpQueue, NULL, 0, (void*) irp, NULL)) + if (!MessageQueue_Post(drive->IrpQueue, NULL, 0, (void*)irp, NULL)) { WLog_ERR(TAG, "MessageQueue_Post failed!"); return ERROR_INTERNAL_ERROR; @@ -848,17 +845,17 @@ static UINT drive_free_int(DRIVE_DEVICE* drive) */ static UINT drive_free(DEVICE* device) { - DRIVE_DEVICE* drive = (DRIVE_DEVICE*) device; + DRIVE_DEVICE* drive = (DRIVE_DEVICE*)device; UINT error = CHANNEL_RC_OK; if (!drive) return ERROR_INVALID_PARAMETER; - if (MessageQueue_PostQuit(drive->IrpQueue, 0) - && (WaitForSingleObject(drive->thread, INFINITE) == WAIT_FAILED)) + if (MessageQueue_PostQuit(drive->IrpQueue, 0) && + (WaitForSingleObject(drive->thread, INFINITE) == WAIT_FAILED)) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", error); return error; } @@ -870,7 +867,7 @@ static UINT drive_free(DEVICE* device) */ static void drive_file_objfree(void* obj) { - drive_file_free((DRIVE_FILE*) obj); + drive_file_free((DRIVE_FILE*)obj); } /** @@ -878,8 +875,8 @@ static void drive_file_objfree(void* obj) * * @return 0 on success, otherwise a Win32 error code */ -static UINT drive_register_drive_path(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, - const char* name, const char* path, BOOL automount) +static UINT drive_register_drive_path(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, const char* name, + const char* path, BOOL automount) { size_t i, length; DRIVE_DEVICE* drive; @@ -887,14 +884,15 @@ static UINT drive_register_drive_path(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, if (!pEntryPoints || !name || !path) { - WLog_ERR(TAG, "[%s] Invalid parameters: pEntryPoints=%p, name=%p, path=%p", pEntryPoints, name, path); + WLog_ERR(TAG, "[%s] Invalid parameters: pEntryPoints=%p, name=%p, path=%p", pEntryPoints, + name, path); return ERROR_INVALID_PARAMETER; } if (name[0] && path[0]) { size_t pathLength = strnlen(path, MAX_PATH); - drive = (DRIVE_DEVICE*) calloc(1, sizeof(DRIVE_DEVICE)); + drive = (DRIVE_DEVICE*)calloc(1, sizeof(DRIVE_DEVICE)); if (!drive) { @@ -922,7 +920,7 @@ static UINT drive_register_drive_path(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, Stream_Write_UINT8(drive->device.data, name[i] < 0 ? '_' : name[i]); if ((pathLength > 1) && (path[pathLength - 1] == '/')) - pathLength --; + pathLength--; if (ConvertToUnicode(sys_code_page, 0, path, pathLength, &drive->path, 0) <= 0) { @@ -950,15 +948,14 @@ static UINT drive_register_drive_path(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, goto out_error; } - if ((error = pEntryPoints->RegisterDevice(pEntryPoints->devman, - (DEVICE*) drive))) + if ((error = pEntryPoints->RegisterDevice(pEntryPoints->devman, (DEVICE*)drive))) { - WLog_ERR(TAG, "RegisterDevice failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "RegisterDevice failed with error %" PRIu32 "!", error); goto out_error; } - if (!(drive->thread = CreateThread(NULL, 0, drive_thread_func, drive, - CREATE_SUSPENDED, NULL))) + if (!(drive->thread = + CreateThread(NULL, 0, drive_thread_func, drive, CREATE_SUSPENDED, NULL))) { WLog_ERR(TAG, "CreateThread failed!"); goto out_error; @@ -974,9 +971,9 @@ out_error: } #ifdef BUILTIN_CHANNELS -#define DeviceServiceEntry drive_DeviceServiceEntry +#define DeviceServiceEntry drive_DeviceServiceEntry #else -#define DeviceServiceEntry FREERDP_API DeviceServiceEntry +#define DeviceServiceEntry FREERDP_API DeviceServiceEntry #endif /** @@ -995,7 +992,7 @@ UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) char* bufdup; char* devdup; #endif - drive = (RDPDR_DRIVE*) pEntryPoints->device; + drive = (RDPDR_DRIVE*)pEntryPoints->device; #ifndef WIN32 sys_code_page = CP_UTF8; diff --git a/channels/echo/client/echo_main.c b/channels/echo/client/echo_main.c index a16089fd9..e830122a7 100644 --- a/channels/echo/client/echo_main.c +++ b/channels/echo/client/echo_main.c @@ -66,9 +66,9 @@ struct _ECHO_PLUGIN * * @return 0 on success, otherwise a Win32 error code */ -static UINT echo_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream *data) +static UINT echo_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream* data) { - ECHO_CHANNEL_CALLBACK* callback = (ECHO_CHANNEL_CALLBACK*) pChannelCallback; + ECHO_CHANNEL_CALLBACK* callback = (ECHO_CHANNEL_CALLBACK*)pChannelCallback; BYTE* pBuffer = Stream_Pointer(data); UINT32 cbSize = Stream_GetRemainingLength(data); @@ -83,7 +83,7 @@ static UINT echo_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, */ static UINT echo_on_close(IWTSVirtualChannelCallback* pChannelCallback) { - ECHO_CHANNEL_CALLBACK* callback = (ECHO_CHANNEL_CALLBACK*) pChannelCallback; + ECHO_CHANNEL_CALLBACK* callback = (ECHO_CHANNEL_CALLBACK*)pChannelCallback; free(callback); @@ -96,13 +96,13 @@ static UINT echo_on_close(IWTSVirtualChannelCallback* pChannelCallback) * @return 0 on success, otherwise a Win32 error code */ static UINT echo_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, - IWTSVirtualChannel* pChannel, BYTE* Data, BOOL* pbAccept, - IWTSVirtualChannelCallback** ppCallback) + IWTSVirtualChannel* pChannel, BYTE* Data, BOOL* pbAccept, + IWTSVirtualChannelCallback** ppCallback) { ECHO_CHANNEL_CALLBACK* callback; - ECHO_LISTENER_CALLBACK* listener_callback = (ECHO_LISTENER_CALLBACK*) pListenerCallback; + ECHO_LISTENER_CALLBACK* listener_callback = (ECHO_LISTENER_CALLBACK*)pListenerCallback; - callback = (ECHO_CHANNEL_CALLBACK*) calloc(1, sizeof(ECHO_CHANNEL_CALLBACK)); + callback = (ECHO_CHANNEL_CALLBACK*)calloc(1, sizeof(ECHO_CHANNEL_CALLBACK)); if (!callback) { @@ -116,7 +116,7 @@ static UINT echo_on_new_channel_connection(IWTSListenerCallback* pListenerCallba callback->channel_mgr = listener_callback->channel_mgr; callback->channel = pChannel; - *ppCallback = (IWTSVirtualChannelCallback*) callback; + *ppCallback = (IWTSVirtualChannelCallback*)callback; return CHANNEL_RC_OK; } @@ -128,9 +128,9 @@ static UINT echo_on_new_channel_connection(IWTSListenerCallback* pListenerCallba */ static UINT echo_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) { - ECHO_PLUGIN* echo = (ECHO_PLUGIN*) pPlugin; + ECHO_PLUGIN* echo = (ECHO_PLUGIN*)pPlugin; - echo->listener_callback = (ECHO_LISTENER_CALLBACK*) calloc(1, sizeof(ECHO_LISTENER_CALLBACK)); + echo->listener_callback = (ECHO_LISTENER_CALLBACK*)calloc(1, sizeof(ECHO_LISTENER_CALLBACK)); if (!echo->listener_callback) { @@ -143,7 +143,7 @@ static UINT echo_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManage echo->listener_callback->channel_mgr = pChannelMgr; return pChannelMgr->CreateListener(pChannelMgr, "ECHO", 0, - (IWTSListenerCallback*) echo->listener_callback, NULL); + (IWTSListenerCallback*)echo->listener_callback, NULL); } /** @@ -153,7 +153,7 @@ static UINT echo_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManage */ static UINT echo_plugin_terminated(IWTSPlugin* pPlugin) { - ECHO_PLUGIN* echo = (ECHO_PLUGIN*) pPlugin; + ECHO_PLUGIN* echo = (ECHO_PLUGIN*)pPlugin; free(echo); @@ -161,9 +161,9 @@ static UINT echo_plugin_terminated(IWTSPlugin* pPlugin) } #ifdef BUILTIN_CHANNELS -#define DVCPluginEntry echo_DVCPluginEntry +#define DVCPluginEntry echo_DVCPluginEntry #else -#define DVCPluginEntry FREERDP_API DVCPluginEntry +#define DVCPluginEntry FREERDP_API DVCPluginEntry #endif /** @@ -176,11 +176,11 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) UINT status = CHANNEL_RC_OK; ECHO_PLUGIN* echo; - echo = (ECHO_PLUGIN*) pEntryPoints->GetPlugin(pEntryPoints, "echo"); + echo = (ECHO_PLUGIN*)pEntryPoints->GetPlugin(pEntryPoints, "echo"); if (!echo) { - echo = (ECHO_PLUGIN*) calloc(1, sizeof(ECHO_PLUGIN)); + echo = (ECHO_PLUGIN*)calloc(1, sizeof(ECHO_PLUGIN)); if (!echo) { @@ -193,7 +193,7 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) echo->iface.Disconnected = NULL; echo->iface.Terminated = echo_plugin_terminated; - status = pEntryPoints->RegisterPlugin(pEntryPoints, "echo", (IWTSPlugin*) echo); + status = pEntryPoints->RegisterPlugin(pEntryPoints, "echo", (IWTSPlugin*)echo); } return status; diff --git a/channels/echo/client/echo_main.h b/channels/echo/client/echo_main.h index 04cda415a..06262b12b 100644 --- a/channels/echo/client/echo_main.h +++ b/channels/echo/client/echo_main.h @@ -33,8 +33,10 @@ #ifdef WITH_DEBUG_DVC #define DEBUG_DVC(...) WLog_DBG(DVC_TAG, __VA_ARGS__) #else -#define DEBUG_DVC(...) do { } while (0) +#define DEBUG_DVC(...) \ + do \ + { \ + } while (0) #endif #endif /* FREERDP_CHANNEL_ECHO_CLIENT_MAIN_H */ - diff --git a/channels/echo/server/echo_main.c b/channels/echo/server/echo_main.c index b3f8eb0f7..55e2fa237 100644 --- a/channels/echo/server/echo_main.c +++ b/channels/echo/server/echo_main.c @@ -66,14 +66,14 @@ static UINT echo_server_open_channel(echo_server* echo) DWORD BytesReturned = 0; PULONG pSessionId = NULL; - if (WTSQuerySessionInformationA(echo->context.vcm, WTS_CURRENT_SESSION, - WTSSessionId, (LPSTR*) &pSessionId, &BytesReturned) == FALSE) + if (WTSQuerySessionInformationA(echo->context.vcm, WTS_CURRENT_SESSION, WTSSessionId, + (LPSTR*)&pSessionId, &BytesReturned) == FALSE) { WLog_ERR(TAG, "WTSQuerySessionInformationA failed!"); return ERROR_INTERNAL_ERROR; } - echo->SessionId = (DWORD) * pSessionId; + echo->SessionId = (DWORD)*pSessionId; WTSFreeMemory(pSessionId); hEvent = WTSVirtualChannelManagerGetEventHandle(echo->context.vcm); StartTick = GetTickCount(); @@ -83,12 +83,12 @@ static UINT echo_server_open_channel(echo_server* echo) if (WaitForSingleObject(hEvent, 1000) == WAIT_FAILED) { Error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", Error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", Error); return Error; } - echo->echo_channel = WTSVirtualChannelOpenEx(echo->SessionId, - "ECHO", WTS_CHANNEL_OPTION_DYNAMIC); + echo->echo_channel = + WTSVirtualChannelOpenEx(echo->SessionId, "ECHO", WTS_CHANNEL_OPTION_DYNAMIC); if (echo->echo_channel) break; @@ -114,19 +114,19 @@ static DWORD WINAPI echo_server_thread_func(LPVOID arg) BOOL ready = FALSE; HANDLE ChannelEvent; DWORD BytesReturned = 0; - echo_server* echo = (echo_server*) arg; + echo_server* echo = (echo_server*)arg; UINT error; DWORD status; if ((error = echo_server_open_channel(echo))) { UINT error2 = 0; - WLog_ERR(TAG, "echo_server_open_channel failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "echo_server_open_channel failed with error %" PRIu32 "!", error); IFCALLRET(echo->context.OpenResult, error2, &echo->context, ECHO_SERVER_OPEN_RESULT_NOTSUPPORTED); if (error2) - WLog_ERR(TAG, "echo server's OpenResult callback failed with error %"PRIu32"", + WLog_ERR(TAG, "echo server's OpenResult callback failed with error %" PRIu32 "", error2); goto out; @@ -158,7 +158,7 @@ static DWORD WINAPI echo_server_thread_func(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "", error); break; } @@ -168,7 +168,7 @@ static DWORD WINAPI echo_server_thread_func(LPVOID arg) ECHO_SERVER_OPEN_RESULT_CLOSED); if (error) - WLog_ERR(TAG, "OpenResult failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "OpenResult failed with error %" PRIu32 "!", error); break; } @@ -180,21 +180,20 @@ static DWORD WINAPI echo_server_thread_func(LPVOID arg) ECHO_SERVER_OPEN_RESULT_ERROR); if (error) - WLog_ERR(TAG, "OpenResult failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "OpenResult failed with error %" PRIu32 "!", error); break; } - ready = *((BOOL*) buffer); + ready = *((BOOL*)buffer); WTSFreeMemory(buffer); if (ready) { - IFCALLRET(echo->context.OpenResult, error, &echo->context, - ECHO_SERVER_OPEN_RESULT_OK); + IFCALLRET(echo->context.OpenResult, error, &echo->context, ECHO_SERVER_OPEN_RESULT_OK); if (error) - WLog_ERR(TAG, "OpenResult failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "OpenResult failed with error %" PRIu32 "!", error); break; } @@ -217,7 +216,7 @@ static DWORD WINAPI echo_server_thread_func(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "", error); break; } @@ -237,20 +236,20 @@ static DWORD WINAPI echo_server_thread_func(LPVOID arg) break; } - if (WTSVirtualChannelRead(echo->echo_channel, 0, (PCHAR) Stream_Buffer(s), - (ULONG) Stream_Capacity(s), &BytesReturned) == FALSE) + if (WTSVirtualChannelRead(echo->echo_channel, 0, (PCHAR)Stream_Buffer(s), + (ULONG)Stream_Capacity(s), &BytesReturned) == FALSE) { WLog_ERR(TAG, "WTSVirtualChannelRead failed!"); error = ERROR_INTERNAL_ERROR; break; } - IFCALLRET(echo->context.Response, error, &echo->context, - (BYTE*) Stream_Buffer(s), BytesReturned); + IFCALLRET(echo->context.Response, error, &echo->context, (BYTE*)Stream_Buffer(s), + BytesReturned); if (error) { - WLog_ERR(TAG, "Response failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "Response failed with error %" PRIu32 "!", error); break; } } @@ -275,7 +274,7 @@ out: */ static UINT echo_server_open(echo_server_context* context) { - echo_server* echo = (echo_server*) context; + echo_server* echo = (echo_server*)context; if (echo->thread == NULL) { @@ -285,7 +284,7 @@ static UINT echo_server_open(echo_server_context* context) return ERROR_INTERNAL_ERROR; } - if (!(echo->thread = CreateThread(NULL, 0, echo_server_thread_func, (void*) echo, 0, NULL))) + if (!(echo->thread = CreateThread(NULL, 0, echo_server_thread_func, (void*)echo, 0, NULL))) { WLog_ERR(TAG, "CreateEvent failed!"); CloseHandle(echo->stopEvent); @@ -305,7 +304,7 @@ static UINT echo_server_open(echo_server_context* context) static UINT echo_server_close(echo_server_context* context) { UINT error = CHANNEL_RC_OK; - echo_server* echo = (echo_server*) context; + echo_server* echo = (echo_server*)context; if (echo->thread) { @@ -314,7 +313,7 @@ static UINT echo_server_close(echo_server_context* context) if (WaitForSingleObject(echo->thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", error); return error; } @@ -327,17 +326,16 @@ static UINT echo_server_close(echo_server_context* context) return error; } -static BOOL echo_server_request(echo_server_context* context, - const BYTE* buffer, UINT32 length) +static BOOL echo_server_request(echo_server_context* context, const BYTE* buffer, UINT32 length) { - echo_server* echo = (echo_server*) context; - return WTSVirtualChannelWrite(echo->echo_channel, (PCHAR) buffer, length, NULL); + echo_server* echo = (echo_server*)context; + return WTSVirtualChannelWrite(echo->echo_channel, (PCHAR)buffer, length, NULL); } echo_server_context* echo_server_context_new(HANDLE vcm) { echo_server* echo; - echo = (echo_server*) calloc(1, sizeof(echo_server)); + echo = (echo_server*)calloc(1, sizeof(echo_server)); if (echo) { @@ -349,12 +347,12 @@ echo_server_context* echo_server_context_new(HANDLE vcm) else WLog_ERR(TAG, "calloc failed!"); - return (echo_server_context*) echo; + return (echo_server_context*)echo; } void echo_server_context_free(echo_server_context* context) { - echo_server* echo = (echo_server*) context; + echo_server* echo = (echo_server*)context; echo_server_close(context); free(echo); } diff --git a/channels/encomsp/client/encomsp_main.c b/channels/encomsp/client/encomsp_main.c index a2482fe74..2d22eeb59 100644 --- a/channels/encomsp/client/encomsp_main.c +++ b/channels/encomsp/client/encomsp_main.c @@ -44,7 +44,7 @@ static UINT encomsp_read_header(wStream* s, ENCOMSP_ORDER_HEADER* header) return ERROR_INVALID_DATA; } - Stream_Read_UINT16(s, header->Type); /* Type (2 bytes) */ + Stream_Read_UINT16(s, header->Type); /* Type (2 bytes) */ Stream_Read_UINT16(s, header->Length); /* Length (2 bytes) */ return CHANNEL_RC_OK; } @@ -56,7 +56,7 @@ static UINT encomsp_read_header(wStream* s, ENCOMSP_ORDER_HEADER* header) */ static UINT encomsp_write_header(wStream* s, ENCOMSP_ORDER_HEADER* header) { - Stream_Write_UINT16(s, header->Type); /* Type (2 bytes) */ + Stream_Write_UINT16(s, header->Type); /* Type (2 bytes) */ Stream_Write_UINT16(s, header->Length); /* Length (2 bytes) */ return CHANNEL_RC_OK; } @@ -80,7 +80,7 @@ static UINT encomsp_read_unicode_string(wStream* s, ENCOMSP_UNICODE_STRING* str) if (str->cchString > 1024) { - WLog_ERR(TAG, "cchString was %"PRIu16" but has to be < 1025!", str->cchString); + WLog_ERR(TAG, "cchString was %" PRIu16 " but has to be < 1025!", str->cchString); return ERROR_INVALID_DATA; } @@ -94,11 +94,10 @@ static UINT encomsp_read_unicode_string(wStream* s, ENCOMSP_UNICODE_STRING* str) return CHANNEL_RC_OK; } -static EncomspClientContext* encomsp_get_client_interface( - encomspPlugin* encomsp) +static EncomspClientContext* encomsp_get_client_interface(encomspPlugin* encomsp) { EncomspClientContext* pInterface; - pInterface = (EncomspClientContext*) encomsp->channelEntryPoints.pInterface; + pInterface = (EncomspClientContext*)encomsp->channelEntryPoints.pInterface; return pInterface; } @@ -121,15 +120,14 @@ static UINT encomsp_virtual_channel_write(encomspPlugin* encomsp, wStream* s) WLog_INFO(TAG, "EncomspWrite (%"PRIuz")", Stream_Length(s)); winpr_HexDump(Stream_Buffer(s), Stream_Length(s)); #endif - status = encomsp->channelEntryPoints.pVirtualChannelWriteEx(encomsp->InitHandle, - encomsp->OpenHandle, - Stream_Buffer(s), (UINT32) Stream_Length(s), s); + status = encomsp->channelEntryPoints.pVirtualChannelWriteEx( + encomsp->InitHandle, encomsp->OpenHandle, Stream_Buffer(s), (UINT32)Stream_Length(s), s); if (status != CHANNEL_RC_OK) { Stream_Free(s, TRUE); - WLog_ERR(TAG, "VirtualChannelWriteEx failed with %s [%08"PRIX32"]", - WTSErrorToString(status), status); + WLog_ERR(TAG, "VirtualChannelWriteEx failed with %s [%08" PRIX32 "]", + WTSErrorToString(status), status); } return status; } @@ -140,7 +138,7 @@ static UINT encomsp_virtual_channel_write(encomspPlugin* encomsp, wStream* s) * @return 0 on success, otherwise a Win32 error code */ static UINT encomsp_recv_filter_updated_pdu(encomspPlugin* encomsp, wStream* s, - ENCOMSP_ORDER_HEADER* header) + ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; @@ -151,7 +149,7 @@ static UINT encomsp_recv_filter_updated_pdu(encomspPlugin* encomsp, wStream* s, if (!context) return ERROR_INVALID_HANDLE; - beg = ((int) Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; + beg = ((int)Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; CopyMemory(&pdu, header, sizeof(ENCOMSP_ORDER_HEADER)); if (Stream_GetRemainingLength(s) < 1) @@ -161,7 +159,7 @@ static UINT encomsp_recv_filter_updated_pdu(encomspPlugin* encomsp, wStream* s, } Stream_Read_UINT8(s, pdu.Flags); /* Flags (1 byte) */ - end = (int) Stream_GetPosition(s); + end = (int)Stream_GetPosition(s); if ((beg + header->Length) < end) { @@ -183,7 +181,7 @@ static UINT encomsp_recv_filter_updated_pdu(encomspPlugin* encomsp, wStream* s, IFCALLRET(context->FilterUpdated, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->FilterUpdated failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context->FilterUpdated failed with error %" PRIu32 "", error); return error; } @@ -193,8 +191,8 @@ static UINT encomsp_recv_filter_updated_pdu(encomspPlugin* encomsp, wStream* s, * * @return 0 on success, otherwise a Win32 error code */ -static UINT encomsp_recv_application_created_pdu(encomspPlugin* encomsp, - wStream* s, ENCOMSP_ORDER_HEADER* header) +static UINT encomsp_recv_application_created_pdu(encomspPlugin* encomsp, wStream* s, + ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; @@ -205,7 +203,7 @@ static UINT encomsp_recv_application_created_pdu(encomspPlugin* encomsp, if (!context) return ERROR_INVALID_HANDLE; - beg = ((int) Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; + beg = ((int)Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; CopyMemory(&pdu, header, sizeof(ENCOMSP_ORDER_HEADER)); if (Stream_GetRemainingLength(s) < 6) @@ -219,11 +217,11 @@ static UINT encomsp_recv_application_created_pdu(encomspPlugin* encomsp, if ((error = encomsp_read_unicode_string(s, &(pdu.Name)))) { - WLog_ERR(TAG, "encomsp_read_unicode_string failed with error %"PRIu32"", error); + WLog_ERR(TAG, "encomsp_read_unicode_string failed with error %" PRIu32 "", error); return error; } - end = (int) Stream_GetPosition(s); + end = (int)Stream_GetPosition(s); if ((beg + header->Length) < end) { @@ -245,7 +243,7 @@ static UINT encomsp_recv_application_created_pdu(encomspPlugin* encomsp, IFCALLRET(context->ApplicationCreated, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->ApplicationCreated failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context->ApplicationCreated failed with error %" PRIu32 "", error); return error; } @@ -255,8 +253,8 @@ static UINT encomsp_recv_application_created_pdu(encomspPlugin* encomsp, * * @return 0 on success, otherwise a Win32 error code */ -static UINT encomsp_recv_application_removed_pdu(encomspPlugin* encomsp, - wStream* s, ENCOMSP_ORDER_HEADER* header) +static UINT encomsp_recv_application_removed_pdu(encomspPlugin* encomsp, wStream* s, + ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; @@ -267,7 +265,7 @@ static UINT encomsp_recv_application_removed_pdu(encomspPlugin* encomsp, if (!context) return ERROR_INVALID_HANDLE; - beg = ((int) Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; + beg = ((int)Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; CopyMemory(&pdu, header, sizeof(ENCOMSP_ORDER_HEADER)); if (Stream_GetRemainingLength(s) < 4) @@ -277,7 +275,7 @@ static UINT encomsp_recv_application_removed_pdu(encomspPlugin* encomsp, } Stream_Read_UINT32(s, pdu.AppId); /* AppId (4 bytes) */ - end = (int) Stream_GetPosition(s); + end = (int)Stream_GetPosition(s); if ((beg + header->Length) < end) { @@ -299,7 +297,7 @@ static UINT encomsp_recv_application_removed_pdu(encomspPlugin* encomsp, IFCALLRET(context->ApplicationRemoved, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->ApplicationRemoved failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context->ApplicationRemoved failed with error %" PRIu32 "", error); return error; } @@ -310,7 +308,7 @@ static UINT encomsp_recv_application_removed_pdu(encomspPlugin* encomsp, * @return 0 on success, otherwise a Win32 error code */ static UINT encomsp_recv_window_created_pdu(encomspPlugin* encomsp, wStream* s, - ENCOMSP_ORDER_HEADER* header) + ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; @@ -321,7 +319,7 @@ static UINT encomsp_recv_window_created_pdu(encomspPlugin* encomsp, wStream* s, if (!context) return ERROR_INVALID_HANDLE; - beg = ((int) Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; + beg = ((int)Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; CopyMemory(&pdu, header, sizeof(ENCOMSP_ORDER_HEADER)); if (Stream_GetRemainingLength(s) < 10) @@ -336,11 +334,11 @@ static UINT encomsp_recv_window_created_pdu(encomspPlugin* encomsp, wStream* s, if ((error = encomsp_read_unicode_string(s, &(pdu.Name)))) { - WLog_ERR(TAG, "encomsp_read_unicode_string failed with error %"PRIu32"", error); + WLog_ERR(TAG, "encomsp_read_unicode_string failed with error %" PRIu32 "", error); return error; } - end = (int) Stream_GetPosition(s); + end = (int)Stream_GetPosition(s); if ((beg + header->Length) < end) { @@ -362,7 +360,7 @@ static UINT encomsp_recv_window_created_pdu(encomspPlugin* encomsp, wStream* s, IFCALLRET(context->WindowCreated, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->WindowCreated failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context->WindowCreated failed with error %" PRIu32 "", error); return error; } @@ -373,7 +371,7 @@ static UINT encomsp_recv_window_created_pdu(encomspPlugin* encomsp, wStream* s, * @return 0 on success, otherwise a Win32 error code */ static UINT encomsp_recv_window_removed_pdu(encomspPlugin* encomsp, wStream* s, - ENCOMSP_ORDER_HEADER* header) + ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; @@ -384,7 +382,7 @@ static UINT encomsp_recv_window_removed_pdu(encomspPlugin* encomsp, wStream* s, if (!context) return ERROR_INVALID_HANDLE; - beg = ((int) Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; + beg = ((int)Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; CopyMemory(&pdu, header, sizeof(ENCOMSP_ORDER_HEADER)); if (Stream_GetRemainingLength(s) < 4) @@ -394,7 +392,7 @@ static UINT encomsp_recv_window_removed_pdu(encomspPlugin* encomsp, wStream* s, } Stream_Read_UINT32(s, pdu.WndId); /* WndId (4 bytes) */ - end = (int) Stream_GetPosition(s); + end = (int)Stream_GetPosition(s); if ((beg + header->Length) < end) { @@ -416,7 +414,7 @@ static UINT encomsp_recv_window_removed_pdu(encomspPlugin* encomsp, wStream* s, IFCALLRET(context->WindowRemoved, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->WindowRemoved failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context->WindowRemoved failed with error %" PRIu32 "", error); return error; } @@ -427,7 +425,7 @@ static UINT encomsp_recv_window_removed_pdu(encomspPlugin* encomsp, wStream* s, * @return 0 on success, otherwise a Win32 error code */ static UINT encomsp_recv_show_window_pdu(encomspPlugin* encomsp, wStream* s, - ENCOMSP_ORDER_HEADER* header) + ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; @@ -438,7 +436,7 @@ static UINT encomsp_recv_show_window_pdu(encomspPlugin* encomsp, wStream* s, if (!context) return ERROR_INVALID_HANDLE; - beg = ((int) Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; + beg = ((int)Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; CopyMemory(&pdu, header, sizeof(ENCOMSP_ORDER_HEADER)); if (Stream_GetRemainingLength(s) < 4) @@ -448,7 +446,7 @@ static UINT encomsp_recv_show_window_pdu(encomspPlugin* encomsp, wStream* s, } Stream_Read_UINT32(s, pdu.WndId); /* WndId (4 bytes) */ - end = (int) Stream_GetPosition(s); + end = (int)Stream_GetPosition(s); if ((beg + header->Length) < end) { @@ -470,7 +468,7 @@ static UINT encomsp_recv_show_window_pdu(encomspPlugin* encomsp, wStream* s, IFCALLRET(context->ShowWindow, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->ShowWindow failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context->ShowWindow failed with error %" PRIu32 "", error); return error; } @@ -480,8 +478,8 @@ static UINT encomsp_recv_show_window_pdu(encomspPlugin* encomsp, wStream* s, * * @return 0 on success, otherwise a Win32 error code */ -static UINT encomsp_recv_participant_created_pdu(encomspPlugin* encomsp, - wStream* s, ENCOMSP_ORDER_HEADER* header) +static UINT encomsp_recv_participant_created_pdu(encomspPlugin* encomsp, wStream* s, + ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; @@ -492,7 +490,7 @@ static UINT encomsp_recv_participant_created_pdu(encomspPlugin* encomsp, if (!context) return ERROR_INVALID_HANDLE; - beg = ((int) Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; + beg = ((int)Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; CopyMemory(&pdu, header, sizeof(ENCOMSP_ORDER_HEADER)); if (Stream_GetRemainingLength(s) < 10) @@ -502,16 +500,16 @@ static UINT encomsp_recv_participant_created_pdu(encomspPlugin* encomsp, } Stream_Read_UINT32(s, pdu.ParticipantId); /* ParticipantId (4 bytes) */ - Stream_Read_UINT32(s, pdu.GroupId); /* GroupId (4 bytes) */ - Stream_Read_UINT16(s, pdu.Flags); /* Flags (2 bytes) */ + Stream_Read_UINT32(s, pdu.GroupId); /* GroupId (4 bytes) */ + Stream_Read_UINT16(s, pdu.Flags); /* Flags (2 bytes) */ if ((error = encomsp_read_unicode_string(s, &(pdu.FriendlyName)))) { - WLog_ERR(TAG, "encomsp_read_unicode_string failed with error %"PRIu32"", error); + WLog_ERR(TAG, "encomsp_read_unicode_string failed with error %" PRIu32 "", error); return error; } - end = (int) Stream_GetPosition(s); + end = (int)Stream_GetPosition(s); if ((beg + header->Length) < end) { @@ -533,7 +531,7 @@ static UINT encomsp_recv_participant_created_pdu(encomspPlugin* encomsp, IFCALLRET(context->ParticipantCreated, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->ParticipantCreated failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context->ParticipantCreated failed with error %" PRIu32 "", error); return error; } @@ -543,8 +541,8 @@ static UINT encomsp_recv_participant_created_pdu(encomspPlugin* encomsp, * * @return 0 on success, otherwise a Win32 error code */ -static UINT encomsp_recv_participant_removed_pdu(encomspPlugin* encomsp, - wStream* s, ENCOMSP_ORDER_HEADER* header) +static UINT encomsp_recv_participant_removed_pdu(encomspPlugin* encomsp, wStream* s, + ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; @@ -555,7 +553,7 @@ static UINT encomsp_recv_participant_removed_pdu(encomspPlugin* encomsp, if (!context) return ERROR_INVALID_HANDLE; - beg = ((int) Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; + beg = ((int)Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; CopyMemory(&pdu, header, sizeof(ENCOMSP_ORDER_HEADER)); if (Stream_GetRemainingLength(s) < 12) @@ -565,9 +563,9 @@ static UINT encomsp_recv_participant_removed_pdu(encomspPlugin* encomsp, } Stream_Read_UINT32(s, pdu.ParticipantId); /* ParticipantId (4 bytes) */ - Stream_Read_UINT32(s, pdu.DiscType); /* DiscType (4 bytes) */ - Stream_Read_UINT32(s, pdu.DiscCode); /* DiscCode (4 bytes) */ - end = (int) Stream_GetPosition(s); + Stream_Read_UINT32(s, pdu.DiscType); /* DiscType (4 bytes) */ + Stream_Read_UINT32(s, pdu.DiscCode); /* DiscCode (4 bytes) */ + end = (int)Stream_GetPosition(s); if ((beg + header->Length) < end) { @@ -589,7 +587,7 @@ static UINT encomsp_recv_participant_removed_pdu(encomspPlugin* encomsp, IFCALLRET(context->ParticipantRemoved, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->ParticipantRemoved failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context->ParticipantRemoved failed with error %" PRIu32 "", error); return error; } @@ -599,8 +597,8 @@ static UINT encomsp_recv_participant_removed_pdu(encomspPlugin* encomsp, * * @return 0 on success, otherwise a Win32 error code */ -static UINT encomsp_recv_change_participant_control_level_pdu( - encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) +static UINT encomsp_recv_change_participant_control_level_pdu(encomspPlugin* encomsp, wStream* s, + ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; @@ -611,7 +609,7 @@ static UINT encomsp_recv_change_participant_control_level_pdu( if (!context) return ERROR_INVALID_HANDLE; - beg = ((int) Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; + beg = ((int)Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; CopyMemory(&pdu, header, sizeof(ENCOMSP_ORDER_HEADER)); if (Stream_GetRemainingLength(s) < 6) @@ -620,9 +618,9 @@ static UINT encomsp_recv_change_participant_control_level_pdu( return ERROR_INVALID_DATA; } - Stream_Read_UINT16(s, pdu.Flags); /* Flags (2 bytes) */ + Stream_Read_UINT16(s, pdu.Flags); /* Flags (2 bytes) */ Stream_Read_UINT32(s, pdu.ParticipantId); /* ParticipantId (4 bytes) */ - end = (int) Stream_GetPosition(s); + end = (int)Stream_GetPosition(s); if ((beg + header->Length) < end) { @@ -644,7 +642,7 @@ static UINT encomsp_recv_change_participant_control_level_pdu( IFCALLRET(context->ChangeParticipantControlLevel, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->ChangeParticipantControlLevel failed with error %"PRIu32"", + WLog_ERR(TAG, "context->ChangeParticipantControlLevel failed with error %" PRIu32 "", error); return error; @@ -655,14 +653,14 @@ static UINT encomsp_recv_change_participant_control_level_pdu( * * @return 0 on success, otherwise a Win32 error code */ -static UINT encomsp_send_change_participant_control_level_pdu( - EncomspClientContext* context, - ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* pdu) +static UINT +encomsp_send_change_participant_control_level_pdu(EncomspClientContext* context, + ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* pdu) { wStream* s; encomspPlugin* encomsp; UINT error; - encomsp = (encomspPlugin*) context->handle; + encomsp = (encomspPlugin*)context->handle; pdu->Type = ODTYPE_PARTICIPANT_CTRL_CHANGED; pdu->Length = ENCOMSP_ORDER_HEADER_SIZE + 6; s = Stream_New(NULL, pdu->Length); @@ -673,13 +671,13 @@ static UINT encomsp_send_change_participant_control_level_pdu( return CHANNEL_RC_NO_MEMORY; } - if ((error = encomsp_write_header(s, (ENCOMSP_ORDER_HEADER*) pdu))) + if ((error = encomsp_write_header(s, (ENCOMSP_ORDER_HEADER*)pdu))) { - WLog_ERR(TAG, "encomsp_write_header failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "encomsp_write_header failed with error %" PRIu32 "!", error); return error; } - Stream_Write_UINT16(s, pdu->Flags); /* Flags (2 bytes) */ + Stream_Write_UINT16(s, pdu->Flags); /* Flags (2 bytes) */ Stream_Write_UINT32(s, pdu->ParticipantId); /* ParticipantId (4 bytes) */ Stream_SealLength(s); return encomsp_virtual_channel_write(encomsp, s); @@ -690,8 +688,8 @@ static UINT encomsp_send_change_participant_control_level_pdu( * * @return 0 on success, otherwise a Win32 error code */ -static UINT encomsp_recv_graphics_stream_paused_pdu(encomspPlugin* encomsp, - wStream* s, ENCOMSP_ORDER_HEADER* header) +static UINT encomsp_recv_graphics_stream_paused_pdu(encomspPlugin* encomsp, wStream* s, + ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; @@ -702,9 +700,9 @@ static UINT encomsp_recv_graphics_stream_paused_pdu(encomspPlugin* encomsp, if (!context) return ERROR_INVALID_HANDLE; - beg = ((int) Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; + beg = ((int)Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; CopyMemory(&pdu, header, sizeof(ENCOMSP_ORDER_HEADER)); - end = (int) Stream_GetPosition(s); + end = (int)Stream_GetPosition(s); if ((beg + header->Length) < end) { @@ -726,7 +724,7 @@ static UINT encomsp_recv_graphics_stream_paused_pdu(encomspPlugin* encomsp, IFCALLRET(context->GraphicsStreamPaused, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->GraphicsStreamPaused failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context->GraphicsStreamPaused failed with error %" PRIu32 "", error); return error; } @@ -736,8 +734,8 @@ static UINT encomsp_recv_graphics_stream_paused_pdu(encomspPlugin* encomsp, * * @return 0 on success, otherwise a Win32 error code */ -static UINT encomsp_recv_graphics_stream_resumed_pdu(encomspPlugin* encomsp, - wStream* s, ENCOMSP_ORDER_HEADER* header) +static UINT encomsp_recv_graphics_stream_resumed_pdu(encomspPlugin* encomsp, wStream* s, + ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; @@ -748,9 +746,9 @@ static UINT encomsp_recv_graphics_stream_resumed_pdu(encomspPlugin* encomsp, if (!context) return ERROR_INVALID_HANDLE; - beg = ((int) Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; + beg = ((int)Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; CopyMemory(&pdu, header, sizeof(ENCOMSP_ORDER_HEADER)); - end = (int) Stream_GetPosition(s); + end = (int)Stream_GetPosition(s); if ((beg + header->Length) < end) { @@ -772,7 +770,7 @@ static UINT encomsp_recv_graphics_stream_resumed_pdu(encomspPlugin* encomsp, IFCALLRET(context->GraphicsStreamResumed, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->GraphicsStreamResumed failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context->GraphicsStreamResumed failed with error %" PRIu32 "", error); return error; } @@ -791,18 +789,20 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) { if ((error = encomsp_read_header(s, &header))) { - WLog_ERR(TAG, "encomsp_read_header failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "encomsp_read_header failed with error %" PRIu32 "!", error); return error; } - //WLog_DBG(TAG, "EncomspReceive: Type: %"PRIu16" Length: %"PRIu16"", header.Type, header.Length); + // WLog_DBG(TAG, "EncomspReceive: Type: %"PRIu16" Length: %"PRIu16"", header.Type, + // header.Length); switch (header.Type) { case ODTYPE_FILTER_STATE_UPDATED: if ((error = encomsp_recv_filter_updated_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_filter_updated_pdu failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "encomsp_recv_filter_updated_pdu failed with error %" PRIu32 "!", + error); return error; } @@ -811,7 +811,8 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) case ODTYPE_APP_REMOVED: if ((error = encomsp_recv_application_removed_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_application_removed_pdu failed with error %"PRIu32"!", + WLog_ERR(TAG, + "encomsp_recv_application_removed_pdu failed with error %" PRIu32 "!", error); return error; } @@ -821,7 +822,8 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) case ODTYPE_APP_CREATED: if ((error = encomsp_recv_application_created_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_application_removed_pdu failed with error %"PRIu32"!", + WLog_ERR(TAG, + "encomsp_recv_application_removed_pdu failed with error %" PRIu32 "!", error); return error; } @@ -831,7 +833,8 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) case ODTYPE_WND_REMOVED: if ((error = encomsp_recv_window_removed_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_window_removed_pdu failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "encomsp_recv_window_removed_pdu failed with error %" PRIu32 "!", + error); return error; } @@ -840,7 +843,8 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) case ODTYPE_WND_CREATED: if ((error = encomsp_recv_window_created_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_window_created_pdu failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "encomsp_recv_window_created_pdu failed with error %" PRIu32 "!", + error); return error; } @@ -849,7 +853,8 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) case ODTYPE_WND_SHOW: if ((error = encomsp_recv_show_window_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_show_window_pdu failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "encomsp_recv_show_window_pdu failed with error %" PRIu32 "!", + error); return error; } @@ -858,7 +863,8 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) case ODTYPE_PARTICIPANT_REMOVED: if ((error = encomsp_recv_participant_removed_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_participant_removed_pdu failed with error %"PRIu32"!", + WLog_ERR(TAG, + "encomsp_recv_participant_removed_pdu failed with error %" PRIu32 "!", error); return error; } @@ -868,7 +874,8 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) case ODTYPE_PARTICIPANT_CREATED: if ((error = encomsp_recv_participant_created_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_participant_created_pdu failed with error %"PRIu32"!", + WLog_ERR(TAG, + "encomsp_recv_participant_created_pdu failed with error %" PRIu32 "!", error); return error; } @@ -876,11 +883,12 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) break; case ODTYPE_PARTICIPANT_CTRL_CHANGED: - if ((error = encomsp_recv_change_participant_control_level_pdu(encomsp, s, - &header))) + if ((error = + encomsp_recv_change_participant_control_level_pdu(encomsp, s, &header))) { WLog_ERR(TAG, - "encomsp_recv_change_participant_control_level_pdu failed with error %"PRIu32"!", + "encomsp_recv_change_participant_control_level_pdu failed with error " + "%" PRIu32 "!", error); return error; } @@ -890,7 +898,9 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) case ODTYPE_GRAPHICS_STREAM_PAUSED: if ((error = encomsp_recv_graphics_stream_paused_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_graphics_stream_paused_pdu failed with error %"PRIu32"!", + WLog_ERR(TAG, + "encomsp_recv_graphics_stream_paused_pdu failed with error %" PRIu32 + "!", error); return error; } @@ -900,7 +910,9 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) case ODTYPE_GRAPHICS_STREAM_RESUMED: if ((error = encomsp_recv_graphics_stream_resumed_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_graphics_stream_resumed_pdu failed with error %"PRIu32"!", + WLog_ERR(TAG, + "encomsp_recv_graphics_stream_resumed_pdu failed with error %" PRIu32 + "!", error); return error; } @@ -908,7 +920,7 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) break; default: - WLog_ERR(TAG, "header.Type %"PRIu16" not found", header.Type); + WLog_ERR(TAG, "header.Type %" PRIu16 " not found", header.Type); return ERROR_INVALID_DATA; break; } @@ -926,8 +938,9 @@ static void encomsp_process_connect(encomspPlugin* encomsp) * * @return 0 on success, otherwise a Win32 error code */ -static UINT encomsp_virtual_channel_event_data_received(encomspPlugin* encomsp, - void* pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) +static UINT encomsp_virtual_channel_event_data_received(encomspPlugin* encomsp, void* pData, + UINT32 dataLength, UINT32 totalLength, + UINT32 dataFlags) { wStream* data_in; @@ -950,7 +963,7 @@ static UINT encomsp_virtual_channel_event_data_received(encomspPlugin* encomsp, data_in = encomsp->data_in; - if (!Stream_EnsureRemainingCapacity(data_in, (int) dataLength)) + if (!Stream_EnsureRemainingCapacity(data_in, (int)dataLength)) { WLog_ERR(TAG, "Stream_EnsureRemainingCapacity failed!"); return ERROR_INTERNAL_ERROR; @@ -962,7 +975,7 @@ static UINT encomsp_virtual_channel_event_data_received(encomspPlugin* encomsp, { if (Stream_Capacity(data_in) != Stream_GetPosition(data_in)) { - WLog_ERR(TAG, "encomsp_plugin_process_received: read error"); + WLog_ERR(TAG, "encomsp_plugin_process_received: read error"); return ERROR_INVALID_DATA; } @@ -970,7 +983,7 @@ static UINT encomsp_virtual_channel_event_data_received(encomspPlugin* encomsp, Stream_SealLength(data_in); Stream_SetPosition(data_in, 0); - if (!MessageQueue_Post(encomsp->queue, NULL, 0, (void*) data_in, NULL)) + if (!MessageQueue_Post(encomsp->queue, NULL, 0, (void*)data_in, NULL)) { WLog_ERR(TAG, "MessageQueue_Post failed!"); return ERROR_INTERNAL_ERROR; @@ -981,24 +994,28 @@ static UINT encomsp_virtual_channel_event_data_received(encomspPlugin* encomsp, } static VOID VCAPITYPE encomsp_virtual_channel_open_event_ex(LPVOID lpUserParam, DWORD openHandle, - UINT event, - LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) + UINT event, LPVOID pData, + UINT32 dataLength, UINT32 totalLength, + UINT32 dataFlags) { UINT error = CHANNEL_RC_OK; - encomspPlugin* encomsp = (encomspPlugin*) lpUserParam; + encomspPlugin* encomsp = (encomspPlugin*)lpUserParam; if (!encomsp || (encomsp->OpenHandle != openHandle)) { - WLog_ERR(TAG, "error no match"); + WLog_ERR(TAG, "error no match"); return; } switch (event) { case CHANNEL_EVENT_DATA_RECEIVED: - if ((error = encomsp_virtual_channel_event_data_received(encomsp, pData, - dataLength, totalLength, dataFlags))) - WLog_ERR(TAG, "encomsp_virtual_channel_event_data_received failed with error %"PRIu32"", error); + if ((error = encomsp_virtual_channel_event_data_received(encomsp, pData, dataLength, + totalLength, dataFlags))) + WLog_ERR(TAG, + "encomsp_virtual_channel_event_data_received failed with error %" PRIu32 + "", + error); break; @@ -1008,14 +1025,15 @@ static VOID VCAPITYPE encomsp_virtual_channel_open_event_ex(LPVOID lpUserParam, wStream* s = (wStream*)pData; Stream_Free(s, TRUE); } - break; + break; case CHANNEL_EVENT_USER: break; } if (error && encomsp->rdpcontext) - setChannelError(encomsp->rdpcontext, error, "encomsp_virtual_channel_open_event reported an error"); + setChannelError(encomsp->rdpcontext, error, + "encomsp_virtual_channel_open_event reported an error"); return; } @@ -1024,7 +1042,7 @@ static DWORD WINAPI encomsp_virtual_channel_client_thread(LPVOID arg) { wStream* data; wMessage message; - encomspPlugin* encomsp = (encomspPlugin*) arg; + encomspPlugin* encomsp = (encomspPlugin*)arg; UINT error = CHANNEL_RC_OK; encomsp_process_connect(encomsp); @@ -1049,11 +1067,11 @@ static DWORD WINAPI encomsp_virtual_channel_client_thread(LPVOID arg) if (message.id == 0) { - data = (wStream*) message.wParam; + data = (wStream*)message.wParam; if ((error = encomsp_process_receive(encomsp, data))) { - WLog_ERR(TAG, "encomsp_process_receive failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "encomsp_process_receive failed with error %" PRIu32 "!", error); break; } } @@ -1072,17 +1090,17 @@ static DWORD WINAPI encomsp_virtual_channel_client_thread(LPVOID arg) * * @return 0 on success, otherwise a Win32 error code */ -static UINT encomsp_virtual_channel_event_connected(encomspPlugin* encomsp, - LPVOID pData, UINT32 dataLength) +static UINT encomsp_virtual_channel_event_connected(encomspPlugin* encomsp, LPVOID pData, + UINT32 dataLength) { UINT32 status; - status = encomsp->channelEntryPoints.pVirtualChannelOpenEx(encomsp->InitHandle, - &encomsp->OpenHandle, encomsp->channelDef.name, - encomsp_virtual_channel_open_event_ex); + status = encomsp->channelEntryPoints.pVirtualChannelOpenEx( + encomsp->InitHandle, &encomsp->OpenHandle, encomsp->channelDef.name, + encomsp_virtual_channel_open_event_ex); if (status != CHANNEL_RC_OK) { - WLog_ERR(TAG, "pVirtualChannelOpen failed with %s [%08"PRIX32"]", + WLog_ERR(TAG, "pVirtualChannelOpen failed with %s [%08" PRIX32 "]", WTSErrorToString(status), status); return status; } @@ -1095,9 +1113,8 @@ static UINT encomsp_virtual_channel_event_connected(encomspPlugin* encomsp, return CHANNEL_RC_NO_MEMORY; } - if (!(encomsp->thread = CreateThread(NULL, 0, - encomsp_virtual_channel_client_thread, (void*) encomsp, - 0, NULL))) + if (!(encomsp->thread = CreateThread(NULL, 0, encomsp_virtual_channel_client_thread, + (void*)encomsp, 0, NULL))) { WLog_ERR(TAG, "CreateThread failed!"); MessageQueue_Free(encomsp->queue); @@ -1119,11 +1136,11 @@ static UINT encomsp_virtual_channel_event_disconnected(encomspPlugin* encomsp) if (encomsp->OpenHandle == 0) return CHANNEL_RC_OK; - if (MessageQueue_PostQuit(encomsp->queue, 0) - && (WaitForSingleObject(encomsp->thread, INFINITE) == WAIT_FAILED)) + if (MessageQueue_PostQuit(encomsp->queue, 0) && + (WaitForSingleObject(encomsp->thread, INFINITE) == WAIT_FAILED)) { rc = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", rc); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", rc); return rc; } @@ -1131,12 +1148,13 @@ static UINT encomsp_virtual_channel_event_disconnected(encomspPlugin* encomsp) CloseHandle(encomsp->thread); encomsp->queue = NULL; encomsp->thread = NULL; - rc = encomsp->channelEntryPoints.pVirtualChannelCloseEx(encomsp->InitHandle, encomsp->OpenHandle); + rc = encomsp->channelEntryPoints.pVirtualChannelCloseEx(encomsp->InitHandle, + encomsp->OpenHandle); if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "pVirtualChannelClose failed with %s [%08"PRIX32"]", - WTSErrorToString(rc), rc); + WLog_ERR(TAG, "pVirtualChannelClose failed with %s [%08" PRIX32 "]", WTSErrorToString(rc), + rc); return rc; } @@ -1151,7 +1169,6 @@ static UINT encomsp_virtual_channel_event_disconnected(encomspPlugin* encomsp) return CHANNEL_RC_OK; } - /** * Function description * @@ -1166,23 +1183,24 @@ static UINT encomsp_virtual_channel_event_terminated(encomspPlugin* encomsp) } static VOID VCAPITYPE encomsp_virtual_channel_init_event_ex(LPVOID lpUserParam, LPVOID pInitHandle, - UINT event, LPVOID pData, UINT dataLength) + UINT event, LPVOID pData, + UINT dataLength) { UINT error = CHANNEL_RC_OK; - encomspPlugin* encomsp = (encomspPlugin*) lpUserParam; + encomspPlugin* encomsp = (encomspPlugin*)lpUserParam; if (!encomsp || (encomsp->InitHandle != pInitHandle)) { - WLog_ERR(TAG, "error no match"); + WLog_ERR(TAG, "error no match"); return; } switch (event) { case CHANNEL_EVENT_CONNECTED: - if ((error = encomsp_virtual_channel_event_connected(encomsp, pData, - dataLength))) - WLog_ERR(TAG, "encomsp_virtual_channel_event_connected failed with error %"PRIu32"", + if ((error = encomsp_virtual_channel_event_connected(encomsp, pData, dataLength))) + WLog_ERR(TAG, + "encomsp_virtual_channel_event_connected failed with error %" PRIu32 "", error); break; @@ -1190,7 +1208,8 @@ static VOID VCAPITYPE encomsp_virtual_channel_init_event_ex(LPVOID lpUserParam, case CHANNEL_EVENT_DISCONNECTED: if ((error = encomsp_virtual_channel_event_disconnected(encomsp))) WLog_ERR(TAG, - "encomsp_virtual_channel_event_disconnected failed with error %"PRIu32"", error); + "encomsp_virtual_channel_event_disconnected failed with error %" PRIu32 "", + error); break; @@ -1199,15 +1218,16 @@ static VOID VCAPITYPE encomsp_virtual_channel_init_event_ex(LPVOID lpUserParam, break; default: - WLog_ERR(TAG, "Unhandled event type %"PRIu32"", event); + WLog_ERR(TAG, "Unhandled event type %" PRIu32 "", event); } if (error && encomsp->rdpcontext) - setChannelError(encomsp->rdpcontext, error, "encomsp_virtual_channel_init_event reported an error"); + setChannelError(encomsp->rdpcontext, error, + "encomsp_virtual_channel_init_event reported an error"); } /* encomsp is always built-in */ -#define VirtualChannelEntryEx encomsp_VirtualChannelEntryEx +#define VirtualChannelEntryEx encomsp_VirtualChannelEntryEx BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS_EX pEntryPoints, PVOID pInitHandle) { @@ -1216,7 +1236,7 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS_EX pEntryPoints, PVOI EncomspClientContext* context = NULL; CHANNEL_ENTRY_POINTS_FREERDP_EX* pEntryPointsEx; BOOL isFreerdp = FALSE; - encomsp = (encomspPlugin*) calloc(1, sizeof(encomspPlugin)); + encomsp = (encomspPlugin*)calloc(1, sizeof(encomspPlugin)); if (!encomsp) { @@ -1224,18 +1244,15 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS_EX pEntryPoints, PVOI return FALSE; } - encomsp->channelDef.options = - CHANNEL_OPTION_INITIALIZED | - CHANNEL_OPTION_ENCRYPT_RDP | - CHANNEL_OPTION_COMPRESS_RDP | - CHANNEL_OPTION_SHOW_PROTOCOL; + encomsp->channelDef.options = CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP | + CHANNEL_OPTION_COMPRESS_RDP | CHANNEL_OPTION_SHOW_PROTOCOL; sprintf_s(encomsp->channelDef.name, ARRAYSIZE(encomsp->channelDef.name), "encomsp"); - pEntryPointsEx = (CHANNEL_ENTRY_POINTS_FREERDP_EX*) pEntryPoints; + pEntryPointsEx = (CHANNEL_ENTRY_POINTS_FREERDP_EX*)pEntryPoints; if ((pEntryPointsEx->cbSize >= sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX)) && (pEntryPointsEx->MagicNumber == FREERDP_CHANNEL_MAGIC_NUMBER)) { - context = (EncomspClientContext*) calloc(1, sizeof(EncomspClientContext)); + context = (EncomspClientContext*)calloc(1, sizeof(EncomspClientContext)); if (!context) { @@ -1243,7 +1260,7 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS_EX pEntryPoints, PVOI goto error_out; } - context->handle = (void*) encomsp; + context->handle = (void*)encomsp; context->FilterUpdated = NULL; context->ApplicationCreated = NULL; context->ApplicationRemoved = NULL; @@ -1252,8 +1269,7 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS_EX pEntryPoints, PVOI context->ShowWindow = NULL; context->ParticipantCreated = NULL; context->ParticipantRemoved = NULL; - context->ChangeParticipantControlLevel = - encomsp_send_change_participant_control_level_pdu; + context->ChangeParticipantControlLevel = encomsp_send_change_participant_control_level_pdu; context->GraphicsStreamPaused = NULL; context->GraphicsStreamResumed = NULL; encomsp->context = context; @@ -1264,14 +1280,13 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS_EX pEntryPoints, PVOI CopyMemory(&(encomsp->channelEntryPoints), pEntryPoints, sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX)); encomsp->InitHandle = pInitHandle; - rc = encomsp->channelEntryPoints.pVirtualChannelInitEx(encomsp, context, pInitHandle, - &encomsp->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000, - encomsp_virtual_channel_init_event_ex); + rc = encomsp->channelEntryPoints.pVirtualChannelInitEx( + encomsp, context, pInitHandle, &encomsp->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000, + encomsp_virtual_channel_init_event_ex); if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "failed with %s [%08"PRIX32"]", - WTSErrorToString(rc), rc); + WLog_ERR(TAG, "failed with %s [%08" PRIX32 "]", WTSErrorToString(rc), rc); goto error_out; } diff --git a/channels/encomsp/server/encomsp_main.c b/channels/encomsp/server/encomsp_main.c index 0d3e3e7cd..9b1693bbb 100644 --- a/channels/encomsp/server/encomsp_main.c +++ b/channels/encomsp/server/encomsp_main.c @@ -43,7 +43,7 @@ static UINT encomsp_read_header(wStream* s, ENCOMSP_ORDER_HEADER* header) if (Stream_GetRemainingLength(s) < ENCOMSP_ORDER_HEADER_SIZE) return ERROR_INVALID_DATA; - Stream_Read_UINT16(s, header->Type); /* Type (2 bytes) */ + Stream_Read_UINT16(s, header->Type); /* Type (2 bytes) */ Stream_Read_UINT16(s, header->Length); /* Length (2 bytes) */ return CHANNEL_RC_OK; } @@ -83,13 +83,14 @@ static int encomsp_read_unicode_string(wStream* s, ENCOMSP_UNICODE_STRING* str) * * @return 0 on success, otherwise a Win32 error code */ -static UINT encomsp_recv_change_participant_control_level_pdu( - EncomspServerContext* context, wStream* s, ENCOMSP_ORDER_HEADER* header) +static UINT encomsp_recv_change_participant_control_level_pdu(EncomspServerContext* context, + wStream* s, + ENCOMSP_ORDER_HEADER* header) { int beg, end; ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU pdu; UINT error = CHANNEL_RC_OK; - beg = ((int) Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; + beg = ((int)Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; CopyMemory(&pdu, header, sizeof(ENCOMSP_ORDER_HEADER)); if (Stream_GetRemainingLength(s) < 6) @@ -98,9 +99,9 @@ static UINT encomsp_recv_change_participant_control_level_pdu( return ERROR_INVALID_DATA; } - Stream_Read_UINT16(s, pdu.Flags); /* Flags (2 bytes) */ + Stream_Read_UINT16(s, pdu.Flags); /* Flags (2 bytes) */ Stream_Read_UINT32(s, pdu.ParticipantId); /* ParticipantId (4 bytes) */ - end = (int) Stream_GetPosition(s); + end = (int)Stream_GetPosition(s); if ((beg + header->Length) < end) { @@ -122,7 +123,7 @@ static UINT encomsp_recv_change_participant_control_level_pdu( IFCALLRET(context->ChangeParticipantControlLevel, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->ChangeParticipantControlLevel failed with error %"PRIu32"", + WLog_ERR(TAG, "context->ChangeParticipantControlLevel failed with error %" PRIu32 "", error); return error; @@ -133,8 +134,7 @@ static UINT encomsp_recv_change_participant_control_level_pdu( * * @return 0 on success, otherwise a Win32 error code */ -static UINT encomsp_server_receive_pdu(EncomspServerContext* context, - wStream* s) +static UINT encomsp_server_receive_pdu(EncomspServerContext* context, wStream* s) { UINT error = CHANNEL_RC_OK; ENCOMSP_ORDER_HEADER header; @@ -143,21 +143,22 @@ static UINT encomsp_server_receive_pdu(EncomspServerContext* context, { if ((error = encomsp_read_header(s, &header))) { - WLog_ERR(TAG, "encomsp_read_header failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "encomsp_read_header failed with error %" PRIu32 "!", error); return error; } - WLog_INFO(TAG, "EncomspReceive: Type: %"PRIu16" Length: %"PRIu16"", header.Type, + WLog_INFO(TAG, "EncomspReceive: Type: %" PRIu16 " Length: %" PRIu16 "", header.Type, header.Length); switch (header.Type) { case ODTYPE_PARTICIPANT_CTRL_CHANGED: - if ((error = encomsp_recv_change_participant_control_level_pdu(context, s, - &header))) + if ((error = + encomsp_recv_change_participant_control_level_pdu(context, s, &header))) { WLog_ERR(TAG, - "encomsp_recv_change_participant_control_level_pdu failed with error %"PRIu32"!", + "encomsp_recv_change_participant_control_level_pdu failed with error " + "%" PRIu32 "!", error); return error; } @@ -165,7 +166,7 @@ static UINT encomsp_server_receive_pdu(EncomspServerContext* context, break; default: - WLog_ERR(TAG, "header.Type unknown %"PRIu16"!", header.Type); + WLog_ERR(TAG, "header.Type unknown %" PRIu16 "!", header.Type); return ERROR_INVALID_DATA; break; } @@ -186,7 +187,7 @@ static DWORD WINAPI encomsp_server_thread(LPVOID arg) EncomspServerContext* context; UINT error = CHANNEL_RC_OK; DWORD status; - context = (EncomspServerContext*) arg; + context = (EncomspServerContext*)arg; buffer = NULL; BytesReturned = 0; @@ -200,8 +201,8 @@ static DWORD WINAPI encomsp_server_thread(LPVOID arg) goto out; } - if (WTSVirtualChannelQuery(context->priv->ChannelHandle, WTSVirtualEventHandle, - &buffer, &BytesReturned) == TRUE) + if (WTSVirtualChannelQuery(context->priv->ChannelHandle, WTSVirtualEventHandle, &buffer, + &BytesReturned) == TRUE) { if (BytesReturned == sizeof(HANDLE)) CopyMemory(&ChannelEvent, buffer, sizeof(HANDLE)); @@ -220,7 +221,7 @@ static DWORD WINAPI encomsp_server_thread(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "", error); break; } @@ -229,7 +230,7 @@ static DWORD WINAPI encomsp_server_thread(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", error); break; } @@ -250,8 +251,8 @@ static DWORD WINAPI encomsp_server_thread(LPVOID arg) break; } - if (!WTSVirtualChannelRead(context->priv->ChannelHandle, 0, - (PCHAR) Stream_Buffer(s), Stream_Capacity(s), &BytesReturned)) + if (!WTSVirtualChannelRead(context->priv->ChannelHandle, 0, (PCHAR)Stream_Buffer(s), + Stream_Capacity(s), &BytesReturned)) { WLog_ERR(TAG, "WTSVirtualChannelRead failed!"); error = ERROR_INTERNAL_ERROR; @@ -260,7 +261,7 @@ static DWORD WINAPI encomsp_server_thread(LPVOID arg) if (Stream_GetPosition(s) >= ENCOMSP_ORDER_HEADER_SIZE) { - header = (ENCOMSP_ORDER_HEADER*) Stream_Buffer(s); + header = (ENCOMSP_ORDER_HEADER*)Stream_Buffer(s); if (header->Length >= Stream_GetPosition(s)) { @@ -269,7 +270,8 @@ static DWORD WINAPI encomsp_server_thread(LPVOID arg) if ((error = encomsp_server_receive_pdu(context, s))) { - WLog_ERR(TAG, "encomsp_server_receive_pdu failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "encomsp_server_receive_pdu failed with error %" PRIu32 "!", + error); break; } @@ -282,8 +284,7 @@ static DWORD WINAPI encomsp_server_thread(LPVOID arg) out: if (error && context->rdpcontext) - setChannelError(context->rdpcontext, error, - "encomsp_server_thread reported an error"); + setChannelError(context->rdpcontext, error, "encomsp_server_thread reported an error"); ExitThread(error); return error; @@ -296,8 +297,8 @@ out: */ static UINT encomsp_server_start(EncomspServerContext* context) { - context->priv->ChannelHandle = WTSVirtualChannelOpen(context->vcm, - WTS_CURRENT_SESSION, "encomsp"); + context->priv->ChannelHandle = + WTSVirtualChannelOpen(context->vcm, WTS_CURRENT_SESSION, "encomsp"); if (!context->priv->ChannelHandle) return CHANNEL_RC_BAD_CHANNEL; @@ -308,8 +309,8 @@ static UINT encomsp_server_start(EncomspServerContext* context) return ERROR_INTERNAL_ERROR; } - if (!(context->priv->Thread = CreateThread(NULL, 0, - encomsp_server_thread, (void*) context, 0, NULL))) + if (!(context->priv->Thread = + CreateThread(NULL, 0, encomsp_server_thread, (void*)context, 0, NULL))) { WLog_ERR(TAG, "CreateThread failed!"); CloseHandle(context->priv->StopEvent); @@ -333,7 +334,7 @@ static UINT encomsp_server_stop(EncomspServerContext* context) if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", error); return error; } @@ -345,14 +346,14 @@ static UINT encomsp_server_stop(EncomspServerContext* context) EncomspServerContext* encomsp_server_context_new(HANDLE vcm) { EncomspServerContext* context; - context = (EncomspServerContext*) calloc(1, sizeof(EncomspServerContext)); + context = (EncomspServerContext*)calloc(1, sizeof(EncomspServerContext)); if (context) { context->vcm = vcm; context->Start = encomsp_server_start; context->Stop = encomsp_server_stop; - context->priv = (EncomspServerPrivate*) calloc(1, sizeof(EncomspServerPrivate)); + context->priv = (EncomspServerPrivate*)calloc(1, sizeof(EncomspServerPrivate)); if (!context->priv) { @@ -371,7 +372,7 @@ void encomsp_server_context_free(EncomspServerContext* context) { if (context->priv->ChannelHandle != INVALID_HANDLE_VALUE) WTSVirtualChannelClose(context->priv->ChannelHandle); - + free(context->priv); free(context); } diff --git a/channels/geometry/client/geometry_main.c b/channels/geometry/client/geometry_main.c index 94671bb19..eb7b33864 100644 --- a/channels/geometry/client/geometry_main.c +++ b/channels/geometry/client/geometry_main.c @@ -72,23 +72,22 @@ struct _GEOMETRY_PLUGIN }; typedef struct _GEOMETRY_PLUGIN GEOMETRY_PLUGIN; - -static UINT32 mappedGeometryHash(UINT64 *g) +static UINT32 mappedGeometryHash(UINT64* g) { return (UINT32)((*g >> 32) + (*g & 0xffffffff)); } -static BOOL mappedGeometryKeyCompare(UINT64 *g1, UINT64 *g2) +static BOOL mappedGeometryKeyCompare(UINT64* g1, UINT64* g2) { return *g1 == *g2; } -void mappedGeometryRef(MAPPED_GEOMETRY *g) +void mappedGeometryRef(MAPPED_GEOMETRY* g) { InterlockedIncrement(&g->refCounter); } -void mappedGeometryUnref(MAPPED_GEOMETRY *g) +void mappedGeometryUnref(MAPPED_GEOMETRY* g) { if (InterlockedDecrement(&g->refCounter)) return; @@ -100,13 +99,12 @@ void mappedGeometryUnref(MAPPED_GEOMETRY *g) free(g); } - -void freerdp_rgndata_reset(FREERDP_RGNDATA *data) +void freerdp_rgndata_reset(FREERDP_RGNDATA* data) { data->nRectCount = 0; } -static UINT32 geometry_read_RGNDATA(wStream *s, UINT32 len, FREERDP_RGNDATA *rgndata) +static UINT32 geometry_read_RGNDATA(wStream* s, UINT32 len, FREERDP_RGNDATA* rgndata) { UINT32 dwSize, iType; INT32 right, bottom; @@ -130,7 +128,7 @@ static UINT32 geometry_read_RGNDATA(wStream *s, UINT32 len, FREERDP_RGNDATA *rgn if (iType != RDH_RECTANGLE) { - WLog_ERR(TAG, "iType %"PRIu32" for RGNDATA is not supported", iType); + WLog_ERR(TAG, "iType %" PRIu32 " for RGNDATA is not supported", iType); return ERROR_UNSUPPORTED_TYPE; } @@ -160,11 +158,11 @@ static UINT32 geometry_read_RGNDATA(wStream *s, UINT32 len, FREERDP_RGNDATA *rgn if (rgndata->nRectCount) { UINT32 i; - RDP_RECT *tmp = realloc(rgndata->rects, rgndata->nRectCount * sizeof(RDP_RECT)); + RDP_RECT* tmp = realloc(rgndata->rects, rgndata->nRectCount * sizeof(RDP_RECT)); if (!tmp) { - WLog_ERR(TAG, "unable to allocate memory for %"PRIu32" RECTs", rgndata->nRectCount); + WLog_ERR(TAG, "unable to allocate memory for %" PRIu32 " RECTs", rgndata->nRectCount); return CHANNEL_RC_NO_MEMORY; } rgndata->rects = tmp; @@ -199,14 +197,14 @@ static UINT32 geometry_read_RGNDATA(wStream *s, UINT32 len, FREERDP_RGNDATA *rgn static UINT geometry_recv_pdu(GEOMETRY_CHANNEL_CALLBACK* callback, wStream* s) { UINT32 length, cbGeometryBuffer; - MAPPED_GEOMETRY *mappedGeometry; + MAPPED_GEOMETRY* mappedGeometry; GEOMETRY_PLUGIN* geometry; - GeometryClientContext *context; + GeometryClientContext* context; UINT ret = CHANNEL_RC_OK; UINT32 version, updateType, geometryType; UINT64 id; - geometry = (GEOMETRY_PLUGIN*) callback->plugin; + geometry = (GEOMETRY_PLUGIN*)callback->plugin; context = (GeometryClientContext*)geometry->iface.pInterface; if (Stream_GetRemainingLength(s) < 4) @@ -230,17 +228,18 @@ static UINT geometry_recv_pdu(GEOMETRY_CHANNEL_CALLBACK* callback, wStream* s) mappedGeometry = HashTable_GetItemValue(context->geometries, &id); - if (updateType == GEOMETRY_CLEAR ) + if (updateType == GEOMETRY_CLEAR) { if (!mappedGeometry) { - WLog_ERR(TAG, "geometry 0x%"PRIx64" not found here, ignoring clear command", id); + WLog_ERR(TAG, "geometry 0x%" PRIx64 " not found here, ignoring clear command", id); return CHANNEL_RC_OK; } - WLog_DBG(TAG, "clearing geometry 0x%"PRIx64"", id); + WLog_DBG(TAG, "clearing geometry 0x%" PRIx64 "", id); - if (mappedGeometry->MappedGeometryClear && !mappedGeometry->MappedGeometryClear(mappedGeometry)) + if (mappedGeometry->MappedGeometryClear && + !mappedGeometry->MappedGeometryClear(mappedGeometry)) return ERROR_INTERNAL_ERROR; if (!HashTable_Remove(context->geometries, &id)) @@ -253,7 +252,7 @@ static UINT geometry_recv_pdu(GEOMETRY_CHANNEL_CALLBACK* callback, wStream* s) if (!mappedGeometry) { newOne = TRUE; - WLog_DBG(TAG, "creating geometry 0x%"PRIx64"", id); + WLog_DBG(TAG, "creating geometry 0x%" PRIx64 "", id); mappedGeometry = calloc(1, sizeof(MAPPED_GEOMETRY)); if (!mappedGeometry) return CHANNEL_RC_NO_MEMORY; @@ -261,16 +260,17 @@ static UINT geometry_recv_pdu(GEOMETRY_CHANNEL_CALLBACK* callback, wStream* s) mappedGeometry->refCounter = 1; mappedGeometry->mappingId = id; - if (HashTable_Add(context->geometries, &(mappedGeometry->mappingId), mappedGeometry) < 0) + if (HashTable_Add(context->geometries, &(mappedGeometry->mappingId), mappedGeometry) < + 0) { - WLog_ERR(TAG, "unable to register geometry 0x%"PRIx64" in the table", id); + WLog_ERR(TAG, "unable to register geometry 0x%" PRIx64 " in the table", id); free(mappedGeometry); return CHANNEL_RC_NO_MEMORY; } } else { - WLog_DBG(TAG, "updating geometry 0x%"PRIx64"", id); + WLog_DBG(TAG, "updating geometry 0x%" PRIx64 "", id); } Stream_Read_UINT64(s, mappedGeometry->topLevelId); @@ -307,7 +307,8 @@ static UINT geometry_recv_pdu(GEOMETRY_CHANNEL_CALLBACK* callback, wStream* s) if (newOne) { - if (context->MappedGeometryAdded && !context->MappedGeometryAdded(context, mappedGeometry)) + if (context->MappedGeometryAdded && + !context->MappedGeometryAdded(context, mappedGeometry)) { WLog_ERR(TAG, "geometry added callback failed"); ret = ERROR_INTERNAL_ERROR; @@ -315,7 +316,8 @@ static UINT geometry_recv_pdu(GEOMETRY_CHANNEL_CALLBACK* callback, wStream* s) } else { - if (mappedGeometry->MappedGeometryUpdate && !mappedGeometry->MappedGeometryUpdate(mappedGeometry)) + if (mappedGeometry->MappedGeometryUpdate && + !mappedGeometry->MappedGeometryUpdate(mappedGeometry)) { WLog_ERR(TAG, "geometry update callback failed"); ret = ERROR_INTERNAL_ERROR; @@ -324,11 +326,10 @@ static UINT geometry_recv_pdu(GEOMETRY_CHANNEL_CALLBACK* callback, wStream* s) } else { - WLog_ERR(TAG, "unknown updateType=%"PRIu32"", updateType); + WLog_ERR(TAG, "unknown updateType=%" PRIu32 "", updateType); ret = CHANNEL_RC_OK; } - return ret; } @@ -339,7 +340,7 @@ static UINT geometry_recv_pdu(GEOMETRY_CHANNEL_CALLBACK* callback, wStream* s) */ static UINT geometry_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream* data) { - GEOMETRY_CHANNEL_CALLBACK* callback = (GEOMETRY_CHANNEL_CALLBACK*) pChannelCallback; + GEOMETRY_CHANNEL_CALLBACK* callback = (GEOMETRY_CHANNEL_CALLBACK*)pChannelCallback; return geometry_recv_pdu(callback, data); } @@ -360,16 +361,17 @@ static UINT geometry_on_close(IWTSVirtualChannelCallback* pChannelCallback) * @return 0 on success, otherwise a Win32 error code */ static UINT geometry_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, - IWTSVirtualChannel* pChannel, BYTE* Data, BOOL* pbAccept, - IWTSVirtualChannelCallback** ppCallback) + IWTSVirtualChannel* pChannel, BYTE* Data, + BOOL* pbAccept, + IWTSVirtualChannelCallback** ppCallback) { GEOMETRY_CHANNEL_CALLBACK* callback; - GEOMETRY_LISTENER_CALLBACK* listener_callback = (GEOMETRY_LISTENER_CALLBACK*) pListenerCallback; + GEOMETRY_LISTENER_CALLBACK* listener_callback = (GEOMETRY_LISTENER_CALLBACK*)pListenerCallback; WINPR_UNUSED(Data); WINPR_UNUSED(pbAccept); - callback = (GEOMETRY_CHANNEL_CALLBACK*) calloc(1, sizeof(GEOMETRY_CHANNEL_CALLBACK)); + callback = (GEOMETRY_CHANNEL_CALLBACK*)calloc(1, sizeof(GEOMETRY_CHANNEL_CALLBACK)); if (!callback) { @@ -383,7 +385,7 @@ static UINT geometry_on_new_channel_connection(IWTSListenerCallback* pListenerCa callback->channel_mgr = listener_callback->channel_mgr; callback->channel = pChannel; listener_callback->channel_callback = callback; - *ppCallback = (IWTSVirtualChannelCallback*) callback; + *ppCallback = (IWTSVirtualChannelCallback*)callback; return CHANNEL_RC_OK; } @@ -395,9 +397,9 @@ static UINT geometry_on_new_channel_connection(IWTSListenerCallback* pListenerCa static UINT geometry_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) { UINT status; - GEOMETRY_PLUGIN* geometry = (GEOMETRY_PLUGIN*) pPlugin; - geometry->listener_callback = (GEOMETRY_LISTENER_CALLBACK*) calloc(1, - sizeof(GEOMETRY_LISTENER_CALLBACK)); + GEOMETRY_PLUGIN* geometry = (GEOMETRY_PLUGIN*)pPlugin; + geometry->listener_callback = + (GEOMETRY_LISTENER_CALLBACK*)calloc(1, sizeof(GEOMETRY_LISTENER_CALLBACK)); if (!geometry->listener_callback) { @@ -409,7 +411,8 @@ static UINT geometry_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelMa geometry->listener_callback->plugin = pPlugin; geometry->listener_callback->channel_mgr = pChannelMgr; status = pChannelMgr->CreateListener(pChannelMgr, GEOMETRY_DVC_CHANNEL_NAME, 0, - (IWTSListenerCallback*) geometry->listener_callback, &(geometry->listener)); + (IWTSListenerCallback*)geometry->listener_callback, + &(geometry->listener)); geometry->listener->pInterface = geometry->iface.pInterface; return status; } @@ -421,8 +424,8 @@ static UINT geometry_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelMa */ static UINT geometry_plugin_terminated(IWTSPlugin* pPlugin) { - GEOMETRY_PLUGIN* geometry = (GEOMETRY_PLUGIN*) pPlugin; - GeometryClientContext* context = (GeometryClientContext *)geometry->iface.pInterface; + GEOMETRY_PLUGIN* geometry = (GEOMETRY_PLUGIN*)pPlugin; + GeometryClientContext* context = (GeometryClientContext*)geometry->iface.pInterface; if (context) HashTable_Free(context->geometries); @@ -438,9 +441,9 @@ static UINT geometry_plugin_terminated(IWTSPlugin* pPlugin) */ #ifdef BUILTIN_CHANNELS -#define DVCPluginEntry geometry_DVCPluginEntry +#define DVCPluginEntry geometry_DVCPluginEntry #else -#define DVCPluginEntry FREERDP_API DVCPluginEntry +#define DVCPluginEntry FREERDP_API DVCPluginEntry #endif /** @@ -453,11 +456,11 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) UINT error = CHANNEL_RC_OK; GEOMETRY_PLUGIN* geometry; GeometryClientContext* context; - geometry = (GEOMETRY_PLUGIN*) pEntryPoints->GetPlugin(pEntryPoints, "geometry"); + geometry = (GEOMETRY_PLUGIN*)pEntryPoints->GetPlugin(pEntryPoints, "geometry"); if (!geometry) { - geometry = (GEOMETRY_PLUGIN*) calloc(1, sizeof(GEOMETRY_PLUGIN)); + geometry = (GEOMETRY_PLUGIN*)calloc(1, sizeof(GEOMETRY_PLUGIN)); if (!geometry) { @@ -469,7 +472,7 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) geometry->iface.Connected = NULL; geometry->iface.Disconnected = NULL; geometry->iface.Terminated = geometry_plugin_terminated; - context = (GeometryClientContext*) calloc(1, sizeof(GeometryClientContext)); + context = (GeometryClientContext*)calloc(1, sizeof(GeometryClientContext)); if (!context) { @@ -482,10 +485,10 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) context->geometries->keyCompare = (HASH_TABLE_KEY_COMPARE_FN)mappedGeometryKeyCompare; context->geometries->valueFree = (HASH_TABLE_VALUE_FREE_FN)mappedGeometryUnref; - context->handle = (void*) geometry; - geometry->iface.pInterface = (void*) context; + context->handle = (void*)geometry; + geometry->iface.pInterface = (void*)context; geometry->context = context; - error = pEntryPoints->RegisterPlugin(pEntryPoints, "geometry", (IWTSPlugin*) geometry); + error = pEntryPoints->RegisterPlugin(pEntryPoints, "geometry", (IWTSPlugin*)geometry); } else { @@ -498,5 +501,4 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) error_context: free(geometry); return CHANNEL_RC_NO_MEMORY; - } diff --git a/channels/geometry/client/geometry_main.h b/channels/geometry/client/geometry_main.h index 1fb5321a2..ff6add28d 100644 --- a/channels/geometry/client/geometry_main.h +++ b/channels/geometry/client/geometry_main.h @@ -29,6 +29,4 @@ #include #include - #endif /* FREERDP_CHANNEL_GEOMETRY_CLIENT_MAIN_H */ - diff --git a/channels/parallel/client/parallel_main.c b/channels/parallel/client/parallel_main.c index 19ebce326..3fc6c4158 100644 --- a/channels/parallel/client/parallel_main.c +++ b/channels/parallel/client/parallel_main.c @@ -88,11 +88,11 @@ static UINT parallel_process_irp_create(PARALLEL_DEVICE* parallel, IRP* irp) /* DesiredAccess(4) AllocationSize(8), FileAttributes(4) */ /* SharedAccess(4) CreateDisposition(4), CreateOptions(4) */ Stream_Read_UINT32(irp->input, PathLength); - status = ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) Stream_Pointer(irp->input), - PathLength / 2, &path, 0, NULL, NULL); + status = ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)Stream_Pointer(irp->input), PathLength / 2, + &path, 0, NULL, NULL); if (status < 1) - if (!(path = (char*) calloc(1, 1))) + if (!(path = (char*)calloc(1, 1))) { WLog_ERR(TAG, "calloc failed!"); return CHANNEL_RC_NO_MEMORY; @@ -151,7 +151,7 @@ static UINT parallel_process_irp_read(PARALLEL_DEVICE* parallel, IRP* irp) BYTE* buffer = NULL; Stream_Read_UINT32(irp->input, Length); Stream_Read_UINT64(irp->input, Offset); - buffer = (BYTE*) malloc(Length); + buffer = (BYTE*)malloc(Length); if (!buffer) { @@ -231,8 +231,7 @@ static UINT parallel_process_irp_write(PARALLEL_DEVICE* parallel, IRP* irp) * * @return 0 on success, otherwise a Win32 error code */ -static UINT parallel_process_irp_device_control(PARALLEL_DEVICE* parallel, - IRP* irp) +static UINT parallel_process_irp_device_control(PARALLEL_DEVICE* parallel, IRP* irp) { Stream_Write_UINT32(irp->output, 0); /* OutputBufferLength */ return irp->Complete(irp); @@ -252,7 +251,7 @@ static UINT parallel_process_irp(PARALLEL_DEVICE* parallel, IRP* irp) case IRP_MJ_CREATE: if ((error = parallel_process_irp_create(parallel, irp))) { - WLog_ERR(TAG, "parallel_process_irp_create failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "parallel_process_irp_create failed with error %" PRIu32 "!", error); return error; } @@ -261,7 +260,7 @@ static UINT parallel_process_irp(PARALLEL_DEVICE* parallel, IRP* irp) case IRP_MJ_CLOSE: if ((error = parallel_process_irp_close(parallel, irp))) { - WLog_ERR(TAG, "parallel_process_irp_close failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "parallel_process_irp_close failed with error %" PRIu32 "!", error); return error; } @@ -270,7 +269,7 @@ static UINT parallel_process_irp(PARALLEL_DEVICE* parallel, IRP* irp) case IRP_MJ_READ: if ((error = parallel_process_irp_read(parallel, irp))) { - WLog_ERR(TAG, "parallel_process_irp_read failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "parallel_process_irp_read failed with error %" PRIu32 "!", error); return error; } @@ -279,7 +278,7 @@ static UINT parallel_process_irp(PARALLEL_DEVICE* parallel, IRP* irp) case IRP_MJ_WRITE: if ((error = parallel_process_irp_write(parallel, irp))) { - WLog_ERR(TAG, "parallel_process_irp_write failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "parallel_process_irp_write failed with error %" PRIu32 "!", error); return error; } @@ -288,7 +287,7 @@ static UINT parallel_process_irp(PARALLEL_DEVICE* parallel, IRP* irp) case IRP_MJ_DEVICE_CONTROL: if ((error = parallel_process_irp_device_control(parallel, irp))) { - WLog_ERR(TAG, "parallel_process_irp_device_control failed with error %"PRIu32"!", + WLog_ERR(TAG, "parallel_process_irp_device_control failed with error %" PRIu32 "!", error); return error; } @@ -308,7 +307,7 @@ static DWORD WINAPI parallel_thread_func(LPVOID arg) { IRP* irp; wMessage message; - PARALLEL_DEVICE* parallel = (PARALLEL_DEVICE*) arg; + PARALLEL_DEVICE* parallel = (PARALLEL_DEVICE*)arg; UINT error = CHANNEL_RC_OK; while (1) @@ -330,18 +329,17 @@ static DWORD WINAPI parallel_thread_func(LPVOID arg) if (message.id == WMQ_QUIT) break; - irp = (IRP*) message.wParam; + irp = (IRP*)message.wParam; if ((error = parallel_process_irp(parallel, irp))) { - WLog_ERR(TAG, "parallel_process_irp failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "parallel_process_irp failed with error %" PRIu32 "!", error); break; } } if (error && parallel->rdpcontext) - setChannelError(parallel->rdpcontext, error, - "parallel_thread_func reported an error"); + setChannelError(parallel->rdpcontext, error, "parallel_thread_func reported an error"); ExitThread(error); return error; @@ -354,9 +352,9 @@ static DWORD WINAPI parallel_thread_func(LPVOID arg) */ static UINT parallel_irp_request(DEVICE* device, IRP* irp) { - PARALLEL_DEVICE* parallel = (PARALLEL_DEVICE*) device; + PARALLEL_DEVICE* parallel = (PARALLEL_DEVICE*)device; - if (!MessageQueue_Post(parallel->queue, NULL, 0, (void*) irp, NULL)) + if (!MessageQueue_Post(parallel->queue, NULL, 0, (void*)irp, NULL)) { WLog_ERR(TAG, "MessageQueue_Post failed!"); return ERROR_INTERNAL_ERROR; @@ -373,13 +371,13 @@ static UINT parallel_irp_request(DEVICE* device, IRP* irp) static UINT parallel_free(DEVICE* device) { UINT error; - PARALLEL_DEVICE* parallel = (PARALLEL_DEVICE*) device; + PARALLEL_DEVICE* parallel = (PARALLEL_DEVICE*)device; - if (!MessageQueue_PostQuit(parallel->queue, 0) - || (WaitForSingleObject(parallel->thread, INFINITE) == WAIT_FAILED)) + if (!MessageQueue_PostQuit(parallel->queue, 0) || + (WaitForSingleObject(parallel->thread, INFINITE) == WAIT_FAILED)) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); return error; } @@ -391,9 +389,9 @@ static UINT parallel_free(DEVICE* device) } #ifdef BUILTIN_CHANNELS -#define DeviceServiceEntry parallel_DeviceServiceEntry +#define DeviceServiceEntry parallel_DeviceServiceEntry #else -#define DeviceServiceEntry FREERDP_API DeviceServiceEntry +#define DeviceServiceEntry FREERDP_API DeviceServiceEntry #endif /** @@ -410,7 +408,7 @@ UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) RDPDR_PARALLEL* device; PARALLEL_DEVICE* parallel; UINT error; - device = (RDPDR_PARALLEL*) pEntryPoints->device; + device = (RDPDR_PARALLEL*)pEntryPoints->device; name = device->Name; path = device->Path; @@ -422,7 +420,7 @@ UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) if (name[0] && path[0]) { - parallel = (PARALLEL_DEVICE*) calloc(1, sizeof(PARALLEL_DEVICE)); + parallel = (PARALLEL_DEVICE*)calloc(1, sizeof(PARALLEL_DEVICE)); if (!parallel) { @@ -458,15 +456,14 @@ UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) goto error_out; } - if ((error = pEntryPoints->RegisterDevice(pEntryPoints->devman, - (DEVICE*) parallel))) + if ((error = pEntryPoints->RegisterDevice(pEntryPoints->devman, (DEVICE*)parallel))) { - WLog_ERR(TAG, "RegisterDevice failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "RegisterDevice failed with error %" PRIu32 "!", error); goto error_out; } - if (!(parallel->thread = CreateThread(NULL, 0, - parallel_thread_func, (void*) parallel, 0, NULL))) + if (!(parallel->thread = + CreateThread(NULL, 0, parallel_thread_func, (void*)parallel, 0, NULL))) { WLog_ERR(TAG, "CreateThread failed!"); error = ERROR_INTERNAL_ERROR; diff --git a/channels/printer/client/cups/printer_cups.c b/channels/printer/client/cups/printer_cups.c index 6683de5c2..b78632e9c 100644 --- a/channels/printer/client/cups/printer_cups.c +++ b/channels/printer/client/cups/printer_cups.c @@ -73,9 +73,8 @@ static void printer_cups_get_printjob_name(char* buf, size_t size, size_t id) tt = time(NULL); t = localtime(&tt); - sprintf_s(buf, size - 1, "FreeRDP Print %04d-%02d-%02d %02d-%02d-%02d - Job %"PRIdz, - t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, - t->tm_hour, t->tm_min, t->tm_sec, id); + sprintf_s(buf, size - 1, "FreeRDP Print %04d-%02d-%02d %02d-%02d-%02d - Job %" PRIdz, + t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec, id); } /** @@ -85,14 +84,14 @@ static void printer_cups_get_printjob_name(char* buf, size_t size, size_t id) */ static UINT printer_cups_write_printjob(rdpPrintJob* printjob, const BYTE* data, size_t size) { - rdpCupsPrintJob* cups_printjob = (rdpCupsPrintJob*) printjob; + rdpCupsPrintJob* cups_printjob = (rdpCupsPrintJob*)printjob; #ifndef _CUPS_API_1_4 { FILE* fp; - fp = fopen((const char*) cups_printjob->printjob_object, "a+b"); + fp = fopen((const char*)cups_printjob->printjob_object, "a+b"); if (!fp) return ERROR_INTERNAL_ERROR; @@ -109,7 +108,7 @@ static UINT printer_cups_write_printjob(rdpPrintJob* printjob, const BYTE* data, #else - cupsWriteRequestData((http_t*) cups_printjob->printjob_object, (const char*) data, size); + cupsWriteRequestData((http_t*)cups_printjob->printjob_object, (const char*)data, size); #endif @@ -118,7 +117,7 @@ static UINT printer_cups_write_printjob(rdpPrintJob* printjob, const BYTE* data, static void printer_cups_close_printjob(rdpPrintJob* printjob) { - rdpCupsPrintJob* cups_printjob = (rdpCupsPrintJob*) printjob; + rdpCupsPrintJob* cups_printjob = (rdpCupsPrintJob*)printjob; #ifndef _CUPS_API_1_4 @@ -127,9 +126,9 @@ static void printer_cups_close_printjob(rdpPrintJob* printjob) printer_cups_get_printjob_name(buf, sizeof(buf), printjob->id); - if (cupsPrintFile(printjob->printer->name, (const char*) cups_printjob->printjob_object, buf, 0, NULL) == 0) + if (cupsPrintFile(printjob->printer->name, (const char*)cups_printjob->printjob_object, buf, + 0, NULL) == 0) { - } unlink(cups_printjob->printjob_object); @@ -138,25 +137,25 @@ static void printer_cups_close_printjob(rdpPrintJob* printjob) #else - cupsFinishDocument((http_t*) cups_printjob->printjob_object, printjob->printer->name); + cupsFinishDocument((http_t*)cups_printjob->printjob_object, printjob->printer->name); cups_printjob->printjob_id = 0; - httpClose((http_t*) cups_printjob->printjob_object); + httpClose((http_t*)cups_printjob->printjob_object); #endif - ((rdpCupsPrinter*) printjob->printer)->printjob = NULL; - free(cups_printjob) ; + ((rdpCupsPrinter*)printjob->printer)->printjob = NULL; + free(cups_printjob); } static rdpPrintJob* printer_cups_create_printjob(rdpPrinter* printer, UINT32 id) { - rdpCupsPrinter* cups_printer = (rdpCupsPrinter*) printer; + rdpCupsPrinter* cups_printer = (rdpCupsPrinter*)printer; rdpCupsPrintJob* cups_printjob; if (cups_printer->printjob != NULL) return NULL; - cups_printjob = (rdpCupsPrintJob*) calloc(1, sizeof(rdpCupsPrintJob)); + cups_printjob = (rdpCupsPrintJob*)calloc(1, sizeof(rdpCupsPrintJob)); if (!cups_printjob) return NULL; @@ -179,7 +178,8 @@ static rdpPrintJob* printer_cups_create_printjob(rdpPrinter* printer, UINT32 id) { char buf[100]; - cups_printjob->printjob_object = httpConnectEncrypt(cupsServer(), ippPort(), HTTP_ENCRYPT_IF_REQUESTED); + cups_printjob->printjob_object = + httpConnectEncrypt(cupsServer(), ippPort(), HTTP_ENCRYPT_IF_REQUESTED); if (!cups_printjob->printjob_object) { @@ -189,24 +189,24 @@ static rdpPrintJob* printer_cups_create_printjob(rdpPrinter* printer, UINT32 id) printer_cups_get_printjob_name(buf, sizeof(buf), cups_printjob->printjob.id); - cups_printjob->printjob_id = cupsCreateJob((http_t*) cups_printjob->printjob_object, - printer->name, buf, 0, NULL); + cups_printjob->printjob_id = + cupsCreateJob((http_t*)cups_printjob->printjob_object, printer->name, buf, 0, NULL); if (!cups_printjob->printjob_id) { - httpClose((http_t*) cups_printjob->printjob_object); + httpClose((http_t*)cups_printjob->printjob_object); free(cups_printjob); return NULL; } - cupsStartDocument((http_t*) cups_printjob->printjob_object, - printer->name, cups_printjob->printjob_id, buf, CUPS_FORMAT_AUTO, 1); + cupsStartDocument((http_t*)cups_printjob->printjob_object, printer->name, + cups_printjob->printjob_id, buf, CUPS_FORMAT_AUTO, 1); } #endif cups_printer->printjob = cups_printjob; - + return (rdpPrintJob*)cups_printjob; } @@ -224,10 +224,10 @@ static rdpPrintJob* printer_cups_find_printjob(rdpPrinter* printer, UINT32 id) static void printer_cups_free_printer(rdpPrinter* printer) { - rdpCupsPrinter* cups_printer = (rdpCupsPrinter*) printer; + rdpCupsPrinter* cups_printer = (rdpCupsPrinter*)printer; if (cups_printer->printjob) - cups_printer->printjob->printjob.Close((rdpPrintJob*) cups_printer->printjob); + cups_printer->printjob->printjob.Close((rdpPrintJob*)cups_printer->printjob); if (printer->backend) printer->backend->ReleaseRef(printer->backend); @@ -252,12 +252,12 @@ static void printer_cups_release_ref_printer(rdpPrinter* printer) printer->references--; } -static rdpPrinter* printer_cups_new_printer(rdpCupsPrinterDriver* cups_driver, - const char* name, const char* driverName, BOOL is_default) +static rdpPrinter* printer_cups_new_printer(rdpCupsPrinterDriver* cups_driver, const char* name, + const char* driverName, BOOL is_default) { rdpCupsPrinter* cups_printer; - cups_printer = (rdpCupsPrinter*) calloc(1, sizeof(rdpCupsPrinter)); + cups_printer = (rdpCupsPrinter*)calloc(1, sizeof(rdpCupsPrinter)); if (!cups_printer) return NULL; @@ -288,7 +288,6 @@ static rdpPrinter* printer_cups_new_printer(rdpCupsPrinterDriver* cups_driver, cups_printer->printer.AddRef = printer_cups_add_ref_printer; cups_printer->printer.ReleaseRef = printer_cups_release_ref_printer; - cups_printer->printer.AddRef(&cups_printer->printer); cups_printer->printer.backend->AddRef(cups_printer->printer.backend); return &cups_printer->printer; @@ -298,7 +297,7 @@ static void printer_cups_release_enum_printers(rdpPrinter** printers) { rdpPrinter** cur = printers; - while((cur != NULL) && ((*cur) != NULL)) + while ((cur != NULL) && ((*cur) != NULL)) { if ((*cur)->ReleaseRef) (*cur)->ReleaseRef(*cur); @@ -311,13 +310,13 @@ static rdpPrinter** printer_cups_enum_printers(rdpPrinterDriver* driver) { rdpPrinter** printers; int num_printers; - cups_dest_t *dests; - cups_dest_t *dest; + cups_dest_t* dests; + cups_dest_t* dest; int num_dests; int i; num_dests = cupsGetDests(&dests); - printers = (rdpPrinter**) calloc(num_dests + 1, sizeof(rdpPrinter*)); + printers = (rdpPrinter**)calloc(num_dests + 1, sizeof(rdpPrinter*)); if (!printers) return NULL; @@ -328,8 +327,8 @@ static rdpPrinter** printer_cups_enum_printers(rdpPrinterDriver* driver) if (dest->instance == NULL) { rdpPrinter* current = printers[num_printers]; - current = printer_cups_new_printer((rdpCupsPrinterDriver*) driver, - dest->name, NULL, dest->is_default); + current = printer_cups_new_printer((rdpCupsPrinterDriver*)driver, dest->name, NULL, + dest->is_default); if (!current) { printer_cups_release_enum_printers(printers); @@ -345,18 +344,18 @@ static rdpPrinter** printer_cups_enum_printers(rdpPrinterDriver* driver) return printers; } -static rdpPrinter* printer_cups_get_printer(rdpPrinterDriver* driver, - const char* name, const char* driverName) +static rdpPrinter* printer_cups_get_printer(rdpPrinterDriver* driver, const char* name, + const char* driverName) { - rdpCupsPrinterDriver* cups_driver = (rdpCupsPrinterDriver*) driver; + rdpCupsPrinterDriver* cups_driver = (rdpCupsPrinterDriver*)driver; return printer_cups_new_printer(cups_driver, name, driverName, - cups_driver->id_sequence == 1 ? TRUE : FALSE); + cups_driver->id_sequence == 1 ? TRUE : FALSE); } static void printer_cups_add_ref_driver(rdpPrinterDriver* driver) { - rdpCupsPrinterDriver* cups_driver = (rdpCupsPrinterDriver*) driver; + rdpCupsPrinterDriver* cups_driver = (rdpCupsPrinterDriver*)driver; if (cups_driver) cups_driver->references++; } @@ -366,7 +365,7 @@ static rdpCupsPrinterDriver* cups_driver = NULL; static void printer_cups_release_ref_driver(rdpPrinterDriver* driver) { - rdpCupsPrinterDriver* cups_driver = (rdpCupsPrinterDriver*) driver; + rdpCupsPrinterDriver* cups_driver = (rdpCupsPrinterDriver*)driver; if (cups_driver->references <= 1) { free(cups_driver); @@ -377,14 +376,14 @@ static void printer_cups_release_ref_driver(rdpPrinterDriver* driver) } #ifdef BUILTIN_CHANNELS -rdpPrinterDriver *cups_freerdp_printer_client_subsystem_entry(void) +rdpPrinterDriver* cups_freerdp_printer_client_subsystem_entry(void) #else -FREERDP_API rdpPrinterDriver *freerdp_printer_client_subsystem_entry(void) +FREERDP_API rdpPrinterDriver* freerdp_printer_client_subsystem_entry(void) #endif { if (!cups_driver) { - cups_driver = (rdpCupsPrinterDriver*) calloc(1, sizeof(rdpCupsPrinterDriver)); + cups_driver = (rdpCupsPrinterDriver*)calloc(1, sizeof(rdpCupsPrinterDriver)); if (!cups_driver) return NULL; diff --git a/channels/printer/client/printer_main.c b/channels/printer/client/printer_main.c index 4c1f35984..e83ef5a07 100644 --- a/channels/printer/client/printer_main.c +++ b/channels/printer/client/printer_main.c @@ -71,21 +71,15 @@ typedef enum PRN_CONF_PNP = 1, PRN_CONF_DRIVER = 2, PRN_CONF_DATA = 3 -} -prn_conf_t; +} prn_conf_t; -static const char* filemap[] = -{ - "PortDosName", - "PnPName", - "DriverName", - "CachedPrinterConfigData" -}; +static const char* filemap[] = { "PortDosName", "PnPName", "DriverName", + "CachedPrinterConfigData" }; static char* get_printer_config_path(const rdpSettings* settings, const WCHAR* name, size_t length) { char* dir = GetCombinedPath(settings->ConfigPath, "printers"); - char* bname = crypto_base64_encode((const BYTE*) name, (int)length); + char* bname = crypto_base64_encode((const BYTE*)name, (int)length); char* config = GetCombinedPath(dir, bname); if (config && !PathFileExistsA(config)) @@ -116,8 +110,7 @@ static BOOL printer_write_setting(const char* path, prn_conf_t type, const void* if (!abs) return FALSE; - file = CreateFileA(abs, GENERIC_WRITE, 0, - NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + file = CreateFileA(abs, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); free(abs); if (file == INVALID_HANDLE_VALUE) @@ -171,8 +164,7 @@ static BOOL printer_read_setting(const char* path, prn_conf_t type, void** data, if (!abs) return FALSE; - file = CreateFileA(abs, GENERIC_READ, 0, - NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + file = CreateFileA(abs, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); free(abs); if (file == INVALID_HANDLE_VALUE) @@ -222,9 +214,8 @@ fail: return rc; } -static BOOL printer_save_to_config(const rdpSettings* settings, - const char* PortDosName, size_t PortDosNameLen, - const WCHAR* PnPName, size_t PnPNameLen, +static BOOL printer_save_to_config(const rdpSettings* settings, const char* PortDosName, + size_t PortDosNameLen, const WCHAR* PnPName, size_t PnPNameLen, const WCHAR* DriverName, size_t DriverNameLen, const WCHAR* PrinterName, size_t PrintNameLen, const BYTE* CachedPrinterConfigData, size_t CacheFieldsLen) @@ -332,8 +323,8 @@ static BOOL printer_load_from_config(const rdpSettings* settings, rdpPrinter* pr if (!printer_read_setting(path, PRN_CONF_DRIVER, &DriverName, &DriverNameLen)) { - DriverNameLen = ConvertToUnicode(CP_UTF8, 0, printer->driver, -1, (LPWSTR*)&DriverName, - 0) * 2 + 1; + DriverNameLen = + ConvertToUnicode(CP_UTF8, 0, printer->driver, -1, (LPWSTR*)&DriverName, 0) * 2 + 1; } if (!printer_read_setting(path, PRN_CONF_DATA, &CachedPrinterConfigData, &CachedFieldsLen)) @@ -346,7 +337,7 @@ static BOOL printer_load_from_config(const rdpSettings* settings, rdpPrinter* pr goto fail; Stream_Write_UINT32(printer_dev->device.data, flags); - Stream_Write_UINT32(printer_dev->device.data, 0); /* CodePage, reserved */ + Stream_Write_UINT32(printer_dev->device.data, 0); /* CodePage, reserved */ Stream_Write_UINT32(printer_dev->device.data, PnPNameLen); /* PnPNameLen */ Stream_Write_UINT32(printer_dev->device.data, DriverNameLen); Stream_Write_UINT32(printer_dev->device.data, PrinterNameLen); @@ -435,8 +426,8 @@ static UINT printer_process_irp_create(PRINTER_DEVICE* printer_dev, IRP* irp) rdpPrintJob* printjob = NULL; if (printer_dev->printer) - printjob = printer_dev->printer->CreatePrintJob(printer_dev->printer, - irp->devman->id_sequence++); + printjob = + printer_dev->printer->CreatePrintJob(printer_dev->printer, irp->devman->id_sequence++); if (printjob) { @@ -461,8 +452,7 @@ static UINT printer_process_irp_close(PRINTER_DEVICE* printer_dev, IRP* irp) rdpPrintJob* printjob = NULL; if (printer_dev->printer) - printjob = printer_dev->printer->FindPrintJob(printer_dev->printer, - irp->FileId); + printjob = printer_dev->printer->FindPrintJob(printer_dev->printer, irp->FileId); if (!printjob) { @@ -493,8 +483,7 @@ static UINT printer_process_irp_write(PRINTER_DEVICE* printer_dev, IRP* irp) Stream_Seek(irp->input, 20); /* Padding */ if (printer_dev->printer) - printjob = printer_dev->printer->FindPrintJob(printer_dev->printer, - irp->FileId); + printjob = printer_dev->printer->FindPrintJob(printer_dev->printer, irp->FileId); if (!printjob) { @@ -508,7 +497,7 @@ static UINT printer_process_irp_write(PRINTER_DEVICE* printer_dev, IRP* irp) if (error) { - WLog_ERR(TAG, "printjob->Write failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "printjob->Write failed with error %" PRIu32 "!", error); return error; } @@ -522,8 +511,7 @@ static UINT printer_process_irp_write(PRINTER_DEVICE* printer_dev, IRP* irp) * * @return 0 on success, otherwise a Win32 error code */ -static UINT printer_process_irp_device_control(PRINTER_DEVICE* printer_dev, - IRP* irp) +static UINT printer_process_irp_device_control(PRINTER_DEVICE* printer_dev, IRP* irp) { Stream_Write_UINT32(irp->output, 0); /* OutputBufferLength */ return irp->Complete(irp); @@ -543,7 +531,7 @@ static UINT printer_process_irp(PRINTER_DEVICE* printer_dev, IRP* irp) case IRP_MJ_CREATE: if ((error = printer_process_irp_create(printer_dev, irp))) { - WLog_ERR(TAG, "printer_process_irp_create failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "printer_process_irp_create failed with error %" PRIu32 "!", error); return error; } @@ -552,7 +540,7 @@ static UINT printer_process_irp(PRINTER_DEVICE* printer_dev, IRP* irp) case IRP_MJ_CLOSE: if ((error = printer_process_irp_close(printer_dev, irp))) { - WLog_ERR(TAG, "printer_process_irp_close failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "printer_process_irp_close failed with error %" PRIu32 "!", error); return error; } @@ -561,7 +549,7 @@ static UINT printer_process_irp(PRINTER_DEVICE* printer_dev, IRP* irp) case IRP_MJ_WRITE: if ((error = printer_process_irp_write(printer_dev, irp))) { - WLog_ERR(TAG, "printer_process_irp_write failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "printer_process_irp_write failed with error %" PRIu32 "!", error); return error; } @@ -570,7 +558,7 @@ static UINT printer_process_irp(PRINTER_DEVICE* printer_dev, IRP* irp) case IRP_MJ_DEVICE_CONTROL: if ((error = printer_process_irp_device_control(printer_dev, irp))) { - WLog_ERR(TAG, "printer_process_irp_device_control failed with error %"PRIu32"!", + WLog_ERR(TAG, "printer_process_irp_device_control failed with error %" PRIu32 "!", error); return error; } @@ -589,8 +577,8 @@ static UINT printer_process_irp(PRINTER_DEVICE* printer_dev, IRP* irp) static DWORD WINAPI printer_thread_func(LPVOID arg) { IRP* irp; - PRINTER_DEVICE* printer_dev = (PRINTER_DEVICE*) arg; - HANDLE obj[] = {printer_dev->event, printer_dev->stopEvent}; + PRINTER_DEVICE* printer_dev = (PRINTER_DEVICE*)arg; + HANDLE obj[] = { printer_dev->event, printer_dev->stopEvent }; UINT error = CHANNEL_RC_OK; while (1) @@ -600,7 +588,7 @@ static DWORD WINAPI printer_thread_func(LPVOID arg) if (rc == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "!", error); break; } @@ -610,7 +598,7 @@ static DWORD WINAPI printer_thread_func(LPVOID arg) continue; ResetEvent(printer_dev->event); - irp = (IRP*) InterlockedPopEntrySList(printer_dev->pIrpList); + irp = (IRP*)InterlockedPopEntrySList(printer_dev->pIrpList); if (irp == NULL) { @@ -621,14 +609,13 @@ static DWORD WINAPI printer_thread_func(LPVOID arg) if ((error = printer_process_irp(printer_dev, irp))) { - WLog_ERR(TAG, "printer_process_irp failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "printer_process_irp failed with error %" PRIu32 "!", error); break; } } if (error && printer_dev->rdpcontext) - setChannelError(printer_dev->rdpcontext, error, - "printer_thread_func reported an error"); + setChannelError(printer_dev->rdpcontext, error, "printer_thread_func reported an error"); ExitThread(error); return error; @@ -641,7 +628,7 @@ static DWORD WINAPI printer_thread_func(LPVOID arg) */ static UINT printer_irp_request(DEVICE* device, IRP* irp) { - PRINTER_DEVICE* printer_dev = (PRINTER_DEVICE*) device; + PRINTER_DEVICE* printer_dev = (PRINTER_DEVICE*)device; InterlockedPushEntrySList(printer_dev->pIrpList, &(irp->ItemEntry)); SetEvent(printer_dev->event); return CHANNEL_RC_OK; @@ -650,7 +637,7 @@ static UINT printer_irp_request(DEVICE* device, IRP* irp) static UINT printer_custom_component(DEVICE* device, UINT16 component, UINT16 packetId, wStream* s) { UINT32 eventID; - PRINTER_DEVICE* printer_dev = (PRINTER_DEVICE*) device; + PRINTER_DEVICE* printer_dev = (PRINTER_DEVICE*)device; const rdpSettings* settings = printer_dev->rdpcontext->settings; if (component != RDPDR_CTYP_PRN) @@ -667,156 +654,156 @@ static UINT printer_custom_component(DEVICE* device, UINT16 component, UINT16 pa switch (eventID) { case RDPDR_ADD_PRINTER_EVENT: - { - char PortDosName[8]; - UINT32 PnPNameLen, DriverNameLen, PrintNameLen, CacheFieldsLen; - const WCHAR* PnPName, *DriverName, *PrinterName; - const BYTE* CachedPrinterConfigData; + { + char PortDosName[8]; + UINT32 PnPNameLen, DriverNameLen, PrintNameLen, CacheFieldsLen; + const WCHAR *PnPName, *DriverName, *PrinterName; + const BYTE* CachedPrinterConfigData; - if (Stream_GetRemainingLength(s) < 24) - return ERROR_INVALID_DATA; + if (Stream_GetRemainingLength(s) < 24) + return ERROR_INVALID_DATA; - Stream_Read(s, PortDosName, sizeof(PortDosName)); - Stream_Read_UINT32(s, PnPNameLen); - Stream_Read_UINT32(s, DriverNameLen); - Stream_Read_UINT32(s, PrintNameLen); - Stream_Read_UINT32(s, CacheFieldsLen); + Stream_Read(s, PortDosName, sizeof(PortDosName)); + Stream_Read_UINT32(s, PnPNameLen); + Stream_Read_UINT32(s, DriverNameLen); + Stream_Read_UINT32(s, PrintNameLen); + Stream_Read_UINT32(s, CacheFieldsLen); - if (Stream_GetRemainingLength(s) < PnPNameLen) - return ERROR_INVALID_DATA; + if (Stream_GetRemainingLength(s) < PnPNameLen) + return ERROR_INVALID_DATA; - PnPName = (const WCHAR*)Stream_Pointer(s); - Stream_Seek(s, PnPNameLen); + PnPName = (const WCHAR*)Stream_Pointer(s); + Stream_Seek(s, PnPNameLen); - if (Stream_GetRemainingLength(s) < DriverNameLen) - return ERROR_INVALID_DATA; + if (Stream_GetRemainingLength(s) < DriverNameLen) + return ERROR_INVALID_DATA; - DriverName = (const WCHAR*)Stream_Pointer(s); - Stream_Seek(s, DriverNameLen); + DriverName = (const WCHAR*)Stream_Pointer(s); + Stream_Seek(s, DriverNameLen); - if (Stream_GetRemainingLength(s) < PrintNameLen) - return ERROR_INVALID_DATA; + if (Stream_GetRemainingLength(s) < PrintNameLen) + return ERROR_INVALID_DATA; - PrinterName = (const WCHAR*)Stream_Pointer(s); - Stream_Seek(s, PrintNameLen); + PrinterName = (const WCHAR*)Stream_Pointer(s); + Stream_Seek(s, PrintNameLen); - if (Stream_GetRemainingLength(s) < CacheFieldsLen) - return ERROR_INVALID_DATA; + if (Stream_GetRemainingLength(s) < CacheFieldsLen) + return ERROR_INVALID_DATA; - CachedPrinterConfigData = Stream_Pointer(s); - Stream_Seek(s, CacheFieldsLen); + CachedPrinterConfigData = Stream_Pointer(s); + Stream_Seek(s, CacheFieldsLen); - if (!printer_save_to_config(settings, - PortDosName, sizeof(PortDosName), - PnPName, PnPNameLen, - DriverName, DriverNameLen, - PrinterName, PrintNameLen, - CachedPrinterConfigData, CacheFieldsLen)) - return ERROR_INTERNAL_ERROR; - } - break; + if (!printer_save_to_config(settings, PortDosName, sizeof(PortDosName), PnPName, + PnPNameLen, DriverName, DriverNameLen, PrinterName, + PrintNameLen, CachedPrinterConfigData, + CacheFieldsLen)) + return ERROR_INTERNAL_ERROR; + } + break; case RDPDR_UPDATE_PRINTER_EVENT: - { - UINT32 PrinterNameLen, ConfigDataLen; - const WCHAR* PrinterName; - const BYTE* ConfigData; + { + UINT32 PrinterNameLen, ConfigDataLen; + const WCHAR* PrinterName; + const BYTE* ConfigData; - if (Stream_GetRemainingLength(s) < 8) - return ERROR_INVALID_DATA; + if (Stream_GetRemainingLength(s) < 8) + return ERROR_INVALID_DATA; - Stream_Read_UINT32(s, PrinterNameLen); - Stream_Read_UINT32(s, ConfigDataLen); + Stream_Read_UINT32(s, PrinterNameLen); + Stream_Read_UINT32(s, ConfigDataLen); - if (Stream_GetRemainingLength(s) < PrinterNameLen) - return ERROR_INVALID_DATA; + if (Stream_GetRemainingLength(s) < PrinterNameLen) + return ERROR_INVALID_DATA; - PrinterName = (const WCHAR*)Stream_Pointer(s); - Stream_Seek(s, PrinterNameLen); + PrinterName = (const WCHAR*)Stream_Pointer(s); + Stream_Seek(s, PrinterNameLen); - if (Stream_GetRemainingLength(s) < ConfigDataLen) - return ERROR_INVALID_DATA; + if (Stream_GetRemainingLength(s) < ConfigDataLen) + return ERROR_INVALID_DATA; - ConfigData = Stream_Pointer(s); - Stream_Seek(s, ConfigDataLen); + ConfigData = Stream_Pointer(s); + Stream_Seek(s, ConfigDataLen); - if (!printer_update_to_config(settings, PrinterName, PrinterNameLen, ConfigData, ConfigDataLen)) - return ERROR_INTERNAL_ERROR; - } - break; + if (!printer_update_to_config(settings, PrinterName, PrinterNameLen, ConfigData, + ConfigDataLen)) + return ERROR_INTERNAL_ERROR; + } + break; case RDPDR_DELETE_PRINTER_EVENT: - { - UINT32 PrinterNameLen; - const WCHAR* PrinterName; + { + UINT32 PrinterNameLen; + const WCHAR* PrinterName; - if (Stream_GetRemainingLength(s) < 4) - return ERROR_INVALID_DATA; + if (Stream_GetRemainingLength(s) < 4) + return ERROR_INVALID_DATA; - Stream_Read_UINT32(s, PrinterNameLen); + Stream_Read_UINT32(s, PrinterNameLen); - if (Stream_GetRemainingLength(s) < PrinterNameLen) - return ERROR_INVALID_DATA; + if (Stream_GetRemainingLength(s) < PrinterNameLen) + return ERROR_INVALID_DATA; - PrinterName = (const WCHAR*)Stream_Pointer(s); - Stream_Seek(s, PrinterNameLen); - printer_remove_config(settings, PrinterName, PrinterNameLen); - } - break; + PrinterName = (const WCHAR*)Stream_Pointer(s); + Stream_Seek(s, PrinterNameLen); + printer_remove_config(settings, PrinterName, PrinterNameLen); + } + break; case RDPDR_RENAME_PRINTER_EVENT: - { - UINT32 OldPrinterNameLen, NewPrinterNameLen; - const WCHAR* OldPrinterName; - const WCHAR* NewPrinterName; + { + UINT32 OldPrinterNameLen, NewPrinterNameLen; + const WCHAR* OldPrinterName; + const WCHAR* NewPrinterName; - if (Stream_GetRemainingLength(s) < 8) - return ERROR_INVALID_DATA; + if (Stream_GetRemainingLength(s) < 8) + return ERROR_INVALID_DATA; - Stream_Read_UINT32(s, OldPrinterNameLen); - Stream_Read_UINT32(s, NewPrinterNameLen); + Stream_Read_UINT32(s, OldPrinterNameLen); + Stream_Read_UINT32(s, NewPrinterNameLen); - if (Stream_GetRemainingLength(s) < OldPrinterNameLen) - return ERROR_INVALID_DATA; + if (Stream_GetRemainingLength(s) < OldPrinterNameLen) + return ERROR_INVALID_DATA; - OldPrinterName = (const WCHAR*)Stream_Pointer(s); - Stream_Seek(s, OldPrinterNameLen); + OldPrinterName = (const WCHAR*)Stream_Pointer(s); + Stream_Seek(s, OldPrinterNameLen); - if (Stream_GetRemainingLength(s) < NewPrinterNameLen) - return ERROR_INVALID_DATA; + if (Stream_GetRemainingLength(s) < NewPrinterNameLen) + return ERROR_INVALID_DATA; - NewPrinterName = (const WCHAR*)Stream_Pointer(s); - Stream_Seek(s, NewPrinterNameLen); + NewPrinterName = (const WCHAR*)Stream_Pointer(s); + Stream_Seek(s, NewPrinterNameLen); - if (!printer_move_config(settings, OldPrinterName, OldPrinterNameLen, NewPrinterName, - NewPrinterNameLen)) - return ERROR_INTERNAL_ERROR; - } - break; + if (!printer_move_config(settings, OldPrinterName, OldPrinterNameLen, + NewPrinterName, NewPrinterNameLen)) + return ERROR_INTERNAL_ERROR; + } + break; default: - WLog_ERR(TAG, "Unknown cache data eventID: 0x%08"PRIX32"", eventID); + WLog_ERR(TAG, "Unknown cache data eventID: 0x%08" PRIX32 "", eventID); return ERROR_INVALID_DATA; } break; case PAKID_PRN_USING_XPS: - { - UINT32 flags; + { + UINT32 flags; - if (Stream_GetRemainingLength(s) < 4) - return ERROR_INVALID_DATA; + if (Stream_GetRemainingLength(s) < 4) + return ERROR_INVALID_DATA; - Stream_Read_UINT32(s, flags); - WLog_ERR(TAG, - "Ignoring unhandled message PAKID_PRN_USING_XPS [printerID=%08"PRIx32", flags=%08"PRIx32"]", - eventID, flags); - } - break; + Stream_Read_UINT32(s, flags); + WLog_ERR(TAG, + "Ignoring unhandled message PAKID_PRN_USING_XPS [printerID=%08" PRIx32 + ", flags=%08" PRIx32 "]", + eventID, flags); + } + break; default: - WLog_ERR(TAG, "Unknown printing component packetID: 0x%04"PRIX16"", packetId); + WLog_ERR(TAG, "Unknown printing component packetID: 0x%04" PRIX16 "", packetId); return ERROR_INVALID_DATA; } @@ -831,14 +818,14 @@ static UINT printer_custom_component(DEVICE* device, UINT16 component, UINT16 pa static UINT printer_free(DEVICE* device) { IRP* irp; - PRINTER_DEVICE* printer_dev = (PRINTER_DEVICE*) device; + PRINTER_DEVICE* printer_dev = (PRINTER_DEVICE*)device; UINT error; SetEvent(printer_dev->stopEvent); if (WaitForSingleObject(printer_dev->thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", error); /* The analyzer is confused by this premature return value. * Since this case can not be handled gracefully silence the @@ -848,7 +835,7 @@ static UINT printer_free(DEVICE* device) #endif } - while ((irp = (IRP*) InterlockedPopEntrySList(printer_dev->pIrpList)) != NULL) + while ((irp = (IRP*)InterlockedPopEntrySList(printer_dev->pIrpList)) != NULL) irp->Discard(irp); CloseHandle(printer_dev->thread); @@ -869,12 +856,11 @@ static UINT printer_free(DEVICE* device) * * @return 0 on success, otherwise a Win32 error code */ -static UINT printer_register(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, - rdpPrinter* printer) +static UINT printer_register(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, rdpPrinter* printer) { PRINTER_DEVICE* printer_dev; UINT error = ERROR_INTERNAL_ERROR; - printer_dev = (PRINTER_DEVICE*) calloc(1, sizeof(PRINTER_DEVICE)); + printer_dev = (PRINTER_DEVICE*)calloc(1, sizeof(PRINTER_DEVICE)); if (!printer_dev) { @@ -887,7 +873,7 @@ static UINT printer_register(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, if (!printer_dev->device.data) goto error_out; - sprintf_s(printer_dev->port, sizeof(printer_dev->port), "PRN%"PRIdz, printer->id); + sprintf_s(printer_dev->port, sizeof(printer_dev->port), "PRN%" PRIdz, printer->id); printer_dev->device.type = RDPDR_DTYP_PRINT; printer_dev->device.name = printer_dev->port; printer_dev->device.IRPRequest = printer_irp_request; @@ -895,8 +881,8 @@ static UINT printer_register(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, printer_dev->device.Free = printer_free; printer_dev->rdpcontext = pEntryPoints->rdpcontext; printer_dev->printer = printer; - printer_dev->pIrpList = (WINPR_PSLIST_HEADER) _aligned_malloc(sizeof( - WINPR_SLIST_HEADER), MEMORY_ALLOCATION_ALIGNMENT); + printer_dev->pIrpList = (WINPR_PSLIST_HEADER)_aligned_malloc(sizeof(WINPR_SLIST_HEADER), + MEMORY_ALLOCATION_ALIGNMENT); if (!printer_dev->pIrpList) { @@ -924,15 +910,14 @@ static UINT printer_register(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, goto error_out; } - if ((error = pEntryPoints->RegisterDevice(pEntryPoints->devman, - (DEVICE*) printer_dev))) + if ((error = pEntryPoints->RegisterDevice(pEntryPoints->devman, (DEVICE*)printer_dev))) { - WLog_ERR(TAG, "RegisterDevice failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "RegisterDevice failed with error %" PRIu32 "!", error); goto error_out; } - if (!(printer_dev->thread = CreateThread(NULL, 0, printer_thread_func, (void*) printer_dev, 0, - NULL))) + if (!(printer_dev->thread = + CreateThread(NULL, 0, printer_thread_func, (void*)printer_dev, 0, NULL))) { WLog_ERR(TAG, "CreateThread failed!"); error = ERROR_INTERNAL_ERROR; @@ -950,7 +935,8 @@ static rdpPrinterDriver* printer_load_backend(const char* backend) { typedef rdpPrinterDriver* (*backend_load_t)(void); - backend_load_t entry = (backend_load_t)freerdp_load_channel_addin_entry("printer", backend, NULL, 0); + backend_load_t entry = + (backend_load_t)freerdp_load_channel_addin_entry("printer", backend, NULL, 0); if (!entry) return NULL; @@ -966,22 +952,23 @@ UINT #ifdef BUILTIN_CHANNELS printer_DeviceServiceEntry #else -FREERDP_API DeviceServiceEntry + FREERDP_API + DeviceServiceEntry #endif (PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) { int i; char* name; char* driver_name; - BOOL default_backend = TRUE; + BOOL default_backend = TRUE; RDPDR_PRINTER* device = NULL; rdpPrinterDriver* driver = NULL; - UINT error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (!pEntryPoints || !pEntryPoints->device) return ERROR_INVALID_PARAMETER; - device = (RDPDR_PRINTER*) pEntryPoints->device; + device = (RDPDR_PRINTER*)pEntryPoints->device; name = device->Name; driver_name = device->DriverName; @@ -998,24 +985,24 @@ FREERDP_API DeviceServiceEntry const char* backend = sep + 1; *sep = '\0'; driver = printer_load_backend(backend); - default_backend = FALSE; + default_backend = FALSE; } } - if (!driver && default_backend) - { - const char* backend = + if (!driver && default_backend) + { + const char* backend = #if defined(WITH_CUPS) - "cups" + "cups" #elif defined(_WIN32) - "win" + "win" #else - "" + "" #endif - ; + ; - driver = printer_load_backend(backend); - } + driver = printer_load_backend(backend); + } if (!driver) { @@ -1043,7 +1030,7 @@ FREERDP_API DeviceServiceEntry if ((error = printer_register(pEntryPoints, printer))) { - WLog_ERR(TAG, "printer_register failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "printer_register failed with error %" PRIu32 "!", error); printer->ReleaseRef(printer); goto fail; } @@ -1059,7 +1046,7 @@ FREERDP_API DeviceServiceEntry if ((error = printer_register(pEntryPoints, printer))) { - WLog_ERR(TAG, "printer_register failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "printer_register failed with error %" PRIu32 "!", error); break; } } @@ -1067,7 +1054,7 @@ FREERDP_API DeviceServiceEntry driver->ReleaseEnumPrinters(printers); } - fail: +fail: driver->ReleaseRef(driver); return error; diff --git a/channels/printer/client/win/printer_win.c b/channels/printer/client/win/printer_win.c index 1be9365ed..5306f59fb 100644 --- a/channels/printer/client/win/printer_win.c +++ b/channels/printer/client/win/printer_win.c @@ -40,7 +40,10 @@ #ifdef WITH_DEBUG_WINPR #define DEBUG_WINPR(...) WLog_DBG(PRINTER_TAG, __VA_ARGS__) #else -#define DEBUG_WINPR(...) do { } while (0) +#define DEBUG_WINPR(...) \ + do \ + { \ + } while (0) #endif typedef struct rdp_win_printer_driver rdpWinPrinterDriver; @@ -88,8 +91,8 @@ static WCHAR* printer_win_get_printjob_name(size_t id) return NULL; rc = swprintf_s(str, len, L"FreeRDP Print %04d-%02d-%02d% 02d-%02d-%02d - Job %lu\0", - t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, - t->tm_hour, t->tm_min, t->tm_sec, id); + t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec, + id); return str; } @@ -113,14 +116,14 @@ static UINT printer_win_write_printjob(rdpPrintJob* printjob, const BYTE* data, if (!printer) return ERROR_BAD_ARGUMENTS; - if(!WritePrinter(printer->hPrinter, pBuf, cbBuf, &pcWritten)) + if (!WritePrinter(printer->hPrinter, pBuf, cbBuf, &pcWritten)) return ERROR_INTERNAL_ERROR; return CHANNEL_RC_OK; } static void printer_win_close_printjob(rdpPrintJob* printjob) { - rdpWinPrintJob* win_printjob = (rdpWinPrintJob*) printjob; + rdpWinPrintJob* win_printjob = (rdpWinPrintJob*)printjob; rdpWinPrinter* win_printer; if (!printjob) @@ -132,12 +135,10 @@ static void printer_win_close_printjob(rdpPrintJob* printjob) if (!EndPagePrinter(win_printer->hPrinter)) { - } if (!ClosePrinter(win_printer->hPrinter)) { - } win_printer->printjob = NULL; @@ -154,17 +155,17 @@ static rdpPrintJob* printer_win_create_printjob(rdpPrinter* printer, UINT32 id) if (win_printer->printjob != NULL) return NULL; - win_printjob = (rdpWinPrintJob*) calloc(1, sizeof(rdpWinPrintJob)); + win_printjob = (rdpWinPrintJob*)calloc(1, sizeof(rdpWinPrintJob)); if (!win_printjob) return NULL; win_printjob->printjob.id = id; win_printjob->printjob.printer = printer; win_printjob->di.pDocName = printer_win_get_printjob_name(id); - win_printjob->di.pDatatype= NULL; + win_printjob->di.pDatatype = NULL; win_printjob->di.pOutputFile = NULL; - win_printjob->handle = StartDocPrinter(win_printer->hPrinter, 1, (LPBYTE) &(win_printjob->di)); + win_printjob->handle = StartDocPrinter(win_printer->hPrinter, 1, (LPBYTE) & (win_printjob->di)); if (!win_printjob->handle) { @@ -184,13 +185,13 @@ static rdpPrintJob* printer_win_create_printjob(rdpPrinter* printer, UINT32 id) win_printjob->printjob.Close = printer_win_close_printjob; win_printer->printjob = win_printjob; - + return &win_printjob->printjob; } static rdpPrintJob* printer_win_find_printjob(rdpPrinter* printer, UINT32 id) { - rdpWinPrinter* win_printer = (rdpWinPrinter*) printer; + rdpWinPrinter* win_printer = (rdpWinPrinter*)printer; if (!win_printer->printjob) return NULL; @@ -198,18 +199,18 @@ static rdpPrintJob* printer_win_find_printjob(rdpPrinter* printer, UINT32 id) if (win_printer->printjob->printjob.id != id) return NULL; - return (rdpPrintJob*) win_printer->printjob; + return (rdpPrintJob*)win_printer->printjob; } static void printer_win_free_printer(rdpPrinter* printer) { - rdpWinPrinter* win_printer = (rdpWinPrinter*) printer; + rdpWinPrinter* win_printer = (rdpWinPrinter*)printer; if (win_printer->printjob) - win_printer->printjob->printjob.Close((rdpPrintJob*) win_printer->printjob); + win_printer->printjob->printjob.Close((rdpPrintJob*)win_printer->printjob); if (printer->backend) - printer->backend->ReleaseRef(printer->backend); + printer->backend->ReleaseRef(printer->backend); free(printer->name); free(printer->driver); @@ -232,15 +233,15 @@ static void printer_win_release_ref_printer(rdpPrinter* printer) printer->references--; } -static rdpPrinter* printer_win_new_printer(rdpWinPrinterDriver* win_driver, - const WCHAR* name, const WCHAR* drivername, BOOL is_default) +static rdpPrinter* printer_win_new_printer(rdpWinPrinterDriver* win_driver, const WCHAR* name, + const WCHAR* drivername, BOOL is_default) { rdpWinPrinter* win_printer; DWORD needed = 0; int status; - PRINTER_INFO_2 *prninfo=NULL; + PRINTER_INFO_2* prninfo = NULL; - win_printer = (rdpWinPrinter*) calloc(1, sizeof(rdpWinPrinter)); + win_printer = (rdpWinPrinter*)calloc(1, sizeof(rdpWinPrinter)); if (!win_printer) return NULL; @@ -272,7 +273,7 @@ static rdpPrinter* printer_win_new_printer(rdpWinPrinterDriver* win_driver, } /* How many memory should be allocated for printer data */ - GetPrinter(win_printer->hPrinter, 2, (LPBYTE) prninfo, 0, &needed); + GetPrinter(win_printer->hPrinter, 2, (LPBYTE)prninfo, 0, &needed); if (needed == 0) { free(win_printer->printer.name); @@ -280,7 +281,7 @@ static rdpPrinter* printer_win_new_printer(rdpWinPrinterDriver* win_driver, return NULL; } - prninfo = (PRINTER_INFO_2*) GlobalAlloc(GPTR,needed); + prninfo = (PRINTER_INFO_2*)GlobalAlloc(GPTR, needed); if (!prninfo) { free(win_printer->printer.name); @@ -288,7 +289,7 @@ static rdpPrinter* printer_win_new_printer(rdpWinPrinterDriver* win_driver, return NULL; } - if (!GetPrinter(win_printer->hPrinter, 2, (LPBYTE) prninfo, needed, &needed)) + if (!GetPrinter(win_printer->hPrinter, 2, (LPBYTE)prninfo, needed, &needed)) { GlobalFree(prninfo); free(win_printer->printer.name); @@ -297,9 +298,11 @@ static rdpPrinter* printer_win_new_printer(rdpWinPrinterDriver* win_driver, } if (drivername) - status = ConvertFromUnicode(CP_UTF8, 0, drivername, -1, &win_printer->printer.driver, 0, NULL, NULL); + status = ConvertFromUnicode(CP_UTF8, 0, drivername, -1, &win_printer->printer.driver, 0, + NULL, NULL); else - status = ConvertFromUnicode(CP_UTF8, 0, prninfo->pDriverName, -1, &win_printer->printer.driver, 0, NULL, NULL); + status = ConvertFromUnicode(CP_UTF8, 0, prninfo->pDriverName, -1, + &win_printer->printer.driver, 0, NULL, NULL); if (!win_printer->printer.driver || (status <= 0)) { GlobalFree(prninfo); @@ -317,7 +320,7 @@ static void printer_win_release_enum_printers(rdpPrinter** printers) { rdpPrinter** cur = printers; - while((cur != NULL) && ((*cur) != NULL)) + while ((cur != NULL) && ((*cur) != NULL)) { if ((*cur)->ReleaseRef) (*cur)->ReleaseRef(*cur); @@ -335,21 +338,21 @@ static rdpPrinter** printer_win_enum_printers(rdpPrinterDriver* driver) DWORD needed, returned; /* find required size for the buffer */ - EnumPrinters(PRINTER_ENUM_LOCAL|PRINTER_ENUM_CONNECTIONS, NULL, 2, NULL, 0, &needed, &returned); - + EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, NULL, 2, NULL, 0, &needed, + &returned); /* allocate array of PRINTER_INFO structures */ - prninfo = (PRINTER_INFO_2*) GlobalAlloc(GPTR,needed); + prninfo = (PRINTER_INFO_2*)GlobalAlloc(GPTR, needed); if (!prninfo) return NULL; - - /* call again */ - if (!EnumPrinters(PRINTER_ENUM_LOCAL|PRINTER_ENUM_CONNECTIONS, NULL, 2, (LPBYTE) prninfo, needed, &needed, &returned)) - { + /* call again */ + if (!EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, NULL, 2, (LPBYTE)prninfo, + needed, &needed, &returned)) + { } - printers = (rdpPrinter**) calloc((returned + 1), sizeof(rdpPrinter*)); + printers = (rdpPrinter**)calloc((returned + 1), sizeof(rdpPrinter*)); if (!printers) { GlobalFree(prninfo); @@ -358,11 +361,11 @@ static rdpPrinter** printer_win_enum_printers(rdpPrinterDriver* driver) num_printers = 0; - for (i = 0; i < (int) returned; i++) + for (i = 0; i < (int)returned; i++) { rdpPrinter* current = printers[num_printers]; - current = printer_win_new_printer((rdpWinPrinterDriver*)driver, - prninfo[i].pPrinterName, prninfo[i].pDriverName, 0); + current = printer_win_new_printer((rdpWinPrinterDriver*)driver, prninfo[i].pPrinterName, + prninfo[i].pDriverName, 0); if (!current) { printer_win_release_enum_printers(printers); @@ -376,14 +379,14 @@ static rdpPrinter** printer_win_enum_printers(rdpPrinterDriver* driver) return printers; } -static rdpPrinter* printer_win_get_printer(rdpPrinterDriver* driver, - const char* name, const char* driverName) +static rdpPrinter* printer_win_get_printer(rdpPrinterDriver* driver, const char* name, + const char* driverName) { WCHAR* driverNameW = NULL; WCHAR* nameW = NULL; rdpWinPrinterDriver* win_driver = (rdpWinPrinterDriver*)driver; - rdpPrinter *myPrinter = NULL; - + rdpPrinter* myPrinter = NULL; + if (name) { ConvertToUnicode(CP_UTF8, 0, name, -1, &nameW, 0); @@ -398,17 +401,16 @@ static rdpPrinter* printer_win_get_printer(rdpPrinterDriver* driver, } myPrinter = printer_win_new_printer(win_driver, nameW, driverNameW, - win_driver->id_sequence == 1 ? TRUE : FALSE); + win_driver->id_sequence == 1 ? TRUE : FALSE); free(driverNameW); free(nameW); return myPrinter; } - static void printer_win_add_ref_driver(rdpPrinterDriver* driver) { - rdpWinPrinterDriver* win = (rdpWinPrinterDriver*) driver; + rdpWinPrinterDriver* win = (rdpWinPrinterDriver*)driver; if (win) win->references++; } @@ -418,7 +420,7 @@ static rdpWinPrinterDriver* win_driver = NULL; static void printer_win_release_ref_driver(rdpPrinterDriver* driver) { - rdpWinPrinterDriver* win = (rdpWinPrinterDriver*) driver; + rdpWinPrinterDriver* win = (rdpWinPrinterDriver*)driver; if (win->references <= 1) { free(win); @@ -429,14 +431,14 @@ static void printer_win_release_ref_driver(rdpPrinterDriver* driver) } #ifdef BUILTIN_CHANNELS -rdpPrinterDriver *win_freerdp_printer_client_subsystem_entry(void) +rdpPrinterDriver* win_freerdp_printer_client_subsystem_entry(void) #else -FREERDP_API rdpPrinterDriver *freerdp_printer_client_subsystem_entry(void) +FREERDP_API rdpPrinterDriver* freerdp_printer_client_subsystem_entry(void) #endif { if (!win_driver) { - win_driver = (rdpWinPrinterDriver*) calloc(1, sizeof(rdpWinPrinterDriver)); + win_driver = (rdpWinPrinterDriver*)calloc(1, sizeof(rdpWinPrinterDriver)); if (!win_driver) return NULL; @@ -454,7 +456,3 @@ FREERDP_API rdpPrinterDriver *freerdp_printer_client_subsystem_entry(void) return &win_driver->driver; } - - - - diff --git a/channels/printer/printer.h b/channels/printer/printer.h index 5ce8f5e45..ae0902dff 100644 --- a/channels/printer/printer.h +++ b/channels/printer/printer.h @@ -21,17 +21,16 @@ #define FREERDP_CHANNEL_PRINTER_PRINTER_H /* SERVER_PRINTER_CACHE_EVENT.cachedata */ -#define RDPDR_ADD_PRINTER_EVENT 0x00000001 -#define RDPDR_UPDATE_PRINTER_EVENT 0x00000002 -#define RDPDR_DELETE_PRINTER_EVENT 0x00000003 -#define RDPDR_RENAME_PRINTER_EVENT 0x00000004 +#define RDPDR_ADD_PRINTER_EVENT 0x00000001 +#define RDPDR_UPDATE_PRINTER_EVENT 0x00000002 +#define RDPDR_DELETE_PRINTER_EVENT 0x00000003 +#define RDPDR_RENAME_PRINTER_EVENT 0x00000004 /* DR_PRN_DEVICE_ANNOUNCE.Flags */ -#define RDPDR_PRINTER_ANNOUNCE_FLAG_ASCII 0x00000001 -#define RDPDR_PRINTER_ANNOUNCE_FLAG_DEFAULTPRINTER 0x00000002 -#define RDPDR_PRINTER_ANNOUNCE_FLAG_NETWORKPRINTER 0x00000004 -#define RDPDR_PRINTER_ANNOUNCE_FLAG_TSPRINTER 0x00000008 -#define RDPDR_PRINTER_ANNOUNCE_FLAG_XPSFORMAT 0x00000010 - +#define RDPDR_PRINTER_ANNOUNCE_FLAG_ASCII 0x00000001 +#define RDPDR_PRINTER_ANNOUNCE_FLAG_DEFAULTPRINTER 0x00000002 +#define RDPDR_PRINTER_ANNOUNCE_FLAG_NETWORKPRINTER 0x00000004 +#define RDPDR_PRINTER_ANNOUNCE_FLAG_TSPRINTER 0x00000008 +#define RDPDR_PRINTER_ANNOUNCE_FLAG_XPSFORMAT 0x00000010 #endif /* FREERDP_CHANNEL_PRINTER_PRINTER_H */ diff --git a/channels/rail/client/rail_main.c b/channels/rail/client/rail_main.c index fb9add9d9..ce58070f0 100644 --- a/channels/rail/client/rail_main.c +++ b/channels/rail/client/rail_main.c @@ -42,7 +42,7 @@ RailClientContext* rail_get_client_interface(railPlugin* rail) if (!rail) return NULL; - pInterface = (RailClientContext*) rail->channelEntryPoints.pInterface; + pInterface = (RailClientContext*)rail->channelEntryPoints.pInterface; return pInterface; } @@ -61,13 +61,13 @@ static UINT rail_send(railPlugin* rail, wStream* s) return CHANNEL_RC_BAD_INIT_HANDLE; } - status = rail->channelEntryPoints.pVirtualChannelWriteEx(rail->InitHandle, rail->OpenHandle, - Stream_Buffer(s), (UINT32) Stream_GetPosition(s), s); + status = rail->channelEntryPoints.pVirtualChannelWriteEx( + rail->InitHandle, rail->OpenHandle, Stream_Buffer(s), (UINT32)Stream_GetPosition(s), s); if (status != CHANNEL_RC_OK) { Stream_Free(s, TRUE); - WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08"PRIX32"]", + WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08" PRIX32 "]", WTSErrorToString(status), status); } @@ -109,8 +109,7 @@ UINT rail_send_channel_data(railPlugin* rail, wStream* src) * * @return 0 on success, otherwise a Win32 error code */ -static UINT rail_client_execute(RailClientContext* context, - const RAIL_EXEC_ORDER* exec) +static UINT rail_client_execute(RailClientContext* context, const RAIL_EXEC_ORDER* exec) { char* exeOrFile; UINT error; @@ -123,7 +122,7 @@ static UINT rail_client_execute(RailClientContext* context, if (!context || !exec) return ERROR_INVALID_PARAMETER; - rail = (railPlugin*) context->handle; + rail = (railPlugin*)context->handle; exeOrFile = exec->RemoteApplicationProgram; flags = exec->flags; @@ -151,15 +150,14 @@ static UINT rail_client_execute(RailClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rail_client_activate(RailClientContext* context, - const RAIL_ACTIVATE_ORDER* activate) +static UINT rail_client_activate(RailClientContext* context, const RAIL_ACTIVATE_ORDER* activate) { railPlugin* rail; if (!context || !activate) return ERROR_INVALID_PARAMETER; - rail = (railPlugin*) context->handle; + rail = (railPlugin*)context->handle; return rail_send_client_activate_order(rail, activate); } @@ -168,8 +166,7 @@ static UINT rail_client_activate(RailClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rail_send_client_sysparam(RailClientContext* context, - RAIL_SYSPARAM_ORDER* sysparam) +static UINT rail_send_client_sysparam(RailClientContext* context, RAIL_SYSPARAM_ORDER* sysparam) { wStream* s; size_t length = RAIL_SYSPARAM_ORDER_LENGTH; @@ -179,7 +176,7 @@ static UINT rail_send_client_sysparam(RailClientContext* context, if (!context || !sysparam) return ERROR_INVALID_PARAMETER; - rail = (railPlugin*) context->handle; + rail = (railPlugin*)context->handle; switch (sysparam->param) { @@ -224,14 +221,14 @@ static UINT rail_send_client_sysparam(RailClientContext* context, if ((error = rail_write_client_sysparam_order(rail, s, sysparam))) { - WLog_ERR(TAG, "rail_write_client_sysparam_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_write_client_sysparam_order failed with error %" PRIu32 "!", error); Stream_Free(s, TRUE); return error; } if ((error = rail_send_pdu(rail, s, TS_RAIL_ORDER_SYSPARAM))) { - WLog_ERR(TAG, "rail_send_pdu failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_pdu failed with error %" PRIu32 "!", error); } Stream_Free(s, TRUE); @@ -260,7 +257,7 @@ static UINT rail_client_system_param(RailClientContext* context, if ((error = rail_send_client_sysparam(context, &sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_client_sysparam failed with error %" PRIu32 "!", error); return error; } } @@ -271,7 +268,7 @@ static UINT rail_client_system_param(RailClientContext* context, if ((error = rail_send_client_sysparam(context, &sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_client_sysparam failed with error %" PRIu32 "!", error); return error; } } @@ -282,7 +279,7 @@ static UINT rail_client_system_param(RailClientContext* context, if ((error = rail_send_client_sysparam(context, &sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_client_sysparam failed with error %" PRIu32 "!", error); return error; } } @@ -293,7 +290,7 @@ static UINT rail_client_system_param(RailClientContext* context, if ((error = rail_send_client_sysparam(context, &sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_client_sysparam failed with error %" PRIu32 "!", error); return error; } } @@ -304,7 +301,7 @@ static UINT rail_client_system_param(RailClientContext* context, if ((error = rail_send_client_sysparam(context, &sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_client_sysparam failed with error %" PRIu32 "!", error); return error; } } @@ -315,7 +312,7 @@ static UINT rail_client_system_param(RailClientContext* context, if ((error = rail_send_client_sysparam(context, &sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_client_sysparam failed with error %" PRIu32 "!", error); return error; } } @@ -326,7 +323,7 @@ static UINT rail_client_system_param(RailClientContext* context, if ((error = rail_send_client_sysparam(context, &sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_client_sysparam failed with error %" PRIu32 "!", error); return error; } } @@ -361,7 +358,7 @@ static UINT rail_client_system_command(RailClientContext* context, if (!context || !syscommand) return ERROR_INVALID_PARAMETER; - rail = (railPlugin*) context->handle; + rail = (railPlugin*)context->handle; return rail_send_client_syscommand_order(rail, syscommand); } @@ -370,15 +367,14 @@ static UINT rail_client_system_command(RailClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rail_client_handshake(RailClientContext* context, - const RAIL_HANDSHAKE_ORDER* handshake) +static UINT rail_client_handshake(RailClientContext* context, const RAIL_HANDSHAKE_ORDER* handshake) { railPlugin* rail; if (!context || !handshake) return ERROR_INVALID_PARAMETER; - rail = (railPlugin*) context->handle; + rail = (railPlugin*)context->handle; return rail_send_handshake_order(rail, handshake); } @@ -387,8 +383,7 @@ static UINT rail_client_handshake(RailClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rail_server_handshake(RailClientContext* context, - const RAIL_HANDSHAKE_ORDER* handshake) +static UINT rail_server_handshake(RailClientContext* context, const RAIL_HANDSHAKE_ORDER* handshake) { if (!context || !handshake) return ERROR_INVALID_PARAMETER; @@ -409,7 +404,7 @@ static UINT rail_server_handshake_ex(RailClientContext* context, if (!context || !handshakeEx) return ERROR_INVALID_PARAMETER; - rail = (railPlugin*) context->handle; + rail = (railPlugin*)context->handle; return CHANNEL_RC_OK; } @@ -426,7 +421,7 @@ static UINT rail_client_notify_event(RailClientContext* context, if (!context || !notifyEvent) return ERROR_INVALID_PARAMETER; - rail = (railPlugin*) context->handle; + rail = (railPlugin*)context->handle; return rail_send_client_notify_event_order(rail, notifyEvent); } @@ -443,7 +438,7 @@ static UINT rail_client_window_move(RailClientContext* context, if (!context || !windowMove) return ERROR_INVALID_PARAMETER; - rail = (railPlugin*) context->handle; + rail = (railPlugin*)context->handle; return rail_send_client_window_move_order(rail, windowMove); } @@ -488,7 +483,7 @@ static UINT rail_client_information(RailClientContext* context, if (!context || !clientStatus) return ERROR_INVALID_PARAMETER; - rail = (railPlugin*) context->handle; + rail = (railPlugin*)context->handle; return rail_send_client_status_order(rail, clientStatus); } @@ -497,15 +492,14 @@ static UINT rail_client_information(RailClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rail_client_system_menu(RailClientContext* context, - const RAIL_SYSMENU_ORDER* sysmenu) +static UINT rail_client_system_menu(RailClientContext* context, const RAIL_SYSMENU_ORDER* sysmenu) { railPlugin* rail; if (!context || !sysmenu) return ERROR_INVALID_PARAMETER; - rail = (railPlugin*) context->handle; + rail = (railPlugin*)context->handle; return rail_send_client_sysmenu_order(rail, sysmenu); } @@ -515,14 +509,14 @@ static UINT rail_client_system_menu(RailClientContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT rail_client_language_bar_info(RailClientContext* context, - const RAIL_LANGBAR_INFO_ORDER* langBarInfo) + const RAIL_LANGBAR_INFO_ORDER* langBarInfo) { railPlugin* rail; if (!context || !langBarInfo) return ERROR_INVALID_PARAMETER; - rail = (railPlugin*) context->handle; + rail = (railPlugin*)context->handle; return rail_send_client_langbar_info_order(rail, langBarInfo); } @@ -532,7 +526,7 @@ static UINT rail_client_language_bar_info(RailClientContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT rail_server_language_bar_info(RailClientContext* context, - const RAIL_LANGBAR_INFO_ORDER* langBarInfo) + const RAIL_LANGBAR_INFO_ORDER* langBarInfo) { if (!context || !langBarInfo) return ERROR_INVALID_PARAMETER; @@ -541,14 +535,14 @@ static UINT rail_server_language_bar_info(RailClientContext* context, } static UINT rail_client_language_ime_info(RailClientContext* context, - const RAIL_LANGUAGEIME_INFO_ORDER* langImeInfo) + const RAIL_LANGUAGEIME_INFO_ORDER* langImeInfo) { railPlugin* rail; if (!context || !langImeInfo) return ERROR_INVALID_PARAMETER; - rail = (railPlugin*) context->handle; + rail = (railPlugin*)context->handle; return rail_send_client_languageime_info_order(rail, langImeInfo); } @@ -572,38 +566,36 @@ static UINT rail_server_execute_result(RailClientContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT rail_client_get_appid_request(RailClientContext* context, - const RAIL_GET_APPID_REQ_ORDER* getAppIdReq) + const RAIL_GET_APPID_REQ_ORDER* getAppIdReq) { railPlugin* rail; if (!context || !getAppIdReq || !context->handle) return ERROR_INVALID_PARAMETER; - rail = (railPlugin*) context->handle; + rail = (railPlugin*)context->handle; return rail_send_client_get_appid_req_order(rail, getAppIdReq); } -static UINT rail_client_cloak(RailClientContext* context, - const RAIL_CLOAK* cloak) +static UINT rail_client_cloak(RailClientContext* context, const RAIL_CLOAK* cloak) { railPlugin* rail; if (!context || !cloak || !context->handle) return ERROR_INVALID_PARAMETER; - rail = (railPlugin*) context->handle; + rail = (railPlugin*)context->handle; return rail_send_client_order_cloak_order(rail, cloak); } -static UINT rail_client_snap_arrange(RailClientContext* context, - const RAIL_SNAP_ARRANGE* snap) +static UINT rail_client_snap_arrange(RailClientContext* context, const RAIL_SNAP_ARRANGE* snap) { railPlugin* rail; if (!context || !snap || !context->handle) return ERROR_INVALID_PARAMETER; - rail = (railPlugin*) context->handle; + rail = (railPlugin*)context->handle; return rail_send_client_order_snap_arrange_order(rail, snap); } @@ -613,7 +605,7 @@ static UINT rail_client_snap_arrange(RailClientContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT rail_server_get_appid_response(RailClientContext* context, - const RAIL_GET_APPID_RESP_ORDER* getAppIdResp) + const RAIL_GET_APPID_RESP_ORDER* getAppIdResp) { if (!context || !getAppIdResp) return ERROR_INVALID_PARAMETER; @@ -626,8 +618,9 @@ static UINT rail_server_get_appid_response(RailClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rail_virtual_channel_event_data_received(railPlugin* rail, - void* pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) +static UINT rail_virtual_channel_event_data_received(railPlugin* rail, void* pData, + UINT32 dataLength, UINT32 totalLength, + UINT32 dataFlags) { wStream* data_in; @@ -652,7 +645,7 @@ static UINT rail_virtual_channel_event_data_received(railPlugin* rail, data_in = rail->data_in; - if (!Stream_EnsureRemainingCapacity(data_in, (int) dataLength)) + if (!Stream_EnsureRemainingCapacity(data_in, (int)dataLength)) { WLog_ERR(TAG, "Stream_EnsureRemainingCapacity failed!"); return CHANNEL_RC_NO_MEMORY; @@ -664,7 +657,7 @@ static UINT rail_virtual_channel_event_data_received(railPlugin* rail, { if (Stream_Capacity(data_in) != Stream_GetPosition(data_in)) { - WLog_ERR(TAG, "rail_plugin_process_received: read error"); + WLog_ERR(TAG, "rail_plugin_process_received: read error"); return ERROR_INTERNAL_ERROR; } @@ -672,7 +665,7 @@ static UINT rail_virtual_channel_event_data_received(railPlugin* rail, Stream_SealLength(data_in); Stream_SetPosition(data_in, 0); - if (!MessageQueue_Post(rail->queue, NULL, 0, (void*) data_in, NULL)) + if (!MessageQueue_Post(rail->queue, NULL, 0, (void*)data_in, NULL)) { WLog_ERR(TAG, "MessageQueue_Post failed!"); return ERROR_INTERNAL_ERROR; @@ -683,11 +676,12 @@ static UINT rail_virtual_channel_event_data_received(railPlugin* rail, } static VOID VCAPITYPE rail_virtual_channel_open_event_ex(LPVOID lpUserParam, DWORD openHandle, - UINT event, - LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) + UINT event, LPVOID pData, + UINT32 dataLength, UINT32 totalLength, + UINT32 dataFlags) { UINT error = CHANNEL_RC_OK; - railPlugin* rail = (railPlugin*) lpUserParam; + railPlugin* rail = (railPlugin*)lpUserParam; if (!rail || (rail->OpenHandle != openHandle)) { @@ -699,8 +693,9 @@ static VOID VCAPITYPE rail_virtual_channel_open_event_ex(LPVOID lpUserParam, DWO { case CHANNEL_EVENT_DATA_RECEIVED: if ((error = rail_virtual_channel_event_data_received(rail, pData, dataLength, - totalLength, dataFlags))) - WLog_ERR(TAG, "rail_virtual_channel_event_data_received failed with error %"PRIu32"!", + totalLength, dataFlags))) + WLog_ERR(TAG, + "rail_virtual_channel_event_data_received failed with error %" PRIu32 "!", error); break; @@ -711,7 +706,7 @@ static VOID VCAPITYPE rail_virtual_channel_open_event_ex(LPVOID lpUserParam, DWO wStream* s = (wStream*)pData; Stream_Free(s, TRUE); } - break; + break; case CHANNEL_EVENT_USER: break; @@ -728,7 +723,7 @@ static DWORD WINAPI rail_virtual_channel_client_thread(LPVOID arg) { wStream* data; wMessage message; - railPlugin* rail = (railPlugin*) arg; + railPlugin* rail = (railPlugin*)arg; UINT error = CHANNEL_RC_OK; while (1) @@ -752,13 +747,13 @@ static DWORD WINAPI rail_virtual_channel_client_thread(LPVOID arg) if (message.id == 0) { - data = (wStream*) message.wParam; + data = (wStream*)message.wParam; error = rail_order_recv(rail, data); Stream_Free(data, TRUE); if (error) { - WLog_ERR(TAG, "rail_order_recv failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_order_recv failed with error %" PRIu32 "!", error); break; } } @@ -777,16 +772,16 @@ static DWORD WINAPI rail_virtual_channel_client_thread(LPVOID arg) * * @return 0 on success, otherwise a Win32 error code */ -static UINT rail_virtual_channel_event_connected(railPlugin* rail, LPVOID pData, - UINT32 dataLength) +static UINT rail_virtual_channel_event_connected(railPlugin* rail, LPVOID pData, UINT32 dataLength) { UINT status; - status = rail->channelEntryPoints.pVirtualChannelOpenEx(rail->InitHandle, - &rail->OpenHandle, rail->channelDef.name, rail_virtual_channel_open_event_ex); + status = rail->channelEntryPoints.pVirtualChannelOpenEx(rail->InitHandle, &rail->OpenHandle, + rail->channelDef.name, + rail_virtual_channel_open_event_ex); if (status != CHANNEL_RC_OK) { - WLog_ERR(TAG, "pVirtualChannelOpen failed with %s [%08"PRIX32"]", + WLog_ERR(TAG, "pVirtualChannelOpen failed with %s [%08" PRIX32 "]", WTSErrorToString(status), status); return status; } @@ -799,9 +794,8 @@ static UINT rail_virtual_channel_event_connected(railPlugin* rail, LPVOID pData, return CHANNEL_RC_NO_MEMORY; } - if (!(rail->thread = CreateThread(NULL, 0, - rail_virtual_channel_client_thread, (void*) rail, 0, - NULL))) + if (!(rail->thread = + CreateThread(NULL, 0, rail_virtual_channel_client_thread, (void*)rail, 0, NULL))) { WLog_ERR(TAG, "CreateThread failed!"); MessageQueue_Free(rail->queue); @@ -824,11 +818,11 @@ static UINT rail_virtual_channel_event_disconnected(railPlugin* rail) if (rail->OpenHandle == 0) return CHANNEL_RC_OK; - if (MessageQueue_PostQuit(rail->queue, 0) - && (WaitForSingleObject(rail->thread, INFINITE) == WAIT_FAILED)) + if (MessageQueue_PostQuit(rail->queue, 0) && + (WaitForSingleObject(rail->thread, INFINITE) == WAIT_FAILED)) { rc = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", rc); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", rc); return rc; } @@ -840,8 +834,8 @@ static UINT rail_virtual_channel_event_disconnected(railPlugin* rail) if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "pVirtualChannelCloseEx failed with %s [%08"PRIX32"]", - WTSErrorToString(rc), rc); + WLog_ERR(TAG, "pVirtualChannelCloseEx failed with %s [%08" PRIX32 "]", WTSErrorToString(rc), + rc); return rc; } @@ -864,14 +858,14 @@ static void rail_virtual_channel_event_terminated(railPlugin* rail) } static VOID VCAPITYPE rail_virtual_channel_init_event_ex(LPVOID lpUserParam, LPVOID pInitHandle, - UINT event, LPVOID pData, UINT dataLength) + UINT event, LPVOID pData, UINT dataLength) { UINT error = CHANNEL_RC_OK; - railPlugin* rail = (railPlugin*) lpUserParam; + railPlugin* rail = (railPlugin*)lpUserParam; if (!rail || (rail->InitHandle != pInitHandle)) { - WLog_ERR(TAG, "error no match"); + WLog_ERR(TAG, "error no match"); return; } @@ -879,14 +873,15 @@ static VOID VCAPITYPE rail_virtual_channel_init_event_ex(LPVOID lpUserParam, LPV { case CHANNEL_EVENT_CONNECTED: if ((error = rail_virtual_channel_event_connected(rail, pData, dataLength))) - WLog_ERR(TAG, "rail_virtual_channel_event_connected failed with error %"PRIu32"!", + WLog_ERR(TAG, "rail_virtual_channel_event_connected failed with error %" PRIu32 "!", error); break; case CHANNEL_EVENT_DISCONNECTED: if ((error = rail_virtual_channel_event_disconnected(rail))) - WLog_ERR(TAG, "rail_virtual_channel_event_disconnected failed with error %"PRIu32"!", + WLog_ERR(TAG, + "rail_virtual_channel_event_disconnected failed with error %" PRIu32 "!", error); break; @@ -902,11 +897,12 @@ static VOID VCAPITYPE rail_virtual_channel_init_event_ex(LPVOID lpUserParam, LPV } if (error && rail->rdpcontext) - setChannelError(rail->rdpcontext, error, "rail_virtual_channel_init_event_ex reported an error"); + setChannelError(rail->rdpcontext, error, + "rail_virtual_channel_init_event_ex reported an error"); } /* rail is always built-in */ -#define VirtualChannelEntryEx rail_VirtualChannelEntryEx +#define VirtualChannelEntryEx rail_VirtualChannelEntryEx BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID pInitHandle) { @@ -915,7 +911,7 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p RailClientContext* context = NULL; CHANNEL_ENTRY_POINTS_FREERDP_EX* pEntryPointsEx; BOOL isFreerdp = FALSE; - rail = (railPlugin*) calloc(1, sizeof(railPlugin)); + rail = (railPlugin*)calloc(1, sizeof(railPlugin)); if (!rail) { @@ -923,18 +919,15 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p return FALSE; } - rail->channelDef.options = - CHANNEL_OPTION_INITIALIZED | - CHANNEL_OPTION_ENCRYPT_RDP | - CHANNEL_OPTION_COMPRESS_RDP | - CHANNEL_OPTION_SHOW_PROTOCOL; + rail->channelDef.options = CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP | + CHANNEL_OPTION_COMPRESS_RDP | CHANNEL_OPTION_SHOW_PROTOCOL; sprintf_s(rail->channelDef.name, ARRAYSIZE(rail->channelDef.name), "rail"); - pEntryPointsEx = (CHANNEL_ENTRY_POINTS_FREERDP_EX*) pEntryPoints; + pEntryPointsEx = (CHANNEL_ENTRY_POINTS_FREERDP_EX*)pEntryPoints; if ((pEntryPointsEx->cbSize >= sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX)) && (pEntryPointsEx->MagicNumber == FREERDP_CHANNEL_MAGIC_NUMBER)) { - context = (RailClientContext*) calloc(1, sizeof(RailClientContext)); + context = (RailClientContext*)calloc(1, sizeof(RailClientContext)); if (!context) { @@ -943,7 +936,7 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p return FALSE; } - context->handle = (void*) rail; + context->handle = (void*)rail; context->custom = NULL; context->ClientExecute = rail_client_execute; context->ClientActivate = rail_client_activate; @@ -974,17 +967,15 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p rail->log = WLog_Get("com.freerdp.channels.rail.client"); WLog_Print(rail->log, WLOG_DEBUG, "VirtualChannelEntryEx"); - CopyMemory(&(rail->channelEntryPoints), pEntryPoints, - sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX)); + CopyMemory(&(rail->channelEntryPoints), pEntryPoints, sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX)); rail->InitHandle = pInitHandle; - rc = rail->channelEntryPoints.pVirtualChannelInitEx(rail, context, pInitHandle, - &rail->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000, - rail_virtual_channel_init_event_ex); + rc = rail->channelEntryPoints.pVirtualChannelInitEx( + rail, context, pInitHandle, &rail->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000, + rail_virtual_channel_init_event_ex); if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "failed with %s [%08"PRIX32"]", - WTSErrorToString(rc), rc); + WLog_ERR(TAG, "failed with %s [%08" PRIX32 "]", WTSErrorToString(rc), rc); goto error_out; } diff --git a/channels/rail/client/rail_orders.c b/channels/rail/client/rail_orders.c index 72fd99e87..309654287 100644 --- a/channels/rail/client/rail_orders.c +++ b/channels/rail/client/rail_orders.c @@ -48,7 +48,7 @@ static UINT rail_write_unicode_string(wStream* s, const RAIL_UNICODE_STRING* uni return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT16(s, unicode_string->length); /* cbString (2 bytes) */ + Stream_Write_UINT16(s, unicode_string->length); /* cbString (2 bytes) */ Stream_Write(s, unicode_string->string, unicode_string->length); /* string */ return CHANNEL_RC_OK; } @@ -65,7 +65,7 @@ static UINT rail_write_unicode_string_value(wStream* s, const RAIL_UNICODE_STRIN if (!s || !unicode_string) return ERROR_INVALID_PARAMETER; - length = unicode_string->length; + length = unicode_string->length; if (length > 0) { @@ -93,12 +93,13 @@ UINT rail_send_pdu(railPlugin* rail, wStream* s, UINT16 orderType) if (!rail || !s) return ERROR_INVALID_PARAMETER; - orderLength = (UINT16) Stream_GetPosition(s); + orderLength = (UINT16)Stream_GetPosition(s); Stream_SetPosition(s, 0); rail_write_pdu_header(s, orderType, orderLength); Stream_SetPosition(s, orderLength); - WLog_Print(rail->log, WLOG_DEBUG, "Sending %s PDU, length: %"PRIu16"", - RAIL_ORDER_TYPE_STRINGS[((orderType & 0xF0) >> 3) + (orderType & 0x0F)], orderLength); + WLog_Print(rail->log, WLOG_DEBUG, "Sending %s PDU, length: %" PRIu16 "", + RAIL_ORDER_TYPE_STRINGS[((orderType & 0xF0) >> 3) + (orderType & 0x0F)], + orderLength); return rail_send_channel_data(rail, s); } @@ -116,7 +117,7 @@ static UINT rail_write_high_contrast(wStream* s, const RAIL_HIGH_CONTRAST* highC colorSchemeLength = highContrast->colorScheme.length + 2; Stream_Write_UINT32(s, highContrast->flags); /* flags (4 bytes) */ - Stream_Write_UINT32(s, colorSchemeLength); /* colorSchemeLength (4 bytes) */ + Stream_Write_UINT32(s, colorSchemeLength); /* colorSchemeLength (4 bytes) */ return rail_write_unicode_string(s, &highContrast->colorScheme); /* colorScheme */ } @@ -149,11 +150,13 @@ static UINT rail_read_server_exec_result_order(wStream* s, RAIL_EXEC_RESULT_ORDE return ERROR_INVALID_DATA; } - Stream_Read_UINT16(s, execResult->flags); /* flags (2 bytes) */ + Stream_Read_UINT16(s, execResult->flags); /* flags (2 bytes) */ Stream_Read_UINT16(s, execResult->execResult); /* execResult (2 bytes) */ - Stream_Read_UINT32(s, execResult->rawResult); /* rawResult (4 bytes) */ - Stream_Seek_UINT16(s); /* padding (2 bytes) */ - return rail_read_unicode_string(s, &execResult->exeOrFile) ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; /* exeOrFile */ + Stream_Read_UINT32(s, execResult->rawResult); /* rawResult (4 bytes) */ + Stream_Seek_UINT16(s); /* padding (2 bytes) */ + return rail_read_unicode_string(s, &execResult->exeOrFile) + ? CHANNEL_RC_OK + : ERROR_INTERNAL_ERROR; /* exeOrFile */ } /** @@ -175,7 +178,7 @@ static UINT rail_read_server_sysparam_order(wStream* s, RAIL_SYSPARAM_ORDER* sys } Stream_Read_UINT32(s, sysparam->param); /* systemParam (4 bytes) */ - Stream_Read_UINT8(s, body); /* body (1 byte) */ + Stream_Read_UINT8(s, body); /* body (1 byte) */ switch (sysparam->param) { @@ -210,14 +213,14 @@ static UINT rail_read_server_minmaxinfo_order(wStream* s, RAIL_MINMAXINFO_ORDER* return ERROR_INVALID_DATA; } - Stream_Read_UINT32(s, minmaxinfo->windowId); /* windowId (4 bytes) */ - Stream_Read_INT16(s, minmaxinfo->maxWidth); /* maxWidth (2 bytes) */ - Stream_Read_INT16(s, minmaxinfo->maxHeight); /* maxHeight (2 bytes) */ - Stream_Read_INT16(s, minmaxinfo->maxPosX); /* maxPosX (2 bytes) */ - Stream_Read_INT16(s, minmaxinfo->maxPosY); /* maxPosY (2 bytes) */ - Stream_Read_INT16(s, minmaxinfo->minTrackWidth); /* minTrackWidth (2 bytes) */ + Stream_Read_UINT32(s, minmaxinfo->windowId); /* windowId (4 bytes) */ + Stream_Read_INT16(s, minmaxinfo->maxWidth); /* maxWidth (2 bytes) */ + Stream_Read_INT16(s, minmaxinfo->maxHeight); /* maxHeight (2 bytes) */ + Stream_Read_INT16(s, minmaxinfo->maxPosX); /* maxPosX (2 bytes) */ + Stream_Read_INT16(s, minmaxinfo->maxPosY); /* maxPosY (2 bytes) */ + Stream_Read_INT16(s, minmaxinfo->minTrackWidth); /* minTrackWidth (2 bytes) */ Stream_Read_INT16(s, minmaxinfo->minTrackHeight); /* minTrackHeight (2 bytes) */ - Stream_Read_INT16(s, minmaxinfo->maxTrackWidth); /* maxTrackWidth (2 bytes) */ + Stream_Read_INT16(s, minmaxinfo->maxTrackWidth); /* maxTrackWidth (2 bytes) */ Stream_Read_INT16(s, minmaxinfo->maxTrackHeight); /* maxTrackHeight (2 bytes) */ return CHANNEL_RC_OK; } @@ -228,7 +231,7 @@ static UINT rail_read_server_minmaxinfo_order(wStream* s, RAIL_MINMAXINFO_ORDER* * @return 0 on success, otherwise a Win32 error code */ static UINT rail_read_server_localmovesize_order(wStream* s, - RAIL_LOCALMOVESIZE_ORDER* localMoveSize) + RAIL_LOCALMOVESIZE_ORDER* localMoveSize) { UINT16 isMoveSizeStart; @@ -242,11 +245,11 @@ static UINT rail_read_server_localmovesize_order(wStream* s, } Stream_Read_UINT32(s, localMoveSize->windowId); /* windowId (4 bytes) */ - Stream_Read_UINT16(s, isMoveSizeStart); /* isMoveSizeStart (2 bytes) */ + Stream_Read_UINT16(s, isMoveSizeStart); /* isMoveSizeStart (2 bytes) */ localMoveSize->isMoveSizeStart = (isMoveSizeStart != 0) ? TRUE : FALSE; Stream_Read_UINT16(s, localMoveSize->moveSizeType); /* moveSizeType (2 bytes) */ - Stream_Read_INT16(s, localMoveSize->posX); /* posX (2 bytes) */ - Stream_Read_INT16(s, localMoveSize->posY); /* posY (2 bytes) */ + Stream_Read_INT16(s, localMoveSize->posX); /* posX (2 bytes) */ + Stream_Read_INT16(s, localMoveSize->posY); /* posY (2 bytes) */ return CHANNEL_RC_OK; } @@ -256,7 +259,7 @@ static UINT rail_read_server_localmovesize_order(wStream* s, * @return 0 on success, otherwise a Win32 error code */ static UINT rail_read_server_get_appid_resp_order(wStream* s, - RAIL_GET_APPID_RESP_ORDER* getAppidResp) + RAIL_GET_APPID_RESP_ORDER* getAppidResp) { if (!s || !getAppidResp) return ERROR_INVALID_PARAMETER; @@ -268,7 +271,8 @@ static UINT rail_read_server_get_appid_resp_order(wStream* s, } Stream_Read_UINT32(s, getAppidResp->windowId); /* windowId (4 bytes) */ - Stream_Read(s, (BYTE*) & (getAppidResp->applicationId), 520); /* applicationId (260 UNICODE chars) */ + Stream_Read(s, (BYTE*)&(getAppidResp->applicationId), + 520); /* applicationId (260 UNICODE chars) */ return CHANNEL_RC_OK; } @@ -307,8 +311,9 @@ static UINT rail_write_client_status_order(wStream* s, const RAIL_CLIENT_STATUS_ * @return 0 on success, otherwise a Win32 error code */ static UINT rail_write_client_exec_order(wStream* s, UINT16 flags, - const RAIL_UNICODE_STRING* exeOrFile, const RAIL_UNICODE_STRING* workingDir, - const RAIL_UNICODE_STRING* arguments) + const RAIL_UNICODE_STRING* exeOrFile, + const RAIL_UNICODE_STRING* workingDir, + const RAIL_UNICODE_STRING* arguments) { UINT error; @@ -317,35 +322,35 @@ static UINT rail_write_client_exec_order(wStream* s, UINT16 flags, /* [MS-RDPERP] 2.2.2.3.1 Client Execute PDU (TS_RAIL_ORDER_EXEC) * Check argument limits */ - if ((exeOrFile->length > 520) || (workingDir->length > 520) || - (arguments->length > 16000)) + if ((exeOrFile->length > 520) || (workingDir->length > 520) || (arguments->length > 16000)) { WLog_ERR(TAG, - "TS_RAIL_ORDER_EXEC argument limits exceeded: ExeOrFile=%"PRIu16" [max=520], WorkingDir=%"PRIu16" [max=520], Arguments=%"PRIu16" [max=16000]", + "TS_RAIL_ORDER_EXEC argument limits exceeded: ExeOrFile=%" PRIu16 + " [max=520], WorkingDir=%" PRIu16 " [max=520], Arguments=%" PRIu16 " [max=16000]", exeOrFile->length, workingDir->length, arguments->length); return ERROR_BAD_ARGUMENTS; } - Stream_Write_UINT16(s, flags); /* flags (2 bytes) */ - Stream_Write_UINT16(s, exeOrFile->length); /* exeOrFileLength (2 bytes) */ + Stream_Write_UINT16(s, flags); /* flags (2 bytes) */ + Stream_Write_UINT16(s, exeOrFile->length); /* exeOrFileLength (2 bytes) */ Stream_Write_UINT16(s, workingDir->length); /* workingDirLength (2 bytes) */ - Stream_Write_UINT16(s, arguments->length); /* argumentsLength (2 bytes) */ + Stream_Write_UINT16(s, arguments->length); /* argumentsLength (2 bytes) */ if ((error = rail_write_unicode_string_value(s, exeOrFile))) { - WLog_ERR(TAG, "rail_write_unicode_string_value failed with error %"PRIu32"", error); + WLog_ERR(TAG, "rail_write_unicode_string_value failed with error %" PRIu32 "", error); return error; } if ((error = rail_write_unicode_string_value(s, workingDir))) { - WLog_ERR(TAG, "rail_write_unicode_string_value failed with error %"PRIu32"", error); + WLog_ERR(TAG, "rail_write_unicode_string_value failed with error %" PRIu32 "", error); return error; } if ((error = rail_write_unicode_string_value(s, arguments))) { - WLog_ERR(TAG, "rail_write_unicode_string_value failed with error %"PRIu32"", error); + WLog_ERR(TAG, "rail_write_unicode_string_value failed with error %" PRIu32 "", error); return error; } @@ -391,23 +396,23 @@ UINT rail_write_client_sysparam_order(railPlugin* rail, wStream* s, break; case SPI_SET_WORK_AREA: - Stream_Write_UINT16(s, sysparam->workArea.left); /* left (2 bytes) */ - Stream_Write_UINT16(s, sysparam->workArea.top); /* top (2 bytes) */ - Stream_Write_UINT16(s, sysparam->workArea.right); /* right (2 bytes) */ + Stream_Write_UINT16(s, sysparam->workArea.left); /* left (2 bytes) */ + Stream_Write_UINT16(s, sysparam->workArea.top); /* top (2 bytes) */ + Stream_Write_UINT16(s, sysparam->workArea.right); /* right (2 bytes) */ Stream_Write_UINT16(s, sysparam->workArea.bottom); /* bottom (2 bytes) */ break; case SPI_DISPLAY_CHANGE: - Stream_Write_UINT16(s, sysparam->displayChange.left); /* left (2 bytes) */ - Stream_Write_UINT16(s, sysparam->displayChange.top); /* top (2 bytes) */ - Stream_Write_UINT16(s, sysparam->displayChange.right); /* right (2 bytes) */ + Stream_Write_UINT16(s, sysparam->displayChange.left); /* left (2 bytes) */ + Stream_Write_UINT16(s, sysparam->displayChange.top); /* top (2 bytes) */ + Stream_Write_UINT16(s, sysparam->displayChange.right); /* right (2 bytes) */ Stream_Write_UINT16(s, sysparam->displayChange.bottom); /* bottom (2 bytes) */ break; case SPI_TASKBAR_POS: - Stream_Write_UINT16(s, sysparam->taskbarPos.left); /* left (2 bytes) */ - Stream_Write_UINT16(s, sysparam->taskbarPos.top); /* top (2 bytes) */ - Stream_Write_UINT16(s, sysparam->taskbarPos.right); /* right (2 bytes) */ + Stream_Write_UINT16(s, sysparam->taskbarPos.left); /* left (2 bytes) */ + Stream_Write_UINT16(s, sysparam->taskbarPos.top); /* top (2 bytes) */ + Stream_Write_UINT16(s, sysparam->taskbarPos.right); /* right (2 bytes) */ Stream_Write_UINT16(s, sysparam->taskbarPos.bottom); /* bottom (2 bytes) */ break; @@ -472,8 +477,8 @@ static UINT rail_write_client_sysmenu_order(wStream* s, const RAIL_SYSMENU_ORDER return ERROR_INVALID_PARAMETER; Stream_Write_UINT32(s, sysmenu->windowId); /* windowId (4 bytes) */ - Stream_Write_INT16(s, sysmenu->left); /* left (2 bytes) */ - Stream_Write_INT16(s, sysmenu->top); /* top (2 bytes) */ + Stream_Write_INT16(s, sysmenu->left); /* left (2 bytes) */ + Stream_Write_INT16(s, sysmenu->top); /* top (2 bytes) */ return ERROR_SUCCESS; } @@ -483,38 +488,38 @@ static UINT rail_write_client_syscommand_order(wStream* s, const RAIL_SYSCOMMAND return ERROR_INVALID_PARAMETER; Stream_Write_UINT32(s, syscommand->windowId); /* windowId (4 bytes) */ - Stream_Write_UINT16(s, syscommand->command); /* command (2 bytes) */ + Stream_Write_UINT16(s, syscommand->command); /* command (2 bytes) */ return ERROR_SUCCESS; } static UINT rail_write_client_notify_event_order(wStream* s, - const RAIL_NOTIFY_EVENT_ORDER* notifyEvent) + const RAIL_NOTIFY_EVENT_ORDER* notifyEvent) { if (!s || !notifyEvent) return ERROR_INVALID_PARAMETER; - Stream_Write_UINT32(s, notifyEvent->windowId); /* windowId (4 bytes) */ + Stream_Write_UINT32(s, notifyEvent->windowId); /* windowId (4 bytes) */ Stream_Write_UINT32(s, notifyEvent->notifyIconId); /* notifyIconId (4 bytes) */ - Stream_Write_UINT32(s, notifyEvent->message); /* notifyIconId (4 bytes) */ + Stream_Write_UINT32(s, notifyEvent->message); /* notifyIconId (4 bytes) */ return ERROR_SUCCESS; } static UINT rail_write_client_window_move_order(wStream* s, - const RAIL_WINDOW_MOVE_ORDER* windowMove) + const RAIL_WINDOW_MOVE_ORDER* windowMove) { if (!s || !windowMove) return ERROR_INVALID_PARAMETER; Stream_Write_UINT32(s, windowMove->windowId); /* windowId (4 bytes) */ - Stream_Write_INT16(s, windowMove->left); /* left (2 bytes) */ - Stream_Write_INT16(s, windowMove->top); /* top (2 bytes) */ - Stream_Write_INT16(s, windowMove->right); /* right (2 bytes) */ - Stream_Write_INT16(s, windowMove->bottom); /* bottom (2 bytes) */ + Stream_Write_INT16(s, windowMove->left); /* left (2 bytes) */ + Stream_Write_INT16(s, windowMove->top); /* top (2 bytes) */ + Stream_Write_INT16(s, windowMove->right); /* right (2 bytes) */ + Stream_Write_INT16(s, windowMove->bottom); /* bottom (2 bytes) */ return ERROR_SUCCESS; } static UINT rail_write_client_get_appid_req_order(wStream* s, - const RAIL_GET_APPID_REQ_ORDER* getAppidReq) + const RAIL_GET_APPID_REQ_ORDER* getAppidReq) { if (!s || !getAppidReq) return ERROR_INVALID_PARAMETER; @@ -533,7 +538,7 @@ static UINT rail_write_langbar_info_order(wStream* s, const RAIL_LANGBAR_INFO_OR } static UINT rail_write_languageime_info_order(wStream* s, - const RAIL_LANGUAGEIME_INFO_ORDER* langImeInfo) + const RAIL_LANGUAGEIME_INFO_ORDER* langImeInfo) { if (!s || !langImeInfo) return ERROR_INVALID_PARAMETER; @@ -563,7 +568,7 @@ static UINT rail_recv_handshake_order(railPlugin* rail, wStream* s) if ((error = rail_read_handshake_order(s, &serverHandshake))) { - WLog_ERR(TAG, "rail_read_handshake_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_read_handshake_order failed with error %" PRIu32 "!", error); return error; } @@ -581,7 +586,7 @@ static UINT rail_recv_handshake_order(railPlugin* rail, wStream* s) IFCALLRET(context->ServerHandshake, error, context, &serverHandshake); if (error) - WLog_ERR(TAG, "context.ServerHandshake failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context.ServerHandshake failed with error %" PRIu32 "", error); } return error; @@ -624,7 +629,7 @@ static UINT rail_recv_handshake_ex_order(railPlugin* rail, wStream* s) if ((error = rail_read_handshake_ex_order(s, &serverHandshake))) { - WLog_ERR(TAG, "rail_read_handshake_ex_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_read_handshake_ex_order failed with error %" PRIu32 "!", error); return error; } @@ -643,7 +648,7 @@ static UINT rail_recv_handshake_ex_order(railPlugin* rail, wStream* s) IFCALLRET(context->ServerHandshakeEx, error, context, &serverHandshake); if (error) - WLog_ERR(TAG, "context.ServerHandshakeEx failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context.ServerHandshakeEx failed with error %" PRIu32 "", error); } return error; @@ -665,7 +670,7 @@ static UINT rail_recv_exec_result_order(railPlugin* rail, wStream* s) if ((error = rail_read_server_exec_result_order(s, &execResult))) { - WLog_ERR(TAG, "rail_read_server_exec_result_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_read_server_exec_result_order failed with error %" PRIu32 "!", error); goto fail; } @@ -674,7 +679,7 @@ static UINT rail_recv_exec_result_order(railPlugin* rail, wStream* s) IFCALLRET(context->ServerExecuteResult, error, context, &execResult); if (error) - WLog_ERR(TAG, "context.ServerExecuteResult failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context.ServerExecuteResult failed with error %" PRIu32 "", error); } fail: @@ -698,7 +703,7 @@ static UINT rail_recv_server_sysparam_order(railPlugin* rail, wStream* s) if ((error = rail_read_server_sysparam_order(s, &sysparam))) { - WLog_ERR(TAG, "rail_read_server_sysparam_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_read_server_sysparam_order failed with error %" PRIu32 "!", error); return error; } @@ -707,7 +712,7 @@ static UINT rail_recv_server_sysparam_order(railPlugin* rail, wStream* s) IFCALLRET(context->ServerSystemParam, error, context, &sysparam); if (error) - WLog_ERR(TAG, "context.ServerSystemParam failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context.ServerSystemParam failed with error %" PRIu32 "", error); } return error; @@ -729,7 +734,7 @@ static UINT rail_recv_server_minmaxinfo_order(railPlugin* rail, wStream* s) if ((error = rail_read_server_minmaxinfo_order(s, &minMaxInfo))) { - WLog_ERR(TAG, "rail_read_server_minmaxinfo_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_read_server_minmaxinfo_order failed with error %" PRIu32 "!", error); return error; } @@ -738,7 +743,7 @@ static UINT rail_recv_server_minmaxinfo_order(railPlugin* rail, wStream* s) IFCALLRET(context->ServerMinMaxInfo, error, context, &minMaxInfo); if (error) - WLog_ERR(TAG, "context.ServerMinMaxInfo failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context.ServerMinMaxInfo failed with error %" PRIu32 "", error); } return error; @@ -760,7 +765,7 @@ static UINT rail_recv_server_localmovesize_order(railPlugin* rail, wStream* s) if ((error = rail_read_server_localmovesize_order(s, &localMoveSize))) { - WLog_ERR(TAG, "rail_read_server_localmovesize_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_read_server_localmovesize_order failed with error %" PRIu32 "!", error); return error; } @@ -769,7 +774,7 @@ static UINT rail_recv_server_localmovesize_order(railPlugin* rail, wStream* s) IFCALLRET(context->ServerLocalMoveSize, error, context, &localMoveSize); if (error) - WLog_ERR(TAG, "context.ServerLocalMoveSize failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context.ServerLocalMoveSize failed with error %" PRIu32 "", error); } return error; @@ -791,7 +796,8 @@ static UINT rail_recv_server_get_appid_resp_order(railPlugin* rail, wStream* s) if ((error = rail_read_server_get_appid_resp_order(s, &getAppIdResp))) { - WLog_ERR(TAG, "rail_read_server_get_appid_resp_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_read_server_get_appid_resp_order failed with error %" PRIu32 "!", + error); return error; } @@ -800,7 +806,7 @@ static UINT rail_recv_server_get_appid_resp_order(railPlugin* rail, wStream* s) IFCALLRET(context->ServerGetAppIdResponse, error, context, &getAppIdResp); if (error) - WLog_ERR(TAG, "context.ServerGetAppIdResponse failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context.ServerGetAppIdResponse failed with error %" PRIu32 "", error); } return error; @@ -825,7 +831,7 @@ static UINT rail_recv_langbar_info_order(railPlugin* rail, wStream* s) if ((error = rail_read_langbar_info_order(s, &langBarInfo))) { - WLog_ERR(TAG, "rail_read_langbar_info_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_read_langbar_info_order failed with error %" PRIu32 "!", error); return error; } @@ -834,13 +840,12 @@ static UINT rail_recv_langbar_info_order(railPlugin* rail, wStream* s) IFCALLRET(context->ServerLanguageBarInfo, error, context, &langBarInfo); if (error) - WLog_ERR(TAG, "context.ServerLanguageBarInfo failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context.ServerLanguageBarInfo failed with error %" PRIu32 "", error); } return error; } - static UINT rail_read_taskbar_info_order(wStream* s, RAIL_TASKBAR_INFO_ORDER* taskbarInfo) { if (!s || !taskbarInfo) @@ -858,7 +863,6 @@ static UINT rail_read_taskbar_info_order(wStream* s, RAIL_TASKBAR_INFO_ORDER* ta return CHANNEL_RC_OK; } - static UINT rail_recv_taskbar_info_order(railPlugin* rail, wStream* s) { RailClientContext* context = rail_get_client_interface(rail); @@ -875,7 +879,7 @@ static UINT rail_recv_taskbar_info_order(railPlugin* rail, wStream* s) if ((error = rail_read_taskbar_info_order(s, &taskBarInfo))) { - WLog_ERR(TAG, "rail_read_langbar_info_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_read_langbar_info_order failed with error %" PRIu32 "!", error); return error; } @@ -884,7 +888,7 @@ static UINT rail_recv_taskbar_info_order(railPlugin* rail, wStream* s) IFCALLRET(context->ServerTaskBarInfo, error, context, &taskBarInfo); if (error) - WLog_ERR(TAG, "context.ServerLanguageBarInfo failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context.ServerLanguageBarInfo failed with error %" PRIu32 "", error); } return error; @@ -919,7 +923,7 @@ static UINT rail_recv_zorder_sync_order(railPlugin* rail, wStream* s) if ((error = rail_read_zorder_sync_order(s, &zorder))) { - WLog_ERR(TAG, "rail_read_zorder_sync_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_read_zorder_sync_order failed with error %" PRIu32 "!", error); return error; } @@ -928,7 +932,7 @@ static UINT rail_recv_zorder_sync_order(railPlugin* rail, wStream* s) IFCALLRET(context->ServerZOrderSync, error, context, &zorder); if (error) - WLog_ERR(TAG, "context.ServerZOrderSync failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context.ServerZOrderSync failed with error %" PRIu32 "", error); } return error; @@ -966,7 +970,7 @@ static UINT rail_recv_order_cloak(railPlugin* rail, wStream* s) if ((error = rail_read_order_cloak(s, &cloak))) { - WLog_ERR(TAG, "rail_read_zorder_sync_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_read_zorder_sync_order failed with error %" PRIu32 "!", error); return error; } @@ -975,7 +979,7 @@ static UINT rail_recv_order_cloak(railPlugin* rail, wStream* s) IFCALLRET(context->ServerCloak, error, context, &cloak); if (error) - WLog_ERR(TAG, "context.ServerZOrderSync failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context.ServerZOrderSync failed with error %" PRIu32 "", error); } return error; @@ -1012,7 +1016,7 @@ static UINT rail_recv_power_display_request_order(railPlugin* rail, wStream* s) if ((error = rail_read_power_display_request_order(s, &power))) { - WLog_ERR(TAG, "rail_read_zorder_sync_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_read_zorder_sync_order failed with error %" PRIu32 "!", error); return error; } @@ -1021,15 +1025,14 @@ static UINT rail_recv_power_display_request_order(railPlugin* rail, wStream* s) IFCALLRET(context->ServerPowerDisplayRequest, error, context, &power); if (error) - WLog_ERR(TAG, "context.ServerPowerDisplayRequest failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context.ServerPowerDisplayRequest failed with error %" PRIu32 "", error); } return error; } - static UINT rail_read_get_application_id_extended_response_order(wStream* s, - RAIL_GET_APPID_RESP_EX* id) + RAIL_GET_APPID_RESP_EX* id) { if (!s || !id) return ERROR_INVALID_PARAMETER; @@ -1059,14 +1062,14 @@ static UINT rail_read_get_application_id_extended_response_order(wStream* s, if (!Stream_Read_UTF16_String(s, id->processImageName, ARRAYSIZE(id->processImageName))) return ERROR_INVALID_DATA; - if (_wcsnlen(id->applicationID, ARRAYSIZE(id->processImageName)) >= ARRAYSIZE(id->processImageName)) + if (_wcsnlen(id->applicationID, ARRAYSIZE(id->processImageName)) >= + ARRAYSIZE(id->processImageName)) return ERROR_INVALID_DATA; return CHANNEL_RC_OK; } -static UINT rail_recv_get_application_id_extended_response_order(railPlugin* rail, - wStream* s) +static UINT rail_recv_get_application_id_extended_response_order(railPlugin* rail, wStream* s) { RailClientContext* context = rail_get_client_interface(rail); RAIL_GET_APPID_RESP_EX id = { 0 }; @@ -1077,7 +1080,9 @@ static UINT rail_recv_get_application_id_extended_response_order(railPlugin* rai if ((error = rail_read_get_application_id_extended_response_order(s, &id))) { - WLog_ERR(TAG, "rail_read_get_application_id_extended_response_order failed with error %"PRIu32"!", + WLog_ERR(TAG, + "rail_read_get_application_id_extended_response_order failed with error %" PRIu32 + "!", error); return error; } @@ -1087,7 +1092,8 @@ static UINT rail_recv_get_application_id_extended_response_order(railPlugin* rai IFCALLRET(context->ServerGetAppidResponseExtended, error, context, &id); if (error) - WLog_ERR(TAG, "context.ServerGetAppidResponseExtended failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context.ServerGetAppidResponseExtended failed with error %" PRIu32 "", + error); } return error; @@ -1109,12 +1115,13 @@ UINT rail_order_recv(railPlugin* rail, wStream* s) if ((error = rail_read_pdu_header(s, &orderType, &orderLength))) { - WLog_ERR(TAG, "rail_read_pdu_header failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_read_pdu_header failed with error %" PRIu32 "!", error); return error; } - WLog_Print(rail->log, WLOG_DEBUG, "Received %s PDU, length:%"PRIu16"", - RAIL_ORDER_TYPE_STRINGS[((orderType & 0xF0) >> 3) + (orderType & 0x0F)], orderLength); + WLog_Print(rail->log, WLOG_DEBUG, "Received %s PDU, length:%" PRIu16 "", + RAIL_ORDER_TYPE_STRINGS[((orderType & 0xF0) >> 3) + (orderType & 0x0F)], + orderLength); switch (orderType) { @@ -1158,7 +1165,7 @@ UINT rail_order_recv(railPlugin* rail, wStream* s) return rail_recv_get_application_id_extended_response_order(rail, s); default: - WLog_ERR(TAG, "Unknown RAIL PDU order reveived."); + WLog_ERR(TAG, "Unknown RAIL PDU order reveived."); return ERROR_INVALID_DATA; } @@ -1256,7 +1263,8 @@ UINT rail_send_client_status_order(railPlugin* rail, const RAIL_CLIENT_STATUS_OR * @return 0 on success, otherwise a Win32 error code */ UINT rail_send_client_exec_order(railPlugin* rail, UINT16 flags, - const RAIL_UNICODE_STRING* exeOrFile, const RAIL_UNICODE_STRING* workingDir, + const RAIL_UNICODE_STRING* exeOrFile, + const RAIL_UNICODE_STRING* workingDir, const RAIL_UNICODE_STRING* arguments) { wStream* s; @@ -1266,10 +1274,7 @@ UINT rail_send_client_exec_order(railPlugin* rail, UINT16 flags, if (!rail || !exeOrFile || !workingDir || !arguments) return ERROR_INVALID_PARAMETER; - length = RAIL_EXEC_ORDER_LENGTH + - exeOrFile->length + - workingDir->length + - arguments->length; + length = RAIL_EXEC_ORDER_LENGTH + exeOrFile->length + workingDir->length + arguments->length; s = rail_pdu_init(length); if (!s) @@ -1280,13 +1285,13 @@ UINT rail_send_client_exec_order(railPlugin* rail, UINT16 flags, if ((error = rail_write_client_exec_order(s, flags, exeOrFile, workingDir, arguments))) { - WLog_ERR(TAG, "rail_write_client_exec_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_write_client_exec_order failed with error %" PRIu32 "!", error); goto out; } if ((error = rail_send_pdu(rail, s, TS_RAIL_ORDER_EXEC))) { - WLog_ERR(TAG, "rail_send_pdu failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_pdu failed with error %" PRIu32 "!", error); goto out; } @@ -1353,13 +1358,13 @@ static UINT rail_send_client_sysparam_order(railPlugin* rail, const RAIL_SYSPARA if ((error = rail_write_client_sysparam_order(rail, s, sysparam))) { - WLog_ERR(TAG, "rail_write_client_sysparam_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_write_client_sysparam_order failed with error %" PRIu32 "!", error); goto out; } if ((error = rail_send_pdu(rail, s, TS_RAIL_ORDER_SYSPARAM))) { - WLog_ERR(TAG, "rail_send_pdu failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_pdu failed with error %" PRIu32 "!", error); goto out; } @@ -1386,7 +1391,7 @@ static UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORD if ((error = rail_send_client_sysparam_order(rail, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %" PRIu32 "!", error); return error; } } @@ -1397,7 +1402,7 @@ static UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORD if ((error = rail_send_client_sysparam_order(rail, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %" PRIu32 "!", error); return error; } } @@ -1406,9 +1411,9 @@ static UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORD { sysparam->param = SPI_SET_MOUSE_BUTTON_SWAP; - if ((error = rail_send_client_sysparam_order(rail, sysparam))) + if ((error = rail_send_client_sysparam_order(rail, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %" PRIu32 "!", error); return error; } } @@ -1419,7 +1424,7 @@ static UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORD if ((error = rail_send_client_sysparam_order(rail, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %" PRIu32 "!", error); return error; } } @@ -1430,7 +1435,7 @@ static UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORD if ((error = rail_send_client_sysparam_order(rail, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %" PRIu32 "!", error); return error; } } @@ -1441,7 +1446,7 @@ static UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORD if ((error = rail_send_client_sysparam_order(rail, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %" PRIu32 "!", error); return error; } } @@ -1452,7 +1457,7 @@ static UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORD if ((error = rail_send_client_sysparam_order(rail, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %" PRIu32 "!", error); return error; } } @@ -1463,7 +1468,7 @@ static UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORD if ((error = rail_send_client_sysparam_order(rail, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %" PRIu32 "!", error); return error; } } @@ -1474,7 +1479,7 @@ static UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORD if ((error = rail_send_client_sysparam_order(rail, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %" PRIu32 "!", error); return error; } } @@ -1485,7 +1490,7 @@ static UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORD if ((error = rail_send_client_sysparam_order(rail, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %" PRIu32 "!", error); return error; } } @@ -1496,7 +1501,7 @@ static UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORD if ((error = rail_send_client_sysparam_order(rail, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %" PRIu32 "!", error); return error; } } @@ -1600,7 +1605,7 @@ UINT rail_send_client_syscommand_order(railPlugin* rail, const RAIL_SYSCOMMAND_O * @return 0 on success, otherwise a Win32 error code */ UINT rail_send_client_notify_event_order(railPlugin* rail, - const RAIL_NOTIFY_EVENT_ORDER* notifyEvent) + const RAIL_NOTIFY_EVENT_ORDER* notifyEvent) { wStream* s; UINT error; @@ -1661,7 +1666,7 @@ UINT rail_send_client_window_move_order(railPlugin* rail, const RAIL_WINDOW_MOVE * @return 0 on success, otherwise a Win32 error code */ UINT rail_send_client_get_appid_req_order(railPlugin* rail, - const RAIL_GET_APPID_REQ_ORDER* getAppIdReq) + const RAIL_GET_APPID_REQ_ORDER* getAppIdReq) { wStream* s; UINT error; @@ -1692,7 +1697,7 @@ UINT rail_send_client_get_appid_req_order(railPlugin* rail, * @return 0 on success, otherwise a Win32 error code */ UINT rail_send_client_langbar_info_order(railPlugin* rail, - const RAIL_LANGBAR_INFO_ORDER* langBarInfo) + const RAIL_LANGBAR_INFO_ORDER* langBarInfo) { wStream* s; UINT error; @@ -1721,7 +1726,7 @@ UINT rail_send_client_langbar_info_order(railPlugin* rail, } UINT rail_send_client_languageime_info_order(railPlugin* rail, - const RAIL_LANGUAGEIME_INFO_ORDER* langImeInfo) + const RAIL_LANGUAGEIME_INFO_ORDER* langImeInfo) { wStream* s; UINT error; diff --git a/channels/rail/client/rail_orders.h b/channels/rail/client/rail_orders.h index 41ef3ebb9..f1dfd1cc8 100644 --- a/channels/rail/client/rail_orders.h +++ b/channels/rail/client/rail_orders.h @@ -39,21 +39,22 @@ UINT rail_send_handshake_order(railPlugin* rail, const RAIL_HANDSHAKE_ORDER* han UINT rail_send_handshake_ex_order(railPlugin* rail, const RAIL_HANDSHAKE_EX_ORDER* handshakeEx); UINT rail_send_client_status_order(railPlugin* rail, const RAIL_CLIENT_STATUS_ORDER* clientStatus); UINT rail_send_client_exec_order(railPlugin* rail, UINT16 flags, - const RAIL_UNICODE_STRING* exeOrFile, const RAIL_UNICODE_STRING* workingDir, + const RAIL_UNICODE_STRING* exeOrFile, + const RAIL_UNICODE_STRING* workingDir, const RAIL_UNICODE_STRING* arguments); UINT rail_send_client_activate_order(railPlugin* rail, const RAIL_ACTIVATE_ORDER* activate); UINT rail_send_client_sysmenu_order(railPlugin* rail, const RAIL_SYSMENU_ORDER* sysmenu); UINT rail_send_client_syscommand_order(railPlugin* rail, const RAIL_SYSCOMMAND_ORDER* syscommand); UINT rail_send_client_notify_event_order(railPlugin* rail, - const RAIL_NOTIFY_EVENT_ORDER* notifyEvent); + const RAIL_NOTIFY_EVENT_ORDER* notifyEvent); UINT rail_send_client_window_move_order(railPlugin* rail, const RAIL_WINDOW_MOVE_ORDER* windowMove); UINT rail_send_client_get_appid_req_order(railPlugin* rail, - const RAIL_GET_APPID_REQ_ORDER* getAppIdReq); + const RAIL_GET_APPID_REQ_ORDER* getAppIdReq); UINT rail_send_client_langbar_info_order(railPlugin* rail, - const RAIL_LANGBAR_INFO_ORDER* langBarInfo); + const RAIL_LANGBAR_INFO_ORDER* langBarInfo); UINT rail_send_client_languageime_info_order(railPlugin* rail, - const RAIL_LANGUAGEIME_INFO_ORDER* langImeInfo); + const RAIL_LANGUAGEIME_INFO_ORDER* langImeInfo); UINT rail_send_client_order_cloak_order(railPlugin* rail, const RAIL_CLOAK* cloak); UINT rail_send_client_order_snap_arrange_order(railPlugin* rail, const RAIL_SNAP_ARRANGE* snap); diff --git a/channels/rail/rail_common.c b/channels/rail/rail_common.c index ac0103ffc..a9149248b 100644 --- a/channels/rail/rail_common.c +++ b/channels/rail/rail_common.c @@ -24,32 +24,29 @@ #include -const char* const RAIL_ORDER_TYPE_STRINGS[] = -{ - "", - "Execute", - "Activate", - "System Parameters Update", - "System Command", - "Handshake", - "Notify Event", - "", - "Window Move", - "Local Move/Size", - "Min Max Info", - "Client Status", - "System Menu", - "Language Bar Info", - "Get Application ID Request", - "Get Application ID Response", - "Execute Result", - "", - "", - "", - "", - "", - "" -}; +const char* const RAIL_ORDER_TYPE_STRINGS[] = { "", + "Execute", + "Activate", + "System Parameters Update", + "System Command", + "Handshake", + "Notify Event", + "", + "Window Move", + "Local Move/Size", + "Min Max Info", + "Client Status", + "System Menu", + "Language Bar Info", + "Get Application ID Request", + "Get Application ID Response", + "Execute Result", + "", + "", + "", + "", + "", + "" }; BOOL rail_string_to_unicode_string(const char* string, RAIL_UNICODE_STRING* unicode_string) { @@ -70,8 +67,8 @@ BOOL rail_string_to_unicode_string(const char* string, RAIL_UNICODE_STRING* unic return FALSE; } - unicode_string->string = (BYTE*) buffer; - unicode_string->length = (UINT16) length * sizeof(WCHAR); + unicode_string->string = (BYTE*)buffer; + unicode_string->length = (UINT16)length * sizeof(WCHAR); return TRUE; } @@ -88,14 +85,14 @@ UINT rail_read_pdu_header(wStream* s, UINT16* orderType, UINT16* orderLength) if (Stream_GetRemainingLength(s) < 4) return ERROR_INVALID_DATA; - Stream_Read_UINT16(s, *orderType); /* orderType (2 bytes) */ + Stream_Read_UINT16(s, *orderType); /* orderType (2 bytes) */ Stream_Read_UINT16(s, *orderLength); /* orderLength (2 bytes) */ return CHANNEL_RC_OK; } void rail_write_pdu_header(wStream* s, UINT16 orderType, UINT16 orderLength) { - Stream_Write_UINT16(s, orderType); /* orderType (2 bytes) */ + Stream_Write_UINT16(s, orderType); /* orderType (2 bytes) */ Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */ } @@ -140,13 +137,13 @@ UINT rail_read_handshake_ex_order(wStream* s, RAIL_HANDSHAKE_EX_ORDER* handshake if (Stream_GetRemainingLength(s) < 8) return ERROR_INVALID_DATA; - Stream_Read_UINT32(s, handshakeEx->buildNumber); /* buildNumber (4 bytes) */ + Stream_Read_UINT32(s, handshakeEx->buildNumber); /* buildNumber (4 bytes) */ Stream_Read_UINT32(s, handshakeEx->railHandshakeFlags); /* railHandshakeFlags (4 bytes) */ return CHANNEL_RC_OK; } void rail_write_handshake_ex_order(wStream* s, const RAIL_HANDSHAKE_EX_ORDER* handshakeEx) { - Stream_Write_UINT32(s, handshakeEx->buildNumber); /* buildNumber (4 bytes) */ + Stream_Write_UINT32(s, handshakeEx->buildNumber); /* buildNumber (4 bytes) */ Stream_Write_UINT32(s, handshakeEx->railHandshakeFlags); /* railHandshakeFlags (4 bytes) */ } diff --git a/channels/rail/rail_common.h b/channels/rail/rail_common.h index c481cc4ce..cbce3a2ee 100644 --- a/channels/rail/rail_common.h +++ b/channels/rail/rail_common.h @@ -28,22 +28,22 @@ extern const char* const RAIL_ORDER_TYPE_STRINGS[]; -#define RAIL_PDU_HEADER_LENGTH 4 +#define RAIL_PDU_HEADER_LENGTH 4 /* Fixed length of PDUs, excluding variable lengths */ -#define RAIL_HANDSHAKE_ORDER_LENGTH 4 /* fixed */ -#define RAIL_HANDSHAKE_EX_ORDER_LENGTH 8 /* fixed */ -#define RAIL_CLIENT_STATUS_ORDER_LENGTH 4 /* fixed */ -#define RAIL_EXEC_ORDER_LENGTH 8 /* variable */ -#define RAIL_SYSPARAM_ORDER_LENGTH 4 /* variable */ -#define RAIL_ACTIVATE_ORDER_LENGTH 5 /* fixed */ -#define RAIL_SYSMENU_ORDER_LENGTH 8 /* fixed */ -#define RAIL_SYSCOMMAND_ORDER_LENGTH 6 /* fixed */ -#define RAIL_NOTIFY_EVENT_ORDER_LENGTH 12 /* fixed */ -#define RAIL_WINDOW_MOVE_ORDER_LENGTH 12 /* fixed */ -#define RAIL_GET_APPID_REQ_ORDER_LENGTH 4 /* fixed */ -#define RAIL_LANGBAR_INFO_ORDER_LENGTH 4 /* fixed */ -#define RAIL_LANGUAGEIME_INFO_ORDER_LENGTH 44 /* fixed */ +#define RAIL_HANDSHAKE_ORDER_LENGTH 4 /* fixed */ +#define RAIL_HANDSHAKE_EX_ORDER_LENGTH 8 /* fixed */ +#define RAIL_CLIENT_STATUS_ORDER_LENGTH 4 /* fixed */ +#define RAIL_EXEC_ORDER_LENGTH 8 /* variable */ +#define RAIL_SYSPARAM_ORDER_LENGTH 4 /* variable */ +#define RAIL_ACTIVATE_ORDER_LENGTH 5 /* fixed */ +#define RAIL_SYSMENU_ORDER_LENGTH 8 /* fixed */ +#define RAIL_SYSCOMMAND_ORDER_LENGTH 6 /* fixed */ +#define RAIL_NOTIFY_EVENT_ORDER_LENGTH 12 /* fixed */ +#define RAIL_WINDOW_MOVE_ORDER_LENGTH 12 /* fixed */ +#define RAIL_GET_APPID_REQ_ORDER_LENGTH 4 /* fixed */ +#define RAIL_LANGBAR_INFO_ORDER_LENGTH 4 /* fixed */ +#define RAIL_LANGUAGEIME_INFO_ORDER_LENGTH 44 /* fixed */ BOOL rail_string_to_unicode_string(const char* string, RAIL_UNICODE_STRING* unicode_string); UINT rail_read_handshake_order(wStream* s, RAIL_HANDSHAKE_ORDER* handshake); diff --git a/channels/rdp2tcp/client/rdp2tcp_main.c b/channels/rdp2tcp/client/rdp2tcp_main.c index bc0ad2f59..58a2ef55c 100644 --- a/channels/rdp2tcp/client/rdp2tcp_main.c +++ b/channels/rdp2tcp/client/rdp2tcp_main.c @@ -46,7 +46,6 @@ typedef struct char buffer[16 * 1024]; } Plugin; - static int init_external_addin(Plugin* plugin) { SECURITY_ATTRIBUTES saAttr; @@ -86,16 +85,16 @@ static int init_external_addin(Plugin* plugin) // Execute plugin if (!CreateProcess(NULL, - plugin->channelEntryPoints.pExtendedData, // command line - NULL, // process security attributes - NULL, // primary thread security attributes - TRUE, // handles are inherited - 0, // creation flags - NULL, // use parent's environment - NULL, // use parent's current directory - &siStartInfo, // STARTUPINFO pointer - &procInfo // receives PROCESS_INFORMATION - )) + plugin->channelEntryPoints.pExtendedData, // command line + NULL, // process security attributes + NULL, // primary thread security attributes + TRUE, // handles are inherited + 0, // creation flags + NULL, // use parent's environment + NULL, // use parent's current directory + &siStartInfo, // STARTUPINFO pointer + &procInfo // receives PROCESS_INFORMATION + )) { WLog_ERR(TAG, "fork for addin"); return -1; @@ -146,7 +145,8 @@ static DWORD WINAPI copyThread(void* data) goto fail; } - //if (!ReadFile(plugin->hStdOutputRead, plugin->buffer, sizeof plugin->buffer, &dwRead, NULL)) + // if (!ReadFile(plugin->hStdOutputRead, plugin->buffer, sizeof plugin->buffer, &dwRead, + // NULL)) if (!ReadFile(plugin->hStdOutputRead, buffer, bufsize, &dwRead, NULL)) { free(buffer); @@ -159,8 +159,8 @@ static DWORD WINAPI copyThread(void* data) dumpData(buffer, dwRead); } - if (plugin->channelEntryPoints.pVirtualChannelWriteEx(plugin->initHandle, plugin->openHandle, - buffer, dwRead, buffer) != CHANNEL_RC_OK) + if (plugin->channelEntryPoints.pVirtualChannelWriteEx( + plugin->initHandle, plugin->openHandle, buffer, dwRead, buffer) != CHANNEL_RC_OK) { free(buffer); fprintf(stderr, "rdp2tcp copyThread failed %i\n", (int)dwRead); @@ -222,7 +222,8 @@ static void dataReceived(Plugin* plugin, void* pData, UINT32 dataLength, UINT32 } static void VCAPITYPE VirtualChannelOpenEventEx(LPVOID lpUserParam, DWORD openHandle, UINT event, - LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) + LPVOID pData, UINT32 dataLength, UINT32 totalLength, + UINT32 dataFlags) { Plugin* plugin = (Plugin*)lpUserParam; @@ -243,7 +244,7 @@ static void VCAPITYPE VirtualChannelOpenEventEx(LPVOID lpUserParam, DWORD openHa } static VOID VCAPITYPE VirtualChannelInitEventEx(LPVOID lpUserParam, LPVOID pInitHandle, UINT event, - LPVOID pData, UINT dataLength) + LPVOID pData, UINT dataLength) { Plugin* plugin = (Plugin*)lpUserParam; @@ -256,8 +257,9 @@ static VOID VCAPITYPE VirtualChannelInitEventEx(LPVOID lpUserParam, LPVOID pInit plugin->writeComplete = CreateEvent(NULL, TRUE, FALSE, NULL); plugin->copyThread = CreateThread(NULL, 0, copyThread, plugin, 0, NULL); - if (plugin->channelEntryPoints.pVirtualChannelOpenEx(pInitHandle, &plugin->openHandle, - RDP2TCP_CHAN_NAME, VirtualChannelOpenEventEx) != CHANNEL_RC_OK) + if (plugin->channelEntryPoints.pVirtualChannelOpenEx( + pInitHandle, &plugin->openHandle, RDP2TCP_CHAN_NAME, + VirtualChannelOpenEventEx) != CHANNEL_RC_OK) return; break; @@ -312,12 +314,11 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p strncpy(channelDef.name, RDP2TCP_CHAN_NAME, sizeof(channelDef.name)); channelDef.options = - CHANNEL_OPTION_INITIALIZED | - CHANNEL_OPTION_ENCRYPT_RDP | - CHANNEL_OPTION_COMPRESS_RDP; + CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP | CHANNEL_OPTION_COMPRESS_RDP; if (pEntryPointsEx->pVirtualChannelInitEx(plugin, NULL, pInitHandle, &channelDef, 1, - VIRTUAL_CHANNEL_VERSION_WIN2000, VirtualChannelInitEventEx) != CHANNEL_RC_OK) + VIRTUAL_CHANNEL_VERSION_WIN2000, + VirtualChannelInitEventEx) != CHANNEL_RC_OK) return FALSE; return TRUE; diff --git a/channels/rdpdr/client/devman.c b/channels/rdpdr/client/devman.c index acb9c44e8..5ade857a5 100644 --- a/channels/rdpdr/client/devman.c +++ b/channels/rdpdr/client/devman.c @@ -43,7 +43,7 @@ static void devman_device_free(void* obj) { - DEVICE* device = (DEVICE*) obj; + DEVICE* device = (DEVICE*)obj; if (!device) return; @@ -58,21 +58,21 @@ DEVMAN* devman_new(rdpdrPlugin* rdpdr) if (!rdpdr) return NULL; - devman = (DEVMAN*) calloc(1, sizeof(DEVMAN)); + devman = (DEVMAN*)calloc(1, sizeof(DEVMAN)); if (!devman) { - WLog_INFO(TAG, "calloc failed!"); + WLog_INFO(TAG, "calloc failed!"); return NULL; } - devman->plugin = (void*) rdpdr; + devman->plugin = (void*)rdpdr; devman->id_sequence = 1; devman->devices = ListDictionary_New(TRUE); if (!devman->devices) { - WLog_INFO(TAG, "ListDictionary_New failed!"); + WLog_INFO(TAG, "ListDictionary_New failed!"); free(devman); return NULL; } @@ -94,7 +94,7 @@ void devman_unregister_device(DEVMAN* devman, void* key) if (!devman || !key) return; - device = (DEVICE*) ListDictionary_Remove(devman->devices, key); + device = (DEVICE*)ListDictionary_Remove(devman->devices, key); if (device) devman_device_free(device); @@ -113,11 +113,11 @@ static UINT devman_register_device(DEVMAN* devman, DEVICE* device) return ERROR_INVALID_PARAMETER; device->id = devman->id_sequence++; - key = (void*)(size_t) device->id; + key = (void*)(size_t)device->id; if (!ListDictionary_Add(devman->devices, key, device)) { - WLog_INFO(TAG, "ListDictionary_Add failed!"); + WLog_INFO(TAG, "ListDictionary_Add failed!"); return ERROR_INTERNAL_ERROR; } @@ -127,12 +127,12 @@ static UINT devman_register_device(DEVMAN* devman, DEVICE* device) DEVICE* devman_get_device_by_id(DEVMAN* devman, UINT32 id) { DEVICE* device = NULL; - void* key = (void*)(size_t) id; + void* key = (void*)(size_t)id; if (!devman) return NULL; - device = (DEVICE*) ListDictionary_GetItemValue(devman->devices, key); + device = (DEVICE*)ListDictionary_GetItemValue(devman->devices, key); return device; } @@ -150,7 +150,7 @@ DEVICE* devman_get_device_by_type(DEVMAN* devman, UINT32 type) for (x = 0; x < count; x++) { - DEVICE* cur = (DEVICE*) ListDictionary_GetItemValue(devman->devices, (void*)keys[x]); + DEVICE* cur = (DEVICE*)ListDictionary_GetItemValue(devman->devices, (void*)keys[x]); if (!cur) continue; @@ -200,21 +200,21 @@ UINT devman_load_device_service(DEVMAN* devman, const RDPDR_DEVICE* device, rdpC if (!ServiceName) { - WLog_INFO(TAG, "ServiceName %s did not match!", ServiceName); + WLog_INFO(TAG, "ServiceName %s did not match!", ServiceName); return ERROR_INVALID_NAME; } if (device->Name) - WLog_INFO(TAG, "Loading device service %s [%s] (static)", ServiceName, device->Name); + WLog_INFO(TAG, "Loading device service %s [%s] (static)", ServiceName, device->Name); else - WLog_INFO(TAG, "Loading device service %s (static)", ServiceName); + WLog_INFO(TAG, "Loading device service %s (static)", ServiceName); - entry = (PDEVICE_SERVICE_ENTRY) freerdp_load_channel_addin_entry(ServiceName, NULL, - "DeviceServiceEntry", 0); + entry = (PDEVICE_SERVICE_ENTRY)freerdp_load_channel_addin_entry(ServiceName, NULL, + "DeviceServiceEntry", 0); if (!entry) { - WLog_INFO(TAG, "freerdp_load_channel_addin_entry failed!"); + WLog_INFO(TAG, "freerdp_load_channel_addin_entry failed!"); return ERROR_INTERNAL_ERROR; } diff --git a/channels/rdpdr/client/irp.c b/channels/rdpdr/client/irp.c index 21d4a466f..f5ad4861a 100644 --- a/channels/rdpdr/client/irp.c +++ b/channels/rdpdr/client/irp.c @@ -63,7 +63,7 @@ static UINT irp_complete(IRP* irp) rdpdrPlugin* rdpdr; UINT error; - rdpdr = (rdpdrPlugin*) irp->devman->plugin; + rdpdr = (rdpdrPlugin*)irp->devman->plugin; pos = Stream_GetPosition(irp->output); Stream_SetPosition(irp->output, RDPDR_DEVICE_IO_RESPONSE_LENGTH - 4); @@ -102,7 +102,7 @@ IRP* irp_new(DEVMAN* devman, wStream* s, UINT* error) return NULL; }; - irp = (IRP*) _aligned_malloc(sizeof(IRP), MEMORY_ALLOCATION_ALIGNMENT); + irp = (IRP*)_aligned_malloc(sizeof(IRP), MEMORY_ALLOCATION_ALIGNMENT); if (!irp) { @@ -112,15 +112,14 @@ IRP* irp_new(DEVMAN* devman, wStream* s, UINT* error) return NULL; } - ZeroMemory(irp, sizeof(IRP)); irp->input = s; irp->device = device; irp->devman = devman; - Stream_Read_UINT32(s, irp->FileId); /* FileId (4 bytes) */ - Stream_Read_UINT32(s, irp->CompletionId); /* CompletionId (4 bytes) */ + Stream_Read_UINT32(s, irp->FileId); /* FileId (4 bytes) */ + Stream_Read_UINT32(s, irp->CompletionId); /* CompletionId (4 bytes) */ Stream_Read_UINT32(s, irp->MajorFunction); /* MajorFunction (4 bytes) */ Stream_Read_UINT32(s, irp->MinorFunction); /* MinorFunction (4 bytes) */ @@ -133,11 +132,11 @@ IRP* irp_new(DEVMAN* devman, wStream* s, UINT* error) *error = CHANNEL_RC_NO_MEMORY; return NULL; } - Stream_Write_UINT16(irp->output, RDPDR_CTYP_CORE); /* Component (2 bytes) */ + Stream_Write_UINT16(irp->output, RDPDR_CTYP_CORE); /* Component (2 bytes) */ Stream_Write_UINT16(irp->output, PAKID_CORE_DEVICE_IOCOMPLETION); /* PacketId (2 bytes) */ - Stream_Write_UINT32(irp->output, DeviceId); /* DeviceId (4 bytes) */ - Stream_Write_UINT32(irp->output, irp->CompletionId); /* CompletionId (4 bytes) */ - Stream_Write_UINT32(irp->output, 0); /* IoStatus (4 bytes) */ + Stream_Write_UINT32(irp->output, DeviceId); /* DeviceId (4 bytes) */ + Stream_Write_UINT32(irp->output, irp->CompletionId); /* CompletionId (4 bytes) */ + Stream_Write_UINT32(irp->output, 0); /* IoStatus (4 bytes) */ irp->Complete = irp_complete; irp->Discard = irp_free; diff --git a/channels/rdpdr/client/rdpdr_capabilities.c b/channels/rdpdr/client/rdpdr_capabilities.c index b5de7ad7c..97c876b0e 100644 --- a/channels/rdpdr/client/rdpdr_capabilities.c +++ b/channels/rdpdr/client/rdpdr_capabilities.c @@ -53,14 +53,14 @@ static void rdpdr_write_general_capset(rdpdrPlugin* rdpdr, wStream* s) Stream_Write_UINT32(s, 0); /* osVersion, unused and must be set to zero */ Stream_Write_UINT16(s, 1); /* protocolMajorVersion, must be set to 1 */ Stream_Write_UINT16(s, RDPDR_MINOR_RDP_VERSION_5_2); /* protocolMinorVersion */ - Stream_Write_UINT32(s, 0x0000FFFF); /* ioCode1 */ + Stream_Write_UINT32(s, 0x0000FFFF); /* ioCode1 */ Stream_Write_UINT32(s, 0); /* ioCode2, must be set to zero, reserved for future use */ Stream_Write_UINT32(s, RDPDR_DEVICE_REMOVE_PDUS | RDPDR_CLIENT_DISPLAY_NAME_PDU | - RDPDR_USER_LOGGEDON_PDU); /* extendedPDU */ - Stream_Write_UINT32(s, ENABLE_ASYNCIO); /* extraFlags1 */ + RDPDR_USER_LOGGEDON_PDU); /* extendedPDU */ + Stream_Write_UINT32(s, ENABLE_ASYNCIO); /* extraFlags1 */ Stream_Write_UINT32(s, 0); /* extraFlags2, must be set to zero, reserved for future use */ - Stream_Write_UINT32(s, - 0); /* SpecialTypeDeviceCap, number of special devices to be redirected before logon */ + Stream_Write_UINT32( + s, 0); /* SpecialTypeDeviceCap, number of special devices to be redirected before logon */ } /* Process device direction general capability set */ diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index a809a1965..d37c1a276 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -81,16 +81,14 @@ struct _DEVICE_DRIVE_EXT * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, - BOOL userLoggedOn); +static UINT rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, BOOL userLoggedOn); /** * Function description * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_send_device_list_remove_request(rdpdrPlugin* rdpdr, - UINT32 count, UINT32 ids[]) +static UINT rdpdr_send_device_list_remove_request(rdpdrPlugin* rdpdr, UINT32 count, UINT32 ids[]) { UINT32 i; wStream* s; @@ -185,17 +183,17 @@ LRESULT CALLBACK hotplug_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) switch (wParam) { case DBT_DEVICEARRIVAL: - if (lpdb -> dbch_devicetype == DBT_DEVTYP_VOLUME) + if (lpdb->dbch_devicetype == DBT_DEVTYP_VOLUME) { PDEV_BROADCAST_VOLUME lpdbv = (PDEV_BROADCAST_VOLUME)lpdb; DWORD unitmask = lpdbv->dbcv_unitmask; int i; - char drive_path[4] = { 'c', ':', '/', '\0'}; + char drive_path[4] = { 'c', ':', '/', '\0' }; for (i = 0; i < 26; i++) { if (unitmask & 0x01) - { + { drive_path[0] = 'A' + i; drive_path[1] = ':'; @@ -208,7 +206,8 @@ LRESULT CALLBACK hotplug_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) drive_path[1] = '\0'; drive.automount = TRUE; drive.Name = drive_path; - devman_load_device_service(rdpdr->devman, (const RDPDR_DEVICE*)&drive, + devman_load_device_service(rdpdr->devman, + (const RDPDR_DEVICE*)&drive, rdpdr->rdpcontext); rdpdr_send_device_list_announce_request(rdpdr, TRUE); } @@ -221,7 +220,7 @@ LRESULT CALLBACK hotplug_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) break; case DBT_DEVICEREMOVECOMPLETE: - if (lpdb -> dbch_devicetype == DBT_DEVTYP_VOLUME) + if (lpdb->dbch_devicetype == DBT_DEVTYP_VOLUME) { PDEV_BROADCAST_VOLUME lpdbv = (PDEV_BROADCAST_VOLUME)lpdb; DWORD unitmask = lpdbv->dbcv_unitmask; @@ -242,21 +241,25 @@ LRESULT CALLBACK hotplug_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) for (j = 0; j < count; j++) { device_ext = (DEVICE_DRIVE_EXT*)ListDictionary_GetItemValue( - rdpdr->devman->devices, (void*)keys[j]); + rdpdr->devman->devices, (void*)keys[j]); - if (device_ext->path[0] == drive_name_upper - || device_ext->path[0] == drive_name_lower) + if (device_ext->path[0] == drive_name_upper || + device_ext->path[0] == drive_name_lower) { if (device_ext->automount) { devman_unregister_device(rdpdr->devman, (void*)keys[j]); ids[0] = keys[j]; - if ((error = rdpdr_send_device_list_remove_request(rdpdr, 1, ids))) + if ((error = rdpdr_send_device_list_remove_request( + rdpdr, 1, ids))) { // dont end on error, just report ? - WLog_ERR(TAG, "rdpdr_send_device_list_remove_request failed with error %"PRIu32"!", - error); + WLog_ERR( + TAG, + "rdpdr_send_device_list_remove_request failed " + "with error %" PRIu32 "!", + error); } break; @@ -297,30 +300,27 @@ static DWORD WINAPI drive_hotplug_thread_func(LPVOID arg) HDEVNOTIFY hDevNotify; rdpdr = (rdpdrPlugin*)arg; /* init windows class */ - wnd_cls.cbSize = sizeof(WNDCLASSEX); - wnd_cls.style = CS_HREDRAW | CS_VREDRAW; - wnd_cls.lpfnWndProc = hotplug_proc; - wnd_cls.cbClsExtra = 0; - wnd_cls.cbWndExtra = 0; - wnd_cls.hIcon = LoadIcon(NULL, IDI_APPLICATION); - wnd_cls.hCursor = NULL; + wnd_cls.cbSize = sizeof(WNDCLASSEX); + wnd_cls.style = CS_HREDRAW | CS_VREDRAW; + wnd_cls.lpfnWndProc = hotplug_proc; + wnd_cls.cbClsExtra = 0; + wnd_cls.cbWndExtra = 0; + wnd_cls.hIcon = LoadIcon(NULL, IDI_APPLICATION); + wnd_cls.hCursor = NULL; wnd_cls.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); - wnd_cls.lpszMenuName = NULL; + wnd_cls.lpszMenuName = NULL; wnd_cls.lpszClassName = L"DRIVE_HOTPLUG"; - wnd_cls.hInstance = NULL; - wnd_cls.hIconSm = LoadIcon(NULL, IDI_APPLICATION); + wnd_cls.hInstance = NULL; + wnd_cls.hIconSm = LoadIcon(NULL, IDI_APPLICATION); RegisterClassEx(&wnd_cls); /* create window */ - hwnd = CreateWindowEx(0, L"DRIVE_HOTPLUG", NULL, - 0, 0, 0, 0, 0, - NULL, NULL, NULL, NULL); + hwnd = CreateWindowEx(0, L"DRIVE_HOTPLUG", NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)rdpdr); rdpdr->hotplug_wnd = hwnd; /* register device interface to hwnd */ NotificationFilter.dbch_size = sizeof(DEV_BROADCAST_HANDLE); NotificationFilter.dbch_devicetype = DBT_DEVTYP_HANDLE; - hDevNotify = RegisterDeviceNotification(hwnd, &NotificationFilter, - DEVICE_NOTIFY_WINDOW_HANDLE); + hDevNotify = RegisterDeviceNotification(hwnd, &NotificationFilter, DEVICE_NOTIFY_WINDOW_HANDLE); /* message loop */ while ((bRet = GetMessage(&msg, 0, 0, 0)) != 0) @@ -352,7 +352,7 @@ static UINT drive_hotplug_thread_terminate(rdpdrPlugin* rdpdr) if (rdpdr->hotplug_wnd && !PostMessage(rdpdr->hotplug_wnd, WM_QUIT, 0, 0)) { error = GetLastError(); - WLog_ERR(TAG, "PostMessage failed with error %"PRIu32"", error); + WLog_ERR(TAG, "PostMessage failed with error %" PRIu32 "", error); } return error; @@ -365,10 +365,9 @@ static UINT drive_hotplug_thread_terminate(rdpdrPlugin* rdpdr) typedef struct _hotplug_dev { char* path; - BOOL to_add; + BOOL to_add; } hotplug_dev; - /** * Function description * @@ -429,8 +428,8 @@ static UINT handle_hotplug(rdpdrPlugin* rdpdr) { char* path = NULL; BOOL dev_found = FALSE; - device_ext = (DEVICE_DRIVE_EXT*)ListDictionary_GetItemValue( - rdpdr->devman->devices, (void*)keys[j]); + device_ext = + (DEVICE_DRIVE_EXT*)ListDictionary_GetItemValue(rdpdr->devman->devices, (void*)keys[j]); if (!device_ext || !device_ext->automount) continue; @@ -470,7 +469,8 @@ static UINT handle_hotplug(rdpdrPlugin* rdpdr) if ((error = rdpdr_send_device_list_remove_request(rdpdr, 1, ids))) { - WLog_ERR(TAG, "rdpdr_send_device_list_remove_request failed with error %"PRIu32"!", + WLog_ERR(TAG, + "rdpdr_send_device_list_remove_request failed with error %" PRIu32 "!", error); goto cleanup; } @@ -516,17 +516,17 @@ cleanup: return error; } - static void drive_hotplug_fsevent_callback(ConstFSEventStreamRef streamRef, - void* clientCallBackInfo, - size_t numEvents, void* eventPaths, const FSEventStreamEventFlags eventFlags[], - const FSEventStreamEventId eventIds[]) + void* clientCallBackInfo, size_t numEvents, + void* eventPaths, + const FSEventStreamEventFlags eventFlags[], + const FSEventStreamEventId eventIds[]) { rdpdrPlugin* rdpdr; size_t i; UINT error; char** paths = (char**)eventPaths; - rdpdr = (rdpdrPlugin*) clientCallBackInfo; + rdpdr = (rdpdrPlugin*)clientCallBackInfo; for (i = 0; i < numEvents; i++) { @@ -534,7 +534,7 @@ static void drive_hotplug_fsevent_callback(ConstFSEventStreamRef streamRef, { if ((error = handle_hotplug(rdpdr))) { - WLog_ERR(TAG, "handle_hotplug failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "handle_hotplug failed with error %" PRIu32 "!", error); } else rdpdr_send_device_list_announce_request(rdpdr, TRUE); @@ -550,7 +550,7 @@ void first_hotplug(rdpdrPlugin* rdpdr) if ((error = handle_hotplug(rdpdr))) { - WLog_ERR(TAG, "handle_hotplug failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "handle_hotplug failed with error %" PRIu32 "!", error); } } @@ -558,16 +558,15 @@ static DWORD WINAPI drive_hotplug_thread_func(LPVOID arg) { rdpdrPlugin* rdpdr; FSEventStreamRef fsev; - rdpdr = (rdpdrPlugin*) arg; + rdpdr = (rdpdrPlugin*)arg; CFStringRef path = CFSTR("/Volumes/"); - CFArrayRef pathsToWatch = CFArrayCreate(kCFAllocatorMalloc, (const void**)&path, - 1, NULL); + CFArrayRef pathsToWatch = CFArrayCreate(kCFAllocatorMalloc, (const void**)&path, 1, NULL); FSEventStreamContext ctx; ZeroMemory(&ctx, sizeof(ctx)); ctx.info = arg; - fsev = FSEventStreamCreate(kCFAllocatorMalloc, drive_hotplug_fsevent_callback, - &ctx, pathsToWatch, kFSEventStreamEventIdSinceNow, 1, - kFSEventStreamCreateFlagNone); + fsev = + FSEventStreamCreate(kCFAllocatorMalloc, drive_hotplug_fsevent_callback, &ctx, pathsToWatch, + kFSEventStreamEventIdSinceNow, 1, kFSEventStreamCreateFlagNone); rdpdr->runLoop = CFRunLoopGetCurrent(); FSEventStreamScheduleWithRunLoop(fsev, rdpdr->runLoop, kCFRunLoopDefaultMode); FSEventStreamStart(fsev); @@ -585,18 +584,11 @@ static DWORD WINAPI drive_hotplug_thread_func(LPVOID arg) typedef struct _hotplug_dev { char* path; - BOOL to_add; + BOOL to_add; } hotplug_dev; - -static const char* automountLocations[] = -{ - "/run/user/%lu/gvfs", - "/run/media/%s", - "/media/%s", - "/media", - "/mnt" -}; +static const char* automountLocations[] = { "/run/user/%lu/gvfs", "/run/media/%s", "/media/%s", + "/media", "/mnt" }; static BOOL isAutomountLocation(const char* path) { @@ -716,7 +708,7 @@ static char* get_word(char* str, size_t* offset) p = str + *offset; tmp = p; - while (*tmp != ' ' && *tmp != '\0') + while (*tmp != ' ' && *tmp != '\0') tmp++; wlen = tmp - p; @@ -791,10 +783,11 @@ static UINT handle_hotplug(rdpdrPlugin* rdpdr) { char* path = NULL; BOOL dev_found = FALSE; - DEVICE_DRIVE_EXT* device_ext = (DEVICE_DRIVE_EXT*)ListDictionary_GetItemValue( - rdpdr->devman->devices, (void*)keys[j]); + DEVICE_DRIVE_EXT* device_ext = + (DEVICE_DRIVE_EXT*)ListDictionary_GetItemValue(rdpdr->devman->devices, (void*)keys[j]); - if (!device_ext || (device_ext->device.type != RDPDR_DTYP_FILESYSTEM) || !device_ext->path || !device_ext->automount) + if (!device_ext || (device_ext->device.type != RDPDR_DTYP_FILESYSTEM) || + !device_ext->path || !device_ext->automount) continue; ConvertFromUnicode(CP_UTF8, 0, device_ext->path, -1, &path, 0, NULL, NULL); @@ -825,7 +818,8 @@ static UINT handle_hotplug(rdpdrPlugin* rdpdr) if ((error = rdpdr_send_device_list_remove_request(rdpdr, 1, ids))) { - WLog_ERR(TAG, "rdpdr_send_device_list_remove_request failed with error %"PRIu32"!", + WLog_ERR(TAG, + "rdpdr_send_device_list_remove_request failed with error %" PRIu32 "!", error); goto cleanup; } @@ -877,7 +871,7 @@ static void first_hotplug(rdpdrPlugin* rdpdr) if ((error = handle_hotplug(rdpdr))) { - WLog_ERR(TAG, "handle_hotplug failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "handle_hotplug failed with error %" PRIu32 "!", error); } } @@ -890,7 +884,7 @@ static DWORD WINAPI drive_hotplug_thread_func(LPVOID arg) int rv; UINT error = 0; DWORD status; - rdpdr = (rdpdrPlugin*) arg; + rdpdr = (rdpdrPlugin*)arg; mfd = open("/proc/mounts", O_RDONLY, 0); if (mfd < 0) @@ -912,7 +906,7 @@ static DWORD WINAPI drive_hotplug_thread_func(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); goto out; } @@ -924,7 +918,7 @@ static DWORD WINAPI drive_hotplug_thread_func(LPVOID arg) /* file /proc/mounts changed, handle this */ if ((error = handle_hotplug(rdpdr))) { - WLog_ERR(TAG, "handle_hotplug failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "handle_hotplug failed with error %" PRIu32 "!", error); goto out; } else @@ -940,8 +934,7 @@ static DWORD WINAPI drive_hotplug_thread_func(LPVOID arg) out: if (error && rdpdr->rdpcontext) - setChannelError(rdpdr->rdpcontext, error, - "drive_hotplug_thread_func reported an error"); + setChannelError(rdpdr->rdpcontext, error, "drive_hotplug_thread_func reported an error"); ExitThread(error); return error; @@ -969,7 +962,7 @@ static UINT drive_hotplug_thread_terminate(rdpdrPlugin* rdpdr) if (WaitForSingleObject(rdpdr->hotplugThread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); return error; } @@ -984,7 +977,6 @@ static UINT drive_hotplug_thread_terminate(rdpdrPlugin* rdpdr) #endif - /** * Function description * @@ -1003,14 +995,12 @@ static UINT rdpdr_process_connect(rdpdrPlugin* rdpdr) return CHANNEL_RC_NO_MEMORY; } - settings = (rdpSettings*) rdpdr->channelEntryPoints.pExtendedData; + settings = (rdpSettings*)rdpdr->channelEntryPoints.pExtendedData; if (settings->ClientHostname) - strncpy(rdpdr->computerName, settings->ClientHostname, - sizeof(rdpdr->computerName) - 1); + strncpy(rdpdr->computerName, settings->ClientHostname, sizeof(rdpdr->computerName) - 1); else - strncpy(rdpdr->computerName, settings->ComputerName, - sizeof(rdpdr->computerName) - 1); + strncpy(rdpdr->computerName, settings->ComputerName, sizeof(rdpdr->computerName) - 1); for (index = 0; index < settings->DeviceCount; index++) { @@ -1036,8 +1026,8 @@ static UINT rdpdr_process_connect(rdpdrPlugin* rdpdr) #endif - if (!(rdpdr->hotplugThread = CreateThread(NULL, 0, - drive_hotplug_thread_func, rdpdr, 0, NULL))) + if (!(rdpdr->hotplugThread = + CreateThread(NULL, 0, drive_hotplug_thread_func, rdpdr, 0, NULL))) { WLog_ERR(TAG, "CreateThread failed!"); #ifndef _WIN32 @@ -1051,10 +1041,9 @@ static UINT rdpdr_process_connect(rdpdrPlugin* rdpdr) } } - if ((error = devman_load_device_service(rdpdr->devman, device, - rdpdr->rdpcontext))) + if ((error = devman_load_device_service(rdpdr->devman, device, rdpdr->rdpcontext))) { - WLog_ERR(TAG, "devman_load_device_service failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "devman_load_device_service failed with error %" PRIu32 "!", error); return error; } } @@ -1062,8 +1051,7 @@ static UINT rdpdr_process_connect(rdpdrPlugin* rdpdr) return error; } -static UINT rdpdr_process_server_announce_request(rdpdrPlugin* rdpdr, - wStream* s) +static UINT rdpdr_process_server_announce_request(rdpdrPlugin* rdpdr, wStream* s) { if (Stream_GetRemainingLength(s) < 8) return ERROR_INVALID_DATA; @@ -1091,11 +1079,11 @@ static UINT rdpdr_send_client_announce_reply(rdpdrPlugin* rdpdr) return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT16(s, RDPDR_CTYP_CORE); /* Component (2 bytes) */ + Stream_Write_UINT16(s, RDPDR_CTYP_CORE); /* Component (2 bytes) */ Stream_Write_UINT16(s, PAKID_CORE_CLIENTID_CONFIRM); /* PacketId (2 bytes) */ Stream_Write_UINT16(s, rdpdr->versionMajor); Stream_Write_UINT16(s, rdpdr->versionMinor); - Stream_Write_UINT32(s, (UINT32) rdpdr->clientID); + Stream_Write_UINT32(s, (UINT32)rdpdr->clientID); return rdpdr_send(rdpdr, s); } @@ -1113,8 +1101,7 @@ static UINT rdpdr_send_client_name_request(rdpdrPlugin* rdpdr) if (!rdpdr->computerName[0]) gethostname(rdpdr->computerName, sizeof(rdpdr->computerName) - 1); - computerNameLenW = ConvertToUnicode(CP_UTF8, 0, rdpdr->computerName, -1, - &computerNameW, 0) * 2; + computerNameLenW = ConvertToUnicode(CP_UTF8, 0, rdpdr->computerName, -1, &computerNameW, 0) * 2; s = Stream_New(NULL, 16 + computerNameLenW + 2); if (!s) @@ -1124,20 +1111,18 @@ static UINT rdpdr_send_client_name_request(rdpdrPlugin* rdpdr) return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT16(s, RDPDR_CTYP_CORE); /* Component (2 bytes) */ + Stream_Write_UINT16(s, RDPDR_CTYP_CORE); /* Component (2 bytes) */ Stream_Write_UINT16(s, PAKID_CORE_CLIENT_NAME); /* PacketId (2 bytes) */ - Stream_Write_UINT32(s, 1); /* unicodeFlag, 0 for ASCII and 1 for Unicode */ - Stream_Write_UINT32(s, 0); /* codePage, must be set to zero */ - Stream_Write_UINT32(s, computerNameLenW + - 2); /* computerNameLen, including null terminator */ + Stream_Write_UINT32(s, 1); /* unicodeFlag, 0 for ASCII and 1 for Unicode */ + Stream_Write_UINT32(s, 0); /* codePage, must be set to zero */ + Stream_Write_UINT32(s, computerNameLenW + 2); /* computerNameLen, including null terminator */ Stream_Write(s, computerNameW, computerNameLenW); Stream_Write_UINT16(s, 0); /* null terminator */ free(computerNameW); return rdpdr_send(rdpdr, s); } -static UINT rdpdr_process_server_clientid_confirm(rdpdrPlugin* rdpdr, - wStream* s) +static UINT rdpdr_process_server_clientid_confirm(rdpdrPlugin* rdpdr, wStream* s) { UINT16 versionMajor; UINT16 versionMinor; @@ -1167,8 +1152,7 @@ static UINT rdpdr_process_server_clientid_confirm(rdpdrPlugin* rdpdr, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, - BOOL userLoggedOn) +static UINT rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, BOOL userLoggedOn) { int i; BYTE c; @@ -1189,7 +1173,7 @@ static UINT rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT16(s, RDPDR_CTYP_CORE); /* Component (2 bytes) */ + Stream_Write_UINT16(s, RDPDR_CTYP_CORE); /* Component (2 bytes) */ Stream_Write_UINT16(s, PAKID_CORE_DEVICELIST_ANNOUNCE); /* PacketId (2 bytes) */ count_pos = Stream_GetPosition(s); count = 0; @@ -1199,8 +1183,7 @@ static UINT rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, for (index = 0; index < keyCount; index++) { - device = (DEVICE*) ListDictionary_GetItemValue(rdpdr->devman->devices, - (void*) pKeys[index]); + device = (DEVICE*)ListDictionary_GetItemValue(rdpdr->devman->devices, (void*)pKeys[index]); /** * 1. versionMinor 0x0005 doesn't send PAKID_CORE_USER_LOGGEDON @@ -1209,8 +1192,8 @@ static UINT rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, * 3. other devices are sent only after user_loggedon */ - if ((rdpdr->versionMinor == 0x0005) || - (device->type == RDPDR_DTYP_SMARTCARD) || userLoggedOn) + if ((rdpdr->versionMinor == 0x0005) || (device->type == RDPDR_DTYP_SMARTCARD) || + userLoggedOn) { data_len = (device->data == NULL ? 0 : Stream_GetPosition(device->data)); @@ -1223,8 +1206,8 @@ static UINT rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, } Stream_Write_UINT32(s, device->type); /* deviceType */ - Stream_Write_UINT32(s, device->id); /* deviceID */ - strncpy((char*) Stream_Pointer(s), device->name, 8); + Stream_Write_UINT32(s, device->id); /* deviceID */ + strncpy((char*)Stream_Pointer(s), device->name, 8); for (i = 0; i < 8; i++) { @@ -1242,7 +1225,7 @@ static UINT rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, Stream_Write(s, Stream_Buffer(device->data), data_len); count++; - WLog_INFO(TAG, "registered device #%"PRIu32": %s (type=%"PRIu32" id=%"PRIu32")", + WLog_INFO(TAG, "registered device #%" PRIu32 ": %s (type=%" PRIu32 " id=%" PRIu32 ")", count, device->name, device->type, device->id); } } @@ -1269,14 +1252,14 @@ static UINT rdpdr_process_irp(rdpdrPlugin* rdpdr, wStream* s) if (!irp) { - WLog_ERR(TAG, "irp_new failed with %"PRIu32"!", error); + WLog_ERR(TAG, "irp_new failed with %" PRIu32 "!", error); return error; } IFCALLRET(irp->device->IRPRequest, error, irp->device, irp); if (error) - WLog_ERR(TAG, "device->IRPRequest failed with error %"PRIu32"", error); + WLog_ERR(TAG, "device->IRPRequest failed with error %" PRIu32 "", error); return error; } @@ -1323,8 +1306,7 @@ static UINT rdpdr_process_init(rdpdrPlugin* rdpdr) for (index = 0; index < keyCount; index++) { - device = (DEVICE*) ListDictionary_GetItemValue(rdpdr->devman->devices, - (void*) pKeys[index]); + device = (DEVICE*)ListDictionary_GetItemValue(rdpdr->devman->devices, (void*)pKeys[index]); IFCALLRET(device->Init, error, device); if (error != CHANNEL_RC_OK) @@ -1358,7 +1340,7 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) if (Stream_GetRemainingLength(s) >= 4) { Stream_Read_UINT16(s, component); /* Component (2 bytes) */ - Stream_Read_UINT16(s, packetId); /* PacketId (2 bytes) */ + Stream_Read_UINT16(s, packetId); /* PacketId (2 bytes) */ if (component == RDPDR_CTYP_CORE) { @@ -1370,15 +1352,19 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) } else if ((error = rdpdr_send_client_announce_reply(rdpdr))) { - WLog_ERR(TAG, "rdpdr_send_client_announce_reply failed with error %"PRIu32"", error); + WLog_ERR(TAG, + "rdpdr_send_client_announce_reply failed with error %" PRIu32 "", + error); } else if ((error = rdpdr_send_client_name_request(rdpdr))) { - WLog_ERR(TAG, "rdpdr_send_client_name_request failed with error %"PRIu32"", error); + WLog_ERR(TAG, + "rdpdr_send_client_name_request failed with error %" PRIu32 "", + error); } else if ((error = rdpdr_process_init(rdpdr))) { - WLog_ERR(TAG, "rdpdr_process_init failed with error %"PRIu32"", error); + WLog_ERR(TAG, "rdpdr_process_init failed with error %" PRIu32 "", error); } break; @@ -1389,7 +1375,9 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) } else if ((error = rdpdr_send_capability_response(rdpdr))) { - WLog_ERR(TAG, "rdpdr_send_capability_response failed with error %"PRIu32"", error); + WLog_ERR(TAG, + "rdpdr_send_capability_response failed with error %" PRIu32 "", + error); } break; @@ -1400,8 +1388,10 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) } else if ((error = rdpdr_send_device_list_announce_request(rdpdr, FALSE))) { - WLog_ERR(TAG, "rdpdr_send_device_list_announce_request failed with error %"PRIu32"", - error); + WLog_ERR( + TAG, + "rdpdr_send_device_list_announce_request failed with error %" PRIu32 "", + error); } break; @@ -1409,8 +1399,10 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) case PAKID_CORE_USER_LOGGEDON: if ((error = rdpdr_send_device_list_announce_request(rdpdr, TRUE))) { - WLog_ERR(TAG, "rdpdr_send_device_list_announce_request failed with error %"PRIu32"", - error); + WLog_ERR( + TAG, + "rdpdr_send_device_list_announce_request failed with error %" PRIu32 "", + error); } break; @@ -1430,7 +1422,7 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) case PAKID_CORE_DEVICE_IOREQUEST: if ((error = rdpdr_process_irp(rdpdr, s))) { - WLog_ERR(TAG, "rdpdr_process_irp failed with error %"PRIu32"", error); + WLog_ERR(TAG, "rdpdr_process_irp failed with error %" PRIu32 "", error); return error; } else @@ -1439,7 +1431,7 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) break; default: - WLog_ERR(TAG, "RDPDR_CTYP_CORE unknown PacketId: 0x%04"PRIX16"", packetId); + WLog_ERR(TAG, "RDPDR_CTYP_CORE unknown PacketId: 0x%04" PRIX16 "", packetId); error = ERROR_INVALID_DATA; break; } @@ -1450,8 +1442,9 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) if (error != CHANNEL_RC_OK) { - WLog_ERR(TAG, "Unknown message: Component: 0x%04"PRIX16" PacketId: 0x%04"PRIX16"", component, - packetId); + WLog_ERR(TAG, + "Unknown message: Component: 0x%04" PRIX16 " PacketId: 0x%04" PRIX16 "", + component, packetId); } } } @@ -1468,7 +1461,7 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) UINT rdpdr_send(rdpdrPlugin* rdpdr, wStream* s) { UINT status; - rdpdrPlugin* plugin = (rdpdrPlugin*) rdpdr; + rdpdrPlugin* plugin = (rdpdrPlugin*)rdpdr; if (!rdpdr || !s) { @@ -1483,14 +1476,15 @@ UINT rdpdr_send(rdpdrPlugin* rdpdr, wStream* s) } else { - status = plugin->channelEntryPoints.pVirtualChannelWriteEx(plugin->InitHandle, plugin->OpenHandle, - Stream_Buffer(s), (UINT32) Stream_GetPosition(s), s); + status = plugin->channelEntryPoints.pVirtualChannelWriteEx( + plugin->InitHandle, plugin->OpenHandle, Stream_Buffer(s), (UINT32)Stream_GetPosition(s), + s); } if (status != CHANNEL_RC_OK) { Stream_Free(s, TRUE); - WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08"PRIX32"]", + WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08" PRIX32 "]", WTSErrorToString(status), status); } @@ -1502,8 +1496,9 @@ UINT rdpdr_send(rdpdrPlugin* rdpdr, wStream* s) * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_virtual_channel_event_data_received(rdpdrPlugin* rdpdr, - void* pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) +static UINT rdpdr_virtual_channel_event_data_received(rdpdrPlugin* rdpdr, void* pData, + UINT32 dataLength, UINT32 totalLength, + UINT32 dataFlags) { wStream* data_in; @@ -1527,16 +1522,16 @@ static UINT rdpdr_virtual_channel_event_data_received(rdpdrPlugin* rdpdr, if (!rdpdr->data_in) { - WLog_ERR(TAG, "Stream_New failed!"); + WLog_ERR(TAG, "Stream_New failed!"); return CHANNEL_RC_NO_MEMORY; } } data_in = rdpdr->data_in; - if (!Stream_EnsureRemainingCapacity(data_in, (int) dataLength)) + if (!Stream_EnsureRemainingCapacity(data_in, (int)dataLength)) { - WLog_ERR(TAG, "Stream_EnsureRemainingCapacity failed!"); + WLog_ERR(TAG, "Stream_EnsureRemainingCapacity failed!"); return ERROR_INVALID_DATA; } @@ -1554,7 +1549,7 @@ static UINT rdpdr_virtual_channel_event_data_received(rdpdrPlugin* rdpdr, Stream_SealLength(data_in); Stream_SetPosition(data_in, 0); - if (!MessageQueue_Post(rdpdr->queue, NULL, 0, (void*) data_in, NULL)) + if (!MessageQueue_Post(rdpdr->queue, NULL, 0, (void*)data_in, NULL)) { WLog_ERR(TAG, "MessageQueue_Post failed!"); return ERROR_INTERNAL_ERROR; @@ -1565,25 +1560,27 @@ static UINT rdpdr_virtual_channel_event_data_received(rdpdrPlugin* rdpdr, } static VOID VCAPITYPE rdpdr_virtual_channel_open_event_ex(LPVOID lpUserParam, DWORD openHandle, - UINT event, - LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) + UINT event, LPVOID pData, + UINT32 dataLength, UINT32 totalLength, + UINT32 dataFlags) { UINT error = CHANNEL_RC_OK; - rdpdrPlugin* rdpdr = (rdpdrPlugin*) lpUserParam; + rdpdrPlugin* rdpdr = (rdpdrPlugin*)lpUserParam; if (!rdpdr || !pData || (rdpdr->OpenHandle != openHandle)) { - WLog_ERR(TAG, "error no match"); + WLog_ERR(TAG, "error no match"); return; } switch (event) { case CHANNEL_EVENT_DATA_RECEIVED: - if ((error = rdpdr_virtual_channel_event_data_received(rdpdr, pData, - dataLength, totalLength, dataFlags))) + if ((error = rdpdr_virtual_channel_event_data_received(rdpdr, pData, dataLength, + totalLength, dataFlags))) WLog_ERR(TAG, - "rdpdr_virtual_channel_event_data_received failed with error %"PRIu32"!", error); + "rdpdr_virtual_channel_event_data_received failed with error %" PRIu32 "!", + error); break; @@ -1593,7 +1590,7 @@ static VOID VCAPITYPE rdpdr_virtual_channel_open_event_ex(LPVOID lpUserParam, DW wStream* s = (wStream*)pData; Stream_Free(s, TRUE); } - break; + break; case CHANNEL_EVENT_USER: break; @@ -1610,18 +1607,18 @@ static DWORD WINAPI rdpdr_virtual_channel_client_thread(LPVOID arg) { wStream* data; wMessage message; - rdpdrPlugin* rdpdr = (rdpdrPlugin*) arg; + rdpdrPlugin* rdpdr = (rdpdrPlugin*)arg; UINT error; if (!rdpdr) { - ExitThread((DWORD) CHANNEL_RC_NULL_DATA); + ExitThread((DWORD)CHANNEL_RC_NULL_DATA); return CHANNEL_RC_NULL_DATA; } if ((error = rdpdr_process_connect(rdpdr))) { - WLog_ERR(TAG, "rdpdr_process_connect failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpdr_process_connect failed with error %" PRIu32 "!", error); if (rdpdr->rdpcontext) setChannelError(rdpdr->rdpcontext, error, @@ -1643,17 +1640,17 @@ static DWORD WINAPI rdpdr_virtual_channel_client_thread(LPVOID arg) if (message.id == 0) { - data = (wStream*) message.wParam; + data = (wStream*)message.wParam; if ((error = rdpdr_process_receive(rdpdr, data))) { - WLog_ERR(TAG, "rdpdr_process_receive failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpdr_process_receive failed with error %" PRIu32 "!", error); if (rdpdr->rdpcontext) setChannelError(rdpdr->rdpcontext, error, "rdpdr_virtual_channel_client_thread reported an error"); - ExitThread((DWORD) error); + ExitThread((DWORD)error); return error; } } @@ -1669,16 +1666,17 @@ static DWORD WINAPI rdpdr_virtual_channel_client_thread(LPVOID arg) * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_virtual_channel_event_connected(rdpdrPlugin* rdpdr, - LPVOID pData, UINT32 dataLength) +static UINT rdpdr_virtual_channel_event_connected(rdpdrPlugin* rdpdr, LPVOID pData, + UINT32 dataLength) { UINT32 status; - status = rdpdr->channelEntryPoints.pVirtualChannelOpenEx(rdpdr->InitHandle, - &rdpdr->OpenHandle, rdpdr->channelDef.name, rdpdr_virtual_channel_open_event_ex); + status = rdpdr->channelEntryPoints.pVirtualChannelOpenEx(rdpdr->InitHandle, &rdpdr->OpenHandle, + rdpdr->channelDef.name, + rdpdr_virtual_channel_open_event_ex); if (status != CHANNEL_RC_OK) { - WLog_ERR(TAG, "pVirtualChannelOpenEx failed with %s [%08"PRIX32"]", + WLog_ERR(TAG, "pVirtualChannelOpenEx failed with %s [%08" PRIX32 "]", WTSErrorToString(status), status); return status; } @@ -1691,9 +1689,8 @@ static UINT rdpdr_virtual_channel_event_connected(rdpdrPlugin* rdpdr, return CHANNEL_RC_NO_MEMORY; } - if (!(rdpdr->thread = CreateThread(NULL, 0, - rdpdr_virtual_channel_client_thread, (void*) rdpdr, 0, - NULL))) + if (!(rdpdr->thread = + CreateThread(NULL, 0, rdpdr_virtual_channel_client_thread, (void*)rdpdr, 0, NULL))) { WLog_ERR(TAG, "CreateThread failed!"); return ERROR_INTERNAL_ERROR; @@ -1714,11 +1711,11 @@ static UINT rdpdr_virtual_channel_event_disconnected(rdpdrPlugin* rdpdr) if (rdpdr->OpenHandle == 0) return CHANNEL_RC_OK; - if (MessageQueue_PostQuit(rdpdr->queue, 0) - && (WaitForSingleObject(rdpdr->thread, INFINITE) == WAIT_FAILED)) + if (MessageQueue_PostQuit(rdpdr->queue, 0) && + (WaitForSingleObject(rdpdr->thread, INFINITE) == WAIT_FAILED)) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); return error; } @@ -1729,7 +1726,7 @@ static UINT rdpdr_virtual_channel_event_disconnected(rdpdrPlugin* rdpdr) if ((error = drive_hotplug_thread_terminate(rdpdr))) { - WLog_ERR(TAG, "drive_hotplug_thread_terminate failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "drive_hotplug_thread_terminate failed with error %" PRIu32 "!", error); return error; } @@ -1737,7 +1734,7 @@ static UINT rdpdr_virtual_channel_event_disconnected(rdpdrPlugin* rdpdr) if (CHANNEL_RC_OK != error) { - WLog_ERR(TAG, "pVirtualChannelCloseEx failed with %s [%08"PRIX32"]", + WLog_ERR(TAG, "pVirtualChannelCloseEx failed with %s [%08" PRIX32 "]", WTSErrorToString(error), error); } @@ -1765,11 +1762,10 @@ static void rdpdr_virtual_channel_event_terminated(rdpdrPlugin* rdpdr) } static VOID VCAPITYPE rdpdr_virtual_channel_init_event_ex(LPVOID lpUserParam, LPVOID pInitHandle, - UINT event, - LPVOID pData, UINT dataLength) + UINT event, LPVOID pData, UINT dataLength) { UINT error = CHANNEL_RC_OK; - rdpdrPlugin* rdpdr = (rdpdrPlugin*) lpUserParam; + rdpdrPlugin* rdpdr = (rdpdrPlugin*)lpUserParam; if (!rdpdr || (rdpdr->InitHandle != pInitHandle)) { @@ -1784,14 +1780,16 @@ static VOID VCAPITYPE rdpdr_virtual_channel_init_event_ex(LPVOID lpUserParam, LP case CHANNEL_EVENT_CONNECTED: if ((error = rdpdr_virtual_channel_event_connected(rdpdr, pData, dataLength))) - WLog_ERR(TAG, "rdpdr_virtual_channel_event_connected failed with error %"PRIu32"!", + WLog_ERR(TAG, + "rdpdr_virtual_channel_event_connected failed with error %" PRIu32 "!", error); break; case CHANNEL_EVENT_DISCONNECTED: if ((error = rdpdr_virtual_channel_event_disconnected(rdpdr))) - WLog_ERR(TAG, "rdpdr_virtual_channel_event_disconnected failed with error %"PRIu32"!", + WLog_ERR(TAG, + "rdpdr_virtual_channel_event_disconnected failed with error %" PRIu32 "!", error); break; @@ -1803,7 +1801,7 @@ static VOID VCAPITYPE rdpdr_virtual_channel_init_event_ex(LPVOID lpUserParam, LP case CHANNEL_EVENT_ATTACHED: case CHANNEL_EVENT_DETACHED: default: - WLog_ERR(TAG, "unknown event %"PRIu32"!", event); + WLog_ERR(TAG, "unknown event %" PRIu32 "!", event); break; } @@ -1813,14 +1811,14 @@ static VOID VCAPITYPE rdpdr_virtual_channel_init_event_ex(LPVOID lpUserParam, LP } /* rdpdr is always built-in */ -#define VirtualChannelEntryEx rdpdr_VirtualChannelEntryEx +#define VirtualChannelEntryEx rdpdr_VirtualChannelEntryEx BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID pInitHandle) { UINT rc; rdpdrPlugin* rdpdr; CHANNEL_ENTRY_POINTS_FREERDP_EX* pEntryPointsEx; - rdpdr = (rdpdrPlugin*) calloc(1, sizeof(rdpdrPlugin)); + rdpdr = (rdpdrPlugin*)calloc(1, sizeof(rdpdrPlugin)); if (!rdpdr) { @@ -1829,12 +1827,10 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p } rdpdr->channelDef.options = - CHANNEL_OPTION_INITIALIZED | - CHANNEL_OPTION_ENCRYPT_RDP | - CHANNEL_OPTION_COMPRESS_RDP; + CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP | CHANNEL_OPTION_COMPRESS_RDP; sprintf_s(rdpdr->channelDef.name, ARRAYSIZE(rdpdr->channelDef.name), "rdpdr"); rdpdr->sequenceId = 0; - pEntryPointsEx = (CHANNEL_ENTRY_POINTS_FREERDP_EX*) pEntryPoints; + pEntryPointsEx = (CHANNEL_ENTRY_POINTS_FREERDP_EX*)pEntryPoints; if ((pEntryPointsEx->cbSize >= sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX)) && (pEntryPointsEx->MagicNumber == FREERDP_CHANNEL_MAGIC_NUMBER)) @@ -1842,17 +1838,16 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p rdpdr->rdpcontext = pEntryPointsEx->context; } - CopyMemory(&(rdpdr->channelEntryPoints), pEntryPoints, - sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX)); + CopyMemory(&(rdpdr->channelEntryPoints), pEntryPoints, sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX)); rdpdr->InitHandle = pInitHandle; - rc = rdpdr->channelEntryPoints.pVirtualChannelInitEx(rdpdr, NULL, pInitHandle, - &rdpdr->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000, - rdpdr_virtual_channel_init_event_ex); + rc = rdpdr->channelEntryPoints.pVirtualChannelInitEx( + rdpdr, NULL, pInitHandle, &rdpdr->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000, + rdpdr_virtual_channel_init_event_ex); if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "pVirtualChannelInitEx failed with %s [%08"PRIX32"]", - WTSErrorToString(rc), rc); + WLog_ERR(TAG, "pVirtualChannelInitEx failed with %s [%08" PRIX32 "]", WTSErrorToString(rc), + rc); free(rdpdr); return FALSE; } diff --git a/channels/rdpdr/server/rdpdr_main.c b/channels/rdpdr/server/rdpdr_main.c index e8711196c..3e005da0f 100644 --- a/channels/rdpdr/server/rdpdr_main.c +++ b/channels/rdpdr/server/rdpdr_main.c @@ -39,7 +39,7 @@ static UINT32 g_ClientId = 0; static RDPDR_IRP* rdpdr_server_irp_new() { RDPDR_IRP* irp; - irp = (RDPDR_IRP*) calloc(1, sizeof(RDPDR_IRP)); + irp = (RDPDR_IRP*)calloc(1, sizeof(RDPDR_IRP)); return irp; } @@ -48,19 +48,15 @@ static void rdpdr_server_irp_free(RDPDR_IRP* irp) free(irp); } -static BOOL rdpdr_server_enqueue_irp(RdpdrServerContext* context, - RDPDR_IRP* irp) +static BOOL rdpdr_server_enqueue_irp(RdpdrServerContext* context, RDPDR_IRP* irp) { - return ListDictionary_Add(context->priv->IrpList, - (void*)(size_t) irp->CompletionId, irp); + return ListDictionary_Add(context->priv->IrpList, (void*)(size_t)irp->CompletionId, irp); } -static RDPDR_IRP* rdpdr_server_dequeue_irp(RdpdrServerContext* context, - UINT32 completionId) +static RDPDR_IRP* rdpdr_server_dequeue_irp(RdpdrServerContext* context, UINT32 completionId) { RDPDR_IRP* irp; - irp = (RDPDR_IRP*) ListDictionary_Remove(context->priv->IrpList, - (void*)(size_t) completionId); + irp = (RDPDR_IRP*)ListDictionary_Remove(context->priv->IrpList, (void*)(size_t)completionId); return irp; } @@ -86,17 +82,15 @@ static UINT rdpdr_server_send_announce_request(RdpdrServerContext* context) return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT16(s, header.Component); /* Component (2 bytes) */ - Stream_Write_UINT16(s, header.PacketId); /* PacketId (2 bytes) */ - Stream_Write_UINT16(s, - context->priv->VersionMajor); /* VersionMajor (2 bytes) */ - Stream_Write_UINT16(s, - context->priv->VersionMinor); /* VersionMinor (2 bytes) */ - Stream_Write_UINT32(s, context->priv->ClientId); /* ClientId (4 bytes) */ + Stream_Write_UINT16(s, header.Component); /* Component (2 bytes) */ + Stream_Write_UINT16(s, header.PacketId); /* PacketId (2 bytes) */ + Stream_Write_UINT16(s, context->priv->VersionMajor); /* VersionMajor (2 bytes) */ + Stream_Write_UINT16(s, context->priv->VersionMinor); /* VersionMinor (2 bytes) */ + Stream_Write_UINT32(s, context->priv->ClientId); /* ClientId (4 bytes) */ Stream_SealLength(s); winpr_HexDump(TAG, WLOG_DEBUG, Stream_Buffer(s), Stream_Length(s)); - status = WTSVirtualChannelWrite(context->priv->ChannelHandle, - (PCHAR) Stream_Buffer(s), Stream_Length(s), &written); + status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s), + Stream_Length(s), &written); Stream_Free(s, TRUE); return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } @@ -106,8 +100,8 @@ static UINT rdpdr_server_send_announce_request(RdpdrServerContext* context) * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_receive_announce_response(RdpdrServerContext* context, - wStream* s, RDPDR_HEADER* header) +static UINT rdpdr_server_receive_announce_response(RdpdrServerContext* context, wStream* s, + RDPDR_HEADER* header) { UINT32 ClientId; UINT16 VersionMajor; @@ -121,9 +115,10 @@ static UINT rdpdr_server_receive_announce_response(RdpdrServerContext* context, Stream_Read_UINT16(s, VersionMajor); /* VersionMajor (2 bytes) */ Stream_Read_UINT16(s, VersionMinor); /* VersionMinor (2 bytes) */ - Stream_Read_UINT32(s, ClientId); /* ClientId (4 bytes) */ + Stream_Read_UINT32(s, ClientId); /* ClientId (4 bytes) */ WLog_DBG(TAG, - "Client Announce Response: VersionMajor: 0x%08"PRIX16" VersionMinor: 0x%04"PRIX16" ClientId: 0x%08"PRIX32"", + "Client Announce Response: VersionMajor: 0x%08" PRIX16 " VersionMinor: 0x%04" PRIX16 + " ClientId: 0x%08" PRIX32 "", VersionMajor, VersionMinor, ClientId); context->priv->ClientId = ClientId; return CHANNEL_RC_OK; @@ -134,8 +129,8 @@ static UINT rdpdr_server_receive_announce_response(RdpdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_receive_client_name_request(RdpdrServerContext* - context, wStream* s, RDPDR_HEADER* header) +static UINT rdpdr_server_receive_client_name_request(RdpdrServerContext* context, wStream* s, + RDPDR_HEADER* header) { UINT32 UnicodeFlag; UINT32 ComputerNameLen; @@ -146,8 +141,8 @@ static UINT rdpdr_server_receive_client_name_request(RdpdrServerContext* return ERROR_INVALID_DATA; } - Stream_Read_UINT32(s, UnicodeFlag); /* UnicodeFlag (4 bytes) */ - Stream_Seek_UINT32(s); /* CodePage (4 bytes), MUST be set to zero */ + Stream_Read_UINT32(s, UnicodeFlag); /* UnicodeFlag (4 bytes) */ + Stream_Seek_UINT32(s); /* CodePage (4 bytes), MUST be set to zero */ Stream_Read_UINT32(s, ComputerNameLen); /* ComputerNameLen (4 bytes) */ /* UnicodeFlag is either 0 or 1, the other 31 bits must be ignored. */ @@ -162,7 +157,7 @@ static UINT rdpdr_server_receive_client_name_request(RdpdrServerContext* { if ((ComputerNameLen % 2) || ComputerNameLen > 512 || ComputerNameLen < 2) { - WLog_ERR(TAG, "invalid unicode computer name length: %"PRIu32"", ComputerNameLen); + WLog_ERR(TAG, "invalid unicode computer name length: %" PRIu32 "", ComputerNameLen); return ERROR_INVALID_DATA; } } @@ -170,7 +165,7 @@ static UINT rdpdr_server_receive_client_name_request(RdpdrServerContext* { if (ComputerNameLen > 256 || ComputerNameLen < 1) { - WLog_ERR(TAG, "invalid ascii computer name length: %"PRIu32"", ComputerNameLen); + WLog_ERR(TAG, "invalid ascii computer name length: %" PRIu32 "", ComputerNameLen); return ERROR_INVALID_DATA; } } @@ -198,7 +193,7 @@ static UINT rdpdr_server_receive_client_name_request(RdpdrServerContext* if (UnicodeFlag) { - if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) Stream_Pointer(s), -1, + if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)Stream_Pointer(s), -1, &(context->priv->ClientComputerName), 0, NULL, NULL) < 1) { WLog_ERR(TAG, "failed to convert client computer name"); @@ -207,7 +202,7 @@ static UINT rdpdr_server_receive_client_name_request(RdpdrServerContext* } else { - context->priv->ClientComputerName = _strdup((char*) Stream_Pointer(s)); + context->priv->ClientComputerName = _strdup((char*)Stream_Pointer(s)); if (!context->priv->ClientComputerName) { @@ -226,8 +221,7 @@ static UINT rdpdr_server_receive_client_name_request(RdpdrServerContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_read_capability_set_header(wStream* s, - RDPDR_CAPABILITY_HEADER* header) +static UINT rdpdr_server_read_capability_set_header(wStream* s, RDPDR_CAPABILITY_HEADER* header) { if (Stream_GetRemainingLength(s) < 8) { @@ -235,10 +229,9 @@ static UINT rdpdr_server_read_capability_set_header(wStream* s, return ERROR_INVALID_DATA; } - Stream_Read_UINT16(s, header->CapabilityType); /* CapabilityType (2 bytes) */ - Stream_Read_UINT16(s, - header->CapabilityLength); /* CapabilityLength (2 bytes) */ - Stream_Read_UINT32(s, header->Version); /* Version (4 bytes) */ + Stream_Read_UINT16(s, header->CapabilityType); /* CapabilityType (2 bytes) */ + Stream_Read_UINT16(s, header->CapabilityLength); /* CapabilityLength (2 bytes) */ + Stream_Read_UINT32(s, header->Version); /* Version (4 bytes) */ return CHANNEL_RC_OK; } @@ -247,8 +240,7 @@ static UINT rdpdr_server_read_capability_set_header(wStream* s, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_write_capability_set_header(wStream* s, - RDPDR_CAPABILITY_HEADER* header) +static UINT rdpdr_server_write_capability_set_header(wStream* s, RDPDR_CAPABILITY_HEADER* header) { if (!Stream_EnsureRemainingCapacity(s, 8)) { @@ -256,10 +248,9 @@ static UINT rdpdr_server_write_capability_set_header(wStream* s, return ERROR_INVALID_DATA; } - Stream_Write_UINT16(s, header->CapabilityType); /* CapabilityType (2 bytes) */ - Stream_Write_UINT16(s, - header->CapabilityLength); /* CapabilityLength (2 bytes) */ - Stream_Write_UINT32(s, header->Version); /* Version (4 bytes) */ + Stream_Write_UINT16(s, header->CapabilityType); /* CapabilityType (2 bytes) */ + Stream_Write_UINT16(s, header->CapabilityLength); /* CapabilityLength (2 bytes) */ + Stream_Write_UINT32(s, header->Version); /* Version (4 bytes) */ return CHANNEL_RC_OK; } @@ -268,8 +259,8 @@ static UINT rdpdr_server_write_capability_set_header(wStream* s, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_read_general_capability_set(RdpdrServerContext* - context, wStream* s, RDPDR_CAPABILITY_HEADER* header) +static UINT rdpdr_server_read_general_capability_set(RdpdrServerContext* context, wStream* s, + RDPDR_CAPABILITY_HEADER* header) { UINT32 ioCode1; UINT32 extraFlags1; @@ -284,17 +275,15 @@ static UINT rdpdr_server_read_general_capability_set(RdpdrServerContext* return ERROR_INVALID_DATA; } - Stream_Seek_UINT32(s); /* osType (4 bytes), ignored on receipt */ - Stream_Seek_UINT32(s); /* osVersion (4 bytes), unused and must be set to zero */ + Stream_Seek_UINT32(s); /* osType (4 bytes), ignored on receipt */ + Stream_Seek_UINT32(s); /* osVersion (4 bytes), unused and must be set to zero */ Stream_Read_UINT16(s, VersionMajor); /* protocolMajorVersion (2 bytes) */ Stream_Read_UINT16(s, VersionMinor); /* protocolMinorVersion (2 bytes) */ - Stream_Read_UINT32(s, ioCode1); /* ioCode1 (4 bytes) */ - Stream_Seek_UINT32( - s); /* ioCode2 (4 bytes), must be set to zero, reserved for future use */ + Stream_Read_UINT32(s, ioCode1); /* ioCode1 (4 bytes) */ + Stream_Seek_UINT32(s); /* ioCode2 (4 bytes), must be set to zero, reserved for future use */ Stream_Read_UINT32(s, extendedPdu); /* extendedPdu (4 bytes) */ Stream_Read_UINT32(s, extraFlags1); /* extraFlags1 (4 bytes) */ - Stream_Seek_UINT32( - s); /* extraFlags2 (4 bytes), must be set to zero, reserved for future use */ + Stream_Seek_UINT32(s); /* extraFlags2 (4 bytes), must be set to zero, reserved for future use */ if (header->Version == GENERAL_CAPABILITY_VERSION_02) { @@ -304,12 +293,10 @@ static UINT rdpdr_server_read_general_capability_set(RdpdrServerContext* return ERROR_INVALID_DATA; } - Stream_Read_UINT32(s, - SpecialTypeDeviceCap); /* SpecialTypeDeviceCap (4 bytes) */ + Stream_Read_UINT32(s, SpecialTypeDeviceCap); /* SpecialTypeDeviceCap (4 bytes) */ } - context->priv->UserLoggedOnPdu = (extendedPdu & RDPDR_USER_LOGGEDON_PDU) ? - TRUE : FALSE; + context->priv->UserLoggedOnPdu = (extendedPdu & RDPDR_USER_LOGGEDON_PDU) ? TRUE : FALSE; return CHANNEL_RC_OK; } @@ -318,8 +305,7 @@ static UINT rdpdr_server_read_general_capability_set(RdpdrServerContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_write_general_capability_set(RdpdrServerContext* - context, wStream* s) +static UINT rdpdr_server_write_general_capability_set(RdpdrServerContext* context, wStream* s) { UINT32 ioCode1; UINT32 extendedPdu; @@ -330,25 +316,25 @@ static UINT rdpdr_server_write_general_capability_set(RdpdrServerContext* header.CapabilityLength = RDPDR_CAPABILITY_HEADER_LENGTH + 36; header.Version = GENERAL_CAPABILITY_VERSION_02; ioCode1 = 0; - ioCode1 |= RDPDR_IRP_MJ_CREATE; /* always set */ - ioCode1 |= RDPDR_IRP_MJ_CLEANUP; /* always set */ - ioCode1 |= RDPDR_IRP_MJ_CLOSE; /* always set */ - ioCode1 |= RDPDR_IRP_MJ_READ; /* always set */ - ioCode1 |= RDPDR_IRP_MJ_WRITE; /* always set */ - ioCode1 |= RDPDR_IRP_MJ_FLUSH_BUFFERS; /* always set */ - ioCode1 |= RDPDR_IRP_MJ_SHUTDOWN; /* always set */ - ioCode1 |= RDPDR_IRP_MJ_DEVICE_CONTROL; /* always set */ + ioCode1 |= RDPDR_IRP_MJ_CREATE; /* always set */ + ioCode1 |= RDPDR_IRP_MJ_CLEANUP; /* always set */ + ioCode1 |= RDPDR_IRP_MJ_CLOSE; /* always set */ + ioCode1 |= RDPDR_IRP_MJ_READ; /* always set */ + ioCode1 |= RDPDR_IRP_MJ_WRITE; /* always set */ + ioCode1 |= RDPDR_IRP_MJ_FLUSH_BUFFERS; /* always set */ + ioCode1 |= RDPDR_IRP_MJ_SHUTDOWN; /* always set */ + ioCode1 |= RDPDR_IRP_MJ_DEVICE_CONTROL; /* always set */ ioCode1 |= RDPDR_IRP_MJ_QUERY_VOLUME_INFORMATION; /* always set */ - ioCode1 |= RDPDR_IRP_MJ_SET_VOLUME_INFORMATION; /* always set */ - ioCode1 |= RDPDR_IRP_MJ_QUERY_INFORMATION; /* always set */ - ioCode1 |= RDPDR_IRP_MJ_SET_INFORMATION; /* always set */ - ioCode1 |= RDPDR_IRP_MJ_DIRECTORY_CONTROL; /* always set */ - ioCode1 |= RDPDR_IRP_MJ_LOCK_CONTROL; /* always set */ - ioCode1 |= RDPDR_IRP_MJ_QUERY_SECURITY; /* optional */ - ioCode1 |= RDPDR_IRP_MJ_SET_SECURITY; /* optional */ + ioCode1 |= RDPDR_IRP_MJ_SET_VOLUME_INFORMATION; /* always set */ + ioCode1 |= RDPDR_IRP_MJ_QUERY_INFORMATION; /* always set */ + ioCode1 |= RDPDR_IRP_MJ_SET_INFORMATION; /* always set */ + ioCode1 |= RDPDR_IRP_MJ_DIRECTORY_CONTROL; /* always set */ + ioCode1 |= RDPDR_IRP_MJ_LOCK_CONTROL; /* always set */ + ioCode1 |= RDPDR_IRP_MJ_QUERY_SECURITY; /* optional */ + ioCode1 |= RDPDR_IRP_MJ_SET_SECURITY; /* optional */ extendedPdu = 0; extendedPdu |= RDPDR_CLIENT_DISPLAY_NAME_PDU; /* always set */ - extendedPdu |= RDPDR_DEVICE_REMOVE_PDUS; /* optional */ + extendedPdu |= RDPDR_DEVICE_REMOVE_PDUS; /* optional */ if (context->priv->UserLoggedOnPdu) extendedPdu |= RDPDR_USER_LOGGEDON_PDU; /* optional */ @@ -365,21 +351,16 @@ static UINT rdpdr_server_write_general_capability_set(RdpdrServerContext* rdpdr_server_write_capability_set_header(s, &header); Stream_Write_UINT32(s, 0); /* osType (4 bytes), ignored on receipt */ - Stream_Write_UINT32(s, - 0); /* osVersion (4 bytes), unused and must be set to zero */ - Stream_Write_UINT16(s, - context->priv->VersionMajor); /* protocolMajorVersion (2 bytes) */ - Stream_Write_UINT16(s, - context->priv->VersionMinor); /* protocolMinorVersion (2 bytes) */ - Stream_Write_UINT32(s, ioCode1); /* ioCode1 (4 bytes) */ - Stream_Write_UINT32(s, - 0); /* ioCode2 (4 bytes), must be set to zero, reserved for future use */ + Stream_Write_UINT32(s, 0); /* osVersion (4 bytes), unused and must be set to zero */ + Stream_Write_UINT16(s, context->priv->VersionMajor); /* protocolMajorVersion (2 bytes) */ + Stream_Write_UINT16(s, context->priv->VersionMinor); /* protocolMinorVersion (2 bytes) */ + Stream_Write_UINT32(s, ioCode1); /* ioCode1 (4 bytes) */ + Stream_Write_UINT32(s, 0); /* ioCode2 (4 bytes), must be set to zero, reserved for future use */ Stream_Write_UINT32(s, extendedPdu); /* extendedPdu (4 bytes) */ Stream_Write_UINT32(s, extraFlags1); /* extraFlags1 (4 bytes) */ - Stream_Write_UINT32(s, - 0); /* extraFlags2 (4 bytes), must be set to zero, reserved for future use */ - Stream_Write_UINT32(s, - SpecialTypeDeviceCap); /* SpecialTypeDeviceCap (4 bytes) */ + Stream_Write_UINT32( + s, 0); /* extraFlags2 (4 bytes), must be set to zero, reserved for future use */ + Stream_Write_UINT32(s, SpecialTypeDeviceCap); /* SpecialTypeDeviceCap (4 bytes) */ return CHANNEL_RC_OK; } @@ -388,8 +369,8 @@ static UINT rdpdr_server_write_general_capability_set(RdpdrServerContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_read_printer_capability_set(RdpdrServerContext* - context, wStream* s, RDPDR_CAPABILITY_HEADER* header) +static UINT rdpdr_server_read_printer_capability_set(RdpdrServerContext* context, wStream* s, + RDPDR_CAPABILITY_HEADER* header) { return CHANNEL_RC_OK; } @@ -399,8 +380,7 @@ static UINT rdpdr_server_read_printer_capability_set(RdpdrServerContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_write_printer_capability_set(RdpdrServerContext* - context, wStream* s) +static UINT rdpdr_server_write_printer_capability_set(RdpdrServerContext* context, wStream* s) { RDPDR_CAPABILITY_HEADER header; header.CapabilityType = CAP_PRINTER_TYPE; @@ -421,8 +401,8 @@ static UINT rdpdr_server_write_printer_capability_set(RdpdrServerContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_read_port_capability_set(RdpdrServerContext* context, - wStream* s, RDPDR_CAPABILITY_HEADER* header) +static UINT rdpdr_server_read_port_capability_set(RdpdrServerContext* context, wStream* s, + RDPDR_CAPABILITY_HEADER* header) { return CHANNEL_RC_OK; } @@ -432,8 +412,7 @@ static UINT rdpdr_server_read_port_capability_set(RdpdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_write_port_capability_set(RdpdrServerContext* context, - wStream* s) +static UINT rdpdr_server_write_port_capability_set(RdpdrServerContext* context, wStream* s) { RDPDR_CAPABILITY_HEADER header; header.CapabilityType = CAP_PORT_TYPE; @@ -454,8 +433,8 @@ static UINT rdpdr_server_write_port_capability_set(RdpdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_read_drive_capability_set(RdpdrServerContext* context, - wStream* s, RDPDR_CAPABILITY_HEADER* header) +static UINT rdpdr_server_read_drive_capability_set(RdpdrServerContext* context, wStream* s, + RDPDR_CAPABILITY_HEADER* header) { return CHANNEL_RC_OK; } @@ -465,8 +444,7 @@ static UINT rdpdr_server_read_drive_capability_set(RdpdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_write_drive_capability_set(RdpdrServerContext* context, - wStream* s) +static UINT rdpdr_server_write_drive_capability_set(RdpdrServerContext* context, wStream* s) { RDPDR_CAPABILITY_HEADER header; header.CapabilityType = CAP_DRIVE_TYPE; @@ -487,8 +465,8 @@ static UINT rdpdr_server_write_drive_capability_set(RdpdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_read_smartcard_capability_set(RdpdrServerContext* - context, wStream* s, RDPDR_CAPABILITY_HEADER* header) +static UINT rdpdr_server_read_smartcard_capability_set(RdpdrServerContext* context, wStream* s, + RDPDR_CAPABILITY_HEADER* header) { return CHANNEL_RC_OK; } @@ -498,8 +476,7 @@ static UINT rdpdr_server_read_smartcard_capability_set(RdpdrServerContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_write_smartcard_capability_set( - RdpdrServerContext* context, wStream* s) +static UINT rdpdr_server_write_smartcard_capability_set(RdpdrServerContext* context, wStream* s) { RDPDR_CAPABILITY_HEADER header; header.CapabilityType = CAP_SMARTCARD_TYPE; @@ -520,8 +497,7 @@ static UINT rdpdr_server_write_smartcard_capability_set( * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_send_core_capability_request(RdpdrServerContext* - context) +static UINT rdpdr_server_send_core_capability_request(RdpdrServerContext* context) { wStream* s; BOOL status; @@ -555,14 +531,14 @@ static UINT rdpdr_server_send_core_capability_request(RdpdrServerContext* } Stream_Write_UINT16(s, header.Component); /* Component (2 bytes) */ - Stream_Write_UINT16(s, header.PacketId); /* PacketId (2 bytes) */ - Stream_Write_UINT16(s, numCapabilities); /* numCapabilities (2 bytes) */ - Stream_Write_UINT16(s, 0); /* Padding (2 bytes) */ + Stream_Write_UINT16(s, header.PacketId); /* PacketId (2 bytes) */ + Stream_Write_UINT16(s, numCapabilities); /* numCapabilities (2 bytes) */ + Stream_Write_UINT16(s, 0); /* Padding (2 bytes) */ if ((error = rdpdr_server_write_general_capability_set(context, s))) { - WLog_ERR(TAG, - "rdpdr_server_write_general_capability_set failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpdr_server_write_general_capability_set failed with error %" PRIu32 "!", + error); goto out; } @@ -570,7 +546,7 @@ static UINT rdpdr_server_send_core_capability_request(RdpdrServerContext* { if ((error = rdpdr_server_write_drive_capability_set(context, s))) { - WLog_ERR(TAG, "rdpdr_server_write_drive_capability_set failed with error %"PRIu32"!", + WLog_ERR(TAG, "rdpdr_server_write_drive_capability_set failed with error %" PRIu32 "!", error); goto out; } @@ -580,7 +556,7 @@ static UINT rdpdr_server_send_core_capability_request(RdpdrServerContext* { if ((error = rdpdr_server_write_port_capability_set(context, s))) { - WLog_ERR(TAG, "rdpdr_server_write_port_capability_set failed with error %"PRIu32"!", + WLog_ERR(TAG, "rdpdr_server_write_port_capability_set failed with error %" PRIu32 "!", error); goto out; } @@ -591,7 +567,8 @@ static UINT rdpdr_server_send_core_capability_request(RdpdrServerContext* if ((error = rdpdr_server_write_printer_capability_set(context, s))) { WLog_ERR(TAG, - "rdpdr_server_write_printer_capability_set failed with error %"PRIu32"!", error); + "rdpdr_server_write_printer_capability_set failed with error %" PRIu32 "!", + error); goto out; } } @@ -601,15 +578,16 @@ static UINT rdpdr_server_send_core_capability_request(RdpdrServerContext* if ((error = rdpdr_server_write_smartcard_capability_set(context, s))) { WLog_ERR(TAG, - "rdpdr_server_write_printer_capability_set failed with error %"PRIu32"!", error); + "rdpdr_server_write_printer_capability_set failed with error %" PRIu32 "!", + error); goto out; } } Stream_SealLength(s); winpr_HexDump(TAG, WLOG_DEBUG, Stream_Buffer(s), Stream_Length(s)); - status = WTSVirtualChannelWrite(context->priv->ChannelHandle, - (PCHAR) Stream_Buffer(s), Stream_Length(s), &written); + status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s), + Stream_Length(s), &written); Stream_Free(s, TRUE); return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; out: @@ -622,8 +600,8 @@ out: * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_receive_core_capability_response( - RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) +static UINT rdpdr_server_receive_core_capability_response(RdpdrServerContext* context, wStream* s, + RDPDR_HEADER* header) { int i; UINT status; @@ -637,13 +615,13 @@ static UINT rdpdr_server_receive_core_capability_response( } Stream_Read_UINT16(s, numCapabilities); /* numCapabilities (2 bytes) */ - Stream_Seek_UINT16(s); /* Padding (2 bytes) */ + Stream_Seek_UINT16(s); /* Padding (2 bytes) */ for (i = 0; i < numCapabilities; i++) { if ((status = rdpdr_server_read_capability_set_header(s, &capabilityHeader))) { - WLog_ERR(TAG, "rdpdr_server_read_capability_set_header failed with error %"PRIu32"!", + WLog_ERR(TAG, "rdpdr_server_read_capability_set_header failed with error %" PRIu32 "!", status); return status; } @@ -651,10 +629,12 @@ static UINT rdpdr_server_receive_core_capability_response( switch (capabilityHeader.CapabilityType) { case CAP_GENERAL_TYPE: - if ((status = rdpdr_server_read_general_capability_set(context, s, - &capabilityHeader))) + if ((status = + rdpdr_server_read_general_capability_set(context, s, &capabilityHeader))) { - WLog_ERR(TAG, "rdpdr_server_read_general_capability_set failed with error %"PRIu32"!", + WLog_ERR(TAG, + "rdpdr_server_read_general_capability_set failed with error %" PRIu32 + "!", status); return status; } @@ -662,10 +642,12 @@ static UINT rdpdr_server_receive_core_capability_response( break; case CAP_PRINTER_TYPE: - if ((status = rdpdr_server_read_printer_capability_set(context, s, - &capabilityHeader))) + if ((status = + rdpdr_server_read_printer_capability_set(context, s, &capabilityHeader))) { - WLog_ERR(TAG, "rdpdr_server_read_printer_capability_set failed with error %"PRIu32"!", + WLog_ERR(TAG, + "rdpdr_server_read_printer_capability_set failed with error %" PRIu32 + "!", status); return status; } @@ -673,10 +655,10 @@ static UINT rdpdr_server_receive_core_capability_response( break; case CAP_PORT_TYPE: - if ((status = rdpdr_server_read_port_capability_set(context, s, - &capabilityHeader))) + if ((status = rdpdr_server_read_port_capability_set(context, s, &capabilityHeader))) { - WLog_ERR(TAG, "rdpdr_server_read_port_capability_set failed with error %"PRIu32"!", + WLog_ERR(TAG, + "rdpdr_server_read_port_capability_set failed with error %" PRIu32 "!", status); return status; } @@ -684,10 +666,12 @@ static UINT rdpdr_server_receive_core_capability_response( break; case CAP_DRIVE_TYPE: - if ((status = rdpdr_server_read_drive_capability_set(context, s, - &capabilityHeader))) + if ((status = + rdpdr_server_read_drive_capability_set(context, s, &capabilityHeader))) { - WLog_ERR(TAG, "rdpdr_server_read_drive_capability_set failed with error %"PRIu32"!", + WLog_ERR(TAG, + "rdpdr_server_read_drive_capability_set failed with error %" PRIu32 + "!", status); return status; } @@ -695,20 +679,22 @@ static UINT rdpdr_server_receive_core_capability_response( break; case CAP_SMARTCARD_TYPE: - if ((status = rdpdr_server_read_smartcard_capability_set(context, s, - &capabilityHeader))) + if ((status = + rdpdr_server_read_smartcard_capability_set(context, s, &capabilityHeader))) { WLog_ERR(TAG, - "rdpdr_server_read_smartcard_capability_set failed with error %"PRIu32"!", status); + "rdpdr_server_read_smartcard_capability_set failed with error %" PRIu32 + "!", + status); return status; } break; default: - WLog_DBG(TAG, "Unknown capabilityType %"PRIu16"", capabilityHeader.CapabilityType); - Stream_Seek(s, capabilityHeader.CapabilityLength - - RDPDR_CAPABILITY_HEADER_LENGTH); + WLog_DBG(TAG, "Unknown capabilityType %" PRIu16 "", + capabilityHeader.CapabilityType); + Stream_Seek(s, capabilityHeader.CapabilityLength - RDPDR_CAPABILITY_HEADER_LENGTH); return ERROR_INVALID_DATA; break; } @@ -739,17 +725,15 @@ static UINT rdpdr_server_send_client_id_confirm(RdpdrServerContext* context) return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT16(s, header.Component); /* Component (2 bytes) */ - Stream_Write_UINT16(s, header.PacketId); /* PacketId (2 bytes) */ - Stream_Write_UINT16(s, - context->priv->VersionMajor); /* VersionMajor (2 bytes) */ - Stream_Write_UINT16(s, - context->priv->VersionMinor); /* VersionMinor (2 bytes) */ - Stream_Write_UINT32(s, context->priv->ClientId); /* ClientId (4 bytes) */ + Stream_Write_UINT16(s, header.Component); /* Component (2 bytes) */ + Stream_Write_UINT16(s, header.PacketId); /* PacketId (2 bytes) */ + Stream_Write_UINT16(s, context->priv->VersionMajor); /* VersionMajor (2 bytes) */ + Stream_Write_UINT16(s, context->priv->VersionMinor); /* VersionMinor (2 bytes) */ + Stream_Write_UINT32(s, context->priv->ClientId); /* ClientId (4 bytes) */ Stream_SealLength(s); winpr_HexDump(TAG, WLOG_DEBUG, Stream_Buffer(s), Stream_Length(s)); - status = WTSVirtualChannelWrite(context->priv->ChannelHandle, - (PCHAR) Stream_Buffer(s), Stream_Length(s), &written); + status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s), + Stream_Length(s), &written); Stream_Free(s, TRUE); return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } @@ -759,8 +743,8 @@ static UINT rdpdr_server_send_client_id_confirm(RdpdrServerContext* context) * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_receive_device_list_announce_request( - RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) +static UINT rdpdr_server_receive_device_list_announce_request(RdpdrServerContext* context, + wStream* s, RDPDR_HEADER* header) { UINT32 i; UINT32 DeviceCount; @@ -776,7 +760,7 @@ static UINT rdpdr_server_receive_device_list_announce_request( } Stream_Read_UINT32(s, DeviceCount); /* DeviceCount (4 bytes) */ - WLog_DBG(TAG, "DeviceCount: %"PRIu32"", DeviceCount); + WLog_DBG(TAG, "DeviceCount: %" PRIu32 "", DeviceCount); for (i = 0; i < DeviceCount; i++) { @@ -788,9 +772,9 @@ static UINT rdpdr_server_receive_device_list_announce_request( return ERROR_INVALID_DATA; } - Stream_Read_UINT32(s, DeviceType); /* DeviceType (4 bytes) */ - Stream_Read_UINT32(s, DeviceId); /* DeviceId (4 bytes) */ - Stream_Read(s, PreferredDosName, 8); /* PreferredDosName (8 bytes) */ + Stream_Read_UINT32(s, DeviceType); /* DeviceType (4 bytes) */ + Stream_Read_UINT32(s, DeviceId); /* DeviceId (4 bytes) */ + Stream_Read(s, PreferredDosName, 8); /* PreferredDosName (8 bytes) */ Stream_Read_UINT32(s, DeviceDataLength); /* DeviceDataLength (4 bytes) */ if (Stream_GetRemainingLength(s) < DeviceDataLength) @@ -799,8 +783,8 @@ static UINT rdpdr_server_receive_device_list_announce_request( return ERROR_INVALID_DATA; } - WLog_DBG(TAG, "Device %d Name: %s Id: 0x%08"PRIX32" DataLength: %"PRIu32"", - i, PreferredDosName, DeviceId, DeviceDataLength); + WLog_DBG(TAG, "Device %d Name: %s Id: 0x%08" PRIX32 " DataLength: %" PRIu32 "", i, + PreferredDosName, DeviceId, DeviceDataLength); switch (DeviceType) { @@ -852,8 +836,8 @@ static UINT rdpdr_server_receive_device_list_announce_request( * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_receive_device_list_remove_request( - RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) +static UINT rdpdr_server_receive_device_list_remove_request(RdpdrServerContext* context, wStream* s, + RDPDR_HEADER* header) { UINT32 i; UINT32 DeviceCount; @@ -867,7 +851,7 @@ static UINT rdpdr_server_receive_device_list_remove_request( } Stream_Read_UINT32(s, DeviceCount); /* DeviceCount (4 bytes) */ - WLog_DBG(TAG, "DeviceCount: %"PRIu32"", DeviceCount); + WLog_DBG(TAG, "DeviceCount: %" PRIu32 "", DeviceCount); for (i = 0; i < DeviceCount; i++) { @@ -878,7 +862,7 @@ static UINT rdpdr_server_receive_device_list_remove_request( } Stream_Read_UINT32(s, DeviceId); /* DeviceId (4 bytes) */ - WLog_DBG(TAG, "Device %d Id: 0x%08"PRIX32"", i, DeviceId); + WLog_DBG(TAG, "Device %d Id: 0x%08" PRIX32 "", i, DeviceId); DeviceType = 0; /* TODO: Save the device type on the announce request. */ switch (DeviceType) @@ -929,8 +913,8 @@ static UINT rdpdr_server_receive_device_list_remove_request( * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_receive_device_io_completion(RdpdrServerContext* - context, wStream* s, RDPDR_HEADER* header) +static UINT rdpdr_server_receive_device_io_completion(RdpdrServerContext* context, wStream* s, + RDPDR_HEADER* header) { UINT32 deviceId; UINT32 completionId; @@ -947,13 +931,13 @@ static UINT rdpdr_server_receive_device_io_completion(RdpdrServerContext* Stream_Read_UINT32(s, deviceId); Stream_Read_UINT32(s, completionId); Stream_Read_UINT32(s, ioStatus); - WLog_DBG(TAG, "deviceId=%"PRIu32", completionId=0x%"PRIx32", ioStatus=0x%"PRIx32"", deviceId, - completionId, ioStatus); + WLog_DBG(TAG, "deviceId=%" PRIu32 ", completionId=0x%" PRIx32 ", ioStatus=0x%" PRIx32 "", + deviceId, completionId, ioStatus); irp = rdpdr_server_dequeue_irp(context, completionId); if (!irp) { - WLog_ERR(TAG, "IRP not found for completionId=0x%"PRIx32"", completionId); + WLog_ERR(TAG, "IRP not found for completionId=0x%" PRIx32 "", completionId); return ERROR_INTERNAL_ERROR; } @@ -989,11 +973,11 @@ static UINT rdpdr_server_send_user_logged_on(RdpdrServerContext* context) } Stream_Write_UINT16(s, header.Component); /* Component (2 bytes) */ - Stream_Write_UINT16(s, header.PacketId); /* PacketId (2 bytes) */ + Stream_Write_UINT16(s, header.PacketId); /* PacketId (2 bytes) */ Stream_SealLength(s); winpr_HexDump(TAG, WLOG_DEBUG, Stream_Buffer(s), Stream_Length(s)); - status = WTSVirtualChannelWrite(context->priv->ChannelHandle, - (PCHAR) Stream_Buffer(s), Stream_Length(s), &written); + status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s), + Stream_Length(s), &written); Stream_Free(s, TRUE); return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } @@ -1003,11 +987,10 @@ static UINT rdpdr_server_send_user_logged_on(RdpdrServerContext* context) * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, - RDPDR_HEADER* header) +static UINT rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) { UINT error = CHANNEL_RC_OK; - WLog_DBG(TAG, "RdpdrServerReceivePdu: Component: 0x%04"PRIX16" PacketId: 0x%04"PRIX16"", + WLog_DBG(TAG, "RdpdrServerReceivePdu: Component: 0x%04" PRIX16 " PacketId: 0x%04" PRIX16 "", header->Component, header->PacketId); winpr_HexDump(TAG, WLOG_DEBUG, Stream_Buffer(s), Stream_Length(s)); @@ -1018,7 +1001,9 @@ static UINT rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, case PAKID_CORE_CLIENTID_CONFIRM: if ((error = rdpdr_server_receive_announce_response(context, s, header))) { - WLog_ERR(TAG, "rdpdr_server_receive_announce_response failed with error %"PRIu32"!", + WLog_ERR(TAG, + "rdpdr_server_receive_announce_response failed with error %" PRIu32 + "!", error); return error; } @@ -1028,7 +1013,9 @@ static UINT rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, case PAKID_CORE_CLIENT_NAME: if ((error = rdpdr_server_receive_client_name_request(context, s, header))) { - WLog_ERR(TAG, "rdpdr_server_receive_client_name_request failed with error %"PRIu32"!", + WLog_ERR(TAG, + "rdpdr_server_receive_client_name_request failed with error %" PRIu32 + "!", error); return error; } @@ -1036,13 +1023,16 @@ static UINT rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, if ((error = rdpdr_server_send_core_capability_request(context))) { WLog_ERR(TAG, - "rdpdr_server_send_core_capability_request failed with error %"PRIu32"!", error); + "rdpdr_server_send_core_capability_request failed with error %" PRIu32 + "!", + error); return error; } if ((error = rdpdr_server_send_client_id_confirm(context))) { - WLog_ERR(TAG, "rdpdr_server_send_client_id_confirm failed with error %"PRIu32"!", + WLog_ERR(TAG, + "rdpdr_server_send_client_id_confirm failed with error %" PRIu32 "!", error); return error; } @@ -1052,26 +1042,31 @@ static UINT rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, case PAKID_CORE_CLIENT_CAPABILITY: if ((error = rdpdr_server_receive_core_capability_response(context, s, header))) { - WLog_ERR(TAG, - "rdpdr_server_receive_core_capability_response failed with error %"PRIu32"!", error); + WLog_ERR( + TAG, + "rdpdr_server_receive_core_capability_response failed with error %" PRIu32 + "!", + error); return error; } if (context->priv->UserLoggedOnPdu) if ((error = rdpdr_server_send_user_logged_on(context))) { - WLog_ERR(TAG, "rdpdr_server_send_user_logged_on failed with error %"PRIu32"!", error); + WLog_ERR(TAG, + "rdpdr_server_send_user_logged_on failed with error %" PRIu32 "!", + error); return error; } break; case PAKID_CORE_DEVICELIST_ANNOUNCE: - if ((error = rdpdr_server_receive_device_list_announce_request(context, s, - header))) + if ((error = rdpdr_server_receive_device_list_announce_request(context, s, header))) { WLog_ERR(TAG, - "rdpdr_server_receive_device_list_announce_request failed with error %"PRIu32"!", + "rdpdr_server_receive_device_list_announce_request failed with error " + "%" PRIu32 "!", error); return error; } @@ -1088,18 +1083,21 @@ static UINT rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, if ((error = rdpdr_server_receive_device_io_completion(context, s, header))) { WLog_ERR(TAG, - "rdpdr_server_receive_device_io_completion failed with error %"PRIu32"!", error); + "rdpdr_server_receive_device_io_completion failed with error %" PRIu32 + "!", + error); return error; } break; case PAKID_CORE_DEVICELIST_REMOVE: - if ((error = rdpdr_server_receive_device_list_remove_request(context, s, - header))) + if ((error = rdpdr_server_receive_device_list_remove_request(context, s, header))) { WLog_ERR(TAG, - "rdpdr_server_receive_device_io_completion failed with error %"PRIu32"!", error); + "rdpdr_server_receive_device_io_completion failed with error %" PRIu32 + "!", + error); return error; } @@ -1125,7 +1123,7 @@ static UINT rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, } else { - WLog_WARN(TAG, "Unknown RDPDR_HEADER.Component: 0x%04"PRIX16"", header->Component); + WLog_WARN(TAG, "Unknown RDPDR_HEADER.Component: 0x%04" PRIX16 "", header->Component); return ERROR_INVALID_DATA; } @@ -1144,7 +1142,7 @@ static DWORD WINAPI rdpdr_server_thread(LPVOID arg) DWORD BytesReturned; RdpdrServerContext* context; UINT error; - context = (RdpdrServerContext*) arg; + context = (RdpdrServerContext*)arg; buffer = NULL; BytesReturned = 0; ChannelEvent = NULL; @@ -1157,8 +1155,8 @@ static DWORD WINAPI rdpdr_server_thread(LPVOID arg) goto out; } - if (WTSVirtualChannelQuery(context->priv->ChannelHandle, WTSVirtualEventHandle, - &buffer, &BytesReturned) == TRUE) + if (WTSVirtualChannelQuery(context->priv->ChannelHandle, WTSVirtualEventHandle, &buffer, + &BytesReturned) == TRUE) { if (BytesReturned == sizeof(HANDLE)) CopyMemory(&ChannelEvent, buffer, sizeof(HANDLE)); @@ -1172,8 +1170,7 @@ static DWORD WINAPI rdpdr_server_thread(LPVOID arg) if ((error = rdpdr_server_send_announce_request(context))) { - WLog_ERR(TAG, "rdpdr_server_send_announce_request failed with error %"PRIu32"!", - error); + WLog_ERR(TAG, "rdpdr_server_send_announce_request failed with error %" PRIu32 "!", error); goto out_stream; } @@ -1185,7 +1182,7 @@ static DWORD WINAPI rdpdr_server_thread(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "!", error); goto out_stream; } @@ -1194,15 +1191,15 @@ static DWORD WINAPI rdpdr_server_thread(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); goto out_stream; } if (status == WAIT_OBJECT_0) break; - if (!WTSVirtualChannelRead(context->priv->ChannelHandle, 0, - (PCHAR) Stream_Buffer(s), Stream_Capacity(s), &BytesReturned)) + if (!WTSVirtualChannelRead(context->priv->ChannelHandle, 0, (PCHAR)Stream_Buffer(s), + Stream_Capacity(s), &BytesReturned)) { WLog_ERR(TAG, "WTSVirtualChannelRead failed!"); error = ERROR_INTERNAL_ERROR; @@ -1217,11 +1214,11 @@ static DWORD WINAPI rdpdr_server_thread(LPVOID arg) while (Stream_GetRemainingLength(s) >= RDPDR_HEADER_LENGTH) { Stream_Read_UINT16(s, header.Component); /* Component (2 bytes) */ - Stream_Read_UINT16(s, header.PacketId); /* PacketId (2 bytes) */ + Stream_Read_UINT16(s, header.PacketId); /* PacketId (2 bytes) */ if ((error = rdpdr_server_receive_pdu(context, s, &header))) { - WLog_ERR(TAG, "rdpdr_server_receive_pdu failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpdr_server_receive_pdu failed with error %" PRIu32 "!", error); goto out_stream; } } @@ -1233,8 +1230,7 @@ out_stream: out: if (error && context->rdpcontext) - setChannelError(context->rdpcontext, error, - "rdpdr_server_thread reported an error"); + setChannelError(context->rdpcontext, error, "rdpdr_server_thread reported an error"); ExitThread(error); return error; @@ -1247,8 +1243,8 @@ out: */ static UINT rdpdr_server_start(RdpdrServerContext* context) { - context->priv->ChannelHandle = WTSVirtualChannelOpen(context->vcm, - WTS_CURRENT_SESSION, "rdpdr"); + context->priv->ChannelHandle = + WTSVirtualChannelOpen(context->vcm, WTS_CURRENT_SESSION, "rdpdr"); if (!context->priv->ChannelHandle) { @@ -1262,8 +1258,8 @@ static UINT rdpdr_server_start(RdpdrServerContext* context) return ERROR_INTERNAL_ERROR; } - if (!(context->priv->Thread = CreateThread(NULL, 0, - rdpdr_server_thread, (void*) context, 0, NULL))) + if (!(context->priv->Thread = + CreateThread(NULL, 0, rdpdr_server_thread, (void*)context, 0, NULL))) { WLog_ERR(TAG, "CreateThread failed!"); CloseHandle(context->priv->StopEvent); @@ -1290,7 +1286,7 @@ static UINT rdpdr_server_stop(RdpdrServerContext* context) if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); return error; } @@ -1303,21 +1299,17 @@ static UINT rdpdr_server_stop(RdpdrServerContext* context) return CHANNEL_RC_OK; } -static void rdpdr_server_write_device_iorequest( - wStream* s, - UINT32 deviceId, - UINT32 fileId, - UINT32 completionId, - UINT32 majorFunction, - UINT32 minorFunction) +static void rdpdr_server_write_device_iorequest(wStream* s, UINT32 deviceId, UINT32 fileId, + UINT32 completionId, UINT32 majorFunction, + UINT32 minorFunction) { - Stream_Write_UINT16(s, RDPDR_CTYP_CORE); /* Component (2 bytes) */ + Stream_Write_UINT16(s, RDPDR_CTYP_CORE); /* Component (2 bytes) */ Stream_Write_UINT16(s, PAKID_CORE_DEVICE_IOREQUEST); /* PacketId (2 bytes) */ - Stream_Write_UINT32(s, deviceId); /* DeviceId (4 bytes) */ - Stream_Write_UINT32(s, fileId); /* FileId (4 bytes) */ - Stream_Write_UINT32(s, completionId); /* CompletionId (4 bytes) */ - Stream_Write_UINT32(s, majorFunction); /* MajorFunction (4 bytes) */ - Stream_Write_UINT32(s, minorFunction); /* MinorFunction (4 bytes) */ + Stream_Write_UINT32(s, deviceId); /* DeviceId (4 bytes) */ + Stream_Write_UINT32(s, fileId); /* FileId (4 bytes) */ + Stream_Write_UINT32(s, completionId); /* CompletionId (4 bytes) */ + Stream_Write_UINT32(s, majorFunction); /* MajorFunction (4 bytes) */ + Stream_Write_UINT32(s, minorFunction); /* MinorFunction (4 bytes) */ } /** @@ -1326,7 +1318,7 @@ static void rdpdr_server_write_device_iorequest( * @return 0 on success, otherwise a Win32 error code */ static UINT rdpdr_server_read_file_directory_information(wStream* s, - FILE_DIRECTORY_INFORMATION* fdi) + FILE_DIRECTORY_INFORMATION* fdi) { UINT32 fileNameLength; ZeroMemory(fdi, sizeof(FILE_DIRECTORY_INFORMATION)); @@ -1338,15 +1330,15 @@ static UINT rdpdr_server_read_file_directory_information(wStream* s, } Stream_Read_UINT32(s, fdi->NextEntryOffset); /* NextEntryOffset (4 bytes) */ - Stream_Read_UINT32(s, fdi->FileIndex); /* FileIndex (4 bytes) */ - Stream_Read_UINT64(s, fdi->CreationTime); /* CreationTime (8 bytes) */ - Stream_Read_UINT64(s, fdi->LastAccessTime); /* LastAccessTime (8 bytes) */ - Stream_Read_UINT64(s, fdi->LastWriteTime); /* LastWriteTime (8 bytes) */ - Stream_Read_UINT64(s, fdi->ChangeTime); /* ChangeTime (8 bytes) */ - Stream_Read_UINT64(s, fdi->EndOfFile); /* EndOfFile (8 bytes) */ - Stream_Read_UINT64(s, fdi->AllocationSize); /* AllocationSize (8 bytes) */ - Stream_Read_UINT32(s, fdi->FileAttributes); /* FileAttributes (4 bytes) */ - Stream_Read_UINT32(s, fileNameLength); /* FileNameLength (4 bytes) */ + Stream_Read_UINT32(s, fdi->FileIndex); /* FileIndex (4 bytes) */ + Stream_Read_UINT64(s, fdi->CreationTime); /* CreationTime (8 bytes) */ + Stream_Read_UINT64(s, fdi->LastAccessTime); /* LastAccessTime (8 bytes) */ + Stream_Read_UINT64(s, fdi->LastWriteTime); /* LastWriteTime (8 bytes) */ + Stream_Read_UINT64(s, fdi->ChangeTime); /* ChangeTime (8 bytes) */ + Stream_Read_UINT64(s, fdi->EndOfFile); /* EndOfFile (8 bytes) */ + Stream_Read_UINT64(s, fdi->AllocationSize); /* AllocationSize (8 bytes) */ + Stream_Read_UINT32(s, fdi->FileAttributes); /* FileAttributes (4 bytes) */ + Stream_Read_UINT32(s, fileNameLength); /* FileNameLength (4 bytes) */ if (Stream_GetRemainingLength(s) < fileNameLength) { @@ -1354,8 +1346,8 @@ static UINT rdpdr_server_read_file_directory_information(wStream* s, return ERROR_INVALID_DATA; } - WideCharToMultiByte(CP_ACP, 0, (LPCWSTR) Stream_Pointer(s), fileNameLength / 2, - fdi->FileName, sizeof(fdi->FileName), NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)Stream_Pointer(s), fileNameLength / 2, fdi->FileName, + sizeof(fdi->FileName), NULL, NULL); Stream_Seek(s, fileNameLength); return CHANNEL_RC_OK; } @@ -1365,21 +1357,19 @@ static UINT rdpdr_server_read_file_directory_information(wStream* s, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_send_device_create_request( - RdpdrServerContext* context, - UINT32 deviceId, - UINT32 completionId, - const char* path, - UINT32 desiredAccess, - UINT32 createOptions, - UINT32 createDisposition) +static UINT rdpdr_server_send_device_create_request(RdpdrServerContext* context, UINT32 deviceId, + UINT32 completionId, const char* path, + UINT32 desiredAccess, UINT32 createOptions, + UINT32 createDisposition) { UINT32 pathLength; ULONG written; BOOL status; wStream* s; WLog_DBG(TAG, - "RdpdrServerSendDeviceCreateRequest: deviceId=%"PRIu32", path=%s, desiredAccess=0x%"PRIx32" createOptions=0x%"PRIx32" createDisposition=0x%"PRIx32"", + "RdpdrServerSendDeviceCreateRequest: deviceId=%" PRIu32 + ", path=%s, desiredAccess=0x%" PRIx32 " createOptions=0x%" PRIx32 + " createDisposition=0x%" PRIx32 "", deviceId, path, desiredAccess, createOptions, createDisposition); /* Compute the required Unicode size. */ pathLength = (strlen(path) + 1) * sizeof(WCHAR); @@ -1391,23 +1381,21 @@ static UINT rdpdr_server_send_device_create_request( return CHANNEL_RC_NO_MEMORY; } - rdpdr_server_write_device_iorequest(s, deviceId, 0, completionId, IRP_MJ_CREATE, - 0); + rdpdr_server_write_device_iorequest(s, deviceId, 0, completionId, IRP_MJ_CREATE, 0); Stream_Write_UINT32(s, desiredAccess); /* DesiredAccess (4 bytes) */ - Stream_Write_UINT32(s, 0); /* AllocationSize (8 bytes) */ + Stream_Write_UINT32(s, 0); /* AllocationSize (8 bytes) */ Stream_Write_UINT32(s, 0); - Stream_Write_UINT32(s, 0); /* FileAttributes (4 bytes) */ - Stream_Write_UINT32(s, 3); /* SharedAccess (4 bytes) */ + Stream_Write_UINT32(s, 0); /* FileAttributes (4 bytes) */ + Stream_Write_UINT32(s, 3); /* SharedAccess (4 bytes) */ Stream_Write_UINT32(s, createDisposition); /* CreateDisposition (4 bytes) */ - Stream_Write_UINT32(s, createOptions); /* CreateOptions (4 bytes) */ - Stream_Write_UINT32(s, pathLength); /* PathLength (4 bytes) */ + Stream_Write_UINT32(s, createOptions); /* CreateOptions (4 bytes) */ + Stream_Write_UINT32(s, pathLength); /* PathLength (4 bytes) */ /* Convert the path to Unicode. */ - MultiByteToWideChar(CP_ACP, 0, path, -1, (LPWSTR) Stream_Pointer(s), - pathLength); + MultiByteToWideChar(CP_ACP, 0, path, -1, (LPWSTR)Stream_Pointer(s), pathLength); Stream_Seek(s, pathLength); Stream_SealLength(s); - status = WTSVirtualChannelWrite(context->priv->ChannelHandle, - (PCHAR) Stream_Buffer(s), Stream_Length(s), &written); + status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s), + Stream_Length(s), &written); Stream_Free(s, TRUE); return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } @@ -1417,16 +1405,13 @@ static UINT rdpdr_server_send_device_create_request( * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_send_device_close_request( - RdpdrServerContext* context, - UINT32 deviceId, - UINT32 fileId, - UINT32 completionId) +static UINT rdpdr_server_send_device_close_request(RdpdrServerContext* context, UINT32 deviceId, + UINT32 fileId, UINT32 completionId) { ULONG written; BOOL status; wStream* s; - WLog_DBG(TAG, "RdpdrServerSendDeviceCloseRequest: deviceId=%"PRIu32", fileId=%"PRIu32"", + WLog_DBG(TAG, "RdpdrServerSendDeviceCloseRequest: deviceId=%" PRIu32 ", fileId=%" PRIu32 "", deviceId, fileId); s = Stream_New(NULL, 128); @@ -1436,12 +1421,11 @@ static UINT rdpdr_server_send_device_close_request( return CHANNEL_RC_NO_MEMORY; } - rdpdr_server_write_device_iorequest(s, deviceId, fileId, completionId, - IRP_MJ_CLOSE, 0); + rdpdr_server_write_device_iorequest(s, deviceId, fileId, completionId, IRP_MJ_CLOSE, 0); Stream_Zero(s, 32); /* Padding (32 bytes) */ Stream_SealLength(s); - status = WTSVirtualChannelWrite(context->priv->ChannelHandle, - (PCHAR) Stream_Buffer(s), Stream_Length(s), &written); + status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s), + Stream_Length(s), &written); Stream_Free(s, TRUE); return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } @@ -1451,19 +1435,16 @@ static UINT rdpdr_server_send_device_close_request( * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_send_device_read_request( - RdpdrServerContext* context, - UINT32 deviceId, - UINT32 fileId, - UINT32 completionId, - UINT32 length, - UINT32 offset) +static UINT rdpdr_server_send_device_read_request(RdpdrServerContext* context, UINT32 deviceId, + UINT32 fileId, UINT32 completionId, UINT32 length, + UINT32 offset) { ULONG written; BOOL status; wStream* s; WLog_DBG(TAG, - "RdpdrServerSendDeviceReadRequest: deviceId=%"PRIu32", fileId=%"PRIu32", length=%"PRIu32", offset=%"PRIu32"", + "RdpdrServerSendDeviceReadRequest: deviceId=%" PRIu32 ", fileId=%" PRIu32 + ", length=%" PRIu32 ", offset=%" PRIu32 "", deviceId, fileId, length, offset); s = Stream_New(NULL, 128); @@ -1473,15 +1454,14 @@ static UINT rdpdr_server_send_device_read_request( return CHANNEL_RC_NO_MEMORY; } - rdpdr_server_write_device_iorequest(s, deviceId, fileId, completionId, - IRP_MJ_READ, 0); + rdpdr_server_write_device_iorequest(s, deviceId, fileId, completionId, IRP_MJ_READ, 0); Stream_Write_UINT32(s, length); /* Length (4 bytes) */ Stream_Write_UINT32(s, offset); /* Offset (8 bytes) */ Stream_Write_UINT32(s, 0); Stream_Zero(s, 20); /* Padding (20 bytes) */ Stream_SealLength(s); - status = WTSVirtualChannelWrite(context->priv->ChannelHandle, - (PCHAR) Stream_Buffer(s), Stream_Length(s), &written); + status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s), + Stream_Length(s), &written); Stream_Free(s, TRUE); return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } @@ -1491,20 +1471,16 @@ static UINT rdpdr_server_send_device_read_request( * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_send_device_write_request( - RdpdrServerContext* context, - UINT32 deviceId, - UINT32 fileId, - UINT32 completionId, - const char* data, - UINT32 length, - UINT32 offset) +static UINT rdpdr_server_send_device_write_request(RdpdrServerContext* context, UINT32 deviceId, + UINT32 fileId, UINT32 completionId, + const char* data, UINT32 length, UINT32 offset) { ULONG written; BOOL status; wStream* s; WLog_DBG(TAG, - "RdpdrServerSendDeviceWriteRequest: deviceId=%"PRIu32", fileId=%"PRIu32", length=%"PRIu32", offset=%"PRIu32"", + "RdpdrServerSendDeviceWriteRequest: deviceId=%" PRIu32 ", fileId=%" PRIu32 + ", length=%" PRIu32 ", offset=%" PRIu32 "", deviceId, fileId, length, offset); s = Stream_New(NULL, 64 + length); @@ -1514,16 +1490,15 @@ static UINT rdpdr_server_send_device_write_request( return CHANNEL_RC_NO_MEMORY; } - rdpdr_server_write_device_iorequest(s, deviceId, fileId, completionId, - IRP_MJ_WRITE, 0); + rdpdr_server_write_device_iorequest(s, deviceId, fileId, completionId, IRP_MJ_WRITE, 0); Stream_Write_UINT32(s, length); /* Length (4 bytes) */ Stream_Write_UINT32(s, offset); /* Offset (8 bytes) */ Stream_Write_UINT32(s, 0); - Stream_Zero(s, 20); /* Padding (20 bytes) */ + Stream_Zero(s, 20); /* Padding (20 bytes) */ Stream_Write(s, data, length); /* WriteData (variable) */ Stream_SealLength(s); - status = WTSVirtualChannelWrite(context->priv->ChannelHandle, - (PCHAR) Stream_Buffer(s), Stream_Length(s), &written); + status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s), + Stream_Length(s), &written); Stream_Free(s, TRUE); return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } @@ -1533,19 +1508,17 @@ static UINT rdpdr_server_send_device_write_request( * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_send_device_query_directory_request( - RdpdrServerContext* context, - UINT32 deviceId, - UINT32 fileId, - UINT32 completionId, - const char* path) +static UINT rdpdr_server_send_device_query_directory_request(RdpdrServerContext* context, + UINT32 deviceId, UINT32 fileId, + UINT32 completionId, const char* path) { UINT32 pathLength; ULONG written; BOOL status; wStream* s; WLog_DBG(TAG, - "RdpdrServerSendDeviceQueryDirectoryRequest: deviceId=%"PRIu32", fileId=%"PRIu32", path=%s", + "RdpdrServerSendDeviceQueryDirectoryRequest: deviceId=%" PRIu32 ", fileId=%" PRIu32 + ", path=%s", deviceId, fileId, path); /* Compute the required Unicode size. */ pathLength = path ? (strlen(path) + 1) * sizeof(WCHAR) : 0; @@ -1557,25 +1530,23 @@ static UINT rdpdr_server_send_device_query_directory_request( return CHANNEL_RC_NO_MEMORY; } - rdpdr_server_write_device_iorequest(s, deviceId, fileId, completionId, - IRP_MJ_DIRECTORY_CONTROL, IRP_MN_QUERY_DIRECTORY); - Stream_Write_UINT32(s, - FileDirectoryInformation); /* FsInformationClass (4 bytes) */ - Stream_Write_UINT8(s, path ? 1 : 0); /* InitialQuery (1 byte) */ - Stream_Write_UINT32(s, pathLength); /* PathLength (4 bytes) */ - Stream_Zero(s, 23); /* Padding (23 bytes) */ + rdpdr_server_write_device_iorequest(s, deviceId, fileId, completionId, IRP_MJ_DIRECTORY_CONTROL, + IRP_MN_QUERY_DIRECTORY); + Stream_Write_UINT32(s, FileDirectoryInformation); /* FsInformationClass (4 bytes) */ + Stream_Write_UINT8(s, path ? 1 : 0); /* InitialQuery (1 byte) */ + Stream_Write_UINT32(s, pathLength); /* PathLength (4 bytes) */ + Stream_Zero(s, 23); /* Padding (23 bytes) */ /* Convert the path to Unicode. */ if (pathLength > 0) { - MultiByteToWideChar(CP_ACP, 0, path, -1, (LPWSTR) Stream_Pointer(s), - pathLength); + MultiByteToWideChar(CP_ACP, 0, path, -1, (LPWSTR)Stream_Pointer(s), pathLength); Stream_Seek(s, pathLength); } Stream_SealLength(s); - status = WTSVirtualChannelWrite(context->priv->ChannelHandle, - (PCHAR) Stream_Buffer(s), Stream_Length(s), &written); + status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s), + Stream_Length(s), &written); Stream_Free(s, TRUE); return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } @@ -1585,19 +1556,17 @@ static UINT rdpdr_server_send_device_query_directory_request( * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_send_device_file_rename_request( - RdpdrServerContext* context, - UINT32 deviceId, - UINT32 fileId, - UINT32 completionId, - const char* path) +static UINT rdpdr_server_send_device_file_rename_request(RdpdrServerContext* context, + UINT32 deviceId, UINT32 fileId, + UINT32 completionId, const char* path) { UINT32 pathLength; ULONG written; BOOL status; wStream* s; WLog_DBG(TAG, - "RdpdrServerSendDeviceFileNameRequest: deviceId=%"PRIu32", fileId=%"PRIu32", path=%s", + "RdpdrServerSendDeviceFileNameRequest: deviceId=%" PRIu32 ", fileId=%" PRIu32 + ", path=%s", deviceId, fileId, path); /* Compute the required Unicode size. */ pathLength = path ? (strlen(path) + 1) * sizeof(WCHAR) : 0; @@ -1609,28 +1578,26 @@ static UINT rdpdr_server_send_device_file_rename_request( return CHANNEL_RC_NO_MEMORY; } - rdpdr_server_write_device_iorequest(s, deviceId, fileId, completionId, - IRP_MJ_SET_INFORMATION, 0); - Stream_Write_UINT32(s, - FileRenameInformation); /* FsInformationClass (4 bytes) */ - Stream_Write_UINT32(s, pathLength + 6); /* Length (4 bytes) */ - Stream_Zero(s, 24); /* Padding (24 bytes) */ + rdpdr_server_write_device_iorequest(s, deviceId, fileId, completionId, IRP_MJ_SET_INFORMATION, + 0); + Stream_Write_UINT32(s, FileRenameInformation); /* FsInformationClass (4 bytes) */ + Stream_Write_UINT32(s, pathLength + 6); /* Length (4 bytes) */ + Stream_Zero(s, 24); /* Padding (24 bytes) */ /* RDP_FILE_RENAME_INFORMATION */ - Stream_Write_UINT8(s, 0); /* ReplaceIfExists (1 byte) */ - Stream_Write_UINT8(s, 0); /* RootDirectory (1 byte) */ + Stream_Write_UINT8(s, 0); /* ReplaceIfExists (1 byte) */ + Stream_Write_UINT8(s, 0); /* RootDirectory (1 byte) */ Stream_Write_UINT32(s, pathLength); /* FileNameLength (4 bytes) */ /* Convert the path to Unicode. */ if (pathLength > 0) { - MultiByteToWideChar(CP_ACP, 0, path, -1, (LPWSTR) Stream_Pointer(s), - pathLength); + MultiByteToWideChar(CP_ACP, 0, path, -1, (LPWSTR)Stream_Pointer(s), pathLength); Stream_Seek(s, pathLength); } Stream_SealLength(s); - status = WTSVirtualChannelWrite(context->priv->ChannelHandle, - (PCHAR) Stream_Buffer(s), Stream_Length(s), &written); + status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s), + Stream_Length(s), &written); Stream_Free(s, TRUE); return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } @@ -1655,12 +1622,13 @@ static void rdpdr_server_convert_slashes(char* path, int size) * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_create_directory_callback2( - RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, - UINT32 completionId, UINT32 ioStatus) +static UINT rdpdr_server_drive_create_directory_callback2(RdpdrServerContext* context, wStream* s, + RDPDR_IRP* irp, UINT32 deviceId, + UINT32 completionId, UINT32 ioStatus) { WLog_DBG(TAG, - "RdpdrServerDriveCreateDirectoryCallback2: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", + "RdpdrServerDriveCreateDirectoryCallback2: deviceId=%" PRIu32 ", completionId=%" PRIu32 + ", ioStatus=0x%" PRIx32 "", deviceId, completionId, ioStatus); /* Invoke the create directory completion routine. */ context->OnDriveCreateDirectoryComplete(context, irp->CallbackData, ioStatus); @@ -1674,14 +1642,15 @@ static UINT rdpdr_server_drive_create_directory_callback2( * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_create_directory_callback1( - RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, - UINT32 completionId, UINT32 ioStatus) +static UINT rdpdr_server_drive_create_directory_callback1(RdpdrServerContext* context, wStream* s, + RDPDR_IRP* irp, UINT32 deviceId, + UINT32 completionId, UINT32 ioStatus) { UINT32 fileId; UINT8 information; WLog_DBG(TAG, - "RdpdrServerDriveCreateDirectoryCallback1: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", + "RdpdrServerDriveCreateDirectoryCallback1: deviceId=%" PRIu32 ", completionId=%" PRIu32 + ", ioStatus=0x%" PRIx32 "", deviceId, completionId, ioStatus); if (ioStatus != STATUS_SUCCESS) @@ -1699,7 +1668,7 @@ static UINT rdpdr_server_drive_create_directory_callback1( return ERROR_INVALID_DATA; } - Stream_Read_UINT32(s, fileId); /* FileId (4 bytes) */ + Stream_Read_UINT32(s, fileId); /* FileId (4 bytes) */ Stream_Read_UINT8(s, information); /* Information (1 byte) */ /* Setup the IRP. */ irp->CompletionId = context->priv->NextCompletionId++; @@ -1715,8 +1684,7 @@ static UINT rdpdr_server_drive_create_directory_callback1( } /* Send a request to close the file */ - return rdpdr_server_send_device_close_request(context, deviceId, fileId, - irp->CompletionId); + return rdpdr_server_send_device_close_request(context, deviceId, fileId, irp->CompletionId); } /** @@ -1724,8 +1692,8 @@ static UINT rdpdr_server_drive_create_directory_callback1( * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_create_directory(RdpdrServerContext* context, - void* callbackData, UINT32 deviceId, const char* path) +static UINT rdpdr_server_drive_create_directory(RdpdrServerContext* context, void* callbackData, + UINT32 deviceId, const char* path) { RDPDR_IRP* irp; irp = rdpdr_server_irp_new(); @@ -1751,10 +1719,9 @@ static UINT rdpdr_server_drive_create_directory(RdpdrServerContext* context, } /* Send a request to open the file. */ - return rdpdr_server_send_device_create_request(context, deviceId, - irp->CompletionId, irp->PathName, - FILE_READ_DATA | SYNCHRONIZE, - FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT, FILE_CREATE); + return rdpdr_server_send_device_create_request( + context, deviceId, irp->CompletionId, irp->PathName, FILE_READ_DATA | SYNCHRONIZE, + FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT, FILE_CREATE); } /************************************************* @@ -1766,12 +1733,13 @@ static UINT rdpdr_server_drive_create_directory(RdpdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_delete_directory_callback2( - RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, - UINT32 completionId, UINT32 ioStatus) +static UINT rdpdr_server_drive_delete_directory_callback2(RdpdrServerContext* context, wStream* s, + RDPDR_IRP* irp, UINT32 deviceId, + UINT32 completionId, UINT32 ioStatus) { WLog_DBG(TAG, - "RdpdrServerDriveDeleteDirectoryCallback2: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", + "RdpdrServerDriveDeleteDirectoryCallback2: deviceId=%" PRIu32 ", completionId=%" PRIu32 + ", ioStatus=0x%" PRIx32 "", deviceId, completionId, ioStatus); /* Invoke the delete directory completion routine. */ context->OnDriveDeleteDirectoryComplete(context, irp->CallbackData, ioStatus); @@ -1785,14 +1753,15 @@ static UINT rdpdr_server_drive_delete_directory_callback2( * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_delete_directory_callback1( - RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, - UINT32 completionId, UINT32 ioStatus) +static UINT rdpdr_server_drive_delete_directory_callback1(RdpdrServerContext* context, wStream* s, + RDPDR_IRP* irp, UINT32 deviceId, + UINT32 completionId, UINT32 ioStatus) { UINT32 fileId; UINT8 information; WLog_DBG(TAG, - "RdpdrServerDriveDeleteDirectoryCallback1: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", + "RdpdrServerDriveDeleteDirectoryCallback1: deviceId=%" PRIu32 ", completionId=%" PRIu32 + ", ioStatus=0x%" PRIx32 "", deviceId, completionId, ioStatus); if (ioStatus != STATUS_SUCCESS) @@ -1810,7 +1779,7 @@ static UINT rdpdr_server_drive_delete_directory_callback1( return ERROR_INVALID_DATA; } - Stream_Read_UINT32(s, fileId); /* FileId (4 bytes) */ + Stream_Read_UINT32(s, fileId); /* FileId (4 bytes) */ Stream_Read_UINT8(s, information); /* Information (1 byte) */ /* Setup the IRP. */ irp->CompletionId = context->priv->NextCompletionId++; @@ -1826,8 +1795,7 @@ static UINT rdpdr_server_drive_delete_directory_callback1( } /* Send a request to close the file */ - return rdpdr_server_send_device_close_request(context, deviceId, fileId, - irp->CompletionId); + return rdpdr_server_send_device_close_request(context, deviceId, fileId, irp->CompletionId); } /** @@ -1835,8 +1803,8 @@ static UINT rdpdr_server_drive_delete_directory_callback1( * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_delete_directory(RdpdrServerContext* context, - void* callbackData, UINT32 deviceId, const char* path) +static UINT rdpdr_server_drive_delete_directory(RdpdrServerContext* context, void* callbackData, + UINT32 deviceId, const char* path) { RDPDR_IRP* irp; irp = rdpdr_server_irp_new(); @@ -1862,10 +1830,9 @@ static UINT rdpdr_server_drive_delete_directory(RdpdrServerContext* context, } /* Send a request to open the file. */ - return rdpdr_server_send_device_create_request(context, deviceId, - irp->CompletionId, irp->PathName, - DELETE | SYNCHRONIZE, FILE_DIRECTORY_FILE | FILE_DELETE_ON_CLOSE | - FILE_SYNCHRONOUS_IO_NONALERT, FILE_OPEN); + return rdpdr_server_send_device_create_request( + context, deviceId, irp->CompletionId, irp->PathName, DELETE | SYNCHRONIZE, + FILE_DIRECTORY_FILE | FILE_DELETE_ON_CLOSE | FILE_SYNCHRONOUS_IO_NONALERT, FILE_OPEN); } /************************************************* @@ -1877,15 +1844,16 @@ static UINT rdpdr_server_drive_delete_directory(RdpdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_query_directory_callback2( - RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, - UINT32 completionId, UINT32 ioStatus) +static UINT rdpdr_server_drive_query_directory_callback2(RdpdrServerContext* context, wStream* s, + RDPDR_IRP* irp, UINT32 deviceId, + UINT32 completionId, UINT32 ioStatus) { UINT error; UINT32 length; FILE_DIRECTORY_INFORMATION fdi; WLog_DBG(TAG, - "RdpdrServerDriveQueryDirectoryCallback2: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", + "RdpdrServerDriveQueryDirectoryCallback2: deviceId=%" PRIu32 ", completionId=%" PRIu32 + ", ioStatus=0x%" PRIx32 "", deviceId, completionId, ioStatus); if (Stream_GetRemainingLength(s) < 4) @@ -1901,7 +1869,8 @@ static UINT rdpdr_server_drive_query_directory_callback2( if ((error = rdpdr_server_read_file_directory_information(s, &fdi))) { WLog_ERR(TAG, - "rdpdr_server_read_file_directory_information failed with error %"PRIu32"!", error); + "rdpdr_server_read_file_directory_information failed with error %" PRIu32 "!", + error); return error; } } @@ -1933,14 +1902,13 @@ static UINT rdpdr_server_drive_query_directory_callback2( } /* Send a request to query the directory. */ - return rdpdr_server_send_device_query_directory_request(context, irp->DeviceId, - irp->FileId, irp->CompletionId, NULL); + return rdpdr_server_send_device_query_directory_request(context, irp->DeviceId, irp->FileId, + irp->CompletionId, NULL); } else { /* Invoke the query directory completion routine. */ - context->OnDriveQueryDirectoryComplete(context, irp->CallbackData, ioStatus, - NULL); + context->OnDriveQueryDirectoryComplete(context, irp->CallbackData, ioStatus, NULL); /* Destroy the IRP. */ rdpdr_server_irp_free(irp); } @@ -1953,20 +1921,20 @@ static UINT rdpdr_server_drive_query_directory_callback2( * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_query_directory_callback1( - RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, - UINT32 completionId, UINT32 ioStatus) +static UINT rdpdr_server_drive_query_directory_callback1(RdpdrServerContext* context, wStream* s, + RDPDR_IRP* irp, UINT32 deviceId, + UINT32 completionId, UINT32 ioStatus) { UINT32 fileId; WLog_DBG(TAG, - "RdpdrServerDriveQueryDirectoryCallback1: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", + "RdpdrServerDriveQueryDirectoryCallback1: deviceId=%" PRIu32 ", completionId=%" PRIu32 + ", ioStatus=0x%" PRIx32 "", deviceId, completionId, ioStatus); if (ioStatus != STATUS_SUCCESS) { /* Invoke the query directory completion routine. */ - context->OnDriveQueryDirectoryComplete(context, irp->CallbackData, ioStatus, - NULL); + context->OnDriveQueryDirectoryComplete(context, irp->CallbackData, ioStatus, NULL); /* Destroy the IRP. */ rdpdr_server_irp_free(irp); return CHANNEL_RC_OK; @@ -1994,8 +1962,8 @@ static UINT rdpdr_server_drive_query_directory_callback1( } /* Send a request to query the directory. */ - return rdpdr_server_send_device_query_directory_request(context, deviceId, - fileId, irp->CompletionId, irp->PathName); + return rdpdr_server_send_device_query_directory_request(context, deviceId, fileId, + irp->CompletionId, irp->PathName); } /** @@ -2003,8 +1971,8 @@ static UINT rdpdr_server_drive_query_directory_callback1( * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_query_directory(RdpdrServerContext* context, - void* callbackData, UINT32 deviceId, const char* path) +static UINT rdpdr_server_drive_query_directory(RdpdrServerContext* context, void* callbackData, + UINT32 deviceId, const char* path) { RDPDR_IRP* irp; irp = rdpdr_server_irp_new(); @@ -2030,10 +1998,9 @@ static UINT rdpdr_server_drive_query_directory(RdpdrServerContext* context, } /* Send a request to open the directory. */ - return rdpdr_server_send_device_create_request(context, deviceId, - irp->CompletionId, irp->PathName, - FILE_READ_DATA | SYNCHRONIZE, - FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT, FILE_OPEN); + return rdpdr_server_send_device_create_request( + context, deviceId, irp->CompletionId, irp->PathName, FILE_READ_DATA | SYNCHRONIZE, + FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT, FILE_OPEN); } /************************************************* @@ -2045,14 +2012,15 @@ static UINT rdpdr_server_drive_query_directory(RdpdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_open_file_callback(RdpdrServerContext* context, - wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, - UINT32 ioStatus) +static UINT rdpdr_server_drive_open_file_callback(RdpdrServerContext* context, wStream* s, + RDPDR_IRP* irp, UINT32 deviceId, + UINT32 completionId, UINT32 ioStatus) { UINT32 fileId; UINT8 information; WLog_DBG(TAG, - "RdpdrServerDriveOpenFileCallback: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", + "RdpdrServerDriveOpenFileCallback: deviceId=%" PRIu32 ", completionId=%" PRIu32 + ", ioStatus=0x%" PRIx32 "", deviceId, completionId, ioStatus); if (Stream_GetRemainingLength(s) < 5) @@ -2061,11 +2029,10 @@ static UINT rdpdr_server_drive_open_file_callback(RdpdrServerContext* context, return ERROR_INVALID_DATA; } - Stream_Read_UINT32(s, fileId); /* FileId (4 bytes) */ + Stream_Read_UINT32(s, fileId); /* FileId (4 bytes) */ Stream_Read_UINT8(s, information); /* Information (1 byte) */ /* Invoke the open file completion routine. */ - context->OnDriveOpenFileComplete(context, irp->CallbackData, ioStatus, deviceId, - fileId); + context->OnDriveOpenFileComplete(context, irp->CallbackData, ioStatus, deviceId, fileId); /* Destroy the IRP. */ rdpdr_server_irp_free(irp); return CHANNEL_RC_OK; @@ -2076,9 +2043,9 @@ static UINT rdpdr_server_drive_open_file_callback(RdpdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_open_file(RdpdrServerContext* context, - void* callbackData, UINT32 deviceId, const char* path, UINT32 desiredAccess, - UINT32 createDisposition) +static UINT rdpdr_server_drive_open_file(RdpdrServerContext* context, void* callbackData, + UINT32 deviceId, const char* path, UINT32 desiredAccess, + UINT32 createDisposition) { RDPDR_IRP* irp; irp = rdpdr_server_irp_new(); @@ -2104,9 +2071,9 @@ static UINT rdpdr_server_drive_open_file(RdpdrServerContext* context, } /* Send a request to open the file. */ - return rdpdr_server_send_device_create_request(context, deviceId, - irp->CompletionId, irp->PathName, - desiredAccess | SYNCHRONIZE, FILE_SYNCHRONOUS_IO_NONALERT, createDisposition); + return rdpdr_server_send_device_create_request(context, deviceId, irp->CompletionId, + irp->PathName, desiredAccess | SYNCHRONIZE, + FILE_SYNCHRONOUS_IO_NONALERT, createDisposition); } /************************************************* @@ -2118,14 +2085,15 @@ static UINT rdpdr_server_drive_open_file(RdpdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_read_file_callback(RdpdrServerContext* context, - wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, - UINT32 ioStatus) +static UINT rdpdr_server_drive_read_file_callback(RdpdrServerContext* context, wStream* s, + RDPDR_IRP* irp, UINT32 deviceId, + UINT32 completionId, UINT32 ioStatus) { UINT32 length; char* buffer = NULL; WLog_DBG(TAG, - "RdpdrServerDriveReadFileCallback: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", + "RdpdrServerDriveReadFileCallback: deviceId=%" PRIu32 ", completionId=%" PRIu32 + ", ioStatus=0x%" PRIx32 "", deviceId, completionId, ioStatus); if (Stream_GetRemainingLength(s) < 4) @@ -2144,13 +2112,12 @@ static UINT rdpdr_server_drive_read_file_callback(RdpdrServerContext* context, if (length > 0) { - buffer = (char*) Stream_Pointer(s); + buffer = (char*)Stream_Pointer(s); Stream_Seek(s, length); } /* Invoke the read file completion routine. */ - context->OnDriveReadFileComplete(context, irp->CallbackData, ioStatus, buffer, - length); + context->OnDriveReadFileComplete(context, irp->CallbackData, ioStatus, buffer, length); /* Destroy the IRP. */ rdpdr_server_irp_free(irp); return CHANNEL_RC_OK; @@ -2161,9 +2128,9 @@ static UINT rdpdr_server_drive_read_file_callback(RdpdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_read_file(RdpdrServerContext* context, - void* callbackData, UINT32 deviceId, UINT32 fileId, UINT32 length, - UINT32 offset) +static UINT rdpdr_server_drive_read_file(RdpdrServerContext* context, void* callbackData, + UINT32 deviceId, UINT32 fileId, UINT32 length, + UINT32 offset) { RDPDR_IRP* irp; irp = rdpdr_server_irp_new(); @@ -2188,8 +2155,8 @@ static UINT rdpdr_server_drive_read_file(RdpdrServerContext* context, } /* Send a request to open the directory. */ - return rdpdr_server_send_device_read_request(context, deviceId, fileId, - irp->CompletionId, length, offset); + return rdpdr_server_send_device_read_request(context, deviceId, fileId, irp->CompletionId, + length, offset); } /************************************************* @@ -2201,13 +2168,14 @@ static UINT rdpdr_server_drive_read_file(RdpdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_write_file_callback(RdpdrServerContext* context, - wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, - UINT32 ioStatus) +static UINT rdpdr_server_drive_write_file_callback(RdpdrServerContext* context, wStream* s, + RDPDR_IRP* irp, UINT32 deviceId, + UINT32 completionId, UINT32 ioStatus) { UINT32 length; WLog_DBG(TAG, - "RdpdrServerDriveWriteFileCallback: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", + "RdpdrServerDriveWriteFileCallback: deviceId=%" PRIu32 ", completionId=%" PRIu32 + ", ioStatus=0x%" PRIx32 "", deviceId, completionId, ioStatus); if (Stream_GetRemainingLength(s) < 5) @@ -2217,7 +2185,7 @@ static UINT rdpdr_server_drive_write_file_callback(RdpdrServerContext* context, } Stream_Read_UINT32(s, length); /* Length (4 bytes) */ - Stream_Seek(s, 1); /* Padding (1 byte) */ + Stream_Seek(s, 1); /* Padding (1 byte) */ if (Stream_GetRemainingLength(s) < length) { @@ -2237,9 +2205,9 @@ static UINT rdpdr_server_drive_write_file_callback(RdpdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_write_file(RdpdrServerContext* context, - void* callbackData, UINT32 deviceId, UINT32 fileId, const char* buffer, - UINT32 length, UINT32 offset) +static UINT rdpdr_server_drive_write_file(RdpdrServerContext* context, void* callbackData, + UINT32 deviceId, UINT32 fileId, const char* buffer, + UINT32 length, UINT32 offset) { RDPDR_IRP* irp; irp = rdpdr_server_irp_new(); @@ -2264,8 +2232,8 @@ static UINT rdpdr_server_drive_write_file(RdpdrServerContext* context, } /* Send a request to open the directory. */ - return rdpdr_server_send_device_write_request(context, deviceId, fileId, - irp->CompletionId, buffer, length, offset); + return rdpdr_server_send_device_write_request(context, deviceId, fileId, irp->CompletionId, + buffer, length, offset); } /************************************************* @@ -2277,12 +2245,13 @@ static UINT rdpdr_server_drive_write_file(RdpdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_close_file_callback(RdpdrServerContext* context, - wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, - UINT32 ioStatus) +static UINT rdpdr_server_drive_close_file_callback(RdpdrServerContext* context, wStream* s, + RDPDR_IRP* irp, UINT32 deviceId, + UINT32 completionId, UINT32 ioStatus) { WLog_DBG(TAG, - "RdpdrServerDriveCloseFileCallback: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", + "RdpdrServerDriveCloseFileCallback: deviceId=%" PRIu32 ", completionId=%" PRIu32 + ", ioStatus=0x%" PRIx32 "", deviceId, completionId, ioStatus); /* Invoke the close file completion routine. */ context->OnDriveCloseFileComplete(context, irp->CallbackData, ioStatus); @@ -2296,8 +2265,8 @@ static UINT rdpdr_server_drive_close_file_callback(RdpdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_close_file(RdpdrServerContext* context, - void* callbackData, UINT32 deviceId, UINT32 fileId) +static UINT rdpdr_server_drive_close_file(RdpdrServerContext* context, void* callbackData, + UINT32 deviceId, UINT32 fileId) { RDPDR_IRP* irp; irp = rdpdr_server_irp_new(); @@ -2322,8 +2291,7 @@ static UINT rdpdr_server_drive_close_file(RdpdrServerContext* context, } /* Send a request to open the directory. */ - return rdpdr_server_send_device_close_request(context, deviceId, fileId, - irp->CompletionId); + return rdpdr_server_send_device_close_request(context, deviceId, fileId, irp->CompletionId); } /************************************************* @@ -2335,12 +2303,13 @@ static UINT rdpdr_server_drive_close_file(RdpdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_delete_file_callback2(RdpdrServerContext* - context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, - UINT32 ioStatus) +static UINT rdpdr_server_drive_delete_file_callback2(RdpdrServerContext* context, wStream* s, + RDPDR_IRP* irp, UINT32 deviceId, + UINT32 completionId, UINT32 ioStatus) { WLog_DBG(TAG, - "RdpdrServerDriveDeleteFileCallback2: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", + "RdpdrServerDriveDeleteFileCallback2: deviceId=%" PRIu32 ", completionId=%" PRIu32 + ", ioStatus=0x%" PRIx32 "", deviceId, completionId, ioStatus); /* Invoke the delete file completion routine. */ context->OnDriveDeleteFileComplete(context, irp->CallbackData, ioStatus); @@ -2354,14 +2323,15 @@ static UINT rdpdr_server_drive_delete_file_callback2(RdpdrServerContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_delete_file_callback1(RdpdrServerContext* - context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, - UINT32 ioStatus) +static UINT rdpdr_server_drive_delete_file_callback1(RdpdrServerContext* context, wStream* s, + RDPDR_IRP* irp, UINT32 deviceId, + UINT32 completionId, UINT32 ioStatus) { UINT32 fileId; UINT8 information; WLog_DBG(TAG, - "RdpdrServerDriveDeleteFileCallback1: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", + "RdpdrServerDriveDeleteFileCallback1: deviceId=%" PRIu32 ", completionId=%" PRIu32 + ", ioStatus=0x%" PRIx32 "", deviceId, completionId, ioStatus); if (ioStatus != STATUS_SUCCESS) @@ -2379,7 +2349,7 @@ static UINT rdpdr_server_drive_delete_file_callback1(RdpdrServerContext* return ERROR_INVALID_DATA; } - Stream_Read_UINT32(s, fileId); /* FileId (4 bytes) */ + Stream_Read_UINT32(s, fileId); /* FileId (4 bytes) */ Stream_Read_UINT8(s, information); /* Information (1 byte) */ /* Setup the IRP. */ irp->CompletionId = context->priv->NextCompletionId++; @@ -2395,8 +2365,7 @@ static UINT rdpdr_server_drive_delete_file_callback1(RdpdrServerContext* } /* Send a request to close the file */ - return rdpdr_server_send_device_close_request(context, deviceId, fileId, - irp->CompletionId); + return rdpdr_server_send_device_close_request(context, deviceId, fileId, irp->CompletionId); } /** @@ -2404,8 +2373,8 @@ static UINT rdpdr_server_drive_delete_file_callback1(RdpdrServerContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_delete_file(RdpdrServerContext* context, - void* callbackData, UINT32 deviceId, const char* path) +static UINT rdpdr_server_drive_delete_file(RdpdrServerContext* context, void* callbackData, + UINT32 deviceId, const char* path) { RDPDR_IRP* irp; irp = rdpdr_server_irp_new(); @@ -2431,10 +2400,9 @@ static UINT rdpdr_server_drive_delete_file(RdpdrServerContext* context, } /* Send a request to open the file. */ - return rdpdr_server_send_device_create_request(context, deviceId, - irp->CompletionId, irp->PathName, - FILE_READ_DATA | SYNCHRONIZE, - FILE_DELETE_ON_CLOSE | FILE_SYNCHRONOUS_IO_NONALERT, FILE_OPEN); + return rdpdr_server_send_device_create_request( + context, deviceId, irp->CompletionId, irp->PathName, FILE_READ_DATA | SYNCHRONIZE, + FILE_DELETE_ON_CLOSE | FILE_SYNCHRONOUS_IO_NONALERT, FILE_OPEN); } /************************************************* @@ -2446,12 +2414,13 @@ static UINT rdpdr_server_drive_delete_file(RdpdrServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_rename_file_callback3(RdpdrServerContext* - context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, - UINT32 ioStatus) +static UINT rdpdr_server_drive_rename_file_callback3(RdpdrServerContext* context, wStream* s, + RDPDR_IRP* irp, UINT32 deviceId, + UINT32 completionId, UINT32 ioStatus) { WLog_DBG(TAG, - "RdpdrServerDriveRenameFileCallback3: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", + "RdpdrServerDriveRenameFileCallback3: deviceId=%" PRIu32 ", completionId=%" PRIu32 + ", ioStatus=0x%" PRIx32 "", deviceId, completionId, ioStatus); /* Destroy the IRP. */ rdpdr_server_irp_free(irp); @@ -2463,13 +2432,14 @@ static UINT rdpdr_server_drive_rename_file_callback3(RdpdrServerContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_rename_file_callback2(RdpdrServerContext* - context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, - UINT32 ioStatus) +static UINT rdpdr_server_drive_rename_file_callback2(RdpdrServerContext* context, wStream* s, + RDPDR_IRP* irp, UINT32 deviceId, + UINT32 completionId, UINT32 ioStatus) { UINT32 length; WLog_DBG(TAG, - "RdpdrServerDriveRenameFileCallback2: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", + "RdpdrServerDriveRenameFileCallback2: deviceId=%" PRIu32 ", completionId=%" PRIu32 + ", ioStatus=0x%" PRIx32 "", deviceId, completionId, ioStatus); if (Stream_GetRemainingLength(s) < 5) @@ -2479,7 +2449,7 @@ static UINT rdpdr_server_drive_rename_file_callback2(RdpdrServerContext* } Stream_Read_UINT32(s, length); /* Length (4 bytes) */ - Stream_Seek(s, 1); /* Padding (1 byte) */ + Stream_Seek(s, 1); /* Padding (1 byte) */ /* Invoke the rename file completion routine. */ context->OnDriveRenameFileComplete(context, irp->CallbackData, ioStatus); /* Setup the IRP. */ @@ -2496,7 +2466,7 @@ static UINT rdpdr_server_drive_rename_file_callback2(RdpdrServerContext* /* Send a request to close the file */ return rdpdr_server_send_device_close_request(context, deviceId, irp->FileId, - irp->CompletionId); + irp->CompletionId); } /** @@ -2504,14 +2474,15 @@ static UINT rdpdr_server_drive_rename_file_callback2(RdpdrServerContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_rename_file_callback1(RdpdrServerContext* - context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, - UINT32 ioStatus) +static UINT rdpdr_server_drive_rename_file_callback1(RdpdrServerContext* context, wStream* s, + RDPDR_IRP* irp, UINT32 deviceId, + UINT32 completionId, UINT32 ioStatus) { UINT32 fileId; UINT8 information; WLog_DBG(TAG, - "RdpdrServerDriveRenameFileCallback1: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", + "RdpdrServerDriveRenameFileCallback1: deviceId=%" PRIu32 ", completionId=%" PRIu32 + ", ioStatus=0x%" PRIx32 "", deviceId, completionId, ioStatus); if (ioStatus != STATUS_SUCCESS) @@ -2529,7 +2500,7 @@ static UINT rdpdr_server_drive_rename_file_callback1(RdpdrServerContext* return ERROR_INVALID_DATA; } - Stream_Read_UINT32(s, fileId); /* FileId (4 bytes) */ + Stream_Read_UINT32(s, fileId); /* FileId (4 bytes) */ Stream_Read_UINT8(s, information); /* Information (1 byte) */ /* Setup the IRP. */ irp->CompletionId = context->priv->NextCompletionId++; @@ -2546,7 +2517,7 @@ static UINT rdpdr_server_drive_rename_file_callback1(RdpdrServerContext* /* Send a request to rename the file */ return rdpdr_server_send_device_file_rename_request(context, deviceId, fileId, - irp->CompletionId, irp->ExtraBuffer); + irp->CompletionId, irp->ExtraBuffer); } /** @@ -2554,8 +2525,9 @@ static UINT rdpdr_server_drive_rename_file_callback1(RdpdrServerContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpdr_server_drive_rename_file(RdpdrServerContext* context, - void* callbackData, UINT32 deviceId, const char* oldPath, const char* newPath) +static UINT rdpdr_server_drive_rename_file(RdpdrServerContext* context, void* callbackData, + UINT32 deviceId, const char* oldPath, + const char* newPath) { RDPDR_IRP* irp; irp = rdpdr_server_irp_new(); @@ -2583,15 +2555,15 @@ static UINT rdpdr_server_drive_rename_file(RdpdrServerContext* context, } /* Send a request to open the file. */ - return rdpdr_server_send_device_create_request(context, deviceId, - irp->CompletionId, irp->PathName, - FILE_READ_DATA | SYNCHRONIZE, FILE_SYNCHRONOUS_IO_NONALERT, FILE_OPEN); + return rdpdr_server_send_device_create_request(context, deviceId, irp->CompletionId, + irp->PathName, FILE_READ_DATA | SYNCHRONIZE, + FILE_SYNCHRONOUS_IO_NONALERT, FILE_OPEN); } RdpdrServerContext* rdpdr_server_context_new(HANDLE vcm) { RdpdrServerContext* context; - context = (RdpdrServerContext*) calloc(1, sizeof(RdpdrServerContext)); + context = (RdpdrServerContext*)calloc(1, sizeof(RdpdrServerContext)); if (context) { @@ -2607,7 +2579,7 @@ RdpdrServerContext* rdpdr_server_context_new(HANDLE vcm) context->DriveCloseFile = rdpdr_server_drive_close_file; context->DriveDeleteFile = rdpdr_server_drive_delete_file; context->DriveRenameFile = rdpdr_server_drive_rename_file; - context->priv = (RdpdrServerPrivate*) calloc(1, sizeof(RdpdrServerPrivate)); + context->priv = (RdpdrServerPrivate*)calloc(1, sizeof(RdpdrServerPrivate)); if (!context->priv) { @@ -2652,4 +2624,3 @@ void rdpdr_server_context_free(RdpdrServerContext* context) free(context); } } - diff --git a/channels/rdpdr/server/rdpdr_main.h b/channels/rdpdr/server/rdpdr_main.h index 035ff7d70..f3f54cc07 100644 --- a/channels/rdpdr/server/rdpdr_main.h +++ b/channels/rdpdr/server/rdpdr_main.h @@ -48,7 +48,7 @@ struct _rdpdr_server_private UINT32 NextCompletionId; }; -#define RDPDR_HEADER_LENGTH 4 +#define RDPDR_HEADER_LENGTH 4 struct _RDPDR_HEADER { @@ -57,14 +57,14 @@ struct _RDPDR_HEADER }; typedef struct _RDPDR_HEADER RDPDR_HEADER; -#define RDPDR_VERSION_MAJOR 0x0001 +#define RDPDR_VERSION_MAJOR 0x0001 -#define RDPDR_VERSION_MINOR_RDP50 0x0002 -#define RDPDR_VERSION_MINOR_RDP51 0x0005 -#define RDPDR_VERSION_MINOR_RDP52 0x000A -#define RDPDR_VERSION_MINOR_RDP6X 0x000C +#define RDPDR_VERSION_MINOR_RDP50 0x0002 +#define RDPDR_VERSION_MINOR_RDP51 0x0005 +#define RDPDR_VERSION_MINOR_RDP52 0x000A +#define RDPDR_VERSION_MINOR_RDP6X 0x000C -#define RDPDR_CAPABILITY_HEADER_LENGTH 8 +#define RDPDR_CAPABILITY_HEADER_LENGTH 8 struct _RDPDR_CAPABILITY_HEADER { @@ -81,8 +81,10 @@ struct _RDPDR_IRP UINT32 FileId; char PathName[256]; char ExtraBuffer[256]; - void *CallbackData; - UINT (*Callback)(RdpdrServerContext* context, wStream* s, struct _RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus); + void* CallbackData; + UINT(*Callback) + (RdpdrServerContext* context, wStream* s, struct _RDPDR_IRP* irp, UINT32 deviceId, + UINT32 completionId, UINT32 ioStatus); }; typedef struct _RDPDR_IRP RDPDR_IRP; diff --git a/channels/rdpei/client/rdpei_main.c b/channels/rdpei/client/rdpei_main.c index 9aca25861..27e09ea4a 100644 --- a/channels/rdpei/client/rdpei_main.c +++ b/channels/rdpei/client/rdpei_main.c @@ -62,7 +62,7 @@ * http://msdn.microsoft.com/en-us/library/hh454910/ */ -#define MAX_CONTACTS 512 +#define MAX_CONTACTS 512 struct _RDPEI_CHANNEL_CALLBACK { @@ -117,16 +117,13 @@ typedef struct _RDPEI_PLUGIN RDPEI_PLUGIN; */ UINT rdpei_send_frame(RdpeiClientContext* context); -const char* RDPEI_EVENTID_STRINGS[] = -{ - "", - "EVENTID_SC_READY", - "EVENTID_CS_READY", - "EVENTID_TOUCH", - "EVENTID_SUSPEND_TOUCH", - "EVENTID_RESUME_TOUCH", - "EVENTID_DISMISS_HOVERING_CONTACT" -}; +const char* RDPEI_EVENTID_STRINGS[] = { "", + "EVENTID_SC_READY", + "EVENTID_CS_READY", + "EVENTID_TOUCH", + "EVENTID_SUSPEND_TOUCH", + "EVENTID_RESUME_TOUCH", + "EVENTID_DISMISS_HOVERING_CONTACT" }; /** * Function description @@ -137,12 +134,12 @@ UINT rdpei_add_frame(RdpeiClientContext* context) { int i; RDPINPUT_CONTACT_DATA* contact; - RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) context->handle; + RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*)context->handle; rdpei->frame.contactCount = 0; for (i = 0; i < rdpei->maxTouchContacts; i++) { - contact = (RDPINPUT_CONTACT_DATA*) & (rdpei->contactPoints[i].data); + contact = (RDPINPUT_CONTACT_DATA*)&(rdpei->contactPoints[i].data); if (rdpei->contactPoints[i].dirty) { @@ -172,7 +169,7 @@ UINT rdpei_add_frame(RdpeiClientContext* context) static DWORD WINAPI rdpei_schedule_thread(LPVOID arg) { DWORD status; - RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) arg; + RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*)arg; UINT error = CHANNEL_RC_OK; RdpeiClientContext* context; HANDLE hdl[2]; @@ -183,7 +180,7 @@ static DWORD WINAPI rdpei_schedule_thread(LPVOID arg) goto out; } - context = (RdpeiClientContext*) rdpei->iface.pInterface; + context = (RdpeiClientContext*)rdpei->iface.pInterface; hdl[0] = rdpei->event; hdl[1] = rdpei->stopEvent; @@ -200,7 +197,7 @@ static DWORD WINAPI rdpei_schedule_thread(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "!", error); break; } @@ -211,7 +208,7 @@ static DWORD WINAPI rdpei_schedule_thread(LPVOID arg) if ((error = rdpei_add_frame(context))) { - WLog_ERR(TAG, "rdpei_add_frame failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpei_add_frame failed with error %" PRIu32 "!", error); break; } @@ -219,7 +216,7 @@ static DWORD WINAPI rdpei_schedule_thread(LPVOID arg) { if ((error = rdpei_send_frame(context))) { - WLog_ERR(TAG, "rdpei_send_frame failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpei_send_frame failed with error %" PRIu32 "!", error); break; } } @@ -233,8 +230,7 @@ static DWORD WINAPI rdpei_schedule_thread(LPVOID arg) out: if (error && rdpei && rdpei->rdpcontext) - setChannelError(rdpei->rdpcontext, error, - "rdpei_schedule_thread reported an error"); + setChannelError(rdpei->rdpcontext, error, "rdpei_schedule_thread reported an error"); ExitThread(error); return error; @@ -245,18 +241,18 @@ out: * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_send_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s, - UINT16 eventId, UINT32 pduLength) +UINT rdpei_send_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s, UINT16 eventId, UINT32 pduLength) { UINT status; Stream_SetPosition(s, 0); - Stream_Write_UINT16(s, eventId); /* eventId (2 bytes) */ + Stream_Write_UINT16(s, eventId); /* eventId (2 bytes) */ Stream_Write_UINT32(s, pduLength); /* pduLength (4 bytes) */ Stream_SetPosition(s, Stream_Length(s)); - status = callback->channel->Write(callback->channel, (UINT32) Stream_Length(s), - Stream_Buffer(s), NULL); + status = callback->channel->Write(callback->channel, (UINT32)Stream_Length(s), Stream_Buffer(s), + NULL); #ifdef WITH_DEBUG_RDPEI - WLog_DBG(TAG, "rdpei_send_pdu: eventId: %"PRIu16" (%s) length: %"PRIu32" status: %"PRIu32"", + WLog_DBG(TAG, + "rdpei_send_pdu: eventId: %" PRIu16 " (%s) length: %" PRIu32 " status: %" PRIu32 "", eventId, RDPEI_EVENTID_STRINGS[eventId], pduLength, status); #endif return status; @@ -273,10 +269,10 @@ UINT rdpei_send_cs_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback) wStream* s; UINT32 flags; UINT32 pduLength; - RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) callback->plugin; + RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*)callback->plugin; flags = 0; flags |= READY_FLAGS_SHOW_TOUCH_VISUALS; - //flags |= READY_FLAGS_DISABLE_TIMESTAMP_INJECTION; + // flags |= READY_FLAGS_DISABLE_TIMESTAMP_INJECTION; pduLength = RDPINPUT_HEADER_LENGTH + 10; s = Stream_New(NULL, pduLength); @@ -287,10 +283,9 @@ UINT rdpei_send_cs_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback) } Stream_Seek(s, RDPINPUT_HEADER_LENGTH); - Stream_Write_UINT32(s, flags); /* flags (4 bytes) */ - Stream_Write_UINT32(s, RDPINPUT_PROTOCOL_V10); /* protocolVersion (4 bytes) */ - Stream_Write_UINT16(s, - rdpei->maxTouchContacts); /* maxTouchContacts (2 bytes) */ + Stream_Write_UINT32(s, flags); /* flags (4 bytes) */ + Stream_Write_UINT32(s, RDPINPUT_PROTOCOL_V10); /* protocolVersion (4 bytes) */ + Stream_Write_UINT16(s, rdpei->maxTouchContacts); /* maxTouchContacts (2 bytes) */ Stream_SealLength(s); status = rdpei_send_pdu(callback, s, EVENTID_CS_READY, pduLength); Stream_Free(s, TRUE); @@ -329,8 +324,8 @@ UINT rdpei_write_touch_frame(wStream* s, RDPINPUT_TOUCH_FRAME* frame) int rectSize = 2; RDPINPUT_CONTACT_DATA* contact; #ifdef WITH_DEBUG_RDPEI - WLog_DBG(TAG, "contactCount: %"PRIu32"", frame->contactCount); - WLog_DBG(TAG, "frameOffset: 0x%016"PRIX64"", frame->frameOffset); + WLog_DBG(TAG, "contactCount: %" PRIu32 "", frame->contactCount); + WLog_DBG(TAG, "frameOffset: 0x%016" PRIX64 "", frame->frameOffset); #endif rdpei_write_2byte_unsigned(s, frame->contactCount); /* contactCount (TWO_BYTE_UNSIGNED_INTEGER) */ @@ -338,10 +333,10 @@ UINT rdpei_write_touch_frame(wStream* s, RDPINPUT_TOUCH_FRAME* frame) * the time offset from the previous frame (in microseconds). * If this is the first frame being transmitted then this field MUST be set to zero. */ - rdpei_write_8byte_unsigned(s, - frame->frameOffset * 1000); /* frameOffset (EIGHT_BYTE_UNSIGNED_INTEGER) */ + rdpei_write_8byte_unsigned(s, frame->frameOffset * + 1000); /* frameOffset (EIGHT_BYTE_UNSIGNED_INTEGER) */ - if (!Stream_EnsureRemainingCapacity(s, (size_t) frame->contactCount * 64)) + if (!Stream_EnsureRemainingCapacity(s, (size_t)frame->contactCount * 64)) { WLog_ERR(TAG, "Stream_EnsureRemainingCapacity failed!"); return CHANNEL_RC_NO_MEMORY; @@ -356,11 +351,13 @@ UINT rdpei_write_touch_frame(wStream* s, RDPINPUT_TOUCH_FRAME* frame) contact->contactRectRight = contact->x + rectSize; contact->contactRectBottom = contact->y + rectSize; #ifdef WITH_DEBUG_RDPEI - WLog_DBG(TAG, "contact[%"PRIu32"].contactId: %"PRIu32"", index, contact->contactId); - WLog_DBG(TAG, "contact[%"PRIu32"].fieldsPresent: %"PRIu32"", index, contact->fieldsPresent); - WLog_DBG(TAG, "contact[%"PRIu32"].x: %"PRId32"", index, contact->x); - WLog_DBG(TAG, "contact[%"PRIu32"].y: %"PRId32"", index, contact->y); - WLog_DBG(TAG, "contact[%"PRIu32"].contactFlags: 0x%08"PRIX32"", index, contact->contactFlags); + WLog_DBG(TAG, "contact[%" PRIu32 "].contactId: %" PRIu32 "", index, contact->contactId); + WLog_DBG(TAG, "contact[%" PRIu32 "].fieldsPresent: %" PRIu32 "", index, + contact->fieldsPresent); + WLog_DBG(TAG, "contact[%" PRIu32 "].x: %" PRId32 "", index, contact->x); + WLog_DBG(TAG, "contact[%" PRIu32 "].y: %" PRId32 "", index, contact->y); + WLog_DBG(TAG, "contact[%" PRIu32 "].contactFlags: 0x%08" PRIX32 "", index, + contact->contactFlags); rdpei_print_contact_flags(contact->contactFlags); #endif Stream_Write_UINT8(s, contact->contactId); /* contactId (1 byte) */ @@ -404,8 +401,7 @@ UINT rdpei_write_touch_frame(wStream* s, RDPINPUT_TOUCH_FRAME* frame) * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_send_touch_event_pdu(RDPEI_CHANNEL_CALLBACK* callback, - RDPINPUT_TOUCH_FRAME* frame) +UINT rdpei_send_touch_event_pdu(RDPEI_CHANNEL_CALLBACK* callback, RDPINPUT_TOUCH_FRAME* frame) { UINT status; wStream* s; @@ -424,13 +420,13 @@ UINT rdpei_send_touch_event_pdu(RDPEI_CHANNEL_CALLBACK* callback, * the time that has elapsed (in milliseconds) from when the oldest touch frame * was generated to when it was encoded for transmission by the client. */ - rdpei_write_4byte_unsigned(s, - (UINT32) frame->frameOffset); /* encodeTime (FOUR_BYTE_UNSIGNED_INTEGER) */ - rdpei_write_2byte_unsigned(s, 1); /* (frameCount) TWO_BYTE_UNSIGNED_INTEGER */ + rdpei_write_4byte_unsigned( + s, (UINT32)frame->frameOffset); /* encodeTime (FOUR_BYTE_UNSIGNED_INTEGER) */ + rdpei_write_2byte_unsigned(s, 1); /* (frameCount) TWO_BYTE_UNSIGNED_INTEGER */ if ((status = rdpei_write_touch_frame(s, frame))) { - WLog_ERR(TAG, "rdpei_write_touch_frame failed with error %"PRIu32"!", status); + WLog_ERR(TAG, "rdpei_write_touch_frame failed with error %" PRIu32 "!", status); Stream_Free(s, TRUE); return status; } @@ -470,12 +466,12 @@ UINT rdpei_recv_sc_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) */ UINT rdpei_recv_suspend_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) { - RdpeiClientContext* rdpei = (RdpeiClientContext*) callback->plugin->pInterface; + RdpeiClientContext* rdpei = (RdpeiClientContext*)callback->plugin->pInterface; UINT error = CHANNEL_RC_OK; IFCALLRET(rdpei->SuspendTouch, error, rdpei); if (error) - WLog_ERR(TAG, "rdpei->SuspendTouch failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpei->SuspendTouch failed with error %" PRIu32 "!", error); return error; } @@ -487,12 +483,12 @@ UINT rdpei_recv_suspend_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) */ UINT rdpei_recv_resume_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) { - RdpeiClientContext* rdpei = (RdpeiClientContext*) callback->plugin->pInterface; + RdpeiClientContext* rdpei = (RdpeiClientContext*)callback->plugin->pInterface; UINT error = CHANNEL_RC_OK; IFCALLRET(rdpei->ResumeTouch, error, rdpei); if (error) - WLog_ERR(TAG, "rdpei->ResumeTouch failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpei->ResumeTouch failed with error %" PRIu32 "!", error); return error; } @@ -507,11 +503,11 @@ UINT rdpei_recv_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) UINT16 eventId; UINT32 pduLength; UINT error; - Stream_Read_UINT16(s, eventId); /* eventId (2 bytes) */ + Stream_Read_UINT16(s, eventId); /* eventId (2 bytes) */ Stream_Read_UINT32(s, pduLength); /* pduLength (4 bytes) */ #ifdef WITH_DEBUG_RDPEI - WLog_DBG(TAG, "rdpei_recv_pdu: eventId: %"PRIu16" (%s) length: %"PRIu32"", - eventId, RDPEI_EVENTID_STRINGS[eventId], pduLength); + WLog_DBG(TAG, "rdpei_recv_pdu: eventId: %" PRIu16 " (%s) length: %" PRIu32 "", eventId, + RDPEI_EVENTID_STRINGS[eventId], pduLength); #endif switch (eventId) @@ -519,13 +515,13 @@ UINT rdpei_recv_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) case EVENTID_SC_READY: if ((error = rdpei_recv_sc_ready_pdu(callback, s))) { - WLog_ERR(TAG, "rdpei_recv_sc_ready_pdu failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpei_recv_sc_ready_pdu failed with error %" PRIu32 "!", error); return error; } if ((error = rdpei_send_cs_ready_pdu(callback))) { - WLog_ERR(TAG, "rdpei_send_cs_ready_pdu failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpei_send_cs_ready_pdu failed with error %" PRIu32 "!", error); return error; } @@ -534,7 +530,7 @@ UINT rdpei_recv_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) case EVENTID_SUSPEND_TOUCH: if ((error = rdpei_recv_suspend_touch_pdu(callback, s))) { - WLog_ERR(TAG, "rdpei_recv_suspend_touch_pdu failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpei_recv_suspend_touch_pdu failed with error %" PRIu32 "!", error); return error; } @@ -543,7 +539,7 @@ UINT rdpei_recv_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) case EVENTID_RESUME_TOUCH: if ((error = rdpei_recv_resume_touch_pdu(callback, s))) { - WLog_ERR(TAG, "rdpei_recv_resume_touch_pdu failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpei_recv_resume_touch_pdu failed with error %" PRIu32 "!", error); return error; } @@ -561,11 +557,10 @@ UINT rdpei_recv_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpei_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, - wStream* data) +static UINT rdpei_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream* data) { - RDPEI_CHANNEL_CALLBACK* callback = (RDPEI_CHANNEL_CALLBACK*) pChannelCallback; - return rdpei_recv_pdu(callback, data); + RDPEI_CHANNEL_CALLBACK* callback = (RDPEI_CHANNEL_CALLBACK*)pChannelCallback; + return rdpei_recv_pdu(callback, data); } /** @@ -575,7 +570,7 @@ static UINT rdpei_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, */ static UINT rdpei_on_close(IWTSVirtualChannelCallback* pChannelCallback) { - RDPEI_CHANNEL_CALLBACK* callback = (RDPEI_CHANNEL_CALLBACK*) pChannelCallback; + RDPEI_CHANNEL_CALLBACK* callback = (RDPEI_CHANNEL_CALLBACK*)pChannelCallback; free(callback); return CHANNEL_RC_OK; } @@ -585,15 +580,13 @@ static UINT rdpei_on_close(IWTSVirtualChannelCallback* pChannelCallback) * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpei_on_new_channel_connection(IWTSListenerCallback* - pListenerCallback, - IWTSVirtualChannel* pChannel, BYTE* Data, BOOL* pbAccept, - IWTSVirtualChannelCallback** ppCallback) +static UINT rdpei_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, + IWTSVirtualChannel* pChannel, BYTE* Data, + BOOL* pbAccept, IWTSVirtualChannelCallback** ppCallback) { RDPEI_CHANNEL_CALLBACK* callback; - RDPEI_LISTENER_CALLBACK* listener_callback = (RDPEI_LISTENER_CALLBACK*) - pListenerCallback; - callback = (RDPEI_CHANNEL_CALLBACK*) calloc(1, sizeof(RDPEI_CHANNEL_CALLBACK)); + RDPEI_LISTENER_CALLBACK* listener_callback = (RDPEI_LISTENER_CALLBACK*)pListenerCallback; + callback = (RDPEI_CHANNEL_CALLBACK*)calloc(1, sizeof(RDPEI_CHANNEL_CALLBACK)); if (!callback) { @@ -607,7 +600,7 @@ static UINT rdpei_on_new_channel_connection(IWTSListenerCallback* callback->channel_mgr = listener_callback->channel_mgr; callback->channel = pChannel; listener_callback->channel_callback = callback; - *ppCallback = (IWTSVirtualChannelCallback*) callback; + *ppCallback = (IWTSVirtualChannelCallback*)callback; return CHANNEL_RC_OK; } @@ -616,13 +609,11 @@ static UINT rdpei_on_new_channel_connection(IWTSListenerCallback* * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpei_plugin_initialize(IWTSPlugin* pPlugin, - IWTSVirtualChannelManager* pChannelMgr) +static UINT rdpei_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) { UINT error; - RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) pPlugin; - rdpei->listener_callback = (RDPEI_LISTENER_CALLBACK*) calloc(1 , - sizeof(RDPEI_LISTENER_CALLBACK)); + RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*)pPlugin; + rdpei->listener_callback = (RDPEI_LISTENER_CALLBACK*)calloc(1, sizeof(RDPEI_LISTENER_CALLBACK)); if (!rdpei->listener_callback) { @@ -630,15 +621,15 @@ static UINT rdpei_plugin_initialize(IWTSPlugin* pPlugin, return CHANNEL_RC_NO_MEMORY; } - rdpei->listener_callback->iface.OnNewChannelConnection = - rdpei_on_new_channel_connection; + rdpei->listener_callback->iface.OnNewChannelConnection = rdpei_on_new_channel_connection; rdpei->listener_callback->plugin = pPlugin; rdpei->listener_callback->channel_mgr = pChannelMgr; if ((error = pChannelMgr->CreateListener(pChannelMgr, RDPEI_DVC_CHANNEL_NAME, 0, - (IWTSListenerCallback*) rdpei->listener_callback, &(rdpei->listener)))) + (IWTSListenerCallback*)rdpei->listener_callback, + &(rdpei->listener)))) { - WLog_ERR(TAG, "ChannelMgr->CreateListener failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "ChannelMgr->CreateListener failed with error %" PRIu32 "!", error); goto error_out; } @@ -657,8 +648,7 @@ static UINT rdpei_plugin_initialize(IWTSPlugin* pPlugin, goto error_out; } - if (!(rdpei->thread = CreateThread(NULL, 0, - rdpei_schedule_thread, (void*) rdpei, 0, NULL))) + if (!(rdpei->thread = CreateThread(NULL, 0, rdpei_schedule_thread, (void*)rdpei, 0, NULL))) { WLog_ERR(TAG, "CreateThread failed!"); goto error_out; @@ -679,7 +669,7 @@ error_out: */ static UINT rdpei_plugin_terminated(IWTSPlugin* pPlugin) { - RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) pPlugin; + RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*)pPlugin; UINT error; if (!pPlugin) @@ -691,7 +681,7 @@ static UINT rdpei_plugin_terminated(IWTSPlugin* pPlugin) if (WaitForSingleObject(rdpei->thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); return error; } @@ -711,7 +701,7 @@ static UINT rdpei_plugin_terminated(IWTSPlugin* pPlugin) int rdpei_get_version(RdpeiClientContext* context) { - RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) context->handle; + RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*)context->handle; return rdpei->version; } @@ -723,7 +713,7 @@ int rdpei_get_version(RdpeiClientContext* context) UINT rdpei_send_frame(RdpeiClientContext* context) { UINT64 currentTime; - RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) context->handle; + RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*)context->handle; RDPEI_CHANNEL_CALLBACK* callback = rdpei->listener_callback->channel_callback; UINT error; currentTime = GetTickCount64(); @@ -741,7 +731,7 @@ UINT rdpei_send_frame(RdpeiClientContext* context) if ((error = rdpei_send_touch_event_pdu(callback, &rdpei->frame))) { - WLog_ERR(TAG, "rdpei_send_touch_event_pdu failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpei_send_touch_event_pdu failed with error %" PRIu32 "!", error); return error; } @@ -755,14 +745,12 @@ UINT rdpei_send_frame(RdpeiClientContext* context) * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_add_contact(RdpeiClientContext* context, - RDPINPUT_CONTACT_DATA* contact) +UINT rdpei_add_contact(RdpeiClientContext* context, RDPINPUT_CONTACT_DATA* contact) { RDPINPUT_CONTACT_POINT* contactPoint; - RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) context->handle; + RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*)context->handle; EnterCriticalSection(&rdpei->lock); - contactPoint = (RDPINPUT_CONTACT_POINT*) - &rdpei->contactPoints[contact->contactId]; + contactPoint = (RDPINPUT_CONTACT_POINT*)&rdpei->contactPoints[contact->contactId]; CopyMemory(&(contactPoint->data), contact, sizeof(RDPINPUT_CONTACT_DATA)); contactPoint->dirty = TRUE; SetEvent(rdpei->event); @@ -775,21 +763,20 @@ UINT rdpei_add_contact(RdpeiClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_touch_begin(RdpeiClientContext* context, int externalId, int x, - int y, int* contactId) +UINT rdpei_touch_begin(RdpeiClientContext* context, int externalId, int x, int y, int* contactId) { unsigned int i; int contactIdlocal = -1; RDPINPUT_CONTACT_DATA contact; RDPINPUT_CONTACT_POINT* contactPoint = NULL; - RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) context->handle; - UINT error = CHANNEL_RC_OK; + RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*)context->handle; + UINT error = CHANNEL_RC_OK; /* Create a new contact point in an empty slot */ for (i = 0; i < rdpei->maxTouchContacts; i++) { - contactPoint = (RDPINPUT_CONTACT_POINT*) &rdpei->contactPoints[i]; + contactPoint = (RDPINPUT_CONTACT_POINT*)&rdpei->contactPoints[i]; if (!contactPoint->active) { @@ -809,7 +796,7 @@ UINT rdpei_touch_begin(RdpeiClientContext* context, int externalId, int x, contactPoint->lastY = y; contact.x = x; contact.y = y; - contact.contactId = (UINT32) contactIdlocal; + contact.contactId = (UINT32)contactIdlocal; contact.contactFlags |= CONTACT_FLAG_DOWN; contact.contactFlags |= CONTACT_FLAG_INRANGE; contact.contactFlags |= CONTACT_FLAG_INCONTACT; @@ -825,19 +812,18 @@ UINT rdpei_touch_begin(RdpeiClientContext* context, int externalId, int x, * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_touch_update(RdpeiClientContext* context, int externalId, int x, - int y, int* contactId) +UINT rdpei_touch_update(RdpeiClientContext* context, int externalId, int x, int y, int* contactId) { unsigned int i; int contactIdlocal = -1; RDPINPUT_CONTACT_DATA contact; RDPINPUT_CONTACT_POINT* contactPoint = NULL; - RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) context->handle; + RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*)context->handle; UINT error = CHANNEL_RC_OK; for (i = 0; i < rdpei->maxTouchContacts; i++) { - contactPoint = (RDPINPUT_CONTACT_POINT*) &rdpei->contactPoints[i]; + contactPoint = (RDPINPUT_CONTACT_POINT*)&rdpei->contactPoints[i]; if (!contactPoint->active) continue; @@ -856,7 +842,7 @@ UINT rdpei_touch_update(RdpeiClientContext* context, int externalId, int x, contactPoint->lastY = y; contact.x = x; contact.y = y; - contact.contactId = (UINT32) contactIdlocal; + contact.contactId = (UINT32)contactIdlocal; contact.contactFlags |= CONTACT_FLAG_UPDATE; contact.contactFlags |= CONTACT_FLAG_INRANGE; contact.contactFlags |= CONTACT_FLAG_INCONTACT; @@ -872,20 +858,19 @@ UINT rdpei_touch_update(RdpeiClientContext* context, int externalId, int x, * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_touch_end(RdpeiClientContext* context, int externalId, int x, int y, - int* contactId) +UINT rdpei_touch_end(RdpeiClientContext* context, int externalId, int x, int y, int* contactId) { unsigned int i; int contactIdlocal = -1; int tempvalue; RDPINPUT_CONTACT_DATA contact; RDPINPUT_CONTACT_POINT* contactPoint = NULL; - RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) context->handle; + RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*)context->handle; UINT error; for (i = 0; i < rdpei->maxTouchContacts; i++) { - contactPoint = (RDPINPUT_CONTACT_POINT*) &rdpei->contactPoints[i]; + contactPoint = (RDPINPUT_CONTACT_POINT*)&rdpei->contactPoints[i]; if (!contactPoint->active) continue; @@ -905,19 +890,19 @@ UINT rdpei_touch_end(RdpeiClientContext* context, int externalId, int x, int y, { if ((error = context->TouchUpdate(context, externalId, x, y, &tempvalue))) { - WLog_ERR(TAG, "context->TouchUpdate failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "context->TouchUpdate failed with error %" PRIu32 "!", error); return error; } } contact.x = x; contact.y = y; - contact.contactId = (UINT32) contactIdlocal; + contact.contactId = (UINT32)contactIdlocal; contact.contactFlags |= CONTACT_FLAG_UP; if ((error = context->AddContact(context, &contact))) { - WLog_ERR(TAG, "context->AddContact failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "context->AddContact failed with error %" PRIu32 "!", error); return error; } @@ -933,9 +918,9 @@ UINT rdpei_touch_end(RdpeiClientContext* context, int externalId, int x, int y, } #ifdef BUILTIN_CHANNELS -#define DVCPluginEntry rdpei_DVCPluginEntry +#define DVCPluginEntry rdpei_DVCPluginEntry #else -#define DVCPluginEntry FREERDP_API DVCPluginEntry +#define DVCPluginEntry FREERDP_API DVCPluginEntry #endif /** @@ -948,12 +933,12 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) UINT error; RDPEI_PLUGIN* rdpei = NULL; RdpeiClientContext* context = NULL; - rdpei = (RDPEI_PLUGIN*) pEntryPoints->GetPlugin(pEntryPoints, "rdpei"); + rdpei = (RDPEI_PLUGIN*)pEntryPoints->GetPlugin(pEntryPoints, "rdpei"); if (!rdpei) { size_t size; - rdpei = (RDPEI_PLUGIN*) calloc(1, sizeof(RDPEI_PLUGIN)); + rdpei = (RDPEI_PLUGIN*)calloc(1, sizeof(RDPEI_PLUGIN)); if (!rdpei) { @@ -968,12 +953,13 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) rdpei->version = 1; rdpei->currentFrameTime = 0; rdpei->previousFrameTime = 0; - rdpei->frame.contacts = (RDPINPUT_CONTACT_DATA*) rdpei->contacts; + rdpei->frame.contacts = (RDPINPUT_CONTACT_DATA*)rdpei->contacts; rdpei->maxTouchContacts = 10; size = rdpei->maxTouchContacts * sizeof(RDPINPUT_CONTACT_POINT); - rdpei->contactPoints = (RDPINPUT_CONTACT_POINT*) calloc(1, size); - rdpei->rdpcontext = ((freerdp*)((rdpSettings*) pEntryPoints->GetRdpSettings( - pEntryPoints))->instance)->context; + rdpei->contactPoints = (RDPINPUT_CONTACT_POINT*)calloc(1, size); + rdpei->rdpcontext = + ((freerdp*)((rdpSettings*)pEntryPoints->GetRdpSettings(pEntryPoints))->instance) + ->context; if (!rdpei->contactPoints) { @@ -982,7 +968,7 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) goto error_out; } - context = (RdpeiClientContext*) calloc(1, sizeof(RdpeiClientContext)); + context = (RdpeiClientContext*)calloc(1, sizeof(RdpeiClientContext)); if (!context) { @@ -991,18 +977,17 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) goto error_out; } - context->handle = (void*) rdpei; + context->handle = (void*)rdpei; context->GetVersion = rdpei_get_version; context->AddContact = rdpei_add_contact; context->TouchBegin = rdpei_touch_begin; context->TouchUpdate = rdpei_touch_update; context->TouchEnd = rdpei_touch_end; - rdpei->iface.pInterface = (void*) context; + rdpei->iface.pInterface = (void*)context; - if ((error = pEntryPoints->RegisterPlugin(pEntryPoints, "rdpei", - (IWTSPlugin*) rdpei))) + if ((error = pEntryPoints->RegisterPlugin(pEntryPoints, "rdpei", (IWTSPlugin*)rdpei))) { - WLog_ERR(TAG, "EntryPoints->RegisterPlugin failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "EntryPoints->RegisterPlugin failed with error %" PRIu32 "!", error); error = CHANNEL_RC_NO_MEMORY; goto error_out; } diff --git a/channels/rdpei/client/rdpei_main.h b/channels/rdpei/client/rdpei_main.h index 4dc499831..ed557b29d 100644 --- a/channels/rdpei/client/rdpei_main.h +++ b/channels/rdpei/client/rdpei_main.h @@ -34,10 +34,10 @@ #define TAG CHANNELS_TAG("rdpei.client") -#define RDPINPUT_CONTACT_STATE_INITIAL 0x0000 -#define RDPINPUT_CONTACT_STATE_ENGAGED 0x0001 -#define RDPINPUT_CONTACT_STATE_HOVERING 0x0002 -#define RDPINPUT_CONTACT_STATE_OUT_OF_RANGE 0x0003 +#define RDPINPUT_CONTACT_STATE_INITIAL 0x0000 +#define RDPINPUT_CONTACT_STATE_ENGAGED 0x0001 +#define RDPINPUT_CONTACT_STATE_HOVERING 0x0002 +#define RDPINPUT_CONTACT_STATE_OUT_OF_RANGE 0x0003 /** * Touch Contact State Transitions @@ -84,8 +84,10 @@ typedef struct _RDPINPUT_CONTACT_POINT RDPINPUT_CONTACT_POINT; #ifdef WITH_DEBUG_DVC #define DEBUG_DVC(...) WLog_DBG(TAG, __VA_ARGS__) #else -#define DEBUG_DVC(...) do { } while (0) +#define DEBUG_DVC(...) \ + do \ + { \ + } while (0) #endif #endif /* FREERDP_CHANNEL_RDPEI_CLIENT_MAIN_H */ - diff --git a/channels/rdpei/rdpei_common.c b/channels/rdpei/rdpei_common.c index 41a2ec3c3..adf9710d1 100644 --- a/channels/rdpei/rdpei_common.c +++ b/channels/rdpei/rdpei_common.c @@ -408,7 +408,7 @@ BOOL rdpei_read_8byte_unsigned(wStream* s, UINT64* value) break; case 4: - *value = ((UINT64) (byte & 0x1F)) << 32; + *value = ((UINT64)(byte & 0x1F)) << 32; Stream_Read_UINT8(s, byte); *value |= (byte << 24); Stream_Read_UINT8(s, byte); @@ -420,9 +420,9 @@ BOOL rdpei_read_8byte_unsigned(wStream* s, UINT64* value) break; case 5: - *value = ((UINT64) (byte & 0x1F)) << 40; + *value = ((UINT64)(byte & 0x1F)) << 40; Stream_Read_UINT8(s, byte); - *value |= (((UINT64) byte) << 32); + *value |= (((UINT64)byte) << 32); Stream_Read_UINT8(s, byte); *value |= (byte << 24); Stream_Read_UINT8(s, byte); @@ -434,11 +434,11 @@ BOOL rdpei_read_8byte_unsigned(wStream* s, UINT64* value) break; case 6: - *value = ((UINT64) (byte & 0x1F)) << 48; + *value = ((UINT64)(byte & 0x1F)) << 48; Stream_Read_UINT8(s, byte); - *value |= (((UINT64) byte) << 40); + *value |= (((UINT64)byte) << 40); Stream_Read_UINT8(s, byte); - *value |= (((UINT64) byte) << 32); + *value |= (((UINT64)byte) << 32); Stream_Read_UINT8(s, byte); *value |= (byte << 24); Stream_Read_UINT8(s, byte); @@ -450,13 +450,13 @@ BOOL rdpei_read_8byte_unsigned(wStream* s, UINT64* value) break; case 7: - *value = ((UINT64) (byte & 0x1F)) << 56; + *value = ((UINT64)(byte & 0x1F)) << 56; Stream_Read_UINT8(s, byte); - *value |= (((UINT64) byte) << 48); + *value |= (((UINT64)byte) << 48); Stream_Read_UINT8(s, byte); - *value |= (((UINT64) byte) << 40); + *value |= (((UINT64)byte) << 40); Stream_Read_UINT8(s, byte); - *value |= (((UINT64) byte) << 32); + *value |= (((UINT64)byte) << 32); Stream_Read_UINT8(s, byte); *value |= (byte << 24); Stream_Read_UINT8(s, byte); @@ -589,7 +589,7 @@ BOOL rdpei_write_8byte_unsigned(wStream* s, UINT64 value) return TRUE; } -void touch_event_reset(RDPINPUT_TOUCH_EVENT *event) +void touch_event_reset(RDPINPUT_TOUCH_EVENT* event) { int i; @@ -601,8 +601,7 @@ void touch_event_reset(RDPINPUT_TOUCH_EVENT *event) event->frameCount = 0; } - -void touch_frame_reset(RDPINPUT_TOUCH_FRAME *frame) +void touch_frame_reset(RDPINPUT_TOUCH_FRAME* frame) { free(frame->contacts); frame->contacts = NULL; diff --git a/channels/rdpei/rdpei_common.h b/channels/rdpei/rdpei_common.h index 34d1edd64..610767a95 100644 --- a/channels/rdpei/rdpei_common.h +++ b/channels/rdpei/rdpei_common.h @@ -26,7 +26,8 @@ #include /** @brief input event ids */ -enum { +enum +{ EVENTID_SC_READY = 0x0001, EVENTID_CS_READY = 0x0002, EVENTID_TOUCH = 0x0003, @@ -46,8 +47,7 @@ BOOL rdpei_write_4byte_signed(wStream* s, INT32 value); BOOL rdpei_read_8byte_unsigned(wStream* s, UINT64* value); BOOL rdpei_write_8byte_unsigned(wStream* s, UINT64 value); -void touch_event_reset(RDPINPUT_TOUCH_EVENT *event); -void touch_frame_reset(RDPINPUT_TOUCH_FRAME *frame); +void touch_event_reset(RDPINPUT_TOUCH_EVENT* event); +void touch_frame_reset(RDPINPUT_TOUCH_FRAME* frame); #endif /* FREERDP_CHANNEL_RDPEI_COMMON_H */ - diff --git a/channels/rdpei/server/rdpei_main.c b/channels/rdpei/server/rdpei_main.c index 7f5a20d63..81b93ce6f 100644 --- a/channels/rdpei/server/rdpei_main.c +++ b/channels/rdpei/server/rdpei_main.c @@ -34,7 +34,8 @@ #include /** @brief */ -enum RdpEiState { +enum RdpEiState +{ STATE_INITIAL, STATE_WAITING_CLIENT_READY, STATE_WAITING_FRAME, @@ -48,8 +49,8 @@ struct _rdpei_server_private UINT32 expectedBytes; BOOL waitingHeaders; - wStream *inputStream; - wStream *outputStream; + wStream* inputStream; + wStream* outputStream; UINT16 currentMsgType; @@ -58,11 +59,10 @@ struct _rdpei_server_private enum RdpEiState automataState; }; - RdpeiServerContext* rdpei_server_context_new(HANDLE vcm) { - RdpeiServerContext *ret = calloc(1, sizeof(*ret)); - RdpeiServerPrivate *priv; + RdpeiServerContext* ret = calloc(1, sizeof(*ret)); + RdpeiServerPrivate* priv; if (!ret) return NULL; @@ -97,22 +97,27 @@ out_free: * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_server_init(RdpeiServerContext *context) +UINT rdpei_server_init(RdpeiServerContext* context) { - void *buffer = NULL; + void* buffer = NULL; DWORD bytesReturned; - RdpeiServerPrivate *priv = context->priv; + RdpeiServerPrivate* priv = context->priv; - priv->channelHandle = WTSVirtualChannelOpenEx(WTS_CURRENT_SESSION, RDPEI_DVC_CHANNEL_NAME, WTS_CHANNEL_OPTION_DYNAMIC); + priv->channelHandle = WTSVirtualChannelOpenEx(WTS_CURRENT_SESSION, RDPEI_DVC_CHANNEL_NAME, + WTS_CHANNEL_OPTION_DYNAMIC); if (!priv->channelHandle) { WLog_ERR(TAG, "WTSVirtualChannelOpenEx failed!"); return CHANNEL_RC_INITIALIZATION_ERROR; } - if (!WTSVirtualChannelQuery(priv->channelHandle, WTSVirtualEventHandle, &buffer, &bytesReturned) || (bytesReturned != sizeof(HANDLE))) + if (!WTSVirtualChannelQuery(priv->channelHandle, WTSVirtualEventHandle, &buffer, + &bytesReturned) || + (bytesReturned != sizeof(HANDLE))) { - WLog_ERR(TAG, "WTSVirtualChannelQuery failed or invalid invalid returned size(%"PRIu32")!", bytesReturned); + WLog_ERR(TAG, + "WTSVirtualChannelQuery failed or invalid invalid returned size(%" PRIu32 ")!", + bytesReturned); if (buffer) WTSFreeMemory(buffer); goto out_close; @@ -127,10 +132,9 @@ out_close: return CHANNEL_RC_INITIALIZATION_ERROR; } - -void rdpei_server_context_reset(RdpeiServerContext *context) +void rdpei_server_context_reset(RdpeiServerContext* context) { - RdpeiServerPrivate *priv = context->priv; + RdpeiServerPrivate* priv = context->priv; priv->channelHandle = INVALID_HANDLE_VALUE; priv->expectedBytes = RDPINPUT_HEADER_LENGTH; @@ -141,7 +145,7 @@ void rdpei_server_context_reset(RdpeiServerContext *context) void rdpei_server_context_free(RdpeiServerContext* context) { - RdpeiServerPrivate *priv = context->priv; + RdpeiServerPrivate* priv = context->priv; if (priv->channelHandle != INVALID_HANDLE_VALUE) WTSVirtualChannelClose(priv->channelHandle); Stream_Free(priv->inputStream, TRUE); @@ -149,18 +153,17 @@ void rdpei_server_context_free(RdpeiServerContext* context) free(context); } -HANDLE rdpei_server_get_event_handle(RdpeiServerContext *context) +HANDLE rdpei_server_get_event_handle(RdpeiServerContext* context) { return context->priv->eventHandle; } - /** * Function description * * @return 0 on success, otherwise a Win32 error code */ -static UINT read_cs_ready_message(RdpeiServerContext *context, wStream *s) +static UINT read_cs_ready_message(RdpeiServerContext* context, wStream* s) { UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 10) @@ -175,17 +178,17 @@ static UINT read_cs_ready_message(RdpeiServerContext *context, wStream *s) switch (context->clientVersion) { - case RDPINPUT_PROTOCOL_V10: - case RDPINPUT_PROTOCOL_V101: - break; - default: - WLog_ERR(TAG, "unhandled RPDEI protocol version 0x%"PRIx32"", context->clientVersion); - break; + case RDPINPUT_PROTOCOL_V10: + case RDPINPUT_PROTOCOL_V101: + break; + default: + WLog_ERR(TAG, "unhandled RPDEI protocol version 0x%" PRIx32 "", context->clientVersion); + break; } IFCALLRET(context->onClientReady, error, context); if (error) - WLog_ERR(TAG, "context->onClientReady failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context->onClientReady failed with error %" PRIu32 "", error); return error; } @@ -195,7 +198,8 @@ static UINT read_cs_ready_message(RdpeiServerContext *context, wStream *s) * * @return 0 on success, otherwise a Win32 error code */ -static UINT read_touch_contact_data(RdpeiServerContext *context, wStream *s, RDPINPUT_CONTACT_DATA *contactData) +static UINT read_touch_contact_data(RdpeiServerContext* context, wStream* s, + RDPINPUT_CONTACT_DATA* contactData) { if (Stream_GetRemainingLength(s) < 1) { @@ -205,9 +209,9 @@ static UINT read_touch_contact_data(RdpeiServerContext *context, wStream *s, RDP Stream_Read_UINT8(s, contactData->contactId); if (!rdpei_read_2byte_unsigned(s, &contactData->fieldsPresent) || - !rdpei_read_4byte_signed(s, &contactData->x) || - !rdpei_read_4byte_signed(s, &contactData->y) || - !rdpei_read_4byte_unsigned(s, &contactData->contactFlags)) + !rdpei_read_4byte_signed(s, &contactData->x) || + !rdpei_read_4byte_signed(s, &contactData->y) || + !rdpei_read_4byte_unsigned(s, &contactData->contactFlags)) { WLog_ERR(TAG, "rdpei_read_ failed!"); return ERROR_INTERNAL_ERROR; @@ -216,9 +220,9 @@ static UINT read_touch_contact_data(RdpeiServerContext *context, wStream *s, RDP if (contactData->fieldsPresent & CONTACT_DATA_CONTACTRECT_PRESENT) { if (!rdpei_read_2byte_signed(s, &contactData->contactRectLeft) || - !rdpei_read_2byte_signed(s, &contactData->contactRectTop) || - !rdpei_read_2byte_signed(s, &contactData->contactRectRight) || - !rdpei_read_2byte_signed(s, &contactData->contactRectBottom)) + !rdpei_read_2byte_signed(s, &contactData->contactRectTop) || + !rdpei_read_2byte_signed(s, &contactData->contactRectRight) || + !rdpei_read_2byte_signed(s, &contactData->contactRectBottom)) { WLog_ERR(TAG, "rdpei_read_ failed!"); return ERROR_INTERNAL_ERROR; @@ -226,15 +230,14 @@ static UINT read_touch_contact_data(RdpeiServerContext *context, wStream *s, RDP } if ((contactData->fieldsPresent & CONTACT_DATA_ORIENTATION_PRESENT) && - !rdpei_read_4byte_unsigned(s, &contactData->orientation)) + !rdpei_read_4byte_unsigned(s, &contactData->orientation)) { WLog_ERR(TAG, "rdpei_read_ failed!"); return ERROR_INTERNAL_ERROR; } - if ((contactData->fieldsPresent & CONTACT_DATA_PRESSURE_PRESENT) && - !rdpei_read_4byte_unsigned(s, &contactData->pressure)) + !rdpei_read_4byte_unsigned(s, &contactData->pressure)) { WLog_ERR(TAG, "rdpei_read_ failed!"); return ERROR_INTERNAL_ERROR; @@ -248,13 +251,14 @@ static UINT read_touch_contact_data(RdpeiServerContext *context, wStream *s, RDP * * @return 0 on success, otherwise a Win32 error code */ -static UINT read_touch_frame(RdpeiServerContext *context, wStream *s, RDPINPUT_TOUCH_FRAME *frame) +static UINT read_touch_frame(RdpeiServerContext* context, wStream* s, RDPINPUT_TOUCH_FRAME* frame) { UINT32 i; - RDPINPUT_CONTACT_DATA *contact; + RDPINPUT_CONTACT_DATA* contact; UINT error; - if (!rdpei_read_2byte_unsigned(s, &frame->contactCount) || !rdpei_read_8byte_unsigned(s, &frame->frameOffset)) + if (!rdpei_read_2byte_unsigned(s, &frame->contactCount) || + !rdpei_read_8byte_unsigned(s, &frame->frameOffset)) { WLog_ERR(TAG, "rdpei_read_ failed!"); return ERROR_INTERNAL_ERROR; @@ -271,7 +275,7 @@ static UINT read_touch_frame(RdpeiServerContext *context, wStream *s, RDPINPUT_T { if ((error = read_touch_contact_data(context, s, contact))) { - WLog_ERR(TAG, "read_touch_contact_data failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "read_touch_contact_data failed with error %" PRIu32 "!", error); frame->contactCount = i; touch_frame_reset(frame); return error; @@ -285,15 +289,16 @@ static UINT read_touch_frame(RdpeiServerContext *context, wStream *s, RDPINPUT_T * * @return 0 on success, otherwise a Win32 error code */ -static UINT read_touch_event(RdpeiServerContext *context, wStream *s) +static UINT read_touch_event(RdpeiServerContext* context, wStream* s) { UINT32 frameCount; UINT32 i; - RDPINPUT_TOUCH_EVENT *event = &context->priv->touchEvent; - RDPINPUT_TOUCH_FRAME *frame; + RDPINPUT_TOUCH_EVENT* event = &context->priv->touchEvent; + RDPINPUT_TOUCH_FRAME* frame; UINT error = CHANNEL_RC_OK; - if (!rdpei_read_4byte_unsigned(s, &event->encodeTime) || !rdpei_read_2byte_unsigned(s, &frameCount)) + if (!rdpei_read_4byte_unsigned(s, &event->encodeTime) || + !rdpei_read_2byte_unsigned(s, &frameCount)) { WLog_ERR(TAG, "rdpei_read_ failed!"); return ERROR_INTERNAL_ERROR; @@ -311,29 +316,28 @@ static UINT read_touch_event(RdpeiServerContext *context, wStream *s) { if ((error = read_touch_frame(context, s, frame))) { - WLog_ERR(TAG, "read_touch_contact_data failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "read_touch_contact_data failed with error %" PRIu32 "!", error); event->frameCount = i; goto out_cleanup; } } - IFCALLRET(context->onTouchEvent, error, context, event); if (error) - WLog_ERR(TAG, "context->onTouchEvent failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context->onTouchEvent failed with error %" PRIu32 "", error); out_cleanup: touch_event_reset(event); return error; } - /** * Function description * * @return 0 on success, otherwise a Win32 error code */ -static UINT read_dismiss_hovering_contact(RdpeiServerContext *context, wStream *s) { +static UINT read_dismiss_hovering_contact(RdpeiServerContext* context, wStream* s) +{ BYTE contactId; UINT error = CHANNEL_RC_OK; @@ -347,24 +351,25 @@ static UINT read_dismiss_hovering_contact(RdpeiServerContext *context, wStream * IFCALLRET(context->onTouchReleased, error, context, contactId); if (error) - WLog_ERR(TAG, "context->onTouchReleased failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context->onTouchReleased failed with error %" PRIu32 "", error); return error; } - /** * Function description * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_server_handle_messages(RdpeiServerContext *context) { +UINT rdpei_server_handle_messages(RdpeiServerContext* context) +{ DWORD bytesReturned; - RdpeiServerPrivate *priv = context->priv; - wStream *s = priv->inputStream; + RdpeiServerPrivate* priv = context->priv; + wStream* s = priv->inputStream; UINT error = CHANNEL_RC_OK; - if (!WTSVirtualChannelRead(priv->channelHandle, 0, (PCHAR)Stream_Pointer(s), priv->expectedBytes, &bytesReturned)) + if (!WTSVirtualChannelRead(priv->channelHandle, 0, (PCHAR)Stream_Pointer(s), + priv->expectedBytes, &bytesReturned)) { if (GetLastError() == ERROR_NO_DATA) return ERROR_READ_FAULT; @@ -391,7 +396,7 @@ UINT rdpei_server_handle_messages(RdpeiServerContext *context) { if (pduLen < RDPINPUT_HEADER_LENGTH) { - WLog_ERR(TAG, "invalid pduLength %"PRIu32"", pduLen); + WLog_ERR(TAG, "invalid pduLength %" PRIu32 "", pduLen); return ERROR_INVALID_DATA; } priv->expectedBytes = pduLen - RDPINPUT_HEADER_LENGTH; @@ -411,36 +416,37 @@ UINT rdpei_server_handle_messages(RdpeiServerContext *context) { /* when here we have the header + the body */ switch (priv->currentMsgType) { - case EVENTID_CS_READY: - if (priv->automataState != STATE_WAITING_CLIENT_READY) - { - WLog_ERR(TAG, "not expecting a CS_READY packet in this state(%d)", priv->automataState); - return ERROR_INVALID_STATE; - } + case EVENTID_CS_READY: + if (priv->automataState != STATE_WAITING_CLIENT_READY) + { + WLog_ERR(TAG, "not expecting a CS_READY packet in this state(%d)", + priv->automataState); + return ERROR_INVALID_STATE; + } - if ((error = read_cs_ready_message(context, s))) - { - WLog_ERR(TAG, "read_cs_ready_message failed with error %"PRIu32"", error); - return error; - } - break; + if ((error = read_cs_ready_message(context, s))) + { + WLog_ERR(TAG, "read_cs_ready_message failed with error %" PRIu32 "", error); + return error; + } + break; - case EVENTID_TOUCH: - if ((error = read_touch_event(context, s))) - { - WLog_ERR(TAG, "read_touch_event failed with error %"PRIu32"", error); - return error; - } - break; - case EVENTID_DISMISS_HOVERING_CONTACT: - if ((error = read_dismiss_hovering_contact(context, s))) - { - WLog_ERR(TAG, "read_dismiss_hovering_contact failed with error %"PRIu32"", error); - return error; - } - break; - default: - WLog_ERR(TAG, "unexpected message type 0x%"PRIx16"", priv->currentMsgType); + case EVENTID_TOUCH: + if ((error = read_touch_event(context, s))) + { + WLog_ERR(TAG, "read_touch_event failed with error %" PRIu32 "", error); + return error; + } + break; + case EVENTID_DISMISS_HOVERING_CONTACT: + if ((error = read_dismiss_hovering_contact(context, s))) + { + WLog_ERR(TAG, "read_dismiss_hovering_contact failed with error %" PRIu32 "", error); + return error; + } + break; + default: + WLog_ERR(TAG, "unexpected message type 0x%" PRIx16 "", priv->currentMsgType); } Stream_SetPosition(s, 0); @@ -449,16 +455,15 @@ UINT rdpei_server_handle_messages(RdpeiServerContext *context) { return error; } - /** * Function description * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_server_send_sc_ready(RdpeiServerContext *context, UINT32 version) +UINT rdpei_server_send_sc_ready(RdpeiServerContext* context, UINT32 version) { ULONG written; - RdpeiServerPrivate *priv = context->priv; + RdpeiServerPrivate* priv = context->priv; if (priv->automataState != STATE_INITIAL) { @@ -479,7 +484,7 @@ UINT rdpei_server_send_sc_ready(RdpeiServerContext *context, UINT32 version) Stream_Write_UINT32(priv->outputStream, version); if (!WTSVirtualChannelWrite(priv->channelHandle, (PCHAR)Stream_Buffer(priv->outputStream), - Stream_GetPosition(priv->outputStream), &written)) + Stream_GetPosition(priv->outputStream), &written)) { WLog_ERR(TAG, "WTSVirtualChannelWrite failed!"); return ERROR_INTERNAL_ERROR; @@ -494,21 +499,21 @@ UINT rdpei_server_send_sc_ready(RdpeiServerContext *context, UINT32 version) * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_server_suspend(RdpeiServerContext *context) +UINT rdpei_server_suspend(RdpeiServerContext* context) { ULONG written; - RdpeiServerPrivate *priv = context->priv; + RdpeiServerPrivate* priv = context->priv; switch (priv->automataState) { - case STATE_SUSPENDED: - WLog_ERR(TAG, "already suspended"); - return CHANNEL_RC_OK; - case STATE_WAITING_FRAME: - break; - default: - WLog_ERR(TAG, "called from unexpected state %d", priv->automataState); - return ERROR_INVALID_STATE; + case STATE_SUSPENDED: + WLog_ERR(TAG, "already suspended"); + return CHANNEL_RC_OK; + case STATE_WAITING_FRAME: + break; + default: + WLog_ERR(TAG, "called from unexpected state %d", priv->automataState); + return ERROR_INVALID_STATE; } Stream_SetPosition(priv->outputStream, 0); @@ -522,7 +527,7 @@ UINT rdpei_server_suspend(RdpeiServerContext *context) Stream_Write_UINT32(priv->outputStream, RDPINPUT_HEADER_LENGTH); if (!WTSVirtualChannelWrite(priv->channelHandle, (PCHAR)Stream_Buffer(priv->outputStream), - Stream_GetPosition(priv->outputStream), &written)) + Stream_GetPosition(priv->outputStream), &written)) { WLog_ERR(TAG, "WTSVirtualChannelWrite failed!"); return ERROR_INTERNAL_ERROR; @@ -532,27 +537,26 @@ UINT rdpei_server_suspend(RdpeiServerContext *context) return CHANNEL_RC_OK; } - /** * Function description * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_server_resume(RdpeiServerContext *context) +UINT rdpei_server_resume(RdpeiServerContext* context) { ULONG written; - RdpeiServerPrivate *priv = context->priv; + RdpeiServerPrivate* priv = context->priv; switch (priv->automataState) { - case STATE_WAITING_FRAME: - WLog_ERR(TAG, "not suspended"); - return CHANNEL_RC_OK; - case STATE_SUSPENDED: - break; - default: - WLog_ERR(TAG, "called from unexpected state %d", priv->automataState); - return ERROR_INVALID_STATE; + case STATE_WAITING_FRAME: + WLog_ERR(TAG, "not suspended"); + return CHANNEL_RC_OK; + case STATE_SUSPENDED: + break; + default: + WLog_ERR(TAG, "called from unexpected state %d", priv->automataState); + return ERROR_INVALID_STATE; } Stream_SetPosition(priv->outputStream, 0); @@ -566,7 +570,7 @@ UINT rdpei_server_resume(RdpeiServerContext *context) Stream_Write_UINT32(priv->outputStream, RDPINPUT_HEADER_LENGTH); if (!WTSVirtualChannelWrite(priv->channelHandle, (PCHAR)Stream_Buffer(priv->outputStream), - Stream_GetPosition(priv->outputStream), &written)) + Stream_GetPosition(priv->outputStream), &written)) { WLog_ERR(TAG, "WTSVirtualChannelWrite failed!"); return ERROR_INTERNAL_ERROR; @@ -575,4 +579,3 @@ UINT rdpei_server_resume(RdpeiServerContext *context) priv->automataState = STATE_WAITING_FRAME; return CHANNEL_RC_OK; } - diff --git a/channels/rdpei/server/rdpei_main.h b/channels/rdpei/server/rdpei_main.h index f6505f54d..cf3e3cbb4 100644 --- a/channels/rdpei/server/rdpei_main.h +++ b/channels/rdpei/server/rdpei_main.h @@ -29,7 +29,4 @@ #define TAG CHANNELS_TAG("rdpei.server") - - #endif /* FREERDP_CHANNEL_RDPEI_SERVER_MAIN_H */ - diff --git a/channels/rdpgfx/client/rdpgfx_codec.c b/channels/rdpgfx/client/rdpgfx_codec.c index cf96f44c9..d89278c75 100644 --- a/channels/rdpgfx/client/rdpgfx_codec.c +++ b/channels/rdpgfx/client/rdpgfx_codec.c @@ -39,8 +39,7 @@ * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_read_h264_metablock(RDPGFX_PLUGIN* gfx, wStream* s, - RDPGFX_H264_METABLOCK* meta) +static UINT rdpgfx_read_h264_metablock(RDPGFX_PLUGIN* gfx, wStream* s, RDPGFX_H264_METABLOCK* meta) { UINT32 index; RECTANGLE_16* regionRect; @@ -63,7 +62,7 @@ static UINT rdpgfx_read_h264_metablock(RDPGFX_PLUGIN* gfx, wStream* s, goto error_out; } - meta->regionRects = (RECTANGLE_16*) calloc(meta->numRegionRects, sizeof(RECTANGLE_16)); + meta->regionRects = (RECTANGLE_16*)calloc(meta->numRegionRects, sizeof(RECTANGLE_16)); if (!meta->regionRects) { @@ -72,8 +71,8 @@ static UINT rdpgfx_read_h264_metablock(RDPGFX_PLUGIN* gfx, wStream* s, goto error_out; } - meta->quantQualityVals = (RDPGFX_H264_QUANT_QUALITY*) calloc(meta->numRegionRects, sizeof( - RDPGFX_H264_QUANT_QUALITY)); + meta->quantQualityVals = + (RDPGFX_H264_QUANT_QUALITY*)calloc(meta->numRegionRects, sizeof(RDPGFX_H264_QUANT_QUALITY)); if (!meta->quantQualityVals) { @@ -82,7 +81,7 @@ static UINT rdpgfx_read_h264_metablock(RDPGFX_PLUGIN* gfx, wStream* s, goto error_out; } - WLog_DBG(TAG, "H264_METABLOCK: numRegionRects: %"PRIu32"", meta->numRegionRects); + WLog_DBG(TAG, "H264_METABLOCK: numRegionRects: %" PRIu32 "", meta->numRegionRects); for (index = 0; index < meta->numRegionRects; index++) { @@ -90,12 +89,13 @@ static UINT rdpgfx_read_h264_metablock(RDPGFX_PLUGIN* gfx, wStream* s, if ((error = rdpgfx_read_rect16(s, regionRect))) { - WLog_ERR(TAG, "rdpgfx_read_rect16 failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpgfx_read_rect16 failed with error %" PRIu32 "!", error); goto error_out; } WLog_DBG(TAG, - "regionRects[%"PRIu32"]: left: %"PRIu16" top: %"PRIu16" right: %"PRIu16" bottom: %"PRIu16"", + "regionRects[%" PRIu32 "]: left: %" PRIu16 " top: %" PRIu16 " right: %" PRIu16 + " bottom: %" PRIu16 "", index, regionRect->left, regionRect->top, regionRect->right, regionRect->bottom); } @@ -109,14 +109,16 @@ static UINT rdpgfx_read_h264_metablock(RDPGFX_PLUGIN* gfx, wStream* s, for (index = 0; index < meta->numRegionRects; index++) { quantQualityVal = &(meta->quantQualityVals[index]); - Stream_Read_UINT8(s, quantQualityVal->qpVal); /* qpVal (1 byte) */ + Stream_Read_UINT8(s, quantQualityVal->qpVal); /* qpVal (1 byte) */ Stream_Read_UINT8(s, quantQualityVal->qualityVal); /* qualityVal (1 byte) */ quantQualityVal->qp = quantQualityVal->qpVal & 0x3F; quantQualityVal->r = (quantQualityVal->qpVal >> 6) & 1; quantQualityVal->p = (quantQualityVal->qpVal >> 7) & 1; WLog_DBG(TAG, - "quantQualityVals[%"PRIu32"]: qp: %"PRIu8" r: %"PRIu8" p: %"PRIu8" qualityVal: %"PRIu8"", - index, quantQualityVal->qp, quantQualityVal->r, quantQualityVal->p, quantQualityVal->qualityVal); + "quantQualityVals[%" PRIu32 "]: qp: %" PRIu8 " r: %" PRIu8 " p: %" PRIu8 + " qualityVal: %" PRIu8 "", + index, quantQualityVal->qp, quantQualityVal->r, quantQualityVal->p, + quantQualityVal->qualityVal); } return CHANNEL_RC_OK; @@ -138,7 +140,7 @@ static UINT rdpgfx_decode_AVC420(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd UINT error; wStream* s; RDPGFX_AVC420_BITMAP_STREAM h264; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; s = Stream_New(cmd->data, cmd->length); if (!s) @@ -150,21 +152,21 @@ static UINT rdpgfx_decode_AVC420(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd if ((error = rdpgfx_read_h264_metablock(gfx, s, &(h264.meta)))) { Stream_Free(s, FALSE); - WLog_ERR(TAG, "rdpgfx_read_h264_metablock failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpgfx_read_h264_metablock failed with error %" PRIu32 "!", error); return error; } h264.data = Stream_Pointer(s); - h264.length = (UINT32) Stream_GetRemainingLength(s); + h264.length = (UINT32)Stream_GetRemainingLength(s); Stream_Free(s, FALSE); - cmd->extra = (void*) &h264; + cmd->extra = (void*)&h264; if (context) { IFCALLRET(context->SurfaceCommand, error, context, cmd); if (error) - WLog_ERR(TAG, "context->SurfaceCommand failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context->SurfaceCommand failed with error %" PRIu32 "", error); } free(h264.meta.regionRects); @@ -184,7 +186,7 @@ static UINT rdpgfx_decode_AVC444(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd size_t pos1, pos2; wStream* s; RDPGFX_AVC444_BITMAP_STREAM h264 = { 0 }; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; s = Stream_New(cmd->data, cmd->length); if (!s) @@ -213,7 +215,7 @@ static UINT rdpgfx_decode_AVC444(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd if ((error = rdpgfx_read_h264_metablock(gfx, s, &(h264.bitstream[0].meta)))) { - WLog_ERR(TAG, "rdpgfx_read_h264_metablock failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpgfx_read_h264_metablock failed with error %" PRIu32 "!", error); goto fail; } @@ -235,7 +237,7 @@ static UINT rdpgfx_decode_AVC444(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd if ((error = rdpgfx_read_h264_metablock(gfx, s, &(h264.bitstream[1].meta)))) { - WLog_ERR(TAG, "rdpgfx_read_h264_metablock failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpgfx_read_h264_metablock failed with error %" PRIu32 "!", error); goto fail; } @@ -245,14 +247,14 @@ static UINT rdpgfx_decode_AVC444(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd else h264.bitstream[0].length = Stream_GetRemainingLength(s); - cmd->extra = (void*) &h264; + cmd->extra = (void*)&h264; if (context) { IFCALLRET(context->SurfaceCommand, error, context, cmd); if (error) - WLog_ERR(TAG, "context->SurfaceCommand failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context->SurfaceCommand failed with error %" PRIu32 "", error); } fail: @@ -272,21 +274,21 @@ fail: UINT rdpgfx_decode(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) { UINT error = CHANNEL_RC_OK; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; PROFILER_ENTER(context->SurfaceProfiler) switch (cmd->codecId) { case RDPGFX_CODECID_AVC420: if ((error = rdpgfx_decode_AVC420(gfx, cmd))) - WLog_ERR(TAG, "rdpgfx_decode_AVC420 failed with error %"PRIu32"", error); + WLog_ERR(TAG, "rdpgfx_decode_AVC420 failed with error %" PRIu32 "", error); break; case RDPGFX_CODECID_AVC444: case RDPGFX_CODECID_AVC444v2: if ((error = rdpgfx_decode_AVC444(gfx, cmd))) - WLog_ERR(TAG, "rdpgfx_decode_AVC444 failed with error %"PRIu32"", error); + WLog_ERR(TAG, "rdpgfx_decode_AVC444 failed with error %" PRIu32 "", error); break; @@ -296,7 +298,7 @@ UINT rdpgfx_decode(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) IFCALLRET(context->SurfaceCommand, error, context, cmd); if (error) - WLog_ERR(TAG, "context->SurfaceCommand failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context->SurfaceCommand failed with error %" PRIu32 "", error); } break; diff --git a/channels/rdpgfx/client/rdpgfx_main.c b/channels/rdpgfx/client/rdpgfx_main.c index 00a450ed0..1063c67a5 100644 --- a/channels/rdpgfx/client/rdpgfx_main.c +++ b/channels/rdpgfx/client/rdpgfx_main.c @@ -53,7 +53,7 @@ * @return 0 on success, otherwise a Win32 error code */ static UINT rdpgfx_send_caps_advertise_pdu(RdpgfxClientContext* context, - const RDPGFX_CAPS_ADVERTISE_PDU* pdu) + const RDPGFX_CAPS_ADVERTISE_PDU* pdu) { UINT error = CHANNEL_RC_OK; UINT16 index; @@ -62,7 +62,7 @@ static UINT rdpgfx_send_caps_advertise_pdu(RdpgfxClientContext* context, RDPGFX_PLUGIN* gfx; RDPGFX_CHANNEL_CALLBACK* callback; wStream* s; - gfx = (RDPGFX_PLUGIN*) context->handle; + gfx = (RDPGFX_PLUGIN*)context->handle; callback = gfx->listener_callback->channel_callback; header.flags = 0; header.cmdId = RDPGFX_CMDID_CAPSADVERTISE; @@ -74,7 +74,7 @@ static UINT rdpgfx_send_caps_advertise_pdu(RdpgfxClientContext* context, header.pduLength += RDPGFX_CAPSET_BASE_SIZE + capsSet->length; } - DEBUG_RDPGFX(gfx->log, "SendCapsAdvertisePdu %"PRIu16"", pdu->capsSetCount); + DEBUG_RDPGFX(gfx->log, "SendCapsAdvertisePdu %" PRIu16 "", pdu->capsSetCount); s = Stream_New(NULL, header.pduLength); if (!s) @@ -93,14 +93,14 @@ static UINT rdpgfx_send_caps_advertise_pdu(RdpgfxClientContext* context, { capsSet = &(pdu->capsSets[index]); Stream_Write_UINT32(s, capsSet->version); /* version (4 bytes) */ - Stream_Write_UINT32(s, capsSet->length); /* capsDataLength (4 bytes) */ - Stream_Write_UINT32(s, capsSet->flags); /* capsData (4 bytes) */ + Stream_Write_UINT32(s, capsSet->length); /* capsDataLength (4 bytes) */ + Stream_Write_UINT32(s, capsSet->flags); /* capsData (4 bytes) */ Stream_Zero(s, capsSet->length - 4); } Stream_SealLength(s); - error = callback->channel->Write(callback->channel, (UINT32) Stream_Length(s), - Stream_Buffer(s), NULL); + error = callback->channel->Write(callback->channel, (UINT32)Stream_Length(s), Stream_Buffer(s), + NULL); fail: Stream_Free(s, TRUE); return error; @@ -109,17 +109,10 @@ fail: static BOOL rdpgfx_is_capability_filtered(RDPGFX_PLUGIN* gfx, UINT32 caps) { const UINT32 filter = gfx->capsFilter; - const UINT32 capList[] = - { - RDPGFX_CAPVERSION_8, - RDPGFX_CAPVERSION_81, - RDPGFX_CAPVERSION_10, - RDPGFX_CAPVERSION_101, - RDPGFX_CAPVERSION_102, - RDPGFX_CAPVERSION_103, - RDPGFX_CAPVERSION_104, - RDPGFX_CAPVERSION_105, - RDPGFX_CAPVERSION_106 + const UINT32 capList[] = { + RDPGFX_CAPVERSION_8, RDPGFX_CAPVERSION_81, RDPGFX_CAPVERSION_10, + RDPGFX_CAPVERSION_101, RDPGFX_CAPVERSION_102, RDPGFX_CAPVERSION_103, + RDPGFX_CAPVERSION_104, RDPGFX_CAPVERSION_105, RDPGFX_CAPVERSION_106 }; UINT32 x; @@ -148,18 +141,18 @@ static UINT rdpgfx_send_supported_caps(RDPGFX_CHANNEL_CALLBACK* callback) if (!callback) return ERROR_BAD_ARGUMENTS; - gfx = (RDPGFX_PLUGIN*) callback->plugin; + gfx = (RDPGFX_PLUGIN*)callback->plugin; if (!gfx) return ERROR_BAD_CONFIGURATION; - context = (RdpgfxClientContext*) gfx->iface.pInterface; + context = (RdpgfxClientContext*)gfx->iface.pInterface; if (!context) return ERROR_BAD_CONFIGURATION; pdu.capsSetCount = 0; - pdu.capsSets = (RDPGFX_CAPSET*) capsSets; + pdu.capsSets = (RDPGFX_CAPSET*)capsSets; if (!rdpgfx_is_capability_filtered(gfx, RDPGFX_CAPVERSION_8)) { @@ -286,13 +279,12 @@ static UINT rdpgfx_send_supported_caps(RDPGFX_CHANNEL_CALLBACK* callback) * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_caps_confirm_pdu(RDPGFX_CHANNEL_CALLBACK* callback, - wStream* s) +static UINT rdpgfx_recv_caps_confirm_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_CAPSET capsSet; RDPGFX_CAPS_CONFIRM_PDU pdu; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; pdu.capsSet = &capsSet; if (Stream_GetRemainingLength(s) < 12) @@ -302,11 +294,11 @@ static UINT rdpgfx_recv_caps_confirm_pdu(RDPGFX_CHANNEL_CALLBACK* callback, } Stream_Read_UINT32(s, capsSet.version); /* version (4 bytes) */ - Stream_Read_UINT32(s, capsSet.length); /* capsDataLength (4 bytes) */ - Stream_Read_UINT32(s, capsSet.flags); /* capsData (4 bytes) */ + Stream_Read_UINT32(s, capsSet.length); /* capsDataLength (4 bytes) */ + Stream_Read_UINT32(s, capsSet.flags); /* capsData (4 bytes) */ gfx->ConnectionCaps = capsSet; - DEBUG_RDPGFX(gfx->log, "RecvCapsConfirmPdu: version: 0x%08"PRIX32" flags: 0x%08"PRIX32"", - capsSet.version, capsSet.flags); + DEBUG_RDPGFX(gfx->log, "RecvCapsConfirmPdu: version: 0x%08" PRIX32 " flags: 0x%08" PRIX32 "", + capsSet.version, capsSet.flags); if (!context) return ERROR_BAD_CONFIGURATION; @@ -320,7 +312,7 @@ static UINT rdpgfx_recv_caps_confirm_pdu(RDPGFX_CHANNEL_CALLBACK* callback, * @return 0 on success, otherwise a Win32 error code */ static UINT rdpgfx_send_frame_acknowledge_pdu(RdpgfxClientContext* context, - const RDPGFX_FRAME_ACKNOWLEDGE_PDU* pdu) + const RDPGFX_FRAME_ACKNOWLEDGE_PDU* pdu) { UINT error; wStream* s; @@ -331,7 +323,7 @@ static UINT rdpgfx_send_frame_acknowledge_pdu(RdpgfxClientContext* context, if (!context || !pdu) return ERROR_BAD_ARGUMENTS; - gfx = (RDPGFX_PLUGIN*) context->handle; + gfx = (RDPGFX_PLUGIN*)context->handle; if (!gfx) return ERROR_BAD_CONFIGURATION; @@ -344,7 +336,7 @@ static UINT rdpgfx_send_frame_acknowledge_pdu(RdpgfxClientContext* context, header.flags = 0; header.cmdId = RDPGFX_CMDID_FRAMEACKNOWLEDGE; header.pduLength = RDPGFX_HEADER_SIZE + 12; - DEBUG_RDPGFX(gfx->log, "SendFrameAcknowledgePdu: %"PRIu32"", pdu->frameId); + DEBUG_RDPGFX(gfx->log, "SendFrameAcknowledgePdu: %" PRIu32 "", pdu->frameId); s = Stream_New(NULL, header.pduLength); if (!s) @@ -357,12 +349,11 @@ static UINT rdpgfx_send_frame_acknowledge_pdu(RdpgfxClientContext* context, goto fail; /* RDPGFX_FRAME_ACKNOWLEDGE_PDU */ - Stream_Write_UINT32(s, pdu->queueDepth); /* queueDepth (4 bytes) */ - Stream_Write_UINT32(s, pdu->frameId); /* frameId (4 bytes) */ - Stream_Write_UINT32(s, - pdu->totalFramesDecoded); /* totalFramesDecoded (4 bytes) */ - error = callback->channel->Write(callback->channel, (UINT32) Stream_Length(s), - Stream_Buffer(s), NULL); + Stream_Write_UINT32(s, pdu->queueDepth); /* queueDepth (4 bytes) */ + Stream_Write_UINT32(s, pdu->frameId); /* frameId (4 bytes) */ + Stream_Write_UINT32(s, pdu->totalFramesDecoded); /* totalFramesDecoded (4 bytes) */ + error = callback->channel->Write(callback->channel, (UINT32)Stream_Length(s), Stream_Buffer(s), + NULL); if (error == CHANNEL_RC_OK) /* frame successfully acked */ gfx->UnacknowledgedFrames--; @@ -373,7 +364,7 @@ fail: } static UINT rdpgfx_send_qoe_frame_acknowledge_pdu(RdpgfxClientContext* context, - const RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU* pdu) + const RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU* pdu) { UINT error; wStream* s; @@ -387,7 +378,7 @@ static UINT rdpgfx_send_qoe_frame_acknowledge_pdu(RdpgfxClientContext* context, if (!context || !pdu) return ERROR_BAD_ARGUMENTS; - gfx = (RDPGFX_PLUGIN*) context->handle; + gfx = (RDPGFX_PLUGIN*)context->handle; if (!gfx) return ERROR_BAD_CONFIGURATION; @@ -397,7 +388,7 @@ static UINT rdpgfx_send_qoe_frame_acknowledge_pdu(RdpgfxClientContext* context, if (!callback) return ERROR_BAD_CONFIGURATION; - DEBUG_RDPGFX(gfx->log, "SendQoeFrameAcknowledgePdu: %"PRIu32"", pdu->frameId); + DEBUG_RDPGFX(gfx->log, "SendQoeFrameAcknowledgePdu: %" PRIu32 "", pdu->frameId); s = Stream_New(NULL, header.pduLength); if (!s) @@ -414,8 +405,8 @@ static UINT rdpgfx_send_qoe_frame_acknowledge_pdu(RdpgfxClientContext* context, Stream_Write_UINT32(s, pdu->timestamp); Stream_Write_UINT16(s, pdu->timeDiffSE); Stream_Write_UINT16(s, pdu->timeDiffEDR); - error = callback->channel->Write(callback->channel, (UINT32) Stream_Length(s), - Stream_Buffer(s), NULL); + error = callback->channel->Write(callback->channel, (UINT32)Stream_Length(s), Stream_Buffer(s), + NULL); fail: Stream_Free(s, TRUE); return error; @@ -427,7 +418,7 @@ fail: * @return 0 on success, otherwise a Win32 error code */ static UINT rdpgfx_send_cache_import_offer_pdu(RdpgfxClientContext* context, - const RDPGFX_CACHE_IMPORT_OFFER_PDU* pdu) + const RDPGFX_CACHE_IMPORT_OFFER_PDU* pdu) { UINT16 index; UINT error = CHANNEL_RC_OK; @@ -440,7 +431,7 @@ static UINT rdpgfx_send_cache_import_offer_pdu(RdpgfxClientContext* context, if (!context || !pdu) return ERROR_BAD_ARGUMENTS; - gfx = (RDPGFX_PLUGIN*) context->handle; + gfx = (RDPGFX_PLUGIN*)context->handle; if (!gfx) return ERROR_BAD_CONFIGURATION; @@ -453,9 +444,10 @@ static UINT rdpgfx_send_cache_import_offer_pdu(RdpgfxClientContext* context, header.flags = 0; header.cmdId = RDPGFX_CMDID_CACHEIMPORTOFFER; header.pduLength = RDPGFX_HEADER_SIZE + 2 + pdu->cacheEntriesCount * 12; - DEBUG_RDPGFX(gfx->log, "SendCacheImportOfferPdu: cacheEntriesCount: %"PRIu16"", pdu->cacheEntriesCount); + DEBUG_RDPGFX(gfx->log, "SendCacheImportOfferPdu: cacheEntriesCount: %" PRIu16 "", + pdu->cacheEntriesCount); s = Stream_New(NULL, header.pduLength); - + if (!s) { WLog_ERR(TAG, "Stream_New failed!"); @@ -467,7 +459,7 @@ static UINT rdpgfx_send_cache_import_offer_pdu(RdpgfxClientContext* context, if (pdu->cacheEntriesCount <= 0) { - WLog_ERR(TAG, "Invalid cacheEntriesCount: %"PRIu16"", pdu->cacheEntriesCount); + WLog_ERR(TAG, "Invalid cacheEntriesCount: %" PRIu16 "", pdu->cacheEntriesCount); error = ERROR_INVALID_DATA; goto fail; } @@ -478,12 +470,12 @@ static UINT rdpgfx_send_cache_import_offer_pdu(RdpgfxClientContext* context, for (index = 0; index < pdu->cacheEntriesCount; index++) { cacheEntries = &(pdu->cacheEntries[index]); - Stream_Write_UINT64(s, cacheEntries->cacheKey); /* cacheKey (8 bytes) */ + Stream_Write_UINT64(s, cacheEntries->cacheKey); /* cacheKey (8 bytes) */ Stream_Write_UINT32(s, cacheEntries->bitmapLength); /* bitmapLength (4 bytes) */ } - error = callback->channel->Write(callback->channel, (UINT32) Stream_Length(s), - Stream_Buffer(s), NULL); + error = callback->channel->Write(callback->channel, (UINT32)Stream_Length(s), Stream_Buffer(s), + NULL); fail: Stream_Free(s, TRUE); @@ -495,15 +487,14 @@ fail: * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_reset_graphics_pdu(RDPGFX_CHANNEL_CALLBACK* callback, - wStream* s) +static UINT rdpgfx_recv_reset_graphics_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { int pad; UINT32 index; MONITOR_DEF* monitor; RDPGFX_RESET_GRAPHICS_PDU pdu; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error = CHANNEL_RC_OK; GraphicsResetEventArgs graphicsReset; @@ -513,8 +504,8 @@ static UINT rdpgfx_recv_reset_graphics_pdu(RDPGFX_CHANNEL_CALLBACK* callback, return ERROR_INVALID_DATA; } - Stream_Read_UINT32(s, pdu.width); /* width (4 bytes) */ - Stream_Read_UINT32(s, pdu.height); /* height (4 bytes) */ + Stream_Read_UINT32(s, pdu.width); /* width (4 bytes) */ + Stream_Read_UINT32(s, pdu.height); /* height (4 bytes) */ Stream_Read_UINT32(s, pdu.monitorCount); /* monitorCount (4 bytes) */ if (Stream_GetRemainingLength(s) < (pdu.monitorCount * 20)) @@ -523,7 +514,7 @@ static UINT rdpgfx_recv_reset_graphics_pdu(RDPGFX_CHANNEL_CALLBACK* callback, return ERROR_INVALID_DATA; } - pdu.monitorDefArray = (MONITOR_DEF*) calloc(pdu.monitorCount, sizeof(MONITOR_DEF)); + pdu.monitorDefArray = (MONITOR_DEF*)calloc(pdu.monitorCount, sizeof(MONITOR_DEF)); if (!pdu.monitorDefArray) { @@ -534,16 +525,16 @@ static UINT rdpgfx_recv_reset_graphics_pdu(RDPGFX_CHANNEL_CALLBACK* callback, for (index = 0; index < pdu.monitorCount; index++) { monitor = &(pdu.monitorDefArray[index]); - Stream_Read_UINT32(s, monitor->left); /* left (4 bytes) */ - Stream_Read_UINT32(s, monitor->top); /* top (4 bytes) */ - Stream_Read_UINT32(s, monitor->right); /* right (4 bytes) */ + Stream_Read_UINT32(s, monitor->left); /* left (4 bytes) */ + Stream_Read_UINT32(s, monitor->top); /* top (4 bytes) */ + Stream_Read_UINT32(s, monitor->right); /* right (4 bytes) */ Stream_Read_UINT32(s, monitor->bottom); /* bottom (4 bytes) */ - Stream_Read_UINT32(s, monitor->flags); /* flags (4 bytes) */ + Stream_Read_UINT32(s, monitor->flags); /* flags (4 bytes) */ } pad = 340 - (RDPGFX_HEADER_SIZE + 12 + (pdu.monitorCount * 20)); - if (Stream_GetRemainingLength(s) < (size_t) pad) + if (Stream_GetRemainingLength(s) < (size_t)pad) { WLog_Print(gfx->log, WLOG_ERROR, "Stream_GetRemainingLength failed!"); free(pdu.monitorDefArray); @@ -551,14 +542,17 @@ static UINT rdpgfx_recv_reset_graphics_pdu(RDPGFX_CHANNEL_CALLBACK* callback, } Stream_Seek(s, pad); /* pad (total size is 340 bytes) */ - DEBUG_RDPGFX(gfx->log, "RecvResetGraphicsPdu: width: %"PRIu32" height: %"PRIu32" count: %"PRIu32"", - pdu.width, pdu.height, pdu.monitorCount); + DEBUG_RDPGFX(gfx->log, + "RecvResetGraphicsPdu: width: %" PRIu32 " height: %" PRIu32 " count: %" PRIu32 "", + pdu.width, pdu.height, pdu.monitorCount); for (index = 0; index < pdu.monitorCount; index++) { monitor = &(pdu.monitorDefArray[index]); - DEBUG_RDPGFX(gfx->log, "RecvResetGraphicsPdu: monitor left:%"PRIi32" top:%"PRIi32" right:%"PRIi32" left:%"PRIi32" flags:0x%"PRIx32"", - monitor->left, monitor->top, monitor->right, monitor->bottom, monitor->flags); + DEBUG_RDPGFX(gfx->log, + "RecvResetGraphicsPdu: monitor left:%" PRIi32 " top:%" PRIi32 " right:%" PRIi32 + " left:%" PRIi32 " flags:0x%" PRIx32 "", + monitor->left, monitor->top, monitor->right, monitor->bottom, monitor->flags); } if (context) @@ -566,7 +560,8 @@ static UINT rdpgfx_recv_reset_graphics_pdu(RDPGFX_CHANNEL_CALLBACK* callback, IFCALLRET(context->ResetGraphics, error, context, &pdu); if (error) - WLog_Print(gfx->log, WLOG_ERROR, "context->ResetGraphics failed with error %"PRIu32"", error); + WLog_Print(gfx->log, WLOG_ERROR, "context->ResetGraphics failed with error %" PRIu32 "", + error); } /* some listeners may be interested (namely the display channel) */ @@ -583,12 +578,11 @@ static UINT rdpgfx_recv_reset_graphics_pdu(RDPGFX_CHANNEL_CALLBACK* callback, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_evict_cache_entry_pdu(RDPGFX_CHANNEL_CALLBACK* callback, - wStream* s) +static UINT rdpgfx_recv_evict_cache_entry_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_EVICT_CACHE_ENTRY_PDU pdu; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 2) @@ -598,14 +592,16 @@ static UINT rdpgfx_recv_evict_cache_entry_pdu(RDPGFX_CHANNEL_CALLBACK* callback, } Stream_Read_UINT16(s, pdu.cacheSlot); /* cacheSlot (2 bytes) */ - WLog_Print(gfx->log, WLOG_DEBUG, "RecvEvictCacheEntryPdu: cacheSlot: %"PRIu16"", pdu.cacheSlot); + WLog_Print(gfx->log, WLOG_DEBUG, "RecvEvictCacheEntryPdu: cacheSlot: %" PRIu16 "", + pdu.cacheSlot); if (context) { IFCALLRET(context->EvictCacheEntry, error, context, &pdu); if (error) - WLog_Print(gfx->log, WLOG_ERROR, "context->EvictCacheEntry failed with error %"PRIu32"", error); + WLog_Print(gfx->log, WLOG_ERROR, + "context->EvictCacheEntry failed with error %" PRIu32 "", error); } return error; @@ -616,13 +612,12 @@ static UINT rdpgfx_recv_evict_cache_entry_pdu(RDPGFX_CHANNEL_CALLBACK* callback, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_cache_import_reply_pdu(RDPGFX_CHANNEL_CALLBACK* callback, - wStream* s) +static UINT rdpgfx_recv_cache_import_reply_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { UINT16 index; RDPGFX_CACHE_IMPORT_REPLY_PDU pdu; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 2) @@ -639,7 +634,7 @@ static UINT rdpgfx_recv_cache_import_reply_pdu(RDPGFX_CHANNEL_CALLBACK* callback return ERROR_INVALID_DATA; } - pdu.cacheSlots = (UINT16*) calloc(pdu.importedEntriesCount, sizeof(UINT16)); + pdu.cacheSlots = (UINT16*)calloc(pdu.importedEntriesCount, sizeof(UINT16)); if (!pdu.cacheSlots) { @@ -652,15 +647,16 @@ static UINT rdpgfx_recv_cache_import_reply_pdu(RDPGFX_CHANNEL_CALLBACK* callback Stream_Read_UINT16(s, pdu.cacheSlots[index]); /* cacheSlot (2 bytes) */ } - DEBUG_RDPGFX(gfx->log, "RecvCacheImportReplyPdu: importedEntriesCount: %"PRIu16"", - pdu.importedEntriesCount); + DEBUG_RDPGFX(gfx->log, "RecvCacheImportReplyPdu: importedEntriesCount: %" PRIu16 "", + pdu.importedEntriesCount); if (context) { IFCALLRET(context->CacheImportReply, error, context, &pdu); if (error) - WLog_Print(gfx->log, WLOG_ERROR, "context->CacheImportReply failed with error %"PRIu32"", error); + WLog_Print(gfx->log, WLOG_ERROR, + "context->CacheImportReply failed with error %" PRIu32 "", error); } free(pdu.cacheSlots); @@ -672,12 +668,11 @@ static UINT rdpgfx_recv_cache_import_reply_pdu(RDPGFX_CHANNEL_CALLBACK* callback * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_create_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, - wStream* s) +static UINT rdpgfx_recv_create_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_CREATE_SURFACE_PDU pdu; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 7) @@ -686,19 +681,22 @@ static UINT rdpgfx_recv_create_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, return ERROR_INVALID_DATA; } - Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ - Stream_Read_UINT16(s, pdu.width); /* width (2 bytes) */ - Stream_Read_UINT16(s, pdu.height); /* height (2 bytes) */ + Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ + Stream_Read_UINT16(s, pdu.width); /* width (2 bytes) */ + Stream_Read_UINT16(s, pdu.height); /* height (2 bytes) */ Stream_Read_UINT8(s, pdu.pixelFormat); /* RDPGFX_PIXELFORMAT (1 byte) */ - DEBUG_RDPGFX(gfx->log, "RecvCreateSurfacePdu: surfaceId: %"PRIu16" width: %"PRIu16" height: %"PRIu16" pixelFormat: 0x%02"PRIX8"", - pdu.surfaceId, pdu.width, pdu.height, pdu.pixelFormat); + DEBUG_RDPGFX(gfx->log, + "RecvCreateSurfacePdu: surfaceId: %" PRIu16 " width: %" PRIu16 " height: %" PRIu16 + " pixelFormat: 0x%02" PRIX8 "", + pdu.surfaceId, pdu.width, pdu.height, pdu.pixelFormat); if (context) { IFCALLRET(context->CreateSurface, error, context, &pdu); if (error) - WLog_Print(gfx->log, WLOG_ERROR, "context->CreateSurface failed with error %"PRIu32"", error); + WLog_Print(gfx->log, WLOG_ERROR, "context->CreateSurface failed with error %" PRIu32 "", + error); } return error; @@ -709,12 +707,11 @@ static UINT rdpgfx_recv_create_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_delete_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, - wStream* s) +static UINT rdpgfx_recv_delete_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_DELETE_SURFACE_PDU pdu; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 2) @@ -724,14 +721,15 @@ static UINT rdpgfx_recv_delete_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, } Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ - DEBUG_RDPGFX(gfx->log, "RecvDeleteSurfacePdu: surfaceId: %"PRIu16"", pdu.surfaceId); + DEBUG_RDPGFX(gfx->log, "RecvDeleteSurfacePdu: surfaceId: %" PRIu16 "", pdu.surfaceId); if (context) { IFCALLRET(context->DeleteSurface, error, context, &pdu); if (error) - WLog_Print(gfx->log, WLOG_ERROR, "context->DeleteSurface failed with error %"PRIu32"", error); + WLog_Print(gfx->log, WLOG_ERROR, "context->DeleteSurface failed with error %" PRIu32 "", + error); } return error; @@ -742,12 +740,11 @@ static UINT rdpgfx_recv_delete_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_start_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, - wStream* s) +static UINT rdpgfx_recv_start_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_START_FRAME_PDU pdu; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < RDPGFX_START_FRAME_PDU_SIZE) @@ -757,9 +754,9 @@ static UINT rdpgfx_recv_start_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, } Stream_Read_UINT32(s, pdu.timestamp); /* timestamp (4 bytes) */ - Stream_Read_UINT32(s, pdu.frameId); /* frameId (4 bytes) */ - DEBUG_RDPGFX(gfx->log, "RecvStartFramePdu: frameId: %"PRIu32" timestamp: 0x%08"PRIX32"", - pdu.frameId, pdu.timestamp); + Stream_Read_UINT32(s, pdu.frameId); /* frameId (4 bytes) */ + DEBUG_RDPGFX(gfx->log, "RecvStartFramePdu: frameId: %" PRIu32 " timestamp: 0x%08" PRIX32 "", + pdu.frameId, pdu.timestamp); gfx->StartDecodingTime = GetTickCount64(); if (context) @@ -767,7 +764,8 @@ static UINT rdpgfx_recv_start_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, IFCALLRET(context->StartFrame, error, context, &pdu); if (error) - WLog_Print(gfx->log, WLOG_ERROR, "context->StartFrame failed with error %"PRIu32"", error); + WLog_Print(gfx->log, WLOG_ERROR, "context->StartFrame failed with error %" PRIu32 "", + error); } gfx->UnacknowledgedFrames++; @@ -779,13 +777,12 @@ static UINT rdpgfx_recv_start_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_end_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, - wStream* s) +static UINT rdpgfx_recv_end_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_END_FRAME_PDU pdu; RDPGFX_FRAME_ACKNOWLEDGE_PDU ack; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < RDPGFX_END_FRAME_PDU_SIZE) @@ -795,7 +792,7 @@ static UINT rdpgfx_recv_end_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, } Stream_Read_UINT32(s, pdu.frameId); /* frameId (4 bytes) */ - DEBUG_RDPGFX(gfx->log, "RecvEndFramePdu: frameId: %"PRIu32"", pdu.frameId); + DEBUG_RDPGFX(gfx->log, "RecvEndFramePdu: frameId: %" PRIu32 "", pdu.frameId); if (context) { @@ -803,7 +800,8 @@ static UINT rdpgfx_recv_end_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, if (error) { - WLog_Print(gfx->log, WLOG_ERROR, "context->EndFrame failed with error %"PRIu32"", error); + WLog_Print(gfx->log, WLOG_ERROR, "context->EndFrame failed with error %" PRIu32 "", + error); return error; } } @@ -822,16 +820,17 @@ static UINT rdpgfx_recv_end_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, if (gfx->TotalDecodedFrames == 1) if ((error = rdpgfx_send_frame_acknowledge_pdu(context, &ack))) - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_send_frame_acknowledge_pdu failed with error %"PRIu32"", - error); + WLog_Print(gfx->log, WLOG_ERROR, + "rdpgfx_send_frame_acknowledge_pdu failed with error %" PRIu32 "", + error); } else { ack.queueDepth = QUEUE_DEPTH_UNAVAILABLE; if ((error = rdpgfx_send_frame_acknowledge_pdu(context, &ack))) - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_send_frame_acknowledge_pdu failed with error %"PRIu32"", - error); + WLog_Print(gfx->log, WLOG_ERROR, + "rdpgfx_send_frame_acknowledge_pdu failed with error %" PRIu32 "", error); } switch (gfx->ConnectionCaps.version) @@ -857,7 +856,8 @@ static UINT rdpgfx_recv_end_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, if ((error = rdpgfx_send_qoe_frame_acknowledge_pdu(context, &qoe))) WLog_Print(gfx->log, WLOG_ERROR, - "rdpgfx_send_qoe_frame_acknowledge_pdu failed with error %"PRIu32"", + "rdpgfx_send_qoe_frame_acknowledge_pdu failed with error %" PRIu32 + "", error); } @@ -875,12 +875,11 @@ static UINT rdpgfx_recv_end_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_wire_to_surface_1_pdu(RDPGFX_CHANNEL_CALLBACK* callback, - wStream* s) +static UINT rdpgfx_recv_wire_to_surface_1_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_SURFACE_COMMAND cmd; RDPGFX_WIRE_TO_SURFACE_PDU_1 pdu; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; UINT error; if (Stream_GetRemainingLength(s) < RDPGFX_WIRE_TO_SURFACE_PDU_1_SIZE) @@ -889,13 +888,13 @@ static UINT rdpgfx_recv_wire_to_surface_1_pdu(RDPGFX_CHANNEL_CALLBACK* callback, return ERROR_INVALID_DATA; } - Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ - Stream_Read_UINT16(s, pdu.codecId); /* codecId (2 bytes) */ + Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ + Stream_Read_UINT16(s, pdu.codecId); /* codecId (2 bytes) */ Stream_Read_UINT8(s, pdu.pixelFormat); /* pixelFormat (1 byte) */ if ((error = rdpgfx_read_rect16(s, &(pdu.destRect)))) /* destRect (8 bytes) */ { - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_read_rect16 failed with error %"PRIu32"", error); + WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_read_rect16 failed with error %" PRIu32 "", error); return error; } @@ -910,13 +909,14 @@ static UINT rdpgfx_recv_wire_to_surface_1_pdu(RDPGFX_CHANNEL_CALLBACK* callback, pdu.bitmapData = Stream_Pointer(s); Stream_Seek(s, pdu.bitmapDataLength); - DEBUG_RDPGFX(gfx->log, "RecvWireToSurface1Pdu: surfaceId: %"PRIu16" codecId: %s (0x%04"PRIX16") pixelFormat: 0x%02"PRIX8" " - "destRect: left: %"PRIu16" top: %"PRIu16" right: %"PRIu16" bottom: %"PRIu16" bitmapDataLength: %"PRIu32"", - pdu.surfaceId, rdpgfx_get_codec_id_string(pdu.codecId), - pdu.codecId, pdu.pixelFormat, - pdu.destRect.left, pdu.destRect.top, - pdu.destRect.right, pdu.destRect.bottom, - pdu.bitmapDataLength); + DEBUG_RDPGFX(gfx->log, + "RecvWireToSurface1Pdu: surfaceId: %" PRIu16 " codecId: %s (0x%04" PRIX16 + ") pixelFormat: 0x%02" PRIX8 " " + "destRect: left: %" PRIu16 " top: %" PRIu16 " right: %" PRIu16 " bottom: %" PRIu16 + " bitmapDataLength: %" PRIu32 "", + pdu.surfaceId, rdpgfx_get_codec_id_string(pdu.codecId), pdu.codecId, + pdu.pixelFormat, pdu.destRect.left, pdu.destRect.top, pdu.destRect.right, + pdu.destRect.bottom, pdu.bitmapDataLength); cmd.surfaceId = pdu.surfaceId; cmd.codecId = pdu.codecId; cmd.contextId = 0; @@ -946,7 +946,7 @@ static UINT rdpgfx_recv_wire_to_surface_1_pdu(RDPGFX_CHANNEL_CALLBACK* callback, cmd.extra = NULL; if ((error = rdpgfx_decode(gfx, &cmd))) - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_decode failed with error %"PRIu32"!", error); + WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_decode failed with error %" PRIu32 "!", error); return error; } @@ -956,13 +956,12 @@ static UINT rdpgfx_recv_wire_to_surface_1_pdu(RDPGFX_CHANNEL_CALLBACK* callback, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_wire_to_surface_2_pdu(RDPGFX_CHANNEL_CALLBACK* callback, - wStream* s) +static UINT rdpgfx_recv_wire_to_surface_2_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_SURFACE_COMMAND cmd; RDPGFX_WIRE_TO_SURFACE_PDU_2 pdu; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < RDPGFX_WIRE_TO_SURFACE_PDU_2_SIZE) @@ -971,18 +970,19 @@ static UINT rdpgfx_recv_wire_to_surface_2_pdu(RDPGFX_CHANNEL_CALLBACK* callback, return ERROR_INVALID_DATA; } - Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ - Stream_Read_UINT16(s, pdu.codecId); /* codecId (2 bytes) */ - Stream_Read_UINT32(s, pdu.codecContextId); /* codecContextId (4 bytes) */ - Stream_Read_UINT8(s, pdu.pixelFormat); /* pixelFormat (1 byte) */ + Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ + Stream_Read_UINT16(s, pdu.codecId); /* codecId (2 bytes) */ + Stream_Read_UINT32(s, pdu.codecContextId); /* codecContextId (4 bytes) */ + Stream_Read_UINT8(s, pdu.pixelFormat); /* pixelFormat (1 byte) */ Stream_Read_UINT32(s, pdu.bitmapDataLength); /* bitmapDataLength (4 bytes) */ pdu.bitmapData = Stream_Pointer(s); Stream_Seek(s, pdu.bitmapDataLength); - DEBUG_RDPGFX(gfx->log, - "RecvWireToSurface2Pdu: surfaceId: %"PRIu16" codecId: %s (0x%04"PRIX16") " - "codecContextId: %"PRIu32" pixelFormat: 0x%02"PRIX8" bitmapDataLength: %"PRIu32"", - pdu.surfaceId, rdpgfx_get_codec_id_string(pdu.codecId), pdu.codecId, - pdu.codecContextId, pdu.pixelFormat, pdu.bitmapDataLength); + DEBUG_RDPGFX(gfx->log, + "RecvWireToSurface2Pdu: surfaceId: %" PRIu16 " codecId: %s (0x%04" PRIX16 ") " + "codecContextId: %" PRIu32 " pixelFormat: 0x%02" PRIX8 + " bitmapDataLength: %" PRIu32 "", + pdu.surfaceId, rdpgfx_get_codec_id_string(pdu.codecId), pdu.codecId, + pdu.codecContextId, pdu.pixelFormat, pdu.bitmapDataLength); cmd.surfaceId = pdu.surfaceId; cmd.codecId = pdu.codecId; @@ -1017,7 +1017,8 @@ static UINT rdpgfx_recv_wire_to_surface_2_pdu(RDPGFX_CHANNEL_CALLBACK* callback, IFCALLRET(context->SurfaceCommand, error, context, &cmd); if (error) - WLog_Print(gfx->log, WLOG_ERROR, "context->SurfaceCommand failed with error %"PRIu32"", error); + WLog_Print(gfx->log, WLOG_ERROR, + "context->SurfaceCommand failed with error %" PRIu32 "", error); } return error; @@ -1028,12 +1029,11 @@ static UINT rdpgfx_recv_wire_to_surface_2_pdu(RDPGFX_CHANNEL_CALLBACK* callback, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_delete_encoding_context_pdu(RDPGFX_CHANNEL_CALLBACK* - callback, wStream* s) +static UINT rdpgfx_recv_delete_encoding_context_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_DELETE_ENCODING_CONTEXT_PDU pdu; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 6) @@ -1042,19 +1042,20 @@ static UINT rdpgfx_recv_delete_encoding_context_pdu(RDPGFX_CHANNEL_CALLBACK* return ERROR_INVALID_DATA; } - Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ + Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ Stream_Read_UINT32(s, pdu.codecContextId); /* codecContextId (4 bytes) */ - DEBUG_RDPGFX(gfx->log, "RecvDeleteEncodingContextPdu: surfaceId: %"PRIu16" codecContextId: %"PRIu32"", - pdu.surfaceId, pdu.codecContextId); + DEBUG_RDPGFX(gfx->log, + "RecvDeleteEncodingContextPdu: surfaceId: %" PRIu16 " codecContextId: %" PRIu32 "", + pdu.surfaceId, pdu.codecContextId); if (context) { IFCALLRET(context->DeleteEncodingContext, error, context, &pdu); if (error) - WLog_Print(gfx->log, WLOG_ERROR, "context->DeleteEncodingContext failed with error %"PRIu32"", - error); + WLog_Print(gfx->log, WLOG_ERROR, + "context->DeleteEncodingContext failed with error %" PRIu32 "", error); } return error; @@ -1070,8 +1071,8 @@ static UINT rdpgfx_recv_solid_fill_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStrea UINT16 index; RECTANGLE_16* fillRect; RDPGFX_SOLID_FILL_PDU pdu; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error; if (Stream_GetRemainingLength(s) < 8) @@ -1084,7 +1085,8 @@ static UINT rdpgfx_recv_solid_fill_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStrea if ((error = rdpgfx_read_color32(s, &(pdu.fillPixel)))) /* fillPixel (4 bytes) */ { - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_read_color32 failed with error %"PRIu32"!", error); + WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_read_color32 failed with error %" PRIu32 "!", + error); return error; } @@ -1096,7 +1098,7 @@ static UINT rdpgfx_recv_solid_fill_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStrea return ERROR_INVALID_DATA; } - pdu.fillRects = (RECTANGLE_16*) calloc(pdu.fillRectCount, sizeof(RECTANGLE_16)); + pdu.fillRects = (RECTANGLE_16*)calloc(pdu.fillRectCount, sizeof(RECTANGLE_16)); if (!pdu.fillRects) { @@ -1110,20 +1112,22 @@ static UINT rdpgfx_recv_solid_fill_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStrea if ((error = rdpgfx_read_rect16(s, fillRect))) { - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_read_rect16 failed with error %"PRIu32"!", error); + WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_read_rect16 failed with error %" PRIu32 "!", + error); free(pdu.fillRects); return error; } } - DEBUG_RDPGFX(gfx->log, "RecvSolidFillPdu: surfaceId: %"PRIu16" fillRectCount: %"PRIu16"", - pdu.surfaceId, pdu.fillRectCount); + DEBUG_RDPGFX(gfx->log, "RecvSolidFillPdu: surfaceId: %" PRIu16 " fillRectCount: %" PRIu16 "", + pdu.surfaceId, pdu.fillRectCount); if (context) { IFCALLRET(context->SolidFill, error, context, &pdu); if (error) - WLog_Print(gfx->log, WLOG_ERROR, "context->SolidFill failed with error %"PRIu32"", error); + WLog_Print(gfx->log, WLOG_ERROR, "context->SolidFill failed with error %" PRIu32 "", + error); } free(pdu.fillRects); @@ -1135,14 +1139,13 @@ static UINT rdpgfx_recv_solid_fill_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStrea * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_surface_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* - callback, wStream* s) +static UINT rdpgfx_recv_surface_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { UINT16 index; RDPGFX_POINT16* destPt; RDPGFX_SURFACE_TO_SURFACE_PDU pdu; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error; if (Stream_GetRemainingLength(s) < 14) @@ -1151,12 +1154,13 @@ static UINT rdpgfx_recv_surface_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* return ERROR_INVALID_DATA; } - Stream_Read_UINT16(s, pdu.surfaceIdSrc); /* surfaceIdSrc (2 bytes) */ + Stream_Read_UINT16(s, pdu.surfaceIdSrc); /* surfaceIdSrc (2 bytes) */ Stream_Read_UINT16(s, pdu.surfaceIdDest); /* surfaceIdDest (2 bytes) */ if ((error = rdpgfx_read_rect16(s, &(pdu.rectSrc)))) /* rectSrc (8 bytes ) */ { - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_read_rect16 failed with error %"PRIu32"!", error); + WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_read_rect16 failed with error %" PRIu32 "!", + error); return error; } @@ -1168,7 +1172,7 @@ static UINT rdpgfx_recv_surface_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* return ERROR_INVALID_DATA; } - pdu.destPts = (RDPGFX_POINT16*) calloc(pdu.destPtsCount, sizeof(RDPGFX_POINT16)); + pdu.destPts = (RDPGFX_POINT16*)calloc(pdu.destPtsCount, sizeof(RDPGFX_POINT16)); if (!pdu.destPts) { @@ -1182,24 +1186,27 @@ static UINT rdpgfx_recv_surface_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* if ((error = rdpgfx_read_point16(s, destPt))) { - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_read_point16 failed with error %"PRIu32"!", error); + WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_read_point16 failed with error %" PRIu32 "!", + error); free(pdu.destPts); return error; } } - DEBUG_RDPGFX(gfx->log, "RecvSurfaceToSurfacePdu: surfaceIdSrc: %"PRIu16" surfaceIdDest: %"PRIu16" " - "left: %"PRIu16" top: %"PRIu16" right: %"PRIu16" bottom: %"PRIu16" destPtsCount: %"PRIu16"", - pdu.surfaceIdSrc, pdu.surfaceIdDest, - pdu.rectSrc.left, pdu.rectSrc.top, pdu.rectSrc.right, pdu.rectSrc.bottom, - pdu.destPtsCount); + DEBUG_RDPGFX(gfx->log, + "RecvSurfaceToSurfacePdu: surfaceIdSrc: %" PRIu16 " surfaceIdDest: %" PRIu16 " " + "left: %" PRIu16 " top: %" PRIu16 " right: %" PRIu16 " bottom: %" PRIu16 + " destPtsCount: %" PRIu16 "", + pdu.surfaceIdSrc, pdu.surfaceIdDest, pdu.rectSrc.left, pdu.rectSrc.top, + pdu.rectSrc.right, pdu.rectSrc.bottom, pdu.destPtsCount); if (context) { IFCALLRET(context->SurfaceToSurface, error, context, &pdu); if (error) - WLog_Print(gfx->log, WLOG_ERROR, "context->SurfaceToSurface failed with error %"PRIu32"", error); + WLog_Print(gfx->log, WLOG_ERROR, + "context->SurfaceToSurface failed with error %" PRIu32 "", error); } free(pdu.destPts); @@ -1211,12 +1218,11 @@ static UINT rdpgfx_recv_surface_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_surface_to_cache_pdu(RDPGFX_CHANNEL_CALLBACK* callback, - wStream* s) +static UINT rdpgfx_recv_surface_to_cache_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_SURFACE_TO_CACHE_PDU pdu; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error; if (Stream_GetRemainingLength(s) < 20) @@ -1226,28 +1232,30 @@ static UINT rdpgfx_recv_surface_to_cache_pdu(RDPGFX_CHANNEL_CALLBACK* callback, } Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ - Stream_Read_UINT64(s, pdu.cacheKey); /* cacheKey (8 bytes) */ + Stream_Read_UINT64(s, pdu.cacheKey); /* cacheKey (8 bytes) */ Stream_Read_UINT16(s, pdu.cacheSlot); /* cacheSlot (2 bytes) */ if ((error = rdpgfx_read_rect16(s, &(pdu.rectSrc)))) /* rectSrc (8 bytes ) */ { - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_read_rect16 failed with error %"PRIu32"!", error); + WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_read_rect16 failed with error %" PRIu32 "!", + error); return error; } - DEBUG_RDPGFX(gfx->log, - "RecvSurfaceToCachePdu: surfaceId: %"PRIu16" cacheKey: 0x%016"PRIX64" cacheSlot: %"PRIu16" " - "left: %"PRIu16" top: %"PRIu16" right: %"PRIu16" bottom: %"PRIu16"", - pdu.surfaceId, pdu.cacheKey, pdu.cacheSlot, - pdu.rectSrc.left, pdu.rectSrc.top, - pdu.rectSrc.right, pdu.rectSrc.bottom); + DEBUG_RDPGFX(gfx->log, + "RecvSurfaceToCachePdu: surfaceId: %" PRIu16 " cacheKey: 0x%016" PRIX64 + " cacheSlot: %" PRIu16 " " + "left: %" PRIu16 " top: %" PRIu16 " right: %" PRIu16 " bottom: %" PRIu16 "", + pdu.surfaceId, pdu.cacheKey, pdu.cacheSlot, pdu.rectSrc.left, pdu.rectSrc.top, + pdu.rectSrc.right, pdu.rectSrc.bottom); if (context) { IFCALLRET(context->SurfaceToCache, error, context, &pdu); if (error) - WLog_Print(gfx->log, WLOG_ERROR, "context->SurfaceToCache failed with error %"PRIu32"", error); + WLog_Print(gfx->log, WLOG_ERROR, + "context->SurfaceToCache failed with error %" PRIu32 "", error); } return error; @@ -1258,14 +1266,13 @@ static UINT rdpgfx_recv_surface_to_cache_pdu(RDPGFX_CHANNEL_CALLBACK* callback, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_cache_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, - wStream* s) +static UINT rdpgfx_recv_cache_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { UINT16 index; RDPGFX_POINT16* destPt; RDPGFX_CACHE_TO_SURFACE_PDU pdu; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 6) @@ -1274,8 +1281,8 @@ static UINT rdpgfx_recv_cache_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, return ERROR_INVALID_DATA; } - Stream_Read_UINT16(s, pdu.cacheSlot); /* cacheSlot (2 bytes) */ - Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ + Stream_Read_UINT16(s, pdu.cacheSlot); /* cacheSlot (2 bytes) */ + Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ Stream_Read_UINT16(s, pdu.destPtsCount); /* destPtsCount (2 bytes) */ if (Stream_GetRemainingLength(s) < (size_t)(pdu.destPtsCount * 4)) @@ -1284,7 +1291,7 @@ static UINT rdpgfx_recv_cache_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, return ERROR_INVALID_DATA; } - pdu.destPts = (RDPGFX_POINT16*) calloc(pdu.destPtsCount, sizeof(RDPGFX_POINT16)); + pdu.destPts = (RDPGFX_POINT16*)calloc(pdu.destPtsCount, sizeof(RDPGFX_POINT16)); if (!pdu.destPts) { @@ -1298,22 +1305,25 @@ static UINT rdpgfx_recv_cache_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, if ((error = rdpgfx_read_point16(s, destPt))) { - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_read_point16 failed with error %"PRIu32"", error); + WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_read_point16 failed with error %" PRIu32 "", + error); free(pdu.destPts); return error; } } - DEBUG_RDPGFX(gfx->log, - "RdpGfxRecvCacheToSurfacePdu: cacheSlot: %"PRIu16" surfaceId: %"PRIu16" destPtsCount: %"PRIu16"", - pdu.cacheSlot, pdu.surfaceId, pdu.destPtsCount); + DEBUG_RDPGFX(gfx->log, + "RdpGfxRecvCacheToSurfacePdu: cacheSlot: %" PRIu16 " surfaceId: %" PRIu16 + " destPtsCount: %" PRIu16 "", + pdu.cacheSlot, pdu.surfaceId, pdu.destPtsCount); if (context) { IFCALLRET(context->CacheToSurface, error, context, &pdu); if (error) - WLog_Print(gfx->log, WLOG_ERROR, "context->CacheToSurface failed with error %"PRIu32"", error); + WLog_Print(gfx->log, WLOG_ERROR, + "context->CacheToSurface failed with error %" PRIu32 "", error); } free(pdu.destPts); @@ -1325,12 +1335,11 @@ static UINT rdpgfx_recv_cache_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_map_surface_to_output_pdu(RDPGFX_CHANNEL_CALLBACK* - callback, wStream* s) +static UINT rdpgfx_recv_map_surface_to_output_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU pdu; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 12) @@ -1339,31 +1348,33 @@ static UINT rdpgfx_recv_map_surface_to_output_pdu(RDPGFX_CHANNEL_CALLBACK* return ERROR_INVALID_DATA; } - Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ - Stream_Read_UINT16(s, pdu.reserved); /* reserved (2 bytes) */ + Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ + Stream_Read_UINT16(s, pdu.reserved); /* reserved (2 bytes) */ Stream_Read_UINT32(s, pdu.outputOriginX); /* outputOriginX (4 bytes) */ Stream_Read_UINT32(s, pdu.outputOriginY); /* outputOriginY (4 bytes) */ - DEBUG_RDPGFX(gfx->log, - "RecvMapSurfaceToOutputPdu: surfaceId: %"PRIu16" outputOriginX: %"PRIu32" outputOriginY: %"PRIu32"", - pdu.surfaceId, pdu.outputOriginX, pdu.outputOriginY); + DEBUG_RDPGFX(gfx->log, + "RecvMapSurfaceToOutputPdu: surfaceId: %" PRIu16 " outputOriginX: %" PRIu32 + " outputOriginY: %" PRIu32 "", + pdu.surfaceId, pdu.outputOriginX, pdu.outputOriginY); if (context) { IFCALLRET(context->MapSurfaceToOutput, error, context, &pdu); if (error) - WLog_Print(gfx->log, WLOG_ERROR, "context->MapSurfaceToOutput failed with error %"PRIu32"", error); + WLog_Print(gfx->log, WLOG_ERROR, + "context->MapSurfaceToOutput failed with error %" PRIu32 "", error); } return error; } -static UINT rdpgfx_recv_map_surface_to_scaled_output_pdu(RDPGFX_CHANNEL_CALLBACK* - callback, wStream* s) +static UINT rdpgfx_recv_map_surface_to_scaled_output_pdu(RDPGFX_CHANNEL_CALLBACK* callback, + wStream* s) { RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU pdu; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 20) @@ -1372,23 +1383,25 @@ static UINT rdpgfx_recv_map_surface_to_scaled_output_pdu(RDPGFX_CHANNEL_CALLBACK return ERROR_INVALID_DATA; } - Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ - Stream_Read_UINT16(s, pdu.reserved); /* reserved (2 bytes) */ + Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ + Stream_Read_UINT16(s, pdu.reserved); /* reserved (2 bytes) */ Stream_Read_UINT32(s, pdu.outputOriginX); /* outputOriginX (4 bytes) */ Stream_Read_UINT32(s, pdu.outputOriginY); /* outputOriginY (4 bytes) */ - Stream_Read_UINT32(s, pdu.targetWidth); /* targetWidth (4 bytes) */ - Stream_Read_UINT32(s, pdu.targetHeight); /* targetHeight (4 bytes) */ - DEBUG_RDPGFX(gfx->log, - "RecvMapSurfaceToScaledOutputPdu: surfaceId: %"PRIu16" outputOriginX: %"PRIu32" outputOriginY: %"PRIu32" targetWidth: %"PRIu32" targetHeight: %"PRIu32, - pdu.surfaceId, pdu.outputOriginX, pdu.outputOriginY, pdu.targetWidth, pdu.targetHeight); + Stream_Read_UINT32(s, pdu.targetWidth); /* targetWidth (4 bytes) */ + Stream_Read_UINT32(s, pdu.targetHeight); /* targetHeight (4 bytes) */ + DEBUG_RDPGFX(gfx->log, + "RecvMapSurfaceToScaledOutputPdu: surfaceId: %" PRIu16 " outputOriginX: %" PRIu32 + " outputOriginY: %" PRIu32 " targetWidth: %" PRIu32 " targetHeight: %" PRIu32, + pdu.surfaceId, pdu.outputOriginX, pdu.outputOriginY, pdu.targetWidth, + pdu.targetHeight); if (context) { IFCALLRET(context->MapSurfaceToScaledOutput, error, context, &pdu); if (error) - WLog_Print(gfx->log, WLOG_ERROR, "context->MapSurfaceToScaledOutput failed with error %"PRIu32"", - error); + WLog_Print(gfx->log, WLOG_ERROR, + "context->MapSurfaceToScaledOutput failed with error %" PRIu32 "", error); } return error; @@ -1399,12 +1412,11 @@ static UINT rdpgfx_recv_map_surface_to_scaled_output_pdu(RDPGFX_CHANNEL_CALLBACK * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_map_surface_to_window_pdu(RDPGFX_CHANNEL_CALLBACK* callback, - wStream* s) +static UINT rdpgfx_recv_map_surface_to_window_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_MAP_SURFACE_TO_WINDOW_PDU pdu; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 18) @@ -1413,31 +1425,33 @@ static UINT rdpgfx_recv_map_surface_to_window_pdu(RDPGFX_CHANNEL_CALLBACK* callb return ERROR_INVALID_DATA; } - Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ - Stream_Read_UINT64(s, pdu.windowId); /* windowId (8 bytes) */ - Stream_Read_UINT32(s, pdu.mappedWidth); /* mappedWidth (4 bytes) */ + Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ + Stream_Read_UINT64(s, pdu.windowId); /* windowId (8 bytes) */ + Stream_Read_UINT32(s, pdu.mappedWidth); /* mappedWidth (4 bytes) */ Stream_Read_UINT32(s, pdu.mappedHeight); /* mappedHeight (4 bytes) */ - DEBUG_RDPGFX(gfx->log, - "RecvMapSurfaceToWindowPdu: surfaceId: %"PRIu16" windowId: 0x%016"PRIX64" mappedWidth: %"PRIu32" mappedHeight: %"PRIu32"", - pdu.surfaceId, pdu.windowId, pdu.mappedWidth, pdu.mappedHeight); + DEBUG_RDPGFX(gfx->log, + "RecvMapSurfaceToWindowPdu: surfaceId: %" PRIu16 " windowId: 0x%016" PRIX64 + " mappedWidth: %" PRIu32 " mappedHeight: %" PRIu32 "", + pdu.surfaceId, pdu.windowId, pdu.mappedWidth, pdu.mappedHeight); if (context && context->MapSurfaceToWindow) { IFCALLRET(context->MapSurfaceToWindow, error, context, &pdu); if (error) - WLog_Print(gfx->log, WLOG_ERROR, "context->MapSurfaceToWindow failed with error %"PRIu32"", error); + WLog_Print(gfx->log, WLOG_ERROR, + "context->MapSurfaceToWindow failed with error %" PRIu32 "", error); } return error; } static UINT rdpgfx_recv_map_surface_to_scaled_window_pdu(RDPGFX_CHANNEL_CALLBACK* callback, - wStream* s) + wStream* s) { RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU pdu; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 26) @@ -1446,23 +1460,26 @@ static UINT rdpgfx_recv_map_surface_to_scaled_window_pdu(RDPGFX_CHANNEL_CALLBACK return ERROR_INVALID_DATA; } - Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ - Stream_Read_UINT64(s, pdu.windowId); /* windowId (8 bytes) */ - Stream_Read_UINT32(s, pdu.mappedWidth); /* mappedWidth (4 bytes) */ + Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ + Stream_Read_UINT64(s, pdu.windowId); /* windowId (8 bytes) */ + Stream_Read_UINT32(s, pdu.mappedWidth); /* mappedWidth (4 bytes) */ Stream_Read_UINT32(s, pdu.mappedHeight); /* mappedHeight (4 bytes) */ - Stream_Read_UINT32(s, pdu.targetWidth); /* targetWidth (4 bytes) */ + Stream_Read_UINT32(s, pdu.targetWidth); /* targetWidth (4 bytes) */ Stream_Read_UINT32(s, pdu.targetHeight); /* targetHeight (4 bytes) */ - DEBUG_RDPGFX(gfx->log, - "RecvMapSurfaceToScaledWindowPdu: surfaceId: %"PRIu16" windowId: 0x%016"PRIX64" mappedWidth: %"PRIu32" mappedHeight: %"PRIu32" targetWidth: %"PRIu32" targetHeight: %"PRIu32"", - pdu.surfaceId, pdu.windowId, pdu.mappedWidth, pdu.mappedHeight, pdu.targetWidth, pdu.targetHeight); + DEBUG_RDPGFX(gfx->log, + "RecvMapSurfaceToScaledWindowPdu: surfaceId: %" PRIu16 " windowId: 0x%016" PRIX64 + " mappedWidth: %" PRIu32 " mappedHeight: %" PRIu32 " targetWidth: %" PRIu32 + " targetHeight: %" PRIu32 "", + pdu.surfaceId, pdu.windowId, pdu.mappedWidth, pdu.mappedHeight, pdu.targetWidth, + pdu.targetHeight); if (context && context->MapSurfaceToScaledWindow) { IFCALLRET(context->MapSurfaceToScaledWindow, error, context, &pdu); if (error) - WLog_Print(gfx->log, WLOG_ERROR, "context->MapSurfaceToScaledWindow failed with error %"PRIu32"", - error); + WLog_Print(gfx->log, WLOG_ERROR, + "context->MapSurfaceToScaledWindow failed with error %" PRIu32 "", error); } return error; @@ -1478,32 +1495,34 @@ static UINT rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) size_t beg, end; RDPGFX_HEADER header; UINT error; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; beg = Stream_GetPosition(s); if ((error = rdpgfx_read_header(s, &header))) { - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_read_header failed with error %"PRIu32"!", error); + WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_read_header failed with error %" PRIu32 "!", + error); return error; } - DEBUG_RDPGFX(gfx->log, - "cmdId: %s (0x%04"PRIX16") flags: 0x%04"PRIX16" pduLength: %"PRIu32"", - rdpgfx_get_cmd_id_string(header.cmdId), header.cmdId, header.flags, - header.pduLength); + DEBUG_RDPGFX( + gfx->log, "cmdId: %s (0x%04" PRIX16 ") flags: 0x%04" PRIX16 " pduLength: %" PRIu32 "", + rdpgfx_get_cmd_id_string(header.cmdId), header.cmdId, header.flags, header.pduLength); switch (header.cmdId) { case RDPGFX_CMDID_WIRETOSURFACE_1: if ((error = rdpgfx_recv_wire_to_surface_1_pdu(callback, s))) - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_recv_wire_to_surface_1_pdu failed with error %"PRIu32"!", + WLog_Print(gfx->log, WLOG_ERROR, + "rdpgfx_recv_wire_to_surface_1_pdu failed with error %" PRIu32 "!", error); break; case RDPGFX_CMDID_WIRETOSURFACE_2: if ((error = rdpgfx_recv_wire_to_surface_2_pdu(callback, s))) - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_recv_wire_to_surface_2_pdu failed with error %"PRIu32"!", + WLog_Print(gfx->log, WLOG_ERROR, + "rdpgfx_recv_wire_to_surface_2_pdu failed with error %" PRIu32 "!", error); break; @@ -1511,104 +1530,112 @@ static UINT rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) case RDPGFX_CMDID_DELETEENCODINGCONTEXT: if ((error = rdpgfx_recv_delete_encoding_context_pdu(callback, s))) WLog_Print(gfx->log, WLOG_ERROR, - "rdpgfx_recv_delete_encoding_context_pdu failed with error %"PRIu32"!", + "rdpgfx_recv_delete_encoding_context_pdu failed with error %" PRIu32 "!", error); break; case RDPGFX_CMDID_SOLIDFILL: if ((error = rdpgfx_recv_solid_fill_pdu(callback, s))) - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_recv_solid_fill_pdu failed with error %"PRIu32"!", error); + WLog_Print(gfx->log, WLOG_ERROR, + "rdpgfx_recv_solid_fill_pdu failed with error %" PRIu32 "!", error); break; case RDPGFX_CMDID_SURFACETOSURFACE: if ((error = rdpgfx_recv_surface_to_surface_pdu(callback, s))) - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_recv_surface_to_surface_pdu failed with error %"PRIu32"!", + WLog_Print(gfx->log, WLOG_ERROR, + "rdpgfx_recv_surface_to_surface_pdu failed with error %" PRIu32 "!", error); break; case RDPGFX_CMDID_SURFACETOCACHE: if ((error = rdpgfx_recv_surface_to_cache_pdu(callback, s))) - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_recv_surface_to_cache_pdu failed with error %"PRIu32"!", + WLog_Print(gfx->log, WLOG_ERROR, + "rdpgfx_recv_surface_to_cache_pdu failed with error %" PRIu32 "!", error); break; case RDPGFX_CMDID_CACHETOSURFACE: if ((error = rdpgfx_recv_cache_to_surface_pdu(callback, s))) - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_recv_cache_to_surface_pdu failed with error %"PRIu32"!", + WLog_Print(gfx->log, WLOG_ERROR, + "rdpgfx_recv_cache_to_surface_pdu failed with error %" PRIu32 "!", error); break; case RDPGFX_CMDID_EVICTCACHEENTRY: if ((error = rdpgfx_recv_evict_cache_entry_pdu(callback, s))) - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_recv_evict_cache_entry_pdu failed with error %"PRIu32"!", + WLog_Print(gfx->log, WLOG_ERROR, + "rdpgfx_recv_evict_cache_entry_pdu failed with error %" PRIu32 "!", error); break; case RDPGFX_CMDID_CREATESURFACE: if ((error = rdpgfx_recv_create_surface_pdu(callback, s))) - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_recv_create_surface_pdu failed with error %"PRIu32"!", - error); + WLog_Print(gfx->log, WLOG_ERROR, + "rdpgfx_recv_create_surface_pdu failed with error %" PRIu32 "!", error); break; case RDPGFX_CMDID_DELETESURFACE: if ((error = rdpgfx_recv_delete_surface_pdu(callback, s))) - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_recv_delete_surface_pdu failed with error %"PRIu32"!", - error); + WLog_Print(gfx->log, WLOG_ERROR, + "rdpgfx_recv_delete_surface_pdu failed with error %" PRIu32 "!", error); break; case RDPGFX_CMDID_STARTFRAME: if ((error = rdpgfx_recv_start_frame_pdu(callback, s))) - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_recv_start_frame_pdu failed with error %"PRIu32"!", error); + WLog_Print(gfx->log, WLOG_ERROR, + "rdpgfx_recv_start_frame_pdu failed with error %" PRIu32 "!", error); break; case RDPGFX_CMDID_ENDFRAME: if ((error = rdpgfx_recv_end_frame_pdu(callback, s))) - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_recv_end_frame_pdu failed with error %"PRIu32"!", error); + WLog_Print(gfx->log, WLOG_ERROR, + "rdpgfx_recv_end_frame_pdu failed with error %" PRIu32 "!", error); break; case RDPGFX_CMDID_RESETGRAPHICS: if ((error = rdpgfx_recv_reset_graphics_pdu(callback, s))) - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_recv_reset_graphics_pdu failed with error %"PRIu32"!", - error); + WLog_Print(gfx->log, WLOG_ERROR, + "rdpgfx_recv_reset_graphics_pdu failed with error %" PRIu32 "!", error); break; case RDPGFX_CMDID_MAPSURFACETOOUTPUT: if ((error = rdpgfx_recv_map_surface_to_output_pdu(callback, s))) WLog_Print(gfx->log, WLOG_ERROR, - "rdpgfx_recv_map_surface_to_output_pdu failed with error %"PRIu32"!", + "rdpgfx_recv_map_surface_to_output_pdu failed with error %" PRIu32 "!", error); break; case RDPGFX_CMDID_CACHEIMPORTREPLY: if ((error = rdpgfx_recv_cache_import_reply_pdu(callback, s))) - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_recv_cache_import_reply_pdu failed with error %"PRIu32"!", + WLog_Print(gfx->log, WLOG_ERROR, + "rdpgfx_recv_cache_import_reply_pdu failed with error %" PRIu32 "!", error); break; case RDPGFX_CMDID_CAPSCONFIRM: if ((error = rdpgfx_recv_caps_confirm_pdu(callback, s))) - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_recv_caps_confirm_pdu failed with error %"PRIu32"!", - error); + WLog_Print(gfx->log, WLOG_ERROR, + "rdpgfx_recv_caps_confirm_pdu failed with error %" PRIu32 "!", error); break; case RDPGFX_CMDID_MAPSURFACETOWINDOW: if ((error = rdpgfx_recv_map_surface_to_window_pdu(callback, s))) WLog_Print(gfx->log, WLOG_ERROR, - "rdpgfx_recv_map_surface_to_window_pdu failed with error %"PRIu32"!", + "rdpgfx_recv_map_surface_to_window_pdu failed with error %" PRIu32 "!", error); break; @@ -1616,7 +1643,8 @@ static UINT rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) case RDPGFX_CMDID_MAPSURFACETOSCALEDWINDOW: if ((error = rdpgfx_recv_map_surface_to_scaled_window_pdu(callback, s))) WLog_Print(gfx->log, WLOG_ERROR, - "rdpgfx_recv_map_surface_to_scaled_window_pdu failed with error %"PRIu32"!", + "rdpgfx_recv_map_surface_to_scaled_window_pdu failed with error %" PRIu32 + "!", error); break; @@ -1624,7 +1652,8 @@ static UINT rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) case RDPGFX_CMDID_MAPSURFACETOSCALEDOUTPUT: if ((error = rdpgfx_recv_map_surface_to_scaled_output_pdu(callback, s))) WLog_Print(gfx->log, WLOG_ERROR, - "rdpgfx_recv_map_surface_to_scaled_output_pdu failed with error %"PRIu32"!", + "rdpgfx_recv_map_surface_to_scaled_output_pdu failed with error %" PRIu32 + "!", error); break; @@ -1636,7 +1665,7 @@ static UINT rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) if (error) { - WLog_Print(gfx->log, WLOG_ERROR, "Error while parsing GFX cmdId: %s (0x%04"PRIX16")", + WLog_Print(gfx->log, WLOG_ERROR, "Error while parsing GFX cmdId: %s (0x%04" PRIX16 ")", rdpgfx_get_cmd_id_string(header.cmdId), header.cmdId); return error; } @@ -1645,8 +1674,9 @@ static UINT rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) if (end != (beg + header.pduLength)) { - WLog_Print(gfx->log, WLOG_ERROR, "Unexpected gfx pdu end: Actual: %d, Expected: %"PRIu32"", - end, (beg + header.pduLength)); + WLog_Print(gfx->log, WLOG_ERROR, + "Unexpected gfx pdu end: Actual: %d, Expected: %" PRIu32 "", end, + (beg + header.pduLength)); Stream_SetPosition(s, (beg + header.pduLength)); } @@ -1658,15 +1688,14 @@ static UINT rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_on_data_received(IWTSVirtualChannelCallback* - pChannelCallback, wStream* data) +static UINT rdpgfx_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream* data) { wStream* s; int status = 0; UINT32 DstSize = 0; BYTE* pDstData = NULL; - RDPGFX_CHANNEL_CALLBACK* callback = (RDPGFX_CHANNEL_CALLBACK*) pChannelCallback; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; + RDPGFX_CHANNEL_CALLBACK* callback = (RDPGFX_CHANNEL_CALLBACK*)pChannelCallback; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; UINT error = CHANNEL_RC_OK; status = zgfx_decompress(gfx->zgfx, Stream_Pointer(data), Stream_GetRemainingLength(data), &pDstData, &DstSize, 0); @@ -1689,7 +1718,8 @@ static UINT rdpgfx_on_data_received(IWTSVirtualChannelCallback* { if ((error = rdpgfx_recv_pdu(callback, s))) { - WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_recv_pdu failed with error %"PRIu32"!", error); + WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_recv_pdu failed with error %" PRIu32 "!", + error); break; } } @@ -1705,9 +1735,9 @@ static UINT rdpgfx_on_data_received(IWTSVirtualChannelCallback* */ static UINT rdpgfx_on_open(IWTSVirtualChannelCallback* pChannelCallback) { - RDPGFX_CHANNEL_CALLBACK* callback = (RDPGFX_CHANNEL_CALLBACK*) pChannelCallback; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_CHANNEL_CALLBACK* callback = (RDPGFX_CHANNEL_CALLBACK*)pChannelCallback; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error = CHANNEL_RC_OK; BOOL do_caps_advertise = TRUE; gfx->sendFrameAcks = TRUE; @@ -1717,7 +1747,8 @@ static UINT rdpgfx_on_open(IWTSVirtualChannelCallback* pChannelCallback) IFCALLRET(context->OnOpen, error, context, &do_caps_advertise, &gfx->sendFrameAcks); if (error) - WLog_Print(gfx->log, WLOG_ERROR, "context->OnOpen failed with error %"PRIu32"", error); + WLog_Print(gfx->log, WLOG_ERROR, "context->OnOpen failed with error %" PRIu32 "", + error); } if (do_caps_advertise) @@ -1736,10 +1767,10 @@ static UINT rdpgfx_on_close(IWTSVirtualChannelCallback* pChannelCallback) int count; int index; ULONG_PTR* pKeys = NULL; - RDPGFX_CHANNEL_CALLBACK* callback = (RDPGFX_CHANNEL_CALLBACK*) pChannelCallback; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; - DEBUG_RDPGFX(gfx->log, "OnClose"); + RDPGFX_CHANNEL_CALLBACK* callback = (RDPGFX_CHANNEL_CALLBACK*)pChannelCallback; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)callback->plugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; + DEBUG_RDPGFX(gfx->log, "OnClose"); free(callback); gfx->UnacknowledgedFrames = 0; gfx->TotalDecodedFrames = 0; @@ -1758,7 +1789,7 @@ static UINT rdpgfx_on_close(IWTSVirtualChannelCallback* pChannelCallback) for (index = 0; index < count; index++) { RDPGFX_DELETE_SURFACE_PDU pdu; - pdu.surfaceId = ((UINT16) pKeys[index]) - 1; + pdu.surfaceId = ((UINT16)pKeys[index]) - 1; if (context && context->DeleteSurface) { @@ -1773,7 +1804,7 @@ static UINT rdpgfx_on_close(IWTSVirtualChannelCallback* pChannelCallback) if (gfx->CacheSlots[index]) { RDPGFX_EVICT_CACHE_ENTRY_PDU pdu; - pdu.cacheSlot = (UINT16) index; + pdu.cacheSlot = (UINT16)index; if (context && context->EvictCacheEntry) { @@ -1797,14 +1828,14 @@ static UINT rdpgfx_on_close(IWTSVirtualChannelCallback* pChannelCallback) * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_on_new_channel_connection(IWTSListenerCallback* - pListenerCallback, - IWTSVirtualChannel* pChannel, BYTE* Data, BOOL* pbAccept, - IWTSVirtualChannelCallback** ppCallback) +static UINT rdpgfx_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, + IWTSVirtualChannel* pChannel, BYTE* Data, + BOOL* pbAccept, + IWTSVirtualChannelCallback** ppCallback) { RDPGFX_CHANNEL_CALLBACK* callback; RDPGFX_LISTENER_CALLBACK* listener_callback = (RDPGFX_LISTENER_CALLBACK*)pListenerCallback; - callback = (RDPGFX_CHANNEL_CALLBACK*) calloc(1, sizeof(RDPGFX_CHANNEL_CALLBACK)); + callback = (RDPGFX_CHANNEL_CALLBACK*)calloc(1, sizeof(RDPGFX_CHANNEL_CALLBACK)); if (!callback) { @@ -1819,7 +1850,7 @@ static UINT rdpgfx_on_new_channel_connection(IWTSListenerCallback* callback->channel_mgr = listener_callback->channel_mgr; callback->channel = pChannel; listener_callback->channel_callback = callback; - *ppCallback = (IWTSVirtualChannelCallback*) callback; + *ppCallback = (IWTSVirtualChannelCallback*)callback; return CHANNEL_RC_OK; } @@ -1828,12 +1859,11 @@ static UINT rdpgfx_on_new_channel_connection(IWTSListenerCallback* * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_plugin_initialize(IWTSPlugin* pPlugin, - IWTSVirtualChannelManager* pChannelMgr) +static UINT rdpgfx_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) { UINT error; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) pPlugin; - gfx->listener_callback = (RDPGFX_LISTENER_CALLBACK*) calloc(1, sizeof(RDPGFX_LISTENER_CALLBACK)); + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)pPlugin; + gfx->listener_callback = (RDPGFX_LISTENER_CALLBACK*)calloc(1, sizeof(RDPGFX_LISTENER_CALLBACK)); if (!gfx->listener_callback) { @@ -1845,7 +1875,8 @@ static UINT rdpgfx_plugin_initialize(IWTSPlugin* pPlugin, gfx->listener_callback->plugin = pPlugin; gfx->listener_callback->channel_mgr = pChannelMgr; error = pChannelMgr->CreateListener(pChannelMgr, RDPGFX_DVC_CHANNEL_NAME, 0, - (IWTSListenerCallback*) gfx->listener_callback, &(gfx->listener)); + (IWTSListenerCallback*)gfx->listener_callback, + &(gfx->listener)); gfx->listener->pInterface = gfx->iface.pInterface; DEBUG_RDPGFX(gfx->log, "Initialize"); return error; @@ -1861,8 +1892,8 @@ static UINT rdpgfx_plugin_terminated(IWTSPlugin* pPlugin) int count; int index; ULONG_PTR* pKeys = NULL; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) pPlugin; - RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)pPlugin; + RdpgfxClientContext* context = (RdpgfxClientContext*)gfx->iface.pInterface; UINT error = CHANNEL_RC_OK; DEBUG_RDPGFX(gfx->log, "Terminated"); @@ -1871,7 +1902,7 @@ static UINT rdpgfx_plugin_terminated(IWTSPlugin* pPlugin) for (index = 0; index < count; index++) { RDPGFX_DELETE_SURFACE_PDU pdu; - pdu.surfaceId = ((UINT16) pKeys[index]) - 1; + pdu.surfaceId = ((UINT16)pKeys[index]) - 1; if (context) { @@ -1886,13 +1917,12 @@ static UINT rdpgfx_plugin_terminated(IWTSPlugin* pPlugin) } } - for (index = 0; index < gfx->MaxCacheSlot; index++) { if (gfx->CacheSlots[index]) { RDPGFX_EVICT_CACHE_ENTRY_PDU pdu; - pdu.cacheSlot = (UINT16) index; + pdu.cacheSlot = (UINT16)index; if (context) { @@ -1919,17 +1949,16 @@ out: * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_set_surface_data(RdpgfxClientContext* context, - UINT16 surfaceId, void* pData) +static UINT rdpgfx_set_surface_data(RdpgfxClientContext* context, UINT16 surfaceId, void* pData) { ULONG_PTR key; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) context->handle; - key = ((ULONG_PTR) surfaceId) + 1; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)context->handle; + key = ((ULONG_PTR)surfaceId) + 1; if (pData) - HashTable_Add(gfx->SurfaceTable, (void*) key, pData); + HashTable_Add(gfx->SurfaceTable, (void*)key, pData); else - HashTable_Remove(gfx->SurfaceTable, (void*) key); + HashTable_Remove(gfx->SurfaceTable, (void*)key); return CHANNEL_RC_OK; } @@ -1939,14 +1968,14 @@ static UINT rdpgfx_set_surface_data(RdpgfxClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_get_surface_ids(RdpgfxClientContext* context, - UINT16** ppSurfaceIds, UINT16* count_out) +static UINT rdpgfx_get_surface_ids(RdpgfxClientContext* context, UINT16** ppSurfaceIds, + UINT16* count_out) { int count; int index; UINT16* pSurfaceIds; ULONG_PTR* pKeys = NULL; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) context->handle; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)context->handle; count = HashTable_GetKeys(gfx->SurfaceTable, &pKeys); if (count < 1) @@ -1955,7 +1984,7 @@ static UINT rdpgfx_get_surface_ids(RdpgfxClientContext* context, return CHANNEL_RC_OK; } - pSurfaceIds = (UINT16*) calloc(count, sizeof(UINT16)); + pSurfaceIds = (UINT16*)calloc(count, sizeof(UINT16)); if (!pSurfaceIds) { @@ -1975,14 +2004,13 @@ static UINT rdpgfx_get_surface_ids(RdpgfxClientContext* context, return CHANNEL_RC_OK; } -static void* rdpgfx_get_surface_data(RdpgfxClientContext* context, - UINT16 surfaceId) +static void* rdpgfx_get_surface_data(RdpgfxClientContext* context, UINT16 surfaceId) { ULONG_PTR key; void* pData = NULL; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) context->handle; - key = ((ULONG_PTR) surfaceId) + 1; - pData = HashTable_GetItemValue(gfx->SurfaceTable, (void*) key); + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)context->handle; + key = ((ULONG_PTR)surfaceId) + 1; + pData = HashTable_GetItemValue(gfx->SurfaceTable, (void*)key); return pData; } @@ -1991,14 +2019,13 @@ static void* rdpgfx_get_surface_data(RdpgfxClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_set_cache_slot_data(RdpgfxClientContext* context, - UINT16 cacheSlot, void* pData) +static UINT rdpgfx_set_cache_slot_data(RdpgfxClientContext* context, UINT16 cacheSlot, void* pData) { - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) context->handle; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)context->handle; if (cacheSlot >= gfx->MaxCacheSlot) { - WLog_ERR(TAG, "%s: invalid cache slot %"PRIu16" maxAllowed=%"PRIu16"", __FUNCTION__, + WLog_ERR(TAG, "%s: invalid cache slot %" PRIu16 " maxAllowed=%" PRIu16 "", __FUNCTION__, cacheSlot, gfx->MaxCacheSlot); return ERROR_INVALID_INDEX; } @@ -2010,11 +2037,11 @@ static UINT rdpgfx_set_cache_slot_data(RdpgfxClientContext* context, static void* rdpgfx_get_cache_slot_data(RdpgfxClientContext* context, UINT16 cacheSlot) { void* pData = NULL; - RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) context->handle; + RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*)context->handle; if (cacheSlot >= gfx->MaxCacheSlot) { - WLog_ERR(TAG, "%s: invalid cache slot %"PRIu16" maxAllowed=%"PRIu16"", __FUNCTION__, + WLog_ERR(TAG, "%s: invalid cache slot %" PRIu16 " maxAllowed=%" PRIu16 "", __FUNCTION__, cacheSlot, gfx->MaxCacheSlot); return NULL; } @@ -2024,9 +2051,9 @@ static void* rdpgfx_get_cache_slot_data(RdpgfxClientContext* context, UINT16 cac } #ifdef BUILTIN_CHANNELS -#define DVCPluginEntry rdpgfx_DVCPluginEntry +#define DVCPluginEntry rdpgfx_DVCPluginEntry #else -#define DVCPluginEntry FREERDP_API DVCPluginEntry +#define DVCPluginEntry FREERDP_API DVCPluginEntry #endif RdpgfxClientContext* rdpgfx_client_context_new(rdpSettings* settings) @@ -2145,11 +2172,12 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) UINT error = CHANNEL_RC_OK; RDPGFX_PLUGIN* gfx; RdpgfxClientContext* context; - gfx = (RDPGFX_PLUGIN*) pEntryPoints->GetPlugin(pEntryPoints, "rdpgfx"); + gfx = (RDPGFX_PLUGIN*)pEntryPoints->GetPlugin(pEntryPoints, "rdpgfx"); if (!gfx) { - context = rdpgfx_client_context_new((rdpSettings*)pEntryPoints->GetRdpSettings(pEntryPoints)); + context = + rdpgfx_client_context_new((rdpSettings*)pEntryPoints->GetRdpSettings(pEntryPoints)); if (!context) { @@ -2157,14 +2185,14 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) return CHANNEL_RC_NO_MEMORY; } - gfx = (RDPGFX_PLUGIN*) context->handle; + gfx = (RDPGFX_PLUGIN*)context->handle; gfx->iface.Initialize = rdpgfx_plugin_initialize; gfx->iface.Connected = NULL; gfx->iface.Disconnected = NULL; gfx->iface.Terminated = rdpgfx_plugin_terminated; - error = pEntryPoints->RegisterPlugin(pEntryPoints, "rdpgfx", (IWTSPlugin*) gfx); + error = pEntryPoints->RegisterPlugin(pEntryPoints, "rdpgfx", (IWTSPlugin*)gfx); } return error; diff --git a/channels/rdpgfx/client/rdpgfx_main.h b/channels/rdpgfx/client/rdpgfx_main.h index f7dfdf254..3f58f2d14 100644 --- a/channels/rdpgfx/client/rdpgfx_main.h +++ b/channels/rdpgfx/client/rdpgfx_main.h @@ -89,4 +89,3 @@ struct _RDPGFX_PLUGIN typedef struct _RDPGFX_PLUGIN RDPGFX_PLUGIN; #endif /* FREERDP_CHANNEL_RDPGFX_CLIENT_MAIN_H */ - diff --git a/channels/rdpgfx/rdpgfx_common.c b/channels/rdpgfx/rdpgfx_common.c index 1a01db323..090aa50ab 100644 --- a/channels/rdpgfx/rdpgfx_common.c +++ b/channels/rdpgfx/rdpgfx_common.c @@ -31,34 +31,31 @@ #include "rdpgfx_common.h" -static const char* RDPGFX_CMDID_STRINGS[] = -{ - "RDPGFX_CMDID_UNUSED_0000", - "RDPGFX_CMDID_WIRETOSURFACE_1", - "RDPGFX_CMDID_WIRETOSURFACE_2", - "RDPGFX_CMDID_DELETEENCODINGCONTEXT", - "RDPGFX_CMDID_SOLIDFILL", - "RDPGFX_CMDID_SURFACETOSURFACE", - "RDPGFX_CMDID_SURFACETOCACHE", - "RDPGFX_CMDID_CACHETOSURFACE", - "RDPGFX_CMDID_EVICTCACHEENTRY", - "RDPGFX_CMDID_CREATESURFACE", - "RDPGFX_CMDID_DELETESURFACE", - "RDPGFX_CMDID_STARTFRAME", - "RDPGFX_CMDID_ENDFRAME", - "RDPGFX_CMDID_FRAMEACKNOWLEDGE", - "RDPGFX_CMDID_RESETGRAPHICS", - "RDPGFX_CMDID_MAPSURFACETOOUTPUT", - "RDPGFX_CMDID_CACHEIMPORTOFFER", - "RDPGFX_CMDID_CACHEIMPORTREPLY", - "RDPGFX_CMDID_CAPSADVERTISE", - "RDPGFX_CMDID_CAPSCONFIRM", - "RDPGFX_CMDID_UNUSED_0014", - "RDPGFX_CMDID_MAPSURFACETOWINDOW", - "RDPGFX_CMDID_QOEFRAMEACKNOWLEDGE", - "RDPGFX_CMDID_MAPSURFACETOSCALEDOUTPUT", - "RDPGFX_CMDID_MAPSURFACETOSCALEDWINDOW" -}; +static const char* RDPGFX_CMDID_STRINGS[] = { "RDPGFX_CMDID_UNUSED_0000", + "RDPGFX_CMDID_WIRETOSURFACE_1", + "RDPGFX_CMDID_WIRETOSURFACE_2", + "RDPGFX_CMDID_DELETEENCODINGCONTEXT", + "RDPGFX_CMDID_SOLIDFILL", + "RDPGFX_CMDID_SURFACETOSURFACE", + "RDPGFX_CMDID_SURFACETOCACHE", + "RDPGFX_CMDID_CACHETOSURFACE", + "RDPGFX_CMDID_EVICTCACHEENTRY", + "RDPGFX_CMDID_CREATESURFACE", + "RDPGFX_CMDID_DELETESURFACE", + "RDPGFX_CMDID_STARTFRAME", + "RDPGFX_CMDID_ENDFRAME", + "RDPGFX_CMDID_FRAMEACKNOWLEDGE", + "RDPGFX_CMDID_RESETGRAPHICS", + "RDPGFX_CMDID_MAPSURFACETOOUTPUT", + "RDPGFX_CMDID_CACHEIMPORTOFFER", + "RDPGFX_CMDID_CACHEIMPORTREPLY", + "RDPGFX_CMDID_CAPSADVERTISE", + "RDPGFX_CMDID_CAPSCONFIRM", + "RDPGFX_CMDID_UNUSED_0014", + "RDPGFX_CMDID_MAPSURFACETOWINDOW", + "RDPGFX_CMDID_QOEFRAMEACKNOWLEDGE", + "RDPGFX_CMDID_MAPSURFACETOSCALEDOUTPUT", + "RDPGFX_CMDID_MAPSURFACETOSCALEDWINDOW" }; const char* rdpgfx_get_cmd_id_string(UINT16 cmdId) { @@ -119,8 +116,8 @@ UINT rdpgfx_read_header(wStream* s, RDPGFX_HEADER* header) return CHANNEL_RC_NO_MEMORY; } - Stream_Read_UINT16(s, header->cmdId); /* cmdId (2 bytes) */ - Stream_Read_UINT16(s, header->flags); /* flags (2 bytes) */ + Stream_Read_UINT16(s, header->cmdId); /* cmdId (2 bytes) */ + Stream_Read_UINT16(s, header->flags); /* flags (2 bytes) */ Stream_Read_UINT32(s, header->pduLength); /* pduLength (4 bytes) */ return CHANNEL_RC_OK; } @@ -132,8 +129,8 @@ UINT rdpgfx_read_header(wStream* s, RDPGFX_HEADER* header) */ UINT rdpgfx_write_header(wStream* s, const RDPGFX_HEADER* header) { - Stream_Write_UINT16(s, header->cmdId); /* cmdId (2 bytes) */ - Stream_Write_UINT16(s, header->flags); /* flags (2 bytes) */ + Stream_Write_UINT16(s, header->cmdId); /* cmdId (2 bytes) */ + Stream_Write_UINT16(s, header->flags); /* flags (2 bytes) */ Stream_Write_UINT32(s, header->pduLength); /* pduLength (4 bytes) */ return CHANNEL_RC_OK; } @@ -181,9 +178,9 @@ UINT rdpgfx_read_rect16(wStream* s, RECTANGLE_16* rect16) return ERROR_INVALID_DATA; } - Stream_Read_UINT16(s, rect16->left); /* left (2 bytes) */ - Stream_Read_UINT16(s, rect16->top); /* top (2 bytes) */ - Stream_Read_UINT16(s, rect16->right); /* right (2 bytes) */ + Stream_Read_UINT16(s, rect16->left); /* left (2 bytes) */ + Stream_Read_UINT16(s, rect16->top); /* top (2 bytes) */ + Stream_Read_UINT16(s, rect16->right); /* right (2 bytes) */ Stream_Read_UINT16(s, rect16->bottom); /* bottom (2 bytes) */ return CHANNEL_RC_OK; } @@ -195,9 +192,9 @@ UINT rdpgfx_read_rect16(wStream* s, RECTANGLE_16* rect16) */ UINT rdpgfx_write_rect16(wStream* s, const RECTANGLE_16* rect16) { - Stream_Write_UINT16(s, rect16->left); /* left (2 bytes) */ - Stream_Write_UINT16(s, rect16->top); /* top (2 bytes) */ - Stream_Write_UINT16(s, rect16->right); /* right (2 bytes) */ + Stream_Write_UINT16(s, rect16->left); /* left (2 bytes) */ + Stream_Write_UINT16(s, rect16->top); /* top (2 bytes) */ + Stream_Write_UINT16(s, rect16->right); /* right (2 bytes) */ Stream_Write_UINT16(s, rect16->bottom); /* bottom (2 bytes) */ return CHANNEL_RC_OK; } @@ -215,9 +212,9 @@ UINT rdpgfx_read_color32(wStream* s, RDPGFX_COLOR32* color32) return ERROR_INVALID_DATA; } - Stream_Read_UINT8(s, color32->B); /* B (1 byte) */ - Stream_Read_UINT8(s, color32->G); /* G (1 byte) */ - Stream_Read_UINT8(s, color32->R); /* R (1 byte) */ + Stream_Read_UINT8(s, color32->B); /* B (1 byte) */ + Stream_Read_UINT8(s, color32->G); /* G (1 byte) */ + Stream_Read_UINT8(s, color32->R); /* R (1 byte) */ Stream_Read_UINT8(s, color32->XA); /* XA (1 byte) */ return CHANNEL_RC_OK; } @@ -229,9 +226,9 @@ UINT rdpgfx_read_color32(wStream* s, RDPGFX_COLOR32* color32) */ UINT rdpgfx_write_color32(wStream* s, const RDPGFX_COLOR32* color32) { - Stream_Write_UINT8(s, color32->B); /* B (1 byte) */ - Stream_Write_UINT8(s, color32->G); /* G (1 byte) */ - Stream_Write_UINT8(s, color32->R); /* R (1 byte) */ + Stream_Write_UINT8(s, color32->B); /* B (1 byte) */ + Stream_Write_UINT8(s, color32->G); /* G (1 byte) */ + Stream_Write_UINT8(s, color32->R); /* R (1 byte) */ Stream_Write_UINT8(s, color32->XA); /* XA (1 byte) */ return CHANNEL_RC_OK; } diff --git a/channels/rdpgfx/rdpgfx_common.h b/channels/rdpgfx/rdpgfx_common.h index 4a7d6eca4..664c9cc08 100644 --- a/channels/rdpgfx/rdpgfx_common.h +++ b/channels/rdpgfx/rdpgfx_common.h @@ -44,10 +44,12 @@ FREERDP_LOCAL UINT rdpgfx_read_color32(wStream* s, RDPGFX_COLOR32* color32); FREERDP_LOCAL UINT rdpgfx_write_color32(wStream* s, const RDPGFX_COLOR32* color32); #ifdef WITH_DEBUG_RDPGFX -#define DEBUG_RDPGFX(_LOGGER,...) WLog_Print(_LOGGER, WLOG_DEBUG, __VA_ARGS__) +#define DEBUG_RDPGFX(_LOGGER, ...) WLog_Print(_LOGGER, WLOG_DEBUG, __VA_ARGS__) #else -#define DEBUG_RDPGFX(_LOGGER,...) do { } while (0) +#define DEBUG_RDPGFX(_LOGGER, ...) \ + do \ + { \ + } while (0) #endif #endif /* FREERDP_CHANNEL_RDPGFX_COMMON_H */ - diff --git a/channels/rdpgfx/server/rdpgfx_main.c b/channels/rdpgfx/server/rdpgfx_main.c index 793dcd1c3..34a77e06e 100644 --- a/channels/rdpgfx/server/rdpgfx_main.c +++ b/channels/rdpgfx/server/rdpgfx_main.c @@ -54,9 +54,7 @@ static INLINE UINT32 rdpgfx_pdu_length(UINT32 dataLen) return RDPGFX_HEADER_SIZE + dataLen; } - -static INLINE UINT rdpgfx_server_packet_init_header(wStream* s, - UINT16 cmdId, UINT32 pduLength) +static INLINE UINT rdpgfx_server_packet_init_header(wStream* s, UINT16 cmdId, UINT32 pduLength) { RDPGFX_HEADER header; header.flags = 0; @@ -74,8 +72,7 @@ static INLINE UINT rdpgfx_server_packet_init_header(wStream* s, * @param s stream * @param start saved start pos of the packet in the stream */ -static INLINE void rdpgfx_server_packet_complete_header(wStream* s, - size_t start) +static INLINE void rdpgfx_server_packet_complete_header(wStream* s, size_t start) { size_t current = Stream_GetPosition(s); /* Fill actual length */ @@ -102,8 +99,7 @@ static UINT rdpgfx_server_packet_send(RdpgfxServerContext* context, wStream* s) /* Allocate new stream with enough capacity. Additional overhead is * descriptor (1 bytes) + segmentCount (2 bytes) + uncompressedSize (4 bytes) * + segmentCount * size (4 bytes) */ - fs = Stream_New(NULL, SrcSize + 7 - + (SrcSize / ZGFX_SEGMENTED_MAXSIZE + 1) * 4); + fs = Stream_New(NULL, SrcSize + 7 + (SrcSize / ZGFX_SEGMENTED_MAXSIZE + 1) * 4); if (!fs) { @@ -112,16 +108,14 @@ static UINT rdpgfx_server_packet_send(RdpgfxServerContext* context, wStream* s) goto out; } - if (zgfx_compress_to_stream(context->priv->zgfx, fs, pSrcData, - SrcSize, &flags) < 0) + if (zgfx_compress_to_stream(context->priv->zgfx, fs, pSrcData, SrcSize, &flags) < 0) { WLog_ERR(TAG, "zgfx_compress_to_stream failed!"); error = ERROR_INTERNAL_ERROR; goto out; } - if (!WTSVirtualChannelWrite(context->priv->rdpgfx_channel, - (PCHAR) Stream_Buffer(fs), + if (!WTSVirtualChannelWrite(context->priv->rdpgfx_channel, (PCHAR)Stream_Buffer(fs), Stream_GetPosition(fs), &written)) { WLog_ERR(TAG, "WTSVirtualChannelWrite failed!"); @@ -131,8 +125,8 @@ static UINT rdpgfx_server_packet_send(RdpgfxServerContext* context, wStream* s) if (written < Stream_GetPosition(fs)) { - WLog_WARN(TAG, "Unexpected bytes written: %"PRIu32"/%"PRIuz"", - written, Stream_GetPosition(fs)); + WLog_WARN(TAG, "Unexpected bytes written: %" PRIu32 "/%" PRIuz "", written, + Stream_GetPosition(fs)); } error = CHANNEL_RC_OK; @@ -169,7 +163,7 @@ static wStream* rdpgfx_server_single_packet_new(UINT16 cmdId, UINT32 dataLen) if ((error = rdpgfx_server_packet_init_header(s, cmdId, pduLength))) { - WLog_ERR(TAG, "Failed to init header with error %"PRIu32"!", error); + WLog_ERR(TAG, "Failed to init header with error %" PRIu32 "!", error); goto error; } @@ -187,8 +181,7 @@ error: * * @return 0 on success, otherwise a Win32 error code */ -static INLINE UINT rdpgfx_server_single_packet_send( - RdpgfxServerContext* context, wStream* s) +static INLINE UINT rdpgfx_server_single_packet_send(RdpgfxServerContext* context, wStream* s) { /* Fill actual length */ rdpgfx_server_packet_complete_header(s, 0); @@ -201,11 +194,11 @@ static INLINE UINT rdpgfx_server_single_packet_send( * @return 0 on success, otherwise a Win32 error code */ static UINT rdpgfx_send_caps_confirm_pdu(RdpgfxServerContext* context, - const RDPGFX_CAPS_CONFIRM_PDU* capsConfirm) + const RDPGFX_CAPS_CONFIRM_PDU* capsConfirm) { RDPGFX_CAPSET* capsSet = capsConfirm->capsSet; - wStream* s = rdpgfx_server_single_packet_new( - RDPGFX_CMDID_CAPSCONFIRM, RDPGFX_CAPSET_BASE_SIZE + capsSet->length); + wStream* s = rdpgfx_server_single_packet_new(RDPGFX_CMDID_CAPSCONFIRM, + RDPGFX_CAPSET_BASE_SIZE + capsSet->length); if (!s) { @@ -214,7 +207,7 @@ static UINT rdpgfx_send_caps_confirm_pdu(RdpgfxServerContext* context, } Stream_Write_UINT32(s, capsSet->version); /* version (4 bytes) */ - Stream_Write_UINT32(s, capsSet->length); /* capsDataLength (4 bytes) */ + Stream_Write_UINT32(s, capsSet->length); /* capsDataLength (4 bytes) */ if (capsSet->length >= 4) { @@ -233,7 +226,7 @@ static UINT rdpgfx_send_caps_confirm_pdu(RdpgfxServerContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT rdpgfx_send_reset_graphics_pdu(RdpgfxServerContext* context, - const RDPGFX_RESET_GRAPHICS_PDU* pdu) + const RDPGFX_RESET_GRAPHICS_PDU* pdu) { UINT32 index; MONITOR_DEF* monitor; @@ -242,14 +235,13 @@ static UINT rdpgfx_send_reset_graphics_pdu(RdpgfxServerContext* context, /* Check monitorCount. This ensures total size within 340 bytes) */ if (pdu->monitorCount >= 16) { - WLog_ERR(TAG, "Monitor count MUST be less than or equal to 16: %"PRIu32"", + WLog_ERR(TAG, "Monitor count MUST be less than or equal to 16: %" PRIu32 "", pdu->monitorCount); return ERROR_INVALID_DATA; } - s = rdpgfx_server_single_packet_new( - RDPGFX_CMDID_RESETGRAPHICS, - RDPGFX_RESET_GRAPHICS_PDU_SIZE - RDPGFX_HEADER_SIZE); + s = rdpgfx_server_single_packet_new(RDPGFX_CMDID_RESETGRAPHICS, + RDPGFX_RESET_GRAPHICS_PDU_SIZE - RDPGFX_HEADER_SIZE); if (!s) { @@ -257,18 +249,18 @@ static UINT rdpgfx_send_reset_graphics_pdu(RdpgfxServerContext* context, return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT32(s, pdu->width); /* width (4 bytes) */ - Stream_Write_UINT32(s, pdu->height); /* height (4 bytes) */ + Stream_Write_UINT32(s, pdu->width); /* width (4 bytes) */ + Stream_Write_UINT32(s, pdu->height); /* height (4 bytes) */ Stream_Write_UINT32(s, pdu->monitorCount); /* monitorCount (4 bytes) */ for (index = 0; index < pdu->monitorCount; index++) { monitor = &(pdu->monitorDefArray[index]); - Stream_Write_UINT32(s, monitor->left); /* left (4 bytes) */ - Stream_Write_UINT32(s, monitor->top); /* top (4 bytes) */ - Stream_Write_UINT32(s, monitor->right); /* right (4 bytes) */ + Stream_Write_UINT32(s, monitor->left); /* left (4 bytes) */ + Stream_Write_UINT32(s, monitor->top); /* top (4 bytes) */ + Stream_Write_UINT32(s, monitor->right); /* right (4 bytes) */ Stream_Write_UINT32(s, monitor->bottom); /* bottom (4 bytes) */ - Stream_Write_UINT32(s, monitor->flags); /* flags (4 bytes) */ + Stream_Write_UINT32(s, monitor->flags); /* flags (4 bytes) */ } /* pad (total size must be 340 bytes) */ @@ -282,7 +274,7 @@ static UINT rdpgfx_send_reset_graphics_pdu(RdpgfxServerContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT rdpgfx_send_evict_cache_entry_pdu(RdpgfxServerContext* context, - const RDPGFX_EVICT_CACHE_ENTRY_PDU* pdu) + const RDPGFX_EVICT_CACHE_ENTRY_PDU* pdu) { wStream* s = rdpgfx_server_single_packet_new(RDPGFX_CMDID_EVICTCACHEENTRY, 2); @@ -302,12 +294,11 @@ static UINT rdpgfx_send_evict_cache_entry_pdu(RdpgfxServerContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT rdpgfx_send_cache_import_reply_pdu(RdpgfxServerContext* context, - const RDPGFX_CACHE_IMPORT_REPLY_PDU* pdu) + const RDPGFX_CACHE_IMPORT_REPLY_PDU* pdu) { UINT16 index; - wStream* s = rdpgfx_server_single_packet_new( - RDPGFX_CMDID_CACHEIMPORTREPLY, - 2 + 2 * pdu->importedEntriesCount); + wStream* s = rdpgfx_server_single_packet_new(RDPGFX_CMDID_CACHEIMPORTREPLY, + 2 + 2 * pdu->importedEntriesCount); if (!s) { @@ -332,7 +323,7 @@ static UINT rdpgfx_send_cache_import_reply_pdu(RdpgfxServerContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT rdpgfx_send_create_surface_pdu(RdpgfxServerContext* context, - const RDPGFX_CREATE_SURFACE_PDU* pdu) + const RDPGFX_CREATE_SURFACE_PDU* pdu) { wStream* s = rdpgfx_server_single_packet_new(RDPGFX_CMDID_CREATESURFACE, 7); @@ -342,9 +333,9 @@ static UINT rdpgfx_send_create_surface_pdu(RdpgfxServerContext* context, return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT16(s, pdu->surfaceId); /* surfaceId (2 bytes) */ - Stream_Write_UINT16(s, pdu->width); /* width (2 bytes) */ - Stream_Write_UINT16(s, pdu->height); /* height (2 bytes) */ + Stream_Write_UINT16(s, pdu->surfaceId); /* surfaceId (2 bytes) */ + Stream_Write_UINT16(s, pdu->width); /* width (2 bytes) */ + Stream_Write_UINT16(s, pdu->height); /* height (2 bytes) */ Stream_Write_UINT8(s, pdu->pixelFormat); /* RDPGFX_PIXELFORMAT (1 byte) */ return rdpgfx_server_single_packet_send(context, s); } @@ -355,7 +346,7 @@ static UINT rdpgfx_send_create_surface_pdu(RdpgfxServerContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT rdpgfx_send_delete_surface_pdu(RdpgfxServerContext* context, - const RDPGFX_DELETE_SURFACE_PDU* pdu) + const RDPGFX_DELETE_SURFACE_PDU* pdu) { wStream* s = rdpgfx_server_single_packet_new(RDPGFX_CMDID_DELETESURFACE, 2); @@ -369,15 +360,13 @@ static UINT rdpgfx_send_delete_surface_pdu(RdpgfxServerContext* context, return rdpgfx_server_single_packet_send(context, s); } -static INLINE void rdpgfx_write_start_frame_pdu(wStream* s, - const RDPGFX_START_FRAME_PDU* pdu) +static INLINE void rdpgfx_write_start_frame_pdu(wStream* s, const RDPGFX_START_FRAME_PDU* pdu) { Stream_Write_UINT32(s, pdu->timestamp); /* timestamp (4 bytes) */ - Stream_Write_UINT32(s, pdu->frameId); /* frameId (4 bytes) */ + Stream_Write_UINT32(s, pdu->frameId); /* frameId (4 bytes) */ } -static INLINE void rdpgfx_write_end_frame_pdu(wStream* s, - const RDPGFX_END_FRAME_PDU* pdu) +static INLINE void rdpgfx_write_end_frame_pdu(wStream* s, const RDPGFX_END_FRAME_PDU* pdu) { Stream_Write_UINT32(s, pdu->frameId); /* frameId (4 bytes) */ } @@ -390,9 +379,8 @@ static INLINE void rdpgfx_write_end_frame_pdu(wStream* s, static UINT rdpgfx_send_start_frame_pdu(RdpgfxServerContext* context, const RDPGFX_START_FRAME_PDU* pdu) { - wStream* s = rdpgfx_server_single_packet_new( - RDPGFX_CMDID_STARTFRAME, - RDPGFX_START_FRAME_PDU_SIZE); + wStream* s = + rdpgfx_server_single_packet_new(RDPGFX_CMDID_STARTFRAME, RDPGFX_START_FRAME_PDU_SIZE); if (!s) { @@ -409,12 +397,9 @@ static UINT rdpgfx_send_start_frame_pdu(RdpgfxServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_send_end_frame_pdu(RdpgfxServerContext* context, - const RDPGFX_END_FRAME_PDU* pdu) +static UINT rdpgfx_send_end_frame_pdu(RdpgfxServerContext* context, const RDPGFX_END_FRAME_PDU* pdu) { - wStream* s = rdpgfx_server_single_packet_new( - RDPGFX_CMDID_ENDFRAME, - RDPGFX_END_FRAME_PDU_SIZE); + wStream* s = rdpgfx_server_single_packet_new(RDPGFX_CMDID_ENDFRAME, RDPGFX_END_FRAME_PDU_SIZE); if (!s) { @@ -432,14 +417,13 @@ static UINT rdpgfx_send_end_frame_pdu(RdpgfxServerContext* context, * * @return estimated size */ -static INLINE UINT32 rdpgfx_estimate_h264_avc420( - const RDPGFX_AVC420_BITMAP_STREAM* havc420) +static INLINE UINT32 rdpgfx_estimate_h264_avc420(const RDPGFX_AVC420_BITMAP_STREAM* havc420) { /* H264 metadata + H264 stream. See rdpgfx_write_h264_avc420 */ return sizeof(UINT32) /* numRegionRects */ - + 10 /* regionRects + quantQualityVals */ - * havc420->meta.numRegionRects - + havc420->length; + + 10 /* regionRects + quantQualityVals */ + * havc420->meta.numRegionRects + + havc420->length; } /** @@ -448,8 +432,7 @@ static INLINE UINT32 rdpgfx_estimate_h264_avc420( * * @return estimated size */ -static INLINE UINT32 rdpgfx_estimate_surface_command(const RDPGFX_SURFACE_COMMAND* - cmd) +static INLINE UINT32 rdpgfx_estimate_surface_command(const RDPGFX_SURFACE_COMMAND* cmd) { RDPGFX_AVC420_BITMAP_STREAM* havc420 = NULL; RDPGFX_AVC444_BITMAP_STREAM* havc444 = NULL; @@ -529,7 +512,7 @@ static UINT rdpgfx_write_h264_metablock(wStream* s, const RDPGFX_H264_METABLOCK* if ((error = rdpgfx_write_rect16(s, regionRect))) { - WLog_ERR(TAG, "rdpgfx_write_rect16 failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpgfx_write_rect16 failed with error %" PRIu32 "!", error); return error; } } @@ -537,9 +520,8 @@ static UINT rdpgfx_write_h264_metablock(wStream* s, const RDPGFX_H264_METABLOCK* for (index = 0; index < meta->numRegionRects; index++) { quantQualityVal = &(meta->quantQualityVals[index]); - Stream_Write_UINT8(s, quantQualityVal->qp - | (quantQualityVal->r << 6) - | (quantQualityVal->p << 7)); /* qpVal (1 byte) */ + Stream_Write_UINT8(s, quantQualityVal->qp | (quantQualityVal->r << 6) | + (quantQualityVal->p << 7)); /* qpVal (1 byte) */ /* qualityVal (1 byte) */ Stream_Write_UINT8(s, quantQualityVal->qualityVal); } @@ -553,15 +535,13 @@ static UINT rdpgfx_write_h264_metablock(wStream* s, const RDPGFX_H264_METABLOCK* * * @return 0 on success, otherwise a Win32 error code */ -static INLINE UINT rdpgfx_write_h264_avc420(wStream* s, - RDPGFX_AVC420_BITMAP_STREAM* havc420) +static INLINE UINT rdpgfx_write_h264_avc420(wStream* s, RDPGFX_AVC420_BITMAP_STREAM* havc420) { UINT error = CHANNEL_RC_OK; if ((error = rdpgfx_write_h264_metablock(s, &(havc420->meta)))) { - WLog_ERR(TAG, "rdpgfx_write_h264_metablock failed with error %"PRIu32"!", - error); + WLog_ERR(TAG, "rdpgfx_write_h264_metablock failed with error %" PRIu32 "!", error); return error; } @@ -579,8 +559,7 @@ static INLINE UINT rdpgfx_write_h264_avc420(wStream* s, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_write_surface_command(wStream* s, - const RDPGFX_SURFACE_COMMAND* cmd) +static UINT rdpgfx_write_surface_command(wStream* s, const RDPGFX_SURFACE_COMMAND* cmd) { UINT error = CHANNEL_RC_OK; RDPGFX_AVC420_BITMAP_STREAM* havc420 = NULL; @@ -609,23 +588,23 @@ static UINT rdpgfx_write_surface_command(wStream* s, { /* Write RDPGFX_CMDID_WIRETOSURFACE_2 format for CAPROGRESSIVE */ Stream_Write_UINT16(s, cmd->surfaceId); /* surfaceId (2 bytes) */ - Stream_Write_UINT16(s, cmd->codecId); /* codecId (2 bytes) */ + Stream_Write_UINT16(s, cmd->codecId); /* codecId (2 bytes) */ Stream_Write_UINT32(s, cmd->contextId); /* codecContextId (4 bytes) */ - Stream_Write_UINT8(s, pixelFormat); /* pixelFormat (1 byte) */ - Stream_Write_UINT32(s, cmd->length); /* bitmapDataLength (4 bytes) */ + Stream_Write_UINT8(s, pixelFormat); /* pixelFormat (1 byte) */ + Stream_Write_UINT32(s, cmd->length); /* bitmapDataLength (4 bytes) */ Stream_Write(s, cmd->data, cmd->length); } else { /* Write RDPGFX_CMDID_WIRETOSURFACE_1 format for others */ Stream_Write_UINT16(s, cmd->surfaceId); /* surfaceId (2 bytes) */ - Stream_Write_UINT16(s, cmd->codecId); /* codecId (2 bytes) */ - Stream_Write_UINT8(s, pixelFormat); /* pixelFormat (1 byte) */ - Stream_Write_UINT16(s, cmd->left); /* left (2 bytes) */ - Stream_Write_UINT16(s, cmd->top); /* top (2 bytes) */ - Stream_Write_UINT16(s, cmd->right); /* right (2 bytes) */ - Stream_Write_UINT16(s, cmd->bottom); /* bottom (2 bytes) */ - Stream_Write_UINT32(s, cmd->length); /* bitmapDataLength (4 bytes) */ + Stream_Write_UINT16(s, cmd->codecId); /* codecId (2 bytes) */ + Stream_Write_UINT8(s, pixelFormat); /* pixelFormat (1 byte) */ + Stream_Write_UINT16(s, cmd->left); /* left (2 bytes) */ + Stream_Write_UINT16(s, cmd->top); /* top (2 bytes) */ + Stream_Write_UINT16(s, cmd->right); /* right (2 bytes) */ + Stream_Write_UINT16(s, cmd->bottom); /* bottom (2 bytes) */ + Stream_Write_UINT32(s, cmd->length); /* bitmapDataLength (4 bytes) */ bitmapDataStart = Stream_GetPosition(s); if (cmd->codecId == RDPGFX_CODECID_AVC420) @@ -639,10 +618,11 @@ static UINT rdpgfx_write_surface_command(wStream* s, return error; } } - else if ((cmd->codecId == RDPGFX_CODECID_AVC444) || (cmd->codecId == RDPGFX_CODECID_AVC444v2)) + else if ((cmd->codecId == RDPGFX_CODECID_AVC444) || + (cmd->codecId == RDPGFX_CODECID_AVC444v2)) { havc444 = (RDPGFX_AVC444_BITMAP_STREAM*)cmd->extra; - havc420 = &(havc444->bitstream[0]); /* avc420EncodedBitstreamInfo (4 bytes) */ + havc420 = &(havc444->bitstream[0]); /* avc420EncodedBitstreamInfo (4 bytes) */ Stream_Write_UINT32(s, havc444->cbAvc420EncodedBitstream1 | (havc444->LC << 30UL)); /* avc420EncodedBitstream1 */ error = rdpgfx_write_h264_avc420(s, havc420); @@ -693,9 +673,8 @@ static UINT rdpgfx_send_surface_command(RdpgfxServerContext* context, { UINT error = CHANNEL_RC_OK; wStream* s; - s = rdpgfx_server_single_packet_new( - rdpgfx_surface_command_cmdid(cmd), - rdpgfx_estimate_surface_command(cmd)); + s = rdpgfx_server_single_packet_new(rdpgfx_surface_command_cmdid(cmd), + rdpgfx_estimate_surface_command(cmd)); if (!s) { @@ -726,8 +705,9 @@ error: * @return 0 on success, otherwise a Win32 error code */ static UINT rdpgfx_send_surface_frame_command(RdpgfxServerContext* context, - const RDPGFX_SURFACE_COMMAND* cmd, const RDPGFX_START_FRAME_PDU* startFrame, - const RDPGFX_END_FRAME_PDU* endFrame) + const RDPGFX_SURFACE_COMMAND* cmd, + const RDPGFX_START_FRAME_PDU* startFrame, + const RDPGFX_END_FRAME_PDU* endFrame) { UINT error = CHANNEL_RC_OK; @@ -757,12 +737,11 @@ static UINT rdpgfx_send_surface_frame_command(RdpgfxServerContext* context, if (startFrame) { position = Stream_GetPosition(s); - error = rdpgfx_server_packet_init_header(s, - RDPGFX_CMDID_STARTFRAME, 0); + error = rdpgfx_server_packet_init_header(s, RDPGFX_CMDID_STARTFRAME, 0); if (error != CHANNEL_RC_OK) { - WLog_ERR(TAG, "Failed to init header with error %"PRIu32"!", error); + WLog_ERR(TAG, "Failed to init header with error %" PRIu32 "!", error); goto error; } @@ -772,13 +751,12 @@ static UINT rdpgfx_send_surface_frame_command(RdpgfxServerContext* context, /* Write RDPGFX_CMDID_WIRETOSURFACE_1 or RDPGFX_CMDID_WIRETOSURFACE_2 */ position = Stream_GetPosition(s); - error = rdpgfx_server_packet_init_header(s, - rdpgfx_surface_command_cmdid(cmd), - 0); // Actual length will be filled later + error = rdpgfx_server_packet_init_header(s, rdpgfx_surface_command_cmdid(cmd), + 0); // Actual length will be filled later if (error != CHANNEL_RC_OK) { - WLog_ERR(TAG, "Failed to init header with error %"PRIu32"!", error); + WLog_ERR(TAG, "Failed to init header with error %" PRIu32 "!", error); goto error; } @@ -796,12 +774,11 @@ static UINT rdpgfx_send_surface_frame_command(RdpgfxServerContext* context, if (endFrame) { position = Stream_GetPosition(s); - error = rdpgfx_server_packet_init_header(s, - RDPGFX_CMDID_ENDFRAME, 0); + error = rdpgfx_server_packet_init_header(s, RDPGFX_CMDID_ENDFRAME, 0); if (error != CHANNEL_RC_OK) { - WLog_ERR(TAG, "Failed to init header with error %"PRIu32"!", error); + WLog_ERR(TAG, "Failed to init header with error %" PRIu32 "!", error); goto error; } @@ -820,12 +797,10 @@ error: * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_send_delete_encoding_context_pdu(RdpgfxServerContext* - context, - const RDPGFX_DELETE_ENCODING_CONTEXT_PDU* pdu) +static UINT rdpgfx_send_delete_encoding_context_pdu(RdpgfxServerContext* context, + const RDPGFX_DELETE_ENCODING_CONTEXT_PDU* pdu) { - wStream* s = rdpgfx_server_single_packet_new( - RDPGFX_CMDID_DELETEENCODINGCONTEXT, 6); + wStream* s = rdpgfx_server_single_packet_new(RDPGFX_CMDID_DELETEENCODINGCONTEXT, 6); if (!s) { @@ -833,7 +808,7 @@ static UINT rdpgfx_send_delete_encoding_context_pdu(RdpgfxServerContext* return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT16(s, pdu->surfaceId); /* surfaceId (2 bytes) */ + Stream_Write_UINT16(s, pdu->surfaceId); /* surfaceId (2 bytes) */ Stream_Write_UINT32(s, pdu->codecContextId); /* codecContextId (4 bytes) */ return rdpgfx_server_single_packet_send(context, s); } @@ -849,9 +824,8 @@ static UINT rdpgfx_send_solid_fill_pdu(RdpgfxServerContext* context, UINT error = CHANNEL_RC_OK; UINT16 index; RECTANGLE_16* fillRect; - wStream* s = rdpgfx_server_single_packet_new( - RDPGFX_CMDID_SOLIDFILL, - 8 + 8 * pdu->fillRectCount); + wStream* s = + rdpgfx_server_single_packet_new(RDPGFX_CMDID_SOLIDFILL, 8 + 8 * pdu->fillRectCount); if (!s) { @@ -864,7 +838,7 @@ static UINT rdpgfx_send_solid_fill_pdu(RdpgfxServerContext* context, /* fillPixel (4 bytes) */ if ((error = rdpgfx_write_color32(s, &(pdu->fillPixel)))) { - WLog_ERR(TAG, "rdpgfx_write_color32 failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpgfx_write_color32 failed with error %" PRIu32 "!", error); goto error; } @@ -876,7 +850,7 @@ static UINT rdpgfx_send_solid_fill_pdu(RdpgfxServerContext* context, if ((error = rdpgfx_write_rect16(s, fillRect))) { - WLog_ERR(TAG, "rdpgfx_write_rect16 failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpgfx_write_rect16 failed with error %" PRIu32 "!", error); goto error; } } @@ -893,14 +867,13 @@ error: * @return 0 on success, otherwise a Win32 error code */ static UINT rdpgfx_send_surface_to_surface_pdu(RdpgfxServerContext* context, - const RDPGFX_SURFACE_TO_SURFACE_PDU* pdu) + const RDPGFX_SURFACE_TO_SURFACE_PDU* pdu) { UINT error = CHANNEL_RC_OK; UINT16 index; RDPGFX_POINT16* destPt; - wStream* s = rdpgfx_server_single_packet_new( - RDPGFX_CMDID_SURFACETOSURFACE, - 14 + 4 * pdu->destPtsCount); + wStream* s = + rdpgfx_server_single_packet_new(RDPGFX_CMDID_SURFACETOSURFACE, 14 + 4 * pdu->destPtsCount); if (!s) { @@ -908,13 +881,13 @@ static UINT rdpgfx_send_surface_to_surface_pdu(RdpgfxServerContext* context, return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT16(s, pdu->surfaceIdSrc); /* surfaceIdSrc (2 bytes) */ + Stream_Write_UINT16(s, pdu->surfaceIdSrc); /* surfaceIdSrc (2 bytes) */ Stream_Write_UINT16(s, pdu->surfaceIdDest); /* surfaceIdDest (2 bytes) */ /* rectSrc (8 bytes ) */ if ((error = rdpgfx_write_rect16(s, &(pdu->rectSrc)))) { - WLog_ERR(TAG, "rdpgfx_write_rect16 failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpgfx_write_rect16 failed with error %" PRIu32 "!", error); goto error; } @@ -926,7 +899,7 @@ static UINT rdpgfx_send_surface_to_surface_pdu(RdpgfxServerContext* context, if ((error = rdpgfx_write_point16(s, destPt))) { - WLog_ERR(TAG, "rdpgfx_write_point16 failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpgfx_write_point16 failed with error %" PRIu32 "!", error); goto error; } } @@ -943,11 +916,10 @@ error: * @return 0 on success, otherwise a Win32 error code */ static UINT rdpgfx_send_surface_to_cache_pdu(RdpgfxServerContext* context, - const RDPGFX_SURFACE_TO_CACHE_PDU* pdu) + const RDPGFX_SURFACE_TO_CACHE_PDU* pdu) { UINT error = CHANNEL_RC_OK; - wStream* s = rdpgfx_server_single_packet_new( - RDPGFX_CMDID_SURFACETOCACHE, 20); + wStream* s = rdpgfx_server_single_packet_new(RDPGFX_CMDID_SURFACETOCACHE, 20); if (!s) { @@ -956,13 +928,13 @@ static UINT rdpgfx_send_surface_to_cache_pdu(RdpgfxServerContext* context, } Stream_Write_UINT16(s, pdu->surfaceId); /* surfaceId (2 bytes) */ - Stream_Write_UINT64(s, pdu->cacheKey); /* cacheKey (8 bytes) */ + Stream_Write_UINT64(s, pdu->cacheKey); /* cacheKey (8 bytes) */ Stream_Write_UINT16(s, pdu->cacheSlot); /* cacheSlot (2 bytes) */ /* rectSrc (8 bytes ) */ if ((error = rdpgfx_write_rect16(s, &(pdu->rectSrc)))) { - WLog_ERR(TAG, "rdpgfx_write_rect16 failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpgfx_write_rect16 failed with error %" PRIu32 "!", error); goto error; } @@ -978,14 +950,13 @@ error: * @return 0 on success, otherwise a Win32 error code */ static UINT rdpgfx_send_cache_to_surface_pdu(RdpgfxServerContext* context, - const RDPGFX_CACHE_TO_SURFACE_PDU* pdu) + const RDPGFX_CACHE_TO_SURFACE_PDU* pdu) { UINT error = CHANNEL_RC_OK; UINT16 index; RDPGFX_POINT16* destPt; - wStream* s = rdpgfx_server_single_packet_new( - RDPGFX_CMDID_CACHETOSURFACE, - 6 + 4 * pdu->destPtsCount); + wStream* s = + rdpgfx_server_single_packet_new(RDPGFX_CMDID_CACHETOSURFACE, 6 + 4 * pdu->destPtsCount); if (!s) { @@ -993,8 +964,8 @@ static UINT rdpgfx_send_cache_to_surface_pdu(RdpgfxServerContext* context, return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT16(s, pdu->cacheSlot); /* cacheSlot (2 bytes) */ - Stream_Write_UINT16(s, pdu->surfaceId); /* surfaceId (2 bytes) */ + Stream_Write_UINT16(s, pdu->cacheSlot); /* cacheSlot (2 bytes) */ + Stream_Write_UINT16(s, pdu->surfaceId); /* surfaceId (2 bytes) */ Stream_Write_UINT16(s, pdu->destPtsCount); /* destPtsCount (2 bytes) */ for (index = 0; index < pdu->destPtsCount; index++) @@ -1003,7 +974,7 @@ static UINT rdpgfx_send_cache_to_surface_pdu(RdpgfxServerContext* context, if ((error = rdpgfx_write_point16(s, destPt))) { - WLog_ERR(TAG, "rdpgfx_write_point16 failed with error %"PRIu32"", error); + WLog_ERR(TAG, "rdpgfx_write_point16 failed with error %" PRIu32 "", error); goto error; } } @@ -1020,10 +991,9 @@ error: * @return 0 on success, otherwise a Win32 error code */ static UINT rdpgfx_send_map_surface_to_output_pdu(RdpgfxServerContext* context, - const RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* pdu) + const RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* pdu) { - wStream* s = rdpgfx_server_single_packet_new( - RDPGFX_CMDID_MAPSURFACETOOUTPUT, 12); + wStream* s = rdpgfx_server_single_packet_new(RDPGFX_CMDID_MAPSURFACETOOUTPUT, 12); if (!s) { @@ -1031,8 +1001,8 @@ static UINT rdpgfx_send_map_surface_to_output_pdu(RdpgfxServerContext* context, return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT16(s, pdu->surfaceId); /* surfaceId (2 bytes) */ - Stream_Write_UINT16(s, 0); /* reserved (2 bytes). Must be 0 */ + Stream_Write_UINT16(s, pdu->surfaceId); /* surfaceId (2 bytes) */ + Stream_Write_UINT16(s, 0); /* reserved (2 bytes). Must be 0 */ Stream_Write_UINT32(s, pdu->outputOriginX); /* outputOriginX (4 bytes) */ Stream_Write_UINT32(s, pdu->outputOriginY); /* outputOriginY (4 bytes) */ return rdpgfx_server_single_packet_send(context, s); @@ -1044,10 +1014,9 @@ static UINT rdpgfx_send_map_surface_to_output_pdu(RdpgfxServerContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT rdpgfx_send_map_surface_to_window_pdu(RdpgfxServerContext* context, - const RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* pdu) + const RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* pdu) { - wStream* s = rdpgfx_server_single_packet_new( - RDPGFX_CMDID_MAPSURFACETOWINDOW, 18); + wStream* s = rdpgfx_server_single_packet_new(RDPGFX_CMDID_MAPSURFACETOWINDOW, 18); if (!s) { @@ -1055,18 +1024,18 @@ static UINT rdpgfx_send_map_surface_to_window_pdu(RdpgfxServerContext* context, return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT16(s, pdu->surfaceId); /* surfaceId (2 bytes) */ - Stream_Write_UINT64(s, pdu->windowId); /* windowId (8 bytes) */ - Stream_Write_UINT32(s, pdu->mappedWidth); /* mappedWidth (4 bytes) */ + Stream_Write_UINT16(s, pdu->surfaceId); /* surfaceId (2 bytes) */ + Stream_Write_UINT64(s, pdu->windowId); /* windowId (8 bytes) */ + Stream_Write_UINT32(s, pdu->mappedWidth); /* mappedWidth (4 bytes) */ Stream_Write_UINT32(s, pdu->mappedHeight); /* mappedHeight (4 bytes) */ return rdpgfx_server_single_packet_send(context, s); } -static UINT rdpgfx_send_map_surface_to_scaled_window_pdu(RdpgfxServerContext* context, - const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* pdu) +static UINT +rdpgfx_send_map_surface_to_scaled_window_pdu(RdpgfxServerContext* context, + const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* pdu) { - wStream* s = rdpgfx_server_single_packet_new( - RDPGFX_CMDID_MAPSURFACETOWINDOW, 26); + wStream* s = rdpgfx_server_single_packet_new(RDPGFX_CMDID_MAPSURFACETOWINDOW, 26); if (!s) { @@ -1074,11 +1043,11 @@ static UINT rdpgfx_send_map_surface_to_scaled_window_pdu(RdpgfxServerContext* co return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT16(s, pdu->surfaceId); /* surfaceId (2 bytes) */ - Stream_Write_UINT64(s, pdu->windowId); /* windowId (8 bytes) */ - Stream_Write_UINT32(s, pdu->mappedWidth); /* mappedWidth (4 bytes) */ + Stream_Write_UINT16(s, pdu->surfaceId); /* surfaceId (2 bytes) */ + Stream_Write_UINT64(s, pdu->windowId); /* windowId (8 bytes) */ + Stream_Write_UINT32(s, pdu->mappedWidth); /* mappedWidth (4 bytes) */ Stream_Write_UINT32(s, pdu->mappedHeight); /* mappedHeight (4 bytes) */ - Stream_Write_UINT32(s, pdu->targetWidth); /* targetWidth (4 bytes) */ + Stream_Write_UINT32(s, pdu->targetWidth); /* targetWidth (4 bytes) */ Stream_Write_UINT32(s, pdu->targetHeight); /* targetHeight (4 bytes) */ return rdpgfx_server_single_packet_send(context, s); } @@ -1088,8 +1057,7 @@ static UINT rdpgfx_send_map_surface_to_scaled_window_pdu(RdpgfxServerContext* co * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_frame_acknowledge_pdu(RdpgfxServerContext* context, - wStream* s) +static UINT rdpgfx_recv_frame_acknowledge_pdu(RdpgfxServerContext* context, wStream* s) { RDPGFX_FRAME_ACKNOWLEDGE_PDU pdu; UINT error = CHANNEL_RC_OK; @@ -1100,8 +1068,8 @@ static UINT rdpgfx_recv_frame_acknowledge_pdu(RdpgfxServerContext* context, return ERROR_INVALID_DATA; } - Stream_Read_UINT32(s, pdu.queueDepth); /* queueDepth (4 bytes) */ - Stream_Read_UINT32(s, pdu.frameId); /* frameId (4 bytes) */ + Stream_Read_UINT32(s, pdu.queueDepth); /* queueDepth (4 bytes) */ + Stream_Read_UINT32(s, pdu.frameId); /* frameId (4 bytes) */ Stream_Read_UINT32(s, pdu.totalFramesDecoded); /* totalFramesDecoded (4 bytes) */ if (context) @@ -1109,8 +1077,7 @@ static UINT rdpgfx_recv_frame_acknowledge_pdu(RdpgfxServerContext* context, IFCALLRET(context->FrameAcknowledge, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->FrameAcknowledge failed with error %"PRIu32"", - error); + WLog_ERR(TAG, "context->FrameAcknowledge failed with error %" PRIu32 "", error); } return error; @@ -1121,8 +1088,7 @@ static UINT rdpgfx_recv_frame_acknowledge_pdu(RdpgfxServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_cache_import_offer_pdu(RdpgfxServerContext* context, - wStream* s) +static UINT rdpgfx_recv_cache_import_offer_pdu(RdpgfxServerContext* context, wStream* s) { UINT16 index; RDPGFX_CACHE_IMPORT_OFFER_PDU pdu; @@ -1141,7 +1107,7 @@ static UINT rdpgfx_recv_cache_import_offer_pdu(RdpgfxServerContext* context, if (pdu.cacheEntriesCount <= 0) { /* According to the latest spec, capsSetCount <= 3 */ - WLog_ERR(TAG, "Invalid cacheEntriesCount: %"PRIu16"", pdu.cacheEntriesCount); + WLog_ERR(TAG, "Invalid cacheEntriesCount: %" PRIu16 "", pdu.cacheEntriesCount); return ERROR_INVALID_DATA; } @@ -1151,9 +1117,8 @@ static UINT rdpgfx_recv_cache_import_offer_pdu(RdpgfxServerContext* context, return ERROR_INVALID_DATA; } - pdu.cacheEntries = (RDPGFX_CACHE_ENTRY_METADATA*) - calloc(pdu.cacheEntriesCount, - sizeof(RDPGFX_CACHE_ENTRY_METADATA)); + pdu.cacheEntries = (RDPGFX_CACHE_ENTRY_METADATA*)calloc(pdu.cacheEntriesCount, + sizeof(RDPGFX_CACHE_ENTRY_METADATA)); if (!pdu.cacheEntries) { @@ -1164,7 +1129,7 @@ static UINT rdpgfx_recv_cache_import_offer_pdu(RdpgfxServerContext* context, for (index = 0; index < pdu.cacheEntriesCount; index++) { cacheEntries = &(pdu.cacheEntries[index]); - Stream_Read_UINT64(s, cacheEntries->cacheKey); /* cacheKey (8 bytes) */ + Stream_Read_UINT64(s, cacheEntries->cacheKey); /* cacheKey (8 bytes) */ Stream_Read_UINT32(s, cacheEntries->bitmapLength); /* bitmapLength (4 bytes) */ } @@ -1173,8 +1138,7 @@ static UINT rdpgfx_recv_cache_import_offer_pdu(RdpgfxServerContext* context, IFCALLRET(context->CacheImportOffer, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->CacheImportOffer failed with error %"PRIu32"", - error); + WLog_ERR(TAG, "context->CacheImportOffer failed with error %" PRIu32 "", error); } free(pdu.cacheEntries); @@ -1186,8 +1150,7 @@ static UINT rdpgfx_recv_cache_import_offer_pdu(RdpgfxServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_caps_advertise_pdu(RdpgfxServerContext* context, - wStream* s) +static UINT rdpgfx_recv_caps_advertise_pdu(RdpgfxServerContext* context, wStream* s) { UINT16 index; RDPGFX_CAPSET* capsSets; @@ -1209,7 +1172,7 @@ static UINT rdpgfx_recv_caps_advertise_pdu(RdpgfxServerContext* context, if (!capsSets) return ERROR_OUTOFMEMORY; - pdu.capsSets = (RDPGFX_CAPSET*) capsSets; + pdu.capsSets = (RDPGFX_CAPSET*)capsSets; for (index = 0; index < pdu.capsSetCount; index++) { @@ -1219,7 +1182,7 @@ static UINT rdpgfx_recv_caps_advertise_pdu(RdpgfxServerContext* context, goto fail; Stream_Read_UINT32(s, capsSet->version); /* version (4 bytes) */ - Stream_Read_UINT32(s, capsSet->length); /* capsDataLength (4 bytes) */ + Stream_Read_UINT32(s, capsSet->length); /* capsDataLength (4 bytes) */ if (capsSet->length >= 4) { @@ -1237,7 +1200,7 @@ static UINT rdpgfx_recv_caps_advertise_pdu(RdpgfxServerContext* context, IFCALLRET(context->CapsAdvertise, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->CapsAdvertise failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context->CapsAdvertise failed with error %" PRIu32 "", error); fail: free(capsSets); @@ -1249,8 +1212,7 @@ fail: * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpgfx_recv_qoe_frame_acknowledge_pdu(RdpgfxServerContext* context, - wStream* s) +static UINT rdpgfx_recv_qoe_frame_acknowledge_pdu(RdpgfxServerContext* context, wStream* s) { RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU pdu; UINT error = CHANNEL_RC_OK; @@ -1261,9 +1223,9 @@ static UINT rdpgfx_recv_qoe_frame_acknowledge_pdu(RdpgfxServerContext* context, return ERROR_INVALID_DATA; } - Stream_Read_UINT32(s, pdu.frameId); /* frameId (4 bytes) */ - Stream_Read_UINT32(s, pdu.timestamp); /* timestamp (4 bytes) */ - Stream_Read_UINT16(s, pdu.timeDiffSE); /* timeDiffSE (2 bytes) */ + Stream_Read_UINT32(s, pdu.frameId); /* frameId (4 bytes) */ + Stream_Read_UINT32(s, pdu.timestamp); /* timestamp (4 bytes) */ + Stream_Read_UINT16(s, pdu.timeDiffSE); /* timeDiffSE (2 bytes) */ Stream_Read_UINT16(s, pdu.timeDiffEDR); /* timeDiffEDR (2 bytes) */ if (context) @@ -1271,18 +1233,17 @@ static UINT rdpgfx_recv_qoe_frame_acknowledge_pdu(RdpgfxServerContext* context, IFCALLRET(context->QoeFrameAcknowledge, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->QoeFrameAcknowledge failed with error %"PRIu32"", - error); + WLog_ERR(TAG, "context->QoeFrameAcknowledge failed with error %" PRIu32 "", error); } return error; } -static UINT rdpgfx_send_map_surface_to_scaled_output_pdu(RdpgfxServerContext* context, - const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* pdu) +static UINT +rdpgfx_send_map_surface_to_scaled_output_pdu(RdpgfxServerContext* context, + const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* pdu) { - wStream* s = rdpgfx_server_single_packet_new( - RDPGFX_CMDID_MAPSURFACETOSCALEDOUTPUT, 20); + wStream* s = rdpgfx_server_single_packet_new(RDPGFX_CMDID_MAPSURFACETOSCALEDOUTPUT, 20); if (!s) { @@ -1290,12 +1251,12 @@ static UINT rdpgfx_send_map_surface_to_scaled_output_pdu(RdpgfxServerContext* co return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT16(s, pdu->surfaceId); /* surfaceId (2 bytes) */ - Stream_Write_UINT16(s, 0); /* reserved (2 bytes). Must be 0 */ + Stream_Write_UINT16(s, pdu->surfaceId); /* surfaceId (2 bytes) */ + Stream_Write_UINT16(s, 0); /* reserved (2 bytes). Must be 0 */ Stream_Write_UINT32(s, pdu->outputOriginX); /* outputOriginX (4 bytes) */ Stream_Write_UINT32(s, pdu->outputOriginY); /* outputOriginY (4 bytes) */ - Stream_Write_UINT32(s, pdu->targetWidth); /* targetWidth (4 bytes) */ - Stream_Write_UINT32(s, pdu->targetHeight); /* targetHeight (4 bytes) */ + Stream_Write_UINT32(s, pdu->targetWidth); /* targetWidth (4 bytes) */ + Stream_Write_UINT32(s, pdu->targetHeight); /* targetHeight (4 bytes) */ return rdpgfx_server_single_packet_send(context, s); } @@ -1313,43 +1274,50 @@ static UINT rdpgfx_server_receive_pdu(RdpgfxServerContext* context, wStream* s) if ((error = rdpgfx_read_header(s, &header))) { - WLog_ERR(TAG, "rdpgfx_read_header failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "rdpgfx_read_header failed with error %" PRIu32 "!", error); return error; } #ifdef WITH_DEBUG_RDPGFX - WLog_DBG(TAG, "cmdId: %s (0x%04"PRIX16") flags: 0x%04"PRIX16" pduLength: %"PRIu32"", - rdpgfx_get_cmd_id_string(header.cmdId), header.cmdId, - header.flags, header.pduLength); + WLog_DBG(TAG, "cmdId: %s (0x%04" PRIX16 ") flags: 0x%04" PRIX16 " pduLength: %" PRIu32 "", + rdpgfx_get_cmd_id_string(header.cmdId), header.cmdId, header.flags, header.pduLength); #endif switch (header.cmdId) { case RDPGFX_CMDID_FRAMEACKNOWLEDGE: if ((error = rdpgfx_recv_frame_acknowledge_pdu(context, s))) - WLog_ERR(TAG, "rdpgfx_recv_frame_acknowledge_pdu " - "failed with error %"PRIu32"!", error); + WLog_ERR(TAG, + "rdpgfx_recv_frame_acknowledge_pdu " + "failed with error %" PRIu32 "!", + error); break; case RDPGFX_CMDID_CACHEIMPORTOFFER: if ((error = rdpgfx_recv_cache_import_offer_pdu(context, s))) - WLog_ERR(TAG, "rdpgfx_recv_cache_import_offer_pdu " - "failed with error %"PRIu32"!", error); + WLog_ERR(TAG, + "rdpgfx_recv_cache_import_offer_pdu " + "failed with error %" PRIu32 "!", + error); break; case RDPGFX_CMDID_CAPSADVERTISE: if ((error = rdpgfx_recv_caps_advertise_pdu(context, s))) - WLog_ERR(TAG, "rdpgfx_recv_caps_advertise_pdu " - "failed with error %"PRIu32"!", error); + WLog_ERR(TAG, + "rdpgfx_recv_caps_advertise_pdu " + "failed with error %" PRIu32 "!", + error); break; case RDPGFX_CMDID_QOEFRAMEACKNOWLEDGE: if ((error = rdpgfx_recv_qoe_frame_acknowledge_pdu(context, s))) - WLog_ERR(TAG, "rdpgfx_recv_qoe_frame_acknowledge_pdu " - "failed with error %"PRIu32"!", error); + WLog_ERR(TAG, + "rdpgfx_recv_qoe_frame_acknowledge_pdu " + "failed with error %" PRIu32 "!", + error); break; @@ -1360,7 +1328,7 @@ static UINT rdpgfx_server_receive_pdu(RdpgfxServerContext* context, wStream* s) if (error) { - WLog_ERR(TAG, "Error while parsing GFX cmdId: %s (0x%04"PRIX16")", + WLog_ERR(TAG, "Error while parsing GFX cmdId: %s (0x%04" PRIX16 ")", rdpgfx_get_cmd_id_string(header.cmdId), header.cmdId); return error; } @@ -1369,8 +1337,8 @@ static UINT rdpgfx_server_receive_pdu(RdpgfxServerContext* context, wStream* s) if (end != (beg + header.pduLength)) { - WLog_ERR(TAG, "Unexpected gfx pdu end: Actual: %d, Expected: %"PRIu32"", - end, (beg + header.pduLength)); + WLog_ERR(TAG, "Unexpected gfx pdu end: Actual: %d, Expected: %" PRIu32 "", end, + (beg + header.pduLength)); Stream_SetPosition(s, (beg + header.pduLength)); } @@ -1379,7 +1347,7 @@ static UINT rdpgfx_server_receive_pdu(RdpgfxServerContext* context, wStream* s) static DWORD WINAPI rdpgfx_server_thread_func(LPVOID arg) { - RdpgfxServerContext* context = (RdpgfxServerContext*) arg; + RdpgfxServerContext* context = (RdpgfxServerContext*)arg; RdpgfxServerPrivate* priv = context->priv; DWORD status; DWORD nCount; @@ -1399,7 +1367,7 @@ static DWORD WINAPI rdpgfx_server_thread_func(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "", error); break; } @@ -1409,15 +1377,13 @@ static DWORD WINAPI rdpgfx_server_thread_func(LPVOID arg) if ((error = rdpgfx_server_handle_messages(context))) { - WLog_ERR(TAG, "rdpgfx_server_handle_messages failed with error %"PRIu32"", - error); + WLog_ERR(TAG, "rdpgfx_server_handle_messages failed with error %" PRIu32 "", error); break; } } if (error && context->rdpcontext) - setChannelError(context->rdpcontext, error, - "rdpgfx_server_thread_func reported an error"); + setChannelError(context->rdpcontext, error, "rdpgfx_server_thread_func reported an error"); ExitThread(error); return error; @@ -1425,7 +1391,7 @@ static DWORD WINAPI rdpgfx_server_thread_func(LPVOID arg) static BOOL rdpgfx_server_open(RdpgfxServerContext* context) { - RdpgfxServerPrivate* priv = (RdpgfxServerPrivate*) context->priv; + RdpgfxServerPrivate* priv = (RdpgfxServerPrivate*)context->priv; void* buffer = NULL; if (!priv->isOpened) @@ -1434,19 +1400,17 @@ static BOOL rdpgfx_server_open(RdpgfxServerContext* context) DWORD BytesReturned = 0; priv->SessionId = WTS_CURRENT_SESSION; - if (WTSQuerySessionInformationA(context->vcm, WTS_CURRENT_SESSION, - WTSSessionId, (LPSTR*) &pSessionId, - &BytesReturned) == FALSE) + if (WTSQuerySessionInformationA(context->vcm, WTS_CURRENT_SESSION, WTSSessionId, + (LPSTR*)&pSessionId, &BytesReturned) == FALSE) { WLog_ERR(TAG, "WTSQuerySessionInformationA failed!"); return FALSE; } - priv->SessionId = (DWORD) * pSessionId; + priv->SessionId = (DWORD)*pSessionId; WTSFreeMemory(pSessionId); - priv->rdpgfx_channel = WTSVirtualChannelOpenEx(priv->SessionId, - RDPGFX_DVC_CHANNEL_NAME, - WTS_CHANNEL_OPTION_DYNAMIC); + priv->rdpgfx_channel = WTSVirtualChannelOpenEx(priv->SessionId, RDPGFX_DVC_CHANNEL_NAME, + WTS_CHANNEL_OPTION_DYNAMIC); if (!priv->rdpgfx_channel) { @@ -1455,12 +1419,13 @@ static BOOL rdpgfx_server_open(RdpgfxServerContext* context) } /* Query for channel event handle */ - if (!WTSVirtualChannelQuery(priv->rdpgfx_channel, WTSVirtualEventHandle, - &buffer, &BytesReturned) - || (BytesReturned != sizeof(HANDLE))) + if (!WTSVirtualChannelQuery(priv->rdpgfx_channel, WTSVirtualEventHandle, &buffer, + &BytesReturned) || + (BytesReturned != sizeof(HANDLE))) { - WLog_ERR(TAG, "WTSVirtualChannelQuery failed " - "or invalid returned size(%"PRIu32")", + WLog_ERR(TAG, + "WTSVirtualChannelQuery failed " + "or invalid returned size(%" PRIu32 ")", BytesReturned); if (buffer) @@ -1486,9 +1451,8 @@ static BOOL rdpgfx_server_open(RdpgfxServerContext* context) goto out_zgfx; } - if (!(priv->thread = CreateThread(NULL, 0, - rdpgfx_server_thread_func, - (void*) context, 0, NULL))) + if (!(priv->thread = + CreateThread(NULL, 0, rdpgfx_server_thread_func, (void*)context, 0, NULL))) { WLog_ERR(TAG, "CreateThread failed!"); goto out_stopEvent; @@ -1517,7 +1481,7 @@ out_close: static BOOL rdpgfx_server_close(RdpgfxServerContext* context) { - RdpgfxServerPrivate* priv = (RdpgfxServerPrivate*) context->priv; + RdpgfxServerPrivate* priv = (RdpgfxServerPrivate*)context->priv; if (priv->ownThread && priv->thread) { @@ -1525,8 +1489,7 @@ static BOOL rdpgfx_server_close(RdpgfxServerContext* context) if (WaitForSingleObject(priv->thread, INFINITE) == WAIT_FAILED) { - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", - GetLastError()); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", GetLastError()); return FALSE; } @@ -1589,8 +1552,7 @@ RdpgfxServerContext* rdpgfx_server_context_new(HANDLE vcm) context->CapsConfirm = rdpgfx_send_caps_confirm_pdu; context->FrameAcknowledge = NULL; context->QoeFrameAcknowledge = NULL; - context->priv = priv = (RdpgfxServerPrivate*) - calloc(1, sizeof(RdpgfxServerPrivate)); + context->priv = priv = (RdpgfxServerPrivate*)calloc(1, sizeof(RdpgfxServerPrivate)); if (!priv) { @@ -1610,7 +1572,7 @@ RdpgfxServerContext* rdpgfx_server_context_new(HANDLE vcm) priv->isOpened = FALSE; priv->isReady = FALSE; priv->ownThread = TRUE; - return (RdpgfxServerContext*) context; + return (RdpgfxServerContext*)context; out_free_priv: free(context->priv); out_free: @@ -1654,9 +1616,8 @@ UINT rdpgfx_server_handle_messages(RdpgfxServerContext* context) /* Check whether the dynamic channel is ready */ if (!priv->isReady) { - if (WTSVirtualChannelQuery(priv->rdpgfx_channel, - WTSVirtualChannelReady, - &buffer, &BytesReturned) == FALSE) + if (WTSVirtualChannelQuery(priv->rdpgfx_channel, WTSVirtualChannelReady, &buffer, + &BytesReturned) == FALSE) { if (GetLastError() == ERROR_NO_DATA) return ERROR_NO_DATA; @@ -1665,7 +1626,7 @@ UINT rdpgfx_server_handle_messages(RdpgfxServerContext* context) return ERROR_INTERNAL_ERROR; } - priv->isReady = *((BOOL*) buffer); + priv->isReady = *((BOOL*)buffer); WTSFreeMemory(buffer); } @@ -1674,8 +1635,7 @@ UINT rdpgfx_server_handle_messages(RdpgfxServerContext* context) { Stream_SetPosition(s, 0); - if (!WTSVirtualChannelRead(priv->rdpgfx_channel, - 0, NULL, 0, &BytesReturned)) + if (!WTSVirtualChannelRead(priv->rdpgfx_channel, 0, NULL, 0, &BytesReturned)) { if (GetLastError() == ERROR_NO_DATA) return ERROR_NO_DATA; @@ -1693,8 +1653,7 @@ UINT rdpgfx_server_handle_messages(RdpgfxServerContext* context) return CHANNEL_RC_NO_MEMORY; } - if (WTSVirtualChannelRead(priv->rdpgfx_channel, 0, - (PCHAR) Stream_Buffer(s), + if (WTSVirtualChannelRead(priv->rdpgfx_channel, 0, (PCHAR)Stream_Buffer(s), Stream_Capacity(s), &BytesReturned) == FALSE) { WLog_ERR(TAG, "WTSVirtualChannelRead failed!"); @@ -1708,8 +1667,10 @@ UINT rdpgfx_server_handle_messages(RdpgfxServerContext* context) { if ((ret = rdpgfx_server_receive_pdu(context, s))) { - WLog_ERR(TAG, "rdpgfx_server_receive_pdu " - "failed with error %"PRIu32"!", ret); + WLog_ERR(TAG, + "rdpgfx_server_receive_pdu " + "failed with error %" PRIu32 "!", + ret); return ret; } } diff --git a/channels/rdpsnd/client/alsa/rdpsnd_alsa.c b/channels/rdpsnd/client/alsa/rdpsnd_alsa.c index c085abf49..95e7a7976 100644 --- a/channels/rdpsnd/client/alsa/rdpsnd_alsa.c +++ b/channels/rdpsnd/client/alsa/rdpsnd_alsa.c @@ -61,11 +61,11 @@ struct rdpsnd_alsa_plugin snd_pcm_uframes_t period_size; }; -#define SND_PCM_CHECK(_func, _status) \ - if (_status < 0) \ - { \ - WLog_ERR(TAG, "%s: %d\n", _func, _status); \ - return -1; \ +#define SND_PCM_CHECK(_func, _status) \ + if (_status < 0) \ + { \ + WLog_ERR(TAG, "%s: %d\n", _func, _status); \ + return -1; \ } static int rdpsnd_alsa_set_hw_params(rdpsndAlsaPlugin* alsa) @@ -78,7 +78,8 @@ static int rdpsnd_alsa_set_hw_params(rdpsndAlsaPlugin* alsa) status = snd_pcm_hw_params_any(alsa->pcm_handle, hw_params); SND_PCM_CHECK("snd_pcm_hw_params_any", status); /* Set interleaved read/write access */ - status = snd_pcm_hw_params_set_access(alsa->pcm_handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED); + status = + snd_pcm_hw_params_set_access(alsa->pcm_handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED); SND_PCM_CHECK("snd_pcm_hw_params_set_access", status); /* Set sample format */ status = snd_pcm_hw_params_set_format(alsa->pcm_handle, hw_params, alsa->format); @@ -111,7 +112,8 @@ static int rdpsnd_alsa_set_hw_params(rdpsndAlsaPlugin* alsa) * It is also possible for the buffer size to not be an integer multiple of the period size. */ int interrupts_per_sec_near = 50; - int bytes_per_sec = (alsa->actual_rate * alsa->aformat.wBitsPerSample / 8 * alsa->actual_channels); + int bytes_per_sec = + (alsa->actual_rate * alsa->aformat.wBitsPerSample / 8 * alsa->actual_channels); alsa->buffer_size = buffer_size_max; alsa->period_size = (bytes_per_sec / interrupts_per_sec_near); @@ -123,11 +125,12 @@ static int rdpsnd_alsa_set_hw_params(rdpsndAlsaPlugin* alsa) } /* Set buffer size */ - status = snd_pcm_hw_params_set_buffer_size_near(alsa->pcm_handle, hw_params, &alsa->buffer_size); + status = + snd_pcm_hw_params_set_buffer_size_near(alsa->pcm_handle, hw_params, &alsa->buffer_size); SND_PCM_CHECK("snd_pcm_hw_params_set_buffer_size_near", status); /* Set period size */ status = snd_pcm_hw_params_set_period_size_near(alsa->pcm_handle, hw_params, &alsa->period_size, - NULL); + NULL); SND_PCM_CHECK("snd_pcm_hw_params_set_period_size_near", status); status = snd_pcm_hw_params(alsa->pcm_handle, hw_params); SND_PCM_CHECK("snd_pcm_hw_params", status); @@ -144,10 +147,10 @@ static int rdpsnd_alsa_set_sw_params(rdpsndAlsaPlugin* alsa) status = snd_pcm_sw_params_current(alsa->pcm_handle, sw_params); SND_PCM_CHECK("snd_pcm_sw_params_current", status); status = snd_pcm_sw_params_set_avail_min(alsa->pcm_handle, sw_params, - (alsa->aformat.nChannels * alsa->actual_channels)); + (alsa->aformat.nChannels * alsa->actual_channels)); SND_PCM_CHECK("snd_pcm_sw_params_set_avail_min", status); status = snd_pcm_sw_params_set_start_threshold(alsa->pcm_handle, sw_params, - alsa->aformat.nBlockAlign); + alsa->aformat.nBlockAlign); SND_PCM_CHECK("snd_pcm_sw_params_set_start_threshold", status); status = snd_pcm_sw_params(alsa->pcm_handle, sw_params); SND_PCM_CHECK("snd_pcm_sw_params", status); @@ -183,7 +186,7 @@ static int rdpsnd_alsa_set_params(rdpsndAlsaPlugin* alsa) static BOOL rdpsnd_alsa_set_format(rdpsndDevicePlugin* device, const AUDIO_FORMAT* format, UINT32 latency) { - rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*) device; + rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*)device; if (format) { @@ -291,7 +294,7 @@ static BOOL rdpsnd_alsa_open(rdpsndDevicePlugin* device, const AUDIO_FORMAT* for { int mode; int status; - rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*) device; + rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*)device; if (alsa->pcm_handle) return TRUE; @@ -306,13 +309,12 @@ static BOOL rdpsnd_alsa_open(rdpsndDevicePlugin* device, const AUDIO_FORMAT* for return FALSE; } - return rdpsnd_alsa_set_format(device, format, latency) && - rdpsnd_alsa_open_mixer(alsa); + return rdpsnd_alsa_set_format(device, format, latency) && rdpsnd_alsa_open_mixer(alsa); } static void rdpsnd_alsa_close(rdpsndDevicePlugin* device) { - rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*) device; + rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*)device; if (!alsa) return; @@ -322,7 +324,7 @@ static void rdpsnd_alsa_close(rdpsndDevicePlugin* device) static void rdpsnd_alsa_free(rdpsndDevicePlugin* device) { - rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*) device; + rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*)device; rdpsnd_alsa_pcm_close(alsa); rdpsnd_alsa_close_mixer(alsa); free(alsa->device_name); @@ -334,8 +336,7 @@ static BOOL rdpsnd_alsa_format_supported(rdpsndDevicePlugin* device, const AUDIO switch (format->wFormatTag) { case WAVE_FORMAT_PCM: - if (format->cbSize == 0 && - format->nSamplesPerSec <= 48000 && + if (format->cbSize == 0 && format->nSamplesPerSec <= 48000 && (format->wBitsPerSample == 8 || format->wBitsPerSample == 16) && (format->nChannels == 1 || format->nChannels == 2)) { @@ -358,8 +359,8 @@ static UINT32 rdpsnd_alsa_get_volume(rdpsndDevicePlugin* device) UINT16 dwVolumeLeft; UINT16 dwVolumeRight; snd_mixer_elem_t* elem; - rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*) device; - dwVolumeLeft = ((50 * 0xFFFF) / 100); /* 50% */ + rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*)device; + dwVolumeLeft = ((50 * 0xFFFF) / 100); /* 50% */ dwVolumeRight = ((50 * 0xFFFF) / 100); /* 50% */ if (!rdpsnd_alsa_open_mixer(alsa)) @@ -372,8 +373,10 @@ static UINT32 rdpsnd_alsa_get_volume(rdpsndDevicePlugin* device) snd_mixer_selem_get_playback_volume_range(elem, &volume_min, &volume_max); snd_mixer_selem_get_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT, &volume_left); snd_mixer_selem_get_playback_volume(elem, SND_MIXER_SCHN_FRONT_RIGHT, &volume_right); - dwVolumeLeft = (UINT16)(((volume_left * 0xFFFF) - volume_min) / (volume_max - volume_min)); - dwVolumeRight = (UINT16)(((volume_right * 0xFFFF) - volume_min) / (volume_max - volume_min)); + dwVolumeLeft = + (UINT16)(((volume_left * 0xFFFF) - volume_min) / (volume_max - volume_min)); + dwVolumeRight = + (UINT16)(((volume_right * 0xFFFF) - volume_min) / (volume_max - volume_min)); break; } } @@ -391,7 +394,7 @@ static BOOL rdpsnd_alsa_set_volume(rdpsndDevicePlugin* device, UINT32 value) long volume_left; long volume_right; snd_mixer_elem_t* elem; - rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*) device; + rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*)device; if (!rdpsnd_alsa_open_mixer(alsa)) return FALSE; @@ -407,8 +410,10 @@ static BOOL rdpsnd_alsa_set_volume(rdpsndDevicePlugin* device, UINT32 value) volume_left = volume_min + (left * (volume_max - volume_min)) / 0xFFFF; volume_right = volume_min + (right * (volume_max - volume_min)) / 0xFFFF; - if ((snd_mixer_selem_set_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT, volume_left) < 0) || - (snd_mixer_selem_set_playback_volume(elem, SND_MIXER_SCHN_FRONT_RIGHT, volume_right) < 0)) + if ((snd_mixer_selem_set_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT, volume_left) < + 0) || + (snd_mixer_selem_set_playback_volume(elem, SND_MIXER_SCHN_FRONT_RIGHT, + volume_right) < 0)) { WLog_ERR(TAG, "error setting the volume\n"); return FALSE; @@ -424,21 +429,21 @@ static UINT rdpsnd_alsa_play(rdpsndDevicePlugin* device, const BYTE* data, size_ UINT latency; size_t offset; int frame_size; - rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*) device; + rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*)device; offset = 0; frame_size = alsa->actual_channels * alsa->aformat.wBitsPerSample / 8; while (offset < size) { - snd_pcm_sframes_t status = snd_pcm_writei(alsa->pcm_handle, &data[offset], - (size - offset) / frame_size); + snd_pcm_sframes_t status = + snd_pcm_writei(alsa->pcm_handle, &data[offset], (size - offset) / frame_size); if (status < 0) status = snd_pcm_recover(alsa->pcm_handle, status, 0); if (status < 0) { - WLog_ERR(TAG, "status: %d\n", status); + WLog_ERR(TAG, "status: %d\n", status); rdpsnd_alsa_close(device); rdpsnd_alsa_open(device, NULL, alsa->latency); break; @@ -472,15 +477,14 @@ static UINT rdpsnd_alsa_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV* int status; DWORD flags; COMMAND_LINE_ARGUMENT_A* arg; - rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*) device; - COMMAND_LINE_ARGUMENT_A rdpsnd_alsa_args[] = - { - { "dev", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "device" }, - { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } - }; - flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; - status = CommandLineParseArgumentsA(args->argc, args->argv, rdpsnd_alsa_args, flags, - alsa, NULL, NULL); + rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*)device; + COMMAND_LINE_ARGUMENT_A rdpsnd_alsa_args[] = { { "dev", COMMAND_LINE_VALUE_REQUIRED, "", + NULL, NULL, -1, NULL, "device" }, + { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; + flags = + COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; + status = CommandLineParseArgumentsA(args->argc, args->argv, rdpsnd_alsa_args, flags, alsa, NULL, + NULL); if (status < 0) { @@ -495,8 +499,7 @@ static UINT rdpsnd_alsa_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV* if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "dev") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "dev") { alsa->device_name = _strdup(arg->Value); @@ -504,16 +507,15 @@ static UINT rdpsnd_alsa_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV* return CHANNEL_RC_NO_MEMORY; } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); return CHANNEL_RC_OK; } #ifdef BUILTIN_CHANNELS -#define freerdp_rdpsnd_client_subsystem_entry alsa_freerdp_rdpsnd_client_subsystem_entry +#define freerdp_rdpsnd_client_subsystem_entry alsa_freerdp_rdpsnd_client_subsystem_entry #else -#define freerdp_rdpsnd_client_subsystem_entry FREERDP_API freerdp_rdpsnd_client_subsystem_entry +#define freerdp_rdpsnd_client_subsystem_entry FREERDP_API freerdp_rdpsnd_client_subsystem_entry #endif /** @@ -526,7 +528,7 @@ UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS p ADDIN_ARGV* args; rdpsndAlsaPlugin* alsa; UINT error; - alsa = (rdpsndAlsaPlugin*) calloc(1, sizeof(rdpsndAlsaPlugin)); + alsa = (rdpsndAlsaPlugin*)calloc(1, sizeof(rdpsndAlsaPlugin)); if (!alsa) { @@ -545,9 +547,9 @@ UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS p if (args->argc > 1) { - if ((error = rdpsnd_alsa_parse_addin_args((rdpsndDevicePlugin*) alsa, args))) + if ((error = rdpsnd_alsa_parse_addin_args((rdpsndDevicePlugin*)alsa, args))) { - WLog_ERR(TAG, "rdpsnd_alsa_parse_addin_args failed with error %"PRIu32"", error); + WLog_ERR(TAG, "rdpsnd_alsa_parse_addin_args failed with error %" PRIu32 "", error); goto error_parse_args; } } @@ -568,7 +570,7 @@ UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS p alsa->actual_rate = 22050; alsa->format = SND_PCM_FORMAT_S16_LE; alsa->actual_channels = 2; - pEntryPoints->pRegisterRdpsndDevice(pEntryPoints->rdpsnd, (rdpsndDevicePlugin*) alsa); + pEntryPoints->pRegisterRdpsndDevice(pEntryPoints->rdpsnd, (rdpsndDevicePlugin*)alsa); return CHANNEL_RC_OK; error_strdup: free(alsa->device_name); diff --git a/channels/rdpsnd/client/fake/rdpsnd_fake.c b/channels/rdpsnd/client/fake/rdpsnd_fake.c index 9c23baec2..6ae792659 100644 --- a/channels/rdpsnd/client/fake/rdpsnd_fake.c +++ b/channels/rdpsnd/client/fake/rdpsnd_fake.c @@ -57,7 +57,7 @@ static BOOL rdpsnd_fake_set_volume(rdpsndDevicePlugin* device, UINT32 value) static void rdpsnd_fake_free(rdpsndDevicePlugin* device) { - rdpsndFakePlugin* fake = (rdpsndFakePlugin*) device; + rdpsndFakePlugin* fake = (rdpsndFakePlugin*)device; if (!fake) return; @@ -95,13 +95,11 @@ static UINT rdpsnd_fake_parse_addin_args(rdpsndFakePlugin* fake, ADDIN_ARGV* arg int status; DWORD flags; COMMAND_LINE_ARGUMENT_A* arg; - COMMAND_LINE_ARGUMENT_A rdpsnd_fake_args[] = - { - { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } - }; - flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; - status = CommandLineParseArgumentsA(args->argc, args->argv, - rdpsnd_fake_args, flags, fake, NULL, NULL); + COMMAND_LINE_ARGUMENT_A rdpsnd_fake_args[] = { { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; + flags = + COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; + status = CommandLineParseArgumentsA(args->argc, args->argv, rdpsnd_fake_args, flags, fake, NULL, + NULL); if (status < 0) return ERROR_INVALID_DATA; @@ -113,18 +111,16 @@ static UINT rdpsnd_fake_parse_addin_args(rdpsndFakePlugin* fake, ADDIN_ARGV* arg if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + CommandLineSwitchStart(arg) CommandLineSwitchEnd(arg) + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); return CHANNEL_RC_OK; } #ifdef BUILTIN_CHANNELS -#define freerdp_rdpsnd_client_subsystem_entry fake_freerdp_rdpsnd_client_subsystem_entry +#define freerdp_rdpsnd_client_subsystem_entry fake_freerdp_rdpsnd_client_subsystem_entry #else -#define freerdp_rdpsnd_client_subsystem_entry FREERDP_API freerdp_rdpsnd_client_subsystem_entry +#define freerdp_rdpsnd_client_subsystem_entry FREERDP_API freerdp_rdpsnd_client_subsystem_entry #endif /** @@ -137,7 +133,7 @@ UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS p ADDIN_ARGV* args; rdpsndFakePlugin* fake; UINT ret = CHANNEL_RC_OK; - fake = (rdpsndFakePlugin*) calloc(1, sizeof(rdpsndFakePlugin)); + fake = (rdpsndFakePlugin*)calloc(1, sizeof(rdpsndFakePlugin)); if (!fake) return CHANNEL_RC_NO_MEMORY; diff --git a/channels/rdpsnd/client/ios/TPCircularBuffer.c b/channels/rdpsnd/client/ios/TPCircularBuffer.c index 1c9402799..b29f61184 100644 --- a/channels/rdpsnd/client/ios/TPCircularBuffer.c +++ b/channels/rdpsnd/client/ios/TPCircularBuffer.c @@ -35,106 +35,119 @@ #include #include -#define reportResult(result,operation) (_reportResult((result),(operation),__FILE__,__LINE__)) -static inline bool _reportResult(kern_return_t result, const char *operation, const char* file, int line) { - if ( result != ERR_SUCCESS ) { - WLog_DBG(TAG, "%s:%d: %s: %s\n", file, line, operation, mach_error_string(result)); - return false; - } - return true; +#define reportResult(result, operation) (_reportResult((result), (operation), __FILE__, __LINE__)) +static inline bool _reportResult(kern_return_t result, const char* operation, const char* file, + int line) +{ + if (result != ERR_SUCCESS) + { + WLog_DBG(TAG, "%s:%d: %s: %s\n", file, line, operation, mach_error_string(result)); + return false; + } + return true; } -bool TPCircularBufferInit(TPCircularBuffer *buffer, int length) { +bool TPCircularBufferInit(TPCircularBuffer* buffer, int length) +{ - // Keep trying until we get our buffer, needed to handle race conditions - int retries = 3; - while ( true ) { + // Keep trying until we get our buffer, needed to handle race conditions + int retries = 3; + while (true) + { - buffer->length = round_page(length); // We need whole page sizes + buffer->length = round_page(length); // We need whole page sizes - // Temporarily allocate twice the length, so we have the contiguous address space to - // support a second instance of the buffer directly after - vm_address_t bufferAddress; - kern_return_t result = vm_allocate(mach_task_self(), - &bufferAddress, - buffer->length * 2, - VM_FLAGS_ANYWHERE); // allocate anywhere it'll fit - if ( result != ERR_SUCCESS ) { - if ( retries-- == 0 ) { - reportResult(result, "Buffer allocation"); - return false; - } - // Try again if we fail - continue; - } - - // Now replace the second half of the allocation with a virtual copy of the first half. Deallocate the second half... - result = vm_deallocate(mach_task_self(), - bufferAddress + buffer->length, - buffer->length); - if ( result != ERR_SUCCESS ) { - if ( retries-- == 0 ) { - reportResult(result, "Buffer deallocation"); - return false; - } - // If this fails somehow, deallocate the whole region and try again - vm_deallocate(mach_task_self(), bufferAddress, buffer->length); - continue; - } - - // Re-map the buffer to the address space immediately after the buffer - vm_address_t virtualAddress = bufferAddress + buffer->length; - vm_prot_t cur_prot, max_prot; - result = vm_remap(mach_task_self(), - &virtualAddress, // mirror target - buffer->length, // size of mirror - 0, // auto alignment - 0, // force remapping to virtualAddress - mach_task_self(), // same task - bufferAddress, // mirror source - 0, // MAP READ-WRITE, NOT COPY - &cur_prot, // unused protection struct - &max_prot, // unused protection struct - VM_INHERIT_DEFAULT); - if ( result != ERR_SUCCESS ) { - if ( retries-- == 0 ) { - reportResult(result, "Remap buffer memory"); - return false; - } - // If this remap failed, we hit a race condition, so deallocate and try again - vm_deallocate(mach_task_self(), bufferAddress, buffer->length); - continue; - } - - if ( virtualAddress != bufferAddress+buffer->length ) { - // If the memory is not contiguous, clean up both allocated buffers and try again - if ( retries-- == 0 ) { - WLog_DBG(TAG, "Couldn't map buffer memory to end of buffer"); - return false; - } + // Temporarily allocate twice the length, so we have the contiguous address space to + // support a second instance of the buffer directly after + vm_address_t bufferAddress; + kern_return_t result = vm_allocate(mach_task_self(), &bufferAddress, buffer->length * 2, + VM_FLAGS_ANYWHERE); // allocate anywhere it'll fit + if (result != ERR_SUCCESS) + { + if (retries-- == 0) + { + reportResult(result, "Buffer allocation"); + return false; + } + // Try again if we fail + continue; + } - vm_deallocate(mach_task_self(), virtualAddress, buffer->length); - vm_deallocate(mach_task_self(), bufferAddress, buffer->length); - continue; - } - - buffer->buffer = (void*)bufferAddress; - buffer->fillCount = 0; - buffer->head = buffer->tail = 0; - - return true; - } - return false; + // Now replace the second half of the allocation with a virtual copy of the first half. + // Deallocate the second half... + result = vm_deallocate(mach_task_self(), bufferAddress + buffer->length, buffer->length); + if (result != ERR_SUCCESS) + { + if (retries-- == 0) + { + reportResult(result, "Buffer deallocation"); + return false; + } + // If this fails somehow, deallocate the whole region and try again + vm_deallocate(mach_task_self(), bufferAddress, buffer->length); + continue; + } + + // Re-map the buffer to the address space immediately after the buffer + vm_address_t virtualAddress = bufferAddress + buffer->length; + vm_prot_t cur_prot, max_prot; + result = vm_remap(mach_task_self(), + &virtualAddress, // mirror target + buffer->length, // size of mirror + 0, // auto alignment + 0, // force remapping to virtualAddress + mach_task_self(), // same task + bufferAddress, // mirror source + 0, // MAP READ-WRITE, NOT COPY + &cur_prot, // unused protection struct + &max_prot, // unused protection struct + VM_INHERIT_DEFAULT); + if (result != ERR_SUCCESS) + { + if (retries-- == 0) + { + reportResult(result, "Remap buffer memory"); + return false; + } + // If this remap failed, we hit a race condition, so deallocate and try again + vm_deallocate(mach_task_self(), bufferAddress, buffer->length); + continue; + } + + if (virtualAddress != bufferAddress + buffer->length) + { + // If the memory is not contiguous, clean up both allocated buffers and try again + if (retries-- == 0) + { + WLog_DBG(TAG, "Couldn't map buffer memory to end of buffer"); + return false; + } + + vm_deallocate(mach_task_self(), virtualAddress, buffer->length); + vm_deallocate(mach_task_self(), bufferAddress, buffer->length); + continue; + } + + buffer->buffer = (void*)bufferAddress; + buffer->fillCount = 0; + buffer->head = buffer->tail = 0; + + return true; + } + return false; } -void TPCircularBufferCleanup(TPCircularBuffer *buffer) { - vm_deallocate(mach_task_self(), (vm_address_t)buffer->buffer, buffer->length * 2); - memset(buffer, 0, sizeof(TPCircularBuffer)); +void TPCircularBufferCleanup(TPCircularBuffer* buffer) +{ + vm_deallocate(mach_task_self(), (vm_address_t)buffer->buffer, buffer->length * 2); + memset(buffer, 0, sizeof(TPCircularBuffer)); } -void TPCircularBufferClear(TPCircularBuffer *buffer) { - int32_t fillCount; - if ( TPCircularBufferTail(buffer, &fillCount) ) { - TPCircularBufferConsume(buffer, fillCount); - } +void TPCircularBufferClear(TPCircularBuffer* buffer) +{ + int32_t fillCount; + if (TPCircularBufferTail(buffer, &fillCount)) + { + TPCircularBufferConsume(buffer, fillCount); + } } diff --git a/channels/rdpsnd/client/ios/TPCircularBuffer.h b/channels/rdpsnd/client/ios/TPCircularBuffer.h index cd2a4d837..d246efae2 100644 --- a/channels/rdpsnd/client/ios/TPCircularBuffer.h +++ b/channels/rdpsnd/client/ios/TPCircularBuffer.h @@ -8,9 +8,10 @@ // // // This implementation makes use of a virtual memory mapping technique that inserts a virtual copy -// of the buffer memory directly after the buffer's end, negating the need for any buffer wrap-around -// logic. Clients can simply use the returned memory address as if it were contiguous space. -// +// of the buffer memory directly after the buffer's end, negating the need for any buffer +// wrap-around logic. Clients can simply use the returned memory address as if it were contiguous +// space. +// // The implementation is thread-safe in the case of a single producer and single consumer. // // Virtual memory technique originally proposed by Philip Howard (http://vrb.slashusr.org/), and @@ -47,146 +48,167 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif - -typedef struct { - void *buffer; - int32_t length; - int32_t tail; - int32_t head; - volatile int32_t fillCount; -} TPCircularBuffer; -/*! - * Initialise buffer - * - * Note that the length is advisory only: Because of the way the - * memory mirroring technique works, the true buffer length will - * be multiples of the device page size (e.g. 4096 bytes) - * - * @param buffer Circular buffer - * @param length Length of buffer - */ -bool TPCircularBufferInit(TPCircularBuffer *buffer, int32_t length); + typedef struct + { + void* buffer; + int32_t length; + int32_t tail; + int32_t head; + volatile int32_t fillCount; + } TPCircularBuffer; -/*! - * Cleanup buffer - * - * Releases buffer resources. - */ -void TPCircularBufferCleanup(TPCircularBuffer *buffer); + /*! + * Initialise buffer + * + * Note that the length is advisory only: Because of the way the + * memory mirroring technique works, the true buffer length will + * be multiples of the device page size (e.g. 4096 bytes) + * + * @param buffer Circular buffer + * @param length Length of buffer + */ + bool TPCircularBufferInit(TPCircularBuffer* buffer, int32_t length); -/*! - * Clear buffer - * - * Resets buffer to original, empty state. - * - * This is safe for use by consumer while producer is accessing - * buffer. - */ -void TPCircularBufferClear(TPCircularBuffer *buffer); + /*! + * Cleanup buffer + * + * Releases buffer resources. + */ + void TPCircularBufferCleanup(TPCircularBuffer* buffer); -// Reading (consuming) + /*! + * Clear buffer + * + * Resets buffer to original, empty state. + * + * This is safe for use by consumer while producer is accessing + * buffer. + */ + void TPCircularBufferClear(TPCircularBuffer* buffer); -/*! - * Access end of buffer - * - * This gives you a pointer to the end of the buffer, ready - * for reading, and the number of available bytes to read. - * - * @param buffer Circular buffer - * @param availableBytes On output, the number of bytes ready for reading - * @return Pointer to the first bytes ready for reading, or NULL if buffer is empty - */ -static __inline__ __attribute__((always_inline)) void* TPCircularBufferTail(TPCircularBuffer *buffer, int32_t* availableBytes) { - *availableBytes = buffer->fillCount; - if ( *availableBytes == 0 ) return NULL; - return (void*)((char*)buffer->buffer + buffer->tail); -} + // Reading (consuming) -/*! - * Consume bytes in buffer - * - * This frees up the just-read bytes, ready for writing again. - * - * @param buffer Circular buffer - * @param amount Number of bytes to consume - */ -static __inline__ __attribute__((always_inline)) void TPCircularBufferConsume(TPCircularBuffer *buffer, int32_t amount) { - buffer->tail = (buffer->tail + amount) % buffer->length; - OSAtomicAdd32Barrier(-amount, &buffer->fillCount); - assert(buffer->fillCount >= 0); -} + /*! + * Access end of buffer + * + * This gives you a pointer to the end of the buffer, ready + * for reading, and the number of available bytes to read. + * + * @param buffer Circular buffer + * @param availableBytes On output, the number of bytes ready for reading + * @return Pointer to the first bytes ready for reading, or NULL if buffer is empty + */ + static __inline__ __attribute__((always_inline)) void* + TPCircularBufferTail(TPCircularBuffer* buffer, int32_t* availableBytes) + { + *availableBytes = buffer->fillCount; + if (*availableBytes == 0) + return NULL; + return (void*)((char*)buffer->buffer + buffer->tail); + } -/*! - * Version of TPCircularBufferConsume without the memory barrier, for more optimal use in single-threaded contexts - */ -static __inline__ __attribute__((always_inline)) void TPCircularBufferConsumeNoBarrier(TPCircularBuffer *buffer, int32_t amount) { - buffer->tail = (buffer->tail + amount) % buffer->length; - buffer->fillCount -= amount; - assert(buffer->fillCount >= 0); -} + /*! + * Consume bytes in buffer + * + * This frees up the just-read bytes, ready for writing again. + * + * @param buffer Circular buffer + * @param amount Number of bytes to consume + */ + static __inline__ __attribute__((always_inline)) void + TPCircularBufferConsume(TPCircularBuffer* buffer, int32_t amount) + { + buffer->tail = (buffer->tail + amount) % buffer->length; + OSAtomicAdd32Barrier(-amount, &buffer->fillCount); + assert(buffer->fillCount >= 0); + } -/*! - * Access front of buffer - * - * This gives you a pointer to the front of the buffer, ready - * for writing, and the number of available bytes to write. - * - * @param buffer Circular buffer - * @param availableBytes On output, the number of bytes ready for writing - * @return Pointer to the first bytes ready for writing, or NULL if buffer is full - */ -static __inline__ __attribute__((always_inline)) void* TPCircularBufferHead(TPCircularBuffer *buffer, int32_t* availableBytes) { - *availableBytes = (buffer->length - buffer->fillCount); - if ( *availableBytes == 0 ) return NULL; - return (void*)((char*)buffer->buffer + buffer->head); -} - -// Writing (producing) + /*! + * Version of TPCircularBufferConsume without the memory barrier, for more optimal use in + * single-threaded contexts + */ + static __inline__ __attribute__((always_inline)) void + TPCircularBufferConsumeNoBarrier(TPCircularBuffer* buffer, int32_t amount) + { + buffer->tail = (buffer->tail + amount) % buffer->length; + buffer->fillCount -= amount; + assert(buffer->fillCount >= 0); + } -/*! - * Produce bytes in buffer - * - * This marks the given section of the buffer ready for reading. - * - * @param buffer Circular buffer - * @param amount Number of bytes to produce - */ -static __inline__ __attribute__((always_inline)) void TPCircularBufferProduce(TPCircularBuffer *buffer, int amount) { - buffer->head = (buffer->head + amount) % buffer->length; - OSAtomicAdd32Barrier(amount, &buffer->fillCount); - assert(buffer->fillCount <= buffer->length); -} + /*! + * Access front of buffer + * + * This gives you a pointer to the front of the buffer, ready + * for writing, and the number of available bytes to write. + * + * @param buffer Circular buffer + * @param availableBytes On output, the number of bytes ready for writing + * @return Pointer to the first bytes ready for writing, or NULL if buffer is full + */ + static __inline__ __attribute__((always_inline)) void* + TPCircularBufferHead(TPCircularBuffer* buffer, int32_t* availableBytes) + { + *availableBytes = (buffer->length - buffer->fillCount); + if (*availableBytes == 0) + return NULL; + return (void*)((char*)buffer->buffer + buffer->head); + } -/*! - * Version of TPCircularBufferProduce without the memory barrier, for more optimal use in single-threaded contexts - */ -static __inline__ __attribute__((always_inline)) void TPCircularBufferProduceNoBarrier(TPCircularBuffer *buffer, int amount) { - buffer->head = (buffer->head + amount) % buffer->length; - buffer->fillCount += amount; - assert(buffer->fillCount <= buffer->length); -} + // Writing (producing) -/*! - * Helper routine to copy bytes to buffer - * - * This copies the given bytes to the buffer, and marks them ready for writing. - * - * @param buffer Circular buffer - * @param src Source buffer - * @param len Number of bytes in source buffer - * @return true if bytes copied, false if there was insufficient space - */ -static __inline__ __attribute__((always_inline)) bool TPCircularBufferProduceBytes(TPCircularBuffer *buffer, const void* src, int32_t len) { - int32_t space; - void *ptr = TPCircularBufferHead(buffer, &space); - if ( space < len ) return false; - memcpy(ptr, src, len); - TPCircularBufferProduce(buffer, len); - return true; -} + /*! + * Produce bytes in buffer + * + * This marks the given section of the buffer ready for reading. + * + * @param buffer Circular buffer + * @param amount Number of bytes to produce + */ + static __inline__ __attribute__((always_inline)) void + TPCircularBufferProduce(TPCircularBuffer* buffer, int amount) + { + buffer->head = (buffer->head + amount) % buffer->length; + OSAtomicAdd32Barrier(amount, &buffer->fillCount); + assert(buffer->fillCount <= buffer->length); + } + + /*! + * Version of TPCircularBufferProduce without the memory barrier, for more optimal use in + * single-threaded contexts + */ + static __inline__ __attribute__((always_inline)) void + TPCircularBufferProduceNoBarrier(TPCircularBuffer* buffer, int amount) + { + buffer->head = (buffer->head + amount) % buffer->length; + buffer->fillCount += amount; + assert(buffer->fillCount <= buffer->length); + } + + /*! + * Helper routine to copy bytes to buffer + * + * This copies the given bytes to the buffer, and marks them ready for writing. + * + * @param buffer Circular buffer + * @param src Source buffer + * @param len Number of bytes in source buffer + * @return true if bytes copied, false if there was insufficient space + */ + static __inline__ __attribute__((always_inline)) bool + TPCircularBufferProduceBytes(TPCircularBuffer* buffer, const void* src, int32_t len) + { + int32_t space; + void* ptr = TPCircularBufferHead(buffer, &space); + if (space < len) + return false; + memcpy(ptr, src, len); + TPCircularBufferProduce(buffer, len); + return true; + } #ifdef __cplusplus } diff --git a/channels/rdpsnd/client/ios/rdpsnd_ios.c b/channels/rdpsnd/client/ios/rdpsnd_ios.c index 643164441..29feb97cc 100644 --- a/channels/rdpsnd/client/ios/rdpsnd_ios.c +++ b/channels/rdpsnd/client/ios/rdpsnd_ios.c @@ -33,8 +33,8 @@ #include "rdpsnd_main.h" #include "TPCircularBuffer.h" -#define INPUT_BUFFER_SIZE 32768 -#define CIRCULAR_BUFFER_SIZE (INPUT_BUFFER_SIZE * 4) +#define INPUT_BUFFER_SIZE 32768 +#define CIRCULAR_BUFFER_SIZE (INPUT_BUFFER_SIZE * 4) typedef struct rdpsnd_ios_plugin { @@ -47,14 +47,10 @@ typedef struct rdpsnd_ios_plugin #define THIS(__ptr) ((rdpsndIOSPlugin*)__ptr) -static OSStatus rdpsnd_ios_render_cb( - void* inRefCon, - AudioUnitRenderActionFlags __unused* ioActionFlags, - const AudioTimeStamp __unused* inTimeStamp, - UInt32 inBusNumber, - UInt32 __unused inNumberFrames, - AudioBufferList* ioData -) +static OSStatus rdpsnd_ios_render_cb(void* inRefCon, + AudioUnitRenderActionFlags __unused* ioActionFlags, + const AudioTimeStamp __unused* inTimeStamp, UInt32 inBusNumber, + UInt32 __unused inNumberFrames, AudioBufferList* ioData) { unsigned int i; @@ -182,22 +178,17 @@ static BOOL rdpsnd_ios_open(rdpsndDevicePlugin* device, AUDIO_FORMAT* format, in return FALSE; /* Set the format for the AudioUnit. */ - AudioStreamBasicDescription audioFormat = {0}; - audioFormat.mSampleRate = format->nSamplesPerSec; - audioFormat.mFormatID = kAudioFormatLinearPCM; - audioFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked; - audioFormat.mFramesPerPacket = 1; /* imminent property of the Linear PCM */ + AudioStreamBasicDescription audioFormat = { 0 }; + audioFormat.mSampleRate = format->nSamplesPerSec; + audioFormat.mFormatID = kAudioFormatLinearPCM; + audioFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked; + audioFormat.mFramesPerPacket = 1; /* imminent property of the Linear PCM */ audioFormat.mChannelsPerFrame = format->nChannels; - audioFormat.mBitsPerChannel = format->wBitsPerSample; - audioFormat.mBytesPerFrame = (format->wBitsPerSample * format->nChannels) / 8; - audioFormat.mBytesPerPacket = audioFormat.mBytesPerFrame * audioFormat.mFramesPerPacket; - status = AudioUnitSetProperty( - p->audio_unit, - kAudioUnitProperty_StreamFormat, - kAudioUnitScope_Input, - 0, - &audioFormat, - sizeof(audioFormat)); + audioFormat.mBitsPerChannel = format->wBitsPerSample; + audioFormat.mBytesPerFrame = (format->wBitsPerSample * format->nChannels) / 8; + audioFormat.mBytesPerPacket = audioFormat.mBytesPerFrame * audioFormat.mFramesPerPacket; + status = AudioUnitSetProperty(p->audio_unit, kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Input, 0, &audioFormat, sizeof(audioFormat)); if (status != 0) { @@ -207,16 +198,12 @@ static BOOL rdpsnd_ios_open(rdpsndDevicePlugin* device, AUDIO_FORMAT* format, in } /* Set up the AudioUnit callback. */ - AURenderCallbackStruct callbackStruct = {0}; + AURenderCallbackStruct callbackStruct = { 0 }; callbackStruct.inputProc = rdpsnd_ios_render_cb; callbackStruct.inputProcRefCon = p; - status = AudioUnitSetProperty( - p->audio_unit, - kAudioUnitProperty_SetRenderCallback, - kAudioUnitScope_Input, - 0, - &callbackStruct, - sizeof(callbackStruct)); + status = + AudioUnitSetProperty(p->audio_unit, kAudioUnitProperty_SetRenderCallback, + kAudioUnitScope_Input, 0, &callbackStruct, sizeof(callbackStruct)); if (status != 0) { @@ -279,9 +266,9 @@ static void rdpsnd_ios_free(rdpsndDevicePlugin* device) } #ifdef BUILTIN_CHANNELS -#define freerdp_rdpsnd_client_subsystem_entry ios_freerdp_rdpsnd_client_subsystem_entry +#define freerdp_rdpsnd_client_subsystem_entry ios_freerdp_rdpsnd_client_subsystem_entry #else -#define freerdp_rdpsnd_client_subsystem_entry FREERDP_API freerdp_rdpsnd_client_subsystem_entry +#define freerdp_rdpsnd_client_subsystem_entry FREERDP_API freerdp_rdpsnd_client_subsystem_entry #endif /** @@ -291,7 +278,7 @@ static void rdpsnd_ios_free(rdpsndDevicePlugin* device) */ UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints) { - rdpsndIOSPlugin* p = (rdpsndIOSPlugin*) calloc(1, sizeof(rdpsndIOSPlugin)); + rdpsndIOSPlugin* p = (rdpsndIOSPlugin*)calloc(1, sizeof(rdpsndIOSPlugin)); if (!p) return CHANNEL_RC_NO_MEMORY; diff --git a/channels/rdpsnd/client/mac/rdpsnd_mac.m b/channels/rdpsnd/client/mac/rdpsnd_mac.m index d31466427..78ac8003c 100644 --- a/channels/rdpsnd/client/mac/rdpsnd_mac.m +++ b/channels/rdpsnd/client/mac/rdpsnd_mac.m @@ -49,16 +49,16 @@ struct rdpsnd_mac_plugin UINT32 latency; AUDIO_FORMAT format; - AVAudioEngine* engine; - AVAudioPlayerNode* player; + AVAudioEngine *engine; + AVAudioPlayerNode *player; UINT64 diff; }; typedef struct rdpsnd_mac_plugin rdpsndMacPlugin; -static BOOL rdpsnd_mac_set_format(rdpsndDevicePlugin* device, const AUDIO_FORMAT* format, +static BOOL rdpsnd_mac_set_format(rdpsndDevicePlugin *device, const AUDIO_FORMAT *format, UINT32 latency) { - rdpsndMacPlugin* mac = (rdpsndMacPlugin*) device; + rdpsndMacPlugin *mac = (rdpsndMacPlugin *)device; if (!mac || !format) return FALSE; @@ -69,7 +69,7 @@ static BOOL rdpsnd_mac_set_format(rdpsndDevicePlugin* device, const AUDIO_FORMAT return TRUE; } -static char* FormatError(OSStatus st) +static char *FormatError(OSStatus st) { switch (st) { @@ -126,7 +126,7 @@ static char* FormatError(OSStatus st) } } -static void rdpsnd_mac_release(rdpsndMacPlugin* mac) +static void rdpsnd_mac_release(rdpsndMacPlugin *mac) { if (mac->player) [mac->player release]; @@ -137,10 +137,10 @@ static void rdpsnd_mac_release(rdpsndMacPlugin* mac) mac->engine = NULL; } -static BOOL rdpsnd_mac_open(rdpsndDevicePlugin* device, const AUDIO_FORMAT* format, UINT32 latency) +static BOOL rdpsnd_mac_open(rdpsndDevicePlugin *device, const AUDIO_FORMAT *format, UINT32 latency) { - NSError* error; - rdpsndMacPlugin* mac = (rdpsndMacPlugin*) device; + NSError *error; + rdpsndMacPlugin *mac = (rdpsndMacPlugin *)device; if (mac->isOpen) return TRUE; @@ -160,11 +160,11 @@ static BOOL rdpsnd_mac_open(rdpsndDevicePlugin* device, const AUDIO_FORMAT* form return FALSE; } - [mac->engine attachNode: mac->player]; + [mac->engine attachNode:mac->player]; - [mac->engine connect: mac->player to: mac->engine.mainMixerNode format: nil]; + [mac->engine connect:mac->player to:mac->engine.mainMixerNode format:nil]; - if (![mac->engine startAndReturnError: &error]) + if (![mac->engine startAndReturnError:&error]) { device->Close(device); WLog_ERR(TAG, "Failed to start audio player %s", [error.localizedDescription UTF8String]); @@ -175,14 +175,14 @@ static BOOL rdpsnd_mac_open(rdpsndDevicePlugin* device, const AUDIO_FORMAT* form return TRUE; } -static void rdpsnd_mac_close(rdpsndDevicePlugin* device) +static void rdpsnd_mac_close(rdpsndDevicePlugin *device) { - rdpsndMacPlugin* mac = (rdpsndMacPlugin*) device; + rdpsndMacPlugin *mac = (rdpsndMacPlugin *)device; if (mac->isPlaying) { - [mac->player stop]; - mac->isPlaying = FALSE; + [mac->player stop]; + mac->isPlaying = FALSE; } if (mac->isOpen) @@ -194,22 +194,22 @@ static void rdpsnd_mac_close(rdpsndDevicePlugin* device) rdpsnd_mac_release(mac); } -static void rdpsnd_mac_free(rdpsndDevicePlugin* device) +static void rdpsnd_mac_free(rdpsndDevicePlugin *device) { - rdpsndMacPlugin* mac = (rdpsndMacPlugin*) device; + rdpsndMacPlugin *mac = (rdpsndMacPlugin *)device; device->Close(device); free(mac); } -static BOOL rdpsnd_mac_format_supported(rdpsndDevicePlugin* device, const AUDIO_FORMAT* format) +static BOOL rdpsnd_mac_format_supported(rdpsndDevicePlugin *device, const AUDIO_FORMAT *format) { WINPR_UNUSED(device); switch (format->wFormatTag) { case WAVE_FORMAT_PCM: - if (format->wBitsPerSample != 16) - return FALSE; + if (format->wBitsPerSample != 16) + return FALSE; return TRUE; default: @@ -217,28 +217,28 @@ static BOOL rdpsnd_mac_format_supported(rdpsndDevicePlugin* device, const AUDIO_ } } -static BOOL rdpsnd_mac_set_volume(rdpsndDevicePlugin* device, UINT32 value) +static BOOL rdpsnd_mac_set_volume(rdpsndDevicePlugin *device, UINT32 value) { Float32 fVolume; UINT16 volumeLeft; UINT16 volumeRight; - rdpsndMacPlugin* mac = (rdpsndMacPlugin*) device; + rdpsndMacPlugin *mac = (rdpsndMacPlugin *)device; if (!mac->player) return FALSE; volumeLeft = (value & 0xFFFF); volumeRight = ((value >> 16) & 0xFFFF); - fVolume = ((float) volumeLeft) / 65535.0f; + fVolume = ((float)volumeLeft) / 65535.0f; mac->player.volume = fVolume; return TRUE; } -static void rdpsnd_mac_start(rdpsndDevicePlugin* device) +static void rdpsnd_mac_start(rdpsndDevicePlugin *device) { - rdpsndMacPlugin* mac = (rdpsndMacPlugin*) device; + rdpsndMacPlugin *mac = (rdpsndMacPlugin *)device; if (!mac->isPlaying) { @@ -249,12 +249,12 @@ static void rdpsnd_mac_start(rdpsndDevicePlugin* device) } } -static UINT rdpsnd_mac_play(rdpsndDevicePlugin* device, const BYTE* data, size_t size) +static UINT rdpsnd_mac_play(rdpsndDevicePlugin *device, const BYTE *data, size_t size) { - rdpsndMacPlugin* mac = (rdpsndMacPlugin*) device; - AVAudioPCMBuffer* buffer; - AVAudioFormat* format; - float * const * db; + rdpsndMacPlugin *mac = (rdpsndMacPlugin *)device; + AVAudioPCMBuffer *buffer; + AVAudioFormat *format; + float *const *db; size_t pos, step, x; AVAudioFrameCount count; UINT64 start = GetTickCount64(); @@ -265,13 +265,16 @@ static UINT rdpsnd_mac_play(rdpsndDevicePlugin* device, const BYTE* data, size_t step = 2 * mac->format.nChannels; count = size / step; - format = [[AVAudioFormat alloc] initWithCommonFormat:AVAudioPCMFormatFloat32 sampleRate:mac->format.nSamplesPerSec channels:mac->format.nChannels interleaved:NO]; + format = [[AVAudioFormat alloc] initWithCommonFormat:AVAudioPCMFormatFloat32 + sampleRate:mac->format.nSamplesPerSec + channels:mac->format.nChannels + interleaved:NO]; if (!format) { WLog_WARN(TAG, "AVAudioFormat::init() failed"); return 0; } - buffer = [[AVAudioPCMBuffer alloc] initWithPCMFormat:format frameCapacity: count]; + buffer = [[AVAudioPCMBuffer alloc] initWithPCMFormat:format frameCapacity:count]; if (!buffer) { [format release]; @@ -282,10 +285,10 @@ static UINT rdpsnd_mac_play(rdpsndDevicePlugin* device, const BYTE* data, size_t buffer.frameLength = buffer.frameCapacity; db = buffer.floatChannelData; - for (pos=0; posformat.nChannels; x++) + const BYTE *d = &data[pos * step]; + for (x = 0; x < mac->format.nChannels; x++) { const float val = (int16_t)((uint16_t)d[0] | ((uint16_t)d[1] << 8)) / 32768.0f; db[x][pos] = val; @@ -295,21 +298,22 @@ static UINT rdpsnd_mac_play(rdpsndDevicePlugin* device, const BYTE* data, size_t rdpsnd_mac_start(device); - [mac->player scheduleBuffer: buffer completionHandler:^{ - UINT64 stop = GetTickCount64(); - if (start > stop) - mac->diff = 0; - else - mac->diff = stop - start; - }]; + [mac->player scheduleBuffer:buffer + completionHandler:^{ + UINT64 stop = GetTickCount64(); + if (start > stop) + mac->diff = 0; + else + mac->diff = stop - start; + }]; return mac->diff > UINT_MAX ? UINT_MAX : mac->diff; } #ifdef BUILTIN_CHANNELS -#define freerdp_rdpsnd_client_subsystem_entry mac_freerdp_rdpsnd_client_subsystem_entry +#define freerdp_rdpsnd_client_subsystem_entry mac_freerdp_rdpsnd_client_subsystem_entry #else -#define freerdp_rdpsnd_client_subsystem_entry FREERDP_API freerdp_rdpsnd_client_subsystem_entry +#define freerdp_rdpsnd_client_subsystem_entry FREERDP_API freerdp_rdpsnd_client_subsystem_entry #endif /** @@ -319,8 +323,8 @@ static UINT rdpsnd_mac_play(rdpsndDevicePlugin* device, const BYTE* data, size_t */ UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints) { - rdpsndMacPlugin* mac; - mac = (rdpsndMacPlugin*) calloc(1, sizeof(rdpsndMacPlugin)); + rdpsndMacPlugin *mac; + mac = (rdpsndMacPlugin *)calloc(1, sizeof(rdpsndMacPlugin)); if (!mac) return CHANNEL_RC_NO_MEMORY; @@ -331,6 +335,6 @@ UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS p mac->device.Play = rdpsnd_mac_play; mac->device.Close = rdpsnd_mac_close; mac->device.Free = rdpsnd_mac_free; - pEntryPoints->pRegisterRdpsndDevice(pEntryPoints->rdpsnd, (rdpsndDevicePlugin*) mac); + pEntryPoints->pRegisterRdpsndDevice(pEntryPoints->rdpsnd, (rdpsndDevicePlugin *)mac); return CHANNEL_RC_OK; } diff --git a/channels/rdpsnd/client/opensles/opensl_io.c b/channels/rdpsnd/client/opensles/opensl_io.c index ffc24e12c..61afc108f 100644 --- a/channels/rdpsnd/client/opensles/opensl_io.c +++ b/channels/rdpsnd/client/opensles/opensl_io.c @@ -6,14 +6,14 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -32,7 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "rdpsnd_main.h" #include "opensl_io.h" #define CONV16BIT 32768 -#define CONVMYFLT (1./32768.) +#define CONVMYFLT (1. / 32768.) static void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void* context); @@ -42,22 +42,24 @@ static SLresult openSLCreateEngine(OPENSL_STREAM* p) SLresult result; // create engine result = slCreateEngine(&(p->engineObject), 0, NULL, 0, NULL, NULL); - DEBUG_SND("engineObject=%p", (void*) p->engineObject); + DEBUG_SND("engineObject=%p", (void*)p->engineObject); - if (result != SL_RESULT_SUCCESS) goto engine_end; + if (result != SL_RESULT_SUCCESS) + goto engine_end; // realize the engine result = (*p->engineObject)->Realize(p->engineObject, SL_BOOLEAN_FALSE); - DEBUG_SND("Realize=%"PRIu32"", result); + DEBUG_SND("Realize=%" PRIu32 "", result); - if (result != SL_RESULT_SUCCESS) goto engine_end; + if (result != SL_RESULT_SUCCESS) + goto engine_end; // get the engine interface, which is needed in order to create other objects - result = (*p->engineObject)->GetInterface(p->engineObject, SL_IID_ENGINE, - &(p->engineEngine)); - DEBUG_SND("engineEngine=%p", (void*) p->engineEngine); + result = (*p->engineObject)->GetInterface(p->engineObject, SL_IID_ENGINE, &(p->engineEngine)); + DEBUG_SND("engineEngine=%p", (void*)p->engineEngine); - if (result != SL_RESULT_SUCCESS) goto engine_end; + if (result != SL_RESULT_SUCCESS) + goto engine_end; engine_end: return result; @@ -68,18 +70,15 @@ static SLresult openSLPlayOpen(OPENSL_STREAM* p) { SLresult result; SLuint32 sr = p->sr; - SLuint32 channels = p->outchannels; + SLuint32 channels = p->outchannels; assert(p->engineObject); assert(p->engineEngine); if (channels) { // configure audio source - SLDataLocator_AndroidSimpleBufferQueue loc_bufq = - { - SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, - p->queuesize - }; + SLDataLocator_AndroidSimpleBufferQueue loc_bufq = { SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, + p->queuesize }; switch (sr) { @@ -135,90 +134,102 @@ static SLresult openSLPlayOpen(OPENSL_STREAM* p) return -1; } - const SLInterfaceID ids[] = {SL_IID_VOLUME}; - const SLboolean req[] = {SL_BOOLEAN_FALSE}; - result = (*p->engineEngine)->CreateOutputMix(p->engineEngine, - &(p->outputMixObject), 1, ids, req); - DEBUG_SND("engineEngine=%p", (void*) p->engineEngine); + const SLInterfaceID ids[] = { SL_IID_VOLUME }; + const SLboolean req[] = { SL_BOOLEAN_FALSE }; + result = (*p->engineEngine) + ->CreateOutputMix(p->engineEngine, &(p->outputMixObject), 1, ids, req); + DEBUG_SND("engineEngine=%p", (void*)p->engineEngine); assert(!result); - if (result != SL_RESULT_SUCCESS) goto end_openaudio; + if (result != SL_RESULT_SUCCESS) + goto end_openaudio; // realize the output mix result = (*p->outputMixObject)->Realize(p->outputMixObject, SL_BOOLEAN_FALSE); - DEBUG_SND("Realize=%"PRIu32"", result); + DEBUG_SND("Realize=%" PRIu32 "", result); assert(!result); - if (result != SL_RESULT_SUCCESS) goto end_openaudio; + if (result != SL_RESULT_SUCCESS) + goto end_openaudio; int speakers; if (channels > 1) speakers = SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT; - else speakers = SL_SPEAKER_FRONT_CENTER; + else + speakers = SL_SPEAKER_FRONT_CENTER; - SLDataFormat_PCM format_pcm = {SL_DATAFORMAT_PCM, channels, sr, - SL_PCMSAMPLEFORMAT_FIXED_16, SL_PCMSAMPLEFORMAT_FIXED_16, - speakers, SL_BYTEORDER_LITTLEENDIAN - }; - SLDataSource audioSrc = {&loc_bufq, &format_pcm}; + SLDataFormat_PCM format_pcm = { SL_DATAFORMAT_PCM, + channels, + sr, + SL_PCMSAMPLEFORMAT_FIXED_16, + SL_PCMSAMPLEFORMAT_FIXED_16, + speakers, + SL_BYTEORDER_LITTLEENDIAN }; + SLDataSource audioSrc = { &loc_bufq, &format_pcm }; // configure audio sink - SLDataLocator_OutputMix loc_outmix = {SL_DATALOCATOR_OUTPUTMIX, p->outputMixObject}; - SLDataSink audioSnk = {&loc_outmix, NULL}; + SLDataLocator_OutputMix loc_outmix = { SL_DATALOCATOR_OUTPUTMIX, p->outputMixObject }; + SLDataSink audioSnk = { &loc_outmix, NULL }; // create audio player - const SLInterfaceID ids1[] = {SL_IID_ANDROIDSIMPLEBUFFERQUEUE, SL_IID_VOLUME}; - const SLboolean req1[] = {SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE}; - result = (*p->engineEngine)->CreateAudioPlayer(p->engineEngine, - &(p->bqPlayerObject), &audioSrc, &audioSnk, 2, ids1, req1); - DEBUG_SND("bqPlayerObject=%p", (void*) p->bqPlayerObject); + const SLInterfaceID ids1[] = { SL_IID_ANDROIDSIMPLEBUFFERQUEUE, SL_IID_VOLUME }; + const SLboolean req1[] = { SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE }; + result = (*p->engineEngine) + ->CreateAudioPlayer(p->engineEngine, &(p->bqPlayerObject), &audioSrc, + &audioSnk, 2, ids1, req1); + DEBUG_SND("bqPlayerObject=%p", (void*)p->bqPlayerObject); assert(!result); - if (result != SL_RESULT_SUCCESS) goto end_openaudio; + if (result != SL_RESULT_SUCCESS) + goto end_openaudio; // realize the player result = (*p->bqPlayerObject)->Realize(p->bqPlayerObject, SL_BOOLEAN_FALSE); - DEBUG_SND("Realize=%"PRIu32"", result); + DEBUG_SND("Realize=%" PRIu32 "", result); assert(!result); - if (result != SL_RESULT_SUCCESS) goto end_openaudio; + if (result != SL_RESULT_SUCCESS) + goto end_openaudio; // get the play interface - result = (*p->bqPlayerObject)->GetInterface(p->bqPlayerObject, SL_IID_PLAY, - &(p->bqPlayerPlay)); - DEBUG_SND("bqPlayerPlay=%p", (void*) p->bqPlayerPlay); + result = + (*p->bqPlayerObject)->GetInterface(p->bqPlayerObject, SL_IID_PLAY, &(p->bqPlayerPlay)); + DEBUG_SND("bqPlayerPlay=%p", (void*)p->bqPlayerPlay); assert(!result); - if (result != SL_RESULT_SUCCESS) goto end_openaudio; + if (result != SL_RESULT_SUCCESS) + goto end_openaudio; // get the volume interface - result = (*p->bqPlayerObject)->GetInterface(p->bqPlayerObject, SL_IID_VOLUME, - &(p->bqPlayerVolume)); - DEBUG_SND("bqPlayerVolume=%p", (void*) p->bqPlayerVolume); + result = (*p->bqPlayerObject) + ->GetInterface(p->bqPlayerObject, SL_IID_VOLUME, &(p->bqPlayerVolume)); + DEBUG_SND("bqPlayerVolume=%p", (void*)p->bqPlayerVolume); assert(!result); - if (result != SL_RESULT_SUCCESS) goto end_openaudio; + if (result != SL_RESULT_SUCCESS) + goto end_openaudio; // get the buffer queue interface - result = (*p->bqPlayerObject)->GetInterface(p->bqPlayerObject, - SL_IID_ANDROIDSIMPLEBUFFERQUEUE, - &(p->bqPlayerBufferQueue)); - DEBUG_SND("bqPlayerBufferQueue=%p", (void*) p->bqPlayerBufferQueue); + result = (*p->bqPlayerObject) + ->GetInterface(p->bqPlayerObject, SL_IID_ANDROIDSIMPLEBUFFERQUEUE, + &(p->bqPlayerBufferQueue)); + DEBUG_SND("bqPlayerBufferQueue=%p", (void*)p->bqPlayerBufferQueue); assert(!result); - if (result != SL_RESULT_SUCCESS) goto end_openaudio; + if (result != SL_RESULT_SUCCESS) + goto end_openaudio; // register callback on the buffer queue - result = (*p->bqPlayerBufferQueue)->RegisterCallback(p->bqPlayerBufferQueue, - bqPlayerCallback, p); - DEBUG_SND("bqPlayerCallback=%p", (void*) p->bqPlayerCallback); + result = (*p->bqPlayerBufferQueue) + ->RegisterCallback(p->bqPlayerBufferQueue, bqPlayerCallback, p); + DEBUG_SND("bqPlayerCallback=%p", (void*)p->bqPlayerCallback); assert(!result); - if (result != SL_RESULT_SUCCESS) goto end_openaudio; + if (result != SL_RESULT_SUCCESS) + goto end_openaudio; // set the player's state to playing - result = (*p->bqPlayerPlay)->SetPlayState(p->bqPlayerPlay, - SL_PLAYSTATE_PLAYING); - DEBUG_SND("SetPlayState=%"PRIu32"", result); + result = (*p->bqPlayerPlay)->SetPlayState(p->bqPlayerPlay, SL_PLAYSTATE_PLAYING); + DEBUG_SND("SetPlayState=%" PRIu32 "", result); assert(!result); end_openaudio: assert(!result); @@ -258,13 +269,11 @@ static void openSLDestroyEngine(OPENSL_STREAM* p) } } - // open the android audio device for and/or output -OPENSL_STREAM* android_OpenAudioDevice(int sr, int outchannels, - int bufferframes) +OPENSL_STREAM* android_OpenAudioDevice(int sr, int outchannels, int bufferframes) { OPENSL_STREAM* p; - p = (OPENSL_STREAM*) calloc(1, sizeof(OPENSL_STREAM)); + p = (OPENSL_STREAM*)calloc(1, sizeof(OPENSL_STREAM)); if (!p) return NULL; @@ -313,7 +322,7 @@ void android_CloseAudioDevice(OPENSL_STREAM* p) // this callback handler is called every time a buffer finishes playing static void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void* context) { - OPENSL_STREAM* p = (OPENSL_STREAM*) context; + OPENSL_STREAM* p = (OPENSL_STREAM*)context; assert(p); assert(p->queue); void* data = Queue_Dequeue(p->queue); @@ -328,8 +337,8 @@ int android_AudioOut(OPENSL_STREAM* p, const short* buffer, int size) assert(size > 0); /* Assure, that the queue is not full. */ - if (p->queuesize <= Queue_Count(p->queue) - && WaitForSingleObject(p->queue->event, INFINITE) == WAIT_FAILED) + if (p->queuesize <= Queue_Count(p->queue) && + WaitForSingleObject(p->queue->event, INFINITE) == WAIT_FAILED) { DEBUG_SND("WaitForSingleObject failed!"); return -1; @@ -345,8 +354,7 @@ int android_AudioOut(OPENSL_STREAM* p, const short* buffer, int size) memcpy(data, buffer, size * sizeof(short)); Queue_Enqueue(p->queue, data); - (*p->bqPlayerBufferQueue)->Enqueue(p->bqPlayerBufferQueue, - data, sizeof(short) * size); + (*p->bqPlayerBufferQueue)->Enqueue(p->bqPlayerBufferQueue, data, sizeof(short) * size); return size; } @@ -394,8 +402,7 @@ int android_GetOutputVolumeMax(OPENSL_STREAM* p) SLmillibel level; assert(p); assert(p->bqPlayerVolume); - SLresult rc = (*p->bqPlayerVolume)->GetMaxVolumeLevel(p->bqPlayerVolume, - &level); + SLresult rc = (*p->bqPlayerVolume)->GetMaxVolumeLevel(p->bqPlayerVolume, &level); if (SL_RESULT_SUCCESS != rc) return 0; @@ -403,7 +410,6 @@ int android_GetOutputVolumeMax(OPENSL_STREAM* p) return level; } - BOOL android_SetOutputVolume(OPENSL_STREAM* p, int level) { SLresult rc = (*p->bqPlayerVolume)->SetVolumeLevel(p->bqPlayerVolume, level); @@ -413,4 +419,3 @@ BOOL android_SetOutputVolume(OPENSL_STREAM* p, int level) return TRUE; } - diff --git a/channels/rdpsnd/client/opensles/opensl_io.h b/channels/rdpsnd/client/opensles/opensl_io.h index 0bb121a53..57dc04841 100644 --- a/channels/rdpsnd/client/opensles/opensl_io.h +++ b/channels/rdpsnd/client/opensles/opensl_io.h @@ -6,14 +6,14 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -38,72 +38,71 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct opensl_stream -{ - // engine interfaces - SLObjectItf engineObject; - SLEngineItf engineEngine; + typedef struct opensl_stream + { + // engine interfaces + SLObjectItf engineObject; + SLEngineItf engineEngine; - // output mix interfaces - SLObjectItf outputMixObject; + // output mix interfaces + SLObjectItf outputMixObject; - // buffer queue player interfaces - SLObjectItf bqPlayerObject; - SLPlayItf bqPlayerPlay; - SLVolumeItf bqPlayerVolume; - SLAndroidSimpleBufferQueueItf bqPlayerBufferQueue; - SLEffectSendItf bqPlayerEffectSend; + // buffer queue player interfaces + SLObjectItf bqPlayerObject; + SLPlayItf bqPlayerPlay; + SLVolumeItf bqPlayerVolume; + SLAndroidSimpleBufferQueueItf bqPlayerBufferQueue; + SLEffectSendItf bqPlayerEffectSend; - unsigned int outchannels; - unsigned int sr; + unsigned int outchannels; + unsigned int sr; - unsigned int queuesize; - wQueue* queue; -} OPENSL_STREAM; + unsigned int queuesize; + wQueue* queue; + } OPENSL_STREAM; -/* -Open the audio device with a given sampling rate (sr), output channels and IO buffer size -in frames. Returns a handle to the OpenSL stream -*/ -FREERDP_LOCAL OPENSL_STREAM* android_OpenAudioDevice(int sr, int outchannels, - int bufferframes); -/* -Close the audio device -*/ -FREERDP_LOCAL void android_CloseAudioDevice(OPENSL_STREAM* p); -/* -Write a buffer to the OpenSL stream *p, of size samples. Returns the number of samples written. -*/ -FREERDP_LOCAL int android_AudioOut(OPENSL_STREAM* p, const short* buffer, - int size); -/* - * Set the volume input level. - */ -FREERDP_LOCAL void android_SetInputVolume(OPENSL_STREAM* p, int level); -/* - * Get the current output mute setting. - */ -FREERDP_LOCAL int android_GetOutputMute(OPENSL_STREAM* p); -/* - * Change the current output mute setting. - */ -FREERDP_LOCAL BOOL android_SetOutputMute(OPENSL_STREAM* p, BOOL mute); -/* - * Get the current output volume level. - */ -FREERDP_LOCAL int android_GetOutputVolume(OPENSL_STREAM* p); -/* - * Get the maximum output volume level. - */ -FREERDP_LOCAL int android_GetOutputVolumeMax(OPENSL_STREAM* p); + /* + Open the audio device with a given sampling rate (sr), output channels and IO buffer size + in frames. Returns a handle to the OpenSL stream + */ + FREERDP_LOCAL OPENSL_STREAM* android_OpenAudioDevice(int sr, int outchannels, int bufferframes); + /* + Close the audio device + */ + FREERDP_LOCAL void android_CloseAudioDevice(OPENSL_STREAM* p); + /* + Write a buffer to the OpenSL stream *p, of size samples. Returns the number of samples written. + */ + FREERDP_LOCAL int android_AudioOut(OPENSL_STREAM* p, const short* buffer, int size); + /* + * Set the volume input level. + */ + FREERDP_LOCAL void android_SetInputVolume(OPENSL_STREAM* p, int level); + /* + * Get the current output mute setting. + */ + FREERDP_LOCAL int android_GetOutputMute(OPENSL_STREAM* p); + /* + * Change the current output mute setting. + */ + FREERDP_LOCAL BOOL android_SetOutputMute(OPENSL_STREAM* p, BOOL mute); + /* + * Get the current output volume level. + */ + FREERDP_LOCAL int android_GetOutputVolume(OPENSL_STREAM* p); + /* + * Get the maximum output volume level. + */ + FREERDP_LOCAL int android_GetOutputVolumeMax(OPENSL_STREAM* p); -/* - * Set the volume output level. - */ -FREERDP_LOCAL BOOL android_SetOutputVolume(OPENSL_STREAM* p, int level); + /* + * Set the volume output level. + */ + FREERDP_LOCAL BOOL android_SetOutputVolume(OPENSL_STREAM* p, int level); #ifdef __cplusplus }; #endif diff --git a/channels/rdpsnd/client/opensles/rdpsnd_opensles.c b/channels/rdpsnd/client/opensles/rdpsnd_opensles.c index e00c0e76a..3481d9130 100644 --- a/channels/rdpsnd/client/opensles/rdpsnd_opensles.c +++ b/channels/rdpsnd/client/opensles/rdpsnd_opensles.c @@ -66,8 +66,7 @@ static int rdpsnd_opensles_volume_to_millibel(unsigned short level, int max) const int min = SL_MILLIBEL_MIN; const int step = max - min; const int rc = (level * step / 0xFFFF) + min; - DEBUG_SND("level=%hu, min=%d, max=%d, step=%d, result=%d", - level, min, max, step, rc); + DEBUG_SND("level=%hu, min=%d, max=%d, step=%d, result=%d", level, min, max, step, rc); return rc; } @@ -76,8 +75,7 @@ static unsigned short rdpsnd_opensles_millibel_to_volume(int millibel, int max) const int min = SL_MILLIBEL_MIN; const int range = max - min; const int rc = ((millibel - min) * 0xFFFF + range / 2 + 1) / range; - DEBUG_SND("millibel=%d, min=%d, max=%d, range=%d, result=%d", - millibel, min, max, range, rc); + DEBUG_SND("millibel=%d, min=%d, max=%d, range=%d, result=%d", millibel, min, max, range, rc); return rc; } @@ -96,12 +94,11 @@ static bool rdpsnd_opensles_check_handle(const rdpsndopenslesPlugin* hdl) return rc; } -static BOOL rdpsnd_opensles_set_volume(rdpsndDevicePlugin* device, - UINT32 volume); +static BOOL rdpsnd_opensles_set_volume(rdpsndDevicePlugin* device, UINT32 volume); static int rdpsnd_opensles_set_params(rdpsndopenslesPlugin* opensles) { - DEBUG_SND("opensles=%p", (void*) opensles); + DEBUG_SND("opensles=%p", (void*)opensles); if (!rdpsnd_opensles_check_handle(opensles)) return 0; @@ -109,23 +106,23 @@ static int rdpsnd_opensles_set_params(rdpsndopenslesPlugin* opensles) if (opensles->stream) android_CloseAudioDevice(opensles->stream); - opensles->stream = android_OpenAudioDevice( - opensles->rate, opensles->channels, 20); + opensles->stream = android_OpenAudioDevice(opensles->rate, opensles->channels, 20); return 0; } -static BOOL rdpsnd_opensles_set_format(rdpsndDevicePlugin* device, - const AUDIO_FORMAT* format, UINT32 latency) +static BOOL rdpsnd_opensles_set_format(rdpsndDevicePlugin* device, const AUDIO_FORMAT* format, + UINT32 latency) { - rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device; + rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*)device; rdpsnd_opensles_check_handle(opensles); - DEBUG_SND("opensles=%p format=%p, latency=%"PRIu32, (void*) opensles, (void*) format, latency); + DEBUG_SND("opensles=%p format=%p, latency=%" PRIu32, (void*)opensles, (void*)format, latency); if (format) { - DEBUG_SND("format=%"PRIu16", cbsize=%"PRIu16", samples=%"PRIu32", bits=%"PRIu16", channels=%"PRIu16", align=%"PRIu16"", + DEBUG_SND("format=%" PRIu16 ", cbsize=%" PRIu16 ", samples=%" PRIu32 ", bits=%" PRIu16 + ", channels=%" PRIu16 ", align=%" PRIu16 "", format->wFormatTag, format->cbSize, format->nSamplesPerSec, - format->wBitsPerSample, format->nChannels, format->nBlockAlign); + format->wBitsPerSample, format->nChannels, format->nBlockAlign); opensles->rate = format->nSamplesPerSec; opensles->channels = format->nChannels; opensles->format = format->wFormatTag; @@ -137,18 +134,17 @@ static BOOL rdpsnd_opensles_set_format(rdpsndDevicePlugin* device, return (rdpsnd_opensles_set_params(opensles) == 0); } -static BOOL rdpsnd_opensles_open(rdpsndDevicePlugin* device, - const AUDIO_FORMAT* format, UINT32 latency) +static BOOL rdpsnd_opensles_open(rdpsndDevicePlugin* device, const AUDIO_FORMAT* format, + UINT32 latency) { - rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device; - DEBUG_SND("opensles=%p format=%p, latency=%"PRIu32", rate=%"PRIu32"", - (void*) opensles, (void*) format, latency, opensles->rate); + rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*)device; + DEBUG_SND("opensles=%p format=%p, latency=%" PRIu32 ", rate=%" PRIu32 "", (void*)opensles, + (void*)format, latency, opensles->rate); if (rdpsnd_opensles_check_handle(opensles)) return TRUE; - opensles->stream = android_OpenAudioDevice(opensles->rate, opensles->channels, - 20); + opensles->stream = android_OpenAudioDevice(opensles->rate, opensles->channels, 20); assert(opensles->stream); if (!opensles->stream) @@ -161,8 +157,8 @@ static BOOL rdpsnd_opensles_open(rdpsndDevicePlugin* device, static void rdpsnd_opensles_close(rdpsndDevicePlugin* device) { - rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device; - DEBUG_SND("opensles=%p", (void*) opensles); + rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*)device; + DEBUG_SND("opensles=%p", (void*)opensles); if (!rdpsnd_opensles_check_handle(opensles)) return; @@ -173,28 +169,27 @@ static void rdpsnd_opensles_close(rdpsndDevicePlugin* device) static void rdpsnd_opensles_free(rdpsndDevicePlugin* device) { - rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device; - DEBUG_SND("opensles=%p", (void*) opensles); + rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*)device; + DEBUG_SND("opensles=%p", (void*)opensles); assert(opensles); assert(opensles->device_name); free(opensles->device_name); free(opensles); } -static BOOL rdpsnd_opensles_format_supported(rdpsndDevicePlugin* device, - const AUDIO_FORMAT* format) +static BOOL rdpsnd_opensles_format_supported(rdpsndDevicePlugin* device, const AUDIO_FORMAT* format) { - DEBUG_SND("format=%"PRIu16", cbsize=%"PRIu16", samples=%"PRIu32", bits=%"PRIu16", channels=%"PRIu16", align=%"PRIu16"", - format->wFormatTag, format->cbSize, format->nSamplesPerSec, - format->wBitsPerSample, format->nChannels, format->nBlockAlign); + DEBUG_SND("format=%" PRIu16 ", cbsize=%" PRIu16 ", samples=%" PRIu32 ", bits=%" PRIu16 + ", channels=%" PRIu16 ", align=%" PRIu16 "", + format->wFormatTag, format->cbSize, format->nSamplesPerSec, format->wBitsPerSample, + format->nChannels, format->nBlockAlign); assert(device); assert(format); switch (format->wFormatTag) { case WAVE_FORMAT_PCM: - if (format->cbSize == 0 && - format->nSamplesPerSec <= 48000 && + if (format->cbSize == 0 && format->nSamplesPerSec <= 48000 && (format->wBitsPerSample == 8 || format->wBitsPerSample == 16) && (format->nChannels == 1 || format->nChannels == 2)) { @@ -212,8 +207,8 @@ static BOOL rdpsnd_opensles_format_supported(rdpsndDevicePlugin* device, static UINT32 rdpsnd_opensles_get_volume(rdpsndDevicePlugin* device) { - rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device; - DEBUG_SND("opensles=%p", (void*) opensles); + rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*)device; + DEBUG_SND("opensles=%p", (void*)opensles); assert(opensles); if (opensles->stream) @@ -233,11 +228,10 @@ static UINT32 rdpsnd_opensles_get_volume(rdpsndDevicePlugin* device) return opensles->volume; } -static BOOL rdpsnd_opensles_set_volume(rdpsndDevicePlugin* device, - UINT32 value) +static BOOL rdpsnd_opensles_set_volume(rdpsndDevicePlugin* device, UINT32 value) { - rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device; - DEBUG_SND("opensles=%p, value=%"PRIu32"", (void*) opensles, value); + rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*)device; + DEBUG_SND("opensles=%p, value=%" PRIu32 "", (void*)opensles, value); assert(opensles); opensles->volume = value; @@ -261,23 +255,21 @@ static BOOL rdpsnd_opensles_set_volume(rdpsndDevicePlugin* device, return TRUE; } -static UINT rdpsnd_opensles_play(rdpsndDevicePlugin* device, - const BYTE* data, size_t size) +static UINT rdpsnd_opensles_play(rdpsndDevicePlugin* device, const BYTE* data, size_t size) { - union - { + union { const BYTE* b; const short* s; } src; int ret; - rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device; - DEBUG_SND("opensles=%p, data=%p, size=%d", (void*) opensles, (void*) data, size); + rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*)device; + DEBUG_SND("opensles=%p, data=%p, size=%d", (void*)opensles, (void*)data, size); if (!rdpsnd_opensles_check_handle(opensles)) return 0; src.b = data; - DEBUG_SND("size=%d, src=%p", size, (void*) src.b); + DEBUG_SND("size=%d, src=%p", size, (void*)src.b); assert(0 == size % 2); assert(size > 0); assert(src.b); @@ -291,34 +283,29 @@ static UINT rdpsnd_opensles_play(rdpsndDevicePlugin* device, static void rdpsnd_opensles_start(rdpsndDevicePlugin* device) { - rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device; + rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*)device; rdpsnd_opensles_check_handle(opensles); - DEBUG_SND("opensles=%p", (void*) opensles); + DEBUG_SND("opensles=%p", (void*)opensles); } -static int rdpsnd_opensles_parse_addin_args(rdpsndDevicePlugin* device, - ADDIN_ARGV* args) +static int rdpsnd_opensles_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV* args) { int status; DWORD flags; COMMAND_LINE_ARGUMENT_A* arg; - rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device; - COMMAND_LINE_ARGUMENT_A rdpsnd_opensles_args[] = - { - { - "dev", COMMAND_LINE_VALUE_REQUIRED, "", - NULL, NULL, -1, NULL, "device" - }, + rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*)device; + COMMAND_LINE_ARGUMENT_A rdpsnd_opensles_args[] = { + { "dev", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "device" }, { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; assert(opensles); assert(args); - DEBUG_SND("opensles=%p, args=%p", (void*) opensles, (void*) args); - flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | - COMMAND_LINE_IGN_UNKNOWN_KEYWORD; - status = CommandLineParseArgumentsA(args->argc, args->argv, - rdpsnd_opensles_args, flags, opensles, NULL, NULL); + DEBUG_SND("opensles=%p, args=%p", (void*)opensles, (void*)args); + flags = + COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; + status = CommandLineParseArgumentsA(args->argc, args->argv, rdpsnd_opensles_args, flags, + opensles, NULL, NULL); if (status < 0) return status; @@ -330,8 +317,7 @@ static int rdpsnd_opensles_parse_addin_args(rdpsndDevicePlugin* device, if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "dev") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "dev") { opensles->device_name = _strdup(arg->Value); @@ -339,18 +325,15 @@ static int rdpsnd_opensles_parse_addin_args(rdpsndDevicePlugin* device, return ERROR_OUTOFMEMORY; } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); return status; } #ifdef BUILTIN_CHANNELS -#define freerdp_rdpsnd_client_subsystem_entry \ - opensles_freerdp_rdpsnd_client_subsystem_entry +#define freerdp_rdpsnd_client_subsystem_entry opensles_freerdp_rdpsnd_client_subsystem_entry #else -#define freerdp_rdpsnd_client_subsystem_entry \ - FREERDP_API freerdp_rdpsnd_client_subsystem_entry +#define freerdp_rdpsnd_client_subsystem_entry FREERDP_API freerdp_rdpsnd_client_subsystem_entry #endif /** @@ -358,14 +341,13 @@ static int rdpsnd_opensles_parse_addin_args(rdpsndDevicePlugin* device, * * @return 0 on success, otherwise a Win32 error code */ -UINT freerdp_rdpsnd_client_subsystem_entry( - PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints) +UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints) { ADDIN_ARGV* args; rdpsndopenslesPlugin* opensles; UINT error; - DEBUG_SND("pEntryPoints=%p", (void*) pEntryPoints); - opensles = (rdpsndopenslesPlugin*) calloc(1, sizeof(rdpsndopenslesPlugin)); + DEBUG_SND("pEntryPoints=%p", (void*)pEntryPoints); + opensles = (rdpsndopenslesPlugin*)calloc(1, sizeof(rdpsndopenslesPlugin)); if (!opensles) return CHANNEL_RC_NO_MEMORY; @@ -379,7 +361,7 @@ UINT freerdp_rdpsnd_client_subsystem_entry( opensles->device.Close = rdpsnd_opensles_close; opensles->device.Free = rdpsnd_opensles_free; args = pEntryPoints->args; - rdpsnd_opensles_parse_addin_args((rdpsndDevicePlugin*) opensles, args); + rdpsnd_opensles_parse_addin_args((rdpsndDevicePlugin*)opensles, args); if (!opensles->device_name) { @@ -395,8 +377,7 @@ UINT freerdp_rdpsnd_client_subsystem_entry( opensles->rate = 44100; opensles->channels = 2; opensles->format = WAVE_FORMAT_ADPCM; - pEntryPoints->pRegisterRdpsndDevice(pEntryPoints->rdpsnd, - (rdpsndDevicePlugin*) opensles); + pEntryPoints->pRegisterRdpsndDevice(pEntryPoints->rdpsnd, (rdpsndDevicePlugin*)opensles); DEBUG_SND("success"); return CHANNEL_RC_OK; outstrdup: diff --git a/channels/rdpsnd/client/oss/rdpsnd_oss.c b/channels/rdpsnd/client/oss/rdpsnd_oss.c index 19b0a07c5..7a7937dad 100644 --- a/channels/rdpsnd/client/oss/rdpsnd_oss.c +++ b/channels/rdpsnd/client/oss/rdpsnd_oss.c @@ -67,13 +67,12 @@ struct rdpsnd_oss_plugin AUDIO_FORMAT format; }; -#define OSS_LOG_ERR(_text, _error) \ - { \ - if (_error != 0) \ +#define OSS_LOG_ERR(_text, _error) \ + { \ + if (_error != 0) \ WLog_ERR(TAG, "%s: %i - %s", _text, _error, strerror(_error)); \ } - static int rdpsnd_oss_get_format(const AUDIO_FORMAT* format) { switch (format->wFormatTag) @@ -111,8 +110,7 @@ static BOOL rdpsnd_oss_format_supported(rdpsndDevicePlugin* device, const AUDIO_ switch (format->wFormatTag) { case WAVE_FORMAT_PCM: - if (format->cbSize != 0 || - format->nSamplesPerSec > 48000 || + if (format->cbSize != 0 || format->nSamplesPerSec > 48000 || (format->wBitsPerSample != 8 && format->wBitsPerSample != 16) || (format->nChannels != 1 && format->nChannels != 2)) return FALSE; @@ -307,7 +305,7 @@ static UINT32 rdpsnd_oss_get_volume(rdpsndDevicePlugin* device) UINT16 dwVolumeLeft, dwVolumeRight; rdpsndOssPlugin* oss = (rdpsndOssPlugin*)device; /* On error return 50% volume. */ - dwVolumeLeft = ((50 * 0xFFFF) / 100); /* 50% */ + dwVolumeLeft = ((50 * 0xFFFF) / 100); /* 50% */ dwVolumeRight = ((50 * 0xFFFF) / 100); /* 50% */ dwVolume = ((dwVolumeLeft << 16) | dwVolumeRight); @@ -391,18 +389,17 @@ static UINT rdpsnd_oss_play(rdpsndDevicePlugin* device, const BYTE* data, size_t static int rdpsnd_oss_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV* args) { int status; - char* str_num, *eptr; + char *str_num, *eptr; DWORD flags; COMMAND_LINE_ARGUMENT_A* arg; rdpsndOssPlugin* oss = (rdpsndOssPlugin*)device; - COMMAND_LINE_ARGUMENT_A rdpsnd_oss_args[] = - { - { "dev", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "device" }, - { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } - }; - flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; - status = CommandLineParseArgumentsA(args->argc, args->argv, rdpsnd_oss_args, flags, - oss, NULL, NULL); + COMMAND_LINE_ARGUMENT_A rdpsnd_oss_args[] = { { "dev", COMMAND_LINE_VALUE_REQUIRED, "", + NULL, NULL, -1, NULL, "device" }, + { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; + flags = + COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; + status = + CommandLineParseArgumentsA(args->argc, args->argv, rdpsnd_oss_args, flags, oss, NULL, NULL); if (status < 0) return status; @@ -415,8 +412,7 @@ static int rdpsnd_oss_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV* a if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "dev") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "dev") { str_num = _strdup(arg->Value); @@ -441,16 +437,15 @@ static int rdpsnd_oss_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV* a free(str_num); } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); return status; } #ifdef BUILTIN_CHANNELS -#define freerdp_rdpsnd_client_subsystem_entry oss_freerdp_rdpsnd_client_subsystem_entry +#define freerdp_rdpsnd_client_subsystem_entry oss_freerdp_rdpsnd_client_subsystem_entry #else -#define freerdp_rdpsnd_client_subsystem_entry FREERDP_API freerdp_rdpsnd_client_subsystem_entry +#define freerdp_rdpsnd_client_subsystem_entry FREERDP_API freerdp_rdpsnd_client_subsystem_entry #endif /** diff --git a/channels/rdpsnd/client/proxy/rdpsnd_proxy.c b/channels/rdpsnd/client/proxy/rdpsnd_proxy.c index 16c4edffd..9de71c96e 100644 --- a/channels/rdpsnd/client/proxy/rdpsnd_proxy.c +++ b/channels/rdpsnd/client/proxy/rdpsnd_proxy.c @@ -44,7 +44,8 @@ struct rdpsnd_proxy_plugin RdpsndServerContext* rdpsnd_server; }; -static BOOL rdpsnd_proxy_open(rdpsndDevicePlugin* device, const AUDIO_FORMAT* format, UINT32 latency) +static BOOL rdpsnd_proxy_open(rdpsndDevicePlugin* device, const AUDIO_FORMAT* format, + UINT32 latency) { rdpsndProxyPlugin* proxy = (rdpsndProxyPlugin*)device; @@ -67,7 +68,7 @@ static BOOL rdpsnd_proxy_set_volume(rdpsndDevicePlugin* device, UINT32 value) static void rdpsnd_proxy_free(rdpsndDevicePlugin* device) { - rdpsndProxyPlugin* proxy = (rdpsndProxyPlugin*) device; + rdpsndProxyPlugin* proxy = (rdpsndProxyPlugin*)device; if (!proxy) return; @@ -105,11 +106,10 @@ static void rdpsnd_proxy_start(rdpsndDevicePlugin* device) * @return 0 on success, otherwise a Win32 error code */ - #ifdef BUILTIN_CHANNELS -#define freerdp_rdpsnd_client_subsystem_entry proxy_freerdp_rdpsnd_client_subsystem_entry +#define freerdp_rdpsnd_client_subsystem_entry proxy_freerdp_rdpsnd_client_subsystem_entry #else -#define freerdp_rdpsnd_client_subsystem_entry FREERDP_API freerdp_rdpsnd_client_subsystem_entry +#define freerdp_rdpsnd_client_subsystem_entry FREERDP_API freerdp_rdpsnd_client_subsystem_entry #endif /** @@ -122,7 +122,7 @@ UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS p ADDIN_ARGV* args; rdpsndProxyPlugin* proxy; pClientContext* pc; - proxy = (rdpsndProxyPlugin*) calloc(1, sizeof(rdpsndProxyPlugin)); + proxy = (rdpsndProxyPlugin*)calloc(1, sizeof(rdpsndProxyPlugin)); if (!proxy) return CHANNEL_RC_NO_MEMORY; @@ -137,7 +137,7 @@ UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS p args = pEntryPoints->args; pEntryPoints->pRegisterRdpsndDevice(pEntryPoints->rdpsnd, &proxy->device); - pc = (pClientContext*) freerdp_rdpsnd_get_context(pEntryPoints->rdpsnd); + pc = (pClientContext*)freerdp_rdpsnd_get_context(pEntryPoints->rdpsnd); if (pc == NULL) { free(proxy); diff --git a/channels/rdpsnd/client/pulse/rdpsnd_pulse.c b/channels/rdpsnd/client/pulse/rdpsnd_pulse.c index b3e88c037..0ea359fdf 100644 --- a/channels/rdpsnd/client/pulse/rdpsnd_pulse.c +++ b/channels/rdpsnd/client/pulse/rdpsnd_pulse.c @@ -59,9 +59,11 @@ static void rdpsnd_pulse_get_sink_info(pa_context* c, const pa_sink_info* i, int void* userdata) { uint8_t x; - UINT16 dwVolumeLeft = ((50 * 0xFFFF) / 100); /* 50% */; - UINT16 dwVolumeRight = ((50 * 0xFFFF) / 100); /* 50% */; - rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*) userdata; + UINT16 dwVolumeLeft = ((50 * 0xFFFF) / 100); /* 50% */ + ; + UINT16 dwVolumeRight = ((50 * 0xFFFF) / 100); /* 50% */ + ; + rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*)userdata; if (!pulse || !c || !i) return; @@ -94,7 +96,7 @@ static void rdpsnd_pulse_get_sink_info(pa_context* c, const pa_sink_info* i, int static void rdpsnd_pulse_context_state_callback(pa_context* context, void* userdata) { pa_context_state_t state; - rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*) userdata; + rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*)userdata; state = pa_context_get_state(context); switch (state) @@ -117,7 +119,7 @@ static BOOL rdpsnd_pulse_connect(rdpsndDevicePlugin* device) { pa_operation* o; pa_context_state_t state; - rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*) device; + rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*)device; if (!pulse->context) return FALSE; @@ -170,7 +172,7 @@ static BOOL rdpsnd_pulse_connect(rdpsndDevicePlugin* device) static void rdpsnd_pulse_stream_success_callback(pa_stream* stream, int success, void* userdata) { - rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*) userdata; + rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*)userdata; pa_threaded_mainloop_signal(pulse->mainloop, 0); } @@ -190,7 +192,7 @@ static void rdpsnd_pulse_wait_for_operation(rdpsndPulsePlugin* pulse, pa_operati static void rdpsnd_pulse_stream_state_callback(pa_stream* stream, void* userdata) { pa_stream_state_t state; - rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*) userdata; + rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*)userdata; state = pa_stream_get_state(stream); switch (state) @@ -211,20 +213,20 @@ static void rdpsnd_pulse_stream_state_callback(pa_stream* stream, void* userdata static void rdpsnd_pulse_stream_request_callback(pa_stream* stream, size_t length, void* userdata) { - rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*) userdata; + rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*)userdata; pa_threaded_mainloop_signal(pulse->mainloop, 0); } static void rdpsnd_pulse_close(rdpsndDevicePlugin* device) { - rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*) device; + rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*)device; if (!pulse->context || !pulse->stream) return; pa_threaded_mainloop_lock(pulse->mainloop); - rdpsnd_pulse_wait_for_operation(pulse, pa_stream_drain(pulse->stream, - rdpsnd_pulse_stream_success_callback, pulse)); + rdpsnd_pulse_wait_for_operation( + pulse, pa_stream_drain(pulse->stream, rdpsnd_pulse_stream_success_callback, pulse)); pa_stream_disconnect(pulse->stream); pa_stream_unref(pulse->stream); pulse->stream = NULL; @@ -286,7 +288,7 @@ static BOOL rdpsnd_pulse_open(rdpsndDevicePlugin* device, const AUDIO_FORMAT* fo pa_stream_flags_t flags; pa_buffer_attr buffer_attr = { 0 }; char ss[PA_SAMPLE_SPEC_SNPRINT_MAX]; - rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*) device; + rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*)device; if (!pulse->context || pulse->stream) return TRUE; @@ -320,14 +322,14 @@ static BOOL rdpsnd_pulse_open(rdpsndDevicePlugin* device, const AUDIO_FORMAT* fo { buffer_attr.maxlength = pa_usec_to_bytes(pulse->latency * 2 * 1000, &pulse->sample_spec); buffer_attr.tlength = pa_usec_to_bytes(pulse->latency * 1000, &pulse->sample_spec); - buffer_attr.prebuf = (UINT32) - 1; - buffer_attr.minreq = (UINT32) - 1; - buffer_attr.fragsize = (UINT32) - 1; + buffer_attr.prebuf = (UINT32)-1; + buffer_attr.minreq = (UINT32)-1; + buffer_attr.fragsize = (UINT32)-1; flags |= PA_STREAM_ADJUST_LATENCY; } - if (pa_stream_connect_playback(pulse->stream, - pulse->device_name, pulse->latency > 0 ? &buffer_attr : NULL, flags, NULL, NULL) < 0) + if (pa_stream_connect_playback(pulse->stream, pulse->device_name, + pulse->latency > 0 ? &buffer_attr : NULL, flags, NULL, NULL) < 0) { pa_threaded_mainloop_unlock(pulse->mainloop); return TRUE; @@ -359,7 +361,7 @@ static BOOL rdpsnd_pulse_open(rdpsndDevicePlugin* device, const AUDIO_FORMAT* fo static void rdpsnd_pulse_free(rdpsndDevicePlugin* device) { - rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*) device; + rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*)device; if (!pulse) return; @@ -393,8 +395,7 @@ BOOL rdpsnd_pulse_format_supported(rdpsndDevicePlugin* device, const AUDIO_FORMA switch (format->wFormatTag) { case WAVE_FORMAT_PCM: - if (format->cbSize == 0 && - (format->nSamplesPerSec <= PA_RATE_MAX) && + if (format->cbSize == 0 && (format->nSamplesPerSec <= PA_RATE_MAX) && (format->wBitsPerSample == 8 || format->wBitsPerSample == 16) && (format->nChannels >= 1 && format->nChannels <= PA_CHANNELS_MAX)) { @@ -405,8 +406,7 @@ BOOL rdpsnd_pulse_format_supported(rdpsndDevicePlugin* device, const AUDIO_FORMA case WAVE_FORMAT_ALAW: case WAVE_FORMAT_MULAW: - if (format->cbSize == 0 && - (format->nSamplesPerSec <= PA_RATE_MAX) && + if (format->cbSize == 0 && (format->nSamplesPerSec <= PA_RATE_MAX) && (format->wBitsPerSample == 8) && (format->nChannels >= 1 && format->nChannels <= PA_CHANNELS_MAX)) { @@ -422,7 +422,7 @@ BOOL rdpsnd_pulse_format_supported(rdpsndDevicePlugin* device, const AUDIO_FORMA static UINT32 rdpsnd_pulse_get_volume(rdpsndDevicePlugin* device) { pa_operation* o; - rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*) device; + rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*)device; if (!pulse) return 0; @@ -443,7 +443,7 @@ static BOOL rdpsnd_pulse_set_volume(rdpsndDevicePlugin* device, UINT32 value) pa_volume_t left; pa_volume_t right; pa_operation* operation; - rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*) device; + rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*)device; if (!pulse->context || !pulse->stream) return FALSE; @@ -456,7 +456,7 @@ static BOOL rdpsnd_pulse_set_volume(rdpsndDevicePlugin* device, UINT32 value) cv.values[1] = PA_VOLUME_MUTED + (right * (PA_VOLUME_NORM - PA_VOLUME_MUTED)) / 0xFFFF; pa_threaded_mainloop_lock(pulse->mainloop); operation = pa_context_set_sink_input_volume(pulse->context, pa_stream_get_index(pulse->stream), - &cv, NULL, NULL); + &cv, NULL, NULL); if (operation) pa_operation_unref(operation); @@ -471,7 +471,7 @@ static UINT rdpsnd_pulse_play(rdpsndDevicePlugin* device, const BYTE* data, size int status; pa_usec_t latency; int negative; - rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*) device; + rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*)device; if (!pulse->stream || !data) return 0; @@ -483,7 +483,7 @@ static UINT rdpsnd_pulse_play(rdpsndDevicePlugin* device, const BYTE* data, size while ((length = pa_stream_writable_size(pulse->stream)) == 0) pa_threaded_mainloop_wait(pulse->mainloop); - if (length == (size_t) -1) + if (length == (size_t)-1) break; if (length > size) @@ -509,7 +509,7 @@ static UINT rdpsnd_pulse_play(rdpsndDevicePlugin* device, const BYTE* data, size static void rdpsnd_pulse_start(rdpsndDevicePlugin* device) { - rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*) device; + rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*)device; if (!pulse->stream) return; @@ -529,15 +529,14 @@ static UINT rdpsnd_pulse_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV int status; DWORD flags; COMMAND_LINE_ARGUMENT_A* arg; - rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*) device; - COMMAND_LINE_ARGUMENT_A rdpsnd_pulse_args[] = - { - { "dev", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "device" }, - { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } - }; - flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; - status = CommandLineParseArgumentsA(args->argc, args->argv, - rdpsnd_pulse_args, flags, pulse, NULL, NULL); + rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*)device; + COMMAND_LINE_ARGUMENT_A rdpsnd_pulse_args[] = { { "dev", COMMAND_LINE_VALUE_REQUIRED, + "", NULL, NULL, -1, NULL, "device" }, + { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; + flags = + COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; + status = CommandLineParseArgumentsA(args->argc, args->argv, rdpsnd_pulse_args, flags, pulse, + NULL, NULL); if (status < 0) return ERROR_INVALID_DATA; @@ -549,8 +548,7 @@ static UINT rdpsnd_pulse_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "dev") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "dev") { pulse->device_name = _strdup(arg->Value); @@ -558,16 +556,15 @@ static UINT rdpsnd_pulse_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV return ERROR_OUTOFMEMORY; } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); return CHANNEL_RC_OK; } #ifdef BUILTIN_CHANNELS -#define freerdp_rdpsnd_client_subsystem_entry pulse_freerdp_rdpsnd_client_subsystem_entry +#define freerdp_rdpsnd_client_subsystem_entry pulse_freerdp_rdpsnd_client_subsystem_entry #else -#define freerdp_rdpsnd_client_subsystem_entry FREERDP_API freerdp_rdpsnd_client_subsystem_entry +#define freerdp_rdpsnd_client_subsystem_entry FREERDP_API freerdp_rdpsnd_client_subsystem_entry #endif /** @@ -580,7 +577,7 @@ UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS p ADDIN_ARGV* args; rdpsndPulsePlugin* pulse; UINT ret; - pulse = (rdpsndPulsePlugin*) calloc(1, sizeof(rdpsndPulsePlugin)); + pulse = (rdpsndPulsePlugin*)calloc(1, sizeof(rdpsndPulsePlugin)); if (!pulse) return CHANNEL_RC_NO_MEMORY; @@ -597,7 +594,7 @@ UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS p if (args->argc > 1) { - ret = rdpsnd_pulse_parse_addin_args((rdpsndDevicePlugin*) pulse, args); + ret = rdpsnd_pulse_parse_addin_args((rdpsndDevicePlugin*)pulse, args); if (ret != CHANNEL_RC_OK) { @@ -623,7 +620,7 @@ UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS p if (!rdpsnd_pulse_connect((rdpsndDevicePlugin*)pulse)) goto error; - pEntryPoints->pRegisterRdpsndDevice(pEntryPoints->rdpsnd, (rdpsndDevicePlugin*) pulse); + pEntryPoints->pRegisterRdpsndDevice(pEntryPoints->rdpsnd, (rdpsndDevicePlugin*)pulse); return CHANNEL_RC_OK; error: rdpsnd_pulse_free((rdpsndDevicePlugin*)pulse); diff --git a/channels/rdpsnd/client/rdpsnd_main.c b/channels/rdpsnd/client/rdpsnd_main.c index 5be8263ce..68ff694f5 100644 --- a/channels/rdpsnd/client/rdpsnd_main.c +++ b/channels/rdpsnd/client/rdpsnd_main.c @@ -124,12 +124,12 @@ static UINT rdpsnd_send_quality_mode_pdu(rdpsndPlugin* rdpsnd) return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT8(pdu, SNDC_QUALITYMODE); /* msgType */ - Stream_Write_UINT8(pdu, 0); /* bPad */ - Stream_Write_UINT16(pdu, 4); /* BodySize */ + Stream_Write_UINT8(pdu, SNDC_QUALITYMODE); /* msgType */ + Stream_Write_UINT8(pdu, 0); /* bPad */ + Stream_Write_UINT16(pdu, 4); /* BodySize */ Stream_Write_UINT16(pdu, rdpsnd->wQualityMode); /* wQualityMode */ - Stream_Write_UINT16(pdu, 0); /* Reserved */ - WLog_Print(rdpsnd->log, WLOG_DEBUG, "QualityMode: %"PRIu16"", rdpsnd->wQualityMode); + Stream_Write_UINT16(pdu, 0); /* Reserved */ + WLog_Print(rdpsnd->log, WLOG_DEBUG, "QualityMode: %" PRIu16 "", rdpsnd->wQualityMode); return rdpsnd_virtual_channel_write(rdpsnd, pdu); } @@ -191,17 +191,17 @@ static UINT rdpsnd_send_client_audio_formats(rdpsndPlugin* rdpsnd) return CHANNEL_RC_NO_MEMORY; } - Stream_Write_UINT8(pdu, SNDC_FORMATS); /* msgType */ - Stream_Write_UINT8(pdu, 0); /* bPad */ - Stream_Write_UINT16(pdu, length - 4); /* BodySize */ + Stream_Write_UINT8(pdu, SNDC_FORMATS); /* msgType */ + Stream_Write_UINT8(pdu, 0); /* bPad */ + Stream_Write_UINT16(pdu, length - 4); /* BodySize */ Stream_Write_UINT32(pdu, TSSNDCAPS_ALIVE | TSSNDCAPS_VOLUME); /* dwFlags */ - Stream_Write_UINT32(pdu, dwVolume); /* dwVolume */ - Stream_Write_UINT32(pdu, 0); /* dwPitch */ - Stream_Write_UINT16(pdu, 0); /* wDGramPort */ - Stream_Write_UINT16(pdu, wNumberOfFormats); /* wNumberOfFormats */ - Stream_Write_UINT8(pdu, 0); /* cLastBlockConfirmed */ - Stream_Write_UINT16(pdu, CHANNEL_VERSION_WIN_MAX); /* wVersion */ - Stream_Write_UINT8(pdu, 0); /* bPad */ + Stream_Write_UINT32(pdu, dwVolume); /* dwVolume */ + Stream_Write_UINT32(pdu, 0); /* dwPitch */ + Stream_Write_UINT16(pdu, 0); /* wDGramPort */ + Stream_Write_UINT16(pdu, wNumberOfFormats); /* wNumberOfFormats */ + Stream_Write_UINT8(pdu, 0); /* cLastBlockConfirmed */ + Stream_Write_UINT16(pdu, CHANNEL_VERSION_WIN_MAX); /* wVersion */ + Stream_Write_UINT8(pdu, 0); /* bPad */ for (index = 0; index < wNumberOfFormats; index++) { @@ -223,8 +223,7 @@ static UINT rdpsnd_send_client_audio_formats(rdpsndPlugin* rdpsnd) * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpsnd_recv_server_audio_formats_pdu(rdpsndPlugin* rdpsnd, - wStream* s) +static UINT rdpsnd_recv_server_audio_formats_pdu(rdpsndPlugin* rdpsnd, wStream* s) { UINT16 index; UINT16 wVersion; @@ -244,8 +243,8 @@ static UINT rdpsnd_recv_server_audio_formats_pdu(rdpsndPlugin* rdpsnd, Stream_Seek_UINT16(s); /* wDGramPort */ Stream_Read_UINT16(s, wNumberOfFormats); Stream_Read_UINT8(s, rdpsnd->cBlockNo); /* cLastBlockConfirmed */ - Stream_Read_UINT16(s, wVersion); /* wVersion */ - Stream_Seek_UINT8(s); /* bPad */ + Stream_Read_UINT16(s, wVersion); /* wVersion */ + Stream_Seek_UINT8(s); /* bPad */ rdpsnd->NumberOfServerFormats = wNumberOfFormats; if (Stream_GetRemainingLength(s) / 14 < wNumberOfFormats) @@ -287,8 +286,8 @@ out_fail: * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpsnd_send_training_confirm_pdu(rdpsndPlugin* rdpsnd, - UINT16 wTimeStamp, UINT16 wPackSize) +static UINT rdpsnd_send_training_confirm_pdu(rdpsndPlugin* rdpsnd, UINT16 wTimeStamp, + UINT16 wPackSize) { wStream* pdu; pdu = Stream_New(NULL, 8); @@ -300,13 +299,13 @@ static UINT rdpsnd_send_training_confirm_pdu(rdpsndPlugin* rdpsnd, } Stream_Write_UINT8(pdu, SNDC_TRAINING); /* msgType */ - Stream_Write_UINT8(pdu, 0); /* bPad */ - Stream_Write_UINT16(pdu, 4); /* BodySize */ + Stream_Write_UINT8(pdu, 0); /* bPad */ + Stream_Write_UINT16(pdu, 4); /* BodySize */ Stream_Write_UINT16(pdu, wTimeStamp); Stream_Write_UINT16(pdu, wPackSize); WLog_Print(rdpsnd->log, WLOG_DEBUG, - "Training Response: wTimeStamp: %"PRIu16" wPackSize: %"PRIu16"", - wTimeStamp, wPackSize); + "Training Response: wTimeStamp: %" PRIu16 " wPackSize: %" PRIu16 "", wTimeStamp, + wPackSize); return rdpsnd_virtual_channel_write(rdpsnd, pdu); } @@ -326,13 +325,13 @@ static UINT rdpsnd_recv_training_pdu(rdpsndPlugin* rdpsnd, wStream* s) Stream_Read_UINT16(s, wTimeStamp); Stream_Read_UINT16(s, wPackSize); WLog_Print(rdpsnd->log, WLOG_DEBUG, - "Training Request: wTimeStamp: %"PRIu16" wPackSize: %"PRIu16"", - wTimeStamp, wPackSize); + "Training Request: wTimeStamp: %" PRIu16 " wPackSize: %" PRIu16 "", wTimeStamp, + wPackSize); return rdpsnd_send_training_confirm_pdu(rdpsnd, wTimeStamp, wPackSize); } static BOOL rdpsnd_ensure_device_is_open(rdpsndPlugin* rdpsnd, UINT32 wFormatNo, - const AUDIO_FORMAT* format) + const AUDIO_FORMAT* format) { if (!rdpsnd) return FALSE; @@ -356,7 +355,8 @@ static BOOL rdpsnd_ensure_device_is_open(rdpsndPlugin* rdpsnd, UINT32 wFormatNo, WLog_Print(rdpsnd->log, WLOG_DEBUG, "Opening device with format %s [backend %s]", audio_format_get_tag_string(format->wFormatTag), audio_format_get_tag_string(deviceFormat.wFormatTag)); - rc = IFCALLRESULT(FALSE, rdpsnd->device->Open, rdpsnd->device, &deviceFormat, rdpsnd->latency); + rc = IFCALLRESULT(FALSE, rdpsnd->device->Open, rdpsnd->device, &deviceFormat, + rdpsnd->latency); if (!rc) return FALSE; @@ -379,8 +379,7 @@ static BOOL rdpsnd_ensure_device_is_open(rdpsndPlugin* rdpsnd, UINT32 wFormatNo, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpsnd_recv_wave_info_pdu(rdpsndPlugin* rdpsnd, wStream* s, - UINT16 BodySize) +static UINT rdpsnd_recv_wave_info_pdu(rdpsndPlugin* rdpsnd, wStream* s, UINT16 BodySize) { UINT16 wFormatNo; const AUDIO_FORMAT* format; @@ -400,8 +399,9 @@ static UINT rdpsnd_recv_wave_info_pdu(rdpsndPlugin* rdpsnd, wStream* s, Stream_Read(s, rdpsnd->waveData, 4); rdpsnd->waveDataSize = BodySize - 8; format = &rdpsnd->ClientFormats[wFormatNo]; - WLog_Print(rdpsnd->log, WLOG_DEBUG, "WaveInfo: cBlockNo: %"PRIu8" wFormatNo: %"PRIu16" [%s]", - rdpsnd->cBlockNo, wFormatNo, audio_format_get_tag_string(format->wFormatTag)); + WLog_Print(rdpsnd->log, WLOG_DEBUG, + "WaveInfo: cBlockNo: %" PRIu8 " wFormatNo: %" PRIu16 " [%s]", rdpsnd->cBlockNo, + wFormatNo, audio_format_get_tag_string(format->wFormatTag)); if (!rdpsnd_ensure_device_is_open(rdpsnd, wFormatNo, format)) return ERROR_INTERNAL_ERROR; @@ -415,8 +415,8 @@ static UINT rdpsnd_recv_wave_info_pdu(rdpsndPlugin* rdpsnd, wStream* s, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpsnd_send_wave_confirm_pdu(rdpsndPlugin* rdpsnd, - UINT16 wTimeStamp, BYTE cConfirmedBlockNo) +static UINT rdpsnd_send_wave_confirm_pdu(rdpsndPlugin* rdpsnd, UINT16 wTimeStamp, + BYTE cConfirmedBlockNo) { wStream* pdu; pdu = Stream_New(NULL, 8); @@ -432,7 +432,7 @@ static UINT rdpsnd_send_wave_confirm_pdu(rdpsndPlugin* rdpsnd, Stream_Write_UINT16(pdu, 4); Stream_Write_UINT16(pdu, wTimeStamp); Stream_Write_UINT8(pdu, cConfirmedBlockNo); /* cConfirmedBlockNo */ - Stream_Write_UINT8(pdu, 0); /* bPad */ + Stream_Write_UINT8(pdu, 0); /* bPad */ return rdpsnd_virtual_channel_write(rdpsnd, pdu); } @@ -444,13 +444,13 @@ static UINT rdpsnd_treat_wave(rdpsndPlugin* rdpsnd, wStream* s, size_t size) UINT64 diffMS, ts; UINT latency = 0; - if (Stream_GetRemainingLength(s) < size) return ERROR_BAD_LENGTH; data = Stream_Pointer(s); format = &rdpsnd->ClientFormats[rdpsnd->wCurrentFormatNo]; - WLog_Print(rdpsnd->log, WLOG_DEBUG, "Wave: cBlockNo: %"PRIu8" wTimeStamp: %"PRIu16", size: %"PRIdz, + WLog_Print(rdpsnd->log, WLOG_DEBUG, + "Wave: cBlockNo: %" PRIu8 " wTimeStamp: %" PRIu16 ", size: %" PRIdz, rdpsnd->cBlockNo, rdpsnd->wTimeStamp, size); if (rdpsnd->device && rdpsnd->attached) @@ -483,7 +483,6 @@ static UINT rdpsnd_treat_wave(rdpsndPlugin* rdpsnd, wStream* s, size_t size) return rdpsnd_send_wave_confirm_pdu(rdpsnd, (UINT16)ts, rdpsnd->cBlockNo); } - /** * Function description * @@ -523,8 +522,9 @@ static UINT rdpsnd_recv_wave2_pdu(rdpsndPlugin* rdpsnd, wStream* s, UINT16 BodyS rdpsnd->waveDataSize = BodySize - 12; format = &rdpsnd->ClientFormats[wFormatNo]; rdpsnd->wArrivalTime = GetTickCount64(); - WLog_Print(rdpsnd->log, WLOG_DEBUG, "Wave2PDU: cBlockNo: %"PRIu8" wFormatNo: %"PRIu16", align=%hu", - rdpsnd->cBlockNo, wFormatNo, format->nBlockAlign); + WLog_Print(rdpsnd->log, WLOG_DEBUG, + "Wave2PDU: cBlockNo: %" PRIu8 " wFormatNo: %" PRIu16 ", align=%hu", rdpsnd->cBlockNo, + wFormatNo, format->nBlockAlign); if (!rdpsnd_ensure_device_is_open(rdpsnd, wFormatNo, format)) return ERROR_INTERNAL_ERROR; @@ -536,7 +536,7 @@ static void rdpsnd_recv_close_pdu(rdpsndPlugin* rdpsnd) { if (rdpsnd->isOpen) { - WLog_Print(rdpsnd->log, WLOG_DEBUG, "Closing device"); + WLog_Print(rdpsnd->log, WLOG_DEBUG, "Closing device"); } else WLog_Print(rdpsnd->log, WLOG_DEBUG, "Device already closed"); @@ -556,7 +556,7 @@ static UINT rdpsnd_recv_volume_pdu(rdpsndPlugin* rdpsnd, wStream* s) return ERROR_BAD_LENGTH; Stream_Read_UINT32(s, dwVolume); - WLog_Print(rdpsnd->log, WLOG_DEBUG, "Volume: 0x%08"PRIX32"", dwVolume); + WLog_Print(rdpsnd->log, WLOG_DEBUG, "Volume: 0x%08" PRIX32 "", dwVolume); rc = IFCALLRESULT(FALSE, rdpsnd->device->SetVolume, rdpsnd->device, dwVolume); if (!rc) @@ -592,7 +592,7 @@ static UINT rdpsnd_recv_pdu(rdpsndPlugin* rdpsnd, wStream* s) } Stream_Read_UINT8(s, msgType); /* msgType */ - Stream_Seek_UINT8(s); /* bPad */ + Stream_Seek_UINT8(s); /* bPad */ Stream_Read_UINT16(s, BodySize); switch (msgType) @@ -622,7 +622,7 @@ static UINT rdpsnd_recv_pdu(rdpsndPlugin* rdpsnd, wStream* s) break; default: - WLog_ERR(TAG, "unknown msgType %"PRIu8"", msgType); + WLog_ERR(TAG, "unknown msgType %" PRIu8 "", msgType); break; } @@ -631,8 +631,7 @@ out: return status; } -static void rdpsnd_register_device_plugin(rdpsndPlugin* rdpsnd, - rdpsndDevicePlugin* device) +static void rdpsnd_register_device_plugin(rdpsndPlugin* rdpsnd, rdpsndDevicePlugin* device) { if (rdpsnd->device) { @@ -649,14 +648,13 @@ static void rdpsnd_register_device_plugin(rdpsndPlugin* rdpsnd, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpsnd_load_device_plugin(rdpsndPlugin* rdpsnd, const char* name, - ADDIN_ARGV* args) +static UINT rdpsnd_load_device_plugin(rdpsndPlugin* rdpsnd, const char* name, ADDIN_ARGV* args) { PFREERDP_RDPSND_DEVICE_ENTRY entry; FREERDP_RDPSND_DEVICE_ENTRY_POINTS entryPoints; UINT error; - entry = (PFREERDP_RDPSND_DEVICE_ENTRY) - freerdp_load_channel_addin_entry("rdpsnd", (LPSTR) name, NULL, 0); + entry = (PFREERDP_RDPSND_DEVICE_ENTRY)freerdp_load_channel_addin_entry("rdpsnd", (LPSTR)name, + NULL, 0); if (!entry) return ERROR_INTERNAL_ERROR; @@ -666,7 +664,7 @@ static UINT rdpsnd_load_device_plugin(rdpsndPlugin* rdpsnd, const char* name, entryPoints.args = args; if ((error = entry(&entryPoints))) - WLog_ERR(TAG, "%s entry returns error %"PRIu32"", name, error); + WLog_ERR(TAG, "%s entry returns error %" PRIu32 "", name, error); WLog_INFO(TAG, "Loaded %s backend for rdpsnd", name); return error; @@ -696,24 +694,24 @@ static UINT rdpsnd_process_addin_args(rdpsndPlugin* rdpsnd, ADDIN_ARGV* args) int status; DWORD flags; COMMAND_LINE_ARGUMENT_A* arg; - COMMAND_LINE_ARGUMENT_A rdpsnd_args[] = - { - { "sys", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "subsystem" }, - { "dev", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "device" }, - { "format", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "format" }, - { "rate", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "rate" }, - { "channel", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "channel" }, - { "latency", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "latency" }, - { "quality", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "quality mode" }, - { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } - }; + COMMAND_LINE_ARGUMENT_A rdpsnd_args[] = { + { "sys", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "subsystem" }, + { "dev", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "device" }, + { "format", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "format" }, + { "rate", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "rate" }, + { "channel", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "channel" }, + { "latency", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "latency" }, + { "quality", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "quality mode" }, + { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } + }; rdpsnd->wQualityMode = HIGH_QUALITY; /* default quality mode */ if (args->argc > 1) { flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON; - status = CommandLineParseArgumentsA(args->argc, args->argv, - rdpsnd_args, flags, rdpsnd, NULL, NULL); + status = CommandLineParseArgumentsA(args->argc, args->argv, rdpsnd_args, flags, rdpsnd, + NULL, NULL); if (status < 0) return CHANNEL_RC_INITIALIZATION_ERROR; @@ -726,8 +724,7 @@ static UINT rdpsnd_process_addin_args(rdpsndPlugin* rdpsnd, ADDIN_ARGV* args) if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "sys") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "sys") { if (!rdpsnd_set_subsystem(rdpsnd, arg->Value)) return CHANNEL_RC_NO_MEMORY; @@ -794,14 +791,13 @@ static UINT rdpsnd_process_addin_args(rdpsndPlugin* rdpsnd, ADDIN_ARGV* args) if ((wQualityMode < 0) || (wQualityMode > 2)) wQualityMode = DYNAMIC_QUALITY; - rdpsnd->wQualityMode = (UINT16) wQualityMode; + rdpsnd->wQualityMode = (UINT16)wQualityMode; } CommandLineSwitchDefault(arg) { } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); } return CHANNEL_RC_OK; @@ -818,36 +814,34 @@ static UINT rdpsnd_process_connect(rdpsndPlugin* rdpsnd) { const char* subsystem; const char* device; - } - backends[] = - { + } backends[] = { #if defined(WITH_IOSAUDIO) - {"ios", ""}, + { "ios", "" }, #endif #if defined(WITH_OPENSLES) - {"opensles", ""}, + { "opensles", "" }, #endif #if defined(WITH_PULSE) - {"pulse", ""}, + { "pulse", "" }, #endif #if defined(WITH_ALSA) - {"alsa", "default"}, + { "alsa", "default" }, #endif #if defined(WITH_OSS) - {"oss", ""}, + { "oss", "" }, #endif #if defined(WITH_MACAUDIO) - {"mac", "default"}, + { "mac", "default" }, #endif #if defined(WITH_WINMM) - { "winmm", ""}, + { "winmm", "" }, #endif { "fake", "" } }; ADDIN_ARGV* args; UINT status = ERROR_INTERNAL_ERROR; rdpsnd->latency = 0; - args = (ADDIN_ARGV*) rdpsnd->channelEntryPoints.pExtendedData; + args = (ADDIN_ARGV*)rdpsnd->channelEntryPoints.pExtendedData; if (args) { @@ -861,7 +855,7 @@ static UINT rdpsnd_process_connect(rdpsndPlugin* rdpsnd) { if ((status = rdpsnd_load_device_plugin(rdpsnd, rdpsnd->subsystem, args))) { - WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %"PRIu32"", + WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %" PRIu32 "", rdpsnd->subsystem, status); return status; } @@ -876,7 +870,7 @@ static UINT rdpsnd_process_connect(rdpsndPlugin* rdpsnd) const char* device_name = backends[x].device; if ((status = rdpsnd_load_device_plugin(rdpsnd, subsystem_name, args))) - WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %"PRIu32"", + WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %" PRIu32 "", subsystem_name, status); if (!rdpsnd->device) @@ -898,7 +892,7 @@ static UINT rdpsnd_process_connect(rdpsndPlugin* rdpsnd) static void rdpsnd_process_disconnect(rdpsndPlugin* rdpsnd) { - IFCALL(rdpsnd->device->Close, rdpsnd->device); + IFCALL(rdpsnd->device->Close, rdpsnd->device); } /** @@ -912,14 +906,15 @@ UINT rdpsnd_virtual_channel_write(rdpsndPlugin* rdpsnd, wStream* s) if (rdpsnd) { - status = rdpsnd->channelEntryPoints.pVirtualChannelWriteEx(rdpsnd->InitHandle, rdpsnd->OpenHandle, - Stream_Buffer(s), (UINT32) Stream_GetPosition(s), s); + status = rdpsnd->channelEntryPoints.pVirtualChannelWriteEx( + rdpsnd->InitHandle, rdpsnd->OpenHandle, Stream_Buffer(s), (UINT32)Stream_GetPosition(s), + s); } if (status != CHANNEL_RC_OK) { Stream_Free(s, TRUE); - WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08"PRIX32"]", + WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08" PRIX32 "]", WTSErrorToString(status), status); } @@ -931,8 +926,9 @@ UINT rdpsnd_virtual_channel_write(rdpsndPlugin* rdpsnd, wStream* s) * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpsnd_virtual_channel_event_data_received(rdpsndPlugin* plugin, - void* pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) +static UINT rdpsnd_virtual_channel_event_data_received(rdpsndPlugin* plugin, void* pData, + UINT32 dataLength, UINT32 totalLength, + UINT32 dataFlags) { if ((dataFlags & CHANNEL_FLAG_SUSPEND) || (dataFlags & CHANNEL_FLAG_RESUME)) return CHANNEL_RC_OK; @@ -957,7 +953,7 @@ static UINT rdpsnd_virtual_channel_event_data_received(rdpsndPlugin* plugin, if (!Queue_Enqueue(plugin->queue, plugin->data_in)) { - WLog_ERR(TAG, "Queue_Enqueue failed!"); + WLog_ERR(TAG, "Queue_Enqueue failed!"); return ERROR_INTERNAL_ERROR; } @@ -968,25 +964,27 @@ static UINT rdpsnd_virtual_channel_event_data_received(rdpsndPlugin* plugin, } static VOID VCAPITYPE rdpsnd_virtual_channel_open_event_ex(LPVOID lpUserParam, DWORD openHandle, - UINT event, - LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) + UINT event, LPVOID pData, + UINT32 dataLength, UINT32 totalLength, + UINT32 dataFlags) { UINT error = CHANNEL_RC_OK; - rdpsndPlugin* rdpsnd = (rdpsndPlugin*) lpUserParam; + rdpsndPlugin* rdpsnd = (rdpsndPlugin*)lpUserParam; if (!rdpsnd || (rdpsnd->OpenHandle != openHandle)) { - WLog_ERR(TAG, "error no match"); + WLog_ERR(TAG, "error no match"); return; } switch (event) { case CHANNEL_EVENT_DATA_RECEIVED: - if ((error = rdpsnd_virtual_channel_event_data_received(rdpsnd, pData, - dataLength, totalLength, dataFlags))) + if ((error = rdpsnd_virtual_channel_event_data_received(rdpsnd, pData, dataLength, + totalLength, dataFlags))) WLog_ERR(TAG, - "rdpsnd_virtual_channel_event_data_received failed with error %"PRIu32"", error); + "rdpsnd_virtual_channel_event_data_received failed with error %" PRIu32 "", + error); break; @@ -996,7 +994,7 @@ static VOID VCAPITYPE rdpsnd_virtual_channel_open_event_ex(LPVOID lpUserParam, D wStream* s = (wStream*)pData; Stream_Free(s, TRUE); } - break; + break; case CHANNEL_EVENT_USER: break; @@ -1010,7 +1008,7 @@ static VOID VCAPITYPE rdpsnd_virtual_channel_open_event_ex(LPVOID lpUserParam, D static DWORD WINAPI rdpsnd_virtual_channel_client_thread(LPVOID arg) { BOOL running = TRUE; - rdpsndPlugin* rdpsnd = (rdpsndPlugin*) arg; + rdpsndPlugin* rdpsnd = (rdpsndPlugin*)arg; DWORD error = CHANNEL_RC_OK; HANDLE events[2]; @@ -1030,11 +1028,11 @@ static DWORD WINAPI rdpsnd_virtual_channel_client_thread(LPVOID arg) switch (status) { case WAIT_OBJECT_0: - { - wStream* s = Queue_Dequeue(rdpsnd->queue); - error = rdpsnd_recv_pdu(rdpsnd, s); - } - break; + { + wStream* s = Queue_Dequeue(rdpsnd->queue); + error = rdpsnd_recv_pdu(rdpsnd, s); + } + break; case WAIT_OBJECT_0 + 1: running = FALSE; @@ -1044,8 +1042,7 @@ static DWORD WINAPI rdpsnd_virtual_channel_client_thread(LPVOID arg) error = status; break; } - } - while ((error == CHANNEL_RC_OK) && running); + } while ((error == CHANNEL_RC_OK) && running); out: @@ -1067,10 +1064,10 @@ static void rdpsnd_queue_free(void* data) Stream_Free(s, TRUE); } -static UINT rdpsnd_virtual_channel_event_initialized(rdpsndPlugin* rdpsnd, - LPVOID pData, UINT32 dataLength) +static UINT rdpsnd_virtual_channel_event_initialized(rdpsndPlugin* rdpsnd, LPVOID pData, + UINT32 dataLength) { - rdpsnd->stopEvent = CreateEventA(NULL, TRUE, FALSE, NULL); + rdpsnd->stopEvent = CreateEventA(NULL, TRUE, FALSE, NULL); if (!rdpsnd->stopEvent) goto fail; @@ -1085,17 +1082,17 @@ fail: * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpsnd_virtual_channel_event_connected(rdpsndPlugin* rdpsnd, - LPVOID pData, UINT32 dataLength) +static UINT rdpsnd_virtual_channel_event_connected(rdpsndPlugin* rdpsnd, LPVOID pData, + UINT32 dataLength) { UINT32 status; - status = rdpsnd->channelEntryPoints.pVirtualChannelOpenEx(rdpsnd->InitHandle, - &rdpsnd->OpenHandle, rdpsnd->channelDef.name, - rdpsnd_virtual_channel_open_event_ex); + status = rdpsnd->channelEntryPoints.pVirtualChannelOpenEx( + rdpsnd->InitHandle, &rdpsnd->OpenHandle, rdpsnd->channelDef.name, + rdpsnd_virtual_channel_open_event_ex); if (status != CHANNEL_RC_OK) { - WLog_ERR(TAG, "pVirtualChannelOpenEx failed with %s [%08"PRIX32"]", + WLog_ERR(TAG, "pVirtualChannelOpenEx failed with %s [%08" PRIX32 "]", WTSErrorToString(status), status); return status; } @@ -1117,9 +1114,8 @@ static UINT rdpsnd_virtual_channel_event_connected(rdpsndPlugin* rdpsnd, goto fail; ResetEvent(rdpsnd->stopEvent); - rdpsnd->thread = CreateThread(NULL, 0, - rdpsnd_virtual_channel_client_thread, (void*) rdpsnd, - 0, NULL); + rdpsnd->thread = + CreateThread(NULL, 0, rdpsnd_virtual_channel_client_thread, (void*)rdpsnd, 0, NULL); if (!rdpsnd->thread) goto fail; @@ -1156,16 +1152,17 @@ static UINT rdpsnd_virtual_channel_event_disconnected(rdpsndPlugin* rdpsnd) if (WaitForSingleObject(rdpsnd->thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); return error; } CloseHandle(rdpsnd->thread); - error = rdpsnd->channelEntryPoints.pVirtualChannelCloseEx(rdpsnd->InitHandle, rdpsnd->OpenHandle); + error = + rdpsnd->channelEntryPoints.pVirtualChannelCloseEx(rdpsnd->InitHandle, rdpsnd->OpenHandle); if (CHANNEL_RC_OK != error) { - WLog_ERR(TAG, "pVirtualChannelCloseEx failed with %s [%08"PRIX32"]", + WLog_ERR(TAG, "pVirtualChannelCloseEx failed with %s [%08" PRIX32 "]", WTSErrorToString(error), error); return error; } @@ -1206,14 +1203,15 @@ static void rdpsnd_virtual_channel_event_terminated(rdpsndPlugin* rdpsnd) } static VOID VCAPITYPE rdpsnd_virtual_channel_init_event_ex(LPVOID lpUserParam, LPVOID pInitHandle, - UINT event, LPVOID pData, UINT dataLength) + UINT event, LPVOID pData, + UINT dataLength) { UINT error = CHANNEL_RC_OK; - rdpsndPlugin* plugin = (rdpsndPlugin*) lpUserParam; + rdpsndPlugin* plugin = (rdpsndPlugin*)lpUserParam; if (!plugin || (plugin->InitHandle != pInitHandle)) { - WLog_ERR(TAG, "error no match"); + WLog_ERR(TAG, "error no match"); return; } @@ -1221,14 +1219,16 @@ static VOID VCAPITYPE rdpsnd_virtual_channel_init_event_ex(LPVOID lpUserParam, L { case CHANNEL_EVENT_INITIALIZED: if ((error = rdpsnd_virtual_channel_event_initialized(plugin, pData, dataLength))) - WLog_ERR(TAG, "rdpsnd_virtual_channel_event_initialized failed with error %"PRIu32"!", + WLog_ERR(TAG, + "rdpsnd_virtual_channel_event_initialized failed with error %" PRIu32 "!", error); break; case CHANNEL_EVENT_CONNECTED: if ((error = rdpsnd_virtual_channel_event_connected(plugin, pData, dataLength))) - WLog_ERR(TAG, "rdpsnd_virtual_channel_event_connected failed with error %"PRIu32"!", + WLog_ERR(TAG, + "rdpsnd_virtual_channel_event_connected failed with error %" PRIu32 "!", error); break; @@ -1236,7 +1236,8 @@ static VOID VCAPITYPE rdpsnd_virtual_channel_init_event_ex(LPVOID lpUserParam, L case CHANNEL_EVENT_DISCONNECTED: if ((error = rdpsnd_virtual_channel_event_disconnected(plugin))) WLog_ERR(TAG, - "rdpsnd_virtual_channel_event_disconnected failed with error %"PRIu32"!", error); + "rdpsnd_virtual_channel_event_disconnected failed with error %" PRIu32 "!", + error); break; @@ -1270,7 +1271,7 @@ rdpContext* freerdp_rdpsnd_get_context(rdpsndPlugin* plugin) } /* rdpsnd is always built-in */ -#define VirtualChannelEntryEx rdpsnd_VirtualChannelEntryEx +#define VirtualChannelEntryEx rdpsnd_VirtualChannelEntryEx BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID pInitHandle) { @@ -1281,17 +1282,15 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p if (!pEntryPoints) return FALSE; - rdpsnd = (rdpsndPlugin*) calloc(1, sizeof(rdpsndPlugin)); + rdpsnd = (rdpsndPlugin*)calloc(1, sizeof(rdpsndPlugin)); if (!rdpsnd) return FALSE; rdpsnd->attached = TRUE; - rdpsnd->channelDef.options = - CHANNEL_OPTION_INITIALIZED | - CHANNEL_OPTION_ENCRYPT_RDP; + rdpsnd->channelDef.options = CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP; sprintf_s(rdpsnd->channelDef.name, ARRAYSIZE(rdpsnd->channelDef.name), "rdpsnd"); - pEntryPointsEx = (CHANNEL_ENTRY_POINTS_FREERDP_EX*) pEntryPoints; + pEntryPointsEx = (CHANNEL_ENTRY_POINTS_FREERDP_EX*)pEntryPoints; if ((pEntryPointsEx->cbSize >= sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX)) && (pEntryPointsEx->MagicNumber == FREERDP_CHANNEL_MAGIC_NUMBER)) @@ -1311,14 +1310,14 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p CopyMemory(&(rdpsnd->channelEntryPoints), pEntryPoints, sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX)); rdpsnd->InitHandle = pInitHandle; - rc = rdpsnd->channelEntryPoints.pVirtualChannelInitEx(rdpsnd, NULL, pInitHandle, - &rdpsnd->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000, - rdpsnd_virtual_channel_init_event_ex); + rc = rdpsnd->channelEntryPoints.pVirtualChannelInitEx( + rdpsnd, NULL, pInitHandle, &rdpsnd->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000, + rdpsnd_virtual_channel_init_event_ex); if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "pVirtualChannelInitEx failed with %s [%08"PRIX32"]", - WTSErrorToString(rc), rc); + WLog_ERR(TAG, "pVirtualChannelInitEx failed with %s [%08" PRIX32 "]", WTSErrorToString(rc), + rc); free(rdpsnd); return FALSE; } diff --git a/channels/rdpsnd/client/rdpsnd_main.h b/channels/rdpsnd/client/rdpsnd_main.h index 3202f26e4..b3b478ff7 100644 --- a/channels/rdpsnd/client/rdpsnd_main.h +++ b/channels/rdpsnd/client/rdpsnd_main.h @@ -34,7 +34,10 @@ FREERDP_API rdpContext* freerdp_rdpsnd_get_context(rdpsndPlugin* rdpsnd); #if defined(WITH_DEBUG_SND) #define DEBUG_SND(...) WLog_DBG(TAG, __VA_ARGS__) #else -#define DEBUG_SND(...) do { } while (0) +#define DEBUG_SND(...) \ + do \ + { \ + } while (0) #endif #endif /* FREERDP_CHANNEL_RDPSND_CLIENT_MAIN_H */ diff --git a/channels/rdpsnd/client/winmm/rdpsnd_winmm.c b/channels/rdpsnd/client/winmm/rdpsnd_winmm.c index 5d96970b2..386a7f3a6 100644 --- a/channels/rdpsnd/client/winmm/rdpsnd_winmm.c +++ b/channels/rdpsnd/client/winmm/rdpsnd_winmm.c @@ -85,7 +85,7 @@ static BOOL rdpsnd_winmm_convert_format(const AUDIO_FORMAT* in, WAVEFORMATEX* ou static BOOL rdpsnd_winmm_set_format(rdpsndDevicePlugin* device, const AUDIO_FORMAT* format, UINT32 latency) { - rdpsndWinmmPlugin* winmm = (rdpsndWinmmPlugin*) device; + rdpsndWinmmPlugin* winmm = (rdpsndWinmmPlugin*)device; winmm->latency = latency; if (!rdpsnd_winmm_convert_format(format, &winmm->format)) @@ -94,29 +94,24 @@ static BOOL rdpsnd_winmm_set_format(rdpsndDevicePlugin* device, const AUDIO_FORM return TRUE; } -static void CALLBACK waveOutProc( - HWAVEOUT hwo, - UINT uMsg, - DWORD_PTR dwInstance, - DWORD_PTR dwParam1, - DWORD_PTR dwParam2 - ) +static void CALLBACK waveOutProc(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, + DWORD_PTR dwParam2) { - rdpsndWinmmPlugin* winmm = (rdpsndWinmmPlugin*) dwInstance; + rdpsndWinmmPlugin* winmm = (rdpsndWinmmPlugin*)dwInstance; LPWAVEHDR lpWaveHdr = (LPWAVEHDR)dwParam1; - switch(uMsg) + switch (uMsg) { - case WOM_OPEN: - case WOM_CLOSE: - break; - case WOM_DONE: - waveOutUnprepareHeader(hwo, lpWaveHdr, sizeof(WAVEHDR)); - free(lpWaveHdr); - ReleaseSemaphore(winmm->semaphore, 1, NULL); - break; - default: - break; + case WOM_OPEN: + case WOM_CLOSE: + break; + case WOM_DONE: + waveOutUnprepareHeader(hwo, lpWaveHdr, sizeof(WAVEHDR)); + free(lpWaveHdr); + ReleaseSemaphore(winmm->semaphore, 1, NULL); + break; + default: + break; } } @@ -124,7 +119,7 @@ static BOOL rdpsnd_winmm_open(rdpsndDevicePlugin* device, const AUDIO_FORMAT* fo UINT32 latency) { MMRESULT mmResult; - rdpsndWinmmPlugin* winmm = (rdpsndWinmmPlugin*) device; + rdpsndWinmmPlugin* winmm = (rdpsndWinmmPlugin*)device; if (winmm->hWaveOut) return TRUE; @@ -132,13 +127,12 @@ static BOOL rdpsnd_winmm_open(rdpsndDevicePlugin* device, const AUDIO_FORMAT* fo if (!rdpsnd_winmm_set_format(device, format, latency)) return FALSE; - mmResult = waveOutOpen(&winmm->hWaveOut, WAVE_MAPPER, &winmm->format, - (DWORD_PTR) waveOutProc, (DWORD_PTR)winmm, - CALLBACK_FUNCTION); + mmResult = waveOutOpen(&winmm->hWaveOut, WAVE_MAPPER, &winmm->format, (DWORD_PTR)waveOutProc, + (DWORD_PTR)winmm, CALLBACK_FUNCTION); if (mmResult != MMSYSERR_NOERROR) { - WLog_Print(winmm->log, WLOG_ERROR, "waveOutOpen failed: %"PRIu32"", mmResult); + WLog_Print(winmm->log, WLOG_ERROR, "waveOutOpen failed: %" PRIu32 "", mmResult); return FALSE; } @@ -148,7 +142,7 @@ static BOOL rdpsnd_winmm_open(rdpsndDevicePlugin* device, const AUDIO_FORMAT* fo if (mmResult != MMSYSERR_NOERROR) { - WLog_Print(winmm->log, WLOG_ERROR, "waveOutSetVolume failed: %"PRIu32"", mmResult); + WLog_Print(winmm->log, WLOG_ERROR, "waveOutSetVolume failed: %" PRIu32 "", mmResult); return FALSE; } @@ -159,15 +153,15 @@ static void rdpsnd_winmm_close(rdpsndDevicePlugin* device) { size_t x; MMRESULT mmResult; - rdpsndWinmmPlugin* winmm = (rdpsndWinmmPlugin*) device; + rdpsndWinmmPlugin* winmm = (rdpsndWinmmPlugin*)device; if (winmm->hWaveOut) { - for (x=0; xsemaphore, INFINITE); mmResult = waveOutClose(winmm->hWaveOut); if (mmResult != MMSYSERR_NOERROR) - WLog_Print(winmm->log, WLOG_ERROR, "waveOutClose failure: %"PRIu32"", mmResult); + WLog_Print(winmm->log, WLOG_ERROR, "waveOutClose failure: %" PRIu32 "", mmResult); winmm->hWaveOut = NULL; } @@ -175,7 +169,7 @@ static void rdpsnd_winmm_close(rdpsndDevicePlugin* device) static void rdpsnd_winmm_free(rdpsndDevicePlugin* device) { - rdpsndWinmmPlugin* winmm = (rdpsndWinmmPlugin*) device; + rdpsndWinmmPlugin* winmm = (rdpsndWinmmPlugin*)device; if (winmm) { @@ -206,7 +200,7 @@ static UINT32 rdpsnd_winmm_get_volume(rdpsndDevicePlugin* device) { MMRESULT mmResult; DWORD dwVolume = UINT32_MAX; - rdpsndWinmmPlugin* winmm = (rdpsndWinmmPlugin*) device; + rdpsndWinmmPlugin* winmm = (rdpsndWinmmPlugin*)device; if (!winmm->hWaveOut) return dwVolume; @@ -214,7 +208,7 @@ static UINT32 rdpsnd_winmm_get_volume(rdpsndDevicePlugin* device) mmResult = waveOutGetVolume(winmm->hWaveOut, &dwVolume); if (mmResult != MMSYSERR_NOERROR) { - WLog_Print(winmm->log, WLOG_ERROR, "waveOutGetVolume failure: %"PRIu32"", mmResult); + WLog_Print(winmm->log, WLOG_ERROR, "waveOutGetVolume failure: %" PRIu32 "", mmResult); dwVolume = UINT32_MAX; } return dwVolume; @@ -223,7 +217,7 @@ static UINT32 rdpsnd_winmm_get_volume(rdpsndDevicePlugin* device) static BOOL rdpsnd_winmm_set_volume(rdpsndDevicePlugin* device, UINT32 value) { MMRESULT mmResult; - rdpsndWinmmPlugin* winmm = (rdpsndWinmmPlugin*) device; + rdpsndWinmmPlugin* winmm = (rdpsndWinmmPlugin*)device; winmm->volume = value; if (!winmm->hWaveOut) @@ -232,7 +226,7 @@ static BOOL rdpsnd_winmm_set_volume(rdpsndDevicePlugin* device, UINT32 value) mmResult = waveOutSetVolume(winmm->hWaveOut, value); if (mmResult != MMSYSERR_NOERROR) { - WLog_Print(winmm->log, WLOG_ERROR, "waveOutGetVolume failure: %"PRIu32"", mmResult); + WLog_Print(winmm->log, WLOG_ERROR, "waveOutGetVolume failure: %" PRIu32 "", mmResult); return FALSE; } return TRUE; @@ -240,7 +234,7 @@ static BOOL rdpsnd_winmm_set_volume(rdpsndDevicePlugin* device, UINT32 value) static void rdpsnd_winmm_start(rdpsndDevicePlugin* device) { - //rdpsndWinmmPlugin* winmm = (rdpsndWinmmPlugin*) device; + // rdpsndWinmmPlugin* winmm = (rdpsndWinmmPlugin*) device; WINPR_UNUSED(device); } @@ -248,7 +242,7 @@ static UINT rdpsnd_winmm_play(rdpsndDevicePlugin* device, const BYTE* data, size { MMRESULT mmResult; LPWAVEHDR lpWaveHdr; - rdpsndWinmmPlugin* winmm = (rdpsndWinmmPlugin*) device; + rdpsndWinmmPlugin* winmm = (rdpsndWinmmPlugin*)device; if (!winmm->hWaveOut) return 0; @@ -262,14 +256,14 @@ static UINT rdpsnd_winmm_play(rdpsndDevicePlugin* device, const BYTE* data, size lpWaveHdr->dwFlags = 0; lpWaveHdr->dwLoops = 0; - lpWaveHdr->lpData = (LPSTR) data; + lpWaveHdr->lpData = (LPSTR)data; lpWaveHdr->dwBufferLength = (DWORD)size; mmResult = waveOutPrepareHeader(winmm->hWaveOut, lpWaveHdr, sizeof(WAVEHDR)); if (mmResult != MMSYSERR_NOERROR) { - WLog_Print(winmm->log, WLOG_ERROR, "waveOutPrepareHeader failure: %"PRIu32"", mmResult); + WLog_Print(winmm->log, WLOG_ERROR, "waveOutPrepareHeader failure: %" PRIu32 "", mmResult); free(lpWaveHdr); return 0; } @@ -279,7 +273,7 @@ static UINT rdpsnd_winmm_play(rdpsndDevicePlugin* device, const BYTE* data, size if (mmResult != MMSYSERR_NOERROR) { - WLog_Print(winmm->log, WLOG_ERROR, "waveOutWrite failure: %"PRIu32"", mmResult); + WLog_Print(winmm->log, WLOG_ERROR, "waveOutWrite failure: %" PRIu32 "", mmResult); waveOutUnprepareHeader(winmm->hWaveOut, lpWaveHdr, sizeof(WAVEHDR)); free(lpWaveHdr); return 0; @@ -295,9 +289,9 @@ static void rdpsnd_winmm_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV } #ifdef BUILTIN_CHANNELS -#define freerdp_rdpsnd_client_subsystem_entry winmm_freerdp_rdpsnd_client_subsystem_entry +#define freerdp_rdpsnd_client_subsystem_entry winmm_freerdp_rdpsnd_client_subsystem_entry #else -#define freerdp_rdpsnd_client_subsystem_entry FREERDP_API freerdp_rdpsnd_client_subsystem_entry +#define freerdp_rdpsnd_client_subsystem_entry FREERDP_API freerdp_rdpsnd_client_subsystem_entry #endif /** @@ -309,7 +303,7 @@ UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS p { ADDIN_ARGV* args; rdpsndWinmmPlugin* winmm; - winmm = (rdpsndWinmmPlugin*) calloc(1, sizeof(rdpsndWinmmPlugin)); + winmm = (rdpsndWinmmPlugin*)calloc(1, sizeof(rdpsndWinmmPlugin)); if (!winmm) return CHANNEL_RC_NO_MEMORY; @@ -327,9 +321,9 @@ UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS p if (!winmm->semaphore) goto fail; args = pEntryPoints->args; - rdpsnd_winmm_parse_addin_args((rdpsndDevicePlugin*) winmm, args); + rdpsnd_winmm_parse_addin_args((rdpsndDevicePlugin*)winmm, args); winmm->volume = 0xFFFFFFFF; - pEntryPoints->pRegisterRdpsndDevice(pEntryPoints->rdpsnd, (rdpsndDevicePlugin*) winmm); + pEntryPoints->pRegisterRdpsndDevice(pEntryPoints->rdpsnd, (rdpsndDevicePlugin*)winmm); return CHANNEL_RC_OK; fail: diff --git a/channels/rdpsnd/server/rdpsnd_main.c b/channels/rdpsnd/server/rdpsnd_main.c index 53d4d5c32..0c51c7641 100644 --- a/channels/rdpsnd/server/rdpsnd_main.c +++ b/channels/rdpsnd/server/rdpsnd_main.c @@ -50,20 +50,21 @@ static UINT rdpsnd_server_send_formats(RdpsndServerContext* context, wStream* s) Stream_Write_UINT8(s, SNDC_FORMATS); Stream_Write_UINT8(s, 0); Stream_Seek_UINT16(s); - Stream_Write_UINT32(s, 0); /* dwFlags */ - Stream_Write_UINT32(s, 0); /* dwVolume */ - Stream_Write_UINT32(s, 0); /* dwPitch */ - Stream_Write_UINT16(s, 0); /* wDGramPort */ + Stream_Write_UINT32(s, 0); /* dwFlags */ + Stream_Write_UINT32(s, 0); /* dwVolume */ + Stream_Write_UINT32(s, 0); /* dwPitch */ + Stream_Write_UINT16(s, 0); /* wDGramPort */ Stream_Write_UINT16(s, context->num_server_formats); /* wNumberOfFormats */ - Stream_Write_UINT8(s, context->block_no); /* cLastBlockConfirmed */ - Stream_Write_UINT16(s, CHANNEL_VERSION_WIN_MAX); /* wVersion */ - Stream_Write_UINT8(s, 0); /* bPad */ + Stream_Write_UINT8(s, context->block_no); /* cLastBlockConfirmed */ + Stream_Write_UINT16(s, CHANNEL_VERSION_WIN_MAX); /* wVersion */ + Stream_Write_UINT8(s, 0); /* bPad */ for (i = 0; i < context->num_server_formats; i++) { AUDIO_FORMAT format = context->server_formats[i]; // TODO: Eliminate this!!! - format.nAvgBytesPerSec = format.nSamplesPerSec * format.nChannels * format.wBitsPerSample / 8; + format.nAvgBytesPerSec = + format.nSamplesPerSec * format.nChannels * format.wBitsPerSample / 8; if (!audio_format_write(s, &format)) goto fail; @@ -73,8 +74,8 @@ static UINT rdpsnd_server_send_formats(RdpsndServerContext* context, wStream* s) Stream_SetPosition(s, 2); Stream_Write_UINT16(s, pos - 4); Stream_SetPosition(s, pos); - status = WTSVirtualChannelWrite(context->priv->ChannelHandle, - (PCHAR) Stream_Buffer(s), Stream_GetPosition(s), &written); + status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s), + Stream_GetPosition(s), &written); Stream_SetPosition(s, 0); fail: return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; @@ -85,8 +86,7 @@ fail: * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpsnd_server_recv_waveconfirm(RdpsndServerContext* context, - wStream* s) +static UINT rdpsnd_server_recv_waveconfirm(RdpsndServerContext* context, wStream* s) { UINT16 timestamp; BYTE confirmBlockNum; @@ -101,10 +101,10 @@ static UINT rdpsnd_server_recv_waveconfirm(RdpsndServerContext* context, Stream_Read_UINT16(s, timestamp); Stream_Read_UINT8(s, confirmBlockNum); Stream_Seek_UINT8(s); - IFCALLRET(context->ConfirmBlock, error, context, confirmBlockNum, timestamp); + IFCALLRET(context->ConfirmBlock, error, context, confirmBlockNum, timestamp); if (error) - WLog_ERR(TAG, "context->ConfirmBlock failed with error %"PRIu32"", error); + WLog_ERR(TAG, "context->ConfirmBlock failed with error %" PRIu32 "", error); return error; } @@ -114,8 +114,7 @@ static UINT rdpsnd_server_recv_waveconfirm(RdpsndServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpsnd_server_recv_quality_mode(RdpsndServerContext* context, - wStream* s) +static UINT rdpsnd_server_recv_quality_mode(RdpsndServerContext* context, wStream* s) { UINT16 quality; @@ -127,7 +126,7 @@ static UINT rdpsnd_server_recv_quality_mode(RdpsndServerContext* context, Stream_Read_UINT16(s, quality); Stream_Seek_UINT16(s); // reserved - WLog_DBG(TAG, "Client requested sound quality: 0x%04"PRIX16"", quality); + WLog_DBG(TAG, "Client requested sound quality: 0x%04" PRIX16 "", quality); return CHANNEL_RC_OK; } @@ -150,14 +149,14 @@ static UINT rdpsnd_server_recv_formats(RdpsndServerContext* context, wStream* s) return ERROR_INVALID_DATA; } - Stream_Read_UINT32(s, flags); /* dwFlags */ - Stream_Read_UINT32(s, vol); /* dwVolume */ - Stream_Read_UINT32(s, pitch); /* dwPitch */ - Stream_Read_UINT16(s, udpPort); /* wDGramPort */ + Stream_Read_UINT32(s, flags); /* dwFlags */ + Stream_Read_UINT32(s, vol); /* dwVolume */ + Stream_Read_UINT32(s, pitch); /* dwPitch */ + Stream_Read_UINT16(s, udpPort); /* wDGramPort */ Stream_Read_UINT16(s, context->num_client_formats); /* wNumberOfFormats */ - Stream_Read_UINT8(s, lastblock); /* cLastBlockConfirmed */ - Stream_Read_UINT16(s, context->clientVersion); /* wVersion */ - Stream_Seek_UINT8(s); /* bPad */ + Stream_Read_UINT8(s, lastblock); /* cLastBlockConfirmed */ + Stream_Read_UINT16(s, context->clientVersion); /* wVersion */ + Stream_Seek_UINT8(s); /* bPad */ /* this check is only a guess as cbSize can influence the size of a format record */ if (Stream_GetRemainingLength(s) < context->num_client_formats * 18) @@ -168,7 +167,7 @@ static UINT rdpsnd_server_recv_formats(RdpsndServerContext* context, wStream* s) if (!context->num_client_formats) { - WLog_ERR(TAG, "client doesn't support any format!"); + WLog_ERR(TAG, "client doesn't support any format!"); return ERROR_INTERNAL_ERROR; } @@ -176,7 +175,7 @@ static UINT rdpsnd_server_recv_formats(RdpsndServerContext* context, wStream* s) if (!context->client_formats) { - WLog_ERR(TAG, "calloc failed!"); + WLog_ERR(TAG, "calloc failed!"); return CHANNEL_RC_NO_MEMORY; } @@ -209,15 +208,15 @@ static UINT rdpsnd_server_recv_formats(RdpsndServerContext* context, wStream* s) if (context->client_formats[i].wFormatTag != 0) { - //lets call this a known format - //TODO: actually look through our own list of known formats + // lets call this a known format + // TODO: actually look through our own list of known formats num_known_format++; } } if (!context->num_client_formats) { - WLog_ERR(TAG, "client doesn't support any known format!"); + WLog_ERR(TAG, "client doesn't support any known format!"); goto out_free; } @@ -245,7 +244,7 @@ static DWORD WINAPI rdpsnd_server_thread(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "!", error); break; } @@ -254,7 +253,7 @@ static DWORD WINAPI rdpsnd_server_thread(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); break; } @@ -263,14 +262,13 @@ static DWORD WINAPI rdpsnd_server_thread(LPVOID arg) if ((error = rdpsnd_server_handle_messages(context))) { - WLog_ERR(TAG, "rdpsnd_server_handle_messages failed with error %"PRIu32"", error); + WLog_ERR(TAG, "rdpsnd_server_handle_messages failed with error %" PRIu32 "", error); break; } } if (error && context->rdpcontext) - setChannelError(context->rdpcontext, error, - "rdpsnd_server_thread reported an error"); + setChannelError(context->rdpcontext, error, "rdpsnd_server_thread reported an error"); ExitThread(error); return error; @@ -281,8 +279,7 @@ static DWORD WINAPI rdpsnd_server_thread(LPVOID arg) * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpsnd_server_initialize(RdpsndServerContext* context, - BOOL ownThread) +static UINT rdpsnd_server_initialize(RdpsndServerContext* context, BOOL ownThread) { context->priv->ownThread = ownThread; return context->Start(context); @@ -293,31 +290,29 @@ static UINT rdpsnd_server_initialize(RdpsndServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpsnd_server_select_format(RdpsndServerContext* context, - UINT16 client_format_index) +static UINT rdpsnd_server_select_format(RdpsndServerContext* context, UINT16 client_format_index) { int bs; int out_buffer_size; AUDIO_FORMAT* format; UINT error = CHANNEL_RC_OK; - if ((client_format_index >= context->num_client_formats) - || (!context->src_format)) + if ((client_format_index >= context->num_client_formats) || (!context->src_format)) { - WLog_ERR(TAG, "index %d is not correct.", client_format_index); + WLog_ERR(TAG, "index %d is not correct.", client_format_index); return ERROR_INVALID_DATA; } EnterCriticalSection(&context->priv->lock); context->priv->src_bytes_per_sample = context->src_format->wBitsPerSample / 8; - context->priv->src_bytes_per_frame = context->priv->src_bytes_per_sample * - context->src_format->nChannels; + context->priv->src_bytes_per_frame = + context->priv->src_bytes_per_sample * context->src_format->nChannels; context->selected_client_format = client_format_index; format = &context->client_formats[client_format_index]; if (format->nSamplesPerSec == 0) { - WLog_ERR(TAG, "invalid Client Sound Format!!"); + WLog_ERR(TAG, "invalid Client Sound Format!!"); error = ERROR_INVALID_DATA; goto out; } @@ -325,8 +320,7 @@ static UINT rdpsnd_server_select_format(RdpsndServerContext* context, if (context->latency <= 0) context->latency = 50; - context->priv->out_frames = context->src_format->nSamplesPerSec * - context->latency / 1000; + context->priv->out_frames = context->src_format->nSamplesPerSec * context->latency / 1000; if (context->priv->out_frames < 1) context->priv->out_frames = 1; @@ -353,8 +347,7 @@ static UINT rdpsnd_server_select_format(RdpsndServerContext* context, } context->priv->out_pending_frames = 0; - out_buffer_size = context->priv->out_frames * - context->priv->src_bytes_per_frame; + out_buffer_size = context->priv->out_frames * context->priv->src_bytes_per_frame; if (context->priv->out_buffer_size < out_buffer_size) { @@ -404,8 +397,7 @@ static BOOL rdpsnd_server_align_wave_pdu(wStream* s, UINT32 alignment) * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpsnd_server_send_wave_pdu(RdpsndServerContext* context, - UINT16 wTimestamp) +static UINT rdpsnd_server_send_wave_pdu(RdpsndServerContext* context, UINT16 wTimestamp) { size_t length; size_t start, end = 0; @@ -421,13 +413,13 @@ static UINT rdpsnd_server_send_wave_pdu(RdpsndServerContext* context, format = &context->client_formats[context->selected_client_format]; /* WaveInfo PDU */ Stream_SetPosition(s, 0); - Stream_Write_UINT8(s, SNDC_WAVE); /* msgType */ - Stream_Write_UINT8(s, 0); /* bPad */ - Stream_Write_UINT16(s, 0); /* BodySize */ - Stream_Write_UINT16(s, wTimestamp); /* wTimeStamp */ + Stream_Write_UINT8(s, SNDC_WAVE); /* msgType */ + Stream_Write_UINT8(s, 0); /* bPad */ + Stream_Write_UINT16(s, 0); /* BodySize */ + Stream_Write_UINT16(s, wTimestamp); /* wTimeStamp */ Stream_Write_UINT16(s, context->selected_client_format); /* wFormatNo */ - Stream_Write_UINT8(s, context->block_no); /* cBlockNo */ - Stream_Seek(s, 3); /* bPad */ + Stream_Write_UINT8(s, context->block_no); /* cBlockNo */ + Stream_Seek(s, 3); /* bPad */ start = Stream_GetPosition(s); src = context->priv->out_buffer; length = context->priv->out_pending_frames * context->priv->src_bytes_per_frame; @@ -446,8 +438,8 @@ static UINT rdpsnd_server_send_wave_pdu(RdpsndServerContext* context, Stream_SetPosition(s, end); context->block_no = (context->block_no + 1) % 256; - if (!WTSVirtualChannelWrite(context->priv->ChannelHandle, - (PCHAR) Stream_Buffer(s), start + 4, &written)) + if (!WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s), + start + 4, &written)) { WLog_ERR(TAG, "WTSVirtualChannelWrite failed!"); error = ERROR_INTERNAL_ERROR; @@ -465,8 +457,8 @@ static UINT rdpsnd_server_send_wave_pdu(RdpsndServerContext* context, Stream_Write_UINT32(s, 0); /* bPad */ Stream_SetPosition(s, start); - if (!WTSVirtualChannelWrite(context->priv->ChannelHandle, - (PCHAR) Stream_Pointer(s), end - start, &written)) + if (!WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Pointer(s), end - start, + &written)) { WLog_ERR(TAG, "WTSVirtualChannelWrite failed!"); error = ERROR_INTERNAL_ERROR; @@ -484,8 +476,7 @@ out: * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpsnd_server_send_wave2_pdu(RdpsndServerContext* context, - UINT16 wTimestamp) +static UINT rdpsnd_server_send_wave2_pdu(RdpsndServerContext* context, UINT16 wTimestamp) { size_t length; size_t end = 0; @@ -501,14 +492,14 @@ static UINT rdpsnd_server_send_wave2_pdu(RdpsndServerContext* context, format = &context->client_formats[context->selected_client_format]; /* WaveInfo PDU */ Stream_SetPosition(s, 0); - Stream_Write_UINT8(s, SNDC_WAVE2); /* msgType */ - Stream_Write_UINT8(s, 0); /* bPad */ - Stream_Write_UINT16(s, 0); /* BodySize */ - Stream_Write_UINT16(s, wTimestamp); /* wTimeStamp */ + Stream_Write_UINT8(s, SNDC_WAVE2); /* msgType */ + Stream_Write_UINT8(s, 0); /* bPad */ + Stream_Write_UINT16(s, 0); /* BodySize */ + Stream_Write_UINT16(s, wTimestamp); /* wTimeStamp */ Stream_Write_UINT16(s, context->selected_client_format); /* wFormatNo */ - Stream_Write_UINT8(s, context->block_no); /* cBlockNo */ - Stream_Seek(s, 3); /* bPad */ - Stream_Write_UINT32(s, wTimestamp); /* dwAudioTimeStamp */ + Stream_Write_UINT8(s, context->block_no); /* cBlockNo */ + Stream_Seek(s, 3); /* bPad */ + Stream_Write_UINT32(s, wTimestamp); /* dwAudioTimeStamp */ src = context->priv->out_buffer; length = context->priv->out_pending_frames * context->priv->src_bytes_per_frame; @@ -526,13 +517,14 @@ static UINT rdpsnd_server_send_wave2_pdu(RdpsndServerContext* context, Stream_SetPosition(s, 2); Stream_Write_UINT16(s, end - 4); context->block_no = (context->block_no + 1) % 256; - rc = WTSVirtualChannelWrite(context->priv->ChannelHandle, - (PCHAR) Stream_Buffer(s), end, &written); + rc = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s), end, + &written); if (!rc || (end != written)) { - WLog_ERR(TAG, "WTSVirtualChannelWrite failed! [stream length=%"PRIdz" - written=%"PRIu32, end, - written); + WLog_ERR(TAG, + "WTSVirtualChannelWrite failed! [stream length=%" PRIdz " - written=%" PRIu32, + end, written); error = ERROR_INTERNAL_ERROR; } } @@ -543,8 +535,7 @@ static UINT rdpsnd_server_send_wave2_pdu(RdpsndServerContext* context, } /* Wrapper function to send WAVE or WAVE2 PDU depending on client connected */ -static UINT rdpsnd_server_send_audio_pdu(RdpsndServerContext* context, - UINT16 wTimestamp) +static UINT rdpsnd_server_send_audio_pdu(RdpsndServerContext* context, UINT16 wTimestamp) { if (context->clientVersion >= CHANNEL_VERSION_WIN_8) return rdpsnd_server_send_wave2_pdu(context, wTimestamp); @@ -557,8 +548,8 @@ static UINT rdpsnd_server_send_audio_pdu(RdpsndServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpsnd_server_send_samples(RdpsndServerContext* context, - const void* buf, int nframes, UINT16 wTimestamp) +static UINT rdpsnd_server_send_samples(RdpsndServerContext* context, const void* buf, int nframes, + UINT16 wTimestamp) { int cframes; int cframesize; @@ -575,13 +566,12 @@ static UINT rdpsnd_server_send_samples(RdpsndServerContext* context, while (nframes > 0) { - cframes = MIN(nframes, context->priv->out_frames - - context->priv->out_pending_frames); + cframes = MIN(nframes, context->priv->out_frames - context->priv->out_pending_frames); cframesize = cframes * context->priv->src_bytes_per_frame; CopyMemory(context->priv->out_buffer + - (context->priv->out_pending_frames * context->priv->src_bytes_per_frame), buf, - cframesize); - buf = (BYTE*) buf + cframesize; + (context->priv->out_pending_frames * context->priv->src_bytes_per_frame), + buf, cframesize); + buf = (BYTE*)buf + cframesize; nframes -= cframes; context->priv->out_pending_frames += cframes; @@ -589,7 +579,7 @@ static UINT rdpsnd_server_send_samples(RdpsndServerContext* context, { if ((error = rdpsnd_server_send_audio_pdu(context, wTimestamp))) { - WLog_ERR(TAG, "rdpsnd_server_send_audio_pdu failed with error %"PRIu32"", error); + WLog_ERR(TAG, "rdpsnd_server_send_audio_pdu failed with error %" PRIu32 "", error); break; } } @@ -605,8 +595,7 @@ out: * * @return 0 on success, otherwise a Win32 error code */ -static UINT rdpsnd_server_set_volume(RdpsndServerContext* context, int left, - int right) +static UINT rdpsnd_server_set_volume(RdpsndServerContext* context, int left, int right) { size_t pos; BOOL status; @@ -621,8 +610,8 @@ static UINT rdpsnd_server_set_volume(RdpsndServerContext* context, int left, Stream_SetPosition(s, 2); Stream_Write_UINT16(s, pos - 4); Stream_SetPosition(s, pos); - status = WTSVirtualChannelWrite(context->priv->ChannelHandle, - (PCHAR) Stream_Buffer(s), Stream_GetPosition(s), &written); + status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s), + Stream_GetPosition(s), &written); Stream_SetPosition(s, 0); return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } @@ -650,7 +639,7 @@ static UINT rdpsnd_server_close(RdpsndServerContext* context) } else if ((error = rdpsnd_server_send_audio_pdu(context, 0))) { - WLog_ERR(TAG, "rdpsnd_server_send_audio_pdu failed with error %"PRIu32"", error); + WLog_ERR(TAG, "rdpsnd_server_send_audio_pdu failed with error %" PRIu32 "", error); } } @@ -667,8 +656,8 @@ static UINT rdpsnd_server_close(RdpsndServerContext* context) Stream_SetPosition(s, 2); Stream_Write_UINT16(s, pos - 4); Stream_SetPosition(s, pos); - status = WTSVirtualChannelWrite(context->priv->ChannelHandle, - (PCHAR) Stream_Buffer(s), Stream_GetPosition(s), &written); + status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s), + Stream_GetPosition(s), &written); Stream_SetPosition(s, 0); return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } @@ -684,8 +673,7 @@ static UINT rdpsnd_server_start(RdpsndServerContext* context) DWORD bytesReturned; RdpsndServerPrivate* priv = context->priv; UINT error = ERROR_INTERNAL_ERROR; - priv->ChannelHandle = WTSVirtualChannelOpen(context->vcm, WTS_CURRENT_SESSION, - "rdpsnd"); + priv->ChannelHandle = WTSVirtualChannelOpen(context->vcm, WTS_CURRENT_SESSION, "rdpsnd"); if (!priv->ChannelHandle) { @@ -694,10 +682,12 @@ static UINT rdpsnd_server_start(RdpsndServerContext* context) } if (!WTSVirtualChannelQuery(priv->ChannelHandle, WTSVirtualEventHandle, &buffer, - &bytesReturned) || (bytesReturned != sizeof(HANDLE))) + &bytesReturned) || + (bytesReturned != sizeof(HANDLE))) { WLog_ERR(TAG, - "error during WTSVirtualChannelQuery(WTSVirtualEventHandle) or invalid returned size(%"PRIu32")", + "error during WTSVirtualChannelQuery(WTSVirtualEventHandle) or invalid returned " + "size(%" PRIu32 ")", bytesReturned); if (buffer) @@ -725,7 +715,7 @@ static UINT rdpsnd_server_start(RdpsndServerContext* context) if ((error = rdpsnd_server_send_formats(context, context->priv->rdpsnd_pdu))) { - WLog_ERR(TAG, "rdpsnd_server_send_formats failed with error %"PRIu32"", error); + WLog_ERR(TAG, "rdpsnd_server_send_formats failed with error %" PRIu32 "", error); goto out_lock; } @@ -739,8 +729,8 @@ static UINT rdpsnd_server_start(RdpsndServerContext* context) goto out_lock; } - context->priv->Thread = CreateThread(NULL, 0, - rdpsnd_server_thread, (void*) context, 0, NULL); + context->priv->Thread = + CreateThread(NULL, 0, rdpsnd_server_thread, (void*)context, 0, NULL); if (!context->priv->Thread) { @@ -782,7 +772,7 @@ static UINT rdpsnd_server_stop(RdpsndServerContext* context) if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); return error; } @@ -820,8 +810,7 @@ RdpsndServerContext* rdpsnd_server_context_new(HANDLE vcm) context->SendSamples = rdpsnd_server_send_samples; context->SetVolume = rdpsnd_server_set_volume; context->Close = rdpsnd_server_close; - context->priv = priv = (RdpsndServerPrivate*)calloc(1, - sizeof(RdpsndServerPrivate)); + context->priv = priv = (RdpsndServerPrivate*)calloc(1, sizeof(RdpsndServerPrivate)); if (!priv) { @@ -858,7 +847,6 @@ out_free: return NULL; } - void rdpsnd_server_context_reset(RdpsndServerContext* context) { context->priv->expectedBytes = 4; @@ -916,7 +904,7 @@ UINT rdpsnd_server_handle_messages(RdpsndServerContext* context) if (GetLastError() == ERROR_NO_DATA) return ERROR_NO_DATA; - WLog_ERR(TAG, "channel connection closed"); + WLog_ERR(TAG, "channel connection closed"); return ERROR_INTERNAL_ERROR; } @@ -952,7 +940,7 @@ UINT rdpsnd_server_handle_messages(RdpsndServerContext* context) /* when here we have the header + the body */ #ifdef WITH_DEBUG_SND - WLog_DBG(TAG, "message type %"PRIu8"", priv->msgType); + WLog_DBG(TAG, "message type %" PRIu8 "", priv->msgType); #endif priv->expectedBytes = 4; priv->waitingHeader = TRUE; @@ -982,7 +970,7 @@ UINT rdpsnd_server_handle_messages(RdpsndServerContext* context) break; default: - WLog_ERR(TAG, "UNKNOWN MESSAGE TYPE!! (0x%02"PRIX8")", priv->msgType); + WLog_ERR(TAG, "UNKNOWN MESSAGE TYPE!! (0x%02" PRIX8 ")", priv->msgType); ret = ERROR_INVALID_DATA; break; } diff --git a/channels/remdesk/client/remdesk_main.c b/channels/remdesk/client/remdesk_main.c index dc2a6f839..c950d458f 100644 --- a/channels/remdesk/client/remdesk_main.c +++ b/channels/remdesk/client/remdesk_main.c @@ -49,14 +49,13 @@ static UINT remdesk_virtual_channel_write(remdeskPlugin* remdesk, wStream* s) return CHANNEL_RC_INVALID_INSTANCE; } - status = remdesk->channelEntryPoints.pVirtualChannelWriteEx(remdesk->InitHandle, - remdesk->OpenHandle, - Stream_Buffer(s), (UINT32) Stream_Length(s), s); + status = remdesk->channelEntryPoints.pVirtualChannelWriteEx( + remdesk->InitHandle, remdesk->OpenHandle, Stream_Buffer(s), (UINT32)Stream_Length(s), s); if (status != CHANNEL_RC_OK) { Stream_Free(s, TRUE); - WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08"PRIX32"]", + WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08" PRIX32 "]", WTSErrorToString(status), status); } return status; @@ -93,8 +92,8 @@ static UINT remdesk_generate_expert_blob(remdeskPlugin* remdesk) if (!name) name = "Expert"; - remdesk->EncryptedPassStub = freerdp_assistance_encrypt_pass_stub(password, - settings->RemoteAssistancePassStub, &(remdesk->EncryptedPassStubSize)); + remdesk->EncryptedPassStub = freerdp_assistance_encrypt_pass_stub( + password, settings->RemoteAssistancePassStub, &(remdesk->EncryptedPassStubSize)); if (!remdesk->EncryptedPassStub) { @@ -103,7 +102,7 @@ static UINT remdesk_generate_expert_blob(remdeskPlugin* remdesk) } pass = freerdp_assistance_bin_to_hex_string(remdesk->EncryptedPassStub, - remdesk->EncryptedPassStubSize); + remdesk->EncryptedPassStubSize); if (!pass) { @@ -128,8 +127,7 @@ static UINT remdesk_generate_expert_blob(remdeskPlugin* remdesk) * * @return 0 on success, otherwise a Win32 error code */ -static UINT remdesk_read_channel_header(wStream* s, - REMDESK_CHANNEL_HEADER* header) +static UINT remdesk_read_channel_header(wStream* s, REMDESK_CHANNEL_HEADER* header) { int status; UINT32 ChannelNameLen; @@ -141,7 +139,7 @@ static UINT remdesk_read_channel_header(wStream* s, return ERROR_INVALID_DATA; } - Stream_Read_UINT32(s, ChannelNameLen); /* ChannelNameLen (4 bytes) */ + Stream_Read_UINT32(s, ChannelNameLen); /* ChannelNameLen (4 bytes) */ Stream_Read_UINT32(s, header->DataLength); /* DataLen (4 bytes) */ if (ChannelNameLen > 64) @@ -163,9 +161,9 @@ static UINT remdesk_read_channel_header(wStream* s, } ZeroMemory(header->ChannelName, sizeof(header->ChannelName)); - pChannelName = (char*) header->ChannelName; - status = ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) Stream_Pointer(s), - ChannelNameLen / 2, &pChannelName, 32, NULL, NULL); + pChannelName = (char*)header->ChannelName; + status = ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)Stream_Pointer(s), ChannelNameLen / 2, + &pChannelName, 32, NULL, NULL); Stream_Seek(s, ChannelNameLen); if (status <= 0) @@ -182,8 +180,7 @@ static UINT remdesk_read_channel_header(wStream* s, * * @return 0 on success, otherwise a Win32 error code */ -static UINT remdesk_write_channel_header(wStream* s, - REMDESK_CHANNEL_HEADER* header) +static UINT remdesk_write_channel_header(wStream* s, REMDESK_CHANNEL_HEADER* header) { int index; UINT32 ChannelNameLen; @@ -192,12 +189,12 @@ static UINT remdesk_write_channel_header(wStream* s, for (index = 0; index < 32; index++) { - ChannelNameW[index] = (WCHAR) header->ChannelName[index]; + ChannelNameW[index] = (WCHAR)header->ChannelName[index]; } ChannelNameLen = (strnlen(header->ChannelName, sizeof(header->ChannelName)) + 1) * 2; - Stream_Write_UINT32(s, ChannelNameLen); /* ChannelNameLen (4 bytes) */ - Stream_Write_UINT32(s, header->DataLength); /* DataLen (4 bytes) */ + Stream_Write_UINT32(s, ChannelNameLen); /* ChannelNameLen (4 bytes) */ + Stream_Write_UINT32(s, header->DataLength); /* DataLen (4 bytes) */ Stream_Write(s, ChannelNameW, ChannelNameLen); /* ChannelName (variable) */ return CHANNEL_RC_OK; } @@ -209,7 +206,7 @@ static UINT remdesk_write_channel_header(wStream* s, */ static UINT remdesk_write_ctl_header(wStream* s, REMDESK_CTL_HEADER* ctlHeader) { - remdesk_write_channel_header(s, (REMDESK_CHANNEL_HEADER*) ctlHeader); + remdesk_write_channel_header(s, (REMDESK_CHANNEL_HEADER*)ctlHeader); Stream_Write_UINT32(s, ctlHeader->msgType); /* msgType (4 bytes) */ return CHANNEL_RC_OK; } @@ -219,8 +216,8 @@ static UINT remdesk_write_ctl_header(wStream* s, REMDESK_CTL_HEADER* ctlHeader) * * @return 0 on success, otherwise a Win32 error code */ -static UINT remdesk_prepare_ctl_header(REMDESK_CTL_HEADER* ctlHeader, - UINT32 msgType, UINT32 msgSize) +static UINT remdesk_prepare_ctl_header(REMDESK_CTL_HEADER* ctlHeader, UINT32 msgType, + UINT32 msgSize) { ctlHeader->msgType = msgType; sprintf_s(ctlHeader->ChannelName, ARRAYSIZE(ctlHeader->ChannelName), REMDESK_CHANNEL_CTL_NAME); @@ -233,8 +230,8 @@ static UINT remdesk_prepare_ctl_header(REMDESK_CTL_HEADER* ctlHeader, * * @return 0 on success, otherwise a Win32 error code */ -static UINT remdesk_recv_ctl_server_announce_pdu(remdeskPlugin* remdesk, - wStream* s, REMDESK_CHANNEL_HEADER* header) +static UINT remdesk_recv_ctl_server_announce_pdu(remdeskPlugin* remdesk, wStream* s, + REMDESK_CHANNEL_HEADER* header) { return CHANNEL_RC_OK; } @@ -244,8 +241,8 @@ static UINT remdesk_recv_ctl_server_announce_pdu(remdeskPlugin* remdesk, * * @return 0 on success, otherwise a Win32 error code */ -static UINT remdesk_recv_ctl_version_info_pdu(remdeskPlugin* remdesk, - wStream* s, REMDESK_CHANNEL_HEADER* header) +static UINT remdesk_recv_ctl_version_info_pdu(remdeskPlugin* remdesk, wStream* s, + REMDESK_CHANNEL_HEADER* header) { UINT32 versionMajor; UINT32 versionMinor; @@ -261,7 +258,8 @@ static UINT remdesk_recv_ctl_version_info_pdu(remdeskPlugin* remdesk, if ((versionMajor != 1) || (versionMinor > 2) || (versionMinor == 0)) { - WLog_ERR(TAG, "Unsupported protocol version %"PRId32".%"PRId32, versionMajor, versionMinor); + WLog_ERR(TAG, "Unsupported protocol version %" PRId32 ".%" PRId32, versionMajor, + versionMinor); } remdesk->Version = versionMinor; @@ -277,7 +275,7 @@ static UINT remdesk_send_ctl_version_info_pdu(remdeskPlugin* remdesk) { wStream* s; REMDESK_CTL_VERSION_INFO_PDU pdu; - UINT error; + UINT error; remdesk_prepare_ctl_header(&(pdu.ctlHeader), REMDESK_CTL_VERSIONINFO, 8); pdu.versionMajor = 1; pdu.versionMinor = 2; @@ -295,7 +293,7 @@ static UINT remdesk_send_ctl_version_info_pdu(remdeskPlugin* remdesk) Stream_SealLength(s); if ((error = remdesk_virtual_channel_write(remdesk, s))) - WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %" PRIu32 "!", error); return error; } @@ -318,7 +316,7 @@ static UINT remdesk_recv_ctl_result_pdu(remdeskPlugin* remdesk, wStream* s, Stream_Read_UINT32(s, result); /* result (4 bytes) */ *pResult = result; - //WLog_DBG(TAG, "RemdeskRecvResult: 0x%08"PRIX32"", result); + // WLog_DBG(TAG, "RemdeskRecvResult: 0x%08"PRIX32"", result); return CHANNEL_RC_OK; } @@ -340,14 +338,13 @@ static UINT remdesk_send_ctl_authenticate_pdu(remdeskPlugin* remdesk) if ((error = remdesk_generate_expert_blob(remdesk))) { - WLog_ERR(TAG, "remdesk_generate_expert_blob failed with error %"PRIu32"", error); + WLog_ERR(TAG, "remdesk_generate_expert_blob failed with error %" PRIu32 "", error); return error; } pdu.expertBlob = remdesk->ExpertBlob; pdu.raConnectionString = remdesk->settings->RemoteAssistanceRCTicket; - status = ConvertToUnicode(CP_UTF8, 0, pdu.raConnectionString, -1, - &raConnectionStringW, 0); + status = ConvertToUnicode(CP_UTF8, 0, pdu.raConnectionString, -1, &raConnectionStringW, 0); if (status <= 0) { @@ -378,12 +375,12 @@ static UINT remdesk_send_ctl_authenticate_pdu(remdeskPlugin* remdesk) } remdesk_write_ctl_header(s, &(pdu.ctlHeader)); - Stream_Write(s, (BYTE*) raConnectionStringW, cbRaConnectionStringW); - Stream_Write(s, (BYTE*) expertBlobW, cbExpertBlobW); + Stream_Write(s, (BYTE*)raConnectionStringW, cbRaConnectionStringW); + Stream_Write(s, (BYTE*)expertBlobW, cbExpertBlobW); Stream_SealLength(s); if ((error = remdesk_virtual_channel_write(remdesk, s))) - WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %" PRIu32 "!", error); out: free(raConnectionStringW); @@ -406,8 +403,7 @@ static UINT remdesk_send_ctl_remote_control_desktop_pdu(remdeskPlugin* remdesk) WCHAR* raConnectionStringW = NULL; REMDESK_CTL_REMOTE_CONTROL_DESKTOP_PDU pdu; pdu.raConnectionString = remdesk->settings->RemoteAssistanceRCTicket; - status = ConvertToUnicode(CP_UTF8, 0, pdu.raConnectionString, -1, - &raConnectionStringW, 0); + status = ConvertToUnicode(CP_UTF8, 0, pdu.raConnectionString, -1, &raConnectionStringW, 0); if (status <= 0) { @@ -428,11 +424,11 @@ static UINT remdesk_send_ctl_remote_control_desktop_pdu(remdeskPlugin* remdesk) } remdesk_write_ctl_header(s, &(pdu.ctlHeader)); - Stream_Write(s, (BYTE*) raConnectionStringW, cbRaConnectionStringW); + Stream_Write(s, (BYTE*)raConnectionStringW, cbRaConnectionStringW); Stream_SealLength(s); if ((error = remdesk_virtual_channel_write(remdesk, s))) - WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %" PRIu32 "!", error); out: free(raConnectionStringW); @@ -456,7 +452,7 @@ static UINT remdesk_send_ctl_verify_password_pdu(remdeskPlugin* remdesk) if ((error = remdesk_generate_expert_blob(remdesk))) { - WLog_ERR(TAG, "remdesk_generate_expert_blob failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_generate_expert_blob failed with error %" PRIu32 "!", error); return error; } @@ -470,8 +466,7 @@ static UINT remdesk_send_ctl_verify_password_pdu(remdeskPlugin* remdesk) } cbExpertBlobW = status * 2; - remdesk_prepare_ctl_header(&(pdu.ctlHeader), REMDESK_CTL_VERIFY_PASSWORD, - cbExpertBlobW); + remdesk_prepare_ctl_header(&(pdu.ctlHeader), REMDESK_CTL_VERIFY_PASSWORD, cbExpertBlobW); s = Stream_New(NULL, REMDESK_CHANNEL_CTL_SIZE + pdu.ctlHeader.DataLength); if (!s) @@ -482,11 +477,11 @@ static UINT remdesk_send_ctl_verify_password_pdu(remdeskPlugin* remdesk) } remdesk_write_ctl_header(s, &(pdu.ctlHeader)); - Stream_Write(s, (BYTE*) expertBlobW, cbExpertBlobW); + Stream_Write(s, (BYTE*)expertBlobW, cbExpertBlobW); Stream_SealLength(s); if ((error = remdesk_virtual_channel_write(remdesk, s))) - WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %" PRIu32 "!", error); out: free(expertBlobW); @@ -507,7 +502,7 @@ static UINT remdesk_send_ctl_expert_on_vista_pdu(remdeskPlugin* remdesk) if ((error = remdesk_generate_expert_blob(remdesk))) { - WLog_ERR(TAG, "remdesk_generate_expert_blob failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_generate_expert_blob failed with error %" PRIu32 "!", error); return error; } @@ -534,8 +529,7 @@ static UINT remdesk_send_ctl_expert_on_vista_pdu(remdeskPlugin* remdesk) * * @return 0 on success, otherwise a Win32 error code */ -static UINT remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, - REMDESK_CHANNEL_HEADER* header) +static UINT remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, REMDESK_CHANNEL_HEADER* header) { UINT error = CHANNEL_RC_OK; UINT32 msgType = 0; @@ -549,7 +543,7 @@ static UINT remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, Stream_Read_UINT32(s, msgType); /* msgType (4 bytes) */ - //WLog_DBG(TAG, "msgType: %"PRIu32"", msgType); + // WLog_DBG(TAG, "msgType: %"PRIu32"", msgType); switch (msgType) { @@ -558,7 +552,7 @@ static UINT remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, case REMDESK_CTL_RESULT: if ((error = remdesk_recv_ctl_result_pdu(remdesk, s, header, &result))) - WLog_ERR(TAG, "remdesk_recv_ctl_result_pdu failed with error %"PRIu32"", error); + WLog_ERR(TAG, "remdesk_recv_ctl_result_pdu failed with error %" PRIu32 "", error); break; @@ -567,7 +561,7 @@ static UINT remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, case REMDESK_CTL_SERVER_ANNOUNCE: if ((error = remdesk_recv_ctl_server_announce_pdu(remdesk, s, header))) - WLog_ERR(TAG, "remdesk_recv_ctl_server_announce_pdu failed with error %"PRIu32"", + WLog_ERR(TAG, "remdesk_recv_ctl_server_announce_pdu failed with error %" PRIu32 "", error); break; @@ -578,7 +572,8 @@ static UINT remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, case REMDESK_CTL_VERSIONINFO: if ((error = remdesk_recv_ctl_version_info_pdu(remdesk, s, header))) { - WLog_ERR(TAG, "remdesk_recv_ctl_version_info_pdu failed with error %"PRIu32"", error); + WLog_ERR(TAG, "remdesk_recv_ctl_version_info_pdu failed with error %" PRIu32 "", + error); break; } @@ -586,20 +581,24 @@ static UINT remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, { if ((error = remdesk_send_ctl_version_info_pdu(remdesk))) { - WLog_ERR(TAG, "remdesk_send_ctl_version_info_pdu failed with error %"PRIu32"", error); + WLog_ERR(TAG, "remdesk_send_ctl_version_info_pdu failed with error %" PRIu32 "", + error); break; } if ((error = remdesk_send_ctl_authenticate_pdu(remdesk))) { - WLog_ERR(TAG, "remdesk_send_ctl_authenticate_pdu failed with error %"PRIu32"", error); + WLog_ERR(TAG, "remdesk_send_ctl_authenticate_pdu failed with error %" PRIu32 "", + error); break; } if ((error = remdesk_send_ctl_remote_control_desktop_pdu(remdesk))) { - WLog_ERR(TAG, - "remdesk_send_ctl_remote_control_desktop_pdu failed with error %"PRIu32"", error); + WLog_ERR( + TAG, + "remdesk_send_ctl_remote_control_desktop_pdu failed with error %" PRIu32 "", + error); break; } } @@ -607,14 +606,16 @@ static UINT remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, { if ((error = remdesk_send_ctl_expert_on_vista_pdu(remdesk))) { - WLog_ERR(TAG, "remdesk_send_ctl_expert_on_vista_pdu failed with error %"PRIu32"", + WLog_ERR(TAG, + "remdesk_send_ctl_expert_on_vista_pdu failed with error %" PRIu32 "", error); break; } if ((error = remdesk_send_ctl_verify_password_pdu(remdesk))) { - WLog_ERR(TAG, "remdesk_send_ctl_verify_password_pdu failed with error %"PRIu32"", + WLog_ERR(TAG, + "remdesk_send_ctl_verify_password_pdu failed with error %" PRIu32 "", error); break; } @@ -641,7 +642,7 @@ static UINT remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, break; default: - WLog_ERR(TAG, "unknown msgType: %"PRIu32"", msgType); + WLog_ERR(TAG, "unknown msgType: %" PRIu32 "", msgType); error = ERROR_INVALID_DATA; break; } @@ -665,7 +666,7 @@ static UINT remdesk_process_receive(remdeskPlugin* remdesk, wStream* s) if ((status = remdesk_read_channel_header(s, &header))) { - WLog_ERR(TAG, "remdesk_read_channel_header failed with error %"PRIu32"", status); + WLog_ERR(TAG, "remdesk_read_channel_header failed with error %" PRIu32 "", status); return status; } @@ -697,17 +698,17 @@ static UINT remdesk_process_receive(remdeskPlugin* remdesk, wStream* s) static void remdesk_process_connect(remdeskPlugin* remdesk) { - remdesk->settings = (rdpSettings*) remdesk->channelEntryPoints.pExtendedData; + remdesk->settings = (rdpSettings*)remdesk->channelEntryPoints.pExtendedData; } - /** * Function description * * @return 0 on success, otherwise a Win32 error code */ -static UINT remdesk_virtual_channel_event_data_received(remdeskPlugin* remdesk, - void* pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) +static UINT remdesk_virtual_channel_event_data_received(remdeskPlugin* remdesk, void* pData, + UINT32 dataLength, UINT32 totalLength, + UINT32 dataFlags) { wStream* data_in; @@ -732,7 +733,7 @@ static UINT remdesk_virtual_channel_event_data_received(remdeskPlugin* remdesk, data_in = remdesk->data_in; - if (!Stream_EnsureRemainingCapacity(data_in, (int) dataLength)) + if (!Stream_EnsureRemainingCapacity(data_in, (int)dataLength)) { WLog_ERR(TAG, "Stream_EnsureRemainingCapacity failed!"); return CHANNEL_RC_NO_MEMORY; @@ -744,7 +745,7 @@ static UINT remdesk_virtual_channel_event_data_received(remdeskPlugin* remdesk, { if (Stream_Capacity(data_in) != Stream_GetPosition(data_in)) { - WLog_ERR(TAG, "read error"); + WLog_ERR(TAG, "read error"); return ERROR_INTERNAL_ERROR; } @@ -752,7 +753,7 @@ static UINT remdesk_virtual_channel_event_data_received(remdeskPlugin* remdesk, Stream_SealLength(data_in); Stream_SetPosition(data_in, 0); - if (!MessageQueue_Post(remdesk->queue, NULL, 0, (void*) data_in, NULL)) + if (!MessageQueue_Post(remdesk->queue, NULL, 0, (void*)data_in, NULL)) { WLog_ERR(TAG, "MessageQueue_Post failed!"); return ERROR_INTERNAL_ERROR; @@ -763,25 +764,28 @@ static UINT remdesk_virtual_channel_event_data_received(remdeskPlugin* remdesk, } static VOID VCAPITYPE remdesk_virtual_channel_open_event_ex(LPVOID lpUserParam, DWORD openHandle, - UINT event, - LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) + UINT event, LPVOID pData, + UINT32 dataLength, UINT32 totalLength, + UINT32 dataFlags) { UINT error = CHANNEL_RC_OK; - remdeskPlugin* remdesk = (remdeskPlugin*) lpUserParam; + remdeskPlugin* remdesk = (remdeskPlugin*)lpUserParam; if (!remdesk || (remdesk->OpenHandle != openHandle)) { - WLog_ERR(TAG, "error no match"); + WLog_ERR(TAG, "error no match"); return; } switch (event) { case CHANNEL_EVENT_DATA_RECEIVED: - if ((error = remdesk_virtual_channel_event_data_received(remdesk, pData, - dataLength, totalLength, dataFlags))) + if ((error = remdesk_virtual_channel_event_data_received(remdesk, pData, dataLength, + totalLength, dataFlags))) WLog_ERR(TAG, - "remdesk_virtual_channel_event_data_received failed with error %"PRIu32"!", error); + "remdesk_virtual_channel_event_data_received failed with error %" PRIu32 + "!", + error); break; @@ -791,13 +795,13 @@ static VOID VCAPITYPE remdesk_virtual_channel_open_event_ex(LPVOID lpUserParam, wStream* s = (wStream*)lpUserParam; Stream_Free(s, TRUE); } - break; + break; case CHANNEL_EVENT_USER: break; default: - WLog_ERR(TAG, "unhandled event %"PRIu32"!", event); + WLog_ERR(TAG, "unhandled event %" PRIu32 "!", event); error = ERROR_INTERNAL_ERROR; } @@ -810,7 +814,7 @@ static DWORD WINAPI remdesk_virtual_channel_client_thread(LPVOID arg) { wStream* data; wMessage message; - remdeskPlugin* remdesk = (remdeskPlugin*) arg; + remdeskPlugin* remdesk = (remdeskPlugin*)arg; UINT error = CHANNEL_RC_OK; remdesk_process_connect(remdesk); @@ -835,11 +839,11 @@ static DWORD WINAPI remdesk_virtual_channel_client_thread(LPVOID arg) if (message.id == 0) { - data = (wStream*) message.wParam; + data = (wStream*)message.wParam; if ((error = remdesk_process_receive(remdesk, data))) { - WLog_ERR(TAG, "remdesk_process_receive failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_process_receive failed with error %" PRIu32 "!", error); break; } } @@ -858,18 +862,18 @@ static DWORD WINAPI remdesk_virtual_channel_client_thread(LPVOID arg) * * @return 0 on success, otherwise a Win32 error code */ -static UINT remdesk_virtual_channel_event_connected(remdeskPlugin* remdesk, - LPVOID pData, UINT32 dataLength) +static UINT remdesk_virtual_channel_event_connected(remdeskPlugin* remdesk, LPVOID pData, + UINT32 dataLength) { UINT32 status; UINT error; - status = remdesk->channelEntryPoints.pVirtualChannelOpenEx(remdesk->InitHandle, - &remdesk->OpenHandle, remdesk->channelDef.name, - remdesk_virtual_channel_open_event_ex); + status = remdesk->channelEntryPoints.pVirtualChannelOpenEx( + remdesk->InitHandle, &remdesk->OpenHandle, remdesk->channelDef.name, + remdesk_virtual_channel_open_event_ex); if (status != CHANNEL_RC_OK) { - WLog_ERR(TAG, "pVirtualChannelOpenEx failed with %s [%08"PRIX32"]", + WLog_ERR(TAG, "pVirtualChannelOpenEx failed with %s [%08" PRIX32 "]", WTSErrorToString(status), status); return status; } @@ -883,9 +887,8 @@ static UINT remdesk_virtual_channel_event_connected(remdeskPlugin* remdesk, goto error_out; } - remdesk->thread = CreateThread(NULL, 0, - remdesk_virtual_channel_client_thread, (void*) remdesk, - 0, NULL); + remdesk->thread = + CreateThread(NULL, 0, remdesk_virtual_channel_client_thread, (void*)remdesk, 0, NULL); if (!remdesk->thread) { @@ -913,11 +916,11 @@ static UINT remdesk_virtual_channel_event_disconnected(remdeskPlugin* remdesk) if (remdesk->OpenHandle == 0) return CHANNEL_RC_OK; - if (MessageQueue_PostQuit(remdesk->queue, 0) - && (WaitForSingleObject(remdesk->thread, INFINITE) == WAIT_FAILED)) + if (MessageQueue_PostQuit(remdesk->queue, 0) && + (WaitForSingleObject(remdesk->thread, INFINITE) == WAIT_FAILED)) { rc = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", rc); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", rc); return rc; } @@ -925,12 +928,13 @@ static UINT remdesk_virtual_channel_event_disconnected(remdeskPlugin* remdesk) CloseHandle(remdesk->thread); remdesk->queue = NULL; remdesk->thread = NULL; - rc = remdesk->channelEntryPoints.pVirtualChannelCloseEx(remdesk->InitHandle, remdesk->OpenHandle); + rc = remdesk->channelEntryPoints.pVirtualChannelCloseEx(remdesk->InitHandle, + remdesk->OpenHandle); if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "pVirtualChannelCloseEx failed with %s [%08"PRIX32"]", - WTSErrorToString(rc), rc); + WLog_ERR(TAG, "pVirtualChannelCloseEx failed with %s [%08" PRIX32 "]", WTSErrorToString(rc), + rc); } remdesk->OpenHandle = 0; @@ -952,24 +956,24 @@ static void remdesk_virtual_channel_event_terminated(remdeskPlugin* remdesk) } static VOID VCAPITYPE remdesk_virtual_channel_init_event_ex(LPVOID lpUserParam, LPVOID pInitHandle, - UINT event, LPVOID pData, - UINT dataLength) + UINT event, LPVOID pData, + UINT dataLength) { UINT error = CHANNEL_RC_OK; - remdeskPlugin* remdesk = (remdeskPlugin*) lpUserParam; + remdeskPlugin* remdesk = (remdeskPlugin*)lpUserParam; if (!remdesk || (remdesk->InitHandle != pInitHandle)) { - WLog_ERR(TAG, "error no match"); + WLog_ERR(TAG, "error no match"); return; } switch (event) { case CHANNEL_EVENT_CONNECTED: - if ((error = remdesk_virtual_channel_event_connected(remdesk, pData, - dataLength))) - WLog_ERR(TAG, "remdesk_virtual_channel_event_connected failed with error %"PRIu32"", + if ((error = remdesk_virtual_channel_event_connected(remdesk, pData, dataLength))) + WLog_ERR(TAG, + "remdesk_virtual_channel_event_connected failed with error %" PRIu32 "", error); break; @@ -977,7 +981,8 @@ static VOID VCAPITYPE remdesk_virtual_channel_init_event_ex(LPVOID lpUserParam, case CHANNEL_EVENT_DISCONNECTED: if ((error = remdesk_virtual_channel_event_disconnected(remdesk))) WLog_ERR(TAG, - "remdesk_virtual_channel_event_disconnected failed with error %"PRIu32"", error); + "remdesk_virtual_channel_event_disconnected failed with error %" PRIu32 "", + error); break; @@ -997,7 +1002,7 @@ static VOID VCAPITYPE remdesk_virtual_channel_init_event_ex(LPVOID lpUserParam, } /* remdesk is always built-in */ -#define VirtualChannelEntryEx remdesk_VirtualChannelEntryEx +#define VirtualChannelEntryEx remdesk_VirtualChannelEntryEx BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID pInitHandle) { @@ -1011,7 +1016,7 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p return FALSE; } - remdesk = (remdeskPlugin*) calloc(1, sizeof(remdeskPlugin)); + remdesk = (remdeskPlugin*)calloc(1, sizeof(remdeskPlugin)); if (!remdesk) { @@ -1019,19 +1024,16 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p return FALSE; } - remdesk->channelDef.options = - CHANNEL_OPTION_INITIALIZED | - CHANNEL_OPTION_ENCRYPT_RDP | - CHANNEL_OPTION_COMPRESS_RDP | - CHANNEL_OPTION_SHOW_PROTOCOL; + remdesk->channelDef.options = CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP | + CHANNEL_OPTION_COMPRESS_RDP | CHANNEL_OPTION_SHOW_PROTOCOL; sprintf_s(remdesk->channelDef.name, ARRAYSIZE(remdesk->channelDef.name), "remdesk"); remdesk->Version = 2; - pEntryPointsEx = (CHANNEL_ENTRY_POINTS_FREERDP_EX*) pEntryPoints; + pEntryPointsEx = (CHANNEL_ENTRY_POINTS_FREERDP_EX*)pEntryPoints; if ((pEntryPointsEx->cbSize >= sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX)) && (pEntryPointsEx->MagicNumber == FREERDP_CHANNEL_MAGIC_NUMBER)) { - context = (RemdeskClientContext*) calloc(1, sizeof(RemdeskClientContext)); + context = (RemdeskClientContext*)calloc(1, sizeof(RemdeskClientContext)); if (!context) { @@ -1039,7 +1041,7 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p goto error_out; } - context->handle = (void*) remdesk; + context->handle = (void*)remdesk; remdesk->context = context; remdesk->rdpcontext = pEntryPointsEx->context; } @@ -1047,14 +1049,14 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p CopyMemory(&(remdesk->channelEntryPoints), pEntryPoints, sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX)); remdesk->InitHandle = pInitHandle; - rc = remdesk->channelEntryPoints.pVirtualChannelInitEx(remdesk, context, pInitHandle, - &remdesk->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000, - remdesk_virtual_channel_init_event_ex); + rc = remdesk->channelEntryPoints.pVirtualChannelInitEx( + remdesk, context, pInitHandle, &remdesk->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000, + remdesk_virtual_channel_init_event_ex); if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "pVirtualChannelInitEx failed with %s [%08"PRIX32"]", - WTSErrorToString(rc), rc); + WLog_ERR(TAG, "pVirtualChannelInitEx failed with %s [%08" PRIX32 "]", WTSErrorToString(rc), + rc); goto error_out; } diff --git a/channels/remdesk/server/remdesk_main.c b/channels/remdesk/server/remdesk_main.c index 04781773e..aeaa332e5 100644 --- a/channels/remdesk/server/remdesk_main.c +++ b/channels/remdesk/server/remdesk_main.c @@ -34,13 +34,12 @@ * * @return 0 on success, otherwise a Win32 error code */ -static UINT remdesk_virtual_channel_write(RemdeskServerContext* context, - wStream* s) +static UINT remdesk_virtual_channel_write(RemdeskServerContext* context, wStream* s) { BOOL status; ULONG BytesWritten = 0; - status = WTSVirtualChannelWrite(context->priv->ChannelHandle, - (PCHAR) Stream_Buffer(s), Stream_Length(s), &BytesWritten); + status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s), + Stream_Length(s), &BytesWritten); return (status) ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } @@ -49,8 +48,7 @@ static UINT remdesk_virtual_channel_write(RemdeskServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT remdesk_read_channel_header(wStream* s, - REMDESK_CHANNEL_HEADER* header) +static UINT remdesk_read_channel_header(wStream* s, REMDESK_CHANNEL_HEADER* header) { int status; UINT32 ChannelNameLen; @@ -62,7 +60,7 @@ static UINT remdesk_read_channel_header(wStream* s, return CHANNEL_RC_NO_MEMORY; } - Stream_Read_UINT32(s, ChannelNameLen); /* ChannelNameLen (4 bytes) */ + Stream_Read_UINT32(s, ChannelNameLen); /* ChannelNameLen (4 bytes) */ Stream_Read_UINT32(s, header->DataLength); /* DataLen (4 bytes) */ if (ChannelNameLen > 64) @@ -84,9 +82,9 @@ static UINT remdesk_read_channel_header(wStream* s, } ZeroMemory(header->ChannelName, sizeof(header->ChannelName)); - pChannelName = (char*) header->ChannelName; - status = ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) Stream_Pointer(s), - ChannelNameLen / 2, &pChannelName, 32, NULL, NULL); + pChannelName = (char*)header->ChannelName; + status = ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)Stream_Pointer(s), ChannelNameLen / 2, + &pChannelName, 32, NULL, NULL); Stream_Seek(s, ChannelNameLen); if (status <= 0) @@ -103,8 +101,7 @@ static UINT remdesk_read_channel_header(wStream* s, * * @return 0 on success, otherwise a Win32 error code */ -static UINT remdesk_write_channel_header(wStream* s, - REMDESK_CHANNEL_HEADER* header) +static UINT remdesk_write_channel_header(wStream* s, REMDESK_CHANNEL_HEADER* header) { int index; UINT32 ChannelNameLen; @@ -113,12 +110,12 @@ static UINT remdesk_write_channel_header(wStream* s, for (index = 0; index < 32; index++) { - ChannelNameW[index] = (WCHAR) header->ChannelName[index]; + ChannelNameW[index] = (WCHAR)header->ChannelName[index]; } ChannelNameLen = (strnlen(header->ChannelName, sizeof(header->ChannelName)) + 1) * 2; - Stream_Write_UINT32(s, ChannelNameLen); /* ChannelNameLen (4 bytes) */ - Stream_Write_UINT32(s, header->DataLength); /* DataLen (4 bytes) */ + Stream_Write_UINT32(s, ChannelNameLen); /* ChannelNameLen (4 bytes) */ + Stream_Write_UINT32(s, header->DataLength); /* DataLen (4 bytes) */ Stream_Write(s, ChannelNameW, ChannelNameLen); /* ChannelName (variable) */ return CHANNEL_RC_OK; } @@ -132,10 +129,9 @@ static UINT remdesk_write_ctl_header(wStream* s, REMDESK_CTL_HEADER* ctlHeader) { UINT error; - if ((error = remdesk_write_channel_header(s, - (REMDESK_CHANNEL_HEADER*) ctlHeader))) + if ((error = remdesk_write_channel_header(s, (REMDESK_CHANNEL_HEADER*)ctlHeader))) { - WLog_ERR(TAG, "remdesk_write_channel_header failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_write_channel_header failed with error %" PRIu32 "!", error); return error; } @@ -148,8 +144,8 @@ static UINT remdesk_write_ctl_header(wStream* s, REMDESK_CTL_HEADER* ctlHeader) * * @return 0 on success, otherwise a Win32 error code */ -static UINT remdesk_prepare_ctl_header(REMDESK_CTL_HEADER* ctlHeader, - UINT32 msgType, UINT32 msgSize) +static UINT remdesk_prepare_ctl_header(REMDESK_CTL_HEADER* ctlHeader, UINT32 msgType, + UINT32 msgSize) { ctlHeader->msgType = msgType; sprintf_s(ctlHeader->ChannelName, ARRAYSIZE(ctlHeader->ChannelName), REMDESK_CHANNEL_CTL_NAME); @@ -162,18 +158,16 @@ static UINT remdesk_prepare_ctl_header(REMDESK_CTL_HEADER* ctlHeader, * * @return 0 on success, otherwise a Win32 error code */ -static UINT remdesk_send_ctl_result_pdu(RemdeskServerContext* context, - UINT32 result) +static UINT remdesk_send_ctl_result_pdu(RemdeskServerContext* context, UINT32 result) { wStream* s; REMDESK_CTL_RESULT_PDU pdu; UINT error; pdu.result = result; - if ((error = remdesk_prepare_ctl_header(&(pdu.ctlHeader), REMDESK_CTL_RESULT, - 4))) + if ((error = remdesk_prepare_ctl_header(&(pdu.ctlHeader), REMDESK_CTL_RESULT, 4))) { - WLog_ERR(TAG, "remdesk_prepare_ctl_header failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_prepare_ctl_header failed with error %" PRIu32 "!", error); return error; } @@ -187,7 +181,7 @@ static UINT remdesk_send_ctl_result_pdu(RemdeskServerContext* context, if ((error = remdesk_write_ctl_header(s, &(pdu.ctlHeader)))) { - WLog_ERR(TAG, "remdesk_write_ctl_header failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_write_ctl_header failed with error %" PRIu32 "!", error); goto out; } @@ -195,7 +189,7 @@ static UINT remdesk_send_ctl_result_pdu(RemdeskServerContext* context, Stream_SealLength(s); if ((error = remdesk_virtual_channel_write(context, s))) - WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %" PRIu32 "!", error); out: Stream_Free(s, TRUE); @@ -213,10 +207,9 @@ static UINT remdesk_send_ctl_version_info_pdu(RemdeskServerContext* context) REMDESK_CTL_VERSION_INFO_PDU pdu; UINT error; - if ((error = remdesk_prepare_ctl_header(&(pdu.ctlHeader), - REMDESK_CTL_VERSIONINFO, 8))) + if ((error = remdesk_prepare_ctl_header(&(pdu.ctlHeader), REMDESK_CTL_VERSIONINFO, 8))) { - WLog_ERR(TAG, "remdesk_prepare_ctl_header failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_prepare_ctl_header failed with error %" PRIu32 "!", error); return error; } @@ -232,7 +225,7 @@ static UINT remdesk_send_ctl_version_info_pdu(RemdeskServerContext* context) if ((error = remdesk_write_ctl_header(s, &(pdu.ctlHeader)))) { - WLog_ERR(TAG, "remdesk_write_ctl_header failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_write_ctl_header failed with error %" PRIu32 "!", error); goto out; } @@ -241,7 +234,7 @@ static UINT remdesk_send_ctl_version_info_pdu(RemdeskServerContext* context) Stream_SealLength(s); if ((error = remdesk_virtual_channel_write(context, s))) - WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %" PRIu32 "!", error); out: Stream_Free(s, TRUE); @@ -253,8 +246,8 @@ out: * * @return 0 on success, otherwise a Win32 error code */ -static UINT remdesk_recv_ctl_version_info_pdu(RemdeskServerContext* context, - wStream* s, REMDESK_CHANNEL_HEADER* header) +static UINT remdesk_recv_ctl_version_info_pdu(RemdeskServerContext* context, wStream* s, + REMDESK_CHANNEL_HEADER* header) { UINT32 versionMajor; UINT32 versionMinor; @@ -275,8 +268,8 @@ static UINT remdesk_recv_ctl_version_info_pdu(RemdeskServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT remdesk_recv_ctl_remote_control_desktop_pdu( - RemdeskServerContext* context, wStream* s, REMDESK_CHANNEL_HEADER* header) +static UINT remdesk_recv_ctl_remote_control_desktop_pdu(RemdeskServerContext* context, wStream* s, + REMDESK_CHANNEL_HEADER* header) { int status; int cchStringW; @@ -287,7 +280,7 @@ static UINT remdesk_recv_ctl_remote_control_desktop_pdu( REMDESK_CTL_REMOTE_CONTROL_DESKTOP_PDU pdu; UINT error; msgLength = header->DataLength - 4; - pStringW = (WCHAR*) Stream_Pointer(s); + pStringW = (WCHAR*)Stream_Pointer(s); raConnectionStringW = pStringW; cchStringW = 0; @@ -303,8 +296,8 @@ static UINT remdesk_recv_ctl_remote_control_desktop_pdu( cchStringW++; cbRaConnectionStringW = cchStringW * 2; pdu.raConnectionString = NULL; - status = ConvertFromUnicode(CP_UTF8, 0, raConnectionStringW, - cbRaConnectionStringW / 2, &pdu.raConnectionString, 0, NULL, NULL); + status = ConvertFromUnicode(CP_UTF8, 0, raConnectionStringW, cbRaConnectionStringW / 2, + &pdu.raConnectionString, 0, NULL, NULL); if (status <= 0) { @@ -312,12 +305,11 @@ static UINT remdesk_recv_ctl_remote_control_desktop_pdu( return ERROR_INTERNAL_ERROR; } - WLog_INFO(TAG, "RaConnectionString: %s", - pdu.raConnectionString); + WLog_INFO(TAG, "RaConnectionString: %s", pdu.raConnectionString); free(pdu.raConnectionString); if ((error = remdesk_send_ctl_result_pdu(context, 0))) - WLog_ERR(TAG, "remdesk_send_ctl_result_pdu failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_send_ctl_result_pdu failed with error %" PRIu32 "!", error); return error; } @@ -327,8 +319,8 @@ static UINT remdesk_recv_ctl_remote_control_desktop_pdu( * * @return 0 on success, otherwise a Win32 error code */ -static UINT remdesk_recv_ctl_authenticate_pdu(RemdeskServerContext* context, - wStream* s, REMDESK_CHANNEL_HEADER* header) +static UINT remdesk_recv_ctl_authenticate_pdu(RemdeskServerContext* context, wStream* s, + REMDESK_CHANNEL_HEADER* header) { int status; int cchStringW; @@ -340,7 +332,7 @@ static UINT remdesk_recv_ctl_authenticate_pdu(RemdeskServerContext* context, WCHAR* raConnectionStringW = NULL; REMDESK_CTL_AUTHENTICATE_PDU pdu; msgLength = header->DataLength - 4; - pStringW = (WCHAR*) Stream_Pointer(s); + pStringW = (WCHAR*)Stream_Pointer(s); raConnectionStringW = pStringW; cchStringW = 0; @@ -371,8 +363,8 @@ static UINT remdesk_recv_ctl_authenticate_pdu(RemdeskServerContext* context, cchStringW++; cbExpertBlobW = cchStringW * 2; pdu.raConnectionString = NULL; - status = ConvertFromUnicode(CP_UTF8, 0, raConnectionStringW, - cbRaConnectionStringW / 2, &pdu.raConnectionString, 0, NULL, NULL); + status = ConvertFromUnicode(CP_UTF8, 0, raConnectionStringW, cbRaConnectionStringW / 2, + &pdu.raConnectionString, 0, NULL, NULL); if (status <= 0) { @@ -381,8 +373,8 @@ static UINT remdesk_recv_ctl_authenticate_pdu(RemdeskServerContext* context, } pdu.expertBlob = NULL; - status = ConvertFromUnicode(CP_UTF8, 0, expertBlobW, - cbExpertBlobW / 2, &pdu.expertBlob, 0, NULL, NULL); + status = ConvertFromUnicode(CP_UTF8, 0, expertBlobW, cbExpertBlobW / 2, &pdu.expertBlob, 0, + NULL, NULL); if (status <= 0) { @@ -391,8 +383,7 @@ static UINT remdesk_recv_ctl_authenticate_pdu(RemdeskServerContext* context, return ERROR_INTERNAL_ERROR; } - WLog_INFO(TAG, "RaConnectionString: %s ExpertBlob: %s", - pdu.raConnectionString, pdu.expertBlob); + WLog_INFO(TAG, "RaConnectionString: %s ExpertBlob: %s", pdu.raConnectionString, pdu.expertBlob); free(pdu.raConnectionString); free(pdu.expertBlob); return CHANNEL_RC_OK; @@ -403,8 +394,8 @@ static UINT remdesk_recv_ctl_authenticate_pdu(RemdeskServerContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT remdesk_recv_ctl_verify_password_pdu(RemdeskServerContext* context, - wStream* s, REMDESK_CHANNEL_HEADER* header) +static UINT remdesk_recv_ctl_verify_password_pdu(RemdeskServerContext* context, wStream* s, + REMDESK_CHANNEL_HEADER* header) { int status; int cbExpertBlobW = 0; @@ -419,10 +410,10 @@ static UINT remdesk_recv_ctl_verify_password_pdu(RemdeskServerContext* context, } pdu.expertBlob = NULL; - expertBlobW = (WCHAR*) Stream_Pointer(s); + expertBlobW = (WCHAR*)Stream_Pointer(s); cbExpertBlobW = header->DataLength - 4; - status = ConvertFromUnicode(CP_UTF8, 0, expertBlobW, cbExpertBlobW / 2, - &pdu.expertBlob, 0, NULL, NULL); + status = ConvertFromUnicode(CP_UTF8, 0, expertBlobW, cbExpertBlobW / 2, &pdu.expertBlob, 0, + NULL, NULL); if (status <= 0) { @@ -433,7 +424,7 @@ static UINT remdesk_recv_ctl_verify_password_pdu(RemdeskServerContext* context, WLog_INFO(TAG, "ExpertBlob: %s", pdu.expertBlob); if ((error = remdesk_send_ctl_result_pdu(context, 0))) - WLog_ERR(TAG, "remdesk_send_ctl_result_pdu failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_send_ctl_result_pdu failed with error %" PRIu32 "!", error); return error; } @@ -456,7 +447,7 @@ static UINT remdesk_recv_ctl_pdu(RemdeskServerContext* context, wStream* s, } Stream_Read_UINT32(s, msgType); /* msgType (4 bytes) */ - WLog_INFO(TAG, "msgType: %"PRIu32"", msgType); + WLog_INFO(TAG, "msgType: %" PRIu32 "", msgType); switch (msgType) { @@ -464,7 +455,9 @@ static UINT remdesk_recv_ctl_pdu(RemdeskServerContext* context, wStream* s, if ((error = remdesk_recv_ctl_remote_control_desktop_pdu(context, s, header))) { WLog_ERR(TAG, - "remdesk_recv_ctl_remote_control_desktop_pdu failed with error %"PRIu32"!", error); + "remdesk_recv_ctl_remote_control_desktop_pdu failed with error %" PRIu32 + "!", + error); return error; } @@ -473,7 +466,7 @@ static UINT remdesk_recv_ctl_pdu(RemdeskServerContext* context, wStream* s, case REMDESK_CTL_AUTHENTICATE: if ((error = remdesk_recv_ctl_authenticate_pdu(context, s, header))) { - WLog_ERR(TAG, "remdesk_recv_ctl_authenticate_pdu failed with error %"PRIu32"!", + WLog_ERR(TAG, "remdesk_recv_ctl_authenticate_pdu failed with error %" PRIu32 "!", error); return error; } @@ -486,7 +479,7 @@ static UINT remdesk_recv_ctl_pdu(RemdeskServerContext* context, wStream* s, case REMDESK_CTL_VERSIONINFO: if ((error = remdesk_recv_ctl_version_info_pdu(context, s, header))) { - WLog_ERR(TAG, "remdesk_recv_ctl_version_info_pdu failed with error %"PRIu32"!", + WLog_ERR(TAG, "remdesk_recv_ctl_version_info_pdu failed with error %" PRIu32 "!", error); return error; } @@ -499,7 +492,7 @@ static UINT remdesk_recv_ctl_pdu(RemdeskServerContext* context, wStream* s, case REMDESK_CTL_VERIFY_PASSWORD: if ((error = remdesk_recv_ctl_verify_password_pdu(context, s, header))) { - WLog_ERR(TAG, "remdesk_recv_ctl_verify_password_pdu failed with error %"PRIu32"!", + WLog_ERR(TAG, "remdesk_recv_ctl_verify_password_pdu failed with error %" PRIu32 "!", error); return error; } @@ -519,7 +512,7 @@ static UINT remdesk_recv_ctl_pdu(RemdeskServerContext* context, wStream* s, break; default: - WLog_ERR(TAG, "remdesk_recv_control_pdu: unknown msgType: %"PRIu32"", msgType); + WLog_ERR(TAG, "remdesk_recv_control_pdu: unknown msgType: %" PRIu32 "", msgType); error = ERROR_INVALID_DATA; break; } @@ -532,8 +525,7 @@ static UINT remdesk_recv_ctl_pdu(RemdeskServerContext* context, wStream* s, * * @return 0 on success, otherwise a Win32 error code */ -static UINT remdesk_server_receive_pdu(RemdeskServerContext* context, - wStream* s) +static UINT remdesk_server_receive_pdu(RemdeskServerContext* context, wStream* s) { UINT error = CHANNEL_RC_OK; REMDESK_CHANNEL_HEADER header; @@ -544,7 +536,7 @@ static UINT remdesk_server_receive_pdu(RemdeskServerContext* context, if ((error = remdesk_read_channel_header(s, &header))) { - WLog_ERR(TAG, "remdesk_read_channel_header failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_read_channel_header failed with error %" PRIu32 "!", error); return error; } @@ -552,7 +544,7 @@ static UINT remdesk_server_receive_pdu(RemdeskServerContext* context, { if ((error = remdesk_recv_ctl_pdu(context, s, &header))) { - WLog_ERR(TAG, "remdesk_recv_ctl_pdu failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_recv_ctl_pdu failed with error %" PRIu32 "!", error); return error; } } @@ -591,7 +583,7 @@ static DWORD WINAPI remdesk_server_thread(LPVOID arg) DWORD BytesReturned; RemdeskServerContext* context; UINT error; - context = (RemdeskServerContext*) arg; + context = (RemdeskServerContext*)arg; buffer = NULL; BytesReturned = 0; ChannelEvent = NULL; @@ -604,8 +596,8 @@ static DWORD WINAPI remdesk_server_thread(LPVOID arg) goto out; } - if (WTSVirtualChannelQuery(context->priv->ChannelHandle, WTSVirtualEventHandle, - &buffer, &BytesReturned) == TRUE) + if (WTSVirtualChannelQuery(context->priv->ChannelHandle, WTSVirtualEventHandle, &buffer, + &BytesReturned) == TRUE) { if (BytesReturned == sizeof(HANDLE)) CopyMemory(&ChannelEvent, buffer, sizeof(HANDLE)); @@ -625,8 +617,7 @@ static DWORD WINAPI remdesk_server_thread(LPVOID arg) if ((error = remdesk_send_ctl_version_info_pdu(context))) { - WLog_ERR(TAG, "remdesk_send_ctl_version_info_pdu failed with error %"PRIu32"!", - error); + WLog_ERR(TAG, "remdesk_send_ctl_version_info_pdu failed with error %" PRIu32 "!", error); goto out; } @@ -637,7 +628,7 @@ static DWORD WINAPI remdesk_server_thread(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "", error); break; } @@ -646,7 +637,7 @@ static DWORD WINAPI remdesk_server_thread(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", error); break; } @@ -655,8 +646,8 @@ static DWORD WINAPI remdesk_server_thread(LPVOID arg) break; } - if (WTSVirtualChannelRead(context->priv->ChannelHandle, 0, - (PCHAR) Stream_Buffer(s), Stream_Capacity(s), &BytesReturned)) + if (WTSVirtualChannelRead(context->priv->ChannelHandle, 0, (PCHAR)Stream_Buffer(s), + Stream_Capacity(s), &BytesReturned)) { if (BytesReturned) Stream_Seek(s, BytesReturned); @@ -673,7 +664,7 @@ static DWORD WINAPI remdesk_server_thread(LPVOID arg) if (Stream_GetPosition(s) >= 8) { - pHeader = (UINT32*) Stream_Buffer(s); + pHeader = (UINT32*)Stream_Buffer(s); PduLength = pHeader[0] + pHeader[1] + 8; if (PduLength >= Stream_GetPosition(s)) @@ -683,7 +674,8 @@ static DWORD WINAPI remdesk_server_thread(LPVOID arg) if ((error = remdesk_server_receive_pdu(context, s))) { - WLog_ERR(TAG, "remdesk_server_receive_pdu failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "remdesk_server_receive_pdu failed with error %" PRIu32 "!", + error); break; } @@ -696,8 +688,7 @@ static DWORD WINAPI remdesk_server_thread(LPVOID arg) out: if (error && context->rdpcontext) - setChannelError(context->rdpcontext, error, - "remdesk_server_thread reported an error"); + setChannelError(context->rdpcontext, error, "remdesk_server_thread reported an error"); ExitThread(error); return error; @@ -710,8 +701,8 @@ out: */ static UINT remdesk_server_start(RemdeskServerContext* context) { - context->priv->ChannelHandle = WTSVirtualChannelOpen(context->vcm, - WTS_CURRENT_SESSION, "remdesk"); + context->priv->ChannelHandle = + WTSVirtualChannelOpen(context->vcm, WTS_CURRENT_SESSION, "remdesk"); if (!context->priv->ChannelHandle) { @@ -725,8 +716,8 @@ static UINT remdesk_server_start(RemdeskServerContext* context) return ERROR_INTERNAL_ERROR; } - if (!(context->priv->Thread = CreateThread(NULL, 0, - remdesk_server_thread, (void*) context, 0, NULL))) + if (!(context->priv->Thread = + CreateThread(NULL, 0, remdesk_server_thread, (void*)context, 0, NULL))) { WLog_ERR(TAG, "CreateThread failed!"); CloseHandle(context->priv->StopEvent); @@ -750,7 +741,7 @@ static UINT remdesk_server_stop(RemdeskServerContext* context) if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); return error; } @@ -762,14 +753,14 @@ static UINT remdesk_server_stop(RemdeskServerContext* context) RemdeskServerContext* remdesk_server_context_new(HANDLE vcm) { RemdeskServerContext* context; - context = (RemdeskServerContext*) calloc(1, sizeof(RemdeskServerContext)); + context = (RemdeskServerContext*)calloc(1, sizeof(RemdeskServerContext)); if (context) { context->vcm = vcm; context->Start = remdesk_server_start; context->Stop = remdesk_server_stop; - context->priv = (RemdeskServerPrivate*) calloc(1, sizeof(RemdeskServerPrivate)); + context->priv = (RemdeskServerPrivate*)calloc(1, sizeof(RemdeskServerPrivate)); if (!context->priv) { diff --git a/channels/remdesk/server/remdesk_main.h b/channels/remdesk/server/remdesk_main.h index 857376ae5..f47d037ab 100644 --- a/channels/remdesk/server/remdesk_main.h +++ b/channels/remdesk/server/remdesk_main.h @@ -39,4 +39,3 @@ struct _remdesk_server_private }; #endif /* FREERDP_CHANNEL_REMDESK_SERVER_MAIN_H */ - diff --git a/channels/serial/client/serial_main.c b/channels/serial/client/serial_main.c index b0a83eccc..cac534c8d 100644 --- a/channels/serial/client/serial_main.c +++ b/channels/serial/client/serial_main.c @@ -49,7 +49,7 @@ * CommWriteFile by WriteFile etc.. */ #if defined __linux__ && !defined ANDROID -#define MAX_IRP_THREADS 5 +#define MAX_IRP_THREADS 5 typedef struct _SERIAL_DEVICE SERIAL_DEVICE; @@ -81,7 +81,8 @@ struct _IRP_THREAD_DATA static UINT32 _GetLastErrorToIoStatus(SERIAL_DEVICE* serial) { - /* http://msdn.microsoft.com/en-us/library/ff547466%28v=vs.85%29.aspx#generic_status_values_for_serial_device_control_requests */ + /* http://msdn.microsoft.com/en-us/library/ff547466%28v=vs.85%29.aspx#generic_status_values_for_serial_device_control_requests + */ switch (GetLastError()) { case ERROR_BAD_DEVICE: @@ -119,8 +120,7 @@ static UINT32 _GetLastErrorToIoStatus(SERIAL_DEVICE* serial) /* no default */ } - WLog_Print(serial->log, WLOG_DEBUG, "unexpected last-error: 0x%08"PRIX32"", - GetLastError()); + WLog_Print(serial->log, WLOG_DEBUG, "unexpected last-error: 0x%08" PRIX32 "", GetLastError()); return STATUS_UNSUCCESSFUL; } @@ -134,19 +134,19 @@ static UINT serial_process_irp_create(SERIAL_DEVICE* serial, IRP* irp) if (Stream_GetRemainingLength(irp->input) < 32) return ERROR_INVALID_DATA; - Stream_Read_UINT32(irp->input, DesiredAccess); /* DesiredAccess (4 bytes) */ - Stream_Seek_UINT64(irp->input); /* AllocationSize (8 bytes) */ - Stream_Seek_UINT32(irp->input); /* FileAttributes (4 bytes) */ - Stream_Read_UINT32(irp->input, SharedAccess); /* SharedAccess (4 bytes) */ - Stream_Read_UINT32(irp->input, CreateDisposition); /* CreateDisposition (4 bytes) */ - Stream_Seek_UINT32(irp->input); /* CreateOptions (4 bytes) */ - Stream_Read_UINT32(irp->input, PathLength); /* PathLength (4 bytes) */ + Stream_Read_UINT32(irp->input, DesiredAccess); /* DesiredAccess (4 bytes) */ + Stream_Seek_UINT64(irp->input); /* AllocationSize (8 bytes) */ + Stream_Seek_UINT32(irp->input); /* FileAttributes (4 bytes) */ + Stream_Read_UINT32(irp->input, SharedAccess); /* SharedAccess (4 bytes) */ + Stream_Read_UINT32(irp->input, CreateDisposition); /* CreateDisposition (4 bytes) */ + Stream_Seek_UINT32(irp->input); /* CreateOptions (4 bytes) */ + Stream_Read_UINT32(irp->input, PathLength); /* PathLength (4 bytes) */ if (Stream_GetRemainingLength(irp->input) < PathLength) return ERROR_INVALID_DATA; - Stream_Seek(irp->input, PathLength); /* Path (variable) */ - assert(PathLength == 0); /* MS-RDPESP 2.2.2.2 */ + Stream_Seek(irp->input, PathLength); /* Path (variable) */ + assert(PathLength == 0); /* MS-RDPESP 2.2.2.2 */ #ifndef _WIN32 /* Windows 2012 server sends on a first call : * DesiredAccess = 0x00100080: SYNCHRONIZE | FILE_READ_ATTRIBUTES @@ -154,9 +154,9 @@ static UINT serial_process_irp_create(SERIAL_DEVICE* serial, IRP* irp) * CreateDisposition = 0x00000001: CREATE_NEW * * then Windows 2012 sends : - * DesiredAccess = 0x00120089: SYNCHRONIZE | READ_CONTROL | FILE_READ_ATTRIBUTES | FILE_READ_EA | FILE_READ_DATA - * SharedAccess = 0x00000007: FILE_SHARE_DELETE | FILE_SHARE_WRITE | FILE_SHARE_READ - * CreateDisposition = 0x00000001: CREATE_NEW + * DesiredAccess = 0x00120089: SYNCHRONIZE | READ_CONTROL | FILE_READ_ATTRIBUTES | + * FILE_READ_EA | FILE_READ_DATA SharedAccess = 0x00000007: FILE_SHARE_DELETE | + * FILE_SHARE_WRITE | FILE_SHARE_READ CreateDisposition = 0x00000001: CREATE_NEW * * assert(DesiredAccess == (GENERIC_READ | GENERIC_WRITE)); * assert(SharedAccess == 0); @@ -164,24 +164,22 @@ static UINT serial_process_irp_create(SERIAL_DEVICE* serial, IRP* irp) * */ WLog_Print(serial->log, WLOG_DEBUG, - "DesiredAccess: 0x%"PRIX32", SharedAccess: 0x%"PRIX32", CreateDisposition: 0x%"PRIX32"", + "DesiredAccess: 0x%" PRIX32 ", SharedAccess: 0x%" PRIX32 + ", CreateDisposition: 0x%" PRIX32 "", DesiredAccess, SharedAccess, CreateDisposition); /* FIXME: As of today only the flags below are supported by CommCreateFileA: */ - DesiredAccess = GENERIC_READ | GENERIC_WRITE; - SharedAccess = 0; + DesiredAccess = GENERIC_READ | GENERIC_WRITE; + SharedAccess = 0; CreateDisposition = OPEN_EXISTING; #endif - serial->hComm = CreateFile(serial->device.name, - DesiredAccess, - SharedAccess, - NULL, /* SecurityAttributes */ - CreateDisposition, - 0, /* FlagsAndAttributes */ - NULL); /* TemplateFile */ + serial->hComm = + CreateFile(serial->device.name, DesiredAccess, SharedAccess, NULL, /* SecurityAttributes */ + CreateDisposition, 0, /* FlagsAndAttributes */ + NULL); /* TemplateFile */ if (!serial->hComm || (serial->hComm == INVALID_HANDLE_VALUE)) { - WLog_Print(serial->log, WLOG_WARN, "CreateFile failure: %s last-error: 0x%08"PRIX32"", + WLog_Print(serial->log, WLOG_WARN, "CreateFile failure: %s last-error: 0x%08" PRIX32 "", serial->device.name, GetLastError()); irp->IoStatus = STATUS_UNSUCCESSFUL; goto error_handle; @@ -200,11 +198,11 @@ static UINT serial_process_irp_create(SERIAL_DEVICE* serial, IRP* irp) assert(irp->FileId == 0); irp->FileId = irp->devman->id_sequence++; /* FIXME: why not ((WINPR_COMM*)hComm)->fd? */ irp->IoStatus = STATUS_SUCCESS; - WLog_Print(serial->log, WLOG_DEBUG, "%s (DeviceId: %"PRIu32", FileId: %"PRIu32") created.", + WLog_Print(serial->log, WLOG_DEBUG, "%s (DeviceId: %" PRIu32 ", FileId: %" PRIu32 ") created.", serial->device.name, irp->device->id, irp->FileId); error_handle: - Stream_Write_UINT32(irp->output, irp->FileId); /* FileId (4 bytes) */ - Stream_Write_UINT8(irp->output, 0); /* Information (1 byte) */ + Stream_Write_UINT32(irp->output, irp->FileId); /* FileId (4 bytes) */ + Stream_Write_UINT8(irp->output, 0); /* Information (1 byte) */ return CHANNEL_RC_OK; } @@ -217,13 +215,13 @@ static UINT serial_process_irp_close(SERIAL_DEVICE* serial, IRP* irp) if (!CloseHandle(serial->hComm)) { - WLog_Print(serial->log, WLOG_WARN, "CloseHandle failure: %s (%"PRIu32") closed.", + WLog_Print(serial->log, WLOG_WARN, "CloseHandle failure: %s (%" PRIu32 ") closed.", serial->device.name, irp->device->id); irp->IoStatus = STATUS_UNSUCCESSFUL; goto error_handle; } - WLog_Print(serial->log, WLOG_DEBUG, "%s (DeviceId: %"PRIu32", FileId: %"PRIu32") closed.", + WLog_Print(serial->log, WLOG_DEBUG, "%s (DeviceId: %" PRIu32 ", FileId: %" PRIu32 ") closed.", serial->device.name, irp->device->id, irp->FileId); serial->hComm = NULL; irp->IoStatus = STATUS_SUCCESS; @@ -249,7 +247,7 @@ static UINT serial_process_irp_read(SERIAL_DEVICE* serial, IRP* irp) Stream_Read_UINT32(irp->input, Length); /* Length (4 bytes) */ Stream_Read_UINT64(irp->input, Offset); /* Offset (8 bytes) */ - Stream_Seek(irp->input, 20); /* Padding (20 bytes) */ + Stream_Seek(irp->input, 20); /* Padding (20 bytes) */ buffer = (BYTE*)calloc(Length, sizeof(BYTE)); if (buffer == NULL) @@ -261,7 +259,7 @@ static UINT serial_process_irp_read(SERIAL_DEVICE* serial, IRP* irp) /* MS-RDPESP 3.2.5.1.4: If the Offset field is not set to 0, the value MUST be ignored * assert(Offset == 0); */ - WLog_Print(serial->log, WLOG_DEBUG, "reading %"PRIu32" bytes from %s", Length, + WLog_Print(serial->log, WLOG_DEBUG, "reading %" PRIu32 " bytes from %s", Length, serial->device.name); /* FIXME: CommReadFile to be replaced by ReadFile */ @@ -272,12 +270,12 @@ static UINT serial_process_irp_read(SERIAL_DEVICE* serial, IRP* irp) else { WLog_Print(serial->log, WLOG_DEBUG, - "read failure to %s, nbRead=%"PRIu32", last-error: 0x%08"PRIX32"", serial->device.name, - nbRead, GetLastError()); + "read failure to %s, nbRead=%" PRIu32 ", last-error: 0x%08" PRIX32 "", + serial->device.name, nbRead, GetLastError()); irp->IoStatus = _GetLastErrorToIoStatus(serial); } - WLog_Print(serial->log, WLOG_DEBUG, "%"PRIu32" bytes read from %s", nbRead, + WLog_Print(serial->log, WLOG_DEBUG, "%" PRIu32 " bytes read from %s", nbRead, serial->device.name); error_handle: Stream_Write_UINT32(irp->output, nbRead); /* Length (4 bytes) */ @@ -309,38 +307,36 @@ static UINT serial_process_irp_write(SERIAL_DEVICE* serial, IRP* irp) Stream_Read_UINT32(irp->input, Length); /* Length (4 bytes) */ Stream_Read_UINT64(irp->input, Offset); /* Offset (8 bytes) */ - Stream_Seek(irp->input, 20); /* Padding (20 bytes) */ + Stream_Seek(irp->input, 20); /* Padding (20 bytes) */ /* MS-RDPESP 3.2.5.1.5: The Offset field is ignored * assert(Offset == 0); * * Using a serial printer, noticed though this field could be * set. */ - WLog_Print(serial->log, WLOG_DEBUG, "writing %"PRIu32" bytes to %s", Length, + WLog_Print(serial->log, WLOG_DEBUG, "writing %" PRIu32 " bytes to %s", Length, serial->device.name); /* FIXME: CommWriteFile to be replaced by WriteFile */ - if (CommWriteFile(serial->hComm, Stream_Pointer(irp->input), Length, &nbWritten, - NULL)) + if (CommWriteFile(serial->hComm, Stream_Pointer(irp->input), Length, &nbWritten, NULL)) { irp->IoStatus = STATUS_SUCCESS; } else { WLog_Print(serial->log, WLOG_DEBUG, - "write failure to %s, nbWritten=%"PRIu32", last-error: 0x%08"PRIX32"", serial->device.name, - nbWritten, GetLastError()); + "write failure to %s, nbWritten=%" PRIu32 ", last-error: 0x%08" PRIX32 "", + serial->device.name, nbWritten, GetLastError()); irp->IoStatus = _GetLastErrorToIoStatus(serial); } - WLog_Print(serial->log, WLOG_DEBUG, "%"PRIu32" bytes written to %s", nbWritten, + WLog_Print(serial->log, WLOG_DEBUG, "%" PRIu32 " bytes written to %s", nbWritten, serial->device.name); Stream_Write_UINT32(irp->output, nbWritten); /* Length (4 bytes) */ - Stream_Write_UINT8(irp->output, 0); /* Padding (1 byte) */ + Stream_Write_UINT8(irp->output, 0); /* Padding (1 byte) */ return CHANNEL_RC_OK; } - /** * Function description * @@ -350,18 +346,18 @@ static UINT serial_process_irp_device_control(SERIAL_DEVICE* serial, IRP* irp) { UINT32 IoControlCode; UINT32 InputBufferLength; - BYTE* InputBuffer = NULL; + BYTE* InputBuffer = NULL; UINT32 OutputBufferLength; - BYTE* OutputBuffer = NULL; - DWORD BytesReturned = 0; + BYTE* OutputBuffer = NULL; + DWORD BytesReturned = 0; if (Stream_GetRemainingLength(irp->input) < 32) return ERROR_INVALID_DATA; Stream_Read_UINT32(irp->input, OutputBufferLength); /* OutputBufferLength (4 bytes) */ - Stream_Read_UINT32(irp->input, InputBufferLength); /* InputBufferLength (4 bytes) */ - Stream_Read_UINT32(irp->input, IoControlCode); /* IoControlCode (4 bytes) */ - Stream_Seek(irp->input, 20); /* Padding (20 bytes) */ + Stream_Read_UINT32(irp->input, InputBufferLength); /* InputBufferLength (4 bytes) */ + Stream_Read_UINT32(irp->input, IoControlCode); /* IoControlCode (4 bytes) */ + Stream_Seek(irp->input, 20); /* Padding (20 bytes) */ if (Stream_GetRemainingLength(irp->input) < InputBufferLength) return ERROR_INVALID_DATA; @@ -384,20 +380,23 @@ static UINT serial_process_irp_device_control(SERIAL_DEVICE* serial, IRP* irp) Stream_Read(irp->input, InputBuffer, InputBufferLength); WLog_Print(serial->log, WLOG_DEBUG, - "CommDeviceIoControl: CompletionId=%"PRIu32", IoControlCode=[0x%"PRIX32"] %s", + "CommDeviceIoControl: CompletionId=%" PRIu32 ", IoControlCode=[0x%" PRIX32 "] %s", irp->CompletionId, IoControlCode, _comm_serial_ioctl_name(IoControlCode)); /* FIXME: CommDeviceIoControl to be replaced by DeviceIoControl() */ - if (CommDeviceIoControl(serial->hComm, IoControlCode, InputBuffer, - InputBufferLength, OutputBuffer, OutputBufferLength, &BytesReturned, NULL)) + if (CommDeviceIoControl(serial->hComm, IoControlCode, InputBuffer, InputBufferLength, + OutputBuffer, OutputBufferLength, &BytesReturned, NULL)) { - /* WLog_Print(serial->log, WLOG_DEBUG, "CommDeviceIoControl: CompletionId=%"PRIu32", IoControlCode=[0x%"PRIX32"] %s done", irp->CompletionId, IoControlCode, _comm_serial_ioctl_name(IoControlCode)); */ + /* WLog_Print(serial->log, WLOG_DEBUG, "CommDeviceIoControl: CompletionId=%"PRIu32", + * IoControlCode=[0x%"PRIX32"] %s done", irp->CompletionId, IoControlCode, + * _comm_serial_ioctl_name(IoControlCode)); */ irp->IoStatus = STATUS_SUCCESS; } else { WLog_Print(serial->log, WLOG_DEBUG, - "CommDeviceIoControl failure: IoControlCode=[0x%"PRIX32"] %s, last-error: 0x%08"PRIX32"", + "CommDeviceIoControl failure: IoControlCode=[0x%" PRIX32 + "] %s, last-error: 0x%08" PRIX32 "", IoControlCode, _comm_serial_ioctl_name(IoControlCode), GetLastError()); irp->IoStatus = _GetLastErrorToIoStatus(serial); } @@ -444,7 +443,7 @@ static UINT serial_process_irp(SERIAL_DEVICE* serial, IRP* irp) { UINT error = CHANNEL_RC_OK; WLog_Print(serial->log, WLOG_DEBUG, - "IRP MajorFunction: 0x%08"PRIX32" MinorFunction: 0x%08"PRIX32"\n", + "IRP MajorFunction: 0x%08" PRIX32 " MinorFunction: 0x%08" PRIX32 "\n", irp->MajorFunction, irp->MinorFunction); switch (irp->MajorFunction) @@ -459,7 +458,7 @@ static UINT serial_process_irp(SERIAL_DEVICE* serial, IRP* irp) case IRP_MJ_READ: if ((error = serial_process_irp_read(serial, irp))) - WLog_ERR(TAG, "serial_process_irp_read failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "serial_process_irp_read failed with error %" PRIu32 "!", error); break; @@ -469,7 +468,7 @@ static UINT serial_process_irp(SERIAL_DEVICE* serial, IRP* irp) case IRP_MJ_DEVICE_CONTROL: if ((error = serial_process_irp_device_control(serial, irp))) - WLog_ERR(TAG, "serial_process_irp_device_control failed with error %"PRIu32"!", + WLog_ERR(TAG, "serial_process_irp_device_control failed with error %" PRIu32 "!", error); break; @@ -482,7 +481,6 @@ static UINT serial_process_irp(SERIAL_DEVICE* serial, IRP* irp) return error; } - static DWORD WINAPI irp_thread_func(LPVOID arg) { IRP_THREAD_DATA* data = (IRP_THREAD_DATA*)arg; @@ -491,7 +489,7 @@ static DWORD WINAPI irp_thread_func(LPVOID arg) /* blocks until the end of the request */ if ((error = serial_process_irp(data->serial, data->irp))) { - WLog_ERR(TAG, "serial_process_irp failed with error %"PRIu32"", error); + WLog_ERR(TAG, "serial_process_irp failed with error %" PRIu32 "", error); goto error_out; } @@ -502,8 +500,7 @@ static DWORD WINAPI irp_thread_func(LPVOID arg) error_out: if (error && data->serial->rdpcontext) - setChannelError(data->serial->rdpcontext, error, - "irp_thread_func reported an error"); + setChannelError(data->serial->rdpcontext, error, "irp_thread_func reported an error"); /* NB: At this point, the server might already being reusing * the CompletionId whereas the thread is not yet @@ -513,7 +510,6 @@ error_out: return error; } - static void create_irp_thread(SERIAL_DEVICE* serial, IRP* irp) { IRP_THREAD_DATA* data = NULL; @@ -547,13 +543,15 @@ static void create_irp_thread(SERIAL_DEVICE* serial, IRP* irp) DWORD waitResult; ULONG_PTR id = ids[i]; irpThread = ListDictionary_GetItemValue(serial->IrpThreads, (void*)id); - /* FIXME: not quite sure a zero timeout is a good thing to check whether a thread is stil alived or not */ + /* FIXME: not quite sure a zero timeout is a good thing to check whether a thread is + * stil alived or not */ waitResult = WaitForSingleObject(irpThread, 0); if (waitResult == WAIT_OBJECT_0) { /* terminating thread */ - /* WLog_Print(serial->log, WLOG_DEBUG, "IRP thread with CompletionId=%"PRIuz" naturally died", id); */ + /* WLog_Print(serial->log, WLOG_DEBUG, "IRP thread with CompletionId=%"PRIuz" + * naturally died", id); */ CloseHandle(irpThread); ListDictionary_Remove(serial->IrpThreads, (void*)id); serial->IrpThreadToBeTerminatedCount--; @@ -562,7 +560,8 @@ static void create_irp_thread(SERIAL_DEVICE* serial, IRP* irp) { /* unexpected thread state */ WLog_Print(serial->log, WLOG_WARN, - "WaitForSingleObject, got an unexpected result=0x%"PRIX32"\n", waitResult); + "WaitForSingleObject, got an unexpected result=0x%" PRIX32 "\n", + waitResult); assert(FALSE); } @@ -571,7 +570,7 @@ static void create_irp_thread(SERIAL_DEVICE* serial, IRP* irp) if (serial->IrpThreadToBeTerminatedCount > 0) { - WLog_Print(serial->log, WLOG_DEBUG, "%"PRIu32" IRP thread(s) not yet terminated", + WLog_Print(serial->log, WLOG_DEBUG, "%" PRIu32 " IRP thread(s) not yet terminated", serial->IrpThreadToBeTerminatedCount); Sleep(1); /* 1 ms */ } @@ -597,7 +596,7 @@ static void create_irp_thread(SERIAL_DEVICE* serial, IRP* irp) { /* Thread still alived <=> Request still pending */ WLog_Print(serial->log, WLOG_DEBUG, - "IRP recall: IRP with the CompletionId=%"PRIu32" not yet completed!", + "IRP recall: IRP with the CompletionId=%" PRIu32 " not yet completed!", irp->CompletionId); assert(FALSE); /* unimplemented */ /* TODO: asserts that previousIrpThread handles well @@ -623,11 +622,11 @@ static void create_irp_thread(SERIAL_DEVICE* serial, IRP* irp) "Number of IRP threads threshold reached: %d, keep on anyway", ListDictionary_Count(serial->IrpThreads)); assert(FALSE); /* unimplemented */ - /* TODO: MAX_IRP_THREADS has been thought to avoid a - * flooding of pending requests. Use - * WaitForMultipleObjects() when available in winpr - * for threads. - */ + /* TODO: MAX_IRP_THREADS has been thought to avoid a + * flooding of pending requests. Use + * WaitForMultipleObjects() when available in winpr + * for threads. + */ } /* error_handle to be used ... */ @@ -642,12 +641,7 @@ static void create_irp_thread(SERIAL_DEVICE* serial, IRP* irp) data->serial = serial; data->irp = irp; /* data freed by irp_thread_func */ - irpThread = CreateThread(NULL, - 0, - irp_thread_func, - (void*)data, - 0, - NULL); + irpThread = CreateThread(NULL, 0, irp_thread_func, (void*)data, 0, NULL); if (irpThread == INVALID_HANDLE_VALUE) { @@ -670,7 +664,6 @@ error_handle: free(data); } - static void terminate_pending_irp_threads(SERIAL_DEVICE* serial) { ULONG_PTR* ids; @@ -692,19 +685,18 @@ static void terminate_pending_irp_threads(SERIAL_DEVICE* serial) } CloseHandle(irpThread); - WLog_Print(serial->log, WLOG_DEBUG, "IRP thread terminated, CompletionId %p", (void*) id); + WLog_Print(serial->log, WLOG_DEBUG, "IRP thread terminated, CompletionId %p", (void*)id); } ListDictionary_Clear(serial->IrpThreads); free(ids); } - static DWORD WINAPI serial_thread_func(LPVOID arg) { IRP* irp; wMessage message; - SERIAL_DEVICE* serial = (SERIAL_DEVICE*) arg; + SERIAL_DEVICE* serial = (SERIAL_DEVICE*)arg; UINT error = CHANNEL_RC_OK; while (1) @@ -729,21 +721,19 @@ static DWORD WINAPI serial_thread_func(LPVOID arg) break; } - irp = (IRP*) message.wParam; + irp = (IRP*)message.wParam; if (irp) create_irp_thread(serial, irp); } if (error && serial->rdpcontext) - setChannelError(serial->rdpcontext, error, - "serial_thread_func reported an error"); + setChannelError(serial->rdpcontext, error, "serial_thread_func reported an error"); ExitThread(error); return error; } - /** * Function description * @@ -751,7 +741,7 @@ static DWORD WINAPI serial_thread_func(LPVOID arg) */ static UINT serial_irp_request(DEVICE* device, IRP* irp) { - SERIAL_DEVICE* serial = (SERIAL_DEVICE*) device; + SERIAL_DEVICE* serial = (SERIAL_DEVICE*)device; assert(irp != NULL); if (irp == NULL) @@ -762,7 +752,7 @@ static UINT serial_irp_request(DEVICE* device, IRP* irp) * write requests. */ - if (!MessageQueue_Post(serial->MainIrpQueue, NULL, 0, (void*) irp, NULL)) + if (!MessageQueue_Post(serial->MainIrpQueue, NULL, 0, (void*)irp, NULL)) { WLog_ERR(TAG, "MessageQueue_Post failed!"); return ERROR_INTERNAL_ERROR; @@ -771,7 +761,6 @@ static UINT serial_irp_request(DEVICE* device, IRP* irp) return CHANNEL_RC_OK; } - /** * Function description * @@ -780,14 +769,14 @@ static UINT serial_irp_request(DEVICE* device, IRP* irp) static UINT serial_free(DEVICE* device) { UINT error; - SERIAL_DEVICE* serial = (SERIAL_DEVICE*) device; + SERIAL_DEVICE* serial = (SERIAL_DEVICE*)device; WLog_Print(serial->log, WLOG_DEBUG, "freeing"); MessageQueue_PostQuit(serial->MainIrpQueue, 0); if (WaitForSingleObject(serial->MainThread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); return error; } @@ -808,9 +797,9 @@ static UINT serial_free(DEVICE* device) #endif /* __linux__ */ #ifdef BUILTIN_CHANNELS -#define DeviceServiceEntry serial_DeviceServiceEntry +#define DeviceServiceEntry serial_DeviceServiceEntry #else -#define DeviceServiceEntry FREERDP_API DeviceServiceEntry +#define DeviceServiceEntry FREERDP_API DeviceServiceEntry #endif /** @@ -829,7 +818,7 @@ UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) SERIAL_DEVICE* serial; #endif /* __linux__ */ UINT error = CHANNEL_RC_OK; - device = (RDPDR_SERIAL*) pEntryPoints->device; + device = (RDPDR_SERIAL*)pEntryPoints->device; name = device->Name; path = device->Path; driver = device->Driver; @@ -846,8 +835,7 @@ UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) log = WLog_Get("com.freerdp.channel.serial.client"); WLog_Print(log, WLOG_DEBUG, "initializing"); #ifndef __linux__ /* to be removed */ - WLog_Print(log, WLOG_WARN, - "Serial ports redirection not supported on this platform."); + WLog_Print(log, WLOG_WARN, "Serial ports redirection not supported on this platform."); return CHANNEL_RC_INITIALIZATION_ERROR; #else /* __linux __ */ WLog_Print(log, WLOG_DEBUG, "Defining %s as %s", name, path); @@ -855,11 +843,11 @@ UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) if (!DefineCommDevice(name /* eg: COM1 */, path /* eg: /dev/ttyS0 */)) { DWORD status = GetLastError(); - WLog_ERR(TAG, "DefineCommDevice failed with %08"PRIx32, status); + WLog_ERR(TAG, "DefineCommDevice failed with %08" PRIx32, status); return ERROR_INTERNAL_ERROR; } - serial = (SERIAL_DEVICE*) calloc(1, sizeof(SERIAL_DEVICE)); + serial = (SERIAL_DEVICE*)calloc(1, sizeof(SERIAL_DEVICE)); if (!serial) { @@ -921,8 +909,8 @@ UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) } } - WLog_Print(serial->log, WLOG_DEBUG, "Server's serial driver: %s (id: %d)", - driver, serial->ServerSerialDriverId); + WLog_Print(serial->log, WLOG_DEBUG, "Server's serial driver: %s (id: %d)", driver, + serial->ServerSerialDriverId); /* TODO: implement auto detection of the server's serial driver */ serial->MainIrpQueue = MessageQueue_New(NULL); @@ -946,19 +934,14 @@ UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) serial->IrpThreadToBeTerminatedCount = 0; InitializeCriticalSection(&serial->TerminatingIrpThreadsLock); - if ((error = pEntryPoints->RegisterDevice(pEntryPoints->devman, - (DEVICE*) serial))) + if ((error = pEntryPoints->RegisterDevice(pEntryPoints->devman, (DEVICE*)serial))) { - WLog_ERR(TAG, "EntryPoints->RegisterDevice failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "EntryPoints->RegisterDevice failed with error %" PRIu32 "!", error); goto error_out; } - if (!(serial->MainThread = CreateThread(NULL, - 0, - serial_thread_func, - (void*) serial, - 0, - NULL))) + if (!(serial->MainThread = + CreateThread(NULL, 0, serial_thread_func, (void*)serial, 0, NULL))) { WLog_ERR(TAG, "CreateThread failed!"); error = ERROR_INTERNAL_ERROR; diff --git a/channels/server/channels.h b/channels/server/channels.h index f054c919f..a6c4791ca 100644 --- a/channels/server/channels.h +++ b/channels/server/channels.h @@ -21,6 +21,4 @@ #ifndef FREERDP_CHANNEL_SERVER_CHANNELS_H #define FREERDP_CHANNEL_SERVER_CHANNELS_H - - #endif /* FREERDP_CHANNEL_SERVER_CHANNELS_H */ diff --git a/channels/smartcard/client/smartcard_main.c b/channels/smartcard/client/smartcard_main.c index 134c021f8..fb79fb151 100644 --- a/channels/smartcard/client/smartcard_main.c +++ b/channels/smartcard/client/smartcard_main.c @@ -39,7 +39,7 @@ static SMARTCARD_DEVICE* sSmartcard = NULL; static SMARTCARD_DEVICE* cast_device_from(DEVICE* device, const char* fkt, const char* file, - int line) + int line) { if (!device) { @@ -49,7 +49,7 @@ static SMARTCARD_DEVICE* cast_device_from(DEVICE* device, const char* fkt, const if (device->type != RDPDR_DTYP_SMARTCARD) { - WLog_ERR(TAG, "%s [%s:%d] Called smartcard channel with invalid device of type %"PRIx32, + WLog_ERR(TAG, "%s [%s:%d] Called smartcard channel with invalid device of type %" PRIx32, fkt, file, line, device->type); return NULL; } @@ -79,7 +79,7 @@ static DWORD WINAPI smartcard_context_thread(LPVOID arg) if (waitStatus == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "!", error); break; } @@ -88,7 +88,7 @@ static DWORD WINAPI smartcard_context_thread(LPVOID arg) if (waitStatus == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); break; } @@ -104,18 +104,18 @@ static DWORD WINAPI smartcard_context_thread(LPVOID arg) if (message.id == WMQ_QUIT) break; - operation = (SMARTCARD_OPERATION*) message.wParam; + operation = (SMARTCARD_OPERATION*)message.wParam; if (operation) { if ((status = smartcard_irp_device_control_call(smartcard, operation))) { - WLog_ERR(TAG, "smartcard_irp_device_control_call failed with error %"PRIu32"", + WLog_ERR(TAG, "smartcard_irp_device_control_call failed with error %" PRIu32 "", status); break; } - if (!Queue_Enqueue(smartcard->CompletedIrpQueue, (void*) operation->irp)) + if (!Queue_Enqueue(smartcard->CompletedIrpQueue, (void*)operation->irp)) { WLog_ERR(TAG, "Queue_Enqueue failed!"); status = ERROR_INTERNAL_ERROR; @@ -128,18 +128,16 @@ static DWORD WINAPI smartcard_context_thread(LPVOID arg) } if (status && smartcard->rdpcontext) - setChannelError(smartcard->rdpcontext, error, - "smartcard_context_thread reported an error"); + setChannelError(smartcard->rdpcontext, error, "smartcard_context_thread reported an error"); ExitThread(status); return error; } -SMARTCARD_CONTEXT* smartcard_context_new(SMARTCARD_DEVICE* smartcard, - SCARDCONTEXT hContext) +SMARTCARD_CONTEXT* smartcard_context_new(SMARTCARD_DEVICE* smartcard, SCARDCONTEXT hContext) { SMARTCARD_CONTEXT* pContext; - pContext = (SMARTCARD_CONTEXT*) calloc(1, sizeof(SMARTCARD_CONTEXT)); + pContext = (SMARTCARD_CONTEXT*)calloc(1, sizeof(SMARTCARD_CONTEXT)); if (!pContext) { @@ -157,9 +155,7 @@ SMARTCARD_CONTEXT* smartcard_context_new(SMARTCARD_DEVICE* smartcard, goto error_irpqueue; } - pContext->thread = CreateThread(NULL, 0, - smartcard_context_thread, - pContext, 0, NULL); + pContext->thread = CreateThread(NULL, 0, smartcard_context_thread, pContext, 0, NULL); if (!pContext->thread) { @@ -185,9 +181,9 @@ void smartcard_context_free(void* pCtx) /* cancel blocking calls like SCardGetStatusChange */ SCardCancel(pContext->hContext); - if (MessageQueue_PostQuit(pContext->IrpQueue, 0) - && (WaitForSingleObject(pContext->thread, INFINITE) == WAIT_FAILED)) - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", GetLastError()); + if (MessageQueue_PostQuit(pContext->IrpQueue, 0) && + (WaitForSingleObject(pContext->thread, INFINITE) == WAIT_FAILED)) + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", GetLastError()); CloseHandle(pContext->thread); MessageQueue_Free(pContext->IrpQueue); @@ -204,8 +200,9 @@ static void smartcard_release_all_contexts(SMARTCARD_DEVICE* smartcard) /** * On protocol termination, the following actions are performed: - * For each context in rgSCardContextList, SCardCancel is called causing all SCardGetStatusChange calls to be processed. - * After that, SCardReleaseContext is called on each context and the context MUST be removed from rgSCardContextList. + * For each context in rgSCardContextList, SCardCancel is called causing all + * SCardGetStatusChange calls to be processed. After that, SCardReleaseContext is called on each + * context and the context MUST be removed from rgSCardContextList. */ /** @@ -219,8 +216,8 @@ static void smartcard_release_all_contexts(SMARTCARD_DEVICE* smartcard) for (index = 0; index < keyCount; index++) { - pContext = (SMARTCARD_CONTEXT*) ListDictionary_GetItemValue( - smartcard->rgSCardContextList, (void*) pKeys[index]); + pContext = (SMARTCARD_CONTEXT*)ListDictionary_GetItemValue( + smartcard->rgSCardContextList, (void*)pKeys[index]); if (!pContext) continue; @@ -247,8 +244,8 @@ static void smartcard_release_all_contexts(SMARTCARD_DEVICE* smartcard) for (index = 0; index < keyCount; index++) { - pContext = (SMARTCARD_CONTEXT*) ListDictionary_Remove( - smartcard->rgSCardContextList, (void*) pKeys[index]); + pContext = (SMARTCARD_CONTEXT*)ListDictionary_Remove(smartcard->rgSCardContextList, + (void*)pKeys[index]); if (!pContext) continue; @@ -259,9 +256,10 @@ static void smartcard_release_all_contexts(SMARTCARD_DEVICE* smartcard) { SCardReleaseContext(hContext); - if (MessageQueue_PostQuit(pContext->IrpQueue, 0) - && (WaitForSingleObject(pContext->thread, INFINITE) == WAIT_FAILED)) - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", GetLastError()); + if (MessageQueue_PostQuit(pContext->IrpQueue, 0) && + (WaitForSingleObject(pContext->thread, INFINITE) == WAIT_FAILED)) + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", + GetLastError()); CloseHandle(pContext->thread); MessageQueue_Free(pContext->IrpQueue); @@ -319,11 +317,11 @@ static UINT smartcard_free(DEVICE* device) if (smartcard->IrpQueue) { - if (MessageQueue_PostQuit(smartcard->IrpQueue, 0) - && (WaitForSingleObject(smartcard->thread, INFINITE) == WAIT_FAILED)) + if (MessageQueue_PostQuit(smartcard->IrpQueue, 0) && + (WaitForSingleObject(smartcard->thread, INFINITE) == WAIT_FAILED)) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); return error; } } @@ -363,7 +361,7 @@ static UINT smartcard_init(DEVICE* device) static UINT smartcard_complete_irp(SMARTCARD_DEVICE* smartcard, IRP* irp) { void* key; - key = (void*)(size_t) irp->CompletionId; + key = (void*)(size_t)irp->CompletionId; ListDictionary_Remove(smartcard->rgOutstandingMessages, key); return irp->Complete(irp); } @@ -385,7 +383,7 @@ static UINT smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp) BOOL asyncIrp = FALSE; SMARTCARD_CONTEXT* pContext = NULL; SMARTCARD_OPERATION* operation = NULL; - key = (void*)(size_t) irp->CompletionId; + key = (void*)(size_t)irp->CompletionId; if (!ListDictionary_Add(smartcard->rgOutstandingMessages, key, irp)) { @@ -395,7 +393,7 @@ static UINT smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp) if (irp->MajorFunction == IRP_MJ_DEVICE_CONTROL) { - operation = (SMARTCARD_OPERATION*) calloc(1, sizeof(SMARTCARD_OPERATION)); + operation = (SMARTCARD_OPERATION*)calloc(1, sizeof(SMARTCARD_OPERATION)); if (!operation) { @@ -410,7 +408,7 @@ static UINT smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp) { irp->IoStatus = (UINT32)STATUS_UNSUCCESSFUL; - if (!Queue_Enqueue(smartcard->CompletedIrpQueue, (void*) irp)) + if (!Queue_Enqueue(smartcard->CompletedIrpQueue, (void*)irp)) { free(operation); WLog_ERR(TAG, "Queue_Enqueue failed!"); @@ -480,8 +478,8 @@ static UINT smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp) break; } - pContext = ListDictionary_GetItemValue(smartcard->rgSCardContextList, - (void*) operation->hContext); + pContext = + ListDictionary_GetItemValue(smartcard->rgSCardContextList, (void*)operation->hContext); if (!pContext) asyncIrp = FALSE; @@ -490,12 +488,12 @@ static UINT smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp) { if ((status = smartcard_irp_device_control_call(smartcard, operation))) { - WLog_ERR(TAG, "smartcard_irp_device_control_call failed with error %"PRId32"!", + WLog_ERR(TAG, "smartcard_irp_device_control_call failed with error %" PRId32 "!", status); return (UINT32)status; } - if (!Queue_Enqueue(smartcard->CompletedIrpQueue, (void*) irp)) + if (!Queue_Enqueue(smartcard->CompletedIrpQueue, (void*)irp)) { free(operation); WLog_ERR(TAG, "Queue_Enqueue failed!"); @@ -508,7 +506,7 @@ static UINT smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp) { if (pContext) { - if (!MessageQueue_Post(pContext->IrpQueue, NULL, 0, (void*) operation, NULL)) + if (!MessageQueue_Post(pContext->IrpQueue, NULL, 0, (void*)operation, NULL)) { WLog_ERR(TAG, "MessageQueue_Post failed!"); return ERROR_INTERNAL_ERROR; @@ -519,11 +517,12 @@ static UINT smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp) else { WLog_ERR(TAG, - "Unexpected SmartCard IRP: MajorFunction 0x%08"PRIX32" MinorFunction: 0x%08"PRIX32"", + "Unexpected SmartCard IRP: MajorFunction 0x%08" PRIX32 + " MinorFunction: 0x%08" PRIX32 "", irp->MajorFunction, irp->MinorFunction); irp->IoStatus = (UINT32)STATUS_NOT_SUPPORTED; - if (!Queue_Enqueue(smartcard->CompletedIrpQueue, (void*) irp)) + if (!Queue_Enqueue(smartcard->CompletedIrpQueue, (void*)irp)) { WLog_ERR(TAG, "Queue_Enqueue failed!"); return ERROR_INTERNAL_ERROR; @@ -557,7 +556,7 @@ static DWORD WINAPI smartcard_thread_func(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "!", error); break; } @@ -566,7 +565,7 @@ static DWORD WINAPI smartcard_thread_func(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); break; } @@ -588,14 +587,14 @@ static DWORD WINAPI smartcard_thread_func(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); goto out; } if (status == WAIT_TIMEOUT) break; - irp = (IRP*) Queue_Dequeue(smartcard->CompletedIrpQueue); + irp = (IRP*)Queue_Dequeue(smartcard->CompletedIrpQueue); if (irp) { @@ -606,7 +605,8 @@ static DWORD WINAPI smartcard_thread_func(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", + error); goto out; } @@ -616,7 +616,8 @@ static DWORD WINAPI smartcard_thread_func(LPVOID arg) if ((error = smartcard_complete_irp(smartcard, irp))) { - WLog_ERR(TAG, "smartcard_complete_irp failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "smartcard_complete_irp failed with error %" PRIu32 "!", + error); goto out; } } @@ -625,13 +626,13 @@ static DWORD WINAPI smartcard_thread_func(LPVOID arg) break; } - irp = (IRP*) message.wParam; + irp = (IRP*)message.wParam; if (irp) { if ((error = smartcard_process_irp(smartcard, irp))) { - WLog_ERR(TAG, "smartcard_process_irp failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "smartcard_process_irp failed with error %" PRIu32 "!", error); goto out; } } @@ -642,13 +643,13 @@ static DWORD WINAPI smartcard_thread_func(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); break; } if (status == WAIT_OBJECT_0) { - irp = (IRP*) Queue_Dequeue(smartcard->CompletedIrpQueue); + irp = (IRP*)Queue_Dequeue(smartcard->CompletedIrpQueue); if (irp) { @@ -659,7 +660,7 @@ static DWORD WINAPI smartcard_thread_func(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); break; } @@ -675,7 +676,7 @@ static DWORD WINAPI smartcard_thread_func(LPVOID arg) goto out; } - WLog_ERR(TAG, "smartcard_complete_irp failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "smartcard_complete_irp failed with error %" PRIu32 "!", error); goto out; } } @@ -685,8 +686,7 @@ static DWORD WINAPI smartcard_thread_func(LPVOID arg) out: if (error && smartcard->rdpcontext) - setChannelError(smartcard->rdpcontext, error, - "smartcard_thread_func reported an error"); + setChannelError(smartcard->rdpcontext, error, "smartcard_thread_func reported an error"); ExitThread(error); return error; @@ -704,7 +704,7 @@ static UINT smartcard_irp_request(DEVICE* device, IRP* irp) if (!smartcard) return ERROR_INVALID_PARAMETER; - if (!MessageQueue_Post(smartcard->IrpQueue, NULL, 0, (void*) irp, NULL)) + if (!MessageQueue_Post(smartcard->IrpQueue, NULL, 0, (void*)irp, NULL)) { WLog_ERR(TAG, "MessageQueue_Post failed!"); return ERROR_INTERNAL_ERROR; @@ -714,7 +714,7 @@ static UINT smartcard_irp_request(DEVICE* device, IRP* irp) } /* smartcard is always built-in */ -#define DeviceServiceEntry smartcard_DeviceServiceEntry +#define DeviceServiceEntry smartcard_DeviceServiceEntry /** * Function description @@ -730,7 +730,7 @@ UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) if (!sSmartcard) { wObject* obj; - smartcard = (SMARTCARD_DEVICE*) calloc(1, sizeof(SMARTCARD_DEVICE)); + smartcard = (SMARTCARD_DEVICE*)calloc(1, sizeof(SMARTCARD_DEVICE)); if (!smartcard) { @@ -795,9 +795,8 @@ UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) goto fail; } - smartcard->thread = CreateThread(NULL, 0, - smartcard_thread_func, - smartcard, CREATE_SUSPENDED, NULL); + smartcard->thread = + CreateThread(NULL, 0, smartcard_thread_func, smartcard, CREATE_SUSPENDED, NULL); if (!smartcard->thread) { @@ -820,4 +819,3 @@ fail: smartcard_free_(smartcard); return error; } - diff --git a/channels/smartcard/client/smartcard_main.h b/channels/smartcard/client/smartcard_main.h index a867e69b2..e14423359 100644 --- a/channels/smartcard/client/smartcard_main.h +++ b/channels/smartcard/client/smartcard_main.h @@ -34,56 +34,61 @@ #define TAG CHANNELS_TAG("smartcard.client") -#define RDP_SCARD_CTL_CODE(code) CTL_CODE(FILE_DEVICE_FILE_SYSTEM, (code), METHOD_BUFFERED, FILE_ANY_ACCESS) +#define RDP_SCARD_CTL_CODE(code) \ + CTL_CODE(FILE_DEVICE_FILE_SYSTEM, (code), METHOD_BUFFERED, FILE_ANY_ACCESS) -#define SCARD_IOCTL_ESTABLISHCONTEXT RDP_SCARD_CTL_CODE(5) /* SCardEstablishContext */ -#define SCARD_IOCTL_RELEASECONTEXT RDP_SCARD_CTL_CODE(6) /* SCardReleaseContext */ -#define SCARD_IOCTL_ISVALIDCONTEXT RDP_SCARD_CTL_CODE(7) /* SCardIsValidContext */ -#define SCARD_IOCTL_LISTREADERGROUPSA RDP_SCARD_CTL_CODE(8) /* SCardListReaderGroupsA */ -#define SCARD_IOCTL_LISTREADERGROUPSW RDP_SCARD_CTL_CODE(9) /* SCardListReaderGroupsW */ -#define SCARD_IOCTL_LISTREADERSA RDP_SCARD_CTL_CODE(10) /* SCardListReadersA */ -#define SCARD_IOCTL_LISTREADERSW RDP_SCARD_CTL_CODE(11) /* SCardListReadersW */ -#define SCARD_IOCTL_INTRODUCEREADERGROUPA RDP_SCARD_CTL_CODE(20) /* SCardIntroduceReaderGroupA */ -#define SCARD_IOCTL_INTRODUCEREADERGROUPW RDP_SCARD_CTL_CODE(21) /* SCardIntroduceReaderGroupW */ -#define SCARD_IOCTL_FORGETREADERGROUPA RDP_SCARD_CTL_CODE(22) /* SCardForgetReaderGroupA */ -#define SCARD_IOCTL_FORGETREADERGROUPW RDP_SCARD_CTL_CODE(23) /* SCardForgetReaderGroupW */ -#define SCARD_IOCTL_INTRODUCEREADERA RDP_SCARD_CTL_CODE(24) /* SCardIntroduceReaderA */ -#define SCARD_IOCTL_INTRODUCEREADERW RDP_SCARD_CTL_CODE(25) /* SCardIntroduceReaderW */ -#define SCARD_IOCTL_FORGETREADERA RDP_SCARD_CTL_CODE(26) /* SCardForgetReaderA */ -#define SCARD_IOCTL_FORGETREADERW RDP_SCARD_CTL_CODE(27) /* SCardForgetReaderW */ -#define SCARD_IOCTL_ADDREADERTOGROUPA RDP_SCARD_CTL_CODE(28) /* SCardAddReaderToGroupA */ -#define SCARD_IOCTL_ADDREADERTOGROUPW RDP_SCARD_CTL_CODE(29) /* SCardAddReaderToGroupW */ -#define SCARD_IOCTL_REMOVEREADERFROMGROUPA RDP_SCARD_CTL_CODE(30) /* SCardRemoveReaderFromGroupA */ -#define SCARD_IOCTL_REMOVEREADERFROMGROUPW RDP_SCARD_CTL_CODE(31) /* SCardRemoveReaderFromGroupW */ -#define SCARD_IOCTL_LOCATECARDSA RDP_SCARD_CTL_CODE(38) /* SCardLocateCardsA */ -#define SCARD_IOCTL_LOCATECARDSW RDP_SCARD_CTL_CODE(39) /* SCardLocateCardsW */ -#define SCARD_IOCTL_GETSTATUSCHANGEA RDP_SCARD_CTL_CODE(40) /* SCardGetStatusChangeA */ -#define SCARD_IOCTL_GETSTATUSCHANGEW RDP_SCARD_CTL_CODE(41) /* SCardGetStatusChangeW */ -#define SCARD_IOCTL_CANCEL RDP_SCARD_CTL_CODE(42) /* SCardCancel */ -#define SCARD_IOCTL_CONNECTA RDP_SCARD_CTL_CODE(43) /* SCardConnectA */ -#define SCARD_IOCTL_CONNECTW RDP_SCARD_CTL_CODE(44) /* SCardConnectW */ -#define SCARD_IOCTL_RECONNECT RDP_SCARD_CTL_CODE(45) /* SCardReconnect */ -#define SCARD_IOCTL_DISCONNECT RDP_SCARD_CTL_CODE(46) /* SCardDisconnect */ -#define SCARD_IOCTL_BEGINTRANSACTION RDP_SCARD_CTL_CODE(47) /* SCardBeginTransaction */ -#define SCARD_IOCTL_ENDTRANSACTION RDP_SCARD_CTL_CODE(48) /* SCardEndTransaction */ -#define SCARD_IOCTL_STATE RDP_SCARD_CTL_CODE(49) /* SCardState */ -#define SCARD_IOCTL_STATUSA RDP_SCARD_CTL_CODE(50) /* SCardStatusA */ -#define SCARD_IOCTL_STATUSW RDP_SCARD_CTL_CODE(51) /* SCardStatusW */ -#define SCARD_IOCTL_TRANSMIT RDP_SCARD_CTL_CODE(52) /* SCardTransmit */ -#define SCARD_IOCTL_CONTROL RDP_SCARD_CTL_CODE(53) /* SCardControl */ -#define SCARD_IOCTL_GETATTRIB RDP_SCARD_CTL_CODE(54) /* SCardGetAttrib */ -#define SCARD_IOCTL_SETATTRIB RDP_SCARD_CTL_CODE(55) /* SCardSetAttrib */ -#define SCARD_IOCTL_ACCESSSTARTEDEVENT RDP_SCARD_CTL_CODE(56) /* SCardAccessStartedEvent */ -#define SCARD_IOCTL_LOCATECARDSBYATRA RDP_SCARD_CTL_CODE(58) /* SCardLocateCardsByATRA */ -#define SCARD_IOCTL_LOCATECARDSBYATRW RDP_SCARD_CTL_CODE(59) /* SCardLocateCardsByATRW */ -#define SCARD_IOCTL_READCACHEA RDP_SCARD_CTL_CODE(60) /* SCardReadCacheA */ -#define SCARD_IOCTL_READCACHEW RDP_SCARD_CTL_CODE(61) /* SCardReadCacheW */ -#define SCARD_IOCTL_WRITECACHEA RDP_SCARD_CTL_CODE(62) /* SCardWriteCacheA */ -#define SCARD_IOCTL_WRITECACHEW RDP_SCARD_CTL_CODE(63) /* SCardWriteCacheW */ -#define SCARD_IOCTL_GETTRANSMITCOUNT RDP_SCARD_CTL_CODE(64) /* SCardGetTransmitCount */ -#define SCARD_IOCTL_RELEASESTARTEDEVENT RDP_SCARD_CTL_CODE(66) /* SCardReleaseStartedEvent */ -#define SCARD_IOCTL_GETREADERICON RDP_SCARD_CTL_CODE(67) /* SCardGetReaderIconA */ -#define SCARD_IOCTL_GETDEVICETYPEID RDP_SCARD_CTL_CODE(68) /* SCardGetDeviceTypeIdA */ +#define SCARD_IOCTL_ESTABLISHCONTEXT RDP_SCARD_CTL_CODE(5) /* SCardEstablishContext */ +#define SCARD_IOCTL_RELEASECONTEXT RDP_SCARD_CTL_CODE(6) /* SCardReleaseContext */ +#define SCARD_IOCTL_ISVALIDCONTEXT RDP_SCARD_CTL_CODE(7) /* SCardIsValidContext */ +#define SCARD_IOCTL_LISTREADERGROUPSA RDP_SCARD_CTL_CODE(8) /* SCardListReaderGroupsA */ +#define SCARD_IOCTL_LISTREADERGROUPSW RDP_SCARD_CTL_CODE(9) /* SCardListReaderGroupsW */ +#define SCARD_IOCTL_LISTREADERSA RDP_SCARD_CTL_CODE(10) /* SCardListReadersA */ +#define SCARD_IOCTL_LISTREADERSW RDP_SCARD_CTL_CODE(11) /* SCardListReadersW */ +#define SCARD_IOCTL_INTRODUCEREADERGROUPA RDP_SCARD_CTL_CODE(20) /* SCardIntroduceReaderGroupA */ +#define SCARD_IOCTL_INTRODUCEREADERGROUPW RDP_SCARD_CTL_CODE(21) /* SCardIntroduceReaderGroupW */ +#define SCARD_IOCTL_FORGETREADERGROUPA RDP_SCARD_CTL_CODE(22) /* SCardForgetReaderGroupA */ +#define SCARD_IOCTL_FORGETREADERGROUPW RDP_SCARD_CTL_CODE(23) /* SCardForgetReaderGroupW */ +#define SCARD_IOCTL_INTRODUCEREADERA RDP_SCARD_CTL_CODE(24) /* SCardIntroduceReaderA */ +#define SCARD_IOCTL_INTRODUCEREADERW RDP_SCARD_CTL_CODE(25) /* SCardIntroduceReaderW */ +#define SCARD_IOCTL_FORGETREADERA RDP_SCARD_CTL_CODE(26) /* SCardForgetReaderA */ +#define SCARD_IOCTL_FORGETREADERW RDP_SCARD_CTL_CODE(27) /* SCardForgetReaderW */ +#define SCARD_IOCTL_ADDREADERTOGROUPA RDP_SCARD_CTL_CODE(28) /* SCardAddReaderToGroupA */ +#define SCARD_IOCTL_ADDREADERTOGROUPW RDP_SCARD_CTL_CODE(29) /* SCardAddReaderToGroupW */ +#define SCARD_IOCTL_REMOVEREADERFROMGROUPA \ + RDP_SCARD_CTL_CODE(30) /* SCardRemoveReaderFromGroupA \ + */ +#define SCARD_IOCTL_REMOVEREADERFROMGROUPW \ + RDP_SCARD_CTL_CODE(31) /* SCardRemoveReaderFromGroupW \ + */ +#define SCARD_IOCTL_LOCATECARDSA RDP_SCARD_CTL_CODE(38) /* SCardLocateCardsA */ +#define SCARD_IOCTL_LOCATECARDSW RDP_SCARD_CTL_CODE(39) /* SCardLocateCardsW */ +#define SCARD_IOCTL_GETSTATUSCHANGEA RDP_SCARD_CTL_CODE(40) /* SCardGetStatusChangeA */ +#define SCARD_IOCTL_GETSTATUSCHANGEW RDP_SCARD_CTL_CODE(41) /* SCardGetStatusChangeW */ +#define SCARD_IOCTL_CANCEL RDP_SCARD_CTL_CODE(42) /* SCardCancel */ +#define SCARD_IOCTL_CONNECTA RDP_SCARD_CTL_CODE(43) /* SCardConnectA */ +#define SCARD_IOCTL_CONNECTW RDP_SCARD_CTL_CODE(44) /* SCardConnectW */ +#define SCARD_IOCTL_RECONNECT RDP_SCARD_CTL_CODE(45) /* SCardReconnect */ +#define SCARD_IOCTL_DISCONNECT RDP_SCARD_CTL_CODE(46) /* SCardDisconnect */ +#define SCARD_IOCTL_BEGINTRANSACTION RDP_SCARD_CTL_CODE(47) /* SCardBeginTransaction */ +#define SCARD_IOCTL_ENDTRANSACTION RDP_SCARD_CTL_CODE(48) /* SCardEndTransaction */ +#define SCARD_IOCTL_STATE RDP_SCARD_CTL_CODE(49) /* SCardState */ +#define SCARD_IOCTL_STATUSA RDP_SCARD_CTL_CODE(50) /* SCardStatusA */ +#define SCARD_IOCTL_STATUSW RDP_SCARD_CTL_CODE(51) /* SCardStatusW */ +#define SCARD_IOCTL_TRANSMIT RDP_SCARD_CTL_CODE(52) /* SCardTransmit */ +#define SCARD_IOCTL_CONTROL RDP_SCARD_CTL_CODE(53) /* SCardControl */ +#define SCARD_IOCTL_GETATTRIB RDP_SCARD_CTL_CODE(54) /* SCardGetAttrib */ +#define SCARD_IOCTL_SETATTRIB RDP_SCARD_CTL_CODE(55) /* SCardSetAttrib */ +#define SCARD_IOCTL_ACCESSSTARTEDEVENT RDP_SCARD_CTL_CODE(56) /* SCardAccessStartedEvent */ +#define SCARD_IOCTL_LOCATECARDSBYATRA RDP_SCARD_CTL_CODE(58) /* SCardLocateCardsByATRA */ +#define SCARD_IOCTL_LOCATECARDSBYATRW RDP_SCARD_CTL_CODE(59) /* SCardLocateCardsByATRW */ +#define SCARD_IOCTL_READCACHEA RDP_SCARD_CTL_CODE(60) /* SCardReadCacheA */ +#define SCARD_IOCTL_READCACHEW RDP_SCARD_CTL_CODE(61) /* SCardReadCacheW */ +#define SCARD_IOCTL_WRITECACHEA RDP_SCARD_CTL_CODE(62) /* SCardWriteCacheA */ +#define SCARD_IOCTL_WRITECACHEW RDP_SCARD_CTL_CODE(63) /* SCardWriteCacheW */ +#define SCARD_IOCTL_GETTRANSMITCOUNT RDP_SCARD_CTL_CODE(64) /* SCardGetTransmitCount */ +#define SCARD_IOCTL_RELEASESTARTEDEVENT RDP_SCARD_CTL_CODE(66) /* SCardReleaseStartedEvent */ +#define SCARD_IOCTL_GETREADERICON RDP_SCARD_CTL_CODE(67) /* SCardGetReaderIconA */ +#define SCARD_IOCTL_GETDEVICETYPEID RDP_SCARD_CTL_CODE(68) /* SCardGetDeviceTypeIdA */ typedef struct _SMARTCARD_DEVICE SMARTCARD_DEVICE; @@ -124,7 +129,7 @@ SMARTCARD_CONTEXT* smartcard_context_new(SMARTCARD_DEVICE* smartcard, SCARDCONTE void smartcard_context_free(void* pContext); LONG smartcard_irp_device_control_decode(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation); + SMARTCARD_OPERATION* operation); LONG smartcard_irp_device_control_call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERATION* operation); #include "smartcard_pack.h" diff --git a/channels/smartcard/client/smartcard_operations.c b/channels/smartcard/client/smartcard_operations.c index 336a05ae1..fc1e8a2f2 100644 --- a/channels/smartcard/client/smartcard_operations.c +++ b/channels/smartcard/client/smartcard_operations.c @@ -195,7 +195,7 @@ const char* smartcard_get_ioctl_string(UINT32 ioControlCode, BOOL funcName) } static LONG smartcard_EstablishContext_Decode(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; EstablishContext_Call* call; @@ -207,7 +207,8 @@ static LONG smartcard_EstablishContext_Decode(SMARTCARD_DEVICE* smartcard, if ((status = smartcard_unpack_establish_context_call(smartcard, irp->input, call))) { - WLog_ERR(TAG, "smartcard_unpack_establish_context_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_establish_context_call failed with error %" PRId32 "", + status); return status; } @@ -216,7 +217,7 @@ static LONG smartcard_EstablishContext_Decode(SMARTCARD_DEVICE* smartcard, } static LONG smartcard_EstablishContext_Call(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; SCARDCONTEXT hContext = -1; @@ -228,7 +229,7 @@ static LONG smartcard_EstablishContext_Call(SMARTCARD_DEVICE* smartcard, if (ret.ReturnCode == SCARD_S_SUCCESS) { SMARTCARD_CONTEXT* pContext; - void* key = (void*)(size_t) hContext; + void* key = (void*)(size_t)hContext; // TODO: handle return values pContext = smartcard_context_new(smartcard, hContext); @@ -238,7 +239,7 @@ static LONG smartcard_EstablishContext_Call(SMARTCARD_DEVICE* smartcard, return STATUS_NO_MEMORY; } - if (!ListDictionary_Add(smartcard->rgSCardContextList, key, (void*) pContext)) + if (!ListDictionary_Add(smartcard->rgSCardContextList, key, (void*)pContext)) { WLog_ERR(TAG, "ListDictionary_Add failed!"); return STATUS_INTERNAL_ERROR; @@ -246,7 +247,7 @@ static LONG smartcard_EstablishContext_Call(SMARTCARD_DEVICE* smartcard, } else { - WLog_ERR(TAG, "SCardEstablishContext failed with error %"PRId32"", status); + WLog_ERR(TAG, "SCardEstablishContext failed with error %" PRId32 "", status); return status; } @@ -255,7 +256,8 @@ static LONG smartcard_EstablishContext_Call(SMARTCARD_DEVICE* smartcard, if ((status = smartcard_pack_establish_context_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_establish_context_return failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_establish_context_return failed with error %" PRId32 "", + status); return status; } @@ -263,7 +265,7 @@ static LONG smartcard_EstablishContext_Call(SMARTCARD_DEVICE* smartcard, } static LONG smartcard_ReleaseContext_Decode(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; Context_Call* call; @@ -274,7 +276,7 @@ static LONG smartcard_ReleaseContext_Decode(SMARTCARD_DEVICE* smartcard, return STATUS_NO_MEMORY; if ((status = smartcard_unpack_context_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_context_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_context_call failed with error %" PRId32 "", status); smartcard_trace_context_call(smartcard, call, "ReleaseContext"); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); @@ -282,7 +284,7 @@ static LONG smartcard_ReleaseContext_Decode(SMARTCARD_DEVICE* smartcard, } static LONG smartcard_ReleaseContext_Call(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; Long_Return ret; @@ -291,13 +293,13 @@ static LONG smartcard_ReleaseContext_Call(SMARTCARD_DEVICE* smartcard, if (ret.ReturnCode == SCARD_S_SUCCESS) { SMARTCARD_CONTEXT* pContext; - void* key = (void*)(size_t) operation->hContext; - pContext = (SMARTCARD_CONTEXT*) ListDictionary_Remove(smartcard->rgSCardContextList, key); + void* key = (void*)(size_t)operation->hContext; + pContext = (SMARTCARD_CONTEXT*)ListDictionary_Remove(smartcard->rgSCardContextList, key); smartcard_context_free(pContext); } else { - WLog_ERR(TAG, "SCardReleaseContext failed with error %"PRId32"", status); + WLog_ERR(TAG, "SCardReleaseContext failed with error %" PRId32 "", status); return status; } @@ -306,7 +308,7 @@ static LONG smartcard_ReleaseContext_Call(SMARTCARD_DEVICE* smartcard, } static LONG smartcard_IsValidContext_Decode(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; Context_Call* call; @@ -317,7 +319,7 @@ static LONG smartcard_IsValidContext_Decode(SMARTCARD_DEVICE* smartcard, return STATUS_NO_MEMORY; if ((status = smartcard_unpack_context_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_context_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_context_call failed with error %" PRId32 "", status); smartcard_trace_context_call(smartcard, call, "IsValidContext"); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); @@ -325,14 +327,14 @@ static LONG smartcard_IsValidContext_Decode(SMARTCARD_DEVICE* smartcard, } static LONG smartcard_IsValidContext_Call(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; Long_Return ret; if ((status = ret.ReturnCode = SCardIsValidContext(operation->hContext))) { - WLog_ERR(TAG, "SCardIsValidContext failed with error %"PRId32"", status); + WLog_ERR(TAG, "SCardIsValidContext failed with error %" PRId32 "", status); return status; } @@ -341,7 +343,7 @@ static LONG smartcard_IsValidContext_Call(SMARTCARD_DEVICE* smartcard, } static LONG smartcard_ListReaderGroupsA_Decode(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; ListReaderGroups_Call* call; @@ -358,7 +360,7 @@ static LONG smartcard_ListReaderGroupsA_Decode(SMARTCARD_DEVICE* smartcard, } static LONG smartcard_ListReaderGroupsA_Call(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; ListReaderGroups_Return ret; @@ -366,9 +368,9 @@ static LONG smartcard_ListReaderGroupsA_Call(SMARTCARD_DEVICE* smartcard, DWORD cchGroups = 0; IRP* irp = operation->irp; cchGroups = SCARD_AUTOALLOCATE; - status = ret.ReturnCode = SCardListReaderGroupsA(operation->hContext, (LPSTR) &mszGroups, - &cchGroups); - ret.msz = (BYTE*) mszGroups; + status = ret.ReturnCode = + SCardListReaderGroupsA(operation->hContext, (LPSTR)&mszGroups, &cchGroups); + ret.msz = (BYTE*)mszGroups; ret.cBytes = cchGroups; if (status != SCARD_S_SUCCESS) @@ -387,7 +389,7 @@ static LONG smartcard_ListReaderGroupsA_Call(SMARTCARD_DEVICE* smartcard, } static LONG smartcard_ListReaderGroupsW_Decode(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; ListReaderGroups_Call* call; @@ -404,7 +406,7 @@ static LONG smartcard_ListReaderGroupsW_Decode(SMARTCARD_DEVICE* smartcard, } static LONG smartcard_ListReaderGroupsW_Call(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; ListReaderGroups_Return ret; @@ -412,9 +414,9 @@ static LONG smartcard_ListReaderGroupsW_Call(SMARTCARD_DEVICE* smartcard, DWORD cchGroups = 0; IRP* irp = operation->irp; cchGroups = SCARD_AUTOALLOCATE; - status = ret.ReturnCode = SCardListReaderGroupsW(operation->hContext, (LPWSTR) &mszGroups, - &cchGroups); - ret.msz = (BYTE*) mszGroups; + status = ret.ReturnCode = + SCardListReaderGroupsW(operation->hContext, (LPWSTR)&mszGroups, &cchGroups); + ret.msz = (BYTE*)mszGroups; ret.cBytes = cchGroups; if (status != SCARD_S_SUCCESS) @@ -474,8 +476,7 @@ static DWORD filter_device_by_name_a(wLinkedList* list, LPSTR* mszReaders, DWORD wpos += readerLen + 1; } - } - while (rpos < cchReaders); + } while (rpos < cchReaders); /* this string must be double 0 terminated */ if (rpos != wpos) @@ -498,8 +499,7 @@ static DWORD filter_device_by_name_w(wLinkedList* list, LPWSTR* mszReaders, DWOR if (LinkedList_Count(list) < 1) return cchReaders; - res = ConvertFromUnicode(CP_UTF8, 0, *mszReaders, (int)cchReaders, &readers, 0, NULL, - NULL); + res = ConvertFromUnicode(CP_UTF8, 0, *mszReaders, (int)cchReaders, &readers, 0, NULL, NULL); /* When res==0, readers may have been set to NULL by ConvertFromUnicode */ if ((res < 0) || ((DWORD)res != cchReaders) || (readers == 0)) @@ -518,7 +518,7 @@ static DWORD filter_device_by_name_w(wLinkedList* list, LPWSTR* mszReaders, DWOR } static LONG smartcard_ListReadersA_Decode(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; ListReaders_Call* call; @@ -529,7 +529,7 @@ static LONG smartcard_ListReadersA_Decode(SMARTCARD_DEVICE* smartcard, return STATUS_NO_MEMORY; if ((status = smartcard_unpack_list_readers_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_list_readers_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_list_readers_call failed with error %" PRId32 "", status); smartcard_trace_list_readers_call(smartcard, call, FALSE); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); @@ -545,8 +545,8 @@ static LONG smartcard_ListReadersA_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_O IRP* irp = operation->irp; ListReaders_Call* call = operation->call; cchReaders = SCARD_AUTOALLOCATE; - status = ret.ReturnCode = SCardListReadersA(operation->hContext, (LPCSTR) call->mszGroups, - (LPSTR) &mszReaders, &cchReaders); + status = ret.ReturnCode = SCardListReadersA(operation->hContext, (LPCSTR)call->mszGroups, + (LPSTR)&mszReaders, &cchReaders); if (call->mszGroups) { @@ -556,18 +556,18 @@ static LONG smartcard_ListReadersA_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_O if (status) { - WLog_ERR(TAG, "SCardListReadersA failed with error %"PRId32"", status); + WLog_ERR(TAG, "SCardListReadersA failed with error %" PRId32 "", status); return status; } cchReaders = filter_device_by_name_a(smartcard->names, &mszReaders, cchReaders); - ret.msz = (BYTE*) mszReaders; + ret.msz = (BYTE*)mszReaders; ret.cBytes = cchReaders; smartcard_trace_list_readers_return(smartcard, &ret, FALSE); if ((status = smartcard_pack_list_readers_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_list_readers_return failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_list_readers_return failed with error %" PRId32 "", status); return status; } @@ -581,7 +581,7 @@ static LONG smartcard_ListReadersA_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_O } static LONG smartcard_ListReadersW_Decode(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; ListReaders_Call* call; @@ -592,7 +592,7 @@ static LONG smartcard_ListReadersW_Decode(SMARTCARD_DEVICE* smartcard, return STATUS_NO_MEMORY; if ((status = smartcard_unpack_list_readers_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_list_readers_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_list_readers_call failed with error %" PRId32 "", status); smartcard_trace_list_readers_call(smartcard, call, TRUE); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); @@ -608,8 +608,8 @@ static LONG smartcard_ListReadersW_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_O IRP* irp = operation->irp; ListReaders_Call* call = operation->call; cchReaders = SCARD_AUTOALLOCATE; - status = ret.ReturnCode = SCardListReadersW(operation->hContext, - (LPCWSTR) call->mszGroups, (LPWSTR) &mszReaders, &cchReaders); + status = ret.ReturnCode = SCardListReadersW(operation->hContext, (LPCWSTR)call->mszGroups, + (LPWSTR)&mszReaders, &cchReaders); if (call->mszGroups) { @@ -619,18 +619,18 @@ static LONG smartcard_ListReadersW_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_O if (status != SCARD_S_SUCCESS) { - WLog_ERR(TAG, "SCardListReadersW failed with error %"PRId32"", status); + WLog_ERR(TAG, "SCardListReadersW failed with error %" PRId32 "", status); return status; } cchReaders = filter_device_by_name_w(smartcard->names, &mszReaders, cchReaders); - ret.msz = (BYTE*) mszReaders; + ret.msz = (BYTE*)mszReaders; ret.cBytes = cchReaders * 2; smartcard_trace_list_readers_return(smartcard, &ret, TRUE); if ((status = smartcard_pack_list_readers_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_list_readers_return failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_list_readers_return failed with error %" PRId32 "", status); return status; } @@ -644,7 +644,7 @@ static LONG smartcard_ListReadersW_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_O } static LONG smartcard_GetStatusChangeA_Decode(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; GetStatusChangeA_Call* call; @@ -656,7 +656,8 @@ static LONG smartcard_GetStatusChangeA_Decode(SMARTCARD_DEVICE* smartcard, if ((status = smartcard_unpack_get_status_change_a_call(smartcard, irp->input, call))) { - WLog_ERR(TAG, "smartcard_unpack_get_status_change_a_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_get_status_change_a_call failed with error %" PRId32 "", + status); return status; } @@ -666,21 +667,21 @@ static LONG smartcard_GetStatusChangeA_Decode(SMARTCARD_DEVICE* smartcard, } static LONG smartcard_GetStatusChangeA_Call(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { UINT32 index; GetStatusChange_Return ret; LPSCARD_READERSTATEA rgReaderState = NULL; IRP* irp = operation->irp; GetStatusChangeA_Call* call = operation->call; - ret.ReturnCode = SCardGetStatusChangeA(operation->hContext, call->dwTimeOut, call->rgReaderStates, - call->cReaders); + ret.ReturnCode = SCardGetStatusChangeA(operation->hContext, call->dwTimeOut, + call->rgReaderStates, call->cReaders); ret.cReaders = call->cReaders; ret.rgReaderStates = NULL; if (ret.cReaders > 0) { - ret.rgReaderStates = (ReaderState_Return*) calloc(ret.cReaders, sizeof(ReaderState_Return)); + ret.rgReaderStates = (ReaderState_Return*)calloc(ret.cReaders, sizeof(ReaderState_Return)); if (!ret.rgReaderStates) return STATUS_NO_MEMORY; @@ -713,7 +714,7 @@ static LONG smartcard_GetStatusChangeA_Call(SMARTCARD_DEVICE* smartcard, } static LONG smartcard_GetStatusChangeW_Decode(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; GetStatusChangeW_Call* call; @@ -724,7 +725,8 @@ static LONG smartcard_GetStatusChangeW_Decode(SMARTCARD_DEVICE* smartcard, return STATUS_NO_MEMORY; if ((status = smartcard_unpack_get_status_change_w_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_get_status_change_w_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_get_status_change_w_call failed with error %" PRId32 "", + status); smartcard_trace_get_status_change_w_call(smartcard, call); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); @@ -732,7 +734,7 @@ static LONG smartcard_GetStatusChangeW_Decode(SMARTCARD_DEVICE* smartcard, } static LONG smartcard_GetStatusChangeW_Call(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { UINT32 index; GetStatusChange_Return ret; @@ -746,7 +748,7 @@ static LONG smartcard_GetStatusChangeW_Call(SMARTCARD_DEVICE* smartcard, if (ret.cReaders > 0) { - ret.rgReaderStates = (ReaderState_Return*) calloc(ret.cReaders, sizeof(ReaderState_Return)); + ret.rgReaderStates = (ReaderState_Return*)calloc(ret.cReaders, sizeof(ReaderState_Return)); if (!ret.rgReaderStates) return STATUS_NO_MEMORY; @@ -789,7 +791,7 @@ static LONG smartcard_Cancel_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERA return STATUS_NO_MEMORY; if ((status = smartcard_unpack_context_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_context_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_context_call failed with error %" PRId32 "", status); smartcard_trace_context_call(smartcard, call, "Cancel"); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); @@ -803,7 +805,7 @@ static LONG smartcard_Cancel_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERATI if ((status = ret.ReturnCode = SCardCancel(operation->hContext))) { - WLog_ERR(TAG, "SCardCancel failed with error %"PRId32"", status); + WLog_ERR(TAG, "SCardCancel failed with error %" PRId32 "", status); return status; } @@ -822,11 +824,11 @@ static LONG smartcard_ConnectA_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPE return STATUS_NO_MEMORY; if ((status = smartcard_unpack_connect_a_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_connect_a_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_connect_a_call failed with error %" PRId32 "", status); smartcard_trace_connect_a_call(smartcard, call); - operation->hContext = smartcard_scard_context_native_from_redir(smartcard, - &(call->Common.hContext)); + operation->hContext = + smartcard_scard_context_native_from_redir(smartcard, &(call->Common.hContext)); return status; } @@ -844,22 +846,22 @@ static LONG smartcard_ConnectA_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERA call->Common.dwPreferredProtocols = SCARD_PROTOCOL_Tx; } - status = ret.ReturnCode = SCardConnectA(operation->hContext, (char*) call->szReader, - call->Common.dwShareMode, - call->Common.dwPreferredProtocols, &hCard, &ret.dwActiveProtocol); + status = ret.ReturnCode = + SCardConnectA(operation->hContext, (char*)call->szReader, call->Common.dwShareMode, + call->Common.dwPreferredProtocols, &hCard, &ret.dwActiveProtocol); smartcard_scard_context_native_to_redir(smartcard, &(ret.hContext), operation->hContext); smartcard_scard_handle_native_to_redir(smartcard, &(ret.hCard), hCard); smartcard_trace_connect_return(smartcard, &ret); if (status) { - WLog_ERR(TAG, "SCardConnectA failed with error %"PRId32"", status); + WLog_ERR(TAG, "SCardConnectA failed with error %" PRId32 "", status); goto out_fail; } if ((status = smartcard_pack_connect_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_connect_return failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_connect_return failed with error %" PRId32 "", status); goto out_fail; } @@ -880,11 +882,11 @@ static LONG smartcard_ConnectW_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPE return STATUS_NO_MEMORY; if ((status = smartcard_unpack_connect_w_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_connect_w_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_connect_w_call failed with error %" PRId32 "", status); smartcard_trace_connect_w_call(smartcard, call); - operation->hContext = smartcard_scard_context_native_from_redir(smartcard, - &(call->Common.hContext)); + operation->hContext = + smartcard_scard_context_native_from_redir(smartcard, &(call->Common.hContext)); return status; } @@ -902,22 +904,22 @@ static LONG smartcard_ConnectW_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERA call->Common.dwPreferredProtocols = SCARD_PROTOCOL_Tx; } - status = ret.ReturnCode = SCardConnectW(operation->hContext, (WCHAR*) call->szReader, - call->Common.dwShareMode, - call->Common.dwPreferredProtocols, &hCard, &ret.dwActiveProtocol); + status = ret.ReturnCode = + SCardConnectW(operation->hContext, (WCHAR*)call->szReader, call->Common.dwShareMode, + call->Common.dwPreferredProtocols, &hCard, &ret.dwActiveProtocol); smartcard_scard_context_native_to_redir(smartcard, &(ret.hContext), operation->hContext); smartcard_scard_handle_native_to_redir(smartcard, &(ret.hCard), hCard); smartcard_trace_connect_return(smartcard, &ret); if (status) { - WLog_ERR(TAG, "SCardConnectW failed with error %"PRId32"", status); + WLog_ERR(TAG, "SCardConnectW failed with error %" PRId32 "", status); goto out_fail; } if ((status = smartcard_pack_connect_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_connect_return failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_connect_return failed with error %" PRId32 "", status); goto out_fail; } @@ -938,7 +940,7 @@ static LONG smartcard_Reconnect_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OP return STATUS_NO_MEMORY; if ((status = smartcard_unpack_reconnect_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_reconnect_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_reconnect_call failed with error %" PRId32 "", status); smartcard_trace_reconnect_call(smartcard, call); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); @@ -952,13 +954,13 @@ static LONG smartcard_Reconnect_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPER Reconnect_Return ret; IRP* irp = operation->irp; Reconnect_Call* call = operation->call; - ret.ReturnCode = SCardReconnect(operation->hCard, call->dwShareMode, - call->dwPreferredProtocols, call->dwInitialization, &ret.dwActiveProtocol); + ret.ReturnCode = SCardReconnect(operation->hCard, call->dwShareMode, call->dwPreferredProtocols, + call->dwInitialization, &ret.dwActiveProtocol); smartcard_trace_reconnect_return(smartcard, &ret); if ((status = smartcard_pack_reconnect_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_reconnect_return failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_reconnect_return failed with error %" PRId32 "", status); return status; } @@ -976,7 +978,8 @@ static LONG smartcard_Disconnect_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_O return STATUS_NO_MEMORY; if ((status = smartcard_unpack_hcard_and_disposition_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_hcard_and_disposition_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_hcard_and_disposition_call failed with error %" PRId32 "", + status); smartcard_trace_hcard_and_disposition_call(smartcard, call, "Disconnect"); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); @@ -992,7 +995,7 @@ static LONG smartcard_Disconnect_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPE if ((status = ret.ReturnCode = SCardDisconnect(operation->hCard, call->dwDisposition))) { - WLog_ERR(TAG, "SCardDisconnect failed with error %"PRId32"", status); + WLog_ERR(TAG, "SCardDisconnect failed with error %" PRId32 "", status); return status; } @@ -1005,7 +1008,7 @@ static LONG smartcard_Disconnect_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPE } static LONG smartcard_BeginTransaction_Decode(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; HCardAndDisposition_Call* call; @@ -1016,7 +1019,8 @@ static LONG smartcard_BeginTransaction_Decode(SMARTCARD_DEVICE* smartcard, return STATUS_NO_MEMORY; if ((status = smartcard_unpack_hcard_and_disposition_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_hcard_and_disposition_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_hcard_and_disposition_call failed with error %" PRId32 "", + status); smartcard_trace_hcard_and_disposition_call(smartcard, call, "BeginTransaction"); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); @@ -1025,13 +1029,13 @@ static LONG smartcard_BeginTransaction_Decode(SMARTCARD_DEVICE* smartcard, } static LONG smartcard_BeginTransaction_Call(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { Long_Return ret; if ((ret.ReturnCode = SCardBeginTransaction(operation->hCard))) { - WLog_ERR(TAG, "SCardBeginTransaction failed with error %"PRId32"", ret.ReturnCode); + WLog_ERR(TAG, "SCardBeginTransaction failed with error %" PRId32 "", ret.ReturnCode); return ret.ReturnCode; } @@ -1040,7 +1044,7 @@ static LONG smartcard_BeginTransaction_Call(SMARTCARD_DEVICE* smartcard, } static LONG smartcard_EndTransaction_Decode(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; HCardAndDisposition_Call* call; @@ -1051,7 +1055,8 @@ static LONG smartcard_EndTransaction_Decode(SMARTCARD_DEVICE* smartcard, return STATUS_NO_MEMORY; if ((status = smartcard_unpack_hcard_and_disposition_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_hcard_and_disposition_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_hcard_and_disposition_call failed with error %" PRId32 "", + status); smartcard_trace_hcard_and_disposition_call(smartcard, call, "EndTransaction"); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); @@ -1060,14 +1065,14 @@ static LONG smartcard_EndTransaction_Decode(SMARTCARD_DEVICE* smartcard, } static LONG smartcard_EndTransaction_Call(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { Long_Return ret; HCardAndDisposition_Call* call = operation->call; if ((ret.ReturnCode = SCardEndTransaction(operation->hCard, call->dwDisposition))) { - WLog_ERR(TAG, "SCardEndTransaction failed with error %"PRId32"", ret.ReturnCode); + WLog_ERR(TAG, "SCardEndTransaction failed with error %" PRId32 "", ret.ReturnCode); return ret.ReturnCode; } @@ -1086,7 +1091,7 @@ static LONG smartcard_State_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERAT return STATUS_NO_MEMORY; if ((status = smartcard_unpack_state_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_state_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_state_call failed with error %" PRId32 "", status); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); operation->hCard = smartcard_scard_handle_native_from_redir(smartcard, &(call->hCard)); @@ -1099,12 +1104,12 @@ static LONG smartcard_State_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERATIO State_Return ret; IRP* irp = operation->irp; ret.cbAtrLen = SCARD_ATR_LENGTH; - ret.ReturnCode = SCardState(operation->hCard, &ret.dwState, &ret.dwProtocol, (BYTE*) &ret.rgAtr, + ret.ReturnCode = SCardState(operation->hCard, &ret.dwState, &ret.dwProtocol, (BYTE*)&ret.rgAtr, &ret.cbAtrLen); if ((status = smartcard_pack_state_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_state_return failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_state_return failed with error %" PRId32 "", status); return status; } @@ -1122,7 +1127,7 @@ static LONG smartcard_StatusA_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPER return STATUS_NO_MEMORY; if ((status = smartcard_unpack_status_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_status_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_status_call failed with error %" PRId32 "", status); smartcard_trace_status_call(smartcard, call, FALSE); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); @@ -1148,15 +1153,15 @@ static LONG smartcard_StatusA_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERAT else cchReaderLen = SCARD_AUTOALLOCATE; - status = ret.ReturnCode = SCardStatusA(operation->hCard, - call->fmszReaderNamesIsNULL ? NULL : (LPSTR) &mszReaderNames, - &cchReaderLen, &ret.dwState, &ret.dwProtocol, - cbAtrLen ? (BYTE*) &ret.pbAtr : NULL, &cbAtrLen); + status = ret.ReturnCode = + SCardStatusA(operation->hCard, call->fmszReaderNamesIsNULL ? NULL : (LPSTR)&mszReaderNames, + &cchReaderLen, &ret.dwState, &ret.dwProtocol, + cbAtrLen ? (BYTE*)&ret.pbAtr : NULL, &cbAtrLen); if (status == SCARD_S_SUCCESS) { if (!call->fmszReaderNamesIsNULL) - ret.mszReaderNames = (BYTE*) mszReaderNames; + ret.mszReaderNames = (BYTE*)mszReaderNames; ret.cBytes = cchReaderLen; @@ -1168,7 +1173,7 @@ static LONG smartcard_StatusA_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERAT if ((status = smartcard_pack_status_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_status_return failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_status_return failed with error %" PRId32 "", status); return status; } @@ -1191,7 +1196,7 @@ static LONG smartcard_StatusW_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPER return STATUS_NO_MEMORY; if ((status = smartcard_unpack_status_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_status_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_status_call failed with error %" PRId32 "", status); smartcard_trace_status_call(smartcard, call, TRUE); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); @@ -1221,17 +1226,17 @@ static LONG smartcard_StatusW_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERAT cchReaderLen = SCARD_AUTOALLOCATE; ZeroMemory(ret.pbAtr, 32); - status = ret.ReturnCode = SCardStatusW(operation->hCard, - call->fmszReaderNamesIsNULL ? NULL : (LPWSTR) &mszReaderNames, - &cchReaderLen, &ret.dwState, &ret.dwProtocol, (BYTE*) &ret.pbAtr, &cbAtrLen); + status = ret.ReturnCode = + SCardStatusW(operation->hCard, call->fmszReaderNamesIsNULL ? NULL : (LPWSTR)&mszReaderNames, + &cchReaderLen, &ret.dwState, &ret.dwProtocol, (BYTE*)&ret.pbAtr, &cbAtrLen); if (status == SCARD_S_SUCCESS) { if (!call->fmszReaderNamesIsNULL) - ret.mszReaderNames = (BYTE*) mszReaderNames; + ret.mszReaderNames = (BYTE*)mszReaderNames; - // WinScard returns the number of CHARACTERS whereas pcsc-lite returns the - // number of BYTES. + // WinScard returns the number of CHARACTERS whereas pcsc-lite returns the + // number of BYTES. #ifdef _WIN32 ret.cBytes = cchReaderLen * 2; #else @@ -1245,7 +1250,7 @@ static LONG smartcard_StatusW_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERAT if ((status = smartcard_pack_status_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_status_return failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_status_return failed with error %" PRId32 "", status); return status; } @@ -1266,7 +1271,7 @@ static LONG smartcard_Transmit_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPE return STATUS_NO_MEMORY; if ((status = smartcard_unpack_transmit_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_transmit_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_transmit_call failed with error %" PRId32 "", status); smartcard_trace_transmit_call(smartcard, call); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); @@ -1289,15 +1294,16 @@ static LONG smartcard_Transmit_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERA call->cbRecvLength = 66560; ret.cbRecvLength = call->cbRecvLength; - ret.pbRecvBuffer = (BYTE*) malloc(ret.cbRecvLength); + ret.pbRecvBuffer = (BYTE*)malloc(ret.cbRecvLength); if (!ret.pbRecvBuffer) return STATUS_NO_MEMORY; } ret.pioRecvPci = call->pioRecvPci; - ret.ReturnCode = SCardTransmit(operation->hCard, call->pioSendPci, call->pbSendBuffer, - call->cbSendLength, ret.pioRecvPci, ret.pbRecvBuffer, &(ret.cbRecvLength)); + ret.ReturnCode = + SCardTransmit(operation->hCard, call->pioSendPci, call->pbSendBuffer, call->cbSendLength, + ret.pioRecvPci, ret.pbRecvBuffer, &(ret.cbRecvLength)); smartcard_trace_transmit_return(smartcard, &ret); status = smartcard_pack_transmit_return(smartcard, irp->output, &ret); @@ -1308,7 +1314,7 @@ static LONG smartcard_Transmit_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERA if (status) { - WLog_ERR(TAG, "smartcard_pack_transmit_return failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_transmit_return failed with error %" PRId32 "", status); return status; } return ret.ReturnCode; @@ -1325,7 +1331,7 @@ static LONG smartcard_Control_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPER return STATUS_NO_MEMORY; if ((status = smartcard_unpack_control_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_control_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_control_call failed with error %" PRId32 "", status); smartcard_trace_control_call(smartcard, call); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); @@ -1340,19 +1346,19 @@ static LONG smartcard_Control_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERAT IRP* irp = operation->irp; Control_Call* call = operation->call; ret.cbOutBufferSize = call->cbOutBufferSize; - ret.pvOutBuffer = (BYTE*) malloc(call->cbOutBufferSize); + ret.pvOutBuffer = (BYTE*)malloc(call->cbOutBufferSize); if (!ret.pvOutBuffer) return SCARD_E_NO_MEMORY; - ret.ReturnCode = SCardControl(operation->hCard, - call->dwControlCode, call->pvInBuffer, call->cbInBufferSize, - ret.pvOutBuffer, call->cbOutBufferSize, &ret.cbOutBufferSize); + ret.ReturnCode = + SCardControl(operation->hCard, call->dwControlCode, call->pvInBuffer, call->cbInBufferSize, + ret.pvOutBuffer, call->cbOutBufferSize, &ret.cbOutBufferSize); smartcard_trace_control_return(smartcard, &ret); if ((status = smartcard_pack_control_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_control_return failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_control_return failed with error %" PRId32 "", status); return status; } @@ -1372,7 +1378,7 @@ static LONG smartcard_GetAttrib_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OP return STATUS_NO_MEMORY; if ((status = smartcard_unpack_get_attrib_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_get_attrib_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_get_attrib_call failed with error %" PRId32 "", status); smartcard_trace_get_attrib_call(smartcard, call); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); @@ -1397,21 +1403,22 @@ static LONG smartcard_GetAttrib_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPER if (call->cbAttrLen && !autoAllocate) { - ret.pbAttr = (BYTE*) malloc(call->cbAttrLen); + ret.pbAttr = (BYTE*)malloc(call->cbAttrLen); if (!ret.pbAttr) return SCARD_E_NO_MEMORY; } cbAttrLen = call->cbAttrLen; - ret.ReturnCode = SCardGetAttrib(operation->hCard, call->dwAttrId, - autoAllocate ? (LPBYTE) & (ret.pbAttr) : ret.pbAttr, &cbAttrLen); + ret.ReturnCode = + SCardGetAttrib(operation->hCard, call->dwAttrId, + autoAllocate ? (LPBYTE) & (ret.pbAttr) : ret.pbAttr, &cbAttrLen); ret.cbAttrLen = cbAttrLen; smartcard_trace_get_attrib_return(smartcard, &ret, call->dwAttrId); if (ret.ReturnCode) { - WLog_WARN(TAG, "SCardGetAttrib: %s (0x%08"PRIX32") cbAttrLen: %"PRIu32"", + WLog_WARN(TAG, "SCardGetAttrib: %s (0x%08" PRIX32 ") cbAttrLen: %" PRIu32 "", SCardGetAttributeString(call->dwAttrId), call->dwAttrId, call->cbAttrLen); Stream_Zero(irp->output, 256); free(ret.pbAttr); @@ -1420,7 +1427,7 @@ static LONG smartcard_GetAttrib_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPER if ((status = smartcard_pack_get_attrib_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_get_attrib_return failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_get_attrib_return failed with error %" PRId32 "", status); return status; } @@ -1429,7 +1436,7 @@ static LONG smartcard_GetAttrib_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPER } static LONG smartcard_AccessStartedEvent_Decode(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { Long_Call* call; IRP* irp; @@ -1442,7 +1449,7 @@ static LONG smartcard_AccessStartedEvent_Decode(SMARTCARD_DEVICE* smartcard, if (Stream_GetRemainingLength(irp->input) < 4) { - WLog_WARN(TAG, "AccessStartedEvent is too short: %"PRIuz"", + WLog_WARN(TAG, "AccessStartedEvent is too short: %" PRIuz "", Stream_GetRemainingLength(irp->input)); return SCARD_F_INTERNAL_ERROR; } @@ -1452,7 +1459,7 @@ static LONG smartcard_AccessStartedEvent_Decode(SMARTCARD_DEVICE* smartcard, } static LONG smartcard_AccessStartedEvent_Call(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status = SCARD_S_SUCCESS; WINPR_UNUSED(operation); @@ -1467,7 +1474,7 @@ static LONG smartcard_AccessStartedEvent_Call(SMARTCARD_DEVICE* smartcard, } static LONG smartcard_LocateCardsByATRA_Decode(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; LocateCardsByATRA_Call* call; @@ -1478,7 +1485,8 @@ static LONG smartcard_LocateCardsByATRA_Decode(SMARTCARD_DEVICE* smartcard, return STATUS_NO_MEMORY; if ((status = smartcard_unpack_locate_cards_by_atr_a_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_locate_cards_by_atr_a_call failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_locate_cards_by_atr_a_call failed with error %" PRId32 "", + status); smartcard_trace_locate_cards_by_atr_a_call(smartcard, call); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); @@ -1486,7 +1494,7 @@ static LONG smartcard_LocateCardsByATRA_Decode(SMARTCARD_DEVICE* smartcard, } static LONG smartcard_LocateCardsByATRA_Call(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; DWORD i, j, k; @@ -1495,22 +1503,22 @@ static LONG smartcard_LocateCardsByATRA_Call(SMARTCARD_DEVICE* smartcard, LPSCARD_READERSTATEA states = NULL; IRP* irp = operation->irp; LocateCardsByATRA_Call* call = operation->call; - states = (LPSCARD_READERSTATEA) calloc(call->cReaders, sizeof(SCARD_READERSTATEA)); + states = (LPSCARD_READERSTATEA)calloc(call->cReaders, sizeof(SCARD_READERSTATEA)); if (!states) return STATUS_NO_MEMORY; for (i = 0; i < call->cReaders; i++) { - states[i].szReader = (LPCSTR) call->rgReaderStates[i].szReader; + states[i].szReader = (LPCSTR)call->rgReaderStates[i].szReader; states[i].dwCurrentState = call->rgReaderStates[i].Common.dwCurrentState; states[i].dwEventState = call->rgReaderStates[i].Common.dwEventState; states[i].cbAtr = call->rgReaderStates[i].Common.cbAtr; CopyMemory(&(states[i].rgbAtr), &(call->rgReaderStates[i].Common.rgbAtr), 36); } - status = ret.ReturnCode = SCardGetStatusChangeA(operation->hContext, 0x000001F4, states, - call->cReaders); + status = ret.ReturnCode = + SCardGetStatusChangeA(operation->hContext, 0x000001F4, states, call->cReaders); if (status && (status != SCARD_E_TIMEOUT) && (status != SCARD_E_CANCELLED)) { @@ -1538,7 +1546,7 @@ static LONG smartcard_LocateCardsByATRA_Call(SMARTCARD_DEVICE* smartcard, ret.rgReaderStates = NULL; if (ret.cReaders > 0) - ret.rgReaderStates = (ReaderState_Return*) calloc(ret.cReaders, sizeof(ReaderState_Return)); + ret.rgReaderStates = (ReaderState_Return*)calloc(ret.cReaders, sizeof(ReaderState_Return)); if (!ret.rgReaderStates) { @@ -1560,7 +1568,8 @@ static LONG smartcard_LocateCardsByATRA_Call(SMARTCARD_DEVICE* smartcard, if ((status = smartcard_pack_get_status_change_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_get_status_change_return failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_get_status_change_return failed with error %" PRId32 "", + status); return status; } @@ -1568,11 +1577,11 @@ static LONG smartcard_LocateCardsByATRA_Call(SMARTCARD_DEVICE* smartcard, { for (i = 0; i < call->cReaders; i++) { - state = (LPSCARD_READERSTATEA) &call->rgReaderStates[i]; + state = (LPSCARD_READERSTATEA)&call->rgReaderStates[i]; if (state->szReader) { - free((void*) state->szReader); + free((void*)state->szReader); state->szReader = NULL; } } @@ -1586,7 +1595,7 @@ static LONG smartcard_LocateCardsByATRA_Call(SMARTCARD_DEVICE* smartcard, } LONG smartcard_irp_device_control_decode(SMARTCARD_DEVICE* smartcard, - SMARTCARD_OPERATION* operation) + SMARTCARD_OPERATION* operation) { LONG status; UINT32 offset; @@ -1599,41 +1608,42 @@ LONG smartcard_irp_device_control_decode(SMARTCARD_DEVICE* smartcard, if (Stream_GetRemainingLength(irp->input) < 32) { - WLog_WARN(TAG, "Device Control Request is too short: %"PRIuz"", + WLog_WARN(TAG, "Device Control Request is too short: %" PRIuz "", Stream_GetRemainingLength(irp->input)); return SCARD_F_INTERNAL_ERROR; } Stream_Read_UINT32(irp->input, outputBufferLength); /* OutputBufferLength (4 bytes) */ - Stream_Read_UINT32(irp->input, inputBufferLength); /* InputBufferLength (4 bytes) */ - Stream_Read_UINT32(irp->input, ioControlCode); /* IoControlCode (4 bytes) */ - Stream_Seek(irp->input, 20); /* Padding (20 bytes) */ + Stream_Read_UINT32(irp->input, inputBufferLength); /* InputBufferLength (4 bytes) */ + Stream_Read_UINT32(irp->input, ioControlCode); /* IoControlCode (4 bytes) */ + Stream_Seek(irp->input, 20); /* Padding (20 bytes) */ operation->ioControlCode = ioControlCode; if (Stream_Length(irp->input) != (Stream_GetPosition(irp->input) + inputBufferLength)) { - WLog_WARN(TAG, "InputBufferLength mismatch: Actual: %"PRIuz" Expected: %"PRIuz"", - Stream_Length(irp->input), - Stream_GetPosition(irp->input) + inputBufferLength); + WLog_WARN(TAG, "InputBufferLength mismatch: Actual: %" PRIuz " Expected: %" PRIuz "", + Stream_Length(irp->input), Stream_GetPosition(irp->input) + inputBufferLength); return SCARD_F_INTERNAL_ERROR; } - WLog_DBG(TAG, "%s (0x%08"PRIX32") FileId: %"PRIu32" CompletionId: %"PRIu32"", - smartcard_get_ioctl_string(ioControlCode, TRUE), - ioControlCode, irp->FileId, irp->CompletionId); + WLog_DBG(TAG, "%s (0x%08" PRIX32 ") FileId: %" PRIu32 " CompletionId: %" PRIu32 "", + smartcard_get_ioctl_string(ioControlCode, TRUE), ioControlCode, irp->FileId, + irp->CompletionId); if ((ioControlCode != SCARD_IOCTL_ACCESSSTARTEDEVENT) && (ioControlCode != SCARD_IOCTL_RELEASESTARTEDEVENT)) { if ((status = smartcard_unpack_common_type_header(smartcard, irp->input))) { - WLog_ERR(TAG, "smartcard_unpack_common_type_header failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_common_type_header failed with error %" PRId32 "", + status); return SCARD_F_INTERNAL_ERROR; } if ((status = smartcard_unpack_private_type_header(smartcard, irp->input))) { - WLog_ERR(TAG, "smartcard_unpack_common_type_header failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_common_type_header failed with error %" PRId32 "", + status); return SCARD_F_INTERNAL_ERROR; } } @@ -1853,7 +1863,8 @@ LONG smartcard_irp_device_control_decode(SMARTCARD_DEVICE* smartcard, SIZE_T difference; difference = Stream_Length(irp->input) - Stream_GetPosition(irp->input); WLog_WARN(TAG, - "IRP was not fully parsed %s (0x%08"PRIX32"): Actual: %"PRIuz", Expected: %"PRIuz", Difference: %"PRIuz"", + "IRP was not fully parsed %s (0x%08" PRIX32 "): Actual: %" PRIuz + ", Expected: %" PRIuz ", Difference: %" PRIuz "", smartcard_get_ioctl_string(ioControlCode, TRUE), ioControlCode, Stream_GetPosition(irp->input), Stream_Length(irp->input), difference); winpr_HexDump(TAG, WLOG_WARN, Stream_Pointer(irp->input), difference); @@ -1864,7 +1875,8 @@ LONG smartcard_irp_device_control_decode(SMARTCARD_DEVICE* smartcard, SIZE_T difference; difference = Stream_GetPosition(irp->input) - Stream_Length(irp->input); WLog_WARN(TAG, - "IRP was parsed beyond its end %s (0x%08"PRIX32"): Actual: %"PRIuz", Expected: %"PRIuz", Difference: %"PRIuz"", + "IRP was parsed beyond its end %s (0x%08" PRIX32 "): Actual: %" PRIuz + ", Expected: %" PRIuz ", Difference: %" PRIuz "", smartcard_get_ioctl_string(ioControlCode, TRUE), ioControlCode, Stream_GetPosition(irp->input), Stream_Length(irp->input), difference); } @@ -1899,8 +1911,9 @@ LONG smartcard_irp_device_control_call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OP /* Device Control Response */ Stream_Seek_UINT32(irp->output); /* OutputBufferLength (4 bytes) */ Stream_Seek(irp->output, SMARTCARD_COMMON_TYPE_HEADER_LENGTH); /* CommonTypeHeader (8 bytes) */ - Stream_Seek(irp->output, SMARTCARD_PRIVATE_TYPE_HEADER_LENGTH); /* PrivateTypeHeader (8 bytes) */ - Stream_Seek_UINT32(irp->output); /* Result (4 bytes) */ + Stream_Seek(irp->output, + SMARTCARD_PRIVATE_TYPE_HEADER_LENGTH); /* PrivateTypeHeader (8 bytes) */ + Stream_Seek_UINT32(irp->output); /* Result (4 bytes) */ /* Call */ @@ -2116,14 +2129,14 @@ LONG smartcard_irp_device_control_call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OP (ioControlCode != SCARD_IOCTL_RELEASESTARTEDEVENT)) { offset = (RDPDR_DEVICE_IO_RESPONSE_LENGTH + RDPDR_DEVICE_IO_CONTROL_RSP_HDR_LENGTH); - smartcard_pack_write_size_align(smartcard, irp->output, Stream_GetPosition(irp->output) - offset, - 8); + smartcard_pack_write_size_align(smartcard, irp->output, + Stream_GetPosition(irp->output) - offset, 8); } if ((result != SCARD_S_SUCCESS) && (result != SCARD_E_TIMEOUT) && (result != SCARD_E_NO_READERS_AVAILABLE) && (result != SCARD_E_NO_SERVICE)) { - WLog_WARN(TAG, "IRP failure: %s (0x%08"PRIX32"), status: %s (0x%08"PRIX32")", + WLog_WARN(TAG, "IRP failure: %s (0x%08" PRIX32 "), status: %s (0x%08" PRIX32 ")", smartcard_get_ioctl_string(ioControlCode, TRUE), ioControlCode, SCardGetErrorString(result), result); } @@ -2134,7 +2147,7 @@ LONG smartcard_irp_device_control_call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OP { /* NTSTATUS error */ irp->IoStatus = (UINT32)result; - WLog_WARN(TAG, "IRP failure: %s (0x%08"PRIX32"), ntstatus: 0x%08"PRIX32"", + WLog_WARN(TAG, "IRP failure: %s (0x%08" PRIX32 "), ntstatus: 0x%08" PRIX32 "", smartcard_get_ioctl_string(ioControlCode, TRUE), ioControlCode, result); } @@ -2143,12 +2156,11 @@ LONG smartcard_irp_device_control_call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OP objectBufferLength = outputBufferLength - RDPDR_DEVICE_IO_RESPONSE_LENGTH; Stream_SetPosition(irp->output, RDPDR_DEVICE_IO_RESPONSE_LENGTH); /* Device Control Response */ - Stream_Write_UINT32(irp->output, outputBufferLength); /* OutputBufferLength (4 bytes) */ + Stream_Write_UINT32(irp->output, outputBufferLength); /* OutputBufferLength (4 bytes) */ smartcard_pack_common_type_header(smartcard, irp->output); /* CommonTypeHeader (8 bytes) */ smartcard_pack_private_type_header(smartcard, irp->output, objectBufferLength); /* PrivateTypeHeader (8 bytes) */ - Stream_Write_UINT32(irp->output, result); /* Result (4 bytes) */ + Stream_Write_UINT32(irp->output, result); /* Result (4 bytes) */ Stream_SetPosition(irp->output, Stream_Length(irp->output)); return SCARD_S_SUCCESS; } - diff --git a/channels/smartcard/client/smartcard_pack.c b/channels/smartcard/client/smartcard_pack.c index 6ab809c4d..b2ce09a0f 100644 --- a/channels/smartcard/client/smartcard_pack.c +++ b/channels/smartcard/client/smartcard_pack.c @@ -38,38 +38,38 @@ LONG smartcard_unpack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s if (Stream_GetRemainingLength(s) < 8) { - WLog_WARN(TAG, "CommonTypeHeader is too short: %"PRIuz"", - Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "CommonTypeHeader is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } /* Process CommonTypeHeader */ - Stream_Read_UINT8(s, version); /* Version (1 byte) */ - Stream_Read_UINT8(s, endianness); /* Endianness (1 byte) */ + Stream_Read_UINT8(s, version); /* Version (1 byte) */ + Stream_Read_UINT8(s, endianness); /* Endianness (1 byte) */ Stream_Read_UINT16(s, commonHeaderLength); /* CommonHeaderLength (2 bytes) */ - Stream_Read_UINT32(s, filler); /* Filler (4 bytes), should be 0xCCCCCCCC */ + Stream_Read_UINT32(s, filler); /* Filler (4 bytes), should be 0xCCCCCCCC */ if (version != 1) { - WLog_WARN(TAG, "Unsupported CommonTypeHeader Version %"PRIu8"", version); + WLog_WARN(TAG, "Unsupported CommonTypeHeader Version %" PRIu8 "", version); return STATUS_INVALID_PARAMETER; } if (endianness != 0x10) { - WLog_WARN(TAG, "Unsupported CommonTypeHeader Endianness %"PRIu8"", endianness); + WLog_WARN(TAG, "Unsupported CommonTypeHeader Endianness %" PRIu8 "", endianness); return STATUS_INVALID_PARAMETER; } if (commonHeaderLength != 8) { - WLog_WARN(TAG, "Unsupported CommonTypeHeader CommonHeaderLength %"PRIu16"", commonHeaderLength); + WLog_WARN(TAG, "Unsupported CommonTypeHeader CommonHeaderLength %" PRIu16 "", + commonHeaderLength); return STATUS_INVALID_PARAMETER; } if (filler != 0xCCCCCCCC) { - WLog_WARN(TAG, "Unexpected CommonTypeHeader Filler 0x%08"PRIX32"", filler); + WLog_WARN(TAG, "Unexpected CommonTypeHeader Filler 0x%08" PRIX32 "", filler); return STATUS_INVALID_PARAMETER; } @@ -79,9 +79,9 @@ LONG smartcard_unpack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s void smartcard_pack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s) { WINPR_UNUSED(smartcard); - Stream_Write_UINT8(s, 1); /* Version (1 byte) */ - Stream_Write_UINT8(s, 0x10); /* Endianness (1 byte) */ - Stream_Write_UINT16(s, 8); /* CommonHeaderLength (2 bytes) */ + Stream_Write_UINT8(s, 1); /* Version (1 byte) */ + Stream_Write_UINT8(s, 0x10); /* Endianness (1 byte) */ + Stream_Write_UINT16(s, 8); /* CommonHeaderLength (2 bytes) */ Stream_Write_UINT32(s, 0xCCCCCCCC); /* Filler (4 bytes), should be 0xCCCCCCCC */ } @@ -93,24 +93,24 @@ LONG smartcard_unpack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* if (Stream_GetRemainingLength(s) < 8) { - WLog_WARN(TAG, "PrivateTypeHeader is too short: %"PRIuz"", - Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "PrivateTypeHeader is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } Stream_Read_UINT32(s, objectBufferLength); /* ObjectBufferLength (4 bytes) */ - Stream_Read_UINT32(s, filler); /* Filler (4 bytes), should be 0x00000000 */ + Stream_Read_UINT32(s, filler); /* Filler (4 bytes), should be 0x00000000 */ if (filler != 0x00000000) { - WLog_WARN(TAG, "Unexpected PrivateTypeHeader Filler 0x%08"PRIX32"", filler); + WLog_WARN(TAG, "Unexpected PrivateTypeHeader Filler 0x%08" PRIX32 "", filler); return STATUS_INVALID_PARAMETER; } if (objectBufferLength != Stream_GetRemainingLength(s)) { WLog_WARN(TAG, - "PrivateTypeHeader ObjectBufferLength mismatch: Actual: %"PRIu32", Expected: %"PRIuz"", + "PrivateTypeHeader ObjectBufferLength mismatch: Actual: %" PRIu32 + ", Expected: %" PRIuz "", objectBufferLength, Stream_GetRemainingLength(s)); return STATUS_INVALID_PARAMETER; } @@ -123,7 +123,7 @@ void smartcard_pack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* s, { WINPR_UNUSED(smartcard); Stream_Write_UINT32(s, objectBufferLength); /* ObjectBufferLength (4 bytes) */ - Stream_Write_UINT32(s, 0x00000000); /* Filler (4 bytes), should be 0x00000000 */ + Stream_Write_UINT32(s, 0x00000000); /* Filler (4 bytes), should be 0x00000000 */ } LONG smartcard_unpack_read_size_align(SMARTCARD_DEVICE* smartcard, wStream* s, UINT32 size, @@ -165,7 +165,7 @@ LONG smartcard_pack_write_size_align(SMARTCARD_DEVICE* smartcard, wStream* s, UI } SCARDCONTEXT smartcard_scard_context_native_from_redir(SMARTCARD_DEVICE* smartcard, - REDIR_SCARDCONTEXT* context) + REDIR_SCARDCONTEXT* context) { SCARDCONTEXT hContext = { 0 }; WINPR_UNUSED(smartcard); @@ -173,7 +173,8 @@ SCARDCONTEXT smartcard_scard_context_native_from_redir(SMARTCARD_DEVICE* smartca if ((context->cbContext != sizeof(ULONG_PTR)) && (context->cbContext != 0)) { WLog_WARN(TAG, - "REDIR_SCARDCONTEXT does not match native size: Actual: %"PRIu32", Expected: %"PRIuz"", + "REDIR_SCARDCONTEXT does not match native size: Actual: %" PRIu32 + ", Expected: %" PRIuz "", context->cbContext, sizeof(ULONG_PTR)); return 0; } @@ -185,7 +186,7 @@ SCARDCONTEXT smartcard_scard_context_native_from_redir(SMARTCARD_DEVICE* smartca } void smartcard_scard_context_native_to_redir(SMARTCARD_DEVICE* smartcard, - REDIR_SCARDCONTEXT* context, SCARDCONTEXT hContext) + REDIR_SCARDCONTEXT* context, SCARDCONTEXT hContext) { WINPR_UNUSED(smartcard); ZeroMemory(context, sizeof(REDIR_SCARDCONTEXT)); @@ -194,7 +195,7 @@ void smartcard_scard_context_native_to_redir(SMARTCARD_DEVICE* smartcard, } SCARDHANDLE smartcard_scard_handle_native_from_redir(SMARTCARD_DEVICE* smartcard, - REDIR_SCARDHANDLE* handle) + REDIR_SCARDHANDLE* handle) { SCARDHANDLE hCard = 0; WINPR_UNUSED(smartcard); @@ -202,7 +203,8 @@ SCARDHANDLE smartcard_scard_handle_native_from_redir(SMARTCARD_DEVICE* smartcard if (handle->cbHandle != sizeof(ULONG_PTR)) { WLog_WARN(TAG, - "REDIR_SCARDHANDLE does not match native size: Actual: %"PRIu32", Expected: %"PRIuz"", + "REDIR_SCARDHANDLE does not match native size: Actual: %" PRIu32 + ", Expected: %" PRIuz "", handle->cbHandle, sizeof(ULONG_PTR)); return 0; } @@ -214,7 +216,7 @@ SCARDHANDLE smartcard_scard_handle_native_from_redir(SMARTCARD_DEVICE* smartcard } void smartcard_scard_handle_native_to_redir(SMARTCARD_DEVICE* smartcard, REDIR_SCARDHANDLE* handle, - SCARDHANDLE hCard) + SCARDHANDLE hCard) { WINPR_UNUSED(smartcard); ZeroMemory(handle, sizeof(REDIR_SCARDHANDLE)); @@ -223,7 +225,7 @@ void smartcard_scard_handle_native_to_redir(SMARTCARD_DEVICE* smartcard, REDIR_S } LONG smartcard_unpack_redir_scard_context(SMARTCARD_DEVICE* smartcard, wStream* s, - REDIR_SCARDCONTEXT* context) + REDIR_SCARDCONTEXT* context) { UINT32 pbContextNdrPtr; WINPR_UNUSED(smartcard); @@ -231,8 +233,7 @@ LONG smartcard_unpack_redir_scard_context(SMARTCARD_DEVICE* smartcard, wStream* if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too short: %"PRIuz"", - Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -240,30 +241,33 @@ LONG smartcard_unpack_redir_scard_context(SMARTCARD_DEVICE* smartcard, wStream* if (Stream_GetRemainingLength(s) < context->cbContext) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too short: Actual: %"PRIuz", Expected: %"PRIu32"", + WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too short: Actual: %" PRIuz ", Expected: %" PRIu32 "", Stream_GetRemainingLength(s), context->cbContext); return STATUS_BUFFER_TOO_SMALL; } if ((context->cbContext != 0) && (context->cbContext != 4) && (context->cbContext != 8)) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT length is not 0, 4 or 8: %"PRIu32"", context->cbContext); + WLog_WARN(TAG, "REDIR_SCARDCONTEXT length is not 0, 4 or 8: %" PRIu32 "", + context->cbContext); return STATUS_INVALID_PARAMETER; } Stream_Read_UINT32(s, pbContextNdrPtr); /* pbContextNdrPtr (4 bytes) */ - if (((context->cbContext == 0) && pbContextNdrPtr) || ((context->cbContext != 0) && - !pbContextNdrPtr)) + if (((context->cbContext == 0) && pbContextNdrPtr) || + ((context->cbContext != 0) && !pbContextNdrPtr)) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT cbContext (%"PRIu32") pbContextNdrPtr (%"PRIu32") inconsistency", + WLog_WARN(TAG, + "REDIR_SCARDCONTEXT cbContext (%" PRIu32 ") pbContextNdrPtr (%" PRIu32 + ") inconsistency", context->cbContext, pbContextNdrPtr); return STATUS_INVALID_PARAMETER; } if (context->cbContext > Stream_GetRemainingLength(s)) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too long: Actual: %"PRIuz", Expected: %"PRIu32"", + WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too long: Actual: %" PRIuz ", Expected: %" PRIu32 "", Stream_GetRemainingLength(s), context->cbContext); return STATUS_INVALID_PARAMETER; } @@ -278,12 +282,12 @@ LONG smartcard_pack_redir_scard_context(SMARTCARD_DEVICE* smartcard, wStream* s, WINPR_UNUSED(smartcard); pbContextNdrPtr = (context->cbContext) ? 0x00020001 : 0; Stream_Write_UINT32(s, context->cbContext); /* cbContext (4 bytes) */ - Stream_Write_UINT32(s, pbContextNdrPtr); /* pbContextNdrPtr (4 bytes) */ + Stream_Write_UINT32(s, pbContextNdrPtr); /* pbContextNdrPtr (4 bytes) */ return SCARD_S_SUCCESS; } LONG smartcard_unpack_redir_scard_context_ref(SMARTCARD_DEVICE* smartcard, wStream* s, - REDIR_SCARDCONTEXT* context) + REDIR_SCARDCONTEXT* context) { UINT32 length; WINPR_UNUSED(smartcard); @@ -293,7 +297,7 @@ LONG smartcard_unpack_redir_scard_context_ref(SMARTCARD_DEVICE* smartcard, wStre if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too short: Actual: %"PRIuz", Expected: 4", + WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too short: Actual: %" PRIuz ", Expected: 4", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -302,20 +306,20 @@ LONG smartcard_unpack_redir_scard_context_ref(SMARTCARD_DEVICE* smartcard, wStre if (length != context->cbContext) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT length (%"PRIu32") cbContext (%"PRIu32") mismatch", + WLog_WARN(TAG, "REDIR_SCARDCONTEXT length (%" PRIu32 ") cbContext (%" PRIu32 ") mismatch", length, context->cbContext); return STATUS_INVALID_PARAMETER; } if ((context->cbContext != 0) && (context->cbContext != 4) && (context->cbContext != 8)) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT length is not 4 or 8: %"PRIu32"", context->cbContext); + WLog_WARN(TAG, "REDIR_SCARDCONTEXT length is not 4 or 8: %" PRIu32 "", context->cbContext); return STATUS_INVALID_PARAMETER; } if (Stream_GetRemainingLength(s) < context->cbContext) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too short: Actual: %"PRIuz", Expected: %"PRIu32"", + WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too short: Actual: %" PRIuz ", Expected: %" PRIu32 "", Stream_GetRemainingLength(s), context->cbContext); return STATUS_BUFFER_TOO_SMALL; } @@ -329,7 +333,7 @@ LONG smartcard_unpack_redir_scard_context_ref(SMARTCARD_DEVICE* smartcard, wStre } LONG smartcard_pack_redir_scard_context_ref(SMARTCARD_DEVICE* smartcard, wStream* s, - REDIR_SCARDCONTEXT* context) + REDIR_SCARDCONTEXT* context) { WINPR_UNUSED(smartcard); Stream_Write_UINT32(s, context->cbContext); /* Length (4 bytes) */ @@ -343,7 +347,7 @@ LONG smartcard_pack_redir_scard_context_ref(SMARTCARD_DEVICE* smartcard, wStream } LONG smartcard_unpack_redir_scard_handle(SMARTCARD_DEVICE* smartcard, wStream* s, - REDIR_SCARDHANDLE* handle) + REDIR_SCARDHANDLE* handle) { UINT32 pbHandleNdrPtr; WINPR_UNUSED(smartcard); @@ -351,8 +355,7 @@ LONG smartcard_unpack_redir_scard_handle(SMARTCARD_DEVICE* smartcard, wStream* s if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "SCARDHANDLE is too short: %"PRIuz"", - Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "SCARDHANDLE is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -360,7 +363,7 @@ LONG smartcard_unpack_redir_scard_handle(SMARTCARD_DEVICE* smartcard, wStream* s if ((Stream_GetRemainingLength(s) < handle->cbHandle) || (!handle->cbHandle)) { - WLog_WARN(TAG, "SCARDHANDLE is too short: Actual: %"PRIuz", Expected: %"PRIu32"", + WLog_WARN(TAG, "SCARDHANDLE is too short: Actual: %" PRIuz ", Expected: %" PRIu32 "", Stream_GetRemainingLength(s), handle->cbHandle); return STATUS_BUFFER_TOO_SMALL; } @@ -376,19 +379,19 @@ LONG smartcard_pack_redir_scard_handle(SMARTCARD_DEVICE* smartcard, wStream* s, WINPR_UNUSED(smartcard); pbHandleNdrPtr = (handle->cbHandle) ? 0x00020002 : 0; Stream_Write_UINT32(s, handle->cbHandle); /* cbHandle (4 bytes) */ - Stream_Write_UINT32(s, pbHandleNdrPtr); /* pbHandleNdrPtr (4 bytes) */ + Stream_Write_UINT32(s, pbHandleNdrPtr); /* pbHandleNdrPtr (4 bytes) */ return SCARD_S_SUCCESS; } LONG smartcard_unpack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStream* s, - REDIR_SCARDHANDLE* handle) + REDIR_SCARDHANDLE* handle) { UINT32 length; WINPR_UNUSED(smartcard); if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "REDIR_SCARDHANDLE is too short: Actual: %"PRIuz", Expected: 4", + WLog_WARN(TAG, "REDIR_SCARDHANDLE is too short: Actual: %" PRIuz ", Expected: 4", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -397,20 +400,20 @@ LONG smartcard_unpack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStrea if (length != handle->cbHandle) { - WLog_WARN(TAG, "REDIR_SCARDHANDLE length (%"PRIu32") cbHandle (%"PRIu32") mismatch", + WLog_WARN(TAG, "REDIR_SCARDHANDLE length (%" PRIu32 ") cbHandle (%" PRIu32 ") mismatch", length, handle->cbHandle); return STATUS_INVALID_PARAMETER; } if ((handle->cbHandle != 4) && (handle->cbHandle != 8)) { - WLog_WARN(TAG, "REDIR_SCARDHANDLE length is not 4 or 8: %"PRIu32"", handle->cbHandle); + WLog_WARN(TAG, "REDIR_SCARDHANDLE length is not 4 or 8: %" PRIu32 "", handle->cbHandle); return STATUS_INVALID_PARAMETER; } if ((Stream_GetRemainingLength(s) < handle->cbHandle) || (!handle->cbHandle)) { - WLog_WARN(TAG, "REDIR_SCARDHANDLE is too short: Actual: %"PRIuz", Expected: %"PRIu32"", + WLog_WARN(TAG, "REDIR_SCARDHANDLE is too short: Actual: %" PRIuz ", Expected: %" PRIu32 "", Stream_GetRemainingLength(s), handle->cbHandle); return STATUS_BUFFER_TOO_SMALL; } @@ -422,7 +425,7 @@ LONG smartcard_unpack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStrea } LONG smartcard_pack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStream* s, - REDIR_SCARDHANDLE* handle) + REDIR_SCARDHANDLE* handle) { WINPR_UNUSED(smartcard); Stream_Write_UINT32(s, handle->cbHandle); /* Length (4 bytes) */ @@ -434,13 +437,13 @@ LONG smartcard_pack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStream* } LONG smartcard_unpack_establish_context_call(SMARTCARD_DEVICE* smartcard, wStream* s, - EstablishContext_Call* call) + EstablishContext_Call* call) { WINPR_UNUSED(smartcard); if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "EstablishContext_Call is too short: Actual: %"PRIuz", Expected: 4", + WLog_WARN(TAG, "EstablishContext_Call is too short: Actual: %" PRIuz ", Expected: 4", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -450,7 +453,7 @@ LONG smartcard_unpack_establish_context_call(SMARTCARD_DEVICE* smartcard, wStrea } void smartcard_trace_establish_context_call(SMARTCARD_DEVICE* smartcard, - const EstablishContext_Call* call) + const EstablishContext_Call* call) { WINPR_UNUSED(smartcard); @@ -458,30 +461,31 @@ void smartcard_trace_establish_context_call(SMARTCARD_DEVICE* smartcard, return; WLog_DBG(TAG, "EstablishContext_Call {"); - WLog_DBG(TAG, "dwScope: %s (0x%08"PRIX32")", - SCardGetScopeString(call->dwScope), call->dwScope); + WLog_DBG(TAG, "dwScope: %s (0x%08" PRIX32 ")", SCardGetScopeString(call->dwScope), + call->dwScope); WLog_DBG(TAG, "}"); } LONG smartcard_pack_establish_context_return(SMARTCARD_DEVICE* smartcard, wStream* s, - EstablishContext_Return* ret) + EstablishContext_Return* ret) { LONG status; if ((status = smartcard_pack_redir_scard_context(smartcard, s, &(ret->hContext)))) { - WLog_ERR(TAG, "smartcard_pack_redir_scard_context failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_redir_scard_context failed with error %" PRId32 "", status); return status; } if ((status = smartcard_pack_redir_scard_context_ref(smartcard, s, &(ret->hContext)))) - WLog_ERR(TAG, "smartcard_pack_redir_scard_context_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_redir_scard_context_ref failed with error %" PRId32 "", + status); return status; } void smartcard_trace_establish_context_return(SMARTCARD_DEVICE* smartcard, - const EstablishContext_Return* ret) + const EstablishContext_Return* ret) { BYTE* pb; WINPR_UNUSED(smartcard); @@ -490,19 +494,20 @@ void smartcard_trace_establish_context_return(SMARTCARD_DEVICE* smartcard, return; WLog_DBG(TAG, "EstablishContext_Return {"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", - SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); - pb = (BYTE*) & (ret->hContext.pbContext); + WLog_DBG(TAG, "ReturnCode: %s (0x%08" PRIX32 ")", SCardGetErrorString(ret->ReturnCode), + ret->ReturnCode); + pb = (BYTE*)&(ret->hContext.pbContext); if (ret->hContext.cbContext > 4) { WLog_DBG(TAG, - "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], ret->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], ret->hContext.cbContext); } @@ -515,17 +520,19 @@ LONG smartcard_unpack_context_call(SMARTCARD_DEVICE* smartcard, wStream* s, Cont if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %" PRId32 "", status); return status; } if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %" PRId32 "", + status); return status; } -void smartcard_trace_context_call(SMARTCARD_DEVICE* smartcard, const Context_Call* call, const char* name) +void smartcard_trace_context_call(SMARTCARD_DEVICE* smartcard, const Context_Call* call, + const char* name) { BYTE* pb; WINPR_UNUSED(smartcard); @@ -534,24 +541,26 @@ void smartcard_trace_context_call(SMARTCARD_DEVICE* smartcard, const Context_Cal return; WLog_DBG(TAG, "%s_Call {", name); - pb = (BYTE*) & (call->hContext.pbContext); + pb = (BYTE*)&(call->hContext.pbContext); if (call->hContext.cbContext > 4) { WLog_DBG(TAG, - "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } WLog_DBG(TAG, "}"); } -void smartcard_trace_long_return(SMARTCARD_DEVICE* smartcard, const Long_Return* ret, const char* name) +void smartcard_trace_long_return(SMARTCARD_DEVICE* smartcard, const Long_Return* ret, + const char* name) { WINPR_UNUSED(smartcard); @@ -559,13 +568,13 @@ void smartcard_trace_long_return(SMARTCARD_DEVICE* smartcard, const Long_Return* return; WLog_DBG(TAG, "%s_Return {", name); - WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", - SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); + WLog_DBG(TAG, "ReturnCode: %s (0x%08" PRIX32 ")", SCardGetErrorString(ret->ReturnCode), + ret->ReturnCode); WLog_DBG(TAG, "}"); } LONG smartcard_unpack_list_reader_groups_call(SMARTCARD_DEVICE* smartcard, wStream* s, - ListReaderGroups_Call* call) + ListReaderGroups_Call* call) { LONG status; status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)); @@ -575,13 +584,12 @@ LONG smartcard_unpack_list_reader_groups_call(SMARTCARD_DEVICE* smartcard, wStre if (Stream_GetRemainingLength(s) < 8) { - WLog_WARN(TAG, "ListReaderGroups_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "ListReaderGroups_Call is too short: %d", (int)Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } Stream_Read_UINT32(s, call->fmszGroupsIsNULL); /* fmszGroupsIsNULL (4 bytes) */ - Stream_Read_UINT32(s, call->cchGroups); /* cchGroups (4 bytes) */ + Stream_Read_UINT32(s, call->cchGroups); /* cchGroups (4 bytes) */ status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)); if (status) @@ -591,7 +599,7 @@ LONG smartcard_unpack_list_reader_groups_call(SMARTCARD_DEVICE* smartcard, wStre } void smartcard_trace_list_reader_groups_call(SMARTCARD_DEVICE* smartcard, - const ListReaderGroups_Call* call, BOOL unicode) + const ListReaderGroups_Call* call, BOOL unicode) { BYTE* pb; WINPR_UNUSED(smartcard); @@ -600,33 +608,34 @@ void smartcard_trace_list_reader_groups_call(SMARTCARD_DEVICE* smartcard, return; WLog_DBG(TAG, "ListReaderGroups%S_Call {", unicode ? "W" : "A"); - pb = (BYTE*) & (call->hContext.pbContext); + pb = (BYTE*)&(call->hContext.pbContext); if (call->hContext.cbContext > 4) { WLog_DBG(TAG, - "hContext: 0x%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8" (%"PRIu32")", + "hContext: 0x%02" PRIx8 "%02" PRIx8 "%02" PRIx8 "%02" PRIx8 "%02" PRIx8 "%02" PRIx8 + "%02" PRIx8 "%02" PRIx8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8" (%"PRIu32")", + WLog_DBG(TAG, "hContext: 0x%02" PRIx8 "%02" PRIx8 "%02" PRIx8 "%02" PRIx8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } - WLog_DBG(TAG, "fmszGroupsIsNULL: %"PRId32" cchGroups: 0x%08"PRIx32, - call->fmszGroupsIsNULL, call->cchGroups); + WLog_DBG(TAG, "fmszGroupsIsNULL: %" PRId32 " cchGroups: 0x%08" PRIx32, call->fmszGroupsIsNULL, + call->cchGroups); WLog_DBG(TAG, "}"); } LONG smartcard_pack_list_reader_groups_return(SMARTCARD_DEVICE* smartcard, wStream* s, - ListReaderGroups_Return* ret) + ListReaderGroups_Return* ret) { UINT32 mszNdrPtr; mszNdrPtr = (ret->cBytes) ? 0x00020008 : 0; Stream_EnsureRemainingCapacity(s, ret->cBytes + 32); Stream_Write_UINT32(s, ret->cBytes); /* cBytes (4 bytes) */ - Stream_Write_UINT32(s, mszNdrPtr); /* mszNdrPtr (4 bytes) */ + Stream_Write_UINT32(s, mszNdrPtr); /* mszNdrPtr (4 bytes) */ if (mszNdrPtr) { @@ -644,7 +653,7 @@ LONG smartcard_pack_list_reader_groups_return(SMARTCARD_DEVICE* smartcard, wStre } void smartcard_trace_list_reader_groups_return(SMARTCARD_DEVICE* smartcard, - const ListReaderGroups_Return* ret, BOOL unicode) + const ListReaderGroups_Return* ret, BOOL unicode) { int index; int length; @@ -657,12 +666,12 @@ void smartcard_trace_list_reader_groups_return(SMARTCARD_DEVICE* smartcard, if (unicode) { length = ret->cBytes / 2; - ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) ret->msz, length, &mszA, 0, NULL, NULL); + ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)ret->msz, length, &mszA, 0, NULL, NULL); } else { length = ret->cBytes; - mszA = (char*) malloc(length); + mszA = (char*)malloc(length); CopyMemory(mszA, ret->msz, ret->cBytes); } @@ -673,9 +682,9 @@ void smartcard_trace_list_reader_groups_return(SMARTCARD_DEVICE* smartcard, } WLog_DBG(TAG, "ListReaderGroups%s_Return {", unicode ? "W" : "A"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIx32")", - SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); - WLog_DBG(TAG, "cBytes: %"PRIu32" msz: %s", ret->cBytes, mszA); + WLog_DBG(TAG, "ReturnCode: %s (0x%08" PRIx32 ")", SCardGetErrorString(ret->ReturnCode), + ret->ReturnCode); + WLog_DBG(TAG, "cBytes: %" PRIu32 " msz: %s", ret->cBytes, mszA); WLog_DBG(TAG, "}"); free(mszA); } @@ -690,32 +699,33 @@ LONG smartcard_unpack_list_readers_call(SMARTCARD_DEVICE* smartcard, wStream* s, if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %" PRId32 "", status); return status; } if (Stream_GetRemainingLength(s) < 16) { - WLog_WARN(TAG, "ListReaders_Call is too short: %"PRIuz"", - Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "ListReaders_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } - Stream_Read_UINT32(s, call->cBytes); /* cBytes (4 bytes) */ - Stream_Read_UINT32(s, mszGroupsNdrPtr); /* mszGroupsNdrPtr (4 bytes) */ + Stream_Read_UINT32(s, call->cBytes); /* cBytes (4 bytes) */ + Stream_Read_UINT32(s, mszGroupsNdrPtr); /* mszGroupsNdrPtr (4 bytes) */ Stream_Read_UINT32(s, call->fmszReadersIsNULL); /* fmszReadersIsNULL (4 bytes) */ - Stream_Read_UINT32(s, call->cchReaders); /* cchReaders (4 bytes) */ + Stream_Read_UINT32(s, call->cchReaders); /* cchReaders (4 bytes) */ if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %" PRId32 "", + status); return status; } if ((mszGroupsNdrPtr && !call->cBytes) || (!mszGroupsNdrPtr && call->cBytes)) { WLog_WARN(TAG, - "ListReaders_Call mszGroupsNdrPtr (0x%08"PRIX32") and cBytes (0x%08"PRIX32") inconsistency", + "ListReaders_Call mszGroupsNdrPtr (0x%08" PRIX32 ") and cBytes (0x%08" PRIX32 + ") inconsistency", mszGroupsNdrPtr, call->cBytes); return STATUS_INVALID_PARAMETER; } @@ -726,19 +736,22 @@ LONG smartcard_unpack_list_readers_call(SMARTCARD_DEVICE* smartcard, wStream* s, if (count != call->cBytes) { - WLog_WARN(TAG, "ListReaders_Call NdrCount (0x%08"PRIX32") and cBytes (0x%08"PRIX32") inconsistency", + WLog_WARN(TAG, + "ListReaders_Call NdrCount (0x%08" PRIX32 ") and cBytes (0x%08" PRIX32 + ") inconsistency", count, call->cBytes); return STATUS_INVALID_PARAMETER; } if (Stream_GetRemainingLength(s) < call->cBytes) { - WLog_WARN(TAG, "ListReaders_Call is too short: Actual: %"PRIuz", Expected: %"PRIu32"", + WLog_WARN(TAG, + "ListReaders_Call is too short: Actual: %" PRIuz ", Expected: %" PRIu32 "", Stream_GetRemainingLength(s), call->cBytes); return STATUS_BUFFER_TOO_SMALL; } - call->mszGroups = (BYTE*) calloc(1, call->cBytes + 4); + call->mszGroups = (BYTE*)calloc(1, call->cBytes + 4); if (!call->mszGroups) { @@ -764,26 +777,28 @@ void smartcard_trace_list_readers_call(SMARTCARD_DEVICE* smartcard, const ListRe return; if (unicode) - ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) call->mszGroups, call->cBytes / 2, &mszGroupsA, 0, NULL, - NULL); + ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)call->mszGroups, call->cBytes / 2, &mszGroupsA, 0, + NULL, NULL); WLog_DBG(TAG, "ListReaders%s_Call {", unicode ? "W" : "A"); - pb = (BYTE*) & (call->hContext.pbContext); + pb = (BYTE*)&(call->hContext.pbContext); if (call->hContext.cbContext > 4) { WLog_DBG(TAG, - "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } WLog_DBG(TAG, - "cBytes: %"PRIu32" mszGroups: %s fmszReadersIsNULL: %"PRId32" cchReaders: 0x%08"PRIX32"", + "cBytes: %" PRIu32 " mszGroups: %s fmszReadersIsNULL: %" PRId32 + " cchReaders: 0x%08" PRIX32 "", call->cBytes, mszGroupsA, call->fmszReadersIsNULL, call->cchReaders); WLog_DBG(TAG, "}"); @@ -809,7 +824,7 @@ LONG smartcard_pack_list_readers_return(SMARTCARD_DEVICE* smartcard, wStream* s, } Stream_Write_UINT32(s, ret->cBytes); /* cBytes (4 bytes) */ - Stream_Write_UINT32(s, mszNdrPtr); /* mszNdrPtr (4 bytes) */ + Stream_Write_UINT32(s, mszNdrPtr); /* mszNdrPtr (4 bytes) */ if (mszNdrPtr) { @@ -822,7 +837,7 @@ LONG smartcard_pack_list_readers_return(SMARTCARD_DEVICE* smartcard, wStream* s, if ((error = smartcard_pack_write_size_align(smartcard, s, ret->cBytes, 4))) { - WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %"PRId32"", error); + WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %" PRId32 "", error); return error; } } @@ -831,7 +846,7 @@ LONG smartcard_pack_list_readers_return(SMARTCARD_DEVICE* smartcard, wStream* s, } void smartcard_trace_list_readers_return(SMARTCARD_DEVICE* smartcard, const ListReaders_Return* ret, - BOOL unicode) + BOOL unicode) { size_t index; size_t length; @@ -842,8 +857,8 @@ void smartcard_trace_list_readers_return(SMARTCARD_DEVICE* smartcard, const List return; WLog_DBG(TAG, "ListReaders%s_Return {", unicode ? "W" : "A"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", - SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); + WLog_DBG(TAG, "ReturnCode: %s (0x%08" PRIX32 ")", SCardGetErrorString(ret->ReturnCode), + ret->ReturnCode); if (ret->ReturnCode != SCARD_S_SUCCESS) { @@ -855,8 +870,7 @@ void smartcard_trace_list_readers_return(SMARTCARD_DEVICE* smartcard, const List { length = ret->cBytes / 2; - if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) ret->msz, (int)length, - &mszA, 0, NULL, NULL) < 1) + if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)ret->msz, (int)length, &mszA, 0, NULL, NULL) < 1) { WLog_ERR(TAG, "ConvertFromUnicode failed"); return; @@ -865,7 +879,7 @@ void smartcard_trace_list_readers_return(SMARTCARD_DEVICE* smartcard, const List else { length = ret->cBytes; - mszA = (char*) malloc(length); + mszA = (char*)malloc(length); if (!mszA) { @@ -882,7 +896,7 @@ void smartcard_trace_list_readers_return(SMARTCARD_DEVICE* smartcard, const List mszA[index] = ','; } - WLog_DBG(TAG, "cBytes: %"PRIu32" msz: %s", ret->cBytes, mszA); + WLog_DBG(TAG, "cBytes: %" PRIu32 " msz: %s", ret->cBytes, mszA); WLog_DBG(TAG, "}"); free(mszA); } @@ -894,18 +908,17 @@ LONG smartcard_unpack_connect_common(SMARTCARD_DEVICE* smartcard, wStream* s, if (Stream_GetRemainingLength(s) < 8) { - WLog_WARN(TAG, "Connect_Common is too short: %"PRIuz"", - Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "Connect_Common is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(common->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %" PRId32 "", status); return status; } - Stream_Read_UINT32(s, common->dwShareMode); /* dwShareMode (4 bytes) */ + Stream_Read_UINT32(s, common->dwShareMode); /* dwShareMode (4 bytes) */ Stream_Read_UINT32(s, common->dwPreferredProtocols); /* dwPreferredProtocols (4 bytes) */ return SCARD_S_SUCCESS; } @@ -918,8 +931,7 @@ LONG smartcard_unpack_connect_a_call(SMARTCARD_DEVICE* smartcard, wStream* s, Co if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "ConnectA_Call is too short: %"PRIuz"", - Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "ConnectA_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -927,15 +939,15 @@ LONG smartcard_unpack_connect_a_call(SMARTCARD_DEVICE* smartcard, wStream* s, Co if ((status = smartcard_unpack_connect_common(smartcard, s, &(call->Common)))) { - WLog_ERR(TAG, "smartcard_unpack_connect_common failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_connect_common failed with error %" PRId32 "", status); return status; } /* szReader */ - Stream_Seek_UINT32(s); /* NdrMaxCount (4 bytes) */ - Stream_Seek_UINT32(s); /* NdrOffset (4 bytes) */ + Stream_Seek_UINT32(s); /* NdrMaxCount (4 bytes) */ + Stream_Seek_UINT32(s); /* NdrOffset (4 bytes) */ Stream_Read_UINT32(s, count); /* NdrActualCount (4 bytes) */ - call->szReader = (unsigned char*) malloc(count + 1); + call->szReader = (unsigned char*)malloc(count + 1); if (!call->szReader) { @@ -948,7 +960,8 @@ LONG smartcard_unpack_connect_a_call(SMARTCARD_DEVICE* smartcard, wStream* s, Co call->szReader[count] = '\0'; if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->Common.hContext)))) - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %" PRId32 "", + status); return status; } @@ -962,24 +975,28 @@ void smartcard_trace_connect_a_call(SMARTCARD_DEVICE* smartcard, const ConnectA_ return; WLog_DBG(TAG, "ConnectA_Call {"); - pb = (BYTE*) & (call->Common.hContext.pbContext); + pb = (BYTE*)&(call->Common.hContext.pbContext); if (call->Common.hContext.cbContext > 4) { WLog_DBG(TAG, - "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", - pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->Common.hContext.cbContext); + "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", + pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], + call->Common.hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->Common.hContext.cbContext); } WLog_DBG(TAG, - "szReader: %s dwShareMode: %s (0x%08"PRIX32") dwPreferredProtocols: %s (0x%08"PRIX32")", - call->szReader, SCardGetShareModeString(call->Common.dwShareMode), call->Common.dwShareMode, - SCardGetProtocolString(call->Common.dwPreferredProtocols), call->Common.dwPreferredProtocols); + "szReader: %s dwShareMode: %s (0x%08" PRIX32 ") dwPreferredProtocols: %s (0x%08" PRIX32 + ")", + call->szReader, SCardGetShareModeString(call->Common.dwShareMode), + call->Common.dwShareMode, SCardGetProtocolString(call->Common.dwPreferredProtocols), + call->Common.dwPreferredProtocols); WLog_DBG(TAG, "}"); } @@ -991,8 +1008,7 @@ LONG smartcard_unpack_connect_w_call(SMARTCARD_DEVICE* smartcard, wStream* s, Co if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "ConnectW_Call is too short: %"PRIuz"", - Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "ConnectW_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1000,15 +1016,15 @@ LONG smartcard_unpack_connect_w_call(SMARTCARD_DEVICE* smartcard, wStream* s, Co if ((status = smartcard_unpack_connect_common(smartcard, s, &(call->Common)))) { - WLog_ERR(TAG, "smartcard_unpack_connect_common failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_connect_common failed with error %" PRId32 "", status); return status; } /* szReader */ - Stream_Seek_UINT32(s); /* NdrMaxCount (4 bytes) */ - Stream_Seek_UINT32(s); /* NdrOffset (4 bytes) */ + Stream_Seek_UINT32(s); /* NdrMaxCount (4 bytes) */ + Stream_Seek_UINT32(s); /* NdrOffset (4 bytes) */ Stream_Read_UINT32(s, count); /* NdrActualCount (4 bytes) */ - call->szReader = (WCHAR*) calloc((count + 1), 2); + call->szReader = (WCHAR*)calloc((count + 1), 2); if (!call->szReader) { @@ -1021,7 +1037,8 @@ LONG smartcard_unpack_connect_w_call(SMARTCARD_DEVICE* smartcard, wStream* s, Co call->szReader[count] = '\0'; if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->Common.hContext)))) - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %" PRId32 "", + status); return status; } @@ -1037,24 +1054,28 @@ void smartcard_trace_connect_w_call(SMARTCARD_DEVICE* smartcard, const ConnectW_ ConvertFromUnicode(CP_UTF8, 0, call->szReader, -1, &szReaderA, 0, NULL, NULL); WLog_DBG(TAG, "ConnectW_Call {"); - pb = (BYTE*) & (call->Common.hContext.pbContext); + pb = (BYTE*)&(call->Common.hContext.pbContext); if (call->Common.hContext.cbContext > 4) { WLog_DBG(TAG, - "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", - pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->Common.hContext.cbContext); + "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", + pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], + call->Common.hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->Common.hContext.cbContext); } WLog_DBG(TAG, - "szReader: %s dwShareMode: %s (0x%08"PRIX32") dwPreferredProtocols: %s (0x%08"PRIX32")", + "szReader: %s dwShareMode: %s (0x%08" PRIX32 ") dwPreferredProtocols: %s (0x%08" PRIX32 + ")", szReaderA, SCardGetShareModeString(call->Common.dwShareMode), call->Common.dwShareMode, - SCardGetProtocolString(call->Common.dwPreferredProtocols), call->Common.dwPreferredProtocols); + SCardGetProtocolString(call->Common.dwPreferredProtocols), + call->Common.dwPreferredProtocols); WLog_DBG(TAG, "}"); free(szReaderA); } @@ -1065,13 +1086,13 @@ LONG smartcard_pack_connect_return(SMARTCARD_DEVICE* smartcard, wStream* s, Conn if ((status = smartcard_pack_redir_scard_context(smartcard, s, &(ret->hContext)))) { - WLog_ERR(TAG, "smartcard_pack_redir_scard_context failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_redir_scard_context failed with error %" PRId32 "", status); return status; } if ((status = smartcard_pack_redir_scard_handle(smartcard, s, &(ret->hCard)))) { - WLog_ERR(TAG, "smartcard_pack_redir_scard_handle failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_redir_scard_handle failed with error %" PRId32 "", status); return status; } @@ -1079,12 +1100,14 @@ LONG smartcard_pack_connect_return(SMARTCARD_DEVICE* smartcard, wStream* s, Conn if ((status = smartcard_pack_redir_scard_context_ref(smartcard, s, &(ret->hContext)))) { - WLog_ERR(TAG, "smartcard_pack_redir_scard_context_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_redir_scard_context_ref failed with error %" PRId32 "", + status); return status; } if ((status = smartcard_pack_redir_scard_handle_ref(smartcard, s, &(ret->hCard)))) - WLog_ERR(TAG, "smartcard_pack_redir_scard_handle_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_redir_scard_handle_ref failed with error %" PRId32 "", + status); return status; } @@ -1098,37 +1121,39 @@ void smartcard_trace_connect_return(SMARTCARD_DEVICE* smartcard, const Connect_R return; WLog_DBG(TAG, "Connect_Return {"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", - SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); - pb = (BYTE*) & (ret->hContext.pbContext); + WLog_DBG(TAG, "ReturnCode: %s (0x%08" PRIX32 ")", SCardGetErrorString(ret->ReturnCode), + ret->ReturnCode); + pb = (BYTE*)&(ret->hContext.pbContext); if (ret->hContext.cbContext > 4) { WLog_DBG(TAG, - "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], ret->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], ret->hContext.cbContext); } - pb = (BYTE*) & (ret->hCard.pbHandle); + pb = (BYTE*)&(ret->hCard.pbHandle); if (ret->hCard.cbHandle > 4) { WLog_DBG(TAG, - "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hCard: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], ret->hCard.cbHandle); } else { - WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hCard: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], ret->hCard.cbHandle); } - WLog_DBG(TAG, "dwActiveProtocol: %s (0x%08"PRIX32")", + WLog_DBG(TAG, "dwActiveProtocol: %s (0x%08" PRIX32 ")", SCardGetProtocolString(ret->dwActiveProtocol), ret->dwActiveProtocol); WLog_DBG(TAG, "}"); } @@ -1139,35 +1164,36 @@ LONG smartcard_unpack_reconnect_call(SMARTCARD_DEVICE* smartcard, wStream* s, Re if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %" PRId32 "", status); return status; } if ((status = smartcard_unpack_redir_scard_handle(smartcard, s, &(call->hCard)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %" PRId32 "", status); return status; } if (Stream_GetRemainingLength(s) < 12) { - WLog_WARN(TAG, "Reconnect_Call is too short: %"PRIuz"", - Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "Reconnect_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } - Stream_Read_UINT32(s, call->dwShareMode); /* dwShareMode (4 bytes) */ + Stream_Read_UINT32(s, call->dwShareMode); /* dwShareMode (4 bytes) */ Stream_Read_UINT32(s, call->dwPreferredProtocols); /* dwPreferredProtocols (4 bytes) */ - Stream_Read_UINT32(s, call->dwInitialization); /* dwInitialization (4 bytes) */ + Stream_Read_UINT32(s, call->dwInitialization); /* dwInitialization (4 bytes) */ if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %" PRId32 "", + status); return status; } if ((status = smartcard_unpack_redir_scard_handle_ref(smartcard, s, &(call->hCard)))) - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %" PRId32 "", + status); return status; } @@ -1181,36 +1207,39 @@ void smartcard_trace_reconnect_call(SMARTCARD_DEVICE* smartcard, const Reconnect return; WLog_DBG(TAG, "Reconnect_Call {"); - pb = (BYTE*) & (call->hContext.pbContext); + pb = (BYTE*)&(call->hContext.pbContext); if (call->hContext.cbContext > 4) { WLog_DBG(TAG, - "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } - pb = (BYTE*) & (call->hCard.pbHandle); + pb = (BYTE*)&(call->hCard.pbHandle); if (call->hCard.cbHandle > 4) { WLog_DBG(TAG, - "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hCard: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hCard.cbHandle); } else { - WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hCard: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->hCard.cbHandle); } WLog_DBG(TAG, - "dwShareMode: %s (0x%08"PRIX32") dwPreferredProtocols: %s (0x%08"PRIX32") dwInitialization: %s (0x%08"PRIX32")", + "dwShareMode: %s (0x%08" PRIX32 ") dwPreferredProtocols: %s (0x%08" PRIX32 + ") dwInitialization: %s (0x%08" PRIX32 ")", SCardGetShareModeString(call->dwShareMode), call->dwShareMode, SCardGetProtocolString(call->dwPreferredProtocols), call->dwPreferredProtocols, SCardGetDispositionString(call->dwInitialization), call->dwInitialization); @@ -1232,33 +1261,33 @@ void smartcard_trace_reconnect_return(SMARTCARD_DEVICE* smartcard, const Reconne return; WLog_DBG(TAG, "Reconnect_Return {"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", - SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); - WLog_DBG(TAG, "dwActiveProtocol: %s (0x%08"PRIX32")", + WLog_DBG(TAG, "ReturnCode: %s (0x%08" PRIX32 ")", SCardGetErrorString(ret->ReturnCode), + ret->ReturnCode); + WLog_DBG(TAG, "dwActiveProtocol: %s (0x%08" PRIX32 ")", SCardGetProtocolString(ret->dwActiveProtocol), ret->dwActiveProtocol); WLog_DBG(TAG, "}"); } LONG smartcard_unpack_hcard_and_disposition_call(SMARTCARD_DEVICE* smartcard, wStream* s, - HCardAndDisposition_Call* call) + HCardAndDisposition_Call* call) { LONG status; if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %" PRId32 "", status); return status; } if ((status = smartcard_unpack_redir_scard_handle(smartcard, s, &(call->hCard)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %" PRId32 "", status); return status; } if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "HCardAndDisposition_Call is too short: %"PRIuz"", + WLog_WARN(TAG, "HCardAndDisposition_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1267,18 +1296,20 @@ LONG smartcard_unpack_hcard_and_disposition_call(SMARTCARD_DEVICE* smartcard, wS if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %" PRId32 "", + status); return status; } if ((status = smartcard_unpack_redir_scard_handle_ref(smartcard, s, &(call->hCard)))) - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %" PRId32 "", + status); return status; } void smartcard_trace_hcard_and_disposition_call(SMARTCARD_DEVICE* smartcard, - HCardAndDisposition_Call* call, const char* name) + HCardAndDisposition_Call* call, const char* name) { BYTE* pb; WINPR_UNUSED(smartcard); @@ -1287,41 +1318,43 @@ void smartcard_trace_hcard_and_disposition_call(SMARTCARD_DEVICE* smartcard, return; WLog_DBG(TAG, "%s_Call {", name); - pb = (BYTE*) & (call->hContext.pbContext); + pb = (BYTE*)&(call->hContext.pbContext); if (call->hContext.cbContext > 4) { WLog_DBG(TAG, - "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } - pb = (BYTE*) & (call->hCard.pbHandle); + pb = (BYTE*)&(call->hCard.pbHandle); if (call->hCard.cbHandle > 4) { WLog_DBG(TAG, - "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hCard: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hCard.cbHandle); } else { - WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hCard: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->hCard.cbHandle); } - WLog_DBG(TAG, "dwDisposition: %s (0x%08"PRIX32")", + WLog_DBG(TAG, "dwDisposition: %s (0x%08" PRIX32 ")", SCardGetDispositionString(call->dwDisposition), call->dwDisposition); WLog_DBG(TAG, "}"); } LONG smartcard_unpack_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, wStream* s, - GetStatusChangeA_Call* call) + GetStatusChangeA_Call* call) { UINT32 index; UINT32 count; @@ -1335,30 +1368,31 @@ LONG smartcard_unpack_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, wStr if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %" PRId32 "", status); return status; } if (Stream_GetRemainingLength(s) < 12) { - WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %"PRIuz"", + WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } - Stream_Read_UINT32(s, call->dwTimeOut); /* dwTimeOut (4 bytes) */ - Stream_Read_UINT32(s, call->cReaders); /* cReaders (4 bytes) */ + Stream_Read_UINT32(s, call->dwTimeOut); /* dwTimeOut (4 bytes) */ + Stream_Read_UINT32(s, call->cReaders); /* cReaders (4 bytes) */ Stream_Read_UINT32(s, rgReaderStatesNdrPtr); /* rgReaderStatesNdrPtr (4 bytes) */ if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %" PRId32 "", + status); return status; } if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %"PRIuz"", + WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1368,14 +1402,16 @@ LONG smartcard_unpack_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, wStr if (count != call->cReaders) { WLog_WARN(TAG, - "GetStatusChangeA_Call unexpected reader count: Actual: %"PRIu32", Expected: %"PRIu32"", + "GetStatusChangeA_Call unexpected reader count: Actual: %" PRIu32 + ", Expected: %" PRIu32 "", count, call->cReaders); return STATUS_INVALID_PARAMETER; } if (call->cReaders > 0) { - call->rgReaderStates = (LPSCARD_READERSTATEA) calloc(call->cReaders, sizeof(SCARD_READERSTATEA)); + call->rgReaderStates = + (LPSCARD_READERSTATEA)calloc(call->cReaders, sizeof(SCARD_READERSTATEA)); if (!call->rgReaderStates) { @@ -1389,17 +1425,17 @@ LONG smartcard_unpack_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, wStr if (Stream_GetRemainingLength(s) < 52) { - WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %"PRIuz"", + WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } - Stream_Read_UINT32(s, szReaderNdrPtr); /* szReaderNdrPtr (4 bytes) */ + Stream_Read_UINT32(s, szReaderNdrPtr); /* szReaderNdrPtr (4 bytes) */ Stream_Read_UINT32(s, readerState->dwCurrentState); /* dwCurrentState (4 bytes) */ - Stream_Read_UINT32(s, readerState->dwEventState); /* dwEventState (4 bytes) */ - Stream_Read_UINT32(s, readerState->cbAtr); /* cbAtr (4 bytes) */ - Stream_Read(s, readerState->rgbAtr, 32); /* rgbAtr [0..32] (32 bytes) */ - Stream_Seek(s, 4); /* rgbAtr [32..36] (4 bytes) */ + Stream_Read_UINT32(s, readerState->dwEventState); /* dwEventState (4 bytes) */ + Stream_Read_UINT32(s, readerState->cbAtr); /* cbAtr (4 bytes) */ + Stream_Read(s, readerState->rgbAtr, 32); /* rgbAtr [0..32] (32 bytes) */ + Stream_Seek(s, 4); /* rgbAtr [32..36] (4 bytes) */ } for (index = 0; index < call->cReaders; index++) @@ -1408,23 +1444,23 @@ LONG smartcard_unpack_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, wStr if (Stream_GetRemainingLength(s) < 12) { - WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %"PRIuz"", + WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } Stream_Read_UINT32(s, maxCount); /* NdrMaxCount (4 bytes) */ - Stream_Read_UINT32(s, offset); /* NdrOffset (4 bytes) */ - Stream_Read_UINT32(s, count); /* NdrActualCount (4 bytes) */ + Stream_Read_UINT32(s, offset); /* NdrOffset (4 bytes) */ + Stream_Read_UINT32(s, count); /* NdrActualCount (4 bytes) */ if (Stream_GetRemainingLength(s) < count) { - WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %"PRIuz"", + WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } - readerState->szReader = (LPCSTR) malloc(count + 1); + readerState->szReader = (LPCSTR)malloc(count + 1); if (!readerState->szReader) { @@ -1432,9 +1468,9 @@ LONG smartcard_unpack_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, wStr return STATUS_NO_MEMORY; } - Stream_Read(s, (void*) readerState->szReader, count); + Stream_Read(s, (void*)readerState->szReader, count); smartcard_unpack_read_size_align(smartcard, s, count, 4); - ((char*) readerState->szReader)[count] = '\0'; + ((char*)readerState->szReader)[count] = '\0'; if (!readerState->szReader) { @@ -1448,7 +1484,7 @@ LONG smartcard_unpack_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, wStr } void smartcard_trace_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, - const GetStatusChangeA_Call* call) + const GetStatusChangeA_Call* call) { BYTE* pb; UINT32 index; @@ -1461,34 +1497,35 @@ void smartcard_trace_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, return; WLog_DBG(TAG, "GetStatusChangeA_Call {"); - pb = (BYTE*) & (call->hContext.pbContext); + pb = (BYTE*)&(call->hContext.pbContext); if (call->hContext.cbContext > 4) { WLog_DBG(TAG, - "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } - WLog_DBG(TAG, "dwTimeOut: 0x%08"PRIX32" cReaders: %"PRIu32"", - call->dwTimeOut, call->cReaders); + WLog_DBG(TAG, "dwTimeOut: 0x%08" PRIX32 " cReaders: %" PRIu32 "", call->dwTimeOut, + call->cReaders); for (index = 0; index < call->cReaders; index++) { readerState = &call->rgReaderStates[index]; - WLog_DBG(TAG, "\t[%"PRIu32"]: szReader: %s cbAtr: %"PRIu32"", - index, readerState->szReader, readerState->cbAtr); + WLog_DBG(TAG, "\t[%" PRIu32 "]: szReader: %s cbAtr: %" PRIu32 "", index, + readerState->szReader, readerState->cbAtr); szCurrentState = SCardGetReaderStateString(readerState->dwCurrentState); szEventState = SCardGetReaderStateString(readerState->dwEventState); - WLog_DBG(TAG, "\t[%"PRIu32"]: dwCurrentState: %s (0x%08"PRIX32")", - index, szCurrentState, readerState->dwCurrentState); - WLog_DBG(TAG, "\t[%"PRIu32"]: dwEventState: %s (0x%08"PRIX32")", - index, szEventState, readerState->dwEventState); + WLog_DBG(TAG, "\t[%" PRIu32 "]: dwCurrentState: %s (0x%08" PRIX32 ")", index, + szCurrentState, readerState->dwCurrentState); + WLog_DBG(TAG, "\t[%" PRIu32 "]: dwEventState: %s (0x%08" PRIX32 ")", index, szEventState, + readerState->dwEventState); free(szCurrentState); free(szEventState); } @@ -1497,7 +1534,7 @@ void smartcard_trace_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, } LONG smartcard_unpack_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, wStream* s, - GetStatusChangeW_Call* call) + GetStatusChangeW_Call* call) { UINT32 index; UINT32 count; @@ -1511,30 +1548,31 @@ LONG smartcard_unpack_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, wStr if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %" PRId32 "", status); return status; } if (Stream_GetRemainingLength(s) < 12) { - WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %"PRIuz"", + WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } - Stream_Read_UINT32(s, call->dwTimeOut); /* dwTimeOut (4 bytes) */ - Stream_Read_UINT32(s, call->cReaders); /* cReaders (4 bytes) */ + Stream_Read_UINT32(s, call->dwTimeOut); /* dwTimeOut (4 bytes) */ + Stream_Read_UINT32(s, call->cReaders); /* cReaders (4 bytes) */ Stream_Read_UINT32(s, rgReaderStatesNdrPtr); /* rgReaderStatesNdrPtr (4 bytes) */ if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %" PRId32 "", + status); return status; } if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %"PRIuz"", + WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1543,7 +1581,8 @@ LONG smartcard_unpack_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, wStr if (call->cReaders > 0) { - call->rgReaderStates = (LPSCARD_READERSTATEW) calloc(call->cReaders, sizeof(SCARD_READERSTATEW)); + call->rgReaderStates = + (LPSCARD_READERSTATEW)calloc(call->cReaders, sizeof(SCARD_READERSTATEW)); if (!call->rgReaderStates) { @@ -1557,17 +1596,17 @@ LONG smartcard_unpack_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, wStr if (Stream_GetRemainingLength(s) < 52) { - WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %"PRIuz"", + WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } - Stream_Read_UINT32(s, szReaderNdrPtr); /* (4 bytes) */ + Stream_Read_UINT32(s, szReaderNdrPtr); /* (4 bytes) */ Stream_Read_UINT32(s, readerState->dwCurrentState); /* dwCurrentState (4 bytes) */ - Stream_Read_UINT32(s, readerState->dwEventState); /* dwEventState (4 bytes) */ - Stream_Read_UINT32(s, readerState->cbAtr); /* cbAtr (4 bytes) */ - Stream_Read(s, readerState->rgbAtr, 32); /* rgbAtr [0..32] (32 bytes) */ - Stream_Seek(s, 4); /* rgbAtr [32..36] (4 bytes) */ + Stream_Read_UINT32(s, readerState->dwEventState); /* dwEventState (4 bytes) */ + Stream_Read_UINT32(s, readerState->cbAtr); /* cbAtr (4 bytes) */ + Stream_Read(s, readerState->rgbAtr, 32); /* rgbAtr [0..32] (32 bytes) */ + Stream_Seek(s, 4); /* rgbAtr [32..36] (4 bytes) */ } for (index = 0; index < call->cReaders; index++) @@ -1576,23 +1615,23 @@ LONG smartcard_unpack_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, wStr if (Stream_GetRemainingLength(s) < 12) { - WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %"PRIuz"", + WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } Stream_Read_UINT32(s, maxCount); /* NdrMaxCount (4 bytes) */ - Stream_Read_UINT32(s, offset); /* NdrOffset (4 bytes) */ - Stream_Read_UINT32(s, count); /* NdrActualCount (4 bytes) */ + Stream_Read_UINT32(s, offset); /* NdrOffset (4 bytes) */ + Stream_Read_UINT32(s, count); /* NdrActualCount (4 bytes) */ if (Stream_GetRemainingLength(s) < (count * 2)) { - WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %"PRIuz"", + WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } - readerState->szReader = (WCHAR*) calloc((count + 1), 2); + readerState->szReader = (WCHAR*)calloc((count + 1), 2); if (!readerState->szReader) { @@ -1600,9 +1639,9 @@ LONG smartcard_unpack_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, wStr return STATUS_NO_MEMORY; } - Stream_Read(s, (void*) readerState->szReader, (count * 2)); + Stream_Read(s, (void*)readerState->szReader, (count * 2)); smartcard_unpack_read_size_align(smartcard, s, (count * 2), 4); - ((WCHAR*) readerState->szReader)[count] = '\0'; + ((WCHAR*)readerState->szReader)[count] = '\0'; if (!readerState->szReader) { @@ -1616,7 +1655,7 @@ LONG smartcard_unpack_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, wStr } void smartcard_trace_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, - GetStatusChangeW_Call* call) + GetStatusChangeW_Call* call) { BYTE* pb; UINT32 index; @@ -1629,36 +1668,37 @@ void smartcard_trace_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, return; WLog_DBG(TAG, "GetStatusChangeW_Call {"); - pb = (BYTE*) & (call->hContext.pbContext); + pb = (BYTE*)&(call->hContext.pbContext); if (call->hContext.cbContext > 4) { WLog_DBG(TAG, - "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } - WLog_DBG(TAG, "dwTimeOut: 0x%08"PRIX32" cReaders: %"PRIu32"", - call->dwTimeOut, call->cReaders); + WLog_DBG(TAG, "dwTimeOut: 0x%08" PRIX32 " cReaders: %" PRIu32 "", call->dwTimeOut, + call->cReaders); for (index = 0; index < call->cReaders; index++) { char* szReaderA = NULL; readerState = &call->rgReaderStates[index]; ConvertFromUnicode(CP_UTF8, 0, readerState->szReader, -1, &szReaderA, 0, NULL, NULL); - WLog_DBG(TAG, "\t[%"PRIu32"]: szReader: %s cbAtr: %"PRIu32"", - index, szReaderA, readerState->cbAtr); + WLog_DBG(TAG, "\t[%" PRIu32 "]: szReader: %s cbAtr: %" PRIu32 "", index, szReaderA, + readerState->cbAtr); szCurrentState = SCardGetReaderStateString(readerState->dwCurrentState); szEventState = SCardGetReaderStateString(readerState->dwEventState); - WLog_DBG(TAG, "\t[%"PRIu32"]: dwCurrentState: %s (0x%08"PRIX32")", - index, szCurrentState, readerState->dwCurrentState); - WLog_DBG(TAG, "\t[%"PRIu32"]: dwEventState: %s (0x%08"PRIX32")", - index, szEventState, readerState->dwEventState); + WLog_DBG(TAG, "\t[%" PRIu32 "]: dwCurrentState: %s (0x%08" PRIX32 ")", index, + szCurrentState, readerState->dwCurrentState); + WLog_DBG(TAG, "\t[%" PRIu32 "]: dwEventState: %s (0x%08" PRIX32 ")", index, szEventState, + readerState->dwEventState); free(szCurrentState); free(szEventState); free(szReaderA); @@ -1668,30 +1708,30 @@ void smartcard_trace_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, } LONG smartcard_pack_get_status_change_return(SMARTCARD_DEVICE* smartcard, wStream* s, - GetStatusChange_Return* ret) + GetStatusChange_Return* ret) { UINT32 index; ReaderState_Return* rgReaderState; WINPR_UNUSED(smartcard); Stream_Write_UINT32(s, ret->cReaders); /* cReaders (4 bytes) */ - Stream_Write_UINT32(s, 0x00020100); /* rgReaderStatesNdrPtr (4 bytes) */ + Stream_Write_UINT32(s, 0x00020100); /* rgReaderStatesNdrPtr (4 bytes) */ Stream_Write_UINT32(s, ret->cReaders); /* rgReaderStatesNdrCount (4 bytes) */ for (index = 0; index < ret->cReaders; index++) { rgReaderState = &(ret->rgReaderStates[index]); Stream_Write_UINT32(s, rgReaderState->dwCurrentState); /* dwCurrentState (4 bytes) */ - Stream_Write_UINT32(s, rgReaderState->dwEventState); /* dwEventState (4 bytes) */ - Stream_Write_UINT32(s, rgReaderState->cbAtr); /* cbAtr (4 bytes) */ - Stream_Write(s, rgReaderState->rgbAtr, 32); /* rgbAtr [0..32] (32 bytes) */ - Stream_Zero(s, 4); /* rgbAtr [32..36] (32 bytes) */ + Stream_Write_UINT32(s, rgReaderState->dwEventState); /* dwEventState (4 bytes) */ + Stream_Write_UINT32(s, rgReaderState->cbAtr); /* cbAtr (4 bytes) */ + Stream_Write(s, rgReaderState->rgbAtr, 32); /* rgbAtr [0..32] (32 bytes) */ + Stream_Zero(s, 4); /* rgbAtr [32..36] (32 bytes) */ } return SCARD_S_SUCCESS; } void smartcard_trace_get_status_change_return(SMARTCARD_DEVICE* smartcard, - const GetStatusChange_Return* ret, BOOL unicode) + const GetStatusChange_Return* ret, BOOL unicode) { UINT32 index; char* rgbAtr; @@ -1704,22 +1744,22 @@ void smartcard_trace_get_status_change_return(SMARTCARD_DEVICE* smartcard, return; WLog_DBG(TAG, "GetStatusChange%s_Return {", unicode ? "W" : "A"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", - SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); - WLog_DBG(TAG, "cReaders: %"PRIu32"", ret->cReaders); + WLog_DBG(TAG, "ReturnCode: %s (0x%08" PRIX32 ")", SCardGetErrorString(ret->ReturnCode), + ret->ReturnCode); + WLog_DBG(TAG, "cReaders: %" PRIu32 "", ret->cReaders); for (index = 0; index < ret->cReaders; index++) { rgReaderState = &(ret->rgReaderStates[index]); szCurrentState = SCardGetReaderStateString(rgReaderState->dwCurrentState); szEventState = SCardGetReaderStateString(rgReaderState->dwEventState); - rgbAtr = winpr_BinToHexString((BYTE*) & (rgReaderState->rgbAtr), rgReaderState->cbAtr, FALSE); - WLog_DBG(TAG, "\t[%"PRIu32"]: dwCurrentState: %s (0x%08"PRIX32")", - index, szCurrentState, rgReaderState->dwCurrentState); - WLog_DBG(TAG, "\t[%"PRIu32"]: dwEventState: %s (0x%08"PRIX32")", - index, szEventState, rgReaderState->dwEventState); - WLog_DBG(TAG, "\t[%"PRIu32"]: cbAtr: %"PRIu32" rgbAtr: %s", - index, rgReaderState->cbAtr, rgbAtr); + rgbAtr = winpr_BinToHexString((BYTE*)&(rgReaderState->rgbAtr), rgReaderState->cbAtr, FALSE); + WLog_DBG(TAG, "\t[%" PRIu32 "]: dwCurrentState: %s (0x%08" PRIX32 ")", index, + szCurrentState, rgReaderState->dwCurrentState); + WLog_DBG(TAG, "\t[%" PRIu32 "]: dwEventState: %s (0x%08" PRIX32 ")", index, szEventState, + rgReaderState->dwEventState); + WLog_DBG(TAG, "\t[%" PRIu32 "]: cbAtr: %" PRIu32 " rgbAtr: %s", index, rgReaderState->cbAtr, + rgbAtr); free(szCurrentState); free(szEventState); free(rgbAtr); @@ -1734,34 +1774,35 @@ LONG smartcard_unpack_state_call(SMARTCARD_DEVICE* smartcard, wStream* s, State_ if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %" PRId32 "", status); return status; } if ((status = smartcard_unpack_redir_scard_handle(smartcard, s, &(call->hCard)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %" PRId32 "", status); return status; } if (Stream_GetRemainingLength(s) < 8) { - WLog_WARN(TAG, "State_Call is too short: %"PRIuz"", - Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "State_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } Stream_Read_UINT32(s, call->fpbAtrIsNULL); /* fpbAtrIsNULL (4 bytes) */ - Stream_Read_UINT32(s, call->cbAtrLen); /* cbAtrLen (4 bytes) */ + Stream_Read_UINT32(s, call->cbAtrLen); /* cbAtrLen (4 bytes) */ if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %" PRId32 "", + status); return status; } if ((status = smartcard_unpack_redir_scard_handle_ref(smartcard, s, &(call->hCard)))) - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %" PRId32 "", + status); return status; } @@ -1769,15 +1810,15 @@ LONG smartcard_unpack_state_call(SMARTCARD_DEVICE* smartcard, wStream* s, State_ LONG smartcard_pack_state_return(SMARTCARD_DEVICE* smartcard, wStream* s, State_Return* ret) { LONG status; - Stream_Write_UINT32(s, ret->dwState); /* dwState (4 bytes) */ - Stream_Write_UINT32(s, ret->dwProtocol); /* dwProtocol (4 bytes) */ - Stream_Write_UINT32(s, ret->cbAtrLen); /* cbAtrLen (4 bytes) */ - Stream_Write_UINT32(s, 0x00020020); /* rgAtrNdrPtr (4 bytes) */ - Stream_Write_UINT32(s, ret->cbAtrLen); /* rgAtrLength (4 bytes) */ + Stream_Write_UINT32(s, ret->dwState); /* dwState (4 bytes) */ + Stream_Write_UINT32(s, ret->dwProtocol); /* dwProtocol (4 bytes) */ + Stream_Write_UINT32(s, ret->cbAtrLen); /* cbAtrLen (4 bytes) */ + Stream_Write_UINT32(s, 0x00020020); /* rgAtrNdrPtr (4 bytes) */ + Stream_Write_UINT32(s, ret->cbAtrLen); /* rgAtrLength (4 bytes) */ Stream_Write(s, ret->rgAtr, ret->cbAtrLen); /* rgAtr */ if ((status = smartcard_pack_write_size_align(smartcard, s, ret->cbAtrLen, 4))) - WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %" PRId32 "", status); return status; } @@ -1788,35 +1829,36 @@ LONG smartcard_unpack_status_call(SMARTCARD_DEVICE* smartcard, wStream* s, Statu if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %" PRId32 "", status); return status; } if ((status = smartcard_unpack_redir_scard_handle(smartcard, s, &(call->hCard)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %" PRId32 "", status); return status; } if (Stream_GetRemainingLength(s) < 12) { - WLog_WARN(TAG, "Status_Call is too short: %"PRIuz"", - Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "Status_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } Stream_Read_UINT32(s, call->fmszReaderNamesIsNULL); /* fmszReaderNamesIsNULL (4 bytes) */ - Stream_Read_UINT32(s, call->cchReaderLen); /* cchReaderLen (4 bytes) */ - Stream_Read_UINT32(s, call->cbAtrLen); /* cbAtrLen (4 bytes) */ + Stream_Read_UINT32(s, call->cchReaderLen); /* cchReaderLen (4 bytes) */ + Stream_Read_UINT32(s, call->cbAtrLen); /* cbAtrLen (4 bytes) */ if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %" PRId32 "", + status); return status; } if ((status = smartcard_unpack_redir_scard_handle_ref(smartcard, s, &(call->hCard)))) - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %" PRId32 "", + status); return status; } @@ -1830,35 +1872,38 @@ void smartcard_trace_status_call(SMARTCARD_DEVICE* smartcard, const Status_Call* return; WLog_DBG(TAG, "Status%s_Call {", unicode ? "W" : "A"); - pb = (BYTE*) & (call->hContext.pbContext); + pb = (BYTE*)&(call->hContext.pbContext); if (call->hContext.cbContext > 4) { WLog_DBG(TAG, - "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } - pb = (BYTE*) & (call->hCard.pbHandle); + pb = (BYTE*)&(call->hCard.pbHandle); if (call->hCard.cbHandle > 4) { WLog_DBG(TAG, - "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hCard: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hCard.cbHandle); } else { - WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hCard: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->hCard.cbHandle); } - WLog_DBG(TAG, "fmszReaderNamesIsNULL: %"PRId32" cchReaderLen: %"PRIu32" cbAtrLen: %"PRIu32"", + WLog_DBG(TAG, + "fmszReaderNamesIsNULL: %" PRId32 " cchReaderLen: %" PRIu32 " cbAtrLen: %" PRIu32 "", call->fmszReaderNamesIsNULL, call->cchReaderLen, call->cbAtrLen); WLog_DBG(TAG, "}"); } @@ -1873,13 +1918,13 @@ LONG smartcard_pack_status_return(SMARTCARD_DEVICE* smartcard, wStream* s, Statu return SCARD_F_INTERNAL_ERROR; } - Stream_Write_UINT32(s, ret->cBytes); /* cBytes (4 bytes) */ - Stream_Write_UINT32(s, 0x00020010); /* mszReaderNamesNdrPtr (4 bytes) */ - Stream_Write_UINT32(s, ret->dwState); /* dwState (4 bytes) */ + Stream_Write_UINT32(s, ret->cBytes); /* cBytes (4 bytes) */ + Stream_Write_UINT32(s, 0x00020010); /* mszReaderNamesNdrPtr (4 bytes) */ + Stream_Write_UINT32(s, ret->dwState); /* dwState (4 bytes) */ Stream_Write_UINT32(s, ret->dwProtocol); /* dwProtocol (4 bytes) */ - Stream_Write(s, ret->pbAtr, 32); /* pbAtr (32 bytes) */ - Stream_Write_UINT32(s, ret->cbAtrLen); /* cbAtrLen (4 bytes) */ - Stream_Write_UINT32(s, ret->cBytes); /* mszReaderNamesNdrLen (4 bytes) */ + Stream_Write(s, ret->pbAtr, 32); /* pbAtr (32 bytes) */ + Stream_Write_UINT32(s, ret->cbAtrLen); /* cbAtrLen (4 bytes) */ + Stream_Write_UINT32(s, ret->cBytes); /* mszReaderNamesNdrLen (4 bytes) */ if (ret->mszReaderNames) Stream_Write(s, ret->mszReaderNames, ret->cBytes); @@ -1887,12 +1932,13 @@ LONG smartcard_pack_status_return(SMARTCARD_DEVICE* smartcard, wStream* s, Statu Stream_Zero(s, ret->cBytes); if ((status = smartcard_pack_write_size_align(smartcard, s, ret->cBytes, 4))) - WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %" PRId32 "", status); return status; } -void smartcard_trace_status_return(SMARTCARD_DEVICE* smartcard, const Status_Return* ret, BOOL unicode) +void smartcard_trace_status_return(SMARTCARD_DEVICE* smartcard, const Status_Return* ret, + BOOL unicode) { size_t index; size_t length; @@ -1909,7 +1955,7 @@ void smartcard_trace_status_return(SMARTCARD_DEVICE* smartcard, const Status_Ret { length = ret->cBytes / 2; - if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) ret->mszReaderNames, (int) length, + if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)ret->mszReaderNames, (int)length, &mszReaderNamesA, 0, NULL, NULL) < 1) { WLog_ERR(TAG, "ConvertFromUnicode failed"); @@ -1918,8 +1964,8 @@ void smartcard_trace_status_return(SMARTCARD_DEVICE* smartcard, const Status_Ret } else { - length = (int) ret->cBytes; - mszReaderNamesA = (char*) malloc(length); + length = (int)ret->cBytes; + mszReaderNamesA = (char*)malloc(length); if (!mszReaderNamesA) { @@ -1944,19 +1990,18 @@ void smartcard_trace_status_return(SMARTCARD_DEVICE* smartcard, const Status_Ret pbAtr = winpr_BinToHexString(ret->pbAtr, ret->cbAtrLen, FALSE); WLog_DBG(TAG, "Status%s_Return {", unicode ? "W" : "A"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", - SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); - WLog_DBG(TAG, "dwState: %s (0x%08"PRIX32") dwProtocol: %s (0x%08"PRIX32")", + WLog_DBG(TAG, "ReturnCode: %s (0x%08" PRIX32 ")", SCardGetErrorString(ret->ReturnCode), + ret->ReturnCode); + WLog_DBG(TAG, "dwState: %s (0x%08" PRIX32 ") dwProtocol: %s (0x%08" PRIX32 ")", SCardGetCardStateString(ret->dwState), ret->dwState, SCardGetProtocolString(ret->dwProtocol), ret->dwProtocol); if (mszReaderNamesA) { - WLog_DBG(TAG, "cBytes: %"PRIu32" mszReaderNames: %s", - ret->cBytes, mszReaderNamesA); + WLog_DBG(TAG, "cBytes: %" PRIu32 " mszReaderNames: %s", ret->cBytes, mszReaderNamesA); } - WLog_DBG(TAG, "cbAtrLen: %"PRIu32" pbAtr: %s", ret->cbAtrLen, pbAtr); + WLog_DBG(TAG, "cbAtrLen: %" PRIu32 " pbAtr: %s", ret->cbAtrLen, pbAtr); WLog_DBG(TAG, "}"); free(mszReaderNamesA); free(pbAtr); @@ -1968,35 +2013,36 @@ LONG smartcard_unpack_get_attrib_call(SMARTCARD_DEVICE* smartcard, wStream* s, G if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %" PRId32 "", status); return status; } if ((status = smartcard_unpack_redir_scard_handle(smartcard, s, &(call->hCard)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %" PRId32 "", status); return status; } if (Stream_GetRemainingLength(s) < 12) { - WLog_WARN(TAG, "GetAttrib_Call is too short: %"PRIuz"", - Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "GetAttrib_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } - Stream_Read_UINT32(s, call->dwAttrId); /* dwAttrId (4 bytes) */ + Stream_Read_UINT32(s, call->dwAttrId); /* dwAttrId (4 bytes) */ Stream_Read_UINT32(s, call->fpbAttrIsNULL); /* fpbAttrIsNULL (4 bytes) */ - Stream_Read_UINT32(s, call->cbAttrLen); /* cbAttrLen (4 bytes) */ + Stream_Read_UINT32(s, call->cbAttrLen); /* cbAttrLen (4 bytes) */ if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %" PRId32 "", + status); return status; } if ((status = smartcard_unpack_redir_scard_handle_ref(smartcard, s, &(call->hCard)))) - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %" PRId32 "", + status); return status; } @@ -2010,36 +2056,40 @@ void smartcard_trace_get_attrib_call(SMARTCARD_DEVICE* smartcard, GetAttrib_Call return; WLog_DBG(TAG, "GetAttrib_Call {"); - pb = (BYTE*) & (call->hContext.pbContext); + pb = (BYTE*)&(call->hContext.pbContext); if (call->hContext.cbContext > 4) { WLog_DBG(TAG, - "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } - pb = (BYTE*) & (call->hCard.pbHandle); + pb = (BYTE*)&(call->hCard.pbHandle); if (call->hCard.cbHandle > 4) { WLog_DBG(TAG, - "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hCard: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hCard.cbHandle); } else { - WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hCard: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->hCard.cbHandle); } - WLog_DBG(TAG, "dwAttrId: %s (0x%08"PRIX32") fpbAttrIsNULL: %"PRId32" cbAttrLen: 0x%08"PRIX32"", - SCardGetAttributeString(call->dwAttrId), call->dwAttrId, call->fpbAttrIsNULL, call->cbAttrLen); + WLog_DBG(TAG, + "dwAttrId: %s (0x%08" PRIX32 ") fpbAttrIsNULL: %" PRId32 " cbAttrLen: 0x%08" PRIX32 "", + SCardGetAttributeString(call->dwAttrId), call->dwAttrId, call->fpbAttrIsNULL, + call->cbAttrLen); WLog_DBG(TAG, "}"); } @@ -2055,7 +2105,7 @@ LONG smartcard_pack_get_attrib_return(SMARTCARD_DEVICE* smartcard, wStream* s, } Stream_Write_UINT32(s, ret->cbAttrLen); /* cbAttrLen (4 bytes) */ - Stream_Write_UINT32(s, 0x00020080); /* pbAttrNdrPtr (4 bytes) */ + Stream_Write_UINT32(s, 0x00020080); /* pbAttrNdrPtr (4 bytes) */ Stream_Write_UINT32(s, ret->cbAttrLen); /* pbAttrNdrCount (4 bytes) */ if (!ret->pbAttr) @@ -2064,7 +2114,7 @@ LONG smartcard_pack_get_attrib_return(SMARTCARD_DEVICE* smartcard, wStream* s, Stream_Write(s, ret->pbAttr, ret->cbAttrLen); /* pbAttr */ if ((status = smartcard_pack_write_size_align(smartcard, s, ret->cbAttrLen, 4))) - WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %" PRId32 "", status); return status; } @@ -2078,19 +2128,19 @@ void smartcard_trace_get_attrib_return(SMARTCARD_DEVICE* smartcard, const GetAtt return; WLog_DBG(TAG, "GetAttrib_Return {"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", - SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); - WLog_DBG(TAG, "dwAttrId: %s (0x%08"PRIX32") cbAttrLen: 0x%08"PRIX32"", + WLog_DBG(TAG, "ReturnCode: %s (0x%08" PRIX32 ")", SCardGetErrorString(ret->ReturnCode), + ret->ReturnCode); + WLog_DBG(TAG, "dwAttrId: %s (0x%08" PRIX32 ") cbAttrLen: 0x%08" PRIX32 "", SCardGetAttributeString(dwAttrId), dwAttrId, ret->cbAttrLen); if (dwAttrId == SCARD_ATTR_VENDOR_NAME) { - WLog_DBG(TAG, "pbAttr: %.*s", ret->cbAttrLen, (char*) ret->pbAttr); + WLog_DBG(TAG, "pbAttr: %.*s", ret->cbAttrLen, (char*)ret->pbAttr); } else if (dwAttrId == SCARD_ATTR_CURRENT_PROTOCOL_TYPE) { - UINT32 dwProtocolType = *((UINT32*) ret->pbAttr); - WLog_DBG(TAG, "dwProtocolType: %s (0x%08"PRIX32")", + UINT32 dwProtocolType = *((UINT32*)ret->pbAttr); + WLog_DBG(TAG, "dwProtocolType: %s (0x%08" PRIX32 ")", SCardGetProtocolString(dwProtocolType), dwProtocolType); } @@ -2105,38 +2155,39 @@ LONG smartcard_unpack_control_call(SMARTCARD_DEVICE* smartcard, wStream* s, Cont if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %" PRId32 "", status); return status; } if ((status = smartcard_unpack_redir_scard_handle(smartcard, s, &(call->hCard)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %" PRId32 "", status); return status; } if (Stream_GetRemainingLength(s) < 20) { - WLog_WARN(TAG, "Control_Call is too short: %"PRIuz"", - Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "Control_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } - Stream_Read_UINT32(s, call->dwControlCode); /* dwControlCode (4 bytes) */ - Stream_Read_UINT32(s, call->cbInBufferSize); /* cbInBufferSize (4 bytes) */ - Stream_Seek_UINT32(s); /* pvInBufferNdrPtr (4 bytes) */ + Stream_Read_UINT32(s, call->dwControlCode); /* dwControlCode (4 bytes) */ + Stream_Read_UINT32(s, call->cbInBufferSize); /* cbInBufferSize (4 bytes) */ + Stream_Seek_UINT32(s); /* pvInBufferNdrPtr (4 bytes) */ Stream_Read_UINT32(s, call->fpvOutBufferIsNULL); /* fpvOutBufferIsNULL (4 bytes) */ - Stream_Read_UINT32(s, call->cbOutBufferSize); /* cbOutBufferSize (4 bytes) */ + Stream_Read_UINT32(s, call->cbOutBufferSize); /* cbOutBufferSize (4 bytes) */ if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %" PRId32 "", + status); return status; } if ((status = smartcard_unpack_redir_scard_handle_ref(smartcard, s, &(call->hCard)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %" PRId32 "", + status); return status; } @@ -2144,8 +2195,7 @@ LONG smartcard_unpack_control_call(SMARTCARD_DEVICE* smartcard, wStream* s, Cont { if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "Control_Call is too short: %"PRIuz"", - Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "Control_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -2153,12 +2203,11 @@ LONG smartcard_unpack_control_call(SMARTCARD_DEVICE* smartcard, wStream* s, Cont if (Stream_GetRemainingLength(s) < length) { - WLog_WARN(TAG, "Control_Call is too short: %"PRIuz"", - Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "Control_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } - call->pvInBuffer = (BYTE*) malloc(length); + call->pvInBuffer = (BYTE*)malloc(length); if (!call->pvInBuffer) { @@ -2182,37 +2231,41 @@ void smartcard_trace_control_call(SMARTCARD_DEVICE* smartcard, const Control_Cal return; WLog_DBG(TAG, "Control_Call {"); - pb = (BYTE*) & (call->hContext.pbContext); + pb = (BYTE*)&(call->hContext.pbContext); if (call->hContext.cbContext > 4) { WLog_DBG(TAG, - "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } - pb = (BYTE*) & (call->hCard.pbHandle); + pb = (BYTE*)&(call->hCard.pbHandle); if (call->hCard.cbHandle > 4) { WLog_DBG(TAG, - "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hCard: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hCard.cbHandle); } else { - WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hCard: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->hCard.cbHandle); } WLog_DBG(TAG, - "dwControlCode: 0x%08"PRIX32" cbInBufferSize: %"PRIu32" fpvOutBufferIsNULL: %"PRId32" cbOutBufferSize: %"PRIu32"", - call->dwControlCode, call->cbInBufferSize, call->fpvOutBufferIsNULL, call->cbOutBufferSize); + "dwControlCode: 0x%08" PRIX32 " cbInBufferSize: %" PRIu32 + " fpvOutBufferIsNULL: %" PRId32 " cbOutBufferSize: %" PRIu32 "", + call->dwControlCode, call->cbInBufferSize, call->fpvOutBufferIsNULL, + call->cbOutBufferSize); if (call->pvInBuffer) { @@ -2239,7 +2292,7 @@ LONG smartcard_pack_control_return(SMARTCARD_DEVICE* smartcard, wStream* s, Cont } Stream_Write_UINT32(s, ret->cbOutBufferSize); /* cbOutBufferSize (4 bytes) */ - Stream_Write_UINT32(s, 0x00020040); /* pvOutBufferPointer (4 bytes) */ + Stream_Write_UINT32(s, 0x00020040); /* pvOutBufferPointer (4 bytes) */ Stream_Write_UINT32(s, ret->cbOutBufferSize); /* pvOutBufferLength (4 bytes) */ if (ret->cbOutBufferSize > 0) @@ -2248,7 +2301,7 @@ LONG smartcard_pack_control_return(SMARTCARD_DEVICE* smartcard, wStream* s, Cont if ((error = smartcard_pack_write_size_align(smartcard, s, ret->cbOutBufferSize, 4))) { - WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %"PRId32"", error); + WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %" PRId32 "", error); return error; } } @@ -2264,9 +2317,9 @@ void smartcard_trace_control_return(SMARTCARD_DEVICE* smartcard, const Control_R return; WLog_DBG(TAG, "Control_Return {"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", - SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); - WLog_DBG(TAG, "cbOutBufferSize: %"PRIu32"", ret->cbOutBufferSize); + WLog_DBG(TAG, "ReturnCode: %s (0x%08" PRIX32 ")", SCardGetErrorString(ret->ReturnCode), + ret->ReturnCode); + WLog_DBG(TAG, "cbOutBufferSize: %" PRIu32 "", ret->cbOutBufferSize); if (ret->pvOutBuffer) { @@ -2298,61 +2351,65 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %" PRId32 "", status); return status; } if ((status = smartcard_unpack_redir_scard_handle(smartcard, s, &(call->hCard)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %" PRId32 "", status); return status; } if (Stream_GetRemainingLength(s) < 32) { - WLog_WARN(TAG, "Transmit_Call is too short: Actual: %"PRIuz", Expected: 32", + WLog_WARN(TAG, "Transmit_Call is too short: Actual: %" PRIuz ", Expected: 32", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } - Stream_Read_UINT32(s, ioSendPci.dwProtocol); /* dwProtocol (4 bytes) */ - Stream_Read_UINT32(s, ioSendPci.cbExtraBytes); /* cbExtraBytes (4 bytes) */ - Stream_Read_UINT32(s, pbExtraBytesNdrPtr); /* pbExtraBytesNdrPtr (4 bytes) */ - Stream_Read_UINT32(s, call->cbSendLength); /* cbSendLength (4 bytes) */ - Stream_Read_UINT32(s, pbSendBufferNdrPtr); /* pbSendBufferNdrPtr (4 bytes) */ - Stream_Read_UINT32(s, pioRecvPciNdrPtr); /* pioRecvPciNdrPtr (4 bytes) */ + Stream_Read_UINT32(s, ioSendPci.dwProtocol); /* dwProtocol (4 bytes) */ + Stream_Read_UINT32(s, ioSendPci.cbExtraBytes); /* cbExtraBytes (4 bytes) */ + Stream_Read_UINT32(s, pbExtraBytesNdrPtr); /* pbExtraBytesNdrPtr (4 bytes) */ + Stream_Read_UINT32(s, call->cbSendLength); /* cbSendLength (4 bytes) */ + Stream_Read_UINT32(s, pbSendBufferNdrPtr); /* pbSendBufferNdrPtr (4 bytes) */ + Stream_Read_UINT32(s, pioRecvPciNdrPtr); /* pioRecvPciNdrPtr (4 bytes) */ Stream_Read_UINT32(s, call->fpbRecvBufferIsNULL); /* fpbRecvBufferIsNULL (4 bytes) */ - Stream_Read_UINT32(s, call->cbRecvLength); /* cbRecvLength (4 bytes) */ + Stream_Read_UINT32(s, call->cbRecvLength); /* cbRecvLength (4 bytes) */ if (ioSendPci.cbExtraBytes > 1024) { - WLog_WARN(TAG, "Transmit_Call ioSendPci.cbExtraBytes is out of bounds: %"PRIu32" (max: 1024)", + WLog_WARN(TAG, + "Transmit_Call ioSendPci.cbExtraBytes is out of bounds: %" PRIu32 " (max: 1024)", ioSendPci.cbExtraBytes); return STATUS_INVALID_PARAMETER; } if (call->cbSendLength > 66560) { - WLog_WARN(TAG, "Transmit_Call cbSendLength is out of bounds: %"PRIu32" (max: 66560)", + WLog_WARN(TAG, "Transmit_Call cbSendLength is out of bounds: %" PRIu32 " (max: 66560)", ioSendPci.cbExtraBytes); return STATUS_INVALID_PARAMETER; } if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %" PRId32 "", + status); return status; } if ((status = smartcard_unpack_redir_scard_handle_ref(smartcard, s, &(call->hCard)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %" PRId32 "", + status); return status; } if (ioSendPci.cbExtraBytes && !pbExtraBytesNdrPtr) { - WLog_WARN(TAG, "Transmit_Call ioSendPci.cbExtraBytes is non-zero but pbExtraBytesNdrPtr is null"); + WLog_WARN( + TAG, "Transmit_Call ioSendPci.cbExtraBytes is non-zero but pbExtraBytesNdrPtr is null"); return STATUS_INVALID_PARAMETER; } @@ -2360,7 +2417,7 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra { if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "Transmit_Call is too short: %"PRIuz" (ioSendPci.pbExtraBytes)", + WLog_WARN(TAG, "Transmit_Call is too short: %" PRIuz " (ioSendPci.pbExtraBytes)", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -2370,13 +2427,15 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra if (Stream_GetRemainingLength(s) < ioSendPci.cbExtraBytes) { WLog_WARN(TAG, - "Transmit_Call is too short: Actual: %"PRIuz", Expected: %"PRIu32" (ioSendPci.cbExtraBytes)", + "Transmit_Call is too short: Actual: %" PRIuz ", Expected: %" PRIu32 + " (ioSendPci.cbExtraBytes)", Stream_GetRemainingLength(s), ioSendPci.cbExtraBytes); return STATUS_BUFFER_TOO_SMALL; } ioSendPci.pbExtraBytes = Stream_Pointer(s); - call->pioSendPci = (LPSCARD_IO_REQUEST) malloc(sizeof(SCARD_IO_REQUEST) + ioSendPci.cbExtraBytes); + call->pioSendPci = + (LPSCARD_IO_REQUEST)malloc(sizeof(SCARD_IO_REQUEST) + ioSendPci.cbExtraBytes); if (!call->pioSendPci) { @@ -2386,13 +2445,13 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra call->pioSendPci->dwProtocol = ioSendPci.dwProtocol; call->pioSendPci->cbPciLength = (DWORD)(ioSendPci.cbExtraBytes + sizeof(SCARD_IO_REQUEST)); - pbExtraBytes = &((BYTE*) call->pioSendPci)[sizeof(SCARD_IO_REQUEST)]; + pbExtraBytes = &((BYTE*)call->pioSendPci)[sizeof(SCARD_IO_REQUEST)]; Stream_Read(s, pbExtraBytes, ioSendPci.cbExtraBytes); smartcard_unpack_read_size_align(smartcard, s, ioSendPci.cbExtraBytes, 4); } else { - call->pioSendPci = (LPSCARD_IO_REQUEST) calloc(1, sizeof(SCARD_IO_REQUEST)); + call->pioSendPci = (LPSCARD_IO_REQUEST)calloc(1, sizeof(SCARD_IO_REQUEST)); if (!call->pioSendPci) { @@ -2408,8 +2467,7 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra { if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "Transmit_Call is too short: %"PRIuz"", - Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "Transmit_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -2418,19 +2476,22 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra if (length != call->cbSendLength) { WLog_WARN(TAG, - "Transmit_Call unexpected length: Actual: %"PRIu32", Expected: %"PRIu32" (cbSendLength)", + "Transmit_Call unexpected length: Actual: %" PRIu32 ", Expected: %" PRIu32 + " (cbSendLength)", length, call->cbSendLength); return STATUS_INVALID_PARAMETER; } if (Stream_GetRemainingLength(s) < call->cbSendLength) { - WLog_WARN(TAG, "Transmit_Call is too short: Actual: %"PRIuz", Expected: %"PRIu32" (cbSendLength)", + WLog_WARN(TAG, + "Transmit_Call is too short: Actual: %" PRIuz ", Expected: %" PRIu32 + " (cbSendLength)", Stream_GetRemainingLength(s), call->cbSendLength); return STATUS_BUFFER_TOO_SMALL; } - call->pbSendBuffer = (BYTE*) malloc(call->cbSendLength); + call->pbSendBuffer = (BYTE*)malloc(call->cbSendLength); if (!call->pbSendBuffer) { @@ -2446,18 +2507,20 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra { if (Stream_GetRemainingLength(s) < 12) { - WLog_WARN(TAG, "Transmit_Call is too short: Actual: %"PRIuz", Expected: 12", + WLog_WARN(TAG, "Transmit_Call is too short: Actual: %" PRIuz ", Expected: 12", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } - Stream_Read_UINT32(s, ioRecvPci.dwProtocol); /* dwProtocol (4 bytes) */ + Stream_Read_UINT32(s, ioRecvPci.dwProtocol); /* dwProtocol (4 bytes) */ Stream_Read_UINT32(s, ioRecvPci.cbExtraBytes); /* cbExtraBytes (4 bytes) */ - Stream_Read_UINT32(s, pbExtraBytesNdrPtr); /* pbExtraBytesNdrPtr (4 bytes) */ + Stream_Read_UINT32(s, pbExtraBytesNdrPtr); /* pbExtraBytesNdrPtr (4 bytes) */ if (ioRecvPci.cbExtraBytes && !pbExtraBytesNdrPtr) { - WLog_WARN(TAG, "Transmit_Call ioRecvPci.cbExtraBytes is non-zero but pbExtraBytesNdrPtr is null"); + WLog_WARN( + TAG, + "Transmit_Call ioRecvPci.cbExtraBytes is non-zero but pbExtraBytesNdrPtr is null"); return STATUS_INVALID_PARAMETER; } @@ -2465,7 +2528,7 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra { if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "Transmit_Call is too short: %"PRIuz" (ioRecvPci.pbExtraBytes)", + WLog_WARN(TAG, "Transmit_Call is too short: %" PRIuz " (ioRecvPci.pbExtraBytes)", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -2474,7 +2537,9 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra if (ioRecvPci.cbExtraBytes > 1024) { - WLog_WARN(TAG, "Transmit_Call ioRecvPci.cbExtraBytes is out of bounds: %"PRIu32" (max: 1024)", + WLog_WARN(TAG, + "Transmit_Call ioRecvPci.cbExtraBytes is out of bounds: %" PRIu32 + " (max: 1024)", ioRecvPci.cbExtraBytes); return STATUS_INVALID_PARAMETER; } @@ -2482,7 +2547,8 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra if (length != ioRecvPci.cbExtraBytes) { WLog_WARN(TAG, - "Transmit_Call unexpected length: Actual: %"PRIu32", Expected: %"PRIu32" (ioRecvPci.cbExtraBytes)", + "Transmit_Call unexpected length: Actual: %" PRIu32 ", Expected: %" PRIu32 + " (ioRecvPci.cbExtraBytes)", length, ioRecvPci.cbExtraBytes); return STATUS_INVALID_PARAMETER; } @@ -2490,13 +2556,15 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra if (Stream_GetRemainingLength(s) < ioRecvPci.cbExtraBytes) { WLog_WARN(TAG, - "Transmit_Call is too short: Actual: %"PRIuz", Expected: %"PRIu32" (ioRecvPci.cbExtraBytes)", + "Transmit_Call is too short: Actual: %" PRIuz ", Expected: %" PRIu32 + " (ioRecvPci.cbExtraBytes)", Stream_GetRemainingLength(s), ioRecvPci.cbExtraBytes); return STATUS_BUFFER_TOO_SMALL; } ioRecvPci.pbExtraBytes = Stream_Pointer(s); - call->pioRecvPci = (LPSCARD_IO_REQUEST) malloc(sizeof(SCARD_IO_REQUEST) + ioRecvPci.cbExtraBytes); + call->pioRecvPci = + (LPSCARD_IO_REQUEST)malloc(sizeof(SCARD_IO_REQUEST) + ioRecvPci.cbExtraBytes); if (!call->pioRecvPci) { @@ -2505,14 +2573,15 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra } call->pioRecvPci->dwProtocol = ioRecvPci.dwProtocol; - call->pioRecvPci->cbPciLength = (DWORD)(ioRecvPci.cbExtraBytes + sizeof(SCARD_IO_REQUEST)); - pbExtraBytes = &((BYTE*) call->pioRecvPci)[sizeof(SCARD_IO_REQUEST)]; + call->pioRecvPci->cbPciLength = + (DWORD)(ioRecvPci.cbExtraBytes + sizeof(SCARD_IO_REQUEST)); + pbExtraBytes = &((BYTE*)call->pioRecvPci)[sizeof(SCARD_IO_REQUEST)]; Stream_Read(s, pbExtraBytes, ioRecvPci.cbExtraBytes); smartcard_unpack_read_size_align(smartcard, s, ioRecvPci.cbExtraBytes, 4); } else { - call->pioRecvPci = (LPSCARD_IO_REQUEST) calloc(1, sizeof(SCARD_IO_REQUEST)); + call->pioRecvPci = (LPSCARD_IO_REQUEST)calloc(1, sizeof(SCARD_IO_REQUEST)); if (!call->pioRecvPci) { @@ -2539,39 +2608,41 @@ void smartcard_trace_transmit_call(SMARTCARD_DEVICE* smartcard, const Transmit_C return; WLog_DBG(TAG, "Transmit_Call {"); - pb = (BYTE*) & (call->hContext.pbContext); + pb = (BYTE*)&(call->hContext.pbContext); if (call->hContext.cbContext > 4) { WLog_DBG(TAG, - "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } - pb = (BYTE*) & (call->hCard.pbHandle); + pb = (BYTE*)&(call->hCard.pbHandle); if (call->hCard.cbHandle > 4) { WLog_DBG(TAG, - "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hCard: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hCard.cbHandle); } else { - WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hCard: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->hCard.cbHandle); } if (call->pioSendPci) { cbExtraBytes = (UINT32)(call->pioSendPci->cbPciLength - sizeof(SCARD_IO_REQUEST)); - pbExtraBytes = &((BYTE*) call->pioSendPci)[sizeof(SCARD_IO_REQUEST)]; - WLog_DBG(TAG, "pioSendPci: dwProtocol: %"PRIu32" cbExtraBytes: %"PRIu32"", + pbExtraBytes = &((BYTE*)call->pioSendPci)[sizeof(SCARD_IO_REQUEST)]; + WLog_DBG(TAG, "pioSendPci: dwProtocol: %" PRIu32 " cbExtraBytes: %" PRIu32 "", call->pioSendPci->dwProtocol, cbExtraBytes); if (cbExtraBytes) @@ -2586,7 +2657,7 @@ void smartcard_trace_transmit_call(SMARTCARD_DEVICE* smartcard, const Transmit_C WLog_DBG(TAG, "pioSendPci: null"); } - WLog_DBG(TAG, "cbSendLength: %"PRIu32"", call->cbSendLength); + WLog_DBG(TAG, "cbSendLength: %" PRIu32 "", call->cbSendLength); if (call->pbSendBuffer) { @@ -2602,8 +2673,8 @@ void smartcard_trace_transmit_call(SMARTCARD_DEVICE* smartcard, const Transmit_C if (call->pioRecvPci) { cbExtraBytes = (UINT32)(call->pioRecvPci->cbPciLength - sizeof(SCARD_IO_REQUEST)); - pbExtraBytes = &((BYTE*) call->pioRecvPci)[sizeof(SCARD_IO_REQUEST)]; - WLog_DBG(TAG, "pioRecvPci: dwProtocol: %"PRIu32" cbExtraBytes: %"PRIu32"", + pbExtraBytes = &((BYTE*)call->pioRecvPci)[sizeof(SCARD_IO_REQUEST)]; + WLog_DBG(TAG, "pioRecvPci: dwProtocol: %" PRIu32 " cbExtraBytes: %" PRIu32 "", call->pioRecvPci->dwProtocol, cbExtraBytes); if (cbExtraBytes) @@ -2618,7 +2689,7 @@ void smartcard_trace_transmit_call(SMARTCARD_DEVICE* smartcard, const Transmit_C WLog_DBG(TAG, "pioRecvPci: null"); } - WLog_DBG(TAG, "fpbRecvBufferIsNULL: %"PRId32" cbRecvLength: %"PRIu32"", + WLog_DBG(TAG, "fpbRecvBufferIsNULL: %" PRId32 " cbRecvLength: %" PRIu32 "", call->fpbRecvBufferIsNULL, call->cbRecvLength); WLog_DBG(TAG, "}"); } @@ -2637,14 +2708,14 @@ LONG smartcard_pack_transmit_return(SMARTCARD_DEVICE* smartcard, wStream* s, Tra pioRecvPciNdrPtr = (ret->pioRecvPci) ? 0x00020000 : 0; pbRecvBufferNdrPtr = (ret->pbRecvBuffer) ? 0x00020004 : 0; - Stream_Write_UINT32(s, pioRecvPciNdrPtr); /* pioRecvPciNdrPtr (4 bytes) */ - Stream_Write_UINT32(s, ret->cbRecvLength); /* cbRecvLength (4 bytes) */ + Stream_Write_UINT32(s, pioRecvPciNdrPtr); /* pioRecvPciNdrPtr (4 bytes) */ + Stream_Write_UINT32(s, ret->cbRecvLength); /* cbRecvLength (4 bytes) */ Stream_Write_UINT32(s, pbRecvBufferNdrPtr); /* pbRecvBufferNdrPtr (4 bytes) */ if (pioRecvPciNdrPtr) { cbExtraBytes = (UINT32)(ret->pioRecvPci->cbPciLength - sizeof(SCARD_IO_REQUEST)); - pbExtraBytes = &((BYTE*) ret->pioRecvPci)[sizeof(SCARD_IO_REQUEST)]; + pbExtraBytes = &((BYTE*)ret->pioRecvPci)[sizeof(SCARD_IO_REQUEST)]; pbExtraBytesNdrPtr = cbExtraBytes ? 0x00020008 : 0; if (!Stream_EnsureRemainingCapacity(s, cbExtraBytes + 16)) @@ -2654,8 +2725,8 @@ LONG smartcard_pack_transmit_return(SMARTCARD_DEVICE* smartcard, wStream* s, Tra } Stream_Write_UINT32(s, ret->pioRecvPci->dwProtocol); /* dwProtocol (4 bytes) */ - Stream_Write_UINT32(s, cbExtraBytes); /* cbExtraBytes (4 bytes) */ - Stream_Write_UINT32(s, pbExtraBytesNdrPtr); /* pbExtraBytesNdrPtr (4 bytes) */ + Stream_Write_UINT32(s, cbExtraBytes); /* cbExtraBytes (4 bytes) */ + Stream_Write_UINT32(s, pbExtraBytesNdrPtr); /* pbExtraBytesNdrPtr (4 bytes) */ if (pbExtraBytesNdrPtr) { @@ -2664,7 +2735,8 @@ LONG smartcard_pack_transmit_return(SMARTCARD_DEVICE* smartcard, wStream* s, Tra if ((error = smartcard_pack_write_size_align(smartcard, s, cbExtraBytes, 4))) { - WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %"PRId32"!", error); + WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %" PRId32 "!", + error); return error; } } @@ -2683,7 +2755,7 @@ LONG smartcard_pack_transmit_return(SMARTCARD_DEVICE* smartcard, wStream* s, Tra if ((error = smartcard_pack_write_size_align(smartcard, s, ret->cbRecvLength, 4))) { - WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %"PRId32"!", error); + WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %" PRId32 "!", error); return error; } } @@ -2701,14 +2773,14 @@ void smartcard_trace_transmit_return(SMARTCARD_DEVICE* smartcard, const Transmit return; WLog_DBG(TAG, "Transmit_Return {"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", - SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); + WLog_DBG(TAG, "ReturnCode: %s (0x%08" PRIX32 ")", SCardGetErrorString(ret->ReturnCode), + ret->ReturnCode); if (ret->pioRecvPci) { cbExtraBytes = (UINT32)(ret->pioRecvPci->cbPciLength - sizeof(SCARD_IO_REQUEST)); - pbExtraBytes = &((BYTE*) ret->pioRecvPci)[sizeof(SCARD_IO_REQUEST)]; - WLog_DBG(TAG, "pioRecvPci: dwProtocol: %"PRIu32" cbExtraBytes: %"PRIu32"", + pbExtraBytes = &((BYTE*)ret->pioRecvPci)[sizeof(SCARD_IO_REQUEST)]; + WLog_DBG(TAG, "pioRecvPci: dwProtocol: %" PRIu32 " cbExtraBytes: %" PRIu32 "", ret->pioRecvPci->dwProtocol, cbExtraBytes); if (cbExtraBytes) @@ -2723,7 +2795,7 @@ void smartcard_trace_transmit_return(SMARTCARD_DEVICE* smartcard, const Transmit WLog_DBG(TAG, "pioRecvPci: null"); } - WLog_DBG(TAG, "cbRecvLength: %"PRIu32"", ret->cbRecvLength); + WLog_DBG(TAG, "cbRecvLength: %" PRIu32 "", ret->cbRecvLength); if (ret->pbRecvBuffer) { @@ -2740,7 +2812,7 @@ void smartcard_trace_transmit_return(SMARTCARD_DEVICE* smartcard, const Transmit } LONG smartcard_unpack_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, wStream* s, - LocateCardsByATRA_Call* call) + LocateCardsByATRA_Call* call) { UINT32 index; UINT32 count; @@ -2755,31 +2827,32 @@ LONG smartcard_unpack_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, wS if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %" PRId32 "", status); return status; } if (Stream_GetRemainingLength(s) < 16) { - WLog_WARN(TAG, "LocateCardsByATRA_Call is too short: %"PRIuz"", + WLog_WARN(TAG, "LocateCardsByATRA_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } Stream_Read_UINT32(s, call->cAtrs); Stream_Read_UINT32(s, rgAtrMasksNdrPtr); - Stream_Read_UINT32(s, call->cReaders); /* cReaders (4 bytes) */ + Stream_Read_UINT32(s, call->cReaders); /* cReaders (4 bytes) */ Stream_Read_UINT32(s, rgReaderStatesNdrPtr); /* rgReaderStatesNdrPtr (4 bytes) */ if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %" PRId32 "", + status); return status; } if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "LocateCardsByATRA_Call is too short: %"PRIuz"", + WLog_WARN(TAG, "LocateCardsByATRA_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -2787,7 +2860,8 @@ LONG smartcard_unpack_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, wS if ((rgAtrMasksNdrPtr && !call->cAtrs) || (!rgAtrMasksNdrPtr && call->cAtrs)) { WLog_WARN(TAG, - "LocateCardsByATRA_Call rgAtrMasksNdrPtr (0x%08"PRIX32") and cAtrs (0x%08"PRIX32") inconsistency", + "LocateCardsByATRA_Call rgAtrMasksNdrPtr (0x%08" PRIX32 + ") and cAtrs (0x%08" PRIX32 ") inconsistency", rgAtrMasksNdrPtr, call->cAtrs); return STATUS_INVALID_PARAMETER; } @@ -2799,14 +2873,17 @@ LONG smartcard_unpack_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, wS if (count != call->cAtrs) { WLog_WARN(TAG, - "LocateCardsByATRA_Call NdrCount (0x%08"PRIX32") and cAtrs (0x%08"PRIX32") inconsistency", + "LocateCardsByATRA_Call NdrCount (0x%08" PRIX32 ") and cAtrs (0x%08" PRIX32 + ") inconsistency", count, call->cAtrs); return STATUS_INVALID_PARAMETER; } if (Stream_GetRemainingLength(s) < call->cAtrs) { - WLog_WARN(TAG, "LocateCardsByATRA_Call is too short: Actual: %"PRIuz", Expected: %"PRIu32"", + WLog_WARN(TAG, + "LocateCardsByATRA_Call is too short: Actual: %" PRIuz ", Expected: %" PRIu32 + "", Stream_GetRemainingLength(s), call->cAtrs); return STATUS_BUFFER_TOO_SMALL; } @@ -2832,7 +2909,8 @@ LONG smartcard_unpack_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, wS if (count != call->cReaders) { WLog_WARN(TAG, - "GetStatusChangeA_Call unexpected reader count: Actual: %"PRIu32", Expected: %"PRIu32"", + "GetStatusChangeA_Call unexpected reader count: Actual: %" PRIu32 + ", Expected: %" PRIu32 "", count, call->cReaders); return STATUS_INVALID_PARAMETER; } @@ -2849,46 +2927,46 @@ LONG smartcard_unpack_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, wS for (index = 0; index < call->cReaders; index++) { - readerState = (LPSCARD_READERSTATEA) &call->rgReaderStates[index]; + readerState = (LPSCARD_READERSTATEA)&call->rgReaderStates[index]; if (Stream_GetRemainingLength(s) < 52) { - WLog_WARN(TAG, "LocateCardsByATRA_Call is too short: %"PRIuz"", + WLog_WARN(TAG, "LocateCardsByATRA_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } - Stream_Read_UINT32(s, szReaderNdrPtr); /* szReaderNdrPtr (4 bytes) */ + Stream_Read_UINT32(s, szReaderNdrPtr); /* szReaderNdrPtr (4 bytes) */ Stream_Read_UINT32(s, readerState->dwCurrentState); /* dwCurrentState (4 bytes) */ - Stream_Read_UINT32(s, readerState->dwEventState); /* dwEventState (4 bytes) */ - Stream_Read_UINT32(s, readerState->cbAtr); /* cbAtr (4 bytes) */ - Stream_Read(s, readerState->rgbAtr, 32); /* rgbAtr [0..32] (32 bytes) */ - Stream_Seek(s, 4); /* rgbAtr [32..36] (4 bytes) */ + Stream_Read_UINT32(s, readerState->dwEventState); /* dwEventState (4 bytes) */ + Stream_Read_UINT32(s, readerState->cbAtr); /* cbAtr (4 bytes) */ + Stream_Read(s, readerState->rgbAtr, 32); /* rgbAtr [0..32] (32 bytes) */ + Stream_Seek(s, 4); /* rgbAtr [32..36] (4 bytes) */ } for (index = 0; index < call->cReaders; index++) { - readerState = (LPSCARD_READERSTATEA) &call->rgReaderStates[index]; + readerState = (LPSCARD_READERSTATEA)&call->rgReaderStates[index]; if (Stream_GetRemainingLength(s) < 12) { - WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %"PRIuz"", + WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } Stream_Read_UINT32(s, maxCount); /* NdrMaxCount (4 bytes) */ - Stream_Read_UINT32(s, offset); /* NdrOffset (4 bytes) */ - Stream_Read_UINT32(s, count); /* NdrActualCount (4 bytes) */ + Stream_Read_UINT32(s, offset); /* NdrOffset (4 bytes) */ + Stream_Read_UINT32(s, count); /* NdrActualCount (4 bytes) */ if (Stream_GetRemainingLength(s) < count) { - WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %"PRIuz"", + WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %" PRIuz "", Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } - readerState->szReader = (LPCSTR) malloc(count + 1); + readerState->szReader = (LPCSTR)malloc(count + 1); if (!readerState->szReader) { @@ -2896,9 +2974,9 @@ LONG smartcard_unpack_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, wS return STATUS_NO_MEMORY; } - Stream_Read(s, (void*) readerState->szReader, count); + Stream_Read(s, (void*)readerState->szReader, count); smartcard_unpack_read_size_align(smartcard, s, count, 4); - ((char*) readerState->szReader)[count] = '\0'; + ((char*)readerState->szReader)[count] = '\0'; if (!readerState->szReader) { @@ -2912,7 +2990,7 @@ LONG smartcard_unpack_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, wS } void smartcard_trace_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, - const LocateCardsByATRA_Call* call) + const LocateCardsByATRA_Call* call) { BYTE* pb; UINT32 index; @@ -2926,42 +3004,42 @@ void smartcard_trace_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, return; WLog_DBG(TAG, "LocateCardsByATRA_Call {"); - pb = (BYTE*) & (call->hContext.pbContext); + pb = (BYTE*)&(call->hContext.pbContext); if (call->hContext.cbContext > 4) { WLog_DBG(TAG, - "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", + WLog_DBG(TAG, "hContext: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 " (%" PRIu32 ")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } for (index = 0; index < call->cReaders; index++) { - readerState = (LPSCARD_READERSTATEA) &call->rgReaderStates[index]; - WLog_DBG(TAG, "\t[%"PRIu32"]: szReader: %s cbAtr: %"PRIu32"", - index, readerState->szReader, readerState->cbAtr); + readerState = (LPSCARD_READERSTATEA)&call->rgReaderStates[index]; + WLog_DBG(TAG, "\t[%" PRIu32 "]: szReader: %s cbAtr: %" PRIu32 "", index, + readerState->szReader, readerState->cbAtr); szCurrentState = SCardGetReaderStateString(readerState->dwCurrentState); szEventState = SCardGetReaderStateString(readerState->dwEventState); - rgbAtr = winpr_BinToHexString((BYTE*) & (readerState->rgbAtr), readerState->cbAtr, FALSE); - WLog_DBG(TAG, "\t[%"PRIu32"]: dwCurrentState: %s (0x%08"PRIX32")", - index, szCurrentState, readerState->dwCurrentState); - WLog_DBG(TAG, "\t[%"PRIu32"]: dwEventState: %s (0x%08"PRIX32")", - index, szEventState, readerState->dwEventState); + rgbAtr = winpr_BinToHexString((BYTE*)&(readerState->rgbAtr), readerState->cbAtr, FALSE); + WLog_DBG(TAG, "\t[%" PRIu32 "]: dwCurrentState: %s (0x%08" PRIX32 ")", index, + szCurrentState, readerState->dwCurrentState); + WLog_DBG(TAG, "\t[%" PRIu32 "]: dwEventState: %s (0x%08" PRIX32 ")", index, szEventState, + readerState->dwEventState); if (rgbAtr) { - WLog_DBG(TAG, "\t[%"PRIu32"]: cbAtr: %"PRIu32" rgbAtr: %s", - index, readerState->cbAtr, rgbAtr); + WLog_DBG(TAG, "\t[%" PRIu32 "]: cbAtr: %" PRIu32 " rgbAtr: %s", index, + readerState->cbAtr, rgbAtr); } else { - WLog_DBG(TAG, "\t[%"PRIu32"]: cbAtr: 0 rgbAtr: n/a", - index); + WLog_DBG(TAG, "\t[%" PRIu32 "]: cbAtr: 0 rgbAtr: n/a", index); } free(szCurrentState); diff --git a/channels/smartcard/client/smartcard_pack.h b/channels/smartcard/client/smartcard_pack.h index 92bb9b505..87709649b 100644 --- a/channels/smartcard/client/smartcard_pack.h +++ b/channels/smartcard/client/smartcard_pack.h @@ -175,8 +175,8 @@ typedef struct _LocateCardsW_Call typedef struct _LocateCards_ATRMask { /* [range] */ DWORD cbAtr; - BYTE rgbAtr[ 36 ]; - BYTE rgbMask[ 36 ]; + BYTE rgbAtr[36]; + BYTE rgbMask[36]; } LocateCards_ATRMask; typedef struct _LocateCardsByATRA_Call @@ -431,8 +431,8 @@ typedef struct _WriteCacheW_Call WriteCache_Common Common; } WriteCacheW_Call; -#define SMARTCARD_COMMON_TYPE_HEADER_LENGTH 8 -#define SMARTCARD_PRIVATE_TYPE_HEADER_LENGTH 8 +#define SMARTCARD_COMMON_TYPE_HEADER_LENGTH 8 +#define SMARTCARD_PRIVATE_TYPE_HEADER_LENGTH 8 #include "smartcard_main.h" @@ -442,14 +442,14 @@ LONG smartcard_unpack_read_size_align(SMARTCARD_DEVICE* smartcard, wStream* s, U UINT32 alignment); SCARDCONTEXT smartcard_scard_context_native_from_redir(SMARTCARD_DEVICE* smartcard, - REDIR_SCARDCONTEXT* context); + REDIR_SCARDCONTEXT* context); void smartcard_scard_context_native_to_redir(SMARTCARD_DEVICE* smartcard, - REDIR_SCARDCONTEXT* context, SCARDCONTEXT hContext); + REDIR_SCARDCONTEXT* context, SCARDCONTEXT hContext); SCARDHANDLE smartcard_scard_handle_native_from_redir(SMARTCARD_DEVICE* smartcard, - REDIR_SCARDHANDLE* handle); + REDIR_SCARDHANDLE* handle); void smartcard_scard_handle_native_to_redir(SMARTCARD_DEVICE* smartcard, REDIR_SCARDHANDLE* handle, - SCARDHANDLE hCard); + SCARDHANDLE hCard); LONG smartcard_unpack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s); void smartcard_pack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s); @@ -459,50 +459,51 @@ void smartcard_pack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* s, UINT32 objectBufferLength); LONG smartcard_unpack_redir_scard_context(SMARTCARD_DEVICE* smartcard, wStream* s, - REDIR_SCARDCONTEXT* context); + REDIR_SCARDCONTEXT* context); LONG smartcard_pack_redir_scard_context(SMARTCARD_DEVICE* smartcard, wStream* s, REDIR_SCARDCONTEXT* context); LONG smartcard_unpack_redir_scard_context_ref(SMARTCARD_DEVICE* smartcard, wStream* s, - REDIR_SCARDCONTEXT* context); + REDIR_SCARDCONTEXT* context); LONG smartcard_pack_redir_scard_context_ref(SMARTCARD_DEVICE* smartcard, wStream* s, - REDIR_SCARDCONTEXT* context); + REDIR_SCARDCONTEXT* context); LONG smartcard_unpack_redir_scard_handle(SMARTCARD_DEVICE* smartcard, wStream* s, - REDIR_SCARDHANDLE* handle); + REDIR_SCARDHANDLE* handle); LONG smartcard_pack_redir_scard_handle(SMARTCARD_DEVICE* smartcard, wStream* s, REDIR_SCARDHANDLE* handle); LONG smartcard_unpack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStream* s, - REDIR_SCARDHANDLE* handle); + REDIR_SCARDHANDLE* handle); LONG smartcard_pack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStream* s, - REDIR_SCARDHANDLE* handle); + REDIR_SCARDHANDLE* handle); LONG smartcard_unpack_establish_context_call(SMARTCARD_DEVICE* smartcard, wStream* s, - EstablishContext_Call* call); + EstablishContext_Call* call); void smartcard_trace_establish_context_call(SMARTCARD_DEVICE* smartcard, - const EstablishContext_Call* call); + const EstablishContext_Call* call); LONG smartcard_pack_establish_context_return(SMARTCARD_DEVICE* smartcard, wStream* s, - EstablishContext_Return* ret); + EstablishContext_Return* ret); void smartcard_trace_establish_context_return(SMARTCARD_DEVICE* smartcard, - const EstablishContext_Return* ret); + const EstablishContext_Return* ret); LONG smartcard_unpack_context_call(SMARTCARD_DEVICE* smartcard, wStream* s, Context_Call* call); void smartcard_trace_context_call(SMARTCARD_DEVICE* smartcard, const Context_Call* call, const char* name); -void smartcard_trace_long_return(SMARTCARD_DEVICE* smartcard, const Long_Return* ret, const char* name); +void smartcard_trace_long_return(SMARTCARD_DEVICE* smartcard, const Long_Return* ret, + const char* name); LONG smartcard_unpack_list_reader_groups_call(SMARTCARD_DEVICE* smartcard, wStream* s, - ListReaderGroups_Call* call); + ListReaderGroups_Call* call); void smartcard_trace_list_reader_groups_call(SMARTCARD_DEVICE* smartcard, - const ListReaderGroups_Call* call, BOOL unicode); + const ListReaderGroups_Call* call, BOOL unicode); LONG smartcard_pack_list_reader_groups_return(SMARTCARD_DEVICE* smartcard, wStream* s, - ListReaderGroups_Return* ret); + ListReaderGroups_Return* ret); void smartcard_trace_list_reader_groups_return(SMARTCARD_DEVICE* smartcard, - const ListReaderGroups_Return* ret, BOOL unicode); + const ListReaderGroups_Return* ret, BOOL unicode); LONG smartcard_unpack_list_readers_call(SMARTCARD_DEVICE* smartcard, wStream* s, ListReaders_Call* call); @@ -512,7 +513,7 @@ void smartcard_trace_list_readers_call(SMARTCARD_DEVICE* smartcard, const ListRe LONG smartcard_pack_list_readers_return(SMARTCARD_DEVICE* smartcard, wStream* s, ListReaders_Return* ret); void smartcard_trace_list_readers_return(SMARTCARD_DEVICE* smartcard, const ListReaders_Return* ret, - BOOL unicode); + BOOL unicode); LONG smartcard_unpack_connect_a_call(SMARTCARD_DEVICE* smartcard, wStream* s, ConnectA_Call* call); void smartcard_trace_connect_a_call(SMARTCARD_DEVICE* smartcard, const ConnectA_Call* call); @@ -531,33 +532,35 @@ LONG smartcard_pack_reconnect_return(SMARTCARD_DEVICE* smartcard, wStream* s, void smartcard_trace_reconnect_return(SMARTCARD_DEVICE* smartcard, const Reconnect_Return* ret); LONG smartcard_unpack_hcard_and_disposition_call(SMARTCARD_DEVICE* smartcard, wStream* s, - HCardAndDisposition_Call* call); + HCardAndDisposition_Call* call); void smartcard_trace_hcard_and_disposition_call(SMARTCARD_DEVICE* smartcard, - HCardAndDisposition_Call* call, const char* name); + HCardAndDisposition_Call* call, const char* name); LONG smartcard_unpack_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, wStream* s, - GetStatusChangeA_Call* call); + GetStatusChangeA_Call* call); void smartcard_trace_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, - const GetStatusChangeA_Call* call); + const GetStatusChangeA_Call* call); LONG smartcard_unpack_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, wStream* s, - GetStatusChangeW_Call* call); + GetStatusChangeW_Call* call); void smartcard_trace_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, - GetStatusChangeW_Call* call); + GetStatusChangeW_Call* call); LONG smartcard_pack_get_status_change_return(SMARTCARD_DEVICE* smartcard, wStream* s, - GetStatusChange_Return* ret); + GetStatusChange_Return* ret); void smartcard_trace_get_status_change_return(SMARTCARD_DEVICE* smartcard, - const GetStatusChange_Return* ret, BOOL unicode); + const GetStatusChange_Return* ret, BOOL unicode); LONG smartcard_unpack_state_call(SMARTCARD_DEVICE* smartcard, wStream* s, State_Call* call); LONG smartcard_pack_state_return(SMARTCARD_DEVICE* smartcard, wStream* s, State_Return* ret); LONG smartcard_unpack_status_call(SMARTCARD_DEVICE* smartcard, wStream* s, Status_Call* call); -void smartcard_trace_status_call(SMARTCARD_DEVICE* smartcard, const Status_Call* call, BOOL unicode); +void smartcard_trace_status_call(SMARTCARD_DEVICE* smartcard, const Status_Call* call, + BOOL unicode); LONG smartcard_pack_status_return(SMARTCARD_DEVICE* smartcard, wStream* s, Status_Return* ret); -void smartcard_trace_status_return(SMARTCARD_DEVICE* smartcard, const Status_Return* ret, BOOL unicode); +void smartcard_trace_status_return(SMARTCARD_DEVICE* smartcard, const Status_Return* ret, + BOOL unicode); LONG smartcard_unpack_get_attrib_call(SMARTCARD_DEVICE* smartcard, wStream* s, GetAttrib_Call* call); @@ -581,9 +584,8 @@ LONG smartcard_pack_transmit_return(SMARTCARD_DEVICE* smartcard, wStream* s, Tra void smartcard_trace_transmit_return(SMARTCARD_DEVICE* smartcard, const Transmit_Return* ret); LONG smartcard_unpack_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, wStream* s, - LocateCardsByATRA_Call* call); + LocateCardsByATRA_Call* call); void smartcard_trace_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, - const LocateCardsByATRA_Call* call); - + const LocateCardsByATRA_Call* call); #endif /* FREERDP_CHANNEL_SMARTCARD_CLIENT_PACK_H */ diff --git a/channels/sshagent/client/sshagent_main.c b/channels/sshagent/client/sshagent_main.c index 39d81aaf5..aa7e632e7 100644 --- a/channels/sshagent/client/sshagent_main.c +++ b/channels/sshagent/client/sshagent_main.c @@ -95,7 +95,6 @@ struct _SSHAGENT_PLUGIN rdpContext* rdpcontext; }; - /** * Function to open the connection to the sshagent * @@ -123,8 +122,7 @@ static int connect_to_sshagent(const char* udspath) if (rc != 0) { - WLog_ERR(TAG, "Can't connect to Unix domain socket \"%s\"!", - udspath); + WLog_ERR(TAG, "Can't connect to Unix domain socket \"%s\"!", udspath); close(agent_fd); return -1; } @@ -132,7 +130,6 @@ static int connect_to_sshagent(const char* udspath) return agent_fd; } - /** * Entry point for thread to read from the ssh-agent socket and forward * the data to RDP @@ -148,9 +145,7 @@ static DWORD WINAPI sshagent_read_thread(LPVOID data) while (going) { - int bytes_read = read(callback->agent_fd, - buffer, - sizeof(buffer)); + int bytes_read = read(callback->agent_fd, buffer, sizeof(buffer)); if (bytes_read == 0) { @@ -161,9 +156,7 @@ static DWORD WINAPI sshagent_read_thread(LPVOID data) { if (errno != EINTR) { - WLog_ERR(TAG, - "Error reading from sshagent, errno=%d", - errno); + WLog_ERR(TAG, "Error reading from sshagent, errno=%d", errno); status = ERROR_READ_FAULT; going = 0; } @@ -171,10 +164,7 @@ static DWORD WINAPI sshagent_read_thread(LPVOID data) else { /* Something read: forward to virtual channel */ - status = callback->channel->Write(callback->channel, - bytes_read, - buffer, - NULL); + status = callback->channel->Write(callback->channel, bytes_read, buffer, NULL); if (status != CHANNEL_RC_OK) { @@ -186,11 +176,10 @@ static DWORD WINAPI sshagent_read_thread(LPVOID data) close(callback->agent_fd); if (status != CHANNEL_RC_OK) - setChannelError(callback->rdpcontext, status, - "sshagent_read_thread reported an error"); + setChannelError(callback->rdpcontext, status, "sshagent_read_thread reported an error"); - ExitThread(status); - return status; + ExitThread(status); + return status; } /** @@ -200,7 +189,7 @@ static DWORD WINAPI sshagent_read_thread(LPVOID data) */ static UINT sshagent_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream* data) { - SSHAGENT_CHANNEL_CALLBACK* callback = (SSHAGENT_CHANNEL_CALLBACK*) pChannelCallback; + SSHAGENT_CHANNEL_CALLBACK* callback = (SSHAGENT_CHANNEL_CALLBACK*)pChannelCallback; BYTE* pBuffer = Stream_Pointer(data); UINT32 cbSize = Stream_GetRemainingLength(data); BYTE* pos = pBuffer; @@ -210,16 +199,13 @@ static UINT sshagent_on_data_received(IWTSVirtualChannelCallback* pChannelCallba while (bytes_to_write > 0) { - int bytes_written = write(callback->agent_fd, pos, - bytes_to_write); + int bytes_written = write(callback->agent_fd, pos, bytes_to_write); if (bytes_written < 0) { if (errno != EINTR) { - WLog_ERR(TAG, - "Error writing to sshagent, errno=%d", - errno); + WLog_ERR(TAG, "Error writing to sshagent, errno=%d", errno); return ERROR_WRITE_FAULT; } } @@ -242,7 +228,7 @@ static UINT sshagent_on_data_received(IWTSVirtualChannelCallback* pChannelCallba */ static UINT sshagent_on_close(IWTSVirtualChannelCallback* pChannelCallback) { - SSHAGENT_CHANNEL_CALLBACK* callback = (SSHAGENT_CHANNEL_CALLBACK*) pChannelCallback; + SSHAGENT_CHANNEL_CALLBACK* callback = (SSHAGENT_CHANNEL_CALLBACK*)pChannelCallback; /* Call shutdown() to wake up the read() in sshagent_read_thread(). */ shutdown(callback->agent_fd, SHUT_RDWR); EnterCriticalSection(&callback->lock); @@ -250,7 +236,7 @@ static UINT sshagent_on_close(IWTSVirtualChannelCallback* pChannelCallback) if (WaitForSingleObject(callback->thread, INFINITE) == WAIT_FAILED) { UINT error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); return error; } @@ -261,19 +247,19 @@ static UINT sshagent_on_close(IWTSVirtualChannelCallback* pChannelCallback) return CHANNEL_RC_OK; } - /** * Callback for when a new virtual channel is opened * * @return 0 on success, otherwise a Win32 error code */ static UINT sshagent_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, - IWTSVirtualChannel* pChannel, BYTE* Data, BOOL* pbAccept, - IWTSVirtualChannelCallback** ppCallback) + IWTSVirtualChannel* pChannel, BYTE* Data, + BOOL* pbAccept, + IWTSVirtualChannelCallback** ppCallback) { SSHAGENT_CHANNEL_CALLBACK* callback; - SSHAGENT_LISTENER_CALLBACK* listener_callback = (SSHAGENT_LISTENER_CALLBACK*) pListenerCallback; - callback = (SSHAGENT_CHANNEL_CALLBACK*) calloc(1, sizeof(SSHAGENT_CHANNEL_CALLBACK)); + SSHAGENT_LISTENER_CALLBACK* listener_callback = (SSHAGENT_LISTENER_CALLBACK*)pListenerCallback; + callback = (SSHAGENT_CHANNEL_CALLBACK*)calloc(1, sizeof(SSHAGENT_CHANNEL_CALLBACK)); if (!callback) { @@ -283,8 +269,7 @@ static UINT sshagent_on_new_channel_connection(IWTSListenerCallback* pListenerCa /* Now open a connection to the local ssh-agent. Do this for each * connection to the plugin in case we mess up the agent session. */ - callback->agent_fd - = connect_to_sshagent(listener_callback->agent_uds_path); + callback->agent_fd = connect_to_sshagent(listener_callback->agent_uds_path); if (callback->agent_fd == -1) { @@ -299,13 +284,7 @@ static UINT sshagent_on_new_channel_connection(IWTSListenerCallback* pListenerCa callback->channel_mgr = listener_callback->channel_mgr; callback->channel = pChannel; callback->rdpcontext = listener_callback->rdpcontext; - callback->thread - = CreateThread(NULL, - 0, - sshagent_read_thread, - (void*) callback, - 0, - NULL); + callback->thread = CreateThread(NULL, 0, sshagent_read_thread, (void*)callback, 0, NULL); if (!callback->thread) { @@ -315,7 +294,7 @@ static UINT sshagent_on_new_channel_connection(IWTSListenerCallback* pListenerCa return CHANNEL_RC_INITIALIZATION_ERROR; } - *ppCallback = (IWTSVirtualChannelCallback*) callback; + *ppCallback = (IWTSVirtualChannelCallback*)callback; return CHANNEL_RC_OK; } @@ -326,9 +305,9 @@ static UINT sshagent_on_new_channel_connection(IWTSListenerCallback* pListenerCa */ static UINT sshagent_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) { - SSHAGENT_PLUGIN* sshagent = (SSHAGENT_PLUGIN*) pPlugin; - sshagent->listener_callback = (SSHAGENT_LISTENER_CALLBACK*) calloc(1, - sizeof(SSHAGENT_LISTENER_CALLBACK)); + SSHAGENT_PLUGIN* sshagent = (SSHAGENT_PLUGIN*)pPlugin; + sshagent->listener_callback = + (SSHAGENT_LISTENER_CALLBACK*)calloc(1, sizeof(SSHAGENT_LISTENER_CALLBACK)); if (!sshagent->listener_callback) { @@ -351,7 +330,7 @@ static UINT sshagent_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelMa } return pChannelMgr->CreateListener(pChannelMgr, "SSHAGENT", 0, - (IWTSListenerCallback*) sshagent->listener_callback, NULL); + (IWTSListenerCallback*)sshagent->listener_callback, NULL); } /** @@ -361,15 +340,15 @@ static UINT sshagent_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelMa */ static UINT sshagent_plugin_terminated(IWTSPlugin* pPlugin) { - SSHAGENT_PLUGIN* sshagent = (SSHAGENT_PLUGIN*) pPlugin; + SSHAGENT_PLUGIN* sshagent = (SSHAGENT_PLUGIN*)pPlugin; free(sshagent); return CHANNEL_RC_OK; } #ifdef BUILTIN_CHANNELS -#define DVCPluginEntry sshagent_DVCPluginEntry +#define DVCPluginEntry sshagent_DVCPluginEntry #else -#define DVCPluginEntry FREERDP_API DVCPluginEntry +#define DVCPluginEntry FREERDP_API DVCPluginEntry #endif /** @@ -381,11 +360,11 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) { UINT status = CHANNEL_RC_OK; SSHAGENT_PLUGIN* sshagent; - sshagent = (SSHAGENT_PLUGIN*) pEntryPoints->GetPlugin(pEntryPoints, "sshagent"); + sshagent = (SSHAGENT_PLUGIN*)pEntryPoints->GetPlugin(pEntryPoints, "sshagent"); if (!sshagent) { - sshagent = (SSHAGENT_PLUGIN*) calloc(1, sizeof(SSHAGENT_PLUGIN)); + sshagent = (SSHAGENT_PLUGIN*)calloc(1, sizeof(SSHAGENT_PLUGIN)); if (!sshagent) { @@ -397,9 +376,10 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) sshagent->iface.Connected = NULL; sshagent->iface.Disconnected = NULL; sshagent->iface.Terminated = sshagent_plugin_terminated; - sshagent->rdpcontext = ((freerdp*)((rdpSettings*) pEntryPoints->GetRdpSettings( - pEntryPoints))->instance)->context; - status = pEntryPoints->RegisterPlugin(pEntryPoints, "sshagent", (IWTSPlugin*) sshagent); + sshagent->rdpcontext = + ((freerdp*)((rdpSettings*)pEntryPoints->GetRdpSettings(pEntryPoints))->instance) + ->context; + status = pEntryPoints->RegisterPlugin(pEntryPoints, "sshagent", (IWTSPlugin*)sshagent); } return status; diff --git a/channels/sshagent/client/sshagent_main.h b/channels/sshagent/client/sshagent_main.h index fc1ac150d..550b2b74d 100644 --- a/channels/sshagent/client/sshagent_main.h +++ b/channels/sshagent/client/sshagent_main.h @@ -35,8 +35,10 @@ #ifdef WITH_DEBUG_SSHAGENT #define DEBUG_SSHAGENT(...) WLog_DBG(DVC_TAG, __VA_ARGS__) #else -#define DEBUG_SSHAGENT(...) do { } while (0) +#define DEBUG_SSHAGENT(...) \ + do \ + { \ + } while (0) #endif #endif /* SSHAGENT_MAIN_H */ - diff --git a/channels/tsmf/client/alsa/tsmf_alsa.c b/channels/tsmf/client/alsa/tsmf_alsa.c index 3cf821b60..6e1f00357 100644 --- a/channels/tsmf/client/alsa/tsmf_alsa.c +++ b/channels/tsmf/client/alsa/tsmf_alsa.c @@ -65,7 +65,7 @@ static BOOL tsmf_alsa_open_device(TSMFAlsaAudioDevice* alsa) static BOOL tsmf_alsa_open(ITSMFAudioDevice* audio, const char* device) { - TSMFAlsaAudioDevice* alsa = (TSMFAlsaAudioDevice*) audio; + TSMFAlsaAudioDevice* alsa = (TSMFAlsaAudioDevice*)audio; if (!device) { @@ -79,14 +79,14 @@ static BOOL tsmf_alsa_open(ITSMFAudioDevice* audio, const char* device) return tsmf_alsa_open_device(alsa); } -static BOOL tsmf_alsa_set_format(ITSMFAudioDevice* audio, - UINT32 sample_rate, UINT32 channels, UINT32 bits_per_sample) +static BOOL tsmf_alsa_set_format(ITSMFAudioDevice* audio, UINT32 sample_rate, UINT32 channels, + UINT32 bits_per_sample) { int error; snd_pcm_uframes_t frames; snd_pcm_hw_params_t* hw_params; snd_pcm_sw_params_t* sw_params; - TSMFAlsaAudioDevice* alsa = (TSMFAlsaAudioDevice*) audio; + TSMFAlsaAudioDevice* alsa = (TSMFAlsaAudioDevice*)audio; if (!alsa->out_handle) return FALSE; @@ -104,17 +104,12 @@ static BOOL tsmf_alsa_set_format(ITSMFAudioDevice* audio, } snd_pcm_hw_params_any(alsa->out_handle, hw_params); - snd_pcm_hw_params_set_access(alsa->out_handle, hw_params, - SND_PCM_ACCESS_RW_INTERLEAVED); - snd_pcm_hw_params_set_format(alsa->out_handle, hw_params, - SND_PCM_FORMAT_S16_LE); - snd_pcm_hw_params_set_rate_near(alsa->out_handle, hw_params, - &alsa->actual_rate, NULL); - snd_pcm_hw_params_set_channels_near(alsa->out_handle, hw_params, - &alsa->actual_channels); + snd_pcm_hw_params_set_access(alsa->out_handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED); + snd_pcm_hw_params_set_format(alsa->out_handle, hw_params, SND_PCM_FORMAT_S16_LE); + snd_pcm_hw_params_set_rate_near(alsa->out_handle, hw_params, &alsa->actual_rate, NULL); + snd_pcm_hw_params_set_channels_near(alsa->out_handle, hw_params, &alsa->actual_channels); frames = sample_rate; - snd_pcm_hw_params_set_buffer_size_near(alsa->out_handle, hw_params, - &frames); + snd_pcm_hw_params_set_buffer_size_near(alsa->out_handle, hw_params, &frames); snd_pcm_hw_params(alsa->out_handle, hw_params); snd_pcm_hw_params_free(hw_params); error = snd_pcm_sw_params_malloc(&sw_params); @@ -126,22 +121,21 @@ static BOOL tsmf_alsa_set_format(ITSMFAudioDevice* audio, } snd_pcm_sw_params_current(alsa->out_handle, sw_params); - snd_pcm_sw_params_set_start_threshold(alsa->out_handle, sw_params, - frames / 2); + snd_pcm_sw_params_set_start_threshold(alsa->out_handle, sw_params, frames / 2); snd_pcm_sw_params(alsa->out_handle, sw_params); snd_pcm_sw_params_free(sw_params); snd_pcm_prepare(alsa->out_handle); - DEBUG_TSMF("sample_rate %"PRIu32" channels %"PRIu32" bits_per_sample %"PRIu32"", + DEBUG_TSMF("sample_rate %" PRIu32 " channels %" PRIu32 " bits_per_sample %" PRIu32 "", sample_rate, channels, bits_per_sample); DEBUG_TSMF("hardware buffer %lu frames", frames); if ((alsa->actual_rate != alsa->source_rate) || (alsa->actual_channels != alsa->source_channels)) { - DEBUG_TSMF("actual rate %"PRIu32" / channel %"PRIu32" is different " - "from source rate %"PRIu32" / channel %"PRIu32", resampling required.", - alsa->actual_rate, alsa->actual_channels, - alsa->source_rate, alsa->source_channels); + DEBUG_TSMF("actual rate %" PRIu32 " / channel %" PRIu32 " is different " + "from source rate %" PRIu32 " / channel %" PRIu32 ", resampling required.", + alsa->actual_rate, alsa->actual_channels, alsa->source_rate, + alsa->source_channels); } return TRUE; @@ -156,8 +150,8 @@ static BOOL tsmf_alsa_play(ITSMFAudioDevice* audio, const BYTE* src, UINT32 data const BYTE* pindex; int rbytes_per_frame; int sbytes_per_frame; - TSMFAlsaAudioDevice* alsa = (TSMFAlsaAudioDevice*) audio; - DEBUG_TSMF("data_size %"PRIu32"", data_size); + TSMFAlsaAudioDevice* alsa = (TSMFAlsaAudioDevice*)audio; + DEBUG_TSMF("data_size %" PRIu32 "", data_size); if (alsa->out_handle) { @@ -202,13 +196,12 @@ static UINT64 tsmf_alsa_get_latency(ITSMFAudioDevice* audio) { UINT64 latency = 0; snd_pcm_sframes_t frames = 0; - TSMFAlsaAudioDevice* alsa = (TSMFAlsaAudioDevice*) audio; + TSMFAlsaAudioDevice* alsa = (TSMFAlsaAudioDevice*)audio; if (alsa->out_handle && alsa->actual_rate > 0 && - snd_pcm_delay(alsa->out_handle, &frames) == 0 && - frames > 0) + snd_pcm_delay(alsa->out_handle, &frames) == 0 && frames > 0) { - latency = ((UINT64)frames) * 10000000LL / (UINT64) alsa->actual_rate; + latency = ((UINT64)frames) * 10000000LL / (UINT64)alsa->actual_rate; } return latency; @@ -221,7 +214,7 @@ static BOOL tsmf_alsa_flush(ITSMFAudioDevice* audio) static void tsmf_alsa_free(ITSMFAudioDevice* audio) { - TSMFAlsaAudioDevice* alsa = (TSMFAlsaAudioDevice*) audio; + TSMFAlsaAudioDevice* alsa = (TSMFAlsaAudioDevice*)audio; DEBUG_TSMF(""); if (alsa->out_handle) @@ -234,15 +227,16 @@ static void tsmf_alsa_free(ITSMFAudioDevice* audio) } #ifdef BUILTIN_CHANNELS -#define freerdp_tsmf_client_audio_subsystem_entry alsa_freerdp_tsmf_client_audio_subsystem_entry +#define freerdp_tsmf_client_audio_subsystem_entry alsa_freerdp_tsmf_client_audio_subsystem_entry #else -#define freerdp_tsmf_client_audio_subsystem_entry FREERDP_API freerdp_tsmf_client_audio_subsystem_entry +#define freerdp_tsmf_client_audio_subsystem_entry \ + FREERDP_API freerdp_tsmf_client_audio_subsystem_entry #endif ITSMFAudioDevice* freerdp_tsmf_client_audio_subsystem_entry(void) { TSMFAlsaAudioDevice* alsa; - alsa = (TSMFAlsaAudioDevice*) malloc(sizeof(TSMFAlsaAudioDevice)); + alsa = (TSMFAlsaAudioDevice*)malloc(sizeof(TSMFAlsaAudioDevice)); ZeroMemory(alsa, sizeof(TSMFAlsaAudioDevice)); alsa->iface.Open = tsmf_alsa_open; alsa->iface.SetFormat = tsmf_alsa_set_format; @@ -250,5 +244,5 @@ ITSMFAudioDevice* freerdp_tsmf_client_audio_subsystem_entry(void) alsa->iface.GetLatency = tsmf_alsa_get_latency; alsa->iface.Flush = tsmf_alsa_flush; alsa->iface.Free = tsmf_alsa_free; - return (ITSMFAudioDevice*) alsa; + return (ITSMFAudioDevice*)alsa; } diff --git a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c index 5522eb724..0444ad07b 100644 --- a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c +++ b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c @@ -92,7 +92,7 @@ typedef struct _TSMFFFmpegDecoder static BOOL tsmf_ffmpeg_init_context(ITSMFDecoder* decoder) { - TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder; + TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*)decoder; mdecoder->codec_context = avcodec_alloc_context3(NULL); if (!mdecoder->codec_context) @@ -106,7 +106,7 @@ static BOOL tsmf_ffmpeg_init_context(ITSMFDecoder* decoder) static BOOL tsmf_ffmpeg_init_video_stream(ITSMFDecoder* decoder, const TS_AM_MEDIA_TYPE* media_type) { - TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder; + TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*)decoder; mdecoder->codec_context->width = media_type->Width; mdecoder->codec_context->height = media_type->Height; mdecoder->codec_context->bit_rate = media_type->BitRate; @@ -122,7 +122,7 @@ static BOOL tsmf_ffmpeg_init_video_stream(ITSMFDecoder* decoder, const TS_AM_MED static BOOL tsmf_ffmpeg_init_audio_stream(ITSMFDecoder* decoder, const TS_AM_MEDIA_TYPE* media_type) { - TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder; + TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*)decoder; mdecoder->codec_context->sample_rate = media_type->SamplesPerSecond.Numerator; mdecoder->codec_context->bit_rate = media_type->BitRate; mdecoder->codec_context->channels = media_type->Channels; @@ -137,7 +137,7 @@ static BOOL tsmf_ffmpeg_init_audio_stream(ITSMFDecoder* decoder, const TS_AM_MED mdecoder->codec_context->dsp_mask = FF_MM_SSE2 | FF_MM_MMX2; #endif #endif -#else /* LIBAVCODEC_VERSION_MAJOR < 55 */ +#else /* LIBAVCODEC_VERSION_MAJOR < 55 */ #ifdef AV_CPU_FLAG_SSE2 av_set_cpu_flags_mask(AV_CPU_FLAG_SSE2 | AV_CPU_FLAG_MMXEXT); #else @@ -152,7 +152,7 @@ static BOOL tsmf_ffmpeg_init_stream(ITSMFDecoder* decoder, const TS_AM_MEDIA_TYP BYTE* p; UINT32 size; const BYTE* s; - TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder; + TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*)decoder; mdecoder->codec = avcodec_find_decoder(mdecoder->codec_id); if (!mdecoder->codec) @@ -198,12 +198,12 @@ static BOOL tsmf_ffmpeg_init_stream(ITSMFDecoder* decoder, const TS_AM_MEDIA_TYP /* The extradata format that FFmpeg uses is following CodecPrivate in Matroska. See http://haali.su/mkv/codecs.pdf */ p = mdecoder->codec_context->extradata; - *p++ = 1; /* Reserved? */ - *p++ = media_type->ExtraData[8]; /* Profile */ - *p++ = 0; /* Profile */ + *p++ = 1; /* Reserved? */ + *p++ = media_type->ExtraData[8]; /* Profile */ + *p++ = 0; /* Profile */ *p++ = media_type->ExtraData[12]; /* Level */ - *p++ = 0xff; /* Flag? */ - *p++ = 0xe0 | 0x01; /* Reserved | #sps */ + *p++ = 0xff; /* Flag? */ + *p++ = 0xe0 | 0x01; /* Reserved | #sps */ s = media_type->ExtraData + 20; size = ((UINT32)(*s)) * 256 + ((UINT32)(*(s + 1))); memcpy(p, s, size + 2); @@ -215,7 +215,8 @@ static BOOL tsmf_ffmpeg_init_stream(ITSMFDecoder* decoder, const TS_AM_MEDIA_TYP } else { - memcpy(mdecoder->codec_context->extradata, media_type->ExtraData, media_type->ExtraDataSize); + memcpy(mdecoder->codec_context->extradata, media_type->ExtraData, + media_type->ExtraDataSize); memset(mdecoder->codec_context->extradata + media_type->ExtraDataSize, 0, 8); } } @@ -228,7 +229,7 @@ static BOOL tsmf_ffmpeg_init_stream(ITSMFDecoder* decoder, const TS_AM_MEDIA_TYP static BOOL tsmf_ffmpeg_prepare(ITSMFDecoder* decoder) { - TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder; + TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*)decoder; if (avcodec_open2(mdecoder->codec_context, mdecoder->codec, NULL) < 0) { @@ -242,7 +243,7 @@ static BOOL tsmf_ffmpeg_prepare(ITSMFDecoder* decoder) static BOOL tsmf_ffmpeg_set_format(ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* media_type) { - TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder; + TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*)decoder; switch (media_type->MajorType) { @@ -330,18 +331,19 @@ static BOOL tsmf_ffmpeg_set_format(ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* medi static BOOL tsmf_ffmpeg_decode_video(ITSMFDecoder* decoder, const BYTE* data, UINT32 data_size, UINT32 extensions) { - TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder; + TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*)decoder; int decoded; int len; AVFrame* frame; BOOL ret = TRUE; -#if LIBAVCODEC_VERSION_MAJOR < 52 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR <= 20) +#if LIBAVCODEC_VERSION_MAJOR < 52 || \ + (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR <= 20) len = avcodec_decode_video(mdecoder->codec_context, mdecoder->frame, &decoded, data, data_size); #else { AVPacket pkt; av_init_packet(&pkt); - pkt.data = (BYTE*) data; + pkt.data = (BYTE*)data; pkt.size = data_size; if (extensions & TSMM_SAMPLE_EXT_CLEANPOINT) @@ -353,12 +355,12 @@ static BOOL tsmf_ffmpeg_decode_video(ITSMFDecoder* decoder, const BYTE* data, UI if (len < 0) { - WLog_ERR(TAG, "data_size %"PRIu32", avcodec_decode_video failed (%d)", data_size, len); + WLog_ERR(TAG, "data_size %" PRIu32 ", avcodec_decode_video failed (%d)", data_size, len); ret = FALSE; } else if (!decoded) { - WLog_ERR(TAG, "data_size %"PRIu32", no frame is decoded.", data_size); + WLog_ERR(TAG, "data_size %" PRIu32 ", no frame is decoded.", data_size); ret = FALSE; } else @@ -367,10 +369,11 @@ static BOOL tsmf_ffmpeg_decode_video(ITSMFDecoder* decoder, const BYTE* data, UI "pix_fmt %d width %d height %d", mdecoder->frame->linesize[0], mdecoder->frame->linesize[1], mdecoder->frame->linesize[2], mdecoder->frame->linesize[3], - mdecoder->codec_context->pix_fmt, - mdecoder->codec_context->width, mdecoder->codec_context->height); - mdecoder->decoded_size = avpicture_get_size(mdecoder->codec_context->pix_fmt, - mdecoder->codec_context->width, mdecoder->codec_context->height); + mdecoder->codec_context->pix_fmt, mdecoder->codec_context->width, + mdecoder->codec_context->height); + mdecoder->decoded_size = + avpicture_get_size(mdecoder->codec_context->pix_fmt, mdecoder->codec_context->width, + mdecoder->codec_context->height); mdecoder->decoded_data = calloc(1, mdecoder->decoded_size); if (!mdecoder->decoded_data) @@ -381,12 +384,11 @@ static BOOL tsmf_ffmpeg_decode_video(ITSMFDecoder* decoder, const BYTE* data, UI #else frame = av_frame_alloc(); #endif - avpicture_fill((AVPicture*) frame, mdecoder->decoded_data, - mdecoder->codec_context->pix_fmt, + avpicture_fill((AVPicture*)frame, mdecoder->decoded_data, mdecoder->codec_context->pix_fmt, mdecoder->codec_context->width, mdecoder->codec_context->height); - av_picture_copy((AVPicture*) frame, (AVPicture*) mdecoder->frame, - mdecoder->codec_context->pix_fmt, - mdecoder->codec_context->width, mdecoder->codec_context->height); + av_picture_copy((AVPicture*)frame, (AVPicture*)mdecoder->frame, + mdecoder->codec_context->pix_fmt, mdecoder->codec_context->width, + mdecoder->codec_context->height); av_free(frame); } @@ -396,7 +398,7 @@ static BOOL tsmf_ffmpeg_decode_video(ITSMFDecoder* decoder, const BYTE* data, UI static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder* decoder, const BYTE* data, UINT32 data_size, UINT32 extensions) { - TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder; + TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*)decoder; int len; int frame_size; UINT32 src_size; @@ -426,7 +428,7 @@ static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder* decoder, const BYTE* data, UI return FALSE; /* align the memory for SSE2 needs */ - dst = (BYTE*)(((uintptr_t) mdecoder->decoded_data + 15) & ~ 0x0F); + dst = (BYTE*)(((uintptr_t)mdecoder->decoded_data + 15) & ~0x0F); dst_offset = dst - mdecoder->decoded_data; src = data; src_size = data_size; @@ -444,7 +446,7 @@ static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder* decoder, const BYTE* data, UI mdecoder->decoded_size_max = mdecoder->decoded_size_max * 2 + 16; mdecoder->decoded_data = tmp_data; - dst = (BYTE*)(((uintptr_t)mdecoder->decoded_data + 15) & ~ 0x0F); + dst = (BYTE*)(((uintptr_t)mdecoder->decoded_data + 15) & ~0x0F); if (dst - mdecoder->decoded_data != dst_offset) { @@ -457,9 +459,10 @@ static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder* decoder, const BYTE* data, UI } frame_size = mdecoder->decoded_size_max - mdecoder->decoded_size; -#if LIBAVCODEC_VERSION_MAJOR < 52 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR <= 20) - len = avcodec_decode_audio2(mdecoder->codec_context, - (int16_t*) dst, &frame_size, src, src_size); +#if LIBAVCODEC_VERSION_MAJOR < 52 || \ + (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR <= 20) + len = avcodec_decode_audio2(mdecoder->codec_context, (int16_t*)dst, &frame_size, src, + src_size); #else { #if LIBAVCODEC_VERSION_MAJOR < 55 @@ -470,14 +473,15 @@ static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder* decoder, const BYTE* data, UI int got_frame = 0; AVPacket pkt; av_init_packet(&pkt); - pkt.data = (BYTE*) src; + pkt.data = (BYTE*)src; pkt.size = src_size; len = avcodec_decode_audio4(mdecoder->codec_context, decoded_frame, &got_frame, &pkt); if (len >= 0 && got_frame) { frame_size = av_samples_get_buffer_size(NULL, mdecoder->codec_context->channels, - decoded_frame->nb_samples, mdecoder->codec_context->sample_fmt, 1); + decoded_frame->nb_samples, + mdecoder->codec_context->sample_fmt, 1); memcpy(dst, decoded_frame->data[0], frame_size); } else @@ -510,18 +514,18 @@ static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder* decoder, const BYTE* data, UI else if (dst_offset) { /* move the aligned decoded data to original place */ - memmove(mdecoder->decoded_data, mdecoder->decoded_data + dst_offset, mdecoder->decoded_size); + memmove(mdecoder->decoded_data, mdecoder->decoded_data + dst_offset, + mdecoder->decoded_size); } - DEBUG_TSMF("data_size %"PRIu32" decoded_size %"PRIu32"", - data_size, mdecoder->decoded_size); + DEBUG_TSMF("data_size %" PRIu32 " decoded_size %" PRIu32 "", data_size, mdecoder->decoded_size); return TRUE; } static BOOL tsmf_ffmpeg_decode(ITSMFDecoder* decoder, const BYTE* data, UINT32 data_size, UINT32 extensions) { - TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder; + TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*)decoder; if (mdecoder->decoded_data) { @@ -548,7 +552,7 @@ static BOOL tsmf_ffmpeg_decode(ITSMFDecoder* decoder, const BYTE* data, UINT32 d static BYTE* tsmf_ffmpeg_get_decoded_data(ITSMFDecoder* decoder, UINT32* size) { BYTE* buf; - TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder; + TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*)decoder; *size = mdecoder->decoded_size; buf = mdecoder->decoded_data; mdecoder->decoded_data = NULL; @@ -558,7 +562,7 @@ static BYTE* tsmf_ffmpeg_get_decoded_data(ITSMFDecoder* decoder, UINT32* size) static UINT32 tsmf_ffmpeg_get_decoded_format(ITSMFDecoder* decoder) { - TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder; + TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*)decoder; switch (mdecoder->codec_context->pix_fmt) { @@ -566,15 +570,14 @@ static UINT32 tsmf_ffmpeg_get_decoded_format(ITSMFDecoder* decoder) return RDP_PIXFMT_I420; default: - WLog_ERR(TAG, "unsupported pixel format %u", - mdecoder->codec_context->pix_fmt); - return (UINT32) - 1; + WLog_ERR(TAG, "unsupported pixel format %u", mdecoder->codec_context->pix_fmt); + return (UINT32)-1; } } static BOOL tsmf_ffmpeg_get_decoded_dimension(ITSMFDecoder* decoder, UINT32* width, UINT32* height) { - TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder; + TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*)decoder; if (mdecoder->codec_context->width > 0 && mdecoder->codec_context->height > 0) { @@ -590,7 +593,7 @@ static BOOL tsmf_ffmpeg_get_decoded_dimension(ITSMFDecoder* decoder, UINT32* wid static void tsmf_ffmpeg_free(ITSMFDecoder* decoder) { - TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder; + TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*)decoder; if (mdecoder->frame) av_free(mdecoder->frame); @@ -617,17 +620,17 @@ static BOOL CALLBACK InitializeAvCodecs(PINIT_ONCE once, PVOID param, PVOID* con } #ifdef BUILTIN_CHANNELS -#define freerdp_tsmf_client_subsystem_entry ffmpeg_freerdp_tsmf_client_decoder_subsystem_entry +#define freerdp_tsmf_client_subsystem_entry ffmpeg_freerdp_tsmf_client_decoder_subsystem_entry #else -#define freerdp_tsmf_client_subsystem_entry FREERDP_API freerdp_tsmf_client_decoder_subsystem_entry +#define freerdp_tsmf_client_subsystem_entry FREERDP_API freerdp_tsmf_client_decoder_subsystem_entry #endif ITSMFDecoder* freerdp_tsmf_client_subsystem_entry(void) { TSMFFFmpegDecoder* decoder; InitOnceExecuteOnce(&g_Initialized, InitializeAvCodecs, NULL, NULL); - WLog_DBG(TAG, "TSMFDecoderEntry FFMPEG"); - decoder = (TSMFFFmpegDecoder*) calloc(1, sizeof(TSMFFFmpegDecoder)); + WLog_DBG(TAG, "TSMFDecoderEntry FFMPEG"); + decoder = (TSMFFFmpegDecoder*)calloc(1, sizeof(TSMFFFmpegDecoder)); if (!decoder) return NULL; @@ -638,5 +641,5 @@ ITSMFDecoder* freerdp_tsmf_client_subsystem_entry(void) decoder->iface.GetDecodedFormat = tsmf_ffmpeg_get_decoded_format; decoder->iface.GetDecodedDimension = tsmf_ffmpeg_get_decoded_dimension; decoder->iface.Free = tsmf_ffmpeg_free; - return (ITSMFDecoder*) decoder; + return (ITSMFDecoder*)decoder; } diff --git a/channels/tsmf/client/gstreamer/tsmf_X11.c b/channels/tsmf/client/gstreamer/tsmf_X11.c index 7035d0db3..f7b339c95 100644 --- a/channels/tsmf/client/gstreamer/tsmf_X11.c +++ b/channels/tsmf/client/gstreamer/tsmf_X11.c @@ -16,7 +16,7 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #include #include @@ -65,17 +65,17 @@ struct X11Handle { int shmid; - int *xfwin; + int* xfwin; #if defined(WITH_XEXT) BOOL has_shape; #endif - Display *disp; + Display* disp; Window subwin; BOOL subwinMapped; #if GST_VERSION_MAJOR > 0 - GstVideoOverlay *overlay; + GstVideoOverlay* overlay; #else - GstXOverlay *overlay; + GstXOverlay* overlay; #endif int subwinWidth; int subwinHeight; @@ -90,34 +90,35 @@ static const char* get_shm_id() return shm_id; } -static GstBusSyncReply tsmf_platform_bus_sync_handler(GstBus *bus, GstMessage *message, gpointer user_data) +static GstBusSyncReply tsmf_platform_bus_sync_handler(GstBus* bus, GstMessage* message, + gpointer user_data) { struct X11Handle* hdl; TSMFGstreamerDecoder* decoder = user_data; - if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT) + if (GST_MESSAGE_TYPE(message) != GST_MESSAGE_ELEMENT) return GST_BUS_PASS; #if GST_VERSION_MAJOR > 0 - if (!gst_is_video_overlay_prepare_window_handle_message (message)) + if (!gst_is_video_overlay_prepare_window_handle_message(message)) return GST_BUS_PASS; #else - if (!gst_structure_has_name (message->structure, "prepare-xwindow-id")) + if (!gst_structure_has_name(message->structure, "prepare-xwindow-id")) return GST_BUS_PASS; #endif - hdl = (struct X11Handle*) decoder->platform; + hdl = (struct X11Handle*)decoder->platform; if (hdl->subwin) { #if GST_VERSION_MAJOR > 0 - hdl->overlay = GST_VIDEO_OVERLAY (GST_MESSAGE_SRC (message)); + hdl->overlay = GST_VIDEO_OVERLAY(GST_MESSAGE_SRC(message)); gst_video_overlay_set_window_handle(hdl->overlay, hdl->subwin); gst_video_overlay_handle_events(hdl->overlay, FALSE); #else - hdl->overlay = GST_X_OVERLAY (GST_MESSAGE_SRC (message)); -#if GST_CHECK_VERSION(0,10,31) + hdl->overlay = GST_X_OVERLAY(GST_MESSAGE_SRC(message)); +#if GST_CHECK_VERSION(0, 10, 31) gst_x_overlay_set_window_handle(hdl->overlay, hdl->subwin); #else gst_x_overlay_set_xwindow_id(hdl->overlay, hdl->subwin); @@ -125,17 +126,20 @@ static GstBusSyncReply tsmf_platform_bus_sync_handler(GstBus *bus, GstMessage *m gst_x_overlay_handle_events(hdl->overlay, TRUE); #endif - if (hdl->subwinWidth != -1 && hdl->subwinHeight != -1 && hdl->subwinX != -1 && hdl->subwinY != -1) + if (hdl->subwinWidth != -1 && hdl->subwinHeight != -1 && hdl->subwinX != -1 && + hdl->subwinY != -1) { #if GST_VERSION_MAJOR > 0 - if (!gst_video_overlay_set_render_rectangle(hdl->overlay, 0, 0, hdl->subwinWidth, hdl->subwinHeight)) + if (!gst_video_overlay_set_render_rectangle(hdl->overlay, 0, 0, hdl->subwinWidth, + hdl->subwinHeight)) { WLog_ERR(TAG, "Could not resize overlay!"); } gst_video_overlay_expose(hdl->overlay); #else - if (!gst_x_overlay_set_render_rectangle(hdl->overlay, 0, 0, hdl->subwinWidth, hdl->subwinHeight)) + if (!gst_x_overlay_set_render_rectangle(hdl->overlay, 0, 0, hdl->subwinWidth, + hdl->subwinHeight)) { WLog_ERR(TAG, "Could not resize overlay!"); } @@ -143,15 +147,18 @@ static GstBusSyncReply tsmf_platform_bus_sync_handler(GstBus *bus, GstMessage *m gst_x_overlay_expose(hdl->overlay); #endif XLockDisplay(hdl->disp); - XMoveResizeWindow(hdl->disp, hdl->subwin, hdl->subwinX, hdl->subwinY, hdl->subwinWidth, hdl->subwinHeight); + XMoveResizeWindow(hdl->disp, hdl->subwin, hdl->subwinX, hdl->subwinY, hdl->subwinWidth, + hdl->subwinHeight); XSync(hdl->disp, FALSE); XUnlockDisplay(hdl->disp); } - } else { - g_warning ("Window was not available before retrieving the overlay!"); + } + else + { + g_warning("Window was not available before retrieving the overlay!"); } - gst_message_unref (message); + gst_message_unref(message); return GST_BUS_DROP; } @@ -187,11 +194,12 @@ int tsmf_platform_create(TSMFGstreamerDecoder* decoder) hdl->shmid = shm_open(get_shm_id(), (O_RDWR | O_CREAT), (PROT_READ | PROT_WRITE)); if (hdl->shmid == -1) { - WLog_ERR(TAG, "failed to get access to shared memory - shmget(%s): %i - %s", get_shm_id(), errno, strerror(errno)); + WLog_ERR(TAG, "failed to get access to shared memory - shmget(%s): %i - %s", get_shm_id(), + errno, strerror(errno)); return -2; } - hdl->xfwin = mmap(0, sizeof(void *), PROT_READ | PROT_WRITE, MAP_SHARED, hdl->shmid, 0); + hdl->xfwin = mmap(0, sizeof(void*), PROT_READ | PROT_WRITE, MAP_SHARED, hdl->shmid, 0); if (hdl->xfwin == MAP_FAILED) { WLog_ERR(TAG, "shmat failed!"); @@ -221,7 +229,6 @@ int tsmf_platform_set_format(TSMFGstreamerDecoder* decoder) if (decoder->media_type == TSMF_MAJOR_TYPE_VIDEO) { - } return 0; @@ -240,9 +247,9 @@ int tsmf_platform_register_handler(TSMFGstreamerDecoder* decoder) bus = gst_pipeline_get_bus(GST_PIPELINE(decoder->pipe)); #if GST_VERSION_MAJOR > 0 - gst_bus_set_sync_handler (bus, (GstBusSyncHandler) tsmf_platform_bus_sync_handler, decoder, NULL); + gst_bus_set_sync_handler(bus, (GstBusSyncHandler)tsmf_platform_bus_sync_handler, decoder, NULL); #else - gst_bus_set_sync_handler (bus, (GstBusSyncHandler) tsmf_platform_bus_sync_handler, decoder); + gst_bus_set_sync_handler(bus, (GstBusSyncHandler)tsmf_platform_bus_sync_handler, decoder); #endif if (!bus) @@ -251,7 +258,7 @@ int tsmf_platform_register_handler(TSMFGstreamerDecoder* decoder) return 1; } - gst_object_unref (bus); + gst_object_unref(bus); return 0; } @@ -295,12 +302,12 @@ int tsmf_window_create(TSMFGstreamerDecoder* decoder) if (!decoder->platform) return -1; - hdl = (struct X11Handle*) decoder->platform; + hdl = (struct X11Handle*)decoder->platform; if (!hdl->subwin) { XLockDisplay(hdl->disp); - hdl->subwin = XCreateSimpleWindow(hdl->disp, *(int *)hdl->xfwin, 0, 0, 1, 1, 0, 0, 0); + hdl->subwin = XCreateSimpleWindow(hdl->disp, *(int*)hdl->xfwin, 0, 0, 1, 1, 0, 0, 0); XUnlockDisplay(hdl->disp); if (!hdl->subwin) @@ -313,18 +320,18 @@ int tsmf_window_create(TSMFGstreamerDecoder* decoder) decoder->ready = TRUE; #if defined(WITH_XEXT) - int event, error; - XLockDisplay(hdl->disp); - hdl->has_shape = XShapeQueryExtension(hdl->disp, &event, &error); - XUnlockDisplay(hdl->disp); + int event, error; + XLockDisplay(hdl->disp); + hdl->has_shape = XShapeQueryExtension(hdl->disp, &event, &error); + XUnlockDisplay(hdl->disp); #endif } return 0; } -int tsmf_window_resize(TSMFGstreamerDecoder* decoder, int x, int y, int width, - int height, int nr_rects, RDP_RECT *rects) +int tsmf_window_resize(TSMFGstreamerDecoder* decoder, int x, int y, int width, int height, + int nr_rects, RDP_RECT* rects) { struct X11Handle* hdl; @@ -339,7 +346,7 @@ int tsmf_window_resize(TSMFGstreamerDecoder* decoder, int x, int y, int width, if (!decoder->platform) return -1; - hdl = (struct X11Handle*) decoder->platform; + hdl = (struct X11Handle*)decoder->platform; DEBUG_TSMF("resize: x=%d, y=%d, w=%d, h=%d", x, y, width, height); if (hdl->overlay) @@ -370,7 +377,8 @@ int tsmf_window_resize(TSMFGstreamerDecoder* decoder, int x, int y, int width, hdl->subwinHeight = height; XLockDisplay(hdl->disp); - XMoveResizeWindow(hdl->disp, hdl->subwin, hdl->subwinX, hdl->subwinY, hdl->subwinWidth, hdl->subwinHeight); + XMoveResizeWindow(hdl->disp, hdl->subwin, hdl->subwinX, hdl->subwinY, hdl->subwinWidth, + hdl->subwinHeight); /* Unmap the window if there are no visibility rects */ if (nr_rects == 0) @@ -382,7 +390,7 @@ int tsmf_window_resize(TSMFGstreamerDecoder* decoder, int x, int y, int width, if (hdl->has_shape) { int i; - XRectangle *xrects = NULL; + XRectangle* xrects = NULL; if (nr_rects == 0) { @@ -396,7 +404,7 @@ int tsmf_window_resize(TSMFGstreamerDecoder* decoder, int x, int y, int width, { xrects = calloc(nr_rects, sizeof(XRectangle)); } - + if (xrects) { for (i = 0; i < nr_rects; i++) @@ -407,7 +415,8 @@ int tsmf_window_resize(TSMFGstreamerDecoder* decoder, int x, int y, int width, xrects[i].height = rects[i].height; } - XShapeCombineRectangles(hdl->disp, hdl->subwin, ShapeBounding, x, y, xrects, nr_rects, ShapeSet, 0); + XShapeCombineRectangles(hdl->disp, hdl->subwin, ShapeBounding, x, y, xrects, + nr_rects, ShapeSet, 0); free(xrects); } } @@ -441,7 +450,7 @@ int tsmf_window_map(TSMFGstreamerDecoder* decoder) if (!decoder) return -1; - hdl = (struct X11Handle*) decoder->platform; + hdl = (struct X11Handle*)decoder->platform; /* Only need to map the window if it is not currently mapped */ if ((hdl->subwin) && (!hdl->subwinMapped)) @@ -462,22 +471,21 @@ int tsmf_window_unmap(TSMFGstreamerDecoder* decoder) if (!decoder) return -1; - hdl = (struct X11Handle*) decoder->platform; + hdl = (struct X11Handle*)decoder->platform; /* only need to unmap window if it is currently mapped */ if ((hdl->subwin) && (hdl->subwinMapped)) { XLockDisplay(hdl->disp); XUnmapWindow(hdl->disp, hdl->subwin); - hdl->subwinMapped = FALSE; - XSync(hdl->disp, FALSE); + hdl->subwinMapped = FALSE; + XSync(hdl->disp, FALSE); XUnlockDisplay(hdl->disp); } return 0; } - int tsmf_window_destroy(TSMFGstreamerDecoder* decoder) { struct X11Handle* hdl; @@ -493,7 +501,7 @@ int tsmf_window_destroy(TSMFGstreamerDecoder* decoder) if (!decoder->platform) return -1; - hdl = (struct X11Handle*) decoder->platform; + hdl = (struct X11Handle*)decoder->platform; if (hdl->subwin) { @@ -512,4 +520,3 @@ int tsmf_window_destroy(TSMFGstreamerDecoder* decoder) hdl->subwinHeight = -1; return 0; } - diff --git a/channels/tsmf/client/gstreamer/tsmf_gstreamer.c b/channels/tsmf/client/gstreamer/tsmf_gstreamer.c index 22f6698fb..64a7b6824 100644 --- a/channels/tsmf/client/gstreamer/tsmf_gstreamer.c +++ b/channels/tsmf/client/gstreamer/tsmf_gstreamer.c @@ -17,7 +17,7 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -54,12 +54,12 @@ #endif /* 1 second = 10,000,000 100ns units*/ -#define SEEK_TOLERANCE 10*1000*1000 +#define SEEK_TOLERANCE 10 * 1000 * 1000 static BOOL tsmf_gstreamer_pipeline_build(TSMFGstreamerDecoder* mdecoder); static void tsmf_gstreamer_clean_up(TSMFGstreamerDecoder* mdecoder); static int tsmf_gstreamer_pipeline_set_state(TSMFGstreamerDecoder* mdecoder, - GstState desired_state); + GstState desired_state); static BOOL tsmf_gstreamer_buffer_level(ITSMFDecoder* decoder); const char* get_type(TSMFGstreamerDecoder* mdecoder) @@ -78,55 +78,59 @@ const char* get_type(TSMFGstreamerDecoder* mdecoder) } } -static void cb_child_added(GstChildProxy *child_proxy, GObject *object, TSMFGstreamerDecoder* mdecoder) +static void cb_child_added(GstChildProxy* child_proxy, GObject* object, + TSMFGstreamerDecoder* mdecoder) { DEBUG_TSMF("NAME: %s", G_OBJECT_TYPE_NAME(object)); - if (!g_strcmp0(G_OBJECT_TYPE_NAME(object), "GstXvImageSink") || !g_strcmp0(G_OBJECT_TYPE_NAME(object), "GstXImageSink") || !g_strcmp0(G_OBJECT_TYPE_NAME(object), "GstFluVAAutoSink")) + if (!g_strcmp0(G_OBJECT_TYPE_NAME(object), "GstXvImageSink") || + !g_strcmp0(G_OBJECT_TYPE_NAME(object), "GstXImageSink") || + !g_strcmp0(G_OBJECT_TYPE_NAME(object), "GstFluVAAutoSink")) { - gst_base_sink_set_max_lateness((GstBaseSink *) object, 10000000); /* nanoseconds */ - g_object_set(G_OBJECT(object), "sync", TRUE, NULL); /* synchronize on the clock */ + gst_base_sink_set_max_lateness((GstBaseSink*)object, 10000000); /* nanoseconds */ + g_object_set(G_OBJECT(object), "sync", TRUE, NULL); /* synchronize on the clock */ g_object_set(G_OBJECT(object), "async", TRUE, NULL); /* no async state changes */ } - else if (!g_strcmp0(G_OBJECT_TYPE_NAME(object), "GstAlsaSink") || !g_strcmp0(G_OBJECT_TYPE_NAME(object), "GstPulseSink")) + else if (!g_strcmp0(G_OBJECT_TYPE_NAME(object), "GstAlsaSink") || + !g_strcmp0(G_OBJECT_TYPE_NAME(object), "GstPulseSink")) { - gst_base_sink_set_max_lateness((GstBaseSink *) object, 10000000); /* nanoseconds */ + gst_base_sink_set_max_lateness((GstBaseSink*)object, 10000000); /* nanoseconds */ g_object_set(G_OBJECT(object), "slave-method", 1, NULL); - g_object_set(G_OBJECT(object), "buffer-time", (gint64) 20000, NULL); /* microseconds */ - g_object_set(G_OBJECT(object), "drift-tolerance", (gint64) 20000, NULL); /* microseconds */ - g_object_set(G_OBJECT(object), "latency-time", (gint64) 10000, NULL); /* microseconds */ - g_object_set(G_OBJECT(object), "sync", TRUE, NULL); /* synchronize on the clock */ + g_object_set(G_OBJECT(object), "buffer-time", (gint64)20000, NULL); /* microseconds */ + g_object_set(G_OBJECT(object), "drift-tolerance", (gint64)20000, NULL); /* microseconds */ + g_object_set(G_OBJECT(object), "latency-time", (gint64)10000, NULL); /* microseconds */ + g_object_set(G_OBJECT(object), "sync", TRUE, NULL); /* synchronize on the clock */ g_object_set(G_OBJECT(object), "async", TRUE, NULL); /* no async state changes */ } } -static void tsmf_gstreamer_enough_data(GstAppSrc *src, gpointer user_data) +static void tsmf_gstreamer_enough_data(GstAppSrc* src, gpointer user_data) { TSMFGstreamerDecoder* mdecoder = user_data; - (void) mdecoder; + (void)mdecoder; DEBUG_TSMF("%s", get_type(mdecoder)); } -static void tsmf_gstreamer_need_data(GstAppSrc *src, guint length, gpointer user_data) +static void tsmf_gstreamer_need_data(GstAppSrc* src, guint length, gpointer user_data) { TSMFGstreamerDecoder* mdecoder = user_data; - (void) mdecoder; + (void)mdecoder; DEBUG_TSMF("%s length=%u", get_type(mdecoder), length); } -static gboolean tsmf_gstreamer_seek_data(GstAppSrc *src, guint64 offset, gpointer user_data) +static gboolean tsmf_gstreamer_seek_data(GstAppSrc* src, guint64 offset, gpointer user_data) { TSMFGstreamerDecoder* mdecoder = user_data; - (void) mdecoder; - DEBUG_TSMF("%s offset=%"PRIu64"", get_type(mdecoder), offset); + (void)mdecoder; + DEBUG_TSMF("%s offset=%" PRIu64 "", get_type(mdecoder), offset); return TRUE; } static BOOL tsmf_gstreamer_change_volume(ITSMFDecoder* decoder, UINT32 newVolume, UINT32 muted) { - TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder *) decoder; + TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder*)decoder; if (!mdecoder || !mdecoder->pipe) return TRUE; @@ -134,9 +138,9 @@ static BOOL tsmf_gstreamer_change_volume(ITSMFDecoder* decoder, UINT32 newVolume if (mdecoder->media_type == TSMF_MAJOR_TYPE_VIDEO) return TRUE; - mdecoder->gstMuted = (BOOL) muted; - DEBUG_TSMF("mute=[%"PRId32"]", mdecoder->gstMuted); - mdecoder->gstVolume = (double) newVolume / (double) 10000; + mdecoder->gstMuted = (BOOL)muted; + DEBUG_TSMF("mute=[%" PRId32 "]", mdecoder->gstMuted); + mdecoder->gstVolume = (double)newVolume / (double)10000; DEBUG_TSMF("gst_new_vol=[%f]", mdecoder->gstVolume); if (!mdecoder->volume) @@ -169,10 +173,11 @@ int tsmf_gstreamer_pipeline_set_state(TSMFGstreamerDecoder* mdecoder, GstState d return 0; if (!mdecoder->pipe) - return 0; /* Just in case this is called during startup or shutdown when we don't expect it */ + return 0; /* Just in case this is called during startup or shutdown when we don't expect it + */ if (desired_state == mdecoder->state) - return 0; /* Redundant request - Nothing to do */ + return 0; /* Redundant request - Nothing to do */ name = gst_element_state_get_name(desired_state); /* For debug */ DEBUG_TSMF("%s to %s", sname, name); @@ -210,7 +215,7 @@ static GstBuffer* tsmf_get_buffer_from_data(const void* raw_data, gsize size) if (!data) { - WLog_ERR(TAG, "Could not allocate %"G_GSIZE_FORMAT" bytes of data.", size); + WLog_ERR(TAG, "Could not allocate %" G_GSIZE_FORMAT " bytes of data.", size); return NULL; } @@ -238,7 +243,7 @@ static GstBuffer* tsmf_get_buffer_from_data(const void* raw_data, gsize size) static BOOL tsmf_gstreamer_set_format(ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* media_type) { - TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder*) decoder; + TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder*)decoder; if (!mdecoder) return FALSE; @@ -260,175 +265,153 @@ static BOOL tsmf_gstreamer_set_format(ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* m switch (media_type->SubType) { case TSMF_SUB_TYPE_WVC1: - mdecoder->gst_caps = gst_caps_new_simple("video/x-wmv", - "bitrate", G_TYPE_UINT, media_type->BitRate, - "width", G_TYPE_INT, media_type->Width, - "height", G_TYPE_INT, media_type->Height, - "wmvversion", G_TYPE_INT, 3, + mdecoder->gst_caps = gst_caps_new_simple( + "video/x-wmv", "bitrate", G_TYPE_UINT, media_type->BitRate, "width", G_TYPE_INT, + media_type->Width, "height", G_TYPE_INT, media_type->Height, "wmvversion", + G_TYPE_INT, 3, #if GST_VERSION_MAJOR > 0 - "format", G_TYPE_STRING, "WVC1", + "format", G_TYPE_STRING, "WVC1", #else - "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('W', 'V', 'C', '1'), + "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC('W', 'V', 'C', '1'), #endif - "framerate", GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, media_type->SamplesPerSecond.Denominator, - "pixel-aspect-ratio", GST_TYPE_FRACTION, 1 , 1, - NULL); + "framerate", GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, + media_type->SamplesPerSecond.Denominator, "pixel-aspect-ratio", GST_TYPE_FRACTION, + 1, 1, NULL); break; case TSMF_SUB_TYPE_MP4S: - mdecoder->gst_caps = gst_caps_new_simple("video/x-divx", - "divxversion", G_TYPE_INT, 5, - "bitrate", G_TYPE_UINT, media_type->BitRate, - "width", G_TYPE_INT, media_type->Width, - "height", G_TYPE_INT, media_type->Height, + mdecoder->gst_caps = gst_caps_new_simple( + "video/x-divx", "divxversion", G_TYPE_INT, 5, "bitrate", G_TYPE_UINT, + media_type->BitRate, "width", G_TYPE_INT, media_type->Width, "height", G_TYPE_INT, + media_type->Height, #if GST_VERSION_MAJOR > 0 - "format", G_TYPE_STRING, "MP42", -#else - "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('M', 'P', '4', '2'), + "format", G_TYPE_STRING, "MP42", +#else + "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC('M', 'P', '4', '2'), #endif - "framerate", GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, media_type->SamplesPerSecond.Denominator, - NULL); + "framerate", GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, + media_type->SamplesPerSecond.Denominator, NULL); break; case TSMF_SUB_TYPE_MP42: - mdecoder->gst_caps = gst_caps_new_simple("video/x-msmpeg", - "msmpegversion", G_TYPE_INT, 42, - "bitrate", G_TYPE_UINT, media_type->BitRate, - "width", G_TYPE_INT, media_type->Width, - "height", G_TYPE_INT, media_type->Height, -#if GST_VERSION_MAJOR > 0 - "format", G_TYPE_STRING, "MP42", + mdecoder->gst_caps = gst_caps_new_simple( + "video/x-msmpeg", "msmpegversion", G_TYPE_INT, 42, "bitrate", G_TYPE_UINT, + media_type->BitRate, "width", G_TYPE_INT, media_type->Width, "height", G_TYPE_INT, + media_type->Height, +#if GST_VERSION_MAJOR > 0 + "format", G_TYPE_STRING, "MP42", #else - "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('M', 'P', '4', '2'), + "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC('M', 'P', '4', '2'), #endif - "framerate", GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, media_type->SamplesPerSecond.Denominator, - NULL); + "framerate", GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, + media_type->SamplesPerSecond.Denominator, NULL); break; case TSMF_SUB_TYPE_MP43: - mdecoder->gst_caps = gst_caps_new_simple("video/x-msmpeg", - "msmpegversion", G_TYPE_INT, 43, - "bitrate", G_TYPE_UINT, media_type->BitRate, - "width", G_TYPE_INT, media_type->Width, - "height", G_TYPE_INT, media_type->Height, -#if GST_VERSION_MAJOR > 0 - "format", G_TYPE_STRING, "MP43", -#else - "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('M', 'P', '4', '3'), + mdecoder->gst_caps = gst_caps_new_simple( + "video/x-msmpeg", "msmpegversion", G_TYPE_INT, 43, "bitrate", G_TYPE_UINT, + media_type->BitRate, "width", G_TYPE_INT, media_type->Width, "height", G_TYPE_INT, + media_type->Height, +#if GST_VERSION_MAJOR > 0 + "format", G_TYPE_STRING, "MP43", +#else + "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC('M', 'P', '4', '3'), #endif - "framerate", GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, media_type->SamplesPerSecond.Denominator, - NULL); + "framerate", GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, + media_type->SamplesPerSecond.Denominator, NULL); break; case TSMF_SUB_TYPE_M4S2: - mdecoder->gst_caps = gst_caps_new_simple ("video/mpeg", - "mpegversion", G_TYPE_INT, 4, - "width", G_TYPE_INT, media_type->Width, - "height", G_TYPE_INT, media_type->Height, -#if GST_VERSION_MAJOR > 0 - "format", G_TYPE_STRING, "M4S2", -#else - "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('M', '4', 'S', '2'), + mdecoder->gst_caps = gst_caps_new_simple( + "video/mpeg", "mpegversion", G_TYPE_INT, 4, "width", G_TYPE_INT, media_type->Width, + "height", G_TYPE_INT, media_type->Height, +#if GST_VERSION_MAJOR > 0 + "format", G_TYPE_STRING, "M4S2", +#else + "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC('M', '4', 'S', '2'), #endif - "framerate", GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, media_type->SamplesPerSecond.Denominator, - NULL); + "framerate", GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, + media_type->SamplesPerSecond.Denominator, NULL); break; case TSMF_SUB_TYPE_WMA9: - mdecoder->gst_caps = gst_caps_new_simple("audio/x-wma", - "wmaversion", G_TYPE_INT, 3, - "rate", G_TYPE_INT, media_type->SamplesPerSecond.Numerator, - "channels", G_TYPE_INT, media_type->Channels, - "bitrate", G_TYPE_INT, media_type->BitRate, - "depth", G_TYPE_INT, media_type->BitsPerSample, - "width", G_TYPE_INT, media_type->BitsPerSample, - "block_align", G_TYPE_INT, media_type->BlockAlign, - NULL); + mdecoder->gst_caps = gst_caps_new_simple( + "audio/x-wma", "wmaversion", G_TYPE_INT, 3, "rate", G_TYPE_INT, + media_type->SamplesPerSecond.Numerator, "channels", G_TYPE_INT, + media_type->Channels, "bitrate", G_TYPE_INT, media_type->BitRate, "depth", + G_TYPE_INT, media_type->BitsPerSample, "width", G_TYPE_INT, + media_type->BitsPerSample, "block_align", G_TYPE_INT, media_type->BlockAlign, NULL); break; case TSMF_SUB_TYPE_WMA1: - mdecoder->gst_caps = gst_caps_new_simple ("audio/x-wma", - "wmaversion", G_TYPE_INT, 1, - "rate", G_TYPE_INT, media_type->SamplesPerSecond.Numerator, - "channels", G_TYPE_INT, media_type->Channels, - "bitrate", G_TYPE_INT, media_type->BitRate, - "depth", G_TYPE_INT, media_type->BitsPerSample, - "width", G_TYPE_INT, media_type->BitsPerSample, - "block_align", G_TYPE_INT, media_type->BlockAlign, - NULL); + mdecoder->gst_caps = gst_caps_new_simple( + "audio/x-wma", "wmaversion", G_TYPE_INT, 1, "rate", G_TYPE_INT, + media_type->SamplesPerSecond.Numerator, "channels", G_TYPE_INT, + media_type->Channels, "bitrate", G_TYPE_INT, media_type->BitRate, "depth", + G_TYPE_INT, media_type->BitsPerSample, "width", G_TYPE_INT, + media_type->BitsPerSample, "block_align", G_TYPE_INT, media_type->BlockAlign, NULL); break; case TSMF_SUB_TYPE_WMA2: - mdecoder->gst_caps = gst_caps_new_simple("audio/x-wma", - "wmaversion", G_TYPE_INT, 2, - "rate", G_TYPE_INT, media_type->SamplesPerSecond.Numerator, - "channels", G_TYPE_INT, media_type->Channels, - "bitrate", G_TYPE_INT, media_type->BitRate, - "depth", G_TYPE_INT, media_type->BitsPerSample, - "width", G_TYPE_INT, media_type->BitsPerSample, - "block_align", G_TYPE_INT, media_type->BlockAlign, - NULL); + mdecoder->gst_caps = gst_caps_new_simple( + "audio/x-wma", "wmaversion", G_TYPE_INT, 2, "rate", G_TYPE_INT, + media_type->SamplesPerSecond.Numerator, "channels", G_TYPE_INT, + media_type->Channels, "bitrate", G_TYPE_INT, media_type->BitRate, "depth", + G_TYPE_INT, media_type->BitsPerSample, "width", G_TYPE_INT, + media_type->BitsPerSample, "block_align", G_TYPE_INT, media_type->BlockAlign, NULL); break; case TSMF_SUB_TYPE_MP3: - mdecoder->gst_caps = gst_caps_new_simple("audio/mpeg", - "mpegversion", G_TYPE_INT, 1, - "layer", G_TYPE_INT, 3, - "rate", G_TYPE_INT, media_type->SamplesPerSecond.Numerator, - "channels", G_TYPE_INT, media_type->Channels, - NULL); + mdecoder->gst_caps = + gst_caps_new_simple("audio/mpeg", "mpegversion", G_TYPE_INT, 1, "layer", G_TYPE_INT, + 3, "rate", G_TYPE_INT, media_type->SamplesPerSecond.Numerator, + "channels", G_TYPE_INT, media_type->Channels, NULL); break; case TSMF_SUB_TYPE_WMV1: - mdecoder->gst_caps = gst_caps_new_simple("video/x-wmv", - "bitrate", G_TYPE_UINT, media_type->BitRate, - "width", G_TYPE_INT, media_type->Width, - "height", G_TYPE_INT, media_type->Height, - "wmvversion", G_TYPE_INT, 1, -#if GST_VERSION_MAJOR > 0 - "format", G_TYPE_STRING, "WMV1", -#else - "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('W', 'M', 'V', '1'), + mdecoder->gst_caps = gst_caps_new_simple( + "video/x-wmv", "bitrate", G_TYPE_UINT, media_type->BitRate, "width", G_TYPE_INT, + media_type->Width, "height", G_TYPE_INT, media_type->Height, "wmvversion", + G_TYPE_INT, 1, +#if GST_VERSION_MAJOR > 0 + "format", G_TYPE_STRING, "WMV1", +#else + "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC('W', 'M', 'V', '1'), #endif - "framerate", GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, media_type->SamplesPerSecond.Denominator, - NULL); + "framerate", GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, + media_type->SamplesPerSecond.Denominator, NULL); break; case TSMF_SUB_TYPE_WMV2: - mdecoder->gst_caps = gst_caps_new_simple("video/x-wmv", - "width", G_TYPE_INT, media_type->Width, - "height", G_TYPE_INT, media_type->Height, - "wmvversion", G_TYPE_INT, 2, -#if GST_VERSION_MAJOR > 0 - "format", G_TYPE_STRING, "WMV2", + mdecoder->gst_caps = gst_caps_new_simple( + "video/x-wmv", "width", G_TYPE_INT, media_type->Width, "height", G_TYPE_INT, + media_type->Height, "wmvversion", G_TYPE_INT, 2, +#if GST_VERSION_MAJOR > 0 + "format", G_TYPE_STRING, "WMV2", #else - "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('W', 'M', 'V', '2'), + "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC('W', 'M', 'V', '2'), #endif - "framerate", GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, media_type->SamplesPerSecond.Denominator, - "pixel-aspect-ratio", GST_TYPE_FRACTION, 1 , 1, - NULL); + "framerate", GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, + media_type->SamplesPerSecond.Denominator, "pixel-aspect-ratio", GST_TYPE_FRACTION, + 1, 1, NULL); break; case TSMF_SUB_TYPE_WMV3: - mdecoder->gst_caps = gst_caps_new_simple("video/x-wmv", - "bitrate", G_TYPE_UINT, media_type->BitRate, - "width", G_TYPE_INT, media_type->Width, - "height", G_TYPE_INT, media_type->Height, - "wmvversion", G_TYPE_INT, 3, -#if GST_VERSION_MAJOR > 0 - "format", G_TYPE_STRING, "WMV3", + mdecoder->gst_caps = gst_caps_new_simple( + "video/x-wmv", "bitrate", G_TYPE_UINT, media_type->BitRate, "width", G_TYPE_INT, + media_type->Width, "height", G_TYPE_INT, media_type->Height, "wmvversion", + G_TYPE_INT, 3, +#if GST_VERSION_MAJOR > 0 + "format", G_TYPE_STRING, "WMV3", #else - "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('W', 'M', 'V', '3'), + "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC('W', 'M', 'V', '3'), #endif - "framerate", GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, media_type->SamplesPerSecond.Denominator, - "pixel-aspect-ratio", GST_TYPE_FRACTION, 1 , 1, - NULL); + "framerate", GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, + media_type->SamplesPerSecond.Denominator, "pixel-aspect-ratio", GST_TYPE_FRACTION, + 1, 1, NULL); break; case TSMF_SUB_TYPE_AVC1: case TSMF_SUB_TYPE_H264: - mdecoder->gst_caps = gst_caps_new_simple("video/x-h264", - "width", G_TYPE_INT, media_type->Width, - "height", G_TYPE_INT, media_type->Height, - "framerate", GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, media_type->SamplesPerSecond.Denominator, - "pixel-aspect-ratio", GST_TYPE_FRACTION, 1 , 1, - "stream-format", G_TYPE_STRING, "byte-stream", - "alignment", G_TYPE_STRING, "nal", - NULL); + mdecoder->gst_caps = gst_caps_new_simple( + "video/x-h264", "width", G_TYPE_INT, media_type->Width, "height", G_TYPE_INT, + media_type->Height, "framerate", GST_TYPE_FRACTION, + media_type->SamplesPerSecond.Numerator, media_type->SamplesPerSecond.Denominator, + "pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1, "stream-format", G_TYPE_STRING, + "byte-stream", "alignment", G_TYPE_STRING, "nal", NULL); break; case TSMF_SUB_TYPE_AC3: - mdecoder->gst_caps = gst_caps_new_simple("audio/x-ac3", - "rate", G_TYPE_INT, media_type->SamplesPerSecond.Numerator, - "channels", G_TYPE_INT, media_type->Channels, - NULL); + mdecoder->gst_caps = gst_caps_new_simple( + "audio/x-ac3", "rate", G_TYPE_INT, media_type->SamplesPerSecond.Numerator, + "channels", G_TYPE_INT, media_type->Channels, NULL); break; case TSMF_SUB_TYPE_AAC: @@ -441,59 +424,47 @@ static BOOL tsmf_gstreamer_set_format(ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* m media_type->ExtraDataSize -= 12; } - mdecoder->gst_caps = gst_caps_new_simple("audio/mpeg", - "rate", G_TYPE_INT, media_type->SamplesPerSecond.Numerator, - "channels", G_TYPE_INT, media_type->Channels, - "mpegversion", G_TYPE_INT, 4, - "framed", G_TYPE_BOOLEAN, TRUE, - "stream-format", G_TYPE_STRING, "raw", - NULL); + mdecoder->gst_caps = gst_caps_new_simple( + "audio/mpeg", "rate", G_TYPE_INT, media_type->SamplesPerSecond.Numerator, + "channels", G_TYPE_INT, media_type->Channels, "mpegversion", G_TYPE_INT, 4, + "framed", G_TYPE_BOOLEAN, TRUE, "stream-format", G_TYPE_STRING, "raw", NULL); break; case TSMF_SUB_TYPE_MP1A: - mdecoder->gst_caps = gst_caps_new_simple("audio/mpeg", - "mpegversion", G_TYPE_INT, 1, - "channels", G_TYPE_INT, media_type->Channels, - NULL); + mdecoder->gst_caps = + gst_caps_new_simple("audio/mpeg", "mpegversion", G_TYPE_INT, 1, "channels", + G_TYPE_INT, media_type->Channels, NULL); break; case TSMF_SUB_TYPE_MP1V: - mdecoder->gst_caps = gst_caps_new_simple("video/mpeg", - "mpegversion", G_TYPE_INT, 1, - "width", G_TYPE_INT, media_type->Width, - "height", G_TYPE_INT, media_type->Height, - "systemstream", G_TYPE_BOOLEAN, FALSE, - NULL); + mdecoder->gst_caps = + gst_caps_new_simple("video/mpeg", "mpegversion", G_TYPE_INT, 1, "width", G_TYPE_INT, + media_type->Width, "height", G_TYPE_INT, media_type->Height, + "systemstream", G_TYPE_BOOLEAN, FALSE, NULL); break; case TSMF_SUB_TYPE_YUY2: #if GST_VERSION_MAJOR > 0 - mdecoder->gst_caps = gst_caps_new_simple("video/x-raw", - "format", G_TYPE_STRING, "YUY2", - "width", G_TYPE_INT, media_type->Width, - "height", G_TYPE_INT, media_type->Height, - NULL); + mdecoder->gst_caps = gst_caps_new_simple( + "video/x-raw", "format", G_TYPE_STRING, "YUY2", "width", G_TYPE_INT, + media_type->Width, "height", G_TYPE_INT, media_type->Height, NULL); #else - mdecoder->gst_caps = gst_caps_new_simple("video/x-raw-yuv", - "format", G_TYPE_STRING, "YUY2", - "width", G_TYPE_INT, media_type->Width, - "height", G_TYPE_INT, media_type->Height, - "framerate", GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, media_type->SamplesPerSecond.Denominator, - NULL); + mdecoder->gst_caps = gst_caps_new_simple( + "video/x-raw-yuv", "format", G_TYPE_STRING, "YUY2", "width", G_TYPE_INT, + media_type->Width, "height", G_TYPE_INT, media_type->Height, "framerate", + GST_TYPE_FRACTION, media_type->SamplesPerSecond.Numerator, + media_type->SamplesPerSecond.Denominator, NULL); #endif break; case TSMF_SUB_TYPE_MP2V: - mdecoder->gst_caps = gst_caps_new_simple("video/mpeg", - "mpegversion", G_TYPE_INT, 2, - "systemstream", G_TYPE_BOOLEAN, FALSE, - NULL); + mdecoder->gst_caps = gst_caps_new_simple("video/mpeg", "mpegversion", G_TYPE_INT, 2, + "systemstream", G_TYPE_BOOLEAN, FALSE, NULL); break; case TSMF_SUB_TYPE_MP2A: - mdecoder->gst_caps = gst_caps_new_simple("audio/mpeg", - "mpegversion", G_TYPE_INT, 1, - "rate", G_TYPE_INT, media_type->SamplesPerSecond.Numerator, - "channels", G_TYPE_INT, media_type->Channels, - NULL); + mdecoder->gst_caps = + gst_caps_new_simple("audio/mpeg", "mpegversion", G_TYPE_INT, 1, "rate", G_TYPE_INT, + media_type->SamplesPerSecond.Numerator, "channels", G_TYPE_INT, + media_type->Channels, NULL); break; case TSMF_SUB_TYPE_FLAC: - mdecoder->gst_caps = gst_caps_new_simple("audio/x-flac", "", NULL); + mdecoder->gst_caps = gst_caps_new_simple("audio/x-flac", "", NULL); break; default: WLog_ERR(TAG, "unknown format:(%d).", media_type->SubType); @@ -502,8 +473,8 @@ static BOOL tsmf_gstreamer_set_format(ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* m if (media_type->ExtraDataSize > 0) { - GstBuffer *buffer; - DEBUG_TSMF("Extra data available (%"PRIu32")", media_type->ExtraDataSize); + GstBuffer* buffer; + DEBUG_TSMF("Extra data available (%" PRIu32 ")", media_type->ExtraDataSize); buffer = tsmf_get_buffer_from_data(media_type->ExtraData, media_type->ExtraDataSize); if (!buffer) @@ -515,7 +486,7 @@ static BOOL tsmf_gstreamer_set_format(ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* m gst_caps_set_simple(mdecoder->gst_caps, "codec_data", GST_TYPE_BUFFER, buffer, NULL); } - DEBUG_TSMF("%p format '%s'", (void*) mdecoder, gst_caps_to_string(mdecoder->gst_caps)); + DEBUG_TSMF("%p format '%s'", (void*)mdecoder, gst_caps_to_string(mdecoder->gst_caps)); tsmf_platform_set_format(mdecoder); /* Create the pipeline... */ @@ -547,11 +518,17 @@ void tsmf_gstreamer_clean_up(TSMFGstreamerDecoder* mdecoder) BOOL tsmf_gstreamer_pipeline_build(TSMFGstreamerDecoder* mdecoder) { #if GST_VERSION_MAJOR > 0 - const char* video = "appsrc name=videosource ! queue2 name=videoqueue ! decodebin name=videodecoder !"; - const char* audio = "appsrc name=audiosource ! queue2 name=audioqueue ! decodebin name=audiodecoder ! audioconvert ! audiorate ! audioresample ! volume name=audiovolume !"; + const char* video = + "appsrc name=videosource ! queue2 name=videoqueue ! decodebin name=videodecoder !"; + const char* audio = + "appsrc name=audiosource ! queue2 name=audioqueue ! decodebin name=audiodecoder ! " + "audioconvert ! audiorate ! audioresample ! volume name=audiovolume !"; #else - const char* video = "appsrc name=videosource ! queue2 name=videoqueue ! decodebin2 name=videodecoder !"; - const char* audio = "appsrc name=audiosource ! queue2 name=audioqueue ! decodebin2 name=audiodecoder ! audioconvert ! audiorate ! audioresample ! volume name=audiovolume !"; + const char* video = + "appsrc name=videosource ! queue2 name=videoqueue ! decodebin2 name=videodecoder !"; + const char* audio = + "appsrc name=audiosource ! queue2 name=audioqueue ! decodebin2 name=audiodecoder ! " + "audioconvert ! audiorate ! audioresample ! volume name=audiovolume !"; #endif char pipeline[1024]; @@ -562,9 +539,11 @@ BOOL tsmf_gstreamer_pipeline_build(TSMFGstreamerDecoder* mdecoder) * The only fixed elements necessary are appsrc and the volume element for audio streams. * The rest could easily be provided in gstreamer pipeline notation from command line. */ if (mdecoder->media_type == TSMF_MAJOR_TYPE_VIDEO) - sprintf_s(pipeline, sizeof(pipeline), "%s %s name=videosink", video, tsmf_platform_get_video_sink()); + sprintf_s(pipeline, sizeof(pipeline), "%s %s name=videosink", video, + tsmf_platform_get_video_sink()); else - sprintf_s(pipeline, sizeof(pipeline), "%s %s name=audiosink", audio, tsmf_platform_get_audio_sink()); + sprintf_s(pipeline, sizeof(pipeline), "%s %s name=audiosink", audio, + tsmf_platform_get_audio_sink()); DEBUG_TSMF("pipeline=%s", pipeline); mdecoder->pipe = gst_parse_launch(pipeline, NULL); @@ -620,49 +599,54 @@ BOOL tsmf_gstreamer_pipeline_build(TSMFGstreamerDecoder* mdecoder) return FALSE; } - tsmf_gstreamer_change_volume((ITSMFDecoder*)mdecoder, mdecoder->gstVolume*((double) 10000), mdecoder->gstMuted); + tsmf_gstreamer_change_volume((ITSMFDecoder*)mdecoder, mdecoder->gstVolume * ((double)10000), + mdecoder->gstMuted); } tsmf_platform_register_handler(mdecoder); /* AppSrc settings */ - GstAppSrcCallbacks callbacks = - { - tsmf_gstreamer_need_data, - tsmf_gstreamer_enough_data, - tsmf_gstreamer_seek_data, - { NULL } + GstAppSrcCallbacks callbacks = { + tsmf_gstreamer_need_data, tsmf_gstreamer_enough_data, tsmf_gstreamer_seek_data, { NULL } }; g_object_set(mdecoder->src, "format", GST_FORMAT_TIME, NULL); g_object_set(mdecoder->src, "is-live", FALSE, NULL); g_object_set(mdecoder->src, "block", FALSE, NULL); g_object_set(mdecoder->src, "blocksize", 1024, NULL); - gst_app_src_set_caps((GstAppSrc *) mdecoder->src, mdecoder->gst_caps); - gst_app_src_set_callbacks((GstAppSrc *)mdecoder->src, &callbacks, mdecoder, NULL); - gst_app_src_set_stream_type((GstAppSrc *) mdecoder->src, GST_APP_STREAM_TYPE_SEEKABLE); - gst_app_src_set_latency((GstAppSrc *) mdecoder->src, 0, -1); - gst_app_src_set_max_bytes((GstAppSrc *) mdecoder->src, (guint64) 0);//unlimited + gst_app_src_set_caps((GstAppSrc*)mdecoder->src, mdecoder->gst_caps); + gst_app_src_set_callbacks((GstAppSrc*)mdecoder->src, &callbacks, mdecoder, NULL); + gst_app_src_set_stream_type((GstAppSrc*)mdecoder->src, GST_APP_STREAM_TYPE_SEEKABLE); + gst_app_src_set_latency((GstAppSrc*)mdecoder->src, 0, -1); + gst_app_src_set_max_bytes((GstAppSrc*)mdecoder->src, (guint64)0); // unlimited g_object_set(G_OBJECT(mdecoder->queue), "use-buffering", FALSE, NULL); g_object_set(G_OBJECT(mdecoder->queue), "use-rate-estimate", FALSE, NULL); g_object_set(G_OBJECT(mdecoder->queue), "max-size-buffers", 0, NULL); g_object_set(G_OBJECT(mdecoder->queue), "max-size-bytes", 0, NULL); - g_object_set(G_OBJECT(mdecoder->queue), "max-size-time", (guint64) 0, NULL); + g_object_set(G_OBJECT(mdecoder->queue), "max-size-time", (guint64)0, NULL); - /* Only set these properties if not an autosink, otherwise we will set properties when real sinks are added */ - if (!g_strcmp0(G_OBJECT_TYPE_NAME(mdecoder->outsink), "GstAutoVideoSink") && !g_strcmp0(G_OBJECT_TYPE_NAME(mdecoder->outsink), "GstAutoAudioSink")) + /* Only set these properties if not an autosink, otherwise we will set properties when real + * sinks are added */ + if (!g_strcmp0(G_OBJECT_TYPE_NAME(mdecoder->outsink), "GstAutoVideoSink") && + !g_strcmp0(G_OBJECT_TYPE_NAME(mdecoder->outsink), "GstAutoAudioSink")) { if (mdecoder->media_type == TSMF_MAJOR_TYPE_VIDEO) { - gst_base_sink_set_max_lateness((GstBaseSink *) mdecoder->outsink, 10000000); /* nanoseconds */ + gst_base_sink_set_max_lateness((GstBaseSink*)mdecoder->outsink, + 10000000); /* nanoseconds */ } else { - gst_base_sink_set_max_lateness((GstBaseSink *) mdecoder->outsink, 10000000); /* nanoseconds */ - g_object_set(G_OBJECT(mdecoder->outsink), "buffer-time", (gint64) 20000, NULL); /* microseconds */ - g_object_set(G_OBJECT(mdecoder->outsink), "drift-tolerance", (gint64) 20000, NULL); /* microseconds */ - g_object_set(G_OBJECT(mdecoder->outsink), "latency-time", (gint64) 10000, NULL); /* microseconds */ + gst_base_sink_set_max_lateness((GstBaseSink*)mdecoder->outsink, + 10000000); /* nanoseconds */ + g_object_set(G_OBJECT(mdecoder->outsink), "buffer-time", (gint64)20000, + NULL); /* microseconds */ + g_object_set(G_OBJECT(mdecoder->outsink), "drift-tolerance", (gint64)20000, + NULL); /* microseconds */ + g_object_set(G_OBJECT(mdecoder->outsink), "latency-time", (gint64)10000, + NULL); /* microseconds */ g_object_set(G_OBJECT(mdecoder->outsink), "slave-method", 1, NULL); } - g_object_set(G_OBJECT(mdecoder->outsink), "sync", TRUE, NULL); /* synchronize on the clock */ + g_object_set(G_OBJECT(mdecoder->outsink), "sync", TRUE, + NULL); /* synchronize on the clock */ g_object_set(G_OBJECT(mdecoder->outsink), "async", TRUE, NULL); /* no async state changes */ } @@ -673,16 +657,18 @@ BOOL tsmf_gstreamer_pipeline_build(TSMFGstreamerDecoder* mdecoder) mdecoder->shutdown = 0; mdecoder->paused = FALSE; - GST_DEBUG_BIN_TO_DOT_FILE(GST_BIN(mdecoder->pipe), GST_DEBUG_GRAPH_SHOW_ALL, get_type(mdecoder)); + GST_DEBUG_BIN_TO_DOT_FILE(GST_BIN(mdecoder->pipe), GST_DEBUG_GRAPH_SHOW_ALL, + get_type(mdecoder)); return TRUE; } -static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder* decoder, const BYTE *data, UINT32 data_size, UINT32 extensions, - UINT64 start_time, UINT64 end_time, UINT64 duration) +static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder* decoder, const BYTE* data, UINT32 data_size, + UINT32 extensions, UINT64 start_time, UINT64 end_time, + UINT64 duration) { - GstBuffer *gst_buf; - TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder *) decoder; + GstBuffer* gst_buf; + TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder*)decoder; UINT64 sample_time = tsmf_gstreamer_timestamp_ms_to_gst(start_time); BOOL useTimestamps = TRUE; @@ -698,9 +684,9 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder* decoder, const BYTE *data, UIN * We don't expect to block here often, since the pipeline should * have more than enough buffering. */ - DEBUG_TSMF("%s. Start:(%"PRIu64") End:(%"PRIu64") Duration:(%"PRIu64") Last Start:(%"PRIu64")", - get_type(mdecoder), start_time, end_time, duration, - mdecoder->last_sample_start_time); + DEBUG_TSMF( + "%s. Start:(%" PRIu64 ") End:(%" PRIu64 ") Duration:(%" PRIu64 ") Last Start:(%" PRIu64 ")", + get_type(mdecoder), start_time, end_time, duration, mdecoder->last_sample_start_time); if (mdecoder->shutdown) { @@ -719,7 +705,9 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder* decoder, const BYTE *data, UIN if (!mdecoder->src) { - WLog_ERR(TAG, "failed to construct pipeline correctly. Unable to push buffer to source element."); + WLog_ERR( + TAG, + "failed to construct pipeline correctly. Unable to push buffer to source element."); return FALSE; } @@ -727,7 +715,7 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder* decoder, const BYTE *data, UIN if (gst_buf == NULL) { - WLog_ERR(TAG, "tsmf_get_buffer_from_data(%p, %"PRIu32") failed.", (void*) data, data_size); + WLog_ERR(TAG, "tsmf_get_buffer_from_data(%p, %" PRIu32 ") failed.", (void*)data, data_size); return FALSE; } @@ -752,46 +740,54 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder* decoder, const BYTE *data, UIN { mdecoder->seeking = FALSE; tsmf_gstreamer_pipeline_set_state(mdecoder, GST_STATE_PAUSED); - mdecoder->pipeline_start_time_valid = 0; + mdecoder->pipeline_start_time_valid = 0; } if (mdecoder->pipeline_start_time_valid) { - DEBUG_TSMF("%s start time %"PRIu64"", get_type(mdecoder), start_time); + DEBUG_TSMF("%s start time %" PRIu64 "", get_type(mdecoder), start_time); /* Adjusted the condition for a seek to be based on start time only * WMV1 and WMV2 files in particular have bad end time and duration values * there seems to be no real side effects of just using the start time instead */ - UINT64 minTime = mdecoder->last_sample_start_time - (UINT64) SEEK_TOLERANCE; - UINT64 maxTime = mdecoder->last_sample_start_time + (UINT64) SEEK_TOLERANCE; + UINT64 minTime = mdecoder->last_sample_start_time - (UINT64)SEEK_TOLERANCE; + UINT64 maxTime = mdecoder->last_sample_start_time + (UINT64)SEEK_TOLERANCE; - /* Make sure the minTime stops at 0 , should we be at the beginning of the stream */ - if (mdecoder->last_sample_start_time < (UINT64) SEEK_TOLERANCE) - minTime = 0; + /* Make sure the minTime stops at 0 , should we be at the beginning of the stream */ + if (mdecoder->last_sample_start_time < (UINT64)SEEK_TOLERANCE) + minTime = 0; - /* If the start_time is valid and different from the previous start time by more than the seek tolerance, then we have a seek condition */ + /* If the start_time is valid and different from the previous start time by more than the + * seek tolerance, then we have a seek condition */ if (((start_time > maxTime) || (start_time < minTime)) && useTimestamps) { - DEBUG_TSMF("tsmf_gstreamer_decodeEx: start_time=[%"PRIu64"] > last_sample_start_time=[%"PRIu64"] OR ", start_time, mdecoder->last_sample_start_time); - DEBUG_TSMF("tsmf_gstreamer_decodeEx: start_time=[%"PRIu64"] < last_sample_start_time=[%"PRIu64"] with", start_time, mdecoder->last_sample_start_time); - DEBUG_TSMF("tsmf_gstreamer_decodeEX: a tolerance of more than [%lu] from the last sample", SEEK_TOLERANCE); - DEBUG_TSMF("tsmf_gstreamer_decodeEX: minTime=[%"PRIu64"] maxTime=[%"PRIu64"]", minTime, maxTime); + DEBUG_TSMF("tsmf_gstreamer_decodeEx: start_time=[%" PRIu64 + "] > last_sample_start_time=[%" PRIu64 "] OR ", + start_time, mdecoder->last_sample_start_time); + DEBUG_TSMF("tsmf_gstreamer_decodeEx: start_time=[%" PRIu64 + "] < last_sample_start_time=[%" PRIu64 "] with", + start_time, mdecoder->last_sample_start_time); + DEBUG_TSMF( + "tsmf_gstreamer_decodeEX: a tolerance of more than [%lu] from the last sample", + SEEK_TOLERANCE); + DEBUG_TSMF("tsmf_gstreamer_decodeEX: minTime=[%" PRIu64 "] maxTime=[%" PRIu64 "]", + minTime, maxTime); mdecoder->seeking = TRUE; - /* since we cant make the gstreamer pipeline jump to the new start time after a seek - we just maintain - * a offset between realtime and gstreamer time + /* since we cant make the gstreamer pipeline jump to the new start time after a seek - + * we just maintain a offset between realtime and gstreamer time */ mdecoder->seek_offset = start_time; } } else { - DEBUG_TSMF("%s start time %"PRIu64"", get_type(mdecoder), start_time); + DEBUG_TSMF("%s start time %" PRIu64 "", get_type(mdecoder), start_time); /* Always set base/start time to 0. Will use seek offset to translate real buffer times - * back to 0. This allows the video to be started from anywhere and the ability to handle seeks - * without rebuilding the pipeline, etc. since that is costly + * back to 0. This allows the video to be started from anywhere and the ability to handle + * seeks without rebuilding the pipeline, etc. since that is costly */ gst_element_set_base_time(mdecoder->pipe, tsmf_gstreamer_timestamp_ms_to_gst(0)); gst_element_set_start_time(mdecoder->pipe, tsmf_gstreamer_timestamp_ms_to_gst(0)); @@ -802,8 +798,7 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder* decoder, const BYTE *data, UIN mdecoder->seek_offset = start_time; if (!gst_element_seek(mdecoder->pipe, 1.0, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, - GST_SEEK_TYPE_SET, 0, - GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE)) + GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE)) { WLog_ERR(TAG, "seek failed"); } @@ -811,12 +806,14 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder* decoder, const BYTE *data, UIN #if GST_VERSION_MAJOR > 0 if (useTimestamps) - GST_BUFFER_PTS(gst_buf) = sample_time - tsmf_gstreamer_timestamp_ms_to_gst(mdecoder->seek_offset); + GST_BUFFER_PTS(gst_buf) = + sample_time - tsmf_gstreamer_timestamp_ms_to_gst(mdecoder->seek_offset); else GST_BUFFER_PTS(gst_buf) = GST_CLOCK_TIME_NONE; #else if (useTimestamps) - GST_BUFFER_TIMESTAMP(gst_buf) = sample_time - tsmf_gstreamer_timestamp_ms_to_gst(mdecoder->seek_offset); + GST_BUFFER_TIMESTAMP(gst_buf) = + sample_time - tsmf_gstreamer_timestamp_ms_to_gst(mdecoder->seek_offset); else GST_BUFFER_TIMESTAMP(gst_buf) = GST_CLOCK_TIME_NONE; #endif @@ -837,9 +834,11 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder* decoder, const BYTE *data, UIN if (mdecoder->pipe && (GST_STATE(mdecoder->pipe) != GST_STATE_PLAYING)) { - DEBUG_TSMF("%s: state=%s", get_type(mdecoder), gst_element_state_get_name(GST_STATE(mdecoder->pipe))); + DEBUG_TSMF("%s: state=%s", get_type(mdecoder), + gst_element_state_get_name(GST_STATE(mdecoder->pipe))); - DEBUG_TSMF("%s Paused: %"PRIi32" Shutdown: %i Ready: %"PRIi32"", get_type(mdecoder), mdecoder->paused, mdecoder->shutdown, mdecoder->ready); + DEBUG_TSMF("%s Paused: %" PRIi32 " Shutdown: %i Ready: %" PRIi32 "", get_type(mdecoder), + mdecoder->paused, mdecoder->shutdown, mdecoder->ready); if (!mdecoder->paused && !mdecoder->shutdown && mdecoder->ready) tsmf_gstreamer_pipeline_set_state(mdecoder, GST_STATE_PLAYING); } @@ -847,9 +846,9 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder* decoder, const BYTE *data, UIN return TRUE; } -static BOOL tsmf_gstreamer_control(ITSMFDecoder* decoder, ITSMFControlMsg control_msg, UINT32 *arg) +static BOOL tsmf_gstreamer_control(ITSMFDecoder* decoder, ITSMFControlMsg control_msg, UINT32* arg) { - TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder *) decoder; + TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder*)decoder; if (!mdecoder) { @@ -922,7 +921,7 @@ static BOOL tsmf_gstreamer_control(ITSMFDecoder* decoder, ITSMFControlMsg contro static BOOL tsmf_gstreamer_buffer_level(ITSMFDecoder* decoder) { - TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder *) decoder; + TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder*)decoder; DEBUG_TSMF(""); if (!mdecoder) @@ -939,7 +938,7 @@ static BOOL tsmf_gstreamer_buffer_level(ITSMFDecoder* decoder) static void tsmf_gstreamer_free(ITSMFDecoder* decoder) { - TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder *) decoder; + TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder*)decoder; DEBUG_TSMF("%s", get_type(mdecoder)); if (mdecoder) @@ -959,7 +958,7 @@ static void tsmf_gstreamer_free(ITSMFDecoder* decoder) static UINT64 tsmf_gstreamer_get_running_time(ITSMFDecoder* decoder) { - TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder *) decoder; + TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder*)decoder; if (!mdecoder) return 0; @@ -977,38 +976,37 @@ static UINT64 tsmf_gstreamer_get_running_time(ITSMFDecoder* decoder) #else gst_element_query_position(mdecoder->pipe, &fmt, &pos); #endif - return (UINT64) (pos/100 + mdecoder->seek_offset); + return (UINT64)(pos / 100 + mdecoder->seek_offset); } -static BOOL tsmf_gstreamer_update_rendering_area(ITSMFDecoder* decoder, - int newX, int newY, int newWidth, int newHeight, int numRectangles, - RDP_RECT *rectangles) +static BOOL tsmf_gstreamer_update_rendering_area(ITSMFDecoder* decoder, int newX, int newY, + int newWidth, int newHeight, int numRectangles, + RDP_RECT* rectangles) { - TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder *) decoder; - DEBUG_TSMF("x=%d, y=%d, w=%d, h=%d, rect=%d", newX, newY, newWidth, - newHeight, numRectangles); + TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder*)decoder; + DEBUG_TSMF("x=%d, y=%d, w=%d, h=%d, rect=%d", newX, newY, newWidth, newHeight, numRectangles); if (mdecoder->media_type == TSMF_MAJOR_TYPE_VIDEO) { - return tsmf_window_resize(mdecoder, newX, newY, newWidth, newHeight, - numRectangles, rectangles) == 0; + return tsmf_window_resize(mdecoder, newX, newY, newWidth, newHeight, numRectangles, + rectangles) == 0; } return TRUE; } -BOOL tsmf_gstreamer_ack(ITSMFDecoder* decoder, BOOL (*cb)(void *, BOOL), void *stream) +BOOL tsmf_gstreamer_ack(ITSMFDecoder* decoder, BOOL (*cb)(void*, BOOL), void* stream) { - TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder *) decoder; + TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder*)decoder; DEBUG_TSMF(""); mdecoder->ack_cb = NULL; mdecoder->stream = stream; return TRUE; } -BOOL tsmf_gstreamer_sync(ITSMFDecoder* decoder, void (*cb)(void *), void *stream) +BOOL tsmf_gstreamer_sync(ITSMFDecoder* decoder, void (*cb)(void*), void* stream) { - TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder *) decoder; + TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder*)decoder; DEBUG_TSMF(""); mdecoder->sync_cb = NULL; mdecoder->stream = stream; @@ -1016,16 +1014,16 @@ BOOL tsmf_gstreamer_sync(ITSMFDecoder* decoder, void (*cb)(void *), void *stream } #ifdef BUILTIN_CHANNELS -#define freerdp_tsmf_client_subsystem_entry gstreamer_freerdp_tsmf_client_decoder_subsystem_entry +#define freerdp_tsmf_client_subsystem_entry gstreamer_freerdp_tsmf_client_decoder_subsystem_entry #else -#define freerdp_tsmf_client_subsystem_entry FREERDP_API freerdp_tsmf_client_decoder_subsystem_entry +#define freerdp_tsmf_client_subsystem_entry FREERDP_API freerdp_tsmf_client_decoder_subsystem_entry #endif ITSMFDecoder* freerdp_tsmf_client_subsystem_entry(void) { - TSMFGstreamerDecoder *decoder; + TSMFGstreamerDecoder* decoder; -#if GST_CHECK_VERSION(0,10,31) +#if GST_CHECK_VERSION(0, 10, 31) if (!gst_is_initialized()) { gst_init(NULL, NULL); @@ -1056,7 +1054,7 @@ ITSMFDecoder* freerdp_tsmf_client_subsystem_entry(void) decoder->paused = FALSE; decoder->gstVolume = 0.5; decoder->gstMuted = FALSE; - decoder->state = GST_STATE_VOID_PENDING; /* No real state yet */ + decoder->state = GST_STATE_VOID_PENDING; /* No real state yet */ decoder->last_sample_start_time = 0; decoder->last_sample_end_time = 0; decoder->seek_offset = 0; @@ -1068,5 +1066,5 @@ ITSMFDecoder* freerdp_tsmf_client_subsystem_entry(void) return NULL; } - return (ITSMFDecoder*) decoder; + return (ITSMFDecoder*)decoder; } diff --git a/channels/tsmf/client/gstreamer/tsmf_platform.h b/channels/tsmf/client/gstreamer/tsmf_platform.h index 7fb6be1f7..970a59984 100644 --- a/channels/tsmf/client/gstreamer/tsmf_platform.h +++ b/channels/tsmf/client/gstreamer/tsmf_platform.h @@ -17,7 +17,7 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifndef FREERDP_CHANNEL_TSMF_CLIENT_GST_PLATFORM_H #define FREERDP_CHANNEL_TSMF_CLIENT_GST_PLATFORM_H @@ -34,13 +34,13 @@ typedef struct _TSMFGstreamerDecoder gint64 duration; GstState state; - GstCaps *gst_caps; + GstCaps* gst_caps; - GstElement *pipe; - GstElement *src; - GstElement *queue; - GstElement *outsink; - GstElement *volume; + GstElement* pipe; + GstElement* src; + GstElement* queue; + GstElement* outsink; + GstElement* volume; BOOL ready; BOOL paused; @@ -53,13 +53,13 @@ typedef struct _TSMFGstreamerDecoder BOOL gstMuted; int pipeline_start_time_valid; /* We've set the start time and have not reset the pipeline */ - int shutdown; /* The decoder stream is shutting down */ + int shutdown; /* The decoder stream is shutting down */ - void *platform; + void* platform; - BOOL (*ack_cb)(void *,BOOL); - void (*sync_cb)(void *); - void *stream; + BOOL (*ack_cb)(void*, BOOL); + void (*sync_cb)(void*); + void* stream; } TSMFGstreamerDecoder; @@ -74,8 +74,8 @@ int tsmf_platform_register_handler(TSMFGstreamerDecoder* decoder); int tsmf_platform_free(TSMFGstreamerDecoder* decoder); int tsmf_window_create(TSMFGstreamerDecoder* decoder); -int tsmf_window_resize(TSMFGstreamerDecoder* decoder, int x, int y, - int width, int height, int nr_rect, RDP_RECT *visible); +int tsmf_window_resize(TSMFGstreamerDecoder* decoder, int x, int y, int width, int height, + int nr_rect, RDP_RECT* visible); int tsmf_window_destroy(TSMFGstreamerDecoder* decoder); int tsmf_window_map(TSMFGstreamerDecoder* decoder); diff --git a/channels/tsmf/client/oss/tsmf_oss.c b/channels/tsmf/client/oss/tsmf_oss.c index 67a792728..774affbd1 100644 --- a/channels/tsmf/client/oss/tsmf_oss.c +++ b/channels/tsmf/client/oss/tsmf_oss.c @@ -46,7 +46,6 @@ #include "tsmf_audio.h" - typedef struct _TSMFOSSAudioDevice { ITSMFAudioDevice iface; @@ -61,12 +60,10 @@ typedef struct _TSMFOSSAudioDevice UINT32 data_size_last; } TSMFOssAudioDevice; - #define OSS_LOG_ERR(_text, _error) \ - if (_error != 0) \ + if (_error != 0) \ WLog_ERR(TAG, "%s: %i - %s", _text, _error, strerror(_error)); - static BOOL tsmf_oss_open(ITSMFAudioDevice* audio, const char* device) { int tmp; @@ -75,7 +72,7 @@ static BOOL tsmf_oss_open(ITSMFAudioDevice* audio, const char* device) if (oss == NULL || oss->pcm_handle != -1) return FALSE; - if (device == NULL) /* Default device. */ + if (device == NULL) /* Default device. */ { strncpy(oss->dev_name, "/dev/dsp", sizeof(oss->dev_name)); } @@ -161,7 +158,7 @@ static BOOL tsmf_oss_set_format(ITSMFAudioDevice* audio, UINT32 sample_rate, UIN if (ioctl(oss->pcm_handle, SNDCTL_DSP_SETFRAGMENT, &tmp) == -1) OSS_LOG_ERR("SNDCTL_DSP_SETFRAGMENT failed", errno); - DEBUG_TSMF("sample_rate %"PRIu32" channels %"PRIu32" bits_per_sample %"PRIu32"", + DEBUG_TSMF("sample_rate %" PRIu32 " channels %" PRIu32 " bits_per_sample %" PRIu32 "", sample_rate, channels, bits_per_sample); return TRUE; } @@ -171,7 +168,7 @@ static BOOL tsmf_oss_play(ITSMFAudioDevice* audio, const BYTE* data, UINT32 data int status; UINT32 offset; TSMFOssAudioDevice* oss = (TSMFOssAudioDevice*)audio; - DEBUG_TSMF("tsmf_oss_play: data_size %"PRIu32"", data_size); + DEBUG_TSMF("tsmf_oss_play: data_size %" PRIu32 "", data_size); if (oss == NULL || oss->pcm_handle == -1) return FALSE; @@ -206,8 +203,8 @@ static UINT64 tsmf_oss_get_latency(ITSMFAudioDevice* audio) if (oss == NULL) return 0; - //latency = ((oss->data_size_last / (oss->bits_per_sample / 8)) * oss->sample_rate); - //WLog_INFO(TAG, "latency: %zu", latency); + // latency = ((oss->data_size_last / (oss->bits_per_sample / 8)) * oss->sample_rate); + // WLog_INFO(TAG, "latency: %zu", latency); return latency; } @@ -233,9 +230,10 @@ static void tsmf_oss_free(ITSMFAudioDevice* audio) } #ifdef BUILTIN_CHANNELS -#define freerdp_tsmf_client_audio_subsystem_entry oss_freerdp_tsmf_client_audio_subsystem_entry +#define freerdp_tsmf_client_audio_subsystem_entry oss_freerdp_tsmf_client_audio_subsystem_entry #else -#define freerdp_tsmf_client_audio_subsystem_entry FREERDP_API freerdp_tsmf_client_audio_subsystem_entry +#define freerdp_tsmf_client_audio_subsystem_entry \ + FREERDP_API freerdp_tsmf_client_audio_subsystem_entry #endif ITSMFAudioDevice* freerdp_tsmf_client_audio_subsystem_entry(void) diff --git a/channels/tsmf/client/pulse/tsmf_pulse.c b/channels/tsmf/client/pulse/tsmf_pulse.c index e63477c57..b2f567e05 100644 --- a/channels/tsmf/client/pulse/tsmf_pulse.c +++ b/channels/tsmf/client/pulse/tsmf_pulse.c @@ -45,7 +45,7 @@ typedef struct _TSMFPulseAudioDevice static void tsmf_pulse_context_state_callback(pa_context* context, void* userdata) { - TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*) userdata; + TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*)userdata; pa_context_state_t state; state = pa_context_get_state(context); @@ -77,8 +77,7 @@ static BOOL tsmf_pulse_connect(TSMFPulseAudioDevice* pulse) if (pa_context_connect(pulse->context, NULL, 0, NULL)) { - WLog_ERR(TAG, "pa_context_connect failed (%d)", - pa_context_errno(pulse->context)); + WLog_ERR(TAG, "pa_context_connect failed (%d)", pa_context_errno(pulse->context)); return FALSE; } @@ -87,8 +86,7 @@ static BOOL tsmf_pulse_connect(TSMFPulseAudioDevice* pulse) if (pa_threaded_mainloop_start(pulse->mainloop) < 0) { pa_threaded_mainloop_unlock(pulse->mainloop); - WLog_ERR(TAG, "pa_threaded_mainloop_start failed (%d)", - pa_context_errno(pulse->context)); + WLog_ERR(TAG, "pa_threaded_mainloop_start failed (%d)", pa_context_errno(pulse->context)); return FALSE; } @@ -101,8 +99,7 @@ static BOOL tsmf_pulse_connect(TSMFPulseAudioDevice* pulse) if (!PA_CONTEXT_IS_GOOD(state)) { - DEBUG_TSMF("bad context state (%d)", - pa_context_errno(pulse->context)); + DEBUG_TSMF("bad context state (%d)", pa_context_errno(pulse->context)); break; } @@ -125,7 +122,7 @@ static BOOL tsmf_pulse_connect(TSMFPulseAudioDevice* pulse) static BOOL tsmf_pulse_open(ITSMFAudioDevice* audio, const char* device) { - TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*) audio; + TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*)audio; if (device) { @@ -162,7 +159,7 @@ static BOOL tsmf_pulse_open(ITSMFAudioDevice* audio, const char* device) static void tsmf_pulse_stream_success_callback(pa_stream* stream, int success, void* userdata) { - TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*) userdata; + TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*)userdata; pa_threaded_mainloop_signal(pulse->mainloop, 0); } @@ -181,7 +178,7 @@ static void tsmf_pulse_wait_for_operation(TSMFPulseAudioDevice* pulse, pa_operat static void tsmf_pulse_stream_state_callback(pa_stream* stream, void* userdata) { - TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*) userdata; + TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*)userdata; pa_stream_state_t state; state = pa_stream_get_state(stream); @@ -206,8 +203,8 @@ static void tsmf_pulse_stream_state_callback(pa_stream* stream, void* userdata) static void tsmf_pulse_stream_request_callback(pa_stream* stream, size_t length, void* userdata) { - TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*) userdata; - DEBUG_TSMF("%"PRIdz"", length); + TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*)userdata; + DEBUG_TSMF("%" PRIdz "", length); pa_threaded_mainloop_signal(pulse->mainloop, 0); } @@ -219,8 +216,8 @@ static BOOL tsmf_pulse_close_stream(TSMFPulseAudioDevice* pulse) DEBUG_TSMF(""); pa_threaded_mainloop_lock(pulse->mainloop); pa_stream_set_write_callback(pulse->stream, NULL, NULL); - tsmf_pulse_wait_for_operation(pulse, - pa_stream_drain(pulse->stream, tsmf_pulse_stream_success_callback, pulse)); + tsmf_pulse_wait_for_operation( + pulse, pa_stream_drain(pulse->stream, tsmf_pulse_stream_success_callback, pulse)); pa_stream_disconnect(pulse->stream); pa_stream_unref(pulse->stream); pulse->stream = NULL; @@ -238,35 +235,30 @@ static BOOL tsmf_pulse_open_stream(TSMFPulseAudioDevice* pulse) DEBUG_TSMF(""); pa_threaded_mainloop_lock(pulse->mainloop); - pulse->stream = pa_stream_new(pulse->context, "freerdp", - &pulse->sample_spec, NULL); + pulse->stream = pa_stream_new(pulse->context, "freerdp", &pulse->sample_spec, NULL); if (!pulse->stream) { pa_threaded_mainloop_unlock(pulse->mainloop); - WLog_ERR(TAG, "pa_stream_new failed (%d)", - pa_context_errno(pulse->context)); + WLog_ERR(TAG, "pa_stream_new failed (%d)", pa_context_errno(pulse->context)); return FALSE; } - pa_stream_set_state_callback(pulse->stream, - tsmf_pulse_stream_state_callback, pulse); - pa_stream_set_write_callback(pulse->stream, - tsmf_pulse_stream_request_callback, pulse); + pa_stream_set_state_callback(pulse->stream, tsmf_pulse_stream_state_callback, pulse); + pa_stream_set_write_callback(pulse->stream, tsmf_pulse_stream_request_callback, pulse); buffer_attr.maxlength = pa_usec_to_bytes(500000, &pulse->sample_spec); buffer_attr.tlength = pa_usec_to_bytes(250000, &pulse->sample_spec); - buffer_attr.prebuf = (UINT32) - 1; - buffer_attr.minreq = (UINT32) - 1; - buffer_attr.fragsize = (UINT32) - 1; + buffer_attr.prebuf = (UINT32)-1; + buffer_attr.minreq = (UINT32)-1; + buffer_attr.fragsize = (UINT32)-1; - if (pa_stream_connect_playback(pulse->stream, - pulse->device[0] ? pulse->device : NULL, &buffer_attr, - PA_STREAM_ADJUST_LATENCY | PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_AUTO_TIMING_UPDATE, - NULL, NULL) < 0) + if (pa_stream_connect_playback( + pulse->stream, pulse->device[0] ? pulse->device : NULL, &buffer_attr, + PA_STREAM_ADJUST_LATENCY | PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_AUTO_TIMING_UPDATE, + NULL, NULL) < 0) { pa_threaded_mainloop_unlock(pulse->mainloop); - WLog_ERR(TAG, "pa_stream_connect_playback failed (%d)", - pa_context_errno(pulse->context)); + WLog_ERR(TAG, "pa_stream_connect_playback failed (%d)", pa_context_errno(pulse->context)); return FALSE; } @@ -279,8 +271,7 @@ static BOOL tsmf_pulse_open_stream(TSMFPulseAudioDevice* pulse) if (!PA_STREAM_IS_GOOD(state)) { - WLog_ERR(TAG, "bad stream state (%d)", - pa_context_errno(pulse->context)); + WLog_ERR(TAG, "bad stream state (%d)", pa_context_errno(pulse->context)); break; } @@ -301,11 +292,11 @@ static BOOL tsmf_pulse_open_stream(TSMFPulseAudioDevice* pulse) } } -static BOOL tsmf_pulse_set_format(ITSMFAudioDevice* audio, - UINT32 sample_rate, UINT32 channels, UINT32 bits_per_sample) +static BOOL tsmf_pulse_set_format(ITSMFAudioDevice* audio, UINT32 sample_rate, UINT32 channels, + UINT32 bits_per_sample) { - TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*) audio; - DEBUG_TSMF("sample_rate %"PRIu32" channels %"PRIu32" bits_per_sample %"PRIu32"", + TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*)audio; + DEBUG_TSMF("sample_rate %" PRIu32 " channels %" PRIu32 " bits_per_sample %" PRIu32 "", sample_rate, channels, bits_per_sample); pulse->sample_spec.rate = sample_rate; pulse->sample_spec.channels = channels; @@ -315,11 +306,11 @@ static BOOL tsmf_pulse_set_format(ITSMFAudioDevice* audio, static BOOL tsmf_pulse_play(ITSMFAudioDevice* audio, const BYTE* data, UINT32 data_size) { - TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*) audio; + TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*)audio; const BYTE* src; size_t len; int ret; - DEBUG_TSMF("data_size %"PRIu32"", data_size); + DEBUG_TSMF("data_size %" PRIu32 "", data_size); if (pulse->stream) { @@ -334,7 +325,7 @@ static BOOL tsmf_pulse_play(ITSMFAudioDevice* audio, const BYTE* data, UINT32 da pa_threaded_mainloop_wait(pulse->mainloop); } - if (len == (size_t) -1) + if (len == (size_t)-1) break; if (len > data_size) @@ -344,8 +335,7 @@ static BOOL tsmf_pulse_play(ITSMFAudioDevice* audio, const BYTE* data, UINT32 da if (ret < 0) { - DEBUG_TSMF("pa_stream_write failed (%d)", - pa_context_errno(pulse->context)); + DEBUG_TSMF("pa_stream_write failed (%d)", pa_context_errno(pulse->context)); break; } @@ -363,7 +353,7 @@ static UINT64 tsmf_pulse_get_latency(ITSMFAudioDevice* audio) { pa_usec_t usec; UINT64 latency = 0; - TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*) audio; + TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*)audio; if (pulse->stream && pa_stream_get_latency(pulse->stream, &usec, NULL) == 0) { @@ -375,17 +365,17 @@ static UINT64 tsmf_pulse_get_latency(ITSMFAudioDevice* audio) static BOOL tsmf_pulse_flush(ITSMFAudioDevice* audio) { - TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*) audio; + TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*)audio; pa_threaded_mainloop_lock(pulse->mainloop); - tsmf_pulse_wait_for_operation(pulse, - pa_stream_flush(pulse->stream, tsmf_pulse_stream_success_callback, pulse)); + tsmf_pulse_wait_for_operation( + pulse, pa_stream_flush(pulse->stream, tsmf_pulse_stream_success_callback, pulse)); pa_threaded_mainloop_unlock(pulse->mainloop); return TRUE; } static void tsmf_pulse_free(ITSMFAudioDevice* audio) { - TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*) audio; + TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*)audio; DEBUG_TSMF(""); tsmf_pulse_close_stream(pulse); @@ -417,7 +407,7 @@ FREERDP_API ITSMFAudioDevice* freerdp_tsmf_client_audio_subsystem_entry(void) #endif { TSMFPulseAudioDevice* pulse; - pulse = (TSMFPulseAudioDevice*) calloc(1, sizeof(TSMFPulseAudioDevice)); + pulse = (TSMFPulseAudioDevice*)calloc(1, sizeof(TSMFPulseAudioDevice)); if (!pulse) return NULL; @@ -428,6 +418,5 @@ FREERDP_API ITSMFAudioDevice* freerdp_tsmf_client_audio_subsystem_entry(void) pulse->iface.GetLatency = tsmf_pulse_get_latency; pulse->iface.Flush = tsmf_pulse_flush; pulse->iface.Free = tsmf_pulse_free; - return (ITSMFAudioDevice*) pulse; + return (ITSMFAudioDevice*)pulse; } - diff --git a/channels/tsmf/client/tsmf_audio.c b/channels/tsmf/client/tsmf_audio.c index 18d844c41..9f0bb3230 100644 --- a/channels/tsmf/client/tsmf_audio.c +++ b/channels/tsmf/client/tsmf_audio.c @@ -32,7 +32,8 @@ static ITSMFAudioDevice* tsmf_load_audio_device_by_name(const char* name, const ITSMFAudioDevice* audio; TSMF_AUDIO_DEVICE_ENTRY entry; - entry = (TSMF_AUDIO_DEVICE_ENTRY) (void*)freerdp_load_channel_addin_entry("tsmf", name, "audio", 0); + entry = + (TSMF_AUDIO_DEVICE_ENTRY)(void*)freerdp_load_channel_addin_entry("tsmf", name, "audio", 0); if (!entry) return NULL; @@ -84,7 +85,7 @@ ITSMFAudioDevice* tsmf_load_audio_device(const char* name, const char* device) audio = tsmf_load_audio_device_by_name("alsa", device); #endif } - + if (audio == NULL) { WLog_ERR(TAG, "no sound device."); @@ -96,4 +97,3 @@ ITSMFAudioDevice* tsmf_load_audio_device(const char* name, const char* device) return audio; } - diff --git a/channels/tsmf/client/tsmf_audio.h b/channels/tsmf/client/tsmf_audio.h index d589d5489..e7ae68cb1 100644 --- a/channels/tsmf/client/tsmf_audio.h +++ b/channels/tsmf/client/tsmf_audio.h @@ -29,12 +29,12 @@ struct _ITSMFAudioDevice /* Open the audio device. */ BOOL (*Open)(ITSMFAudioDevice* audio, const char* device); /* Set the audio data format. */ - BOOL (*SetFormat)(ITSMFAudioDevice* audio, UINT32 sample_rate, UINT32 channels, - UINT32 bits_per_sample); + BOOL(*SetFormat) + (ITSMFAudioDevice* audio, UINT32 sample_rate, UINT32 channels, UINT32 bits_per_sample); /* Play audio data. */ BOOL (*Play)(ITSMFAudioDevice* audio, const BYTE* data, UINT32 data_size); /* Get the latency of the last written sample, in 100ns */ - UINT64(*GetLatency)(ITSMFAudioDevice* audio); + UINT64 (*GetLatency)(ITSMFAudioDevice* audio); /* Change the playback volume level */ BOOL (*ChangeVolume)(ITSMFAudioDevice* audio, UINT32 newVolume, UINT32 muted); /* Flush queued audio data */ diff --git a/channels/tsmf/client/tsmf_codec.c b/channels/tsmf/client/tsmf_codec.c index 0918c456d..66723962d 100644 --- a/channels/tsmf/client/tsmf_codec.c +++ b/channels/tsmf/client/tsmf_codec.c @@ -43,260 +43,212 @@ typedef struct _TSMFMediaTypeMap int type; } TSMFMediaTypeMap; -static const TSMFMediaTypeMap tsmf_major_type_map[] = -{ +static const TSMFMediaTypeMap tsmf_major_type_map[] = { /* 73646976-0000-0010-8000-00AA00389B71 */ - { - { 0x76, 0x69, 0x64, 0x73, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIATYPE_Video", - TSMF_MAJOR_TYPE_VIDEO - }, + { { 0x76, 0x69, 0x64, 0x73, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIATYPE_Video", + TSMF_MAJOR_TYPE_VIDEO }, /* 73647561-0000-0010-8000-00AA00389B71 */ - { - { 0x61, 0x75, 0x64, 0x73, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIATYPE_Audio", - TSMF_MAJOR_TYPE_AUDIO - }, + { { 0x61, 0x75, 0x64, 0x73, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIATYPE_Audio", + TSMF_MAJOR_TYPE_AUDIO }, - { - { 0 }, - "Unknown", - TSMF_MAJOR_TYPE_UNKNOWN - } + { { 0 }, "Unknown", TSMF_MAJOR_TYPE_UNKNOWN } }; -static const TSMFMediaTypeMap tsmf_sub_type_map[] = -{ +static const TSMFMediaTypeMap tsmf_sub_type_map[] = { /* 31435657-0000-0010-8000-00AA00389B71 */ - { - { 0x57, 0x56, 0x43, 0x31, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIASUBTYPE_WVC1", - TSMF_SUB_TYPE_WVC1 - }, + { { 0x57, 0x56, 0x43, 0x31, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_WVC1", + TSMF_SUB_TYPE_WVC1 }, - /* 00000160-0000-0010-8000-00AA00389B71 */ - { - { 0x60, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIASUBTYPE_WMAudioV1", /* V7, V8 has the same GUID */ - TSMF_SUB_TYPE_WMA1 - }, + /* 00000160-0000-0010-8000-00AA00389B71 */ + { { 0x60, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_WMAudioV1", /* V7, V8 has the same GUID */ + TSMF_SUB_TYPE_WMA1 }, /* 00000161-0000-0010-8000-00AA00389B71 */ - { - { 0x61, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIASUBTYPE_WMAudioV2", /* V7, V8 has the same GUID */ - TSMF_SUB_TYPE_WMA2 - }, + { { 0x61, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_WMAudioV2", /* V7, V8 has the same GUID */ + TSMF_SUB_TYPE_WMA2 }, /* 00000162-0000-0010-8000-00AA00389B71 */ - { - { 0x62, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIASUBTYPE_WMAudioV9", - TSMF_SUB_TYPE_WMA9 - }, + { { 0x62, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_WMAudioV9", + TSMF_SUB_TYPE_WMA9 }, /* 00000055-0000-0010-8000-00AA00389B71 */ - { - { 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIASUBTYPE_MP3", - TSMF_SUB_TYPE_MP3 - }, + { { 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_MP3", + TSMF_SUB_TYPE_MP3 }, /* E06D802B-DB46-11CF-B4D1-00805F6CBBEA */ - { - { 0x2B, 0x80, 0x6D, 0xE0, 0x46, 0xDB, 0xCF, 0x11, 0xB4, 0xD1, 0x00, 0x80, 0x5F, 0x6C, 0xBB, 0xEA }, - "MEDIASUBTYPE_MPEG2_AUDIO", - TSMF_SUB_TYPE_MP2A - }, + { { 0x2B, 0x80, 0x6D, 0xE0, 0x46, 0xDB, 0xCF, 0x11, 0xB4, 0xD1, 0x00, 0x80, 0x5F, 0x6C, 0xBB, + 0xEA }, + "MEDIASUBTYPE_MPEG2_AUDIO", + TSMF_SUB_TYPE_MP2A }, /* E06D8026-DB46-11CF-B4D1-00805F6CBBEA */ - { - { 0x26, 0x80, 0x6D, 0xE0, 0x46, 0xDB, 0xCF, 0x11, 0xB4, 0xD1, 0x00, 0x80, 0x5F, 0x6C, 0xBB, 0xEA }, - "MEDIASUBTYPE_MPEG2_VIDEO", - TSMF_SUB_TYPE_MP2V - }, + { { 0x26, 0x80, 0x6D, 0xE0, 0x46, 0xDB, 0xCF, 0x11, 0xB4, 0xD1, 0x00, 0x80, 0x5F, 0x6C, 0xBB, + 0xEA }, + "MEDIASUBTYPE_MPEG2_VIDEO", + TSMF_SUB_TYPE_MP2V }, /* 31564D57-0000-0010-8000-00AA00389B71 */ - { - { 0x57, 0x4D, 0x56, 0x31, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIASUBTYPE_WMV1", - TSMF_SUB_TYPE_WMV1 - }, + { { 0x57, 0x4D, 0x56, 0x31, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_WMV1", + TSMF_SUB_TYPE_WMV1 }, /* 32564D57-0000-0010-8000-00AA00389B71 */ - { - { 0x57, 0x4D, 0x56, 0x32, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIASUBTYPE_WMV2", - TSMF_SUB_TYPE_WMV2 - }, + { { 0x57, 0x4D, 0x56, 0x32, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_WMV2", + TSMF_SUB_TYPE_WMV2 }, /* 33564D57-0000-0010-8000-00AA00389B71 */ - { - { 0x57, 0x4D, 0x56, 0x33, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIASUBTYPE_WMV3", - TSMF_SUB_TYPE_WMV3 - }, + { { 0x57, 0x4D, 0x56, 0x33, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_WMV3", + TSMF_SUB_TYPE_WMV3 }, /* 00001610-0000-0010-8000-00AA00389B71 */ - { - { 0x10, 0x16, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIASUBTYPE_MPEG_HEAAC", - TSMF_SUB_TYPE_AAC - }, + { { 0x10, 0x16, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_MPEG_HEAAC", + TSMF_SUB_TYPE_AAC }, /* 34363248-0000-0010-8000-00AA00389B71 */ - { - { 0x48, 0x32, 0x36, 0x34, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIASUBTYPE_H264", - TSMF_SUB_TYPE_H264 - }, + { { 0x48, 0x32, 0x36, 0x34, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_H264", + TSMF_SUB_TYPE_H264 }, /* 31435641-0000-0010-8000-00AA00389B71 */ - { - { 0x41, 0x56, 0x43, 0x31, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIASUBTYPE_AVC1", - TSMF_SUB_TYPE_AVC1 - }, + { { 0x41, 0x56, 0x43, 0x31, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_AVC1", + TSMF_SUB_TYPE_AVC1 }, /* 3334504D-0000-0010-8000-00AA00389B71 */ - { - { 0x4D, 0x50, 0x34, 0x33, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIASUBTYPE_MP43", - TSMF_SUB_TYPE_MP43 - }, + { { 0x4D, 0x50, 0x34, 0x33, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_MP43", + TSMF_SUB_TYPE_MP43 }, /* 5634504D-0000-0010-8000-00AA00389B71 */ - { - { 0x4D, 0x50, 0x34, 0x56, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIASUBTYPE_MP4S", - TSMF_SUB_TYPE_MP4S - }, + { { 0x4D, 0x50, 0x34, 0x56, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_MP4S", + TSMF_SUB_TYPE_MP4S }, /* 3234504D-0000-0010-8000-00AA00389B71 */ - { - { 0x4D, 0x50, 0x34, 0x32, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIASUBTYPE_MP42", - TSMF_SUB_TYPE_MP42 - }, + { { 0x4D, 0x50, 0x34, 0x32, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_MP42", + TSMF_SUB_TYPE_MP42 }, /* 3253344D-0000-0010-8000-00AA00389B71 */ - { - { 0x4D, 0x34, 0x53, 0x32, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIASUBTYPE_MP42", - TSMF_SUB_TYPE_M4S2 - }, + { { 0x4D, 0x34, 0x53, 0x32, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_MP42", + TSMF_SUB_TYPE_M4S2 }, /* E436EB81-524F-11CE-9F53-0020AF0BA770 */ - { - { 0x81, 0xEB, 0x36, 0xE4, 0x4F, 0x52, 0xCE, 0x11, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70 }, - "MEDIASUBTYPE_MP1V", - TSMF_SUB_TYPE_MP1V - }, + { { 0x81, 0xEB, 0x36, 0xE4, 0x4F, 0x52, 0xCE, 0x11, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, + 0x70 }, + "MEDIASUBTYPE_MP1V", + TSMF_SUB_TYPE_MP1V }, /* 00000050-0000-0010-8000-00AA00389B71 */ - { - { 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIASUBTYPE_MP1A", - TSMF_SUB_TYPE_MP1A - }, + { { 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_MP1A", + TSMF_SUB_TYPE_MP1A }, /* E06D802C-DB46-11CF-B4D1-00805F6CBBEA */ - { - { 0x2C, 0x80, 0x6D, 0xE0, 0x46, 0xDB, 0xCF, 0x11, 0xB4, 0xD1, 0x00, 0x80, 0x5F, 0x6C, 0xBB, 0xEA }, - "MEDIASUBTYPE_DOLBY_AC3", - TSMF_SUB_TYPE_AC3 - }, + { { 0x2C, 0x80, 0x6D, 0xE0, 0x46, 0xDB, 0xCF, 0x11, 0xB4, 0xD1, 0x00, 0x80, 0x5F, 0x6C, 0xBB, + 0xEA }, + "MEDIASUBTYPE_DOLBY_AC3", + TSMF_SUB_TYPE_AC3 }, /* 32595559-0000-0010-8000-00AA00389B71 */ - { - { 0x59, 0x55, 0x59, 0x32, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }, - "MEDIASUBTYPE_YUY2", - TSMF_SUB_TYPE_YUY2 - }, + { { 0x59, 0x55, 0x59, 0x32, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_YUY2", + TSMF_SUB_TYPE_YUY2 }, /* Opencodec IDS */ - { - {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}, - "MEDIASUBTYPE_FLAC", - TSMF_SUB_TYPE_FLAC - }, + { { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_FLAC", + TSMF_SUB_TYPE_FLAC }, - { - {0x61, 0x34, 0x70, 0x6D, 0x7A, 0x76, 0x4D, 0x49, 0xB4, 0x78, 0xF2, 0x9D, 0x25, 0xDC, 0x90, 0x37}, - "MEDIASUBTYPE_OGG", - TSMF_SUB_TYPE_OGG - }, + { { 0x61, 0x34, 0x70, 0x6D, 0x7A, 0x76, 0x4D, 0x49, 0xB4, 0x78, 0xF2, 0x9D, 0x25, 0xDC, 0x90, + 0x37 }, + "MEDIASUBTYPE_OGG", + TSMF_SUB_TYPE_OGG }, - { - {0x4D, 0x34, 0x53, 0x32, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}, - "MEDIASUBTYPE_H263", - TSMF_SUB_TYPE_H263 - }, + { { 0x4D, 0x34, 0x53, 0x32, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_H263", + TSMF_SUB_TYPE_H263 }, /* WebMMF codec IDS */ - { - {0x56, 0x50, 0x38, 0x30, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}, - "MEDIASUBTYPE_VP8", - TSMF_SUB_TYPE_VP8 - }, + { { 0x56, 0x50, 0x38, 0x30, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, + 0x71 }, + "MEDIASUBTYPE_VP8", + TSMF_SUB_TYPE_VP8 }, - { - {0x0B, 0xD1, 0x2F, 0x8D, 0x41, 0x58, 0x6B, 0x4A, 0x89, 0x05, 0x58, 0x8F, 0xEC, 0x1A, 0xDE, 0xD9}, - "MEDIASUBTYPE_OGG", - TSMF_SUB_TYPE_OGG - }, + { { 0x0B, 0xD1, 0x2F, 0x8D, 0x41, 0x58, 0x6B, 0x4A, 0x89, 0x05, 0x58, 0x8F, 0xEC, 0x1A, 0xDE, + 0xD9 }, + "MEDIASUBTYPE_OGG", + TSMF_SUB_TYPE_OGG }, - { - { 0 }, - "Unknown", - TSMF_SUB_TYPE_UNKNOWN - } + { { 0 }, "Unknown", TSMF_SUB_TYPE_UNKNOWN } }; -static const TSMFMediaTypeMap tsmf_format_type_map[] = -{ +static const TSMFMediaTypeMap tsmf_format_type_map[] = { /* AED4AB2D-7326-43CB-9464-C879CAB9C43D */ - { - { 0x2D, 0xAB, 0xD4, 0xAE, 0x26, 0x73, 0xCB, 0x43, 0x94, 0x64, 0xC8, 0x79, 0xCA, 0xB9, 0xC4, 0x3D }, - "FORMAT_MFVideoFormat", - TSMF_FORMAT_TYPE_MFVIDEOFORMAT - }, + { { 0x2D, 0xAB, 0xD4, 0xAE, 0x26, 0x73, 0xCB, 0x43, 0x94, 0x64, 0xC8, 0x79, 0xCA, 0xB9, 0xC4, + 0x3D }, + "FORMAT_MFVideoFormat", + TSMF_FORMAT_TYPE_MFVIDEOFORMAT }, /* 05589F81-C356-11CE-BF01-00AA0055595A */ - { - { 0x81, 0x9F, 0x58, 0x05, 0x56, 0xC3, 0xCE, 0x11, 0xBF, 0x01, 0x00, 0xAA, 0x00, 0x55, 0x59, 0x5A }, - "FORMAT_WaveFormatEx", - TSMF_FORMAT_TYPE_WAVEFORMATEX - }, + { { 0x81, 0x9F, 0x58, 0x05, 0x56, 0xC3, 0xCE, 0x11, 0xBF, 0x01, 0x00, 0xAA, 0x00, 0x55, 0x59, + 0x5A }, + "FORMAT_WaveFormatEx", + TSMF_FORMAT_TYPE_WAVEFORMATEX }, /* E06D80E3-DB46-11CF-B4D1-00805F6CBBEA */ - { - { 0xE3, 0x80, 0x6D, 0xE0, 0x46, 0xDB, 0xCF, 0x11, 0xB4, 0xD1, 0x00, 0x80, 0x5F, 0x6C, 0xBB, 0xEA }, - "FORMAT_MPEG2_VIDEO", - TSMF_FORMAT_TYPE_MPEG2VIDEOINFO - }, + { { 0xE3, 0x80, 0x6D, 0xE0, 0x46, 0xDB, 0xCF, 0x11, 0xB4, 0xD1, 0x00, 0x80, 0x5F, 0x6C, 0xBB, + 0xEA }, + "FORMAT_MPEG2_VIDEO", + TSMF_FORMAT_TYPE_MPEG2VIDEOINFO }, /* F72A76A0-EB0A-11D0-ACE4-0000C0CC16BA */ - { - { 0xA0, 0x76, 0x2A, 0xF7, 0x0A, 0xEB, 0xD0, 0x11, 0xAC, 0xE4, 0x00, 0x00, 0xC0, 0xCC, 0x16, 0xBA }, - "FORMAT_VideoInfo2", - TSMF_FORMAT_TYPE_VIDEOINFO2 - }, + { { 0xA0, 0x76, 0x2A, 0xF7, 0x0A, 0xEB, 0xD0, 0x11, 0xAC, 0xE4, 0x00, 0x00, 0xC0, 0xCC, 0x16, + 0xBA }, + "FORMAT_VideoInfo2", + TSMF_FORMAT_TYPE_VIDEOINFO2 }, /* 05589F82-C356-11CE-BF01-00AA0055595A */ - { - { 0x82, 0x9F, 0x58, 0x05, 0x56, 0xC3, 0xCE, 0x11, 0xBF, 0x01, 0x00, 0xAA, 0x00, 0x55, 0x59, 0x5A }, - "FORMAT_MPEG1_VIDEO", - TSMF_FORMAT_TYPE_MPEG1VIDEOINFO - }, + { { 0x82, 0x9F, 0x58, 0x05, 0x56, 0xC3, 0xCE, 0x11, 0xBF, 0x01, 0x00, 0xAA, 0x00, 0x55, 0x59, + 0x5A }, + "FORMAT_MPEG1_VIDEO", + TSMF_FORMAT_TYPE_MPEG1VIDEOINFO }, - { - { 0 }, - "Unknown", - TSMF_FORMAT_TYPE_UNKNOWN - } + { { 0 }, "Unknown", TSMF_FORMAT_TYPE_UNKNOWN } }; static void tsmf_print_guid(const BYTE* guid) @@ -304,21 +256,20 @@ static void tsmf_print_guid(const BYTE* guid) #ifdef WITH_DEBUG_TSMF char guidString[37]; - snprintf(guidString, sizeof(guidString), "%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"-%02"PRIX8"%02"PRIX8"-%02"PRIX8"%02"PRIX8"-%02"PRIX8"%02"PRIX8"-%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"", - guid[3], guid[2], guid[1], guid[0], - guid[5], guid[4], - guid[7], guid[6], - guid[8], guid[9], - guid[10], guid[11], guid[12], guid[13], guid[14], guid[15] - ); - + snprintf(guidString, sizeof(guidString), + "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "-%02" PRIX8 "%02" PRIX8 "-%02" PRIX8 + "%02" PRIX8 "-%02" PRIX8 "%02" PRIX8 "-%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 "", + guid[3], guid[2], guid[1], guid[0], guid[5], guid[4], guid[7], guid[6], guid[8], + guid[9], guid[10], guid[11], guid[12], guid[13], guid[14], guid[15]); WLog_INFO(TAG, "%s", guidString); #endif } /* http://msdn.microsoft.com/en-us/library/dd318229.aspx */ -static UINT32 tsmf_codec_parse_BITMAPINFOHEADER(TS_AM_MEDIA_TYPE* mediatype, wStream* s, BOOL bypass) +static UINT32 tsmf_codec_parse_BITMAPINFOHEADER(TS_AM_MEDIA_TYPE* mediatype, wStream* s, + BOOL bypass) { UINT32 biSize; UINT32 biWidth; @@ -338,7 +289,7 @@ static UINT32 tsmf_codec_parse_BITMAPINFOHEADER(TS_AM_MEDIA_TYPE* mediatype, wSt mediatype->Height = biHeight; /* Assume there will be no color table for video? */ - if ((biSize < 40) || (Stream_GetRemainingLength(s) < (biSize-40))) + if ((biSize < 40) || (Stream_GetRemainingLength(s) < (biSize - 40))) return 0; if (bypass && biSize > 40) @@ -422,8 +373,8 @@ static BOOL tsmf_read_format_type(TS_AM_MEDIA_TYPE* mediatype, wStream* s, UINT3 if (Stream_GetRemainingLength(s) < 176) return FALSE; - Stream_Seek(s, 8); /* dwSize and ? */ - Stream_Read_UINT32(s, mediatype->Width); /* videoInfo.dwWidth */ + Stream_Seek(s, 8); /* dwSize and ? */ + Stream_Read_UINT32(s, mediatype->Width); /* videoInfo.dwWidth */ Stream_Read_UINT32(s, mediatype->Height); /* videoInfo.dwHeight */ Stream_Seek(s, 32); /* videoInfo.FramesPerSecond */ @@ -600,7 +551,7 @@ BOOL tsmf_codec_parse_media_type(TS_AM_MEDIA_TYPE* mediatype, wStream* s) if (Stream_GetRemainingLength(s) < 4) return FALSE; Stream_Read_UINT32(s, cbFormat); - DEBUG_TSMF("cbFormat %"PRIu32"", cbFormat); + DEBUG_TSMF("cbFormat %" PRIu32 "", cbFormat); #ifdef WITH_DEBUG_TSMF winpr_HexDump(TAG, WLOG_DEBUG, Stream_Pointer(s), cbFormat); #endif @@ -627,7 +578,7 @@ BOOL tsmf_codec_check_media_type(const char* decoder_name, wStream* s) if (firstRun) { - firstRun =FALSE; + firstRun = FALSE; if (tsmf_check_decoder_available(decoder_name)) decoderAvailable = TRUE; } diff --git a/channels/tsmf/client/tsmf_codec.h b/channels/tsmf/client/tsmf_codec.h index a678ea41c..ab988991d 100644 --- a/channels/tsmf/client/tsmf_codec.h +++ b/channels/tsmf/client/tsmf_codec.h @@ -26,4 +26,3 @@ BOOL tsmf_codec_parse_media_type(TS_AM_MEDIA_TYPE* mediatype, wStream* s); BOOL tsmf_codec_check_media_type(const char* decoder_name, wStream* s); #endif /* FREERDP_CHANNEL_TSMF_CLIENT_CODEC_H */ - diff --git a/channels/tsmf/client/tsmf_constants.h b/channels/tsmf/client/tsmf_constants.h index d84370a2a..43d37f27d 100644 --- a/channels/tsmf/client/tsmf_constants.h +++ b/channels/tsmf/client/tsmf_constants.h @@ -26,114 +26,114 @@ /* Interface IDs defined in [MS-RDPEV]. There's no constant names in the MS documentation, so we create them on our own. */ -#define TSMF_INTERFACE_DEFAULT 0x00000000 -#define TSMF_INTERFACE_CLIENT_NOTIFICATIONS 0x00000001 -#define TSMF_INTERFACE_CAPABILITIES 0x00000002 +#define TSMF_INTERFACE_DEFAULT 0x00000000 +#define TSMF_INTERFACE_CLIENT_NOTIFICATIONS 0x00000001 +#define TSMF_INTERFACE_CAPABILITIES 0x00000002 /* Interface ID Mask */ -#define STREAM_ID_STUB 0x80000000 -#define STREAM_ID_PROXY 0x40000000 -#define STREAM_ID_NONE 0x00000000 +#define STREAM_ID_STUB 0x80000000 +#define STREAM_ID_PROXY 0x40000000 +#define STREAM_ID_NONE 0x00000000 /* Functon ID */ /* Common IDs for all interfaces are as follows. */ -#define RIMCALL_RELEASE 0x00000001 -#define RIMCALL_QUERYINTERFACE 0x00000002 +#define RIMCALL_RELEASE 0x00000001 +#define RIMCALL_QUERYINTERFACE 0x00000002 /* Capabilities Negotiator Interface IDs are as follows. */ -#define RIM_EXCHANGE_CAPABILITY_REQUEST 0x00000100 +#define RIM_EXCHANGE_CAPABILITY_REQUEST 0x00000100 /* The Client Notifications Interface ID is as follows. */ -#define PLAYBACK_ACK 0x00000100 -#define CLIENT_EVENT_NOTIFICATION 0x00000101 +#define PLAYBACK_ACK 0x00000100 +#define CLIENT_EVENT_NOTIFICATION 0x00000101 /* Server Data Interface IDs are as follows. */ -#define EXCHANGE_CAPABILITIES_REQ 0x00000100 -#define SET_CHANNEL_PARAMS 0x00000101 -#define ADD_STREAM 0x00000102 -#define ON_SAMPLE 0x00000103 -#define SET_VIDEO_WINDOW 0x00000104 -#define ON_NEW_PRESENTATION 0x00000105 -#define SHUTDOWN_PRESENTATION_REQ 0x00000106 -#define SET_TOPOLOGY_REQ 0x00000107 -#define CHECK_FORMAT_SUPPORT_REQ 0x00000108 -#define ON_PLAYBACK_STARTED 0x00000109 -#define ON_PLAYBACK_PAUSED 0x0000010a -#define ON_PLAYBACK_STOPPED 0x0000010b -#define ON_PLAYBACK_RESTARTED 0x0000010c -#define ON_PLAYBACK_RATE_CHANGED 0x0000010d -#define ON_FLUSH 0x0000010e -#define ON_STREAM_VOLUME 0x0000010f -#define ON_CHANNEL_VOLUME 0x00000110 -#define ON_END_OF_STREAM 0x00000111 -#define SET_ALLOCATOR 0x00000112 -#define NOTIFY_PREROLL 0x00000113 -#define UPDATE_GEOMETRY_INFO 0x00000114 -#define REMOVE_STREAM 0x00000115 -#define SET_SOURCE_VIDEO_RECT 0x00000116 +#define EXCHANGE_CAPABILITIES_REQ 0x00000100 +#define SET_CHANNEL_PARAMS 0x00000101 +#define ADD_STREAM 0x00000102 +#define ON_SAMPLE 0x00000103 +#define SET_VIDEO_WINDOW 0x00000104 +#define ON_NEW_PRESENTATION 0x00000105 +#define SHUTDOWN_PRESENTATION_REQ 0x00000106 +#define SET_TOPOLOGY_REQ 0x00000107 +#define CHECK_FORMAT_SUPPORT_REQ 0x00000108 +#define ON_PLAYBACK_STARTED 0x00000109 +#define ON_PLAYBACK_PAUSED 0x0000010a +#define ON_PLAYBACK_STOPPED 0x0000010b +#define ON_PLAYBACK_RESTARTED 0x0000010c +#define ON_PLAYBACK_RATE_CHANGED 0x0000010d +#define ON_FLUSH 0x0000010e +#define ON_STREAM_VOLUME 0x0000010f +#define ON_CHANNEL_VOLUME 0x00000110 +#define ON_END_OF_STREAM 0x00000111 +#define SET_ALLOCATOR 0x00000112 +#define NOTIFY_PREROLL 0x00000113 +#define UPDATE_GEOMETRY_INFO 0x00000114 +#define REMOVE_STREAM 0x00000115 +#define SET_SOURCE_VIDEO_RECT 0x00000116 /* Supported platform */ -#define MMREDIR_CAPABILITY_PLATFORM_MF 0x00000001 -#define MMREDIR_CAPABILITY_PLATFORM_DSHOW 0x00000002 -#define MMREDIR_CAPABILITY_PLATFORM_OTHER 0x00000004 +#define MMREDIR_CAPABILITY_PLATFORM_MF 0x00000001 +#define MMREDIR_CAPABILITY_PLATFORM_DSHOW 0x00000002 +#define MMREDIR_CAPABILITY_PLATFORM_OTHER 0x00000004 /* TSMM_CLIENT_EVENT Constants */ -#define TSMM_CLIENT_EVENT_ENDOFSTREAM 0x0064 -#define TSMM_CLIENT_EVENT_STOP_COMPLETED 0x00C8 -#define TSMM_CLIENT_EVENT_START_COMPLETED 0x00C9 -#define TSMM_CLIENT_EVENT_MONITORCHANGED 0x012C +#define TSMM_CLIENT_EVENT_ENDOFSTREAM 0x0064 +#define TSMM_CLIENT_EVENT_STOP_COMPLETED 0x00C8 +#define TSMM_CLIENT_EVENT_START_COMPLETED 0x00C9 +#define TSMM_CLIENT_EVENT_MONITORCHANGED 0x012C /* TS_MM_DATA_SAMPLE.SampleExtensions */ -#define TSMM_SAMPLE_EXT_CLEANPOINT 0x00000001 -#define TSMM_SAMPLE_EXT_DISCONTINUITY 0x00000002 -#define TSMM_SAMPLE_EXT_INTERLACED 0x00000004 -#define TSMM_SAMPLE_EXT_BOTTOMFIELDFIRST 0x00000008 -#define TSMM_SAMPLE_EXT_REPEATFIELDFIRST 0x00000010 -#define TSMM_SAMPLE_EXT_SINGLEFIELD 0x00000020 +#define TSMM_SAMPLE_EXT_CLEANPOINT 0x00000001 +#define TSMM_SAMPLE_EXT_DISCONTINUITY 0x00000002 +#define TSMM_SAMPLE_EXT_INTERLACED 0x00000004 +#define TSMM_SAMPLE_EXT_BOTTOMFIELDFIRST 0x00000008 +#define TSMM_SAMPLE_EXT_REPEATFIELDFIRST 0x00000010 +#define TSMM_SAMPLE_EXT_SINGLEFIELD 0x00000020 #define TSMM_SAMPLE_EXT_DERIVEDFROMTOPFIELD 0x00000040 -#define TSMM_SAMPLE_EXT_HAS_NO_TIMESTAMPS 0x00000080 +#define TSMM_SAMPLE_EXT_HAS_NO_TIMESTAMPS 0x00000080 #define TSMM_SAMPLE_EXT_RELATIVE_TIMESTAMPS 0x00000100 #define TSMM_SAMPLE_EXT_ABSOLUTE_TIMESTAMPS 0x00000200 /* MajorType */ -#define TSMF_MAJOR_TYPE_UNKNOWN 0 -#define TSMF_MAJOR_TYPE_VIDEO 1 -#define TSMF_MAJOR_TYPE_AUDIO 2 +#define TSMF_MAJOR_TYPE_UNKNOWN 0 +#define TSMF_MAJOR_TYPE_VIDEO 1 +#define TSMF_MAJOR_TYPE_AUDIO 2 /* SubType */ -#define TSMF_SUB_TYPE_UNKNOWN 0 -#define TSMF_SUB_TYPE_WVC1 1 -#define TSMF_SUB_TYPE_WMA2 2 -#define TSMF_SUB_TYPE_WMA9 3 -#define TSMF_SUB_TYPE_MP3 4 -#define TSMF_SUB_TYPE_MP2A 5 -#define TSMF_SUB_TYPE_MP2V 6 -#define TSMF_SUB_TYPE_WMV3 7 -#define TSMF_SUB_TYPE_AAC 8 -#define TSMF_SUB_TYPE_H264 9 -#define TSMF_SUB_TYPE_AVC1 10 -#define TSMF_SUB_TYPE_AC3 11 -#define TSMF_SUB_TYPE_WMV2 12 -#define TSMF_SUB_TYPE_WMV1 13 -#define TSMF_SUB_TYPE_MP1V 14 -#define TSMF_SUB_TYPE_MP1A 15 -#define TSMF_SUB_TYPE_YUY2 16 -#define TSMF_SUB_TYPE_MP43 17 -#define TSMF_SUB_TYPE_MP4S 18 -#define TSMF_SUB_TYPE_MP42 19 -#define TSMF_SUB_TYPE_OGG 20 -#define TSMF_SUB_TYPE_SPEEX 21 -#define TSMF_SUB_TYPE_THEORA 22 -#define TSMF_SUB_TYPE_FLAC 23 -#define TSMF_SUB_TYPE_VP8 24 -#define TSMF_SUB_TYPE_VP9 25 -#define TSMF_SUB_TYPE_H263 26 -#define TSMF_SUB_TYPE_M4S2 27 -#define TSMF_SUB_TYPE_WMA1 28 +#define TSMF_SUB_TYPE_UNKNOWN 0 +#define TSMF_SUB_TYPE_WVC1 1 +#define TSMF_SUB_TYPE_WMA2 2 +#define TSMF_SUB_TYPE_WMA9 3 +#define TSMF_SUB_TYPE_MP3 4 +#define TSMF_SUB_TYPE_MP2A 5 +#define TSMF_SUB_TYPE_MP2V 6 +#define TSMF_SUB_TYPE_WMV3 7 +#define TSMF_SUB_TYPE_AAC 8 +#define TSMF_SUB_TYPE_H264 9 +#define TSMF_SUB_TYPE_AVC1 10 +#define TSMF_SUB_TYPE_AC3 11 +#define TSMF_SUB_TYPE_WMV2 12 +#define TSMF_SUB_TYPE_WMV1 13 +#define TSMF_SUB_TYPE_MP1V 14 +#define TSMF_SUB_TYPE_MP1A 15 +#define TSMF_SUB_TYPE_YUY2 16 +#define TSMF_SUB_TYPE_MP43 17 +#define TSMF_SUB_TYPE_MP4S 18 +#define TSMF_SUB_TYPE_MP42 19 +#define TSMF_SUB_TYPE_OGG 20 +#define TSMF_SUB_TYPE_SPEEX 21 +#define TSMF_SUB_TYPE_THEORA 22 +#define TSMF_SUB_TYPE_FLAC 23 +#define TSMF_SUB_TYPE_VP8 24 +#define TSMF_SUB_TYPE_VP9 25 +#define TSMF_SUB_TYPE_H263 26 +#define TSMF_SUB_TYPE_M4S2 27 +#define TSMF_SUB_TYPE_WMA1 28 /* FormatType */ -#define TSMF_FORMAT_TYPE_UNKNOWN 0 -#define TSMF_FORMAT_TYPE_MFVIDEOFORMAT 1 -#define TSMF_FORMAT_TYPE_WAVEFORMATEX 2 -#define TSMF_FORMAT_TYPE_MPEG2VIDEOINFO 3 -#define TSMF_FORMAT_TYPE_VIDEOINFO2 4 -#define TSMF_FORMAT_TYPE_MPEG1VIDEOINFO 5 +#define TSMF_FORMAT_TYPE_UNKNOWN 0 +#define TSMF_FORMAT_TYPE_MFVIDEOFORMAT 1 +#define TSMF_FORMAT_TYPE_WAVEFORMATEX 2 +#define TSMF_FORMAT_TYPE_MPEG2VIDEOINFO 3 +#define TSMF_FORMAT_TYPE_VIDEOINFO2 4 +#define TSMF_FORMAT_TYPE_MPEG1VIDEOINFO 5 #endif /* FREERDP_CHANNEL_TSMF_CLIENT_CONSTANTS_H */ diff --git a/channels/tsmf/client/tsmf_decoder.c b/channels/tsmf/client/tsmf_decoder.c index 5e8411462..c59b0f61d 100644 --- a/channels/tsmf/client/tsmf_decoder.c +++ b/channels/tsmf/client/tsmf_decoder.c @@ -32,12 +32,12 @@ #include "tsmf_constants.h" #include "tsmf_decoder.h" -static ITSMFDecoder* tsmf_load_decoder_by_name(const char *name) +static ITSMFDecoder* tsmf_load_decoder_by_name(const char* name) { ITSMFDecoder* decoder; TSMF_DECODER_ENTRY entry; - entry = (TSMF_DECODER_ENTRY) (void*)freerdp_load_channel_addin_entry("tsmf", name, "decoder", 0); + entry = (TSMF_DECODER_ENTRY)(void*)freerdp_load_channel_addin_entry("tsmf", name, "decoder", 0); if (!entry) return NULL; @@ -53,7 +53,7 @@ static ITSMFDecoder* tsmf_load_decoder_by_name(const char *name) return decoder; } -static BOOL tsmf_decoder_set_format(ITSMFDecoder *decoder, TS_AM_MEDIA_TYPE* media_type) +static BOOL tsmf_decoder_set_format(ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* media_type) { if (decoder->SetFormat(decoder, media_type)) return TRUE; @@ -102,8 +102,8 @@ BOOL tsmf_check_decoder_available(const char* name) decoder = tsmf_load_decoder_by_name(name); } #if defined(WITH_GSTREAMER_1_0) || defined(WITH_GSTREAMER_0_10) - if (!decoder) - decoder = tsmf_load_decoder_by_name("gstreamer"); + if (!decoder) + decoder = tsmf_load_decoder_by_name("gstreamer"); #endif #if defined(WITH_FFMPEG) @@ -120,4 +120,3 @@ BOOL tsmf_check_decoder_available(const char* name) return retValue; } - diff --git a/channels/tsmf/client/tsmf_decoder.h b/channels/tsmf/client/tsmf_decoder.h index a12e8ceeb..9a16faffe 100644 --- a/channels/tsmf/client/tsmf_decoder.h +++ b/channels/tsmf/client/tsmf_decoder.h @@ -36,40 +36,43 @@ typedef struct _ITSMFDecoder ITSMFDecoder; struct _ITSMFDecoder { /* Set the decoder format. Return true if supported. */ - BOOL (*SetFormat)(ITSMFDecoder *decoder, TS_AM_MEDIA_TYPE *media_type); + BOOL (*SetFormat)(ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* media_type); /* Decode a sample. */ - BOOL (*Decode)(ITSMFDecoder *decoder, const BYTE *data, UINT32 data_size, UINT32 extensions); + BOOL (*Decode)(ITSMFDecoder* decoder, const BYTE* data, UINT32 data_size, UINT32 extensions); /* Get the decoded data */ - BYTE *(*GetDecodedData)(ITSMFDecoder *decoder, UINT32 *size); + BYTE* (*GetDecodedData)(ITSMFDecoder* decoder, UINT32* size); /* Get the pixel format of decoded video frame */ - UINT32(*GetDecodedFormat)(ITSMFDecoder *decoder); + UINT32 (*GetDecodedFormat)(ITSMFDecoder* decoder); /* Get the width and height of decoded video frame */ - BOOL (*GetDecodedDimension)(ITSMFDecoder *decoder, UINT32 *width, UINT32 *height); + BOOL (*GetDecodedDimension)(ITSMFDecoder* decoder, UINT32* width, UINT32* height); /* Free the decoder */ - void (*Free)(ITSMFDecoder *decoder); + void (*Free)(ITSMFDecoder* decoder); /* Optional Contol function */ - BOOL (*Control)(ITSMFDecoder *decoder, ITSMFControlMsg control_msg, UINT32 *arg); + BOOL (*Control)(ITSMFDecoder* decoder, ITSMFControlMsg control_msg, UINT32* arg); /* Decode a sample with extended interface. */ - BOOL (*DecodeEx)(ITSMFDecoder *decoder, const BYTE *data, UINT32 data_size, UINT32 extensions, - UINT64 start_time, UINT64 end_time, UINT64 duration); + BOOL(*DecodeEx) + (ITSMFDecoder* decoder, const BYTE* data, UINT32 data_size, UINT32 extensions, + UINT64 start_time, UINT64 end_time, UINT64 duration); /* Get current play time */ - UINT64(*GetRunningTime)(ITSMFDecoder *decoder); + UINT64 (*GetRunningTime)(ITSMFDecoder* decoder); /* Update Gstreamer Rendering Area */ - BOOL (*UpdateRenderingArea)(ITSMFDecoder *decoder, int newX, int newY, int newWidth, int newHeight, int numRectangles, RDP_RECT *rectangles); + BOOL(*UpdateRenderingArea) + (ITSMFDecoder* decoder, int newX, int newY, int newWidth, int newHeight, int numRectangles, + RDP_RECT* rectangles); /* Change Gstreamer Audio Volume */ - BOOL (*ChangeVolume)(ITSMFDecoder *decoder, UINT32 newVolume, UINT32 muted); + BOOL (*ChangeVolume)(ITSMFDecoder* decoder, UINT32 newVolume, UINT32 muted); /* Check buffer level */ - BOOL (*BufferLevel)(ITSMFDecoder *decoder); + BOOL (*BufferLevel)(ITSMFDecoder* decoder); /* Register a callback for frame ack. */ - BOOL (*SetAckFunc)(ITSMFDecoder *decoder, BOOL (*cb)(void *,BOOL), void *stream); + BOOL (*SetAckFunc)(ITSMFDecoder* decoder, BOOL (*cb)(void*, BOOL), void* stream); /* Register a callback for stream seek detection. */ - BOOL (*SetSyncFunc)(ITSMFDecoder *decoder, void (*cb)(void *), void *stream); + BOOL (*SetSyncFunc)(ITSMFDecoder* decoder, void (*cb)(void*), void* stream); }; #define TSMF_DECODER_EXPORT_FUNC_NAME "TSMFDecoderEntry" -typedef ITSMFDecoder *(*TSMF_DECODER_ENTRY)(void); +typedef ITSMFDecoder* (*TSMF_DECODER_ENTRY)(void); -ITSMFDecoder *tsmf_load_decoder(const char *name, TS_AM_MEDIA_TYPE *media_type); +ITSMFDecoder* tsmf_load_decoder(const char* name, TS_AM_MEDIA_TYPE* media_type); BOOL tsmf_check_decoder_available(const char* name); #endif /* FREERDP_CHANNEL_TSMF_CLIENT_DECODER_H */ diff --git a/channels/tsmf/client/tsmf_ifman.c b/channels/tsmf/client/tsmf_ifman.c index 9fcc620c1..752666d33 100644 --- a/channels/tsmf/client/tsmf_ifman.c +++ b/channels/tsmf/client/tsmf_ifman.c @@ -52,7 +52,7 @@ UINT tsmf_ifman_rim_exchange_capability_request(TSMF_IFMAN* ifman) return ERROR_INVALID_DATA; Stream_Read_UINT32(ifman->input, CapabilityValue); - DEBUG_TSMF("server CapabilityValue %"PRIu32"", CapabilityValue); + DEBUG_TSMF("server CapabilityValue %" PRIu32 "", CapabilityValue); if (!Stream_EnsureRemainingCapacity(ifman->output, 8)) return ERROR_INVALID_DATA; @@ -108,7 +108,7 @@ UINT tsmf_ifman_exchange_capability_request(TSMF_IFMAN* ifman) return ERROR_INVALID_DATA; Stream_Read_UINT32(ifman->output, v); - DEBUG_TSMF("server protocol version %"PRIu32"", v); + DEBUG_TSMF("server protocol version %" PRIu32 "", v); break; case 2: /* Supported platform */ @@ -116,14 +116,14 @@ UINT tsmf_ifman_exchange_capability_request(TSMF_IFMAN* ifman) return ERROR_INVALID_DATA; Stream_Peek_UINT32(ifman->output, v); - DEBUG_TSMF("server supported platform %"PRIu32"", v); + DEBUG_TSMF("server supported platform %" PRIu32 "", v); /* Claim that we support both MF and DShow platforms. */ - Stream_Write_UINT32(ifman->output, - MMREDIR_CAPABILITY_PLATFORM_MF | MMREDIR_CAPABILITY_PLATFORM_DSHOW); + Stream_Write_UINT32(ifman->output, MMREDIR_CAPABILITY_PLATFORM_MF | + MMREDIR_CAPABILITY_PLATFORM_DSHOW); break; default: - WLog_ERR(TAG, "skipping unknown capability type %"PRIu32"", CapabilityType); + WLog_ERR(TAG, "skipping unknown capability type %" PRIu32 "", CapabilityType); break; } @@ -152,7 +152,7 @@ UINT tsmf_ifman_check_format_support_request(TSMF_IFMAN* ifman) Stream_Read_UINT32(ifman->input, PlatformCookie); Stream_Seek_UINT32(ifman->input); /* NoRolloverFlags (4 bytes) */ Stream_Read_UINT32(ifman->input, numMediaType); - DEBUG_TSMF("PlatformCookie %"PRIu32" numMediaType %"PRIu32"", PlatformCookie, numMediaType); + DEBUG_TSMF("PlatformCookie %" PRIu32 " numMediaType %" PRIu32 "", PlatformCookie, numMediaType); if (!tsmf_codec_check_media_type(ifman->decoder_name, ifman->input)) FormatSupported = 0; @@ -343,12 +343,12 @@ UINT tsmf_ifman_set_source_video_rect(TSMF_IFMAN* ifman) } else { - Left = tsmf_stream_read_float(ifman->input); /* Left (4 bytes) */ - Top = tsmf_stream_read_float(ifman->input); /* Top (4 bytes) */ - Right = tsmf_stream_read_float(ifman->input); /* Right (4 bytes) */ + Left = tsmf_stream_read_float(ifman->input); /* Left (4 bytes) */ + Top = tsmf_stream_read_float(ifman->input); /* Top (4 bytes) */ + Right = tsmf_stream_read_float(ifman->input); /* Right (4 bytes) */ Bottom = tsmf_stream_read_float(ifman->input); /* Bottom (4 bytes) */ - DEBUG_TSMF("SetSourceVideoRect: Left: %f Top: %f Right: %f Bottom: %f", - Left, Top, Right, Bottom); + DEBUG_TSMF("SetSourceVideoRect: Left: %f Top: %f Right: %f Bottom: %f", Left, Top, Right, + Bottom); } ifman->output_pending = TRUE; @@ -411,9 +411,9 @@ UINT tsmf_ifman_on_stream_volume(TSMF_IFMAN* ifman) Stream_Seek(ifman->input, 16); Stream_Read_UINT32(ifman->input, newVolume); - DEBUG_TSMF("on stream volume: new volume=[%"PRIu32"]", newVolume); + DEBUG_TSMF("on stream volume: new volume=[%" PRIu32 "]", newVolume); Stream_Read_UINT32(ifman->input, muted); - DEBUG_TSMF("on stream volume: muted=[%"PRIu32"]", muted); + DEBUG_TSMF("on stream volume: muted=[%" PRIu32 "]", muted); if (!tsmf_presentation_volume_changed(presentation, newVolume, muted)) return ERROR_INVALID_OPERATION; @@ -443,9 +443,9 @@ UINT tsmf_ifman_on_channel_volume(TSMF_IFMAN* ifman) UINT32 changedChannel; Stream_Seek(ifman->input, 16); Stream_Read_UINT32(ifman->input, channelVolume); - DEBUG_TSMF("on channel volume: channel volume=[%"PRIu32"]", channelVolume); + DEBUG_TSMF("on channel volume: channel volume=[%" PRIu32 "]", channelVolume); Stream_Read_UINT32(ifman->input, changedChannel); - DEBUG_TSMF("on stream volume: changed channel=[%"PRIu32"]", changedChannel); + DEBUG_TSMF("on stream volume: changed channel=[%" PRIu32 "]", changedChannel); } ifman->output_pending = TRUE; @@ -503,12 +503,13 @@ UINT tsmf_ifman_update_geometry_info(TSMF_IFMAN* ifman) Stream_SetPosition(ifman->input, pos + numGeometryInfo); Stream_Read_UINT32(ifman->input, cbVisibleRect); num_rects = cbVisibleRect / 16; - DEBUG_TSMF("numGeometryInfo %"PRIu32" Width %"PRIu32" Height %"PRIu32" Left %"PRIu32" Top %"PRIu32" cbVisibleRect %"PRIu32" num_rects %d", + DEBUG_TSMF("numGeometryInfo %" PRIu32 " Width %" PRIu32 " Height %" PRIu32 " Left %" PRIu32 + " Top %" PRIu32 " cbVisibleRect %" PRIu32 " num_rects %d", numGeometryInfo, Width, Height, Left, Top, cbVisibleRect, num_rects); if (num_rects > 0) { - rects = (RDP_RECT*) calloc(num_rects, sizeof(RDP_RECT)); + rects = (RDP_RECT*)calloc(num_rects, sizeof(RDP_RECT)); for (i = 0; i < num_rects; i++) { @@ -522,12 +523,13 @@ UINT tsmf_ifman_update_geometry_info(TSMF_IFMAN* ifman) Stream_Seek_UINT16(ifman->input); rects[i].width -= rects[i].x; rects[i].height -= rects[i].y; - DEBUG_TSMF("rect %d: %"PRId16" %"PRId16" %"PRId16" %"PRId16"", i, - rects[i].x, rects[i].y, rects[i].width, rects[i].height); + DEBUG_TSMF("rect %d: %" PRId16 " %" PRId16 " %" PRId16 " %" PRId16 "", i, rects[i].x, + rects[i].y, rects[i].width, rects[i].height); } } - if (!tsmf_presentation_set_geometry_info(presentation, Left, Top, Width, Height, num_rects, rects)) + if (!tsmf_presentation_set_geometry_info(presentation, Left, Top, Width, Height, num_rects, + rects)) return ERROR_INVALID_OPERATION; ifman->output_pending = TRUE; @@ -592,10 +594,11 @@ UINT tsmf_ifman_on_sample(TSMF_IFMAN* ifman) if (Stream_GetRemainingLength(ifman->input) < cbData) return ERROR_INVALID_DATA; - DEBUG_TSMF("MessageId %"PRIu32" StreamId %"PRIu32" SampleStartTime %"PRIu64" SampleEndTime %"PRIu64" " - "ThrottleDuration %"PRIu64" SampleExtensions %"PRIu32" cbData %"PRIu32"", - ifman->message_id, StreamId, SampleStartTime, SampleEndTime, - ThrottleDuration, SampleExtensions, cbData); + DEBUG_TSMF("MessageId %" PRIu32 " StreamId %" PRIu32 " SampleStartTime %" PRIu64 + " SampleEndTime %" PRIu64 " " + "ThrottleDuration %" PRIu64 " SampleExtensions %" PRIu32 " cbData %" PRIu32 "", + ifman->message_id, StreamId, SampleStartTime, SampleEndTime, ThrottleDuration, + SampleExtensions, cbData); presentation = tsmf_presentation_find_by_id(ifman->presentation_id); if (!presentation) @@ -612,9 +615,9 @@ UINT tsmf_ifman_on_sample(TSMF_IFMAN* ifman) return ERROR_NOT_FOUND; } - if (!tsmf_stream_push_sample(stream, ifman->channel_callback, - ifman->message_id, SampleStartTime, SampleEndTime, - ThrottleDuration, SampleExtensions, cbData, Stream_Pointer(ifman->input))) + if (!tsmf_stream_push_sample(stream, ifman->channel_callback, ifman->message_id, + SampleStartTime, SampleEndTime, ThrottleDuration, SampleExtensions, + cbData, Stream_Pointer(ifman->input))) { WLog_ERR(TAG, "unable to push sample"); return ERROR_OUTOFMEMORY; @@ -622,7 +625,7 @@ UINT tsmf_ifman_on_sample(TSMF_IFMAN* ifman) if ((error = tsmf_presentation_sync(presentation))) { - WLog_ERR(TAG, "tsmf_presentation_sync failed with error %"PRIu32"", error); + WLog_ERR(TAG, "tsmf_presentation_sync failed with error %" PRIu32 "", error); return error; } @@ -646,7 +649,7 @@ UINT tsmf_ifman_on_flush(TSMF_IFMAN* ifman) Stream_Seek(ifman->input, 16); Stream_Read_UINT32(ifman->input, StreamId); - DEBUG_TSMF("StreamId %"PRIu32"", StreamId); + DEBUG_TSMF("StreamId %" PRIu32 "", StreamId); presentation = tsmf_presentation_find_by_id(ifman->presentation_id); if (!presentation) @@ -698,7 +701,7 @@ UINT tsmf_ifman_on_end_of_stream(TSMF_IFMAN* ifman) tsmf_stream_end(stream, ifman->message_id, ifman->channel_callback); } - DEBUG_TSMF("StreamId %"PRIu32"", StreamId); + DEBUG_TSMF("StreamId %" PRIu32 "", StreamId); ifman->output_pending = TRUE; ifman->output_interface_id = TSMF_INTERFACE_CLIENT_NOTIFICATIONS | STREAM_ID_PROXY; return CHANNEL_RC_OK; @@ -727,10 +730,10 @@ UINT tsmf_ifman_on_playback_started(TSMF_IFMAN* ifman) if (!Stream_EnsureRemainingCapacity(ifman->output, 16)) return ERROR_OUTOFMEMORY; - Stream_Write_UINT32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */ - Stream_Write_UINT32(ifman->output, 0); /* StreamId */ + Stream_Write_UINT32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */ + Stream_Write_UINT32(ifman->output, 0); /* StreamId */ Stream_Write_UINT32(ifman->output, TSMM_CLIENT_EVENT_START_COMPLETED); /* EventId */ - Stream_Write_UINT32(ifman->output, 0); /* cbData */ + Stream_Write_UINT32(ifman->output, 0); /* cbData */ ifman->output_interface_id = TSMF_INTERFACE_CLIENT_NOTIFICATIONS | STREAM_ID_PROXY; return CHANNEL_RC_OK; } @@ -805,10 +808,10 @@ UINT tsmf_ifman_on_playback_stopped(TSMF_IFMAN* ifman) if (!Stream_EnsureRemainingCapacity(ifman->output, 16)) return ERROR_OUTOFMEMORY; - Stream_Write_UINT32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */ - Stream_Write_UINT32(ifman->output, 0); /* StreamId */ + Stream_Write_UINT32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */ + Stream_Write_UINT32(ifman->output, 0); /* StreamId */ Stream_Write_UINT32(ifman->output, TSMM_CLIENT_EVENT_STOP_COMPLETED); /* EventId */ - Stream_Write_UINT32(ifman->output, 0); /* cbData */ + Stream_Write_UINT32(ifman->output, 0); /* cbData */ ifman->output_interface_id = TSMF_INTERFACE_CLIENT_NOTIFICATIONS | STREAM_ID_PROXY; return CHANNEL_RC_OK; } @@ -825,10 +828,10 @@ UINT tsmf_ifman_on_playback_rate_changed(TSMF_IFMAN* ifman) if (!Stream_EnsureRemainingCapacity(ifman->output, 16)) return ERROR_OUTOFMEMORY; - Stream_Write_UINT32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */ - Stream_Write_UINT32(ifman->output, 0); /* StreamId */ + Stream_Write_UINT32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */ + Stream_Write_UINT32(ifman->output, 0); /* StreamId */ Stream_Write_UINT32(ifman->output, TSMM_CLIENT_EVENT_MONITORCHANGED); /* EventId */ - Stream_Write_UINT32(ifman->output, 0); /* cbData */ + Stream_Write_UINT32(ifman->output, 0); /* cbData */ ifman->output_interface_id = TSMF_INTERFACE_CLIENT_NOTIFICATIONS | STREAM_ID_PROXY; return CHANNEL_RC_OK; } diff --git a/channels/tsmf/client/tsmf_ifman.h b/channels/tsmf/client/tsmf_ifman.h index b6986205a..3830f5b49 100644 --- a/channels/tsmf/client/tsmf_ifman.h +++ b/channels/tsmf/client/tsmf_ifman.h @@ -67,4 +67,3 @@ UINT tsmf_ifman_on_playback_stopped(TSMF_IFMAN* ifman); UINT tsmf_ifman_on_playback_rate_changed(TSMF_IFMAN* ifman); #endif /* FREERDP_CHANNEL_TSMF_CLIENT_IFMAN_H */ - diff --git a/channels/tsmf/client/tsmf_main.c b/channels/tsmf/client/tsmf_main.c index 8f7902da1..ec281ea11 100644 --- a/channels/tsmf/client/tsmf_main.c +++ b/channels/tsmf/client/tsmf_main.c @@ -40,7 +40,7 @@ BOOL tsmf_send_eos_response(IWTSVirtualChannelCallback* pChannelCallback, UINT32 { wStream* s = NULL; int status = -1; - TSMF_CHANNEL_CALLBACK* callback = (TSMF_CHANNEL_CALLBACK*) pChannelCallback; + TSMF_CHANNEL_CALLBACK* callback = (TSMF_CHANNEL_CALLBACK*)pChannelCallback; if (!callback) { @@ -57,12 +57,13 @@ BOOL tsmf_send_eos_response(IWTSVirtualChannelCallback* pChannelCallback, UINT32 Stream_Write_UINT32(s, TSMF_INTERFACE_CLIENT_NOTIFICATIONS | STREAM_ID_PROXY); Stream_Write_UINT32(s, message_id); - Stream_Write_UINT32(s, CLIENT_EVENT_NOTIFICATION); /* FunctionId */ - Stream_Write_UINT32(s, callback->stream_id); /* StreamId */ + Stream_Write_UINT32(s, CLIENT_EVENT_NOTIFICATION); /* FunctionId */ + Stream_Write_UINT32(s, callback->stream_id); /* StreamId */ Stream_Write_UINT32(s, TSMM_CLIENT_EVENT_ENDOFSTREAM); /* EventId */ - Stream_Write_UINT32(s, 0); /* cbData */ - DEBUG_TSMF("EOS response size %"PRIuz"", Stream_GetPosition(s)); - status = callback->channel->Write(callback->channel, Stream_GetPosition(s), Stream_Buffer(s), NULL); + Stream_Write_UINT32(s, 0); /* cbData */ + DEBUG_TSMF("EOS response size %" PRIuz "", Stream_GetPosition(s)); + status = callback->channel->Write(callback->channel, Stream_GetPosition(s), + Stream_Buffer(s), NULL); if (status) { @@ -75,12 +76,12 @@ BOOL tsmf_send_eos_response(IWTSVirtualChannelCallback* pChannelCallback, UINT32 return (status == 0); } -BOOL tsmf_playback_ack(IWTSVirtualChannelCallback* pChannelCallback, - UINT32 message_id, UINT64 duration, UINT32 data_size) +BOOL tsmf_playback_ack(IWTSVirtualChannelCallback* pChannelCallback, UINT32 message_id, + UINT64 duration, UINT32 data_size) { wStream* s = NULL; int status = -1; - TSMF_CHANNEL_CALLBACK* callback = (TSMF_CHANNEL_CALLBACK*) pChannelCallback; + TSMF_CHANNEL_CALLBACK* callback = (TSMF_CHANNEL_CALLBACK*)pChannelCallback; if (!callback) return FALSE; @@ -92,11 +93,11 @@ BOOL tsmf_playback_ack(IWTSVirtualChannelCallback* pChannelCallback, Stream_Write_UINT32(s, TSMF_INTERFACE_CLIENT_NOTIFICATIONS | STREAM_ID_PROXY); Stream_Write_UINT32(s, message_id); - Stream_Write_UINT32(s, PLAYBACK_ACK); /* FunctionId */ + Stream_Write_UINT32(s, PLAYBACK_ACK); /* FunctionId */ Stream_Write_UINT32(s, callback->stream_id); /* StreamId */ - Stream_Write_UINT64(s, duration); /* DataDuration */ - Stream_Write_UINT64(s, data_size); /* cbData */ - DEBUG_TSMF("ACK response size %"PRIuz"", Stream_GetPosition(s)); + Stream_Write_UINT64(s, duration); /* DataDuration */ + Stream_Write_UINT64(s, data_size); /* cbData */ + DEBUG_TSMF("ACK response size %" PRIuz "", Stream_GetPosition(s)); if (!callback->channel || !callback->channel->Write) { @@ -106,8 +107,8 @@ BOOL tsmf_playback_ack(IWTSVirtualChannelCallback* pChannelCallback, } else { - status = callback->channel->Write(callback->channel, - Stream_GetPosition(s), Stream_Buffer(s), NULL); + status = callback->channel->Write(callback->channel, Stream_GetPosition(s), + Stream_Buffer(s), NULL); } if (status) @@ -135,13 +136,13 @@ static UINT tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, UINT32 MessageId; UINT32 FunctionId; UINT32 InterfaceId; - TSMF_CHANNEL_CALLBACK* callback = (TSMF_CHANNEL_CALLBACK*) pChannelCallback; + TSMF_CHANNEL_CALLBACK* callback = (TSMF_CHANNEL_CALLBACK*)pChannelCallback; UINT32 cbSize = Stream_GetRemainingLength(data); /* 2.2.1 Shared Message Header (SHARED_MSG_HEADER) */ if (cbSize < 12) { - WLog_ERR(TAG, "invalid size. cbSize=%"PRIu32"", cbSize); + WLog_ERR(TAG, "invalid size. cbSize=%" PRIu32 "", cbSize); return ERROR_INVALID_DATA; } @@ -153,15 +154,16 @@ static UINT tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, Stream_Seek(output, 8); Stream_Read_UINT32(input, InterfaceId); /* InterfaceId (4 bytes) */ - Stream_Read_UINT32(input, MessageId); /* MessageId (4 bytes) */ - Stream_Read_UINT32(input, FunctionId); /* FunctionId (4 bytes) */ - DEBUG_TSMF("cbSize=%"PRIu32" InterfaceId=0x%"PRIX32" MessageId=0x%"PRIX32" FunctionId=0x%"PRIX32"", + Stream_Read_UINT32(input, MessageId); /* MessageId (4 bytes) */ + Stream_Read_UINT32(input, FunctionId); /* FunctionId (4 bytes) */ + DEBUG_TSMF("cbSize=%" PRIu32 " InterfaceId=0x%" PRIX32 " MessageId=0x%" PRIX32 + " FunctionId=0x%" PRIX32 "", cbSize, InterfaceId, MessageId, FunctionId); ZeroMemory(&ifman, sizeof(TSMF_IFMAN)); ifman.channel_callback = pChannelCallback; - ifman.decoder_name = ((TSMF_PLUGIN*) callback->plugin)->decoder_name; - ifman.audio_name = ((TSMF_PLUGIN*) callback->plugin)->audio_name; - ifman.audio_device = ((TSMF_PLUGIN*) callback->plugin)->audio_device; + ifman.decoder_name = ((TSMF_PLUGIN*)callback->plugin)->decoder_name; + ifman.audio_name = ((TSMF_PLUGIN*)callback->plugin)->audio_name; + ifman.audio_device = ((TSMF_PLUGIN*)callback->plugin)->audio_device; CopyMemory(ifman.presentation_id, callback->presentation_id, GUID_SIZE); ifman.stream_id = callback->stream_id; ifman.message_id = MessageId; @@ -171,7 +173,8 @@ static UINT tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, ifman.output_pending = FALSE; ifman.output_interface_id = InterfaceId; - //fprintf(stderr, "InterfaceId: 0x%08"PRIX32" MessageId: 0x%08"PRIX32" FunctionId: 0x%08"PRIX32"\n", InterfaceId, MessageId, FunctionId); + // fprintf(stderr, "InterfaceId: 0x%08"PRIX32" MessageId: 0x%08"PRIX32" FunctionId: + // 0x%08"PRIX32"\n", InterfaceId, MessageId, FunctionId); switch (InterfaceId) { @@ -206,7 +209,7 @@ static UINT tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, CopyMemory(callback->presentation_id, Stream_Pointer(input), GUID_SIZE); Stream_Seek(input, GUID_SIZE); Stream_Read_UINT32(input, callback->stream_id); - DEBUG_TSMF("SET_CHANNEL_PARAMS StreamId=%"PRIu32"", callback->stream_id); + DEBUG_TSMF("SET_CHANNEL_PARAMS StreamId=%" PRIu32 "", callback->stream_id); ifman.output_pending = TRUE; processed = TRUE; break; @@ -227,7 +230,8 @@ static UINT tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, break; case ADD_STREAM: - error = tsmf_ifman_add_stream(&ifman, ((TSMF_PLUGIN*) callback->plugin)->rdpcontext); + error = + tsmf_ifman_add_stream(&ifman, ((TSMF_PLUGIN*)callback->plugin)->rdpcontext); processed = TRUE; break; @@ -340,7 +344,7 @@ static UINT tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, if (error) { - WLog_ERR(TAG, "ifman data received processing error %"PRIu32"", error); + WLog_ERR(TAG, "ifman data received processing error %" PRIu32 "", error); } if (!processed) @@ -364,7 +368,8 @@ static UINT tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, if (!processed) { WLog_ERR(TAG, - "Unknown InterfaceId: 0x%08"PRIX32" MessageId: 0x%08"PRIX32" FunctionId: 0x%08"PRIX32"\n", + "Unknown InterfaceId: 0x%08" PRIX32 " MessageId: 0x%08" PRIX32 + " FunctionId: 0x%08" PRIX32 "\n", InterfaceId, MessageId, FunctionId); /* When a request is not implemented we return empty response indicating error */ } @@ -384,7 +389,7 @@ static UINT tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, if (error) { - WLog_ERR(TAG, "response error %"PRIu32"", error); + WLog_ERR(TAG, "response error %" PRIu32 "", error); } } @@ -402,7 +407,7 @@ static UINT tsmf_on_close(IWTSVirtualChannelCallback* pChannelCallback) { TSMF_STREAM* stream; TSMF_PRESENTATION* presentation; - TSMF_CHANNEL_CALLBACK* callback = (TSMF_CHANNEL_CALLBACK*) pChannelCallback; + TSMF_CHANNEL_CALLBACK* callback = (TSMF_CHANNEL_CALLBACK*)pChannelCallback; DEBUG_TSMF(""); if (callback->stream_id) @@ -428,15 +433,13 @@ static UINT tsmf_on_close(IWTSVirtualChannelCallback* pChannelCallback) * @return 0 on success, otherwise a Win32 error code */ static UINT tsmf_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, - IWTSVirtualChannel* pChannel, - BYTE* Data, - BOOL* pbAccept, - IWTSVirtualChannelCallback** ppCallback) + IWTSVirtualChannel* pChannel, BYTE* Data, BOOL* pbAccept, + IWTSVirtualChannelCallback** ppCallback) { TSMF_CHANNEL_CALLBACK* callback; - TSMF_LISTENER_CALLBACK* listener_callback = (TSMF_LISTENER_CALLBACK*) pListenerCallback; + TSMF_LISTENER_CALLBACK* listener_callback = (TSMF_LISTENER_CALLBACK*)pListenerCallback; DEBUG_TSMF(""); - callback = (TSMF_CHANNEL_CALLBACK*) calloc(1, sizeof(TSMF_CHANNEL_CALLBACK)); + callback = (TSMF_CHANNEL_CALLBACK*)calloc(1, sizeof(TSMF_CHANNEL_CALLBACK)); if (!callback) return CHANNEL_RC_NO_MEMORY; @@ -447,7 +450,7 @@ static UINT tsmf_on_new_channel_connection(IWTSListenerCallback* pListenerCallba callback->plugin = listener_callback->plugin; callback->channel_mgr = listener_callback->channel_mgr; callback->channel = pChannel; - *ppCallback = (IWTSVirtualChannelCallback*) callback; + *ppCallback = (IWTSVirtualChannelCallback*)callback; return CHANNEL_RC_OK; } @@ -459,9 +462,9 @@ static UINT tsmf_on_new_channel_connection(IWTSListenerCallback* pListenerCallba static UINT tsmf_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) { UINT status; - TSMF_PLUGIN* tsmf = (TSMF_PLUGIN*) pPlugin; + TSMF_PLUGIN* tsmf = (TSMF_PLUGIN*)pPlugin; DEBUG_TSMF(""); - tsmf->listener_callback = (TSMF_LISTENER_CALLBACK*) calloc(1, sizeof(TSMF_LISTENER_CALLBACK)); + tsmf->listener_callback = (TSMF_LISTENER_CALLBACK*)calloc(1, sizeof(TSMF_LISTENER_CALLBACK)); if (!tsmf->listener_callback) return CHANNEL_RC_NO_MEMORY; @@ -469,8 +472,8 @@ static UINT tsmf_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManage tsmf->listener_callback->iface.OnNewChannelConnection = tsmf_on_new_channel_connection; tsmf->listener_callback->plugin = pPlugin; tsmf->listener_callback->channel_mgr = pChannelMgr; - status = pChannelMgr->CreateListener(pChannelMgr, "TSMF", 0, - (IWTSListenerCallback*) tsmf->listener_callback, &(tsmf->listener)); + status = pChannelMgr->CreateListener( + pChannelMgr, "TSMF", 0, (IWTSListenerCallback*)tsmf->listener_callback, &(tsmf->listener)); tsmf->listener->pInterface = tsmf->iface.pInterface; return status; } @@ -482,7 +485,7 @@ static UINT tsmf_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManage */ static UINT tsmf_plugin_terminated(IWTSPlugin* pPlugin) { - TSMF_PLUGIN* tsmf = (TSMF_PLUGIN*) pPlugin; + TSMF_PLUGIN* tsmf = (TSMF_PLUGIN*)pPlugin; DEBUG_TSMF(""); free(tsmf->listener_callback); free(tsmf); @@ -499,17 +502,16 @@ static UINT tsmf_process_addin_args(IWTSPlugin* pPlugin, ADDIN_ARGV* args) int status; DWORD flags; COMMAND_LINE_ARGUMENT_A* arg; - TSMF_PLUGIN* tsmf = (TSMF_PLUGIN*) pPlugin; - COMMAND_LINE_ARGUMENT_A tsmf_args[] = - { - { "sys", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "audio subsystem" }, - { "dev", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "audio device name" }, - { "decoder", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "decoder subsystem" }, - { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } - }; + TSMF_PLUGIN* tsmf = (TSMF_PLUGIN*)pPlugin; + COMMAND_LINE_ARGUMENT_A tsmf_args[] = { { "sys", COMMAND_LINE_VALUE_REQUIRED, "", + NULL, NULL, -1, NULL, "audio subsystem" }, + { "dev", COMMAND_LINE_VALUE_REQUIRED, "", NULL, + NULL, -1, NULL, "audio device name" }, + { "decoder", COMMAND_LINE_VALUE_REQUIRED, "", + NULL, NULL, -1, NULL, "decoder subsystem" }, + { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON; - status = CommandLineParseArgumentsA(args->argc, args->argv, - tsmf_args, flags, tsmf, NULL, NULL); + status = CommandLineParseArgumentsA(args->argc, args->argv, tsmf_args, flags, tsmf, NULL, NULL); if (status != 0) return ERROR_INVALID_DATA; @@ -521,8 +523,7 @@ static UINT tsmf_process_addin_args(IWTSPlugin* pPlugin, ADDIN_ARGV* args) if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "sys") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "sys") { tsmf->audio_name = _strdup(arg->Value); @@ -547,16 +548,15 @@ static UINT tsmf_process_addin_args(IWTSPlugin* pPlugin, ADDIN_ARGV* args) { } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); return CHANNEL_RC_OK; } #ifdef BUILTIN_CHANNELS -#define DVCPluginEntry tsmf_DVCPluginEntry +#define DVCPluginEntry tsmf_DVCPluginEntry #else -#define DVCPluginEntry FREERDP_API DVCPluginEntry +#define DVCPluginEntry FREERDP_API DVCPluginEntry #endif /** @@ -570,11 +570,11 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) TSMF_PLUGIN* tsmf; TsmfClientContext* context; UINT error = CHANNEL_RC_NO_MEMORY; - tsmf = (TSMF_PLUGIN*) pEntryPoints->GetPlugin(pEntryPoints, "tsmf"); + tsmf = (TSMF_PLUGIN*)pEntryPoints->GetPlugin(pEntryPoints, "tsmf"); if (!tsmf) { - tsmf = (TSMF_PLUGIN*) calloc(1, sizeof(TSMF_PLUGIN)); + tsmf = (TSMF_PLUGIN*)calloc(1, sizeof(TSMF_PLUGIN)); if (!tsmf) { @@ -586,9 +586,10 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) tsmf->iface.Connected = NULL; tsmf->iface.Disconnected = NULL; tsmf->iface.Terminated = tsmf_plugin_terminated; - tsmf->rdpcontext = ((freerdp*)((rdpSettings*) pEntryPoints->GetRdpSettings( - pEntryPoints))->instance)->context; - context = (TsmfClientContext*) calloc(1, sizeof(TsmfClientContext)); + tsmf->rdpcontext = + ((freerdp*)((rdpSettings*)pEntryPoints->GetRdpSettings(pEntryPoints))->instance) + ->context; + context = (TsmfClientContext*)calloc(1, sizeof(TsmfClientContext)); if (!context) { @@ -596,8 +597,8 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) goto error_context; } - context->handle = (void*) tsmf; - tsmf->iface.pInterface = (void*) context; + context->handle = (void*)tsmf; + tsmf->iface.pInterface = (void*)context; if (!tsmf_media_init()) { @@ -605,12 +606,13 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) goto error_init; } - status = pEntryPoints->RegisterPlugin(pEntryPoints, "tsmf", (IWTSPlugin*) tsmf); + status = pEntryPoints->RegisterPlugin(pEntryPoints, "tsmf", (IWTSPlugin*)tsmf); } if (status == CHANNEL_RC_OK) { - status = tsmf_process_addin_args((IWTSPlugin*) tsmf, pEntryPoints->GetPluginData(pEntryPoints)); + status = + tsmf_process_addin_args((IWTSPlugin*)tsmf, pEntryPoints->GetPluginData(pEntryPoints)); } return status; diff --git a/channels/tsmf/client/tsmf_main.h b/channels/tsmf/client/tsmf_main.h index 0143d29f3..366215cdb 100644 --- a/channels/tsmf/client/tsmf_main.h +++ b/channels/tsmf/client/tsmf_main.h @@ -65,7 +65,7 @@ struct _TSMF_PLUGIN }; BOOL tsmf_send_eos_response(IWTSVirtualChannelCallback* pChannelCallback, UINT32 message_id); -BOOL tsmf_playback_ack(IWTSVirtualChannelCallback* pChannelCallback, - UINT32 message_id, UINT64 duration, UINT32 data_size); +BOOL tsmf_playback_ack(IWTSVirtualChannelCallback* pChannelCallback, UINT32 message_id, + UINT64 duration, UINT32 data_size); #endif /* FREERDP_CHANNEL_TSMF_CLIENT_MAIN_H */ diff --git a/channels/tsmf/client/tsmf_media.c b/channels/tsmf/client/tsmf_media.c index 0e2072510..b77a3c642 100644 --- a/channels/tsmf/client/tsmf_media.c +++ b/channels/tsmf/client/tsmf_media.c @@ -57,7 +57,7 @@ #define AUDIO_TOLERANCE 10000000LL /* 1 second = 10,000,000 100ns units*/ -#define VIDEO_ADJUST_MAX 10*1000*1000 +#define VIDEO_ADJUST_MAX 10 * 1000 * 1000 #define MAX_ACK_TIME 666667 @@ -194,9 +194,10 @@ static TSMF_SAMPLE* tsmf_stream_pop_sample(TSMF_STREAM* stream, int sync) { if (stream->major_type == TSMF_MAJOR_TYPE_AUDIO) { - /* Check if some other stream has earlier sample that needs to be played first */ - /* Start time is more reliable than end time as some stream types seem to have incorrect - * end times from the server + /* Check if some other stream has earlier sample that needs to be played first + */ + /* Start time is more reliable than end time as some stream types seem to have + * incorrect end times from the server */ if (stream->last_start_time > AUDIO_TOLERANCE) { @@ -205,10 +206,10 @@ static TSMF_SAMPLE* tsmf_stream_pop_sample(TSMF_STREAM* stream, int sync) for (index = 0; index < count; index++) { - s = (TSMF_STREAM*) ArrayList_GetItem(presentation->stream_list, index); + s = (TSMF_STREAM*)ArrayList_GetItem(presentation->stream_list, index); - /* Start time is more reliable than end time as some stream types seem to have incorrect - * end times from the server + /* Start time is more reliable than end time as some stream types seem + * to have incorrect end times from the server */ if (s != stream && !s->eos && s->last_start_time && s->last_start_time < stream->last_start_time - AUDIO_TOLERANCE) @@ -224,8 +225,8 @@ static TSMF_SAMPLE* tsmf_stream_pop_sample(TSMF_STREAM* stream, int sync) } else { - /* Start time is more reliable than end time as some stream types seem to have incorrect - * end times from the server + /* Start time is more reliable than end time as some stream types seem to have + * incorrect end times from the server */ if (stream->last_start_time > presentation->audio_start_time) { @@ -240,16 +241,16 @@ static TSMF_SAMPLE* tsmf_stream_pop_sample(TSMF_STREAM* stream, int sync) if (pending) return NULL; - sample = (TSMF_SAMPLE*) Queue_Dequeue(stream->sample_list); + sample = (TSMF_SAMPLE*)Queue_Dequeue(stream->sample_list); - /* Only update stream last end time if the sample end time is valid and greater than the current stream end time */ - if (sample && (sample->end_time > stream->last_end_time) - && (!sample->invalidTimestamps)) + /* Only update stream last end time if the sample end time is valid and greater than the current + * stream end time */ + if (sample && (sample->end_time > stream->last_end_time) && (!sample->invalidTimestamps)) stream->last_end_time = sample->end_time; - /* Only update stream last start time if the sample start time is valid and greater than the current stream start time */ - if (sample && (sample->start_time > stream->last_start_time) - && (!sample->invalidTimestamps)) + /* Only update stream last start time if the sample start time is valid and greater than the + * current stream start time */ + if (sample && (sample->start_time > stream->last_start_time) && (!sample->invalidTimestamps)) stream->last_start_time = sample->start_time; return sample; @@ -271,8 +272,8 @@ static BOOL tsmf_sample_ack(TSMF_SAMPLE* sample) if (!sample) return FALSE; - return tsmf_playback_ack(sample->channel_callback, sample->sample_id, - sample->duration, sample->data_size); + return tsmf_playback_ack(sample->channel_callback, sample->sample_id, sample->duration, + sample->data_size); } static BOOL tsmf_sample_queue_ack(TSMF_SAMPLE* sample) @@ -300,7 +301,7 @@ static BOOL tsmf_stream_process_ack(void* arg, BOOL force) return TRUE; Queue_Lock(stream->sample_ack_list); - sample = (TSMF_SAMPLE*) Queue_Peek(stream->sample_ack_list); + sample = (TSMF_SAMPLE*)Queue_Peek(stream->sample_ack_list); if (!sample) { @@ -343,14 +344,14 @@ finally: } TSMF_PRESENTATION* tsmf_presentation_new(const BYTE* guid, - IWTSVirtualChannelCallback* pChannelCallback) + IWTSVirtualChannelCallback* pChannelCallback) { TSMF_PRESENTATION* presentation; if (!guid || !pChannelCallback) return NULL; - presentation = (TSMF_PRESENTATION*) calloc(1, sizeof(TSMF_PRESENTATION)); + presentation = (TSMF_PRESENTATION*)calloc(1, sizeof(TSMF_PRESENTATION)); if (!presentation) { @@ -366,8 +367,7 @@ TSMF_PRESENTATION* tsmf_presentation_new(const BYTE* guid, if (!(presentation->stream_list = ArrayList_New(TRUE))) goto error_stream_list; - ArrayList_Object(presentation->stream_list)->fnObjectFree = - _tsmf_stream_free; + ArrayList_Object(presentation->stream_list)->fnObjectFree = _tsmf_stream_free; if (ArrayList_Add(presentation_list, presentation) < 0) goto error_add; @@ -388,7 +388,7 @@ static char* guid_to_string(const BYTE* guid, char* str, size_t len) return NULL; for (i = 0; i < GUID_SIZE && (len > 2 * i); i++) - sprintf_s(str + (2 * i), len - 2 * i, "%02"PRIX8"", guid[i]); + sprintf_s(str + (2 * i), len - 2 * i, "%02" PRIX8 "", guid[i]); return str; } @@ -405,7 +405,7 @@ TSMF_PRESENTATION* tsmf_presentation_find_by_id(const BYTE* guid) for (index = 0; index < count; index++) { - presentation = (TSMF_PRESENTATION*) ArrayList_GetItem(presentation_list, index); + presentation = (TSMF_PRESENTATION*)ArrayList_GetItem(presentation_list, index); if (memcmp(presentation->presentation_id, guid, GUID_SIZE) == 0) { @@ -417,8 +417,8 @@ TSMF_PRESENTATION* tsmf_presentation_find_by_id(const BYTE* guid) ArrayList_Unlock(presentation_list); if (!found) - WLog_WARN(TAG, "presentation id %s not found", guid_to_string(guid, guid_str, - sizeof(guid_str))); + WLog_WARN(TAG, "presentation id %s not found", + guid_to_string(guid, guid_str, sizeof(guid_str))); return (found) ? presentation : NULL; } @@ -429,10 +429,9 @@ static BOOL tsmf_sample_playback_video(TSMF_SAMPLE* sample) TSMF_VIDEO_FRAME_EVENT event; TSMF_STREAM* stream = sample->stream; TSMF_PRESENTATION* presentation = stream->presentation; - TSMF_CHANNEL_CALLBACK* callback = (TSMF_CHANNEL_CALLBACK*) - sample->channel_callback; - TsmfClientContext* tsmf = (TsmfClientContext*) callback->plugin->pInterface; - DEBUG_TSMF("MessageId %"PRIu32" EndTime %"PRIu64" data_size %"PRIu32" consumed.", + TSMF_CHANNEL_CALLBACK* callback = (TSMF_CHANNEL_CALLBACK*)sample->channel_callback; + TsmfClientContext* tsmf = (TsmfClientContext*)callback->plugin->pInterface; + DEBUG_TSMF("MessageId %" PRIu32 " EndTime %" PRIu64 " data_size %" PRIu32 " consumed.", sample->sample_id, sample->end_time, sample->data_size); if (sample->data) @@ -444,8 +443,7 @@ static BOOL tsmf_sample_playback_video(TSMF_SAMPLE* sample) */ if (stream->next_start_time > t && ((sample->start_time >= presentation->audio_start_time) || - ((sample->start_time < stream->last_start_time) - && (!sample->invalidTimestamps)))) + ((sample->start_time < stream->last_start_time) && (!sample->invalidTimestamps)))) { USleep((stream->next_start_time - t) / 10); } @@ -465,7 +463,7 @@ static BOOL tsmf_sample_playback_video(TSMF_SAMPLE* sample) if (presentation->nr_rects > 0) { event.numVisibleRects = presentation->nr_rects; - event.visibleRects = (RECTANGLE_16*) calloc(event.numVisibleRects, sizeof(RECTANGLE_16)); + event.visibleRects = (RECTANGLE_16*)calloc(event.numVisibleRects, sizeof(RECTANGLE_16)); if (!event.visibleRects) { @@ -473,7 +471,8 @@ static BOOL tsmf_sample_playback_video(TSMF_SAMPLE* sample) return FALSE; } - memcpy(event.visibleRects, presentation->rects, presentation->nr_rects * sizeof(RDP_RECT)); + memcpy(event.visibleRects, presentation->rects, + presentation->nr_rects * sizeof(RDP_RECT)); presentation->nr_rects = 0; } @@ -500,7 +499,8 @@ static BOOL tsmf_sample_playback_video(TSMF_SAMPLE* sample) frame_id++; #endif - /* The frame data ownership is passed to the event object, and is freed after the event is processed. */ + /* The frame data ownership is passed to the event object, and is freed after the event is + * processed. */ sample->data = NULL; sample->decoded_size = 0; @@ -521,13 +521,13 @@ static BOOL tsmf_sample_playback_audio(TSMF_SAMPLE* sample) UINT64 latency = 0; TSMF_STREAM* stream = sample->stream; BOOL ret; - DEBUG_TSMF("MessageId %"PRIu32" EndTime %"PRIu64" consumed.", - sample->sample_id, sample->end_time); + DEBUG_TSMF("MessageId %" PRIu32 " EndTime %" PRIu64 " consumed.", sample->sample_id, + sample->end_time); if (stream->audio && sample->data) { - ret = sample->stream->audio->Play(sample->stream->audio, sample->data, - sample->decoded_size); + ret = + sample->stream->audio->Play(sample->stream->audio, sample->data, sample->decoded_size); free(sample->data); sample->data = NULL; sample->decoded_size = 0; @@ -567,9 +567,10 @@ static BOOL tsmf_sample_playback(TSMF_SAMPLE* sample) { if (stream->decoder->DecodeEx) { - /* Try to "sync" video buffers to audio buffers by looking at the running time for each stream - * The difference between the two running times causes an offset between audio and video actual - * render times. So, we try to adjust timestamps on the video buffer to match those on the audio buffer. + /* Try to "sync" video buffers to audio buffers by looking at the running time for each + * stream The difference between the two running times causes an offset between audio + * and video actual render times. So, we try to adjust timestamps on the video buffer to + * match those on the audio buffer. */ if (stream->major_type == TSMF_MAJOR_TYPE_VIDEO) { @@ -582,14 +583,14 @@ static BOOL tsmf_sample_playback(TSMF_SAMPLE* sample) for (index = 0; index < count; index++) { UINT64 time_diff; - temp_stream = (TSMF_STREAM*) ArrayList_GetItem(presentation->stream_list, - index); + temp_stream = (TSMF_STREAM*)ArrayList_GetItem(presentation->stream_list, index); if (temp_stream->major_type == TSMF_MAJOR_TYPE_AUDIO) { - UINT64 video_time = (UINT64) stream->decoder->GetRunningTime(stream->decoder); - UINT64 audio_time = (UINT64) temp_stream->decoder->GetRunningTime( - temp_stream->decoder); + UINT64 video_time = + (UINT64)stream->decoder->GetRunningTime(stream->decoder); + UINT64 audio_time = + (UINT64)temp_stream->decoder->GetRunningTime(temp_stream->decoder); UINT64 max_adjust = VIDEO_ADJUST_MAX; if (video_time < audio_time) @@ -610,9 +611,9 @@ static BOOL tsmf_sample_playback(TSMF_SAMPLE* sample) ArrayList_Unlock(presentation->stream_list); } - ret = stream->decoder->DecodeEx(stream->decoder, sample->data, - sample->data_size, sample->extensions, - sample->start_time, sample->end_time, sample->duration); + ret = stream->decoder->DecodeEx(stream->decoder, sample->data, sample->data_size, + sample->extensions, sample->start_time, + sample->end_time, sample->duration); } else { @@ -643,7 +644,7 @@ static BOOL tsmf_sample_playback(TSMF_SAMPLE* sample) { pixfmt = stream->decoder->GetDecodedFormat(stream->decoder); - if (pixfmt == ((UINT32) - 1)) + if (pixfmt == ((UINT32)-1)) { WLog_ERR(TAG, "unable to decode video format"); @@ -664,7 +665,7 @@ static BOOL tsmf_sample_playback(TSMF_SAMPLE* sample) if (ret && (width != stream->width || height != stream->height)) { - DEBUG_TSMF("video dimension changed to %"PRIu32" x %"PRIu32"", width, height); + DEBUG_TSMF("video dimension changed to %" PRIu32 " x %" PRIu32 "", width, height); stream->width = width; stream->height = height; } @@ -673,19 +674,16 @@ static BOOL tsmf_sample_playback(TSMF_SAMPLE* sample) if (stream->decoder->GetDecodedData) { - sample->data = stream->decoder->GetDecodedData(stream->decoder, - &sample->decoded_size); + sample->data = stream->decoder->GetDecodedData(stream->decoder, &sample->decoded_size); switch (sample->stream->major_type) { case TSMF_MAJOR_TYPE_VIDEO: - ret = tsmf_sample_playback_video(sample) && - tsmf_sample_queue_ack(sample); + ret = tsmf_sample_playback_video(sample) && tsmf_sample_queue_ack(sample); break; case TSMF_MAJOR_TYPE_AUDIO: - ret = tsmf_sample_playback_audio(sample) && - tsmf_sample_queue_ack(sample); + ret = tsmf_sample_playback_audio(sample) && tsmf_sample_queue_ack(sample); break; } } @@ -702,20 +700,20 @@ static BOOL tsmf_sample_playback(TSMF_SAMPLE* sample) buffer_filled = FALSE; } - ack_anticipation_time += (sample->duration / 2 < MAX_ACK_TIME) ? - sample->duration / 2 : MAX_ACK_TIME; + ack_anticipation_time += + (sample->duration / 2 < MAX_ACK_TIME) ? sample->duration / 2 : MAX_ACK_TIME; switch (sample->stream->major_type) { case TSMF_MAJOR_TYPE_VIDEO: - { - break; - } + { + break; + } case TSMF_MAJOR_TYPE_AUDIO: - { - break; - } + { + break; + } } sample->ack_time = ack_anticipation_time; @@ -733,9 +731,9 @@ static BOOL tsmf_sample_playback(TSMF_SAMPLE* sample) static DWORD WINAPI tsmf_stream_ack_func(LPVOID arg) { HANDLE hdl[2]; - TSMF_STREAM* stream = (TSMF_STREAM*) arg; + TSMF_STREAM* stream = (TSMF_STREAM*)arg; UINT error = CHANNEL_RC_OK; - DEBUG_TSMF("in %"PRIu32"", stream->stream_id); + DEBUG_TSMF("in %" PRIu32 "", stream->stream_id); hdl[0] = stream->stopEvent; hdl[1] = Queue_Event(stream->sample_ack_list); @@ -746,7 +744,7 @@ static DWORD WINAPI tsmf_stream_ack_func(LPVOID arg) if (ev == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "!", error); break; } @@ -756,8 +754,7 @@ static DWORD WINAPI tsmf_stream_ack_func(LPVOID arg) if (stream->eos) { - while ((stream->currentBufferLevel > 0) - && !(tsmf_stream_process_ack(stream, TRUE))) + while ((stream->currentBufferLevel > 0) && !(tsmf_stream_process_ack(stream, TRUE))) { DEBUG_TSMF("END OF STREAM PROCESSING!"); @@ -806,10 +803,9 @@ static DWORD WINAPI tsmf_stream_ack_func(LPVOID arg) } if (error && stream->rdpcontext) - setChannelError(stream->rdpcontext, error, - "tsmf_stream_ack_func reported an error"); + setChannelError(stream->rdpcontext, error, "tsmf_stream_ack_func reported an error"); - DEBUG_TSMF("out %"PRIu32"", stream->stream_id); + DEBUG_TSMF("out %" PRIu32 "", stream->stream_id); ExitThread(error); return error; } @@ -818,24 +814,26 @@ static DWORD WINAPI tsmf_stream_playback_func(LPVOID arg) { HANDLE hdl[2]; TSMF_SAMPLE* sample = NULL; - TSMF_STREAM* stream = (TSMF_STREAM*) arg; + TSMF_STREAM* stream = (TSMF_STREAM*)arg; TSMF_PRESENTATION* presentation = stream->presentation; UINT error = CHANNEL_RC_OK; DWORD status; - DEBUG_TSMF("in %"PRIu32"", stream->stream_id); + DEBUG_TSMF("in %" PRIu32 "", stream->stream_id); - if (stream->major_type == TSMF_MAJOR_TYPE_AUDIO && - stream->sample_rate && stream->channels && stream->bits_per_sample) + if (stream->major_type == TSMF_MAJOR_TYPE_AUDIO && stream->sample_rate && stream->channels && + stream->bits_per_sample) { if (stream->decoder) { if (stream->decoder->GetDecodedData) { stream->audio = tsmf_load_audio_device( - presentation->audio_name - && presentation->audio_name[0] ? presentation->audio_name : NULL, - presentation->audio_device - && presentation->audio_device[0] ? presentation->audio_device : NULL); + presentation->audio_name && presentation->audio_name[0] + ? presentation->audio_name + : NULL, + presentation->audio_device && presentation->audio_device[0] + ? presentation->audio_device + : NULL); if (stream->audio) { @@ -856,7 +854,7 @@ static DWORD WINAPI tsmf_stream_playback_func(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "!", error); break; } @@ -865,7 +863,7 @@ static DWORD WINAPI tsmf_stream_playback_func(LPVOID arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); break; } @@ -896,18 +894,16 @@ static DWORD WINAPI tsmf_stream_playback_func(LPVOID arg) } if (error && stream->rdpcontext) - setChannelError(stream->rdpcontext, error, - "tsmf_stream_playback_func reported an error"); + setChannelError(stream->rdpcontext, error, "tsmf_stream_playback_func reported an error"); - DEBUG_TSMF("out %"PRIu32"", stream->stream_id); + DEBUG_TSMF("out %" PRIu32 "", stream->stream_id); ExitThread(error); return error; } static BOOL tsmf_stream_start(TSMF_STREAM* stream) { - if (!stream || !stream->presentation || !stream->decoder - || !stream->decoder->Control) + if (!stream || !stream->presentation || !stream->decoder || !stream->decoder->Control) return TRUE; stream->eos = 0; @@ -955,8 +951,7 @@ static BOOL tsmf_stream_restart(TSMF_STREAM* stream) return stream->decoder->Control(stream->decoder, Control_Restart, NULL); } -static BOOL tsmf_stream_change_volume(TSMF_STREAM* stream, UINT32 newVolume, - UINT32 muted) +static BOOL tsmf_stream_change_volume(TSMF_STREAM* stream, UINT32 newVolume, UINT32 muted) { if (!stream || !stream->decoder) return TRUE; @@ -973,8 +968,8 @@ static BOOL tsmf_stream_change_volume(TSMF_STREAM* stream, UINT32 newVolume, return TRUE; } -BOOL tsmf_presentation_volume_changed(TSMF_PRESENTATION* presentation, - UINT32 newVolume, UINT32 muted) +BOOL tsmf_presentation_volume_changed(TSMF_PRESENTATION* presentation, UINT32 newVolume, + UINT32 muted) { UINT32 index; UINT32 count; @@ -987,7 +982,7 @@ BOOL tsmf_presentation_volume_changed(TSMF_PRESENTATION* presentation, for (index = 0; index < count; index++) { - stream = (TSMF_STREAM*) ArrayList_GetItem(presentation->stream_list, index); + stream = (TSMF_STREAM*)ArrayList_GetItem(presentation->stream_list, index); ret &= tsmf_stream_change_volume(stream, newVolume, muted); } @@ -1006,7 +1001,7 @@ BOOL tsmf_presentation_paused(TSMF_PRESENTATION* presentation) for (index = 0; index < count; index++) { - stream = (TSMF_STREAM*) ArrayList_GetItem(presentation->stream_list, index); + stream = (TSMF_STREAM*)ArrayList_GetItem(presentation->stream_list, index); ret &= tsmf_stream_pause(stream); } @@ -1025,7 +1020,7 @@ BOOL tsmf_presentation_restarted(TSMF_PRESENTATION* presentation) for (index = 0; index < count; index++) { - stream = (TSMF_STREAM*) ArrayList_GetItem(presentation->stream_list, index); + stream = (TSMF_STREAM*)ArrayList_GetItem(presentation->stream_list, index); ret &= tsmf_stream_restart(stream); } @@ -1044,7 +1039,7 @@ BOOL tsmf_presentation_start(TSMF_PRESENTATION* presentation) for (index = 0; index < count; index++) { - stream = (TSMF_STREAM*) ArrayList_GetItem(presentation->stream_list, index); + stream = (TSMF_STREAM*)ArrayList_GetItem(presentation->stream_list, index); ret &= tsmf_stream_start(stream); } @@ -1067,13 +1062,12 @@ UINT tsmf_presentation_sync(TSMF_PRESENTATION* presentation) for (index = 0; index < count; index++) { - TSMF_STREAM* stream = (TSMF_STREAM*) ArrayList_GetItem( - presentation->stream_list, index); + TSMF_STREAM* stream = (TSMF_STREAM*)ArrayList_GetItem(presentation->stream_list, index); if (WaitForSingleObject(stream->ready, 500) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); return error; } } @@ -1093,7 +1087,7 @@ BOOL tsmf_presentation_stop(TSMF_PRESENTATION* presentation) for (index = 0; index < count; index++) { - stream = (TSMF_STREAM*) ArrayList_GetItem(presentation->stream_list, index); + stream = (TSMF_STREAM*)ArrayList_GetItem(presentation->stream_list, index); ret &= tsmf_stream_stop(stream); } @@ -1103,8 +1097,9 @@ BOOL tsmf_presentation_stop(TSMF_PRESENTATION* presentation) return ret; } -BOOL tsmf_presentation_set_geometry_info(TSMF_PRESENTATION* presentation, - UINT32 x, UINT32 y, UINT32 width, UINT32 height, int num_rects, RDP_RECT* rects) +BOOL tsmf_presentation_set_geometry_info(TSMF_PRESENTATION* presentation, UINT32 x, UINT32 y, + UINT32 width, UINT32 height, int num_rects, + RDP_RECT* rects) { UINT32 index; UINT32 count; @@ -1117,9 +1112,10 @@ BOOL tsmf_presentation_set_geometry_info(TSMF_PRESENTATION* presentation, if (!width || !height) return TRUE; - /* Streams can be added/removed from the presentation and the server will resend geometry info when a new stream is - * added to the presentation. Also, num_rects is used to indicate whether or not the window is visible. - * So, always process a valid message with unchanged position/size and/or no visibility rects. + /* Streams can be added/removed from the presentation and the server will resend geometry info + * when a new stream is added to the presentation. Also, num_rects is used to indicate whether + * or not the window is visible. So, always process a valid message with unchanged position/size + * and/or no visibility rects. */ presentation->x = x; presentation->y = y; @@ -1139,7 +1135,7 @@ BOOL tsmf_presentation_set_geometry_info(TSMF_PRESENTATION* presentation, for (index = 0; index < count; index++) { - stream = (TSMF_STREAM*) ArrayList_GetItem(presentation->stream_list, index); + stream = (TSMF_STREAM*)ArrayList_GetItem(presentation->stream_list, index); if (!stream->decoder) continue; @@ -1147,7 +1143,7 @@ BOOL tsmf_presentation_set_geometry_info(TSMF_PRESENTATION* presentation, if (stream->decoder->UpdateRenderingArea) { ret = stream->decoder->UpdateRenderingArea(stream->decoder, x, y, width, height, - num_rects, rects); + num_rects, rects); } } @@ -1155,8 +1151,8 @@ BOOL tsmf_presentation_set_geometry_info(TSMF_PRESENTATION* presentation, return ret; } -void tsmf_presentation_set_audio_device(TSMF_PRESENTATION* presentation, - const char* name, const char* device) +void tsmf_presentation_set_audio_device(TSMF_PRESENTATION* presentation, const char* name, + const char* device) { presentation->audio_name = name; presentation->audio_device = device; @@ -1166,7 +1162,7 @@ BOOL tsmf_stream_flush(TSMF_STREAM* stream) { BOOL ret = TRUE; - //TSMF_SAMPLE* sample; + // TSMF_SAMPLE* sample; /* TODO: free lists */ if (stream->audio) ret = stream->audio->Flush(stream->audio); @@ -1215,11 +1211,11 @@ TSMF_STREAM* tsmf_stream_new(TSMF_PRESENTATION* presentation, UINT32 stream_id, if (stream) { - WLog_ERR(TAG, "duplicated stream id %"PRIu32"!", stream_id); + WLog_ERR(TAG, "duplicated stream id %" PRIu32 "!", stream_id); return NULL; } - stream = (TSMF_STREAM*) calloc(1, sizeof(TSMF_STREAM)); + stream = (TSMF_STREAM*)calloc(1, sizeof(TSMF_STREAM)); if (!stream) { @@ -1258,14 +1254,14 @@ TSMF_STREAM* tsmf_stream_new(TSMF_PRESENTATION* presentation, UINT32 stream_id, goto error_sample_ack_list; stream->sample_ack_list->object.fnObjectFree = tsmf_sample_free; - stream->play_thread = CreateThread(NULL, 0, tsmf_stream_playback_func, - stream, CREATE_SUSPENDED, NULL); + stream->play_thread = + CreateThread(NULL, 0, tsmf_stream_playback_func, stream, CREATE_SUSPENDED, NULL); if (!stream->play_thread) goto error_play_thread; - stream->ack_thread = CreateThread(NULL, 0, tsmf_stream_ack_func, stream, - CREATE_SUSPENDED, NULL); + stream->ack_thread = + CreateThread(NULL, 0, tsmf_stream_ack_func, stream, CREATE_SUSPENDED, NULL); if (!stream->ack_thread) goto error_ack_thread; @@ -1279,13 +1275,13 @@ error_add: SetEvent(stream->stopEvent); if (WaitForSingleObject(stream->ack_thread, INFINITE) == WAIT_FAILED) - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", GetLastError()); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", GetLastError()); error_ack_thread: SetEvent(stream->stopEvent); if (WaitForSingleObject(stream->play_thread, INFINITE) == WAIT_FAILED) - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", GetLastError()); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", GetLastError()); error_play_thread: Queue_Free(stream->sample_ack_list); @@ -1306,8 +1302,7 @@ void tsmf_stream_start_threads(TSMF_STREAM* stream) ResumeThread(stream->ack_thread); } -TSMF_STREAM* tsmf_stream_find_by_id(TSMF_PRESENTATION* presentation, - UINT32 stream_id) +TSMF_STREAM* tsmf_stream_find_by_id(TSMF_PRESENTATION* presentation, UINT32 stream_id) { UINT32 index; UINT32 count; @@ -1318,7 +1313,7 @@ TSMF_STREAM* tsmf_stream_find_by_id(TSMF_PRESENTATION* presentation, for (index = 0; index < count; index++) { - stream = (TSMF_STREAM*) ArrayList_GetItem(presentation->stream_list, index); + stream = (TSMF_STREAM*)ArrayList_GetItem(presentation->stream_list, index); if (stream->stream_id == stream_id) { @@ -1356,20 +1351,21 @@ BOOL tsmf_stream_set_format(TSMF_STREAM* stream, const char* name, wStream* s) if (mediatype.MajorType == TSMF_MAJOR_TYPE_VIDEO) { - DEBUG_TSMF("video width %"PRIu32" height %"PRIu32" bit_rate %"PRIu32" frame_rate %f codec_data %"PRIu32"", + DEBUG_TSMF("video width %" PRIu32 " height %" PRIu32 " bit_rate %" PRIu32 + " frame_rate %f codec_data %" PRIu32 "", mediatype.Width, mediatype.Height, mediatype.BitRate, - (double) mediatype.SamplesPerSecond.Numerator / (double) - mediatype.SamplesPerSecond.Denominator, + (double)mediatype.SamplesPerSecond.Numerator / + (double)mediatype.SamplesPerSecond.Denominator, mediatype.ExtraDataSize); stream->minBufferLevel = VIDEO_MIN_BUFFER_LEVEL; stream->maxBufferLevel = VIDEO_MAX_BUFFER_LEVEL; } else if (mediatype.MajorType == TSMF_MAJOR_TYPE_AUDIO) { - DEBUG_TSMF("audio channel %"PRIu32" sample_rate %"PRIu32" bits_per_sample %"PRIu32" codec_data %"PRIu32"", + DEBUG_TSMF("audio channel %" PRIu32 " sample_rate %" PRIu32 " bits_per_sample %" PRIu32 + " codec_data %" PRIu32 "", mediatype.Channels, mediatype.SamplesPerSecond.Numerator, - mediatype.BitsPerSample, - mediatype.ExtraDataSize); + mediatype.BitsPerSample, mediatype.ExtraDataSize); stream->sample_rate = mediatype.SamplesPerSecond.Numerator; stream->channels = mediatype.Channels; stream->bits_per_sample = mediatype.BitsPerSample; @@ -1392,12 +1388,10 @@ BOOL tsmf_stream_set_format(TSMF_STREAM* stream, const char* name, wStream* s) return FALSE; if (stream->decoder->SetAckFunc) - ret &= stream->decoder->SetAckFunc(stream->decoder, tsmf_stream_process_ack, - stream); + ret &= stream->decoder->SetAckFunc(stream->decoder, tsmf_stream_process_ack, stream); if (stream->decoder->SetSyncFunc) - ret &= stream->decoder->SetSyncFunc(stream->decoder, tsmf_stream_resync, - stream); + ret &= stream->decoder->SetSyncFunc(stream->decoder, tsmf_stream_resync, stream); return ret; } @@ -1427,7 +1421,7 @@ void _tsmf_stream_free(void* obj) { if (WaitForSingleObject(stream->play_thread, INFINITE) == WAIT_FAILED) { - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", GetLastError()); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", GetLastError()); return; } @@ -1439,7 +1433,7 @@ void _tsmf_stream_free(void* obj) { if (WaitForSingleObject(stream->ack_thread, INFINITE) == WAIT_FAILED) { - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", GetLastError()); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", GetLastError()); return; } @@ -1468,11 +1462,9 @@ void tsmf_stream_free(TSMF_STREAM* stream) ArrayList_Remove(presentation->stream_list, stream); } -BOOL tsmf_stream_push_sample(TSMF_STREAM* stream, - IWTSVirtualChannelCallback* pChannelCallback, +BOOL tsmf_stream_push_sample(TSMF_STREAM* stream, IWTSVirtualChannelCallback* pChannelCallback, UINT32 sample_id, UINT64 start_time, UINT64 end_time, UINT64 duration, - UINT32 extensions, - UINT32 data_size, BYTE* data) + UINT32 extensions, UINT32 data_size, BYTE* data) { TSMF_SAMPLE* sample; SetEvent(stream->ready); @@ -1480,7 +1472,7 @@ BOOL tsmf_stream_push_sample(TSMF_STREAM* stream, if (TERMINATING) return TRUE; - sample = (TSMF_SAMPLE*) calloc(1, sizeof(TSMF_SAMPLE)); + sample = (TSMF_SAMPLE*)calloc(1, sizeof(TSMF_SAMPLE)); if (!sample) { diff --git a/channels/tsmf/client/tsmf_media.h b/channels/tsmf/client/tsmf_media.h index 3ab21ddc5..ade06da8f 100644 --- a/channels/tsmf/client/tsmf_media.h +++ b/channels/tsmf/client/tsmf_media.h @@ -37,7 +37,7 @@ typedef struct _TSMF_STREAM TSMF_STREAM; typedef struct _TSMF_SAMPLE TSMF_SAMPLE; TSMF_PRESENTATION* tsmf_presentation_new(const BYTE* guid, - IWTSVirtualChannelCallback* pChannelCallback); + IWTSVirtualChannelCallback* pChannelCallback); TSMF_PRESENTATION* tsmf_presentation_find_by_id(const BYTE* guid); BOOL tsmf_presentation_start(TSMF_PRESENTATION* presentation); BOOL tsmf_presentation_stop(TSMF_PRESENTATION* presentation); @@ -46,11 +46,11 @@ BOOL tsmf_presentation_paused(TSMF_PRESENTATION* presentation); BOOL tsmf_presentation_restarted(TSMF_PRESENTATION* presentation); BOOL tsmf_presentation_volume_changed(TSMF_PRESENTATION* presentation, UINT32 newVolume, UINT32 muted); -BOOL tsmf_presentation_set_geometry_info(TSMF_PRESENTATION* presentation, - UINT32 x, UINT32 y, UINT32 width, UINT32 height, - int num_rects, RDP_RECT* rects); -void tsmf_presentation_set_audio_device(TSMF_PRESENTATION* presentation, - const char* name, const char* device); +BOOL tsmf_presentation_set_geometry_info(TSMF_PRESENTATION* presentation, UINT32 x, UINT32 y, + UINT32 width, UINT32 height, int num_rects, + RDP_RECT* rects); +void tsmf_presentation_set_audio_device(TSMF_PRESENTATION* presentation, const char* name, + const char* device); void tsmf_presentation_free(TSMF_PRESENTATION* presentation); TSMF_STREAM* tsmf_stream_new(TSMF_PRESENTATION* presentation, UINT32 stream_id, @@ -63,11 +63,10 @@ void tsmf_stream_free(TSMF_STREAM* stream); BOOL tsmf_stream_flush(TSMF_STREAM* stream); BOOL tsmf_stream_push_sample(TSMF_STREAM* stream, IWTSVirtualChannelCallback* pChannelCallback, - UINT32 sample_id, UINT64 start_time, UINT64 end_time, UINT64 duration, UINT32 extensions, - UINT32 data_size, BYTE* data); + UINT32 sample_id, UINT64 start_time, UINT64 end_time, UINT64 duration, + UINT32 extensions, UINT32 data_size, BYTE* data); BOOL tsmf_media_init(void); void tsmf_stream_start_threads(TSMF_STREAM* stream); #endif /* FREERDP_CHANNEL_TSMF_CLIENT_MEDIA_H */ - diff --git a/channels/tsmf/client/tsmf_types.h b/channels/tsmf/client/tsmf_types.h index a6833f03f..7e3823dd2 100644 --- a/channels/tsmf/client/tsmf_types.h +++ b/channels/tsmf/client/tsmf_types.h @@ -33,7 +33,10 @@ #ifdef WITH_DEBUG_TSMF #define DEBUG_TSMF(...) WLog_DBG(TAG, __VA_ARGS__) #else -#define DEBUG_TSMF(...) do { } while (0) +#define DEBUG_TSMF(...) \ + do \ + { \ + } while (0) #endif typedef struct _TS_AM_MEDIA_TYPE @@ -58,4 +61,3 @@ typedef struct _TS_AM_MEDIA_TYPE } TS_AM_MEDIA_TYPE; #endif /* FREERDP_CHANNEL_TSMF_CLIENT_TYPES_H */ - diff --git a/channels/urbdrc/client/data_transfer.c b/channels/urbdrc/client/data_transfer.c index 336b7c081..5b4b00e6a 100644 --- a/channels/urbdrc/client/data_transfer.c +++ b/channels/urbdrc/client/data_transfer.c @@ -65,7 +65,7 @@ static int func_check_isochronous_fds(IUDEVICE* pdev) ISOCH_CALLBACK_DATA* isoch = NULL; URBDRC_CHANNEL_CALLBACK* callback; - isoch_queue = (ISOCH_CALLBACK_QUEUE*) pdev->get_isoch_queue(pdev); + isoch_queue = (ISOCH_CALLBACK_QUEUE*)pdev->get_isoch_queue(pdev); while (process_times) { @@ -93,7 +93,7 @@ static int func_check_isochronous_fds(IUDEVICE* pdev) } else { - callback = (URBDRC_CHANNEL_CALLBACK*) isoch->callback; + callback = (URBDRC_CHANNEL_CALLBACK*)isoch->callback; size_temp = isoch->out_size; data_temp = isoch->out_data; @@ -117,8 +117,9 @@ static int func_check_isochronous_fds(IUDEVICE* pdev) #endif -static int urbdrc_process_register_request_callback(URBDRC_CHANNEL_CALLBACK* callback, - BYTE* data, UINT32 data_sizem, IUDEVMAN* udevman, UINT32 UsbDevice) +static int urbdrc_process_register_request_callback(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, + UINT32 data_sizem, IUDEVMAN* udevman, + UINT32 UsbDevice) { IUDEVICE* pdev; UINT32 NumRequestCompletion = 0; @@ -135,7 +136,7 @@ static int urbdrc_process_register_request_callback(URBDRC_CHANNEL_CALLBACK* cal { data_read_UINT32(data + 0, NumRequestCompletion); /** must be 1 */ /** RequestCompletion: - * unique Request Completion interface for the client to use */ + * unique Request Completion interface for the client to use */ data_read_UINT32(data + 4, RequestCompletion); pdev->set_ReqCompletion(pdev, RequestCompletion); } @@ -143,7 +144,7 @@ static int urbdrc_process_register_request_callback(URBDRC_CHANNEL_CALLBACK* cal { data_read_UINT32(data + 0, RequestCompletion); - if (1)//(pdev->get_ReqCompletion(pdev) == RequestCompletion) + if (1) //(pdev->get_ReqCompletion(pdev) == RequestCompletion) { /** The wrong driver may also receive this message, So we * need some time(default 3s) to check the driver or delete @@ -157,7 +158,8 @@ static int urbdrc_process_register_request_callback(URBDRC_CHANNEL_CALLBACK* cal return 0; } -static int urbdrc_process_cancel_request(BYTE* data, UINT32 data_sizem, IUDEVMAN* udevman, UINT32 UsbDevice) +static int urbdrc_process_cancel_request(BYTE* data, UINT32 data_sizem, IUDEVMAN* udevman, + UINT32 UsbDevice) { IUDEVICE* pdev; UINT32 CancelId; @@ -165,7 +167,7 @@ static int urbdrc_process_cancel_request(BYTE* data, UINT32 data_sizem, IUDEVMAN data_read_UINT32(data + 0, CancelId); /** RequestId */ - WLog_DBG(TAG, "urbdrc_process_cancel_request: id 0x%"PRIx32"", CancelId); + WLog_DBG(TAG, "urbdrc_process_cancel_request: id 0x%" PRIx32 "", CancelId); pdev = udevman->get_udevice_by_UsbDevice(udevman, UsbDevice); @@ -177,7 +179,8 @@ static int urbdrc_process_cancel_request(BYTE* data, UINT32 data_sizem, IUDEVMAN return error; } -static int urbdrc_process_retract_device_request(BYTE* data, UINT32 data_sizem, IUDEVMAN* udevman, UINT32 UsbDevice) +static int urbdrc_process_retract_device_request(BYTE* data, UINT32 data_sizem, IUDEVMAN* udevman, + UINT32 UsbDevice) { UINT32 Reason; WLog_DBG(TAG, "urbdrc_process_retract_device_request"); @@ -192,7 +195,8 @@ static int urbdrc_process_retract_device_request(BYTE* data, UINT32 data_sizem, break; default: - WLog_DBG(TAG, "urbdrc_process_retract_device_request: Unknown Reason %"PRIu32"", Reason); + WLog_DBG(TAG, "urbdrc_process_retract_device_request: Unknown Reason %" PRIu32 "", + Reason); return -1; break; } @@ -201,7 +205,8 @@ static int urbdrc_process_retract_device_request(BYTE* data, UINT32 data_sizem, } static int urbdrc_process_io_control(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, - UINT32 data_sizem, UINT32 MessageId, IUDEVMAN * udevman, UINT32 UsbDevice) + UINT32 data_sizem, UINT32 MessageId, IUDEVMAN* udevman, + UINT32 UsbDevice) { IUDEVICE* pdev; UINT32 out_size; @@ -227,28 +232,29 @@ static int urbdrc_process_io_control(URBDRC_CHANNEL_CALLBACK* callback, BYTE* da if (pdev == NULL) return 0; - InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev)); + InterfaceId = ((STREAM_ID_PROXY << 30) | pdev->get_ReqCompletion(pdev)); /** process */ - OutputBuffer = (BYTE *)calloc(1, OutputBufferSize); + OutputBuffer = (BYTE*)calloc(1, OutputBufferSize); if (!OutputBuffer) return ERROR_OUTOFMEMORY; switch (IoControlCode) { - case IOCTL_INTERNAL_USB_SUBMIT_URB: /** 0x00220003 */ + case IOCTL_INTERNAL_USB_SUBMIT_URB: /** 0x00220003 */ WLog_DBG(TAG, "ioctl: IOCTL_INTERNAL_USB_SUBMIT_URB"); - WLog_ERR(TAG, " Function IOCTL_INTERNAL_USB_SUBMIT_URB: Unchecked"); + WLog_ERR(TAG, " Function IOCTL_INTERNAL_USB_SUBMIT_URB: Unchecked"); break; - case IOCTL_INTERNAL_USB_RESET_PORT: /** 0x00220007 */ + case IOCTL_INTERNAL_USB_RESET_PORT: /** 0x00220007 */ WLog_DBG(TAG, "ioctl: IOCTL_INTERNAL_USB_RESET_PORT"); break; case IOCTL_INTERNAL_USB_GET_PORT_STATUS: /** 0x00220013 */ WLog_DBG(TAG, "ioctl: IOCTL_INTERNAL_USB_GET_PORT_STATUS"); - success = pdev->query_device_port_status(pdev, &usbd_status, &OutputBufferSize, OutputBuffer); + success = + pdev->query_device_port_status(pdev, &usbd_status, &OutputBufferSize, OutputBuffer); if (success) { @@ -262,24 +268,26 @@ static int urbdrc_process_io_control(URBDRC_CHANNEL_CALLBACK* callback, BYTE* da OutputBufferSize = 4; } - WLog_DBG(TAG, "PORT STATUS(fake!):0x%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"", - OutputBuffer[3], OutputBuffer[2], OutputBuffer[1], OutputBuffer[0]); + WLog_DBG(TAG, + "PORT STATUS(fake!):0x%02" PRIx8 "%02" PRIx8 "%02" PRIx8 "%02" PRIx8 "", + OutputBuffer[3], OutputBuffer[2], OutputBuffer[1], OutputBuffer[0]); } break; - case IOCTL_INTERNAL_USB_CYCLE_PORT: /** 0x0022001F */ + case IOCTL_INTERNAL_USB_CYCLE_PORT: /** 0x0022001F */ WLog_DBG(TAG, "ioctl: IOCTL_INTERNAL_USB_CYCLE_PORT"); - WLog_ERR(TAG, " Function IOCTL_INTERNAL_USB_CYCLE_PORT: Unchecked"); + WLog_ERR(TAG, " Function IOCTL_INTERNAL_USB_CYCLE_PORT: Unchecked"); break; case IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION: /** 0x00220027 */ WLog_DBG(TAG, "ioctl: IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION"); - WLog_ERR(TAG, " Function IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION: Unchecked"); + WLog_ERR(TAG, " Function IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION: Unchecked"); break; default: - WLog_DBG(TAG, "urbdrc_process_io_control: unknown IoControlCode 0x%"PRIX32"", IoControlCode); + WLog_DBG(TAG, "urbdrc_process_io_control: unknown IoControlCode 0x%" PRIX32 "", + IoControlCode); zfree(OutputBuffer); return ERROR_INVALID_OPERATION; break; @@ -287,19 +295,19 @@ static int urbdrc_process_io_control(URBDRC_CHANNEL_CALLBACK* callback, BYTE* da offset = 28; out_size = offset + OutputBufferSize; - out_data = (BYTE *) calloc(1, out_size); + out_data = (BYTE*)calloc(1, out_size); if (!out_data) { zfree(OutputBuffer); return ERROR_OUTOFMEMORY; } - data_write_UINT32(out_data + 0, InterfaceId); /** interface */ - data_write_UINT32(out_data + 4, MessageId); /** message id */ + data_write_UINT32(out_data + 0, InterfaceId); /** interface */ + data_write_UINT32(out_data + 4, MessageId); /** message id */ data_write_UINT32(out_data + 8, IOCONTROL_COMPLETION); /** function id */ - data_write_UINT32(out_data + 12, RequestId); /** RequestId */ + data_write_UINT32(out_data + 12, RequestId); /** RequestId */ data_write_UINT32(out_data + 16, USBD_STATUS_SUCCESS); /** HResult */ - data_write_UINT32(out_data + 20, OutputBufferSize); /** Information */ - data_write_UINT32(out_data + 24, OutputBufferSize); /** OutputBufferSize */ + data_write_UINT32(out_data + 20, OutputBufferSize); /** Information */ + data_write_UINT32(out_data + 24, OutputBufferSize); /** OutputBufferSize */ for (i = 0; i < OutputBufferSize; i++) { @@ -317,7 +325,8 @@ static int urbdrc_process_io_control(URBDRC_CHANNEL_CALLBACK* callback, BYTE* da } static int urbdrc_process_internal_io_control(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, - UINT32 data_sizem, UINT32 MessageId, IUDEVMAN* udevman, UINT32 UsbDevice) + UINT32 data_sizem, UINT32 MessageId, + IUDEVMAN* udevman, UINT32 UsbDevice) { IUDEVICE* pdev; BYTE* out_data; @@ -326,7 +335,7 @@ static int urbdrc_process_internal_io_control(URBDRC_CHANNEL_CALLBACK* callback, data_read_UINT32(data + 0, IoControlCode); - WLog_DBG(TAG, "urbdrc_process_internal_io_control:0x%"PRIx32"", IoControlCode); + WLog_DBG(TAG, "urbdrc_process_internal_io_control:0x%" PRIx32 "", IoControlCode); data_read_UINT32(data + 4, InputBufferSize); data_read_UINT32(data + 8, OutputBufferSize); @@ -337,22 +346,22 @@ static int urbdrc_process_internal_io_control(URBDRC_CHANNEL_CALLBACK* callback, if (pdev == NULL) return 0; - InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev)); + InterfaceId = ((STREAM_ID_PROXY << 30) | pdev->get_ReqCompletion(pdev)); /** Fixme: Currently this is a FALSE bustime... */ urbdrc_get_mstime(frames); out_size = 32; - out_data = (BYTE *) malloc(out_size); + out_data = (BYTE*)malloc(out_size); memset(out_data, 0, out_size); - data_write_UINT32(out_data + 0, InterfaceId); /** interface */ - data_write_UINT32(out_data + 4, MessageId); /** message id */ + data_write_UINT32(out_data + 0, InterfaceId); /** interface */ + data_write_UINT32(out_data + 4, MessageId); /** message id */ data_write_UINT32(out_data + 8, IOCONTROL_COMPLETION); /** function id */ - data_write_UINT32(out_data + 12, RequestId); /** RequestId */ - data_write_UINT32(out_data + 16, 0); /** HResult */ - data_write_UINT32(out_data + 20, 4); /** Information */ - data_write_UINT32(out_data + 24, 4); /** OutputBufferSize */ - data_write_UINT32(out_data + 28, frames); /** OutputBuffer */ + data_write_UINT32(out_data + 12, RequestId); /** RequestId */ + data_write_UINT32(out_data + 16, 0); /** HResult */ + data_write_UINT32(out_data + 20, 4); /** Information */ + data_write_UINT32(out_data + 24, 4); /** OutputBufferSize */ + data_write_UINT32(out_data + 28, frames); /** OutputBuffer */ if (!pdev->isSigToEnd(pdev)) callback->channel->Write(callback->channel, out_size, out_data, NULL); @@ -363,7 +372,8 @@ static int urbdrc_process_internal_io_control(URBDRC_CHANNEL_CALLBACK* callback, } static int urbdrc_process_query_device_text(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, - UINT32 data_sizem, UINT32 MessageId, IUDEVMAN* udevman, UINT32 UsbDevice) + UINT32 data_sizem, UINT32 MessageId, IUDEVMAN* udevman, + UINT32 UsbDevice) { IUDEVICE* pdev; UINT32 out_size; @@ -395,15 +405,15 @@ static int urbdrc_process_query_device_text(URBDRC_CHANNEL_CALLBACK* callback, B if (bufferSize != 0) out_size += 2; - out_data = (BYTE*) malloc(out_size); + out_data = (BYTE*)malloc(out_size); memset(out_data, 0, out_size); data_write_UINT32(out_data + 0, InterfaceId); /** interface */ - data_write_UINT32(out_data + 4, MessageId); /** message id */ + data_write_UINT32(out_data + 4, MessageId); /** message id */ if (bufferSize != 0) { - data_write_UINT32(out_data + 8, (bufferSize/2)+1); /** cchDeviceDescription */ + data_write_UINT32(out_data + 8, (bufferSize / 2) + 1); /** cchDeviceDescription */ out_offset = 12; memcpy(out_data + out_offset, DeviceDescription, bufferSize); out_offset += bufferSize; @@ -426,11 +436,12 @@ static int urbdrc_process_query_device_text(URBDRC_CHANNEL_CALLBACK* callback, B return 0; } -static void func_select_all_interface_for_msconfig(IUDEVICE* pdev, MSUSB_CONFIG_DESCRIPTOR* MsConfig) +static void func_select_all_interface_for_msconfig(IUDEVICE* pdev, + MSUSB_CONFIG_DESCRIPTOR* MsConfig) { UINT32 inum; MSUSB_INTERFACE_DESCRIPTOR** MsInterfaces = MsConfig->MsInterfaces; - BYTE InterfaceNumber, AlternateSetting; + BYTE InterfaceNumber, AlternateSetting; UINT32 NumInterfaces = MsConfig->NumInterfaces; for (inum = 0; inum < NumInterfaces; inum++) @@ -442,9 +453,10 @@ static void func_select_all_interface_for_msconfig(IUDEVICE* pdev, MSUSB_CONFIG_ } static int urb_select_configuration(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, - UINT32 data_sizem, UINT32 MessageId, IUDEVMAN* udevman, UINT32 UsbDevice, int transferDir) + UINT32 data_sizem, UINT32 MessageId, IUDEVMAN* udevman, + UINT32 UsbDevice, int transferDir) { - MSUSB_CONFIG_DESCRIPTOR * MsConfig = NULL; + MSUSB_CONFIG_DESCRIPTOR* MsConfig = NULL; IUDEVICE* pdev = NULL; UINT32 out_size, InterfaceId, RequestId, NumInterfaces, usbd_status = 0; BYTE ConfigurationDescriptorIsValid; @@ -453,7 +465,7 @@ static int urb_select_configuration(URBDRC_CHANNEL_CALLBACK* callback, BYTE* dat if (transferDir == 0) { - WLog_ERR(TAG, "urb_select_configuration: not support transfer out"); + WLog_ERR(TAG, "urb_select_configuration: not support transfer out"); return -1; } @@ -462,7 +474,7 @@ static int urb_select_configuration(URBDRC_CHANNEL_CALLBACK* callback, BYTE* dat if (pdev == NULL) return 0; - InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev)); + InterfaceId = ((STREAM_ID_PROXY << 30) | pdev->get_ReqCompletion(pdev)); data_read_UINT32(data + 0, RequestId); data_read_BYTE(data + 4, ConfigurationDescriptorIsValid); data_read_UINT32(data + 8, NumInterfaces); @@ -488,12 +500,12 @@ static int urb_select_configuration(URBDRC_CHANNEL_CALLBACK* callback, BYTE* dat out_size = 36 + MsOutSize; else out_size = 44; - out_data = (BYTE *) malloc(out_size); + out_data = (BYTE*)malloc(out_size); memset(out_data, 0, out_size); - data_write_UINT32(out_data + 0, InterfaceId); /** interface */ - data_write_UINT32(out_data + 4, MessageId); /** message id */ - data_write_UINT32(out_data + 8, URB_COMPLETION_NO_DATA); /** function id */ - data_write_UINT32(out_data + 12, RequestId); /** RequestId */ + data_write_UINT32(out_data + 0, InterfaceId); /** interface */ + data_write_UINT32(out_data + 4, MessageId); /** message id */ + data_write_UINT32(out_data + 8, URB_COMPLETION_NO_DATA); /** function id */ + data_write_UINT32(out_data + 12, RequestId); /** RequestId */ if (MsOutSize > 0) { /** CbTsUrbResult */ @@ -509,7 +521,7 @@ static int urb_select_configuration(URBDRC_CHANNEL_CALLBACK* callback, BYTE* dat /** Padding, MUST be ignored upon receipt */ data_write_UINT16(out_data + 22, URB_FUNCTION_SELECT_CONFIGURATION); - data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ + data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ offset = 28; /** TS_URB_SELECT_CONFIGURATION_RESULT */ if (MsOutSize > 0) @@ -518,12 +530,12 @@ static int urb_select_configuration(URBDRC_CHANNEL_CALLBACK* callback, BYTE* dat } else { - data_write_UINT32(out_data + offset, 0); /** ConfigurationHandle */ - data_write_UINT32(out_data + offset + 4, NumInterfaces); /** NumInterfaces */ + data_write_UINT32(out_data + offset, 0); /** ConfigurationHandle */ + data_write_UINT32(out_data + offset + 4, NumInterfaces); /** NumInterfaces */ offset += 8; } - data_write_UINT32(out_data + offset, 0); /** HResult */ - data_write_UINT32(out_data + offset + 4, 0); /** OutputBufferSize */ + data_write_UINT32(out_data + offset, 0); /** HResult */ + data_write_UINT32(out_data + offset + 4, 0); /** OutputBufferSize */ if (!pdev->isSigToEnd(pdev)) callback->channel->Write(callback->channel, out_size, out_data, NULL); @@ -532,7 +544,8 @@ static int urb_select_configuration(URBDRC_CHANNEL_CALLBACK* callback, BYTE* dat } static int urb_select_interface(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, UINT32 data_sizem, - UINT32 MessageId, IUDEVMAN* udevman, UINT32 UsbDevice, int transferDir) + UINT32 MessageId, IUDEVMAN* udevman, UINT32 UsbDevice, + int transferDir) { MSUSB_CONFIG_DESCRIPTOR* MsConfig; MSUSB_INTERFACE_DESCRIPTOR* MsInterface; @@ -545,7 +558,7 @@ static int urb_select_interface(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, U if (transferDir == 0) { - WLog_ERR(TAG, "urb_select_interface: not support transfer out"); + WLog_ERR(TAG, "urb_select_interface: not support transfer out"); return -1; } @@ -576,27 +589,27 @@ static int urb_select_interface(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, U MsInterface = MsConfig->MsInterfaces[InterfaceNumber]; interface_size = 16 + (MsInterface->NumberOfPipes * 20); - out_size = 36 + interface_size ; - out_data = (BYTE*) malloc(out_size); + out_size = 36 + interface_size; + out_data = (BYTE*)malloc(out_size); memset(out_data, 0, out_size); - data_write_UINT32(out_data + 0, InterfaceId); /** interface */ - data_write_UINT32(out_data + 4, MessageId); /** message id */ - data_write_UINT32(out_data + 8, URB_COMPLETION_NO_DATA); /** function id */ - data_write_UINT32(out_data + 12, RequestId); /** RequestId */ - data_write_UINT32(out_data + 16, 8 + interface_size); /** CbTsUrbResult */ + data_write_UINT32(out_data + 0, InterfaceId); /** interface */ + data_write_UINT32(out_data + 4, MessageId); /** message id */ + data_write_UINT32(out_data + 8, URB_COMPLETION_NO_DATA); /** function id */ + data_write_UINT32(out_data + 12, RequestId); /** RequestId */ + data_write_UINT32(out_data + 16, 8 + interface_size); /** CbTsUrbResult */ /** TS_URB_RESULT_HEADER */ - data_write_UINT16(out_data + 20, 8 + interface_size); /** Size */ + data_write_UINT16(out_data + 20, 8 + interface_size); /** Size */ /** Padding, MUST be ignored upon receipt */ data_write_UINT16(out_data + 22, URB_FUNCTION_SELECT_INTERFACE); - data_write_UINT32(out_data + 24, USBD_STATUS_SUCCESS); /** UsbdStatus */ + data_write_UINT32(out_data + 24, USBD_STATUS_SUCCESS); /** UsbdStatus */ out_offset = 28; /** TS_URB_SELECT_INTERFACE_RESULT */ msusb_msinterface_write(MsInterface, out_data + out_offset, &out_offset); - data_write_UINT32(out_data + out_offset, 0); /** HResult */ - data_write_UINT32(out_data + out_offset + 4, OutputBufferSize); /** OutputBufferSize */ + data_write_UINT32(out_data + out_offset, 0); /** HResult */ + data_write_UINT32(out_data + out_offset + 4, OutputBufferSize); /** OutputBufferSize */ if (!pdev->isSigToEnd(pdev)) callback->channel->Write(callback->channel, out_size, out_data, NULL); @@ -606,8 +619,9 @@ static int urb_select_interface(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, U return 0; } -static int urb_control_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, - UINT32 data_sizem, UINT32 MessageId, IUDEVMAN* udevman, UINT32 UsbDevice, int transferDir, int External) +static int urb_control_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, UINT32 data_sizem, + UINT32 MessageId, IUDEVMAN* udevman, UINT32 UsbDevice, + int transferDir, int External) { IUDEVICE* pdev; UINT32 out_size, RequestId, InterfaceId, EndpointAddress, PipeHandle; @@ -629,7 +643,7 @@ static int urb_control_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, data_read_UINT32(data + 8, TransferFlags); /** TransferFlags */ EndpointAddress = (PipeHandle & 0x000000ff); - offset = 12; + offset = 12; Timeout = 2000; switch (External) @@ -649,7 +663,7 @@ static int urb_control_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, data_read_UINT16(data + offset + 4, Index); data_read_UINT16(data + offset + 6, length); data_read_UINT32(data + offset + 8, OutputBufferSize); - offset += 12; + offset += 12; if (length != OutputBufferSize) { @@ -658,7 +672,7 @@ static int urb_control_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, } out_size = 36 + OutputBufferSize; - out_data = (BYTE *) malloc(out_size); + out_data = (BYTE*)malloc(out_size); memset(out_data, 0, out_size); buffer = out_data + 36; @@ -668,18 +682,12 @@ static int urb_control_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, memcpy(buffer, data + offset, OutputBufferSize); /** process URB_FUNCTION_CONTROL_TRANSFER */ - ret = pdev->control_transfer( - pdev, RequestId, EndpointAddress, TransferFlags, - bmRequestType, - Request, - Value, - Index, - &usbd_status, - &OutputBufferSize, - buffer, - Timeout); + ret = pdev->control_transfer(pdev, RequestId, EndpointAddress, TransferFlags, bmRequestType, + Request, Value, Index, &usbd_status, &OutputBufferSize, buffer, + Timeout); - if (ret < 0){ + if (ret < 0) + { WLog_DBG(TAG, "control_transfer: error num %d!!", ret); OutputBufferSize = 0; } @@ -691,24 +699,24 @@ static int urb_control_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, else out_size = offset; - data_write_UINT32(out_data + 0, InterfaceId); /** interface */ - data_write_UINT32(out_data + 4, MessageId); /** message id */ + data_write_UINT32(out_data + 0, InterfaceId); /** interface */ + data_write_UINT32(out_data + 4, MessageId); /** message id */ - if(transferDir == USBD_TRANSFER_DIRECTION_IN && OutputBufferSize != 0) - data_write_UINT32(out_data + 8, URB_COMPLETION); /** function id */ + if (transferDir == USBD_TRANSFER_DIRECTION_IN && OutputBufferSize != 0) + data_write_UINT32(out_data + 8, URB_COMPLETION); /** function id */ else data_write_UINT32(out_data + 8, URB_COMPLETION_NO_DATA); - data_write_UINT32(out_data + 12, RequestId); /** RequestId */ - data_write_UINT32(out_data + 16, 0x00000008); /** CbTsUrbResult */ + data_write_UINT32(out_data + 12, RequestId); /** RequestId */ + data_write_UINT32(out_data + 16, 0x00000008); /** CbTsUrbResult */ /** TsUrbResult TS_URB_RESULT_HEADER */ - data_write_UINT16(out_data + 20, 0x0008); /** Size */ + data_write_UINT16(out_data + 20, 0x0008); /** Size */ /** Padding, MUST be ignored upon receipt */ data_write_UINT16(out_data + 22, URB_FUNCTION_CONTROL_TRANSFER); - data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ + data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ - data_write_UINT32(out_data + 28, 0); /** HResult */ - data_write_UINT32(out_data + 32, OutputBufferSize); /** OutputBufferSize */ + data_write_UINT32(out_data + 28, 0); /** HResult */ + data_write_UINT32(out_data + 32, OutputBufferSize); /** OutputBufferSize */ if (!pdev->isSigToEnd(pdev)) callback->channel->Write(callback->channel, out_size, out_data, NULL); @@ -719,7 +727,8 @@ static int urb_control_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, } static int urb_bulk_or_interrupt_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, - UINT32 data_sizem, UINT32 MessageId, IUDEVMAN* udevman, UINT32 UsbDevice, int transferDir) + UINT32 data_sizem, UINT32 MessageId, IUDEVMAN* udevman, + UINT32 UsbDevice, int transferDir) { int offset; BYTE* Buffer; @@ -737,7 +746,7 @@ static int urb_bulk_or_interrupt_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYT data_read_UINT32(data + 0, RequestId); data_read_UINT32(data + 4, PipeHandle); - data_read_UINT32(data + 8, TransferFlags); /** TransferFlags */ + data_read_UINT32(data + 8, TransferFlags); /** TransferFlags */ data_read_UINT32(data + 12, OutputBufferSize); offset = 16; EndpointAddress = (PipeHandle & 0x000000ff); @@ -748,7 +757,7 @@ static int urb_bulk_or_interrupt_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYT out_size = 36 + OutputBufferSize; Buffer = NULL; - out_data = (BYTE*) malloc(out_size); + out_data = (BYTE*)malloc(out_size); memset(out_data, 0, out_size); switch (transferDir) @@ -763,13 +772,8 @@ static int urb_bulk_or_interrupt_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYT } /** process URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER */ - pdev->bulk_or_interrupt_transfer( - pdev, RequestId, EndpointAddress, - TransferFlags, - &usbd_status, - &OutputBufferSize, - Buffer, - 10000); + pdev->bulk_or_interrupt_transfer(pdev, RequestId, EndpointAddress, TransferFlags, &usbd_status, + &OutputBufferSize, Buffer, 10000); offset = 36; if (transferDir == USBD_TRANSFER_DIRECTION_IN) @@ -777,23 +781,23 @@ static int urb_bulk_or_interrupt_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYT else out_size = offset; /** send data */ - data_write_UINT32(out_data + 0, InterfaceId); /** interface */ - data_write_UINT32(out_data + 4, MessageId); /** message id */ - if(transferDir == USBD_TRANSFER_DIRECTION_IN && OutputBufferSize != 0) - data_write_UINT32(out_data + 8, URB_COMPLETION); /** function id */ + data_write_UINT32(out_data + 0, InterfaceId); /** interface */ + data_write_UINT32(out_data + 4, MessageId); /** message id */ + if (transferDir == USBD_TRANSFER_DIRECTION_IN && OutputBufferSize != 0) + data_write_UINT32(out_data + 8, URB_COMPLETION); /** function id */ else data_write_UINT32(out_data + 8, URB_COMPLETION_NO_DATA); - data_write_UINT32(out_data + 12, RequestId); /** RequestId */ - data_write_UINT32(out_data + 16, 0x00000008); /** CbTsUrbResult */ + data_write_UINT32(out_data + 12, RequestId); /** RequestId */ + data_write_UINT32(out_data + 16, 0x00000008); /** CbTsUrbResult */ /** TsUrbResult TS_URB_RESULT_HEADER */ - data_write_UINT16(out_data + 20, 0x0008); /** Size */ + data_write_UINT16(out_data + 20, 0x0008); /** Size */ /** Padding, MUST be ignored upon receipt */ data_write_UINT16(out_data + 22, URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER); - data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ + data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ - data_write_UINT32(out_data + 28, 0); /** HResult */ - data_write_UINT32(out_data + 32, OutputBufferSize); /** OutputBufferSize */ + data_write_UINT32(out_data + 28, 0); /** HResult */ + data_write_UINT32(out_data + 32, OutputBufferSize); /** OutputBufferSize */ if (pdev && !pdev->isSigToEnd(pdev)) callback->channel->Write(callback->channel, out_size, out_data, NULL); @@ -803,24 +807,20 @@ static int urb_bulk_or_interrupt_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYT return 0; } - -static int urb_isoch_transfer(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data, - UINT32 data_sizem, - UINT32 MessageId, - IUDEVMAN * udevman, - UINT32 UsbDevice, - int transferDir) +static int urb_isoch_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, UINT32 data_sizem, + UINT32 MessageId, IUDEVMAN* udevman, UINT32 UsbDevice, + int transferDir) { - IUDEVICE * pdev; - UINT32 RequestId, InterfaceId, EndpointAddress; - UINT32 PipeHandle, TransferFlags, StartFrame, NumberOfPackets; - UINT32 ErrorCount, OutputBufferSize, usbd_status = 0; - UINT32 RequestField, noAck = 0; - UINT32 out_size = 0; - BYTE * iso_buffer = NULL; - BYTE * iso_packets = NULL; - BYTE * out_data = NULL; - int offset, nullBuffer = 0, iso_status; + IUDEVICE* pdev; + UINT32 RequestId, InterfaceId, EndpointAddress; + UINT32 PipeHandle, TransferFlags, StartFrame, NumberOfPackets; + UINT32 ErrorCount, OutputBufferSize, usbd_status = 0; + UINT32 RequestField, noAck = 0; + UINT32 out_size = 0; + BYTE* iso_buffer = NULL; + BYTE* iso_packets = NULL; + BYTE* out_data = NULL; + int offset, nullBuffer = 0, iso_status; pdev = udevman->get_udevice_by_UsbDevice(udevman, UsbDevice); if (pdev == NULL) @@ -828,31 +828,34 @@ static int urb_isoch_transfer(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data, if (pdev->isSigToEnd(pdev)) return 0; - InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev)); + InterfaceId = ((STREAM_ID_PROXY << 30) | pdev->get_ReqCompletion(pdev)); data_read_UINT32(data + 0, RequestField); - RequestId = RequestField & 0x7fffffff; - noAck = (RequestField & 0x80000000)>>31; + RequestId = RequestField & 0x7fffffff; + noAck = (RequestField & 0x80000000) >> 31; data_read_UINT32(data + 4, PipeHandle); - EndpointAddress = (PipeHandle & 0x000000ff); - data_read_UINT32(data + 8, TransferFlags); /** TransferFlags */ - data_read_UINT32(data + 12, StartFrame); /** StartFrame */ + EndpointAddress = (PipeHandle & 0x000000ff); + data_read_UINT32(data + 8, TransferFlags); /** TransferFlags */ + data_read_UINT32(data + 12, StartFrame); /** StartFrame */ data_read_UINT32(data + 16, NumberOfPackets); /** NumberOfPackets */ - data_read_UINT32(data + 20, ErrorCount); /** ErrorCount */ + data_read_UINT32(data + 20, ErrorCount); /** ErrorCount */ offset = 24 + (NumberOfPackets * 12); data_read_UINT32(data + offset, OutputBufferSize); offset += 4; /** send data memory alloc */ - if (transferDir == USBD_TRANSFER_DIRECTION_OUT) { - if (!noAck) { + if (transferDir == USBD_TRANSFER_DIRECTION_OUT) + { + if (!noAck) + { out_size = 48 + (NumberOfPackets * 12); - out_data = (BYTE *) malloc(out_size); + out_data = (BYTE*)malloc(out_size); iso_packets = out_data + 40; } } - else { + else + { out_size = 48 + OutputBufferSize + (NumberOfPackets * 12); - out_data = (BYTE *) malloc(out_size); + out_data = (BYTE*)malloc(out_size); iso_packets = out_data + 40; } @@ -863,7 +866,7 @@ static int urb_isoch_transfer(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data, { case USBD_TRANSFER_DIRECTION_OUT: /** Get Buffer Data */ - //memcpy(iso_buffer, data + offset, OutputBufferSize); + // memcpy(iso_buffer, data + offset, OutputBufferSize); iso_buffer = data + offset; break; case USBD_TRANSFER_DIRECTION_IN: @@ -871,39 +874,31 @@ static int urb_isoch_transfer(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data, break; } - WLog_DBG(TAG, "urb_isoch_transfer: EndpointAddress: 0x%"PRIx32", " - "TransferFlags: 0x%"PRIx32", " - "StartFrame: 0x%"PRIx32", " - "NumberOfPackets: 0x%"PRIx32", " - "OutputBufferSize: 0x%"PRIx32" " - "RequestId: 0x%"PRIx32"", - EndpointAddress, TransferFlags, StartFrame, - NumberOfPackets, OutputBufferSize, RequestId); + WLog_DBG(TAG, + "urb_isoch_transfer: EndpointAddress: 0x%" PRIx32 ", " + "TransferFlags: 0x%" PRIx32 ", " + "StartFrame: 0x%" PRIx32 ", " + "NumberOfPackets: 0x%" PRIx32 ", " + "OutputBufferSize: 0x%" PRIx32 " " + "RequestId: 0x%" PRIx32 "", + EndpointAddress, TransferFlags, StartFrame, NumberOfPackets, OutputBufferSize, + RequestId); #if ISOCH_FIFO - ISOCH_CALLBACK_QUEUE * isoch_queue = NULL; - ISOCH_CALLBACK_DATA * isoch = NULL; - if(!noAck) + ISOCH_CALLBACK_QUEUE* isoch_queue = NULL; + ISOCH_CALLBACK_DATA* isoch = NULL; + if (!noAck) { - isoch_queue = (ISOCH_CALLBACK_QUEUE *)pdev->get_isoch_queue(pdev); + isoch_queue = (ISOCH_CALLBACK_QUEUE*)pdev->get_isoch_queue(pdev); isoch = isoch_queue->register_data(isoch_queue, callback, pdev); } #endif - iso_status = pdev->isoch_transfer( - pdev, RequestId, EndpointAddress, - TransferFlags, - noAck, - &ErrorCount, - &usbd_status, - &StartFrame, - NumberOfPackets, - iso_packets, - &OutputBufferSize, - iso_buffer, - 2000); + iso_status = pdev->isoch_transfer(pdev, RequestId, EndpointAddress, TransferFlags, noAck, + &ErrorCount, &usbd_status, &StartFrame, NumberOfPackets, + iso_packets, &OutputBufferSize, iso_buffer, 2000); - if(noAck) + if (noAck) { zfree(out_data); return 0; @@ -912,47 +907,47 @@ static int urb_isoch_transfer(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data, if (iso_status < 0) nullBuffer = 1; - out_size = 48; if (nullBuffer) OutputBufferSize = 0; else out_size += OutputBufferSize + (NumberOfPackets * 12); /* fill the send data */ - data_write_UINT32(out_data + 0, InterfaceId); /** interface */ - data_write_UINT32(out_data + 4, MessageId); /** message id */ - if(OutputBufferSize != 0 && !nullBuffer) - data_write_UINT32(out_data + 8, URB_COMPLETION); /** function id */ + data_write_UINT32(out_data + 0, InterfaceId); /** interface */ + data_write_UINT32(out_data + 4, MessageId); /** message id */ + if (OutputBufferSize != 0 && !nullBuffer) + data_write_UINT32(out_data + 8, URB_COMPLETION); /** function id */ else data_write_UINT32(out_data + 8, URB_COMPLETION_NO_DATA); - data_write_UINT32(out_data + 12, RequestId); /** RequestId */ - data_write_UINT32(out_data + 16, 20 + (NumberOfPackets * 12)); /** CbTsUrbResult */ + data_write_UINT32(out_data + 12, RequestId); /** RequestId */ + data_write_UINT32(out_data + 16, 20 + (NumberOfPackets * 12)); /** CbTsUrbResult */ /** TsUrbResult TS_URB_RESULT_HEADER */ - data_write_UINT16(out_data + 20, 20 + (NumberOfPackets * 12)); /** Size */ + data_write_UINT16(out_data + 20, 20 + (NumberOfPackets * 12)); /** Size */ /** Padding, MUST be ignored upon receipt */ data_write_UINT16(out_data + 22, URB_FUNCTION_ISOCH_TRANSFER); - data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ + data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ - data_write_UINT32(out_data + 28, StartFrame); /** StartFrame */ + data_write_UINT32(out_data + 28, StartFrame); /** StartFrame */ if (!nullBuffer) { /** NumberOfPackets */ data_write_UINT32(out_data + 32, NumberOfPackets); - data_write_UINT32(out_data + 36, ErrorCount); /** ErrorCount */ + data_write_UINT32(out_data + 36, ErrorCount); /** ErrorCount */ offset = 40 + (NumberOfPackets * 12); } else { - data_write_UINT32(out_data + 32, 0); /** NumberOfPackets */ - data_write_UINT32(out_data + 36, NumberOfPackets); /** ErrorCount */ + data_write_UINT32(out_data + 32, 0); /** NumberOfPackets */ + data_write_UINT32(out_data + 36, NumberOfPackets); /** ErrorCount */ offset = 40; } - data_write_UINT32(out_data + offset, 0); /** HResult */ - data_write_UINT32(out_data + offset + 4, OutputBufferSize); /** OutputBufferSize */ + data_write_UINT32(out_data + offset, 0); /** HResult */ + data_write_UINT32(out_data + offset + 4, OutputBufferSize); /** OutputBufferSize */ #if ISOCH_FIFO - if(!noAck){ + if (!noAck) + { pthread_mutex_lock(&isoch_queue->isoch_loading); isoch->out_data = out_data; isoch->out_size = out_size; @@ -970,14 +965,9 @@ static int urb_isoch_transfer(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data, return 0; } -static int urb_control_descriptor_request(URBDRC_CHANNEL_CALLBACK* callback, - BYTE * data, - UINT32 data_sizem, - UINT32 MessageId, - IUDEVMAN * udevman, - UINT32 UsbDevice, - BYTE func_recipient, - int transferDir) +static int urb_control_descriptor_request(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, + UINT32 data_sizem, UINT32 MessageId, IUDEVMAN* udevman, + UINT32 UsbDevice, BYTE func_recipient, int transferDir) { IUDEVICE* pdev; UINT32 out_size, InterfaceId, RequestId, OutputBufferSize, usbd_status; @@ -992,7 +982,7 @@ static int urb_control_descriptor_request(URBDRC_CHANNEL_CALLBACK* callback, if (pdev == NULL) return 0; - InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev)); + InterfaceId = ((STREAM_ID_PROXY << 30) | pdev->get_ReqCompletion(pdev)); data_read_UINT32(data + 0, RequestId); data_read_BYTE(data + 4, desc_index); data_read_BYTE(data + 5, desc_type); @@ -1000,7 +990,7 @@ static int urb_control_descriptor_request(URBDRC_CHANNEL_CALLBACK* callback, data_read_UINT32(data + 8, OutputBufferSize); out_size = 36 + OutputBufferSize; - out_data = (BYTE *) malloc(out_size); + out_data = (BYTE*)malloc(out_size); memset(out_data, 0, out_size); buffer = out_data + 36; @@ -1026,35 +1016,29 @@ static int urb_control_descriptor_request(URBDRC_CHANNEL_CALLBACK* callback, /** process get usb device descriptor */ ret = pdev->control_transfer( - pdev, RequestId, 0, 0, bmRequestType, - 0x06, /* REQUEST_GET_DESCRIPTOR */ - (desc_type << 8) | desc_index, - langId, - &usbd_status, - &OutputBufferSize, - buffer, - 1000); + pdev, RequestId, 0, 0, bmRequestType, 0x06, /* REQUEST_GET_DESCRIPTOR */ + (desc_type << 8) | desc_index, langId, &usbd_status, &OutputBufferSize, buffer, 1000); - - if (ret < 0) { + if (ret < 0) + { WLog_DBG(TAG, "get_descriptor: error num %d", ret); OutputBufferSize = 0; } offset = 36; out_size = offset + OutputBufferSize; - data_write_UINT32(out_data + 0, InterfaceId); /** interface */ - data_write_UINT32(out_data + 4, MessageId); /** message id */ - data_write_UINT32(out_data + 8, URB_COMPLETION); /** function id */ - data_write_UINT32(out_data + 12, RequestId); /** RequestId */ - data_write_UINT32(out_data + 16, 0x00000008); /** CbTsUrbResult */ + data_write_UINT32(out_data + 0, InterfaceId); /** interface */ + data_write_UINT32(out_data + 4, MessageId); /** message id */ + data_write_UINT32(out_data + 8, URB_COMPLETION); /** function id */ + data_write_UINT32(out_data + 12, RequestId); /** RequestId */ + data_write_UINT32(out_data + 16, 0x00000008); /** CbTsUrbResult */ /** TsUrbResult TS_URB_RESULT_HEADER */ - data_write_UINT16(out_data + 20, 0x0008); /** Size */ + data_write_UINT16(out_data + 20, 0x0008); /** Size */ /** Padding, MUST be ignored upon receipt */ data_write_UINT16(out_data + 22, URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE); - data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ - data_write_UINT32(out_data + 28, 0); /** HResult */ - data_write_UINT32(out_data + 32, OutputBufferSize); /** OutputBufferSize */ + data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ + data_write_UINT32(out_data + 28, 0); /** HResult */ + data_write_UINT32(out_data + 32, OutputBufferSize); /** OutputBufferSize */ if (!pdev->isSigToEnd(pdev)) callback->channel->Write(callback->channel, out_size, out_data, NULL); @@ -1063,13 +1047,9 @@ static int urb_control_descriptor_request(URBDRC_CHANNEL_CALLBACK* callback, return 0; } -static int urb_control_get_status_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data, - UINT32 data_sizem, - UINT32 MessageId, - IUDEVMAN * udevman, - UINT32 UsbDevice, - BYTE func_recipient, - int transferDir) +static int urb_control_get_status_request(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, + UINT32 data_sizem, UINT32 MessageId, IUDEVMAN* udevman, + UINT32 UsbDevice, BYTE func_recipient, int transferDir) { IUDEVICE* pdev; UINT32 out_size, RequestId, InterfaceId, OutputBufferSize, usbd_status; @@ -1079,7 +1059,8 @@ static int urb_control_get_status_request(URBDRC_CHANNEL_CALLBACK * callback, BY BYTE* out_data; int offset, ret; - if (transferDir == 0){ + if (transferDir == 0) + { WLog_DBG(TAG, "urb_control_get_status_request: not support transfer out"); return -1; } @@ -1087,36 +1068,32 @@ static int urb_control_get_status_request(URBDRC_CHANNEL_CALLBACK * callback, BY pdev = udevman->get_udevice_by_UsbDevice(udevman, UsbDevice); if (pdev == NULL) return 0; - InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev)); + InterfaceId = ((STREAM_ID_PROXY << 30) | pdev->get_ReqCompletion(pdev)); data_read_UINT32(data + 0, RequestId); data_read_UINT16(data + 4, Index); /** Index */ data_read_UINT32(data + 8, OutputBufferSize); out_size = 36 + OutputBufferSize; - out_data = (BYTE *) malloc(out_size); + out_data = (BYTE*)malloc(out_size); memset(out_data, 0, out_size); buffer = out_data + 36; bmRequestType = func_recipient | 0x80; - ret = pdev->control_transfer( - pdev, RequestId, 0, 0, bmRequestType, - 0x00, /* REQUEST_GET_STATUS */ - 0, - Index, - &usbd_status, - &OutputBufferSize, - buffer, - 1000); + ret = + pdev->control_transfer(pdev, RequestId, 0, 0, bmRequestType, 0x00, /* REQUEST_GET_STATUS */ + 0, Index, &usbd_status, &OutputBufferSize, buffer, 1000); - if (ret < 0){ + if (ret < 0) + { WLog_DBG(TAG, "control_transfer: error num %d!!", ret); OutputBufferSize = 0; usbd_status = USBD_STATUS_STALL_PID; } - else{ + else + { usbd_status = USBD_STATUS_SUCCESS; } @@ -1127,24 +1104,24 @@ static int urb_control_get_status_request(URBDRC_CHANNEL_CALLBACK * callback, BY else out_size = offset; - data_write_UINT32(out_data + 0, InterfaceId); /** interface */ - data_write_UINT32(out_data + 4, MessageId); /** message id */ + data_write_UINT32(out_data + 0, InterfaceId); /** interface */ + data_write_UINT32(out_data + 4, MessageId); /** message id */ - if(transferDir == USBD_TRANSFER_DIRECTION_IN && OutputBufferSize != 0) - data_write_UINT32(out_data + 8, URB_COMPLETION); /** function id */ + if (transferDir == USBD_TRANSFER_DIRECTION_IN && OutputBufferSize != 0) + data_write_UINT32(out_data + 8, URB_COMPLETION); /** function id */ else data_write_UINT32(out_data + 8, URB_COMPLETION_NO_DATA); - data_write_UINT32(out_data + 12, RequestId); /** RequestId, include NoAck*/ - data_write_UINT32(out_data + 16, 0x00000008); /** CbTsUrbResult */ + data_write_UINT32(out_data + 12, RequestId); /** RequestId, include NoAck*/ + data_write_UINT32(out_data + 16, 0x00000008); /** CbTsUrbResult */ /** TsUrbResult TS_URB_RESULT_HEADER */ - data_write_UINT16(out_data + 20, 0x0008); /** Size */ + data_write_UINT16(out_data + 20, 0x0008); /** Size */ /** Padding, MUST be ignored upon receipt */ data_write_UINT16(out_data + 22, URB_FUNCTION_VENDOR_DEVICE); - data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ + data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ - data_write_UINT32(out_data + 28, 0); /** HResult */ - data_write_UINT32(out_data + 32, OutputBufferSize); /** OutputBufferSize */ + data_write_UINT32(out_data + 28, 0); /** HResult */ + data_write_UINT32(out_data + 32, OutputBufferSize); /** OutputBufferSize */ if (!pdev->isSigToEnd(pdev)) callback->channel->Write(callback->channel, out_size, out_data, NULL); @@ -1154,15 +1131,10 @@ static int urb_control_get_status_request(URBDRC_CHANNEL_CALLBACK * callback, BY return 0; } -static int urb_control_vendor_or_class_request(URBDRC_CHANNEL_CALLBACK * callback, - BYTE * data, - UINT32 data_sizem, - UINT32 MessageId, - IUDEVMAN * udevman, - UINT32 UsbDevice, - BYTE func_type, - BYTE func_recipient, - int transferDir) +static int urb_control_vendor_or_class_request(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, + UINT32 data_sizem, UINT32 MessageId, + IUDEVMAN* udevman, UINT32 UsbDevice, BYTE func_type, + BYTE func_recipient, int transferDir) { IUDEVICE* pdev; UINT32 out_size, RequestId, InterfaceId, TransferFlags, usbd_status; @@ -1177,20 +1149,20 @@ static int urb_control_vendor_or_class_request(URBDRC_CHANNEL_CALLBACK * callbac pdev = udevman->get_udevice_by_UsbDevice(udevman, UsbDevice); if (pdev == NULL) return 0; - InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev)); + InterfaceId = ((STREAM_ID_PROXY << 30) | pdev->get_ReqCompletion(pdev)); data_read_UINT32(data + 0, RequestId); - data_read_UINT32(data + 4, TransferFlags); /** TransferFlags */ + data_read_UINT32(data + 4, TransferFlags); /** TransferFlags */ data_read_BYTE(data + 8, ReqTypeReservedBits); /** ReqTypeReservedBids */ - data_read_BYTE(data + 9, Request); /** Request */ - data_read_UINT16(data + 10, Value); /** value */ - data_read_UINT16(data + 12, Index); /** index */ - data_read_UINT16(data + 14, Padding); /** Padding */ + data_read_BYTE(data + 9, Request); /** Request */ + data_read_UINT16(data + 10, Value); /** value */ + data_read_UINT16(data + 12, Index); /** index */ + data_read_UINT16(data + 14, Padding); /** Padding */ data_read_UINT32(data + 16, OutputBufferSize); offset = 20; out_size = 36 + OutputBufferSize; - out_data = (BYTE *) malloc(out_size); + out_data = (BYTE*)malloc(out_size); memset(out_data, 0, out_size); buffer = out_data + 36; @@ -1205,28 +1177,26 @@ static int urb_control_vendor_or_class_request(URBDRC_CHANNEL_CALLBACK * callbac if (TransferFlags & USBD_TRANSFER_DIRECTION) bmRequestType |= 0x80; - WLog_DBG(TAG, "urb_control_vendor_or_class_request: " - "RequestId 0x%"PRIx32" TransferFlags: 0x%"PRIx32" ReqTypeReservedBits: 0x%"PRIx8" " - "Request:0x%"PRIx8" Value: 0x%"PRIx16" Index: 0x%"PRIx16" OutputBufferSize: 0x%"PRIx32" bmRequestType: 0x%"PRIx8"!!", - RequestId, TransferFlags, ReqTypeReservedBits, Request, Value, - Index, OutputBufferSize, bmRequestType); + WLog_DBG(TAG, + "urb_control_vendor_or_class_request: " + "RequestId 0x%" PRIx32 " TransferFlags: 0x%" PRIx32 " ReqTypeReservedBits: 0x%" PRIx8 + " " + "Request:0x%" PRIx8 " Value: 0x%" PRIx16 " Index: 0x%" PRIx16 + " OutputBufferSize: 0x%" PRIx32 " bmRequestType: 0x%" PRIx8 "!!", + RequestId, TransferFlags, ReqTypeReservedBits, Request, Value, Index, OutputBufferSize, + bmRequestType); - ret = pdev->control_transfer( - pdev, RequestId, 0, 0, bmRequestType, - Request, - Value, - Index, - &usbd_status, - &OutputBufferSize, - buffer, - 2000); + ret = pdev->control_transfer(pdev, RequestId, 0, 0, bmRequestType, Request, Value, Index, + &usbd_status, &OutputBufferSize, buffer, 2000); - if (ret < 0){ + if (ret < 0) + { WLog_DBG(TAG, "control_transfer: error num %d!!", ret); OutputBufferSize = 0; usbd_status = USBD_STATUS_STALL_PID; } - else{ + else + { usbd_status = USBD_STATUS_SUCCESS; } @@ -1236,23 +1206,24 @@ static int urb_control_vendor_or_class_request(URBDRC_CHANNEL_CALLBACK * callbac else out_size = offset; /** send data */ - data_write_UINT32(out_data + 0, InterfaceId); /** interface */ - data_write_UINT32(out_data + 4, MessageId); /** message id */ + data_write_UINT32(out_data + 0, InterfaceId); /** interface */ + data_write_UINT32(out_data + 4, MessageId); /** message id */ - if(transferDir == USBD_TRANSFER_DIRECTION_IN && OutputBufferSize != 0) - data_write_UINT32(out_data + 8, URB_COMPLETION); /** function id */ + if (transferDir == USBD_TRANSFER_DIRECTION_IN && OutputBufferSize != 0) + data_write_UINT32(out_data + 8, URB_COMPLETION); /** function id */ else data_write_UINT32(out_data + 8, URB_COMPLETION_NO_DATA); - data_write_UINT32(out_data + 12, RequestId); /** RequestId, include NoAck*/ - data_write_UINT32(out_data + 16, 0x00000008); /** CbTsUrbResult */ + data_write_UINT32(out_data + 12, RequestId); /** RequestId, include NoAck*/ + data_write_UINT32(out_data + 16, 0x00000008); /** CbTsUrbResult */ /** TsUrbResult TS_URB_RESULT_HEADER */ - data_write_UINT16(out_data + 20, 0x0008); /** Size */ - data_write_UINT16(out_data + 22, URB_FUNCTION_VENDOR_DEVICE); /** Padding, MUST be ignored upon receipt */ - data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ + data_write_UINT16(out_data + 20, 0x0008); /** Size */ + data_write_UINT16(out_data + 22, + URB_FUNCTION_VENDOR_DEVICE); /** Padding, MUST be ignored upon receipt */ + data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ - data_write_UINT32(out_data + 28, 0); /** HResult */ - data_write_UINT32(out_data + 32, OutputBufferSize); /** OutputBufferSize */ + data_write_UINT32(out_data + 28, 0); /** HResult */ + data_write_UINT32(out_data + 32, OutputBufferSize); /** OutputBufferSize */ if (!pdev->isSigToEnd(pdev)) callback->channel->Write(callback->channel, out_size, out_data, NULL); @@ -1261,15 +1232,9 @@ static int urb_control_vendor_or_class_request(URBDRC_CHANNEL_CALLBACK * callbac return 0; } - - -static int urb_os_feature_descriptor_request(URBDRC_CHANNEL_CALLBACK * callback, - BYTE * data, - UINT32 data_sizem, - UINT32 MessageId, - IUDEVMAN * udevman, - UINT32 UsbDevice, - int transferDir) +static int urb_os_feature_descriptor_request(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, + UINT32 data_sizem, UINT32 MessageId, IUDEVMAN* udevman, + UINT32 UsbDevice, int transferDir) { IUDEVICE* pdev; UINT32 out_size, RequestId, InterfaceId, OutputBufferSize, usbd_status; @@ -1284,19 +1249,19 @@ static int urb_os_feature_descriptor_request(URBDRC_CHANNEL_CALLBACK * callback, if (pdev == NULL) return 0; - InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev)); + InterfaceId = ((STREAM_ID_PROXY << 30) | pdev->get_ReqCompletion(pdev)); data_read_UINT32(data + 0, RequestId); - data_read_BYTE(data + 4, Recipient); /** Recipient */ - Recipient = (Recipient & 0x1f); /* XXX: origin: Recipient && 0x1f !? */ - data_read_BYTE(data + 5, InterfaceNumber); /** InterfaceNumber */ - data_read_BYTE(data + 6, Ms_PageIndex); /** Ms_PageIndex */ + data_read_BYTE(data + 4, Recipient); /** Recipient */ + Recipient = (Recipient & 0x1f); /* XXX: origin: Recipient && 0x1f !? */ + data_read_BYTE(data + 5, InterfaceNumber); /** InterfaceNumber */ + data_read_BYTE(data + 6, Ms_PageIndex); /** Ms_PageIndex */ data_read_UINT16(data + 7, Ms_featureDescIndex); /** Ms_featureDescIndex */ data_read_UINT32(data + 12, OutputBufferSize); offset = 16; out_size = 36 + OutputBufferSize; - out_data = (BYTE *) malloc(out_size); + out_data = (BYTE*)malloc(out_size); memset(out_data, 0, out_size); buffer = out_data + 36; @@ -1304,29 +1269,23 @@ static int urb_os_feature_descriptor_request(URBDRC_CHANNEL_CALLBACK * callback, switch (transferDir) { case USBD_TRANSFER_DIRECTION_OUT: - WLog_ERR(TAG, "Function urb_os_feature_descriptor_request: OUT Unchecked"); + WLog_ERR(TAG, "Function urb_os_feature_descriptor_request: OUT Unchecked"); memcpy(buffer, data + offset, OutputBufferSize); break; case USBD_TRANSFER_DIRECTION_IN: break; } - WLog_DBG(TAG, "Ms descriptor arg: Recipient:0x%"PRIx8", " - "InterfaceNumber:0x%"PRIx8", Ms_PageIndex:0x%"PRIx8", " - "Ms_featureDescIndex:0x%"PRIx16", OutputBufferSize:0x%"PRIx32"", - Recipient, InterfaceNumber, Ms_PageIndex, - Ms_featureDescIndex, OutputBufferSize); + WLog_DBG(TAG, + "Ms descriptor arg: Recipient:0x%" PRIx8 ", " + "InterfaceNumber:0x%" PRIx8 ", Ms_PageIndex:0x%" PRIx8 ", " + "Ms_featureDescIndex:0x%" PRIx16 ", OutputBufferSize:0x%" PRIx32 "", + Recipient, InterfaceNumber, Ms_PageIndex, Ms_featureDescIndex, OutputBufferSize); /** get ms string */ - ret = pdev->os_feature_descriptor_request( - pdev, RequestId, Recipient, - InterfaceNumber, - Ms_PageIndex, - Ms_featureDescIndex, - &usbd_status, - &OutputBufferSize, - buffer, - 1000); + ret = pdev->os_feature_descriptor_request(pdev, RequestId, Recipient, InterfaceNumber, + Ms_PageIndex, Ms_featureDescIndex, &usbd_status, + &OutputBufferSize, buffer, 1000); if (ret < 0) WLog_DBG(TAG, "os_feature_descriptor_request: error num %d", ret); @@ -1334,23 +1293,23 @@ static int urb_os_feature_descriptor_request(URBDRC_CHANNEL_CALLBACK * callback, offset = 36; out_size = offset + OutputBufferSize; /** send data */ - data_write_UINT32(out_data + 0, InterfaceId); /** interface */ - data_write_UINT32(out_data + 4, MessageId); /** message id */ - if(OutputBufferSize!=0) - data_write_UINT32(out_data + 8, URB_COMPLETION); /** function id */ + data_write_UINT32(out_data + 0, InterfaceId); /** interface */ + data_write_UINT32(out_data + 4, MessageId); /** message id */ + if (OutputBufferSize != 0) + data_write_UINT32(out_data + 8, URB_COMPLETION); /** function id */ else data_write_UINT32(out_data + 8, URB_COMPLETION_NO_DATA); - data_write_UINT32(out_data + 12, RequestId); /** RequestId */ - data_write_UINT32(out_data + 16, 0x00000008); /** CbTsUrbResult */ + data_write_UINT32(out_data + 12, RequestId); /** RequestId */ + data_write_UINT32(out_data + 16, 0x00000008); /** CbTsUrbResult */ /** TsUrbResult TS_URB_RESULT_HEADER */ - data_write_UINT16(out_data + 20, 0x0008); /** Size */ + data_write_UINT16(out_data + 20, 0x0008); /** Size */ /** Padding, MUST be ignored upon receipt */ data_write_UINT16(out_data + 22, URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR); - data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ + data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ - data_write_UINT32(out_data + 28, 0); /** HResult */ - data_write_UINT32(out_data + 32, OutputBufferSize); /** OutputBufferSize */ + data_write_UINT32(out_data + 28, 0); /** HResult */ + data_write_UINT32(out_data + 32, OutputBufferSize); /** OutputBufferSize */ if (!pdev->isSigToEnd(pdev)) callback->channel->Write(callback->channel, out_size, out_data, NULL); @@ -1360,13 +1319,9 @@ static int urb_os_feature_descriptor_request(URBDRC_CHANNEL_CALLBACK * callback, return 0; } -static int urb_pipe_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data, - UINT32 data_sizem, - UINT32 MessageId, - IUDEVMAN * udevman, - UINT32 UsbDevice, - int transferDir, - int action) +static int urb_pipe_request(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, UINT32 data_sizem, + UINT32 MessageId, IUDEVMAN* udevman, UINT32 UsbDevice, int transferDir, + int action) { IUDEVICE* pdev; UINT32 out_size, RequestId, InterfaceId, PipeHandle, EndpointAddress; @@ -1374,7 +1329,8 @@ static int urb_pipe_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data, BYTE* out_data; int out_offset, ret; - if (transferDir == 0){ + if (transferDir == 0) + { WLog_DBG(TAG, "urb_pipe_request: not support transfer out"); return -1; } @@ -1384,36 +1340,32 @@ static int urb_pipe_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data, if (pdev == NULL) return 0; - InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev)); + InterfaceId = ((STREAM_ID_PROXY << 30) | pdev->get_ReqCompletion(pdev)); data_read_UINT32(data + 0, RequestId); data_read_UINT32(data + 4, PipeHandle); /** PipeHandle */ data_read_UINT32(data + 8, OutputBufferSize); EndpointAddress = (PipeHandle & 0x000000ff); - - switch (action){ + switch (action) + { case PIPE_CANCEL: - WLog_DBG(TAG, "urb_pipe_request: PIPE_CANCEL 0x%"PRIx32"", EndpointAddress); + WLog_DBG(TAG, "urb_pipe_request: PIPE_CANCEL 0x%" PRIx32 "", EndpointAddress); - ret = pdev->control_pipe_request( - pdev, RequestId, EndpointAddress, - &usbd_status, - PIPE_CANCEL); + ret = pdev->control_pipe_request(pdev, RequestId, EndpointAddress, &usbd_status, + PIPE_CANCEL); - if (ret < 0) { + if (ret < 0) + { WLog_DBG(TAG, "PIPE SET HALT: error num %d", ret); } - break; case PIPE_RESET: - WLog_DBG(TAG, "urb_pipe_request: PIPE_RESET ep 0x%"PRIx32"", EndpointAddress); + WLog_DBG(TAG, "urb_pipe_request: PIPE_RESET ep 0x%" PRIx32 "", EndpointAddress); - ret = pdev->control_pipe_request( - pdev, RequestId, EndpointAddress, - &usbd_status, - PIPE_RESET); + ret = pdev->control_pipe_request(pdev, RequestId, EndpointAddress, &usbd_status, + PIPE_RESET); if (ret < 0) WLog_DBG(TAG, "PIPE RESET: error num %d!!", ret); @@ -1424,27 +1376,26 @@ static int urb_pipe_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data, break; } - /** send data */ out_offset = 36; out_size = out_offset + OutputBufferSize; - out_data = (BYTE *) malloc(out_size); + out_data = (BYTE*)malloc(out_size); memset(out_data, 0, out_size); - data_write_UINT32(out_data + 0, InterfaceId); /** interface */ - data_write_UINT32(out_data + 4, MessageId); /** message id */ + data_write_UINT32(out_data + 0, InterfaceId); /** interface */ + data_write_UINT32(out_data + 4, MessageId); /** message id */ data_write_UINT32(out_data + 8, URB_COMPLETION_NO_DATA); - data_write_UINT32(out_data + 12, RequestId); /** RequestId */ - data_write_UINT32(out_data + 16, 0x00000008); /** CbTsUrbResult */ + data_write_UINT32(out_data + 12, RequestId); /** RequestId */ + data_write_UINT32(out_data + 16, 0x00000008); /** CbTsUrbResult */ /** TsUrbResult TS_URB_RESULT_HEADER */ - data_write_UINT16(out_data + 20, 0x0008); /** Size */ + data_write_UINT16(out_data + 20, 0x0008); /** Size */ /** Padding, MUST be ignored upon receipt */ data_write_UINT16(out_data + 22, URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL); - data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ + data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ - data_write_UINT32(out_data + 28, 0); /** HResult */ - data_write_UINT32(out_data + 32, 0); /** OutputBufferSize */ + data_write_UINT32(out_data + 28, 0); /** HResult */ + data_write_UINT32(out_data + 32, 0); /** OutputBufferSize */ if (!pdev->isSigToEnd(pdev)) callback->channel->Write(callback->channel, out_size, out_data, NULL); @@ -1453,55 +1404,52 @@ static int urb_pipe_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data, return 0; } -static int urb_get_current_frame_number(URBDRC_CHANNEL_CALLBACK* callback, - BYTE * data, - UINT32 data_sizem, - UINT32 MessageId, - IUDEVMAN * udevman, - UINT32 UsbDevice, - int transferDir) +static int urb_get_current_frame_number(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, + UINT32 data_sizem, UINT32 MessageId, IUDEVMAN* udevman, + UINT32 UsbDevice, int transferDir) { IUDEVICE* pdev; UINT32 out_size, RequestId, InterfaceId, OutputBufferSize; UINT32 dummy_frames; BYTE* out_data; - if (transferDir == 0){ + if (transferDir == 0) + { WLog_DBG(TAG, "urb_get_current_frame_number: not support transfer out"); - //exit(1); + // exit(1); return -1; } pdev = udevman->get_udevice_by_UsbDevice(udevman, UsbDevice); if (pdev == NULL) return 0; - InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev)); + InterfaceId = ((STREAM_ID_PROXY << 30) | pdev->get_ReqCompletion(pdev)); data_read_UINT32(data + 0, RequestId); data_read_UINT32(data + 4, OutputBufferSize); - /** Fixme: Need to fill actual frame number!!*/ + /** Fixme: Need to fill actual frame number!!*/ urbdrc_get_mstime(dummy_frames); out_size = 40; - out_data = (BYTE *) malloc(out_size); + out_data = (BYTE*)malloc(out_size); memset(out_data, 0, out_size); - data_write_UINT32(out_data + 0, InterfaceId); /** interface */ - data_write_UINT32(out_data + 4, MessageId); /** message id */ + data_write_UINT32(out_data + 0, InterfaceId); /** interface */ + data_write_UINT32(out_data + 4, MessageId); /** message id */ data_write_UINT32(out_data + 8, URB_COMPLETION_NO_DATA); - data_write_UINT32(out_data + 12, RequestId); /** RequestId */ - data_write_UINT32(out_data + 16, 12); /** CbTsUrbResult */ + data_write_UINT32(out_data + 12, RequestId); /** RequestId */ + data_write_UINT32(out_data + 16, 12); /** CbTsUrbResult */ /** TsUrbResult TS_URB_RESULT_HEADER */ - data_write_UINT16(out_data + 20, 12); /** Size */ + data_write_UINT16(out_data + 20, 12); /** Size */ /** Padding, MUST be ignored upon receipt */ data_write_UINT16(out_data + 22, URB_FUNCTION_GET_CURRENT_FRAME_NUMBER); - data_write_UINT32(out_data + 24, USBD_STATUS_SUCCESS); /** UsbdStatus */ - data_write_UINT32(out_data + 28, dummy_frames); /** FrameNumber */ + data_write_UINT32(out_data + 24, USBD_STATUS_SUCCESS); /** UsbdStatus */ + data_write_UINT32(out_data + 28, dummy_frames); /** FrameNumber */ - data_write_UINT32(out_data + 32, 0); /** HResult */ - data_write_UINT32(out_data + 36, 0); /** OutputBufferSize */ + data_write_UINT32(out_data + 32, 0); /** HResult */ + data_write_UINT32(out_data + 36, 0); /** OutputBufferSize */ if (!pdev->isSigToEnd(pdev)) callback->channel->Write(callback->channel, out_size, out_data, NULL); @@ -1509,15 +1457,11 @@ static int urb_get_current_frame_number(URBDRC_CHANNEL_CALLBACK* callback, return 0; } - /* Unused function for current server */ -static int urb_control_get_configuration_request(URBDRC_CHANNEL_CALLBACK* callback, - BYTE * data, - UINT32 data_sizem, - UINT32 MessageId, - IUDEVMAN * udevman, - UINT32 UsbDevice, - int transferDir) +static int urb_control_get_configuration_request(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, + UINT32 data_sizem, UINT32 MessageId, + IUDEVMAN* udevman, UINT32 UsbDevice, + int transferDir) { IUDEVICE* pdev; UINT32 out_size, RequestId, InterfaceId, OutputBufferSize, usbd_status; @@ -1528,7 +1472,7 @@ static int urb_control_get_configuration_request(URBDRC_CHANNEL_CALLBACK* callba if (transferDir == 0) { WLog_DBG(TAG, "urb_control_get_configuration_request:" - " not support transfer out"); + " not support transfer out"); return -1; } @@ -1537,53 +1481,47 @@ static int urb_control_get_configuration_request(URBDRC_CHANNEL_CALLBACK* callba if (pdev == NULL) return 0; - InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev)); + InterfaceId = ((STREAM_ID_PROXY << 30) | pdev->get_ReqCompletion(pdev)); data_read_UINT32(data + 0, RequestId); data_read_UINT32(data + 4, OutputBufferSize); out_size = 36 + OutputBufferSize; - out_data = (BYTE *) malloc(out_size); + out_data = (BYTE*)malloc(out_size); memset(out_data, 0, out_size); buffer = out_data + 36; - ret = pdev->control_transfer( - pdev, RequestId, 0, 0, 0x80 | 0x00, - 0x08, /* REQUEST_GET_CONFIGURATION */ - 0, - 0, - &usbd_status, - &OutputBufferSize, - buffer, - 1000); + ret = pdev->control_transfer(pdev, RequestId, 0, 0, 0x80 | 0x00, + 0x08, /* REQUEST_GET_CONFIGURATION */ + 0, 0, &usbd_status, &OutputBufferSize, buffer, 1000); - if (ret < 0){ + if (ret < 0) + { WLog_DBG(TAG, "control_transfer: error num %d", ret); OutputBufferSize = 0; } - offset = 36; out_size = offset + OutputBufferSize; - data_write_UINT32(out_data + 0, InterfaceId); /** interface */ - data_write_UINT32(out_data + 4, MessageId); /** message id */ + data_write_UINT32(out_data + 0, InterfaceId); /** interface */ + data_write_UINT32(out_data + 4, MessageId); /** message id */ if (OutputBufferSize != 0) data_write_UINT32(out_data + 8, URB_COMPLETION); else data_write_UINT32(out_data + 8, URB_COMPLETION_NO_DATA); - data_write_UINT32(out_data + 12, RequestId); /** RequestId */ - data_write_UINT32(out_data + 16, 8); /** CbTsUrbResult */ + data_write_UINT32(out_data + 12, RequestId); /** RequestId */ + data_write_UINT32(out_data + 16, 8); /** CbTsUrbResult */ /** TsUrbResult TS_URB_RESULT_HEADER */ - data_write_UINT16(out_data + 20, 8); /** Size */ + data_write_UINT16(out_data + 20, 8); /** Size */ /** Padding, MUST be ignored upon receipt */ data_write_UINT16(out_data + 22, URB_FUNCTION_GET_CONFIGURATION); - data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ + data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ - data_write_UINT32(out_data + 28, 0); /** HResult */ - data_write_UINT32(out_data + 32, OutputBufferSize); /** OutputBufferSize */ + data_write_UINT32(out_data + 28, 0); /** HResult */ + data_write_UINT32(out_data + 32, OutputBufferSize); /** OutputBufferSize */ if (!pdev->isSigToEnd(pdev)) callback->channel->Write(callback->channel, out_size, out_data, NULL); @@ -1592,13 +1530,9 @@ static int urb_control_get_configuration_request(URBDRC_CHANNEL_CALLBACK* callba } /* Unused function for current server */ -static int urb_control_get_interface_request(URBDRC_CHANNEL_CALLBACK* callback, - BYTE * data, - UINT32 data_sizem, - UINT32 MessageId, - IUDEVMAN * udevman, - UINT32 UsbDevice, - int transferDir) +static int urb_control_get_interface_request(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, + UINT32 data_sizem, UINT32 MessageId, IUDEVMAN* udevman, + UINT32 UsbDevice, int transferDir) { IUDEVICE* pdev; UINT32 out_size, RequestId, InterfaceId, OutputBufferSize, usbd_status; @@ -1607,7 +1541,8 @@ static int urb_control_get_interface_request(URBDRC_CHANNEL_CALLBACK* callback, BYTE* out_data; int ret, offset; - if (transferDir == 0){ + if (transferDir == 0) + { WLog_DBG(TAG, "urb_control_get_interface_request: not support transfer out"); return -1; } @@ -1615,52 +1550,48 @@ static int urb_control_get_interface_request(URBDRC_CHANNEL_CALLBACK* callback, pdev = udevman->get_udevice_by_UsbDevice(udevman, UsbDevice); if (pdev == NULL) return 0; - InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev)); + InterfaceId = ((STREAM_ID_PROXY << 30) | pdev->get_ReqCompletion(pdev)); data_read_UINT32(data + 0, RequestId); data_read_UINT16(data + 4, interface); data_read_UINT32(data + 8, OutputBufferSize); out_size = 36 + OutputBufferSize; - out_data = (BYTE *) malloc(out_size); + out_data = (BYTE*)malloc(out_size); memset(out_data, 0, out_size); buffer = out_data + 36; - ret = pdev->control_transfer(pdev, RequestId, 0, 0, 0x80 | 0x01, - 0x0A, /* REQUEST_GET_INTERFACE */ - 0, - interface, - &usbd_status, - &OutputBufferSize, - buffer, - 1000); + ret = + pdev->control_transfer(pdev, RequestId, 0, 0, 0x80 | 0x01, 0x0A, /* REQUEST_GET_INTERFACE */ + 0, interface, &usbd_status, &OutputBufferSize, buffer, 1000); - if (ret < 0){ + if (ret < 0) + { WLog_DBG(TAG, "control_transfer: error num %d", ret); OutputBufferSize = 0; } offset = 36; out_size = offset + OutputBufferSize; - data_write_UINT32(out_data + 0, InterfaceId); /** interface */ - data_write_UINT32(out_data + 4, MessageId); /** message id */ + data_write_UINT32(out_data + 0, InterfaceId); /** interface */ + data_write_UINT32(out_data + 4, MessageId); /** message id */ if (OutputBufferSize != 0) data_write_UINT32(out_data + 8, URB_COMPLETION); else data_write_UINT32(out_data + 8, URB_COMPLETION_NO_DATA); - data_write_UINT32(out_data + 12, RequestId); /** RequestId */ - data_write_UINT32(out_data + 16, 8); /** CbTsUrbResult */ + data_write_UINT32(out_data + 12, RequestId); /** RequestId */ + data_write_UINT32(out_data + 16, 8); /** CbTsUrbResult */ /** TsUrbResult TS_URB_RESULT_HEADER */ - data_write_UINT16(out_data + 20, 8); /** Size */ + data_write_UINT16(out_data + 20, 8); /** Size */ /** Padding, MUST be ignored upon receipt */ data_write_UINT16(out_data + 22, URB_FUNCTION_GET_INTERFACE); - data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ + data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ - data_write_UINT32(out_data + 28, 0); /** HResult */ - data_write_UINT32(out_data + 32, OutputBufferSize); /** OutputBufferSize */ + data_write_UINT32(out_data + 28, 0); /** HResult */ + data_write_UINT32(out_data + 32, OutputBufferSize); /** OutputBufferSize */ if (!pdev->isSigToEnd(pdev)) callback->channel->Write(callback->channel, out_size, out_data, NULL); @@ -1668,14 +1599,10 @@ static int urb_control_get_interface_request(URBDRC_CHANNEL_CALLBACK* callback, return 0; } -static int urb_control_feature_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data, - UINT32 data_sizem, - UINT32 MessageId, - IUDEVMAN * udevman, - UINT32 UsbDevice, - BYTE func_recipient, - BYTE command, - int transferDir) +static int urb_control_feature_request(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, + UINT32 data_sizem, UINT32 MessageId, IUDEVMAN* udevman, + UINT32 UsbDevice, BYTE func_recipient, BYTE command, + int transferDir) { IUDEVICE* pdev; UINT32 out_size, RequestId, InterfaceId, OutputBufferSize, usbd_status; @@ -1690,7 +1617,7 @@ static int urb_control_feature_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE if (pdev == NULL) return 0; - InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev)); + InterfaceId = ((STREAM_ID_PROXY << 30) | pdev->get_ReqCompletion(pdev)); data_read_UINT32(data + 0, RequestId); data_read_UINT16(data + 4, FeatureSelector); @@ -1699,7 +1626,7 @@ static int urb_control_feature_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE offset = 12; out_size = 36 + OutputBufferSize; - out_data = (BYTE *) malloc(out_size); + out_data = (BYTE*)malloc(out_size); memset(out_data, 0, out_size); buffer = out_data + 36; @@ -1708,7 +1635,7 @@ static int urb_control_feature_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE switch (transferDir) { case USBD_TRANSFER_DIRECTION_OUT: - WLog_ERR(TAG, "Function urb_control_feature_request: OUT Unchecked"); + WLog_ERR(TAG, "Function urb_control_feature_request: OUT Unchecked"); memcpy(buffer, data + offset, OutputBufferSize); bmRequestType |= 0x00; break; @@ -1726,46 +1653,40 @@ static int urb_control_feature_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE bmRequest = 0x01; /* REQUEST_CLEAR_FEATURE */ break; default: - WLog_ERR(TAG, "urb_control_feature_request: Error Command 0x%02"PRIx8"", command); + WLog_ERR(TAG, "urb_control_feature_request: Error Command 0x%02" PRIx8 "", command); zfree(out_data); return -1; } - ret = pdev->control_transfer( - pdev, RequestId, 0, 0, bmRequestType, bmRequest, - FeatureSelector, - Index, - &usbd_status, - &OutputBufferSize, - buffer, - 1000); + ret = pdev->control_transfer(pdev, RequestId, 0, 0, bmRequestType, bmRequest, FeatureSelector, + Index, &usbd_status, &OutputBufferSize, buffer, 1000); - if (ret < 0){ + if (ret < 0) + { WLog_DBG(TAG, "feature control transfer: error num %d", ret); OutputBufferSize = 0; } offset = 36; out_size = offset + OutputBufferSize; - data_write_UINT32(out_data + 0, InterfaceId); /** interface */ - data_write_UINT32(out_data + 4, MessageId); /** message id */ + data_write_UINT32(out_data + 0, InterfaceId); /** interface */ + data_write_UINT32(out_data + 4, MessageId); /** message id */ if (OutputBufferSize != 0) data_write_UINT32(out_data + 8, URB_COMPLETION); else data_write_UINT32(out_data + 8, URB_COMPLETION_NO_DATA); - data_write_UINT32(out_data + 12, RequestId); /** RequestId */ - data_write_UINT32(out_data + 16, 8); /** CbTsUrbResult */ + data_write_UINT32(out_data + 12, RequestId); /** RequestId */ + data_write_UINT32(out_data + 16, 8); /** CbTsUrbResult */ /** TsUrbResult TS_URB_RESULT_HEADER */ - data_write_UINT16(out_data + 20, 8); /** Size */ + data_write_UINT16(out_data + 20, 8); /** Size */ /** Padding, MUST be ignored upon receipt */ data_write_UINT16(out_data + 22, URB_FUNCTION_GET_INTERFACE); - data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ - - data_write_UINT32(out_data + 28, 0); /** HResult */ - data_write_UINT32(out_data + 32, OutputBufferSize); /** OutputBufferSize */ + data_write_UINT32(out_data + 24, usbd_status); /** UsbdStatus */ + data_write_UINT32(out_data + 28, 0); /** HResult */ + data_write_UINT32(out_data + 32, OutputBufferSize); /** OutputBufferSize */ if (!pdev->isSigToEnd(pdev)) callback->channel->Write(callback->channel, out_size, out_data, NULL); @@ -1773,532 +1694,308 @@ static int urb_control_feature_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE return 0; } -static int urbdrc_process_transfer_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data, - UINT32 data_sizem, - UINT32 MessageId, - IUDEVMAN * udevman, - UINT32 UsbDevice, - int transferDir) +static int urbdrc_process_transfer_request(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, + UINT32 data_sizem, UINT32 MessageId, IUDEVMAN* udevman, + UINT32 UsbDevice, int transferDir) { - IUDEVICE * pdev; - UINT32 CbTsUrb; - UINT16 Size; - UINT16 URB_Function; - UINT32 OutputBufferSize; - int error = 0; + IUDEVICE* pdev; + UINT32 CbTsUrb; + UINT16 Size; + UINT16 URB_Function; + UINT32 OutputBufferSize; + int error = 0; pdev = udevman->get_udevice_by_UsbDevice(udevman, UsbDevice); if (pdev == NULL) return 0; - data_read_UINT32(data + 0, CbTsUrb); /** CbTsUrb */ - data_read_UINT16(data + 4, Size); /** size */ + data_read_UINT32(data + 0, CbTsUrb); /** CbTsUrb */ + data_read_UINT16(data + 4, Size); /** size */ data_read_UINT16(data + 6, URB_Function); data_read_UINT32(data + 4 + CbTsUrb, OutputBufferSize); switch (URB_Function) { - case URB_FUNCTION_SELECT_CONFIGURATION: /** 0x0000 */ + case URB_FUNCTION_SELECT_CONFIGURATION: /** 0x0000 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_SELECT_CONFIGURATION"); - error = urb_select_configuration( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - transferDir); + error = urb_select_configuration(callback, data + 8, data_sizem - 8, MessageId, udevman, + UsbDevice, transferDir); break; - case URB_FUNCTION_SELECT_INTERFACE: /** 0x0001 */ + case URB_FUNCTION_SELECT_INTERFACE: /** 0x0001 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_SELECT_INTERFACE"); - error = urb_select_interface( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - transferDir); + error = urb_select_interface(callback, data + 8, data_sizem - 8, MessageId, udevman, + UsbDevice, transferDir); break; - case URB_FUNCTION_ABORT_PIPE: /** 0x0002 */ + case URB_FUNCTION_ABORT_PIPE: /** 0x0002 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_ABORT_PIPE"); - error = urb_pipe_request( - callback, data + 8, data_sizem - 8, - MessageId, - udevman, - UsbDevice, - transferDir, - PIPE_CANCEL); + error = urb_pipe_request(callback, data + 8, data_sizem - 8, MessageId, udevman, + UsbDevice, transferDir, PIPE_CANCEL); break; - case URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL: /** 0x0003 */ + case URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL: /** 0x0003 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL"); - error = -1; /** This URB function is obsolete in Windows 2000 - * and later operating systems - * and is not supported by Microsoft. */ + error = -1; /** This URB function is obsolete in Windows 2000 + * and later operating systems + * and is not supported by Microsoft. */ break; - case URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL: /** 0x0004 */ + case URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL: /** 0x0004 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL"); - error = -1; /** This URB function is obsolete in Windows 2000 - * and later operating systems - * and is not supported by Microsoft. */ + error = -1; /** This URB function is obsolete in Windows 2000 + * and later operating systems + * and is not supported by Microsoft. */ break; - case URB_FUNCTION_GET_FRAME_LENGTH: /** 0x0005 */ + case URB_FUNCTION_GET_FRAME_LENGTH: /** 0x0005 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_GET_FRAME_LENGTH"); - error = -1; /** This URB function is obsolete in Windows 2000 - * and later operating systems - * and is not supported by Microsoft. */ + error = -1; /** This URB function is obsolete in Windows 2000 + * and later operating systems + * and is not supported by Microsoft. */ break; - case URB_FUNCTION_SET_FRAME_LENGTH: /** 0x0006 */ + case URB_FUNCTION_SET_FRAME_LENGTH: /** 0x0006 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_SET_FRAME_LENGTH"); - error = -1; /** This URB function is obsolete in Windows 2000 - * and later operating systems - * and is not supported by Microsoft. */ + error = -1; /** This URB function is obsolete in Windows 2000 + * and later operating systems + * and is not supported by Microsoft. */ break; - case URB_FUNCTION_GET_CURRENT_FRAME_NUMBER: /** 0x0007 */ + case URB_FUNCTION_GET_CURRENT_FRAME_NUMBER: /** 0x0007 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_GET_CURRENT_FRAME_NUMBER"); - error = urb_get_current_frame_number( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - transferDir); + error = urb_get_current_frame_number(callback, data + 8, data_sizem - 8, MessageId, + udevman, UsbDevice, transferDir); break; - case URB_FUNCTION_CONTROL_TRANSFER: /** 0x0008 */ + case URB_FUNCTION_CONTROL_TRANSFER: /** 0x0008 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_CONTROL_TRANSFER"); - error = urb_control_transfer( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - transferDir, - URB_CONTROL_TRANSFER_NONEXTERNAL); + error = urb_control_transfer(callback, data + 8, data_sizem - 8, MessageId, udevman, + UsbDevice, transferDir, URB_CONTROL_TRANSFER_NONEXTERNAL); break; - case URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER: /** 0x0009 */ + case URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER: /** 0x0009 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER"); - error = urb_bulk_or_interrupt_transfer( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - transferDir); + error = urb_bulk_or_interrupt_transfer(callback, data + 8, data_sizem - 8, MessageId, + udevman, UsbDevice, transferDir); break; - case URB_FUNCTION_ISOCH_TRANSFER: /** 0x000A */ + case URB_FUNCTION_ISOCH_TRANSFER: /** 0x000A */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_ISOCH_TRANSFER"); - error = urb_isoch_transfer( - callback, data + 8, data_sizem - 8, - MessageId, - udevman, - UsbDevice, - transferDir); + error = urb_isoch_transfer(callback, data + 8, data_sizem - 8, MessageId, udevman, + UsbDevice, transferDir); break; - case URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE: /** 0x000B */ + case URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE: /** 0x000B */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE"); - error = urb_control_descriptor_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - 0x00, - transferDir); + error = urb_control_descriptor_request(callback, data + 8, data_sizem - 8, MessageId, + udevman, UsbDevice, 0x00, transferDir); break; - case URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE: /** 0x000C */ + case URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE: /** 0x000C */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE"); - error = urb_control_descriptor_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - 0x00, - transferDir); + error = urb_control_descriptor_request(callback, data + 8, data_sizem - 8, MessageId, + udevman, UsbDevice, 0x00, transferDir); break; - case URB_FUNCTION_SET_FEATURE_TO_DEVICE: /** 0x000D */ + case URB_FUNCTION_SET_FEATURE_TO_DEVICE: /** 0x000D */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_SET_FEATURE_TO_DEVICE"); - error = urb_control_feature_request(callback, - data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - 0x00, - URB_SET_FEATURE, - transferDir); + error = + urb_control_feature_request(callback, data + 8, data_sizem - 8, MessageId, udevman, + UsbDevice, 0x00, URB_SET_FEATURE, transferDir); break; - case URB_FUNCTION_SET_FEATURE_TO_INTERFACE: /** 0x000E */ + case URB_FUNCTION_SET_FEATURE_TO_INTERFACE: /** 0x000E */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_SET_FEATURE_TO_INTERFACE"); - error = urb_control_feature_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - 0x01, - URB_SET_FEATURE, - transferDir); + error = + urb_control_feature_request(callback, data + 8, data_sizem - 8, MessageId, udevman, + UsbDevice, 0x01, URB_SET_FEATURE, transferDir); break; - case URB_FUNCTION_SET_FEATURE_TO_ENDPOINT: /** 0x000F */ + case URB_FUNCTION_SET_FEATURE_TO_ENDPOINT: /** 0x000F */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_SET_FEATURE_TO_ENDPOINT"); - error = urb_control_feature_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - 0x02, - URB_SET_FEATURE, - transferDir); + error = + urb_control_feature_request(callback, data + 8, data_sizem - 8, MessageId, udevman, + UsbDevice, 0x02, URB_SET_FEATURE, transferDir); break; - case URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE: /** 0x0010 */ + case URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE: /** 0x0010 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE"); - error = urb_control_feature_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - 0x00, - URB_CLEAR_FEATURE, - transferDir); + error = + urb_control_feature_request(callback, data + 8, data_sizem - 8, MessageId, udevman, + UsbDevice, 0x00, URB_CLEAR_FEATURE, transferDir); break; - case URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE: /** 0x0011 */ + case URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE: /** 0x0011 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE"); - error = urb_control_feature_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - 0x01, - URB_CLEAR_FEATURE, - transferDir); + error = + urb_control_feature_request(callback, data + 8, data_sizem - 8, MessageId, udevman, + UsbDevice, 0x01, URB_CLEAR_FEATURE, transferDir); break; - case URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT: /** 0x0012 */ + case URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT: /** 0x0012 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT"); - error = urb_control_feature_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - 0x02, - URB_CLEAR_FEATURE, - transferDir); + error = + urb_control_feature_request(callback, data + 8, data_sizem - 8, MessageId, udevman, + UsbDevice, 0x02, URB_CLEAR_FEATURE, transferDir); break; - case URB_FUNCTION_GET_STATUS_FROM_DEVICE: /** 0x0013 */ + case URB_FUNCTION_GET_STATUS_FROM_DEVICE: /** 0x0013 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_GET_STATUS_FROM_DEVICE"); - error = urb_control_get_status_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - 0x00, - transferDir); + error = urb_control_get_status_request(callback, data + 8, data_sizem - 8, MessageId, + udevman, UsbDevice, 0x00, transferDir); break; - case URB_FUNCTION_GET_STATUS_FROM_INTERFACE: /** 0x0014 */ + case URB_FUNCTION_GET_STATUS_FROM_INTERFACE: /** 0x0014 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_GET_STATUS_FROM_INTERFACE"); - error = urb_control_get_status_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - 0x01, - transferDir); + error = urb_control_get_status_request(callback, data + 8, data_sizem - 8, MessageId, + udevman, UsbDevice, 0x01, transferDir); break; - case URB_FUNCTION_GET_STATUS_FROM_ENDPOINT: /** 0x0015 */ + case URB_FUNCTION_GET_STATUS_FROM_ENDPOINT: /** 0x0015 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_GET_STATUS_FROM_ENDPOINT"); - error = urb_control_get_status_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - 0x02, - transferDir); + error = urb_control_get_status_request(callback, data + 8, data_sizem - 8, MessageId, + udevman, UsbDevice, 0x02, transferDir); break; - case URB_FUNCTION_RESERVED_0X0016: /** 0x0016 */ + case URB_FUNCTION_RESERVED_0X0016: /** 0x0016 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_RESERVED_0X0016"); error = -1; break; - case URB_FUNCTION_VENDOR_DEVICE: /** 0x0017 */ + case URB_FUNCTION_VENDOR_DEVICE: /** 0x0017 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_VENDOR_DEVICE"); - error = urb_control_vendor_or_class_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - (0x02 << 5), /* vendor type */ - 0x00, - transferDir); + error = urb_control_vendor_or_class_request(callback, data + 8, data_sizem - 8, + MessageId, udevman, UsbDevice, + (0x02 << 5), /* vendor type */ + 0x00, transferDir); break; - case URB_FUNCTION_VENDOR_INTERFACE: /** 0x0018 */ + case URB_FUNCTION_VENDOR_INTERFACE: /** 0x0018 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_VENDOR_INTERFACE"); - error = urb_control_vendor_or_class_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - (0x02 << 5), /* vendor type */ - 0x01, - transferDir); + error = urb_control_vendor_or_class_request(callback, data + 8, data_sizem - 8, + MessageId, udevman, UsbDevice, + (0x02 << 5), /* vendor type */ + 0x01, transferDir); break; - case URB_FUNCTION_VENDOR_ENDPOINT: /** 0x0019 */ + case URB_FUNCTION_VENDOR_ENDPOINT: /** 0x0019 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_VENDOR_ENDPOINT"); - error = urb_control_vendor_or_class_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - (0x02 << 5), /* vendor type */ - 0x02, - transferDir); + error = urb_control_vendor_or_class_request(callback, data + 8, data_sizem - 8, + MessageId, udevman, UsbDevice, + (0x02 << 5), /* vendor type */ + 0x02, transferDir); break; - case URB_FUNCTION_CLASS_DEVICE: /** 0x001A */ + case URB_FUNCTION_CLASS_DEVICE: /** 0x001A */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_CLASS_DEVICE"); - error = urb_control_vendor_or_class_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - (0x01 << 5), /* class type */ - 0x00, - transferDir); + error = urb_control_vendor_or_class_request(callback, data + 8, data_sizem - 8, + MessageId, udevman, UsbDevice, + (0x01 << 5), /* class type */ + 0x00, transferDir); break; - case URB_FUNCTION_CLASS_INTERFACE: /** 0x001B */ + case URB_FUNCTION_CLASS_INTERFACE: /** 0x001B */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_CLASS_INTERFACE"); - error = urb_control_vendor_or_class_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - (0x01 << 5), /* class type */ - 0x01, - transferDir); + error = urb_control_vendor_or_class_request(callback, data + 8, data_sizem - 8, + MessageId, udevman, UsbDevice, + (0x01 << 5), /* class type */ + 0x01, transferDir); break; - case URB_FUNCTION_CLASS_ENDPOINT: /** 0x001C */ + case URB_FUNCTION_CLASS_ENDPOINT: /** 0x001C */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_CLASS_ENDPOINT"); - error = urb_control_vendor_or_class_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - (0x01 << 5), /* class type */ - 0x02, - transferDir); + error = urb_control_vendor_or_class_request(callback, data + 8, data_sizem - 8, + MessageId, udevman, UsbDevice, + (0x01 << 5), /* class type */ + 0x02, transferDir); break; - case URB_FUNCTION_RESERVE_0X001D: /** 0x001D */ + case URB_FUNCTION_RESERVE_0X001D: /** 0x001D */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_RESERVE_0X001D"); error = -1; break; case URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL: /** 0x001E */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL"); - error = urb_pipe_request( - callback, data + 8, data_sizem - 8, - MessageId, - udevman, - UsbDevice, - transferDir, - PIPE_RESET); + error = urb_pipe_request(callback, data + 8, data_sizem - 8, MessageId, udevman, + UsbDevice, transferDir, PIPE_RESET); break; - case URB_FUNCTION_CLASS_OTHER: /** 0x001F */ + case URB_FUNCTION_CLASS_OTHER: /** 0x001F */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_CLASS_OTHER"); - error = urb_control_vendor_or_class_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - (0x01 << 5), /* class type */ - 0x03, - transferDir); + error = urb_control_vendor_or_class_request(callback, data + 8, data_sizem - 8, + MessageId, udevman, UsbDevice, + (0x01 << 5), /* class type */ + 0x03, transferDir); break; - case URB_FUNCTION_VENDOR_OTHER: /** 0x0020 */ + case URB_FUNCTION_VENDOR_OTHER: /** 0x0020 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_VENDOR_OTHER"); - error = urb_control_vendor_or_class_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - (0x02 << 5), /* vendor type */ - 0x03, - transferDir); + error = urb_control_vendor_or_class_request(callback, data + 8, data_sizem - 8, + MessageId, udevman, UsbDevice, + (0x02 << 5), /* vendor type */ + 0x03, transferDir); break; - case URB_FUNCTION_GET_STATUS_FROM_OTHER: /** 0x0021 */ + case URB_FUNCTION_GET_STATUS_FROM_OTHER: /** 0x0021 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_GET_STATUS_FROM_OTHER"); - error = urb_control_get_status_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - 0x03, - transferDir); + error = urb_control_get_status_request(callback, data + 8, data_sizem - 8, MessageId, + udevman, UsbDevice, 0x03, transferDir); break; - case URB_FUNCTION_CLEAR_FEATURE_TO_OTHER: /** 0x0022 */ + case URB_FUNCTION_CLEAR_FEATURE_TO_OTHER: /** 0x0022 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_CLEAR_FEATURE_TO_OTHER"); - error = urb_control_feature_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - 0x03, - URB_CLEAR_FEATURE, - transferDir); + error = + urb_control_feature_request(callback, data + 8, data_sizem - 8, MessageId, udevman, + UsbDevice, 0x03, URB_CLEAR_FEATURE, transferDir); break; - case URB_FUNCTION_SET_FEATURE_TO_OTHER: /** 0x0023 */ + case URB_FUNCTION_SET_FEATURE_TO_OTHER: /** 0x0023 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_SET_FEATURE_TO_OTHER"); - error = urb_control_feature_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - 0x03, - URB_SET_FEATURE, - transferDir); + error = + urb_control_feature_request(callback, data + 8, data_sizem - 8, MessageId, udevman, + UsbDevice, 0x03, URB_SET_FEATURE, transferDir); break; - case URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT: /** 0x0024 */ + case URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT: /** 0x0024 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT"); - error = urb_control_descriptor_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - 0x02, - transferDir); + error = urb_control_descriptor_request(callback, data + 8, data_sizem - 8, MessageId, + udevman, UsbDevice, 0x02, transferDir); break; - case URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT: /** 0x0025 */ + case URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT: /** 0x0025 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT"); - error = urb_control_descriptor_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - 0x02, - transferDir); + error = urb_control_descriptor_request(callback, data + 8, data_sizem - 8, MessageId, + udevman, UsbDevice, 0x02, transferDir); break; - case URB_FUNCTION_GET_CONFIGURATION: /** 0x0026 */ + case URB_FUNCTION_GET_CONFIGURATION: /** 0x0026 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_GET_CONFIGURATION"); - error = urb_control_get_configuration_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - transferDir); + error = urb_control_get_configuration_request( + callback, data + 8, data_sizem - 8, MessageId, udevman, UsbDevice, transferDir); break; - case URB_FUNCTION_GET_INTERFACE: /** 0x0027 */ + case URB_FUNCTION_GET_INTERFACE: /** 0x0027 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_GET_INTERFACE"); - error = urb_control_get_interface_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - transferDir); + error = urb_control_get_interface_request(callback, data + 8, data_sizem - 8, MessageId, + udevman, UsbDevice, transferDir); break; - case URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE: /** 0x0028 */ + case URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE: /** 0x0028 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE"); - error = urb_control_descriptor_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - 0x01, - transferDir); + error = urb_control_descriptor_request(callback, data + 8, data_sizem - 8, MessageId, + udevman, UsbDevice, 0x01, transferDir); break; - case URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE: /** 0x0029 */ + case URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE: /** 0x0029 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE"); - error = urb_control_descriptor_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - 0x01, - transferDir); + error = urb_control_descriptor_request(callback, data + 8, data_sizem - 8, MessageId, + udevman, UsbDevice, 0x01, transferDir); break; - case URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR: /** 0x002A */ + case URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR: /** 0x002A */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR"); - error = urb_os_feature_descriptor_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - transferDir); + error = urb_os_feature_descriptor_request(callback, data + 8, data_sizem - 8, MessageId, + udevman, UsbDevice, transferDir); break; - case URB_FUNCTION_RESERVE_0X002B: /** 0x002B */ + case URB_FUNCTION_RESERVE_0X002B: /** 0x002B */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_RESERVE_0X002B"); error = -1; break; - case URB_FUNCTION_RESERVE_0X002C: /** 0x002C */ + case URB_FUNCTION_RESERVE_0X002C: /** 0x002C */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_RESERVE_0X002C"); error = -1; break; - case URB_FUNCTION_RESERVE_0X002D: /** 0x002D */ + case URB_FUNCTION_RESERVE_0X002D: /** 0x002D */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_RESERVE_0X002D"); error = -1; break; - case URB_FUNCTION_RESERVE_0X002E: /** 0x002E */ + case URB_FUNCTION_RESERVE_0X002E: /** 0x002E */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_RESERVE_0X002E"); error = -1; break; - case URB_FUNCTION_RESERVE_0X002F: /** 0x002F */ + case URB_FUNCTION_RESERVE_0X002F: /** 0x002F */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_RESERVE_0X002F"); error = -1; break; /** USB 2.0 calls start at 0x0030 */ - case URB_FUNCTION_SYNC_RESET_PIPE: /** 0x0030 */ + case URB_FUNCTION_SYNC_RESET_PIPE: /** 0x0030 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_SYNC_RESET_PIPE"); - error = urb_pipe_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - transferDir, - PIPE_RESET); - error = -9; /** function not support */ + error = urb_pipe_request(callback, data + 8, data_sizem - 8, MessageId, udevman, + UsbDevice, transferDir, PIPE_RESET); + error = -9; /** function not support */ break; - case URB_FUNCTION_SYNC_CLEAR_STALL: /** 0x0031 */ + case URB_FUNCTION_SYNC_CLEAR_STALL: /** 0x0031 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_SYNC_CLEAR_STALL"); - error = urb_pipe_request( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - transferDir, - PIPE_RESET); + error = urb_pipe_request(callback, data + 8, data_sizem - 8, MessageId, udevman, + UsbDevice, transferDir, PIPE_RESET); error = -9; break; - case URB_FUNCTION_CONTROL_TRANSFER_EX: /** 0x0032 */ + case URB_FUNCTION_CONTROL_TRANSFER_EX: /** 0x0032 */ WLog_DBG(TAG, "URB_Func: URB_FUNCTION_CONTROL_TRANSFER_EX"); - error = urb_control_transfer( - callback, data + 8, - data_sizem - 8, - MessageId, - udevman, - UsbDevice, - transferDir, - URB_CONTROL_TRANSFER_EXTERNAL); + error = urb_control_transfer(callback, data + 8, data_sizem - 8, MessageId, udevman, + UsbDevice, transferDir, URB_CONTROL_TRANSFER_EXTERNAL); break; default: - WLog_DBG(TAG, "URB_Func: %"PRIx16" is not found!", URB_Function); + WLog_DBG(TAG, "URB_Func: %" PRIx16 " is not found!", URB_Function); break; } @@ -2307,15 +2004,15 @@ static int urbdrc_process_transfer_request(URBDRC_CHANNEL_CALLBACK * callback, B void* urbdrc_process_udev_data_transfer(void* arg) { - TRANSFER_DATA* transfer_data = (TRANSFER_DATA*) arg; - URBDRC_CHANNEL_CALLBACK * callback = transfer_data->callback; - BYTE * pBuffer = transfer_data->pBuffer; - UINT32 cbSize = transfer_data->cbSize; - UINT32 UsbDevice = transfer_data->UsbDevice; - IUDEVMAN * udevman = transfer_data->udevman; - UINT32 MessageId; - UINT32 FunctionId; - IUDEVICE* pdev; + TRANSFER_DATA* transfer_data = (TRANSFER_DATA*)arg; + URBDRC_CHANNEL_CALLBACK* callback = transfer_data->callback; + BYTE* pBuffer = transfer_data->pBuffer; + UINT32 cbSize = transfer_data->cbSize; + UINT32 UsbDevice = transfer_data->UsbDevice; + IUDEVMAN* udevman = transfer_data->udevman; + UINT32 MessageId; + UINT32 FunctionId; + IUDEVICE* pdev; int error = 0; pdev = udevman->get_udevice_by_UsbDevice(udevman, UsbDevice); if (pdev == NULL || pdev->isSigToEnd(pdev)) @@ -2336,91 +2033,74 @@ void* urbdrc_process_udev_data_transfer(void* arg) switch (FunctionId) { case CANCEL_REQUEST: - WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:" - " >>CANCEL_REQUEST<<0x%"PRIX32"", FunctionId); - error = urbdrc_process_cancel_request( - pBuffer + 8, - cbSize - 8, - udevman, - UsbDevice); + WLog_DBG(TAG, + "urbdrc_process_udev_data_transfer:" + " >>CANCEL_REQUEST<<0x%" PRIX32 "", + FunctionId); + error = urbdrc_process_cancel_request(pBuffer + 8, cbSize - 8, udevman, UsbDevice); break; case REGISTER_REQUEST_CALLBACK: - WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:" - " >>REGISTER_REQUEST_CALLBACK<<0x%"PRIX32"", FunctionId); - error = urbdrc_process_register_request_callback( - callback, - pBuffer + 8, - cbSize - 8, - udevman, - UsbDevice); + WLog_DBG(TAG, + "urbdrc_process_udev_data_transfer:" + " >>REGISTER_REQUEST_CALLBACK<<0x%" PRIX32 "", + FunctionId); + error = urbdrc_process_register_request_callback(callback, pBuffer + 8, cbSize - 8, + udevman, UsbDevice); break; case IO_CONTROL: - WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:" - " >>IO_CONTROL<<0x%"PRIX32"", FunctionId); - error = urbdrc_process_io_control( - callback, - pBuffer + 8, - cbSize - 8, - MessageId, - udevman, UsbDevice); + WLog_DBG(TAG, + "urbdrc_process_udev_data_transfer:" + " >>IO_CONTROL<<0x%" PRIX32 "", + FunctionId); + error = urbdrc_process_io_control(callback, pBuffer + 8, cbSize - 8, MessageId, udevman, + UsbDevice); break; case INTERNAL_IO_CONTROL: - WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:" - " >>INTERNAL_IO_CONTROL<<0x%"PRIX32"", FunctionId); - error = urbdrc_process_internal_io_control( - callback, - pBuffer + 8, - cbSize - 8, - MessageId, - udevman, UsbDevice); + WLog_DBG(TAG, + "urbdrc_process_udev_data_transfer:" + " >>INTERNAL_IO_CONTROL<<0x%" PRIX32 "", + FunctionId); + error = urbdrc_process_internal_io_control(callback, pBuffer + 8, cbSize - 8, MessageId, + udevman, UsbDevice); break; case QUERY_DEVICE_TEXT: - WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:" - " >>QUERY_DEVICE_TEXT<<0x%"PRIX32"", FunctionId); - error = urbdrc_process_query_device_text( - callback, - pBuffer + 8, - cbSize - 8, - MessageId, - udevman, - UsbDevice); + WLog_DBG(TAG, + "urbdrc_process_udev_data_transfer:" + " >>QUERY_DEVICE_TEXT<<0x%" PRIX32 "", + FunctionId); + error = urbdrc_process_query_device_text(callback, pBuffer + 8, cbSize - 8, MessageId, + udevman, UsbDevice); break; case TRANSFER_IN_REQUEST: - WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:" - " >>TRANSFER_IN_REQUEST<<0x%"PRIX32"", FunctionId); - error = urbdrc_process_transfer_request( - callback, - pBuffer + 8, - cbSize - 8, - MessageId, - udevman, - UsbDevice, - USBD_TRANSFER_DIRECTION_IN); + WLog_DBG(TAG, + "urbdrc_process_udev_data_transfer:" + " >>TRANSFER_IN_REQUEST<<0x%" PRIX32 "", + FunctionId); + error = urbdrc_process_transfer_request(callback, pBuffer + 8, cbSize - 8, MessageId, + udevman, UsbDevice, USBD_TRANSFER_DIRECTION_IN); break; case TRANSFER_OUT_REQUEST: - WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:" - " >>TRANSFER_OUT_REQUEST<<0x%"PRIX32"", FunctionId); - error = urbdrc_process_transfer_request( - callback, - pBuffer + 8, - cbSize - 8, - MessageId, - udevman, - UsbDevice, - USBD_TRANSFER_DIRECTION_OUT); + WLog_DBG(TAG, + "urbdrc_process_udev_data_transfer:" + " >>TRANSFER_OUT_REQUEST<<0x%" PRIX32 "", + FunctionId); + error = + urbdrc_process_transfer_request(callback, pBuffer + 8, cbSize - 8, MessageId, + udevman, UsbDevice, USBD_TRANSFER_DIRECTION_OUT); break; case RETRACT_DEVICE: - WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:" - " >>RETRACT_DEVICE<<0x%"PRIX32"", FunctionId); - error = urbdrc_process_retract_device_request( - pBuffer + 8, - cbSize - 8, - udevman, - UsbDevice); + WLog_DBG(TAG, + "urbdrc_process_udev_data_transfer:" + " >>RETRACT_DEVICE<<0x%" PRIX32 "", + FunctionId); + error = + urbdrc_process_retract_device_request(pBuffer + 8, cbSize - 8, udevman, UsbDevice); break; default: - WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:" - " unknown FunctionId 0x%"PRIX32"", FunctionId); + WLog_DBG(TAG, + "urbdrc_process_udev_data_transfer:" + " unknown FunctionId 0x%" PRIX32 "", + FunctionId); error = -1; break; } diff --git a/channels/urbdrc/client/data_transfer.h b/channels/urbdrc/client/data_transfer.h index bc3d70860..5e47e2de5 100644 --- a/channels/urbdrc/client/data_transfer.h +++ b/channels/urbdrc/client/data_transfer.h @@ -26,10 +26,8 @@ #define DEVICE_CTX(dev) ((dev)->ctx) #define HANDLE_CTX(handle) (DEVICE_CTX((handle)->dev)) #define TRANSFER_CTX(transfer) (HANDLE_CTX((transfer)->dev_handle)) -#define ITRANSFER_CTX(transfer) \ - (TRANSFER_CTX(__USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer))) +#define ITRANSFER_CTX(transfer) (TRANSFER_CTX(__USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer))) -void *urbdrc_process_udev_data_transfer(void* arg); +void* urbdrc_process_udev_data_transfer(void* arg); #endif /* FREERDP_CHANNEL_URBDRC_CLIENT_DATA_TRANSFER_H */ - diff --git a/channels/urbdrc/client/isoch_queue.c b/channels/urbdrc/client/isoch_queue.c index 4e051f9e0..eff5fbeab 100644 --- a/channels/urbdrc/client/isoch_queue.c +++ b/channels/urbdrc/client/isoch_queue.c @@ -44,17 +44,18 @@ static ISOCH_CALLBACK_DATA* isoch_queue_get_next(ISOCH_CALLBACK_QUEUE* queue) return isoch; } -static ISOCH_CALLBACK_DATA* isoch_queue_register_data(ISOCH_CALLBACK_QUEUE* queue, void* callback, void* dev) +static ISOCH_CALLBACK_DATA* isoch_queue_register_data(ISOCH_CALLBACK_QUEUE* queue, void* callback, + void* dev) { ISOCH_CALLBACK_DATA* isoch; - - isoch = (ISOCH_CALLBACK_DATA*) calloc(1, sizeof(ISOCH_CALLBACK_DATA)); + + isoch = (ISOCH_CALLBACK_DATA*)calloc(1, sizeof(ISOCH_CALLBACK_DATA)); if (!isoch) return NULL; - + isoch->device = dev; isoch->callback = callback; - + pthread_mutex_lock(&queue->isoch_loading); if (queue->head == NULL) @@ -80,7 +81,7 @@ static ISOCH_CALLBACK_DATA* isoch_queue_register_data(ISOCH_CALLBACK_QUEUE* queu static int isoch_queue_unregister_data(ISOCH_CALLBACK_QUEUE* queue, ISOCH_CALLBACK_DATA* isoch) { ISOCH_CALLBACK_DATA* p; - + queue->rewind(queue); while (queue->has_next(queue)) @@ -157,20 +158,20 @@ void isoch_queue_free(ISOCH_CALLBACK_QUEUE* queue) pthread_mutex_destroy(&queue->isoch_loading); /* free queue */ - if (queue) + if (queue) zfree(queue); } ISOCH_CALLBACK_QUEUE* isoch_queue_new() { ISOCH_CALLBACK_QUEUE* queue; - - queue = (ISOCH_CALLBACK_QUEUE*) calloc(1, sizeof(ISOCH_CALLBACK_QUEUE)); + + queue = (ISOCH_CALLBACK_QUEUE*)calloc(1, sizeof(ISOCH_CALLBACK_QUEUE)); if (!queue) return NULL; - + pthread_mutex_init(&queue->isoch_loading, NULL); - + /* load service */ queue->get_next = isoch_queue_get_next; queue->has_next = isoch_queue_has_next; @@ -178,6 +179,6 @@ ISOCH_CALLBACK_QUEUE* isoch_queue_new() queue->register_data = isoch_queue_register_data; queue->unregister_data = isoch_queue_unregister_data; queue->free = isoch_queue_free; - + return queue; } diff --git a/channels/urbdrc/client/isoch_queue.h b/channels/urbdrc/client/isoch_queue.h index 90ab1a162..a58078816 100644 --- a/channels/urbdrc/client/isoch_queue.h +++ b/channels/urbdrc/client/isoch_queue.h @@ -23,47 +23,38 @@ #include "urbdrc_types.h" - typedef struct _ISOCH_CALLBACK_DATA ISOCH_CALLBACK_DATA; typedef struct _ISOCH_CALLBACK_QUEUE ISOCH_CALLBACK_QUEUE; - struct _ISOCH_CALLBACK_DATA { - void * inode; - void * prev; - void * next; - void * device; - BYTE * out_data; + void* inode; + void* prev; + void* next; + void* device; + BYTE* out_data; UINT32 out_size; - void * callback; + void* callback; }; - - struct _ISOCH_CALLBACK_QUEUE { int isoch_num; ISOCH_CALLBACK_DATA* curr; /* current point */ ISOCH_CALLBACK_DATA* head; /* head point in linked list */ ISOCH_CALLBACK_DATA* tail; /* tail point in linked list */ - - pthread_mutex_t isoch_loading; - - /* Isochronous queue service */ - void (*rewind) (ISOCH_CALLBACK_QUEUE * queue); - BOOL (*has_next) (ISOCH_CALLBACK_QUEUE * queue); - int (*unregister_data) (ISOCH_CALLBACK_QUEUE* queue, ISOCH_CALLBACK_DATA* isoch); - ISOCH_CALLBACK_DATA *(*get_next) (ISOCH_CALLBACK_QUEUE * queue); - ISOCH_CALLBACK_DATA *(*register_data) (ISOCH_CALLBACK_QUEUE* queue, - void * callback, void * dev); - void (*free) (ISOCH_CALLBACK_QUEUE * queue); - -}; + pthread_mutex_t isoch_loading; + + /* Isochronous queue service */ + void (*rewind)(ISOCH_CALLBACK_QUEUE* queue); + BOOL (*has_next)(ISOCH_CALLBACK_QUEUE* queue); + int (*unregister_data)(ISOCH_CALLBACK_QUEUE* queue, ISOCH_CALLBACK_DATA* isoch); + ISOCH_CALLBACK_DATA* (*get_next)(ISOCH_CALLBACK_QUEUE* queue); + ISOCH_CALLBACK_DATA* (*register_data)(ISOCH_CALLBACK_QUEUE* queue, void* callback, void* dev); + void (*free)(ISOCH_CALLBACK_QUEUE* queue); +}; ISOCH_CALLBACK_QUEUE* isoch_queue_new(void); - - #endif /* FREERDP_CHANNEL_URBDRC_CLIENT_ISOCH_QUEUE_H */ diff --git a/channels/urbdrc/client/libusb/libusb_udevice.c b/channels/urbdrc/client/libusb/libusb_udevice.c index 0b1ab0721..084108a92 100644 --- a/channels/urbdrc/client/libusb/libusb_udevice.c +++ b/channels/urbdrc/client/libusb/libusb_udevice.c @@ -31,35 +31,34 @@ #include "libusb_udevice.h" -#define BASIC_STATE_FUNC_DEFINED(_arg, _type) \ - static _type udev_get_##_arg (IUDEVICE* idev) \ - { \ - UDEVICE* pdev = (UDEVICE*) idev; \ - return pdev->_arg; \ - } \ - static void udev_set_##_arg (IUDEVICE* idev, _type _t) \ - { \ - UDEVICE* pdev = (UDEVICE*) idev; \ - pdev->_arg = _t; \ +#define BASIC_STATE_FUNC_DEFINED(_arg, _type) \ + static _type udev_get_##_arg(IUDEVICE* idev) \ + { \ + UDEVICE* pdev = (UDEVICE*)idev; \ + return pdev->_arg; \ + } \ + static void udev_set_##_arg(IUDEVICE* idev, _type _t) \ + { \ + UDEVICE* pdev = (UDEVICE*)idev; \ + pdev->_arg = _t; \ } -#define BASIC_POINT_FUNC_DEFINED(_arg, _type) \ - static _type udev_get_p_##_arg (IUDEVICE* idev) \ - { \ - UDEVICE* pdev = (UDEVICE*) idev; \ - return pdev->_arg; \ - } \ - static void udev_set_p_##_arg (IUDEVICE* idev, _type _t) \ - { \ - UDEVICE* pdev = (UDEVICE*) idev; \ - pdev->_arg = _t; \ +#define BASIC_POINT_FUNC_DEFINED(_arg, _type) \ + static _type udev_get_p_##_arg(IUDEVICE* idev) \ + { \ + UDEVICE* pdev = (UDEVICE*)idev; \ + return pdev->_arg; \ + } \ + static void udev_set_p_##_arg(IUDEVICE* idev, _type _t) \ + { \ + UDEVICE* pdev = (UDEVICE*)idev; \ + pdev->_arg = _t; \ } #define BASIC_STATE_FUNC_REGISTER(_arg, _dev) \ _dev->iface.get_##_arg = udev_get_##_arg; \ _dev->iface.set_##_arg = udev_set_##_arg - typedef struct _ISO_USER_DATA ISO_USER_DATA; struct _ISO_USER_DATA @@ -167,7 +166,7 @@ already_done: static void func_iso_callback(struct libusb_transfer* transfer) { - ISO_USER_DATA* iso_user_data = (ISO_USER_DATA*) transfer->user_data; + ISO_USER_DATA* iso_user_data = (ISO_USER_DATA*)transfer->user_data; BYTE* data = iso_user_data->IsoPacket; int* completed = &iso_user_data->completed; UINT32 offset = 0; @@ -186,8 +185,7 @@ static void func_iso_callback(struct libusb_transfer* transfer) act_len = transfer->iso_packet_desc[i].actual_length; data_write_UINT32(data + offset, index); data_write_UINT32(data + offset + 4, act_len); - data_write_UINT32(data + offset + 8, - transfer->iso_packet_desc[i].status); + data_write_UINT32(data + offset + 8, transfer->iso_packet_desc[i].status); offset += 12; if (transfer->iso_packet_desc[i].status == USBD_STATUS_SUCCESS) @@ -203,14 +201,14 @@ static void func_iso_callback(struct libusb_transfer* transfer) } else { - //WLog_ERR(TAG, "actual length %"PRIu32"", act_len); - //exit(EXIT_FAILURE); + // WLog_ERR(TAG, "actual length %"PRIu32"", act_len); + // exit(EXIT_FAILURE); } } else { iso_user_data->error_count++; - //print_transfer_status(transfer->iso_packet_desc[i].status); + // print_transfer_status(transfer->iso_packet_desc[i].status); } } @@ -225,18 +223,19 @@ static void func_iso_callback(struct libusb_transfer* transfer) } else { - //print_status(transfer->status); + // print_status(transfer->status); iso_user_data->iso_status = -1; } } static const LIBUSB_ENDPOINT_DESCEIPTOR* func_get_ep_desc(LIBUSB_CONFIG_DESCRIPTOR* LibusbConfig, - MSUSB_CONFIG_DESCRIPTOR* MsConfig, UINT32 EndpointAddress) + MSUSB_CONFIG_DESCRIPTOR* MsConfig, + UINT32 EndpointAddress) { BYTE alt; UINT32 inum, pnum; MSUSB_INTERFACE_DESCRIPTOR** MsInterfaces; - const LIBUSB_INTERFACE* interface; + const LIBUSB_INTERFACE* interface; const LIBUSB_ENDPOINT_DESCEIPTOR* endpoint; MsInterfaces = MsConfig->MsInterfaces; interface = LibusbConfig->interface; @@ -357,7 +356,7 @@ static void func_iso_data_init(ISO_USER_DATA* iso_user_data, UINT32 numPacket, U } static int func_config_release_all_interface(LIBUSB_DEVICE_HANDLE* libusb_handle, - UINT32 NumInterfaces) + UINT32 NumInterfaces) { UINT32 i; int ret; @@ -368,7 +367,7 @@ static int func_config_release_all_interface(LIBUSB_DEVICE_HANDLE* libusb_handle if (ret < 0) { - WLog_ERR(TAG, "config_release_all_interface: error num %d", ret); + WLog_ERR(TAG, "config_release_all_interface: error num %d", ret); return -1; } } @@ -386,7 +385,7 @@ static int func_claim_all_interface(LIBUSB_DEVICE_HANDLE* libusb_handle, int Num if (ret < 0) { - WLog_ERR(TAG, "claim_all_interface: error num %d", ret); + WLog_ERR(TAG, "claim_all_interface: error num %d", ret); return -1; } } @@ -397,65 +396,65 @@ static int func_claim_all_interface(LIBUSB_DEVICE_HANDLE* libusb_handle, int Num /* static void* print_transfer_status(enum libusb_transfer_status status) { - switch (status) - { - case LIBUSB_TRANSFER_COMPLETED: - //WLog_ERR(TAG, "Transfer Status: LIBUSB_TRANSFER_COMPLETED"); - break; - case LIBUSB_TRANSFER_ERROR: - WLog_ERR(TAG, "Transfer Status: LIBUSB_TRANSFER_ERROR"); - break; - case LIBUSB_TRANSFER_TIMED_OUT: - WLog_ERR(TAG, "Transfer Status: LIBUSB_TRANSFER_TIMED_OUT"); - break; - case LIBUSB_TRANSFER_CANCELLED: - WLog_ERR(TAG, "Transfer Status: LIBUSB_TRANSFER_CANCELLED"); - break; - case LIBUSB_TRANSFER_STALL: - WLog_ERR(TAG, "Transfer Status: LIBUSB_TRANSFER_STALL"); - break; - case LIBUSB_TRANSFER_NO_DEVICE: - WLog_ERR(TAG, "Transfer Status: LIBUSB_TRANSFER_NO_DEVICE"); - break; - case LIBUSB_TRANSFER_OVERFLOW: - WLog_ERR(TAG, "Transfer Status: LIBUSB_TRANSFER_OVERFLOW"); - break; - default: - WLog_ERR(TAG, "Transfer Status: Get unknow error num %d (0x%x)", - status, status); - } - return 0; + switch (status) + { + case LIBUSB_TRANSFER_COMPLETED: + //WLog_ERR(TAG, "Transfer Status: LIBUSB_TRANSFER_COMPLETED"); + break; + case LIBUSB_TRANSFER_ERROR: + WLog_ERR(TAG, "Transfer Status: LIBUSB_TRANSFER_ERROR"); + break; + case LIBUSB_TRANSFER_TIMED_OUT: + WLog_ERR(TAG, "Transfer Status: LIBUSB_TRANSFER_TIMED_OUT"); + break; + case LIBUSB_TRANSFER_CANCELLED: + WLog_ERR(TAG, "Transfer Status: LIBUSB_TRANSFER_CANCELLED"); + break; + case LIBUSB_TRANSFER_STALL: + WLog_ERR(TAG, "Transfer Status: LIBUSB_TRANSFER_STALL"); + break; + case LIBUSB_TRANSFER_NO_DEVICE: + WLog_ERR(TAG, "Transfer Status: LIBUSB_TRANSFER_NO_DEVICE"); + break; + case LIBUSB_TRANSFER_OVERFLOW: + WLog_ERR(TAG, "Transfer Status: LIBUSB_TRANSFER_OVERFLOW"); + break; + default: + WLog_ERR(TAG, "Transfer Status: Get unknow error num %d (0x%x)", + status, status); + } + return 0; } static void print_status(enum libusb_transfer_status status) { - switch (status) - { - case LIBUSB_TRANSFER_COMPLETED: - WLog_ERR(TAG, "Transfer status: LIBUSB_TRANSFER_COMPLETED"); - break; - case LIBUSB_TRANSFER_ERROR: - WLog_ERR(TAG, "Transfer status: LIBUSB_TRANSFER_ERROR"); - break; - case LIBUSB_TRANSFER_TIMED_OUT: - WLog_ERR(TAG, "Transfer status: LIBUSB_TRANSFER_TIMED_OUT"); - break; - case LIBUSB_TRANSFER_CANCELLED: - WLog_ERR(TAG, "Transfer status: LIBUSB_TRANSFER_CANCELLED"); - break; - case LIBUSB_TRANSFER_STALL: - WLog_ERR(TAG, "Transfer status: LIBUSB_TRANSFER_STALL"); - break; - case LIBUSB_TRANSFER_NO_DEVICE: - WLog_ERR(TAG, "Transfer status: LIBUSB_TRANSFER_NO_DEVICE"); - break; - case LIBUSB_TRANSFER_OVERFLOW: - WLog_ERR(TAG, "Transfer status: LIBUSB_TRANSFER_OVERFLOW"); - break; - default: - WLog_ERR(TAG, "Transfer status: unknow status %d(0x%x)", status, status); - break; - } + switch (status) + { + case LIBUSB_TRANSFER_COMPLETED: + WLog_ERR(TAG, "Transfer status: LIBUSB_TRANSFER_COMPLETED"); + break; + case LIBUSB_TRANSFER_ERROR: + WLog_ERR(TAG, "Transfer status: LIBUSB_TRANSFER_ERROR"); + break; + case LIBUSB_TRANSFER_TIMED_OUT: + WLog_ERR(TAG, "Transfer status: LIBUSB_TRANSFER_TIMED_OUT"); + break; + case LIBUSB_TRANSFER_CANCELLED: + WLog_ERR(TAG, "Transfer status: LIBUSB_TRANSFER_CANCELLED"); + break; + case LIBUSB_TRANSFER_STALL: + WLog_ERR(TAG, "Transfer status: LIBUSB_TRANSFER_STALL"); + break; + case LIBUSB_TRANSFER_NO_DEVICE: + WLog_ERR(TAG, "Transfer status: LIBUSB_TRANSFER_NO_DEVICE"); + break; + case LIBUSB_TRANSFER_OVERFLOW: + WLog_ERR(TAG, "Transfer status: LIBUSB_TRANSFER_OVERFLOW"); + break; + default: + WLog_ERR(TAG, "Transfer status: unknow status %d(0x%x)", status, status); + break; + } } */ @@ -480,12 +479,12 @@ static LIBUSB_DEVICE_DESCRIPTOR* udev_new_descript(LIBUSB_DEVICE* libusb_dev) { int ret; LIBUSB_DEVICE_DESCRIPTOR* descriptor; - descriptor = (LIBUSB_DEVICE_DESCRIPTOR*) malloc(sizeof(LIBUSB_DEVICE_DESCRIPTOR)); + descriptor = (LIBUSB_DEVICE_DESCRIPTOR*)malloc(sizeof(LIBUSB_DEVICE_DESCRIPTOR)); ret = libusb_get_device_descriptor(libusb_dev, descriptor); if (ret < 0) { - WLog_ERR(TAG, "libusb_get_device_descriptor: ERROR!!"); + WLog_ERR(TAG, "libusb_get_device_descriptor: ERROR!!"); free(descriptor); return NULL; } @@ -505,7 +504,7 @@ static int udev_get_hub_handle(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_numb /* Look for device. */ error = -1; - for (i = 0; i < total_device; i ++) + for (i = 0; i < total_device; i++) { if ((bus_number != libusb_get_bus_number(libusb_list[i])) || (dev_number != libusb_get_device_address(libusb_list[i]))) @@ -534,7 +533,8 @@ static int udev_get_hub_handle(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_numb error = 0; WLog_DBG(TAG, " Port: %d", pdev->port_number); /* gen device path */ - sprintf_s(pdev->path, ARRAYSIZE(pdev->path), "ugen%"PRIu16".%"PRIu16"", bus_number, dev_number); + sprintf_s(pdev->path, ARRAYSIZE(pdev->path), "ugen%" PRIu16 ".%" PRIu16 "", bus_number, + dev_number); WLog_DBG(TAG, " DevPath: %s", pdev->path); break; } @@ -544,13 +544,14 @@ static int udev_get_hub_handle(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_numb { error = -1; - for (i = 0; i < total_device; i ++) + for (i = 0; i < total_device; i++) { if ((bus_number != libusb_get_bus_number(libusb_list[i])) || - (1 != libusb_get_device_address(libusb_list[i]))) /* Root hub allways first on bus. */ + (1 != + libusb_get_device_address(libusb_list[i]))) /* Root hub allways first on bus. */ continue; - WLog_DBG(TAG, " Open hub: %"PRIu16"", bus_number); + WLog_DBG(TAG, " Open hub: %" PRIu16 "", bus_number); error = libusb_open(libusb_list[i], &pdev->hub_handle); if (error < 0) @@ -619,28 +620,25 @@ static int udev_get_hub_handle(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_numb if (bus_number == tmp_b && dev_number == tmp_d) { /* get port number */ - char* p1, *p2; - const char* sysfs_path = - udev_device_get_property_value(dev, "DEVPATH"); - p1 = (char*) sysfs_path; + char *p1, *p2; + const char* sysfs_path = udev_device_get_property_value(dev, "DEVPATH"); + p1 = (char*)sysfs_path; do { p2 = p1 + 1; p1 = strchr(p2, '.'); - } - while (p1 != NULL); + } while (p1 != NULL); if ((size_t)((p2 - sysfs_path) + 2U) < strlen(sysfs_path)) { - p1 = (char*) sysfs_path; + p1 = (char*)sysfs_path; do { p2 = p1 + 1; p1 = strchr(p2, '-'); - } - while (p1 != NULL); + } while (p1 != NULL); } errno = 0; @@ -654,14 +652,13 @@ static int udev_get_hub_handle(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_numb } WLog_DBG(TAG, " Port: %d", pdev->port_number); /* get device path */ - p1 = (char*) sysfs_path; + p1 = (char*)sysfs_path; do { p2 = p1 + 1; p1 = strchr(p2, '/'); - } - while (p1 != NULL); + } while (p1 != NULL); sprintf_s(pdev->path, ARRAYSIZE(pdev->path), "%s", p2); WLog_DBG(TAG, " DevPath: %s", pdev->path); @@ -717,7 +714,7 @@ static int udev_get_hub_handle(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_numb static int libusb_udev_select_interface(IUDEVICE* idev, BYTE InterfaceNumber, BYTE AlternateSetting) { int error = 0, diff = 1; - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; MSUSB_CONFIG_DESCRIPTOR* MsConfig; MSUSB_INTERFACE_DESCRIPTOR** MsInterfaces; MsConfig = pdev->MsConfig; @@ -734,23 +731,22 @@ static int libusb_udev_select_interface(IUDEVICE* idev, BYTE InterfaceNumber, BY if (diff) { - error = libusb_set_interface_alt_setting(pdev->libusb_handle, - InterfaceNumber, AlternateSetting); + error = libusb_set_interface_alt_setting(pdev->libusb_handle, InterfaceNumber, + AlternateSetting); if (error < 0) { - WLog_ERR(TAG, "Set interface altsetting get error num %d", - error); + WLog_ERR(TAG, "Set interface altsetting get error num %d", error); } } return error; } -static MSUSB_CONFIG_DESCRIPTOR* libusb_udev_complete_msconfig_setup(IUDEVICE* idev, - MSUSB_CONFIG_DESCRIPTOR* MsConfig) +static MSUSB_CONFIG_DESCRIPTOR* +libusb_udev_complete_msconfig_setup(IUDEVICE* idev, MSUSB_CONFIG_DESCRIPTOR* MsConfig) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; MSUSB_INTERFACE_DESCRIPTOR** MsInterfaces; MSUSB_INTERFACE_DESCRIPTOR* MsInterface; MSUSB_PIPE_DESCRIPTOR** MsPipes; @@ -767,8 +763,9 @@ static MSUSB_CONFIG_DESCRIPTOR* libusb_udev_complete_msconfig_setup(IUDEVICE* id if (LibusbConfig->bNumInterfaces != MsConfig->NumInterfaces) { - WLog_ERR(TAG, "Select Configuration: Libusb NumberInterfaces(%"PRIu8") is different " - "with MsConfig NumberInterfaces(%"PRIu32")", + WLog_ERR(TAG, + "Select Configuration: Libusb NumberInterfaces(%" PRIu8 ") is different " + "with MsConfig NumberInterfaces(%" PRIu32 ")", LibusbConfig->bNumInterfaces, MsConfig->NumInterfaces); } @@ -782,11 +779,12 @@ static MSUSB_CONFIG_DESCRIPTOR* libusb_udev_complete_msconfig_setup(IUDEVICE* id LibusbInterface = &LibusbConfig->interface[MsInterface->InterfaceNumber]; LibusbAltsetting = &LibusbInterface->altsetting[MsInterface->AlternateSetting]; LibusbNumEndpoint = LibusbAltsetting->bNumEndpoints; - t_MsPipes = (MSUSB_PIPE_DESCRIPTOR**) calloc(LibusbNumEndpoint, sizeof(MSUSB_PIPE_DESCRIPTOR*)); + t_MsPipes = + (MSUSB_PIPE_DESCRIPTOR**)calloc(LibusbNumEndpoint, sizeof(MSUSB_PIPE_DESCRIPTOR*)); for (pnum = 0; pnum < LibusbNumEndpoint; pnum++) { - t_MsPipe = (MSUSB_PIPE_DESCRIPTOR*) malloc(sizeof(MSUSB_PIPE_DESCRIPTOR)); + t_MsPipe = (MSUSB_PIPE_DESCRIPTOR*)malloc(sizeof(MSUSB_PIPE_DESCRIPTOR)); memset(t_MsPipe, 0, sizeof(MSUSB_PIPE_DESCRIPTOR)); if (pnum < MsInterface->NumberOfPipes && MsInterface->MsPipes) @@ -817,14 +815,13 @@ static MSUSB_CONFIG_DESCRIPTOR* libusb_udev_complete_msconfig_setup(IUDEVICE* id /* setup configuration */ MsOutSize = 8; /* ConfigurationHandle: 4 bytes - * --------------------------------------------------------------- - * ||<<< 1 byte >>>|<<< 1 byte >>>|<<<<<<<<<< 2 byte >>>>>>>>>>>|| - * || bus_number | dev_number | bConfigurationValue || - * --------------------------------------------------------------- + * --------------------------------------------------------------- + * ||<<< 1 byte >>>|<<< 1 byte >>>|<<<<<<<<<< 2 byte >>>>>>>>>>>|| + * || bus_number | dev_number | bConfigurationValue || + * --------------------------------------------------------------- * ***********************/ - MsConfig->ConfigurationHandle = MsConfig->bConfigurationValue | - (pdev->bus_number << 24) | - (pdev->dev_number << 16); + MsConfig->ConfigurationHandle = + MsConfig->bConfigurationValue | (pdev->bus_number << 24) | (pdev->dev_number << 16); MsInterfaces = MsConfig->MsInterfaces; for (inum = 0; inum < MsConfig->NumInterfaces; inum++) @@ -840,10 +837,9 @@ static MSUSB_CONFIG_DESCRIPTOR* libusb_udev_complete_msconfig_setup(IUDEVICE* id * || bus_number | dev_number | altsetting | interfaceNum || * --------------------------------------------------------------- * ***********************/ - MsInterface->InterfaceHandle = LibusbAltsetting->bInterfaceNumber - | (LibusbAltsetting->bAlternateSetting << 8) - | (pdev->dev_number << 16) - | (pdev->bus_number << 24); + MsInterface->InterfaceHandle = LibusbAltsetting->bInterfaceNumber | + (LibusbAltsetting->bAlternateSetting << 8) | + (pdev->dev_number << 16) | (pdev->bus_number << 24); MsInterface->Length = 16 + (MsInterface->NumberOfPipes * 20); MsInterface->bInterfaceClass = LibusbAltsetting->bInterfaceClass; MsInterface->bInterfaceSubClass = LibusbAltsetting->bInterfaceSubClass; @@ -864,9 +860,8 @@ static MSUSB_CONFIG_DESCRIPTOR* libusb_udev_complete_msconfig_setup(IUDEVICE* id * || bus_number | dev_number | bEndpointAddress || * --------------------------------------------------------------- * ***********************/ - MsPipe->PipeHandle = LibusbEndpoint->bEndpointAddress - | (pdev->dev_number << 16) - | (pdev->bus_number << 24); + MsPipe->PipeHandle = LibusbEndpoint->bEndpointAddress | (pdev->dev_number << 16) | + (pdev->bus_number << 24); /* count endpoint max packet size */ int max = LibusbEndpoint->wMaxPacketSize & 0x07ff; BYTE attr = LibusbEndpoint->bmAttributes; @@ -899,7 +894,7 @@ static MSUSB_CONFIG_DESCRIPTOR* libusb_udev_complete_msconfig_setup(IUDEVICE* id static int libusb_udev_select_configuration(IUDEVICE* idev, UINT32 bConfigurationValue) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; MSUSB_CONFIG_DESCRIPTOR* MsConfig = pdev->MsConfig; LIBUSB_DEVICE_HANDLE* libusb_handle = pdev->libusb_handle; LIBUSB_DEVICE* libusb_dev = pdev->libusb_dev; @@ -919,7 +914,7 @@ static int libusb_udev_select_configuration(IUDEVICE* idev, UINT32 bConfiguratio if (ret < 0) { - WLog_ERR(TAG, "libusb_set_configuration: ERROR number %d!!", ret); + WLog_ERR(TAG, "libusb_set_configuration: ERROR number %d!!", ret); func_claim_all_interface(libusb_handle, (*LibusbConfig)->bNumInterfaces); return -1; } @@ -929,7 +924,7 @@ static int libusb_udev_select_configuration(IUDEVICE* idev, UINT32 bConfiguratio if (ret < 0) { - WLog_ERR(TAG, "libusb_get_config_descriptor_by_value: ERROR number %d!!", ret); + WLog_ERR(TAG, "libusb_get_config_descriptor_by_value: ERROR number %d!!", ret); func_claim_all_interface(libusb_handle, (*LibusbConfig)->bNumInterfaces); return -1; } @@ -940,10 +935,10 @@ static int libusb_udev_select_configuration(IUDEVICE* idev, UINT32 bConfiguratio } static int libusb_udev_control_pipe_request(IUDEVICE* idev, UINT32 RequestId, - UINT32 EndpointAddress, UINT32* UsbdStatus, int command) + UINT32 EndpointAddress, UINT32* UsbdStatus, int command) { int error = 0; - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; /* pdev->request_queue->register_request(pdev->request_queue, RequestId, NULL, 0); @@ -953,22 +948,17 @@ static int libusb_udev_control_pipe_request(IUDEVICE* idev, UINT32 RequestId, case PIPE_CANCEL: /** cancel bulk or int transfer */ idev->cancel_all_transfer_request(idev); - //dummy_wait_s_obj(1); + // dummy_wait_s_obj(1); /** set feature to ep (set halt)*/ - error = libusb_control_transfer(pdev->libusb_handle, - LIBUSB_ENDPOINT_OUT | LIBUSB_RECIPIENT_ENDPOINT, - LIBUSB_REQUEST_SET_FEATURE, - ENDPOINT_HALT, - EndpointAddress, - NULL, - 0, - 1000); + error = libusb_control_transfer( + pdev->libusb_handle, LIBUSB_ENDPOINT_OUT | LIBUSB_RECIPIENT_ENDPOINT, + LIBUSB_REQUEST_SET_FEATURE, ENDPOINT_HALT, EndpointAddress, NULL, 0, 1000); break; case PIPE_RESET: idev->cancel_all_transfer_request(idev); error = libusb_clear_halt(pdev->libusb_handle, EndpointAddress); - //func_set_usbd_status(pdev, UsbdStatus, error); + // func_set_usbd_status(pdev, UsbdStatus, error); break; default: @@ -979,17 +969,15 @@ static int libusb_udev_control_pipe_request(IUDEVICE* idev, UINT32 RequestId, *UsbdStatus = 0; /* if(pdev->request_queue->unregister_request(pdev->request_queue, RequestId)) - WLog_ERR(TAG, "request_queue_unregister_request: not fount request 0x%x", RequestId); + WLog_ERR(TAG, "request_queue_unregister_request: not fount request 0x%x", RequestId); */ return error; } -static int libusb_udev_control_query_device_text(IUDEVICE* idev, UINT32 TextType, - UINT32 LocaleId, - UINT32* BufferSize, - BYTE* Buffer) +static int libusb_udev_control_query_device_text(IUDEVICE* idev, UINT32 TextType, UINT32 LocaleId, + UINT32* BufferSize, BYTE* Buffer) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; LIBUSB_DEVICE_DESCRIPTOR* devDescriptor = pdev->devDescriptor; char* strDesc = "Generic Usb String"; char deviceLocation[25]; @@ -1001,11 +989,8 @@ static int libusb_udev_control_query_device_text(IUDEVICE* idev, UINT32 TextType switch (TextType) { case DeviceTextDescription: - ret = libusb_get_string_descriptor(pdev->libusb_handle, - devDescriptor->iProduct, - LocaleId, - Buffer, - *BufferSize); + ret = libusb_get_string_descriptor(pdev->libusb_handle, devDescriptor->iProduct, + LocaleId, Buffer, *BufferSize); for (i = 0; (ret > 0) && (i < (size_t)ret); i++) { @@ -1016,8 +1001,10 @@ static int libusb_udev_control_query_device_text(IUDEVICE* idev, UINT32 TextType if (ret <= 0 || ret < 4) { - WLog_DBG(TAG, "libusb_get_string_descriptor: " - "ERROR num %d, iProduct: %"PRIu8"!", ret, devDescriptor->iProduct); + WLog_DBG(TAG, + "libusb_get_string_descriptor: " + "ERROR num %d, iProduct: %" PRIu8 "!", + ret, devDescriptor->iProduct); memcpy(Buffer, strDesc, strlen(strDesc)); Buffer[strlen(strDesc)] = '\0'; *BufferSize = (strlen((char*)Buffer)) * 2; @@ -1038,8 +1025,8 @@ static int libusb_udev_control_query_device_text(IUDEVICE* idev, UINT32 TextType case DeviceTextLocationInformation: bus_number = libusb_get_bus_number(pdev->libusb_dev); device_address = libusb_get_device_address(pdev->libusb_dev); - sprintf_s(deviceLocation, ARRAYSIZE(deviceLocation), "Port_#%04"PRIu8".Hub_#%04"PRIu8"", - device_address, bus_number); + sprintf_s(deviceLocation, ARRAYSIZE(deviceLocation), + "Port_#%04" PRIu8 ".Hub_#%04" PRIu8 "", device_address, bus_number); for (i = 0; i < strlen(deviceLocation); i++) { @@ -1051,55 +1038,41 @@ static int libusb_udev_control_query_device_text(IUDEVICE* idev, UINT32 TextType break; default: - WLog_DBG(TAG, "Query Text: unknown TextType %"PRIu32"", TextType); + WLog_DBG(TAG, "Query Text: unknown TextType %" PRIu32 "", TextType); break; } return 0; } - static int libusb_udev_os_feature_descriptor_request(IUDEVICE* idev, UINT32 RequestId, - BYTE Recipient, - BYTE InterfaceNumber, - BYTE Ms_PageIndex, - UINT16 Ms_featureDescIndex, - UINT32* UsbdStatus, - UINT32* BufferSize, - BYTE* Buffer, - int Timeout) + BYTE Recipient, BYTE InterfaceNumber, + BYTE Ms_PageIndex, UINT16 Ms_featureDescIndex, + UINT32* UsbdStatus, UINT32* BufferSize, + BYTE* Buffer, int Timeout) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; BYTE ms_string_desc[0x13]; int error = 0; /* pdev->request_queue->register_request(pdev->request_queue, RequestId, NULL, 0); */ memset(ms_string_desc, 0, 0x13); - error = libusb_control_transfer(pdev->libusb_handle, - LIBUSB_ENDPOINT_IN | Recipient, - LIBUSB_REQUEST_GET_DESCRIPTOR, - 0x03ee, - 0, - ms_string_desc, - 0x12, + error = libusb_control_transfer(pdev->libusb_handle, LIBUSB_ENDPOINT_IN | Recipient, + LIBUSB_REQUEST_GET_DESCRIPTOR, 0x03ee, 0, ms_string_desc, 0x12, Timeout); - //WLog_ERR(TAG, "Get ms string: result number %d", error); + // WLog_ERR(TAG, "Get ms string: result number %d", error); if (error > 0) { BYTE bMS_Vendorcode; data_read_BYTE(ms_string_desc + 16, bMS_Vendorcode); - //WLog_ERR(TAG, "bMS_Vendorcode:0x%x", bMS_Vendorcode); + // WLog_ERR(TAG, "bMS_Vendorcode:0x%x", bMS_Vendorcode); /** get os descriptor */ error = libusb_control_transfer(pdev->libusb_handle, LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR | Recipient, - bMS_Vendorcode, - (InterfaceNumber << 8) | Ms_PageIndex, - Ms_featureDescIndex, - Buffer, - *BufferSize, - Timeout); + bMS_Vendorcode, (InterfaceNumber << 8) | Ms_PageIndex, + Ms_featureDescIndex, Buffer, *BufferSize, Timeout); *BufferSize = error; } @@ -1110,14 +1083,14 @@ static int libusb_udev_os_feature_descriptor_request(IUDEVICE* idev, UINT32 Requ /* if(pdev->request_queue->unregister_request(pdev->request_queue, RequestId)) - WLog_ERR(TAG, "request_queue_unregister_request: not fount request 0x%x", RequestId); + WLog_ERR(TAG, "request_queue_unregister_request: not fount request 0x%x", RequestId); */ return error; } static int libusb_udev_query_device_descriptor(IUDEVICE* idev, int offset) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; switch (offset) { @@ -1173,7 +1146,7 @@ static int libusb_udev_query_device_descriptor(IUDEVICE* idev, int offset) static void libusb_udev_detach_kernel_driver(IUDEVICE* idev) { int i, err = 0; - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; if ((pdev->status & URBDRC_DEVICE_DETACH_KERNEL) == 0) { @@ -1196,7 +1169,7 @@ static void libusb_udev_detach_kernel_driver(IUDEVICE* idev) static void libusb_udev_attach_kernel_driver(IUDEVICE* idev) { int i, err = 0; - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; for (i = 0; i < pdev->LibusbConfig->bNumInterfaces && err != LIBUSB_ERROR_NO_DEVICE; i++) { @@ -1217,62 +1190,62 @@ static void libusb_udev_attach_kernel_driver(IUDEVICE* idev) static int libusb_udev_is_composite_device(IUDEVICE* idev) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; return pdev->isCompositeDevice; } static int libusb_udev_is_signal_end(IUDEVICE* idev) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; return (pdev->status & URBDRC_DEVICE_SIGNAL_END) ? 1 : 0; } static int libusb_udev_is_exist(IUDEVICE* idev) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; return (pdev->status & URBDRC_DEVICE_NOT_FOUND) ? 0 : 1; } static int libusb_udev_is_channel_closed(IUDEVICE* idev) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; return (pdev->status & URBDRC_DEVICE_CHANNEL_CLOSED) ? 1 : 0; } static int libusb_udev_is_already_send(IUDEVICE* idev) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; return (pdev->status & URBDRC_DEVICE_ALREADY_SEND) ? 1 : 0; } static void libusb_udev_signal_end(IUDEVICE* idev) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; pdev->status |= URBDRC_DEVICE_SIGNAL_END; } static void libusb_udev_channel_closed(IUDEVICE* idev) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; pdev->status |= URBDRC_DEVICE_CHANNEL_CLOSED; } static void libusb_udev_set_already_send(IUDEVICE* idev) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; pdev->status |= URBDRC_DEVICE_ALREADY_SEND; } static char* libusb_udev_get_path(IUDEVICE* idev) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; return pdev->path; } static int libusb_udev_wait_action_completion(IUDEVICE* idev) { int error, sval; - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; while (1) { @@ -1288,13 +1261,13 @@ static int libusb_udev_wait_action_completion(IUDEVICE* idev) static void libusb_udev_push_action(IUDEVICE* idev) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; sem_post(&pdev->sem_id); } static void libusb_udev_complete_action(IUDEVICE* idev) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; sem_trywait(&pdev->sem_id); } @@ -1302,7 +1275,7 @@ static int libusb_udev_wait_for_detach(IUDEVICE* idev) { int error = 0; int times = 0; - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; while (times < 25) { @@ -1321,31 +1294,29 @@ static int libusb_udev_wait_for_detach(IUDEVICE* idev) static void libusb_udev_lock_fifo_isoch(IUDEVICE* idev) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; pthread_mutex_lock(&pdev->mutex_isoch); } -static void libusb_udev_unlock_fifo_isoch(IUDEVICE* idev) +static void libusb_udev_unlock_fifo_isoch(IUDEVICE* idev) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; pthread_mutex_unlock(&pdev->mutex_isoch); } static int libusb_udev_query_device_port_status(IUDEVICE* idev, UINT32* UsbdStatus, - UINT32* BufferSize, BYTE* Buffer) + UINT32* BufferSize, BYTE* Buffer) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; int success = 0, ret; WLog_DBG(TAG, "..."); if (pdev->hub_handle != NULL) { - ret = idev->control_transfer(idev, 0xffff, 0, 0, - LIBUSB_ENDPOINT_IN - | LIBUSB_REQUEST_TYPE_CLASS - | LIBUSB_RECIPIENT_OTHER, - LIBUSB_REQUEST_GET_STATUS, - 0, pdev->port_number, UsbdStatus, BufferSize, Buffer, 1000); + ret = idev->control_transfer( + idev, 0xffff, 0, 0, + LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_OTHER, + LIBUSB_REQUEST_GET_STATUS, 0, pdev->port_number, UsbdStatus, BufferSize, Buffer, 1000); if (ret < 0) { @@ -1354,7 +1325,7 @@ static int libusb_udev_query_device_port_status(IUDEVICE* idev, UINT32* UsbdStat } else { - WLog_DBG(TAG, "PORT STATUS:0x%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"", + WLog_DBG(TAG, "PORT STATUS:0x%02" PRIx8 "%02" PRIx8 "%02" PRIx8 "%02" PRIx8 "", Buffer[3], Buffer[2], Buffer[1], Buffer[0]); success = 1; } @@ -1365,7 +1336,7 @@ static int libusb_udev_query_device_port_status(IUDEVICE* idev, UINT32* UsbdStat static int libusb_udev_request_queue_is_none(IUDEVICE* idev) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; if (pdev->request_queue->request_num == 0) return 1; @@ -1375,11 +1346,12 @@ static int libusb_udev_request_queue_is_none(IUDEVICE* idev) static int libusb_udev_isoch_transfer(IUDEVICE* idev, UINT32 RequestId, UINT32 EndpointAddress, UINT32 TransferFlags, int NoAck, UINT32* ErrorCount, - UINT32* UrbdStatus, UINT32* StartFrame, UINT32 NumberOfPackets, - BYTE* IsoPacket, UINT32* BufferSize, BYTE* Buffer, int Timeout) + UINT32* UrbdStatus, UINT32* StartFrame, + UINT32 NumberOfPackets, BYTE* IsoPacket, UINT32* BufferSize, + BYTE* Buffer, int Timeout) { UINT32 iso_packet_size; - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; ISO_USER_DATA iso_user_data; struct libusb_transfer* iso_transfer = NULL; int status = 0, ret = 0, submit = 0; @@ -1388,16 +1360,15 @@ static int libusb_udev_isoch_transfer(IUDEVICE* idev, UINT32 RequestId, UINT32 E if (iso_transfer == NULL) { - WLog_ERR(TAG, "Error: libusb_alloc_transfer."); + WLog_ERR(TAG, "Error: libusb_alloc_transfer."); return -1; } /** process URB_FUNCTION_IOSCH_TRANSFER */ func_iso_data_init(&iso_user_data, NumberOfPackets, *BufferSize, NoAck, IsoPacket, Buffer); /** fill setting */ - libusb_fill_iso_transfer(iso_transfer, - pdev->libusb_handle, EndpointAddress, Buffer, *BufferSize, - NumberOfPackets, func_iso_callback, &iso_user_data, 2000); + libusb_fill_iso_transfer(iso_transfer, pdev->libusb_handle, EndpointAddress, Buffer, + *BufferSize, NumberOfPackets, func_iso_callback, &iso_user_data, 2000); libusb_set_iso_packet_lengths(iso_transfer, iso_packet_size); if (pdev->status & (URBDRC_DEVICE_SIGNAL_END | URBDRC_DEVICE_NOT_FOUND)) @@ -1464,13 +1435,14 @@ static int libusb_udev_isoch_transfer(IUDEVICE* idev, UINT32 RequestId, UINT32 E } static int libusb_udev_control_transfer(IUDEVICE* idev, UINT32 RequestId, UINT32 EndpointAddress, - UINT32 TransferFlags, BYTE bmRequestType, BYTE Request, UINT16 Value, UINT16 Index, - UINT32* UrbdStatus, UINT32* BufferSize, BYTE* Buffer, UINT32 Timeout) + UINT32 TransferFlags, BYTE bmRequestType, BYTE Request, + UINT16 Value, UINT16 Index, UINT32* UrbdStatus, + UINT32* BufferSize, BYTE* Buffer, UINT32 Timeout) { int status = 0; - UDEVICE* pdev = (UDEVICE*) idev; - status = libusb_control_transfer(pdev->libusb_handle, - bmRequestType, Request, Value, Index, Buffer, *BufferSize, Timeout); + UDEVICE* pdev = (UDEVICE*)idev; + status = libusb_control_transfer(pdev->libusb_handle, bmRequestType, Request, Value, Index, + Buffer, *BufferSize, Timeout); if (!(status < 0)) *BufferSize = status; @@ -1480,11 +1452,12 @@ static int libusb_udev_control_transfer(IUDEVICE* idev, UINT32 RequestId, UINT32 } static int libusb_udev_bulk_or_interrupt_transfer(IUDEVICE* idev, UINT32 RequestId, - UINT32 EndpointAddress, UINT32 TransferFlags, UINT32* UsbdStatus, UINT32* BufferSize, BYTE* Buffer, - UINT32 Timeout) + UINT32 EndpointAddress, UINT32 TransferFlags, + UINT32* UsbdStatus, UINT32* BufferSize, + BYTE* Buffer, UINT32 Timeout) { UINT32 transfer_type; - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; const LIBUSB_ENDPOINT_DESCEIPTOR* ep_desc; struct libusb_transfer* transfer = NULL; TRANSFER_REQUEST* request = NULL; @@ -1496,20 +1469,21 @@ static int libusb_udev_bulk_or_interrupt_transfer(IUDEVICE* idev, UINT32 Request if (!ep_desc) { - WLog_ERR(TAG, "func_get_ep_desc: endpoint 0x%"PRIx32" is not found!!", EndpointAddress); + WLog_ERR(TAG, "func_get_ep_desc: endpoint 0x%" PRIx32 " is not found!!", EndpointAddress); return -1; } transfer_type = (ep_desc->bmAttributes) & 0x3; - WLog_DBG(TAG, "urb_bulk_or_interrupt_transfer: ep:0x%"PRIx32" " - "transfer_type %"PRIu32" flag:%"PRIu32" OutputBufferSize:0x%"PRIx32"", + WLog_DBG(TAG, + "urb_bulk_or_interrupt_transfer: ep:0x%" PRIx32 " " + "transfer_type %" PRIu32 " flag:%" PRIu32 " OutputBufferSize:0x%" PRIx32 "", EndpointAddress, transfer_type, TransferFlags, *BufferSize); switch (transfer_type) { case BULK_TRANSFER: /** Bulk Transfer */ - //Timeout = 10000; + // Timeout = 10000; break; case INTERRUPT_TRANSFER: @@ -1520,7 +1494,8 @@ static int libusb_udev_bulk_or_interrupt_transfer(IUDEVICE* idev, UINT32 Request * request to wMaxPacketSize */ if (*BufferSize != (ep_desc->wMaxPacketSize)) { - WLog_DBG(TAG, "Interrupt Transfer(%s): " + WLog_DBG(TAG, + "Interrupt Transfer(%s): " "BufferSize is different than maxPacketsize(0x%x)", ((transferDir) ? "IN" : "OUT"), ep_desc->wMaxPacketSize); @@ -1533,15 +1508,17 @@ static int libusb_udev_bulk_or_interrupt_transfer(IUDEVICE* idev, UINT32 Request break; default: - WLog_DBG(TAG, "urb_bulk_or_interrupt_transfer:" - " other transfer type 0x%"PRIX32"", transfer_type); + WLog_DBG(TAG, + "urb_bulk_or_interrupt_transfer:" + " other transfer type 0x%" PRIX32 "", + transfer_type); return -1; break; } - libusb_fill_bulk_transfer(transfer, pdev->libusb_handle, EndpointAddress, - Buffer, *BufferSize, func_bulk_transfer_cb, &completed, Timeout); - transfer->type = (unsigned char) transfer_type; + libusb_fill_bulk_transfer(transfer, pdev->libusb_handle, EndpointAddress, Buffer, *BufferSize, + func_bulk_transfer_cb, &completed, Timeout); + transfer->type = (unsigned char)transfer_type; /** Bug fixed in libusb-1.0-8 later: issue of memory crash */ submit = libusb_submit_transfer(transfer); @@ -1553,13 +1530,13 @@ static int libusb_udev_bulk_or_interrupt_transfer(IUDEVICE* idev, UINT32 Request } else { - request = pdev->request_queue->register_request( - pdev->request_queue, RequestId, transfer, EndpointAddress); + request = pdev->request_queue->register_request(pdev->request_queue, RequestId, transfer, + EndpointAddress); request->submit = 1; } if ((pdev && *UsbdStatus == 0) && (submit >= 0) && - (pdev->iface.isSigToEnd((IUDEVICE*) pdev) == 0)) + (pdev->iface.isSigToEnd((IUDEVICE*)pdev) == 0)) { while (!completed) { @@ -1626,12 +1603,13 @@ static int libusb_udev_bulk_or_interrupt_transfer(IUDEVICE* idev, UINT32 Request *BufferSize = transfer->actual_length; } - WLog_DBG(TAG, "bulk or interrupt Transfer data size : 0x%"PRIx32"", *BufferSize); + WLog_DBG(TAG, "bulk or interrupt Transfer data size : 0x%" PRIx32 "", *BufferSize); if (request) { if (pdev->request_queue->unregister_request(pdev->request_queue, RequestId)) - WLog_ERR(TAG, "request_queue_unregister_request: not fount request 0x%"PRIx32"", RequestId); + WLog_ERR(TAG, "request_queue_unregister_request: not fount request 0x%" PRIx32 "", + RequestId); } libusb_free_transfer(transfer); @@ -1641,7 +1619,7 @@ static int libusb_udev_bulk_or_interrupt_transfer(IUDEVICE* idev, UINT32 Request static void libusb_udev_cancel_all_transfer_request(IUDEVICE* idev) { int status; - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; REQUEST_QUEUE* request_queue = pdev->request_queue; TRANSFER_REQUEST* request = NULL; pthread_mutex_lock(&request_queue->request_loading); @@ -1707,7 +1685,7 @@ static int func_cancel_xact_request(TRANSFER_REQUEST* request) static int libusb_udev_cancel_transfer_request(IUDEVICE* idev, UINT32 RequestId) { - UDEVICE* pdev = (UDEVICE*) idev; + UDEVICE* pdev = (UDEVICE*)idev; REQUEST_QUEUE* request_queue = pdev->request_queue; TRANSFER_REQUEST* request = NULL; int status = 0, retry_times = 0; @@ -1722,8 +1700,8 @@ cancel_retry: if (!request) continue; - WLog_DBG(TAG, "CancelId:0x%"PRIx32" RequestId:0x%x endpoint 0x%x!!", - RequestId, request->RequestId, request->endpoint); + WLog_DBG(TAG, "CancelId:0x%" PRIx32 " RequestId:0x%x endpoint 0x%x!!", RequestId, + request->RequestId, request->endpoint); if (request->RequestId == (RequestId && retry_times <= 10)) { @@ -1830,7 +1808,7 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number) if (status < 0) { - WLog_ERR(TAG, "USB init: Error to get HUB handle!!"); + WLog_ERR(TAG, "USB init: Error to get HUB handle!!"); pdev->hub_handle = NULL; } @@ -1838,7 +1816,7 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number) if (!pdev->devDescriptor) { - WLog_ERR(TAG, "USB init: Error to get device descriptor!!"); + WLog_ERR(TAG, "USB init: Error to get device descriptor!!"); zfree(pdev); return NULL; } @@ -1848,7 +1826,7 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number) if (status < 0) { - WLog_ERR(TAG, "libusb_get_descriptor: ERROR!!ret:%d", status); + WLog_ERR(TAG, "libusb_get_descriptor: ERROR!!ret:%d", status); zfree(pdev); return NULL; } @@ -1856,10 +1834,10 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number) config_temp = pdev->LibusbConfig; /* get the first interface and first altsetting */ interface_temp = config_temp->interface[0].altsetting[0]; - WLog_DBG(TAG, "Registered Device: Vid: 0x%04"PRIX16" Pid: 0x%04"PRIX16"" - " InterfaceClass = 0x%02"PRIX8"", - pdev->devDescriptor->idVendor, - pdev->devDescriptor->idProduct, + WLog_DBG(TAG, + "Registered Device: Vid: 0x%04" PRIX16 " Pid: 0x%04" PRIX16 "" + " InterfaceClass = 0x%02" PRIX8 "", + pdev->devDescriptor->idVendor, pdev->devDescriptor->idProduct, interface_temp.bInterfaceClass); /* Denied list */ @@ -1867,18 +1845,18 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number) { case CLASS_RESERVE: - //case CLASS_COMMUNICATION_IF: - //case CLASS_HID: - //case CLASS_PHYSICAL: + // case CLASS_COMMUNICATION_IF: + // case CLASS_HID: + // case CLASS_PHYSICAL: case CLASS_MASS_STORAGE: case CLASS_HUB: - //case CLASS_COMMUNICATION_DATA_IF: + // case CLASS_COMMUNICATION_DATA_IF: case CLASS_SMART_CARD: case CLASS_CONTENT_SECURITY: - //case CLASS_WIRELESS_CONTROLLER: - //case CLASS_ELSE_DEVICE: - WLog_ERR(TAG, " Device is not supported!!"); + // case CLASS_WIRELESS_CONTROLLER: + // case CLASS_ELSE_DEVICE: + WLog_ERR(TAG, " Device is not supported!!"); zfree(pdev); return NULL; @@ -1889,14 +1867,12 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number) /* Check composite device */ devDescriptor = pdev->devDescriptor; - if ((devDescriptor->bNumConfigurations == 1) && - (config_temp->bNumInterfaces > 1) && + if ((devDescriptor->bNumConfigurations == 1) && (config_temp->bNumInterfaces > 1) && (devDescriptor->bDeviceClass == 0x0)) { pdev->isCompositeDevice = 1; } - else if ((devDescriptor->bDeviceClass == 0xef) && - (devDescriptor->bDeviceSubClass == 0x02) && + else if ((devDescriptor->bDeviceClass == 0xef) && (devDescriptor->bDeviceSubClass == 0x02) && (devDescriptor->bDeviceProtocol == 0x01)) { pdev->isCompositeDevice = 1; @@ -1924,12 +1900,12 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number) /* set config of windows */ pdev->MsConfig = msusb_msconfig_new(); pthread_mutex_init(&pdev->mutex_isoch, NULL); - //deb_config_msg(pdev->libusb_dev, config_temp, devDescriptor->bNumConfigurations); + // deb_config_msg(pdev->libusb_dev, config_temp, devDescriptor->bNumConfigurations); udev_load_interface(pdev); - return (IUDEVICE*) pdev; + return (IUDEVICE*)pdev; } -int udev_new_by_id(UINT16 idVendor, UINT16 idProduct, IUDEVICE** * devArray) +int udev_new_by_id(UINT16 idVendor, UINT16 idProduct, IUDEVICE*** devArray) { LIBUSB_DEVICE_DESCRIPTOR* descriptor; LIBUSB_DEVICE** libusb_list; @@ -1938,8 +1914,8 @@ int udev_new_by_id(UINT16 idVendor, UINT16 idProduct, IUDEVICE** * devArray) UINT16 dev_number; ssize_t i, total_device; int status, num = 0; - WLog_INFO(TAG, "VID: 0x%04"PRIX16", PID: 0x%04"PRIX16"", idVendor, idProduct); - array = (UDEVICE**) malloc(16 * sizeof(UDEVICE*)); + WLog_INFO(TAG, "VID: 0x%04" PRIX16 ", PID: 0x%04" PRIX16 "", idVendor, idProduct); + array = (UDEVICE**)malloc(16 * sizeof(UDEVICE*)); total_device = libusb_get_device_list(NULL, &libusb_list); for (i = 0; i < total_device; i++) @@ -1950,7 +1926,7 @@ int udev_new_by_id(UINT16 idVendor, UINT16 idProduct, IUDEVICE** * devArray) { bus_number = 0; dev_number = 0; - array[num] = (PUDEVICE) malloc(sizeof(UDEVICE)); + array[num] = (PUDEVICE)malloc(sizeof(UDEVICE)); array[num]->libusb_dev = libusb_list[i]; status = libusb_open(libusb_list[i], &array[num]->libusb_handle); @@ -1964,7 +1940,7 @@ int udev_new_by_id(UINT16 idVendor, UINT16 idProduct, IUDEVICE** * devArray) bus_number = libusb_get_bus_number(libusb_list[i]); dev_number = libusb_get_device_address(libusb_list[i]); - array[num] = (PUDEVICE) udev_init(array[num], bus_number, dev_number); + array[num] = (PUDEVICE)udev_init(array[num], bus_number, dev_number); if (array[num] != NULL) num++; @@ -1974,7 +1950,7 @@ int udev_new_by_id(UINT16 idVendor, UINT16 idProduct, IUDEVICE** * devArray) } libusb_free_device_list(libusb_list, 1); - *devArray = (IUDEVICE**) array; + *devArray = (IUDEVICE**)array; return num; } @@ -1983,12 +1959,12 @@ IUDEVICE* udev_new_by_addr(int bus_number, int dev_number) int status; UDEVICE* pDev; WLog_DBG(TAG, "bus:%d dev:%d", bus_number, dev_number); - pDev = (PUDEVICE) malloc(sizeof(UDEVICE)); + pDev = (PUDEVICE)malloc(sizeof(UDEVICE)); pDev->libusb_dev = udev_get_libusb_dev(bus_number, dev_number); if (pDev->libusb_dev == NULL) { - WLog_ERR(TAG, "libusb_device_new: ERROR!!"); + WLog_ERR(TAG, "libusb_device_new: ERROR!!"); zfree(pDev); return NULL; } @@ -1997,7 +1973,7 @@ IUDEVICE* udev_new_by_addr(int bus_number, int dev_number) if (status < 0) { - WLog_ERR(TAG, "libusb_open: (by addr) ERROR!!"); + WLog_ERR(TAG, "libusb_open: (by addr) ERROR!!"); zfree(pDev); return NULL; } diff --git a/channels/urbdrc/client/libusb/libusb_udevice.h b/channels/urbdrc/client/libusb/libusb_udevice.h index c79dfcad5..f08f24b07 100644 --- a/channels/urbdrc/client/libusb/libusb_udevice.h +++ b/channels/urbdrc/client/libusb/libusb_udevice.h @@ -18,8 +18,6 @@ * limitations under the License. */ - - #ifndef FREERDP_CHANNEL_URBDRC_CLIENT_LIBUSB_UDEVICE_H #define FREERDP_CHANNEL_URBDRC_CLIENT_LIBUSB_UDEVICE_H @@ -33,13 +31,13 @@ #include "request_queue.h" #include "urbdrc_main.h" -typedef struct libusb_device LIBUSB_DEVICE; -typedef struct libusb_device_handle LIBUSB_DEVICE_HANDLE; -typedef struct libusb_device_descriptor LIBUSB_DEVICE_DESCRIPTOR; -typedef struct libusb_config_descriptor LIBUSB_CONFIG_DESCRIPTOR; -typedef struct libusb_interface LIBUSB_INTERFACE; -typedef struct libusb_interface_descriptor LIBUSB_INTERFACE_DESCRIPTOR; -typedef struct libusb_endpoint_descriptor LIBUSB_ENDPOINT_DESCEIPTOR; +typedef struct libusb_device LIBUSB_DEVICE; +typedef struct libusb_device_handle LIBUSB_DEVICE_HANDLE; +typedef struct libusb_device_descriptor LIBUSB_DEVICE_DESCRIPTOR; +typedef struct libusb_config_descriptor LIBUSB_CONFIG_DESCRIPTOR; +typedef struct libusb_interface LIBUSB_INTERFACE; +typedef struct libusb_interface_descriptor LIBUSB_INTERFACE_DESCRIPTOR; +typedef struct libusb_endpoint_descriptor LIBUSB_ENDPOINT_DESCEIPTOR; typedef struct _UDEVICE UDEVICE; @@ -47,37 +45,37 @@ struct _UDEVICE { IUDEVICE iface; - void * udev; - void * prev; - void * next; + void* udev; + void* prev; + void* next; - UINT32 UsbDevice; /* An unique interface ID */ - UINT32 ReqCompletion; /* An unique interface ID */ - UINT32 channel_id; - UINT16 status; - UINT16 bus_number; - UINT16 dev_number; - char path[17]; - int port_number; - int isCompositeDevice; + UINT32 UsbDevice; /* An unique interface ID */ + UINT32 ReqCompletion; /* An unique interface ID */ + UINT32 channel_id; + UINT16 status; + UINT16 bus_number; + UINT16 dev_number; + char path[17]; + int port_number; + int isCompositeDevice; - LIBUSB_DEVICE_HANDLE * libusb_handle; - LIBUSB_DEVICE_HANDLE * hub_handle; - LIBUSB_DEVICE * libusb_dev; - LIBUSB_DEVICE_DESCRIPTOR * devDescriptor; - MSUSB_CONFIG_DESCRIPTOR * MsConfig; - LIBUSB_CONFIG_DESCRIPTOR * LibusbConfig; + LIBUSB_DEVICE_HANDLE* libusb_handle; + LIBUSB_DEVICE_HANDLE* hub_handle; + LIBUSB_DEVICE* libusb_dev; + LIBUSB_DEVICE_DESCRIPTOR* devDescriptor; + MSUSB_CONFIG_DESCRIPTOR* MsConfig; + LIBUSB_CONFIG_DESCRIPTOR* LibusbConfig; - REQUEST_QUEUE * request_queue; + REQUEST_QUEUE* request_queue; /* Used in isochronous transfer */ - void * isoch_queue; + void* isoch_queue; pthread_mutex_t mutex_isoch; - sem_t sem_id; + sem_t sem_id; }; -typedef UDEVICE * PUDEVICE; +typedef UDEVICE* PUDEVICE; -int udev_new_by_id(UINT16 idVendor, UINT16 idProduct, IUDEVICE ***devArray); +int udev_new_by_id(UINT16 idVendor, UINT16 idProduct, IUDEVICE*** devArray); IUDEVICE* udev_new_by_addr(int bus_number, int dev_number); extern int libusb_debug; diff --git a/channels/urbdrc/client/libusb/libusb_udevman.c b/channels/urbdrc/client/libusb/libusb_udevman.c index 679318542..035c2d0de 100644 --- a/channels/urbdrc/client/libusb/libusb_udevman.c +++ b/channels/urbdrc/client/libusb/libusb_udevman.c @@ -34,19 +34,19 @@ int libusb_debug; -#define BASIC_STATE_FUNC_DEFINED(_arg, _type) \ - static _type udevman_get_##_arg (IUDEVMAN* idevman) \ - { \ - UDEVMAN * udevman = (UDEVMAN *) idevman; \ - return udevman->_arg; \ - } \ - static void udevman_set_##_arg (IUDEVMAN* idevman, _type _t) \ - { \ - UDEVMAN * udevman = (UDEVMAN *) idevman; \ - udevman->_arg = _t; \ +#define BASIC_STATE_FUNC_DEFINED(_arg, _type) \ + static _type udevman_get_##_arg(IUDEVMAN* idevman) \ + { \ + UDEVMAN* udevman = (UDEVMAN*)idevman; \ + return udevman->_arg; \ + } \ + static void udevman_set_##_arg(IUDEVMAN* idevman, _type _t) \ + { \ + UDEVMAN* udevman = (UDEVMAN*)idevman; \ + udevman->_arg = _t; \ } -#define BASIC_STATE_FUNC_REGISTER(_arg, _man) \ +#define BASIC_STATE_FUNC_REGISTER(_arg, _man) \ _man->iface.get_##_arg = udevman_get_##_arg; \ _man->iface.set_##_arg = udevman_set_##_arg @@ -72,13 +72,13 @@ typedef UDEVMAN* PUDEVMAN; static void udevman_rewind(IUDEVMAN* idevman) { - UDEVMAN* udevman = (UDEVMAN*) idevman; + UDEVMAN* udevman = (UDEVMAN*)idevman; udevman->idev = udevman->head; } static int udevman_has_next(IUDEVMAN* idevman) { - UDEVMAN* udevman = (UDEVMAN*) idevman; + UDEVMAN* udevman = (UDEVMAN*)idevman; if (udevman->idev == NULL) return 0; @@ -88,10 +88,10 @@ static int udevman_has_next(IUDEVMAN* idevman) static IUDEVICE* udevman_get_next(IUDEVMAN* idevman) { - UDEVMAN* udevman = (UDEVMAN*) idevman; + UDEVMAN* udevman = (UDEVMAN*)idevman; IUDEVICE* pdev; pdev = udevman->idev; - udevman->idev = (IUDEVICE*)((UDEVICE*) udevman->idev)->next; + udevman->idev = (IUDEVICE*)((UDEVICE*)udevman->idev)->next; return pdev; } @@ -105,7 +105,8 @@ static IUDEVICE* udevman_get_udevice_by_addr(IUDEVMAN* idevman, int bus_number, { pdev = idevman->get_next(idevman); - if ((pdev->get_bus_number(pdev) == bus_number) && (pdev->get_dev_number(pdev) == dev_number)) + if ((pdev->get_bus_number(pdev) == bus_number) && + (pdev->get_dev_number(pdev) == dev_number)) { idevman->loading_unlock(idevman); return pdev; @@ -113,19 +114,18 @@ static IUDEVICE* udevman_get_udevice_by_addr(IUDEVMAN* idevman, int bus_number, } idevman->loading_unlock(idevman); - WLog_WARN(TAG, "bus:%d dev:%d not exist in udevman", - bus_number, dev_number); + WLog_WARN(TAG, "bus:%d dev:%d not exist in udevman", bus_number, dev_number); return NULL; } static int udevman_register_udevice(IUDEVMAN* idevman, int bus_number, int dev_number, int UsbDevice, UINT16 idVendor, UINT16 idProduct, int flag) { - UDEVMAN* udevman = (UDEVMAN*) idevman; + UDEVMAN* udevman = (UDEVMAN*)idevman; IUDEVICE* pdev = NULL; IUDEVICE** devArray; int i, num, addnum = 0; - pdev = (IUDEVICE*) udevman_get_udevice_by_addr(idevman, bus_number, dev_number); + pdev = (IUDEVICE*)udevman_get_udevice_by_addr(idevman, bus_number, dev_number); if (pdev != NULL) return 0; @@ -167,8 +167,8 @@ static int udevman_register_udevice(IUDEVMAN* idevman, int bus_number, int dev_n { pdev = devArray[i]; - if (udevman_get_udevice_by_addr(idevman, - pdev->get_bus_number(pdev), pdev->get_dev_number(pdev)) != NULL) + if (udevman_get_udevice_by_addr(idevman, pdev->get_bus_number(pdev), + pdev->get_dev_number(pdev)) != NULL) { zfree(pdev); continue; @@ -201,7 +201,7 @@ static int udevman_register_udevice(IUDEVMAN* idevman, int bus_number, int dev_n } else { - WLog_ERR(TAG, "udevman_register_udevice: function error!!"); + WLog_ERR(TAG, "udevman_register_udevice: function error!!"); return 0; } @@ -210,16 +210,16 @@ static int udevman_register_udevice(IUDEVMAN* idevman, int bus_number, int dev_n static int udevman_unregister_udevice(IUDEVMAN* idevman, int bus_number, int dev_number) { - UDEVMAN* udevman = (UDEVMAN*) idevman; - UDEVICE* pdev, * dev; + UDEVMAN* udevman = (UDEVMAN*)idevman; + UDEVICE *pdev, *dev; int ret = 0, err = 0; - dev = (UDEVICE*) udevman_get_udevice_by_addr(idevman, bus_number, dev_number); + dev = (UDEVICE*)udevman_get_udevice_by_addr(idevman, bus_number, dev_number); idevman->loading_lock(idevman); idevman->rewind(idevman); while (idevman->has_next(idevman) != 0) { - pdev = (UDEVICE*) idevman->get_next(idevman); + pdev = (UDEVICE*)idevman->get_next(idevman); if (pdev == dev) /* device exists */ { @@ -273,7 +273,8 @@ static int udevman_unregister_udevice(IUDEVMAN* idevman, int bus_number, int dev /* release all interface and attach kernel driver */ dev->iface.attach_kernel_driver((IUDEVICE*)dev); - if (dev->request_queue) zfree(dev->request_queue); + if (dev->request_queue) + zfree(dev->request_queue); /* free the config descriptor that send from windows */ msusb_msconfig_free(dev->MsConfig); @@ -327,7 +328,7 @@ static int udevman_check_device_exist_by_id(IUDEVMAN* idevman, UINT16 idVendor, static int udevman_is_auto_add(IUDEVMAN* idevman) { - UDEVMAN* udevman = (UDEVMAN*) idevman; + UDEVMAN* udevman = (UDEVMAN*)idevman; return (udevman->flags & UDEVMAN_FLAG_ADD_BY_AUTO) ? 1 : 0; } @@ -339,12 +340,12 @@ static IUDEVICE* udevman_get_udevice_by_UsbDevice_try_again(IUDEVMAN* idevman, U while (idevman->has_next(idevman)) { - pdev = (UDEVICE*) idevman->get_next(idevman); + pdev = (UDEVICE*)idevman->get_next(idevman); if (pdev->UsbDevice == UsbDevice) { idevman->loading_unlock(idevman); - return (IUDEVICE*) pdev; + return (IUDEVICE*)pdev; } } @@ -360,49 +361,49 @@ static IUDEVICE* udevman_get_udevice_by_UsbDevice(IUDEVMAN* idevman, UINT32 UsbD while (idevman->has_next(idevman)) { - pdev = (UDEVICE*) idevman->get_next(idevman); + pdev = (UDEVICE*)idevman->get_next(idevman); if (pdev->UsbDevice == UsbDevice) { idevman->loading_unlock(idevman); - return (IUDEVICE*) pdev; + return (IUDEVICE*)pdev; } } idevman->loading_unlock(idevman); /* try again */ - pdev = (UDEVICE*) idevman->get_udevice_by_UsbDevice_try_again(idevman, UsbDevice); + pdev = (UDEVICE*)idevman->get_udevice_by_UsbDevice_try_again(idevman, UsbDevice); if (pdev) { - return (IUDEVICE*) pdev; + return (IUDEVICE*)pdev; } - WLog_ERR(TAG, "0x%"PRIx32" ERROR!!", UsbDevice); + WLog_ERR(TAG, "0x%" PRIx32 " ERROR!!", UsbDevice); return NULL; } static void udevman_loading_lock(IUDEVMAN* idevman) { - UDEVMAN* udevman = (UDEVMAN*) idevman; + UDEVMAN* udevman = (UDEVMAN*)idevman; pthread_mutex_lock(&udevman->devman_loading); } static void udevman_loading_unlock(IUDEVMAN* idevman) { - UDEVMAN* udevman = (UDEVMAN*) idevman; + UDEVMAN* udevman = (UDEVMAN*)idevman; pthread_mutex_unlock(&udevman->devman_loading); } static void udevman_wait_urb(IUDEVMAN* idevman) { - UDEVMAN* udevman = (UDEVMAN*) idevman; + UDEVMAN* udevman = (UDEVMAN*)idevman; sem_wait(&udevman->sem_urb_lock); } static void udevman_push_urb(IUDEVMAN* idevman) { - UDEVMAN* udevman = (UDEVMAN*) idevman; + UDEVMAN* udevman = (UDEVMAN*)idevman; sem_post(&udevman->sem_urb_lock); } @@ -412,7 +413,7 @@ BASIC_STATE_FUNC_DEFINED(sem_timeout, int) static void udevman_free(IUDEVMAN* idevman) { - UDEVMAN* udevman = (UDEVMAN*) idevman; + UDEVMAN* udevman = (UDEVMAN*)idevman; pthread_mutex_destroy(&udevman->devman_loading); sem_destroy(&udevman->sem_urb_lock); libusb_exit(NULL); @@ -434,8 +435,7 @@ static void udevman_load_interface(UDEVMAN* udevman) udevman->iface.register_udevice = udevman_register_udevice; udevman->iface.unregister_udevice = udevman_unregister_udevice; udevman->iface.get_udevice_by_UsbDevice = udevman_get_udevice_by_UsbDevice; - udevman->iface.get_udevice_by_UsbDevice_try_again = - udevman_get_udevice_by_UsbDevice_try_again; + udevman->iface.get_udevice_by_UsbDevice_try_again = udevman_get_udevice_by_UsbDevice_try_again; /* Extension */ udevman->iface.check_device_exist_by_id = udevman_check_device_exist_by_id; udevman->iface.isAutoAdd = udevman_is_auto_add; @@ -480,14 +480,15 @@ static void urbdrc_udevman_register_devices(UDEVMAN* udevman, char* devices) if (udevman->flags & UDEVMAN_FLAG_ADD_BY_VID_PID) { udevman_parse_device_pid_vid(hardware_id, &idVendor, &idProduct, ':'); - success = udevman->iface.register_udevice((IUDEVMAN*) udevman, - 0, 0, UsbDevice, (UINT16) idVendor, (UINT16) idProduct, UDEVMAN_FLAG_ADD_BY_VID_PID); + success = udevman->iface.register_udevice((IUDEVMAN*)udevman, 0, 0, UsbDevice, + (UINT16)idVendor, (UINT16)idProduct, + UDEVMAN_FLAG_ADD_BY_VID_PID); } else if (udevman->flags & UDEVMAN_FLAG_ADD_BY_ADDR) { udevman_parse_device_addr(hardware_id, &bus_number, &dev_number, ':'); - success = udevman->iface.register_udevice((IUDEVMAN*) udevman, - bus_number, dev_number, UsbDevice, 0, 0, UDEVMAN_FLAG_ADD_BY_ADDR); + success = udevman->iface.register_udevice((IUDEVMAN*)udevman, bus_number, dev_number, + UsbDevice, 0, 0, UDEVMAN_FLAG_ADD_BY_ADDR); } if (success) @@ -502,18 +503,18 @@ static void urbdrc_udevman_parse_addin_args(UDEVMAN* udevman, ADDIN_ARGV* args) int status; DWORD flags; COMMAND_LINE_ARGUMENT_A* arg; - COMMAND_LINE_ARGUMENT_A urbdrc_udevman_args[] = - { - { "dbg", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "debug" }, - { "dev", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "device list" }, - { "id", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "FLAG_ADD_BY_VID_PID" }, - { "addr", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "FLAG_ADD_BY_ADDR" }, - { "auto", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "FLAG_ADD_BY_AUTO" }, - { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } - }; + COMMAND_LINE_ARGUMENT_A urbdrc_udevman_args[] = { + { "dbg", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "debug" }, + { "dev", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "device list" }, + { "id", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, + "FLAG_ADD_BY_VID_PID" }, + { "addr", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "FLAG_ADD_BY_ADDR" }, + { "auto", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "FLAG_ADD_BY_AUTO" }, + { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } + }; flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON; - status = CommandLineParseArgumentsA(args->argc, args->argv, - urbdrc_udevman_args, flags, udevman, NULL, NULL); + status = CommandLineParseArgumentsA(args->argc, args->argv, urbdrc_udevman_args, flags, udevman, + NULL, NULL); arg = urbdrc_udevman_args; do @@ -521,8 +522,7 @@ static void urbdrc_udevman_parse_addin_args(UDEVMAN* udevman, ADDIN_ARGV* args) if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "dbg") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "dbg") { WLog_SetLogLevel(WLog_Get(TAG), WLOG_TRACE); } @@ -546,14 +546,13 @@ static void urbdrc_udevman_parse_addin_args(UDEVMAN* udevman, ADDIN_ARGV* args) { } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); } #ifdef BUILTIN_CHANNELS -#define freerdp_urbdrc_client_subsystem_entry libusb_freerdp_urbdrc_client_subsystem_entry +#define freerdp_urbdrc_client_subsystem_entry libusb_freerdp_urbdrc_client_subsystem_entry #else -#define freerdp_urbdrc_client_subsystem_entry FREERDP_API freerdp_urbdrc_client_subsystem_entry +#define freerdp_urbdrc_client_subsystem_entry FREERDP_API freerdp_urbdrc_client_subsystem_entry #endif int freerdp_urbdrc_client_subsystem_entry(PFREERDP_URBDRC_SERVICE_ENTRY_POINTS pEntryPoints) @@ -561,7 +560,7 @@ int freerdp_urbdrc_client_subsystem_entry(PFREERDP_URBDRC_SERVICE_ENTRY_POINTS p UDEVMAN* udevman; ADDIN_ARGV* args = pEntryPoints->args; libusb_init(NULL); - udevman = (PUDEVMAN) malloc(sizeof(UDEVMAN)); + udevman = (PUDEVMAN)malloc(sizeof(UDEVMAN)); if (!udevman) return -1; @@ -579,7 +578,7 @@ int freerdp_urbdrc_client_subsystem_entry(PFREERDP_URBDRC_SERVICE_ENTRY_POINTS p /* set debug flag, to enable Debug message for usb data transfer */ libusb_debug = 10; urbdrc_udevman_parse_addin_args(udevman, args); - pEntryPoints->pRegisterUDEVMAN(pEntryPoints->plugin, (IUDEVMAN*) udevman); + pEntryPoints->pRegisterUDEVMAN(pEntryPoints->plugin, (IUDEVMAN*)udevman); WLog_DBG(TAG, "UDEVMAN device registered."); return 0; } diff --git a/channels/urbdrc/client/libusb/request_queue.c b/channels/urbdrc/client/libusb/request_queue.c index 86035f1e4..9492cddcb 100644 --- a/channels/urbdrc/client/libusb/request_queue.c +++ b/channels/urbdrc/client/libusb/request_queue.c @@ -29,7 +29,7 @@ TRANSFER_REQUEST* request_queue_get_next(REQUEST_QUEUE* queue) TRANSFER_REQUEST* request; request = queue->ireq; - queue->ireq = (TRANSFER_REQUEST *)queue->ireq->next; + queue->ireq = (TRANSFER_REQUEST*)queue->ireq->next; return request; } @@ -43,11 +43,11 @@ int request_queue_has_next(REQUEST_QUEUE* queue) } TRANSFER_REQUEST* request_queue_register_request(REQUEST_QUEUE* queue, UINT32 RequestId, - struct libusb_transfer* transfer, BYTE endpoint) + struct libusb_transfer* transfer, BYTE endpoint) { TRANSFER_REQUEST* request; - request = (TRANSFER_REQUEST*) malloc(sizeof(TRANSFER_REQUEST)); + request = (TRANSFER_REQUEST*)malloc(sizeof(TRANSFER_REQUEST)); request->prev = NULL; request->next = NULL; @@ -68,8 +68,8 @@ TRANSFER_REQUEST* request_queue_register_request(REQUEST_QUEUE* queue, UINT32 Re else { /* append data to the end of the linked queue */ - queue->tail->next = (void*) request; - request->prev = (void*) queue->tail; + queue->tail->next = (void*)request; + request->prev = (void*)queue->tail; queue->tail = request; } @@ -87,12 +87,12 @@ void request_queue_rewind(REQUEST_QUEUE* queue) /* Get first*/ TRANSFER_REQUEST* request_queue_get_request_by_endpoint(REQUEST_QUEUE* queue, BYTE ep) { - TRANSFER_REQUEST * request; + TRANSFER_REQUEST* request; pthread_mutex_lock(&queue->request_loading); - queue->rewind (queue); - while (queue->has_next (queue)) + queue->rewind(queue); + while (queue->has_next(queue)) { - request = queue->get_next (queue); + request = queue->get_next(queue); if (request->endpoint == ep) { pthread_mutex_unlock(&queue->request_loading); @@ -100,7 +100,7 @@ TRANSFER_REQUEST* request_queue_get_request_by_endpoint(REQUEST_QUEUE* queue, BY } } pthread_mutex_unlock(&queue->request_loading); - WLog_ERR(TAG, "request_queue_get_request_by_id: ERROR!!"); + WLog_ERR(TAG, "request_queue_get_request_by_id: ERROR!!"); return NULL; } @@ -114,41 +114,40 @@ int request_queue_unregister_request(REQUEST_QUEUE* queue, UINT32 RequestId) { request = queue->get_next(queue); - if (request->RequestId == RequestId) + if (request->RequestId == RequestId) { if (request->prev != NULL) { - request_temp = (TRANSFER_REQUEST*) request->prev; - request_temp->next = (TRANSFER_REQUEST*) request->next; + request_temp = (TRANSFER_REQUEST*)request->prev; + request_temp->next = (TRANSFER_REQUEST*)request->next; } else { - queue->head = (TRANSFER_REQUEST*) request->next; + queue->head = (TRANSFER_REQUEST*)request->next; } if (request->next != NULL) { - request_temp = (TRANSFER_REQUEST*) request->next; - request_temp->prev = (TRANSFER_REQUEST*) request->prev; + request_temp = (TRANSFER_REQUEST*)request->next; + request_temp->prev = (TRANSFER_REQUEST*)request->prev; } else { - queue->tail = (TRANSFER_REQUEST*) request->prev; - + queue->tail = (TRANSFER_REQUEST*)request->prev; } queue->request_num--; - + if (request) { request->transfer = NULL; - zfree(request); + zfree(request); } pthread_mutex_unlock(&queue->request_loading); - return 0; + return 0; } } pthread_mutex_unlock(&queue->request_loading); @@ -160,11 +159,11 @@ REQUEST_QUEUE* request_queue_new() { REQUEST_QUEUE* queue; - queue = (REQUEST_QUEUE*) malloc(sizeof(REQUEST_QUEUE)); + queue = (REQUEST_QUEUE*)malloc(sizeof(REQUEST_QUEUE)); queue->request_num = 0; queue->ireq = NULL; queue->head = NULL; - queue->tail = NULL; + queue->tail = NULL; pthread_mutex_init(&queue->request_loading, NULL); diff --git a/channels/urbdrc/client/libusb/request_queue.h b/channels/urbdrc/client/libusb/request_queue.h index 35e80c5d1..bafe6716a 100644 --- a/channels/urbdrc/client/libusb/request_queue.h +++ b/channels/urbdrc/client/libusb/request_queue.h @@ -28,17 +28,16 @@ typedef struct _REQUEST_QUEUE REQUEST_QUEUE; struct _TRANSFER_REQUEST { - void* request; - void* prev; - void* next; + void* request; + void* prev; + void* next; - UINT32 RequestId; - BYTE endpoint; - struct libusb_transfer *transfer; - int submit; + UINT32 RequestId; + BYTE endpoint; + struct libusb_transfer* transfer; + int submit; }; - struct _REQUEST_QUEUE { int request_num; @@ -49,17 +48,15 @@ struct _REQUEST_QUEUE pthread_mutex_t request_loading; /* request queue manager service */ - void (*rewind) (REQUEST_QUEUE *queue); - int (*has_next) (REQUEST_QUEUE* queue); - int (*unregister_request) (REQUEST_QUEUE *queue, UINT32 RequestId); - TRANSFER_REQUEST *(*get_next) (REQUEST_QUEUE* queue); - TRANSFER_REQUEST *(*get_request_by_ep) (REQUEST_QUEUE *queue, BYTE ep); - TRANSFER_REQUEST *(*register_request) (REQUEST_QUEUE* queue, - UINT32 RequestId, struct libusb_transfer * transfer, BYTE endpoint); + void (*rewind)(REQUEST_QUEUE* queue); + int (*has_next)(REQUEST_QUEUE* queue); + int (*unregister_request)(REQUEST_QUEUE* queue, UINT32 RequestId); + TRANSFER_REQUEST* (*get_next)(REQUEST_QUEUE* queue); + TRANSFER_REQUEST* (*get_request_by_ep)(REQUEST_QUEUE* queue, BYTE ep); + TRANSFER_REQUEST* (*register_request)(REQUEST_QUEUE* queue, UINT32 RequestId, + struct libusb_transfer* transfer, BYTE endpoint); }; - REQUEST_QUEUE* request_queue_new(void); - #endif /* FREERDP_CHANNEL_URBDRC_CLIENT_LIBUSB_REQUEST_QUEUE_H */ diff --git a/channels/urbdrc/client/searchman.c b/channels/urbdrc/client/searchman.c index e87102ce2..a1a587d5b 100644 --- a/channels/urbdrc/client/searchman.c +++ b/channels/urbdrc/client/searchman.c @@ -18,7 +18,6 @@ * limitations under the License. */ - #include #include #include @@ -47,16 +46,16 @@ static USB_SEARCHDEV* searchman_get_next(USB_SEARCHMAN* searchman) USB_SEARCHDEV* search; search = searchman->idev; - searchman->idev = (USB_SEARCHDEV*) searchman->idev->next; + searchman->idev = (USB_SEARCHDEV*)searchman->idev->next; return search; } static BOOL searchman_list_add(USB_SEARCHMAN* searchman, UINT16 idVendor, UINT16 idProduct) { - USB_SEARCHDEV* search; + USB_SEARCHDEV* search; - search = (USB_SEARCHDEV*) calloc(1, sizeof(USB_SEARCHDEV)); + search = (USB_SEARCHDEV*)calloc(1, sizeof(USB_SEARCHDEV)); if (!search) return FALSE; @@ -92,8 +91,7 @@ static int searchman_list_remove(USB_SEARCHMAN* searchman, UINT16 idVendor, UINT { point = searchman_get_next(searchman); - if (point->idVendor == idVendor && - point->idProduct == idProduct) + if (point->idVendor == idVendor && point->idProduct == idProduct) { /* set previous device to point to next device */ @@ -160,27 +158,27 @@ static void searchman_list_show(USB_SEARCHMAN* self) { int num = 0; USB_SEARCHDEV* usb; - WLog_DBG(TAG, "=========== Usb Search List ========="); + WLog_DBG(TAG, "=========== Usb Search List ========="); self->rewind(self); while (self->has_next(self)) { usb = self->get_next(self); - WLog_DBG(TAG, " USB %d: ", num++); - WLog_DBG(TAG, " idVendor: 0x%04"PRIX16"", usb->idVendor); - WLog_DBG(TAG, " idProduct: 0x%04"PRIX16"", usb->idProduct); + WLog_DBG(TAG, " USB %d: ", num++); + WLog_DBG(TAG, " idVendor: 0x%04" PRIX16 "", usb->idVendor); + WLog_DBG(TAG, " idProduct: 0x%04" PRIX16 "", usb->idProduct); } - WLog_DBG(TAG, "================= END ==============="); + WLog_DBG(TAG, "================= END ==============="); } void searchman_free(USB_SEARCHMAN* self) { - USB_SEARCHDEV * dev; + USB_SEARCHDEV* dev; while (self->head != NULL) { - dev = (USB_SEARCHDEV *)self->head; - self->remove (self, dev->idVendor, dev->idProduct); + dev = (USB_SEARCHDEV*)self->head; + self->remove(self, dev->idVendor, dev->idProduct); } /* free searchman */ @@ -189,12 +187,12 @@ void searchman_free(USB_SEARCHMAN* self) free(self); } -USB_SEARCHMAN* searchman_new(void * urbdrc, UINT32 UsbDevice) +USB_SEARCHMAN* searchman_new(void* urbdrc, UINT32 UsbDevice) { int ret; USB_SEARCHMAN* searchman; - searchman = (USB_SEARCHMAN*) calloc(1, sizeof(USB_SEARCHMAN)); + searchman = (USB_SEARCHMAN*)calloc(1, sizeof(USB_SEARCHMAN)); if (!searchman) return NULL; diff --git a/channels/urbdrc/client/searchman.h b/channels/urbdrc/client/searchman.h index b449a989f..8e5562819 100644 --- a/channels/urbdrc/client/searchman.h +++ b/channels/urbdrc/client/searchman.h @@ -40,9 +40,9 @@ struct _USB_SEARCHMAN { int usb_numbers; UINT32 UsbDevice; - USB_SEARCHDEV* idev; /* iterator device */ - USB_SEARCHDEV* head; /* head device in linked list */ - USB_SEARCHDEV* tail; /* tail device in linked list */ + USB_SEARCHDEV* idev; /* iterator device */ + USB_SEARCHDEV* head; /* head device in linked list */ + USB_SEARCHDEV* tail; /* tail device in linked list */ pthread_mutex_t mutex; HANDLE term_event; @@ -53,26 +53,25 @@ struct _USB_SEARCHMAN void* urbdrc; /* load service */ - void (*rewind) (USB_SEARCHMAN* seachman); + void (*rewind)(USB_SEARCHMAN* seachman); /* show all device in the list */ - void (*show) (USB_SEARCHMAN* self); + void (*show)(USB_SEARCHMAN* self); /* start searchman */ - BOOL (*start) (USB_SEARCHMAN* self, void* (*func)(void*)); + BOOL (*start)(USB_SEARCHMAN* self, void* (*func)(void*)); /* close searchman */ - void (*close) (USB_SEARCHMAN* self); + void (*close)(USB_SEARCHMAN* self); /* add a new usb device for search */ - BOOL (*add) (USB_SEARCHMAN* seachman, UINT16 idVendor, UINT16 idProduct); + BOOL (*add)(USB_SEARCHMAN* seachman, UINT16 idVendor, UINT16 idProduct); /* remove a usb device from list */ - int (*remove) (USB_SEARCHMAN* searchman, UINT16 idVendor, UINT16 idProduct); + int (*remove)(USB_SEARCHMAN* searchman, UINT16 idVendor, UINT16 idProduct); /* check list has next device*/ - int (*has_next) (USB_SEARCHMAN* seachman); + int (*has_next)(USB_SEARCHMAN* seachman); /* get the device from list*/ - USB_SEARCHDEV* (*get_next) (USB_SEARCHMAN* seachman); + USB_SEARCHDEV* (*get_next)(USB_SEARCHMAN* seachman); /* free! */ - void (*free) (USB_SEARCHMAN* searchman); + void (*free)(USB_SEARCHMAN* searchman); }; USB_SEARCHMAN* searchman_new(void* urbdrc, UINT32 UsbDevice); #endif /* FREERDP_CHANNEL_URBDRC_CLIENT_SEARCHMAN_H */ - diff --git a/channels/urbdrc/client/urbdrc_main.c b/channels/urbdrc/client/urbdrc_main.c index dcc8cf16f..6694521d2 100644 --- a/channels/urbdrc/client/urbdrc_main.c +++ b/channels/urbdrc/client/urbdrc_main.c @@ -51,22 +51,22 @@ #include "data_transfer.h" #include "searchman.h" -static int func_hardware_id_format(IUDEVICE* pdev, char(*HardwareIds)[DEVICE_HARDWARE_ID_SIZE]) +static int func_hardware_id_format(IUDEVICE* pdev, char (*HardwareIds)[DEVICE_HARDWARE_ID_SIZE]) { char str[DEVICE_HARDWARE_ID_SIZE]; UINT16 idVendor, idProduct, bcdDevice; idVendor = (UINT16)pdev->query_device_descriptor(pdev, ID_VENDOR); idProduct = (UINT16)pdev->query_device_descriptor(pdev, ID_PRODUCT); bcdDevice = (UINT16)pdev->query_device_descriptor(pdev, BCD_DEVICE); - sprintf_s(str, sizeof(str), "USB\\VID_%04"PRIX16"&PID_%04"PRIX16"", idVendor, idProduct); + sprintf_s(str, sizeof(str), "USB\\VID_%04" PRIX16 "&PID_%04" PRIX16 "", idVendor, idProduct); strncpy(HardwareIds[1], str, DEVICE_HARDWARE_ID_SIZE); - sprintf_s(str, sizeof(str), "%s&REV_%04"PRIX16"", HardwareIds[1], bcdDevice); + sprintf_s(str, sizeof(str), "%s&REV_%04" PRIX16 "", HardwareIds[1], bcdDevice); strncpy(HardwareIds[0], str, DEVICE_HARDWARE_ID_SIZE); return 0; } static int func_compat_id_format(IUDEVICE* pdev, - char(*CompatibilityIds)[DEVICE_COMPATIBILITY_ID_SIZE]) + char (*CompatibilityIds)[DEVICE_COMPATIBILITY_ID_SIZE]) { char str[DEVICE_COMPATIBILITY_ID_SIZE]; UINT8 bDeviceClass, bDeviceSubClass, bDeviceProtocol; @@ -76,11 +76,12 @@ static int func_compat_id_format(IUDEVICE* pdev, if (!(pdev->isCompositeDevice(pdev))) { - sprintf_s(str, sizeof(str), "USB\\Class_%02"PRIX8"", bDeviceClass); + sprintf_s(str, sizeof(str), "USB\\Class_%02" PRIX8 "", bDeviceClass); strncpy(CompatibilityIds[2], str, DEVICE_COMPATIBILITY_ID_SIZE); - sprintf_s(str, sizeof(str), "%s&SubClass_%02"PRIX8"", CompatibilityIds[2], bDeviceSubClass); + sprintf_s(str, sizeof(str), "%s&SubClass_%02" PRIX8 "", CompatibilityIds[2], + bDeviceSubClass); strncpy(CompatibilityIds[1], str, DEVICE_COMPATIBILITY_ID_SIZE); - sprintf_s(str, sizeof(str), "%s&Prot_%02"PRIX8"", CompatibilityIds[1], bDeviceProtocol); + sprintf_s(str, sizeof(str), "%s&Prot_%02" PRIX8 "", CompatibilityIds[1], bDeviceProtocol); strncpy(CompatibilityIds[0], str, DEVICE_COMPATIBILITY_ID_SIZE); } else @@ -104,7 +105,7 @@ static void func_close_udevice(USB_SEARCHMAN* searchman, IUDEVICE* pdev) pdev->SigToEnd(pdev); idVendor = pdev->query_device_descriptor(pdev, ID_VENDOR); idProduct = pdev->query_device_descriptor(pdev, ID_PRODUCT); - searchman->add(searchman, (UINT16) idVendor, (UINT16) idProduct); + searchman->add(searchman, (UINT16)idVendor, (UINT16)idProduct); pdev->cancel_all_transfer_request(pdev); pdev->wait_action_completion(pdev); #if ISOCH_FIFO @@ -116,8 +117,7 @@ static void func_close_udevice(USB_SEARCHMAN* searchman, IUDEVICE* pdev) isoch_queue->free(isoch_queue); } #endif - urbdrc->udevman->unregister_udevice(urbdrc->udevman, - pdev->get_bus_number(pdev), + urbdrc->udevman->unregister_udevice(urbdrc->udevman, pdev->get_bus_number(pdev), pdev->get_dev_number(pdev)); } @@ -128,19 +128,19 @@ static int fun_device_string_send_set(char* out_data, int out_offset, char* str) while (str[i]) { - data_write_UINT16(out_data + out_offset + offset, str[i]); /* str */ + data_write_UINT16(out_data + out_offset + offset, str[i]); /* str */ i++; offset += 2; } - data_write_UINT16(out_data + out_offset + offset, 0x0000); /* add "\0" */ + data_write_UINT16(out_data + out_offset + offset, 0x0000); /* add "\0" */ offset += 2; return offset + out_offset; } static int func_container_id_generate(IUDEVICE* pdev, char* strContainerId) { - char* p, *path; + char *p, *path; UINT8 containerId[17]; UINT16 idVendor, idProduct; idVendor = (UINT16)pdev->query_device_descriptor(pdev, ID_VENDOR); @@ -153,15 +153,17 @@ static int func_container_id_generate(IUDEVICE* pdev, char* strContainerId) p = path; ZeroMemory(containerId, sizeof(containerId)); - sprintf_s((char*)containerId, sizeof(containerId), "%04"PRIX16"%04"PRIX16"%s", idVendor, idProduct, - p); + sprintf_s((char*)containerId, sizeof(containerId), "%04" PRIX16 "%04" PRIX16 "%s", idVendor, + idProduct, p); /* format */ sprintf_s(strContainerId, DEVICE_CONTAINER_STR_SIZE, - "{%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"-%02"PRIx8"%02"PRIx8"-%02"PRIx8"%02"PRIx8"-%02"PRIx8"%02"PRIx8"-%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"}", - containerId[0], containerId[1], containerId[2], containerId[3], - containerId[4], containerId[5], containerId[6], containerId[7], - containerId[8], containerId[9], containerId[10], containerId[11], - containerId[12], containerId[13], containerId[14], containerId[15]); + "{%02" PRIx8 "%02" PRIx8 "%02" PRIx8 "%02" PRIx8 "-%02" PRIx8 "%02" PRIx8 "-%02" PRIx8 + "%02" PRIx8 "-%02" PRIx8 "%02" PRIx8 "-%02" PRIx8 "%02" PRIx8 "%02" PRIx8 "%02" PRIx8 + "%02" PRIx8 "%02" PRIx8 "}", + containerId[0], containerId[1], containerId[2], containerId[3], containerId[4], + containerId[5], containerId[6], containerId[7], containerId[8], containerId[9], + containerId[10], containerId[11], containerId[12], containerId[13], containerId[14], + containerId[15]); return 0; } @@ -172,17 +174,19 @@ static int func_instance_id_generate(IUDEVICE* pdev, char* strInstanceId) sprintf_s((char*)instanceId, sizeof(instanceId), "\\%s", pdev->getPath(pdev)); /* format */ sprintf_s(strInstanceId, DEVICE_INSTANCE_STR_SIZE, - "%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"-%02"PRIx8"%02"PRIx8"-%02"PRIx8"%02"PRIx8"-%02"PRIx8"%02"PRIx8"-%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"", - instanceId[0], instanceId[1], instanceId[2], instanceId[3], - instanceId[4], instanceId[5], instanceId[6], instanceId[7], - instanceId[8], instanceId[9], instanceId[10], instanceId[11], - instanceId[12], instanceId[13], instanceId[14], instanceId[15]); + "%02" PRIx8 "%02" PRIx8 "%02" PRIx8 "%02" PRIx8 "-%02" PRIx8 "%02" PRIx8 "-%02" PRIx8 + "%02" PRIx8 "-%02" PRIx8 "%02" PRIx8 "-%02" PRIx8 "%02" PRIx8 "%02" PRIx8 "%02" PRIx8 + "%02" PRIx8 "%02" PRIx8 "", + instanceId[0], instanceId[1], instanceId[2], instanceId[3], instanceId[4], + instanceId[5], instanceId[6], instanceId[7], instanceId[8], instanceId[9], + instanceId[10], instanceId[11], instanceId[12], instanceId[13], instanceId[14], + instanceId[15]); return 0; } #if ISOCH_FIFO -static void func_lock_isoch_mutex(TRANSFER_DATA* transfer_data) +static void func_lock_isoch_mutex(TRANSFER_DATA* transfer_data) { int noAck = 0; IUDEVICE* pdev; @@ -195,14 +199,12 @@ static void func_lock_isoch_mutex(TRANSFER_DATA* transfer_data) { data_read_UINT32(transfer_data->pBuffer + 4, FunctionId); - if ((FunctionId == TRANSFER_IN_REQUEST || - FunctionId == TRANSFER_OUT_REQUEST) && + if ((FunctionId == TRANSFER_IN_REQUEST || FunctionId == TRANSFER_OUT_REQUEST) && transfer_data->cbSize >= 16) { data_read_UINT16(transfer_data->pBuffer + 14, URB_Function); - if (URB_Function == URB_FUNCTION_ISOCH_TRANSFER && - transfer_data->cbSize >= 20) + if (URB_Function == URB_FUNCTION_ISOCH_TRANSFER && transfer_data->cbSize >= 20) { data_read_UINT32(transfer_data->pBuffer + 16, RequestField); noAck = (RequestField & 0x80000000) >> 31; @@ -225,7 +227,7 @@ static void func_lock_isoch_mutex(TRANSFER_DATA* transfer_data) * @return 0 on success, otherwise a Win32 error code */ static UINT urbdrc_process_capability_request(URBDRC_CHANNEL_CALLBACK* callback, char* data, - UINT32 data_sizem, UINT32 MessageId) + UINT32 data_sizem, UINT32 MessageId) { UINT32 InterfaceId; UINT32 Version; @@ -236,16 +238,16 @@ static UINT urbdrc_process_capability_request(URBDRC_CHANNEL_CALLBACK* callback, data_read_UINT32(data + 0, Version); InterfaceId = ((STREAM_ID_NONE << 30) | CAPABILITIES_NEGOTIATOR); out_size = 16; - out_data = (char*) calloc(1, out_size); + out_data = (char*)calloc(1, out_size); if (!out_data) return ERROR_OUTOFMEMORY; data_write_UINT32(out_data + 0, InterfaceId); /* interface id */ - data_write_UINT32(out_data + 4, MessageId); /* message id */ - data_write_UINT32(out_data + 8, Version); /* usb protocol version */ + data_write_UINT32(out_data + 4, MessageId); /* message id */ + data_write_UINT32(out_data + 8, Version); /* usb protocol version */ data_write_UINT32(out_data + 12, 0x00000000); /* HRESULT */ - ret = callback->channel->Write(callback->channel, out_size, (BYTE*) out_data, NULL); + ret = callback->channel->Write(callback->channel, out_size, (BYTE*)out_data, NULL); zfree(out_data); return ret; } @@ -256,7 +258,7 @@ static UINT urbdrc_process_capability_request(URBDRC_CHANNEL_CALLBACK* callback, * @return 0 on success, otherwise a Win32 error code */ static UINT urbdrc_process_channel_create(URBDRC_CHANNEL_CALLBACK* callback, char* data, - UINT32 data_sizem, UINT32 MessageId) + UINT32 data_sizem, UINT32 MessageId) { UINT32 InterfaceId; UINT32 out_size; @@ -271,13 +273,13 @@ static UINT urbdrc_process_channel_create(URBDRC_CHANNEL_CALLBACK* callback, cha data_read_UINT32(data + 8, Capabilities); InterfaceId = ((STREAM_ID_PROXY << 30) | CLIENT_CHANNEL_NOTIFICATION); out_size = 24; - out_data = (char*) calloc(1, out_size); + out_data = (char*)calloc(1, out_size); if (!out_data) return ERROR_OUTOFMEMORY; - data_write_UINT32(out_data + 0, InterfaceId); /* interface id */ - data_write_UINT32(out_data + 4, MessageId); /* message id */ + data_write_UINT32(out_data + 0, InterfaceId); /* interface id */ + data_write_UINT32(out_data + 4, MessageId); /* message id */ data_write_UINT32(out_data + 8, CHANNEL_CREATED); /* function id */ data_write_UINT32(out_data + 12, MajorVersion); data_write_UINT32(out_data + 16, MinorVersion); @@ -297,12 +299,12 @@ static int urdbrc_send_virtual_channel_add(IWTSVirtualChannel* channel, UINT32 M assert(NULL != channel->Write); InterfaceId = ((STREAM_ID_PROXY << 30) | CLIENT_DEVICE_SINK); out_size = 12; - out_data = (char*) malloc(out_size); + out_data = (char*)malloc(out_size); memset(out_data, 0, out_size); - data_write_UINT32(out_data + 0, InterfaceId); /* interface */ - data_write_UINT32(out_data + 4, MessageId); /* message id */ + data_write_UINT32(out_data + 0, InterfaceId); /* interface */ + data_write_UINT32(out_data + 4, MessageId); /* message id */ data_write_UINT32(out_data + 8, ADD_VIRTUAL_CHANNEL); /* function id */ - channel->Write(channel, out_size, (BYTE*) out_data, NULL); + channel->Write(channel, out_size, (BYTE*)out_data, NULL); zfree(out_data); return 0; } @@ -341,8 +343,7 @@ static UINT urdbrc_send_usb_device_add(URBDRC_CHANNEL_CALLBACK* callback, IUDEVI func_compat_id_format(pdev, CompatibilityIds); func_instance_id_generate(pdev, strInstanceId); func_container_id_generate(pdev, strContainerId); - cchCompatIds = strlen(CompatibilityIds[0]) + 1 + - strlen(CompatibilityIds[1]) + 1 + + cchCompatIds = strlen(CompatibilityIds[0]) + 1 + strlen(CompatibilityIds[1]) + 1 + strlen(CompatibilityIds[2]) + 2; if (pdev->isCompositeDevice(pdev)) @@ -350,22 +351,20 @@ static UINT urdbrc_send_usb_device_add(URBDRC_CHANNEL_CALLBACK* callback, IUDEVI out_offset = 24; size = 24; - size += (strlen(strInstanceId) + 1) * 2 + - (strlen(HardwareIds[0]) + 1) * 2 + 4 + - (strlen(HardwareIds[1]) + 1) * 2 + 2 + - 4 + (cchCompatIds) * 2 + + size += (strlen(strInstanceId) + 1) * 2 + (strlen(HardwareIds[0]) + 1) * 2 + 4 + + (strlen(HardwareIds[1]) + 1) * 2 + 2 + 4 + (cchCompatIds)*2 + (strlen(strContainerId) + 1) * 2 + 4 + 28; out_data = (char*)calloc(1, size); if (!out_data) return ERROR_OUTOFMEMORY; - data_write_UINT32(out_data + 0, InterfaceId); /* interface */ - /* data_write_UINT32(out_data + 4, 0);*/ /* message id */ - data_write_UINT32(out_data + 8, ADD_DEVICE); /* function id */ - data_write_UINT32(out_data + 12, 0x00000001); /* NumUsbDevice */ + data_write_UINT32(out_data + 0, InterfaceId); /* interface */ + /* data_write_UINT32(out_data + 4, 0);*/ /* message id */ + data_write_UINT32(out_data + 8, ADD_DEVICE); /* function id */ + data_write_UINT32(out_data + 12, 0x00000001); /* NumUsbDevice */ data_write_UINT32(out_data + 16, pdev->get_UsbDevice(pdev)); /* UsbDevice */ - data_write_UINT32(out_data + 20, 0x00000025); /* cchDeviceInstanceId */ + data_write_UINT32(out_data + 20, 0x00000025); /* cchDeviceInstanceId */ out_offset = fun_device_string_send_set(out_data, out_offset, strInstanceId); data_write_UINT32(out_data + out_offset, 0x00000036); /* cchHwIds */ out_offset += 4; @@ -395,8 +394,8 @@ static UINT urdbrc_send_usb_device_add(URBDRC_CHANNEL_CALLBACK* callback, IUDEVI out_offset = fun_device_string_send_set(out_data, out_offset, strContainerId); /* USB_DEVICE_CAPABILITIES 28 bytes */ data_write_UINT32(out_data + out_offset, 0x0000001c); /* CbSize */ - data_write_UINT32(out_data + out_offset + 4, 2); /* UsbBusInterfaceVersion, 0 ,1 or 2 */ - data_write_UINT32(out_data + out_offset + 8, 0x600); /* USBDI_Version, 0x500 or 0x600 */ + data_write_UINT32(out_data + out_offset + 4, 2); /* UsbBusInterfaceVersion, 0 ,1 or 2 */ + data_write_UINT32(out_data + out_offset + 8, 0x600); /* USBDI_Version, 0x500 or 0x600 */ /* Supported_USB_Version, 0x110,0x110 or 0x200(usb2.0) */ bcdUSB = pdev->query_device_descriptor(pdev, BCD_USB); data_write_UINT32(out_data + out_offset + 12, bcdUSB); @@ -422,7 +421,7 @@ static UINT urdbrc_send_usb_device_add(URBDRC_CHANNEL_CALLBACK* callback, IUDEVI * @return 0 on success, otherwise a Win32 error code */ static UINT urbdrc_exchange_capabilities(URBDRC_CHANNEL_CALLBACK* callback, char* pBuffer, - UINT32 cbSize) + UINT32 cbSize) { UINT32 MessageId; UINT32 FunctionId; @@ -437,7 +436,7 @@ static UINT urbdrc_exchange_capabilities(URBDRC_CHANNEL_CALLBACK* callback, char break; default: - WLog_ERR(TAG, "%s: unknown FunctionId 0x%"PRIX32"", __FUNCTION__, FunctionId); + WLog_ERR(TAG, "%s: unknown FunctionId 0x%" PRIX32 "", __FUNCTION__, FunctionId); error = ERROR_NOT_FOUND; break; } @@ -449,7 +448,7 @@ static UINT urbdrc_exchange_capabilities(URBDRC_CHANNEL_CALLBACK* callback, char static char* devd_get_val(char* buf, size_t buf_size, const char* val_name, size_t val_name_size, size_t* val_size) { - char* ret, *buf_end, *ptr; + char *ret, *buf_end, *ptr; buf_end = (buf + buf_size); for (ret = buf; ret != NULL && ret < buf_end;) @@ -476,7 +475,7 @@ static char* devd_get_val(char* buf, size_t buf_size, const char* val_name, size if (ret[0] != '=') continue; - ret ++; + ret++; break; } @@ -547,7 +546,7 @@ static void* urbdrc_search_usb_device(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", error); return 0; } @@ -556,8 +555,12 @@ static void* urbdrc_search_usb_device(void* arg) errno = 0; WLog_DBG(TAG, "======= SEARCH ======= "); - /* !system=USB subsystem=DEVICE type=ATTACH ugen=ugen3.3 cdev=ugen3.3 vendor=0x046d product=0x082d devclass=0xef devsubclass=0x02 sernum="6E7D726F" release=0x0011 mode=host port=4 parent=ugen3.1 */ - /* !system=USB subsystem=DEVICE type=DETACH ugen=ugen3.3 cdev=ugen3.3 vendor=0x046d product=0x082d devclass=0xef devsubclass=0x02 sernum="6E7D726F" release=0x0011 mode=host port=4 parent=ugen3.1 */ + /* !system=USB subsystem=DEVICE type=ATTACH ugen=ugen3.3 cdev=ugen3.3 vendor=0x046d + * product=0x082d devclass=0xef devsubclass=0x02 sernum="6E7D726F" release=0x0011 mode=host + * port=4 parent=ugen3.1 */ + /* !system=USB subsystem=DEVICE type=DETACH ugen=ugen3.3 cdev=ugen3.3 vendor=0x046d + * product=0x082d devclass=0xef devsubclass=0x02 sernum="6E7D726F" release=0x0011 mode=host + * port=4 parent=ugen3.1 */ data_size = read(devd_skt, buf, (sizeof(buf) - 1)); if (data_size == -1) @@ -617,7 +620,7 @@ static void* urbdrc_search_usb_device(void* arg) /* Prepare strings. */ ptr[0] = 0; - ptr ++; + ptr++; val[val_size] = 0; /* Extract numbers. */ busnum = strtol(val, NULL, 0); @@ -668,7 +671,8 @@ static void* urbdrc_search_usb_device(void* arg) continue; val[val_size] = ' '; - WLog_DBG(TAG, "ATTACH: bus: %i, dev: %i, ven: %i, prod: %i", busnum, devnum, idVendor, idProduct); + WLog_DBG(TAG, "ATTACH: bus: %i, dev: %i, ven: %i, prod: %i", busnum, devnum, + idVendor, idProduct); dvc_channel = channel_mgr->FindChannelById(channel_mgr, urbdrc->first_channel_id); searchman->rewind(searchman); @@ -676,10 +680,9 @@ static void* urbdrc_search_usb_device(void* arg) { sdev = searchman->get_next(searchman); - if (sdev->idVendor == idVendor && - sdev->idProduct == idProduct) + if (sdev->idVendor == idVendor && sdev->idProduct == idProduct) { - WLog_VRB(TAG, "Searchman Found Device: %04"PRIx16":%04"PRIx16"", + WLog_VRB(TAG, "Searchman Found Device: %04" PRIx16 ":%04" PRIx16 "", sdev->idVendor, sdev->idProduct); found = 1; break; @@ -688,20 +691,20 @@ static void* urbdrc_search_usb_device(void* arg) if (!found && udevman->isAutoAdd(udevman)) { - WLog_VRB(TAG, "Auto Find Device: %04x:%04x ", - idVendor, idProduct); + WLog_VRB(TAG, "Auto Find Device: %04x:%04x ", idVendor, idProduct); found = 2; } if (found) { - success = udevman->register_udevice(udevman, busnum, devnum, - searchman->UsbDevice, 0, 0, UDEVMAN_FLAG_ADD_BY_ADDR); + success = + udevman->register_udevice(udevman, busnum, devnum, searchman->UsbDevice, 0, + 0, UDEVMAN_FLAG_ADD_BY_ADDR); } if (success) { - searchman->UsbDevice ++; + searchman->UsbDevice++; usleep(400000); error = urdbrc_send_virtual_channel_add(dvc_channel, 0); @@ -726,11 +729,13 @@ static void* urbdrc_search_usb_device(void* arg) if (pdev->get_bus_number(pdev) == busnum && pdev->get_dev_number(pdev) == devnum) { - dvc_channel = channel_mgr->FindChannelById(channel_mgr, pdev->get_channel_id(pdev)); + dvc_channel = + channel_mgr->FindChannelById(channel_mgr, pdev->get_channel_id(pdev)); if (dvc_channel == NULL) { - WLog_ERR(TAG, "SEARCH: dvc_channel %d is NULL!!", pdev->get_channel_id(pdev)); + WLog_ERR(TAG, "SEARCH: dvc_channel %d is NULL!!", + pdev->get_channel_id(pdev)); func_close_udevice(searchman, pdev); break; } @@ -749,8 +754,7 @@ static void* urbdrc_search_usb_device(void* arg) udevman->loading_unlock(udevman); usleep(300000); - if (pdev && on_close && dvc_channel && - pdev->isSigToEnd(pdev) && + if (pdev && on_close && dvc_channel && pdev->isSigToEnd(pdev) && !(pdev->isChannelClosed(pdev))) { dvc_channel->Close(dvc_channel); @@ -768,11 +772,11 @@ err_out: return 0; } #endif -#if defined (__linux__) +#if defined(__linux__) static void* urbdrc_search_usb_device(void* arg) { - USB_SEARCHMAN* searchman = (USB_SEARCHMAN*) arg; - URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*) searchman->urbdrc; + USB_SEARCHMAN* searchman = (USB_SEARCHMAN*)arg; + URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*)searchman->urbdrc; IUDEVMAN* udevman = urbdrc->udevman; IWTSVirtualChannelManager* channel_mgr; IWTSVirtualChannel* dvc_channel; @@ -795,7 +799,7 @@ static void* urbdrc_search_usb_device(void* arg) if (!udev) { - WLog_ERR(TAG, "Can't create udev"); + WLog_ERR(TAG, "Can't create udev"); return 0; } @@ -805,8 +809,7 @@ static void* urbdrc_search_usb_device(void* arg) udev_monitor_enable_receiving(mon); /* Get the file descriptor (fd) for the monitor. This fd will get passed to select() */ - mon_fd = CreateFileDescriptorEvent(NULL, TRUE, FALSE, - udev_monitor_get_fd(mon), WINPR_FD_READ); + mon_fd = CreateFileDescriptorEvent(NULL, TRUE, FALSE, udev_monitor_get_fd(mon), WINPR_FD_READ); if (!mon_fd) goto fail_create_monfd_event; @@ -828,7 +831,7 @@ static void* urbdrc_search_usb_device(void* arg) if (status == WAIT_FAILED) { dwError = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", dwError); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "!", dwError); goto out; } @@ -837,7 +840,7 @@ static void* urbdrc_search_usb_device(void* arg) if (status == WAIT_FAILED) { dwError = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", dwError); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", dwError); goto out; } @@ -852,7 +855,7 @@ static void* urbdrc_search_usb_device(void* arg) if (status == WAIT_FAILED) { dwError = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", dwError); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", dwError); goto out; } @@ -895,18 +898,17 @@ static void* urbdrc_search_usb_device(void* arg) if (errno != 0) continue; - dvc_channel = channel_mgr->FindChannelById(channel_mgr, - urbdrc->first_channel_id); + dvc_channel = + channel_mgr->FindChannelById(channel_mgr, urbdrc->first_channel_id); searchman->rewind(searchman); while (dvc_channel && searchman->has_next(searchman)) { sdev = searchman->get_next(searchman); - if (sdev->idVendor == idVendor && - sdev->idProduct == idProduct) + if (sdev->idVendor == idVendor && sdev->idProduct == idProduct) { - WLog_VRB(TAG, "Searchman Find Device: %04"PRIx16":%04"PRIx16"", + WLog_VRB(TAG, "Searchman Find Device: %04" PRIx16 ":%04" PRIx16 "", sdev->idVendor, sdev->idProduct); found = 1; break; @@ -915,15 +917,15 @@ static void* urbdrc_search_usb_device(void* arg) if (!found && udevman->isAutoAdd(udevman)) { - WLog_VRB(TAG, "Auto Find Device: %04x:%04x ", - idVendor, idProduct); + WLog_VRB(TAG, "Auto Find Device: %04x:%04x ", idVendor, idProduct); found = 2; } if (found) { - success = udevman->register_udevice(udevman, busnum, devnum, - searchman->UsbDevice, 0, 0, UDEVMAN_FLAG_ADD_BY_ADDR); + success = + udevman->register_udevice(udevman, busnum, devnum, searchman->UsbDevice, + 0, 0, UDEVMAN_FLAG_ADD_BY_ADDR); } if (success) @@ -944,7 +946,8 @@ static void* urbdrc_search_usb_device(void* arg) if (status == WAIT_FAILED) { dwError = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", dwError); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "!", + dwError); goto out; } @@ -953,7 +956,8 @@ static void* urbdrc_search_usb_device(void* arg) if (status == WAIT_FAILED) { dwError = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", dwError); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "!", + dwError); goto out; } @@ -990,13 +994,16 @@ static void* urbdrc_search_usb_device(void* arg) { pdev = udevman->get_next(udevman); - if (pdev->get_bus_number(pdev) == busnum && pdev->get_dev_number(pdev) == devnum) + if (pdev->get_bus_number(pdev) == busnum && + pdev->get_dev_number(pdev) == devnum) { - dvc_channel = channel_mgr->FindChannelById(channel_mgr, pdev->get_channel_id(pdev)); + dvc_channel = channel_mgr->FindChannelById(channel_mgr, + pdev->get_channel_id(pdev)); if (dvc_channel == NULL) { - WLog_ERR(TAG, "SEARCH: dvc_channel %d is NULL!!", pdev->get_channel_id(pdev)); + WLog_ERR(TAG, "SEARCH: dvc_channel %d is NULL!!", + pdev->get_channel_id(pdev)); func_close_udevice(searchman, pdev); break; } @@ -1021,7 +1028,8 @@ static void* urbdrc_search_usb_device(void* arg) if (status == WAIT_FAILED) { dwError = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", dwError); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %" PRIu32 "!", + dwError); goto out; } @@ -1030,7 +1038,8 @@ static void* urbdrc_search_usb_device(void* arg) if (status == WAIT_FAILED) { dwError = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", dwError); + WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "!", + dwError); goto out; } @@ -1041,7 +1050,8 @@ static void* urbdrc_search_usb_device(void* arg) return 0; } - if (pdev && on_close && dvc_channel && pdev->isSigToEnd(pdev) && !(pdev->isChannelClosed(pdev))) + if (pdev && on_close && dvc_channel && pdev->isSigToEnd(pdev) && + !(pdev->isChannelClosed(pdev))) { on_close = 0; dvc_channel->Close(dvc_channel); @@ -1052,7 +1062,7 @@ static void* urbdrc_search_usb_device(void* arg) } else { - WLog_ERR(TAG, "No Device from receive_device(). An error occurred."); + WLog_ERR(TAG, "No Device from receive_device(). An error occurred."); } } } @@ -1067,7 +1077,7 @@ fail_create_monfd_event: void* urbdrc_new_device_create(void* arg) { - TRANSFER_DATA* transfer_data = (TRANSFER_DATA*) arg; + TRANSFER_DATA* transfer_data = (TRANSFER_DATA*)arg; URBDRC_CHANNEL_CALLBACK* callback = transfer_data->callback; IWTSVirtualChannelManager* channel_mgr; URBDRC_PLUGIN* urbdrc = transfer_data->urbdrc; @@ -1137,8 +1147,7 @@ void* urbdrc_new_device_create(void* arg) break; default: - WLog_ERR(TAG, "vchannel_status unknown value %"PRIu32"", - urbdrc->vchannel_status); + WLog_ERR(TAG, "vchannel_status unknown value %" PRIu32 "", urbdrc->vchannel_status); break; } @@ -1151,13 +1160,13 @@ void* urbdrc_new_device_create(void* arg) * @return 0 on success, otherwise a Win32 error code */ static UINT urbdrc_process_channel_notification(URBDRC_CHANNEL_CALLBACK* callback, char* pBuffer, - UINT32 cbSize) + UINT32 cbSize) { UINT32 i; UINT32 MessageId; UINT32 FunctionId; UINT error = CHANNEL_RC_OK; - URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*) callback->plugin; + URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*)callback->plugin; WLog_DBG(TAG, "..."); data_read_UINT32(pBuffer + 0, MessageId); data_read_UINT32(pBuffer + 4, FunctionId); @@ -1171,7 +1180,7 @@ static UINT urbdrc_process_channel_notification(URBDRC_CHANNEL_CALLBACK* callbac case RIMCALL_RELEASE: WLog_VRB(TAG, "recv RIMCALL_RELEASE"); pthread_t thread; - TRANSFER_DATA* transfer_data; + TRANSFER_DATA* transfer_data; transfer_data = (TRANSFER_DATA*)malloc(sizeof(TRANSFER_DATA)); if (!transfer_data) @@ -1182,7 +1191,7 @@ static UINT urbdrc_process_channel_notification(URBDRC_CHANNEL_CALLBACK* callbac transfer_data->udevman = urbdrc->udevman; transfer_data->urbdrc = urbdrc; transfer_data->cbSize = cbSize; - transfer_data->pBuffer = (BYTE*) malloc((cbSize)); + transfer_data->pBuffer = (BYTE*)malloc((cbSize)); if (!transfer_data->pBuffer) { @@ -1206,7 +1215,7 @@ static UINT urbdrc_process_channel_notification(URBDRC_CHANNEL_CALLBACK* callbac break; default: - WLog_VRB(TAG, "%s: unknown FunctionId 0x%"PRIX32"", __FUNCTION__, FunctionId); + WLog_VRB(TAG, "%s: unknown FunctionId 0x%" PRIX32 "", __FUNCTION__, FunctionId); error = 1; break; } @@ -1221,7 +1230,7 @@ static UINT urbdrc_process_channel_notification(URBDRC_CHANNEL_CALLBACK* callbac */ static UINT urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream* data) { - URBDRC_CHANNEL_CALLBACK* callback = (URBDRC_CHANNEL_CALLBACK*) pChannelCallback; + URBDRC_CHANNEL_CALLBACK* callback = (URBDRC_CHANNEL_CALLBACK*)pChannelCallback; URBDRC_PLUGIN* urbdrc; IUDEVMAN* udevman; UINT32 InterfaceTemp; @@ -1237,16 +1246,17 @@ static UINT urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback if (callback->plugin == NULL) return 0; - urbdrc = (URBDRC_PLUGIN*) callback->plugin; + urbdrc = (URBDRC_PLUGIN*)callback->plugin; if (urbdrc->udevman == NULL) return 0; - udevman = (IUDEVMAN*) urbdrc->udevman; + udevman = (IUDEVMAN*)urbdrc->udevman; data_read_UINT32(pBuffer + 0, InterfaceTemp); InterfaceId = (InterfaceTemp & 0x0fffffff); Mask = ((InterfaceTemp & 0xf0000000) >> 30); - WLog_VRB(TAG, "Size=%"PRIu32" InterfaceId=0x%"PRIX32" Mask=0x%"PRIX32"", cbSize, InterfaceId, Mask); + WLog_VRB(TAG, "Size=%" PRIu32 " InterfaceId=0x%" PRIX32 " Mask=0x%" PRIX32 "", cbSize, + InterfaceId, Mask); switch (InterfaceId) { @@ -1259,7 +1269,7 @@ static UINT urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback break; default: - WLog_VRB(TAG, "InterfaceId 0x%"PRIX32" Start matching devices list", InterfaceId); + WLog_VRB(TAG, "InterfaceId 0x%" PRIX32 " Start matching devices list", InterfaceId); pthread_t thread; TRANSFER_DATA* transfer_data; transfer_data = (TRANSFER_DATA*)malloc(sizeof(TRANSFER_DATA)); @@ -1294,7 +1304,7 @@ static UINT urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback if (error != 0) { - WLog_ERR(TAG, "Create Data Transfer Thread got error = %"PRIu32"", error); + WLog_ERR(TAG, "Create Data Transfer Thread got error = %" PRIu32 "", error); free(transfer_data->pBuffer); free(transfer_data); return ERROR_INVALID_OPERATION; @@ -1314,15 +1324,15 @@ static UINT urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback */ static UINT urbdrc_on_close(IWTSVirtualChannelCallback* pChannelCallback) { - URBDRC_CHANNEL_CALLBACK* callback = (URBDRC_CHANNEL_CALLBACK*) pChannelCallback; - URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*) callback->plugin; - IUDEVMAN* udevman = (IUDEVMAN*) urbdrc->udevman; - USB_SEARCHMAN* searchman = (USB_SEARCHMAN*) urbdrc->searchman; + URBDRC_CHANNEL_CALLBACK* callback = (URBDRC_CHANNEL_CALLBACK*)pChannelCallback; + URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*)callback->plugin; + IUDEVMAN* udevman = (IUDEVMAN*)urbdrc->udevman; + USB_SEARCHMAN* searchman = (USB_SEARCHMAN*)urbdrc->searchman; IUDEVICE* pdev = NULL; UINT32 ChannelId = 0; int found = 0; ChannelId = callback->channel_mgr->GetChannelId(callback->channel); - WLog_INFO(TAG, "urbdrc_on_close: channel id %"PRIu32"", ChannelId); + WLog_INFO(TAG, "urbdrc_on_close: channel id %" PRIu32 "", ChannelId); udevman->loading_lock(udevman); udevman->rewind(udevman); @@ -1356,12 +1366,14 @@ static UINT urbdrc_on_close(IWTSVirtualChannelCallback* pChannelCallback) * @return 0 on success, otherwise a Win32 error code */ static UINT urbdrc_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, - IWTSVirtualChannel* pChannel, BYTE* pData, BOOL* pbAccept, IWTSVirtualChannelCallback** ppCallback) + IWTSVirtualChannel* pChannel, BYTE* pData, + BOOL* pbAccept, + IWTSVirtualChannelCallback** ppCallback) { - URBDRC_LISTENER_CALLBACK* listener_callback = (URBDRC_LISTENER_CALLBACK*) pListenerCallback; + URBDRC_LISTENER_CALLBACK* listener_callback = (URBDRC_LISTENER_CALLBACK*)pListenerCallback; URBDRC_CHANNEL_CALLBACK* callback; WLog_VRB(TAG, ""); - callback = (URBDRC_CHANNEL_CALLBACK*) calloc(1, sizeof(URBDRC_CHANNEL_CALLBACK)); + callback = (URBDRC_CHANNEL_CALLBACK*)calloc(1, sizeof(URBDRC_CHANNEL_CALLBACK)); if (!callback) return ERROR_OUTOFMEMORY; @@ -1371,7 +1383,7 @@ static UINT urbdrc_on_new_channel_connection(IWTSListenerCallback* pListenerCall callback->plugin = listener_callback->plugin; callback->channel_mgr = listener_callback->channel_mgr; callback->channel = pChannel; - *ppCallback = (IWTSVirtualChannelCallback*) callback; + *ppCallback = (IWTSVirtualChannelCallback*)callback; return CHANNEL_RC_OK; } @@ -1382,11 +1394,12 @@ static UINT urbdrc_on_new_channel_connection(IWTSListenerCallback* pListenerCall */ static UINT urbdrc_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) { - URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*) pPlugin; + URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*)pPlugin; IUDEVMAN* udevman = NULL; USB_SEARCHMAN* searchman = NULL; WLog_VRB(TAG, ""); - urbdrc->listener_callback = (URBDRC_LISTENER_CALLBACK*) calloc(1, sizeof(URBDRC_LISTENER_CALLBACK)); + urbdrc->listener_callback = + (URBDRC_LISTENER_CALLBACK*)calloc(1, sizeof(URBDRC_LISTENER_CALLBACK)); if (!urbdrc->listener_callback) return CHANNEL_RC_NO_MEMORY; @@ -1396,7 +1409,7 @@ static UINT urbdrc_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelMana urbdrc->listener_callback->channel_mgr = pChannelMgr; /* Init searchman */ udevman = urbdrc->udevman; - searchman = searchman_new((void*) urbdrc, udevman->get_defUsbDevice(udevman)); + searchman = searchman_new((void*)urbdrc, udevman->get_defUsbDevice(udevman)); if (!searchman) { @@ -1407,7 +1420,7 @@ static UINT urbdrc_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelMana urbdrc->searchman = searchman; return pChannelMgr->CreateListener(pChannelMgr, "URBDRC", 0, - (IWTSListenerCallback*) urbdrc->listener_callback, NULL); + (IWTSListenerCallback*)urbdrc->listener_callback, NULL); } /** @@ -1417,7 +1430,7 @@ static UINT urbdrc_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelMana */ static UINT urbdrc_plugin_terminated(IWTSPlugin* pPlugin) { - URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*) pPlugin; + URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*)pPlugin; IUDEVMAN* udevman = urbdrc->udevman; USB_SEARCHMAN* searchman = urbdrc->searchman; WLog_VRB(TAG, ""); @@ -1457,7 +1470,7 @@ static UINT urbdrc_plugin_terminated(IWTSPlugin* pPlugin) static void urbdrc_register_udevman_addin(IWTSPlugin* pPlugin, IUDEVMAN* udevman) { - URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*) pPlugin; + URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*)pPlugin; if (urbdrc->udevman) { @@ -1478,8 +1491,8 @@ static UINT urbdrc_load_udevman_addin(IWTSPlugin* pPlugin, const char* name, ADD { PFREERDP_URBDRC_DEVICE_ENTRY entry; FREERDP_URBDRC_SERVICE_ENTRY_POINTS entryPoints; - entry = (PFREERDP_URBDRC_DEVICE_ENTRY) freerdp_load_channel_addin_entry("urbdrc", (LPSTR) name, - NULL, 0); + entry = (PFREERDP_URBDRC_DEVICE_ENTRY)freerdp_load_channel_addin_entry("urbdrc", (LPSTR)name, + NULL, 0); if (!entry) return ERROR_INVALID_OPERATION; @@ -1514,15 +1527,14 @@ static UINT urbdrc_process_addin_args(URBDRC_PLUGIN* urbdrc, ADDIN_ARGV* args) int status; DWORD flags; COMMAND_LINE_ARGUMENT_A* arg; - COMMAND_LINE_ARGUMENT_A urbdrc_args[] = - { - { "dbg", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "debug" }, - { "sys", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "subsystem" }, - { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } - }; + COMMAND_LINE_ARGUMENT_A urbdrc_args[] = { + { "dbg", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "debug" }, + { "sys", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "subsystem" }, + { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } + }; flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON; - status = CommandLineParseArgumentsA(args->argc, args->argv, - urbdrc_args, flags, urbdrc, NULL, NULL); + status = + CommandLineParseArgumentsA(args->argc, args->argv, urbdrc_args, flags, urbdrc, NULL, NULL); if (status < 0) return ERROR_INVALID_DATA; @@ -1534,8 +1546,7 @@ static UINT urbdrc_process_addin_args(URBDRC_PLUGIN* urbdrc, ADDIN_ARGV* args) if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "dbg") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "dbg") { WLog_SetLogLevel(WLog_Get(TAG), WLOG_TRACE); } @@ -1548,8 +1559,7 @@ static UINT urbdrc_process_addin_args(URBDRC_PLUGIN* urbdrc, ADDIN_ARGV* args) { } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); return CHANNEL_RC_OK; } @@ -1570,12 +1580,12 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) UINT status = 0; ADDIN_ARGV* args; URBDRC_PLUGIN* urbdrc; - urbdrc = (URBDRC_PLUGIN*) pEntryPoints->GetPlugin(pEntryPoints, "urbdrc"); + urbdrc = (URBDRC_PLUGIN*)pEntryPoints->GetPlugin(pEntryPoints, "urbdrc"); args = pEntryPoints->GetPluginData(pEntryPoints); if (urbdrc == NULL) { - urbdrc = (URBDRC_PLUGIN*) calloc(1, sizeof(URBDRC_PLUGIN)); + urbdrc = (URBDRC_PLUGIN*)calloc(1, sizeof(URBDRC_PLUGIN)); if (!urbdrc) return CHANNEL_RC_NO_MEMORY; @@ -1586,7 +1596,7 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) urbdrc->iface.Terminated = urbdrc_plugin_terminated; urbdrc->searchman = NULL; urbdrc->vchannel_status = INIT_CHANNEL_IN; - status = pEntryPoints->RegisterPlugin(pEntryPoints, "urbdrc", (IWTSPlugin*) urbdrc); + status = pEntryPoints->RegisterPlugin(pEntryPoints, "urbdrc", (IWTSPlugin*)urbdrc); if (status != CHANNEL_RC_OK) goto error_register; @@ -1598,7 +1608,7 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) { /* TODO: we should unregister the plugin ? */ WLog_ERR(TAG, "error processing arguments"); - //return status; + // return status; } if (!urbdrc->subsystem && !urbdrc_set_subsystem(urbdrc, "libusb")) @@ -1608,7 +1618,7 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) return ERROR_OUTOFMEMORY; } - return urbdrc_load_udevman_addin((IWTSPlugin*) urbdrc, urbdrc->subsystem, args); + return urbdrc_load_udevman_addin((IWTSPlugin*)urbdrc, urbdrc->subsystem, args); error_register: free(urbdrc); return status; diff --git a/channels/urbdrc/client/urbdrc_main.h b/channels/urbdrc/client/urbdrc_main.h index 129b84435..e76ef4024 100644 --- a/channels/urbdrc/client/urbdrc_main.h +++ b/channels/urbdrc/client/urbdrc_main.h @@ -18,29 +18,27 @@ * limitations under the License. */ - - #ifndef FREERDP_CHANNEL_URBDRC_CLIENT_MAIN_H #define FREERDP_CHANNEL_URBDRC_CLIENT_MAIN_H #include "searchman.h" #include "isoch_queue.h" -#define DEVICE_HARDWARE_ID_SIZE 32 -#define DEVICE_COMPATIBILITY_ID_SIZE 36 -#define DEVICE_INSTANCE_STR_SIZE 37 -#define DEVICE_CONTAINER_STR_SIZE 39 +#define DEVICE_HARDWARE_ID_SIZE 32 +#define DEVICE_COMPATIBILITY_ID_SIZE 36 +#define DEVICE_INSTANCE_STR_SIZE 37 +#define DEVICE_CONTAINER_STR_SIZE 39 typedef struct _IUDEVICE IUDEVICE; typedef struct _IUDEVMAN IUDEVMAN; #define BASIC_DEV_STATE_DEFINED(_arg, _type) \ - _type (*get_##_arg) (IUDEVICE* pdev); \ - void (*set_##_arg) (IUDEVICE* pdev, _type _arg) + _type (*get_##_arg)(IUDEVICE * pdev); \ + void (*set_##_arg)(IUDEVICE * pdev, _type _arg) #define BASIC_DEVMAN_STATE_DEFINED(_arg, _type) \ - _type (*get_##_arg) (IUDEVMAN* udevman); \ - void (*set_##_arg) (IUDEVMAN* udevman, _type _arg) + _type (*get_##_arg)(IUDEVMAN * udevman); \ + void (*set_##_arg)(IUDEVMAN * udevman, _type _arg) typedef struct _URBDRC_LISTENER_CALLBACK URBDRC_LISTENER_CALLBACK; @@ -106,75 +104,76 @@ struct _TRANSFER_DATA struct _IUDEVICE { /* Transfer */ - int (*isoch_transfer) (IUDEVICE* idev, UINT32 RequestId, - UINT32 EndpointAddress, UINT32 TransferFlags, int NoAck, UINT32* ErrorCount, - UINT32* UrbdStatus, UINT32* StartFrame, UINT32 NumberOfPackets, - BYTE* IsoPacket, UINT32* BufferSize, BYTE* Buffer, int Timeout); + int (*isoch_transfer)(IUDEVICE* idev, UINT32 RequestId, UINT32 EndpointAddress, + UINT32 TransferFlags, int NoAck, UINT32* ErrorCount, UINT32* UrbdStatus, + UINT32* StartFrame, UINT32 NumberOfPackets, BYTE* IsoPacket, + UINT32* BufferSize, BYTE* Buffer, int Timeout); - int (*control_transfer) (IUDEVICE* idev, UINT32 RequestId, - UINT32 EndpointAddress, UINT32 TransferFlags, BYTE bmRequestType, BYTE Request, UINT16 Value, - UINT16 Index, UINT32* UrbdStatus, UINT32* BufferSize, BYTE* Buffer, UINT32 Timeout); + int (*control_transfer)(IUDEVICE* idev, UINT32 RequestId, UINT32 EndpointAddress, + UINT32 TransferFlags, BYTE bmRequestType, BYTE Request, UINT16 Value, + UINT16 Index, UINT32* UrbdStatus, UINT32* BufferSize, BYTE* Buffer, + UINT32 Timeout); - int (*bulk_or_interrupt_transfer) (IUDEVICE* idev, UINT32 RequestId, UINT32 EndpointAddress, - UINT32 TransferFlags, UINT32* UsbdStatus, UINT32* BufferSize, BYTE* Buffer, UINT32 Timeout); + int (*bulk_or_interrupt_transfer)(IUDEVICE* idev, UINT32 RequestId, UINT32 EndpointAddress, + UINT32 TransferFlags, UINT32* UsbdStatus, UINT32* BufferSize, + BYTE* Buffer, UINT32 Timeout); - int (*select_configuration) (IUDEVICE* idev, UINT32 bConfigurationValue); + int (*select_configuration)(IUDEVICE* idev, UINT32 bConfigurationValue); - int (*select_interface) (IUDEVICE* idev, BYTE InterfaceNumber, - BYTE AlternateSetting); + int (*select_interface)(IUDEVICE* idev, BYTE InterfaceNumber, BYTE AlternateSetting); - int (*control_pipe_request) (IUDEVICE* idev, UINT32 RequestId, - UINT32 EndpointAddress, UINT32* UsbdStatus, int command); + int (*control_pipe_request)(IUDEVICE* idev, UINT32 RequestId, UINT32 EndpointAddress, + UINT32* UsbdStatus, int command); - int (*control_query_device_text) (IUDEVICE* idev, UINT32 TextType, - UINT32 LocaleId, UINT32*BufferSize, BYTE* Buffer); + int (*control_query_device_text)(IUDEVICE* idev, UINT32 TextType, UINT32 LocaleId, + UINT32* BufferSize, BYTE* Buffer); - int (*os_feature_descriptor_request) (IUDEVICE* idev, UINT32 RequestId, BYTE Recipient, - BYTE InterfaceNumber, BYTE Ms_PageIndex, UINT16 Ms_featureDescIndex, UINT32* UsbdStatus, - UINT32* BufferSize, BYTE* Buffer, int Timeout); + int (*os_feature_descriptor_request)(IUDEVICE* idev, UINT32 RequestId, BYTE Recipient, + BYTE InterfaceNumber, BYTE Ms_PageIndex, + UINT16 Ms_featureDescIndex, UINT32* UsbdStatus, + UINT32* BufferSize, BYTE* Buffer, int Timeout); - void (*cancel_all_transfer_request) (IUDEVICE* idev); + void (*cancel_all_transfer_request)(IUDEVICE* idev); - int (*cancel_transfer_request) (IUDEVICE* idev, UINT32 RequestId); + int (*cancel_transfer_request)(IUDEVICE* idev, UINT32 RequestId); - int (*query_device_descriptor) (IUDEVICE* idev, int offset); + int (*query_device_descriptor)(IUDEVICE* idev, int offset); - void (*detach_kernel_driver) (IUDEVICE* idev); + void (*detach_kernel_driver)(IUDEVICE* idev); - void (*attach_kernel_driver) (IUDEVICE* idev); + void (*attach_kernel_driver)(IUDEVICE* idev); - int (*wait_action_completion) (IUDEVICE* idev); + int (*wait_action_completion)(IUDEVICE* idev); - void (*push_action) (IUDEVICE* idev); + void (*push_action)(IUDEVICE* idev); - void (*complete_action) (IUDEVICE* idev); + void (*complete_action)(IUDEVICE* idev); /* Wait for 5 sec */ - int (*wait_for_detach) (IUDEVICE* idev); + int (*wait_for_detach)(IUDEVICE* idev); /* FIXME: Currently this is a way of stupid, SHOULD to improve it. * Isochronous transfer must to FIFO */ - void (*lock_fifo_isoch) (IUDEVICE* idev); - void (*unlock_fifo_isoch) (IUDEVICE* idev); + void (*lock_fifo_isoch)(IUDEVICE* idev); + void (*unlock_fifo_isoch)(IUDEVICE* idev); - int (*query_device_port_status) (IUDEVICE* idev, UINT32 *UsbdStatus, - UINT32* BufferSize, - BYTE* Buffer); + int (*query_device_port_status)(IUDEVICE* idev, UINT32* UsbdStatus, UINT32* BufferSize, + BYTE* Buffer); - int (*request_queue_is_none) (IUDEVICE* idev); + int (*request_queue_is_none)(IUDEVICE* idev); - MSUSB_CONFIG_DESCRIPTOR* (*complete_msconfig_setup) (IUDEVICE* idev, - MSUSB_CONFIG_DESCRIPTOR* MsConfig); + MSUSB_CONFIG_DESCRIPTOR* (*complete_msconfig_setup)(IUDEVICE* idev, + MSUSB_CONFIG_DESCRIPTOR* MsConfig); /* Basic state */ - int (*isCompositeDevice) (IUDEVICE* idev); - int (*isSigToEnd) (IUDEVICE* idev); - int (*isExist) (IUDEVICE* idev); - int (*isAlreadySend) (IUDEVICE* idev); - int (*isChannelClosed) (IUDEVICE* idev); - void (*SigToEnd) (IUDEVICE* idev); - void (*setAlreadySend) (IUDEVICE* idev); - void (*setChannelClosed) (IUDEVICE* idev); - char *(*getPath) (IUDEVICE* idev); + int (*isCompositeDevice)(IUDEVICE* idev); + int (*isSigToEnd)(IUDEVICE* idev); + int (*isExist)(IUDEVICE* idev); + int (*isAlreadySend)(IUDEVICE* idev); + int (*isChannelClosed)(IUDEVICE* idev); + void (*SigToEnd)(IUDEVICE* idev); + void (*setAlreadySend)(IUDEVICE* idev); + void (*setChannelClosed)(IUDEVICE* idev); + char* (*getPath)(IUDEVICE* idev); BASIC_DEV_STATE_DEFINED(channel_id, UINT32); BASIC_DEV_STATE_DEFINED(UsbDevice, UINT32); @@ -190,27 +189,26 @@ struct _IUDEVICE BASIC_DEV_STATE_DEFINED(p_next, void*); /* Control semaphore or mutex lock */ - }; struct _IUDEVMAN { /* Standard */ - void (*free) (IUDEVMAN* idevman); + void (*free)(IUDEVMAN* idevman); /* Manage devices */ - void (*rewind) (IUDEVMAN* idevman); - int (*has_next) (IUDEVMAN* idevman); - int (*unregister_udevice) (IUDEVMAN* idevman, int bus_number, int dev_number); - int (*register_udevice) (IUDEVMAN* idevman, int bus_number, - int dev_number, int UsbDevice, UINT16 idVendor, UINT16 idProduct, int flag); - IUDEVICE *(*get_next) (IUDEVMAN* idevman); - IUDEVICE *(*get_udevice_by_UsbDevice) (IUDEVMAN* idevman, UINT32 UsbDevice); - IUDEVICE *(*get_udevice_by_UsbDevice_try_again) (IUDEVMAN* idevman, UINT32 UsbDevice); + void (*rewind)(IUDEVMAN* idevman); + int (*has_next)(IUDEVMAN* idevman); + int (*unregister_udevice)(IUDEVMAN* idevman, int bus_number, int dev_number); + int (*register_udevice)(IUDEVMAN* idevman, int bus_number, int dev_number, int UsbDevice, + UINT16 idVendor, UINT16 idProduct, int flag); + IUDEVICE* (*get_next)(IUDEVMAN* idevman); + IUDEVICE* (*get_udevice_by_UsbDevice)(IUDEVMAN* idevman, UINT32 UsbDevice); + IUDEVICE* (*get_udevice_by_UsbDevice_try_again)(IUDEVMAN* idevman, UINT32 UsbDevice); /* Extension */ - int (*check_device_exist_by_id) (IUDEVMAN* idevman, UINT16 idVendor, UINT16 idProduct); - int (*isAutoAdd) (IUDEVMAN* idevman); + int (*check_device_exist_by_id)(IUDEVMAN* idevman, UINT16 idVendor, UINT16 idProduct); + int (*isAutoAdd)(IUDEVMAN* idevman); /* Basic state */ BASIC_DEVMAN_STATE_DEFINED(defUsbDevice, UINT32); @@ -218,10 +216,10 @@ struct _IUDEVMAN BASIC_DEVMAN_STATE_DEFINED(sem_timeout, int); /* control semaphore or mutex lock */ - void (*loading_lock) (IUDEVMAN* idevman); - void (*loading_unlock) (IUDEVMAN* idevman); - void (*push_urb) (IUDEVMAN* idevman); - void (*wait_urb) (IUDEVMAN* idevman); + void (*loading_lock)(IUDEVMAN* idevman); + void (*loading_unlock)(IUDEVMAN* idevman); + void (*push_urb)(IUDEVMAN* idevman); + void (*wait_urb)(IUDEVMAN* idevman); }; #endif /* FREERDP_CHANNEL_URBDRC_CLIENT_MAIN_H */ diff --git a/channels/urbdrc/client/urbdrc_types.h b/channels/urbdrc/client/urbdrc_types.h index 204cadec3..57555b47e 100644 --- a/channels/urbdrc/client/urbdrc_types.h +++ b/channels/urbdrc/client/urbdrc_types.h @@ -40,72 +40,74 @@ #ifdef WITH_DEBUG_DVC #define DEBUG_DVC(...) WLog_DBG(TAG, __VA_ARGS__) #else -#define DEBUG_DVC(...) do { } while (0) +#define DEBUG_DVC(...) \ + do \ + { \ + } while (0) #endif -#define CAPABILITIES_NEGOTIATOR 0x00000000 -#define CLIENT_DEVICE_SINK 0x00000001 -#define SERVER_CHANNEL_NOTIFICATION 0x00000002 -#define CLIENT_CHANNEL_NOTIFICATION 0x00000003 -#define BASE_USBDEVICE_NUM 0x00000005 +#define CAPABILITIES_NEGOTIATOR 0x00000000 +#define CLIENT_DEVICE_SINK 0x00000001 +#define SERVER_CHANNEL_NOTIFICATION 0x00000002 +#define CLIENT_CHANNEL_NOTIFICATION 0x00000003 +#define BASE_USBDEVICE_NUM 0x00000005 -#define RIMCALL_RELEASE 0x00000001 -#define RIM_EXCHANGE_CAPABILITY_REQUEST 0x00000100 -#define CHANNEL_CREATED 0x00000100 -#define ADD_VIRTUAL_CHANNEL 0x00000100 -#define ADD_DEVICE 0x00000101 +#define RIMCALL_RELEASE 0x00000001 +#define RIM_EXCHANGE_CAPABILITY_REQUEST 0x00000100 +#define CHANNEL_CREATED 0x00000100 +#define ADD_VIRTUAL_CHANNEL 0x00000100 +#define ADD_DEVICE 0x00000101 -#define INIT_CHANNEL_IN 1 -#define INIT_CHANNEL_OUT 0 +#define INIT_CHANNEL_IN 1 +#define INIT_CHANNEL_OUT 0 /* InterfaceClass */ -#define CLASS_RESERVE 0x00 -#define CLASS_AUDIO 0x01 -#define CLASS_COMMUNICATION_IF 0x02 -#define CLASS_HID 0x03 -#define CLASS_PHYSICAL 0x05 -#define CLASS_IMAGE 0x06 -#define CLASS_PRINTER 0x07 -#define CLASS_MASS_STORAGE 0x08 -#define CLASS_HUB 0x09 -#define CLASS_COMMUNICATION_DATA_IF 0x0a -#define CLASS_SMART_CARD 0x0b -#define CLASS_CONTENT_SECURITY 0x0d -#define CLASS_VIDEO 0x0e -#define CLASS_PERSONAL_HEALTHCARE 0x0f -#define CLASS_DIAGNOSTIC 0xdc -#define CLASS_WIRELESS_CONTROLLER 0xe0 -#define CLASS_ELSE_DEVICE 0xef -#define CLASS_DEPENDENCE 0xfe -#define CLASS_VENDOR_DEPENDENCE 0xff +#define CLASS_RESERVE 0x00 +#define CLASS_AUDIO 0x01 +#define CLASS_COMMUNICATION_IF 0x02 +#define CLASS_HID 0x03 +#define CLASS_PHYSICAL 0x05 +#define CLASS_IMAGE 0x06 +#define CLASS_PRINTER 0x07 +#define CLASS_MASS_STORAGE 0x08 +#define CLASS_HUB 0x09 +#define CLASS_COMMUNICATION_DATA_IF 0x0a +#define CLASS_SMART_CARD 0x0b +#define CLASS_CONTENT_SECURITY 0x0d +#define CLASS_VIDEO 0x0e +#define CLASS_PERSONAL_HEALTHCARE 0x0f +#define CLASS_DIAGNOSTIC 0xdc +#define CLASS_WIRELESS_CONTROLLER 0xe0 +#define CLASS_ELSE_DEVICE 0xef +#define CLASS_DEPENDENCE 0xfe +#define CLASS_VENDOR_DEPENDENCE 0xff /* usb version */ -#define USB_v1_0 0x100 -#define USB_v1_1 0x110 -#define USB_v2_0 0x200 -#define USB_v3_0 0x300 +#define USB_v1_0 0x100 +#define USB_v1_1 0x110 +#define USB_v2_0 0x200 +#define USB_v3_0 0x300 -#define STREAM_ID_NONE 0x0 -#define STREAM_ID_PROXY 0x1 -#define STREAM_ID_STUB 0x2 +#define STREAM_ID_NONE 0x0 +#define STREAM_ID_PROXY 0x1 +#define STREAM_ID_STUB 0x2 -#define CANCEL_REQUEST 0x00000100 -#define REGISTER_REQUEST_CALLBACK 0x00000101 -#define IO_CONTROL 0x00000102 -#define INTERNAL_IO_CONTROL 0x00000103 -#define QUERY_DEVICE_TEXT 0x00000104 -#define TRANSFER_IN_REQUEST 0x00000105 -#define TRANSFER_OUT_REQUEST 0x00000106 -#define RETRACT_DEVICE 0x00000107 +#define CANCEL_REQUEST 0x00000100 +#define REGISTER_REQUEST_CALLBACK 0x00000101 +#define IO_CONTROL 0x00000102 +#define INTERNAL_IO_CONTROL 0x00000103 +#define QUERY_DEVICE_TEXT 0x00000104 +#define TRANSFER_IN_REQUEST 0x00000105 +#define TRANSFER_OUT_REQUEST 0x00000106 +#define RETRACT_DEVICE 0x00000107 - -#define IOCONTROL_COMPLETION 0x00000100 -#define URB_COMPLETION 0x00000101 -#define URB_COMPLETION_NO_DATA 0x00000102 +#define IOCONTROL_COMPLETION 0x00000100 +#define URB_COMPLETION 0x00000101 +#define URB_COMPLETION_NO_DATA 0x00000102 /* The USB device is to be stopped from being redirected because the * device is blocked by the server's policy. */ -#define UsbRetractReason_BlockedByPolicy 0x00000001 +#define UsbRetractReason_BlockedByPolicy 0x00000001 enum device_text_type { @@ -131,202 +133,209 @@ enum device_descriptor_table B_NUM_CONFIGURATIONS = 17 }; -#define PIPE_CANCEL 0 -#define PIPE_RESET 1 +#define PIPE_CANCEL 0 +#define PIPE_RESET 1 -#define IOCTL_INTERNAL_USB_SUBMIT_URB 0x00220003 -#define IOCTL_INTERNAL_USB_RESET_PORT 0x00220007 -#define IOCTL_INTERNAL_USB_GET_PORT_STATUS 0x00220013 -#define IOCTL_INTERNAL_USB_CYCLE_PORT 0x0022001F -#define IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION 0x00220027 +#define IOCTL_INTERNAL_USB_SUBMIT_URB 0x00220003 +#define IOCTL_INTERNAL_USB_RESET_PORT 0x00220007 +#define IOCTL_INTERNAL_USB_GET_PORT_STATUS 0x00220013 +#define IOCTL_INTERNAL_USB_CYCLE_PORT 0x0022001F +#define IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION 0x00220027 - - -#define URB_FUNCTION_SELECT_CONFIGURATION 0x0000 -#define URB_FUNCTION_SELECT_INTERFACE 0x0001 -#define URB_FUNCTION_ABORT_PIPE 0x0002 -#define URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL 0x0003 -#define URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL 0x0004 -#define URB_FUNCTION_GET_FRAME_LENGTH 0x0005 -#define URB_FUNCTION_SET_FRAME_LENGTH 0x0006 -#define URB_FUNCTION_GET_CURRENT_FRAME_NUMBER 0x0007 -#define URB_FUNCTION_CONTROL_TRANSFER 0x0008 -#define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER 0x0009 -#define URB_FUNCTION_ISOCH_TRANSFER 0x000A -#define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE 0x000B -#define URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE 0x000C -#define URB_FUNCTION_SET_FEATURE_TO_DEVICE 0x000D -#define URB_FUNCTION_SET_FEATURE_TO_INTERFACE 0x000E -#define URB_FUNCTION_SET_FEATURE_TO_ENDPOINT 0x000F -#define URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE 0x0010 -#define URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE 0x0011 -#define URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT 0x0012 -#define URB_FUNCTION_GET_STATUS_FROM_DEVICE 0x0013 -#define URB_FUNCTION_GET_STATUS_FROM_INTERFACE 0x0014 -#define URB_FUNCTION_GET_STATUS_FROM_ENDPOINT 0x0015 -#define URB_FUNCTION_RESERVED_0X0016 0x0016 -#define URB_FUNCTION_VENDOR_DEVICE 0x0017 -#define URB_FUNCTION_VENDOR_INTERFACE 0x0018 -#define URB_FUNCTION_VENDOR_ENDPOINT 0x0019 -#define URB_FUNCTION_CLASS_DEVICE 0x001A -#define URB_FUNCTION_CLASS_INTERFACE 0x001B -#define URB_FUNCTION_CLASS_ENDPOINT 0x001C -#define URB_FUNCTION_RESERVE_0X001D 0x001D -#define URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL 0x001E -#define URB_FUNCTION_CLASS_OTHER 0x001F -#define URB_FUNCTION_VENDOR_OTHER 0x0020 -#define URB_FUNCTION_GET_STATUS_FROM_OTHER 0x0021 -#define URB_FUNCTION_CLEAR_FEATURE_TO_OTHER 0x0022 -#define URB_FUNCTION_SET_FEATURE_TO_OTHER 0x0023 -#define URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT 0x0024 -#define URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT 0x0025 -#define URB_FUNCTION_GET_CONFIGURATION 0x0026 -#define URB_FUNCTION_GET_INTERFACE 0x0027 -#define URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE 0x0028 -#define URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE 0x0029 -#define URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR 0x002A -#define URB_FUNCTION_RESERVE_0X002B 0x002B -#define URB_FUNCTION_RESERVE_0X002C 0x002C -#define URB_FUNCTION_RESERVE_0X002D 0x002D -#define URB_FUNCTION_RESERVE_0X002E 0x002E -#define URB_FUNCTION_RESERVE_0X002F 0x002F +#define URB_FUNCTION_SELECT_CONFIGURATION 0x0000 +#define URB_FUNCTION_SELECT_INTERFACE 0x0001 +#define URB_FUNCTION_ABORT_PIPE 0x0002 +#define URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL 0x0003 +#define URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL 0x0004 +#define URB_FUNCTION_GET_FRAME_LENGTH 0x0005 +#define URB_FUNCTION_SET_FRAME_LENGTH 0x0006 +#define URB_FUNCTION_GET_CURRENT_FRAME_NUMBER 0x0007 +#define URB_FUNCTION_CONTROL_TRANSFER 0x0008 +#define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER 0x0009 +#define URB_FUNCTION_ISOCH_TRANSFER 0x000A +#define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE 0x000B +#define URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE 0x000C +#define URB_FUNCTION_SET_FEATURE_TO_DEVICE 0x000D +#define URB_FUNCTION_SET_FEATURE_TO_INTERFACE 0x000E +#define URB_FUNCTION_SET_FEATURE_TO_ENDPOINT 0x000F +#define URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE 0x0010 +#define URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE 0x0011 +#define URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT 0x0012 +#define URB_FUNCTION_GET_STATUS_FROM_DEVICE 0x0013 +#define URB_FUNCTION_GET_STATUS_FROM_INTERFACE 0x0014 +#define URB_FUNCTION_GET_STATUS_FROM_ENDPOINT 0x0015 +#define URB_FUNCTION_RESERVED_0X0016 0x0016 +#define URB_FUNCTION_VENDOR_DEVICE 0x0017 +#define URB_FUNCTION_VENDOR_INTERFACE 0x0018 +#define URB_FUNCTION_VENDOR_ENDPOINT 0x0019 +#define URB_FUNCTION_CLASS_DEVICE 0x001A +#define URB_FUNCTION_CLASS_INTERFACE 0x001B +#define URB_FUNCTION_CLASS_ENDPOINT 0x001C +#define URB_FUNCTION_RESERVE_0X001D 0x001D +#define URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL 0x001E +#define URB_FUNCTION_CLASS_OTHER 0x001F +#define URB_FUNCTION_VENDOR_OTHER 0x0020 +#define URB_FUNCTION_GET_STATUS_FROM_OTHER 0x0021 +#define URB_FUNCTION_CLEAR_FEATURE_TO_OTHER 0x0022 +#define URB_FUNCTION_SET_FEATURE_TO_OTHER 0x0023 +#define URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT 0x0024 +#define URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT 0x0025 +#define URB_FUNCTION_GET_CONFIGURATION 0x0026 +#define URB_FUNCTION_GET_INTERFACE 0x0027 +#define URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE 0x0028 +#define URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE 0x0029 +#define URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR 0x002A +#define URB_FUNCTION_RESERVE_0X002B 0x002B +#define URB_FUNCTION_RESERVE_0X002C 0x002C +#define URB_FUNCTION_RESERVE_0X002D 0x002D +#define URB_FUNCTION_RESERVE_0X002E 0x002E +#define URB_FUNCTION_RESERVE_0X002F 0x002F // USB 2.0 calls start at 0x0030 -#define URB_FUNCTION_SYNC_RESET_PIPE 0x0030 -#define URB_FUNCTION_SYNC_CLEAR_STALL 0x0031 -#define URB_FUNCTION_CONTROL_TRANSFER_EX 0x0032 +#define URB_FUNCTION_SYNC_RESET_PIPE 0x0030 +#define URB_FUNCTION_SYNC_CLEAR_STALL 0x0031 +#define URB_FUNCTION_CONTROL_TRANSFER_EX 0x0032 -#define USBD_STATUS_SUCCESS 0x0 -#define USBD_STATUS_PENDING 0x40000000 -#define USBD_STATUS_CANCELED 0xC0010000 +#define USBD_STATUS_SUCCESS 0x0 +#define USBD_STATUS_PENDING 0x40000000 +#define USBD_STATUS_CANCELED 0xC0010000 -#define USBD_STATUS_CRC 0xC0000001 -#define USBD_STATUS_BTSTUFF 0xC0000002 -#define USBD_STATUS_DATA_TOGGLE_MISMATCH 0xC0000003 -#define USBD_STATUS_STALL_PID 0xC0000004 -#define USBD_STATUS_DEV_NOT_RESPONDING 0xC0000005 -#define USBD_STATUS_PID_CHECK_FAILURE 0xC0000006 -#define USBD_STATUS_UNEXPECTED_PID 0xC0000007 -#define USBD_STATUS_DATA_OVERRUN 0xC0000008 -#define USBD_STATUS_DATA_UNDERRUN 0xC0000009 -#define USBD_STATUS_RESERVED1 0xC000000A -#define USBD_STATUS_RESERVED2 0xC000000B -#define USBD_STATUS_BUFFER_OVERRUN 0xC000000C -#define USBD_STATUS_BUFFER_UNDERRUN 0xC000000D +#define USBD_STATUS_CRC 0xC0000001 +#define USBD_STATUS_BTSTUFF 0xC0000002 +#define USBD_STATUS_DATA_TOGGLE_MISMATCH 0xC0000003 +#define USBD_STATUS_STALL_PID 0xC0000004 +#define USBD_STATUS_DEV_NOT_RESPONDING 0xC0000005 +#define USBD_STATUS_PID_CHECK_FAILURE 0xC0000006 +#define USBD_STATUS_UNEXPECTED_PID 0xC0000007 +#define USBD_STATUS_DATA_OVERRUN 0xC0000008 +#define USBD_STATUS_DATA_UNDERRUN 0xC0000009 +#define USBD_STATUS_RESERVED1 0xC000000A +#define USBD_STATUS_RESERVED2 0xC000000B +#define USBD_STATUS_BUFFER_OVERRUN 0xC000000C +#define USBD_STATUS_BUFFER_UNDERRUN 0xC000000D /* unknown */ -#define USBD_STATUS_NO_DATA 0xC000000E +#define USBD_STATUS_NO_DATA 0xC000000E -#define USBD_STATUS_NOT_ACCESSED 0xC000000F -#define USBD_STATUS_FIFO 0xC0000010 -#define USBD_STATUS_XACT_ERROR 0xC0000011 -#define USBD_STATUS_BABBLE_DETECTED 0xC0000012 -#define USBD_STATUS_DATA_BUFFER_ERROR 0xC0000013 +#define USBD_STATUS_NOT_ACCESSED 0xC000000F +#define USBD_STATUS_FIFO 0xC0000010 +#define USBD_STATUS_XACT_ERROR 0xC0000011 +#define USBD_STATUS_BABBLE_DETECTED 0xC0000012 +#define USBD_STATUS_DATA_BUFFER_ERROR 0xC0000013 -#define USBD_STATUS_NOT_SUPPORTED 0xC0000E00 -#define USBD_STATUS_BUFFER_TOO_SMALL 0xC0003000 -#define USBD_STATUS_TIMEOUT 0xC0006000 -#define USBD_STATUS_DEVICE_GONE 0xC0007000 +#define USBD_STATUS_NOT_SUPPORTED 0xC0000E00 +#define USBD_STATUS_BUFFER_TOO_SMALL 0xC0003000 +#define USBD_STATUS_TIMEOUT 0xC0006000 +#define USBD_STATUS_DEVICE_GONE 0xC0007000 -#define USBD_STATUS_NO_MEMORY 0x80000100 -#define USBD_STATUS_INVALID_URB_FUNCTION 0x80000200 -#define USBD_STATUS_INVALID_PARAMETER 0x80000300 -#define USBD_STATUS_REQUEST_FAILED 0x80000500 -#define USBD_STATUS_INVALID_PIPE_HANDLE 0x80000600 -#define USBD_STATUS_ERROR_SHORT_TRANSFER 0x80000900 +#define USBD_STATUS_NO_MEMORY 0x80000100 +#define USBD_STATUS_INVALID_URB_FUNCTION 0x80000200 +#define USBD_STATUS_INVALID_PARAMETER 0x80000300 +#define USBD_STATUS_REQUEST_FAILED 0x80000500 +#define USBD_STATUS_INVALID_PIPE_HANDLE 0x80000600 +#define USBD_STATUS_ERROR_SHORT_TRANSFER 0x80000900 // Values for URB TransferFlags Field // /* - Set if data moves device->host + Set if data moves device->host */ -#define USBD_TRANSFER_DIRECTION 0x00000001 +#define USBD_TRANSFER_DIRECTION 0x00000001 /* - This bit if not set indicates that a short packet, and hence, - a short transfer is an error condition + This bit if not set indicates that a short packet, and hence, + a short transfer is an error condition */ -#define USBD_SHORT_TRANSFER_OK 0x00000002 +#define USBD_SHORT_TRANSFER_OK 0x00000002 /* - Subit the iso transfer on the next frame + Subit the iso transfer on the next frame */ -#define USBD_START_ISO_TRANSFER_ASAP 0x00000004 -#define USBD_DEFAULT_PIPE_TRANSFER 0x00000008 +#define USBD_START_ISO_TRANSFER_ASAP 0x00000004 +#define USBD_DEFAULT_PIPE_TRANSFER 0x00000008 +#define USBD_TRANSFER_DIRECTION_FLAG(flags) ((flags)&USBD_TRANSFER_DIRECTION) -#define USBD_TRANSFER_DIRECTION_FLAG(flags) ((flags) & USBD_TRANSFER_DIRECTION) - -#define USBD_TRANSFER_DIRECTION_OUT 0 -#define USBD_TRANSFER_DIRECTION_IN 1 +#define USBD_TRANSFER_DIRECTION_OUT 0 +#define USBD_TRANSFER_DIRECTION_IN 1 #define VALID_TRANSFER_FLAGS_MASK USBD_SHORT_TRANSFER_OK | \ USBD_TRANSFER_DIRECTION | \ USBD_START_ISO_TRANSFER_ASAP | \ USBD_DEFAULT_PIPE_TRANSFER) -#define ENDPOINT_HALT 0x00 -#define DEVICE_REMOTE_WAKEUP 0x01 +#define ENDPOINT_HALT 0x00 +#define DEVICE_REMOTE_WAKEUP 0x01 /* transfer type */ -#define CONTROL_TRANSFER 0x00 -#define ISOCHRONOUS_TRANSFER 0x01 -#define BULK_TRANSFER 0x02 -#define INTERRUPT_TRANSFER 0x03 +#define CONTROL_TRANSFER 0x00 +#define ISOCHRONOUS_TRANSFER 0x01 +#define BULK_TRANSFER 0x02 +#define INTERRUPT_TRANSFER 0x03 -#define ClearHubFeature (0x2000 | LIBUSB_REQUEST_CLEAR_FEATURE) -#define ClearPortFeature (0x2300 | LIBUSB_REQUEST_CLEAR_FEATURE) -#define GetHubDescriptor (0xa000 | LIBUSB_REQUEST_GET_DESCRIPTOR) -#define GetHubStatus (0xa000 | LIBUSB_REQUEST_GET_STATUS) -#define GetPortStatus (0xa300 | LIBUSB_REQUEST_GET_STATUS) -#define SetHubFeature (0x2000 | LIBUSB_REQUEST_SET_FEATURE) -#define SetPortFeature (0x2300 | LIBUSB_REQUEST_SET_FEATURE) +#define ClearHubFeature (0x2000 | LIBUSB_REQUEST_CLEAR_FEATURE) +#define ClearPortFeature (0x2300 | LIBUSB_REQUEST_CLEAR_FEATURE) +#define GetHubDescriptor (0xa000 | LIBUSB_REQUEST_GET_DESCRIPTOR) +#define GetHubStatus (0xa000 | LIBUSB_REQUEST_GET_STATUS) +#define GetPortStatus (0xa300 | LIBUSB_REQUEST_GET_STATUS) +#define SetHubFeature (0x2000 | LIBUSB_REQUEST_SET_FEATURE) +#define SetPortFeature (0x2300 | LIBUSB_REQUEST_SET_FEATURE) -#define USBD_PF_CHANGE_MAX_PACKET 0x00000001 -#define USBD_PF_SHORT_PACKET_OPT 0x00000002 -#define USBD_PF_ENABLE_RT_THREAD_ACCESS 0x00000004 -#define USBD_PF_MAP_ADD_TRANSFERS 0x00000008 +#define USBD_PF_CHANGE_MAX_PACKET 0x00000001 +#define USBD_PF_SHORT_PACKET_OPT 0x00000002 +#define USBD_PF_ENABLE_RT_THREAD_ACCESS 0x00000004 +#define USBD_PF_MAP_ADD_TRANSFERS 0x00000008 /* feature request */ -#define URB_SET_FEATURE 0x00 -#define URB_CLEAR_FEATURE 0x01 +#define URB_SET_FEATURE 0x00 +#define URB_CLEAR_FEATURE 0x01 -#define USBD_PF_CHANGE_MAX_PACKET 0x00000001 -#define USBD_PF_SHORT_PACKET_OPT 0x00000002 -#define USBD_PF_ENABLE_RT_THREAD_ACCESS 0x00000004 -#define USBD_PF_MAP_ADD_TRANSFERS 0x00000008 +#define USBD_PF_CHANGE_MAX_PACKET 0x00000001 +#define USBD_PF_SHORT_PACKET_OPT 0x00000002 +#define USBD_PF_ENABLE_RT_THREAD_ACCESS 0x00000004 +#define USBD_PF_MAP_ADD_TRANSFERS 0x00000008 -#define URB_CONTROL_TRANSFER_EXTERNAL 0x1 -#define URB_CONTROL_TRANSFER_NONEXTERNAL 0x0 +#define URB_CONTROL_TRANSFER_EXTERNAL 0x1 +#define URB_CONTROL_TRANSFER_NONEXTERNAL 0x0 -#define USBFS_URB_SHORT_NOT_OK 0x01 -#define USBFS_URB_ISO_ASAP 0x02 -#define USBFS_URB_BULK_CONTINUATION 0x04 -#define USBFS_URB_QUEUE_BULK 0x10 +#define USBFS_URB_SHORT_NOT_OK 0x01 +#define USBFS_URB_ISO_ASAP 0x02 +#define USBFS_URB_BULK_CONTINUATION 0x04 +#define USBFS_URB_QUEUE_BULK 0x10 -#define URBDRC_DEVICE_INITIALIZED 0x01 -#define URBDRC_DEVICE_NOT_FOUND 0x02 -#define URBDRC_DEVICE_SIGNAL_END 0x04 -#define URBDRC_DEVICE_CHANNEL_CLOSED 0x08 -#define URBDRC_DEVICE_ALREADY_SEND 0x10 -#define URBDRC_DEVICE_DETACH_KERNEL 0x20 +#define URBDRC_DEVICE_INITIALIZED 0x01 +#define URBDRC_DEVICE_NOT_FOUND 0x02 +#define URBDRC_DEVICE_SIGNAL_END 0x04 +#define URBDRC_DEVICE_CHANNEL_CLOSED 0x08 +#define URBDRC_DEVICE_ALREADY_SEND 0x10 +#define URBDRC_DEVICE_DETACH_KERNEL 0x20 -#define UDEVMAN_FLAG_ADD_BY_VID_PID 0x01 -#define UDEVMAN_FLAG_ADD_BY_ADDR 0x02 -#define UDEVMAN_FLAG_ADD_BY_AUTO 0x04 -#define UDEVMAN_FLAG_DEBUG 0x08 +#define UDEVMAN_FLAG_ADD_BY_VID_PID 0x01 +#define UDEVMAN_FLAG_ADD_BY_ADDR 0x02 +#define UDEVMAN_FLAG_ADD_BY_AUTO 0x04 +#define UDEVMAN_FLAG_DEBUG 0x08 -#define MAX_URB_REQUSET_NUM 0x80 +#define MAX_URB_REQUSET_NUM 0x80 #define LOG_LEVEL 1 -#define dummy_wait_obj(void) do{ sleep(5); } while(0) -#define dummy_wait_s_obj(_s) do{ sleep(_s); } while(0) +#define dummy_wait_obj(void) \ + do \ + { \ + sleep(5); \ + } while (0) +#define dummy_wait_s_obj(_s) \ + do \ + { \ + sleep(_s); \ + } while (0) -#define ISOCH_FIFO 1 -#define WAIT_COMPLETE_SLEEP 10000 /* for cpu high loading */ +#define ISOCH_FIFO 1 +#define WAIT_COMPLETE_SLEEP 10000 /* for cpu high loading */ -#define urbdrc_get_mstime(_t) do { \ - struct timeval _tp; \ - gettimeofday(&_tp, 0); \ +#define urbdrc_get_mstime(_t) \ + do \ + { \ + struct timeval _tp; \ + gettimeofday(&_tp, 0); \ _t = (_tp.tv_sec * 1000) + (_tp.tv_usec / 1000); \ } while (0) diff --git a/channels/video/client/video_main.c b/channels/video/client/video_main.c old mode 100755 new mode 100644 index 896ebfb49..3b820b026 --- a/channels/video/client/video_main.c +++ b/channels/video/client/video_main.c @@ -42,7 +42,6 @@ #include #include - #define TAG CHANNELS_TAG("video") #include "video_main.h" @@ -76,36 +75,31 @@ struct _VIDEO_PLUGIN VIDEO_LISTENER_CALLBACK* control_callback; VIDEO_LISTENER_CALLBACK* data_callback; - VideoClientContext *context; + VideoClientContext* context; }; typedef struct _VIDEO_PLUGIN VIDEO_PLUGIN; - #define XF_VIDEO_UNLIMITED_RATE 31 -static const BYTE MFVideoFormat_H264[] = {'H', '2', '6', '4', - 0x00, 0x00, - 0x10, 0x00, - 0x80, 0x00, - 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}; +static const BYTE MFVideoFormat_H264[] = { 'H', '2', '6', '4', 0x00, 0x00, 0x10, 0x00, + 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }; typedef struct _PresentationContext PresentationContext; typedef struct _VideoFrame VideoFrame; - /** @brief private data for the channel */ struct _VideoClientContextPriv { - VideoClientContext *video; - GeometryClientContext *geometry; - wQueue *frames; + VideoClientContext* video; + GeometryClientContext* geometry; + wQueue* frames; CRITICAL_SECTION framesLock; - wBufferPool *surfacePool; + wBufferPool* surfacePool; UINT32 publishedFrames; UINT32 droppedFrames; UINT32 lastSentRate; UINT64 nextFeedbackTime; - PresentationContext *currentPresentation; + PresentationContext* currentPresentation; }; /** @brief */ @@ -113,50 +107,49 @@ struct _VideoFrame { UINT64 publishTime; UINT64 hnsDuration; - MAPPED_GEOMETRY *geometry; + MAPPED_GEOMETRY* geometry; UINT32 w, h; - BYTE *surfaceData; - PresentationContext *presentation; + BYTE* surfaceData; + PresentationContext* presentation; }; /** @brief */ struct _PresentationContext { - VideoClientContext *video; + VideoClientContext* video; BYTE PresentationId; UINT32 SourceWidth, SourceHeight; UINT32 ScaledWidth, ScaledHeight; - MAPPED_GEOMETRY *geometry; + MAPPED_GEOMETRY* geometry; UINT64 startTimeStamp; UINT64 publishOffset; - H264_CONTEXT *h264; - YUV_CONTEXT *yuv; - wStream *currentSample; + H264_CONTEXT* h264; + YUV_CONTEXT* yuv; + wStream* currentSample; UINT64 lastPublishTime, nextPublishTime; volatile LONG refCounter; - BYTE *surfaceData; - VideoSurface *surface; + BYTE* surfaceData; + VideoSurface* surface; }; - -static const char *video_command_name(BYTE cmd) +static const char* video_command_name(BYTE cmd) { - switch(cmd) + switch (cmd) { - case TSMM_START_PRESENTATION: - return "start"; - case TSMM_STOP_PRESENTATION: - return "stop"; - default: - return ""; + case TSMM_START_PRESENTATION: + return "start"; + case TSMM_STOP_PRESENTATION: + return "stop"; + default: + return ""; } } -static BOOL yuv_to_rgb(PresentationContext *presentation, BYTE *dest) +static BOOL yuv_to_rgb(PresentationContext* presentation, BYTE* dest) { const BYTE* pYUVPoint[3]; - H264_CONTEXT *h264 = presentation->h264; + H264_CONTEXT* h264 = presentation->h264; BYTE** ppYUVData; ppYUVData = h264->pYUVData; @@ -165,7 +158,8 @@ static BOOL yuv_to_rgb(PresentationContext *presentation, BYTE *dest) pYUVPoint[1] = ppYUVData[1]; pYUVPoint[2] = ppYUVData[2]; - if (!yuv_context_decode(presentation->yuv, pYUVPoint, h264->iStride, PIXEL_FORMAT_BGRX32, dest, h264->width * 4)) + if (!yuv_context_decode(presentation->yuv, pYUVPoint, h264->iStride, PIXEL_FORMAT_BGRX32, dest, + h264->width * 4)) { WLog_ERR(TAG, "error in yuv_to_rgb conversion"); return FALSE; @@ -174,15 +168,15 @@ static BOOL yuv_to_rgb(PresentationContext *presentation, BYTE *dest) return TRUE; } - -static void video_client_context_set_geometry(VideoClientContext *video, GeometryClientContext *geometry) +static void video_client_context_set_geometry(VideoClientContext* video, + GeometryClientContext* geometry) { video->priv->geometry = geometry; } -VideoClientContextPriv *VideoClientContextPriv_new(VideoClientContext *video) +VideoClientContextPriv* VideoClientContextPriv_new(VideoClientContext* video) { - VideoClientContextPriv *ret = calloc(1, sizeof(*ret)); + VideoClientContextPriv* ret = calloc(1, sizeof(*ret)); if (!ret) return NULL; @@ -208,9 +202,9 @@ VideoClientContextPriv *VideoClientContextPriv_new(VideoClientContext *video) ret->video = video; - /* don't set to unlimited so that we have the chance to send a feedback in - * the first second (for servers that want feedback directly) - */ + /* don't set to unlimited so that we have the chance to send a feedback in + * the first second (for servers that want feedback directly) + */ ret->lastSentRate = 30; return ret; @@ -223,12 +217,11 @@ error_frames: return NULL; } - -static PresentationContext *PresentationContext_new(VideoClientContext *video, BYTE PresentationId, - UINT32 x, UINT32 y, UINT32 width, UINT32 height) +static PresentationContext* PresentationContext_new(VideoClientContext* video, BYTE PresentationId, + UINT32 x, UINT32 y, UINT32 width, UINT32 height) { - VideoClientContextPriv *priv = video->priv; - PresentationContext *ret = calloc(1, sizeof(*ret)); + VideoClientContextPriv* priv = video->priv; + PresentationContext* ret = calloc(1, sizeof(*ret)); if (!ret) return NULL; @@ -288,11 +281,10 @@ error_h264: return NULL; } - -static void PresentationContext_unref(PresentationContext *presentation) +static void PresentationContext_unref(PresentationContext* presentation) { - VideoClientContextPriv *priv; - MAPPED_GEOMETRY *geometry; + VideoClientContextPriv* priv; + MAPPED_GEOMETRY* geometry; if (!presentation) return; @@ -319,10 +311,9 @@ static void PresentationContext_unref(PresentationContext *presentation) free(presentation); } - -static void VideoFrame_free(VideoFrame **pframe) +static void VideoFrame_free(VideoFrame** pframe) { - VideoFrame *frame = *pframe; + VideoFrame* frame = *pframe; mappedGeometryUnref(frame->geometry); BufferPool_Return(frame->presentation->video->priv->surfacePool, frame->surfaceData); @@ -331,13 +322,12 @@ static void VideoFrame_free(VideoFrame **pframe) *pframe = NULL; } - -static void VideoClientContextPriv_free(VideoClientContextPriv *priv) +static void VideoClientContextPriv_free(VideoClientContextPriv* priv) { EnterCriticalSection(&priv->framesLock); while (Queue_Count(priv->frames)) { - VideoFrame *frame = Queue_Dequeue(priv->frames); + VideoFrame* frame = Queue_Dequeue(priv->frames); if (frame) VideoFrame_free(&frame); } @@ -354,12 +344,12 @@ static void VideoClientContextPriv_free(VideoClientContextPriv *priv) free(priv); } - -static UINT video_control_send_presentation_response(VideoClientContext *context, TSMM_PRESENTATION_RESPONSE *resp) +static UINT video_control_send_presentation_response(VideoClientContext* context, + TSMM_PRESENTATION_RESPONSE* resp) { BYTE buf[12]; - wStream *s; - VIDEO_PLUGIN* video = (VIDEO_PLUGIN *)context->handle; + wStream* s; + VIDEO_PLUGIN* video = (VIDEO_PLUGIN*)context->handle; IWTSVirtualChannel* channel; UINT ret; @@ -367,7 +357,7 @@ static UINT video_control_send_presentation_response(VideoClientContext *context if (!s) return CHANNEL_RC_NO_MEMORY; - Stream_Write_UINT32(s, 12); /* cbSize */ + Stream_Write_UINT32(s, 12); /* cbSize */ Stream_Write_UINT32(s, TSMM_PACKET_TYPE_PRESENTATION_RESPONSE); /* PacketType */ Stream_Write_UINT8(s, resp->PresentationId); Stream_Zero(s, 3); @@ -380,19 +370,19 @@ static UINT video_control_send_presentation_response(VideoClientContext *context return ret; } -static BOOL video_onMappedGeometryUpdate(MAPPED_GEOMETRY *geometry) +static BOOL video_onMappedGeometryUpdate(MAPPED_GEOMETRY* geometry) { - PresentationContext *presentation = (PresentationContext *)geometry->custom; - RDP_RECT *r = &geometry->geometry.boundingRect; + PresentationContext* presentation = (PresentationContext*)geometry->custom; + RDP_RECT* r = &geometry->geometry.boundingRect; WLog_DBG(TAG, "geometry updated topGeom=(%d,%d-%dx%d) geom=(%d,%d-%dx%d) rects=(%d,%d-%dx%d)", - geometry->topLevelLeft, geometry->topLevelTop, - geometry->topLevelRight - geometry->topLevelLeft, geometry->topLevelBottom - geometry->topLevelTop, + geometry->topLevelLeft, geometry->topLevelTop, + geometry->topLevelRight - geometry->topLevelLeft, + geometry->topLevelBottom - geometry->topLevelTop, - geometry->left, geometry->top, - geometry->right - geometry->left, geometry->bottom - geometry->top, + geometry->left, geometry->top, geometry->right - geometry->left, + geometry->bottom - geometry->top, - r->x, r->y, r->width, r->height - ); + r->x, r->y, r->width, r->height); presentation->surface->x = geometry->topLevelLeft + geometry->left; presentation->surface->y = geometry->topLevelTop + geometry->top; @@ -400,26 +390,26 @@ static BOOL video_onMappedGeometryUpdate(MAPPED_GEOMETRY *geometry) return TRUE; } -static BOOL video_onMappedGeometryClear(MAPPED_GEOMETRY *geometry) +static BOOL video_onMappedGeometryClear(MAPPED_GEOMETRY* geometry) { - PresentationContext *presentation = (PresentationContext *)geometry->custom; + PresentationContext* presentation = (PresentationContext*)geometry->custom; mappedGeometryUnref(presentation->geometry); presentation->geometry = NULL; return TRUE; } -static UINT video_PresentationRequest(VideoClientContext* video, TSMM_PRESENTATION_REQUEST *req) +static UINT video_PresentationRequest(VideoClientContext* video, TSMM_PRESENTATION_REQUEST* req) { - VideoClientContextPriv *priv = video->priv; - PresentationContext *presentation; + VideoClientContextPriv* priv = video->priv; + PresentationContext* presentation; UINT ret = CHANNEL_RC_OK; presentation = priv->currentPresentation; if (req->Command == TSMM_START_PRESENTATION) { - MAPPED_GEOMETRY *geom; + MAPPED_GEOMETRY* geom; TSMM_PRESENTATION_RESPONSE resp; if (memcmp(req->VideoSubtypeId, MFVideoFormat_H264, 16) != 0) @@ -432,7 +422,8 @@ static UINT video_PresentationRequest(VideoClientContext* video, TSMM_PRESENTATI { if (presentation->PresentationId == req->PresentationId) { - WLog_ERR(TAG, "ignoring start request for existing presentation %d", req->PresentationId); + WLog_ERR(TAG, "ignoring start request for existing presentation %d", + req->PresentationId); return CHANNEL_RC_OK; } @@ -450,15 +441,14 @@ static UINT video_PresentationRequest(VideoClientContext* video, TSMM_PRESENTATI geom = HashTable_GetItemValue(priv->geometry->geometries, &(req->GeometryMappingId)); if (!geom) { - WLog_ERR(TAG, "geometry mapping 0x%"PRIx64" not registered", req->GeometryMappingId); + WLog_ERR(TAG, "geometry mapping 0x%" PRIx64 " not registered", req->GeometryMappingId); return CHANNEL_RC_OK; } WLog_DBG(TAG, "creating presentation 0x%x", req->PresentationId); - presentation = PresentationContext_new(video, req->PresentationId, - geom->topLevelLeft + geom->left, - geom->topLevelTop + geom->top, - req->SourceWidth, req->SourceHeight); + presentation = PresentationContext_new( + video, req->PresentationId, geom->topLevelLeft + geom->left, + geom->topLevelTop + geom->top, req->SourceWidth, req->SourceHeight); if (!presentation) { WLog_ERR(TAG, "unable to create presentation video"); @@ -501,8 +491,7 @@ static UINT video_PresentationRequest(VideoClientContext* video, TSMM_PRESENTATI return ret; } - -static UINT video_read_tsmm_presentation_req(VideoClientContext *context, wStream *s) +static UINT video_read_tsmm_presentation_req(VideoClientContext* context, wStream* s) { TSMM_PRESENTATION_REQUEST req; @@ -538,38 +527,38 @@ static UINT video_read_tsmm_presentation_req(VideoClientContext *context, wStrea req.pExtraData = Stream_Pointer(s); - WLog_DBG(TAG, "presentationReq: id:%"PRIu8" version:%"PRIu8" command:%s srcWidth/srcHeight=%"PRIu32"x%"PRIu32 - " scaled Width/Height=%"PRIu32"x%"PRIu32" timestamp=%"PRIu64" mappingId=%"PRIx64"", - req.PresentationId, req.Version, video_command_name(req.Command), - req.SourceWidth, req.SourceHeight, req.ScaledWidth, req.ScaledHeight, - req.hnsTimestampOffset, req.GeometryMappingId); + WLog_DBG(TAG, + "presentationReq: id:%" PRIu8 " version:%" PRIu8 + " command:%s srcWidth/srcHeight=%" PRIu32 "x%" PRIu32 " scaled Width/Height=%" PRIu32 + "x%" PRIu32 " timestamp=%" PRIu64 " mappingId=%" PRIx64 "", + req.PresentationId, req.Version, video_command_name(req.Command), req.SourceWidth, + req.SourceHeight, req.ScaledWidth, req.ScaledHeight, req.hnsTimestampOffset, + req.GeometryMappingId); return video_PresentationRequest(context, &req); } - - /** * Function description * * @return 0 on success, otherwise a Win32 error code */ -static UINT video_control_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream *s) +static UINT video_control_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream* s) { - VIDEO_CHANNEL_CALLBACK* callback = (VIDEO_CHANNEL_CALLBACK*) pChannelCallback; + VIDEO_CHANNEL_CALLBACK* callback = (VIDEO_CHANNEL_CALLBACK*)pChannelCallback; VIDEO_PLUGIN* video; - VideoClientContext *context; + VideoClientContext* context; UINT ret = CHANNEL_RC_OK; UINT32 cbSize, packetType; - video = (VIDEO_PLUGIN*) callback->plugin; - context = (VideoClientContext *)video->wtsPlugin.pInterface; + video = (VIDEO_PLUGIN*)callback->plugin; + context = (VideoClientContext*)video->wtsPlugin.pInterface; if (Stream_GetRemainingLength(s) < 4) return ERROR_INVALID_DATA; Stream_Read_UINT32(s, cbSize); - if (cbSize < 8 || Stream_GetRemainingLength(s) < (cbSize-4)) + if (cbSize < 8 || Stream_GetRemainingLength(s) < (cbSize - 4)) { WLog_ERR(TAG, "invalid cbSize"); return ERROR_INVALID_DATA; @@ -578,23 +567,24 @@ static UINT video_control_on_data_received(IWTSVirtualChannelCallback* pChannelC Stream_Read_UINT32(s, packetType); switch (packetType) { - case TSMM_PACKET_TYPE_PRESENTATION_REQUEST: - ret = video_read_tsmm_presentation_req(context, s); - break; - default: - WLog_ERR(TAG, "not expecting packet type %"PRIu32"", packetType); - ret = ERROR_UNSUPPORTED_TYPE; - break; + case TSMM_PACKET_TYPE_PRESENTATION_REQUEST: + ret = video_read_tsmm_presentation_req(context, s); + break; + default: + WLog_ERR(TAG, "not expecting packet type %" PRIu32 "", packetType); + ret = ERROR_UNSUPPORTED_TYPE; + break; } return ret; } -static UINT video_control_send_client_notification(VideoClientContext *context, TSMM_CLIENT_NOTIFICATION *notif) +static UINT video_control_send_client_notification(VideoClientContext* context, + TSMM_CLIENT_NOTIFICATION* notif) { BYTE buf[100]; - wStream *s; - VIDEO_PLUGIN* video = (VIDEO_PLUGIN *)context->handle; + wStream* s; + VIDEO_PLUGIN* video = (VIDEO_PLUGIN*)context->handle; IWTSVirtualChannel* channel; UINT ret; UINT32 cbSize; @@ -604,7 +594,7 @@ static UINT video_control_send_client_notification(VideoClientContext *context, return CHANNEL_RC_NO_MEMORY; cbSize = 16; - Stream_Seek_UINT32(s); /* cbSize */ + Stream_Seek_UINT32(s); /* cbSize */ Stream_Write_UINT32(s, TSMM_PACKET_TYPE_CLIENT_NOTIFICATION); /* PacketType */ Stream_Write_UINT8(s, notif->PresentationId); Stream_Write_UINT8(s, notif->NotificationType); @@ -636,16 +626,16 @@ static UINT video_control_send_client_notification(VideoClientContext *context, return ret; } -static void video_timer(VideoClientContext *video, UINT64 now) +static void video_timer(VideoClientContext* video, UINT64 now) { - PresentationContext *presentation; - VideoClientContextPriv *priv = video->priv; + PresentationContext* presentation; + VideoClientContextPriv* priv = video->priv; VideoFrame *peekFrame, *frame = NULL; EnterCriticalSection(&priv->framesLock); do { - peekFrame = (VideoFrame *)Queue_Peek(priv->frames); + peekFrame = (VideoFrame*)Queue_Peek(priv->frames); if (!peekFrame) break; @@ -654,14 +644,13 @@ static void video_timer(VideoClientContext *video, UINT64 now) if (frame) { - WLog_DBG(TAG, "dropping frame @%"PRIu64, frame->publishTime); + WLog_DBG(TAG, "dropping frame @%" PRIu64, frame->publishTime); priv->droppedFrames++; VideoFrame_free(&frame); } frame = peekFrame; Queue_Dequeue(priv->frames); - } - while (1); + } while (1); LeaveCriticalSection(&priv->framesLock); if (!frame) @@ -709,7 +698,7 @@ treat_feedback: /** * we treat all frames ok, so either ask the server to send more, * or stay unlimited - */ + */ if (priv->lastSentRate == XF_VIDEO_UNLIMITED_RATE) computedRate = XF_VIDEO_UNLIMITED_RATE; /* stay unlimited */ else @@ -739,15 +728,15 @@ treat_feedback: video_control_send_client_notification(video, ¬if); priv->lastSentRate = computedRate; - WLog_DBG(TAG, "server notified with rate %d published=%d dropped=%d", priv->lastSentRate, - priv->publishedFrames, priv->droppedFrames); + WLog_DBG(TAG, "server notified with rate %d published=%d dropped=%d", + priv->lastSentRate, priv->publishedFrames, priv->droppedFrames); } PresentationContext_unref(priv->currentPresentation); } WLog_DBG(TAG, "currentRate=%d published=%d dropped=%d", priv->lastSentRate, - priv->publishedFrames, priv->droppedFrames); + priv->publishedFrames, priv->droppedFrames); priv->droppedFrames = 0; priv->publishedFrames = 0; @@ -755,11 +744,10 @@ treat_feedback: } } - -static UINT video_VideoData(VideoClientContext* context, TSMM_VIDEO_DATA *data) +static UINT video_VideoData(VideoClientContext* context, TSMM_VIDEO_DATA* data) { - VideoClientContextPriv *priv = context->priv; - PresentationContext *presentation; + VideoClientContextPriv* priv = context->priv; + PresentationContext* presentation; int status; presentation = priv->currentPresentation; @@ -771,8 +759,8 @@ static UINT video_VideoData(VideoClientContext* context, TSMM_VIDEO_DATA *data) if (presentation->PresentationId != data->PresentationId) { - WLog_ERR(TAG, "current presentation id=%d doesn't match data id=%d", presentation->PresentationId, - data->PresentationId); + WLog_ERR(TAG, "current presentation id=%d doesn't match data id=%d", + presentation->PresentationId, data->PresentationId); return CHANNEL_RC_OK; } @@ -786,15 +774,15 @@ static UINT video_VideoData(VideoClientContext* context, TSMM_VIDEO_DATA *data) if (data->CurrentPacketIndex == data->PacketsInSample) { - H264_CONTEXT *h264 = presentation->h264; + H264_CONTEXT* h264 = presentation->h264; UINT64 startTime = GetTickCount64(), timeAfterH264; - MAPPED_GEOMETRY *geom = presentation->geometry; + MAPPED_GEOMETRY* geom = presentation->geometry; Stream_SealLength(presentation->currentSample); Stream_SetPosition(presentation->currentSample, 0); status = h264->subsystem->Decompress(h264, Stream_Pointer(presentation->currentSample), - Stream_Length(presentation->currentSample)); + Stream_Length(presentation->currentSample)); if (status == 0) return CHANNEL_RC_OK; @@ -823,7 +811,7 @@ static UINT video_VideoData(VideoClientContext* context, TSMM_VIDEO_DATA *data) EnterCriticalSection(&priv->framesLock); while (Queue_Count(priv->frames) > 0) { - VideoFrame *frame = Queue_Dequeue(priv->frames); + VideoFrame* frame = Queue_Dequeue(priv->frames); if (frame) { priv->droppedFrames++; @@ -839,7 +827,7 @@ static UINT video_VideoData(VideoClientContext* context, TSMM_VIDEO_DATA *data) else { BOOL enqueueResult; - VideoFrame *frame = calloc(1, sizeof(*frame)); + VideoFrame* frame = calloc(1, sizeof(*frame)); if (!frame) { WLog_ERR(TAG, "unable to create frame"); @@ -884,31 +872,29 @@ static UINT video_VideoData(VideoClientContext* context, TSMM_VIDEO_DATA *data) return CHANNEL_RC_NO_MEMORY; } - WLog_DBG(TAG, "scheduling frame in %"PRIu32" ms", (frame->publishTime-startTime)); + WLog_DBG(TAG, "scheduling frame in %" PRIu32 " ms", (frame->publishTime - startTime)); } } return CHANNEL_RC_OK; } - - -static UINT video_data_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream *s) +static UINT video_data_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream* s) { - VIDEO_CHANNEL_CALLBACK* callback = (VIDEO_CHANNEL_CALLBACK*) pChannelCallback; + VIDEO_CHANNEL_CALLBACK* callback = (VIDEO_CHANNEL_CALLBACK*)pChannelCallback; VIDEO_PLUGIN* video; - VideoClientContext *context; + VideoClientContext* context; UINT32 cbSize, packetType; TSMM_VIDEO_DATA data; - video = (VIDEO_PLUGIN*) callback->plugin; - context = (VideoClientContext *)video->wtsPlugin.pInterface; + video = (VIDEO_PLUGIN*)callback->plugin; + context = (VideoClientContext*)video->wtsPlugin.pInterface; if (Stream_GetRemainingLength(s) < 4) return ERROR_INVALID_DATA; Stream_Read_UINT32(s, cbSize); - if (cbSize < 8 || Stream_GetRemainingLength(s) < (cbSize-4)) + if (cbSize < 8 || Stream_GetRemainingLength(s) < (cbSize - 4)) { WLog_ERR(TAG, "invalid cbSize"); return ERROR_INVALID_DATA; @@ -939,17 +925,17 @@ static UINT video_data_on_data_received(IWTSVirtualChannelCallback* pChannelCall Stream_Read_UINT32(s, data.cbSample); data.pSample = Stream_Pointer(s); -/* - WLog_DBG(TAG, "videoData: id:%"PRIu8" version:%"PRIu8" flags:0x%"PRIx8" timestamp=%"PRIu64" duration=%"PRIu64 - " curPacketIndex:%"PRIu16" packetInSample:%"PRIu16" sampleNumber:%"PRIu32" cbSample:%"PRIu32"", - data.PresentationId, data.Version, data.Flags, data.hnsTimestamp, data.hnsDuration, - data.CurrentPacketIndex, data.PacketsInSample, data.SampleNumber, data.cbSample); -*/ + /* + WLog_DBG(TAG, "videoData: id:%"PRIu8" version:%"PRIu8" flags:0x%"PRIx8" timestamp=%"PRIu64" + duration=%"PRIu64 " curPacketIndex:%"PRIu16" packetInSample:%"PRIu16" sampleNumber:%"PRIu32" + cbSample:%"PRIu32"", data.PresentationId, data.Version, data.Flags, data.hnsTimestamp, + data.hnsDuration, data.CurrentPacketIndex, data.PacketsInSample, data.SampleNumber, + data.cbSample); + */ return video_VideoData(context, &data); } - /** * Function description * @@ -973,16 +959,17 @@ static UINT video_data_on_close(IWTSVirtualChannelCallback* pChannelCallback) * @return 0 on success, otherwise a Win32 error code */ static UINT video_control_on_new_channel_connection(IWTSListenerCallback* listenerCallback, - IWTSVirtualChannel* channel, BYTE* Data, BOOL* pbAccept, - IWTSVirtualChannelCallback** ppCallback) + IWTSVirtualChannel* channel, BYTE* Data, + BOOL* pbAccept, + IWTSVirtualChannelCallback** ppCallback) { VIDEO_CHANNEL_CALLBACK* callback; - VIDEO_LISTENER_CALLBACK* listener_callback = (VIDEO_LISTENER_CALLBACK*) listenerCallback; + VIDEO_LISTENER_CALLBACK* listener_callback = (VIDEO_LISTENER_CALLBACK*)listenerCallback; WINPR_UNUSED(Data); WINPR_UNUSED(pbAccept); - callback = (VIDEO_CHANNEL_CALLBACK*) calloc(1, sizeof(VIDEO_CHANNEL_CALLBACK)); + callback = (VIDEO_CHANNEL_CALLBACK*)calloc(1, sizeof(VIDEO_CHANNEL_CALLBACK)); if (!callback) { WLog_ERR(TAG, "calloc failed!"); @@ -996,22 +983,23 @@ static UINT video_control_on_new_channel_connection(IWTSListenerCallback* listen callback->channel = channel; listener_callback->channel_callback = callback; - *ppCallback = (IWTSVirtualChannelCallback*) callback; + *ppCallback = (IWTSVirtualChannelCallback*)callback; return CHANNEL_RC_OK; } static UINT video_data_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, - IWTSVirtualChannel* pChannel, BYTE* Data, BOOL* pbAccept, - IWTSVirtualChannelCallback** ppCallback) + IWTSVirtualChannel* pChannel, BYTE* Data, + BOOL* pbAccept, + IWTSVirtualChannelCallback** ppCallback) { VIDEO_CHANNEL_CALLBACK* callback; - VIDEO_LISTENER_CALLBACK* listener_callback = (VIDEO_LISTENER_CALLBACK*) pListenerCallback; + VIDEO_LISTENER_CALLBACK* listener_callback = (VIDEO_LISTENER_CALLBACK*)pListenerCallback; WINPR_UNUSED(Data); WINPR_UNUSED(pbAccept); - callback = (VIDEO_CHANNEL_CALLBACK*) calloc(1, sizeof(VIDEO_CHANNEL_CALLBACK)); + callback = (VIDEO_CHANNEL_CALLBACK*)calloc(1, sizeof(VIDEO_CHANNEL_CALLBACK)); if (!callback) { WLog_ERR(TAG, "calloc failed!"); @@ -1025,12 +1013,11 @@ static UINT video_data_on_new_channel_connection(IWTSListenerCallback* pListener callback->channel = pChannel; listener_callback->channel_callback = callback; - *ppCallback = (IWTSVirtualChannelCallback*) callback; + *ppCallback = (IWTSVirtualChannelCallback*)callback; return CHANNEL_RC_OK; } - /** * Function description * @@ -1039,10 +1026,11 @@ static UINT video_data_on_new_channel_connection(IWTSListenerCallback* pListener static UINT video_plugin_initialize(IWTSPlugin* plugin, IWTSVirtualChannelManager* channelMgr) { UINT status; - VIDEO_PLUGIN* video = (VIDEO_PLUGIN *)plugin; - VIDEO_LISTENER_CALLBACK *callback; + VIDEO_PLUGIN* video = (VIDEO_PLUGIN*)plugin; + VIDEO_LISTENER_CALLBACK* callback; - video->control_callback = callback = (VIDEO_LISTENER_CALLBACK*) calloc(1, sizeof(VIDEO_LISTENER_CALLBACK)); + video->control_callback = callback = + (VIDEO_LISTENER_CALLBACK*)calloc(1, sizeof(VIDEO_LISTENER_CALLBACK)); if (!callback) { WLog_ERR(TAG, "calloc for control callback failed!"); @@ -1054,14 +1042,14 @@ static UINT video_plugin_initialize(IWTSPlugin* plugin, IWTSVirtualChannelManage callback->channel_mgr = channelMgr; status = channelMgr->CreateListener(channelMgr, VIDEO_CONTROL_DVC_CHANNEL_NAME, 0, - (IWTSListenerCallback*)callback, &(video->controlListener)); + (IWTSListenerCallback*)callback, &(video->controlListener)); if (status != CHANNEL_RC_OK) return status; video->controlListener->pInterface = video->wtsPlugin.pInterface; - - video->data_callback = callback = (VIDEO_LISTENER_CALLBACK*) calloc(1, sizeof(VIDEO_LISTENER_CALLBACK)); + video->data_callback = callback = + (VIDEO_LISTENER_CALLBACK*)calloc(1, sizeof(VIDEO_LISTENER_CALLBACK)); if (!callback) { WLog_ERR(TAG, "calloc for data callback failed!"); @@ -1073,7 +1061,7 @@ static UINT video_plugin_initialize(IWTSPlugin* plugin, IWTSVirtualChannelManage callback->channel_mgr = channelMgr; status = channelMgr->CreateListener(channelMgr, VIDEO_DATA_DVC_CHANNEL_NAME, 0, - (IWTSListenerCallback*)callback, &(video->dataListener)); + (IWTSListenerCallback*)callback, &(video->dataListener)); if (status == CHANNEL_RC_OK) video->dataListener->pInterface = video->wtsPlugin.pInterface; @@ -1088,7 +1076,7 @@ static UINT video_plugin_initialize(IWTSPlugin* plugin, IWTSVirtualChannelManage */ static UINT video_plugin_terminated(IWTSPlugin* pPlugin) { - VIDEO_PLUGIN* video = (VIDEO_PLUGIN*) pPlugin; + VIDEO_PLUGIN* video = (VIDEO_PLUGIN*)pPlugin; if (video->context) VideoClientContextPriv_free(video->context->priv); @@ -1104,11 +1092,10 @@ static UINT video_plugin_terminated(IWTSPlugin* pPlugin) * Channel Client Interface */ - #ifdef BUILTIN_CHANNELS -#define DVCPluginEntry video_DVCPluginEntry +#define DVCPluginEntry video_DVCPluginEntry #else -#define DVCPluginEntry FREERDP_API DVCPluginEntry +#define DVCPluginEntry FREERDP_API DVCPluginEntry #endif /** @@ -1121,12 +1108,12 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) UINT error = CHANNEL_RC_OK; VIDEO_PLUGIN* videoPlugin; VideoClientContext* videoContext; - VideoClientContextPriv *priv; + VideoClientContextPriv* priv; - videoPlugin = (VIDEO_PLUGIN*) pEntryPoints->GetPlugin(pEntryPoints, "video"); + videoPlugin = (VIDEO_PLUGIN*)pEntryPoints->GetPlugin(pEntryPoints, "video"); if (!videoPlugin) { - videoPlugin = (VIDEO_PLUGIN*) calloc(1, sizeof(VIDEO_PLUGIN)); + videoPlugin = (VIDEO_PLUGIN*)calloc(1, sizeof(VIDEO_PLUGIN)); if (!videoPlugin) { WLog_ERR(TAG, "calloc failed!"); @@ -1138,7 +1125,7 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) videoPlugin->wtsPlugin.Disconnected = NULL; videoPlugin->wtsPlugin.Terminated = video_plugin_terminated; - videoContext = (VideoClientContext*) calloc(1, sizeof(VideoClientContext)); + videoContext = (VideoClientContext*)calloc(1, sizeof(VideoClientContext)); if (!videoContext) { WLog_ERR(TAG, "calloc failed!"); @@ -1155,15 +1142,15 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) return CHANNEL_RC_NO_MEMORY; } - videoContext->handle = (void*) videoPlugin; + videoContext->handle = (void*)videoPlugin; videoContext->priv = priv; videoContext->timer = video_timer; videoContext->setGeometry = video_client_context_set_geometry; - videoPlugin->wtsPlugin.pInterface = (void*) videoContext; + videoPlugin->wtsPlugin.pInterface = (void*)videoContext; videoPlugin->context = videoContext; - error = pEntryPoints->RegisterPlugin(pEntryPoints, "video", (IWTSPlugin*) videoPlugin); + error = pEntryPoints->RegisterPlugin(pEntryPoints, "video", (IWTSPlugin*)videoPlugin); } else { diff --git a/channels/video/client/video_main.h b/channels/video/client/video_main.h index f5e5ac910..18145660a 100644 --- a/channels/video/client/video_main.h +++ b/channels/video/client/video_main.h @@ -30,6 +30,4 @@ #include - #endif /* FREERDP_CHANNEL_GEOMETRY_CLIENT_MAIN_H */ - diff --git a/client/Android/Studio/aFreeRDP/src/main/java/com/freerdp/afreerdp/application/GlobalApp.java b/client/Android/Studio/aFreeRDP/src/main/java/com/freerdp/afreerdp/application/GlobalApp.java index c0b36f020..7d4495948 100644 --- a/client/Android/Studio/aFreeRDP/src/main/java/com/freerdp/afreerdp/application/GlobalApp.java +++ b/client/Android/Studio/aFreeRDP/src/main/java/com/freerdp/afreerdp/application/GlobalApp.java @@ -1,6 +1,5 @@ package com.freerdp.afreerdp.application; - -public class GlobalApp extends com.freerdp.freerdpcore.application.GlobalApp { - +public class GlobalApp extends com.freerdp.freerdpcore.application.GlobalApp +{ } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/application/GlobalApp.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/application/GlobalApp.java index ce6c4d871..e71a86e6e 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/application/GlobalApp.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/application/GlobalApp.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.application; @@ -32,159 +33,179 @@ import java.util.Map; import java.util.Timer; import java.util.TimerTask; -public class GlobalApp extends Application implements LibFreeRDP.EventListener { - // event notification defines - public static final String EVENT_TYPE = "EVENT_TYPE"; - public static final String EVENT_PARAM = "EVENT_PARAM"; - public static final String EVENT_STATUS = "EVENT_STATUS"; - public static final String EVENT_ERROR = "EVENT_ERROR"; - public static final String ACTION_EVENT_FREERDP = "com.freerdp.freerdp.event.freerdp"; - public static final int FREERDP_EVENT_CONNECTION_SUCCESS = 1; - public static final int FREERDP_EVENT_CONNECTION_FAILURE = 2; - public static final int FREERDP_EVENT_DISCONNECTED = 3; - private static final String TAG = "GlobalApp"; - public static boolean ConnectedTo3G = false; - private static Map sessionMap; - private static BookmarkDB bookmarkDB; - private static ManualBookmarkGateway manualBookmarkGateway; +public class GlobalApp extends Application implements LibFreeRDP.EventListener +{ + // event notification defines + public static final String EVENT_TYPE = "EVENT_TYPE"; + public static final String EVENT_PARAM = "EVENT_PARAM"; + public static final String EVENT_STATUS = "EVENT_STATUS"; + public static final String EVENT_ERROR = "EVENT_ERROR"; + public static final String ACTION_EVENT_FREERDP = "com.freerdp.freerdp.event.freerdp"; + public static final int FREERDP_EVENT_CONNECTION_SUCCESS = 1; + public static final int FREERDP_EVENT_CONNECTION_FAILURE = 2; + public static final int FREERDP_EVENT_DISCONNECTED = 3; + private static final String TAG = "GlobalApp"; + public static boolean ConnectedTo3G = false; + private static Map sessionMap; + private static BookmarkDB bookmarkDB; + private static ManualBookmarkGateway manualBookmarkGateway; - private static HistoryDB historyDB; - private static QuickConnectHistoryGateway quickConnectHistoryGateway; + private static HistoryDB historyDB; + private static QuickConnectHistoryGateway quickConnectHistoryGateway; - // timer for disconnecting sessions after the screen was turned off - private static Timer disconnectTimer = null; + // timer for disconnecting sessions after the screen was turned off + private static Timer disconnectTimer = null; - public static ManualBookmarkGateway getManualBookmarkGateway() { - return manualBookmarkGateway; - } + public static ManualBookmarkGateway getManualBookmarkGateway() + { + return manualBookmarkGateway; + } - public static QuickConnectHistoryGateway getQuickConnectHistoryGateway() { - return quickConnectHistoryGateway; - } + public static QuickConnectHistoryGateway getQuickConnectHistoryGateway() + { + return quickConnectHistoryGateway; + } - // Disconnect handling for Screen on/off events - public void startDisconnectTimer() { - final int timeoutMinutes = ApplicationSettingsActivity.getDisconnectTimeout(this); - if (timeoutMinutes > 0) { - // start disconnect timeout... - disconnectTimer = new Timer(); - disconnectTimer.schedule(new DisconnectTask(), timeoutMinutes * 60 * 1000); - } - } + // Disconnect handling for Screen on/off events + public void startDisconnectTimer() + { + final int timeoutMinutes = ApplicationSettingsActivity.getDisconnectTimeout(this); + if (timeoutMinutes > 0) + { + // start disconnect timeout... + disconnectTimer = new Timer(); + disconnectTimer.schedule(new DisconnectTask(), timeoutMinutes * 60 * 1000); + } + } - static public void cancelDisconnectTimer() { - // cancel any pending timer events - if (disconnectTimer != null) { - disconnectTimer.cancel(); - disconnectTimer.purge(); - disconnectTimer = null; - } - } + static public void cancelDisconnectTimer() + { + // cancel any pending timer events + if (disconnectTimer != null) + { + disconnectTimer.cancel(); + disconnectTimer.purge(); + disconnectTimer = null; + } + } - // RDP session handling - static public SessionState createSession(BookmarkBase bookmark, Context context) { - SessionState session = new SessionState(LibFreeRDP.newInstance(context), bookmark); - sessionMap.put(Long.valueOf(session.getInstance()), session); - return session; - } + // RDP session handling + static public SessionState createSession(BookmarkBase bookmark, Context context) + { + SessionState session = new SessionState(LibFreeRDP.newInstance(context), bookmark); + sessionMap.put(Long.valueOf(session.getInstance()), session); + return session; + } - static public SessionState createSession(Uri openUri, Context context) { - SessionState session = new SessionState(LibFreeRDP.newInstance(context), openUri); - sessionMap.put(Long.valueOf(session.getInstance()), session); - return session; - } + static public SessionState createSession(Uri openUri, Context context) + { + SessionState session = new SessionState(LibFreeRDP.newInstance(context), openUri); + sessionMap.put(Long.valueOf(session.getInstance()), session); + return session; + } - static public SessionState getSession(long instance) { - return sessionMap.get(instance); - } + static public SessionState getSession(long instance) + { + return sessionMap.get(instance); + } - static public Collection getSessions() { - // return a copy of the session items - return new ArrayList(sessionMap.values()); - } + static public Collection getSessions() + { + // return a copy of the session items + return new ArrayList(sessionMap.values()); + } - static public void freeSession(long instance) { - if (GlobalApp.sessionMap.containsKey(instance)) { - GlobalApp.sessionMap.remove(instance); - LibFreeRDP.freeInstance(instance); - } - } + static public void freeSession(long instance) + { + if (GlobalApp.sessionMap.containsKey(instance)) + { + GlobalApp.sessionMap.remove(instance); + LibFreeRDP.freeInstance(instance); + } + } - @Override - public void onCreate() { - super.onCreate(); + @Override public void onCreate() + { + super.onCreate(); - /* Initialize preferences. */ - ApplicationSettingsActivity.get(this); + /* Initialize preferences. */ + ApplicationSettingsActivity.get(this); - sessionMap = Collections.synchronizedMap(new HashMap()); + sessionMap = Collections.synchronizedMap(new HashMap()); - LibFreeRDP.setEventListener(this); + LibFreeRDP.setEventListener(this); - bookmarkDB = new BookmarkDB(this); + bookmarkDB = new BookmarkDB(this); - manualBookmarkGateway = new ManualBookmarkGateway(bookmarkDB); + manualBookmarkGateway = new ManualBookmarkGateway(bookmarkDB); - historyDB = new HistoryDB(this); - quickConnectHistoryGateway = new QuickConnectHistoryGateway(historyDB); + historyDB = new HistoryDB(this); + quickConnectHistoryGateway = new QuickConnectHistoryGateway(historyDB); - ConnectedTo3G = NetworkStateReceiver.isConnectedTo3G(this); + ConnectedTo3G = NetworkStateReceiver.isConnectedTo3G(this); - // init screen receiver here (this can't be declared in AndroidManifest - refer to: - // http://thinkandroid.wordpress.com/2010/01/24/handling-screen-off-and-screen-on-intents/ - IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON); - filter.addAction(Intent.ACTION_SCREEN_OFF); - registerReceiver(new ScreenReceiver(), filter); - } + // init screen receiver here (this can't be declared in AndroidManifest - refer to: + // http://thinkandroid.wordpress.com/2010/01/24/handling-screen-off-and-screen-on-intents/ + IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON); + filter.addAction(Intent.ACTION_SCREEN_OFF); + registerReceiver(new ScreenReceiver(), filter); + } - // helper to send FreeRDP notifications - private void sendRDPNotification(int type, long param) { - // send broadcast - Intent intent = new Intent(ACTION_EVENT_FREERDP); - intent.putExtra(EVENT_TYPE, type); - intent.putExtra(EVENT_PARAM, param); - sendBroadcast(intent); - } + // helper to send FreeRDP notifications + private void sendRDPNotification(int type, long param) + { + // send broadcast + Intent intent = new Intent(ACTION_EVENT_FREERDP); + intent.putExtra(EVENT_TYPE, type); + intent.putExtra(EVENT_PARAM, param); + sendBroadcast(intent); + } - @Override - public void OnPreConnect(long instance) { - Log.v(TAG, "OnPreConnect"); - } + @Override public void OnPreConnect(long instance) + { + Log.v(TAG, "OnPreConnect"); + } - // ////////////////////////////////////////////////////////////////////// - // Implementation of LibFreeRDP.EventListener - public void OnConnectionSuccess(long instance) { - Log.v(TAG, "OnConnectionSuccess"); - sendRDPNotification(FREERDP_EVENT_CONNECTION_SUCCESS, instance); - } + // ////////////////////////////////////////////////////////////////////// + // Implementation of LibFreeRDP.EventListener + public void OnConnectionSuccess(long instance) + { + Log.v(TAG, "OnConnectionSuccess"); + sendRDPNotification(FREERDP_EVENT_CONNECTION_SUCCESS, instance); + } - public void OnConnectionFailure(long instance) { - Log.v(TAG, "OnConnectionFailure"); + public void OnConnectionFailure(long instance) + { + Log.v(TAG, "OnConnectionFailure"); - // send notification to session activity - sendRDPNotification(FREERDP_EVENT_CONNECTION_FAILURE, instance); - } + // send notification to session activity + sendRDPNotification(FREERDP_EVENT_CONNECTION_FAILURE, instance); + } - public void OnDisconnecting(long instance) { - Log.v(TAG, "OnDisconnecting"); - } + public void OnDisconnecting(long instance) + { + Log.v(TAG, "OnDisconnecting"); + } - public void OnDisconnected(long instance) { - Log.v(TAG, "OnDisconnected"); - sendRDPNotification(FREERDP_EVENT_DISCONNECTED, instance); - } + public void OnDisconnected(long instance) + { + Log.v(TAG, "OnDisconnected"); + sendRDPNotification(FREERDP_EVENT_DISCONNECTED, instance); + } - // TimerTask for disconnecting sessions after screen was turned off - private static class DisconnectTask extends TimerTask { - @Override - public void run() { - Log.v("DisconnectTask", "Doing action"); + // TimerTask for disconnecting sessions after screen was turned off + private static class DisconnectTask extends TimerTask + { + @Override public void run() + { + Log.v("DisconnectTask", "Doing action"); - // disconnect any running rdp session - Collection sessions = GlobalApp.getSessions(); - for (SessionState session : sessions) { - LibFreeRDP.disconnect(session.getInstance()); - } - } - } + // disconnect any running rdp session + Collection sessions = GlobalApp.getSessions(); + for (SessionState session : sessions) + { + LibFreeRDP.disconnect(session.getInstance()); + } + } + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/application/NetworkStateReceiver.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/application/NetworkStateReceiver.java index 38a98a684..ea3d663a7 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/application/NetworkStateReceiver.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/application/NetworkStateReceiver.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.application; @@ -16,34 +17,42 @@ import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.util.Log; -public class NetworkStateReceiver extends BroadcastReceiver { +public class NetworkStateReceiver extends BroadcastReceiver +{ - public static boolean isConnectedTo3G(Context context) { - ConnectivityManager connectivity = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); - NetworkInfo info = connectivity.getActiveNetworkInfo(); + public static boolean isConnectedTo3G(Context context) + { + ConnectivityManager connectivity = + (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE); + NetworkInfo info = connectivity.getActiveNetworkInfo(); - // no connection or background data disabled - if (info == null || !info.isConnected()) - return false; + // no connection or background data disabled + if (info == null || !info.isConnected()) + return false; - return (info.getType() != ConnectivityManager.TYPE_WIFI && info.getType() != ConnectivityManager.TYPE_WIMAX); - } + return (info.getType() != ConnectivityManager.TYPE_WIFI && + info.getType() != ConnectivityManager.TYPE_WIMAX); + } - @Override - public void onReceive(Context context, Intent intent) { + @Override public void onReceive(Context context, Intent intent) + { - // check if we are connected via 3g or wlan - if (intent.getExtras() != null) { - NetworkInfo info = (NetworkInfo) intent.getExtras().get(ConnectivityManager.EXTRA_NETWORK_INFO); + // check if we are connected via 3g or wlan + if (intent.getExtras() != null) + { + NetworkInfo info = + (NetworkInfo)intent.getExtras().get(ConnectivityManager.EXTRA_NETWORK_INFO); - // are we connected at all? - if (info != null && info.isConnected()) { - // see if we are connected through 3G or WiFi - Log.d("app", "Connected via type " + info.getTypeName()); - GlobalApp.ConnectedTo3G = (info.getType() != ConnectivityManager.TYPE_WIFI && info.getType() != ConnectivityManager.TYPE_WIMAX); - } + // are we connected at all? + if (info != null && info.isConnected()) + { + // see if we are connected through 3G or WiFi + Log.d("app", "Connected via type " + info.getTypeName()); + GlobalApp.ConnectedTo3G = (info.getType() != ConnectivityManager.TYPE_WIFI && + info.getType() != ConnectivityManager.TYPE_WIMAX); + } - Log.v("NetworkState", info.toString()); - } - } + Log.v("NetworkState", info.toString()); + } + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/application/ScreenReceiver.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/application/ScreenReceiver.java index f4b36fb07..d1330caf2 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/application/ScreenReceiver.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/application/ScreenReceiver.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.application; @@ -14,16 +15,16 @@ import android.content.Context; import android.content.Intent; import android.util.Log; -public class ScreenReceiver extends BroadcastReceiver { - - @Override - public void onReceive(Context context, Intent intent) { - GlobalApp app = (GlobalApp) context.getApplicationContext(); - Log.v("ScreenReceiver", "Received action: " + intent.getAction()); - if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) - app.startDisconnectTimer(); - else if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) - app.cancelDisconnectTimer(); - } +public class ScreenReceiver extends BroadcastReceiver +{ + @Override public void onReceive(Context context, Intent intent) + { + GlobalApp app = (GlobalApp)context.getApplicationContext(); + Log.v("ScreenReceiver", "Received action: " + intent.getAction()); + if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) + app.startDisconnectTimer(); + else if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) + app.cancelDisconnectTimer(); + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/application/SessionState.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/application/SessionState.java index 75c901524..1e1431c5a 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/application/SessionState.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/application/SessionState.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.application; @@ -19,93 +20,110 @@ import android.os.Parcelable; import com.freerdp.freerdpcore.domain.BookmarkBase; import com.freerdp.freerdpcore.services.LibFreeRDP; -public class SessionState implements Parcelable { - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - public SessionState createFromParcel(Parcel in) { - return new SessionState(in); - } +public class SessionState implements Parcelable +{ + public static final Parcelable.Creator CREATOR = + new Parcelable.Creator() { + public SessionState createFromParcel(Parcel in) + { + return new SessionState(in); + } - @Override - public SessionState[] newArray(int size) { - return new SessionState[size]; - } - }; - private long instance; - private BookmarkBase bookmark; - private Uri openUri; - private BitmapDrawable surface; - private LibFreeRDP.UIEventListener uiEventListener; + @Override public SessionState[] newArray(int size) + { + return new SessionState[size]; + } + }; + private long instance; + private BookmarkBase bookmark; + private Uri openUri; + private BitmapDrawable surface; + private LibFreeRDP.UIEventListener uiEventListener; - public SessionState(Parcel parcel) { - instance = parcel.readLong(); - bookmark = parcel.readParcelable(null); - openUri = parcel.readParcelable(null); + public SessionState(Parcel parcel) + { + instance = parcel.readLong(); + bookmark = parcel.readParcelable(null); + openUri = parcel.readParcelable(null); - Bitmap bitmap = parcel.readParcelable(null); - surface = new BitmapDrawable(bitmap); - } + Bitmap bitmap = parcel.readParcelable(null); + surface = new BitmapDrawable(bitmap); + } - public SessionState(long instance, BookmarkBase bookmark) { - this.instance = instance; - this.bookmark = bookmark; - this.openUri = null; - this.uiEventListener = null; - } + public SessionState(long instance, BookmarkBase bookmark) + { + this.instance = instance; + this.bookmark = bookmark; + this.openUri = null; + this.uiEventListener = null; + } - public SessionState(long instance, Uri openUri) { - this.instance = instance; - this.bookmark = null; - this.openUri = openUri; - this.uiEventListener = null; - } + public SessionState(long instance, Uri openUri) + { + this.instance = instance; + this.bookmark = null; + this.openUri = openUri; + this.uiEventListener = null; + } - public void connect(Context context) { - if (bookmark != null) { - LibFreeRDP.setConnectionInfo(context, instance, bookmark); - } else { - LibFreeRDP.setConnectionInfo(context, instance, openUri); - } - LibFreeRDP.connect(instance); - } + public void connect(Context context) + { + if (bookmark != null) + { + LibFreeRDP.setConnectionInfo(context, instance, bookmark); + } + else + { + LibFreeRDP.setConnectionInfo(context, instance, openUri); + } + LibFreeRDP.connect(instance); + } - public long getInstance() { - return instance; - } + public long getInstance() + { + return instance; + } - public BookmarkBase getBookmark() { - return bookmark; - } + public BookmarkBase getBookmark() + { + return bookmark; + } - public Uri getOpenUri() { - return openUri; - } + public Uri getOpenUri() + { + return openUri; + } - public LibFreeRDP.UIEventListener getUIEventListener() { - return uiEventListener; - } + public LibFreeRDP.UIEventListener getUIEventListener() + { + return uiEventListener; + } - public void setUIEventListener(LibFreeRDP.UIEventListener uiEventListener) { - this.uiEventListener = uiEventListener; - } + public void setUIEventListener(LibFreeRDP.UIEventListener uiEventListener) + { + this.uiEventListener = uiEventListener; + } - public BitmapDrawable getSurface() { - return surface; - } + public BitmapDrawable getSurface() + { + return surface; + } - public void setSurface(BitmapDrawable surface) { - this.surface = surface; - } + public void setSurface(BitmapDrawable surface) + { + this.surface = surface; + } - @Override - public int describeContents() { - return 0; - } + @Override public int describeContents() + { + return 0; + } - @Override - public void writeToParcel(Parcel out, int flags) { - out.writeLong(instance); - out.writeParcelable(bookmark, flags); - out.writeParcelable(openUri, flags); - out.writeParcelable(surface.getBitmap(), flags); - } + @Override public void writeToParcel(Parcel out, int flags) + { + out.writeLong(instance); + out.writeParcelable(bookmark, flags); + out.writeParcelable(openUri, flags); + out.writeParcelable(surface.getBitmap(), flags); + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/BookmarkBase.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/BookmarkBase.java index f45cc5035..171f279e8 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/BookmarkBase.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/BookmarkBase.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.domain; @@ -17,953 +18,1046 @@ import com.freerdp.freerdpcore.application.GlobalApp; import java.util.Locale; -public class BookmarkBase implements Parcelable, Cloneable { - public static final int TYPE_INVALID = -1; - public static final int TYPE_MANUAL = 1; - public static final int TYPE_QUICKCONNECT = 2; - public static final int TYPE_PLACEHOLDER = 3; - public static final int TYPE_CUSTOM_BASE = 1000; - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - public BookmarkBase createFromParcel(Parcel in) { - return new BookmarkBase(in); - } - - @Override - public BookmarkBase[] newArray(int size) { - return new BookmarkBase[size]; - } - }; - protected int type; - private long id; - private String label; - private String username; - private String password; - private String domain; - private ScreenSettings screenSettings; - private PerformanceFlags performanceFlags; - private AdvancedSettings advancedSettings; - private DebugSettings debugSettings; - - public BookmarkBase(Parcel parcel) { - type = parcel.readInt(); - id = parcel.readLong(); - label = parcel.readString(); - username = parcel.readString(); - password = parcel.readString(); - domain = parcel.readString(); - - screenSettings = parcel.readParcelable(ScreenSettings.class - .getClassLoader()); - performanceFlags = parcel.readParcelable(PerformanceFlags.class - .getClassLoader()); - advancedSettings = parcel.readParcelable(AdvancedSettings.class - .getClassLoader()); - debugSettings = parcel.readParcelable(DebugSettings.class - .getClassLoader()); - } - - public BookmarkBase() { - init(); - } - - private void init() { - type = TYPE_INVALID; - id = -1; - label = ""; - username = ""; - password = ""; - domain = ""; - - screenSettings = new ScreenSettings(); - performanceFlags = new PerformanceFlags(); - advancedSettings = new AdvancedSettings(); - debugSettings = new DebugSettings(); - } - - @SuppressWarnings("unchecked") - public T get() { - return (T) this; - } - - public int getType() { - return type; - } - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getDomain() { - return domain; - } - - public void setDomain(String domain) { - this.domain = domain; - } - - public ScreenSettings getScreenSettings() { - return screenSettings; - } - - public void setScreenSettings(ScreenSettings screenSettings) { - this.screenSettings = screenSettings; - } - - public PerformanceFlags getPerformanceFlags() { - return performanceFlags; - } - - public void setPerformanceFlags(PerformanceFlags performanceFlags) { - this.performanceFlags = performanceFlags; - } - - public AdvancedSettings getAdvancedSettings() { - return advancedSettings; - } - - public void setAdvancedSettings(AdvancedSettings advancedSettings) { - this.advancedSettings = advancedSettings; - } - - public DebugSettings getDebugSettings() { - return debugSettings; - } - - public void setDebugSettings(DebugSettings debugSettings) { - this.debugSettings = debugSettings; - } - - public ScreenSettings getActiveScreenSettings() { - return (GlobalApp.ConnectedTo3G && advancedSettings - .getEnable3GSettings()) ? advancedSettings.getScreen3G() - : screenSettings; - } - - public PerformanceFlags getActivePerformanceFlags() { - return (GlobalApp.ConnectedTo3G && advancedSettings - .getEnable3GSettings()) ? advancedSettings.getPerformance3G() - : performanceFlags; - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel out, int flags) { - out.writeInt(type); - out.writeLong(id); - out.writeString(label); - out.writeString(username); - out.writeString(password); - out.writeString(domain); - - out.writeParcelable(screenSettings, flags); - out.writeParcelable(performanceFlags, flags); - out.writeParcelable(advancedSettings, flags); - out.writeParcelable(debugSettings, flags); - } - - // write to shared preferences - public void writeToSharedPreferences(SharedPreferences sharedPrefs) { - - Locale locale = Locale.ENGLISH; - - SharedPreferences.Editor editor = sharedPrefs.edit(); - editor.clear(); - editor.putString("bookmark.label", label); - editor.putString("bookmark.username", username); - editor.putString("bookmark.password", password); - editor.putString("bookmark.domain", domain); - - editor.putInt("bookmark.colors", screenSettings.getColors()); - editor.putString("bookmark.resolution", screenSettings - .getResolutionString().toLowerCase(locale)); - editor.putInt("bookmark.width", screenSettings.getWidth()); - editor.putInt("bookmark.height", screenSettings.getHeight()); - - editor.putBoolean("bookmark.perf_remotefx", - performanceFlags.getRemoteFX()); - editor.putBoolean("bookmark.perf_gfx", - performanceFlags.getGfx()); - editor.putBoolean("bookmark.perf_gfx_h264", - performanceFlags.getH264()); - editor.putBoolean("bookmark.perf_wallpaper", - performanceFlags.getWallpaper()); - editor.putBoolean("bookmark.perf_font_smoothing", - performanceFlags.getFontSmoothing()); - editor.putBoolean("bookmark.perf_desktop_composition", - performanceFlags.getDesktopComposition()); - editor.putBoolean("bookmark.perf_window_dragging", - performanceFlags.getFullWindowDrag()); - editor.putBoolean("bookmark.perf_menu_animation", - performanceFlags.getMenuAnimations()); - editor.putBoolean("bookmark.perf_themes", performanceFlags.getTheming()); - - editor.putBoolean("bookmark.enable_3g_settings", - advancedSettings.getEnable3GSettings()); - - editor.putInt("bookmark.colors_3g", advancedSettings.getScreen3G() - .getColors()); - editor.putString("bookmark.resolution_3g", advancedSettings - .getScreen3G().getResolutionString().toLowerCase(locale)); - editor.putInt("bookmark.width_3g", advancedSettings.getScreen3G() - .getWidth()); - editor.putInt("bookmark.height_3g", advancedSettings.getScreen3G() - .getHeight()); - - editor.putBoolean("bookmark.perf_remotefx_3g", advancedSettings - .getPerformance3G().getRemoteFX()); - editor.putBoolean("bookmark.perf_gfx_3g", advancedSettings - .getPerformance3G().getGfx()); - editor.putBoolean("bookmark.perf_gfx_h264_3g", advancedSettings - .getPerformance3G().getH264()); - editor.putBoolean("bookmark.perf_wallpaper_3g", advancedSettings - .getPerformance3G().getWallpaper()); - editor.putBoolean("bookmark.perf_font_smoothing_3g", advancedSettings - .getPerformance3G().getFontSmoothing()); - editor.putBoolean("bookmark.perf_desktop_composition_3g", - advancedSettings.getPerformance3G().getDesktopComposition()); - editor.putBoolean("bookmark.perf_window_dragging_3g", advancedSettings - .getPerformance3G().getFullWindowDrag()); - editor.putBoolean("bookmark.perf_menu_animation_3g", advancedSettings - .getPerformance3G().getMenuAnimations()); - editor.putBoolean("bookmark.perf_themes_3g", advancedSettings - .getPerformance3G().getTheming()); - - editor.putBoolean("bookmark.redirect_sdcard", - advancedSettings.getRedirectSDCard()); - editor.putInt("bookmark.redirect_sound", - advancedSettings.getRedirectSound()); - editor.putBoolean("bookmark.redirect_microphone", - advancedSettings.getRedirectMicrophone()); - editor.putInt("bookmark.security", advancedSettings.getSecurity()); - editor.putString("bookmark.remote_program", - advancedSettings.getRemoteProgram()); - editor.putString("bookmark.work_dir", advancedSettings.getWorkDir()); - editor.putBoolean("bookmark.console_mode", - advancedSettings.getConsoleMode()); - - editor.putBoolean("bookmark.async_channel", debugSettings.getAsyncChannel()); - editor.putBoolean("bookmark.async_input", debugSettings.getAsyncInput()); - editor.putBoolean("bookmark.async_update", debugSettings.getAsyncUpdate()); - editor.putString("bookmark.debug_level", - debugSettings.getDebugLevel()); - - editor.apply(); - } - - // read from shared preferences - public void readFromSharedPreferences(SharedPreferences sharedPrefs) { - label = sharedPrefs.getString("bookmark.label", ""); - username = sharedPrefs.getString("bookmark.username", ""); - password = sharedPrefs.getString("bookmark.password", ""); - domain = sharedPrefs.getString("bookmark.domain", ""); - - screenSettings.setColors(sharedPrefs.getInt("bookmark.colors", 16)); - screenSettings.setResolution( - sharedPrefs.getString("bookmark.resolution", "automatic"), - sharedPrefs.getInt("bookmark.width", 800), - sharedPrefs.getInt("bookmark.height", 600)); - - performanceFlags.setRemoteFX(sharedPrefs.getBoolean( - "bookmark.perf_remotefx", false)); - performanceFlags.setGfx(sharedPrefs.getBoolean( - "bookmark.perf_gfx", false)); - performanceFlags.setH264(sharedPrefs.getBoolean( - "bookmark.perf_gfx_h264", false)); - performanceFlags.setWallpaper(sharedPrefs.getBoolean( - "bookmark.perf_wallpaper", false)); - performanceFlags.setFontSmoothing(sharedPrefs.getBoolean( - "bookmark.perf_font_smoothing", false)); - performanceFlags.setDesktopComposition(sharedPrefs.getBoolean( - "bookmark.perf_desktop_composition", false)); - performanceFlags.setFullWindowDrag(sharedPrefs.getBoolean( - "bookmark.perf_window_dragging", false)); - performanceFlags.setMenuAnimations(sharedPrefs.getBoolean( - "bookmark.perf_menu_animation", false)); - performanceFlags.setTheming(sharedPrefs.getBoolean( - "bookmark.perf_themes", false)); - - advancedSettings.setEnable3GSettings(sharedPrefs.getBoolean( - "bookmark.enable_3g_settings", false)); - - advancedSettings.getScreen3G().setColors( - sharedPrefs.getInt("bookmark.colors_3g", 16)); - advancedSettings.getScreen3G().setResolution( - sharedPrefs.getString("bookmark.resolution_3g", "automatic"), - sharedPrefs.getInt("bookmark.width_3g", 800), - sharedPrefs.getInt("bookmark.height_3g", 600)); - - advancedSettings.getPerformance3G().setRemoteFX( - sharedPrefs.getBoolean("bookmark.perf_remotefx_3g", false)); - advancedSettings.getPerformance3G().setGfx(sharedPrefs.getBoolean( - "bookmark.perf_gfx_3g", false)); - advancedSettings.getPerformance3G().setH264(sharedPrefs.getBoolean( - "bookmark.perf_gfx_h264_3g", false)); - advancedSettings.getPerformance3G().setWallpaper( - sharedPrefs.getBoolean("bookmark.perf_wallpaper_3g", false)); - advancedSettings.getPerformance3G().setFontSmoothing( - sharedPrefs - .getBoolean("bookmark.perf_font_smoothing_3g", false)); - advancedSettings.getPerformance3G().setDesktopComposition( - sharedPrefs.getBoolean("bookmark.perf_desktop_composition_3g", - false)); - advancedSettings.getPerformance3G().setFullWindowDrag( - sharedPrefs.getBoolean("bookmark.perf_window_dragging_3g", - false)); - advancedSettings.getPerformance3G().setMenuAnimations( - sharedPrefs - .getBoolean("bookmark.perf_menu_animation_3g", false)); - advancedSettings.getPerformance3G().setTheming( - sharedPrefs.getBoolean("bookmark.perf_themes_3g", false)); - - advancedSettings.setRedirectSDCard(sharedPrefs.getBoolean("bookmark.redirect_sdcard", false)); - advancedSettings.setRedirectSound(sharedPrefs.getInt("bookmark.redirect_sound", 0)); - advancedSettings.setRedirectMicrophone(sharedPrefs.getBoolean("bookmark.redirect_microphone", false)); - advancedSettings.setSecurity(sharedPrefs.getInt("bookmark.security", 0)); - advancedSettings.setRemoteProgram(sharedPrefs.getString("bookmark.remote_program", "")); - advancedSettings.setWorkDir(sharedPrefs.getString("bookmark.work_dir", "")); - advancedSettings.setConsoleMode(sharedPrefs.getBoolean("bookmark.console_mode", false)); - - debugSettings.setAsyncChannel(sharedPrefs.getBoolean("bookmark.async_channel", true)); - debugSettings.setAsyncInput(sharedPrefs.getBoolean("bookmark.async_input", true)); - debugSettings.setAsyncUpdate(sharedPrefs.getBoolean("bookmark.async_update", true)); - debugSettings.setDebugLevel(sharedPrefs.getString("bookmark.debug_level", "INFO")); - } - - // Cloneable - public Object clone() { - try { - return super.clone(); - } catch (CloneNotSupportedException e) { - return null; - } - } - - // performance flags - public static class PerformanceFlags implements Parcelable { - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - public PerformanceFlags createFromParcel(Parcel in) { - return new PerformanceFlags(in); - } - - @Override - public PerformanceFlags[] newArray(int size) { - return new PerformanceFlags[size]; - } - }; - private boolean remotefx; - private boolean gfx; - private boolean h264; - private boolean wallpaper; - private boolean theming; - private boolean fullWindowDrag; - private boolean menuAnimations; - private boolean fontSmoothing; - private boolean desktopComposition; - - public PerformanceFlags() { - remotefx = false; - gfx = false; - h264 = false; - wallpaper = false; - theming = false; - fullWindowDrag = false; - menuAnimations = false; - fontSmoothing = false; - desktopComposition = false; - } - - public PerformanceFlags(Parcel parcel) { - remotefx = parcel.readInt() == 1; - gfx = parcel.readInt() == 1; - h264 = parcel.readInt() == 1; - wallpaper = parcel.readInt() == 1; - theming = parcel.readInt() == 1; - fullWindowDrag = (parcel.readInt() == 1); - menuAnimations = parcel.readInt() == 1; - fontSmoothing = parcel.readInt() == 1; - desktopComposition = parcel.readInt() == 1; - } - - public boolean getRemoteFX() { - return remotefx; - } - - public void setRemoteFX(boolean remotefx) { - this.remotefx = remotefx; - } - - public boolean getGfx() { - return gfx; - } - - public void setGfx(boolean gfx) { - this.gfx = gfx; - } - - public boolean getH264() { - return h264; - } - - public void setH264(boolean h264) { - this.h264 = h264; - } - - public boolean getWallpaper() { - return wallpaper; - } - - public void setWallpaper(boolean wallpaper) { - this.wallpaper = wallpaper; - } - - public boolean getTheming() { - return theming; - } - - public void setTheming(boolean theming) { - this.theming = theming; - } - - public boolean getFullWindowDrag() { - return fullWindowDrag; - } - - public void setFullWindowDrag(boolean fullWindowDrag) { - this.fullWindowDrag = fullWindowDrag; - } - - public boolean getMenuAnimations() { - return menuAnimations; - } - - public void setMenuAnimations(boolean menuAnimations) { - this.menuAnimations = menuAnimations; - } - - public boolean getFontSmoothing() { - return fontSmoothing; - } - - public void setFontSmoothing(boolean fontSmoothing) { - this.fontSmoothing = fontSmoothing; - } - - public boolean getDesktopComposition() { - return desktopComposition; - } - - public void setDesktopComposition(boolean desktopComposition) { - this.desktopComposition = desktopComposition; - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel out, int flags) { - out.writeInt(remotefx ? 1 : 0); - out.writeInt(gfx ? 1 : 0); - out.writeInt(h264 ? 1 : 0); - out.writeInt(wallpaper ? 1 : 0); - out.writeInt(theming ? 1 : 0); - out.writeInt(fullWindowDrag ? 1 : 0); - out.writeInt(menuAnimations ? 1 : 0); - out.writeInt(fontSmoothing ? 1 : 0); - out.writeInt(desktopComposition ? 1 : 0); - } - } - - // Screen Settings class - public static class ScreenSettings implements Parcelable { - public static final int FITSCREEN = -2; - public static final int AUTOMATIC = -1; - public static final int CUSTOM = 0; - public static final int PREDEFINED = 1; - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - public ScreenSettings createFromParcel(Parcel in) { - return new ScreenSettings(in); - } - - @Override - public ScreenSettings[] newArray(int size) { - return new ScreenSettings[size]; - } - }; - private int resolution; - private int colors; - private int width; - private int height; - - public ScreenSettings() { - init(); - } - - public ScreenSettings(Parcel parcel) { - resolution = parcel.readInt(); - colors = parcel.readInt(); - width = parcel.readInt(); - height = parcel.readInt(); - } - - private void validate() { - switch (colors) { - case 32: - case 24: - case 16: - case 15: - case 8: - break; - default: - colors = 32; - break; - } - - if ((width <= 0) || (width > 65536)) { - width = 1024; - } - - if ((height <= 0) || (height > 65536)) { - height = 768; - } - - switch(resolution) { - case FITSCREEN: - case AUTOMATIC: - case CUSTOM: - case PREDEFINED: - break; - default: - resolution = AUTOMATIC; - break; - } - } - - private void init() { - resolution = AUTOMATIC; - colors = 16; - width = 0; - height = 0; - } - - public void setResolution(String resolution, int width, int height) { - if (resolution.contains("x")) { - String[] dimensions = resolution.split("x"); - this.width = Integer.valueOf(dimensions[0]); - this.height = Integer.valueOf(dimensions[1]); - this.resolution = PREDEFINED; - } else if (resolution.equalsIgnoreCase("custom")) { - this.width = width; - this.height = height; - this.resolution = CUSTOM; - } else if (resolution.equalsIgnoreCase("fitscreen")) { - this.width = this.height = 0; - this.resolution = FITSCREEN; - } else { - this.width = this.height = 0; - this.resolution = AUTOMATIC; - } - } - - public int getResolution() { - return resolution; - } - - public void setResolution(int resolution) { - this.resolution = resolution; - - if (resolution == AUTOMATIC || resolution == FITSCREEN) { - width = 0; - height = 0; - } - } - - public String getResolutionString() { - if (isPredefined()) - return (width + "x" + height); - - return (isFitScreen() ? "fitscreen" : isAutomatic() ? "automatic" - : "custom"); - } - - public boolean isPredefined() { - validate(); - return (resolution == PREDEFINED); - } - - public boolean isAutomatic() { - validate(); - return (resolution == AUTOMATIC); - } - - public boolean isFitScreen() { - validate(); - return (resolution == FITSCREEN); - } - - public boolean isCustom() { - validate(); - return (resolution == CUSTOM); - } - - public int getWidth() { - validate(); - return width; - } - - public void setWidth(int width) { - this.width = width; - } - - public int getHeight() { - validate(); - return height; - } - - public void setHeight(int height) { - this.height = height; - } - - public int getColors() { - validate(); - return colors; - } - - public void setColors(int colors) { - this.colors = colors; - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel out, int flags) { - out.writeInt(resolution); - out.writeInt(colors); - out.writeInt(width); - out.writeInt(height); - } - } - - public static class DebugSettings implements Parcelable { - - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - public DebugSettings createFromParcel(Parcel in) { - return new DebugSettings(in); - } - - @Override - public DebugSettings[] newArray(int size) { - return new DebugSettings[size]; - } - }; - private String debug; - private boolean asyncChannel; - private boolean asyncTransport; - private boolean asyncInput; - private boolean asyncUpdate; - - public DebugSettings() { - init(); - } - - // Session Settings - public DebugSettings(Parcel parcel) { - asyncChannel = parcel.readInt() == 1; - asyncTransport = parcel.readInt() == 1; - asyncInput = parcel.readInt() == 1; - asyncUpdate = parcel.readInt() == 1; - debug = parcel.readString(); - } - - private void init() { - debug = "INFO"; - asyncChannel = true; - asyncTransport = false; - asyncInput = true; - asyncUpdate = true; - } - - private void validate() { - final String[] levels = { - "OFF", - "FATAL", - "ERROR", - "WARN", - "INFO", - "DEBUG", - "TRACE" - }; - - for (String level : levels) { - if (level.equalsIgnoreCase(this.debug)) { - return; - } - } - - this.debug = "INFO"; - } - - public String getDebugLevel() { - validate(); - return debug; - } - - public void setDebugLevel(String debug) { - this.debug = debug; - } - - public boolean getAsyncUpdate() { - return asyncUpdate; - } - - public void setAsyncUpdate(boolean enabled) { - asyncUpdate = enabled; - } - - public boolean getAsyncInput() { - return asyncInput; - } - - public void setAsyncInput(boolean enabled) { - asyncInput = enabled; - } - - public boolean getAsyncChannel() { - return asyncChannel; - } - - public void setAsyncChannel(boolean enabled) { - asyncChannel = enabled; - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel out, int flags) { - out.writeInt(asyncChannel ? 1 : 0); - out.writeInt(asyncTransport ? 1 : 0); - out.writeInt(asyncInput ? 1 : 0); - out.writeInt(asyncUpdate ? 1 : 0); - out.writeString(debug); - } - } - - // Session Settings - public static class AdvancedSettings implements Parcelable { - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - public AdvancedSettings createFromParcel(Parcel in) { - return new AdvancedSettings(in); - } - - @Override - public AdvancedSettings[] newArray(int size) { - return new AdvancedSettings[size]; - } - }; - private boolean enable3GSettings; - private ScreenSettings screen3G; - private PerformanceFlags performance3G; - private boolean redirectSDCard; - private int redirectSound; - private boolean redirectMicrophone; - private int security; - private boolean consoleMode; - private String remoteProgram; - private String workDir; - - public AdvancedSettings() { - init(); - } - - public AdvancedSettings(Parcel parcel) { - enable3GSettings = parcel.readInt() == 1; - screen3G = parcel.readParcelable(ScreenSettings.class - .getClassLoader()); - performance3G = parcel.readParcelable(PerformanceFlags.class - .getClassLoader()); - redirectSDCard = parcel.readInt() == 1; - redirectSound = parcel.readInt(); - redirectMicrophone = parcel.readInt() == 1; - security = parcel.readInt(); - consoleMode = parcel.readInt() == 1; - remoteProgram = parcel.readString(); - workDir = parcel.readString(); - } - - private void init() { - enable3GSettings = false; - screen3G = new ScreenSettings(); - performance3G = new PerformanceFlags(); - redirectSDCard = false; - redirectSound = 0; - redirectMicrophone = false; - security = 0; - consoleMode = false; - remoteProgram = ""; - workDir = ""; - } - - private void validate() { - switch (redirectSound) { - case 0: - case 1: - case 2: - break; - default: - redirectSound = 0; - break; - } - - switch (security) { - case 0: - case 1: - case 2: - case 3: - break; - default: - security = 0; - break; - } - } - - public boolean getEnable3GSettings() { - return enable3GSettings; - } - - public void setEnable3GSettings(boolean enable3GSettings) { - this.enable3GSettings = enable3GSettings; - } - - public ScreenSettings getScreen3G() { - return screen3G; - } - - public void setScreen3G(ScreenSettings screen3G) { - this.screen3G = screen3G; - } - - public PerformanceFlags getPerformance3G() { - return performance3G; - } - - public void setPerformance3G(PerformanceFlags performance3G) { - this.performance3G = performance3G; - } - - public boolean getRedirectSDCard() { - return redirectSDCard; - } - - public void setRedirectSDCard(boolean redirectSDCard) { - this.redirectSDCard = redirectSDCard; - } - - public int getRedirectSound() { - validate(); - return redirectSound; - } - - public void setRedirectSound(int redirect) { - this.redirectSound = redirect; - } - - public boolean getRedirectMicrophone() { - return redirectMicrophone; - } - - public void setRedirectMicrophone(boolean redirect) { - this.redirectMicrophone = redirect; - } - - public int getSecurity() { - validate(); - return security; - } - - public void setSecurity(int security) { - this.security = security; - } - - public boolean getConsoleMode() { - return consoleMode; - } - - public void setConsoleMode(boolean consoleMode) { - this.consoleMode = consoleMode; - } - - public String getRemoteProgram() { - return remoteProgram; - } - - public void setRemoteProgram(String remoteProgram) { - this.remoteProgram = remoteProgram; - } - - public String getWorkDir() { - return workDir; - } - - public void setWorkDir(String workDir) { - this.workDir = workDir; - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel out, int flags) { - out.writeInt(enable3GSettings ? 1 : 0); - out.writeParcelable(screen3G, flags); - out.writeParcelable(performance3G, flags); - out.writeInt(redirectSDCard ? 1 : 0); - out.writeInt(redirectSound); - out.writeInt(redirectMicrophone ? 1 : 0); - out.writeInt(security); - out.writeInt(consoleMode ? 1 : 0); - out.writeString(remoteProgram); - out.writeString(workDir); - } - } +public class BookmarkBase implements Parcelable, Cloneable +{ + public static final int TYPE_INVALID = -1; + public static final int TYPE_MANUAL = 1; + public static final int TYPE_QUICKCONNECT = 2; + public static final int TYPE_PLACEHOLDER = 3; + public static final int TYPE_CUSTOM_BASE = 1000; + public static final Parcelable.Creator CREATOR = + new Parcelable.Creator() { + public BookmarkBase createFromParcel(Parcel in) + { + return new BookmarkBase(in); + } + + @Override public BookmarkBase[] newArray(int size) + { + return new BookmarkBase[size]; + } + }; + protected int type; + private long id; + private String label; + private String username; + private String password; + private String domain; + private ScreenSettings screenSettings; + private PerformanceFlags performanceFlags; + private AdvancedSettings advancedSettings; + private DebugSettings debugSettings; + + public BookmarkBase(Parcel parcel) + { + type = parcel.readInt(); + id = parcel.readLong(); + label = parcel.readString(); + username = parcel.readString(); + password = parcel.readString(); + domain = parcel.readString(); + + screenSettings = parcel.readParcelable(ScreenSettings.class.getClassLoader()); + performanceFlags = parcel.readParcelable(PerformanceFlags.class.getClassLoader()); + advancedSettings = parcel.readParcelable(AdvancedSettings.class.getClassLoader()); + debugSettings = parcel.readParcelable(DebugSettings.class.getClassLoader()); + } + + public BookmarkBase() + { + init(); + } + + private void init() + { + type = TYPE_INVALID; + id = -1; + label = ""; + username = ""; + password = ""; + domain = ""; + + screenSettings = new ScreenSettings(); + performanceFlags = new PerformanceFlags(); + advancedSettings = new AdvancedSettings(); + debugSettings = new DebugSettings(); + } + + @SuppressWarnings("unchecked") public T get() + { + return (T)this; + } + + public int getType() + { + return type; + } + + public long getId() + { + return id; + } + + public void setId(long id) + { + this.id = id; + } + + public String getLabel() + { + return label; + } + + public void setLabel(String label) + { + this.label = label; + } + + public String getUsername() + { + return username; + } + + public void setUsername(String username) + { + this.username = username; + } + + public String getPassword() + { + return password; + } + + public void setPassword(String password) + { + this.password = password; + } + + public String getDomain() + { + return domain; + } + + public void setDomain(String domain) + { + this.domain = domain; + } + + public ScreenSettings getScreenSettings() + { + return screenSettings; + } + + public void setScreenSettings(ScreenSettings screenSettings) + { + this.screenSettings = screenSettings; + } + + public PerformanceFlags getPerformanceFlags() + { + return performanceFlags; + } + + public void setPerformanceFlags(PerformanceFlags performanceFlags) + { + this.performanceFlags = performanceFlags; + } + + public AdvancedSettings getAdvancedSettings() + { + return advancedSettings; + } + + public void setAdvancedSettings(AdvancedSettings advancedSettings) + { + this.advancedSettings = advancedSettings; + } + + public DebugSettings getDebugSettings() + { + return debugSettings; + } + + public void setDebugSettings(DebugSettings debugSettings) + { + this.debugSettings = debugSettings; + } + + public ScreenSettings getActiveScreenSettings() + { + return (GlobalApp.ConnectedTo3G && advancedSettings.getEnable3GSettings()) + ? advancedSettings.getScreen3G() + : screenSettings; + } + + public PerformanceFlags getActivePerformanceFlags() + { + return (GlobalApp.ConnectedTo3G && advancedSettings.getEnable3GSettings()) + ? advancedSettings.getPerformance3G() + : performanceFlags; + } + + @Override public int describeContents() + { + return 0; + } + + @Override public void writeToParcel(Parcel out, int flags) + { + out.writeInt(type); + out.writeLong(id); + out.writeString(label); + out.writeString(username); + out.writeString(password); + out.writeString(domain); + + out.writeParcelable(screenSettings, flags); + out.writeParcelable(performanceFlags, flags); + out.writeParcelable(advancedSettings, flags); + out.writeParcelable(debugSettings, flags); + } + + // write to shared preferences + public void writeToSharedPreferences(SharedPreferences sharedPrefs) + { + + Locale locale = Locale.ENGLISH; + + SharedPreferences.Editor editor = sharedPrefs.edit(); + editor.clear(); + editor.putString("bookmark.label", label); + editor.putString("bookmark.username", username); + editor.putString("bookmark.password", password); + editor.putString("bookmark.domain", domain); + + editor.putInt("bookmark.colors", screenSettings.getColors()); + editor.putString("bookmark.resolution", + screenSettings.getResolutionString().toLowerCase(locale)); + editor.putInt("bookmark.width", screenSettings.getWidth()); + editor.putInt("bookmark.height", screenSettings.getHeight()); + + editor.putBoolean("bookmark.perf_remotefx", performanceFlags.getRemoteFX()); + editor.putBoolean("bookmark.perf_gfx", performanceFlags.getGfx()); + editor.putBoolean("bookmark.perf_gfx_h264", performanceFlags.getH264()); + editor.putBoolean("bookmark.perf_wallpaper", performanceFlags.getWallpaper()); + editor.putBoolean("bookmark.perf_font_smoothing", performanceFlags.getFontSmoothing()); + editor.putBoolean("bookmark.perf_desktop_composition", + performanceFlags.getDesktopComposition()); + editor.putBoolean("bookmark.perf_window_dragging", performanceFlags.getFullWindowDrag()); + editor.putBoolean("bookmark.perf_menu_animation", performanceFlags.getMenuAnimations()); + editor.putBoolean("bookmark.perf_themes", performanceFlags.getTheming()); + + editor.putBoolean("bookmark.enable_3g_settings", advancedSettings.getEnable3GSettings()); + + editor.putInt("bookmark.colors_3g", advancedSettings.getScreen3G().getColors()); + editor.putString("bookmark.resolution_3g", + advancedSettings.getScreen3G().getResolutionString().toLowerCase(locale)); + editor.putInt("bookmark.width_3g", advancedSettings.getScreen3G().getWidth()); + editor.putInt("bookmark.height_3g", advancedSettings.getScreen3G().getHeight()); + + editor.putBoolean("bookmark.perf_remotefx_3g", + advancedSettings.getPerformance3G().getRemoteFX()); + editor.putBoolean("bookmark.perf_gfx_3g", advancedSettings.getPerformance3G().getGfx()); + editor.putBoolean("bookmark.perf_gfx_h264_3g", + advancedSettings.getPerformance3G().getH264()); + editor.putBoolean("bookmark.perf_wallpaper_3g", + advancedSettings.getPerformance3G().getWallpaper()); + editor.putBoolean("bookmark.perf_font_smoothing_3g", + advancedSettings.getPerformance3G().getFontSmoothing()); + editor.putBoolean("bookmark.perf_desktop_composition_3g", + advancedSettings.getPerformance3G().getDesktopComposition()); + editor.putBoolean("bookmark.perf_window_dragging_3g", + advancedSettings.getPerformance3G().getFullWindowDrag()); + editor.putBoolean("bookmark.perf_menu_animation_3g", + advancedSettings.getPerformance3G().getMenuAnimations()); + editor.putBoolean("bookmark.perf_themes_3g", + advancedSettings.getPerformance3G().getTheming()); + + editor.putBoolean("bookmark.redirect_sdcard", advancedSettings.getRedirectSDCard()); + editor.putInt("bookmark.redirect_sound", advancedSettings.getRedirectSound()); + editor.putBoolean("bookmark.redirect_microphone", advancedSettings.getRedirectMicrophone()); + editor.putInt("bookmark.security", advancedSettings.getSecurity()); + editor.putString("bookmark.remote_program", advancedSettings.getRemoteProgram()); + editor.putString("bookmark.work_dir", advancedSettings.getWorkDir()); + editor.putBoolean("bookmark.console_mode", advancedSettings.getConsoleMode()); + + editor.putBoolean("bookmark.async_channel", debugSettings.getAsyncChannel()); + editor.putBoolean("bookmark.async_input", debugSettings.getAsyncInput()); + editor.putBoolean("bookmark.async_update", debugSettings.getAsyncUpdate()); + editor.putString("bookmark.debug_level", debugSettings.getDebugLevel()); + + editor.apply(); + } + + // read from shared preferences + public void readFromSharedPreferences(SharedPreferences sharedPrefs) + { + label = sharedPrefs.getString("bookmark.label", ""); + username = sharedPrefs.getString("bookmark.username", ""); + password = sharedPrefs.getString("bookmark.password", ""); + domain = sharedPrefs.getString("bookmark.domain", ""); + + screenSettings.setColors(sharedPrefs.getInt("bookmark.colors", 16)); + screenSettings.setResolution(sharedPrefs.getString("bookmark.resolution", "automatic"), + sharedPrefs.getInt("bookmark.width", 800), + sharedPrefs.getInt("bookmark.height", 600)); + + performanceFlags.setRemoteFX(sharedPrefs.getBoolean("bookmark.perf_remotefx", false)); + performanceFlags.setGfx(sharedPrefs.getBoolean("bookmark.perf_gfx", false)); + performanceFlags.setH264(sharedPrefs.getBoolean("bookmark.perf_gfx_h264", false)); + performanceFlags.setWallpaper(sharedPrefs.getBoolean("bookmark.perf_wallpaper", false)); + performanceFlags.setFontSmoothing( + sharedPrefs.getBoolean("bookmark.perf_font_smoothing", false)); + performanceFlags.setDesktopComposition( + sharedPrefs.getBoolean("bookmark.perf_desktop_composition", false)); + performanceFlags.setFullWindowDrag( + sharedPrefs.getBoolean("bookmark.perf_window_dragging", false)); + performanceFlags.setMenuAnimations( + sharedPrefs.getBoolean("bookmark.perf_menu_animation", false)); + performanceFlags.setTheming(sharedPrefs.getBoolean("bookmark.perf_themes", false)); + + advancedSettings.setEnable3GSettings( + sharedPrefs.getBoolean("bookmark.enable_3g_settings", false)); + + advancedSettings.getScreen3G().setColors(sharedPrefs.getInt("bookmark.colors_3g", 16)); + advancedSettings.getScreen3G().setResolution( + sharedPrefs.getString("bookmark.resolution_3g", "automatic"), + sharedPrefs.getInt("bookmark.width_3g", 800), + sharedPrefs.getInt("bookmark.height_3g", 600)); + + advancedSettings.getPerformance3G().setRemoteFX( + sharedPrefs.getBoolean("bookmark.perf_remotefx_3g", false)); + advancedSettings.getPerformance3G().setGfx( + sharedPrefs.getBoolean("bookmark.perf_gfx_3g", false)); + advancedSettings.getPerformance3G().setH264( + sharedPrefs.getBoolean("bookmark.perf_gfx_h264_3g", false)); + advancedSettings.getPerformance3G().setWallpaper( + sharedPrefs.getBoolean("bookmark.perf_wallpaper_3g", false)); + advancedSettings.getPerformance3G().setFontSmoothing( + sharedPrefs.getBoolean("bookmark.perf_font_smoothing_3g", false)); + advancedSettings.getPerformance3G().setDesktopComposition( + sharedPrefs.getBoolean("bookmark.perf_desktop_composition_3g", false)); + advancedSettings.getPerformance3G().setFullWindowDrag( + sharedPrefs.getBoolean("bookmark.perf_window_dragging_3g", false)); + advancedSettings.getPerformance3G().setMenuAnimations( + sharedPrefs.getBoolean("bookmark.perf_menu_animation_3g", false)); + advancedSettings.getPerformance3G().setTheming( + sharedPrefs.getBoolean("bookmark.perf_themes_3g", false)); + + advancedSettings.setRedirectSDCard( + sharedPrefs.getBoolean("bookmark.redirect_sdcard", false)); + advancedSettings.setRedirectSound(sharedPrefs.getInt("bookmark.redirect_sound", 0)); + advancedSettings.setRedirectMicrophone( + sharedPrefs.getBoolean("bookmark.redirect_microphone", false)); + advancedSettings.setSecurity(sharedPrefs.getInt("bookmark.security", 0)); + advancedSettings.setRemoteProgram(sharedPrefs.getString("bookmark.remote_program", "")); + advancedSettings.setWorkDir(sharedPrefs.getString("bookmark.work_dir", "")); + advancedSettings.setConsoleMode(sharedPrefs.getBoolean("bookmark.console_mode", false)); + + debugSettings.setAsyncChannel(sharedPrefs.getBoolean("bookmark.async_channel", true)); + debugSettings.setAsyncInput(sharedPrefs.getBoolean("bookmark.async_input", true)); + debugSettings.setAsyncUpdate(sharedPrefs.getBoolean("bookmark.async_update", true)); + debugSettings.setDebugLevel(sharedPrefs.getString("bookmark.debug_level", "INFO")); + } + + // Cloneable + public Object clone() + { + try + { + return super.clone(); + } + catch (CloneNotSupportedException e) + { + return null; + } + } + + // performance flags + public static class PerformanceFlags implements Parcelable + { + public static final Parcelable.Creator CREATOR = + new Parcelable.Creator() { + public PerformanceFlags createFromParcel(Parcel in) + { + return new PerformanceFlags(in); + } + + @Override public PerformanceFlags[] newArray(int size) + { + return new PerformanceFlags[size]; + } + }; + private boolean remotefx; + private boolean gfx; + private boolean h264; + private boolean wallpaper; + private boolean theming; + private boolean fullWindowDrag; + private boolean menuAnimations; + private boolean fontSmoothing; + private boolean desktopComposition; + + public PerformanceFlags() + { + remotefx = false; + gfx = false; + h264 = false; + wallpaper = false; + theming = false; + fullWindowDrag = false; + menuAnimations = false; + fontSmoothing = false; + desktopComposition = false; + } + + public PerformanceFlags(Parcel parcel) + { + remotefx = parcel.readInt() == 1; + gfx = parcel.readInt() == 1; + h264 = parcel.readInt() == 1; + wallpaper = parcel.readInt() == 1; + theming = parcel.readInt() == 1; + fullWindowDrag = (parcel.readInt() == 1); + menuAnimations = parcel.readInt() == 1; + fontSmoothing = parcel.readInt() == 1; + desktopComposition = parcel.readInt() == 1; + } + + public boolean getRemoteFX() + { + return remotefx; + } + + public void setRemoteFX(boolean remotefx) + { + this.remotefx = remotefx; + } + + public boolean getGfx() + { + return gfx; + } + + public void setGfx(boolean gfx) + { + this.gfx = gfx; + } + + public boolean getH264() + { + return h264; + } + + public void setH264(boolean h264) + { + this.h264 = h264; + } + + public boolean getWallpaper() + { + return wallpaper; + } + + public void setWallpaper(boolean wallpaper) + { + this.wallpaper = wallpaper; + } + + public boolean getTheming() + { + return theming; + } + + public void setTheming(boolean theming) + { + this.theming = theming; + } + + public boolean getFullWindowDrag() + { + return fullWindowDrag; + } + + public void setFullWindowDrag(boolean fullWindowDrag) + { + this.fullWindowDrag = fullWindowDrag; + } + + public boolean getMenuAnimations() + { + return menuAnimations; + } + + public void setMenuAnimations(boolean menuAnimations) + { + this.menuAnimations = menuAnimations; + } + + public boolean getFontSmoothing() + { + return fontSmoothing; + } + + public void setFontSmoothing(boolean fontSmoothing) + { + this.fontSmoothing = fontSmoothing; + } + + public boolean getDesktopComposition() + { + return desktopComposition; + } + + public void setDesktopComposition(boolean desktopComposition) + { + this.desktopComposition = desktopComposition; + } + + @Override public int describeContents() + { + return 0; + } + + @Override public void writeToParcel(Parcel out, int flags) + { + out.writeInt(remotefx ? 1 : 0); + out.writeInt(gfx ? 1 : 0); + out.writeInt(h264 ? 1 : 0); + out.writeInt(wallpaper ? 1 : 0); + out.writeInt(theming ? 1 : 0); + out.writeInt(fullWindowDrag ? 1 : 0); + out.writeInt(menuAnimations ? 1 : 0); + out.writeInt(fontSmoothing ? 1 : 0); + out.writeInt(desktopComposition ? 1 : 0); + } + } + + // Screen Settings class + public static class ScreenSettings implements Parcelable + { + public static final int FITSCREEN = -2; + public static final int AUTOMATIC = -1; + public static final int CUSTOM = 0; + public static final int PREDEFINED = 1; + public static final Parcelable.Creator CREATOR = + new Parcelable.Creator() { + public ScreenSettings createFromParcel(Parcel in) + { + return new ScreenSettings(in); + } + + @Override public ScreenSettings[] newArray(int size) + { + return new ScreenSettings[size]; + } + }; + private int resolution; + private int colors; + private int width; + private int height; + + public ScreenSettings() + { + init(); + } + + public ScreenSettings(Parcel parcel) + { + resolution = parcel.readInt(); + colors = parcel.readInt(); + width = parcel.readInt(); + height = parcel.readInt(); + } + + private void validate() + { + switch (colors) + { + case 32: + case 24: + case 16: + case 15: + case 8: + break; + default: + colors = 32; + break; + } + + if ((width <= 0) || (width > 65536)) + { + width = 1024; + } + + if ((height <= 0) || (height > 65536)) + { + height = 768; + } + + switch (resolution) + { + case FITSCREEN: + case AUTOMATIC: + case CUSTOM: + case PREDEFINED: + break; + default: + resolution = AUTOMATIC; + break; + } + } + + private void init() + { + resolution = AUTOMATIC; + colors = 16; + width = 0; + height = 0; + } + + public void setResolution(String resolution, int width, int height) + { + if (resolution.contains("x")) + { + String[] dimensions = resolution.split("x"); + this.width = Integer.valueOf(dimensions[0]); + this.height = Integer.valueOf(dimensions[1]); + this.resolution = PREDEFINED; + } + else if (resolution.equalsIgnoreCase("custom")) + { + this.width = width; + this.height = height; + this.resolution = CUSTOM; + } + else if (resolution.equalsIgnoreCase("fitscreen")) + { + this.width = this.height = 0; + this.resolution = FITSCREEN; + } + else + { + this.width = this.height = 0; + this.resolution = AUTOMATIC; + } + } + + public int getResolution() + { + return resolution; + } + + public void setResolution(int resolution) + { + this.resolution = resolution; + + if (resolution == AUTOMATIC || resolution == FITSCREEN) + { + width = 0; + height = 0; + } + } + + public String getResolutionString() + { + if (isPredefined()) + return (width + "x" + height); + + return (isFitScreen() ? "fitscreen" : isAutomatic() ? "automatic" : "custom"); + } + + public boolean isPredefined() + { + validate(); + return (resolution == PREDEFINED); + } + + public boolean isAutomatic() + { + validate(); + return (resolution == AUTOMATIC); + } + + public boolean isFitScreen() + { + validate(); + return (resolution == FITSCREEN); + } + + public boolean isCustom() + { + validate(); + return (resolution == CUSTOM); + } + + public int getWidth() + { + validate(); + return width; + } + + public void setWidth(int width) + { + this.width = width; + } + + public int getHeight() + { + validate(); + return height; + } + + public void setHeight(int height) + { + this.height = height; + } + + public int getColors() + { + validate(); + return colors; + } + + public void setColors(int colors) + { + this.colors = colors; + } + + @Override public int describeContents() + { + return 0; + } + + @Override public void writeToParcel(Parcel out, int flags) + { + out.writeInt(resolution); + out.writeInt(colors); + out.writeInt(width); + out.writeInt(height); + } + } + + public static class DebugSettings implements Parcelable + { + + public static final Parcelable.Creator CREATOR = + new Parcelable.Creator() { + public DebugSettings createFromParcel(Parcel in) + { + return new DebugSettings(in); + } + + @Override public DebugSettings[] newArray(int size) + { + return new DebugSettings[size]; + } + }; + private String debug; + private boolean asyncChannel; + private boolean asyncTransport; + private boolean asyncInput; + private boolean asyncUpdate; + + public DebugSettings() + { + init(); + } + + // Session Settings + public DebugSettings(Parcel parcel) + { + asyncChannel = parcel.readInt() == 1; + asyncTransport = parcel.readInt() == 1; + asyncInput = parcel.readInt() == 1; + asyncUpdate = parcel.readInt() == 1; + debug = parcel.readString(); + } + + private void init() + { + debug = "INFO"; + asyncChannel = true; + asyncTransport = false; + asyncInput = true; + asyncUpdate = true; + } + + private void validate() + { + final String[] levels = { "OFF", "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE" }; + + for (String level : levels) + { + if (level.equalsIgnoreCase(this.debug)) + { + return; + } + } + + this.debug = "INFO"; + } + + public String getDebugLevel() + { + validate(); + return debug; + } + + public void setDebugLevel(String debug) + { + this.debug = debug; + } + + public boolean getAsyncUpdate() + { + return asyncUpdate; + } + + public void setAsyncUpdate(boolean enabled) + { + asyncUpdate = enabled; + } + + public boolean getAsyncInput() + { + return asyncInput; + } + + public void setAsyncInput(boolean enabled) + { + asyncInput = enabled; + } + + public boolean getAsyncChannel() + { + return asyncChannel; + } + + public void setAsyncChannel(boolean enabled) + { + asyncChannel = enabled; + } + + @Override public int describeContents() + { + return 0; + } + + @Override public void writeToParcel(Parcel out, int flags) + { + out.writeInt(asyncChannel ? 1 : 0); + out.writeInt(asyncTransport ? 1 : 0); + out.writeInt(asyncInput ? 1 : 0); + out.writeInt(asyncUpdate ? 1 : 0); + out.writeString(debug); + } + } + + // Session Settings + public static class AdvancedSettings implements Parcelable + { + public static final Parcelable.Creator CREATOR = + new Parcelable.Creator() { + public AdvancedSettings createFromParcel(Parcel in) + { + return new AdvancedSettings(in); + } + + @Override public AdvancedSettings[] newArray(int size) + { + return new AdvancedSettings[size]; + } + }; + private boolean enable3GSettings; + private ScreenSettings screen3G; + private PerformanceFlags performance3G; + private boolean redirectSDCard; + private int redirectSound; + private boolean redirectMicrophone; + private int security; + private boolean consoleMode; + private String remoteProgram; + private String workDir; + + public AdvancedSettings() + { + init(); + } + + public AdvancedSettings(Parcel parcel) + { + enable3GSettings = parcel.readInt() == 1; + screen3G = parcel.readParcelable(ScreenSettings.class.getClassLoader()); + performance3G = parcel.readParcelable(PerformanceFlags.class.getClassLoader()); + redirectSDCard = parcel.readInt() == 1; + redirectSound = parcel.readInt(); + redirectMicrophone = parcel.readInt() == 1; + security = parcel.readInt(); + consoleMode = parcel.readInt() == 1; + remoteProgram = parcel.readString(); + workDir = parcel.readString(); + } + + private void init() + { + enable3GSettings = false; + screen3G = new ScreenSettings(); + performance3G = new PerformanceFlags(); + redirectSDCard = false; + redirectSound = 0; + redirectMicrophone = false; + security = 0; + consoleMode = false; + remoteProgram = ""; + workDir = ""; + } + + private void validate() + { + switch (redirectSound) + { + case 0: + case 1: + case 2: + break; + default: + redirectSound = 0; + break; + } + + switch (security) + { + case 0: + case 1: + case 2: + case 3: + break; + default: + security = 0; + break; + } + } + + public boolean getEnable3GSettings() + { + return enable3GSettings; + } + + public void setEnable3GSettings(boolean enable3GSettings) + { + this.enable3GSettings = enable3GSettings; + } + + public ScreenSettings getScreen3G() + { + return screen3G; + } + + public void setScreen3G(ScreenSettings screen3G) + { + this.screen3G = screen3G; + } + + public PerformanceFlags getPerformance3G() + { + return performance3G; + } + + public void setPerformance3G(PerformanceFlags performance3G) + { + this.performance3G = performance3G; + } + + public boolean getRedirectSDCard() + { + return redirectSDCard; + } + + public void setRedirectSDCard(boolean redirectSDCard) + { + this.redirectSDCard = redirectSDCard; + } + + public int getRedirectSound() + { + validate(); + return redirectSound; + } + + public void setRedirectSound(int redirect) + { + this.redirectSound = redirect; + } + + public boolean getRedirectMicrophone() + { + return redirectMicrophone; + } + + public void setRedirectMicrophone(boolean redirect) + { + this.redirectMicrophone = redirect; + } + + public int getSecurity() + { + validate(); + return security; + } + + public void setSecurity(int security) + { + this.security = security; + } + + public boolean getConsoleMode() + { + return consoleMode; + } + + public void setConsoleMode(boolean consoleMode) + { + this.consoleMode = consoleMode; + } + + public String getRemoteProgram() + { + return remoteProgram; + } + + public void setRemoteProgram(String remoteProgram) + { + this.remoteProgram = remoteProgram; + } + + public String getWorkDir() + { + return workDir; + } + + public void setWorkDir(String workDir) + { + this.workDir = workDir; + } + + @Override public int describeContents() + { + return 0; + } + + @Override public void writeToParcel(Parcel out, int flags) + { + out.writeInt(enable3GSettings ? 1 : 0); + out.writeParcelable(screen3G, flags); + out.writeParcelable(performance3G, flags); + out.writeInt(redirectSDCard ? 1 : 0); + out.writeInt(redirectSound); + out.writeInt(redirectMicrophone ? 1 : 0); + out.writeInt(security); + out.writeInt(consoleMode ? 1 : 0); + out.writeString(remoteProgram); + out.writeString(workDir); + } + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/ConnectionReference.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/ConnectionReference.java index ac8c2fbc3..3e6877672 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/ConnectionReference.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/ConnectionReference.java @@ -1,69 +1,85 @@ /* - A RDP connection reference. References can use bookmark ids or hostnames to connect to a RDP server. + A RDP connection reference. References can use bookmark ids or hostnames to connect to a RDP + server. Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.domain; -public class ConnectionReference { - public static final String PATH_MANUAL_BOOKMARK_ID = "MBMID/"; - public static final String PATH_HOSTNAME = "HOST/"; - public static final String PATH_PLACEHOLDER = "PLCHLD/"; - public static final String PATH_FILE = "FILE/"; +public class ConnectionReference +{ + public static final String PATH_MANUAL_BOOKMARK_ID = "MBMID/"; + public static final String PATH_HOSTNAME = "HOST/"; + public static final String PATH_PLACEHOLDER = "PLCHLD/"; + public static final String PATH_FILE = "FILE/"; - public static String getManualBookmarkReference(long bookmarkId) { - return (PATH_MANUAL_BOOKMARK_ID + bookmarkId); - } + public static String getManualBookmarkReference(long bookmarkId) + { + return (PATH_MANUAL_BOOKMARK_ID + bookmarkId); + } - public static String getHostnameReference(String hostname) { - return (PATH_HOSTNAME + hostname); - } + public static String getHostnameReference(String hostname) + { + return (PATH_HOSTNAME + hostname); + } - public static String getPlaceholderReference(String name) { - return (PATH_PLACEHOLDER + name); - } + public static String getPlaceholderReference(String name) + { + return (PATH_PLACEHOLDER + name); + } - public static String getFileReference(String uri) { - return (PATH_FILE + uri); - } + public static String getFileReference(String uri) + { + return (PATH_FILE + uri); + } - public static boolean isBookmarkReference(String refStr) { - return refStr.startsWith(PATH_MANUAL_BOOKMARK_ID); - } + public static boolean isBookmarkReference(String refStr) + { + return refStr.startsWith(PATH_MANUAL_BOOKMARK_ID); + } - public static boolean isManualBookmarkReference(String refStr) { - return refStr.startsWith(PATH_MANUAL_BOOKMARK_ID); - } + public static boolean isManualBookmarkReference(String refStr) + { + return refStr.startsWith(PATH_MANUAL_BOOKMARK_ID); + } - public static boolean isHostnameReference(String refStr) { - return refStr.startsWith(PATH_HOSTNAME); - } + public static boolean isHostnameReference(String refStr) + { + return refStr.startsWith(PATH_HOSTNAME); + } - public static boolean isPlaceholderReference(String refStr) { - return refStr.startsWith(PATH_PLACEHOLDER); - } + public static boolean isPlaceholderReference(String refStr) + { + return refStr.startsWith(PATH_PLACEHOLDER); + } - public static boolean isFileReference(String refStr) { - return refStr.startsWith(PATH_FILE); - } + public static boolean isFileReference(String refStr) + { + return refStr.startsWith(PATH_FILE); + } - public static long getManualBookmarkId(String refStr) { - return Integer.parseInt(refStr.substring(PATH_MANUAL_BOOKMARK_ID.length())); - } + public static long getManualBookmarkId(String refStr) + { + return Integer.parseInt(refStr.substring(PATH_MANUAL_BOOKMARK_ID.length())); + } - public static String getHostname(String refStr) { - return refStr.substring(PATH_HOSTNAME.length()); - } + public static String getHostname(String refStr) + { + return refStr.substring(PATH_HOSTNAME.length()); + } - public static String getPlaceholder(String refStr) { - return refStr.substring(PATH_PLACEHOLDER.length()); - } + public static String getPlaceholder(String refStr) + { + return refStr.substring(PATH_PLACEHOLDER.length()); + } - public static String getFile(String refStr) { - return refStr.substring(PATH_FILE.length()); - } + public static String getFile(String refStr) + { + return refStr.substring(PATH_FILE.length()); + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/ManualBookmark.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/ManualBookmark.java index 0e5b677a3..874d4e934 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/ManualBookmark.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/ManualBookmark.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.domain; @@ -13,212 +14,242 @@ import android.content.SharedPreferences; import android.os.Parcel; import android.os.Parcelable; -public class ManualBookmark extends BookmarkBase { - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - public ManualBookmark createFromParcel(Parcel in) { - return new ManualBookmark(in); - } +public class ManualBookmark extends BookmarkBase +{ + public static final Parcelable.Creator CREATOR = + new Parcelable.Creator() { + public ManualBookmark createFromParcel(Parcel in) + { + return new ManualBookmark(in); + } - @Override - public ManualBookmark[] newArray(int size) { - return new ManualBookmark[size]; - } - }; - private String hostname; - private int port; - private boolean enableGatewaySettings; - private GatewaySettings gatewaySettings; + @Override public ManualBookmark[] newArray(int size) + { + return new ManualBookmark[size]; + } + }; + private String hostname; + private int port; + private boolean enableGatewaySettings; + private GatewaySettings gatewaySettings; - public ManualBookmark(Parcel parcel) { - super(parcel); - type = TYPE_MANUAL; - hostname = parcel.readString(); - port = parcel.readInt(); + public ManualBookmark(Parcel parcel) + { + super(parcel); + type = TYPE_MANUAL; + hostname = parcel.readString(); + port = parcel.readInt(); - enableGatewaySettings = (parcel.readInt() == 1 ? true : false); - gatewaySettings = parcel.readParcelable(GatewaySettings.class.getClassLoader()); - } + enableGatewaySettings = (parcel.readInt() == 1 ? true : false); + gatewaySettings = parcel.readParcelable(GatewaySettings.class.getClassLoader()); + } - public ManualBookmark() { - super(); - init(); - } + public ManualBookmark() + { + super(); + init(); + } - private void init() { - type = TYPE_MANUAL; - hostname = ""; - port = 3389; - enableGatewaySettings = false; - gatewaySettings = new GatewaySettings(); - } + private void init() + { + type = TYPE_MANUAL; + hostname = ""; + port = 3389; + enableGatewaySettings = false; + gatewaySettings = new GatewaySettings(); + } - public String getHostname() { - return hostname; - } + public String getHostname() + { + return hostname; + } - public void setHostname(String hostname) { - this.hostname = hostname; - } + public void setHostname(String hostname) + { + this.hostname = hostname; + } - public int getPort() { - return port; - } + public int getPort() + { + return port; + } - public void setPort(int port) { - this.port = port; - } + public void setPort(int port) + { + this.port = port; + } - public boolean getEnableGatewaySettings() { - return enableGatewaySettings; - } + public boolean getEnableGatewaySettings() + { + return enableGatewaySettings; + } - public void setEnableGatewaySettings(boolean enableGatewaySettings) { - this.enableGatewaySettings = enableGatewaySettings; - } + public void setEnableGatewaySettings(boolean enableGatewaySettings) + { + this.enableGatewaySettings = enableGatewaySettings; + } - public GatewaySettings getGatewaySettings() { - return gatewaySettings; - } + public GatewaySettings getGatewaySettings() + { + return gatewaySettings; + } - public void setGatewaySettings(GatewaySettings gatewaySettings) { - this.gatewaySettings = gatewaySettings; - } + public void setGatewaySettings(GatewaySettings gatewaySettings) + { + this.gatewaySettings = gatewaySettings; + } - @Override - public int describeContents() { - return 0; - } + @Override public int describeContents() + { + return 0; + } - @Override - public void writeToParcel(Parcel out, int flags) { - super.writeToParcel(out, flags); - out.writeString(hostname); - out.writeInt(port); - out.writeInt(enableGatewaySettings ? 1 : 0); - out.writeParcelable(gatewaySettings, flags); - } + @Override public void writeToParcel(Parcel out, int flags) + { + super.writeToParcel(out, flags); + out.writeString(hostname); + out.writeInt(port); + out.writeInt(enableGatewaySettings ? 1 : 0); + out.writeParcelable(gatewaySettings, flags); + } - @Override - public void writeToSharedPreferences(SharedPreferences sharedPrefs) { - super.writeToSharedPreferences(sharedPrefs); + @Override public void writeToSharedPreferences(SharedPreferences sharedPrefs) + { + super.writeToSharedPreferences(sharedPrefs); - SharedPreferences.Editor editor = sharedPrefs.edit(); - editor.putString("bookmark.hostname", hostname); - editor.putInt("bookmark.port", port); - editor.putBoolean("bookmark.enable_gateway_settings", enableGatewaySettings); - editor.putString("bookmark.gateway_hostname", gatewaySettings.getHostname()); - editor.putInt("bookmark.gateway_port", gatewaySettings.getPort()); - editor.putString("bookmark.gateway_username", gatewaySettings.getUsername()); - editor.putString("bookmark.gateway_password", gatewaySettings.getPassword()); - editor.putString("bookmark.gateway_domain", gatewaySettings.getDomain()); - editor.commit(); - } + SharedPreferences.Editor editor = sharedPrefs.edit(); + editor.putString("bookmark.hostname", hostname); + editor.putInt("bookmark.port", port); + editor.putBoolean("bookmark.enable_gateway_settings", enableGatewaySettings); + editor.putString("bookmark.gateway_hostname", gatewaySettings.getHostname()); + editor.putInt("bookmark.gateway_port", gatewaySettings.getPort()); + editor.putString("bookmark.gateway_username", gatewaySettings.getUsername()); + editor.putString("bookmark.gateway_password", gatewaySettings.getPassword()); + editor.putString("bookmark.gateway_domain", gatewaySettings.getDomain()); + editor.commit(); + } - @Override - public void readFromSharedPreferences(SharedPreferences sharedPrefs) { - super.readFromSharedPreferences(sharedPrefs); + @Override public void readFromSharedPreferences(SharedPreferences sharedPrefs) + { + super.readFromSharedPreferences(sharedPrefs); - hostname = sharedPrefs.getString("bookmark.hostname", ""); - port = sharedPrefs.getInt("bookmark.port", 3389); - enableGatewaySettings = sharedPrefs.getBoolean("bookmark.enable_gateway_settings", false); - gatewaySettings.setHostname(sharedPrefs.getString("bookmark.gateway_hostname", "")); - gatewaySettings.setPort(sharedPrefs.getInt("bookmark.gateway_port", 443)); - gatewaySettings.setUsername(sharedPrefs.getString("bookmark.gateway_username", "")); - gatewaySettings.setPassword(sharedPrefs.getString("bookmark.gateway_password", "")); - gatewaySettings.setDomain(sharedPrefs.getString("bookmark.gateway_domain", "")); - } + hostname = sharedPrefs.getString("bookmark.hostname", ""); + port = sharedPrefs.getInt("bookmark.port", 3389); + enableGatewaySettings = sharedPrefs.getBoolean("bookmark.enable_gateway_settings", false); + gatewaySettings.setHostname(sharedPrefs.getString("bookmark.gateway_hostname", "")); + gatewaySettings.setPort(sharedPrefs.getInt("bookmark.gateway_port", 443)); + gatewaySettings.setUsername(sharedPrefs.getString("bookmark.gateway_username", "")); + gatewaySettings.setPassword(sharedPrefs.getString("bookmark.gateway_password", "")); + gatewaySettings.setDomain(sharedPrefs.getString("bookmark.gateway_domain", "")); + } - // Cloneable - public Object clone() { - return super.clone(); - } + // Cloneable + public Object clone() + { + return super.clone(); + } - // Gateway Settings class - public static class GatewaySettings implements Parcelable { - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - public GatewaySettings createFromParcel(Parcel in) { - return new GatewaySettings(in); - } + // Gateway Settings class + public static class GatewaySettings implements Parcelable + { + public static final Parcelable.Creator CREATOR = + new Parcelable.Creator() { + public GatewaySettings createFromParcel(Parcel in) + { + return new GatewaySettings(in); + } - @Override - public GatewaySettings[] newArray(int size) { - return new GatewaySettings[size]; - } - }; - private String hostname; - private int port; - private String username; - private String password; - private String domain; + @Override public GatewaySettings[] newArray(int size) + { + return new GatewaySettings[size]; + } + }; + private String hostname; + private int port; + private String username; + private String password; + private String domain; - public GatewaySettings() { - hostname = ""; - port = 443; - username = ""; - password = ""; - domain = ""; - } + public GatewaySettings() + { + hostname = ""; + port = 443; + username = ""; + password = ""; + domain = ""; + } - public GatewaySettings(Parcel parcel) { - hostname = parcel.readString(); - port = parcel.readInt(); - username = parcel.readString(); - password = parcel.readString(); - domain = parcel.readString(); - } + public GatewaySettings(Parcel parcel) + { + hostname = parcel.readString(); + port = parcel.readInt(); + username = parcel.readString(); + password = parcel.readString(); + domain = parcel.readString(); + } - public String getHostname() { - return hostname; - } + public String getHostname() + { + return hostname; + } - public void setHostname(String hostname) { - this.hostname = hostname; - } + public void setHostname(String hostname) + { + this.hostname = hostname; + } - public int getPort() { - return port; - } + public int getPort() + { + return port; + } - public void setPort(int port) { - this.port = port; - } + public void setPort(int port) + { + this.port = port; + } - public String getUsername() { - return username; - } + public String getUsername() + { + return username; + } - public void setUsername(String username) { - this.username = username; - } + public void setUsername(String username) + { + this.username = username; + } - public String getPassword() { - return password; - } + public String getPassword() + { + return password; + } - public void setPassword(String password) { - this.password = password; - } + public void setPassword(String password) + { + this.password = password; + } - public String getDomain() { - return domain; - } + public String getDomain() + { + return domain; + } - public void setDomain(String domain) { - this.domain = domain; - } + public void setDomain(String domain) + { + this.domain = domain; + } - @Override - public int describeContents() { - return 0; - } + @Override public int describeContents() + { + return 0; + } - @Override - public void writeToParcel(Parcel out, int flags) { - out.writeString(hostname); - out.writeInt(port); - out.writeString(username); - out.writeString(password); - out.writeString(domain); - } - } + @Override public void writeToParcel(Parcel out, int flags) + { + out.writeString(hostname); + out.writeInt(port); + out.writeString(username); + out.writeString(password); + out.writeString(domain); + } + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/PlaceholderBookmark.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/PlaceholderBookmark.java index b181af3b6..d15aaf792 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/PlaceholderBookmark.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/PlaceholderBookmark.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.domain; @@ -13,64 +14,71 @@ import android.content.SharedPreferences; import android.os.Parcel; import android.os.Parcelable; -public class PlaceholderBookmark extends BookmarkBase { +public class PlaceholderBookmark extends BookmarkBase +{ - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - public PlaceholderBookmark createFromParcel(Parcel in) { - return new PlaceholderBookmark(in); - } + public static final Parcelable.Creator CREATOR = + new Parcelable.Creator() { + public PlaceholderBookmark createFromParcel(Parcel in) + { + return new PlaceholderBookmark(in); + } - @Override - public PlaceholderBookmark[] newArray(int size) { - return new PlaceholderBookmark[size]; - } - }; - private String name; + @Override public PlaceholderBookmark[] newArray(int size) + { + return new PlaceholderBookmark[size]; + } + }; + private String name; - public PlaceholderBookmark(Parcel parcel) { - super(parcel); - type = TYPE_PLACEHOLDER; - name = parcel.readString(); - } + public PlaceholderBookmark(Parcel parcel) + { + super(parcel); + type = TYPE_PLACEHOLDER; + name = parcel.readString(); + } - public PlaceholderBookmark() { - super(); - type = TYPE_PLACEHOLDER; - name = ""; - } + public PlaceholderBookmark() + { + super(); + type = TYPE_PLACEHOLDER; + name = ""; + } - public String getName() { - return name; - } + public String getName() + { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) + { + this.name = name; + } - @Override - public int describeContents() { - return 0; - } + @Override public int describeContents() + { + return 0; + } - @Override - public void writeToParcel(Parcel out, int flags) { - super.writeToParcel(out, flags); - out.writeString(name); - } + @Override public void writeToParcel(Parcel out, int flags) + { + super.writeToParcel(out, flags); + out.writeString(name); + } - @Override - public void writeToSharedPreferences(SharedPreferences sharedPrefs) { - super.writeToSharedPreferences(sharedPrefs); - } + @Override public void writeToSharedPreferences(SharedPreferences sharedPrefs) + { + super.writeToSharedPreferences(sharedPrefs); + } - @Override - public void readFromSharedPreferences(SharedPreferences sharedPrefs) { - super.readFromSharedPreferences(sharedPrefs); - } - - // Cloneable - public Object clone() { - return super.clone(); - } + @Override public void readFromSharedPreferences(SharedPreferences sharedPrefs) + { + super.readFromSharedPreferences(sharedPrefs); + } + // Cloneable + public Object clone() + { + return super.clone(); + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/QuickConnectBookmark.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/QuickConnectBookmark.java index 7df9db8c9..3367b5479 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/QuickConnectBookmark.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/QuickConnectBookmark.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.domain; @@ -13,52 +14,57 @@ import android.content.SharedPreferences; import android.os.Parcel; import android.os.Parcelable; -public class QuickConnectBookmark extends ManualBookmark { +public class QuickConnectBookmark extends ManualBookmark +{ - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - public QuickConnectBookmark createFromParcel(Parcel in) { - return new QuickConnectBookmark(in); - } + public static final Parcelable.Creator CREATOR = + new Parcelable.Creator() { + public QuickConnectBookmark createFromParcel(Parcel in) + { + return new QuickConnectBookmark(in); + } - @Override - public QuickConnectBookmark[] newArray(int size) { - return new QuickConnectBookmark[size]; - } - }; + @Override public QuickConnectBookmark[] newArray(int size) + { + return new QuickConnectBookmark[size]; + } + }; - public QuickConnectBookmark(Parcel parcel) { - super(parcel); - type = TYPE_QUICKCONNECT; - } + public QuickConnectBookmark(Parcel parcel) + { + super(parcel); + type = TYPE_QUICKCONNECT; + } - public QuickConnectBookmark() { - super(); - type = TYPE_QUICKCONNECT; - } + public QuickConnectBookmark() + { + super(); + type = TYPE_QUICKCONNECT; + } - @Override - public int describeContents() { - return 0; - } + @Override public int describeContents() + { + return 0; + } - @Override - public void writeToParcel(Parcel out, int flags) { - super.writeToParcel(out, flags); - } + @Override public void writeToParcel(Parcel out, int flags) + { + super.writeToParcel(out, flags); + } - @Override - public void writeToSharedPreferences(SharedPreferences sharedPrefs) { - super.writeToSharedPreferences(sharedPrefs); - } + @Override public void writeToSharedPreferences(SharedPreferences sharedPrefs) + { + super.writeToSharedPreferences(sharedPrefs); + } - @Override - public void readFromSharedPreferences(SharedPreferences sharedPrefs) { - super.readFromSharedPreferences(sharedPrefs); - } - - // Cloneable - public Object clone() { - return super.clone(); - } + @Override public void readFromSharedPreferences(SharedPreferences sharedPrefs) + { + super.readFromSharedPreferences(sharedPrefs); + } + // Cloneable + public Object clone() + { + return super.clone(); + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/AboutActivity.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/AboutActivity.java index c9320d46e..26a4e455f 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/AboutActivity.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/AboutActivity.java @@ -22,85 +22,100 @@ import java.util.Formatter; import java.util.IllegalFormatException; import java.util.Locale; -public class AboutActivity extends AppCompatActivity { - private static final String TAG = AboutActivity.class.toString(); - private WebView mWebView; +public class AboutActivity extends AppCompatActivity +{ + private static final String TAG = AboutActivity.class.toString(); + private WebView mWebView; - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_about); - mWebView = (WebView) findViewById(R.id.activity_about_webview); - } + @Override protected void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_about); + mWebView = (WebView)findViewById(R.id.activity_about_webview); + } - @Override - protected void onResume() { - populate(); - super.onResume(); - } + @Override protected void onResume() + { + populate(); + super.onResume(); + } - private void populate() { - StringBuilder total = new StringBuilder(); + private void populate() + { + StringBuilder total = new StringBuilder(); - String filename = "about_phone.html"; - if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE) { - filename = "about.html"; - } - Locale def = Locale.getDefault(); - String prefix = def.getLanguage().toLowerCase(def); + String filename = "about_phone.html"; + if ((getResources().getConfiguration().screenLayout & + Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE) + { + filename = "about.html"; + } + Locale def = Locale.getDefault(); + String prefix = def.getLanguage().toLowerCase(def); - String dir = prefix + "_about_page/"; - String file = dir + filename; - InputStream is; - try { - is = getAssets().open(file); - is.close(); - } catch (IOException e) { - Log.e(TAG, "Missing localized asset " + file, e); - dir = "about_page/"; - file = dir + filename; - } + String dir = prefix + "_about_page/"; + String file = dir + filename; + InputStream is; + try + { + is = getAssets().open(file); + is.close(); + } + catch (IOException e) + { + Log.e(TAG, "Missing localized asset " + file, e); + dir = "about_page/"; + file = dir + filename; + } - try { - BufferedReader r = new BufferedReader(new InputStreamReader(getAssets().open(file))); - try { - String line; - while ((line = r.readLine()) != null) { - total.append(line); - total.append("\n"); - } - } finally { - r.close(); - } - } catch (IOException e) { - Log.e(TAG, "Could not read about page " + file, e); - } + try + { + BufferedReader r = new BufferedReader(new InputStreamReader(getAssets().open(file))); + try + { + String line; + while ((line = r.readLine()) != null) + { + total.append(line); + total.append("\n"); + } + } + finally + { + r.close(); + } + } + catch (IOException e) + { + Log.e(TAG, "Could not read about page " + file, e); + } - // append FreeRDP core version to app version - // get app version - String version; - try { - version = getPackageManager().getPackageInfo(getPackageName(), 0).versionName; - } catch (PackageManager.NameNotFoundException e) { - version = "unknown"; - } - version = version + " (" + LibFreeRDP.getVersion() + ")"; + // append FreeRDP core version to app version + // get app version + String version; + try + { + version = getPackageManager().getPackageInfo(getPackageName(), 0).versionName; + } + catch (PackageManager.NameNotFoundException e) + { + version = "unknown"; + } + version = version + " (" + LibFreeRDP.getVersion() + ")"; - WebSettings settings = mWebView.getSettings(); - settings.setDomStorageEnabled(true); - settings.setUseWideViewPort(true); - settings.setLoadWithOverviewMode(true); - settings.setSupportZoom(true); + WebSettings settings = mWebView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setUseWideViewPort(true); + settings.setLoadWithOverviewMode(true); + settings.setSupportZoom(true); - final String base = "file:///android_asset/" + dir; + final String base = "file:///android_asset/" + dir; - final String rawHtml = total.toString(); - final String html = rawHtml.replaceAll("%AFREERDP_VERSION%", version) - .replaceAll("%SYSTEM_VERSION%", Build.VERSION.RELEASE) - .replaceAll("%DEVICE_MODEL%", Build.MODEL); - - mWebView.loadDataWithBaseURL(base, html, "text/html", null, - "about:blank"); - } + final String rawHtml = total.toString(); + final String html = rawHtml.replaceAll("%AFREERDP_VERSION%", version) + .replaceAll("%SYSTEM_VERSION%", Build.VERSION.RELEASE) + .replaceAll("%DEVICE_MODEL%", Build.MODEL); + mWebView.loadDataWithBaseURL(base, html, "text/html", null, "about:blank"); + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/ApplicationSettingsActivity.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/ApplicationSettingsActivity.java index 05fb79239..2a4fc5e89 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/ApplicationSettingsActivity.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/ApplicationSettingsActivity.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.presentation; @@ -31,217 +32,269 @@ import java.io.File; import java.util.List; import java.util.UUID; -public class ApplicationSettingsActivity extends AppCompatPreferenceActivity { - private static boolean isXLargeTablet(Context context) { - return (context.getResources().getConfiguration().screenLayout - & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE; - } +public class ApplicationSettingsActivity extends AppCompatPreferenceActivity +{ + private static boolean isXLargeTablet(Context context) + { + return (context.getResources().getConfiguration().screenLayout & + Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE; + } - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setupActionBar(); - } + @Override protected void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + setupActionBar(); + } - private void setupActionBar() { - android.app.ActionBar actionBar = getActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - } - } + private void setupActionBar() + { + android.app.ActionBar actionBar = getActionBar(); + if (actionBar != null) + { + actionBar.setDisplayHomeAsUpEnabled(true); + } + } - @Override - public boolean onIsMultiPane() { - return isXLargeTablet(this); - } + @Override public boolean onIsMultiPane() + { + return isXLargeTablet(this); + } - @Override - @TargetApi(Build.VERSION_CODES.HONEYCOMB) - public void onBuildHeaders(List
target) { - loadHeadersFromResource(R.xml.settings_app_headers, target); - } + @Override + @TargetApi(Build.VERSION_CODES.HONEYCOMB) + public void onBuildHeaders(List
target) + { + loadHeadersFromResource(R.xml.settings_app_headers, target); + } - protected boolean isValidFragment(String fragmentName) { - return PreferenceFragment.class.getName().equals(fragmentName) - || ClientPreferenceFragment.class.getName().equals(fragmentName) - || UiPreferenceFragment.class.getName().equals(fragmentName) - || PowerPreferenceFragment.class.getName().equals(fragmentName) - || SecurityPreferenceFragment.class.getName().equals(fragmentName); - } + protected boolean isValidFragment(String fragmentName) + { + return PreferenceFragment.class.getName().equals(fragmentName) || + ClientPreferenceFragment.class.getName().equals(fragmentName) || + UiPreferenceFragment.class.getName().equals(fragmentName) || + PowerPreferenceFragment.class.getName().equals(fragmentName) || + SecurityPreferenceFragment.class.getName().equals(fragmentName); + } - @TargetApi(Build.VERSION_CODES.HONEYCOMB) - public static class ClientPreferenceFragment extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener { - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - addPreferencesFromResource(R.xml.settings_app_client); - SharedPreferences preferences = get(getActivity()); - preferences.registerOnSharedPreferenceChangeListener(this); - } + @TargetApi(Build.VERSION_CODES.HONEYCOMB) + public static class ClientPreferenceFragment + extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener + { + @Override public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.settings_app_client); + SharedPreferences preferences = get(getActivity()); + preferences.registerOnSharedPreferenceChangeListener(this); + } - @Override - public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { - if (isAdded()) { - final String clientNameKey = getString(R.string.preference_key_client_name); + @Override + public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) + { + if (isAdded()) + { + final String clientNameKey = getString(R.string.preference_key_client_name); - get(getActivity()); - if (key.equals(clientNameKey)) { - final String clientNameValue = sharedPreferences.getString(clientNameKey, ""); - EditTextPreference pref = (EditTextPreference) findPreference(clientNameKey); - pref.setText(clientNameValue); - } - } - } - } + get(getActivity()); + if (key.equals(clientNameKey)) + { + final String clientNameValue = sharedPreferences.getString(clientNameKey, ""); + EditTextPreference pref = (EditTextPreference)findPreference(clientNameKey); + pref.setText(clientNameValue); + } + } + } + } - @TargetApi(Build.VERSION_CODES.HONEYCOMB) - public static class UiPreferenceFragment extends PreferenceFragment { - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - addPreferencesFromResource(R.xml.settings_app_ui); - } - } + @TargetApi(Build.VERSION_CODES.HONEYCOMB) + public static class UiPreferenceFragment extends PreferenceFragment + { + @Override public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.settings_app_ui); + } + } - @TargetApi(Build.VERSION_CODES.HONEYCOMB) - public static class PowerPreferenceFragment extends PreferenceFragment { - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - addPreferencesFromResource(R.xml.settings_app_power); - } - } + @TargetApi(Build.VERSION_CODES.HONEYCOMB) + public static class PowerPreferenceFragment extends PreferenceFragment + { + @Override public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.settings_app_power); + } + } - @TargetApi(Build.VERSION_CODES.HONEYCOMB) - public static class SecurityPreferenceFragment extends PreferenceFragment { - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - addPreferencesFromResource(R.xml.settings_app_security); - } + @TargetApi(Build.VERSION_CODES.HONEYCOMB) + public static class SecurityPreferenceFragment extends PreferenceFragment + { + @Override public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.settings_app_security); + } - @Override - public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { - final String clear = getString(R.string.preference_key_security_clear_certificate_cache); - if (preference.getKey().equals(clear)) { - showDialog(); - return true; - } else { - return super.onPreferenceTreeClick(preferenceScreen, preference); - } - } + @Override + public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, + Preference preference) + { + final String clear = + getString(R.string.preference_key_security_clear_certificate_cache); + if (preference.getKey().equals(clear)) + { + showDialog(); + return true; + } + else + { + return super.onPreferenceTreeClick(preferenceScreen, preference); + } + } - private void showDialog() { - new AlertDialog.Builder(getActivity()) - .setTitle(R.string.dlg_title_clear_cert_cache) - .setMessage(R.string.dlg_msg_clear_cert_cache) - .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - clearCertificateCache(); - dialog.dismiss(); - } - }) - .setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - dialog.dismiss(); - } - }) - .setIcon(android.R.drawable.ic_delete) - .show(); - } + private void showDialog() + { + new AlertDialog.Builder(getActivity()) + .setTitle(R.string.dlg_title_clear_cert_cache) + .setMessage(R.string.dlg_msg_clear_cert_cache) + .setPositiveButton(android.R.string.ok, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) + { + clearCertificateCache(); + dialog.dismiss(); + } + }) + .setNegativeButton(android.R.string.cancel, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) + { + dialog.dismiss(); + } + }) + .setIcon(android.R.drawable.ic_delete) + .show(); + } - private boolean deleteDirectory(File dir) { - if (dir.isDirectory()) { - String[] children = dir.list(); - for (String file : children) { - if (!deleteDirectory(new File(dir, file))) - return false; - } - } - return dir.delete(); - } + private boolean deleteDirectory(File dir) + { + if (dir.isDirectory()) + { + String[] children = dir.list(); + for (String file : children) + { + if (!deleteDirectory(new File(dir, file))) + return false; + } + } + return dir.delete(); + } - private void clearCertificateCache() { - Context context = getActivity(); - if ((new File(context.getFilesDir() + "/.freerdp")).exists()) { - if (deleteDirectory(new File(context.getFilesDir() + "/.freerdp"))) - Toast.makeText(context, R.string.info_reset_success, Toast.LENGTH_LONG).show(); - else - Toast.makeText(context, R.string.info_reset_failed, Toast.LENGTH_LONG).show(); - } else - Toast.makeText(context, R.string.info_reset_success, Toast.LENGTH_LONG).show(); - } - } + private void clearCertificateCache() + { + Context context = getActivity(); + if ((new File(context.getFilesDir() + "/.freerdp")).exists()) + { + if (deleteDirectory(new File(context.getFilesDir() + "/.freerdp"))) + Toast.makeText(context, R.string.info_reset_success, Toast.LENGTH_LONG).show(); + else + Toast.makeText(context, R.string.info_reset_failed, Toast.LENGTH_LONG).show(); + } + else + Toast.makeText(context, R.string.info_reset_success, Toast.LENGTH_LONG).show(); + } + } - public static SharedPreferences get(Context context) { - Context appContext = context.getApplicationContext(); - PreferenceManager.setDefaultValues(appContext, R.xml.settings_app_client, false); - PreferenceManager.setDefaultValues(appContext, R.xml.settings_app_power, false); - PreferenceManager.setDefaultValues(appContext, R.xml.settings_app_security, false); - PreferenceManager.setDefaultValues(appContext, R.xml.settings_app_ui, false); - SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(appContext); + public static SharedPreferences get(Context context) + { + Context appContext = context.getApplicationContext(); + PreferenceManager.setDefaultValues(appContext, R.xml.settings_app_client, false); + PreferenceManager.setDefaultValues(appContext, R.xml.settings_app_power, false); + PreferenceManager.setDefaultValues(appContext, R.xml.settings_app_security, false); + PreferenceManager.setDefaultValues(appContext, R.xml.settings_app_ui, false); + SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(appContext); - final String key = context.getString(R.string.preference_key_client_name); - final String value = preferences.getString(key, ""); - if (value.isEmpty()) { - final String android_id = UUID.randomUUID().toString(); - final String defaultValue = context.getString(R.string.preference_default_client_name); - final String name = defaultValue + "-" + android_id; - preferences.edit().putString(key, name.substring(0, 31)).apply(); - } + final String key = context.getString(R.string.preference_key_client_name); + final String value = preferences.getString(key, ""); + if (value.isEmpty()) + { + final String android_id = UUID.randomUUID().toString(); + final String defaultValue = context.getString(R.string.preference_default_client_name); + final String name = defaultValue + "-" + android_id; + preferences.edit().putString(key, name.substring(0, 31)).apply(); + } - return preferences; - } + return preferences; + } - public static int getDisconnectTimeout(Context context) { - SharedPreferences preferences = get(context); - return preferences.getInt(context.getString(R.string.preference_key_power_disconnect_timeout), 0); - } + public static int getDisconnectTimeout(Context context) + { + SharedPreferences preferences = get(context); + return preferences.getInt( + context.getString(R.string.preference_key_power_disconnect_timeout), 0); + } - public static boolean getHideStatusBar(Context context) { - SharedPreferences preferences = get(context); - return preferences.getBoolean(context.getString(R.string.preference_key_ui_hide_status_bar), false); - } + public static boolean getHideStatusBar(Context context) + { + SharedPreferences preferences = get(context); + return preferences.getBoolean(context.getString(R.string.preference_key_ui_hide_status_bar), + false); + } - public static boolean getHideActionBar(Context context) { - SharedPreferences preferences = get(context); - return preferences.getBoolean(context.getString(R.string.preference_key_ui_hide_action_bar), false); - } + public static boolean getHideActionBar(Context context) + { + SharedPreferences preferences = get(context); + return preferences.getBoolean(context.getString(R.string.preference_key_ui_hide_action_bar), + false); + } - public static boolean getAcceptAllCertificates(Context context) { - SharedPreferences preferences = get(context); - return preferences.getBoolean(context.getString(R.string.preference_key_accept_certificates), false); - } + public static boolean getAcceptAllCertificates(Context context) + { + SharedPreferences preferences = get(context); + return preferences.getBoolean( + context.getString(R.string.preference_key_accept_certificates), false); + } - public static boolean getHideZoomControls(Context context) { - SharedPreferences preferences = get(context); - return preferences.getBoolean(context.getString(R.string.preference_key_ui_hide_zoom_controls), false); - } + public static boolean getHideZoomControls(Context context) + { + SharedPreferences preferences = get(context); + return preferences.getBoolean( + context.getString(R.string.preference_key_ui_hide_zoom_controls), false); + } - public static boolean getSwapMouseButtons(Context context) { - SharedPreferences preferences = get(context); - return preferences.getBoolean(context.getString(R.string.preference_key_ui_swap_mouse_buttons), false); - } + public static boolean getSwapMouseButtons(Context context) + { + SharedPreferences preferences = get(context); + return preferences.getBoolean( + context.getString(R.string.preference_key_ui_swap_mouse_buttons), false); + } - public static boolean getInvertScrolling(Context context) { - SharedPreferences preferences = get(context); - return preferences.getBoolean(context.getString(R.string.preference_key_ui_invert_scrolling), false); - } + public static boolean getInvertScrolling(Context context) + { + SharedPreferences preferences = get(context); + return preferences.getBoolean( + context.getString(R.string.preference_key_ui_invert_scrolling), false); + } - public static boolean getAskOnExit(Context context) { - SharedPreferences preferences = get(context); - return preferences.getBoolean(context.getString(R.string.preference_key_ui_ask_on_exit), false); - } + public static boolean getAskOnExit(Context context) + { + SharedPreferences preferences = get(context); + return preferences.getBoolean(context.getString(R.string.preference_key_ui_ask_on_exit), + false); + } - public static boolean getAutoScrollTouchPointer(Context context) { - SharedPreferences preferences = get(context); - return preferences.getBoolean(context.getString(R.string.preference_key_ui_auto_scroll_touchpointer), false); - } + public static boolean getAutoScrollTouchPointer(Context context) + { + SharedPreferences preferences = get(context); + return preferences.getBoolean( + context.getString(R.string.preference_key_ui_auto_scroll_touchpointer), false); + } - public static String getClientName(Context context) { - SharedPreferences preferences = get(context); - return preferences.getString(context.getString(R.string.preference_key_client_name), ""); - } + public static String getClientName(Context context) + { + SharedPreferences preferences = get(context); + return preferences.getString(context.getString(R.string.preference_key_client_name), ""); + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/BookmarkActivity.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/BookmarkActivity.java index 232039d79..89ac4d4c5 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/BookmarkActivity.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/BookmarkActivity.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.presentation; @@ -36,659 +37,707 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; -public class BookmarkActivity extends PreferenceActivity implements - OnSharedPreferenceChangeListener { - public static final String PARAM_CONNECTION_REFERENCE = "conRef"; - - private static final String TAG = "BookmarkActivity"; - private static final int PREFERENCES_BOOKMARK = 1; - private static final int PREFERENCES_CREDENTIALS = 2; - private static final int PREFERENCES_SCREEN = 3; - private static final int PREFERENCES_PERFORMANCE = 4; - private static final int PREFERENCES_ADVANCED = 5; - private static final int PREFERENCES_SCREEN3G = 6; - private static final int PREFERENCES_PERFORMANCE3G = 7; - private static final int PREFERENCES_GATEWAY = 8; - private static final int PREFERENCES_DEBUG = 9; - // bookmark needs to be static because the activity is started for each - // subview - // (we have to do this because Android has a bug where the style for - // Preferences - // is only applied to the first PreferenceScreen but not to subsequent ones) - private static BookmarkBase bookmark = null; - private static boolean settings_changed = false; - private static boolean new_bookmark = false; - private int current_preferences; - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - PreferenceManager mgr = getPreferenceManager(); - // init shared preferences for activity - mgr.setSharedPreferencesName("TEMP"); - mgr.setSharedPreferencesMode(MODE_PRIVATE); - - if (bookmark == null) { - // if we have a bookmark id set in the extras we are in edit mode - Bundle bundle = getIntent().getExtras(); - if (bundle != null) { - // See if we got a connection reference to a bookmark - if (bundle.containsKey(PARAM_CONNECTION_REFERENCE)) { - String refStr = bundle - .getString(PARAM_CONNECTION_REFERENCE); - if (ConnectionReference.isManualBookmarkReference(refStr)) { - bookmark = GlobalApp.getManualBookmarkGateway() - .findById( - ConnectionReference - .getManualBookmarkId(refStr)); - new_bookmark = false; - } else if (ConnectionReference.isHostnameReference(refStr)) { - bookmark = new ManualBookmark(); - bookmark.get().setLabel( - ConnectionReference.getHostname(refStr)); - bookmark.get().setHostname( - ConnectionReference.getHostname(refStr)); - new_bookmark = true; - } else if (ConnectionReference.isFileReference(refStr)) { - String file = ConnectionReference.getFile(refStr); - - bookmark = new ManualBookmark(); - bookmark.setLabel(file); - - try { - RDPFileParser rdpFile = new RDPFileParser(file); - updateBookmarkFromFile((ManualBookmark) bookmark, - rdpFile); - - bookmark.setLabel(new File(file).getName()); - new_bookmark = true; - } catch (IOException e) { - Log.e(TAG, "Failed reading RDP file", e); - } - } - } - } - - // last chance - ensure we really have a valid bookmark - if (bookmark == null) - bookmark = new ManualBookmark(); - - // hide gateway settings if we edit a non-manual bookmark - if (current_preferences == PREFERENCES_ADVANCED - && bookmark.getType() != ManualBookmark.TYPE_MANUAL) { - PreferenceScreen screen = getPreferenceScreen(); - screen.removePreference(findPreference("bookmark.enable_gateway")); - screen.removePreference(findPreference("bookmark.gateway")); - } - - updateH264Preferences(); - - // update preferences from bookmark - bookmark.writeToSharedPreferences(mgr.getSharedPreferences()); - - // no settings changed yet - settings_changed = false; - } - - // load the requested settings resource - if (getIntent() == null || getIntent().getData() == null) { - addPreferencesFromResource(R.xml.bookmark_settings); - current_preferences = PREFERENCES_BOOKMARK; - } else if (getIntent().getData().toString() - .equals("preferences://screen_settings")) { - addPreferencesFromResource(R.xml.screen_settings); - current_preferences = PREFERENCES_SCREEN; - } else if (getIntent().getData().toString() - .equals("preferences://performance_flags")) { - addPreferencesFromResource(R.xml.performance_flags); - current_preferences = PREFERENCES_PERFORMANCE; - } else if (getIntent().getData().toString() - .equals("preferences://screen_settings_3g")) { - addPreferencesFromResource(R.xml.screen_settings_3g); - current_preferences = PREFERENCES_SCREEN3G; - } else if (getIntent().getData().toString() - .equals("preferences://performance_flags_3g")) { - addPreferencesFromResource(R.xml.performance_flags_3g); - current_preferences = PREFERENCES_PERFORMANCE3G; - } else if (getIntent().getData().toString() - .equals("preferences://advanced_settings")) { - addPreferencesFromResource(R.xml.advanced_settings); - current_preferences = PREFERENCES_ADVANCED; - } else if (getIntent().getData().toString() - .equals("preferences://credentials_settings")) { - addPreferencesFromResource(R.xml.credentials_settings); - current_preferences = PREFERENCES_CREDENTIALS; - } else if (getIntent().getData().toString() - .equals("preferences://gateway_settings")) { - addPreferencesFromResource(R.xml.gateway_settings); - current_preferences = PREFERENCES_GATEWAY; - } else if (getIntent().getData().toString() - .equals("preferences://debug_settings")) { - addPreferencesFromResource(R.xml.debug_settings); - current_preferences = PREFERENCES_DEBUG; - } else { - addPreferencesFromResource(R.xml.bookmark_settings); - current_preferences = PREFERENCES_BOOKMARK; - } - - // update UI with bookmark data - SharedPreferences spref = mgr.getSharedPreferences(); - initSettings(spref); - - // register for preferences changed notification - mgr.getSharedPreferences().registerOnSharedPreferenceChangeListener(this); - - // set the correct component names in our preferencescreen settings - setIntentComponentNames(); - - updateH264Preferences(); - } - - private void updateH264Preferences() { - if (!LibFreeRDP.hasH264Support()) { - final int preferenceIdList[] = { - R.string.preference_key_h264, - R.string.preference_key_h264_3g - }; - - PreferenceManager mgr = getPreferenceManager(); - for (int id : preferenceIdList) { - final String key = getString(id); - Preference preference = mgr.findPreference(key); - if (preference != null) { - preference.setEnabled(false); - } - } - } - } - - private void updateBookmarkFromFile(ManualBookmark bookmark, - RDPFileParser rdpFile) { - String s; - Integer i; - - s = rdpFile.getString("full address"); - if (s != null) { - // this gets complicated as it can include port - if (s.lastIndexOf(":") > s.lastIndexOf("]")) { - try { - String port = s.substring(s.lastIndexOf(":") + 1); - bookmark.setPort(Integer.parseInt(port)); - } catch (NumberFormatException e) { - Log.e(TAG, "Malformed address"); - } - - s = s.substring(0, s.lastIndexOf(":")); - } - - // or even be an ipv6 address - if (s.startsWith("[") && s.endsWith("]")) - s = s.substring(1, s.length() - 1); - - bookmark.setHostname(s); - } - - i = rdpFile.getInteger("server port"); - if (i != null) - bookmark.setPort(i); - - s = rdpFile.getString("username"); - if (s != null) - bookmark.setUsername(s); - - s = rdpFile.getString("domain"); - if (s != null) - bookmark.setDomain(s); - - i = rdpFile.getInteger("connect to console"); - if (i != null) - bookmark.getAdvancedSettings().setConsoleMode(i == 1); - } - - private void setIntentComponentNames() { - // we set the component name for our sub-activity calls here because we - // don't know the package - // name of the main app in our library project. - ComponentName compName = new ComponentName(getPackageName(), - BookmarkActivity.class.getName()); - ArrayList prefKeys = new ArrayList(); - - prefKeys.add("bookmark.credentials"); - prefKeys.add("bookmark.screen"); - prefKeys.add("bookmark.performance"); - prefKeys.add("bookmark.advanced"); - prefKeys.add("bookmark.screen_3g"); - prefKeys.add("bookmark.performance_3g"); - prefKeys.add("bookmark.gateway_settings"); - prefKeys.add("bookmark.debug"); - - for (String p : prefKeys) { - Preference pref = findPreference(p); - if (pref != null) - pref.getIntent().setComponent(compName); - } - } - - @Override - public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, - String key) { - settings_changed = true; - switch (current_preferences) { - case PREFERENCES_DEBUG: - debugSettingsChanged(sharedPreferences, key); - break; - - case PREFERENCES_BOOKMARK: - bookmarkSettingsChanged(sharedPreferences, key); - break; - - case PREFERENCES_ADVANCED: - advancedSettingsChanged(sharedPreferences, key); - break; - - case PREFERENCES_CREDENTIALS: - credentialsSettingsChanged(sharedPreferences, key); - break; - - case PREFERENCES_SCREEN: - case PREFERENCES_SCREEN3G: - screenSettingsChanged(sharedPreferences, key); - break; - - case PREFERENCES_GATEWAY: - gatewaySettingsChanged(sharedPreferences, key); - break; - - default: - break; - } - - } - - private void initSettings(SharedPreferences sharedPreferences) { - switch (current_preferences) { - case PREFERENCES_BOOKMARK: - initBookmarkSettings(sharedPreferences); - break; - - case PREFERENCES_ADVANCED: - initAdvancedSettings(sharedPreferences); - break; - - case PREFERENCES_CREDENTIALS: - initCredentialsSettings(sharedPreferences); - break; - - case PREFERENCES_SCREEN: - initScreenSettings(sharedPreferences); - break; - - case PREFERENCES_SCREEN3G: - initScreenSettings3G(sharedPreferences); - break; - - case PREFERENCES_GATEWAY: - initGatewaySettings(sharedPreferences); - break; - - case PREFERENCES_DEBUG: - initDebugSettings(sharedPreferences); - break; - - default: - break; - } - } - - private void initBookmarkSettings(SharedPreferences sharedPreferences) { - bookmarkSettingsChanged(sharedPreferences, "bookmark.label"); - bookmarkSettingsChanged(sharedPreferences, "bookmark.hostname"); - bookmarkSettingsChanged(sharedPreferences, "bookmark.port"); - bookmarkSettingsChanged(sharedPreferences, "bookmark.username"); - bookmarkSettingsChanged(sharedPreferences, "bookmark.resolution"); - } - - private void bookmarkSettingsChanged(SharedPreferences sharedPreferences, - String key) { - if (key.equals("bookmark.label") && findPreference(key) != null) - findPreference(key) - .setSummary(sharedPreferences.getString(key, "")); - else if (key.equals("bookmark.hostname") && findPreference(key) != null) - findPreference(key) - .setSummary(sharedPreferences.getString(key, "")); - else if (key.equals("bookmark.port") && findPreference(key) != null) - findPreference(key).setSummary( - String.valueOf(sharedPreferences.getInt(key, -1))); - else if (key.equals("bookmark.username")) { - String username = sharedPreferences.getString(key, ""); - if (username.length() == 0) - username = ""; - findPreference("bookmark.credentials").setSummary(username); - } else if (key.equals("bookmark.resolution") - || key.equals("bookmark.colors") - || key.equals("bookmark.width") - || key.equals("bookmark.height")) { - String resolution = sharedPreferences.getString( - "bookmark.resolution", "800x600"); - // compare english string from resolutions_values_array array, - // decode to localized - // text for display - if (resolution.equals("automatic")) { - resolution = getResources().getString( - R.string.resolution_automatic); - } - if (resolution.equals("custom")) { - resolution = getResources().getString( - R.string.resolution_custom); - } - if (resolution.equals("fitscreen")) { - resolution = getResources().getString(R.string.resolution_fit); - } - resolution += "@" + sharedPreferences.getInt("bookmark.colors", 16); - findPreference("bookmark.screen").setSummary(resolution); - } - } - - private void initAdvancedSettings(SharedPreferences sharedPreferences) { - advancedSettingsChanged(sharedPreferences, - "bookmark.enable_gateway_settings"); - advancedSettingsChanged(sharedPreferences, - "bookmark.enable_3g_settings"); - advancedSettingsChanged(sharedPreferences, "bookmark.security"); - advancedSettingsChanged(sharedPreferences, "bookmark.resolution_3g"); - advancedSettingsChanged(sharedPreferences, "bookmark.remote_program"); - advancedSettingsChanged(sharedPreferences, "bookmark.work_dir"); - } - - private void advancedSettingsChanged(SharedPreferences sharedPreferences, - String key) { - if (key.equals("bookmark.enable_gateway_settings")) { - boolean enabled = sharedPreferences.getBoolean(key, false); - findPreference("bookmark.gateway_settings").setEnabled(enabled); - } else if (key.equals("bookmark.enable_3g_settings")) { - boolean enabled = sharedPreferences.getBoolean(key, false); - findPreference("bookmark.screen_3g").setEnabled(enabled); - findPreference("bookmark.performance_3g").setEnabled(enabled); - } else if (key.equals("bookmark.security")) { - ListPreference listPreference = (ListPreference) findPreference(key); - CharSequence security = listPreference.getEntries()[sharedPreferences - .getInt(key, 0)]; - listPreference.setSummary(security); - } else if (key.equals("bookmark.resolution_3g") - || key.equals("bookmark.colors_3g") - || key.equals("bookmark.width_3g") - || key.equals("bookmark.height_3g")) { - String resolution = sharedPreferences.getString( - "bookmark.resolution_3g", "800x600"); - if (resolution.equals("automatic")) - resolution = getResources().getString( - R.string.resolution_automatic); - else if (resolution.equals("custom")) - resolution = getResources().getString( - R.string.resolution_custom); - resolution += "@" - + sharedPreferences.getInt("bookmark.colors_3g", 16); - findPreference("bookmark.screen_3g").setSummary(resolution); - } else if (key.equals("bookmark.remote_program")) - findPreference(key) - .setSummary(sharedPreferences.getString(key, "")); - else if (key.equals("bookmark.work_dir")) - findPreference(key) - .setSummary(sharedPreferences.getString(key, "")); - } - - private void initCredentialsSettings(SharedPreferences sharedPreferences) { - credentialsSettingsChanged(sharedPreferences, "bookmark.username"); - credentialsSettingsChanged(sharedPreferences, "bookmark.password"); - credentialsSettingsChanged(sharedPreferences, "bookmark.domain"); - } - - private void credentialsSettingsChanged( - SharedPreferences sharedPreferences, String key) { - if (key.equals("bookmark.username")) - findPreference(key) - .setSummary(sharedPreferences.getString(key, "")); - else if (key.equals("bookmark.password")) { - if (sharedPreferences.getString(key, "").length() == 0) - findPreference(key).setSummary( - getResources().getString( - R.string.settings_password_empty)); - else - findPreference(key).setSummary( - getResources().getString( - R.string.settings_password_present)); - } else if (key.equals("bookmark.domain")) - findPreference(key) - .setSummary(sharedPreferences.getString(key, "")); - } - - private void initScreenSettings(SharedPreferences sharedPreferences) { - screenSettingsChanged(sharedPreferences, "bookmark.colors"); - screenSettingsChanged(sharedPreferences, "bookmark.resolution"); - screenSettingsChanged(sharedPreferences, "bookmark.width"); - screenSettingsChanged(sharedPreferences, "bookmark.height"); - } - - private void initScreenSettings3G(SharedPreferences sharedPreferences) { - screenSettingsChanged(sharedPreferences, "bookmark.colors_3g"); - screenSettingsChanged(sharedPreferences, "bookmark.resolution_3g"); - screenSettingsChanged(sharedPreferences, "bookmark.width_3g"); - screenSettingsChanged(sharedPreferences, "bookmark.height_3g"); - } - - private void screenSettingsChanged(SharedPreferences sharedPreferences, - String key) { - // could happen during initialization because 3g and non-3g settings - // share this routine - just skip - if (findPreference(key) == null) - return; - - if (key.equals("bookmark.colors") || key.equals("bookmark.colors_3g")) { - ListPreference listPreference = (ListPreference) findPreference(key); - listPreference.setSummary(listPreference.getEntry()); - } else if (key.equals("bookmark.resolution") - || key.equals("bookmark.resolution_3g")) { - ListPreference listPreference = (ListPreference) findPreference(key); - listPreference.setSummary(listPreference.getEntry()); - - String value = listPreference.getValue(); - boolean enabled = value.equalsIgnoreCase("custom"); - if (key.equals("bookmark.resolution")) { - findPreference("bookmark.width").setEnabled(enabled); - findPreference("bookmark.height").setEnabled(enabled); - } else { - findPreference("bookmark.width_3g").setEnabled(enabled); - findPreference("bookmark.height_3g").setEnabled(enabled); - } - } else if (key.equals("bookmark.width") - || key.equals("bookmark.width_3g")) - findPreference(key).setSummary( - String.valueOf(sharedPreferences.getInt(key, 800))); - else if (key.equals("bookmark.height") - || key.equals("bookmark.height_3g")) - findPreference(key).setSummary( - String.valueOf(sharedPreferences.getInt(key, 600))); - } - - private void initDebugSettings(SharedPreferences sharedPreferences) { - debugSettingsChanged(sharedPreferences, "bookmark.debug_level"); - debugSettingsChanged(sharedPreferences, "bookmark.async_channel"); - debugSettingsChanged(sharedPreferences, "bookmark.async_update"); - debugSettingsChanged(sharedPreferences, "bookmark.async_input"); - } - - private void initGatewaySettings(SharedPreferences sharedPreferences) { - gatewaySettingsChanged(sharedPreferences, "bookmark.gateway_hostname"); - gatewaySettingsChanged(sharedPreferences, "bookmark.gateway_port"); - gatewaySettingsChanged(sharedPreferences, "bookmark.gateway_username"); - gatewaySettingsChanged(sharedPreferences, "bookmark.gateway_password"); - gatewaySettingsChanged(sharedPreferences, "bookmark.gateway_domain"); - } - - private void debugSettingsChanged(SharedPreferences sharedPreferences, - String key) { - if (key.equals("bookmark.debug_level")) { - String level = sharedPreferences.getString(key, "INFO"); - Preference pref = findPreference("bookmark.debug_level"); - pref.setDefaultValue(level); - } else if (key.equals("bookmark.async_channel")) { - boolean enabled = sharedPreferences.getBoolean(key, false); - Preference pref = findPreference("bookmark.async_channel"); - pref.setDefaultValue(enabled); - } else if (key.equals("bookmark.async_update")) { - boolean enabled = sharedPreferences.getBoolean(key, false); - Preference pref = findPreference("bookmark.async_update"); - pref.setDefaultValue(enabled); - } else if (key.equals("bookmark.async_input")) { - boolean enabled = sharedPreferences.getBoolean(key, false); - Preference pref = findPreference("bookmark.async_input"); - pref.setDefaultValue(enabled); - } - } - - private void gatewaySettingsChanged(SharedPreferences sharedPreferences, - String key) { - if (key.equals("bookmark.gateway_hostname")) { - findPreference(key) - .setSummary(sharedPreferences.getString(key, "")); - } else if (key.equals("bookmark.gateway_port")) { - findPreference(key).setSummary( - String.valueOf(sharedPreferences.getInt(key, 443))); - } else if (key.equals("bookmark.gateway_username")) { - findPreference(key) - .setSummary(sharedPreferences.getString(key, "")); - } else if (key.equals("bookmark.gateway_password")) { - if (sharedPreferences.getString(key, "").length() == 0) - findPreference(key).setSummary( - getResources().getString( - R.string.settings_password_empty)); - else - findPreference(key).setSummary( - getResources().getString( - R.string.settings_password_present)); - } else if (key.equals("bookmark.gateway_domain")) - findPreference(key) - .setSummary(sharedPreferences.getString(key, "")); - } - - private boolean verifySettings(SharedPreferences sharedPreferences) { - - boolean verifyFailed = false; - // perform sanity checks on settings - // Label set - if (sharedPreferences.getString("bookmark.label", "").length() == 0) - verifyFailed = true; - - // Server and port specified - if (!verifyFailed - && sharedPreferences.getString("bookmark.hostname", "") - .length() == 0) - verifyFailed = true; - - // Server and port specified - if (!verifyFailed && sharedPreferences.getInt("bookmark.port", -1) <= 0) - verifyFailed = true; - - // if an error occurred - display toast and return false - return (!verifyFailed); - } - - private void finishAndResetBookmark() { - bookmark = null; - getPreferenceManager().getSharedPreferences() - .unregisterOnSharedPreferenceChangeListener(this); - finish(); - } - - @Override - public void onBackPressed() { - // only proceed if we are in the main preferences screen - if (current_preferences != PREFERENCES_BOOKMARK) { - super.onBackPressed(); - getPreferenceManager().getSharedPreferences() - .unregisterOnSharedPreferenceChangeListener(this); - return; - } - - SharedPreferences sharedPreferences = getPreferenceManager() - .getSharedPreferences(); - if (!verifySettings(sharedPreferences)) { - // ask the user if he wants to cancel or continue editing - AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setTitle(R.string.error_bookmark_incomplete_title) - .setMessage(R.string.error_bookmark_incomplete) - .setPositiveButton(R.string.cancel, - new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, - int which) { - finishAndResetBookmark(); - } - }) - .setNegativeButton(R.string.cont, - new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, - int which) { - dialog.cancel(); - } - }).show(); - - return; - } else { - // ask the user if he wants to save or cancel editing if a setting - // has changed - if (new_bookmark || settings_changed) { - AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setTitle(R.string.dlg_title_save_bookmark) - .setMessage(R.string.dlg_save_bookmark) - .setPositiveButton(R.string.yes, - new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, - int which) { - // read shared prefs back to bookmark - bookmark.readFromSharedPreferences(getPreferenceManager() - .getSharedPreferences()); - - BookmarkBaseGateway bookmarkGateway; - if (bookmark.getType() == BookmarkBase.TYPE_MANUAL) { - bookmarkGateway = GlobalApp - .getManualBookmarkGateway(); - // remove any history entry for this - // bookmark - GlobalApp - .getQuickConnectHistoryGateway() - .removeHistoryItem( - bookmark.get() - .getHostname()); - } else { - assert false; - return; - } - - // insert or update bookmark and leave - // activity - if (bookmark.getId() > 0) - bookmarkGateway.update(bookmark); - else - bookmarkGateway.insert(bookmark); - - finishAndResetBookmark(); - } - }) - .setNegativeButton(R.string.no, - new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, - int which) { - finishAndResetBookmark(); - } - }).show(); - } else { - finishAndResetBookmark(); - } - } - } +public class BookmarkActivity extends PreferenceActivity implements OnSharedPreferenceChangeListener +{ + public static final String PARAM_CONNECTION_REFERENCE = "conRef"; + + private static final String TAG = "BookmarkActivity"; + private static final int PREFERENCES_BOOKMARK = 1; + private static final int PREFERENCES_CREDENTIALS = 2; + private static final int PREFERENCES_SCREEN = 3; + private static final int PREFERENCES_PERFORMANCE = 4; + private static final int PREFERENCES_ADVANCED = 5; + private static final int PREFERENCES_SCREEN3G = 6; + private static final int PREFERENCES_PERFORMANCE3G = 7; + private static final int PREFERENCES_GATEWAY = 8; + private static final int PREFERENCES_DEBUG = 9; + // bookmark needs to be static because the activity is started for each + // subview + // (we have to do this because Android has a bug where the style for + // Preferences + // is only applied to the first PreferenceScreen but not to subsequent ones) + private static BookmarkBase bookmark = null; + private static boolean settings_changed = false; + private static boolean new_bookmark = false; + private int current_preferences; + + @Override public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + + PreferenceManager mgr = getPreferenceManager(); + // init shared preferences for activity + mgr.setSharedPreferencesName("TEMP"); + mgr.setSharedPreferencesMode(MODE_PRIVATE); + + if (bookmark == null) + { + // if we have a bookmark id set in the extras we are in edit mode + Bundle bundle = getIntent().getExtras(); + if (bundle != null) + { + // See if we got a connection reference to a bookmark + if (bundle.containsKey(PARAM_CONNECTION_REFERENCE)) + { + String refStr = bundle.getString(PARAM_CONNECTION_REFERENCE); + if (ConnectionReference.isManualBookmarkReference(refStr)) + { + bookmark = GlobalApp.getManualBookmarkGateway().findById( + ConnectionReference.getManualBookmarkId(refStr)); + new_bookmark = false; + } + else if (ConnectionReference.isHostnameReference(refStr)) + { + bookmark = new ManualBookmark(); + bookmark.get().setLabel( + ConnectionReference.getHostname(refStr)); + bookmark.get().setHostname( + ConnectionReference.getHostname(refStr)); + new_bookmark = true; + } + else if (ConnectionReference.isFileReference(refStr)) + { + String file = ConnectionReference.getFile(refStr); + + bookmark = new ManualBookmark(); + bookmark.setLabel(file); + + try + { + RDPFileParser rdpFile = new RDPFileParser(file); + updateBookmarkFromFile((ManualBookmark)bookmark, rdpFile); + + bookmark.setLabel(new File(file).getName()); + new_bookmark = true; + } + catch (IOException e) + { + Log.e(TAG, "Failed reading RDP file", e); + } + } + } + } + + // last chance - ensure we really have a valid bookmark + if (bookmark == null) + bookmark = new ManualBookmark(); + + // hide gateway settings if we edit a non-manual bookmark + if (current_preferences == PREFERENCES_ADVANCED && + bookmark.getType() != ManualBookmark.TYPE_MANUAL) + { + PreferenceScreen screen = getPreferenceScreen(); + screen.removePreference(findPreference("bookmark.enable_gateway")); + screen.removePreference(findPreference("bookmark.gateway")); + } + + updateH264Preferences(); + + // update preferences from bookmark + bookmark.writeToSharedPreferences(mgr.getSharedPreferences()); + + // no settings changed yet + settings_changed = false; + } + + // load the requested settings resource + if (getIntent() == null || getIntent().getData() == null) + { + addPreferencesFromResource(R.xml.bookmark_settings); + current_preferences = PREFERENCES_BOOKMARK; + } + else if (getIntent().getData().toString().equals("preferences://screen_settings")) + { + addPreferencesFromResource(R.xml.screen_settings); + current_preferences = PREFERENCES_SCREEN; + } + else if (getIntent().getData().toString().equals("preferences://performance_flags")) + { + addPreferencesFromResource(R.xml.performance_flags); + current_preferences = PREFERENCES_PERFORMANCE; + } + else if (getIntent().getData().toString().equals("preferences://screen_settings_3g")) + { + addPreferencesFromResource(R.xml.screen_settings_3g); + current_preferences = PREFERENCES_SCREEN3G; + } + else if (getIntent().getData().toString().equals("preferences://performance_flags_3g")) + { + addPreferencesFromResource(R.xml.performance_flags_3g); + current_preferences = PREFERENCES_PERFORMANCE3G; + } + else if (getIntent().getData().toString().equals("preferences://advanced_settings")) + { + addPreferencesFromResource(R.xml.advanced_settings); + current_preferences = PREFERENCES_ADVANCED; + } + else if (getIntent().getData().toString().equals("preferences://credentials_settings")) + { + addPreferencesFromResource(R.xml.credentials_settings); + current_preferences = PREFERENCES_CREDENTIALS; + } + else if (getIntent().getData().toString().equals("preferences://gateway_settings")) + { + addPreferencesFromResource(R.xml.gateway_settings); + current_preferences = PREFERENCES_GATEWAY; + } + else if (getIntent().getData().toString().equals("preferences://debug_settings")) + { + addPreferencesFromResource(R.xml.debug_settings); + current_preferences = PREFERENCES_DEBUG; + } + else + { + addPreferencesFromResource(R.xml.bookmark_settings); + current_preferences = PREFERENCES_BOOKMARK; + } + + // update UI with bookmark data + SharedPreferences spref = mgr.getSharedPreferences(); + initSettings(spref); + + // register for preferences changed notification + mgr.getSharedPreferences().registerOnSharedPreferenceChangeListener(this); + + // set the correct component names in our preferencescreen settings + setIntentComponentNames(); + + updateH264Preferences(); + } + + private void updateH264Preferences() + { + if (!LibFreeRDP.hasH264Support()) + { + final int preferenceIdList[] = { R.string.preference_key_h264, + R.string.preference_key_h264_3g }; + + PreferenceManager mgr = getPreferenceManager(); + for (int id : preferenceIdList) + { + final String key = getString(id); + Preference preference = mgr.findPreference(key); + if (preference != null) + { + preference.setEnabled(false); + } + } + } + } + + private void updateBookmarkFromFile(ManualBookmark bookmark, RDPFileParser rdpFile) + { + String s; + Integer i; + + s = rdpFile.getString("full address"); + if (s != null) + { + // this gets complicated as it can include port + if (s.lastIndexOf(":") > s.lastIndexOf("]")) + { + try + { + String port = s.substring(s.lastIndexOf(":") + 1); + bookmark.setPort(Integer.parseInt(port)); + } + catch (NumberFormatException e) + { + Log.e(TAG, "Malformed address"); + } + + s = s.substring(0, s.lastIndexOf(":")); + } + + // or even be an ipv6 address + if (s.startsWith("[") && s.endsWith("]")) + s = s.substring(1, s.length() - 1); + + bookmark.setHostname(s); + } + + i = rdpFile.getInteger("server port"); + if (i != null) + bookmark.setPort(i); + + s = rdpFile.getString("username"); + if (s != null) + bookmark.setUsername(s); + + s = rdpFile.getString("domain"); + if (s != null) + bookmark.setDomain(s); + + i = rdpFile.getInteger("connect to console"); + if (i != null) + bookmark.getAdvancedSettings().setConsoleMode(i == 1); + } + + private void setIntentComponentNames() + { + // we set the component name for our sub-activity calls here because we + // don't know the package + // name of the main app in our library project. + ComponentName compName = + new ComponentName(getPackageName(), BookmarkActivity.class.getName()); + ArrayList prefKeys = new ArrayList(); + + prefKeys.add("bookmark.credentials"); + prefKeys.add("bookmark.screen"); + prefKeys.add("bookmark.performance"); + prefKeys.add("bookmark.advanced"); + prefKeys.add("bookmark.screen_3g"); + prefKeys.add("bookmark.performance_3g"); + prefKeys.add("bookmark.gateway_settings"); + prefKeys.add("bookmark.debug"); + + for (String p : prefKeys) + { + Preference pref = findPreference(p); + if (pref != null) + pref.getIntent().setComponent(compName); + } + } + + @Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) + { + settings_changed = true; + switch (current_preferences) + { + case PREFERENCES_DEBUG: + debugSettingsChanged(sharedPreferences, key); + break; + + case PREFERENCES_BOOKMARK: + bookmarkSettingsChanged(sharedPreferences, key); + break; + + case PREFERENCES_ADVANCED: + advancedSettingsChanged(sharedPreferences, key); + break; + + case PREFERENCES_CREDENTIALS: + credentialsSettingsChanged(sharedPreferences, key); + break; + + case PREFERENCES_SCREEN: + case PREFERENCES_SCREEN3G: + screenSettingsChanged(sharedPreferences, key); + break; + + case PREFERENCES_GATEWAY: + gatewaySettingsChanged(sharedPreferences, key); + break; + + default: + break; + } + } + + private void initSettings(SharedPreferences sharedPreferences) + { + switch (current_preferences) + { + case PREFERENCES_BOOKMARK: + initBookmarkSettings(sharedPreferences); + break; + + case PREFERENCES_ADVANCED: + initAdvancedSettings(sharedPreferences); + break; + + case PREFERENCES_CREDENTIALS: + initCredentialsSettings(sharedPreferences); + break; + + case PREFERENCES_SCREEN: + initScreenSettings(sharedPreferences); + break; + + case PREFERENCES_SCREEN3G: + initScreenSettings3G(sharedPreferences); + break; + + case PREFERENCES_GATEWAY: + initGatewaySettings(sharedPreferences); + break; + + case PREFERENCES_DEBUG: + initDebugSettings(sharedPreferences); + break; + + default: + break; + } + } + + private void initBookmarkSettings(SharedPreferences sharedPreferences) + { + bookmarkSettingsChanged(sharedPreferences, "bookmark.label"); + bookmarkSettingsChanged(sharedPreferences, "bookmark.hostname"); + bookmarkSettingsChanged(sharedPreferences, "bookmark.port"); + bookmarkSettingsChanged(sharedPreferences, "bookmark.username"); + bookmarkSettingsChanged(sharedPreferences, "bookmark.resolution"); + } + + private void bookmarkSettingsChanged(SharedPreferences sharedPreferences, String key) + { + if (key.equals("bookmark.label") && findPreference(key) != null) + findPreference(key).setSummary(sharedPreferences.getString(key, "")); + else if (key.equals("bookmark.hostname") && findPreference(key) != null) + findPreference(key).setSummary(sharedPreferences.getString(key, "")); + else if (key.equals("bookmark.port") && findPreference(key) != null) + findPreference(key).setSummary(String.valueOf(sharedPreferences.getInt(key, -1))); + else if (key.equals("bookmark.username")) + { + String username = sharedPreferences.getString(key, ""); + if (username.length() == 0) + username = ""; + findPreference("bookmark.credentials").setSummary(username); + } + else if (key.equals("bookmark.resolution") || key.equals("bookmark.colors") || + key.equals("bookmark.width") || key.equals("bookmark.height")) + { + String resolution = sharedPreferences.getString("bookmark.resolution", "800x600"); + // compare english string from resolutions_values_array array, + // decode to localized + // text for display + if (resolution.equals("automatic")) + { + resolution = getResources().getString(R.string.resolution_automatic); + } + if (resolution.equals("custom")) + { + resolution = getResources().getString(R.string.resolution_custom); + } + if (resolution.equals("fitscreen")) + { + resolution = getResources().getString(R.string.resolution_fit); + } + resolution += "@" + sharedPreferences.getInt("bookmark.colors", 16); + findPreference("bookmark.screen").setSummary(resolution); + } + } + + private void initAdvancedSettings(SharedPreferences sharedPreferences) + { + advancedSettingsChanged(sharedPreferences, "bookmark.enable_gateway_settings"); + advancedSettingsChanged(sharedPreferences, "bookmark.enable_3g_settings"); + advancedSettingsChanged(sharedPreferences, "bookmark.security"); + advancedSettingsChanged(sharedPreferences, "bookmark.resolution_3g"); + advancedSettingsChanged(sharedPreferences, "bookmark.remote_program"); + advancedSettingsChanged(sharedPreferences, "bookmark.work_dir"); + } + + private void advancedSettingsChanged(SharedPreferences sharedPreferences, String key) + { + if (key.equals("bookmark.enable_gateway_settings")) + { + boolean enabled = sharedPreferences.getBoolean(key, false); + findPreference("bookmark.gateway_settings").setEnabled(enabled); + } + else if (key.equals("bookmark.enable_3g_settings")) + { + boolean enabled = sharedPreferences.getBoolean(key, false); + findPreference("bookmark.screen_3g").setEnabled(enabled); + findPreference("bookmark.performance_3g").setEnabled(enabled); + } + else if (key.equals("bookmark.security")) + { + ListPreference listPreference = (ListPreference)findPreference(key); + CharSequence security = listPreference.getEntries()[sharedPreferences.getInt(key, 0)]; + listPreference.setSummary(security); + } + else if (key.equals("bookmark.resolution_3g") || key.equals("bookmark.colors_3g") || + key.equals("bookmark.width_3g") || key.equals("bookmark.height_3g")) + { + String resolution = sharedPreferences.getString("bookmark.resolution_3g", "800x600"); + if (resolution.equals("automatic")) + resolution = getResources().getString(R.string.resolution_automatic); + else if (resolution.equals("custom")) + resolution = getResources().getString(R.string.resolution_custom); + resolution += "@" + sharedPreferences.getInt("bookmark.colors_3g", 16); + findPreference("bookmark.screen_3g").setSummary(resolution); + } + else if (key.equals("bookmark.remote_program")) + findPreference(key).setSummary(sharedPreferences.getString(key, "")); + else if (key.equals("bookmark.work_dir")) + findPreference(key).setSummary(sharedPreferences.getString(key, "")); + } + + private void initCredentialsSettings(SharedPreferences sharedPreferences) + { + credentialsSettingsChanged(sharedPreferences, "bookmark.username"); + credentialsSettingsChanged(sharedPreferences, "bookmark.password"); + credentialsSettingsChanged(sharedPreferences, "bookmark.domain"); + } + + private void credentialsSettingsChanged(SharedPreferences sharedPreferences, String key) + { + if (key.equals("bookmark.username")) + findPreference(key).setSummary(sharedPreferences.getString(key, "")); + else if (key.equals("bookmark.password")) + { + if (sharedPreferences.getString(key, "").length() == 0) + findPreference(key).setSummary( + getResources().getString(R.string.settings_password_empty)); + else + findPreference(key).setSummary( + getResources().getString(R.string.settings_password_present)); + } + else if (key.equals("bookmark.domain")) + findPreference(key).setSummary(sharedPreferences.getString(key, "")); + } + + private void initScreenSettings(SharedPreferences sharedPreferences) + { + screenSettingsChanged(sharedPreferences, "bookmark.colors"); + screenSettingsChanged(sharedPreferences, "bookmark.resolution"); + screenSettingsChanged(sharedPreferences, "bookmark.width"); + screenSettingsChanged(sharedPreferences, "bookmark.height"); + } + + private void initScreenSettings3G(SharedPreferences sharedPreferences) + { + screenSettingsChanged(sharedPreferences, "bookmark.colors_3g"); + screenSettingsChanged(sharedPreferences, "bookmark.resolution_3g"); + screenSettingsChanged(sharedPreferences, "bookmark.width_3g"); + screenSettingsChanged(sharedPreferences, "bookmark.height_3g"); + } + + private void screenSettingsChanged(SharedPreferences sharedPreferences, String key) + { + // could happen during initialization because 3g and non-3g settings + // share this routine - just skip + if (findPreference(key) == null) + return; + + if (key.equals("bookmark.colors") || key.equals("bookmark.colors_3g")) + { + ListPreference listPreference = (ListPreference)findPreference(key); + listPreference.setSummary(listPreference.getEntry()); + } + else if (key.equals("bookmark.resolution") || key.equals("bookmark.resolution_3g")) + { + ListPreference listPreference = (ListPreference)findPreference(key); + listPreference.setSummary(listPreference.getEntry()); + + String value = listPreference.getValue(); + boolean enabled = value.equalsIgnoreCase("custom"); + if (key.equals("bookmark.resolution")) + { + findPreference("bookmark.width").setEnabled(enabled); + findPreference("bookmark.height").setEnabled(enabled); + } + else + { + findPreference("bookmark.width_3g").setEnabled(enabled); + findPreference("bookmark.height_3g").setEnabled(enabled); + } + } + else if (key.equals("bookmark.width") || key.equals("bookmark.width_3g")) + findPreference(key).setSummary(String.valueOf(sharedPreferences.getInt(key, 800))); + else if (key.equals("bookmark.height") || key.equals("bookmark.height_3g")) + findPreference(key).setSummary(String.valueOf(sharedPreferences.getInt(key, 600))); + } + + private void initDebugSettings(SharedPreferences sharedPreferences) + { + debugSettingsChanged(sharedPreferences, "bookmark.debug_level"); + debugSettingsChanged(sharedPreferences, "bookmark.async_channel"); + debugSettingsChanged(sharedPreferences, "bookmark.async_update"); + debugSettingsChanged(sharedPreferences, "bookmark.async_input"); + } + + private void initGatewaySettings(SharedPreferences sharedPreferences) + { + gatewaySettingsChanged(sharedPreferences, "bookmark.gateway_hostname"); + gatewaySettingsChanged(sharedPreferences, "bookmark.gateway_port"); + gatewaySettingsChanged(sharedPreferences, "bookmark.gateway_username"); + gatewaySettingsChanged(sharedPreferences, "bookmark.gateway_password"); + gatewaySettingsChanged(sharedPreferences, "bookmark.gateway_domain"); + } + + private void debugSettingsChanged(SharedPreferences sharedPreferences, String key) + { + if (key.equals("bookmark.debug_level")) + { + String level = sharedPreferences.getString(key, "INFO"); + Preference pref = findPreference("bookmark.debug_level"); + pref.setDefaultValue(level); + } + else if (key.equals("bookmark.async_channel")) + { + boolean enabled = sharedPreferences.getBoolean(key, false); + Preference pref = findPreference("bookmark.async_channel"); + pref.setDefaultValue(enabled); + } + else if (key.equals("bookmark.async_update")) + { + boolean enabled = sharedPreferences.getBoolean(key, false); + Preference pref = findPreference("bookmark.async_update"); + pref.setDefaultValue(enabled); + } + else if (key.equals("bookmark.async_input")) + { + boolean enabled = sharedPreferences.getBoolean(key, false); + Preference pref = findPreference("bookmark.async_input"); + pref.setDefaultValue(enabled); + } + } + + private void gatewaySettingsChanged(SharedPreferences sharedPreferences, String key) + { + if (key.equals("bookmark.gateway_hostname")) + { + findPreference(key).setSummary(sharedPreferences.getString(key, "")); + } + else if (key.equals("bookmark.gateway_port")) + { + findPreference(key).setSummary(String.valueOf(sharedPreferences.getInt(key, 443))); + } + else if (key.equals("bookmark.gateway_username")) + { + findPreference(key).setSummary(sharedPreferences.getString(key, "")); + } + else if (key.equals("bookmark.gateway_password")) + { + if (sharedPreferences.getString(key, "").length() == 0) + findPreference(key).setSummary( + getResources().getString(R.string.settings_password_empty)); + else + findPreference(key).setSummary( + getResources().getString(R.string.settings_password_present)); + } + else if (key.equals("bookmark.gateway_domain")) + findPreference(key).setSummary(sharedPreferences.getString(key, "")); + } + + private boolean verifySettings(SharedPreferences sharedPreferences) + { + + boolean verifyFailed = false; + // perform sanity checks on settings + // Label set + if (sharedPreferences.getString("bookmark.label", "").length() == 0) + verifyFailed = true; + + // Server and port specified + if (!verifyFailed && sharedPreferences.getString("bookmark.hostname", "").length() == 0) + verifyFailed = true; + + // Server and port specified + if (!verifyFailed && sharedPreferences.getInt("bookmark.port", -1) <= 0) + verifyFailed = true; + + // if an error occurred - display toast and return false + return (!verifyFailed); + } + + private void finishAndResetBookmark() + { + bookmark = null; + getPreferenceManager().getSharedPreferences().unregisterOnSharedPreferenceChangeListener( + this); + finish(); + } + + @Override public void onBackPressed() + { + // only proceed if we are in the main preferences screen + if (current_preferences != PREFERENCES_BOOKMARK) + { + super.onBackPressed(); + getPreferenceManager() + .getSharedPreferences() + .unregisterOnSharedPreferenceChangeListener(this); + return; + } + + SharedPreferences sharedPreferences = getPreferenceManager().getSharedPreferences(); + if (!verifySettings(sharedPreferences)) + { + // ask the user if he wants to cancel or continue editing + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle(R.string.error_bookmark_incomplete_title) + .setMessage(R.string.error_bookmark_incomplete) + .setPositiveButton(R.string.cancel, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) + { + finishAndResetBookmark(); + } + }) + .setNegativeButton(R.string.cont, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) + { + dialog.cancel(); + } + }) + .show(); + + return; + } + else + { + // ask the user if he wants to save or cancel editing if a setting + // has changed + if (new_bookmark || settings_changed) + { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle(R.string.dlg_title_save_bookmark) + .setMessage(R.string.dlg_save_bookmark) + .setPositiveButton( + R.string.yes, + new DialogInterface.OnClickListener() { + @Override public void onClick(DialogInterface dialog, int which) + { + // read shared prefs back to bookmark + bookmark.readFromSharedPreferences( + getPreferenceManager().getSharedPreferences()); + + BookmarkBaseGateway bookmarkGateway; + if (bookmark.getType() == BookmarkBase.TYPE_MANUAL) + { + bookmarkGateway = GlobalApp.getManualBookmarkGateway(); + // remove any history entry for this + // bookmark + GlobalApp.getQuickConnectHistoryGateway().removeHistoryItem( + bookmark.get().getHostname()); + } + else + { + assert false; + return; + } + + // insert or update bookmark and leave + // activity + if (bookmark.getId() > 0) + bookmarkGateway.update(bookmark); + else + bookmarkGateway.insert(bookmark); + + finishAndResetBookmark(); + } + }) + .setNegativeButton(R.string.no, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) + { + finishAndResetBookmark(); + } + }) + .show(); + } + else + { + finishAndResetBookmark(); + } + } + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/HelpActivity.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/HelpActivity.java index 247635e79..8e1e6b2ed 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/HelpActivity.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/HelpActivity.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.presentation; @@ -22,50 +23,55 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.util.Locale; -public class HelpActivity extends AppCompatActivity { +public class HelpActivity extends AppCompatActivity +{ - private static final String TAG = HelpActivity.class.toString(); + private static final String TAG = HelpActivity.class.toString(); - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); + @Override public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); - WebView webview = new WebView(this); - setContentView(webview); + WebView webview = new WebView(this); + setContentView(webview); - String filename; - if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE) - filename = "gestures.html"; - else - filename = "gestures_phone.html"; + String filename; + if ((getResources().getConfiguration().screenLayout & + Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE) + filename = "gestures.html"; + else + filename = "gestures_phone.html"; - WebSettings settings = webview.getSettings(); - settings.setDomStorageEnabled(true); - settings.setUseWideViewPort(true); - settings.setLoadWithOverviewMode(true); - settings.setSupportZoom(true); - settings.setJavaScriptEnabled(true); - - settings.setAllowContentAccess(true); - settings.setAllowFileAccess(true); + WebSettings settings = webview.getSettings(); + settings.setDomStorageEnabled(true); + settings.setUseWideViewPort(true); + settings.setLoadWithOverviewMode(true); + settings.setSupportZoom(true); + settings.setJavaScriptEnabled(true); - final Locale def = Locale.getDefault(); - final String prefix = def.getLanguage().toLowerCase(def); + settings.setAllowContentAccess(true); + settings.setAllowFileAccess(true); - final String base = "file:///android_asset/"; - final String baseName = "help_page"; - String dir = prefix + "_" + baseName + "/"; - String file = dir + filename; - InputStream is; - try { - is = getAssets().open(file); - is.close(); - } catch (IOException e) { - Log.e(TAG, "Missing localized asset " + file, e); - dir = baseName + "/"; - file = dir + filename; - } + final Locale def = Locale.getDefault(); + final String prefix = def.getLanguage().toLowerCase(def); - webview.loadUrl(base + file); - } + final String base = "file:///android_asset/"; + final String baseName = "help_page"; + String dir = prefix + "_" + baseName + "/"; + String file = dir + filename; + InputStream is; + try + { + is = getAssets().open(file); + is.close(); + } + catch (IOException e) + { + Log.e(TAG, "Missing localized asset " + file, e); + dir = baseName + "/"; + file = dir + filename; + } + + webview.loadUrl(base + file); + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/HomeActivity.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/HomeActivity.java index 7407373d2..48e197743 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/HomeActivity.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/HomeActivity.java @@ -4,7 +4,8 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.presentation; @@ -45,303 +46,354 @@ import com.freerdp.freerdpcore.utils.SeparatedListAdapter; import java.util.ArrayList; -public class HomeActivity extends AppCompatActivity { - private final static String ADD_BOOKMARK_PLACEHOLDER = "add_bookmark"; - private static final String TAG = "HomeActivity"; - private static final String PARAM_SUPERBAR_TEXT = "superbar_text"; - private ListView listViewBookmarks; - private Button clearTextButton; - private EditText superBarEditText; - private BookmarkArrayAdapter manualBookmarkAdapter; - private SeparatedListAdapter separatedListAdapter; - private PlaceholderBookmark addBookmarkPlaceholder; - private String sectionLabelBookmarks; +public class HomeActivity extends AppCompatActivity +{ + private final static String ADD_BOOKMARK_PLACEHOLDER = "add_bookmark"; + private static final String TAG = "HomeActivity"; + private static final String PARAM_SUPERBAR_TEXT = "superbar_text"; + private ListView listViewBookmarks; + private Button clearTextButton; + private EditText superBarEditText; + private BookmarkArrayAdapter manualBookmarkAdapter; + private SeparatedListAdapter separatedListAdapter; + private PlaceholderBookmark addBookmarkPlaceholder; + private String sectionLabelBookmarks; - View mDecor; + View mDecor; - @Override - public void onCreate(Bundle savedInstanceState) { - setTitle(R.string.title_home); - super.onCreate(savedInstanceState); - setContentView(R.layout.home); + @Override public void onCreate(Bundle savedInstanceState) + { + setTitle(R.string.title_home); + super.onCreate(savedInstanceState); + setContentView(R.layout.home); - mDecor = getWindow().getDecorView(); - mDecor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); + mDecor = getWindow().getDecorView(); + mDecor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | + View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); - long heapSize = Runtime.getRuntime().maxMemory(); - Log.i(TAG, "Max HeapSize: " + heapSize); - Log.i(TAG, "App data folder: " + getFilesDir().toString()); + long heapSize = Runtime.getRuntime().maxMemory(); + Log.i(TAG, "Max HeapSize: " + heapSize); + Log.i(TAG, "App data folder: " + getFilesDir().toString()); - // load strings - sectionLabelBookmarks = getResources().getString(R.string.section_bookmarks); + // load strings + sectionLabelBookmarks = getResources().getString(R.string.section_bookmarks); - // create add bookmark/quick connect bookmark placeholder - addBookmarkPlaceholder = new PlaceholderBookmark(); - addBookmarkPlaceholder.setName(ADD_BOOKMARK_PLACEHOLDER); - addBookmarkPlaceholder.setLabel(getResources().getString(R.string.list_placeholder_add_bookmark)); + // create add bookmark/quick connect bookmark placeholder + addBookmarkPlaceholder = new PlaceholderBookmark(); + addBookmarkPlaceholder.setName(ADD_BOOKMARK_PLACEHOLDER); + addBookmarkPlaceholder.setLabel( + getResources().getString(R.string.list_placeholder_add_bookmark)); - // check for passed .rdp file and open it in a new bookmark - Intent caller = getIntent(); - Uri callParameter = caller.getData(); + // check for passed .rdp file and open it in a new bookmark + Intent caller = getIntent(); + Uri callParameter = caller.getData(); - if (Intent.ACTION_VIEW.equals(caller.getAction()) && callParameter != null) { - String refStr = ConnectionReference.getFileReference(callParameter.getPath()); - Bundle bundle = new Bundle(); - bundle.putString(BookmarkActivity.PARAM_CONNECTION_REFERENCE, refStr); + if (Intent.ACTION_VIEW.equals(caller.getAction()) && callParameter != null) + { + String refStr = ConnectionReference.getFileReference(callParameter.getPath()); + Bundle bundle = new Bundle(); + bundle.putString(BookmarkActivity.PARAM_CONNECTION_REFERENCE, refStr); - Intent bookmarkIntent = new Intent(this.getApplicationContext(), BookmarkActivity.class); - bookmarkIntent.putExtras(bundle); - startActivity(bookmarkIntent); - } + Intent bookmarkIntent = + new Intent(this.getApplicationContext(), BookmarkActivity.class); + bookmarkIntent.putExtras(bundle); + startActivity(bookmarkIntent); + } - // load views - clearTextButton = (Button) findViewById(R.id.clear_search_btn); - superBarEditText = (EditText) findViewById(R.id.superBarEditText); + // load views + clearTextButton = (Button)findViewById(R.id.clear_search_btn); + superBarEditText = (EditText)findViewById(R.id.superBarEditText); - listViewBookmarks = (ListView) findViewById(R.id.listViewBookmarks); + listViewBookmarks = (ListView)findViewById(R.id.listViewBookmarks); - // set listeners for the list view - listViewBookmarks.setOnItemClickListener(new AdapterView.OnItemClickListener() { - public void onItemClick(AdapterView parent, View view, int position, long id) { - String curSection = separatedListAdapter.getSectionForPosition(position); - Log.v(TAG, "Clicked on item id " + separatedListAdapter.getItemId(position) + " in section " + curSection); - if (curSection == sectionLabelBookmarks) { - String refStr = view.getTag().toString(); - if (ConnectionReference.isManualBookmarkReference(refStr) || - ConnectionReference.isHostnameReference(refStr)) { - Bundle bundle = new Bundle(); - bundle.putString(SessionActivity.PARAM_CONNECTION_REFERENCE, refStr); + // set listeners for the list view + listViewBookmarks.setOnItemClickListener(new AdapterView.OnItemClickListener() { + public void onItemClick(AdapterView parent, View view, int position, long id) + { + String curSection = separatedListAdapter.getSectionForPosition(position); + Log.v(TAG, "Clicked on item id " + separatedListAdapter.getItemId(position) + + " in section " + curSection); + if (curSection == sectionLabelBookmarks) + { + String refStr = view.getTag().toString(); + if (ConnectionReference.isManualBookmarkReference(refStr) || + ConnectionReference.isHostnameReference(refStr)) + { + Bundle bundle = new Bundle(); + bundle.putString(SessionActivity.PARAM_CONNECTION_REFERENCE, refStr); - Intent sessionIntent = new Intent(view.getContext(), SessionActivity.class); - sessionIntent.putExtras(bundle); - startActivity(sessionIntent); + Intent sessionIntent = new Intent(view.getContext(), SessionActivity.class); + sessionIntent.putExtras(bundle); + startActivity(sessionIntent); - // clear any search text - superBarEditText.setText(""); - superBarEditText.clearFocus(); - } else if (ConnectionReference.isPlaceholderReference(refStr)) { - // is this the add bookmark placeholder? - if (ConnectionReference.getPlaceholder(refStr).equals(ADD_BOOKMARK_PLACEHOLDER)) { - Intent bookmarkIntent = new Intent(view.getContext(), BookmarkActivity.class); - startActivity(bookmarkIntent); - } - } - } - } - }); + // clear any search text + superBarEditText.setText(""); + superBarEditText.clearFocus(); + } + else if (ConnectionReference.isPlaceholderReference(refStr)) + { + // is this the add bookmark placeholder? + if (ConnectionReference.getPlaceholder(refStr).equals( + ADD_BOOKMARK_PLACEHOLDER)) + { + Intent bookmarkIntent = + new Intent(view.getContext(), BookmarkActivity.class); + startActivity(bookmarkIntent); + } + } + } + } + }); - listViewBookmarks.setOnCreateContextMenuListener(new OnCreateContextMenuListener() { - @Override - public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { - // if the selected item is not a session item (tag == null) and not a quick connect entry - // (not a hostname connection reference) inflate the context menu - View itemView = ((AdapterContextMenuInfo) menuInfo).targetView; - String refStr = itemView.getTag() != null ? itemView.getTag().toString() : null; - if (refStr != null && !ConnectionReference.isHostnameReference(refStr) && !ConnectionReference.isPlaceholderReference(refStr)) { - getMenuInflater().inflate(R.menu.bookmark_context_menu, menu); - menu.setHeaderTitle(getResources().getString(R.string.menu_title_bookmark)); - } - } - }); + listViewBookmarks.setOnCreateContextMenuListener(new OnCreateContextMenuListener() { + @Override + public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) + { + // if the selected item is not a session item (tag == null) and not a quick connect + // entry (not a hostname connection reference) inflate the context menu + View itemView = ((AdapterContextMenuInfo)menuInfo).targetView; + String refStr = itemView.getTag() != null ? itemView.getTag().toString() : null; + if (refStr != null && !ConnectionReference.isHostnameReference(refStr) && + !ConnectionReference.isPlaceholderReference(refStr)) + { + getMenuInflater().inflate(R.menu.bookmark_context_menu, menu); + menu.setHeaderTitle(getResources().getString(R.string.menu_title_bookmark)); + } + } + }); - superBarEditText.addTextChangedListener(new SuperBarTextWatcher()); + superBarEditText.addTextChangedListener(new SuperBarTextWatcher()); - clearTextButton.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - superBarEditText.setText(""); - } - }); - } + clearTextButton.setOnClickListener(new OnClickListener() { + @Override public void onClick(View v) + { + superBarEditText.setText(""); + } + }); + } + @Override public void onConfigurationChanged(Configuration newConfig) + { + // ignore orientation/keyboard change + super.onConfigurationChanged(newConfig); + mDecor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | + View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); + } - @Override - public void onConfigurationChanged(Configuration newConfig) { - // ignore orientation/keyboard change - super.onConfigurationChanged(newConfig); - mDecor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); - } + @Override public boolean onSearchRequested() + { + superBarEditText.requestFocus(); + return true; + } - @Override - public boolean onSearchRequested() { - superBarEditText.requestFocus(); - return true; - } + @Override public boolean onContextItemSelected(MenuItem aItem) + { - @Override - public boolean onContextItemSelected(MenuItem aItem) { + // get connection reference + AdapterContextMenuInfo menuInfo = (AdapterContextMenuInfo)aItem.getMenuInfo(); + String refStr = menuInfo.targetView.getTag().toString(); - // get connection reference - AdapterContextMenuInfo menuInfo = (AdapterContextMenuInfo) aItem.getMenuInfo(); - String refStr = menuInfo.targetView.getTag().toString(); + // refer to http://tools.android.com/tips/non-constant-fields why we can't use switch/case + // here .. + int itemId = aItem.getItemId(); + if (itemId == R.id.bookmark_connect) + { + Bundle bundle = new Bundle(); + bundle.putString(SessionActivity.PARAM_CONNECTION_REFERENCE, refStr); + Intent sessionIntent = new Intent(this, SessionActivity.class); + sessionIntent.putExtras(bundle); - // refer to http://tools.android.com/tips/non-constant-fields why we can't use switch/case here .. - int itemId = aItem.getItemId(); - if (itemId == R.id.bookmark_connect) { - Bundle bundle = new Bundle(); - bundle.putString(SessionActivity.PARAM_CONNECTION_REFERENCE, refStr); - Intent sessionIntent = new Intent(this, SessionActivity.class); - sessionIntent.putExtras(bundle); + startActivity(sessionIntent); + return true; + } + else if (itemId == R.id.bookmark_edit) + { + Bundle bundle = new Bundle(); + bundle.putString(BookmarkActivity.PARAM_CONNECTION_REFERENCE, refStr); - startActivity(sessionIntent); - return true; - } else if (itemId == R.id.bookmark_edit) { - Bundle bundle = new Bundle(); - bundle.putString(BookmarkActivity.PARAM_CONNECTION_REFERENCE, refStr); + Intent bookmarkIntent = + new Intent(this.getApplicationContext(), BookmarkActivity.class); + bookmarkIntent.putExtras(bundle); + startActivity(bookmarkIntent); + return true; + } + else if (itemId == R.id.bookmark_delete) + { + if (ConnectionReference.isManualBookmarkReference(refStr)) + { + long id = ConnectionReference.getManualBookmarkId(refStr); + GlobalApp.getManualBookmarkGateway().delete(id); + manualBookmarkAdapter.remove(id); + separatedListAdapter.notifyDataSetChanged(); + } + else + { + assert false; + } - Intent bookmarkIntent = new Intent(this.getApplicationContext(), BookmarkActivity.class); - bookmarkIntent.putExtras(bundle); - startActivity(bookmarkIntent); - return true; - } else if (itemId == R.id.bookmark_delete) { - if (ConnectionReference.isManualBookmarkReference(refStr)) { - long id = ConnectionReference.getManualBookmarkId(refStr); - GlobalApp.getManualBookmarkGateway().delete(id); - manualBookmarkAdapter.remove(id); - separatedListAdapter.notifyDataSetChanged(); - } else { - assert false; - } + // clear super bar text + superBarEditText.setText(""); + return true; + } - // clear super bar text - superBarEditText.setText(""); - return true; - } + return false; + } - return false; - } + @Override protected void onResume() + { + super.onResume(); + Log.v(TAG, "HomeActivity.onResume"); - @Override - protected void onResume() { - super.onResume(); - Log.v(TAG, "HomeActivity.onResume"); + // create bookmark cursor adapter + manualBookmarkAdapter = new BookmarkArrayAdapter( + this, R.layout.bookmark_list_item, GlobalApp.getManualBookmarkGateway().findAll()); - // create bookmark cursor adapter - manualBookmarkAdapter = new BookmarkArrayAdapter(this, R.layout.bookmark_list_item, GlobalApp.getManualBookmarkGateway().findAll()); + // add add bookmark item to manual adapter + manualBookmarkAdapter.insert(addBookmarkPlaceholder, 0); - // add add bookmark item to manual adapter - manualBookmarkAdapter.insert(addBookmarkPlaceholder, 0); + // attach all adapters to the separatedListView adapter and assign it to the list view + separatedListAdapter = new SeparatedListAdapter(this); + separatedListAdapter.addSection(sectionLabelBookmarks, manualBookmarkAdapter); + listViewBookmarks.setAdapter(separatedListAdapter); - // attach all adapters to the separatedListView adapter and assign it to the list view - separatedListAdapter = new SeparatedListAdapter(this); - separatedListAdapter.addSection(sectionLabelBookmarks, manualBookmarkAdapter); - listViewBookmarks.setAdapter(separatedListAdapter); + // if we have a filter text entered cause an update to be caused here + String filter = superBarEditText.getText().toString(); + if (filter.length() > 0) + superBarEditText.setText(filter); + } - // if we have a filter text entered cause an update to be caused here - String filter = superBarEditText.getText().toString(); - if (filter.length() > 0) - superBarEditText.setText(filter); - } + @Override protected void onPause() + { + super.onPause(); + Log.v(TAG, "HomeActivity.onPause"); - @Override - protected void onPause() { - super.onPause(); - Log.v(TAG, "HomeActivity.onPause"); + // reset adapters + listViewBookmarks.setAdapter(null); + separatedListAdapter = null; + manualBookmarkAdapter = null; + } - // reset adapters - listViewBookmarks.setAdapter(null); - separatedListAdapter = null; - manualBookmarkAdapter = null; - } + @Override public void onBackPressed() + { + // if back was pressed - ask the user if he really wants to exit + if (ApplicationSettingsActivity.getAskOnExit(this)) + { + final CheckBox cb = new CheckBox(this); + cb.setChecked(!ApplicationSettingsActivity.getAskOnExit(this)); + cb.setText(R.string.dlg_dont_show_again); - @Override - public void onBackPressed() { - // if back was pressed - ask the user if he really wants to exit - if (ApplicationSettingsActivity.getAskOnExit(this)) { - final CheckBox cb = new CheckBox(this); - cb.setChecked(!ApplicationSettingsActivity.getAskOnExit(this)); - cb.setText(R.string.dlg_dont_show_again); + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle(R.string.dlg_title_exit) + .setMessage(R.string.dlg_msg_exit) + .setView(cb) + .setPositiveButton(R.string.yes, + new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) + { + finish(); + } + }) + .setNegativeButton(R.string.no, + new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) + { + dialog.dismiss(); + } + }) + .create() + .show(); + } + else + { + super.onBackPressed(); + } + } - AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setTitle(R.string.dlg_title_exit) - .setMessage(R.string.dlg_msg_exit) - .setView(cb) - .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int which) { - finish(); - } - }) - .setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int which) { - dialog.dismiss(); - } - }) - .create() - .show(); - } else { - super.onBackPressed(); - } - } + @Override protected void onSaveInstanceState(Bundle outState) + { + super.onSaveInstanceState(outState); + outState.putString(PARAM_SUPERBAR_TEXT, superBarEditText.getText().toString()); + } - @Override - protected void onSaveInstanceState(Bundle outState) { - super.onSaveInstanceState(outState); - outState.putString(PARAM_SUPERBAR_TEXT, superBarEditText.getText().toString()); - } + @Override protected void onRestoreInstanceState(Bundle inState) + { + super.onRestoreInstanceState(inState); + superBarEditText.setText(inState.getString(PARAM_SUPERBAR_TEXT)); + } - @Override - protected void onRestoreInstanceState(Bundle inState) { - super.onRestoreInstanceState(inState); - superBarEditText.setText(inState.getString(PARAM_SUPERBAR_TEXT)); - } + @Override public boolean onCreateOptionsMenu(Menu menu) + { + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.home_menu, menu); + return true; + } - @Override - public boolean onCreateOptionsMenu(Menu menu) { - MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.home_menu, menu); - return true; - } + @Override public boolean onOptionsItemSelected(MenuItem item) + { - @Override - public boolean onOptionsItemSelected(MenuItem item) { + // refer to http://tools.android.com/tips/non-constant-fields why we can't use switch/case + // here .. + int itemId = item.getItemId(); + if (itemId == R.id.newBookmark) + { + Intent bookmarkIntent = new Intent(this, BookmarkActivity.class); + startActivity(bookmarkIntent); + } + else if (itemId == R.id.appSettings) + { + Intent settingsIntent = new Intent(this, ApplicationSettingsActivity.class); + startActivity(settingsIntent); + } + else if (itemId == R.id.help) + { + Intent helpIntent = new Intent(this, HelpActivity.class); + startActivity(helpIntent); + } + else if (itemId == R.id.about) + { + Intent aboutIntent = new Intent(this, AboutActivity.class); + startActivity(aboutIntent); + } - // refer to http://tools.android.com/tips/non-constant-fields why we can't use switch/case here .. - int itemId = item.getItemId(); - if (itemId == R.id.newBookmark) { - Intent bookmarkIntent = new Intent(this, BookmarkActivity.class); - startActivity(bookmarkIntent); - } else if (itemId == R.id.appSettings) { - Intent settingsIntent = new Intent(this, ApplicationSettingsActivity.class); - startActivity(settingsIntent); - } else if (itemId == R.id.help) { - Intent helpIntent = new Intent(this, HelpActivity.class); - startActivity(helpIntent); - } else if (itemId == R.id.about) { - Intent aboutIntent = new Intent(this, AboutActivity.class); - startActivity(aboutIntent); - } + return true; + } - return true; - } + private class SuperBarTextWatcher implements TextWatcher + { + @Override public void afterTextChanged(Editable s) + { + if (separatedListAdapter != null) + { + String text = s.toString(); + if (text.length() > 0) + { + ArrayList computers_list = + GlobalApp.getQuickConnectHistoryGateway().findHistory(text); + computers_list.addAll( + GlobalApp.getManualBookmarkGateway().findByLabelOrHostnameLike(text)); + manualBookmarkAdapter.replaceItems(computers_list); + QuickConnectBookmark qcBm = new QuickConnectBookmark(); + qcBm.setLabel(text); + qcBm.setHostname(text); + manualBookmarkAdapter.insert(qcBm, 0); + } + else + { + manualBookmarkAdapter.replaceItems( + GlobalApp.getManualBookmarkGateway().findAll()); + manualBookmarkAdapter.insert(addBookmarkPlaceholder, 0); + } - private class SuperBarTextWatcher implements TextWatcher { - @Override - public void afterTextChanged(Editable s) { - if (separatedListAdapter != null) { - String text = s.toString(); - if (text.length() > 0) { - ArrayList computers_list = GlobalApp.getQuickConnectHistoryGateway().findHistory(text); - computers_list.addAll(GlobalApp.getManualBookmarkGateway().findByLabelOrHostnameLike(text)); - manualBookmarkAdapter.replaceItems(computers_list); - QuickConnectBookmark qcBm = new QuickConnectBookmark(); - qcBm.setLabel(text); - qcBm.setHostname(text); - manualBookmarkAdapter.insert(qcBm, 0); - } else { - manualBookmarkAdapter.replaceItems(GlobalApp.getManualBookmarkGateway().findAll()); - manualBookmarkAdapter.insert(addBookmarkPlaceholder, 0); - } + separatedListAdapter.notifyDataSetChanged(); + } + } - separatedListAdapter.notifyDataSetChanged(); - } - } + @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) + { + } - @Override - public void beforeTextChanged(CharSequence s, int start, int count, int after) { - } - - @Override - public void onTextChanged(CharSequence s, int start, int before, int count) { - } - } + @Override public void onTextChanged(CharSequence s, int start, int before, int count) + { + } + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/ScrollView2D.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/ScrollView2D.java index a2fee7c5c..ad1d572e8 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/ScrollView2D.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/ScrollView2D.java @@ -54,1097 +54,1296 @@ import java.util.List; * using the two together is possible to achieve the effect of a text view * within a larger container. */ -public class ScrollView2D extends FrameLayout { - - static final int ANIMATED_SCROLL_GAP = 250; - static final float MAX_SCROLL_FACTOR = 0.5f; - private final Rect mTempRect = new Rect(); - private ScrollView2DListener scrollView2DListener = null; - private long mLastScroll; - private Scroller mScroller; - private boolean scrollEnabled = true; - /** - * Flag to indicate that we are moving focus ourselves. This is so the - * code that watches for focus changes initiated outside this TwoDScrollView - * knows that it does not have to do anything. - */ - private boolean mTwoDScrollViewMovedFocus; - /** - * Position of the last motion event. - */ - private float mLastMotionY; - private float mLastMotionX; - /** - * True when the layout has changed but the traversal has not come through yet. - * Ideally the view hierarchy would keep track of this for us. - */ - private boolean mIsLayoutDirty = true; - /** - * The child to give focus to in the event that a child has requested focus while the - * layout is dirty. This prevents the scroll from being wrong if the child has not been - * laid out before requesting focus. - */ - private View mChildToScrollTo = null; - /** - * True if the user is currently dragging this TwoDScrollView around. This is - * not the same as 'is being flinged', which can be checked by - * mScroller.isFinished() (flinging begins when the user lifts his finger). - */ - private boolean mIsBeingDragged = false; - /** - * Determines speed during touch scrolling - */ - private VelocityTracker mVelocityTracker; - /** - * Whether arrow scrolling is animated. - */ - private int mTouchSlop; - private int mMinimumVelocity; - private int mMaximumVelocity; - public ScrollView2D(Context context) { - super(context); - initTwoDScrollView(); - } - - public ScrollView2D(Context context, AttributeSet attrs) { - super(context, attrs); - initTwoDScrollView(); - } - - public ScrollView2D(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - initTwoDScrollView(); - } - - @Override - protected float getTopFadingEdgeStrength() { - if (getChildCount() == 0) { - return 0.0f; - } - final int length = getVerticalFadingEdgeLength(); - if (getScrollY() < length) { - return getScrollY() / (float) length; - } - return 1.0f; - } - - @Override - protected float getBottomFadingEdgeStrength() { - if (getChildCount() == 0) { - return 0.0f; - } - final int length = getVerticalFadingEdgeLength(); - final int bottomEdge = getHeight() - getPaddingBottom(); - final int span = getChildAt(0).getBottom() - getScrollY() - bottomEdge; - if (span < length) { - return span / (float) length; - } - return 1.0f; - } - - @Override - protected float getLeftFadingEdgeStrength() { - if (getChildCount() == 0) { - return 0.0f; - } - final int length = getHorizontalFadingEdgeLength(); - if (getScrollX() < length) { - return getScrollX() / (float) length; - } - return 1.0f; - } - - @Override - protected float getRightFadingEdgeStrength() { - if (getChildCount() == 0) { - return 0.0f; - } - final int length = getHorizontalFadingEdgeLength(); - final int rightEdge = getWidth() - getPaddingRight(); - final int span = getChildAt(0).getRight() - getScrollX() - rightEdge; - if (span < length) { - return span / (float) length; - } - return 1.0f; - } - - /** - * Disable/Enable scrolling - */ - public void setScrollEnabled(boolean enable) { - scrollEnabled = enable; - } - - /** - * @return The maximum amount this scroll view will scroll in response to - * an arrow event. - */ - public int getMaxScrollAmountVertical() { - return (int) (MAX_SCROLL_FACTOR * getHeight()); - } - - public int getMaxScrollAmountHorizontal() { - return (int) (MAX_SCROLL_FACTOR * getWidth()); - } - - private void initTwoDScrollView() { - mScroller = new Scroller(getContext()); - setFocusable(true); - setDescendantFocusability(FOCUS_AFTER_DESCENDANTS); - setWillNotDraw(false); - final ViewConfiguration configuration = ViewConfiguration.get(getContext()); - mTouchSlop = configuration.getScaledTouchSlop(); - mMinimumVelocity = configuration.getScaledMinimumFlingVelocity(); - mMaximumVelocity = configuration.getScaledMaximumFlingVelocity(); - } - - @Override - public void addView(View child) { - if (getChildCount() > 0) { - throw new IllegalStateException("TwoDScrollView can host only one direct child"); - } - super.addView(child); - } - - @Override - public void addView(View child, int index) { - if (getChildCount() > 0) { - throw new IllegalStateException("TwoDScrollView can host only one direct child"); - } - super.addView(child, index); - } - - @Override - public void addView(View child, ViewGroup.LayoutParams params) { - if (getChildCount() > 0) { - throw new IllegalStateException("TwoDScrollView can host only one direct child"); - } - super.addView(child, params); - } - - @Override - public void addView(View child, int index, ViewGroup.LayoutParams params) { - if (getChildCount() > 0) { - throw new IllegalStateException("TwoDScrollView can host only one direct child"); - } - super.addView(child, index, params); - } - - /** - * @return Returns true this TwoDScrollView can be scrolled - */ - private boolean canScroll() { - if (!scrollEnabled) - return false; - View child = getChildAt(0); - if (child != null) { - int childHeight = child.getHeight(); - int childWidth = child.getWidth(); - return (getHeight() < childHeight + getPaddingTop() + getPaddingBottom()) || - (getWidth() < childWidth + getPaddingLeft() + getPaddingRight()); - } - return false; - } - - @Override - public boolean dispatchKeyEvent(KeyEvent event) { - // Let the focused view and/or our descendants get the key first - boolean handled = super.dispatchKeyEvent(event); - if (handled) { - return true; - } - return executeKeyEvent(event); - } - - /** - * You can call this function yourself to have the scroll view perform - * scrolling from a key event, just as if the event had been dispatched to - * it by the view hierarchy. - * - * @param event The key event to execute. - * @return Return true if the event was handled, else false. - */ - public boolean executeKeyEvent(KeyEvent event) { - mTempRect.setEmpty(); - if (!canScroll()) { - if (isFocused()) { - View currentFocused = findFocus(); - if (currentFocused == this) currentFocused = null; - View nextFocused = FocusFinder.getInstance().findNextFocus(this, currentFocused, View.FOCUS_DOWN); - return nextFocused != null && nextFocused != this && nextFocused.requestFocus(View.FOCUS_DOWN); - } - return false; - } - boolean handled = false; - if (event.getAction() == KeyEvent.ACTION_DOWN) { - switch (event.getKeyCode()) { - case KeyEvent.KEYCODE_DPAD_UP: - if (!event.isAltPressed()) { - handled = arrowScroll(View.FOCUS_UP, false); - } else { - handled = fullScroll(View.FOCUS_UP, false); - } - break; - case KeyEvent.KEYCODE_DPAD_DOWN: - if (!event.isAltPressed()) { - handled = arrowScroll(View.FOCUS_DOWN, false); - } else { - handled = fullScroll(View.FOCUS_DOWN, false); - } - break; - case KeyEvent.KEYCODE_DPAD_LEFT: - if (!event.isAltPressed()) { - handled = arrowScroll(View.FOCUS_LEFT, true); - } else { - handled = fullScroll(View.FOCUS_LEFT, true); - } - break; - case KeyEvent.KEYCODE_DPAD_RIGHT: - if (!event.isAltPressed()) { - handled = arrowScroll(View.FOCUS_RIGHT, true); - } else { - handled = fullScroll(View.FOCUS_RIGHT, true); - } - break; - } - } - return handled; - } - - @Override - public boolean onInterceptTouchEvent(MotionEvent ev) { - /* - * This method JUST determines whether we want to intercept the motion. - * If we return true, onMotionEvent will be called and we do the actual - * scrolling there. - * - * Shortcut the most recurring case: the user is in the dragging - * state and he is moving his finger. We want to intercept this - * motion. - */ - final int action = ev.getAction(); - if ((action == MotionEvent.ACTION_MOVE) && (mIsBeingDragged)) { - return true; - } - if (!canScroll()) { - mIsBeingDragged = false; - return false; - } - final float y = ev.getY(); - final float x = ev.getX(); - switch (action) { - case MotionEvent.ACTION_MOVE: - /* - * mIsBeingDragged == false, otherwise the shortcut would have caught it. Check - * whether the user has moved far enough from his original down touch. - */ - /* - * Locally do absolute value. mLastMotionY is set to the y value - * of the down event. - */ - final int yDiff = (int) Math.abs(y - mLastMotionY); - final int xDiff = (int) Math.abs(x - mLastMotionX); - if (yDiff > mTouchSlop || xDiff > mTouchSlop) { - mIsBeingDragged = true; - } - break; - - case MotionEvent.ACTION_DOWN: - /* Remember location of down touch */ - mLastMotionY = y; - mLastMotionX = x; - - /* - * If being flinged and user touches the screen, initiate drag; - * otherwise don't. mScroller.isFinished should be false when - * being flinged. - */ - mIsBeingDragged = !mScroller.isFinished(); - break; - - case MotionEvent.ACTION_CANCEL: - case MotionEvent.ACTION_UP: - /* Release the drag */ - mIsBeingDragged = false; - break; - } - - /* - * The only time we want to intercept motion events is if we are in the - * drag mode. - */ - return mIsBeingDragged; - } - - @Override - public boolean onTouchEvent(MotionEvent ev) { - - if (ev.getAction() == MotionEvent.ACTION_DOWN && ev.getEdgeFlags() != 0) { - // Don't handle edge touches immediately -- they may actually belong to one of our - // descendants. - return false; - } - - if (!canScroll()) { - return false; - } - - if (mVelocityTracker == null) { - mVelocityTracker = VelocityTracker.obtain(); - } - mVelocityTracker.addMovement(ev); - - final int action = ev.getAction(); - final float y = ev.getY(); - final float x = ev.getX(); - - switch (action) { - case MotionEvent.ACTION_DOWN: - /* - * If being flinged and user touches, stop the fling. isFinished - * will be false if being flinged. - */ - if (!mScroller.isFinished()) { - mScroller.abortAnimation(); - } - - // Remember where the motion event started - mLastMotionY = y; - mLastMotionX = x; - break; - case MotionEvent.ACTION_MOVE: - // Scroll to follow the motion event - int deltaX = (int) (mLastMotionX - x); - int deltaY = (int) (mLastMotionY - y); - mLastMotionX = x; - mLastMotionY = y; - - if (deltaX < 0) { - if (getScrollX() < 0) { - deltaX = 0; - } - } else if (deltaX > 0) { - final int rightEdge = getWidth() - getPaddingRight(); - final int availableToScroll = getChildAt(0).getRight() - getScrollX() - rightEdge; - if (availableToScroll > 0) { - deltaX = Math.min(availableToScroll, deltaX); - } else { - deltaX = 0; - } - } - if (deltaY < 0) { - if (getScrollY() < 0) { - deltaY = 0; - } - } else if (deltaY > 0) { - final int bottomEdge = getHeight() - getPaddingBottom(); - final int availableToScroll = getChildAt(0).getBottom() - getScrollY() - bottomEdge; - if (availableToScroll > 0) { - deltaY = Math.min(availableToScroll, deltaY); - } else { - deltaY = 0; - } - } - if (deltaY != 0 || deltaX != 0) - scrollBy(deltaX, deltaY); - break; - case MotionEvent.ACTION_UP: - final VelocityTracker velocityTracker = mVelocityTracker; - velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity); - int initialXVelocity = (int) velocityTracker.getXVelocity(); - int initialYVelocity = (int) velocityTracker.getYVelocity(); - if ((Math.abs(initialXVelocity) + Math.abs(initialYVelocity) > mMinimumVelocity) && getChildCount() > 0) { - fling(-initialXVelocity, -initialYVelocity); - } - if (mVelocityTracker != null) { - mVelocityTracker.recycle(); - mVelocityTracker = null; - } - } - return true; - } - - /** - * Finds the next focusable component that fits in this View's bounds - * (excluding fading edges) pretending that this View's top is located at - * the parameter top. - * - * @param topFocus look for a candidate is the one at the top of the bounds - * if topFocus is true, or at the bottom of the bounds if topFocus is - * false - * @param top the top offset of the bounds in which a focusable must be - * found (the fading edge is assumed to start at this position) - * @param preferredFocusable the View that has highest priority and will be - * returned if it is within my bounds (null is valid) - * @return the next focusable component in the bounds or null if none can be - * found - */ - private View findFocusableViewInMyBounds(final boolean topFocus, final int top, final boolean leftFocus, final int left, View preferredFocusable) { - /* - * The fading edge's transparent side should be considered for focus - * since it's mostly visible, so we divide the actual fading edge length - * by 2. - */ - final int verticalFadingEdgeLength = getVerticalFadingEdgeLength() / 2; - final int topWithoutFadingEdge = top + verticalFadingEdgeLength; - final int bottomWithoutFadingEdge = top + getHeight() - verticalFadingEdgeLength; - final int horizontalFadingEdgeLength = getHorizontalFadingEdgeLength() / 2; - final int leftWithoutFadingEdge = left + horizontalFadingEdgeLength; - final int rightWithoutFadingEdge = left + getWidth() - horizontalFadingEdgeLength; - - if ((preferredFocusable != null) - && (preferredFocusable.getTop() < bottomWithoutFadingEdge) - && (preferredFocusable.getBottom() > topWithoutFadingEdge) - && (preferredFocusable.getLeft() < rightWithoutFadingEdge) - && (preferredFocusable.getRight() > leftWithoutFadingEdge)) { - return preferredFocusable; - } - return findFocusableViewInBounds(topFocus, topWithoutFadingEdge, bottomWithoutFadingEdge, leftFocus, leftWithoutFadingEdge, rightWithoutFadingEdge); - } - - /** - * Finds the next focusable component that fits in the specified bounds. - *

- * - * @param topFocus look for a candidate is the one at the top of the bounds - * if topFocus is true, or at the bottom of the bounds if topFocus is - * false - * @param top the top offset of the bounds in which a focusable must be - * found - * @param bottom the bottom offset of the bounds in which a focusable must - * be found - * @return the next focusable component in the bounds or null if none can - * be found - */ - private View findFocusableViewInBounds(boolean topFocus, int top, int bottom, boolean leftFocus, int left, int right) { - List focusables = getFocusables(View.FOCUS_FORWARD); - View focusCandidate = null; - - /* - * A fully contained focusable is one where its top is below the bound's - * top, and its bottom is above the bound's bottom. A partially - * contained focusable is one where some part of it is within the - * bounds, but it also has some part that is not within bounds. A fully contained - * focusable is preferred to a partially contained focusable. - */ - boolean foundFullyContainedFocusable = false; - - int count = focusables.size(); - for (int i = 0; i < count; i++) { - View view = focusables.get(i); - int viewTop = view.getTop(); - int viewBottom = view.getBottom(); - int viewLeft = view.getLeft(); - int viewRight = view.getRight(); - - if (top < viewBottom && viewTop < bottom && left < viewRight && viewLeft < right) { - /* - * the focusable is in the target area, it is a candidate for - * focusing - */ - final boolean viewIsFullyContained = (top < viewTop) && (viewBottom < bottom) && (left < viewLeft) && (viewRight < right); - if (focusCandidate == null) { - /* No candidate, take this one */ - focusCandidate = view; - foundFullyContainedFocusable = viewIsFullyContained; - } else { - final boolean viewIsCloserToVerticalBoundary = - (topFocus && viewTop < focusCandidate.getTop()) || - (!topFocus && viewBottom > focusCandidate.getBottom()); - final boolean viewIsCloserToHorizontalBoundary = - (leftFocus && viewLeft < focusCandidate.getLeft()) || - (!leftFocus && viewRight > focusCandidate.getRight()); - if (foundFullyContainedFocusable) { - if (viewIsFullyContained && viewIsCloserToVerticalBoundary && viewIsCloserToHorizontalBoundary) { - /* - * We're dealing with only fully contained views, so - * it has to be closer to the boundary to beat our - * candidate - */ - focusCandidate = view; - } - } else { - if (viewIsFullyContained) { - /* Any fully contained view beats a partially contained view */ - focusCandidate = view; - foundFullyContainedFocusable = true; - } else if (viewIsCloserToVerticalBoundary && viewIsCloserToHorizontalBoundary) { - /* - * Partially contained view beats another partially - * contained view if it's closer - */ - focusCandidate = view; - } - } - } - } - } - return focusCandidate; - } - - /** - *

Handles scrolling in response to a "home/end" shortcut press. This - * method will scroll the view to the top or bottom and give the focus - * to the topmost/bottommost component in the new visible area. If no - * component is a good candidate for focus, this scrollview reclaims the - * focus.

- * - * @param direction the scroll direction: {@link android.view.View#FOCUS_UP} - * to go the top of the view or - * {@link android.view.View#FOCUS_DOWN} to go the bottom - * @return true if the key event is consumed by this method, false otherwise - */ - public boolean fullScroll(int direction, boolean horizontal) { - if (!horizontal) { - boolean down = direction == View.FOCUS_DOWN; - int height = getHeight(); - mTempRect.top = 0; - mTempRect.bottom = height; - if (down) { - int count = getChildCount(); - if (count > 0) { - View view = getChildAt(count - 1); - mTempRect.bottom = view.getBottom(); - mTempRect.top = mTempRect.bottom - height; - } - } - return scrollAndFocus(direction, mTempRect.top, mTempRect.bottom, 0, 0, 0); - } else { - boolean right = direction == View.FOCUS_DOWN; - int width = getWidth(); - mTempRect.left = 0; - mTempRect.right = width; - if (right) { - int count = getChildCount(); - if (count > 0) { - View view = getChildAt(count - 1); - mTempRect.right = view.getBottom(); - mTempRect.left = mTempRect.right - width; - } - } - return scrollAndFocus(0, 0, 0, direction, mTempRect.top, mTempRect.bottom); - } - } - - /** - *

Scrolls the view to make the area defined by top and - * bottom visible. This method attempts to give the focus - * to a component visible in this area. If no component can be focused in - * the new visible area, the focus is reclaimed by this scrollview.

- * - * @param direction the scroll direction: {@link android.view.View#FOCUS_UP} - * to go upward - * {@link android.view.View#FOCUS_DOWN} to downward - * @param top the top offset of the new area to be made visible - * @param bottom the bottom offset of the new area to be made visible - * @return true if the key event is consumed by this method, false otherwise - */ - private boolean scrollAndFocus(int directionY, int top, int bottom, int directionX, int left, int right) { - boolean handled = true; - int height = getHeight(); - int containerTop = getScrollY(); - int containerBottom = containerTop + height; - boolean up = directionY == View.FOCUS_UP; - int width = getWidth(); - int containerLeft = getScrollX(); - int containerRight = containerLeft + width; - boolean leftwards = directionX == View.FOCUS_UP; - View newFocused = findFocusableViewInBounds(up, top, bottom, leftwards, left, right); - if (newFocused == null) { - newFocused = this; - } - if ((top >= containerTop && bottom <= containerBottom) || (left >= containerLeft && right <= containerRight)) { - handled = false; - } else { - int deltaY = up ? (top - containerTop) : (bottom - containerBottom); - int deltaX = leftwards ? (left - containerLeft) : (right - containerRight); - doScroll(deltaX, deltaY); - } - if (newFocused != findFocus() && newFocused.requestFocus(directionY)) { - mTwoDScrollViewMovedFocus = true; - mTwoDScrollViewMovedFocus = false; - } - return handled; - } - - /** - * Handle scrolling in response to an up or down arrow click. - * - * @param direction The direction corresponding to the arrow key that was - * pressed - * @return True if we consumed the event, false otherwise - */ - public boolean arrowScroll(int direction, boolean horizontal) { - View currentFocused = findFocus(); - if (currentFocused == this) currentFocused = null; - View nextFocused = FocusFinder.getInstance().findNextFocus(this, currentFocused, direction); - final int maxJump = horizontal ? getMaxScrollAmountHorizontal() : getMaxScrollAmountVertical(); - - if (!horizontal) { - if (nextFocused != null) { - nextFocused.getDrawingRect(mTempRect); - offsetDescendantRectToMyCoords(nextFocused, mTempRect); - int scrollDelta = computeScrollDeltaToGetChildRectOnScreen(mTempRect); - doScroll(0, scrollDelta); - nextFocused.requestFocus(direction); - } else { - // no new focus - int scrollDelta = maxJump; - if (direction == View.FOCUS_UP && getScrollY() < scrollDelta) { - scrollDelta = getScrollY(); - } else if (direction == View.FOCUS_DOWN) { - if (getChildCount() > 0) { - int daBottom = getChildAt(0).getBottom(); - int screenBottom = getScrollY() + getHeight(); - if (daBottom - screenBottom < maxJump) { - scrollDelta = daBottom - screenBottom; - } - } - } - if (scrollDelta == 0) { - return false; - } - doScroll(0, direction == View.FOCUS_DOWN ? scrollDelta : -scrollDelta); - } - } else { - if (nextFocused != null) { - nextFocused.getDrawingRect(mTempRect); - offsetDescendantRectToMyCoords(nextFocused, mTempRect); - int scrollDelta = computeScrollDeltaToGetChildRectOnScreen(mTempRect); - doScroll(scrollDelta, 0); - nextFocused.requestFocus(direction); - } else { - // no new focus - int scrollDelta = maxJump; - if (direction == View.FOCUS_UP && getScrollY() < scrollDelta) { - scrollDelta = getScrollY(); - } else if (direction == View.FOCUS_DOWN) { - if (getChildCount() > 0) { - int daBottom = getChildAt(0).getBottom(); - int screenBottom = getScrollY() + getHeight(); - if (daBottom - screenBottom < maxJump) { - scrollDelta = daBottom - screenBottom; - } - } - } - if (scrollDelta == 0) { - return false; - } - doScroll(direction == View.FOCUS_DOWN ? scrollDelta : -scrollDelta, 0); - } - } - return true; - } - - /** - * Smooth scroll by a Y delta - * - * @param delta the number of pixels to scroll by on the Y axis - */ - private void doScroll(int deltaX, int deltaY) { - if (deltaX != 0 || deltaY != 0) { - smoothScrollBy(deltaX, deltaY); - } - } - - /** - * Like {@link View#scrollBy}, but scroll smoothly instead of immediately. - * - * @param dx the number of pixels to scroll by on the X axis - * @param dy the number of pixels to scroll by on the Y axis - */ - public final void smoothScrollBy(int dx, int dy) { - long duration = AnimationUtils.currentAnimationTimeMillis() - mLastScroll; - if (duration > ANIMATED_SCROLL_GAP) { - mScroller.startScroll(getScrollX(), getScrollY(), dx, dy); - awakenScrollBars(mScroller.getDuration()); - invalidate(); - } else { - if (!mScroller.isFinished()) { - mScroller.abortAnimation(); - } - scrollBy(dx, dy); - } - mLastScroll = AnimationUtils.currentAnimationTimeMillis(); - } - - /** - * Like {@link #scrollTo}, but scroll smoothly instead of immediately. - * - * @param x the position where to scroll on the X axis - * @param y the position where to scroll on the Y axis - */ - public final void smoothScrollTo(int x, int y) { - smoothScrollBy(x - getScrollX(), y - getScrollY()); - } - - /** - *

The scroll range of a scroll view is the overall height of all of its - * children.

- */ - @Override - protected int computeVerticalScrollRange() { - int count = getChildCount(); - return count == 0 ? getHeight() : (getChildAt(0)).getBottom(); - } - - @Override - protected int computeHorizontalScrollRange() { - int count = getChildCount(); - return count == 0 ? getWidth() : (getChildAt(0)).getRight(); - } - - @Override - protected void measureChild(View child, int parentWidthMeasureSpec, int parentHeightMeasureSpec) { - ViewGroup.LayoutParams lp = child.getLayoutParams(); - int childWidthMeasureSpec; - int childHeightMeasureSpec; - - childWidthMeasureSpec = getChildMeasureSpec(parentWidthMeasureSpec, getPaddingLeft() + getPaddingRight(), lp.width); - childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); - - child.measure(childWidthMeasureSpec, childHeightMeasureSpec); - } - - @Override - protected void measureChildWithMargins(View child, int parentWidthMeasureSpec, int widthUsed, int parentHeightMeasureSpec, int heightUsed) { - final MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams(); - final int childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(lp.leftMargin + lp.rightMargin, MeasureSpec.UNSPECIFIED); - final int childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(lp.topMargin + lp.bottomMargin, MeasureSpec.UNSPECIFIED); - - child.measure(childWidthMeasureSpec, childHeightMeasureSpec); - } - - @Override - public void computeScroll() { - if (mScroller.computeScrollOffset()) { - // This is called at drawing time by ViewGroup. We don't want to - // re-show the scrollbars at this point, which scrollTo will do, - // so we replicate most of scrollTo here. - // - // It's a little odd to call onScrollChanged from inside the drawing. - // - // It is, except when you remember that computeScroll() is used to - // animate scrolling. So unless we want to defer the onScrollChanged() - // until the end of the animated scrolling, we don't really have a - // choice here. - // - // I agree. The alternative, which I think would be worse, is to post - // something and tell the subclasses later. This is bad because there - // will be a window where mScrollX/Y is different from what the app - // thinks it is. - // - int oldX = getScrollX(); - int oldY = getScrollY(); - int x = mScroller.getCurrX(); - int y = mScroller.getCurrY(); - if (getChildCount() > 0) { - View child = getChildAt(0); - scrollTo(clamp(x, getWidth() - getPaddingRight() - getPaddingLeft(), child.getWidth()), - clamp(y, getHeight() - getPaddingBottom() - getPaddingTop(), child.getHeight())); - } else { - scrollTo(x, y); - } - if (oldX != getScrollX() || oldY != getScrollY()) { - onScrollChanged(getScrollX(), getScrollY(), oldX, oldY); - } - - // Keep on drawing until the animation has finished. - postInvalidate(); - } - } - - /** - * Scrolls the view to the given child. - * - * @param child the View to scroll to - */ - private void scrollToChild(View child) { - child.getDrawingRect(mTempRect); - /* Offset from child's local coordinates to TwoDScrollView coordinates */ - offsetDescendantRectToMyCoords(child, mTempRect); - int scrollDelta = computeScrollDeltaToGetChildRectOnScreen(mTempRect); - if (scrollDelta != 0) { - scrollBy(0, scrollDelta); - } - } - - /** - * If rect is off screen, scroll just enough to get it (or at least the - * first screen size chunk of it) on screen. - * - * @param rect The rectangle. - * @param immediate True to scroll immediately without animation - * @return true if scrolling was performed - */ - private boolean scrollToChildRect(Rect rect, boolean immediate) { - final int delta = computeScrollDeltaToGetChildRectOnScreen(rect); - final boolean scroll = delta != 0; - if (scroll) { - if (immediate) { - scrollBy(0, delta); - } else { - smoothScrollBy(0, delta); - } - } - return scroll; - } - - /** - * Compute the amount to scroll in the Y direction in order to get - * a rectangle completely on the screen (or, if taller than the screen, - * at least the first screen size chunk of it). - * - * @param rect The rect. - * @return The scroll delta. - */ - protected int computeScrollDeltaToGetChildRectOnScreen(Rect rect) { - if (getChildCount() == 0) return 0; - int height = getHeight(); - int screenTop = getScrollY(); - int screenBottom = screenTop + height; - int fadingEdge = getVerticalFadingEdgeLength(); - // leave room for top fading edge as long as rect isn't at very top - if (rect.top > 0) { - screenTop += fadingEdge; - } - - // leave room for bottom fading edge as long as rect isn't at very bottom - if (rect.bottom < getChildAt(0).getHeight()) { - screenBottom -= fadingEdge; - } - int scrollYDelta = 0; - if (rect.bottom > screenBottom && rect.top > screenTop) { - // need to move down to get it in view: move down just enough so - // that the entire rectangle is in view (or at least the first - // screen size chunk). - if (rect.height() > height) { - // just enough to get screen size chunk on - scrollYDelta += (rect.top - screenTop); - } else { - // get entire rect at bottom of screen - scrollYDelta += (rect.bottom - screenBottom); - } - - // make sure we aren't scrolling beyond the end of our content - int bottom = getChildAt(0).getBottom(); - int distanceToBottom = bottom - screenBottom; - scrollYDelta = Math.min(scrollYDelta, distanceToBottom); - - } else if (rect.top < screenTop && rect.bottom < screenBottom) { - // need to move up to get it in view: move up just enough so that - // entire rectangle is in view (or at least the first screen - // size chunk of it). - - if (rect.height() > height) { - // screen size chunk - scrollYDelta -= (screenBottom - rect.bottom); - } else { - // entire rect at top - scrollYDelta -= (screenTop - rect.top); - } - - // make sure we aren't scrolling any further than the top our content - scrollYDelta = Math.max(scrollYDelta, -getScrollY()); - } - return scrollYDelta; - } - - @Override - public void requestChildFocus(View child, View focused) { - if (!mTwoDScrollViewMovedFocus) { - if (!mIsLayoutDirty) { - scrollToChild(focused); - } else { - // The child may not be laid out yet, we can't compute the scroll yet - mChildToScrollTo = focused; - } - } - super.requestChildFocus(child, focused); - } - - /** - * When looking for focus in children of a scroll view, need to be a little - * more careful not to give focus to something that is scrolled off screen. - *

- * This is more expensive than the default {@link android.view.ViewGroup} - * implementation, otherwise this behavior might have been made the default. - */ - @Override - protected boolean onRequestFocusInDescendants(int direction, Rect previouslyFocusedRect) { - // convert from forward / backward notation to up / down / left / right - // (ugh). - if (direction == View.FOCUS_FORWARD) { - direction = View.FOCUS_DOWN; - } else if (direction == View.FOCUS_BACKWARD) { - direction = View.FOCUS_UP; - } - - final View nextFocus = previouslyFocusedRect == null ? - FocusFinder.getInstance().findNextFocus(this, null, direction) : - FocusFinder.getInstance().findNextFocusFromRect(this, - previouslyFocusedRect, direction); - - if (nextFocus == null) { - return false; - } - - return nextFocus.requestFocus(direction, previouslyFocusedRect); - } - - @Override - public boolean requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate) { - // offset into coordinate space of this scroll view - rectangle.offset(child.getLeft() - child.getScrollX(), child.getTop() - child.getScrollY()); - return scrollToChildRect(rectangle, immediate); - } - - @Override - public void requestLayout() { - mIsLayoutDirty = true; - super.requestLayout(); - } - - @Override - protected void onLayout(boolean changed, int l, int t, int r, int b) { - super.onLayout(changed, l, t, r, b); - mIsLayoutDirty = false; - // Give a child focus if it needs it - if (mChildToScrollTo != null && isViewDescendantOf(mChildToScrollTo, this)) { - scrollToChild(mChildToScrollTo); - } - mChildToScrollTo = null; - - // Calling this with the present values causes it to re-clam them - scrollTo(getScrollX(), getScrollY()); - } - - @Override - protected void onSizeChanged(int w, int h, int oldw, int oldh) { - super.onSizeChanged(w, h, oldw, oldh); - - View currentFocused = findFocus(); - if (null == currentFocused || this == currentFocused) - return; - - // If the currently-focused view was visible on the screen when the - // screen was at the old height, then scroll the screen to make that - // view visible with the new screen height. - currentFocused.getDrawingRect(mTempRect); - offsetDescendantRectToMyCoords(currentFocused, mTempRect); - int scrollDeltaX = computeScrollDeltaToGetChildRectOnScreen(mTempRect); - int scrollDeltaY = computeScrollDeltaToGetChildRectOnScreen(mTempRect); - doScroll(scrollDeltaX, scrollDeltaY); - } - - /** - * Return true if child is an descendant of parent, (or equal to the parent). - */ - private boolean isViewDescendantOf(View child, View parent) { - if (child == parent) { - return true; - } - - final ViewParent theParent = child.getParent(); - return (theParent instanceof ViewGroup) && isViewDescendantOf((View) theParent, parent); - } - - /** - * Fling the scroll view - * - * @param velocityY The initial velocity in the Y direction. Positive - * numbers mean that the finger/curor is moving down the screen, - * which means we want to scroll towards the top. - */ - public void fling(int velocityX, int velocityY) { - if (getChildCount() > 0) { - int height = getHeight() - getPaddingBottom() - getPaddingTop(); - int bottom = getChildAt(0).getHeight(); - int width = getWidth() - getPaddingRight() - getPaddingLeft(); - int right = getChildAt(0).getWidth(); - - mScroller.fling(getScrollX(), getScrollY(), velocityX, velocityY, 0, right - width, 0, bottom - height); - - final boolean movingDown = velocityY > 0; - final boolean movingRight = velocityX > 0; - - View newFocused = findFocusableViewInMyBounds(movingRight, mScroller.getFinalX(), movingDown, mScroller.getFinalY(), findFocus()); - if (newFocused == null) { - newFocused = this; - } - - if (newFocused != findFocus() && newFocused.requestFocus(movingDown ? View.FOCUS_DOWN : View.FOCUS_UP)) { - mTwoDScrollViewMovedFocus = true; - mTwoDScrollViewMovedFocus = false; - } - - awakenScrollBars(mScroller.getDuration()); - invalidate(); - } - } - - /** - * {@inheritDoc} - *

- *

This version also clamps the scrolling to the bounds of our child. - */ - public void scrollTo(int x, int y) { - // we rely on the fact the View.scrollBy calls scrollTo. - if (getChildCount() > 0) { - View child = getChildAt(0); - x = clamp(x, getWidth() - getPaddingRight() - getPaddingLeft(), child.getWidth()); - y = clamp(y, getHeight() - getPaddingBottom() - getPaddingTop(), child.getHeight()); - if (x != getScrollX() || y != getScrollY()) { - super.scrollTo(x, y); - } - } - } - - private int clamp(int n, int my, int child) { - if (my >= child || n < 0) { - /* my >= child is this case: - * |--------------- me ---------------| - * |------ child ------| - * or - * |--------------- me ---------------| - * |------ child ------| - * or - * |--------------- me ---------------| - * |------ child ------| - * - * n < 0 is this case: - * |------ me ------| - * |-------- child --------| - * |-- mScrollX --| - */ - return 0; - } - if ((my + n) > child) { - /* this case: - * |------ me ------| - * |------ child ------| - * |-- mScrollX --| - */ - return child - my; - } - return n; - } - - public void setScrollViewListener(ScrollView2DListener scrollViewListener) { - this.scrollView2DListener = scrollViewListener; - } - - @Override - protected void onScrollChanged(int x, int y, int oldx, int oldy) { - super.onScrollChanged(x, y, oldx, oldy); - if (scrollView2DListener != null) { - scrollView2DListener.onScrollChanged(this, x, y, oldx, oldy); - } - } - - // interface to receive notifications when the view is scrolled - public interface ScrollView2DListener { - abstract void onScrollChanged(ScrollView2D scrollView, int x, int y, int oldx, int oldy); - } - +public class ScrollView2D extends FrameLayout +{ + + static final int ANIMATED_SCROLL_GAP = 250; + static final float MAX_SCROLL_FACTOR = 0.5f; + private final Rect mTempRect = new Rect(); + private ScrollView2DListener scrollView2DListener = null; + private long mLastScroll; + private Scroller mScroller; + private boolean scrollEnabled = true; + /** + * Flag to indicate that we are moving focus ourselves. This is so the + * code that watches for focus changes initiated outside this TwoDScrollView + * knows that it does not have to do anything. + */ + private boolean mTwoDScrollViewMovedFocus; + /** + * Position of the last motion event. + */ + private float mLastMotionY; + private float mLastMotionX; + /** + * True when the layout has changed but the traversal has not come through yet. + * Ideally the view hierarchy would keep track of this for us. + */ + private boolean mIsLayoutDirty = true; + /** + * The child to give focus to in the event that a child has requested focus while the + * layout is dirty. This prevents the scroll from being wrong if the child has not been + * laid out before requesting focus. + */ + private View mChildToScrollTo = null; + /** + * True if the user is currently dragging this TwoDScrollView around. This is + * not the same as 'is being flinged', which can be checked by + * mScroller.isFinished() (flinging begins when the user lifts his finger). + */ + private boolean mIsBeingDragged = false; + /** + * Determines speed during touch scrolling + */ + private VelocityTracker mVelocityTracker; + /** + * Whether arrow scrolling is animated. + */ + private int mTouchSlop; + private int mMinimumVelocity; + private int mMaximumVelocity; + public ScrollView2D(Context context) + { + super(context); + initTwoDScrollView(); + } + + public ScrollView2D(Context context, AttributeSet attrs) + { + super(context, attrs); + initTwoDScrollView(); + } + + public ScrollView2D(Context context, AttributeSet attrs, int defStyle) + { + super(context, attrs, defStyle); + initTwoDScrollView(); + } + + @Override protected float getTopFadingEdgeStrength() + { + if (getChildCount() == 0) + { + return 0.0f; + } + final int length = getVerticalFadingEdgeLength(); + if (getScrollY() < length) + { + return getScrollY() / (float)length; + } + return 1.0f; + } + + @Override protected float getBottomFadingEdgeStrength() + { + if (getChildCount() == 0) + { + return 0.0f; + } + final int length = getVerticalFadingEdgeLength(); + final int bottomEdge = getHeight() - getPaddingBottom(); + final int span = getChildAt(0).getBottom() - getScrollY() - bottomEdge; + if (span < length) + { + return span / (float)length; + } + return 1.0f; + } + + @Override protected float getLeftFadingEdgeStrength() + { + if (getChildCount() == 0) + { + return 0.0f; + } + final int length = getHorizontalFadingEdgeLength(); + if (getScrollX() < length) + { + return getScrollX() / (float)length; + } + return 1.0f; + } + + @Override protected float getRightFadingEdgeStrength() + { + if (getChildCount() == 0) + { + return 0.0f; + } + final int length = getHorizontalFadingEdgeLength(); + final int rightEdge = getWidth() - getPaddingRight(); + final int span = getChildAt(0).getRight() - getScrollX() - rightEdge; + if (span < length) + { + return span / (float)length; + } + return 1.0f; + } + + /** + * Disable/Enable scrolling + */ + public void setScrollEnabled(boolean enable) + { + scrollEnabled = enable; + } + + /** + * @return The maximum amount this scroll view will scroll in response to + * an arrow event. + */ + public int getMaxScrollAmountVertical() + { + return (int)(MAX_SCROLL_FACTOR * getHeight()); + } + + public int getMaxScrollAmountHorizontal() + { + return (int)(MAX_SCROLL_FACTOR * getWidth()); + } + + private void initTwoDScrollView() + { + mScroller = new Scroller(getContext()); + setFocusable(true); + setDescendantFocusability(FOCUS_AFTER_DESCENDANTS); + setWillNotDraw(false); + final ViewConfiguration configuration = ViewConfiguration.get(getContext()); + mTouchSlop = configuration.getScaledTouchSlop(); + mMinimumVelocity = configuration.getScaledMinimumFlingVelocity(); + mMaximumVelocity = configuration.getScaledMaximumFlingVelocity(); + } + + @Override public void addView(View child) + { + if (getChildCount() > 0) + { + throw new IllegalStateException("TwoDScrollView can host only one direct child"); + } + super.addView(child); + } + + @Override public void addView(View child, int index) + { + if (getChildCount() > 0) + { + throw new IllegalStateException("TwoDScrollView can host only one direct child"); + } + super.addView(child, index); + } + + @Override public void addView(View child, ViewGroup.LayoutParams params) + { + if (getChildCount() > 0) + { + throw new IllegalStateException("TwoDScrollView can host only one direct child"); + } + super.addView(child, params); + } + + @Override public void addView(View child, int index, ViewGroup.LayoutParams params) + { + if (getChildCount() > 0) + { + throw new IllegalStateException("TwoDScrollView can host only one direct child"); + } + super.addView(child, index, params); + } + + /** + * @return Returns true this TwoDScrollView can be scrolled + */ + private boolean canScroll() + { + if (!scrollEnabled) + return false; + View child = getChildAt(0); + if (child != null) + { + int childHeight = child.getHeight(); + int childWidth = child.getWidth(); + return (getHeight() < childHeight + getPaddingTop() + getPaddingBottom()) || + (getWidth() < childWidth + getPaddingLeft() + getPaddingRight()); + } + return false; + } + + @Override public boolean dispatchKeyEvent(KeyEvent event) + { + // Let the focused view and/or our descendants get the key first + boolean handled = super.dispatchKeyEvent(event); + if (handled) + { + return true; + } + return executeKeyEvent(event); + } + + /** + * You can call this function yourself to have the scroll view perform + * scrolling from a key event, just as if the event had been dispatched to + * it by the view hierarchy. + * + * @param event The key event to execute. + * @return Return true if the event was handled, else false. + */ + public boolean executeKeyEvent(KeyEvent event) + { + mTempRect.setEmpty(); + if (!canScroll()) + { + if (isFocused()) + { + View currentFocused = findFocus(); + if (currentFocused == this) + currentFocused = null; + View nextFocused = + FocusFinder.getInstance().findNextFocus(this, currentFocused, View.FOCUS_DOWN); + return nextFocused != null && nextFocused != this && + nextFocused.requestFocus(View.FOCUS_DOWN); + } + return false; + } + boolean handled = false; + if (event.getAction() == KeyEvent.ACTION_DOWN) + { + switch (event.getKeyCode()) + { + case KeyEvent.KEYCODE_DPAD_UP: + if (!event.isAltPressed()) + { + handled = arrowScroll(View.FOCUS_UP, false); + } + else + { + handled = fullScroll(View.FOCUS_UP, false); + } + break; + case KeyEvent.KEYCODE_DPAD_DOWN: + if (!event.isAltPressed()) + { + handled = arrowScroll(View.FOCUS_DOWN, false); + } + else + { + handled = fullScroll(View.FOCUS_DOWN, false); + } + break; + case KeyEvent.KEYCODE_DPAD_LEFT: + if (!event.isAltPressed()) + { + handled = arrowScroll(View.FOCUS_LEFT, true); + } + else + { + handled = fullScroll(View.FOCUS_LEFT, true); + } + break; + case KeyEvent.KEYCODE_DPAD_RIGHT: + if (!event.isAltPressed()) + { + handled = arrowScroll(View.FOCUS_RIGHT, true); + } + else + { + handled = fullScroll(View.FOCUS_RIGHT, true); + } + break; + } + } + return handled; + } + + @Override public boolean onInterceptTouchEvent(MotionEvent ev) + { + /* + * This method JUST determines whether we want to intercept the motion. + * If we return true, onMotionEvent will be called and we do the actual + * scrolling there. + * + * Shortcut the most recurring case: the user is in the dragging + * state and he is moving his finger. We want to intercept this + * motion. + */ + final int action = ev.getAction(); + if ((action == MotionEvent.ACTION_MOVE) && (mIsBeingDragged)) + { + return true; + } + if (!canScroll()) + { + mIsBeingDragged = false; + return false; + } + final float y = ev.getY(); + final float x = ev.getX(); + switch (action) + { + case MotionEvent.ACTION_MOVE: + /* + * mIsBeingDragged == false, otherwise the shortcut would have caught it. Check + * whether the user has moved far enough from his original down touch. + */ + /* + * Locally do absolute value. mLastMotionY is set to the y value + * of the down event. + */ + final int yDiff = (int)Math.abs(y - mLastMotionY); + final int xDiff = (int)Math.abs(x - mLastMotionX); + if (yDiff > mTouchSlop || xDiff > mTouchSlop) + { + mIsBeingDragged = true; + } + break; + + case MotionEvent.ACTION_DOWN: + /* Remember location of down touch */ + mLastMotionY = y; + mLastMotionX = x; + + /* + * If being flinged and user touches the screen, initiate drag; + * otherwise don't. mScroller.isFinished should be false when + * being flinged. + */ + mIsBeingDragged = !mScroller.isFinished(); + break; + + case MotionEvent.ACTION_CANCEL: + case MotionEvent.ACTION_UP: + /* Release the drag */ + mIsBeingDragged = false; + break; + } + + /* + * The only time we want to intercept motion events is if we are in the + * drag mode. + */ + return mIsBeingDragged; + } + + @Override public boolean onTouchEvent(MotionEvent ev) + { + + if (ev.getAction() == MotionEvent.ACTION_DOWN && ev.getEdgeFlags() != 0) + { + // Don't handle edge touches immediately -- they may actually belong to one of our + // descendants. + return false; + } + + if (!canScroll()) + { + return false; + } + + if (mVelocityTracker == null) + { + mVelocityTracker = VelocityTracker.obtain(); + } + mVelocityTracker.addMovement(ev); + + final int action = ev.getAction(); + final float y = ev.getY(); + final float x = ev.getX(); + + switch (action) + { + case MotionEvent.ACTION_DOWN: + /* + * If being flinged and user touches, stop the fling. isFinished + * will be false if being flinged. + */ + if (!mScroller.isFinished()) + { + mScroller.abortAnimation(); + } + + // Remember where the motion event started + mLastMotionY = y; + mLastMotionX = x; + break; + case MotionEvent.ACTION_MOVE: + // Scroll to follow the motion event + int deltaX = (int)(mLastMotionX - x); + int deltaY = (int)(mLastMotionY - y); + mLastMotionX = x; + mLastMotionY = y; + + if (deltaX < 0) + { + if (getScrollX() < 0) + { + deltaX = 0; + } + } + else if (deltaX > 0) + { + final int rightEdge = getWidth() - getPaddingRight(); + final int availableToScroll = + getChildAt(0).getRight() - getScrollX() - rightEdge; + if (availableToScroll > 0) + { + deltaX = Math.min(availableToScroll, deltaX); + } + else + { + deltaX = 0; + } + } + if (deltaY < 0) + { + if (getScrollY() < 0) + { + deltaY = 0; + } + } + else if (deltaY > 0) + { + final int bottomEdge = getHeight() - getPaddingBottom(); + final int availableToScroll = + getChildAt(0).getBottom() - getScrollY() - bottomEdge; + if (availableToScroll > 0) + { + deltaY = Math.min(availableToScroll, deltaY); + } + else + { + deltaY = 0; + } + } + if (deltaY != 0 || deltaX != 0) + scrollBy(deltaX, deltaY); + break; + case MotionEvent.ACTION_UP: + final VelocityTracker velocityTracker = mVelocityTracker; + velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity); + int initialXVelocity = (int)velocityTracker.getXVelocity(); + int initialYVelocity = (int)velocityTracker.getYVelocity(); + if ((Math.abs(initialXVelocity) + Math.abs(initialYVelocity) > mMinimumVelocity) && + getChildCount() > 0) + { + fling(-initialXVelocity, -initialYVelocity); + } + if (mVelocityTracker != null) + { + mVelocityTracker.recycle(); + mVelocityTracker = null; + } + } + return true; + } + + /** + * Finds the next focusable component that fits in this View's bounds + * (excluding fading edges) pretending that this View's top is located at + * the parameter top. + * + * @param topFocus look for a candidate is the one at the top of the bounds + * if topFocus is true, or at the bottom of the bounds if topFocus is + * false + * @param top the top offset of the bounds in which a focusable must be + * found (the fading edge is assumed to start at this position) + * @param preferredFocusable the View that has highest priority and will be + * returned if it is within my bounds (null is valid) + * @return the next focusable component in the bounds or null if none can be + * found + */ + private View findFocusableViewInMyBounds(final boolean topFocus, final int top, + final boolean leftFocus, final int left, + View preferredFocusable) + { + /* + * The fading edge's transparent side should be considered for focus + * since it's mostly visible, so we divide the actual fading edge length + * by 2. + */ + final int verticalFadingEdgeLength = getVerticalFadingEdgeLength() / 2; + final int topWithoutFadingEdge = top + verticalFadingEdgeLength; + final int bottomWithoutFadingEdge = top + getHeight() - verticalFadingEdgeLength; + final int horizontalFadingEdgeLength = getHorizontalFadingEdgeLength() / 2; + final int leftWithoutFadingEdge = left + horizontalFadingEdgeLength; + final int rightWithoutFadingEdge = left + getWidth() - horizontalFadingEdgeLength; + + if ((preferredFocusable != null) && + (preferredFocusable.getTop() < bottomWithoutFadingEdge) && + (preferredFocusable.getBottom() > topWithoutFadingEdge) && + (preferredFocusable.getLeft() < rightWithoutFadingEdge) && + (preferredFocusable.getRight() > leftWithoutFadingEdge)) + { + return preferredFocusable; + } + return findFocusableViewInBounds(topFocus, topWithoutFadingEdge, bottomWithoutFadingEdge, + leftFocus, leftWithoutFadingEdge, rightWithoutFadingEdge); + } + + /** + * Finds the next focusable component that fits in the specified bounds. + *

+ * + * @param topFocus look for a candidate is the one at the top of the bounds + * if topFocus is true, or at the bottom of the bounds if topFocus is + * false + * @param top the top offset of the bounds in which a focusable must be + * found + * @param bottom the bottom offset of the bounds in which a focusable must + * be found + * @return the next focusable component in the bounds or null if none can + * be found + */ + private View findFocusableViewInBounds(boolean topFocus, int top, int bottom, boolean leftFocus, + int left, int right) + { + List focusables = getFocusables(View.FOCUS_FORWARD); + View focusCandidate = null; + + /* + * A fully contained focusable is one where its top is below the bound's + * top, and its bottom is above the bound's bottom. A partially + * contained focusable is one where some part of it is within the + * bounds, but it also has some part that is not within bounds. A fully contained + * focusable is preferred to a partially contained focusable. + */ + boolean foundFullyContainedFocusable = false; + + int count = focusables.size(); + for (int i = 0; i < count; i++) + { + View view = focusables.get(i); + int viewTop = view.getTop(); + int viewBottom = view.getBottom(); + int viewLeft = view.getLeft(); + int viewRight = view.getRight(); + + if (top < viewBottom && viewTop < bottom && left < viewRight && viewLeft < right) + { + /* + * the focusable is in the target area, it is a candidate for + * focusing + */ + final boolean viewIsFullyContained = (top < viewTop) && (viewBottom < bottom) && + (left < viewLeft) && (viewRight < right); + if (focusCandidate == null) + { + /* No candidate, take this one */ + focusCandidate = view; + foundFullyContainedFocusable = viewIsFullyContained; + } + else + { + final boolean viewIsCloserToVerticalBoundary = + (topFocus && viewTop < focusCandidate.getTop()) || + (!topFocus && viewBottom > focusCandidate.getBottom()); + final boolean viewIsCloserToHorizontalBoundary = + (leftFocus && viewLeft < focusCandidate.getLeft()) || + (!leftFocus && viewRight > focusCandidate.getRight()); + if (foundFullyContainedFocusable) + { + if (viewIsFullyContained && viewIsCloserToVerticalBoundary && + viewIsCloserToHorizontalBoundary) + { + /* + * We're dealing with only fully contained views, so + * it has to be closer to the boundary to beat our + * candidate + */ + focusCandidate = view; + } + } + else + { + if (viewIsFullyContained) + { + /* Any fully contained view beats a partially contained view */ + focusCandidate = view; + foundFullyContainedFocusable = true; + } + else if (viewIsCloserToVerticalBoundary && viewIsCloserToHorizontalBoundary) + { + /* + * Partially contained view beats another partially + * contained view if it's closer + */ + focusCandidate = view; + } + } + } + } + } + return focusCandidate; + } + + /** + *

Handles scrolling in response to a "home/end" shortcut press. This + * method will scroll the view to the top or bottom and give the focus + * to the topmost/bottommost component in the new visible area. If no + * component is a good candidate for focus, this scrollview reclaims the + * focus.

+ * + * @param direction the scroll direction: {@link android.view.View#FOCUS_UP} + * to go the top of the view or + * {@link android.view.View#FOCUS_DOWN} to go the bottom + * @return true if the key event is consumed by this method, false otherwise + */ + public boolean fullScroll(int direction, boolean horizontal) + { + if (!horizontal) + { + boolean down = direction == View.FOCUS_DOWN; + int height = getHeight(); + mTempRect.top = 0; + mTempRect.bottom = height; + if (down) + { + int count = getChildCount(); + if (count > 0) + { + View view = getChildAt(count - 1); + mTempRect.bottom = view.getBottom(); + mTempRect.top = mTempRect.bottom - height; + } + } + return scrollAndFocus(direction, mTempRect.top, mTempRect.bottom, 0, 0, 0); + } + else + { + boolean right = direction == View.FOCUS_DOWN; + int width = getWidth(); + mTempRect.left = 0; + mTempRect.right = width; + if (right) + { + int count = getChildCount(); + if (count > 0) + { + View view = getChildAt(count - 1); + mTempRect.right = view.getBottom(); + mTempRect.left = mTempRect.right - width; + } + } + return scrollAndFocus(0, 0, 0, direction, mTempRect.top, mTempRect.bottom); + } + } + + /** + *

Scrolls the view to make the area defined by top and + * bottom visible. This method attempts to give the focus + * to a component visible in this area. If no component can be focused in + * the new visible area, the focus is reclaimed by this scrollview.

+ * + * @param direction the scroll direction: {@link android.view.View#FOCUS_UP} + * to go upward + * {@link android.view.View#FOCUS_DOWN} to downward + * @param top the top offset of the new area to be made visible + * @param bottom the bottom offset of the new area to be made visible + * @return true if the key event is consumed by this method, false otherwise + */ + private boolean scrollAndFocus(int directionY, int top, int bottom, int directionX, int left, + int right) + { + boolean handled = true; + int height = getHeight(); + int containerTop = getScrollY(); + int containerBottom = containerTop + height; + boolean up = directionY == View.FOCUS_UP; + int width = getWidth(); + int containerLeft = getScrollX(); + int containerRight = containerLeft + width; + boolean leftwards = directionX == View.FOCUS_UP; + View newFocused = findFocusableViewInBounds(up, top, bottom, leftwards, left, right); + if (newFocused == null) + { + newFocused = this; + } + if ((top >= containerTop && bottom <= containerBottom) || + (left >= containerLeft && right <= containerRight)) + { + handled = false; + } + else + { + int deltaY = up ? (top - containerTop) : (bottom - containerBottom); + int deltaX = leftwards ? (left - containerLeft) : (right - containerRight); + doScroll(deltaX, deltaY); + } + if (newFocused != findFocus() && newFocused.requestFocus(directionY)) + { + mTwoDScrollViewMovedFocus = true; + mTwoDScrollViewMovedFocus = false; + } + return handled; + } + + /** + * Handle scrolling in response to an up or down arrow click. + * + * @param direction The direction corresponding to the arrow key that was + * pressed + * @return True if we consumed the event, false otherwise + */ + public boolean arrowScroll(int direction, boolean horizontal) + { + View currentFocused = findFocus(); + if (currentFocused == this) + currentFocused = null; + View nextFocused = FocusFinder.getInstance().findNextFocus(this, currentFocused, direction); + final int maxJump = + horizontal ? getMaxScrollAmountHorizontal() : getMaxScrollAmountVertical(); + + if (!horizontal) + { + if (nextFocused != null) + { + nextFocused.getDrawingRect(mTempRect); + offsetDescendantRectToMyCoords(nextFocused, mTempRect); + int scrollDelta = computeScrollDeltaToGetChildRectOnScreen(mTempRect); + doScroll(0, scrollDelta); + nextFocused.requestFocus(direction); + } + else + { + // no new focus + int scrollDelta = maxJump; + if (direction == View.FOCUS_UP && getScrollY() < scrollDelta) + { + scrollDelta = getScrollY(); + } + else if (direction == View.FOCUS_DOWN) + { + if (getChildCount() > 0) + { + int daBottom = getChildAt(0).getBottom(); + int screenBottom = getScrollY() + getHeight(); + if (daBottom - screenBottom < maxJump) + { + scrollDelta = daBottom - screenBottom; + } + } + } + if (scrollDelta == 0) + { + return false; + } + doScroll(0, direction == View.FOCUS_DOWN ? scrollDelta : -scrollDelta); + } + } + else + { + if (nextFocused != null) + { + nextFocused.getDrawingRect(mTempRect); + offsetDescendantRectToMyCoords(nextFocused, mTempRect); + int scrollDelta = computeScrollDeltaToGetChildRectOnScreen(mTempRect); + doScroll(scrollDelta, 0); + nextFocused.requestFocus(direction); + } + else + { + // no new focus + int scrollDelta = maxJump; + if (direction == View.FOCUS_UP && getScrollY() < scrollDelta) + { + scrollDelta = getScrollY(); + } + else if (direction == View.FOCUS_DOWN) + { + if (getChildCount() > 0) + { + int daBottom = getChildAt(0).getBottom(); + int screenBottom = getScrollY() + getHeight(); + if (daBottom - screenBottom < maxJump) + { + scrollDelta = daBottom - screenBottom; + } + } + } + if (scrollDelta == 0) + { + return false; + } + doScroll(direction == View.FOCUS_DOWN ? scrollDelta : -scrollDelta, 0); + } + } + return true; + } + + /** + * Smooth scroll by a Y delta + * + * @param delta the number of pixels to scroll by on the Y axis + */ + private void doScroll(int deltaX, int deltaY) + { + if (deltaX != 0 || deltaY != 0) + { + smoothScrollBy(deltaX, deltaY); + } + } + + /** + * Like {@link View#scrollBy}, but scroll smoothly instead of immediately. + * + * @param dx the number of pixels to scroll by on the X axis + * @param dy the number of pixels to scroll by on the Y axis + */ + public final void smoothScrollBy(int dx, int dy) + { + long duration = AnimationUtils.currentAnimationTimeMillis() - mLastScroll; + if (duration > ANIMATED_SCROLL_GAP) + { + mScroller.startScroll(getScrollX(), getScrollY(), dx, dy); + awakenScrollBars(mScroller.getDuration()); + invalidate(); + } + else + { + if (!mScroller.isFinished()) + { + mScroller.abortAnimation(); + } + scrollBy(dx, dy); + } + mLastScroll = AnimationUtils.currentAnimationTimeMillis(); + } + + /** + * Like {@link #scrollTo}, but scroll smoothly instead of immediately. + * + * @param x the position where to scroll on the X axis + * @param y the position where to scroll on the Y axis + */ + public final void smoothScrollTo(int x, int y) + { + smoothScrollBy(x - getScrollX(), y - getScrollY()); + } + + /** + *

The scroll range of a scroll view is the overall height of all of its + * children.

+ */ + @Override protected int computeVerticalScrollRange() + { + int count = getChildCount(); + return count == 0 ? getHeight() : (getChildAt(0)).getBottom(); + } + + @Override protected int computeHorizontalScrollRange() + { + int count = getChildCount(); + return count == 0 ? getWidth() : (getChildAt(0)).getRight(); + } + + @Override + protected void measureChild(View child, int parentWidthMeasureSpec, int parentHeightMeasureSpec) + { + ViewGroup.LayoutParams lp = child.getLayoutParams(); + int childWidthMeasureSpec; + int childHeightMeasureSpec; + + childWidthMeasureSpec = getChildMeasureSpec(parentWidthMeasureSpec, + getPaddingLeft() + getPaddingRight(), lp.width); + childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); + + child.measure(childWidthMeasureSpec, childHeightMeasureSpec); + } + + @Override + protected void measureChildWithMargins(View child, int parentWidthMeasureSpec, int widthUsed, + int parentHeightMeasureSpec, int heightUsed) + { + final MarginLayoutParams lp = (MarginLayoutParams)child.getLayoutParams(); + final int childWidthMeasureSpec = + MeasureSpec.makeMeasureSpec(lp.leftMargin + lp.rightMargin, MeasureSpec.UNSPECIFIED); + final int childHeightMeasureSpec = + MeasureSpec.makeMeasureSpec(lp.topMargin + lp.bottomMargin, MeasureSpec.UNSPECIFIED); + + child.measure(childWidthMeasureSpec, childHeightMeasureSpec); + } + + @Override public void computeScroll() + { + if (mScroller.computeScrollOffset()) + { + // This is called at drawing time by ViewGroup. We don't want to + // re-show the scrollbars at this point, which scrollTo will do, + // so we replicate most of scrollTo here. + // + // It's a little odd to call onScrollChanged from inside the drawing. + // + // It is, except when you remember that computeScroll() is used to + // animate scrolling. So unless we want to defer the onScrollChanged() + // until the end of the animated scrolling, we don't really have a + // choice here. + // + // I agree. The alternative, which I think would be worse, is to post + // something and tell the subclasses later. This is bad because there + // will be a window where mScrollX/Y is different from what the app + // thinks it is. + // + int oldX = getScrollX(); + int oldY = getScrollY(); + int x = mScroller.getCurrX(); + int y = mScroller.getCurrY(); + if (getChildCount() > 0) + { + View child = getChildAt(0); + scrollTo( + clamp(x, getWidth() - getPaddingRight() - getPaddingLeft(), child.getWidth()), + clamp(y, getHeight() - getPaddingBottom() - getPaddingTop(), + child.getHeight())); + } + else + { + scrollTo(x, y); + } + if (oldX != getScrollX() || oldY != getScrollY()) + { + onScrollChanged(getScrollX(), getScrollY(), oldX, oldY); + } + + // Keep on drawing until the animation has finished. + postInvalidate(); + } + } + + /** + * Scrolls the view to the given child. + * + * @param child the View to scroll to + */ + private void scrollToChild(View child) + { + child.getDrawingRect(mTempRect); + /* Offset from child's local coordinates to TwoDScrollView coordinates */ + offsetDescendantRectToMyCoords(child, mTempRect); + int scrollDelta = computeScrollDeltaToGetChildRectOnScreen(mTempRect); + if (scrollDelta != 0) + { + scrollBy(0, scrollDelta); + } + } + + /** + * If rect is off screen, scroll just enough to get it (or at least the + * first screen size chunk of it) on screen. + * + * @param rect The rectangle. + * @param immediate True to scroll immediately without animation + * @return true if scrolling was performed + */ + private boolean scrollToChildRect(Rect rect, boolean immediate) + { + final int delta = computeScrollDeltaToGetChildRectOnScreen(rect); + final boolean scroll = delta != 0; + if (scroll) + { + if (immediate) + { + scrollBy(0, delta); + } + else + { + smoothScrollBy(0, delta); + } + } + return scroll; + } + + /** + * Compute the amount to scroll in the Y direction in order to get + * a rectangle completely on the screen (or, if taller than the screen, + * at least the first screen size chunk of it). + * + * @param rect The rect. + * @return The scroll delta. + */ + protected int computeScrollDeltaToGetChildRectOnScreen(Rect rect) + { + if (getChildCount() == 0) + return 0; + int height = getHeight(); + int screenTop = getScrollY(); + int screenBottom = screenTop + height; + int fadingEdge = getVerticalFadingEdgeLength(); + // leave room for top fading edge as long as rect isn't at very top + if (rect.top > 0) + { + screenTop += fadingEdge; + } + + // leave room for bottom fading edge as long as rect isn't at very bottom + if (rect.bottom < getChildAt(0).getHeight()) + { + screenBottom -= fadingEdge; + } + int scrollYDelta = 0; + if (rect.bottom > screenBottom && rect.top > screenTop) + { + // need to move down to get it in view: move down just enough so + // that the entire rectangle is in view (or at least the first + // screen size chunk). + if (rect.height() > height) + { + // just enough to get screen size chunk on + scrollYDelta += (rect.top - screenTop); + } + else + { + // get entire rect at bottom of screen + scrollYDelta += (rect.bottom - screenBottom); + } + + // make sure we aren't scrolling beyond the end of our content + int bottom = getChildAt(0).getBottom(); + int distanceToBottom = bottom - screenBottom; + scrollYDelta = Math.min(scrollYDelta, distanceToBottom); + } + else if (rect.top < screenTop && rect.bottom < screenBottom) + { + // need to move up to get it in view: move up just enough so that + // entire rectangle is in view (or at least the first screen + // size chunk of it). + + if (rect.height() > height) + { + // screen size chunk + scrollYDelta -= (screenBottom - rect.bottom); + } + else + { + // entire rect at top + scrollYDelta -= (screenTop - rect.top); + } + + // make sure we aren't scrolling any further than the top our content + scrollYDelta = Math.max(scrollYDelta, -getScrollY()); + } + return scrollYDelta; + } + + @Override public void requestChildFocus(View child, View focused) + { + if (!mTwoDScrollViewMovedFocus) + { + if (!mIsLayoutDirty) + { + scrollToChild(focused); + } + else + { + // The child may not be laid out yet, we can't compute the scroll yet + mChildToScrollTo = focused; + } + } + super.requestChildFocus(child, focused); + } + + /** + * When looking for focus in children of a scroll view, need to be a little + * more careful not to give focus to something that is scrolled off screen. + *

+ * This is more expensive than the default {@link android.view.ViewGroup} + * implementation, otherwise this behavior might have been made the default. + */ + @Override + protected boolean onRequestFocusInDescendants(int direction, Rect previouslyFocusedRect) + { + // convert from forward / backward notation to up / down / left / right + // (ugh). + if (direction == View.FOCUS_FORWARD) + { + direction = View.FOCUS_DOWN; + } + else if (direction == View.FOCUS_BACKWARD) + { + direction = View.FOCUS_UP; + } + + final View nextFocus = previouslyFocusedRect == null + ? FocusFinder.getInstance().findNextFocus(this, null, direction) + : FocusFinder.getInstance().findNextFocusFromRect( + this, previouslyFocusedRect, direction); + + if (nextFocus == null) + { + return false; + } + + return nextFocus.requestFocus(direction, previouslyFocusedRect); + } + + @Override + public boolean requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate) + { + // offset into coordinate space of this scroll view + rectangle.offset(child.getLeft() - child.getScrollX(), child.getTop() - child.getScrollY()); + return scrollToChildRect(rectangle, immediate); + } + + @Override public void requestLayout() + { + mIsLayoutDirty = true; + super.requestLayout(); + } + + @Override protected void onLayout(boolean changed, int l, int t, int r, int b) + { + super.onLayout(changed, l, t, r, b); + mIsLayoutDirty = false; + // Give a child focus if it needs it + if (mChildToScrollTo != null && isViewDescendantOf(mChildToScrollTo, this)) + { + scrollToChild(mChildToScrollTo); + } + mChildToScrollTo = null; + + // Calling this with the present values causes it to re-clam them + scrollTo(getScrollX(), getScrollY()); + } + + @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) + { + super.onSizeChanged(w, h, oldw, oldh); + + View currentFocused = findFocus(); + if (null == currentFocused || this == currentFocused) + return; + + // If the currently-focused view was visible on the screen when the + // screen was at the old height, then scroll the screen to make that + // view visible with the new screen height. + currentFocused.getDrawingRect(mTempRect); + offsetDescendantRectToMyCoords(currentFocused, mTempRect); + int scrollDeltaX = computeScrollDeltaToGetChildRectOnScreen(mTempRect); + int scrollDeltaY = computeScrollDeltaToGetChildRectOnScreen(mTempRect); + doScroll(scrollDeltaX, scrollDeltaY); + } + + /** + * Return true if child is an descendant of parent, (or equal to the parent). + */ + private boolean isViewDescendantOf(View child, View parent) + { + if (child == parent) + { + return true; + } + + final ViewParent theParent = child.getParent(); + return (theParent instanceof ViewGroup) && isViewDescendantOf((View)theParent, parent); + } + + /** + * Fling the scroll view + * + * @param velocityY The initial velocity in the Y direction. Positive + * numbers mean that the finger/curor is moving down the screen, + * which means we want to scroll towards the top. + */ + public void fling(int velocityX, int velocityY) + { + if (getChildCount() > 0) + { + int height = getHeight() - getPaddingBottom() - getPaddingTop(); + int bottom = getChildAt(0).getHeight(); + int width = getWidth() - getPaddingRight() - getPaddingLeft(); + int right = getChildAt(0).getWidth(); + + mScroller.fling(getScrollX(), getScrollY(), velocityX, velocityY, 0, right - width, 0, + bottom - height); + + final boolean movingDown = velocityY > 0; + final boolean movingRight = velocityX > 0; + + View newFocused = findFocusableViewInMyBounds( + movingRight, mScroller.getFinalX(), movingDown, mScroller.getFinalY(), findFocus()); + if (newFocused == null) + { + newFocused = this; + } + + if (newFocused != findFocus() && + newFocused.requestFocus(movingDown ? View.FOCUS_DOWN : View.FOCUS_UP)) + { + mTwoDScrollViewMovedFocus = true; + mTwoDScrollViewMovedFocus = false; + } + + awakenScrollBars(mScroller.getDuration()); + invalidate(); + } + } + + /** + * {@inheritDoc} + *

+ *

This version also clamps the scrolling to the bounds of our child. + */ + public void scrollTo(int x, int y) + { + // we rely on the fact the View.scrollBy calls scrollTo. + if (getChildCount() > 0) + { + View child = getChildAt(0); + x = clamp(x, getWidth() - getPaddingRight() - getPaddingLeft(), child.getWidth()); + y = clamp(y, getHeight() - getPaddingBottom() - getPaddingTop(), child.getHeight()); + if (x != getScrollX() || y != getScrollY()) + { + super.scrollTo(x, y); + } + } + } + + private int clamp(int n, int my, int child) + { + if (my >= child || n < 0) + { + /* my >= child is this case: + * |--------------- me ---------------| + * |------ child ------| + * or + * |--------------- me ---------------| + * |------ child ------| + * or + * |--------------- me ---------------| + * |------ child ------| + * + * n < 0 is this case: + * |------ me ------| + * |-------- child --------| + * |-- mScrollX --| + */ + return 0; + } + if ((my + n) > child) + { + /* this case: + * |------ me ------| + * |------ child ------| + * |-- mScrollX --| + */ + return child - my; + } + return n; + } + + public void setScrollViewListener(ScrollView2DListener scrollViewListener) + { + this.scrollView2DListener = scrollViewListener; + } + + @Override protected void onScrollChanged(int x, int y, int oldx, int oldy) + { + super.onScrollChanged(x, y, oldx, oldy); + if (scrollView2DListener != null) + { + scrollView2DListener.onScrollChanged(this, x, y, oldx, oldy); + } + } + + // interface to receive notifications when the view is scrolled + public interface ScrollView2DListener { + abstract void onScrollChanged(ScrollView2D scrollView, int x, int y, int oldx, int oldy); + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/SessionActivity.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/SessionActivity.java index c148c718d..2e64f856f 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/SessionActivity.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/SessionActivity.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.presentation; @@ -63,1305 +64,1370 @@ import java.util.Collection; import java.util.Iterator; import java.util.List; -public class SessionActivity extends AppCompatActivity implements - LibFreeRDP.UIEventListener, KeyboardView.OnKeyboardActionListener, - ScrollView2D.ScrollView2DListener, - KeyboardMapper.KeyProcessingListener, SessionView.SessionViewListener, - TouchPointerView.TouchPointerListener, - ClipboardManagerProxy.OnClipboardChangedListener { - public static final String PARAM_CONNECTION_REFERENCE = "conRef"; - public static final String PARAM_INSTANCE = "instance"; - private static final float ZOOMING_STEP = 0.5f; - private static final int ZOOMCONTROLS_AUTOHIDE_TIMEOUT = 4000; - // timeout between subsequent scrolling requests when the touch-pointer is - // at the edge of the session view - private static final int SCROLLING_TIMEOUT = 50; - private static final int SCROLLING_DISTANCE = 20; - private static final String TAG = "FreeRDP.SessionActivity"; - // variables for delayed move event sending - private static final int MAX_DISCARDED_MOVE_EVENTS = 3; - private static final int SEND_MOVE_EVENT_TIMEOUT = 150; - private Bitmap bitmap; - private SessionState session; - private SessionView sessionView; - private TouchPointerView touchPointerView; - private ProgressDialog progressDialog; - private KeyboardView keyboardView; - private KeyboardView modifiersKeyboardView; - private ZoomControls zoomControls; - private KeyboardMapper keyboardMapper; - - private Keyboard specialkeysKeyboard; - private Keyboard numpadKeyboard; - private Keyboard cursorKeyboard; - private Keyboard modifiersKeyboard; - - private AlertDialog dlgVerifyCertificate; - private AlertDialog dlgUserCredentials; - private View userCredView; - - private UIHandler uiHandler; - - private int screen_width; - private int screen_height; - - private boolean connectCancelledByUser = false; - private boolean sessionRunning = false; - private boolean toggleMouseButtons = false; - - private LibFreeRDPBroadcastReceiver libFreeRDPBroadcastReceiver; - private ScrollView2D scrollView; - // keyboard visibility flags - private boolean sysKeyboardVisible = false; - private boolean extKeyboardVisible = false; - private int discardedMoveEvents = 0; - private ClipboardManagerProxy mClipboardManager; - private boolean callbackDialogResult; - View mDecor; - - private void createDialogs() { - // build verify certificate dialog - dlgVerifyCertificate = new AlertDialog.Builder(this) - .setTitle(R.string.dlg_title_verify_certificate) - .setPositiveButton(android.R.string.yes, - new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, - int which) { - callbackDialogResult = true; - synchronized (dialog) { - dialog.notify(); - } - } - }) - .setNegativeButton(android.R.string.no, - new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, - int which) { - callbackDialogResult = false; - connectCancelledByUser = true; - synchronized (dialog) { - dialog.notify(); - } - } - }).setCancelable(false).create(); - - // build the dialog - userCredView = getLayoutInflater().inflate(R.layout.credentials, null, - true); - dlgUserCredentials = new AlertDialog.Builder(this) - .setView(userCredView) - .setTitle(R.string.dlg_title_credentials) - .setPositiveButton(android.R.string.ok, - new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, - int which) { - callbackDialogResult = true; - synchronized (dialog) { - dialog.notify(); - } - } - }) - .setNegativeButton(android.R.string.cancel, - new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, - int which) { - callbackDialogResult = false; - connectCancelledByUser = true; - synchronized (dialog) { - dialog.notify(); - } - } - }).setCancelable(false).create(); - } - - private boolean hasHardwareMenuButton() { - if (Build.VERSION.SDK_INT <= 10) - return true; - - if (Build.VERSION.SDK_INT >= 14) { - boolean rc = false; - final ViewConfiguration cfg = ViewConfiguration.get(this); - - return cfg.hasPermanentMenuKey(); - } - - return false; - } - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - // show status bar or make fullscreen? - if (ApplicationSettingsActivity.getHideStatusBar(this)) { - getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, - WindowManager.LayoutParams.FLAG_FULLSCREEN); - } - - this.setContentView(R.layout.session); - if (hasHardwareMenuButton() || ApplicationSettingsActivity.getHideActionBar(this)) { - this.getSupportActionBar().hide(); - } else - this.getSupportActionBar().show(); - - Log.v(TAG, "Session.onCreate"); - - // ATTENTION: We use the onGlobalLayout notification to start our - // session. - // This is because only then we can know the exact size of our session - // when using fit screen - // accounting for any status bars etc. that Android might throws on us. - // A bit weird looking - // but this is the only way ... - final View activityRootView = findViewById(R.id.session_root_view); - activityRootView.getViewTreeObserver().addOnGlobalLayoutListener( - new OnGlobalLayoutListener() { - @Override - public void onGlobalLayout() { - screen_width = activityRootView.getWidth(); - screen_height = activityRootView.getHeight(); - - // start session - if (!sessionRunning && getIntent() != null) { - processIntent(getIntent()); - sessionRunning = true; - } - } - }); - - sessionView = (SessionView) findViewById(R.id.sessionView); - sessionView.setScaleGestureDetector(new ScaleGestureDetector(this, - new PinchZoomListener())); - sessionView.setSessionViewListener(this); - sessionView.requestFocus(); - - touchPointerView = (TouchPointerView) findViewById(R.id.touchPointerView); - touchPointerView.setTouchPointerListener(this); - - keyboardMapper = new KeyboardMapper(); - keyboardMapper.init(this); - keyboardMapper.reset(this); - - modifiersKeyboard = new Keyboard(getApplicationContext(), - R.xml.modifiers_keyboard); - specialkeysKeyboard = new Keyboard(getApplicationContext(), - R.xml.specialkeys_keyboard); - numpadKeyboard = new Keyboard(getApplicationContext(), - R.xml.numpad_keyboard); - cursorKeyboard = new Keyboard(getApplicationContext(), - R.xml.cursor_keyboard); - - // hide keyboard below the sessionView - keyboardView = (KeyboardView) findViewById(R.id.extended_keyboard); - keyboardView.setKeyboard(specialkeysKeyboard); - keyboardView.setOnKeyboardActionListener(this); - - modifiersKeyboardView = (KeyboardView) findViewById(R.id.extended_keyboard_header); - modifiersKeyboardView.setKeyboard(modifiersKeyboard); - modifiersKeyboardView.setOnKeyboardActionListener(this); - - scrollView = (ScrollView2D) findViewById(R.id.sessionScrollView); - scrollView.setScrollViewListener(this); - uiHandler = new UIHandler(); - libFreeRDPBroadcastReceiver = new LibFreeRDPBroadcastReceiver(); - - zoomControls = (ZoomControls) findViewById(R.id.zoomControls); - zoomControls.hide(); - zoomControls.setOnZoomInClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - resetZoomControlsAutoHideTimeout(); - zoomControls.setIsZoomInEnabled(sessionView - .zoomIn(ZOOMING_STEP)); - zoomControls.setIsZoomOutEnabled(true); - } - }); - zoomControls.setOnZoomOutClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - resetZoomControlsAutoHideTimeout(); - zoomControls.setIsZoomOutEnabled(sessionView - .zoomOut(ZOOMING_STEP)); - zoomControls.setIsZoomInEnabled(true); - } - }); - - toggleMouseButtons = false; - - createDialogs(); - - // register freerdp events broadcast receiver - IntentFilter filter = new IntentFilter(); - filter.addAction(GlobalApp.ACTION_EVENT_FREERDP); - registerReceiver(libFreeRDPBroadcastReceiver, filter); - - mClipboardManager = ClipboardManagerProxy.getClipboardManager(this); - mClipboardManager.addClipboardChangedListener(this); - - mDecor = getWindow().getDecorView(); - mDecor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); - } - - @Override - protected void onStart() { - super.onStart(); - Log.v(TAG, "Session.onStart"); - } - - @Override - protected void onRestart() { - super.onRestart(); - Log.v(TAG, "Session.onRestart"); - } - - @Override - protected void onResume() { - super.onResume(); - Log.v(TAG, "Session.onResume"); - } - - @Override - protected void onPause() { - super.onPause(); - Log.v(TAG, "Session.onPause"); - - // hide any visible keyboards - showKeyboard(false, false); - } - - @Override - protected void onStop() { - super.onStop(); - Log.v(TAG, "Session.onStop"); - } - - @Override - protected void onDestroy() { - super.onDestroy(); - Log.v(TAG, "Session.onDestroy"); - - // Cancel running disconnect timers. - GlobalApp.cancelDisconnectTimer(); - - // Disconnect all remaining sessions. - Collection sessions = GlobalApp.getSessions(); - for (SessionState session : sessions) - LibFreeRDP.disconnect(session.getInstance()); - - // unregister freerdp events broadcast receiver - unregisterReceiver(libFreeRDPBroadcastReceiver); - - // remove clipboard listener - mClipboardManager.removeClipboardboardChangedListener(this); - - // free session - GlobalApp.freeSession(session.getInstance()); - - session = null; - } - - @Override - public void onConfigurationChanged(Configuration newConfig) { - super.onConfigurationChanged(newConfig); - - // reload keyboard resources (changed from landscape) - modifiersKeyboard = new Keyboard(getApplicationContext(), - R.xml.modifiers_keyboard); - specialkeysKeyboard = new Keyboard(getApplicationContext(), - R.xml.specialkeys_keyboard); - numpadKeyboard = new Keyboard(getApplicationContext(), - R.xml.numpad_keyboard); - cursorKeyboard = new Keyboard(getApplicationContext(), - R.xml.cursor_keyboard); - - // apply loaded keyboards - keyboardView.setKeyboard(specialkeysKeyboard); - modifiersKeyboardView.setKeyboard(modifiersKeyboard); - - mDecor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); - } - - private void processIntent(Intent intent) { - // get either session instance or create one from a bookmark/uri - Bundle bundle = intent.getExtras(); - Uri openUri = intent.getData(); - if (openUri != null) { - // Launched from URI, e.g: - // freerdp://user@ip:port/connect?sound=&rfx=&p=password&clipboard=%2b&themes=- - connect(openUri); - } else if (bundle.containsKey(PARAM_INSTANCE)) { - int inst = bundle.getInt(PARAM_INSTANCE); - session = GlobalApp.getSession(inst); - bitmap = session.getSurface().getBitmap(); - bindSession(); - } else if (bundle.containsKey(PARAM_CONNECTION_REFERENCE)) { - BookmarkBase bookmark = null; - String refStr = bundle.getString(PARAM_CONNECTION_REFERENCE); - if (ConnectionReference.isHostnameReference(refStr)) { - bookmark = new ManualBookmark(); - bookmark.get().setHostname( - ConnectionReference.getHostname(refStr)); - } else if (ConnectionReference.isBookmarkReference(refStr)) { - if (ConnectionReference.isManualBookmarkReference(refStr)) - bookmark = GlobalApp.getManualBookmarkGateway().findById( - ConnectionReference.getManualBookmarkId(refStr)); - else - assert false; - } - - if (bookmark != null) - connect(bookmark); - else - closeSessionActivity(RESULT_CANCELED); - } else { - // no session found - exit - closeSessionActivity(RESULT_CANCELED); - } - } - - private void connect(BookmarkBase bookmark) { - session = GlobalApp.createSession(bookmark, getApplicationContext()); - - BookmarkBase.ScreenSettings screenSettings = session.getBookmark() - .getActiveScreenSettings(); - Log.v(TAG, "Screen Resolution: " + screenSettings.getResolutionString()); - if (screenSettings.isAutomatic()) { - if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE) { - // large screen device i.e. tablet: simply use screen info - screenSettings.setHeight(screen_height); - screenSettings.setWidth(screen_width); - } else { - // small screen device i.e. phone: - // Automatic uses the largest side length of the screen and - // makes a 16:10 resolution setting out of it - int screenMax = (screen_width > screen_height) ? screen_width - : screen_height; - screenSettings.setHeight(screenMax); - screenSettings.setWidth((int) ((float) screenMax * 1.6f)); - } - } - if (screenSettings.isFitScreen()) { - screenSettings.setHeight(screen_height); - screenSettings.setWidth(screen_width); - } - - connectWithTitle(bookmark.getLabel()); - } - - private void connect(Uri openUri) { - session = GlobalApp.createSession(openUri, getApplicationContext()); - - connectWithTitle(openUri.getAuthority()); - } - - private void connectWithTitle(String title) { - session.setUIEventListener(this); - - progressDialog = new ProgressDialog(this); - progressDialog.setTitle(title); - progressDialog.setMessage(getResources().getText( - R.string.dlg_msg_connecting)); - progressDialog.setButton(ProgressDialog.BUTTON_NEGATIVE, "Cancel", - new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - connectCancelledByUser = true; - LibFreeRDP.cancelConnection(session.getInstance()); - } - }); - progressDialog.setCancelable(false); - progressDialog.show(); - - Thread thread = new Thread(new Runnable() { - public void run() { - session.connect(getApplicationContext()); - } - }); - thread.start(); - } - - // binds the current session to the activity by wiring it up with the - // sessionView and updating all internal objects accordingly - private void bindSession() { - Log.v(TAG, "bindSession called"); - session.setUIEventListener(this); - sessionView.onSurfaceChange(session); - scrollView.requestLayout(); - keyboardMapper.reset(this); - mDecor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); - - } - - private void hideSoftInput() { - InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); - - if (mgr.isActive()) { - mgr.toggleSoftInput(InputMethodManager.HIDE_NOT_ALWAYS, 0); - } else { - mgr.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS); - } - } - - // displays either the system or the extended keyboard or non of them - private void showKeyboard(final boolean showSystemKeyboard, - final boolean showExtendedKeyboard) { - // no matter what we are doing ... hide the zoom controls - // TODO: this is not working correctly as hiding the keyboard issues a - // onScrollChange notification showing the control again ... - uiHandler.removeMessages(UIHandler.HIDE_ZOOMCONTROLS); - if (zoomControls.getVisibility() == View.VISIBLE) - zoomControls.hide(); - - InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); - - if (showSystemKeyboard) { - // hide extended keyboard - keyboardView.setVisibility(View.GONE); - // show system keyboard - mgr.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); - - // show modifiers keyboard - modifiersKeyboardView.setVisibility(View.VISIBLE); - } else if (showExtendedKeyboard) { - // hide system keyboard - hideSoftInput(); - - // show extended keyboard - keyboardView.setKeyboard(specialkeysKeyboard); - keyboardView.setVisibility(View.VISIBLE); - modifiersKeyboardView.setVisibility(View.VISIBLE); - } else { - // hide both - hideSoftInput(); - keyboardView.setVisibility(View.GONE); - modifiersKeyboardView.setVisibility(View.GONE); - - // clear any active key modifiers) - keyboardMapper.clearlAllModifiers(); - } - - sysKeyboardVisible = showSystemKeyboard; - extKeyboardVisible = showExtendedKeyboard; - } - - private void closeSessionActivity(int resultCode) { - // Go back to home activity (and send intent data back to home) - setResult(resultCode, getIntent()); - finish(); - } - - // update the state of our modifier keys - private void updateModifierKeyStates() { - // check if any key is in the keycodes list - - List keys = modifiersKeyboard.getKeys(); - for (Iterator it = keys.iterator(); it.hasNext(); ) { - // if the key is a sticky key - just set it to off - Keyboard.Key curKey = it.next(); - if (curKey.sticky) { - switch (keyboardMapper.getModifierState(curKey.codes[0])) { - case KeyboardMapper.KEYSTATE_ON: - curKey.on = true; - curKey.pressed = false; - break; - - case KeyboardMapper.KEYSTATE_OFF: - curKey.on = false; - curKey.pressed = false; - break; - - case KeyboardMapper.KEYSTATE_LOCKED: - curKey.on = true; - curKey.pressed = true; - break; - } - } - } - - // refresh image - modifiersKeyboardView.invalidateAllKeys(); - } - - private void sendDelayedMoveEvent(int x, int y) { - if (uiHandler.hasMessages(UIHandler.SEND_MOVE_EVENT)) { - uiHandler.removeMessages(UIHandler.SEND_MOVE_EVENT); - discardedMoveEvents++; - } else - discardedMoveEvents = 0; - - if (discardedMoveEvents > MAX_DISCARDED_MOVE_EVENTS) - LibFreeRDP.sendCursorEvent(session.getInstance(), x, y, - Mouse.getMoveEvent()); - else - uiHandler.sendMessageDelayed( - Message.obtain(null, UIHandler.SEND_MOVE_EVENT, x, y), - SEND_MOVE_EVENT_TIMEOUT); - } - - private void cancelDelayedMoveEvent() { - uiHandler.removeMessages(UIHandler.SEND_MOVE_EVENT); - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - getMenuInflater().inflate(R.menu.session_menu, menu); - return true; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - // refer to http://tools.android.com/tips/non-constant-fields why we - // can't use switch/case here .. - int itemId = item.getItemId(); - - if (itemId == R.id.session_touch_pointer) { - // toggle touch pointer - if (touchPointerView.getVisibility() == View.VISIBLE) { - touchPointerView.setVisibility(View.INVISIBLE); - sessionView.setTouchPointerPadding(0, 0); - } else { - touchPointerView.setVisibility(View.VISIBLE); - sessionView.setTouchPointerPadding( - touchPointerView.getPointerWidth(), - touchPointerView.getPointerHeight()); - } - } else if (itemId == R.id.session_sys_keyboard) { - showKeyboard(!sysKeyboardVisible, false); - } else if (itemId == R.id.session_ext_keyboard) { - showKeyboard(false, !extKeyboardVisible); - } else if (itemId == R.id.session_disconnect) { - showKeyboard(false, false); - LibFreeRDP.disconnect(session.getInstance()); - } - - return true; - } - - @Override - public void onBackPressed() { - // hide keyboards (if any visible) or send alt+f4 to the session - if (sysKeyboardVisible || extKeyboardVisible) - showKeyboard(false, false); - else - keyboardMapper.sendAltF4(); - } - - @Override - public boolean onKeyLongPress(int keyCode, KeyEvent event) { - if (keyCode == KeyEvent.KEYCODE_BACK) { - LibFreeRDP.disconnect(session.getInstance()); - return true; - } - return super.onKeyLongPress(keyCode, event); - } - - // android keyboard input handling - // We always use the unicode value to process input from the android - // keyboard except if key modifiers - // (like Win, Alt, Ctrl) are activated. In this case we will send the - // virtual key code to allow key - // combinations (like Win + E to open the explorer). - @Override - public boolean onKeyDown(int keycode, KeyEvent event) { - return keyboardMapper.processAndroidKeyEvent(event); - } - - @Override - public boolean onKeyUp(int keycode, KeyEvent event) { - return keyboardMapper.processAndroidKeyEvent(event); - } - - // onKeyMultiple is called for input of some special characters like umlauts - // and some symbol characters - @Override - public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event) { - return keyboardMapper.processAndroidKeyEvent(event); - } - - // **************************************************************************** - // KeyboardView.KeyboardActionEventListener - @Override - public void onKey(int primaryCode, int[] keyCodes) { - keyboardMapper.processCustomKeyEvent(primaryCode); - } - - @Override - public void onText(CharSequence text) { - } - - @Override - public void swipeRight() { - } - - @Override - public void swipeLeft() { - } - - @Override - public void swipeDown() { - } - - @Override - public void swipeUp() { - } - - @Override - public void onPress(int primaryCode) { - } - - @Override - public void onRelease(int primaryCode) { - } - - // **************************************************************************** - // KeyboardMapper.KeyProcessingListener implementation - @Override - public void processVirtualKey(int virtualKeyCode, boolean down) { - LibFreeRDP.sendKeyEvent(session.getInstance(), virtualKeyCode, down); - } - - @Override - public void processUnicodeKey(int unicodeKey) { - LibFreeRDP.sendUnicodeKeyEvent(session.getInstance(), unicodeKey, true); - LibFreeRDP.sendUnicodeKeyEvent(session.getInstance(), unicodeKey, false); - } - - @Override - public void switchKeyboard(int keyboardType) { - switch (keyboardType) { - case KeyboardMapper.KEYBOARD_TYPE_FUNCTIONKEYS: - keyboardView.setKeyboard(specialkeysKeyboard); - break; - - case KeyboardMapper.KEYBOARD_TYPE_NUMPAD: - keyboardView.setKeyboard(numpadKeyboard); - break; - - case KeyboardMapper.KEYBOARD_TYPE_CURSOR: - keyboardView.setKeyboard(cursorKeyboard); - break; - - default: - break; - } - } - - @Override - public void modifiersChanged() { - updateModifierKeyStates(); - } - - // **************************************************************************** - // LibFreeRDP UI event listener implementation - @Override - public void OnSettingsChanged(int width, int height, int bpp) { - - if (bpp > 16) - bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888); - else - bitmap = Bitmap.createBitmap(width, height, Config.RGB_565); - - session.setSurface(new BitmapDrawable(bitmap)); - - if (session.getBookmark() == null) { - // Return immediately if we launch from URI - return; - } - - // check this settings and initial settings - if they are not equal the - // server doesn't support our settings - // FIXME: the additional check (settings.getWidth() != width + 1) is for - // the RDVH bug fix to avoid accidental notifications - // (refer to android_freerdp.c for more info on this problem) - BookmarkBase.ScreenSettings settings = session.getBookmark() - .getActiveScreenSettings(); - if ((settings.getWidth() != width && settings.getWidth() != width + 1) - || settings.getHeight() != height - || settings.getColors() != bpp) - uiHandler - .sendMessage(Message.obtain( - null, - UIHandler.DISPLAY_TOAST, - getResources().getText( - R.string.info_capabilities_changed))); - } - - @Override - public void OnGraphicsUpdate(int x, int y, int width, int height) { - LibFreeRDP.updateGraphics(session.getInstance(), bitmap, x, y, width, - height); - - sessionView.addInvalidRegion(new Rect(x, y, x + width, y + height)); +public class SessionActivity extends AppCompatActivity + implements LibFreeRDP.UIEventListener, KeyboardView.OnKeyboardActionListener, + ScrollView2D.ScrollView2DListener, KeyboardMapper.KeyProcessingListener, + SessionView.SessionViewListener, TouchPointerView.TouchPointerListener, + ClipboardManagerProxy.OnClipboardChangedListener +{ + public static final String PARAM_CONNECTION_REFERENCE = "conRef"; + public static final String PARAM_INSTANCE = "instance"; + private static final float ZOOMING_STEP = 0.5f; + private static final int ZOOMCONTROLS_AUTOHIDE_TIMEOUT = 4000; + // timeout between subsequent scrolling requests when the touch-pointer is + // at the edge of the session view + private static final int SCROLLING_TIMEOUT = 50; + private static final int SCROLLING_DISTANCE = 20; + private static final String TAG = "FreeRDP.SessionActivity"; + // variables for delayed move event sending + private static final int MAX_DISCARDED_MOVE_EVENTS = 3; + private static final int SEND_MOVE_EVENT_TIMEOUT = 150; + private Bitmap bitmap; + private SessionState session; + private SessionView sessionView; + private TouchPointerView touchPointerView; + private ProgressDialog progressDialog; + private KeyboardView keyboardView; + private KeyboardView modifiersKeyboardView; + private ZoomControls zoomControls; + private KeyboardMapper keyboardMapper; + + private Keyboard specialkeysKeyboard; + private Keyboard numpadKeyboard; + private Keyboard cursorKeyboard; + private Keyboard modifiersKeyboard; + + private AlertDialog dlgVerifyCertificate; + private AlertDialog dlgUserCredentials; + private View userCredView; + + private UIHandler uiHandler; + + private int screen_width; + private int screen_height; + + private boolean connectCancelledByUser = false; + private boolean sessionRunning = false; + private boolean toggleMouseButtons = false; + + private LibFreeRDPBroadcastReceiver libFreeRDPBroadcastReceiver; + private ScrollView2D scrollView; + // keyboard visibility flags + private boolean sysKeyboardVisible = false; + private boolean extKeyboardVisible = false; + private int discardedMoveEvents = 0; + private ClipboardManagerProxy mClipboardManager; + private boolean callbackDialogResult; + View mDecor; + + private void createDialogs() + { + // build verify certificate dialog + dlgVerifyCertificate = + new AlertDialog.Builder(this) + .setTitle(R.string.dlg_title_verify_certificate) + .setPositiveButton(android.R.string.yes, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) + { + callbackDialogResult = true; + synchronized (dialog) + { + dialog.notify(); + } + } + }) + .setNegativeButton(android.R.string.no, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) + { + callbackDialogResult = false; + connectCancelledByUser = true; + synchronized (dialog) + { + dialog.notify(); + } + } + }) + .setCancelable(false) + .create(); + + // build the dialog + userCredView = getLayoutInflater().inflate(R.layout.credentials, null, true); + dlgUserCredentials = + new AlertDialog.Builder(this) + .setView(userCredView) + .setTitle(R.string.dlg_title_credentials) + .setPositiveButton(android.R.string.ok, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) + { + callbackDialogResult = true; + synchronized (dialog) + { + dialog.notify(); + } + } + }) + .setNegativeButton(android.R.string.cancel, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) + { + callbackDialogResult = false; + connectCancelledByUser = true; + synchronized (dialog) + { + dialog.notify(); + } + } + }) + .setCancelable(false) + .create(); + } + + private boolean hasHardwareMenuButton() + { + if (Build.VERSION.SDK_INT <= 10) + return true; + + if (Build.VERSION.SDK_INT >= 14) + { + boolean rc = false; + final ViewConfiguration cfg = ViewConfiguration.get(this); + + return cfg.hasPermanentMenuKey(); + } + + return false; + } + + @Override public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + + // show status bar or make fullscreen? + if (ApplicationSettingsActivity.getHideStatusBar(this)) + { + getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, + WindowManager.LayoutParams.FLAG_FULLSCREEN); + } + + this.setContentView(R.layout.session); + if (hasHardwareMenuButton() || ApplicationSettingsActivity.getHideActionBar(this)) + { + this.getSupportActionBar().hide(); + } + else + this.getSupportActionBar().show(); + + Log.v(TAG, "Session.onCreate"); + + // ATTENTION: We use the onGlobalLayout notification to start our + // session. + // This is because only then we can know the exact size of our session + // when using fit screen + // accounting for any status bars etc. that Android might throws on us. + // A bit weird looking + // but this is the only way ... + final View activityRootView = findViewById(R.id.session_root_view); + activityRootView.getViewTreeObserver().addOnGlobalLayoutListener( + new OnGlobalLayoutListener() { + @Override public void onGlobalLayout() + { + screen_width = activityRootView.getWidth(); + screen_height = activityRootView.getHeight(); + + // start session + if (!sessionRunning && getIntent() != null) + { + processIntent(getIntent()); + sessionRunning = true; + } + } + }); + + sessionView = (SessionView)findViewById(R.id.sessionView); + sessionView.setScaleGestureDetector( + new ScaleGestureDetector(this, new PinchZoomListener())); + sessionView.setSessionViewListener(this); + sessionView.requestFocus(); + + touchPointerView = (TouchPointerView)findViewById(R.id.touchPointerView); + touchPointerView.setTouchPointerListener(this); + + keyboardMapper = new KeyboardMapper(); + keyboardMapper.init(this); + keyboardMapper.reset(this); + + modifiersKeyboard = new Keyboard(getApplicationContext(), R.xml.modifiers_keyboard); + specialkeysKeyboard = new Keyboard(getApplicationContext(), R.xml.specialkeys_keyboard); + numpadKeyboard = new Keyboard(getApplicationContext(), R.xml.numpad_keyboard); + cursorKeyboard = new Keyboard(getApplicationContext(), R.xml.cursor_keyboard); + + // hide keyboard below the sessionView + keyboardView = (KeyboardView)findViewById(R.id.extended_keyboard); + keyboardView.setKeyboard(specialkeysKeyboard); + keyboardView.setOnKeyboardActionListener(this); + + modifiersKeyboardView = (KeyboardView)findViewById(R.id.extended_keyboard_header); + modifiersKeyboardView.setKeyboard(modifiersKeyboard); + modifiersKeyboardView.setOnKeyboardActionListener(this); + + scrollView = (ScrollView2D)findViewById(R.id.sessionScrollView); + scrollView.setScrollViewListener(this); + uiHandler = new UIHandler(); + libFreeRDPBroadcastReceiver = new LibFreeRDPBroadcastReceiver(); + + zoomControls = (ZoomControls)findViewById(R.id.zoomControls); + zoomControls.hide(); + zoomControls.setOnZoomInClickListener(new View.OnClickListener() { + @Override public void onClick(View v) + { + resetZoomControlsAutoHideTimeout(); + zoomControls.setIsZoomInEnabled(sessionView.zoomIn(ZOOMING_STEP)); + zoomControls.setIsZoomOutEnabled(true); + } + }); + zoomControls.setOnZoomOutClickListener(new View.OnClickListener() { + @Override public void onClick(View v) + { + resetZoomControlsAutoHideTimeout(); + zoomControls.setIsZoomOutEnabled(sessionView.zoomOut(ZOOMING_STEP)); + zoomControls.setIsZoomInEnabled(true); + } + }); + + toggleMouseButtons = false; + + createDialogs(); + + // register freerdp events broadcast receiver + IntentFilter filter = new IntentFilter(); + filter.addAction(GlobalApp.ACTION_EVENT_FREERDP); + registerReceiver(libFreeRDPBroadcastReceiver, filter); + + mClipboardManager = ClipboardManagerProxy.getClipboardManager(this); + mClipboardManager.addClipboardChangedListener(this); + + mDecor = getWindow().getDecorView(); + mDecor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | + View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); + } + + @Override protected void onStart() + { + super.onStart(); + Log.v(TAG, "Session.onStart"); + } + + @Override protected void onRestart() + { + super.onRestart(); + Log.v(TAG, "Session.onRestart"); + } + + @Override protected void onResume() + { + super.onResume(); + Log.v(TAG, "Session.onResume"); + } + + @Override protected void onPause() + { + super.onPause(); + Log.v(TAG, "Session.onPause"); + + // hide any visible keyboards + showKeyboard(false, false); + } + + @Override protected void onStop() + { + super.onStop(); + Log.v(TAG, "Session.onStop"); + } + + @Override protected void onDestroy() + { + super.onDestroy(); + Log.v(TAG, "Session.onDestroy"); + + // Cancel running disconnect timers. + GlobalApp.cancelDisconnectTimer(); + + // Disconnect all remaining sessions. + Collection sessions = GlobalApp.getSessions(); + for (SessionState session : sessions) + LibFreeRDP.disconnect(session.getInstance()); + + // unregister freerdp events broadcast receiver + unregisterReceiver(libFreeRDPBroadcastReceiver); + + // remove clipboard listener + mClipboardManager.removeClipboardboardChangedListener(this); + + // free session + GlobalApp.freeSession(session.getInstance()); + + session = null; + } + + @Override public void onConfigurationChanged(Configuration newConfig) + { + super.onConfigurationChanged(newConfig); + + // reload keyboard resources (changed from landscape) + modifiersKeyboard = new Keyboard(getApplicationContext(), R.xml.modifiers_keyboard); + specialkeysKeyboard = new Keyboard(getApplicationContext(), R.xml.specialkeys_keyboard); + numpadKeyboard = new Keyboard(getApplicationContext(), R.xml.numpad_keyboard); + cursorKeyboard = new Keyboard(getApplicationContext(), R.xml.cursor_keyboard); + + // apply loaded keyboards + keyboardView.setKeyboard(specialkeysKeyboard); + modifiersKeyboardView.setKeyboard(modifiersKeyboard); + + mDecor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | + View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); + } + + private void processIntent(Intent intent) + { + // get either session instance or create one from a bookmark/uri + Bundle bundle = intent.getExtras(); + Uri openUri = intent.getData(); + if (openUri != null) + { + // Launched from URI, e.g: + // freerdp://user@ip:port/connect?sound=&rfx=&p=password&clipboard=%2b&themes=- + connect(openUri); + } + else if (bundle.containsKey(PARAM_INSTANCE)) + { + int inst = bundle.getInt(PARAM_INSTANCE); + session = GlobalApp.getSession(inst); + bitmap = session.getSurface().getBitmap(); + bindSession(); + } + else if (bundle.containsKey(PARAM_CONNECTION_REFERENCE)) + { + BookmarkBase bookmark = null; + String refStr = bundle.getString(PARAM_CONNECTION_REFERENCE); + if (ConnectionReference.isHostnameReference(refStr)) + { + bookmark = new ManualBookmark(); + bookmark.get().setHostname(ConnectionReference.getHostname(refStr)); + } + else if (ConnectionReference.isBookmarkReference(refStr)) + { + if (ConnectionReference.isManualBookmarkReference(refStr)) + bookmark = GlobalApp.getManualBookmarkGateway().findById( + ConnectionReference.getManualBookmarkId(refStr)); + else + assert false; + } + + if (bookmark != null) + connect(bookmark); + else + closeSessionActivity(RESULT_CANCELED); + } + else + { + // no session found - exit + closeSessionActivity(RESULT_CANCELED); + } + } + + private void connect(BookmarkBase bookmark) + { + session = GlobalApp.createSession(bookmark, getApplicationContext()); + + BookmarkBase.ScreenSettings screenSettings = + session.getBookmark().getActiveScreenSettings(); + Log.v(TAG, "Screen Resolution: " + screenSettings.getResolutionString()); + if (screenSettings.isAutomatic()) + { + if ((getResources().getConfiguration().screenLayout & + Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE) + { + // large screen device i.e. tablet: simply use screen info + screenSettings.setHeight(screen_height); + screenSettings.setWidth(screen_width); + } + else + { + // small screen device i.e. phone: + // Automatic uses the largest side length of the screen and + // makes a 16:10 resolution setting out of it + int screenMax = (screen_width > screen_height) ? screen_width : screen_height; + screenSettings.setHeight(screenMax); + screenSettings.setWidth((int)((float)screenMax * 1.6f)); + } + } + if (screenSettings.isFitScreen()) + { + screenSettings.setHeight(screen_height); + screenSettings.setWidth(screen_width); + } + + connectWithTitle(bookmark.getLabel()); + } + + private void connect(Uri openUri) + { + session = GlobalApp.createSession(openUri, getApplicationContext()); + + connectWithTitle(openUri.getAuthority()); + } + + private void connectWithTitle(String title) + { + session.setUIEventListener(this); + + progressDialog = new ProgressDialog(this); + progressDialog.setTitle(title); + progressDialog.setMessage(getResources().getText(R.string.dlg_msg_connecting)); + progressDialog.setButton( + ProgressDialog.BUTTON_NEGATIVE, "Cancel", new DialogInterface.OnClickListener() { + @Override public void onClick(DialogInterface dialog, int which) + { + connectCancelledByUser = true; + LibFreeRDP.cancelConnection(session.getInstance()); + } + }); + progressDialog.setCancelable(false); + progressDialog.show(); + + Thread thread = new Thread(new Runnable() { + public void run() + { + session.connect(getApplicationContext()); + } + }); + thread.start(); + } + + // binds the current session to the activity by wiring it up with the + // sessionView and updating all internal objects accordingly + private void bindSession() + { + Log.v(TAG, "bindSession called"); + session.setUIEventListener(this); + sessionView.onSurfaceChange(session); + scrollView.requestLayout(); + keyboardMapper.reset(this); + mDecor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | + View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); + } + + private void hideSoftInput() + { + InputMethodManager mgr = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); + + if (mgr.isActive()) + { + mgr.toggleSoftInput(InputMethodManager.HIDE_NOT_ALWAYS, 0); + } + else + { + mgr.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS); + } + } + + // displays either the system or the extended keyboard or non of them + private void showKeyboard(final boolean showSystemKeyboard, final boolean showExtendedKeyboard) + { + // no matter what we are doing ... hide the zoom controls + // TODO: this is not working correctly as hiding the keyboard issues a + // onScrollChange notification showing the control again ... + uiHandler.removeMessages(UIHandler.HIDE_ZOOMCONTROLS); + if (zoomControls.getVisibility() == View.VISIBLE) + zoomControls.hide(); + + InputMethodManager mgr = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); + + if (showSystemKeyboard) + { + // hide extended keyboard + keyboardView.setVisibility(View.GONE); + // show system keyboard + mgr.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); + + // show modifiers keyboard + modifiersKeyboardView.setVisibility(View.VISIBLE); + } + else if (showExtendedKeyboard) + { + // hide system keyboard + hideSoftInput(); + + // show extended keyboard + keyboardView.setKeyboard(specialkeysKeyboard); + keyboardView.setVisibility(View.VISIBLE); + modifiersKeyboardView.setVisibility(View.VISIBLE); + } + else + { + // hide both + hideSoftInput(); + keyboardView.setVisibility(View.GONE); + modifiersKeyboardView.setVisibility(View.GONE); + + // clear any active key modifiers) + keyboardMapper.clearlAllModifiers(); + } + + sysKeyboardVisible = showSystemKeyboard; + extKeyboardVisible = showExtendedKeyboard; + } + + private void closeSessionActivity(int resultCode) + { + // Go back to home activity (and send intent data back to home) + setResult(resultCode, getIntent()); + finish(); + } + + // update the state of our modifier keys + private void updateModifierKeyStates() + { + // check if any key is in the keycodes list + + List keys = modifiersKeyboard.getKeys(); + for (Iterator it = keys.iterator(); it.hasNext();) + { + // if the key is a sticky key - just set it to off + Keyboard.Key curKey = it.next(); + if (curKey.sticky) + { + switch (keyboardMapper.getModifierState(curKey.codes[0])) + { + case KeyboardMapper.KEYSTATE_ON: + curKey.on = true; + curKey.pressed = false; + break; + + case KeyboardMapper.KEYSTATE_OFF: + curKey.on = false; + curKey.pressed = false; + break; + + case KeyboardMapper.KEYSTATE_LOCKED: + curKey.on = true; + curKey.pressed = true; + break; + } + } + } + + // refresh image + modifiersKeyboardView.invalidateAllKeys(); + } + + private void sendDelayedMoveEvent(int x, int y) + { + if (uiHandler.hasMessages(UIHandler.SEND_MOVE_EVENT)) + { + uiHandler.removeMessages(UIHandler.SEND_MOVE_EVENT); + discardedMoveEvents++; + } + else + discardedMoveEvents = 0; + + if (discardedMoveEvents > MAX_DISCARDED_MOVE_EVENTS) + LibFreeRDP.sendCursorEvent(session.getInstance(), x, y, Mouse.getMoveEvent()); + else + uiHandler.sendMessageDelayed(Message.obtain(null, UIHandler.SEND_MOVE_EVENT, x, y), + SEND_MOVE_EVENT_TIMEOUT); + } + + private void cancelDelayedMoveEvent() + { + uiHandler.removeMessages(UIHandler.SEND_MOVE_EVENT); + } + + @Override public boolean onCreateOptionsMenu(Menu menu) + { + getMenuInflater().inflate(R.menu.session_menu, menu); + return true; + } + + @Override public boolean onOptionsItemSelected(MenuItem item) + { + // refer to http://tools.android.com/tips/non-constant-fields why we + // can't use switch/case here .. + int itemId = item.getItemId(); + + if (itemId == R.id.session_touch_pointer) + { + // toggle touch pointer + if (touchPointerView.getVisibility() == View.VISIBLE) + { + touchPointerView.setVisibility(View.INVISIBLE); + sessionView.setTouchPointerPadding(0, 0); + } + else + { + touchPointerView.setVisibility(View.VISIBLE); + sessionView.setTouchPointerPadding(touchPointerView.getPointerWidth(), + touchPointerView.getPointerHeight()); + } + } + else if (itemId == R.id.session_sys_keyboard) + { + showKeyboard(!sysKeyboardVisible, false); + } + else if (itemId == R.id.session_ext_keyboard) + { + showKeyboard(false, !extKeyboardVisible); + } + else if (itemId == R.id.session_disconnect) + { + showKeyboard(false, false); + LibFreeRDP.disconnect(session.getInstance()); + } + + return true; + } + + @Override public void onBackPressed() + { + // hide keyboards (if any visible) or send alt+f4 to the session + if (sysKeyboardVisible || extKeyboardVisible) + showKeyboard(false, false); + else + keyboardMapper.sendAltF4(); + } + + @Override public boolean onKeyLongPress(int keyCode, KeyEvent event) + { + if (keyCode == KeyEvent.KEYCODE_BACK) + { + LibFreeRDP.disconnect(session.getInstance()); + return true; + } + return super.onKeyLongPress(keyCode, event); + } + + // android keyboard input handling + // We always use the unicode value to process input from the android + // keyboard except if key modifiers + // (like Win, Alt, Ctrl) are activated. In this case we will send the + // virtual key code to allow key + // combinations (like Win + E to open the explorer). + @Override public boolean onKeyDown(int keycode, KeyEvent event) + { + return keyboardMapper.processAndroidKeyEvent(event); + } + + @Override public boolean onKeyUp(int keycode, KeyEvent event) + { + return keyboardMapper.processAndroidKeyEvent(event); + } + + // onKeyMultiple is called for input of some special characters like umlauts + // and some symbol characters + @Override public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event) + { + return keyboardMapper.processAndroidKeyEvent(event); + } + + // **************************************************************************** + // KeyboardView.KeyboardActionEventListener + @Override public void onKey(int primaryCode, int[] keyCodes) + { + keyboardMapper.processCustomKeyEvent(primaryCode); + } + + @Override public void onText(CharSequence text) + { + } + + @Override public void swipeRight() + { + } + + @Override public void swipeLeft() + { + } + + @Override public void swipeDown() + { + } + + @Override public void swipeUp() + { + } + + @Override public void onPress(int primaryCode) + { + } + + @Override public void onRelease(int primaryCode) + { + } + + // **************************************************************************** + // KeyboardMapper.KeyProcessingListener implementation + @Override public void processVirtualKey(int virtualKeyCode, boolean down) + { + LibFreeRDP.sendKeyEvent(session.getInstance(), virtualKeyCode, down); + } + + @Override public void processUnicodeKey(int unicodeKey) + { + LibFreeRDP.sendUnicodeKeyEvent(session.getInstance(), unicodeKey, true); + LibFreeRDP.sendUnicodeKeyEvent(session.getInstance(), unicodeKey, false); + } + + @Override public void switchKeyboard(int keyboardType) + { + switch (keyboardType) + { + case KeyboardMapper.KEYBOARD_TYPE_FUNCTIONKEYS: + keyboardView.setKeyboard(specialkeysKeyboard); + break; + + case KeyboardMapper.KEYBOARD_TYPE_NUMPAD: + keyboardView.setKeyboard(numpadKeyboard); + break; + + case KeyboardMapper.KEYBOARD_TYPE_CURSOR: + keyboardView.setKeyboard(cursorKeyboard); + break; + + default: + break; + } + } + + @Override public void modifiersChanged() + { + updateModifierKeyStates(); + } + + // **************************************************************************** + // LibFreeRDP UI event listener implementation + @Override public void OnSettingsChanged(int width, int height, int bpp) + { + + if (bpp > 16) + bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888); + else + bitmap = Bitmap.createBitmap(width, height, Config.RGB_565); + + session.setSurface(new BitmapDrawable(bitmap)); + + if (session.getBookmark() == null) + { + // Return immediately if we launch from URI + return; + } + + // check this settings and initial settings - if they are not equal the + // server doesn't support our settings + // FIXME: the additional check (settings.getWidth() != width + 1) is for + // the RDVH bug fix to avoid accidental notifications + // (refer to android_freerdp.c for more info on this problem) + BookmarkBase.ScreenSettings settings = session.getBookmark().getActiveScreenSettings(); + if ((settings.getWidth() != width && settings.getWidth() != width + 1) || + settings.getHeight() != height || settings.getColors() != bpp) + uiHandler.sendMessage( + Message.obtain(null, UIHandler.DISPLAY_TOAST, + getResources().getText(R.string.info_capabilities_changed))); + } + + @Override public void OnGraphicsUpdate(int x, int y, int width, int height) + { + LibFreeRDP.updateGraphics(session.getInstance(), bitmap, x, y, width, height); + + sessionView.addInvalidRegion(new Rect(x, y, x + width, y + height)); /* - * since sessionView can only be modified from the UI thread any + * since sessionView can only be modified from the UI thread any * modifications to it need to be scheduled */ - uiHandler.sendEmptyMessage(UIHandler.REFRESH_SESSIONVIEW); - } + uiHandler.sendEmptyMessage(UIHandler.REFRESH_SESSIONVIEW); + } - @Override - public void OnGraphicsResize(int width, int height, int bpp) { - // replace bitmap - if (bpp > 16) - bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888); - else - bitmap = Bitmap.createBitmap(width, height, Config.RGB_565); - session.setSurface(new BitmapDrawable(bitmap)); + @Override public void OnGraphicsResize(int width, int height, int bpp) + { + // replace bitmap + if (bpp > 16) + bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888); + else + bitmap = Bitmap.createBitmap(width, height, Config.RGB_565); + session.setSurface(new BitmapDrawable(bitmap)); /* - * since sessionView can only be modified from the UI thread any + * since sessionView can only be modified from the UI thread any * modifications to it need to be scheduled */ - uiHandler.sendEmptyMessage(UIHandler.GRAPHICS_CHANGED); - } - - @Override - public boolean OnAuthenticate(StringBuilder username, StringBuilder domain, - StringBuilder password) { - // this is where the return code of our dialog will be stored - callbackDialogResult = false; - - // set text fields - ((EditText) userCredView.findViewById(R.id.editTextUsername)) - .setText(username); - ((EditText) userCredView.findViewById(R.id.editTextDomain)) - .setText(domain); - ((EditText) userCredView.findViewById(R.id.editTextPassword)) - .setText(password); - - // start dialog in UI thread - uiHandler.sendMessage(Message.obtain(null, UIHandler.SHOW_DIALOG, - dlgUserCredentials)); - - // wait for result - try { - synchronized (dlgUserCredentials) { - dlgUserCredentials.wait(); - } - } catch (InterruptedException e) { - } - - // clear buffers - username.setLength(0); - domain.setLength(0); - password.setLength(0); - - // read back user credentials - username.append(((EditText) userCredView - .findViewById(R.id.editTextUsername)).getText().toString()); - domain.append(((EditText) userCredView - .findViewById(R.id.editTextDomain)).getText().toString()); - password.append(((EditText) userCredView - .findViewById(R.id.editTextPassword)).getText().toString()); - - return callbackDialogResult; - } - - @Override - public boolean OnGatewayAuthenticate(StringBuilder username, StringBuilder domain, StringBuilder password) { - // this is where the return code of our dialog will be stored - callbackDialogResult = false; - - // set text fields - ((EditText) userCredView.findViewById(R.id.editTextUsername)) - .setText(username); - ((EditText) userCredView.findViewById(R.id.editTextDomain)) - .setText(domain); - ((EditText) userCredView.findViewById(R.id.editTextPassword)) - .setText(password); - - // start dialog in UI thread - uiHandler.sendMessage(Message.obtain(null, UIHandler.SHOW_DIALOG, - dlgUserCredentials)); - - // wait for result - try { - synchronized (dlgUserCredentials) { - dlgUserCredentials.wait(); - } - } catch (InterruptedException e) { - } - - // clear buffers - username.setLength(0); - domain.setLength(0); - password.setLength(0); - - // read back user credentials - username.append(((EditText) userCredView - .findViewById(R.id.editTextUsername)).getText().toString()); - domain.append(((EditText) userCredView - .findViewById(R.id.editTextDomain)).getText().toString()); - password.append(((EditText) userCredView - .findViewById(R.id.editTextPassword)).getText().toString()); - - return callbackDialogResult; - } - - @Override - public int OnVerifiyCertificate(String commonName, String subject, String issuer, String fingerprint, boolean mismatch) { - // see if global settings says accept all - if (ApplicationSettingsActivity.getAcceptAllCertificates(this)) - return 0; - - // this is where the return code of our dialog will be stored - callbackDialogResult = false; - - // set message - String msg = getResources().getString( - R.string.dlg_msg_verify_certificate); - msg = msg + "\n\nSubject: " + subject + "\nIssuer: " + issuer - + "\nFingerprint: " + fingerprint; - dlgVerifyCertificate.setMessage(msg); - - // start dialog in UI thread - uiHandler.sendMessage(Message.obtain(null, UIHandler.SHOW_DIALOG, - dlgVerifyCertificate)); - - // wait for result - try { - synchronized (dlgVerifyCertificate) { - dlgVerifyCertificate.wait(); - } - } catch (InterruptedException e) { - } - - return callbackDialogResult ? 1 : 0; - } - - @Override - public int OnVerifyChangedCertificate(String commonName, String subject, String issuer, String fingerprint, String oldSubject, String oldIssuer, String oldFingerprint) { - // see if global settings says accept all - if (ApplicationSettingsActivity.getAcceptAllCertificates(this)) - return 0; - - // this is where the return code of our dialog will be stored - callbackDialogResult = false; - - // set message - String msg = getResources().getString( - R.string.dlg_msg_verify_certificate); - msg = msg + "\n\nSubject: " + subject + "\nIssuer: " + issuer - + "\nFingerprint: " + fingerprint; - dlgVerifyCertificate.setMessage(msg); - - // start dialog in UI thread - uiHandler.sendMessage(Message.obtain(null, UIHandler.SHOW_DIALOG, - dlgVerifyCertificate)); - - // wait for result - try { - synchronized (dlgVerifyCertificate) { - dlgVerifyCertificate.wait(); - } - } catch (InterruptedException e) { - } - - return callbackDialogResult ? 1 : 0; - } - - @Override - public void OnRemoteClipboardChanged(String data) { - Log.v(TAG, "OnRemoteClipboardChanged: " + data); - mClipboardManager.setClipboardData(data); - } - - // **************************************************************************** - // ScrollView2DListener implementation - private void resetZoomControlsAutoHideTimeout() { - uiHandler.removeMessages(UIHandler.HIDE_ZOOMCONTROLS); - uiHandler.sendEmptyMessageDelayed(UIHandler.HIDE_ZOOMCONTROLS, - ZOOMCONTROLS_AUTOHIDE_TIMEOUT); - } - - @Override - public void onScrollChanged(ScrollView2D scrollView, int x, int y, - int oldx, int oldy) { - zoomControls.setIsZoomInEnabled(!sessionView.isAtMaxZoom()); - zoomControls.setIsZoomOutEnabled(!sessionView.isAtMinZoom()); - if (!ApplicationSettingsActivity.getHideZoomControls(this) - && zoomControls.getVisibility() != View.VISIBLE) - zoomControls.show(); - resetZoomControlsAutoHideTimeout(); - } - - // **************************************************************************** - // SessionView.SessionViewListener - @Override - public void onSessionViewBeginTouch() { - scrollView.setScrollEnabled(false); - } - - @Override - public void onSessionViewEndTouch() { - scrollView.setScrollEnabled(true); - } - - @Override - public void onSessionViewLeftTouch(int x, int y, boolean down) { - if (!down) - cancelDelayedMoveEvent(); - - LibFreeRDP.sendCursorEvent( - session.getInstance(), - x, - y, - toggleMouseButtons ? Mouse.getRightButtonEvent(this, down) : Mouse - .getLeftButtonEvent(this, down)); - - if (!down) - toggleMouseButtons = false; - } - - public void onSessionViewRightTouch(int x, int y, boolean down) { - if (!down) - toggleMouseButtons = !toggleMouseButtons; - } - - @Override - public void onSessionViewMove(int x, int y) { - sendDelayedMoveEvent(x, y); - } - - @Override - public void onSessionViewScroll(boolean down) { - LibFreeRDP.sendCursorEvent(session.getInstance(), 0, 0, - Mouse.getScrollEvent(this, down)); - } - - // **************************************************************************** - // TouchPointerView.TouchPointerListener - @Override - public void onTouchPointerClose() { - touchPointerView.setVisibility(View.INVISIBLE); - sessionView.setTouchPointerPadding(0, 0); - } - - private Point mapScreenCoordToSessionCoord(int x, int y) { - int mappedX = (int) ((float) (x + scrollView.getScrollX()) / sessionView - .getZoom()); - int mappedY = (int) ((float) (y + scrollView.getScrollY()) / sessionView - .getZoom()); - if (mappedX > bitmap.getWidth()) - mappedX = bitmap.getWidth(); - if (mappedY > bitmap.getHeight()) - mappedY = bitmap.getHeight(); - return new Point(mappedX, mappedY); - } - - @Override - public void onTouchPointerLeftClick(int x, int y, boolean down) { - Point p = mapScreenCoordToSessionCoord(x, y); - LibFreeRDP.sendCursorEvent(session.getInstance(), p.x, p.y, - Mouse.getLeftButtonEvent(this, down)); - } - - @Override - public void onTouchPointerRightClick(int x, int y, boolean down) { - Point p = mapScreenCoordToSessionCoord(x, y); - LibFreeRDP.sendCursorEvent(session.getInstance(), p.x, p.y, - Mouse.getRightButtonEvent(this, down)); - } - - @Override - public void onTouchPointerMove(int x, int y) { - Point p = mapScreenCoordToSessionCoord(x, y); - LibFreeRDP.sendCursorEvent(session.getInstance(), p.x, p.y, - Mouse.getMoveEvent()); - - if (ApplicationSettingsActivity.getAutoScrollTouchPointer(this) - && !uiHandler.hasMessages(UIHandler.SCROLLING_REQUESTED)) { - Log.v(TAG, "Starting auto-scroll"); - uiHandler.sendEmptyMessageDelayed(UIHandler.SCROLLING_REQUESTED, - SCROLLING_TIMEOUT); - } - } - - @Override - public void onTouchPointerScroll(boolean down) { - LibFreeRDP.sendCursorEvent(session.getInstance(), 0, 0, - Mouse.getScrollEvent(this, down)); - } - - @Override - public void onTouchPointerToggleKeyboard() { - showKeyboard(!sysKeyboardVisible, false); - } - - @Override - public void onTouchPointerToggleExtKeyboard() { - showKeyboard(false, !extKeyboardVisible); - } - - @Override - public void onTouchPointerResetScrollZoom() { - sessionView.setZoom(1.0f); - scrollView.scrollTo(0, 0); - } - - @Override - public boolean onGenericMotionEvent(MotionEvent e) { - super.onGenericMotionEvent(e); - switch (e.getAction()) { - case MotionEvent.ACTION_SCROLL: - final float vScroll = e.getAxisValue(MotionEvent.AXIS_VSCROLL); - if (vScroll < 0) { - LibFreeRDP.sendCursorEvent(session.getInstance(), 0, 0, Mouse.getScrollEvent(this, false)); - } - if (vScroll > 0) { - LibFreeRDP.sendCursorEvent(session.getInstance(), 0, 0, Mouse.getScrollEvent(this, true)); - } - break; - } - return true; - } - - // **************************************************************************** - // ClipboardManagerProxy.OnClipboardChangedListener - @Override - public void onClipboardChanged(String data) { - Log.v(TAG, "onClipboardChanged: " + data); - LibFreeRDP.sendClipboardData(session.getInstance(), data); - } - - private class UIHandler extends Handler { - - public static final int REFRESH_SESSIONVIEW = 1; - public static final int DISPLAY_TOAST = 2; - public static final int HIDE_ZOOMCONTROLS = 3; - public static final int SEND_MOVE_EVENT = 4; - public static final int SHOW_DIALOG = 5; - public static final int GRAPHICS_CHANGED = 6; - public static final int SCROLLING_REQUESTED = 7; - - UIHandler() { - super(); - } - - @Override - public void handleMessage(Message msg) { - switch (msg.what) { - case GRAPHICS_CHANGED: { - sessionView.onSurfaceChange(session); - scrollView.requestLayout(); - break; - } - case REFRESH_SESSIONVIEW: { - sessionView.invalidateRegion(); - break; - } - case DISPLAY_TOAST: { - Toast errorToast = Toast.makeText(getApplicationContext(), - msg.obj.toString(), Toast.LENGTH_LONG); - errorToast.show(); - break; - } - case HIDE_ZOOMCONTROLS: { - zoomControls.hide(); - break; - } - case SEND_MOVE_EVENT: { - LibFreeRDP.sendCursorEvent(session.getInstance(), msg.arg1, - msg.arg2, Mouse.getMoveEvent()); - break; - } - case SHOW_DIALOG: { - // create and show the dialog - ((Dialog) msg.obj).show(); - break; - } - case SCROLLING_REQUESTED: { - int scrollX = 0; - int scrollY = 0; - float[] pointerPos = touchPointerView.getPointerPosition(); - - if (pointerPos[0] > (screen_width - touchPointerView - .getPointerWidth())) - scrollX = SCROLLING_DISTANCE; - else if (pointerPos[0] < 0) - scrollX = -SCROLLING_DISTANCE; - - if (pointerPos[1] > (screen_height - touchPointerView - .getPointerHeight())) - scrollY = SCROLLING_DISTANCE; - else if (pointerPos[1] < 0) - scrollY = -SCROLLING_DISTANCE; - - scrollView.scrollBy(scrollX, scrollY); - - // see if we reached the min/max scroll positions - if (scrollView.getScrollX() == 0 - || scrollView.getScrollX() == (sessionView.getWidth() - scrollView - .getWidth())) - scrollX = 0; - if (scrollView.getScrollY() == 0 - || scrollView.getScrollY() == (sessionView.getHeight() - scrollView - .getHeight())) - scrollY = 0; - - if (scrollX != 0 || scrollY != 0) - uiHandler.sendEmptyMessageDelayed(SCROLLING_REQUESTED, - SCROLLING_TIMEOUT); - else - Log.v(TAG, "Stopping auto-scroll"); - break; - } - } - } - } - - private class PinchZoomListener extends - ScaleGestureDetector.SimpleOnScaleGestureListener { - private float scaleFactor = 1.0f; - - @Override - public boolean onScaleBegin(ScaleGestureDetector detector) { - scrollView.setScrollEnabled(false); - return true; - } - - @Override - public boolean onScale(ScaleGestureDetector detector) { - - // calc scale factor - scaleFactor *= detector.getScaleFactor(); - scaleFactor = Math.max(SessionView.MIN_SCALE_FACTOR, - Math.min(scaleFactor, SessionView.MAX_SCALE_FACTOR)); - sessionView.setZoom(scaleFactor); - - if (!sessionView.isAtMinZoom() && !sessionView.isAtMaxZoom()) { - // transform scroll origin to the new zoom space - float transOriginX = scrollView.getScrollX() - * detector.getScaleFactor(); - float transOriginY = scrollView.getScrollY() - * detector.getScaleFactor(); - - // transform center point to the zoomed space - float transCenterX = (scrollView.getScrollX() + detector - .getFocusX()) * detector.getScaleFactor(); - float transCenterY = (scrollView.getScrollY() + detector - .getFocusY()) * detector.getScaleFactor(); - - // scroll by the difference between the distance of the - // transformed center/origin point and their old distance - // (focusX/Y) - scrollView.scrollBy( - (int) ((transCenterX - transOriginX) - detector - .getFocusX()), - (int) ((transCenterY - transOriginY) - detector - .getFocusY())); - } - - return true; - } - - @Override - public void onScaleEnd(ScaleGestureDetector de) { - scrollView.setScrollEnabled(true); - } - } - - private class LibFreeRDPBroadcastReceiver extends BroadcastReceiver { - @Override - public void onReceive(Context context, Intent intent) { - // still got a valid session? - if (session == null) - return; - - // is this event for the current session? - if (session.getInstance() != intent.getExtras().getLong( - GlobalApp.EVENT_PARAM, -1)) - return; - - switch (intent.getExtras().getInt(GlobalApp.EVENT_TYPE, -1)) { - case GlobalApp.FREERDP_EVENT_CONNECTION_SUCCESS: - OnConnectionSuccess(context); - break; - - case GlobalApp.FREERDP_EVENT_CONNECTION_FAILURE: - OnConnectionFailure(context); - break; - case GlobalApp.FREERDP_EVENT_DISCONNECTED: - OnDisconnected(context); - break; - } - } - - private void OnConnectionSuccess(Context context) { - Log.v(TAG, "OnConnectionSuccess"); - - // bind session - bindSession(); - - if (progressDialog != null) { - progressDialog.dismiss(); - progressDialog = null; - } - - if (session.getBookmark() == null) { - // Return immediately if we launch from URI - return; - } - - // add hostname to history if quick connect was used - Bundle bundle = getIntent().getExtras(); - if (bundle != null - && bundle.containsKey(PARAM_CONNECTION_REFERENCE)) { - if (ConnectionReference.isHostnameReference(bundle - .getString(PARAM_CONNECTION_REFERENCE))) { - assert session.getBookmark().getType() == BookmarkBase.TYPE_MANUAL; - String item = session.getBookmark().get() - .getHostname(); - if (!GlobalApp.getQuickConnectHistoryGateway() - .historyItemExists(item)) - GlobalApp.getQuickConnectHistoryGateway() - .addHistoryItem(item); - } - } - } - - private void OnConnectionFailure(Context context) { - Log.v(TAG, "OnConnectionFailure"); - - // remove pending move events - uiHandler.removeMessages(UIHandler.SEND_MOVE_EVENT); - - if (progressDialog != null) { - progressDialog.dismiss(); - progressDialog = null; - } - - // post error message on UI thread - if (!connectCancelledByUser) - uiHandler.sendMessage(Message.obtain( - null, - UIHandler.DISPLAY_TOAST, - getResources().getText( - R.string.error_connection_failure))); - - closeSessionActivity(RESULT_CANCELED); - } - - private void OnDisconnected(Context context) { - Log.v(TAG, "OnDisconnected"); - - // remove pending move events - uiHandler.removeMessages(UIHandler.SEND_MOVE_EVENT); - - if (progressDialog != null) { - progressDialog.dismiss(); - progressDialog = null; - } - - session.setUIEventListener(null); - closeSessionActivity(RESULT_OK); - } - } - + uiHandler.sendEmptyMessage(UIHandler.GRAPHICS_CHANGED); + } + + @Override + public boolean OnAuthenticate(StringBuilder username, StringBuilder domain, + StringBuilder password) + { + // this is where the return code of our dialog will be stored + callbackDialogResult = false; + + // set text fields + ((EditText)userCredView.findViewById(R.id.editTextUsername)).setText(username); + ((EditText)userCredView.findViewById(R.id.editTextDomain)).setText(domain); + ((EditText)userCredView.findViewById(R.id.editTextPassword)).setText(password); + + // start dialog in UI thread + uiHandler.sendMessage(Message.obtain(null, UIHandler.SHOW_DIALOG, dlgUserCredentials)); + + // wait for result + try + { + synchronized (dlgUserCredentials) + { + dlgUserCredentials.wait(); + } + } + catch (InterruptedException e) + { + } + + // clear buffers + username.setLength(0); + domain.setLength(0); + password.setLength(0); + + // read back user credentials + username.append( + ((EditText)userCredView.findViewById(R.id.editTextUsername)).getText().toString()); + domain.append( + ((EditText)userCredView.findViewById(R.id.editTextDomain)).getText().toString()); + password.append( + ((EditText)userCredView.findViewById(R.id.editTextPassword)).getText().toString()); + + return callbackDialogResult; + } + + @Override + public boolean OnGatewayAuthenticate(StringBuilder username, StringBuilder domain, + StringBuilder password) + { + // this is where the return code of our dialog will be stored + callbackDialogResult = false; + + // set text fields + ((EditText)userCredView.findViewById(R.id.editTextUsername)).setText(username); + ((EditText)userCredView.findViewById(R.id.editTextDomain)).setText(domain); + ((EditText)userCredView.findViewById(R.id.editTextPassword)).setText(password); + + // start dialog in UI thread + uiHandler.sendMessage(Message.obtain(null, UIHandler.SHOW_DIALOG, dlgUserCredentials)); + + // wait for result + try + { + synchronized (dlgUserCredentials) + { + dlgUserCredentials.wait(); + } + } + catch (InterruptedException e) + { + } + + // clear buffers + username.setLength(0); + domain.setLength(0); + password.setLength(0); + + // read back user credentials + username.append( + ((EditText)userCredView.findViewById(R.id.editTextUsername)).getText().toString()); + domain.append( + ((EditText)userCredView.findViewById(R.id.editTextDomain)).getText().toString()); + password.append( + ((EditText)userCredView.findViewById(R.id.editTextPassword)).getText().toString()); + + return callbackDialogResult; + } + + @Override + public int OnVerifiyCertificate(String commonName, String subject, String issuer, + String fingerprint, boolean mismatch) + { + // see if global settings says accept all + if (ApplicationSettingsActivity.getAcceptAllCertificates(this)) + return 0; + + // this is where the return code of our dialog will be stored + callbackDialogResult = false; + + // set message + String msg = getResources().getString(R.string.dlg_msg_verify_certificate); + msg = msg + "\n\nSubject: " + subject + "\nIssuer: " + issuer + + "\nFingerprint: " + fingerprint; + dlgVerifyCertificate.setMessage(msg); + + // start dialog in UI thread + uiHandler.sendMessage(Message.obtain(null, UIHandler.SHOW_DIALOG, dlgVerifyCertificate)); + + // wait for result + try + { + synchronized (dlgVerifyCertificate) + { + dlgVerifyCertificate.wait(); + } + } + catch (InterruptedException e) + { + } + + return callbackDialogResult ? 1 : 0; + } + + @Override + public int OnVerifyChangedCertificate(String commonName, String subject, String issuer, + String fingerprint, String oldSubject, String oldIssuer, + String oldFingerprint) + { + // see if global settings says accept all + if (ApplicationSettingsActivity.getAcceptAllCertificates(this)) + return 0; + + // this is where the return code of our dialog will be stored + callbackDialogResult = false; + + // set message + String msg = getResources().getString(R.string.dlg_msg_verify_certificate); + msg = msg + "\n\nSubject: " + subject + "\nIssuer: " + issuer + + "\nFingerprint: " + fingerprint; + dlgVerifyCertificate.setMessage(msg); + + // start dialog in UI thread + uiHandler.sendMessage(Message.obtain(null, UIHandler.SHOW_DIALOG, dlgVerifyCertificate)); + + // wait for result + try + { + synchronized (dlgVerifyCertificate) + { + dlgVerifyCertificate.wait(); + } + } + catch (InterruptedException e) + { + } + + return callbackDialogResult ? 1 : 0; + } + + @Override public void OnRemoteClipboardChanged(String data) + { + Log.v(TAG, "OnRemoteClipboardChanged: " + data); + mClipboardManager.setClipboardData(data); + } + + // **************************************************************************** + // ScrollView2DListener implementation + private void resetZoomControlsAutoHideTimeout() + { + uiHandler.removeMessages(UIHandler.HIDE_ZOOMCONTROLS); + uiHandler.sendEmptyMessageDelayed(UIHandler.HIDE_ZOOMCONTROLS, + ZOOMCONTROLS_AUTOHIDE_TIMEOUT); + } + + @Override public void onScrollChanged(ScrollView2D scrollView, int x, int y, int oldx, int oldy) + { + zoomControls.setIsZoomInEnabled(!sessionView.isAtMaxZoom()); + zoomControls.setIsZoomOutEnabled(!sessionView.isAtMinZoom()); + if (!ApplicationSettingsActivity.getHideZoomControls(this) && + zoomControls.getVisibility() != View.VISIBLE) + zoomControls.show(); + resetZoomControlsAutoHideTimeout(); + } + + // **************************************************************************** + // SessionView.SessionViewListener + @Override public void onSessionViewBeginTouch() + { + scrollView.setScrollEnabled(false); + } + + @Override public void onSessionViewEndTouch() + { + scrollView.setScrollEnabled(true); + } + + @Override public void onSessionViewLeftTouch(int x, int y, boolean down) + { + if (!down) + cancelDelayedMoveEvent(); + + LibFreeRDP.sendCursorEvent(session.getInstance(), x, y, + toggleMouseButtons ? Mouse.getRightButtonEvent(this, down) + : Mouse.getLeftButtonEvent(this, down)); + + if (!down) + toggleMouseButtons = false; + } + + public void onSessionViewRightTouch(int x, int y, boolean down) + { + if (!down) + toggleMouseButtons = !toggleMouseButtons; + } + + @Override public void onSessionViewMove(int x, int y) + { + sendDelayedMoveEvent(x, y); + } + + @Override public void onSessionViewScroll(boolean down) + { + LibFreeRDP.sendCursorEvent(session.getInstance(), 0, 0, Mouse.getScrollEvent(this, down)); + } + + // **************************************************************************** + // TouchPointerView.TouchPointerListener + @Override public void onTouchPointerClose() + { + touchPointerView.setVisibility(View.INVISIBLE); + sessionView.setTouchPointerPadding(0, 0); + } + + private Point mapScreenCoordToSessionCoord(int x, int y) + { + int mappedX = (int)((float)(x + scrollView.getScrollX()) / sessionView.getZoom()); + int mappedY = (int)((float)(y + scrollView.getScrollY()) / sessionView.getZoom()); + if (mappedX > bitmap.getWidth()) + mappedX = bitmap.getWidth(); + if (mappedY > bitmap.getHeight()) + mappedY = bitmap.getHeight(); + return new Point(mappedX, mappedY); + } + + @Override public void onTouchPointerLeftClick(int x, int y, boolean down) + { + Point p = mapScreenCoordToSessionCoord(x, y); + LibFreeRDP.sendCursorEvent(session.getInstance(), p.x, p.y, + Mouse.getLeftButtonEvent(this, down)); + } + + @Override public void onTouchPointerRightClick(int x, int y, boolean down) + { + Point p = mapScreenCoordToSessionCoord(x, y); + LibFreeRDP.sendCursorEvent(session.getInstance(), p.x, p.y, + Mouse.getRightButtonEvent(this, down)); + } + + @Override public void onTouchPointerMove(int x, int y) + { + Point p = mapScreenCoordToSessionCoord(x, y); + LibFreeRDP.sendCursorEvent(session.getInstance(), p.x, p.y, Mouse.getMoveEvent()); + + if (ApplicationSettingsActivity.getAutoScrollTouchPointer(this) && + !uiHandler.hasMessages(UIHandler.SCROLLING_REQUESTED)) + { + Log.v(TAG, "Starting auto-scroll"); + uiHandler.sendEmptyMessageDelayed(UIHandler.SCROLLING_REQUESTED, SCROLLING_TIMEOUT); + } + } + + @Override public void onTouchPointerScroll(boolean down) + { + LibFreeRDP.sendCursorEvent(session.getInstance(), 0, 0, Mouse.getScrollEvent(this, down)); + } + + @Override public void onTouchPointerToggleKeyboard() + { + showKeyboard(!sysKeyboardVisible, false); + } + + @Override public void onTouchPointerToggleExtKeyboard() + { + showKeyboard(false, !extKeyboardVisible); + } + + @Override public void onTouchPointerResetScrollZoom() + { + sessionView.setZoom(1.0f); + scrollView.scrollTo(0, 0); + } + + @Override public boolean onGenericMotionEvent(MotionEvent e) + { + super.onGenericMotionEvent(e); + switch (e.getAction()) + { + case MotionEvent.ACTION_SCROLL: + final float vScroll = e.getAxisValue(MotionEvent.AXIS_VSCROLL); + if (vScroll < 0) + { + LibFreeRDP.sendCursorEvent(session.getInstance(), 0, 0, + Mouse.getScrollEvent(this, false)); + } + if (vScroll > 0) + { + LibFreeRDP.sendCursorEvent(session.getInstance(), 0, 0, + Mouse.getScrollEvent(this, true)); + } + break; + } + return true; + } + + // **************************************************************************** + // ClipboardManagerProxy.OnClipboardChangedListener + @Override public void onClipboardChanged(String data) + { + Log.v(TAG, "onClipboardChanged: " + data); + LibFreeRDP.sendClipboardData(session.getInstance(), data); + } + + private class UIHandler extends Handler + { + + public static final int REFRESH_SESSIONVIEW = 1; + public static final int DISPLAY_TOAST = 2; + public static final int HIDE_ZOOMCONTROLS = 3; + public static final int SEND_MOVE_EVENT = 4; + public static final int SHOW_DIALOG = 5; + public static final int GRAPHICS_CHANGED = 6; + public static final int SCROLLING_REQUESTED = 7; + + UIHandler() + { + super(); + } + + @Override public void handleMessage(Message msg) + { + switch (msg.what) + { + case GRAPHICS_CHANGED: + { + sessionView.onSurfaceChange(session); + scrollView.requestLayout(); + break; + } + case REFRESH_SESSIONVIEW: + { + sessionView.invalidateRegion(); + break; + } + case DISPLAY_TOAST: + { + Toast errorToast = Toast.makeText(getApplicationContext(), msg.obj.toString(), + Toast.LENGTH_LONG); + errorToast.show(); + break; + } + case HIDE_ZOOMCONTROLS: + { + zoomControls.hide(); + break; + } + case SEND_MOVE_EVENT: + { + LibFreeRDP.sendCursorEvent(session.getInstance(), msg.arg1, msg.arg2, + Mouse.getMoveEvent()); + break; + } + case SHOW_DIALOG: + { + // create and show the dialog + ((Dialog)msg.obj).show(); + break; + } + case SCROLLING_REQUESTED: + { + int scrollX = 0; + int scrollY = 0; + float[] pointerPos = touchPointerView.getPointerPosition(); + + if (pointerPos[0] > (screen_width - touchPointerView.getPointerWidth())) + scrollX = SCROLLING_DISTANCE; + else if (pointerPos[0] < 0) + scrollX = -SCROLLING_DISTANCE; + + if (pointerPos[1] > (screen_height - touchPointerView.getPointerHeight())) + scrollY = SCROLLING_DISTANCE; + else if (pointerPos[1] < 0) + scrollY = -SCROLLING_DISTANCE; + + scrollView.scrollBy(scrollX, scrollY); + + // see if we reached the min/max scroll positions + if (scrollView.getScrollX() == 0 || + scrollView.getScrollX() == (sessionView.getWidth() - scrollView.getWidth())) + scrollX = 0; + if (scrollView.getScrollY() == 0 || + scrollView.getScrollY() == + (sessionView.getHeight() - scrollView.getHeight())) + scrollY = 0; + + if (scrollX != 0 || scrollY != 0) + uiHandler.sendEmptyMessageDelayed(SCROLLING_REQUESTED, SCROLLING_TIMEOUT); + else + Log.v(TAG, "Stopping auto-scroll"); + break; + } + } + } + } + + private class PinchZoomListener extends ScaleGestureDetector.SimpleOnScaleGestureListener + { + private float scaleFactor = 1.0f; + + @Override public boolean onScaleBegin(ScaleGestureDetector detector) + { + scrollView.setScrollEnabled(false); + return true; + } + + @Override public boolean onScale(ScaleGestureDetector detector) + { + + // calc scale factor + scaleFactor *= detector.getScaleFactor(); + scaleFactor = Math.max(SessionView.MIN_SCALE_FACTOR, + Math.min(scaleFactor, SessionView.MAX_SCALE_FACTOR)); + sessionView.setZoom(scaleFactor); + + if (!sessionView.isAtMinZoom() && !sessionView.isAtMaxZoom()) + { + // transform scroll origin to the new zoom space + float transOriginX = scrollView.getScrollX() * detector.getScaleFactor(); + float transOriginY = scrollView.getScrollY() * detector.getScaleFactor(); + + // transform center point to the zoomed space + float transCenterX = + (scrollView.getScrollX() + detector.getFocusX()) * detector.getScaleFactor(); + float transCenterY = + (scrollView.getScrollY() + detector.getFocusY()) * detector.getScaleFactor(); + + // scroll by the difference between the distance of the + // transformed center/origin point and their old distance + // (focusX/Y) + scrollView.scrollBy((int)((transCenterX - transOriginX) - detector.getFocusX()), + (int)((transCenterY - transOriginY) - detector.getFocusY())); + } + + return true; + } + + @Override public void onScaleEnd(ScaleGestureDetector de) + { + scrollView.setScrollEnabled(true); + } + } + + private class LibFreeRDPBroadcastReceiver extends BroadcastReceiver + { + @Override public void onReceive(Context context, Intent intent) + { + // still got a valid session? + if (session == null) + return; + + // is this event for the current session? + if (session.getInstance() != intent.getExtras().getLong(GlobalApp.EVENT_PARAM, -1)) + return; + + switch (intent.getExtras().getInt(GlobalApp.EVENT_TYPE, -1)) + { + case GlobalApp.FREERDP_EVENT_CONNECTION_SUCCESS: + OnConnectionSuccess(context); + break; + + case GlobalApp.FREERDP_EVENT_CONNECTION_FAILURE: + OnConnectionFailure(context); + break; + case GlobalApp.FREERDP_EVENT_DISCONNECTED: + OnDisconnected(context); + break; + } + } + + private void OnConnectionSuccess(Context context) + { + Log.v(TAG, "OnConnectionSuccess"); + + // bind session + bindSession(); + + if (progressDialog != null) + { + progressDialog.dismiss(); + progressDialog = null; + } + + if (session.getBookmark() == null) + { + // Return immediately if we launch from URI + return; + } + + // add hostname to history if quick connect was used + Bundle bundle = getIntent().getExtras(); + if (bundle != null && bundle.containsKey(PARAM_CONNECTION_REFERENCE)) + { + if (ConnectionReference.isHostnameReference( + bundle.getString(PARAM_CONNECTION_REFERENCE))) + { + assert session.getBookmark().getType() == BookmarkBase.TYPE_MANUAL; + String item = session.getBookmark().get().getHostname(); + if (!GlobalApp.getQuickConnectHistoryGateway().historyItemExists(item)) + GlobalApp.getQuickConnectHistoryGateway().addHistoryItem(item); + } + } + } + + private void OnConnectionFailure(Context context) + { + Log.v(TAG, "OnConnectionFailure"); + + // remove pending move events + uiHandler.removeMessages(UIHandler.SEND_MOVE_EVENT); + + if (progressDialog != null) + { + progressDialog.dismiss(); + progressDialog = null; + } + + // post error message on UI thread + if (!connectCancelledByUser) + uiHandler.sendMessage( + Message.obtain(null, UIHandler.DISPLAY_TOAST, + getResources().getText(R.string.error_connection_failure))); + + closeSessionActivity(RESULT_CANCELED); + } + + private void OnDisconnected(Context context) + { + Log.v(TAG, "OnDisconnected"); + + // remove pending move events + uiHandler.removeMessages(UIHandler.SEND_MOVE_EVENT); + + if (progressDialog != null) + { + progressDialog.dismiss(); + progressDialog = null; + } + + session.setUIEventListener(null); + closeSessionActivity(RESULT_OK); + } + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/SessionView.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/SessionView.java index 5ecbcb735..008b153b6 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/SessionView.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/SessionView.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.presentation; @@ -32,319 +33,380 @@ import com.freerdp.freerdpcore.utils.Mouse; import java.util.Stack; +public class SessionView extends View +{ + public static final float MAX_SCALE_FACTOR = 3.0f; + public static final float MIN_SCALE_FACTOR = 1.0f; + private static final String TAG = "SessionView"; + private static final float SCALE_FACTOR_DELTA = 0.0001f; + private static final float TOUCH_SCROLL_DELTA = 10.0f; + private int width; + private int height; + private BitmapDrawable surface; + private Stack invalidRegions; + private int touchPointerPaddingWidth = 0; + private int touchPointerPaddingHeight = 0; + private SessionViewListener sessionViewListener = null; + // helpers for scaling gesture handling + private float scaleFactor = 1.0f; + private Matrix scaleMatrix; + private Matrix invScaleMatrix; + private RectF invalidRegionF; + private GestureDetector gestureDetector; + private SessionState currentSession; -public class SessionView extends View { - public static final float MAX_SCALE_FACTOR = 3.0f; - public static final float MIN_SCALE_FACTOR = 1.0f; - private static final String TAG = "SessionView"; - private static final float SCALE_FACTOR_DELTA = 0.0001f; - private static final float TOUCH_SCROLL_DELTA = 10.0f; - private int width; - private int height; - private BitmapDrawable surface; - private Stack invalidRegions; - private int touchPointerPaddingWidth = 0; - private int touchPointerPaddingHeight = 0; - private SessionViewListener sessionViewListener = null; - // helpers for scaling gesture handling - private float scaleFactor = 1.0f; - private Matrix scaleMatrix; - private Matrix invScaleMatrix; - private RectF invalidRegionF; - private GestureDetector gestureDetector; - private SessionState currentSession; + // private static final String TAG = "FreeRDP.SessionView"; + private DoubleGestureDetector doubleGestureDetector; + public SessionView(Context context) + { + super(context); + initSessionView(context); + } - //private static final String TAG = "FreeRDP.SessionView"; - private DoubleGestureDetector doubleGestureDetector; - public SessionView(Context context) { - super(context); - initSessionView(context); - } + public SessionView(Context context, AttributeSet attrs) + { + super(context, attrs); + initSessionView(context); + } - public SessionView(Context context, AttributeSet attrs) { - super(context, attrs); - initSessionView(context); - } + public SessionView(Context context, AttributeSet attrs, int defStyle) + { + super(context, attrs, defStyle); + initSessionView(context); + } - public SessionView(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - initSessionView(context); - } + private void initSessionView(Context context) + { + invalidRegions = new Stack(); + gestureDetector = new GestureDetector(context, new SessionGestureListener(), null, true); + doubleGestureDetector = + new DoubleGestureDetector(context, null, new SessionDoubleGestureListener()); - private void initSessionView(Context context) { - invalidRegions = new Stack(); - gestureDetector = new GestureDetector(context, new SessionGestureListener(), null, true); - doubleGestureDetector = new DoubleGestureDetector(context, null, new SessionDoubleGestureListener()); + scaleFactor = 1.0f; + scaleMatrix = new Matrix(); + invScaleMatrix = new Matrix(); + invalidRegionF = new RectF(); - scaleFactor = 1.0f; - scaleMatrix = new Matrix(); - invScaleMatrix = new Matrix(); - invalidRegionF = new RectF(); + setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | + View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); + } - setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); - } + public void setScaleGestureDetector(ScaleGestureDetector scaleGestureDetector) + { + doubleGestureDetector.setScaleGestureDetector(scaleGestureDetector); + } - public void setScaleGestureDetector(ScaleGestureDetector scaleGestureDetector) { - doubleGestureDetector.setScaleGestureDetector(scaleGestureDetector); - } + public void setSessionViewListener(SessionViewListener sessionViewListener) + { + this.sessionViewListener = sessionViewListener; + } - public void setSessionViewListener(SessionViewListener sessionViewListener) { - this.sessionViewListener = sessionViewListener; - } + public void addInvalidRegion(Rect invalidRegion) + { + // correctly transform invalid region depending on current scaling + invalidRegionF.set(invalidRegion); + scaleMatrix.mapRect(invalidRegionF); + invalidRegionF.roundOut(invalidRegion); - public void addInvalidRegion(Rect invalidRegion) { - // correctly transform invalid region depending on current scaling - invalidRegionF.set(invalidRegion); - scaleMatrix.mapRect(invalidRegionF); - invalidRegionF.roundOut(invalidRegion); + invalidRegions.add(invalidRegion); + } - invalidRegions.add(invalidRegion); - } + public void invalidateRegion() + { + invalidate(invalidRegions.pop()); + } - public void invalidateRegion() { - invalidate(invalidRegions.pop()); - } + public void onSurfaceChange(SessionState session) + { + surface = session.getSurface(); + Bitmap bitmap = surface.getBitmap(); + width = bitmap.getWidth(); + height = bitmap.getHeight(); + surface.setBounds(0, 0, width, height); - public void onSurfaceChange(SessionState session) { - surface = session.getSurface(); - Bitmap bitmap = surface.getBitmap(); - width = bitmap.getWidth(); - height = bitmap.getHeight(); - surface.setBounds(0, 0, width, height); + setMinimumWidth(width); + setMinimumHeight(height); - setMinimumWidth(width); - setMinimumHeight(height); + requestLayout(); + currentSession = session; + } - requestLayout(); - currentSession = session; - } + public float getZoom() + { + return scaleFactor; + } - public float getZoom() { - return scaleFactor; - } + public void setZoom(float factor) + { + // calc scale matrix and inverse scale matrix (to correctly transform the view and moues + // coordinates) + scaleFactor = factor; + scaleMatrix.setScale(scaleFactor, scaleFactor); + invScaleMatrix.setScale(1.0f / scaleFactor, 1.0f / scaleFactor); - public void setZoom(float factor) { - // calc scale matrix and inverse scale matrix (to correctly transform the view and moues coordinates) - scaleFactor = factor; - scaleMatrix.setScale(scaleFactor, scaleFactor); - invScaleMatrix.setScale(1.0f / scaleFactor, 1.0f / scaleFactor); + // update layout + requestLayout(); + } - // update layout - requestLayout(); - } + public boolean isAtMaxZoom() + { + return (scaleFactor > (MAX_SCALE_FACTOR - SCALE_FACTOR_DELTA)); + } - public boolean isAtMaxZoom() { - return (scaleFactor > (MAX_SCALE_FACTOR - SCALE_FACTOR_DELTA)); - } + public boolean isAtMinZoom() + { + return (scaleFactor < (MIN_SCALE_FACTOR + SCALE_FACTOR_DELTA)); + } - public boolean isAtMinZoom() { - return (scaleFactor < (MIN_SCALE_FACTOR + SCALE_FACTOR_DELTA)); - } + public boolean zoomIn(float factor) + { + boolean res = true; + scaleFactor += factor; + if (scaleFactor > (MAX_SCALE_FACTOR - SCALE_FACTOR_DELTA)) + { + scaleFactor = MAX_SCALE_FACTOR; + res = false; + } + setZoom(scaleFactor); + return res; + } - public boolean zoomIn(float factor) { - boolean res = true; - scaleFactor += factor; - if (scaleFactor > (MAX_SCALE_FACTOR - SCALE_FACTOR_DELTA)) { - scaleFactor = MAX_SCALE_FACTOR; - res = false; - } - setZoom(scaleFactor); - return res; - } + public boolean zoomOut(float factor) + { + boolean res = true; + scaleFactor -= factor; + if (scaleFactor < (MIN_SCALE_FACTOR + SCALE_FACTOR_DELTA)) + { + scaleFactor = MIN_SCALE_FACTOR; + res = false; + } + setZoom(scaleFactor); + return res; + } - public boolean zoomOut(float factor) { - boolean res = true; - scaleFactor -= factor; - if (scaleFactor < (MIN_SCALE_FACTOR + SCALE_FACTOR_DELTA)) { - scaleFactor = MIN_SCALE_FACTOR; - res = false; - } - setZoom(scaleFactor); - return res; - } + public void setTouchPointerPadding(int widht, int height) + { + touchPointerPaddingWidth = widht; + touchPointerPaddingHeight = height; + requestLayout(); + } - public void setTouchPointerPadding(int widht, int height) { - touchPointerPaddingWidth = widht; - touchPointerPaddingHeight = height; - requestLayout(); - } + public int getTouchPointerPaddingWidth() + { + return touchPointerPaddingWidth; + } - public int getTouchPointerPaddingWidth() { - return touchPointerPaddingWidth; - } + public int getTouchPointerPaddingHeight() + { + return touchPointerPaddingHeight; + } - public int getTouchPointerPaddingHeight() { - return touchPointerPaddingHeight; - } + @Override public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) + { + Log.v(TAG, width + "x" + height); + this.setMeasuredDimension((int)(width * scaleFactor) + touchPointerPaddingWidth, + (int)(height * scaleFactor) + touchPointerPaddingHeight); + } - @Override - public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - Log.v(TAG, width + "x" + height); - this.setMeasuredDimension((int) (width * scaleFactor) + touchPointerPaddingWidth, (int) (height * scaleFactor) + touchPointerPaddingHeight); - } + @Override public void onDraw(Canvas canvas) + { + super.onDraw(canvas); - @Override - public void onDraw(Canvas canvas) { - super.onDraw(canvas); + canvas.save(); + canvas.concat(scaleMatrix); + surface.draw(canvas); + canvas.restore(); + } - canvas.save(); - canvas.concat(scaleMatrix); - surface.draw(canvas); - canvas.restore(); - } + // dirty hack: we call back to our activity and call onBackPressed as this doesn't reach us when + // the soft keyboard is shown ... + @Override public boolean dispatchKeyEventPreIme(KeyEvent event) + { + if (event.getKeyCode() == KeyEvent.KEYCODE_BACK && + event.getAction() == KeyEvent.ACTION_DOWN) + ((SessionActivity)this.getContext()).onBackPressed(); + return super.dispatchKeyEventPreIme(event); + } - // dirty hack: we call back to our activity and call onBackPressed as this doesn't reach us when the soft keyboard is shown ... - @Override - public boolean dispatchKeyEventPreIme(KeyEvent event) { - if (event.getKeyCode() == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) - ((SessionActivity) this.getContext()).onBackPressed(); - return super.dispatchKeyEventPreIme(event); - } + // perform mapping on the touch event's coordinates according to the current scaling + private MotionEvent mapTouchEvent(MotionEvent event) + { + MotionEvent mappedEvent = MotionEvent.obtain(event); + float[] coordinates = { mappedEvent.getX(), mappedEvent.getY() }; + invScaleMatrix.mapPoints(coordinates); + mappedEvent.setLocation(coordinates[0], coordinates[1]); + return mappedEvent; + } - // perform mapping on the touch event's coordinates according to the current scaling - private MotionEvent mapTouchEvent(MotionEvent event) { - MotionEvent mappedEvent = MotionEvent.obtain(event); - float[] coordinates = {mappedEvent.getX(), mappedEvent.getY()}; - invScaleMatrix.mapPoints(coordinates); - mappedEvent.setLocation(coordinates[0], coordinates[1]); - return mappedEvent; - } + // perform mapping on the double touch event's coordinates according to the current scaling + private MotionEvent mapDoubleTouchEvent(MotionEvent event) + { + MotionEvent mappedEvent = MotionEvent.obtain(event); + float[] coordinates = { (mappedEvent.getX(0) + mappedEvent.getX(1)) / 2, + (mappedEvent.getY(0) + mappedEvent.getY(1)) / 2 }; + invScaleMatrix.mapPoints(coordinates); + mappedEvent.setLocation(coordinates[0], coordinates[1]); + return mappedEvent; + } - // perform mapping on the double touch event's coordinates according to the current scaling - private MotionEvent mapDoubleTouchEvent(MotionEvent event) { - MotionEvent mappedEvent = MotionEvent.obtain(event); - float[] coordinates = {(mappedEvent.getX(0) + mappedEvent.getX(1)) / 2, (mappedEvent.getY(0) + mappedEvent.getY(1)) / 2}; - invScaleMatrix.mapPoints(coordinates); - mappedEvent.setLocation(coordinates[0], coordinates[1]); - return mappedEvent; - } + @Override public boolean onTouchEvent(MotionEvent event) + { + boolean res = gestureDetector.onTouchEvent(event); + res |= doubleGestureDetector.onTouchEvent(event); + return res; + } - @Override - public boolean onTouchEvent(MotionEvent event) { - boolean res = gestureDetector.onTouchEvent(event); - res |= doubleGestureDetector.onTouchEvent(event); - return res; - } + public interface SessionViewListener { + abstract void onSessionViewBeginTouch(); - public interface SessionViewListener { - abstract void onSessionViewBeginTouch(); + abstract void onSessionViewEndTouch(); - abstract void onSessionViewEndTouch(); + abstract void onSessionViewLeftTouch(int x, int y, boolean down); - abstract void onSessionViewLeftTouch(int x, int y, boolean down); + abstract void onSessionViewRightTouch(int x, int y, boolean down); - abstract void onSessionViewRightTouch(int x, int y, boolean down); + abstract void onSessionViewMove(int x, int y); - abstract void onSessionViewMove(int x, int y); + abstract void onSessionViewScroll(boolean down); + } - abstract void onSessionViewScroll(boolean down); - } + private class SessionGestureListener extends GestureDetector.SimpleOnGestureListener + { + boolean longPressInProgress = false; - private class SessionGestureListener extends GestureDetector.SimpleOnGestureListener { - boolean longPressInProgress = false; + public boolean onDown(MotionEvent e) + { + return true; + } - public boolean onDown(MotionEvent e) { - return true; - } + public boolean onUp(MotionEvent e) + { + sessionViewListener.onSessionViewEndTouch(); + return true; + } - public boolean onUp(MotionEvent e) { - sessionViewListener.onSessionViewEndTouch(); - return true; - } + public void onLongPress(MotionEvent e) + { + MotionEvent mappedEvent = mapTouchEvent(e); + sessionViewListener.onSessionViewBeginTouch(); + sessionViewListener.onSessionViewLeftTouch((int)mappedEvent.getX(), + (int)mappedEvent.getY(), true); + longPressInProgress = true; + } - public void onLongPress(MotionEvent e) { - MotionEvent mappedEvent = mapTouchEvent(e); - sessionViewListener.onSessionViewBeginTouch(); - sessionViewListener.onSessionViewLeftTouch((int) mappedEvent.getX(), (int) mappedEvent.getY(), true); - longPressInProgress = true; - } + public void onLongPressUp(MotionEvent e) + { + MotionEvent mappedEvent = mapTouchEvent(e); + sessionViewListener.onSessionViewLeftTouch((int)mappedEvent.getX(), + (int)mappedEvent.getY(), false); + longPressInProgress = false; + sessionViewListener.onSessionViewEndTouch(); + } - public void onLongPressUp(MotionEvent e) { - MotionEvent mappedEvent = mapTouchEvent(e); - sessionViewListener.onSessionViewLeftTouch((int) mappedEvent.getX(), (int) mappedEvent.getY(), false); - longPressInProgress = false; - sessionViewListener.onSessionViewEndTouch(); - } + public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) + { + if (longPressInProgress) + { + MotionEvent mappedEvent = mapTouchEvent(e2); + sessionViewListener.onSessionViewMove((int)mappedEvent.getX(), + (int)mappedEvent.getY()); + return true; + } - public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { - if (longPressInProgress) { - MotionEvent mappedEvent = mapTouchEvent(e2); - sessionViewListener.onSessionViewMove((int) mappedEvent.getX(), (int) mappedEvent.getY()); - return true; - } + return false; + } - return false; - } + public boolean onDoubleTap(MotionEvent e) + { + // send 2nd click for double click + MotionEvent mappedEvent = mapTouchEvent(e); + sessionViewListener.onSessionViewLeftTouch((int)mappedEvent.getX(), + (int)mappedEvent.getY(), true); + sessionViewListener.onSessionViewLeftTouch((int)mappedEvent.getX(), + (int)mappedEvent.getY(), false); + return true; + } - public boolean onDoubleTap(MotionEvent e) { - // send 2nd click for double click - MotionEvent mappedEvent = mapTouchEvent(e); - sessionViewListener.onSessionViewLeftTouch((int) mappedEvent.getX(), (int) mappedEvent.getY(), true); - sessionViewListener.onSessionViewLeftTouch((int) mappedEvent.getX(), (int) mappedEvent.getY(), false); - return true; - } + public boolean onSingleTapUp(MotionEvent e) + { + // send single click + MotionEvent mappedEvent = mapTouchEvent(e); + sessionViewListener.onSessionViewBeginTouch(); + switch (e.getButtonState()) + { + case MotionEvent.BUTTON_PRIMARY: + sessionViewListener.onSessionViewLeftTouch((int)mappedEvent.getX(), + (int)mappedEvent.getY(), true); + sessionViewListener.onSessionViewLeftTouch((int)mappedEvent.getX(), + (int)mappedEvent.getY(), false); + break; + case MotionEvent.BUTTON_SECONDARY: + sessionViewListener.onSessionViewRightTouch((int)mappedEvent.getX(), + (int)mappedEvent.getY(), true); + sessionViewListener.onSessionViewRightTouch((int)mappedEvent.getX(), + (int)mappedEvent.getY(), false); + sessionViewListener.onSessionViewLeftTouch((int)mappedEvent.getX(), + (int)mappedEvent.getY(), true); + sessionViewListener.onSessionViewLeftTouch((int)mappedEvent.getX(), + (int)mappedEvent.getY(), false); + break; + } + sessionViewListener.onSessionViewEndTouch(); + return true; + } + } - public boolean onSingleTapUp(MotionEvent e) { - // send single click - MotionEvent mappedEvent = mapTouchEvent(e); - sessionViewListener.onSessionViewBeginTouch(); - switch (e.getButtonState()) { - case MotionEvent.BUTTON_PRIMARY: - sessionViewListener.onSessionViewLeftTouch((int) mappedEvent.getX(), (int) mappedEvent.getY(), true); - sessionViewListener.onSessionViewLeftTouch((int) mappedEvent.getX(), (int) mappedEvent.getY(), false); - break; - case MotionEvent.BUTTON_SECONDARY: - sessionViewListener.onSessionViewRightTouch((int) mappedEvent.getX(), (int) mappedEvent.getY(), true); - sessionViewListener.onSessionViewRightTouch((int) mappedEvent.getX(), (int) mappedEvent.getY(), false); - sessionViewListener.onSessionViewLeftTouch((int) mappedEvent.getX(), (int) mappedEvent.getY(), true); - sessionViewListener.onSessionViewLeftTouch((int) mappedEvent.getX(), (int) mappedEvent.getY(), false); - break; - } - sessionViewListener.onSessionViewEndTouch(); - return true; - } - } + private class SessionDoubleGestureListener + implements DoubleGestureDetector.OnDoubleGestureListener + { + private MotionEvent prevEvent = null; - private class SessionDoubleGestureListener implements DoubleGestureDetector.OnDoubleGestureListener { - private MotionEvent prevEvent = null; + public boolean onDoubleTouchDown(MotionEvent e) + { + sessionViewListener.onSessionViewBeginTouch(); + prevEvent = MotionEvent.obtain(e); + return true; + } - public boolean onDoubleTouchDown(MotionEvent e) { - sessionViewListener.onSessionViewBeginTouch(); - prevEvent = MotionEvent.obtain(e); - return true; - } + public boolean onDoubleTouchUp(MotionEvent e) + { + if (prevEvent != null) + { + prevEvent.recycle(); + prevEvent = null; + } + sessionViewListener.onSessionViewEndTouch(); + return true; + } - public boolean onDoubleTouchUp(MotionEvent e) { - if (prevEvent != null) { - prevEvent.recycle(); - prevEvent = null; - } - sessionViewListener.onSessionViewEndTouch(); - return true; - } - - public boolean onDoubleTouchScroll(MotionEvent e1, MotionEvent e2) { - // calc if user scrolled up or down (or if any scrolling happened at all) - float deltaY = e2.getY() - prevEvent.getY(); - if (deltaY > TOUCH_SCROLL_DELTA) { - sessionViewListener.onSessionViewScroll(true); - prevEvent.recycle(); - prevEvent = MotionEvent.obtain(e2); - } else if (deltaY < -TOUCH_SCROLL_DELTA) { - sessionViewListener.onSessionViewScroll(false); - prevEvent.recycle(); - prevEvent = MotionEvent.obtain(e2); - } - return true; - } - - public boolean onDoubleTouchSingleTap(MotionEvent e) { - // send single click - MotionEvent mappedEvent = mapDoubleTouchEvent(e); - sessionViewListener.onSessionViewRightTouch((int) mappedEvent.getX(), (int) mappedEvent.getY(), true); - sessionViewListener.onSessionViewRightTouch((int) mappedEvent.getX(), (int) mappedEvent.getY(), false); - return true; - } - } + public boolean onDoubleTouchScroll(MotionEvent e1, MotionEvent e2) + { + // calc if user scrolled up or down (or if any scrolling happened at all) + float deltaY = e2.getY() - prevEvent.getY(); + if (deltaY > TOUCH_SCROLL_DELTA) + { + sessionViewListener.onSessionViewScroll(true); + prevEvent.recycle(); + prevEvent = MotionEvent.obtain(e2); + } + else if (deltaY < -TOUCH_SCROLL_DELTA) + { + sessionViewListener.onSessionViewScroll(false); + prevEvent.recycle(); + prevEvent = MotionEvent.obtain(e2); + } + return true; + } + public boolean onDoubleTouchSingleTap(MotionEvent e) + { + // send single click + MotionEvent mappedEvent = mapDoubleTouchEvent(e); + sessionViewListener.onSessionViewRightTouch((int)mappedEvent.getX(), + (int)mappedEvent.getY(), true); + sessionViewListener.onSessionViewRightTouch((int)mappedEvent.getX(), + (int)mappedEvent.getY(), false); + return true; + } + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/ShortcutsActivity.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/ShortcutsActivity.java index 7101fb451..2121c6e53 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/ShortcutsActivity.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/ShortcutsActivity.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.presentation; @@ -30,118 +31,130 @@ import com.freerdp.freerdpcore.utils.BookmarkArrayAdapter; import java.util.ArrayList; -public class ShortcutsActivity extends ListActivity { +public class ShortcutsActivity extends ListActivity +{ - public static final String TAG = "ShortcutsActivity"; + public static final String TAG = "ShortcutsActivity"; + @Override public void onCreate(Bundle savedInstanceState) + { - @Override - public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); - super.onCreate(savedInstanceState); + Intent intent = getIntent(); + if (Intent.ACTION_CREATE_SHORTCUT.equals(intent.getAction())) + { + // set listeners for the list view + getListView().setOnItemClickListener(new AdapterView.OnItemClickListener() { + public void onItemClick(AdapterView parent, View view, int position, long id) + { + String refStr = view.getTag().toString(); + String defLabel = + ((TextView)(view.findViewById(R.id.bookmark_text1))).getText().toString(); + setupShortcut(refStr, defLabel); + } + }); + } + else + { + // just exit + finish(); + } + } - Intent intent = getIntent(); - if (Intent.ACTION_CREATE_SHORTCUT.equals(intent.getAction())) { - // set listeners for the list view - getListView().setOnItemClickListener(new AdapterView.OnItemClickListener() { - public void onItemClick(AdapterView parent, View view, int position, long id) { - String refStr = view.getTag().toString(); - String defLabel = ((TextView) (view.findViewById(R.id.bookmark_text1))).getText().toString(); - setupShortcut(refStr, defLabel); - } - }); - } else { - // just exit - finish(); - } - } + @Override public void onResume() + { + super.onResume(); + // create bookmark cursor adapter + ArrayList bookmarks = GlobalApp.getManualBookmarkGateway().findAll(); + BookmarkArrayAdapter bookmarkAdapter = + new BookmarkArrayAdapter(this, android.R.layout.simple_list_item_2, bookmarks); + getListView().setAdapter(bookmarkAdapter); + } - @Override - public void onResume() { - super.onResume(); - // create bookmark cursor adapter - ArrayList bookmarks = GlobalApp.getManualBookmarkGateway().findAll(); - BookmarkArrayAdapter bookmarkAdapter = new BookmarkArrayAdapter(this, android.R.layout.simple_list_item_2, bookmarks); - getListView().setAdapter(bookmarkAdapter); - } + public void onPause() + { + super.onPause(); + getListView().setAdapter(null); + } - public void onPause() { - super.onPause(); - getListView().setAdapter(null); - } + /** + * This function creates a shortcut and returns it to the caller. There are actually two + * intents that you will send back. + *

+ * The first intent serves as a container for the shortcut and is returned to the launcher by + * setResult(). This intent must contain three fields: + *

+ *

    + *
  • {@link android.content.Intent#EXTRA_SHORTCUT_INTENT} The shortcut intent.
  • + *
  • {@link android.content.Intent#EXTRA_SHORTCUT_NAME} The text that will be displayed with + * the shortcut.
  • + *
  • {@link android.content.Intent#EXTRA_SHORTCUT_ICON} The shortcut's icon, if provided as a + * bitmap, or {@link android.content.Intent#EXTRA_SHORTCUT_ICON_RESOURCE} if provided as + * a drawable resource.
  • + *
+ *

+ * If you use a simple drawable resource, note that you must wrapper it using + * {@link android.content.Intent.ShortcutIconResource}, as shown below. This is required so + * that the launcher can access resources that are stored in your application's .apk file. If + * you return a bitmap, such as a thumbnail, you can simply put the bitmap into the extras + * bundle using {@link android.content.Intent#EXTRA_SHORTCUT_ICON}. + *

+ * The shortcut intent can be any intent that you wish the launcher to send, when the user + * clicks on the shortcut. Typically this will be {@link android.content.Intent#ACTION_VIEW} + * with an appropriate Uri for your content, but any Intent will work here as long as it + * triggers the desired action within your Activity. + */ - /** - * This function creates a shortcut and returns it to the caller. There are actually two - * intents that you will send back. - *

- * The first intent serves as a container for the shortcut and is returned to the launcher by - * setResult(). This intent must contain three fields: - *

- *

    - *
  • {@link android.content.Intent#EXTRA_SHORTCUT_INTENT} The shortcut intent.
  • - *
  • {@link android.content.Intent#EXTRA_SHORTCUT_NAME} The text that will be displayed with - * the shortcut.
  • - *
  • {@link android.content.Intent#EXTRA_SHORTCUT_ICON} The shortcut's icon, if provided as a - * bitmap, or {@link android.content.Intent#EXTRA_SHORTCUT_ICON_RESOURCE} if provided as - * a drawable resource.
  • - *
- *

- * If you use a simple drawable resource, note that you must wrapper it using - * {@link android.content.Intent.ShortcutIconResource}, as shown below. This is required so - * that the launcher can access resources that are stored in your application's .apk file. If - * you return a bitmap, such as a thumbnail, you can simply put the bitmap into the extras - * bundle using {@link android.content.Intent#EXTRA_SHORTCUT_ICON}. - *

- * The shortcut intent can be any intent that you wish the launcher to send, when the user - * clicks on the shortcut. Typically this will be {@link android.content.Intent#ACTION_VIEW} - * with an appropriate Uri for your content, but any Intent will work here as long as it - * triggers the desired action within your Activity. - */ + private void setupShortcut(String strRef, String defaultLabel) + { + final String paramStrRef = strRef; + final String paramDefaultLabel = defaultLabel; + final Context paramContext = this; - private void setupShortcut(String strRef, String defaultLabel) { - final String paramStrRef = strRef; - final String paramDefaultLabel = defaultLabel; - final Context paramContext = this; + // display edit dialog to the user so he can specify the shortcut name + final EditText input = new EditText(this); + input.setText(defaultLabel); - // display edit dialog to the user so he can specify the shortcut name - final EditText input = new EditText(this); - input.setText(defaultLabel); + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle(R.string.dlg_title_create_shortcut) + .setMessage(R.string.dlg_msg_create_shortcut) + .setView(input) + .setPositiveButton( + android.R.string.ok, + new DialogInterface.OnClickListener() { + @Override public void onClick(DialogInterface dialog, int which) + { + String label = input.getText().toString(); + if (label.length() == 0) + label = paramDefaultLabel; - AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setTitle(R.string.dlg_title_create_shortcut) - .setMessage(R.string.dlg_msg_create_shortcut) - .setView(input) - .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - String label = input.getText().toString(); - if (label.length() == 0) - label = paramDefaultLabel; + Intent shortcutIntent = new Intent(Intent.ACTION_VIEW); + shortcutIntent.setClassName(paramContext, + SessionRequestHandlerActivity.class.getName()); + shortcutIntent.setData(Uri.parse(paramStrRef)); - Intent shortcutIntent = new Intent(Intent.ACTION_VIEW); - shortcutIntent.setClassName(paramContext, SessionRequestHandlerActivity.class.getName()); - shortcutIntent.setData(Uri.parse(paramStrRef)); - - // Then, set up the container intent (the response to the caller) - Intent intent = new Intent(); - intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent); - intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, label); - Parcelable iconResource = Intent.ShortcutIconResource.fromContext(paramContext, R.drawable.icon_launcher_freerdp); - intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource); - - // Now, return the result to the launcher - setResult(RESULT_OK, intent); - finish(); - } - }) - .setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - dialog.dismiss(); - } - }) - .create().show(); - - } + // Then, set up the container intent (the response to the caller) + Intent intent = new Intent(); + intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent); + intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, label); + Parcelable iconResource = Intent.ShortcutIconResource.fromContext( + paramContext, R.drawable.icon_launcher_freerdp); + intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource); + // Now, return the result to the launcher + setResult(RESULT_OK, intent); + finish(); + } + }) + .setNegativeButton(android.R.string.cancel, + new DialogInterface.OnClickListener() { + @Override public void onClick(DialogInterface dialog, int which) + { + dialog.dismiss(); + } + }) + .create() + .show(); + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/TouchPointerView.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/TouchPointerView.java index d58159dd0..6b8b96ce6 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/TouchPointerView.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/TouchPointerView.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.presentation; @@ -21,312 +22,364 @@ import android.widget.ImageView; import com.freerdp.freerdpcore.R; import com.freerdp.freerdpcore.utils.GestureDetector; -public class TouchPointerView extends ImageView { +public class TouchPointerView extends ImageView +{ - private static final int POINTER_ACTION_CURSOR = 0; - private static final int POINTER_ACTION_CLOSE = 3; + private static final int POINTER_ACTION_CURSOR = 0; + private static final int POINTER_ACTION_CLOSE = 3; + // the touch pointer consists of 9 quadrants with the following functionality: + // + // ------------- + // | 0 | 1 | 2 | + // ------------- + // | 3 | 4 | 5 | + // ------------- + // | 6 | 7 | 8 | + // ------------- + // + // 0 ... contains the actual pointer (the tip must be centered in the quadrant) + // 1 ... is left empty + // 2, 3, 5, 6, 7, 8 ... function quadrants that issue a callback + // 4 ... pointer center used for left clicks and to drag the pointer + private static final int POINTER_ACTION_RCLICK = 2; + private static final int POINTER_ACTION_LCLICK = 4; + private static final int POINTER_ACTION_MOVE = 4; + private static final int POINTER_ACTION_SCROLL = 5; + private static final int POINTER_ACTION_RESET = 6; + private static final int POINTER_ACTION_KEYBOARD = 7; + private static final int POINTER_ACTION_EXTKEYBOARD = 8; + private static final float SCROLL_DELTA = 10.0f; + private static final int DEFAULT_TOUCH_POINTER_RESTORE_DELAY = 150; + private RectF pointerRect; + private RectF pointerAreaRects[] = new RectF[9]; + private Matrix translationMatrix; + private boolean pointerMoving = false; + private boolean pointerScrolling = false; + private TouchPointerListener listener = null; + private UIHandler uiHandler = new UIHandler(); + // gesture detection + private GestureDetector gestureDetector; + public TouchPointerView(Context context) + { + super(context); + initTouchPointer(context); + } - // the touch pointer consists of 9 quadrants with the following functionality: - // - // ------------- - // | 0 | 1 | 2 | - // ------------- - // | 3 | 4 | 5 | - // ------------- - // | 6 | 7 | 8 | - // ------------- - // - // 0 ... contains the actual pointer (the tip must be centered in the quadrant) - // 1 ... is left empty - // 2, 3, 5, 6, 7, 8 ... function quadrants that issue a callback - // 4 ... pointer center used for left clicks and to drag the pointer - private static final int POINTER_ACTION_RCLICK = 2; - private static final int POINTER_ACTION_LCLICK = 4; - private static final int POINTER_ACTION_MOVE = 4; - private static final int POINTER_ACTION_SCROLL = 5; - private static final int POINTER_ACTION_RESET = 6; - private static final int POINTER_ACTION_KEYBOARD = 7; - private static final int POINTER_ACTION_EXTKEYBOARD = 8; - private static final float SCROLL_DELTA = 10.0f; - private static final int DEFAULT_TOUCH_POINTER_RESTORE_DELAY = 150; - private RectF pointerRect; - private RectF pointerAreaRects[] = new RectF[9]; - private Matrix translationMatrix; - private boolean pointerMoving = false; - private boolean pointerScrolling = false; - private TouchPointerListener listener = null; - private UIHandler uiHandler = new UIHandler(); - // gesture detection - private GestureDetector gestureDetector; - public TouchPointerView(Context context) { - super(context); - initTouchPointer(context); - } + public TouchPointerView(Context context, AttributeSet attrs) + { + super(context, attrs); + initTouchPointer(context); + } - public TouchPointerView(Context context, AttributeSet attrs) { - super(context, attrs); - initTouchPointer(context); - } + public TouchPointerView(Context context, AttributeSet attrs, int defStyle) + { + super(context, attrs, defStyle); + initTouchPointer(context); + } - public TouchPointerView(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - initTouchPointer(context); - } + private void initTouchPointer(Context context) + { + gestureDetector = + new GestureDetector(context, new TouchPointerGestureListener(), null, true); + gestureDetector.setLongPressTimeout(500); + translationMatrix = new Matrix(); + setScaleType(ScaleType.MATRIX); + setImageMatrix(translationMatrix); - private void initTouchPointer(Context context) { - gestureDetector = new GestureDetector(context, new TouchPointerGestureListener(), null, true); - gestureDetector.setLongPressTimeout(500); - translationMatrix = new Matrix(); - setScaleType(ScaleType.MATRIX); - setImageMatrix(translationMatrix); + // init rects + final float rectSizeWidth = (float)getDrawable().getIntrinsicWidth() / 3.0f; + final float rectSizeHeight = (float)getDrawable().getIntrinsicWidth() / 3.0f; + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 3; j++) + { + int left = (int)(j * rectSizeWidth); + int top = (int)(i * rectSizeHeight); + int right = left + (int)rectSizeWidth; + int bottom = top + (int)rectSizeHeight; + pointerAreaRects[i * 3 + j] = new RectF(left, top, right, bottom); + } + } + pointerRect = + new RectF(0, 0, getDrawable().getIntrinsicWidth(), getDrawable().getIntrinsicHeight()); + } - // init rects - final float rectSizeWidth = (float) getDrawable().getIntrinsicWidth() / 3.0f; - final float rectSizeHeight = (float) getDrawable().getIntrinsicWidth() / 3.0f; - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 3; j++) { - int left = (int) (j * rectSizeWidth); - int top = (int) (i * rectSizeHeight); - int right = left + (int) rectSizeWidth; - int bottom = top + (int) rectSizeHeight; - pointerAreaRects[i * 3 + j] = new RectF(left, top, right, bottom); - } - } - pointerRect = new RectF(0, 0, getDrawable().getIntrinsicWidth(), getDrawable().getIntrinsicHeight()); - } + public void setTouchPointerListener(TouchPointerListener listener) + { + this.listener = listener; + } - public void setTouchPointerListener(TouchPointerListener listener) { - this.listener = listener; - } + public int getPointerWidth() + { + return getDrawable().getIntrinsicWidth(); + } - public int getPointerWidth() { - return getDrawable().getIntrinsicWidth(); - } + public int getPointerHeight() + { + return getDrawable().getIntrinsicHeight(); + } - public int getPointerHeight() { - return getDrawable().getIntrinsicHeight(); - } + public float[] getPointerPosition() + { + float[] curPos = new float[2]; + translationMatrix.mapPoints(curPos); + return curPos; + } - public float[] getPointerPosition() { - float[] curPos = new float[2]; - translationMatrix.mapPoints(curPos); - return curPos; - } + private void movePointer(float deltaX, float deltaY) + { + translationMatrix.postTranslate(deltaX, deltaY); + setImageMatrix(translationMatrix); + } - private void movePointer(float deltaX, float deltaY) { - translationMatrix.postTranslate(deltaX, deltaY); - setImageMatrix(translationMatrix); - } + private void ensureVisibility(int screen_width, int screen_height) + { + float[] curPos = new float[2]; + translationMatrix.mapPoints(curPos); - private void ensureVisibility(int screen_width, int screen_height) { - float[] curPos = new float[2]; - translationMatrix.mapPoints(curPos); + if (curPos[0] > (screen_width - pointerRect.width())) + curPos[0] = screen_width - pointerRect.width(); + if (curPos[0] < 0) + curPos[0] = 0; + if (curPos[1] > (screen_height - pointerRect.height())) + curPos[1] = screen_height - pointerRect.height(); + if (curPos[1] < 0) + curPos[1] = 0; - if (curPos[0] > (screen_width - pointerRect.width())) - curPos[0] = screen_width - pointerRect.width(); - if (curPos[0] < 0) - curPos[0] = 0; - if (curPos[1] > (screen_height - pointerRect.height())) - curPos[1] = screen_height - pointerRect.height(); - if (curPos[1] < 0) - curPos[1] = 0; + translationMatrix.setTranslate(curPos[0], curPos[1]); + setImageMatrix(translationMatrix); + } - translationMatrix.setTranslate(curPos[0], curPos[1]); - setImageMatrix(translationMatrix); - } + private void displayPointerImageAction(int resId) + { + setPointerImage(resId); + uiHandler.sendEmptyMessageDelayed(0, DEFAULT_TOUCH_POINTER_RESTORE_DELAY); + } - private void displayPointerImageAction(int resId) { - setPointerImage(resId); - uiHandler.sendEmptyMessageDelayed(0, DEFAULT_TOUCH_POINTER_RESTORE_DELAY); - } + private void setPointerImage(int resId) + { + setImageResource(resId); + } - private void setPointerImage(int resId) { - setImageResource(resId); - } + // returns the pointer area with the current translation matrix applied + private RectF getCurrentPointerArea(int area) + { + RectF transRect = new RectF(pointerAreaRects[area]); + translationMatrix.mapRect(transRect); + return transRect; + } - // returns the pointer area with the current translation matrix applied - private RectF getCurrentPointerArea(int area) { - RectF transRect = new RectF(pointerAreaRects[area]); - translationMatrix.mapRect(transRect); - return transRect; - } + private boolean pointerAreaTouched(MotionEvent event, int area) + { + RectF transRect = new RectF(pointerAreaRects[area]); + translationMatrix.mapRect(transRect); + if (transRect.contains(event.getX(), event.getY())) + return true; + return false; + } - private boolean pointerAreaTouched(MotionEvent event, int area) { - RectF transRect = new RectF(pointerAreaRects[area]); - translationMatrix.mapRect(transRect); - if (transRect.contains(event.getX(), event.getY())) - return true; - return false; - } + private boolean pointerTouched(MotionEvent event) + { + RectF transRect = new RectF(pointerRect); + translationMatrix.mapRect(transRect); + if (transRect.contains(event.getX(), event.getY())) + return true; + return false; + } - private boolean pointerTouched(MotionEvent event) { - RectF transRect = new RectF(pointerRect); - translationMatrix.mapRect(transRect); - if (transRect.contains(event.getX(), event.getY())) - return true; - return false; - } + @Override public boolean onTouchEvent(MotionEvent event) + { + // check if pointer is being moved or if we are in scroll mode or if the pointer is touched + if (!pointerMoving && !pointerScrolling && !pointerTouched(event)) + return false; + return gestureDetector.onTouchEvent(event); + } - @Override - public boolean onTouchEvent(MotionEvent event) { - // check if pointer is being moved or if we are in scroll mode or if the pointer is touched - if (!pointerMoving && !pointerScrolling && !pointerTouched(event)) - return false; - return gestureDetector.onTouchEvent(event); - } + @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) + { + // ensure touch pointer is visible + if (changed) + ensureVisibility(right - left, bottom - top); + } - @Override - protected void onLayout(boolean changed, int left, int top, int right, int bottom) { - // ensure touch pointer is visible - if (changed) - ensureVisibility(right - left, bottom - top); - } + // touch pointer listener - is triggered if an action field is + public interface TouchPointerListener { + abstract void onTouchPointerClose(); - // touch pointer listener - is triggered if an action field is - public interface TouchPointerListener { - abstract void onTouchPointerClose(); + abstract void onTouchPointerLeftClick(int x, int y, boolean down); - abstract void onTouchPointerLeftClick(int x, int y, boolean down); + abstract void onTouchPointerRightClick(int x, int y, boolean down); - abstract void onTouchPointerRightClick(int x, int y, boolean down); + abstract void onTouchPointerMove(int x, int y); - abstract void onTouchPointerMove(int x, int y); + abstract void onTouchPointerScroll(boolean down); - abstract void onTouchPointerScroll(boolean down); + abstract void onTouchPointerToggleKeyboard(); - abstract void onTouchPointerToggleKeyboard(); + abstract void onTouchPointerToggleExtKeyboard(); - abstract void onTouchPointerToggleExtKeyboard(); + abstract void onTouchPointerResetScrollZoom(); + } - abstract void onTouchPointerResetScrollZoom(); - } + private class UIHandler extends Handler + { - private class UIHandler extends Handler { + UIHandler() + { + super(); + } - UIHandler() { - super(); - } + @Override public void handleMessage(Message msg) + { + setPointerImage(R.drawable.touch_pointer_default); + } + } - @Override - public void handleMessage(Message msg) { - setPointerImage(R.drawable.touch_pointer_default); - } - } + private class TouchPointerGestureListener extends GestureDetector.SimpleOnGestureListener + { - private class TouchPointerGestureListener extends GestureDetector.SimpleOnGestureListener { + private MotionEvent prevEvent = null; - private MotionEvent prevEvent = null; + public boolean onDown(MotionEvent e) + { + if (pointerAreaTouched(e, POINTER_ACTION_MOVE)) + { + prevEvent = MotionEvent.obtain(e); + pointerMoving = true; + } + else if (pointerAreaTouched(e, POINTER_ACTION_SCROLL)) + { + prevEvent = MotionEvent.obtain(e); + pointerScrolling = true; + setPointerImage(R.drawable.touch_pointer_scroll); + } - public boolean onDown(MotionEvent e) { - if (pointerAreaTouched(e, POINTER_ACTION_MOVE)) { - prevEvent = MotionEvent.obtain(e); - pointerMoving = true; - } else if (pointerAreaTouched(e, POINTER_ACTION_SCROLL)) { - prevEvent = MotionEvent.obtain(e); - pointerScrolling = true; - setPointerImage(R.drawable.touch_pointer_scroll); - } + return true; + } - return true; - } + public boolean onUp(MotionEvent e) + { + if (prevEvent != null) + { + prevEvent.recycle(); + prevEvent = null; + } - public boolean onUp(MotionEvent e) { - if (prevEvent != null) { - prevEvent.recycle(); - prevEvent = null; - } + if (pointerScrolling) + setPointerImage(R.drawable.touch_pointer_default); - if (pointerScrolling) - setPointerImage(R.drawable.touch_pointer_default); + pointerMoving = false; + pointerScrolling = false; + return true; + } - pointerMoving = false; - pointerScrolling = false; - return true; - } + public void onLongPress(MotionEvent e) + { + if (pointerAreaTouched(e, POINTER_ACTION_LCLICK)) + { + setPointerImage(R.drawable.touch_pointer_active); + pointerMoving = true; + RectF rect = getCurrentPointerArea(POINTER_ACTION_CURSOR); + listener.onTouchPointerLeftClick((int)rect.centerX(), (int)rect.centerY(), true); + } + } - public void onLongPress(MotionEvent e) { - if (pointerAreaTouched(e, POINTER_ACTION_LCLICK)) { - setPointerImage(R.drawable.touch_pointer_active); - pointerMoving = true; - RectF rect = getCurrentPointerArea(POINTER_ACTION_CURSOR); - listener.onTouchPointerLeftClick((int) rect.centerX(), (int) rect.centerY(), true); - } - } + public void onLongPressUp(MotionEvent e) + { + if (pointerMoving) + { + setPointerImage(R.drawable.touch_pointer_default); + pointerMoving = false; + RectF rect = getCurrentPointerArea(POINTER_ACTION_CURSOR); + listener.onTouchPointerLeftClick((int)rect.centerX(), (int)rect.centerY(), false); + } + } - public void onLongPressUp(MotionEvent e) { - if (pointerMoving) { - setPointerImage(R.drawable.touch_pointer_default); - pointerMoving = false; - RectF rect = getCurrentPointerArea(POINTER_ACTION_CURSOR); - listener.onTouchPointerLeftClick((int) rect.centerX(), (int) rect.centerY(), false); - } - } + public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) + { + if (pointerMoving) + { + // move pointer graphics + movePointer((int)(e2.getX() - prevEvent.getX()), + (int)(e2.getY() - prevEvent.getY())); + prevEvent.recycle(); + prevEvent = MotionEvent.obtain(e2); - public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { - if (pointerMoving) { - // move pointer graphics - movePointer((int) (e2.getX() - prevEvent.getX()), (int) (e2.getY() - prevEvent.getY())); - prevEvent.recycle(); - prevEvent = MotionEvent.obtain(e2); + // send move notification + RectF rect = getCurrentPointerArea(POINTER_ACTION_CURSOR); + listener.onTouchPointerMove((int)rect.centerX(), (int)rect.centerY()); + return true; + } + else if (pointerScrolling) + { + // calc if user scrolled up or down (or if any scrolling happened at all) + float deltaY = e2.getY() - prevEvent.getY(); + if (deltaY > SCROLL_DELTA) + { + listener.onTouchPointerScroll(true); + prevEvent.recycle(); + prevEvent = MotionEvent.obtain(e2); + } + else if (deltaY < -SCROLL_DELTA) + { + listener.onTouchPointerScroll(false); + prevEvent.recycle(); + prevEvent = MotionEvent.obtain(e2); + } + return true; + } + return false; + } - // send move notification - RectF rect = getCurrentPointerArea(POINTER_ACTION_CURSOR); - listener.onTouchPointerMove((int) rect.centerX(), (int) rect.centerY()); - return true; - } else if (pointerScrolling) { - // calc if user scrolled up or down (or if any scrolling happened at all) - float deltaY = e2.getY() - prevEvent.getY(); - if (deltaY > SCROLL_DELTA) { - listener.onTouchPointerScroll(true); - prevEvent.recycle(); - prevEvent = MotionEvent.obtain(e2); - } else if (deltaY < -SCROLL_DELTA) { - listener.onTouchPointerScroll(false); - prevEvent.recycle(); - prevEvent = MotionEvent.obtain(e2); - } - return true; - } - return false; - } + public boolean onSingleTapUp(MotionEvent e) + { + // look what area got touched and fire actions accordingly + if (pointerAreaTouched(e, POINTER_ACTION_CLOSE)) + listener.onTouchPointerClose(); + else if (pointerAreaTouched(e, POINTER_ACTION_LCLICK)) + { + displayPointerImageAction(R.drawable.touch_pointer_lclick); + RectF rect = getCurrentPointerArea(POINTER_ACTION_CURSOR); + listener.onTouchPointerLeftClick((int)rect.centerX(), (int)rect.centerY(), true); + listener.onTouchPointerLeftClick((int)rect.centerX(), (int)rect.centerY(), false); + } + else if (pointerAreaTouched(e, POINTER_ACTION_RCLICK)) + { + displayPointerImageAction(R.drawable.touch_pointer_rclick); + RectF rect = getCurrentPointerArea(POINTER_ACTION_CURSOR); + listener.onTouchPointerRightClick((int)rect.centerX(), (int)rect.centerY(), true); + listener.onTouchPointerRightClick((int)rect.centerX(), (int)rect.centerY(), false); + } + else if (pointerAreaTouched(e, POINTER_ACTION_KEYBOARD)) + { + displayPointerImageAction(R.drawable.touch_pointer_keyboard); + listener.onTouchPointerToggleKeyboard(); + } + else if (pointerAreaTouched(e, POINTER_ACTION_EXTKEYBOARD)) + { + displayPointerImageAction(R.drawable.touch_pointer_extkeyboard); + listener.onTouchPointerToggleExtKeyboard(); + } + else if (pointerAreaTouched(e, POINTER_ACTION_RESET)) + { + displayPointerImageAction(R.drawable.touch_pointer_reset); + listener.onTouchPointerResetScrollZoom(); + } - public boolean onSingleTapUp(MotionEvent e) { - // look what area got touched and fire actions accordingly - if (pointerAreaTouched(e, POINTER_ACTION_CLOSE)) - listener.onTouchPointerClose(); - else if (pointerAreaTouched(e, POINTER_ACTION_LCLICK)) { - displayPointerImageAction(R.drawable.touch_pointer_lclick); - RectF rect = getCurrentPointerArea(POINTER_ACTION_CURSOR); - listener.onTouchPointerLeftClick((int) rect.centerX(), (int) rect.centerY(), true); - listener.onTouchPointerLeftClick((int) rect.centerX(), (int) rect.centerY(), false); - } else if (pointerAreaTouched(e, POINTER_ACTION_RCLICK)) { - displayPointerImageAction(R.drawable.touch_pointer_rclick); - RectF rect = getCurrentPointerArea(POINTER_ACTION_CURSOR); - listener.onTouchPointerRightClick((int) rect.centerX(), (int) rect.centerY(), true); - listener.onTouchPointerRightClick((int) rect.centerX(), (int) rect.centerY(), false); - } else if (pointerAreaTouched(e, POINTER_ACTION_KEYBOARD)) { - displayPointerImageAction(R.drawable.touch_pointer_keyboard); - listener.onTouchPointerToggleKeyboard(); - } else if (pointerAreaTouched(e, POINTER_ACTION_EXTKEYBOARD)) { - displayPointerImageAction(R.drawable.touch_pointer_extkeyboard); - listener.onTouchPointerToggleExtKeyboard(); - } else if (pointerAreaTouched(e, POINTER_ACTION_RESET)) { - displayPointerImageAction(R.drawable.touch_pointer_reset); - listener.onTouchPointerResetScrollZoom(); - } + return true; + } - return true; - } - - public boolean onDoubleTap(MotionEvent e) { - // issue a double click notification if performed in center quadrant - if (pointerAreaTouched(e, POINTER_ACTION_LCLICK)) { - RectF rect = getCurrentPointerArea(POINTER_ACTION_CURSOR); - listener.onTouchPointerLeftClick((int) rect.centerX(), (int) rect.centerY(), true); - listener.onTouchPointerLeftClick((int) rect.centerX(), (int) rect.centerY(), false); - } - return true; - } - } + public boolean onDoubleTap(MotionEvent e) + { + // issue a double click notification if performed in center quadrant + if (pointerAreaTouched(e, POINTER_ACTION_LCLICK)) + { + RectF rect = getCurrentPointerArea(POINTER_ACTION_CURSOR); + listener.onTouchPointerLeftClick((int)rect.centerX(), (int)rect.centerY(), true); + listener.onTouchPointerLeftClick((int)rect.centerX(), (int)rect.centerY(), false); + } + return true; + } + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/BookmarkBaseGateway.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/BookmarkBaseGateway.java index 5335ff507..d3ed7fe16 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/BookmarkBaseGateway.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/BookmarkBaseGateway.java @@ -3,13 +3,13 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.services; - import android.content.ContentValues; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; @@ -22,453 +22,596 @@ import com.freerdp.freerdpcore.domain.BookmarkBase; import java.util.ArrayList; -public abstract class BookmarkBaseGateway { - private final static String TAG = "BookmarkBaseGateway"; - private SQLiteOpenHelper bookmarkDB; - - private static final String JOIN_PREFIX = "join_"; - private static final String KEY_BOOKMARK_ID = "bookmarkId"; - private static final String KEY_SCREEN_COLORS = "screenColors"; - private static final String KEY_SCREEN_COLORS_3G = "screenColors3G"; - private static final String KEY_SCREEN_RESOLUTION = "screenResolution"; - private static final String KEY_SCREEN_RESOLUTION_3G = "screenResolution3G"; - private static final String KEY_SCREEN_WIDTH = "screenWidth"; - private static final String KEY_SCREEN_WIDTH_3G = "screenWidth3G"; - private static final String KEY_SCREEN_HEIGHT = "screenHeight"; - private static final String KEY_SCREEN_HEIGHT_3G = "screenHeight3G"; - - private static final String KEY_PERFORMANCE_RFX = "performanceRemoteFX"; - private static final String KEY_PERFORMANCE_RFX_3G = "performanceRemoteFX3G"; - private static final String KEY_PERFORMANCE_GFX = "performanceGfx"; - private static final String KEY_PERFORMANCE_GFX_3G = "performanceGfx3G"; - private static final String KEY_PERFORMANCE_H264 = "performanceGfxH264"; - private static final String KEY_PERFORMANCE_H264_3G = "performanceGfxH2643G"; - private static final String KEY_PERFORMANCE_WALLPAPER = "performanceWallpaper"; - private static final String KEY_PERFORMANCE_WALLPAPER_3G = "performanceWallpaper3G"; - private static final String KEY_PERFORMANCE_THEME = "performanceTheming"; - private static final String KEY_PERFORMANCE_THEME_3G = "performanceTheming3G"; - - private static final String KEY_PERFORMANCE_DRAG = "performanceFullWindowDrag"; - private static final String KEY_PERFORMANCE_DRAG_3G = "performanceFullWindowDrag3G"; - private static final String KEY_PERFORMANCE_MENU_ANIMATIONS = "performanceMenuAnimations"; - private static final String KEY_PERFORMANCE_MENU_ANIMATIONS_3G = "performanceMenuAnimations3G"; - private static final String KEY_PERFORMANCE_FONTS = "performanceFontSmoothing"; - private static final String KEY_PERFORMANCE_FONTS_3G = "performanceFontSmoothing3G"; - private static final String KEY_PERFORMANCE_COMPOSITION = "performanceDesktopComposition"; - private static final String KEY_PERFORMANCE_COMPOSITION_3G = "performanceDesktopComposition3G"; - - public BookmarkBaseGateway(SQLiteOpenHelper bookmarkDB) { - this.bookmarkDB = bookmarkDB; - } - - protected abstract BookmarkBase createBookmark(); - - protected abstract String getBookmarkTableName(); - - protected abstract void addBookmarkSpecificColumns(ArrayList columns); - - protected abstract void addBookmarkSpecificColumns(BookmarkBase bookmark, ContentValues columns); - - protected abstract void readBookmarkSpecificColumns(BookmarkBase bookmark, Cursor cursor); - - public void insert(BookmarkBase bookmark) { - // begin transaction - SQLiteDatabase db = getWritableDatabase(); - db.beginTransaction(); - - long rowid; - ContentValues values = new ContentValues(); - values.put(BookmarkDB.DB_KEY_BOOKMARK_LABEL, bookmark.getLabel()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_USERNAME, bookmark.getUsername()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_PASSWORD, bookmark.getPassword()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_DOMAIN, bookmark.getDomain()); - // insert screen and performance settings - rowid = insertScreenSettings(db, bookmark.getScreenSettings()); - values.put(BookmarkDB.DB_KEY_SCREEN_SETTINGS, rowid); - rowid = insertPerformanceFlags(db, bookmark.getPerformanceFlags()); - values.put(BookmarkDB.DB_KEY_PERFORMANCE_FLAGS, rowid); - - // advanced settings - values.put(BookmarkDB.DB_KEY_BOOKMARK_3G_ENABLE, bookmark.getAdvancedSettings().getEnable3GSettings()); - // insert 3G screen and 3G performance settings - rowid = insertScreenSettings(db, bookmark.getAdvancedSettings().getScreen3G()); - values.put(BookmarkDB.DB_KEY_SCREEN_SETTINGS_3G, rowid); - rowid = insertPerformanceFlags(db, bookmark.getAdvancedSettings().getPerformance3G()); - values.put(BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G, rowid); - values.put(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_SDCARD, bookmark.getAdvancedSettings().getRedirectSDCard()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_SOUND, bookmark.getAdvancedSettings().getRedirectSound()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_MICROPHONE, bookmark.getAdvancedSettings().getRedirectMicrophone()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_SECURITY, bookmark.getAdvancedSettings().getSecurity()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_CONSOLE_MODE, bookmark.getAdvancedSettings().getConsoleMode()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_REMOTE_PROGRAM, bookmark.getAdvancedSettings().getRemoteProgram()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_WORK_DIR, bookmark.getAdvancedSettings().getWorkDir()); - - values.put(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_CHANNEL, bookmark.getDebugSettings().getAsyncChannel()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_INPUT, bookmark.getDebugSettings().getAsyncInput()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_UPDATE, bookmark.getDebugSettings().getAsyncUpdate()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_DEBUG_LEVEL, bookmark.getDebugSettings().getDebugLevel()); - - // add any special columns - addBookmarkSpecificColumns(bookmark, values); - - // insert bookmark and end transaction - db.insertOrThrow(getBookmarkTableName(), null, values); - db.setTransactionSuccessful(); - db.endTransaction(); - } - - public boolean update(BookmarkBase bookmark) { - // start a transaction - SQLiteDatabase db = getWritableDatabase(); - db.beginTransaction(); - - // bookmark settings - ContentValues values = new ContentValues(); - values.put(BookmarkDB.DB_KEY_BOOKMARK_LABEL, bookmark.getLabel()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_USERNAME, bookmark.getUsername()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_PASSWORD, bookmark.getPassword()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_DOMAIN, bookmark.getDomain()); - // update screen and performance settings settings - updateScreenSettings(db, bookmark); - updatePerformanceFlags(db, bookmark); - - // advanced settings - values.put(BookmarkDB.DB_KEY_BOOKMARK_3G_ENABLE, bookmark.getAdvancedSettings().getEnable3GSettings()); - // update 3G screen and 3G performance settings settings - updateScreenSettings3G(db, bookmark); - updatePerformanceFlags3G(db, bookmark); - values.put(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_SDCARD, bookmark.getAdvancedSettings().getRedirectSDCard()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_SOUND, bookmark.getAdvancedSettings().getRedirectSound()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_MICROPHONE, bookmark.getAdvancedSettings().getRedirectMicrophone()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_SECURITY, bookmark.getAdvancedSettings().getSecurity()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_CONSOLE_MODE, bookmark.getAdvancedSettings().getConsoleMode()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_REMOTE_PROGRAM, bookmark.getAdvancedSettings().getRemoteProgram()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_WORK_DIR, bookmark.getAdvancedSettings().getWorkDir()); - - values.put(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_CHANNEL, bookmark.getDebugSettings().getAsyncChannel()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_INPUT, bookmark.getDebugSettings().getAsyncInput()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_UPDATE, bookmark.getDebugSettings().getAsyncUpdate()); - values.put(BookmarkDB.DB_KEY_BOOKMARK_DEBUG_LEVEL, bookmark.getDebugSettings().getDebugLevel()); - - addBookmarkSpecificColumns(bookmark, values); - - // update bookmark - boolean res = (db.update(getBookmarkTableName(), values, BookmarkDB.ID + " = " + bookmark.getId(), null) == 1); - - // commit - db.setTransactionSuccessful(); - db.endTransaction(); - - return res; - } - - public void delete(long id) { - SQLiteDatabase db = getWritableDatabase(); - db.delete(getBookmarkTableName(), BookmarkDB.ID + " = " + id, null); - } - - public BookmarkBase findById(long id) { - Cursor cursor = queryBookmarks(getBookmarkTableName() + "." + BookmarkDB.ID + " = " + id, null); - if (cursor.getCount() == 0) { - cursor.close(); - return null; - } - - cursor.moveToFirst(); - BookmarkBase bookmark = getBookmarkFromCursor(cursor); - cursor.close(); - return bookmark; - } - - public BookmarkBase findByLabel(String label) { - Cursor cursor = queryBookmarks(BookmarkDB.DB_KEY_BOOKMARK_LABEL + " = '" + label + "'", BookmarkDB.DB_KEY_BOOKMARK_LABEL); - if (cursor.getCount() > 1) - Log.e(TAG, "More than one bookmark with the same label found!"); - - BookmarkBase bookmark = null; - if (cursor.moveToFirst() && (cursor.getCount() > 0)) - bookmark = getBookmarkFromCursor(cursor); - - cursor.close(); - return bookmark; - } - - public ArrayList findByLabelLike(String pattern) { - Cursor cursor = queryBookmarks(BookmarkDB.DB_KEY_BOOKMARK_LABEL + " LIKE '%" + pattern + "%'", BookmarkDB.DB_KEY_BOOKMARK_LABEL); - ArrayList bookmarks = new ArrayList(cursor.getCount()); - - if (cursor.moveToFirst() && (cursor.getCount() > 0)) { - do { - bookmarks.add(getBookmarkFromCursor(cursor)); - } while (cursor.moveToNext()); - } - - cursor.close(); - return bookmarks; - } - - public ArrayList findAll() { - Cursor cursor = queryBookmarks(null, BookmarkDB.DB_KEY_BOOKMARK_LABEL); - final int count = cursor.getCount(); - ArrayList bookmarks = new ArrayList<>(count); - - if (cursor.moveToFirst() && (count > 0)) { - do { - bookmarks.add(getBookmarkFromCursor(cursor)); - } while (cursor.moveToNext()); - } - - cursor.close(); - return bookmarks; - } - - protected Cursor queryBookmarks(String whereClause, String orderBy) { - // create tables string - final String ID = BookmarkDB.ID; - final String tables = BookmarkDB.DB_TABLE_BOOKMARK + " INNER JOIN " + - BookmarkDB.DB_TABLE_SCREEN + " AS " + JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS + " ON " + JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS + "." + - ID + " = " + BookmarkDB.DB_TABLE_BOOKMARK + "." + BookmarkDB.DB_KEY_SCREEN_SETTINGS + - " INNER JOIN " + BookmarkDB.DB_TABLE_PERFORMANCE + - " AS " + JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + " ON " + JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + ID + " = " + - BookmarkDB.DB_TABLE_BOOKMARK + "." + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + - " INNER JOIN " + BookmarkDB.DB_TABLE_SCREEN + - " AS " + JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS_3G + " ON " + JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS_3G + "." + ID + " = " + - BookmarkDB.DB_TABLE_BOOKMARK + "." + BookmarkDB.DB_KEY_SCREEN_SETTINGS_3G + - " INNER JOIN " + BookmarkDB.DB_TABLE_PERFORMANCE + - " AS " + JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + " ON " + JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + ID + " = " + - BookmarkDB.DB_TABLE_BOOKMARK + "." + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G; - - // create columns list - ArrayList columns = new ArrayList<>(); - addBookmarkColumns(columns); - addScreenSettingsColumns(columns); - addPerformanceFlagsColumns(columns); - addScreenSettings3GColumns(columns); - addPerformanceFlags3GColumns(columns); - - String[] cols = new String[columns.size()]; - columns.toArray(cols); - - SQLiteDatabase db = getReadableDatabase(); - final String query = SQLiteQueryBuilder.buildQueryString(false, tables, cols, whereClause, null, null, orderBy, null); - return db.rawQuery(query, null); - } - - private void addBookmarkColumns(ArrayList columns) { - columns.add(getBookmarkTableName() + "." + BookmarkDB.ID + " " + KEY_BOOKMARK_ID); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_LABEL); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_USERNAME); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_PASSWORD); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_DOMAIN); - - // advanced settings - columns.add(BookmarkDB.DB_KEY_BOOKMARK_3G_ENABLE); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_SDCARD); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_SOUND); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_MICROPHONE); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_SECURITY); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_CONSOLE_MODE); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_REMOTE_PROGRAM); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_WORK_DIR); - - // debug settings - columns.add(BookmarkDB.DB_KEY_BOOKMARK_DEBUG_LEVEL); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_CHANNEL); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_UPDATE); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_INPUT); - - addBookmarkSpecificColumns(columns); - } - - private void addScreenSettingsColumns(ArrayList columns) { - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS + "." + BookmarkDB.DB_KEY_SCREEN_COLORS + " as " + KEY_SCREEN_COLORS); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS + "." + BookmarkDB.DB_KEY_SCREEN_RESOLUTION + " as " + KEY_SCREEN_RESOLUTION); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS + "." + BookmarkDB.DB_KEY_SCREEN_WIDTH + " as " + KEY_SCREEN_WIDTH); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS + "." + BookmarkDB.DB_KEY_SCREEN_HEIGHT + " as " + KEY_SCREEN_HEIGHT); - } - - private void addPerformanceFlagsColumns(ArrayList columns) { - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + BookmarkDB.DB_KEY_PERFORMANCE_RFX + " as " + KEY_PERFORMANCE_RFX); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + BookmarkDB.DB_KEY_PERFORMANCE_GFX + " as " + KEY_PERFORMANCE_GFX); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + BookmarkDB.DB_KEY_PERFORMANCE_H264 + " as " + KEY_PERFORMANCE_H264); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + BookmarkDB.DB_KEY_PERFORMANCE_WALLPAPER + " as " + KEY_PERFORMANCE_WALLPAPER); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + BookmarkDB.DB_KEY_PERFORMANCE_THEME + " as " + KEY_PERFORMANCE_THEME); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + BookmarkDB.DB_KEY_PERFORMANCE_DRAG + " as " + KEY_PERFORMANCE_DRAG); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + BookmarkDB.DB_KEY_PERFORMANCE_MENU_ANIMATIONS + " as " + KEY_PERFORMANCE_MENU_ANIMATIONS); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + BookmarkDB.DB_KEY_PERFORMANCE_FONTS + " as " + KEY_PERFORMANCE_FONTS); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + BookmarkDB.DB_KEY_PERFORMANCE_COMPOSITION + " " + KEY_PERFORMANCE_COMPOSITION); - } - - private void addScreenSettings3GColumns(ArrayList columns) { - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS_3G + "." + BookmarkDB.DB_KEY_SCREEN_COLORS + " as " + KEY_SCREEN_COLORS_3G); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS_3G + "." + BookmarkDB.DB_KEY_SCREEN_RESOLUTION + " as " + KEY_SCREEN_RESOLUTION_3G); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS_3G + "." + BookmarkDB.DB_KEY_SCREEN_WIDTH + " as " + KEY_SCREEN_WIDTH_3G); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS_3G + "." + BookmarkDB.DB_KEY_SCREEN_HEIGHT + " as " + KEY_SCREEN_HEIGHT_3G); - } - - private void addPerformanceFlags3GColumns(ArrayList columns) { - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + BookmarkDB.DB_KEY_PERFORMANCE_RFX + " as " + KEY_PERFORMANCE_RFX_3G); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + BookmarkDB.DB_KEY_PERFORMANCE_GFX + " as " + KEY_PERFORMANCE_GFX_3G); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + BookmarkDB.DB_KEY_PERFORMANCE_H264 + " as " + KEY_PERFORMANCE_H264_3G); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + BookmarkDB.DB_KEY_PERFORMANCE_WALLPAPER + " as " + KEY_PERFORMANCE_WALLPAPER_3G); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + BookmarkDB.DB_KEY_PERFORMANCE_THEME + " as " + KEY_PERFORMANCE_THEME_3G); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + BookmarkDB.DB_KEY_PERFORMANCE_DRAG + " as " + KEY_PERFORMANCE_DRAG_3G); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + BookmarkDB.DB_KEY_PERFORMANCE_MENU_ANIMATIONS + " as " + KEY_PERFORMANCE_MENU_ANIMATIONS_3G); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + BookmarkDB.DB_KEY_PERFORMANCE_FONTS + " as " + KEY_PERFORMANCE_FONTS_3G); - columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + BookmarkDB.DB_KEY_PERFORMANCE_COMPOSITION + " " + KEY_PERFORMANCE_COMPOSITION_3G); - } - - protected BookmarkBase getBookmarkFromCursor(Cursor cursor) { - BookmarkBase bookmark = createBookmark(); - bookmark.setId(cursor.getLong(cursor.getColumnIndex(KEY_BOOKMARK_ID))); - bookmark.setLabel(cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_LABEL))); - bookmark.setUsername(cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_USERNAME))); - bookmark.setPassword(cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_PASSWORD))); - bookmark.setDomain(cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_DOMAIN))); - readScreenSettings(bookmark, cursor); - readPerformanceFlags(bookmark, cursor); - - // advanced settings - bookmark.getAdvancedSettings().setEnable3GSettings(cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_3G_ENABLE)) != 0); - readScreenSettings3G(bookmark, cursor); - readPerformanceFlags3G(bookmark, cursor); - bookmark.getAdvancedSettings().setRedirectSDCard(cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_SDCARD)) != 0); - bookmark.getAdvancedSettings().setRedirectSound(cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_SOUND))); - bookmark.getAdvancedSettings().setRedirectMicrophone(cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_MICROPHONE)) != 0); - bookmark.getAdvancedSettings().setSecurity(cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_SECURITY))); - bookmark.getAdvancedSettings().setConsoleMode(cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_CONSOLE_MODE)) != 0); - bookmark.getAdvancedSettings().setRemoteProgram(cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_REMOTE_PROGRAM))); - bookmark.getAdvancedSettings().setWorkDir(cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_WORK_DIR))); - - bookmark.getDebugSettings().setAsyncChannel( - cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_CHANNEL)) == 1); - bookmark.getDebugSettings().setAsyncInput( - cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_INPUT)) == 1); - bookmark.getDebugSettings().setAsyncUpdate( - cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_UPDATE)) == 1); - bookmark.getDebugSettings().setDebugLevel(cursor.getString(cursor.getColumnIndex - (BookmarkDB.DB_KEY_BOOKMARK_DEBUG_LEVEL))); - - readBookmarkSpecificColumns(bookmark, cursor); - - return bookmark; - } - - private void readScreenSettings(BookmarkBase bookmark, Cursor cursor) { - BookmarkBase.ScreenSettings screenSettings = bookmark.getScreenSettings(); - screenSettings.setColors(cursor.getInt(cursor.getColumnIndex(KEY_SCREEN_COLORS))); - screenSettings.setResolution(cursor.getInt(cursor.getColumnIndex(KEY_SCREEN_RESOLUTION))); - screenSettings.setWidth(cursor.getInt(cursor.getColumnIndex(KEY_SCREEN_WIDTH))); - screenSettings.setHeight(cursor.getInt(cursor.getColumnIndex(KEY_SCREEN_HEIGHT))); - } - - private void readPerformanceFlags(BookmarkBase bookmark, Cursor cursor) { - BookmarkBase.PerformanceFlags perfFlags = bookmark.getPerformanceFlags(); - perfFlags.setRemoteFX(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_RFX)) != 0); - perfFlags.setGfx(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_GFX)) != 0); - perfFlags.setH264(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_H264)) != 0); - perfFlags.setWallpaper(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_WALLPAPER)) != 0); - perfFlags.setTheming(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_THEME)) != 0); - perfFlags.setFullWindowDrag(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_DRAG)) != 0); - perfFlags.setMenuAnimations(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_MENU_ANIMATIONS)) != 0); - perfFlags.setFontSmoothing(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_FONTS)) != 0); - perfFlags.setDesktopComposition(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_COMPOSITION)) != 0); - } - - private void readScreenSettings3G(BookmarkBase bookmark, Cursor cursor) { - BookmarkBase.ScreenSettings screenSettings = bookmark.getAdvancedSettings().getScreen3G(); - screenSettings.setColors(cursor.getInt(cursor.getColumnIndex(KEY_SCREEN_COLORS_3G))); - screenSettings.setResolution(cursor.getInt(cursor.getColumnIndex(KEY_SCREEN_RESOLUTION_3G))); - screenSettings.setWidth(cursor.getInt(cursor.getColumnIndex(KEY_SCREEN_WIDTH_3G))); - screenSettings.setHeight(cursor.getInt(cursor.getColumnIndex(KEY_SCREEN_HEIGHT_3G))); - } - - private void readPerformanceFlags3G(BookmarkBase bookmark, Cursor cursor) { - BookmarkBase.PerformanceFlags perfFlags = bookmark.getAdvancedSettings().getPerformance3G(); - perfFlags.setRemoteFX(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_RFX_3G)) != 0); - perfFlags.setGfx(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_GFX_3G)) != 0); - perfFlags.setH264(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_H264_3G)) != 0); - perfFlags.setWallpaper(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_WALLPAPER_3G)) != 0); - perfFlags.setTheming(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_THEME_3G)) != 0); - perfFlags.setFullWindowDrag(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_DRAG_3G)) != 0); - perfFlags.setMenuAnimations(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_MENU_ANIMATIONS_3G)) != 0); - perfFlags.setFontSmoothing(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_FONTS_3G)) != 0); - perfFlags.setDesktopComposition(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_COMPOSITION_3G)) != 0); - } - - private void fillScreenSettingsContentValues(BookmarkBase.ScreenSettings settings, ContentValues values) { - values.put(BookmarkDB.DB_KEY_SCREEN_COLORS, settings.getColors()); - values.put(BookmarkDB.DB_KEY_SCREEN_RESOLUTION, settings.getResolution()); - values.put(BookmarkDB.DB_KEY_SCREEN_WIDTH, settings.getWidth()); - values.put(BookmarkDB.DB_KEY_SCREEN_HEIGHT, settings.getHeight()); - } - - private void fillPerformanceFlagsContentValues(BookmarkBase.PerformanceFlags perfFlags, ContentValues values) { - values.put(BookmarkDB.DB_KEY_PERFORMANCE_RFX, perfFlags.getRemoteFX()); - values.put(BookmarkDB.DB_KEY_PERFORMANCE_GFX, perfFlags.getGfx()); - values.put(BookmarkDB.DB_KEY_PERFORMANCE_H264, perfFlags.getH264()); - values.put(BookmarkDB.DB_KEY_PERFORMANCE_WALLPAPER, perfFlags.getWallpaper()); - values.put(BookmarkDB.DB_KEY_PERFORMANCE_THEME, perfFlags.getTheming()); - values.put(BookmarkDB.DB_KEY_PERFORMANCE_DRAG, perfFlags.getFullWindowDrag()); - values.put(BookmarkDB.DB_KEY_PERFORMANCE_MENU_ANIMATIONS, perfFlags.getMenuAnimations()); - values.put(BookmarkDB.DB_KEY_PERFORMANCE_FONTS, perfFlags.getFontSmoothing()); - values.put(BookmarkDB.DB_KEY_PERFORMANCE_COMPOSITION, perfFlags.getDesktopComposition()); - } - - private long insertScreenSettings(SQLiteDatabase db, BookmarkBase.ScreenSettings settings) { - ContentValues values = new ContentValues(); - fillScreenSettingsContentValues(settings, values); - return db.insertOrThrow(BookmarkDB.DB_TABLE_SCREEN, null, values); - } - - private boolean updateScreenSettings(SQLiteDatabase db, BookmarkBase bookmark) { - ContentValues values = new ContentValues(); - fillScreenSettingsContentValues(bookmark.getScreenSettings(), values); - String whereClause = BookmarkDB.ID + " IN " + "(SELECT " + BookmarkDB.DB_KEY_SCREEN_SETTINGS + " FROM " + getBookmarkTableName() + " WHERE " + BookmarkDB.ID + " = " + bookmark.getId() + ");"; - return (db.update(BookmarkDB.DB_TABLE_SCREEN, values, whereClause, null) == 1); - } - - private boolean updateScreenSettings3G(SQLiteDatabase db, BookmarkBase bookmark) { - ContentValues values = new ContentValues(); - fillScreenSettingsContentValues(bookmark.getAdvancedSettings().getScreen3G(), values); - String whereClause = BookmarkDB.ID + " IN " + "(SELECT " + BookmarkDB.DB_KEY_SCREEN_SETTINGS_3G + " FROM " + getBookmarkTableName() + " WHERE " + BookmarkDB.ID + " = " + bookmark.getId() + ");"; - return (db.update(BookmarkDB.DB_TABLE_SCREEN, values, whereClause, null) == 1); - } - - private long insertPerformanceFlags(SQLiteDatabase db, BookmarkBase.PerformanceFlags perfFlags) { - ContentValues values = new ContentValues(); - fillPerformanceFlagsContentValues(perfFlags, values); - return db.insertOrThrow(BookmarkDB.DB_TABLE_PERFORMANCE, null, values); - } - - private boolean updatePerformanceFlags(SQLiteDatabase db, BookmarkBase bookmark) { - ContentValues values = new ContentValues(); - fillPerformanceFlagsContentValues(bookmark.getPerformanceFlags(), values); - String whereClause = BookmarkDB.ID + " IN " + "(SELECT " + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + " FROM " + getBookmarkTableName() + " WHERE " + BookmarkDB.ID + " = " + bookmark.getId() + ");"; - return (db.update(BookmarkDB.DB_TABLE_PERFORMANCE, values, whereClause, null) == 1); - } - - private boolean updatePerformanceFlags3G(SQLiteDatabase db, BookmarkBase bookmark) { - ContentValues values = new ContentValues(); - fillPerformanceFlagsContentValues(bookmark.getAdvancedSettings().getPerformance3G(), values); - String whereClause = BookmarkDB.ID + " IN " + "(SELECT " + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + " FROM " + getBookmarkTableName() + " WHERE " + BookmarkDB.ID + " = " + bookmark.getId() + ");"; - return (db.update(BookmarkDB.DB_TABLE_PERFORMANCE, values, whereClause, null) == 1); - } - - // safety wrappers - // in case of getReadableDatabase it could happen that upgradeDB gets called which is - // a problem if the DB is only readable - private SQLiteDatabase getWritableDatabase() { - return bookmarkDB.getWritableDatabase(); - } - - private SQLiteDatabase getReadableDatabase() { - SQLiteDatabase db; - try { - db = bookmarkDB.getReadableDatabase(); - } catch (SQLiteException e) { - db = bookmarkDB.getWritableDatabase(); - } - return db; - } +public abstract class BookmarkBaseGateway +{ + private final static String TAG = "BookmarkBaseGateway"; + private SQLiteOpenHelper bookmarkDB; + + private static final String JOIN_PREFIX = "join_"; + private static final String KEY_BOOKMARK_ID = "bookmarkId"; + private static final String KEY_SCREEN_COLORS = "screenColors"; + private static final String KEY_SCREEN_COLORS_3G = "screenColors3G"; + private static final String KEY_SCREEN_RESOLUTION = "screenResolution"; + private static final String KEY_SCREEN_RESOLUTION_3G = "screenResolution3G"; + private static final String KEY_SCREEN_WIDTH = "screenWidth"; + private static final String KEY_SCREEN_WIDTH_3G = "screenWidth3G"; + private static final String KEY_SCREEN_HEIGHT = "screenHeight"; + private static final String KEY_SCREEN_HEIGHT_3G = "screenHeight3G"; + + private static final String KEY_PERFORMANCE_RFX = "performanceRemoteFX"; + private static final String KEY_PERFORMANCE_RFX_3G = "performanceRemoteFX3G"; + private static final String KEY_PERFORMANCE_GFX = "performanceGfx"; + private static final String KEY_PERFORMANCE_GFX_3G = "performanceGfx3G"; + private static final String KEY_PERFORMANCE_H264 = "performanceGfxH264"; + private static final String KEY_PERFORMANCE_H264_3G = "performanceGfxH2643G"; + private static final String KEY_PERFORMANCE_WALLPAPER = "performanceWallpaper"; + private static final String KEY_PERFORMANCE_WALLPAPER_3G = "performanceWallpaper3G"; + private static final String KEY_PERFORMANCE_THEME = "performanceTheming"; + private static final String KEY_PERFORMANCE_THEME_3G = "performanceTheming3G"; + + private static final String KEY_PERFORMANCE_DRAG = "performanceFullWindowDrag"; + private static final String KEY_PERFORMANCE_DRAG_3G = "performanceFullWindowDrag3G"; + private static final String KEY_PERFORMANCE_MENU_ANIMATIONS = "performanceMenuAnimations"; + private static final String KEY_PERFORMANCE_MENU_ANIMATIONS_3G = "performanceMenuAnimations3G"; + private static final String KEY_PERFORMANCE_FONTS = "performanceFontSmoothing"; + private static final String KEY_PERFORMANCE_FONTS_3G = "performanceFontSmoothing3G"; + private static final String KEY_PERFORMANCE_COMPOSITION = "performanceDesktopComposition"; + private static final String KEY_PERFORMANCE_COMPOSITION_3G = "performanceDesktopComposition3G"; + + public BookmarkBaseGateway(SQLiteOpenHelper bookmarkDB) + { + this.bookmarkDB = bookmarkDB; + } + + protected abstract BookmarkBase createBookmark(); + + protected abstract String getBookmarkTableName(); + + protected abstract void addBookmarkSpecificColumns(ArrayList columns); + + protected abstract void addBookmarkSpecificColumns(BookmarkBase bookmark, + ContentValues columns); + + protected abstract void readBookmarkSpecificColumns(BookmarkBase bookmark, Cursor cursor); + + public void insert(BookmarkBase bookmark) + { + // begin transaction + SQLiteDatabase db = getWritableDatabase(); + db.beginTransaction(); + + long rowid; + ContentValues values = new ContentValues(); + values.put(BookmarkDB.DB_KEY_BOOKMARK_LABEL, bookmark.getLabel()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_USERNAME, bookmark.getUsername()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_PASSWORD, bookmark.getPassword()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_DOMAIN, bookmark.getDomain()); + // insert screen and performance settings + rowid = insertScreenSettings(db, bookmark.getScreenSettings()); + values.put(BookmarkDB.DB_KEY_SCREEN_SETTINGS, rowid); + rowid = insertPerformanceFlags(db, bookmark.getPerformanceFlags()); + values.put(BookmarkDB.DB_KEY_PERFORMANCE_FLAGS, rowid); + + // advanced settings + values.put(BookmarkDB.DB_KEY_BOOKMARK_3G_ENABLE, + bookmark.getAdvancedSettings().getEnable3GSettings()); + // insert 3G screen and 3G performance settings + rowid = insertScreenSettings(db, bookmark.getAdvancedSettings().getScreen3G()); + values.put(BookmarkDB.DB_KEY_SCREEN_SETTINGS_3G, rowid); + rowid = insertPerformanceFlags(db, bookmark.getAdvancedSettings().getPerformance3G()); + values.put(BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G, rowid); + values.put(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_SDCARD, + bookmark.getAdvancedSettings().getRedirectSDCard()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_SOUND, + bookmark.getAdvancedSettings().getRedirectSound()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_MICROPHONE, + bookmark.getAdvancedSettings().getRedirectMicrophone()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_SECURITY, + bookmark.getAdvancedSettings().getSecurity()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_CONSOLE_MODE, + bookmark.getAdvancedSettings().getConsoleMode()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_REMOTE_PROGRAM, + bookmark.getAdvancedSettings().getRemoteProgram()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_WORK_DIR, + bookmark.getAdvancedSettings().getWorkDir()); + + values.put(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_CHANNEL, + bookmark.getDebugSettings().getAsyncChannel()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_INPUT, + bookmark.getDebugSettings().getAsyncInput()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_UPDATE, + bookmark.getDebugSettings().getAsyncUpdate()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_DEBUG_LEVEL, + bookmark.getDebugSettings().getDebugLevel()); + + // add any special columns + addBookmarkSpecificColumns(bookmark, values); + + // insert bookmark and end transaction + db.insertOrThrow(getBookmarkTableName(), null, values); + db.setTransactionSuccessful(); + db.endTransaction(); + } + + public boolean update(BookmarkBase bookmark) + { + // start a transaction + SQLiteDatabase db = getWritableDatabase(); + db.beginTransaction(); + + // bookmark settings + ContentValues values = new ContentValues(); + values.put(BookmarkDB.DB_KEY_BOOKMARK_LABEL, bookmark.getLabel()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_USERNAME, bookmark.getUsername()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_PASSWORD, bookmark.getPassword()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_DOMAIN, bookmark.getDomain()); + // update screen and performance settings settings + updateScreenSettings(db, bookmark); + updatePerformanceFlags(db, bookmark); + + // advanced settings + values.put(BookmarkDB.DB_KEY_BOOKMARK_3G_ENABLE, + bookmark.getAdvancedSettings().getEnable3GSettings()); + // update 3G screen and 3G performance settings settings + updateScreenSettings3G(db, bookmark); + updatePerformanceFlags3G(db, bookmark); + values.put(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_SDCARD, + bookmark.getAdvancedSettings().getRedirectSDCard()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_SOUND, + bookmark.getAdvancedSettings().getRedirectSound()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_MICROPHONE, + bookmark.getAdvancedSettings().getRedirectMicrophone()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_SECURITY, + bookmark.getAdvancedSettings().getSecurity()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_CONSOLE_MODE, + bookmark.getAdvancedSettings().getConsoleMode()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_REMOTE_PROGRAM, + bookmark.getAdvancedSettings().getRemoteProgram()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_WORK_DIR, + bookmark.getAdvancedSettings().getWorkDir()); + + values.put(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_CHANNEL, + bookmark.getDebugSettings().getAsyncChannel()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_INPUT, + bookmark.getDebugSettings().getAsyncInput()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_UPDATE, + bookmark.getDebugSettings().getAsyncUpdate()); + values.put(BookmarkDB.DB_KEY_BOOKMARK_DEBUG_LEVEL, + bookmark.getDebugSettings().getDebugLevel()); + + addBookmarkSpecificColumns(bookmark, values); + + // update bookmark + boolean res = (db.update(getBookmarkTableName(), values, + BookmarkDB.ID + " = " + bookmark.getId(), null) == 1); + + // commit + db.setTransactionSuccessful(); + db.endTransaction(); + + return res; + } + + public void delete(long id) + { + SQLiteDatabase db = getWritableDatabase(); + db.delete(getBookmarkTableName(), BookmarkDB.ID + " = " + id, null); + } + + public BookmarkBase findById(long id) + { + Cursor cursor = + queryBookmarks(getBookmarkTableName() + "." + BookmarkDB.ID + " = " + id, null); + if (cursor.getCount() == 0) + { + cursor.close(); + return null; + } + + cursor.moveToFirst(); + BookmarkBase bookmark = getBookmarkFromCursor(cursor); + cursor.close(); + return bookmark; + } + + public BookmarkBase findByLabel(String label) + { + Cursor cursor = queryBookmarks(BookmarkDB.DB_KEY_BOOKMARK_LABEL + " = '" + label + "'", + BookmarkDB.DB_KEY_BOOKMARK_LABEL); + if (cursor.getCount() > 1) + Log.e(TAG, "More than one bookmark with the same label found!"); + + BookmarkBase bookmark = null; + if (cursor.moveToFirst() && (cursor.getCount() > 0)) + bookmark = getBookmarkFromCursor(cursor); + + cursor.close(); + return bookmark; + } + + public ArrayList findByLabelLike(String pattern) + { + Cursor cursor = + queryBookmarks(BookmarkDB.DB_KEY_BOOKMARK_LABEL + " LIKE '%" + pattern + "%'", + BookmarkDB.DB_KEY_BOOKMARK_LABEL); + ArrayList bookmarks = new ArrayList(cursor.getCount()); + + if (cursor.moveToFirst() && (cursor.getCount() > 0)) + { + do + { + bookmarks.add(getBookmarkFromCursor(cursor)); + } while (cursor.moveToNext()); + } + + cursor.close(); + return bookmarks; + } + + public ArrayList findAll() + { + Cursor cursor = queryBookmarks(null, BookmarkDB.DB_KEY_BOOKMARK_LABEL); + final int count = cursor.getCount(); + ArrayList bookmarks = new ArrayList<>(count); + + if (cursor.moveToFirst() && (count > 0)) + { + do + { + bookmarks.add(getBookmarkFromCursor(cursor)); + } while (cursor.moveToNext()); + } + + cursor.close(); + return bookmarks; + } + + protected Cursor queryBookmarks(String whereClause, String orderBy) + { + // create tables string + final String ID = BookmarkDB.ID; + final String tables = + BookmarkDB.DB_TABLE_BOOKMARK + " INNER JOIN " + BookmarkDB.DB_TABLE_SCREEN + " AS " + + JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS + " ON " + JOIN_PREFIX + + BookmarkDB.DB_KEY_SCREEN_SETTINGS + "." + ID + " = " + BookmarkDB.DB_TABLE_BOOKMARK + + "." + BookmarkDB.DB_KEY_SCREEN_SETTINGS + " INNER JOIN " + + BookmarkDB.DB_TABLE_PERFORMANCE + " AS " + JOIN_PREFIX + + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + " ON " + JOIN_PREFIX + + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + ID + " = " + BookmarkDB.DB_TABLE_BOOKMARK + + "." + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + " INNER JOIN " + + BookmarkDB.DB_TABLE_SCREEN + " AS " + JOIN_PREFIX + + BookmarkDB.DB_KEY_SCREEN_SETTINGS_3G + " ON " + JOIN_PREFIX + + BookmarkDB.DB_KEY_SCREEN_SETTINGS_3G + "." + ID + " = " + BookmarkDB.DB_TABLE_BOOKMARK + + "." + BookmarkDB.DB_KEY_SCREEN_SETTINGS_3G + " INNER JOIN " + + BookmarkDB.DB_TABLE_PERFORMANCE + " AS " + JOIN_PREFIX + + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + " ON " + JOIN_PREFIX + + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + ID + " = " + + BookmarkDB.DB_TABLE_BOOKMARK + "." + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G; + + // create columns list + ArrayList columns = new ArrayList<>(); + addBookmarkColumns(columns); + addScreenSettingsColumns(columns); + addPerformanceFlagsColumns(columns); + addScreenSettings3GColumns(columns); + addPerformanceFlags3GColumns(columns); + + String[] cols = new String[columns.size()]; + columns.toArray(cols); + + SQLiteDatabase db = getReadableDatabase(); + final String query = SQLiteQueryBuilder.buildQueryString(false, tables, cols, whereClause, + null, null, orderBy, null); + return db.rawQuery(query, null); + } + + private void addBookmarkColumns(ArrayList columns) + { + columns.add(getBookmarkTableName() + "." + BookmarkDB.ID + " " + KEY_BOOKMARK_ID); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_LABEL); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_USERNAME); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_PASSWORD); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_DOMAIN); + + // advanced settings + columns.add(BookmarkDB.DB_KEY_BOOKMARK_3G_ENABLE); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_SDCARD); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_SOUND); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_MICROPHONE); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_SECURITY); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_CONSOLE_MODE); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_REMOTE_PROGRAM); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_WORK_DIR); + + // debug settings + columns.add(BookmarkDB.DB_KEY_BOOKMARK_DEBUG_LEVEL); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_CHANNEL); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_UPDATE); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_INPUT); + + addBookmarkSpecificColumns(columns); + } + + private void addScreenSettingsColumns(ArrayList columns) + { + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS + "." + + BookmarkDB.DB_KEY_SCREEN_COLORS + " as " + KEY_SCREEN_COLORS); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS + "." + + BookmarkDB.DB_KEY_SCREEN_RESOLUTION + " as " + KEY_SCREEN_RESOLUTION); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS + "." + + BookmarkDB.DB_KEY_SCREEN_WIDTH + " as " + KEY_SCREEN_WIDTH); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS + "." + + BookmarkDB.DB_KEY_SCREEN_HEIGHT + " as " + KEY_SCREEN_HEIGHT); + } + + private void addPerformanceFlagsColumns(ArrayList columns) + { + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + + BookmarkDB.DB_KEY_PERFORMANCE_RFX + " as " + KEY_PERFORMANCE_RFX); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + + BookmarkDB.DB_KEY_PERFORMANCE_GFX + " as " + KEY_PERFORMANCE_GFX); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + + BookmarkDB.DB_KEY_PERFORMANCE_H264 + " as " + KEY_PERFORMANCE_H264); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + + BookmarkDB.DB_KEY_PERFORMANCE_WALLPAPER + " as " + KEY_PERFORMANCE_WALLPAPER); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + + BookmarkDB.DB_KEY_PERFORMANCE_THEME + " as " + KEY_PERFORMANCE_THEME); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + + BookmarkDB.DB_KEY_PERFORMANCE_DRAG + " as " + KEY_PERFORMANCE_DRAG); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + + BookmarkDB.DB_KEY_PERFORMANCE_MENU_ANIMATIONS + " as " + + KEY_PERFORMANCE_MENU_ANIMATIONS); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + + BookmarkDB.DB_KEY_PERFORMANCE_FONTS + " as " + KEY_PERFORMANCE_FONTS); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + "." + + BookmarkDB.DB_KEY_PERFORMANCE_COMPOSITION + " " + KEY_PERFORMANCE_COMPOSITION); + } + + private void addScreenSettings3GColumns(ArrayList columns) + { + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS_3G + "." + + BookmarkDB.DB_KEY_SCREEN_COLORS + " as " + KEY_SCREEN_COLORS_3G); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS_3G + "." + + BookmarkDB.DB_KEY_SCREEN_RESOLUTION + " as " + KEY_SCREEN_RESOLUTION_3G); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS_3G + "." + + BookmarkDB.DB_KEY_SCREEN_WIDTH + " as " + KEY_SCREEN_WIDTH_3G); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_SCREEN_SETTINGS_3G + "." + + BookmarkDB.DB_KEY_SCREEN_HEIGHT + " as " + KEY_SCREEN_HEIGHT_3G); + } + + private void addPerformanceFlags3GColumns(ArrayList columns) + { + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + + BookmarkDB.DB_KEY_PERFORMANCE_RFX + " as " + KEY_PERFORMANCE_RFX_3G); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + + BookmarkDB.DB_KEY_PERFORMANCE_GFX + " as " + KEY_PERFORMANCE_GFX_3G); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + + BookmarkDB.DB_KEY_PERFORMANCE_H264 + " as " + KEY_PERFORMANCE_H264_3G); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + + BookmarkDB.DB_KEY_PERFORMANCE_WALLPAPER + " as " + + KEY_PERFORMANCE_WALLPAPER_3G); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + + BookmarkDB.DB_KEY_PERFORMANCE_THEME + " as " + KEY_PERFORMANCE_THEME_3G); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + + BookmarkDB.DB_KEY_PERFORMANCE_DRAG + " as " + KEY_PERFORMANCE_DRAG_3G); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + + BookmarkDB.DB_KEY_PERFORMANCE_MENU_ANIMATIONS + " as " + + KEY_PERFORMANCE_MENU_ANIMATIONS_3G); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + + BookmarkDB.DB_KEY_PERFORMANCE_FONTS + " as " + KEY_PERFORMANCE_FONTS_3G); + columns.add(JOIN_PREFIX + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + "." + + BookmarkDB.DB_KEY_PERFORMANCE_COMPOSITION + " " + + KEY_PERFORMANCE_COMPOSITION_3G); + } + + protected BookmarkBase getBookmarkFromCursor(Cursor cursor) + { + BookmarkBase bookmark = createBookmark(); + bookmark.setId(cursor.getLong(cursor.getColumnIndex(KEY_BOOKMARK_ID))); + bookmark.setLabel( + cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_LABEL))); + bookmark.setUsername( + cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_USERNAME))); + bookmark.setPassword( + cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_PASSWORD))); + bookmark.setDomain( + cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_DOMAIN))); + readScreenSettings(bookmark, cursor); + readPerformanceFlags(bookmark, cursor); + + // advanced settings + bookmark.getAdvancedSettings().setEnable3GSettings( + cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_3G_ENABLE)) != 0); + readScreenSettings3G(bookmark, cursor); + readPerformanceFlags3G(bookmark, cursor); + bookmark.getAdvancedSettings().setRedirectSDCard( + cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_SDCARD)) != 0); + bookmark.getAdvancedSettings().setRedirectSound( + cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_SOUND))); + bookmark.getAdvancedSettings().setRedirectMicrophone( + cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_REDIRECT_MICROPHONE)) != + 0); + bookmark.getAdvancedSettings().setSecurity( + cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_SECURITY))); + bookmark.getAdvancedSettings().setConsoleMode( + cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_CONSOLE_MODE)) != 0); + bookmark.getAdvancedSettings().setRemoteProgram( + cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_REMOTE_PROGRAM))); + bookmark.getAdvancedSettings().setWorkDir( + cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_WORK_DIR))); + + bookmark.getDebugSettings().setAsyncChannel( + cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_CHANNEL)) == 1); + bookmark.getDebugSettings().setAsyncInput( + cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_INPUT)) == 1); + bookmark.getDebugSettings().setAsyncUpdate( + cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_UPDATE)) == 1); + bookmark.getDebugSettings().setDebugLevel( + cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_DEBUG_LEVEL))); + + readBookmarkSpecificColumns(bookmark, cursor); + + return bookmark; + } + + private void readScreenSettings(BookmarkBase bookmark, Cursor cursor) + { + BookmarkBase.ScreenSettings screenSettings = bookmark.getScreenSettings(); + screenSettings.setColors(cursor.getInt(cursor.getColumnIndex(KEY_SCREEN_COLORS))); + screenSettings.setResolution(cursor.getInt(cursor.getColumnIndex(KEY_SCREEN_RESOLUTION))); + screenSettings.setWidth(cursor.getInt(cursor.getColumnIndex(KEY_SCREEN_WIDTH))); + screenSettings.setHeight(cursor.getInt(cursor.getColumnIndex(KEY_SCREEN_HEIGHT))); + } + + private void readPerformanceFlags(BookmarkBase bookmark, Cursor cursor) + { + BookmarkBase.PerformanceFlags perfFlags = bookmark.getPerformanceFlags(); + perfFlags.setRemoteFX(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_RFX)) != 0); + perfFlags.setGfx(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_GFX)) != 0); + perfFlags.setH264(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_H264)) != 0); + perfFlags.setWallpaper(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_WALLPAPER)) != + 0); + perfFlags.setTheming(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_THEME)) != 0); + perfFlags.setFullWindowDrag(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_DRAG)) != + 0); + perfFlags.setMenuAnimations( + cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_MENU_ANIMATIONS)) != 0); + perfFlags.setFontSmoothing(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_FONTS)) != + 0); + perfFlags.setDesktopComposition( + cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_COMPOSITION)) != 0); + } + + private void readScreenSettings3G(BookmarkBase bookmark, Cursor cursor) + { + BookmarkBase.ScreenSettings screenSettings = bookmark.getAdvancedSettings().getScreen3G(); + screenSettings.setColors(cursor.getInt(cursor.getColumnIndex(KEY_SCREEN_COLORS_3G))); + screenSettings.setResolution( + cursor.getInt(cursor.getColumnIndex(KEY_SCREEN_RESOLUTION_3G))); + screenSettings.setWidth(cursor.getInt(cursor.getColumnIndex(KEY_SCREEN_WIDTH_3G))); + screenSettings.setHeight(cursor.getInt(cursor.getColumnIndex(KEY_SCREEN_HEIGHT_3G))); + } + + private void readPerformanceFlags3G(BookmarkBase bookmark, Cursor cursor) + { + BookmarkBase.PerformanceFlags perfFlags = bookmark.getAdvancedSettings().getPerformance3G(); + perfFlags.setRemoteFX(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_RFX_3G)) != 0); + perfFlags.setGfx(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_GFX_3G)) != 0); + perfFlags.setH264(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_H264_3G)) != 0); + perfFlags.setWallpaper(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_WALLPAPER_3G)) != + 0); + perfFlags.setTheming(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_THEME_3G)) != 0); + perfFlags.setFullWindowDrag(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_DRAG_3G)) != + 0); + perfFlags.setMenuAnimations( + cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_MENU_ANIMATIONS_3G)) != 0); + perfFlags.setFontSmoothing(cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_FONTS_3G)) != + 0); + perfFlags.setDesktopComposition( + cursor.getInt(cursor.getColumnIndex(KEY_PERFORMANCE_COMPOSITION_3G)) != 0); + } + + private void fillScreenSettingsContentValues(BookmarkBase.ScreenSettings settings, + ContentValues values) + { + values.put(BookmarkDB.DB_KEY_SCREEN_COLORS, settings.getColors()); + values.put(BookmarkDB.DB_KEY_SCREEN_RESOLUTION, settings.getResolution()); + values.put(BookmarkDB.DB_KEY_SCREEN_WIDTH, settings.getWidth()); + values.put(BookmarkDB.DB_KEY_SCREEN_HEIGHT, settings.getHeight()); + } + + private void fillPerformanceFlagsContentValues(BookmarkBase.PerformanceFlags perfFlags, + ContentValues values) + { + values.put(BookmarkDB.DB_KEY_PERFORMANCE_RFX, perfFlags.getRemoteFX()); + values.put(BookmarkDB.DB_KEY_PERFORMANCE_GFX, perfFlags.getGfx()); + values.put(BookmarkDB.DB_KEY_PERFORMANCE_H264, perfFlags.getH264()); + values.put(BookmarkDB.DB_KEY_PERFORMANCE_WALLPAPER, perfFlags.getWallpaper()); + values.put(BookmarkDB.DB_KEY_PERFORMANCE_THEME, perfFlags.getTheming()); + values.put(BookmarkDB.DB_KEY_PERFORMANCE_DRAG, perfFlags.getFullWindowDrag()); + values.put(BookmarkDB.DB_KEY_PERFORMANCE_MENU_ANIMATIONS, perfFlags.getMenuAnimations()); + values.put(BookmarkDB.DB_KEY_PERFORMANCE_FONTS, perfFlags.getFontSmoothing()); + values.put(BookmarkDB.DB_KEY_PERFORMANCE_COMPOSITION, perfFlags.getDesktopComposition()); + } + + private long insertScreenSettings(SQLiteDatabase db, BookmarkBase.ScreenSettings settings) + { + ContentValues values = new ContentValues(); + fillScreenSettingsContentValues(settings, values); + return db.insertOrThrow(BookmarkDB.DB_TABLE_SCREEN, null, values); + } + + private boolean updateScreenSettings(SQLiteDatabase db, BookmarkBase bookmark) + { + ContentValues values = new ContentValues(); + fillScreenSettingsContentValues(bookmark.getScreenSettings(), values); + String whereClause = BookmarkDB.ID + " IN " + + "(SELECT " + BookmarkDB.DB_KEY_SCREEN_SETTINGS + " FROM " + + getBookmarkTableName() + " WHERE " + BookmarkDB.ID + " = " + + bookmark.getId() + ");"; + return (db.update(BookmarkDB.DB_TABLE_SCREEN, values, whereClause, null) == 1); + } + + private boolean updateScreenSettings3G(SQLiteDatabase db, BookmarkBase bookmark) + { + ContentValues values = new ContentValues(); + fillScreenSettingsContentValues(bookmark.getAdvancedSettings().getScreen3G(), values); + String whereClause = BookmarkDB.ID + " IN " + + "(SELECT " + BookmarkDB.DB_KEY_SCREEN_SETTINGS_3G + " FROM " + + getBookmarkTableName() + " WHERE " + BookmarkDB.ID + " = " + + bookmark.getId() + ");"; + return (db.update(BookmarkDB.DB_TABLE_SCREEN, values, whereClause, null) == 1); + } + + private long insertPerformanceFlags(SQLiteDatabase db, BookmarkBase.PerformanceFlags perfFlags) + { + ContentValues values = new ContentValues(); + fillPerformanceFlagsContentValues(perfFlags, values); + return db.insertOrThrow(BookmarkDB.DB_TABLE_PERFORMANCE, null, values); + } + + private boolean updatePerformanceFlags(SQLiteDatabase db, BookmarkBase bookmark) + { + ContentValues values = new ContentValues(); + fillPerformanceFlagsContentValues(bookmark.getPerformanceFlags(), values); + String whereClause = BookmarkDB.ID + " IN " + + "(SELECT " + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS + " FROM " + + getBookmarkTableName() + " WHERE " + BookmarkDB.ID + " = " + + bookmark.getId() + ");"; + return (db.update(BookmarkDB.DB_TABLE_PERFORMANCE, values, whereClause, null) == 1); + } + + private boolean updatePerformanceFlags3G(SQLiteDatabase db, BookmarkBase bookmark) + { + ContentValues values = new ContentValues(); + fillPerformanceFlagsContentValues(bookmark.getAdvancedSettings().getPerformance3G(), + values); + String whereClause = BookmarkDB.ID + " IN " + + "(SELECT " + BookmarkDB.DB_KEY_PERFORMANCE_FLAGS_3G + " FROM " + + getBookmarkTableName() + " WHERE " + BookmarkDB.ID + " = " + + bookmark.getId() + ");"; + return (db.update(BookmarkDB.DB_TABLE_PERFORMANCE, values, whereClause, null) == 1); + } + + // safety wrappers + // in case of getReadableDatabase it could happen that upgradeDB gets called which is + // a problem if the DB is only readable + private SQLiteDatabase getWritableDatabase() + { + return bookmarkDB.getWritableDatabase(); + } + + private SQLiteDatabase getReadableDatabase() + { + SQLiteDatabase db; + try + { + db = bookmarkDB.getReadableDatabase(); + } + catch (SQLiteException e) + { + db = bookmarkDB.getWritableDatabase(); + } + return db; + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/BookmarkDB.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/BookmarkDB.java index e2537d5a2..420e540ae 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/BookmarkDB.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/BookmarkDB.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.services; @@ -21,371 +22,401 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -public class BookmarkDB extends SQLiteOpenHelper { - public static final String ID = BaseColumns._ID; - private static final int DB_VERSION = 9; - private static final String DB_BACKUP_PREFIX = "temp_"; - private static final String DB_NAME = "bookmarks.db"; - static final String DB_TABLE_BOOKMARK = "tbl_manual_bookmarks"; - static final String DB_TABLE_SCREEN = "tbl_screen_settings"; - static final String DB_TABLE_PERFORMANCE = "tbl_performance_flags"; - private static final String[] DB_TABLES = { - DB_TABLE_BOOKMARK, - DB_TABLE_SCREEN, - DB_TABLE_PERFORMANCE - }; +public class BookmarkDB extends SQLiteOpenHelper +{ + public static final String ID = BaseColumns._ID; + private static final int DB_VERSION = 9; + private static final String DB_BACKUP_PREFIX = "temp_"; + private static final String DB_NAME = "bookmarks.db"; + static final String DB_TABLE_BOOKMARK = "tbl_manual_bookmarks"; + static final String DB_TABLE_SCREEN = "tbl_screen_settings"; + static final String DB_TABLE_PERFORMANCE = "tbl_performance_flags"; + private static final String[] DB_TABLES = { DB_TABLE_BOOKMARK, DB_TABLE_SCREEN, + DB_TABLE_PERFORMANCE }; - static final String DB_KEY_SCREEN_COLORS = "colors"; - static final String DB_KEY_SCREEN_RESOLUTION = "resolution"; - static final String DB_KEY_SCREEN_WIDTH = "width"; - static final String DB_KEY_SCREEN_HEIGHT = "height"; + static final String DB_KEY_SCREEN_COLORS = "colors"; + static final String DB_KEY_SCREEN_RESOLUTION = "resolution"; + static final String DB_KEY_SCREEN_WIDTH = "width"; + static final String DB_KEY_SCREEN_HEIGHT = "height"; - static final String DB_KEY_SCREEN_SETTINGS = "screen_settings"; - static final String DB_KEY_SCREEN_SETTINGS_3G = "screen_3g"; - static final String DB_KEY_PERFORMANCE_FLAGS = "performance_flags"; - static final String DB_KEY_PERFORMANCE_FLAGS_3G = "performance_3g"; + static final String DB_KEY_SCREEN_SETTINGS = "screen_settings"; + static final String DB_KEY_SCREEN_SETTINGS_3G = "screen_3g"; + static final String DB_KEY_PERFORMANCE_FLAGS = "performance_flags"; + static final String DB_KEY_PERFORMANCE_FLAGS_3G = "performance_3g"; - static final String DB_KEY_PERFORMANCE_RFX = "perf_remotefx"; - static final String DB_KEY_PERFORMANCE_GFX = "perf_gfx"; - static final String DB_KEY_PERFORMANCE_H264 = "perf_gfx_h264"; - static final String DB_KEY_PERFORMANCE_WALLPAPER = "perf_wallpaper"; - static final String DB_KEY_PERFORMANCE_THEME = "perf_theming"; - static final String DB_KEY_PERFORMANCE_DRAG = "perf_full_window_drag"; - static final String DB_KEY_PERFORMANCE_MENU_ANIMATIONS = "perf_menu_animations"; - static final String DB_KEY_PERFORMANCE_FONTS = "perf_font_smoothing"; - static final String DB_KEY_PERFORMANCE_COMPOSITION = "perf_desktop_composition"; + static final String DB_KEY_PERFORMANCE_RFX = "perf_remotefx"; + static final String DB_KEY_PERFORMANCE_GFX = "perf_gfx"; + static final String DB_KEY_PERFORMANCE_H264 = "perf_gfx_h264"; + static final String DB_KEY_PERFORMANCE_WALLPAPER = "perf_wallpaper"; + static final String DB_KEY_PERFORMANCE_THEME = "perf_theming"; + static final String DB_KEY_PERFORMANCE_DRAG = "perf_full_window_drag"; + static final String DB_KEY_PERFORMANCE_MENU_ANIMATIONS = "perf_menu_animations"; + static final String DB_KEY_PERFORMANCE_FONTS = "perf_font_smoothing"; + static final String DB_KEY_PERFORMANCE_COMPOSITION = "perf_desktop_composition"; - static final String DB_KEY_BOOKMARK_LABEL = "label"; - static final String DB_KEY_BOOKMARK_HOSTNAME = "hostname"; - static final String DB_KEY_BOOKMARK_USERNAME = "username"; - static final String DB_KEY_BOOKMARK_PASSWORD = "password"; - static final String DB_KEY_BOOKMARK_DOMAIN = "domain"; - static final String DB_KEY_BOOKMARK_PORT = "port"; + static final String DB_KEY_BOOKMARK_LABEL = "label"; + static final String DB_KEY_BOOKMARK_HOSTNAME = "hostname"; + static final String DB_KEY_BOOKMARK_USERNAME = "username"; + static final String DB_KEY_BOOKMARK_PASSWORD = "password"; + static final String DB_KEY_BOOKMARK_DOMAIN = "domain"; + static final String DB_KEY_BOOKMARK_PORT = "port"; - static final String DB_KEY_BOOKMARK_REDIRECT_SDCARD = "redirect_sdcard"; - static final String DB_KEY_BOOKMARK_REDIRECT_SOUND = "redirect_sound"; - static final String DB_KEY_BOOKMARK_REDIRECT_MICROPHONE = "redirect_microphone"; - static final String DB_KEY_BOOKMARK_SECURITY = "security"; - static final String DB_KEY_BOOKMARK_REMOTE_PROGRAM = "remote_program"; - static final String DB_KEY_BOOKMARK_WORK_DIR = "work_dir"; - static final String DB_KEY_BOOKMARK_ASYNC_CHANNEL = "async_channel"; - static final String DB_KEY_BOOKMARK_ASYNC_INPUT = "async_input"; - static final String DB_KEY_BOOKMARK_ASYNC_UPDATE = "async_update"; - static final String DB_KEY_BOOKMARK_CONSOLE_MODE = "console_mode"; - static final String DB_KEY_BOOKMARK_DEBUG_LEVEL = "debug_level"; + static final String DB_KEY_BOOKMARK_REDIRECT_SDCARD = "redirect_sdcard"; + static final String DB_KEY_BOOKMARK_REDIRECT_SOUND = "redirect_sound"; + static final String DB_KEY_BOOKMARK_REDIRECT_MICROPHONE = "redirect_microphone"; + static final String DB_KEY_BOOKMARK_SECURITY = "security"; + static final String DB_KEY_BOOKMARK_REMOTE_PROGRAM = "remote_program"; + static final String DB_KEY_BOOKMARK_WORK_DIR = "work_dir"; + static final String DB_KEY_BOOKMARK_ASYNC_CHANNEL = "async_channel"; + static final String DB_KEY_BOOKMARK_ASYNC_INPUT = "async_input"; + static final String DB_KEY_BOOKMARK_ASYNC_UPDATE = "async_update"; + static final String DB_KEY_BOOKMARK_CONSOLE_MODE = "console_mode"; + static final String DB_KEY_BOOKMARK_DEBUG_LEVEL = "debug_level"; - static final String DB_KEY_BOOKMARK_GW_ENABLE = "enable_gateway_settings"; - static final String DB_KEY_BOOKMARK_GW_HOSTNAME = "gateway_hostname"; - static final String DB_KEY_BOOKMARK_GW_PORT = "gateway_port"; - static final String DB_KEY_BOOKMARK_GW_USERNAME = "gateway_username"; - static final String DB_KEY_BOOKMARK_GW_PASSWORD = "gateway_password"; - static final String DB_KEY_BOOKMARK_GW_DOMAIN = "gateway_domain"; - static final String DB_KEY_BOOKMARK_3G_ENABLE = "enable_3g_settings"; + static final String DB_KEY_BOOKMARK_GW_ENABLE = "enable_gateway_settings"; + static final String DB_KEY_BOOKMARK_GW_HOSTNAME = "gateway_hostname"; + static final String DB_KEY_BOOKMARK_GW_PORT = "gateway_port"; + static final String DB_KEY_BOOKMARK_GW_USERNAME = "gateway_username"; + static final String DB_KEY_BOOKMARK_GW_PASSWORD = "gateway_password"; + static final String DB_KEY_BOOKMARK_GW_DOMAIN = "gateway_domain"; + static final String DB_KEY_BOOKMARK_3G_ENABLE = "enable_3g_settings"; - public BookmarkDB(Context context) { - super(context, DB_NAME, null, DB_VERSION); - } + public BookmarkDB(Context context) + { + super(context, DB_NAME, null, DB_VERSION); + } - private static List GetColumns(SQLiteDatabase db, String tableName) { - List ar = null; - Cursor c = null; - try { - c = db.rawQuery("SELECT * FROM " + tableName + " LIMIT 1", null); - if (c != null) { - ar = new ArrayList<>(Arrays.asList(c.getColumnNames())); - } - } catch (Exception e) { - Log.v(tableName, e.getMessage(), e); - e.printStackTrace(); - } finally { - if (c != null) - c.close(); - } - return ar; - } + private static List GetColumns(SQLiteDatabase db, String tableName) + { + List ar = null; + Cursor c = null; + try + { + c = db.rawQuery("SELECT * FROM " + tableName + " LIMIT 1", null); + if (c != null) + { + ar = new ArrayList<>(Arrays.asList(c.getColumnNames())); + } + } + catch (Exception e) + { + Log.v(tableName, e.getMessage(), e); + e.printStackTrace(); + } + finally + { + if (c != null) + c.close(); + } + return ar; + } - private static String joinStrings(List list, String delim) { - StringBuilder buf = new StringBuilder(); - int num = list.size(); - for (int i = 0; i < num; i++) { - if (i != 0) - buf.append(delim); - buf.append((String) list.get(i)); - } - return buf.toString(); - } + private static String joinStrings(List list, String delim) + { + StringBuilder buf = new StringBuilder(); + int num = list.size(); + for (int i = 0; i < num; i++) + { + if (i != 0) + buf.append(delim); + buf.append((String)list.get(i)); + } + return buf.toString(); + } - private void backupTables(SQLiteDatabase db) { - for (String table : DB_TABLES) { - final String tmpTable = DB_BACKUP_PREFIX + table; - final String query = "ALTER TABLE '" + table + "' RENAME TO '" + tmpTable + "'"; - try { - db.execSQL(query); - } catch (Exception e) { - /* Ignore errors if table does not exist. */ - } - } - } + private void backupTables(SQLiteDatabase db) + { + for (String table : DB_TABLES) + { + final String tmpTable = DB_BACKUP_PREFIX + table; + final String query = "ALTER TABLE '" + table + "' RENAME TO '" + tmpTable + "'"; + try + { + db.execSQL(query); + } + catch (Exception e) + { + /* Ignore errors if table does not exist. */ + } + } + } - private void dropOldTables(SQLiteDatabase db) { - for (String table : DB_TABLES) { - final String tmpTable = DB_BACKUP_PREFIX + table; - final String query = "DROP TABLE IF EXISTS '" + tmpTable + "'"; - db.execSQL(query); - } - } + private void dropOldTables(SQLiteDatabase db) + { + for (String table : DB_TABLES) + { + final String tmpTable = DB_BACKUP_PREFIX + table; + final String query = "DROP TABLE IF EXISTS '" + tmpTable + "'"; + db.execSQL(query); + } + } - private void createDB(SQLiteDatabase db) { - final String sqlScreenSettings = - "CREATE TABLE IF NOT EXISTS " + DB_TABLE_SCREEN + " (" - + ID + " INTEGER PRIMARY KEY, " - + DB_KEY_SCREEN_COLORS + " INTEGER DEFAULT 16, " - + DB_KEY_SCREEN_RESOLUTION + " INTEGER DEFAULT 0, " - + DB_KEY_SCREEN_WIDTH + ", " - + DB_KEY_SCREEN_HEIGHT + ");"; + private void createDB(SQLiteDatabase db) + { + final String sqlScreenSettings = + "CREATE TABLE IF NOT EXISTS " + DB_TABLE_SCREEN + " (" + ID + " INTEGER PRIMARY KEY, " + + DB_KEY_SCREEN_COLORS + " INTEGER DEFAULT 16, " + DB_KEY_SCREEN_RESOLUTION + + " INTEGER DEFAULT 0, " + DB_KEY_SCREEN_WIDTH + ", " + DB_KEY_SCREEN_HEIGHT + ");"; - db.execSQL(sqlScreenSettings); + db.execSQL(sqlScreenSettings); - final String sqlPerformanceFlags = - "CREATE TABLE IF NOT EXISTS " + DB_TABLE_PERFORMANCE + " (" - + ID + " INTEGER PRIMARY KEY, " - + DB_KEY_PERFORMANCE_RFX + " INTEGER, " - + DB_KEY_PERFORMANCE_GFX + " INTEGER, " - + DB_KEY_PERFORMANCE_H264 + " INTEGER, " - + DB_KEY_PERFORMANCE_WALLPAPER + " INTEGER, " - + DB_KEY_PERFORMANCE_THEME + " INTEGER, " - + DB_KEY_PERFORMANCE_DRAG + " INTEGER, " - + DB_KEY_PERFORMANCE_MENU_ANIMATIONS + " INTEGER, " - + DB_KEY_PERFORMANCE_FONTS + " INTEGER, " - + DB_KEY_PERFORMANCE_COMPOSITION + " INTEGER);"; + final String sqlPerformanceFlags = + "CREATE TABLE IF NOT EXISTS " + DB_TABLE_PERFORMANCE + " (" + ID + + " INTEGER PRIMARY KEY, " + DB_KEY_PERFORMANCE_RFX + " INTEGER, " + + DB_KEY_PERFORMANCE_GFX + " INTEGER, " + DB_KEY_PERFORMANCE_H264 + " INTEGER, " + + DB_KEY_PERFORMANCE_WALLPAPER + " INTEGER, " + DB_KEY_PERFORMANCE_THEME + " INTEGER, " + + DB_KEY_PERFORMANCE_DRAG + " INTEGER, " + DB_KEY_PERFORMANCE_MENU_ANIMATIONS + + " INTEGER, " + DB_KEY_PERFORMANCE_FONTS + " INTEGER, " + + DB_KEY_PERFORMANCE_COMPOSITION + " INTEGER);"; - db.execSQL(sqlPerformanceFlags); + db.execSQL(sqlPerformanceFlags); - final String sqlManualBookmarks = getManualBookmarksCreationString(); - db.execSQL(sqlManualBookmarks); - } + final String sqlManualBookmarks = getManualBookmarksCreationString(); + db.execSQL(sqlManualBookmarks); + } - private void upgradeTables(SQLiteDatabase db) { - for (String table : DB_TABLES) { - final String tmpTable = DB_BACKUP_PREFIX + table; + private void upgradeTables(SQLiteDatabase db) + { + for (String table : DB_TABLES) + { + final String tmpTable = DB_BACKUP_PREFIX + table; - final List newColumns = GetColumns(db, table); - List columns = GetColumns(db, tmpTable); + final List newColumns = GetColumns(db, table); + List columns = GetColumns(db, tmpTable); - if (columns != null) { - columns.retainAll(newColumns); + if (columns != null) + { + columns.retainAll(newColumns); - // restore data - final String cols = joinStrings(columns, ","); - final String query = String.format("INSERT INTO %s (%s) SELECT %s from '%s'", table, cols, cols, tmpTable); - db.execSQL(query); - } - } - } + // restore data + final String cols = joinStrings(columns, ","); + final String query = String.format("INSERT INTO %s (%s) SELECT %s from '%s'", table, + cols, cols, tmpTable); + db.execSQL(query); + } + } + } - private void downgradeTables(SQLiteDatabase db) { - for (String table : DB_TABLES) { - final String tmpTable = DB_BACKUP_PREFIX + table; + private void downgradeTables(SQLiteDatabase db) + { + for (String table : DB_TABLES) + { + final String tmpTable = DB_BACKUP_PREFIX + table; - List oldColumns = GetColumns(db, table); - final List columns = GetColumns(db, tmpTable); + List oldColumns = GetColumns(db, table); + final List columns = GetColumns(db, tmpTable); - if (oldColumns != null) { - oldColumns.retainAll(columns); + if (oldColumns != null) + { + oldColumns.retainAll(columns); - // restore data - final String cols = joinStrings(oldColumns, ","); - final String query = String.format("INSERT INTO %s (%s) SELECT %s from '%s'", table, cols, cols, tmpTable); - db.execSQL(query); - } - } - } + // restore data + final String cols = joinStrings(oldColumns, ","); + final String query = String.format("INSERT INTO %s (%s) SELECT %s from '%s'", table, + cols, cols, tmpTable); + db.execSQL(query); + } + } + } - private List getTableNames(SQLiteDatabase db) { - final String query = "SELECT name FROM sqlite_master WHERE type='table'"; - Cursor cursor = db.rawQuery(query, null); - List list = new ArrayList<>(); - try { - if (cursor.moveToFirst() && (cursor.getCount() > 0)) { - while (!cursor.isAfterLast()) { - final String name = cursor.getString(cursor.getColumnIndex("name")); - list.add(name); - cursor.moveToNext(); - } - } - } finally { - cursor.close(); - } + private List getTableNames(SQLiteDatabase db) + { + final String query = "SELECT name FROM sqlite_master WHERE type='table'"; + Cursor cursor = db.rawQuery(query, null); + List list = new ArrayList<>(); + try + { + if (cursor.moveToFirst() && (cursor.getCount() > 0)) + { + while (!cursor.isAfterLast()) + { + final String name = cursor.getString(cursor.getColumnIndex("name")); + list.add(name); + cursor.moveToNext(); + } + } + } + finally + { + cursor.close(); + } - return list; - } + return list; + } - private void insertDefault(SQLiteDatabase db) { - ContentValues screenValues = new ContentValues(); - screenValues.put(DB_KEY_SCREEN_COLORS, 32); - screenValues.put(DB_KEY_SCREEN_RESOLUTION, 1); - screenValues.put(DB_KEY_SCREEN_WIDTH, 1024); - screenValues.put(DB_KEY_SCREEN_HEIGHT, 768); + private void insertDefault(SQLiteDatabase db) + { + ContentValues screenValues = new ContentValues(); + screenValues.put(DB_KEY_SCREEN_COLORS, 32); + screenValues.put(DB_KEY_SCREEN_RESOLUTION, 1); + screenValues.put(DB_KEY_SCREEN_WIDTH, 1024); + screenValues.put(DB_KEY_SCREEN_HEIGHT, 768); - final long idScreen = db.insert(DB_TABLE_SCREEN, null, screenValues); - final long idScreen3g = db.insert(DB_TABLE_SCREEN, null, screenValues); + final long idScreen = db.insert(DB_TABLE_SCREEN, null, screenValues); + final long idScreen3g = db.insert(DB_TABLE_SCREEN, null, screenValues); - ContentValues performanceValues = new ContentValues(); - performanceValues.put(DB_KEY_PERFORMANCE_RFX, 1); - performanceValues.put(DB_KEY_PERFORMANCE_GFX, 1); - performanceValues.put(DB_KEY_PERFORMANCE_H264, 0); - performanceValues.put(DB_KEY_PERFORMANCE_WALLPAPER, 0); - performanceValues.put(DB_KEY_PERFORMANCE_THEME, 0); - performanceValues.put(DB_KEY_PERFORMANCE_DRAG, 0); - performanceValues.put(DB_KEY_PERFORMANCE_MENU_ANIMATIONS, 0); - performanceValues.put(DB_KEY_PERFORMANCE_FONTS, 0); - performanceValues.put(DB_KEY_PERFORMANCE_COMPOSITION, 0); + ContentValues performanceValues = new ContentValues(); + performanceValues.put(DB_KEY_PERFORMANCE_RFX, 1); + performanceValues.put(DB_KEY_PERFORMANCE_GFX, 1); + performanceValues.put(DB_KEY_PERFORMANCE_H264, 0); + performanceValues.put(DB_KEY_PERFORMANCE_WALLPAPER, 0); + performanceValues.put(DB_KEY_PERFORMANCE_THEME, 0); + performanceValues.put(DB_KEY_PERFORMANCE_DRAG, 0); + performanceValues.put(DB_KEY_PERFORMANCE_MENU_ANIMATIONS, 0); + performanceValues.put(DB_KEY_PERFORMANCE_FONTS, 0); + performanceValues.put(DB_KEY_PERFORMANCE_COMPOSITION, 0); - final long idPerformance = db.insert(DB_TABLE_PERFORMANCE, null, performanceValues); - final long idPerformance3g = db.insert(DB_TABLE_PERFORMANCE, null, performanceValues); + final long idPerformance = db.insert(DB_TABLE_PERFORMANCE, null, performanceValues); + final long idPerformance3g = db.insert(DB_TABLE_PERFORMANCE, null, performanceValues); - ContentValues bookmarkValues = new ContentValues(); - bookmarkValues.put(DB_KEY_BOOKMARK_LABEL, "Test Server"); - bookmarkValues.put(DB_KEY_BOOKMARK_HOSTNAME, "testservice.afreerdp.com"); - bookmarkValues.put(DB_KEY_BOOKMARK_USERNAME, ""); - bookmarkValues.put(DB_KEY_BOOKMARK_PASSWORD, ""); - bookmarkValues.put(DB_KEY_BOOKMARK_DOMAIN, ""); - bookmarkValues.put(DB_KEY_BOOKMARK_PORT, "3389"); + ContentValues bookmarkValues = new ContentValues(); + bookmarkValues.put(DB_KEY_BOOKMARK_LABEL, "Test Server"); + bookmarkValues.put(DB_KEY_BOOKMARK_HOSTNAME, "testservice.afreerdp.com"); + bookmarkValues.put(DB_KEY_BOOKMARK_USERNAME, ""); + bookmarkValues.put(DB_KEY_BOOKMARK_PASSWORD, ""); + bookmarkValues.put(DB_KEY_BOOKMARK_DOMAIN, ""); + bookmarkValues.put(DB_KEY_BOOKMARK_PORT, "3389"); - bookmarkValues.put(DB_KEY_SCREEN_SETTINGS, idScreen); - bookmarkValues.put(DB_KEY_SCREEN_SETTINGS_3G, idScreen3g); - bookmarkValues.put(DB_KEY_PERFORMANCE_FLAGS, idPerformance); - bookmarkValues.put(DB_KEY_PERFORMANCE_FLAGS_3G, idPerformance3g); + bookmarkValues.put(DB_KEY_SCREEN_SETTINGS, idScreen); + bookmarkValues.put(DB_KEY_SCREEN_SETTINGS_3G, idScreen3g); + bookmarkValues.put(DB_KEY_PERFORMANCE_FLAGS, idPerformance); + bookmarkValues.put(DB_KEY_PERFORMANCE_FLAGS_3G, idPerformance3g); - bookmarkValues.put(DB_KEY_BOOKMARK_REDIRECT_SDCARD, 0); - bookmarkValues.put(DB_KEY_BOOKMARK_REDIRECT_SOUND, 0); - bookmarkValues.put(DB_KEY_BOOKMARK_REDIRECT_MICROPHONE, 0); - bookmarkValues.put(DB_KEY_BOOKMARK_SECURITY, 0); - bookmarkValues.put(DB_KEY_BOOKMARK_REMOTE_PROGRAM, ""); - bookmarkValues.put(DB_KEY_BOOKMARK_WORK_DIR, ""); - bookmarkValues.put(DB_KEY_BOOKMARK_ASYNC_CHANNEL, 1); - bookmarkValues.put(DB_KEY_BOOKMARK_ASYNC_INPUT, 1); - bookmarkValues.put(DB_KEY_BOOKMARK_ASYNC_UPDATE, 1); - bookmarkValues.put(DB_KEY_BOOKMARK_CONSOLE_MODE, 0); - bookmarkValues.put(DB_KEY_BOOKMARK_DEBUG_LEVEL, "INFO"); + bookmarkValues.put(DB_KEY_BOOKMARK_REDIRECT_SDCARD, 0); + bookmarkValues.put(DB_KEY_BOOKMARK_REDIRECT_SOUND, 0); + bookmarkValues.put(DB_KEY_BOOKMARK_REDIRECT_MICROPHONE, 0); + bookmarkValues.put(DB_KEY_BOOKMARK_SECURITY, 0); + bookmarkValues.put(DB_KEY_BOOKMARK_REMOTE_PROGRAM, ""); + bookmarkValues.put(DB_KEY_BOOKMARK_WORK_DIR, ""); + bookmarkValues.put(DB_KEY_BOOKMARK_ASYNC_CHANNEL, 1); + bookmarkValues.put(DB_KEY_BOOKMARK_ASYNC_INPUT, 1); + bookmarkValues.put(DB_KEY_BOOKMARK_ASYNC_UPDATE, 1); + bookmarkValues.put(DB_KEY_BOOKMARK_CONSOLE_MODE, 0); + bookmarkValues.put(DB_KEY_BOOKMARK_DEBUG_LEVEL, "INFO"); - db.insert(DB_TABLE_BOOKMARK, null, bookmarkValues); - } + db.insert(DB_TABLE_BOOKMARK, null, bookmarkValues); + } - @Override - public void onCreate(SQLiteDatabase db) { - createDB(db); - insertDefault(db); - } + @Override public void onCreate(SQLiteDatabase db) + { + createDB(db); + insertDefault(db); + } - private String getManualBookmarksCreationString() { - return ( - "CREATE TABLE IF NOT EXISTS " + DB_TABLE_BOOKMARK + " (" - + ID + " INTEGER PRIMARY KEY, " - + DB_KEY_BOOKMARK_LABEL + " TEXT NOT NULL, " - + DB_KEY_BOOKMARK_HOSTNAME + " TEXT NOT NULL, " - + DB_KEY_BOOKMARK_USERNAME + " TEXT NOT NULL, " - + DB_KEY_BOOKMARK_PASSWORD + " TEXT, " - + DB_KEY_BOOKMARK_DOMAIN + " TEXT, " - + DB_KEY_BOOKMARK_PORT + " TEXT, " - + DB_KEY_SCREEN_SETTINGS + " INTEGER NOT NULL, " - + DB_KEY_PERFORMANCE_FLAGS + " INTEGER NOT NULL, " + private String getManualBookmarksCreationString() + { + return ("CREATE TABLE IF NOT EXISTS " + DB_TABLE_BOOKMARK + " (" + ID + + " INTEGER PRIMARY KEY, " + DB_KEY_BOOKMARK_LABEL + " TEXT NOT NULL, " + + DB_KEY_BOOKMARK_HOSTNAME + " TEXT NOT NULL, " + DB_KEY_BOOKMARK_USERNAME + + " TEXT NOT NULL, " + DB_KEY_BOOKMARK_PASSWORD + " TEXT, " + DB_KEY_BOOKMARK_DOMAIN + + " TEXT, " + DB_KEY_BOOKMARK_PORT + " TEXT, " + DB_KEY_SCREEN_SETTINGS + + " INTEGER NOT NULL, " + DB_KEY_PERFORMANCE_FLAGS + " INTEGER NOT NULL, " - + DB_KEY_BOOKMARK_GW_ENABLE + " INTEGER DEFAULT 0, " - + DB_KEY_BOOKMARK_GW_HOSTNAME + " TEXT, " - + DB_KEY_BOOKMARK_GW_PORT + " INTEGER DEFAULT 443, " - + DB_KEY_BOOKMARK_GW_USERNAME + " TEXT, " - + DB_KEY_BOOKMARK_GW_PASSWORD + " TEXT, " - + DB_KEY_BOOKMARK_GW_DOMAIN + " TEXT, " + + DB_KEY_BOOKMARK_GW_ENABLE + " INTEGER DEFAULT 0, " + DB_KEY_BOOKMARK_GW_HOSTNAME + + " TEXT, " + DB_KEY_BOOKMARK_GW_PORT + " INTEGER DEFAULT 443, " + + DB_KEY_BOOKMARK_GW_USERNAME + " TEXT, " + DB_KEY_BOOKMARK_GW_PASSWORD + " TEXT, " + + DB_KEY_BOOKMARK_GW_DOMAIN + " TEXT, " - + DB_KEY_BOOKMARK_3G_ENABLE + " INTEGER DEFAULT 0, " - + DB_KEY_SCREEN_SETTINGS_3G + " INTEGER NOT NULL, " - + DB_KEY_PERFORMANCE_FLAGS_3G + " INTEGER NOT NULL, " - + DB_KEY_BOOKMARK_REDIRECT_SDCARD + " INTEGER DEFAULT 0, " - + DB_KEY_BOOKMARK_REDIRECT_SOUND + " INTEGER DEFAULT 0, " - + DB_KEY_BOOKMARK_REDIRECT_MICROPHONE + " INTEGER DEFAULT 0, " - + DB_KEY_BOOKMARK_SECURITY + " INTEGER, " - + DB_KEY_BOOKMARK_REMOTE_PROGRAM + " TEXT, " - + DB_KEY_BOOKMARK_WORK_DIR + " TEXT, " - + DB_KEY_BOOKMARK_ASYNC_CHANNEL + " INTEGER DEFAULT 0, " - + DB_KEY_BOOKMARK_ASYNC_INPUT + " INTEGER DEFAULT 0, " - + DB_KEY_BOOKMARK_ASYNC_UPDATE + " INTEGER DEFAULT 0, " - + DB_KEY_BOOKMARK_CONSOLE_MODE + " INTEGER, " - + DB_KEY_BOOKMARK_DEBUG_LEVEL + " TEXT DEFAULT 'INFO', " + + DB_KEY_BOOKMARK_3G_ENABLE + " INTEGER DEFAULT 0, " + DB_KEY_SCREEN_SETTINGS_3G + + " INTEGER NOT NULL, " + DB_KEY_PERFORMANCE_FLAGS_3G + " INTEGER NOT NULL, " + + DB_KEY_BOOKMARK_REDIRECT_SDCARD + " INTEGER DEFAULT 0, " + + DB_KEY_BOOKMARK_REDIRECT_SOUND + " INTEGER DEFAULT 0, " + + DB_KEY_BOOKMARK_REDIRECT_MICROPHONE + " INTEGER DEFAULT 0, " + + DB_KEY_BOOKMARK_SECURITY + " INTEGER, " + DB_KEY_BOOKMARK_REMOTE_PROGRAM + + " TEXT, " + DB_KEY_BOOKMARK_WORK_DIR + " TEXT, " + DB_KEY_BOOKMARK_ASYNC_CHANNEL + + " INTEGER DEFAULT 0, " + DB_KEY_BOOKMARK_ASYNC_INPUT + " INTEGER DEFAULT 0, " + + DB_KEY_BOOKMARK_ASYNC_UPDATE + " INTEGER DEFAULT 0, " + + DB_KEY_BOOKMARK_CONSOLE_MODE + " INTEGER, " + DB_KEY_BOOKMARK_DEBUG_LEVEL + + " TEXT DEFAULT 'INFO', " - + "FOREIGN KEY(" + DB_KEY_SCREEN_SETTINGS + ") REFERENCES " + DB_TABLE_SCREEN + "(" + ID + "), " - + "FOREIGN KEY(" + DB_KEY_PERFORMANCE_FLAGS + ") REFERENCES " + DB_TABLE_PERFORMANCE + "(" + ID + "), " - + "FOREIGN KEY(" + DB_KEY_SCREEN_SETTINGS_3G + ") REFERENCES " + DB_TABLE_SCREEN + "(" + ID + "), " - + "FOREIGN KEY(" + DB_KEY_PERFORMANCE_FLAGS_3G + ") REFERENCES " + DB_TABLE_PERFORMANCE + "(" + ID + ") " + + "FOREIGN KEY(" + DB_KEY_SCREEN_SETTINGS + ") REFERENCES " + DB_TABLE_SCREEN + + "(" + ID + "), " + + "FOREIGN KEY(" + DB_KEY_PERFORMANCE_FLAGS + ") REFERENCES " + + DB_TABLE_PERFORMANCE + "(" + ID + "), " + + "FOREIGN KEY(" + DB_KEY_SCREEN_SETTINGS_3G + ") REFERENCES " + DB_TABLE_SCREEN + + "(" + ID + "), " + + "FOREIGN KEY(" + DB_KEY_PERFORMANCE_FLAGS_3G + ") REFERENCES " + + DB_TABLE_PERFORMANCE + "(" + ID + ") " - + ");"); - } + + ");"); + } - private void recreateDB(SQLiteDatabase db) { - for (String table : DB_TABLES) { - final String query = "DROP TABLE IF EXISTS '" + table + "'"; - db.execSQL(query); - } - onCreate(db); - } + private void recreateDB(SQLiteDatabase db) + { + for (String table : DB_TABLES) + { + final String query = "DROP TABLE IF EXISTS '" + table + "'"; + db.execSQL(query); + } + onCreate(db); + } - private void upgradeDB(SQLiteDatabase db) { - db.beginTransaction(); - try { - /* Back up old tables. */ - dropOldTables(db); - backupTables(db); - createDB(db); - upgradeTables(db); + private void upgradeDB(SQLiteDatabase db) + { + db.beginTransaction(); + try + { + /* Back up old tables. */ + dropOldTables(db); + backupTables(db); + createDB(db); + upgradeTables(db); - db.setTransactionSuccessful(); - } finally { - db.endTransaction(); - dropOldTables(db); - } - } + db.setTransactionSuccessful(); + } + finally + { + db.endTransaction(); + dropOldTables(db); + } + } - private void downgradeDB(SQLiteDatabase db) { - db.beginTransaction(); - try { - /* Back up old tables. */ - dropOldTables(db); - backupTables(db); - createDB(db); - downgradeTables(db); + private void downgradeDB(SQLiteDatabase db) + { + db.beginTransaction(); + try + { + /* Back up old tables. */ + dropOldTables(db); + backupTables(db); + createDB(db); + downgradeTables(db); - db.setTransactionSuccessful(); - } finally { - db.endTransaction(); - dropOldTables(db); - } - } + db.setTransactionSuccessful(); + } + finally + { + db.endTransaction(); + dropOldTables(db); + } + } - // from http://stackoverflow.com/questions/3424156/upgrade-sqlite-database-from-one-version-to-another - @Override - public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { - switch (oldVersion) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - upgradeDB(db); - break; - default: - recreateDB(db); - break; - } - } - - @Override - public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) { - downgradeDB(db); - } + // from + // http://stackoverflow.com/questions/3424156/upgrade-sqlite-database-from-one-version-to-another + @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) + { + switch (oldVersion) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + upgradeDB(db); + break; + default: + recreateDB(db); + break; + } + } + @Override public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) + { + downgradeDB(db); + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/FreeRDPSuggestionProvider.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/FreeRDPSuggestionProvider.java index 5d0035b41..d5f657c74 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/FreeRDPSuggestionProvider.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/FreeRDPSuggestionProvider.java @@ -1,10 +1,11 @@ /* - Suggestion Provider for RDP bookmarks + Suggestion Provider for RDP bookmarks Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.services; @@ -24,97 +25,110 @@ import com.freerdp.freerdpcore.domain.ManualBookmark; import java.util.ArrayList; -public class FreeRDPSuggestionProvider extends ContentProvider { +public class FreeRDPSuggestionProvider extends ContentProvider +{ - public static final Uri CONTENT_URI = Uri.parse("content://com.freerdp.afreerdp.services.freerdpsuggestionprovider"); + public static final Uri CONTENT_URI = + Uri.parse("content://com.freerdp.afreerdp.services.freerdpsuggestionprovider"); - @Override - public int delete(Uri uri, String selection, String[] selectionArgs) { - // TODO Auto-generated method stub - return 0; - } + @Override public int delete(Uri uri, String selection, String[] selectionArgs) + { + // TODO Auto-generated method stub + return 0; + } - @Override - public String getType(Uri uri) { - return "vnd.android.cursor.item/vnd.freerdp.remote"; - } + @Override public String getType(Uri uri) + { + return "vnd.android.cursor.item/vnd.freerdp.remote"; + } - @Override - public Uri insert(Uri uri, ContentValues values) { - // TODO Auto-generated method stub - return null; - } + @Override public Uri insert(Uri uri, ContentValues values) + { + // TODO Auto-generated method stub + return null; + } - @Override - public boolean onCreate() { - return true; - } + @Override public boolean onCreate() + { + return true; + } - @Override - public Cursor query(Uri uri, String[] projection, String selection, - String[] selectionArgs, String sortOrder) { + @Override + public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, + String sortOrder) + { - String query = (selectionArgs != null && selectionArgs.length > 0) ? selectionArgs[0] : ""; + String query = (selectionArgs != null && selectionArgs.length > 0) ? selectionArgs[0] : ""; - // search history - ArrayList history = GlobalApp.getQuickConnectHistoryGateway().findHistory(query); + // search history + ArrayList history = + GlobalApp.getQuickConnectHistoryGateway().findHistory(query); - // search bookmarks - ArrayList manualBookmarks; - if (query.length() > 0) - manualBookmarks = GlobalApp.getManualBookmarkGateway().findByLabelOrHostnameLike(query); - else - manualBookmarks = GlobalApp.getManualBookmarkGateway().findAll(); + // search bookmarks + ArrayList manualBookmarks; + if (query.length() > 0) + manualBookmarks = GlobalApp.getManualBookmarkGateway().findByLabelOrHostnameLike(query); + else + manualBookmarks = GlobalApp.getManualBookmarkGateway().findAll(); - return createResultCursor(history, manualBookmarks); - } + return createResultCursor(history, manualBookmarks); + } - @Override - public int update(Uri uri, ContentValues values, String selection, - String[] selectionArgs) { - // TODO Auto-generated method stub - return 0; - } + @Override + public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) + { + // TODO Auto-generated method stub + return 0; + } - private void addBookmarksToCursor(ArrayList bookmarks, MatrixCursor resultCursor) { - Object[] row = new Object[5]; - for (BookmarkBase bookmark : bookmarks) { - row[0] = new Long(bookmark.getId()); - row[1] = bookmark.getLabel(); - row[2] = bookmark.get().getHostname(); - row[3] = ConnectionReference.getManualBookmarkReference(bookmark.getId()); - row[4] = "android.resource://" + getContext().getPackageName() + "/" + R.drawable.icon_star_on; - resultCursor.addRow(row); - } - } + private void addBookmarksToCursor(ArrayList bookmarks, MatrixCursor resultCursor) + { + Object[] row = new Object[5]; + for (BookmarkBase bookmark : bookmarks) + { + row[0] = new Long(bookmark.getId()); + row[1] = bookmark.getLabel(); + row[2] = bookmark.get().getHostname(); + row[3] = ConnectionReference.getManualBookmarkReference(bookmark.getId()); + row[4] = "android.resource://" + getContext().getPackageName() + "/" + + R.drawable.icon_star_on; + resultCursor.addRow(row); + } + } - private void addHistoryToCursor(ArrayList history, MatrixCursor resultCursor) { - Object[] row = new Object[5]; - for (BookmarkBase bookmark : history) { - row[0] = new Integer(1); - row[1] = bookmark.getLabel(); - row[2] = bookmark.getLabel(); - row[3] = ConnectionReference.getHostnameReference(bookmark.getLabel()); - row[4] = "android.resource://" + getContext().getPackageName() + "/" + R.drawable.icon_star_off; - resultCursor.addRow(row); - } - } + private void addHistoryToCursor(ArrayList history, MatrixCursor resultCursor) + { + Object[] row = new Object[5]; + for (BookmarkBase bookmark : history) + { + row[0] = new Integer(1); + row[1] = bookmark.getLabel(); + row[2] = bookmark.getLabel(); + row[3] = ConnectionReference.getHostnameReference(bookmark.getLabel()); + row[4] = "android.resource://" + getContext().getPackageName() + "/" + + R.drawable.icon_star_off; + resultCursor.addRow(row); + } + } - private Cursor createResultCursor(ArrayList history, ArrayList manualBookmarks) { + private Cursor createResultCursor(ArrayList history, + ArrayList manualBookmarks) + { - // create result matrix cursor - int totalCount = history.size() + manualBookmarks.size(); - String[] columns = {android.provider.BaseColumns._ID, SearchManager.SUGGEST_COLUMN_TEXT_1, - SearchManager.SUGGEST_COLUMN_TEXT_2, SearchManager.SUGGEST_COLUMN_INTENT_DATA, - SearchManager.SUGGEST_COLUMN_ICON_2}; - MatrixCursor matrixCursor = new MatrixCursor(columns, totalCount); - - // populate result matrix - if (totalCount > 0) { - addHistoryToCursor(history, matrixCursor); - addBookmarksToCursor(manualBookmarks, matrixCursor); - } - return matrixCursor; - } + // create result matrix cursor + int totalCount = history.size() + manualBookmarks.size(); + String[] columns = { android.provider.BaseColumns._ID, SearchManager.SUGGEST_COLUMN_TEXT_1, + SearchManager.SUGGEST_COLUMN_TEXT_2, + SearchManager.SUGGEST_COLUMN_INTENT_DATA, + SearchManager.SUGGEST_COLUMN_ICON_2 }; + MatrixCursor matrixCursor = new MatrixCursor(columns, totalCount); + // populate result matrix + if (totalCount > 0) + { + addHistoryToCursor(history, matrixCursor); + addBookmarksToCursor(manualBookmarks, matrixCursor); + } + return matrixCursor; + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/HistoryDB.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/HistoryDB.java index 91bd8b7b0..b483aac88 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/HistoryDB.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/HistoryDB.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.services; @@ -13,34 +14,33 @@ import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; -public class HistoryDB extends SQLiteOpenHelper { +public class HistoryDB extends SQLiteOpenHelper +{ - public static final String QUICK_CONNECT_TABLE_NAME = "quick_connect_history"; - public static final String QUICK_CONNECT_TABLE_COL_ITEM = "item"; - public static final String QUICK_CONNECT_TABLE_COL_TIMESTAMP = "timestamp"; - private static final int DB_VERSION = 1; - private static final String DB_NAME = "history.db"; + public static final String QUICK_CONNECT_TABLE_NAME = "quick_connect_history"; + public static final String QUICK_CONNECT_TABLE_COL_ITEM = "item"; + public static final String QUICK_CONNECT_TABLE_COL_TIMESTAMP = "timestamp"; + private static final int DB_VERSION = 1; + private static final String DB_NAME = "history.db"; - public HistoryDB(Context context) { - super(context, DB_NAME, null, DB_VERSION); - } + public HistoryDB(Context context) + { + super(context, DB_NAME, null, DB_VERSION); + } - @Override - public void onCreate(SQLiteDatabase db) { + @Override public void onCreate(SQLiteDatabase db) + { - String sqlQuickConnectHistory = - "CREATE TABLE " + QUICK_CONNECT_TABLE_NAME + " (" - + QUICK_CONNECT_TABLE_COL_ITEM + " TEXT PRIMARY KEY, " - + QUICK_CONNECT_TABLE_COL_TIMESTAMP + " INTEGER" - + ");"; + String sqlQuickConnectHistory = "CREATE TABLE " + QUICK_CONNECT_TABLE_NAME + " (" + + QUICK_CONNECT_TABLE_COL_ITEM + " TEXT PRIMARY KEY, " + + QUICK_CONNECT_TABLE_COL_TIMESTAMP + " INTEGER" + + ");"; - db.execSQL(sqlQuickConnectHistory); - } - - @Override - public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { - // TODO Auto-generated method stub - - } + db.execSQL(sqlQuickConnectHistory); + } + @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) + { + // TODO Auto-generated method stub + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/LibFreeRDP.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/LibFreeRDP.java index 686b5c2ed..658b47c73 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/LibFreeRDP.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/LibFreeRDP.java @@ -3,13 +3,13 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.services; - import android.content.Context; import android.graphics.Bitmap; import android.net.Uri; @@ -24,502 +24,594 @@ import com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity; import java.util.ArrayList; -public class LibFreeRDP { - private static final String TAG = "LibFreeRDP"; - private static EventListener listener; - private static boolean mHasH264 = true; - - private static final LongSparseArray mInstanceState = new LongSparseArray<>(); - - static { - final String h264 = "openh264"; - final String[] libraries = { - h264, "freerdp-openssl", "jpeg", "winpr2", - "freerdp2", "freerdp-client2", "freerdp-android2"}; - final String LD_PATH = System.getProperty("java.library.path"); - - for (String lib : libraries) { - try { - Log.v(TAG, "Trying to load library " + lib + " from LD_PATH: " + LD_PATH); - System.loadLibrary(lib); - } catch (UnsatisfiedLinkError e) { - Log.e(TAG, "Failed to load library " + lib + ": " + e.toString()); - if (lib.equals(h264)) { - mHasH264 = false; - } - } - } - } - - public static boolean hasH264Support() { - return mHasH264; - } - - private static native String freerdp_get_jni_version(); - - private static native String freerdp_get_version(); - - private static native String freerdp_get_build_date(); - - private static native String freerdp_get_build_revision(); - - private static native String freerdp_get_build_config(); - - private static native long freerdp_new(Context context); - - private static native void freerdp_free(long inst); - - private static native boolean freerdp_parse_arguments(long inst, String[] args); - - private static native boolean freerdp_connect(long inst); - - private static native boolean freerdp_disconnect(long inst); - - private static native boolean freerdp_update_graphics(long inst, - Bitmap bitmap, int x, int y, int width, int height); - - private static native boolean freerdp_send_cursor_event(long inst, int x, int y, int flags); - - private static native boolean freerdp_send_key_event(long inst, int keycode, boolean down); - - private static native boolean freerdp_send_unicodekey_event(long inst, int keycode, boolean down); - - private static native boolean freerdp_send_clipboard_data(long inst, String data); - - private static native String freerdp_get_last_error_string(long inst); - - public static void setEventListener(EventListener l) { - listener = l; - } - - public static long newInstance(Context context) { - return freerdp_new(context); - } - - public static void freeInstance(long inst) { - synchronized (mInstanceState) { - if (mInstanceState.get(inst, false)) { - freerdp_disconnect(inst); - } - while(mInstanceState.get(inst, false)) { - try { - mInstanceState.wait(); - } catch (InterruptedException e) { - throw new RuntimeException(); - } - } - } - freerdp_free(inst); - } - - public static boolean connect(long inst) { - synchronized (mInstanceState) { - if (mInstanceState.get(inst, false)) { - throw new RuntimeException("instance already connected"); - } - } - return freerdp_connect(inst); - } - - public static boolean disconnect(long inst) { - synchronized (mInstanceState) { - if (mInstanceState.get(inst, false)) { - return freerdp_disconnect(inst); - } - return true; - } - } - - public static boolean cancelConnection(long inst) { - synchronized (mInstanceState) { - if (mInstanceState.get(inst, false)) { - return freerdp_disconnect(inst); - } - return true; - } - } - - private static String addFlag(String name, boolean enabled) { - if (enabled) { - return "+" + name; - } - return "-" + name; - } - - public static boolean setConnectionInfo(Context context, long inst, BookmarkBase bookmark) { - BookmarkBase.ScreenSettings screenSettings = bookmark.getActiveScreenSettings(); - BookmarkBase.AdvancedSettings advanced = bookmark.getAdvancedSettings(); - BookmarkBase.DebugSettings debug = bookmark.getDebugSettings(); - - String arg; - ArrayList args = new ArrayList(); - - args.add(TAG); - args.add("/gdi:sw"); - - final String clientName = ApplicationSettingsActivity.getClientName(context); - if (!clientName.isEmpty()) { - args.add("/client-hostname:" + clientName); - } - String certName = ""; - if (bookmark.getType() != BookmarkBase.TYPE_MANUAL) { - return false; - } - - int port = bookmark.get().getPort(); - String hostname = bookmark.get().getHostname(); - - args.add("/v:" + hostname); - args.add("/port:" + String.valueOf(port)); - - arg = bookmark.getUsername(); - if (!arg.isEmpty()) { - args.add("/u:" + arg); - } - arg = bookmark.getDomain(); - if (!arg.isEmpty()) { - args.add("/d:" + arg); - } - arg = bookmark.getPassword(); - if (!arg.isEmpty()) { - args.add("/p:" + arg); - } - - args.add(String.format("/size:%dx%d", screenSettings.getWidth(), - screenSettings.getHeight())); - args.add("/bpp:" + String.valueOf(screenSettings.getColors())); - - if (advanced.getConsoleMode()) { - args.add("/admin"); - } - - switch (advanced.getSecurity()) { - case 3: // NLA - args.add("/sec-nla"); - break; - case 2: // TLS - args.add("/sec-tls"); - break; - case 1: // RDP - args.add("/sec-rdp"); - break; - default: - break; - } - - if (!certName.isEmpty()) { - args.add("/cert-name:" + certName); - } - - BookmarkBase.PerformanceFlags flags = bookmark.getActivePerformanceFlags(); - if (flags.getRemoteFX()) { - args.add("/rfx"); - } - - if (flags.getGfx()) { - args.add("/gfx"); - } - - if (flags.getH264() && mHasH264) { - args.add("/gfx:AVC444"); - } - - args.add(addFlag("wallpaper", flags.getWallpaper())); - args.add(addFlag("window-drag", flags.getFullWindowDrag())); - args.add(addFlag("menu-anims", flags.getMenuAnimations())); - args.add(addFlag("themes", flags.getTheming())); - args.add(addFlag("fonts", flags.getFontSmoothing())); - args.add(addFlag("aero", flags.getDesktopComposition())); - args.add(addFlag("glyph-cache", false)); - - if (!advanced.getRemoteProgram().isEmpty()) { - args.add("/shell:" + advanced.getRemoteProgram()); - } - - if (!advanced.getWorkDir().isEmpty()) { - args.add("/shell-dir:" + advanced.getWorkDir()); - } - - args.add(addFlag("async-channels", debug.getAsyncChannel())); - args.add(addFlag("async-input", debug.getAsyncInput())); - args.add(addFlag("async-update", debug.getAsyncUpdate())); - - if (advanced.getRedirectSDCard()) { - String path = android.os.Environment.getExternalStorageDirectory().getPath(); - args.add("/drive:sdcard," + path); - } - - args.add("/clipboard"); - - // Gateway enabled? - if (bookmark.getType() == BookmarkBase.TYPE_MANUAL && bookmark.get().getEnableGatewaySettings()) { - ManualBookmark.GatewaySettings gateway = bookmark.get().getGatewaySettings(); - - args.add(String.format("/g:%s:%d", gateway.getHostname(), gateway.getPort())); - - arg = gateway.getUsername(); - if (!arg.isEmpty()) { - args.add("/gu:" + arg); - } - arg = gateway.getDomain(); - if (!arg.isEmpty()) { - args.add("/gd:" + arg); - } - arg = gateway.getPassword(); - if (!arg.isEmpty()) { - args.add("/gp:" + arg); - } - } - - /* 0 ... local - 1 ... remote - 2 ... disable */ - args.add("/audio-mode:" + String.valueOf(advanced.getRedirectSound())); - if (advanced.getRedirectSound() == 0) { - args.add("/sound"); - } - - if (advanced.getRedirectMicrophone()) { - args.add("/microphone"); - } - - args.add("/cert-ignore"); - args.add("/log-level:" + debug.getDebugLevel()); - String[] arrayArgs = args.toArray(new String[args.size()]); - return freerdp_parse_arguments(inst, arrayArgs); - } - - public static boolean setConnectionInfo(Context context, long inst, Uri openUri) { - ArrayList args = new ArrayList<>(); - - // Parse URI from query string. Same key overwrite previous one - // freerdp://user@ip:port/connect?sound=&rfx=&p=password&clipboard=%2b&themes=- - - // Now we only support Software GDI - args.add(TAG); - args.add("/gdi:sw"); - - final String clientName = ApplicationSettingsActivity.getClientName(context); - if (!clientName.isEmpty()) { - args.add("/client-hostname:" + clientName); - } - - // Parse hostname and port. Set to 'v' argument - String hostname = openUri.getHost(); - int port = openUri.getPort(); - if (hostname != null) { - hostname = hostname + ((port == -1) ? "" : (":" + String.valueOf(port))); - args.add("/v:" + hostname); - } - - String user = openUri.getUserInfo(); - if (user != null) { - args.add("/u:" + user); - } - - for (String key : openUri.getQueryParameterNames()) { - String value = openUri.getQueryParameter(key); - - if (value.isEmpty()) { - // Query: key= - // To freerdp argument: /key - args.add("/" + key); - } else if (value.equals("-") || value.equals("+")) { - // Query: key=- or key=+ - // To freerdp argument: -key or +key - args.add(value + key); - } else { - // Query: key=value - // To freerdp argument: /key:value - if (key.equals("drive") && value.equals("sdcard")) { - // Special for sdcard redirect - String path = android.os.Environment.getExternalStorageDirectory().getPath(); - value = "sdcard," + path; - } - - args.add("/" + key + ":" + value); - } - } - - String[] arrayArgs = args.toArray(new String[args.size()]); - return freerdp_parse_arguments(inst, arrayArgs); - } - - public static boolean updateGraphics(long inst, Bitmap bitmap, int x, int y, int width, int height) { - return freerdp_update_graphics(inst, bitmap, x, y, width, height); - } - - public static boolean sendCursorEvent(long inst, int x, int y, int flags) { - return freerdp_send_cursor_event(inst, x, y, flags); - } - - public static boolean sendKeyEvent(long inst, int keycode, boolean down) { - return freerdp_send_key_event(inst, keycode, down); - } - - public static boolean sendUnicodeKeyEvent(long inst, int keycode, boolean down) { - return freerdp_send_unicodekey_event(inst, keycode, down); - } - - public static boolean sendClipboardData(long inst, String data) { - return freerdp_send_clipboard_data(inst, data); - } - - private static void OnConnectionSuccess(long inst) { - if (listener != null) - listener.OnConnectionSuccess(inst); - synchronized (mInstanceState) { - mInstanceState.append(inst, true); - mInstanceState.notifyAll(); - } - } - - private static void OnConnectionFailure(long inst) { - if (listener != null) - listener.OnConnectionFailure(inst); - synchronized (mInstanceState) { - mInstanceState.remove(inst); - mInstanceState.notifyAll(); - } - } - - private static void OnPreConnect(long inst) { - if (listener != null) - listener.OnPreConnect(inst); - } - - private static void OnDisconnecting(long inst) { - if (listener != null) - listener.OnDisconnecting(inst); - } - - private static void OnDisconnected(long inst) { - if (listener != null) - listener.OnDisconnected(inst); - synchronized (mInstanceState) { - mInstanceState.remove(inst); - mInstanceState.notifyAll(); - } - } - - private static void OnSettingsChanged(long inst, int width, int height, int bpp) { - SessionState s = GlobalApp.getSession(inst); - if (s == null) - return; - UIEventListener uiEventListener = s.getUIEventListener(); - if (uiEventListener != null) - uiEventListener.OnSettingsChanged(width, height, bpp); - } - - private static boolean OnAuthenticate(long inst, StringBuilder username, StringBuilder domain, StringBuilder password) { - SessionState s = GlobalApp.getSession(inst); - if (s == null) - return false; - UIEventListener uiEventListener = s.getUIEventListener(); - if (uiEventListener != null) - return uiEventListener.OnAuthenticate(username, domain, password); - return false; - } - - private static boolean OnGatewayAuthenticate(long inst, StringBuilder username, StringBuilder - domain, StringBuilder password) { - SessionState s = GlobalApp.getSession(inst); - if (s == null) - return false; - UIEventListener uiEventListener = s.getUIEventListener(); - if (uiEventListener != null) - return uiEventListener.OnGatewayAuthenticate(username, domain, password); - return false; - } - - private static int OnVerifyCertificate(long inst, String commonName, String subject, - String issuer, String fingerprint, boolean - hostMismatch) { - SessionState s = GlobalApp.getSession(inst); - if (s == null) - return 0; - UIEventListener uiEventListener = s.getUIEventListener(); - if (uiEventListener != null) - return uiEventListener.OnVerifiyCertificate(commonName, subject, issuer, fingerprint, - hostMismatch); - return 0; - } - - private static int OnVerifyChangedCertificate(long inst, String commonName, String subject, - String issuer, String fingerprint, String oldSubject, - String oldIssuer, String oldFingerprint) { - SessionState s = GlobalApp.getSession(inst); - if (s == null) - return 0; - UIEventListener uiEventListener = s.getUIEventListener(); - if (uiEventListener != null) - return uiEventListener.OnVerifyChangedCertificate(commonName, subject, issuer, - fingerprint, oldSubject, oldIssuer, oldFingerprint); - return 0; - } - - private static void OnGraphicsUpdate(long inst, int x, int y, int width, int height) { - SessionState s = GlobalApp.getSession(inst); - if (s == null) - return; - UIEventListener uiEventListener = s.getUIEventListener(); - if (uiEventListener != null) - uiEventListener.OnGraphicsUpdate(x, y, width, height); - } - - private static void OnGraphicsResize(long inst, int width, int height, int bpp) { - SessionState s = GlobalApp.getSession(inst); - if (s == null) - return; - UIEventListener uiEventListener = s.getUIEventListener(); - if (uiEventListener != null) - uiEventListener.OnGraphicsResize(width, height, bpp); - } - - private static void OnRemoteClipboardChanged(long inst, String data) { - SessionState s = GlobalApp.getSession(inst); - if (s == null) - return; - UIEventListener uiEventListener = s.getUIEventListener(); - if (uiEventListener != null) - uiEventListener.OnRemoteClipboardChanged(data); - } - - public static String getVersion() { - return freerdp_get_version(); - } - - public static interface EventListener { - void OnPreConnect(long instance); - - void OnConnectionSuccess(long instance); - - void OnConnectionFailure(long instance); - - void OnDisconnecting(long instance); - - void OnDisconnected(long instance); - } - - public static interface UIEventListener { - void OnSettingsChanged(int width, int height, int bpp); - - boolean OnAuthenticate(StringBuilder username, StringBuilder domain, StringBuilder password); - - boolean OnGatewayAuthenticate(StringBuilder username, StringBuilder domain, StringBuilder - password); - - int OnVerifiyCertificate(String commonName, String subject, - String issuer, String fingerprint, boolean mismatch); - - int OnVerifyChangedCertificate(String commonName, String subject, - String issuer, String fingerprint, String oldSubject, - String oldIssuer, String oldFingerprint); - - void OnGraphicsUpdate(int x, int y, int width, int height); - - void OnGraphicsResize(int width, int height, int bpp); - - void OnRemoteClipboardChanged(String data); - } +public class LibFreeRDP +{ + private static final String TAG = "LibFreeRDP"; + private static EventListener listener; + private static boolean mHasH264 = true; + + private static final LongSparseArray mInstanceState = new LongSparseArray<>(); + + static + { + final String h264 = "openh264"; + final String[] libraries = { h264, + "freerdp-openssl", + "jpeg", + "winpr2", + "freerdp2", + "freerdp-client2", + "freerdp-android2" }; + final String LD_PATH = System.getProperty("java.library.path"); + + for (String lib : libraries) + { + try + { + Log.v(TAG, "Trying to load library " + lib + " from LD_PATH: " + LD_PATH); + System.loadLibrary(lib); + } + catch (UnsatisfiedLinkError e) + { + Log.e(TAG, "Failed to load library " + lib + ": " + e.toString()); + if (lib.equals(h264)) + { + mHasH264 = false; + } + } + } + } + + public static boolean hasH264Support() + { + return mHasH264; + } + + private static native String freerdp_get_jni_version(); + + private static native String freerdp_get_version(); + + private static native String freerdp_get_build_date(); + + private static native String freerdp_get_build_revision(); + + private static native String freerdp_get_build_config(); + + private static native long freerdp_new(Context context); + + private static native void freerdp_free(long inst); + + private static native boolean freerdp_parse_arguments(long inst, String[] args); + + private static native boolean freerdp_connect(long inst); + + private static native boolean freerdp_disconnect(long inst); + + private static native boolean freerdp_update_graphics(long inst, Bitmap bitmap, int x, int y, + int width, int height); + + private static native boolean freerdp_send_cursor_event(long inst, int x, int y, int flags); + + private static native boolean freerdp_send_key_event(long inst, int keycode, boolean down); + + private static native boolean freerdp_send_unicodekey_event(long inst, int keycode, + boolean down); + + private static native boolean freerdp_send_clipboard_data(long inst, String data); + + private static native String freerdp_get_last_error_string(long inst); + + public static void setEventListener(EventListener l) + { + listener = l; + } + + public static long newInstance(Context context) + { + return freerdp_new(context); + } + + public static void freeInstance(long inst) + { + synchronized (mInstanceState) + { + if (mInstanceState.get(inst, false)) + { + freerdp_disconnect(inst); + } + while (mInstanceState.get(inst, false)) + { + try + { + mInstanceState.wait(); + } + catch (InterruptedException e) + { + throw new RuntimeException(); + } + } + } + freerdp_free(inst); + } + + public static boolean connect(long inst) + { + synchronized (mInstanceState) + { + if (mInstanceState.get(inst, false)) + { + throw new RuntimeException("instance already connected"); + } + } + return freerdp_connect(inst); + } + + public static boolean disconnect(long inst) + { + synchronized (mInstanceState) + { + if (mInstanceState.get(inst, false)) + { + return freerdp_disconnect(inst); + } + return true; + } + } + + public static boolean cancelConnection(long inst) + { + synchronized (mInstanceState) + { + if (mInstanceState.get(inst, false)) + { + return freerdp_disconnect(inst); + } + return true; + } + } + + private static String addFlag(String name, boolean enabled) + { + if (enabled) + { + return "+" + name; + } + return "-" + name; + } + + public static boolean setConnectionInfo(Context context, long inst, BookmarkBase bookmark) + { + BookmarkBase.ScreenSettings screenSettings = bookmark.getActiveScreenSettings(); + BookmarkBase.AdvancedSettings advanced = bookmark.getAdvancedSettings(); + BookmarkBase.DebugSettings debug = bookmark.getDebugSettings(); + + String arg; + ArrayList args = new ArrayList(); + + args.add(TAG); + args.add("/gdi:sw"); + + final String clientName = ApplicationSettingsActivity.getClientName(context); + if (!clientName.isEmpty()) + { + args.add("/client-hostname:" + clientName); + } + String certName = ""; + if (bookmark.getType() != BookmarkBase.TYPE_MANUAL) + { + return false; + } + + int port = bookmark.get().getPort(); + String hostname = bookmark.get().getHostname(); + + args.add("/v:" + hostname); + args.add("/port:" + String.valueOf(port)); + + arg = bookmark.getUsername(); + if (!arg.isEmpty()) + { + args.add("/u:" + arg); + } + arg = bookmark.getDomain(); + if (!arg.isEmpty()) + { + args.add("/d:" + arg); + } + arg = bookmark.getPassword(); + if (!arg.isEmpty()) + { + args.add("/p:" + arg); + } + + args.add( + String.format("/size:%dx%d", screenSettings.getWidth(), screenSettings.getHeight())); + args.add("/bpp:" + String.valueOf(screenSettings.getColors())); + + if (advanced.getConsoleMode()) + { + args.add("/admin"); + } + + switch (advanced.getSecurity()) + { + case 3: // NLA + args.add("/sec-nla"); + break; + case 2: // TLS + args.add("/sec-tls"); + break; + case 1: // RDP + args.add("/sec-rdp"); + break; + default: + break; + } + + if (!certName.isEmpty()) + { + args.add("/cert-name:" + certName); + } + + BookmarkBase.PerformanceFlags flags = bookmark.getActivePerformanceFlags(); + if (flags.getRemoteFX()) + { + args.add("/rfx"); + } + + if (flags.getGfx()) + { + args.add("/gfx"); + } + + if (flags.getH264() && mHasH264) + { + args.add("/gfx:AVC444"); + } + + args.add(addFlag("wallpaper", flags.getWallpaper())); + args.add(addFlag("window-drag", flags.getFullWindowDrag())); + args.add(addFlag("menu-anims", flags.getMenuAnimations())); + args.add(addFlag("themes", flags.getTheming())); + args.add(addFlag("fonts", flags.getFontSmoothing())); + args.add(addFlag("aero", flags.getDesktopComposition())); + args.add(addFlag("glyph-cache", false)); + + if (!advanced.getRemoteProgram().isEmpty()) + { + args.add("/shell:" + advanced.getRemoteProgram()); + } + + if (!advanced.getWorkDir().isEmpty()) + { + args.add("/shell-dir:" + advanced.getWorkDir()); + } + + args.add(addFlag("async-channels", debug.getAsyncChannel())); + args.add(addFlag("async-input", debug.getAsyncInput())); + args.add(addFlag("async-update", debug.getAsyncUpdate())); + + if (advanced.getRedirectSDCard()) + { + String path = android.os.Environment.getExternalStorageDirectory().getPath(); + args.add("/drive:sdcard," + path); + } + + args.add("/clipboard"); + + // Gateway enabled? + if (bookmark.getType() == BookmarkBase.TYPE_MANUAL && + bookmark.get().getEnableGatewaySettings()) + { + ManualBookmark.GatewaySettings gateway = + bookmark.get().getGatewaySettings(); + + args.add(String.format("/g:%s:%d", gateway.getHostname(), gateway.getPort())); + + arg = gateway.getUsername(); + if (!arg.isEmpty()) + { + args.add("/gu:" + arg); + } + arg = gateway.getDomain(); + if (!arg.isEmpty()) + { + args.add("/gd:" + arg); + } + arg = gateway.getPassword(); + if (!arg.isEmpty()) + { + args.add("/gp:" + arg); + } + } + + /* 0 ... local + 1 ... remote + 2 ... disable */ + args.add("/audio-mode:" + String.valueOf(advanced.getRedirectSound())); + if (advanced.getRedirectSound() == 0) + { + args.add("/sound"); + } + + if (advanced.getRedirectMicrophone()) + { + args.add("/microphone"); + } + + args.add("/cert-ignore"); + args.add("/log-level:" + debug.getDebugLevel()); + String[] arrayArgs = args.toArray(new String[args.size()]); + return freerdp_parse_arguments(inst, arrayArgs); + } + + public static boolean setConnectionInfo(Context context, long inst, Uri openUri) + { + ArrayList args = new ArrayList<>(); + + // Parse URI from query string. Same key overwrite previous one + // freerdp://user@ip:port/connect?sound=&rfx=&p=password&clipboard=%2b&themes=- + + // Now we only support Software GDI + args.add(TAG); + args.add("/gdi:sw"); + + final String clientName = ApplicationSettingsActivity.getClientName(context); + if (!clientName.isEmpty()) + { + args.add("/client-hostname:" + clientName); + } + + // Parse hostname and port. Set to 'v' argument + String hostname = openUri.getHost(); + int port = openUri.getPort(); + if (hostname != null) + { + hostname = hostname + ((port == -1) ? "" : (":" + String.valueOf(port))); + args.add("/v:" + hostname); + } + + String user = openUri.getUserInfo(); + if (user != null) + { + args.add("/u:" + user); + } + + for (String key : openUri.getQueryParameterNames()) + { + String value = openUri.getQueryParameter(key); + + if (value.isEmpty()) + { + // Query: key= + // To freerdp argument: /key + args.add("/" + key); + } + else if (value.equals("-") || value.equals("+")) + { + // Query: key=- or key=+ + // To freerdp argument: -key or +key + args.add(value + key); + } + else + { + // Query: key=value + // To freerdp argument: /key:value + if (key.equals("drive") && value.equals("sdcard")) + { + // Special for sdcard redirect + String path = android.os.Environment.getExternalStorageDirectory().getPath(); + value = "sdcard," + path; + } + + args.add("/" + key + ":" + value); + } + } + + String[] arrayArgs = args.toArray(new String[args.size()]); + return freerdp_parse_arguments(inst, arrayArgs); + } + + public static boolean updateGraphics(long inst, Bitmap bitmap, int x, int y, int width, + int height) + { + return freerdp_update_graphics(inst, bitmap, x, y, width, height); + } + + public static boolean sendCursorEvent(long inst, int x, int y, int flags) + { + return freerdp_send_cursor_event(inst, x, y, flags); + } + + public static boolean sendKeyEvent(long inst, int keycode, boolean down) + { + return freerdp_send_key_event(inst, keycode, down); + } + + public static boolean sendUnicodeKeyEvent(long inst, int keycode, boolean down) + { + return freerdp_send_unicodekey_event(inst, keycode, down); + } + + public static boolean sendClipboardData(long inst, String data) + { + return freerdp_send_clipboard_data(inst, data); + } + + private static void OnConnectionSuccess(long inst) + { + if (listener != null) + listener.OnConnectionSuccess(inst); + synchronized (mInstanceState) + { + mInstanceState.append(inst, true); + mInstanceState.notifyAll(); + } + } + + private static void OnConnectionFailure(long inst) + { + if (listener != null) + listener.OnConnectionFailure(inst); + synchronized (mInstanceState) + { + mInstanceState.remove(inst); + mInstanceState.notifyAll(); + } + } + + private static void OnPreConnect(long inst) + { + if (listener != null) + listener.OnPreConnect(inst); + } + + private static void OnDisconnecting(long inst) + { + if (listener != null) + listener.OnDisconnecting(inst); + } + + private static void OnDisconnected(long inst) + { + if (listener != null) + listener.OnDisconnected(inst); + synchronized (mInstanceState) + { + mInstanceState.remove(inst); + mInstanceState.notifyAll(); + } + } + + private static void OnSettingsChanged(long inst, int width, int height, int bpp) + { + SessionState s = GlobalApp.getSession(inst); + if (s == null) + return; + UIEventListener uiEventListener = s.getUIEventListener(); + if (uiEventListener != null) + uiEventListener.OnSettingsChanged(width, height, bpp); + } + + private static boolean OnAuthenticate(long inst, StringBuilder username, StringBuilder domain, + StringBuilder password) + { + SessionState s = GlobalApp.getSession(inst); + if (s == null) + return false; + UIEventListener uiEventListener = s.getUIEventListener(); + if (uiEventListener != null) + return uiEventListener.OnAuthenticate(username, domain, password); + return false; + } + + private static boolean OnGatewayAuthenticate(long inst, StringBuilder username, + StringBuilder domain, StringBuilder password) + { + SessionState s = GlobalApp.getSession(inst); + if (s == null) + return false; + UIEventListener uiEventListener = s.getUIEventListener(); + if (uiEventListener != null) + return uiEventListener.OnGatewayAuthenticate(username, domain, password); + return false; + } + + private static int OnVerifyCertificate(long inst, String commonName, String subject, + String issuer, String fingerprint, boolean hostMismatch) + { + SessionState s = GlobalApp.getSession(inst); + if (s == null) + return 0; + UIEventListener uiEventListener = s.getUIEventListener(); + if (uiEventListener != null) + return uiEventListener.OnVerifiyCertificate(commonName, subject, issuer, fingerprint, + hostMismatch); + return 0; + } + + private static int OnVerifyChangedCertificate(long inst, String commonName, String subject, + String issuer, String fingerprint, + String oldSubject, String oldIssuer, + String oldFingerprint) + { + SessionState s = GlobalApp.getSession(inst); + if (s == null) + return 0; + UIEventListener uiEventListener = s.getUIEventListener(); + if (uiEventListener != null) + return uiEventListener.OnVerifyChangedCertificate( + commonName, subject, issuer, fingerprint, oldSubject, oldIssuer, oldFingerprint); + return 0; + } + + private static void OnGraphicsUpdate(long inst, int x, int y, int width, int height) + { + SessionState s = GlobalApp.getSession(inst); + if (s == null) + return; + UIEventListener uiEventListener = s.getUIEventListener(); + if (uiEventListener != null) + uiEventListener.OnGraphicsUpdate(x, y, width, height); + } + + private static void OnGraphicsResize(long inst, int width, int height, int bpp) + { + SessionState s = GlobalApp.getSession(inst); + if (s == null) + return; + UIEventListener uiEventListener = s.getUIEventListener(); + if (uiEventListener != null) + uiEventListener.OnGraphicsResize(width, height, bpp); + } + + private static void OnRemoteClipboardChanged(long inst, String data) + { + SessionState s = GlobalApp.getSession(inst); + if (s == null) + return; + UIEventListener uiEventListener = s.getUIEventListener(); + if (uiEventListener != null) + uiEventListener.OnRemoteClipboardChanged(data); + } + + public static String getVersion() + { + return freerdp_get_version(); + } + + public static interface EventListener { + void OnPreConnect(long instance); + + void OnConnectionSuccess(long instance); + + void OnConnectionFailure(long instance); + + void OnDisconnecting(long instance); + + void OnDisconnected(long instance); + } + + public static interface UIEventListener { + void OnSettingsChanged(int width, int height, int bpp); + + boolean OnAuthenticate(StringBuilder username, StringBuilder domain, + StringBuilder password); + + boolean OnGatewayAuthenticate(StringBuilder username, StringBuilder domain, + StringBuilder password); + + int OnVerifiyCertificate(String commonName, String subject, String issuer, + String fingerprint, boolean mismatch); + + int OnVerifyChangedCertificate(String commonName, String subject, String issuer, + String fingerprint, String oldSubject, String oldIssuer, + String oldFingerprint); + + void OnGraphicsUpdate(int x, int y, int width, int height); + + void OnGraphicsResize(int width, int height, int bpp); + + void OnRemoteClipboardChanged(String data); + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/ManualBookmarkGateway.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/ManualBookmarkGateway.java index 64df814d7..2cd275163 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/ManualBookmarkGateway.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/ManualBookmarkGateway.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.services; @@ -18,96 +19,113 @@ import com.freerdp.freerdpcore.domain.ManualBookmark; import java.util.ArrayList; -public class ManualBookmarkGateway extends BookmarkBaseGateway { +public class ManualBookmarkGateway extends BookmarkBaseGateway +{ - public ManualBookmarkGateway(SQLiteOpenHelper bookmarkDB) { - super(bookmarkDB); - } + public ManualBookmarkGateway(SQLiteOpenHelper bookmarkDB) + { + super(bookmarkDB); + } - @Override - protected BookmarkBase createBookmark() { - return new ManualBookmark(); - } + @Override protected BookmarkBase createBookmark() + { + return new ManualBookmark(); + } - @Override - protected String getBookmarkTableName() { - return BookmarkDB.DB_TABLE_BOOKMARK; - } + @Override protected String getBookmarkTableName() + { + return BookmarkDB.DB_TABLE_BOOKMARK; + } - @Override - protected void addBookmarkSpecificColumns(BookmarkBase bookmark, ContentValues columns) { - ManualBookmark bm = (ManualBookmark) bookmark; - columns.put(BookmarkDB.DB_KEY_BOOKMARK_HOSTNAME, bm.getHostname()); - columns.put(BookmarkDB.DB_KEY_BOOKMARK_PORT, bm.getPort()); + @Override + protected void addBookmarkSpecificColumns(BookmarkBase bookmark, ContentValues columns) + { + ManualBookmark bm = (ManualBookmark)bookmark; + columns.put(BookmarkDB.DB_KEY_BOOKMARK_HOSTNAME, bm.getHostname()); + columns.put(BookmarkDB.DB_KEY_BOOKMARK_PORT, bm.getPort()); - // gateway settings - columns.put(BookmarkDB.DB_KEY_BOOKMARK_GW_ENABLE, bm.getEnableGatewaySettings()); - columns.put(BookmarkDB.DB_KEY_BOOKMARK_GW_HOSTNAME, bm.getGatewaySettings().getHostname()); - columns.put(BookmarkDB.DB_KEY_BOOKMARK_GW_PORT, bm.getGatewaySettings().getPort()); - columns.put(BookmarkDB.DB_KEY_BOOKMARK_GW_USERNAME, bm.getGatewaySettings().getUsername()); - columns.put(BookmarkDB.DB_KEY_BOOKMARK_GW_PASSWORD, bm.getGatewaySettings().getPassword()); - columns.put(BookmarkDB.DB_KEY_BOOKMARK_GW_DOMAIN, bm.getGatewaySettings().getDomain()); - } + // gateway settings + columns.put(BookmarkDB.DB_KEY_BOOKMARK_GW_ENABLE, bm.getEnableGatewaySettings()); + columns.put(BookmarkDB.DB_KEY_BOOKMARK_GW_HOSTNAME, bm.getGatewaySettings().getHostname()); + columns.put(BookmarkDB.DB_KEY_BOOKMARK_GW_PORT, bm.getGatewaySettings().getPort()); + columns.put(BookmarkDB.DB_KEY_BOOKMARK_GW_USERNAME, bm.getGatewaySettings().getUsername()); + columns.put(BookmarkDB.DB_KEY_BOOKMARK_GW_PASSWORD, bm.getGatewaySettings().getPassword()); + columns.put(BookmarkDB.DB_KEY_BOOKMARK_GW_DOMAIN, bm.getGatewaySettings().getDomain()); + } - @Override - protected void addBookmarkSpecificColumns(ArrayList columns) { - columns.add(BookmarkDB.DB_KEY_BOOKMARK_HOSTNAME); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_PORT); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_GW_ENABLE); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_GW_HOSTNAME); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_GW_PORT); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_GW_USERNAME); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_GW_PASSWORD); - columns.add(BookmarkDB.DB_KEY_BOOKMARK_GW_DOMAIN); - } + @Override protected void addBookmarkSpecificColumns(ArrayList columns) + { + columns.add(BookmarkDB.DB_KEY_BOOKMARK_HOSTNAME); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_PORT); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_GW_ENABLE); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_GW_HOSTNAME); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_GW_PORT); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_GW_USERNAME); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_GW_PASSWORD); + columns.add(BookmarkDB.DB_KEY_BOOKMARK_GW_DOMAIN); + } - @Override - protected void readBookmarkSpecificColumns(BookmarkBase bookmark, Cursor cursor) { - ManualBookmark bm = (ManualBookmark) bookmark; - bm.setHostname(cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_HOSTNAME))); - bm.setPort(cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_PORT))); + @Override protected void readBookmarkSpecificColumns(BookmarkBase bookmark, Cursor cursor) + { + ManualBookmark bm = (ManualBookmark)bookmark; + bm.setHostname( + cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_HOSTNAME))); + bm.setPort(cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_PORT))); - bm.setEnableGatewaySettings(cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_GW_ENABLE)) != 0); - readGatewaySettings(bm, cursor); - } + bm.setEnableGatewaySettings( + cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_GW_ENABLE)) != 0); + readGatewaySettings(bm, cursor); + } - public BookmarkBase findByLabelOrHostname(String pattern) { - if (pattern.length() == 0) - return null; + public BookmarkBase findByLabelOrHostname(String pattern) + { + if (pattern.length() == 0) + return null; - Cursor cursor = queryBookmarks(BookmarkDB.DB_KEY_BOOKMARK_LABEL + " = '" + pattern + - "' OR " + BookmarkDB.DB_KEY_BOOKMARK_HOSTNAME + " = '" + pattern + "'", - BookmarkDB.DB_KEY_BOOKMARK_LABEL); - BookmarkBase bookmark = null; - if (cursor.moveToFirst() && (cursor.getCount() > 0)) - bookmark = getBookmarkFromCursor(cursor); + Cursor cursor = + queryBookmarks(BookmarkDB.DB_KEY_BOOKMARK_LABEL + " = '" + pattern + "' OR " + + BookmarkDB.DB_KEY_BOOKMARK_HOSTNAME + " = '" + pattern + "'", + BookmarkDB.DB_KEY_BOOKMARK_LABEL); + BookmarkBase bookmark = null; + if (cursor.moveToFirst() && (cursor.getCount() > 0)) + bookmark = getBookmarkFromCursor(cursor); - cursor.close(); - return bookmark; - } + cursor.close(); + return bookmark; + } - public ArrayList findByLabelOrHostnameLike(String pattern) { - Cursor cursor = queryBookmarks(BookmarkDB.DB_KEY_BOOKMARK_LABEL + " LIKE '%" + - pattern + "%' OR " + BookmarkDB.DB_KEY_BOOKMARK_HOSTNAME + " LIKE '%" + - pattern + "%'", BookmarkDB.DB_KEY_BOOKMARK_LABEL); - ArrayList bookmarks = new ArrayList(cursor.getCount()); + public ArrayList findByLabelOrHostnameLike(String pattern) + { + Cursor cursor = + queryBookmarks(BookmarkDB.DB_KEY_BOOKMARK_LABEL + " LIKE '%" + pattern + "%' OR " + + BookmarkDB.DB_KEY_BOOKMARK_HOSTNAME + " LIKE '%" + pattern + "%'", + BookmarkDB.DB_KEY_BOOKMARK_LABEL); + ArrayList bookmarks = new ArrayList(cursor.getCount()); - if (cursor.moveToFirst() && (cursor.getCount() > 0)) { - do { - bookmarks.add(getBookmarkFromCursor(cursor)); - } while (cursor.moveToNext()); - } + if (cursor.moveToFirst() && (cursor.getCount() > 0)) + { + do + { + bookmarks.add(getBookmarkFromCursor(cursor)); + } while (cursor.moveToNext()); + } - cursor.close(); - return bookmarks; - } + cursor.close(); + return bookmarks; + } - private void readGatewaySettings(ManualBookmark bookmark, Cursor cursor) { - ManualBookmark.GatewaySettings gatewaySettings = bookmark.getGatewaySettings(); - gatewaySettings.setHostname(cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_GW_HOSTNAME))); - gatewaySettings.setPort(cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_GW_PORT))); - gatewaySettings.setUsername(cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_GW_USERNAME))); - gatewaySettings.setPassword(cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_GW_PASSWORD))); - gatewaySettings.setDomain(cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_GW_DOMAIN))); - } + private void readGatewaySettings(ManualBookmark bookmark, Cursor cursor) + { + ManualBookmark.GatewaySettings gatewaySettings = bookmark.getGatewaySettings(); + gatewaySettings.setHostname( + cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_GW_HOSTNAME))); + gatewaySettings.setPort( + cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_GW_PORT))); + gatewaySettings.setUsername( + cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_GW_USERNAME))); + gatewaySettings.setPassword( + cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_GW_PASSWORD))); + gatewaySettings.setDomain( + cursor.getString(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_GW_DOMAIN))); + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/QuickConnectHistoryGateway.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/QuickConnectHistoryGateway.java index 7d97243f3..4dd51398f 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/QuickConnectHistoryGateway.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/QuickConnectHistoryGateway.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.services; @@ -21,76 +22,100 @@ import com.freerdp.freerdpcore.domain.QuickConnectBookmark; import java.util.ArrayList; +public class QuickConnectHistoryGateway +{ + private final static String TAG = "QuickConnectHistoryGateway"; + private SQLiteOpenHelper historyDB; -public class QuickConnectHistoryGateway { - private final static String TAG = "QuickConnectHistoryGateway"; - private SQLiteOpenHelper historyDB; + public QuickConnectHistoryGateway(SQLiteOpenHelper historyDB) + { + this.historyDB = historyDB; + } + public ArrayList findHistory(String filter) + { + String[] column = { HistoryDB.QUICK_CONNECT_TABLE_COL_ITEM }; - public QuickConnectHistoryGateway(SQLiteOpenHelper historyDB) { - this.historyDB = historyDB; - } + SQLiteDatabase db = getReadableDatabase(); + String selection = + (filter.length() > 0) + ? (HistoryDB.QUICK_CONNECT_TABLE_COL_ITEM + " LIKE '%" + filter + "%'") + : null; + Cursor cursor = db.query(HistoryDB.QUICK_CONNECT_TABLE_NAME, column, selection, null, null, + null, HistoryDB.QUICK_CONNECT_TABLE_COL_TIMESTAMP); - public ArrayList findHistory(String filter) { - String[] column = {HistoryDB.QUICK_CONNECT_TABLE_COL_ITEM}; + ArrayList result = new ArrayList(cursor.getCount()); + if (cursor.moveToFirst()) + { + do + { + String hostname = + cursor.getString(cursor.getColumnIndex(HistoryDB.QUICK_CONNECT_TABLE_COL_ITEM)); + QuickConnectBookmark bookmark = new QuickConnectBookmark(); + bookmark.setLabel(hostname); + bookmark.setHostname(hostname); + result.add(bookmark); + } while (cursor.moveToNext()); + } + cursor.close(); + return result; + } - SQLiteDatabase db = getReadableDatabase(); - String selection = (filter.length() > 0) ? (HistoryDB.QUICK_CONNECT_TABLE_COL_ITEM + " LIKE '%" + filter + "%'") : null; - Cursor cursor = db.query(HistoryDB.QUICK_CONNECT_TABLE_NAME, column, selection, null, null, null, HistoryDB.QUICK_CONNECT_TABLE_COL_TIMESTAMP); + public void addHistoryItem(String item) + { + String insertHistoryItem = "INSERT OR REPLACE INTO " + HistoryDB.QUICK_CONNECT_TABLE_NAME + + " (" + HistoryDB.QUICK_CONNECT_TABLE_COL_ITEM + ", " + + HistoryDB.QUICK_CONNECT_TABLE_COL_TIMESTAMP + ") VALUES('" + + item + "', datetime('now'))"; + SQLiteDatabase db = getWritableDatabase(); + try + { + db.execSQL(insertHistoryItem); + } + catch (SQLException e) + { + Log.v(TAG, e.toString()); + } + } - ArrayList result = new ArrayList(cursor.getCount()); - if (cursor.moveToFirst()) { - do { - String hostname = cursor.getString(cursor.getColumnIndex(HistoryDB.QUICK_CONNECT_TABLE_COL_ITEM)); - QuickConnectBookmark bookmark = new QuickConnectBookmark(); - bookmark.setLabel(hostname); - bookmark.setHostname(hostname); - result.add(bookmark); - } while (cursor.moveToNext()); - } - cursor.close(); - return result; - } + public boolean historyItemExists(String item) + { + String[] column = { HistoryDB.QUICK_CONNECT_TABLE_COL_ITEM }; + SQLiteDatabase db = getReadableDatabase(); + Cursor cursor = db.query(HistoryDB.QUICK_CONNECT_TABLE_NAME, column, + HistoryDB.QUICK_CONNECT_TABLE_COL_ITEM + " = '" + item + "'", null, + null, null, null); + boolean exists = (cursor.getCount() == 1); + cursor.close(); + return exists; + } - public void addHistoryItem(String item) { - String insertHistoryItem = "INSERT OR REPLACE INTO " + HistoryDB.QUICK_CONNECT_TABLE_NAME + " (" + - HistoryDB.QUICK_CONNECT_TABLE_COL_ITEM + ", " + HistoryDB.QUICK_CONNECT_TABLE_COL_TIMESTAMP + ") VALUES('" + item + "', datetime('now'))"; - SQLiteDatabase db = getWritableDatabase(); - try { - db.execSQL(insertHistoryItem); - } catch (SQLException e) { - Log.v(TAG, e.toString()); - } - } + public void removeHistoryItem(String hostname) + { + SQLiteDatabase db = getWritableDatabase(); + db.delete(HistoryDB.QUICK_CONNECT_TABLE_NAME, + HistoryDB.QUICK_CONNECT_TABLE_COL_ITEM + " = '" + hostname + "'", null); + } - public boolean historyItemExists(String item) { - String[] column = {HistoryDB.QUICK_CONNECT_TABLE_COL_ITEM}; - SQLiteDatabase db = getReadableDatabase(); - Cursor cursor = db.query(HistoryDB.QUICK_CONNECT_TABLE_NAME, column, HistoryDB.QUICK_CONNECT_TABLE_COL_ITEM + " = '" + item + "'", null, null, null, null); - boolean exists = (cursor.getCount() == 1); - cursor.close(); - return exists; - } + // safety wrappers + // in case of getReadableDatabase it could happen that upgradeDB gets called which is + // a problem if the DB is only readable + private SQLiteDatabase getWritableDatabase() + { + return historyDB.getWritableDatabase(); + } - public void removeHistoryItem(String hostname) { - SQLiteDatabase db = getWritableDatabase(); - db.delete(HistoryDB.QUICK_CONNECT_TABLE_NAME, HistoryDB.QUICK_CONNECT_TABLE_COL_ITEM + " = '" + hostname + "'", null); - } - - // safety wrappers - // in case of getReadableDatabase it could happen that upgradeDB gets called which is - // a problem if the DB is only readable - private SQLiteDatabase getWritableDatabase() { - return historyDB.getWritableDatabase(); - } - - private SQLiteDatabase getReadableDatabase() { - SQLiteDatabase db; - try { - db = historyDB.getReadableDatabase(); - } catch (SQLiteException e) { - db = historyDB.getWritableDatabase(); - } - return db; - } + private SQLiteDatabase getReadableDatabase() + { + SQLiteDatabase db; + try + { + db = historyDB.getReadableDatabase(); + } + catch (SQLiteException e) + { + db = historyDB.getWritableDatabase(); + } + return db; + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/SessionRequestHandlerActivity.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/SessionRequestHandlerActivity.java index 6239acadd..772b3a3ef 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/SessionRequestHandlerActivity.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/SessionRequestHandlerActivity.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.services; @@ -19,54 +20,58 @@ import com.freerdp.freerdpcore.domain.ConnectionReference; import com.freerdp.freerdpcore.presentation.BookmarkActivity; import com.freerdp.freerdpcore.presentation.SessionActivity; +public class SessionRequestHandlerActivity extends AppCompatActivity +{ -public class SessionRequestHandlerActivity extends AppCompatActivity { + @Override public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + handleIntent(getIntent()); + } - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - handleIntent(getIntent()); - } + @Override protected void onNewIntent(Intent intent) + { + setIntent(intent); + handleIntent(intent); + } - @Override - protected void onNewIntent(Intent intent) { - setIntent(intent); - handleIntent(intent); - } + private void startSessionWithConnectionReference(String refStr) + { - private void startSessionWithConnectionReference(String refStr) { + Bundle bundle = new Bundle(); + bundle.putString(SessionActivity.PARAM_CONNECTION_REFERENCE, refStr); + Intent sessionIntent = new Intent(this, SessionActivity.class); + sessionIntent.putExtras(bundle); - Bundle bundle = new Bundle(); - bundle.putString(SessionActivity.PARAM_CONNECTION_REFERENCE, refStr); - Intent sessionIntent = new Intent(this, SessionActivity.class); - sessionIntent.putExtras(bundle); + startActivityForResult(sessionIntent, 0); + } - startActivityForResult(sessionIntent, 0); - } + private void editBookmarkWithConnectionReference(String refStr) + { + Bundle bundle = new Bundle(); + bundle.putString(BookmarkActivity.PARAM_CONNECTION_REFERENCE, refStr); + Intent bookmarkIntent = new Intent(this.getApplicationContext(), BookmarkActivity.class); + bookmarkIntent.putExtras(bundle); + startActivityForResult(bookmarkIntent, 0); + } - private void editBookmarkWithConnectionReference(String refStr) { - Bundle bundle = new Bundle(); - bundle.putString(BookmarkActivity.PARAM_CONNECTION_REFERENCE, refStr); - Intent bookmarkIntent = new Intent(this.getApplicationContext(), BookmarkActivity.class); - bookmarkIntent.putExtras(bundle); - startActivityForResult(bookmarkIntent, 0); - } + private void handleIntent(Intent intent) + { - private void handleIntent(Intent intent) { + String action = intent.getAction(); + if (Intent.ACTION_SEARCH.equals(action)) + startSessionWithConnectionReference(ConnectionReference.getHostnameReference( + intent.getStringExtra(SearchManager.QUERY))); + else if (Intent.ACTION_VIEW.equals(action)) + startSessionWithConnectionReference(intent.getDataString()); + else if (Intent.ACTION_EDIT.equals(action)) + editBookmarkWithConnectionReference(intent.getDataString()); + } - String action = intent.getAction(); - if (Intent.ACTION_SEARCH.equals(action)) - startSessionWithConnectionReference(ConnectionReference.getHostnameReference(intent.getStringExtra(SearchManager.QUERY))); - else if (Intent.ACTION_VIEW.equals(action)) - startSessionWithConnectionReference(intent.getDataString()); - else if (Intent.ACTION_EDIT.equals(action)) - editBookmarkWithConnectionReference(intent.getDataString()); - } - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - super.onActivityResult(requestCode, resultCode, data); - this.setResult(resultCode); - this.finish(); - } + @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) + { + super.onActivityResult(requestCode, resultCode, data); + this.setResult(resultCode); + this.finish(); + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/AppCompatPreferenceActivity.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/AppCompatPreferenceActivity.java index 3e7aaa3cb..73377fa59 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/AppCompatPreferenceActivity.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/AppCompatPreferenceActivity.java @@ -13,95 +13,100 @@ import android.view.MenuInflater; import android.view.View; import android.view.ViewGroup; -public abstract class AppCompatPreferenceActivity extends PreferenceActivity { +public abstract class AppCompatPreferenceActivity extends PreferenceActivity +{ - private AppCompatDelegate mDelegate; + private AppCompatDelegate mDelegate; - @Override - protected void onCreate(Bundle savedInstanceState) { - getDelegate().installViewFactory(); - getDelegate().onCreate(savedInstanceState); - super.onCreate(savedInstanceState); - } + @Override protected void onCreate(Bundle savedInstanceState) + { + getDelegate().installViewFactory(); + getDelegate().onCreate(savedInstanceState); + super.onCreate(savedInstanceState); + } - @Override - protected void onPostCreate(Bundle savedInstanceState) { - super.onPostCreate(savedInstanceState); - getDelegate().onPostCreate(savedInstanceState); - } + @Override protected void onPostCreate(Bundle savedInstanceState) + { + super.onPostCreate(savedInstanceState); + getDelegate().onPostCreate(savedInstanceState); + } - public ActionBar getSupportActionBar() { - return getDelegate().getSupportActionBar(); - } + public ActionBar getSupportActionBar() + { + return getDelegate().getSupportActionBar(); + } - public void setSupportActionBar(@Nullable Toolbar toolbar) { - getDelegate().setSupportActionBar(toolbar); - } + public void setSupportActionBar(@Nullable Toolbar toolbar) + { + getDelegate().setSupportActionBar(toolbar); + } - @Override - @NonNull - public MenuInflater getMenuInflater() { - return getDelegate().getMenuInflater(); - } + @Override @NonNull public MenuInflater getMenuInflater() + { + return getDelegate().getMenuInflater(); + } - @Override - public void setContentView(@LayoutRes int layoutResID) { - getDelegate().setContentView(layoutResID); - } + @Override public void setContentView(@LayoutRes int layoutResID) + { + getDelegate().setContentView(layoutResID); + } - @Override - public void setContentView(View view) { - getDelegate().setContentView(view); - } + @Override public void setContentView(View view) + { + getDelegate().setContentView(view); + } - @Override - public void setContentView(View view, ViewGroup.LayoutParams params) { - getDelegate().setContentView(view, params); - } + @Override public void setContentView(View view, ViewGroup.LayoutParams params) + { + getDelegate().setContentView(view, params); + } - @Override - public void addContentView(View view, ViewGroup.LayoutParams params) { - getDelegate().addContentView(view, params); - } + @Override public void addContentView(View view, ViewGroup.LayoutParams params) + { + getDelegate().addContentView(view, params); + } - @Override - protected void onPostResume() { - super.onPostResume(); - getDelegate().onPostResume(); - } + @Override protected void onPostResume() + { + super.onPostResume(); + getDelegate().onPostResume(); + } - @Override - protected void onTitleChanged(CharSequence title, int color) { - super.onTitleChanged(title, color); - getDelegate().setTitle(title); - } + @Override protected void onTitleChanged(CharSequence title, int color) + { + super.onTitleChanged(title, color); + getDelegate().setTitle(title); + } - @Override - public void onConfigurationChanged(Configuration newConfig) { - super.onConfigurationChanged(newConfig); - getDelegate().onConfigurationChanged(newConfig); - } + @Override public void onConfigurationChanged(Configuration newConfig) + { + super.onConfigurationChanged(newConfig); + getDelegate().onConfigurationChanged(newConfig); + } - @Override - protected void onStop() { - super.onStop(); - getDelegate().onStop(); - } + @Override protected void onStop() + { + super.onStop(); + getDelegate().onStop(); + } - @Override - protected void onDestroy() { - super.onDestroy(); - getDelegate().onDestroy(); - } + @Override protected void onDestroy() + { + super.onDestroy(); + getDelegate().onDestroy(); + } - public void invalidateOptionsMenu() { - getDelegate().invalidateOptionsMenu(); - } + public void invalidateOptionsMenu() + { + getDelegate().invalidateOptionsMenu(); + } - private AppCompatDelegate getDelegate() { - if (mDelegate == null) { - mDelegate = AppCompatDelegate.create(this, null); - } - return mDelegate; - } + private AppCompatDelegate getDelegate() + { + if (mDelegate == null) + { + mDelegate = AppCompatDelegate.create(this, null); + } + return mDelegate; + } } \ No newline at end of file diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/BookmarkArrayAdapter.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/BookmarkArrayAdapter.java index 4968c571a..6c6de6acc 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/BookmarkArrayAdapter.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/BookmarkArrayAdapter.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.utils; @@ -29,89 +30,106 @@ import com.freerdp.freerdpcore.presentation.BookmarkActivity; import java.util.List; -public class BookmarkArrayAdapter extends ArrayAdapter { +public class BookmarkArrayAdapter extends ArrayAdapter +{ - public BookmarkArrayAdapter(Context context, int textViewResourceId, List objects) { - super(context, textViewResourceId, objects); - } + public BookmarkArrayAdapter(Context context, int textViewResourceId, List objects) + { + super(context, textViewResourceId, objects); + } - @Override - public View getView(int position, View convertView, ViewGroup parent) { - View curView = convertView; - if (curView == null) { - LayoutInflater vi = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - curView = vi.inflate(R.layout.bookmark_list_item, null); - } + @Override public View getView(int position, View convertView, ViewGroup parent) + { + View curView = convertView; + if (curView == null) + { + LayoutInflater vi = + (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + curView = vi.inflate(R.layout.bookmark_list_item, null); + } - BookmarkBase bookmark = getItem(position); - TextView label = (TextView) curView.findViewById(R.id.bookmark_text1); - TextView hostname = (TextView) curView.findViewById(R.id.bookmark_text2); - ImageView star_icon = (ImageView) curView.findViewById(R.id.bookmark_icon2); - assert label != null; - assert hostname != null; + BookmarkBase bookmark = getItem(position); + TextView label = (TextView)curView.findViewById(R.id.bookmark_text1); + TextView hostname = (TextView)curView.findViewById(R.id.bookmark_text2); + ImageView star_icon = (ImageView)curView.findViewById(R.id.bookmark_icon2); + assert label != null; + assert hostname != null; - label.setText(bookmark.getLabel()); - star_icon.setVisibility(View.VISIBLE); + label.setText(bookmark.getLabel()); + star_icon.setVisibility(View.VISIBLE); - String refStr; - if (bookmark.getType() == BookmarkBase.TYPE_MANUAL) { - hostname.setText(bookmark.get().getHostname()); - refStr = ConnectionReference.getManualBookmarkReference(bookmark.getId()); - star_icon.setImageResource(R.drawable.icon_star_on); - } else if (bookmark.getType() == BookmarkBase.TYPE_QUICKCONNECT) { - // just set an empty hostname (with a blank) - the hostname is already displayed in the label - // and in case we just set it to "" the textview will shrunk - hostname.setText(" "); - refStr = ConnectionReference.getHostnameReference(bookmark.getLabel()); - star_icon.setImageResource(R.drawable.icon_star_off); - } else if (bookmark.getType() == BookmarkBase.TYPE_PLACEHOLDER) { - hostname.setText(" "); - refStr = ConnectionReference.getPlaceholderReference(bookmark.get().getName()); - star_icon.setVisibility(View.GONE); - } else { - // unknown bookmark type... - refStr = ""; - assert false; - } + String refStr; + if (bookmark.getType() == BookmarkBase.TYPE_MANUAL) + { + hostname.setText(bookmark.get().getHostname()); + refStr = ConnectionReference.getManualBookmarkReference(bookmark.getId()); + star_icon.setImageResource(R.drawable.icon_star_on); + } + else if (bookmark.getType() == BookmarkBase.TYPE_QUICKCONNECT) + { + // just set an empty hostname (with a blank) - the hostname is already displayed in the + // label and in case we just set it to "" the textview will shrunk + hostname.setText(" "); + refStr = ConnectionReference.getHostnameReference(bookmark.getLabel()); + star_icon.setImageResource(R.drawable.icon_star_off); + } + else if (bookmark.getType() == BookmarkBase.TYPE_PLACEHOLDER) + { + hostname.setText(" "); + refStr = ConnectionReference.getPlaceholderReference( + bookmark.get().getName()); + star_icon.setVisibility(View.GONE); + } + else + { + // unknown bookmark type... + refStr = ""; + assert false; + } - star_icon.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - // start bookmark editor - Bundle bundle = new Bundle(); - String refStr = v.getTag().toString(); - bundle.putString(BookmarkActivity.PARAM_CONNECTION_REFERENCE, refStr); + star_icon.setOnClickListener(new OnClickListener() { + @Override public void onClick(View v) + { + // start bookmark editor + Bundle bundle = new Bundle(); + String refStr = v.getTag().toString(); + bundle.putString(BookmarkActivity.PARAM_CONNECTION_REFERENCE, refStr); - Intent bookmarkIntent = new Intent(getContext(), BookmarkActivity.class); - bookmarkIntent.putExtras(bundle); - getContext().startActivity(bookmarkIntent); - } - }); + Intent bookmarkIntent = new Intent(getContext(), BookmarkActivity.class); + bookmarkIntent.putExtras(bundle); + getContext().startActivity(bookmarkIntent); + } + }); - curView.setTag(refStr); - star_icon.setTag(refStr); + curView.setTag(refStr); + star_icon.setTag(refStr); - return curView; - } + return curView; + } - public void addItems(List newItems) { - for (BookmarkBase item : newItems) - add(item); - } + public void addItems(List newItems) + { + for (BookmarkBase item : newItems) + add(item); + } - public void replaceItems(List newItems) { - clear(); - for (BookmarkBase item : newItems) - add(item); - } + public void replaceItems(List newItems) + { + clear(); + for (BookmarkBase item : newItems) + add(item); + } - public void remove(long bookmarkId) { - for (int i = 0; i < getCount(); i++) { - BookmarkBase bm = getItem(i); - if (bm.getId() == bookmarkId) { - remove(bm); - return; - } - } - } + public void remove(long bookmarkId) + { + for (int i = 0; i < getCount(); i++) + { + BookmarkBase bm = getItem(i); + if (bm.getId() == bookmarkId) + { + remove(bm); + return; + } + } + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/ButtonPreference.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/ButtonPreference.java index 7248932a4..72c8cf081 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/ButtonPreference.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/ButtonPreference.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.utils; @@ -20,67 +21,76 @@ import android.widget.LinearLayout; import com.freerdp.freerdpcore.R; -public class ButtonPreference extends Preference { +public class ButtonPreference extends Preference +{ - private OnClickListener buttonOnClickListener; - private String buttonText; - private Button button; + private OnClickListener buttonOnClickListener; + private String buttonText; + private Button button; - public ButtonPreference(Context context) { - super(context); - init(); - } + public ButtonPreference(Context context) + { + super(context); + init(); + } - public ButtonPreference(Context context, AttributeSet attrs) { - super(context, attrs); - init(); - } + public ButtonPreference(Context context, AttributeSet attrs) + { + super(context, attrs); + init(); + } - public ButtonPreference(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - init(); - } + public ButtonPreference(Context context, AttributeSet attrs, int defStyle) + { + super(context, attrs, defStyle); + init(); + } - private void init() { - setLayoutResource(R.layout.button_preference); - button = null; - buttonText = null; - buttonOnClickListener = null; - } + private void init() + { + setLayoutResource(R.layout.button_preference); + button = null; + buttonText = null; + buttonOnClickListener = null; + } - @Override - public View getView(View convertView, ViewGroup parent) { - View v = super.getView(convertView, parent); - button = (Button) v.findViewById(R.id.preference_button); - if (buttonText != null) - button.setText(buttonText); - if (buttonOnClickListener != null) - button.setOnClickListener(buttonOnClickListener); + @Override public View getView(View convertView, ViewGroup parent) + { + View v = super.getView(convertView, parent); + button = (Button)v.findViewById(R.id.preference_button); + if (buttonText != null) + button.setText(buttonText); + if (buttonOnClickListener != null) + button.setOnClickListener(buttonOnClickListener); - // additional init for ICS - make widget frame visible - // refer to http://stackoverflow.com/questions/8762984/custom-preference-broken-in-honeycomb-ics - LinearLayout widgetFrameView = ((LinearLayout) v.findViewById(android.R.id.widget_frame)); - widgetFrameView.setVisibility(View.VISIBLE); + // additional init for ICS - make widget frame visible + // refer to + // http://stackoverflow.com/questions/8762984/custom-preference-broken-in-honeycomb-ics + LinearLayout widgetFrameView = ((LinearLayout)v.findViewById(android.R.id.widget_frame)); + widgetFrameView.setVisibility(View.VISIBLE); - return v; - } + return v; + } - public void setButtonText(int resId) { - buttonText = getContext().getResources().getString(resId); - if (button != null) - button.setText(buttonText); - } + public void setButtonText(int resId) + { + buttonText = getContext().getResources().getString(resId); + if (button != null) + button.setText(buttonText); + } - public void setButtonText(String text) { - buttonText = text; - if (button != null) - button.setText(text); - } + public void setButtonText(String text) + { + buttonText = text; + if (button != null) + button.setText(text); + } - public void setButtonOnClickListener(OnClickListener listener) { - if (button != null) - button.setOnClickListener(listener); - else - buttonOnClickListener = listener; - } + public void setButtonOnClickListener(OnClickListener listener) + { + if (button != null) + button.setOnClickListener(listener); + else + buttonOnClickListener = listener; + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/ClipboardManagerProxy.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/ClipboardManagerProxy.java index dce3b1bc9..cb26ddb38 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/ClipboardManagerProxy.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/ClipboardManagerProxy.java @@ -7,87 +7,94 @@ import android.content.Context; import android.os.Build.VERSION; import android.os.Build.VERSION_CODES; -public abstract class ClipboardManagerProxy { +public abstract class ClipboardManagerProxy +{ - public static ClipboardManagerProxy getClipboardManager(Context ctx) { - if (VERSION.SDK_INT < VERSION_CODES.HONEYCOMB) - return new PreHCClipboardManager(ctx); - else - return new HCClipboardManager(ctx); - } + public static ClipboardManagerProxy getClipboardManager(Context ctx) + { + if (VERSION.SDK_INT < VERSION_CODES.HONEYCOMB) + return new PreHCClipboardManager(ctx); + else + return new HCClipboardManager(ctx); + } - public abstract void setClipboardData(String data); + public abstract void setClipboardData(String data); - public abstract void addClipboardChangedListener(OnClipboardChangedListener listener); + public abstract void addClipboardChangedListener(OnClipboardChangedListener listener); - public abstract void removeClipboardboardChangedListener(OnClipboardChangedListener listener); + public abstract void removeClipboardboardChangedListener(OnClipboardChangedListener listener); - public static interface OnClipboardChangedListener { - void onClipboardChanged(String data); - } + public static interface OnClipboardChangedListener { + void onClipboardChanged(String data); + } - private static class PreHCClipboardManager extends ClipboardManagerProxy { + private static class PreHCClipboardManager extends ClipboardManagerProxy + { - public PreHCClipboardManager(Context ctx) { + public PreHCClipboardManager(Context ctx) + { + } - } + @Override public void setClipboardData(String data) + { + } - @Override - public void setClipboardData(String data) { - } + @Override public void addClipboardChangedListener(OnClipboardChangedListener listener) + { + } - @Override - public void addClipboardChangedListener( - OnClipboardChangedListener listener) { - } + @Override + public void removeClipboardboardChangedListener(OnClipboardChangedListener listener) + { + } + } - @Override - public void removeClipboardboardChangedListener( - OnClipboardChangedListener listener) { - } - } + @TargetApi(11) + private static class HCClipboardManager + extends ClipboardManagerProxy implements ClipboardManager.OnPrimaryClipChangedListener + { + private ClipboardManager mClipboardManager; + private OnClipboardChangedListener mListener; - @TargetApi(11) - private static class HCClipboardManager extends ClipboardManagerProxy implements ClipboardManager.OnPrimaryClipChangedListener { - private ClipboardManager mClipboardManager; - private OnClipboardChangedListener mListener; + public HCClipboardManager(Context ctx) + { + mClipboardManager = (ClipboardManager)ctx.getSystemService(Context.CLIPBOARD_SERVICE); + } - public HCClipboardManager(Context ctx) { - mClipboardManager = (ClipboardManager) ctx.getSystemService(Context.CLIPBOARD_SERVICE); - } + @Override public void setClipboardData(String data) + { + mClipboardManager.setPrimaryClip( + ClipData.newPlainText("rdp-clipboard", data == null ? "" : data)); + } - @Override - public void setClipboardData(String data) { - mClipboardManager.setPrimaryClip(ClipData.newPlainText("rdp-clipboard", data == null ? "" : data)); - } + @Override public void onPrimaryClipChanged() + { + ClipData clip = mClipboardManager.getPrimaryClip(); + String data = null; - @Override - public void onPrimaryClipChanged() { - ClipData clip = mClipboardManager.getPrimaryClip(); - String data = null; + if (clip != null && clip.getItemCount() > 0) + { + CharSequence cs = clip.getItemAt(0).getText(); + if (cs != null) + data = cs.toString(); + } + if (mListener != null) + { + mListener.onClipboardChanged(data); + } + } - if (clip != null && clip.getItemCount() > 0) { - CharSequence cs = clip.getItemAt(0).getText(); - if (cs != null) - data = cs.toString(); - } - if (mListener != null) { - mListener.onClipboardChanged(data); - } - } + @Override public void addClipboardChangedListener(OnClipboardChangedListener listener) + { + mListener = listener; + mClipboardManager.addPrimaryClipChangedListener(this); + } - @Override - public void addClipboardChangedListener( - OnClipboardChangedListener listener) { - mListener = listener; - mClipboardManager.addPrimaryClipChangedListener(this); - } - - @Override - public void removeClipboardboardChangedListener( - OnClipboardChangedListener listener) { - mListener = null; - mClipboardManager.removePrimaryClipChangedListener(this); - } - } + @Override + public void removeClipboardboardChangedListener(OnClipboardChangedListener listener) + { + mListener = null; + mClipboardManager.removePrimaryClipChangedListener(this); + } + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/DoubleGestureDetector.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/DoubleGestureDetector.java index 563bc61a9..2e8dfc881 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/DoubleGestureDetector.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/DoubleGestureDetector.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.utils; @@ -16,312 +17,333 @@ import android.view.ScaleGestureDetector; import com.freerdp.freerdpcore.utils.GestureDetector.OnGestureListener; -public class DoubleGestureDetector { - // timeout during that the second finger has to touch the screen before the double finger detection is cancelled - private static final long DOUBLE_TOUCH_TIMEOUT = 100; - // timeout during that an UP event will trigger a single double touch event - private static final long SINGLE_DOUBLE_TOUCH_TIMEOUT = 1000; - // constants for Message.what used by GestureHandler below - private static final int TAP = 1; - // different detection modes - private static final int MODE_UNKNOWN = 0; - private static final int MODE_PINCH_ZOOM = 1; - private static final int MODE_SCROLL = 2; - private static final int SCROLL_SCORE_TO_REACH = 20; - private final OnDoubleGestureListener mListener; - private int mPointerDistanceSquare; - private int mCurrentMode; - private int mScrollDetectionScore; - private ScaleGestureDetector scaleGestureDetector; - private boolean mCancelDetection; - private boolean mDoubleInProgress; - private GestureHandler mHandler; - private MotionEvent mCurrentDownEvent; - private MotionEvent mCurrentDoubleDownEvent; - private MotionEvent mPreviousUpEvent; - private MotionEvent mPreviousPointerUpEvent; - /** - * Creates a GestureDetector with the supplied listener. - * You may only use this constructor from a UI thread (this is the usual situation). - * - * @param context the application's context - * @param listener the listener invoked for all the callbacks, this must - * not be null. - * @throws NullPointerException if {@code listener} is null. - * @see android.os.Handler#Handler() - */ - public DoubleGestureDetector(Context context, Handler handler, OnDoubleGestureListener listener) { - mListener = listener; - init(context, handler); - } +public class DoubleGestureDetector +{ + // timeout during that the second finger has to touch the screen before the double finger + // detection is cancelled + private static final long DOUBLE_TOUCH_TIMEOUT = 100; + // timeout during that an UP event will trigger a single double touch event + private static final long SINGLE_DOUBLE_TOUCH_TIMEOUT = 1000; + // constants for Message.what used by GestureHandler below + private static final int TAP = 1; + // different detection modes + private static final int MODE_UNKNOWN = 0; + private static final int MODE_PINCH_ZOOM = 1; + private static final int MODE_SCROLL = 2; + private static final int SCROLL_SCORE_TO_REACH = 20; + private final OnDoubleGestureListener mListener; + private int mPointerDistanceSquare; + private int mCurrentMode; + private int mScrollDetectionScore; + private ScaleGestureDetector scaleGestureDetector; + private boolean mCancelDetection; + private boolean mDoubleInProgress; + private GestureHandler mHandler; + private MotionEvent mCurrentDownEvent; + private MotionEvent mCurrentDoubleDownEvent; + private MotionEvent mPreviousUpEvent; + private MotionEvent mPreviousPointerUpEvent; + /** + * Creates a GestureDetector with the supplied listener. + * You may only use this constructor from a UI thread (this is the usual situation). + * + * @param context the application's context + * @param listener the listener invoked for all the callbacks, this must + * not be null. + * @throws NullPointerException if {@code listener} is null. + * @see android.os.Handler#Handler() + */ + public DoubleGestureDetector(Context context, Handler handler, OnDoubleGestureListener listener) + { + mListener = listener; + init(context, handler); + } - private void init(Context context, Handler handler) { - if (mListener == null) { - throw new NullPointerException("OnGestureListener must not be null"); - } + private void init(Context context, Handler handler) + { + if (mListener == null) + { + throw new NullPointerException("OnGestureListener must not be null"); + } - if (handler != null) - mHandler = new GestureHandler(handler); - else - mHandler = new GestureHandler(); + if (handler != null) + mHandler = new GestureHandler(handler); + else + mHandler = new GestureHandler(); - // we use 1cm distance to decide between scroll and pinch zoom - // - first convert cm to inches - // - then multiply inches by dots per inch - float distInches = 0.5f / 2.54f; - float distPixelsX = distInches * context.getResources().getDisplayMetrics().xdpi; - float distPixelsY = distInches * context.getResources().getDisplayMetrics().ydpi; + // we use 1cm distance to decide between scroll and pinch zoom + // - first convert cm to inches + // - then multiply inches by dots per inch + float distInches = 0.5f / 2.54f; + float distPixelsX = distInches * context.getResources().getDisplayMetrics().xdpi; + float distPixelsY = distInches * context.getResources().getDisplayMetrics().ydpi; - mPointerDistanceSquare = (int) (distPixelsX * distPixelsX + distPixelsY * distPixelsY); - } + mPointerDistanceSquare = (int)(distPixelsX * distPixelsX + distPixelsY * distPixelsY); + } - /** - * Set scale gesture detector - * - * @param scaleGestureDetector - */ - public void setScaleGestureDetector(ScaleGestureDetector scaleGestureDetector) { - this.scaleGestureDetector = scaleGestureDetector; - } + /** + * Set scale gesture detector + * + * @param scaleGestureDetector + */ + public void setScaleGestureDetector(ScaleGestureDetector scaleGestureDetector) + { + this.scaleGestureDetector = scaleGestureDetector; + } - /** - * Analyzes the given motion event and if applicable triggers the - * appropriate callbacks on the {@link OnGestureListener} supplied. - * - * @param ev The current motion event. - * @return true if the {@link OnGestureListener} consumed the event, - * else false. - */ - public boolean onTouchEvent(MotionEvent ev) { - boolean handled = false; - final int action = ev.getAction(); - //dumpEvent(ev); + /** + * Analyzes the given motion event and if applicable triggers the + * appropriate callbacks on the {@link OnGestureListener} supplied. + * + * @param ev The current motion event. + * @return true if the {@link OnGestureListener} consumed the event, + * else false. + */ + public boolean onTouchEvent(MotionEvent ev) + { + boolean handled = false; + final int action = ev.getAction(); + // dumpEvent(ev); - switch (action & MotionEvent.ACTION_MASK) { - case MotionEvent.ACTION_DOWN: - if (mCurrentDownEvent != null) - mCurrentDownEvent.recycle(); + switch (action & MotionEvent.ACTION_MASK) + { + case MotionEvent.ACTION_DOWN: + if (mCurrentDownEvent != null) + mCurrentDownEvent.recycle(); - mCurrentMode = MODE_UNKNOWN; - mCurrentDownEvent = MotionEvent.obtain(ev); - mCancelDetection = false; - mDoubleInProgress = false; - mScrollDetectionScore = 0; - handled = true; - break; + mCurrentMode = MODE_UNKNOWN; + mCurrentDownEvent = MotionEvent.obtain(ev); + mCancelDetection = false; + mDoubleInProgress = false; + mScrollDetectionScore = 0; + handled = true; + break; - case MotionEvent.ACTION_POINTER_UP: - if (mPreviousPointerUpEvent != null) - mPreviousPointerUpEvent.recycle(); - mPreviousPointerUpEvent = MotionEvent.obtain(ev); - break; + case MotionEvent.ACTION_POINTER_UP: + if (mPreviousPointerUpEvent != null) + mPreviousPointerUpEvent.recycle(); + mPreviousPointerUpEvent = MotionEvent.obtain(ev); + break; - case MotionEvent.ACTION_POINTER_DOWN: - // more than 2 fingers down? cancel - // 2nd finger touched too late? cancel - if (ev.getPointerCount() > 2 || (ev.getEventTime() - mCurrentDownEvent.getEventTime()) > DOUBLE_TOUCH_TIMEOUT) { - cancel(); - break; - } + case MotionEvent.ACTION_POINTER_DOWN: + // more than 2 fingers down? cancel + // 2nd finger touched too late? cancel + if (ev.getPointerCount() > 2 || + (ev.getEventTime() - mCurrentDownEvent.getEventTime()) > DOUBLE_TOUCH_TIMEOUT) + { + cancel(); + break; + } - // detection cancelled? - if (mCancelDetection) - break; + // detection cancelled? + if (mCancelDetection) + break; - // double touch gesture in progress - mDoubleInProgress = true; - if (mCurrentDoubleDownEvent != null) - mCurrentDoubleDownEvent.recycle(); - mCurrentDoubleDownEvent = MotionEvent.obtain(ev); + // double touch gesture in progress + mDoubleInProgress = true; + if (mCurrentDoubleDownEvent != null) + mCurrentDoubleDownEvent.recycle(); + mCurrentDoubleDownEvent = MotionEvent.obtain(ev); - // set detection mode to unkown and send a TOUCH timeout event to detect single taps - mCurrentMode = MODE_UNKNOWN; - mHandler.sendEmptyMessageDelayed(TAP, SINGLE_DOUBLE_TOUCH_TIMEOUT); + // set detection mode to unkown and send a TOUCH timeout event to detect single taps + mCurrentMode = MODE_UNKNOWN; + mHandler.sendEmptyMessageDelayed(TAP, SINGLE_DOUBLE_TOUCH_TIMEOUT); - handled |= mListener.onDoubleTouchDown(ev); - break; + handled |= mListener.onDoubleTouchDown(ev); + break; - case MotionEvent.ACTION_MOVE: + case MotionEvent.ACTION_MOVE: - // detection cancelled or not active? - if (mCancelDetection || !mDoubleInProgress || ev.getPointerCount() != 2) - break; + // detection cancelled or not active? + if (mCancelDetection || !mDoubleInProgress || ev.getPointerCount() != 2) + break; - // determine mode - if (mCurrentMode == MODE_UNKNOWN) { - // did the pointer distance change? - if (pointerDistanceChanged(mCurrentDoubleDownEvent, ev)) { - handled |= scaleGestureDetector.onTouchEvent(mCurrentDownEvent); - MotionEvent e = MotionEvent.obtain(ev); - e.setAction(mCurrentDoubleDownEvent.getAction()); - handled |= scaleGestureDetector.onTouchEvent(e); - mCurrentMode = MODE_PINCH_ZOOM; - break; - } else { - mScrollDetectionScore++; - if (mScrollDetectionScore >= SCROLL_SCORE_TO_REACH) - mCurrentMode = MODE_SCROLL; - } - } + // determine mode + if (mCurrentMode == MODE_UNKNOWN) + { + // did the pointer distance change? + if (pointerDistanceChanged(mCurrentDoubleDownEvent, ev)) + { + handled |= scaleGestureDetector.onTouchEvent(mCurrentDownEvent); + MotionEvent e = MotionEvent.obtain(ev); + e.setAction(mCurrentDoubleDownEvent.getAction()); + handled |= scaleGestureDetector.onTouchEvent(e); + mCurrentMode = MODE_PINCH_ZOOM; + break; + } + else + { + mScrollDetectionScore++; + if (mScrollDetectionScore >= SCROLL_SCORE_TO_REACH) + mCurrentMode = MODE_SCROLL; + } + } - switch (mCurrentMode) { - case MODE_PINCH_ZOOM: - if (scaleGestureDetector != null) - handled |= scaleGestureDetector.onTouchEvent(ev); - break; + switch (mCurrentMode) + { + case MODE_PINCH_ZOOM: + if (scaleGestureDetector != null) + handled |= scaleGestureDetector.onTouchEvent(ev); + break; - case MODE_SCROLL: - handled = mListener.onDoubleTouchScroll(mCurrentDownEvent, ev); - break; + case MODE_SCROLL: + handled = mListener.onDoubleTouchScroll(mCurrentDownEvent, ev); + break; - default: - handled = true; - break; - } + default: + handled = true; + break; + } - break; + break; - case MotionEvent.ACTION_UP: - // fingers were not removed equally? cancel - if (mPreviousPointerUpEvent != null && (ev.getEventTime() - mPreviousPointerUpEvent.getEventTime()) > DOUBLE_TOUCH_TIMEOUT) { - mPreviousPointerUpEvent.recycle(); - mPreviousPointerUpEvent = null; - cancel(); - break; - } + case MotionEvent.ACTION_UP: + // fingers were not removed equally? cancel + if (mPreviousPointerUpEvent != null && + (ev.getEventTime() - mPreviousPointerUpEvent.getEventTime()) > + DOUBLE_TOUCH_TIMEOUT) + { + mPreviousPointerUpEvent.recycle(); + mPreviousPointerUpEvent = null; + cancel(); + break; + } - // detection cancelled or not active? - if (mCancelDetection || !mDoubleInProgress) - break; + // detection cancelled or not active? + if (mCancelDetection || !mDoubleInProgress) + break; - boolean hasTapEvent = mHandler.hasMessages(TAP); - MotionEvent currentUpEvent = MotionEvent.obtain(ev); - if (mCurrentMode == MODE_UNKNOWN && hasTapEvent) - handled = mListener.onDoubleTouchSingleTap(mCurrentDoubleDownEvent); - else if (mCurrentMode == MODE_PINCH_ZOOM) - handled = scaleGestureDetector.onTouchEvent(ev); + boolean hasTapEvent = mHandler.hasMessages(TAP); + MotionEvent currentUpEvent = MotionEvent.obtain(ev); + if (mCurrentMode == MODE_UNKNOWN && hasTapEvent) + handled = mListener.onDoubleTouchSingleTap(mCurrentDoubleDownEvent); + else if (mCurrentMode == MODE_PINCH_ZOOM) + handled = scaleGestureDetector.onTouchEvent(ev); - if (mPreviousUpEvent != null) - mPreviousUpEvent.recycle(); + if (mPreviousUpEvent != null) + mPreviousUpEvent.recycle(); - // Hold the event we obtained above - listeners may have changed the original. - mPreviousUpEvent = currentUpEvent; - handled |= mListener.onDoubleTouchUp(ev); - break; + // Hold the event we obtained above - listeners may have changed the original. + mPreviousUpEvent = currentUpEvent; + handled |= mListener.onDoubleTouchUp(ev); + break; - case MotionEvent.ACTION_CANCEL: - cancel(); - break; - } + case MotionEvent.ACTION_CANCEL: + cancel(); + break; + } - if ((action == MotionEvent.ACTION_MOVE) && handled == false) - handled = true; + if ((action == MotionEvent.ACTION_MOVE) && handled == false) + handled = true; - return handled; - } + return handled; + } - private void cancel() { - mHandler.removeMessages(TAP); - mCurrentMode = MODE_UNKNOWN; - mCancelDetection = true; - mDoubleInProgress = false; - } + private void cancel() + { + mHandler.removeMessages(TAP); + mCurrentMode = MODE_UNKNOWN; + mCancelDetection = true; + mDoubleInProgress = false; + } - // returns true of the distance between the two pointers changed - private boolean pointerDistanceChanged(MotionEvent oldEvent, MotionEvent newEvent) { - int deltaX1 = Math.abs((int) oldEvent.getX(0) - (int) oldEvent.getX(1)); - int deltaX2 = Math.abs((int) newEvent.getX(0) - (int) newEvent.getX(1)); - int distXSquare = (deltaX2 - deltaX1) * (deltaX2 - deltaX1); + // returns true of the distance between the two pointers changed + private boolean pointerDistanceChanged(MotionEvent oldEvent, MotionEvent newEvent) + { + int deltaX1 = Math.abs((int)oldEvent.getX(0) - (int)oldEvent.getX(1)); + int deltaX2 = Math.abs((int)newEvent.getX(0) - (int)newEvent.getX(1)); + int distXSquare = (deltaX2 - deltaX1) * (deltaX2 - deltaX1); - int deltaY1 = Math.abs((int) oldEvent.getY(0) - (int) oldEvent.getY(1)); - int deltaY2 = Math.abs((int) newEvent.getY(0) - (int) newEvent.getY(1)); - int distYSquare = (deltaY2 - deltaY1) * (deltaY2 - deltaY1); + int deltaY1 = Math.abs((int)oldEvent.getY(0) - (int)oldEvent.getY(1)); + int deltaY2 = Math.abs((int)newEvent.getY(0) - (int)newEvent.getY(1)); + int distYSquare = (deltaY2 - deltaY1) * (deltaY2 - deltaY1); - return (distXSquare + distYSquare) > mPointerDistanceSquare; - } + return (distXSquare + distYSquare) > mPointerDistanceSquare; + } - /** - * The listener that is used to notify when gestures occur. - * If you want to listen for all the different gestures then implement - * this interface. If you only want to listen for a subset it might - * be easier to extend {@link SimpleOnGestureListener}. - */ - public interface OnDoubleGestureListener { + /** + * The listener that is used to notify when gestures occur. + * If you want to listen for all the different gestures then implement + * this interface. If you only want to listen for a subset it might + * be easier to extend {@link SimpleOnGestureListener}. + */ + public interface OnDoubleGestureListener { - /** - * Notified when a multi tap event starts - */ - boolean onDoubleTouchDown(MotionEvent e); + /** + * Notified when a multi tap event starts + */ + boolean onDoubleTouchDown(MotionEvent e); - /** - * Notified when a multi tap event ends - */ - boolean onDoubleTouchUp(MotionEvent e); + /** + * Notified when a multi tap event ends + */ + boolean onDoubleTouchUp(MotionEvent e); - /** - * Notified when a tap occurs with the up {@link MotionEvent} - * that triggered it. - * - * @param e The up motion event that completed the first tap - * @return true if the event is consumed, else false - */ - boolean onDoubleTouchSingleTap(MotionEvent e); + /** + * Notified when a tap occurs with the up {@link MotionEvent} + * that triggered it. + * + * @param e The up motion event that completed the first tap + * @return true if the event is consumed, else false + */ + boolean onDoubleTouchSingleTap(MotionEvent e); - /** - * Notified when a scroll occurs with the initial on down {@link MotionEvent} and the - * current move {@link MotionEvent}. The distance in x and y is also supplied for - * convenience. - * - * @param e1 The first down motion event that started the scrolling. - * @param e2 The move motion event that triggered the current onScroll. - * @param distanceX The distance along the X axis that has been scrolled since the last - * call to onScroll. This is NOT the distance between {@code e1} - * and {@code e2}. - * @param distanceY The distance along the Y axis that has been scrolled since the last - * call to onScroll. This is NOT the distance between {@code e1} - * and {@code e2}. - * @return true if the event is consumed, else false - */ - boolean onDoubleTouchScroll(MotionEvent e1, MotionEvent e2); - } - - /* - private void dumpEvent(MotionEvent event) { - String names[] = { "DOWN" , "UP" , "MOVE" , "CANCEL" , "OUTSIDE" , - "POINTER_DOWN" , "POINTER_UP" , "7?" , "8?" , "9?" }; - StringBuilder sb = new StringBuilder(); - int action = event.getAction(); - int actionCode = action & MotionEvent.ACTION_MASK; - sb.append("event ACTION_" ).append(names[actionCode]); - if (actionCode == MotionEvent.ACTION_POINTER_DOWN - || actionCode == MotionEvent.ACTION_POINTER_UP) { - sb.append("(pid " ).append( - action >> MotionEvent.ACTION_POINTER_ID_SHIFT); - sb.append(")" ); - } - sb.append("[" ); - for (int i = 0; i < event.getPointerCount(); i++) { - sb.append("#" ).append(i); - sb.append("(pid " ).append(event.getPointerId(i)); - sb.append(")=" ).append((int) event.getX(i)); - sb.append("," ).append((int) event.getY(i)); - if (i + 1 < event.getPointerCount()) - sb.append(";" ); - } - sb.append("]" ); - Log.d("DoubleDetector", sb.toString()); - } - */ + /** + * Notified when a scroll occurs with the initial on down {@link MotionEvent} and the + * current move {@link MotionEvent}. The distance in x and y is also supplied for + * convenience. + * + * @param e1 The first down motion event that started the scrolling. + * @param e2 The move motion event that triggered the current onScroll. + * @param distanceX The distance along the X axis that has been scrolled since the last + * call to onScroll. This is NOT the distance between {@code e1} + * and {@code e2}. + * @param distanceY The distance along the Y axis that has been scrolled since the last + * call to onScroll. This is NOT the distance between {@code e1} + * and {@code e2}. + * @return true if the event is consumed, else false + */ + boolean onDoubleTouchScroll(MotionEvent e1, MotionEvent e2); + } - private class GestureHandler extends Handler { - GestureHandler() { - super(); - } + /* + private void dumpEvent(MotionEvent event) { + String names[] = { "DOWN" , "UP" , "MOVE" , "CANCEL" , "OUTSIDE" , + "POINTER_DOWN" , "POINTER_UP" , "7?" , "8?" , "9?" }; + StringBuilder sb = new StringBuilder(); + int action = event.getAction(); + int actionCode = action & MotionEvent.ACTION_MASK; + sb.append("event ACTION_" ).append(names[actionCode]); + if (actionCode == MotionEvent.ACTION_POINTER_DOWN + || actionCode == MotionEvent.ACTION_POINTER_UP) { + sb.append("(pid " ).append( + action >> MotionEvent.ACTION_POINTER_ID_SHIFT); + sb.append(")" ); + } + sb.append("[" ); + for (int i = 0; i < event.getPointerCount(); i++) { + sb.append("#" ).append(i); + sb.append("(pid " ).append(event.getPointerId(i)); + sb.append(")=" ).append((int) event.getX(i)); + sb.append("," ).append((int) event.getY(i)); + if (i + 1 < event.getPointerCount()) + sb.append(";" ); + } + sb.append("]" ); + Log.d("DoubleDetector", sb.toString()); + } + */ - GestureHandler(Handler handler) { - super(handler.getLooper()); - } - - } + private class GestureHandler extends Handler + { + GestureHandler() + { + super(); + } + GestureHandler(Handler handler) + { + super(handler.getLooper()); + } + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/GestureDetector.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/GestureDetector.java index 71c1e6f1f..2e971b594 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/GestureDetector.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/GestureDetector.java @@ -12,7 +12,7 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * Modified for aFreeRDP by Martin Fleisz (martin.fleisz@thincast.com) */ @@ -26,522 +26,595 @@ import android.util.DisplayMetrics; import android.view.MotionEvent; import android.view.ViewConfiguration; -public class GestureDetector { +public class GestureDetector +{ - private static final int TAP_TIMEOUT = 100; - private static final int DOUBLE_TAP_TIMEOUT = 200; - // Distance a touch can wander before we think the user is the first touch in a sequence of double tap - private static final int LARGE_TOUCH_SLOP = 18; - // Distance between the first touch and second touch to still be considered a double tap - private static final int DOUBLE_TAP_SLOP = 100; - // constants for Message.what used by GestureHandler below - private static final int SHOW_PRESS = 1; - private static final int LONG_PRESS = 2; - private static final int TAP = 3; - private final Handler mHandler; - private final OnGestureListener mListener; - private int mTouchSlopSquare; - private int mLargeTouchSlopSquare; - private int mDoubleTapSlopSquare; - private int mLongpressTimeout = 100; - private OnDoubleTapListener mDoubleTapListener; - private boolean mStillDown; - private boolean mInLongPress; - private boolean mAlwaysInTapRegion; - private boolean mAlwaysInBiggerTapRegion; - private MotionEvent mCurrentDownEvent; - private MotionEvent mPreviousUpEvent; - /** - * True when the user is still touching for the second tap (down, move, and - * up events). Can only be true if there is a double tap listener attached. - */ - private boolean mIsDoubleTapping; - private float mLastMotionY; - private float mLastMotionX; - private boolean mIsLongpressEnabled; - /** - * True if we are at a target API level of >= Froyo or the developer can - * explicitly set it. If true, input events with > 1 pointer will be ignored - * so we can work side by side with multitouch gesture detectors. - */ - private boolean mIgnoreMultitouch; - /** - * Creates a GestureDetector with the supplied listener. - * You may only use this constructor from a UI thread (this is the usual situation). - * - * @param context the application's context - * @param listener the listener invoked for all the callbacks, this must - * not be null. - * @throws NullPointerException if {@code listener} is null. - * @see android.os.Handler#Handler() - */ - public GestureDetector(Context context, OnGestureListener listener) { - this(context, listener, null); - } + private static final int TAP_TIMEOUT = 100; + private static final int DOUBLE_TAP_TIMEOUT = 200; + // Distance a touch can wander before we think the user is the first touch in a sequence of + // double tap + private static final int LARGE_TOUCH_SLOP = 18; + // Distance between the first touch and second touch to still be considered a double tap + private static final int DOUBLE_TAP_SLOP = 100; + // constants for Message.what used by GestureHandler below + private static final int SHOW_PRESS = 1; + private static final int LONG_PRESS = 2; + private static final int TAP = 3; + private final Handler mHandler; + private final OnGestureListener mListener; + private int mTouchSlopSquare; + private int mLargeTouchSlopSquare; + private int mDoubleTapSlopSquare; + private int mLongpressTimeout = 100; + private OnDoubleTapListener mDoubleTapListener; + private boolean mStillDown; + private boolean mInLongPress; + private boolean mAlwaysInTapRegion; + private boolean mAlwaysInBiggerTapRegion; + private MotionEvent mCurrentDownEvent; + private MotionEvent mPreviousUpEvent; + /** + * True when the user is still touching for the second tap (down, move, and + * up events). Can only be true if there is a double tap listener attached. + */ + private boolean mIsDoubleTapping; + private float mLastMotionY; + private float mLastMotionX; + private boolean mIsLongpressEnabled; + /** + * True if we are at a target API level of >= Froyo or the developer can + * explicitly set it. If true, input events with > 1 pointer will be ignored + * so we can work side by side with multitouch gesture detectors. + */ + private boolean mIgnoreMultitouch; + /** + * Creates a GestureDetector with the supplied listener. + * You may only use this constructor from a UI thread (this is the usual situation). + * + * @param context the application's context + * @param listener the listener invoked for all the callbacks, this must + * not be null. + * @throws NullPointerException if {@code listener} is null. + * @see android.os.Handler#Handler() + */ + public GestureDetector(Context context, OnGestureListener listener) + { + this(context, listener, null); + } - /** - * Creates a GestureDetector with the supplied listener. - * You may only use this constructor from a UI thread (this is the usual situation). - * - * @param context the application's context - * @param listener the listener invoked for all the callbacks, this must - * not be null. - * @param handler the handler to use - * @throws NullPointerException if {@code listener} is null. - * @see android.os.Handler#Handler() - */ - public GestureDetector(Context context, OnGestureListener listener, Handler handler) { - this(context, listener, handler, context != null && - context.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.FROYO); - } + /** + * Creates a GestureDetector with the supplied listener. + * You may only use this constructor from a UI thread (this is the usual situation). + * + * @param context the application's context + * @param listener the listener invoked for all the callbacks, this must + * not be null. + * @param handler the handler to use + * @throws NullPointerException if {@code listener} is null. + * @see android.os.Handler#Handler() + */ + public GestureDetector(Context context, OnGestureListener listener, Handler handler) + { + this(context, listener, handler, + context != null && + context.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.FROYO); + } - /** - * Creates a GestureDetector with the supplied listener. - * You may only use this constructor from a UI thread (this is the usual situation). - * - * @param context the application's context - * @param listener the listener invoked for all the callbacks, this must - * not be null. - * @param handler the handler to use - * @param ignoreMultitouch whether events involving more than one pointer should - * be ignored. - * @throws NullPointerException if {@code listener} is null. - * @see android.os.Handler#Handler() - */ - public GestureDetector(Context context, OnGestureListener listener, Handler handler, - boolean ignoreMultitouch) { - if (handler != null) { - mHandler = new GestureHandler(handler); - } else { - mHandler = new GestureHandler(); - } - mListener = listener; - if (listener instanceof OnDoubleTapListener) { - setOnDoubleTapListener((OnDoubleTapListener) listener); - } - init(context, ignoreMultitouch); - } + /** + * Creates a GestureDetector with the supplied listener. + * You may only use this constructor from a UI thread (this is the usual situation). + * + * @param context the application's context + * @param listener the listener invoked for all the callbacks, this must + * not be null. + * @param handler the handler to use + * @param ignoreMultitouch whether events involving more than one pointer should + * be ignored. + * @throws NullPointerException if {@code listener} is null. + * @see android.os.Handler#Handler() + */ + public GestureDetector(Context context, OnGestureListener listener, Handler handler, + boolean ignoreMultitouch) + { + if (handler != null) + { + mHandler = new GestureHandler(handler); + } + else + { + mHandler = new GestureHandler(); + } + mListener = listener; + if (listener instanceof OnDoubleTapListener) + { + setOnDoubleTapListener((OnDoubleTapListener)listener); + } + init(context, ignoreMultitouch); + } - private void init(Context context, boolean ignoreMultitouch) { - if (mListener == null) { - throw new NullPointerException("OnGestureListener must not be null"); - } - mIsLongpressEnabled = true; - mIgnoreMultitouch = ignoreMultitouch; + private void init(Context context, boolean ignoreMultitouch) + { + if (mListener == null) + { + throw new NullPointerException("OnGestureListener must not be null"); + } + mIsLongpressEnabled = true; + mIgnoreMultitouch = ignoreMultitouch; - // Fallback to support pre-donuts releases - int touchSlop, largeTouchSlop, doubleTapSlop; - if (context == null) { - //noinspection deprecation - touchSlop = ViewConfiguration.getTouchSlop(); - largeTouchSlop = touchSlop + 2; - doubleTapSlop = DOUBLE_TAP_SLOP; - } else { - final DisplayMetrics metrics = context.getResources().getDisplayMetrics(); - final float density = metrics.density; - final ViewConfiguration configuration = ViewConfiguration.get(context); - touchSlop = configuration.getScaledTouchSlop(); - largeTouchSlop = (int) (density * LARGE_TOUCH_SLOP + 0.5f); - doubleTapSlop = configuration.getScaledDoubleTapSlop(); - } - mTouchSlopSquare = touchSlop * touchSlop; - mLargeTouchSlopSquare = largeTouchSlop * largeTouchSlop; - mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop; - } + // Fallback to support pre-donuts releases + int touchSlop, largeTouchSlop, doubleTapSlop; + if (context == null) + { + // noinspection deprecation + touchSlop = ViewConfiguration.getTouchSlop(); + largeTouchSlop = touchSlop + 2; + doubleTapSlop = DOUBLE_TAP_SLOP; + } + else + { + final DisplayMetrics metrics = context.getResources().getDisplayMetrics(); + final float density = metrics.density; + final ViewConfiguration configuration = ViewConfiguration.get(context); + touchSlop = configuration.getScaledTouchSlop(); + largeTouchSlop = (int)(density * LARGE_TOUCH_SLOP + 0.5f); + doubleTapSlop = configuration.getScaledDoubleTapSlop(); + } + mTouchSlopSquare = touchSlop * touchSlop; + mLargeTouchSlopSquare = largeTouchSlop * largeTouchSlop; + mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop; + } - /** - * Sets the listener which will be called for double-tap and related - * gestures. - * - * @param onDoubleTapListener the listener invoked for all the callbacks, or - * null to stop listening for double-tap gestures. - */ - public void setOnDoubleTapListener(OnDoubleTapListener onDoubleTapListener) { - mDoubleTapListener = onDoubleTapListener; - } + /** + * Sets the listener which will be called for double-tap and related + * gestures. + * + * @param onDoubleTapListener the listener invoked for all the callbacks, or + * null to stop listening for double-tap gestures. + */ + public void setOnDoubleTapListener(OnDoubleTapListener onDoubleTapListener) + { + mDoubleTapListener = onDoubleTapListener; + } - /** - * Set whether longpress is enabled, if this is enabled when a user - * presses and holds down you get a longpress event and nothing further. - * If it's disabled the user can press and hold down and then later - * moved their finger and you will get scroll events. By default - * longpress is enabled. - * - * @param isLongpressEnabled whether longpress should be enabled. - */ - public void setIsLongpressEnabled(boolean isLongpressEnabled) { - mIsLongpressEnabled = isLongpressEnabled; - } + /** + * Set whether longpress is enabled, if this is enabled when a user + * presses and holds down you get a longpress event and nothing further. + * If it's disabled the user can press and hold down and then later + * moved their finger and you will get scroll events. By default + * longpress is enabled. + * + * @param isLongpressEnabled whether longpress should be enabled. + */ + public void setIsLongpressEnabled(boolean isLongpressEnabled) + { + mIsLongpressEnabled = isLongpressEnabled; + } - /** - * @return true if longpress is enabled, else false. - */ - public boolean isLongpressEnabled() { - return mIsLongpressEnabled; - } + /** + * @return true if longpress is enabled, else false. + */ + public boolean isLongpressEnabled() + { + return mIsLongpressEnabled; + } - public void setLongPressTimeout(int timeout) { - mLongpressTimeout = timeout; - } + public void setLongPressTimeout(int timeout) + { + mLongpressTimeout = timeout; + } - /** - * Analyzes the given motion event and if applicable triggers the - * appropriate callbacks on the {@link OnGestureListener} supplied. - * - * @param ev The current motion event. - * @return true if the {@link OnGestureListener} consumed the event, - * else false. - */ - public boolean onTouchEvent(MotionEvent ev) { - final int action = ev.getAction(); - final float y = ev.getY(); - final float x = ev.getX(); + /** + * Analyzes the given motion event and if applicable triggers the + * appropriate callbacks on the {@link OnGestureListener} supplied. + * + * @param ev The current motion event. + * @return true if the {@link OnGestureListener} consumed the event, + * else false. + */ + public boolean onTouchEvent(MotionEvent ev) + { + final int action = ev.getAction(); + final float y = ev.getY(); + final float x = ev.getX(); - boolean handled = false; + boolean handled = false; - switch (action & MotionEvent.ACTION_MASK) { - case MotionEvent.ACTION_POINTER_DOWN: - if (mIgnoreMultitouch) { - // Multitouch event - abort. - cancel(); - } - break; + switch (action & MotionEvent.ACTION_MASK) + { + case MotionEvent.ACTION_POINTER_DOWN: + if (mIgnoreMultitouch) + { + // Multitouch event - abort. + cancel(); + } + break; - case MotionEvent.ACTION_POINTER_UP: - // Ending a multitouch gesture and going back to 1 finger - if (mIgnoreMultitouch && ev.getPointerCount() == 2) { - int index = (((action & MotionEvent.ACTION_POINTER_INDEX_MASK) - >> MotionEvent.ACTION_POINTER_INDEX_SHIFT) == 0) ? 1 : 0; - mLastMotionX = ev.getX(index); - mLastMotionY = ev.getY(index); - } - break; + case MotionEvent.ACTION_POINTER_UP: + // Ending a multitouch gesture and going back to 1 finger + if (mIgnoreMultitouch && ev.getPointerCount() == 2) + { + int index = (((action & MotionEvent.ACTION_POINTER_INDEX_MASK) >> + MotionEvent.ACTION_POINTER_INDEX_SHIFT) == 0) + ? 1 + : 0; + mLastMotionX = ev.getX(index); + mLastMotionY = ev.getY(index); + } + break; - case MotionEvent.ACTION_DOWN: - if (mDoubleTapListener != null) { - boolean hadTapMessage = mHandler.hasMessages(TAP); - if (hadTapMessage) mHandler.removeMessages(TAP); - if ((mCurrentDownEvent != null) && (mPreviousUpEvent != null) && hadTapMessage && - isConsideredDoubleTap(mCurrentDownEvent, mPreviousUpEvent, ev)) { - // This is a second tap - mIsDoubleTapping = true; - // Give a callback with the first tap of the double-tap - handled |= mDoubleTapListener.onDoubleTap(mCurrentDownEvent); - // Give a callback with down event of the double-tap - handled |= mDoubleTapListener.onDoubleTapEvent(ev); - } else { - // This is a first tap - mHandler.sendEmptyMessageDelayed(TAP, DOUBLE_TAP_TIMEOUT); - } - } + case MotionEvent.ACTION_DOWN: + if (mDoubleTapListener != null) + { + boolean hadTapMessage = mHandler.hasMessages(TAP); + if (hadTapMessage) + mHandler.removeMessages(TAP); + if ((mCurrentDownEvent != null) && (mPreviousUpEvent != null) && + hadTapMessage && + isConsideredDoubleTap(mCurrentDownEvent, mPreviousUpEvent, ev)) + { + // This is a second tap + mIsDoubleTapping = true; + // Give a callback with the first tap of the double-tap + handled |= mDoubleTapListener.onDoubleTap(mCurrentDownEvent); + // Give a callback with down event of the double-tap + handled |= mDoubleTapListener.onDoubleTapEvent(ev); + } + else + { + // This is a first tap + mHandler.sendEmptyMessageDelayed(TAP, DOUBLE_TAP_TIMEOUT); + } + } - mLastMotionX = x; - mLastMotionY = y; - if (mCurrentDownEvent != null) { - mCurrentDownEvent.recycle(); - } - mCurrentDownEvent = MotionEvent.obtain(ev); - mAlwaysInTapRegion = true; - mAlwaysInBiggerTapRegion = true; - mStillDown = true; - mInLongPress = false; + mLastMotionX = x; + mLastMotionY = y; + if (mCurrentDownEvent != null) + { + mCurrentDownEvent.recycle(); + } + mCurrentDownEvent = MotionEvent.obtain(ev); + mAlwaysInTapRegion = true; + mAlwaysInBiggerTapRegion = true; + mStillDown = true; + mInLongPress = false; - if (mIsLongpressEnabled) { - mHandler.removeMessages(LONG_PRESS); - mHandler.sendEmptyMessageAtTime(LONG_PRESS, mCurrentDownEvent.getDownTime() - + TAP_TIMEOUT + mLongpressTimeout); - } - mHandler.sendEmptyMessageAtTime(SHOW_PRESS, mCurrentDownEvent.getDownTime() + TAP_TIMEOUT); - handled |= mListener.onDown(ev); - break; + if (mIsLongpressEnabled) + { + mHandler.removeMessages(LONG_PRESS); + mHandler.sendEmptyMessageAtTime(LONG_PRESS, mCurrentDownEvent.getDownTime() + + TAP_TIMEOUT + + mLongpressTimeout); + } + mHandler.sendEmptyMessageAtTime(SHOW_PRESS, + mCurrentDownEvent.getDownTime() + TAP_TIMEOUT); + handled |= mListener.onDown(ev); + break; - case MotionEvent.ACTION_MOVE: - if (mIgnoreMultitouch && ev.getPointerCount() > 1) { - break; - } - final float scrollX = mLastMotionX - x; - final float scrollY = mLastMotionY - y; - if (mIsDoubleTapping) { - // Give the move events of the double-tap - handled |= mDoubleTapListener.onDoubleTapEvent(ev); - } else if (mAlwaysInTapRegion) { - final int deltaX = (int) (x - mCurrentDownEvent.getX()); - final int deltaY = (int) (y - mCurrentDownEvent.getY()); - int distance = (deltaX * deltaX) + (deltaY * deltaY); - if (distance > mTouchSlopSquare) { - mLastMotionX = x; - mLastMotionY = y; - mAlwaysInTapRegion = false; - mHandler.removeMessages(TAP); - mHandler.removeMessages(SHOW_PRESS); - mHandler.removeMessages(LONG_PRESS); - } - if (distance > mLargeTouchSlopSquare) { - mAlwaysInBiggerTapRegion = false; - } - handled = mListener.onScroll(mCurrentDownEvent, ev, scrollX, scrollY); - } else if ((Math.abs(scrollX) >= 1) || (Math.abs(scrollY) >= 1)) { - handled = mListener.onScroll(mCurrentDownEvent, ev, scrollX, scrollY); - mLastMotionX = x; - mLastMotionY = y; - } - break; + case MotionEvent.ACTION_MOVE: + if (mIgnoreMultitouch && ev.getPointerCount() > 1) + { + break; + } + final float scrollX = mLastMotionX - x; + final float scrollY = mLastMotionY - y; + if (mIsDoubleTapping) + { + // Give the move events of the double-tap + handled |= mDoubleTapListener.onDoubleTapEvent(ev); + } + else if (mAlwaysInTapRegion) + { + final int deltaX = (int)(x - mCurrentDownEvent.getX()); + final int deltaY = (int)(y - mCurrentDownEvent.getY()); + int distance = (deltaX * deltaX) + (deltaY * deltaY); + if (distance > mTouchSlopSquare) + { + mLastMotionX = x; + mLastMotionY = y; + mAlwaysInTapRegion = false; + mHandler.removeMessages(TAP); + mHandler.removeMessages(SHOW_PRESS); + mHandler.removeMessages(LONG_PRESS); + } + if (distance > mLargeTouchSlopSquare) + { + mAlwaysInBiggerTapRegion = false; + } + handled = mListener.onScroll(mCurrentDownEvent, ev, scrollX, scrollY); + } + else if ((Math.abs(scrollX) >= 1) || (Math.abs(scrollY) >= 1)) + { + handled = mListener.onScroll(mCurrentDownEvent, ev, scrollX, scrollY); + mLastMotionX = x; + mLastMotionY = y; + } + break; - case MotionEvent.ACTION_UP: - mStillDown = false; - MotionEvent currentUpEvent = MotionEvent.obtain(ev); - if (mIsDoubleTapping) { - // Finally, give the up event of the double-tap - handled |= mDoubleTapListener.onDoubleTapEvent(ev); - } else if (mInLongPress) { - mHandler.removeMessages(TAP); - mListener.onLongPressUp(ev); - mInLongPress = false; - } else if (mAlwaysInTapRegion) { - handled = mListener.onSingleTapUp(mCurrentDownEvent); - } else { - // A fling must travel the minimum tap distance - } - if (mPreviousUpEvent != null) { - mPreviousUpEvent.recycle(); - } - // Hold the event we obtained above - listeners may have changed the original. - mPreviousUpEvent = currentUpEvent; - mIsDoubleTapping = false; - mHandler.removeMessages(SHOW_PRESS); - mHandler.removeMessages(LONG_PRESS); - handled |= mListener.onUp(ev); - break; - case MotionEvent.ACTION_CANCEL: - cancel(); - break; - } - return handled; - } + case MotionEvent.ACTION_UP: + mStillDown = false; + MotionEvent currentUpEvent = MotionEvent.obtain(ev); + if (mIsDoubleTapping) + { + // Finally, give the up event of the double-tap + handled |= mDoubleTapListener.onDoubleTapEvent(ev); + } + else if (mInLongPress) + { + mHandler.removeMessages(TAP); + mListener.onLongPressUp(ev); + mInLongPress = false; + } + else if (mAlwaysInTapRegion) + { + handled = mListener.onSingleTapUp(mCurrentDownEvent); + } + else + { + // A fling must travel the minimum tap distance + } + if (mPreviousUpEvent != null) + { + mPreviousUpEvent.recycle(); + } + // Hold the event we obtained above - listeners may have changed the original. + mPreviousUpEvent = currentUpEvent; + mIsDoubleTapping = false; + mHandler.removeMessages(SHOW_PRESS); + mHandler.removeMessages(LONG_PRESS); + handled |= mListener.onUp(ev); + break; + case MotionEvent.ACTION_CANCEL: + cancel(); + break; + } + return handled; + } - private void cancel() { - mHandler.removeMessages(SHOW_PRESS); - mHandler.removeMessages(LONG_PRESS); - mHandler.removeMessages(TAP); - mAlwaysInTapRegion = false; // ensures that we won't receive an OnSingleTap notification when a 2-Finger tap is performed - mIsDoubleTapping = false; - mStillDown = false; - if (mInLongPress) { - mInLongPress = false; - } - } + private void cancel() + { + mHandler.removeMessages(SHOW_PRESS); + mHandler.removeMessages(LONG_PRESS); + mHandler.removeMessages(TAP); + mAlwaysInTapRegion = false; // ensures that we won't receive an OnSingleTap notification + // when a 2-Finger tap is performed + mIsDoubleTapping = false; + mStillDown = false; + if (mInLongPress) + { + mInLongPress = false; + } + } - private boolean isConsideredDoubleTap(MotionEvent firstDown, MotionEvent firstUp, - MotionEvent secondDown) { - if (!mAlwaysInBiggerTapRegion) { - return false; - } + private boolean isConsideredDoubleTap(MotionEvent firstDown, MotionEvent firstUp, + MotionEvent secondDown) + { + if (!mAlwaysInBiggerTapRegion) + { + return false; + } - if (secondDown.getEventTime() - firstUp.getEventTime() > DOUBLE_TAP_TIMEOUT) { - return false; - } + if (secondDown.getEventTime() - firstUp.getEventTime() > DOUBLE_TAP_TIMEOUT) + { + return false; + } - int deltaX = (int) firstDown.getX() - (int) secondDown.getX(); - int deltaY = (int) firstDown.getY() - (int) secondDown.getY(); - return (deltaX * deltaX + deltaY * deltaY < mDoubleTapSlopSquare); - } + int deltaX = (int)firstDown.getX() - (int)secondDown.getX(); + int deltaY = (int)firstDown.getY() - (int)secondDown.getY(); + return (deltaX * deltaX + deltaY * deltaY < mDoubleTapSlopSquare); + } - private void dispatchLongPress() { - mHandler.removeMessages(TAP); - mInLongPress = true; - mListener.onLongPress(mCurrentDownEvent); - } + private void dispatchLongPress() + { + mHandler.removeMessages(TAP); + mInLongPress = true; + mListener.onLongPress(mCurrentDownEvent); + } - /** - * The listener that is used to notify when gestures occur. - * If you want to listen for all the different gestures then implement - * this interface. If you only want to listen for a subset it might - * be easier to extend {@link SimpleOnGestureListener}. - */ - public interface OnGestureListener { + /** + * The listener that is used to notify when gestures occur. + * If you want to listen for all the different gestures then implement + * this interface. If you only want to listen for a subset it might + * be easier to extend {@link SimpleOnGestureListener}. + */ + public interface OnGestureListener { - /** - * Notified when a tap occurs with the down {@link MotionEvent} - * that triggered it. This will be triggered immediately for - * every down event. All other events should be preceded by this. - * - * @param e The down motion event. - */ - boolean onDown(MotionEvent e); + /** + * Notified when a tap occurs with the down {@link MotionEvent} + * that triggered it. This will be triggered immediately for + * every down event. All other events should be preceded by this. + * + * @param e The down motion event. + */ + boolean onDown(MotionEvent e); - /** - * Notified when a tap finishes with the up {@link MotionEvent} - * that triggered it. This will be triggered immediately for - * every up event. All other events should be preceded by this. - * - * @param e The up motion event. - */ - boolean onUp(MotionEvent e); + /** + * Notified when a tap finishes with the up {@link MotionEvent} + * that triggered it. This will be triggered immediately for + * every up event. All other events should be preceded by this. + * + * @param e The up motion event. + */ + boolean onUp(MotionEvent e); - /** - * The user has performed a down {@link MotionEvent} and not performed - * a move or up yet. This event is commonly used to provide visual - * feedback to the user to let them know that their action has been - * recognized i.e. highlight an element. - * - * @param e The down motion event - */ - void onShowPress(MotionEvent e); + /** + * The user has performed a down {@link MotionEvent} and not performed + * a move or up yet. This event is commonly used to provide visual + * feedback to the user to let them know that their action has been + * recognized i.e. highlight an element. + * + * @param e The down motion event + */ + void onShowPress(MotionEvent e); - /** - * Notified when a tap occurs with the up {@link MotionEvent} - * that triggered it. - * - * @param e The up motion event that completed the first tap - * @return true if the event is consumed, else false - */ - boolean onSingleTapUp(MotionEvent e); + /** + * Notified when a tap occurs with the up {@link MotionEvent} + * that triggered it. + * + * @param e The up motion event that completed the first tap + * @return true if the event is consumed, else false + */ + boolean onSingleTapUp(MotionEvent e); - /** - * Notified when a scroll occurs with the initial on down {@link MotionEvent} and the - * current move {@link MotionEvent}. The distance in x and y is also supplied for - * convenience. - * - * @param e1 The first down motion event that started the scrolling. - * @param e2 The move motion event that triggered the current onScroll. - * @param distanceX The distance along the X axis that has been scrolled since the last - * call to onScroll. This is NOT the distance between {@code e1} - * and {@code e2}. - * @param distanceY The distance along the Y axis that has been scrolled since the last - * call to onScroll. This is NOT the distance between {@code e1} - * and {@code e2}. - * @return true if the event is consumed, else false - */ - boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY); + /** + * Notified when a scroll occurs with the initial on down {@link MotionEvent} and the + * current move {@link MotionEvent}. The distance in x and y is also supplied for + * convenience. + * + * @param e1 The first down motion event that started the scrolling. + * @param e2 The move motion event that triggered the current onScroll. + * @param distanceX The distance along the X axis that has been scrolled since the last + * call to onScroll. This is NOT the distance between {@code e1} + * and {@code e2}. + * @param distanceY The distance along the Y axis that has been scrolled since the last + * call to onScroll. This is NOT the distance between {@code e1} + * and {@code e2}. + * @return true if the event is consumed, else false + */ + boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY); - /** - * Notified when a long press occurs with the initial on down {@link MotionEvent} - * that trigged it. - * - * @param e The initial on down motion event that started the longpress. - */ - void onLongPress(MotionEvent e); + /** + * Notified when a long press occurs with the initial on down {@link MotionEvent} + * that trigged it. + * + * @param e The initial on down motion event that started the longpress. + */ + void onLongPress(MotionEvent e); - /** - * Notified when a long press ends with the final {@link MotionEvent}. - * - * @param e The up motion event that ended the longpress. - */ - void onLongPressUp(MotionEvent e); - } + /** + * Notified when a long press ends with the final {@link MotionEvent}. + * + * @param e The up motion event that ended the longpress. + */ + void onLongPressUp(MotionEvent e); + } - /** - * The listener that is used to notify when a double-tap or a confirmed - * single-tap occur. - */ - public interface OnDoubleTapListener { - /** - * Notified when a single-tap occurs. - *

- * Unlike {@link OnGestureListener#onSingleTapUp(MotionEvent)}, this - * will only be called after the detector is confident that the user's - * first tap is not followed by a second tap leading to a double-tap - * gesture. - * - * @param e The down motion event of the single-tap. - * @return true if the event is consumed, else false - */ - boolean onSingleTapConfirmed(MotionEvent e); + /** + * The listener that is used to notify when a double-tap or a confirmed + * single-tap occur. + */ + public interface OnDoubleTapListener { + /** + * Notified when a single-tap occurs. + *

+ * Unlike {@link OnGestureListener#onSingleTapUp(MotionEvent)}, this + * will only be called after the detector is confident that the user's + * first tap is not followed by a second tap leading to a double-tap + * gesture. + * + * @param e The down motion event of the single-tap. + * @return true if the event is consumed, else false + */ + boolean onSingleTapConfirmed(MotionEvent e); - /** - * Notified when a double-tap occurs. - * - * @param e The down motion event of the first tap of the double-tap. - * @return true if the event is consumed, else false - */ - boolean onDoubleTap(MotionEvent e); + /** + * Notified when a double-tap occurs. + * + * @param e The down motion event of the first tap of the double-tap. + * @return true if the event is consumed, else false + */ + boolean onDoubleTap(MotionEvent e); - /** - * Notified when an event within a double-tap gesture occurs, including - * the down, move, and up events. - * - * @param e The motion event that occurred during the double-tap gesture. - * @return true if the event is consumed, else false - */ - boolean onDoubleTapEvent(MotionEvent e); - } + /** + * Notified when an event within a double-tap gesture occurs, including + * the down, move, and up events. + * + * @param e The motion event that occurred during the double-tap gesture. + * @return true if the event is consumed, else false + */ + boolean onDoubleTapEvent(MotionEvent e); + } - /** - * A convenience class to extend when you only want to listen for a subset - * of all the gestures. This implements all methods in the - * {@link OnGestureListener} and {@link OnDoubleTapListener} but does - * nothing and return {@code false} for all applicable methods. - */ - public static class SimpleOnGestureListener implements OnGestureListener, OnDoubleTapListener { - public boolean onSingleTapUp(MotionEvent e) { - return false; - } + /** + * A convenience class to extend when you only want to listen for a subset + * of all the gestures. This implements all methods in the + * {@link OnGestureListener} and {@link OnDoubleTapListener} but does + * nothing and return {@code false} for all applicable methods. + */ + public static class SimpleOnGestureListener implements OnGestureListener, OnDoubleTapListener + { + public boolean onSingleTapUp(MotionEvent e) + { + return false; + } - public void onLongPress(MotionEvent e) { - } + public void onLongPress(MotionEvent e) + { + } - public void onLongPressUp(MotionEvent e) { - } + public void onLongPressUp(MotionEvent e) + { + } - public boolean onScroll(MotionEvent e1, MotionEvent e2, - float distanceX, float distanceY) { - return false; - } + public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) + { + return false; + } - public void onShowPress(MotionEvent e) { - } + public void onShowPress(MotionEvent e) + { + } - public boolean onDown(MotionEvent e) { - return false; - } + public boolean onDown(MotionEvent e) + { + return false; + } - public boolean onUp(MotionEvent e) { - return false; - } + public boolean onUp(MotionEvent e) + { + return false; + } - public boolean onDoubleTap(MotionEvent e) { - return false; - } + public boolean onDoubleTap(MotionEvent e) + { + return false; + } - public boolean onDoubleTapEvent(MotionEvent e) { - return false; - } + public boolean onDoubleTapEvent(MotionEvent e) + { + return false; + } - public boolean onSingleTapConfirmed(MotionEvent e) { - return false; - } - } + public boolean onSingleTapConfirmed(MotionEvent e) + { + return false; + } + } - private class GestureHandler extends Handler { - GestureHandler() { - super(); - } + private class GestureHandler extends Handler + { + GestureHandler() + { + super(); + } - GestureHandler(Handler handler) { - super(handler.getLooper()); - } + GestureHandler(Handler handler) + { + super(handler.getLooper()); + } - @Override - public void handleMessage(Message msg) { - switch (msg.what) { - case SHOW_PRESS: - mListener.onShowPress(mCurrentDownEvent); - break; + @Override public void handleMessage(Message msg) + { + switch (msg.what) + { + case SHOW_PRESS: + mListener.onShowPress(mCurrentDownEvent); + break; - case LONG_PRESS: - dispatchLongPress(); - break; + case LONG_PRESS: + dispatchLongPress(); + break; - case TAP: - // If the user's finger is still down, do not count it as a tap - if (mDoubleTapListener != null && !mStillDown) { - mDoubleTapListener.onSingleTapConfirmed(mCurrentDownEvent); - } - break; + case TAP: + // If the user's finger is still down, do not count it as a tap + if (mDoubleTapListener != null && !mStillDown) + { + mDoubleTapListener.onSingleTapConfirmed(mCurrentDownEvent); + } + break; - default: - throw new RuntimeException("Unknown message " + msg); //never - } - } - } + default: + throw new RuntimeException("Unknown message " + msg); // never + } + } + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/IntEditTextPreference.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/IntEditTextPreference.java index a3e951c05..a383d910d 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/IntEditTextPreference.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/IntEditTextPreference.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.utils; @@ -16,72 +17,85 @@ import android.util.AttributeSet; import com.freerdp.freerdpcore.R; -public class IntEditTextPreference extends EditTextPreference { +public class IntEditTextPreference extends EditTextPreference +{ - private int bounds_min, bounds_max, bounds_default; + private int bounds_min, bounds_max, bounds_default; - public IntEditTextPreference(Context context) { - super(context); - init(context, null); - } + public IntEditTextPreference(Context context) + { + super(context); + init(context, null); + } - public IntEditTextPreference(Context context, AttributeSet attrs) { - super(context, attrs); - init(context, attrs); - } + public IntEditTextPreference(Context context, AttributeSet attrs) + { + super(context, attrs); + init(context, attrs); + } - public IntEditTextPreference(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - init(context, attrs); - } + public IntEditTextPreference(Context context, AttributeSet attrs, int defStyle) + { + super(context, attrs, defStyle); + init(context, attrs); + } - private void init(Context context, AttributeSet attrs) { - if (attrs != null) { - TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.IntEditTextPreference, 0, 0); - bounds_min = array.getInt(R.styleable.IntEditTextPreference_bounds_min, Integer.MIN_VALUE); - bounds_max = array.getInt(R.styleable.IntEditTextPreference_bounds_max, Integer.MAX_VALUE); - bounds_default = array.getInt(R.styleable.IntEditTextPreference_bounds_default, 0); - array.recycle(); - } else { - bounds_min = Integer.MIN_VALUE; - bounds_max = Integer.MAX_VALUE; - bounds_default = 0; - } - } + private void init(Context context, AttributeSet attrs) + { + if (attrs != null) + { + TypedArray array = + context.obtainStyledAttributes(attrs, R.styleable.IntEditTextPreference, 0, 0); + bounds_min = + array.getInt(R.styleable.IntEditTextPreference_bounds_min, Integer.MIN_VALUE); + bounds_max = + array.getInt(R.styleable.IntEditTextPreference_bounds_max, Integer.MAX_VALUE); + bounds_default = array.getInt(R.styleable.IntEditTextPreference_bounds_default, 0); + array.recycle(); + } + else + { + bounds_min = Integer.MIN_VALUE; + bounds_max = Integer.MAX_VALUE; + bounds_default = 0; + } + } - public void setBounds(int min, int max, int defaultValue) { - bounds_min = min; - bounds_max = max; - bounds_default = defaultValue; - } + public void setBounds(int min, int max, int defaultValue) + { + bounds_min = min; + bounds_max = max; + bounds_default = defaultValue; + } - @Override - protected String getPersistedString(String defaultReturnValue) { - int value = getPersistedInt(-1); - if (value > bounds_max || value < bounds_min) - value = bounds_default; - return String.valueOf(value); - } + @Override protected String getPersistedString(String defaultReturnValue) + { + int value = getPersistedInt(-1); + if (value > bounds_max || value < bounds_min) + value = bounds_default; + return String.valueOf(value); + } - @Override - protected boolean persistString(String value) { - return persistInt(Integer.valueOf(value)); - } + @Override protected boolean persistString(String value) + { + return persistInt(Integer.valueOf(value)); + } - @Override - protected void onDialogClosed(boolean positiveResult) { - if (positiveResult) { - // prevent exception when an empty value is persisted - if (getEditText().getText().length() == 0) - getEditText().setText("0"); + @Override protected void onDialogClosed(boolean positiveResult) + { + if (positiveResult) + { + // prevent exception when an empty value is persisted + if (getEditText().getText().length() == 0) + getEditText().setText("0"); - // check bounds - int value = Integer.valueOf(getEditText().getText().toString()); - if (value > bounds_max || value < bounds_min) - value = bounds_default; - getEditText().setText(String.valueOf(value)); - } + // check bounds + int value = Integer.valueOf(getEditText().getText().toString()); + if (value > bounds_max || value < bounds_min) + value = bounds_default; + getEditText().setText(String.valueOf(value)); + } - super.onDialogClosed(positiveResult); - } + super.onDialogClosed(positiveResult); + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/IntListPreference.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/IntListPreference.java index a641061ad..0b4f6433e 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/IntListPreference.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/IntListPreference.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.utils; @@ -13,23 +14,26 @@ import android.content.Context; import android.preference.ListPreference; import android.util.AttributeSet; -public class IntListPreference extends ListPreference { +public class IntListPreference extends ListPreference +{ - public IntListPreference(Context context) { - super(context); - } + public IntListPreference(Context context) + { + super(context); + } - public IntListPreference(Context context, AttributeSet attrs) { - super(context, attrs); - } + public IntListPreference(Context context, AttributeSet attrs) + { + super(context, attrs); + } - @Override - protected String getPersistedString(String defaultReturnValue) { - return String.valueOf(getPersistedInt(-1)); - } + @Override protected String getPersistedString(String defaultReturnValue) + { + return String.valueOf(getPersistedInt(-1)); + } - @Override - protected boolean persistString(String value) { - return persistInt(Integer.valueOf(value)); - } + @Override protected boolean persistString(String value) + { + return persistInt(Integer.valueOf(value)); + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/KeyboardMapper.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/KeyboardMapper.java index 170f41518..f1456b23d 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/KeyboardMapper.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/KeyboardMapper.java @@ -3,11 +3,11 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ - package com.freerdp.freerdpcore.utils; import android.content.Context; @@ -15,627 +15,711 @@ import android.view.KeyEvent; import com.freerdp.freerdpcore.R; -public class KeyboardMapper { - public static final int KEYBOARD_TYPE_FUNCTIONKEYS = 1; - public static final int KEYBOARD_TYPE_NUMPAD = 2; - public static final int KEYBOARD_TYPE_CURSOR = 3; +public class KeyboardMapper +{ + public static final int KEYBOARD_TYPE_FUNCTIONKEYS = 1; + public static final int KEYBOARD_TYPE_NUMPAD = 2; + public static final int KEYBOARD_TYPE_CURSOR = 3; - // defines key states for modifier keys - locked means on and no auto-release if an other key is pressed - public static final int KEYSTATE_ON = 1; - public static final int KEYSTATE_LOCKED = 2; - public static final int KEYSTATE_OFF = 3; - final static int VK_LBUTTON = 0x01; - final static int VK_RBUTTON = 0x02; - final static int VK_CANCEL = 0x03; - final static int VK_MBUTTON = 0x04; - final static int VK_XBUTTON1 = 0x05; - final static int VK_XBUTTON2 = 0x06; - final static int VK_BACK = 0x08; - final static int VK_TAB = 0x09; - final static int VK_CLEAR = 0x0C; - final static int VK_RETURN = 0x0D; - final static int VK_SHIFT = 0x10; - final static int VK_CONTROL = 0x11; - final static int VK_MENU = 0x12; - final static int VK_PAUSE = 0x13; - final static int VK_CAPITAL = 0x14; - final static int VK_KANA = 0x15; - final static int VK_HANGUEL = 0x15; - final static int VK_HANGUL = 0x15; - final static int VK_JUNJA = 0x17; - final static int VK_FINAL = 0x18; - final static int VK_HANJA = 0x19; - final static int VK_KANJI = 0x19; - final static int VK_ESCAPE = 0x1B; - final static int VK_CONVERT = 0x1C; - final static int VK_NONCONVERT = 0x1D; - final static int VK_ACCEPT = 0x1E; - final static int VK_MODECHANGE = 0x1F; - final static int VK_SPACE = 0x20; - final static int VK_PRIOR = 0x21; - final static int VK_NEXT = 0x22; - final static int VK_END = 0x23; - final static int VK_HOME = 0x24; - final static int VK_LEFT = 0x25; - final static int VK_UP = 0x26; - final static int VK_RIGHT = 0x27; - final static int VK_DOWN = 0x28; - final static int VK_SELECT = 0x29; - final static int VK_PRINT = 0x2A; - final static int VK_EXECUTE = 0x2B; - final static int VK_SNAPSHOT = 0x2C; - final static int VK_INSERT = 0x2D; - final static int VK_DELETE = 0x2E; - final static int VK_HELP = 0x2F; - final static int VK_KEY_0 = 0x30; - final static int VK_KEY_1 = 0x31; - final static int VK_KEY_2 = 0x32; - final static int VK_KEY_3 = 0x33; - final static int VK_KEY_4 = 0x34; - final static int VK_KEY_5 = 0x35; - final static int VK_KEY_6 = 0x36; - final static int VK_KEY_7 = 0x37; - final static int VK_KEY_8 = 0x38; - final static int VK_KEY_9 = 0x39; - final static int VK_KEY_A = 0x41; - final static int VK_KEY_B = 0x42; - final static int VK_KEY_C = 0x43; - final static int VK_KEY_D = 0x44; - final static int VK_KEY_E = 0x45; - final static int VK_KEY_F = 0x46; - final static int VK_KEY_G = 0x47; - final static int VK_KEY_H = 0x48; - final static int VK_KEY_I = 0x49; - final static int VK_KEY_J = 0x4A; - final static int VK_KEY_K = 0x4B; - final static int VK_KEY_L = 0x4C; - final static int VK_KEY_M = 0x4D; - final static int VK_KEY_N = 0x4E; - final static int VK_KEY_O = 0x4F; - final static int VK_KEY_P = 0x50; - final static int VK_KEY_Q = 0x51; - final static int VK_KEY_R = 0x52; - final static int VK_KEY_S = 0x53; - final static int VK_KEY_T = 0x54; - final static int VK_KEY_U = 0x55; - final static int VK_KEY_V = 0x56; - final static int VK_KEY_W = 0x57; - final static int VK_KEY_X = 0x58; - final static int VK_KEY_Y = 0x59; - final static int VK_KEY_Z = 0x5A; - final static int VK_LWIN = 0x5B; - final static int VK_RWIN = 0x5C; - final static int VK_APPS = 0x5D; - final static int VK_SLEEP = 0x5F; - final static int VK_NUMPAD0 = 0x60; - final static int VK_NUMPAD1 = 0x61; - final static int VK_NUMPAD2 = 0x62; - final static int VK_NUMPAD3 = 0x63; - final static int VK_NUMPAD4 = 0x64; - final static int VK_NUMPAD5 = 0x65; - final static int VK_NUMPAD6 = 0x66; - final static int VK_NUMPAD7 = 0x67; - final static int VK_NUMPAD8 = 0x68; - final static int VK_NUMPAD9 = 0x69; - final static int VK_MULTIPLY = 0x6A; - final static int VK_ADD = 0x6B; - final static int VK_SEPARATOR = 0x6C; - final static int VK_SUBTRACT = 0x6D; - final static int VK_DECIMAL = 0x6E; - final static int VK_DIVIDE = 0x6F; - final static int VK_F1 = 0x70; - final static int VK_F2 = 0x71; - final static int VK_F3 = 0x72; - final static int VK_F4 = 0x73; - final static int VK_F5 = 0x74; - final static int VK_F6 = 0x75; - final static int VK_F7 = 0x76; - final static int VK_F8 = 0x77; - final static int VK_F9 = 0x78; - final static int VK_F10 = 0x79; - final static int VK_F11 = 0x7A; - final static int VK_F12 = 0x7B; - final static int VK_F13 = 0x7C; - final static int VK_F14 = 0x7D; - final static int VK_F15 = 0x7E; - final static int VK_F16 = 0x7F; - final static int VK_F17 = 0x80; - final static int VK_F18 = 0x81; - final static int VK_F19 = 0x82; - final static int VK_F20 = 0x83; - final static int VK_F21 = 0x84; - final static int VK_F22 = 0x85; - final static int VK_F23 = 0x86; - final static int VK_F24 = 0x87; - final static int VK_NUMLOCK = 0x90; - final static int VK_SCROLL = 0x91; - final static int VK_LSHIFT = 0xA0; - final static int VK_RSHIFT = 0xA1; - final static int VK_LCONTROL = 0xA2; - final static int VK_RCONTROL = 0xA3; - final static int VK_LMENU = 0xA4; - final static int VK_RMENU = 0xA5; - final static int VK_BROWSER_BACK = 0xA6; - final static int VK_BROWSER_FORWARD = 0xA7; - final static int VK_BROWSER_REFRESH = 0xA8; - final static int VK_BROWSER_STOP = 0xA9; - final static int VK_BROWSER_SEARCH = 0xAA; - final static int VK_BROWSER_FAVORITES = 0xAB; - final static int VK_BROWSER_HOME = 0xAC; - final static int VK_VOLUME_MUTE = 0xAD; - final static int VK_VOLUME_DOWN = 0xAE; - final static int VK_VOLUME_UP = 0xAF; - final static int VK_MEDIA_NEXT_TRACK = 0xB0; - final static int VK_MEDIA_PREV_TRACK = 0xB1; - final static int VK_MEDIA_STOP = 0xB2; - final static int VK_MEDIA_PLAY_PAUSE = 0xB3; - final static int VK_LAUNCH_MAIL = 0xB4; - final static int VK_LAUNCH_MEDIA_SELECT = 0xB5; - final static int VK_LAUNCH_APP1 = 0xB6; - final static int VK_LAUNCH_APP2 = 0xB7; - final static int VK_OEM_1 = 0xBA; - final static int VK_OEM_PLUS = 0xBB; - final static int VK_OEM_COMMA = 0xBC; - final static int VK_OEM_MINUS = 0xBD; - final static int VK_OEM_PERIOD = 0xBE; - final static int VK_OEM_2 = 0xBF; - final static int VK_OEM_3 = 0xC0; - final static int VK_ABNT_C1 = 0xC1; - final static int VK_ABNT_C2 = 0xC2; - final static int VK_OEM_4 = 0xDB; - final static int VK_OEM_5 = 0xDC; - final static int VK_OEM_6 = 0xDD; - final static int VK_OEM_7 = 0xDE; - final static int VK_OEM_8 = 0xDF; - final static int VK_OEM_102 = 0xE2; - final static int VK_PROCESSKEY = 0xE5; - final static int VK_PACKET = 0xE7; - final static int VK_ATTN = 0xF6; - final static int VK_CRSEL = 0xF7; - final static int VK_EXSEL = 0xF8; - final static int VK_EREOF = 0xF9; - final static int VK_PLAY = 0xFA; - final static int VK_ZOOM = 0xFB; - final static int VK_NONAME = 0xFC; - final static int VK_PA1 = 0xFD; - final static int VK_OEM_CLEAR = 0xFE; - final static int VK_UNICODE = 0x80000000; - final static int VK_EXT_KEY = 0x00000100; - // key codes to switch between custom keyboard - private final static int EXTKEY_KBFUNCTIONKEYS = 0x1100; - private final static int EXTKEY_KBNUMPAD = 0x1101; - private final static int EXTKEY_KBCURSOR = 0x1102; - // this flag indicates if we got a VK or a unicode character in our translation map - private static final int KEY_FLAG_UNICODE = 0x80000000; - // this flag indicates if the key is a toggle key (remains down when pressed and goes up if pressed again) - private static final int KEY_FLAG_TOGGLE = 0x40000000; - private static int[] keymapAndroid; - private static int[] keymapExt; - private static boolean initialized = false; - private KeyProcessingListener listener = null; - private boolean shiftPressed = false; - private boolean ctrlPressed = false; - private boolean altPressed = false; - private boolean winPressed = false; - private long lastModifierTime; - private int lastModifierKeyCode = -1; - private boolean isShiftLocked = false; - private boolean isCtrlLocked = false; - private boolean isAltLocked = false; - private boolean isWinLocked = false; + // defines key states for modifier keys - locked means on and no auto-release if an other key is + // pressed + public static final int KEYSTATE_ON = 1; + public static final int KEYSTATE_LOCKED = 2; + public static final int KEYSTATE_OFF = 3; + final static int VK_LBUTTON = 0x01; + final static int VK_RBUTTON = 0x02; + final static int VK_CANCEL = 0x03; + final static int VK_MBUTTON = 0x04; + final static int VK_XBUTTON1 = 0x05; + final static int VK_XBUTTON2 = 0x06; + final static int VK_BACK = 0x08; + final static int VK_TAB = 0x09; + final static int VK_CLEAR = 0x0C; + final static int VK_RETURN = 0x0D; + final static int VK_SHIFT = 0x10; + final static int VK_CONTROL = 0x11; + final static int VK_MENU = 0x12; + final static int VK_PAUSE = 0x13; + final static int VK_CAPITAL = 0x14; + final static int VK_KANA = 0x15; + final static int VK_HANGUEL = 0x15; + final static int VK_HANGUL = 0x15; + final static int VK_JUNJA = 0x17; + final static int VK_FINAL = 0x18; + final static int VK_HANJA = 0x19; + final static int VK_KANJI = 0x19; + final static int VK_ESCAPE = 0x1B; + final static int VK_CONVERT = 0x1C; + final static int VK_NONCONVERT = 0x1D; + final static int VK_ACCEPT = 0x1E; + final static int VK_MODECHANGE = 0x1F; + final static int VK_SPACE = 0x20; + final static int VK_PRIOR = 0x21; + final static int VK_NEXT = 0x22; + final static int VK_END = 0x23; + final static int VK_HOME = 0x24; + final static int VK_LEFT = 0x25; + final static int VK_UP = 0x26; + final static int VK_RIGHT = 0x27; + final static int VK_DOWN = 0x28; + final static int VK_SELECT = 0x29; + final static int VK_PRINT = 0x2A; + final static int VK_EXECUTE = 0x2B; + final static int VK_SNAPSHOT = 0x2C; + final static int VK_INSERT = 0x2D; + final static int VK_DELETE = 0x2E; + final static int VK_HELP = 0x2F; + final static int VK_KEY_0 = 0x30; + final static int VK_KEY_1 = 0x31; + final static int VK_KEY_2 = 0x32; + final static int VK_KEY_3 = 0x33; + final static int VK_KEY_4 = 0x34; + final static int VK_KEY_5 = 0x35; + final static int VK_KEY_6 = 0x36; + final static int VK_KEY_7 = 0x37; + final static int VK_KEY_8 = 0x38; + final static int VK_KEY_9 = 0x39; + final static int VK_KEY_A = 0x41; + final static int VK_KEY_B = 0x42; + final static int VK_KEY_C = 0x43; + final static int VK_KEY_D = 0x44; + final static int VK_KEY_E = 0x45; + final static int VK_KEY_F = 0x46; + final static int VK_KEY_G = 0x47; + final static int VK_KEY_H = 0x48; + final static int VK_KEY_I = 0x49; + final static int VK_KEY_J = 0x4A; + final static int VK_KEY_K = 0x4B; + final static int VK_KEY_L = 0x4C; + final static int VK_KEY_M = 0x4D; + final static int VK_KEY_N = 0x4E; + final static int VK_KEY_O = 0x4F; + final static int VK_KEY_P = 0x50; + final static int VK_KEY_Q = 0x51; + final static int VK_KEY_R = 0x52; + final static int VK_KEY_S = 0x53; + final static int VK_KEY_T = 0x54; + final static int VK_KEY_U = 0x55; + final static int VK_KEY_V = 0x56; + final static int VK_KEY_W = 0x57; + final static int VK_KEY_X = 0x58; + final static int VK_KEY_Y = 0x59; + final static int VK_KEY_Z = 0x5A; + final static int VK_LWIN = 0x5B; + final static int VK_RWIN = 0x5C; + final static int VK_APPS = 0x5D; + final static int VK_SLEEP = 0x5F; + final static int VK_NUMPAD0 = 0x60; + final static int VK_NUMPAD1 = 0x61; + final static int VK_NUMPAD2 = 0x62; + final static int VK_NUMPAD3 = 0x63; + final static int VK_NUMPAD4 = 0x64; + final static int VK_NUMPAD5 = 0x65; + final static int VK_NUMPAD6 = 0x66; + final static int VK_NUMPAD7 = 0x67; + final static int VK_NUMPAD8 = 0x68; + final static int VK_NUMPAD9 = 0x69; + final static int VK_MULTIPLY = 0x6A; + final static int VK_ADD = 0x6B; + final static int VK_SEPARATOR = 0x6C; + final static int VK_SUBTRACT = 0x6D; + final static int VK_DECIMAL = 0x6E; + final static int VK_DIVIDE = 0x6F; + final static int VK_F1 = 0x70; + final static int VK_F2 = 0x71; + final static int VK_F3 = 0x72; + final static int VK_F4 = 0x73; + final static int VK_F5 = 0x74; + final static int VK_F6 = 0x75; + final static int VK_F7 = 0x76; + final static int VK_F8 = 0x77; + final static int VK_F9 = 0x78; + final static int VK_F10 = 0x79; + final static int VK_F11 = 0x7A; + final static int VK_F12 = 0x7B; + final static int VK_F13 = 0x7C; + final static int VK_F14 = 0x7D; + final static int VK_F15 = 0x7E; + final static int VK_F16 = 0x7F; + final static int VK_F17 = 0x80; + final static int VK_F18 = 0x81; + final static int VK_F19 = 0x82; + final static int VK_F20 = 0x83; + final static int VK_F21 = 0x84; + final static int VK_F22 = 0x85; + final static int VK_F23 = 0x86; + final static int VK_F24 = 0x87; + final static int VK_NUMLOCK = 0x90; + final static int VK_SCROLL = 0x91; + final static int VK_LSHIFT = 0xA0; + final static int VK_RSHIFT = 0xA1; + final static int VK_LCONTROL = 0xA2; + final static int VK_RCONTROL = 0xA3; + final static int VK_LMENU = 0xA4; + final static int VK_RMENU = 0xA5; + final static int VK_BROWSER_BACK = 0xA6; + final static int VK_BROWSER_FORWARD = 0xA7; + final static int VK_BROWSER_REFRESH = 0xA8; + final static int VK_BROWSER_STOP = 0xA9; + final static int VK_BROWSER_SEARCH = 0xAA; + final static int VK_BROWSER_FAVORITES = 0xAB; + final static int VK_BROWSER_HOME = 0xAC; + final static int VK_VOLUME_MUTE = 0xAD; + final static int VK_VOLUME_DOWN = 0xAE; + final static int VK_VOLUME_UP = 0xAF; + final static int VK_MEDIA_NEXT_TRACK = 0xB0; + final static int VK_MEDIA_PREV_TRACK = 0xB1; + final static int VK_MEDIA_STOP = 0xB2; + final static int VK_MEDIA_PLAY_PAUSE = 0xB3; + final static int VK_LAUNCH_MAIL = 0xB4; + final static int VK_LAUNCH_MEDIA_SELECT = 0xB5; + final static int VK_LAUNCH_APP1 = 0xB6; + final static int VK_LAUNCH_APP2 = 0xB7; + final static int VK_OEM_1 = 0xBA; + final static int VK_OEM_PLUS = 0xBB; + final static int VK_OEM_COMMA = 0xBC; + final static int VK_OEM_MINUS = 0xBD; + final static int VK_OEM_PERIOD = 0xBE; + final static int VK_OEM_2 = 0xBF; + final static int VK_OEM_3 = 0xC0; + final static int VK_ABNT_C1 = 0xC1; + final static int VK_ABNT_C2 = 0xC2; + final static int VK_OEM_4 = 0xDB; + final static int VK_OEM_5 = 0xDC; + final static int VK_OEM_6 = 0xDD; + final static int VK_OEM_7 = 0xDE; + final static int VK_OEM_8 = 0xDF; + final static int VK_OEM_102 = 0xE2; + final static int VK_PROCESSKEY = 0xE5; + final static int VK_PACKET = 0xE7; + final static int VK_ATTN = 0xF6; + final static int VK_CRSEL = 0xF7; + final static int VK_EXSEL = 0xF8; + final static int VK_EREOF = 0xF9; + final static int VK_PLAY = 0xFA; + final static int VK_ZOOM = 0xFB; + final static int VK_NONAME = 0xFC; + final static int VK_PA1 = 0xFD; + final static int VK_OEM_CLEAR = 0xFE; + final static int VK_UNICODE = 0x80000000; + final static int VK_EXT_KEY = 0x00000100; + // key codes to switch between custom keyboard + private final static int EXTKEY_KBFUNCTIONKEYS = 0x1100; + private final static int EXTKEY_KBNUMPAD = 0x1101; + private final static int EXTKEY_KBCURSOR = 0x1102; + // this flag indicates if we got a VK or a unicode character in our translation map + private static final int KEY_FLAG_UNICODE = 0x80000000; + // this flag indicates if the key is a toggle key (remains down when pressed and goes up if + // pressed again) + private static final int KEY_FLAG_TOGGLE = 0x40000000; + private static int[] keymapAndroid; + private static int[] keymapExt; + private static boolean initialized = false; + private KeyProcessingListener listener = null; + private boolean shiftPressed = false; + private boolean ctrlPressed = false; + private boolean altPressed = false; + private boolean winPressed = false; + private long lastModifierTime; + private int lastModifierKeyCode = -1; + private boolean isShiftLocked = false; + private boolean isCtrlLocked = false; + private boolean isAltLocked = false; + private boolean isWinLocked = false; - public void init(Context context) { - if (initialized == true) - return; + public void init(Context context) + { + if (initialized == true) + return; - keymapAndroid = new int[256]; + keymapAndroid = new int[256]; - keymapAndroid[KeyEvent.KEYCODE_0] = VK_KEY_0; - keymapAndroid[KeyEvent.KEYCODE_1] = VK_KEY_1; - keymapAndroid[KeyEvent.KEYCODE_2] = VK_KEY_2; - keymapAndroid[KeyEvent.KEYCODE_3] = VK_KEY_3; - keymapAndroid[KeyEvent.KEYCODE_4] = VK_KEY_4; - keymapAndroid[KeyEvent.KEYCODE_5] = VK_KEY_5; - keymapAndroid[KeyEvent.KEYCODE_6] = VK_KEY_6; - keymapAndroid[KeyEvent.KEYCODE_7] = VK_KEY_7; - keymapAndroid[KeyEvent.KEYCODE_8] = VK_KEY_8; - keymapAndroid[KeyEvent.KEYCODE_9] = VK_KEY_9; + keymapAndroid[KeyEvent.KEYCODE_0] = VK_KEY_0; + keymapAndroid[KeyEvent.KEYCODE_1] = VK_KEY_1; + keymapAndroid[KeyEvent.KEYCODE_2] = VK_KEY_2; + keymapAndroid[KeyEvent.KEYCODE_3] = VK_KEY_3; + keymapAndroid[KeyEvent.KEYCODE_4] = VK_KEY_4; + keymapAndroid[KeyEvent.KEYCODE_5] = VK_KEY_5; + keymapAndroid[KeyEvent.KEYCODE_6] = VK_KEY_6; + keymapAndroid[KeyEvent.KEYCODE_7] = VK_KEY_7; + keymapAndroid[KeyEvent.KEYCODE_8] = VK_KEY_8; + keymapAndroid[KeyEvent.KEYCODE_9] = VK_KEY_9; - keymapAndroid[KeyEvent.KEYCODE_A] = VK_KEY_A; - keymapAndroid[KeyEvent.KEYCODE_B] = VK_KEY_B; - keymapAndroid[KeyEvent.KEYCODE_C] = VK_KEY_C; - keymapAndroid[KeyEvent.KEYCODE_D] = VK_KEY_D; - keymapAndroid[KeyEvent.KEYCODE_E] = VK_KEY_E; - keymapAndroid[KeyEvent.KEYCODE_F] = VK_KEY_F; - keymapAndroid[KeyEvent.KEYCODE_G] = VK_KEY_G; - keymapAndroid[KeyEvent.KEYCODE_H] = VK_KEY_H; - keymapAndroid[KeyEvent.KEYCODE_I] = VK_KEY_I; - keymapAndroid[KeyEvent.KEYCODE_J] = VK_KEY_J; - keymapAndroid[KeyEvent.KEYCODE_K] = VK_KEY_K; - keymapAndroid[KeyEvent.KEYCODE_L] = VK_KEY_L; - keymapAndroid[KeyEvent.KEYCODE_M] = VK_KEY_M; - keymapAndroid[KeyEvent.KEYCODE_N] = VK_KEY_N; - keymapAndroid[KeyEvent.KEYCODE_O] = VK_KEY_O; - keymapAndroid[KeyEvent.KEYCODE_P] = VK_KEY_P; - keymapAndroid[KeyEvent.KEYCODE_Q] = VK_KEY_Q; - keymapAndroid[KeyEvent.KEYCODE_R] = VK_KEY_R; - keymapAndroid[KeyEvent.KEYCODE_S] = VK_KEY_S; - keymapAndroid[KeyEvent.KEYCODE_T] = VK_KEY_T; - keymapAndroid[KeyEvent.KEYCODE_U] = VK_KEY_U; - keymapAndroid[KeyEvent.KEYCODE_V] = VK_KEY_V; - keymapAndroid[KeyEvent.KEYCODE_W] = VK_KEY_W; - keymapAndroid[KeyEvent.KEYCODE_X] = VK_KEY_X; - keymapAndroid[KeyEvent.KEYCODE_Y] = VK_KEY_Y; - keymapAndroid[KeyEvent.KEYCODE_Z] = VK_KEY_Z; + keymapAndroid[KeyEvent.KEYCODE_A] = VK_KEY_A; + keymapAndroid[KeyEvent.KEYCODE_B] = VK_KEY_B; + keymapAndroid[KeyEvent.KEYCODE_C] = VK_KEY_C; + keymapAndroid[KeyEvent.KEYCODE_D] = VK_KEY_D; + keymapAndroid[KeyEvent.KEYCODE_E] = VK_KEY_E; + keymapAndroid[KeyEvent.KEYCODE_F] = VK_KEY_F; + keymapAndroid[KeyEvent.KEYCODE_G] = VK_KEY_G; + keymapAndroid[KeyEvent.KEYCODE_H] = VK_KEY_H; + keymapAndroid[KeyEvent.KEYCODE_I] = VK_KEY_I; + keymapAndroid[KeyEvent.KEYCODE_J] = VK_KEY_J; + keymapAndroid[KeyEvent.KEYCODE_K] = VK_KEY_K; + keymapAndroid[KeyEvent.KEYCODE_L] = VK_KEY_L; + keymapAndroid[KeyEvent.KEYCODE_M] = VK_KEY_M; + keymapAndroid[KeyEvent.KEYCODE_N] = VK_KEY_N; + keymapAndroid[KeyEvent.KEYCODE_O] = VK_KEY_O; + keymapAndroid[KeyEvent.KEYCODE_P] = VK_KEY_P; + keymapAndroid[KeyEvent.KEYCODE_Q] = VK_KEY_Q; + keymapAndroid[KeyEvent.KEYCODE_R] = VK_KEY_R; + keymapAndroid[KeyEvent.KEYCODE_S] = VK_KEY_S; + keymapAndroid[KeyEvent.KEYCODE_T] = VK_KEY_T; + keymapAndroid[KeyEvent.KEYCODE_U] = VK_KEY_U; + keymapAndroid[KeyEvent.KEYCODE_V] = VK_KEY_V; + keymapAndroid[KeyEvent.KEYCODE_W] = VK_KEY_W; + keymapAndroid[KeyEvent.KEYCODE_X] = VK_KEY_X; + keymapAndroid[KeyEvent.KEYCODE_Y] = VK_KEY_Y; + keymapAndroid[KeyEvent.KEYCODE_Z] = VK_KEY_Z; - keymapAndroid[KeyEvent.KEYCODE_DEL] = VK_BACK; - keymapAndroid[KeyEvent.KEYCODE_ENTER] = VK_RETURN; - keymapAndroid[KeyEvent.KEYCODE_SPACE] = VK_SPACE; - keymapAndroid[KeyEvent.KEYCODE_TAB] = VK_TAB; -// keymapAndroid[KeyEvent.KEYCODE_SHIFT_LEFT] = VK_LSHIFT; -// keymapAndroid[KeyEvent.KEYCODE_SHIFT_RIGHT] = VK_RSHIFT; + keymapAndroid[KeyEvent.KEYCODE_DEL] = VK_BACK; + keymapAndroid[KeyEvent.KEYCODE_ENTER] = VK_RETURN; + keymapAndroid[KeyEvent.KEYCODE_SPACE] = VK_SPACE; + keymapAndroid[KeyEvent.KEYCODE_TAB] = VK_TAB; + // keymapAndroid[KeyEvent.KEYCODE_SHIFT_LEFT] = VK_LSHIFT; + // keymapAndroid[KeyEvent.KEYCODE_SHIFT_RIGHT] = VK_RSHIFT; -// keymapAndroid[KeyEvent.KEYCODE_DPAD_DOWN] = VK_DOWN; -// keymapAndroid[KeyEvent.KEYCODE_DPAD_LEFT] = VK_LEFT; -// keymapAndroid[KeyEvent.KEYCODE_DPAD_RIGHT] = VK_RIGHT; -// keymapAndroid[KeyEvent.KEYCODE_DPAD_UP] = VK_UP; + // keymapAndroid[KeyEvent.KEYCODE_DPAD_DOWN] = VK_DOWN; + // keymapAndroid[KeyEvent.KEYCODE_DPAD_LEFT] = VK_LEFT; + // keymapAndroid[KeyEvent.KEYCODE_DPAD_RIGHT] = VK_RIGHT; + // keymapAndroid[KeyEvent.KEYCODE_DPAD_UP] = VK_UP; -// keymapAndroid[KeyEvent.KEYCODE_COMMA] = VK_OEM_COMMA; -// keymapAndroid[KeyEvent.KEYCODE_PERIOD] = VK_OEM_PERIOD; -// keymapAndroid[KeyEvent.KEYCODE_MINUS] = VK_OEM_MINUS; -// keymapAndroid[KeyEvent.KEYCODE_PLUS] = VK_OEM_PLUS; + // keymapAndroid[KeyEvent.KEYCODE_COMMA] = VK_OEM_COMMA; + // keymapAndroid[KeyEvent.KEYCODE_PERIOD] = VK_OEM_PERIOD; + // keymapAndroid[KeyEvent.KEYCODE_MINUS] = VK_OEM_MINUS; + // keymapAndroid[KeyEvent.KEYCODE_PLUS] = VK_OEM_PLUS; -// keymapAndroid[KeyEvent.KEYCODE_ALT_LEFT] = VK_LMENU; -// keymapAndroid[KeyEvent.KEYCODE_ALT_RIGHT] = VK_RMENU; + // keymapAndroid[KeyEvent.KEYCODE_ALT_LEFT] = VK_LMENU; + // keymapAndroid[KeyEvent.KEYCODE_ALT_RIGHT] = VK_RMENU; -// keymapAndroid[KeyEvent.KEYCODE_AT] = (KEY_FLAG_UNICODE | 64); -// keymapAndroid[KeyEvent.KEYCODE_APOSTROPHE] = (KEY_FLAG_UNICODE | 39); -// keymapAndroid[KeyEvent.KEYCODE_BACKSLASH] = (KEY_FLAG_UNICODE | 92); -// keymapAndroid[KeyEvent.KEYCODE_COMMA] = (KEY_FLAG_UNICODE | 44); -// keymapAndroid[KeyEvent.KEYCODE_EQUALS] = (KEY_FLAG_UNICODE | 61); -// keymapAndroid[KeyEvent.KEYCODE_GRAVE] = (KEY_FLAG_UNICODE | 96); -// keymapAndroid[KeyEvent.KEYCODE_LEFT_BRACKET] = (KEY_FLAG_UNICODE | 91); -// keymapAndroid[KeyEvent.KEYCODE_RIGHT_BRACKET] = (KEY_FLAG_UNICODE | 93); -// keymapAndroid[KeyEvent.KEYCODE_MINUS] = (KEY_FLAG_UNICODE | 45); -// keymapAndroid[KeyEvent.KEYCODE_PERIOD] = (KEY_FLAG_UNICODE | 46); -// keymapAndroid[KeyEvent.KEYCODE_PLUS] = (KEY_FLAG_UNICODE | 43); -// keymapAndroid[KeyEvent.KEYCODE_POUND] = (KEY_FLAG_UNICODE | 35); -// keymapAndroid[KeyEvent.KEYCODE_SEMICOLON] = (KEY_FLAG_UNICODE | 59); -// keymapAndroid[KeyEvent.KEYCODE_SLASH] = (KEY_FLAG_UNICODE | 47); -// keymapAndroid[KeyEvent.KEYCODE_STAR] = (KEY_FLAG_UNICODE | 42); + // keymapAndroid[KeyEvent.KEYCODE_AT] = (KEY_FLAG_UNICODE | 64); + // keymapAndroid[KeyEvent.KEYCODE_APOSTROPHE] = (KEY_FLAG_UNICODE | 39); + // keymapAndroid[KeyEvent.KEYCODE_BACKSLASH] = (KEY_FLAG_UNICODE | 92); + // keymapAndroid[KeyEvent.KEYCODE_COMMA] = (KEY_FLAG_UNICODE | 44); + // keymapAndroid[KeyEvent.KEYCODE_EQUALS] = (KEY_FLAG_UNICODE | 61); + // keymapAndroid[KeyEvent.KEYCODE_GRAVE] = (KEY_FLAG_UNICODE | 96); + // keymapAndroid[KeyEvent.KEYCODE_LEFT_BRACKET] = (KEY_FLAG_UNICODE | 91); + // keymapAndroid[KeyEvent.KEYCODE_RIGHT_BRACKET] = (KEY_FLAG_UNICODE | 93); + // keymapAndroid[KeyEvent.KEYCODE_MINUS] = (KEY_FLAG_UNICODE | 45); + // keymapAndroid[KeyEvent.KEYCODE_PERIOD] = (KEY_FLAG_UNICODE | 46); + // keymapAndroid[KeyEvent.KEYCODE_PLUS] = (KEY_FLAG_UNICODE | 43); + // keymapAndroid[KeyEvent.KEYCODE_POUND] = (KEY_FLAG_UNICODE | 35); + // keymapAndroid[KeyEvent.KEYCODE_SEMICOLON] = (KEY_FLAG_UNICODE | 59); + // keymapAndroid[KeyEvent.KEYCODE_SLASH] = (KEY_FLAG_UNICODE | 47); + // keymapAndroid[KeyEvent.KEYCODE_STAR] = (KEY_FLAG_UNICODE | 42); - // special keys mapping - keymapExt = new int[256]; - keymapExt[context.getResources().getInteger(R.integer.keycode_F1)] = VK_F1; - keymapExt[context.getResources().getInteger(R.integer.keycode_F2)] = VK_F2; - keymapExt[context.getResources().getInteger(R.integer.keycode_F3)] = VK_F3; - keymapExt[context.getResources().getInteger(R.integer.keycode_F4)] = VK_F4; - keymapExt[context.getResources().getInteger(R.integer.keycode_F5)] = VK_F5; - keymapExt[context.getResources().getInteger(R.integer.keycode_F6)] = VK_F6; - keymapExt[context.getResources().getInteger(R.integer.keycode_F7)] = VK_F7; - keymapExt[context.getResources().getInteger(R.integer.keycode_F8)] = VK_F8; - keymapExt[context.getResources().getInteger(R.integer.keycode_F9)] = VK_F9; - keymapExt[context.getResources().getInteger(R.integer.keycode_F10)] = VK_F10; - keymapExt[context.getResources().getInteger(R.integer.keycode_F11)] = VK_F11; - keymapExt[context.getResources().getInteger(R.integer.keycode_F12)] = VK_F12; - keymapExt[context.getResources().getInteger(R.integer.keycode_tab)] = VK_TAB; - keymapExt[context.getResources().getInteger(R.integer.keycode_print)] = VK_PRINT; - keymapExt[context.getResources().getInteger(R.integer.keycode_insert)] = VK_INSERT | VK_EXT_KEY; - keymapExt[context.getResources().getInteger(R.integer.keycode_delete)] = VK_DELETE | VK_EXT_KEY; - keymapExt[context.getResources().getInteger(R.integer.keycode_home)] = VK_HOME | VK_EXT_KEY; - keymapExt[context.getResources().getInteger(R.integer.keycode_end)] = VK_END | VK_EXT_KEY; - keymapExt[context.getResources().getInteger(R.integer.keycode_pgup)] = VK_PRIOR | VK_EXT_KEY; - keymapExt[context.getResources().getInteger(R.integer.keycode_pgdn)] = VK_NEXT | VK_EXT_KEY; + // special keys mapping + keymapExt = new int[256]; + keymapExt[context.getResources().getInteger(R.integer.keycode_F1)] = VK_F1; + keymapExt[context.getResources().getInteger(R.integer.keycode_F2)] = VK_F2; + keymapExt[context.getResources().getInteger(R.integer.keycode_F3)] = VK_F3; + keymapExt[context.getResources().getInteger(R.integer.keycode_F4)] = VK_F4; + keymapExt[context.getResources().getInteger(R.integer.keycode_F5)] = VK_F5; + keymapExt[context.getResources().getInteger(R.integer.keycode_F6)] = VK_F6; + keymapExt[context.getResources().getInteger(R.integer.keycode_F7)] = VK_F7; + keymapExt[context.getResources().getInteger(R.integer.keycode_F8)] = VK_F8; + keymapExt[context.getResources().getInteger(R.integer.keycode_F9)] = VK_F9; + keymapExt[context.getResources().getInteger(R.integer.keycode_F10)] = VK_F10; + keymapExt[context.getResources().getInteger(R.integer.keycode_F11)] = VK_F11; + keymapExt[context.getResources().getInteger(R.integer.keycode_F12)] = VK_F12; + keymapExt[context.getResources().getInteger(R.integer.keycode_tab)] = VK_TAB; + keymapExt[context.getResources().getInteger(R.integer.keycode_print)] = VK_PRINT; + keymapExt[context.getResources().getInteger(R.integer.keycode_insert)] = + VK_INSERT | VK_EXT_KEY; + keymapExt[context.getResources().getInteger(R.integer.keycode_delete)] = + VK_DELETE | VK_EXT_KEY; + keymapExt[context.getResources().getInteger(R.integer.keycode_home)] = VK_HOME | VK_EXT_KEY; + keymapExt[context.getResources().getInteger(R.integer.keycode_end)] = VK_END | VK_EXT_KEY; + keymapExt[context.getResources().getInteger(R.integer.keycode_pgup)] = + VK_PRIOR | VK_EXT_KEY; + keymapExt[context.getResources().getInteger(R.integer.keycode_pgdn)] = VK_NEXT | VK_EXT_KEY; - // numpad mapping - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_0)] = VK_NUMPAD0; - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_1)] = VK_NUMPAD1; - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_2)] = VK_NUMPAD2; - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_3)] = VK_NUMPAD3; - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_4)] = VK_NUMPAD4; - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_5)] = VK_NUMPAD5; - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_6)] = VK_NUMPAD6; - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_7)] = VK_NUMPAD7; - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_8)] = VK_NUMPAD8; - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_9)] = VK_NUMPAD9; - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_numlock)] = VK_NUMLOCK; - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_add)] = VK_ADD; - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_comma)] = VK_DECIMAL; - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_divide)] = VK_DIVIDE | VK_EXT_KEY; - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_enter)] = VK_RETURN | VK_EXT_KEY; - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_multiply)] = VK_MULTIPLY; - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_subtract)] = VK_SUBTRACT; - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_equals)] = (KEY_FLAG_UNICODE | 61); - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_left_paren)] = (KEY_FLAG_UNICODE | 40); - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_right_paren)] = (KEY_FLAG_UNICODE | 41); + // numpad mapping + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_0)] = VK_NUMPAD0; + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_1)] = VK_NUMPAD1; + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_2)] = VK_NUMPAD2; + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_3)] = VK_NUMPAD3; + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_4)] = VK_NUMPAD4; + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_5)] = VK_NUMPAD5; + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_6)] = VK_NUMPAD6; + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_7)] = VK_NUMPAD7; + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_8)] = VK_NUMPAD8; + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_9)] = VK_NUMPAD9; + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_numlock)] = VK_NUMLOCK; + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_add)] = VK_ADD; + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_comma)] = VK_DECIMAL; + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_divide)] = + VK_DIVIDE | VK_EXT_KEY; + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_enter)] = + VK_RETURN | VK_EXT_KEY; + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_multiply)] = + VK_MULTIPLY; + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_subtract)] = + VK_SUBTRACT; + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_equals)] = + (KEY_FLAG_UNICODE | 61); + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_left_paren)] = + (KEY_FLAG_UNICODE | 40); + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_right_paren)] = + (KEY_FLAG_UNICODE | 41); - // cursor key codes - keymapExt[context.getResources().getInteger(R.integer.keycode_up)] = VK_UP | VK_EXT_KEY; - keymapExt[context.getResources().getInteger(R.integer.keycode_down)] = VK_DOWN | VK_EXT_KEY; - keymapExt[context.getResources().getInteger(R.integer.keycode_left)] = VK_LEFT | VK_EXT_KEY; - keymapExt[context.getResources().getInteger(R.integer.keycode_right)] = VK_RIGHT | VK_EXT_KEY; - keymapExt[context.getResources().getInteger(R.integer.keycode_enter)] = VK_RETURN | VK_EXT_KEY; - keymapExt[context.getResources().getInteger(R.integer.keycode_backspace)] = VK_BACK; + // cursor key codes + keymapExt[context.getResources().getInteger(R.integer.keycode_up)] = VK_UP | VK_EXT_KEY; + keymapExt[context.getResources().getInteger(R.integer.keycode_down)] = VK_DOWN | VK_EXT_KEY; + keymapExt[context.getResources().getInteger(R.integer.keycode_left)] = VK_LEFT | VK_EXT_KEY; + keymapExt[context.getResources().getInteger(R.integer.keycode_right)] = + VK_RIGHT | VK_EXT_KEY; + keymapExt[context.getResources().getInteger(R.integer.keycode_enter)] = + VK_RETURN | VK_EXT_KEY; + keymapExt[context.getResources().getInteger(R.integer.keycode_backspace)] = VK_BACK; - // shared keys - keymapExt[context.getResources().getInteger(R.integer.keycode_win)] = VK_LWIN | VK_EXT_KEY; - keymapExt[context.getResources().getInteger(R.integer.keycode_menu)] = VK_APPS | VK_EXT_KEY; - keymapExt[context.getResources().getInteger(R.integer.keycode_esc)] = VK_ESCAPE; + // shared keys + keymapExt[context.getResources().getInteger(R.integer.keycode_win)] = VK_LWIN | VK_EXT_KEY; + keymapExt[context.getResources().getInteger(R.integer.keycode_menu)] = VK_APPS | VK_EXT_KEY; + keymapExt[context.getResources().getInteger(R.integer.keycode_esc)] = VK_ESCAPE; -/* keymapExt[context.getResources().getInteger(R.integer.keycode_modifier_ctrl)] = VK_LCONTROL; - keymapExt[context.getResources().getInteger(R.integer.keycode_modifier_alt)] = VK_LMENU; - keymapExt[context.getResources().getInteger(R.integer.keycode_modifier_shift)] = VK_LSHIFT; -*/ - // get custom keyboard key codes - keymapExt[context.getResources().getInteger(R.integer.keycode_specialkeys_keyboard)] = EXTKEY_KBFUNCTIONKEYS; - keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_keyboard)] = EXTKEY_KBNUMPAD; - keymapExt[context.getResources().getInteger(R.integer.keycode_cursor_keyboard)] = EXTKEY_KBCURSOR; + /* keymapExt[context.getResources().getInteger(R.integer.keycode_modifier_ctrl)] = + VK_LCONTROL; keymapExt[context.getResources().getInteger(R.integer.keycode_modifier_alt)] + = VK_LMENU; + keymapExt[context.getResources().getInteger(R.integer.keycode_modifier_shift)] = + VK_LSHIFT; + */ + // get custom keyboard key codes + keymapExt[context.getResources().getInteger(R.integer.keycode_specialkeys_keyboard)] = + EXTKEY_KBFUNCTIONKEYS; + keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_keyboard)] = + EXTKEY_KBNUMPAD; + keymapExt[context.getResources().getInteger(R.integer.keycode_cursor_keyboard)] = + EXTKEY_KBCURSOR; - keymapExt[context.getResources().getInteger(R.integer.keycode_toggle_shift)] = (KEY_FLAG_TOGGLE | VK_LSHIFT); - keymapExt[context.getResources().getInteger(R.integer.keycode_toggle_ctrl)] = (KEY_FLAG_TOGGLE | VK_LCONTROL); - keymapExt[context.getResources().getInteger(R.integer.keycode_toggle_alt)] = (KEY_FLAG_TOGGLE | VK_LMENU); - keymapExt[context.getResources().getInteger(R.integer.keycode_toggle_win)] = (KEY_FLAG_TOGGLE | VK_LWIN); + keymapExt[context.getResources().getInteger(R.integer.keycode_toggle_shift)] = + (KEY_FLAG_TOGGLE | VK_LSHIFT); + keymapExt[context.getResources().getInteger(R.integer.keycode_toggle_ctrl)] = + (KEY_FLAG_TOGGLE | VK_LCONTROL); + keymapExt[context.getResources().getInteger(R.integer.keycode_toggle_alt)] = + (KEY_FLAG_TOGGLE | VK_LMENU); + keymapExt[context.getResources().getInteger(R.integer.keycode_toggle_win)] = + (KEY_FLAG_TOGGLE | VK_LWIN); - initialized = true; - } + initialized = true; + } - public void reset(KeyProcessingListener listener) { - shiftPressed = false; - ctrlPressed = false; - altPressed = false; - winPressed = false; - setKeyProcessingListener(listener); - } + public void reset(KeyProcessingListener listener) + { + shiftPressed = false; + ctrlPressed = false; + altPressed = false; + winPressed = false; + setKeyProcessingListener(listener); + } - public void setKeyProcessingListener(KeyProcessingListener listener) { - this.listener = listener; - } + public void setKeyProcessingListener(KeyProcessingListener listener) + { + this.listener = listener; + } - public boolean processAndroidKeyEvent(KeyEvent event) { - switch (event.getAction()) { - // we only process down events - case KeyEvent.ACTION_UP: { - return false; - } + public boolean processAndroidKeyEvent(KeyEvent event) + { + switch (event.getAction()) + { + // we only process down events + case KeyEvent.ACTION_UP: + { + return false; + } - case KeyEvent.ACTION_DOWN: { - boolean modifierActive = isModifierPressed(); - // if a modifier is pressed we will send a VK event (if possible) so that key combinations will be - // recognized correctly. Otherwise we will send the unicode key. At the end we will reset all modifiers - // and notifiy our listener. - int vkcode = getVirtualKeyCode(event.getKeyCode()); - if ((vkcode & KEY_FLAG_UNICODE) != 0) - listener.processUnicodeKey(vkcode & (~KEY_FLAG_UNICODE)); - // if we got a valid vkcode send it - except for letters/numbers if a modifier is active - else if (vkcode > 0 && (event.getMetaState() & (KeyEvent.META_ALT_ON | KeyEvent.META_SHIFT_ON | KeyEvent.META_SYM_ON)) == 0) { - listener.processVirtualKey(vkcode, true); - listener.processVirtualKey(vkcode, false); - } else if (event.isShiftPressed() && vkcode != 0) { - listener.processVirtualKey(VK_LSHIFT, true); - listener.processVirtualKey(vkcode, true); - listener.processVirtualKey(vkcode, false); - listener.processVirtualKey(VK_LSHIFT, false); - } else if (event.getUnicodeChar() != 0) - listener.processUnicodeKey(event.getUnicodeChar()); - else - return false; + case KeyEvent.ACTION_DOWN: + { + boolean modifierActive = isModifierPressed(); + // if a modifier is pressed we will send a VK event (if possible) so that key + // combinations will be recognized correctly. Otherwise we will send the unicode + // key. At the end we will reset all modifiers and notifiy our listener. + int vkcode = getVirtualKeyCode(event.getKeyCode()); + if ((vkcode & KEY_FLAG_UNICODE) != 0) + listener.processUnicodeKey(vkcode & (~KEY_FLAG_UNICODE)); + // if we got a valid vkcode send it - except for letters/numbers if a modifier is + // active + else if (vkcode > 0 && + (event.getMetaState() & (KeyEvent.META_ALT_ON | KeyEvent.META_SHIFT_ON | + KeyEvent.META_SYM_ON)) == 0) + { + listener.processVirtualKey(vkcode, true); + listener.processVirtualKey(vkcode, false); + } + else if (event.isShiftPressed() && vkcode != 0) + { + listener.processVirtualKey(VK_LSHIFT, true); + listener.processVirtualKey(vkcode, true); + listener.processVirtualKey(vkcode, false); + listener.processVirtualKey(VK_LSHIFT, false); + } + else if (event.getUnicodeChar() != 0) + listener.processUnicodeKey(event.getUnicodeChar()); + else + return false; - // reset any pending toggle states if a modifier was pressed - if (modifierActive) - resetModifierKeysAfterInput(false); - return true; - } + // reset any pending toggle states if a modifier was pressed + if (modifierActive) + resetModifierKeysAfterInput(false); + return true; + } - case KeyEvent.ACTION_MULTIPLE: { - String str = event.getCharacters(); - for (int i = 0; i < str.length(); i++) - listener.processUnicodeKey(str.charAt(i)); - return true; - } + case KeyEvent.ACTION_MULTIPLE: + { + String str = event.getCharacters(); + for (int i = 0; i < str.length(); i++) + listener.processUnicodeKey(str.charAt(i)); + return true; + } - default: - break; - } - return false; - } + default: + break; + } + return false; + } - public void processCustomKeyEvent(int keycode) { - int extCode = getExtendedKeyCode(keycode); - if (extCode == 0) - return; + public void processCustomKeyEvent(int keycode) + { + int extCode = getExtendedKeyCode(keycode); + if (extCode == 0) + return; - // toggle button pressed? - if ((extCode & KEY_FLAG_TOGGLE) != 0) { - processToggleButton(extCode & (~KEY_FLAG_TOGGLE)); - return; - } + // toggle button pressed? + if ((extCode & KEY_FLAG_TOGGLE) != 0) + { + processToggleButton(extCode & (~KEY_FLAG_TOGGLE)); + return; + } - // keyboard switch button pressed? - if (extCode == EXTKEY_KBFUNCTIONKEYS || extCode == EXTKEY_KBNUMPAD || extCode == EXTKEY_KBCURSOR) { - switchKeyboard(extCode); - return; - } + // keyboard switch button pressed? + if (extCode == EXTKEY_KBFUNCTIONKEYS || extCode == EXTKEY_KBNUMPAD || + extCode == EXTKEY_KBCURSOR) + { + switchKeyboard(extCode); + return; + } - // nope - see if we got a unicode or vk - if ((extCode & KEY_FLAG_UNICODE) != 0) - listener.processUnicodeKey(extCode & (~KEY_FLAG_UNICODE)); - else { - listener.processVirtualKey(extCode, true); - listener.processVirtualKey(extCode, false); - } + // nope - see if we got a unicode or vk + if ((extCode & KEY_FLAG_UNICODE) != 0) + listener.processUnicodeKey(extCode & (~KEY_FLAG_UNICODE)); + else + { + listener.processVirtualKey(extCode, true); + listener.processVirtualKey(extCode, false); + } - resetModifierKeysAfterInput(false); - } + resetModifierKeysAfterInput(false); + } - public void sendAltF4() { - listener.processVirtualKey(VK_LMENU, true); - listener.processVirtualKey(VK_F4, true); - listener.processVirtualKey(VK_F4, false); - listener.processVirtualKey(VK_LMENU, false); - } + public void sendAltF4() + { + listener.processVirtualKey(VK_LMENU, true); + listener.processVirtualKey(VK_F4, true); + listener.processVirtualKey(VK_F4, false); + listener.processVirtualKey(VK_LMENU, false); + } - private boolean isModifierPressed() { - return (shiftPressed || ctrlPressed || altPressed || winPressed); - } + private boolean isModifierPressed() + { + return (shiftPressed || ctrlPressed || altPressed || winPressed); + } - public int getModifierState(int keycode) { - int modifierCode = getExtendedKeyCode(keycode); + public int getModifierState(int keycode) + { + int modifierCode = getExtendedKeyCode(keycode); - // check and get real modifier keycode - if ((modifierCode & KEY_FLAG_TOGGLE) == 0) - return -1; - modifierCode = modifierCode & (~KEY_FLAG_TOGGLE); + // check and get real modifier keycode + if ((modifierCode & KEY_FLAG_TOGGLE) == 0) + return -1; + modifierCode = modifierCode & (~KEY_FLAG_TOGGLE); - switch (modifierCode) { - case VK_LSHIFT: { - return (shiftPressed ? (isShiftLocked ? KEYSTATE_LOCKED : KEYSTATE_ON) : KEYSTATE_OFF); - } - case VK_LCONTROL: { - return (ctrlPressed ? (isCtrlLocked ? KEYSTATE_LOCKED : KEYSTATE_ON) : KEYSTATE_OFF); - } - case VK_LMENU: { - return (altPressed ? (isAltLocked ? KEYSTATE_LOCKED : KEYSTATE_ON) : KEYSTATE_OFF); - } - case VK_LWIN: { - return (winPressed ? (isWinLocked ? KEYSTATE_LOCKED : KEYSTATE_ON) : KEYSTATE_OFF); - } - } + switch (modifierCode) + { + case VK_LSHIFT: + { + return (shiftPressed ? (isShiftLocked ? KEYSTATE_LOCKED : KEYSTATE_ON) + : KEYSTATE_OFF); + } + case VK_LCONTROL: + { + return (ctrlPressed ? (isCtrlLocked ? KEYSTATE_LOCKED : KEYSTATE_ON) + : KEYSTATE_OFF); + } + case VK_LMENU: + { + return (altPressed ? (isAltLocked ? KEYSTATE_LOCKED : KEYSTATE_ON) : KEYSTATE_OFF); + } + case VK_LWIN: + { + return (winPressed ? (isWinLocked ? KEYSTATE_LOCKED : KEYSTATE_ON) : KEYSTATE_OFF); + } + } - return -1; - } + return -1; + } - private int getVirtualKeyCode(int keycode) { - if (keycode >= 0 && keycode <= 0xFF) - return keymapAndroid[keycode]; - return 0; - } + private int getVirtualKeyCode(int keycode) + { + if (keycode >= 0 && keycode <= 0xFF) + return keymapAndroid[keycode]; + return 0; + } - private int getExtendedKeyCode(int keycode) { - if (keycode >= 0 && keycode <= 0xFF) - return keymapExt[keycode]; - return 0; - } + private int getExtendedKeyCode(int keycode) + { + if (keycode >= 0 && keycode <= 0xFF) + return keymapExt[keycode]; + return 0; + } - private void processToggleButton(int keycode) { - switch (keycode) { - case VK_LSHIFT: { - if (!checkToggleModifierLock(VK_LSHIFT)) { - isShiftLocked = false; - shiftPressed = !shiftPressed; - listener.processVirtualKey(VK_LSHIFT, shiftPressed); - } else - isShiftLocked = true; - break; - } - case VK_LCONTROL: { - if (!checkToggleModifierLock(VK_LCONTROL)) { - isCtrlLocked = false; - ctrlPressed = !ctrlPressed; - listener.processVirtualKey(VK_LCONTROL, ctrlPressed); - } else - isCtrlLocked = true; - break; - } - case VK_LMENU: { - if (!checkToggleModifierLock(VK_LMENU)) { - isAltLocked = false; - altPressed = !altPressed; - listener.processVirtualKey(VK_LMENU, altPressed); - } else - isAltLocked = true; - break; - } - case VK_LWIN: { - if (!checkToggleModifierLock(VK_LWIN)) { - isWinLocked = false; - winPressed = !winPressed; - listener.processVirtualKey(VK_LWIN | VK_EXT_KEY, winPressed); - } else - isWinLocked = true; - break; - } - } - listener.modifiersChanged(); - } + private void processToggleButton(int keycode) + { + switch (keycode) + { + case VK_LSHIFT: + { + if (!checkToggleModifierLock(VK_LSHIFT)) + { + isShiftLocked = false; + shiftPressed = !shiftPressed; + listener.processVirtualKey(VK_LSHIFT, shiftPressed); + } + else + isShiftLocked = true; + break; + } + case VK_LCONTROL: + { + if (!checkToggleModifierLock(VK_LCONTROL)) + { + isCtrlLocked = false; + ctrlPressed = !ctrlPressed; + listener.processVirtualKey(VK_LCONTROL, ctrlPressed); + } + else + isCtrlLocked = true; + break; + } + case VK_LMENU: + { + if (!checkToggleModifierLock(VK_LMENU)) + { + isAltLocked = false; + altPressed = !altPressed; + listener.processVirtualKey(VK_LMENU, altPressed); + } + else + isAltLocked = true; + break; + } + case VK_LWIN: + { + if (!checkToggleModifierLock(VK_LWIN)) + { + isWinLocked = false; + winPressed = !winPressed; + listener.processVirtualKey(VK_LWIN | VK_EXT_KEY, winPressed); + } + else + isWinLocked = true; + break; + } + } + listener.modifiersChanged(); + } - public void clearlAllModifiers() { - resetModifierKeysAfterInput(true); - } + public void clearlAllModifiers() + { + resetModifierKeysAfterInput(true); + } - private void resetModifierKeysAfterInput(boolean force) { - if (shiftPressed && (!isShiftLocked || force)) { - listener.processVirtualKey(VK_LSHIFT, false); - shiftPressed = false; - } - if (ctrlPressed && (!isCtrlLocked || force)) { - listener.processVirtualKey(VK_LCONTROL, false); - ctrlPressed = false; - } - if (altPressed && (!isAltLocked || force)) { - listener.processVirtualKey(VK_LMENU, false); - altPressed = false; - } - if (winPressed && (!isWinLocked || force)) { - listener.processVirtualKey(VK_LWIN | VK_EXT_KEY, false); - winPressed = false; - } + private void resetModifierKeysAfterInput(boolean force) + { + if (shiftPressed && (!isShiftLocked || force)) + { + listener.processVirtualKey(VK_LSHIFT, false); + shiftPressed = false; + } + if (ctrlPressed && (!isCtrlLocked || force)) + { + listener.processVirtualKey(VK_LCONTROL, false); + ctrlPressed = false; + } + if (altPressed && (!isAltLocked || force)) + { + listener.processVirtualKey(VK_LMENU, false); + altPressed = false; + } + if (winPressed && (!isWinLocked || force)) + { + listener.processVirtualKey(VK_LWIN | VK_EXT_KEY, false); + winPressed = false; + } - if (listener != null) - listener.modifiersChanged(); - } + if (listener != null) + listener.modifiersChanged(); + } - private void switchKeyboard(int keycode) { - switch (keycode) { - case EXTKEY_KBFUNCTIONKEYS: { - listener.switchKeyboard(KEYBOARD_TYPE_FUNCTIONKEYS); - break; - } + private void switchKeyboard(int keycode) + { + switch (keycode) + { + case EXTKEY_KBFUNCTIONKEYS: + { + listener.switchKeyboard(KEYBOARD_TYPE_FUNCTIONKEYS); + break; + } - case EXTKEY_KBNUMPAD: { - listener.switchKeyboard(KEYBOARD_TYPE_NUMPAD); - break; - } + case EXTKEY_KBNUMPAD: + { + listener.switchKeyboard(KEYBOARD_TYPE_NUMPAD); + break; + } - case EXTKEY_KBCURSOR: { - listener.switchKeyboard(KEYBOARD_TYPE_CURSOR); - break; - } + case EXTKEY_KBCURSOR: + { + listener.switchKeyboard(KEYBOARD_TYPE_CURSOR); + break; + } - default: - break; - } - } + default: + break; + } + } - private boolean checkToggleModifierLock(int keycode) { - long now = System.currentTimeMillis(); + private boolean checkToggleModifierLock(int keycode) + { + long now = System.currentTimeMillis(); - // was the same modifier hit? - if (lastModifierKeyCode != keycode) { - lastModifierKeyCode = keycode; - lastModifierTime = now; - return false; - } + // was the same modifier hit? + if (lastModifierKeyCode != keycode) + { + lastModifierKeyCode = keycode; + lastModifierTime = now; + return false; + } - // within a certain time interval? - if (lastModifierTime + 800 > now) { - lastModifierTime = 0; - return true; - } else { - lastModifierTime = now; - return false; - } - } + // within a certain time interval? + if (lastModifierTime + 800 > now) + { + lastModifierTime = 0; + return true; + } + else + { + lastModifierTime = now; + return false; + } + } - // interface that gets called for input handling - public interface KeyProcessingListener { - abstract void processVirtualKey(int virtualKeyCode, boolean down); + // interface that gets called for input handling + public interface KeyProcessingListener { + abstract void processVirtualKey(int virtualKeyCode, boolean down); - abstract void processUnicodeKey(int unicodeKey); + abstract void processUnicodeKey(int unicodeKey); - abstract void switchKeyboard(int keyboardType); - - abstract void modifiersChanged(); - } + abstract void switchKeyboard(int keyboardType); + abstract void modifiersChanged(); + } } - diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/Mouse.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/Mouse.java index 2461486c9..11f1d3e47 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/Mouse.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/Mouse.java @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.utils; @@ -13,47 +14,51 @@ import android.content.Context; import com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity; -public class Mouse { +public class Mouse +{ - private final static int PTRFLAGS_LBUTTON = 0x1000; - private final static int PTRFLAGS_RBUTTON = 0x2000; + private final static int PTRFLAGS_LBUTTON = 0x1000; + private final static int PTRFLAGS_RBUTTON = 0x2000; - private final static int PTRFLAGS_DOWN = 0x8000; - private final static int PTRFLAGS_MOVE = 0x0800; + private final static int PTRFLAGS_DOWN = 0x8000; + private final static int PTRFLAGS_MOVE = 0x0800; - private final static int PTRFLAGS_WHEEL = 0x0200; - private final static int PTRFLAGS_WHEEL_NEGATIVE = 0x0100; + private final static int PTRFLAGS_WHEEL = 0x0200; + private final static int PTRFLAGS_WHEEL_NEGATIVE = 0x0100; - public static int getLeftButtonEvent(Context context, boolean down) { - if (ApplicationSettingsActivity.getSwapMouseButtons(context)) - return (PTRFLAGS_RBUTTON | (down ? PTRFLAGS_DOWN : 0)); - else - return (PTRFLAGS_LBUTTON | (down ? PTRFLAGS_DOWN : 0)); - } + public static int getLeftButtonEvent(Context context, boolean down) + { + if (ApplicationSettingsActivity.getSwapMouseButtons(context)) + return (PTRFLAGS_RBUTTON | (down ? PTRFLAGS_DOWN : 0)); + else + return (PTRFLAGS_LBUTTON | (down ? PTRFLAGS_DOWN : 0)); + } - public static int getRightButtonEvent(Context context, boolean down) { - if (ApplicationSettingsActivity.getSwapMouseButtons(context)) - return (PTRFLAGS_LBUTTON | (down ? PTRFLAGS_DOWN : 0)); - else - return (PTRFLAGS_RBUTTON | (down ? PTRFLAGS_DOWN : 0)); - } + public static int getRightButtonEvent(Context context, boolean down) + { + if (ApplicationSettingsActivity.getSwapMouseButtons(context)) + return (PTRFLAGS_LBUTTON | (down ? PTRFLAGS_DOWN : 0)); + else + return (PTRFLAGS_RBUTTON | (down ? PTRFLAGS_DOWN : 0)); + } - public static int getMoveEvent() { - return PTRFLAGS_MOVE; - } + public static int getMoveEvent() + { + return PTRFLAGS_MOVE; + } - public static int getScrollEvent(Context context, boolean down) { - int flags = PTRFLAGS_WHEEL; + public static int getScrollEvent(Context context, boolean down) + { + int flags = PTRFLAGS_WHEEL; - // invert scrolling? - if (ApplicationSettingsActivity.getInvertScrolling(context)) - down = !down; - - if (down) - flags |= (PTRFLAGS_WHEEL_NEGATIVE | 0x0088); - else - flags |= 0x0078; - return flags; - } + // invert scrolling? + if (ApplicationSettingsActivity.getInvertScrolling(context)) + down = !down; + if (down) + flags |= (PTRFLAGS_WHEEL_NEGATIVE | 0x0088); + else + flags |= 0x0078; + return flags; + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/RDPFileParser.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/RDPFileParser.java index c45d41d07..413050a83 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/RDPFileParser.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/RDPFileParser.java @@ -3,8 +3,9 @@ Copyright 2013 Blaz Bacnik - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.utils; @@ -15,77 +16,96 @@ import java.io.IOException; import java.util.HashMap; import java.util.Locale; -public class RDPFileParser { +public class RDPFileParser +{ - private static final int MAX_ERRORS = 20; - private static final int MAX_LINES = 500; + private static final int MAX_ERRORS = 20; + private static final int MAX_LINES = 500; - private HashMap options; + private HashMap options; - public RDPFileParser() { - init(); - } + public RDPFileParser() + { + init(); + } - public RDPFileParser(String filename) throws IOException { - init(); - parse(filename); - } + public RDPFileParser(String filename) throws IOException + { + init(); + parse(filename); + } - private void init() { - options = new HashMap(); - } + private void init() + { + options = new HashMap(); + } - public void parse(String filename) throws IOException { - BufferedReader br = new BufferedReader(new FileReader(filename)); - String line = null; + public void parse(String filename) throws IOException + { + BufferedReader br = new BufferedReader(new FileReader(filename)); + String line = null; - int errors = 0; - int lines = 0; - boolean ok; + int errors = 0; + int lines = 0; + boolean ok; - while ((line = br.readLine()) != null) { - lines++; - ok = false; + while ((line = br.readLine()) != null) + { + lines++; + ok = false; - if (errors > MAX_ERRORS || lines > MAX_LINES) { - br.close(); - throw new IOException("Parsing limits exceeded"); - } + if (errors > MAX_ERRORS || lines > MAX_LINES) + { + br.close(); + throw new IOException("Parsing limits exceeded"); + } - String[] fields = line.split(":", 3); + String[] fields = line.split(":", 3); - if (fields.length == 3) { - if (fields[1].equals("s")) { - options.put(fields[0].toLowerCase(Locale.ENGLISH), fields[2]); - ok = true; - } else if (fields[1].equals("i")) { - try { - Integer i = Integer.parseInt(fields[2]); - options.put(fields[0].toLowerCase(Locale.ENGLISH), i); - ok = true; - } catch (NumberFormatException e) { - } - } else if (fields[1].equals("b")) { - ok = true; - } - } + if (fields.length == 3) + { + if (fields[1].equals("s")) + { + options.put(fields[0].toLowerCase(Locale.ENGLISH), fields[2]); + ok = true; + } + else if (fields[1].equals("i")) + { + try + { + Integer i = Integer.parseInt(fields[2]); + options.put(fields[0].toLowerCase(Locale.ENGLISH), i); + ok = true; + } + catch (NumberFormatException e) + { + } + } + else if (fields[1].equals("b")) + { + ok = true; + } + } - if (!ok) errors++; - } - br.close(); - } + if (!ok) + errors++; + } + br.close(); + } - public String getString(String optionName) { - if (options.get(optionName) instanceof String) - return (String) options.get(optionName); - else - return null; - } + public String getString(String optionName) + { + if (options.get(optionName) instanceof String) + return (String)options.get(optionName); + else + return null; + } - public Integer getInteger(String optionName) { - if (options.get(optionName) instanceof Integer) - return (Integer) options.get(optionName); - else - return null; - } + public Integer getInteger(String optionName) + { + if (options.get(optionName) instanceof Integer) + return (Integer)options.get(optionName); + else + return null; + } } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/SeparatedListAdapter.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/SeparatedListAdapter.java index 7f8d8d2ba..659732da5 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/SeparatedListAdapter.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/utils/SeparatedListAdapter.java @@ -4,8 +4,9 @@ Copyright Jeff Sharkey - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ package com.freerdp.freerdpcore.utils; @@ -22,157 +23,186 @@ import com.freerdp.freerdpcore.R; import java.util.LinkedHashMap; import java.util.Map; -public class SeparatedListAdapter extends BaseAdapter { +public class SeparatedListAdapter extends BaseAdapter +{ - public final static int TYPE_SECTION_HEADER = 0; - public final Map sections = new LinkedHashMap(); - public final ArrayAdapter headers; + public final static int TYPE_SECTION_HEADER = 0; + public final Map sections = new LinkedHashMap(); + public final ArrayAdapter headers; - public SeparatedListAdapter(Context context) { - headers = new ArrayAdapter(context, R.layout.list_header); - } + public SeparatedListAdapter(Context context) + { + headers = new ArrayAdapter(context, R.layout.list_header); + } - public void addSection(String section, Adapter adapter) { - this.headers.add(section); - this.sections.put(section, adapter); - } + public void addSection(String section, Adapter adapter) + { + this.headers.add(section); + this.sections.put(section, adapter); + } - public void setSectionTitle(int section, String title) { - String oldTitle = this.headers.getItem(section); + public void setSectionTitle(int section, String title) + { + String oldTitle = this.headers.getItem(section); - // remove/add to headers array - this.headers.remove(oldTitle); - this.headers.insert(title, section); + // remove/add to headers array + this.headers.remove(oldTitle); + this.headers.insert(title, section); - // remove/add to section map - Adapter adapter = this.sections.get(oldTitle); - this.sections.remove(oldTitle); - this.sections.put(title, adapter); - } + // remove/add to section map + Adapter adapter = this.sections.get(oldTitle); + this.sections.remove(oldTitle); + this.sections.put(title, adapter); + } - public Object getItem(int position) { - for (int i = 0; i < headers.getCount(); i++) { - String section = headers.getItem(i); - Adapter adapter = sections.get(section); + public Object getItem(int position) + { + for (int i = 0; i < headers.getCount(); i++) + { + String section = headers.getItem(i); + Adapter adapter = sections.get(section); - // ignore empty sections - if (adapter.getCount() > 0) { - int size = adapter.getCount() + 1; + // ignore empty sections + if (adapter.getCount() > 0) + { + int size = adapter.getCount() + 1; - // check if position inside this section - if (position == 0) return section; - if (position < size) return adapter.getItem(position - 1); + // check if position inside this section + if (position == 0) + return section; + if (position < size) + return adapter.getItem(position - 1); - // otherwise jump into next section - position -= size; - } - } - return null; - } + // otherwise jump into next section + position -= size; + } + } + return null; + } - public int getCount() { - // total together all sections, plus one for each section header (except if the section is empty) - int total = 0; - for (Adapter adapter : this.sections.values()) - total += ((adapter.getCount() > 0) ? adapter.getCount() + 1 : 0); - return total; - } + public int getCount() + { + // total together all sections, plus one for each section header (except if the section is + // empty) + int total = 0; + for (Adapter adapter : this.sections.values()) + total += ((adapter.getCount() > 0) ? adapter.getCount() + 1 : 0); + return total; + } - public int getViewTypeCount() { - // assume that headers count as one, then total all sections - int total = 1; - for (Adapter adapter : this.sections.values()) - total += adapter.getViewTypeCount(); - return total; - } + public int getViewTypeCount() + { + // assume that headers count as one, then total all sections + int total = 1; + for (Adapter adapter : this.sections.values()) + total += adapter.getViewTypeCount(); + return total; + } - public int getItemViewType(int position) { - int type = 1; - for (int i = 0; i < headers.getCount(); i++) { - String section = headers.getItem(i); - Adapter adapter = sections.get(section); + public int getItemViewType(int position) + { + int type = 1; + for (int i = 0; i < headers.getCount(); i++) + { + String section = headers.getItem(i); + Adapter adapter = sections.get(section); - // skip empty sections - if (adapter.getCount() > 0) { - int size = adapter.getCount() + 1; + // skip empty sections + if (adapter.getCount() > 0) + { + int size = adapter.getCount() + 1; - // check if position inside this section - if (position == 0) return TYPE_SECTION_HEADER; - if (position < size) return type + adapter.getItemViewType(position - 1); + // check if position inside this section + if (position == 0) + return TYPE_SECTION_HEADER; + if (position < size) + return type + adapter.getItemViewType(position - 1); - // otherwise jump into next section - position -= size; - type += adapter.getViewTypeCount(); - } - } - return -1; - } + // otherwise jump into next section + position -= size; + type += adapter.getViewTypeCount(); + } + } + return -1; + } - public boolean areAllItemsSelectable() { - return false; - } + public boolean areAllItemsSelectable() + { + return false; + } - public boolean isEnabled(int position) { - return (getItemViewType(position) != TYPE_SECTION_HEADER); - } + public boolean isEnabled(int position) + { + return (getItemViewType(position) != TYPE_SECTION_HEADER); + } - @Override - public View getView(int position, View convertView, ViewGroup parent) { - int sectionnum = 0; - for (int i = 0; i < headers.getCount(); i++) { - String section = headers.getItem(i); - Adapter adapter = sections.get(section); + @Override public View getView(int position, View convertView, ViewGroup parent) + { + int sectionnum = 0; + for (int i = 0; i < headers.getCount(); i++) + { + String section = headers.getItem(i); + Adapter adapter = sections.get(section); - // skip empty sections - if (adapter.getCount() > 0) { - int size = adapter.getCount() + 1; + // skip empty sections + if (adapter.getCount() > 0) + { + int size = adapter.getCount() + 1; - // check if position inside this section - if (position == 0) return headers.getView(sectionnum, convertView, parent); - if (position < size) return adapter.getView(position - 1, null, parent); + // check if position inside this section + if (position == 0) + return headers.getView(sectionnum, convertView, parent); + if (position < size) + return adapter.getView(position - 1, null, parent); - // otherwise jump into next section - position -= size; - } - sectionnum++; - } - return null; - } + // otherwise jump into next section + position -= size; + } + sectionnum++; + } + return null; + } - @Override - public long getItemId(int position) { - for (int i = 0; i < headers.getCount(); i++) { - String section = headers.getItem(i); - Adapter adapter = sections.get(section); - if (adapter.getCount() > 0) { - int size = adapter.getCount() + 1; + @Override public long getItemId(int position) + { + for (int i = 0; i < headers.getCount(); i++) + { + String section = headers.getItem(i); + Adapter adapter = sections.get(section); + if (adapter.getCount() > 0) + { + int size = adapter.getCount() + 1; - // check if position inside this section - if (position < size) return adapter.getItemId(position - 1); + // check if position inside this section + if (position < size) + return adapter.getItemId(position - 1); - // otherwise jump into next section - position -= size; - } - } - return -1; - } + // otherwise jump into next section + position -= size; + } + } + return -1; + } - public String getSectionForPosition(int position) { - int curPos = 0; - for (int i = 0; i < headers.getCount(); i++) { - String section = headers.getItem(i); - Adapter adapter = sections.get(section); - if (adapter.getCount() > 0) { - int size = adapter.getCount() + 1; + public String getSectionForPosition(int position) + { + int curPos = 0; + for (int i = 0; i < headers.getCount(); i++) + { + String section = headers.getItem(i); + Adapter adapter = sections.get(section); + if (adapter.getCount() > 0) + { + int size = adapter.getCount() + 1; - // check if position inside this section - if (position >= curPos && position < (curPos + size)) return section.toString(); + // check if position inside this section + if (position >= curPos && position < (curPos + size)) + return section.toString(); - // otherwise jump into next section - curPos += size; - } - } - return null; - } - -} \ No newline at end of file + // otherwise jump into next section + curPos += size; + } + } + return null; + } +} \ No newline at end of file diff --git a/client/Android/android_cliprdr.c b/client/Android/android_cliprdr.c index 998266bc4..5e9f79182 100644 --- a/client/Android/android_cliprdr.c +++ b/client/Android/android_cliprdr.c @@ -49,7 +49,7 @@ UINT android_cliprdr_send_client_format_list(CliprdrClientContext* cliprdr) if (!cliprdr) return ERROR_INVALID_PARAMETER; - androidContext* afc = (androidContext*) cliprdr->custom; + androidContext* afc = (androidContext*)cliprdr->custom; if (!afc || !afc->cliprdr) return ERROR_INVALID_PARAMETER; @@ -57,7 +57,7 @@ UINT android_cliprdr_send_client_format_list(CliprdrClientContext* cliprdr) ZeroMemory(&formatList, sizeof(CLIPRDR_FORMAT_LIST)); pFormatIds = NULL; numFormats = ClipboardGetFormatIds(afc->clipboard, &pFormatIds); - formats = (CLIPRDR_FORMAT*) calloc(numFormats, sizeof(CLIPRDR_FORMAT)); + formats = (CLIPRDR_FORMAT*)calloc(numFormats, sizeof(CLIPRDR_FORMAT)); if (!formats) goto fail; @@ -92,8 +92,8 @@ fail: return rc; } -static UINT android_cliprdr_send_client_format_data_request( - CliprdrClientContext* cliprdr, UINT32 formatId) +static UINT android_cliprdr_send_client_format_data_request(CliprdrClientContext* cliprdr, + UINT32 formatId) { UINT rc = ERROR_INVALID_PARAMETER; CLIPRDR_FORMAT_DATA_REQUEST formatDataRequest; @@ -102,7 +102,7 @@ static UINT android_cliprdr_send_client_format_data_request( if (!cliprdr) goto fail; - afc = (androidContext*) cliprdr->custom; + afc = (androidContext*)cliprdr->custom; if (!afc || !afc->clipboardRequestEvent || !cliprdr->ClientFormatDataRequest) goto fail; @@ -118,8 +118,7 @@ fail: return rc; } -static UINT android_cliprdr_send_client_capabilities(CliprdrClientContext* - cliprdr) +static UINT android_cliprdr_send_client_capabilities(CliprdrClientContext* cliprdr) { CLIPRDR_CAPABILITIES capabilities; CLIPRDR_GENERAL_CAPABILITY_SET generalCapabilitySet; @@ -128,8 +127,7 @@ static UINT android_cliprdr_send_client_capabilities(CliprdrClientContext* return ERROR_INVALID_PARAMETER; capabilities.cCapabilitiesSets = 1; - capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET*) & - (generalCapabilitySet); + capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET*)&(generalCapabilitySet); generalCapabilitySet.capabilitySetType = CB_CAPSTYPE_GENERAL; generalCapabilitySet.capabilitySetLength = 12; generalCapabilitySet.version = CB_CAPS_VERSION_2; @@ -143,7 +141,7 @@ static UINT android_cliprdr_send_client_capabilities(CliprdrClientContext* * @return 0 on success, otherwise a Win32 error code */ static UINT android_cliprdr_monitor_ready(CliprdrClientContext* cliprdr, - const CLIPRDR_MONITOR_READY* monitorReady) + const CLIPRDR_MONITOR_READY* monitorReady) { UINT rc; androidContext* afc; @@ -151,7 +149,7 @@ static UINT android_cliprdr_monitor_ready(CliprdrClientContext* cliprdr, if (!cliprdr || !monitorReady) return ERROR_INVALID_PARAMETER; - afc = (androidContext*) cliprdr->custom; + afc = (androidContext*)cliprdr->custom; if (!afc) return ERROR_INVALID_PARAMETER; @@ -172,7 +170,7 @@ static UINT android_cliprdr_monitor_ready(CliprdrClientContext* cliprdr, * @return 0 on success, otherwise a Win32 error code */ static UINT android_cliprdr_server_capabilities(CliprdrClientContext* cliprdr, - const CLIPRDR_CAPABILITIES* capabilities) + const CLIPRDR_CAPABILITIES* capabilities) { UINT32 index; CLIPRDR_CAPABILITY_SET* capabilitySet; @@ -181,7 +179,7 @@ static UINT android_cliprdr_server_capabilities(CliprdrClientContext* cliprdr, if (!cliprdr || !capabilities) return ERROR_INVALID_PARAMETER; - afc = (androidContext*) cliprdr->custom; + afc = (androidContext*)cliprdr->custom; if (!afc) return ERROR_INVALID_PARAMETER; @@ -193,8 +191,8 @@ static UINT android_cliprdr_server_capabilities(CliprdrClientContext* cliprdr, if ((capabilitySet->capabilitySetType == CB_CAPSTYPE_GENERAL) && (capabilitySet->capabilitySetLength >= CB_CAPSTYPE_GENERAL_LEN)) { - CLIPRDR_GENERAL_CAPABILITY_SET* generalCapabilitySet - = (CLIPRDR_GENERAL_CAPABILITY_SET*) capabilitySet; + CLIPRDR_GENERAL_CAPABILITY_SET* generalCapabilitySet = + (CLIPRDR_GENERAL_CAPABILITY_SET*)capabilitySet; afc->clipboardCapabilities = generalCapabilitySet->generalFlags; break; } @@ -209,7 +207,7 @@ static UINT android_cliprdr_server_capabilities(CliprdrClientContext* cliprdr, * @return 0 on success, otherwise a Win32 error code */ static UINT android_cliprdr_server_format_list(CliprdrClientContext* cliprdr, - const CLIPRDR_FORMAT_LIST* formatList) + const CLIPRDR_FORMAT_LIST* formatList) { UINT rc; UINT32 index; @@ -219,7 +217,7 @@ static UINT android_cliprdr_server_format_list(CliprdrClientContext* cliprdr, if (!cliprdr || !formatList) return ERROR_INVALID_PARAMETER; - afc = (androidContext*) cliprdr->custom; + afc = (androidContext*)cliprdr->custom; if (!afc) return ERROR_INVALID_PARAMETER; @@ -238,8 +236,7 @@ static UINT android_cliprdr_server_format_list(CliprdrClientContext* cliprdr, return CHANNEL_RC_OK; afc->numServerFormats = formatList->numFormats; - afc->serverFormats = (CLIPRDR_FORMAT*) calloc(afc->numServerFormats, - sizeof(CLIPRDR_FORMAT)); + afc->serverFormats = (CLIPRDR_FORMAT*)calloc(afc->numServerFormats, sizeof(CLIPRDR_FORMAT)); if (!afc->serverFormats) return CHANNEL_RC_NO_MEMORY; @@ -251,8 +248,7 @@ static UINT android_cliprdr_server_format_list(CliprdrClientContext* cliprdr, if (formatList->formats[index].formatName) { - afc->serverFormats[index].formatName = _strdup( - formatList->formats[index].formatName); + afc->serverFormats[index].formatName = _strdup(formatList->formats[index].formatName); if (!afc->serverFormats[index].formatName) return CHANNEL_RC_NO_MEMORY; @@ -265,16 +261,16 @@ static UINT android_cliprdr_server_format_list(CliprdrClientContext* cliprdr, if (format->formatId == CF_UNICODETEXT) { - if ((rc = android_cliprdr_send_client_format_data_request(cliprdr, - CF_UNICODETEXT)) != CHANNEL_RC_OK) + if ((rc = android_cliprdr_send_client_format_data_request(cliprdr, CF_UNICODETEXT)) != + CHANNEL_RC_OK) return rc; break; } else if (format->formatId == CF_TEXT) { - if ((rc = android_cliprdr_send_client_format_data_request(cliprdr, - CF_TEXT)) != CHANNEL_RC_OK) + if ((rc = android_cliprdr_send_client_format_data_request(cliprdr, CF_TEXT)) != + CHANNEL_RC_OK) return rc; break; @@ -289,9 +285,9 @@ static UINT android_cliprdr_server_format_list(CliprdrClientContext* cliprdr, * * @return 0 on success, otherwise a Win32 error code */ -static UINT android_cliprdr_server_format_list_response( - CliprdrClientContext* cliprdr, - const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) +static UINT +android_cliprdr_server_format_list_response(CliprdrClientContext* cliprdr, + const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) { if (!cliprdr || !formatListResponse) return ERROR_INVALID_PARAMETER; @@ -304,9 +300,9 @@ static UINT android_cliprdr_server_format_list_response( * * @return 0 on success, otherwise a Win32 error code */ -static UINT android_cliprdr_server_lock_clipboard_data(CliprdrClientContext* - cliprdr, - const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) +static UINT +android_cliprdr_server_lock_clipboard_data(CliprdrClientContext* cliprdr, + const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) { if (!cliprdr || !lockClipboardData) return ERROR_INVALID_PARAMETER; @@ -320,8 +316,7 @@ static UINT android_cliprdr_server_lock_clipboard_data(CliprdrClientContext* * @return 0 on success, otherwise a Win32 error code */ static UINT android_cliprdr_server_unlock_clipboard_data( - CliprdrClientContext* cliprdr, - const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) + CliprdrClientContext* cliprdr, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) { if (!cliprdr || !unlockClipboardData) return ERROR_INVALID_PARAMETER; @@ -334,9 +329,9 @@ static UINT android_cliprdr_server_unlock_clipboard_data( * * @return 0 on success, otherwise a Win32 error code */ -static UINT android_cliprdr_server_format_data_request(CliprdrClientContext* - cliprdr, - const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) +static UINT +android_cliprdr_server_format_data_request(CliprdrClientContext* cliprdr, + const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) { UINT rc; BYTE* data; @@ -348,14 +343,14 @@ static UINT android_cliprdr_server_format_data_request(CliprdrClientContext* if (!cliprdr || !formatDataRequest || !cliprdr->ClientFormatDataResponse) return ERROR_INVALID_PARAMETER; - afc = (androidContext*) cliprdr->custom; + afc = (androidContext*)cliprdr->custom; if (!afc) return ERROR_INVALID_PARAMETER; ZeroMemory(&response, sizeof(CLIPRDR_FORMAT_DATA_RESPONSE)); formatId = formatDataRequest->requestedFormatId; - data = (BYTE*) ClipboardGetData(afc->clipboard, formatId, &size); + data = (BYTE*)ClipboardGetData(afc->clipboard, formatId, &size); response.msgFlags = CB_RESPONSE_OK; response.dataLen = size; response.requestedFormatData = data; @@ -377,9 +372,9 @@ static UINT android_cliprdr_server_format_data_request(CliprdrClientContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT android_cliprdr_server_format_data_response( - CliprdrClientContext* cliprdr, - const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) +static UINT +android_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr, + const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) { BYTE* data; UINT32 size; @@ -392,12 +387,12 @@ static UINT android_cliprdr_server_format_data_response( if (!cliprdr || !formatDataResponse) return ERROR_INVALID_PARAMETER; - afc = (androidContext*) cliprdr->custom; + afc = (androidContext*)cliprdr->custom; if (!afc) return ERROR_INVALID_PARAMETER; - instance = ((rdpContext*) afc)->instance; + instance = ((rdpContext*)afc)->instance; if (!instance) return ERROR_INVALID_PARAMETER; @@ -421,8 +416,7 @@ static UINT android_cliprdr_server_format_data_response( size = formatDataResponse->dataLen; - if (!ClipboardSetData(afc->clipboard, formatId, - formatDataResponse->requestedFormatData, size)) + if (!ClipboardSetData(afc->clipboard, formatId, formatDataResponse->requestedFormatData, size)) return ERROR_INTERNAL_ERROR; SetEvent(afc->clipboardRequestEvent); @@ -433,7 +427,7 @@ static UINT android_cliprdr_server_format_data_response( jstring jdata; jboolean attached; formatId = ClipboardRegisterFormat(afc->clipboard, "UTF8_STRING"); - data = (void*) ClipboardGetData(afc->clipboard, formatId, &size); + data = (void*)ClipboardGetData(afc->clipboard, formatId, &size); attached = jni_attach_thread(&env); size = strnlen(data, size); jdata = jniNewStringUTF(env, data, size); @@ -454,8 +448,7 @@ static UINT android_cliprdr_server_format_data_response( * @return 0 on success, otherwise a Win32 error code */ static UINT android_cliprdr_server_file_contents_request( - CliprdrClientContext* cliprdr, - const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) + CliprdrClientContext* cliprdr, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { if (!cliprdr || !fileContentsRequest) return ERROR_INVALID_PARAMETER; @@ -469,8 +462,7 @@ static UINT android_cliprdr_server_file_contents_request( * @return 0 on success, otherwise a Win32 error code */ static UINT android_cliprdr_server_file_contents_response( - CliprdrClientContext* cliprdr, - const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) + CliprdrClientContext* cliprdr, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) { if (!cliprdr || !fileContentsResponse) return ERROR_INVALID_PARAMETER; @@ -498,20 +490,17 @@ BOOL android_cliprdr_init(androidContext* afc, CliprdrClientContext* cliprdr) afc->cliprdr = cliprdr; afc->clipboard = clipboard; afc->clipboardRequestEvent = hevent; - cliprdr->custom = (void*) afc; + cliprdr->custom = (void*)afc; cliprdr->MonitorReady = android_cliprdr_monitor_ready; cliprdr->ServerCapabilities = android_cliprdr_server_capabilities; cliprdr->ServerFormatList = android_cliprdr_server_format_list; cliprdr->ServerFormatListResponse = android_cliprdr_server_format_list_response; cliprdr->ServerLockClipboardData = android_cliprdr_server_lock_clipboard_data; - cliprdr->ServerUnlockClipboardData = - android_cliprdr_server_unlock_clipboard_data; + cliprdr->ServerUnlockClipboardData = android_cliprdr_server_unlock_clipboard_data; cliprdr->ServerFormatDataRequest = android_cliprdr_server_format_data_request; cliprdr->ServerFormatDataResponse = android_cliprdr_server_format_data_response; - cliprdr->ServerFileContentsRequest = - android_cliprdr_server_file_contents_request; - cliprdr->ServerFileContentsResponse = - android_cliprdr_server_file_contents_response; + cliprdr->ServerFileContentsRequest = android_cliprdr_server_file_contents_request; + cliprdr->ServerFileContentsResponse = android_cliprdr_server_file_contents_response; return TRUE; } diff --git a/client/Android/android_cliprdr.h b/client/Android/android_cliprdr.h index af142c20b..8404d9a74 100644 --- a/client/Android/android_cliprdr.h +++ b/client/Android/android_cliprdr.h @@ -25,12 +25,9 @@ #include "android_freerdp.h" -FREERDP_LOCAL UINT android_cliprdr_send_client_format_list( - CliprdrClientContext* cliprdr); +FREERDP_LOCAL UINT android_cliprdr_send_client_format_list(CliprdrClientContext* cliprdr); -FREERDP_LOCAL BOOL android_cliprdr_init(androidContext* afc, - CliprdrClientContext* cliprdr); -FREERDP_LOCAL BOOL android_cliprdr_uninit(androidContext* afc, - CliprdrClientContext* cliprdr); +FREERDP_LOCAL BOOL android_cliprdr_init(androidContext* afc, CliprdrClientContext* cliprdr); +FREERDP_LOCAL BOOL android_cliprdr_uninit(androidContext* afc, CliprdrClientContext* cliprdr); #endif /* FREERDP_CLIENT_ANDROID_CLIPRDR_H */ diff --git a/client/Android/android_event.c b/client/Android/android_event.c index 7b764aca1..aa6c647a6 100644 --- a/client/Android/android_event.c +++ b/client/Android/android_event.c @@ -37,8 +37,7 @@ BOOL android_push_event(freerdp* inst, ANDROID_EVENT* event) int new_size; void* new_events; new_size = aCtx->event_queue->size * 2; - new_events = realloc((void*) aCtx->event_queue->events, - sizeof(ANDROID_EVENT*) * new_size); + new_events = realloc((void*)aCtx->event_queue->events, sizeof(ANDROID_EVENT*) * new_size); if (!new_events) return FALSE; @@ -85,7 +84,7 @@ static BOOL android_process_event(ANDROID_EVENT_QUEUE* queue, freerdp* inst) { ANDROID_EVENT* event; rdpContext* context = inst->context; - androidContext* afc = (androidContext*) context; + androidContext* afc = (androidContext*)context; while (android_peek_event(queue)) { @@ -93,20 +92,19 @@ static BOOL android_process_event(ANDROID_EVENT_QUEUE* queue, freerdp* inst) if (event->type == EVENT_TYPE_KEY) { - ANDROID_EVENT_KEY* key_event = (ANDROID_EVENT_KEY*) event; + ANDROID_EVENT_KEY* key_event = (ANDROID_EVENT_KEY*)event; inst->input->KeyboardEvent(inst->input, key_event->flags, key_event->scancode); android_event_free((ANDROID_EVENT*)key_event); } else if (event->type == EVENT_TYPE_KEY_UNICODE) { - ANDROID_EVENT_KEY* key_event = (ANDROID_EVENT_KEY*) event; - inst->input->UnicodeKeyboardEvent(inst->input, key_event->flags, - key_event->scancode); + ANDROID_EVENT_KEY* key_event = (ANDROID_EVENT_KEY*)event; + inst->input->UnicodeKeyboardEvent(inst->input, key_event->flags, key_event->scancode); android_event_free((ANDROID_EVENT*)key_event); } else if (event->type == EVENT_TYPE_CURSOR) { - ANDROID_EVENT_CURSOR* cursor_event = (ANDROID_EVENT_CURSOR*) event; + ANDROID_EVENT_CURSOR* cursor_event = (ANDROID_EVENT_CURSOR*)event; inst->input->MouseEvent(inst->input, cursor_event->flags, cursor_event->x, cursor_event->y); android_event_free((ANDROID_EVENT*)cursor_event); @@ -115,7 +113,7 @@ static BOOL android_process_event(ANDROID_EVENT_QUEUE* queue, freerdp* inst) { UINT32 size; UINT32 formatId; - ANDROID_EVENT_CLIPBOARD* clipboard_event = (ANDROID_EVENT_CLIPBOARD*) event; + ANDROID_EVENT_CLIPBOARD* clipboard_event = (ANDROID_EVENT_CLIPBOARD*)event; formatId = ClipboardRegisterFormat(afc->clipboard, "UTF8_STRING"); size = clipboard_event->data_length; @@ -179,7 +177,7 @@ BOOL android_check_handle(freerdp* inst) ANDROID_EVENT_KEY* android_event_key_new(int flags, UINT16 scancode) { ANDROID_EVENT_KEY* event; - event = (ANDROID_EVENT_KEY*) calloc(1, sizeof(ANDROID_EVENT_KEY)); + event = (ANDROID_EVENT_KEY*)calloc(1, sizeof(ANDROID_EVENT_KEY)); if (!event) return NULL; @@ -198,7 +196,7 @@ static void android_event_key_free(ANDROID_EVENT_KEY* event) ANDROID_EVENT_KEY* android_event_unicodekey_new(UINT16 flags, UINT16 key) { ANDROID_EVENT_KEY* event; - event = (ANDROID_EVENT_KEY*) calloc(1, sizeof(ANDROID_EVENT_KEY)); + event = (ANDROID_EVENT_KEY*)calloc(1, sizeof(ANDROID_EVENT_KEY)); if (!event) return NULL; @@ -217,7 +215,7 @@ static void android_event_unicodekey_free(ANDROID_EVENT_KEY* event) ANDROID_EVENT_CURSOR* android_event_cursor_new(UINT16 flags, UINT16 x, UINT16 y) { ANDROID_EVENT_CURSOR* event; - event = (ANDROID_EVENT_CURSOR*) calloc(1, sizeof(ANDROID_EVENT_CURSOR)); + event = (ANDROID_EVENT_CURSOR*)calloc(1, sizeof(ANDROID_EVENT_CURSOR)); if (!event) return NULL; @@ -237,7 +235,7 @@ static void android_event_cursor_free(ANDROID_EVENT_CURSOR* event) ANDROID_EVENT* android_event_disconnect_new(void) { ANDROID_EVENT* event; - event = (ANDROID_EVENT*) calloc(1, sizeof(ANDROID_EVENT)); + event = (ANDROID_EVENT*)calloc(1, sizeof(ANDROID_EVENT)); if (!event) return NULL; @@ -251,11 +249,10 @@ static void android_event_disconnect_free(ANDROID_EVENT* event) free(event); } -ANDROID_EVENT_CLIPBOARD* android_event_clipboard_new(void* data, - int data_length) +ANDROID_EVENT_CLIPBOARD* android_event_clipboard_new(void* data, int data_length) { ANDROID_EVENT_CLIPBOARD* event; - event = (ANDROID_EVENT_CLIPBOARD*) calloc(1, sizeof(ANDROID_EVENT_CLIPBOARD)); + event = (ANDROID_EVENT_CLIPBOARD*)calloc(1, sizeof(ANDROID_EVENT_CLIPBOARD)); if (!event) return NULL; @@ -292,7 +289,7 @@ BOOL android_event_queue_init(freerdp* inst) { androidContext* aCtx = (androidContext*)inst->context; ANDROID_EVENT_QUEUE* queue; - queue = (ANDROID_EVENT_QUEUE*) calloc(1, sizeof(ANDROID_EVENT_QUEUE)); + queue = (ANDROID_EVENT_QUEUE*)calloc(1, sizeof(ANDROID_EVENT_QUEUE)); if (!queue) { @@ -310,7 +307,7 @@ BOOL android_event_queue_init(freerdp* inst) return FALSE; } - queue->events = (ANDROID_EVENT**) calloc(queue->size, sizeof(ANDROID_EVENT*)); + queue->events = (ANDROID_EVENT**)calloc(queue->size, sizeof(ANDROID_EVENT*)); if (!queue->events) { diff --git a/client/Android/android_event.h b/client/Android/android_event.h index 1110a8704..b2d7bf2e6 100644 --- a/client/Android/android_event.h +++ b/client/Android/android_event.h @@ -14,11 +14,11 @@ #include #include -#define EVENT_TYPE_KEY 1 -#define EVENT_TYPE_CURSOR 2 -#define EVENT_TYPE_DISCONNECT 3 -#define EVENT_TYPE_KEY_UNICODE 4 -#define EVENT_TYPE_CLIPBOARD 5 +#define EVENT_TYPE_KEY 1 +#define EVENT_TYPE_CURSOR 2 +#define EVENT_TYPE_DISCONNECT 3 +#define EVENT_TYPE_KEY_UNICODE 4 +#define EVENT_TYPE_CLIPBOARD 5 struct _ANDROID_EVENT { @@ -65,14 +65,11 @@ FREERDP_LOCAL BOOL android_push_event(freerdp* inst, ANDROID_EVENT* event); FREERDP_LOCAL HANDLE android_get_handle(freerdp* inst); FREERDP_LOCAL BOOL android_check_handle(freerdp* inst); -FREERDP_LOCAL ANDROID_EVENT_KEY* android_event_key_new(int flags, - UINT16 scancode); +FREERDP_LOCAL ANDROID_EVENT_KEY* android_event_key_new(int flags, UINT16 scancode); FREERDP_LOCAL ANDROID_EVENT_KEY* android_event_unicodekey_new(UINT16 flags, UINT16 key); -FREERDP_LOCAL ANDROID_EVENT_CURSOR* android_event_cursor_new(UINT16 flags, - UINT16 x, UINT16 y); +FREERDP_LOCAL ANDROID_EVENT_CURSOR* android_event_cursor_new(UINT16 flags, UINT16 x, UINT16 y); FREERDP_LOCAL ANDROID_EVENT* android_event_disconnect_new(void); -FREERDP_LOCAL ANDROID_EVENT_CLIPBOARD* android_event_clipboard_new(void* data, - int data_length); +FREERDP_LOCAL ANDROID_EVENT_CLIPBOARD* android_event_clipboard_new(void* data, int data_length); FREERDP_LOCAL void android_event_free(ANDROID_EVENT* event); diff --git a/client/Android/android_freerdp.c b/client/Android/android_freerdp.c index fbb966a37..693ddfc6b 100644 --- a/client/Android/android_freerdp.c +++ b/client/Android/android_freerdp.c @@ -9,7 +9,8 @@ Copyright 2016 Armin Novak This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #ifdef HAVE_CONFIG_H @@ -57,74 +58,68 @@ /* Defines the JNI version supported by this library. */ #define FREERDP_JNI_VERSION "2.0.0" -static void android_OnChannelConnectedEventHandler( - void* context, - ChannelConnectedEventArgs* e) +static void android_OnChannelConnectedEventHandler(void* context, ChannelConnectedEventArgs* e) { rdpSettings* settings; androidContext* afc; if (!context || !e) { - WLog_FATAL(TAG, "%s(context=%p, EventArgs=%p", - __FUNCTION__, context, (void*) e); + WLog_FATAL(TAG, "%s(context=%p, EventArgs=%p", __FUNCTION__, context, (void*)e); return; } - afc = (androidContext*) context; + afc = (androidContext*)context; settings = afc->rdpCtx.settings; if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) { if (settings->SoftwareGdi) { - gdi_graphics_pipeline_init(afc->rdpCtx.gdi, - (RdpgfxClientContext*) e->pInterface); + gdi_graphics_pipeline_init(afc->rdpCtx.gdi, (RdpgfxClientContext*)e->pInterface); } else { WLog_WARN(TAG, "GFX without software GDI requested. " - " This is not supported, add /gdi:sw"); + " This is not supported, add /gdi:sw"); } } else if (strcmp(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0) { - android_cliprdr_init(afc, (CliprdrClientContext*) e->pInterface); + android_cliprdr_init(afc, (CliprdrClientContext*)e->pInterface); } } -static void android_OnChannelDisconnectedEventHandler( - void* context, ChannelDisconnectedEventArgs* e) +static void android_OnChannelDisconnectedEventHandler(void* context, + ChannelDisconnectedEventArgs* e) { rdpSettings* settings; androidContext* afc; if (!context || !e) { - WLog_FATAL(TAG, "%s(context=%p, EventArgs=%p", - __FUNCTION__, context, (void*) e); + WLog_FATAL(TAG, "%s(context=%p, EventArgs=%p", __FUNCTION__, context, (void*)e); return; } - afc = (androidContext*) context; + afc = (androidContext*)context; settings = afc->rdpCtx.settings; if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) { if (settings->SoftwareGdi) { - gdi_graphics_pipeline_uninit(afc->rdpCtx.gdi, - (RdpgfxClientContext*) e->pInterface); + gdi_graphics_pipeline_uninit(afc->rdpCtx.gdi, (RdpgfxClientContext*)e->pInterface); } else { WLog_WARN(TAG, "GFX without software GDI requested. " - " This is not supported, add /gdi:sw"); + " This is not supported, add /gdi:sw"); } } else if (strcmp(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0) { - android_cliprdr_uninit(afc, (CliprdrClientContext*) e->pInterface); + android_cliprdr_uninit(afc, (CliprdrClientContext*)e->pInterface); } } @@ -166,7 +161,7 @@ static BOOL android_end_paint(rdpContext* context) if (ninvalid < 1) return TRUE; - + cinvalid = hwnd->cinvalid; if (!cinvalid) @@ -185,8 +180,8 @@ static BOOL android_end_paint(rdpContext* context) y2 = MAX(y2, cinvalid[i].y + cinvalid[i].h); } - freerdp_callback("OnGraphicsUpdate", "(JIIII)V", (jlong)context->instance, - x1, y1, x2 - x1, y2 - y1); + freerdp_callback("OnGraphicsUpdate", "(JIIII)V", (jlong)context->instance, x1, y1, x2 - x1, + y2 - y1); hwnd->invalid->null = TRUE; hwnd->ninvalid = 0; @@ -198,9 +193,9 @@ static BOOL android_desktop_resize(rdpContext* context) if (!context || !context->instance || !context->settings) return FALSE; - freerdp_callback("OnGraphicsResize", "(JIII)V", - (jlong)context->instance, context->settings->DesktopWidth, - context->settings->DesktopHeight, context->settings->ColorDepth); + freerdp_callback("OnGraphicsResize", "(JIII)V", (jlong)context->instance, + context->settings->DesktopWidth, context->settings->DesktopHeight, + context->settings->ColorDepth); return TRUE; } @@ -217,9 +212,8 @@ static BOOL android_pre_connect(freerdp* instance) if (!settings) return FALSE; - rc = PubSub_SubscribeChannelConnected( - instance->context->pubSub, - android_OnChannelConnectedEventHandler); + rc = PubSub_SubscribeChannelConnected(instance->context->pubSub, + android_OnChannelConnectedEventHandler); if (rc != CHANNEL_RC_OK) { @@ -227,9 +221,8 @@ static BOOL android_pre_connect(freerdp* instance) return FALSE; } - rc = PubSub_SubscribeChannelDisconnected( - instance->context->pubSub, - android_OnChannelDisconnectedEventHandler); + rc = PubSub_SubscribeChannelDisconnected(instance->context->pubSub, + android_OnChannelDisconnectedEventHandler); if (rc != CHANNEL_RC_OK) { @@ -237,8 +230,7 @@ static BOOL android_pre_connect(freerdp* instance) return FALSE; } - if (!freerdp_client_load_addins(instance->context->channels, - instance->settings)) + if (!freerdp_client_load_addins(instance->context->channels, instance->settings)) { WLog_ERR(TAG, "Failed to load addins [%l08X]", GetLastError()); return FALSE; @@ -262,8 +254,7 @@ static void android_Pointer_Free(rdpContext* context, rdpPointer* pointer) return; } -static BOOL android_Pointer_Set(rdpContext* context, - const rdpPointer* pointer) +static BOOL android_Pointer_Set(rdpContext* context, const rdpPointer* pointer) { if (!context) return FALSE; @@ -271,8 +262,7 @@ static BOOL android_Pointer_Set(rdpContext* context, return TRUE; } -static BOOL android_Pointer_SetPosition(rdpContext* context, - UINT32 x, UINT32 y) +static BOOL android_Pointer_SetPosition(rdpContext* context, UINT32 x, UINT32 y) { if (!context) return FALSE; @@ -334,9 +324,8 @@ static BOOL android_post_connect(freerdp* instance) instance->update->BeginPaint = android_begin_paint; instance->update->EndPaint = android_end_paint; instance->update->DesktopResize = android_desktop_resize; - freerdp_callback("OnSettingsChanged", "(JIII)V", (jlong)instance, - settings->DesktopWidth, settings->DesktopHeight, - settings->ColorDepth); + freerdp_callback("OnSettingsChanged", "(JIII)V", (jlong)instance, settings->DesktopWidth, + settings->DesktopHeight, settings->ColorDepth); freerdp_callback("OnConnectionSuccess", "(J)V", (jlong)instance); return TRUE; } @@ -347,8 +336,8 @@ static void android_post_disconnect(freerdp* instance) gdi_free(instance); } -static BOOL android_authenticate_int(freerdp* instance, char** username, - char** password, char** domain, const char* cb_name) +static BOOL android_authenticate_int(freerdp* instance, char** username, char** password, + char** domain, const char* cb_name) { JNIEnv* env; jboolean attached = jni_attach_thread(&env); @@ -356,12 +345,11 @@ static BOOL android_authenticate_int(freerdp* instance, char** username, jobject jstr2 = create_string_builder(env, *domain); jobject jstr3 = create_string_builder(env, *password); jboolean res; - res = freerdp_callback_bool_result( - cb_name, - "(JLjava/lang/StringBuilder;" - "Ljava/lang/StringBuilder;" - "Ljava/lang/StringBuilder;)Z", - (jlong)instance, jstr1, jstr2, jstr3); + res = freerdp_callback_bool_result(cb_name, + "(JLjava/lang/StringBuilder;" + "Ljava/lang/StringBuilder;" + "Ljava/lang/StringBuilder;)Z", + (jlong)instance, jstr1, jstr2, jstr3); if (res == JNI_TRUE) { @@ -380,24 +368,20 @@ static BOOL android_authenticate_int(freerdp* instance, char** username, return ((res == JNI_TRUE) ? TRUE : FALSE); } -static BOOL android_authenticate(freerdp* instance, char** username, - char** password, char** domain) +static BOOL android_authenticate(freerdp* instance, char** username, char** password, char** domain) { - return android_authenticate_int(instance, username, password, domain, - "OnAuthenticate"); + return android_authenticate_int(instance, username, password, domain, "OnAuthenticate"); } -static BOOL android_gw_authenticate(freerdp* instance, char** username, - char** password, char** domain) +static BOOL android_gw_authenticate(freerdp* instance, char** username, char** password, + char** domain) { - return android_authenticate_int(instance, username, password, domain, - "OnGatewayAuthenticate"); + return android_authenticate_int(instance, username, password, domain, "OnGatewayAuthenticate"); } -static DWORD android_verify_certificate( - freerdp* instance, const char* common_name, - const char* subject, const char* issuer, - const char* fingerprint, BOOL host_mismatch) +static DWORD android_verify_certificate(freerdp* instance, const char* common_name, + const char* subject, const char* issuer, + const char* fingerprint, BOOL host_mismatch) { WLog_DBG(TAG, "Certificate details:"); WLog_DBG(TAG, "\tSubject: %s", subject); @@ -413,9 +397,10 @@ static DWORD android_verify_certificate( jstring jstr1 = (*env)->NewStringUTF(env, subject); jstring jstr2 = (*env)->NewStringUTF(env, issuer); jstring jstr3 = (*env)->NewStringUTF(env, fingerprint); - jint res = freerdp_callback_int_result("OnVerifyCertificate", - "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)I", - (jlong)instance, jstr0, jstr1, jstr2, jstr3, host_mismatch); + jint res = freerdp_callback_int_result( + "OnVerifyCertificate", + "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)I", + (jlong)instance, jstr0, jstr1, jstr2, jstr3, host_mismatch); if (attached == JNI_TRUE) jni_detach_thread(); @@ -423,14 +408,11 @@ static DWORD android_verify_certificate( return res; } -static DWORD android_verify_changed_certificate(freerdp* instance, - const char* common_name, - const char* subject, - const char* issuer, - const char* new_fingerprint, - const char* old_subject, - const char* old_issuer, - const char* old_fingerprint) +static DWORD android_verify_changed_certificate(freerdp* instance, const char* common_name, + const char* subject, const char* issuer, + const char* new_fingerprint, + const char* old_subject, const char* old_issuer, + const char* old_fingerprint) { JNIEnv* env; jboolean attached = jni_attach_thread(&env); @@ -441,10 +423,11 @@ static DWORD android_verify_changed_certificate(freerdp* instance, jstring jstr4 = (*env)->NewStringUTF(env, old_subject); jstring jstr5 = (*env)->NewStringUTF(env, old_issuer); jstring jstr6 = (*env)->NewStringUTF(env, old_fingerprint); - jint res = freerdp_callback_int_result("OnVerifyChangedCertificate", - "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;" - "Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I", - (jlong)instance, jstr0, jstr1, jstr2, jstr3, jstr4, jstr5, jstr6); + jint res = freerdp_callback_int_result( + "OnVerifyChangedCertificate", + "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;" + "Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I", + (jlong)instance, jstr0, jstr1, jstr2, jstr3, jstr4, jstr5, jstr6); if (attached == JNI_TRUE) jni_detach_thread(); @@ -456,7 +439,7 @@ static DWORD WINAPI jni_input_thread(LPVOID arg) { HANDLE event[2]; wMessageQueue* queue; - freerdp* instance = (freerdp*) arg; + freerdp* instance = (freerdp*)arg; WLog_DBG(TAG, "input_thread Start."); if (!(queue = freerdp_get_message_queue(instance, FREERDP_INPUT_MESSAGE_QUEUE))) @@ -465,8 +448,7 @@ static DWORD WINAPI jni_input_thread(LPVOID arg) if (!(event[0] = android_get_handle(instance))) goto disconnect; - if (!(event[1] = freerdp_get_message_queue_event_handle(instance, - FREERDP_INPUT_MESSAGE_QUEUE))) + if (!(event[1] = freerdp_get_message_queue_event_handle(instance, FREERDP_INPUT_MESSAGE_QUEUE))) goto disconnect; do @@ -487,8 +469,7 @@ static DWORD WINAPI jni_input_thread(LPVOID arg) if (android_check_handle(instance) != TRUE) break; - } - while (1); + } while (1); WLog_DBG(TAG, "input_thread Quit."); disconnect: @@ -507,7 +488,7 @@ static int android_freerdp_run(freerdp* instance) const rdpSettings* settings = instance->context->settings; rdpContext* context = instance->context; BOOL async_input = settings->AsyncInput; - WLog_DBG(TAG, "AsyncInput=%"PRIu8"", settings->AsyncInput); + WLog_DBG(TAG, "AsyncInput=%" PRIu8 "", settings->AsyncInput); if (async_input) { @@ -543,7 +524,8 @@ static int android_freerdp_run(freerdp* instance) if ((status == WAIT_FAILED)) { - WLog_ERR(TAG, "WaitForMultipleObjects failed with %"PRIu32" [%08lX]", status, GetLastError()); + WLog_ERR(TAG, "WaitForMultipleObjects failed with %" PRIu32 " [%08lX]", status, + GetLastError()); break; } @@ -551,8 +533,8 @@ static int android_freerdp_run(freerdp* instance) { /* TODO: Auto reconnect if (xf_auto_reconnect(instance)) - continue; - */ + continue; + */ WLog_ERR(TAG, "Failed to check FreeRDP file descriptor"); status = GetLastError(); break; @@ -577,7 +559,8 @@ disconnect: if (async_input && inputThread) { - wMessageQueue* input_queue = freerdp_get_message_queue(instance, FREERDP_INPUT_MESSAGE_QUEUE); + wMessageQueue* input_queue = + freerdp_get_message_queue(instance, FREERDP_INPUT_MESSAGE_QUEUE); MessageQueue_PostQuit(input_queue, 0); WaitForSingleObject(inputThread, INFINITE); CloseHandle(inputThread); @@ -617,7 +600,7 @@ static DWORD WINAPI android_thread_func(LPVOID param) goto fail; fail: - WLog_DBG(TAG, "Session ended with %08"PRIX32"", status); + WLog_DBG(TAG, "Session ended with %08" PRIX32 "", status); if (status == CHANNEL_RC_OK) freerdp_callback("OnDisconnected", "(J)V", (jlong)instance); @@ -648,7 +631,6 @@ static BOOL android_client_new(freerdp* instance, rdpContext* context) return TRUE; } - static void android_client_free(freerdp* instance, rdpContext* context) { if (!context) @@ -693,27 +675,26 @@ static jlong JNICALL jni_freerdp_new(JNIEnv* env, jclass cls, jobject context) if (!contextClass || !fileClass) { - WLog_FATAL(TAG, "Failed to load class references %s=%p, %s=%p", - JAVA_CONTEXT_CLASS, (void*) contextClass, JAVA_FILE_CLASS, (void*) fileClass); + WLog_FATAL(TAG, "Failed to load class references %s=%p, %s=%p", JAVA_CONTEXT_CLASS, + (void*)contextClass, JAVA_FILE_CLASS, (void*)fileClass); return (jlong)NULL; } - getFilesDirID = (*env)->GetMethodID(env, contextClass, "getFilesDir", - "()L"JAVA_FILE_CLASS";"); + getFilesDirID = + (*env)->GetMethodID(env, contextClass, "getFilesDir", "()L" JAVA_FILE_CLASS ";"); if (!getFilesDirID) { - WLog_FATAL(TAG, "Failed to find method ID getFilesDir ()L"JAVA_FILE_CLASS";"); + WLog_FATAL(TAG, "Failed to find method ID getFilesDir ()L" JAVA_FILE_CLASS ";"); return (jlong)NULL; } - getAbsolutePathID = (*env)->GetMethodID(env, fileClass, "getAbsolutePath", - "()Ljava/lang/String;"); + getAbsolutePathID = + (*env)->GetMethodID(env, fileClass, "getAbsolutePath", "()Ljava/lang/String;"); if (!getAbsolutePathID) { - WLog_FATAL(TAG, - "Failed to find method ID getAbsolutePath ()Ljava/lang/String;"); + WLog_FATAL(TAG, "Failed to find method ID getAbsolutePath ()Ljava/lang/String;"); return (jlong)NULL; } @@ -752,8 +733,7 @@ static jlong JNICALL jni_freerdp_new(JNIEnv* env, jclass cls, jobject context) if (setenv("HOME", _strdup(envStr), 1) != 0) { - WLog_FATAL(TAG, "Failed to set environemnt HOME=%s %s [%d]", - env, strerror(errno), errno); + WLog_FATAL(TAG, "Failed to set environemnt HOME=%s %s [%d]", env, strerror(errno), errno); return (jlong)NULL; } @@ -763,7 +743,7 @@ static jlong JNICALL jni_freerdp_new(JNIEnv* env, jclass cls, jobject context) if (!ctx) return (jlong)NULL; - return (jlong) ctx->instance; + return (jlong)ctx->instance; } static void JNICALL jni_freerdp_free(JNIEnv* env, jclass cls, jlong instance) @@ -785,12 +765,12 @@ static jstring JNICALL jni_freerdp_get_last_error_string(JNIEnv* env, jclass cls if (!inst || !inst->context) return (*env)->NewStringUTF(env, ""); - return (*env)->NewStringUTF(env, - freerdp_get_last_error_string(freerdp_get_last_error(inst->context))); + return (*env)->NewStringUTF( + env, freerdp_get_last_error_string(freerdp_get_last_error(inst->context))); } -static jboolean JNICALL jni_freerdp_parse_arguments( - JNIEnv* env, jclass cls, jlong instance, jobjectArray arguments) +static jboolean JNICALL jni_freerdp_parse_arguments(JNIEnv* env, jclass cls, jlong instance, + jobjectArray arguments) { freerdp* inst = (freerdp*)instance; int i, count; @@ -814,8 +794,7 @@ static jboolean JNICALL jni_freerdp_parse_arguments( (*env)->ReleaseStringUTFChars(env, str, raw); } - status = freerdp_client_settings_parse_command_line(inst->settings, count, argv, - FALSE); + status = freerdp_client_settings_parse_command_line(inst->settings, count, argv, FALSE); for (i = 0; i < count; i++) free(argv[i]); @@ -824,23 +803,21 @@ static jboolean JNICALL jni_freerdp_parse_arguments( return (status == 0) ? JNI_TRUE : JNI_FALSE; } -static jboolean JNICALL jni_freerdp_connect(JNIEnv* env, jclass cls, - jlong instance) +static jboolean JNICALL jni_freerdp_connect(JNIEnv* env, jclass cls, jlong instance) { freerdp* inst = (freerdp*)instance; androidContext* ctx; if (!inst || !inst->context) { - WLog_FATAL(TAG, "%s(env=%p, cls=%p, instance=%d", __FUNCTION__, - (void*) env, (void*) cls, instance); + WLog_FATAL(TAG, "%s(env=%p, cls=%p, instance=%d", __FUNCTION__, (void*)env, (void*)cls, + instance); return JNI_FALSE; } ctx = (androidContext*)inst->context; - if (!(ctx->thread = CreateThread(NULL, 0, android_thread_func, - inst, 0, NULL))) + if (!(ctx->thread = CreateThread(NULL, 0, android_thread_func, inst, 0, NULL))) { return JNI_FALSE; } @@ -848,8 +825,7 @@ static jboolean JNICALL jni_freerdp_connect(JNIEnv* env, jclass cls, return JNI_TRUE; } -static jboolean JNICALL jni_freerdp_disconnect(JNIEnv* env, jclass cls, - jlong instance) +static jboolean JNICALL jni_freerdp_disconnect(JNIEnv* env, jclass cls, jlong instance) { freerdp* inst = (freerdp*)instance; androidContext* ctx; @@ -857,8 +833,8 @@ static jboolean JNICALL jni_freerdp_disconnect(JNIEnv* env, jclass cls, if (!inst || !inst->context || !cls || !env) { - WLog_FATAL(TAG, "%s(env=%p, cls=%p, instance=%d", __FUNCTION__, - (void*) env, (void*) cls, instance); + WLog_FATAL(TAG, "%s(env=%p, cls=%p, instance=%d", __FUNCTION__, (void*)env, (void*)cls, + instance); return JNI_FALSE; } @@ -880,9 +856,9 @@ static jboolean JNICALL jni_freerdp_disconnect(JNIEnv* env, jclass cls, return JNI_TRUE; } -static jboolean JNICALL jni_freerdp_update_graphics( - JNIEnv* env, jclass cls, jlong instance, jobject bitmap, - jint x, jint y, jint width, jint height) +static jboolean JNICALL jni_freerdp_update_graphics(JNIEnv* env, jclass cls, jlong instance, + jobject bitmap, jint x, jint y, jint width, + jint height) { UINT32 DstFormat; jboolean rc; @@ -894,8 +870,8 @@ static jboolean JNICALL jni_freerdp_update_graphics( if (!env || !cls || !inst) { - WLog_FATAL(TAG, "%s(env=%p, cls=%p, instance=%d", __FUNCTION__, - (void*) env, (void*) cls, instance); + WLog_FATAL(TAG, "%s(env=%p, cls=%p, instance=%d", __FUNCTION__, (void*)env, (void*)cls, + instance); return JNI_FALSE; } @@ -949,9 +925,8 @@ static jboolean JNICALL jni_freerdp_update_graphics( return rc; } -static jboolean JNICALL jni_freerdp_send_key_event( - JNIEnv* env, jclass cls, jlong instance, - jint keycode, jboolean down) +static jboolean JNICALL jni_freerdp_send_key_event(JNIEnv* env, jclass cls, jlong instance, + jint keycode, jboolean down) { DWORD scancode; ANDROID_EVENT* event; @@ -959,7 +934,7 @@ static jboolean JNICALL jni_freerdp_send_key_event( scancode = GetVirtualScanCodeFromVirtualKeyCode(keycode, 4); int flags = (down == JNI_TRUE) ? KBD_FLAGS_DOWN : KBD_FLAGS_RELEASE; flags |= (scancode & KBDEXT) ? KBD_FLAGS_EXTENDED : 0; - event = (ANDROID_EVENT*) android_event_key_new(flags, scancode & 0xFF); + event = (ANDROID_EVENT*)android_event_key_new(flags, scancode & 0xFF); if (!event) return JNI_FALSE; @@ -970,17 +945,17 @@ static jboolean JNICALL jni_freerdp_send_key_event( return JNI_FALSE; } - WLog_DBG(TAG, "send_key_event: %"PRIu32", %d", scancode, flags); + WLog_DBG(TAG, "send_key_event: %" PRIu32 ", %d", scancode, flags); return JNI_TRUE; } -static jboolean JNICALL jni_freerdp_send_unicodekey_event( - JNIEnv* env, jclass cls, jlong instance, jint keycode, jboolean down) +static jboolean JNICALL jni_freerdp_send_unicodekey_event(JNIEnv* env, jclass cls, jlong instance, + jint keycode, jboolean down) { ANDROID_EVENT* event; freerdp* inst = (freerdp*)instance; UINT16 flags = (down == JNI_TRUE) ? 0 : KBD_FLAGS_RELEASE; - event = (ANDROID_EVENT*) android_event_unicodekey_new(flags, keycode); + event = (ANDROID_EVENT*)android_event_unicodekey_new(flags, keycode); if (!event) return JNI_FALSE; @@ -995,12 +970,12 @@ static jboolean JNICALL jni_freerdp_send_unicodekey_event( return JNI_TRUE; } -static jboolean JNICALL jni_freerdp_send_cursor_event( - JNIEnv* env, jclass cls, jlong instance, jint x, jint y, jint flags) +static jboolean JNICALL jni_freerdp_send_cursor_event(JNIEnv* env, jclass cls, jlong instance, + jint x, jint y, jint flags) { ANDROID_EVENT* event; freerdp* inst = (freerdp*)instance; - event = (ANDROID_EVENT*) android_event_cursor_new(flags, x, y); + event = (ANDROID_EVENT*)android_event_cursor_new(flags, x, y); if (!event) return JNI_FALSE; @@ -1015,17 +990,15 @@ static jboolean JNICALL jni_freerdp_send_cursor_event( return JNI_TRUE; } -static jboolean JNICALL jni_freerdp_send_clipboard_data( - JNIEnv* env, jclass cls, - jlong instance, jstring jdata) +static jboolean JNICALL jni_freerdp_send_clipboard_data(JNIEnv* env, jclass cls, jlong instance, + jstring jdata) { ANDROID_EVENT* event; freerdp* inst = (freerdp*)instance; - const jbyte* data = jdata != NULL ? (*env)->GetStringUTFChars(env, jdata, - NULL) : NULL; + const jbyte* data = jdata != NULL ? (*env)->GetStringUTFChars(env, jdata, NULL) : NULL; int data_length = data ? strlen(data) : 0; jboolean ret = JNI_FALSE; - event = (ANDROID_EVENT*) android_event_clipboard_new((void*)data, data_length); + event = (ANDROID_EVENT*)android_event_clipboard_new((void*)data, data_length); if (!event) goto out_fail; @@ -1071,88 +1044,25 @@ static jstring JNICALL jni_freerdp_get_build_config(JNIEnv* env, jclass cls) return (*env)->NewStringUTF(env, freerdp_get_build_config()); } -static JNINativeMethod methods[] = -{ - { - "freerdp_get_jni_version", - "()Ljava/lang/String;", - &jni_freerdp_get_jni_version - }, - { - "freerdp_get_version", - "()Ljava/lang/String;", - &jni_freerdp_get_version - }, - { - "freerdp_get_build_date", - "()Ljava/lang/String;", - &jni_freerdp_get_build_date - }, - { - "freerdp_get_build_revision", - "()Ljava/lang/String;", - &jni_freerdp_get_build_revision - }, - { - "freerdp_get_build_config", - "()Ljava/lang/String;", - &jni_freerdp_get_build_config - }, - { - "freerdp_get_last_error_string", - "(J)Ljava/lang/String;", - &jni_freerdp_get_last_error_string - }, - { - "freerdp_new", - "(Landroid/content/Context;)J", - &jni_freerdp_new - }, - { - "freerdp_free", - "(J)V", - &jni_freerdp_free - }, - { - "freerdp_parse_arguments", - "(J[Ljava/lang/String;)Z", - &jni_freerdp_parse_arguments - }, - { - "freerdp_connect", - "(J)Z", - &jni_freerdp_connect - }, - { - "freerdp_disconnect", - "(J)Z", - &jni_freerdp_disconnect - }, - { - "freerdp_update_graphics", - "(JLandroid/graphics/Bitmap;IIII)Z", - &jni_freerdp_update_graphics - }, - { - "freerdp_send_cursor_event", - "(JIII)Z", - &jni_freerdp_send_cursor_event - }, - { - "freerdp_send_key_event", - "(JIZ)Z", - &jni_freerdp_send_key_event - }, - { - "freerdp_send_unicodekey_event", - "(JIZ)Z", - &jni_freerdp_send_unicodekey_event - }, - { - "freerdp_send_clipboard_data", - "(JLjava/lang/String;)Z", - &jni_freerdp_send_clipboard_data - } +static JNINativeMethod methods[] = { + { "freerdp_get_jni_version", "()Ljava/lang/String;", &jni_freerdp_get_jni_version }, + { "freerdp_get_version", "()Ljava/lang/String;", &jni_freerdp_get_version }, + { "freerdp_get_build_date", "()Ljava/lang/String;", &jni_freerdp_get_build_date }, + { "freerdp_get_build_revision", "()Ljava/lang/String;", &jni_freerdp_get_build_revision }, + { "freerdp_get_build_config", "()Ljava/lang/String;", &jni_freerdp_get_build_config }, + { "freerdp_get_last_error_string", "(J)Ljava/lang/String;", + &jni_freerdp_get_last_error_string }, + { "freerdp_new", "(Landroid/content/Context;)J", &jni_freerdp_new }, + { "freerdp_free", "(J)V", &jni_freerdp_free }, + { "freerdp_parse_arguments", "(J[Ljava/lang/String;)Z", &jni_freerdp_parse_arguments }, + { "freerdp_connect", "(J)Z", &jni_freerdp_connect }, + { "freerdp_disconnect", "(J)Z", &jni_freerdp_disconnect }, + { "freerdp_update_graphics", "(JLandroid/graphics/Bitmap;IIII)Z", + &jni_freerdp_update_graphics }, + { "freerdp_send_cursor_event", "(JIII)Z", &jni_freerdp_send_cursor_event }, + { "freerdp_send_key_event", "(JIZ)Z", &jni_freerdp_send_key_event }, + { "freerdp_send_unicodekey_event", "(JIZ)Z", &jni_freerdp_send_unicodekey_event }, + { "freerdp_send_clipboard_data", "(JLjava/lang/String;)Z", &jni_freerdp_send_clipboard_data } }; static jclass gJavaActivityClass = NULL; @@ -1164,11 +1074,11 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) WLog_DBG(TAG, "Setting up JNI environement..."); /* - if (freerdp_handle_signals() != 0) - { - WLog_FATAL(TAG, "Failed to register signal handler"); - return -1; - } + if (freerdp_handle_signals() != 0) + { + WLog_FATAL(TAG, "Failed to register signal handler"); + return -1; + } */ if ((*vm)->GetEnv(vm, (void**)&env, JNI_VERSION_1_6) != JNI_OK) { @@ -1186,8 +1096,7 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) } // Register methods with env->RegisterNatives. - (*env)->RegisterNatives(env, activityClass, methods, - sizeof(methods) / sizeof(methods[0])); + (*env)->RegisterNatives(env, activityClass, methods, sizeof(methods) / sizeof(methods[0])); /* create global reference for class */ gJavaActivityClass = (*env)->NewGlobalRef(env, activityClass); g_JavaVm = vm; diff --git a/client/Android/android_freerdp.h b/client/Android/android_freerdp.h index ac8ca897b..58d127cbd 100644 --- a/client/Android/android_freerdp.h +++ b/client/Android/android_freerdp.h @@ -3,8 +3,9 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #ifndef FREERDP_CLIENT_ANDROID_FREERDP_H @@ -41,5 +42,3 @@ struct android_context typedef struct android_context androidContext; #endif /* FREERDP_CLIENT_ANDROID_FREERDP_H */ - - diff --git a/client/Android/android_freerdp_jni.h b/client/Android/android_freerdp_jni.h index 5bf48a24f..c0055f574 100644 --- a/client/Android/android_freerdp_jni.h +++ b/client/Android/android_freerdp_jni.h @@ -25,4 +25,3 @@ #define JAVA_FILE_CLASS "java/io/File" #endif /* FREERDP_CLIENT_ANDROID_FREERDP_JNI_H */ - diff --git a/client/Android/android_jni_callback.c b/client/Android/android_jni_callback.c index d8a5dcf3e..d57a7caca 100644 --- a/client/Android/android_jni_callback.c +++ b/client/Android/android_jni_callback.c @@ -58,7 +58,8 @@ static void jni_load_class(JNIEnv* env, const char* path, jobject* objptr) (*objptr) = (*env)->NewGlobalRef(env, object); finish: - while (0); + while (0) + ; } jint init_callback_environment(JavaVM* vm, JNIEnv* env) @@ -71,15 +72,14 @@ jint init_callback_environment(JavaVM* vm, JNIEnv* env) /* attach current thread to jvm */ jboolean jni_attach_thread(JNIEnv** env) { - if ((*jVM)->GetEnv(jVM, (void**) env, JNI_VERSION_1_4) != JNI_OK) + if ((*jVM)->GetEnv(jVM, (void**)env, JNI_VERSION_1_4) != JNI_OK) { WLog_DBG(TAG, "android_java_callback: attaching current thread"); (*jVM)->AttachCurrentThread(jVM, env, NULL); - if ((*jVM)->GetEnv(jVM, (void**) env, JNI_VERSION_1_4) != JNI_OK) + if ((*jVM)->GetEnv(jVM, (void**)env, JNI_VERSION_1_4) != JNI_OK) { - WLog_ERR(TAG, - "android_java_callback: failed to obtain current JNI environment"); + WLog_ERR(TAG, "android_java_callback: failed to obtain current JNI environment"); } return JNI_TRUE; @@ -95,8 +95,8 @@ void jni_detach_thread() } /* callback with void result */ -static void java_callback_void(jobject obj, const char* callback, - const char* signature, va_list args) +static void java_callback_void(jobject obj, const char* callback, const char* signature, + va_list args) { jclass jObjClass; jmethodID jCallback; @@ -128,8 +128,8 @@ finish: } /* callback with bool result */ -static jboolean java_callback_bool(jobject obj, const char* callback, - const char* signature, va_list args) +static jboolean java_callback_bool(jobject obj, const char* callback, const char* signature, + va_list args) { jclass jObjClass; jmethodID jCallback; @@ -164,8 +164,8 @@ finish: } /* callback with int result */ -static jint java_callback_int(jobject obj, const char* callback, - const char* signature, va_list args) +static jint java_callback_int(jobject obj, const char* callback, const char* signature, + va_list args) { jclass jObjClass; jmethodID jCallback; @@ -199,7 +199,6 @@ finish: return res; } - /* callback to freerdp class */ void freerdp_callback(const char* callback, const char* signature, ...) { @@ -209,8 +208,7 @@ void freerdp_callback(const char* callback, const char* signature, ...) va_end(vl); } -jboolean freerdp_callback_bool_result(const char* callback, - const char* signature, ...) +jboolean freerdp_callback_bool_result(const char* callback, const char* signature, ...) { va_list vl; va_start(vl, signature); @@ -219,8 +217,7 @@ jboolean freerdp_callback_bool_result(const char* callback, return res; } -jint freerdp_callback_int_result(const char* callback, const char* signature, - ...) +jint freerdp_callback_int_result(const char* callback, const char* signature, ...) { va_list vl; va_start(vl, signature); diff --git a/client/Android/android_jni_callback.h b/client/Android/android_jni_callback.h index 7f91306e3..861e40d27 100644 --- a/client/Android/android_jni_callback.h +++ b/client/Android/android_jni_callback.h @@ -20,12 +20,9 @@ FREERDP_LOCAL jint init_callback_environment(JavaVM* vm, JNIEnv* env); FREERDP_LOCAL jboolean jni_attach_thread(JNIEnv** env); FREERDP_LOCAL void jni_detach_thread(void); -FREERDP_LOCAL void freerdp_callback(const char* callback, const char* signature, - ...); -FREERDP_LOCAL jboolean freerdp_callback_bool_result(const char* callback, - const char* signature, ...); -FREERDP_LOCAL jint freerdp_callback_int_result(const char* callback, - const char* signature, ...); +FREERDP_LOCAL void freerdp_callback(const char* callback, const char* signature, ...); +FREERDP_LOCAL jboolean freerdp_callback_bool_result(const char* callback, const char* signature, + ...); +FREERDP_LOCAL jint freerdp_callback_int_result(const char* callback, const char* signature, ...); #endif /* FREERDP_CLIENT_ANDROID_JNI_CALLBACK_H */ - diff --git a/client/Android/android_jni_utils.c b/client/Android/android_jni_utils.c index f79b39c32..9c2ee3840 100644 --- a/client/Android/android_jni_utils.c +++ b/client/Android/android_jni_utils.c @@ -20,7 +20,7 @@ #define TAG CLIENT_TAG("android.utils") -JavaVM *g_JavaVm; +JavaVM* g_JavaVm; JavaVM* getJavaVM() { @@ -30,7 +30,7 @@ JavaVM* getJavaVM() JNIEnv* getJNIEnv() { JNIEnv* env = NULL; - if ((*g_JavaVm)->GetEnv(g_JavaVm, (void**) &env, JNI_VERSION_1_4) != JNI_OK) + if ((*g_JavaVm)->GetEnv(g_JavaVm, (void**)&env, JNI_VERSION_1_4) != JNI_OK) { WLog_FATAL(TAG, "Failed to obtain JNIEnv"); return NULL; @@ -38,7 +38,7 @@ JNIEnv* getJNIEnv() return env; } -jobject create_string_builder(JNIEnv *env, char* initialStr) +jobject create_string_builder(JNIEnv* env, char* initialStr) { jclass cls; jmethodID methodId; @@ -46,14 +46,14 @@ jobject create_string_builder(JNIEnv *env, char* initialStr) // get class cls = (*env)->FindClass(env, "java/lang/StringBuilder"); - if(!cls) + if (!cls) return NULL; - if(initialStr) + if (initialStr) { // get method id for constructor methodId = (*env)->GetMethodID(env, cls, "", "(Ljava/lang/String;)V"); - if(!methodId) + if (!methodId) return NULL; // create string that holds our initial string @@ -66,7 +66,7 @@ jobject create_string_builder(JNIEnv *env, char* initialStr) { // get method id for constructor methodId = (*env)->GetMethodID(env, cls, "", "()V"); - if(!methodId) + if (!methodId) return NULL; // construct new StringBuilder @@ -86,12 +86,12 @@ char* get_string_from_string_builder(JNIEnv* env, jobject strBuilder) // get class cls = (*env)->FindClass(env, "java/lang/StringBuilder"); - if(!cls) + if (!cls) return NULL; // get method id for constructor methodId = (*env)->GetMethodID(env, cls, "toString", "()Ljava/lang/String;"); - if(!methodId) + if (!methodId) return NULL; // get jstring representation of our buffer @@ -128,10 +128,10 @@ jstring jniNewStringUTF(JNIEnv* env, const char* in, int len) return NULL; } - for(i = 0; i < len; i++) + for (i = 0; i < len; i++) { unsigned char one = utf8[i]; - switch(one >> 4) + switch (one >> 4) { case 0x00: case 0x01: @@ -147,27 +147,25 @@ jstring jniNewStringUTF(JNIEnv* env, const char* in, int len) case 0x09: case 0x0a: case 0x0b: - //case 0x0f: + // case 0x0f: /* - * Bit pattern 10xx or 1111, which are illegal start bytes. - * Note: 1111 is valid for normal UTF-8, but not the - * modified UTF-8 used here. - */ + * Bit pattern 10xx or 1111, which are illegal start bytes. + * Note: 1111 is valid for normal UTF-8, but not the + * modified UTF-8 used here. + */ break; case 0x0f: case 0x0e: // Bit pattern 111x, so there are two additional bytes. if (i < (len - 2)) { - unsigned char two = utf8[i+1]; - unsigned char three = utf8[i+2]; + unsigned char two = utf8[i + 1]; + unsigned char three = utf8[i + 2]; if ((two & 0xc0) == 0x80 && (three & 0xc0) == 0x80) { i += 2; unicode[result_size++] = - ((one & 0x0f) << 12) - | ((two & 0x3f) << 6) - | (three & 0x3f); + ((one & 0x0f) << 12) | ((two & 0x3f) << 6) | (three & 0x3f); } } break; @@ -176,13 +174,11 @@ jstring jniNewStringUTF(JNIEnv* env, const char* in, int len) // Bit pattern 110x, so there is one additional byte. if (i < (len - 1)) { - unsigned char two = utf8[i+1]; + unsigned char two = utf8[i + 1]; if ((two & 0xc0) == 0x80) { i += 1; - unicode[result_size++] = - ((one & 0x1f) << 6) - | (two & 0x3f); + unicode[result_size++] = ((one & 0x1f) << 6) | (two & 0x3f); } } break; diff --git a/client/Android/android_jni_utils.h b/client/Android/android_jni_utils.h index 5414e3301..0ac804d3b 100644 --- a/client/Android/android_jni_utils.h +++ b/client/Android/android_jni_utils.h @@ -20,15 +20,14 @@ extern "C" { #endif -FREERDP_LOCAL JNIEnv* getJNIEnv(); -FREERDP_LOCAL JavaVM* getJavaVM(); + FREERDP_LOCAL JNIEnv* getJNIEnv(); + FREERDP_LOCAL JavaVM* getJavaVM(); -FREERDP_LOCAL char* get_string_from_string_builder(JNIEnv* env, - jobject strBuilder); -FREERDP_LOCAL jobject create_string_builder(JNIEnv* env, char* initialStr); -FREERDP_LOCAL jstring jniNewStringUTF(JNIEnv* env, const char* in, int len); + FREERDP_LOCAL char* get_string_from_string_builder(JNIEnv* env, jobject strBuilder); + FREERDP_LOCAL jobject create_string_builder(JNIEnv* env, char* initialStr); + FREERDP_LOCAL jstring jniNewStringUTF(JNIEnv* env, const char* in, int len); -FREERDP_LOCAL extern JavaVM* g_JavaVm; + FREERDP_LOCAL extern JavaVM* g_JavaVm; #ifdef __cplusplus } diff --git a/client/Mac/CertificateDialog.h b/client/Mac/CertificateDialog.h index 2fccbcbfd..6c4455f78 100644 --- a/client/Mac/CertificateDialog.h +++ b/client/Mac/CertificateDialog.h @@ -22,39 +22,39 @@ @interface CertificateDialog : NSWindowController { -@public - NSTextField* textCommonName; - NSTextField* textSubject; - NSTextField* textIssuer; - NSTextField* textFingerprint; - NSTextField* textMismatch; - NSTextField* messageLabel; - NSString* serverHostname; + @public + NSTextField *textCommonName; + NSTextField *textSubject; + NSTextField *textIssuer; + NSTextField *textFingerprint; + NSTextField *textMismatch; + NSTextField *messageLabel; + NSString *serverHostname; BOOL hostMismatch; BOOL changed; int result; } -@property(retain) IBOutlet NSTextField* textCommonName; -@property(retain) IBOutlet NSTextField* textSubject; -@property(retain) IBOutlet NSTextField* textIssuer; -@property(retain) IBOutlet NSTextField* textFingerprint; -@property(retain) IBOutlet NSTextField* textMismatch; -@property(retain) IBOutlet NSTextField* messageLabel; +@property(retain) IBOutlet NSTextField *textCommonName; +@property(retain) IBOutlet NSTextField *textSubject; +@property(retain) IBOutlet NSTextField *textIssuer; +@property(retain) IBOutlet NSTextField *textFingerprint; +@property(retain) IBOutlet NSTextField *textMismatch; +@property(retain) IBOutlet NSTextField *messageLabel; -- (IBAction)onAccept:(NSObject*)sender; -- (IBAction)onTemporary:(NSObject*)sender; -- (IBAction)onCancel:(NSObject*)sender; +- (IBAction)onAccept:(NSObject *)sender; +- (IBAction)onTemporary:(NSObject *)sender; +- (IBAction)onCancel:(NSObject *)sender; -@property(retain) NSString* serverHostname; -@property(retain) NSString* commonName; -@property(retain) NSString* subject; -@property(retain) NSString* issuer; -@property(retain) NSString* fingerprint; +@property(retain) NSString *serverHostname; +@property(retain) NSString *commonName; +@property(retain) NSString *subject; +@property(retain) NSString *issuer; +@property(retain) NSString *fingerprint; @property BOOL hostMismatch; @property BOOL changed; @property(readonly) int result; -- (int) runModal:(NSWindow*)mainWindow; +- (int)runModal:(NSWindow *)mainWindow; @end diff --git a/client/Mac/CertificateDialog.m b/client/Mac/CertificateDialog.m index dc01e10d1..152fbcd43 100644 --- a/client/Mac/CertificateDialog.m +++ b/client/Mac/CertificateDialog.m @@ -23,9 +23,9 @@ #import -@interface CertificateDialog() +@interface CertificateDialog () - @property int result; +@property int result; @end @@ -54,57 +54,63 @@ - (void)windowDidLoad { [super windowDidLoad]; - // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. + // Implement this method to handle any initialization after your window controller's window has + // been loaded from its nib file. [self.window setTitle:self.serverHostname]; if (self.changed) [self.messageLabel setStringValue:[NSString stringWithFormat:@"Changed certificate for %@", - self.serverHostname]]; + self.serverHostname]]; else [self.messageLabel setStringValue:[NSString stringWithFormat:@"New Certificate for %@", - self.serverHostname]]; + self.serverHostname]]; if (!self.hostMismatch) - [self.textMismatch setStringValue:[NSString stringWithFormat:@"NOTE: The server name matches the certificate, good."]]; + [self.textMismatch + setStringValue:[NSString stringWithFormat: + @"NOTE: The server name matches the certificate, good."]]; else - [self.textMismatch setStringValue:[NSString stringWithFormat:@"ATTENTION: The common name does not match the server name!"]]; + [self.textMismatch + setStringValue:[NSString + stringWithFormat: + @"ATTENTION: The common name does not match the server name!"]]; [self.textCommonName setStringValue:self.commonName]; [self.textFingerprint setStringValue:self.fingerprint]; [self.textIssuer setStringValue:self.issuer]; [self.textSubject setStringValue:self.subject]; } -- (IBAction)onAccept:(NSObject*)sender +- (IBAction)onAccept:(NSObject *)sender { [NSApp stopModalWithCode:1]; } -- (IBAction)onTemporary:(NSObject*)sender +- (IBAction)onTemporary:(NSObject *)sender { [NSApp stopModalWithCode:2]; } -- (IBAction)onCancel:(NSObject*)sender +- (IBAction)onCancel:(NSObject *)sender { [NSApp stopModalWithCode:0]; } -- (int)runModal:(NSWindow*)mainWindow +- (int)runModal:(NSWindow *)mainWindow { if ([mainWindow respondsToSelector:@selector(beginSheet:completionHandler:)]) { [mainWindow beginSheet:self.window completionHandler:nil]; - self.result = [NSApp runModalForWindow: self.window]; - [mainWindow endSheet: self.window]; + self.result = [NSApp runModalForWindow:self.window]; + [mainWindow endSheet:self.window]; } else { - [NSApp beginSheet: self.window - modalForWindow: mainWindow - modalDelegate: nil - didEndSelector: nil - contextInfo: nil]; - self.result = [NSApp runModalForWindow: self.window]; - [NSApp endSheet: self.window]; + [NSApp beginSheet:self.window + modalForWindow:mainWindow + modalDelegate:nil + didEndSelector:nil + contextInfo:nil]; + self.result = [NSApp runModalForWindow:self.window]; + [NSApp endSheet:self.window]; } [self.window orderOut:nil]; diff --git a/client/Mac/Clipboard.m b/client/Mac/Clipboard.m index 19c2cc5fc..a34e5a85d 100644 --- a/client/Mac/Clipboard.m +++ b/client/Mac/Clipboard.m @@ -20,104 +20,105 @@ #import "Clipboard.h" -int mac_cliprdr_send_client_format_list(CliprdrClientContext* cliprdr) +int mac_cliprdr_send_client_format_list(CliprdrClientContext *cliprdr) { UINT32 index; UINT32 formatId; UINT32 numFormats; - UINT32* pFormatIds; - const char* formatName; - CLIPRDR_FORMAT* formats; + UINT32 *pFormatIds; + const char *formatName; + CLIPRDR_FORMAT *formats; CLIPRDR_FORMAT_LIST formatList; - mfContext* mfc = (mfContext*) cliprdr->custom; - + mfContext *mfc = (mfContext *)cliprdr->custom; + ZeroMemory(&formatList, sizeof(CLIPRDR_FORMAT_LIST)); - + pFormatIds = NULL; numFormats = ClipboardGetFormatIds(mfc->clipboard, &pFormatIds); - - formats = (CLIPRDR_FORMAT*) calloc(numFormats, sizeof(CLIPRDR_FORMAT)); - + + formats = (CLIPRDR_FORMAT *)calloc(numFormats, sizeof(CLIPRDR_FORMAT)); + if (!formats) return -1; - + for (index = 0; index < numFormats; index++) { formatId = pFormatIds[index]; formatName = ClipboardGetFormatName(mfc->clipboard, formatId); - + formats[index].formatId = formatId; formats[index].formatName = NULL; - + if ((formatId > CF_MAX) && formatName) formats[index].formatName = _strdup(formatName); } - + formatList.msgFlags = CB_RESPONSE_OK; formatList.numFormats = numFormats; formatList.formats = formats; - + mfc->cliprdr->ClientFormatList(mfc->cliprdr, &formatList); - + for (index = 0; index < numFormats; index++) { free(formats[index].formatName); } - + free(pFormatIds); free(formats); - + return 1; } -static int mac_cliprdr_send_client_format_list_response(CliprdrClientContext* cliprdr, BOOL status) +static int mac_cliprdr_send_client_format_list_response(CliprdrClientContext *cliprdr, BOOL status) { CLIPRDR_FORMAT_LIST_RESPONSE formatListResponse; - + formatListResponse.msgType = CB_FORMAT_LIST_RESPONSE; formatListResponse.msgFlags = status ? CB_RESPONSE_OK : CB_RESPONSE_FAIL; formatListResponse.dataLen = 0; - + cliprdr->ClientFormatListResponse(cliprdr, &formatListResponse); - + return 1; } -static int mac_cliprdr_send_client_format_data_request(CliprdrClientContext* cliprdr, UINT32 formatId) +static int mac_cliprdr_send_client_format_data_request(CliprdrClientContext *cliprdr, + UINT32 formatId) { CLIPRDR_FORMAT_DATA_REQUEST formatDataRequest; - mfContext* mfc = (mfContext*) cliprdr->custom; - + mfContext *mfc = (mfContext *)cliprdr->custom; + ZeroMemory(&formatDataRequest, sizeof(CLIPRDR_FORMAT_DATA_REQUEST)); - + formatDataRequest.msgType = CB_FORMAT_DATA_REQUEST; formatDataRequest.msgFlags = 0; - + formatDataRequest.requestedFormatId = formatId; mfc->requestedFormatId = formatId; ResetEvent(mfc->clipboardRequestEvent); - + cliprdr->ClientFormatDataRequest(cliprdr, &formatDataRequest); - + return 1; } -static int mac_cliprdr_send_client_capabilities(CliprdrClientContext* cliprdr) +static int mac_cliprdr_send_client_capabilities(CliprdrClientContext *cliprdr) { CLIPRDR_CAPABILITIES capabilities; CLIPRDR_GENERAL_CAPABILITY_SET generalCapabilitySet; - + capabilities.cCapabilitiesSets = 1; - capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET*) &(generalCapabilitySet); - + capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET *)&(generalCapabilitySet); + generalCapabilitySet.capabilitySetType = CB_CAPSTYPE_GENERAL; generalCapabilitySet.capabilitySetLength = 12; - + generalCapabilitySet.version = CB_CAPS_VERSION_2; generalCapabilitySet.generalFlags = CB_USE_LONG_FORMAT_NAMES; - + cliprdr->ClientCapabilities(cliprdr, &capabilities); - + return 1; } @@ -126,14 +127,15 @@ static int mac_cliprdr_send_client_capabilities(CliprdrClientContext* cliprdr) * * @return 0 on success, otherwise a Win32 error code */ -static UINT mac_cliprdr_monitor_ready(CliprdrClientContext* cliprdr, const CLIPRDR_MONITOR_READY* monitorReady) +static UINT mac_cliprdr_monitor_ready(CliprdrClientContext *cliprdr, + const CLIPRDR_MONITOR_READY *monitorReady) { - mfContext* mfc = (mfContext*) cliprdr->custom; - + mfContext *mfc = (mfContext *)cliprdr->custom; + mfc->clipboardSync = TRUE; mac_cliprdr_send_client_capabilities(cliprdr); mac_cliprdr_send_client_format_list(cliprdr); - + return CHANNEL_RC_OK; } @@ -142,27 +144,28 @@ static UINT mac_cliprdr_monitor_ready(CliprdrClientContext* cliprdr, const CLIPR * * @return 0 on success, otherwise a Win32 error code */ -static UINT mac_cliprdr_server_capabilities(CliprdrClientContext* cliprdr, const CLIPRDR_CAPABILITIES* capabilities) +static UINT mac_cliprdr_server_capabilities(CliprdrClientContext *cliprdr, + const CLIPRDR_CAPABILITIES *capabilities) { UINT32 index; - CLIPRDR_CAPABILITY_SET* capabilitySet; - mfContext* mfc = (mfContext*) cliprdr->custom; - + CLIPRDR_CAPABILITY_SET *capabilitySet; + mfContext *mfc = (mfContext *)cliprdr->custom; + for (index = 0; index < capabilities->cCapabilitiesSets; index++) { capabilitySet = &(capabilities->capabilitySets[index]); - + if ((capabilitySet->capabilitySetType == CB_CAPSTYPE_GENERAL) && (capabilitySet->capabilitySetLength >= CB_CAPSTYPE_GENERAL_LEN)) { - CLIPRDR_GENERAL_CAPABILITY_SET* generalCapabilitySet - = (CLIPRDR_GENERAL_CAPABILITY_SET*) capabilitySet; - + CLIPRDR_GENERAL_CAPABILITY_SET *generalCapabilitySet = + (CLIPRDR_GENERAL_CAPABILITY_SET *)capabilitySet; + mfc->clipboardCapabilities = generalCapabilitySet->generalFlags; break; } } - + return CHANNEL_RC_OK; } @@ -171,48 +174,49 @@ static UINT mac_cliprdr_server_capabilities(CliprdrClientContext* cliprdr, const * * @return 0 on success, otherwise a Win32 error code */ -static UINT mac_cliprdr_server_format_list(CliprdrClientContext* cliprdr, const CLIPRDR_FORMAT_LIST* formatList) +static UINT mac_cliprdr_server_format_list(CliprdrClientContext *cliprdr, + const CLIPRDR_FORMAT_LIST *formatList) { UINT32 index; - CLIPRDR_FORMAT* format; - mfContext* mfc = (mfContext*) cliprdr->custom; - + CLIPRDR_FORMAT *format; + mfContext *mfc = (mfContext *)cliprdr->custom; + if (mfc->serverFormats) { for (index = 0; index < mfc->numServerFormats; index++) { free(mfc->serverFormats[index].formatName); } - + free(mfc->serverFormats); mfc->serverFormats = NULL; mfc->numServerFormats = 0; } - + if (formatList->numFormats < 1) return CHANNEL_RC_OK; - + mfc->numServerFormats = formatList->numFormats; - mfc->serverFormats = (CLIPRDR_FORMAT*) calloc(mfc->numServerFormats, sizeof(CLIPRDR_FORMAT)); - + mfc->serverFormats = (CLIPRDR_FORMAT *)calloc(mfc->numServerFormats, sizeof(CLIPRDR_FORMAT)); + if (!mfc->serverFormats) return CHANNEL_RC_NO_MEMORY; - + for (index = 0; index < mfc->numServerFormats; index++) { mfc->serverFormats[index].formatId = formatList->formats[index].formatId; mfc->serverFormats[index].formatName = NULL; - + if (formatList->formats[index].formatName) mfc->serverFormats[index].formatName = _strdup(formatList->formats[index].formatName); } - + mac_cliprdr_send_client_format_list_response(cliprdr, TRUE); - + for (index = 0; index < mfc->numServerFormats; index++) { format = &(mfc->serverFormats[index]); - + if (format->formatId == CF_UNICODETEXT) { mac_cliprdr_send_client_format_data_request(cliprdr, CF_UNICODETEXT); @@ -229,7 +233,7 @@ static UINT mac_cliprdr_server_format_list(CliprdrClientContext* cliprdr, const break; } } - + return CHANNEL_RC_OK; } @@ -238,7 +242,9 @@ static UINT mac_cliprdr_server_format_list(CliprdrClientContext* cliprdr, const * * @return 0 on success, otherwise a Win32 error code */ -static UINT mac_cliprdr_server_format_list_response(CliprdrClientContext* cliprdr, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) +static UINT +mac_cliprdr_server_format_list_response(CliprdrClientContext *cliprdr, + const CLIPRDR_FORMAT_LIST_RESPONSE *formatListResponse) { return CHANNEL_RC_OK; } @@ -248,7 +254,9 @@ static UINT mac_cliprdr_server_format_list_response(CliprdrClientContext* cliprd * * @return 0 on success, otherwise a Win32 error code */ -static UINT mac_cliprdr_server_lock_clipboard_data(CliprdrClientContext* cliprdr, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) +static UINT +mac_cliprdr_server_lock_clipboard_data(CliprdrClientContext *cliprdr, + const CLIPRDR_LOCK_CLIPBOARD_DATA *lockClipboardData) { return CHANNEL_RC_OK; } @@ -258,7 +266,9 @@ static UINT mac_cliprdr_server_lock_clipboard_data(CliprdrClientContext* cliprdr * * @return 0 on success, otherwise a Win32 error code */ -static UINT mac_cliprdr_server_unlock_clipboard_data(CliprdrClientContext* cliprdr, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) +static UINT +mac_cliprdr_server_unlock_clipboard_data(CliprdrClientContext *cliprdr, + const CLIPRDR_UNLOCK_CLIPBOARD_DATA *unlockClipboardData) { return CHANNEL_RC_OK; } @@ -268,34 +278,36 @@ static UINT mac_cliprdr_server_unlock_clipboard_data(CliprdrClientContext* clipr * * @return 0 on success, otherwise a Win32 error code */ -static UINT mac_cliprdr_server_format_data_request(CliprdrClientContext* cliprdr, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) +static UINT +mac_cliprdr_server_format_data_request(CliprdrClientContext *cliprdr, + const CLIPRDR_FORMAT_DATA_REQUEST *formatDataRequest) { - BYTE* data; + BYTE *data; UINT32 size; UINT32 formatId; CLIPRDR_FORMAT_DATA_RESPONSE response; - mfContext* mfc = (mfContext*) cliprdr->custom; - + mfContext *mfc = (mfContext *)cliprdr->custom; + ZeroMemory(&response, sizeof(CLIPRDR_FORMAT_DATA_RESPONSE)); - + formatId = formatDataRequest->requestedFormatId; - data = (BYTE*) ClipboardGetData(mfc->clipboard, formatId, &size); - + data = (BYTE *)ClipboardGetData(mfc->clipboard, formatId, &size); + response.msgFlags = CB_RESPONSE_OK; response.dataLen = size; response.requestedFormatData = data; - + if (!data) { response.msgFlags = CB_RESPONSE_FAIL; response.dataLen = 0; response.requestedFormatData = NULL; } - + cliprdr->ClientFormatDataResponse(cliprdr, &response); - + free(data); - + return CHANNEL_RC_OK; } @@ -304,62 +316,66 @@ static UINT mac_cliprdr_server_format_data_request(CliprdrClientContext* cliprdr * * @return 0 on success, otherwise a Win32 error code */ -static UINT mac_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) +static UINT +mac_cliprdr_server_format_data_response(CliprdrClientContext *cliprdr, + const CLIPRDR_FORMAT_DATA_RESPONSE *formatDataResponse) { - BYTE* data; + BYTE *data; UINT32 size; UINT32 index; UINT32 formatId; - CLIPRDR_FORMAT* format = NULL; - mfContext* mfc = (mfContext*) cliprdr->custom; - MRDPView* view = (MRDPView*) mfc->view; - + CLIPRDR_FORMAT *format = NULL; + mfContext *mfc = (mfContext *)cliprdr->custom; + MRDPView *view = (MRDPView *)mfc->view; + if (formatDataResponse->msgFlags & CB_RESPONSE_FAIL) { SetEvent(mfc->clipboardRequestEvent); return ERROR_INTERNAL_ERROR; } - + for (index = 0; index < mfc->numServerFormats; index++) { if (mfc->requestedFormatId == mfc->serverFormats[index].formatId) format = &(mfc->serverFormats[index]); } - + if (!format) { SetEvent(mfc->clipboardRequestEvent); return ERROR_INTERNAL_ERROR; } - + if (format->formatName) formatId = ClipboardRegisterFormat(mfc->clipboard, format->formatName); else formatId = format->formatId; - + size = formatDataResponse->dataLen; - + ClipboardSetData(mfc->clipboard, formatId, formatDataResponse->requestedFormatData, size); - + SetEvent(mfc->clipboardRequestEvent); - + if ((formatId == CF_TEXT) || (formatId == CF_OEMTEXT) || (formatId == CF_UNICODETEXT)) { formatId = ClipboardRegisterFormat(mfc->clipboard, "UTF8_STRING"); - - data = (void*) ClipboardGetData(mfc->clipboard, formatId, &size); - + + data = (void *)ClipboardGetData(mfc->clipboard, formatId, &size); + if (size > 1) size--; /* we need the size without the null terminator */ - - NSString* str = [[NSString alloc] initWithBytes: (void*) data length:size encoding:NSUTF8StringEncoding]; + + NSString *str = [[NSString alloc] initWithBytes:(void *)data + length:size + encoding:NSUTF8StringEncoding]; free(data); - - NSArray* types = [[NSArray alloc] initWithObjects:NSStringPboardType, nil]; + + NSArray *types = [[NSArray alloc] initWithObjects:NSStringPboardType, nil]; [view->pasteboard_wr declareTypes:types owner:view]; [view->pasteboard_wr setString:str forType:NSStringPboardType]; } - + return CHANNEL_RC_OK; } @@ -368,7 +384,9 @@ static UINT mac_cliprdr_server_format_data_response(CliprdrClientContext* cliprd * * @return 0 on success, otherwise a Win32 error code */ -static UINT mac_cliprdr_server_file_contents_request(CliprdrClientContext* cliprdr, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +static UINT +mac_cliprdr_server_file_contents_request(CliprdrClientContext *cliprdr, + const CLIPRDR_FILE_CONTENTS_REQUEST *fileContentsRequest) { return CHANNEL_RC_OK; } @@ -378,19 +396,20 @@ static UINT mac_cliprdr_server_file_contents_request(CliprdrClientContext* clipr * * @return 0 on success, otherwise a Win32 error code */ -static UINT mac_cliprdr_server_file_contents_response(CliprdrClientContext* cliprdr, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) +static UINT mac_cliprdr_server_file_contents_response( + CliprdrClientContext *cliprdr, const CLIPRDR_FILE_CONTENTS_RESPONSE *fileContentsResponse) { return CHANNEL_RC_OK; } -void mac_cliprdr_init(mfContext* mfc, CliprdrClientContext* cliprdr) +void mac_cliprdr_init(mfContext *mfc, CliprdrClientContext *cliprdr) { - cliprdr->custom = (void*) mfc; + cliprdr->custom = (void *)mfc; mfc->cliprdr = cliprdr; - + mfc->clipboard = ClipboardCreate(); mfc->clipboardRequestEvent = CreateEvent(NULL, TRUE, FALSE, NULL); - + cliprdr->MonitorReady = mac_cliprdr_monitor_ready; cliprdr->ServerCapabilities = mac_cliprdr_server_capabilities; cliprdr->ServerFormatList = mac_cliprdr_server_format_list; @@ -403,11 +422,11 @@ void mac_cliprdr_init(mfContext* mfc, CliprdrClientContext* cliprdr) cliprdr->ServerFileContentsResponse = mac_cliprdr_server_file_contents_response; } -void mac_cliprdr_uninit(mfContext* mfc, CliprdrClientContext* cliprdr) +void mac_cliprdr_uninit(mfContext *mfc, CliprdrClientContext *cliprdr) { cliprdr->custom = NULL; mfc->cliprdr = NULL; - + ClipboardDestroy(mfc->clipboard); CloseHandle(mfc->clipboardRequestEvent); } diff --git a/client/Mac/Keyboard.m b/client/Mac/Keyboard.m index 90eb5381d..9bb9cd481 100644 --- a/client/Mac/Keyboard.m +++ b/client/Mac/Keyboard.m @@ -33,8 +33,7 @@ typedef struct _APPLE_KEYBOARD_DESC APPLE_KEYBOARD_DESC; /* VendorID: 0x05AC (Apple, Inc.) */ -static const APPLE_KEYBOARD_DESC APPLE_KEYBOARDS[] = -{ +static const APPLE_KEYBOARD_DESC APPLE_KEYBOARDS[] = { { 0x200, APPLE_KEYBOARD_TYPE_ANSI }, { 0x201, APPLE_KEYBOARD_TYPE_ANSI }, /* USB Keyboard [Alps or Logitech, M2452] */ { 0x202, APPLE_KEYBOARD_TYPE_ANSI }, /* Keyboard [ALPS] */ @@ -50,48 +49,48 @@ static const APPLE_KEYBOARD_DESC APPLE_KEYBOARDS[] = { 0x20C, APPLE_KEYBOARD_TYPE_ANSI }, /* Extended Keyboard [Mitsumi] */ { 0x20D, APPLE_KEYBOARD_TYPE_ANSI }, /* Pro Keyboard [Mitsumi, A1048/JIS layout] */ { 0x20E, APPLE_KEYBOARD_TYPE_ANSI }, /* Internal Keyboard/Trackpad (ANSI) */ - { 0x20F, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ + { 0x20F, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ { 0x210, APPLE_KEYBOARD_TYPE_ANSI }, { 0x211, APPLE_KEYBOARD_TYPE_ANSI }, { 0x212, APPLE_KEYBOARD_TYPE_ANSI }, { 0x213, APPLE_KEYBOARD_TYPE_ANSI }, { 0x214, APPLE_KEYBOARD_TYPE_ANSI }, /* Internal Keyboard/Trackpad (ANSI) */ - { 0x215, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ - { 0x216, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (JIS) */ + { 0x215, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ + { 0x216, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (JIS) */ { 0x217, APPLE_KEYBOARD_TYPE_ANSI }, /* Internal Keyboard/Trackpad (ANSI) */ - { 0x218, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ - { 0x219, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (JIS) */ + { 0x218, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ + { 0x219, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (JIS) */ { 0x21A, APPLE_KEYBOARD_TYPE_ANSI }, /* Internal Keyboard/Trackpad (ANSI) */ - { 0x21B, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ - { 0x21C, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (JIS) */ + { 0x21B, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ + { 0x21C, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (JIS) */ { 0x21D, APPLE_KEYBOARD_TYPE_ANSI }, /* Aluminum Mini Keyboard (ANSI) */ - { 0x21E, APPLE_KEYBOARD_TYPE_ISO }, /* Aluminum Mini Keyboard (ISO) */ - { 0x21F, APPLE_KEYBOARD_TYPE_JIS }, /* Aluminum Mini Keyboard (JIS) */ + { 0x21E, APPLE_KEYBOARD_TYPE_ISO }, /* Aluminum Mini Keyboard (ISO) */ + { 0x21F, APPLE_KEYBOARD_TYPE_JIS }, /* Aluminum Mini Keyboard (JIS) */ { 0x220, APPLE_KEYBOARD_TYPE_ANSI }, /* Aluminum Keyboard (ANSI) */ - { 0x221, APPLE_KEYBOARD_TYPE_JIS }, /* Aluminum Keyboard (JIS) */ - { 0x222, APPLE_KEYBOARD_TYPE_JIS }, /* Aluminum Keyboard (JIS) */ + { 0x221, APPLE_KEYBOARD_TYPE_JIS }, /* Aluminum Keyboard (JIS) */ + { 0x222, APPLE_KEYBOARD_TYPE_JIS }, /* Aluminum Keyboard (JIS) */ { 0x223, APPLE_KEYBOARD_TYPE_ANSI }, /* Internal Keyboard/Trackpad (ANSI) */ - { 0x224, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ - { 0x225, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (JIS) */ + { 0x224, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ + { 0x225, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (JIS) */ { 0x226, APPLE_KEYBOARD_TYPE_ANSI }, { 0x227, APPLE_KEYBOARD_TYPE_ANSI }, { 0x228, APPLE_KEYBOARD_TYPE_ANSI }, { 0x229, APPLE_KEYBOARD_TYPE_ANSI }, /* Internal Keyboard/Trackpad (MacBook Pro) (ANSI) */ - { 0x22A, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (MacBook Pro) (ISO) */ - { 0x22B, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (MacBook Pro) (JIS) */ + { 0x22A, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (MacBook Pro) (ISO) */ + { 0x22B, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (MacBook Pro) (JIS) */ { 0x22C, APPLE_KEYBOARD_TYPE_ANSI }, { 0x22D, APPLE_KEYBOARD_TYPE_ANSI }, { 0x22E, APPLE_KEYBOARD_TYPE_ANSI }, { 0x22F, APPLE_KEYBOARD_TYPE_ANSI }, { 0x230, APPLE_KEYBOARD_TYPE_ANSI }, /* Internal Keyboard/Trackpad (MacBook Pro 4,1) (ANSI) */ - { 0x231, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (MacBook Pro 4,1) (ISO) */ - { 0x232, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (MacBook Pro 4,1) (JIS) */ + { 0x231, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (MacBook Pro 4,1) (ISO) */ + { 0x232, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (MacBook Pro 4,1) (JIS) */ { 0x233, APPLE_KEYBOARD_TYPE_ANSI }, { 0x234, APPLE_KEYBOARD_TYPE_ANSI }, { 0x235, APPLE_KEYBOARD_TYPE_ANSI }, { 0x236, APPLE_KEYBOARD_TYPE_ANSI }, /* Internal Keyboard/Trackpad (ANSI) */ - { 0x237, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ - { 0x238, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (JIS) */ + { 0x237, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ + { 0x238, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (JIS) */ { 0x239, APPLE_KEYBOARD_TYPE_ANSI }, { 0x23A, APPLE_KEYBOARD_TYPE_ANSI }, { 0x23B, APPLE_KEYBOARD_TYPE_ANSI }, @@ -99,14 +98,14 @@ static const APPLE_KEYBOARD_DESC APPLE_KEYBOARDS[] = { 0x23D, APPLE_KEYBOARD_TYPE_ANSI }, { 0x23E, APPLE_KEYBOARD_TYPE_ANSI }, { 0x23F, APPLE_KEYBOARD_TYPE_ANSI }, /* Internal Keyboard/Trackpad (ANSI) */ - { 0x240, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ - { 0x241, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (JIS) */ + { 0x240, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ + { 0x241, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (JIS) */ { 0x242, APPLE_KEYBOARD_TYPE_ANSI }, /* Internal Keyboard/Trackpad (ANSI) */ - { 0x243, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ - { 0x244, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (JIS) */ + { 0x243, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ + { 0x244, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (JIS) */ { 0x245, APPLE_KEYBOARD_TYPE_ANSI }, /* Internal Keyboard/Trackpad (ANSI) */ - { 0x246, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ - { 0x247, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (JIS) */ + { 0x246, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ + { 0x247, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (JIS) */ { 0x248, APPLE_KEYBOARD_TYPE_ANSI }, { 0x249, APPLE_KEYBOARD_TYPE_ANSI }, { 0x24A, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (MacBook Air) (ISO) */ @@ -118,8 +117,8 @@ static const APPLE_KEYBOARD_DESC APPLE_KEYBOARDS[] = { 0x250, APPLE_KEYBOARD_TYPE_ISO }, /* Aluminium Keyboard (ISO) */ { 0x251, APPLE_KEYBOARD_TYPE_ANSI }, { 0x252, APPLE_KEYBOARD_TYPE_ANSI }, /* Internal Keyboard/Trackpad (ANSI) */ - { 0x253, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ - { 0x254, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (JIS) */ + { 0x253, APPLE_KEYBOARD_TYPE_ISO }, /* Internal Keyboard/Trackpad (ISO) */ + { 0x254, APPLE_KEYBOARD_TYPE_JIS }, /* Internal Keyboard/Trackpad (JIS) */ { 0x255, APPLE_KEYBOARD_TYPE_ANSI }, { 0x256, APPLE_KEYBOARD_TYPE_ANSI }, { 0x257, APPLE_KEYBOARD_TYPE_ANSI }, @@ -144,8 +143,7 @@ static const APPLE_KEYBOARD_DESC APPLE_KEYBOARDS[] = { 0x26A, APPLE_KEYBOARD_TYPE_ANSI } }; -static enum APPLE_KEYBOARD_TYPE mac_identify_keyboard_type(uint32_t vendorID, - uint32_t productID) +static enum APPLE_KEYBOARD_TYPE mac_identify_keyboard_type(uint32_t vendorID, uint32_t productID) { enum APPLE_KEYBOARD_TYPE type = APPLE_KEYBOARD_TYPE_ANSI; @@ -164,10 +162,9 @@ enum APPLE_KEYBOARD_TYPE mac_detect_keyboard_type(void) CFSetRef deviceCFSetRef = NULL; IOHIDDeviceRef inIOHIDDeviceRef = NULL; IOHIDManagerRef tIOHIDManagerRef = NULL; - IOHIDDeviceRef* tIOHIDDeviceRefs = nil; + IOHIDDeviceRef *tIOHIDDeviceRefs = nil; enum APPLE_KEYBOARD_TYPE type = APPLE_KEYBOARD_TYPE_ANSI; - tIOHIDManagerRef = IOHIDManagerCreate(kCFAllocatorDefault, - kIOHIDOptionsTypeNone); + tIOHIDManagerRef = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone); if (!tIOHIDManagerRef) return type; @@ -189,7 +186,7 @@ enum APPLE_KEYBOARD_TYPE mac_detect_keyboard_type(void) if (!tIOHIDDeviceRefs) return type; - CFSetGetValues(deviceCFSetRef, (const void**) tIOHIDDeviceRefs); + CFSetGetValues(deviceCFSetRef, (const void **)tIOHIDDeviceRefs); CFRelease(deviceCFSetRef); deviceCFSetRef = NULL; @@ -208,19 +205,17 @@ enum APPLE_KEYBOARD_TYPE mac_detect_keyboard_type(void) tCFTypeRef = IOHIDDeviceGetProperty(inIOHIDDeviceRef, CFSTR(kIOHIDVendorIDKey)); if (tCFTypeRef) - CFNumberGetValue((CFNumberRef) tCFTypeRef, kCFNumberSInt32Type, &vendorID); + CFNumberGetValue((CFNumberRef)tCFTypeRef, kCFNumberSInt32Type, &vendorID); - tCFTypeRef = IOHIDDeviceGetProperty(inIOHIDDeviceRef, - CFSTR(kIOHIDProductIDKey)); + tCFTypeRef = IOHIDDeviceGetProperty(inIOHIDDeviceRef, CFSTR(kIOHIDProductIDKey)); if (tCFTypeRef) - CFNumberGetValue((CFNumberRef) tCFTypeRef, kCFNumberSInt32Type, &productID); + CFNumberGetValue((CFNumberRef)tCFTypeRef, kCFNumberSInt32Type, &productID); - tCFTypeRef = IOHIDDeviceGetProperty(inIOHIDDeviceRef, - CFSTR(kIOHIDCountryCodeKey)); + tCFTypeRef = IOHIDDeviceGetProperty(inIOHIDDeviceRef, CFSTR(kIOHIDCountryCodeKey)); if (tCFTypeRef) - CFNumberGetValue((CFNumberRef) tCFTypeRef, kCFNumberSInt32Type, &countryCode); + CFNumberGetValue((CFNumberRef)tCFTypeRef, kCFNumberSInt32Type, &countryCode); ltype = mac_identify_keyboard_type(vendorID, productID); diff --git a/client/Mac/MRDPCursor.h b/client/Mac/MRDPCursor.h index 767ccbc52..6b16d793f 100644 --- a/client/Mac/MRDPCursor.h +++ b/client/Mac/MRDPCursor.h @@ -23,12 +23,12 @@ @interface MRDPCursor : NSObject { -@public - rdpPointer* pointer; - BYTE* cursor_data; - NSBitmapImageRep* bmiRep; - NSCursor* nsCursor; - NSImage* nsImage; + @public + rdpPointer *pointer; + BYTE *cursor_data; + NSBitmapImageRep *bmiRep; + NSCursor *nsCursor; + NSImage *nsImage; } @end diff --git a/client/Mac/MRDPView.h b/client/Mac/MRDPView.h index 1c74a1b53..51eb8f549 100644 --- a/client/Mac/MRDPView.h +++ b/client/Mac/MRDPView.h @@ -30,19 +30,19 @@ @interface MRDPView : NSView { - mfContext* mfc; - NSBitmapImageRep* bmiRep; - NSMutableArray* cursors; - NSMutableArray* windows; - NSTimer* pasteboard_timer; - NSCursor* currentCursor; + mfContext *mfc; + NSBitmapImageRep *bmiRep; + NSMutableArray *cursors; + NSMutableArray *windows; + NSTimer *pasteboard_timer; + NSCursor *currentCursor; NSRect prevWinPosition; - freerdp* instance; - rdpContext* context; + freerdp *instance; + rdpContext *context; CGContextRef bitmap_context; - char* pixel_data; + char *pixel_data; int argc; - char** argv; + char **argv; DWORD kbdModFlags; BOOL initialized; NSPoint savedDragLocation; @@ -51,57 +51,51 @@ BOOL skipResizeOnce; BOOL saveInitialDragLoc; BOOL skipMoveWindowOnce; -@public - NSPasteboard* pasteboard_rd; - NSPasteboard* pasteboard_wr; + @public + NSPasteboard *pasteboard_rd; + NSPasteboard *pasteboard_wr; int pasteboard_changecount; int pasteboard_format; int is_connected; } -- (int) rdpStart :(rdpContext*) rdp_context; -- (void) setCursor: (NSCursor*) cursor; -- (void) setScrollOffset:(int)xOffset y:(int)yOffset w:(int)width h:(int)height; +- (int)rdpStart:(rdpContext *)rdp_context; +- (void)setCursor:(NSCursor *)cursor; +- (void)setScrollOffset:(int)xOffset y:(int)yOffset w:(int)width h:(int)height; -- (void) onPasteboardTimerFired :(NSTimer*) timer; -- (void) pause; -- (void) resume; -- (void) releaseResources; +- (void)onPasteboardTimerFired:(NSTimer *)timer; +- (void)pause; +- (void)resume; +- (void)releaseResources; @property(assign) int is_connected; @end /* Pointer Flags */ -#define PTR_FLAGS_WHEEL 0x0200 -#define PTR_FLAGS_WHEEL_NEGATIVE 0x0100 -#define PTR_FLAGS_MOVE 0x0800 -#define PTR_FLAGS_DOWN 0x8000 -#define PTR_FLAGS_BUTTON1 0x1000 -#define PTR_FLAGS_BUTTON2 0x2000 -#define PTR_FLAGS_BUTTON3 0x4000 -#define WheelRotationMask 0x01FF +#define PTR_FLAGS_WHEEL 0x0200 +#define PTR_FLAGS_WHEEL_NEGATIVE 0x0100 +#define PTR_FLAGS_MOVE 0x0800 +#define PTR_FLAGS_DOWN 0x8000 +#define PTR_FLAGS_BUTTON1 0x1000 +#define PTR_FLAGS_BUTTON2 0x2000 +#define PTR_FLAGS_BUTTON3 0x4000 +#define WheelRotationMask 0x01FF -BOOL mac_pre_connect(freerdp* instance); -BOOL mac_post_connect(freerdp* instance); -void mac_post_disconnect(freerdp* instance); -BOOL mac_authenticate(freerdp* instance, char** username, char** password, - char** domain); -BOOL mac_gw_authenticate(freerdp* instance, char** username, char** password, - char** domain); +BOOL mac_pre_connect(freerdp *instance); +BOOL mac_post_connect(freerdp *instance); +void mac_post_disconnect(freerdp *instance); +BOOL mac_authenticate(freerdp *instance, char **username, char **password, char **domain); +BOOL mac_gw_authenticate(freerdp *instance, char **username, char **password, char **domain); -DWORD mac_verify_certificate_ex(freerdp* instance, const char* host, UINT16 port, - const char* common_name, const char* subject, - const char* issuer, const char* fingerprint, - DWORD flags); -DWORD mac_verify_changed_certificate_ex(freerdp* instance, const char* host, - UINT16 port, const char* common_name, - const char* subject, const char* issuer, - const char* fingerprint, - const char* old_subject, - const char* old_issuer, - const char* old_fingerprint, - DWORD flags); +DWORD mac_verify_certificate_ex(freerdp *instance, const char *host, UINT16 port, + const char *common_name, const char *subject, const char *issuer, + const char *fingerprint, DWORD flags); +DWORD mac_verify_changed_certificate_ex(freerdp *instance, const char *host, UINT16 port, + const char *common_name, const char *subject, + const char *issuer, const char *fingerprint, + const char *old_subject, const char *old_issuer, + const char *old_fingerprint, DWORD flags); -int mac_logon_error_info(freerdp* instance, UINT32 data, UINT32 type); +int mac_logon_error_info(freerdp *instance, UINT32 data, UINT32 type); #endif /* FREERDP_CLIENT_MAC_MRDPVIEW_H */ diff --git a/client/Mac/MRDPView.m b/client/Mac/MRDPView.m index bdc3c32cd..dc07cdc01 100644 --- a/client/Mac/MRDPView.m +++ b/client/Mac/MRDPView.m @@ -49,44 +49,44 @@ #define TAG CLIENT_TAG("mac") -static BOOL mf_Pointer_New(rdpContext* context, rdpPointer* pointer); -static void mf_Pointer_Free(rdpContext* context, rdpPointer* pointer); -static BOOL mf_Pointer_Set(rdpContext* context, const rdpPointer* pointer); -static BOOL mf_Pointer_SetNull(rdpContext* context); -static BOOL mf_Pointer_SetDefault(rdpContext* context); -static BOOL mf_Pointer_SetPosition(rdpContext* context, UINT32 x, UINT32 y); +static BOOL mf_Pointer_New(rdpContext *context, rdpPointer *pointer); +static void mf_Pointer_Free(rdpContext *context, rdpPointer *pointer); +static BOOL mf_Pointer_Set(rdpContext *context, const rdpPointer *pointer); +static BOOL mf_Pointer_SetNull(rdpContext *context); +static BOOL mf_Pointer_SetDefault(rdpContext *context); +static BOOL mf_Pointer_SetPosition(rdpContext *context, UINT32 x, UINT32 y); -static BOOL mac_begin_paint(rdpContext* context); -static BOOL mac_end_paint(rdpContext* context); -static BOOL mac_desktop_resize(rdpContext* context); +static BOOL mac_begin_paint(rdpContext *context); +static BOOL mac_end_paint(rdpContext *context); +static BOOL mac_desktop_resize(rdpContext *context); -static void input_activity_cb(freerdp* instance); +static void input_activity_cb(freerdp *instance); -static DWORD WINAPI mac_client_thread(void* param); +static DWORD WINAPI mac_client_thread(void *param); @implementation MRDPView @synthesize is_connected; -- (int) rdpStart:(rdpContext*) rdp_context +- (int)rdpStart:(rdpContext *)rdp_context { - rdpSettings* settings; + rdpSettings *settings; EmbedWindowEventArgs e; [self initializeView]; context = rdp_context; - mfc = (mfContext*) rdp_context; + mfc = (mfContext *)rdp_context; instance = context->instance; settings = context->settings; EventArgsInit(&e, "mfreerdp"); e.embed = TRUE; - e.handle = (void*) self; + e.handle = (void *)self; PubSub_OnEmbedWindow(context->pubSub, context, &e); - NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; + NSScreen *screen = [[NSScreen screens] objectAtIndex:0]; NSRect screenFrame = [screen frame]; if (instance->settings->Fullscreen) { - instance->settings->DesktopWidth = screenFrame.size.width; + instance->settings->DesktopWidth = screenFrame.size.width; instance->settings->DesktopHeight = screenFrame.size.height; [self enterFullScreenMode:[NSScreen mainScreen] withOptions:nil]; } @@ -98,8 +98,8 @@ static DWORD WINAPI mac_client_thread(void* param); mfc->client_height = instance->settings->DesktopHeight; mfc->client_width = instance->settings->DesktopWidth; - if (!(mfc->thread = CreateThread(NULL, 0, mac_client_thread, (void*) context, 0, - &mfc->mainThreadId))) + if (!(mfc->thread = + CreateThread(NULL, 0, mac_client_thread, (void *)context, 0, &mfc->mainThreadId))) { WLog_ERR(TAG, "failed to create client thread"); return -1; @@ -112,18 +112,17 @@ static DWORD WINAPI mac_client_input_thread(LPVOID param) { int status; wMessage message; - wMessageQueue* queue; - rdpContext* context = (rdpContext*) param; + wMessageQueue *queue; + rdpContext *context = (rdpContext *)param; status = 1; - queue = freerdp_get_message_queue(context->instance, - FREERDP_INPUT_MESSAGE_QUEUE); + queue = freerdp_get_message_queue(context->instance, FREERDP_INPUT_MESSAGE_QUEUE); while (MessageQueue_Wait(queue)) { while (MessageQueue_Peek(queue, &message, TRUE)) { status = freerdp_message_queue_process_message(context->instance, - FREERDP_INPUT_MESSAGE_QUEUE, &message); + FREERDP_INPUT_MESSAGE_QUEUE, &message); if (!status) break; @@ -137,7 +136,7 @@ static DWORD WINAPI mac_client_input_thread(LPVOID param) return 0; } -DWORD WINAPI mac_client_thread(void* param) +DWORD WINAPI mac_client_thread(void *param) { @autoreleasepool { @@ -149,11 +148,11 @@ DWORD WINAPI mac_client_thread(void* param) DWORD nCount; DWORD nCountTmp; DWORD nCountBase; - rdpContext* context = (rdpContext*) param; - mfContext* mfc = (mfContext*) context; - freerdp* instance = context->instance; - MRDPView* view = mfc->view; - rdpSettings* settings = context->settings; + rdpContext *context = (rdpContext *)param; + mfContext *mfc = (mfContext *)context; + freerdp *instance = context->instance; + MRDPView *view = mfc->view; + rdpSettings *settings = context->settings; status = freerdp_connect(context->instance); if (!status) @@ -170,14 +169,14 @@ DWORD WINAPI mac_client_thread(void* param) { if (!(inputThread = CreateThread(NULL, 0, mac_client_input_thread, context, 0, NULL))) { - WLog_ERR(TAG, "failed to create async input thread"); + WLog_ERR(TAG, "failed to create async input thread"); goto disconnect; } } else { if (!(inputEvent = freerdp_get_message_queue_event_handle(instance, - FREERDP_INPUT_MESSAGE_QUEUE))) + FREERDP_INPUT_MESSAGE_QUEUE))) { WLog_ERR(TAG, "failed to get input event handle"); goto disconnect; @@ -192,8 +191,7 @@ DWORD WINAPI mac_client_thread(void* param) { nCount = nCountBase; { - if (!(nCountTmp = freerdp_get_event_handles(context, &events[nCount], - 16 - nCount))) + if (!(nCountTmp = freerdp_get_event_handles(context, &events[nCount], 16 - nCount))) { WLog_ERR(TAG, "freerdp_get_event_handles failed"); break; @@ -238,8 +236,8 @@ DWORD WINAPI mac_client_thread(void* param) if (settings->AsyncInput && inputThread) { - wMessageQueue* inputQueue = freerdp_get_message_queue(instance, - FREERDP_INPUT_MESSAGE_QUEUE); + wMessageQueue *inputQueue = + freerdp_get_message_queue(instance, FREERDP_INPUT_MESSAGE_QUEUE); if (inputQueue) { @@ -267,21 +265,24 @@ DWORD WINAPI mac_client_thread(void* param) return self; } -- (void) viewDidLoad +- (void)viewDidLoad { [self initializeView]; } -- (void) initializeView +- (void)initializeView { if (!initialized) { cursors = [[NSMutableArray alloc] initWithCapacity:10]; // setup a mouse tracking area - NSTrackingArea* trackingArea = [[NSTrackingArea alloc] initWithRect:[self - visibleRect] options:NSTrackingMouseEnteredAndExited | NSTrackingMouseMoved | - NSTrackingCursorUpdate | NSTrackingEnabledDuringMouseDrag | - NSTrackingActiveWhenFirstResponder owner:self userInfo:nil]; + NSTrackingArea *trackingArea = [[NSTrackingArea alloc] + initWithRect:[self visibleRect] + options:NSTrackingMouseEnteredAndExited | NSTrackingMouseMoved | + NSTrackingCursorUpdate | NSTrackingEnabledDuringMouseDrag | + NSTrackingActiveWhenFirstResponder + owner:self + userInfo:nil]; [self addTrackingArea:trackingArea]; // Set the default cursor currentCursor = [NSCursor arrowCursor]; @@ -289,16 +290,15 @@ DWORD WINAPI mac_client_thread(void* param) } } -- (void) setCursor: (NSCursor*) cursor +- (void)setCursor:(NSCursor *)cursor { self->currentCursor = cursor; - dispatch_async(dispatch_get_main_queue(), ^ - { + dispatch_async(dispatch_get_main_queue(), ^{ [[self window] invalidateCursorRectsForView:self]; }); } -- (void) resetCursorRects +- (void)resetCursorRects { [self addCursorRect:[self visibleRect] cursor:currentCursor]; } @@ -308,7 +308,7 @@ DWORD WINAPI mac_client_thread(void* param) return YES; } -- (void) mouseMoved:(NSEvent*)event +- (void)mouseMoved:(NSEvent *)event { [super mouseMoved:event]; @@ -316,12 +316,12 @@ DWORD WINAPI mac_client_thread(void* param) return; NSPoint loc = [event locationInWindow]; - int x = (int) loc.x; - int y = (int) loc.y; + int x = (int)loc.x; + int y = (int)loc.y; mf_scale_mouse_event(context, instance->input, PTR_FLAGS_MOVE, x, y); } -- (void)mouseDown:(NSEvent*) event +- (void)mouseDown:(NSEvent *)event { [super mouseDown:event]; @@ -329,12 +329,12 @@ DWORD WINAPI mac_client_thread(void* param) return; NSPoint loc = [event locationInWindow]; - int x = (int) loc.x; - int y = (int) loc.y; + int x = (int)loc.x; + int y = (int)loc.y; mf_press_mouse_button(context, instance->input, 0, x, y, TRUE); } -- (void) mouseUp:(NSEvent*) event +- (void)mouseUp:(NSEvent *)event { [super mouseUp:event]; @@ -342,12 +342,12 @@ DWORD WINAPI mac_client_thread(void* param) return; NSPoint loc = [event locationInWindow]; - int x = (int) loc.x; - int y = (int) loc.y; + int x = (int)loc.x; + int y = (int)loc.y; mf_press_mouse_button(context, instance->input, 0, x, y, FALSE); } -- (void) rightMouseDown:(NSEvent*)event +- (void)rightMouseDown:(NSEvent *)event { [super rightMouseDown:event]; @@ -355,12 +355,12 @@ DWORD WINAPI mac_client_thread(void* param) return; NSPoint loc = [event locationInWindow]; - int x = (int) loc.x; - int y = (int) loc.y; + int x = (int)loc.x; + int y = (int)loc.y; mf_press_mouse_button(context, instance->input, 1, x, y, TRUE); } -- (void) rightMouseUp:(NSEvent*)event +- (void)rightMouseUp:(NSEvent *)event { [super rightMouseUp:event]; @@ -368,12 +368,12 @@ DWORD WINAPI mac_client_thread(void* param) return; NSPoint loc = [event locationInWindow]; - int x = (int) loc.x; - int y = (int) loc.y; + int x = (int)loc.x; + int y = (int)loc.y; mf_press_mouse_button(context, instance->input, 1, x, y, FALSE); } -- (void) otherMouseDown:(NSEvent*)event +- (void)otherMouseDown:(NSEvent *)event { [super otherMouseDown:event]; @@ -381,13 +381,13 @@ DWORD WINAPI mac_client_thread(void* param) return; NSPoint loc = [event locationInWindow]; - int x = (int) loc.x; - int y = (int) loc.y; + int x = (int)loc.x; + int y = (int)loc.y; int pressed = [event buttonNumber]; mf_press_mouse_button(context, instance->input, pressed, x, y, TRUE); } -- (void) otherMouseUp:(NSEvent*)event +- (void)otherMouseUp:(NSEvent *)event { [super otherMouseUp:event]; @@ -395,13 +395,13 @@ DWORD WINAPI mac_client_thread(void* param) return; NSPoint loc = [event locationInWindow]; - int x = (int) loc.x; - int y = (int) loc.y; + int x = (int)loc.x; + int y = (int)loc.y; int pressed = [event buttonNumber]; mf_press_mouse_button(context, instance->input, pressed, x, y, FALSE); } -- (void) scrollWheel:(NSEvent*)event +- (void)scrollWheel:(NSEvent *)event { UINT16 flags; [super scrollWheel:event]; @@ -441,13 +441,12 @@ DWORD WINAPI mac_client_thread(void* param) { /* limit to maximum value in WheelRotationMask (9bit signed value) */ const UINT16 step = units & WheelRotationMask; - mf_scale_mouse_event(context, instance->input, - flags | step, 0, 0); + mf_scale_mouse_event(context, instance->input, flags | step, 0, 0); units -= step; } } -- (void) mouseDragged:(NSEvent*)event +- (void)mouseDragged:(NSEvent *)event { [super mouseDragged:event]; @@ -455,8 +454,8 @@ DWORD WINAPI mac_client_thread(void* param) return; NSPoint loc = [event locationInWindow]; - int x = (int) loc.x; - int y = (int) loc.y; + int x = (int)loc.x; + int y = (int)loc.y; // send mouse motion event to RDP server mf_scale_mouse_event(context, instance->input, PTR_FLAGS_MOVE, x, y); } @@ -517,14 +516,14 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type) return keyCode; } -- (void) keyDown:(NSEvent*) event +- (void)keyDown:(NSEvent *)event { DWORD keyCode; DWORD keyFlags; DWORD vkcode; DWORD scancode; unichar keyChar; - NSString* characters; + NSString *characters; if (!is_connected) return; @@ -553,14 +552,14 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type) freerdp_input_send_keyboard_event(instance->input, keyFlags, scancode); } -- (void) keyUp:(NSEvent*) event +- (void)keyUp:(NSEvent *)event { DWORD keyCode; DWORD keyFlags; DWORD vkcode; DWORD scancode; unichar keyChar; - NSString* characters; + NSString *characters; if (!is_connected) return; @@ -588,7 +587,7 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type) freerdp_input_send_keyboard_event(instance->input, keyFlags, scancode); } -- (void) flagsChanged:(NSEvent*) event +- (void)flagsChanged:(NSEvent *)event { int key; DWORD keyFlags; @@ -636,60 +635,44 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type) #endif if ((modFlags & NSAlphaShiftKeyMask) && !(kbdModFlags & NSAlphaShiftKeyMask)) - freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_DOWN, - scancode); - else if (!(modFlags & NSAlphaShiftKeyMask) - && (kbdModFlags & NSAlphaShiftKeyMask)) - freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_RELEASE, - scancode); + freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_DOWN, scancode); + else if (!(modFlags & NSAlphaShiftKeyMask) && (kbdModFlags & NSAlphaShiftKeyMask)) + freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_RELEASE, scancode); if ((modFlags & NSShiftKeyMask) && !(kbdModFlags & NSShiftKeyMask)) - freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_DOWN, - scancode); + freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_DOWN, scancode); else if (!(modFlags & NSShiftKeyMask) && (kbdModFlags & NSShiftKeyMask)) - freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_RELEASE, - scancode); + freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_RELEASE, scancode); if ((modFlags & NSControlKeyMask) && !(kbdModFlags & NSControlKeyMask)) - freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_DOWN, - scancode); + freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_DOWN, scancode); else if (!(modFlags & NSControlKeyMask) && (kbdModFlags & NSControlKeyMask)) - freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_RELEASE, - scancode); + freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_RELEASE, scancode); if ((modFlags & NSAlternateKeyMask) && !(kbdModFlags & NSAlternateKeyMask)) - freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_DOWN, - scancode); + freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_DOWN, scancode); else if (!(modFlags & NSAlternateKeyMask) && (kbdModFlags & NSAlternateKeyMask)) - freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_RELEASE, - scancode); + freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_RELEASE, scancode); if ((modFlags & NSCommandKeyMask) && !(kbdModFlags & NSCommandKeyMask)) - freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_DOWN, - scancode); + freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_DOWN, scancode); else if (!(modFlags & NSCommandKeyMask) && (kbdModFlags & NSCommandKeyMask)) - freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_RELEASE, - scancode); + freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_RELEASE, scancode); if ((modFlags & NSNumericPadKeyMask) && !(kbdModFlags & NSNumericPadKeyMask)) - freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_DOWN, - scancode); - else if (!(modFlags & NSNumericPadKeyMask) - && (kbdModFlags & NSNumericPadKeyMask)) - freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_RELEASE, - scancode); + freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_DOWN, scancode); + else if (!(modFlags & NSNumericPadKeyMask) && (kbdModFlags & NSNumericPadKeyMask)) + freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_RELEASE, scancode); if ((modFlags & NSHelpKeyMask) && !(kbdModFlags & NSHelpKeyMask)) - freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_DOWN, - scancode); + freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_DOWN, scancode); else if (!(modFlags & NSHelpKeyMask) && (kbdModFlags & NSHelpKeyMask)) - freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_RELEASE, - scancode); + freerdp_input_send_keyboard_event(instance->input, keyFlags | KBD_FLAGS_RELEASE, scancode); kbdModFlags = modFlags; } -- (void) releaseResources +- (void)releaseResources { int i; @@ -702,7 +685,7 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type) free(pixel_data); } -- (void) drawRect:(NSRect)rect +- (void)drawRect:(NSRect)rect { if (!context) return; @@ -712,10 +695,11 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type) CGContextRef cgContext = [[NSGraphicsContext currentContext] graphicsPort]; CGImageRef cgImage = CGBitmapContextCreateImage(self->bitmap_context); CGContextSaveGState(cgContext); - CGContextClipToRect(cgContext, CGRectMake(rect.origin.x, rect.origin.y, - rect.size.width, rect.size.height)); - CGContextDrawImage(cgContext, CGRectMake(0, - 0, [self bounds].size.width, [self bounds].size.height), cgImage); + CGContextClipToRect( + cgContext, CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height)); + CGContextDrawImage(cgContext, + CGRectMake(0, 0, [self bounds].size.width, [self bounds].size.height), + cgImage); CGContextRestoreGState(cgContext); CGImageRelease(cgImage); } @@ -727,23 +711,23 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type) } } -- (void) onPasteboardTimerFired :(NSTimer*) timer +- (void)onPasteboardTimerFired:(NSTimer *)timer { - const BYTE* data; + const BYTE *data; UINT32 size; UINT32 formatId; BOOL formatMatch; int changeCount; - NSData* formatData; - const char* formatType; - NSPasteboardItem* item; - changeCount = (int) [pasteboard_rd changeCount]; + NSData *formatData; + const char *formatType; + NSPasteboardItem *item; + changeCount = (int)[pasteboard_rd changeCount]; if (changeCount == pasteboard_changecount) return; pasteboard_changecount = changeCount; - NSArray* items = [pasteboard_rd pasteboardItems]; + NSArray *items = [pasteboard_rd pasteboardItems]; if ([items count] < 1) return; @@ -755,7 +739,7 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type) */ formatMatch = FALSE; - for (NSString * type in [item types]) + for (NSString *type in [item types]) { formatType = [type UTF8String]; @@ -763,7 +747,7 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type) { formatData = [item dataForType:type]; formatId = ClipboardRegisterFormat(mfc->clipboard, "UTF8_STRING"); - size = (UINT32) [formatData length]; + size = (UINT32)[formatData length]; data = [formatData bytes]; /* size is the string length without the terminating NULL terminator */ ClipboardSetData(mfc->clipboard, formatId, data, size + 1); @@ -779,15 +763,14 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type) mac_cliprdr_send_client_format_list(mfc->cliprdr); } -- (void) pause +- (void)pause { - dispatch_async(dispatch_get_main_queue(), ^ - { + dispatch_async(dispatch_get_main_queue(), ^{ [self->pasteboard_timer invalidate]; }); - NSArray* trackingAreas = self.trackingAreas; + NSArray *trackingAreas = self.trackingAreas; - for (NSTrackingArea * ta in trackingAreas) + for (NSTrackingArea *ta in trackingAreas) { [self removeTrackingArea:ta]; } @@ -798,20 +781,27 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type) if (!self.is_connected) return; - dispatch_async(dispatch_get_main_queue(), ^ - { - self->pasteboard_timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(onPasteboardTimerFired:) userInfo:nil repeats:YES]; + dispatch_async(dispatch_get_main_queue(), ^{ + self->pasteboard_timer = + [NSTimer scheduledTimerWithTimeInterval:0.5 + target:self + selector:@selector(onPasteboardTimerFired:) + userInfo:nil + repeats:YES]; - NSTrackingArea* trackingArea = [[NSTrackingArea alloc] initWithRect:[self - visibleRect] options:NSTrackingMouseEnteredAndExited | NSTrackingMouseMoved | - NSTrackingCursorUpdate | NSTrackingEnabledDuringMouseDrag | - NSTrackingActiveWhenFirstResponder owner:self userInfo:nil]; + NSTrackingArea *trackingArea = [[NSTrackingArea alloc] + initWithRect:[self visibleRect] + options:NSTrackingMouseEnteredAndExited | NSTrackingMouseMoved | + NSTrackingCursorUpdate | NSTrackingEnabledDuringMouseDrag | + NSTrackingActiveWhenFirstResponder + owner:self + userInfo:nil]; [self addTrackingArea:trackingArea]; [trackingArea release]; }); } -- (void) setScrollOffset:(int)xOffset y:(int)yOffset w:(int)width h:(int)height +- (void)setScrollOffset:(int)xOffset y:(int)yOffset w:(int)width h:(int)height { mfc->yCurrentScroll = yOffset; mfc->xCurrentScroll = xOffset; @@ -819,11 +809,10 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type) mfc->client_width = width; } -void mac_OnChannelConnectedEventHandler(void* context, - ChannelConnectedEventArgs* e) +void mac_OnChannelConnectedEventHandler(void *context, ChannelConnectedEventArgs *e) { - mfContext* mfc = (mfContext*) context; - rdpSettings* settings = mfc->context.settings; + mfContext *mfc = (mfContext *)context; + rdpSettings *settings = mfc->context.settings; if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0) { @@ -831,22 +820,21 @@ void mac_OnChannelConnectedEventHandler(void* context, else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) { if (settings->SoftwareGdi) - gdi_graphics_pipeline_init(mfc->context.gdi, (RdpgfxClientContext*) e->pInterface); + gdi_graphics_pipeline_init(mfc->context.gdi, (RdpgfxClientContext *)e->pInterface); } else if (strcmp(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0) { - mac_cliprdr_init(mfc, (CliprdrClientContext*) e->pInterface); + mac_cliprdr_init(mfc, (CliprdrClientContext *)e->pInterface); } else if (strcmp(e->name, ENCOMSP_SVC_CHANNEL_NAME) == 0) { } } -void mac_OnChannelDisconnectedEventHandler(void* context, - ChannelDisconnectedEventArgs* e) +void mac_OnChannelDisconnectedEventHandler(void *context, ChannelDisconnectedEventArgs *e) { - mfContext* mfc = (mfContext*) context; - rdpSettings* settings = mfc->context.settings; + mfContext *mfc = (mfContext *)context; + rdpSettings *settings = mfc->context.settings; if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0) { @@ -854,21 +842,20 @@ void mac_OnChannelDisconnectedEventHandler(void* context, else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) { if (settings->SoftwareGdi) - gdi_graphics_pipeline_uninit(mfc->context.gdi, - (RdpgfxClientContext*) e->pInterface); + gdi_graphics_pipeline_uninit(mfc->context.gdi, (RdpgfxClientContext *)e->pInterface); } else if (strcmp(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0) { - mac_cliprdr_uninit(mfc, (CliprdrClientContext*) e->pInterface); + mac_cliprdr_uninit(mfc, (CliprdrClientContext *)e->pInterface); } else if (strcmp(e->name, ENCOMSP_SVC_CHANNEL_NAME) == 0) { } } -BOOL mac_pre_connect(freerdp* instance) +BOOL mac_pre_connect(freerdp *instance) { - rdpSettings* settings; + rdpSettings *settings; instance->update->BeginPaint = mac_begin_paint; instance->update->EndPaint = mac_end_paint; instance->update->DesktopResize = mac_desktop_resize; @@ -876,33 +863,30 @@ BOOL mac_pre_connect(freerdp* instance) if (!settings->ServerHostname) { - WLog_ERR(TAG, - "error: server hostname was not specified with /v:[:port]"); + WLog_ERR(TAG, "error: server hostname was not specified with /v:[:port]"); [NSApp terminate:nil]; return -1; } settings->OsMajorType = OSMAJORTYPE_MACINTOSH; settings->OsMinorType = OSMINORTYPE_MACINTOSH; - PubSub_SubscribeChannelConnected(instance->context->pubSub, - mac_OnChannelConnectedEventHandler); + PubSub_SubscribeChannelConnected(instance->context->pubSub, mac_OnChannelConnectedEventHandler); PubSub_SubscribeChannelDisconnected(instance->context->pubSub, mac_OnChannelDisconnectedEventHandler); - if (!freerdp_client_load_addins(instance->context->channels, - instance->settings)) + if (!freerdp_client_load_addins(instance->context->channels, instance->settings)) return FALSE; return TRUE; } -BOOL mac_post_connect(freerdp* instance) +BOOL mac_post_connect(freerdp *instance) { - rdpGdi* gdi; - rdpSettings* settings; + rdpGdi *gdi; + rdpSettings *settings; rdpPointer rdp_pointer; - mfContext* mfc = (mfContext*) instance->context; - MRDPView* view = (MRDPView*) mfc->view; + mfContext *mfc = (mfContext *)instance->context; + MRDPView *view = (MRDPView *)mfc->view; ZeroMemory(&rdp_pointer, sizeof(rdpPointer)); rdp_pointer.size = sizeof(rdpPointer); rdp_pointer.New = mf_Pointer_New; @@ -922,8 +906,7 @@ BOOL mac_post_connect(freerdp* instance) /* setup pasteboard (aka clipboard) for copy operations (write only) */ view->pasteboard_wr = [NSPasteboard generalPasteboard]; /* setup pasteboard for read operations */ - dispatch_async(dispatch_get_main_queue(), ^ - { + dispatch_async(dispatch_get_main_queue(), ^{ view->pasteboard_rd = [NSPasteboard generalPasteboard]; view->pasteboard_changecount = -1; }); @@ -932,56 +915,53 @@ BOOL mac_post_connect(freerdp* instance) return TRUE; } -void mac_post_disconnect(freerdp* instance) +void mac_post_disconnect(freerdp *instance) { - mfContext* mfc; - MRDPView* view; + mfContext *mfc; + MRDPView *view; if (!instance || !instance->context) return; - mfc = (mfContext*) instance->context; - view = (MRDPView*) mfc->view; + mfc = (mfContext *)instance->context; + view = (MRDPView *)mfc->view; [view pause]; - PubSub_UnsubscribeChannelConnected(instance->context->pubSub, mac_OnChannelConnectedEventHandler); + PubSub_UnsubscribeChannelConnected(instance->context->pubSub, + mac_OnChannelConnectedEventHandler); PubSub_UnsubscribeChannelDisconnected(instance->context->pubSub, mac_OnChannelDisconnectedEventHandler); gdi_free(instance); } -static BOOL mac_authenticate_int(NSString* title, freerdp* instance, char** username, - char** password, - char** domain) +static BOOL mac_authenticate_int(NSString *title, freerdp *instance, char **username, + char **password, char **domain) { - mfContext* mfc = (mfContext*) instance->context; - MRDPView* view = (MRDPView*) mfc->view; - PasswordDialog* dialog = [PasswordDialog new]; + mfContext *mfc = (mfContext *)instance->context; + MRDPView *view = (MRDPView *)mfc->view; + PasswordDialog *dialog = [PasswordDialog new]; dialog.serverHostname = title; if (*username) - dialog.username = [NSString stringWithCString:*username encoding: - NSUTF8StringEncoding]; + dialog.username = [NSString stringWithCString:*username encoding:NSUTF8StringEncoding]; if (*password) - dialog.password = [NSString stringWithCString:*password encoding: - NSUTF8StringEncoding]; + dialog.password = [NSString stringWithCString:*password encoding:NSUTF8StringEncoding]; if (*domain) - dialog.domain = [NSString stringWithCString:*domain encoding: - NSUTF8StringEncoding]; + dialog.domain = [NSString stringWithCString:*domain encoding:NSUTF8StringEncoding]; - dispatch_sync(dispatch_get_main_queue(), ^ - { - [dialog performSelectorOnMainThread:@selector(runModal:) withObject:[view window] waitUntilDone:TRUE]; + dispatch_sync(dispatch_get_main_queue(), ^{ + [dialog performSelectorOnMainThread:@selector(runModal:) + withObject:[view window] + waitUntilDone:TRUE]; }); BOOL ok = dialog.modalCode; if (ok) { size_t ulen, plen, dlen; - const char* submittedUsername = [dialog.username cStringUsingEncoding: - NSUTF8StringEncoding]; + const char *submittedUsername = [dialog.username cStringUsingEncoding:NSUTF8StringEncoding]; ulen = (strlen(submittedUsername) + 1) * sizeof(char); *username = malloc(ulen); @@ -989,8 +969,7 @@ static BOOL mac_authenticate_int(NSString* title, freerdp* instance, char** user return FALSE; sprintf_s(*username, ulen, "%s", submittedUsername); - const char* submittedPassword = [dialog.password cStringUsingEncoding: - NSUTF8StringEncoding]; + const char *submittedPassword = [dialog.password cStringUsingEncoding:NSUTF8StringEncoding]; plen = (strlen(submittedPassword) + 1) * sizeof(char); *password = malloc(plen); @@ -998,8 +977,7 @@ static BOOL mac_authenticate_int(NSString* title, freerdp* instance, char** user return FALSE; sprintf_s(*password, plen, "%s", submittedPassword); - const char* submittedDomain = [dialog.domain cStringUsingEncoding: - NSUTF8StringEncoding]; + const char *submittedDomain = [dialog.domain cStringUsingEncoding:NSUTF8StringEncoding]; dlen = (strlen(submittedDomain) + 1) * sizeof(char); *domain = malloc(dlen); @@ -1012,35 +990,34 @@ static BOOL mac_authenticate_int(NSString* title, freerdp* instance, char** user return ok; } -BOOL mac_authenticate(freerdp* instance, char** username, char** password, - char** domain) +BOOL mac_authenticate(freerdp *instance, char **username, char **password, char **domain) { - NSString* title = [NSString stringWithFormat:@"%@:%u", - [NSString stringWithCString:instance->settings->ServerHostname encoding: - NSUTF8StringEncoding], - instance->settings->ServerPort]; + NSString *title = + [NSString stringWithFormat:@"%@:%u", + [NSString stringWithCString:instance->settings->ServerHostname + encoding:NSUTF8StringEncoding], + instance -> settings -> ServerPort]; return mac_authenticate_int(title, instance, username, password, domain); } -BOOL mac_gw_authenticate(freerdp* instance, char** username, char** password, - char** domain) +BOOL mac_gw_authenticate(freerdp *instance, char **username, char **password, char **domain) { - NSString* title = [NSString stringWithFormat:@"%@:%u", - [NSString stringWithCString:instance->settings->GatewayHostname encoding: - NSUTF8StringEncoding], - instance->settings->GatewayPort]; + NSString *title = + [NSString stringWithFormat:@"%@:%u", + [NSString stringWithCString:instance->settings->GatewayHostname + encoding:NSUTF8StringEncoding], + instance -> settings -> GatewayPort]; return mac_authenticate_int(title, instance, username, password, domain); } -DWORD mac_verify_certificate_ex(freerdp* instance, const char* host, UINT16 port, - const char* common_name, const char* subject, - const char* issuer, const char* fingerprint, - DWORD flags) +DWORD mac_verify_certificate_ex(freerdp *instance, const char *host, UINT16 port, + const char *common_name, const char *subject, const char *issuer, + const char *fingerprint, DWORD flags) { - mfContext* mfc = (mfContext*) instance->context; - MRDPView* view = (MRDPView*) mfc->view; - CertificateDialog* dialog = [CertificateDialog new]; - const char* type = "RDP-Server"; + mfContext *mfc = (mfContext *)instance->context; + MRDPView *view = (MRDPView *)mfc->view; + CertificateDialog *dialog = [CertificateDialog new]; + const char *type = "RDP-Server"; char hostname[8192]; if (flags & VERIFY_CERT_FLAG_GATEWAY) @@ -1049,16 +1026,12 @@ DWORD mac_verify_certificate_ex(freerdp* instance, const char* host, UINT16 port if (flags & VERIFY_CERT_FLAG_REDIRECT) type = "RDP-Redirect"; - sprintf_s(hostname, sizeof(hostname), "%s %s:%"PRIu16, type, host, port); + sprintf_s(hostname, sizeof(hostname), "%s %s:%" PRIu16, type, host, port); dialog.serverHostname = [NSString stringWithCString:hostname]; - dialog.commonName = [NSString stringWithCString:common_name encoding: - NSUTF8StringEncoding]; - dialog.subject = [NSString stringWithCString:subject encoding: - NSUTF8StringEncoding]; - dialog.issuer = [NSString stringWithCString:issuer encoding: - NSUTF8StringEncoding]; - dialog.fingerprint = [NSString stringWithCString:fingerprint encoding: - NSUTF8StringEncoding]; + dialog.commonName = [NSString stringWithCString:common_name encoding:NSUTF8StringEncoding]; + dialog.subject = [NSString stringWithCString:subject encoding:NSUTF8StringEncoding]; + dialog.issuer = [NSString stringWithCString:issuer encoding:NSUTF8StringEncoding]; + dialog.fingerprint = [NSString stringWithCString:fingerprint encoding:NSUTF8StringEncoding]; if (flags & VERIFY_CERT_FLAG_MISMATCH) dialog.hostMismatch = TRUE; @@ -1066,21 +1039,22 @@ DWORD mac_verify_certificate_ex(freerdp* instance, const char* host, UINT16 port if (flags & VERIFY_CERT_FLAG_CHANGED) dialog.changed = TRUE; - [dialog performSelectorOnMainThread:@selector(runModal:) withObject:[view - window] waitUntilDone:TRUE]; + [dialog performSelectorOnMainThread:@selector(runModal:) + withObject:[view window] + waitUntilDone:TRUE]; return dialog.result; } -DWORD mac_verify_changed_certificate_ex(freerdp* instance, const char* host, UINT16 port, - const char* common_name, const char* subject, - const char* issuer, const char* fingerprint, - const char* old_subject, const char* old_issuer, - const char* old_fingerprint, DWORD flags) +DWORD mac_verify_changed_certificate_ex(freerdp *instance, const char *host, UINT16 port, + const char *common_name, const char *subject, + const char *issuer, const char *fingerprint, + const char *old_subject, const char *old_issuer, + const char *old_fingerprint, DWORD flags) { - mfContext* mfc = (mfContext*) instance->context; - MRDPView* view = (MRDPView*) mfc->view; - CertificateDialog* dialog = [CertificateDialog new]; - const char* type = "RDP-Server"; + mfContext *mfc = (mfContext *)instance->context; + MRDPView *view = (MRDPView *)mfc->view; + CertificateDialog *dialog = [CertificateDialog new]; + const char *type = "RDP-Server"; char hostname[8192]; if (flags & VERIFY_CERT_FLAG_GATEWAY) @@ -1089,16 +1063,12 @@ DWORD mac_verify_changed_certificate_ex(freerdp* instance, const char* host, UIN if (flags & VERIFY_CERT_FLAG_REDIRECT) type = "RDP-Redirect"; - sprintf_s(hostname, sizeof(hostname), "%s %s:%"PRIu16, type, host, port); + sprintf_s(hostname, sizeof(hostname), "%s %s:%" PRIu16, type, host, port); dialog.serverHostname = [NSString stringWithCString:hostname]; - dialog.commonName = [NSString stringWithCString:common_name encoding: - NSUTF8StringEncoding]; - dialog.subject = [NSString stringWithCString:subject encoding: - NSUTF8StringEncoding]; - dialog.issuer = [NSString stringWithCString:issuer encoding: - NSUTF8StringEncoding]; - dialog.fingerprint = [NSString stringWithCString:fingerprint encoding: - NSUTF8StringEncoding]; + dialog.commonName = [NSString stringWithCString:common_name encoding:NSUTF8StringEncoding]; + dialog.subject = [NSString stringWithCString:subject encoding:NSUTF8StringEncoding]; + dialog.issuer = [NSString stringWithCString:issuer encoding:NSUTF8StringEncoding]; + dialog.fingerprint = [NSString stringWithCString:fingerprint encoding:NSUTF8StringEncoding]; if (flags & VERIFY_CERT_FLAG_MISMATCH) dialog.hostMismatch = TRUE; @@ -1106,39 +1076,40 @@ DWORD mac_verify_changed_certificate_ex(freerdp* instance, const char* host, UIN if (flags & VERIFY_CERT_FLAG_CHANGED) dialog.changed = TRUE; - [dialog performSelectorOnMainThread:@selector(runModal:) withObject:[view - window] waitUntilDone:TRUE]; + [dialog performSelectorOnMainThread:@selector(runModal:) + withObject:[view window] + waitUntilDone:TRUE]; return dialog.result; } -int mac_logon_error_info(freerdp* instance, UINT32 data, UINT32 type) +int mac_logon_error_info(freerdp *instance, UINT32 data, UINT32 type) { - const char* str_data = freerdp_get_logon_error_info_data(data); - const char* str_type = freerdp_get_logon_error_info_type(type); + const char *str_data = freerdp_get_logon_error_info_data(data); + const char *str_type = freerdp_get_logon_error_info_type(type); // TODO: Error message dialog WLog_INFO(TAG, "Logon Error Info %s [%s]", str_data, str_type); return 1; } -BOOL mf_Pointer_New(rdpContext* context, rdpPointer* pointer) +BOOL mf_Pointer_New(rdpContext *context, rdpPointer *pointer) { - rdpGdi* gdi; + rdpGdi *gdi; NSRect rect; - NSImage* image; + NSImage *image; NSPoint hotSpot; - NSCursor* cursor; - BYTE* cursor_data; - NSMutableArray* ma; - NSBitmapImageRep* bmiRep; - MRDPCursor* mrdpCursor = [[MRDPCursor alloc] init]; - mfContext* mfc = (mfContext*) context; - MRDPView* view; + NSCursor *cursor; + BYTE *cursor_data; + NSMutableArray *ma; + NSBitmapImageRep *bmiRep; + MRDPCursor *mrdpCursor = [[MRDPCursor alloc] init]; + mfContext *mfc = (mfContext *)context; + MRDPView *view; UINT32 format; if (!mfc || !context || !pointer) return FALSE; - view = (MRDPView*) mfc->view; + view = (MRDPView *)mfc->view; gdi = context->gdi; if (!gdi || !view) @@ -1148,7 +1119,7 @@ BOOL mf_Pointer_New(rdpContext* context, rdpPointer* pointer) rect.size.height = pointer->height; rect.origin.x = pointer->xPos; rect.origin.y = pointer->yPos; - cursor_data = (BYTE*) malloc(rect.size.width * rect.size.height * 4); + cursor_data = (BYTE *)malloc(rect.size.width * rect.size.height * 4); if (!cursor_data) return FALSE; @@ -1156,12 +1127,10 @@ BOOL mf_Pointer_New(rdpContext* context, rdpPointer* pointer) mrdpCursor->cursor_data = cursor_data; format = PIXEL_FORMAT_RGBA32; - if (!freerdp_image_copy_from_pointer_data( - cursor_data, format, - 0, 0, 0, pointer->width, pointer->height, - pointer->xorMaskData, pointer->lengthXorMask, - pointer->andMaskData, pointer->lengthAndMask, - pointer->xorBpp, NULL)) + if (!freerdp_image_copy_from_pointer_data(cursor_data, format, 0, 0, 0, pointer->width, + pointer->height, pointer->xorMaskData, + pointer->lengthXorMask, pointer->andMaskData, + pointer->lengthAndMask, pointer->xorBpp, NULL)) { free(cursor_data); mrdpCursor->cursor_data = NULL; @@ -1169,28 +1138,28 @@ BOOL mf_Pointer_New(rdpContext* context, rdpPointer* pointer) } /* store cursor bitmap image in representation - required by NSImage */ - bmiRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: - (unsigned char**) &cursor_data - pixelsWide:rect.size.width - pixelsHigh:rect.size.height - bitsPerSample:8 - samplesPerPixel:4 - hasAlpha:YES - isPlanar:NO - colorSpaceName:NSDeviceRGBColorSpace - bitmapFormat:0 - bytesPerRow:rect.size.width * GetBytesPerPixel(format) - bitsPerPixel:0]; + bmiRep = [[NSBitmapImageRep alloc] + initWithBitmapDataPlanes:(unsigned char **)&cursor_data + pixelsWide:rect.size.width + pixelsHigh:rect.size.height + bitsPerSample:8 + samplesPerPixel:4 + hasAlpha:YES + isPlanar:NO + colorSpaceName:NSDeviceRGBColorSpace + bitmapFormat:0 + bytesPerRow:rect.size.width * GetBytesPerPixel(format) + bitsPerPixel:0]; mrdpCursor->bmiRep = bmiRep; /* create an image using above representation */ image = [[NSImage alloc] initWithSize:[bmiRep size]]; - [image addRepresentation: bmiRep]; + [image addRepresentation:bmiRep]; [image setFlipped:NO]; mrdpCursor->nsImage = image; /* need hotspot to create cursor */ hotSpot.x = pointer->xPos; hotSpot.y = pointer->yPos; - cursor = [[NSCursor alloc] initWithImage: image hotSpot:hotSpot]; + cursor = [[NSCursor alloc] initWithImage:image hotSpot:hotSpot]; mrdpCursor->nsCursor = cursor; mrdpCursor->pointer = pointer; /* save cursor for later use in mf_Pointer_Set() */ @@ -1199,13 +1168,13 @@ BOOL mf_Pointer_New(rdpContext* context, rdpPointer* pointer) return TRUE; } -void mf_Pointer_Free(rdpContext* context, rdpPointer* pointer) +void mf_Pointer_Free(rdpContext *context, rdpPointer *pointer) { - mfContext* mfc = (mfContext*) context; - MRDPView* view = (MRDPView*) mfc->view; - NSMutableArray* ma = view->cursors; + mfContext *mfc = (mfContext *)context; + MRDPView *view = (MRDPView *)mfc->view; + NSMutableArray *ma = view->cursors; - for (MRDPCursor * cursor in ma) + for (MRDPCursor *cursor in ma) { if (cursor->pointer == pointer) { @@ -1219,13 +1188,13 @@ void mf_Pointer_Free(rdpContext* context, rdpPointer* pointer) } } -BOOL mf_Pointer_Set(rdpContext* context, const rdpPointer* pointer) +BOOL mf_Pointer_Set(rdpContext *context, const rdpPointer *pointer) { - mfContext* mfc = (mfContext*) context; - MRDPView* view = (MRDPView*) mfc->view; - NSMutableArray* ma = view->cursors; + mfContext *mfc = (mfContext *)context; + MRDPView *view = (MRDPView *)mfc->view; + NSMutableArray *ma = view->cursors; - for (MRDPCursor * cursor in ma) + for (MRDPCursor *cursor in ma) { if (cursor->pointer == pointer) { @@ -1238,22 +1207,22 @@ BOOL mf_Pointer_Set(rdpContext* context, const rdpPointer* pointer) return TRUE; } -BOOL mf_Pointer_SetNull(rdpContext* context) +BOOL mf_Pointer_SetNull(rdpContext *context) { return TRUE; } -BOOL mf_Pointer_SetDefault(rdpContext* context) +BOOL mf_Pointer_SetDefault(rdpContext *context) { - mfContext* mfc = (mfContext*) context; - MRDPView* view = (MRDPView*) mfc->view; + mfContext *mfc = (mfContext *)context; + MRDPView *view = (MRDPView *)mfc->view; [view setCursor:[NSCursor arrowCursor]]; return TRUE; } -static BOOL mf_Pointer_SetPosition(rdpContext* context, UINT32 x, UINT32 y) +static BOOL mf_Pointer_SetPosition(rdpContext *context, UINT32 x, UINT32 y) { - mfContext* mfc = (mfContext*) context; + mfContext *mfc = (mfContext *)context; if (!mfc) return FALSE; @@ -1262,33 +1231,33 @@ static BOOL mf_Pointer_SetPosition(rdpContext* context, UINT32 x, UINT32 y) return TRUE; } -CGContextRef mac_create_bitmap_context(rdpContext* context) +CGContextRef mac_create_bitmap_context(rdpContext *context) { CGContextRef bitmap_context; - rdpGdi* gdi = context->gdi; + rdpGdi *gdi = context->gdi; UINT32 bpp = GetBytesPerPixel(gdi->dstFormat); CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); if (bpp == 2) { - bitmap_context = CGBitmapContextCreate(gdi->primary_buffer, - gdi->width, gdi->height, 5, gdi->stride, - colorSpace, kCGBitmapByteOrder16Little | kCGImageAlphaNoneSkipFirst); + bitmap_context = CGBitmapContextCreate( + gdi->primary_buffer, gdi->width, gdi->height, 5, gdi->stride, colorSpace, + kCGBitmapByteOrder16Little | kCGImageAlphaNoneSkipFirst); } else { - bitmap_context = CGBitmapContextCreate(gdi->primary_buffer, - gdi->width, gdi->height, 8, gdi->stride, - colorSpace, kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst); + bitmap_context = CGBitmapContextCreate( + gdi->primary_buffer, gdi->width, gdi->height, 8, gdi->stride, colorSpace, + kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst); } CGColorSpaceRelease(colorSpace); return bitmap_context; } -BOOL mac_begin_paint(rdpContext* context) +BOOL mac_begin_paint(rdpContext *context) { - rdpGdi* gdi = context->gdi; + rdpGdi *gdi = context->gdi; if (!gdi) return FALSE; @@ -1297,14 +1266,14 @@ BOOL mac_begin_paint(rdpContext* context) return TRUE; } -BOOL mac_end_paint(rdpContext* context) +BOOL mac_end_paint(rdpContext *context) { - rdpGdi* gdi; + rdpGdi *gdi; HGDI_RGN invalid; NSRect newDrawRect; int ww, wh, dw, dh; - mfContext* mfc = (mfContext*) context; - MRDPView* view = (MRDPView*) mfc->view; + mfContext *mfc = (mfContext *)context; + MRDPView *view = (MRDPView *)mfc->view; gdi = context->gdi; if (!gdi) @@ -1343,20 +1312,19 @@ BOOL mac_end_paint(rdpContext* context) } windows_to_apple_cords(mfc->view, &newDrawRect); - dispatch_sync(dispatch_get_main_queue(), ^ - { + dispatch_sync(dispatch_get_main_queue(), ^{ [view setNeedsDisplayInRect:newDrawRect]; }); gdi->primary->hdc->hwnd->ninvalid = 0; return TRUE; } -BOOL mac_desktop_resize(rdpContext* context) +BOOL mac_desktop_resize(rdpContext *context) { ResizeWindowEventArgs e; - mfContext* mfc = (mfContext*) context; - MRDPView* view = (MRDPView*) mfc->view; - rdpSettings* settings = context->settings; + mfContext *mfc = (mfContext *)context; + MRDPView *view = (MRDPView *)mfc->view; + rdpSettings *settings = context->settings; if (!context->gdi) return TRUE; @@ -1390,11 +1358,11 @@ BOOL mac_desktop_resize(rdpContext* context) return TRUE; } -void input_activity_cb(freerdp* instance) +void input_activity_cb(freerdp *instance) { int status; wMessage message; - wMessageQueue* queue; + wMessageQueue *queue; status = 1; queue = freerdp_get_message_queue(instance, FREERDP_INPUT_MESSAGE_QUEUE); @@ -1402,8 +1370,8 @@ void input_activity_cb(freerdp* instance) { while (MessageQueue_Peek(queue, &message, TRUE)) { - status = freerdp_message_queue_process_message(instance, - FREERDP_INPUT_MESSAGE_QUEUE, &message); + status = freerdp_message_queue_process_message(instance, FREERDP_INPUT_MESSAGE_QUEUE, + &message); if (!status) break; @@ -1411,7 +1379,7 @@ void input_activity_cb(freerdp* instance) } else { - WLog_ERR(TAG, "input_activity_cb: No queue!"); + WLog_ERR(TAG, "input_activity_cb: No queue!"); } } @@ -1423,17 +1391,16 @@ void input_activity_cb(freerdp* instance) * */ -void windows_to_apple_cords(MRDPView* view, NSRect* r) +void windows_to_apple_cords(MRDPView *view, NSRect *r) { - dispatch_sync(dispatch_get_main_queue(), ^ - { + dispatch_sync(dispatch_get_main_queue(), ^{ r->origin.y = [view frame].size.height - (r->origin.y + r->size.height); }); } -void sync_keyboard_state(freerdp* instance) +void sync_keyboard_state(freerdp *instance) { - mfContext* context = (mfContext*)instance->context; + mfContext *context = (mfContext *)instance->context; UINT32 flags = 0; CGEventFlags currentFlags = CGEventSourceFlagsState(kCGEventSourceStateHIDSystemState); diff --git a/client/Mac/PasswordDialog.h b/client/Mac/PasswordDialog.h index 833336e2f..eb24c5c45 100644 --- a/client/Mac/PasswordDialog.h +++ b/client/Mac/PasswordDialog.h @@ -21,29 +21,29 @@ @interface PasswordDialog : NSWindowController { -@public - NSTextField* usernameText; - NSTextField* passwordText; - NSTextField* messageLabel; - NSString* serverHostname; - NSString* username; - NSString* password; - NSString* domain; + @public + NSTextField *usernameText; + NSTextField *passwordText; + NSTextField *messageLabel; + NSString *serverHostname; + NSString *username; + NSString *password; + NSString *domain; BOOL modalCode; } -@property(retain) IBOutlet NSTextField* usernameText; -@property(retain) IBOutlet NSTextField* passwordText; -@property(retain) IBOutlet NSTextField* messageLabel; +@property(retain) IBOutlet NSTextField *usernameText; +@property(retain) IBOutlet NSTextField *passwordText; +@property(retain) IBOutlet NSTextField *messageLabel; -- (IBAction)onOK:(NSObject*)sender; -- (IBAction)onCancel:(NSObject*)sender; +- (IBAction)onOK:(NSObject *)sender; +- (IBAction)onCancel:(NSObject *)sender; -@property(retain) NSString* serverHostname; -@property(retain) NSString* username; -@property(retain) NSString* password; -@property(retain) NSString* domain; +@property(retain) NSString *serverHostname; +@property(retain) NSString *username; +@property(retain) NSString *password; +@property(retain) NSString *domain; @property(readonly) BOOL modalCode; -- (BOOL) runModal:(NSWindow*)mainWindow; +- (BOOL)runModal:(NSWindow *)mainWindow; @end diff --git a/client/Mac/PasswordDialog.m b/client/Mac/PasswordDialog.m index 2eecea4b2..f4c520bec 100644 --- a/client/Mac/PasswordDialog.m +++ b/client/Mac/PasswordDialog.m @@ -22,9 +22,9 @@ #import -@interface PasswordDialog() +@interface PasswordDialog () - @property BOOL modalCode; +@property BOOL modalCode; @end @@ -47,15 +47,16 @@ - (void)windowDidLoad { [super windowDidLoad]; - // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. + // Implement this method to handle any initialization after your window controller's window has + // been loaded from its nib file. [self.window setTitle:self.serverHostname]; - [self.messageLabel setStringValue:[NSString stringWithFormat:@"Authenticate to %@", - self.serverHostname]]; - NSMutableString* domainUser = [[NSMutableString alloc] initWithString:@""]; + [self.messageLabel + setStringValue:[NSString stringWithFormat:@"Authenticate to %@", self.serverHostname]]; + NSMutableString *domainUser = [[NSMutableString alloc] initWithString:@""]; - if (self.domain != nil - && [[self.domain stringByTrimmingCharactersInSet:[NSCharacterSet - whitespaceCharacterSet]] length] > 0) + if (self.domain != nil && + [[self.domain stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] + length] > 0) { [domainUser appendFormat:@"%@\\", self.domain]; } @@ -69,18 +70,17 @@ [self.usernameText setStringValue:domainUser]; } -- (IBAction)onOK:(NSObject*)sender +- (IBAction)onOK:(NSObject *)sender { - char* submittedUser = NULL; - char* submittedDomain = NULL; + char *submittedUser = NULL; + char *submittedDomain = NULL; - if (freerdp_parse_username([self.usernameText.stringValue cStringUsingEncoding: - NSUTF8StringEncoding], &submittedUser, &submittedDomain)) + if (freerdp_parse_username( + [self.usernameText.stringValue cStringUsingEncoding:NSUTF8StringEncoding], + &submittedUser, &submittedDomain)) { - self.username = [NSString stringWithCString: submittedUser encoding: - NSUTF8StringEncoding]; - self.domain = [NSString stringWithCString: submittedDomain encoding: - NSUTF8StringEncoding]; + self.username = [NSString stringWithCString:submittedUser encoding:NSUTF8StringEncoding]; + self.domain = [NSString stringWithCString:submittedDomain encoding:NSUTF8StringEncoding]; } else { @@ -91,28 +91,28 @@ [NSApp stopModalWithCode:TRUE]; } -- (IBAction)onCancel:(NSObject*)sender +- (IBAction)onCancel:(NSObject *)sender { [NSApp stopModalWithCode:FALSE]; } -- (BOOL)runModal:(NSWindow*)mainWindow +- (BOOL)runModal:(NSWindow *)mainWindow { if ([mainWindow respondsToSelector:@selector(beginSheet:completionHandler:)]) { [mainWindow beginSheet:self.window completionHandler:nil]; - self.modalCode = [NSApp runModalForWindow: self.window]; - [mainWindow endSheet: self.window]; + self.modalCode = [NSApp runModalForWindow:self.window]; + [mainWindow endSheet:self.window]; } else { - [NSApp beginSheet: self.window - modalForWindow: mainWindow - modalDelegate: nil - didEndSelector: nil - contextInfo: nil]; - self.modalCode = [NSApp runModalForWindow: self.window]; - [NSApp endSheet: self.window]; + [NSApp beginSheet:self.window + modalForWindow:mainWindow + modalDelegate:nil + didEndSelector:nil + contextInfo:nil]; + self.modalCode = [NSApp runModalForWindow:self.window]; + [NSApp endSheet:self.window]; } [self.window orderOut:nil]; diff --git a/client/Mac/cli/AppDelegate.h b/client/Mac/cli/AppDelegate.h index 91439c06f..64b261149 100644 --- a/client/Mac/cli/AppDelegate.h +++ b/client/Mac/cli/AppDelegate.h @@ -12,15 +12,15 @@ @interface AppDelegate : NSObject { -@public - NSWindow* window; - rdpContext* context; - MRDPView* mrdpView; + @public + NSWindow *window; + rdpContext *context; + MRDPView *mrdpView; } -- (void) rdpConnectError: (NSString*) customMessage; +- (void)rdpConnectError:(NSString *)customMessage; -@property (assign) IBOutlet NSWindow *window; -@property (assign) rdpContext *context; +@property(assign) IBOutlet NSWindow *window; +@property(assign) rdpContext *context; @end diff --git a/client/Mac/cli/AppDelegate.m b/client/Mac/cli/AppDelegate.m index 646f7b56d..d916e710c 100644 --- a/client/Mac/cli/AppDelegate.m +++ b/client/Mac/cli/AppDelegate.m @@ -12,15 +12,12 @@ #import "MacFreeRDP/MRDPView.h" #import -static AppDelegate* _singleDelegate = nil; -void AppDelegate_ConnectionResultEventHandler(void* context, - ConnectionResultEventArgs* e); -void AppDelegate_ErrorInfoEventHandler(void* ctx, ErrorInfoEventArgs* e); -void AppDelegate_EmbedWindowEventHandler(void* context, - EmbedWindowEventArgs* e); -void AppDelegate_ResizeWindowEventHandler(void* context, - ResizeWindowEventArgs* e); -void mac_set_view_size(rdpContext* context, MRDPView* view); +static AppDelegate *_singleDelegate = nil; +void AppDelegate_ConnectionResultEventHandler(void *context, ConnectionResultEventArgs *e); +void AppDelegate_ErrorInfoEventHandler(void *ctx, ErrorInfoEventArgs *e); +void AppDelegate_EmbedWindowEventHandler(void *context, EmbedWindowEventArgs *e); +void AppDelegate_ResizeWindowEventHandler(void *context, ResizeWindowEventArgs *e); +void mac_set_view_size(rdpContext *context, MRDPView *view); @implementation AppDelegate @@ -31,68 +28,64 @@ void mac_set_view_size(rdpContext* context, MRDPView* view); @synthesize window = window; - @synthesize context = context; -- (void) applicationDidFinishLaunching:(NSNotification*)aNotification +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { int status; - mfContext* mfc; + mfContext *mfc; _singleDelegate = self; [self CreateContext]; status = [self ParseCommandLineArguments]; - mfc = (mfContext*) context; - mfc->view = (void*) mrdpView; + mfc = (mfContext *)context; + mfc->view = (void *)mrdpView; if (status == 0) { - NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; + NSScreen *screen = [[NSScreen screens] objectAtIndex:0]; NSRect screenFrame = [screen frame]; if (context->instance->settings->Fullscreen) { - context->instance->settings->DesktopWidth = screenFrame.size.width; + context->instance->settings->DesktopWidth = screenFrame.size.width; context->instance->settings->DesktopHeight = screenFrame.size.height; } - PubSub_SubscribeConnectionResult(context->pubSub, - AppDelegate_ConnectionResultEventHandler); + PubSub_SubscribeConnectionResult(context->pubSub, AppDelegate_ConnectionResultEventHandler); PubSub_SubscribeErrorInfo(context->pubSub, AppDelegate_ErrorInfoEventHandler); - PubSub_SubscribeEmbedWindow(context->pubSub, - AppDelegate_EmbedWindowEventHandler); - PubSub_SubscribeResizeWindow(context->pubSub, - AppDelegate_ResizeWindowEventHandler); + PubSub_SubscribeEmbedWindow(context->pubSub, AppDelegate_EmbedWindowEventHandler); + PubSub_SubscribeResizeWindow(context->pubSub, AppDelegate_ResizeWindowEventHandler); freerdp_client_start(context); - NSString* winTitle; + NSString *winTitle; if (mfc->context.settings->WindowTitle && mfc->context.settings->WindowTitle[0]) { - winTitle = [[NSString alloc] initWithCString: - mfc->context.settings->WindowTitle]; + winTitle = [[NSString alloc] initWithCString:mfc->context.settings->WindowTitle]; } else { - winTitle = [[NSString alloc] initWithFormat:@"%@:%u", - [NSString stringWithCString:mfc->context.settings->ServerHostname encoding: - NSUTF8StringEncoding], - mfc->context.settings->ServerPort]; + winTitle = [[NSString alloc] + initWithFormat:@"%@:%u", + [NSString stringWithCString:mfc->context.settings->ServerHostname + encoding:NSUTF8StringEncoding], + mfc -> context.settings->ServerPort]; } [window setTitle:winTitle]; } } -- (void) applicationWillBecomeActive:(NSNotification*)notification +- (void)applicationWillBecomeActive:(NSNotification *)notification { [mrdpView resume]; } -- (void) applicationWillResignActive:(NSNotification*)notification +- (void)applicationWillResignActive:(NSNotification *)notification { [mrdpView pause]; } -- (void) applicationWillTerminate:(NSNotification*)notification +- (void)applicationWillTerminate:(NSNotification *)notification { NSLog(@"Stopping...\n"); freerdp_client_stop(context); @@ -101,23 +94,23 @@ void mac_set_view_size(rdpContext* context, MRDPView* view); NSLog(@"Stopped.\n"); } -- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)sender +- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender { return YES; } -- (int) ParseCommandLineArguments +- (int)ParseCommandLineArguments { int i; int length; int status; - char* cptr; - NSArray* args = [[NSProcessInfo processInfo] arguments]; - context->argc = (int) [args count]; - context->argv = malloc(sizeof(char*) * context->argc); + char *cptr; + NSArray *args = [[NSProcessInfo processInfo] arguments]; + context->argc = (int)[args count]; + context->argv = malloc(sizeof(char *) * context->argc); i = 0; - for (NSString * str in args) + for (NSString *str in args) { /* filter out some arguments added by XCode */ if ([str isEqualToString:@"YES"]) @@ -127,20 +120,20 @@ void mac_set_view_size(rdpContext* context, MRDPView* view); continue; length = (int)([str length] + 1); - cptr = (char*) malloc(length); + cptr = (char *)malloc(length); sprintf_s(cptr, length, "%s", [str UTF8String]); context->argv[i++] = cptr; } context->argc = i; - status = freerdp_client_settings_parse_command_line(context->settings, - context->argc, context->argv, FALSE); - status = freerdp_client_settings_command_line_status_print(context->settings, - status, context->argc, context->argv); + status = freerdp_client_settings_parse_command_line(context->settings, context->argc, + context->argv, FALSE); + status = freerdp_client_settings_command_line_status_print(context->settings, status, + context->argc, context->argv); return status; } -- (void) CreateContext +- (void)CreateContext { RDP_CLIENT_ENTRY_POINTS clientEntryPoints; ZeroMemory(&clientEntryPoints, sizeof(RDP_CLIENT_ENTRY_POINTS)); @@ -150,12 +143,12 @@ void mac_set_view_size(rdpContext* context, MRDPView* view); context = freerdp_client_context_new(&clientEntryPoints); } -- (void) ReleaseContext +- (void)ReleaseContext { - mfContext* mfc; - MRDPView* view; - mfc = (mfContext*) context; - view = (MRDPView*) mfc->view; + mfContext *mfc; + MRDPView *view; + mfc = (mfContext *)context; + view = (MRDPView *)mfc->view; [view exitFullScreenModeWithOptions:nil]; [view releaseResources]; [view release]; @@ -164,46 +157,42 @@ void mac_set_view_size(rdpContext* context, MRDPView* view); context = nil; } - /** ********************************************************************* * called when we fail to connect to a RDP server - Make sure this is called from the main thread. ***********************************************************************/ -- (void) rdpConnectError : (NSString*) withMessage +- (void)rdpConnectError:(NSString *)withMessage { - mfContext* mfc; - MRDPView* view; - mfc = (mfContext*) context; - view = (MRDPView*) mfc->view; + mfContext *mfc; + MRDPView *view; + mfc = (mfContext *)context; + view = (MRDPView *)mfc->view; [view exitFullScreenModeWithOptions:nil]; - NSString* message = withMessage ? withMessage : @"Error connecting to server"; - NSAlert* alert = [[NSAlert alloc] init]; + NSString *message = withMessage ? withMessage : @"Error connecting to server"; + NSAlert *alert = [[NSAlert alloc] init]; [alert setMessageText:message]; [alert beginSheetModalForWindow:[self window] - modalDelegate:self - didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) - contextInfo:nil]; + modalDelegate:self + didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) + contextInfo:nil]; } - /** ********************************************************************* * just a terminate selector for above call ***********************************************************************/ -- (void) alertDidEnd:(NSAlert*)a returnCode:(NSInteger)rc contextInfo:(void*)ci +- (void)alertDidEnd:(NSAlert *)a returnCode:(NSInteger)rc contextInfo:(void *)ci { [NSApp terminate:nil]; } - @end /** ********************************************************************* * On connection error, display message and quit application ***********************************************************************/ -void AppDelegate_ConnectionResultEventHandler(void* ctx, - ConnectionResultEventArgs* e) +void AppDelegate_ConnectionResultEventHandler(void *ctx, ConnectionResultEventArgs *e) { NSLog(@"ConnectionResult event result:%d\n", e->result); @@ -211,50 +200,52 @@ void AppDelegate_ConnectionResultEventHandler(void* ctx, { if (e->result != 0) { - NSString* message = nil; + NSString *message = nil; if (connectErrorCode == AUTHENTICATIONERROR) { - message = [NSString stringWithFormat:@"%@", - @"Authentication failure, check credentials."]; + message = [NSString + stringWithFormat:@"%@", @"Authentication failure, check credentials."]; } // Making sure this should be invoked on the main UI thread. [_singleDelegate performSelectorOnMainThread:@selector(rdpConnectError:) - withObject:message waitUntilDone:FALSE]; + withObject:message + waitUntilDone:FALSE]; } } } -void AppDelegate_ErrorInfoEventHandler(void* ctx, ErrorInfoEventArgs* e) +void AppDelegate_ErrorInfoEventHandler(void *ctx, ErrorInfoEventArgs *e) { NSLog(@"ErrorInfo event code:%d\n", e->code); if (_singleDelegate) { // Retrieve error message associated with error code - NSString* message = nil; + NSString *message = nil; if (e->code != ERRINFO_NONE) { - const char* errorMessage = freerdp_get_error_info_string(e->code); + const char *errorMessage = freerdp_get_error_info_string(e->code); message = [[NSString alloc] initWithUTF8String:errorMessage]; } // Making sure this should be invoked on the main UI thread. [_singleDelegate performSelectorOnMainThread:@selector(rdpConnectError:) - withObject:message waitUntilDone:TRUE]; + withObject:message + waitUntilDone:TRUE]; [message release]; } } -void AppDelegate_EmbedWindowEventHandler(void* ctx, EmbedWindowEventArgs* e) +void AppDelegate_EmbedWindowEventHandler(void *ctx, EmbedWindowEventArgs *e) { - rdpContext* context = (rdpContext*) ctx; + rdpContext *context = (rdpContext *)ctx; if (_singleDelegate) { - mfContext* mfc = (mfContext*) context; + mfContext *mfc = (mfContext *)context; _singleDelegate->mrdpView = mfc->view; if (_singleDelegate->window) @@ -268,21 +259,21 @@ void AppDelegate_EmbedWindowEventHandler(void* ctx, EmbedWindowEventArgs* e) } } -void AppDelegate_ResizeWindowEventHandler(void* ctx, ResizeWindowEventArgs* e) +void AppDelegate_ResizeWindowEventHandler(void *ctx, ResizeWindowEventArgs *e) { - rdpContext* context = (rdpContext*) ctx; + rdpContext *context = (rdpContext *)ctx; fprintf(stderr, "ResizeWindowEventHandler: %d %d\n", e->width, e->height); if (_singleDelegate) { - mfContext* mfc = (mfContext*) context; + mfContext *mfc = (mfContext *)context; dispatch_async(dispatch_get_main_queue(), ^{ mac_set_view_size(context, mfc->view); }); } } -void mac_set_view_size(rdpContext* context, MRDPView* view) +void mac_set_view_size(rdpContext *context, MRDPView *view) { // set client area to specified dimensions NSRect innerRect; diff --git a/client/Mac/mf_client.h b/client/Mac/mf_client.h index 4d8b2fa53..c3b3c85fc 100644 --- a/client/Mac/mf_client.h +++ b/client/Mac/mf_client.h @@ -25,21 +25,22 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API void mf_press_mouse_button(void* context, rdpInput* intput, int button, int x, int y, - BOOL down); -FREERDP_API void mf_scale_mouse_event(void* context, rdpInput* input, UINT16 flags, UINT16 x, - UINT16 y); -FREERDP_API void mf_scale_mouse_event_ex(void* context, rdpInput* input, UINT16 flags, UINT16 x, - UINT16 y); + FREERDP_API void mf_press_mouse_button(void* context, rdpInput* intput, int button, int x, + int y, BOOL down); + FREERDP_API void mf_scale_mouse_event(void* context, rdpInput* input, UINT16 flags, UINT16 x, + UINT16 y); + FREERDP_API void mf_scale_mouse_event_ex(void* context, rdpInput* input, UINT16 flags, UINT16 x, + UINT16 y); -/** - * Client Interface - */ + /** + * Client Interface + */ -FREERDP_API int RdpClientEntry(RDP_CLIENT_ENTRY_POINTS* pEntryPoints); + FREERDP_API int RdpClientEntry(RDP_CLIENT_ENTRY_POINTS* pEntryPoints); #ifdef __cplusplus } diff --git a/client/Mac/mf_client.m b/client/Mac/mf_client.m index 54c646654..10fb1b40a 100644 --- a/client/Mac/mf_client.m +++ b/client/Mac/mf_client.m @@ -40,26 +40,27 @@ static void mfreerdp_client_global_uninit(void) { } -static int mfreerdp_client_start(rdpContext* context) +static int mfreerdp_client_start(rdpContext *context) { - MRDPView* view; - mfContext* mfc = (mfContext*) context; + MRDPView *view; + mfContext *mfc = (mfContext *)context; if (mfc->view == NULL) { // view not specified beforehand. Create view dynamically - mfc->view = [[MRDPView alloc] initWithFrame : NSMakeRect(0, 0, - context->settings->DesktopWidth, context->settings->DesktopHeight)]; + mfc->view = + [[MRDPView alloc] initWithFrame:NSMakeRect(0, 0, context->settings->DesktopWidth, + context->settings->DesktopHeight)]; mfc->view_ownership = TRUE; } - view = (MRDPView*) mfc->view; + view = (MRDPView *)mfc->view; return [view rdpStart:context]; } -static int mfreerdp_client_stop(rdpContext* context) +static int mfreerdp_client_stop(rdpContext *context) { - mfContext* mfc = (mfContext*) context; + mfContext *mfc = (mfContext *)context; if (mfc->thread) { @@ -71,7 +72,7 @@ static int mfreerdp_client_stop(rdpContext* context) if (mfc->view_ownership) { - MRDPView* view = (MRDPView*) mfc->view; + MRDPView *view = (MRDPView *)mfc->view; [view releaseResources]; [view release]; mfc->view = nil; @@ -80,11 +81,11 @@ static int mfreerdp_client_stop(rdpContext* context) return 0; } -static BOOL mfreerdp_client_new(freerdp* instance, rdpContext* context) +static BOOL mfreerdp_client_new(freerdp *instance, rdpContext *context) { - mfContext* mfc; - rdpSettings* settings; - mfc = (mfContext*) instance->context; + mfContext *mfc; + rdpSettings *settings; + mfc = (mfContext *)instance->context; mfc->stopEvent = CreateEvent(NULL, TRUE, FALSE, NULL); context->instance->PreConnect = mac_pre_connect; context->instance->PostConnect = mac_post_connect; @@ -101,18 +102,18 @@ static BOOL mfreerdp_client_new(freerdp* instance, rdpContext* context) return TRUE; } -static void mfreerdp_client_free(freerdp* instance, rdpContext* context) +static void mfreerdp_client_free(freerdp *instance, rdpContext *context) { - mfContext* mfc; + mfContext *mfc; if (!instance || !context) return; - mfc = (mfContext*) instance->context; + mfc = (mfContext *)instance->context; CloseHandle(mfc->stopEvent); } -static void mf_scale_mouse_coordinates(mfContext* mfc, UINT16* px, UINT16* py) +static void mf_scale_mouse_coordinates(mfContext *mfc, UINT16 *px, UINT16 *py) { UINT16 x = *px; UINT16 y = *py; @@ -128,7 +129,6 @@ static void mf_scale_mouse_coordinates(mfContext* mfc, UINT16* px, UINT16* py) y -= (dh - wh); x -= (dw - ww); - } else { @@ -140,11 +140,10 @@ static void mf_scale_mouse_coordinates(mfContext* mfc, UINT16* px, UINT16* py) *py = y; } -void mf_scale_mouse_event(void* context, rdpInput* input, UINT16 flags, - UINT16 x, UINT16 y) +void mf_scale_mouse_event(void *context, rdpInput *input, UINT16 flags, UINT16 x, UINT16 y) { - mfContext* mfc = (mfContext*) context; - MRDPView* view = (MRDPView*) mfc->view; + mfContext *mfc = (mfContext *)context; + MRDPView *view = (MRDPView *)mfc->view; // Convert to windows coordinates y = [view frame].size.height - y; @@ -153,11 +152,10 @@ void mf_scale_mouse_event(void* context, rdpInput* input, UINT16 flags, freerdp_input_send_mouse_event(input, flags, x, y); } -void mf_scale_mouse_event_ex(void* context, rdpInput* input, UINT16 flags, - UINT16 x, UINT16 y) +void mf_scale_mouse_event_ex(void *context, rdpInput *input, UINT16 flags, UINT16 x, UINT16 y) { - mfContext* mfc = (mfContext*) context; - MRDPView* view = (MRDPView*) mfc->view; + mfContext *mfc = (mfContext *)context; + MRDPView *view = (MRDPView *)mfc->view; // Convert to windows coordinates y = [view frame].size.height - y; @@ -165,7 +163,7 @@ void mf_scale_mouse_event_ex(void* context, rdpInput* input, UINT16 flags, freerdp_input_send_extended_mouse_event(input, flags, x, y); } -void mf_press_mouse_button(void* context, rdpInput* input, int button, int x, int y, BOOL down) +void mf_press_mouse_button(void *context, rdpInput *input, int button, int x, int y, BOOL down) { UINT16 flags = 0; UINT16 xflags = 0; @@ -179,28 +177,23 @@ void mf_press_mouse_button(void* context, rdpInput* input, int button, int x, in switch (button) { case 0: - mf_scale_mouse_event(context, input, - flags | PTR_FLAGS_BUTTON1, x, y); + mf_scale_mouse_event(context, input, flags | PTR_FLAGS_BUTTON1, x, y); break; case 1: - mf_scale_mouse_event(context, input, - flags | PTR_FLAGS_BUTTON2, x, y); + mf_scale_mouse_event(context, input, flags | PTR_FLAGS_BUTTON2, x, y); break; case 2: - mf_scale_mouse_event(context, input, - flags | PTR_FLAGS_BUTTON3, x, y); + mf_scale_mouse_event(context, input, flags | PTR_FLAGS_BUTTON3, x, y); break; case 3: - mf_scale_mouse_event_ex(context, input, - xflags | PTR_XFLAGS_BUTTON1, x, y); + mf_scale_mouse_event_ex(context, input, xflags | PTR_XFLAGS_BUTTON1, x, y); break; case 4: - mf_scale_mouse_event_ex(context, input, - xflags | PTR_XFLAGS_BUTTON2, x, y); + mf_scale_mouse_event_ex(context, input, xflags | PTR_XFLAGS_BUTTON2, x, y); break; default: @@ -208,7 +201,7 @@ void mf_press_mouse_button(void* context, rdpInput* input, int button, int x, in } } -int RdpClientEntry(RDP_CLIENT_ENTRY_POINTS* pEntryPoints) +int RdpClientEntry(RDP_CLIENT_ENTRY_POINTS *pEntryPoints) { pEntryPoints->Version = 1; pEntryPoints->Size = sizeof(RDP_CLIENT_ENTRY_POINTS_V1); diff --git a/client/Mac/mfreerdp.h b/client/Mac/mfreerdp.h index 75e5b7322..be39031a6 100644 --- a/client/Mac/mfreerdp.h +++ b/client/Mac/mfreerdp.h @@ -75,15 +75,15 @@ struct mf_context // These variables are required for horizontal scrolling. BOOL updating_scrollbars; BOOL xScrollVisible; - int xMinScroll; // minimum horizontal scroll value - int xCurrentScroll; // current horizontal scroll value - int xMaxScroll; // maximum horizontal scroll value + int xMinScroll; // minimum horizontal scroll value + int xCurrentScroll; // current horizontal scroll value + int xMaxScroll; // maximum horizontal scroll value // These variables are required for vertical scrolling. BOOL yScrollVisible; - int yMinScroll; // minimum vertical scroll value - int yCurrentScroll; // current vertical scroll value - int yMaxScroll; // maximum vertical scroll value + int yMinScroll; // minimum vertical scroll value + int yCurrentScroll; // current vertical scroll value + int yMaxScroll; // maximum vertical scroll value CGEventFlags kbdFlags; }; diff --git a/client/Sample/tf_channels.c b/client/Sample/tf_channels.c index 38bad83cc..51e55afeb 100644 --- a/client/Sample/tf_channels.c +++ b/client/Sample/tf_channels.c @@ -40,7 +40,7 @@ * @return 0 on success, otherwise a Win32 error code */ static UINT tf_encomsp_participant_created(EncomspClientContext* context, - ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated) + ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated) { WINPR_UNUSED(context); WINPR_UNUSED(participantCreated); @@ -50,7 +50,7 @@ static UINT tf_encomsp_participant_created(EncomspClientContext* context, static void tf_encomsp_init(tfContext* tf, EncomspClientContext* encomsp) { tf->encomsp = encomsp; - encomsp->custom = (void*) tf; + encomsp->custom = (void*)tf; encomsp->ParticipantCreated = tf_encomsp_participant_created; } @@ -66,22 +66,20 @@ static void tf_encomsp_uninit(tfContext* tf, EncomspClientContext* encomsp) tf->encomsp = NULL; } - -void tf_OnChannelConnectedEventHandler(void* context, - ChannelConnectedEventArgs* e) +void tf_OnChannelConnectedEventHandler(void* context, ChannelConnectedEventArgs* e) { - tfContext* tf = (tfContext*) context; + tfContext* tf = (tfContext*)context; if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0) { - tf->rdpei = (RdpeiClientContext*) e->pInterface; + tf->rdpei = (RdpeiClientContext*)e->pInterface; } else if (strcmp(e->name, TSMF_DVC_CHANNEL_NAME) == 0) { } else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) { - gdi_graphics_pipeline_init(tf->context.gdi, (RdpgfxClientContext*) e->pInterface); + gdi_graphics_pipeline_init(tf->context.gdi, (RdpgfxClientContext*)e->pInterface); } else if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0) { @@ -91,14 +89,13 @@ void tf_OnChannelConnectedEventHandler(void* context, } else if (strcmp(e->name, ENCOMSP_SVC_CHANNEL_NAME) == 0) { - tf_encomsp_init(tf, (EncomspClientContext*) e->pInterface); + tf_encomsp_init(tf, (EncomspClientContext*)e->pInterface); } } -void tf_OnChannelDisconnectedEventHandler(void* context, - ChannelDisconnectedEventArgs* e) +void tf_OnChannelDisconnectedEventHandler(void* context, ChannelDisconnectedEventArgs* e) { - tfContext* tf = (tfContext*) context; + tfContext* tf = (tfContext*)context; if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0) { @@ -109,8 +106,7 @@ void tf_OnChannelDisconnectedEventHandler(void* context, } else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) { - gdi_graphics_pipeline_uninit(tf->context.gdi, - (RdpgfxClientContext*) e->pInterface); + gdi_graphics_pipeline_uninit(tf->context.gdi, (RdpgfxClientContext*)e->pInterface); } else if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0) { @@ -120,6 +116,6 @@ void tf_OnChannelDisconnectedEventHandler(void* context, } else if (strcmp(e->name, ENCOMSP_SVC_CHANNEL_NAME) == 0) { - tf_encomsp_uninit(tf, (EncomspClientContext*) e->pInterface); + tf_encomsp_uninit(tf, (EncomspClientContext*)e->pInterface); } } diff --git a/client/Sample/tf_channels.h b/client/Sample/tf_channels.h index 5cb3202bf..b1c0b8655 100644 --- a/client/Sample/tf_channels.h +++ b/client/Sample/tf_channels.h @@ -24,14 +24,10 @@ #include #include -int tf_on_channel_connected(freerdp* instance, const char* name, - void* pInterface); -int tf_on_channel_disconnected(freerdp* instance, const char* name, - void* pInterface); +int tf_on_channel_connected(freerdp* instance, const char* name, void* pInterface); +int tf_on_channel_disconnected(freerdp* instance, const char* name, void* pInterface); -void tf_OnChannelConnectedEventHandler(void* context, - ChannelConnectedEventArgs* e); -void tf_OnChannelDisconnectedEventHandler(void* context, - ChannelDisconnectedEventArgs* e); +void tf_OnChannelConnectedEventHandler(void* context, ChannelConnectedEventArgs* e); +void tf_OnChannelDisconnectedEventHandler(void* context, ChannelDisconnectedEventArgs* e); #endif /* FREERDP_CLIENT_SAMPLE_CHANNELS_H */ diff --git a/client/Sample/tf_freerdp.c b/client/Sample/tf_freerdp.c index 41179ec44..325cc943c 100644 --- a/client/Sample/tf_freerdp.c +++ b/client/Sample/tf_freerdp.c @@ -71,8 +71,7 @@ static BOOL tf_end_paint(rdpContext* context) } /* This function is called to output a System BEEP */ -static BOOL tf_play_sound(rdpContext* context, - const PLAY_SOUND_UPDATE* play_sound) +static BOOL tf_play_sound(rdpContext* context, const PLAY_SOUND_UPDATE* play_sound) { /* TODO: Implement */ WINPR_UNUSED(context); @@ -97,7 +96,8 @@ static BOOL tf_keyboard_set_ime_status(rdpContext* context, UINT16 imeId, UINT32 return FALSE; WLog_WARN(TAG, - "KeyboardSetImeStatus(unitId=%04"PRIx16", imeState=%08"PRIx32", imeConvMode=%08"PRIx32") ignored", + "KeyboardSetImeStatus(unitId=%04" PRIx16 ", imeState=%08" PRIx32 + ", imeConvMode=%08" PRIx32 ") ignored", imeId, imeState, imeConvMode); return TRUE; } @@ -116,15 +116,13 @@ static BOOL tf_pre_connect(freerdp* instance) * callbacks or deactiveate certain features. */ /* Register the channel listeners. * They are required to set up / tear down channels if they are loaded. */ - PubSub_SubscribeChannelConnected(instance->context->pubSub, - tf_OnChannelConnectedEventHandler); + PubSub_SubscribeChannelConnected(instance->context->pubSub, tf_OnChannelConnectedEventHandler); PubSub_SubscribeChannelDisconnected(instance->context->pubSub, tf_OnChannelDisconnectedEventHandler); /* Load all required plugins / channels / libraries specified by current * settings. */ - if (!freerdp_client_load_addins(instance->context->channels, - instance->settings)) + if (!freerdp_client_load_addins(instance->context->channels, instance->settings)) return FALSE; /* TODO: Any code your client requires */ @@ -165,7 +163,7 @@ static void tf_post_disconnect(freerdp* instance) if (!instance->context) return; - context = (tfContext*) instance->context; + context = (tfContext*)instance->context; PubSub_UnsubscribeChannelConnected(instance->context->pubSub, tf_OnChannelConnectedEventHandler); PubSub_UnsubscribeChannelDisconnected(instance->context->pubSub, @@ -205,7 +203,7 @@ static DWORD WINAPI tf_client_thread_proc(LPVOID arg) if (status == WAIT_FAILED) { - WLog_ERR(TAG, "%s: WaitForMultipleObjects failed with %"PRIu32"", __FUNCTION__, + WLog_ERR(TAG, "%s: WaitForMultipleObjects failed with %" PRIu32 "", __FUNCTION__, status); break; } @@ -248,7 +246,7 @@ static int tf_logon_error_info(freerdp* instance, UINT32 data, UINT32 type) if (!instance || !instance->context) return -1; - tf = (tfContext*) instance->context; + tf = (tfContext*)instance->context; WLog_INFO(TAG, "Logon Error Info %s [%s]", str_data, str_type); WINPR_UNUSED(tf); @@ -257,7 +255,7 @@ static int tf_logon_error_info(freerdp* instance, UINT32 data, UINT32 type) static BOOL tf_client_new(freerdp* instance, rdpContext* context) { - tfContext* tf = (tfContext*) context; + tfContext* tf = (tfContext*)context; if (!instance || !context) return FALSE; @@ -275,10 +273,9 @@ static BOOL tf_client_new(freerdp* instance, rdpContext* context) return TRUE; } - static void tf_client_free(freerdp* instance, rdpContext* context) { - tfContext* tf = (tfContext*) instance->context; + tfContext* tf = (tfContext*)instance->context; if (!context) return; @@ -328,10 +325,9 @@ int main(int argc, char* argv[]) if (!context) goto fail; - status = freerdp_client_settings_parse_command_line(context->settings, argc, - argv, FALSE); - status = freerdp_client_settings_command_line_status_print(context->settings, - status, argc, argv); + status = freerdp_client_settings_parse_command_line(context->settings, argc, argv, FALSE); + status = + freerdp_client_settings_command_line_status_print(context->settings, status, argc, argv); if (status) return 0; diff --git a/client/Wayland/wlf_channels.c b/client/Wayland/wlf_channels.c index babea04e6..743dd54af 100644 --- a/client/Wayland/wlf_channels.c +++ b/client/Wayland/wlf_channels.c @@ -34,7 +34,7 @@ * @return 0 on success, otherwise a Win32 error code */ static UINT wlf_encomsp_participant_created(EncomspClientContext* context, - ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated) + ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated) { return CHANNEL_RC_OK; } @@ -42,7 +42,7 @@ static UINT wlf_encomsp_participant_created(EncomspClientContext* context, static void wlf_encomsp_init(wlfContext* wlf, EncomspClientContext* encomsp) { wlf->encomsp = encomsp; - encomsp->custom = (void*) wlf; + encomsp->custom = (void*)wlf; encomsp->ParticipantCreated = wlf_encomsp_participant_created; } @@ -58,22 +58,20 @@ static void wlf_encomsp_uninit(wlfContext* wlf, EncomspClientContext* encomsp) wlf->encomsp = NULL; } - -void wlf_OnChannelConnectedEventHandler(void* context, - ChannelConnectedEventArgs* e) +void wlf_OnChannelConnectedEventHandler(void* context, ChannelConnectedEventArgs* e) { - wlfContext* wlf = (wlfContext*) context; + wlfContext* wlf = (wlfContext*)context; if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0) { - wlf->rdpei = (RdpeiClientContext*) e->pInterface; + wlf->rdpei = (RdpeiClientContext*)e->pInterface; } else if (strcmp(e->name, TSMF_DVC_CHANNEL_NAME) == 0) { } else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) { - gdi_graphics_pipeline_init(wlf->context.gdi, (RdpgfxClientContext*) e->pInterface); + gdi_graphics_pipeline_init(wlf->context.gdi, (RdpgfxClientContext*)e->pInterface); } else if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0) { @@ -84,7 +82,7 @@ void wlf_OnChannelConnectedEventHandler(void* context, } else if (strcmp(e->name, ENCOMSP_SVC_CHANNEL_NAME) == 0) { - wlf_encomsp_init(wlf, (EncomspClientContext*) e->pInterface); + wlf_encomsp_init(wlf, (EncomspClientContext*)e->pInterface); } else if (strcmp(e->name, DISP_DVC_CHANNEL_NAME) == 0) { @@ -92,10 +90,9 @@ void wlf_OnChannelConnectedEventHandler(void* context, } } -void wlf_OnChannelDisconnectedEventHandler(void* context, - ChannelDisconnectedEventArgs* e) +void wlf_OnChannelDisconnectedEventHandler(void* context, ChannelDisconnectedEventArgs* e) { - wlfContext* wlf = (wlfContext*) context; + wlfContext* wlf = (wlfContext*)context; if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0) { @@ -106,8 +103,7 @@ void wlf_OnChannelDisconnectedEventHandler(void* context, } else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) { - gdi_graphics_pipeline_uninit(wlf->context.gdi, - (RdpgfxClientContext*) e->pInterface); + gdi_graphics_pipeline_uninit(wlf->context.gdi, (RdpgfxClientContext*)e->pInterface); } else if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0) { @@ -118,7 +114,7 @@ void wlf_OnChannelDisconnectedEventHandler(void* context, } else if (strcmp(e->name, ENCOMSP_SVC_CHANNEL_NAME) == 0) { - wlf_encomsp_uninit(wlf, (EncomspClientContext*) e->pInterface); + wlf_encomsp_uninit(wlf, (EncomspClientContext*)e->pInterface); } else if (strcmp(e->name, DISP_DVC_CHANNEL_NAME) == 0) { diff --git a/client/Wayland/wlf_channels.h b/client/Wayland/wlf_channels.h index 1b6c591fe..d4469cbfc 100644 --- a/client/Wayland/wlf_channels.h +++ b/client/Wayland/wlf_channels.h @@ -29,14 +29,10 @@ #include #include -int wlf_on_channel_connected(freerdp* instance, const char* name, - void* pInterface); -int wlf_on_channel_disconnected(freerdp* instance, const char* name, - void* pInterface); +int wlf_on_channel_connected(freerdp* instance, const char* name, void* pInterface); +int wlf_on_channel_disconnected(freerdp* instance, const char* name, void* pInterface); -void wlf_OnChannelConnectedEventHandler(void* context, - ChannelConnectedEventArgs* e); -void wlf_OnChannelDisconnectedEventHandler(void* context, - ChannelDisconnectedEventArgs* e); +void wlf_OnChannelConnectedEventHandler(void* context, ChannelConnectedEventArgs* e); +void wlf_OnChannelDisconnectedEventHandler(void* context, ChannelDisconnectedEventArgs* e); #endif /* FREERDP_CLIENT_WAYLAND_CHANNELS_H */ diff --git a/client/Wayland/wlf_cliprdr.c b/client/Wayland/wlf_cliprdr.c index 44f3b4439..c88b32a22 100644 --- a/client/Wayland/wlf_cliprdr.c +++ b/client/Wayland/wlf_cliprdr.c @@ -38,39 +38,20 @@ #define TAG CLIENT_TAG("wayland.cliprdr") -#define MAX_CLIPBOARD_FORMATS 255 +#define MAX_CLIPBOARD_FORMATS 255 -static const char* mime_text[] = -{ - "text/plain", - "text/plain;charset=utf-8", - "UTF8_STRING", - "COMPOUND_TEXT", - "TEXT", - "STRING" -}; +static const char* mime_text[] = { "text/plain", "text/plain;charset=utf-8", + "UTF8_STRING", "COMPOUND_TEXT", + "TEXT", "STRING" }; -static const char* mime_image[] = -{ - "image/png", - "image/bmp", - "image/x-bmp", - "image/x-MS-bmp", - "image/x-icon", - "image/x-ico", - "image/x-win-bitmap", - "image/vmd.microsoft.icon", - "application/ico", - "image/ico", - "image/icon", - "image/jpeg", +static const char* mime_image[] = { + "image/png", "image/bmp", "image/x-bmp", "image/x-MS-bmp", + "image/x-icon", "image/x-ico", "image/x-win-bitmap", "image/vmd.microsoft.icon", + "application/ico", "image/ico", "image/icon", "image/jpeg", "image/tiff" }; -static const char* mime_html[] = -{ - "text/html" -}; +static const char* mime_html[] = { "text/html" }; struct wlf_clipboard { @@ -253,13 +234,11 @@ static void wlf_cliprdr_add_client_format(wfClipboard* clipboard, const char* mi * * @return 0 on success, otherwise a Win32 error code */ -static UINT wlf_cliprdr_send_data_request(wfClipboard* clipboard, - UINT32 formatId) +static UINT wlf_cliprdr_send_data_request(wfClipboard* clipboard, UINT32 formatId) { CLIPRDR_FORMAT_DATA_REQUEST request = { 0 }; request.requestedFormatId = formatId; - return clipboard->context->ClientFormatDataRequest(clipboard->context, - &request); + return clipboard->context->ClientFormatDataRequest(clipboard->context, &request); } /** @@ -267,8 +246,7 @@ static UINT wlf_cliprdr_send_data_request(wfClipboard* clipboard, * * @return 0 on success, otherwise a Win32 error code */ -static UINT wlf_cliprdr_send_data_response(wfClipboard* clipboard, const BYTE* data, - size_t size) +static UINT wlf_cliprdr_send_data_response(wfClipboard* clipboard, const BYTE* data, size_t size) { CLIPRDR_FORMAT_DATA_RESPONSE response = { 0 }; @@ -278,8 +256,7 @@ static UINT wlf_cliprdr_send_data_response(wfClipboard* clipboard, const BYTE* d response.msgFlags = (data) ? CB_RESPONSE_OK : CB_RESPONSE_FAIL; response.dataLen = (UINT32)size; response.requestedFormatData = data; - return clipboard->context->ClientFormatDataResponse(clipboard->context, - &response); + return clipboard->context->ClientFormatDataResponse(clipboard->context, &response); } BOOL wlf_cliprdr_handle_event(wfClipboard* clipboard, const UwacClipboardEvent* event) @@ -321,19 +298,16 @@ static UINT wlf_cliprdr_send_client_capabilities(wfClipboard* clipboard) CLIPRDR_CAPABILITIES capabilities; CLIPRDR_GENERAL_CAPABILITY_SET generalCapabilitySet; capabilities.cCapabilitiesSets = 1; - capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET*) & - (generalCapabilitySet); + capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET*)&(generalCapabilitySet); generalCapabilitySet.capabilitySetType = CB_CAPSTYPE_GENERAL; generalCapabilitySet.capabilitySetLength = 12; generalCapabilitySet.version = CB_CAPS_VERSION_2; generalCapabilitySet.generalFlags = CB_USE_LONG_FORMAT_NAMES; if (clipboard->streams_supported && clipboard->file_formats_registered) - generalCapabilitySet.generalFlags |= - CB_STREAM_FILECLIP_ENABLED | CB_FILECLIP_NO_FILE_PATHS; + generalCapabilitySet.generalFlags |= CB_STREAM_FILECLIP_ENABLED | CB_FILECLIP_NO_FILE_PATHS; - return clipboard->context->ClientCapabilities(clipboard->context, - &capabilities); + return clipboard->context->ClientCapabilities(clipboard->context, &capabilities); } /** @@ -341,15 +315,13 @@ static UINT wlf_cliprdr_send_client_capabilities(wfClipboard* clipboard) * * @return 0 on success, otherwise a Win32 error code */ -static UINT wlf_cliprdr_send_client_format_list_response(wfClipboard* clipboard, - BOOL status) +static UINT wlf_cliprdr_send_client_format_list_response(wfClipboard* clipboard, BOOL status) { CLIPRDR_FORMAT_LIST_RESPONSE formatListResponse; formatListResponse.msgType = CB_FORMAT_LIST_RESPONSE; formatListResponse.msgFlags = status ? CB_RESPONSE_OK : CB_RESPONSE_FAIL; formatListResponse.dataLen = 0; - return clipboard->context->ClientFormatListResponse(clipboard->context, - &formatListResponse); + return clipboard->context->ClientFormatListResponse(clipboard->context, &formatListResponse); } /** @@ -360,7 +332,7 @@ static UINT wlf_cliprdr_send_client_format_list_response(wfClipboard* clipboard, static UINT wlf_cliprdr_monitor_ready(CliprdrClientContext* context, const CLIPRDR_MONITOR_READY* monitorReady) { - wfClipboard* clipboard = (wfClipboard*) context->custom; + wfClipboard* clipboard = (wfClipboard*)context->custom; UINT ret; WINPR_UNUSED(monitorReady); @@ -380,20 +352,21 @@ static UINT wlf_cliprdr_monitor_ready(CliprdrClientContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT wlf_cliprdr_server_capabilities(CliprdrClientContext* context, - const CLIPRDR_CAPABILITIES* capabilities) + const CLIPRDR_CAPABILITIES* capabilities) { UINT32 i; - const BYTE* capsPtr = (const BYTE*) capabilities->capabilitySets; - wfClipboard* clipboard = (wfClipboard*) context->custom; + const BYTE* capsPtr = (const BYTE*)capabilities->capabilitySets; + wfClipboard* clipboard = (wfClipboard*)context->custom; clipboard->streams_supported = FALSE; for (i = 0; i < capabilities->cCapabilitiesSets; i++) { - const CLIPRDR_CAPABILITY_SET* caps = (const CLIPRDR_CAPABILITY_SET*) capsPtr; + const CLIPRDR_CAPABILITY_SET* caps = (const CLIPRDR_CAPABILITY_SET*)capsPtr; if (caps->capabilitySetType == CB_CAPSTYPE_GENERAL) { - const CLIPRDR_GENERAL_CAPABILITY_SET* generalCaps = (const CLIPRDR_GENERAL_CAPABILITY_SET*) caps; + const CLIPRDR_GENERAL_CAPABILITY_SET* generalCaps = + (const CLIPRDR_GENERAL_CAPABILITY_SET*)caps; if (generalCaps->generalFlags & CB_STREAM_FILECLIP_ENABLED) { @@ -457,7 +430,8 @@ static void wlf_cliprdr_transfer_data(UwacSeat* seat, void* context, const char* if (clipboard->responseFile) wlf_cliprdr_send_data_request(clipboard, clipboard->responseFormat); else - WLog_Print(clipboard->log, WLOG_ERROR, "failed to open clipboard file descriptor for MIME %s", + WLog_Print(clipboard->log, WLOG_ERROR, + "failed to open clipboard file descriptor for MIME %s", clipboard->responseMime); } } @@ -477,7 +451,7 @@ static void wlf_cliprdr_cancel_data(UwacSeat* seat, void* context) * @return 0 on success, otherwise a Win32 error code */ static UINT wlf_cliprdr_server_format_list(CliprdrClientContext* context, - const CLIPRDR_FORMAT_LIST* formatList) + const CLIPRDR_FORMAT_LIST* formatList) { UINT32 i; wfClipboard* clipboard; @@ -488,13 +462,14 @@ static UINT wlf_cliprdr_server_format_list(CliprdrClientContext* context, if (!context || !context->custom) return ERROR_INVALID_PARAMETER; - clipboard = (wfClipboard*) context->custom; + clipboard = (wfClipboard*)context->custom; wlf_cliprdr_free_server_formats(clipboard); - if (!(clipboard->serverFormats = (CLIPRDR_FORMAT*) calloc( - formatList->numFormats, sizeof(CLIPRDR_FORMAT)))) + if (!(clipboard->serverFormats = + (CLIPRDR_FORMAT*)calloc(formatList->numFormats, sizeof(CLIPRDR_FORMAT)))) { - WLog_Print(clipboard->log, WLOG_ERROR, "failed to allocate %"PRIuz" CLIPRDR_FORMAT structs", + WLog_Print(clipboard->log, WLOG_ERROR, + "failed to allocate %" PRIuz " CLIPRDR_FORMAT structs", clipboard->numServerFormats); return CHANNEL_RC_NO_MEMORY; } @@ -503,7 +478,8 @@ static UINT wlf_cliprdr_server_format_list(CliprdrClientContext* context, if (!clipboard->seat) { - WLog_Print(clipboard->log, WLOG_ERROR, "clipboard->seat=NULL, check your client implementation"); + WLog_Print(clipboard->log, WLOG_ERROR, + "clipboard->seat=NULL, check your client implementation"); return ERROR_INTERNAL_ERROR; } @@ -586,10 +562,11 @@ static UINT wlf_cliprdr_server_format_list(CliprdrClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT wlf_cliprdr_server_format_list_response(CliprdrClientContext* - context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) +static UINT +wlf_cliprdr_server_format_list_response(CliprdrClientContext* context, + const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) { - //wfClipboard* clipboard = (wfClipboard*) context->custom; + // wfClipboard* clipboard = (wfClipboard*) context->custom; return CHANNEL_RC_OK; } @@ -598,8 +575,9 @@ static UINT wlf_cliprdr_server_format_list_response(CliprdrClientContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT wlf_cliprdr_server_format_data_request(CliprdrClientContext* context, - const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) +static UINT +wlf_cliprdr_server_format_data_request(CliprdrClientContext* context, + const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) { int cnv; UINT rc = CHANNEL_RC_OK; @@ -608,7 +586,7 @@ static UINT wlf_cliprdr_server_format_data_request(CliprdrClientContext* context size_t size; const char* mime; UINT32 formatId = formatDataRequest->requestedFormatId; - wfClipboard* clipboard = (wfClipboard*) context->custom; + wfClipboard* clipboard = (wfClipboard*)context->custom; switch (formatId) { @@ -680,8 +658,9 @@ static UINT wlf_cliprdr_server_format_data_request(CliprdrClientContext* context * * @return 0 on success, otherwise a Win32 error code */ -static UINT wlf_cliprdr_server_format_data_response(CliprdrClientContext* - context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) +static UINT +wlf_cliprdr_server_format_data_response(CliprdrClientContext* context, + const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) { int cnv; UINT rc = ERROR_INTERNAL_ERROR; @@ -689,7 +668,7 @@ static UINT wlf_cliprdr_server_format_data_response(CliprdrClientContext* LPSTR cdata = NULL; LPCSTR data = (LPCSTR)formatDataResponse->requestedFormatData; const WCHAR* wdata = (const WCHAR*)formatDataResponse->requestedFormatData; - wfClipboard* clipboard = (wfClipboard*) context->custom; + wfClipboard* clipboard = (wfClipboard*)context->custom; if (size > INT_MAX * sizeof(WCHAR)) return ERROR_INTERNAL_ERROR; @@ -697,7 +676,8 @@ static UINT wlf_cliprdr_server_format_data_response(CliprdrClientContext* switch (clipboard->responseFormat) { case CF_UNICODETEXT: - cnv = ConvertFromUnicode(CP_UTF8, 0, wdata, (int)(size / sizeof(WCHAR)), &cdata, 0, NULL, NULL); + cnv = ConvertFromUnicode(CP_UTF8, 0, wdata, (int)(size / sizeof(WCHAR)), &cdata, 0, + NULL, NULL); if (cnv < 0) return ERROR_INTERNAL_ERROR; @@ -718,8 +698,9 @@ static UINT wlf_cliprdr_server_format_data_response(CliprdrClientContext* return rc; } -static UINT wlf_cliprdr_server_file_size_request(wfClipboard* clipboard, - const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +static UINT +wlf_cliprdr_server_file_size_request(wfClipboard* clipboard, + const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { wClipboardFileSizeRequest request = { 0 }; request.streamId = fileContentsRequest->streamId; @@ -727,15 +708,17 @@ static UINT wlf_cliprdr_server_file_size_request(wfClipboard* clipboard, if (fileContentsRequest->cbRequested != sizeof(UINT64)) { - WLog_Print(clipboard->log, WLOG_WARN, "unexpected FILECONTENTS_SIZE request: %"PRIu32" bytes", + WLog_Print(clipboard->log, WLOG_WARN, + "unexpected FILECONTENTS_SIZE request: %" PRIu32 " bytes", fileContentsRequest->cbRequested); } return clipboard->delegate->ClientRequestFileSize(clipboard->delegate, &request); } -static UINT wlf_cliprdr_server_file_range_request(wfClipboard* clipboard, - const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +static UINT +wlf_cliprdr_server_file_range_request(wfClipboard* clipboard, + const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { wClipboardFileRangeRequest request = { 0 }; request.streamId = fileContentsRequest->streamId; @@ -746,8 +729,9 @@ static UINT wlf_cliprdr_server_file_range_request(wfClipboard* clipboard, return clipboard->delegate->ClientRequestFileRange(clipboard->delegate, &request); } -static UINT wlf_cliprdr_send_file_contents_failure(CliprdrClientContext* context, - const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +static UINT +wlf_cliprdr_send_file_contents_failure(CliprdrClientContext* context, + const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { CLIPRDR_FILE_CONTENTS_RESPONSE response = { 0 }; response.msgFlags = CB_RESPONSE_FAIL; @@ -755,8 +739,9 @@ static UINT wlf_cliprdr_send_file_contents_failure(CliprdrClientContext* context return context->ClientFileContentsResponse(context, &response); } -static UINT wlf_cliprdr_server_file_contents_request(CliprdrClientContext* context, - const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +static UINT +wlf_cliprdr_server_file_contents_request(CliprdrClientContext* context, + const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { UINT error = NO_ERROR; wfClipboard* clipboard = context->custom; @@ -780,8 +765,8 @@ static UINT wlf_cliprdr_server_file_contents_request(CliprdrClientContext* conte if (error) { - WLog_Print(clipboard->log, WLOG_ERROR, "failed to handle CLIPRDR_FILECONTENTS_REQUEST: 0x%08X", - error); + WLog_Print(clipboard->log, WLOG_ERROR, + "failed to handle CLIPRDR_FILECONTENTS_REQUEST: 0x%08X", error); return wlf_cliprdr_send_file_contents_failure(context, fileContentsRequest); } @@ -789,19 +774,21 @@ static UINT wlf_cliprdr_server_file_contents_request(CliprdrClientContext* conte } static UINT wlf_cliprdr_clipboard_file_size_success(wClipboardDelegate* delegate, - const wClipboardFileSizeRequest* request, UINT64 fileSize) + const wClipboardFileSizeRequest* request, + UINT64 fileSize) { CLIPRDR_FILE_CONTENTS_RESPONSE response = { 0 }; wfClipboard* clipboard = delegate->custom; response.msgFlags = CB_RESPONSE_OK; response.streamId = request->streamId; response.cbRequested = sizeof(UINT64); - response.requestedData = (BYTE*) &fileSize; + response.requestedData = (BYTE*)&fileSize; return clipboard->context->ClientFileContentsResponse(clipboard->context, &response); } static UINT wlf_cliprdr_clipboard_file_size_failure(wClipboardDelegate* delegate, - const wClipboardFileSizeRequest* request, UINT errorCode) + const wClipboardFileSizeRequest* request, + UINT errorCode) { CLIPRDR_FILE_CONTENTS_RESPONSE response = { 0 }; wfClipboard* clipboard = delegate->custom; @@ -812,19 +799,21 @@ static UINT wlf_cliprdr_clipboard_file_size_failure(wClipboardDelegate* delegate } static UINT wlf_cliprdr_clipboard_file_range_success(wClipboardDelegate* delegate, - const wClipboardFileRangeRequest* request, const BYTE* data, UINT32 size) + const wClipboardFileRangeRequest* request, + const BYTE* data, UINT32 size) { CLIPRDR_FILE_CONTENTS_RESPONSE response = { 0 }; wfClipboard* clipboard = delegate->custom; response.msgFlags = CB_RESPONSE_OK; response.streamId = request->streamId; response.cbRequested = size; - response.requestedData = (const BYTE*) data; + response.requestedData = (const BYTE*)data; return clipboard->context->ClientFileContentsResponse(clipboard->context, &response); } static UINT wlf_cliprdr_clipboard_file_range_failure(wClipboardDelegate* delegate, - const wClipboardFileRangeRequest* request, UINT errorCode) + const wClipboardFileRangeRequest* request, + UINT errorCode) { CLIPRDR_FILE_CONTENTS_RESPONSE response = { 0 }; wfClipboard* clipboard = delegate->custom; @@ -839,7 +828,7 @@ wfClipboard* wlf_clipboard_new(wlfContext* wfc) rdpChannels* channels; wfClipboard* clipboard; - if (!(clipboard = (wfClipboard*) calloc(1, sizeof(wfClipboard)))) + if (!(clipboard = (wfClipboard*)calloc(1, sizeof(wfClipboard)))) return NULL; clipboard->wfc = wfc; @@ -875,7 +864,7 @@ BOOL wlf_cliprdr_init(wfClipboard* clipboard, CliprdrClientContext* cliprdr) return FALSE; clipboard->context = cliprdr; - cliprdr->custom = (void*) clipboard; + cliprdr->custom = (void*)clipboard; cliprdr->MonitorReady = wlf_cliprdr_monitor_ready; cliprdr->ServerCapabilities = wlf_cliprdr_server_capabilities; cliprdr->ServerFormatList = wlf_cliprdr_server_format_list; diff --git a/client/Wayland/wlf_disp.c b/client/Wayland/wlf_disp.c index 012ca0879..609c4ef2f 100644 --- a/client/Wayland/wlf_disp.c +++ b/client/Wayland/wlf_disp.c @@ -111,9 +111,9 @@ static BOOL wlf_disp_sendResize(wlfDispContext* wlfDisp) /* TODO: Multimonitor support for wayland if (wlc->fullscreen && (settings->MonitorCount > 0)) { - if (wlf_disp_sendLayout(wlfDisp->disp, settings->MonitorDefArray, - settings->MonitorCount) != CHANNEL_RC_OK) - return FALSE; + if (wlf_disp_sendLayout(wlfDisp->disp, settings->MonitorDefArray, + settings->MonitorCount) != CHANNEL_RC_OK) + return FALSE; } else */ @@ -334,7 +334,8 @@ static UINT wlf_DisplayControlCaps(DispClientContext* disp, UINT32 maxNumMonitor wlfDispContext* wlfDisp = (wlfDispContext*)disp->custom; rdpSettings* settings = wlfDisp->wlc->context.settings; WLog_DBG(TAG, - "DisplayControlCapsPdu: MaxNumMonitors: %"PRIu32" MaxMonitorAreaFactorA: %"PRIu32" MaxMonitorAreaFactorB: %"PRIu32"", + "DisplayControlCapsPdu: MaxNumMonitors: %" PRIu32 " MaxMonitorAreaFactorA: %" PRIu32 + " MaxMonitorAreaFactorB: %" PRIu32 "", maxNumMonitors, maxMonitorAreaFactorA, maxMonitorAreaFactorB); wlfDisp->activated = TRUE; @@ -358,7 +359,7 @@ BOOL wlf_disp_init(wlfDispContext* wlfDisp, DispClientContext* disp) return FALSE; wlfDisp->disp = disp; - disp->custom = (void*) wlfDisp; + disp->custom = (void*)wlfDisp; if (settings->DynamicResolutionUpdate) { diff --git a/client/Wayland/wlf_input.c b/client/Wayland/wlf_input.c index e21949643..33352cf13 100644 --- a/client/Wayland/wlf_input.c +++ b/client/Wayland/wlf_input.c @@ -117,7 +117,6 @@ BOOL wlf_handle_pointer_buttons(freerdp* instance, const UwacPointerButtonEvent* return FALSE; } - BOOL wlf_handle_pointer_axis(freerdp* instance, const UwacPointerAxisEvent* ev) { rdpInput* input; @@ -159,7 +158,7 @@ BOOL wlf_handle_pointer_axis(freerdp* instance, const UwacPointerAxisEvent* ev) step = (uint32_t)abs(direction); if (step > WheelRotationMask) step = WheelRotationMask; - flags |= step; + flags |= step; return freerdp_input_send_mouse_event(input, flags, (UINT16)x, (UINT16)y); } diff --git a/client/Wayland/wlf_input.h b/client/Wayland/wlf_input.h index 39431baee..fb362c4cb 100644 --- a/client/Wayland/wlf_input.h +++ b/client/Wayland/wlf_input.h @@ -26,8 +26,7 @@ #include #include -BOOL wlf_handle_pointer_enter(freerdp* instance, - const UwacPointerEnterLeaveEvent* ev); +BOOL wlf_handle_pointer_enter(freerdp* instance, const UwacPointerEnterLeaveEvent* ev); BOOL wlf_handle_pointer_motion(freerdp* instance, const UwacPointerMotionEvent* ev); BOOL wlf_handle_pointer_buttons(freerdp* instance, const UwacPointerButtonEvent* ev); BOOL wlf_handle_pointer_axis(freerdp* instance, const UwacPointerAxisEvent* ev); diff --git a/client/Wayland/wlf_pointer.c b/client/Wayland/wlf_pointer.c index 9dad61717..64166590c 100644 --- a/client/Wayland/wlf_pointer.c +++ b/client/Wayland/wlf_pointer.c @@ -49,11 +49,9 @@ static BOOL wlf_Pointer_New(rdpContext* context, rdpPointer* pointer) return FALSE; if (!freerdp_image_copy_from_pointer_data( - ptr->data, PIXEL_FORMAT_BGRA32, - 0, 0, 0, pointer->width, pointer->height, - pointer->xorMaskData, pointer->lengthXorMask, - pointer->andMaskData, pointer->lengthAndMask, - pointer->xorBpp, &context->gdi->palette)) + ptr->data, PIXEL_FORMAT_BGRA32, 0, 0, 0, pointer->width, pointer->height, + pointer->xorMaskData, pointer->lengthXorMask, pointer->andMaskData, + pointer->lengthAndMask, pointer->xorBpp, &context->gdi->palette)) { _aligned_free(ptr->data); return FALSE; @@ -71,8 +69,7 @@ static void wlf_Pointer_Free(rdpContext* context, rdpPointer* pointer) _aligned_free(ptr->data); } -static BOOL wlf_Pointer_Set(rdpContext* context, - const rdpPointer* pointer) +static BOOL wlf_Pointer_Set(rdpContext* context, const rdpPointer* pointer) { wlfContext* wlf = (wlfContext*)context; wlfPointer* ptr = (wlfPointer*)pointer; @@ -106,8 +103,8 @@ static BOOL wlf_Pointer_Set(rdpContext* context, area.right = (UINT16)pointer->width; area.bottom = (UINT16)pointer->height; - if (!wlf_copy_image(ptr->data, pointer->width * 4, pointer->width, pointer->height, data, w * 4, w, - h, &area, context->settings->SmartSizing)) + if (!wlf_copy_image(ptr->data, pointer->width * 4, pointer->width, pointer->height, data, w * 4, + w, h, &area, context->settings->SmartSizing)) goto fail; rc = UwacSeatSetMouseCursor(wlf->seat, data, size, w, h, x, y); @@ -157,7 +154,7 @@ BOOL wlf_register_pointer(rdpGraphics* graphics) { rdpPointer* pointer = NULL; - if (!(pointer = (rdpPointer*) calloc(1, sizeof(rdpPointer)))) + if (!(pointer = (rdpPointer*)calloc(1, sizeof(rdpPointer)))) return FALSE; pointer->size = sizeof(wlfPointer); diff --git a/client/Wayland/wlfreerdp.c b/client/Wayland/wlfreerdp.c index 301463cf5..cabc56061 100644 --- a/client/Wayland/wlfreerdp.c +++ b/client/Wayland/wlfreerdp.c @@ -100,8 +100,8 @@ static BOOL wl_update_buffer(wlfContext* context_w, INT32 ix, INT32 iy, INT32 iw area.right = x + w; area.bottom = y + h; - if (!wlf_copy_image(gdi->primary_buffer, gdi->stride, gdi->width, gdi->height, - data, stride, geometry.width, geometry.height, &area, + if (!wlf_copy_image(gdi->primary_buffer, gdi->stride, gdi->width, gdi->height, data, stride, + geometry.width, geometry.height, &area, context_w->context.settings->SmartSizing)) return FALSE; @@ -139,7 +139,7 @@ static BOOL wl_end_paint(rdpContext* context) y = gdi->primary->hdc->hwnd->invalid->y; w = gdi->primary->hdc->hwnd->invalid->w; h = gdi->primary->hdc->hwnd->invalid->h; - context_w = (wlfContext*) context; + context_w = (wlfContext*)context; return wl_update_buffer(context_w, x, y, w, h); } @@ -176,7 +176,7 @@ static BOOL wl_pre_connect(freerdp* instance) if (!instance) return FALSE; - context = (wlfContext*) instance->context; + context = (wlfContext*)instance->context; settings = instance->settings; if (!context || !settings) @@ -184,8 +184,7 @@ static BOOL wl_pre_connect(freerdp* instance) settings->OsMajorType = OSMAJORTYPE_UNIX; settings->OsMinorType = OSMINORTYPE_NATIVE_WAYLAND; - PubSub_SubscribeChannelConnected(instance->context->pubSub, - wlf_OnChannelConnectedEventHandler); + PubSub_SubscribeChannelConnected(instance->context->pubSub, wlf_OnChannelConnectedEventHandler); PubSub_SubscribeChannelDisconnected(instance->context->pubSub, wlf_OnChannelDisconnectedEventHandler); @@ -196,8 +195,8 @@ static BOOL wl_pre_connect(freerdp* instance) if (output != NULL && UwacOutputGetResolution(output, &resolution) == UWAC_SUCCESS) { - settings->DesktopWidth = (UINT32) resolution.width; - settings->DesktopHeight = (UINT32) resolution.height; + settings->DesktopWidth = (UINT32)resolution.width; + settings->DesktopHeight = (UINT32)resolution.height; } else { @@ -205,8 +204,7 @@ static BOOL wl_pre_connect(freerdp* instance) } } - if (!freerdp_client_load_addins(instance->context->channels, - instance->settings)) + if (!freerdp_client_load_addins(instance->context->channels, instance->settings)) return FALSE; return TRUE; @@ -223,7 +221,7 @@ static BOOL wl_post_connect(freerdp* instance) if (!instance || !instance->context) return FALSE; - context = (wlfContext*) instance->context; + context = (wlfContext*)instance->context; settings = instance->context->settings; if (!gdi_init(instance, PIXEL_FORMAT_BGRA32)) @@ -283,7 +281,7 @@ static void wl_post_disconnect(freerdp* instance) if (!instance->context) return; - context = (wlfContext*) instance->context; + context = (wlfContext*)instance->context; gdi_free(instance); wlf_clipboard_free(context->clipboard); wlf_disp_free(context->disp); @@ -364,7 +362,8 @@ static BOOL handle_uwac_events(freerdp* instance, UwacDisplay* display) break; case UWAC_EVENT_CONFIGURE: - if (!wlf_disp_handle_configure(context->disp, event.configure.width, event.configure.height)) + if (!wlf_disp_handle_configure(context->disp, event.configure.width, + event.configure.height)) return FALSE; if (!wl_refresh_display(context)) @@ -457,9 +456,9 @@ static int wlfreerdp_run(freerdp* instance) else { /* - * Indicate an unsuccessful connection attempt if reconnect - * did not succeed and no other error was specified. - */ + * Indicate an unsuccessful connection attempt if reconnect + * did not succeed and no other error was specified. + */ if (freerdp_error_info(instance) == 0) status = 42; } @@ -498,15 +497,15 @@ static int wlf_logon_error_info(freerdp* instance, UINT32 data, UINT32 type) if (!instance || !instance->context) return -1; - wlf = (wlfContext*) instance->context; - WLog_Print(wlf->log, WLOG_INFO, "Logon Error Info %s [%s]", str_data, str_type); + wlf = (wlfContext*)instance->context; + WLog_Print(wlf->log, WLOG_INFO, "Logon Error Info %s [%s]", str_data, str_type); return 1; } static BOOL wlf_client_new(freerdp* instance, rdpContext* context) { UwacReturnCode status; - wlfContext* wfl = (wlfContext*) context; + wlfContext* wfl = (wlfContext*)context; if (!instance || !context) return FALSE; @@ -526,7 +525,7 @@ static BOOL wlf_client_new(freerdp* instance, rdpContext* context) return FALSE; wfl->displayHandle = CreateFileDescriptorEvent(NULL, FALSE, FALSE, - UwacDisplayGetFd(wfl->display), WINPR_FD_READ); + UwacDisplayGetFd(wfl->display), WINPR_FD_READ); if (!wfl->displayHandle) return FALSE; @@ -534,10 +533,9 @@ static BOOL wlf_client_new(freerdp* instance, rdpContext* context) return TRUE; } - static void wlf_client_free(freerdp* instance, rdpContext* context) { - wlfContext* wlf = (wlfContext*) instance->context; + wlfContext* wlf = (wlfContext*)instance->context; if (!context) return; @@ -588,10 +586,9 @@ int main(int argc, char* argv[]) if (!context) goto fail; - status = freerdp_client_settings_parse_command_line(context->settings, argc, - argv, FALSE); - status = freerdp_client_settings_command_line_status_print(context->settings, - status, argc, argv); + status = freerdp_client_settings_parse_command_line(context->settings, argc, argv, FALSE); + status = + freerdp_client_settings_command_line_status_print(context->settings, status, argc, argv); if (status) return 0; @@ -609,9 +606,9 @@ fail: return rc; } -BOOL wlf_copy_image(const void* src, size_t srcStride, size_t srcWidth, size_t srcHeight, - void* dst, size_t dstStride, size_t dstWidth, size_t dstHeight, - const RECTANGLE_16* area, BOOL scale) +BOOL wlf_copy_image(const void* src, size_t srcStride, size_t srcWidth, size_t srcHeight, void* dst, + size_t dstStride, size_t dstWidth, size_t dstHeight, const RECTANGLE_16* area, + BOOL scale) { BOOL rc = FALSE; diff --git a/client/Wayland/wlfreerdp.h b/client/Wayland/wlfreerdp.h index 0f57ae5d0..09d056ae4 100644 --- a/client/Wayland/wlfreerdp.h +++ b/client/Wayland/wlfreerdp.h @@ -53,9 +53,8 @@ struct wlf_context }; BOOL wlf_scale_coordinates(rdpContext* context, UINT32* px, UINT32* py, BOOL fromLocalToRDP); -BOOL wlf_copy_image(const void* src, size_t srcStride, size_t srcWidth, size_t srcHeight, - void* dst, size_t dstStride, size_t dstWidth, size_t dstHeight, - const RECTANGLE_16* area, BOOL scale); +BOOL wlf_copy_image(const void* src, size_t srcStride, size_t srcWidth, size_t srcHeight, void* dst, + size_t dstStride, size_t dstWidth, size_t dstHeight, const RECTANGLE_16* area, + BOOL scale); #endif /* FREERDP_CLIENT_WAYLAND_FREERDP_H */ - diff --git a/client/Windows/cli/wfreerdp.c b/client/Windows/cli/wfreerdp.c index 2357ff813..7a76eeb9b 100644 --- a/client/Windows/cli/wfreerdp.c +++ b/client/Windows/cli/wfreerdp.c @@ -42,8 +42,7 @@ #include -INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, - LPSTR lpCmdLine, int nCmdShow) +INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { int status; HANDLE thread; @@ -94,19 +93,17 @@ INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, if (!argv[i]) goto out; - if (WideCharToMultiByte(CP_UTF8, 0, args[i], -1, argv[i], size, NULL, - NULL) != size) + if (WideCharToMultiByte(CP_UTF8, 0, args[i], -1, argv[i], size, NULL, NULL) != size) goto out; } settings = context->settings; - wfc = (wfContext*) context; + wfc = (wfContext*)context; if (!settings || !wfc) goto out; - status = freerdp_client_settings_parse_command_line(settings, argc, argv, - FALSE); + status = freerdp_client_settings_parse_command_line(settings, argc, argv, FALSE); if (status) { diff --git a/client/Windows/resource.h b/client/Windows/resource.h index fe79d5068..35991fc6b 100644 --- a/client/Windows/resource.h +++ b/client/Windows/resource.h @@ -1,12 +1,12 @@ -#define IDI_ICON1 101 -#define IDB_MINIMIZE 103 -#define IDB_MINIMIZE_ACT 104 -#define IDB_LOCK 105 -#define IDB_LOCK_ACT 106 -#define IDB_UNLOCK 107 -#define IDB_UNLOCK_ACT 108 -#define IDB_CLOSE 109 -#define IDB_CLOSE_ACT 100 -#define IDB_RESTORE 111 -#define IDB_RESTORE_ACT 112 +#define IDI_ICON1 101 +#define IDB_MINIMIZE 103 +#define IDB_MINIMIZE_ACT 104 +#define IDB_LOCK 105 +#define IDB_LOCK_ACT 106 +#define IDB_UNLOCK 107 +#define IDB_UNLOCK_ACT 108 +#define IDB_CLOSE 109 +#define IDB_CLOSE_ACT 100 +#define IDB_RESTORE 111 +#define IDB_RESTORE_ACT 112 diff --git a/client/Windows/wf_channels.c b/client/Windows/wf_channels.c index 73aac5c43..3afd52dbb 100644 --- a/client/Windows/wf_channels.c +++ b/client/Windows/wf_channels.c @@ -30,10 +30,9 @@ #include #define TAG CLIENT_TAG("windows") -void wf_OnChannelConnectedEventHandler(void* context, - ChannelConnectedEventArgs* e) +void wf_OnChannelConnectedEventHandler(void* context, ChannelConnectedEventArgs* e) { - wfContext* wfc = (wfContext*) context; + wfContext* wfc = (wfContext*)context; rdpSettings* settings = wfc->context.settings; if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0) @@ -42,28 +41,27 @@ void wf_OnChannelConnectedEventHandler(void* context, else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) { if (!settings->SoftwareGdi) - WLog_WARN(TAG, - "Channel "RDPGFX_DVC_CHANNEL_NAME" does not support hardware acceleration, using fallback."); + WLog_WARN(TAG, "Channel " RDPGFX_DVC_CHANNEL_NAME + " does not support hardware acceleration, using fallback."); - gdi_graphics_pipeline_init(wfc->context.gdi, (RdpgfxClientContext*) e->pInterface); + gdi_graphics_pipeline_init(wfc->context.gdi, (RdpgfxClientContext*)e->pInterface); } else if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0) { - wf_rail_init(wfc, (RailClientContext*) e->pInterface); + wf_rail_init(wfc, (RailClientContext*)e->pInterface); } else if (strcmp(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0) { - wf_cliprdr_init(wfc, (CliprdrClientContext*) e->pInterface); + wf_cliprdr_init(wfc, (CliprdrClientContext*)e->pInterface); } else if (strcmp(e->name, ENCOMSP_SVC_CHANNEL_NAME) == 0) { } } -void wf_OnChannelDisconnectedEventHandler(void* context, - ChannelDisconnectedEventArgs* e) +void wf_OnChannelDisconnectedEventHandler(void* context, ChannelDisconnectedEventArgs* e) { - wfContext* wfc = (wfContext*) context; + wfContext* wfc = (wfContext*)context; rdpSettings* settings = wfc->context.settings; if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0) @@ -71,16 +69,15 @@ void wf_OnChannelDisconnectedEventHandler(void* context, } else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) { - gdi_graphics_pipeline_uninit(wfc->context.gdi, - (RdpgfxClientContext*) e->pInterface); + gdi_graphics_pipeline_uninit(wfc->context.gdi, (RdpgfxClientContext*)e->pInterface); } else if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0) { - wf_rail_uninit(wfc, (RailClientContext*) e->pInterface); + wf_rail_uninit(wfc, (RailClientContext*)e->pInterface); } else if (strcmp(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0) { - wf_cliprdr_uninit(wfc, (CliprdrClientContext*) e->pInterface); + wf_cliprdr_uninit(wfc, (CliprdrClientContext*)e->pInterface); } else if (strcmp(e->name, ENCOMSP_SVC_CHANNEL_NAME) == 0) { diff --git a/client/Windows/wf_channels.h b/client/Windows/wf_channels.h index 90ee0daa0..5e4ca52e3 100644 --- a/client/Windows/wf_channels.h +++ b/client/Windows/wf_channels.h @@ -28,9 +28,7 @@ #include "wf_client.h" -void wf_OnChannelConnectedEventHandler(void* context, - ChannelConnectedEventArgs* e); -void wf_OnChannelDisconnectedEventHandler(void* context, - ChannelDisconnectedEventArgs* e); +void wf_OnChannelConnectedEventHandler(void* context, ChannelConnectedEventArgs* e); +void wf_OnChannelDisconnectedEventHandler(void* context, ChannelDisconnectedEventArgs* e); #endif /* FREERDP_CLIENT_WIN_CHANNELS_H */ diff --git a/client/Windows/wf_client.c b/client/Windows/wf_client.c index f4208aca9..fa8d2c5c7 100644 --- a/client/Windows/wf_client.c +++ b/client/Windows/wf_client.c @@ -68,7 +68,7 @@ static BOOL wf_create_console(void) freopen("CONIN$", "r", stdin); clearerr(stdin); - WLog_INFO(TAG, "Debug console created."); + WLog_INFO(TAG, "Debug console created."); return TRUE; } @@ -152,12 +152,11 @@ static BOOL wf_desktop_resize(rdpContext* context) { same = (wfc->primary == wfc->drawing) ? TRUE : FALSE; wf_image_free(wfc->primary); - wfc->primary = wf_image_new(wfc, settings->DesktopWidth, - settings->DesktopHeight, context->gdi->dstFormat, NULL); + wfc->primary = wf_image_new(wfc, settings->DesktopWidth, settings->DesktopHeight, + context->gdi->dstFormat, NULL); } - if (!gdi_resize_ex(context->gdi, settings->DesktopWidth, - settings->DesktopHeight, 0, + if (!gdi_resize_ex(context->gdi, settings->DesktopWidth, settings->DesktopHeight, 0, context->gdi->dstFormat, wfc->primary->pdata, NULL)) return FALSE; @@ -192,7 +191,7 @@ static BOOL wf_pre_connect(freerdp* instance) return FALSE; context = instance->context; - wfc = (wfContext*) instance->context; + wfc = (wfContext*)instance->context; settings = instance->settings; settings->OsMajorType = OSMAJORTYPE_WINDOWS; settings->OsMinorType = OSMINORTYPE_WINDOWS_NT; @@ -249,9 +248,8 @@ static BOOL wf_pre_connect(freerdp* instance) return -1; freerdp_set_param_uint32(settings, FreeRDP_KeyboardLayout, - (int) GetKeyboardLayout(0) & 0x0000FFFF); - PubSub_SubscribeChannelConnected(instance->context->pubSub, - wf_OnChannelConnectedEventHandler); + (int)GetKeyboardLayout(0) & 0x0000FFFF); + PubSub_SubscribeChannelConnected(instance->context->pubSub, wf_OnChannelConnectedEventHandler); PubSub_SubscribeChannelDisconnected(instance->context->pubSub, wf_OnChannelDisconnectedEventHandler); return TRUE; @@ -269,14 +267,13 @@ static void wf_add_system_menu(wfContext* wfc) hMenu = GetSystemMenu(wfc->hwnd, FALSE); ZeroMemory(&item_info, sizeof(MENUITEMINFO)); - item_info.fMask = MIIM_CHECKMARKS | MIIM_FTYPE | MIIM_ID | MIIM_STRING | - MIIM_DATA; + item_info.fMask = MIIM_CHECKMARKS | MIIM_FTYPE | MIIM_ID | MIIM_STRING | MIIM_DATA; item_info.cbSize = sizeof(MENUITEMINFO); item_info.wID = SYSCOMMAND_ID_SMARTSIZING; item_info.fType = MFT_STRING; item_info.dwTypeData = _wcsdup(_T("Smart sizing")); - item_info.cch = (UINT) _wcslen(_T("Smart sizing")); - item_info.dwItemData = (ULONG_PTR) wfc; + item_info.cch = (UINT)_wcslen(_T("Smart sizing")); + item_info.dwItemData = (ULONG_PTR)wfc; InsertMenuItem(hMenu, 6, TRUE, &item_info); if (wfc->context.settings->SmartSizing) @@ -331,10 +328,9 @@ static BOOL wf_post_connect(freerdp* instance) const UINT32 format = PIXEL_FORMAT_BGRX32; settings = instance->settings; context = instance->context; - wfc = (wfContext*) instance->context; + wfc = (wfContext*)instance->context; cache = instance->context->cache; - wfc->primary = wf_image_new(wfc, settings->DesktopWidth, - settings->DesktopHeight, format, NULL); + wfc->primary = wf_image_new(wfc, settings->DesktopWidth, settings->DesktopHeight, format, NULL); if (!gdi_init_ex(instance, format, 0, wfc->primary->pdata, NULL)) return FALSE; @@ -359,25 +355,24 @@ static BOOL wf_post_connect(freerdp* instance) else if (!settings->Decorations) dwStyle = WS_CHILD | WS_BORDER; else - dwStyle = WS_CAPTION | WS_OVERLAPPED | WS_SYSMENU | WS_MINIMIZEBOX | WS_SIZEBOX - | WS_MAXIMIZEBOX; + dwStyle = + WS_CAPTION | WS_OVERLAPPED | WS_SYSMENU | WS_MINIMIZEBOX | WS_SIZEBOX | WS_MAXIMIZEBOX; if (!wfc->hwnd) { - wfc->hwnd = CreateWindowEx((DWORD) NULL, wfc->wndClassName, wfc->window_title, - dwStyle, - 0, 0, 0, 0, wfc->hWndParent, NULL, wfc->hInstance, NULL); - SetWindowLongPtr(wfc->hwnd, GWLP_USERDATA, (LONG_PTR) wfc); + wfc->hwnd = CreateWindowEx((DWORD)NULL, wfc->wndClassName, wfc->window_title, dwStyle, 0, 0, + 0, 0, wfc->hWndParent, NULL, wfc->hInstance, NULL); + SetWindowLongPtr(wfc->hwnd, GWLP_USERDATA, (LONG_PTR)wfc); } wf_resize_window(wfc); wf_add_system_menu(wfc); - BitBlt(wfc->primary->hdc, 0, 0, settings->DesktopWidth, settings->DesktopHeight, - NULL, 0, 0, BLACKNESS); + BitBlt(wfc->primary->hdc, 0, 0, settings->DesktopWidth, settings->DesktopHeight, NULL, 0, 0, + BLACKNESS); wfc->drawing = wfc->primary; EventArgsInit(&e, "wfreerdp"); e.embed = FALSE; - e.handle = (void*) wfc->hwnd; + e.handle = (void*)wfc->hwnd; PubSub_OnEmbedWindow(context->pubSub, context, &e); ShowWindow(wfc->hwnd, SW_SHOWNORMAL); UpdateWindow(wfc->hwnd); @@ -408,21 +403,15 @@ static void wf_post_disconnect(freerdp* instance) if (!instance || !instance->context || !instance->settings) return; - wfc = (wfContext*) instance->context; + wfc = (wfContext*)instance->context; free(wfc->window_title); } -static CREDUI_INFOA wfUiInfo = -{ - sizeof(CREDUI_INFOA), - NULL, - "Enter your credentials", - "Remote Desktop Security", - NULL -}; +static CREDUI_INFOA wfUiInfo = { sizeof(CREDUI_INFOA), NULL, "Enter your credentials", + "Remote Desktop Security", NULL }; -static BOOL wf_authenticate_raw(freerdp* instance, const char* title, - char** username, char** password, char** domain) +static BOOL wf_authenticate_raw(freerdp* instance, const char* title, char** username, + char** password, char** domain) { wfContext* wfc; BOOL fSave; @@ -435,19 +424,19 @@ static BOOL wf_authenticate_raw(freerdp* instance, const char* title, if (!instance || !instance->context) return FALSE; - wfc = (wfContext*) instance->context; + wfc = (wfContext*)instance->context; fSave = FALSE; dwFlags = CREDUI_FLAGS_DO_NOT_PERSIST | CREDUI_FLAGS_EXCLUDE_CERTIFICATES; if (wfc->isConsole) - status = CredUICmdLinePromptForCredentialsA(title, NULL, 0, - UserName, CREDUI_MAX_USERNAME_LENGTH + 1, - Password, CREDUI_MAX_PASSWORD_LENGTH + 1, &fSave, dwFlags); + status = CredUICmdLinePromptForCredentialsA( + title, NULL, 0, UserName, CREDUI_MAX_USERNAME_LENGTH + 1, Password, + CREDUI_MAX_PASSWORD_LENGTH + 1, &fSave, dwFlags); else - status = CredUIPromptForCredentialsA(&wfUiInfo, title, NULL, 0, - UserName, CREDUI_MAX_USERNAME_LENGTH + 1, - Password, CREDUI_MAX_PASSWORD_LENGTH + 1, &fSave, dwFlags); + status = CredUIPromptForCredentialsA(&wfUiInfo, title, NULL, 0, UserName, + CREDUI_MAX_USERNAME_LENGTH + 1, Password, + CREDUI_MAX_PASSWORD_LENGTH + 1, &fSave, dwFlags); if (status != NO_ERROR) { @@ -455,9 +444,8 @@ static BOOL wf_authenticate_raw(freerdp* instance, const char* title, return FALSE; } - status = CredUIParseUserNameA(UserName, User, sizeof(User), Domain, - sizeof(Domain)); - //WLog_ERR(TAG, "User: %s Domain: %s Password: %s", User, Domain, Password); + status = CredUIParseUserNameA(UserName, User, sizeof(User), Domain, sizeof(Domain)); + // WLog_ERR(TAG, "User: %s Domain: %s Password: %s", User, Domain, Password); *username = _strdup(User); if (!(*username)) @@ -490,15 +478,13 @@ static BOOL wf_authenticate_raw(freerdp* instance, const char* title, return TRUE; } -static BOOL wf_authenticate(freerdp* instance, - char** username, char** password, char** domain) +static BOOL wf_authenticate(freerdp* instance, char** username, char** password, char** domain) { - return wf_authenticate_raw(instance, instance->settings->ServerHostname, - username, password, domain); + return wf_authenticate_raw(instance, instance->settings->ServerHostname, username, password, + domain); } -static BOOL wf_gw_authenticate(freerdp* instance, - char** username, char** password, char** domain) +static BOOL wf_gw_authenticate(freerdp* instance, char** username, char** password, char** domain) { char tmp[MAX_PATH]; sprintf_s(tmp, sizeof(tmp), "Gateway %s", instance->settings->GatewayHostname); @@ -532,42 +518,38 @@ static WCHAR* wf_format_text(const WCHAR* fmt, ...) goto fail; buffer = tmp; - } - while(TRUE); + } while (TRUE); fail: free(buffer); return NULL; } -static DWORD wf_verify_certificate_ex(freerdp* instance, - const char* host, - UINT16 port, - const char* common_name, - const char* subject, - const char* issuer, - const char* fingerprint, - DWORD flags) +static DWORD wf_verify_certificate_ex(freerdp* instance, const char* host, UINT16 port, + const char* common_name, const char* subject, + const char* issuer, const char* fingerprint, DWORD flags) { WCHAR* buffer; WCHAR* caption; int what = IDCANCEL; - buffer = wf_format_text(L"Certificate details:\n" - L"\tCommonName: %S\n" - L"\tSubject: %S\n" - L"\tIssuer: %S\n" - L"\tThumbprint: %S\n" - L"\tHostMismatch: %S\n" - L"\n" - L"The above X.509 certificate could not be verified, possibly because you do not have " - L"the CA certificate in your certificate store, or the certificate has expired. " - L"Please look at the OpenSSL documentation on how to add a private CA to the store.\n" - L"\n" - L"YES\tAccept permanently\n" - L"NO\tAccept for this session only\n" - L"CANCEL\tAbort connection\n", - common_name, subject, issuer, fingerprint, flags & VERIFY_CERT_FLAG_MISMATCH ? "Yes" : "No"); + buffer = wf_format_text( + L"Certificate details:\n" + L"\tCommonName: %S\n" + L"\tSubject: %S\n" + L"\tIssuer: %S\n" + L"\tThumbprint: %S\n" + L"\tHostMismatch: %S\n" + L"\n" + L"The above X.509 certificate could not be verified, possibly because you do not have " + L"the CA certificate in your certificate store, or the certificate has expired. " + L"Please look at the OpenSSL documentation on how to add a private CA to the store.\n" + L"\n" + L"YES\tAccept permanently\n" + L"NO\tAccept for this session only\n" + L"CANCEL\tAbort connection\n", + common_name, subject, issuer, fingerprint, + flags & VERIFY_CERT_FLAG_MISMATCH ? "Yes" : "No"); caption = wf_format_text(L"Verify certificate for %S:%hu", host, port); if (!buffer || !caption) @@ -580,53 +562,48 @@ fail: /* return 1 to accept and store a certificate, 2 to accept * a certificate only for this session, 0 otherwise */ - switch(what) + switch (what) { - case IDYES: - return 1; - case IDNO: - return 2; - default: - return 0; + case IDYES: + return 1; + case IDNO: + return 2; + default: + return 0; } } -static DWORD wf_verify_changed_certificate_ex(freerdp* instance, - const char* host, - UINT16 port, - const char* common_name, - const char* subject, - const char* issuer, - const char* new_fingerprint, - const char* old_subject, - const char* old_issuer, - const char* old_fingerprint, - DWORD flags) +static DWORD wf_verify_changed_certificate_ex(freerdp* instance, const char* host, UINT16 port, + const char* common_name, const char* subject, + const char* issuer, const char* new_fingerprint, + const char* old_subject, const char* old_issuer, + const char* old_fingerprint, DWORD flags) { WCHAR* buffer; WCHAR* caption; int what = IDCANCEL; - buffer = wf_format_text( L"New Certificate details:\n" - L"\tCommonName: %S\n" - L"\tSubject: %S\n" - L"\tIssuer: %S\n" - L"\tThumbprint: %S\n" - L"\tHostMismatch: %S\n" - L"\n" - L"Old Certificate details:\n" - L"\tSubject: %S\n" - L"\tIssuer: %S\n" - L"\tThumbprint: %S" - L"The above X.509 certificate could not be verified, possibly because you do not have " - L"the CA certificate in your certificate store, or the certificate has expired. " - L"Please look at the OpenSSL documentation on how to add a private CA to the store.\n" - L"\n" - L"YES\tAccept permanently\n" - L"NO\tAccept for this session only\n" - L"CANCEL\tAbort connection\n", - common_name, subject, issuer, new_fingerprint, flags & VERIFY_CERT_FLAG_MISMATCH ? "Yes" : "No", - old_subject, old_issuer, old_fingerprint); + buffer = wf_format_text( + L"New Certificate details:\n" + L"\tCommonName: %S\n" + L"\tSubject: %S\n" + L"\tIssuer: %S\n" + L"\tThumbprint: %S\n" + L"\tHostMismatch: %S\n" + L"\n" + L"Old Certificate details:\n" + L"\tSubject: %S\n" + L"\tIssuer: %S\n" + L"\tThumbprint: %S" + L"The above X.509 certificate could not be verified, possibly because you do not have " + L"the CA certificate in your certificate store, or the certificate has expired. " + L"Please look at the OpenSSL documentation on how to add a private CA to the store.\n" + L"\n" + L"YES\tAccept permanently\n" + L"NO\tAccept for this session only\n" + L"CANCEL\tAbort connection\n", + common_name, subject, issuer, new_fingerprint, + flags & VERIFY_CERT_FLAG_MISMATCH ? "Yes" : "No", old_subject, old_issuer, old_fingerprint); caption = wf_format_text(L"Verify certificate change for %S:%hu", host, port); if (!buffer || !caption) @@ -639,14 +616,14 @@ fail: /* return 1 to accept and store a certificate, 2 to accept * a certificate only for this session, 0 otherwise */ - switch(what) + switch (what) { - case IDYES: - return 1; - case IDNO: - return 2; - default: - return 0; + case IDYES: + return 1; + case IDNO: + return 2; + default: + return 0; } } @@ -655,7 +632,7 @@ static DWORD WINAPI wf_input_thread(LPVOID arg) int status; wMessage message; wMessageQueue* queue; - freerdp* instance = (freerdp*) arg; + freerdp* instance = (freerdp*)arg; assert(NULL != instance); status = 1; queue = freerdp_get_message_queue(instance, FREERDP_INPUT_MESSAGE_QUEUE); @@ -664,8 +641,8 @@ static DWORD WINAPI wf_input_thread(LPVOID arg) { while (MessageQueue_Peek(queue, &message, TRUE)) { - status = freerdp_message_queue_process_message(instance, - FREERDP_INPUT_MESSAGE_QUEUE, &message); + status = freerdp_message_queue_process_message(instance, FREERDP_INPUT_MESSAGE_QUEUE, + &message); if (!status) break; @@ -696,9 +673,9 @@ static DWORD WINAPI wf_client_thread(LPVOID lpParam) rdpSettings* settings; BOOL async_input; HANDLE input_thread; - instance = (freerdp*) lpParam; + instance = (freerdp*)lpParam; context = instance->context; - wfc = (wfContext*) instance->context; + wfc = (wfContext*)instance->context; if (!freerdp_connect(instance)) goto end; @@ -709,8 +686,7 @@ static DWORD WINAPI wf_client_thread(LPVOID lpParam) if (async_input) { - if (!(input_thread = CreateThread(NULL, 0, wf_input_thread, - instance, 0, NULL))) + if (!(input_thread = CreateThread(NULL, 0, wf_input_thread, instance, 0, NULL))) { WLog_ERR(TAG, "Failed to create async input thread."); goto disconnect; @@ -739,11 +715,9 @@ static DWORD WINAPI wf_client_thread(LPVOID lpParam) nCount += tmp; } - if (MsgWaitForMultipleObjects(nCount, handles, FALSE, 1000, - QS_ALLINPUT) == WAIT_FAILED) + if (MsgWaitForMultipleObjects(nCount, handles, FALSE, 1000, QS_ALLINPUT) == WAIT_FAILED) { - WLog_ERR(TAG, "wfreerdp_run: WaitForMultipleObjects failed: 0x%08lX", - GetLastError()); + WLog_ERR(TAG, "wfreerdp_run: WaitForMultipleObjects failed: 0x%08lX", GetLastError()); break; } @@ -829,10 +803,9 @@ static DWORD WINAPI wf_keyboard_thread(LPVOID lpParam) BOOL status; wfContext* wfc; HHOOK hook_handle; - wfc = (wfContext*) lpParam; + wfc = (wfContext*)lpParam; assert(NULL != wfc); - hook_handle = SetWindowsHookEx(WH_KEYBOARD_LL, wf_ll_kbd_proc, wfc->hInstance, - 0); + hook_handle = SetWindowsHookEx(WH_KEYBOARD_LL, wf_ll_kbd_proc, wfc->hInstance, 0); if (hook_handle) { @@ -859,7 +832,7 @@ static DWORD WINAPI wf_keyboard_thread(LPVOID lpParam) WLog_DBG(TAG, "Keyboard thread exited."); ExitThread(0); - return (DWORD) NULL; + return (DWORD)NULL; } static rdpSettings* freerdp_client_get_settings(wfContext* wfc) @@ -881,19 +854,18 @@ static int freerdp_client_focus_out(wfContext* wfc) int freerdp_client_set_window_size(wfContext* wfc, int width, int height) { - WLog_DBG(TAG, "freerdp_client_set_window_size %d, %d", width, height); + WLog_DBG(TAG, "freerdp_client_set_window_size %d, %d", width, height); if ((width != wfc->client_width) || (height != wfc->client_height)) { PostThreadMessage(wfc->mainThreadId, WM_SIZE, SIZE_RESTORED, - ((UINT) height << 16) | (UINT) width); + ((UINT)height << 16) | (UINT)width); } return 0; } -void wf_size_scrollbars(wfContext* wfc, UINT32 client_width, - UINT32 client_height) +void wf_size_scrollbars(wfContext* wfc, UINT32 client_width, UINT32 client_height) { if (wfc->disablewindowtracking) return; @@ -925,9 +897,9 @@ void wf_size_scrollbars(wfContext* wfc, UINT32 client_width, { horiz = TRUE; } - else if (horiz - && client_width >= - wfc->context.settings->DesktopWidth/* - GetSystemMetrics(SM_CXVSCROLL)*/) + else if (horiz && + client_width >= + wfc->context.settings->DesktopWidth /* - GetSystemMetrics(SM_CXVSCROLL)*/) { horiz = FALSE; } @@ -936,15 +908,14 @@ void wf_size_scrollbars(wfContext* wfc, UINT32 client_width, { vert = TRUE; } - else if (vert - && client_height >= - wfc->context.settings->DesktopHeight/* - GetSystemMetrics(SM_CYHSCROLL)*/) + else if (vert && + client_height >= + wfc->context.settings->DesktopHeight /* - GetSystemMetrics(SM_CYHSCROLL)*/) { vert = FALSE; } - if (horiz == vert && (horiz != wfc->xScrollVisible - && vert != wfc->yScrollVisible)) + if (horiz == vert && (horiz != wfc->xScrollVisible && vert != wfc->yScrollVisible)) { if (ShowScrollBar(wfc->hwnd, SB_BOTH, horiz)) { @@ -977,11 +948,11 @@ void wf_size_scrollbars(wfContext* wfc, UINT32 client_width, wfc->xMaxScroll = MAX(wfc->context.settings->DesktopWidth - client_width, 0); wfc->xCurrentScroll = MIN(wfc->xCurrentScroll, wfc->xMaxScroll); si.cbSize = sizeof(si); - si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS; - si.nMin = wfc->xMinScroll; - si.nMax = wfc->context.settings->DesktopWidth; - si.nPage = client_width; - si.nPos = wfc->xCurrentScroll; + si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS; + si.nMin = wfc->xMinScroll; + si.nMax = wfc->context.settings->DesktopWidth; + si.nPage = client_width; + si.nPos = wfc->xCurrentScroll; SetScrollInfo(wfc->hwnd, SB_HORZ, &si, TRUE); } @@ -990,15 +961,14 @@ void wf_size_scrollbars(wfContext* wfc, UINT32 client_width, // The vertical scrolling range is defined by // (bitmap_height) - (client_height). The current vertical // scroll value remains within the vertical scrolling range. - wfc->yMaxScroll = MAX(wfc->context.settings->DesktopHeight - client_height, - 0); + wfc->yMaxScroll = MAX(wfc->context.settings->DesktopHeight - client_height, 0); wfc->yCurrentScroll = MIN(wfc->yCurrentScroll, wfc->yMaxScroll); si.cbSize = sizeof(si); - si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS; - si.nMin = wfc->yMinScroll; - si.nMax = wfc->context.settings->DesktopHeight; - si.nPage = client_height; - si.nPos = wfc->yCurrentScroll; + si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS; + si.nMin = wfc->yMinScroll; + si.nMax = wfc->context.settings->DesktopHeight; + si.nPage = client_height; + si.nPos = wfc->yCurrentScroll; SetScrollInfo(wfc->hwnd, SB_VERT, &si, TRUE); } } @@ -1064,10 +1034,10 @@ static int wfreerdp_client_start(rdpContext* context) { HWND hWndParent; HINSTANCE hInstance; - wfContext* wfc = (wfContext*) context; + wfContext* wfc = (wfContext*)context; freerdp* instance = context->instance; hInstance = GetModuleHandle(NULL); - hWndParent = (HWND) instance->settings->ParentWindowId; + hWndParent = (HWND)instance->settings->ParentWindowId; instance->settings->EmbeddedWindow = (hWndParent) ? TRUE : FALSE; wfc->hWndParent = hWndParent; wfc->hInstance = hInstance; @@ -1080,21 +1050,20 @@ static int wfreerdp_client_start(rdpContext* context) wfc->wndClass.cbClsExtra = 0; wfc->wndClass.cbWndExtra = 0; wfc->wndClass.hCursor = wfc->cursor; - wfc->wndClass.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH); + wfc->wndClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); wfc->wndClass.lpszMenuName = NULL; wfc->wndClass.lpszClassName = wfc->wndClassName; wfc->wndClass.hInstance = hInstance; wfc->wndClass.hIcon = wfc->icon; wfc->wndClass.hIconSm = wfc->icon; RegisterClassEx(&(wfc->wndClass)); - wfc->keyboardThread = CreateThread(NULL, 0, wf_keyboard_thread, (void*) wfc, 0, - &wfc->keyboardThreadId); + wfc->keyboardThread = + CreateThread(NULL, 0, wf_keyboard_thread, (void*)wfc, 0, &wfc->keyboardThreadId); if (!wfc->keyboardThread) return -1; - wfc->thread = CreateThread(NULL, 0, wf_client_thread, (void*) instance, 0, - &wfc->mainThreadId); + wfc->thread = CreateThread(NULL, 0, wf_client_thread, (void*)instance, 0, &wfc->mainThreadId); if (!wfc->thread) return -1; @@ -1104,7 +1073,7 @@ static int wfreerdp_client_start(rdpContext* context) static int wfreerdp_client_stop(rdpContext* context) { - wfContext* wfc = (wfContext*) context; + wfContext* wfc = (wfContext*)context; if (wfc->thread) { diff --git a/client/Windows/wf_client.h b/client/Windows/wf_client.h index ad8e32773..29f194a8e 100644 --- a/client/Windows/wf_client.h +++ b/client/Windows/wf_client.h @@ -48,102 +48,101 @@ typedef struct wf_context wfContext; #include "wf_cliprdr.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif // System menu constants #define SYSCOMMAND_ID_SMARTSIZING 1000 -struct wf_bitmap -{ - rdpBitmap _bitmap; - HDC hdc; - HBITMAP bitmap; - HBITMAP org_bitmap; - BYTE* pdata; -}; -typedef struct wf_bitmap wfBitmap; + struct wf_bitmap + { + rdpBitmap _bitmap; + HDC hdc; + HBITMAP bitmap; + HBITMAP org_bitmap; + BYTE* pdata; + }; + typedef struct wf_bitmap wfBitmap; -struct wf_pointer -{ - rdpPointer pointer; - HCURSOR cursor; -}; -typedef struct wf_pointer wfPointer; + struct wf_pointer + { + rdpPointer pointer; + HCURSOR cursor; + }; + typedef struct wf_pointer wfPointer; -struct wf_context -{ - rdpContext context; - DEFINE_RDP_CLIENT_COMMON(); + struct wf_context + { + rdpContext context; + DEFINE_RDP_CLIENT_COMMON(); - int offset_x; - int offset_y; - int fullscreen_toggle; - int fullscreen; - int percentscreen; - WCHAR* window_title; - int client_x; - int client_y; - int client_width; - int client_height; + int offset_x; + int offset_y; + int fullscreen_toggle; + int fullscreen; + int percentscreen; + WCHAR* window_title; + int client_x; + int client_y; + int client_width; + int client_height; - HANDLE keyboardThread; + HANDLE keyboardThread; - HICON icon; - HWND hWndParent; - HINSTANCE hInstance; - WNDCLASSEX wndClass; - LPCTSTR wndClassName; - HCURSOR hDefaultCursor; + HICON icon; + HWND hWndParent; + HINSTANCE hInstance; + WNDCLASSEX wndClass; + LPCTSTR wndClassName; + HCURSOR hDefaultCursor; - HWND hwnd; - POINT diff; + HWND hwnd; + POINT diff; - wfBitmap* primary; - wfBitmap* drawing; - HCURSOR cursor; - HBRUSH brush; - HBRUSH org_brush; - RECT update_rect; - RECT scale_update_rect; + wfBitmap* primary; + wfBitmap* drawing; + HCURSOR cursor; + HBRUSH brush; + HBRUSH org_brush; + RECT update_rect; + RECT scale_update_rect; - DWORD mainThreadId; - DWORD keyboardThreadId; + DWORD mainThreadId; + DWORD keyboardThreadId; - rdpFile* connectionRdpFile; + rdpFile* connectionRdpFile; - BOOL disablewindowtracking; + BOOL disablewindowtracking; - BOOL updating_scrollbars; - BOOL xScrollVisible; - int xMinScroll; - int xCurrentScroll; - int xMaxScroll; + BOOL updating_scrollbars; + BOOL xScrollVisible; + int xMinScroll; + int xCurrentScroll; + int xMaxScroll; - BOOL yScrollVisible; - int yMinScroll; - int yCurrentScroll; - int yMaxScroll; + BOOL yScrollVisible; + int yMinScroll; + int yCurrentScroll; + int yMaxScroll; - void* clipboard; - CliprdrClientContext* cliprdr; + void* clipboard; + CliprdrClientContext* cliprdr; - wfFloatBar* floatbar; + wfFloatBar* floatbar; - RailClientContext* rail; - wHashTable* railWindows; - BOOL isConsole; -}; + RailClientContext* rail; + wHashTable* railWindows; + BOOL isConsole; + }; -/** - * Client Interface - */ + /** + * Client Interface + */ -FREERDP_API int RdpClientEntry(RDP_CLIENT_ENTRY_POINTS* pEntryPoints); -FREERDP_API int freerdp_client_set_window_size(wfContext* wfc, int width, - int height); -FREERDP_API void wf_size_scrollbars(wfContext* wfc, UINT32 client_width, - UINT32 client_height); + FREERDP_API int RdpClientEntry(RDP_CLIENT_ENTRY_POINTS* pEntryPoints); + FREERDP_API int freerdp_client_set_window_size(wfContext* wfc, int width, int height); + FREERDP_API void wf_size_scrollbars(wfContext* wfc, UINT32 client_width, UINT32 client_height); #ifdef __cplusplus } diff --git a/client/Windows/wf_cliprdr.c b/client/Windows/wf_cliprdr.c index da6430286..d1824172a 100644 --- a/client/Windows/wf_cliprdr.c +++ b/client/Windows/wf_cliprdr.c @@ -50,13 +50,16 @@ #ifdef WITH_DEBUG_CLIPRDR #define DEBUG_CLIPRDR(...) WLog_DBG(TAG, __VA_ARGS__) #else -#define DEBUG_CLIPRDR(...) do { } while (0) +#define DEBUG_CLIPRDR(...) \ + do \ + { \ + } while (0) #endif -typedef BOOL (WINAPI* fnAddClipboardFormatListener)(HWND hwnd); -typedef BOOL (WINAPI* fnRemoveClipboardFormatListener)(HWND hwnd); -typedef BOOL (WINAPI* fnGetUpdatedClipboardFormats)(PUINT lpuiFormats, - UINT cFormats, PUINT pcFormatsOut); +typedef BOOL(WINAPI* fnAddClipboardFormatListener)(HWND hwnd); +typedef BOOL(WINAPI* fnRemoveClipboardFormatListener)(HWND hwnd); +typedef BOOL(WINAPI* fnGetUpdatedClipboardFormats)(PUINT lpuiFormats, UINT cFormats, + PUINT pcFormatsOut); struct format_mapping { @@ -143,25 +146,22 @@ struct wf_clipboard }; typedef struct wf_clipboard wfClipboard; -#define WM_CLIPRDR_MESSAGE (WM_USER + 156) -#define OLE_SETCLIPBOARD 1 +#define WM_CLIPRDR_MESSAGE (WM_USER + 156) +#define OLE_SETCLIPBOARD 1 -static BOOL wf_create_file_obj(wfClipboard* cliprdrrdr, - IDataObject** ppDataObject); +static BOOL wf_create_file_obj(wfClipboard* cliprdrrdr, IDataObject** ppDataObject); static void wf_destroy_file_obj(IDataObject* instance); static UINT32 get_remote_format_id(wfClipboard* clipboard, UINT32 local_format); static UINT cliprdr_send_data_request(wfClipboard* clipboard, UINT32 format); static UINT cliprdr_send_lock(wfClipboard* clipboard); static UINT cliprdr_send_unlock(wfClipboard* clipboard); -static UINT cliprdr_send_request_filecontents(wfClipboard* clipboard, - const void* streamid, - ULONG index, UINT32 flag, DWORD positionhigh, - DWORD positionlow, ULONG request); +static UINT cliprdr_send_request_filecontents(wfClipboard* clipboard, const void* streamid, + ULONG index, UINT32 flag, DWORD positionhigh, + DWORD positionlow, ULONG request); static void CliprdrDataObject_Delete(CliprdrDataObject* instance); -static CliprdrEnumFORMATETC* CliprdrEnumFORMATETC_New(ULONG nFormats, - FORMATETC* pFormatEtc); +static CliprdrEnumFORMATETC* CliprdrEnumFORMATETC_New(ULONG nFormats, FORMATETC* pFormatEtc); static void CliprdrEnumFORMATETC_Delete(CliprdrEnumFORMATETC* instance); static void CliprdrStream_Delete(CliprdrStream* instance); @@ -170,8 +170,8 @@ static void CliprdrStream_Delete(CliprdrStream* instance); * IStream */ -static HRESULT STDMETHODCALLTYPE CliprdrStream_QueryInterface(IStream* This, - REFIID riid, void** ppvObject) +static HRESULT STDMETHODCALLTYPE CliprdrStream_QueryInterface(IStream* This, REFIID riid, + void** ppvObject) { if (IsEqualIID(riid, &IID_IStream) || IsEqualIID(riid, &IID_IUnknown)) { @@ -188,7 +188,7 @@ static HRESULT STDMETHODCALLTYPE CliprdrStream_QueryInterface(IStream* This, static ULONG STDMETHODCALLTYPE CliprdrStream_AddRef(IStream* This) { - CliprdrStream* instance = (CliprdrStream*) This; + CliprdrStream* instance = (CliprdrStream*)This; if (!instance) return 0; @@ -199,7 +199,7 @@ static ULONG STDMETHODCALLTYPE CliprdrStream_AddRef(IStream* This) static ULONG STDMETHODCALLTYPE CliprdrStream_Release(IStream* This) { LONG count; - CliprdrStream* instance = (CliprdrStream*) This; + CliprdrStream* instance = (CliprdrStream*)This; if (!instance) return 0; @@ -217,25 +217,25 @@ static ULONG STDMETHODCALLTYPE CliprdrStream_Release(IStream* This) } } -static HRESULT STDMETHODCALLTYPE CliprdrStream_Read(IStream* This, void* pv, - ULONG cb, ULONG* pcbRead) +static HRESULT STDMETHODCALLTYPE CliprdrStream_Read(IStream* This, void* pv, ULONG cb, + ULONG* pcbRead) { int ret; - CliprdrStream* instance = (CliprdrStream*) This; + CliprdrStream* instance = (CliprdrStream*)This; wfClipboard* clipboard; if (!pv || !pcbRead || !instance) return E_INVALIDARG; - clipboard = (wfClipboard*) instance->m_pData; + clipboard = (wfClipboard*)instance->m_pData; *pcbRead = 0; if (instance->m_lOffset.QuadPart >= instance->m_lSize.QuadPart) return S_FALSE; - ret = cliprdr_send_request_filecontents(clipboard, (void*) This, - instance->m_lIndex, FILECONTENTS_RANGE, - instance->m_lOffset.HighPart, instance->m_lOffset.LowPart, cb); + ret = cliprdr_send_request_filecontents(clipboard, (void*)This, instance->m_lIndex, + FILECONTENTS_RANGE, instance->m_lOffset.HighPart, + instance->m_lOffset.LowPart, cb); if (ret < 0) return E_FAIL; @@ -255,9 +255,8 @@ static HRESULT STDMETHODCALLTYPE CliprdrStream_Read(IStream* This, void* pv, return S_OK; } -static HRESULT STDMETHODCALLTYPE CliprdrStream_Write(IStream* This, - const void* pv, - ULONG cb, ULONG* pcbWritten) +static HRESULT STDMETHODCALLTYPE CliprdrStream_Write(IStream* This, const void* pv, ULONG cb, + ULONG* pcbWritten) { (void)This; (void)pv; @@ -266,12 +265,11 @@ static HRESULT STDMETHODCALLTYPE CliprdrStream_Write(IStream* This, return STG_E_ACCESSDENIED; } -static HRESULT STDMETHODCALLTYPE CliprdrStream_Seek(IStream* This, - LARGE_INTEGER dlibMove, - DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition) +static HRESULT STDMETHODCALLTYPE CliprdrStream_Seek(IStream* This, LARGE_INTEGER dlibMove, + DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition) { ULONGLONG newoffset; - CliprdrStream* instance = (CliprdrStream*) This; + CliprdrStream* instance = (CliprdrStream*)This; if (!instance) return E_INVALIDARG; @@ -307,18 +305,16 @@ static HRESULT STDMETHODCALLTYPE CliprdrStream_Seek(IStream* This, return S_OK; } -static HRESULT STDMETHODCALLTYPE CliprdrStream_SetSize(IStream* This, - ULARGE_INTEGER libNewSize) +static HRESULT STDMETHODCALLTYPE CliprdrStream_SetSize(IStream* This, ULARGE_INTEGER libNewSize) { (void)This; (void)libNewSize; return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE CliprdrStream_CopyTo(IStream* This, - IStream* pstm, - ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, - ULARGE_INTEGER* pcbWritten) +static HRESULT STDMETHODCALLTYPE CliprdrStream_CopyTo(IStream* This, IStream* pstm, + ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, + ULARGE_INTEGER* pcbWritten) { (void)This; (void)pstm; @@ -328,8 +324,7 @@ static HRESULT STDMETHODCALLTYPE CliprdrStream_CopyTo(IStream* This, return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE CliprdrStream_Commit(IStream* This, - DWORD grfCommitFlags) +static HRESULT STDMETHODCALLTYPE CliprdrStream_Commit(IStream* This, DWORD grfCommitFlags) { (void)This; (void)grfCommitFlags; @@ -342,9 +337,8 @@ static HRESULT STDMETHODCALLTYPE CliprdrStream_Revert(IStream* This) return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE CliprdrStream_LockRegion(IStream* This, - ULARGE_INTEGER libOffset, - ULARGE_INTEGER cb, DWORD dwLockType) +static HRESULT STDMETHODCALLTYPE CliprdrStream_LockRegion(IStream* This, ULARGE_INTEGER libOffset, + ULARGE_INTEGER cb, DWORD dwLockType) { (void)This; (void)libOffset; @@ -353,9 +347,8 @@ static HRESULT STDMETHODCALLTYPE CliprdrStream_LockRegion(IStream* This, return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE CliprdrStream_UnlockRegion(IStream* This, - ULARGE_INTEGER libOffset, - ULARGE_INTEGER cb, DWORD dwLockType) +static HRESULT STDMETHODCALLTYPE CliprdrStream_UnlockRegion(IStream* This, ULARGE_INTEGER libOffset, + ULARGE_INTEGER cb, DWORD dwLockType) { (void)This; (void)libOffset; @@ -364,10 +357,10 @@ static HRESULT STDMETHODCALLTYPE CliprdrStream_UnlockRegion(IStream* This, return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE CliprdrStream_Stat(IStream* This, - STATSTG* pstatstg, DWORD grfStatFlag) +static HRESULT STDMETHODCALLTYPE CliprdrStream_Stat(IStream* This, STATSTG* pstatstg, + DWORD grfStatFlag) { - CliprdrStream* instance = (CliprdrStream*) This; + CliprdrStream* instance = (CliprdrStream*)This; if (!instance) return E_INVALIDARG; @@ -400,29 +393,27 @@ static HRESULT STDMETHODCALLTYPE CliprdrStream_Stat(IStream* This, return S_OK; } -static HRESULT STDMETHODCALLTYPE CliprdrStream_Clone(IStream* This, - IStream** ppstm) +static HRESULT STDMETHODCALLTYPE CliprdrStream_Clone(IStream* This, IStream** ppstm) { (void)This; (void)ppstm; return E_NOTIMPL; } -static CliprdrStream* CliprdrStream_New(ULONG index, void* pData, - const FILEDESCRIPTORW* dsc) +static CliprdrStream* CliprdrStream_New(ULONG index, void* pData, const FILEDESCRIPTORW* dsc) { IStream* iStream; BOOL success = FALSE; BOOL isDir = FALSE; CliprdrStream* instance; - wfClipboard* clipboard = (wfClipboard*) pData; - instance = (CliprdrStream*) calloc(1, sizeof(CliprdrStream)); + wfClipboard* clipboard = (wfClipboard*)pData; + instance = (CliprdrStream*)calloc(1, sizeof(CliprdrStream)); if (instance) { instance->m_Dsc = *dsc; iStream = &instance->iStream; - iStream->lpVtbl = (IStreamVtbl*) calloc(1, sizeof(IStreamVtbl)); + iStream->lpVtbl = (IStreamVtbl*)calloc(1, sizeof(IStreamVtbl)); if (iStream->lpVtbl) { @@ -454,14 +445,14 @@ static CliprdrStream* CliprdrStream_New(ULONG index, void* pData, if (((instance->m_Dsc.dwFlags & FD_FILESIZE) == 0) && !isDir) { /* get content size of this stream */ - if (cliprdr_send_request_filecontents(clipboard, (void*) instance, - instance->m_lIndex, - FILECONTENTS_SIZE, 0, 0, 8) == CHANNEL_RC_OK) + if (cliprdr_send_request_filecontents(clipboard, (void*)instance, + instance->m_lIndex, FILECONTENTS_SIZE, 0, 0, + 8) == CHANNEL_RC_OK) { success = TRUE; } - instance->m_lSize.QuadPart = *((LONGLONG*) clipboard->req_fdata); + instance->m_lSize.QuadPart = *((LONGLONG*)clipboard->req_fdata); free(clipboard->req_fdata); } else @@ -491,8 +482,7 @@ void CliprdrStream_Delete(CliprdrStream* instance) * IDataObject */ -static LONG cliprdr_lookup_format(CliprdrDataObject* instance, - FORMATETC* pFormatEtc) +static LONG cliprdr_lookup_format(CliprdrDataObject* instance, FORMATETC* pFormatEtc) { ULONG i; @@ -512,8 +502,8 @@ static LONG cliprdr_lookup_format(CliprdrDataObject* instance, return -1; } -static HRESULT STDMETHODCALLTYPE CliprdrDataObject_QueryInterface( - IDataObject* This, REFIID riid, void** ppvObject) +static HRESULT STDMETHODCALLTYPE CliprdrDataObject_QueryInterface(IDataObject* This, REFIID riid, + void** ppvObject) { (void)This; @@ -535,7 +525,7 @@ static HRESULT STDMETHODCALLTYPE CliprdrDataObject_QueryInterface( static ULONG STDMETHODCALLTYPE CliprdrDataObject_AddRef(IDataObject* This) { - CliprdrDataObject* instance = (CliprdrDataObject*) This; + CliprdrDataObject* instance = (CliprdrDataObject*)This; if (!instance) return E_INVALIDARG; @@ -546,7 +536,7 @@ static ULONG STDMETHODCALLTYPE CliprdrDataObject_AddRef(IDataObject* This) static ULONG STDMETHODCALLTYPE CliprdrDataObject_Release(IDataObject* This) { LONG count; - CliprdrDataObject* instance = (CliprdrDataObject*) This; + CliprdrDataObject* instance = (CliprdrDataObject*)This; if (!instance) return E_INVALIDARG; @@ -562,18 +552,18 @@ static ULONG STDMETHODCALLTYPE CliprdrDataObject_Release(IDataObject* This) return count; } -static HRESULT STDMETHODCALLTYPE CliprdrDataObject_GetData( - IDataObject* This, FORMATETC* pFormatEtc, STGMEDIUM* pMedium) +static HRESULT STDMETHODCALLTYPE CliprdrDataObject_GetData(IDataObject* This, FORMATETC* pFormatEtc, + STGMEDIUM* pMedium) { ULONG i; LONG idx; - CliprdrDataObject* instance = (CliprdrDataObject*) This; + CliprdrDataObject* instance = (CliprdrDataObject*)This; wfClipboard* clipboard; if (!pFormatEtc || !pMedium || !instance) return E_INVALIDARG; - clipboard = (wfClipboard*) instance->m_pData; + clipboard = (wfClipboard*)instance->m_pData; if (!clipboard) return E_INVALIDARG; @@ -584,22 +574,19 @@ static HRESULT STDMETHODCALLTYPE CliprdrDataObject_GetData( pMedium->tymed = instance->m_pFormatEtc[idx].tymed; pMedium->pUnkForRelease = 0; - if (instance->m_pFormatEtc[idx].cfFormat == RegisterClipboardFormat( - CFSTR_FILEDESCRIPTORW)) + if (instance->m_pFormatEtc[idx].cfFormat == RegisterClipboardFormat(CFSTR_FILEDESCRIPTORW)) { FILEGROUPDESCRIPTOR* dsc; - DWORD remote = get_remote_format_id(clipboard, - instance->m_pFormatEtc[idx].cfFormat); + DWORD remote = get_remote_format_id(clipboard, instance->m_pFormatEtc[idx].cfFormat); if (cliprdr_send_data_request(clipboard, remote) != 0) return E_UNEXPECTED; - pMedium->hGlobal = - clipboard->hmem; /* points to a FILEGROUPDESCRIPTOR structure */ + pMedium->hGlobal = clipboard->hmem; /* points to a FILEGROUPDESCRIPTOR structure */ /* GlobalLock returns a pointer to the first byte of the memory block, - * in which is a FILEGROUPDESCRIPTOR structure, whose first UINT member - * is the number of FILEDESCRIPTOR's */ - dsc = (FILEGROUPDESCRIPTOR*) GlobalLock(clipboard->hmem); + * in which is a FILEGROUPDESCRIPTOR structure, whose first UINT member + * is the number of FILEDESCRIPTOR's */ + dsc = (FILEGROUPDESCRIPTOR*)GlobalLock(clipboard->hmem); instance->m_nStreams = dsc->cItems; GlobalUnlock(clipboard->hmem); @@ -607,15 +594,14 @@ static HRESULT STDMETHODCALLTYPE CliprdrDataObject_GetData( { if (!instance->m_pStream) { - instance->m_pStream = (LPSTREAM*) calloc(instance->m_nStreams, - sizeof(LPSTREAM)); + instance->m_pStream = (LPSTREAM*)calloc(instance->m_nStreams, sizeof(LPSTREAM)); if (instance->m_pStream) { for (i = 0; i < instance->m_nStreams; i++) { - instance->m_pStream[i] = (IStream*) CliprdrStream_New(i, clipboard, - &dsc->fgd[i]); + instance->m_pStream[i] = + (IStream*)CliprdrStream_New(i, clipboard, &dsc->fgd[i]); if (!instance->m_pStream[i]) return E_OUTOFMEMORY; @@ -636,8 +622,7 @@ static HRESULT STDMETHODCALLTYPE CliprdrDataObject_GetData( return E_OUTOFMEMORY; } } - else if (instance->m_pFormatEtc[idx].cfFormat == RegisterClipboardFormat( - CFSTR_FILECONTENTS)) + else if (instance->m_pFormatEtc[idx].cfFormat == RegisterClipboardFormat(CFSTR_FILECONTENTS)) { if (pFormatEtc->lindex < instance->m_nStreams) { @@ -653,8 +638,9 @@ static HRESULT STDMETHODCALLTYPE CliprdrDataObject_GetData( return S_OK; } -static HRESULT STDMETHODCALLTYPE CliprdrDataObject_GetDataHere( - IDataObject* This, FORMATETC* pformatetc, STGMEDIUM* pmedium) +static HRESULT STDMETHODCALLTYPE CliprdrDataObject_GetDataHere(IDataObject* This, + FORMATETC* pformatetc, + STGMEDIUM* pmedium) { (void)This; (void)pformatetc; @@ -662,10 +648,10 @@ static HRESULT STDMETHODCALLTYPE CliprdrDataObject_GetDataHere( return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE CliprdrDataObject_QueryGetData( - IDataObject* This, FORMATETC* pformatetc) +static HRESULT STDMETHODCALLTYPE CliprdrDataObject_QueryGetData(IDataObject* This, + FORMATETC* pformatetc) { - CliprdrDataObject* instance = (CliprdrDataObject*) This; + CliprdrDataObject* instance = (CliprdrDataObject*)This; if (!pformatetc) return E_INVALIDARG; @@ -676,8 +662,9 @@ static HRESULT STDMETHODCALLTYPE CliprdrDataObject_QueryGetData( return S_OK; } -static HRESULT STDMETHODCALLTYPE CliprdrDataObject_GetCanonicalFormatEtc( - IDataObject* This, FORMATETC* pformatectIn, FORMATETC* pformatetcOut) +static HRESULT STDMETHODCALLTYPE CliprdrDataObject_GetCanonicalFormatEtc(IDataObject* This, + FORMATETC* pformatectIn, + FORMATETC* pformatetcOut) { (void)This; (void)pformatectIn; @@ -689,8 +676,8 @@ static HRESULT STDMETHODCALLTYPE CliprdrDataObject_GetCanonicalFormatEtc( return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE CliprdrDataObject_SetData( - IDataObject* This, FORMATETC* pformatetc, STGMEDIUM* pmedium, BOOL fRelease) +static HRESULT STDMETHODCALLTYPE CliprdrDataObject_SetData(IDataObject* This, FORMATETC* pformatetc, + STGMEDIUM* pmedium, BOOL fRelease) { (void)This; (void)pformatetc; @@ -699,18 +686,19 @@ static HRESULT STDMETHODCALLTYPE CliprdrDataObject_SetData( return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE CliprdrDataObject_EnumFormatEtc( - IDataObject* This, DWORD dwDirection, IEnumFORMATETC** ppenumFormatEtc) +static HRESULT STDMETHODCALLTYPE CliprdrDataObject_EnumFormatEtc(IDataObject* This, + DWORD dwDirection, + IEnumFORMATETC** ppenumFormatEtc) { - CliprdrDataObject* instance = (CliprdrDataObject*) This; + CliprdrDataObject* instance = (CliprdrDataObject*)This; if (!instance || !ppenumFormatEtc) return E_INVALIDARG; if (dwDirection == DATADIR_GET) { - *ppenumFormatEtc = (IEnumFORMATETC*) CliprdrEnumFORMATETC_New( - instance->m_nNumFormats, instance->m_pFormatEtc); + *ppenumFormatEtc = (IEnumFORMATETC*)CliprdrEnumFORMATETC_New(instance->m_nNumFormats, + instance->m_pFormatEtc); return (*ppenumFormatEtc) ? S_OK : E_OUTOFMEMORY; } else @@ -719,9 +707,9 @@ static HRESULT STDMETHODCALLTYPE CliprdrDataObject_EnumFormatEtc( } } -static HRESULT STDMETHODCALLTYPE CliprdrDataObject_DAdvise( - IDataObject* This, FORMATETC* pformatetc, DWORD advf, - IAdviseSink* pAdvSink, DWORD* pdwConnection) +static HRESULT STDMETHODCALLTYPE CliprdrDataObject_DAdvise(IDataObject* This, FORMATETC* pformatetc, + DWORD advf, IAdviseSink* pAdvSink, + DWORD* pdwConnection) { (void)This; (void)pformatetc; @@ -731,35 +719,34 @@ static HRESULT STDMETHODCALLTYPE CliprdrDataObject_DAdvise( return OLE_E_ADVISENOTSUPPORTED; } -static HRESULT STDMETHODCALLTYPE CliprdrDataObject_DUnadvise( - IDataObject* This, DWORD dwConnection) +static HRESULT STDMETHODCALLTYPE CliprdrDataObject_DUnadvise(IDataObject* This, DWORD dwConnection) { (void)This; (void)dwConnection; return OLE_E_ADVISENOTSUPPORTED; } -static HRESULT STDMETHODCALLTYPE CliprdrDataObject_EnumDAdvise( - IDataObject* This, IEnumSTATDATA** ppenumAdvise) +static HRESULT STDMETHODCALLTYPE CliprdrDataObject_EnumDAdvise(IDataObject* This, + IEnumSTATDATA** ppenumAdvise) { (void)This; (void)ppenumAdvise; return OLE_E_ADVISENOTSUPPORTED; } -static CliprdrDataObject* CliprdrDataObject_New( - FORMATETC* fmtetc, STGMEDIUM* stgmed, ULONG count, void* data) +static CliprdrDataObject* CliprdrDataObject_New(FORMATETC* fmtetc, STGMEDIUM* stgmed, ULONG count, + void* data) { int i; CliprdrDataObject* instance; IDataObject* iDataObject; - instance = (CliprdrDataObject*) calloc(1, sizeof(CliprdrDataObject)); + instance = (CliprdrDataObject*)calloc(1, sizeof(CliprdrDataObject)); if (!instance) goto error; iDataObject = &instance->iDataObject; - iDataObject->lpVtbl = (IDataObjectVtbl*) calloc(1, sizeof(IDataObjectVtbl)); + iDataObject->lpVtbl = (IDataObjectVtbl*)calloc(1, sizeof(IDataObjectVtbl)); if (!iDataObject->lpVtbl) goto error; @@ -770,8 +757,7 @@ static CliprdrDataObject* CliprdrDataObject_New( iDataObject->lpVtbl->GetData = CliprdrDataObject_GetData; iDataObject->lpVtbl->GetDataHere = CliprdrDataObject_GetDataHere; iDataObject->lpVtbl->QueryGetData = CliprdrDataObject_QueryGetData; - iDataObject->lpVtbl->GetCanonicalFormatEtc = - CliprdrDataObject_GetCanonicalFormatEtc; + iDataObject->lpVtbl->GetCanonicalFormatEtc = CliprdrDataObject_GetCanonicalFormatEtc; iDataObject->lpVtbl->SetData = CliprdrDataObject_SetData; iDataObject->lpVtbl->EnumFormatEtc = CliprdrDataObject_EnumFormatEtc; iDataObject->lpVtbl->DAdvise = CliprdrDataObject_DAdvise; @@ -785,12 +771,12 @@ static CliprdrDataObject* CliprdrDataObject_New( if (count > 0) { - instance->m_pFormatEtc = (FORMATETC*) calloc(count, sizeof(FORMATETC)); + instance->m_pFormatEtc = (FORMATETC*)calloc(count, sizeof(FORMATETC)); if (!instance->m_pFormatEtc) goto error; - instance->m_pStgMedium = (STGMEDIUM*) calloc(count, sizeof(STGMEDIUM)); + instance->m_pStgMedium = (STGMEDIUM*)calloc(count, sizeof(STGMEDIUM)); if (!instance->m_pStgMedium) goto error; @@ -830,8 +816,7 @@ void CliprdrDataObject_Delete(CliprdrDataObject* instance) } } -static BOOL wf_create_file_obj(wfClipboard* clipboard, - IDataObject** ppDataObject) +static BOOL wf_create_file_obj(wfClipboard* clipboard, IDataObject** ppDataObject) { FORMATETC fmtetc[2]; STGMEDIUM stgmeds[2]; @@ -855,8 +840,7 @@ static BOOL wf_create_file_obj(wfClipboard* clipboard, stgmeds[1].tymed = TYMED_ISTREAM; stgmeds[1].pstm = NULL; stgmeds[1].pUnkForRelease = NULL; - *ppDataObject = (IDataObject*) CliprdrDataObject_New(fmtetc, stgmeds, 2, - clipboard); + *ppDataObject = (IDataObject*)CliprdrDataObject_New(fmtetc, stgmeds, 2, clipboard); return (*ppDataObject) ? TRUE : FALSE; } @@ -876,15 +860,15 @@ static void cliprdr_format_deep_copy(FORMATETC* dest, FORMATETC* source) if (source->ptd) { - dest->ptd = (DVTARGETDEVICE*) CoTaskMemAlloc(sizeof(DVTARGETDEVICE)); + dest->ptd = (DVTARGETDEVICE*)CoTaskMemAlloc(sizeof(DVTARGETDEVICE)); if (dest->ptd) *(dest->ptd) = *(source->ptd); } } -static HRESULT STDMETHODCALLTYPE CliprdrEnumFORMATETC_QueryInterface( - IEnumFORMATETC* This, REFIID riid, void** ppvObject) +static HRESULT STDMETHODCALLTYPE CliprdrEnumFORMATETC_QueryInterface(IEnumFORMATETC* This, + REFIID riid, void** ppvObject) { (void)This; @@ -903,7 +887,7 @@ static HRESULT STDMETHODCALLTYPE CliprdrEnumFORMATETC_QueryInterface( static ULONG STDMETHODCALLTYPE CliprdrEnumFORMATETC_AddRef(IEnumFORMATETC* This) { - CliprdrEnumFORMATETC* instance = (CliprdrEnumFORMATETC*) This; + CliprdrEnumFORMATETC* instance = (CliprdrEnumFORMATETC*)This; if (!instance) return 0; @@ -911,11 +895,10 @@ static ULONG STDMETHODCALLTYPE CliprdrEnumFORMATETC_AddRef(IEnumFORMATETC* This) return InterlockedIncrement(&instance->m_lRefCount); } -static ULONG STDMETHODCALLTYPE CliprdrEnumFORMATETC_Release( - IEnumFORMATETC* This) +static ULONG STDMETHODCALLTYPE CliprdrEnumFORMATETC_Release(IEnumFORMATETC* This) { LONG count; - CliprdrEnumFORMATETC* instance = (CliprdrEnumFORMATETC*) This; + CliprdrEnumFORMATETC* instance = (CliprdrEnumFORMATETC*)This; if (!instance) return 0; @@ -933,20 +916,18 @@ static ULONG STDMETHODCALLTYPE CliprdrEnumFORMATETC_Release( } } -static HRESULT STDMETHODCALLTYPE CliprdrEnumFORMATETC_Next(IEnumFORMATETC* This, - ULONG celt, - FORMATETC* rgelt, ULONG* pceltFetched) +static HRESULT STDMETHODCALLTYPE CliprdrEnumFORMATETC_Next(IEnumFORMATETC* This, ULONG celt, + FORMATETC* rgelt, ULONG* pceltFetched) { - ULONG copied = 0; - CliprdrEnumFORMATETC* instance = (CliprdrEnumFORMATETC*) This; + ULONG copied = 0; + CliprdrEnumFORMATETC* instance = (CliprdrEnumFORMATETC*)This; if (!instance || !celt || !rgelt) return E_INVALIDARG; while ((instance->m_nIndex < instance->m_nNumFormats) && (copied < celt)) { - cliprdr_format_deep_copy(&rgelt[copied++], - &instance->m_pFormatEtc[instance->m_nIndex++]); + cliprdr_format_deep_copy(&rgelt[copied++], &instance->m_pFormatEtc[instance->m_nIndex++]); } if (pceltFetched != 0) @@ -955,25 +936,23 @@ static HRESULT STDMETHODCALLTYPE CliprdrEnumFORMATETC_Next(IEnumFORMATETC* This, return (copied == celt) ? S_OK : E_FAIL; } -static HRESULT STDMETHODCALLTYPE CliprdrEnumFORMATETC_Skip(IEnumFORMATETC* This, - ULONG celt) +static HRESULT STDMETHODCALLTYPE CliprdrEnumFORMATETC_Skip(IEnumFORMATETC* This, ULONG celt) { - CliprdrEnumFORMATETC* instance = (CliprdrEnumFORMATETC*) This; + CliprdrEnumFORMATETC* instance = (CliprdrEnumFORMATETC*)This; if (!instance) return E_INVALIDARG; - if (instance->m_nIndex + (LONG) celt > instance->m_nNumFormats) + if (instance->m_nIndex + (LONG)celt > instance->m_nNumFormats) return E_FAIL; instance->m_nIndex += celt; return S_OK; } -static HRESULT STDMETHODCALLTYPE CliprdrEnumFORMATETC_Reset( - IEnumFORMATETC* This) +static HRESULT STDMETHODCALLTYPE CliprdrEnumFORMATETC_Reset(IEnumFORMATETC* This) { - CliprdrEnumFORMATETC* instance = (CliprdrEnumFORMATETC*) This; + CliprdrEnumFORMATETC* instance = (CliprdrEnumFORMATETC*)This; if (!instance) return E_INVALIDARG; @@ -982,26 +961,25 @@ static HRESULT STDMETHODCALLTYPE CliprdrEnumFORMATETC_Reset( return S_OK; } -static HRESULT STDMETHODCALLTYPE CliprdrEnumFORMATETC_Clone( - IEnumFORMATETC* This, IEnumFORMATETC** ppEnum) +static HRESULT STDMETHODCALLTYPE CliprdrEnumFORMATETC_Clone(IEnumFORMATETC* This, + IEnumFORMATETC** ppEnum) { - CliprdrEnumFORMATETC* instance = (CliprdrEnumFORMATETC*) This; + CliprdrEnumFORMATETC* instance = (CliprdrEnumFORMATETC*)This; if (!instance || !ppEnum) return E_INVALIDARG; - *ppEnum = (IEnumFORMATETC*) CliprdrEnumFORMATETC_New(instance->m_nNumFormats, - instance->m_pFormatEtc); + *ppEnum = + (IEnumFORMATETC*)CliprdrEnumFORMATETC_New(instance->m_nNumFormats, instance->m_pFormatEtc); if (!*ppEnum) return E_OUTOFMEMORY; - ((CliprdrEnumFORMATETC*) *ppEnum)->m_nIndex = instance->m_nIndex; + ((CliprdrEnumFORMATETC*)*ppEnum)->m_nIndex = instance->m_nIndex; return S_OK; } -CliprdrEnumFORMATETC* CliprdrEnumFORMATETC_New(ULONG nFormats, - FORMATETC* pFormatEtc) +CliprdrEnumFORMATETC* CliprdrEnumFORMATETC_New(ULONG nFormats, FORMATETC* pFormatEtc) { ULONG i; CliprdrEnumFORMATETC* instance; @@ -1010,14 +988,13 @@ CliprdrEnumFORMATETC* CliprdrEnumFORMATETC_New(ULONG nFormats, if ((nFormats != 0) && !pFormatEtc) return NULL; - instance = (CliprdrEnumFORMATETC*) calloc(1, sizeof(CliprdrEnumFORMATETC)); + instance = (CliprdrEnumFORMATETC*)calloc(1, sizeof(CliprdrEnumFORMATETC)); if (!instance) goto error; iEnumFORMATETC = &instance->iEnumFORMATETC; - iEnumFORMATETC->lpVtbl = (IEnumFORMATETCVtbl*) calloc(1, - sizeof(IEnumFORMATETCVtbl)); + iEnumFORMATETC->lpVtbl = (IEnumFORMATETCVtbl*)calloc(1, sizeof(IEnumFORMATETCVtbl)); if (!iEnumFORMATETC->lpVtbl) goto error; @@ -1035,7 +1012,7 @@ CliprdrEnumFORMATETC* CliprdrEnumFORMATETC_New(ULONG nFormats, if (nFormats > 0) { - instance->m_pFormatEtc = (FORMATETC*) calloc(nFormats, sizeof(FORMATETC)); + instance->m_pFormatEtc = (FORMATETC*)calloc(nFormats, sizeof(FORMATETC)); if (!instance->m_pFormatEtc) goto error; @@ -1075,8 +1052,7 @@ void CliprdrEnumFORMATETC_Delete(CliprdrEnumFORMATETC* instance) /***********************************************************************************/ -static UINT32 get_local_format_id_by_name(wfClipboard* clipboard, - const TCHAR* format_name) +static UINT32 get_local_format_id_by_name(wfClipboard* clipboard, const TCHAR* format_name) { size_t i; formatMapping* map; @@ -1097,8 +1073,7 @@ static UINT32 get_local_format_id_by_name(wfClipboard* clipboard, if (!unicode_name) return 0; - MultiByteToWideChar(CP_OEMCP, 0, format_name, strlen(format_name), unicode_name, - size); + MultiByteToWideChar(CP_OEMCP, 0, format_name, strlen(format_name), unicode_name, size); #endif if (!unicode_name) @@ -1124,8 +1099,7 @@ static UINT32 get_local_format_id_by_name(wfClipboard* clipboard, static INLINE BOOL file_transferring(wfClipboard* clipboard) { - return get_local_format_id_by_name(clipboard, - CFSTR_FILEDESCRIPTORW) ? TRUE : FALSE; + return get_local_format_id_by_name(clipboard, CFSTR_FILEDESCRIPTORW) ? TRUE : FALSE; } static UINT32 get_remote_format_id(wfClipboard* clipboard, UINT32 local_format) @@ -1157,8 +1131,8 @@ static void map_ensure_capacity(wfClipboard* clipboard) size_t new_size; formatMapping* new_map; new_size = clipboard->map_capacity * 2; - new_map = (formatMapping*) realloc(clipboard->format_mappings, - sizeof(formatMapping) * new_size); + new_map = + (formatMapping*)realloc(clipboard->format_mappings, sizeof(formatMapping) * new_size); if (!new_map) return; @@ -1199,23 +1173,22 @@ static UINT cliprdr_send_tempdir(wfClipboard* clipboard) if (!clipboard) return -1; - if (GetEnvironmentVariableA("TEMP", tempDirectory.szTempDir, - sizeof(tempDirectory.szTempDir)) == 0) + if (GetEnvironmentVariableA("TEMP", tempDirectory.szTempDir, sizeof(tempDirectory.szTempDir)) == + 0) return -1; return clipboard->context->TempDirectory(clipboard->context, &tempDirectory); } -static BOOL cliprdr_GetUpdatedClipboardFormats(wfClipboard* clipboard, - PUINT lpuiFormats, UINT cFormats, PUINT pcFormatsOut) +static BOOL cliprdr_GetUpdatedClipboardFormats(wfClipboard* clipboard, PUINT lpuiFormats, + UINT cFormats, PUINT pcFormatsOut) { UINT index = 0; UINT format = 0; BOOL clipboardOpen = FALSE; if (!clipboard->legacyApi) - return clipboard->GetUpdatedClipboardFormats(lpuiFormats, cFormats, - pcFormatsOut); + return clipboard->GetUpdatedClipboardFormats(lpuiFormats, cFormats, pcFormatsOut); clipboardOpen = OpenClipboard(clipboard->hwnd); @@ -1258,8 +1231,8 @@ static UINT cliprdr_send_format_list(wfClipboard* clipboard) return ERROR_INTERNAL_ERROR; count = CountClipboardFormats(); - numFormats = (UINT32) count; - formats = (CLIPRDR_FORMAT*) calloc(numFormats, sizeof(CLIPRDR_FORMAT)); + numFormats = (UINT32)count; + formats = (CLIPRDR_FORMAT*)calloc(numFormats, sizeof(CLIPRDR_FORMAT)); if (!formats) { @@ -1290,8 +1263,7 @@ static UINT cliprdr_send_format_list(wfClipboard* clipboard) for (index = 0; index < numFormats; index++) { - if (GetClipboardFormatNameA(formats[index].formatId, formatName, - sizeof(formatName))) + if (GetClipboardFormatNameA(formats[index].formatId, formatName, sizeof(formatName))) { formats[index].formatName = _strdup(formatName); } @@ -1313,17 +1285,14 @@ static UINT cliprdr_send_data_request(wfClipboard* clipboard, UINT32 formatId) UINT rc; CLIPRDR_FORMAT_DATA_REQUEST formatDataRequest; - if (!clipboard || !clipboard->context || - !clipboard->context->ClientFormatDataRequest) + if (!clipboard || !clipboard->context || !clipboard->context->ClientFormatDataRequest) return ERROR_INTERNAL_ERROR; formatDataRequest.requestedFormatId = formatId; clipboard->requestedFormatId = formatId; - rc = clipboard->context->ClientFormatDataRequest(clipboard->context, - &formatDataRequest); + rc = clipboard->context->ClientFormatDataRequest(clipboard->context, &formatDataRequest); - if (WaitForSingleObject(clipboard->response_data_event, - INFINITE) != WAIT_OBJECT_0) + if (WaitForSingleObject(clipboard->response_data_event, INFINITE) != WAIT_OBJECT_0) rc = ERROR_INTERNAL_ERROR; else if (!ResetEvent(clipboard->response_data_event)) rc = ERROR_INTERNAL_ERROR; @@ -1331,19 +1300,17 @@ static UINT cliprdr_send_data_request(wfClipboard* clipboard, UINT32 formatId) return rc; } -UINT cliprdr_send_request_filecontents(wfClipboard* clipboard, - const void* streamid, - ULONG index, UINT32 flag, DWORD positionhigh, - DWORD positionlow, ULONG nreq) +UINT cliprdr_send_request_filecontents(wfClipboard* clipboard, const void* streamid, ULONG index, + UINT32 flag, DWORD positionhigh, DWORD positionlow, + ULONG nreq) { UINT rc; CLIPRDR_FILE_CONTENTS_REQUEST fileContentsRequest; - if (!clipboard || !clipboard->context || - !clipboard->context->ClientFileContentsRequest) + if (!clipboard || !clipboard->context || !clipboard->context->ClientFileContentsRequest) return ERROR_INTERNAL_ERROR; - fileContentsRequest.streamId = (UINT32) streamid; + fileContentsRequest.streamId = (UINT32)streamid; fileContentsRequest.listIndex = index; fileContentsRequest.dwFlags = flag; fileContentsRequest.nPositionLow = positionlow; @@ -1351,8 +1318,7 @@ UINT cliprdr_send_request_filecontents(wfClipboard* clipboard, fileContentsRequest.cbRequested = nreq; fileContentsRequest.clipDataId = 0; fileContentsRequest.msgFlags = 0; - rc = clipboard->context->ClientFileContentsRequest(clipboard->context, - &fileContentsRequest); + rc = clipboard->context->ClientFileContentsRequest(clipboard->context, &fileContentsRequest); if (WaitForSingleObject(clipboard->req_fevent, INFINITE) != WAIT_OBJECT_0) rc = ERROR_INTERNAL_ERROR; @@ -1362,13 +1328,12 @@ UINT cliprdr_send_request_filecontents(wfClipboard* clipboard, return rc; } -static UINT cliprdr_send_response_filecontents(wfClipboard* clipboard, - UINT32 streamId, UINT32 size, BYTE* data) +static UINT cliprdr_send_response_filecontents(wfClipboard* clipboard, UINT32 streamId, UINT32 size, + BYTE* data) { CLIPRDR_FILE_CONTENTS_RESPONSE fileContentsResponse; - if (!clipboard || !clipboard->context || - !clipboard->context->ClientFileContentsResponse) + if (!clipboard || !clipboard->context || !clipboard->context->ClientFileContentsResponse) return ERROR_INTERNAL_ERROR; fileContentsResponse.streamId = streamId; @@ -1376,11 +1341,10 @@ static UINT cliprdr_send_response_filecontents(wfClipboard* clipboard, fileContentsResponse.requestedData = data; fileContentsResponse.msgFlags = CB_RESPONSE_OK; return clipboard->context->ClientFileContentsResponse(clipboard->context, - &fileContentsResponse); + &fileContentsResponse); } -static LRESULT CALLBACK cliprdr_proc(HWND hWnd, UINT Msg, WPARAM wParam, - LPARAM lParam) +static LRESULT CALLBACK cliprdr_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { static wfClipboard* clipboard = NULL; @@ -1388,7 +1352,7 @@ static LRESULT CALLBACK cliprdr_proc(HWND hWnd, UINT Msg, WPARAM wParam, { case WM_CREATE: DEBUG_CLIPRDR("info: WM_CREATE"); - clipboard = (wfClipboard*)((CREATESTRUCT*) lParam)->lpCreateParams; + clipboard = (wfClipboard*)((CREATESTRUCT*)lParam)->lpCreateParams; clipboard->hwnd = hWnd; if (!clipboard->legacyApi) @@ -1449,13 +1413,13 @@ static LRESULT CALLBACK cliprdr_proc(HWND hWnd, UINT Msg, WPARAM wParam, case WM_RENDERFORMAT: DEBUG_CLIPRDR("info: WM_RENDERFORMAT"); - if (cliprdr_send_data_request(clipboard, (UINT32) wParam) != 0) + if (cliprdr_send_data_request(clipboard, (UINT32)wParam) != 0) { DEBUG_CLIPRDR("error: cliprdr_send_data_request failed."); break; } - if (!SetClipboardData((UINT) wParam, clipboard->hmem)) + if (!SetClipboardData((UINT)wParam, clipboard->hmem)) { DEBUG_CLIPRDR("SetClipboardData failed with 0x%x", GetLastError()); @@ -1486,8 +1450,8 @@ static LRESULT CALLBACK cliprdr_proc(HWND hWnd, UINT Msg, WPARAM wParam, case WM_CHANGECBCHAIN: if (clipboard->legacyApi) { - HWND hWndCurrViewer = (HWND) wParam; - HWND hWndNextViewer = (HWND) lParam; + HWND hWndCurrViewer = (HWND)wParam; + HWND hWndNextViewer = (HWND)lParam; if (hWndCurrViewer == clipboard->hWndNextViewer) clipboard->hWndNextViewer = hWndNextViewer; @@ -1555,10 +1519,9 @@ static int create_cliprdr_window(wfClipboard* clipboard) wnd_cls.hInstance = GetModuleHandle(NULL); wnd_cls.hIconSm = NULL; RegisterClassEx(&wnd_cls); - clipboard->hwnd = CreateWindowEx(WS_EX_LEFT, - _T("ClipboardHiddenMessageProcessor"), - _T("rdpclip"), 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, GetModuleHandle(NULL), - clipboard); + clipboard->hwnd = + CreateWindowEx(WS_EX_LEFT, _T("ClipboardHiddenMessageProcessor"), _T("rdpclip"), 0, 0, 0, 0, + 0, HWND_MESSAGE, NULL, GetModuleHandle(NULL), clipboard); if (!clipboard->hwnd) { @@ -1574,7 +1537,7 @@ static DWORD WINAPI cliprdr_thread_func(LPVOID arg) int ret; MSG msg; BOOL mcode; - wfClipboard* clipboard = (wfClipboard*) arg; + wfClipboard* clipboard = (wfClipboard*)arg; OleInitialize(0); if ((ret = create_cliprdr_window(clipboard)) != 0) @@ -1638,9 +1601,8 @@ static void clear_file_array(wfClipboard* clipboard) clipboard->nFiles = 0; } -static BOOL wf_cliprdr_get_file_contents(WCHAR* file_name, BYTE* buffer, - LONG positionLow, LONG positionHigh, - DWORD nRequested, DWORD* puSize) +static BOOL wf_cliprdr_get_file_contents(WCHAR* file_name, BYTE* buffer, LONG positionLow, + LONG positionHigh, DWORD nRequested, DWORD* puSize) { BOOL res = FALSE; HANDLE hFile; @@ -1648,12 +1610,11 @@ static BOOL wf_cliprdr_get_file_contents(WCHAR* file_name, BYTE* buffer, if (!file_name || !buffer || !puSize) { - WLog_ERR(TAG, "get file contents Invalid Arguments."); + WLog_ERR(TAG, "get file contents Invalid Arguments."); return FALSE; } - hFile = CreateFileW(file_name, GENERIC_READ, FILE_SHARE_READ, NULL, - OPEN_EXISTING, + hFile = CreateFileW(file_name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL); if (hFile == INVALID_HANDLE_VALUE) @@ -1683,18 +1644,17 @@ error: } /* path_name has a '\' at the end. e.g. c:\newfolder\, file_name is c:\newfolder\new.txt */ -static FILEDESCRIPTORW* wf_cliprdr_get_file_descriptor(WCHAR* file_name, - size_t pathLen) +static FILEDESCRIPTORW* wf_cliprdr_get_file_descriptor(WCHAR* file_name, size_t pathLen) { HANDLE hFile; FILEDESCRIPTORW* fd; - fd = (FILEDESCRIPTORW*) calloc(1, sizeof(FILEDESCRIPTORW)); + fd = (FILEDESCRIPTORW*)calloc(1, sizeof(FILEDESCRIPTORW)); if (!fd) return NULL; - hFile = CreateFileW(file_name, GENERIC_READ, FILE_SHARE_READ, - NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL); + hFile = CreateFileW(file_name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL); if (hFile == INVALID_HANDLE_VALUE) { @@ -1727,13 +1687,13 @@ static BOOL wf_cliprdr_array_ensure_capacity(wfClipboard* clipboard) FILEDESCRIPTORW** new_fd; WCHAR** new_name; new_size = (clipboard->file_array_size + 1) * 2; - new_fd = (FILEDESCRIPTORW**) realloc(clipboard->fileDescriptor, - new_size * sizeof(FILEDESCRIPTORW*)); + new_fd = (FILEDESCRIPTORW**)realloc(clipboard->fileDescriptor, + new_size * sizeof(FILEDESCRIPTORW*)); if (new_fd) clipboard->fileDescriptor = new_fd; - new_name = (WCHAR**) realloc(clipboard->file_names, new_size * sizeof(WCHAR*)); + new_name = (WCHAR**)realloc(clipboard->file_names, new_size * sizeof(WCHAR*)); if (new_name) clipboard->file_names = new_name; @@ -1747,14 +1707,14 @@ static BOOL wf_cliprdr_array_ensure_capacity(wfClipboard* clipboard) return TRUE; } -static BOOL wf_cliprdr_add_to_file_arrays(wfClipboard* clipboard, - WCHAR* full_file_name, size_t pathLen) +static BOOL wf_cliprdr_add_to_file_arrays(wfClipboard* clipboard, WCHAR* full_file_name, + size_t pathLen) { if (!wf_cliprdr_array_ensure_capacity(clipboard)) return FALSE; /* add to name array */ - clipboard->file_names[clipboard->nFiles] = (LPWSTR) malloc(MAX_PATH * 2); + clipboard->file_names[clipboard->nFiles] = (LPWSTR)malloc(MAX_PATH * 2); if (!clipboard->file_names[clipboard->nFiles]) return FALSE; @@ -1774,8 +1734,7 @@ static BOOL wf_cliprdr_add_to_file_arrays(wfClipboard* clipboard, return TRUE; } -static BOOL wf_cliprdr_traverse_directory(wfClipboard* clipboard, - WCHAR* Dir, size_t pathLen) +static BOOL wf_cliprdr_traverse_directory(wfClipboard* clipboard, WCHAR* Dir, size_t pathLen) { HANDLE hFind; WCHAR DirSpec[MAX_PATH]; @@ -1796,9 +1755,9 @@ static BOOL wf_cliprdr_traverse_directory(wfClipboard* clipboard, while (FindNextFile(hFind, &FindFileData)) { - if ((FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0 - && wcscmp(FindFileData.cFileName, _T(".")) == 0 - || wcscmp(FindFileData.cFileName, _T("..")) == 0) + if ((FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0 && + wcscmp(FindFileData.cFileName, _T(".")) == 0 || + wcscmp(FindFileData.cFileName, _T("..")) == 0) { continue; } @@ -1837,22 +1796,17 @@ static UINT wf_cliprdr_send_client_capabilities(wfClipboard* clipboard) CLIPRDR_CAPABILITIES capabilities; CLIPRDR_GENERAL_CAPABILITY_SET generalCapabilitySet; - if (!clipboard || !clipboard->context || - !clipboard->context->ClientCapabilities) + if (!clipboard || !clipboard->context || !clipboard->context->ClientCapabilities) return ERROR_INTERNAL_ERROR; capabilities.cCapabilitiesSets = 1; - capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET*) & - (generalCapabilitySet); + capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET*)&(generalCapabilitySet); generalCapabilitySet.capabilitySetType = CB_CAPSTYPE_GENERAL; generalCapabilitySet.capabilitySetLength = 12; generalCapabilitySet.version = CB_CAPS_VERSION_2; generalCapabilitySet.generalFlags = - CB_USE_LONG_FORMAT_NAMES | - CB_STREAM_FILECLIP_ENABLED | - CB_FILECLIP_NO_FILE_PATHS; - return clipboard->context->ClientCapabilities(clipboard->context, - &capabilities); + CB_USE_LONG_FORMAT_NAMES | CB_STREAM_FILECLIP_ENABLED | CB_FILECLIP_NO_FILE_PATHS; + return clipboard->context->ClientCapabilities(clipboard->context, &capabilities); } /** @@ -1864,7 +1818,7 @@ static UINT wf_cliprdr_monitor_ready(CliprdrClientContext* context, const CLIPRDR_MONITOR_READY* monitorReady) { UINT rc; - wfClipboard* clipboard = (wfClipboard*) context->custom; + wfClipboard* clipboard = (wfClipboard*)context->custom; if (!context || !monitorReady) return ERROR_INTERNAL_ERROR; @@ -1884,11 +1838,11 @@ static UINT wf_cliprdr_monitor_ready(CliprdrClientContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT wf_cliprdr_server_capabilities(CliprdrClientContext* context, - const CLIPRDR_CAPABILITIES* capabilities) + const CLIPRDR_CAPABILITIES* capabilities) { UINT32 index; CLIPRDR_CAPABILITY_SET* capabilitySet; - wfClipboard* clipboard = (wfClipboard*) context->custom; + wfClipboard* clipboard = (wfClipboard*)context->custom; if (!context || !capabilities) return ERROR_INTERNAL_ERROR; @@ -1900,8 +1854,8 @@ static UINT wf_cliprdr_server_capabilities(CliprdrClientContext* context, if ((capabilitySet->capabilitySetType == CB_CAPSTYPE_GENERAL) && (capabilitySet->capabilitySetLength >= CB_CAPSTYPE_GENERAL_LEN)) { - CLIPRDR_GENERAL_CAPABILITY_SET* generalCapabilitySet - = (CLIPRDR_GENERAL_CAPABILITY_SET*) capabilitySet; + CLIPRDR_GENERAL_CAPABILITY_SET* generalCapabilitySet = + (CLIPRDR_GENERAL_CAPABILITY_SET*)capabilitySet; clipboard->capabilities = generalCapabilitySet->generalFlags; break; } @@ -1916,13 +1870,13 @@ static UINT wf_cliprdr_server_capabilities(CliprdrClientContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT wf_cliprdr_server_format_list(CliprdrClientContext* context, - const CLIPRDR_FORMAT_LIST* formatList) + const CLIPRDR_FORMAT_LIST* formatList) { UINT rc = ERROR_INTERNAL_ERROR; UINT32 i; formatMapping* mapping; CLIPRDR_FORMAT* format; - wfClipboard* clipboard = (wfClipboard*) context->custom; + wfClipboard* clipboard = (wfClipboard*)context->custom; if (!clear_format_map(clipboard)) return ERROR_INTERNAL_ERROR; @@ -1936,15 +1890,14 @@ static UINT wf_cliprdr_server_format_list(CliprdrClientContext* context, if (format->formatName) { int size = MultiByteToWideChar(CP_UTF8, 0, format->formatName, - strlen(format->formatName), - NULL, 0); + strlen(format->formatName), NULL, 0); mapping->name = calloc(size + 1, sizeof(WCHAR)); if (mapping->name) { MultiByteToWideChar(CP_UTF8, 0, format->formatName, strlen(format->formatName), mapping->name, size); - mapping->local_format_id = RegisterClipboardFormatW((LPWSTR) mapping->name); + mapping->local_format_id = RegisterClipboardFormatW((LPWSTR)mapping->name); } } else @@ -1969,7 +1922,7 @@ static UINT wf_cliprdr_server_format_list(CliprdrClientContext* context, if (EmptyClipboard()) { - for (i = 0; i < (UINT32) clipboard->map_size; i++) + for (i = 0; i < (UINT32)clipboard->map_size; i++) SetClipboardData(clipboard->format_mappings[i].local_format_id, NULL); rc = CHANNEL_RC_OK; @@ -1987,9 +1940,9 @@ static UINT wf_cliprdr_server_format_list(CliprdrClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT wf_cliprdr_server_format_list_response(CliprdrClientContext* - context, - const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) +static UINT +wf_cliprdr_server_format_list_response(CliprdrClientContext* context, + const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) { (void)context; (void)formatListResponse; @@ -2005,8 +1958,9 @@ static UINT wf_cliprdr_server_format_list_response(CliprdrClientContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT wf_cliprdr_server_lock_clipboard_data(CliprdrClientContext* context, - const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) +static UINT +wf_cliprdr_server_lock_clipboard_data(CliprdrClientContext* context, + const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) { (void)context; (void)lockClipboardData; @@ -2018,17 +1972,16 @@ static UINT wf_cliprdr_server_lock_clipboard_data(CliprdrClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT wf_cliprdr_server_unlock_clipboard_data(CliprdrClientContext* - context, - const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) +static UINT +wf_cliprdr_server_unlock_clipboard_data(CliprdrClientContext* context, + const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) { (void)context; (void)unlockClipboardData; return CHANNEL_RC_OK; } -static BOOL wf_cliprdr_process_filename(wfClipboard* clipboard, - WCHAR* wFileName, size_t str_len) +static BOOL wf_cliprdr_process_filename(wfClipboard* clipboard, WCHAR* wFileName, size_t str_len) { size_t pathLen; size_t offset = str_len; @@ -2050,7 +2003,7 @@ static BOOL wf_cliprdr_process_filename(wfClipboard* clipboard, if (!wf_cliprdr_add_to_file_arrays(clipboard, wFileName, pathLen)) return FALSE; - if ((clipboard->fileDescriptor[clipboard->nFiles - 1]->dwFileAttributes& + if ((clipboard->fileDescriptor[clipboard->nFiles - 1]->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) { /* this is a directory */ @@ -2066,8 +2019,9 @@ static BOOL wf_cliprdr_process_filename(wfClipboard* clipboard, * * @return 0 on success, otherwise a Win32 error code */ -static UINT wf_cliprdr_server_format_data_request(CliprdrClientContext* context, - const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) +static UINT +wf_cliprdr_server_format_data_request(CliprdrClientContext* context, + const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) { UINT rc; size_t size = 0; @@ -2081,7 +2035,7 @@ static UINT wf_cliprdr_server_format_data_request(CliprdrClientContext* context, if (!context || !formatDataRequest) return ERROR_INTERNAL_ERROR; - clipboard = (wfClipboard*) context->custom; + clipboard = (wfClipboard*)context->custom; if (!clipboard) return ERROR_INTERNAL_ERROR; @@ -2119,7 +2073,7 @@ static UINT wf_cliprdr_server_format_data_request(CliprdrClientContext* context, goto exit; } - dropFiles = (DROPFILES*) GlobalLock(stg_medium.hGlobal); + dropFiles = (DROPFILES*)GlobalLock(stg_medium.hGlobal); if (!dropFiles) { @@ -2144,13 +2098,13 @@ static UINT wf_cliprdr_server_format_data_request(CliprdrClientContext* context, { char* p; - for (p = (char*)((char*)dropFiles + dropFiles->pFiles); - (len = strlen(p)) > 0; p += len + 1, clipboard->nFiles++) + for (p = (char*)((char*)dropFiles + dropFiles->pFiles); (len = strlen(p)) > 0; + p += len + 1, clipboard->nFiles++) { int cchWideChar; WCHAR* wFileName; cchWideChar = MultiByteToWideChar(CP_ACP, MB_COMPOSITE, p, len, NULL, 0); - wFileName = (LPWSTR) calloc(cchWideChar, sizeof(WCHAR)); + wFileName = (LPWSTR)calloc(cchWideChar, sizeof(WCHAR)); MultiByteToWideChar(CP_ACP, MB_COMPOSITE, p, len, wFileName, cchWideChar); wf_cliprdr_process_filename(clipboard, wFileName, cchWideChar); } @@ -2160,7 +2114,7 @@ static UINT wf_cliprdr_server_format_data_request(CliprdrClientContext* context, ReleaseStgMedium(&stg_medium); exit: size = 4 + clipboard->nFiles * sizeof(FILEDESCRIPTORW); - groupDsc = (FILEGROUPDESCRIPTORW*) malloc(size); + groupDsc = (FILEGROUPDESCRIPTORW*)malloc(size); if (groupDsc) { @@ -2190,8 +2144,8 @@ static UINT wf_cliprdr_server_format_data_request(CliprdrClientContext* context, return ERROR_INTERNAL_ERROR; } - globlemem = (char*) GlobalLock(hClipdata); - size = (int) GlobalSize(hClipdata); + globlemem = (char*)GlobalLock(hClipdata); + size = (int)GlobalSize(hClipdata); buff = malloc(size); CopyMemory(buff, globlemem, size); GlobalUnlock(hClipdata); @@ -2200,9 +2154,8 @@ static UINT wf_cliprdr_server_format_data_request(CliprdrClientContext* context, response.msgFlags = CB_RESPONSE_OK; response.dataLen = size; - response.requestedFormatData = (BYTE*) buff; - rc = clipboard->context->ClientFormatDataResponse(clipboard->context, - &response); + response.requestedFormatData = (BYTE*)buff; + rc = clipboard->context->ClientFormatDataResponse(clipboard->context, &response); free(buff); return rc; } @@ -2212,9 +2165,9 @@ static UINT wf_cliprdr_server_format_data_request(CliprdrClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT wf_cliprdr_server_format_data_response(CliprdrClientContext* - context, - const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) +static UINT +wf_cliprdr_server_format_data_response(CliprdrClientContext* context, + const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) { BYTE* data; HANDLE hMem; @@ -2226,7 +2179,7 @@ static UINT wf_cliprdr_server_format_data_response(CliprdrClientContext* if (formatDataResponse->msgFlags != CB_RESPONSE_OK) return E_FAIL; - clipboard = (wfClipboard*) context->custom; + clipboard = (wfClipboard*)context->custom; if (!clipboard) return ERROR_INTERNAL_ERROR; @@ -2236,7 +2189,7 @@ static UINT wf_cliprdr_server_format_data_response(CliprdrClientContext* if (!hMem) return ERROR_INTERNAL_ERROR; - data = (BYTE*) GlobalLock(hMem); + data = (BYTE*)GlobalLock(hMem); if (!data) { @@ -2244,8 +2197,7 @@ static UINT wf_cliprdr_server_format_data_response(CliprdrClientContext* return ERROR_INTERNAL_ERROR; } - CopyMemory(data, formatDataResponse->requestedFormatData, - formatDataResponse->dataLen); + CopyMemory(data, formatDataResponse->requestedFormatData, formatDataResponse->dataLen); if (!GlobalUnlock(hMem) && GetLastError()) { @@ -2266,18 +2218,18 @@ static UINT wf_cliprdr_server_format_data_response(CliprdrClientContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT wf_cliprdr_server_file_contents_request(CliprdrClientContext* - context, - const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +static UINT +wf_cliprdr_server_file_contents_request(CliprdrClientContext* context, + const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { DWORD uSize = 0; BYTE* pData = NULL; - HRESULT hRet = S_OK; + HRESULT hRet = S_OK; FORMATETC vFormatEtc; LPDATAOBJECT pDataObj = NULL; STGMEDIUM vStgMedium; BOOL bIsStreamFile = TRUE; - static LPSTREAM pStreamStc = NULL; + static LPSTREAM pStreamStc = NULL; static UINT32 uStreamIdStc = 0; wfClipboard* clipboard; UINT rc = ERROR_INTERNAL_ERROR; @@ -2287,7 +2239,7 @@ static UINT wf_cliprdr_server_file_contents_request(CliprdrClientContext* if (!context || !fileContentsRequest) return ERROR_INTERNAL_ERROR; - clipboard = (wfClipboard*) context->custom; + clipboard = (wfClipboard*)context->custom; if (!clipboard) return ERROR_INTERNAL_ERROR; @@ -2296,7 +2248,7 @@ static UINT wf_cliprdr_server_file_contents_request(CliprdrClientContext* if (fileContentsRequest->dwFlags == FILECONTENTS_SIZE) cbRequested = sizeof(UINT64); - pData = (BYTE*) calloc(1, cbRequested); + pData = (BYTE*)calloc(1, cbRequested); if (!pData) goto error; @@ -2305,7 +2257,7 @@ static UINT wf_cliprdr_server_file_contents_request(CliprdrClientContext* if (FAILED(hRet)) { - WLog_ERR(TAG, "filecontents: get ole clipboard failed."); + WLog_ERR(TAG, "filecontents: get ole clipboard failed."); goto error; } @@ -2354,8 +2306,7 @@ static UINT wf_cliprdr_server_file_contents_request(CliprdrClientContext* break; } } - } - while (hRet == S_OK); + } while (hRet == S_OK); } } @@ -2369,8 +2320,8 @@ static UINT wf_cliprdr_server_file_contents_request(CliprdrClientContext* if (hRet == S_OK) { - *((UINT32*) &pData[0]) = vStatStg.cbSize.LowPart; - *((UINT32*) &pData[4]) = vStatStg.cbSize.HighPart; + *((UINT32*)&pData[0]) = vStatStg.cbSize.LowPart; + *((UINT32*)&pData[4]) = vStatStg.cbSize.HighPart; uSize = cbRequested; } } @@ -2383,17 +2334,16 @@ static UINT wf_cliprdr_server_file_contents_request(CliprdrClientContext* hRet = IStream_Seek(pStreamStc, dlibMove, STREAM_SEEK_SET, &dlibNewPosition); if (SUCCEEDED(hRet)) - hRet = IStream_Read(pStreamStc, pData, cbRequested, - (PULONG) &uSize); + hRet = IStream_Read(pStreamStc, pData, cbRequested, (PULONG)&uSize); } } else { if (fileContentsRequest->dwFlags == FILECONTENTS_SIZE) { - *((UINT32*) &pData[0]) = + *((UINT32*)&pData[0]) = clipboard->fileDescriptor[fileContentsRequest->listIndex]->nFileSizeLow; - *((UINT32*) &pData[4]) = + *((UINT32*)&pData[4]) = clipboard->fileDescriptor[fileContentsRequest->listIndex]->nFileSizeHigh; uSize = cbRequested; } @@ -2401,9 +2351,9 @@ static UINT wf_cliprdr_server_file_contents_request(CliprdrClientContext* { BOOL bRet; bRet = wf_cliprdr_get_file_contents( - clipboard->file_names[fileContentsRequest->listIndex], pData, - fileContentsRequest->nPositionLow, fileContentsRequest->nPositionHigh, - cbRequested, &uSize); + clipboard->file_names[fileContentsRequest->listIndex], pData, + fileContentsRequest->nPositionLow, fileContentsRequest->nPositionHigh, cbRequested, + &uSize); if (bRet == FALSE) { @@ -2426,9 +2376,8 @@ error: pData = NULL; } - sRc = cliprdr_send_response_filecontents(clipboard, - fileContentsRequest->streamId, - uSize, pData); + sRc = + cliprdr_send_response_filecontents(clipboard, fileContentsRequest->streamId, uSize, pData); free(pData); if (sRc != CHANNEL_RC_OK) @@ -2442,9 +2391,9 @@ error: * * @return 0 on success, otherwise a Win32 error code */ -static UINT wf_cliprdr_server_file_contents_response(CliprdrClientContext* - context, - const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) +static UINT +wf_cliprdr_server_file_contents_response(CliprdrClientContext* context, + const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) { wfClipboard* clipboard; @@ -2454,13 +2403,13 @@ static UINT wf_cliprdr_server_file_contents_response(CliprdrClientContext* if (fileContentsResponse->msgFlags != CB_RESPONSE_OK) return E_FAIL; - clipboard = (wfClipboard*) context->custom; + clipboard = (wfClipboard*)context->custom; if (!clipboard) return ERROR_INTERNAL_ERROR; clipboard->req_fsize = fileContentsResponse->cbRequested; - clipboard->req_fdata = (char*) malloc(fileContentsResponse->cbRequested); + clipboard->req_fdata = (char*)malloc(fileContentsResponse->cbRequested); if (!clipboard->req_fdata) return ERROR_INTERNAL_ERROR; @@ -2480,12 +2429,12 @@ static UINT wf_cliprdr_server_file_contents_response(CliprdrClientContext* BOOL wf_cliprdr_init(wfContext* wfc, CliprdrClientContext* cliprdr) { wfClipboard* clipboard; - rdpContext* context = (rdpContext*) wfc; + rdpContext* context = (rdpContext*)wfc; if (!context || !cliprdr) return FALSE; - wfc->clipboard = (wfClipboard*) calloc(1, sizeof(wfClipboard)); + wfc->clipboard = (wfClipboard*)calloc(1, sizeof(wfClipboard)); if (!wfc->clipboard) return FALSE; @@ -2501,21 +2450,20 @@ BOOL wf_cliprdr_init(wfContext* wfc, CliprdrClientContext* cliprdr) if (clipboard->hUser32) { - clipboard->AddClipboardFormatListener = (fnAddClipboardFormatListener) - GetProcAddress(clipboard->hUser32, "AddClipboardFormatListener"); - clipboard->RemoveClipboardFormatListener = (fnRemoveClipboardFormatListener) - GetProcAddress(clipboard->hUser32, "RemoveClipboardFormatListener"); - clipboard->GetUpdatedClipboardFormats = (fnGetUpdatedClipboardFormats) - GetProcAddress(clipboard->hUser32, "GetUpdatedClipboardFormats"); + clipboard->AddClipboardFormatListener = (fnAddClipboardFormatListener)GetProcAddress( + clipboard->hUser32, "AddClipboardFormatListener"); + clipboard->RemoveClipboardFormatListener = (fnRemoveClipboardFormatListener)GetProcAddress( + clipboard->hUser32, "RemoveClipboardFormatListener"); + clipboard->GetUpdatedClipboardFormats = (fnGetUpdatedClipboardFormats)GetProcAddress( + clipboard->hUser32, "GetUpdatedClipboardFormats"); } - if (!(clipboard->hUser32 && clipboard->AddClipboardFormatListener - && clipboard->RemoveClipboardFormatListener - && clipboard->GetUpdatedClipboardFormats)) + if (!(clipboard->hUser32 && clipboard->AddClipboardFormatListener && + clipboard->RemoveClipboardFormatListener && clipboard->GetUpdatedClipboardFormats)) clipboard->legacyApi = TRUE; - if (!(clipboard->format_mappings = (formatMapping*) calloc(clipboard->map_capacity, - sizeof(formatMapping)))) + if (!(clipboard->format_mappings = + (formatMapping*)calloc(clipboard->map_capacity, sizeof(formatMapping)))) goto error; if (!(clipboard->response_data_event = CreateEvent(NULL, TRUE, FALSE, NULL))) @@ -2537,7 +2485,7 @@ BOOL wf_cliprdr_init(wfContext* wfc, CliprdrClientContext* cliprdr) cliprdr->ServerFormatDataResponse = wf_cliprdr_server_format_data_response; cliprdr->ServerFileContentsRequest = wf_cliprdr_server_file_contents_request; cliprdr->ServerFileContentsResponse = wf_cliprdr_server_file_contents_response; - cliprdr->custom = (void*) wfc->clipboard; + cliprdr->custom = (void*)wfc->clipboard; return TRUE; error: wf_cliprdr_uninit(wfc, cliprdr); diff --git a/client/Windows/wf_event.c b/client/Windows/wf_event.c index 9c3395a78..7de3487fb 100644 --- a/client/Windows/wf_event.c +++ b/client/Windows/wf_event.c @@ -36,13 +36,12 @@ static HWND g_focus_hWnd; -#define X_POS(lParam) ((UINT16) (lParam & 0xFFFF)) -#define Y_POS(lParam) ((UINT16) ((lParam >> 16) & 0xFFFF)) +#define X_POS(lParam) ((UINT16)(lParam & 0xFFFF)) +#define Y_POS(lParam) ((UINT16)((lParam >> 16) & 0xFFFF)) -static BOOL wf_scale_blt(wfContext* wfc, HDC hdc, int x, int y, int w, int h, - HDC hdcSrc, int x1, int y1, DWORD rop); -static BOOL wf_scale_mouse_event(wfContext* wfc, rdpInput* input, UINT16 flags, - UINT16 x, UINT16 y); +static BOOL wf_scale_blt(wfContext* wfc, HDC hdc, int x, int y, int w, int h, HDC hdcSrc, int x1, + int y1, DWORD rop); +static BOOL wf_scale_mouse_event(wfContext* wfc, rdpInput* input, UINT16 flags, UINT16 x, UINT16 y); #if (_WIN32_WINNT >= 0x0500) static BOOL wf_scale_mouse_event_ex(wfContext* wfc, rdpInput* input, UINT16 flags, UINT16 buttonMask, UINT16 x, UINT16 y); @@ -53,8 +52,7 @@ static BOOL g_flipping_out; static BOOL alt_ctrl_down() { - return ((GetAsyncKeyState(VK_CONTROL) & 0x8000) || - (GetAsyncKeyState(VK_MENU) & 0x8000)); + return ((GetAsyncKeyState(VK_CONTROL) & 0x8000) || (GetAsyncKeyState(VK_MENU) & 0x8000)); } LRESULT CALLBACK wf_ll_kbd_proc(int nCode, WPARAM wParam, LPARAM lParam) @@ -63,8 +61,7 @@ LRESULT CALLBACK wf_ll_kbd_proc(int nCode, WPARAM wParam, LPARAM lParam) DWORD rdp_scancode; rdpInput* input; PKBDLLHOOKSTRUCT p; - DEBUG_KBD("Low-level keyboard hook, hWnd %X nCode %X wParam %X", g_focus_hWnd, - nCode, wParam); + DEBUG_KBD("Low-level keyboard hook, hWnd %X nCode %X wParam %X", g_focus_hWnd, nCode, wParam); if (g_flipping_in) { @@ -82,14 +79,14 @@ LRESULT CALLBACK wf_ll_kbd_proc(int nCode, WPARAM wParam, LPARAM lParam) case WM_SYSKEYDOWN: case WM_KEYUP: case WM_SYSKEYUP: - wfc = (wfContext*) GetWindowLongPtr(g_focus_hWnd, GWLP_USERDATA); - p = (PKBDLLHOOKSTRUCT) lParam; + wfc = (wfContext*)GetWindowLongPtr(g_focus_hWnd, GWLP_USERDATA); + p = (PKBDLLHOOKSTRUCT)lParam; if (!wfc || !p) return 1; input = wfc->context.input; - rdp_scancode = MAKE_RDP_SCANCODE((BYTE) p->scanCode, p->flags & LLKHF_EXTENDED); + rdp_scancode = MAKE_RDP_SCANCODE((BYTE)p->scanCode, p->flags & LLKHF_EXTENDED); DEBUG_KBD("keydown %d scanCode 0x%08lX flags 0x%08lX vkCode 0x%08lX", (wParam == WM_KEYDOWN), p->scanCode, p->flags, p->vkCode); @@ -114,7 +111,7 @@ LRESULT CALLBACK wf_ll_kbd_proc(int nCode, WPARAM wParam, LPARAM lParam) else if (rdp_scancode == RDP_SCANCODE_NUMLOCK) { /* Windows sends Pause as if it was a RDP NumLock (handled above). - * It must however be sent as a one-shot Ctrl+NumLock */ + * It must however be sent as a one-shot Ctrl+NumLock */ if (wParam == WM_KEYDOWN) { DEBUG_KBD("Pause, sent as Ctrl+NumLock"); @@ -136,12 +133,12 @@ LRESULT CALLBACK wf_ll_kbd_proc(int nCode, WPARAM wParam, LPARAM lParam) rdp_scancode = RDP_SCANCODE_RSHIFT; } - freerdp_input_send_keyboard_event_ex(input, !(p->flags & LLKHF_UP), - rdp_scancode); + freerdp_input_send_keyboard_event_ex(input, !(p->flags & LLKHF_UP), rdp_scancode); - if (p->vkCode == VK_NUMLOCK || p->vkCode == VK_CAPITAL - || p->vkCode == VK_SCROLL || p->vkCode == VK_KANA) - DEBUG_KBD("lock keys are processed on client side too to toggle their indicators"); + if (p->vkCode == VK_NUMLOCK || p->vkCode == VK_CAPITAL || p->vkCode == VK_SCROLL || + p->vkCode == VK_KANA) + DEBUG_KBD( + "lock keys are processed on client side too to toggle their indicators"); else return 1; @@ -192,15 +189,15 @@ void wf_event_focus_in(wfContext* wfc) input->MouseEvent(input, PTR_FLAGS_MOVE, (UINT16)pt.x, (UINT16)pt.y); } -static BOOL wf_event_process_WM_MOUSEWHEEL(wfContext* wfc, HWND hWnd, UINT Msg, - WPARAM wParam, LPARAM lParam, BOOL horizontal, UINT16 x, UINT16 y) +static BOOL wf_event_process_WM_MOUSEWHEEL(wfContext* wfc, HWND hWnd, UINT Msg, WPARAM wParam, + LPARAM lParam, BOOL horizontal, UINT16 x, UINT16 y) { int delta; UINT16 flags = 0; rdpInput* input; DefWindowProc(hWnd, Msg, wParam, lParam); input = wfc->context.input; - delta = ((signed short) HIWORD(wParam)); /* GET_WHEEL_DELTA_WPARAM(wParam); */ + delta = ((signed short)HIWORD(wParam)); /* GET_WHEEL_DELTA_WPARAM(wParam); */ if (horizontal) flags |= PTR_FLAGS_HWHEEL; @@ -225,7 +222,7 @@ static void wf_sizing(wfContext* wfc, WPARAM wParam, LPARAM lParam) if (settings->SmartSizing && (GetAsyncKeyState(VK_CONTROL) & 0x8000)) { - rect = (LPRECT) wParam; + rect = (LPRECT)wParam; switch (lParam) { @@ -233,8 +230,8 @@ static void wf_sizing(wfContext* wfc, WPARAM wParam, LPARAM lParam) case WMSZ_RIGHT: case WMSZ_BOTTOMRIGHT: // Adjust height - rect->bottom = rect->top + settings->DesktopHeight * (rect->right - - rect->left) / settings->DesktopWidth; + rect->bottom = rect->top + settings->DesktopHeight * (rect->right - rect->left) / + settings->DesktopWidth; break; case WMSZ_TOP: @@ -242,21 +239,20 @@ static void wf_sizing(wfContext* wfc, WPARAM wParam, LPARAM lParam) case WMSZ_TOPRIGHT: // Adjust width rect->right = rect->left + settings->DesktopWidth * (rect->bottom - rect->top) / - settings->DesktopHeight; + settings->DesktopHeight; break; case WMSZ_BOTTOMLEFT: case WMSZ_TOPLEFT: // adjust width - rect->left = rect->right - (settings->DesktopWidth * (rect->bottom - - rect->top) / settings->DesktopHeight); + rect->left = rect->right - (settings->DesktopWidth * (rect->bottom - rect->top) / + settings->DesktopHeight); break; } } } -LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, - LPARAM lParam) +LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { HDC hdc; LONG_PTR ptr; @@ -269,7 +265,7 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, SCROLLINFO si; processed = TRUE; ptr = GetWindowLongPtr(hWnd, GWLP_USERDATA); - wfc = (wfContext*) ptr; + wfc = (wfContext*)ptr; if (wfc != NULL) { @@ -281,8 +277,8 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, case WM_MOVE: if (!wfc->disablewindowtracking) { - int x = (int)(short) LOWORD(lParam); - int y = (int)(short) HIWORD(lParam); + int x = (int)(short)LOWORD(lParam); + int y = (int)(short)HIWORD(lParam); wfc->client_x = x; wfc->client_y = y; } @@ -297,11 +293,11 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, else { // Set maximum window size for resizing - minmax = (MINMAXINFO*) lParam; + minmax = (MINMAXINFO*)lParam; - //always use the last determined canvas diff, because it could be - //that the window is minimized when this gets called - //wf_update_canvas_diff(wfc); + // always use the last determined canvas diff, because it could be + // that the window is minimized when this gets called + // wf_update_canvas_diff(wfc); if (!wfc->fullscreen) { @@ -332,10 +328,12 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, { wf_size_scrollbars(wfc, LOWORD(lParam), HIWORD(lParam)); - // Workaround: when the window is maximized, the call to "ShowScrollBars" returns TRUE but has no effect. + // Workaround: when the window is maximized, the call to "ShowScrollBars" + // returns TRUE but has no effect. if (wParam == SIZE_MAXIMIZED && !wfc->fullscreen) SetWindowPos(wfc->hwnd, HWND_TOP, 0, 0, windowRect.right - windowRect.left, - windowRect.bottom - windowRect.top, SWP_NOMOVE | SWP_FRAMECHANGED); + windowRect.bottom - windowRect.top, + SWP_NOMOVE | SWP_FRAMECHANGED); } break; @@ -346,7 +344,7 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, case WM_ERASEBKGND: /* Say we handled it - prevents flickering */ - return (LRESULT) 1; + return (LRESULT)1; case WM_PAINT: hdc = BeginPaint(hWnd, &ps); @@ -363,12 +361,14 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, case WM_XBUTTONDOWN: wf_scale_mouse_event_ex(wfc, input, PTR_XFLAGS_DOWN, GET_XBUTTON_WPARAM(wParam), - X_POS(lParam) - wfc->offset_x, Y_POS(lParam) - wfc->offset_y); + X_POS(lParam) - wfc->offset_x, + Y_POS(lParam) - wfc->offset_y); break; case WM_XBUTTONUP: wf_scale_mouse_event_ex(wfc, input, 0, GET_XBUTTON_WPARAM(wParam), - X_POS(lParam) - wfc->offset_x, Y_POS(lParam) - wfc->offset_y); + X_POS(lParam) - wfc->offset_x, + Y_POS(lParam) - wfc->offset_y); break; #endif @@ -378,8 +378,8 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, break; case WM_MBUTTONUP: - wf_scale_mouse_event(wfc, input, PTR_FLAGS_BUTTON3, - X_POS(lParam) - wfc->offset_x, Y_POS(lParam) - wfc->offset_y); + wf_scale_mouse_event(wfc, input, PTR_FLAGS_BUTTON3, X_POS(lParam) - wfc->offset_x, + Y_POS(lParam) - wfc->offset_y); break; case WM_LBUTTONDOWN: @@ -388,8 +388,8 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, break; case WM_LBUTTONUP: - wf_scale_mouse_event(wfc, input, PTR_FLAGS_BUTTON1, - X_POS(lParam) - wfc->offset_x, Y_POS(lParam) - wfc->offset_y); + wf_scale_mouse_event(wfc, input, PTR_FLAGS_BUTTON1, X_POS(lParam) - wfc->offset_x, + Y_POS(lParam) - wfc->offset_y); break; case WM_RBUTTONDOWN: @@ -398,8 +398,8 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, break; case WM_RBUTTONUP: - wf_scale_mouse_event(wfc, input, PTR_FLAGS_BUTTON2, - X_POS(lParam) - wfc->offset_x, Y_POS(lParam) - wfc->offset_y); + wf_scale_mouse_event(wfc, input, PTR_FLAGS_BUTTON2, X_POS(lParam) - wfc->offset_x, + Y_POS(lParam) - wfc->offset_y); break; case WM_MOUSEMOVE: @@ -432,161 +432,159 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, break; case WM_HSCROLL: + { + int xDelta; // xDelta = new_pos - current_pos + int xNewPos; // new position + int yDelta = 0; + + switch (LOWORD(wParam)) { - int xDelta; // xDelta = new_pos - current_pos - int xNewPos; // new position - int yDelta = 0; - - switch (LOWORD(wParam)) - { - // User clicked the scroll bar shaft left of the scroll box. - case SB_PAGEUP: - xNewPos = wfc->xCurrentScroll - 50; - break; - - // User clicked the scroll bar shaft right of the scroll box. - case SB_PAGEDOWN: - xNewPos = wfc->xCurrentScroll + 50; - break; - - // User clicked the left arrow. - case SB_LINEUP: - xNewPos = wfc->xCurrentScroll - 5; - break; - - // User clicked the right arrow. - case SB_LINEDOWN: - xNewPos = wfc->xCurrentScroll + 5; - break; - - // User dragged the scroll box. - case SB_THUMBPOSITION: - xNewPos = HIWORD(wParam); - break; - - // user is dragging the scrollbar - case SB_THUMBTRACK : - xNewPos = HIWORD(wParam); - break; - - default: - xNewPos = wfc->xCurrentScroll; - } - - // New position must be between 0 and the screen width. - xNewPos = MAX(0, xNewPos); - xNewPos = MIN(wfc->xMaxScroll, xNewPos); - - // If the current position does not change, do not scroll. - if (xNewPos == wfc->xCurrentScroll) + // User clicked the scroll bar shaft left of the scroll box. + case SB_PAGEUP: + xNewPos = wfc->xCurrentScroll - 50; break; - // Determine the amount scrolled (in pixels). - xDelta = xNewPos - wfc->xCurrentScroll; - // Reset the current scroll position. - wfc->xCurrentScroll = xNewPos; - // Scroll the window. (The system repaints most of the - // client area when ScrollWindowEx is called; however, it is - // necessary to call UpdateWindow in order to repaint the - // rectangle of pixels that were invalidated.) - ScrollWindowEx(wfc->hwnd, -xDelta, -yDelta, (CONST RECT*) NULL, - (CONST RECT*) NULL, (HRGN) NULL, (PRECT) NULL, - SW_INVALIDATE); - UpdateWindow(wfc->hwnd); - // Reset the scroll bar. - si.cbSize = sizeof(si); - si.fMask = SIF_POS; - si.nPos = wfc->xCurrentScroll; - SetScrollInfo(wfc->hwnd, SB_HORZ, &si, TRUE); + // User clicked the scroll bar shaft right of the scroll box. + case SB_PAGEDOWN: + xNewPos = wfc->xCurrentScroll + 50; + break; + + // User clicked the left arrow. + case SB_LINEUP: + xNewPos = wfc->xCurrentScroll - 5; + break; + + // User clicked the right arrow. + case SB_LINEDOWN: + xNewPos = wfc->xCurrentScroll + 5; + break; + + // User dragged the scroll box. + case SB_THUMBPOSITION: + xNewPos = HIWORD(wParam); + break; + + // user is dragging the scrollbar + case SB_THUMBTRACK: + xNewPos = HIWORD(wParam); + break; + + default: + xNewPos = wfc->xCurrentScroll; } - break; + + // New position must be between 0 and the screen width. + xNewPos = MAX(0, xNewPos); + xNewPos = MIN(wfc->xMaxScroll, xNewPos); + + // If the current position does not change, do not scroll. + if (xNewPos == wfc->xCurrentScroll) + break; + + // Determine the amount scrolled (in pixels). + xDelta = xNewPos - wfc->xCurrentScroll; + // Reset the current scroll position. + wfc->xCurrentScroll = xNewPos; + // Scroll the window. (The system repaints most of the + // client area when ScrollWindowEx is called; however, it is + // necessary to call UpdateWindow in order to repaint the + // rectangle of pixels that were invalidated.) + ScrollWindowEx(wfc->hwnd, -xDelta, -yDelta, (CONST RECT*)NULL, (CONST RECT*)NULL, + (HRGN)NULL, (PRECT)NULL, SW_INVALIDATE); + UpdateWindow(wfc->hwnd); + // Reset the scroll bar. + si.cbSize = sizeof(si); + si.fMask = SIF_POS; + si.nPos = wfc->xCurrentScroll; + SetScrollInfo(wfc->hwnd, SB_HORZ, &si, TRUE); + } + break; case WM_VSCROLL: + { + int xDelta = 0; + int yDelta; // yDelta = new_pos - current_pos + int yNewPos; // new position + + switch (LOWORD(wParam)) { - int xDelta = 0; - int yDelta; // yDelta = new_pos - current_pos - int yNewPos; // new position - - switch (LOWORD(wParam)) - { - // User clicked the scroll bar shaft above the scroll box. - case SB_PAGEUP: - yNewPos = wfc->yCurrentScroll - 50; - break; - - // User clicked the scroll bar shaft below the scroll box. - case SB_PAGEDOWN: - yNewPos = wfc->yCurrentScroll + 50; - break; - - // User clicked the top arrow. - case SB_LINEUP: - yNewPos = wfc->yCurrentScroll - 5; - break; - - // User clicked the bottom arrow. - case SB_LINEDOWN: - yNewPos = wfc->yCurrentScroll + 5; - break; - - // User dragged the scroll box. - case SB_THUMBPOSITION: - yNewPos = HIWORD(wParam); - break; - - // user is dragging the scrollbar - case SB_THUMBTRACK : - yNewPos = HIWORD(wParam); - break; - - default: - yNewPos = wfc->yCurrentScroll; - } - - // New position must be between 0 and the screen height. - yNewPos = MAX(0, yNewPos); - yNewPos = MIN(wfc->yMaxScroll, yNewPos); - - // If the current position does not change, do not scroll. - if (yNewPos == wfc->yCurrentScroll) + // User clicked the scroll bar shaft above the scroll box. + case SB_PAGEUP: + yNewPos = wfc->yCurrentScroll - 50; break; - // Determine the amount scrolled (in pixels). - yDelta = yNewPos - wfc->yCurrentScroll; - // Reset the current scroll position. - wfc->yCurrentScroll = yNewPos; - // Scroll the window. (The system repaints most of the - // client area when ScrollWindowEx is called; however, it is - // necessary to call UpdateWindow in order to repaint the - // rectangle of pixels that were invalidated.) - ScrollWindowEx(wfc->hwnd, -xDelta, -yDelta, (CONST RECT*) NULL, - (CONST RECT*) NULL, (HRGN) NULL, (PRECT) NULL, - SW_INVALIDATE); - UpdateWindow(wfc->hwnd); - // Reset the scroll bar. - si.cbSize = sizeof(si); - si.fMask = SIF_POS; - si.nPos = wfc->yCurrentScroll; - SetScrollInfo(wfc->hwnd, SB_VERT, &si, TRUE); + // User clicked the scroll bar shaft below the scroll box. + case SB_PAGEDOWN: + yNewPos = wfc->yCurrentScroll + 50; + break; + + // User clicked the top arrow. + case SB_LINEUP: + yNewPos = wfc->yCurrentScroll - 5; + break; + + // User clicked the bottom arrow. + case SB_LINEDOWN: + yNewPos = wfc->yCurrentScroll + 5; + break; + + // User dragged the scroll box. + case SB_THUMBPOSITION: + yNewPos = HIWORD(wParam); + break; + + // user is dragging the scrollbar + case SB_THUMBTRACK: + yNewPos = HIWORD(wParam); + break; + + default: + yNewPos = wfc->yCurrentScroll; } - break; + + // New position must be between 0 and the screen height. + yNewPos = MAX(0, yNewPos); + yNewPos = MIN(wfc->yMaxScroll, yNewPos); + + // If the current position does not change, do not scroll. + if (yNewPos == wfc->yCurrentScroll) + break; + + // Determine the amount scrolled (in pixels). + yDelta = yNewPos - wfc->yCurrentScroll; + // Reset the current scroll position. + wfc->yCurrentScroll = yNewPos; + // Scroll the window. (The system repaints most of the + // client area when ScrollWindowEx is called; however, it is + // necessary to call UpdateWindow in order to repaint the + // rectangle of pixels that were invalidated.) + ScrollWindowEx(wfc->hwnd, -xDelta, -yDelta, (CONST RECT*)NULL, (CONST RECT*)NULL, + (HRGN)NULL, (PRECT)NULL, SW_INVALIDATE); + UpdateWindow(wfc->hwnd); + // Reset the scroll bar. + si.cbSize = sizeof(si); + si.fMask = SIF_POS; + si.nPos = wfc->yCurrentScroll; + SetScrollInfo(wfc->hwnd, SB_VERT, &si, TRUE); + } + break; case WM_SYSCOMMAND: + { + if (wParam == SYSCOMMAND_ID_SMARTSIZING) { - if (wParam == SYSCOMMAND_ID_SMARTSIZING) - { - HMENU hMenu = GetSystemMenu(wfc->hwnd, FALSE); - freerdp_set_param_bool(wfc->context.settings, FreeRDP_SmartSizing, - !wfc->context.settings->SmartSizing); - CheckMenuItem(hMenu, SYSCOMMAND_ID_SMARTSIZING, - wfc->context.settings->SmartSizing ? MF_CHECKED : MF_UNCHECKED); - } - else - { - processed = FALSE; - } + HMENU hMenu = GetSystemMenu(wfc->hwnd, FALSE); + freerdp_set_param_bool(wfc->context.settings, FreeRDP_SmartSizing, + !wfc->context.settings->SmartSizing); + CheckMenuItem(hMenu, SYSCOMMAND_ID_SMARTSIZING, + wfc->context.settings->SmartSizing ? MF_CHECKED : MF_UNCHECKED); } - break; + else + { + processed = FALSE; + } + } + break; default: processed = FALSE; @@ -631,24 +629,24 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, break; case WM_ACTIVATE: + { + int activate = (int)(short)LOWORD(wParam); + + if (activate != WA_INACTIVE) { - int activate = (int)(short) LOWORD(wParam); + if (alt_ctrl_down()) + g_flipping_in = TRUE; - if (activate != WA_INACTIVE) - { - if (alt_ctrl_down()) - g_flipping_in = TRUE; - - g_focus_hWnd = hWnd; - } - else - { - if (alt_ctrl_down()) - g_flipping_out = TRUE; - else - g_focus_hWnd = NULL; - } + g_focus_hWnd = hWnd; } + else + { + if (alt_ctrl_down()) + g_flipping_out = TRUE; + else + g_focus_hWnd = NULL; + } + } default: return DefWindowProc(hWnd, Msg, wParam, lParam); @@ -658,8 +656,8 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, return 0; } -BOOL wf_scale_blt(wfContext* wfc, HDC hdc, int x, int y, int w, int h, - HDC hdcSrc, int x1, int y1, DWORD rop) +BOOL wf_scale_blt(wfContext* wfc, HDC hdc, int x, int y, int w, int h, HDC hdcSrc, int x1, int y1, + DWORD rop) { rdpSettings* settings; UINT32 ww, wh, dw, dh; @@ -682,8 +680,7 @@ BOOL wf_scale_blt(wfContext* wfc, HDC hdc, int x, int y, int w, int h, if (!wh) wh = dh; - if (wfc->fullscreen || !wfc->context.settings->SmartSizing || (ww == dw - && wh == dh)) + if (wfc->fullscreen || !wfc->context.settings->SmartSizing || (ww == dw && wh == dh)) { return BitBlt(hdc, x, y, w, h, wfc->primary->hdc, x1, y1, SRCCOPY); } @@ -736,8 +733,7 @@ static BOOL wf_scale_mouse_pos(wfContext* wfc, UINT16* x, UINT16* y) return TRUE; } -static BOOL wf_scale_mouse_event(wfContext* wfc, rdpInput* input, UINT16 flags, - UINT16 x, UINT16 y) +static BOOL wf_scale_mouse_event(wfContext* wfc, rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) { MouseEventEventArgs eventArgs; @@ -754,10 +750,9 @@ static BOOL wf_scale_mouse_event(wfContext* wfc, rdpInput* input, UINT16 flags, return TRUE; } -#if(_WIN32_WINNT >= 0x0500) +#if (_WIN32_WINNT >= 0x0500) static BOOL wf_scale_mouse_event_ex(wfContext* wfc, rdpInput* input, UINT16 flags, - UINT16 buttonMask, - UINT16 x, UINT16 y) + UINT16 buttonMask, UINT16 x, UINT16 y) { MouseEventExEventArgs eventArgs; diff --git a/client/Windows/wf_event.h b/client/Windows/wf_event.h index a9d710851..f879f873a 100644 --- a/client/Windows/wf_event.h +++ b/client/Windows/wf_event.h @@ -26,8 +26,7 @@ #include LRESULT CALLBACK wf_ll_kbd_proc(int nCode, WPARAM wParam, LPARAM lParam); -LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, - LPARAM lParam); +LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); void wf_event_focus_in(wfContext* wfc); @@ -35,7 +34,10 @@ void wf_event_focus_in(wfContext* wfc); #ifdef WITH_DEBUG_KBD #define DEBUG_KBD(...) WLog_DBG(KBD_TAG, __VA_ARGS__) #else -#define DEBUG_KBD(...) do { } while (0) +#define DEBUG_KBD(...) \ + do \ + { \ + } while (0) #endif #endif /* FREERDP_CLIENT_WIN_EVENT_H */ diff --git a/client/Windows/wf_floatbar.c b/client/Windows/wf_floatbar.c index ed3a2b764..512c66b47 100644 --- a/client/Windows/wf_floatbar.c +++ b/client/Windows/wf_floatbar.c @@ -25,38 +25,38 @@ #include "wf_client.h" #include "wf_floatbar.h" #include "wf_gdi.h" -#pragma comment( lib, "Msimg32.lib" ) +#pragma comment(lib, "Msimg32.lib") #define TAG CLIENT_TAG("windows.floatbar") typedef struct _Button Button; /* TIMERs */ -#define TIMER_HIDE 1 -#define TIMER_ANIMAT_SHOW 2 -#define TIMER_ANIMAT_HIDE 3 +#define TIMER_HIDE 1 +#define TIMER_ANIMAT_SHOW 2 +#define TIMER_ANIMAT_HIDE 3 /* Button Type */ -#define BUTTON_LOCKPIN 0 -#define BUTTON_MINIMIZE 1 -#define BUTTON_RESTORE 2 -#define BUTTON_CLOSE 3 -#define BTN_MAX 4 +#define BUTTON_LOCKPIN 0 +#define BUTTON_MINIMIZE 1 +#define BUTTON_RESTORE 2 +#define BUTTON_CLOSE 3 +#define BTN_MAX 4 /* bmp size */ -#define BACKGROUND_W 576 -#define BACKGROUND_H 27 -#define BUTTON_OFFSET 5 -#define BUTTON_Y 2 -#define BUTTON_WIDTH 23 -#define BUTTON_HEIGHT 21 -#define BUTTON_SPACING 1 +#define BACKGROUND_W 576 +#define BACKGROUND_H 27 +#define BUTTON_OFFSET 5 +#define BUTTON_Y 2 +#define BUTTON_WIDTH 23 +#define BUTTON_HEIGHT 21 +#define BUTTON_SPACING 1 -#define LOCK_X ( BACKGROUND_H + BUTTON_OFFSET ) -#define CLOSE_X ( (BACKGROUND_W - ( BACKGROUND_H + BUTTON_OFFSET ) ) - BUTTON_WIDTH ) -#define RESTORE_X ( CLOSE_X - ( BUTTON_WIDTH + BUTTON_SPACING ) ) -#define MINIMIZE_X ( RESTORE_X - ( BUTTON_WIDTH + BUTTON_SPACING ) ) -#define TEXT_X ( BACKGROUND_H + ( ( BUTTON_WIDTH + BUTTON_SPACING ) * 3 ) + 5 ) +#define LOCK_X (BACKGROUND_H + BUTTON_OFFSET) +#define CLOSE_X ((BACKGROUND_W - (BACKGROUND_H + BUTTON_OFFSET)) - BUTTON_WIDTH) +#define RESTORE_X (CLOSE_X - (BUTTON_WIDTH + BUTTON_SPACING)) +#define MINIMIZE_X (RESTORE_X - (BUTTON_WIDTH + BUTTON_SPACING)) +#define TEXT_X (BACKGROUND_H + ((BUTTON_WIDTH + BUTTON_SPACING) * 3) + 5) struct _Button { @@ -96,12 +96,7 @@ struct _FloatBar static BOOL floatbar_kill_timers(wfFloatBar* floatbar) { size_t x; - UINT_PTR timers[] = - { - TIMER_HIDE, - TIMER_ANIMAT_HIDE, - TIMER_ANIMAT_SHOW - }; + UINT_PTR timers[] = { TIMER_HIDE, TIMER_ANIMAT_HIDE, TIMER_ANIMAT_SHOW }; if (!floatbar) return FALSE; @@ -115,7 +110,7 @@ static BOOL floatbar_kill_timers(wfFloatBar* floatbar) static BOOL floatbar_animation(wfFloatBar* const floatbar, const BOOL show) { - UINT_PTR timer = show ? TIMER_ANIMAT_SHOW : TIMER_ANIMAT_HIDE; + UINT_PTR timer = show ? TIMER_ANIMAT_SHOW : TIMER_ANIMAT_HIDE; if (!floatbar) return FALSE; @@ -131,7 +126,7 @@ static BOOL floatbar_animation(wfFloatBar* const floatbar, const BOOL show) if (SetTimer(floatbar->hwnd, timer, USER_TIMER_MINIMUM, NULL) == NULL) { DWORD err = GetLastError(); - WLog_ERR(TAG, "SetTimer failed with %08"PRIx32, err); + WLog_ERR(TAG, "SetTimer failed with %08" PRIx32, err); return FALSE; } @@ -148,7 +143,7 @@ static BOOL floatbar_trigger_hide(wfFloatBar* floatbar) if (SetTimer(floatbar->hwnd, TIMER_HIDE, 3000, NULL) == NULL) { DWORD err = GetLastError(); - WLog_ERR(TAG, "SetTimer failed with %08"PRIx32, err); + WLog_ERR(TAG, "SetTimer failed with %08" PRIx32, err); return FALSE; } } @@ -163,11 +158,11 @@ static BOOL floatbar_hide(wfFloatBar* floatbar) floatbar->offset = floatbar->height - 2; - if (!MoveWindow(floatbar->hwnd, floatbar->rect.left, -floatbar->offset, - floatbar->width, floatbar->height, TRUE)) + if (!MoveWindow(floatbar->hwnd, floatbar->rect.left, -floatbar->offset, floatbar->width, + floatbar->height, TRUE)) { DWORD err = GetLastError(); - WLog_ERR(TAG, "MoveWindow failed with %08"PRIx32, err); + WLog_ERR(TAG, "MoveWindow failed with %08" PRIx32, err); return FALSE; } @@ -186,11 +181,11 @@ static BOOL floatbar_show(wfFloatBar* floatbar) floatbar->offset = 0; - if (!MoveWindow(floatbar->hwnd, floatbar->rect.left, -floatbar->offset, - floatbar->width, floatbar->height, TRUE)) + if (!MoveWindow(floatbar->hwnd, floatbar->rect.left, -floatbar->offset, floatbar->width, + floatbar->height, TRUE)) { DWORD err = GetLastError(); - WLog_ERR(TAG, "MoveWindow failed with %08"PRIx32, err); + WLog_ERR(TAG, "MoveWindow failed with %08" PRIx32, err); return FALSE; } @@ -235,7 +230,7 @@ static BOOL update_locked_state(wfFloatBar* floatbar) return TRUE; } -static int button_hit(Button* const button) +static int button_hit(Button* const button) { wfFloatBar* const floatbar = button->floatbar; @@ -276,17 +271,18 @@ static int button_paint(const Button* const button, const HDC hdc) bf.BlendFlags = 0; bf.SourceConstantAlpha = 255; bf.AlphaFormat = AC_SRC_ALPHA; - AlphaBlend(hdc, button->x, button->y, button->w, button->h, floatbar->hdcmem, 0, 0, button->w, - button->h, bf); + AlphaBlend(hdc, button->x, button->y, button->w, button->h, floatbar->hdcmem, 0, 0, + button->w, button->h, bf); } return 0; } static Button* floatbar_create_button(wfFloatBar* const floatbar, const int type, const int resid, - const int resid_act, const int x, const int y, const int h, const int w) + const int resid_act, const int x, const int y, const int h, + const int w) { - Button* button = (Button*) calloc(1, sizeof(Button)); + Button* button = (Button*)calloc(1, sizeof(Button)); if (!button) return NULL; @@ -306,12 +302,12 @@ static Button* floatbar_create_button(wfFloatBar* const floatbar, const int type } static Button* floatbar_create_lock_button(wfFloatBar* const floatbar, const int unlock_resid, - const int unlock_resid_act, const int lock_resid, const int lock_resid_act, const int x, - const int y, const int h, const int w) + const int unlock_resid_act, const int lock_resid, + const int lock_resid_act, const int x, const int y, + const int h, const int w) { - Button* button = floatbar_create_button(floatbar, BUTTON_LOCKPIN, unlock_resid, unlock_resid_act, x, - y, h, - w); + Button* button = floatbar_create_button(floatbar, BUTTON_LOCKPIN, unlock_resid, + unlock_resid_act, x, y, h, w); if (!button) return NULL; @@ -320,8 +316,9 @@ static Button* floatbar_create_lock_button(wfFloatBar* const floatbar, const int button->unlocked_bmp_act = button->bmp_act; button->locked_bmp = (HBITMAP)LoadImage(floatbar->wfc->hInstance, MAKEINTRESOURCE(lock_resid), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); - button->locked_bmp_act = (HBITMAP)LoadImage(floatbar->wfc->hInstance, - MAKEINTRESOURCE(lock_resid_act), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); + button->locked_bmp_act = + (HBITMAP)LoadImage(floatbar->wfc->hInstance, MAKEINTRESOURCE(lock_resid_act), IMAGE_BITMAP, + 0, 0, LR_DEFAULTCOLOR); return button; } @@ -358,21 +355,18 @@ static BOOL floatbar_paint(wfFloatBar* const floatbar, const HDC hdc) int bottom = BACKGROUND_H - 1; int right = BACKGROUND_W - 1; const int angleOffset = BACKGROUND_H - 1; - TRIVERTEX triVertext[2] = - { - left, - top, - GetRValue(rgbTop) << 8, - GetGValue(rgbTop) << 8, - GetBValue(rgbTop) << 8, - 0x0000, - right, - bottom, - GetRValue(rgbBottom) << 8, - GetGValue(rgbBottom) << 8, - GetBValue(rgbBottom) << 8, - 0x0000 - }; + TRIVERTEX triVertext[2] = { left, + top, + GetRValue(rgbTop) << 8, + GetGValue(rgbTop) << 8, + GetBValue(rgbTop) << 8, + 0x0000, + right, + bottom, + GetRValue(rgbBottom) << 8, + GetGValue(rgbBottom) << 8, + GetBValue(rgbBottom) << 8, + 0x0000 }; if (!floatbar) return FALSE; @@ -397,7 +391,8 @@ static BOOL floatbar_paint(wfFloatBar* const floatbar, const HDC hdc) LineTo(hdc, right + 1, top - 1); DeleteObject(hpen); SelectObject(hdc, orig); - DrawText(hdc, floatbar->wfc->window_title, wcslen(floatbar->wfc->window_title), &floatbar->textRect, + DrawText(hdc, floatbar->wfc->window_title, wcslen(floatbar->wfc->window_title), + &floatbar->textRect, DT_CENTER | DT_VCENTER | DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE); /* paint buttons */ @@ -427,7 +422,7 @@ static LRESULT CALLBACK floatbar_proc(const HWND hWnd, const UINT Msg, const WPA switch (Msg) { case WM_CREATE: - floatbar = ((wfFloatBar*)((CREATESTRUCT*) lParam)->lpCreateParams); + floatbar = ((wfFloatBar*)((CREATESTRUCT*)lParam)->lpCreateParams); floatbar->hwnd = hWnd; GetWindowRect(floatbar->hwnd, &floatbar->rect); floatbar->width = floatbar->rect.right - floatbar->rect.left; @@ -537,23 +532,23 @@ static LRESULT CALLBACK floatbar_proc(const HWND hWnd, const UINT Msg, const WPA break; case WM_MOUSELEAVE: + { + int i; + + for (i = 0; i < BTN_MAX; i++) { - int i; - - for (i = 0; i < BTN_MAX; i++) + if (floatbar->buttons[i] != NULL) { - if (floatbar->buttons[i] != NULL) - { - floatbar->buttons[i]->active = FALSE; - } + floatbar->buttons[i]->active = FALSE; } - - InvalidateRect(hWnd, NULL, FALSE); - UpdateWindow(hWnd); - floatbar_trigger_hide(floatbar); - break; } + InvalidateRect(hWnd, NULL, FALSE); + UpdateWindow(hWnd); + floatbar_trigger_hide(floatbar); + break; + } + case WM_TIMER: switch (wParam) { @@ -562,28 +557,28 @@ static LRESULT CALLBACK floatbar_proc(const HWND hWnd, const UINT Msg, const WPA break; case TIMER_ANIMAT_SHOW: - { - floatbar->offset--; - MoveWindow(floatbar->hwnd, floatbar->rect.left, -floatbar->offset, floatbar->width, - floatbar->height, TRUE); + { + floatbar->offset--; + MoveWindow(floatbar->hwnd, floatbar->rect.left, -floatbar->offset, + floatbar->width, floatbar->height, TRUE); - if (floatbar->offset <= 0) - floatbar_show(floatbar); + if (floatbar->offset <= 0) + floatbar_show(floatbar); - break; - } + break; + } case TIMER_ANIMAT_HIDE: - { - floatbar->offset++; - MoveWindow(floatbar->hwnd, floatbar->rect.left, -floatbar->offset, - floatbar->width, floatbar->height, TRUE); + { + floatbar->offset++; + MoveWindow(floatbar->hwnd, floatbar->rect.left, -floatbar->offset, + floatbar->width, floatbar->height, TRUE); - if (floatbar->offset >= floatbar->height - 2) - floatbar_hide(floatbar); + if (floatbar->offset >= floatbar->height - 2) + floatbar_hide(floatbar); - break; - } + break; + } default: break; @@ -619,22 +614,21 @@ static BOOL floatbar_window_create(wfFloatBar* floatbar) return FALSE; x = (rect.right - rect.left - BACKGROUND_W) / 2; - wnd_cls.cbSize = sizeof(WNDCLASSEX); - wnd_cls.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; - wnd_cls.lpfnWndProc = floatbar_proc; - wnd_cls.cbClsExtra = 0; - wnd_cls.cbWndExtra = 0; - wnd_cls.hIcon = LoadIcon(NULL, IDI_APPLICATION); - wnd_cls.hCursor = LoadCursor(floatbar->root_window, IDC_ARROW); + wnd_cls.cbSize = sizeof(WNDCLASSEX); + wnd_cls.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; + wnd_cls.lpfnWndProc = floatbar_proc; + wnd_cls.cbClsExtra = 0; + wnd_cls.cbWndExtra = 0; + wnd_cls.hIcon = LoadIcon(NULL, IDI_APPLICATION); + wnd_cls.hCursor = LoadCursor(floatbar->root_window, IDC_ARROW); wnd_cls.hbrBackground = NULL; - wnd_cls.lpszMenuName = NULL; + wnd_cls.lpszMenuName = NULL; wnd_cls.lpszClassName = L"floatbar"; - wnd_cls.hInstance = floatbar->root_window; - wnd_cls.hIconSm = LoadIcon(NULL, IDI_APPLICATION); + wnd_cls.hInstance = floatbar->root_window; + wnd_cls.hIconSm = LoadIcon(NULL, IDI_APPLICATION); RegisterClassEx(&wnd_cls); - barWnd = CreateWindowEx(WS_EX_TOPMOST, L"floatbar", L"floatbar", WS_CHILD, x, 0, - BACKGROUND_W, BACKGROUND_H, floatbar->parent, NULL, - floatbar->root_window, floatbar); + barWnd = CreateWindowEx(WS_EX_TOPMOST, L"floatbar", L"floatbar", WS_CHILD, x, 0, BACKGROUND_W, + BACKGROUND_H, floatbar->parent, NULL, floatbar->root_window, floatbar); if (barWnd == NULL) return FALSE; @@ -672,7 +666,7 @@ wfFloatBar* wf_floatbar_new(wfContext* wfc, HINSTANCE window, DWORD flags) return NULL; // TODO: Disable for remote app - floatbar = (wfFloatBar*) calloc(1, sizeof(wfFloatBar)); + floatbar = (wfFloatBar*)calloc(1, sizeof(wfFloatBar)); if (!floatbar) return NULL; @@ -688,10 +682,12 @@ wfFloatBar* wf_floatbar_new(wfContext* wfc, HINSTANCE window, DWORD flags) if (wfc->fullscreen_toggle) { - floatbar->buttons[0] = floatbar_create_button(floatbar, BUTTON_MINIMIZE, IDB_MINIMIZE, - IDB_MINIMIZE_ACT, MINIMIZE_X, BUTTON_Y, BUTTON_HEIGHT, BUTTON_WIDTH); - floatbar->buttons[1] = floatbar_create_button(floatbar, BUTTON_RESTORE, IDB_RESTORE, - IDB_RESTORE_ACT, RESTORE_X, BUTTON_Y, BUTTON_HEIGHT, BUTTON_WIDTH); + floatbar->buttons[0] = + floatbar_create_button(floatbar, BUTTON_MINIMIZE, IDB_MINIMIZE, IDB_MINIMIZE_ACT, + MINIMIZE_X, BUTTON_Y, BUTTON_HEIGHT, BUTTON_WIDTH); + floatbar->buttons[1] = + floatbar_create_button(floatbar, BUTTON_RESTORE, IDB_RESTORE, IDB_RESTORE_ACT, + RESTORE_X, BUTTON_Y, BUTTON_HEIGHT, BUTTON_WIDTH); } else { @@ -700,9 +696,10 @@ wfFloatBar* wf_floatbar_new(wfContext* wfc, HINSTANCE window, DWORD flags) } floatbar->buttons[2] = floatbar_create_button(floatbar, BUTTON_CLOSE, IDB_CLOSE, IDB_CLOSE_ACT, - CLOSE_X, BUTTON_Y, BUTTON_HEIGHT, BUTTON_WIDTH); - floatbar->buttons[3] = floatbar_create_lock_button(floatbar, IDB_UNLOCK, IDB_UNLOCK_ACT, IDB_LOCK, - IDB_LOCK_ACT, LOCK_X, BUTTON_Y, BUTTON_HEIGHT, BUTTON_WIDTH); + CLOSE_X, BUTTON_Y, BUTTON_HEIGHT, BUTTON_WIDTH); + floatbar->buttons[3] = + floatbar_create_lock_button(floatbar, IDB_UNLOCK, IDB_UNLOCK_ACT, IDB_LOCK, IDB_LOCK_ACT, + LOCK_X, BUTTON_Y, BUTTON_HEIGHT, BUTTON_WIDTH); if (!floatbar_window_create(floatbar)) goto fail; diff --git a/client/Windows/wf_gdi.c b/client/Windows/wf_gdi.c index d91c00481..329f43a75 100644 --- a/client/Windows/wf_gdi.c +++ b/client/Windows/wf_gdi.c @@ -43,8 +43,7 @@ #define TAG CLIENT_TAG("windows.gdi") -static const BYTE wf_rop2_table[] = -{ +static const BYTE wf_rop2_table[] = { R2_BLACK, /* 0 */ R2_NOTMERGEPEN, /* DPon */ R2_MASKNOTPEN, /* DPna */ @@ -63,8 +62,7 @@ static const BYTE wf_rop2_table[] = R2_WHITE, /* 1 */ }; -static BOOL wf_decode_color(wfContext* wfc, const UINT32 srcColor, - COLORREF* color, UINT32* format) +static BOOL wf_decode_color(wfContext* wfc, const UINT32 srcColor, COLORREF* color, UINT32* format) { rdpGdi* gdi; rdpSettings* settings; @@ -102,8 +100,7 @@ static BOOL wf_decode_color(wfContext* wfc, const UINT32 srcColor, return FALSE; } - *color = FreeRDPConvertColor(srcColor, SrcFormat, - DstFormat, &gdi->palette); + *color = FreeRDPConvertColor(srcColor, SrcFormat, DstFormat, &gdi->palette); return TRUE; } @@ -111,7 +108,7 @@ static BOOL wf_set_rop2(HDC hdc, int rop2) { if ((rop2 < 0x01) || (rop2 > 0x10)) { - WLog_ERR(TAG, "Unsupported ROP2: %d", rop2); + WLog_ERR(TAG, "Unsupported ROP2: %d", rop2); return FALSE; } @@ -122,8 +119,7 @@ static BOOL wf_set_rop2(HDC hdc, int rop2) static wfBitmap* wf_glyph_new(wfContext* wfc, GLYPH_DATA* glyph) { wfBitmap* glyph_bmp; - glyph_bmp = wf_image_new(wfc, glyph->cx, glyph->cy, PIXEL_FORMAT_MONO, - glyph->aj); + glyph_bmp = wf_image_new(wfc, glyph->cx, glyph->cy, PIXEL_FORMAT_MONO, glyph->aj); return glyph_bmp; } @@ -143,7 +139,7 @@ static BYTE* wf_glyph_convert(wfContext* wfc, int width, int height, BYTE* data) int dst_bytes_per_row; src_bytes_per_row = (width + 7) / 8; dst_bytes_per_row = src_bytes_per_row + (src_bytes_per_row % 2); - cdata = (BYTE*) malloc(dst_bytes_per_row * height); + cdata = (BYTE*)malloc(dst_bytes_per_row * height); src = data; for (indexy = 0; indexy < height; indexy++) @@ -162,8 +158,7 @@ static BYTE* wf_glyph_convert(wfContext* wfc, int width, int height, BYTE* data) return cdata; } -static HBRUSH wf_create_brush(wfContext* wfc, rdpBrush* brush, UINT32 color, - UINT32 bpp) +static HBRUSH wf_create_brush(wfContext* wfc, rdpBrush* brush, UINT32 color, UINT32 bpp) { UINT32 i; HBRUSH br; @@ -173,8 +168,8 @@ static HBRUSH wf_create_brush(wfContext* wfc, rdpBrush* brush, UINT32 color, HBITMAP pattern = NULL; lbr.lbStyle = brush->style; - if (lbr.lbStyle == BS_DIBPATTERN || lbr.lbStyle == BS_DIBPATTERN8X8 - || lbr.lbStyle == BS_DIBPATTERNPT) + if (lbr.lbStyle == BS_DIBPATTERN || lbr.lbStyle == BS_DIBPATTERN8X8 || + lbr.lbStyle == BS_DIBPATTERNPT) lbr.lbColor = DIB_RGB_COLORS; else lbr.lbColor = color; @@ -185,7 +180,7 @@ static HBRUSH wf_create_brush(wfContext* wfc, rdpBrush* brush, UINT32 color, { UINT32 format = gdi_get_pixel_format(bpp); pattern = wf_create_dib(wfc, 8, 8, format, brush->data, NULL); - lbr.lbHatch = (ULONG_PTR) pattern; + lbr.lbHatch = (ULONG_PTR)pattern; } else { @@ -194,7 +189,7 @@ static HBRUSH wf_create_brush(wfContext* wfc, rdpBrush* brush, UINT32 color, cdata = wf_glyph_convert(wfc, 8, 8, ipattern); pattern = CreateBitmap(8, 8, 1, 1, cdata); - lbr.lbHatch = (ULONG_PTR) pattern; + lbr.lbHatch = (ULONG_PTR)pattern; free(cdata); } } @@ -262,8 +257,7 @@ static BOOL wf_scale_rect(wfContext* wfc, RECT* source) return TRUE; } -void wf_invalidate_region(wfContext* wfc, UINT32 x, UINT32 y, UINT32 width, - UINT32 height) +void wf_invalidate_region(wfContext* wfc, UINT32 x, UINT32 y, UINT32 width, UINT32 height) { RECT rect; rdpGdi* gdi = wfc->context.gdi; @@ -278,8 +272,7 @@ void wf_invalidate_region(wfContext* wfc, UINT32 x, UINT32 y, UINT32 width, rect.top = y; rect.bottom = height; wf_scale_rect(wfc, &rect); - gdi_InvalidateRegion(gdi->primary->hdc, rect.left, rect.top, rect.right, - rect.bottom); + gdi_InvalidateRegion(gdi->primary->hdc, rect.left, rect.top, rect.right, rect.bottom); } void wf_update_offset(wfContext* wfc) @@ -363,14 +356,14 @@ void wf_resize_window(wfContext* wfc) wf_update_canvas_diff(wfc); /* Now resize to get full canvas size and room for caption and borders */ SetWindowPos(wfc->hwnd, HWND_TOP, wfc->client_x, wfc->client_y, - wfc->client_width + wfc->diff.x, wfc->client_height + wfc->diff.y, - 0 /*SWP_FRAMECHANGED*/); + wfc->client_width + wfc->diff.x, wfc->client_height + wfc->diff.y, + 0 /*SWP_FRAMECHANGED*/); } else { /* Now resize to get full canvas size and room for caption and borders */ - SetWindowPos(wfc->hwnd, HWND_TOP, 0, 0, settings->DesktopWidth, - settings->DesktopHeight, SWP_FRAMECHANGED); + SetWindowPos(wfc->hwnd, HWND_TOP, 0, 0, settings->DesktopWidth, settings->DesktopHeight, + SWP_FRAMECHANGED); wf_update_canvas_diff(wfc); SetWindowPos(wfc->hwnd, HWND_TOP, -1, -1, settings->DesktopWidth + wfc->diff.x, settings->DesktopHeight + wfc->diff.y, SWP_NOMOVE | SWP_FRAMECHANGED); @@ -380,7 +373,7 @@ void wf_resize_window(wfContext* wfc) { SetWindowLongPtr(wfc->hwnd, GWL_STYLE, WS_CAPTION | WS_OVERLAPPED | WS_SYSMENU | WS_MINIMIZEBOX | WS_SIZEBOX | - WS_MAXIMIZEBOX); + WS_MAXIMIZEBOX); if (!wfc->client_height) wfc->client_height = settings->DesktopHeight; @@ -399,7 +392,7 @@ void wf_resize_window(wfContext* wfc) SetWindowPos(wfc->hwnd, HWND_TOP, wfc->client_x, wfc->client_y, wfc->client_width + wfc->diff.x, wfc->client_height + wfc->diff.y, 0 /*SWP_FRAMECHANGED*/); - //wf_size_scrollbars(wfc, wfc->client_width, wfc->client_height); + // wf_size_scrollbars(wfc, wfc->client_width, wfc->client_height); } wf_update_offset(wfc); @@ -423,13 +416,13 @@ void wf_toggle_fullscreen(wfContext* wfc) if (!wfc->fullscreen) { - // Reenable window tracking AFTER resizing it back, otherwise it can lean to repositioning errors. + // Reenable window tracking AFTER resizing it back, otherwise it can lean to repositioning + // errors. wfc->disablewindowtracking = FALSE; } } -static BOOL wf_gdi_palette_update(rdpContext* context, - const PALETTE_UPDATE* palette) +static BOOL wf_gdi_palette_update(rdpContext* context, const PALETTE_UPDATE* palette) { return TRUE; } @@ -457,8 +450,7 @@ static BOOL wf_gdi_set_bounds(rdpContext* context, const rdpBounds* bounds) if (bounds != NULL) { - hrgn = CreateRectRgn(bounds->left, bounds->top, bounds->right + 1, - bounds->bottom + 1); + hrgn = CreateRectRgn(bounds->left, bounds->top, bounds->right + 1, bounds->bottom + 1); SelectClipRgn(wfc->drawing->hdc, hrgn); DeleteObject(hrgn); } @@ -475,12 +467,11 @@ static BOOL wf_gdi_dstblt(rdpContext* context, const DSTBLT_ORDER* dstblt) if (!context || !dstblt) return FALSE; - if (!BitBlt(wfc->drawing->hdc, dstblt->nLeftRect, dstblt->nTopRect, - dstblt->nWidth, dstblt->nHeight, NULL, 0, 0, gdi_rop3_code(dstblt->bRop))) + if (!BitBlt(wfc->drawing->hdc, dstblt->nLeftRect, dstblt->nTopRect, dstblt->nWidth, + dstblt->nHeight, NULL, 0, 0, gdi_rop3_code(dstblt->bRop))) return FALSE; - wf_invalidate_region(wfc, dstblt->nLeftRect, dstblt->nTopRect, - dstblt->nWidth, dstblt->nHeight); + wf_invalidate_region(wfc, dstblt->nLeftRect, dstblt->nTopRect, dstblt->nWidth, dstblt->nHeight); return TRUE; } @@ -505,14 +496,13 @@ static BOOL wf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt) if (!wf_decode_color(wfc, patblt->backColor, &bgcolor, NULL)) return FALSE; - brush = wf_create_brush(wfc, &patblt->brush, fgcolor, - context->settings->ColorDepth); + brush = wf_create_brush(wfc, &patblt->brush, fgcolor, context->settings->ColorDepth); org_bkmode = SetBkMode(wfc->drawing->hdc, OPAQUE); org_bkcolor = SetBkColor(wfc->drawing->hdc, bgcolor); org_textcolor = SetTextColor(wfc->drawing->hdc, fgcolor); org_brush = (HBRUSH)SelectObject(wfc->drawing->hdc, brush); - rc = PatBlt(wfc->drawing->hdc, patblt->nLeftRect, patblt->nTopRect, - patblt->nWidth, patblt->nHeight, gdi_rop3_code(patblt->bRop)); + rc = PatBlt(wfc->drawing->hdc, patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, + patblt->nHeight, gdi_rop3_code(patblt->bRop)); SelectObject(wfc->drawing->hdc, org_brush); DeleteObject(brush); SetBkMode(wfc->drawing->hdc, org_bkmode); @@ -533,18 +523,16 @@ static BOOL wf_gdi_scrblt(rdpContext* context, const SCRBLT_ORDER* scrblt) if (!context || !scrblt || !wfc->drawing) return FALSE; - if (!BitBlt(wfc->drawing->hdc, scrblt->nLeftRect, scrblt->nTopRect, - scrblt->nWidth, scrblt->nHeight, wfc->primary->hdc, - scrblt->nXSrc, scrblt->nYSrc, gdi_rop3_code(scrblt->bRop))) + if (!BitBlt(wfc->drawing->hdc, scrblt->nLeftRect, scrblt->nTopRect, scrblt->nWidth, + scrblt->nHeight, wfc->primary->hdc, scrblt->nXSrc, scrblt->nYSrc, + gdi_rop3_code(scrblt->bRop))) return FALSE; - wf_invalidate_region(wfc, scrblt->nLeftRect, scrblt->nTopRect, - scrblt->nWidth, scrblt->nHeight); + wf_invalidate_region(wfc, scrblt->nLeftRect, scrblt->nTopRect, scrblt->nWidth, scrblt->nHeight); return TRUE; } -static BOOL wf_gdi_opaque_rect(rdpContext* context, - const OPAQUE_RECT_ORDER* opaque_rect) +static BOOL wf_gdi_opaque_rect(rdpContext* context, const OPAQUE_RECT_ORDER* opaque_rect) { RECT rect; HBRUSH brush; @@ -584,8 +572,7 @@ static BOOL wf_gdi_multi_opaque_rect(rdpContext* context, if (!context || !multi_opaque_rect) return FALSE; - if (!wf_decode_color(wfc, multi_opaque_rect->color, &brush_color, - NULL)) + if (!wf_decode_color(wfc, multi_opaque_rect->color, &brush_color, NULL)) return FALSE; for (i = 0; i < multi_opaque_rect->numRectangles; i++) @@ -624,15 +611,15 @@ static BOOL wf_gdi_line_to(rdpContext* context, const LINE_TO_ORDER* line_to) pen = CreatePen(line_to->penStyle, line_to->penWidth, pen_color); wf_set_rop2(wfc->drawing->hdc, line_to->bRop2); - org_pen = (HPEN) SelectObject(wfc->drawing->hdc, pen); + org_pen = (HPEN)SelectObject(wfc->drawing->hdc, pen); MoveToEx(wfc->drawing->hdc, line_to->nXStart, line_to->nYStart, NULL); LineTo(wfc->drawing->hdc, line_to->nXEnd, line_to->nYEnd); x = (line_to->nXStart < line_to->nXEnd) ? line_to->nXStart : line_to->nXEnd; y = (line_to->nYStart < line_to->nYEnd) ? line_to->nYStart : line_to->nYEnd; w = (line_to->nXStart < line_to->nXEnd) ? (line_to->nXEnd - line_to->nXStart) - : (line_to->nXStart - line_to->nXEnd); + : (line_to->nXStart - line_to->nXEnd); h = (line_to->nYStart < line_to->nYEnd) ? (line_to->nYEnd - line_to->nYStart) - : (line_to->nYStart - line_to->nYEnd); + : (line_to->nYStart - line_to->nYEnd); if (wfc->drawing == wfc->primary) wf_invalidate_region(wfc, x, y, w, h); @@ -658,20 +645,20 @@ static BOOL wf_gdi_polyline(rdpContext* context, const POLYLINE_ORDER* polyline) hpen = CreatePen(0, 1, pen_color); org_rop2 = wf_set_rop2(wfc->drawing->hdc, polyline->bRop2); - org_hpen = (HPEN) SelectObject(wfc->drawing->hdc, hpen); + org_hpen = (HPEN)SelectObject(wfc->drawing->hdc, hpen); if (polyline->numDeltaEntries > 0) { - POINT* pts; - POINT temp; - int numPoints; - int i; + POINT* pts; + POINT temp; + int numPoints; + int i; numPoints = polyline->numDeltaEntries + 1; - pts = (POINT*) malloc(sizeof(POINT) * numPoints); + pts = (POINT*)malloc(sizeof(POINT) * numPoints); pts[0].x = temp.x = polyline->xStart; pts[0].y = temp.y = polyline->yStart; - for (i = 0; i < (int) polyline->numDeltaEntries; i++) + for (i = 0; i < (int)polyline->numDeltaEntries; i++) { temp.x += polyline->points[i].x; temp.y += polyline->points[i].y; @@ -701,14 +688,14 @@ static BOOL wf_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt) if (!context || !memblt) return FALSE; - bitmap = (wfBitmap*) memblt->bitmap; + bitmap = (wfBitmap*)memblt->bitmap; if (!bitmap || !wfc->drawing || !wfc->drawing->hdc) return FALSE; - if (!BitBlt(wfc->drawing->hdc, memblt->nLeftRect, memblt->nTopRect, - memblt->nWidth, memblt->nHeight, bitmap->hdc, - memblt->nXSrc, memblt->nYSrc, gdi_rop3_code(memblt->bRop))) + if (!BitBlt(wfc->drawing->hdc, memblt->nLeftRect, memblt->nTopRect, memblt->nWidth, + memblt->nHeight, bitmap->hdc, memblt->nXSrc, memblt->nYSrc, + gdi_rop3_code(memblt->bRop))) return FALSE; if (wfc->drawing == wfc->primary) @@ -730,7 +717,7 @@ static BOOL wf_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt) if (!context || !mem3blt) return FALSE; - bitmap = (wfBitmap*) mem3blt->bitmap; + bitmap = (wfBitmap*)mem3blt->bitmap; if (!bitmap || !wfc->drawing || !wfc->drawing->hdc) return FALSE; @@ -753,11 +740,11 @@ static BOOL wf_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt) case GDI_BS_HATCHED: case GDI_BS_PATTERN: - { - HBITMAP bmp = CreateBitmap(8, 8, 1, mem3blt->brush.bpp, mem3blt->brush.data); - brush = CreatePatternBrush(bmp); - } - break; + { + HBITMAP bmp = CreateBitmap(8, 8, 1, mem3blt->brush.bpp, mem3blt->brush.data); + brush = CreatePatternBrush(bmp); + } + break; default: goto fail; @@ -765,14 +752,12 @@ static BOOL wf_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt) orgBrush = SelectObject(hdc, brush); - if (!BitBlt(hdc, mem3blt->nLeftRect, mem3blt->nTopRect, - mem3blt->nWidth, mem3blt->nHeight, bitmap->hdc, - mem3blt->nXSrc, mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop))) + if (!BitBlt(hdc, mem3blt->nLeftRect, mem3blt->nTopRect, mem3blt->nWidth, mem3blt->nHeight, + bitmap->hdc, mem3blt->nXSrc, mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop))) goto fail; if (wfc->drawing == wfc->primary) - wf_invalidate_region(wfc, mem3blt->nLeftRect, mem3blt->nTopRect, - mem3blt->nWidth, + wf_invalidate_region(wfc, mem3blt->nLeftRect, mem3blt->nTopRect, mem3blt->nWidth, mem3blt->nHeight); rc = TRUE; @@ -798,8 +783,8 @@ static BOOL wf_gdi_surface_frame_marker(rdpContext* context, if (!settings) return FALSE; - if (surface_frame_marker->frameAction == SURFACECMD_FRAMEACTION_END - && settings->FrameAcknowledge > 0) + if (surface_frame_marker->frameAction == SURFACECMD_FRAMEACTION_END && + settings->FrameAcknowledge > 0) { IFCALL(context->instance->update->SurfaceFrameAcknowledge, context, surface_frame_marker->frameId); diff --git a/client/Windows/wf_gdi.h b/client/Windows/wf_gdi.h index 3ceec490f..a093e1a8c 100644 --- a/client/Windows/wf_gdi.h +++ b/client/Windows/wf_gdi.h @@ -24,10 +24,8 @@ #include "wf_client.h" -void wf_invalidate_region(wfContext* wfc, UINT32 x, UINT32 y, UINT32 width, - UINT32 height); -wfBitmap* wf_image_new(wfContext* wfc, UINT32 width, UINT32 height, UINT32 bpp, - const BYTE* data); +void wf_invalidate_region(wfContext* wfc, UINT32 x, UINT32 y, UINT32 width, UINT32 height); +wfBitmap* wf_image_new(wfContext* wfc, UINT32 width, UINT32 height, UINT32 bpp, const BYTE* data); void wf_image_free(wfBitmap* image); void wf_update_offset(wfContext* wfc); void wf_resize_window(wfContext* wfc); diff --git a/client/Windows/wf_graphics.c b/client/Windows/wf_graphics.c index 28682cd1e..da1afcf48 100644 --- a/client/Windows/wf_graphics.c +++ b/client/Windows/wf_graphics.c @@ -31,8 +31,8 @@ #define TAG CLIENT_TAG("windows") -HBITMAP wf_create_dib(wfContext* wfc, UINT32 width, UINT32 height, - UINT32 srcFormat, const BYTE* data, BYTE** pdata) +HBITMAP wf_create_dib(wfContext* wfc, UINT32 width, UINT32 height, UINT32 srcFormat, + const BYTE* data, BYTE** pdata) { HDC hdc; int negHeight; @@ -54,11 +54,11 @@ HBITMAP wf_create_dib(wfContext* wfc, UINT32 width, UINT32 height, bmi.bmiHeader.biPlanes = 1; bmi.bmiHeader.biBitCount = GetBitsPerPixel(dstFormat); bmi.bmiHeader.biCompression = BI_RGB; - bitmap = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, (void**) &cdata, NULL, 0); + bitmap = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, (void**)&cdata, NULL, 0); if (data) - freerdp_image_copy(cdata, dstFormat, 0, 0, 0, width, height, data, srcFormat, 0, - 0, 0, &wfc->context.gdi->palette, FREERDP_FLIP_NONE); + freerdp_image_copy(cdata, dstFormat, 0, 0, 0, width, height, data, srcFormat, 0, 0, 0, + &wfc->context.gdi->palette, FREERDP_FLIP_NONE); if (pdata) *pdata = cdata; @@ -68,17 +68,15 @@ HBITMAP wf_create_dib(wfContext* wfc, UINT32 width, UINT32 height, return bitmap; } -wfBitmap* wf_image_new(wfContext* wfc, UINT32 width, UINT32 height, - UINT32 format, const BYTE* data) +wfBitmap* wf_image_new(wfContext* wfc, UINT32 width, UINT32 height, UINT32 format, const BYTE* data) { HDC hdc; wfBitmap* image; hdc = GetDC(NULL); - image = (wfBitmap*) malloc(sizeof(wfBitmap)); + image = (wfBitmap*)malloc(sizeof(wfBitmap)); image->hdc = CreateCompatibleDC(hdc); - image->bitmap = wf_create_dib(wfc, width, height, format, data, - &(image->pdata)); - image->org_bitmap = (HBITMAP) SelectObject(image->hdc, image->bitmap); + image->bitmap = wf_create_dib(wfc, width, height, format, data, &(image->pdata)); + image->org_bitmap = (HBITMAP)SelectObject(image->hdc, image->bitmap); ReleaseDC(NULL, hdc); return image; } @@ -100,30 +98,29 @@ static BOOL wf_Bitmap_New(rdpContext* context, rdpBitmap* bitmap) { HDC hdc; wfContext* wfc = (wfContext*)context; - wfBitmap* wf_bitmap = (wfBitmap*) bitmap; + wfBitmap* wf_bitmap = (wfBitmap*)bitmap; if (!context || !bitmap) return FALSE; - wf_bitmap = (wfBitmap*) bitmap; + wf_bitmap = (wfBitmap*)bitmap; hdc = GetDC(NULL); wf_bitmap->hdc = CreateCompatibleDC(hdc); if (!bitmap->data) wf_bitmap->bitmap = CreateCompatibleBitmap(hdc, bitmap->width, bitmap->height); else - wf_bitmap->bitmap = wf_create_dib(wfc, bitmap->width, bitmap->height, - bitmap->format, bitmap->data, NULL); + wf_bitmap->bitmap = + wf_create_dib(wfc, bitmap->width, bitmap->height, bitmap->format, bitmap->data, NULL); - wf_bitmap->org_bitmap = (HBITMAP) SelectObject(wf_bitmap->hdc, - wf_bitmap->bitmap); + wf_bitmap->org_bitmap = (HBITMAP)SelectObject(wf_bitmap->hdc, wf_bitmap->bitmap); ReleaseDC(NULL, hdc); return TRUE; } static void wf_Bitmap_Free(rdpContext* context, rdpBitmap* bitmap) { - wfBitmap* wf_bitmap = (wfBitmap*) bitmap; + wfBitmap* wf_bitmap = (wfBitmap*)bitmap; if (wf_bitmap != 0) { @@ -141,24 +138,23 @@ static BOOL wf_Bitmap_Paint(rdpContext* context, rdpBitmap* bitmap) BOOL rc; UINT32 width, height; wfContext* wfc = (wfContext*)context; - wfBitmap* wf_bitmap = (wfBitmap*) bitmap; + wfBitmap* wf_bitmap = (wfBitmap*)bitmap; if (!context || !bitmap) return FALSE; width = bitmap->right - bitmap->left + 1; height = bitmap->bottom - bitmap->top + 1; - rc = BitBlt(wfc->primary->hdc, bitmap->left, bitmap->top, - width, height, wf_bitmap->hdc, 0, 0, SRCCOPY); + rc = BitBlt(wfc->primary->hdc, bitmap->left, bitmap->top, width, height, wf_bitmap->hdc, 0, 0, + SRCCOPY); wf_invalidate_region(wfc, bitmap->left, bitmap->top, width, height); return rc; } -static BOOL wf_Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, - BOOL primary) +static BOOL wf_Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, BOOL primary) { wfContext* wfc = (wfContext*)context; - wfBitmap* bmp = (wfBitmap*) bitmap; + wfBitmap* bmp = (wfBitmap*)bitmap; rdpGdi* gdi = context->gdi; if (!gdi || !wfc) @@ -176,8 +172,7 @@ static BOOL wf_Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, /* Pointer Class */ -static BOOL flip_bitmap(const BYTE* src, BYTE* dst, UINT32 scanline, - UINT32 nHeight) +static BOOL flip_bitmap(const BYTE* src, BYTE* dst, UINT32 scanline, UINT32 nHeight) { UINT32 x; BYTE* bottomLine = dst + scanline * (nHeight - 1); @@ -213,15 +208,13 @@ static BOOL wf_Pointer_New(rdpContext* context, const rdpPointer* pointer) if (pointer->xorBpp == 1) { - BYTE* pdata = (BYTE*) _aligned_malloc(pointer->lengthAndMask + - pointer->lengthXorMask, 16); + BYTE* pdata = (BYTE*)_aligned_malloc(pointer->lengthAndMask + pointer->lengthXorMask, 16); if (!pdata) goto fail; CopyMemory(pdata, pointer->andMaskData, pointer->lengthAndMask); - CopyMemory(pdata + pointer->lengthAndMask, pointer->xorMaskData, - pointer->lengthXorMask); + CopyMemory(pdata + pointer->lengthAndMask, pointer->xorMaskData, pointer->lengthXorMask); info.hbmMask = CreateBitmap(pointer->width, pointer->height * 2, 1, 1, pdata); _aligned_free(pdata); info.hbmColor = NULL; @@ -229,13 +222,12 @@ static BOOL wf_Pointer_New(rdpContext* context, const rdpPointer* pointer) else { UINT32 srcFormat; - BYTE* pdata = (BYTE*) _aligned_malloc(pointer->lengthAndMask, 16); + BYTE* pdata = (BYTE*)_aligned_malloc(pointer->lengthAndMask, 16); if (!pdata) goto fail; - flip_bitmap(pointer->andMaskData, pdata, (pointer->width + 7) / 8, - pointer->height); + flip_bitmap(pointer->andMaskData, pdata, (pointer->width + 7) / 8, pointer->height); info.hbmMask = CreateBitmap(pointer->width, pointer->height, 1, 1, pdata); _aligned_free(pdata); @@ -245,22 +237,23 @@ static BOOL wf_Pointer_New(rdpContext* context, const rdpPointer* pointer) if (!srcFormat) goto fail; - info.hbmColor = wf_create_dib((wfContext*)context, pointer->width, pointer->height, srcFormat, NULL, &pdata); + info.hbmColor = wf_create_dib((wfContext*)context, pointer->width, pointer->height, + srcFormat, NULL, &pdata); if (!info.hbmColor) goto fail; - if (!freerdp_image_copy_from_pointer_data(pdata, gdi->dstFormat, 0, 0, 0, - pointer->width, pointer->height, - pointer->xorMaskData, pointer->lengthXorMask, - pointer->andMaskData, pointer->lengthAndMask, pointer->xorBpp, &gdi->palette)) + if (!freerdp_image_copy_from_pointer_data( + pdata, gdi->dstFormat, 0, 0, 0, pointer->width, pointer->height, + pointer->xorMaskData, pointer->lengthXorMask, pointer->andMaskData, + pointer->lengthAndMask, pointer->xorBpp, &gdi->palette)) { goto fail; } } hCur = CreateIconIndirect(&info); - ((wfPointer*) pointer)->cursor = hCur; + ((wfPointer*)pointer)->cursor = hCur; rc = TRUE; fail: @@ -280,7 +273,7 @@ static BOOL wf_Pointer_Free(rdpContext* context, rdpPointer* pointer) if (!context || !pointer) return FALSE; - hCur = ((wfPointer*) pointer)->cursor; + hCur = ((wfPointer*)pointer)->cursor; if (hCur != 0) DestroyIcon(hCur); @@ -296,7 +289,7 @@ static BOOL wf_Pointer_Set(rdpContext* context, const rdpPointer* pointer) if (!context || !pointer) return FALSE; - hCur = ((wfPointer*) pointer)->cursor; + hCur = ((wfPointer*)pointer)->cursor; if (hCur != NULL) { @@ -339,7 +332,7 @@ BOOL wf_register_pointer(rdpGraphics* graphics) if (!graphics) return FALSE; - wfc = (wfContext*) graphics->context; + wfc = (wfContext*)graphics->context; ZeroMemory(&pointer, sizeof(rdpPointer)); pointer.size = sizeof(wfPointer); pointer.New = wf_Pointer_New; @@ -363,7 +356,7 @@ BOOL wf_register_graphics(rdpGraphics* graphics) if (!graphics) return FALSE; - wfc = (wfContext*) graphics->context; + wfc = (wfContext*)graphics->context; bitmap = *graphics->Bitmap_Prototype; bitmap.size = sizeof(wfBitmap); bitmap.New = wf_Bitmap_New; diff --git a/client/Windows/wf_graphics.h b/client/Windows/wf_graphics.h index da2e36eff..241575fd2 100644 --- a/client/Windows/wf_graphics.h +++ b/client/Windows/wf_graphics.h @@ -22,10 +22,10 @@ #include "wf_client.h" -HBITMAP wf_create_dib(wfContext* wfc, UINT32 width, UINT32 height, - UINT32 format, const BYTE* data, BYTE** pdata); -wfBitmap* wf_image_new(wfContext* wfc, UINT32 width, UINT32 height, - UINT32 format, const BYTE* data); +HBITMAP wf_create_dib(wfContext* wfc, UINT32 width, UINT32 height, UINT32 format, const BYTE* data, + BYTE** pdata); +wfBitmap* wf_image_new(wfContext* wfc, UINT32 width, UINT32 height, UINT32 format, + const BYTE* data); void wf_image_free(wfBitmap* image); BOOL wf_register_pointer(rdpGraphics* graphics); diff --git a/client/Windows/wf_rail.c b/client/Windows/wf_rail.c index 9b4034995..24865c51d 100644 --- a/client/Windows/wf_rail.c +++ b/client/Windows/wf_rail.c @@ -29,8 +29,8 @@ #define TAG CLIENT_TAG("windows") -#define GET_X_LPARAM(lParam) ((UINT16) (lParam & 0xFFFF)) -#define GET_Y_LPARAM(lParam) ((UINT16) ((lParam >> 16) & 0xFFFF)) +#define GET_X_LPARAM(lParam) ((UINT16)(lParam & 0xFFFF)) +#define GET_Y_LPARAM(lParam) ((UINT16)((lParam >> 16) & 0xFFFF)) /* RemoteApp Core Protocol Extension */ @@ -42,35 +42,31 @@ struct _WINDOW_STYLE }; typedef struct _WINDOW_STYLE WINDOW_STYLE; -static const WINDOW_STYLE WINDOW_STYLES[] = -{ - { WS_BORDER, "WS_BORDER", FALSE }, - { WS_CAPTION, "WS_CAPTION", FALSE }, - { WS_CHILD, "WS_CHILD", FALSE }, - { WS_CLIPCHILDREN, "WS_CLIPCHILDREN", FALSE }, - { WS_CLIPSIBLINGS, "WS_CLIPSIBLINGS", FALSE }, - { WS_DISABLED, "WS_DISABLED", FALSE }, - { WS_DLGFRAME, "WS_DLGFRAME", FALSE }, - { WS_GROUP, "WS_GROUP", FALSE }, - { WS_HSCROLL, "WS_HSCROLL", FALSE }, - { WS_ICONIC, "WS_ICONIC", FALSE }, - { WS_MAXIMIZE, "WS_MAXIMIZE", FALSE }, - { WS_MAXIMIZEBOX, "WS_MAXIMIZEBOX", FALSE }, - { WS_MINIMIZE, "WS_MINIMIZE", FALSE }, - { WS_MINIMIZEBOX, "WS_MINIMIZEBOX", FALSE }, - { WS_OVERLAPPED, "WS_OVERLAPPED", FALSE }, - { WS_OVERLAPPEDWINDOW, "WS_OVERLAPPEDWINDOW", TRUE }, - { WS_POPUP, "WS_POPUP", FALSE }, - { WS_POPUPWINDOW, "WS_POPUPWINDOW", TRUE }, - { WS_SIZEBOX, "WS_SIZEBOX", FALSE }, - { WS_SYSMENU, "WS_SYSMENU", FALSE }, - { WS_TABSTOP, "WS_TABSTOP", FALSE }, - { WS_THICKFRAME, "WS_THICKFRAME", FALSE }, - { WS_VISIBLE, "WS_VISIBLE", FALSE } -}; +static const WINDOW_STYLE WINDOW_STYLES[] = { { WS_BORDER, "WS_BORDER", FALSE }, + { WS_CAPTION, "WS_CAPTION", FALSE }, + { WS_CHILD, "WS_CHILD", FALSE }, + { WS_CLIPCHILDREN, "WS_CLIPCHILDREN", FALSE }, + { WS_CLIPSIBLINGS, "WS_CLIPSIBLINGS", FALSE }, + { WS_DISABLED, "WS_DISABLED", FALSE }, + { WS_DLGFRAME, "WS_DLGFRAME", FALSE }, + { WS_GROUP, "WS_GROUP", FALSE }, + { WS_HSCROLL, "WS_HSCROLL", FALSE }, + { WS_ICONIC, "WS_ICONIC", FALSE }, + { WS_MAXIMIZE, "WS_MAXIMIZE", FALSE }, + { WS_MAXIMIZEBOX, "WS_MAXIMIZEBOX", FALSE }, + { WS_MINIMIZE, "WS_MINIMIZE", FALSE }, + { WS_MINIMIZEBOX, "WS_MINIMIZEBOX", FALSE }, + { WS_OVERLAPPED, "WS_OVERLAPPED", FALSE }, + { WS_OVERLAPPEDWINDOW, "WS_OVERLAPPEDWINDOW", TRUE }, + { WS_POPUP, "WS_POPUP", FALSE }, + { WS_POPUPWINDOW, "WS_POPUPWINDOW", TRUE }, + { WS_SIZEBOX, "WS_SIZEBOX", FALSE }, + { WS_SYSMENU, "WS_SYSMENU", FALSE }, + { WS_TABSTOP, "WS_TABSTOP", FALSE }, + { WS_THICKFRAME, "WS_THICKFRAME", FALSE }, + { WS_VISIBLE, "WS_VISIBLE", FALSE } }; -static const WINDOW_STYLE EXTENDED_WINDOW_STYLES[] = -{ +static const WINDOW_STYLE EXTENDED_WINDOW_STYLES[] = { { WS_EX_ACCEPTFILES, "WS_EX_ACCEPTFILES", FALSE }, { WS_EX_APPWINDOW, "WS_EX_APPWINDOW", FALSE }, { WS_EX_CLIENTEDGE, "WS_EX_CLIENTEDGE", FALSE }, @@ -130,8 +126,7 @@ void PrintExtendedWindowStyles(UINT32 style) { if (EXTENDED_WINDOW_STYLES[i].multi) { - if ((style & EXTENDED_WINDOW_STYLES[i].style) != - EXTENDED_WINDOW_STYLES[i].style) + if ((style & EXTENDED_WINDOW_STYLES[i].style) != EXTENDED_WINDOW_STYLES[i].style) continue; } @@ -141,7 +136,7 @@ void PrintExtendedWindowStyles(UINT32 style) } static void PrintRailWindowState(const WINDOW_ORDER_INFO* orderInfo, - const WINDOW_STATE_ORDER* windowState) + const WINDOW_STATE_ORDER* windowState) { if (orderInfo->fieldFlags & WINDOW_ORDER_STATE_NEW) WLog_INFO(TAG, "WindowCreate: WindowId: 0x%08X", orderInfo->windowId); @@ -157,8 +152,8 @@ static void PrintRailWindowState(const WINDOW_ORDER_INFO* orderInfo, if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_STYLE) { - WLog_INFO(TAG, "\tStyle: 0x%08X ExtendedStyle: 0x%08X", - windowState->style, windowState->extendedStyle); + WLog_INFO(TAG, "\tStyle: 0x%08X ExtendedStyle: 0x%08X", windowState->style, + windowState->extendedStyle); PrintWindowStyles(windowState->style); PrintExtendedWindowStyles(windowState->extendedStyle); } @@ -171,23 +166,22 @@ static void PrintRailWindowState(const WINDOW_ORDER_INFO* orderInfo, if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_TITLE) { char* title = NULL; - ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) windowState->titleInfo.string, + ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)windowState->titleInfo.string, windowState->titleInfo.length / 2, &title, 0, NULL, NULL); - WLog_INFO(TAG, "\tTitleInfo: %s (length = %hu)", title, - windowState->titleInfo.length); + WLog_INFO(TAG, "\tTitleInfo: %s (length = %hu)", title, windowState->titleInfo.length); free(title); } if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET) { - WLog_INFO(TAG, "\tClientOffsetX: %d ClientOffsetY: %d", - windowState->clientOffsetX, windowState->clientOffsetY); + WLog_INFO(TAG, "\tClientOffsetX: %d ClientOffsetY: %d", windowState->clientOffsetX, + windowState->clientOffsetY); } if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE) { - WLog_INFO(TAG, "\tClientAreaWidth: %u ClientAreaHeight: %u", - windowState->clientAreaWidth, windowState->clientAreaHeight); + WLog_INFO(TAG, "\tClientAreaWidth: %u ClientAreaHeight: %u", windowState->clientAreaWidth, + windowState->clientAreaHeight); } if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_RP_CONTENT) @@ -202,8 +196,8 @@ static void PrintRailWindowState(const WINDOW_ORDER_INFO* orderInfo, if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_OFFSET) { - WLog_INFO(TAG, "\tWindowOffsetX: %d WindowOffsetY: %d", - windowState->windowOffsetX, windowState->windowOffsetY); + WLog_INFO(TAG, "\tWindowOffsetX: %d WindowOffsetY: %d", windowState->windowOffsetX, + windowState->windowOffsetY); } if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_CLIENT_DELTA) @@ -214,8 +208,8 @@ static void PrintRailWindowState(const WINDOW_ORDER_INFO* orderInfo, if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_SIZE) { - WLog_INFO(TAG, "\tWindowWidth: %u WindowHeight: %u", - windowState->windowWidth, windowState->windowHeight); + WLog_INFO(TAG, "\tWindowWidth: %u WindowHeight: %u", windowState->windowWidth, + windowState->windowHeight); } if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_RECTS) @@ -227,15 +221,15 @@ static void PrintRailWindowState(const WINDOW_ORDER_INFO* orderInfo, for (index = 0; index < windowState->numWindowRects; index++) { rect = &windowState->windowRects[index]; - WLog_INFO(TAG, "\twindowRect[%u]: left: %hu top: %hu right: %hu bottom: %hu", - index, rect->left, rect->top, rect->right, rect->bottom); + WLog_INFO(TAG, "\twindowRect[%u]: left: %hu top: %hu right: %hu bottom: %hu", index, + rect->left, rect->top, rect->right, rect->bottom); } } if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_VIS_OFFSET) { - WLog_INFO(TAG, "\tvisibileOffsetX: %d visibleOffsetY: %d", - windowState->visibleOffsetX, windowState->visibleOffsetY); + WLog_INFO(TAG, "\tvisibileOffsetX: %d visibleOffsetY: %d", windowState->visibleOffsetX, + windowState->visibleOffsetY); } if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_VISIBILITY) @@ -247,8 +241,8 @@ static void PrintRailWindowState(const WINDOW_ORDER_INFO* orderInfo, for (index = 0; index < windowState->numVisibilityRects; index++) { rect = &windowState->visibilityRects[index]; - WLog_INFO(TAG, "\tvisibilityRect[%u]: left: %hu top: %hu right: %hu bottom: %hu", - index, rect->left, rect->top, rect->right, rect->bottom); + WLog_INFO(TAG, "\tvisibilityRect[%u]: left: %hu top: %hu right: %hu bottom: %hu", index, + rect->left, rect->top, rect->right, rect->bottom); } } @@ -269,14 +263,13 @@ static void PrintRailIconInfo(const WINDOW_ORDER_INFO* orderInfo, const ICON_INF WLog_INFO(TAG, "\tcbColorTable: %u", iconInfo->cbColorTable); WLog_INFO(TAG, "\tcbBitsMask: %u", iconInfo->cbBitsMask); WLog_INFO(TAG, "\tcbBitsColor: %u", iconInfo->cbBitsColor); - WLog_INFO(TAG, "\tcolorTable: %p", (void*) iconInfo->colorTable); - WLog_INFO(TAG, "\tbitsMask: %p", (void*) iconInfo->bitsMask); - WLog_INFO(TAG, "\tbitsColor: %p", (void*) iconInfo->bitsColor); + WLog_INFO(TAG, "\tcolorTable: %p", (void*)iconInfo->colorTable); + WLog_INFO(TAG, "\tbitsMask: %p", (void*)iconInfo->bitsMask); + WLog_INFO(TAG, "\tbitsColor: %p", (void*)iconInfo->bitsColor); WLog_INFO(TAG, "}"); } -LRESULT CALLBACK wf_RailWndProc(HWND hWnd, UINT msg, WPARAM wParam, - LPARAM lParam) +LRESULT CALLBACK wf_RailWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { HDC hDC; int x, y; @@ -290,13 +283,13 @@ LRESULT CALLBACK wf_RailWndProc(HWND hWnd, UINT msg, WPARAM wParam, rdpInput* input = NULL; rdpContext* context = NULL; wfRailWindow* railWindow; - railWindow = (wfRailWindow*) GetWindowLongPtr(hWnd, GWLP_USERDATA); + railWindow = (wfRailWindow*)GetWindowLongPtr(hWnd, GWLP_USERDATA); if (railWindow) wfc = railWindow->wfc; if (wfc) - context = (rdpContext*) wfc; + context = (rdpContext*)wfc; if (context) input = context->input; @@ -304,90 +297,90 @@ LRESULT CALLBACK wf_RailWndProc(HWND hWnd, UINT msg, WPARAM wParam, switch (msg) { case WM_PAINT: - { - if (!wfc) - return 0; + { + if (!wfc) + return 0; - hDC = BeginPaint(hWnd, &ps); - x = ps.rcPaint.left; - y = ps.rcPaint.top; - width = ps.rcPaint.right - ps.rcPaint.left + 1; - height = ps.rcPaint.bottom - ps.rcPaint.top + 1; - BitBlt(hDC, x, y, width, height, wfc->primary->hdc, - railWindow->x + x, railWindow->y + y, SRCCOPY); - EndPaint(hWnd, &ps); - } - break; + hDC = BeginPaint(hWnd, &ps); + x = ps.rcPaint.left; + y = ps.rcPaint.top; + width = ps.rcPaint.right - ps.rcPaint.left + 1; + height = ps.rcPaint.bottom - ps.rcPaint.top + 1; + BitBlt(hDC, x, y, width, height, wfc->primary->hdc, railWindow->x + x, + railWindow->y + y, SRCCOPY); + EndPaint(hWnd, &ps); + } + break; case WM_LBUTTONDOWN: - { - if (!railWindow || !input) - return 0; + { + if (!railWindow || !input) + return 0; - xPos = GET_X_LPARAM(lParam) + railWindow->x; - yPos = GET_Y_LPARAM(lParam) + railWindow->y; - inputFlags = PTR_FLAGS_DOWN | PTR_FLAGS_BUTTON1; + xPos = GET_X_LPARAM(lParam) + railWindow->x; + yPos = GET_Y_LPARAM(lParam) + railWindow->y; + inputFlags = PTR_FLAGS_DOWN | PTR_FLAGS_BUTTON1; - if (input) - input->MouseEvent(input, inputFlags, xPos, yPos); - } - break; + if (input) + input->MouseEvent(input, inputFlags, xPos, yPos); + } + break; case WM_LBUTTONUP: - { - if (!railWindow || !input) - return 0; + { + if (!railWindow || !input) + return 0; - xPos = GET_X_LPARAM(lParam) + railWindow->x; - yPos = GET_Y_LPARAM(lParam) + railWindow->y; - inputFlags = PTR_FLAGS_BUTTON1; + xPos = GET_X_LPARAM(lParam) + railWindow->x; + yPos = GET_Y_LPARAM(lParam) + railWindow->y; + inputFlags = PTR_FLAGS_BUTTON1; - if (input) - input->MouseEvent(input, inputFlags, xPos, yPos); - } - break; + if (input) + input->MouseEvent(input, inputFlags, xPos, yPos); + } + break; case WM_RBUTTONDOWN: - { - if (!railWindow || !input) - return 0; + { + if (!railWindow || !input) + return 0; - xPos = GET_X_LPARAM(lParam) + railWindow->x; - yPos = GET_Y_LPARAM(lParam) + railWindow->y; - inputFlags = PTR_FLAGS_DOWN | PTR_FLAGS_BUTTON2; + xPos = GET_X_LPARAM(lParam) + railWindow->x; + yPos = GET_Y_LPARAM(lParam) + railWindow->y; + inputFlags = PTR_FLAGS_DOWN | PTR_FLAGS_BUTTON2; - if (input) - input->MouseEvent(input, inputFlags, xPos, yPos); - } - break; + if (input) + input->MouseEvent(input, inputFlags, xPos, yPos); + } + break; case WM_RBUTTONUP: - { - if (!railWindow || !input) - return 0; + { + if (!railWindow || !input) + return 0; - xPos = GET_X_LPARAM(lParam) + railWindow->x; - yPos = GET_Y_LPARAM(lParam) + railWindow->y; - inputFlags = PTR_FLAGS_BUTTON2; + xPos = GET_X_LPARAM(lParam) + railWindow->x; + yPos = GET_Y_LPARAM(lParam) + railWindow->y; + inputFlags = PTR_FLAGS_BUTTON2; - if (input) - input->MouseEvent(input, inputFlags, xPos, yPos); - } - break; + if (input) + input->MouseEvent(input, inputFlags, xPos, yPos); + } + break; case WM_MOUSEMOVE: - { - if (!railWindow || !input) - return 0; + { + if (!railWindow || !input) + return 0; - xPos = GET_X_LPARAM(lParam) + railWindow->x; - yPos = GET_Y_LPARAM(lParam) + railWindow->y; - inputFlags = PTR_FLAGS_MOVE; + xPos = GET_X_LPARAM(lParam) + railWindow->x; + yPos = GET_Y_LPARAM(lParam) + railWindow->y; + inputFlags = PTR_FLAGS_MOVE; - if (input) - input->MouseEvent(input, inputFlags, xPos, yPos); - } - break; + if (input) + input->MouseEvent(input, inputFlags, xPos, yPos); + } + break; case WM_MOUSEWHEEL: break; @@ -407,15 +400,17 @@ LRESULT CALLBACK wf_RailWndProc(HWND hWnd, UINT msg, WPARAM wParam, return 0; } -#define RAIL_DISABLED_WINDOW_STYLES (WS_BORDER | WS_THICKFRAME | WS_DLGFRAME | WS_CAPTION | \ - WS_OVERLAPPED | WS_VSCROLL | WS_HSCROLL | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX) -#define RAIL_DISABLED_EXTENDED_WINDOW_STYLES (WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE | WS_EX_WINDOWEDGE) +#define RAIL_DISABLED_WINDOW_STYLES \ + (WS_BORDER | WS_THICKFRAME | WS_DLGFRAME | WS_CAPTION | WS_OVERLAPPED | WS_VSCROLL | \ + WS_HSCROLL | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX) +#define RAIL_DISABLED_EXTENDED_WINDOW_STYLES \ + (WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE | WS_EX_WINDOWEDGE) -static BOOL wf_rail_window_common(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo,const WINDOW_STATE_ORDER* windowState) +static BOOL wf_rail_window_common(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const WINDOW_STATE_ORDER* windowState) { wfRailWindow* railWindow = NULL; - wfContext* wfc = (wfContext*) context; + wfContext* wfc = (wfContext*)context; RailClientContext* rail = wfc->rail; UINT32 fieldFlags = orderInfo->fieldFlags; PrintRailWindowState(orderInfo, windowState); @@ -425,7 +420,7 @@ static BOOL wf_rail_window_common(rdpContext* context, HANDLE hInstance; WCHAR* titleW = NULL; WNDCLASSEX wndClassEx; - railWindow = (wfRailWindow*) calloc(1, sizeof(wfRailWindow)); + railWindow = (wfRailWindow*)calloc(1, sizeof(wfRailWindow)); if (!railWindow) return FALSE; @@ -452,8 +447,9 @@ static BOOL wf_rail_window_common(rdpContext* context, /* error handled below */ } } - else if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) windowState->titleInfo.string, - windowState->titleInfo.length / 2, &title, 0, NULL, NULL) < 1) + else if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)windowState->titleInfo.string, + windowState->titleInfo.length / 2, &title, 0, NULL, + NULL) < 1) { WLog_ERR(TAG, "failed to convert window title"); /* error handled below */ @@ -489,38 +485,35 @@ static BOOL wf_rail_window_common(rdpContext* context, wndClassEx.hInstance = hInstance; wndClassEx.hIconSm = NULL; RegisterClassEx(&wndClassEx); - railWindow->hWnd = CreateWindowExW( - railWindow->dwExStyle, /* dwExStyle */ - _T("RdpRailWindow"), /* lpClassName */ - titleW, /* lpWindowName */ - railWindow->dwStyle, /* dwStyle */ - railWindow->x, /* x */ - railWindow->y, /* y */ - railWindow->width, /* nWidth */ - railWindow->height, /* nHeight */ - NULL, /* hWndParent */ - NULL, /* hMenu */ - hInstance, /* hInstance */ - NULL /* lpParam */ - ); - SetWindowLongPtr(railWindow->hWnd, GWLP_USERDATA, (LONG_PTR) railWindow); - HashTable_Add(wfc->railWindows, (void*)(UINT_PTR) orderInfo->windowId, - (void*) railWindow); + railWindow->hWnd = CreateWindowExW(railWindow->dwExStyle, /* dwExStyle */ + _T("RdpRailWindow"), /* lpClassName */ + titleW, /* lpWindowName */ + railWindow->dwStyle, /* dwStyle */ + railWindow->x, /* x */ + railWindow->y, /* y */ + railWindow->width, /* nWidth */ + railWindow->height, /* nHeight */ + NULL, /* hWndParent */ + NULL, /* hMenu */ + hInstance, /* hInstance */ + NULL /* lpParam */ + ); + SetWindowLongPtr(railWindow->hWnd, GWLP_USERDATA, (LONG_PTR)railWindow); + HashTable_Add(wfc->railWindows, (void*)(UINT_PTR)orderInfo->windowId, (void*)railWindow); free(titleW); UpdateWindow(railWindow->hWnd); return TRUE; } else { - railWindow = (wfRailWindow*) HashTable_GetItemValue(wfc->railWindows, - (void*)(UINT_PTR) orderInfo->windowId); + railWindow = (wfRailWindow*)HashTable_GetItemValue(wfc->railWindows, + (void*)(UINT_PTR)orderInfo->windowId); } if (!railWindow) return TRUE; - if ((fieldFlags & WINDOW_ORDER_FIELD_WND_OFFSET) || - (fieldFlags & WINDOW_ORDER_FIELD_WND_SIZE)) + if ((fieldFlags & WINDOW_ORDER_FIELD_WND_OFFSET) || (fieldFlags & WINDOW_ORDER_FIELD_WND_SIZE)) { if (fieldFlags & WINDOW_ORDER_FIELD_WND_OFFSET) { @@ -534,12 +527,8 @@ static BOOL wf_rail_window_common(rdpContext* context, railWindow->height = windowState->windowHeight; } - SetWindowPos(railWindow->hWnd, NULL, - railWindow->x, - railWindow->y, - railWindow->width, - railWindow->height, - 0); + SetWindowPos(railWindow->hWnd, NULL, railWindow->x, railWindow->y, railWindow->width, + railWindow->height, 0); } if (fieldFlags & WINDOW_ORDER_FIELD_OWNER) @@ -552,8 +541,8 @@ static BOOL wf_rail_window_common(rdpContext* context, railWindow->dwStyle &= ~RAIL_DISABLED_WINDOW_STYLES; railWindow->dwExStyle = windowState->extendedStyle; railWindow->dwExStyle &= ~RAIL_DISABLED_EXTENDED_WINDOW_STYLES; - SetWindowLongPtr(railWindow->hWnd, GWL_STYLE, (LONG) railWindow->dwStyle); - SetWindowLongPtr(railWindow->hWnd, GWL_EXSTYLE, (LONG) railWindow->dwExStyle); + SetWindowLongPtr(railWindow->hWnd, GWL_STYLE, (LONG)railWindow->dwStyle); + SetWindowLongPtr(railWindow->hWnd, GWL_EXSTYLE, (LONG)railWindow->dwExStyle); } if (fieldFlags & WINDOW_ORDER_FIELD_SHOW) @@ -574,7 +563,7 @@ static BOOL wf_rail_window_common(rdpContext* context, return FALSE; } } - else if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) windowState->titleInfo.string, + else if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)windowState->titleInfo.string, windowState->titleInfo.length / 2, &title, 0, NULL, NULL) < 1) { WLog_ERR(TAG, "failed to convert window title"); @@ -645,27 +634,26 @@ static BOOL wf_rail_window_common(rdpContext* context, return TRUE; } -static BOOL wf_rail_window_delete(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo) +static BOOL wf_rail_window_delete(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo) { wfRailWindow* railWindow = NULL; - wfContext* wfc = (wfContext*) context; + wfContext* wfc = (wfContext*)context; RailClientContext* rail = wfc->rail; WLog_DBG(TAG, "RailWindowDelete"); - railWindow = (wfRailWindow*) HashTable_GetItemValue(wfc->railWindows, - (void*)(UINT_PTR) orderInfo->windowId); + railWindow = (wfRailWindow*)HashTable_GetItemValue(wfc->railWindows, + (void*)(UINT_PTR)orderInfo->windowId); if (!railWindow) return TRUE; - HashTable_Remove(wfc->railWindows, (void*)(UINT_PTR) orderInfo->windowId); + HashTable_Remove(wfc->railWindows, (void*)(UINT_PTR)orderInfo->windowId); DestroyWindow(railWindow->hWnd); free(railWindow); return TRUE; } -static BOOL wf_rail_window_icon(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo, const WINDOW_ICON_ORDER* windowIcon) +static BOOL wf_rail_window_icon(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const WINDOW_ICON_ORDER* windowIcon) { HDC hDC; int bpp; @@ -677,12 +665,12 @@ static BOOL wf_rail_window_icon(rdpContext* context, BITMAPINFO bitmapInfo; wfRailWindow* railWindow; BITMAPINFOHEADER* bitmapInfoHeader; - wfContext* wfc = (wfContext*) context; + wfContext* wfc = (wfContext*)context; RailClientContext* rail = wfc->rail; WLog_DBG(TAG, "RailWindowIcon"); PrintRailIconInfo(orderInfo, windowIcon->iconInfo); - railWindow = (wfRailWindow*) HashTable_GetItemValue(wfc->railWindows, - (void*)(UINT_PTR) orderInfo->windowId); + railWindow = (wfRailWindow*)HashTable_GetItemValue(wfc->railWindows, + (void*)(UINT_PTR)orderInfo->windowId); if (!railWindow) return TRUE; @@ -708,22 +696,19 @@ static BOOL wf_rail_window_icon(rdpContext* context, bitmapInfoHeader->biYPelsPerMeter = height; bitmapInfoHeader->biClrUsed = 0; bitmapInfoHeader->biClrImportant = 0; - iconInfo.hbmMask = CreateDIBitmap(hDC, - bitmapInfoHeader, CBM_INIT, - windowIcon->iconInfo->bitsMask, - &bitmapInfo, DIB_RGB_COLORS); - iconInfo.hbmColor = CreateDIBitmap(hDC, - bitmapInfoHeader, CBM_INIT, - windowIcon->iconInfo->bitsColor, - &bitmapInfo, DIB_RGB_COLORS); + iconInfo.hbmMask = CreateDIBitmap(hDC, bitmapInfoHeader, CBM_INIT, + windowIcon->iconInfo->bitsMask, &bitmapInfo, DIB_RGB_COLORS); + iconInfo.hbmColor = + CreateDIBitmap(hDC, bitmapInfoHeader, CBM_INIT, windowIcon->iconInfo->bitsColor, + &bitmapInfo, DIB_RGB_COLORS); hIcon = CreateIconIndirect(&iconInfo); if (hIcon) { WPARAM wParam; LPARAM lParam; - wParam = (WPARAM) bigIcon ? ICON_BIG : ICON_SMALL; - lParam = (LPARAM) hIcon; + wParam = (WPARAM)bigIcon ? ICON_BIG : ICON_SMALL; + lParam = (LPARAM)hIcon; SendMessage(railWindow->hWnd, WM_SETICON, wParam, lParam); } @@ -737,15 +722,15 @@ static BOOL wf_rail_window_icon(rdpContext* context, return TRUE; } -static BOOL wf_rail_window_cached_icon(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo, const WINDOW_CACHED_ICON_ORDER* windowCachedIcon) +static BOOL wf_rail_window_cached_icon(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const WINDOW_CACHED_ICON_ORDER* windowCachedIcon) { WLog_DBG(TAG, "RailWindowCachedIcon"); return TRUE; } -static void wf_rail_notify_icon_common(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo, const NOTIFY_ICON_STATE_ORDER* notifyIconState) +static void wf_rail_notify_icon_common(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const NOTIFY_ICON_STATE_ORDER* notifyIconState) { if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_NOTIFY_VERSION) { @@ -774,48 +759,46 @@ static void wf_rail_notify_icon_common(rdpContext* context, } } -static BOOL wf_rail_notify_icon_create(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo, const NOTIFY_ICON_STATE_ORDER* notifyIconState) +static BOOL wf_rail_notify_icon_create(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const NOTIFY_ICON_STATE_ORDER* notifyIconState) { - wfContext* wfc = (wfContext*) context; + wfContext* wfc = (wfContext*)context; RailClientContext* rail = wfc->rail; WLog_DBG(TAG, "RailNotifyIconCreate"); wf_rail_notify_icon_common(context, orderInfo, notifyIconState); return TRUE; } -static BOOL wf_rail_notify_icon_update(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo, const NOTIFY_ICON_STATE_ORDER* notifyIconState) +static BOOL wf_rail_notify_icon_update(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const NOTIFY_ICON_STATE_ORDER* notifyIconState) { - wfContext* wfc = (wfContext*) context; + wfContext* wfc = (wfContext*)context; RailClientContext* rail = wfc->rail; WLog_DBG(TAG, "RailNotifyIconUpdate"); wf_rail_notify_icon_common(context, orderInfo, notifyIconState); return TRUE; } -static BOOL wf_rail_notify_icon_delete(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo) +static BOOL wf_rail_notify_icon_delete(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo) { - wfContext* wfc = (wfContext*) context; + wfContext* wfc = (wfContext*)context; RailClientContext* rail = wfc->rail; WLog_DBG(TAG, "RailNotifyIconDelete"); return TRUE; } -static BOOL wf_rail_monitored_desktop(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo, const MONITORED_DESKTOP_ORDER* monitoredDesktop) +static BOOL wf_rail_monitored_desktop(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const MONITORED_DESKTOP_ORDER* monitoredDesktop) { - wfContext* wfc = (wfContext*) context; + wfContext* wfc = (wfContext*)context; RailClientContext* rail = wfc->rail; WLog_DBG(TAG, "RailMonitorDesktop"); return TRUE; } -static BOOL wf_rail_non_monitored_desktop(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo) +static BOOL wf_rail_non_monitored_desktop(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo) { - wfContext* wfc = (wfContext*) context; + wfContext* wfc = (wfContext*)context; RailClientContext* rail = wfc->rail; WLog_DBG(TAG, "RailNonMonitorDesktop"); return TRUE; @@ -844,7 +827,7 @@ void wf_rail_register_update_callbacks(rdpUpdate* update) * @return 0 on success, otherwise a Win32 error code */ static UINT wf_rail_server_execute_result(RailClientContext* context, - const RAIL_EXEC_RESULT_ORDER* execResult) + const RAIL_EXEC_RESULT_ORDER* execResult) { WLog_DBG(TAG, "RailServerExecuteResult: 0x%08X", execResult->rawResult); return CHANNEL_RC_OK; @@ -873,7 +856,7 @@ static UINT wf_rail_server_handshake(RailClientContext* context, RAIL_SYSPARAM_ORDER sysparam; RAIL_HANDSHAKE_ORDER clientHandshake; RAIL_CLIENT_STATUS_ORDER clientStatus; - wfContext* wfc = (wfContext*) context->custom; + wfContext* wfc = (wfContext*)context->custom; rdpSettings* settings = wfc->context.settings; clientHandshake.buildNumber = 0x00001DB0; context->ClientHandshake(context, &clientHandshake); @@ -934,7 +917,7 @@ static UINT wf_rail_server_handshake_ex(RailClientContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT wf_rail_server_local_move_size(RailClientContext* context, - const RAIL_LOCALMOVESIZE_ORDER* localMoveSize) + const RAIL_LOCALMOVESIZE_ORDER* localMoveSize) { return CHANNEL_RC_OK; } @@ -956,7 +939,7 @@ static UINT wf_rail_server_min_max_info(RailClientContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT wf_rail_server_language_bar_info(RailClientContext* context, - const RAIL_LANGBAR_INFO_ORDER* langBarInfo) + const RAIL_LANGBAR_INFO_ORDER* langBarInfo) { return CHANNEL_RC_OK; } @@ -967,7 +950,7 @@ static UINT wf_rail_server_language_bar_info(RailClientContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT wf_rail_server_get_appid_response(RailClientContext* context, - const RAIL_GET_APPID_RESP_ORDER* getAppIdResp) + const RAIL_GET_APPID_RESP_ORDER* getAppIdResp) { return CHANNEL_RC_OK; } @@ -987,8 +970,7 @@ void wf_rail_invalidate_region(wfContext* wfc, REGION16* invalidRegion) for (index = 0; index < count; index++) { - railWindow = (wfRailWindow*) HashTable_GetItemValue(wfc->railWindows, - (void*) pKeys[index]); + railWindow = (wfRailWindow*)HashTable_GetItemValue(wfc->railWindows, (void*)pKeys[index]); if (railWindow) { @@ -1016,9 +998,9 @@ void wf_rail_invalidate_region(wfContext* wfc, REGION16* invalidRegion) BOOL wf_rail_init(wfContext* wfc, RailClientContext* rail) { - rdpContext* context = (rdpContext*) wfc; + rdpContext* context = (rdpContext*)wfc; wfc->rail = rail; - rail->custom = (void*) wfc; + rail->custom = (void*)wfc; rail->ServerExecuteResult = wf_rail_server_execute_result; rail->ServerSystemParam = wf_rail_server_system_param; rail->ServerHandshake = wf_rail_server_handshake; diff --git a/client/X11/cli/xfreerdp.c b/client/X11/cli/xfreerdp.c index 3492f4353..c8a77f335 100644 --- a/client/X11/cli/xfreerdp.c +++ b/client/X11/cli/xfreerdp.c @@ -53,7 +53,7 @@ int main(int argc, char* argv[]) return 1; settings = context->settings; - xfc = (xfContext*) context; + xfc = (xfContext*)context; status = freerdp_client_settings_parse_command_line(context->settings, argc, argv, FALSE); diff --git a/client/X11/generate_argument_docbook.c b/client/X11/generate_argument_docbook.c index 1a3ebf563..d3af6415e 100644 --- a/client/X11/generate_argument_docbook.c +++ b/client/X11/generate_argument_docbook.c @@ -35,7 +35,7 @@ LPSTR tr_esc_str(LPCSTR arg, bool format) if (NULL == tmp) { - fprintf(stderr, "Could not allocate string buffer.\n"); + fprintf(stderr, "Could not allocate string buffer.\n"); exit(-2); } @@ -56,7 +56,7 @@ LPSTR tr_esc_str(LPCSTR arg, bool format) if (NULL == tmp) { - fprintf(stderr, "Could not reallocate string buffer.\n"); + fprintf(stderr, "Could not reallocate string buffer.\n"); exit(-3); } @@ -80,7 +80,7 @@ LPSTR tr_esc_str(LPCSTR arg, bool format) if (NULL == tmp) { - fprintf(stderr, "Could not reallocate string buffer.\n"); + fprintf(stderr, "Could not reallocate string buffer.\n"); exit(-4); } @@ -103,7 +103,7 @@ LPSTR tr_esc_str(LPCSTR arg, bool format) if (NULL == tmp) { - fprintf(stderr, "Could not reallocate string buffer.\n"); + fprintf(stderr, "Could not reallocate string buffer.\n"); exit(-5); } @@ -124,7 +124,7 @@ LPSTR tr_esc_str(LPCSTR arg, bool format) if (NULL == tmp) { - fprintf(stderr, "Could not reallocate string buffer.\n"); + fprintf(stderr, "Could not reallocate string buffer.\n"); exit(-6); } @@ -145,7 +145,7 @@ LPSTR tr_esc_str(LPCSTR arg, bool format) if (NULL == tmp) { - fprintf(stderr, "Could not reallocate string buffer.\n"); + fprintf(stderr, "Could not reallocate string buffer.\n"); exit(-7); } @@ -179,7 +179,7 @@ int main(int argc, char* argv[]) if (NULL == fp) { - fprintf(stderr, "Could not open '%s' for writing.\n", fname); + fprintf(stderr, "Could not open '%s' for writing.\n", fname); return -1; } @@ -192,17 +192,17 @@ int main(int argc, char* argv[]) * compatible XML */ if (elements < 2) { - fprintf(stderr, "The argument array 'args' is empty, writing an empty file.\n"); + fprintf(stderr, "The argument array 'args' is empty, writing an empty file.\n"); elements = 1; } for (x = 0; x < elements - 1; x++) { const COMMAND_LINE_ARGUMENT_A* arg = &args[x]; - char* name = tr_esc_str((LPSTR) arg->Name, FALSE); - char* alias = tr_esc_str((LPSTR) arg->Alias, FALSE); + char* name = tr_esc_str((LPSTR)arg->Name, FALSE); + char* alias = tr_esc_str((LPSTR)arg->Alias, FALSE); char* format = tr_esc_str(arg->Format, TRUE); - char* text = tr_esc_str((LPSTR) arg->Text, FALSE); + char* text = tr_esc_str((LPSTR)arg->Text, FALSE); fprintf(fp, "\t\t\t\n"); do @@ -234,8 +234,7 @@ int main(int argc, char* argv[]) free(name); name = alias; - } - while (alias); + } while (alias); if (text) { @@ -249,7 +248,7 @@ int main(int argc, char* argv[]) fprintf(fp, " (default:%s)", arg->Default ? "on" : "off"); else if (arg->Default) { - char* value = tr_esc_str((LPSTR) arg->Default, FALSE); + char* value = tr_esc_str((LPSTR)arg->Default, FALSE); fprintf(fp, " (default:%s)", value); free(value); } @@ -269,4 +268,3 @@ int main(int argc, char* argv[]) fclose(fp); return 0; } - diff --git a/client/X11/xf_channels.c b/client/X11/xf_channels.c index 09a454f97..4241a1dc6 100644 --- a/client/X11/xf_channels.c +++ b/client/X11/xf_channels.c @@ -36,31 +36,31 @@ void xf_OnChannelConnectedEventHandler(void* context, ChannelConnectedEventArgs* e) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0) { - xfc->rdpei = (RdpeiClientContext*) e->pInterface; + xfc->rdpei = (RdpeiClientContext*)e->pInterface; } else if (strcmp(e->name, TSMF_DVC_CHANNEL_NAME) == 0) { - xf_tsmf_init(xfc, (TsmfClientContext*) e->pInterface); + xf_tsmf_init(xfc, (TsmfClientContext*)e->pInterface); } else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) { - xf_graphics_pipeline_init(xfc, (RdpgfxClientContext*) e->pInterface); + xf_graphics_pipeline_init(xfc, (RdpgfxClientContext*)e->pInterface); } else if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0) { - xf_rail_init(xfc, (RailClientContext*) e->pInterface); + xf_rail_init(xfc, (RailClientContext*)e->pInterface); } else if (strcmp(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0) { - xf_cliprdr_init(xfc, (CliprdrClientContext*) e->pInterface); + xf_cliprdr_init(xfc, (CliprdrClientContext*)e->pInterface); } else if (strcmp(e->name, ENCOMSP_SVC_CHANNEL_NAME) == 0) { - xf_encomsp_init(xfc, (EncomspClientContext*) e->pInterface); + xf_encomsp_init(xfc, (EncomspClientContext*)e->pInterface); } else if (strcmp(e->name, DISP_DVC_CHANNEL_NAME) == 0) { @@ -82,7 +82,7 @@ void xf_OnChannelConnectedEventHandler(void* context, ChannelConnectedEventArgs* void xf_OnChannelDisconnectedEventHandler(void* context, ChannelDisconnectedEventArgs* e) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; rdpSettings* settings = xfc->context.settings; if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0) @@ -95,23 +95,23 @@ void xf_OnChannelDisconnectedEventHandler(void* context, ChannelDisconnectedEven } else if (strcmp(e->name, TSMF_DVC_CHANNEL_NAME) == 0) { - xf_tsmf_uninit(xfc, (TsmfClientContext*) e->pInterface); + xf_tsmf_uninit(xfc, (TsmfClientContext*)e->pInterface); } else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) { - xf_graphics_pipeline_uninit(xfc, (RdpgfxClientContext*) e->pInterface); + xf_graphics_pipeline_uninit(xfc, (RdpgfxClientContext*)e->pInterface); } else if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0) { - xf_rail_uninit(xfc, (RailClientContext*) e->pInterface); + xf_rail_uninit(xfc, (RailClientContext*)e->pInterface); } else if (strcmp(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0) { - xf_cliprdr_uninit(xfc, (CliprdrClientContext*) e->pInterface); + xf_cliprdr_uninit(xfc, (CliprdrClientContext*)e->pInterface); } else if (strcmp(e->name, ENCOMSP_SVC_CHANNEL_NAME) == 0) { - xf_encomsp_uninit(xfc, (EncomspClientContext*) e->pInterface); + xf_encomsp_uninit(xfc, (EncomspClientContext*)e->pInterface); } else if (strcmp(e->name, GEOMETRY_DVC_CHANNEL_NAME) == 0) { diff --git a/client/X11/xf_client.c b/client/X11/xf_client.c index d0f3be38d..04f43b34f 100644 --- a/client/X11/xf_client.c +++ b/client/X11/xf_client.c @@ -102,7 +102,6 @@ #include "xf_channels.h" #include "xfreerdp.h" - #include #define TAG CLIENT_TAG("x11") @@ -155,8 +154,8 @@ static void xf_draw_screen_scaled(xfContext* xfc, int x, int y, int w, int h) if (XSubtractRegion(reg1, reg2, reg1) && !XEmptyRegion(reg1)) { XSetRegion(xfc->display, xfc->gc, reg1); - XFillRectangle(xfc->display, xfc->window->handle, xfc->gc, 0, 0, - xfc->window->width, xfc->window->height); + XFillRectangle(xfc->display, xfc->window->handle, xfc->gc, 0, 0, xfc->window->width, + xfc->window->height); XSetClipMask(xfc->display, xfc->gc, None); } @@ -165,10 +164,10 @@ static void xf_draw_screen_scaled(xfContext* xfc, int x, int y, int w, int h) } picFormat = XRenderFindVisualFormat(xfc->display, xfc->visual); pa.subwindow_mode = IncludeInferiors; - primaryPicture = XRenderCreatePicture(xfc->display, xfc->primary, picFormat, - CPSubwindowMode, &pa); - windowPicture = XRenderCreatePicture(xfc->display, xfc->window->handle, - picFormat, CPSubwindowMode, &pa); + primaryPicture = + XRenderCreatePicture(xfc->display, xfc->primary, picFormat, CPSubwindowMode, &pa); + windowPicture = + XRenderCreatePicture(xfc->display, xfc->window->handle, picFormat, CPSubwindowMode, &pa); // avoid blurry filter when scaling factor is 2x, 3x, etc // useful when the client has high-dpi monitor filter = FilterBilinear; @@ -199,8 +198,8 @@ static void xf_draw_screen_scaled(xfContext* xfc, int x, int y, int w, int h) w = ceil(x2 / xScalingFactor) + 1 - x; h = ceil(y2 / yScalingFactor) + 1 - y; XRenderSetPictureTransform(xfc->display, primaryPicture, &transform); - XRenderComposite(xfc->display, PictOpSrc, primaryPicture, 0, windowPicture, x, - y, 0, 0, xfc->offset_x + x, xfc->offset_y + y, w, h); + XRenderComposite(xfc->display, PictOpSrc, primaryPicture, 0, windowPicture, x, y, 0, 0, + xfc->offset_x + x, xfc->offset_y + y, w, h); XRenderFreePicture(xfc->display, primaryPicture); XRenderFreePicture(xfc->display, windowPicture); } @@ -243,7 +242,7 @@ void xf_draw_screen(xfContext* xfc, int x, int y, int w, int h) static BOOL xf_desktop_resize(rdpContext* context) { rdpSettings* settings; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; settings = context->settings; if (xfc->primary) @@ -251,10 +250,8 @@ static BOOL xf_desktop_resize(rdpContext* context) BOOL same = (xfc->primary == xfc->drawing) ? TRUE : FALSE; XFreePixmap(xfc->display, xfc->primary); - if (!(xfc->primary = XCreatePixmap( - xfc->display, xfc->drawable, - settings->DesktopWidth, - settings->DesktopHeight, xfc->depth))) + if (!(xfc->primary = XCreatePixmap(xfc->display, xfc->drawable, settings->DesktopWidth, + settings->DesktopHeight, xfc->depth))) return FALSE; if (same) @@ -305,7 +302,7 @@ static BOOL xf_sw_end_paint(rdpContext* context) UINT32 w, h; int ninvalid; HGDI_RGN cinvalid; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; rdpGdi* gdi = context->gdi; if (gdi->suppressOutput) @@ -326,8 +323,7 @@ static BOOL xf_sw_end_paint(rdpContext* context) return TRUE; xf_lock_x11(xfc, FALSE); - XPutImage(xfc->display, xfc->primary, xfc->gc, xfc->image, - x, y, x, y, w, h); + XPutImage(xfc->display, xfc->primary, xfc->gc, xfc->image, x, y, x, y, w, h); xf_draw_screen(xfc, x, y, w, h); xf_unlock_x11(xfc, FALSE); } @@ -344,8 +340,7 @@ static BOOL xf_sw_end_paint(rdpContext* context) y = cinvalid[i].y; w = cinvalid[i].w; h = cinvalid[i].h; - XPutImage(xfc->display, xfc->primary, xfc->gc, - xfc->image, x, y, x, y, w, h); + XPutImage(xfc->display, xfc->primary, xfc->gc, xfc->image, x, y, x, y, w, h); xf_draw_screen(xfc, x, y, w, h); } @@ -371,7 +366,7 @@ static BOOL xf_sw_end_paint(rdpContext* context) static BOOL xf_sw_desktop_resize(rdpContext* context) { rdpGdi* gdi = context->gdi; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; rdpSettings* settings = context->settings; BOOL ret = FALSE; xf_lock_x11(xfc, TRUE); @@ -385,9 +380,9 @@ static BOOL xf_sw_desktop_resize(rdpContext* context) XDestroyImage(xfc->image); } - if (!(xfc->image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, - 0, (char*)gdi->primary_buffer, gdi->width, - gdi->height, xfc->scanline_pad, gdi->stride))) + if (!(xfc->image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0, + (char*)gdi->primary_buffer, gdi->width, gdi->height, + xfc->scanline_pad, gdi->stride))) { goto out; } @@ -404,7 +399,7 @@ static BOOL xf_hw_end_paint(rdpContext* context) { INT32 x, y; UINT32 w, h; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; if (xfc->context.gdi->suppressOutput) return TRUE; @@ -472,7 +467,7 @@ static BOOL xf_hw_end_paint(rdpContext* context) static BOOL xf_hw_desktop_resize(rdpContext* context) { rdpGdi* gdi = context->gdi; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; rdpSettings* settings = context->settings; BOOL ret = FALSE; xf_lock_x11(xfc, TRUE); @@ -491,7 +486,7 @@ static BOOL xf_process_x_events(freerdp* instance) BOOL status; XEvent xevent; int pending_status; - xfContext* xfc = (xfContext*) instance->context; + xfContext* xfc = (xfContext*)instance->context; status = TRUE; pending_status = TRUE; @@ -624,8 +619,7 @@ BOOL xf_create_window(xfContext* xfc) xfc->gc = XCreateGC(xfc->display, xfc->drawable, GCGraphicsExposures, &gcv); if (!xfc->primary) - xfc->primary = XCreatePixmap(xfc->display, xfc->drawable, - settings->DesktopWidth, + xfc->primary = XCreatePixmap(xfc->display, xfc->drawable, settings->DesktopWidth, settings->DesktopHeight, xfc->depth); xfc->drawing = xfc->primary; @@ -634,25 +628,21 @@ BOOL xf_create_window(xfContext* xfc) xfc->bitmap_mono = XCreatePixmap(xfc->display, xfc->drawable, 8, 8, 1); if (!xfc->gc_mono) - xfc->gc_mono = XCreateGC(xfc->display, xfc->bitmap_mono, GCGraphicsExposures, - &gcv); + xfc->gc_mono = XCreateGC(xfc->display, xfc->bitmap_mono, GCGraphicsExposures, &gcv); XSetFunction(xfc->display, xfc->gc, GXcopy); XSetFillStyle(xfc->display, xfc->gc, FillSolid); XSetForeground(xfc->display, xfc->gc, BlackPixelOfScreen(xfc->screen)); - XFillRectangle(xfc->display, xfc->primary, xfc->gc, 0, 0, - settings->DesktopWidth, + XFillRectangle(xfc->display, xfc->primary, xfc->gc, 0, 0, settings->DesktopWidth, settings->DesktopHeight); XFlush(xfc->display); if (!xfc->image) { rdpGdi* gdi = xfc->context.gdi; - xfc->image = XCreateImage(xfc->display, xfc->visual, - xfc->depth, - ZPixmap, 0, (char*) gdi->primary_buffer, - settings->DesktopWidth, settings->DesktopHeight, - xfc->scanline_pad, gdi->stride); + xfc->image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0, + (char*)gdi->primary_buffer, settings->DesktopWidth, + settings->DesktopHeight, xfc->scanline_pad, gdi->stride); xfc->image->byte_order = LSBFirst; xfc->image->bitmap_bit_order = LSBFirst; } @@ -721,7 +711,7 @@ static void xf_window_free(xfContext* xfc) void xf_toggle_fullscreen(xfContext* xfc) { WindowStateChangeEventArgs e; - rdpContext* context = (rdpContext*) xfc; + rdpContext* context = (rdpContext*)xfc; rdpSettings* settings = context->settings; /* @@ -767,7 +757,7 @@ BOOL xf_toggle_control(xfContext* xfc) * @return 0 on success, otherwise a Win32 error code */ static UINT xf_encomsp_participant_created(EncomspClientContext* context, - ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated) + ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated) { return CHANNEL_RC_OK; } @@ -775,7 +765,7 @@ static UINT xf_encomsp_participant_created(EncomspClientContext* context, void xf_encomsp_init(xfContext* xfc, EncomspClientContext* encomsp) { xfc->encomsp = encomsp; - encomsp->custom = (void*) xfc; + encomsp->custom = (void*)xfc; encomsp->ParticipantCreated = xf_encomsp_participant_created; } @@ -847,15 +837,14 @@ static BOOL xf_get_pixmap_info(xfContext* xfc) tpl.class = TrueColor; tpl.screen = xfc->screen_number; - if (XGetWindowAttributes(xfc->display, RootWindowOfScreen(xfc->screen), - &window_attributes) == 0) + if (XGetWindowAttributes(xfc->display, RootWindowOfScreen(xfc->screen), &window_attributes) == + 0) { WLog_ERR(TAG, "XGetWindowAttributes failed"); return FALSE; } - vis = XGetVisualInfo(xfc->display, VisualClassMask | VisualScreenMask, - &tpl, &vi_count); + vis = XGetVisualInfo(xfc->display, VisualClassMask | VisualScreenMask, &tpl, &vi_count); if (!vis) { @@ -923,10 +912,9 @@ static int _xf_error_handler(Display* d, XErrorEvent* ev) return xf_error_handler(d, ev); } -static BOOL xf_play_sound(rdpContext* context, - const PLAY_SOUND_UPDATE* play_sound) +static BOOL xf_play_sound(rdpContext* context, const PLAY_SOUND_UPDATE* play_sound) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; WINPR_UNUSED(play_sound); XkbBell(xfc->display, None, 100, 0); return TRUE; @@ -938,9 +926,9 @@ static void xf_check_extensions(xfContext* context) int xkb_major = XkbMajorVersion; int xkb_minor = XkbMinorVersion; - if (XkbLibraryVersion(&xkb_major, &xkb_minor) - && XkbQueryExtension(context->display, &xkb_opcode, &xkb_event, - &xkb_error, &xkb_major, &xkb_minor)) + if (XkbLibraryVersion(&xkb_major, &xkb_minor) && + XkbQueryExtension(context->display, &xkb_opcode, &xkb_event, &xkb_error, &xkb_major, + &xkb_minor)) { context->xkbAvailable = TRUE; } @@ -950,8 +938,7 @@ static void xf_check_extensions(xfContext* context) int xrender_event_base; int xrender_error_base; - if (XRenderQueryExtension(context->display, &xrender_event_base, - &xrender_error_base)) + if (XRenderQueryExtension(context->display, &xrender_event_base, &xrender_error_base)) { context->xrenderAvailable = TRUE; } @@ -962,7 +949,7 @@ static void xf_check_extensions(xfContext* context) #ifdef WITH_XI /* Input device which does NOT have the correct mapping. We must disregard */ /* this device when trying to find the input device which is the pointer. */ -static const char TEST_PTR_STR [] = "Virtual core XTEST pointer"; +static const char TEST_PTR_STR[] = "Virtual core XTEST pointer"; static const size_t TEST_PTR_LEN = sizeof(TEST_PTR_STR) / sizeof(char); /* Invalid device identifier which indicate failure. */ @@ -1054,19 +1041,18 @@ static void xf_get_x11_button_map(xfContext* xfc, unsigned char* x11_map) /* Assignment of physical (not logical) mouse buttons to wire flags. */ /* Notice that the middle button is 2 in X11, but 3 in RDP. */ -static const button_map xf_button_flags[NUM_BUTTONS_MAPPED] = -{ - {Button1, PTR_FLAGS_BUTTON1}, - {Button2, PTR_FLAGS_BUTTON3}, - {Button3, PTR_FLAGS_BUTTON2}, - {Button4, PTR_FLAGS_WHEEL | 0x78}, - {Button5, PTR_FLAGS_WHEEL | PTR_FLAGS_WHEEL_NEGATIVE | 0x78}, - {6, PTR_FLAGS_HWHEEL | PTR_FLAGS_WHEEL_NEGATIVE | 0x78}, - {7, PTR_FLAGS_HWHEEL | 0x78}, - {8, PTR_XFLAGS_BUTTON1}, - {9, PTR_XFLAGS_BUTTON2}, - {97, PTR_XFLAGS_BUTTON1}, - {112, PTR_XFLAGS_BUTTON2} +static const button_map xf_button_flags[NUM_BUTTONS_MAPPED] = { + { Button1, PTR_FLAGS_BUTTON1 }, + { Button2, PTR_FLAGS_BUTTON3 }, + { Button3, PTR_FLAGS_BUTTON2 }, + { Button4, PTR_FLAGS_WHEEL | 0x78 }, + { Button5, PTR_FLAGS_WHEEL | PTR_FLAGS_WHEEL_NEGATIVE | 0x78 }, + { 6, PTR_FLAGS_HWHEEL | PTR_FLAGS_WHEEL_NEGATIVE | 0x78 }, + { 7, PTR_FLAGS_HWHEEL | 0x78 }, + { 8, PTR_XFLAGS_BUTTON1 }, + { 9, PTR_XFLAGS_BUTTON2 }, + { 97, PTR_XFLAGS_BUTTON1 }, + { 112, PTR_XFLAGS_BUTTON2 } }; static UINT16 get_flags_for_button(int button) @@ -1135,29 +1121,29 @@ static void xf_button_map_init(xfContext* xfc) } /** -* Callback given to freerdp_connect() to process the pre-connect operations. -* It will fill the rdp_freerdp structure (instance) with the appropriate options to use for the connection. -* -* @param instance - pointer to the rdp_freerdp structure that contains the connection's parameters, and will -* be filled with the appropriate informations. -* -* @return TRUE if successful. FALSE otherwise. -* Can exit with error code XF_EXIT_PARSE_ARGUMENTS if there is an error in the parameters. -*/ + * Callback given to freerdp_connect() to process the pre-connect operations. + * It will fill the rdp_freerdp structure (instance) with the appropriate options to use for the + * connection. + * + * @param instance - pointer to the rdp_freerdp structure that contains the connection's parameters, + * and will be filled with the appropriate informations. + * + * @return TRUE if successful. FALSE otherwise. + * Can exit with error code XF_EXIT_PARSE_ARGUMENTS if there is an error in the parameters. + */ static BOOL xf_pre_connect(freerdp* instance) { rdpChannels* channels; rdpSettings* settings; rdpContext* context = instance->context; - xfContext* xfc = (xfContext*) instance->context; + xfContext* xfc = (xfContext*)instance->context; UINT32 maxWidth = 0; UINT32 maxHeight = 0; settings = instance->settings; channels = context->channels; settings->OsMajorType = OSMAJORTYPE_UNIX; settings->OsMinorType = OSMINORTYPE_NATIVE_XSERVER; - PubSub_SubscribeChannelConnected(instance->context->pubSub, - xf_OnChannelConnectedEventHandler); + PubSub_SubscribeChannelConnected(instance->context->pubSub, xf_OnChannelConnectedEventHandler); PubSub_SubscribeChannelDisconnected(instance->context->pubSub, xf_OnChannelDisconnectedEventHandler); @@ -1208,8 +1194,8 @@ static BOOL xf_pre_connect(freerdp* instance) * If /f is specified in combination with /smart-sizing:widthxheight then * we run the session in the /smart-sizing dimensions scaled to full screen */ - if (settings->Fullscreen && settings->SmartSizing && - settings->SmartSizingWidth && settings->SmartSizingHeight) + if (settings->Fullscreen && settings->SmartSizing && settings->SmartSizingWidth && + settings->SmartSizingHeight) { settings->DesktopWidth = settings->SmartSizingWidth; settings->DesktopHeight = settings->SmartSizingHeight; @@ -1225,17 +1211,17 @@ static BOOL xf_pre_connect(freerdp* instance) } /** -* Callback given to freerdp_connect() to perform post-connection operations. -* It will be called only if the connection was initialized properly, and will continue the initialization based on the -* newly created connection. -*/ + * Callback given to freerdp_connect() to perform post-connection operations. + * It will be called only if the connection was initialized properly, and will continue the + * initialization based on the newly created connection. + */ static BOOL xf_post_connect(freerdp* instance) { rdpUpdate* update; rdpContext* context; rdpSettings* settings; ResizeWindowEventArgs e; - xfContext* xfc = (xfContext*) instance->context; + xfContext* xfc = (xfContext*)instance->context; context = instance->context; settings = instance->settings; update = context->update; @@ -1333,7 +1319,7 @@ static void xf_post_disconnect(freerdp* instance) return; context = instance->context; - xfc = (xfContext*) context; + xfc = (xfContext*)context; PubSub_UnsubscribeChannelConnected(instance->context->pubSub, xf_OnChannelConnectedEventHandler); PubSub_UnsubscribeChannelDisconnected(instance->context->pubSub, @@ -1363,7 +1349,7 @@ static void xf_post_disconnect(freerdp* instance) static int xf_logon_error_info(freerdp* instance, UINT32 data, UINT32 type) { - xfContext* xfc = (xfContext*) instance->context; + xfContext* xfc = (xfContext*)instance->context; const char* str_data = freerdp_get_logon_error_info_data(data); const char* str_type = freerdp_get_logon_error_info_type(type); WLog_INFO(TAG, "Logon Error Info %s [%s]", str_data, str_type); @@ -1382,8 +1368,8 @@ static DWORD WINAPI xf_input_thread(LPVOID arg) wMessageQueue* queue; int pending_status = 1; int process_status = 1; - freerdp* instance = (freerdp*) arg; - xfContext* xfc = (xfContext*) instance->context; + freerdp* instance = (freerdp*)arg; + xfContext* xfc = (xfContext*)instance->context; queue = freerdp_get_message_queue(instance, FREERDP_INPUT_MESSAGE_QUEUE); nCount = 0; events[nCount++] = MessageQueue_Event(queue); @@ -1427,8 +1413,7 @@ static DWORD WINAPI xf_input_thread(LPVOID arg) if (!process_status) break; } - } - while (pending_status); + } while (pending_status); if (!process_status) { @@ -1475,12 +1460,12 @@ static BOOL handle_window_events(freerdp* instance) } /** Main loop for the rdp connection. -* It will be run from the thread's entry point (thread_func()). -* It initiates the connection, and will continue to run until the session ends, -* processing events as they are received. -* @param instance - pointer to the rdp_freerdp structure that contains the session's settings -* @return A code from the enum XF_EXIT_CODE (0 if successful) -*/ + * It will be run from the thread's entry point (thread_func()). + * It initiates the connection, and will continue to run until the session ends, + * processing events as they are received. + * @param instance - pointer to the rdp_freerdp structure that contains the session's settings + * @return A code from the enum XF_EXIT_CODE (0 if successful) + */ static DWORD WINAPI xf_client_thread(LPVOID param) { BOOL status; @@ -1498,17 +1483,17 @@ static DWORD WINAPI xf_client_thread(LPVOID param) rdpSettings* settings; TimerEventArgs timerEvent; EventArgsInit(&timerEvent, "xfreerdp"); - instance = (freerdp*) param; + instance = (freerdp*)param; context = instance->context; status = freerdp_connect(instance); - xfc = (xfContext*) instance->context; + xfc = (xfContext*)instance->context; if (!status) { - if (freerdp_get_last_error(instance->context) == - FREERDP_ERROR_AUTHENTICATION_FAILED) + if (freerdp_get_last_error(instance->context) == FREERDP_ERROR_AUTHENTICATION_FAILED) exit_code = XF_EXIT_AUTH_FAILURE; - else if (freerdp_get_last_error(instance->context) == FREERDP_ERROR_SECURITY_NEGO_CONNECT_FAILED) + else if (freerdp_get_last_error(instance->context) == + FREERDP_ERROR_SECURITY_NEGO_CONNECT_FAILED) exit_code = XF_EXIT_NEGO_FAILURE; else exit_code = XF_EXIT_CONN_FAILED; @@ -1522,17 +1507,16 @@ static DWORD WINAPI xf_client_thread(LPVOID param) /* --authonly ? */ if (instance->settings->AuthenticationOnly) { - WLog_ERR(TAG, "Authentication only, exit status %"PRId32"", !status); + WLog_ERR(TAG, "Authentication only, exit status %" PRId32 "", !status); goto disconnect; } if (!status) { - WLog_ERR(TAG, "Freerdp connect error exit status %"PRId32"", !status); + WLog_ERR(TAG, "Freerdp connect error exit status %" PRId32 "", !status); exit_code = freerdp_error_info(instance); - if (freerdp_get_last_error(instance->context) == - FREERDP_ERROR_AUTHENTICATION_FAILED) + if (freerdp_get_last_error(instance->context) == FREERDP_ERROR_AUTHENTICATION_FAILED) exit_code = XF_EXIT_AUTH_FAILURE; else if (exit_code == ERRINFO_SUCCESS) exit_code = XF_EXIT_CONN_FAILED; @@ -1590,7 +1574,8 @@ static DWORD WINAPI xf_client_thread(LPVOID param) } { - DWORD tmp = freerdp_get_event_handles(context, &handles[nCount], ARRAYSIZE(handles) - nCount); + DWORD tmp = + freerdp_get_event_handles(context, &handles[nCount], ARRAYSIZE(handles) - nCount); if (tmp == 0) { @@ -1655,8 +1640,8 @@ static DWORD WINAPI xf_client_thread(LPVOID param) freerdp_get_disconnect_ultimatum(context) == Disconnect_Ultimatum_user_requested) { /* This situation might be limited to Windows XP. */ - WLog_INFO(TAG, - "Error info says user did not initiate but disconnect ultimatum says they did; treat this as a user logoff"); + WLog_INFO(TAG, "Error info says user did not initiate but disconnect ultimatum says " + "they did; treat this as a user logoff"); exit_code = XF_EXIT_LOGOFF; } } @@ -1674,8 +1659,7 @@ end: DWORD xf_exit_code_from_disconnect_reason(DWORD reason) { - if (reason == 0 || (reason >= XF_EXIT_PARSE_ARGUMENTS - && reason <= XF_EXIT_NEGO_FAILURE)) + if (reason == 0 || (reason >= XF_EXIT_PARSE_ARGUMENTS && reason <= XF_EXIT_NEGO_FAILURE)) return reason; /* License error set */ else if (reason >= 0x100 && reason <= 0x10A) @@ -1698,10 +1682,9 @@ static void xf_TerminateEventHandler(void* context, TerminateEventArgs* e) } #ifdef WITH_XRENDER -static void xf_ZoomingChangeEventHandler(void* context, - ZoomingChangeEventArgs* e) +static void xf_ZoomingChangeEventHandler(void* context, ZoomingChangeEventArgs* e) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; rdpSettings* settings = xfc->context.settings; int w = xfc->scaledWidth + e->dx; int h = xfc->scaledHeight + e->dy; @@ -1723,10 +1706,9 @@ static void xf_ZoomingChangeEventHandler(void* context, xf_draw_screen(xfc, 0, 0, settings->DesktopWidth, settings->DesktopHeight); } -static void xf_PanningChangeEventHandler(void* context, - PanningChangeEventArgs* e) +static void xf_PanningChangeEventHandler(void* context, PanningChangeEventArgs* e) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; rdpSettings* settings = xfc->context.settings; if (e->dx == 0 && e->dy == 0) @@ -1739,8 +1721,8 @@ static void xf_PanningChangeEventHandler(void* context, #endif /** -* Client Interface -*/ + * Client Interface + */ static BOOL xfreerdp_client_global_init() { @@ -1758,18 +1740,16 @@ static void xfreerdp_client_global_uninit() static int xfreerdp_client_start(rdpContext* context) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; rdpSettings* settings = context->settings; if (!settings->ServerHostname) { - WLog_ERR(TAG, - "error: server hostname was not specified with /v:[:port]"); + WLog_ERR(TAG, "error: server hostname was not specified with /v:[:port]"); return -1; } - if (!(xfc->thread = CreateThread(NULL, 0, xf_client_thread, - context->instance, 0, NULL))) + if (!(xfc->thread = CreateThread(NULL, 0, xf_client_thread, context->instance, 0, NULL))) { WLog_ERR(TAG, "failed to create client thread"); return -1; @@ -1780,7 +1760,7 @@ static int xfreerdp_client_start(rdpContext* context) static int xfreerdp_client_stop(rdpContext* context) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; freerdp_abort_connect(context->instance); if (xfc->thread) @@ -1798,7 +1778,7 @@ static Atom get_supported_atom(xfContext* xfc, const char* atomName) unsigned long i; const Atom atom = XInternAtom(xfc->display, atomName, False); - for (i = 0; i < xfc->supportedAtomCount; i++) + for (i = 0; i < xfc->supportedAtomCount; i++) { if (xfc->supportedAtoms[i] == atom) return atom; @@ -1808,7 +1788,7 @@ static Atom get_supported_atom(xfContext* xfc, const char* atomName) } static BOOL xfreerdp_client_new(freerdp* instance, rdpContext* context) { - xfContext* xfc = (xfContext*) instance->context; + xfContext* xfc = (xfContext*)instance->context; assert(context); assert(xfc); assert(!xfc->display); @@ -1822,13 +1802,10 @@ static BOOL xfreerdp_client_new(freerdp* instance, rdpContext* context) instance->VerifyCertificateEx = client_cli_verify_certificate_ex; instance->VerifyChangedCertificateEx = client_cli_verify_changed_certificate_ex; instance->LogonErrorInfo = xf_logon_error_info; - PubSub_SubscribeTerminate(context->pubSub, - xf_TerminateEventHandler); + PubSub_SubscribeTerminate(context->pubSub, xf_TerminateEventHandler); #ifdef WITH_XRENDER - PubSub_SubscribeZoomingChange(context->pubSub, - xf_ZoomingChangeEventHandler); - PubSub_SubscribePanningChange(context->pubSub, - xf_PanningChangeEventHandler); + PubSub_SubscribeZoomingChange(context->pubSub, xf_ZoomingChangeEventHandler); + PubSub_SubscribePanningChange(context->pubSub, xf_PanningChangeEventHandler); #endif xfc->UseXThreads = TRUE; /* uncomment below if debugging to prevent keyboard grap */ @@ -1848,8 +1825,7 @@ static BOOL xfreerdp_client_new(freerdp* instance, rdpContext* context) if (!xfc->display) { WLog_ERR(TAG, "failed to open display: %s", XDisplayName(NULL)); - WLog_ERR(TAG, - "Please check that the $DISPLAY environment variable is properly set."); + WLog_ERR(TAG, "Please check that the $DISPLAY environment variable is properly set."); goto fail_open_display; } @@ -1878,8 +1854,8 @@ static BOOL xfreerdp_client_new(freerdp* instance, rdpContext* context) unsigned long nitems, after; unsigned char* data = NULL; int status = XGetWindowProperty(xfc->display, RootWindowOfScreen(xfc->screen), - xfc->_NET_SUPPORTED, 0, 1024, False, XA_ATOM, - &actual_type, &actual_format, &nitems, &after, &data); + xfc->_NET_SUPPORTED, 0, 1024, False, XA_ATOM, &actual_type, + &actual_format, &nitems, &after, &data); if ((status == Success) && (actual_type == XA_ATOM) && (actual_format == 32)) { @@ -1894,46 +1870,39 @@ static BOOL xfreerdp_client_new(freerdp* instance, rdpContext* context) xfc->_NET_WM_ICON = XInternAtom(xfc->display, "_NET_WM_ICON", False); xfc->_MOTIF_WM_HINTS = XInternAtom(xfc->display, "_MOTIF_WM_HINTS", False); - xfc->_NET_CURRENT_DESKTOP = XInternAtom(xfc->display, "_NET_CURRENT_DESKTOP", - False); + xfc->_NET_CURRENT_DESKTOP = XInternAtom(xfc->display, "_NET_CURRENT_DESKTOP", False); xfc->_NET_WORKAREA = XInternAtom(xfc->display, "_NET_WORKAREA", False); xfc->_NET_WM_STATE = get_supported_atom(xfc, "_NET_WM_STATE"); xfc->_NET_WM_STATE_FULLSCREEN = get_supported_atom(xfc, "_NET_WM_STATE_FULLSCREEN"); - xfc->_NET_WM_STATE_MAXIMIZED_HORZ = XInternAtom(xfc->display, - "_NET_WM_STATE_MAXIMIZED_HORZ", False); - xfc->_NET_WM_STATE_MAXIMIZED_VERT = XInternAtom(xfc->display, - "_NET_WM_STATE_MAXIMIZED_VERT", False); + xfc->_NET_WM_STATE_MAXIMIZED_HORZ = + XInternAtom(xfc->display, "_NET_WM_STATE_MAXIMIZED_HORZ", False); + xfc->_NET_WM_STATE_MAXIMIZED_VERT = + XInternAtom(xfc->display, "_NET_WM_STATE_MAXIMIZED_VERT", False); xfc->_NET_WM_FULLSCREEN_MONITORS = get_supported_atom(xfc, "_NET_WM_FULLSCREEN_MONITORS"); xfc->_NET_WM_NAME = XInternAtom(xfc->display, "_NET_WM_NAME", False); xfc->_NET_WM_PID = XInternAtom(xfc->display, "_NET_WM_PID", False); - xfc->_NET_WM_WINDOW_TYPE = XInternAtom(xfc->display, "_NET_WM_WINDOW_TYPE", - False); - xfc->_NET_WM_WINDOW_TYPE_NORMAL = XInternAtom(xfc->display, - "_NET_WM_WINDOW_TYPE_NORMAL", False); - xfc->_NET_WM_WINDOW_TYPE_DIALOG = XInternAtom(xfc->display, - "_NET_WM_WINDOW_TYPE_DIALOG", False); - xfc->_NET_WM_WINDOW_TYPE_POPUP = XInternAtom(xfc->display, - "_NET_WM_WINDOW_TYPE_POPUP", False); - xfc->_NET_WM_WINDOW_TYPE_POPUP_MENU = XInternAtom(xfc->display, - "_NET_WM_WINDOW_TYPE_POPUP_MENU", False); - xfc->_NET_WM_WINDOW_TYPE_UTILITY = XInternAtom(xfc->display, - "_NET_WM_WINDOW_TYPE_UTILITY", False); - xfc->_NET_WM_WINDOW_TYPE_DROPDOWN_MENU = XInternAtom(xfc->display, - "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU", False); - xfc->_NET_WM_STATE_SKIP_TASKBAR = XInternAtom(xfc->display, - "_NET_WM_STATE_SKIP_TASKBAR", False); - xfc->_NET_WM_STATE_SKIP_PAGER = XInternAtom(xfc->display, - "_NET_WM_STATE_SKIP_PAGER", False); - xfc->_NET_WM_MOVERESIZE = XInternAtom(xfc->display, "_NET_WM_MOVERESIZE", - False); - xfc->_NET_MOVERESIZE_WINDOW = XInternAtom(xfc->display, - "_NET_MOVERESIZE_WINDOW", False); + xfc->_NET_WM_WINDOW_TYPE = XInternAtom(xfc->display, "_NET_WM_WINDOW_TYPE", False); + xfc->_NET_WM_WINDOW_TYPE_NORMAL = + XInternAtom(xfc->display, "_NET_WM_WINDOW_TYPE_NORMAL", False); + xfc->_NET_WM_WINDOW_TYPE_DIALOG = + XInternAtom(xfc->display, "_NET_WM_WINDOW_TYPE_DIALOG", False); + xfc->_NET_WM_WINDOW_TYPE_POPUP = XInternAtom(xfc->display, "_NET_WM_WINDOW_TYPE_POPUP", False); + xfc->_NET_WM_WINDOW_TYPE_POPUP_MENU = + XInternAtom(xfc->display, "_NET_WM_WINDOW_TYPE_POPUP_MENU", False); + xfc->_NET_WM_WINDOW_TYPE_UTILITY = + XInternAtom(xfc->display, "_NET_WM_WINDOW_TYPE_UTILITY", False); + xfc->_NET_WM_WINDOW_TYPE_DROPDOWN_MENU = + XInternAtom(xfc->display, "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU", False); + xfc->_NET_WM_STATE_SKIP_TASKBAR = + XInternAtom(xfc->display, "_NET_WM_STATE_SKIP_TASKBAR", False); + xfc->_NET_WM_STATE_SKIP_PAGER = XInternAtom(xfc->display, "_NET_WM_STATE_SKIP_PAGER", False); + xfc->_NET_WM_MOVERESIZE = XInternAtom(xfc->display, "_NET_WM_MOVERESIZE", False); + xfc->_NET_MOVERESIZE_WINDOW = XInternAtom(xfc->display, "_NET_MOVERESIZE_WINDOW", False); xfc->UTF8_STRING = XInternAtom(xfc->display, "UTF8_STRING", FALSE); xfc->WM_PROTOCOLS = XInternAtom(xfc->display, "WM_PROTOCOLS", False); xfc->WM_DELETE_WINDOW = XInternAtom(xfc->display, "WM_DELETE_WINDOW", False); xfc->WM_STATE = XInternAtom(xfc->display, "WM_STATE", False); - xfc->x11event = CreateFileDescriptorEvent(NULL, FALSE, FALSE, xfc->xfds, - WINPR_FD_READ); + xfc->x11event = CreateFileDescriptorEvent(NULL, FALSE, FALSE, xfc->xfds, WINPR_FD_READ); if (!xfc->x11event) { @@ -1980,18 +1949,15 @@ fail_open_display: static void xfreerdp_client_free(freerdp* instance, rdpContext* context) { - xfContext* xfc = (xfContext*) instance->context; + xfContext* xfc = (xfContext*)instance->context; if (!context) return; - PubSub_UnsubscribeTerminate(context->pubSub, - xf_TerminateEventHandler); + PubSub_UnsubscribeTerminate(context->pubSub, xf_TerminateEventHandler); #ifdef WITH_XRENDER - PubSub_UnsubscribeZoomingChange(context->pubSub, - xf_ZoomingChangeEventHandler); - PubSub_UnsubscribePanningChange(context->pubSub, - xf_PanningChangeEventHandler); + PubSub_UnsubscribeZoomingChange(context->pubSub, xf_ZoomingChangeEventHandler); + PubSub_UnsubscribePanningChange(context->pubSub, xf_PanningChangeEventHandler); #endif if (xfc->display) diff --git a/client/X11/xf_client.h b/client/X11/xf_client.h index 34535a1e1..e3b00bf9b 100644 --- a/client/X11/xf_client.h +++ b/client/X11/xf_client.h @@ -36,15 +36,15 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/** - * Client Interface - */ + /** + * Client Interface + */ - -FREERDP_API int RdpClientEntry(RDP_CLIENT_ENTRY_POINTS* pEntryPoints); + FREERDP_API int RdpClientEntry(RDP_CLIENT_ENTRY_POINTS* pEntryPoints); #ifdef __cplusplus } diff --git a/client/X11/xf_cliprdr.c b/client/X11/xf_cliprdr.c index befc1126f..461dc5b6a 100644 --- a/client/X11/xf_cliprdr.c +++ b/client/X11/xf_cliprdr.c @@ -45,7 +45,7 @@ #define TAG CLIENT_TAG("x11") -#define MAX_CLIPBOARD_FORMATS 255 +#define MAX_CLIPBOARD_FORMATS 255 struct xf_cliprdr_format { @@ -132,17 +132,15 @@ static void xf_cliprdr_check_owner(xfClipboard* clipboard) static BOOL xf_cliprdr_is_self_owned(xfClipboard* clipboard) { xfContext* xfc = clipboard->xfc; - return XGetSelectionOwner(xfc->display, - clipboard->clipboard_atom) == xfc->drawable; + return XGetSelectionOwner(xfc->display, clipboard->clipboard_atom) == xfc->drawable; } -static void xf_cliprdr_set_raw_transfer_enabled(xfClipboard* clipboard, - BOOL enabled) +static void xf_cliprdr_set_raw_transfer_enabled(xfClipboard* clipboard, BOOL enabled) { UINT32 data = enabled; xfContext* xfc = clipboard->xfc; - XChangeProperty(xfc->display, xfc->drawable, clipboard->raw_transfer_atom, - XA_INTEGER, 32, PropModeReplace, (BYTE*) &data, 1); + XChangeProperty(xfc->display, xfc->drawable, clipboard->raw_transfer_atom, XA_INTEGER, 32, + PropModeReplace, (BYTE*)&data, 1); } static BOOL xf_cliprdr_is_raw_transfer_available(xfClipboard* clipboard) @@ -160,9 +158,9 @@ static BOOL xf_cliprdr_is_raw_transfer_available(xfClipboard* clipboard) if (owner != None) { - result = XGetWindowProperty(xfc->display, owner, - clipboard->raw_transfer_atom, 0, 4, 0, XA_INTEGER, - &type, &format, &length, &bytes_left, (BYTE**) &data); + result = + XGetWindowProperty(xfc->display, owner, clipboard->raw_transfer_atom, 0, 4, 0, + XA_INTEGER, &type, &format, &length, &bytes_left, (BYTE**)&data); } if (data) @@ -180,14 +178,12 @@ static BOOL xf_cliprdr_is_raw_transfer_available(xfClipboard* clipboard) return is_enabled ? TRUE : FALSE; } -static BOOL xf_cliprdr_formats_equal(const CLIPRDR_FORMAT* server, - const xfCliprdrFormat* client) +static BOOL xf_cliprdr_formats_equal(const CLIPRDR_FORMAT* server, const xfCliprdrFormat* client) { if (server->formatName && client->formatName) { /* The server may be using short format names while we store them in full form. */ - return (0 == strncmp(server->formatName, client->formatName, - strlen(server->formatName))); + return (0 == strncmp(server->formatName, client->formatName, strlen(server->formatName))); } if (!server->formatName && !client->formatName) @@ -198,8 +194,7 @@ static BOOL xf_cliprdr_formats_equal(const CLIPRDR_FORMAT* server, return FALSE; } -static xfCliprdrFormat* xf_cliprdr_get_client_format_by_id( - xfClipboard* clipboard, UINT32 formatId) +static xfCliprdrFormat* xf_cliprdr_get_client_format_by_id(xfClipboard* clipboard, UINT32 formatId) { int index; xfCliprdrFormat* format; @@ -215,8 +210,7 @@ static xfCliprdrFormat* xf_cliprdr_get_client_format_by_id( return NULL; } -static xfCliprdrFormat* xf_cliprdr_get_client_format_by_atom( - xfClipboard* clipboard, Atom atom) +static xfCliprdrFormat* xf_cliprdr_get_client_format_by_atom(xfClipboard* clipboard, Atom atom) { int i; xfCliprdrFormat* format; @@ -232,8 +226,7 @@ static xfCliprdrFormat* xf_cliprdr_get_client_format_by_atom( return NULL; } -static CLIPRDR_FORMAT* xf_cliprdr_get_server_format_by_atom( - xfClipboard* clipboard, Atom atom) +static CLIPRDR_FORMAT* xf_cliprdr_get_server_format_by_atom(xfClipboard* clipboard, Atom atom) { int i, j; xfCliprdrFormat* client_format; @@ -263,13 +256,11 @@ static CLIPRDR_FORMAT* xf_cliprdr_get_server_format_by_atom( * * @return 0 on success, otherwise a Win32 error code */ -static UINT xf_cliprdr_send_data_request(xfClipboard* clipboard, - UINT32 formatId) +static UINT xf_cliprdr_send_data_request(xfClipboard* clipboard, UINT32 formatId) { CLIPRDR_FORMAT_DATA_REQUEST request = { 0 }; request.requestedFormatId = formatId; - return clipboard->context->ClientFormatDataRequest(clipboard->context, - &request); + return clipboard->context->ClientFormatDataRequest(clipboard->context, &request); } /** @@ -277,15 +268,13 @@ static UINT xf_cliprdr_send_data_request(xfClipboard* clipboard, * * @return 0 on success, otherwise a Win32 error code */ -static UINT xf_cliprdr_send_data_response(xfClipboard* clipboard, BYTE* data, - int size) +static UINT xf_cliprdr_send_data_response(xfClipboard* clipboard, BYTE* data, int size) { CLIPRDR_FORMAT_DATA_RESPONSE response = { 0 }; response.msgFlags = (data) ? CB_RESPONSE_OK : CB_RESPONSE_FAIL; response.dataLen = size; response.requestedFormatData = data; - return clipboard->context->ClientFormatDataResponse(clipboard->context, - &response); + return clipboard->context->ClientFormatDataResponse(clipboard->context, &response); } static wStream* xf_cliprdr_serialize_server_format_list(xfClipboard* clipboard) @@ -302,8 +291,7 @@ static wStream* xf_cliprdr_serialize_server_format_list(xfClipboard* clipboard) } /* If present, the last format is always synthetic CF_RAW. Do not include it. */ - formatCount = (clipboard->numServerFormats > 0) ? clipboard->numServerFormats - - 1 : 0; + formatCount = (clipboard->numServerFormats > 0) ? clipboard->numServerFormats - 1 : 0; Stream_Write_UINT32(s, formatCount); for (i = 0; i < formatCount; i++) @@ -332,8 +320,8 @@ error: return NULL; } -static CLIPRDR_FORMAT* xf_cliprdr_parse_server_format_list(BYTE* data, - size_t length, UINT32* numFormats) +static CLIPRDR_FORMAT* xf_cliprdr_parse_server_format_list(BYTE* data, size_t length, + UINT32* numFormats) { UINT32 i; wStream* s = NULL; @@ -355,11 +343,11 @@ static CLIPRDR_FORMAT* xf_cliprdr_parse_server_format_list(BYTE* data, if (*numFormats > MAX_CLIPBOARD_FORMATS) { - WLog_ERR(TAG, "unexpectedly large number of formats: %"PRIu32"", *numFormats); + WLog_ERR(TAG, "unexpectedly large number of formats: %" PRIu32 "", *numFormats); goto error; } - if (!(formats = (CLIPRDR_FORMAT*) calloc(*numFormats, sizeof(CLIPRDR_FORMAT)))) + if (!(formats = (CLIPRDR_FORMAT*)calloc(*numFormats, sizeof(CLIPRDR_FORMAT)))) { WLog_ERR(TAG, "failed to allocate format list"); goto error; @@ -377,12 +365,12 @@ static CLIPRDR_FORMAT* xf_cliprdr_parse_server_format_list(BYTE* data, } Stream_Read_UINT32(s, formats[i].formatId); - formatName = (const char*) Stream_Pointer(s); + formatName = (const char*)Stream_Pointer(s); formatNameLength = strnlen(formatName, Stream_GetRemainingLength(s)); if (formatNameLength == Stream_GetRemainingLength(s)) { - WLog_ERR(TAG, "missing terminating null byte, %"PRIuz" bytes left to read", + WLog_ERR(TAG, "missing terminating null byte, %" PRIuz " bytes left to read", formatNameLength); goto error; } @@ -412,8 +400,7 @@ static void xf_cliprdr_free_formats(CLIPRDR_FORMAT* formats, UINT32 numFormats) free(formats); } -static CLIPRDR_FORMAT* xf_cliprdr_get_raw_server_formats(xfClipboard* clipboard, - UINT32* numFormats) +static CLIPRDR_FORMAT* xf_cliprdr_get_raw_server_formats(xfClipboard* clipboard, UINT32* numFormats) { Atom type = None; int format = 0; @@ -423,22 +410,21 @@ static CLIPRDR_FORMAT* xf_cliprdr_get_raw_server_formats(xfClipboard* clipboard, CLIPRDR_FORMAT* formats = NULL; xfContext* xfc = clipboard->xfc; *numFormats = 0; - XGetWindowProperty(xfc->display, clipboard->owner, - clipboard->raw_format_list_atom, - 0, 4096, False, clipboard->raw_format_list_atom, &type, &format, - &length, &remaining, &data); + XGetWindowProperty(xfc->display, clipboard->owner, clipboard->raw_format_list_atom, 0, 4096, + False, clipboard->raw_format_list_atom, &type, &format, &length, &remaining, + &data); - if (data && length > 0 && format == 8 - && type == clipboard->raw_format_list_atom) + if (data && length > 0 && format == 8 && type == clipboard->raw_format_list_atom) { formats = xf_cliprdr_parse_server_format_list(data, length, numFormats); } else { WLog_ERR(TAG, - "failed to retrieve raw format list: data=%p, length=%lu, format=%d, type=%lu (expected=%lu)", - (void*) data, length, format, (unsigned long) type, - (unsigned long) clipboard->raw_format_list_atom); + "failed to retrieve raw format list: data=%p, length=%lu, format=%d, type=%lu " + "(expected=%lu)", + (void*)data, length, format, (unsigned long)type, + (unsigned long)clipboard->raw_format_list_atom); } if (data) @@ -447,8 +433,8 @@ static CLIPRDR_FORMAT* xf_cliprdr_get_raw_server_formats(xfClipboard* clipboard, return formats; } -static CLIPRDR_FORMAT* xf_cliprdr_get_formats_from_targets( - xfClipboard* clipboard, UINT32* numFormats) +static CLIPRDR_FORMAT* xf_cliprdr_get_formats_from_targets(xfClipboard* clipboard, + UINT32* numFormats) { unsigned long i; Atom atom; @@ -460,8 +446,8 @@ static CLIPRDR_FORMAT* xf_cliprdr_get_formats_from_targets( CLIPRDR_FORMAT* formats = NULL; xfContext* xfc = clipboard->xfc; *numFormats = 0; - XGetWindowProperty(xfc->display, xfc->drawable, clipboard->property_atom, - 0, 200, 0, XA_ATOM, &atom, &format_property, &length, &bytes_left, &data); + XGetWindowProperty(xfc->display, xfc->drawable, clipboard->property_atom, 0, 200, 0, XA_ATOM, + &atom, &format_property, &length, &bytes_left, &data); if (length > 0) { @@ -471,7 +457,7 @@ static CLIPRDR_FORMAT* xf_cliprdr_get_formats_from_targets( goto out; } - if (!(formats = (CLIPRDR_FORMAT*) calloc(length, sizeof(CLIPRDR_FORMAT)))) + if (!(formats = (CLIPRDR_FORMAT*)calloc(length, sizeof(CLIPRDR_FORMAT)))) { WLog_ERR(TAG, "failed to allocate %lu CLIPRDR_FORMAT structs", length); goto out; @@ -480,7 +466,7 @@ static CLIPRDR_FORMAT* xf_cliprdr_get_formats_from_targets( for (i = 0; i < length; i++) { - atom = ((Atom*) data)[i]; + atom = ((Atom*)data)[i]; format = xf_cliprdr_get_client_format_by_atom(clipboard, atom); if (format) @@ -499,8 +485,7 @@ out: return formats; } -static CLIPRDR_FORMAT* xf_cliprdr_get_client_formats(xfClipboard* clipboard, - UINT32* numFormats) +static CLIPRDR_FORMAT* xf_cliprdr_get_client_formats(xfClipboard* clipboard, UINT32* numFormats) { CLIPRDR_FORMAT* formats = NULL; *numFormats = 0; @@ -528,8 +513,8 @@ static void xf_cliprdr_provide_server_format_list(xfClipboard* clipboard) if (formats) { XChangeProperty(xfc->display, xfc->drawable, clipboard->raw_format_list_atom, - clipboard->raw_format_list_atom, 8, PropModeReplace, - Stream_Buffer(formats), Stream_Length(formats)); + clipboard->raw_format_list_atom, 8, PropModeReplace, Stream_Buffer(formats), + Stream_Length(formats)); } else { @@ -552,8 +537,8 @@ static void xf_cliprdr_get_requested_targets(xfClipboard* clipboard) xf_cliprdr_free_formats(formats, numFormats); } -static void xf_cliprdr_process_requested_data(xfClipboard* clipboard, - BOOL hasData, BYTE* data, int size) +static void xf_cliprdr_process_requested_data(xfClipboard* clipboard, BOOL hasData, BYTE* data, + int size) { BOOL bSuccess; UINT32 SrcSize; @@ -566,8 +551,7 @@ static void xf_cliprdr_process_requested_data(xfClipboard* clipboard, if (clipboard->incr_starts && hasData) return; - format = xf_cliprdr_get_client_format_by_id(clipboard, - clipboard->requestedFormatId); + format = xf_cliprdr_get_client_format_by_id(clipboard, clipboard->requestedFormatId); if (!hasData || !data || !format) { @@ -586,7 +570,7 @@ static void xf_cliprdr_process_requested_data(xfClipboard* clipboard, case CF_TEXT: case CF_OEMTEXT: case CF_UNICODETEXT: - size = strlen((char*) data) + 1; + size = strlen((char*)data) + 1; srcFormatId = ClipboardGetFormatId(clipboard->system, "UTF8_STRING"); break; @@ -603,7 +587,7 @@ static void xf_cliprdr_process_requested_data(xfClipboard* clipboard, break; } - SrcSize = (UINT32) size; + SrcSize = (UINT32)size; bSuccess = ClipboardSetData(clipboard->system, srcFormatId, data, SrcSize); if (format->formatName) @@ -614,7 +598,7 @@ static void xf_cliprdr_process_requested_data(xfClipboard* clipboard, if (bSuccess) { DstSize = 0; - pDstData = (BYTE*) ClipboardGetData(clipboard->system, dstFormatId, &DstSize); + pDstData = (BYTE*)ClipboardGetData(clipboard->system, dstFormatId, &DstSize); } if (!pDstData) @@ -634,7 +618,7 @@ static void xf_cliprdr_process_requested_data(xfClipboard* clipboard, (dstFormatId == ClipboardGetFormatId(clipboard->system, "FileGroupDescriptorW"))) { UINT error = NO_ERROR; - FILEDESCRIPTOR* file_array = (FILEDESCRIPTOR*) pDstData; + FILEDESCRIPTOR* file_array = (FILEDESCRIPTOR*)pDstData; UINT32 file_count = DstSize / sizeof(FILEDESCRIPTOR); pDstData = NULL; DstSize = 0; @@ -646,7 +630,7 @@ static void xf_cliprdr_process_requested_data(xfClipboard* clipboard, free(file_array); } - xf_cliprdr_send_data_response(clipboard, pDstData, (int) DstSize); + xf_cliprdr_send_data_response(clipboard, pDstData, (int)DstSize); free(pDstData); } @@ -661,8 +645,7 @@ static BOOL xf_cliprdr_get_requested_data(xfClipboard* clipboard, Atom target) unsigned long bytes_left; xfCliprdrFormat* format; xfContext* xfc = clipboard->xfc; - format = xf_cliprdr_get_client_format_by_id(clipboard, - clipboard->requestedFormatId); + format = xf_cliprdr_get_client_format_by_id(clipboard, clipboard->requestedFormatId); if (!format || (format->atom != target)) { @@ -670,8 +653,7 @@ static BOOL xf_cliprdr_get_requested_data(xfClipboard* clipboard, Atom target) return FALSE; } - XGetWindowProperty(xfc->display, xfc->drawable, - clipboard->property_atom, 0, 0, 0, target, + XGetWindowProperty(xfc->display, xfc->drawable, clipboard->property_atom, 0, 0, 0, target, &type, &format_property, &length, &bytes_left, &data); if (data) @@ -708,23 +690,22 @@ static BOOL xf_cliprdr_get_requested_data(xfClipboard* clipboard, Atom target) clipboard->incr_starts = 0; has_data = TRUE; } - else if (XGetWindowProperty(xfc->display, xfc->drawable, - clipboard->property_atom, 0, bytes_left, 0, target, - &type, &format_property, &length, &dummy, &data) == Success) + else if (XGetWindowProperty(xfc->display, xfc->drawable, clipboard->property_atom, 0, + bytes_left, 0, target, &type, &format_property, &length, &dummy, + &data) == Success) { if (clipboard->incr_starts) { BYTE* new_data; bytes_left = length * format_property / 8; - new_data = (BYTE*) realloc(clipboard->incr_data, - clipboard->incr_data_length + bytes_left); + new_data = + (BYTE*)realloc(clipboard->incr_data, clipboard->incr_data_length + bytes_left); if (!new_data) return FALSE; clipboard->incr_data = new_data; - CopyMemory(clipboard->incr_data + clipboard->incr_data_length, data, - bytes_left); + CopyMemory(clipboard->incr_data + clipboard->incr_data_length, data, bytes_left); clipboard->incr_data_length += bytes_left; XFree(data); data = NULL; @@ -738,7 +719,7 @@ static BOOL xf_cliprdr_get_requested_data(xfClipboard* clipboard, Atom target) } XDeleteProperty(xfc->display, xfc->drawable, clipboard->property_atom); - xf_cliprdr_process_requested_data(clipboard, has_data, data, (int) bytes_left); + xf_cliprdr_process_requested_data(clipboard, has_data, data, (int)bytes_left); if (data) XFree(data); @@ -771,27 +752,25 @@ static void xf_cliprdr_provide_targets(xfClipboard* clipboard, XEvent* respond) if (respond->xselection.property != None) { - XChangeProperty(xfc->display, respond->xselection.requestor, - respond->xselection.property, XA_ATOM, 32, PropModeReplace, - (BYTE*) clipboard->targets, clipboard->numTargets); + XChangeProperty(xfc->display, respond->xselection.requestor, respond->xselection.property, + XA_ATOM, 32, PropModeReplace, (BYTE*)clipboard->targets, + clipboard->numTargets); } } -static void xf_cliprdr_provide_data(xfClipboard* clipboard, XEvent* respond, - BYTE* data, UINT32 size) +static void xf_cliprdr_provide_data(xfClipboard* clipboard, XEvent* respond, BYTE* data, + UINT32 size) { xfContext* xfc = clipboard->xfc; if (respond->xselection.property != None) { - XChangeProperty(xfc->display, respond->xselection.requestor, - respond->xselection.property, respond->xselection.target, - 8, PropModeReplace, data, size); + XChangeProperty(xfc->display, respond->xselection.requestor, respond->xselection.property, + respond->xselection.target, 8, PropModeReplace, data, size); } } -static BOOL xf_cliprdr_process_selection_notify(xfClipboard* clipboard, - XEvent* xevent) +static BOOL xf_cliprdr_process_selection_notify(xfClipboard* clipboard, XEvent* xevent) { if (xevent->xselection.target == clipboard->targets[1]) { @@ -831,8 +810,7 @@ static void xf_cliprdr_clear_cached_data(xfClipboard* clipboard) clipboard->data_raw_length = 0; } -static BOOL xf_cliprdr_process_selection_request(xfClipboard* clipboard, - XEvent* xevent) +static BOOL xf_cliprdr_process_selection_request(xfClipboard* clipboard, XEvent* xevent) { int fmt; Atom type; @@ -853,7 +831,7 @@ static BOOL xf_cliprdr_process_selection_request(xfClipboard* clipboard, delayRespond = FALSE; - if (!(respond = (XEvent*) calloc(1, sizeof(XEvent)))) + if (!(respond = (XEvent*)calloc(1, sizeof(XEvent)))) { WLog_ERR(TAG, "failed to allocate XEvent data"); return FALSE; @@ -871,8 +849,7 @@ static BOOL xf_cliprdr_process_selection_request(xfClipboard* clipboard, { /* TODO */ } - else if (xevent->xselectionrequest.target == - clipboard->targets[1]) /* TARGETS */ + else if (xevent->xselectionrequest.target == clipboard->targets[1]) /* TARGETS */ { /* Someone else requests our available formats */ respond->xselection.property = xevent->xselectionrequest.property; @@ -880,8 +857,7 @@ static BOOL xf_cliprdr_process_selection_request(xfClipboard* clipboard, } else { - format = xf_cliprdr_get_server_format_by_atom(clipboard, - xevent->xselectionrequest.target); + format = xf_cliprdr_get_server_format_by_atom(clipboard, xevent->xselectionrequest.target); if (format && (xevent->xselectionrequest.requestor != xfc->drawable)) { @@ -892,8 +868,8 @@ static BOOL xf_cliprdr_process_selection_request(xfClipboard* clipboard, if (formatId == CF_RAW) { if (XGetWindowProperty(xfc->display, xevent->xselectionrequest.requestor, - clipboard->property_atom, 0, 4, 0, XA_INTEGER, - &type, &fmt, &length, &bytes_left, &data) != Success) + clipboard->property_atom, 0, 4, 0, XA_INTEGER, &type, &fmt, + &length, &bytes_left, &data) != Success) { } @@ -907,8 +883,8 @@ static BOOL xf_cliprdr_process_selection_request(xfClipboard* clipboard, /* We can compare format names by pointer value here as they are both * taken from the same clipboard->serverFormats array */ - matchingFormat = (formatId == clipboard->data_format_id) - && (formatName == clipboard->data_format_name); + matchingFormat = (formatId == clipboard->data_format_id) && + (formatName == clipboard->data_format_name); if (matchingFormat && (clipboard->data != 0) && !rawTransfer) { @@ -921,7 +897,8 @@ static BOOL xf_cliprdr_process_selection_request(xfClipboard* clipboard, { /* Cached raw clipboard data available. Send it now */ respond->xselection.property = xevent->xselectionrequest.property; - xf_cliprdr_provide_data(clipboard, respond, clipboard->data_raw, clipboard->data_raw_length); + xf_cliprdr_provide_data(clipboard, respond, clipboard->data_raw, + clipboard->data_raw_length); } else if (clipboard->respond) { @@ -955,8 +932,7 @@ static BOOL xf_cliprdr_process_selection_request(xfClipboard* clipboard, return TRUE; } -static BOOL xf_cliprdr_process_selection_clear(xfClipboard* clipboard, - XEvent* xevent) +static BOOL xf_cliprdr_process_selection_clear(xfClipboard* clipboard, XEvent* xevent) { xfContext* xfc = clipboard->xfc; @@ -969,8 +945,7 @@ static BOOL xf_cliprdr_process_selection_clear(xfClipboard* clipboard, return TRUE; } -static BOOL xf_cliprdr_process_property_notify(xfClipboard* clipboard, - XEvent* xevent) +static BOOL xf_cliprdr_process_property_notify(xfClipboard* clipboard, XEvent* xevent) { xfCliprdrFormat* format; xfContext* xfc = NULL; @@ -990,8 +965,7 @@ static BOOL xf_cliprdr_process_property_notify(xfClipboard* clipboard, else if ((xevent->xproperty.window == xfc->drawable) && (xevent->xproperty.state == PropertyNewValue) && clipboard->incr_starts) { - format = xf_cliprdr_get_client_format_by_id(clipboard, - clipboard->requestedFormatId); + format = xf_cliprdr_get_client_format_by_id(clipboard, clipboard->requestedFormatId); if (format) xf_cliprdr_get_requested_data(clipboard, format->atom); @@ -1014,10 +988,10 @@ void xf_cliprdr_handle_xevent(xfContext* xfc, XEvent* event) #ifdef WITH_XFIXES - if (clipboard->xfixes_supported - && event->type == XFixesSelectionNotify + clipboard->xfixes_event_base) + if (clipboard->xfixes_supported && + event->type == XFixesSelectionNotify + clipboard->xfixes_event_base) { - XFixesSelectionNotifyEvent* se = (XFixesSelectionNotifyEvent*) event; + XFixesSelectionNotifyEvent* se = (XFixesSelectionNotifyEvent*)event; if (se->subtype == XFixesSetSelectionOwnerNotify) { @@ -1074,19 +1048,16 @@ static UINT xf_cliprdr_send_client_capabilities(xfClipboard* clipboard) CLIPRDR_CAPABILITIES capabilities; CLIPRDR_GENERAL_CAPABILITY_SET generalCapabilitySet; capabilities.cCapabilitiesSets = 1; - capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET*) & - (generalCapabilitySet); + capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET*)&(generalCapabilitySet); generalCapabilitySet.capabilitySetType = CB_CAPSTYPE_GENERAL; generalCapabilitySet.capabilitySetLength = 12; generalCapabilitySet.version = CB_CAPS_VERSION_2; generalCapabilitySet.generalFlags = CB_USE_LONG_FORMAT_NAMES; if (clipboard->streams_supported && clipboard->file_formats_registered) - generalCapabilitySet.generalFlags |= - CB_STREAM_FILECLIP_ENABLED | CB_FILECLIP_NO_FILE_PATHS; + generalCapabilitySet.generalFlags |= CB_STREAM_FILECLIP_ENABLED | CB_FILECLIP_NO_FILE_PATHS; - return clipboard->context->ClientCapabilities(clipboard->context, - &capabilities); + return clipboard->context->ClientCapabilities(clipboard->context, &capabilities); } /** @@ -1105,9 +1076,9 @@ static UINT xf_cliprdr_send_client_format_list(xfClipboard* clipboard) if (numFormats) { - if (!(formats = (CLIPRDR_FORMAT*) calloc(numFormats, sizeof(CLIPRDR_FORMAT)))) + if (!(formats = (CLIPRDR_FORMAT*)calloc(numFormats, sizeof(CLIPRDR_FORMAT)))) { - WLog_ERR(TAG, "failed to allocate %"PRIu32" CLIPRDR_FORMAT structs", numFormats); + WLog_ERR(TAG, "failed to allocate %" PRIu32 " CLIPRDR_FORMAT structs", numFormats); return CHANNEL_RC_NO_MEMORY; } } @@ -1127,8 +1098,8 @@ static UINT xf_cliprdr_send_client_format_list(xfClipboard* clipboard) if (clipboard->owner && clipboard->owner != xfc->drawable) { /* Request the owner for TARGETS, and wait for SelectionNotify event */ - XConvertSelection(xfc->display, clipboard->clipboard_atom, - clipboard->targets[1], clipboard->property_atom, xfc->drawable, CurrentTime); + XConvertSelection(xfc->display, clipboard->clipboard_atom, clipboard->targets[1], + clipboard->property_atom, xfc->drawable, CurrentTime); } return ret; @@ -1139,15 +1110,13 @@ static UINT xf_cliprdr_send_client_format_list(xfClipboard* clipboard) * * @return 0 on success, otherwise a Win32 error code */ -static UINT xf_cliprdr_send_client_format_list_response(xfClipboard* clipboard, - BOOL status) +static UINT xf_cliprdr_send_client_format_list_response(xfClipboard* clipboard, BOOL status) { CLIPRDR_FORMAT_LIST_RESPONSE formatListResponse; formatListResponse.msgType = CB_FORMAT_LIST_RESPONSE; formatListResponse.msgFlags = status ? CB_RESPONSE_OK : CB_RESPONSE_FAIL; formatListResponse.dataLen = 0; - return clipboard->context->ClientFormatListResponse(clipboard->context, - &formatListResponse); + return clipboard->context->ClientFormatListResponse(clipboard->context, &formatListResponse); } /** @@ -1158,7 +1127,7 @@ static UINT xf_cliprdr_send_client_format_list_response(xfClipboard* clipboard, static UINT xf_cliprdr_monitor_ready(CliprdrClientContext* context, const CLIPRDR_MONITOR_READY* monitorReady) { - xfClipboard* clipboard = (xfClipboard*) context->custom; + xfClipboard* clipboard = (xfClipboard*)context->custom; UINT ret; WINPR_UNUSED(monitorReady); @@ -1179,22 +1148,22 @@ static UINT xf_cliprdr_monitor_ready(CliprdrClientContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT xf_cliprdr_server_capabilities(CliprdrClientContext* context, - const CLIPRDR_CAPABILITIES* capabilities) + const CLIPRDR_CAPABILITIES* capabilities) { UINT32 i; const CLIPRDR_CAPABILITY_SET* caps; const CLIPRDR_GENERAL_CAPABILITY_SET* generalCaps; - const BYTE* capsPtr = (const BYTE*) capabilities->capabilitySets; - xfClipboard* clipboard = (xfClipboard*) context->custom; + const BYTE* capsPtr = (const BYTE*)capabilities->capabilitySets; + xfClipboard* clipboard = (xfClipboard*)context->custom; clipboard->streams_supported = FALSE; for (i = 0; i < capabilities->cCapabilitiesSets; i++) { - caps = (const CLIPRDR_CAPABILITY_SET*) capsPtr; + caps = (const CLIPRDR_CAPABILITY_SET*)capsPtr; if (caps->capabilitySetType == CB_CAPSTYPE_GENERAL) { - generalCaps = (const CLIPRDR_GENERAL_CAPABILITY_SET*) caps; + generalCaps = (const CLIPRDR_GENERAL_CAPABILITY_SET*)caps; if (generalCaps->generalFlags & CB_STREAM_FILECLIP_ENABLED) { @@ -1214,11 +1183,11 @@ static UINT xf_cliprdr_server_capabilities(CliprdrClientContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT xf_cliprdr_server_format_list(CliprdrClientContext* context, - const CLIPRDR_FORMAT_LIST* formatList) + const CLIPRDR_FORMAT_LIST* formatList) { UINT32 i; int j; - xfClipboard* clipboard = (xfClipboard*) context->custom; + xfClipboard* clipboard = (xfClipboard*)context->custom; xfContext* xfc = clipboard->xfc; UINT ret; xf_cliprdr_clear_cached_data(clipboard); @@ -1237,11 +1206,10 @@ static UINT xf_cliprdr_server_format_list(CliprdrClientContext* context, clipboard->numServerFormats = formatList->numFormats + 1; /* +1 for CF_RAW */ - if (!(clipboard->serverFormats = (CLIPRDR_FORMAT*) calloc( - clipboard->numServerFormats, sizeof(CLIPRDR_FORMAT)))) + if (!(clipboard->serverFormats = + (CLIPRDR_FORMAT*)calloc(clipboard->numServerFormats, sizeof(CLIPRDR_FORMAT)))) { - WLog_ERR(TAG, "failed to allocate %d CLIPRDR_FORMAT structs", - clipboard->numServerFormats); + WLog_ERR(TAG, "failed to allocate %d CLIPRDR_FORMAT structs", clipboard->numServerFormats); return CHANNEL_RC_NO_MEMORY; } @@ -1292,8 +1260,7 @@ static UINT xf_cliprdr_server_format_list(CliprdrClientContext* context, } ret = xf_cliprdr_send_client_format_list_response(clipboard, TRUE); - XSetSelectionOwner(xfc->display, clipboard->clipboard_atom, xfc->drawable, - CurrentTime); + XSetSelectionOwner(xfc->display, clipboard->clipboard_atom, xfc->drawable, CurrentTime); XFlush(xfc->display); return ret; } @@ -1303,10 +1270,11 @@ static UINT xf_cliprdr_server_format_list(CliprdrClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT xf_cliprdr_server_format_list_response(CliprdrClientContext* - context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) +static UINT +xf_cliprdr_server_format_list_response(CliprdrClientContext* context, + const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) { - //xfClipboard* clipboard = (xfClipboard*) context->custom; + // xfClipboard* clipboard = (xfClipboard*) context->custom; return CHANNEL_RC_OK; } @@ -1315,21 +1283,22 @@ static UINT xf_cliprdr_server_format_list_response(CliprdrClientContext* * * @return 0 on success, otherwise a Win32 error code */ -static UINT xf_cliprdr_server_format_data_request(CliprdrClientContext* context, - const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) +static UINT +xf_cliprdr_server_format_data_request(CliprdrClientContext* context, + const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) { BOOL rawTransfer; xfCliprdrFormat* format = NULL; UINT32 formatId = formatDataRequest->requestedFormatId; - xfClipboard* clipboard = (xfClipboard*) context->custom; + xfClipboard* clipboard = (xfClipboard*)context->custom; xfContext* xfc = clipboard->xfc; rawTransfer = xf_cliprdr_is_raw_transfer_available(clipboard); if (rawTransfer) { format = xf_cliprdr_get_client_format_by_id(clipboard, CF_RAW); - XChangeProperty(xfc->display, xfc->drawable, clipboard->property_atom, - XA_INTEGER, 32, PropModeReplace, (BYTE*) &formatId, 1); + XChangeProperty(xfc->display, xfc->drawable, clipboard->property_atom, XA_INTEGER, 32, + PropModeReplace, (BYTE*)&formatId, 1); } else format = xf_cliprdr_get_client_format_by_id(clipboard, formatId); @@ -1338,8 +1307,8 @@ static UINT xf_cliprdr_server_format_data_request(CliprdrClientContext* context, return xf_cliprdr_send_data_response(clipboard, NULL, 0); clipboard->requestedFormatId = rawTransfer ? CF_RAW : formatId; - XConvertSelection(xfc->display, clipboard->clipboard_atom, - format->atom, clipboard->property_atom, xfc->drawable, CurrentTime); + XConvertSelection(xfc->display, clipboard->clipboard_atom, format->atom, + clipboard->property_atom, xfc->drawable, CurrentTime); XFlush(xfc->display); /* After this point, we expect a SelectionNotify event from the clipboard owner. */ return CHANNEL_RC_OK; @@ -1350,8 +1319,9 @@ static UINT xf_cliprdr_server_format_data_request(CliprdrClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT xf_cliprdr_server_format_data_response(CliprdrClientContext* - context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) +static UINT +xf_cliprdr_server_format_data_response(CliprdrClientContext* context, + const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) { BOOL bSuccess; BYTE* pDstData; @@ -1362,7 +1332,7 @@ static UINT xf_cliprdr_server_format_data_response(CliprdrClientContext* BOOL nullTerminated = FALSE; UINT32 size = formatDataResponse->dataLen; const BYTE* data = formatDataResponse->requestedFormatData; - xfClipboard* clipboard = (xfClipboard*) context->custom; + xfClipboard* clipboard = (xfClipboard*)context->custom; xfContext* xfc = clipboard->xfc; if (!clipboard->respond) @@ -1427,7 +1397,7 @@ static UINT xf_cliprdr_server_format_data_response(CliprdrClientContext* } } - SrcSize = (UINT32) size; + SrcSize = (UINT32)size; bSuccess = ClipboardSetData(clipboard->system, srcFormatId, data, SrcSize); if (bSuccess) @@ -1438,7 +1408,7 @@ static UINT xf_cliprdr_server_format_data_response(CliprdrClientContext* return CHANNEL_RC_OK; } - pDstData = (BYTE*) ClipboardGetData(clipboard->system, dstFormatId, &DstSize); + pDstData = (BYTE*)ClipboardGetData(clipboard->system, dstFormatId, &DstSize); if (!pDstData) { @@ -1462,7 +1432,7 @@ static UINT xf_cliprdr_server_format_data_response(CliprdrClientContext* /* We have to copy the original data again, as pSrcData is now owned * by clipboard->system. Memory allocation failure is not fatal here * as this is only a cached value. */ - clipboard->data_raw = (BYTE*) malloc(size); + clipboard->data_raw = (BYTE*)malloc(size); if (clipboard->data_raw) { @@ -1471,20 +1441,21 @@ static UINT xf_cliprdr_server_format_data_response(CliprdrClientContext* } else { - WLog_WARN(TAG, "failed to allocate %"PRIu32" bytes for a copy of raw clipboard data", size); + WLog_WARN(TAG, "failed to allocate %" PRIu32 " bytes for a copy of raw clipboard data", + size); } xf_cliprdr_provide_data(clipboard, clipboard->respond, pDstData, DstSize); - XSendEvent(xfc->display, clipboard->respond->xselection.requestor, 0, 0, - clipboard->respond); + XSendEvent(xfc->display, clipboard->respond->xselection.requestor, 0, 0, clipboard->respond); XFlush(xfc->display); free(clipboard->respond); clipboard->respond = NULL; return CHANNEL_RC_OK; } -static UINT xf_cliprdr_server_file_size_request(xfClipboard* clipboard, - const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +static UINT +xf_cliprdr_server_file_size_request(xfClipboard* clipboard, + const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { wClipboardFileSizeRequest request = { 0 }; request.streamId = fileContentsRequest->streamId; @@ -1492,15 +1463,16 @@ static UINT xf_cliprdr_server_file_size_request(xfClipboard* clipboard, if (fileContentsRequest->cbRequested != sizeof(UINT64)) { - WLog_WARN(TAG, "unexpected FILECONTENTS_SIZE request: %"PRIu32" bytes", + WLog_WARN(TAG, "unexpected FILECONTENTS_SIZE request: %" PRIu32 " bytes", fileContentsRequest->cbRequested); } return clipboard->delegate->ClientRequestFileSize(clipboard->delegate, &request); } -static UINT xf_cliprdr_server_file_range_request(xfClipboard* clipboard, - const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +static UINT +xf_cliprdr_server_file_range_request(xfClipboard* clipboard, + const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { wClipboardFileRangeRequest request = { 0 }; request.streamId = fileContentsRequest->streamId; @@ -1511,8 +1483,9 @@ static UINT xf_cliprdr_server_file_range_request(xfClipboard* clipboard, return clipboard->delegate->ClientRequestFileRange(clipboard->delegate, &request); } -static UINT xf_cliprdr_send_file_contents_failure(CliprdrClientContext* context, - const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +static UINT +xf_cliprdr_send_file_contents_failure(CliprdrClientContext* context, + const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { CLIPRDR_FILE_CONTENTS_RESPONSE response = { 0 }; response.msgFlags = CB_RESPONSE_FAIL; @@ -1520,8 +1493,9 @@ static UINT xf_cliprdr_send_file_contents_failure(CliprdrClientContext* context, return context->ClientFileContentsResponse(context, &response); } -static UINT xf_cliprdr_server_file_contents_request(CliprdrClientContext* context, - const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +static UINT +xf_cliprdr_server_file_contents_request(CliprdrClientContext* context, + const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { UINT error = NO_ERROR; xfClipboard* clipboard = context->custom; @@ -1553,19 +1527,21 @@ static UINT xf_cliprdr_server_file_contents_request(CliprdrClientContext* contex } static UINT xf_cliprdr_clipboard_file_size_success(wClipboardDelegate* delegate, - const wClipboardFileSizeRequest* request, UINT64 fileSize) + const wClipboardFileSizeRequest* request, + UINT64 fileSize) { CLIPRDR_FILE_CONTENTS_RESPONSE response = { 0 }; xfClipboard* clipboard = delegate->custom; response.msgFlags = CB_RESPONSE_OK; response.streamId = request->streamId; response.cbRequested = sizeof(UINT64); - response.requestedData = (BYTE*) &fileSize; + response.requestedData = (BYTE*)&fileSize; return clipboard->context->ClientFileContentsResponse(clipboard->context, &response); } static UINT xf_cliprdr_clipboard_file_size_failure(wClipboardDelegate* delegate, - const wClipboardFileSizeRequest* request, UINT errorCode) + const wClipboardFileSizeRequest* request, + UINT errorCode) { CLIPRDR_FILE_CONTENTS_RESPONSE response = { 0 }; xfClipboard* clipboard = delegate->custom; @@ -1577,19 +1553,21 @@ static UINT xf_cliprdr_clipboard_file_size_failure(wClipboardDelegate* delegate, } static UINT xf_cliprdr_clipboard_file_range_success(wClipboardDelegate* delegate, - const wClipboardFileRangeRequest* request, const BYTE* data, UINT32 size) + const wClipboardFileRangeRequest* request, + const BYTE* data, UINT32 size) { CLIPRDR_FILE_CONTENTS_RESPONSE response = { 0 }; xfClipboard* clipboard = delegate->custom; response.msgFlags = CB_RESPONSE_OK; response.streamId = request->streamId; response.cbRequested = size; - response.requestedData = (BYTE*) data; + response.requestedData = (BYTE*)data; return clipboard->context->ClientFileContentsResponse(clipboard->context, &response); } static UINT xf_cliprdr_clipboard_file_range_failure(wClipboardDelegate* delegate, - const wClipboardFileRangeRequest* request, UINT errorCode) + const wClipboardFileRangeRequest* request, + UINT errorCode) { CLIPRDR_FILE_CONTENTS_RESPONSE response = { 0 }; xfClipboard* clipboard = delegate->custom; @@ -1606,7 +1584,7 @@ xfClipboard* xf_clipboard_new(xfContext* xfc) rdpChannels* channels; xfClipboard* clipboard; - if (!(clipboard = (xfClipboard*) calloc(1, sizeof(xfClipboard)))) + if (!(clipboard = (xfClipboard*)calloc(1, sizeof(xfClipboard)))) { WLog_ERR(TAG, "failed to allocate xfClipboard data"); return NULL; @@ -1614,7 +1592,7 @@ xfClipboard* xf_clipboard_new(xfContext* xfc) xfc->clipboard = clipboard; clipboard->xfc = xfc; - channels = ((rdpContext*) xfc)->channels; + channels = ((rdpContext*)xfc)->channels; clipboard->channels = channels; clipboard->system = ClipboardCreate(); clipboard->requestedFormatId = -1; @@ -1629,8 +1607,7 @@ xfClipboard* xf_clipboard_new(xfContext* xfc) clipboard->property_atom = XInternAtom(xfc->display, "_FREERDP_CLIPRDR", FALSE); clipboard->raw_transfer_atom = XInternAtom(xfc->display, "_FREERDP_CLIPRDR_RAW", FALSE); - clipboard->raw_format_list_atom = - XInternAtom(xfc->display, "_FREERDP_CLIPRDR_FORMATS", FALSE); + clipboard->raw_format_list_atom = XInternAtom(xfc->display, "_FREERDP_CLIPRDR_FORMATS", FALSE); xf_cliprdr_set_raw_transfer_enabled(clipboard, TRUE); XSelectInput(xfc->display, clipboard->root_window, PropertyChangeMask); #ifdef WITH_XFIXES @@ -1643,7 +1620,8 @@ xfClipboard* xf_clipboard_new(xfContext* xfc) if (XFixesQueryVersion(xfc->display, &xfmajor, &xfminor)) { XFixesSelectSelectionInput(xfc->display, clipboard->root_window, - clipboard->clipboard_atom, XFixesSetSelectionOwnerNotifyMask); + clipboard->clipboard_atom, + XFixesSetSelectionOwnerNotifyMask); clipboard->xfixes_supported = TRUE; } else @@ -1657,8 +1635,9 @@ xfClipboard* xf_clipboard_new(xfContext* xfc) } #else - WLog_ERR(TAG, - "Warning: Using clipboard redirection without XFIXES extension is strongly discouraged!"); + WLog_ERR( + TAG, + "Warning: Using clipboard redirection without XFIXES extension is strongly discouraged!"); #endif clipboard->clientFormats[n].atom = XInternAtom(xfc->display, "_FREERDP_RAW", False); clipboard->clientFormats[n].formatId = CF_RAW; @@ -1767,7 +1746,7 @@ void xf_cliprdr_init(xfContext* xfc, CliprdrClientContext* cliprdr) { xfc->cliprdr = cliprdr; xfc->clipboard->context = cliprdr; - cliprdr->custom = (void*) xfc->clipboard; + cliprdr->custom = (void*)xfc->clipboard; cliprdr->MonitorReady = xf_cliprdr_monitor_ready; cliprdr->ServerCapabilities = xf_cliprdr_server_capabilities; cliprdr->ServerFormatList = xf_cliprdr_server_format_list; diff --git a/client/X11/xf_disp.c b/client/X11/xf_disp.c index 33d9dd612..8c596527d 100644 --- a/client/X11/xf_disp.c +++ b/client/X11/xf_disp.c @@ -25,7 +25,7 @@ #include #if (RANDR_MAJOR * 100 + RANDR_MINOR) >= 105 -# define USABLE_XRANDR +#define USABLE_XRANDR #endif #endif @@ -33,7 +33,6 @@ #include "xf_disp.h" #include "xf_monitor.h" - #define TAG CLIENT_TAG("x11disp") #define RESIZE_MIN_DELAY 200 /* minimum delay in ms between two resizes */ @@ -121,8 +120,8 @@ static BOOL xf_disp_sendResize(xfDispContext* xfDisp) if (xfc->fullscreen && (settings->MonitorCount > 0)) { - if (xf_disp_sendLayout(xfDisp->disp, settings->MonitorDefArray, - settings->MonitorCount) != CHANNEL_RC_OK) + if (xf_disp_sendLayout(xfDisp->disp, settings->MonitorDefArray, settings->MonitorCount) != + CHANNEL_RC_OK) return FALSE; } else @@ -378,8 +377,8 @@ BOOL xf_disp_handle_xevent(xfContext* xfc, XEvent* event) #endif xf_detect_monitors(xfc, &maxWidth, &maxHeight); - return xf_disp_sendLayout(xfDisp->disp, settings->MonitorDefArray, - settings->MonitorCount) == CHANNEL_RC_OK; + return xf_disp_sendLayout(xfDisp->disp, settings->MonitorDefArray, settings->MonitorCount) == + CHANNEL_RC_OK; } BOOL xf_disp_handle_configureNotify(xfContext* xfc, int width, int height) @@ -406,7 +405,8 @@ static UINT xf_DisplayControlCaps(DispClientContext* disp, UINT32 maxNumMonitors xfDispContext* xfDisp = (xfDispContext*)disp->custom; rdpSettings* settings = xfDisp->xfc->context.settings; WLog_DBG(TAG, - "DisplayControlCapsPdu: MaxNumMonitors: %"PRIu32" MaxMonitorAreaFactorA: %"PRIu32" MaxMonitorAreaFactorB: %"PRIu32"", + "DisplayControlCapsPdu: MaxNumMonitors: %" PRIu32 " MaxMonitorAreaFactorA: %" PRIu32 + " MaxMonitorAreaFactorB: %" PRIu32 "", maxNumMonitors, maxMonitorAreaFactorA, maxMonitorAreaFactorB); xfDisp->activated = TRUE; @@ -430,7 +430,7 @@ BOOL xf_disp_init(xfDispContext* xfDisp, DispClientContext* disp) return FALSE; xfDisp->disp = disp; - disp->custom = (void*) xfDisp; + disp->custom = (void*)xfDisp; if (settings->DynamicResolutionUpdate) { diff --git a/client/X11/xf_event.c b/client/X11/xf_event.c index 3c227eb2d..c3c38550c 100644 --- a/client/X11/xf_event.c +++ b/client/X11/xf_event.c @@ -39,7 +39,11 @@ #define TAG CLIENT_TAG("x11") -#define CLAMP_COORDINATES(x, y) if (x < 0) x = 0; if (y < 0) y = 0 +#define CLAMP_COORDINATES(x, y) \ + if (x < 0) \ + x = 0; \ + if (y < 0) \ + y = 0 static const char* x11_event_string(int event) { @@ -155,7 +159,10 @@ static const char* x11_event_string(int event) #ifdef WITH_DEBUG_X11 #define DEBUG_X11(...) WLog_DBG(TAG, __VA_ARGS__) #else -#define DEBUG_X11(...) do { } while (0) +#define DEBUG_X11(...) \ + do \ + { \ + } while (0) #endif BOOL xf_event_action_script_init(xfContext* xfc) @@ -224,7 +231,7 @@ static BOOL xf_event_execute_action_script(xfContext* xfc, XEvent* event) for (index = 0; index < count; index++) { - name = (char*) ArrayList_GetItem(xfc->xevents, index); + name = (char*)ArrayList_GetItem(xfc->xevents, index); if (_stricmp(name, xeventName) == 0) { @@ -236,8 +243,8 @@ static BOOL xf_event_execute_action_script(xfContext* xfc, XEvent* event) if (!match) return FALSE; - sprintf_s(command, sizeof(command), "%s xevent %s %lu", - xfc->context.settings->ActionScript, xeventName, (unsigned long) xfc->window->handle); + sprintf_s(command, sizeof(command), "%s xevent %s %lu", xfc->context.settings->ActionScript, + xeventName, (unsigned long)xfc->window->handle); actionScript = popen(command, "r"); if (!actionScript) @@ -326,8 +333,7 @@ static BOOL xf_event_VisibilityNotify(xfContext* xfc, XEvent* event, BOOL app) xfc->unobscured = event->xvisibility.state == VisibilityUnobscured; return TRUE; } -BOOL xf_generic_MotionNotify(xfContext* xfc, int x, int y, int state, - Window window, BOOL app) +BOOL xf_generic_MotionNotify(xfContext* xfc, int x, int y, int state, Window window, BOOL app) { rdpInput* input; Window childWindow; @@ -346,9 +352,8 @@ BOOL xf_generic_MotionNotify(xfContext* xfc, int x, int y, int state, return TRUE; /* Translate to desktop coordinates */ - XTranslateCoordinates(xfc->display, window, - RootWindowOfScreen(xfc->screen), - x, y, &x, &y, &childWindow); + XTranslateCoordinates(xfc->display, window, RootWindowOfScreen(xfc->screen), x, y, &x, &y, + &childWindow); } xf_event_adjust_coordinates(xfc, &x, &y); @@ -356,8 +361,7 @@ BOOL xf_generic_MotionNotify(xfContext* xfc, int x, int y, int state, if (xfc->fullscreen && !app) { - XSetInputFocus(xfc->display, xfc->window->handle, RevertToPointerRoot, - CurrentTime); + XSetInputFocus(xfc->display, xfc->window->handle, RevertToPointerRoot, CurrentTime); } return TRUE; @@ -370,12 +374,12 @@ static BOOL xf_event_MotionNotify(xfContext* xfc, XEvent* event, BOOL app) if (xfc->window) xf_floatbar_set_root_y(xfc->window->floatbar, event->xmotion.y); - return xf_generic_MotionNotify(xfc, event->xmotion.x, event->xmotion.y, - event->xmotion.state, event->xmotion.window, app); + return xf_generic_MotionNotify(xfc, event->xmotion.x, event->xmotion.y, event->xmotion.state, + event->xmotion.window, app); } -BOOL xf_generic_ButtonEvent(xfContext* xfc, int x, int y, int button, - Window window, BOOL app, BOOL down) +BOOL xf_generic_ButtonEvent(xfContext* xfc, int x, int y, int button, Window window, BOOL app, + BOOL down) { UINT16 flags = 0; rdpInput* input; @@ -426,9 +430,8 @@ BOOL xf_generic_ButtonEvent(xfContext* xfc, int x, int y, int button, return TRUE; /* Translate to desktop coordinates */ - XTranslateCoordinates(xfc->display, window, - RootWindowOfScreen(xfc->screen), - x, y, &x, &y, &childWindow); + XTranslateCoordinates(xfc->display, window, RootWindowOfScreen(xfc->screen), x, y, + &x, &y, &childWindow); } xf_event_adjust_coordinates(xfc, &x, &y); @@ -447,8 +450,8 @@ static BOOL xf_event_ButtonPress(xfContext* xfc, XEvent* event, BOOL app) if (xfc->use_xinput) return TRUE; - return xf_generic_ButtonEvent(xfc, event->xbutton.x, event->xbutton.y, - event->xbutton.button, event->xbutton.window, app, TRUE); + return xf_generic_ButtonEvent(xfc, event->xbutton.x, event->xbutton.y, event->xbutton.button, + event->xbutton.window, app, TRUE); } static BOOL xf_event_ButtonRelease(xfContext* xfc, XEvent* event, BOOL app) @@ -456,15 +459,15 @@ static BOOL xf_event_ButtonRelease(xfContext* xfc, XEvent* event, BOOL app) if (xfc->use_xinput) return TRUE; - return xf_generic_ButtonEvent(xfc, event->xbutton.x, event->xbutton.y, - event->xbutton.button, event->xbutton.window, app, FALSE); + return xf_generic_ButtonEvent(xfc, event->xbutton.x, event->xbutton.y, event->xbutton.button, + event->xbutton.window, app, FALSE); } static BOOL xf_event_KeyPress(xfContext* xfc, XEvent* event, BOOL app) { KeySym keysym; char str[256]; WINPR_UNUSED(app); - XLookupString((XKeyEvent*) event, str, sizeof(str), &keysym, NULL); + XLookupString((XKeyEvent*)event, str, sizeof(str), &keysym, NULL); xf_keyboard_key_press(xfc, event->xkey.keycode, keysym); return TRUE; } @@ -473,7 +476,7 @@ static BOOL xf_event_KeyRelease(xfContext* xfc, XEvent* event, BOOL app) KeySym keysym; char str[256]; WINPR_UNUSED(app); - XLookupString((XKeyEvent*) event, str, sizeof(str), &keysym, NULL); + XLookupString((XKeyEvent*)event, str, sizeof(str), &keysym, NULL); xf_keyboard_key_release(xfc, event->xkey.keycode, keysym); return TRUE; } @@ -489,8 +492,8 @@ static BOOL xf_event_FocusIn(xfContext* xfc, XEvent* event, BOOL app) if (!xfc->window) return FALSE; - XGrabKeyboard(xfc->display, xfc->window->handle, TRUE, GrabModeAsync, - GrabModeAsync, CurrentTime); + XGrabKeyboard(xfc->display, xfc->window->handle, TRUE, GrabModeAsync, GrabModeAsync, + CurrentTime); } if (app) @@ -499,7 +502,8 @@ static BOOL xf_event_FocusIn(xfContext* xfc, XEvent* event, BOOL app) xf_rail_send_activate(xfc, event->xany.window, TRUE); appWindow = xf_AppWindowFromX11Window(xfc, event->xany.window); - /* Update the server with any window changes that occurred while the window was not focused. */ + /* Update the server with any window changes that occurred while the window was not focused. + */ if (appWindow) { xf_rail_adjust_position(xfc, appWindow); @@ -543,8 +547,8 @@ static BOOL xf_event_MappingNotify(xfContext* xfc, XEvent* event, BOOL app) } static BOOL xf_event_ClientMessage(xfContext* xfc, XEvent* event, BOOL app) { - if ((event->xclient.message_type == xfc->WM_PROTOCOLS) - && ((Atom) event->xclient.data.l[0] == xfc->WM_DELETE_WINDOW)) + if ((event->xclient.message_type == xfc->WM_PROTOCOLS) && + ((Atom)event->xclient.data.l[0] == xfc->WM_DELETE_WINDOW)) { if (app) { @@ -577,12 +581,11 @@ static BOOL xf_event_EnterNotify(xfContext* xfc, XEvent* event, BOOL app) xfc->mouse_active = TRUE; if (xfc->fullscreen) - XSetInputFocus(xfc->display, xfc->window->handle, RevertToPointerRoot, - CurrentTime); + XSetInputFocus(xfc->display, xfc->window->handle, RevertToPointerRoot, CurrentTime); if (xfc->focused) - XGrabKeyboard(xfc->display, xfc->window->handle, TRUE, GrabModeAsync, - GrabModeAsync, CurrentTime); + XGrabKeyboard(xfc->display, xfc->window->handle, TRUE, GrabModeAsync, GrabModeAsync, + CurrentTime); } else { @@ -638,8 +641,7 @@ static BOOL xf_event_ConfigureNotify(xfContext* xfc, XEvent* event, BOOL app) xfc->offset_x = 0; xfc->offset_y = 0; - if (xfc->context.settings->SmartSizing - || xfc->context.settings->MultiTouchGestures) + if (xfc->context.settings->SmartSizing || xfc->context.settings->MultiTouchGestures) { xfc->scaledWidth = xfc->window->width; xfc->scaledHeight = xfc->window->height; @@ -674,9 +676,8 @@ static BOOL xf_event_ConfigureNotify(xfContext* xfc, XEvent* event, BOOL app) * ConfigureNotify coordinates are expressed relative to the window parent. * Translate these to root window coordinates. */ - XTranslateCoordinates(xfc->display, appWindow->handle, - RootWindowOfScreen(xfc->screen), - 0, 0, &appWindow->x, &appWindow->y, &childWindow); + XTranslateCoordinates(xfc->display, appWindow->handle, RootWindowOfScreen(xfc->screen), 0, + 0, &appWindow->x, &appWindow->y, &childWindow); appWindow->width = event->xconfigure.width; appWindow->height = event->xconfigure.height; @@ -693,9 +694,8 @@ static BOOL xf_event_ConfigureNotify(xfContext* xfc, XEvent* event, BOOL app) } else { - if ((!event->xconfigure.send_event - || appWindow->local_move.state == LMS_NOT_ACTIVE) - && !appWindow->rail_ignore_configure && xfc->focused) + if ((!event->xconfigure.send_event || appWindow->local_move.state == LMS_NOT_ACTIVE) && + !appWindow->rail_ignore_configure && xfc->focused) xf_rail_adjust_position(xfc, appWindow); } } @@ -752,10 +752,10 @@ static BOOL xf_event_PropertyNotify(xfContext* xfc, XEvent* event, BOOL app) * when the window has been minimized, maximized, restored locally * ie. not using the buttons on the rail window itself */ - if ((((Atom) event->xproperty.atom == xfc->_NET_WM_STATE) - && (event->xproperty.state != PropertyDelete)) || - (((Atom) event->xproperty.atom == xfc->WM_STATE) - && (event->xproperty.state != PropertyDelete))) + if ((((Atom)event->xproperty.atom == xfc->_NET_WM_STATE) && + (event->xproperty.state != PropertyDelete)) || + (((Atom)event->xproperty.atom == xfc->WM_STATE) && + (event->xproperty.state != PropertyDelete))) { unsigned long i; BOOL status; @@ -776,23 +776,23 @@ static BOOL xf_event_PropertyNotify(xfContext* xfc, XEvent* event, BOOL app) return TRUE; } - if ((Atom) event->xproperty.atom == xfc->_NET_WM_STATE) + if ((Atom)event->xproperty.atom == xfc->_NET_WM_STATE) { - status = xf_GetWindowProperty(xfc, event->xproperty.window, - xfc->_NET_WM_STATE, 12, &nitems, &bytes, &prop); + status = xf_GetWindowProperty(xfc, event->xproperty.window, xfc->_NET_WM_STATE, 12, + &nitems, &bytes, &prop); if (status) { for (i = 0; i < nitems; i++) { - if ((Atom)((UINT16**) prop)[i] == XInternAtom(xfc->display, - "_NET_WM_STATE_MAXIMIZED_VERT", False)) + if ((Atom)((UINT16**)prop)[i] == + XInternAtom(xfc->display, "_NET_WM_STATE_MAXIMIZED_VERT", False)) { maxVert = TRUE; } - if ((Atom)((UINT16**) prop)[i] == XInternAtom(xfc->display, - "_NET_WM_STATE_MAXIMIZED_HORZ", False)) + if ((Atom)((UINT16**)prop)[i] == + XInternAtom(xfc->display, "_NET_WM_STATE_MAXIMIZED_HORZ", False)) { maxHorz = TRUE; } @@ -802,15 +802,15 @@ static BOOL xf_event_PropertyNotify(xfContext* xfc, XEvent* event, BOOL app) } } - if ((Atom) event->xproperty.atom == xfc->WM_STATE) + if ((Atom)event->xproperty.atom == xfc->WM_STATE) { - status = xf_GetWindowProperty(xfc, event->xproperty.window, - xfc->WM_STATE, 1, &nitems, &bytes, &prop); + status = xf_GetWindowProperty(xfc, event->xproperty.window, xfc->WM_STATE, 1, &nitems, + &bytes, &prop); if (status) { /* If the window is in the iconic state */ - if (((UINT32) *prop == 3)) + if (((UINT32)*prop == 3)) minimized = TRUE; else minimized = FALSE; @@ -822,8 +822,8 @@ static BOOL xf_event_PropertyNotify(xfContext* xfc, XEvent* event, BOOL app) if (app) { - if (maxVert && maxHorz && !minimized - && (appWindow->rail_state != WINDOW_SHOW_MAXIMIZED)) + if (maxVert && maxHorz && !minimized && + (appWindow->rail_state != WINDOW_SHOW_MAXIMIZED)) { appWindow->rail_state = WINDOW_SHOW_MAXIMIZED; xf_rail_send_client_system_command(xfc, appWindow->windowId, SC_MAXIMIZE); @@ -833,8 +833,8 @@ static BOOL xf_event_PropertyNotify(xfContext* xfc, XEvent* event, BOOL app) appWindow->rail_state = WINDOW_SHOW_MINIMIZED; xf_rail_send_client_system_command(xfc, appWindow->windowId, SC_MINIMIZE); } - else if (!minimized && !maxVert && !maxHorz - && (appWindow->rail_state != WINDOW_SHOW) && (appWindow->rail_state != WINDOW_HIDE)) + else if (!minimized && !maxVert && !maxHorz && (appWindow->rail_state != WINDOW_SHOW) && + (appWindow->rail_state != WINDOW_HIDE)) { appWindow->rail_state = WINDOW_SHOW; xf_rail_send_client_system_command(xfc, appWindow->windowId, SC_RESTORE); @@ -846,8 +846,7 @@ static BOOL xf_event_PropertyNotify(xfContext* xfc, XEvent* event, BOOL app) return TRUE; } -static BOOL xf_event_suppress_events(xfContext* xfc, xfAppWindow* appWindow, - XEvent* event) +static BOOL xf_event_suppress_events(xfContext* xfc, xfAppWindow* appWindow, XEvent* event) { if (!xfc->remote_app) return FALSE; @@ -858,7 +857,8 @@ static BOOL xf_event_suppress_events(xfContext* xfc, xfAppWindow* appWindow, /* No local move in progress, nothing to do */ - /* Prevent Configure from happening during indeterminant state of Horz or Vert Max only */ + /* Prevent Configure from happening during indeterminant state of Horz or Vert Max only + */ if ((event->type == ConfigureNotify) && appWindow->rail_ignore_configure) { appWindow->rail_ignore_configure = FALSE; @@ -869,13 +869,16 @@ static BOOL xf_event_suppress_events(xfContext* xfc, xfAppWindow* appWindow, case LMS_STARTING: - /* Local move initiated by RDP server, but we have not yet seen any updates from the X server */ + /* Local move initiated by RDP server, but we have not yet seen any updates from the X + * server */ switch (event->type) { case ConfigureNotify: - /* Starting to see move events from the X server. Local move is now in progress. */ + /* Starting to see move events from the X server. Local move is now in progress. + */ appWindow->local_move.state = LMS_ACTIVE; - /* Allow these events to be processed during move to keep our state up to date. */ + /* Allow these events to be processed during move to keep our state up to date. + */ break; case ButtonPress: @@ -936,7 +939,7 @@ BOOL xf_event_process(freerdp* instance, XEvent* event) { BOOL status = TRUE; xfAppWindow* appWindow; - xfContext* xfc = (xfContext*) instance->context; + xfContext* xfc = (xfContext*)instance->context; rdpSettings* settings = xfc->context.settings; if (xfc->remote_app) @@ -966,8 +969,8 @@ BOOL xf_event_process(freerdp* instance, XEvent* event) if (event->type != MotionNotify) { - DEBUG_X11("%s Event(%d): wnd=0x%08lX", x11_event_string(event->type), - event->type, (unsigned long) event->xany.window); + DEBUG_X11("%s Event(%d): wnd=0x%08lX", x11_event_string(event->type), event->type, + (unsigned long)event->xany.window); } switch (event->type) diff --git a/client/X11/xf_floatbar.c b/client/X11/xf_floatbar.c index f504f0669..de221fd41 100644 --- a/client/X11/xf_floatbar.c +++ b/client/X11/xf_floatbar.c @@ -30,33 +30,35 @@ #define TAG CLIENT_TAG("x11") -#define FLOATBAR_HEIGHT 26 -#define FLOATBAR_DEFAULT_WIDTH 576 -#define FLOATBAR_MIN_WIDTH 200 -#define FLOATBAR_BORDER 24 -#define FLOATBAR_BUTTON_WIDTH 24 -#define FLOATBAR_COLOR_BACKGROUND "RGB:31/6c/a9" -#define FLOATBAR_COLOR_BORDER "RGB:75/9a/c8" -#define FLOATBAR_COLOR_FOREGROUND "RGB:FF/FF/FF" +#define FLOATBAR_HEIGHT 26 +#define FLOATBAR_DEFAULT_WIDTH 576 +#define FLOATBAR_MIN_WIDTH 200 +#define FLOATBAR_BORDER 24 +#define FLOATBAR_BUTTON_WIDTH 24 +#define FLOATBAR_COLOR_BACKGROUND "RGB:31/6c/a9" +#define FLOATBAR_COLOR_BORDER "RGB:75/9a/c8" +#define FLOATBAR_COLOR_FOREGROUND "RGB:FF/FF/FF" #ifdef WITH_DEBUG_X11 #define DEBUG_X11(...) WLog_DBG(TAG, __VA_ARGS__) #else -#define DEBUG_X11(...) do { } while (0) +#define DEBUG_X11(...) \ + do \ + { \ + } while (0) #endif -#define XF_FLOATBAR_MODE_NONE 0 -#define XF_FLOATBAR_MODE_DRAGGING 1 -#define XF_FLOATBAR_MODE_RESIZE_LEFT 2 -#define XF_FLOATBAR_MODE_RESIZE_RIGHT 3 +#define XF_FLOATBAR_MODE_NONE 0 +#define XF_FLOATBAR_MODE_DRAGGING 1 +#define XF_FLOATBAR_MODE_RESIZE_LEFT 2 +#define XF_FLOATBAR_MODE_RESIZE_RIGHT 3 - -#define XF_FLOATBAR_BUTTON_CLOSE 1 -#define XF_FLOATBAR_BUTTON_RESTORE 2 +#define XF_FLOATBAR_BUTTON_CLOSE 1 +#define XF_FLOATBAR_BUTTON_RESTORE 2 #define XF_FLOATBAR_BUTTON_MINIMIZE 3 -#define XF_FLOATBAR_BUTTON_LOCKED 4 +#define XF_FLOATBAR_BUTTON_LOCKED 4 -typedef BOOL(*OnClick)(xfFloatbar*); +typedef BOOL (*OnClick)(xfFloatbar*); typedef struct xf_floatbar_button xfFloatbarButton; @@ -187,10 +189,9 @@ static BOOL create_floatbar(xfFloatbar* floatbar) if (((floatbar->flags & 0x0004) == 0) && !floatbar->locked) floatbar->y = -FLOATBAR_HEIGHT + 1; - floatbar->handle = XCreateWindow(xfc->display, floatbar->root_window, - floatbar->x, 0, FLOATBAR_DEFAULT_WIDTH, - FLOATBAR_HEIGHT, 0, - CopyFromParent, InputOutput, CopyFromParent, 0, NULL); + floatbar->handle = + XCreateWindow(xfc->display, floatbar->root_window, floatbar->x, 0, FLOATBAR_DEFAULT_WIDTH, + FLOATBAR_HEIGHT, 0, CopyFromParent, InputOutput, CopyFromParent, 0, NULL); floatbar->width = FLOATBAR_DEFAULT_WIDTH; floatbar->height = FLOATBAR_HEIGHT; floatbar->mode = XF_FLOATBAR_MODE_NONE; @@ -198,9 +199,10 @@ static BOOL create_floatbar(xfFloatbar* floatbar) floatbar->buttons[1] = xf_floatbar_new_button(floatbar, XF_FLOATBAR_BUTTON_RESTORE); floatbar->buttons[2] = xf_floatbar_new_button(floatbar, XF_FLOATBAR_BUTTON_MINIMIZE); floatbar->buttons[3] = xf_floatbar_new_button(floatbar, XF_FLOATBAR_BUTTON_LOCKED); - XSelectInput(xfc->display, floatbar->handle, ExposureMask | ButtonPressMask | ButtonReleaseMask | - PointerMotionMask | FocusChangeMask | LeaveWindowMask | EnterWindowMask | StructureNotifyMask | - PropertyChangeMask); + XSelectInput(xfc->display, floatbar->handle, + ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | + FocusChangeMask | LeaveWindowMask | EnterWindowMask | StructureNotifyMask | + PropertyChangeMask); floatbar->created = TRUE; return TRUE; } @@ -256,7 +258,7 @@ BOOL xf_floatbar_toggle_fullscreen(xfFloatbar* floatbar, bool fullscreen) xfFloatbarButton* xf_floatbar_new_button(xfFloatbar* floatbar, int type) { xfFloatbarButton* button; - button = (xfFloatbarButton*) calloc(1, sizeof(xfFloatbarButton)); + button = (xfFloatbarButton*)calloc(1, sizeof(xfFloatbarButton)); button->type = type; switch (type) @@ -288,11 +290,11 @@ xfFloatbarButton* xf_floatbar_new_button(xfFloatbar* floatbar, int type) button->y = 0; button->focus = FALSE; button->handle = XCreateWindow(floatbar->xfc->display, floatbar->handle, button->x, 0, - FLOATBAR_BUTTON_WIDTH, - FLOATBAR_BUTTON_WIDTH, 0, CopyFromParent, InputOutput, CopyFromParent, 0, NULL); + FLOATBAR_BUTTON_WIDTH, FLOATBAR_BUTTON_WIDTH, 0, CopyFromParent, + InputOutput, CopyFromParent, 0, NULL); XSelectInput(floatbar->xfc->display, button->handle, - ExposureMask | ButtonPressMask | ButtonReleaseMask | - FocusChangeMask | LeaveWindowMask | EnterWindowMask | StructureNotifyMask); + ExposureMask | ButtonPressMask | ButtonReleaseMask | FocusChangeMask | + LeaveWindowMask | EnterWindowMask | StructureNotifyMask); return button; } @@ -311,7 +313,7 @@ xfFloatbar* xf_floatbar_new(xfContext* xfc, Window window, const char* name, DWO if (xfc->remote_app) return NULL; - floatbar = (xfFloatbar*) calloc(1, sizeof(xfFloatbar)); + floatbar = (xfFloatbar*)calloc(1, sizeof(xfFloatbar)); if (!floatbar) return NULL; @@ -380,8 +382,7 @@ static void xf_floatbar_event_expose(xfFloatbar* floatbar, XEvent* event) border[4].y = border[0].y; /* Fill all pixels with 0 */ XSetForeground(display, shape_gc, 0); - XFillRectangle(display, pmap, shape_gc, 0, 0, floatbar->width, - floatbar->height); + XFillRectangle(display, pmap, shape_gc, 0, 0, floatbar->width, floatbar->height); /* Fill all pixels which should be shown with 1 */ XSetForeground(display, shape_gc, 1); XFillPolygon(display, pmap, shape_gc, shape, 5, 0, CoordModeOrigin); @@ -395,8 +396,8 @@ static void xf_floatbar_event_expose(xfFloatbar* floatbar, XEvent* event) /* draw the host name connected to (limit to maximum file name) */ len = strnlen(floatbar->title, MAX_PATH); XSetForeground(display, gc, xf_floatbar_get_color(floatbar, FLOATBAR_COLOR_FOREGROUND)); - XDrawString(display, floatbar->handle, gc, floatbar->width / 2 - len * 2, 15, - floatbar->title, len); + XDrawString(display, floatbar->handle, gc, floatbar->width / 2 - len * 2, 15, floatbar->title, + len); XFreeGC(display, gc); XFreeGC(display, shape_gc); } @@ -431,15 +432,18 @@ static void xf_floatbar_button_update_positon(xfFloatbar* floatbar, XEvent* even switch (button->type) { case XF_FLOATBAR_BUTTON_CLOSE: - button->x = floatbar->width - FLOATBAR_BORDER - FLOATBAR_BUTTON_WIDTH * button->type; + button->x = + floatbar->width - FLOATBAR_BORDER - FLOATBAR_BUTTON_WIDTH * button->type; break; case XF_FLOATBAR_BUTTON_RESTORE: - button->x = floatbar->width - FLOATBAR_BORDER - FLOATBAR_BUTTON_WIDTH * button->type; + button->x = + floatbar->width - FLOATBAR_BORDER - FLOATBAR_BUTTON_WIDTH * button->type; break; case XF_FLOATBAR_BUTTON_MINIMIZE: - button->x = floatbar->width - FLOATBAR_BORDER - FLOATBAR_BUTTON_WIDTH * button->type; + button->x = + floatbar->width - FLOATBAR_BORDER - FLOATBAR_BUTTON_WIDTH * button->type; break; default: @@ -495,7 +499,8 @@ static void xf_floatbar_button_event_expose(xfFloatbar* floatbar, XEvent* event) FLOATBAR_BUTTON_WIDTH, FLOATBAR_BUTTON_WIDTH); if (!(button->focus)) - XSetForeground(xfc->display, gc, xf_floatbar_get_color(floatbar, FLOATBAR_COLOR_BACKGROUND)); + XSetForeground(xfc->display, gc, + xf_floatbar_get_color(floatbar, FLOATBAR_COLOR_BACKGROUND)); else XSetForeground(xfc->display, gc, xf_floatbar_get_color(floatbar, FLOATBAR_COLOR_BORDER)); @@ -533,7 +538,7 @@ static void xf_floatbar_event_buttonpress(xfFloatbar* floatbar, XEvent* event) case Button1: if (event->xmotion.x <= FLOATBAR_BORDER) floatbar->mode = XF_FLOATBAR_MODE_RESIZE_LEFT; - else if (event->xmotion.x >= (floatbar->width - FLOATBAR_BORDER)) + else if (event->xmotion.x >= (floatbar->width - FLOATBAR_BORDER)) floatbar->mode = XF_FLOATBAR_MODE_RESIZE_RIGHT; else floatbar->mode = XF_FLOATBAR_MODE_DRAGGING; diff --git a/client/X11/xf_gdi.c b/client/X11/xf_gdi.c index d23e115ae..218e1c9d4 100644 --- a/client/X11/xf_gdi.c +++ b/client/X11/xf_gdi.c @@ -39,18 +39,16 @@ #include #define TAG CLIENT_TAG("x11") -static const UINT8 GDI_BS_HATCHED_PATTERNS[] = -{ +static const UINT8 GDI_BS_HATCHED_PATTERNS[] = { 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, /* HS_HORIZONTAL */ 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, /* HS_VERTICAL */ 0xFE, 0xFD, 0xFB, 0xF7, 0xEF, 0xDF, 0xBF, 0x7F, /* HS_FDIAGONAL */ 0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE, /* HS_BDIAGONAL */ 0xF7, 0xF7, 0xF7, 0x00, 0xF7, 0xF7, 0xF7, 0xF7, /* HS_CROSS */ - 0x7E, 0xBD, 0xDB, 0xE7, 0xE7, 0xDB, 0xBD, 0x7E /* HS_DIACROSS */ + 0x7E, 0xBD, 0xDB, 0xE7, 0xE7, 0xDB, 0xBD, 0x7E /* HS_DIACROSS */ }; -static const BYTE xf_rop2_table[] = -{ +static const BYTE xf_rop2_table[] = { 0, GXclear, /* 0 */ GXnor, /* DPon */ @@ -74,7 +72,7 @@ static BOOL xf_set_rop2(xfContext* xfc, int rop2) { if ((rop2 < 0x01) || (rop2 > 0x10)) { - WLog_ERR(TAG, "Unsupported ROP2: %d", rop2); + WLog_ERR(TAG, "Unsupported ROP2: %d", rop2); return FALSE; } @@ -210,7 +208,7 @@ static BOOL xf_set_rop3(xfContext* xfc, UINT32 rop3) if (function < 0) { - WLog_ERR(TAG, "Unsupported ROP3: 0x%08"PRIX32"", rop3); + WLog_ERR(TAG, "Unsupported ROP3: 0x%08" PRIX32 "", rop3); XSetFunction(xfc->display, xfc->gc, GXclear); return FALSE; } @@ -219,9 +217,7 @@ static BOOL xf_set_rop3(xfContext* xfc, UINT32 rop3) return TRUE; } -static Pixmap xf_brush_new(xfContext* xfc, UINT32 width, UINT32 height, - UINT32 bpp, - BYTE* data) +static Pixmap xf_brush_new(xfContext* xfc, UINT32 width, UINT32 height, UINT32 bpp, BYTE* data) { GC gc; Pixmap bitmap; @@ -235,12 +231,11 @@ static Pixmap xf_brush_new(xfContext* xfc, UINT32 width, UINT32 height, if (data) { brushFormat = gdi_get_pixel_format(bpp); - cdata = (BYTE*) _aligned_malloc(width * height * 4, 16); - freerdp_image_copy(cdata, gdi->dstFormat, 0, 0, 0, - width, height, data, brushFormat, 0, 0, 0, - &xfc->context.gdi->palette, FREERDP_FLIP_NONE); - image = XCreateImage(xfc->display, xfc->visual, xfc->depth, - ZPixmap, 0, (char*) cdata, width, height, xfc->scanline_pad, 0); + cdata = (BYTE*)_aligned_malloc(width * height * 4, 16); + freerdp_image_copy(cdata, gdi->dstFormat, 0, 0, 0, width, height, data, brushFormat, 0, 0, + 0, &xfc->context.gdi->palette, FREERDP_FLIP_NONE); + image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0, (char*)cdata, width, + height, xfc->scanline_pad, 0); image->byte_order = LSBFirst; image->bitmap_bit_order = LSBFirst; gc = XCreateGC(xfc->display, xfc->drawable, 0, NULL); @@ -257,16 +252,15 @@ static Pixmap xf_brush_new(xfContext* xfc, UINT32 width, UINT32 height, return bitmap; } -static Pixmap xf_mono_bitmap_new(xfContext* xfc, int width, int height, - const BYTE* data) +static Pixmap xf_mono_bitmap_new(xfContext* xfc, int width, int height, const BYTE* data) { int scanline; XImage* image; Pixmap bitmap; scanline = (width + 7) / 8; bitmap = XCreatePixmap(xfc->display, xfc->drawable, width, height, 1); - image = XCreateImage(xfc->display, xfc->visual, 1, - ZPixmap, 0, (char*) data, width, height, 8, scanline); + image = XCreateImage(xfc->display, xfc->visual, 1, ZPixmap, 0, (char*)data, width, height, 8, + scanline); image->byte_order = LSBFirst; image->bitmap_bit_order = LSBFirst; XPutImage(xfc->display, bitmap, xfc->gc_mono, image, 0, 0, 0, 0, width, height); @@ -275,11 +269,10 @@ static Pixmap xf_mono_bitmap_new(xfContext* xfc, int width, int height, return bitmap; } -static BOOL xf_gdi_set_bounds(rdpContext* context, - const rdpBounds* bounds) +static BOOL xf_gdi_set_bounds(rdpContext* context, const rdpBounds* bounds) { XRectangle clip; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; xf_lock_x11(xfc, FALSE); if (bounds) @@ -301,7 +294,7 @@ static BOOL xf_gdi_set_bounds(rdpContext* context, static BOOL xf_gdi_dstblt(rdpContext* context, const DSTBLT_ORDER* dstblt) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; BOOL ret = FALSE; xf_lock_x11(xfc, FALSE); @@ -309,14 +302,13 @@ static BOOL xf_gdi_dstblt(rdpContext* context, const DSTBLT_ORDER* dstblt) goto fail; XSetFillStyle(xfc->display, xfc->gc, FillSolid); - XFillRectangle(xfc->display, xfc->drawing, xfc->gc, - dstblt->nLeftRect, dstblt->nTopRect, + XFillRectangle(xfc->display, xfc->drawing, xfc->gc, dstblt->nLeftRect, dstblt->nTopRect, dstblt->nWidth, dstblt->nHeight); ret = TRUE; if (xfc->drawing == xfc->primary) - ret = gdi_InvalidateRegion(xfc->hdc, dstblt->nLeftRect, dstblt->nTopRect, - dstblt->nWidth, dstblt->nHeight); + ret = gdi_InvalidateRegion(xfc->hdc, dstblt->nLeftRect, dstblt->nTopRect, dstblt->nWidth, + dstblt->nHeight); fail: XSetFunction(xfc->display, xfc->gc, GXcopy); @@ -327,7 +319,7 @@ fail: static BOOL xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt) { const rdpBrush* brush; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; BOOL ret = FALSE; XColor xfg, xbg; @@ -349,24 +341,24 @@ static BOOL xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt) XSetFillStyle(xfc->display, xfc->gc, FillSolid); XSetBackground(xfc->display, xfc->gc, xbg.pixel); XSetForeground(xfc->display, xfc->gc, xfg.pixel); - XFillRectangle(xfc->display, xfc->drawing, xfc->gc, - patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, patblt->nHeight); + XFillRectangle(xfc->display, xfc->drawing, xfc->gc, patblt->nLeftRect, patblt->nTopRect, + patblt->nWidth, patblt->nHeight); break; case GDI_BS_HATCHED: - { - Pixmap pattern = xf_mono_bitmap_new(xfc, 8, 8, - &GDI_BS_HATCHED_PATTERNS[8 * brush->hatch]); - XSetBackground(xfc->display, xfc->gc, xbg.pixel); - XSetForeground(xfc->display, xfc->gc, xfg.pixel); - XSetFillStyle(xfc->display, xfc->gc, FillOpaqueStippled); - XSetStipple(xfc->display, xfc->gc, pattern); - XSetTSOrigin(xfc->display, xfc->gc, brush->x, brush->y); - XFillRectangle(xfc->display, xfc->drawing, xfc->gc, - patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, patblt->nHeight); - XFreePixmap(xfc->display, pattern); - } - break; + { + Pixmap pattern = + xf_mono_bitmap_new(xfc, 8, 8, &GDI_BS_HATCHED_PATTERNS[8 * brush->hatch]); + XSetBackground(xfc->display, xfc->gc, xbg.pixel); + XSetForeground(xfc->display, xfc->gc, xfg.pixel); + XSetFillStyle(xfc->display, xfc->gc, FillOpaqueStippled); + XSetStipple(xfc->display, xfc->gc, pattern); + XSetTSOrigin(xfc->display, xfc->gc, brush->x, brush->y); + XFillRectangle(xfc->display, xfc->drawing, xfc->gc, patblt->nLeftRect, patblt->nTopRect, + patblt->nWidth, patblt->nHeight); + XFreePixmap(xfc->display, pattern); + } + break; case GDI_BS_PATTERN: if (brush->bpp > 1) @@ -380,8 +372,8 @@ static BOOL xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt) XSetFillStyle(xfc->display, xfc->gc, FillTiled); XSetTile(xfc->display, xfc->gc, pattern); XSetTSOrigin(xfc->display, xfc->gc, brush->x, brush->y); - XFillRectangle(xfc->display, xfc->drawing, xfc->gc, - patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, patblt->nHeight); + XFillRectangle(xfc->display, xfc->drawing, xfc->gc, patblt->nLeftRect, + patblt->nTopRect, patblt->nWidth, patblt->nHeight); XSetTile(xfc->display, xfc->gc, xfc->primary); XFreePixmap(xfc->display, pattern); } @@ -393,23 +385,23 @@ static BOOL xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt) XSetFillStyle(xfc->display, xfc->gc, FillOpaqueStippled); XSetStipple(xfc->display, xfc->gc, pattern); XSetTSOrigin(xfc->display, xfc->gc, brush->x, brush->y); - XFillRectangle(xfc->display, xfc->drawing, xfc->gc, - patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, patblt->nHeight); + XFillRectangle(xfc->display, xfc->drawing, xfc->gc, patblt->nLeftRect, + patblt->nTopRect, patblt->nWidth, patblt->nHeight); XFreePixmap(xfc->display, pattern); } break; default: - WLog_ERR(TAG, "unimplemented brush style:%"PRIu32"", brush->style); + WLog_ERR(TAG, "unimplemented brush style:%" PRIu32 "", brush->style); goto fail; } ret = TRUE; if (xfc->drawing == xfc->primary) - ret = gdi_InvalidateRegion(xfc->hdc, patblt->nLeftRect, patblt->nTopRect, - patblt->nWidth, patblt->nHeight); + ret = gdi_InvalidateRegion(xfc->hdc, patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, + patblt->nHeight); fail: XSetFunction(xfc->display, xfc->gc, GXcopy); @@ -419,7 +411,7 @@ fail: static BOOL xf_gdi_scrblt(rdpContext* context, const SCRBLT_ORDER* scrblt) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; BOOL ret = FALSE; if (!xfc->display || !xfc->drawing) @@ -430,14 +422,13 @@ static BOOL xf_gdi_scrblt(rdpContext* context, const SCRBLT_ORDER* scrblt) if (!xf_set_rop3(xfc, gdi_rop3_code(scrblt->bRop))) goto fail; - XCopyArea(xfc->display, xfc->primary, xfc->drawing, xfc->gc, scrblt->nXSrc, - scrblt->nYSrc, + XCopyArea(xfc->display, xfc->primary, xfc->drawing, xfc->gc, scrblt->nXSrc, scrblt->nYSrc, scrblt->nWidth, scrblt->nHeight, scrblt->nLeftRect, scrblt->nTopRect); ret = TRUE; if (xfc->drawing == xfc->primary) - ret = gdi_InvalidateRegion(xfc->hdc, scrblt->nLeftRect, scrblt->nTopRect, - scrblt->nWidth, scrblt->nHeight); + ret = gdi_InvalidateRegion(xfc->hdc, scrblt->nLeftRect, scrblt->nTopRect, scrblt->nWidth, + scrblt->nHeight); XSetFunction(xfc->display, xfc->gc, GXcopy); fail: @@ -445,11 +436,10 @@ fail: return ret; } -static BOOL xf_gdi_opaque_rect(rdpContext* context, - const OPAQUE_RECT_ORDER* opaque_rect) +static BOOL xf_gdi_opaque_rect(rdpContext* context, const OPAQUE_RECT_ORDER* opaque_rect) { XColor color; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; BOOL ret = TRUE; if (!xf_decode_color(xfc, opaque_rect->color, &color)) @@ -459,13 +449,11 @@ static BOOL xf_gdi_opaque_rect(rdpContext* context, XSetFunction(xfc->display, xfc->gc, GXcopy); XSetFillStyle(xfc->display, xfc->gc, FillSolid); XSetForeground(xfc->display, xfc->gc, color.pixel); - XFillRectangle(xfc->display, xfc->drawing, xfc->gc, - opaque_rect->nLeftRect, opaque_rect->nTopRect, - opaque_rect->nWidth, opaque_rect->nHeight); + XFillRectangle(xfc->display, xfc->drawing, xfc->gc, opaque_rect->nLeftRect, + opaque_rect->nTopRect, opaque_rect->nWidth, opaque_rect->nHeight); if (xfc->drawing == xfc->primary) - ret = gdi_InvalidateRegion(xfc->hdc, opaque_rect->nLeftRect, - opaque_rect->nTopRect, + ret = gdi_InvalidateRegion(xfc->hdc, opaque_rect->nLeftRect, opaque_rect->nTopRect, opaque_rect->nWidth, opaque_rect->nHeight); xf_unlock_x11(xfc, FALSE); @@ -476,7 +464,7 @@ static BOOL xf_gdi_multi_opaque_rect(rdpContext* context, const MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect) { UINT32 i; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; BOOL ret = TRUE; XColor color; @@ -491,8 +479,7 @@ static BOOL xf_gdi_multi_opaque_rect(rdpContext* context, for (i = 0; i < multi_opaque_rect->numRectangles; i++) { const DELTA_RECT* rectangle = &multi_opaque_rect->rectangles[i]; - XFillRectangle(xfc->display, xfc->drawing, xfc->gc, - rectangle->left, rectangle->top, + XFillRectangle(xfc->display, xfc->drawing, xfc->gc, rectangle->left, rectangle->top, rectangle->width, rectangle->height); if (xfc->drawing == xfc->primary) @@ -510,7 +497,7 @@ static BOOL xf_gdi_multi_opaque_rect(rdpContext* context, static BOOL xf_gdi_line_to(rdpContext* context, const LINE_TO_ORDER* line_to) { XColor color; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; BOOL ret = TRUE; if (!xf_decode_color(xfc, line_to->penColor, &color)) @@ -520,8 +507,8 @@ static BOOL xf_gdi_line_to(rdpContext* context, const LINE_TO_ORDER* line_to) xf_set_rop2(xfc, line_to->bRop2); XSetFillStyle(xfc->display, xfc->gc, FillSolid); XSetForeground(xfc->display, xfc->gc, color.pixel); - XDrawLine(xfc->display, xfc->drawing, xfc->gc, - line_to->nXStart, line_to->nYStart, line_to->nXEnd, line_to->nYEnd); + XDrawLine(xfc->display, xfc->drawing, xfc->gc, line_to->nXStart, line_to->nYStart, + line_to->nXEnd, line_to->nYEnd); if (xfc->drawing == xfc->primary) { @@ -538,8 +525,7 @@ static BOOL xf_gdi_line_to(rdpContext* context, const LINE_TO_ORDER* line_to) return ret; } -static BOOL xf_gdi_invalidate_poly_region(xfContext* xfc, XPoint* points, - int npoints) +static BOOL xf_gdi_invalidate_poly_region(xfContext* xfc, XPoint* points, int npoints) { int x, y, x1, y1, x2, y2; @@ -573,14 +559,13 @@ static BOOL xf_gdi_invalidate_poly_region(xfContext* xfc, XPoint* points, return gdi_InvalidateRegion(xfc->hdc, x1, y1, x2 - x1, y2 - y1); } -static BOOL xf_gdi_polyline(rdpContext* context, - const POLYLINE_ORDER* polyline) +static BOOL xf_gdi_polyline(rdpContext* context, const POLYLINE_ORDER* polyline) { UINT32 i; int npoints; XColor color; XPoint* points; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; BOOL ret = TRUE; if (!xf_decode_color(xfc, polyline->penColor, &color)) @@ -608,8 +593,7 @@ static BOOL xf_gdi_polyline(rdpContext* context, points[i + 1].y = polyline->points[i].y; } - XDrawLines(xfc->display, xfc->drawing, xfc->gc, points, npoints, - CoordModePrevious); + XDrawLines(xfc->display, xfc->drawing, xfc->gc, points, npoints, CoordModePrevious); if (xfc->drawing == xfc->primary) { @@ -632,8 +616,8 @@ static BOOL xf_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt) if (!context || !memblt) return FALSE; - bitmap = (xfBitmap*) memblt->bitmap; - xfc = (xfContext*) context; + bitmap = (xfBitmap*)memblt->bitmap; + xfc = (xfContext*)context; if (!bitmap || !xfc || !xfc->display || !xfc->drawing) return FALSE; @@ -642,14 +626,12 @@ static BOOL xf_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt) if (xf_set_rop3(xfc, gdi_rop3_code(memblt->bRop))) { - XCopyArea(xfc->display, bitmap->pixmap, xfc->drawing, xfc->gc, - memblt->nXSrc, memblt->nYSrc, memblt->nWidth, memblt->nHeight, - memblt->nLeftRect, memblt->nTopRect); + XCopyArea(xfc->display, bitmap->pixmap, xfc->drawing, xfc->gc, memblt->nXSrc, memblt->nYSrc, + memblt->nWidth, memblt->nHeight, memblt->nLeftRect, memblt->nTopRect); if (xfc->drawing == xfc->primary) - ret = gdi_InvalidateRegion(xfc->hdc, memblt->nLeftRect, - memblt->nTopRect, memblt->nWidth, - memblt->nHeight); + ret = gdi_InvalidateRegion(xfc->hdc, memblt->nLeftRect, memblt->nTopRect, + memblt->nWidth, memblt->nHeight); } XSetFunction(xfc->display, xfc->gc, GXcopy); @@ -664,7 +646,7 @@ static BOOL xf_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt) XColor foreColor; XColor backColor; Pixmap pattern = 0; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; BOOL ret = FALSE; if (!xfc->display || !xfc->drawing) @@ -678,7 +660,7 @@ static BOOL xf_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt) xf_lock_x11(xfc, FALSE); brush = &mem3blt->brush; - bitmap = (xfBitmap*) mem3blt->bitmap; + bitmap = (xfBitmap*)mem3blt->bitmap; if (!xf_set_rop3(xfc, gdi_rop3_code(mem3blt->bRop))) goto fail; @@ -718,18 +700,17 @@ static BOOL xf_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt) break; default: - WLog_ERR(TAG, "Mem3Blt unimplemented brush style:%"PRIu32"", brush->style); + WLog_ERR(TAG, "Mem3Blt unimplemented brush style:%" PRIu32 "", brush->style); goto fail; } - XCopyArea(xfc->display, bitmap->pixmap, xfc->drawing, xfc->gc, - mem3blt->nXSrc, mem3blt->nYSrc, mem3blt->nWidth, mem3blt->nHeight, - mem3blt->nLeftRect, mem3blt->nTopRect); + XCopyArea(xfc->display, bitmap->pixmap, xfc->drawing, xfc->gc, mem3blt->nXSrc, mem3blt->nYSrc, + mem3blt->nWidth, mem3blt->nHeight, mem3blt->nLeftRect, mem3blt->nTopRect); ret = TRUE; if (xfc->drawing == xfc->primary) - ret = gdi_InvalidateRegion(xfc->hdc, mem3blt->nLeftRect, mem3blt->nTopRect, - mem3blt->nWidth, mem3blt->nHeight); + ret = gdi_InvalidateRegion(xfc->hdc, mem3blt->nLeftRect, mem3blt->nTopRect, mem3blt->nWidth, + mem3blt->nHeight); XSetFillStyle(xfc->display, xfc->gc, FillSolid); XSetTSOrigin(xfc->display, xfc->gc, 0, 0); @@ -743,15 +724,13 @@ fail: return ret; } - -static BOOL xf_gdi_polygon_sc(rdpContext* context, - const POLYGON_SC_ORDER* polygon_sc) +static BOOL xf_gdi_polygon_sc(rdpContext* context, const POLYGON_SC_ORDER* polygon_sc) { UINT32 i; int npoints; XPoint* points; XColor brush_color; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; BOOL ret = TRUE; if (!xf_decode_color(xfc, polygon_sc->brushColor, &brush_color)) @@ -788,14 +767,13 @@ static BOOL xf_gdi_polygon_sc(rdpContext* context, break; default: - WLog_ERR(TAG, "PolygonSC unknown fillMode: %"PRIu32"", polygon_sc->fillMode); + WLog_ERR(TAG, "PolygonSC unknown fillMode: %" PRIu32 "", polygon_sc->fillMode); break; } XSetFillStyle(xfc->display, xfc->gc, FillSolid); XSetForeground(xfc->display, xfc->gc, brush_color.pixel); - XFillPolygon(xfc->display, xfc->drawing, xfc->gc, - points, npoints, Complex, CoordModePrevious); + XFillPolygon(xfc->display, xfc->drawing, xfc->gc, points, npoints, Complex, CoordModePrevious); if (xfc->drawing == xfc->primary) { @@ -809,8 +787,7 @@ static BOOL xf_gdi_polygon_sc(rdpContext* context, return ret; } -static BOOL xf_gdi_polygon_cb(rdpContext* context, - POLYGON_CB_ORDER* polygon_cb) +static BOOL xf_gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb) { UINT32 i; int npoints; @@ -819,7 +796,7 @@ static BOOL xf_gdi_polygon_cb(rdpContext* context, const rdpBrush* brush; XColor foreColor; XColor backColor; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; BOOL ret = TRUE; if (!xf_decode_color(xfc, polygon_cb->foreColor, &foreColor)) @@ -860,7 +837,7 @@ static BOOL xf_gdi_polygon_cb(rdpContext* context, break; default: - WLog_ERR(TAG, "PolygonCB unknown fillMode: %"PRIu32"", polygon_cb->fillMode); + WLog_ERR(TAG, "PolygonCB unknown fillMode: %" PRIu32 "", polygon_cb->fillMode); break; } @@ -892,8 +869,8 @@ static BOOL xf_gdi_polygon_cb(rdpContext* context, } XSetTSOrigin(xfc->display, xfc->gc, brush->x, brush->y); - XFillPolygon(xfc->display, xfc->drawing, xfc->gc, - points, npoints, Complex, CoordModePrevious); + XFillPolygon(xfc->display, xfc->drawing, xfc->gc, points, npoints, Complex, + CoordModePrevious); XSetFillStyle(xfc->display, xfc->gc, FillSolid); XSetTSOrigin(xfc->display, xfc->gc, 0, 0); XFreePixmap(xfc->display, pattern); @@ -906,7 +883,7 @@ static BOOL xf_gdi_polygon_cb(rdpContext* context, } else { - WLog_ERR(TAG, "PolygonCB unimplemented brush style:%"PRIu32"", brush->style); + WLog_ERR(TAG, "PolygonCB unimplemented brush style:%" PRIu32 "", brush->style); } XSetFunction(xfc->display, xfc->gc, GXcopy); @@ -919,7 +896,7 @@ static BOOL xf_gdi_surface_frame_marker(rdpContext* context, const SURFACE_FRAME_MARKER* surface_frame_marker) { rdpSettings* settings; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; BOOL ret = TRUE; settings = xfc->context.settings; xf_lock_x11(xfc, FALSE); @@ -939,7 +916,8 @@ static BOOL xf_gdi_surface_frame_marker(rdpContext* context, if ((xfc->frame_x2 > xfc->frame_x1) && (xfc->frame_y2 > xfc->frame_y1)) ret = gdi_InvalidateRegion(xfc->hdc, xfc->frame_x1, xfc->frame_y1, - xfc->frame_x2 - xfc->frame_x1, xfc->frame_y2 - xfc->frame_y1); + xfc->frame_x2 - xfc->frame_x1, + xfc->frame_y2 - xfc->frame_y1); if (settings->FrameAcknowledge > 0) { @@ -954,8 +932,8 @@ static BOOL xf_gdi_surface_frame_marker(rdpContext* context, return ret; } -static BOOL xf_gdi_surface_update_frame(xfContext* xfc, UINT16 tx, UINT16 ty, - UINT16 width, UINT16 height) +static BOOL xf_gdi_surface_update_frame(xfContext* xfc, UINT16 tx, UINT16 ty, UINT16 width, + UINT16 height) { BOOL ret = TRUE; @@ -991,8 +969,8 @@ static BOOL xf_gdi_surface_update_frame(xfContext* xfc, UINT16 tx, UINT16 ty, return ret; } -static BOOL xf_gdi_update_screen(xfContext* xfc, const BYTE* pSrcData, - UINT32 scanline, const REGION16* pRegion) +static BOOL xf_gdi_update_screen(xfContext* xfc, const BYTE* pSrcData, UINT32 scanline, + const REGION16* pRegion) { BOOL ret = FALSE; XImage* image; @@ -1023,8 +1001,8 @@ static BOOL xf_gdi_update_screen(xfContext* xfc, const BYTE* pSrcData, UINT32 width = rects[i].right - rects[i].left; UINT32 height = rects[i].bottom - rects[i].top; const BYTE* src = pSrcData + top * scanline + bpp * left; - image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0, - (char*) src, width, height, xfc->scanline_pad, scanline); + image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0, (char*)src, width, + height, xfc->scanline_pad, scanline); if (!image) break; @@ -1041,11 +1019,10 @@ static BOOL xf_gdi_update_screen(xfContext* xfc, const BYTE* pSrcData, return ret; } -static BOOL xf_gdi_surface_bits(rdpContext* context, - const SURFACE_BITS_COMMAND* cmd) +static BOOL xf_gdi_surface_bits(rdpContext* context, const SURFACE_BITS_COMMAND* cmd) { BYTE* pSrcData; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; BOOL ret = FALSE; DWORD format; rdpGdi* gdi; @@ -1068,17 +1045,18 @@ static BOOL xf_gdi_surface_bits(rdpContext* context, case RDP_CODEC_ID_REMOTEFX: if (!rfx_process_message(context->codecs->rfx, cmd->bmp.bitmapData, cmd->bmp.bitmapDataLength, cmd->destLeft, cmd->destTop, - gdi->primary_buffer, gdi->dstFormat, gdi->stride, - gdi->height, ®ion)) + gdi->primary_buffer, gdi->dstFormat, gdi->stride, gdi->height, + ®ion)) goto fail; break; case RDP_CODEC_ID_NSCODEC: if (!nsc_process_message(context->codecs->nsc, cmd->bmp.bpp, cmd->bmp.width, - cmd->bmp.height, cmd->bmp.bitmapData, cmd->bmp.bitmapDataLength, - gdi->primary_buffer, gdi->dstFormat, gdi->stride, - 0, 0, cmd->bmp.width, cmd->bmp.height, FREERDP_FLIP_VERTICAL)) + cmd->bmp.height, cmd->bmp.bitmapData, + cmd->bmp.bitmapDataLength, gdi->primary_buffer, gdi->dstFormat, + gdi->stride, 0, 0, cmd->bmp.width, cmd->bmp.height, + FREERDP_FLIP_VERTICAL)) goto fail; region16_union_rect(®ion, ®ion, &cmdRect); @@ -1088,17 +1066,16 @@ static BOOL xf_gdi_surface_bits(rdpContext* context, pSrcData = cmd->bmp.bitmapData; format = gdi_get_pixel_format(cmd->bmp.bpp); - if (!freerdp_image_copy(gdi->primary_buffer, gdi->dstFormat, gdi->stride, - cmd->destLeft, cmd->destTop, cmd->bmp.width, cmd->bmp.height, - pSrcData, format, 0, 0, 0, - &xfc->context.gdi->palette, FREERDP_FLIP_VERTICAL)) + if (!freerdp_image_copy(gdi->primary_buffer, gdi->dstFormat, gdi->stride, cmd->destLeft, + cmd->destTop, cmd->bmp.width, cmd->bmp.height, pSrcData, format, + 0, 0, 0, &xfc->context.gdi->palette, FREERDP_FLIP_VERTICAL)) goto fail; region16_union_rect(®ion, ®ion, &cmdRect); break; default: - WLog_ERR(TAG, "Unsupported codecID %"PRIu16"", cmd->bmp.codecID); + WLog_ERR(TAG, "Unsupported codecID %" PRIu16 "", cmd->bmp.codecID); ret = TRUE; goto fail; } @@ -1128,4 +1105,3 @@ void xf_gdi_register_update_callbacks(rdpUpdate* update) update->SurfaceBits = xf_gdi_surface_bits; update->SurfaceFrameMarker = xf_gdi_surface_frame_marker; } - diff --git a/client/X11/xf_gfx.c b/client/X11/xf_gfx.c index 5fbf7e775..9e94a88ee 100644 --- a/client/X11/xf_gfx.c +++ b/client/X11/xf_gfx.c @@ -50,8 +50,8 @@ static UINT xf_OutputUpdate(xfContext* xfc, xfGfxSurface* surface) XSetClipMask(xfc->display, xfc->gc, None); XSetFunction(xfc->display, xfc->gc, GXcopy); XSetFillStyle(xfc->display, xfc->gc, FillSolid); - region16_intersect_rect(&(surface->gdi.invalidRegion), - &(surface->gdi.invalidRegion), &surfaceRect); + region16_intersect_rect(&(surface->gdi.invalidRegion), &(surface->gdi.invalidRegion), + &surfaceRect); sx = surface->gdi.outputTargetWidth / (double)surface->gdi.mappedWidth; sy = surface->gdi.outputTargetHeight / (double)surface->gdi.mappedHeight; @@ -71,40 +71,34 @@ static UINT xf_OutputUpdate(xfContext* xfc, xfGfxSurface* surface) if (surface->stage) { - if (!freerdp_image_scale(surface->stage, gdi->dstFormat, - surface->stageScanline, nXSrc, nYSrc, - dwidth, dheight, - surface->gdi.data, surface->gdi.format, - surface->gdi.scanline, nXSrc, nYSrc, - swidth, sheight)) + if (!freerdp_image_scale(surface->stage, gdi->dstFormat, surface->stageScanline, nXSrc, + nYSrc, dwidth, dheight, surface->gdi.data, surface->gdi.format, + surface->gdi.scanline, nXSrc, nYSrc, swidth, sheight)) goto fail; } if (xfc->remote_app) { - XPutImage(xfc->display, xfc->primary, xfc->gc, - surface->image, nXSrc, nYSrc, - nXDst, nYDst, dwidth, dheight); + XPutImage(xfc->display, xfc->primary, xfc->gc, surface->image, nXSrc, nYSrc, nXDst, + nYDst, dwidth, dheight); xf_lock_x11(xfc, FALSE); xf_rail_paint(xfc, nXDst, nYDst, nXDst + dwidth, nYDst + dheight); xf_unlock_x11(xfc, FALSE); } else #ifdef WITH_XRENDER - if (xfc->context.settings->SmartSizing - || xfc->context.settings->MultiTouchGestures) - { - XPutImage(xfc->display, xfc->primary, xfc->gc, surface->image, - nXSrc, nYSrc, nXDst, nYDst, dwidth, dheight); - xf_draw_screen(xfc, nXDst, nYDst, dwidth, dheight); - } - else + if (xfc->context.settings->SmartSizing || xfc->context.settings->MultiTouchGestures) + { + XPutImage(xfc->display, xfc->primary, xfc->gc, surface->image, nXSrc, nYSrc, nXDst, + nYDst, dwidth, dheight); + xf_draw_screen(xfc, nXDst, nYDst, dwidth, dheight); + } + else #endif - { - XPutImage(xfc->display, xfc->drawable, xfc->gc, - surface->image, nXSrc, nYSrc, - nXDst, nYDst, dwidth, dheight); - } + { + XPutImage(xfc->display, xfc->drawable, xfc->gc, surface->image, nXSrc, nYSrc, nXDst, + nYDst, dwidth, dheight); + } } rc = CHANNEL_RC_OK; @@ -133,13 +127,13 @@ static UINT xf_UpdateSurfaces(RdpgfxClientContext* context) if (gdi->suppressOutput) return CHANNEL_RC_OK; - xfc = (xfContext*) gdi->context; + xfc = (xfContext*)gdi->context; EnterCriticalSection(&context->mux); context->GetSurfaceIds(context, &pSurfaceIds, &count); for (index = 0; index < count; index++) { - xfGfxSurface* surface = (xfGfxSurface*) context->GetSurfaceData(context, pSurfaceIds[index]); + xfGfxSurface* surface = (xfGfxSurface*)context->GetSurfaceData(context, pSurfaceIds[index]); if (!surface) continue; @@ -165,8 +159,7 @@ static UINT xf_UpdateSurfaces(RdpgfxClientContext* context) return status; } -UINT xf_OutputExpose(xfContext* xfc, UINT32 x, UINT32 y, - UINT32 width, UINT32 height) +UINT xf_OutputExpose(xfContext* xfc, UINT32 x, UINT32 y, UINT32 width, UINT32 height) { UINT16 count; UINT32 index; @@ -190,7 +183,7 @@ UINT xf_OutputExpose(xfContext* xfc, UINT32 x, UINT32 y, for (index = 0; index < count; index++) { - surface = (xfGfxSurface*) context->GetSurfaceData(context, pSurfaceIds[index]); + surface = (xfGfxSurface*)context->GetSurfaceData(context, pSurfaceIds[index]); if (!surface || !surface->gdi.outputMapped) continue; @@ -207,8 +200,7 @@ UINT xf_OutputExpose(xfContext* xfc, UINT32 x, UINT32 y, intersection.top -= surfaceRect.top; intersection.right -= surfaceRect.left; intersection.bottom -= surfaceRect.top; - region16_union_rect(&surface->gdi.invalidRegion, - &surface->gdi.invalidRegion, + region16_union_rect(&surface->gdi.invalidRegion, &surface->gdi.invalidRegion, &intersection); } } @@ -243,7 +235,6 @@ UINT32 x11_pad_scanline(UINT32 scanline, UINT32 inPad) return scanline; } - /** * Function description * @@ -256,8 +247,8 @@ static UINT xf_CreateSurface(RdpgfxClientContext* context, size_t size; xfGfxSurface* surface; rdpGdi* gdi = (rdpGdi*)context->custom; - xfContext* xfc = (xfContext*) gdi->context; - surface = (xfGfxSurface*) calloc(1, sizeof(xfGfxSurface)); + xfContext* xfc = (xfContext*)gdi->context; + surface = (xfGfxSurface*)calloc(1, sizeof(xfGfxSurface)); if (!surface) return CHANNEL_RC_NO_MEMORY; @@ -289,7 +280,8 @@ static UINT xf_CreateSurface(RdpgfxClientContext* context, break; default: - WLog_ERR(TAG, "%s: unknown pixelFormat 0x%"PRIx32"", __FUNCTION__, createSurface->pixelFormat); + WLog_ERR(TAG, "%s: unknown pixelFormat 0x%" PRIx32 "", __FUNCTION__, + createSurface->pixelFormat); ret = ERROR_INTERNAL_ERROR; goto out_free; } @@ -309,9 +301,10 @@ static UINT xf_CreateSurface(RdpgfxClientContext* context, if (AreColorFormatsEqualNoAlpha(gdi->dstFormat, surface->gdi.format)) { - surface->image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0, - (char*) surface->gdi.data, surface->gdi.mappedWidth, surface->gdi.mappedHeight, - xfc->scanline_pad, surface->gdi.scanline); + surface->image = + XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0, + (char*)surface->gdi.data, surface->gdi.mappedWidth, + surface->gdi.mappedHeight, xfc->scanline_pad, surface->gdi.scanline); } else { @@ -320,7 +313,7 @@ static UINT xf_CreateSurface(RdpgfxClientContext* context, surface->stageScanline = width * bytes; surface->stageScanline = x11_pad_scanline(surface->stageScanline, xfc->scanline_pad); size = surface->stageScanline * surface->gdi.height; - surface->stage = (BYTE*) _aligned_malloc(size, 16); + surface->stage = (BYTE*)_aligned_malloc(size, 16); if (!surface->stage) { @@ -329,10 +322,10 @@ static UINT xf_CreateSurface(RdpgfxClientContext* context, } ZeroMemory(surface->stage, size); - surface->image = XCreateImage(xfc->display, xfc->visual, xfc->depth, - ZPixmap, 0, (char*) surface->stage, - surface->gdi.mappedWidth, surface->gdi.mappedHeight, - xfc->scanline_pad, surface->stageScanline); + surface->image = + XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0, (char*)surface->stage, + surface->gdi.mappedWidth, surface->gdi.mappedHeight, xfc->scanline_pad, + surface->stageScanline); } if (!surface->image) @@ -346,7 +339,7 @@ static UINT xf_CreateSurface(RdpgfxClientContext* context, surface->gdi.outputMapped = FALSE; region16_init(&surface->gdi.invalidRegion); - if (context->SetSurfaceData(context, surface->gdi.surfaceId, (void*) surface) != CHANNEL_RC_OK) + if (context->SetSurfaceData(context, surface->gdi.surfaceId, (void*)surface) != CHANNEL_RC_OK) { WLog_ERR(TAG, "%s: an error occurred during SetSurfaceData", __FUNCTION__); goto error_set_surface_data; @@ -377,8 +370,7 @@ static UINT xf_DeleteSurface(RdpgfxClientContext* context, xfGfxSurface* surface = NULL; UINT status; EnterCriticalSection(&context->mux); - surface = (xfGfxSurface*) context->GetSurfaceData(context, - deleteSurface->surfaceId); + surface = (xfGfxSurface*)context->GetSurfaceData(context, deleteSurface->surfaceId); if (surface) { @@ -400,8 +392,7 @@ static UINT xf_DeleteSurface(RdpgfxClientContext* context, status = context->SetSurfaceData(context, deleteSurface->surfaceId, NULL); if (codecs && codecs->progressive) - progressive_delete_surface_context(codecs->progressive, - deleteSurface->surfaceId); + progressive_delete_surface_context(codecs->progressive, deleteSurface->surfaceId); LeaveCriticalSection(&context->mux); return status; diff --git a/client/X11/xf_gfx.h b/client/X11/xf_gfx.h index ecca7994e..934e85a0b 100644 --- a/client/X11/xf_gfx.h +++ b/client/X11/xf_gfx.h @@ -36,8 +36,7 @@ struct xf_gfx_surface }; typedef struct xf_gfx_surface xfGfxSurface; -UINT xf_OutputExpose(xfContext* xfc, UINT32 x, UINT32 y, - UINT32 width, UINT32 height); +UINT xf_OutputExpose(xfContext* xfc, UINT32 x, UINT32 y, UINT32 width, UINT32 height); void xf_graphics_pipeline_init(xfContext* xfc, RdpgfxClientContext* gfx); diff --git a/client/X11/xf_graphics.c b/client/X11/xf_graphics.c index 2d95ff49e..fc3cb955e 100644 --- a/client/X11/xf_graphics.c +++ b/client/X11/xf_graphics.c @@ -104,7 +104,7 @@ static BOOL xf_Bitmap_New(rdpContext* context, rdpBitmap* bitmap) BYTE* data; rdpGdi* gdi; xfBitmap* xbitmap = (xfBitmap*)bitmap; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; if (!context || !bitmap || !context->gdi) return FALSE; @@ -112,8 +112,8 @@ static BOOL xf_Bitmap_New(rdpContext* context, rdpBitmap* bitmap) gdi = context->gdi; xf_lock_x11(xfc, FALSE); depth = GetBitsPerPixel(bitmap->format); - xbitmap->pixmap = XCreatePixmap(xfc->display, xfc->drawable, bitmap->width, - bitmap->height, xfc->depth); + xbitmap->pixmap = + XCreatePixmap(xfc->display, xfc->drawable, bitmap->width, bitmap->height, xfc->depth); if (!xbitmap->pixmap) goto unlock; @@ -127,10 +127,9 @@ static BOOL xf_Bitmap_New(rdpContext* context, rdpBitmap* bitmap) if (!(data = _aligned_malloc(bitmap->width * bitmap->height * 4, 16))) goto unlock; - if (!freerdp_image_copy(data, gdi->dstFormat, 0, 0, 0, - bitmap->width, bitmap->height, - bitmap->data, bitmap->format, - 0, 0, 0, &context->gdi->palette, FREERDP_FLIP_NONE)) + if (!freerdp_image_copy(data, gdi->dstFormat, 0, 0, 0, bitmap->width, bitmap->height, + bitmap->data, bitmap->format, 0, 0, 0, &context->gdi->palette, + FREERDP_FLIP_NONE)) { _aligned_free(data); goto unlock; @@ -141,9 +140,9 @@ static BOOL xf_Bitmap_New(rdpContext* context, rdpBitmap* bitmap) bitmap->format = gdi->dstFormat; } - xbitmap->image = XCreateImage(xfc->display, xfc->visual, xfc->depth, - ZPixmap, 0, (char*) bitmap->data, bitmap->width, bitmap->height, - xfc->scanline_pad, 0); + xbitmap->image = + XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0, (char*)bitmap->data, + bitmap->width, bitmap->height, xfc->scanline_pad, 0); if (!xbitmap->image) goto unlock; @@ -162,7 +161,7 @@ unlock: static void xf_Bitmap_Free(rdpContext* context, rdpBitmap* bitmap) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; xfBitmap* xbitmap = (xfBitmap*)bitmap; if (!xfc || !xbitmap) @@ -191,7 +190,7 @@ static void xf_Bitmap_Free(rdpContext* context, rdpBitmap* bitmap) static BOOL xf_Bitmap_Paint(rdpContext* context, rdpBitmap* bitmap) { int width, height; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; xfBitmap* xbitmap = (xfBitmap*)bitmap; BOOL ret; @@ -202,17 +201,16 @@ static BOOL xf_Bitmap_Paint(rdpContext* context, rdpBitmap* bitmap) height = bitmap->bottom - bitmap->top + 1; xf_lock_x11(xfc, FALSE); XSetFunction(xfc->display, xfc->gc, GXcopy); - XPutImage(xfc->display, xfc->primary, xfc->gc, - xbitmap->image, 0, 0, bitmap->left, bitmap->top, width, height); + XPutImage(xfc->display, xfc->primary, xfc->gc, xbitmap->image, 0, 0, bitmap->left, bitmap->top, + width, height); ret = gdi_InvalidateRegion(xfc->hdc, bitmap->left, bitmap->top, width, height); xf_unlock_x11(xfc, FALSE); return ret; } -static BOOL xf_Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, - BOOL primary) +static BOOL xf_Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, BOOL primary) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; if (!context || (!bitmap && !primary)) return FALSE; @@ -222,7 +220,7 @@ static BOOL xf_Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, if (primary) xfc->drawing = xfc->primary; else - xfc->drawing = ((xfBitmap*) bitmap)->pixmap; + xfc->drawing = ((xfBitmap*)bitmap)->pixmap; xf_unlock_x11(xfc, FALSE); return TRUE; @@ -235,7 +233,7 @@ static BOOL xf_Pointer_New(rdpContext* context, rdpPointer* pointer) UINT32 CursorFormat; size_t size; XcursorImage ci; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; xfPointer* xpointer = (xfPointer*)pointer; if (!context || !pointer || !context->gdi) @@ -256,18 +254,16 @@ static BOOL xf_Pointer_New(rdpContext* context, rdpPointer* pointer) ci.yhot = pointer->yPos; size = ci.height * ci.width * GetBytesPerPixel(CursorFormat); - if (!(ci.pixels = (XcursorPixel*) _aligned_malloc(size, 16))) + if (!(ci.pixels = (XcursorPixel*)_aligned_malloc(size, 16))) { xf_unlock_x11(xfc, FALSE); return FALSE; } if (!freerdp_image_copy_from_pointer_data( - (BYTE*) ci.pixels, CursorFormat, - 0, 0, 0, pointer->width, pointer->height, - pointer->xorMaskData, pointer->lengthXorMask, - pointer->andMaskData, pointer->lengthAndMask, - pointer->xorBpp, &context->gdi->palette)) + (BYTE*)ci.pixels, CursorFormat, 0, 0, 0, pointer->width, pointer->height, + pointer->xorMaskData, pointer->lengthXorMask, pointer->andMaskData, + pointer->lengthAndMask, pointer->xorBpp, &context->gdi->palette)) { _aligned_free(ci.pixels); xf_unlock_x11(xfc, FALSE); @@ -284,23 +280,22 @@ static BOOL xf_Pointer_New(rdpContext* context, rdpPointer* pointer) static void xf_Pointer_Free(rdpContext* context, rdpPointer* pointer) { #ifdef WITH_XCURSOR - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; xf_lock_x11(xfc, FALSE); - if (((xfPointer*) pointer)->cursor) - XFreeCursor(xfc->display, ((xfPointer*) pointer)->cursor); + if (((xfPointer*)pointer)->cursor) + XFreeCursor(xfc->display, ((xfPointer*)pointer)->cursor); xf_unlock_x11(xfc, FALSE); #endif } -static BOOL xf_Pointer_Set(rdpContext* context, - const rdpPointer* pointer) +static BOOL xf_Pointer_Set(rdpContext* context, const rdpPointer* pointer) { #ifdef WITH_XCURSOR - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; xf_lock_x11(xfc, FALSE); - xfc->pointer = (xfPointer*) pointer; + xfc->pointer = (xfPointer*)pointer; /* in RemoteApp mode, window can be null if none has had focus */ @@ -315,7 +310,7 @@ static BOOL xf_Pointer_Set(rdpContext* context, static BOOL xf_Pointer_SetNull(rdpContext* context) { #ifdef WITH_XCURSOR - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; static Cursor nullcursor = None; xf_lock_x11(xfc, FALSE); @@ -345,7 +340,7 @@ static BOOL xf_Pointer_SetNull(rdpContext* context) static BOOL xf_Pointer_SetDefault(rdpContext* context) { #ifdef WITH_XCURSOR - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; xf_lock_x11(xfc, FALSE); xfc->pointer = NULL; @@ -359,7 +354,7 @@ static BOOL xf_Pointer_SetDefault(rdpContext* context) static BOOL xf_Pointer_SetPosition(rdpContext* context, UINT32 x, UINT32 y) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; XWindowAttributes current; XSetWindowAttributes tmp; BOOL ret = FALSE; @@ -374,8 +369,7 @@ static BOOL xf_Pointer_SetPosition(rdpContext* context, UINT32 x, UINT32 y) tmp.event_mask = (current.your_event_mask & ~(PointerMotionMask)); - if (XChangeWindowAttributes(xfc->display, xfc->window->handle, CWEventMask, - &tmp) == 0) + if (XChangeWindowAttributes(xfc->display, xfc->window->handle, CWEventMask, &tmp) == 0) goto out; XWarpPointer(xfc->display, None, xfc->window->handle, 0, 0, 0, 0, x, y); @@ -393,19 +387,18 @@ static BOOL xf_Glyph_New(rdpContext* context, const rdpGlyph* glyph) int scanline; XImage* image; xfGlyph* xf_glyph; - xf_glyph = (xfGlyph*) glyph; - xfContext* xfc = (xfContext*) context; + xf_glyph = (xfGlyph*)glyph; + xfContext* xfc = (xfContext*)context; xf_lock_x11(xfc, FALSE); scanline = (glyph->cx + 7) / 8; - xf_glyph->pixmap = XCreatePixmap(xfc->display, xfc->drawing, glyph->cx, - glyph->cy, 1); - image = XCreateImage(xfc->display, xfc->visual, 1, - ZPixmap, 0, (char*) glyph->aj, glyph->cx, glyph->cy, 8, scanline); + xf_glyph->pixmap = XCreatePixmap(xfc->display, xfc->drawing, glyph->cx, glyph->cy, 1); + image = XCreateImage(xfc->display, xfc->visual, 1, ZPixmap, 0, (char*)glyph->aj, glyph->cx, + glyph->cy, 8, scanline); image->byte_order = MSBFirst; image->bitmap_bit_order = MSBFirst; XInitImage(image); - XPutImage(xfc->display, xf_glyph->pixmap, xfc->gc_mono, image, 0, 0, 0, 0, - glyph->cx, glyph->cy); + XPutImage(xfc->display, xf_glyph->pixmap, xfc->gc_mono, image, 0, 0, 0, 0, glyph->cx, + glyph->cy); image->data = NULL; XDestroyImage(image); xf_unlock_x11(xfc, FALSE); @@ -414,24 +407,23 @@ static BOOL xf_Glyph_New(rdpContext* context, const rdpGlyph* glyph) static void xf_Glyph_Free(rdpContext* context, rdpGlyph* glyph) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; xf_lock_x11(xfc, FALSE); - if (((xfGlyph*) glyph)->pixmap != 0) - XFreePixmap(xfc->display, ((xfGlyph*) glyph)->pixmap); + if (((xfGlyph*)glyph)->pixmap != 0) + XFreePixmap(xfc->display, ((xfGlyph*)glyph)->pixmap); xf_unlock_x11(xfc, FALSE); free(glyph->aj); free(glyph); } -static BOOL xf_Glyph_Draw(rdpContext* context, const rdpGlyph* glyph, INT32 x, - INT32 y, INT32 w, INT32 h, INT32 sx, INT32 sy, - BOOL fOpRedundant) +static BOOL xf_Glyph_Draw(rdpContext* context, const rdpGlyph* glyph, INT32 x, INT32 y, INT32 w, + INT32 h, INT32 sx, INT32 sy, BOOL fOpRedundant) { xfGlyph* xf_glyph; - xfContext* xfc = (xfContext*) context; - xf_glyph = (xfGlyph*) glyph; + xfContext* xfc = (xfContext*)context; + xf_glyph = (xfGlyph*)glyph; xf_lock_x11(xfc, FALSE); if (!fOpRedundant) @@ -446,18 +438,17 @@ static BOOL xf_Glyph_Draw(rdpContext* context, const rdpGlyph* glyph, INT32 x, if (sx || sy) WLog_ERR(TAG, ""); - //XSetClipOrigin(xfc->display, xfc->gc, sx, sy); + // XSetClipOrigin(xfc->display, xfc->gc, sx, sy); XSetTSOrigin(xfc->display, xfc->gc, x, y); XFillRectangle(xfc->display, xfc->drawing, xfc->gc, x, y, w, h); xf_unlock_x11(xfc, FALSE); return TRUE; } -static BOOL xf_Glyph_BeginDraw(rdpContext* context, INT32 x, INT32 y, - INT32 width, INT32 height, UINT32 bgcolor, - UINT32 fgcolor, BOOL fOpRedundant) +static BOOL xf_Glyph_BeginDraw(rdpContext* context, INT32 x, INT32 y, INT32 width, INT32 height, + UINT32 bgcolor, UINT32 fgcolor, BOOL fOpRedundant) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; XRectangle rect; XColor xbgcolor, xfgcolor; @@ -487,11 +478,10 @@ static BOOL xf_Glyph_BeginDraw(rdpContext* context, INT32 x, INT32 y, return TRUE; } -static BOOL xf_Glyph_EndDraw(rdpContext* context, INT32 x, INT32 y, - INT32 width, INT32 height, +static BOOL xf_Glyph_EndDraw(rdpContext* context, INT32 x, INT32 y, INT32 width, INT32 height, UINT32 bgcolor, UINT32 fgcolor) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; BOOL ret = TRUE; XColor xfgcolor, xbgcolor; @@ -512,7 +502,7 @@ BOOL xf_register_pointer(rdpGraphics* graphics) { rdpPointer* pointer = NULL; - if (!(pointer = (rdpPointer*) calloc(1, sizeof(rdpPointer)))) + if (!(pointer = (rdpPointer*)calloc(1, sizeof(rdpPointer)))) return FALSE; pointer->size = sizeof(xfPointer); diff --git a/client/X11/xf_input.c b/client/X11/xf_input.c index 2fae52593..2197e2ddf 100644 --- a/client/X11/xf_input.c +++ b/client/X11/xf_input.c @@ -88,7 +88,6 @@ const char* xf_input_get_class_string(int class) return "XIUnknownClass"; } - int xf_input_init(xfContext* xfc, Window window) { int i, j; @@ -137,7 +136,7 @@ int xf_input_init(xfContext* xfc, Window window) for (j = 0; j < dev->num_classes; j++) { XIAnyClassInfo* class = dev->classes[j]; - XITouchClassInfo* t = (XITouchClassInfo*) class; + XITouchClassInfo* t = (XITouchClassInfo*)class; if ((class->type == XITouchClass) && (t->mode == XIDirectTouch) && (strcmp(dev->name, "Virtual core pointer") != 0)) @@ -149,12 +148,11 @@ int xf_input_init(xfContext* xfc, Window window) for (j = 0; j < dev->num_classes; j++) { XIAnyClassInfo* class = dev->classes[j]; - XITouchClassInfo* t = (XITouchClassInfo*) class; + XITouchClassInfo* t = (XITouchClassInfo*)class; if (xfc->context.settings->MultiTouchInput) { - WLog_INFO(TAG, "%s (%d) \"%s\" id: %d", - xf_input_get_class_string(class->type), + WLog_INFO(TAG, "%s (%d) \"%s\" id: %d", xf_input_get_class_string(class->type), class->type, dev->name, dev->deviceid); } @@ -181,12 +179,11 @@ int xf_input_init(xfContext* xfc, Window window) if (xfc->use_xinput) { - if (!touch && (class->type == XIButtonClass) - && strcmp(dev->name, "Virtual core pointer")) + if (!touch && (class->type == XIButtonClass) && + strcmp(dev->name, "Virtual core pointer")) { - WLog_INFO(TAG, "%s button device (id: %d, mode: %d)", - dev->name, - dev->deviceid, t->mode); + WLog_INFO(TAG, "%s button device (id: %d, mode: %d)", dev->name, dev->deviceid, + t->mode); XISetMask(masks[nmasks], XI_ButtonPress); XISetMask(masks[nmasks], XI_ButtonRelease); XISetMask(masks[nmasks], XI_Motion); @@ -209,10 +206,8 @@ static BOOL xf_input_is_duplicate(XGenericEventCookie* cookie) XIDeviceEvent* event; event = cookie->data; - if ((lastEvent.time == event->time) && - (lastEvType == cookie->evtype) && - (lastEvent.detail == event->detail) && - (lastEvent.event_x == event->event_x) && + if ((lastEvent.time == event->time) && (lastEvType == cookie->evtype) && + (lastEvent.detail == event->detail) && (lastEvent.event_x == event->event_x) && (lastEvent.event_y == event->event_y)) { return TRUE; @@ -553,8 +548,8 @@ static int xf_input_touch_remote(xfContext* xfc, XIDeviceEvent* event, int evtyp xf_input_hide_cursor(xfc); touchId = event->detail; - x = (int) event->event_x; - y = (int) event->event_y; + x = (int)event->event_x; + y = (int)event->event_y; xf_event_adjust_coordinates(xfc, &x, &y); if (evtype == XI_TouchBegin) @@ -583,18 +578,18 @@ static int xf_input_event(xfContext* xfc, XIDeviceEvent* event, int evtype) switch (evtype) { case XI_ButtonPress: - xf_generic_ButtonEvent(xfc, (int) event->event_x, (int) event->event_y, - event->detail, event->event, xfc->remote_app, TRUE); + xf_generic_ButtonEvent(xfc, (int)event->event_x, (int)event->event_y, event->detail, + event->event, xfc->remote_app, TRUE); break; case XI_ButtonRelease: - xf_generic_ButtonEvent(xfc, (int) event->event_x, (int) event->event_y, - event->detail, event->event, xfc->remote_app, FALSE); + xf_generic_ButtonEvent(xfc, (int)event->event_x, (int)event->event_y, event->detail, + event->event, xfc->remote_app, FALSE); break; case XI_Motion: - xf_generic_MotionNotify(xfc, (int) event->event_x, (int) event->event_y, - event->detail, event->event, xfc->remote_app); + xf_generic_MotionNotify(xfc, (int)event->event_x, (int)event->event_y, event->detail, + event->event, xfc->remote_app); break; } diff --git a/client/X11/xf_keyboard.c b/client/X11/xf_keyboard.c index 384de53fc..50b259308 100644 --- a/client/X11/xf_keyboard.c +++ b/client/X11/xf_keyboard.c @@ -172,8 +172,7 @@ void xf_keyboard_release_all_keypress(xfContext* xfc) // release tab before releasing the windows key. // this stops the start menu from opening on unfocus event. if (rdp_scancode == RDP_SCANCODE_LWIN) - freerdp_input_send_keyboard_event_ex(xfc->context.input, FALSE, - RDP_SCANCODE_TAB); + freerdp_input_send_keyboard_event_ex(xfc->context.input, FALSE, RDP_SCANCODE_TAB); freerdp_input_send_keyboard_event_ex(xfc->context.input, FALSE, rdp_scancode); xfc->KeyboardState[keycode] = FALSE; @@ -196,11 +195,10 @@ void xf_keyboard_send_key(xfContext* xfc, BOOL down, BYTE keycode) if (rdp_scancode == RDP_SCANCODE_UNKNOWN) { - WLog_ERR(TAG, "Unknown key with X keycode 0x%02"PRIx8"", keycode); + WLog_ERR(TAG, "Unknown key with X keycode 0x%02" PRIx8 "", keycode); } - else if (rdp_scancode == RDP_SCANCODE_PAUSE && - !xf_keyboard_key_pressed(xfc, XK_Control_L) - && !xf_keyboard_key_pressed(xfc, XK_Control_R)) + else if (rdp_scancode == RDP_SCANCODE_PAUSE && !xf_keyboard_key_pressed(xfc, XK_Control_L) && + !xf_keyboard_key_pressed(xfc, XK_Control_R)) { /* Pause without Ctrl has to be sent as a series of keycodes * in a single input PDU. Pause only happens on "press"; @@ -232,13 +230,13 @@ int xf_keyboard_read_keyboard_state(xfContext* xfc) if (!xfc->remote_app) { - XQueryPointer(xfc->display, xfc->window->handle, - &wdummy, &wdummy, &dummy, &dummy, &dummy, &dummy, &state); + XQueryPointer(xfc->display, xfc->window->handle, &wdummy, &wdummy, &dummy, &dummy, &dummy, + &dummy, &state); } else { - XQueryPointer(xfc->display, DefaultRootWindow(xfc->display), - &wdummy, &wdummy, &dummy, &dummy, &dummy, &dummy, &state); + XQueryPointer(xfc->display, DefaultRootWindow(xfc->display), &wdummy, &wdummy, &dummy, + &dummy, &dummy, &dummy, &state); } return state; @@ -292,8 +290,7 @@ static BOOL xf_keyboard_set_key_state(xfContext* xfc, BOOL on, int keysym) return FALSE; } - return XkbLockModifiers(xfc->display, XkbUseCoreKbd, keysymMask, - on ? keysymMask : 0); + return XkbLockModifiers(xfc->display, XkbUseCoreKbd, keysymMask, on ? keysymMask : 0); } UINT32 xf_keyboard_get_toggle_keys_state(xfContext* xfc) @@ -322,9 +319,8 @@ static void xk_keyboard_update_modifier_keys(xfContext* xfc) int state; size_t i; KeyCode keycode; - int keysyms[] = {XK_Shift_L, XK_Shift_R, XK_Alt_L, XK_Alt_R, - XK_Control_L, XK_Control_R, XK_Super_L, XK_Super_R - }; + int keysyms[] = { XK_Shift_L, XK_Shift_R, XK_Alt_L, XK_Alt_R, + XK_Control_L, XK_Control_R, XK_Super_L, XK_Super_R }; xf_keyboard_clear(xfc); @@ -360,8 +356,7 @@ void xf_keyboard_focus_in(xfContext* xfc) if (xfc->remote_app) return; - if (XQueryPointer(xfc->display, xfc->window->handle, &w, &w, &d, &d, &x, &y, - &state)) + if (XQueryPointer(xfc->display, xfc->window->handle, &w, &w, &d, &d, &x, &y, &state)) { if (x >= 0 && x < xfc->window->width && y >= 0 && y < xfc->window->height) { @@ -371,9 +366,7 @@ void xf_keyboard_focus_in(xfContext* xfc) } } -static int xf_keyboard_execute_action_script(xfContext* xfc, - XF_MODIFIER_KEYS* mod, - KeySym keysym) +static int xf_keyboard_execute_action_script(xfContext* xfc, XF_MODIFIER_KEYS* mod, KeySym keysym) { int index; int count; @@ -389,9 +382,8 @@ static int xf_keyboard_execute_action_script(xfContext* xfc, if (!xfc->actionScriptExists) return 1; - if ((keysym == XK_Shift_L) || (keysym == XK_Shift_R) || - (keysym == XK_Alt_L) || (keysym == XK_Alt_R) || - (keysym == XK_Control_L) || (keysym == XK_Control_R)) + if ((keysym == XK_Shift_L) || (keysym == XK_Shift_R) || (keysym == XK_Alt_L) || + (keysym == XK_Alt_R) || (keysym == XK_Control_L) || (keysym == XK_Control_R)) { return 1; } @@ -420,7 +412,7 @@ static int xf_keyboard_execute_action_script(xfContext* xfc, for (index = 0; index < count; index++) { - keyCombination = (char*) ArrayList_GetItem(xfc->keyCombinations, index); + keyCombination = (char*)ArrayList_GetItem(xfc->keyCombinations, index); if (_stricmp(keyCombination, combination) == 0) { @@ -432,8 +424,8 @@ static int xf_keyboard_execute_action_script(xfContext* xfc, if (!match) return 1; - sprintf_s(command, sizeof(command), "%s key %s", - xfc->context.settings->ActionScript, combination); + sprintf_s(command, sizeof(command), "%s key %s", xfc->context.settings->ActionScript, + combination); keyScript = popen(command, "r"); if (!keyScript) @@ -635,9 +627,8 @@ void xf_keyboard_handle_special_keys_release(xfContext* xfc, KeySym keysym) BOOL xf_keyboard_set_indicators(rdpContext* context, UINT16 led_flags) { - xfContext* xfc = (xfContext*) context; - xf_keyboard_set_key_state(xfc, led_flags & KBD_SYNC_SCROLL_LOCK, - XK_Scroll_Lock); + xfContext* xfc = (xfContext*)context; + xf_keyboard_set_key_state(xfc, led_flags & KBD_SYNC_SCROLL_LOCK, XK_Scroll_Lock); xf_keyboard_set_key_state(xfc, led_flags & KBD_SYNC_NUM_LOCK, XK_Num_Lock); xf_keyboard_set_key_state(xfc, led_flags & KBD_SYNC_CAPS_LOCK, XK_Caps_Lock); xf_keyboard_set_key_state(xfc, led_flags & KBD_SYNC_KANA_LOCK, XK_Kana_Lock); @@ -651,7 +642,8 @@ BOOL xf_keyboard_set_ime_status(rdpContext* context, UINT16 imeId, UINT32 imeSta return FALSE; WLog_WARN(TAG, - "KeyboardSetImeStatus(unitId=%04"PRIx16", imeState=%08"PRIx32", imeConvMode=%08"PRIx32") ignored", + "KeyboardSetImeStatus(unitId=%04" PRIx16 ", imeState=%08" PRIx32 + ", imeConvMode=%08" PRIx32 ") ignored", imeId, imeState, imeConvMode); return TRUE; } diff --git a/client/X11/xf_keyboard.h b/client/X11/xf_keyboard.h index c7e601b1b..2f7dfb786 100644 --- a/client/X11/xf_keyboard.h +++ b/client/X11/xf_keyboard.h @@ -57,6 +57,7 @@ void xf_keyboard_focus_in(xfContext* xfc); BOOL xf_keyboard_handle_special_keys(xfContext* xfc, KeySym keysym); void xf_keyboard_handle_special_keys_release(xfContext* xfc, KeySym keysym); BOOL xf_keyboard_set_indicators(rdpContext* context, UINT16 led_flags); -BOOL xf_keyboard_set_ime_status(rdpContext* context, UINT16 imeId, UINT32 imeState, UINT32 imeConvMode); +BOOL xf_keyboard_set_ime_status(rdpContext* context, UINT16 imeId, UINT32 imeState, + UINT32 imeConvMode); #endif /* FREERDP_CLIENT_X11_XF_KEYBOARD_H */ diff --git a/client/X11/xf_monitor.c b/client/X11/xf_monitor.c index 4dc16d548..30a0b8b37 100644 --- a/client/X11/xf_monitor.c +++ b/client/X11/xf_monitor.c @@ -44,14 +44,15 @@ #include #if (RANDR_MAJOR * 100 + RANDR_MINOR) >= 105 -# define USABLE_XRANDR +#define USABLE_XRANDR #endif #endif #include "xf_monitor.h" -/* See MSDN Section on Multiple Display Monitors: http://msdn.microsoft.com/en-us/library/dd145071 */ +/* See MSDN Section on Multiple Display Monitors: http://msdn.microsoft.com/en-us/library/dd145071 + */ int xf_list_monitors(xfContext* xfc) { @@ -69,18 +70,15 @@ int xf_list_monitors(xfContext* xfc) #if defined(USABLE_XRANDR) if (XRRQueryExtension(xfc->display, &major, &minor) && - (XRRQueryVersion(xfc->display, &major, &minor) == True) && - (major * 100 + minor >= 105)) + (XRRQueryVersion(xfc->display, &major, &minor) == True) && (major * 100 + minor >= 105)) { - XRRMonitorInfo* monitors = XRRGetMonitors(xfc->display, DefaultRootWindow(xfc->display), 1, - &nmonitors); + XRRMonitorInfo* monitors = + XRRGetMonitors(xfc->display, DefaultRootWindow(xfc->display), 1, &nmonitors); for (i = 0; i < nmonitors; i++) { - printf(" %s [%d] %dx%d\t+%d+%d\n", - monitors[i].primary ? "*" : " ", i, - monitors[i].width, monitors[i].height, - monitors[i].x, monitors[i].y); + printf(" %s [%d] %dx%d\t+%d+%d\n", monitors[i].primary ? "*" : " ", i, + monitors[i].width, monitors[i].height, monitors[i].x, monitors[i].y); } XRRFreeMonitors(monitors); @@ -88,24 +86,22 @@ int xf_list_monitors(xfContext* xfc) else #endif #ifdef WITH_XINERAMA - if (XineramaQueryExtension(display, &major, &minor)) + if (XineramaQueryExtension(display, &major, &minor)) + { + if (XineramaIsActive(display)) { - if (XineramaIsActive(display)) + XineramaScreenInfo* screen = XineramaQueryScreens(display, &nmonitors); + + for (i = 0; i < nmonitors; i++) { - XineramaScreenInfo* screen = XineramaQueryScreens(display, &nmonitors); - - for (i = 0; i < nmonitors; i++) - { - printf(" %s [%d] %hdx%hd\t+%hd+%hd\n", - (i == 0) ? "*" : " ", i, - screen[i].width, screen[i].height, - screen[i].x_org, screen[i].y_org); - } - - XFree(screen); + printf(" %s [%d] %hdx%hd\t+%hd+%hd\n", (i == 0) ? "*" : " ", i, + screen[i].width, screen[i].height, screen[i].x_org, screen[i].y_org); } + + XFree(screen); } - else + } + else #else { Screen* screen = ScreenOfDisplay(display, DefaultScreen(display)); @@ -113,7 +109,7 @@ int xf_list_monitors(xfContext* xfc) } #endif - XCloseDisplay(display); + XCloseDisplay(display); return 0; } @@ -163,19 +159,17 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight) *pMaxHeight = settings->DesktopHeight; /* get mouse location */ - if (!XQueryPointer(xfc->display, DefaultRootWindow(xfc->display), - &_dummy_w, &_dummy_w, &mouse_x, &mouse_y, - &_dummy_i, &_dummy_i, (void*) &_dummy_i)) + if (!XQueryPointer(xfc->display, DefaultRootWindow(xfc->display), &_dummy_w, &_dummy_w, + &mouse_x, &mouse_y, &_dummy_i, &_dummy_i, (void*)&_dummy_i)) mouse_x = mouse_y = 0; #if defined(USABLE_XRANDR) if (XRRQueryExtension(xfc->display, &major, &minor) && - (XRRQueryVersion(xfc->display, &major, &minor) == True) && - (major * 100 + minor >= 105)) + (XRRQueryVersion(xfc->display, &major, &minor) == True) && (major * 100 + minor >= 105)) { - XRRMonitorInfo* rrmonitors = XRRGetMonitors(xfc->display, DefaultRootWindow(xfc->display), 1, - &vscreen->nmonitors); + XRRMonitorInfo* rrmonitors = + XRRGetMonitors(xfc->display, DefaultRootWindow(xfc->display), 1, &vscreen->nmonitors); if (vscreen->nmonitors > 16) vscreen->nmonitors = 0; @@ -200,32 +194,32 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight) else #endif #ifdef WITH_XINERAMA - if (XineramaQueryExtension(xfc->display, &major, &minor) && XineramaIsActive(xfc->display)) + if (XineramaQueryExtension(xfc->display, &major, &minor) && XineramaIsActive(xfc->display)) + { + XineramaScreenInfo* screenInfo = XineramaQueryScreens(xfc->display, &vscreen->nmonitors); + + if (vscreen->nmonitors > 16) + vscreen->nmonitors = 0; + + if (vscreen->nmonitors) { - XineramaScreenInfo* screenInfo = XineramaQueryScreens(xfc->display, &vscreen->nmonitors); + int i; - if (vscreen->nmonitors > 16) - vscreen->nmonitors = 0; - - if (vscreen->nmonitors) + for (i = 0; i < vscreen->nmonitors; i++) { - int i; - - for (i = 0; i < vscreen->nmonitors; i++) - { - vscreen->monitors[i].area.left = screenInfo[i].x_org; - vscreen->monitors[i].area.top = screenInfo[i].y_org; - vscreen->monitors[i].area.right = screenInfo[i].x_org + screenInfo[i].width - 1; - vscreen->monitors[i].area.bottom = screenInfo[i].y_org + screenInfo[i].height - 1; - } + vscreen->monitors[i].area.left = screenInfo[i].x_org; + vscreen->monitors[i].area.top = screenInfo[i].y_org; + vscreen->monitors[i].area.right = screenInfo[i].x_org + screenInfo[i].width - 1; + vscreen->monitors[i].area.bottom = screenInfo[i].y_org + screenInfo[i].height - 1; } - - XFree(screenInfo); } + XFree(screenInfo); + } + #endif - xfc->fullscreenMonitors.top = xfc->fullscreenMonitors.bottom = - xfc->fullscreenMonitors.left = xfc->fullscreenMonitors.right = 0; + xfc->fullscreenMonitors.top = xfc->fullscreenMonitors.bottom = xfc->fullscreenMonitors.left = + xfc->fullscreenMonitors.right = 0; /* Determine which monitor that the mouse cursor is on */ if (vscreen->monitors) @@ -256,7 +250,8 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight) if ((!settings->UseMultimon && !settings->SpanMonitors) || (settings->Workarea && !settings->RemoteApplicationMode)) { - /* If no monitors were specified on the command-line then set the current monitor as active */ + /* If no monitors were specified on the command-line then set the current monitor as active + */ if (!settings->NumMonitorIds) { settings->MonitorIds[0] = current_monitor; @@ -329,12 +324,14 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight) if (settings->PercentScreenUseWidth) *pMaxWidth = ((vscreen->monitors[current_monitor].area.right - - vscreen->monitors[current_monitor].area.left + 1) * settings->PercentScreen) / + vscreen->monitors[current_monitor].area.left + 1) * + settings->PercentScreen) / 100; if (settings->PercentScreenUseHeight) *pMaxHeight = ((vscreen->monitors[current_monitor].area.bottom - - vscreen->monitors[current_monitor].area.top + 1) * settings->PercentScreen) / + vscreen->monitors[current_monitor].area.top + 1) * + settings->PercentScreen) / 100; } else @@ -355,7 +352,8 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight) *pMaxHeight = settings->DesktopHeight; } - /* Create array of all active monitors by taking into account monitors requested on the command-line */ + /* Create array of all active monitors by taking into account monitors requested on the + * command-line */ { int i; @@ -402,7 +400,8 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight) } } - /* If no monitor is active(bogus command-line monitor specification) - then lets try to fallback to go fullscreen on the current monitor only */ + /* If no monitor is active(bogus command-line monitor specification) - then lets try to fallback + * to go fullscreen on the current monitor only */ if (nmonitors == 0 && vscreen->nmonitors > 0) { INT32 width, height; @@ -412,7 +411,7 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight) width = vscreen->monitors[current_monitor].area.right - vscreen->monitors[current_monitor].area.left + 1L; height = vscreen->monitors[current_monitor].area.bottom - - vscreen->monitors[current_monitor].area.top + 1L; + vscreen->monitors[current_monitor].area.top + 1L; settings->MonitorDefArray[0].x = vscreen->monitors[current_monitor].area.left; settings->MonitorDefArray[0].y = vscreen->monitors[current_monitor].area.top; @@ -434,8 +433,8 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight) int vR = vX + settings->MonitorDefArray[0].width; int vB = vY + settings->MonitorDefArray[0].height; xfc->fullscreenMonitors.top = xfc->fullscreenMonitors.bottom = - xfc->fullscreenMonitors.left = xfc->fullscreenMonitors.right = - settings->MonitorDefArray[0].orig_screen; + xfc->fullscreenMonitors.left = xfc->fullscreenMonitors.right = + settings->MonitorDefArray[0].orig_screen; /* Calculate bounding rectangle around all monitors to be used AND * also set the Xinerama indices which define left/top/right/bottom monitors. @@ -445,10 +444,10 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight) /* does the same as gdk_rectangle_union */ int destX = MIN(vX, settings->MonitorDefArray[i].x); int destY = MIN(vY, settings->MonitorDefArray[i].y); - int destR = MAX(vR, settings->MonitorDefArray[i].x + - settings->MonitorDefArray[i].width); - int destB = MAX(vB, settings->MonitorDefArray[i].y + - settings->MonitorDefArray[i].height); + int destR = + MAX(vR, settings->MonitorDefArray[i].x + settings->MonitorDefArray[i].width); + int destB = + MAX(vB, settings->MonitorDefArray[i].y + settings->MonitorDefArray[i].height); if (vX != destX) xfc->fullscreenMonitors.left = settings->MonitorDefArray[i].orig_screen; @@ -485,7 +484,7 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight) if (settings->NumMonitorIds) { /* The first monitor is the first in the setting which should be used */ - monitor_index = settings->MonitorIds[0]; + monitor_index = settings->MonitorIds[0]; } else { @@ -509,11 +508,12 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight) } else { - /* Lets try to see if there is a monitor with a 0,0 coordinate and use it as a fallback*/ + /* Lets try to see if there is a monitor with a 0,0 coordinate and use it as a + * fallback*/ for (i = 0; i < settings->MonitorCount; i++) { - if (!primaryMonitorFound && settings->MonitorDefArray[i].x == 0 - && settings->MonitorDefArray[i].y == 0) + if (!primaryMonitorFound && settings->MonitorDefArray[i].x == 0 && + settings->MonitorDefArray[i].y == 0) { settings->MonitorDefArray[i].is_primary = TRUE; settings->MonitorLocalShiftX = settings->MonitorDefArray[i].x; @@ -525,20 +525,22 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight) } /* Subtract monitor shift from monitor variables for server-side use. - * We maintain monitor shift value as Window requires the primary monitor to have a coordinate of 0,0 - * In some X configurations, no monitor may have a coordinate of 0,0. This can also be happen if the user - * requests specific monitors from the command-line as well. So, we make sure to translate our primary monitor's - * upper-left corner to 0,0 on the server. + * We maintain monitor shift value as Window requires the primary monitor to have a + * coordinate of 0,0 In some X configurations, no monitor may have a coordinate of 0,0. This + * can also be happen if the user requests specific monitors from the command-line as well. + * So, we make sure to translate our primary monitor's upper-left corner to 0,0 on the + * server. */ for (i = 0; i < settings->MonitorCount; i++) { - settings->MonitorDefArray[i].x = settings->MonitorDefArray[i].x - - settings->MonitorLocalShiftX; - settings->MonitorDefArray[i].y = settings->MonitorDefArray[i].y - - settings->MonitorLocalShiftY; + settings->MonitorDefArray[i].x = + settings->MonitorDefArray[i].x - settings->MonitorLocalShiftX; + settings->MonitorDefArray[i].y = + settings->MonitorDefArray[i].y - settings->MonitorLocalShiftY; } - /* Set the desktop width and height according to the bounding rectangle around the active monitors */ + /* Set the desktop width and height according to the bounding rectangle around the active + * monitors */ *pMaxWidth = MIN(*pMaxWidth, (UINT32)vscreen->area.right - vscreen->area.left + 1); *pMaxHeight = MIN(*pMaxHeight, (UINT32)vscreen->area.bottom - vscreen->area.top + 1); } diff --git a/client/X11/xf_rail.c b/client/X11/xf_rail.c index a391add38..d712604e0 100644 --- a/client/X11/xf_rail.c +++ b/client/X11/xf_rail.c @@ -33,32 +33,20 @@ #define TAG CLIENT_TAG("x11") -static const char* error_code_names[] = -{ - "RAIL_EXEC_S_OK", - "RAIL_EXEC_E_HOOK_NOT_LOADED", - "RAIL_EXEC_E_DECODE_FAILED", - "RAIL_EXEC_E_NOT_IN_ALLOWLIST", - "RAIL_EXEC_E_FILE_NOT_FOUND", - "RAIL_EXEC_E_FAIL", - "RAIL_EXEC_E_SESSION_LOCKED" -}; +static const char* error_code_names[] = { "RAIL_EXEC_S_OK", + "RAIL_EXEC_E_HOOK_NOT_LOADED", + "RAIL_EXEC_E_DECODE_FAILED", + "RAIL_EXEC_E_NOT_IN_ALLOWLIST", + "RAIL_EXEC_E_FILE_NOT_FOUND", + "RAIL_EXEC_E_FAIL", + "RAIL_EXEC_E_SESSION_LOCKED" }; #ifdef WITH_DEBUG_RAIL -static const char* movetype_names[] = -{ - "(invalid)", - "RAIL_WMSZ_LEFT", - "RAIL_WMSZ_RIGHT", - "RAIL_WMSZ_TOP", - "RAIL_WMSZ_TOPLEFT", - "RAIL_WMSZ_TOPRIGHT", - "RAIL_WMSZ_BOTTOM", - "RAIL_WMSZ_BOTTOMLEFT", - "RAIL_WMSZ_BOTTOMRIGHT", - "RAIL_WMSZ_MOVE", - "RAIL_WMSZ_KEYMOVE", - "RAIL_WMSZ_KEYSIZE" +static const char* movetype_names[] = { + "(invalid)", "RAIL_WMSZ_LEFT", "RAIL_WMSZ_RIGHT", + "RAIL_WMSZ_TOP", "RAIL_WMSZ_TOPLEFT", "RAIL_WMSZ_TOPRIGHT", + "RAIL_WMSZ_BOTTOM", "RAIL_WMSZ_BOTTOMLEFT", "RAIL_WMSZ_BOTTOMRIGHT", + "RAIL_WMSZ_MOVE", "RAIL_WMSZ_KEYMOVE", "RAIL_WMSZ_KEYSIZE" }; #endif @@ -117,8 +105,7 @@ void xf_rail_send_activate(xfContext* xfc, Window xwindow, BOOL enabled) xfc->rail->ClientActivate(xfc->rail, &activate); } -void xf_rail_send_client_system_command(xfContext* xfc, UINT32 windowId, - UINT16 command) +void xf_rail_send_client_system_command(xfContext* xfc, UINT32 windowId, UINT16 command) { RAIL_SYSCOMMAND_ORDER syscommand; syscommand.windowId = windowId; @@ -140,14 +127,14 @@ void xf_rail_adjust_position(xfContext* xfc, xfAppWindow* appWindow) return; /* If current window position disagrees with RDP window position, send update to RDP server */ - if (appWindow->x != appWindow->windowOffsetX || - appWindow->y != appWindow->windowOffsetY || + if (appWindow->x != appWindow->windowOffsetX || appWindow->y != appWindow->windowOffsetY || appWindow->width != (INT64)appWindow->windowWidth || appWindow->height != (INT64)appWindow->windowHeight) { windowMove.windowId = appWindow->windowId; /* - * Calculate new size/position for the rail window(new values for windowOffsetX/windowOffsetY/windowWidth/windowHeight) on the server + * Calculate new size/position for the rail window(new values for + * windowOffsetX/windowOffsetY/windowWidth/windowHeight) on the server */ windowMove.left = appWindow->x; windowMove.top = appWindow->y; @@ -172,20 +159,22 @@ void xf_rail_end_local_move(xfContext* xfc, xfAppWindow* appWindow) */ windowMove.windowId = appWindow->windowId; /* - * Calculate new size/position for the rail window(new values for windowOffsetX/windowOffsetY/windowWidth/windowHeight) on the server + * Calculate new size/position for the rail window(new values for + * windowOffsetX/windowOffsetY/windowWidth/windowHeight) on the server * */ windowMove.left = appWindow->x; windowMove.top = appWindow->y; - windowMove.right = windowMove.left + - appWindow->width; /* In the update to RDP the position is one past the window */ + windowMove.right = + windowMove.left + + appWindow->width; /* In the update to RDP the position is one past the window */ windowMove.bottom = windowMove.top + appWindow->height; xfc->rail->ClientWindowMove(xfc->rail, &windowMove); /* * Simulate button up at new position to end the local move (per RDP spec) */ - XQueryPointer(xfc->display, appWindow->handle, - &root_window, &child_window, &x, &y, &child_x, &child_y, &mask); + XQueryPointer(xfc->display, appWindow->handle, &root_window, &child_window, &x, &y, &child_x, + &child_y, &mask); /* only send the mouse coordinates if not a keyboard move or size */ if ((appWindow->local_move.direction != _NET_WM_MOVERESIZE_MOVE_KEYBOARD) && @@ -251,8 +240,7 @@ static void xf_rail_invalidate_region(xfContext* xfc, REGION16* invalidRegion) region16_uninit(&windowInvalidRegion); } -void xf_rail_paint(xfContext* xfc, INT32 uleft, INT32 utop, UINT32 uright, - UINT32 ubottom) +void xf_rail_paint(xfContext* xfc, INT32 uleft, INT32 utop, UINT32 uright, UINT32 ubottom) { REGION16 invalidRegion; RECTANGLE_16 invalidRect; @@ -268,11 +256,11 @@ void xf_rail_paint(xfContext* xfc, INT32 uleft, INT32 utop, UINT32 uright, /* RemoteApp Core Protocol Extension */ -static BOOL xf_rail_window_common(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo, const WINDOW_STATE_ORDER* windowState) +static BOOL xf_rail_window_common(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const WINDOW_STATE_ORDER* windowState) { xfAppWindow* appWindow = NULL; - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; UINT32 fieldFlags = orderInfo->fieldFlags; BOOL position_or_size_updated = FALSE; appWindow = xf_rail_get_window(xfc, orderInfo->windowId); @@ -303,8 +291,9 @@ static BOOL xf_rail_window_common(rdpContext* context, /* error handled below */ } } - else if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) windowState->titleInfo.string, - windowState->titleInfo.length / 2, &title, 0, NULL, NULL) < 1) + else if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)windowState->titleInfo.string, + windowState->titleInfo.length / 2, &title, 0, NULL, + NULL) < 1) { WLog_ERR(TAG, "failed to convert window title"); /* error handled below */ @@ -332,7 +321,7 @@ static BOOL xf_rail_window_common(rdpContext* context, /* Keep track of any position/size update so that we can force a refresh of the window */ if ((fieldFlags & WINDOW_ORDER_FIELD_WND_OFFSET) || - (fieldFlags & WINDOW_ORDER_FIELD_WND_SIZE) || + (fieldFlags & WINDOW_ORDER_FIELD_WND_SIZE) || (fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET) || (fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE) || (fieldFlags & WINDOW_ORDER_FIELD_WND_CLIENT_DELTA) || @@ -384,7 +373,7 @@ static BOOL xf_rail_window_common(rdpContext* context, return FALSE; } } - else if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) windowState->titleInfo.string, + else if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)windowState->titleInfo.string, windowState->titleInfo.length / 2, &title, 0, NULL, NULL) < 1) { WLog_ERR(TAG, "failed to convert window title"); @@ -425,8 +414,8 @@ static BOOL xf_rail_window_common(rdpContext* context, if (appWindow->numWindowRects) { - appWindow->windowRects = (RECTANGLE_16*) calloc(appWindow->numWindowRects, - sizeof(RECTANGLE_16)); + appWindow->windowRects = + (RECTANGLE_16*)calloc(appWindow->numWindowRects, sizeof(RECTANGLE_16)); if (!appWindow->windowRects) return FALSE; @@ -454,8 +443,8 @@ static BOOL xf_rail_window_common(rdpContext* context, if (appWindow->numVisibilityRects) { - appWindow->visibilityRects = (RECTANGLE_16*) calloc( - appWindow->numVisibilityRects, sizeof(RECTANGLE_16)); + appWindow->visibilityRects = + (RECTANGLE_16*)calloc(appWindow->numVisibilityRects, sizeof(RECTANGLE_16)); if (!appWindow->visibilityRects) return FALSE; @@ -484,15 +473,17 @@ static BOOL xf_rail_window_common(rdpContext* context, if (position_or_size_updated) { - UINT32 visibilityRectsOffsetX = (appWindow->visibleOffsetX - - (appWindow->clientOffsetX - appWindow->windowClientDeltaX)); - UINT32 visibilityRectsOffsetY = (appWindow->visibleOffsetY - - (appWindow->clientOffsetY - appWindow->windowClientDeltaY)); + UINT32 visibilityRectsOffsetX = + (appWindow->visibleOffsetX - + (appWindow->clientOffsetX - appWindow->windowClientDeltaX)); + UINT32 visibilityRectsOffsetY = + (appWindow->visibleOffsetY - + (appWindow->clientOffsetY - appWindow->windowClientDeltaY)); /* - * The rail server like to set the window to a small size when it is minimized even though it is hidden - * in some cases this can cause the window not to restore back to its original size. Therefore we don't - * update our local window when that rail window state is minimized + * The rail server like to set the window to a small size when it is minimized even though + * it is hidden in some cases this can cause the window not to restore back to its original + * size. Therefore we don't update our local window when that rail window state is minimized */ if (appWindow->rail_state != WINDOW_SHOW_MINIMIZED) { @@ -507,8 +498,7 @@ static BOOL xf_rail_window_common(rdpContext* context, } else { - xf_MoveWindow(xfc, appWindow, appWindow->windowOffsetX, - appWindow->windowOffsetY, + xf_MoveWindow(xfc, appWindow, appWindow->windowOffsetX, appWindow->windowOffsetY, appWindow->windowWidth, appWindow->windowHeight); } @@ -521,15 +511,14 @@ static BOOL xf_rail_window_common(rdpContext* context, /* We should only be using the visibility rects for shaping the window */ /*if (fieldFlags & WINDOW_ORDER_FIELD_WND_RECTS) { - xf_SetWindowRects(xfc, appWindow, appWindow->windowRects, appWindow->numWindowRects); + xf_SetWindowRects(xfc, appWindow, appWindow->windowRects, appWindow->numWindowRects); }*/ return TRUE; } -static BOOL xf_rail_window_delete(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo) +static BOOL xf_rail_window_delete(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; return xf_rail_del_window(xfc, orderInfo->windowId); } @@ -543,13 +532,12 @@ static xfRailIconCache* RailIconCache_New(rdpSettings* settings) cache->numCaches = settings->RemoteAppNumIconCaches; cache->numCacheEntries = settings->RemoteAppNumIconCacheEntries; - cache->entries = calloc(cache->numCaches * cache->numCacheEntries, - sizeof(xfRailIcon)); + cache->entries = calloc(cache->numCaches * cache->numCacheEntries, sizeof(xfRailIcon)); if (!cache->entries) { - WLog_ERR(TAG, "failed to allocate icon cache %d x %d entries", - cache->numCaches, cache->numCacheEntries); + WLog_ERR(TAG, "failed to allocate icon cache %d x %d entries", cache->numCaches, + cache->numCacheEntries); free(cache); return NULL; } @@ -574,8 +562,7 @@ static void RailIconCache_Free(xfRailIconCache* cache) } } -static xfRailIcon* RailIconCache_Lookup(xfRailIconCache* cache, - UINT8 cacheId, UINT16 cacheEntry) +static xfRailIcon* RailIconCache_Lookup(xfRailIconCache* cache, UINT8 cacheId, UINT16 cacheEntry) { /* * MS-RDPERP 2.2.1.2.3 Icon Info (TS_ICON_INFO) @@ -620,12 +607,10 @@ static BOOL convert_rail_icon(ICON_INFO* iconInfo, xfRailIcon* railIcon) if (!argbPixels) goto error; - if (!freerdp_image_copy_from_icon_data(argbPixels, - PIXEL_FORMAT_ARGB32, 0, 0, 0, - iconInfo->width, iconInfo->height, - iconInfo->bitsColor, iconInfo->cbBitsColor, - iconInfo->bitsMask, iconInfo->cbBitsMask, - iconInfo->colorTable, iconInfo->cbColorTable, iconInfo->bpp)) + if (!freerdp_image_copy_from_icon_data( + argbPixels, PIXEL_FORMAT_ARGB32, 0, 0, 0, iconInfo->width, iconInfo->height, + iconInfo->bitsColor, iconInfo->cbBitsColor, iconInfo->bitsMask, iconInfo->cbBitsMask, + iconInfo->colorTable, iconInfo->cbColorTable, iconInfo->bpp)) goto error; nelements = 2 + iconInfo->width * iconInfo->height; @@ -653,20 +638,19 @@ error: return FALSE; } -static void xf_rail_set_window_icon(xfContext* xfc, - xfAppWindow* railWindow, xfRailIcon* icon, +static void xf_rail_set_window_icon(xfContext* xfc, xfAppWindow* railWindow, xfRailIcon* icon, BOOL replace) { - XChangeProperty(xfc->display, railWindow->handle, xfc->_NET_WM_ICON, - XA_CARDINAL, 32, replace ? PropModeReplace : PropModeAppend, - (unsigned char*) icon->data, icon->length); + XChangeProperty(xfc->display, railWindow->handle, xfc->_NET_WM_ICON, XA_CARDINAL, 32, + replace ? PropModeReplace : PropModeAppend, (unsigned char*)icon->data, + icon->length); XFlush(xfc->display); } -static BOOL xf_rail_window_icon(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo, const WINDOW_ICON_ORDER* windowIcon) +static BOOL xf_rail_window_icon(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const WINDOW_ICON_ORDER* windowIcon) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; xfAppWindow* railWindow; xfRailIcon* icon; BOOL replaceIcon; @@ -675,14 +659,12 @@ static BOOL xf_rail_window_icon(rdpContext* context, if (!railWindow) return TRUE; - icon = RailIconCache_Lookup(xfc->railIconCache, - windowIcon->iconInfo->cacheId, + icon = RailIconCache_Lookup(xfc->railIconCache, windowIcon->iconInfo->cacheId, windowIcon->iconInfo->cacheEntry); if (!icon) { - WLog_WARN(TAG, "failed to get icon from cache %02X:%04X", - windowIcon->iconInfo->cacheId, + WLog_WARN(TAG, "failed to get icon from cache %02X:%04X", windowIcon->iconInfo->cacheId, windowIcon->iconInfo->cacheEntry); return FALSE; } @@ -698,10 +680,10 @@ static BOOL xf_rail_window_icon(rdpContext* context, return TRUE; } -static BOOL xf_rail_window_cached_icon(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo, const WINDOW_CACHED_ICON_ORDER* windowCachedIcon) +static BOOL xf_rail_window_cached_icon(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const WINDOW_CACHED_ICON_ORDER* windowCachedIcon) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; xfAppWindow* railWindow; xfRailIcon* icon; BOOL replaceIcon; @@ -710,15 +692,13 @@ static BOOL xf_rail_window_cached_icon(rdpContext* context, if (!railWindow) return TRUE; - icon = RailIconCache_Lookup(xfc->railIconCache, - windowCachedIcon->cachedIcon.cacheId, + icon = RailIconCache_Lookup(xfc->railIconCache, windowCachedIcon->cachedIcon.cacheId, windowCachedIcon->cachedIcon.cacheEntry); if (!icon) { WLog_WARN(TAG, "failed to get icon from cache %02X:%04X", - windowCachedIcon->cachedIcon.cacheId, - windowCachedIcon->cachedIcon.cacheEntry); + windowCachedIcon->cachedIcon.cacheId, windowCachedIcon->cachedIcon.cacheEntry); return FALSE; } @@ -727,8 +707,8 @@ static BOOL xf_rail_window_cached_icon(rdpContext* context, return TRUE; } -static BOOL xf_rail_notify_icon_common(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo, const NOTIFY_ICON_STATE_ORDER* notifyIconState) +static BOOL xf_rail_notify_icon_common(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const NOTIFY_ICON_STATE_ORDER* notifyIconState) { if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_NOTIFY_VERSION) { @@ -757,34 +737,32 @@ static BOOL xf_rail_notify_icon_common(rdpContext* context, return TRUE; } -static BOOL xf_rail_notify_icon_create(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo, const NOTIFY_ICON_STATE_ORDER* notifyIconState) +static BOOL xf_rail_notify_icon_create(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const NOTIFY_ICON_STATE_ORDER* notifyIconState) { return xf_rail_notify_icon_common(context, orderInfo, notifyIconState); } -static BOOL xf_rail_notify_icon_update(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo, const NOTIFY_ICON_STATE_ORDER* notifyIconState) +static BOOL xf_rail_notify_icon_update(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const NOTIFY_ICON_STATE_ORDER* notifyIconState) { return xf_rail_notify_icon_common(context, orderInfo, notifyIconState); } -static BOOL xf_rail_notify_icon_delete(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo) +static BOOL xf_rail_notify_icon_delete(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo) { return TRUE; } -static BOOL xf_rail_monitored_desktop(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo, const MONITORED_DESKTOP_ORDER* monitoredDesktop) +static BOOL xf_rail_monitored_desktop(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const MONITORED_DESKTOP_ORDER* monitoredDesktop) { return TRUE; } -static BOOL xf_rail_non_monitored_desktop(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo) +static BOOL xf_rail_non_monitored_desktop(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo) { - xfContext* xfc = (xfContext*) context; + xfContext* xfc = (xfContext*)context; xf_rail_disable_remoteapp_mode(xfc); return TRUE; } @@ -812,9 +790,9 @@ static void xf_rail_register_update_callbacks(rdpUpdate* update) * @return 0 on success, otherwise a Win32 error code */ static UINT xf_rail_server_execute_result(RailClientContext* context, - const RAIL_EXEC_RESULT_ORDER* execResult) + const RAIL_EXEC_RESULT_ORDER* execResult) { - xfContext* xfc = (xfContext*) context->custom; + xfContext* xfc = (xfContext*)context->custom; if (execResult->execResult != RAIL_EXEC_S_OK) { @@ -848,7 +826,7 @@ static UINT xf_rail_server_start_cmd(RailClientContext* context) RAIL_EXEC_ORDER exec = { 0 }; RAIL_SYSPARAM_ORDER sysparam = { 0 }; RAIL_CLIENT_STATUS_ORDER clientStatus = { 0 }; - xfContext* xfc = (xfContext*) context->custom; + xfContext* xfc = (xfContext*)context->custom; rdpSettings* settings = xfc->context.settings; clientStatus.flags = TS_RAIL_CLIENTSTATUS_ALLOWLOCALMOVESIZE; @@ -872,7 +850,7 @@ static UINT xf_rail_server_start_cmd(RailClientContext* context) status = context->ClientLanguageBarInfo(context, &langBarInfo); /* We want the language bar, but the server might not support it. */ - switch(status) + switch (status) { case CHANNEL_RC_OK: case ERROR_BAD_CONFIGURATION: @@ -939,12 +917,12 @@ static UINT xf_rail_server_handshake_ex(RailClientContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT xf_rail_server_local_move_size(RailClientContext* context, - const RAIL_LOCALMOVESIZE_ORDER* localMoveSize) + const RAIL_LOCALMOVESIZE_ORDER* localMoveSize) { int x = 0, y = 0; int direction = 0; Window child_window; - xfContext* xfc = (xfContext*) context->custom; + xfContext* xfc = (xfContext*)context->custom; xfAppWindow* appWindow = xf_rail_get_window(xfc, localMoveSize->windowId); if (!appWindow) @@ -1002,8 +980,7 @@ static UINT xf_rail_server_local_move_size(RailClientContext* context, case RAIL_WMSZ_MOVE: direction = _NET_WM_MOVERESIZE_MOVE; - XTranslateCoordinates(xfc->display, appWindow->handle, - RootWindowOfScreen(xfc->screen), + XTranslateCoordinates(xfc->display, appWindow->handle, RootWindowOfScreen(xfc->screen), localMoveSize->posX, localMoveSize->posY, &x, &y, &child_window); break; @@ -1038,16 +1015,15 @@ static UINT xf_rail_server_local_move_size(RailClientContext* context, static UINT xf_rail_server_min_max_info(RailClientContext* context, const RAIL_MINMAXINFO_ORDER* minMaxInfo) { - xfContext* xfc = (xfContext*) context->custom; + xfContext* xfc = (xfContext*)context->custom; xfAppWindow* appWindow = xf_rail_get_window(xfc, minMaxInfo->windowId); if (appWindow) { - xf_SetWindowMinMaxInfo(xfc, appWindow, - minMaxInfo->maxWidth, minMaxInfo->maxHeight, - minMaxInfo->maxPosX, minMaxInfo->maxPosY, - minMaxInfo->minTrackWidth, minMaxInfo->minTrackHeight, - minMaxInfo->maxTrackWidth, minMaxInfo->maxTrackHeight); + xf_SetWindowMinMaxInfo(xfc, appWindow, minMaxInfo->maxWidth, minMaxInfo->maxHeight, + minMaxInfo->maxPosX, minMaxInfo->maxPosY, minMaxInfo->minTrackWidth, + minMaxInfo->minTrackHeight, minMaxInfo->maxTrackWidth, + minMaxInfo->maxTrackHeight); } return CHANNEL_RC_OK; @@ -1059,7 +1035,7 @@ static UINT xf_rail_server_min_max_info(RailClientContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT xf_rail_server_language_bar_info(RailClientContext* context, - const RAIL_LANGBAR_INFO_ORDER* langBarInfo) + const RAIL_LANGBAR_INFO_ORDER* langBarInfo) { return CHANNEL_RC_OK; } @@ -1070,7 +1046,7 @@ static UINT xf_rail_server_language_bar_info(RailClientContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT xf_rail_server_get_appid_response(RailClientContext* context, - const RAIL_GET_APPID_RESP_ORDER* getAppIdResp) + const RAIL_GET_APPID_RESP_ORDER* getAppIdResp) { return CHANNEL_RC_OK; } @@ -1089,12 +1065,12 @@ static BOOL rail_window_key_equals(void* key1, void* key2) static UINT32 rail_window_key_hash(void* key) { const UINT64* k1 = (const UINT64*)key; - return (UINT32) * k1; + return (UINT32)*k1; } static void rail_window_free(void* value) { - xfAppWindow* appWindow = (xfAppWindow*) value; + xfAppWindow* appWindow = (xfAppWindow*)value; if (!appWindow) return; @@ -1104,14 +1080,14 @@ static void rail_window_free(void* value) int xf_rail_init(xfContext* xfc, RailClientContext* rail) { - rdpContext* context = (rdpContext*) xfc; + rdpContext* context = (rdpContext*)xfc; if (!xfc || !rail) return 0; xfc->rail = rail; xf_rail_register_update_callbacks(context->update); - rail->custom = (void*) xfc; + rail->custom = (void*)xfc; rail->ServerExecuteResult = xf_rail_server_execute_result; rail->ServerSystemParam = xf_rail_server_system_param; rail->ServerHandshake = xf_rail_server_handshake; @@ -1172,7 +1148,7 @@ xfAppWindow* xf_rail_add_window(xfContext* xfc, UINT64 id, UINT32 x, UINT32 y, U if (!xfc) return NULL; - appWindow = (xfAppWindow*) calloc(1, sizeof(xfAppWindow)); + appWindow = (xfAppWindow*)calloc(1, sizeof(xfAppWindow)); if (!appWindow) return NULL; @@ -1185,7 +1161,7 @@ xfAppWindow* xf_rail_add_window(xfContext* xfc, UINT64 id, UINT32 x, UINT32 y, U appWindow->width = width; appWindow->height = height; xf_AppWindowCreate(xfc, appWindow); - HashTable_Add(xfc->railWindows, &appWindow->windowId, (void*) appWindow); + HashTable_Add(xfc->railWindows, &appWindow->windowId, (void*)appWindow); return appWindow; } @@ -1210,4 +1186,3 @@ xfAppWindow* xf_rail_get_window(xfContext* xfc, UINT64 id) return HashTable_GetItemValue(xfc->railWindows, &id); } - diff --git a/client/X11/xf_rail.h b/client/X11/xf_rail.h index 0953ae6be..c99ed7050 100644 --- a/client/X11/xf_rail.h +++ b/client/X11/xf_rail.h @@ -33,15 +33,15 @@ void xf_rail_end_local_move(xfContext* xfc, xfAppWindow* appWindow); void xf_rail_enable_remoteapp_mode(xfContext* xfc); void xf_rail_disable_remoteapp_mode(xfContext* xfc); -xfAppWindow* xf_rail_add_window(xfContext* xfc, UINT64 id, UINT32 x, UINT32 y, - UINT32 width, UINT32 height, UINT32 surfaceId); +xfAppWindow* xf_rail_add_window(xfContext* xfc, UINT64 id, UINT32 x, UINT32 y, UINT32 width, + UINT32 height, UINT32 surfaceId); xfAppWindow* xf_rail_get_window(xfContext* xfc, UINT64 id); BOOL xf_rail_del_window(xfContext* xfc, UINT64 id); -BOOL xf_rail_draw_window(xfContext* xfc, xfAppWindow* window, const char* data, - UINT32 scanline, UINT32 width, UINT32 height, - const RECTANGLE_16* src, const RECTANGLE_16* dst); +BOOL xf_rail_draw_window(xfContext* xfc, xfAppWindow* window, const char* data, UINT32 scanline, + UINT32 width, UINT32 height, const RECTANGLE_16* src, + const RECTANGLE_16* dst); int xf_rail_init(xfContext* xfc, RailClientContext* rail); int xf_rail_uninit(xfContext* xfc, RailClientContext* rail); diff --git a/client/X11/xf_tsmf.c b/client/X11/xf_tsmf.c index 6d7205036..87f10471a 100644 --- a/client/X11/xf_tsmf.c +++ b/client/X11/xf_tsmf.c @@ -94,12 +94,12 @@ static int xf_tsmf_xv_video_frame_event(TsmfClientContext* tsmf, TSMF_VIDEO_FRAM if (!tsmf) return -1; - xfc = (xfContext*) tsmf->custom; + xfc = (xfContext*)tsmf->custom; if (!xfc) return -1; - xv = (xfXvContext*) xfc->xv_context; + xv = (xfXvContext*)xfc->xv_context; if (!xv) return -1; @@ -118,7 +118,7 @@ static int xf_tsmf_xv_video_frame_event(TsmfClientContext* tsmf, TSMF_VIDEO_FRAM if (numRects > 0) { - xrects = (XRectangle*) calloc(numRects, sizeof(XRectangle)); + xrects = (XRectangle*)calloc(numRects, sizeof(XRectangle)); if (!xrects) return -1; @@ -186,13 +186,13 @@ static int xf_tsmf_xv_video_frame_event(TsmfClientContext* tsmf, TSMF_VIDEO_FRAM } else { - WLog_DBG(TAG, "pixel format 0x%"PRIX32" not supported by hardware.", pixfmt); + WLog_DBG(TAG, "pixel format 0x%" PRIX32 " not supported by hardware.", pixfmt); free(xrects); return -1003; } - image = XvShmCreateImage(xfc->display, xv->xv_port, - xvpixfmt, 0, event->frameWidth, event->frameHeight, &shminfo); + image = XvShmCreateImage(xfc->display, xv->xv_port, xvpixfmt, 0, event->frameWidth, + event->frameHeight, &shminfo); if (xv->xv_image_size != image->data_size) { @@ -228,17 +228,15 @@ static int xf_tsmf_xv_video_frame_event(TsmfClientContext* tsmf, TSMF_VIDEO_FRAM /* Y */ if (image->pitches[0] == event->frameWidth) { - CopyMemory(image->data + image->offsets[0], - event->frameData, - event->frameWidth * event->frameHeight); + CopyMemory(image->data + image->offsets[0], event->frameData, + event->frameWidth * event->frameHeight); } else { for (i = 0; i < event->frameHeight; i++) { CopyMemory(image->data + image->offsets[0] + i * image->pitches[0], - event->frameData + i * event->frameWidth, - event->frameWidth); + event->frameData + i * event->frameWidth, event->frameWidth); } } /* UV */ @@ -247,35 +245,31 @@ static int xf_tsmf_xv_video_frame_event(TsmfClientContext* tsmf, TSMF_VIDEO_FRAM { data1 = event->frameData + event->frameWidth * event->frameHeight; data2 = event->frameData + event->frameWidth * event->frameHeight + - event->frameWidth * event->frameHeight / 4; + event->frameWidth * event->frameHeight / 4; } else { data2 = event->frameData + event->frameWidth * event->frameHeight; data1 = event->frameData + event->frameWidth * event->frameHeight + - event->frameWidth * event->frameHeight / 4; + event->frameWidth * event->frameHeight / 4; image->id = pixfmt == RDP_PIXFMT_I420 ? RDP_PIXFMT_YV12 : RDP_PIXFMT_I420; } if (image->pitches[1] * 2 == event->frameWidth) { - CopyMemory(image->data + image->offsets[1], - data1, - event->frameWidth * event->frameHeight / 4); - CopyMemory(image->data + image->offsets[2], - data2, - event->frameWidth * event->frameHeight / 4); + CopyMemory(image->data + image->offsets[1], data1, + event->frameWidth * event->frameHeight / 4); + CopyMemory(image->data + image->offsets[2], data2, + event->frameWidth * event->frameHeight / 4); } else { for (i = 0; i < event->frameHeight / 2; i++) { CopyMemory(image->data + image->offsets[1] + i * image->pitches[1], - data1 + i * event->frameWidth / 2, - event->frameWidth / 2); + data1 + i * event->frameWidth / 2, event->frameWidth / 2); CopyMemory(image->data + image->offsets[2] + i * image->pitches[2], - data2 + i * event->frameWidth / 2, - event->frameWidth / 2); + data2 + i * event->frameWidth / 2, event->frameWidth / 2); } } break; @@ -288,16 +282,17 @@ static int xf_tsmf_xv_video_frame_event(TsmfClientContext* tsmf, TSMF_VIDEO_FRAM } else { - const size_t size = ((UINT32)image->data_size <= event->frameSize) ? - (UINT32)image->data_size : event->frameSize; + const size_t size = ((UINT32)image->data_size <= event->frameSize) + ? (UINT32)image->data_size + : event->frameSize; CopyMemory(image->data, event->frameData, size); } break; } - XvShmPutImage(xfc->display, xv->xv_port, xfc->window->handle, xfc->gc, - image, 0, 0, image->width, image->height, - event->x, event->y, event->width, event->height, FALSE); + XvShmPutImage(xfc->display, xv->xv_port, xfc->window->handle, xfc->gc, image, 0, 0, + image->width, image->height, event->x, event->y, event->width, event->height, + FALSE); if (xv->xv_colorkey_atom == None) XSetClipMask(xfc->display, xfc->gc, None); @@ -330,7 +325,7 @@ int xf_tsmf_xv_init(xfContext* xfc, TsmfClientContext* tsmf) if (xfc->xv_context) return 1; /* context already created */ - xv = (xfXvContext*) calloc(1, sizeof(xfXvContext)); + xv = (xfXvContext*)calloc(1, sizeof(xfXvContext)); if (!xv) return -1; @@ -347,7 +342,8 @@ int xf_tsmf_xv_init(xfContext* xfc, TsmfClientContext* tsmf) return -1; } - ret = XvQueryExtension(xfc->display, &version, &release, &request_base, &event_base, &error_base); + ret = + XvQueryExtension(xfc->display, &version, &release, &request_base, &event_base, &error_base); if (ret != Success) { @@ -357,8 +353,7 @@ int xf_tsmf_xv_init(xfContext* xfc, TsmfClientContext* tsmf) WLog_DBG(TAG, "version %u release %u", version, release); - ret = XvQueryAdaptors(xfc->display, DefaultRootWindow(xfc->display), - &num_adaptors, &ai); + ret = XvQueryAdaptors(xfc->display, DefaultRootWindow(xfc->display), &num_adaptors, &ai); if (ret != Success) { @@ -369,7 +364,7 @@ int xf_tsmf_xv_init(xfContext* xfc, TsmfClientContext* tsmf) for (i = 0; i < num_adaptors; i++) { WLog_DBG(TAG, "adapter port %lu-%lu (%s)", ai[i].base_id, - ai[i].base_id + ai[i].num_ports - 1, ai[i].name); + ai[i].base_id + ai[i].num_ports - 1, ai[i].name); if (xv->xv_port == 0 && i == num_adaptors - 1) xv->xv_port = ai[i].base_id; @@ -392,7 +387,8 @@ int xf_tsmf_xv_init(xfContext* xfc, TsmfClientContext* tsmf) if (strcmp(attr[i].name, "XV_COLORKEY") == 0) { xv->xv_colorkey_atom = XInternAtom(xfc->display, "XV_COLORKEY", FALSE); - XvSetPortAttribute(xfc->display, xv->xv_port, xv->xv_colorkey_atom, attr[i].min_value + 1); + XvSetPortAttribute(xfc->display, xv->xv_port, xv->xv_colorkey_atom, + attr[i].min_value + 1); break; } } @@ -404,13 +400,14 @@ int xf_tsmf_xv_init(xfContext* xfc, TsmfClientContext* tsmf) if (ret > 0) { - xv->xv_pixfmts = (UINT32*) calloc((ret + 1), sizeof(UINT32)); + xv->xv_pixfmts = (UINT32*)calloc((ret + 1), sizeof(UINT32)); for (i = 0; i < (unsigned int)ret; i++) { xv->xv_pixfmts[i] = fo[i].id; - WLog_DBG(TAG, "%c%c%c%c ", ((char*)(xv->xv_pixfmts + i))[0], ((char*)(xv->xv_pixfmts + i))[1], - ((char*)(xv->xv_pixfmts + i))[2], ((char*)(xv->xv_pixfmts + i))[3]); + WLog_DBG(TAG, "%c%c%c%c ", ((char*)(xv->xv_pixfmts + i))[0], + ((char*)(xv->xv_pixfmts + i))[1], ((char*)(xv->xv_pixfmts + i))[2], + ((char*)(xv->xv_pixfmts + i))[3]); } xv->xv_pixfmts[i] = 0; } @@ -419,7 +416,7 @@ int xf_tsmf_xv_init(xfContext* xfc, TsmfClientContext* tsmf) if (tsmf) { xfc->tsmf = tsmf; - tsmf->custom = (void*) xfc; + tsmf->custom = (void*)xfc; tsmf->FrameEvent = xf_tsmf_xv_video_frame_event; } @@ -429,7 +426,7 @@ int xf_tsmf_xv_init(xfContext* xfc, TsmfClientContext* tsmf) int xf_tsmf_xv_uninit(xfContext* xfc, TsmfClientContext* tsmf) { - xfXvContext* xv = (xfXvContext*) xfc->xv_context; + xfXvContext* xv = (xfXvContext*)xfc->xv_context; WINPR_UNUSED(tsmf); if (xv) @@ -476,4 +473,3 @@ int xf_tsmf_uninit(xfContext* xfc, TsmfClientContext* tsmf) return 1; } - diff --git a/client/X11/xf_video.c b/client/X11/xf_video.c index a956f9ce8..9520454cb 100644 --- a/client/X11/xf_video.c +++ b/client/X11/xf_video.c @@ -17,7 +17,6 @@ * limitations under the License. */ - #include #include #include @@ -33,7 +32,7 @@ typedef struct } xfVideoSurface; static VideoSurface* xfVideoCreateSurface(VideoClientContext* video, BYTE* data, UINT32 x, UINT32 y, - UINT32 width, UINT32 height) + UINT32 width, UINT32 height) { xfContext* xfc = (xfContext*)video->custom; xfVideoSurface* ret = calloc(1, sizeof(*ret)); @@ -46,8 +45,8 @@ static VideoSurface* xfVideoCreateSurface(VideoClientContext* video, BYTE* data, ret->base.y = y; ret->base.w = width; ret->base.h = height; - ret->image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0, - (char*)data, width, height, 8, width * 4); + ret->image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0, (char*)data, width, + height, 8, width * 4); if (!ret->image) { @@ -59,26 +58,23 @@ static VideoSurface* xfVideoCreateSurface(VideoClientContext* video, BYTE* data, return &ret->base; } - static BOOL xfVideoShowSurface(VideoClientContext* video, VideoSurface* surface) { xfVideoSurface* xfSurface = (xfVideoSurface*)surface; xfContext* xfc = video->custom; #ifdef WITH_XRENDER - if (xfc->context.settings->SmartSizing - || xfc->context.settings->MultiTouchGestures) + if (xfc->context.settings->SmartSizing || xfc->context.settings->MultiTouchGestures) { - XPutImage(xfc->display, xfc->primary, xfc->gc, xfSurface->image, - 0, 0, surface->x, surface->y, surface->w, surface->h); + XPutImage(xfc->display, xfc->primary, xfc->gc, xfSurface->image, 0, 0, surface->x, + surface->y, surface->w, surface->h); xf_draw_screen(xfc, surface->x, surface->y, surface->w, surface->h); } else #endif { - XPutImage(xfc->display, xfc->drawable, xfc->gc, xfSurface->image, - 0, 0, - surface->x, surface->y, surface->w, surface->h); + XPutImage(xfc->display, xfc->drawable, xfc->gc, xfSurface->image, 0, 0, surface->x, + surface->y, surface->w, surface->h); } return TRUE; @@ -105,7 +101,6 @@ void xf_video_control_init(xfContext* xfc, VideoClientContext* video) video->deleteSurface = xfVideoDeleteSurface; } - void xf_video_control_uninit(xfContext* xfc, VideoClientContext* video) { gdi_video_control_uninit(xfc->context.gdi, video); diff --git a/client/X11/xf_video.h b/client/X11/xf_video.h index 47af49c2c..83708f0df 100644 --- a/client/X11/xf_video.h +++ b/client/X11/xf_video.h @@ -30,5 +30,4 @@ void xf_video_control_uninit(xfContext* xfc, VideoClientContext* video); xfVideoContext* xf_video_new(xfContext* xfc); void xf_video_free(xfVideoContext* context); - #endif /* CLIENT_X11_XF_VIDEO_H_ */ diff --git a/client/X11/xf_window.c b/client/X11/xf_window.c index 83c2553ff..b865eb7cc 100644 --- a/client/X11/xf_window.c +++ b/client/X11/xf_window.c @@ -60,7 +60,10 @@ #ifdef WITH_DEBUG_X11 #define DEBUG_X11(...) WLog_DBG(TAG, __VA_ARGS__) #else -#define DEBUG_X11(...) do { } while (0) +#define DEBUG_X11(...) \ + do \ + { \ + } while (0) #endif #include "FreeRDP_Icon_256px.h" @@ -71,29 +74,29 @@ /* Extended Window Manager Hints: http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html */ /* bit definitions for MwmHints.flags */ -#define MWM_HINTS_FUNCTIONS (1L << 0) -#define MWM_HINTS_DECORATIONS (1L << 1) -#define MWM_HINTS_INPUT_MODE (1L << 2) -#define MWM_HINTS_STATUS (1L << 3) +#define MWM_HINTS_FUNCTIONS (1L << 0) +#define MWM_HINTS_DECORATIONS (1L << 1) +#define MWM_HINTS_INPUT_MODE (1L << 2) +#define MWM_HINTS_STATUS (1L << 3) /* bit definitions for MwmHints.functions */ -#define MWM_FUNC_ALL (1L << 0) -#define MWM_FUNC_RESIZE (1L << 1) -#define MWM_FUNC_MOVE (1L << 2) -#define MWM_FUNC_MINIMIZE (1L << 3) -#define MWM_FUNC_MAXIMIZE (1L << 4) -#define MWM_FUNC_CLOSE (1L << 5) +#define MWM_FUNC_ALL (1L << 0) +#define MWM_FUNC_RESIZE (1L << 1) +#define MWM_FUNC_MOVE (1L << 2) +#define MWM_FUNC_MINIMIZE (1L << 3) +#define MWM_FUNC_MAXIMIZE (1L << 4) +#define MWM_FUNC_CLOSE (1L << 5) /* bit definitions for MwmHints.decorations */ -#define MWM_DECOR_ALL (1L << 0) -#define MWM_DECOR_BORDER (1L << 1) -#define MWM_DECOR_RESIZEH (1L << 2) -#define MWM_DECOR_TITLE (1L << 3) -#define MWM_DECOR_MENU (1L << 4) -#define MWM_DECOR_MINIMIZE (1L << 5) -#define MWM_DECOR_MAXIMIZE (1L << 6) +#define MWM_DECOR_ALL (1L << 0) +#define MWM_DECOR_BORDER (1L << 1) +#define MWM_DECOR_RESIZEH (1L << 2) +#define MWM_DECOR_TITLE (1L << 3) +#define MWM_DECOR_MENU (1L << 4) +#define MWM_DECOR_MINIMIZE (1L << 5) +#define MWM_DECOR_MAXIMIZE (1L << 6) -#define PROP_MOTIF_WM_HINTS_ELEMENTS 5 +#define PROP_MOTIF_WM_HINTS_ELEMENTS 5 struct _PropMotifWmHints { @@ -111,15 +114,14 @@ static void xf_SetWindowTitleText(xfContext* xfc, Window window, const char* nam XStoreName(xfc->display, window, name); Atom wm_Name = xfc->_NET_WM_NAME; Atom utf8Str = xfc->UTF8_STRING; - XChangeProperty(xfc->display, window, wm_Name, utf8Str, 8, - PropModeReplace, (const unsigned char*)name, (int)i); + XChangeProperty(xfc->display, window, wm_Name, utf8Str, 8, PropModeReplace, + (const unsigned char*)name, (int)i); } /** * Post an event from the client to the X server */ -void xf_SendClientEvent(xfContext* xfc, Window window, Atom atom, - unsigned int numArgs, ...) +void xf_SendClientEvent(xfContext* xfc, Window window, Atom atom, unsigned int numArgs, ...) { XEvent xevent; unsigned int i; @@ -139,7 +141,7 @@ void xf_SendClientEvent(xfContext* xfc, Window window, Atom atom, xevent.xclient.data.l[i] = va_arg(argp, int); } - DEBUG_X11("Send ClientMessage Event: wnd=0x%04lX", (unsigned long) xevent.xclient.window); + DEBUG_X11("Send ClientMessage Event: wnd=0x%04lX", (unsigned long)xevent.xclient.window); XSendEvent(xfc->display, RootWindowOfScreen(xfc->screen), False, SubstructureRedirectMask | SubstructureNotifyMask, &xevent); XSync(xfc->display, False); @@ -158,7 +160,8 @@ void xf_SetWindowFullscreen(xfContext* xfc, xfWindow* window, BOOL fullscreen) int startX, startY; UINT32 width = window->width; UINT32 height = window->height; - /* xfc->decorations is set by caller depending on settings and whether it is fullscreen or not */ + /* xfc->decorations is set by caller depending on settings and whether it is fullscreen or not + */ window->decorations = xfc->decorations; /* show/hide decorations (e.g. title bar) as guided by xfc->decorations */ xf_SetWindowDecorations(xfc, window->handle, window->decorations); @@ -204,7 +207,8 @@ void xf_SetWindowFullscreen(xfContext* xfc, xfWindow* window, BOOL fullscreen) } /* - It is safe to proceed with simply toogling _NET_WM_STATE_FULLSCREEN window state on the following conditions: + It is safe to proceed with simply toogling _NET_WM_STATE_FULLSCREEN window state on the + following conditions: - The window manager supports multiple monitor full screen - The user requested to use a single monitor to render the remote desktop */ @@ -233,11 +237,8 @@ void xf_SetWindowFullscreen(xfContext* xfc, xfWindow* window, BOOL fullscreen) if (settings->MonitorCount > 1) { xf_SendClientEvent(xfc, window->handle, xfc->_NET_WM_FULLSCREEN_MONITORS, 5, - xfc->fullscreenMonitors.top, - xfc->fullscreenMonitors.bottom, - xfc->fullscreenMonitors.left, - xfc->fullscreenMonitors.right, - 1); + xfc->fullscreenMonitors.top, xfc->fullscreenMonitors.bottom, + xfc->fullscreenMonitors.left, xfc->fullscreenMonitors.right, 1); } } else @@ -248,8 +249,7 @@ void xf_SetWindowFullscreen(xfContext* xfc, xfWindow* window, BOOL fullscreen) if (xfc->fullscreenMonitors.top) { - xf_SendClientEvent(xfc, window->handle, xfc->_NET_WM_STATE, 4, - _NET_WM_STATE_ADD, + xf_SendClientEvent(xfc, window->handle, xfc->_NET_WM_STATE, 4, _NET_WM_STATE_ADD, xfc->fullscreenMonitors.top, 0, 0); } else @@ -270,16 +270,17 @@ void xf_SetWindowFullscreen(xfContext* xfc, xfWindow* window, BOOL fullscreen) unsigned long bytes; BYTE* prop; - if (xf_GetWindowProperty(xfc, window->handle, xfc->_NET_WM_STATE, 255, &nitems, &bytes, &prop)) + if (xf_GetWindowProperty(xfc, window->handle, xfc->_NET_WM_STATE, 255, &nitems, + &bytes, &prop)) { state = 0; while (nitems-- > 0) { - if (((Atom*) prop)[nitems] == xfc->_NET_WM_STATE_MAXIMIZED_VERT) + if (((Atom*)prop)[nitems] == xfc->_NET_WM_STATE_MAXIMIZED_VERT) state |= 0x01; - if (((Atom*) prop)[nitems] == xfc->_NET_WM_STATE_MAXIMIZED_HORZ) + if (((Atom*)prop)[nitems] == xfc->_NET_WM_STATE_MAXIMIZED_HORZ) state |= 0x02; } @@ -312,24 +313,21 @@ void xf_SetWindowFullscreen(xfContext* xfc, xfWindow* window, BOOL fullscreen) if (xfc->fullscreenMonitors.top) { - xf_SendClientEvent(xfc, window->handle, xfc->_NET_WM_STATE, 4, - _NET_WM_STATE_REMOVE, + xf_SendClientEvent(xfc, window->handle, xfc->_NET_WM_STATE, 4, _NET_WM_STATE_REMOVE, xfc->fullscreenMonitors.top, 0, 0); } /* restore maximized state, if the window was maximized before setting fullscreen */ if (xfc->savedMaximizedState & 0x01) { - xf_SendClientEvent(xfc, window->handle, xfc->_NET_WM_STATE, 4, - _NET_WM_STATE_ADD, xfc->_NET_WM_STATE_MAXIMIZED_VERT, - 0, 0); + xf_SendClientEvent(xfc, window->handle, xfc->_NET_WM_STATE, 4, _NET_WM_STATE_ADD, + xfc->_NET_WM_STATE_MAXIMIZED_VERT, 0, 0); } if (xfc->savedMaximizedState & 0x02) { - xf_SendClientEvent(xfc, window->handle, xfc->_NET_WM_STATE, 4, - _NET_WM_STATE_ADD, xfc->_NET_WM_STATE_MAXIMIZED_HORZ, - 0, 0); + xf_SendClientEvent(xfc, window->handle, xfc->_NET_WM_STATE, 4, _NET_WM_STATE_ADD, + xfc->_NET_WM_STATE_MAXIMIZED_HORZ, 0, 0); } xfc->savedMaximizedState = 0; @@ -339,8 +337,7 @@ void xf_SetWindowFullscreen(xfContext* xfc, xfWindow* window, BOOL fullscreen) /* http://tronche.com/gui/x/xlib/window-information/XGetWindowProperty.html */ -BOOL xf_GetWindowProperty(xfContext* xfc, Window window, Atom property, - int length, +BOOL xf_GetWindowProperty(xfContext* xfc, Window window, Atom property, int length, unsigned long* nitems, unsigned long* bytes, BYTE** prop) { int status; @@ -350,8 +347,7 @@ BOOL xf_GetWindowProperty(xfContext* xfc, Window window, Atom property, if (property == None) return FALSE; - status = XGetWindowProperty(xfc->display, window, - property, 0, length, False, AnyPropertyType, + status = XGetWindowProperty(xfc->display, window, property, 0, length, False, AnyPropertyType, &actual_type, &actual_format, nitems, bytes, prop); if (status != Success) @@ -359,7 +355,7 @@ BOOL xf_GetWindowProperty(xfContext* xfc, Window window, Atom property, if (actual_type == None) { - WLog_INFO(TAG, "Property %lu does not exist", (unsigned long) property); + WLog_INFO(TAG, "Property %lu does not exist", (unsigned long)property); return FALSE; } @@ -372,13 +368,13 @@ BOOL xf_GetCurrentDesktop(xfContext* xfc) unsigned long nitems; unsigned long bytes; unsigned char* prop; - status = xf_GetWindowProperty(xfc, DefaultRootWindow(xfc->display), - xfc->_NET_CURRENT_DESKTOP, 1, &nitems, &bytes, &prop); + status = xf_GetWindowProperty(xfc, DefaultRootWindow(xfc->display), xfc->_NET_CURRENT_DESKTOP, + 1, &nitems, &bytes, &prop); if (!status) return FALSE; - xfc->current_desktop = (int) * prop; + xfc->current_desktop = (int)*prop; free(prop); return TRUE; } @@ -395,8 +391,8 @@ BOOL xf_GetWorkArea(xfContext* xfc) if (!status) return FALSE; - status = xf_GetWindowProperty(xfc, DefaultRootWindow(xfc->display), - xfc->_NET_WORKAREA, 32 * 4, &nitems, &bytes, &prop); + status = xf_GetWindowProperty(xfc, DefaultRootWindow(xfc->display), xfc->_NET_WORKAREA, 32 * 4, + &nitems, &bytes, &prop); if (!status) return FALSE; @@ -407,7 +403,7 @@ BOOL xf_GetWorkArea(xfContext* xfc) return FALSE; } - plong = (long*) prop; + plong = (long*)prop; xfc->workArea.x = plong[xfc->current_desktop * 4 + 0]; xfc->workArea.y = plong[xfc->current_desktop * 4 + 1]; xfc->workArea.width = plong[xfc->current_desktop * 4 + 2]; @@ -420,13 +416,12 @@ void xf_SetWindowDecorations(xfContext* xfc, Window window, BOOL show) { PropMotifWmHints hints; hints.decorations = (show) ? MWM_DECOR_ALL : 0; - hints.functions = MWM_FUNC_ALL ; + hints.functions = MWM_FUNC_ALL; hints.flags = MWM_HINTS_DECORATIONS | MWM_HINTS_FUNCTIONS; hints.inputMode = 0; hints.status = 0; - XChangeProperty(xfc->display, window, xfc->_MOTIF_WM_HINTS, - xfc->_MOTIF_WM_HINTS, 32, - PropModeReplace, (BYTE*) &hints, PROP_MOTIF_WM_HINTS_ELEMENTS); + XChangeProperty(xfc->display, window, xfc->_MOTIF_WM_HINTS, xfc->_MOTIF_WM_HINTS, 32, + PropModeReplace, (BYTE*)&hints, PROP_MOTIF_WM_HINTS_ELEMENTS); } void xf_SetWindowUnlisted(xfContext* xfc, Window window) @@ -434,8 +429,8 @@ void xf_SetWindowUnlisted(xfContext* xfc, Window window) Atom window_state[2]; window_state[0] = xfc->_NET_WM_STATE_SKIP_PAGER; window_state[1] = xfc->_NET_WM_STATE_SKIP_TASKBAR; - XChangeProperty(xfc->display, window, xfc->_NET_WM_STATE, - XA_ATOM, 32, PropModeReplace, (BYTE*) &window_state, 2); + XChangeProperty(xfc->display, window, xfc->_NET_WM_STATE, XA_ATOM, 32, PropModeReplace, + (BYTE*)&window_state, 2); } static void xf_SetWindowPID(xfContext* xfc, Window window, pid_t pid) @@ -446,22 +441,20 @@ static void xf_SetWindowPID(xfContext* xfc, Window window, pid_t pid) pid = getpid(); am_wm_pid = xfc->_NET_WM_PID; - XChangeProperty(xfc->display, window, am_wm_pid, XA_CARDINAL, - 32, PropModeReplace, (BYTE*) &pid, 1); + XChangeProperty(xfc->display, window, am_wm_pid, XA_CARDINAL, 32, PropModeReplace, (BYTE*)&pid, + 1); } static const char* get_shm_id(void) { static char shm_id[64]; - sprintf_s(shm_id, sizeof(shm_id), "/com.freerdp.xfreerdp.tsmf_%016X", - GetCurrentProcessId()); + sprintf_s(shm_id, sizeof(shm_id), "/com.freerdp.xfreerdp.tsmf_%016X", GetCurrentProcessId()); return shm_id; } Window xf_CreateDummyWindow(xfContext* xfc) { - return XCreateSimpleWindow(xfc->display, DefaultRootWindow(xfc->display), - 0, 0, 1, 1, 0, 0, 0); + return XCreateSimpleWindow(xfc->display, DefaultRootWindow(xfc->display), 0, 0, 1, 1, 0, 0, 0); } void xf_DestroyDummyWindow(xfContext* xfc, Window window) @@ -470,8 +463,7 @@ void xf_DestroyDummyWindow(xfContext* xfc, Window window) XDestroyWindow(xfc->display, window); } -xfWindow* xf_CreateDesktopWindow(xfContext* xfc, char* name, int width, - int height) +xfWindow* xf_CreateDesktopWindow(xfContext* xfc, char* name, int width, int height) { XEvent xevent; int input_mask; @@ -479,25 +471,25 @@ xfWindow* xf_CreateDesktopWindow(xfContext* xfc, char* name, int width, Window parentWindow; XClassHint* classHints; rdpSettings* settings; - window = (xfWindow*) calloc(1, sizeof(xfWindow)); + window = (xfWindow*)calloc(1, sizeof(xfWindow)); if (!window) return NULL; settings = xfc->context.settings; - parentWindow = (Window) xfc->context.settings->ParentWindowId; + parentWindow = (Window)xfc->context.settings->ParentWindowId; window->width = width; window->height = height; window->decorations = xfc->decorations; window->is_mapped = FALSE; window->is_transient = FALSE; - window->handle = XCreateWindow(xfc->display, RootWindowOfScreen(xfc->screen), - xfc->workArea.x, xfc->workArea.y, xfc->workArea.width, xfc->workArea.height, - 0, xfc->depth, InputOutput, xfc->visual, + window->handle = XCreateWindow(xfc->display, RootWindowOfScreen(xfc->screen), xfc->workArea.x, + xfc->workArea.y, xfc->workArea.width, xfc->workArea.height, 0, + xfc->depth, InputOutput, xfc->visual, CWBackPixel | CWBackingStore | CWOverrideRedirect | CWColormap | - CWBorderPixel | CWWinGravity | CWBitGravity, &xfc->attribs); - window->shmid = shm_open(get_shm_id(), (O_CREAT | O_RDWR), - (S_IREAD | S_IWRITE)); + CWBorderPixel | CWWinGravity | CWBitGravity, + &xfc->attribs); + window->shmid = shm_open(get_shm_id(), (O_CREAT | O_RDWR), (S_IREAD | S_IWRITE)); if (window->shmid < 0) { @@ -507,12 +499,12 @@ xfWindow* xf_CreateDesktopWindow(xfContext* xfc, char* name, int width, { void* mem; ftruncate(window->shmid, sizeof(window->handle)); - mem = mmap(0, sizeof(window->handle), PROT_READ | PROT_WRITE, MAP_SHARED, - window->shmid, 0); + mem = mmap(0, sizeof(window->handle), PROT_READ | PROT_WRITE, MAP_SHARED, window->shmid, 0); if (mem == MAP_FAILED) { - DEBUG_X11("xf_CreateDesktopWindow: failed to assign pointer to the memory address - shmat()\n"); + DEBUG_X11("xf_CreateDesktopWindow: failed to assign pointer to the memory address - " + "shmat()\n"); } else { @@ -539,17 +531,15 @@ xfWindow* xf_CreateDesktopWindow(xfContext* xfc, char* name, int width, xf_ResizeDesktopWindow(xfc, window, width, height); xf_SetWindowDecorations(xfc, window->handle, window->decorations); xf_SetWindowPID(xfc, window->handle, 0); - input_mask = - KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | - VisibilityChangeMask | FocusChangeMask | StructureNotifyMask | - PointerMotionMask | ExposureMask | PropertyChangeMask; + input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | + VisibilityChangeMask | FocusChangeMask | StructureNotifyMask | PointerMotionMask | + ExposureMask | PropertyChangeMask; if (xfc->grab_keyboard) input_mask |= EnterWindowMask | LeaveWindowMask; - XChangeProperty(xfc->display, window->handle, xfc->_NET_WM_ICON, XA_CARDINAL, - 32, - PropModeReplace, (BYTE*) xf_icon_prop, ARRAYSIZE(xf_icon_prop)); + XChangeProperty(xfc->display, window->handle, xfc->_NET_WM_ICON, XA_CARDINAL, 32, + PropModeReplace, (BYTE*)xf_icon_prop, ARRAYSIZE(xf_icon_prop)); if (parentWindow) XReparentWindow(xfc->display, window->handle, parentWindow, 0, 0); @@ -567,8 +557,7 @@ xfWindow* xf_CreateDesktopWindow(xfContext* xfc, char* name, int width, do { XMaskEvent(xfc->display, VisibilityChangeMask, &xevent); - } - while (xevent.type != VisibilityNotify); + } while (xevent.type != VisibilityNotify); /* * The XCreateWindow call will start the window in the upper-left corner of our current @@ -581,16 +570,14 @@ xfWindow* xf_CreateDesktopWindow(xfContext* xfc, char* name, int width, } else if (settings->DesktopPosX != UINT32_MAX && settings->DesktopPosY != UINT32_MAX) { - XMoveWindow(xfc->display, window->handle, settings->DesktopPosX, - settings->DesktopPosY); + XMoveWindow(xfc->display, window->handle, settings->DesktopPosX, settings->DesktopPosY); } window->floatbar = xf_floatbar_new(xfc, window->handle, name, settings->Floatbar); return window; } -void xf_ResizeDesktopWindow(xfContext* xfc, xfWindow* window, int width, - int height) +void xf_ResizeDesktopWindow(xfContext* xfc, xfWindow* window, int width, int height) { XSizeHints* size_hints; rdpSettings* settings = NULL; @@ -652,13 +639,12 @@ void xf_DestroyDesktopWindow(xfContext* xfc, xfWindow* window) close(window->shmid); shm_unlink(get_shm_id()); - window->xfwin = (Window*) - 1; + window->xfwin = (Window*)-1; window->shmid = -1; free(window); } -void xf_SetWindowStyle(xfContext* xfc, xfAppWindow* appWindow, UINT32 style, - UINT32 ex_style) +void xf_SetWindowStyle(xfContext* xfc, xfAppWindow* appWindow, UINT32 style, UINT32 ex_style) { Atom window_type; BOOL redirect = FALSE; @@ -671,8 +657,8 @@ void xf_SetWindowStyle(xfContext* xfc, xfAppWindow* appWindow, UINT32 style, window_type = xfc->_NET_WM_WINDOW_TYPE_DROPDOWN_MENU; } /* - * TOPMOST window that is not a tool window is treated like a regular window (i.e. task manager). - * Want to do this here, since the window may have type WS_POPUP + * TOPMOST window that is not a tool window is treated like a regular window (i.e. task + * manager). Want to do this here, since the window may have type WS_POPUP */ else if (ex_style & WS_EX_TOPMOST) { @@ -702,12 +688,11 @@ void xf_SetWindowStyle(xfContext* xfc, xfAppWindow* appWindow, UINT32 style, */ XSetWindowAttributes attrs; attrs.override_redirect = redirect ? True : False; - XChangeWindowAttributes(xfc->display, appWindow->handle, CWOverrideRedirect, - &attrs); + XChangeWindowAttributes(xfc->display, appWindow->handle, CWOverrideRedirect, &attrs); } - XChangeProperty(xfc->display, appWindow->handle, xfc->_NET_WM_WINDOW_TYPE, - XA_ATOM, 32, PropModeReplace, (BYTE*) &window_type, 1); + XChangeProperty(xfc->display, appWindow->handle, xfc->_NET_WM_WINDOW_TYPE, XA_ATOM, 32, + PropModeReplace, (BYTE*)&window_type, 1); } void xf_SetWindowText(xfContext* xfc, xfAppWindow* appWindow, const char* name) @@ -715,8 +700,7 @@ void xf_SetWindowText(xfContext* xfc, xfAppWindow* appWindow, const char* name) xf_SetWindowTitleText(xfc, appWindow->handle, name); } -static void xf_FixWindowCoordinates(xfContext* xfc, int* x, int* y, int* width, - int* height) +static void xf_FixWindowCoordinates(xfContext* xfc, int* x, int* y, int* width, int* height) { int vscreen_width; int vscreen_height; @@ -768,8 +752,7 @@ int xf_AppWindowInit(xfContext* xfc, xfAppWindow* appWindow) XClearWindow(xfc->display, appWindow->handle); XMapWindow(xfc->display, appWindow->handle); /* Move doesn't seem to work until window is mapped. */ - xf_MoveWindow(xfc, appWindow, appWindow->x, appWindow->y, appWindow->width, - appWindow->height); + xf_MoveWindow(xfc, appWindow, appWindow->x, appWindow->y, appWindow->width, appWindow->height); xf_SetWindowText(xfc, appWindow, appWindow->title); return 1; } @@ -789,16 +772,15 @@ int xf_AppWindowCreate(xfContext* xfc, xfAppWindow* appWindow) appWindow->is_transient = FALSE; appWindow->rail_state = 0; appWindow->rail_ignore_configure = FALSE; - appWindow->handle = XCreateWindow(xfc->display, RootWindowOfScreen(xfc->screen), - appWindow->x, appWindow->y, appWindow->width, appWindow->height, - 0, xfc->depth, InputOutput, xfc->visual, 0, &xfc->attribs); + appWindow->handle = XCreateWindow(xfc->display, RootWindowOfScreen(xfc->screen), appWindow->x, + appWindow->y, appWindow->width, appWindow->height, 0, + xfc->depth, InputOutput, xfc->visual, 0, &xfc->attribs); if (!appWindow->handle) return -1; ZeroMemory(&gcv, sizeof(gcv)); - appWindow->gc = XCreateGC(xfc->display, appWindow->handle, GCGraphicsExposures, - &gcv); + appWindow->gc = XCreateGC(xfc->display, appWindow->handle, GCGraphicsExposures, &gcv); class_hints = XAllocClassHint(); if (class_hints) @@ -812,7 +794,7 @@ int xf_AppWindowCreate(xfContext* xfc, xfAppWindow* appWindow) else { class = malloc(sizeof("RAIL:00000000")); - sprintf_s(class, sizeof("RAIL:00000000"), "RAIL:%08"PRIX64"", appWindow->windowId); + sprintf_s(class, sizeof("RAIL:00000000"), "RAIL:%08" PRIX64 "", appWindow->windowId); class_hints->res_class = class; } @@ -829,22 +811,20 @@ int xf_AppWindowCreate(xfContext* xfc, xfAppWindow* appWindow) XSetWMHints(xfc->display, appWindow->handle, InputModeHint); XFree(InputModeHint); XSetWMProtocols(xfc->display, appWindow->handle, &(xfc->WM_DELETE_WINDOW), 1); - input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | - ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | - PointerMotionMask | Button1MotionMask | Button2MotionMask | - Button3MotionMask | Button4MotionMask | Button5MotionMask | - ButtonMotionMask | KeymapStateMask | ExposureMask | - VisibilityChangeMask | StructureNotifyMask | SubstructureNotifyMask | - SubstructureRedirectMask | FocusChangeMask | PropertyChangeMask | - ColormapChangeMask | OwnerGrabButtonMask; + input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | + EnterWindowMask | LeaveWindowMask | PointerMotionMask | Button1MotionMask | + Button2MotionMask | Button3MotionMask | Button4MotionMask | Button5MotionMask | + ButtonMotionMask | KeymapStateMask | ExposureMask | VisibilityChangeMask | + StructureNotifyMask | SubstructureNotifyMask | SubstructureRedirectMask | + FocusChangeMask | PropertyChangeMask | ColormapChangeMask | OwnerGrabButtonMask; XSelectInput(xfc->display, appWindow->handle, input_mask); return 1; } -void xf_SetWindowMinMaxInfo(xfContext* xfc, xfAppWindow* appWindow, - int maxWidth, int maxHeight, int maxPosX, int maxPosY, - int minTrackWidth, int minTrackHeight, int maxTrackWidth, int maxTrackHeight) +void xf_SetWindowMinMaxInfo(xfContext* xfc, xfAppWindow* appWindow, int maxWidth, int maxHeight, + int maxPosX, int maxPosY, int minTrackWidth, int minTrackHeight, + int maxTrackWidth, int maxTrackHeight) { XSizeHints* size_hints; size_hints = XAllocSizeHints(); @@ -852,9 +832,9 @@ void xf_SetWindowMinMaxInfo(xfContext* xfc, xfAppWindow* appWindow, if (size_hints) { size_hints->flags = PMinSize | PMaxSize | PResizeInc; - size_hints->min_width = minTrackWidth; + size_hints->min_width = minTrackWidth; size_hints->min_height = minTrackHeight; - size_hints->max_width = maxTrackWidth; + size_hints->max_width = maxTrackWidth; size_hints->max_height = maxTrackHeight; /* to speedup window drawing we need to select optimal value for sizing step. */ size_hints->width_inc = size_hints->height_inc = 1; @@ -863,29 +843,29 @@ void xf_SetWindowMinMaxInfo(xfContext* xfc, xfAppWindow* appWindow, } } -void xf_StartLocalMoveSize(xfContext* xfc, xfAppWindow* appWindow, - int direction, int x, int y) +void xf_StartLocalMoveSize(xfContext* xfc, xfAppWindow* appWindow, int direction, int x, int y) { if (appWindow->local_move.state != LMS_NOT_ACTIVE) return; /* - * Save original mouse location relative to root. This will be needed - * to end local move to RDP server and/or X server - */ + * Save original mouse location relative to root. This will be needed + * to end local move to RDP server and/or X server + */ appWindow->local_move.root_x = x; appWindow->local_move.root_y = y; appWindow->local_move.state = LMS_STARTING; appWindow->local_move.direction = direction; XUngrabPointer(xfc->display, CurrentTime); - xf_SendClientEvent(xfc, appWindow->handle, - xfc->_NET_WM_MOVERESIZE, /* request X window manager to initiate a local move */ - 5, /* 5 arguments to follow */ - x, /* x relative to root window */ - y, /* y relative to root window */ - direction, /* extended ICCM direction flag */ - 1, /* simulated mouse button 1 */ - 1); /* 1 == application request per extended ICCM */ + xf_SendClientEvent( + xfc, appWindow->handle, + xfc->_NET_WM_MOVERESIZE, /* request X window manager to initiate a local move */ + 5, /* 5 arguments to follow */ + x, /* x relative to root window */ + y, /* y relative to root window */ + direction, /* extended ICCM direction flag */ + 1, /* simulated mouse button 1 */ + 1); /* 1 == application request per extended ICCM */ } void xf_EndLocalMoveSize(xfContext* xfc, xfAppWindow* appWindow) @@ -901,21 +881,21 @@ void xf_EndLocalMoveSize(xfContext* xfc, xfAppWindow* appWindow) * RDP server for local moves. We must cancel the X window manager move. * Per ICCM, the X client can ask to cancel an active move. */ - xf_SendClientEvent(xfc, appWindow->handle, - xfc->_NET_WM_MOVERESIZE, /* request X window manager to abort a local move */ - 5, /* 5 arguments to follow */ - appWindow->local_move.root_x, /* x relative to root window */ - appWindow->local_move.root_y, /* y relative to root window */ - _NET_WM_MOVERESIZE_CANCEL, /* extended ICCM direction flag */ - 1, /* simulated mouse button 1 */ - 1); /* 1 == application request per extended ICCM */ + xf_SendClientEvent( + xfc, appWindow->handle, + xfc->_NET_WM_MOVERESIZE, /* request X window manager to abort a local move */ + 5, /* 5 arguments to follow */ + appWindow->local_move.root_x, /* x relative to root window */ + appWindow->local_move.root_y, /* y relative to root window */ + _NET_WM_MOVERESIZE_CANCEL, /* extended ICCM direction flag */ + 1, /* simulated mouse button 1 */ + 1); /* 1 == application request per extended ICCM */ } appWindow->local_move.state = LMS_NOT_ACTIVE; } -void xf_MoveWindow(xfContext* xfc, xfAppWindow* appWindow, int x, int y, - int width, int height) +void xf_MoveWindow(xfContext* xfc, xfAppWindow* appWindow, int x, int y, int width, int height) { BOOL resize = FALSE; @@ -925,8 +905,7 @@ void xf_MoveWindow(xfContext* xfc, xfAppWindow* appWindow, int x, int y, if ((appWindow->width != width) || (appWindow->height != height)) resize = TRUE; - if (appWindow->local_move.state == LMS_STARTING || - appWindow->local_move.state == LMS_ACTIVE) + if (appWindow->local_move.state == LMS_STARTING || appWindow->local_move.state == LMS_ACTIVE) return; appWindow->x = x; @@ -956,16 +935,17 @@ void xf_ShowWindow(xfContext* xfc, xfAppWindow* appWindow, BYTE state) case WINDOW_SHOW_MAXIMIZED: /* Set the window as maximized */ - xf_SendClientEvent(xfc, appWindow->handle, xfc->_NET_WM_STATE, 4, - _NET_WM_STATE_ADD, - xfc->_NET_WM_STATE_MAXIMIZED_VERT, - xfc->_NET_WM_STATE_MAXIMIZED_HORZ, 0); + xf_SendClientEvent(xfc, appWindow->handle, xfc->_NET_WM_STATE, 4, _NET_WM_STATE_ADD, + xfc->_NET_WM_STATE_MAXIMIZED_VERT, xfc->_NET_WM_STATE_MAXIMIZED_HORZ, + 0); /* - * This is a workaround for the case where the window is maximized locally before the rail server is told to maximize - * the window, this appears to be a race condition where the local window with incomplete data and once the window is - * actually maximized on the server - an update of the new areas may not happen. So, we simply to do a full update of - * the entire window once the rail server notifies us that the window is now maximized. + * This is a workaround for the case where the window is maximized locally before the + * rail server is told to maximize the window, this appears to be a race condition where + * the local window with incomplete data and once the window is actually maximized on + * the server + * - an update of the new areas may not happen. So, we simply to do a full update of the + * entire window once the rail server notifies us that the window is now maximized. */ if (appWindow->rail_state == WINDOW_SHOW_MAXIMIZED) { @@ -977,16 +957,15 @@ void xf_ShowWindow(xfContext* xfc, xfAppWindow* appWindow, BYTE state) case WINDOW_SHOW: /* Ensure the window is not maximized */ - xf_SendClientEvent(xfc, appWindow->handle, xfc->_NET_WM_STATE, 4, - _NET_WM_STATE_REMOVE, - xfc->_NET_WM_STATE_MAXIMIZED_VERT, - xfc->_NET_WM_STATE_MAXIMIZED_HORZ, 0); + xf_SendClientEvent(xfc, appWindow->handle, xfc->_NET_WM_STATE, 4, _NET_WM_STATE_REMOVE, + xfc->_NET_WM_STATE_MAXIMIZED_VERT, xfc->_NET_WM_STATE_MAXIMIZED_HORZ, + 0); /* * Ignore configure requests until both the Maximized properties have been processed - * to prevent condition where WM overrides size of request due to one or both of these properties - * still being set - which causes a position adjustment to be sent back to the server - * thus causing the window to not return to its original size + * to prevent condition where WM overrides size of request due to one or both of these + * properties still being set - which causes a position adjustment to be sent back to + * the server thus causing the window to not return to its original size */ if (appWindow->rail_state == WINDOW_SHOW_MAXIMIZED) appWindow->rail_ignore_configure = TRUE; @@ -1003,8 +982,7 @@ void xf_ShowWindow(xfContext* xfc, xfAppWindow* appWindow, BYTE state) XFlush(xfc->display); } -void xf_SetWindowRects(xfContext* xfc, xfAppWindow* appWindow, - RECTANGLE_16* rects, int nrects) +void xf_SetWindowRects(xfContext* xfc, xfAppWindow* appWindow, RECTANGLE_16* rects, int nrects) { int i; XRectangle* xrects; @@ -1013,7 +991,7 @@ void xf_SetWindowRects(xfContext* xfc, xfAppWindow* appWindow, return; #ifdef WITH_XEXT - xrects = (XRectangle*) calloc(nrects, sizeof(XRectangle)); + xrects = (XRectangle*)calloc(nrects, sizeof(XRectangle)); for (i = 0; i < nrects; i++) { @@ -1023,14 +1001,14 @@ void xf_SetWindowRects(xfContext* xfc, xfAppWindow* appWindow, xrects[i].height = rects[i].bottom - rects[i].top; } - XShapeCombineRectangles(xfc->display, appWindow->handle, ShapeBounding, 0, 0, - xrects, nrects, ShapeSet, 0); + XShapeCombineRectangles(xfc->display, appWindow->handle, ShapeBounding, 0, 0, xrects, nrects, + ShapeSet, 0); free(xrects); #endif } -void xf_SetWindowVisibilityRects(xfContext* xfc, xfAppWindow* appWindow, - UINT32 rectsOffsetX, UINT32 rectsOffsetY, RECTANGLE_16* rects, int nrects) +void xf_SetWindowVisibilityRects(xfContext* xfc, xfAppWindow* appWindow, UINT32 rectsOffsetX, + UINT32 rectsOffsetY, RECTANGLE_16* rects, int nrects) { int i; XRectangle* xrects; @@ -1039,7 +1017,7 @@ void xf_SetWindowVisibilityRects(xfContext* xfc, xfAppWindow* appWindow, return; #ifdef WITH_XEXT - xrects = (XRectangle*) calloc(nrects, sizeof(XRectangle)); + xrects = (XRectangle*)calloc(nrects, sizeof(XRectangle)); for (i = 0; i < nrects; i++) { @@ -1049,14 +1027,14 @@ void xf_SetWindowVisibilityRects(xfContext* xfc, xfAppWindow* appWindow, xrects[i].height = rects[i].bottom - rects[i].top; } - XShapeCombineRectangles(xfc->display, appWindow->handle, ShapeBounding, - rectsOffsetX, rectsOffsetY, xrects, nrects, ShapeSet, 0); + XShapeCombineRectangles(xfc->display, appWindow->handle, ShapeBounding, rectsOffsetX, + rectsOffsetY, xrects, nrects, ShapeSet, 0); free(xrects); #endif } -void xf_UpdateWindowArea(xfContext* xfc, xfAppWindow* appWindow, int x, int y, - int width, int height) +void xf_UpdateWindowArea(xfContext* xfc, xfAppWindow* appWindow, int x, int y, int width, + int height) { int ax, ay; @@ -1079,12 +1057,12 @@ void xf_UpdateWindowArea(xfContext* xfc, xfAppWindow* appWindow, int x, int y, if (xfc->context.settings->SoftwareGdi) { - XPutImage(xfc->display, xfc->primary, appWindow->gc, xfc->image, - ax, ay, ax, ay, width, height); + XPutImage(xfc->display, xfc->primary, appWindow->gc, xfc->image, ax, ay, ax, ay, width, + height); } - XCopyArea(xfc->display, xfc->primary, appWindow->handle, appWindow->gc, - ax, ay, width, height, x, y); + XCopyArea(xfc->display, xfc->primary, appWindow->handle, appWindow->gc, ax, ay, width, height, + x, y); XFlush(xfc->display); xf_unlock_x11(xfc, TRUE); } @@ -1110,7 +1088,7 @@ void xf_DestroyWindow(xfContext* xfc, xfAppWindow* appWindow) close(appWindow->shmid); shm_unlink(get_shm_id()); - appWindow->xfwin = (Window*) - 1; + appWindow->xfwin = (Window*)-1; appWindow->shmid = -1; free(appWindow->title); free(appWindow->windowRects); diff --git a/client/X11/xf_window.h b/client/X11/xf_window.h index 6e4b90966..3adaa3c7f 100644 --- a/client/X11/xf_window.h +++ b/client/X11/xf_window.h @@ -34,21 +34,21 @@ typedef struct xf_window xfWindow; #include "xfreerdp.h" // Extended ICCM flags http://standards.freedesktop.org/wm-spec/wm-spec-latest.html -#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0 -#define _NET_WM_MOVERESIZE_SIZE_TOP 1 -#define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2 -#define _NET_WM_MOVERESIZE_SIZE_RIGHT 3 -#define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4 -#define _NET_WM_MOVERESIZE_SIZE_BOTTOM 5 -#define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6 -#define _NET_WM_MOVERESIZE_SIZE_LEFT 7 -#define _NET_WM_MOVERESIZE_MOVE 8 /* movement only */ -#define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9 /* size via keyboard */ -#define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 /* move via keyboard */ -#define _NET_WM_MOVERESIZE_CANCEL 11 /* cancel operation */ +#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0 +#define _NET_WM_MOVERESIZE_SIZE_TOP 1 +#define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2 +#define _NET_WM_MOVERESIZE_SIZE_RIGHT 3 +#define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4 +#define _NET_WM_MOVERESIZE_SIZE_BOTTOM 5 +#define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6 +#define _NET_WM_MOVERESIZE_SIZE_LEFT 7 +#define _NET_WM_MOVERESIZE_MOVE 8 /* movement only */ +#define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9 /* size via keyboard */ +#define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 /* move via keyboard */ +#define _NET_WM_MOVERESIZE_CANCEL 11 /* cancel operation */ #define _NET_WM_STATE_REMOVE 0 /* remove/unset property */ -#define _NET_WM_STATE_ADD 1 /* add/set property */ +#define _NET_WM_STATE_ADD 1 /* add/set property */ #define _NET_WM_STATE_TOGGLE 2 /* toggle property */ enum xf_localmove_state @@ -166,7 +166,7 @@ int xf_AppWindowInit(xfContext* xfc, xfAppWindow* appWindow); void xf_SetWindowText(xfContext* xfc, xfAppWindow* appWindow, const char* name); void xf_MoveWindow(xfContext* xfc, xfAppWindow* appWindow, int x, int y, int width, int height); void xf_ShowWindow(xfContext* xfc, xfAppWindow* appWindow, BYTE state); -//void xf_SetWindowIcon(xfContext* xfc, xfAppWindow* appWindow, rdpIcon* icon); +// void xf_SetWindowIcon(xfContext* xfc, xfAppWindow* appWindow, rdpIcon* icon); void xf_SetWindowRects(xfContext* xfc, xfAppWindow* appWindow, RECTANGLE_16* rects, int nrects); void xf_SetWindowVisibilityRects(xfContext* xfc, xfAppWindow* appWindow, UINT32 rectsOffsetX, UINT32 rectsOffsetY, RECTANGLE_16* rects, int nrects); @@ -174,9 +174,9 @@ void xf_SetWindowStyle(xfContext* xfc, xfAppWindow* appWindow, UINT32 style, UIN void xf_UpdateWindowArea(xfContext* xfc, xfAppWindow* appWindow, int x, int y, int width, int height); void xf_DestroyWindow(xfContext* xfc, xfAppWindow* appWindow); -void xf_SetWindowMinMaxInfo(xfContext* xfc, xfAppWindow* appWindow, - int maxWidth, int maxHeight, int maxPosX, int maxPosY, - int minTrackWidth, int minTrackHeight, int maxTrackWidth, int maxTrackHeight); +void xf_SetWindowMinMaxInfo(xfContext* xfc, xfAppWindow* appWindow, int maxWidth, int maxHeight, + int maxPosX, int maxPosY, int minTrackWidth, int minTrackHeight, + int maxTrackWidth, int maxTrackHeight); void xf_StartLocalMoveSize(xfContext* xfc, xfAppWindow* appWindow, int direction, int x, int y); void xf_EndLocalMoveSize(xfContext* xfc, xfAppWindow* appWindow); xfAppWindow* xf_AppWindowFromX11Window(xfContext* xfc, Window wnd); diff --git a/client/X11/xfreerdp.h b/client/X11/xfreerdp.h index fc3005cd3..31bb8dc4c 100644 --- a/client/X11/xfreerdp.h +++ b/client/X11/xfreerdp.h @@ -295,4 +295,3 @@ void xf_draw_screen(xfContext* xfc, int x, int y, int w, int h); FREERDP_API DWORD xf_exit_code_from_disconnect_reason(DWORD reason); #endif /* FREERDP_CLIENT_X11_FREERDP_H */ - diff --git a/client/common/client.c b/client/common/client.c index 47355c34d..ed96c8138 100644 --- a/client/common/client.c +++ b/client/common/client.c @@ -68,8 +68,7 @@ rdpContext* freerdp_client_context_new(RDP_CLIENT_ENTRY_POINTS* pEntryPoints) instance->ContextSize = pEntryPoints->ContextSize; instance->ContextNew = freerdp_client_common_new; instance->ContextFree = freerdp_client_common_free; - instance->pClientEntryPoints = (RDP_CLIENT_ENTRY_POINTS*) malloc( - pEntryPoints->Size); + instance->pClientEntryPoints = (RDP_CLIENT_ENTRY_POINTS*)malloc(pEntryPoints->Size); if (!instance->pClientEntryPoints) goto out_fail; @@ -83,8 +82,8 @@ rdpContext* freerdp_client_context_new(RDP_CLIENT_ENTRY_POINTS* pEntryPoints) context->instance = instance; context->settings = instance->settings; - if (freerdp_register_addin_provider(freerdp_channels_load_static_addin_entry, - 0) != CHANNEL_RC_OK) + if (freerdp_register_addin_provider(freerdp_channels_load_static_addin_entry, 0) != + CHANNEL_RC_OK) goto out_fail2; return context; @@ -152,7 +151,7 @@ HANDLE freerdp_client_get_thread(rdpContext* context) if (!context) return NULL; - return ((rdpClientContext*) context)->thread; + return ((rdpClientContext*)context)->thread; } static BOOL freerdp_client_settings_post_process(rdpSettings* settings) @@ -212,9 +211,8 @@ out_error: return FALSE; } - -int freerdp_client_settings_parse_command_line(rdpSettings* settings, int argc, - char** argv, BOOL allowUnknown) +int freerdp_client_settings_parse_command_line(rdpSettings* settings, int argc, char** argv, + BOOL allowUnknown) { int status; @@ -224,8 +222,8 @@ int freerdp_client_settings_parse_command_line(rdpSettings* settings, int argc, if (!argv) return -1; - status = freerdp_client_settings_parse_command_line_arguments(settings, argc, - argv, allowUnknown); + status = + freerdp_client_settings_parse_command_line_arguments(settings, argc, argv, allowUnknown); if (status < 0) return status; @@ -238,8 +236,7 @@ int freerdp_client_settings_parse_command_line(rdpSettings* settings, int argc, return status; } -int freerdp_client_settings_parse_connection_file(rdpSettings* settings, - const char* filename) +int freerdp_client_settings_parse_connection_file(rdpSettings* settings, const char* filename) { rdpFile* file; int ret = -1; @@ -260,8 +257,8 @@ out: return ret; } -int freerdp_client_settings_parse_connection_file_buffer(rdpSettings* settings, - const BYTE* buffer, size_t size) +int freerdp_client_settings_parse_connection_file_buffer(rdpSettings* settings, const BYTE* buffer, + size_t size) { rdpFile* file; int status = -1; @@ -270,8 +267,8 @@ int freerdp_client_settings_parse_connection_file_buffer(rdpSettings* settings, if (!file) return -1; - if (freerdp_client_parse_rdp_file_buffer(file, buffer, size) - && freerdp_client_populate_settings_from_rdp_file(file, settings)) + if (freerdp_client_parse_rdp_file_buffer(file, buffer, size) && + freerdp_client_populate_settings_from_rdp_file(file, settings)) { status = 0; } @@ -280,8 +277,8 @@ int freerdp_client_settings_parse_connection_file_buffer(rdpSettings* settings, return status; } -int freerdp_client_settings_write_connection_file(const rdpSettings* settings, - const char* filename, BOOL unicode) +int freerdp_client_settings_write_connection_file(const rdpSettings* settings, const char* filename, + BOOL unicode) { rdpFile* file; int ret = -1; @@ -302,8 +299,7 @@ out: return ret; } -int freerdp_client_settings_parse_assistance_file(rdpSettings* settings, - int argc, char* argv[]) +int freerdp_client_settings_parse_assistance_file(rdpSettings* settings, int argc, char* argv[]) { int status, x; int ret = -1; @@ -349,29 +345,19 @@ out: * @see rdp_server_accept_nego() and rdp_check_fds() * @param instance - pointer to the rdp_freerdp structure that contains the connection settings * @param username - unused - * @param password - on return: pointer to a character string that will be filled by the password entered by the user. - * Note that this character string will be allocated inside the function, and needs to be deallocated by the caller - * using free(), even in case this function fails. + * @param password - on return: pointer to a character string that will be filled by the password + * entered by the user. Note that this character string will be allocated inside the function, and + * needs to be deallocated by the caller using free(), even in case this function fails. * @param domain - unused - * @return TRUE if a password was successfully entered. See freerdp_passphrase_read() for more details. + * @return TRUE if a password was successfully entered. See freerdp_passphrase_read() for more + * details. */ -static BOOL client_cli_authenticate_raw(freerdp* instance, BOOL gateway, - char** username, +static BOOL client_cli_authenticate_raw(freerdp* instance, BOOL gateway, char** username, char** password, char** domain) { static const size_t password_size = 512; - const char* auth[] = - { - "Username: ", - "Domain: ", - "Password: " - }; - const char* gw[] = - { - "GatewayUsername: ", - "GatewayDomain: ", - "GatewayPassword: " - }; + const char* auth[] = { "Username: ", "Domain: ", "Password: " }; + const char* gw[] = { "GatewayUsername: ", "GatewayDomain: ", "GatewayPassword: " }; const char** prompt = (gateway) ? gw : auth; if (!username || !password || !domain) @@ -436,8 +422,7 @@ fail: return FALSE; } -BOOL client_cli_authenticate(freerdp* instance, char** username, - char** password, char** domain) +BOOL client_cli_authenticate(freerdp* instance, char** username, char** password, char** domain) { if (instance->settings->SmartcardLogon) { @@ -448,8 +433,7 @@ BOOL client_cli_authenticate(freerdp* instance, char** username, return client_cli_authenticate_raw(instance, FALSE, username, password, domain); } -BOOL client_cli_gw_authenticate(freerdp* instance, char** username, - char** password, char** domain) +BOOL client_cli_gw_authenticate(freerdp* instance, char** username, char** password, char** domain) { return client_cli_authenticate_raw(instance, TRUE, username, password, domain); } @@ -515,9 +499,8 @@ static DWORD client_cli_accept_certificate(rdpSettings* settings) * @param host_mismatch Indicates the certificate host does not match. * @return 1 if the certificate is trusted, 2 if temporary trusted, 0 otherwise. */ -DWORD client_cli_verify_certificate(freerdp* instance, const char* common_name, - const char* subject, const char* issuer, - const char* fingerprint, BOOL host_mismatch) +DWORD client_cli_verify_certificate(freerdp* instance, const char* common_name, const char* subject, + const char* issuer, const char* fingerprint, BOOL host_mismatch) { WINPR_UNUSED(common_name); WINPR_UNUSED(host_mismatch); @@ -549,9 +532,8 @@ DWORD client_cli_verify_certificate(freerdp* instance, const char* common_name, * @return 1 if the certificate is trusted, 2 if temporary trusted, 0 otherwise. */ DWORD client_cli_verify_certificate_ex(freerdp* instance, const char* host, UINT16 port, - const char* common_name, - const char* subject, const char* issuer, - const char* fingerprint, DWORD flags) + const char* common_name, const char* subject, + const char* issuer, const char* fingerprint, DWORD flags) { const char* type = "RDP-Server"; @@ -561,7 +543,7 @@ DWORD client_cli_verify_certificate_ex(freerdp* instance, const char* host, UINT if (flags & VERIFY_CERT_FLAG_REDIRECT) type = "RDP-Redirect"; - printf("Certificate details for %s:%"PRIu16" (%s):\n", host, port, type); + printf("Certificate details for %s:%" PRIu16 " (%s):\n", host, port, type); printf("\tCommon Name: %s\n", common_name); printf("\tSubject: %s\n", subject); printf("\tIssuer: %s\n", issuer); @@ -587,16 +569,15 @@ DWORD client_cli_verify_certificate_ex(freerdp* instance, const char* host, UINT * @param old_fingerprint * @return 1 if the certificate is trusted, 2 if temporary trusted, 0 otherwise. */ -DWORD client_cli_verify_changed_certificate(freerdp* instance, - const char* common_name, - const char* subject, const char* issuer, - const char* fingerprint, - const char* old_subject, const char* old_issuer, - const char* old_fingerprint) +DWORD client_cli_verify_changed_certificate(freerdp* instance, const char* common_name, + const char* subject, const char* issuer, + const char* fingerprint, const char* old_subject, + const char* old_issuer, const char* old_fingerprint) { WINPR_UNUSED(common_name); - printf("WARNING: This callback is deprecated, migrate to client_cli_verify_changed_certificate_ex\n"); + printf("WARNING: This callback is deprecated, migrate to " + "client_cli_verify_changed_certificate_ex\n"); printf("!!! Certificate has changed !!!\n"); printf("\n"); printf("New Certificate details:\n"); @@ -609,7 +590,8 @@ DWORD client_cli_verify_changed_certificate(freerdp* instance, printf("\tIssuer: %s\n", old_issuer); printf("\tThumbprint: %s\n", old_fingerprint); printf("\n"); - printf("The above X.509 certificate does not match the certificate used for previous connections.\n" + printf("The above X.509 certificate does not match the certificate used for previous " + "connections.\n" "This may indicate that the certificate has been tampered with.\n" "Please contact the administrator of the RDP server and clarify.\n"); return client_cli_accept_certificate(instance->settings); @@ -619,7 +601,8 @@ DWORD client_cli_verify_changed_certificate(freerdp* instance, * when a stored certificate does not match the remote counterpart. * This function will actually be called by tls_verify_certificate(). * @see rdp_client_connect() and tls_connect() - * @param instance pointer to the rdp_freerdp structure that contains the connection settings + * @param instance pointer to the rdp_freerdp structure that contains the connection + * settings * @param host The host currently connecting to * @param port The port currently connecting to * @param common_name The common name of the certificate, should match host or an alias of it @@ -633,13 +616,11 @@ DWORD client_cli_verify_changed_certificate(freerdp* instance, * * @return 1 if the certificate is trusted, 2 if temporary trusted, 0 otherwise. */ -DWORD client_cli_verify_changed_certificate_ex(freerdp* instance, - const char* host, UINT16 port, - const char* common_name, - const char* subject, const char* issuer, - const char* fingerprint, - const char* old_subject, const char* old_issuer, - const char* old_fingerprint, DWORD flags) +DWORD client_cli_verify_changed_certificate_ex(freerdp* instance, const char* host, UINT16 port, + const char* common_name, const char* subject, + const char* issuer, const char* fingerprint, + const char* old_subject, const char* old_issuer, + const char* old_fingerprint, DWORD flags) { const char* type = "RDP-Server"; @@ -649,7 +630,7 @@ DWORD client_cli_verify_changed_certificate_ex(freerdp* instance, if (flags & VERIFY_CERT_FLAG_REDIRECT) type = "RDP-Redirect"; - printf("!!!Certificate for %s:%"PRIu16" (%s) has changed!!!\n", host, port, type); + printf("!!!Certificate for %s:%" PRIu16 " (%s) has changed!!!\n", host, port, type); printf("\n"); printf("New Certificate details:\n"); printf("\tCommon Name: %s\n", common_name); @@ -662,7 +643,8 @@ DWORD client_cli_verify_changed_certificate_ex(freerdp* instance, printf("\tIssuer: %s\n", old_issuer); printf("\tThumbprint: %s\n", old_fingerprint); printf("\n"); - printf("The above X.509 certificate does not match the certificate used for previous connections.\n" + printf("The above X.509 certificate does not match the certificate used for previous " + "connections.\n" "This may indicate that the certificate has been tampered with.\n" "Please contact the administrator of the RDP server and clarify.\n"); return client_cli_accept_certificate(instance->settings); @@ -673,7 +655,7 @@ BOOL client_auto_reconnect(freerdp* instance) return client_auto_reconnect_ex(instance, NULL); } -BOOL client_auto_reconnect_ex(freerdp* instance, BOOL(*window_events)(freerdp* instance)) +BOOL client_auto_reconnect_ex(freerdp* instance, BOOL (*window_events)(freerdp* instance)) { UINT32 maxRetries; UINT32 numRetries = 0; @@ -710,7 +692,7 @@ BOOL client_auto_reconnect_ex(freerdp* instance, BOOL(*window_events)(freerdp* i } /* Attempt the next reconnect */ - WLog_INFO(TAG, "Attempting reconnect (%"PRIu32" of %"PRIu32")", numRetries, maxRetries); + WLog_INFO(TAG, "Attempting reconnect (%" PRIu32 " of %" PRIu32 ")", numRetries, maxRetries); if (freerdp_reconnect(instance)) return TRUE; @@ -727,5 +709,3 @@ BOOL client_auto_reconnect_ex(freerdp* instance, BOOL(*window_events)(freerdp* i WLog_ERR(TAG, "Maximum reconnect retries exceeded"); return FALSE; } - - diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 39027ee90..71b8c2a0f 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -57,8 +57,10 @@ static BOOL freerdp_path_valid(const char* path, BOOL* special) return FALSE; isSpecial = (strncmp(path, "*", 2) == 0) || - (strncmp(path, DynamicDrives, sizeof(DynamicDrives)) == 0) || - (strncmp(path, "%", 2) == 0) ? TRUE : FALSE; + (strncmp(path, DynamicDrives, sizeof(DynamicDrives)) == 0) || + (strncmp(path, "%", 2) == 0) + ? TRUE + : FALSE; if (!isSpecial) isPath = PathFileExistsA(path); @@ -75,13 +77,13 @@ static BOOL freerdp_sanitize_drive_name(char* name, const char* invalid, const c if (strlen(invalid) != strlen(replacement)) return FALSE; - while(*invalid != '\0') + while (*invalid != '\0') { const char what = *invalid++; const char with = *replacement++; char* cur = name; - while((cur = strchr(cur, what)) != NULL) + while ((cur = strchr(cur, what)) != NULL) *cur = with; } return TRUE; @@ -91,7 +93,7 @@ static BOOL freerdp_client_add_drive(rdpSettings* settings, const char* path, co { RDPDR_DRIVE* drive; - drive = (RDPDR_DRIVE*) calloc(1, sizeof(RDPDR_DRIVE)); + drive = (RDPDR_DRIVE*)calloc(1, sizeof(RDPDR_DRIVE)); if (!drive) return FALSE; @@ -118,8 +120,8 @@ static BOOL freerdp_client_add_drive(rdpSettings* settings, const char* path, co goto fail; } else /* We need a name to send to the server. */ - if (!(drive->Name = _strdup(path))) - goto fail; + if (!(drive->Name = _strdup(path))) + goto fail; if (!path || !freerdp_sanitize_drive_name(drive->Name, "\\/", "__")) goto fail; @@ -132,7 +134,7 @@ static BOOL freerdp_client_add_drive(rdpSettings* settings, const char* path, co goto fail; } - if (!freerdp_device_collection_add(settings, (RDPDR_DEVICE*) drive)) + if (!freerdp_device_collection_add(settings, (RDPDR_DEVICE*)drive)) goto fail; return TRUE; @@ -196,8 +198,7 @@ static BOOL value_to_uint(const char* value, ULONGLONG* result, ULONGLONG min, U BOOL freerdp_client_print_version(void) { - printf("This is FreeRDP version %s (%s)\n", FREERDP_VERSION_FULL, - GIT_REVISION); + printf("This is FreeRDP version %s (%s)\n", FREERDP_VERSION_FULL, GIT_REVISION); return TRUE; } @@ -210,8 +211,8 @@ BOOL freerdp_client_print_buildconfig(void) static char* print_token(char* text, size_t start_offset, size_t* current, size_t limit, const char delimiter) { - int rc; - size_t len = strlen(text); + int rc; + size_t len = strlen(text); if (*current < start_offset) { @@ -271,7 +272,7 @@ static size_t print_description(const char* text, size_t start_offset, size_t cu } free(str); - current += (size_t) printf("\n"); + current += (size_t)printf("\n"); return current; } @@ -295,8 +296,8 @@ static void freerdp_client_print_command_line_args(COMMAND_LINE_ARGUMENT_A* arg) return; pos += (size_t)rc; - if ((arg->Flags & COMMAND_LINE_VALUE_REQUIRED) - || (arg->Flags & COMMAND_LINE_VALUE_OPTIONAL)) + if ((arg->Flags & COMMAND_LINE_VALUE_REQUIRED) || + (arg->Flags & COMMAND_LINE_VALUE_OPTIONAL)) { if (arg->Format) { @@ -343,8 +344,7 @@ static void freerdp_client_print_command_line_args(COMMAND_LINE_ARGUMENT_A* arg) } print_description(arg->Text, description_offset, pos); - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); } BOOL freerdp_client_print_command_line_help(int argc, char** argv) @@ -353,7 +353,7 @@ BOOL freerdp_client_print_command_line_help(int argc, char** argv) } BOOL freerdp_client_print_command_line_help_ex(int argc, char** argv, - COMMAND_LINE_ARGUMENT_A* custom) + COMMAND_LINE_ARGUMENT_A* custom) { const char* name = "FreeRDP"; COMMAND_LINE_ARGUMENT_A largs[ARRAYSIZE(args)]; @@ -380,7 +380,8 @@ BOOL freerdp_client_print_command_line_help_ex(int argc, char** argv, printf(" %s connection.rdp /p:Pwd123! /f\n", name); printf(" %s /u:CONTOSO\\JohnDoe /p:Pwd123! /v:rdp.contoso.com\n", name); printf(" %s /u:JohnDoe /p:Pwd123! /w:1366 /h:768 /v:192.168.1.100:4489\n", name); - printf(" %s /u:JohnDoe /p:Pwd123! /vmconnect:C824F53E-95D2-46C6-9A18-23A5BB403532 /v:192.168.1.100\n", + printf(" %s /u:JohnDoe /p:Pwd123! /vmconnect:C824F53E-95D2-46C6-9A18-23A5BB403532 " + "/v:192.168.1.100\n", name); printf("\n"); printf("Clipboard Redirection: +clipboard\n"); @@ -415,8 +416,7 @@ BOOL freerdp_client_print_command_line_help_ex(int argc, char** argv, return TRUE; } -static int freerdp_client_command_line_pre_filter(void* context, int index, - int argc, LPSTR* argv) +static int freerdp_client_command_line_pre_filter(void* context, int index, int argc, LPSTR* argv) { if (index == 1) { @@ -432,7 +432,7 @@ static int freerdp_client_command_line_pre_filter(void* context, int index, { if (_stricmp(&(argv[index])[length - 4], ".rdp") == 0) { - settings = (rdpSettings*) context; + settings = (rdpSettings*)context; if (!copy_value(argv[index], &settings->ConnectionFile)) return COMMAND_LINE_ERROR_MEMORY; @@ -445,7 +445,7 @@ static int freerdp_client_command_line_pre_filter(void* context, int index, { if (_stricmp(&(argv[index])[length - 13], ".msrcIncident") == 0) { - settings = (rdpSettings*) context; + settings = (rdpSettings*)context; if (!copy_value(argv[index], &settings->AssistanceFile)) return COMMAND_LINE_ERROR_MEMORY; @@ -458,9 +458,7 @@ static int freerdp_client_command_line_pre_filter(void* context, int index, return 0; } - -BOOL freerdp_client_add_device_channel(rdpSettings* settings, size_t count, - char** params) +BOOL freerdp_client_add_device_channel(rdpSettings* settings, size_t count, char** params) { if (strcmp(params[0], "drive") == 0) { @@ -488,7 +486,7 @@ BOOL freerdp_client_add_device_channel(rdpSettings* settings, size_t count, if (count > 1) { - printer = (RDPDR_PRINTER*) calloc(1, sizeof(RDPDR_PRINTER)); + printer = (RDPDR_PRINTER*)calloc(1, sizeof(RDPDR_PRINTER)); if (!printer) return FALSE; @@ -511,7 +509,7 @@ BOOL freerdp_client_add_device_channel(rdpSettings* settings, size_t count, } } - if (!freerdp_device_collection_add(settings, (RDPDR_DEVICE*) printer)) + if (!freerdp_device_collection_add(settings, (RDPDR_DEVICE*)printer)) { free(printer->DriverName); free(printer->Name); @@ -531,7 +529,7 @@ BOOL freerdp_client_add_device_channel(rdpSettings* settings, size_t count, settings->RedirectSmartCards = TRUE; settings->DeviceRedirection = TRUE; - smartcard = (RDPDR_SMARTCARD*) calloc(1, sizeof(RDPDR_SMARTCARD)); + smartcard = (RDPDR_SMARTCARD*)calloc(1, sizeof(RDPDR_SMARTCARD)); if (!smartcard) return FALSE; @@ -547,7 +545,7 @@ BOOL freerdp_client_add_device_channel(rdpSettings* settings, size_t count, } } - if (!freerdp_device_collection_add(settings, (RDPDR_DEVICE*) smartcard)) + if (!freerdp_device_collection_add(settings, (RDPDR_DEVICE*)smartcard)) { free(smartcard->Name); free(smartcard); @@ -565,7 +563,7 @@ BOOL freerdp_client_add_device_channel(rdpSettings* settings, size_t count, settings->RedirectSerialPorts = TRUE; settings->DeviceRedirection = TRUE; - serial = (RDPDR_SERIAL*) calloc(1, sizeof(RDPDR_SERIAL)); + serial = (RDPDR_SERIAL*)calloc(1, sizeof(RDPDR_SERIAL)); if (!serial) return FALSE; @@ -614,7 +612,7 @@ BOOL freerdp_client_add_device_channel(rdpSettings* settings, size_t count, } } - if (!freerdp_device_collection_add(settings, (RDPDR_DEVICE*) serial)) + if (!freerdp_device_collection_add(settings, (RDPDR_DEVICE*)serial)) { free(serial->Permissive); free(serial->Driver); @@ -635,7 +633,7 @@ BOOL freerdp_client_add_device_channel(rdpSettings* settings, size_t count, settings->RedirectParallelPorts = TRUE; settings->DeviceRedirection = TRUE; - parallel = (RDPDR_PARALLEL*) calloc(1, sizeof(RDPDR_PARALLEL)); + parallel = (RDPDR_PARALLEL*)calloc(1, sizeof(RDPDR_PARALLEL)); if (!parallel) return FALSE; @@ -661,7 +659,7 @@ BOOL freerdp_client_add_device_channel(rdpSettings* settings, size_t count, } } - if (!freerdp_device_collection_add(settings, (RDPDR_DEVICE*) parallel)) + if (!freerdp_device_collection_add(settings, (RDPDR_DEVICE*)parallel)) { free(parallel->Path); free(parallel->Name); @@ -675,8 +673,7 @@ BOOL freerdp_client_add_device_channel(rdpSettings* settings, size_t count, return FALSE; } -BOOL freerdp_client_add_static_channel(rdpSettings* settings, size_t count, - char** params) +BOOL freerdp_client_add_static_channel(rdpSettings* settings, size_t count, char** params) { int index; ADDIN_ARGV* args; @@ -687,13 +684,13 @@ BOOL freerdp_client_add_static_channel(rdpSettings* settings, size_t count, if (freerdp_static_channel_collection_find(settings, params[0])) return TRUE; - args = (ADDIN_ARGV*) calloc(1, sizeof(ADDIN_ARGV)); + args = (ADDIN_ARGV*)calloc(1, sizeof(ADDIN_ARGV)); if (!args) return FALSE; args->argc = (int)count; - args->argv = (char**) calloc((size_t)args->argc, sizeof(char*)); + args->argv = (char**)calloc((size_t)args->argc, sizeof(char*)); if (!args->argv) goto error_argv; @@ -727,8 +724,7 @@ error_argv: return FALSE; } -BOOL freerdp_client_add_dynamic_channel(rdpSettings* settings, size_t count, - char** params) +BOOL freerdp_client_add_dynamic_channel(rdpSettings* settings, size_t count, char** params) { int index; ADDIN_ARGV* args; @@ -739,13 +735,13 @@ BOOL freerdp_client_add_dynamic_channel(rdpSettings* settings, size_t count, if (freerdp_dynamic_channel_collection_find(settings, params[0])) return TRUE; - args = (ADDIN_ARGV*) malloc(sizeof(ADDIN_ARGV)); + args = (ADDIN_ARGV*)malloc(sizeof(ADDIN_ARGV)); if (!args) return FALSE; args->argc = (int)count; - args->argv = (char**) calloc((size_t)args->argc, sizeof(char*)); + args->argv = (char**)calloc((size_t)args->argc, sizeof(char*)); if (!args->argv) goto error_argv; @@ -780,8 +776,7 @@ error_argv: } static char** freerdp_command_line_parse_comma_separated_values_ex(const char* name, - const char* list, - size_t* count) + const char* list, size_t* count) { char** p; char* str; @@ -798,7 +793,7 @@ static char** freerdp_command_line_parse_comma_separated_values_ex(const char* n if (name) { size_t len = strlen(name); - p = (char**) calloc(2UL + len, sizeof(char*)); + p = (char**)calloc(2UL + len, sizeof(char*)); if (p) { @@ -830,7 +825,7 @@ static char** freerdp_command_line_parse_comma_separated_values_ex(const char* n prefix = (nArgs + 1UL) * sizeof(char*); len = strlen(list); - p = (char**) calloc(len + prefix + 1, sizeof(char*)); + p = (char**)calloc(len + prefix + 1, sizeof(char*)); if (!p) return NULL; @@ -857,26 +852,23 @@ static char** freerdp_command_line_parse_comma_separated_values_ex(const char* n return p; } -static char** freerdp_command_line_parse_comma_separated_values(char* list, - size_t* count) +static char** freerdp_command_line_parse_comma_separated_values(char* list, size_t* count) { return freerdp_command_line_parse_comma_separated_values_ex(NULL, list, count); } -static char** freerdp_command_line_parse_comma_separated_values_offset( - const char* name, char* list, size_t* count) +static char** freerdp_command_line_parse_comma_separated_values_offset(const char* name, char* list, + size_t* count) { return freerdp_command_line_parse_comma_separated_values_ex(name, list, count); } -static int freerdp_client_command_line_post_filter(void* context, - COMMAND_LINE_ARGUMENT_A* arg) +static int freerdp_client_command_line_post_filter(void* context, COMMAND_LINE_ARGUMENT_A* arg) { - rdpSettings* settings = (rdpSettings*) context; + rdpSettings* settings = (rdpSettings*)context; BOOL status = TRUE; BOOL enable = arg->Value ? TRUE : FALSE; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "a") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "a") { char** p; size_t count; @@ -909,8 +901,7 @@ static int freerdp_client_command_line_post_filter(void* context, { char** p; size_t count; - p = freerdp_command_line_parse_comma_separated_values_offset(arg->Name, arg->Value, - &count); + p = freerdp_command_line_parse_comma_separated_values_offset(arg->Name, arg->Value, &count); status = freerdp_client_add_device_channel(settings, count, p); free(p); } @@ -918,8 +909,7 @@ static int freerdp_client_command_line_post_filter(void* context, { char** p; size_t count; - p = freerdp_command_line_parse_comma_separated_values_offset(arg->Name, arg->Value, - &count); + p = freerdp_command_line_parse_comma_separated_values_offset(arg->Name, arg->Value, &count); status = freerdp_client_add_device_channel(settings, count, p); free(p); } @@ -927,8 +917,7 @@ static int freerdp_client_command_line_post_filter(void* context, { char** p; size_t count; - p = freerdp_command_line_parse_comma_separated_values_offset(arg->Name, arg->Value, - &count); + p = freerdp_command_line_parse_comma_separated_values_offset(arg->Name, arg->Value, &count); status = freerdp_client_add_device_channel(settings, count, p); free(p); } @@ -936,8 +925,7 @@ static int freerdp_client_command_line_post_filter(void* context, { char** p; size_t count; - p = freerdp_command_line_parse_comma_separated_values_offset(arg->Name, arg->Value, - &count); + p = freerdp_command_line_parse_comma_separated_values_offset(arg->Name, arg->Value, &count); status = freerdp_client_add_device_channel(settings, count, p); free(p); } @@ -945,8 +933,7 @@ static int freerdp_client_command_line_post_filter(void* context, { char** p; size_t count; - p = freerdp_command_line_parse_comma_separated_values_offset(arg->Name, arg->Value, - &count); + p = freerdp_command_line_parse_comma_separated_values_offset(arg->Name, arg->Value, &count); status = freerdp_client_add_device_channel(settings, count, p); free(p); } @@ -954,8 +941,7 @@ static int freerdp_client_command_line_post_filter(void* context, { char** p; size_t count; - p = freerdp_command_line_parse_comma_separated_values_offset("urbdrc", arg->Value, - &count); + p = freerdp_command_line_parse_comma_separated_values_offset("urbdrc", arg->Value, &count); status = freerdp_client_add_dynamic_channel(settings, count, p); free(p); } @@ -992,8 +978,7 @@ static int freerdp_client_command_line_post_filter(void* context, { char** p; size_t count; - p = freerdp_command_line_parse_comma_separated_values_offset("rdpsnd", arg->Value, - &count); + p = freerdp_command_line_parse_comma_separated_values_offset("rdpsnd", arg->Value, &count); status = freerdp_client_add_static_channel(settings, count, p); free(p); } @@ -1001,8 +986,7 @@ static int freerdp_client_command_line_post_filter(void* context, { char** p; size_t count; - p = freerdp_command_line_parse_comma_separated_values_offset("audin", arg->Value, - &count); + p = freerdp_command_line_parse_comma_separated_values_offset("audin", arg->Value, &count); status = freerdp_client_add_dynamic_channel(settings, count, p); free(p); } @@ -1010,8 +994,7 @@ static int freerdp_client_command_line_post_filter(void* context, { char** p; size_t count; - p = freerdp_command_line_parse_comma_separated_values_offset("tsmf", arg->Value, - &count); + p = freerdp_command_line_parse_comma_separated_values_offset("tsmf", arg->Value, &count); status = freerdp_client_add_dynamic_channel(settings, count, p); free(p); } @@ -1024,8 +1007,8 @@ static int freerdp_client_command_line_post_filter(void* context, settings->SupportMultitransport = enable; if (settings->SupportMultitransport) - settings->MultitransportFlags = (TRANSPORT_TYPE_UDP_FECR | - TRANSPORT_TYPE_UDP_FECL | TRANSPORT_TYPE_UDP_PREFERRED); + settings->MultitransportFlags = + (TRANSPORT_TYPE_UDP_FECR | TRANSPORT_TYPE_UDP_FECL | TRANSPORT_TYPE_UDP_PREFERRED); else settings->MultitransportFlags = 0; } @@ -1033,8 +1016,7 @@ static int freerdp_client_command_line_post_filter(void* context, { settings->PasswordIsSmartcardPin = enable; } - CommandLineSwitchEnd(arg) - return status ? 1 : -1; + CommandLineSwitchEnd(arg) return status ? 1 : -1; } BOOL freerdp_parse_username(const char* username, char** user, char** domain) @@ -1053,7 +1035,7 @@ BOOL freerdp_parse_username(const char* username, char** user, char** domain) if (!*user) return FALSE; - *domain = (char*) calloc(length + 1UL, sizeof(char)); + *domain = (char*)calloc(length + 1UL, sizeof(char)); if (!*domain) { @@ -1104,7 +1086,7 @@ BOOL freerdp_parse_hostname(const char* hostname, char** host, int* port) if (!value_to_int(p + 1, &val, 1, UINT16_MAX)) return FALSE; - *host = (char*) calloc(length + 1UL, sizeof(char)); + *host = (char*)calloc(length + 1UL, sizeof(char)); if (!(*host)) return FALSE; @@ -1266,8 +1248,7 @@ int freerdp_map_keyboard_layout_name_to_id(char* name) return 0; } -static int freerdp_detect_command_line_pre_filter(void* context, int index, - int argc, LPSTR* argv) +static int freerdp_detect_command_line_pre_filter(void* context, int index, int argc, LPSTR* argv) { size_t length; WINPR_UNUSED(context); @@ -1299,8 +1280,8 @@ static int freerdp_detect_command_line_pre_filter(void* context, int index, return 0; } -static int freerdp_detect_windows_style_command_line_syntax(int argc, char** argv, - size_t* count, BOOL ignoreUnknown) +static int freerdp_detect_windows_style_command_line_syntax(int argc, char** argv, size_t* count, + BOOL ignoreUnknown) { int status; DWORD flags; @@ -1320,8 +1301,8 @@ static int freerdp_detect_windows_style_command_line_syntax(int argc, char** arg *count = 0; detect_status = 0; CommandLineClearArgumentsA(largs); - status = CommandLineParseArgumentsA(argc, argv, largs, flags, - NULL, freerdp_detect_command_line_pre_filter, NULL); + status = CommandLineParseArgumentsA(argc, argv, largs, flags, NULL, + freerdp_detect_command_line_pre_filter, NULL); if (status < 0) return status; @@ -1334,8 +1315,7 @@ static int freerdp_detect_windows_style_command_line_syntax(int argc, char** arg continue; (*count)++; - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); if ((status <= COMMAND_LINE_ERROR) && (status >= COMMAND_LINE_ERROR_LAST)) detect_status = -1; @@ -1343,8 +1323,8 @@ static int freerdp_detect_windows_style_command_line_syntax(int argc, char** arg return detect_status; } -int freerdp_detect_posix_style_command_line_syntax(int argc, char** argv, - size_t* count, BOOL ignoreUnknown) +int freerdp_detect_posix_style_command_line_syntax(int argc, char** argv, size_t* count, + BOOL ignoreUnknown) { int status; DWORD flags; @@ -1365,8 +1345,8 @@ int freerdp_detect_posix_style_command_line_syntax(int argc, char** argv, *count = 0; detect_status = 0; CommandLineClearArgumentsA(largs); - status = CommandLineParseArgumentsA(argc, argv, largs, flags, - NULL, freerdp_detect_command_line_pre_filter, NULL); + status = CommandLineParseArgumentsA(argc, argv, largs, flags, NULL, + freerdp_detect_command_line_pre_filter, NULL); if (status < 0) return status; @@ -1379,8 +1359,7 @@ int freerdp_detect_posix_style_command_line_syntax(int argc, char** argv, continue; (*count)++; - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); if ((status <= COMMAND_LINE_ERROR) && (status >= COMMAND_LINE_ERROR_LAST)) detect_status = -1; @@ -1388,8 +1367,7 @@ int freerdp_detect_posix_style_command_line_syntax(int argc, char** argv, return detect_status; } -static BOOL freerdp_client_detect_command_line(int argc, char** argv, - DWORD* flags) +static BOOL freerdp_client_detect_command_line(int argc, char** argv, DWORD* flags) { int old_cli_status; size_t old_cli_count; @@ -1399,12 +1377,11 @@ static BOOL freerdp_client_detect_command_line(int argc, char** argv, size_t windows_cli_count; BOOL compatibility = FALSE; const BOOL ignoreUnknown = TRUE; - windows_cli_status = freerdp_detect_windows_style_command_line_syntax(argc, - argv, &windows_cli_count, ignoreUnknown); - posix_cli_status = freerdp_detect_posix_style_command_line_syntax(argc, argv, - &posix_cli_count, ignoreUnknown); - old_cli_status = freerdp_detect_old_command_line_syntax(argc, argv, - &old_cli_count); + windows_cli_status = freerdp_detect_windows_style_command_line_syntax( + argc, argv, &windows_cli_count, ignoreUnknown); + posix_cli_status = + freerdp_detect_posix_style_command_line_syntax(argc, argv, &posix_cli_count, ignoreUnknown); + old_cli_status = freerdp_detect_old_command_line_syntax(argc, argv, &old_cli_count); /* Default is POSIX syntax */ *flags = COMMAND_LINE_SEPARATOR_SPACE; *flags |= COMMAND_LINE_SIGIL_DASH | COMMAND_LINE_SIGIL_DOUBLE_DASH; @@ -1414,8 +1391,8 @@ static BOOL freerdp_client_detect_command_line(int argc, char** argv, return compatibility; /* Check, if this may be windows style syntax... */ - if ((windows_cli_count && (windows_cli_count >= posix_cli_count)) - || (windows_cli_status <= COMMAND_LINE_STATUS_PRINT)) + if ((windows_cli_count && (windows_cli_count >= posix_cli_count)) || + (windows_cli_status <= COMMAND_LINE_STATUS_PRINT)) { windows_cli_count = 1; *flags = COMMAND_LINE_SEPARATOR_COLON; @@ -1424,8 +1401,7 @@ static BOOL freerdp_client_detect_command_line(int argc, char** argv, else if (old_cli_status >= 0) { /* Ignore legacy parsing in case there is an error in the command line. */ - if ((old_cli_status == 1) || ((old_cli_count > posix_cli_count) - && (old_cli_status != -1))) + if ((old_cli_status == 1) || ((old_cli_count > posix_cli_count) && (old_cli_status != -1))) { *flags = COMMAND_LINE_SEPARATOR_SPACE; *flags |= COMMAND_LINE_SIGIL_DASH | COMMAND_LINE_SIGIL_DOUBLE_DASH; @@ -1434,20 +1410,19 @@ static BOOL freerdp_client_detect_command_line(int argc, char** argv, } WLog_DBG(TAG, "windows: %d/%d posix: %d/%d compat: %d/%d", windows_cli_status, - windows_cli_count, - posix_cli_status, posix_cli_count, old_cli_status, old_cli_count); + windows_cli_count, posix_cli_status, posix_cli_count, old_cli_status, old_cli_count); return compatibility; } -int freerdp_client_settings_command_line_status_print(rdpSettings* settings, - int status, int argc, char** argv) +int freerdp_client_settings_command_line_status_print(rdpSettings* settings, int status, int argc, + char** argv) { - return freerdp_client_settings_command_line_status_print_ex( - settings, status, argc, argv, NULL); + return freerdp_client_settings_command_line_status_print_ex(settings, status, argc, argv, NULL); } -int freerdp_client_settings_command_line_status_print_ex(rdpSettings* settings, - int status, int argc, char** argv, COMMAND_LINE_ARGUMENT_A* custom) +int freerdp_client_settings_command_line_status_print_ex(rdpSettings* settings, int status, + int argc, char** argv, + COMMAND_LINE_ARGUMENT_A* custom) { COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A largs[ARRAYSIZE(args)]; @@ -1474,27 +1449,27 @@ int freerdp_client_settings_command_line_status_print_ex(rdpSettings* settings, DWORD i; RDP_KEYBOARD_LAYOUT* layouts; layouts = freerdp_keyboard_get_layouts(RDP_KEYBOARD_LAYOUT_TYPE_STANDARD); - //if (!layouts) /* FIXME*/ + // if (!layouts) /* FIXME*/ printf("\nKeyboard Layouts\n"); for (i = 0; layouts[i].code; i++) - printf("0x%08"PRIX32"\t%s\n", layouts[i].code, layouts[i].name); + printf("0x%08" PRIX32 "\t%s\n", layouts[i].code, layouts[i].name); freerdp_keyboard_layouts_free(layouts); layouts = freerdp_keyboard_get_layouts(RDP_KEYBOARD_LAYOUT_TYPE_VARIANT); - //if (!layouts) /* FIXME*/ + // if (!layouts) /* FIXME*/ printf("\nKeyboard Layout Variants\n"); for (i = 0; layouts[i].code; i++) - printf("0x%08"PRIX32"\t%s\n", layouts[i].code, layouts[i].name); + printf("0x%08" PRIX32 "\t%s\n", layouts[i].code, layouts[i].name); freerdp_keyboard_layouts_free(layouts); layouts = freerdp_keyboard_get_layouts(RDP_KEYBOARD_LAYOUT_TYPE_IME); - //if (!layouts) /* FIXME*/ + // if (!layouts) /* FIXME*/ printf("\nKeyboard Input Method Editors (IMEs)\n"); for (i = 0; layouts[i].code; i++) - printf("0x%08"PRIX32"\t%s\n", layouts[i].code, layouts[i].name); + printf("0x%08" PRIX32 "\t%s\n", layouts[i].code, layouts[i].name); freerdp_keyboard_layouts_free(layouts); printf("\n"); @@ -1568,7 +1543,7 @@ static BOOL parseSizeValue(const char* input, unsigned long* v1, unsigned long* if ((v == 0 || v == ULONG_MAX) && (errno != 0)) return FALSE; - if (*endPtr != '\0') + if (*endPtr != '\0') return FALSE; if (v2) @@ -1577,8 +1552,8 @@ static BOOL parseSizeValue(const char* input, unsigned long* v1, unsigned long* return TRUE; } -int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, - int argc, char** argv, BOOL allowUnknown) +int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, int argc, + char** argv, BOOL allowUnknown) { char* p; char* user = NULL; @@ -1631,14 +1606,12 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, if (assist) { - if (freerdp_client_settings_parse_assistance_file(settings, - argc, argv) < 0) + if (freerdp_client_settings_parse_assistance_file(settings, argc, argv) < 0) return COMMAND_LINE_ERROR_UNEXPECTED_VALUE; } CommandLineClearArgumentsA(largs); - status = CommandLineParseArgumentsA(argc, argv, largs, flags, - settings, + status = CommandLineParseArgumentsA(argc, argv, largs, flags, settings, freerdp_client_command_line_pre_filter, freerdp_client_command_line_post_filter); @@ -1657,8 +1630,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, if (!(arg->Flags & COMMAND_LINE_ARGUMENT_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "v") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "v") { assert(arg->Value); free(settings->ServerHostname); @@ -1680,7 +1652,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, length = (size_t)(p - arg->Value); settings->ServerPort = (UINT16)val; - if (!(settings->ServerHostname = (char*) calloc(length + 1UL, sizeof(char)))) + if (!(settings->ServerHostname = (char*)calloc(length + 1UL, sizeof(char)))) return COMMAND_LINE_ERROR_MEMORY; strncpy(settings->ServerHostname, arg->Value, length); @@ -1702,7 +1674,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, length = (size_t)(p2 - p); - if (!(settings->ServerHostname = (char*) calloc(length, sizeof(char)))) + if (!(settings->ServerHostname = (char*)calloc(length, sizeof(char)))) return COMMAND_LINE_ERROR_MEMORY; strncpy(settings->ServerHostname, p + 1, length - 1); @@ -1717,7 +1689,8 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, settings->ServerPort = (UINT16)val; } - printf("hostname %s port %"PRIu32"\n", settings->ServerHostname, settings->ServerPort); + printf("hostname %s port %" PRIu32 "\n", settings->ServerHostname, + settings->ServerPort); } } CommandLineSwitchCase(arg, "spn-class") @@ -1756,8 +1729,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, mask = (mask & 0x07); settings->RedirectionPreferType |= mask << (count * 3); count++; - } - while (cur != NULL); + } while (cur != NULL); if (count > 3) return COMMAND_LINE_ERROR_UNEXPECTED_VALUE; @@ -1902,7 +1874,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, if (count > 16) count = 16; - settings->NumMonitorIds = (UINT32) count; + settings->NumMonitorIds = (UINT32)count; for (i = 0; i < settings->NumMonitorIds; i++) { @@ -2029,7 +2001,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, errno = 0; } - settings->KeyboardLayout = (UINT32) val; + settings->KeyboardLayout = (UINT32)val; } CommandLineSwitchCase(arg, "kbd-type") { @@ -2092,7 +2064,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, s = (size_t)(p - arg->Value); settings->GatewayPort = (UINT32)val; - if (!(settings->GatewayHostname = (char*) calloc(s + 1UL, sizeof(char)))) + if (!(settings->GatewayHostname = (char*)calloc(s + 1UL, sizeof(char)))) return COMMAND_LINE_ERROR_MEMORY; strncpy(settings->GatewayHostname, arg->Value, s); @@ -2162,7 +2134,9 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, if (!colonPtr || (colonPtr > atPtr)) { - WLog_ERR(TAG, "invalid syntax for proxy, expected syntax is user:password@host:port"); + WLog_ERR( + TAG, + "invalid syntax for proxy, expected syntax is user:password@host:port"); return COMMAND_LINE_ERROR_UNEXPECTED_VALUE; } @@ -2198,7 +2172,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, length = (size_t)(p - arg->Value); settings->ProxyPort = (UINT16)val; - settings->ProxyHostname = (char*) malloc(length + 1); + settings->ProxyHostname = (char*)malloc(length + 1); strncpy(settings->ProxyHostname, arg->Value, length); settings->ProxyHostname[length] = '\0'; } @@ -2269,7 +2243,8 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, { LONGLONG val; - if (!value_to_int(arg->Value, &val, TSC_PROXY_MODE_NONE_DIRECT, TSC_PROXY_MODE_NONE_DETECT)) + if (!value_to_int(arg->Value, &val, TSC_PROXY_MODE_NONE_DIRECT, + TSC_PROXY_MODE_NONE_DETECT)) return COMMAND_LINE_ERROR_UNEXPECTED_VALUE; } @@ -2296,8 +2271,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, if (!copy_value(arg->Value, (char**)&settings->LoadBalanceInfo)) return COMMAND_LINE_ERROR_MEMORY; - settings->LoadBalanceInfoLength = (UINT32) strlen((char*) - settings->LoadBalanceInfo); + settings->LoadBalanceInfoLength = (UINT32)strlen((char*)settings->LoadBalanceInfo); } CommandLineSwitchCase(arg, "app-name") { @@ -2406,8 +2380,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, else if (_stricmp(arg->Value, "lan") == 0) type = CONNECTION_TYPE_LAN; else if ((_stricmp(arg->Value, "autodetect") == 0) || - (_stricmp(arg->Value, "auto") == 0) || - (_stricmp(arg->Value, "detect") == 0)) + (_stricmp(arg->Value, "auto") == 0) || (_stricmp(arg->Value, "detect") == 0)) { type = CONNECTION_TYPE_AUTODETECT; } @@ -2491,7 +2464,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, } else #endif - if (_strnicmp("RFX", arg->Value, 4) == 0) + if (_strnicmp("RFX", arg->Value, 4) == 0) { settings->GfxAVC444 = FALSE; settings->GfxH264 = FALSE; @@ -2840,8 +2813,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, } else return COMMAND_LINE_ERROR_UNEXPECTED_VALUE; - } - while (start); + } while (start); } } CommandLineSwitchCase(arg, "mouse-motion") @@ -2867,8 +2839,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, } CommandLineSwitchCase(arg, "glyph-cache") { - settings->GlyphSupportLevel = arg->Value ? GLYPH_SUPPORT_FULL : - GLYPH_SUPPORT_NONE; + settings->GlyphSupportLevel = arg->Value ? GLYPH_SUPPORT_FULL : GLYPH_SUPPORT_NONE; } CommandLineSwitchCase(arg, "codec-cache") { @@ -2917,7 +2888,8 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, return COMMAND_LINE_ERROR_UNEXPECTED_VALUE; if (val < 0) - settings->MaxTimeInCheckLoop = 10 * 60 * 60 * 1000; /* 10 hours can be considered as infinite */ + settings->MaxTimeInCheckLoop = + 10 * 60 * 60 * 1000; /* 10 hours can be considered as infinite */ else settings->MaxTimeInCheckLoop = (UINT32)val; } @@ -2967,8 +2939,8 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, BYTE* base64 = NULL; int length; assert(arg->Value); - crypto_base64_decode((const char*)(arg->Value), (int) strlen(arg->Value), - &base64, &length); + crypto_base64_decode((const char*)(arg->Value), (int)strlen(arg->Value), &base64, + &length); if ((base64 != NULL) && (length == sizeof(ARC_SC_PRIVATE_PACKET))) { @@ -3089,8 +3061,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, { } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); if (user) { @@ -3153,7 +3124,8 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, if (!settings->GatewayPassword) return COMMAND_LINE_ERROR; - if (!freerdp_passphrase_read("Gateway Password: ", settings->GatewayPassword, size, 1)) + if (!freerdp_passphrase_read("Gateway Password: ", settings->GatewayPassword, size, + 1)) return COMMAND_LINE_ERROR; } } @@ -3161,8 +3133,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, freerdp_performance_flags_make(settings); - if (settings->RemoteFxCodec || settings->NSCodec - || settings->SupportGraphicsPipeline) + if (settings->RemoteFxCodec || settings->NSCodec || settings->SupportGraphicsPipeline) { settings->FastPathOutput = TRUE; settings->LargePointerFlag = TRUE; @@ -3199,13 +3170,13 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, return status; } -static BOOL freerdp_client_load_static_channel_addin(rdpChannels* channels, - rdpSettings* settings, char* name, void* data) +static BOOL freerdp_client_load_static_channel_addin(rdpChannels* channels, rdpSettings* settings, + char* name, void* data) { PVIRTUALCHANNELENTRY entry = NULL; PVIRTUALCHANNELENTRYEX entryEx = NULL; - entryEx = (PVIRTUALCHANNELENTRYEX)(void*)freerdp_load_channel_addin_entry(name, NULL, NULL, - FREERDP_ADDIN_CHANNEL_STATIC | FREERDP_ADDIN_CHANNEL_ENTRYEX); + entryEx = (PVIRTUALCHANNELENTRYEX)(void*)freerdp_load_channel_addin_entry( + name, NULL, NULL, FREERDP_ADDIN_CHANNEL_STATIC | FREERDP_ADDIN_CHANNEL_ENTRYEX); if (!entryEx) entry = freerdp_load_channel_addin_entry(name, NULL, NULL, FREERDP_ADDIN_CHANNEL_STATIC); @@ -3237,10 +3208,7 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings) if (settings->AudioPlayback) { - char* p[] = - { - "rdpsnd" - }; + char* p[] = { "rdpsnd" }; if (!freerdp_client_add_static_channel(settings, ARRAYSIZE(p), p)) return FALSE; @@ -3248,10 +3216,7 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings) if (settings->AudioCapture) { - char* p[] = - { - "audin" - }; + char* p[] = { "audin" }; if (!freerdp_client_add_dynamic_channel(settings, ARRAYSIZE(p), p)) return FALSE; @@ -3261,8 +3226,7 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings) (freerdp_dynamic_channel_collection_find(settings, "tsmf"))) { settings->DeviceRedirection = TRUE; /* rdpsnd requires rdpdr to be registered */ - settings->AudioPlayback = - TRUE; /* Both rdpsnd and tsmf require this flag to be set */ + settings->AudioPlayback = TRUE; /* Both rdpsnd and tsmf require this flag to be set */ } if (freerdp_dynamic_channel_collection_find(settings, "audin")) @@ -3270,12 +3234,10 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings) settings->AudioCapture = TRUE; } - if (settings->NetworkAutoDetect || - settings->SupportHeartbeatPdu || + if (settings->NetworkAutoDetect || settings->SupportHeartbeatPdu || settings->SupportMultitransport) { - settings->DeviceRedirection = - TRUE; /* these RDP8 features require rdpdr to be registered */ + settings->DeviceRedirection = TRUE; /* these RDP8 features require rdpdr to be registered */ } if (settings->DrivesToRedirect && (strlen(settings->DrivesToRedirect) != 0)) @@ -3301,7 +3263,7 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings) return FALSE; } - while(tok) + while (tok) { /* Syntax: Comma seperated list of the following entries: * '*' ... Redirect all drives, including hotplug @@ -3352,14 +3314,13 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings) params[1] = "media"; params[2] = "*"; - if (!freerdp_client_add_device_channel(settings, 3, (char**) params)) + if (!freerdp_client_add_device_channel(settings, 3, (char**)params)) return FALSE; } } - if (settings->RedirectDrives || settings->RedirectHomeDrive - || settings->RedirectSerialPorts - || settings->RedirectSmartCards || settings->RedirectPrinters) + if (settings->RedirectDrives || settings->RedirectHomeDrive || settings->RedirectSerialPorts || + settings->RedirectSmartCards || settings->RedirectPrinters) { settings->DeviceRedirection = TRUE; /* All of these features require rdpdr */ } @@ -3373,15 +3334,14 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings) params[1] = "home"; params[2] = "%"; - if (!freerdp_client_add_device_channel(settings, 3, (char**) params)) + if (!freerdp_client_add_device_channel(settings, 3, (char**)params)) return FALSE; } } if (settings->DeviceRedirection) { - if (!freerdp_client_load_static_channel_addin(channels, settings, "rdpdr", - settings)) + if (!freerdp_client_load_static_channel_addin(channels, settings, "rdpdr", settings)) return FALSE; if (!freerdp_static_channel_collection_find(settings, "rdpsnd")) @@ -3390,7 +3350,7 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings) params[0] = "rdpsnd"; params[1] = "sys:fake"; - if (!freerdp_client_add_static_channel(settings, 2, (char**) params)) + if (!freerdp_client_add_static_channel(settings, 2, (char**)params)) return FALSE; } } @@ -3401,14 +3361,14 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings) if (!freerdp_device_collection_find_type(settings, RDPDR_DTYP_SMARTCARD)) { - smartcard = (RDPDR_SMARTCARD*) calloc(1, sizeof(RDPDR_SMARTCARD)); + smartcard = (RDPDR_SMARTCARD*)calloc(1, sizeof(RDPDR_SMARTCARD)); if (!smartcard) return FALSE; smartcard->Type = RDPDR_DTYP_SMARTCARD; - if (!freerdp_device_collection_add(settings, (RDPDR_DEVICE*) smartcard)) + if (!freerdp_device_collection_add(settings, (RDPDR_DEVICE*)smartcard)) return FALSE; } } @@ -3419,14 +3379,14 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings) if (!freerdp_device_collection_find_type(settings, RDPDR_DTYP_PRINT)) { - printer = (RDPDR_PRINTER*) calloc(1, sizeof(RDPDR_PRINTER)); + printer = (RDPDR_PRINTER*)calloc(1, sizeof(RDPDR_PRINTER)); if (!printer) return FALSE; printer->Type = RDPDR_DTYP_PRINT; - if (!freerdp_device_collection_add(settings, (RDPDR_DEVICE*) printer)) + if (!freerdp_device_collection_add(settings, (RDPDR_DEVICE*)printer)) return FALSE; } } @@ -3436,7 +3396,7 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings) char* params[1]; params[0] = "cliprdr"; - if (!freerdp_client_add_static_channel(settings, 1, (char**) params)) + if (!freerdp_client_add_static_channel(settings, 1, (char**)params)) return FALSE; } @@ -3456,21 +3416,20 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings) if (settings->EncomspVirtualChannel) { - if (!freerdp_client_load_static_channel_addin(channels, settings, "encomsp", - settings)) + if (!freerdp_client_load_static_channel_addin(channels, settings, "encomsp", settings)) return FALSE; } if (settings->RemdeskVirtualChannel) { - if (!freerdp_client_load_static_channel_addin(channels, settings, "remdesk", - settings)) + if (!freerdp_client_load_static_channel_addin(channels, settings, "remdesk", settings)) return FALSE; } if (settings->RDP2TCPArgs) { - if (!freerdp_client_load_static_channel_addin(channels, settings, "rdp2tcp", settings->RDP2TCPArgs)) + if (!freerdp_client_load_static_channel_addin(channels, settings, "rdp2tcp", + settings->RDP2TCPArgs)) return FALSE; } @@ -3478,15 +3437,13 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings) { args = settings->StaticChannelArray[index]; - if (!freerdp_client_load_static_channel_addin(channels, settings, args->argv[0], - args)) + if (!freerdp_client_load_static_channel_addin(channels, settings, args->argv[0], args)) return FALSE; } if (settings->RemoteApplicationMode) { - if (!freerdp_client_load_static_channel_addin(channels, settings, "rail", - settings)) + if (!freerdp_client_load_static_channel_addin(channels, settings, "rail", settings)) return FALSE; } @@ -3572,8 +3529,7 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings) if (settings->SupportDynamicChannels) { - if (!freerdp_client_load_static_channel_addin(channels, settings, "drdynvc", - settings)) + if (!freerdp_client_load_static_channel_addin(channels, settings, "drdynvc", settings)) return FALSE; } diff --git a/client/common/cmdline.h b/client/common/cmdline.h index 19d3d05bd..e47a26449 100644 --- a/client/common/cmdline.h +++ b/client/common/cmdline.h @@ -22,8 +22,7 @@ #include -static const COMMAND_LINE_ARGUMENT_A args[] = -{ +static const COMMAND_LINE_ARGUMENT_A args[] = { { "a", COMMAND_LINE_VALUE_REQUIRED, "[,]", NULL, NULL, -1, "addin", "Addin" }, { "action-script", COMMAND_LINE_VALUE_REQUIRED, "", "~/.config/freerdp/action.sh", NULL, -1, NULL, "Action script" }, @@ -328,9 +327,12 @@ static const COMMAND_LINE_ARGUMENT_A args[] = "Hyper-V console (use port 2179, disable negotiation)" }, { "w", COMMAND_LINE_VALUE_REQUIRED, "", "1024", NULL, -1, NULL, "Width" }, { "wallpaper", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "wallpaper" }, - { "window-drag", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "full window drag" }, - { "window-position", COMMAND_LINE_VALUE_REQUIRED, "x", NULL, NULL, -1, NULL, "window position" }, - { "wm-class", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "Set the WM_CLASS hint for the window instance" }, + { "window-drag", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, + "full window drag" }, + { "window-position", COMMAND_LINE_VALUE_REQUIRED, "x", NULL, NULL, -1, NULL, + "window position" }, + { "wm-class", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Set the WM_CLASS hint for the window instance" }, { "workarea", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "Use available work area" }, { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; diff --git a/client/common/compatibility.c b/client/common/compatibility.c index 79436c5e1..b9b70c893 100644 --- a/client/common/compatibility.c +++ b/client/common/compatibility.c @@ -41,55 +41,79 @@ #define TAG CLIENT_TAG("common.compatibility") -static const COMMAND_LINE_ARGUMENT_A old_args[] = -{ +static const COMMAND_LINE_ARGUMENT_A old_args[] = { { "0", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "connect to console session" }, - { "a", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "set color depth in bits, default is 16" }, + { "a", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, + "set color depth in bits, default is 16" }, { "c", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "shell working directory" }, { "D", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "hide window decorations" }, { "T", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "Window title" }, { "d", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "domain" }, { "f", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "fullscreen mode" }, - { "g", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "set geometry, using format WxH or X%% or 'workarea', default is 1024x768" }, - { "h", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_HELP, NULL, NULL, NULL, -1, "help", "print this help" }, + { "g", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, + "set geometry, using format WxH or X%% or 'workarea', default is 1024x768" }, + { "h", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_HELP, NULL, NULL, NULL, -1, "help", + "print this help" }, { "k", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "set keyboard layout ID" }, - { "K", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "do not interfere with window manager bindings" }, + { "K", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "do not interfere with window manager bindings" }, { "n", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "hostname" }, { "o", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "console audio" }, { "p", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "password" }, { "s", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "set startup-shell" }, - { "t", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "alternative port number, default is 3389" }, + { "t", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, + "alternative port number, default is 3389" }, { "u", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "username" }, - { "x", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "performance flags (m[odem], b[roadband] or l[an])" }, - { "X", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "embed into another window with a given XID." }, + { "x", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, + "performance flags (m[odem], b[roadband] or l[an])" }, + { "X", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, + "embed into another window with a given XID." }, { "z", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "enable compression" }, - { "app", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "RemoteApp connection. This implies -g workarea" }, + { "app", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "RemoteApp connection. This implies -g workarea" }, { "ext", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "load an extension" }, { "no-auth", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "disable authentication" }, - { "authonly", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "authentication only, no UI" }, - { "from-stdin", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "unspecified username, password, domain and hostname params are prompted" }, + { "authonly", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "authentication only, no UI" }, + { "from-stdin", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "unspecified username, password, domain and hostname params are prompted" }, { "no-fastpath", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "disable fast-path" }, - { "no-motion", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "don't send mouse motion events" }, - { "gdi", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "graphics rendering (hw, sw)" }, + { "no-motion", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "don't send mouse motion events" }, + { "gdi", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, + "graphics rendering (hw, sw)" }, { "no-osb", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "disable offscreen bitmaps" }, { "no-bmp-cache", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "disable bitmap cache" }, - { "plugin", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "load a virtual channel plugin" }, + { "plugin", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, + "load a virtual channel plugin" }, { "rfx", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "enable RemoteFX" }, - { "rfx-mode", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "RemoteFX operational flags (v[ideo], i[mage]), default is video" }, + { "rfx-mode", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, + "RemoteFX operational flags (v[ideo], i[mage]), default is video" }, { "nsc", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "enable NSCodec (experimental)" }, - { "disable-wallpaper", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "disables wallpaper" }, - { "composition", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "enable desktop composition" }, - { "disable-full-window-drag", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "disables full window drag" }, - { "disable-menu-animations", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "disables menu animations" }, + { "disable-wallpaper", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "disables wallpaper" }, + { "composition", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "enable desktop composition" }, + { "disable-full-window-drag", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "disables full window drag" }, + { "disable-menu-animations", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "disables menu animations" }, { "disable-theming", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "disables theming" }, - { "no-rdp", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "disable Standard RDP encryption" }, + { "no-rdp", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "disable Standard RDP encryption" }, { "no-tls", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "disable TLS encryption" }, - { "no-nla", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "disable network level authentication" }, - { "ntlm", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "force NTLM authentication protocol version (1 or 2)" }, - { "ignore-certificate", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "ignore verification of logon certificate" }, - { "sec", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "force protocol security (rdp, tls or nla)" }, - { "secure-checksum", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "use salted checksums with Standard RDP encryption" }, - { "version", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_VERSION, NULL, NULL, NULL, -1, NULL, "print version information" }, + { "no-nla", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "disable network level authentication" }, + { "ntlm", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, + "force NTLM authentication protocol version (1 or 2)" }, + { "ignore-certificate", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "ignore verification of logon certificate" }, + { "sec", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, + "force protocol security (rdp, tls or nla)" }, + { "secure-checksum", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "use salted checksums with Standard RDP encryption" }, + { "version", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_VERSION, NULL, NULL, NULL, -1, NULL, + "print version information" }, { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; @@ -98,8 +122,8 @@ static BOOL freerdp_client_old_parse_hostname(char* str, char** ServerHostname, char* p; char* host = NULL; - if (str[0] == '[' && (p = strchr(str, ']')) - && (p[1] == 0 || (p[1] == ':' && !strchr(p + 2, ':')))) + if (str[0] == '[' && (p = strchr(str, ']')) && + (p[1] == 0 || (p[1] == ':' && !strchr(p + 2, ':')))) { /* Either "[...]" or "[...]:..." with at most one : after the brackets */ if (!(host = _strdup(str + 1))) @@ -160,7 +184,7 @@ static int freerdp_client_old_process_plugin(rdpSettings* settings, ADDIN_ARGV* { args_handled++; settings->RedirectClipboard = TRUE; - WLog_WARN(TAG, "--plugin cliprdr -> +clipboard"); + WLog_WARN(TAG, "--plugin cliprdr -> +clipboard"); } else if (strcmp(args->argv[0], "rdpdr") == 0) { @@ -171,8 +195,7 @@ static int freerdp_client_old_process_plugin(rdpSettings* settings, ADDIN_ARGV* args_handled++; - if ((strcmp(args->argv[1], "disk") == 0) || - (strcmp(args->argv[1], "drive") == 0)) + if ((strcmp(args->argv[1], "disk") == 0) || (strcmp(args->argv[1], "drive") == 0)) { freerdp_addin_replace_argument(args, "disk", "drive"); freerdp_client_add_device_channel(settings, args->argc - 1, &args->argv[1]); @@ -181,8 +204,7 @@ static int freerdp_client_old_process_plugin(rdpSettings* settings, ADDIN_ARGV* { freerdp_client_add_device_channel(settings, args->argc - 1, &args->argv[1]); } - else if ((strcmp(args->argv[1], "scard") == 0) || - (strcmp(args->argv[1], "smartcard") == 0)) + else if ((strcmp(args->argv[1], "scard") == 0) || (strcmp(args->argv[1], "smartcard") == 0)) { freerdp_addin_replace_argument(args, "scard", "smartcard"); freerdp_client_add_device_channel(settings, args->argc - 1, &args->argv[1]); @@ -232,16 +254,15 @@ static int freerdp_client_old_process_plugin(rdpSettings* settings, ADDIN_ARGV* return args_handled; } static int freerdp_client_old_command_line_pre_filter(void* context, int index, int argc, - LPSTR* argv) + LPSTR* argv) { - rdpSettings* settings = (rdpSettings*) context; + rdpSettings* settings = (rdpSettings*)context; if (index == (argc - 1)) { if (argv[index][0] != '-') { - if ((strcmp(argv[index - 1], "-v") == 0) || - (strcmp(argv[index - 1], "/v") == 0)) + if ((strcmp(argv[index - 1], "-v") == 0) || (strcmp(argv[index - 1], "/v") == 0)) { return -1; } @@ -251,8 +272,8 @@ static int freerdp_client_old_command_line_pre_filter(void* context, int index, return -1; } - if (!freerdp_client_old_parse_hostname(argv[index], - &settings->ServerHostname, &settings->ServerPort)) + if (!freerdp_client_old_parse_hostname(argv[index], &settings->ServerHostname, + &settings->ServerPort)) return -1; return 2; @@ -267,7 +288,7 @@ static int freerdp_client_old_command_line_pre_filter(void* context, int index, { int args_handled = 0; int length; - char* a, *p; + char *a, *p; int i, j, t; int old_index; ADDIN_ARGV* args; @@ -278,12 +299,12 @@ static int freerdp_client_old_command_line_pre_filter(void* context, int index, if (index == argc) return -1; - args = (ADDIN_ARGV*) malloc(sizeof(ADDIN_ARGV)); + args = (ADDIN_ARGV*)malloc(sizeof(ADDIN_ARGV)); if (!args) return -1; - args->argv = (char**) calloc(argc, sizeof(char*)); + args->argv = (char**)calloc(argc, sizeof(char*)); if (!args->argv) { @@ -334,7 +355,7 @@ static int freerdp_client_old_command_line_pre_filter(void* context, int index, { length = (int)(p - a); - if (!(args->argv[j + 1] = (char*) malloc(length + 1))) + if (!(args->argv[j + 1] = (char*)malloc(length + 1))) { for (; j >= 0; --j) free(args->argv[j]); @@ -422,7 +443,7 @@ int freerdp_detect_old_command_line_syntax(int argc, char** argv, size_t* count) flags = COMMAND_LINE_SEPARATOR_SPACE | COMMAND_LINE_SILENCE_PARSER; flags |= COMMAND_LINE_SIGIL_DASH | COMMAND_LINE_SIGIL_DOUBLE_DASH; flags |= COMMAND_LINE_SIGIL_NOT_ESCAPED; - settings = (rdpSettings*) calloc(1, sizeof(rdpSettings)); + settings = (rdpSettings*)calloc(1, sizeof(rdpSettings)); if (!settings) return -1; @@ -444,12 +465,11 @@ int freerdp_detect_old_command_line_syntax(int argc, char** argv, size_t* count) if (!(arg->Flags & COMMAND_LINE_ARGUMENT_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "a") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "a") { - if ((strcmp(arg->Value, "8") == 0) || - (strcmp(arg->Value, "15") == 0) || (strcmp(arg->Value, "16") == 0) || - (strcmp(arg->Value, "24") == 0) || (strcmp(arg->Value, "32") == 0)) + if ((strcmp(arg->Value, "8") == 0) || (strcmp(arg->Value, "15") == 0) || + (strcmp(arg->Value, "16") == 0) || (strcmp(arg->Value, "24") == 0) || + (strcmp(arg->Value, "32") == 0)) { detect_status = 1; } @@ -457,10 +477,8 @@ int freerdp_detect_old_command_line_syntax(int argc, char** argv, size_t* count) CommandLineSwitchDefault(arg) { } - CommandLineSwitchEnd(arg) - (*count)++; - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + CommandLineSwitchEnd(arg)(*count)++; + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); if ((status <= COMMAND_LINE_ERROR) && (status >= COMMAND_LINE_ERROR_LAST)) detect_status = -1; @@ -491,7 +509,8 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe flags |= COMMAND_LINE_SIGIL_ENABLE_DISABLE; flags |= COMMAND_LINE_SIGIL_NOT_ESCAPED; status = CommandLineParseArgumentsA(argc, argv, largs, flags, settings, - freerdp_client_old_command_line_pre_filter, freerdp_client_old_command_line_post_filter); + freerdp_client_old_command_line_pre_filter, + freerdp_client_old_command_line_post_filter); if (status == COMMAND_LINE_STATUS_PRINT_VERSION) { @@ -522,11 +541,10 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe if (!(arg->Flags & COMMAND_LINE_ARGUMENT_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "0") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "0") { settings->ConsoleSession = TRUE; - WLog_WARN(TAG, "-0 -> /admin"); + WLog_WARN(TAG, "-0 -> /admin"); } CommandLineSwitchCase(arg, "a") { @@ -536,11 +554,11 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe return COMMAND_LINE_ERROR_UNEXPECTED_VALUE; settings->ColorDepth = val; - WLog_WARN(TAG, "-a %s -> /bpp:%s", arg->Value, arg->Value); + WLog_WARN(TAG, "-a %s -> /bpp:%s", arg->Value, arg->Value); } CommandLineSwitchCase(arg, "c") { - WLog_WARN(TAG, "-c %s -> /shell-dir:%s", arg->Value, arg->Value); + WLog_WARN(TAG, "-c %s -> /shell-dir:%s", arg->Value, arg->Value); if (!(settings->ShellWorkingDirectory = _strdup(arg->Value))) return COMMAND_LINE_ERROR_MEMORY; @@ -548,26 +566,26 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe CommandLineSwitchCase(arg, "D") { settings->Decorations = FALSE; - WLog_WARN(TAG, "-D -> -decorations"); + WLog_WARN(TAG, "-D -> -decorations"); } CommandLineSwitchCase(arg, "T") { if (!(settings->WindowTitle = _strdup(arg->Value))) return COMMAND_LINE_ERROR_MEMORY; - WLog_WARN(TAG, "-T %s -> /title:%s", arg->Value, arg->Value); + WLog_WARN(TAG, "-T %s -> /title:%s", arg->Value, arg->Value); } CommandLineSwitchCase(arg, "d") { if (!(settings->Domain = _strdup(arg->Value))) return COMMAND_LINE_ERROR_MEMORY; - WLog_WARN(TAG, "-d %s -> /d:%s", arg->Value, arg->Value); + WLog_WARN(TAG, "-d %s -> /d:%s", arg->Value, arg->Value); } CommandLineSwitchCase(arg, "f") { settings->Fullscreen = TRUE; - WLog_WARN(TAG, "-f -> /f"); + WLog_WARN(TAG, "-f -> /f"); } CommandLineSwitchCase(arg, "g") { @@ -600,37 +618,37 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe } free(str); - WLog_WARN(TAG, "-g %s -> /size:%s or /w:%"PRIu32" /h:%"PRIu32"", arg->Value, arg->Value, - settings->DesktopWidth, settings->DesktopHeight); + WLog_WARN(TAG, "-g %s -> /size:%s or /w:%" PRIu32 " /h:%" PRIu32 "", arg->Value, + arg->Value, settings->DesktopWidth, settings->DesktopHeight); } CommandLineSwitchCase(arg, "k") { sscanf(arg->Value, "%X", &(settings->KeyboardLayout)); - WLog_WARN(TAG, "-k %s -> /kbd:%s", arg->Value, arg->Value); + WLog_WARN(TAG, "-k %s -> /kbd:%s", arg->Value, arg->Value); } CommandLineSwitchCase(arg, "K") { settings->GrabKeyboard = FALSE; - WLog_WARN(TAG, "-K -> -grab-keyboard"); + WLog_WARN(TAG, "-K -> -grab-keyboard"); } CommandLineSwitchCase(arg, "n") { if (!(settings->ClientHostname = _strdup(arg->Value))) return COMMAND_LINE_ERROR_MEMORY; - WLog_WARN(TAG, "-n -> /client-hostname:%s", arg->Value); + WLog_WARN(TAG, "-n -> /client-hostname:%s", arg->Value); } CommandLineSwitchCase(arg, "o") { settings->RemoteConsoleAudio = TRUE; - WLog_WARN(TAG, "-o -> /audio-mode:1"); + WLog_WARN(TAG, "-o -> /audio-mode:1"); } CommandLineSwitchCase(arg, "p") { if (!(settings->Password = _strdup(arg->Value))) return COMMAND_LINE_ERROR_MEMORY; - WLog_WARN(TAG, "-p ****** -> /p:******"); + WLog_WARN(TAG, "-p ****** -> /p:******"); /* Hide the value from 'ps'. */ FillMemory(arg->Value, strlen(arg->Value), '*'); } @@ -639,7 +657,7 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe if (!(settings->AlternateShell = _strdup(arg->Value))) return COMMAND_LINE_ERROR_MEMORY; - WLog_WARN(TAG, "-s %s -> /shell:%s", arg->Value, arg->Value); + WLog_WARN(TAG, "-s %s -> /shell:%s", arg->Value, arg->Value); } CommandLineSwitchCase(arg, "t") { @@ -649,14 +667,14 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe return COMMAND_LINE_ERROR_UNEXPECTED_VALUE; settings->ServerPort = p; - WLog_WARN(TAG, "-t %s -> /port:%s", arg->Value, arg->Value); + WLog_WARN(TAG, "-t %s -> /port:%s", arg->Value, arg->Value); } CommandLineSwitchCase(arg, "u") { if (!(settings->Username = _strdup(arg->Value))) return COMMAND_LINE_ERROR_MEMORY; - WLog_WARN(TAG, "-u %s -> /u:%s", arg->Value, arg->Value); + WLog_WARN(TAG, "-u %s -> /u:%s", arg->Value, arg->Value); } CommandLineSwitchCase(arg, "x") { @@ -686,16 +704,16 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe freerdp_performance_flags_split(settings); } - WLog_WARN(TAG, "-x %s -> /network:", arg->Value); + WLog_WARN(TAG, "-x %s -> /network:", arg->Value); if (type == CONNECTION_TYPE_MODEM) - WLog_WARN(TAG, "modem"); + WLog_WARN(TAG, "modem"); else if (CONNECTION_TYPE_BROADBAND_HIGH) - WLog_WARN(TAG, "broadband"); + WLog_WARN(TAG, "broadband"); else if (CONNECTION_TYPE_LAN) - WLog_WARN(TAG, "lan"); + WLog_WARN(TAG, "lan"); - WLog_WARN(TAG, ""); + WLog_WARN(TAG, ""); } CommandLineSwitchCase(arg, "X") { @@ -704,17 +722,17 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe if (errno != 0) return COMMAND_LINE_ERROR_UNEXPECTED_VALUE; - WLog_WARN(TAG, "-X %s -> /parent-window:%s", arg->Value, arg->Value); + WLog_WARN(TAG, "-X %s -> /parent-window:%s", arg->Value, arg->Value); } CommandLineSwitchCase(arg, "z") { settings->CompressionEnabled = TRUE; - WLog_WARN(TAG, "-z -> /compression"); + WLog_WARN(TAG, "-z -> /compression"); } CommandLineSwitchCase(arg, "app") { settings->RemoteApplicationMode = TRUE; - WLog_WARN(TAG, "--app -> /app: + program name or alias"); + WLog_WARN(TAG, "--app -> /app: + program name or alias"); } CommandLineSwitchCase(arg, "ext") { @@ -722,7 +740,7 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe CommandLineSwitchCase(arg, "no-auth") { settings->Authentication = FALSE; - WLog_WARN(TAG, "--no-auth -> -authentication"); + WLog_WARN(TAG, "--no-auth -> -authentication"); } CommandLineSwitchCase(arg, "authonly") { @@ -736,12 +754,12 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe { settings->FastPathInput = FALSE; settings->FastPathOutput = FALSE; - WLog_WARN(TAG, "--no-fastpath -> -fast-path"); + WLog_WARN(TAG, "--no-fastpath -> -fast-path"); } CommandLineSwitchCase(arg, "no-motion") { settings->MouseMotion = FALSE; - WLog_WARN(TAG, "--no-motion -> -mouse-motion"); + WLog_WARN(TAG, "--no-motion -> -mouse-motion"); } CommandLineSwitchCase(arg, "gdi") { @@ -750,26 +768,26 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe else if (strcmp(arg->Value, "hw") == 0) settings->SoftwareGdi = FALSE; - WLog_WARN(TAG, "--gdi %s -> /gdi:%s", arg->Value, arg->Value); + WLog_WARN(TAG, "--gdi %s -> /gdi:%s", arg->Value, arg->Value); } CommandLineSwitchCase(arg, "no-osb") { settings->OffscreenSupportLevel = FALSE; - WLog_WARN(TAG, "--no-osb -> -offscreen-cache"); + WLog_WARN(TAG, "--no-osb -> -offscreen-cache"); } CommandLineSwitchCase(arg, "no-bmp-cache") { settings->BitmapCacheEnabled = FALSE; - WLog_WARN(TAG, "--no-bmp-cache -> -bitmap-cache"); + WLog_WARN(TAG, "--no-bmp-cache -> -bitmap-cache"); } CommandLineSwitchCase(arg, "plugin") { - WLog_WARN(TAG, "--plugin -> /a, /vc, /dvc and channel-specific options"); + WLog_WARN(TAG, "--plugin -> /a, /vc, /dvc and channel-specific options"); } CommandLineSwitchCase(arg, "rfx") { settings->RemoteFxCodec = TRUE; - WLog_WARN(TAG, "--rfx -> /rfx"); + WLog_WARN(TAG, "--rfx -> /rfx"); } CommandLineSwitchCase(arg, "rfx-mode") { @@ -778,37 +796,38 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe else if (arg->Value[0] == 'i') settings->RemoteFxCodecMode = 0x02; - WLog_WARN(TAG, "--rfx-mode -> /rfx-mode:%s", settings->RemoteFxCodecMode ? "image" : "video"); + WLog_WARN(TAG, "--rfx-mode -> /rfx-mode:%s", + settings->RemoteFxCodecMode ? "image" : "video"); } CommandLineSwitchCase(arg, "nsc") { settings->NSCodec = TRUE; - WLog_WARN(TAG, "--nsc -> /nsc"); + WLog_WARN(TAG, "--nsc -> /nsc"); } CommandLineSwitchCase(arg, "disable-wallpaper") { settings->DisableWallpaper = TRUE; - WLog_WARN(TAG, "--disable-wallpaper -> -wallpaper"); + WLog_WARN(TAG, "--disable-wallpaper -> -wallpaper"); } CommandLineSwitchCase(arg, "composition") { settings->AllowDesktopComposition = TRUE; - WLog_WARN(TAG, "--composition -> +composition"); + WLog_WARN(TAG, "--composition -> +composition"); } CommandLineSwitchCase(arg, "disable-full-window-drag") { settings->DisableFullWindowDrag = TRUE; - WLog_WARN(TAG, "--disable-full-window-drag -> -window-drag"); + WLog_WARN(TAG, "--disable-full-window-drag -> -window-drag"); } CommandLineSwitchCase(arg, "disable-menu-animations") { settings->DisableMenuAnims = TRUE; - WLog_WARN(TAG, "--disable-menu-animations -> -menu-anims"); + WLog_WARN(TAG, "--disable-menu-animations -> -menu-anims"); } CommandLineSwitchCase(arg, "disable-theming") { settings->DisableThemes = TRUE; - WLog_WARN(TAG, "--disable-theming -> -themes"); + WLog_WARN(TAG, "--disable-theming -> -themes"); } CommandLineSwitchCase(arg, "ntlm") { @@ -816,7 +835,7 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe CommandLineSwitchCase(arg, "ignore-certificate") { settings->IgnoreCertificate = TRUE; - WLog_WARN(TAG, "--ignore-certificate -> /cert-ignore"); + WLog_WARN(TAG, "--ignore-certificate -> /cert-ignore"); } CommandLineSwitchCase(arg, "sec") { @@ -840,22 +859,22 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe settings->NlaSecurity = TRUE; } - WLog_WARN(TAG, "--sec %s -> /sec:%s", arg->Value, arg->Value); + WLog_WARN(TAG, "--sec %s -> /sec:%s", arg->Value, arg->Value); } CommandLineSwitchCase(arg, "no-rdp") { settings->RdpSecurity = FALSE; - WLog_WARN(TAG, "--no-rdp -> -sec-rdp"); + WLog_WARN(TAG, "--no-rdp -> -sec-rdp"); } CommandLineSwitchCase(arg, "no-tls") { settings->TlsSecurity = FALSE; - WLog_WARN(TAG, "--no-tls -> -sec-tls"); + WLog_WARN(TAG, "--no-tls -> -sec-tls"); } CommandLineSwitchCase(arg, "no-nla") { settings->NlaSecurity = FALSE; - WLog_WARN(TAG, "--no-nla -> -sec-nla"); + WLog_WARN(TAG, "--no-nla -> -sec-nla"); } CommandLineSwitchCase(arg, "secure-checksum") { @@ -865,14 +884,13 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe { } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); - WLog_WARN(TAG, "%s -> /v:%s", settings->ServerHostname, settings->ServerHostname); + WLog_WARN(TAG, "%s -> /v:%s", settings->ServerHostname, settings->ServerHostname); if (settings->ServerPort != 3389) - WLog_WARN(TAG, " /port:%"PRIu32"", settings->ServerPort); + WLog_WARN(TAG, " /port:%" PRIu32 "", settings->ServerPort); - WLog_WARN(TAG, ""); + WLog_WARN(TAG, ""); return 0; } diff --git a/client/common/compatibility.h b/client/common/compatibility.h index 83c0d984f..b512a40da 100644 --- a/client/common/compatibility.h +++ b/client/common/compatibility.h @@ -24,7 +24,7 @@ #include FREERDP_LOCAL int freerdp_detect_old_command_line_syntax(int argc, char** argv, size_t* count); -FREERDP_LOCAL int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSettings* settings); +FREERDP_LOCAL int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, + rdpSettings* settings); #endif /* FREERDP_CLIENT_COMMON_COMPATIBILITY_H */ - diff --git a/client/common/file.c b/client/common/file.c index 3be1a237e..dbfc65ce8 100644 --- a/client/common/file.c +++ b/client/common/file.c @@ -18,7 +18,7 @@ */ #ifdef HAVE_CONFIG_H -# include "config.h" +#include "config.h" #endif #include @@ -40,7 +40,7 @@ #include #ifdef HAVE_UNISTD_H -# include +#include #endif #include @@ -121,7 +121,7 @@ struct rdp_file DWORD BitmapCacheSize; /* bitmapcachesize */ DWORD BitmapCachePersistEnable; /* bitmapcachepersistenable */ - DWORD ServerPort; /* server port */ + DWORD ServerPort; /* server port */ LPSTR Username; /* username */ LPSTR Domain; /* domain */ @@ -154,8 +154,8 @@ struct rdp_file DWORD NegotiateSecurityLayer; /* negotiate security layer */ DWORD EnableCredSSPSupport; /* enablecredsspsupport */ - DWORD RemoteApplicationMode; /* remoteapplicationmode */ - LPSTR LoadBalanceInfo; /* loadbalanceinfo */ + DWORD RemoteApplicationMode; /* remoteapplicationmode */ + LPSTR LoadBalanceInfo; /* loadbalanceinfo */ LPSTR RemoteApplicationName; /* remoteapplicationname */ LPSTR RemoteApplicationIcon; /* remoteapplicationicon */ @@ -178,7 +178,7 @@ struct rdp_file DWORD UseRedirectionServerName; /* use redirection server name */ - LPSTR GatewayAccessToken; /* gatewayaccesstoken */ + LPSTR GatewayAccessToken; /* gatewayaccesstoken */ LPSTR DrivesToRedirect; /* drivestoredirect */ LPSTR DevicesToRedirect; /* devicestoredirect */ @@ -211,7 +211,7 @@ struct rdp_file */ static BOOL freerdp_client_rdp_file_set_integer(rdpFile* file, const char* name, long value, - SSIZE_T index) + SSIZE_T index) { BOOL standard = TRUE; #ifdef DEBUG_CLIENT_FILE @@ -371,15 +371,15 @@ static BOOL freerdp_client_rdp_file_set_integer(rdpFile* file, const char* name, } static BOOL freerdp_client_parse_rdp_file_integer(rdpFile* file, const char* name, - const char* value, SSIZE_T index) + const char* value, SSIZE_T index) { char* endptr; long ivalue; errno = 0; ivalue = strtol(value, &endptr, 0); - if ((endptr == NULL) || (errno != 0) || (endptr == value) || - (ivalue > INT32_MAX) || (ivalue < INT32_MIN)) + if ((endptr == NULL) || (errno != 0) || (endptr == value) || (ivalue > INT32_MAX) || + (ivalue < INT32_MIN)) { if (file->flags & RDP_FILE_FLAG_PARSE_INT_RELAXED) { @@ -407,7 +407,7 @@ static BOOL freerdp_client_parse_rdp_file_integer(rdpFile* file, const char* nam */ static int freerdp_client_rdp_file_set_string(rdpFile* file, const char* name, const char* value, - SSIZE_T index) + SSIZE_T index) { int standard = 0; LPSTR* tmp = NULL; @@ -551,7 +551,8 @@ static SSIZE_T freerdp_client_parse_rdp_file_add_line(rdpFile* file, const char* return index; } -static BOOL freerdp_client_parse_rdp_file_string(rdpFile* file, char* name, char* value, SSIZE_T index) +static BOOL freerdp_client_parse_rdp_file_string(rdpFile* file, char* name, char* value, + SSIZE_T index) { BOOL ret = TRUE; char* valueA = _strdup(value); @@ -593,10 +594,10 @@ static BOOL trim(char** strptr) return TRUE; end = str + strlen(str) - 1; - while(isspace(*str)) + while (isspace(*str)) str++; - while((end > str) && isspace(*end)) + while ((end > str) && isspace(*end)) end--; end[1] = '\0'; if (start == str) @@ -844,12 +845,14 @@ BOOL freerdp_client_parse_rdp_file_ex(rdpFile* file, const char* name, rdp_file_ #define SETTING_MODIFIED(_settings, _field) \ (WRITE_ALL_SETTINGS || _settings->SettingsModified[FreeRDP_##_field]) #define SETTING_MODIFIED_SET(_target, _settings, _field) \ - if SETTING_MODIFIED(_settings, _field) \ - _target = _settings->_field + if \ + SETTING_MODIFIED(_settings, _field) \ + _target = _settings->_field #define SETTING_MODIFIED_SET_BOOL(_target, _settings, _field) \ - if SETTING_MODIFIED(_settings, _field) \ - _target = _settings->_field ? 1 : 0 + if \ + SETTING_MODIFIED(_settings, _field) \ + _target = _settings->_field ? 1 : 0 #define SETTING_MODIFIED_SET_STRING(_target, _settings, _field) \ do \ @@ -980,7 +983,7 @@ BOOL freerdp_client_write_rdp_file(const rdpFile* file, const char* name, BOOL u #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" static SSIZE_T freerdp_client_write_setting_to_buffer(char** buffer, size_t* bufferSize, - const char* fmt, ...) + const char* fmt, ...) { va_list ap; SSIZE_T len; @@ -1031,87 +1034,88 @@ size_t freerdp_client_write_rdp_file_buffer(const rdpFile* file, char* buffer, s if ((!buffer || !size) && (buffer || size)) return 0; -#define WRITE_SETTING_(fmt_, param_) \ - { \ +#define WRITE_SETTING_(fmt_, param_) \ + { \ SSIZE_T res = freerdp_client_write_setting_to_buffer(&buffer, &size, fmt_, param_); \ - if (res < 0) \ - return 0; \ + if (res < 0) \ + return 0; \ totalSize += (size_t)res; \ } #define WRITE_SETTING_INT(fmt_, param_) \ if (~(param_)) \ - WRITE_SETTING_(fmt_, param_) + WRITE_SETTING_(fmt_, param_) #define WRITE_SETTING_STR(fmt_, param_) \ if (~(size_t)(param_)) \ - WRITE_SETTING_(fmt_, param_) + WRITE_SETTING_(fmt_, param_) /* integer parameters */ - WRITE_SETTING_INT("use multimon:i:%"PRIu32, file->UseMultiMon); - WRITE_SETTING_INT("screen mode id:i:%"PRIu32, file->ScreenModeId); - WRITE_SETTING_INT("span monitors:i:%"PRIu32, file->SpanMonitors); - WRITE_SETTING_INT("smart sizing:i:%"PRIu32, file->SmartSizing); - WRITE_SETTING_INT("enablesuperpan:i:%"PRIu32, file->EnableSuperSpan); - WRITE_SETTING_INT("superpanaccelerationfactor:i:%"PRIu32, file->SuperSpanAccelerationFactor); - WRITE_SETTING_INT("desktopwidth:i:%"PRIu32, file->DesktopWidth); - WRITE_SETTING_INT("desktopheight:i:%"PRIu32, file->DesktopHeight); - WRITE_SETTING_INT("desktop size id:i:%"PRIu32, file->DesktopSizeId); - WRITE_SETTING_INT("session bpp:i:%"PRIu32, file->SessionBpp); - WRITE_SETTING_INT("compression:i:%"PRIu32, file->Compression); - WRITE_SETTING_INT("keyboardhook:i:%"PRIu32, file->KeyboardHook); - WRITE_SETTING_INT("disable ctrl+alt+del:i:%"PRIu32, file->DisableCtrlAltDel); - WRITE_SETTING_INT("audiomode:i:%"PRIu32, file->AudioMode); - WRITE_SETTING_INT("audioqualitymode:i:%"PRIu32, file->AudioQualityMode); - WRITE_SETTING_INT("audiocapturemode:i:%"PRIu32, file->AudioCaptureMode); - WRITE_SETTING_INT("videoplaybackmode:i:%"PRIu32, file->VideoPlaybackMode); - WRITE_SETTING_INT("connection type:i:%"PRIu32, file->ConnectionType); - WRITE_SETTING_INT("networkautodetect:i:%"PRIu32, file->NetworkAutoDetect); - WRITE_SETTING_INT("bandwidthautodetect:i:%"PRIu32, file->BandwidthAutoDetect); - WRITE_SETTING_INT("pinconnectionbar:i:%"PRIu32, file->PinConnectionBar); - WRITE_SETTING_INT("displayconnectionbar:i:%"PRIu32, file->DisplayConnectionBar); - WRITE_SETTING_INT("workspaceid:i:%"PRIu32, file->WorkspaceId); - WRITE_SETTING_INT("enableworkspacereconnect:i:%"PRIu32, file->EnableWorkspaceReconnect); - WRITE_SETTING_INT("disable wallpaper:i:%"PRIu32, file->DisableWallpaper); - WRITE_SETTING_INT("allow font smoothing:i:%"PRIu32, file->AllowFontSmoothing); - WRITE_SETTING_INT("allow desktop composition:i:%"PRIu32, file->AllowDesktopComposition); - WRITE_SETTING_INT("disable full window drag:i:%"PRIu32, file->DisableFullWindowDrag); - WRITE_SETTING_INT("disable menu anims:i:%"PRIu32, file->DisableMenuAnims); - WRITE_SETTING_INT("disable themes:i:%"PRIu32, file->DisableThemes); - WRITE_SETTING_INT("disable cursor setting:i:%"PRIu32, file->DisableCursorSetting); - WRITE_SETTING_INT("bitmapcachesize:i:%"PRIu32, file->BitmapCacheSize); - WRITE_SETTING_INT("bitmapcachepersistenable:i:%"PRIu32, file->BitmapCachePersistEnable); - WRITE_SETTING_INT("server port:i:%"PRIu32, file->ServerPort); - WRITE_SETTING_INT("redirectdrives:i:%"PRIu32, file->RedirectDrives); - WRITE_SETTING_INT("redirectprinters:i:%"PRIu32, file->RedirectPrinters); - WRITE_SETTING_INT("redirectcomports:i:%"PRIu32, file->RedirectComPorts); - WRITE_SETTING_INT("redirectsmartcards:i:%"PRIu32, file->RedirectSmartCards); - WRITE_SETTING_INT("redirectclipboard:i:%"PRIu32, file->RedirectClipboard); - WRITE_SETTING_INT("redirectposdevices:i:%"PRIu32, file->RedirectPosDevices); - WRITE_SETTING_INT("redirectdirectx:i:%"PRIu32, file->RedirectDirectX); - WRITE_SETTING_INT("disableprinterredirection:i:%"PRIu32, file->DisablePrinterRedirection); - WRITE_SETTING_INT("disableclipboardredirection:i:%"PRIu32, file->DisableClipboardRedirection); - WRITE_SETTING_INT("connect to console:i:%"PRIu32, file->ConnectToConsole); - WRITE_SETTING_INT("administrative session:i:%"PRIu32, file->AdministrativeSession); - WRITE_SETTING_INT("autoreconnection enabled:i:%"PRIu32, file->AutoReconnectionEnabled); - WRITE_SETTING_INT("autoreconnect max retries:i:%"PRIu32, file->AutoReconnectMaxRetries); - WRITE_SETTING_INT("public mode:i:%"PRIu32, file->PublicMode); - WRITE_SETTING_INT("authentication level:i:%"PRId32, file->AuthenticationLevel); - WRITE_SETTING_INT("promptcredentialonce:i:%"PRIu32, file->PromptCredentialOnce); - WRITE_SETTING_INT("prompt for credentials:i:%"PRIu32, file->PromptForCredentials); - WRITE_SETTING_INT("negotiate security layer:i:%"PRIu32, file->NegotiateSecurityLayer); - WRITE_SETTING_INT("enablecredsspsupport:i:%"PRIu32, file->EnableCredSSPSupport); - WRITE_SETTING_INT("remoteapplicationmode:i:%"PRIu32, file->RemoteApplicationMode); - WRITE_SETTING_INT("remoteapplicationexpandcmdline:i:%"PRIu32, file->RemoteApplicationExpandCmdLine); - WRITE_SETTING_INT("remoteapplicationexpandworkingdir:i:%"PRIu32, - file->RemoteApplicationExpandWorkingDir); - WRITE_SETTING_INT("disableconnectionsharing:i:%"PRIu32, file->DisableConnectionSharing); - WRITE_SETTING_INT("disableremoteappcapscheck:i:%"PRIu32, file->DisableRemoteAppCapsCheck); - WRITE_SETTING_INT("gatewayusagemethod:i:%"PRIu32, file->GatewayUsageMethod); - WRITE_SETTING_INT("gatewayprofileusagemethod:i:%"PRIu32, file->GatewayProfileUsageMethod); - WRITE_SETTING_INT("gatewaycredentialssource:i:%"PRIu32, file->GatewayCredentialsSource); - WRITE_SETTING_INT("use redirection server name:i:%"PRIu32, file->UseRedirectionServerName); - WRITE_SETTING_INT("rdgiskdcproxy:i:%"PRIu32, file->RdgIsKdcProxy); + WRITE_SETTING_INT("use multimon:i:%" PRIu32, file->UseMultiMon); + WRITE_SETTING_INT("screen mode id:i:%" PRIu32, file->ScreenModeId); + WRITE_SETTING_INT("span monitors:i:%" PRIu32, file->SpanMonitors); + WRITE_SETTING_INT("smart sizing:i:%" PRIu32, file->SmartSizing); + WRITE_SETTING_INT("enablesuperpan:i:%" PRIu32, file->EnableSuperSpan); + WRITE_SETTING_INT("superpanaccelerationfactor:i:%" PRIu32, file->SuperSpanAccelerationFactor); + WRITE_SETTING_INT("desktopwidth:i:%" PRIu32, file->DesktopWidth); + WRITE_SETTING_INT("desktopheight:i:%" PRIu32, file->DesktopHeight); + WRITE_SETTING_INT("desktop size id:i:%" PRIu32, file->DesktopSizeId); + WRITE_SETTING_INT("session bpp:i:%" PRIu32, file->SessionBpp); + WRITE_SETTING_INT("compression:i:%" PRIu32, file->Compression); + WRITE_SETTING_INT("keyboardhook:i:%" PRIu32, file->KeyboardHook); + WRITE_SETTING_INT("disable ctrl+alt+del:i:%" PRIu32, file->DisableCtrlAltDel); + WRITE_SETTING_INT("audiomode:i:%" PRIu32, file->AudioMode); + WRITE_SETTING_INT("audioqualitymode:i:%" PRIu32, file->AudioQualityMode); + WRITE_SETTING_INT("audiocapturemode:i:%" PRIu32, file->AudioCaptureMode); + WRITE_SETTING_INT("videoplaybackmode:i:%" PRIu32, file->VideoPlaybackMode); + WRITE_SETTING_INT("connection type:i:%" PRIu32, file->ConnectionType); + WRITE_SETTING_INT("networkautodetect:i:%" PRIu32, file->NetworkAutoDetect); + WRITE_SETTING_INT("bandwidthautodetect:i:%" PRIu32, file->BandwidthAutoDetect); + WRITE_SETTING_INT("pinconnectionbar:i:%" PRIu32, file->PinConnectionBar); + WRITE_SETTING_INT("displayconnectionbar:i:%" PRIu32, file->DisplayConnectionBar); + WRITE_SETTING_INT("workspaceid:i:%" PRIu32, file->WorkspaceId); + WRITE_SETTING_INT("enableworkspacereconnect:i:%" PRIu32, file->EnableWorkspaceReconnect); + WRITE_SETTING_INT("disable wallpaper:i:%" PRIu32, file->DisableWallpaper); + WRITE_SETTING_INT("allow font smoothing:i:%" PRIu32, file->AllowFontSmoothing); + WRITE_SETTING_INT("allow desktop composition:i:%" PRIu32, file->AllowDesktopComposition); + WRITE_SETTING_INT("disable full window drag:i:%" PRIu32, file->DisableFullWindowDrag); + WRITE_SETTING_INT("disable menu anims:i:%" PRIu32, file->DisableMenuAnims); + WRITE_SETTING_INT("disable themes:i:%" PRIu32, file->DisableThemes); + WRITE_SETTING_INT("disable cursor setting:i:%" PRIu32, file->DisableCursorSetting); + WRITE_SETTING_INT("bitmapcachesize:i:%" PRIu32, file->BitmapCacheSize); + WRITE_SETTING_INT("bitmapcachepersistenable:i:%" PRIu32, file->BitmapCachePersistEnable); + WRITE_SETTING_INT("server port:i:%" PRIu32, file->ServerPort); + WRITE_SETTING_INT("redirectdrives:i:%" PRIu32, file->RedirectDrives); + WRITE_SETTING_INT("redirectprinters:i:%" PRIu32, file->RedirectPrinters); + WRITE_SETTING_INT("redirectcomports:i:%" PRIu32, file->RedirectComPorts); + WRITE_SETTING_INT("redirectsmartcards:i:%" PRIu32, file->RedirectSmartCards); + WRITE_SETTING_INT("redirectclipboard:i:%" PRIu32, file->RedirectClipboard); + WRITE_SETTING_INT("redirectposdevices:i:%" PRIu32, file->RedirectPosDevices); + WRITE_SETTING_INT("redirectdirectx:i:%" PRIu32, file->RedirectDirectX); + WRITE_SETTING_INT("disableprinterredirection:i:%" PRIu32, file->DisablePrinterRedirection); + WRITE_SETTING_INT("disableclipboardredirection:i:%" PRIu32, file->DisableClipboardRedirection); + WRITE_SETTING_INT("connect to console:i:%" PRIu32, file->ConnectToConsole); + WRITE_SETTING_INT("administrative session:i:%" PRIu32, file->AdministrativeSession); + WRITE_SETTING_INT("autoreconnection enabled:i:%" PRIu32, file->AutoReconnectionEnabled); + WRITE_SETTING_INT("autoreconnect max retries:i:%" PRIu32, file->AutoReconnectMaxRetries); + WRITE_SETTING_INT("public mode:i:%" PRIu32, file->PublicMode); + WRITE_SETTING_INT("authentication level:i:%" PRId32, file->AuthenticationLevel); + WRITE_SETTING_INT("promptcredentialonce:i:%" PRIu32, file->PromptCredentialOnce); + WRITE_SETTING_INT("prompt for credentials:i:%" PRIu32, file->PromptForCredentials); + WRITE_SETTING_INT("negotiate security layer:i:%" PRIu32, file->NegotiateSecurityLayer); + WRITE_SETTING_INT("enablecredsspsupport:i:%" PRIu32, file->EnableCredSSPSupport); + WRITE_SETTING_INT("remoteapplicationmode:i:%" PRIu32, file->RemoteApplicationMode); + WRITE_SETTING_INT("remoteapplicationexpandcmdline:i:%" PRIu32, + file->RemoteApplicationExpandCmdLine); + WRITE_SETTING_INT("remoteapplicationexpandworkingdir:i:%" PRIu32, + file->RemoteApplicationExpandWorkingDir); + WRITE_SETTING_INT("disableconnectionsharing:i:%" PRIu32, file->DisableConnectionSharing); + WRITE_SETTING_INT("disableremoteappcapscheck:i:%" PRIu32, file->DisableRemoteAppCapsCheck); + WRITE_SETTING_INT("gatewayusagemethod:i:%" PRIu32, file->GatewayUsageMethod); + WRITE_SETTING_INT("gatewayprofileusagemethod:i:%" PRIu32, file->GatewayProfileUsageMethod); + WRITE_SETTING_INT("gatewaycredentialssource:i:%" PRIu32, file->GatewayCredentialsSource); + WRITE_SETTING_INT("use redirection server name:i:%" PRIu32, file->UseRedirectionServerName); + WRITE_SETTING_INT("rdgiskdcproxy:i:%" PRIu32, file->RdgIsKdcProxy); /* string parameters */ WRITE_SETTING_STR("username:s:%s", file->Username); @@ -1234,27 +1238,29 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* if (~file->ConnectToConsole) { - if (!freerdp_settings_set_bool(settings, FreeRDP_ConsoleSession, file->ConnectToConsole != 0)) + if (!freerdp_settings_set_bool(settings, FreeRDP_ConsoleSession, + file->ConnectToConsole != 0)) return FALSE; } if (~file->AdministrativeSession) { if (!freerdp_settings_set_bool(settings, FreeRDP_ConsoleSession, - file->AdministrativeSession != 0)) + file->AdministrativeSession != 0)) return FALSE; } if (~file->NegotiateSecurityLayer) { if (!freerdp_settings_set_bool(settings, FreeRDP_NegotiateSecurityLayer, - file->NegotiateSecurityLayer != 0)) + file->NegotiateSecurityLayer != 0)) return FALSE; } if (~file->EnableCredSSPSupport) { - if (!freerdp_settings_set_bool(settings, FreeRDP_NlaSecurity, file->EnableCredSSPSupport != 0)) + if (!freerdp_settings_set_bool(settings, FreeRDP_NlaSecurity, + file->EnableCredSSPSupport != 0)) return FALSE; } @@ -1335,7 +1341,7 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* if (~file->AudioMode) { - switch(file->AudioMode) + switch (file->AudioMode) { case AUDIO_MODE_REDIRECT: if (!freerdp_settings_set_bool(settings, FreeRDP_RemoteConsoleAudio, FALSE)) @@ -1367,7 +1373,8 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* if (~file->Compression) { - if (!freerdp_settings_set_bool(settings, FreeRDP_CompressionEnabled, file->Compression != 0)) + if (!freerdp_settings_set_bool(settings, FreeRDP_CompressionEnabled, + file->Compression != 0)) return FALSE; } @@ -1407,21 +1414,21 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* if (~file->PromptCredentialOnce) { if (!freerdp_settings_set_bool(settings, FreeRDP_GatewayUseSameCredentials, - file->PromptCredentialOnce != 0)) + file->PromptCredentialOnce != 0)) return FALSE; } if (~file->PromptForCredentials) { if (!freerdp_settings_set_bool(settings, FreeRDP_PromptForCredentials, - file->PromptForCredentials != 0)) + file->PromptForCredentials != 0)) return FALSE; } if (~file->RemoteApplicationMode) { if (!freerdp_settings_set_bool(settings, FreeRDP_RemoteApplicationMode, - file->RemoteApplicationMode != 0)) + file->RemoteApplicationMode != 0)) return FALSE; } @@ -1482,26 +1489,28 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* if (~file->AllowFontSmoothing) { if (!freerdp_settings_set_bool(settings, FreeRDP_AllowFontSmoothing, - file->AllowFontSmoothing != 0)) + file->AllowFontSmoothing != 0)) return FALSE; } if (~file->DisableWallpaper) { - if (!freerdp_settings_set_bool(settings, FreeRDP_DisableWallpaper, file->DisableWallpaper != 0)) + if (!freerdp_settings_set_bool(settings, FreeRDP_DisableWallpaper, + file->DisableWallpaper != 0)) return FALSE; } if (~file->DisableFullWindowDrag) { if (!freerdp_settings_set_bool(settings, FreeRDP_DisableFullWindowDrag, - file->DisableFullWindowDrag != 0)) + file->DisableFullWindowDrag != 0)) return FALSE; } if (~file->DisableMenuAnims) { - if (!freerdp_settings_set_bool(settings, FreeRDP_DisableMenuAnims, file->DisableMenuAnims != 0)) + if (!freerdp_settings_set_bool(settings, FreeRDP_DisableMenuAnims, + file->DisableMenuAnims != 0)) return FALSE; } @@ -1514,14 +1523,14 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* if (~file->AllowDesktopComposition) { if (!freerdp_settings_set_bool(settings, FreeRDP_AllowDesktopComposition, - file->AllowDesktopComposition != 0)) + file->AllowDesktopComposition != 0)) return FALSE; } if (~file->BitmapCachePersistEnable) { if (!freerdp_settings_set_bool(settings, FreeRDP_BitmapCachePersistEnabled, - file->BitmapCachePersistEnable != 0)) + file->BitmapCachePersistEnable != 0)) return FALSE; } @@ -1540,7 +1549,8 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* return FALSE; setDefaultConnectionType = FALSE; } - if (!freerdp_settings_set_bool(settings, FreeRDP_NetworkAutoDetect, file->BandwidthAutoDetect != 0)) + if (!freerdp_settings_set_bool(settings, FreeRDP_NetworkAutoDetect, + file->BandwidthAutoDetect != 0)) return FALSE; } @@ -1550,23 +1560,30 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* { if (file->BandwidthAutoDetect != CONNECTION_TYPE_AUTODETECT) { - WLog_WARN(TAG, "Got networkautodetect:i:%"PRIu32" and bandwidthautodetect:i:%"PRIu32". Correcting to bandwidthautodetect:i:%"PRIu32, - file->NetworkAutoDetect, file->BandwidthAutoDetect, CONNECTION_TYPE_AUTODETECT); - WLog_WARN(TAG, "Add bandwidthautodetect:i:%"PRIu32" to your RDP file to eliminate this warning.", CONNECTION_TYPE_AUTODETECT); + WLog_WARN(TAG, + "Got networkautodetect:i:%" PRIu32 " and bandwidthautodetect:i:%" PRIu32 + ". Correcting to bandwidthautodetect:i:%" PRIu32, + file->NetworkAutoDetect, file->BandwidthAutoDetect, + CONNECTION_TYPE_AUTODETECT); + WLog_WARN(TAG, + "Add bandwidthautodetect:i:%" PRIu32 + " to your RDP file to eliminate this warning.", + CONNECTION_TYPE_AUTODETECT); } if (!freerdp_set_connection_type(settings, CONNECTION_TYPE_AUTODETECT)) return FALSE; setDefaultConnectionType = FALSE; } - if (!freerdp_settings_set_bool(settings, FreeRDP_NetworkAutoDetect, file->NetworkAutoDetect == 0)) + if (!freerdp_settings_set_bool(settings, FreeRDP_NetworkAutoDetect, + file->NetworkAutoDetect == 0)) return FALSE; } if (~file->AutoReconnectionEnabled) { if (!freerdp_settings_set_bool(settings, FreeRDP_AutoReconnectionEnabled, - file->AutoReconnectionEnabled != 0)) + file->AutoReconnectionEnabled != 0)) return FALSE; } @@ -1580,20 +1597,21 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* if (~file->RedirectSmartCards) { if (!freerdp_settings_set_bool(settings, FreeRDP_RedirectSmartCards, - file->RedirectSmartCards != 0)) + file->RedirectSmartCards != 0)) return FALSE; } if (~file->RedirectClipboard) { if (!freerdp_settings_set_bool(settings, FreeRDP_RedirectClipboard, - file->RedirectClipboard != 0)) + file->RedirectClipboard != 0)) return FALSE; } if (~file->RedirectPrinters) { - if (!freerdp_settings_set_bool(settings, FreeRDP_RedirectPrinters, file->RedirectPrinters != 0)) + if (!freerdp_settings_set_bool(settings, FreeRDP_RedirectPrinters, + file->RedirectPrinters != 0)) return FALSE; } @@ -1606,18 +1624,18 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* if (~file->RedirectPosDevices) { if (!freerdp_settings_set_bool(settings, FreeRDP_RedirectSerialPorts, - file->RedirectComPorts != 0) || + file->RedirectComPorts != 0) || !freerdp_settings_set_bool(settings, FreeRDP_RedirectParallelPorts, - file->RedirectComPorts != 0)) + file->RedirectComPorts != 0)) return FALSE; } if (~file->RedirectComPorts) { if (!freerdp_settings_set_bool(settings, FreeRDP_RedirectSerialPorts, - file->RedirectComPorts != 0) || + file->RedirectComPorts != 0) || !freerdp_settings_set_bool(settings, FreeRDP_RedirectParallelPorts, - file->RedirectComPorts != 0)) + file->RedirectComPorts != 0)) return FALSE; } @@ -1658,7 +1676,8 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* if (~((size_t)file->DrivesToRedirect)) { - if (!freerdp_settings_set_string(settings, FreeRDP_DrivesToRedirect, file->DrivesToRedirect)) + if (!freerdp_settings_set_string(settings, FreeRDP_DrivesToRedirect, + file->DrivesToRedirect)) return FALSE; } @@ -1682,7 +1701,8 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* char* ConnectionFile = settings->ConnectionFile; settings->ConnectionFile = NULL; - if (freerdp_client_settings_parse_command_line(settings, (int)file->argc, file->argv, FALSE) < 0) + if (freerdp_client_settings_parse_command_line(settings, (int)file->argc, file->argv, + FALSE) < 0) return FALSE; settings->ConnectionFile = ConnectionFile; diff --git a/client/common/test/TestClientChannels.c b/client/common/test/TestClientChannels.c index b63cf983b..d6a55d319 100644 --- a/client/common/test/TestClientChannels.c +++ b/client/common/test/TestClientChannels.c @@ -23,8 +23,8 @@ int TestClientChannels(int argc, char* argv[]) { pAddin = ppAddins[index]; - printf("Addin: Name: %s Subsystem: %s Type: %s\n", - pAddin->cName, pAddin->cSubsystem, pAddin->cType); + printf("Addin: Name: %s Subsystem: %s Type: %s\n", pAddin->cName, pAddin->cSubsystem, + pAddin->cType); } freerdp_channels_addin_list_free(ppAddins); @@ -36,8 +36,8 @@ int TestClientChannels(int argc, char* argv[]) { pAddin = ppAddins[index]; - printf("Addin: Name: %s Subsystem: %s Type: %s\n", - pAddin->cName, pAddin->cSubsystem, pAddin->cType); + printf("Addin: Name: %s Subsystem: %s Type: %s\n", pAddin->cName, pAddin->cSubsystem, + pAddin->cType); } freerdp_channels_addin_list_free(ppAddins); @@ -49,8 +49,8 @@ int TestClientChannels(int argc, char* argv[]) { pAddin = ppAddins[index]; - printf("Addin: Name: %s Subsystem: %s Type: %s\n", - pAddin->cName, pAddin->cSubsystem, pAddin->cType); + printf("Addin: Name: %s Subsystem: %s Type: %s\n", pAddin->cName, pAddin->cSubsystem, + pAddin->cType); } freerdp_channels_addin_list_free(ppAddins); @@ -61,8 +61,8 @@ int TestClientChannels(int argc, char* argv[]) { pAddin = ppAddins[index]; - printf("Addin: Name: %s Subsystem: %s Type: %s\n", - pAddin->cName, pAddin->cSubsystem, pAddin->cType); + printf("Addin: Name: %s Subsystem: %s Type: %s\n", pAddin->cName, pAddin->cSubsystem, + pAddin->cType); } freerdp_channels_addin_list_free(ppAddins); @@ -76,8 +76,8 @@ int TestClientChannels(int argc, char* argv[]) { pAddin = ppAddins[index]; - printf("Addin: Name: %s Subsystem: %s Type: %s\n", - pAddin->cName, pAddin->cSubsystem, pAddin->cType); + printf("Addin: Name: %s Subsystem: %s Type: %s\n", pAddin->cName, pAddin->cSubsystem, + pAddin->cType); } freerdp_channels_addin_list_free(ppAddins); diff --git a/client/common/test/TestClientCmdLine.c b/client/common/test/TestClientCmdLine.c index ccf23b228..55754f7ba 100644 --- a/client/common/test/TestClientCmdLine.c +++ b/client/common/test/TestClientCmdLine.c @@ -6,34 +6,34 @@ #include #include - typedef BOOL (*validate_settings_pr)(rdpSettings* settings); #define printref() printf("%s:%d: in function %-40s:", __FILE__, __LINE__, __FUNCTION__) -#define ERROR(format, ...) \ - do{ \ - fprintf(stderr, format, ##__VA_ARGS__); \ - printref(); \ - printf(format, ##__VA_ARGS__); \ - fflush(stdout); \ - }while(0) - -#define FAILURE(format, ...) \ - do{ \ - printref(); \ - printf(" FAILURE "); \ - printf(format, ##__VA_ARGS__); \ - fflush(stdout); \ - }while(0) +#define ERROR(format, ...) \ + do \ + { \ + fprintf(stderr, format, ##__VA_ARGS__); \ + printref(); \ + printf(format, ##__VA_ARGS__); \ + fflush(stdout); \ + } while (0) +#define FAILURE(format, ...) \ + do \ + { \ + printref(); \ + printf(" FAILURE "); \ + printf(format, ##__VA_ARGS__); \ + fflush(stdout); \ + } while (0) static void print_test_title(int argc, char** argv) { int i; printf("Running test:"); - for (i = 0; i < argc; i ++) + for (i = 0; i < argc; i++) { printf(" %s", argv[i]); } @@ -41,8 +41,8 @@ static void print_test_title(int argc, char** argv) printf("\n"); } -static INLINE BOOL testcase(const char* name, char** argv, size_t argc, - int expected_return, validate_settings_pr validate_settings) +static INLINE BOOL testcase(const char* name, char** argv, size_t argc, int expected_return, + validate_settings_pr validate_settings) { int status; BOOL valid_settings = TRUE; @@ -113,117 +113,96 @@ typedef struct struct { int index; - const char* expected_value; + const char* expected_value; } modified_arguments[8]; } test; -static test tests[] = -{ - { - COMMAND_LINE_STATUS_PRINT_HELP, check_settings_smartcard_no_redirection, - {"testfreerdp", "--help", 0}, - {{0}} - }, - { - COMMAND_LINE_STATUS_PRINT_HELP, check_settings_smartcard_no_redirection, - {"testfreerdp", "/help", 0}, - {{0}} - }, - { - COMMAND_LINE_STATUS_PRINT_HELP, check_settings_smartcard_no_redirection, - {"testfreerdp", "-help", 0}, - {{0}} - }, - { - COMMAND_LINE_STATUS_PRINT_VERSION, check_settings_smartcard_no_redirection, - {"testfreerdp", "--version", 0}, - {{0}} - }, - { - COMMAND_LINE_STATUS_PRINT_VERSION, check_settings_smartcard_no_redirection, - {"testfreerdp", "/version", 0}, - {{0}} - }, - { - COMMAND_LINE_STATUS_PRINT_VERSION, check_settings_smartcard_no_redirection, - {"testfreerdp", "-version", 0}, - {{0}} - }, - { - 0, check_settings_smartcard_no_redirection, - {"testfreerdp", "test.freerdp.com", 0}, - {{0}} - }, - { - 0, check_settings_smartcard_no_redirection, - {"testfreerdp", "-v", "test.freerdp.com", 0}, - {{0}} - }, - { - 0, check_settings_smartcard_no_redirection, - {"testfreerdp", "--v", "test.freerdp.com", 0}, - {{0}} - }, - { - 0, check_settings_smartcard_no_redirection, - {"testfreerdp", "/v:test.freerdp.com", 0}, - {{0}} - }, - { - 0, check_settings_smartcard_no_redirection, - {"testfreerdp", "--plugin", "rdpsnd", "--plugin", "rdpdr", "--data", "disk:media:"DRIVE_REDIRECT_PATH, "--", "test.freerdp.com", 0}, - {{0}} - }, - { - 0, check_settings_smartcard_no_redirection, - {"testfreerdp", "/sound", "/drive:media,"DRIVE_REDIRECT_PATH, "/v:test.freerdp.com", 0}, - {{0}} - }, - { - 0, check_settings_smartcard_no_redirection, - {"testfreerdp", "-u", "test", "-p", "test", "test.freerdp.com", 0}, - {{4, "****"}, {0}} - }, - { - 0, check_settings_smartcard_no_redirection, - {"testfreerdp", "-u", "test", "-p", "test", "-v", "test.freerdp.com", 0}, - {{4, "****"}, {0}} - }, - { - 0, check_settings_smartcard_no_redirection, - {"testfreerdp", "/u:test", "/p:test", "/v:test.freerdp.com", 0}, - {{2, "/p:****"}, {0}} - }, - { - COMMAND_LINE_ERROR_NO_KEYWORD, check_settings_smartcard_no_redirection, - {"testfreerdp", "-invalid", 0}, - {{0}} - }, - { - COMMAND_LINE_ERROR_NO_KEYWORD, check_settings_smartcard_no_redirection, - {"testfreerdp", "--invalid", 0}, - {{0}} - }, - { - COMMAND_LINE_STATUS_PRINT, check_settings_smartcard_no_redirection, - {"testfreerdp", "/kbd-list", 0}, - {{0}} - }, - { - COMMAND_LINE_STATUS_PRINT, check_settings_smartcard_no_redirection, - {"testfreerdp", "/monitor-list", 0}, - {{0}} - }, - { - COMMAND_LINE_ERROR, check_settings_smartcard_no_redirection, - {"testfreerdp", "/sound", "/drive:media:"DRIVE_REDIRECT_PATH, "/v:test.freerdp.com", 0}, - {{0}} - }, - { - COMMAND_LINE_ERROR, check_settings_smartcard_no_redirection, - {"testfreerdp", "/sound", "/drive:media,/foo/bar/blabla", "/v:test.freerdp.com", 0}, - {{0}} - }, +static test tests[] = { + { COMMAND_LINE_STATUS_PRINT_HELP, + check_settings_smartcard_no_redirection, + { "testfreerdp", "--help", 0 }, + { { 0 } } }, + { COMMAND_LINE_STATUS_PRINT_HELP, + check_settings_smartcard_no_redirection, + { "testfreerdp", "/help", 0 }, + { { 0 } } }, + { COMMAND_LINE_STATUS_PRINT_HELP, + check_settings_smartcard_no_redirection, + { "testfreerdp", "-help", 0 }, + { { 0 } } }, + { COMMAND_LINE_STATUS_PRINT_VERSION, + check_settings_smartcard_no_redirection, + { "testfreerdp", "--version", 0 }, + { { 0 } } }, + { COMMAND_LINE_STATUS_PRINT_VERSION, + check_settings_smartcard_no_redirection, + { "testfreerdp", "/version", 0 }, + { { 0 } } }, + { COMMAND_LINE_STATUS_PRINT_VERSION, + check_settings_smartcard_no_redirection, + { "testfreerdp", "-version", 0 }, + { { 0 } } }, + { 0, + check_settings_smartcard_no_redirection, + { "testfreerdp", "test.freerdp.com", 0 }, + { { 0 } } }, + { 0, + check_settings_smartcard_no_redirection, + { "testfreerdp", "-v", "test.freerdp.com", 0 }, + { { 0 } } }, + { 0, + check_settings_smartcard_no_redirection, + { "testfreerdp", "--v", "test.freerdp.com", 0 }, + { { 0 } } }, + { 0, + check_settings_smartcard_no_redirection, + { "testfreerdp", "/v:test.freerdp.com", 0 }, + { { 0 } } }, + { 0, + check_settings_smartcard_no_redirection, + { "testfreerdp", "--plugin", "rdpsnd", "--plugin", "rdpdr", "--data", + "disk:media:" DRIVE_REDIRECT_PATH, "--", "test.freerdp.com", 0 }, + { { 0 } } }, + { 0, + check_settings_smartcard_no_redirection, + { "testfreerdp", "/sound", "/drive:media," DRIVE_REDIRECT_PATH, "/v:test.freerdp.com", 0 }, + { { 0 } } }, + { 0, + check_settings_smartcard_no_redirection, + { "testfreerdp", "-u", "test", "-p", "test", "test.freerdp.com", 0 }, + { { 4, "****" }, { 0 } } }, + { 0, + check_settings_smartcard_no_redirection, + { "testfreerdp", "-u", "test", "-p", "test", "-v", "test.freerdp.com", 0 }, + { { 4, "****" }, { 0 } } }, + { 0, + check_settings_smartcard_no_redirection, + { "testfreerdp", "/u:test", "/p:test", "/v:test.freerdp.com", 0 }, + { { 2, "/p:****" }, { 0 } } }, + { COMMAND_LINE_ERROR_NO_KEYWORD, + check_settings_smartcard_no_redirection, + { "testfreerdp", "-invalid", 0 }, + { { 0 } } }, + { COMMAND_LINE_ERROR_NO_KEYWORD, + check_settings_smartcard_no_redirection, + { "testfreerdp", "--invalid", 0 }, + { { 0 } } }, + { COMMAND_LINE_STATUS_PRINT, + check_settings_smartcard_no_redirection, + { "testfreerdp", "/kbd-list", 0 }, + { { 0 } } }, + { COMMAND_LINE_STATUS_PRINT, + check_settings_smartcard_no_redirection, + { "testfreerdp", "/monitor-list", 0 }, + { { 0 } } }, + { COMMAND_LINE_ERROR, + check_settings_smartcard_no_redirection, + { "testfreerdp", "/sound", "/drive:media:" DRIVE_REDIRECT_PATH, "/v:test.freerdp.com", 0 }, + { { 0 } } }, + { COMMAND_LINE_ERROR, + check_settings_smartcard_no_redirection, + { "testfreerdp", "/sound", "/drive:media,/foo/bar/blabla", "/v:test.freerdp.com", 0 }, + { { 0 } } }, #if 0 { @@ -234,13 +213,12 @@ static test tests[] = #endif }; - void check_modified_arguments(test* test, char** command_line, int* rc) { int k; - const char* expected_argument; + const char* expected_argument; - for (k = 0; (expected_argument = test->modified_arguments[k].expected_value); k ++) + for (k = 0; (expected_argument = test->modified_arguments[k].expected_value); k++) { int index = test->modified_arguments[k].index; char* actual_argument = command_line[index]; @@ -248,10 +226,10 @@ void check_modified_arguments(test* test, char** command_line, int* rc) if (0 != strcmp(actual_argument, expected_argument)) { printref(); - printf("Failure: overridden argument %d is %s but it should be %s\n", - index, actual_argument, expected_argument); + printf("Failure: overridden argument %d is %s but it should be %s\n", index, + actual_argument, expected_argument); fflush(stdout); - * rc = -1; + *rc = -1; } } } @@ -263,24 +241,24 @@ int TestClientCmdLine(int argc, char* argv[]) WINPR_UNUSED(argc); WINPR_UNUSED(argv); - for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i ++) + for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) { int failure = 0; char** command_line = string_list_copy(tests[i].command_line); - if (!testcase(__FUNCTION__, - command_line, string_list_length((const char * const*)command_line), + if (!testcase(__FUNCTION__, command_line, + string_list_length((const char* const*)command_line), tests[i].expected_status, tests[i].validate_settings)) { FAILURE("parsing arguments.\n"); failure = 1; } - check_modified_arguments(& tests[i], command_line, & failure); + check_modified_arguments(&tests[i], command_line, &failure); if (failure) { - string_list_print(stdout, (const char * const*)command_line); + string_list_print(stdout, (const char* const*)command_line); rc = -1; } diff --git a/client/common/test/TestClientRdpFile.c b/client/common/test/TestClientRdpFile.c index c9d852744..ca4a79499 100644 --- a/client/common/test/TestClientRdpFile.c +++ b/client/common/test/TestClientRdpFile.c @@ -7,261 +7,209 @@ #include -static const BYTE testRdpFileUTF16[] = -{ - 0xff, 0xfe, 0x73, 0x00, 0x63, 0x00, 0x72, 0x00, 0x65, 0x00, 0x65, 0x00, - 0x6e, 0x00, 0x20, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, - 0x20, 0x00, 0x69, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, - 0x32, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x75, 0x00, 0x73, 0x00, 0x65, 0x00, - 0x20, 0x00, 0x6d, 0x00, 0x75, 0x00, 0x6c, 0x00, 0x74, 0x00, 0x69, 0x00, - 0x6d, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, - 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x65, 0x00, 0x73, 0x00, - 0x6b, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x77, 0x00, 0x69, 0x00, - 0x64, 0x00, 0x74, 0x00, 0x68, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, - 0x31, 0x00, 0x39, 0x00, 0x32, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, - 0x64, 0x00, 0x65, 0x00, 0x73, 0x00, 0x6b, 0x00, 0x74, 0x00, 0x6f, 0x00, - 0x70, 0x00, 0x68, 0x00, 0x65, 0x00, 0x69, 0x00, 0x67, 0x00, 0x68, 0x00, - 0x74, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x30, 0x00, - 0x38, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x73, 0x00, 0x65, 0x00, - 0x73, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, - 0x62, 0x00, 0x70, 0x00, 0x70, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, - 0x33, 0x00, 0x32, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x77, 0x00, 0x69, 0x00, - 0x6e, 0x00, 0x70, 0x00, 0x6f, 0x00, 0x73, 0x00, 0x73, 0x00, 0x74, 0x00, - 0x72, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x2c, 0x00, - 0x31, 0x00, 0x2c, 0x00, 0x35, 0x00, 0x35, 0x00, 0x33, 0x00, 0x2c, 0x00, - 0x32, 0x00, 0x31, 0x00, 0x31, 0x00, 0x2c, 0x00, 0x31, 0x00, 0x33, 0x00, - 0x35, 0x00, 0x33, 0x00, 0x2c, 0x00, 0x38, 0x00, 0x31, 0x00, 0x31, 0x00, - 0x0d, 0x00, 0x0a, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00, - 0x72, 0x00, 0x65, 0x00, 0x73, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, - 0x6e, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, - 0x0a, 0x00, 0x6b, 0x00, 0x65, 0x00, 0x79, 0x00, 0x62, 0x00, 0x6f, 0x00, - 0x61, 0x00, 0x72, 0x00, 0x64, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x6f, 0x00, - 0x6b, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x32, 0x00, 0x0d, 0x00, - 0x0a, 0x00, 0x61, 0x00, 0x75, 0x00, 0x64, 0x00, 0x69, 0x00, 0x6f, 0x00, - 0x63, 0x00, 0x61, 0x00, 0x70, 0x00, 0x74, 0x00, 0x75, 0x00, 0x72, 0x00, - 0x65, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x3a, 0x00, - 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x76, 0x00, - 0x69, 0x00, 0x64, 0x00, 0x65, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x6c, 0x00, - 0x61, 0x00, 0x79, 0x00, 0x62, 0x00, 0x61, 0x00, 0x63, 0x00, 0x6b, 0x00, - 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, - 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x63, 0x00, 0x6f, 0x00, - 0x6e, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, - 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x74, 0x00, 0x79, 0x00, 0x70, 0x00, - 0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x37, 0x00, 0x0d, 0x00, - 0x0a, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x74, 0x00, 0x77, 0x00, 0x6f, 0x00, - 0x72, 0x00, 0x6b, 0x00, 0x61, 0x00, 0x75, 0x00, 0x74, 0x00, 0x6f, 0x00, - 0x64, 0x00, 0x65, 0x00, 0x74, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, - 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, - 0x62, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x77, 0x00, 0x69, 0x00, - 0x64, 0x00, 0x74, 0x00, 0x68, 0x00, 0x61, 0x00, 0x75, 0x00, 0x74, 0x00, - 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x74, 0x00, 0x65, 0x00, 0x63, 0x00, - 0x74, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, - 0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, 0x70, 0x00, 0x6c, 0x00, - 0x61, 0x00, 0x79, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x6e, 0x00, - 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, - 0x62, 0x00, 0x61, 0x00, 0x72, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, - 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x61, 0x00, - 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x77, 0x00, 0x6f, 0x00, 0x72, 0x00, - 0x6b, 0x00, 0x73, 0x00, 0x70, 0x00, 0x61, 0x00, 0x63, 0x00, 0x65, 0x00, - 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x6e, 0x00, - 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, - 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, - 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x20, 0x00, 0x77, 0x00, - 0x61, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x70, 0x00, 0x61, 0x00, 0x70, 0x00, - 0x65, 0x00, 0x72, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, - 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x6f, 0x00, - 0x77, 0x00, 0x20, 0x00, 0x66, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x74, 0x00, - 0x20, 0x00, 0x73, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x74, 0x00, - 0x68, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x67, 0x00, 0x3a, 0x00, 0x69, 0x00, - 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x6c, 0x00, - 0x6c, 0x00, 0x6f, 0x00, 0x77, 0x00, 0x20, 0x00, 0x64, 0x00, 0x65, 0x00, - 0x73, 0x00, 0x6b, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x20, 0x00, - 0x63, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00, 0x6f, 0x00, 0x73, 0x00, - 0x69, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x3a, 0x00, - 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, - 0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, - 0x20, 0x00, 0x66, 0x00, 0x75, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x20, 0x00, - 0x77, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x6f, 0x00, 0x77, 0x00, - 0x20, 0x00, 0x64, 0x00, 0x72, 0x00, 0x61, 0x00, 0x67, 0x00, 0x3a, 0x00, - 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, - 0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, - 0x20, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x75, 0x00, 0x20, 0x00, - 0x61, 0x00, 0x6e, 0x00, 0x69, 0x00, 0x6d, 0x00, 0x73, 0x00, 0x3a, 0x00, - 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, - 0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, - 0x20, 0x00, 0x74, 0x00, 0x68, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x65, 0x00, - 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, - 0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00, - 0x6c, 0x00, 0x65, 0x00, 0x20, 0x00, 0x63, 0x00, 0x75, 0x00, 0x72, 0x00, - 0x73, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x20, 0x00, 0x73, 0x00, 0x65, 0x00, - 0x74, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x67, 0x00, 0x3a, 0x00, - 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x62, 0x00, - 0x69, 0x00, 0x74, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x70, 0x00, 0x63, 0x00, - 0x61, 0x00, 0x63, 0x00, 0x68, 0x00, 0x65, 0x00, 0x70, 0x00, 0x65, 0x00, - 0x72, 0x00, 0x73, 0x00, 0x69, 0x00, 0x73, 0x00, 0x74, 0x00, 0x65, 0x00, - 0x6e, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x3a, 0x00, - 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x66, 0x00, - 0x75, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x20, 0x00, 0x61, 0x00, 0x64, 0x00, - 0x64, 0x00, 0x72, 0x00, 0x65, 0x00, 0x73, 0x00, 0x73, 0x00, 0x3a, 0x00, - 0x73, 0x00, 0x3a, 0x00, 0x4c, 0x00, 0x41, 0x00, 0x42, 0x00, 0x31, 0x00, - 0x2d, 0x00, 0x57, 0x00, 0x37, 0x00, 0x2d, 0x00, 0x44, 0x00, 0x4d, 0x00, - 0x2d, 0x00, 0x30, 0x00, 0x31, 0x00, 0x2e, 0x00, 0x6c, 0x00, 0x61, 0x00, - 0x62, 0x00, 0x31, 0x00, 0x2e, 0x00, 0x61, 0x00, 0x77, 0x00, 0x61, 0x00, - 0x6b, 0x00, 0x65, 0x00, 0x2e, 0x00, 0x6c, 0x00, 0x6f, 0x00, 0x63, 0x00, - 0x61, 0x00, 0x6c, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x75, 0x00, - 0x64, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, - 0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, - 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00, - 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x70, 0x00, 0x72, 0x00, 0x69, 0x00, - 0x6e, 0x00, 0x74, 0x00, 0x65, 0x00, 0x72, 0x00, 0x73, 0x00, 0x3a, 0x00, - 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, - 0x65, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, - 0x74, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00, 0x6f, 0x00, - 0x72, 0x00, 0x74, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, - 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, - 0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x73, 0x00, - 0x6d, 0x00, 0x61, 0x00, 0x72, 0x00, 0x74, 0x00, 0x63, 0x00, 0x61, 0x00, - 0x72, 0x00, 0x64, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, - 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, - 0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x63, 0x00, - 0x6c, 0x00, 0x69, 0x00, 0x70, 0x00, 0x62, 0x00, 0x6f, 0x00, 0x61, 0x00, - 0x72, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, - 0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x69, 0x00, - 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x70, 0x00, 0x6f, 0x00, - 0x73, 0x00, 0x64, 0x00, 0x65, 0x00, 0x76, 0x00, 0x69, 0x00, 0x63, 0x00, - 0x65, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, - 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x75, 0x00, 0x74, 0x00, 0x6f, 0x00, - 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x6e, 0x00, - 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, - 0x20, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, - 0x65, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, - 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x75, 0x00, 0x74, 0x00, 0x68, 0x00, - 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x63, 0x00, 0x61, 0x00, - 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x6c, 0x00, - 0x65, 0x00, 0x76, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x3a, 0x00, 0x69, 0x00, - 0x3a, 0x00, 0x32, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x70, 0x00, 0x72, 0x00, - 0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00, 0x74, 0x00, 0x20, 0x00, 0x66, 0x00, - 0x6f, 0x00, 0x72, 0x00, 0x20, 0x00, 0x63, 0x00, 0x72, 0x00, 0x65, 0x00, - 0x64, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x61, 0x00, - 0x6c, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, - 0x0d, 0x00, 0x0a, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x67, 0x00, 0x6f, 0x00, - 0x74, 0x00, 0x69, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00, 0x20, 0x00, - 0x73, 0x00, 0x65, 0x00, 0x63, 0x00, 0x75, 0x00, 0x72, 0x00, 0x69, 0x00, - 0x74, 0x00, 0x79, 0x00, 0x20, 0x00, 0x6c, 0x00, 0x61, 0x00, 0x79, 0x00, - 0x65, 0x00, 0x72, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, - 0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x6f, 0x00, - 0x74, 0x00, 0x65, 0x00, 0x61, 0x00, 0x70, 0x00, 0x70, 0x00, 0x6c, 0x00, - 0x69, 0x00, 0x63, 0x00, 0x61, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, - 0x6e, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x3a, 0x00, - 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, - 0x6c, 0x00, 0x74, 0x00, 0x65, 0x00, 0x72, 0x00, 0x6e, 0x00, 0x61, 0x00, - 0x74, 0x00, 0x65, 0x00, 0x20, 0x00, 0x73, 0x00, 0x68, 0x00, 0x65, 0x00, - 0x6c, 0x00, 0x6c, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x0d, 0x00, - 0x0a, 0x00, 0x73, 0x00, 0x68, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c, 0x00, - 0x20, 0x00, 0x77, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x6b, 0x00, 0x69, 0x00, - 0x6e, 0x00, 0x67, 0x00, 0x20, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00, - 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x79, 0x00, - 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x67, 0x00, - 0x61, 0x00, 0x74, 0x00, 0x65, 0x00, 0x77, 0x00, 0x61, 0x00, 0x79, 0x00, - 0x68, 0x00, 0x6f, 0x00, 0x73, 0x00, 0x74, 0x00, 0x6e, 0x00, 0x61, 0x00, - 0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x4c, 0x00, - 0x41, 0x00, 0x42, 0x00, 0x31, 0x00, 0x2d, 0x00, 0x57, 0x00, 0x32, 0x00, - 0x4b, 0x00, 0x38, 0x00, 0x52, 0x00, 0x32, 0x00, 0x2d, 0x00, 0x47, 0x00, - 0x57, 0x00, 0x2e, 0x00, 0x6c, 0x00, 0x61, 0x00, 0x62, 0x00, 0x31, 0x00, - 0x2e, 0x00, 0x61, 0x00, 0x77, 0x00, 0x61, 0x00, 0x6b, 0x00, 0x65, 0x00, - 0x2e, 0x00, 0x6c, 0x00, 0x6f, 0x00, 0x63, 0x00, 0x61, 0x00, 0x6c, 0x00, - 0x0d, 0x00, 0x0a, 0x00, 0x67, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00, - 0x77, 0x00, 0x61, 0x00, 0x79, 0x00, 0x75, 0x00, 0x73, 0x00, 0x61, 0x00, - 0x67, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x74, 0x00, 0x68, 0x00, - 0x6f, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, - 0x0d, 0x00, 0x0a, 0x00, 0x67, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00, - 0x77, 0x00, 0x61, 0x00, 0x79, 0x00, 0x63, 0x00, 0x72, 0x00, 0x65, 0x00, - 0x64, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x61, 0x00, - 0x6c, 0x00, 0x73, 0x00, 0x73, 0x00, 0x6f, 0x00, 0x75, 0x00, 0x72, 0x00, - 0x63, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, - 0x0d, 0x00, 0x0a, 0x00, 0x67, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00, - 0x77, 0x00, 0x61, 0x00, 0x79, 0x00, 0x70, 0x00, 0x72, 0x00, 0x6f, 0x00, - 0x66, 0x00, 0x69, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x75, 0x00, 0x73, 0x00, - 0x61, 0x00, 0x67, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x74, 0x00, - 0x68, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, - 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x70, 0x00, 0x72, 0x00, 0x6f, 0x00, - 0x6d, 0x00, 0x70, 0x00, 0x74, 0x00, 0x63, 0x00, 0x72, 0x00, 0x65, 0x00, - 0x64, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x61, 0x00, - 0x6c, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x63, 0x00, 0x65, 0x00, 0x3a, 0x00, - 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x75, 0x00, - 0x73, 0x00, 0x65, 0x00, 0x20, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, - 0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, - 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x73, 0x00, 0x65, 0x00, 0x72, 0x00, - 0x76, 0x00, 0x65, 0x00, 0x72, 0x00, 0x20, 0x00, 0x6e, 0x00, 0x61, 0x00, - 0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, - 0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x64, 0x00, 0x67, 0x00, 0x69, 0x00, - 0x73, 0x00, 0x6b, 0x00, 0x64, 0x00, 0x63, 0x00, 0x70, 0x00, 0x72, 0x00, - 0x6f, 0x00, 0x78, 0x00, 0x79, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, - 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x6b, 0x00, 0x64, 0x00, 0x63, 0x00, - 0x70, 0x00, 0x72, 0x00, 0x6f, 0x00, 0x78, 0x00, 0x79, 0x00, 0x6e, 0x00, - 0x61, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, - 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x72, 0x00, 0x69, 0x00, 0x76, 0x00, - 0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x65, 0x00, - 0x64, 0x00, 0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, - 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x2a, 0x00, 0x0d, 0x00, 0x0a, 0x00, - 0x75, 0x00, 0x73, 0x00, 0x65, 0x00, 0x72, 0x00, 0x6e, 0x00, 0x61, 0x00, - 0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x4c, 0x00, - 0x41, 0x00, 0x42, 0x00, 0x31, 0x00, 0x5c, 0x00, 0x4a, 0x00, 0x6f, 0x00, - 0x68, 0x00, 0x6e, 0x00, 0x44, 0x00, 0x6f, 0x00, 0x65, 0x00, 0x0d, 0x00, - 0x0a, 0x00 +static const BYTE testRdpFileUTF16[] = { + 0xff, 0xfe, 0x73, 0x00, 0x63, 0x00, 0x72, 0x00, 0x65, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x20, 0x00, + 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x20, 0x00, 0x69, 0x00, 0x64, 0x00, 0x3a, 0x00, + 0x69, 0x00, 0x3a, 0x00, 0x32, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x75, 0x00, 0x73, 0x00, 0x65, 0x00, + 0x20, 0x00, 0x6d, 0x00, 0x75, 0x00, 0x6c, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6d, 0x00, 0x6f, 0x00, + 0x6e, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, + 0x65, 0x00, 0x73, 0x00, 0x6b, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x77, 0x00, 0x69, 0x00, + 0x64, 0x00, 0x74, 0x00, 0x68, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x39, 0x00, + 0x32, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x65, 0x00, 0x73, 0x00, 0x6b, 0x00, + 0x74, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x68, 0x00, 0x65, 0x00, 0x69, 0x00, 0x67, 0x00, 0x68, 0x00, + 0x74, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x30, 0x00, 0x38, 0x00, 0x30, 0x00, + 0x0d, 0x00, 0x0a, 0x00, 0x73, 0x00, 0x65, 0x00, 0x73, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, + 0x6e, 0x00, 0x20, 0x00, 0x62, 0x00, 0x70, 0x00, 0x70, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, + 0x33, 0x00, 0x32, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x77, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x70, 0x00, + 0x6f, 0x00, 0x73, 0x00, 0x73, 0x00, 0x74, 0x00, 0x72, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, + 0x30, 0x00, 0x2c, 0x00, 0x31, 0x00, 0x2c, 0x00, 0x35, 0x00, 0x35, 0x00, 0x33, 0x00, 0x2c, 0x00, + 0x32, 0x00, 0x31, 0x00, 0x31, 0x00, 0x2c, 0x00, 0x31, 0x00, 0x33, 0x00, 0x35, 0x00, 0x33, 0x00, + 0x2c, 0x00, 0x38, 0x00, 0x31, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x63, 0x00, 0x6f, 0x00, + 0x6d, 0x00, 0x70, 0x00, 0x72, 0x00, 0x65, 0x00, 0x73, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, + 0x6e, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x6b, 0x00, + 0x65, 0x00, 0x79, 0x00, 0x62, 0x00, 0x6f, 0x00, 0x61, 0x00, 0x72, 0x00, 0x64, 0x00, 0x68, 0x00, + 0x6f, 0x00, 0x6f, 0x00, 0x6b, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x32, 0x00, 0x0d, 0x00, + 0x0a, 0x00, 0x61, 0x00, 0x75, 0x00, 0x64, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x63, 0x00, 0x61, 0x00, + 0x70, 0x00, 0x74, 0x00, 0x75, 0x00, 0x72, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, + 0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x76, 0x00, + 0x69, 0x00, 0x64, 0x00, 0x65, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x6c, 0x00, 0x61, 0x00, 0x79, 0x00, + 0x62, 0x00, 0x61, 0x00, 0x63, 0x00, 0x6b, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, + 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x63, 0x00, 0x6f, 0x00, + 0x6e, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, + 0x20, 0x00, 0x74, 0x00, 0x79, 0x00, 0x70, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, + 0x37, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x74, 0x00, 0x77, 0x00, 0x6f, 0x00, + 0x72, 0x00, 0x6b, 0x00, 0x61, 0x00, 0x75, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, + 0x74, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, + 0x0d, 0x00, 0x0a, 0x00, 0x62, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x77, 0x00, 0x69, 0x00, + 0x64, 0x00, 0x74, 0x00, 0x68, 0x00, 0x61, 0x00, 0x75, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x64, 0x00, + 0x65, 0x00, 0x74, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, + 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, 0x70, 0x00, 0x6c, 0x00, + 0x61, 0x00, 0x79, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x63, 0x00, + 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x62, 0x00, 0x61, 0x00, 0x72, 0x00, 0x3a, 0x00, + 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x61, 0x00, + 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x77, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x6b, 0x00, 0x73, 0x00, + 0x70, 0x00, 0x61, 0x00, 0x63, 0x00, 0x65, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x6f, 0x00, + 0x6e, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, + 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00, + 0x6c, 0x00, 0x65, 0x00, 0x20, 0x00, 0x77, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x70, 0x00, + 0x61, 0x00, 0x70, 0x00, 0x65, 0x00, 0x72, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, + 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x6f, 0x00, 0x77, 0x00, 0x20, 0x00, + 0x66, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x20, 0x00, 0x73, 0x00, 0x6d, 0x00, 0x6f, 0x00, + 0x6f, 0x00, 0x74, 0x00, 0x68, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x67, 0x00, 0x3a, 0x00, 0x69, 0x00, + 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x6f, 0x00, + 0x77, 0x00, 0x20, 0x00, 0x64, 0x00, 0x65, 0x00, 0x73, 0x00, 0x6b, 0x00, 0x74, 0x00, 0x6f, 0x00, + 0x70, 0x00, 0x20, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00, 0x6f, 0x00, 0x73, 0x00, + 0x69, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, + 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00, + 0x6c, 0x00, 0x65, 0x00, 0x20, 0x00, 0x66, 0x00, 0x75, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x20, 0x00, + 0x77, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x6f, 0x00, 0x77, 0x00, 0x20, 0x00, 0x64, 0x00, + 0x72, 0x00, 0x61, 0x00, 0x67, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, + 0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, + 0x20, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x75, 0x00, 0x20, 0x00, 0x61, 0x00, 0x6e, 0x00, + 0x69, 0x00, 0x6d, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, + 0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, + 0x20, 0x00, 0x74, 0x00, 0x68, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x73, 0x00, 0x3a, 0x00, + 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, + 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x20, 0x00, 0x63, 0x00, 0x75, 0x00, 0x72, 0x00, + 0x73, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x20, 0x00, 0x73, 0x00, 0x65, 0x00, 0x74, 0x00, 0x74, 0x00, + 0x69, 0x00, 0x6e, 0x00, 0x67, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, + 0x0a, 0x00, 0x62, 0x00, 0x69, 0x00, 0x74, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x70, 0x00, 0x63, 0x00, + 0x61, 0x00, 0x63, 0x00, 0x68, 0x00, 0x65, 0x00, 0x70, 0x00, 0x65, 0x00, 0x72, 0x00, 0x73, 0x00, + 0x69, 0x00, 0x73, 0x00, 0x74, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, + 0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x66, 0x00, + 0x75, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x20, 0x00, 0x61, 0x00, 0x64, 0x00, 0x64, 0x00, 0x72, 0x00, + 0x65, 0x00, 0x73, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x4c, 0x00, 0x41, 0x00, + 0x42, 0x00, 0x31, 0x00, 0x2d, 0x00, 0x57, 0x00, 0x37, 0x00, 0x2d, 0x00, 0x44, 0x00, 0x4d, 0x00, + 0x2d, 0x00, 0x30, 0x00, 0x31, 0x00, 0x2e, 0x00, 0x6c, 0x00, 0x61, 0x00, 0x62, 0x00, 0x31, 0x00, + 0x2e, 0x00, 0x61, 0x00, 0x77, 0x00, 0x61, 0x00, 0x6b, 0x00, 0x65, 0x00, 0x2e, 0x00, 0x6c, 0x00, + 0x6f, 0x00, 0x63, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x75, 0x00, + 0x64, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x3a, 0x00, + 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, + 0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x70, 0x00, 0x72, 0x00, 0x69, 0x00, + 0x6e, 0x00, 0x74, 0x00, 0x65, 0x00, 0x72, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, + 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00, + 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00, 0x6f, 0x00, + 0x72, 0x00, 0x74, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, + 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, + 0x74, 0x00, 0x73, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x72, 0x00, 0x74, 0x00, 0x63, 0x00, 0x61, 0x00, + 0x72, 0x00, 0x64, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, + 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, + 0x74, 0x00, 0x63, 0x00, 0x6c, 0x00, 0x69, 0x00, 0x70, 0x00, 0x62, 0x00, 0x6f, 0x00, 0x61, 0x00, + 0x72, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, + 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, + 0x70, 0x00, 0x6f, 0x00, 0x73, 0x00, 0x64, 0x00, 0x65, 0x00, 0x76, 0x00, 0x69, 0x00, 0x63, 0x00, + 0x65, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, + 0x61, 0x00, 0x75, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x6f, 0x00, + 0x6e, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, + 0x20, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x64, 0x00, + 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x75, 0x00, + 0x74, 0x00, 0x68, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x63, 0x00, 0x61, 0x00, + 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x76, 0x00, + 0x65, 0x00, 0x6c, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x32, 0x00, 0x0d, 0x00, 0x0a, 0x00, + 0x70, 0x00, 0x72, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00, 0x74, 0x00, 0x20, 0x00, 0x66, 0x00, + 0x6f, 0x00, 0x72, 0x00, 0x20, 0x00, 0x63, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x65, 0x00, + 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, + 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x67, 0x00, 0x6f, 0x00, + 0x74, 0x00, 0x69, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00, 0x20, 0x00, 0x73, 0x00, 0x65, 0x00, + 0x63, 0x00, 0x75, 0x00, 0x72, 0x00, 0x69, 0x00, 0x74, 0x00, 0x79, 0x00, 0x20, 0x00, 0x6c, 0x00, + 0x61, 0x00, 0x79, 0x00, 0x65, 0x00, 0x72, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, + 0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x74, 0x00, 0x65, 0x00, + 0x61, 0x00, 0x70, 0x00, 0x70, 0x00, 0x6c, 0x00, 0x69, 0x00, 0x63, 0x00, 0x61, 0x00, 0x74, 0x00, + 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x3a, 0x00, + 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x74, 0x00, + 0x65, 0x00, 0x72, 0x00, 0x6e, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00, 0x20, 0x00, 0x73, 0x00, + 0x68, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x0d, 0x00, + 0x0a, 0x00, 0x73, 0x00, 0x68, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x20, 0x00, 0x77, 0x00, + 0x6f, 0x00, 0x72, 0x00, 0x6b, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x67, 0x00, 0x20, 0x00, 0x64, 0x00, + 0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x79, 0x00, + 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x67, 0x00, 0x61, 0x00, 0x74, 0x00, + 0x65, 0x00, 0x77, 0x00, 0x61, 0x00, 0x79, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x73, 0x00, 0x74, 0x00, + 0x6e, 0x00, 0x61, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x4c, 0x00, + 0x41, 0x00, 0x42, 0x00, 0x31, 0x00, 0x2d, 0x00, 0x57, 0x00, 0x32, 0x00, 0x4b, 0x00, 0x38, 0x00, + 0x52, 0x00, 0x32, 0x00, 0x2d, 0x00, 0x47, 0x00, 0x57, 0x00, 0x2e, 0x00, 0x6c, 0x00, 0x61, 0x00, + 0x62, 0x00, 0x31, 0x00, 0x2e, 0x00, 0x61, 0x00, 0x77, 0x00, 0x61, 0x00, 0x6b, 0x00, 0x65, 0x00, + 0x2e, 0x00, 0x6c, 0x00, 0x6f, 0x00, 0x63, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x0d, 0x00, 0x0a, 0x00, + 0x67, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00, 0x77, 0x00, 0x61, 0x00, 0x79, 0x00, 0x75, 0x00, + 0x73, 0x00, 0x61, 0x00, 0x67, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x74, 0x00, 0x68, 0x00, + 0x6f, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, + 0x67, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00, 0x77, 0x00, 0x61, 0x00, 0x79, 0x00, 0x63, 0x00, + 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x61, 0x00, + 0x6c, 0x00, 0x73, 0x00, 0x73, 0x00, 0x6f, 0x00, 0x75, 0x00, 0x72, 0x00, 0x63, 0x00, 0x65, 0x00, + 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x67, 0x00, 0x61, 0x00, + 0x74, 0x00, 0x65, 0x00, 0x77, 0x00, 0x61, 0x00, 0x79, 0x00, 0x70, 0x00, 0x72, 0x00, 0x6f, 0x00, + 0x66, 0x00, 0x69, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x75, 0x00, 0x73, 0x00, 0x61, 0x00, 0x67, 0x00, + 0x65, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x74, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x3a, 0x00, + 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x70, 0x00, 0x72, 0x00, 0x6f, 0x00, + 0x6d, 0x00, 0x70, 0x00, 0x74, 0x00, 0x63, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x65, 0x00, + 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x63, 0x00, + 0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x75, 0x00, + 0x73, 0x00, 0x65, 0x00, 0x20, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00, + 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x73, 0x00, + 0x65, 0x00, 0x72, 0x00, 0x76, 0x00, 0x65, 0x00, 0x72, 0x00, 0x20, 0x00, 0x6e, 0x00, 0x61, 0x00, + 0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, + 0x72, 0x00, 0x64, 0x00, 0x67, 0x00, 0x69, 0x00, 0x73, 0x00, 0x6b, 0x00, 0x64, 0x00, 0x63, 0x00, + 0x70, 0x00, 0x72, 0x00, 0x6f, 0x00, 0x78, 0x00, 0x79, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, + 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x6b, 0x00, 0x64, 0x00, 0x63, 0x00, 0x70, 0x00, 0x72, 0x00, + 0x6f, 0x00, 0x78, 0x00, 0x79, 0x00, 0x6e, 0x00, 0x61, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, + 0x73, 0x00, 0x3a, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x72, 0x00, 0x69, 0x00, 0x76, 0x00, + 0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x69, 0x00, + 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x2a, 0x00, + 0x0d, 0x00, 0x0a, 0x00, 0x75, 0x00, 0x73, 0x00, 0x65, 0x00, 0x72, 0x00, 0x6e, 0x00, 0x61, 0x00, + 0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x4c, 0x00, 0x41, 0x00, 0x42, 0x00, + 0x31, 0x00, 0x5c, 0x00, 0x4a, 0x00, 0x6f, 0x00, 0x68, 0x00, 0x6e, 0x00, 0x44, 0x00, 0x6f, 0x00, + 0x65, 0x00, 0x0d, 0x00, 0x0a, 0x00 }; -static char testRdpFileUTF8[] = - "screen mode id:i:2\n" - "use multimon:i:0\n" - "desktopwidth:i:1920\n" - "desktopheight:i:1080\n" - "session bpp:i:32\n" - "winposstr:s:0,1,553,211,1353,811\n" - "compression:i:1\n" - "keyboardhook:i:2\n" - "audiocapturemode:i:0\n" - "videoplaybackmode:i:1\n" - "connection type:i:7\n" - "networkautodetect:i:1\n" - "bandwidthautodetect:i:1\n" - "displayconnectionbar:i:1\n" - "enableworkspacereconnect:i:0\n" - "disable wallpaper:i:0\n" - "allow font smoothing:i:0\n" - "allow desktop composition:i:0\n" - "disable full window drag:i:1\n" - "disable menu anims:i:1\n" - "disable themes:i:0\n" - "disable cursor setting:i:0\n" - "bitmapcachepersistenable:i:1\n" - "full address:s:LAB1-W7-DM-01.lab1.awake.local\n" - "alternate full address:s:LAB1-W7-DM-01.lab1.awake.global\n" - "audiomode:i:0\n" - "redirectprinters:i:1\n" - "redirectcomports:i:0\n" - "redirectsmartcards:i:1\n" - "redirectclipboard:i:1\n" - "redirectposdevices:i:0\n" - "autoreconnection enabled:i:1\n" - "authentication level:i:2\n" - "prompt for credentials:i:0\n" - "negotiate security layer:i:1\n" - "remoteapplicationmode:i:0\n" - "alternate shell:s:\n" - "shell working directory:s:\n" - "gatewayhostname:s:LAB1-W2K8R2-GW.lab1.awake.local\n" - "gatewayusagemethod:i:1\n" - "gatewaycredentialssource:i:0\n" - "gatewayprofileusagemethod:i:1\n" - "promptcredentialonce:i:1\n" - "use redirection server name:i:0\n" - "rdgiskdcproxy:i:0\n" - "kdcproxyname:s:\n" - "drivestoredirect:s:*\n" - "username:s:LAB1\\JohnDoe\n" - "vendor integer:i:123\n" - "vendor string:s:microsoft\n"; +static char testRdpFileUTF8[] = "screen mode id:i:2\n" + "use multimon:i:0\n" + "desktopwidth:i:1920\n" + "desktopheight:i:1080\n" + "session bpp:i:32\n" + "winposstr:s:0,1,553,211,1353,811\n" + "compression:i:1\n" + "keyboardhook:i:2\n" + "audiocapturemode:i:0\n" + "videoplaybackmode:i:1\n" + "connection type:i:7\n" + "networkautodetect:i:1\n" + "bandwidthautodetect:i:1\n" + "displayconnectionbar:i:1\n" + "enableworkspacereconnect:i:0\n" + "disable wallpaper:i:0\n" + "allow font smoothing:i:0\n" + "allow desktop composition:i:0\n" + "disable full window drag:i:1\n" + "disable menu anims:i:1\n" + "disable themes:i:0\n" + "disable cursor setting:i:0\n" + "bitmapcachepersistenable:i:1\n" + "full address:s:LAB1-W7-DM-01.lab1.awake.local\n" + "alternate full address:s:LAB1-W7-DM-01.lab1.awake.global\n" + "audiomode:i:0\n" + "redirectprinters:i:1\n" + "redirectcomports:i:0\n" + "redirectsmartcards:i:1\n" + "redirectclipboard:i:1\n" + "redirectposdevices:i:0\n" + "autoreconnection enabled:i:1\n" + "authentication level:i:2\n" + "prompt for credentials:i:0\n" + "negotiate security layer:i:1\n" + "remoteapplicationmode:i:0\n" + "alternate shell:s:\n" + "shell working directory:s:\n" + "gatewayhostname:s:LAB1-W2K8R2-GW.lab1.awake.local\n" + "gatewayusagemethod:i:1\n" + "gatewaycredentialssource:i:0\n" + "gatewayprofileusagemethod:i:1\n" + "promptcredentialonce:i:1\n" + "use redirection server name:i:0\n" + "rdgiskdcproxy:i:0\n" + "kdcproxyname:s:\n" + "drivestoredirect:s:*\n" + "username:s:LAB1\\JohnDoe\n" + "vendor integer:i:123\n" + "vendor string:s:microsoft\n"; static char* append(const char* fmt, ...) { @@ -324,13 +272,14 @@ int TestClientRdpFile(int argc, char* argv[]) if (settings->UseMultimon) { - printf("UseMultiMon mismatch: Actual: %"PRIu32", Expected: 0\n", settings->UseMultimon); + printf("UseMultiMon mismatch: Actual: %" PRIu32 ", Expected: 0\n", settings->UseMultimon); goto fail; } if (!settings->Fullscreen) { - printf("ScreenModeId mismatch: Actual: %"PRIu32", Expected: TRUE\n", settings->Fullscreen); + printf("ScreenModeId mismatch: Actual: %" PRIu32 ", Expected: TRUE\n", + settings->Fullscreen); goto fail; } @@ -345,15 +294,15 @@ int TestClientRdpFile(int argc, char* argv[]) if (strcmp(settings->GatewayHostname, "LAB1-W2K8R2-GW.lab1.awake.local") != 0) { - printf("GatewayHostname mismatch: Actual: %s, Expected: %s\n", - settings->GatewayHostname, "LAB1-W2K8R2-GW.lab1.awake.local"); + printf("GatewayHostname mismatch: Actual: %s, Expected: %s\n", settings->GatewayHostname, + "LAB1-W2K8R2-GW.lab1.awake.local"); goto fail; } if (strcmp(settings->ServerHostname, "LAB1-W7-DM-01.lab1.awake.local") != 0) { - printf("ServerHostname mismatch: Actual: %s, Expected: %s\n", - settings->ServerHostname, "LAB1-W7-DM-01.lab1.awake.local"); + printf("ServerHostname mismatch: Actual: %s, Expected: %s\n", settings->ServerHostname, + "LAB1-W7-DM-01.lab1.awake.local"); goto fail; } @@ -368,7 +317,8 @@ int TestClientRdpFile(int argc, char* argv[]) goto fail; } - if (!freerdp_client_parse_rdp_file_buffer(file, (BYTE*) testRdpFileUTF8, sizeof(testRdpFileUTF8))) + if (!freerdp_client_parse_rdp_file_buffer(file, (BYTE*)testRdpFileUTF8, + sizeof(testRdpFileUTF8))) goto fail; if (!freerdp_client_populate_settings_from_rdp_file(file, settings)) @@ -376,13 +326,14 @@ int TestClientRdpFile(int argc, char* argv[]) if (settings->UseMultimon != 0) { - printf("UseMultiMon mismatch: Actual: %"PRIu32", Expected: 0\n", settings->UseMultimon); + printf("UseMultiMon mismatch: Actual: %" PRIu32 ", Expected: 0\n", settings->UseMultimon); return -1; } if (!settings->Fullscreen) { - printf("ScreenModeId mismatch: Actual: %"PRIu32", Expected: TRUE\n", settings->Fullscreen); + printf("ScreenModeId mismatch: Actual: %" PRIu32 ", Expected: TRUE\n", + settings->Fullscreen); return -1; } @@ -397,15 +348,15 @@ int TestClientRdpFile(int argc, char* argv[]) if (strcmp(settings->ServerHostname, "LAB1-W7-DM-01.lab1.awake.global") != 0) { - printf("ServerHostname mismatch: Actual: %s, Expected: %s\n", - settings->ServerHostname, "LAB1-W7-DM-01.lab1.awake.global"); + printf("ServerHostname mismatch: Actual: %s, Expected: %s\n", settings->ServerHostname, + "LAB1-W7-DM-01.lab1.awake.global"); goto fail; } if (strcmp(settings->GatewayHostname, "LAB1-W2K8R2-GW.lab1.awake.local") != 0) { - printf("GatewayHostname mismatch: Actual: %s, Expected: %s\n", - settings->GatewayHostname, "LAB1-W2K8R2-GW.lab1.awake.local"); + printf("GatewayHostname mismatch: Actual: %s, Expected: %s\n", settings->GatewayHostname, + "LAB1-W2K8R2-GW.lab1.awake.local"); goto fail; } @@ -446,7 +397,7 @@ int TestClientRdpFile(int argc, char* argv[]) if (!tmp) goto fail; - base = append("%s/rdp-file-test-%"PRIx64, tmp, id); + base = append("%s/rdp-file-test-%" PRIx64, tmp, id); if (!base) goto fail; if (!CreateDirectoryA(base, NULL)) @@ -463,7 +414,7 @@ int TestClientRdpFile(int argc, char* argv[]) if (!freerdp_client_write_rdp_file(file, utfname, FALSE)) goto fail; - if (!freerdp_client_write_rdp_file(file, uniname, TRUE)) + if (!freerdp_client_write_rdp_file(file, uniname, TRUE)) goto fail; rc = 0; diff --git a/client/iOS/Additions/OrderedDictionary.m b/client/iOS/Additions/OrderedDictionary.m index 63b8cff34..e7081948e 100644 --- a/client/iOS/Additions/OrderedDictionary.m +++ b/client/iOS/Additions/OrderedDictionary.m @@ -129,18 +129,18 @@ NSString *DescriptionForObject(NSObject *object, id locale, NSUInteger indent) - (NSUInteger)indexForKey:(id)key { - return [array indexOfObject:key]; + return [array indexOfObject:key]; } - (NSUInteger)indexForValue:(id)value { - NSArray* keys = [self allKeysForObject:value]; - if ([keys count] > 0) - { - return [self indexForKey:[keys objectAtIndex:0]]; - } - - return NSNotFound; + NSArray *keys = [self allKeysForObject:value]; + if ([keys count] > 0) + { + return [self indexForKey:[keys objectAtIndex:0]]; + } + + return NSNotFound; } - (NSString *)descriptionWithLocale:(id)locale indent:(NSUInteger)level @@ -151,15 +151,14 @@ NSString *DescriptionForObject(NSObject *object, id locale, NSUInteger indent) { [indentString appendFormat:@" "]; } - + NSMutableString *description = [NSMutableString string]; [description appendFormat:@"%@{\n", indentString]; for (NSObject *key in self) { - [description appendFormat:@"%@ %@ = %@;\n", - indentString, - DescriptionForObject(key, locale, level), - DescriptionForObject([self objectForKey:key], locale, level)]; + [description appendFormat:@"%@ %@ = %@;\n", indentString, + DescriptionForObject(key, locale, level), + DescriptionForObject([self objectForKey:key], locale, level)]; } [description appendFormat:@"%@}\n", indentString]; return description; diff --git a/client/iOS/Additions/TSXAdditions.h b/client/iOS/Additions/TSXAdditions.h index d18cc33c8..1f041331e 100644 --- a/client/iOS/Additions/TSXAdditions.h +++ b/client/iOS/Additions/TSXAdditions.h @@ -1,10 +1,11 @@ /* Additions to Cocoa touch classes - + Copyright 2013 Thincast Technologies GmbH, Authors: Dorian Johnson, Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @@ -15,9 +16,12 @@ #pragma mark - @interface NSString (TSXAdditions) -+ (NSString*)stringWithUUID; -- (NSData*)dataFromHexString; -+ (NSString*)hexStringFromData:(const unsigned char *)data ofSize:(unsigned int)size withSeparator:(NSString *)sep afterNthChar:(int)sepnth; ++ (NSString *)stringWithUUID; +- (NSData *)dataFromHexString; ++ (NSString *)hexStringFromData:(const unsigned char *)data + ofSize:(unsigned int)size + withSeparator:(NSString *)sep + afterNthChar:(int)sepnth; @end @interface NSDictionary (TSXAdditions) diff --git a/client/iOS/Additions/TSXAdditions.m b/client/iOS/Additions/TSXAdditions.m index bc2c6a0c4..9a5ac3d74 100644 --- a/client/iOS/Additions/TSXAdditions.m +++ b/client/iOS/Additions/TSXAdditions.m @@ -1,10 +1,11 @@ /* Additions to Cocoa touch classes - + Copyright 2013 Thincast Technologies GmbH, Authors: Dorian Johnson, Martin Fleisz - + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "TSXAdditions.h" @@ -21,12 +22,12 @@ - mutableDeepCopy { - if([self respondsToSelector:@selector(mutableCopyWithZone:)]) - return [self mutableCopy]; - else if([self respondsToSelector:@selector(copyWithZone:)]) - return [self copy]; - else - return [self retain]; + if ([self respondsToSelector:@selector(mutableCopyWithZone:)]) + return [self mutableCopy]; + else if ([self respondsToSelector:@selector(copyWithZone:)]) + return [self copy]; + else + return [self retain]; } @end @@ -36,71 +37,88 @@ @implementation NSString (TSXAdditions) #pragma mark Creation routines -+ (NSString*)stringWithUUID ++ (NSString *)stringWithUUID { CFUUIDRef uuidObj = CFUUIDCreate(nil); - NSString* uuidString = (NSString*)CFUUIDCreateString(nil, uuidObj); + NSString *uuidString = (NSString *)CFUUIDCreateString(nil, uuidObj); CFRelease(uuidObj); return [uuidString autorelease]; } -/* Code from http://code.google.com/p/google-toolbox-for-mac/source/browse/trunk/Foundation/GTMNSData%2BHex.m?r=344 */ -- (NSData*)dataFromHexString +/* Code from + * http://code.google.com/p/google-toolbox-for-mac/source/browse/trunk/Foundation/GTMNSData%2BHex.m?r=344 + */ +- (NSData *)dataFromHexString { - NSData *hexData = [self dataUsingEncoding:NSASCIIStringEncoding]; - const char *hexBuf = [hexData bytes]; - NSUInteger hexLen = [hexData length]; - - // This indicates an error converting to ASCII. - if (!hexData) - return nil; - - if ((hexLen % 2) != 0) { - return nil; - } - - NSMutableData *binaryData = [NSMutableData dataWithLength:(hexLen / 2)]; - unsigned char *binaryPtr = [binaryData mutableBytes]; - unsigned char value = 0; - for (NSUInteger i = 0; i < hexLen; i++) { - char c = hexBuf[i]; - - if (!isxdigit(c)) { - return nil; - } - - if (isdigit(c)) { - value += c - '0'; - } else if (islower(c)) { - value += 10 + c - 'a'; - } else { - value += 10 + c - 'A'; - } - - if (i & 1) { - *binaryPtr++ = value; - value = 0; - } else { - value <<= 4; - } - } - - return [NSData dataWithData:binaryData]; + NSData *hexData = [self dataUsingEncoding:NSASCIIStringEncoding]; + const char *hexBuf = [hexData bytes]; + NSUInteger hexLen = [hexData length]; + + // This indicates an error converting to ASCII. + if (!hexData) + return nil; + + if ((hexLen % 2) != 0) + { + return nil; + } + + NSMutableData *binaryData = [NSMutableData dataWithLength:(hexLen / 2)]; + unsigned char *binaryPtr = [binaryData mutableBytes]; + unsigned char value = 0; + for (NSUInteger i = 0; i < hexLen; i++) + { + char c = hexBuf[i]; + + if (!isxdigit(c)) + { + return nil; + } + + if (isdigit(c)) + { + value += c - '0'; + } + else if (islower(c)) + { + value += 10 + c - 'a'; + } + else + { + value += 10 + c - 'A'; + } + + if (i & 1) + { + *binaryPtr++ = value; + value = 0; + } + else + { + value <<= 4; + } + } + + return [NSData dataWithData:binaryData]; } -+ (NSString*)hexStringFromData:(const unsigned char *)data ofSize:(unsigned int)size withSeparator:(NSString *)sep afterNthChar:(int)sepnth ++ (NSString *)hexStringFromData:(const unsigned char *)data + ofSize:(unsigned int)size + withSeparator:(NSString *)sep + afterNthChar:(int)sepnth { int i; NSMutableString *result; NSString *immutableResult; - + result = [[NSMutableString alloc] init]; - for (i = 0; i < size; i++) { - if(i && sep && sepnth && i%sepnth==0) + for (i = 0; i < size; i++) + { + if (i && sep && sepnth && i % sepnth == 0) [result appendString:sep]; [result appendFormat:@"%02X", data[i]]; } - + immutableResult = [NSString stringWithString:result]; [result release]; return immutableResult; @@ -114,16 +132,16 @@ - mutableDeepCopy { - NSMutableDictionary *newDictionary = [[NSMutableDictionary alloc] init]; - NSEnumerator *enumerator = [self keyEnumerator]; - id key; - while((key = [enumerator nextObject])) - { - id obj = [[self objectForKey:key] mutableDeepCopy]; - [newDictionary setObject:obj forKey:key]; - [obj release]; - } - return newDictionary; + NSMutableDictionary *newDictionary = [[NSMutableDictionary alloc] init]; + NSEnumerator *enumerator = [self keyEnumerator]; + id key; + while ((key = [enumerator nextObject])) + { + id obj = [[self objectForKey:key] mutableDeepCopy]; + [newDictionary setObject:obj forKey:key]; + [obj release]; + } + return newDictionary; } @end @@ -132,16 +150,16 @@ - mutableDeepCopy { - NSMutableArray *newArray = [[NSMutableArray alloc] init]; - NSEnumerator *enumerator = [self objectEnumerator]; - id obj; - while((obj = [enumerator nextObject])) - { - obj = [obj mutableDeepCopy]; - [newArray addObject:obj]; - [obj release]; - } - return newArray; + NSMutableArray *newArray = [[NSMutableArray alloc] init]; + NSEnumerator *enumerator = [self objectEnumerator]; + id obj; + while ((obj = [enumerator nextObject])) + { + obj = [obj mutableDeepCopy]; + [newArray addObject:obj]; + [obj release]; + } + return newArray; } @end @@ -150,68 +168,71 @@ - mutableDeepCopy { - NSMutableSet *newSet = [[NSMutableSet alloc] init]; - NSEnumerator *enumerator = [self objectEnumerator]; - id obj; - while((obj = [enumerator nextObject])) - { - obj = [obj mutableDeepCopy]; - [newSet addObject:obj]; - [obj release]; - } - return newSet; + NSMutableSet *newSet = [[NSMutableSet alloc] init]; + NSEnumerator *enumerator = [self objectEnumerator]; + id obj; + while ((obj = [enumerator nextObject])) + { + obj = [obj mutableDeepCopy]; + [newSet addObject:obj]; + [obj release]; + } + return newSet; } @end - #pragma mark - -/* Code from http://stackoverflow.com/questions/1305225/best-way-to-serialize-a-nsdata-into-an-hexadeximal-string */ +/* Code from + * http://stackoverflow.com/questions/1305225/best-way-to-serialize-a-nsdata-into-an-hexadeximal-string + */ @implementation NSData (TSXAdditions) #pragma mark - String Conversion -- (NSString *)hexadecimalString { - /* Returns hexadecimal string of NSData. Empty string if data is empty. */ - - const unsigned char *dataBuffer = (const unsigned char *)[self bytes]; - - if (!dataBuffer) - return [NSString string]; - - NSUInteger dataLength = [self length]; - NSMutableString *hexString = [NSMutableString stringWithCapacity:(dataLength * 2)]; - - for (int i = 0; i < dataLength; ++i) - [hexString appendString:[NSString stringWithFormat:@"%02lx", (unsigned long)dataBuffer[i]]]; - - return [NSString stringWithString:hexString]; +- (NSString *)hexadecimalString +{ + /* Returns hexadecimal string of NSData. Empty string if data is empty. */ + + const unsigned char *dataBuffer = (const unsigned char *)[self bytes]; + + if (!dataBuffer) + return [NSString string]; + + NSUInteger dataLength = [self length]; + NSMutableString *hexString = [NSMutableString stringWithCapacity:(dataLength * 2)]; + + for (int i = 0; i < dataLength; ++i) + [hexString appendString:[NSString stringWithFormat:@"%02lx", (unsigned long)dataBuffer[i]]]; + + return [NSString stringWithString:hexString]; } /* Code from http://cocoawithlove.com/2009/06/base64-encoding-options-on-mac-and.html */ - (NSString *)base64EncodedString { - // Construct an OpenSSL context - BIO *context = BIO_new(BIO_s_mem()); - - // Tell the context to encode base64 - BIO *command = BIO_new(BIO_f_base64()); - context = BIO_push(command, context); - BIO_set_flags(context, BIO_FLAGS_BASE64_NO_NL); - - // Encode all the data - BIO_write(context, [self bytes], [self length]); - (void)BIO_flush(context); - - // Get the data out of the context - char *outputBuffer; - long outputLength = BIO_get_mem_data(context, &outputBuffer); - NSString *encodedString = [[NSString alloc] initWithBytes:outputBuffer length:outputLength encoding:NSASCIIStringEncoding]; - - BIO_free_all(context); - - return encodedString; + // Construct an OpenSSL context + BIO *context = BIO_new(BIO_s_mem()); + + // Tell the context to encode base64 + BIO *command = BIO_new(BIO_f_base64()); + context = BIO_push(command, context); + BIO_set_flags(context, BIO_FLAGS_BASE64_NO_NL); + + // Encode all the data + BIO_write(context, [self bytes], [self length]); + (void)BIO_flush(context); + + // Get the data out of the context + char *outputBuffer; + long outputLength = BIO_get_mem_data(context, &outputBuffer); + NSString *encodedString = [[NSString alloc] initWithBytes:outputBuffer + length:outputLength + encoding:NSASCIIStringEncoding]; + + BIO_free_all(context); + + return encodedString; } @end - diff --git a/client/iOS/Additions/Toast+UIView.h b/client/iOS/Additions/Toast+UIView.h index 623e70571..03f90c16e 100644 --- a/client/iOS/Additions/Toast+UIView.h +++ b/client/iOS/Additions/Toast+UIView.h @@ -1,11 +1,11 @@ /*************************************************************************** - + Toast+UIView.h Toast Version 0.1 Copyright (c) 2011 Charles Scalesse. - + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including @@ -13,10 +13,10 @@ distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -24,9 +24,8 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -***************************************************************************/ +***************************************************************************/ #import #import @@ -38,14 +37,24 @@ #define ToastDurationShort 1.0 // each makeToast method creates a view and displays it as toast --(void)makeToast:(NSString *)message; --(void)makeToast:(NSString *)message duration:(float)interval position:(id)point; --(void)makeToast:(NSString *)message duration:(float)interval position:(id)point title:(NSString *)title; --(void)makeToast:(NSString *)message duration:(float)interval position:(id)point title:(NSString *)title image:(UIImage *)image; --(void)makeToast:(NSString *)message duration:(float)interval position:(id)point image:(UIImage *)image; +- (void)makeToast:(NSString *)message; +- (void)makeToast:(NSString *)message duration:(float)interval position:(id)point; +- (void)makeToast:(NSString *)message + duration:(float)interval + position:(id)point + title:(NSString *)title; +- (void)makeToast:(NSString *)message + duration:(float)interval + position:(id)point + title:(NSString *)title + image:(UIImage *)image; +- (void)makeToast:(NSString *)message + duration:(float)interval + position:(id)point + image:(UIImage *)image; // the showToast method displays an existing view as toast --(void)showToast:(UIView *)toast; --(void)showToast:(UIView *)toast duration:(float)interval position:(id)point; +- (void)showToast:(UIView *)toast; +- (void)showToast:(UIView *)toast duration:(float)interval position:(id)point; @end diff --git a/client/iOS/Additions/Toast+UIView.m b/client/iOS/Additions/Toast+UIView.m index 649add3f1..38d1bef87 100644 --- a/client/iOS/Additions/Toast+UIView.m +++ b/client/iOS/Additions/Toast+UIView.m @@ -1,11 +1,11 @@ /*************************************************************************** - + Toast+UIView.h Toast Version 0.1 - + Copyright (c) 2011 Charles Scalesse. - + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including @@ -13,10 +13,10 @@ distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -24,284 +24,344 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + ***************************************************************************/ #import "Toast+UIView.h" #import #import -#define kMaxWidth 0.8 -#define kMaxHeight 0.8 +#define kMaxWidth 0.8 +#define kMaxHeight 0.8 -#define kHorizontalPadding 10.0 -#define kVerticalPadding 10.0 -#define kCornerRadius 10.0 -#define kOpacity 0.8 -#define kFontSize 16.0 -#define kMaxTitleLines 999 -#define kMaxMessageLines 999 +#define kHorizontalPadding 10.0 +#define kVerticalPadding 10.0 +#define kCornerRadius 10.0 +#define kOpacity 0.8 +#define kFontSize 16.0 +#define kMaxTitleLines 999 +#define kMaxMessageLines 999 -#define kFadeDuration 0.2 +#define kFadeDuration 0.2 -#define kDefaultLength 3 -#define kDefaultPosition @"bottom" +#define kDefaultLength 3 +#define kDefaultPosition @"bottom" -#define kImageWidth 80.0 -#define kImageHeight 80.0 +#define kImageWidth 80.0 +#define kImageHeight 80.0 static NSString *kDurationKey = @"duration"; - @interface UIView (ToastPrivate) --(CGPoint)getPositionFor:(id)position toast:(UIView *)toast; --(UIView *)makeViewForMessage:(NSString *)message title:(NSString *)title image:(UIImage *)image; +- (CGPoint)getPositionFor:(id)position toast:(UIView *)toast; +- (UIView *)makeViewForMessage:(NSString *)message title:(NSString *)title image:(UIImage *)image; @end - @implementation UIView (Toast) #pragma mark - #pragma mark Toast Methods --(void)makeToast:(NSString *)message { - [self makeToast:message duration:kDefaultLength position:kDefaultPosition]; +- (void)makeToast:(NSString *)message +{ + [self makeToast:message duration:kDefaultLength position:kDefaultPosition]; } --(void)makeToast:(NSString *)message duration:(float)interval position:(id)point { - UIView *toast = [self makeViewForMessage:message title:nil image:nil]; - [self showToast:toast duration:interval position:point]; +- (void)makeToast:(NSString *)message duration:(float)interval position:(id)point +{ + UIView *toast = [self makeViewForMessage:message title:nil image:nil]; + [self showToast:toast duration:interval position:point]; } --(void)makeToast:(NSString *)message duration:(float)interval position:(id)point title:(NSString *)title { - UIView *toast = [self makeViewForMessage:message title:title image:nil]; - [self showToast:toast duration:interval position:point]; +- (void)makeToast:(NSString *)message + duration:(float)interval + position:(id)point + title:(NSString *)title +{ + UIView *toast = [self makeViewForMessage:message title:title image:nil]; + [self showToast:toast duration:interval position:point]; } --(void)makeToast:(NSString *)message duration:(float)interval position:(id)point image:(UIImage *)image { - UIView *toast = [self makeViewForMessage:message title:nil image:image]; - [self showToast:toast duration:interval position:point]; +- (void)makeToast:(NSString *)message + duration:(float)interval + position:(id)point + image:(UIImage *)image +{ + UIView *toast = [self makeViewForMessage:message title:nil image:image]; + [self showToast:toast duration:interval position:point]; } --(void)makeToast:(NSString *)message duration:(float)interval position:(id)point title:(NSString *)title image:(UIImage *)image { - UIView *toast = [self makeViewForMessage:message title:title image:image]; - [self showToast:toast duration:interval position:point]; +- (void)makeToast:(NSString *)message + duration:(float)interval + position:(id)point + title:(NSString *)title + image:(UIImage *)image +{ + UIView *toast = [self makeViewForMessage:message title:title image:image]; + [self showToast:toast duration:interval position:point]; } --(void)showToast:(UIView *)toast { - [self showToast:toast duration:kDefaultLength position:kDefaultPosition]; +- (void)showToast:(UIView *)toast +{ + [self showToast:toast duration:kDefaultLength position:kDefaultPosition]; } --(void)showToast:(UIView *)toast duration:(float)interval position:(id)point { - - /**************************************************** - * * - * Displays a view for a given duration & position. * - * * - ****************************************************/ - - CGPoint toastPoint = [self getPositionFor:point toast:toast]; - - //use an associative reference to associate the toast view with the display interval - objc_setAssociatedObject (toast, &kDurationKey, [NSNumber numberWithFloat:interval], OBJC_ASSOCIATION_RETAIN); - - [toast setCenter:toastPoint]; - [toast setAlpha:0.0]; - [self addSubview:toast]; - - [UIView beginAnimations:@"fade_in" context:toast]; - [UIView setAnimationDuration:kFadeDuration]; - [UIView setAnimationDelegate:self]; - [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)]; - [UIView setAnimationCurve:UIViewAnimationCurveEaseOut]; - [toast setAlpha:1.0]; - [UIView commitAnimations]; - +- (void)showToast:(UIView *)toast duration:(float)interval position:(id)point +{ + + /**************************************************** + * * + * Displays a view for a given duration & position. * + * * + ****************************************************/ + + CGPoint toastPoint = [self getPositionFor:point toast:toast]; + + // use an associative reference to associate the toast view with the display interval + objc_setAssociatedObject(toast, &kDurationKey, [NSNumber numberWithFloat:interval], + OBJC_ASSOCIATION_RETAIN); + + [toast setCenter:toastPoint]; + [toast setAlpha:0.0]; + [self addSubview:toast]; + + [UIView beginAnimations:@"fade_in" context:toast]; + [UIView setAnimationDuration:kFadeDuration]; + [UIView setAnimationDelegate:self]; + [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)]; + [UIView setAnimationCurve:UIViewAnimationCurveEaseOut]; + [toast setAlpha:1.0]; + [UIView commitAnimations]; } #pragma mark - #pragma mark Animation Delegate Method -- (void)animationDidStop:(NSString*)animationID finished:(BOOL)finished context:(void *)context { - - UIView *toast = (UIView *)context; - - // retrieve the display interval associated with the view - float interval = [(NSNumber *)objc_getAssociatedObject(toast, &kDurationKey) floatValue]; - - if([animationID isEqualToString:@"fade_in"]) { - - [UIView beginAnimations:@"fade_out" context:toast]; - [UIView setAnimationDelay:interval]; - [UIView setAnimationDuration:kFadeDuration]; - [UIView setAnimationDelegate:self]; - [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)]; - [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; - [toast setAlpha:0.0]; - [UIView commitAnimations]; - - } else if ([animationID isEqualToString:@"fade_out"]) { - - [toast removeFromSuperview]; - - } - +- (void)animationDidStop:(NSString *)animationID finished:(BOOL)finished context:(void *)context +{ + + UIView *toast = (UIView *)context; + + // retrieve the display interval associated with the view + float interval = [(NSNumber *)objc_getAssociatedObject(toast, &kDurationKey) floatValue]; + + if ([animationID isEqualToString:@"fade_in"]) + { + + [UIView beginAnimations:@"fade_out" context:toast]; + [UIView setAnimationDelay:interval]; + [UIView setAnimationDuration:kFadeDuration]; + [UIView setAnimationDelegate:self]; + [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)]; + [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; + [toast setAlpha:0.0]; + [UIView commitAnimations]; + } + else if ([animationID isEqualToString:@"fade_out"]) + { + + [toast removeFromSuperview]; + } } #pragma mark - #pragma mark Private Methods --(CGPoint)getPositionFor:(id)point toast:(UIView *)toast { - - /************************************************************************************* - * * - * Converts string literals @"top", @"bottom", @"center", or any point wrapped in an * - * NSValue object into a CGPoint * - * * - *************************************************************************************/ - - if([point isKindOfClass:[NSString class]]) { - - if( [point caseInsensitiveCompare:@"top"] == NSOrderedSame ) { - return CGPointMake(self.bounds.size.width/2, (toast.frame.size.height / 2) + kVerticalPadding); - } else if( [point caseInsensitiveCompare:@"bottom"] == NSOrderedSame ) { - return CGPointMake(self.bounds.size.width/2, (self.bounds.size.height - (toast.frame.size.height / 2)) - kVerticalPadding); - } else if( [point caseInsensitiveCompare:@"center"] == NSOrderedSame ) { - return CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2); - } - - } else if ([point isKindOfClass:[NSValue class]]) { - return [point CGPointValue]; - } - - NSLog(@"Error: Invalid position for toast."); - return [self getPositionFor:kDefaultPosition toast:toast]; +- (CGPoint)getPositionFor:(id)point toast:(UIView *)toast +{ + + /************************************************************************************* + * * + * Converts string literals @"top", @"bottom", @"center", or any point wrapped in an * + * NSValue object into a CGPoint * + * * + *************************************************************************************/ + + if ([point isKindOfClass:[NSString class]]) + { + + if ([point caseInsensitiveCompare:@"top"] == NSOrderedSame) + { + return CGPointMake(self.bounds.size.width / 2, + (toast.frame.size.height / 2) + kVerticalPadding); + } + else if ([point caseInsensitiveCompare:@"bottom"] == NSOrderedSame) + { + return CGPointMake(self.bounds.size.width / 2, + (self.bounds.size.height - (toast.frame.size.height / 2)) - + kVerticalPadding); + } + else if ([point caseInsensitiveCompare:@"center"] == NSOrderedSame) + { + return CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2); + } + } + else if ([point isKindOfClass:[NSValue class]]) + { + return [point CGPointValue]; + } + + NSLog(@"Error: Invalid position for toast."); + return [self getPositionFor:kDefaultPosition toast:toast]; } --(UIView *)makeViewForMessage:(NSString *)message title:(NSString *)title image:(UIImage *)image { - - /*********************************************************************************** - * * - * Dynamically build a toast view with any combination of message, title, & image. * - * * - ***********************************************************************************/ - - if((message == nil) && (title == nil) && (image == nil)) return nil; +- (UIView *)makeViewForMessage:(NSString *)message title:(NSString *)title image:(UIImage *)image +{ - UILabel *messageLabel = nil; - UILabel *titleLabel = nil; - UIImageView *imageView = nil; - - // create the parent view - UIView *wrapperView = [[[UIView alloc] init] autorelease]; - [wrapperView.layer setCornerRadius:kCornerRadius]; - [wrapperView setBackgroundColor:[[UIColor blackColor] colorWithAlphaComponent:kOpacity]]; - wrapperView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin; + /*********************************************************************************** + * * + * Dynamically build a toast view with any combination of message, title, & image. * + * * + ***********************************************************************************/ - if(image != nil) { - imageView = [[[UIImageView alloc] initWithImage:image] autorelease]; - [imageView setContentMode:UIViewContentModeScaleAspectFit]; - [imageView setFrame:CGRectMake(kHorizontalPadding, kVerticalPadding, kImageWidth, kImageHeight)]; - } - - float imageWidth, imageHeight, imageLeft; - - // the imageView frame values will be used to size & position the other views - if(imageView != nil) { - imageWidth = imageView.bounds.size.width; - imageHeight = imageView.bounds.size.height; - imageLeft = kHorizontalPadding; - } else { - imageWidth = imageHeight = imageLeft = 0; - } - - if (title != nil) { - titleLabel = [[[UILabel alloc] init] autorelease]; - [titleLabel setNumberOfLines:kMaxTitleLines]; - [titleLabel setFont:[UIFont boldSystemFontOfSize:kFontSize]]; - [titleLabel setTextAlignment:UITextAlignmentLeft]; - [titleLabel setLineBreakMode:UILineBreakModeWordWrap]; - [titleLabel setTextColor:[UIColor whiteColor]]; - [titleLabel setBackgroundColor:[UIColor clearColor]]; - [titleLabel setAlpha:1.0]; - [titleLabel setText:title]; - - // size the title label according to the length of the text - CGSize maxSizeTitle = CGSizeMake((self.bounds.size.width * kMaxWidth) - imageWidth, self.bounds.size.height * kMaxHeight); - CGSize expectedSizeTitle = [title sizeWithFont:titleLabel.font constrainedToSize:maxSizeTitle lineBreakMode:titleLabel.lineBreakMode]; - [titleLabel setFrame:CGRectMake(0, 0, expectedSizeTitle.width, expectedSizeTitle.height)]; - } - - if (message != nil) { - messageLabel = [[[UILabel alloc] init] autorelease]; - [messageLabel setNumberOfLines:kMaxMessageLines]; - [messageLabel setFont:[UIFont systemFontOfSize:kFontSize]]; - [messageLabel setLineBreakMode:UILineBreakModeWordWrap]; - [messageLabel setTextColor:[UIColor whiteColor]]; - [messageLabel setTextAlignment:UITextAlignmentCenter]; - [messageLabel setBackgroundColor:[UIColor clearColor]]; - [messageLabel setAlpha:1.0]; - [messageLabel setText:message]; - - // size the message label according to the length of the text - CGSize maxSizeMessage = CGSizeMake((self.bounds.size.width * kMaxWidth) - imageWidth, self.bounds.size.height * kMaxHeight); - CGSize expectedSizeMessage = [message sizeWithFont:messageLabel.font constrainedToSize:maxSizeMessage lineBreakMode:messageLabel.lineBreakMode]; - [messageLabel setFrame:CGRectMake(0, 0, expectedSizeMessage.width, expectedSizeMessage.height)]; - } - - // titleLabel frame values - float titleWidth, titleHeight, titleTop, titleLeft; - - if(titleLabel != nil) { - titleWidth = titleLabel.bounds.size.width; - titleHeight = titleLabel.bounds.size.height; - titleTop = kVerticalPadding; - titleLeft = imageLeft + imageWidth + kHorizontalPadding; - } else { - titleWidth = titleHeight = titleTop = titleLeft = 0; - } - - // messageLabel frame values - float messageWidth, messageHeight, messageLeft, messageTop; + if ((message == nil) && (title == nil) && (image == nil)) + return nil; - if(messageLabel != nil) { - messageWidth = messageLabel.bounds.size.width; - messageHeight = messageLabel.bounds.size.height; - messageLeft = imageLeft + imageWidth + kHorizontalPadding; - messageTop = titleTop + titleHeight + kVerticalPadding; - } else { - messageWidth = messageHeight = messageLeft = messageTop = 0; - } - - // compare the title & message widths and use the longer value to calculate the size of the wrapper width - // the same logic applies to the x value (left) - float longerWidth = (messageWidth < titleWidth) ? titleWidth : messageWidth; - float longerLeft = (messageLeft < titleLeft) ? titleLeft : messageLeft; - - // if the image width is larger than longerWidth, use the image width to calculate the wrapper width. - // the same logic applies to the wrapper height - float wrapperWidth = ((longerLeft + longerWidth + kHorizontalPadding) < imageWidth + (kHorizontalPadding * 2)) ? imageWidth + (kHorizontalPadding * 2) : (longerLeft + longerWidth + kHorizontalPadding); - float wrapperHeight = ((messageTop + messageHeight + kVerticalPadding) < imageHeight + (kVerticalPadding * 2)) ? imageHeight + (kVerticalPadding * 2) : (messageTop + messageHeight + kVerticalPadding); - - [wrapperView setFrame:CGRectMake(0, 0, wrapperWidth, wrapperHeight)]; - - if(titleLabel != nil) { - [titleLabel setFrame:CGRectMake(titleLeft, titleTop, titleWidth, titleHeight)]; - [wrapperView addSubview:titleLabel]; - } - - if(messageLabel != nil) { - [messageLabel setFrame:CGRectMake(messageLeft, messageTop, messageWidth, messageHeight)]; - [wrapperView addSubview:messageLabel]; - } - - if(imageView != nil) { - [wrapperView addSubview:imageView]; - } - - return wrapperView; + UILabel *messageLabel = nil; + UILabel *titleLabel = nil; + UIImageView *imageView = nil; + + // create the parent view + UIView *wrapperView = [[[UIView alloc] init] autorelease]; + [wrapperView.layer setCornerRadius:kCornerRadius]; + [wrapperView setBackgroundColor:[[UIColor blackColor] colorWithAlphaComponent:kOpacity]]; + wrapperView.autoresizingMask = + UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin | + UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin; + + if (image != nil) + { + imageView = [[[UIImageView alloc] initWithImage:image] autorelease]; + [imageView setContentMode:UIViewContentModeScaleAspectFit]; + [imageView + setFrame:CGRectMake(kHorizontalPadding, kVerticalPadding, kImageWidth, kImageHeight)]; + } + + float imageWidth, imageHeight, imageLeft; + + // the imageView frame values will be used to size & position the other views + if (imageView != nil) + { + imageWidth = imageView.bounds.size.width; + imageHeight = imageView.bounds.size.height; + imageLeft = kHorizontalPadding; + } + else + { + imageWidth = imageHeight = imageLeft = 0; + } + + if (title != nil) + { + titleLabel = [[[UILabel alloc] init] autorelease]; + [titleLabel setNumberOfLines:kMaxTitleLines]; + [titleLabel setFont:[UIFont boldSystemFontOfSize:kFontSize]]; + [titleLabel setTextAlignment:UITextAlignmentLeft]; + [titleLabel setLineBreakMode:UILineBreakModeWordWrap]; + [titleLabel setTextColor:[UIColor whiteColor]]; + [titleLabel setBackgroundColor:[UIColor clearColor]]; + [titleLabel setAlpha:1.0]; + [titleLabel setText:title]; + + // size the title label according to the length of the text + CGSize maxSizeTitle = CGSizeMake((self.bounds.size.width * kMaxWidth) - imageWidth, + self.bounds.size.height * kMaxHeight); + CGSize expectedSizeTitle = [title sizeWithFont:titleLabel.font + constrainedToSize:maxSizeTitle + lineBreakMode:titleLabel.lineBreakMode]; + [titleLabel setFrame:CGRectMake(0, 0, expectedSizeTitle.width, expectedSizeTitle.height)]; + } + + if (message != nil) + { + messageLabel = [[[UILabel alloc] init] autorelease]; + [messageLabel setNumberOfLines:kMaxMessageLines]; + [messageLabel setFont:[UIFont systemFontOfSize:kFontSize]]; + [messageLabel setLineBreakMode:UILineBreakModeWordWrap]; + [messageLabel setTextColor:[UIColor whiteColor]]; + [messageLabel setTextAlignment:UITextAlignmentCenter]; + [messageLabel setBackgroundColor:[UIColor clearColor]]; + [messageLabel setAlpha:1.0]; + [messageLabel setText:message]; + + // size the message label according to the length of the text + CGSize maxSizeMessage = CGSizeMake((self.bounds.size.width * kMaxWidth) - imageWidth, + self.bounds.size.height * kMaxHeight); + CGSize expectedSizeMessage = [message sizeWithFont:messageLabel.font + constrainedToSize:maxSizeMessage + lineBreakMode:messageLabel.lineBreakMode]; + [messageLabel + setFrame:CGRectMake(0, 0, expectedSizeMessage.width, expectedSizeMessage.height)]; + } + + // titleLabel frame values + float titleWidth, titleHeight, titleTop, titleLeft; + + if (titleLabel != nil) + { + titleWidth = titleLabel.bounds.size.width; + titleHeight = titleLabel.bounds.size.height; + titleTop = kVerticalPadding; + titleLeft = imageLeft + imageWidth + kHorizontalPadding; + } + else + { + titleWidth = titleHeight = titleTop = titleLeft = 0; + } + + // messageLabel frame values + float messageWidth, messageHeight, messageLeft, messageTop; + + if (messageLabel != nil) + { + messageWidth = messageLabel.bounds.size.width; + messageHeight = messageLabel.bounds.size.height; + messageLeft = imageLeft + imageWidth + kHorizontalPadding; + messageTop = titleTop + titleHeight + kVerticalPadding; + } + else + { + messageWidth = messageHeight = messageLeft = messageTop = 0; + } + + // compare the title & message widths and use the longer value to calculate the size of the + // wrapper width the same logic applies to the x value (left) + float longerWidth = (messageWidth < titleWidth) ? titleWidth : messageWidth; + float longerLeft = (messageLeft < titleLeft) ? titleLeft : messageLeft; + + // if the image width is larger than longerWidth, use the image width to calculate the wrapper + // width. the same logic applies to the wrapper height + float wrapperWidth = + ((longerLeft + longerWidth + kHorizontalPadding) < imageWidth + (kHorizontalPadding * 2)) + ? imageWidth + (kHorizontalPadding * 2) + : (longerLeft + longerWidth + kHorizontalPadding); + float wrapperHeight = + ((messageTop + messageHeight + kVerticalPadding) < imageHeight + (kVerticalPadding * 2)) + ? imageHeight + (kVerticalPadding * 2) + : (messageTop + messageHeight + kVerticalPadding); + + [wrapperView setFrame:CGRectMake(0, 0, wrapperWidth, wrapperHeight)]; + + if (titleLabel != nil) + { + [titleLabel setFrame:CGRectMake(titleLeft, titleTop, titleWidth, titleHeight)]; + [wrapperView addSubview:titleLabel]; + } + + if (messageLabel != nil) + { + [messageLabel setFrame:CGRectMake(messageLeft, messageTop, messageWidth, messageHeight)]; + [wrapperView addSubview:messageLabel]; + } + + if (imageView != nil) + { + [wrapperView addSubview:imageView]; + } + + return wrapperView; } @end diff --git a/client/iOS/AppDelegate.h b/client/iOS/AppDelegate.h index 6ccc9c51e..dc13cd8fa 100644 --- a/client/iOS/AppDelegate.h +++ b/client/iOS/AppDelegate.h @@ -1,22 +1,24 @@ /* App delegate - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @class MainTabBarController; -@interface AppDelegate : NSObject { +@interface AppDelegate : NSObject +{ - MainTabBarController* _tabBarController; + MainTabBarController *_tabBarController; } -@property (nonatomic, retain) IBOutlet UIWindow *window; -@property (nonatomic, retain) IBOutlet MainTabBarController* tabBarController; +@property(nonatomic, retain) IBOutlet UIWindow *window; +@property(nonatomic, retain) IBOutlet MainTabBarController *tabBarController; @end diff --git a/client/iOS/AppDelegate.m b/client/iOS/AppDelegate.m index a73923cfd..b964593fb 100644 --- a/client/iOS/AppDelegate.m +++ b/client/iOS/AppDelegate.m @@ -1,10 +1,11 @@ /* App delegate - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "AppDelegate.h" @@ -18,89 +19,109 @@ @implementation AppDelegate - @synthesize window = _window, tabBarController = _tabBarController; - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ +- (BOOL)application:(UIApplication *)application + didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ // Set default values for most NSUserDefaults - [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Defaults" ofType:@"plist"]]]; + [[NSUserDefaults standardUserDefaults] + registerDefaults:[NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] + pathForResource:@"Defaults" + ofType:@"plist"]]]; - // init global settings - SetSwapMouseButtonsFlag([[NSUserDefaults standardUserDefaults] boolForKey:@"ui.swap_mouse_buttons"]); - SetInvertScrollingFlag([[NSUserDefaults standardUserDefaults] boolForKey:@"ui.invert_scrolling"]); - - // create bookmark view and navigation controller - BookmarkListController* bookmarkListController = [[[BookmarkListController alloc] initWithNibName:@"BookmarkListView" bundle:nil] autorelease]; - UINavigationController* bookmarkNavigationController = [[[UINavigationController alloc] initWithRootViewController:bookmarkListController] autorelease]; + // init global settings + SetSwapMouseButtonsFlag( + [[NSUserDefaults standardUserDefaults] boolForKey:@"ui.swap_mouse_buttons"]); + SetInvertScrollingFlag( + [[NSUserDefaults standardUserDefaults] boolForKey:@"ui.invert_scrolling"]); - // create app settings view and navigation controller - AppSettingsController* appSettingsController = [[[AppSettingsController alloc] initWithStyle:UITableViewStyleGrouped] autorelease]; - UINavigationController* appSettingsNavigationController = [[[UINavigationController alloc] initWithRootViewController:appSettingsController] autorelease]; - - // create help view controller - HelpController* helpViewController = [[[HelpController alloc] initWithNibName:nil bundle:nil] autorelease]; + // create bookmark view and navigation controller + BookmarkListController *bookmarkListController = + [[[BookmarkListController alloc] initWithNibName:@"BookmarkListView" + bundle:nil] autorelease]; + UINavigationController *bookmarkNavigationController = [[[UINavigationController alloc] + initWithRootViewController:bookmarkListController] autorelease]; - // create about view controller - AboutController* aboutViewController = [[[AboutController alloc] initWithNibName:nil bundle:nil] autorelease]; - - // add tab-bar controller to the main window and display everything - NSArray* tabItems = [NSArray arrayWithObjects:bookmarkNavigationController, appSettingsNavigationController, helpViewController, aboutViewController, nil]; - [_tabBarController setViewControllers:tabItems]; - if ([_window respondsToSelector:@selector(setRootViewController:)]) - [_window setRootViewController:_tabBarController]; - else - [_window addSubview:[_tabBarController view]]; - [_window makeKeyAndVisible]; + // create app settings view and navigation controller + AppSettingsController *appSettingsController = + [[[AppSettingsController alloc] initWithStyle:UITableViewStyleGrouped] autorelease]; + UINavigationController *appSettingsNavigationController = [[[UINavigationController alloc] + initWithRootViewController:appSettingsController] autorelease]; - return YES; + // create help view controller + HelpController *helpViewController = [[[HelpController alloc] initWithNibName:nil + bundle:nil] autorelease]; + + // create about view controller + AboutController *aboutViewController = + [[[AboutController alloc] initWithNibName:nil bundle:nil] autorelease]; + + // add tab-bar controller to the main window and display everything + NSArray *tabItems = + [NSArray arrayWithObjects:bookmarkNavigationController, appSettingsNavigationController, + helpViewController, aboutViewController, nil]; + [_tabBarController setViewControllers:tabItems]; + if ([_window respondsToSelector:@selector(setRootViewController:)]) + [_window setRootViewController:_tabBarController]; + else + [_window addSubview:[_tabBarController view]]; + [_window makeKeyAndVisible]; + + return YES; } - (void)applicationWillResignActive:(UIApplication *)application { - /* - Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - */ + /* + Sent when the application is about to move from active to inactive state. This can occur for + certain types of temporary interruptions (such as an incoming phone call or SMS message) or + when the user quits the application and it begins the transition to the background state. Use + this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. + Games should use this method to pause the game. + */ } - (void)applicationDidEnterBackground:(UIApplication *)application { - /* - Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - */ + /* + Use this method to release shared resources, save user data, invalidate timers, and store + enough application state information to restore your application to its current state in case + it is terminated later. If your application supports background execution, this method is + called instead of applicationWillTerminate: when the user quits. + */ } - (void)applicationWillEnterForeground:(UIApplication *)application { - /* - Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - */ - // cancel disconnect timer + /* + Called as part of the transition from the background to the inactive state; here you can undo + many of the changes made on entering the background. + */ + // cancel disconnect timer } - (void)applicationDidBecomeActive:(UIApplication *)application { - /* - Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - */ + /* + Restart any tasks that were paused (or not yet started) while the application was inactive. If + the application was previously in the background, optionally refresh the user interface. + */ } - (void)applicationWillTerminate:(UIApplication *)application { - /* - Called when the application is about to terminate. - Save data if appropriate. - See also applicationDidEnterBackground:. - */ + /* + Called when the application is about to terminate. + Save data if appropriate. + See also applicationDidEnterBackground:. + */ } - (void)dealloc { - [_window release]; - [super dealloc]; + [_window release]; + [super dealloc]; } @end diff --git a/client/iOS/Controllers/AboutController.h b/client/iOS/Controllers/AboutController.h index ca3755f29..7af340c74 100644 --- a/client/iOS/Controllers/AboutController.h +++ b/client/iOS/Controllers/AboutController.h @@ -1,19 +1,19 @@ /* Application info controller - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import - @interface AboutController : UIViewController { - NSString* last_link_clicked; - UIWebView* webView; + NSString *last_link_clicked; + UIWebView *webView; } @end diff --git a/client/iOS/Controllers/AboutController.m b/client/iOS/Controllers/AboutController.m index 6bd8f4a36..1d7f8a2ad 100644 --- a/client/iOS/Controllers/AboutController.m +++ b/client/iOS/Controllers/AboutController.m @@ -1,10 +1,11 @@ /* Application info controller - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "AboutController.h" @@ -13,80 +14,104 @@ @implementation AboutController - // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { +// The designated initializer. Override if you create the controller programmatically and want to +// perform customization that is not appropriate for viewDidLoad. +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) + { // set title and tab-bar image [self setTitle:NSLocalizedString(@"About", @"About Controller title")]; - UIImage* tabBarIcon = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"tabbar_icon_about" ofType:@"png"]]; - [self setTabBarItem:[[[UITabBarItem alloc] initWithTitle:NSLocalizedString(@"About", @"Tabbar item about") image:tabBarIcon tag:0] autorelease]]; - - last_link_clicked = nil; - } - return self; + UIImage *tabBarIcon = [UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"tabbar_icon_about" + ofType:@"png"]]; + [self setTabBarItem:[[[UITabBarItem alloc] + initWithTitle:NSLocalizedString(@"About", @"Tabbar item about") + image:tabBarIcon + tag:0] autorelease]]; + + last_link_clicked = nil; + } + return self; } - (void)dealloc { - [super dealloc]; - [last_link_clicked release]; + [super dealloc]; + [last_link_clicked release]; } // Implement loadView to create a view hierarchy programmatically, without using a nib. -- (void)loadView +- (void)loadView { webView = [[[UIWebView alloc] initWithFrame:CGRectZero] autorelease]; - [webView setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [webView + setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; [webView setAutoresizesSubviews:YES]; - [webView setDelegate:self]; - [webView setDataDetectorTypes:UIDataDetectorTypeNone]; - [self setView:webView]; + [webView setDelegate:self]; + [webView setDataDetectorTypes:UIDataDetectorTypeNone]; + [self setView:webView]; } - - // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad +- (void)viewDidLoad { - [super viewDidLoad]; - - NSString *filename = (IsPhone() ? @"about_phone" : @"about"); - NSString *htmlString = [[[NSString alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:filename ofType:@"html" inDirectory:@"about_page"] encoding:NSUTF8StringEncoding error:nil] autorelease]; - - [webView loadHTMLString:[NSString stringWithFormat:htmlString, - TSXAppFullVersion(), - [[UIDevice currentDevice] systemName], - [[UIDevice currentDevice] systemVersion], - [[UIDevice currentDevice] model]] baseURL:[NSURL fileURLWithPath:[[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"about_page"]]]; + [super viewDidLoad]; + + NSString *filename = (IsPhone() ? @"about_phone" : @"about"); + NSString *htmlString = [[[NSString alloc] + initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:filename + ofType:@"html" + inDirectory:@"about_page"] + encoding:NSUTF8StringEncoding + error:nil] autorelease]; + + [webView + loadHTMLString:[NSString stringWithFormat:htmlString, TSXAppFullVersion(), + [[UIDevice currentDevice] systemName], + [[UIDevice currentDevice] systemVersion], + [[UIDevice currentDevice] model]] + baseURL:[NSURL fileURLWithPath:[[[NSBundle mainBundle] bundlePath] + stringByAppendingPathComponent:@"about_page"]]]; } // Override to allow orientations other than the default portrait orientation. -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return YES; +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; } #pragma mark - #pragma mark UIWebView callbacks -- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType -{ - if([[request URL] isFileURL]) +- (BOOL)webView:(UIWebView *)webView + shouldStartLoadWithRequest:(NSURLRequest *)request + navigationType:(UIWebViewNavigationType)navigationType +{ + if ([[request URL] isFileURL]) return YES; - - if(navigationType == UIWebViewNavigationTypeLinkClicked) - { - [last_link_clicked release]; - last_link_clicked = [[[request URL] absoluteString] retain]; - BlockAlertView *alert = [BlockAlertView alertWithTitle:NSLocalizedString(@"External Link", @"External Link Alert Title") - message:[NSString stringWithFormat:NSLocalizedString(@"Open [%@] in Browser?", @"Open link in browser (with link as parameter)"), last_link_clicked]]; - [alert setCancelButtonWithTitle:NSLocalizedString(@"No", @"No Button") block:nil]; - [alert addButtonWithTitle:NSLocalizedString(@"OK", @"OK Button") block:^{ - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:last_link_clicked]]; - }]; - - [alert show]; - + if (navigationType == UIWebViewNavigationTypeLinkClicked) + { + [last_link_clicked release]; + last_link_clicked = [[[request URL] absoluteString] retain]; + BlockAlertView *alert = [BlockAlertView + alertWithTitle:NSLocalizedString(@"External Link", @"External Link Alert Title") + message:[NSString stringWithFormat: + NSLocalizedString( + @"Open [%@] in Browser?", + @"Open link in browser (with link as parameter)"), + last_link_clicked]]; + + [alert setCancelButtonWithTitle:NSLocalizedString(@"No", @"No Button") block:nil]; + [alert addButtonWithTitle:NSLocalizedString(@"OK", @"OK Button") + block:^{ + [[UIApplication sharedApplication] + openURL:[NSURL URLWithString:last_link_clicked]]; + }]; + + [alert show]; + return NO; } return YES; diff --git a/client/iOS/Controllers/AdvancedBookmarkEditorController.h b/client/iOS/Controllers/AdvancedBookmarkEditorController.h index 9982ccf6c..1257d46de 100644 --- a/client/iOS/Controllers/AdvancedBookmarkEditorController.h +++ b/client/iOS/Controllers/AdvancedBookmarkEditorController.h @@ -1,10 +1,11 @@ /* Controller to edit advanced bookmark settings - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "EditorBaseController.h" @@ -14,12 +15,12 @@ @interface AdvancedBookmarkEditorController : EditorBaseController { -@private - ComputerBookmark* _bookmark; - ConnectionParams* _params; + @private + ComputerBookmark *_bookmark; + ConnectionParams *_params; } // init for the given bookmark -- (id)initWithBookmark:(ComputerBookmark*)bookmark; +- (id)initWithBookmark:(ComputerBookmark *)bookmark; @end diff --git a/client/iOS/Controllers/AdvancedBookmarkEditorController.m b/client/iOS/Controllers/AdvancedBookmarkEditorController.m index 1f1851cc0..30434cc74 100644 --- a/client/iOS/Controllers/AdvancedBookmarkEditorController.m +++ b/client/iOS/Controllers/AdvancedBookmarkEditorController.m @@ -1,10 +1,11 @@ /* Controller to edit advanced bookmark settings - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "AdvancedBookmarkEditorController.h" @@ -24,48 +25,49 @@ @implementation AdvancedBookmarkEditorController -- (id)initWithBookmark:(ComputerBookmark*)bookmark +- (id)initWithBookmark:(ComputerBookmark *)bookmark { - if ((self = [super initWithStyle:UITableViewStyleGrouped])) + if ((self = [super initWithStyle:UITableViewStyleGrouped])) { // set additional settings state according to bookmark data _bookmark = [bookmark retain]; - _params = [bookmark params]; - } - return self; + _params = [bookmark params]; + } + return self; } - (void)viewDidLoad { - [super viewDidLoad]; - [self setTitle:NSLocalizedString(@"Advanced Settings", @"Advanced Settings title")]; + [super viewDidLoad]; + [self setTitle:NSLocalizedString(@"Advanced Settings", @"Advanced Settings title")]; } - (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - - // we need to reload the table view data here to have up-to-date data for the - // advanced settings accessory items (like for resolution/color mode settings) - [[self tableView] reloadData]; + [super viewWillAppear:animated]; + + // we need to reload the table view data here to have up-to-date data for the + // advanced settings accessory items (like for resolution/color mode settings) + [[self tableView] reloadData]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return YES; + return YES; } #pragma mark - #pragma mark Table view data source -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - // Return the number of sections. - return SECTION_COUNT; +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + // Return the number of sections. + return SECTION_COUNT; } - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - // Return the number of rows in the section. +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + // Return the number of rows in the section. switch (section) { case SECTION_ADVANCED_SETTINGS: // advanced settings @@ -73,15 +75,14 @@ default: break; } - - return 0; -} + return 0; +} // set section headers - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { - switch(section) + switch (section) { case SECTION_ADVANCED_SETTINGS: return NSLocalizedString(@"Advanced", @"'Advanced': advanced settings header"); @@ -89,203 +90,248 @@ return @"unknown"; } - // Customize the appearance of table view cells. -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + // determine the required cell type - NSString* cellType = nil; - switch([indexPath section]) + NSString *cellType = nil; + switch ([indexPath section]) { - case SECTION_ADVANCED_SETTINGS: // advanced settings - { - switch([indexPath row]) - { - case 0: // Enable/Disable TSG Settings - cellType = TableCellIdentifierYesNo; - break; - case 1: // TS Gateway Settings - cellType = TableCellIdentifierSubEditor; - break; - case 2: // 3G Settings - cellType = TableCellIdentifierYesNo; - break; - case 3: // 3G screen/color depth - cellType = TableCellIdentifierSelection; - break; - case 4: // 3G performance settings - cellType = TableCellIdentifierSubEditor; - break; - case 5: // security mode - cellType = TableCellIdentifierSelection; - break; - case 6: // remote program - case 7: // work dir - cellType = TableCellIdentifierText; - break; - case 8: // console mode - cellType = TableCellIdentifierYesNo; - break; - default: - break; - } + case SECTION_ADVANCED_SETTINGS: // advanced settings + { + switch ([indexPath row]) + { + case 0: // Enable/Disable TSG Settings + cellType = TableCellIdentifierYesNo; + break; + case 1: // TS Gateway Settings + cellType = TableCellIdentifierSubEditor; + break; + case 2: // 3G Settings + cellType = TableCellIdentifierYesNo; + break; + case 3: // 3G screen/color depth + cellType = TableCellIdentifierSelection; + break; + case 4: // 3G performance settings + cellType = TableCellIdentifierSubEditor; + break; + case 5: // security mode + cellType = TableCellIdentifierSelection; + break; + case 6: // remote program + case 7: // work dir + cellType = TableCellIdentifierText; + break; + case 8: // console mode + cellType = TableCellIdentifierYesNo; + break; + default: + break; + } break; - } - } - NSAssert(cellType != nil, @"Couldn't determine cell type"); - + } + } + NSAssert(cellType != nil, @"Couldn't determine cell type"); + // get the table view cell UITableViewCell *cell = [self tableViewCellFromIdentifier:cellType]; - NSAssert(cell, @"Invalid cell"); - + NSAssert(cell, @"Invalid cell"); + // set cell values - switch([indexPath section]) + switch ([indexPath section]) { - // advanced settings + // advanced settings case SECTION_ADVANCED_SETTINGS: [self initAdvancedSettings:indexPath cell:cell]; break; - + default: break; - } - - return cell; + } + + return cell; } // updates advanced settings in the UI -- (void)initAdvancedSettings:(NSIndexPath*)indexPath cell:(UITableViewCell*)cell +- (void)initAdvancedSettings:(NSIndexPath *)indexPath cell:(UITableViewCell *)cell { - BOOL enable_3G_settings = [_params boolForKey:@"enable_3g_settings"]; - switch(indexPath.row) + BOOL enable_3G_settings = [_params boolForKey:@"enable_3g_settings"]; + switch (indexPath.row) { case 0: - { - EditFlagTableViewCell* flagCell = (EditFlagTableViewCell*)cell; - [[flagCell label] setText:NSLocalizedString(@"Enable TS Gateway", @"'Enable TS Gateway': Bookmark enable TSG settings")]; - [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; - [[flagCell toggle] setOn:[_params boolForKey:@"enable_tsg_settings"]]; - [[flagCell toggle] addTarget:self action:@selector(toggleSettingValue:) forControlEvents:UIControlEventValueChanged]; - break; - } - case 1: - { - BOOL enable_tsg_settings = [_params boolForKey:@"enable_tsg_settings"]; - EditSubEditTableViewCell* editCell = (EditSubEditTableViewCell*)cell; - [[editCell label] setText:NSLocalizedString(@"TS Gateway Settings", @"'TS Gateway Settings': Bookmark TS Gateway Settings")]; - [[editCell label] setEnabled:enable_tsg_settings]; - [editCell setSelectionStyle:enable_tsg_settings ? UITableViewCellSelectionStyleBlue : UITableViewCellSelectionStyleNone]; - break; - } + { + EditFlagTableViewCell *flagCell = (EditFlagTableViewCell *)cell; + [[flagCell label] + setText:NSLocalizedString(@"Enable TS Gateway", + @"'Enable TS Gateway': Bookmark enable TSG settings")]; + [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[flagCell toggle] setOn:[_params boolForKey:@"enable_tsg_settings"]]; + [[flagCell toggle] addTarget:self + action:@selector(toggleSettingValue:) + forControlEvents:UIControlEventValueChanged]; + break; + } + case 1: + { + BOOL enable_tsg_settings = [_params boolForKey:@"enable_tsg_settings"]; + EditSubEditTableViewCell *editCell = (EditSubEditTableViewCell *)cell; + [[editCell label] + setText:NSLocalizedString(@"TS Gateway Settings", + @"'TS Gateway Settings': Bookmark TS Gateway Settings")]; + [[editCell label] setEnabled:enable_tsg_settings]; + [editCell setSelectionStyle:enable_tsg_settings ? UITableViewCellSelectionStyleBlue + : UITableViewCellSelectionStyleNone]; + break; + } case 2: - { - EditFlagTableViewCell* flagCell = (EditFlagTableViewCell*)cell; - [[flagCell label] setText:NSLocalizedString(@"3G Settings", @"'3G Settings': Bookmark enable 3G settings")]; - [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; - [[flagCell toggle] setOn:[_params boolForKey:@"enable_3g_settings"]]; - [[flagCell toggle] addTarget:self action:@selector(toggleSettingValue:) forControlEvents:UIControlEventValueChanged]; - break; - } + { + EditFlagTableViewCell *flagCell = (EditFlagTableViewCell *)cell; + [[flagCell label] + setText:NSLocalizedString(@"3G Settings", + @"'3G Settings': Bookmark enable 3G settings")]; + [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[flagCell toggle] setOn:[_params boolForKey:@"enable_3g_settings"]]; + [[flagCell toggle] addTarget:self + action:@selector(toggleSettingValue:) + forControlEvents:UIControlEventValueChanged]; + break; + } case 3: - { - EditSelectionTableViewCell* selCell = (EditSelectionTableViewCell*)cell; - [[selCell label] setText:NSLocalizedString(@"3G Screen", @"'3G Screen': Bookmark 3G Screen settings")]; - NSString* resolution = ScreenResolutionDescription([_params intForKeyPath:@"settings_3g.screen_resolution_type"], [_params intForKeyPath:@"settings_3g.width"], [_params intForKeyPath:@"settings_3g.height"]); - int colorBits = [_params intForKeyPath:@"settings_3g.colors"]; - [[selCell selection] setText:[NSString stringWithFormat:@"%@@%d", resolution, colorBits]]; - [[selCell label] setEnabled:enable_3G_settings]; - [[selCell selection] setEnabled:enable_3G_settings]; - [selCell setSelectionStyle:enable_3G_settings ? UITableViewCellSelectionStyleBlue : UITableViewCellSelectionStyleNone]; - break; - } + { + EditSelectionTableViewCell *selCell = (EditSelectionTableViewCell *)cell; + [[selCell label] + setText:NSLocalizedString(@"3G Screen", + @"'3G Screen': Bookmark 3G Screen settings")]; + NSString *resolution = ScreenResolutionDescription( + [_params intForKeyPath:@"settings_3g.screen_resolution_type"], + [_params intForKeyPath:@"settings_3g.width"], + [_params intForKeyPath:@"settings_3g.height"]); + int colorBits = [_params intForKeyPath:@"settings_3g.colors"]; + [[selCell selection] + setText:[NSString stringWithFormat:@"%@@%d", resolution, colorBits]]; + [[selCell label] setEnabled:enable_3G_settings]; + [[selCell selection] setEnabled:enable_3G_settings]; + [selCell setSelectionStyle:enable_3G_settings ? UITableViewCellSelectionStyleBlue + : UITableViewCellSelectionStyleNone]; + break; + } case 4: - { - EditSubEditTableViewCell* editCell = (EditSubEditTableViewCell*)cell; - [[editCell label] setText:NSLocalizedString(@"3G Performance", @"'3G Performance': Bookmark 3G Performance Settings")]; - [[editCell label] setEnabled:enable_3G_settings]; - [editCell setSelectionStyle:enable_3G_settings ? UITableViewCellSelectionStyleBlue : UITableViewCellSelectionStyleNone]; - break; - } + { + EditSubEditTableViewCell *editCell = (EditSubEditTableViewCell *)cell; + [[editCell label] + setText:NSLocalizedString(@"3G Performance", + @"'3G Performance': Bookmark 3G Performance Settings")]; + [[editCell label] setEnabled:enable_3G_settings]; + [editCell setSelectionStyle:enable_3G_settings ? UITableViewCellSelectionStyleBlue + : UITableViewCellSelectionStyleNone]; + break; + } case 5: - { - EditSelectionTableViewCell* selCell = (EditSelectionTableViewCell*)cell; - [[selCell label] setText:NSLocalizedString(@"Security", @"'Security': Bookmark protocl security settings")]; - [[selCell selection] setText:ProtocolSecurityDescription([_params intForKey:@"security"])]; - break; - } + { + EditSelectionTableViewCell *selCell = (EditSelectionTableViewCell *)cell; + [[selCell label] + setText:NSLocalizedString(@"Security", + @"'Security': Bookmark protocl security settings")]; + [[selCell selection] + setText:ProtocolSecurityDescription([_params intForKey:@"security"])]; + break; + } case 6: - { - EditTextTableViewCell* textCell = (EditTextTableViewCell*)cell; - [[textCell label] setText:NSLocalizedString(@"Remote Program", @"'Remote Program': Bookmark remote program settings")]; - [[textCell textfield] setText:[_params StringForKey:@"remote_program"]]; - [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; - [[textCell textfield] setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; - [self adjustEditTextTableViewCell:textCell]; - break; - } + { + EditTextTableViewCell *textCell = (EditTextTableViewCell *)cell; + [[textCell label] + setText:NSLocalizedString(@"Remote Program", + @"'Remote Program': Bookmark remote program settings")]; + [[textCell textfield] setText:[_params StringForKey:@"remote_program"]]; + [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + [self adjustEditTextTableViewCell:textCell]; + break; + } case 7: - { - EditTextTableViewCell* textCell = (EditTextTableViewCell*)cell; - [[textCell label] setText:NSLocalizedString(@"Working Directory", @"'Working Directory': Bookmark working directory settings")]; - [[textCell textfield] setText:[_params StringForKey:@"working_dir"]]; - [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; - [[textCell textfield] setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; - [self adjustEditTextTableViewCell:textCell]; - break; - } + { + EditTextTableViewCell *textCell = (EditTextTableViewCell *)cell; + [[textCell label] + setText:NSLocalizedString( + @"Working Directory", + @"'Working Directory': Bookmark working directory settings")]; + [[textCell textfield] setText:[_params StringForKey:@"working_dir"]]; + [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + [self adjustEditTextTableViewCell:textCell]; + break; + } case 8: - { - EditFlagTableViewCell* flagCell = (EditFlagTableViewCell*)cell; - [[flagCell label] setText:NSLocalizedString(@"Console Mode", @"'Console Mode': Bookmark console mode settings")]; - [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; - [[flagCell toggle] setOn:[_params boolForKey:@"console"]]; - [[flagCell toggle] addTarget:self action:@selector(toggleSettingValue:) forControlEvents:UIControlEventValueChanged]; - break; - } + { + EditFlagTableViewCell *flagCell = (EditFlagTableViewCell *)cell; + [[flagCell label] + setText:NSLocalizedString(@"Console Mode", + @"'Console Mode': Bookmark console mode settings")]; + [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[flagCell toggle] setOn:[_params boolForKey:@"console"]]; + [[flagCell toggle] addTarget:self + action:@selector(toggleSettingValue:) + forControlEvents:UIControlEventValueChanged]; + break; + } default: NSLog(@"Invalid row index in settings table!"); break; - } + } } #pragma mark - #pragma mark Table view delegate -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - UIViewController* viewCtrl = nil; - - // determine view - switch ([indexPath row]) - { - case 1: - if ([_params boolForKey:@"enable_tsg_settings"]) - viewCtrl = [[[BookmarkGatewaySettingsController alloc] initWithBookmark:_bookmark] autorelease]; - break; - case 3: - if ([_params boolForKey:@"enable_3g_settings"]) - viewCtrl = [[[ScreenSelectionController alloc] initWithConnectionParams:_params keyPath:@"settings_3g"] autorelease]; - break; - case 4: - if ([_params boolForKey:@"enable_3g_settings"]) - viewCtrl = [[[PerformanceEditorController alloc] initWithConnectionParams:_params keyPath:@"settings_3g"] autorelease]; - break; - case 5: - viewCtrl = [[[EditorSelectionController alloc] initWithConnectionParams:_params entries:[NSArray arrayWithObject:@"security"] selections:[NSArray arrayWithObject:SelectionForSecuritySetting()]] autorelease]; - break; - default: - break; - } - - // display view - if(viewCtrl) - [[self navigationController] pushViewController:viewCtrl animated:YES]; -} +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + UIViewController *viewCtrl = nil; + // determine view + switch ([indexPath row]) + { + case 1: + if ([_params boolForKey:@"enable_tsg_settings"]) + viewCtrl = [[[BookmarkGatewaySettingsController alloc] initWithBookmark:_bookmark] + autorelease]; + break; + case 3: + if ([_params boolForKey:@"enable_3g_settings"]) + viewCtrl = [[[ScreenSelectionController alloc] + initWithConnectionParams:_params + keyPath:@"settings_3g"] autorelease]; + break; + case 4: + if ([_params boolForKey:@"enable_3g_settings"]) + viewCtrl = [[[PerformanceEditorController alloc] + initWithConnectionParams:_params + keyPath:@"settings_3g"] autorelease]; + break; + case 5: + viewCtrl = [[[EditorSelectionController alloc] + initWithConnectionParams:_params + entries:[NSArray arrayWithObject:@"security"] + selections:[NSArray arrayWithObject:SelectionForSecuritySetting()]] + autorelease]; + break; + default: + break; + } + + // display view + if (viewCtrl) + [[self navigationController] pushViewController:viewCtrl animated:YES]; +} #pragma mark - #pragma mark Text Field delegate -- (BOOL)textFieldShouldReturn:(UITextField*)textField +- (BOOL)textFieldShouldReturn:(UITextField *)textField { [textField resignFirstResponder]; return NO; @@ -293,21 +339,21 @@ - (BOOL)textFieldShouldEndEditing:(UITextField *)textField { - switch(textField.tag) + switch (textField.tag) { - // update remote program/work dir settings - case GET_TAG(SECTION_ADVANCED_SETTINGS, 6): - { - [_params setValue:[textField text] forKey:@"remote_program"]; - break; - } - - case GET_TAG(SECTION_ADVANCED_SETTINGS, 7): - { - [_params setValue:[textField text] forKey:@"working_dir"]; - break; - } - + // update remote program/work dir settings + case GET_TAG(SECTION_ADVANCED_SETTINGS, 6): + { + [_params setValue:[textField text] forKey:@"remote_program"]; + break; + } + + case GET_TAG(SECTION_ADVANCED_SETTINGS, 7): + { + [_params setValue:[textField text] forKey:@"working_dir"]; + break; + } + default: break; } @@ -318,32 +364,44 @@ - (void)toggleSettingValue:(id)sender { - UISwitch* valueSwitch = (UISwitch*)sender; - switch(valueSwitch.tag) - { - case GET_TAG(SECTION_ADVANCED_SETTINGS, 0): - { - [_params setBool:[valueSwitch isOn] forKey:@"enable_tsg_settings"]; - NSArray* indexPaths = [NSArray arrayWithObjects:[NSIndexPath indexPathForRow:1 inSection:SECTION_ADVANCED_SETTINGS], [NSIndexPath indexPathForRow:2 inSection:SECTION_ADVANCED_SETTINGS], nil]; - [[self tableView] reloadRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone]; - break; - } + UISwitch *valueSwitch = (UISwitch *)sender; + switch (valueSwitch.tag) + { + case GET_TAG(SECTION_ADVANCED_SETTINGS, 0): + { + [_params setBool:[valueSwitch isOn] forKey:@"enable_tsg_settings"]; + NSArray *indexPaths = + [NSArray arrayWithObjects:[NSIndexPath indexPathForRow:1 + inSection:SECTION_ADVANCED_SETTINGS], + [NSIndexPath indexPathForRow:2 + inSection:SECTION_ADVANCED_SETTINGS], + nil]; + [[self tableView] reloadRowsAtIndexPaths:indexPaths + withRowAnimation:UITableViewRowAnimationNone]; + break; + } - case GET_TAG(SECTION_ADVANCED_SETTINGS, 2): - { - [_params setBool:[valueSwitch isOn] forKey:@"enable_3g_settings"]; - NSArray* indexPaths = [NSArray arrayWithObjects:[NSIndexPath indexPathForRow:3 inSection:SECTION_ADVANCED_SETTINGS], [NSIndexPath indexPathForRow:2 inSection:SECTION_ADVANCED_SETTINGS], nil]; - [[self tableView] reloadRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone]; - break; - } - - case GET_TAG(SECTION_ADVANCED_SETTINGS, 8): - [_params setBool:[valueSwitch isOn] forKey:@"console"]; - break; - - default: - break; - } + case GET_TAG(SECTION_ADVANCED_SETTINGS, 2): + { + [_params setBool:[valueSwitch isOn] forKey:@"enable_3g_settings"]; + NSArray *indexPaths = + [NSArray arrayWithObjects:[NSIndexPath indexPathForRow:3 + inSection:SECTION_ADVANCED_SETTINGS], + [NSIndexPath indexPathForRow:2 + inSection:SECTION_ADVANCED_SETTINGS], + nil]; + [[self tableView] reloadRowsAtIndexPaths:indexPaths + withRowAnimation:UITableViewRowAnimationNone]; + break; + } + + case GET_TAG(SECTION_ADVANCED_SETTINGS, 8): + [_params setBool:[valueSwitch isOn] forKey:@"console"]; + break; + + default: + break; + } } @end diff --git a/client/iOS/Controllers/AppSettingsController.h b/client/iOS/Controllers/AppSettingsController.h index 2d59dac01..4de1271b0 100644 --- a/client/iOS/Controllers/AppSettingsController.h +++ b/client/iOS/Controllers/AppSettingsController.h @@ -1,10 +1,11 @@ /* Controller to specify application wide settings - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "EditorBaseController.h" diff --git a/client/iOS/Controllers/AppSettingsController.m b/client/iOS/Controllers/AppSettingsController.m index 0f1d68601..5596e168d 100644 --- a/client/iOS/Controllers/AppSettingsController.m +++ b/client/iOS/Controllers/AppSettingsController.m @@ -1,10 +1,11 @@ /* Controller to specify application wide settings - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "AppSettingsController.h" @@ -21,195 +22,224 @@ #pragma mark - #pragma mark Initialization - - (id)initWithStyle:(UITableViewStyle)style { - if ((self = [super initWithStyle:style])) - { - UIImage* tabBarIcon = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"tabbar_icon_settings" ofType:@"png"]]; - [self setTabBarItem:[[[UITabBarItem alloc] initWithTitle:NSLocalizedString(@"Settings", @"Tabbar item settings") image:tabBarIcon tag:0] autorelease]]; - } - return self; + if ((self = [super initWithStyle:style])) + { + UIImage *tabBarIcon = [UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"tabbar_icon_settings" + ofType:@"png"]]; + [self + setTabBarItem:[[[UITabBarItem alloc] + initWithTitle:NSLocalizedString(@"Settings", @"Tabbar item settings") + image:tabBarIcon + tag:0] autorelease]]; + } + return self; } #pragma mark - #pragma mark View lifecycle -- (void)viewDidLoad { - [super viewDidLoad]; +- (void)viewDidLoad +{ + [super viewDidLoad]; - // set title - [self setTitle:NSLocalizedString(@"Settings", @"App Settings title")]; + // set title + [self setTitle:NSLocalizedString(@"Settings", @"App Settings title")]; } - -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; +- (void)viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; } // Override to allow orientations other than the default portrait orientation. -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return YES; +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; } - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - [super dealloc]; +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [super dealloc]; } #pragma mark - #pragma mark Table view data source - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - // Return the number of sections. - return SECTION_NUM_SECTIONS; +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + // Return the number of sections. + return SECTION_NUM_SECTIONS; } - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - // Return the number of rows in the section. - switch (section) +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + // Return the number of rows in the section. + switch (section) { - case SECTION_UI_SETTINGS: // UI settings - return 5; - case SECTION_CERTIFICATE_HANDLING_SETTINGS: // certificate handling settings - return 2; + case SECTION_UI_SETTINGS: // UI settings + return 5; + case SECTION_CERTIFICATE_HANDLING_SETTINGS: // certificate handling settings + return 2; default: break; } - - return 0; -} + return 0; +} // set section headers - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { - switch(section) + switch (section) { - case SECTION_UI_SETTINGS: + case SECTION_UI_SETTINGS: return NSLocalizedString(@"User Interface", @"UI settings section title"); - case SECTION_CERTIFICATE_HANDLING_SETTINGS: - return NSLocalizedString(@"Server Certificate Handling", @"Server Certificate Handling section title"); - default: + case SECTION_CERTIFICATE_HANDLING_SETTINGS: + return NSLocalizedString(@"Server Certificate Handling", + @"Server Certificate Handling section title"); + default: return nil; } return @"unknown"; } // Customize the appearance of table view cells. -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + // determine the required cell type - NSString* cellIdentifier = nil; - switch([indexPath section]) + NSString *cellIdentifier = nil; + switch ([indexPath section]) { - case SECTION_UI_SETTINGS: - { - switch([indexPath row]) - { - case 0: - case 1: - case 2: - case 3: - case 4: - cellIdentifier = TableCellIdentifierYesNo; - break; - } - break; - } - case SECTION_CERTIFICATE_HANDLING_SETTINGS: - { - switch([indexPath row]) - { - case 0: - cellIdentifier = TableCellIdentifierYesNo; - break; - case 1: - cellIdentifier = TableCellIdentifierSubEditor; - break; - } - break; - } - } - NSAssert(cellIdentifier != nil, @"Couldn't determine cell type"); - + case SECTION_UI_SETTINGS: + { + switch ([indexPath row]) + { + case 0: + case 1: + case 2: + case 3: + case 4: + cellIdentifier = TableCellIdentifierYesNo; + break; + } + break; + } + case SECTION_CERTIFICATE_HANDLING_SETTINGS: + { + switch ([indexPath row]) + { + case 0: + cellIdentifier = TableCellIdentifierYesNo; + break; + case 1: + cellIdentifier = TableCellIdentifierSubEditor; + break; + } + break; + } + } + NSAssert(cellIdentifier != nil, @"Couldn't determine cell type"); + // get the table view cell UITableViewCell *cell = [self tableViewCellFromIdentifier:cellIdentifier]; - NSAssert(cell, @"Invalid cell"); - + NSAssert(cell, @"Invalid cell"); + // set cell values - switch([indexPath section]) - { - case SECTION_UI_SETTINGS: - [self initUISettings:indexPath cell:cell]; - break; - - case SECTION_CERTIFICATE_HANDLING_SETTINGS: - [self initCertificateHandlingSettings:indexPath cell:cell]; - break; - + switch ([indexPath section]) + { + case SECTION_UI_SETTINGS: + [self initUISettings:indexPath cell:cell]; + break; + + case SECTION_CERTIFICATE_HANDLING_SETTINGS: + [self initCertificateHandlingSettings:indexPath cell:cell]; + break; + default: break; - } - - return cell; + } + + return cell; } #pragma mark - Initialization helpers // updates UI settings in the UI -- (void)initUISettings:(NSIndexPath*)indexPath cell:(UITableViewCell*)cell +- (void)initUISettings:(NSIndexPath *)indexPath cell:(UITableViewCell *)cell { - switch([indexPath row]) + switch ([indexPath row]) { case 0: - { - EditFlagTableViewCell* flagCell = (EditFlagTableViewCell*)cell; - [[flagCell label] setText:NSLocalizedString(@"Hide Status Bar", "Show/Hide Phone Status Bar setting")]; - [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; - [[flagCell toggle] setOn:[[NSUserDefaults standardUserDefaults] boolForKey:@"ui.hide_status_bar"]]; - [[flagCell toggle] addTarget:self action:@selector(toggleSettingValue:) forControlEvents:UIControlEventValueChanged]; - break; - } - case 1: - { - EditFlagTableViewCell* flagCell = (EditFlagTableViewCell*)cell; - [[flagCell label] setText:NSLocalizedString(@"Hide Tool Bar", "Show/Hide Tool Bar setting")]; - [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; - [[flagCell toggle] setOn:[[NSUserDefaults standardUserDefaults] boolForKey:@"ui.hide_tool_bar"]]; - [[flagCell toggle] addTarget:self action:@selector(toggleSettingValue:) forControlEvents:UIControlEventValueChanged]; + { + EditFlagTableViewCell *flagCell = (EditFlagTableViewCell *)cell; + [[flagCell label] setText:NSLocalizedString(@"Hide Status Bar", + "Show/Hide Phone Status Bar setting")]; + [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[flagCell toggle] + setOn:[[NSUserDefaults standardUserDefaults] boolForKey:@"ui.hide_status_bar"]]; + [[flagCell toggle] addTarget:self + action:@selector(toggleSettingValue:) + forControlEvents:UIControlEventValueChanged]; break; - } + } + case 1: + { + EditFlagTableViewCell *flagCell = (EditFlagTableViewCell *)cell; + [[flagCell label] + setText:NSLocalizedString(@"Hide Tool Bar", "Show/Hide Tool Bar setting")]; + [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[flagCell toggle] + setOn:[[NSUserDefaults standardUserDefaults] boolForKey:@"ui.hide_tool_bar"]]; + [[flagCell toggle] addTarget:self + action:@selector(toggleSettingValue:) + forControlEvents:UIControlEventValueChanged]; + break; + } case 2: - { - EditFlagTableViewCell* flagCell = (EditFlagTableViewCell*)cell; - [[flagCell label] setText:NSLocalizedString(@"Swap Mouse Buttons", "Swap Mouse Button UI setting")]; - [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; - [[flagCell toggle] setOn:[[NSUserDefaults standardUserDefaults] boolForKey:@"ui.swap_mouse_buttons"]]; - [[flagCell toggle] addTarget:self action:@selector(toggleSettingValue:) forControlEvents:UIControlEventValueChanged]; - break; - } + { + EditFlagTableViewCell *flagCell = (EditFlagTableViewCell *)cell; + [[flagCell label] + setText:NSLocalizedString(@"Swap Mouse Buttons", "Swap Mouse Button UI setting")]; + [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[flagCell toggle] + setOn:[[NSUserDefaults standardUserDefaults] boolForKey:@"ui.swap_mouse_buttons"]]; + [[flagCell toggle] addTarget:self + action:@selector(toggleSettingValue:) + forControlEvents:UIControlEventValueChanged]; + break; + } case 3: - { - EditFlagTableViewCell* flagCell = (EditFlagTableViewCell*)cell; - [[flagCell label] setText:NSLocalizedString(@"Invert Scrolling", "Invert Scrolling UI setting")]; - [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; - [[flagCell toggle] setOn:[[NSUserDefaults standardUserDefaults] boolForKey:@"ui.invert_scrolling"]]; - [[flagCell toggle] addTarget:self action:@selector(toggleSettingValue:) forControlEvents:UIControlEventValueChanged]; - break; - } + { + EditFlagTableViewCell *flagCell = (EditFlagTableViewCell *)cell; + [[flagCell label] + setText:NSLocalizedString(@"Invert Scrolling", "Invert Scrolling UI setting")]; + [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[flagCell toggle] + setOn:[[NSUserDefaults standardUserDefaults] boolForKey:@"ui.invert_scrolling"]]; + [[flagCell toggle] addTarget:self + action:@selector(toggleSettingValue:) + forControlEvents:UIControlEventValueChanged]; + break; + } case 4: - { - EditFlagTableViewCell* flagCell = (EditFlagTableViewCell*)cell; - [[flagCell label] setText:NSLocalizedString(@"Touch Pointer Auto Scroll", "Touch Pointer Auto Scroll UI setting")]; - [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; - [[flagCell toggle] setOn:[[NSUserDefaults standardUserDefaults] boolForKey:@"ui.auto_scroll_touchpointer"]]; - [[flagCell toggle] addTarget:self action:@selector(toggleSettingValue:) forControlEvents:UIControlEventValueChanged]; - break; - } + { + EditFlagTableViewCell *flagCell = (EditFlagTableViewCell *)cell; + [[flagCell label] setText:NSLocalizedString(@"Touch Pointer Auto Scroll", + "Touch Pointer Auto Scroll UI setting")]; + [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[flagCell toggle] setOn:[[NSUserDefaults standardUserDefaults] + boolForKey:@"ui.auto_scroll_touchpointer"]]; + [[flagCell toggle] addTarget:self + action:@selector(toggleSettingValue:) + forControlEvents:UIControlEventValueChanged]; + break; + } default: NSLog(@"Invalid row index in settings table!"); break; @@ -217,25 +247,30 @@ } // updates certificate handling settings in the UI -- (void)initCertificateHandlingSettings:(NSIndexPath*)indexPath cell:(UITableViewCell*)cell +- (void)initCertificateHandlingSettings:(NSIndexPath *)indexPath cell:(UITableViewCell *)cell { - switch([indexPath row]) + switch ([indexPath row]) { case 0: - { - EditFlagTableViewCell* flagCell = (EditFlagTableViewCell*)cell; - [[flagCell label] setText:NSLocalizedString(@"Accept all Certificates", "Accept All Certificates setting")]; - [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; - [[flagCell toggle] setOn:[[NSUserDefaults standardUserDefaults] boolForKey:@"security.accept_certificates"]]; - [[flagCell toggle] addTarget:self action:@selector(toggleSettingValue:) forControlEvents:UIControlEventValueChanged]; - break; - } + { + EditFlagTableViewCell *flagCell = (EditFlagTableViewCell *)cell; + [[flagCell label] setText:NSLocalizedString(@"Accept all Certificates", + "Accept All Certificates setting")]; + [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[flagCell toggle] setOn:[[NSUserDefaults standardUserDefaults] + boolForKey:@"security.accept_certificates"]]; + [[flagCell toggle] addTarget:self + action:@selector(toggleSettingValue:) + forControlEvents:UIControlEventValueChanged]; + break; + } case 1: - { - EditSubEditTableViewCell* subCell = (EditSubEditTableViewCell*)cell; - [[subCell label] setText:NSLocalizedString(@"Erase Certificate Cache", @"Erase certificate cache button")]; - break; - } + { + EditSubEditTableViewCell *subCell = (EditSubEditTableViewCell *)cell; + [[subCell label] setText:NSLocalizedString(@"Erase Certificate Cache", + @"Erase certificate cache button")]; + break; + } default: NSLog(@"Invalid row index in settings table!"); break; @@ -245,24 +280,35 @@ #pragma mark - #pragma mark Table view delegate -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ - // deselect any row to fake a button-pressed like effect - [tableView deselectRowAtIndexPath:indexPath animated:YES]; + // deselect any row to fake a button-pressed like effect + [tableView deselectRowAtIndexPath:indexPath animated:YES]; - // ensure everything is stored in our settings before we proceed - [[self view] endEditing:NO]; - - // clear certificate cache - if([indexPath section] == SECTION_CERTIFICATE_HANDLING_SETTINGS && [indexPath row] == 1) - { - // delete certificates cache - NSError* err; - if ([[NSFileManager defaultManager] removeItemAtPath:[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"/.freerdp"] error:&err]) - [[self view] makeToast:NSLocalizedString(@"Certificate Cache cleared!", @"Clear Certificate cache success message") duration:ToastDurationNormal position:@"center"]; - else - [[self view] makeToast:NSLocalizedString(@"Error clearing the Certificate Cache!", @"Clear Certificate cache failed message") duration:ToastDurationNormal position:@"center"]; - } + // ensure everything is stored in our settings before we proceed + [[self view] endEditing:NO]; + + // clear certificate cache + if ([indexPath section] == SECTION_CERTIFICATE_HANDLING_SETTINGS && [indexPath row] == 1) + { + // delete certificates cache + NSError *err; + if ([[NSFileManager defaultManager] + removeItemAtPath:[[NSSearchPathForDirectoriesInDomains( + NSDocumentDirectory, NSUserDomainMask, YES) lastObject] + stringByAppendingPathComponent:@"/.freerdp"] + error:&err]) + [[self view] makeToast:NSLocalizedString(@"Certificate Cache cleared!", + @"Clear Certificate cache success message") + duration:ToastDurationNormal + position:@"center"]; + else + [[self view] makeToast:NSLocalizedString(@"Error clearing the Certificate Cache!", + @"Clear Certificate cache failed message") + duration:ToastDurationNormal + position:@"center"]; + } } #pragma mark - @@ -270,40 +316,45 @@ - (void)toggleSettingValue:(id)sender { - UISwitch* valueSwitch = (UISwitch*)sender; - switch([valueSwitch tag]) - { - case GET_TAG(SECTION_UI_SETTINGS, 0): - [[NSUserDefaults standardUserDefaults] setBool:[valueSwitch isOn] forKey:@"ui.hide_status_bar"]; - break; + UISwitch *valueSwitch = (UISwitch *)sender; + switch ([valueSwitch tag]) + { + case GET_TAG(SECTION_UI_SETTINGS, 0): + [[NSUserDefaults standardUserDefaults] setBool:[valueSwitch isOn] + forKey:@"ui.hide_status_bar"]; + break; - case GET_TAG(SECTION_UI_SETTINGS, 1): - [[NSUserDefaults standardUserDefaults] setBool:[valueSwitch isOn] forKey:@"ui.hide_tool_bar"]; - break; + case GET_TAG(SECTION_UI_SETTINGS, 1): + [[NSUserDefaults standardUserDefaults] setBool:[valueSwitch isOn] + forKey:@"ui.hide_tool_bar"]; + break; - case GET_TAG(SECTION_UI_SETTINGS, 2): - [[NSUserDefaults standardUserDefaults] setBool:[valueSwitch isOn] forKey:@"ui.swap_mouse_buttons"]; - SetSwapMouseButtonsFlag([valueSwitch isOn]); - break; + case GET_TAG(SECTION_UI_SETTINGS, 2): + [[NSUserDefaults standardUserDefaults] setBool:[valueSwitch isOn] + forKey:@"ui.swap_mouse_buttons"]; + SetSwapMouseButtonsFlag([valueSwitch isOn]); + break; - case GET_TAG(SECTION_UI_SETTINGS, 3): - [[NSUserDefaults standardUserDefaults] setBool:[valueSwitch isOn] forKey:@"ui.invert_scrolling"]; - SetInvertScrollingFlag([valueSwitch isOn]); - break; + case GET_TAG(SECTION_UI_SETTINGS, 3): + [[NSUserDefaults standardUserDefaults] setBool:[valueSwitch isOn] + forKey:@"ui.invert_scrolling"]; + SetInvertScrollingFlag([valueSwitch isOn]); + break; - case GET_TAG(SECTION_UI_SETTINGS, 4): - [[NSUserDefaults standardUserDefaults] setBool:[valueSwitch isOn] forKey:@"ui.auto_scroll_touchpointer"]; - SetInvertScrollingFlag([valueSwitch isOn]); - break; + case GET_TAG(SECTION_UI_SETTINGS, 4): + [[NSUserDefaults standardUserDefaults] setBool:[valueSwitch isOn] + forKey:@"ui.auto_scroll_touchpointer"]; + SetInvertScrollingFlag([valueSwitch isOn]); + break; - case GET_TAG(SECTION_CERTIFICATE_HANDLING_SETTINGS, 0): - [[NSUserDefaults standardUserDefaults] setBool:[valueSwitch isOn] forKey:@"security.accept_certificates"]; - break; - - default: - break; - } + case GET_TAG(SECTION_CERTIFICATE_HANDLING_SETTINGS, 0): + [[NSUserDefaults standardUserDefaults] setBool:[valueSwitch isOn] + forKey:@"security.accept_certificates"]; + break; + + default: + break; + } } @end - diff --git a/client/iOS/Controllers/BookmarkEditorController.h b/client/iOS/Controllers/BookmarkEditorController.h index 2fdf6170f..10dbf705c 100644 --- a/client/iOS/Controllers/BookmarkEditorController.h +++ b/client/iOS/Controllers/BookmarkEditorController.h @@ -1,12 +1,12 @@ /* Bookmark editor controller - - Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ #import #import "EditorBaseController.h" @@ -14,27 +14,25 @@ @class ComputerBookmark; @class ConnectionParams; - @protocol BookmarkEditorDelegate // bookmark editing finsihed -- (void)commitBookmark:(ComputerBookmark*)bookmark; +- (void)commitBookmark:(ComputerBookmark *)bookmark; @end - @interface BookmarkEditorController : EditorBaseController { -@private - ComputerBookmark* _bookmark; - ConnectionParams* _params; - - BOOL _display_server_settings; - - id delegate; + @private + ComputerBookmark *_bookmark; + ConnectionParams *_params; + + BOOL _display_server_settings; + + id delegate; } -@property (nonatomic, assign) id delegate; +@property(nonatomic, assign) id delegate; // init for the given bookmark -- (id)initWithBookmark:(ComputerBookmark*)bookmark; +- (id)initWithBookmark:(ComputerBookmark *)bookmark; @end diff --git a/client/iOS/Controllers/BookmarkEditorController.m b/client/iOS/Controllers/BookmarkEditorController.m index 20ef7fef3..de49e3e86 100644 --- a/client/iOS/Controllers/BookmarkEditorController.m +++ b/client/iOS/Controllers/BookmarkEditorController.m @@ -1,10 +1,11 @@ /* Bookmark editor controller - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "BookmarkEditorController.h" @@ -26,63 +27,74 @@ #define SECTION_COUNT 3 #pragma mark - -#pragma mark Initialization +#pragma mark Initialization -- (id)initWithBookmark:(ComputerBookmark*)bookmark +- (id)initWithBookmark:(ComputerBookmark *)bookmark { - if ((self = [super initWithStyle:UITableViewStyleGrouped])) + if ((self = [super initWithStyle:UITableViewStyleGrouped])) { // set additional settings state according to bookmark data - if ([[bookmark uuid] length] == 0) - _bookmark = [bookmark copy]; - else - _bookmark = [bookmark copyWithUUID]; - _params = [_bookmark params]; + if ([[bookmark uuid] length] == 0) + _bookmark = [bookmark copy]; + else + _bookmark = [bookmark copyWithUUID]; + _params = [_bookmark params]; - _display_server_settings = YES; - } - return self; + _display_server_settings = YES; + } + return self; } - #pragma mark - #pragma mark View lifecycle +- (void)viewDidLoad +{ + [super viewDidLoad]; -- (void)viewDidLoad { - [super viewDidLoad]; - - // replace back button with a custom handler that checks if the required bookmark settings were specified - UIBarButtonItem* saveButton = [[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Save", @"Save Button title") style:UIBarButtonItemStyleDone target:self action:@selector(handleSave:)] autorelease]; - UIBarButtonItem* cancelButton = [[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Cancel", @"Cancel Button title") style:UIBarButtonItemStyleBordered target:self action:@selector(handleCancel:)] autorelease]; - [[self navigationItem] setLeftBarButtonItem:cancelButton]; - [[self navigationItem] setRightBarButtonItem:saveButton]; + // replace back button with a custom handler that checks if the required bookmark settings were + // specified + UIBarButtonItem *saveButton = + [[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Save", @"Save Button title") + style:UIBarButtonItemStyleDone + target:self + action:@selector(handleSave:)] autorelease]; + UIBarButtonItem *cancelButton = + [[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Cancel", @"Cancel Button title") + style:UIBarButtonItemStyleBordered + target:self + action:@selector(handleCancel:)] autorelease]; + [[self navigationItem] setLeftBarButtonItem:cancelButton]; + [[self navigationItem] setRightBarButtonItem:saveButton]; } -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; - // we need to reload the table view data here to have up-to-date data for the - // advanced settings accessory items (like for resolution/color mode settings) - [[self tableView] reloadData]; + // we need to reload the table view data here to have up-to-date data for the + // advanced settings accessory items (like for resolution/color mode settings) + [[self tableView] reloadData]; } // Override to allow orientations other than the default portrait orientation. -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return YES; +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; } #pragma mark - #pragma mark Table view data source -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - // Return the number of sections. - return SECTION_COUNT; +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + // Return the number of sections. + return SECTION_COUNT; } - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - // Return the number of rows in the section. +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + // Return the number of rows in the section. switch (section) { case SECTION_SERVER: // server settings @@ -94,18 +106,19 @@ default: break; } - - return 0; -} + return 0; +} // set section headers - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { - switch(section) + switch (section) { case SECTION_SERVER: - return (_display_server_settings ? NSLocalizedString(@"Host", @"'Host': host settings header") : nil); + return (_display_server_settings + ? NSLocalizedString(@"Host", @"'Host': host settings header") + : nil); case SECTION_CREDENTIALS: return NSLocalizedString(@"Credentials", @"'Credentials': credentials settings header"); case SECTION_SETTINGS: @@ -114,56 +127,57 @@ return @"unknown"; } - // Customize the appearance of table view cells. -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ // determine the required cell type - NSString* cellType = nil; - switch([indexPath section]) + NSString *cellType = nil; + switch ([indexPath section]) { case SECTION_SERVER: - cellType = TableCellIdentifierText; + cellType = TableCellIdentifierText; break; - case SECTION_CREDENTIALS: - cellType = TableCellIdentifierSelection; - break; - - case SECTION_SETTINGS: // settings - { - switch([indexPath row]) - { - case 0: // screen/color depth - cellType = TableCellIdentifierSelection; - break; - case 1: // performance settings - case 2: // advanced settings - cellType = TableCellIdentifierSubEditor; - break; - default: - break; - } - } - break; + case SECTION_CREDENTIALS: + cellType = TableCellIdentifierSelection; + break; + + case SECTION_SETTINGS: // settings + { + switch ([indexPath row]) + { + case 0: // screen/color depth + cellType = TableCellIdentifierSelection; + break; + case 1: // performance settings + case 2: // advanced settings + cellType = TableCellIdentifierSubEditor; + break; + default: + break; + } + } + break; + + default: + break; + } + NSAssert(cellType != nil, @"Couldn't determine cell type"); - default: - break; - } - NSAssert(cellType != nil, @"Couldn't determine cell type"); - // get the table view cell UITableViewCell *cell = [self tableViewCellFromIdentifier:cellType]; - NSAssert(cell, @"Invalid cell"); - + NSAssert(cell, @"Invalid cell"); + // set cell values - switch([indexPath section]) + switch ([indexPath section]) { // server settings case SECTION_SERVER: [self initServerSettings:indexPath cell:cell]; break; - + // credentials case SECTION_CREDENTIALS: [self initCredentialSettings:indexPath cell:cell]; @@ -176,50 +190,54 @@ default: break; - } - - return cell; + } + + return cell; } // updates server settings in the UI -- (void)initServerSettings:(NSIndexPath*)indexPath cell:(UITableViewCell*)cell +- (void)initServerSettings:(NSIndexPath *)indexPath cell:(UITableViewCell *)cell { - EditTextTableViewCell* textCell = (EditTextTableViewCell*)cell; + EditTextTableViewCell *textCell = (EditTextTableViewCell *)cell; [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; - switch([indexPath row]) + switch ([indexPath row]) { case 0: [[textCell label] setText:NSLocalizedString(@"Label", @"'Label': Bookmark label")]; [[textCell textfield] setText:[_bookmark label]]; - [[textCell textfield] setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; break; case 1: [[textCell label] setText:NSLocalizedString(@"Host", @"'Host': Bookmark hostname")]; [[textCell textfield] setText:[_params StringForKey:@"hostname"]]; - [[textCell textfield] setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; break; case 2: [[textCell label] setText:NSLocalizedString(@"Port", @"'Port': Bookmark port")]; - [[textCell textfield] setText:[NSString stringWithFormat:@"%d", [_params intForKey:@"port"]]]; - [[textCell textfield] setKeyboardType:UIKeyboardTypeNumberPad]; + [[textCell textfield] + setText:[NSString stringWithFormat:@"%d", [_params intForKey:@"port"]]]; + [[textCell textfield] setKeyboardType:UIKeyboardTypeNumberPad]; break; default: NSLog(@"Invalid row index in settings table!"); break; - } + } - [self adjustEditTextTableViewCell:textCell]; + [self adjustEditTextTableViewCell:textCell]; } // updates credentials in the UI -- (void)initCredentialSettings:(NSIndexPath*)indexPath cell:(UITableViewCell*)cell +- (void)initCredentialSettings:(NSIndexPath *)indexPath cell:(UITableViewCell *)cell { - EditSelectionTableViewCell* selCell = (EditSelectionTableViewCell*)cell; - switch(indexPath.row) + EditSelectionTableViewCell *selCell = (EditSelectionTableViewCell *)cell; + switch (indexPath.row) { case 0: - [[selCell label] setText:NSLocalizedString(@"Credentials", @"'Credentials': Bookmark credentials")]; - [[selCell selection] setText:[_params StringForKey:@"username"]]; + [[selCell label] + setText:NSLocalizedString(@"Credentials", @"'Credentials': Bookmark credentials")]; + [[selCell selection] setText:[_params StringForKey:@"username"]]; break; default: NSLog(@"Invalid row index in settings table!"); @@ -228,85 +246,95 @@ } // updates session settings in the UI -- (void)initSettings:(NSIndexPath*)indexPath cell:(UITableViewCell*)cell -{ - switch(indexPath.row) +- (void)initSettings:(NSIndexPath *)indexPath cell:(UITableViewCell *)cell +{ + switch (indexPath.row) { case 0: - { - EditSelectionTableViewCell* selCell = (EditSelectionTableViewCell*)cell; - [[selCell label] setText:NSLocalizedString(@"Screen", @"'Screen': Bookmark Screen settings")]; - NSString* resolution = ScreenResolutionDescription([_params intForKey:@"screen_resolution_type"], [_params intForKey:@"width"], [_params intForKey:@"height"]); - int colorBits = [_params intForKey:@"colors"]; - [[selCell selection] setText:[NSString stringWithFormat:@"%@@%d", resolution, colorBits]]; - break; - } + { + EditSelectionTableViewCell *selCell = (EditSelectionTableViewCell *)cell; + [[selCell label] + setText:NSLocalizedString(@"Screen", @"'Screen': Bookmark Screen settings")]; + NSString *resolution = ScreenResolutionDescription( + [_params intForKey:@"screen_resolution_type"], [_params intForKey:@"width"], + [_params intForKey:@"height"]); + int colorBits = [_params intForKey:@"colors"]; + [[selCell selection] + setText:[NSString stringWithFormat:@"%@@%d", resolution, colorBits]]; + break; + } case 1: - { - EditSubEditTableViewCell* editCell = (EditSubEditTableViewCell*)cell; - [[editCell label] setText:NSLocalizedString(@"Performance", @"'Performance': Bookmark Performance Settings")]; - break; - } + { + EditSubEditTableViewCell *editCell = (EditSubEditTableViewCell *)cell; + [[editCell label] + setText:NSLocalizedString(@"Performance", + @"'Performance': Bookmark Performance Settings")]; + break; + } case 2: - { - EditSubEditTableViewCell* editCell = (EditSubEditTableViewCell*)cell; - [[editCell label] setText:NSLocalizedString(@"Advanced", @"'Advanced': Bookmark Advanced Settings")]; - break; - } + { + EditSubEditTableViewCell *editCell = (EditSubEditTableViewCell *)cell; + [[editCell label] + setText:NSLocalizedString(@"Advanced", @"'Advanced': Bookmark Advanced Settings")]; + break; + } default: NSLog(@"Invalid row index in settings table!"); break; - } + } } - #pragma mark - #pragma mark Table view delegate -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - UIViewController* viewCtrl = nil; +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + UIViewController *viewCtrl = nil; - // determine view - switch([indexPath section]) - { - case SECTION_CREDENTIALS: - { - if ([indexPath row] == 0) - viewCtrl = [[[CredentialsEditorController alloc] initWithBookmark:_bookmark] autorelease]; - break; - } - - case SECTION_SETTINGS: - { - switch ([indexPath row]) - { - case 0: - viewCtrl = [[[ScreenSelectionController alloc] initWithConnectionParams:_params] autorelease]; - break; - case 1: - viewCtrl = [[[PerformanceEditorController alloc] initWithConnectionParams:_params] autorelease]; - break; - case 2: - viewCtrl = [[[AdvancedBookmarkEditorController alloc] initWithBookmark:_bookmark] autorelease]; - break; - default: - break; - } - - break; - } - } + // determine view + switch ([indexPath section]) + { + case SECTION_CREDENTIALS: + { + if ([indexPath row] == 0) + viewCtrl = + [[[CredentialsEditorController alloc] initWithBookmark:_bookmark] autorelease]; + break; + } - // display view - if(viewCtrl) - [[self navigationController] pushViewController:viewCtrl animated:YES]; + case SECTION_SETTINGS: + { + switch ([indexPath row]) + { + case 0: + viewCtrl = [[[ScreenSelectionController alloc] initWithConnectionParams:_params] + autorelease]; + break; + case 1: + viewCtrl = [[[PerformanceEditorController alloc] + initWithConnectionParams:_params] autorelease]; + break; + case 2: + viewCtrl = [[[AdvancedBookmarkEditorController alloc] + initWithBookmark:_bookmark] autorelease]; + break; + default: + break; + } + + break; + } + } + + // display view + if (viewCtrl) + [[self navigationController] pushViewController:viewCtrl animated:YES]; } - #pragma mark - #pragma mark Text Field delegate -- (BOOL)textFieldShouldReturn:(UITextField*)textField +- (BOOL)textFieldShouldReturn:(UITextField *)textField { [textField resignFirstResponder]; return NO; @@ -314,7 +342,7 @@ - (BOOL)textFieldShouldEndEditing:(UITextField *)textField { - switch(textField.tag) + switch (textField.tag) { // update server settings case GET_TAG(SECTION_SERVER, 0): @@ -328,7 +356,7 @@ case GET_TAG(SECTION_SERVER, 2): [_params setInt:[[textField text] intValue] forKey:@"port"]; break; - + default: break; } @@ -340,51 +368,60 @@ - (void)handleSave:(id)sender { - // resign any first responder (so that we finish editing any bookmark parameter that might be currently edited) - [[self view] endEditing:NO]; - - // verify that bookmark is complete (only for manual bookmarks) - if ([[_bookmark label] length] == 0 || [[_params StringForKey:@"hostname"] length] == 0 || [_params intForKey:@"port"] == 0) - { - BlockAlertView* alertView = [BlockAlertView alertWithTitle:NSLocalizedString(@"Cancel without saving?", @"Incomplete bookmark error title") message:NSLocalizedString(@"Press 'Cancel' to abort!\nPress 'Continue' to specify the required fields!", @"Incomplete bookmark error message")]; - [alertView setCancelButtonWithTitle:NSLocalizedString(@"Cancel", @"Cancel Button") block:^{ - // cancel bookmark editing and return to previous view controller - [[self navigationController] popViewControllerAnimated:YES]; - }]; - [alertView addButtonWithTitle:NSLocalizedString(@"Continue", @"Continue Button") block:nil]; - [alertView show]; - return; - } - - // commit bookmark - if ([[self delegate] respondsToSelector:@selector(commitBookmark:)]) - [[self delegate] commitBookmark:_bookmark]; - - // return to previous view controller - [[self navigationController] popViewControllerAnimated:YES]; + // resign any first responder (so that we finish editing any bookmark parameter that might be + // currently edited) + [[self view] endEditing:NO]; + + // verify that bookmark is complete (only for manual bookmarks) + if ([[_bookmark label] length] == 0 || [[_params StringForKey:@"hostname"] length] == 0 || + [_params intForKey:@"port"] == 0) + { + BlockAlertView *alertView = [BlockAlertView + alertWithTitle:NSLocalizedString(@"Cancel without saving?", + @"Incomplete bookmark error title") + message:NSLocalizedString(@"Press 'Cancel' to abort!\nPress 'Continue' to " + @"specify the required fields!", + @"Incomplete bookmark error message")]; + [alertView + setCancelButtonWithTitle:NSLocalizedString(@"Cancel", @"Cancel Button") + block:^{ + // cancel bookmark editing and return to previous view controller + [[self navigationController] popViewControllerAnimated:YES]; + }]; + [alertView addButtonWithTitle:NSLocalizedString(@"Continue", @"Continue Button") block:nil]; + [alertView show]; + return; + } + + // commit bookmark + if ([[self delegate] respondsToSelector:@selector(commitBookmark:)]) + [[self delegate] commitBookmark:_bookmark]; + + // return to previous view controller + [[self navigationController] popViewControllerAnimated:YES]; } - (void)handleCancel:(id)sender { - // return to previous view controller - [[self navigationController] popViewControllerAnimated:YES]; + // return to previous view controller + [[self navigationController] popViewControllerAnimated:YES]; } #pragma mark - #pragma mark Memory management -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Relinquish ownership any cached data, images, etc that aren't in use. +- (void)didReceiveMemoryWarning +{ + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Relinquish ownership any cached data, images, etc that aren't in use. } -- (void)dealloc { - [super dealloc]; - [_bookmark autorelease]; +- (void)dealloc +{ + [super dealloc]; + [_bookmark autorelease]; } - @end - diff --git a/client/iOS/Controllers/BookmarkGatewaySettingsController.h b/client/iOS/Controllers/BookmarkGatewaySettingsController.h index d663d7bda..26b059a73 100644 --- a/client/iOS/Controllers/BookmarkGatewaySettingsController.h +++ b/client/iOS/Controllers/BookmarkGatewaySettingsController.h @@ -1,10 +1,11 @@ /* Controller to edit ts gateway bookmark settings - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "EditorBaseController.h" @@ -14,12 +15,12 @@ @interface BookmarkGatewaySettingsController : EditorBaseController { -@private - ComputerBookmark* _bookmark; - ConnectionParams* _params; + @private + ComputerBookmark *_bookmark; + ConnectionParams *_params; } // init for the given bookmark -- (id)initWithBookmark:(ComputerBookmark*)bookmark; +- (id)initWithBookmark:(ComputerBookmark *)bookmark; @end diff --git a/client/iOS/Controllers/BookmarkGatewaySettingsController.m b/client/iOS/Controllers/BookmarkGatewaySettingsController.m index 32803b1ba..d58bdbd4c 100644 --- a/client/iOS/Controllers/BookmarkGatewaySettingsController.m +++ b/client/iOS/Controllers/BookmarkGatewaySettingsController.m @@ -20,54 +20,54 @@ @implementation BookmarkGatewaySettingsController -- (id)initWithBookmark:(ComputerBookmark*)bookmark +- (id)initWithBookmark:(ComputerBookmark *)bookmark { - if ((self = [super initWithStyle:UITableViewStyleGrouped])) + if ((self = [super initWithStyle:UITableViewStyleGrouped])) { // set additional settings state according to bookmark data _bookmark = [bookmark retain]; - _params = [bookmark params]; - } - return self; + _params = [bookmark params]; + } + return self; } - (void)viewDidLoad { - [super viewDidLoad]; - [self setTitle:NSLocalizedString(@"TS Gateway Settings", @"TS Gateway Settings title")]; + [super viewDidLoad]; + [self setTitle:NSLocalizedString(@"TS Gateway Settings", @"TS Gateway Settings title")]; } - (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - - // we need to reload the table view data here to have up-to-date data for the - // advanced settings accessory items (like for resolution/color mode settings) - [[self tableView] reloadData]; + [super viewWillAppear:animated]; + + // we need to reload the table view data here to have up-to-date data for the + // advanced settings accessory items (like for resolution/color mode settings) + [[self tableView] reloadData]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return YES; + return YES; } - (void)dealloc { - [super dealloc]; - [_bookmark release]; + [super dealloc]; + [_bookmark release]; } #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - // Return the number of sections. - return SECTION_COUNT; + // Return the number of sections. + return SECTION_COUNT; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - // Return the number of rows in the section. + // Return the number of rows in the section. switch (section) { case SECTION_TSGATEWAY_SETTINGS: // ts gateway settings @@ -75,14 +75,14 @@ default: break; } - - return 0; + + return 0; } // set section headers - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { - switch(section) + switch (section) { case SECTION_TSGATEWAY_SETTINGS: return NSLocalizedString(@"TS Gateway", @"'TS Gateway': ts gateway settings header"); @@ -90,112 +90,119 @@ return @"unknown"; } -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath { // determine the required cell type - NSString* cellType = nil; - switch([indexPath section]) + NSString *cellType = nil; + switch ([indexPath section]) { - case SECTION_TSGATEWAY_SETTINGS: // advanced settings - { - switch([indexPath row]) - { - case 0: // hostname - case 1: // port - case 2: // username - case 4: // domain - cellType = TableCellIdentifierText; - break; - case 3: // password - cellType = TableCellIdentifierSecretText; - break; - default: - break; - } + case SECTION_TSGATEWAY_SETTINGS: // advanced settings + { + switch ([indexPath row]) + { + case 0: // hostname + case 1: // port + case 2: // username + case 4: // domain + cellType = TableCellIdentifierText; + break; + case 3: // password + cellType = TableCellIdentifierSecretText; + break; + default: + break; + } break; - } + } } NSAssert(cellType != nil, @"Couldn't determine cell type"); - + // get the table view cell UITableViewCell *cell = [self tableViewCellFromIdentifier:cellType]; NSAssert(cell, @"Invalid cell"); - + // set cell values - switch([indexPath section]) + switch ([indexPath section]) { - // advanced settings + // advanced settings case SECTION_TSGATEWAY_SETTINGS: [self initGatewaySettings:indexPath cell:cell]; break; - + default: break; } - - return cell; + + return cell; } // updates server settings in the UI -- (void)initGatewaySettings:(NSIndexPath*)indexPath cell:(UITableViewCell*)cell +- (void)initGatewaySettings:(NSIndexPath *)indexPath cell:(UITableViewCell *)cell { - EditTextTableViewCell* textCell = (EditTextTableViewCell*)cell; + EditTextTableViewCell *textCell = (EditTextTableViewCell *)cell; [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; - switch([indexPath row]) + switch ([indexPath row]) { case 0: - { + { [[textCell label] setText:NSLocalizedString(@"Host", @"'Host': Bookmark hostname")]; [[textCell textfield] setText:[_params StringForKey:@"tsg_hostname"]]; - [[textCell textfield] setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; break; - } + } case 1: - { - int port = [_params intForKey:@"tsg_port"]; - if (port == 0) port = 443; + { + int port = [_params intForKey:@"tsg_port"]; + if (port == 0) + port = 443; [[textCell label] setText:NSLocalizedString(@"Port", @"'Port': Bookmark port")]; [[textCell textfield] setText:[NSString stringWithFormat:@"%d", port]]; - [[textCell textfield] setKeyboardType:UIKeyboardTypeNumberPad]; - break; - } + [[textCell textfield] setKeyboardType:UIKeyboardTypeNumberPad]; + break; + } case 2: - { - [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; - [[textCell label] setText:NSLocalizedString(@"Username", @"'Username': Bookmark username")]; + { + [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[textCell label] + setText:NSLocalizedString(@"Username", @"'Username': Bookmark username")]; [[textCell textfield] setText:[_params StringForKey:@"tsg_username"]]; - [[textCell textfield] setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; break; - } + } case 3: - { - [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; - [[textCell label] setText:NSLocalizedString(@"Password", @"'Password': Bookmark password")]; + { + [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[textCell label] + setText:NSLocalizedString(@"Password", @"'Password': Bookmark password")]; [[textCell textfield] setText:[_params StringForKey:@"tsg_password"]]; - [[textCell textfield] setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; break; - } + } case 4: - { - [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; + { + [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; [[textCell label] setText:NSLocalizedString(@"Domain", @"'Domain': Bookmark domain")]; [[textCell textfield] setText:[_params StringForKey:@"tsg_domain"]]; - [[textCell textfield] setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; break; - } + } default: NSLog(@"Invalid row index in settings table!"); break; } - - [self adjustEditTextTableViewCell:textCell]; -} + [self adjustEditTextTableViewCell:textCell]; +} #pragma mark - #pragma mark Text Field delegate -- (BOOL)textFieldShouldReturn:(UITextField*)textField +- (BOOL)textFieldShouldReturn:(UITextField *)textField { [textField resignFirstResponder]; return NO; @@ -203,34 +210,33 @@ - (BOOL)textFieldShouldEndEditing:(UITextField *)textField { - switch(textField.tag) + switch (textField.tag) { - // update server settings + // update server settings case GET_TAG(SECTION_TSGATEWAY_SETTINGS, 0): [_params setValue:[textField text] forKey:@"tsg_hostname"]; break; - + case GET_TAG(SECTION_TSGATEWAY_SETTINGS, 1): [_params setInt:[[textField text] intValue] forKey:@"tsg_port"]; break; - + case GET_TAG(SECTION_TSGATEWAY_SETTINGS, 2): [_params setValue:[textField text] forKey:@"tsg_username"]; break; - + case GET_TAG(SECTION_TSGATEWAY_SETTINGS, 3): [_params setValue:[textField text] forKey:@"tsg_password"]; break; - + case GET_TAG(SECTION_TSGATEWAY_SETTINGS, 4): [_params setValue:[textField text] forKey:@"tsg_domain"]; - break; - + break; + default: break; } return YES; } - @end diff --git a/client/iOS/Controllers/BookmarkListController.h b/client/iOS/Controllers/BookmarkListController.h index d67325f5a..79734523d 100644 --- a/client/iOS/Controllers/BookmarkListController.h +++ b/client/iOS/Controllers/BookmarkListController.h @@ -1,10 +1,11 @@ /* bookmarks and active session view controller - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @@ -14,41 +15,42 @@ #import "BookmarkEditorController.h" #import "Reachability.h" -@interface BookmarkListController : UIViewController -{ +@interface BookmarkListController : UIViewController +{ // custom bookmark and session table cells - BookmarkTableCell* _bmTableCell; - SessionTableCell* _sessTableCell; + BookmarkTableCell *_bmTableCell; + SessionTableCell *_sessTableCell; // child views - UISearchBar* _searchBar; - UITableView* _tableView; - - // array with search results (or nil if no search active) - NSMutableArray* _manual_search_result; - NSMutableArray* _history_search_result; + UISearchBar *_searchBar; + UITableView *_tableView; - // bookmark arrays - NSMutableArray* _manual_bookmarks; - - // bookmark star images - UIImage* _star_on_img; - UIImage* _star_off_img; - - // array with active sessions - NSMutableArray* _active_sessions; - - // array with connection history entries - NSMutableArray* _connection_history; - - // temporary bookmark when asking if the user wants to store a bookmark for a session initiated by a quick connect - ComputerBookmark* _temporary_bookmark; + // array with search results (or nil if no search active) + NSMutableArray *_manual_search_result; + NSMutableArray *_history_search_result; + + // bookmark arrays + NSMutableArray *_manual_bookmarks; + + // bookmark star images + UIImage *_star_on_img; + UIImage *_star_off_img; + + // array with active sessions + NSMutableArray *_active_sessions; + + // array with connection history entries + NSMutableArray *_connection_history; + + // temporary bookmark when asking if the user wants to store a bookmark for a session initiated + // by a quick connect + ComputerBookmark *_temporary_bookmark; } -@property (nonatomic, retain) IBOutlet UISearchBar* searchBar; -@property (nonatomic, retain) IBOutlet UITableView* tableView; -@property (nonatomic, retain) IBOutlet BookmarkTableCell* bmTableCell; -@property (nonatomic, retain) IBOutlet SessionTableCell* sessTableCell; - +@property(nonatomic, retain) IBOutlet UISearchBar *searchBar; +@property(nonatomic, retain) IBOutlet UITableView *tableView; +@property(nonatomic, retain) IBOutlet BookmarkTableCell *bmTableCell; +@property(nonatomic, retain) IBOutlet SessionTableCell *sessTableCell; @end diff --git a/client/iOS/Controllers/BookmarkListController.m b/client/iOS/Controllers/BookmarkListController.m index e3497df91..1d37caf66 100644 --- a/client/iOS/Controllers/BookmarkListController.m +++ b/client/iOS/Controllers/BookmarkListController.m @@ -1,10 +1,11 @@ /* bookmarks and active session view controller - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "BookmarkListController.h" @@ -16,406 +17,458 @@ #import "GlobalDefaults.h" #import "BlockAlertView.h" -#define SECTION_SESSIONS 0 -#define SECTION_BOOKMARKS 1 -#define NUM_SECTIONS 2 +#define SECTION_SESSIONS 0 +#define SECTION_BOOKMARKS 1 +#define NUM_SECTIONS 2 @interface BookmarkListController (Private) #pragma mark misc functions -- (UIButton*)disclosureButtonWithImage:(UIImage*)image; -- (void)performSearch:(NSString*)searchText; +- (UIButton *)disclosureButtonWithImage:(UIImage *)image; +- (void)performSearch:(NSString *)searchText; #pragma mark Persisting bookmarks - (void)scheduleWriteBookmarksToDataStore; - (void)writeBookmarksToDataStore; - (void)scheduleWriteManualBookmarksToDataStore; - (void)writeManualBookmarksToDataStore; - (void)readManualBookmarksFromDataStore; -- (void)writeArray:(NSArray*)bookmarks toDataStoreURL:(NSURL*)url; -- (NSMutableArray*)arrayFromDataStoreURL:(NSURL*)url; -- (NSURL*)manualBookmarksDataStoreURL; -- (NSURL*)connectionHistoryDataStoreURL; +- (void)writeArray:(NSArray *)bookmarks toDataStoreURL:(NSURL *)url; +- (NSMutableArray *)arrayFromDataStoreURL:(NSURL *)url; +- (NSURL *)manualBookmarksDataStoreURL; +- (NSURL *)connectionHistoryDataStoreURL; @end - @implementation BookmarkListController -@synthesize searchBar = _searchBar, tableView = _tableView, bmTableCell = _bmTableCell, sessTableCell = _sessTableCell; +@synthesize searchBar = _searchBar, tableView = _tableView, bmTableCell = _bmTableCell, + sessTableCell = _sessTableCell; - // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) - { - // load bookmarks - [self readManualBookmarksFromDataStore]; +// The designated initializer. Override if you create the controller programmatically and want to +// perform customization that is not appropriate for viewDidLoad. +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) + { + // load bookmarks + [self readManualBookmarksFromDataStore]; + + // load connection history + [self readConnectionHistoryFromDataStore]; - // load connection history - [self readConnectionHistoryFromDataStore]; - // init search result array - _manual_search_result = nil; - - // register for session notifications - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sessionDisconnected:) name:TSXSessionDidDisconnectNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sessionFailedToConnect:) name:TSXSessionDidFailToConnectNotification object:nil]; - - // set title and tabbar controller image - [self setTitle:NSLocalizedString(@"Connections", @"'Connections': bookmark controller title")]; - [self setTabBarItem:[[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemBookmarks tag:0] autorelease]]; + _manual_search_result = nil; - // load images - _star_on_img = [[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"icon_accessory_star_on" ofType:@"png"]] retain]; - _star_off_img = [[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"icon_accessory_star_off" ofType:@"png"]] retain]; + // register for session notifications + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(sessionDisconnected:) + name:TSXSessionDidDisconnectNotification + object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(sessionFailedToConnect:) + name:TSXSessionDidFailToConnectNotification + object:nil]; - // init reachability detection - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reachabilityChanged:) name:kReachabilityChangedNotification object:nil]; - - // init other properties - _active_sessions = [[NSMutableArray alloc] init]; - _temporary_bookmark = nil; - } - return self; + // set title and tabbar controller image + [self setTitle:NSLocalizedString(@"Connections", + @"'Connections': bookmark controller title")]; + [self setTabBarItem:[[[UITabBarItem alloc] + initWithTabBarSystemItem:UITabBarSystemItemBookmarks + tag:0] autorelease]]; + + // load images + _star_on_img = [[UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"icon_accessory_star_on" + ofType:@"png"]] retain]; + _star_off_img = + [[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] + pathForResource:@"icon_accessory_star_off" + ofType:@"png"]] retain]; + + // init reachability detection + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(reachabilityChanged:) + name:kReachabilityChangedNotification + object:nil]; + + // init other properties + _active_sessions = [[NSMutableArray alloc] init]; + _temporary_bookmark = nil; + } + return self; } - (void)loadView { - [super loadView]; + [super loadView]; } // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad { - [super viewDidLoad]; - - // set edit button to allow bookmark list editing - [[self navigationItem] setRightBarButtonItem:[self editButtonItem]]; +- (void)viewDidLoad +{ + [super viewDidLoad]; + + // set edit button to allow bookmark list editing + [[self navigationItem] setRightBarButtonItem:[self editButtonItem]]; } - -- (void)viewWillAppear:(BOOL)animated +- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - - // in case we had a search - search again cause the bookmark searchable items could have changed - if ([[_searchBar text] length] > 0) - [self performSearch:[_searchBar text]]; - // to reflect any bookmark changes - reload table - [_tableView reloadData]; + // in case we had a search - search again cause the bookmark searchable items could have changed + if ([[_searchBar text] length] > 0) + [self performSearch:[_searchBar text]]; + + // to reflect any bookmark changes - reload table + [_tableView reloadData]; } - (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; - - // clear any search - [_searchBar setText:@""]; - [_searchBar resignFirstResponder]; - [self performSearch:@""]; + [super viewWillDisappear:animated]; + + // clear any search + [_searchBar setText:@""]; + [_searchBar resignFirstResponder]; + [self performSearch:@""]; } // Override to allow orientations other than the default portrait orientation. -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - // Return YES for supported orientations - return YES; -} - - -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -- (void)viewDidUnload { - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - - -- (void)dealloc +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [_temporary_bookmark release]; - [_connection_history release]; - [_active_sessions release]; - [_manual_search_result release]; - [_manual_bookmarks release]; - - [_star_on_img release]; - [_star_off_img release]; - - [super dealloc]; + // Return YES for supported orientations + return YES; } +- (void)didReceiveMemoryWarning +{ + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Release any cached data, images, etc that aren't in use. +} + +- (void)viewDidUnload +{ + [super viewDidUnload]; + // Release any retained subviews of the main view. + // e.g. self.myOutlet = nil; +} + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + [_temporary_bookmark release]; + [_connection_history release]; + [_active_sessions release]; + [_manual_search_result release]; + [_manual_bookmarks release]; + + [_star_on_img release]; + [_star_off_img release]; + + [super dealloc]; +} #pragma mark - #pragma mark Table view data source -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - // Return the number of sections. +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + // Return the number of sections. return NUM_SECTIONS; } -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - - switch(section) +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + + switch (section) { - case SECTION_SESSIONS: - return 0; - break; - + case SECTION_SESSIONS: + return 0; + break; + case SECTION_BOOKMARKS: - { - // (+1 for Add Bookmark entry) - if(_manual_search_result != nil) - return ([_manual_search_result count] + [_history_search_result count] + 1); - return ([_manual_bookmarks count] + 1); - } - break; - + { + // (+1 for Add Bookmark entry) + if (_manual_search_result != nil) + return ([_manual_search_result count] + [_history_search_result count] + 1); + return ([_manual_bookmarks count] + 1); + } + break; + default: break; } return 0; } -- (UITableViewCell*)cellForGenericListEntry +- (UITableViewCell *)cellForGenericListEntry { - static NSString *CellIdentifier = @"BookmarkListCell"; - UITableViewCell *cell = [[self tableView] dequeueReusableCellWithIdentifier:CellIdentifier]; - if(cell == nil) - { - cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; - [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; - [cell setAccessoryView:[self disclosureButtonWithImage:_star_off_img]]; - } + static NSString *CellIdentifier = @"BookmarkListCell"; + UITableViewCell *cell = [[self tableView] dequeueReusableCellWithIdentifier:CellIdentifier]; + if (cell == nil) + { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault + reuseIdentifier:CellIdentifier]; + [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; + [cell setAccessoryView:[self disclosureButtonWithImage:_star_off_img]]; + } - return cell; + return cell; } -- (BookmarkTableCell*)cellForBookmark +- (BookmarkTableCell *)cellForBookmark { - static NSString *BookmarkCellIdentifier = @"BookmarkCell"; - BookmarkTableCell *cell = (BookmarkTableCell*)[[self tableView] dequeueReusableCellWithIdentifier:BookmarkCellIdentifier]; - if(cell == nil) - { - [[NSBundle mainBundle] loadNibNamed:@"BookmarkTableViewCell" owner:self options:nil]; - [_bmTableCell setAccessoryView:[self disclosureButtonWithImage:_star_on_img]]; - cell = _bmTableCell; - _bmTableCell = nil; - } - - return cell; + static NSString *BookmarkCellIdentifier = @"BookmarkCell"; + BookmarkTableCell *cell = (BookmarkTableCell *)[[self tableView] + dequeueReusableCellWithIdentifier:BookmarkCellIdentifier]; + if (cell == nil) + { + [[NSBundle mainBundle] loadNibNamed:@"BookmarkTableViewCell" owner:self options:nil]; + [_bmTableCell setAccessoryView:[self disclosureButtonWithImage:_star_on_img]]; + cell = _bmTableCell; + _bmTableCell = nil; + } + + return cell; } // Customize the appearance of table view cells. -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - - - switch ([indexPath section]) - { - case SECTION_SESSIONS: - { - // get custom session cell - static NSString *SessionCellIdentifier = @"SessionCell"; - SessionTableCell *cell = (SessionTableCell*)[tableView dequeueReusableCellWithIdentifier:SessionCellIdentifier]; - if(cell == nil) - { - [[NSBundle mainBundle] loadNibNamed:@"SessionTableViewCell" owner:self options:nil]; - cell = _sessTableCell; - _sessTableCell = nil; - } - - // set cell data - RDPSession* session = [_active_sessions objectAtIndex:[indexPath row]]; - [[cell title] setText:[session sessionName]]; - [[cell server] setText:[[session params] StringForKey:@"hostname"]]; - [[cell username] setText:[[session params] StringForKey:@"username"]]; - [[cell screenshot] setImage:[session getScreenshotWithSize:[[cell screenshot] bounds].size]]; - [[cell disconnectButton] setTag:[indexPath row]]; - return cell; - } - - case SECTION_BOOKMARKS: - { - // special handling for first cell - quick connect/quick create Bookmark cell - if([indexPath row] == 0) - { - // if a search text is entered the cell becomes a quick connect/quick create bookmark cell - otherwise it's just an add bookmark cell - UITableViewCell* cell = [self cellForGenericListEntry]; - if ([[_searchBar text] length] == 0) - { - [[cell textLabel] setText:[@" " stringByAppendingString:NSLocalizedString(@"Add Connection", @"'Add Connection': button label")]]; - [((UIButton*)[cell accessoryView]) setHidden:YES]; - } - else - { - [[cell textLabel] setText:[@" " stringByAppendingString:[_searchBar text]]]; - [((UIButton*)[cell accessoryView]) setHidden:NO]; - } - - return cell; - } - else - { - // do we have a history cell or bookmark cell? - if ([self isIndexPathToHistoryItem:indexPath]) - { - UITableViewCell* cell = [self cellForGenericListEntry]; - [[cell textLabel] setText:[@" " stringByAppendingString:[_history_search_result objectAtIndex:[self historyIndexFromIndexPath:indexPath]]]]; - [((UIButton*)[cell accessoryView]) setHidden:NO]; - return cell; - } - else - { - // set cell properties - ComputerBookmark* entry; - BookmarkTableCell* cell = [self cellForBookmark]; - if(_manual_search_result == nil) - entry = [_manual_bookmarks objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]]; - else - entry = [[_manual_search_result objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]] valueForKey:@"bookmark"]; - - [[cell title] setText:[entry label]]; - [[cell subTitle] setText:[[entry params] StringForKey:@"hostname"]]; - return cell; - } - } - } - - default: - break; - } - - NSAssert(0, @"Failed to create cell"); - return nil; -} - - - -// Override to support conditional editing of the table view. -- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { - // dont allow to edit Add Bookmark item - if([indexPath section] == SECTION_SESSIONS) - return NO; - if([indexPath section] == SECTION_BOOKMARKS && [indexPath row] == 0) - return NO; - return YES; -} - - - - // Override to support editing the table view. - - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath { - if(editingStyle == UITableViewCellEditingStyleDelete) + + switch ([indexPath section]) { - // Delete the row from the data source - switch([indexPath section]) + case SECTION_SESSIONS: { - case SECTION_BOOKMARKS: - { - if (_manual_search_result == nil) - [_manual_bookmarks removeObjectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]]; - else - { - // history item or bookmark? - if ([self isIndexPathToHistoryItem:indexPath]) - { - [_connection_history removeObject:[_history_search_result objectAtIndex:[self historyIndexFromIndexPath:indexPath]]]; - [_history_search_result removeObjectAtIndex:[self historyIndexFromIndexPath:indexPath]]; - } - else - { - [_manual_bookmarks removeObject:[[_manual_search_result objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]] valueForKey:@"bookmark"]]; - [_manual_search_result removeObjectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]]; - } - } - [self scheduleWriteManualBookmarksToDataStore]; - break; - } + // get custom session cell + static NSString *SessionCellIdentifier = @"SessionCell"; + SessionTableCell *cell = (SessionTableCell *)[tableView + dequeueReusableCellWithIdentifier:SessionCellIdentifier]; + if (cell == nil) + { + [[NSBundle mainBundle] loadNibNamed:@"SessionTableViewCell" owner:self options:nil]; + cell = _sessTableCell; + _sessTableCell = nil; + } + + // set cell data + RDPSession *session = [_active_sessions objectAtIndex:[indexPath row]]; + [[cell title] setText:[session sessionName]]; + [[cell server] setText:[[session params] StringForKey:@"hostname"]]; + [[cell username] setText:[[session params] StringForKey:@"username"]]; + [[cell screenshot] + setImage:[session getScreenshotWithSize:[[cell screenshot] bounds].size]]; + [[cell disconnectButton] setTag:[indexPath row]]; + return cell; } - [tableView reloadSections:[NSIndexSet indexSetWithIndex:[indexPath section]] withRowAnimation:UITableViewRowAnimationNone]; - } + case SECTION_BOOKMARKS: + { + // special handling for first cell - quick connect/quick create Bookmark cell + if ([indexPath row] == 0) + { + // if a search text is entered the cell becomes a quick connect/quick create + // bookmark cell - otherwise it's just an add bookmark cell + UITableViewCell *cell = [self cellForGenericListEntry]; + if ([[_searchBar text] length] == 0) + { + [[cell textLabel] + setText:[@" " stringByAppendingString: + NSLocalizedString(@"Add Connection", + @"'Add Connection': button label")]]; + [((UIButton *)[cell accessoryView]) setHidden:YES]; + } + else + { + [[cell textLabel] setText:[@" " stringByAppendingString:[_searchBar text]]]; + [((UIButton *)[cell accessoryView]) setHidden:NO]; + } + + return cell; + } + else + { + // do we have a history cell or bookmark cell? + if ([self isIndexPathToHistoryItem:indexPath]) + { + UITableViewCell *cell = [self cellForGenericListEntry]; + [[cell textLabel] + setText:[@" " stringByAppendingString: + [_history_search_result + objectAtIndex: + [self historyIndexFromIndexPath:indexPath]]]]; + [((UIButton *)[cell accessoryView]) setHidden:NO]; + return cell; + } + else + { + // set cell properties + ComputerBookmark *entry; + BookmarkTableCell *cell = [self cellForBookmark]; + if (_manual_search_result == nil) + entry = [_manual_bookmarks + objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]]; + else + entry = [[_manual_search_result + objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]] + valueForKey:@"bookmark"]; + + [[cell title] setText:[entry label]]; + [[cell subTitle] setText:[[entry params] StringForKey:@"hostname"]]; + return cell; + } + } + } + + default: + break; + } + + NSAssert(0, @"Failed to create cell"); + return nil; } +// Override to support conditional editing of the table view. +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath +{ + // dont allow to edit Add Bookmark item + if ([indexPath section] == SECTION_SESSIONS) + return NO; + if ([indexPath section] == SECTION_BOOKMARKS && [indexPath row] == 0) + return NO; + return YES; +} + +// Override to support editing the table view. +- (void)tableView:(UITableView *)tableView + commitEditingStyle:(UITableViewCellEditingStyle)editingStyle + forRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (editingStyle == UITableViewCellEditingStyleDelete) + { + // Delete the row from the data source + switch ([indexPath section]) + { + case SECTION_BOOKMARKS: + { + if (_manual_search_result == nil) + [_manual_bookmarks + removeObjectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]]; + else + { + // history item or bookmark? + if ([self isIndexPathToHistoryItem:indexPath]) + { + [_connection_history + removeObject: + [_history_search_result + objectAtIndex:[self historyIndexFromIndexPath:indexPath]]]; + [_history_search_result + removeObjectAtIndex:[self historyIndexFromIndexPath:indexPath]]; + } + else + { + [_manual_bookmarks + removeObject: + [[_manual_search_result + objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]] + valueForKey:@"bookmark"]]; + [_manual_search_result + removeObjectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]]; + } + } + [self scheduleWriteManualBookmarksToDataStore]; + break; + } + } + + [tableView reloadSections:[NSIndexSet indexSetWithIndex:[indexPath section]] + withRowAnimation:UITableViewRowAnimationNone]; + } +} // Override to support rearranging the table view. -- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath +- (void)tableView:(UITableView *)tableView + moveRowAtIndexPath:(NSIndexPath *)fromIndexPath + toIndexPath:(NSIndexPath *)toIndexPath { - if([fromIndexPath compare:toIndexPath] != NSOrderedSame) + if ([fromIndexPath compare:toIndexPath] != NSOrderedSame) { - switch([fromIndexPath section]) + switch ([fromIndexPath section]) { - case SECTION_BOOKMARKS: - { - int fromIdx = [self bookmarkIndexFromIndexPath:fromIndexPath]; - int toIdx = [self bookmarkIndexFromIndexPath:toIndexPath]; - ComputerBookmark* temp_bookmark = [[_manual_bookmarks objectAtIndex:fromIdx] retain]; - [_manual_bookmarks removeObjectAtIndex:fromIdx]; - if (toIdx >= [_manual_bookmarks count]) - [_manual_bookmarks addObject:temp_bookmark]; - else - [_manual_bookmarks insertObject:temp_bookmark atIndex:toIdx]; - [temp_bookmark release]; - - [self scheduleWriteManualBookmarksToDataStore]; - break; - } + case SECTION_BOOKMARKS: + { + int fromIdx = [self bookmarkIndexFromIndexPath:fromIndexPath]; + int toIdx = [self bookmarkIndexFromIndexPath:toIndexPath]; + ComputerBookmark *temp_bookmark = + [[_manual_bookmarks objectAtIndex:fromIdx] retain]; + [_manual_bookmarks removeObjectAtIndex:fromIdx]; + if (toIdx >= [_manual_bookmarks count]) + [_manual_bookmarks addObject:temp_bookmark]; + else + [_manual_bookmarks insertObject:temp_bookmark atIndex:toIdx]; + [temp_bookmark release]; + + [self scheduleWriteManualBookmarksToDataStore]; + break; + } } } } - // prevent that an item is moved befoer the Add Bookmark item --(NSIndexPath*)tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath +- (NSIndexPath *)tableView:(UITableView *)tableView + targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath + toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath { - // don't allow to move: - // - items between sections - // - the quick connect/quick create bookmark cell - // - any item while a search is applied - if([proposedDestinationIndexPath row] == 0 || ([sourceIndexPath section] != [proposedDestinationIndexPath section]) || - _manual_search_result != nil) - { - return sourceIndexPath; - } - else - { - return proposedDestinationIndexPath; - } + // don't allow to move: + // - items between sections + // - the quick connect/quick create bookmark cell + // - any item while a search is applied + if ([proposedDestinationIndexPath row] == 0 || + ([sourceIndexPath section] != [proposedDestinationIndexPath section]) || + _manual_search_result != nil) + { + return sourceIndexPath; + } + else + { + return proposedDestinationIndexPath; + } } - // Override to support conditional rearranging of the table view. -- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { +- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath +{ // dont allow to reorder Add Bookmark item - if([indexPath section] == SECTION_BOOKMARKS && [indexPath row] == 0) + if ([indexPath section] == SECTION_BOOKMARKS && [indexPath row] == 0) return NO; - return YES; + return YES; } -- (NSString*)tableView:(UITableView*)tableView titleForHeaderInSection:(NSInteger)section +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { - if(section == SECTION_SESSIONS && [_active_sessions count] > 0) + if (section == SECTION_SESSIONS && [_active_sessions count] > 0) return NSLocalizedString(@"My Sessions", @"'My Session': section sessions header"); - if(section == SECTION_BOOKMARKS) - return NSLocalizedString(@"Manual Connections", @"'Manual Connections': section manual bookmarks header"); + if (section == SECTION_BOOKMARKS) + return NSLocalizedString(@"Manual Connections", + @"'Manual Connections': section manual bookmarks header"); return nil; } -- (NSString*)tableView:(UITableView*)tableView titleForFooterInSection:(NSInteger)section +- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section { return nil; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - if([indexPath section] == SECTION_SESSIONS) - return 72; - return [tableView rowHeight]; + if ([indexPath section] == SECTION_SESSIONS) + return 72; + return [tableView rowHeight]; } #pragma mark - @@ -423,141 +476,172 @@ - (void)setEditing:(BOOL)editing animated:(BOOL)animated { - [super setEditing:editing animated:animated]; - [[self tableView] setEditing:editing animated:animated]; + [super setEditing:editing animated:animated]; + [[self tableView] setEditing:editing animated:animated]; } -- (void)accessoryButtonTapped:(UIControl*)button withEvent:(UIEvent*)event +- (void)accessoryButtonTapped:(UIControl *)button withEvent:(UIEvent *)event { - // forward a tap on our custom accessory button to the real accessory button handler - NSIndexPath* indexPath = [[self tableView] indexPathForRowAtPoint:[[[event touchesForView:button] anyObject] locationInView:[self tableView]]]; - if (indexPath == nil) - return; - - [[[self tableView] delegate] tableView:[self tableView] accessoryButtonTappedForRowWithIndexPath:indexPath]; + // forward a tap on our custom accessory button to the real accessory button handler + NSIndexPath *indexPath = + [[self tableView] indexPathForRowAtPoint:[[[event touchesForView:button] anyObject] + locationInView:[self tableView]]]; + if (indexPath == nil) + return; + + [[[self tableView] delegate] tableView:[self tableView] + accessoryButtonTappedForRowWithIndexPath:indexPath]; } -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath -{ - if([indexPath section] == SECTION_SESSIONS) - { - // resume session - RDPSession* session = [_active_sessions objectAtIndex:[indexPath row]]; - UIViewController* ctrl = [[[RDPSessionViewController alloc] initWithNibName:@"RDPSessionView" bundle:nil session:session] autorelease]; - [ctrl setHidesBottomBarWhenPushed:YES]; - [[self navigationController] pushViewController:ctrl animated:YES]; - } +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + if ([indexPath section] == SECTION_SESSIONS) + { + // resume session + RDPSession *session = [_active_sessions objectAtIndex:[indexPath row]]; + UIViewController *ctrl = + [[[RDPSessionViewController alloc] initWithNibName:@"RDPSessionView" + bundle:nil + session:session] autorelease]; + [ctrl setHidesBottomBarWhenPushed:YES]; + [[self navigationController] pushViewController:ctrl animated:YES]; + } else { - ComputerBookmark* bookmark = nil; - if([indexPath section] == SECTION_BOOKMARKS) + ComputerBookmark *bookmark = nil; + if ([indexPath section] == SECTION_BOOKMARKS) { - // first row has either quick connect or add bookmark item - if([indexPath row] == 0) - { - if ([[_searchBar text] length] == 0) - { - // show add bookmark controller - ComputerBookmark *bookmark = [[[ComputerBookmark alloc] initWithBaseDefaultParameters] autorelease]; - BookmarkEditorController* bookmarkEditorController = [[[BookmarkEditorController alloc] initWithBookmark:bookmark] autorelease]; - [bookmarkEditorController setTitle:NSLocalizedString(@"Add Connection", @"Add Connection title")]; - [bookmarkEditorController setDelegate:self]; - [bookmarkEditorController setHidesBottomBarWhenPushed:YES]; - [[self navigationController] pushViewController:bookmarkEditorController animated:YES]; - } - else - { - // create a quick connect bookmark and add an entry to the quick connect history (if not already in the history) - bookmark = [self bookmarkForQuickConnectTo:[_searchBar text]]; - if (![_connection_history containsObject:[_searchBar text]]) - { - [_connection_history addObject:[_searchBar text]]; - [self scheduleWriteConnectionHistoryToDataStore]; - } - } - } - else - { - if(_manual_search_result != nil) - { - if ([self isIndexPathToHistoryItem:indexPath]) - { - // create a quick connect bookmark for a history item - NSString* item = [_history_search_result objectAtIndex:[self historyIndexFromIndexPath:indexPath]]; - bookmark = [self bookmarkForQuickConnectTo:item]; - } - else - bookmark = [[_manual_search_result objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]] valueForKey:@"bookmark"]; - } - else - bookmark = [_manual_bookmarks objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]]; // -1 because of ADD BOOKMARK entry - } - - // set reachability status - WakeUpWWAN(); - [bookmark setConntectedViaWLAN:[[Reachability reachabilityWithHostName:[[bookmark params] StringForKey:@"hostname"]] currentReachabilityStatus] == ReachableViaWiFi]; + // first row has either quick connect or add bookmark item + if ([indexPath row] == 0) + { + if ([[_searchBar text] length] == 0) + { + // show add bookmark controller + ComputerBookmark *bookmark = + [[[ComputerBookmark alloc] initWithBaseDefaultParameters] autorelease]; + BookmarkEditorController *bookmarkEditorController = + [[[BookmarkEditorController alloc] initWithBookmark:bookmark] autorelease]; + [bookmarkEditorController + setTitle:NSLocalizedString(@"Add Connection", @"Add Connection title")]; + [bookmarkEditorController setDelegate:self]; + [bookmarkEditorController setHidesBottomBarWhenPushed:YES]; + [[self navigationController] pushViewController:bookmarkEditorController + animated:YES]; + } + else + { + // create a quick connect bookmark and add an entry to the quick connect history + // (if not already in the history) + bookmark = [self bookmarkForQuickConnectTo:[_searchBar text]]; + if (![_connection_history containsObject:[_searchBar text]]) + { + [_connection_history addObject:[_searchBar text]]; + [self scheduleWriteConnectionHistoryToDataStore]; + } + } + } + else + { + if (_manual_search_result != nil) + { + if ([self isIndexPathToHistoryItem:indexPath]) + { + // create a quick connect bookmark for a history item + NSString *item = [_history_search_result + objectAtIndex:[self historyIndexFromIndexPath:indexPath]]; + bookmark = [self bookmarkForQuickConnectTo:item]; + } + else + bookmark = [[_manual_search_result + objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]] + valueForKey:@"bookmark"]; + } + else + bookmark = [_manual_bookmarks + objectAtIndex:[self bookmarkIndexFromIndexPath: + indexPath]]; // -1 because of ADD BOOKMARK entry + } + + // set reachability status + WakeUpWWAN(); + [bookmark + setConntectedViaWLAN:[[Reachability + reachabilityWithHostName:[[bookmark params] + StringForKey:@"hostname"]] + currentReachabilityStatus] == ReachableViaWiFi]; } - - if(bookmark != nil) - { + + if (bookmark != nil) + { // create rdp session - RDPSession* session = [[[RDPSession alloc] initWithBookmark:bookmark] autorelease]; - UIViewController* ctrl = [[[RDPSessionViewController alloc] initWithNibName:@"RDPSessionView" bundle:nil session:session] autorelease]; - [ctrl setHidesBottomBarWhenPushed:YES]; - [[self navigationController] pushViewController:ctrl animated:YES]; - [_active_sessions addObject:session]; - } + RDPSession *session = [[[RDPSession alloc] initWithBookmark:bookmark] autorelease]; + UIViewController *ctrl = + [[[RDPSessionViewController alloc] initWithNibName:@"RDPSessionView" + bundle:nil + session:session] autorelease]; + [ctrl setHidesBottomBarWhenPushed:YES]; + [[self navigationController] pushViewController:ctrl animated:YES]; + [_active_sessions addObject:session]; + } } } - -- (void)tableView:(UITableView*)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath*)indexPath -{ +- (void)tableView:(UITableView *)tableView + accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath +{ // get the bookmark - NSString* bookmark_editor_title = NSLocalizedString(@"Edit Connection", @"Edit Connection title"); - ComputerBookmark* bookmark = nil; + NSString *bookmark_editor_title = + NSLocalizedString(@"Edit Connection", @"Edit Connection title"); + ComputerBookmark *bookmark = nil; if ([indexPath section] == SECTION_BOOKMARKS) { - if ([indexPath row] == 0) - { - // create a new bookmark and init hostname and label - bookmark = [self bookmarkForQuickConnectTo:[_searchBar text]]; - bookmark_editor_title = NSLocalizedString(@"Add Connection", @"Add Connection title"); - } - else - { - if (_manual_search_result != nil) - { - if ([self isIndexPathToHistoryItem:indexPath]) - { - // create a new bookmark and init hostname and label - NSString* item = [_history_search_result objectAtIndex:[self historyIndexFromIndexPath:indexPath]]; - bookmark = [self bookmarkForQuickConnectTo:item]; - bookmark_editor_title = NSLocalizedString(@"Add Connection", @"Add Connection title"); - } - else - bookmark = [[_manual_search_result objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]] valueForKey:@"bookmark"]; - } - else - bookmark = [_manual_bookmarks objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]]; // -1 because of ADD BOOKMARK entry - } + if ([indexPath row] == 0) + { + // create a new bookmark and init hostname and label + bookmark = [self bookmarkForQuickConnectTo:[_searchBar text]]; + bookmark_editor_title = NSLocalizedString(@"Add Connection", @"Add Connection title"); + } + else + { + if (_manual_search_result != nil) + { + if ([self isIndexPathToHistoryItem:indexPath]) + { + // create a new bookmark and init hostname and label + NSString *item = [_history_search_result + objectAtIndex:[self historyIndexFromIndexPath:indexPath]]; + bookmark = [self bookmarkForQuickConnectTo:item]; + bookmark_editor_title = + NSLocalizedString(@"Add Connection", @"Add Connection title"); + } + else + bookmark = [[_manual_search_result + objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]] + valueForKey:@"bookmark"]; + } + else + bookmark = [_manual_bookmarks + objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]]; // -1 because of ADD + // BOOKMARK entry + } } - // bookmark found? - start the editor + // bookmark found? - start the editor if (bookmark != nil) { - BookmarkEditorController* editBookmarkController = [[[BookmarkEditorController alloc] initWithBookmark:bookmark] autorelease]; - [editBookmarkController setHidesBottomBarWhenPushed:YES]; - [editBookmarkController setTitle:bookmark_editor_title]; - [editBookmarkController setDelegate:self]; - [[self navigationController] pushViewController:editBookmarkController animated:YES]; + BookmarkEditorController *editBookmarkController = + [[[BookmarkEditorController alloc] initWithBookmark:bookmark] autorelease]; + [editBookmarkController setHidesBottomBarWhenPushed:YES]; + [editBookmarkController setTitle:bookmark_editor_title]; + [editBookmarkController setDelegate:self]; + [[self navigationController] pushViewController:editBookmarkController animated:YES]; } } #pragma mark - #pragma mark Search Bar Delegates -- (BOOL)searchBarShouldBeginEditing:(UISearchBar*)searchBar +- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar { // show cancel button [searchBar setShowsCancelButton:YES animated:YES]; @@ -569,19 +653,19 @@ // clear search result [_manual_search_result release]; _manual_search_result = nil; - + // clear text and remove cancel button [searchBar setText:@""]; [searchBar resignFirstResponder]; } -- (BOOL)searchBarShouldEndEditing:(UISearchBar*)searchBar -{ +- (BOOL)searchBarShouldEndEditing:(UISearchBar *)searchBar +{ [searchBar setShowsCancelButton:NO animated:YES]; - + // re-enable table selection [_tableView setAllowsSelection:YES]; - + return YES; } @@ -590,163 +674,183 @@ [_searchBar resignFirstResponder]; } -- (void)searchBar:(UISearchBar*)searchBar textDidChange:(NSString*)searchText +- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText { - [self performSearch:searchText]; + [self performSearch:searchText]; [_tableView reloadData]; } #pragma mark - Session handling // session was added -- (void)sessionDisconnected:(NSNotification*)notification +- (void)sessionDisconnected:(NSNotification *)notification { - // remove session from active sessions - RDPSession* session = (RDPSession*)[notification object]; - [_active_sessions removeObject:session]; + // remove session from active sessions + RDPSession *session = (RDPSession *)[notification object]; + [_active_sessions removeObject:session]; - // if this view is currently active refresh entries - if([[self navigationController] visibleViewController] == self) - [_tableView reloadSections:[NSIndexSet indexSetWithIndex:SECTION_SESSIONS] withRowAnimation:UITableViewRowAnimationNone]; - - // if session's bookmark is not in the bookmark list ask the user if he wants to add it - // (this happens if the session is created using the quick connect feature) - if (![_manual_bookmarks containsObject:[session bookmark]]) - { - // retain the bookmark in case we want to save it later - _temporary_bookmark = [[session bookmark] retain]; - - // ask the user if he wants to save the bookmark - NSString* title = NSLocalizedString(@"Save Connection Settings?", @"Save connection settings title"); - NSString* message = NSLocalizedString(@"Your Connection Settings have not been saved. Do you want to save them?", @"Save connection settings message"); - BlockAlertView* alert = [BlockAlertView alertWithTitle:title message:message]; - [alert setCancelButtonWithTitle:NSLocalizedString(@"No", @"No Button") block:nil]; - [alert addButtonWithTitle:NSLocalizedString(@"Yes", @"Yes Button") block:^{ - if (_temporary_bookmark) - { - [_manual_bookmarks addObject:_temporary_bookmark]; - [_tableView reloadSections:[NSIndexSet indexSetWithIndex:SECTION_BOOKMARKS] withRowAnimation:UITableViewRowAnimationNone]; - [_temporary_bookmark autorelease]; - _temporary_bookmark = nil; - } - }]; - [alert show]; - } + // if this view is currently active refresh entries + if ([[self navigationController] visibleViewController] == self) + [_tableView reloadSections:[NSIndexSet indexSetWithIndex:SECTION_SESSIONS] + withRowAnimation:UITableViewRowAnimationNone]; + + // if session's bookmark is not in the bookmark list ask the user if he wants to add it + // (this happens if the session is created using the quick connect feature) + if (![_manual_bookmarks containsObject:[session bookmark]]) + { + // retain the bookmark in case we want to save it later + _temporary_bookmark = [[session bookmark] retain]; + + // ask the user if he wants to save the bookmark + NSString *title = + NSLocalizedString(@"Save Connection Settings?", @"Save connection settings title"); + NSString *message = NSLocalizedString( + @"Your Connection Settings have not been saved. Do you want to save them?", + @"Save connection settings message"); + BlockAlertView *alert = [BlockAlertView alertWithTitle:title message:message]; + [alert setCancelButtonWithTitle:NSLocalizedString(@"No", @"No Button") block:nil]; + [alert addButtonWithTitle:NSLocalizedString(@"Yes", @"Yes Button") + block:^{ + if (_temporary_bookmark) + { + [_manual_bookmarks addObject:_temporary_bookmark]; + [_tableView + reloadSections:[NSIndexSet + indexSetWithIndex:SECTION_BOOKMARKS] + withRowAnimation:UITableViewRowAnimationNone]; + [_temporary_bookmark autorelease]; + _temporary_bookmark = nil; + } + }]; + [alert show]; + } } -- (void)sessionFailedToConnect:(NSNotification*)notification +- (void)sessionFailedToConnect:(NSNotification *)notification { - // remove session from active sessions - RDPSession* session = (RDPSession*)[notification object]; - [_active_sessions removeObject:session]; - - // display error toast - [[self view] makeToast:NSLocalizedString(@"Failed to connect to session!", @"Failed to connect error message") duration:ToastDurationNormal position:@"center"]; + // remove session from active sessions + RDPSession *session = (RDPSession *)[notification object]; + [_active_sessions removeObject:session]; + + // display error toast + [[self view] makeToast:NSLocalizedString(@"Failed to connect to session!", + @"Failed to connect error message") + duration:ToastDurationNormal + position:@"center"]; } #pragma mark - Reachability notification -- (void)reachabilityChanged:(NSNotification*)notification +- (void)reachabilityChanged:(NSNotification *)notification { - // no matter how the network changed - we will disconnect - // disconnect session (if there is any) - if ([_active_sessions count] > 0) - { - RDPSession* session = [_active_sessions objectAtIndex:0]; - [session disconnect]; - } + // no matter how the network changed - we will disconnect + // disconnect session (if there is any) + if ([_active_sessions count] > 0) + { + RDPSession *session = [_active_sessions objectAtIndex:0]; + [session disconnect]; + } } #pragma mark - BookmarkEditorController delegate - (void)commitBookmark:(ComputerBookmark *)bookmark { - // if we got a manual bookmark that is not in the list yet - add it otherwise replace it - BOOL found = NO; - for (int idx = 0; idx < [_manual_bookmarks count]; ++idx) - { - if ([[bookmark uuid] isEqualToString:[[_manual_bookmarks objectAtIndex:idx] uuid]]) - { - [_manual_bookmarks replaceObjectAtIndex:idx withObject:bookmark]; - found = YES; - break; - } - } - if (!found) - [_manual_bookmarks addObject:bookmark]; - - // remove any quick connect history entry with the same hostname - NSString* hostname = [[bookmark params] StringForKey:@"hostname"]; - if ([_connection_history containsObject:hostname]) - { - [_connection_history removeObject:hostname]; - [self scheduleWriteConnectionHistoryToDataStore]; - } - - [self scheduleWriteManualBookmarksToDataStore]; + // if we got a manual bookmark that is not in the list yet - add it otherwise replace it + BOOL found = NO; + for (int idx = 0; idx < [_manual_bookmarks count]; ++idx) + { + if ([[bookmark uuid] isEqualToString:[[_manual_bookmarks objectAtIndex:idx] uuid]]) + { + [_manual_bookmarks replaceObjectAtIndex:idx withObject:bookmark]; + found = YES; + break; + } + } + if (!found) + [_manual_bookmarks addObject:bookmark]; + + // remove any quick connect history entry with the same hostname + NSString *hostname = [[bookmark params] StringForKey:@"hostname"]; + if ([_connection_history containsObject:hostname]) + { + [_connection_history removeObject:hostname]; + [self scheduleWriteConnectionHistoryToDataStore]; + } + + [self scheduleWriteManualBookmarksToDataStore]; } - (IBAction)disconnectButtonPressed:(id)sender { - // disconnect session and refresh table view - RDPSession* session = [_active_sessions objectAtIndex:[sender tag]]; - [session disconnect]; + // disconnect session and refresh table view + RDPSession *session = [_active_sessions objectAtIndex:[sender tag]]; + [session disconnect]; } #pragma mark - Misc functions - (BOOL)hasNoBookmarks { - return ([_manual_bookmarks count] == 0); + return ([_manual_bookmarks count] == 0); } -- (UIButton*)disclosureButtonWithImage:(UIImage*)image +- (UIButton *)disclosureButtonWithImage:(UIImage *)image { - // we make the button a little bit bigger (image widht * 2, height + 10) so that the user doesn't accidentally connect to the bookmark ... - UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom]; - [button setFrame:CGRectMake(0, 0, [image size].width * 2, [image size].height + 10)]; - [button setImage:image forState:UIControlStateNormal]; - [button addTarget:self action:@selector(accessoryButtonTapped:withEvent:) forControlEvents:UIControlEventTouchUpInside]; - [button setUserInteractionEnabled:YES]; - return button; + // we make the button a little bit bigger (image widht * 2, height + 10) so that the user + // doesn't accidentally connect to the bookmark ... + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; + [button setFrame:CGRectMake(0, 0, [image size].width * 2, [image size].height + 10)]; + [button setImage:image forState:UIControlStateNormal]; + [button addTarget:self + action:@selector(accessoryButtonTapped:withEvent:) + forControlEvents:UIControlEventTouchUpInside]; + [button setUserInteractionEnabled:YES]; + return button; } -- (void)performSearch:(NSString*)searchText +- (void)performSearch:(NSString *)searchText { - [_manual_search_result autorelease]; - - if([searchText length] > 0) + [_manual_search_result autorelease]; + + if ([searchText length] > 0) { - _manual_search_result = [FilterBookmarks(_manual_bookmarks, [searchText componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]) retain]; - _history_search_result = [FilterHistory(_connection_history, searchText) retain]; - } + _manual_search_result = [FilterBookmarks( + _manual_bookmarks, + [searchText componentsSeparatedByCharactersInSet:[NSCharacterSet + whitespaceAndNewlineCharacterSet]]) + retain]; + _history_search_result = [FilterHistory(_connection_history, searchText) retain]; + } else { - _history_search_result = nil; + _history_search_result = nil; _manual_search_result = nil; - } + } } -- (int)bookmarkIndexFromIndexPath:(NSIndexPath*)indexPath +- (int)bookmarkIndexFromIndexPath:(NSIndexPath *)indexPath { - return [indexPath row] - ((_history_search_result != nil) ? [_history_search_result count] : 0) - 1; + return [indexPath row] - + ((_history_search_result != nil) ? [_history_search_result count] : 0) - 1; } -- (int)historyIndexFromIndexPath:(NSIndexPath*)indexPath +- (int)historyIndexFromIndexPath:(NSIndexPath *)indexPath { - return [indexPath row] - 1; + return [indexPath row] - 1; } -- (BOOL)isIndexPathToHistoryItem:(NSIndexPath*)indexPath +- (BOOL)isIndexPathToHistoryItem:(NSIndexPath *)indexPath { - return (([indexPath row] - 1) < [_history_search_result count]); + return (([indexPath row] - 1) < [_history_search_result count]); } -- (ComputerBookmark*)bookmarkForQuickConnectTo:(NSString*)host +- (ComputerBookmark *)bookmarkForQuickConnectTo:(NSString *)host { - ComputerBookmark* bookmark = [[[ComputerBookmark alloc] initWithBaseDefaultParameters] autorelease]; - [bookmark setLabel:host]; - [[bookmark params] setValue:host forKey:@"hostname"]; - return bookmark; + ComputerBookmark *bookmark = + [[[ComputerBookmark alloc] initWithBaseDefaultParameters] autorelease]; + [bookmark setLabel:host]; + [[bookmark params] setValue:host forKey:@"hostname"]; + return bookmark; } #pragma mark - Persisting bookmarks @@ -759,76 +863,95 @@ } - (void)writeBookmarksToDataStore -{ - [self writeManualBookmarksToDataStore]; +{ + [self writeManualBookmarksToDataStore]; } - (void)scheduleWriteManualBookmarksToDataStore { - [[NSOperationQueue mainQueue] addOperation:[[[NSInvocationOperation alloc] initWithTarget:self selector:@selector(writeManualBookmarksToDataStore) object:nil] autorelease]]; + [[NSOperationQueue mainQueue] + addOperation:[[[NSInvocationOperation alloc] + initWithTarget:self + selector:@selector(writeManualBookmarksToDataStore) + object:nil] autorelease]]; } - (void)writeManualBookmarksToDataStore -{ - [self writeArray:_manual_bookmarks toDataStoreURL:[self manualBookmarksDataStoreURL]]; +{ + [self writeArray:_manual_bookmarks toDataStoreURL:[self manualBookmarksDataStoreURL]]; } - (void)scheduleWriteConnectionHistoryToDataStore { - [[NSOperationQueue mainQueue] addOperation:[[[NSInvocationOperation alloc] initWithTarget:self selector:@selector(writeConnectionHistoryToDataStore) object:nil] autorelease]]; + [[NSOperationQueue mainQueue] + addOperation:[[[NSInvocationOperation alloc] + initWithTarget:self + selector:@selector(writeConnectionHistoryToDataStore) + object:nil] autorelease]]; } - (void)writeConnectionHistoryToDataStore -{ - [self writeArray:_connection_history toDataStoreURL:[self connectionHistoryDataStoreURL]]; +{ + [self writeArray:_connection_history toDataStoreURL:[self connectionHistoryDataStoreURL]]; } -- (void)writeArray:(NSArray*)bookmarks toDataStoreURL:(NSURL*)url +- (void)writeArray:(NSArray *)bookmarks toDataStoreURL:(NSURL *)url { - NSData* archived_data = [NSKeyedArchiver archivedDataWithRootObject:bookmarks]; - [archived_data writeToURL:url atomically:YES]; + NSData *archived_data = [NSKeyedArchiver archivedDataWithRootObject:bookmarks]; + [archived_data writeToURL:url atomically:YES]; } - (void)readManualBookmarksFromDataStore { - [_manual_bookmarks autorelease]; - _manual_bookmarks = [self arrayFromDataStoreURL:[self manualBookmarksDataStoreURL]]; + [_manual_bookmarks autorelease]; + _manual_bookmarks = [self arrayFromDataStoreURL:[self manualBookmarksDataStoreURL]]; - if(_manual_bookmarks == nil) - { - _manual_bookmarks = [[NSMutableArray alloc] init]; - [_manual_bookmarks addObject:[[[GlobalDefaults sharedGlobalDefaults] newTestServerBookmark] autorelease]]; - } + if (_manual_bookmarks == nil) + { + _manual_bookmarks = [[NSMutableArray alloc] init]; + [_manual_bookmarks + addObject:[[[GlobalDefaults sharedGlobalDefaults] newTestServerBookmark] autorelease]]; + } } - (void)readConnectionHistoryFromDataStore { - [_connection_history autorelease]; - _connection_history = [self arrayFromDataStoreURL:[self connectionHistoryDataStoreURL]]; - - if(_connection_history == nil) - _connection_history = [[NSMutableArray alloc] init]; + [_connection_history autorelease]; + _connection_history = [self arrayFromDataStoreURL:[self connectionHistoryDataStoreURL]]; + + if (_connection_history == nil) + _connection_history = [[NSMutableArray alloc] init]; } -- (NSMutableArray*)arrayFromDataStoreURL:(NSURL*)url +- (NSMutableArray *)arrayFromDataStoreURL:(NSURL *)url { - NSData* archived_data = [NSData dataWithContentsOfURL:url]; - + NSData *archived_data = [NSData dataWithContentsOfURL:url]; + if (!archived_data) return nil; - + return [[NSKeyedUnarchiver unarchiveObjectWithData:archived_data] retain]; } -- (NSURL*)manualBookmarksDataStoreURL +- (NSURL *)manualBookmarksDataStoreURL { - return [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/%@", [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject], @"com.freerdp.ifreerdp.bookmarks.plist"]]; + return [NSURL + fileURLWithPath:[NSString stringWithFormat:@"%@/%@", + [NSSearchPathForDirectoriesInDomains( + NSDocumentDirectory, NSUserDomainMask, YES) + lastObject], + @"com.freerdp.ifreerdp.bookmarks.plist"]]; } -- (NSURL*)connectionHistoryDataStoreURL +- (NSURL *)connectionHistoryDataStoreURL { - return [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/%@", [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject], @"com.freerdp.ifreerdp.connection_history.plist"]]; + return [NSURL + fileURLWithPath:[NSString + stringWithFormat:@"%@/%@", + [NSSearchPathForDirectoriesInDomains( + NSDocumentDirectory, NSUserDomainMask, YES) + lastObject], + @"com.freerdp.ifreerdp.connection_history.plist"]]; } @end - diff --git a/client/iOS/Controllers/CredentialsEditorController.h b/client/iOS/Controllers/CredentialsEditorController.h index 7fc5e2f42..4dc12c3ef 100644 --- a/client/iOS/Controllers/CredentialsEditorController.h +++ b/client/iOS/Controllers/CredentialsEditorController.h @@ -1,10 +1,11 @@ /* Controller to edit bookmark credentials - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "EditorBaseController.h" @@ -14,12 +15,12 @@ @interface CredentialsEditorController : EditorBaseController { -@private - ComputerBookmark* _bookmark; - ConnectionParams* _params; + @private + ComputerBookmark *_bookmark; + ConnectionParams *_params; } // init for the given bookmark -- (id)initWithBookmark:(ComputerBookmark*)bookmark; +- (id)initWithBookmark:(ComputerBookmark *)bookmark; @end diff --git a/client/iOS/Controllers/CredentialsEditorController.m b/client/iOS/Controllers/CredentialsEditorController.m index 365da4cd4..4dbea53bc 100644 --- a/client/iOS/Controllers/CredentialsEditorController.m +++ b/client/iOS/Controllers/CredentialsEditorController.m @@ -1,10 +1,11 @@ /* Controller to edit bookmark credentials - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "CredentialsEditorController.h" @@ -20,59 +21,60 @@ @implementation CredentialsEditorController -- (id)initWithBookmark:(ComputerBookmark*)bookmark +- (id)initWithBookmark:(ComputerBookmark *)bookmark { - if ((self = [super initWithStyle:UITableViewStyleGrouped])) + if ((self = [super initWithStyle:UITableViewStyleGrouped])) { // set additional settings state according to bookmark data _bookmark = [bookmark retain]; - _params = [bookmark params]; - } - return self; + _params = [bookmark params]; + } + return self; } - (void)viewDidLoad { - [super viewDidLoad]; - [self setTitle:NSLocalizedString(@"Credentials", @"Credentials title")]; + [super viewDidLoad]; + [self setTitle:NSLocalizedString(@"Credentials", @"Credentials title")]; } - (void)viewDidUnload { - [super viewDidUnload]; - // Release any retained subviews of the main view. + [super viewDidUnload]; + // Release any retained subviews of the main view. } - (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; - - // foce any active editing to stop - [[self view] endEditing:NO]; + [super viewWillDisappear:animated]; + + // foce any active editing to stop + [[self view] endEditing:NO]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return YES; + return YES; } - (void)dealloc { - [super dealloc]; - [_bookmark release]; + [super dealloc]; + [_bookmark release]; } #pragma mark - #pragma mark Table view data source -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - // Return the number of sections. - return SECTION_COUNT; +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + // Return the number of sections. + return SECTION_COUNT; } - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - // Return the number of rows in the section. +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + // Return the number of rows in the section. switch (section) { case SECTION_CREDENTIALS: // credentials @@ -80,15 +82,14 @@ default: break; } - - return 0; -} + return 0; +} // set section headers - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { - switch(section) + switch (section) { case SECTION_CREDENTIALS: return NSLocalizedString(@"Credentials", @"'Credentials': credentials settings header"); @@ -96,88 +97,93 @@ return @"unknown"; } - // Customize the appearance of table view cells. -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + // determine the required cell type - NSString* cellType = nil; - switch([indexPath section]) + NSString *cellType = nil; + switch ([indexPath section]) { case SECTION_CREDENTIALS: // credentials - if([indexPath row] == 1) - cellType = TableCellIdentifierSecretText; // password field - else - cellType = TableCellIdentifierText; + if ([indexPath row] == 1) + cellType = TableCellIdentifierSecretText; // password field + else + cellType = TableCellIdentifierText; break; - - default: - break; - } - NSAssert(cellType != nil, @"Couldn't determine cell type"); - - // get the table view cell - UITableViewCell *cell = [self tableViewCellFromIdentifier:cellType]; - NSAssert(cell, @"Invalid cell"); - - // set cell values - switch([indexPath section]) - { - // credentials - case SECTION_CREDENTIALS: - [self initCredentialSettings:indexPath cell:cell]; - break; - + default: break; - } - - return cell; + } + NSAssert(cellType != nil, @"Couldn't determine cell type"); + + // get the table view cell + UITableViewCell *cell = [self tableViewCellFromIdentifier:cellType]; + NSAssert(cell, @"Invalid cell"); + + // set cell values + switch ([indexPath section]) + { + // credentials + case SECTION_CREDENTIALS: + [self initCredentialSettings:indexPath cell:cell]; + break; + + default: + break; + } + + return cell; } - // updates credentials in the UI -- (void)initCredentialSettings:(NSIndexPath*)indexPath cell:(UITableViewCell*)cell +- (void)initCredentialSettings:(NSIndexPath *)indexPath cell:(UITableViewCell *)cell { - switch(indexPath.row) + switch (indexPath.row) { case 0: - { - EditTextTableViewCell* textCell = (EditTextTableViewCell*)cell; - [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; - [[textCell label] setText:NSLocalizedString(@"Username", @"'Username': Bookmark username")]; + { + EditTextTableViewCell *textCell = (EditTextTableViewCell *)cell; + [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[textCell label] + setText:NSLocalizedString(@"Username", @"'Username': Bookmark username")]; [[textCell textfield] setText:[_params StringForKey:@"username"]]; - [[textCell textfield] setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; - break; - } - case 1: - { - EditSecretTextTableViewCell* textCell = (EditSecretTextTableViewCell*)cell; - [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; - [[textCell label] setText:NSLocalizedString(@"Password", @"'Password': Bookmark password")]; - [[textCell textfield] setText:[_params StringForKey:@"password"]]; - [[textCell textfield] setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; break; - } + } + case 1: + { + EditSecretTextTableViewCell *textCell = (EditSecretTextTableViewCell *)cell; + [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[textCell label] + setText:NSLocalizedString(@"Password", @"'Password': Bookmark password")]; + [[textCell textfield] setText:[_params StringForKey:@"password"]]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + break; + } case 2: - { - EditTextTableViewCell* textCell = (EditTextTableViewCell*)cell; - [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; + { + EditTextTableViewCell *textCell = (EditTextTableViewCell *)cell; + [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; [[textCell label] setText:NSLocalizedString(@"Domain", @"'Domain': Bookmark domain")]; [[textCell textfield] setText:[_params StringForKey:@"domain"]]; - [[textCell textfield] setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; - break; - } + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + break; + } default: NSLog(@"Invalid row index in settings table!"); break; - } + } } #pragma mark - #pragma mark Text Field delegate -- (BOOL)textFieldShouldReturn:(UITextField*)textField +- (BOOL)textFieldShouldReturn:(UITextField *)textField { [textField resignFirstResponder]; return NO; @@ -185,13 +191,13 @@ - (BOOL)textFieldShouldEndEditing:(UITextField *)textField { - switch(textField.tag) - { - // update credentials settings + switch (textField.tag) + { + // update credentials settings case GET_TAG(SECTION_CREDENTIALS, 0): [_params setValue:[textField text] forKey:@"username"]; break; - + case GET_TAG(SECTION_CREDENTIALS, 1): [_params setValue:[textField text] forKey:@"password"]; break; @@ -199,7 +205,7 @@ case GET_TAG(SECTION_CREDENTIALS, 2): [_params setValue:[textField text] forKey:@"domain"]; break; - + default: break; } diff --git a/client/iOS/Controllers/CredentialsInputController.h b/client/iOS/Controllers/CredentialsInputController.h index 9a4c5e204..9bfbda549 100644 --- a/client/iOS/Controllers/CredentialsInputController.h +++ b/client/iOS/Controllers/CredentialsInputController.h @@ -1,10 +1,11 @@ /* Credentials input controller - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @@ -13,19 +14,22 @@ @interface CredentialsInputController : UIViewController { -@private - IBOutlet UITextField* _textfield_username; - IBOutlet UITextField* _textfield_password; - IBOutlet UITextField* _textfield_domain; - IBOutlet UIButton* _btn_login; - IBOutlet UIButton* _btn_cancel; - IBOutlet UIScrollView* _scroll_view; - IBOutlet UILabel* _lbl_message; - - RDPSession* _session; - NSMutableDictionary* _params; + @private + IBOutlet UITextField *_textfield_username; + IBOutlet UITextField *_textfield_password; + IBOutlet UITextField *_textfield_domain; + IBOutlet UIButton *_btn_login; + IBOutlet UIButton *_btn_cancel; + IBOutlet UIScrollView *_scroll_view; + IBOutlet UILabel *_lbl_message; + + RDPSession *_session; + NSMutableDictionary *_params; } -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil session:(RDPSession*)session params:(NSMutableDictionary*)params; +- (id)initWithNibName:(NSString *)nibNameOrNil + bundle:(NSBundle *)nibBundleOrNil + session:(RDPSession *)session + params:(NSMutableDictionary *)params; @end diff --git a/client/iOS/Controllers/CredentialsInputController.m b/client/iOS/Controllers/CredentialsInputController.m index c48f616a1..fed6c727c 100644 --- a/client/iOS/Controllers/CredentialsInputController.m +++ b/client/iOS/Controllers/CredentialsInputController.m @@ -1,10 +1,11 @@ /* Credentials input controller - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "CredentialsInputController.h" @@ -13,121 +14,147 @@ @implementation CredentialsInputController -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil session:(RDPSession *)session params:(NSMutableDictionary *)params +- (id)initWithNibName:(NSString *)nibNameOrNil + bundle:(NSBundle *)nibBundleOrNil + session:(RDPSession *)session + params:(NSMutableDictionary *)params { - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - _session = session; - _params = params; - [self setModalPresentationStyle:UIModalPresentationFormSheet]; + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) + { + _session = session; + _params = params; + [self setModalPresentationStyle:UIModalPresentationFormSheet]; - // on iphone we have the problem that the buttons are hidden by the keyboard - // we solve this issue by registering keyboard notification handlers and adjusting the scrollview accordingly - if (IsPhone()) - { - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name: UIKeyboardWillShowNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name: UIKeyboardWillHideNotification object:nil]; - } - } - return self; + // on iphone we have the problem that the buttons are hidden by the keyboard + // we solve this issue by registering keyboard notification handlers and adjusting the + // scrollview accordingly + if (IsPhone()) + { + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardWillShow:) + name:UIKeyboardWillShowNotification + object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardWillHide:) + name:UIKeyboardWillHideNotification + object:nil]; + } + } + return self; } - (void)viewDidLoad { - [super viewDidLoad]; + [super viewDidLoad]; - // set localized strings - [_lbl_message setText:NSLocalizedString(@"Please provide the missing user information in order to proceed and login.", @"Credentials input view message")]; - [_textfield_username setPlaceholder:NSLocalizedString(@"Username", @"Credentials Input Username hint")]; - [_textfield_password setPlaceholder:NSLocalizedString(@"Password", @"Credentials Input Password hint")]; - [_textfield_domain setPlaceholder:NSLocalizedString(@"Domain", @"Credentials Input Domain hint")]; - [_btn_login setTitle:NSLocalizedString(@"Login", @"Login Button") forState:UIControlStateNormal]; - [_btn_cancel setTitle:NSLocalizedString(@"Cancel", @"Cancel Button") forState:UIControlStateNormal]; + // set localized strings + [_lbl_message + setText:NSLocalizedString( + @"Please provide the missing user information in order to proceed and login.", + @"Credentials input view message")]; + [_textfield_username + setPlaceholder:NSLocalizedString(@"Username", @"Credentials Input Username hint")]; + [_textfield_password + setPlaceholder:NSLocalizedString(@"Password", @"Credentials Input Password hint")]; + [_textfield_domain + setPlaceholder:NSLocalizedString(@"Domain", @"Credentials Input Domain hint")]; + [_btn_login setTitle:NSLocalizedString(@"Login", @"Login Button") + forState:UIControlStateNormal]; + [_btn_cancel setTitle:NSLocalizedString(@"Cancel", @"Cancel Button") + forState:UIControlStateNormal]; - // init scrollview content size - [_scroll_view setContentSize:[_scroll_view frame].size]; - - // set params in the view - [_textfield_username setText:[_params valueForKey:@"username"]]; - [_textfield_password setText:[_params valueForKey:@"password"]]; - [_textfield_domain setText:[_params valueForKey:@"domain"]]; + // init scrollview content size + [_scroll_view setContentSize:[_scroll_view frame].size]; + + // set params in the view + [_textfield_username setText:[_params valueForKey:@"username"]]; + [_textfield_password setText:[_params valueForKey:@"password"]]; + [_textfield_domain setText:[_params valueForKey:@"domain"]]; } - (void)viewDidUnload { - [super viewDidUnload]; + [super viewDidUnload]; } - (void)viewDidDisappear:(BOOL)animated { - [super viewDidDisappear:animated]; - // set signal - [[_session uiRequestCompleted] signal]; + [super viewDidDisappear:animated]; + // set signal + [[_session uiRequestCompleted] signal]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return YES; + return YES; } - (void)dealloc { - [super dealloc]; - [[NSNotificationCenter defaultCenter] removeObserver:self]; + [super dealloc]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; } #pragma mark - #pragma mark iOS Keyboard Notification Handlers - (void)keyboardWillShow:(NSNotification *)notification -{ - CGRect keyboardEndFrame = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; - CGRect keyboardFrame = [[self view] convertRect:keyboardEndFrame toView:nil]; - - [UIView beginAnimations:nil context:NULL]; - [UIView setAnimationCurve:[[[notification userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]]; - [UIView setAnimationDuration:[[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]]; +{ + CGRect keyboardEndFrame = + [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; + CGRect keyboardFrame = [[self view] convertRect:keyboardEndFrame toView:nil]; + + [UIView beginAnimations:nil context:NULL]; + [UIView setAnimationCurve:[[[notification userInfo] + objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]]; + [UIView + setAnimationDuration:[[[notification userInfo] + objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]]; CGRect frame = [_scroll_view frame]; - frame.size.height -= keyboardFrame.size.height; + frame.size.height -= keyboardFrame.size.height; [_scroll_view setFrame:frame]; - [UIView commitAnimations]; + [UIView commitAnimations]; } - (void)keyboardWillHide:(NSNotification *)notification { - CGRect keyboardEndFrame = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; - CGRect keyboardFrame = [[self view] convertRect:keyboardEndFrame toView:nil]; + CGRect keyboardEndFrame = + [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; + CGRect keyboardFrame = [[self view] convertRect:keyboardEndFrame toView:nil]; - [UIView beginAnimations:nil context:NULL]; - [UIView setAnimationCurve:[[[notification userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]]; - [UIView setAnimationDuration:[[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]]; + [UIView beginAnimations:nil context:NULL]; + [UIView setAnimationCurve:[[[notification userInfo] + objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]]; + [UIView + setAnimationDuration:[[[notification userInfo] + objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]]; CGRect frame = [_scroll_view frame]; - frame.size.height += keyboardFrame.size.height; + frame.size.height += keyboardFrame.size.height; [_scroll_view setFrame:frame]; - [UIView commitAnimations]; + [UIView commitAnimations]; } - #pragma mark - Action handlers - (IBAction)loginPressed:(id)sender { - // read input back in - [_params setValue:[_textfield_username text] forKey:@"username"]; - [_params setValue:[_textfield_password text] forKey:@"password"]; - [_params setValue:[_textfield_domain text] forKey:@"domain"]; - [_params setValue:[NSNumber numberWithBool:YES] forKey:@"result"]; + // read input back in + [_params setValue:[_textfield_username text] forKey:@"username"]; + [_params setValue:[_textfield_password text] forKey:@"password"]; + [_params setValue:[_textfield_domain text] forKey:@"domain"]; + [_params setValue:[NSNumber numberWithBool:YES] forKey:@"result"]; - // dismiss controller - [self dismissModalViewControllerAnimated:YES]; + // dismiss controller + [self dismissModalViewControllerAnimated:YES]; } - (IBAction)cancelPressed:(id)sender { - [_params setValue:[NSNumber numberWithBool:NO] forKey:@"result"]; - - // dismiss controller - [self dismissModalViewControllerAnimated:YES]; + [_params setValue:[NSNumber numberWithBool:NO] forKey:@"result"]; + + // dismiss controller + [self dismissModalViewControllerAnimated:YES]; } @end diff --git a/client/iOS/Controllers/EditorBaseController.h b/client/iOS/Controllers/EditorBaseController.h index 547eed54a..780bff9ce 100644 --- a/client/iOS/Controllers/EditorBaseController.h +++ b/client/iOS/Controllers/EditorBaseController.h @@ -1,12 +1,12 @@ /* Basic interface for settings editors - - Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ #import #import "EditTextTableViewCell.h" @@ -16,29 +16,29 @@ #import "EditSecretTextTableViewCell.h" #import "EditButtonTableViewCell.h" -extern NSString* TableCellIdentifierText; -extern NSString* TableCellIdentifierSecretText; -extern NSString* TableCellIdentifierYesNo; -extern NSString* TableCellIdentifierSelection; -extern NSString* TableCellIdentifierSubEditor; -extern NSString* TableCellIdentifierMultiChoice; -extern NSString* TableCellIdentifierButton; +extern NSString *TableCellIdentifierText; +extern NSString *TableCellIdentifierSecretText; +extern NSString *TableCellIdentifierYesNo; +extern NSString *TableCellIdentifierSelection; +extern NSString *TableCellIdentifierSubEditor; +extern NSString *TableCellIdentifierMultiChoice; +extern NSString *TableCellIdentifierButton; @interface EditorBaseController : UITableViewController -{ -@private - IBOutlet EditTextTableViewCell* _textTableViewCell; - IBOutlet EditSecretTextTableViewCell* _secretTextTableViewCell; - IBOutlet EditFlagTableViewCell* _flagTableViewCell; - IBOutlet EditSelectionTableViewCell* _selectionTableViewCell; - IBOutlet EditSubEditTableViewCell* _subEditTableViewCell; - IBOutlet EditButtonTableViewCell* _buttonTableViewCell; +{ + @private + IBOutlet EditTextTableViewCell *_textTableViewCell; + IBOutlet EditSecretTextTableViewCell *_secretTextTableViewCell; + IBOutlet EditFlagTableViewCell *_flagTableViewCell; + IBOutlet EditSelectionTableViewCell *_selectionTableViewCell; + IBOutlet EditSubEditTableViewCell *_subEditTableViewCell; + IBOutlet EditButtonTableViewCell *_buttonTableViewCell; } // returns one of the requested table view cells -- (UITableViewCell*)tableViewCellFromIdentifier:(NSString*)identifier; +- (UITableViewCell *)tableViewCellFromIdentifier:(NSString *)identifier; // Adjust text input cells label/textfield widht according to the label's text size -- (void)adjustEditTextTableViewCell:(EditTextTableViewCell*)cell; +- (void)adjustEditTextTableViewCell:(EditTextTableViewCell *)cell; @end diff --git a/client/iOS/Controllers/EditorBaseController.m b/client/iOS/Controllers/EditorBaseController.m index 48be42e3d..70c5f4e98 100644 --- a/client/iOS/Controllers/EditorBaseController.m +++ b/client/iOS/Controllers/EditorBaseController.m @@ -1,10 +1,11 @@ /* Basic interface for settings editors - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "EditorBaseController.h" @@ -13,96 +14,97 @@ @end -NSString* TableCellIdentifierText = @"cellIdText"; -NSString* TableCellIdentifierSecretText = @"cellIdSecretText"; -NSString* TableCellIdentifierYesNo = @"cellIdYesNo"; -NSString* TableCellIdentifierSelection = @"cellIdSelection"; -NSString* TableCellIdentifierSubEditor = @"cellIdSubEditor"; -NSString* TableCellIdentifierMultiChoice = @"cellIdMultiChoice"; -NSString* TableCellIdentifierButton = @"cellIdButton"; +NSString *TableCellIdentifierText = @"cellIdText"; +NSString *TableCellIdentifierSecretText = @"cellIdSecretText"; +NSString *TableCellIdentifierYesNo = @"cellIdYesNo"; +NSString *TableCellIdentifierSelection = @"cellIdSelection"; +NSString *TableCellIdentifierSubEditor = @"cellIdSubEditor"; +NSString *TableCellIdentifierMultiChoice = @"cellIdMultiChoice"; +NSString *TableCellIdentifierButton = @"cellIdButton"; @implementation EditorBaseController - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return YES; + return YES; } #pragma mark - Create table view cells -- (UITableViewCell*)tableViewCellFromIdentifier:(NSString*)identifier +- (UITableViewCell *)tableViewCellFromIdentifier:(NSString *)identifier { - // try to reuse a cell - UITableViewCell* cell = [[self tableView] dequeueReusableCellWithIdentifier:identifier]; - if (cell != nil) - return cell; + // try to reuse a cell + UITableViewCell *cell = [[self tableView] dequeueReusableCellWithIdentifier:identifier]; + if (cell != nil) + return cell; - // we have to create a new cell - if ([identifier isEqualToString:TableCellIdentifierText]) - { - [[NSBundle mainBundle] loadNibNamed:@"EditTextTableViewCell" owner:self options:nil]; - cell = _textTableViewCell; - _textTableViewCell = nil; - } - else if ([identifier isEqualToString:TableCellIdentifierSecretText]) - { - [[NSBundle mainBundle] loadNibNamed:@"EditSecretTextTableViewCell" owner:self options:nil]; - cell = _secretTextTableViewCell; - _secretTextTableViewCell = nil; - } - else if ([identifier isEqualToString:TableCellIdentifierYesNo]) - { - [[NSBundle mainBundle] loadNibNamed:@"EditFlagTableViewCell" owner:self options:nil]; - cell = _flagTableViewCell; - _flagTableViewCell = nil; - } - else if ([identifier isEqualToString:TableCellIdentifierSelection]) - { - [[NSBundle mainBundle] loadNibNamed:@"EditSelectionTableViewCell" owner:self options:nil]; - cell = _selectionTableViewCell; - _selectionTableViewCell = nil; - } - else if ([identifier isEqualToString:TableCellIdentifierSubEditor]) - { - [[NSBundle mainBundle] loadNibNamed:@"EditSubEditTableViewCell" owner:self options:nil]; - cell = _subEditTableViewCell; - _subEditTableViewCell = nil; - } - else if ([identifier isEqualToString:TableCellIdentifierButton]) - { - [[NSBundle mainBundle] loadNibNamed:@"EditButtonTableViewCell" owner:self options:nil]; - cell = _buttonTableViewCell; - _buttonTableViewCell = nil; - } - else if ([identifier isEqualToString:TableCellIdentifierMultiChoice]) - { - cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier] autorelease]; - } - else - { - NSAssert(false, @"Unknown table cell identifier"); - } - - return cell; + // we have to create a new cell + if ([identifier isEqualToString:TableCellIdentifierText]) + { + [[NSBundle mainBundle] loadNibNamed:@"EditTextTableViewCell" owner:self options:nil]; + cell = _textTableViewCell; + _textTableViewCell = nil; + } + else if ([identifier isEqualToString:TableCellIdentifierSecretText]) + { + [[NSBundle mainBundle] loadNibNamed:@"EditSecretTextTableViewCell" owner:self options:nil]; + cell = _secretTextTableViewCell; + _secretTextTableViewCell = nil; + } + else if ([identifier isEqualToString:TableCellIdentifierYesNo]) + { + [[NSBundle mainBundle] loadNibNamed:@"EditFlagTableViewCell" owner:self options:nil]; + cell = _flagTableViewCell; + _flagTableViewCell = nil; + } + else if ([identifier isEqualToString:TableCellIdentifierSelection]) + { + [[NSBundle mainBundle] loadNibNamed:@"EditSelectionTableViewCell" owner:self options:nil]; + cell = _selectionTableViewCell; + _selectionTableViewCell = nil; + } + else if ([identifier isEqualToString:TableCellIdentifierSubEditor]) + { + [[NSBundle mainBundle] loadNibNamed:@"EditSubEditTableViewCell" owner:self options:nil]; + cell = _subEditTableViewCell; + _subEditTableViewCell = nil; + } + else if ([identifier isEqualToString:TableCellIdentifierButton]) + { + [[NSBundle mainBundle] loadNibNamed:@"EditButtonTableViewCell" owner:self options:nil]; + cell = _buttonTableViewCell; + _buttonTableViewCell = nil; + } + else if ([identifier isEqualToString:TableCellIdentifierMultiChoice]) + { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 + reuseIdentifier:identifier] autorelease]; + } + else + { + NSAssert(false, @"Unknown table cell identifier"); + } + + return cell; } #pragma mark - Utility functions -- (void)adjustEditTextTableViewCell:(EditTextTableViewCell*)cell +- (void)adjustEditTextTableViewCell:(EditTextTableViewCell *)cell { - UILabel* label = [cell label]; - UITextField* textField = [cell textfield]; - - // adjust label - CGFloat width = [[label text] sizeWithFont:[label font]].width; - CGRect frame = [label frame]; - CGFloat delta = width - frame.size.width; - frame.size.width = width; - [label setFrame:frame]; - - // adjust text field - frame = [textField frame]; - frame.origin.x += delta; - frame.size.width -= delta; - [textField setFrame:frame]; + UILabel *label = [cell label]; + UITextField *textField = [cell textfield]; + + // adjust label + CGFloat width = [[label text] sizeWithFont:[label font]].width; + CGRect frame = [label frame]; + CGFloat delta = width - frame.size.width; + frame.size.width = width; + [label setFrame:frame]; + + // adjust text field + frame = [textField frame]; + frame.origin.x += delta; + frame.size.width -= delta; + [textField setFrame:frame]; } @end diff --git a/client/iOS/Controllers/EditorSelectionController.h b/client/iOS/Controllers/EditorSelectionController.h index a240f1537..11c96389f 100644 --- a/client/iOS/Controllers/EditorSelectionController.h +++ b/client/iOS/Controllers/EditorSelectionController.h @@ -1,10 +1,11 @@ /* Generic controller to select a single item from a list of options - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "EditorBaseController.h" @@ -13,18 +14,21 @@ @interface EditorSelectionController : EditorBaseController { - ConnectionParams* _params; + ConnectionParams *_params; - // array with entries in connection parameters that are altered - NSArray* _entries; + // array with entries in connection parameters that are altered + NSArray *_entries; - // array with dictionaries containing label/value pairs that represent the available values for each entry - NSArray* _selections; - - // current selections - NSMutableArray* _cur_selections; + // array with dictionaries containing label/value pairs that represent the available values for + // each entry + NSArray *_selections; + + // current selections + NSMutableArray *_cur_selections; } -- (id)initWithConnectionParams:(ConnectionParams*)params entries:(NSArray*)entries selections:(NSArray*)selections; +- (id)initWithConnectionParams:(ConnectionParams *)params + entries:(NSArray *)entries + selections:(NSArray *)selections; @end diff --git a/client/iOS/Controllers/EditorSelectionController.m b/client/iOS/Controllers/EditorSelectionController.m index 3313a8b16..13a7363b8 100644 --- a/client/iOS/Controllers/EditorSelectionController.m +++ b/client/iOS/Controllers/EditorSelectionController.m @@ -1,10 +1,11 @@ /* Generic controller to select a single item from a list of options - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "EditorSelectionController.h" @@ -12,88 +13,92 @@ #import "OrderedDictionary.h" @interface EditorSelectionController (Private) -- (OrderedDictionary*)selectionForIndex:(int)index; +- (OrderedDictionary *)selectionForIndex:(int)index; @end @implementation EditorSelectionController -- (id)initWithConnectionParams:(ConnectionParams*)params entries:(NSArray *)entries selections:(NSArray *)selections +- (id)initWithConnectionParams:(ConnectionParams *)params + entries:(NSArray *)entries + selections:(NSArray *)selections { - self = [super initWithStyle:UITableViewStyleGrouped]; - if (self) - { - _params = [params retain]; - _entries = [entries retain]; - _selections = [selections retain]; - - // allocate and init current selections array - _cur_selections = [[NSMutableArray alloc] initWithCapacity:[_entries count]]; - for (int i = 0; i < [entries count]; ++i) - { - NSString* entry = [entries objectAtIndex:i]; - if([_params hasValueForKeyPath:entry]) - { - NSUInteger idx = [(OrderedDictionary*)[selections objectAtIndex:i] indexForValue:[NSNumber numberWithInt:[_params intForKeyPath:entry]]]; - [_cur_selections addObject:[NSNumber numberWithInt:(idx != NSNotFound ? idx : 0)]]; - } - else - [_cur_selections addObject:[NSNumber numberWithInt:0]]; - } - } - return self; + self = [super initWithStyle:UITableViewStyleGrouped]; + if (self) + { + _params = [params retain]; + _entries = [entries retain]; + _selections = [selections retain]; + + // allocate and init current selections array + _cur_selections = [[NSMutableArray alloc] initWithCapacity:[_entries count]]; + for (int i = 0; i < [entries count]; ++i) + { + NSString *entry = [entries objectAtIndex:i]; + if ([_params hasValueForKeyPath:entry]) + { + NSUInteger idx = [(OrderedDictionary *)[selections objectAtIndex:i] + indexForValue:[NSNumber numberWithInt:[_params intForKeyPath:entry]]]; + [_cur_selections addObject:[NSNumber numberWithInt:(idx != NSNotFound ? idx : 0)]]; + } + else + [_cur_selections addObject:[NSNumber numberWithInt:0]]; + } + } + return self; } - (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. - [_params autorelease]; - [_entries autorelease]; - [_selections autorelease]; - [_cur_selections autorelease]; + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Release any cached data, images, etc that aren't in use. + [_params autorelease]; + [_entries autorelease]; + [_selections autorelease]; + [_cur_selections autorelease]; } #pragma mark - View lifecycle - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - // Return YES for supported orientations - return YES; + // Return YES for supported orientations + return YES; } #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - // Return the number of sections. - return [_entries count]; + // Return the number of sections. + return [_entries count]; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - // Return the number of rows in the section. - return [[self selectionForIndex:section] count]; + // Return the number of rows in the section. + return [[self selectionForIndex:section] count]; } -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell *cell = [self tableViewCellFromIdentifier:TableCellIdentifierMultiChoice]; - - // get selection - OrderedDictionary* selection = [self selectionForIndex:[indexPath section]]; - - // set cell properties + UITableViewCell *cell = [self tableViewCellFromIdentifier:TableCellIdentifierMultiChoice]; + + // get selection + OrderedDictionary *selection = [self selectionForIndex:[indexPath section]]; + + // set cell properties [[cell textLabel] setText:[selection keyAtIndex:[indexPath row]]]; - + // set default checkmark - if([indexPath row] == [[_cur_selections objectAtIndex:[indexPath section]] intValue]) + if ([indexPath row] == [[_cur_selections objectAtIndex:[indexPath section]] intValue]) [cell setAccessoryType:UITableViewCellAccessoryCheckmark]; else [cell setAccessoryType:UITableViewCellAccessoryNone]; - - return cell; + + return cell; } #pragma mark - Table view delegate @@ -101,36 +106,38 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // has selection change? - int cur_selection = [[_cur_selections objectAtIndex:[indexPath section]] intValue]; - if([indexPath row] != cur_selection) + int cur_selection = [[_cur_selections objectAtIndex:[indexPath section]] intValue]; + if ([indexPath row] != cur_selection) { [tableView deselectRowAtIndexPath:indexPath animated:NO]; - - NSIndexPath* oldIndexPath = [NSIndexPath indexPathForRow:cur_selection inSection:[indexPath section]]; - + + NSIndexPath *oldIndexPath = [NSIndexPath indexPathForRow:cur_selection + inSection:[indexPath section]]; + // clear old checkmark - UITableViewCell* old_sel_cell = [tableView cellForRowAtIndexPath:oldIndexPath]; + UITableViewCell *old_sel_cell = [tableView cellForRowAtIndexPath:oldIndexPath]; old_sel_cell.accessoryType = UITableViewCellAccessoryNone; - + // set new checkmark - UITableViewCell* new_sel_cell = [tableView cellForRowAtIndexPath:indexPath]; + UITableViewCell *new_sel_cell = [tableView cellForRowAtIndexPath:indexPath]; new_sel_cell.accessoryType = UITableViewCellAccessoryCheckmark; - // get value from selection dictionary - OrderedDictionary* dict = [self selectionForIndex:[indexPath section]]; - int sel_value = [[dict valueForKey:[dict keyAtIndex:[indexPath row]]] intValue]; + // get value from selection dictionary + OrderedDictionary *dict = [self selectionForIndex:[indexPath section]]; + int sel_value = [[dict valueForKey:[dict keyAtIndex:[indexPath row]]] intValue]; // update selection index and params value - [_cur_selections replaceObjectAtIndex:[indexPath section] withObject:[NSNumber numberWithInt:[indexPath row]]]; - [_params setInt:sel_value forKeyPath:[_entries objectAtIndex:[indexPath section]]]; - } + [_cur_selections replaceObjectAtIndex:[indexPath section] + withObject:[NSNumber numberWithInt:[indexPath row]]]; + [_params setInt:sel_value forKeyPath:[_entries objectAtIndex:[indexPath section]]]; + } } #pragma mark - Convenience functions -- (OrderedDictionary*)selectionForIndex:(int)index +- (OrderedDictionary *)selectionForIndex:(int)index { - return (OrderedDictionary*)[_selections objectAtIndex:index]; + return (OrderedDictionary *)[_selections objectAtIndex:index]; } @end diff --git a/client/iOS/Controllers/EncryptionController.h b/client/iOS/Controllers/EncryptionController.h index cc3430394..f516cf635 100644 --- a/client/iOS/Controllers/EncryptionController.h +++ b/client/iOS/Controllers/EncryptionController.h @@ -1,10 +1,11 @@ /* Password Encryption Controller - + Copyright 2013 Thincast Technologies GmbH, Author: Dorian Johnson - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @@ -12,13 +13,13 @@ @interface EncryptionController : NSObject { - Encryptor* _shared_encryptor; + Encryptor *_shared_encryptor; } -+ (EncryptionController*)sharedEncryptionController; ++ (EncryptionController *)sharedEncryptionController; // Return a Encryptor suitable for encrypting or decrypting with the master password -- (Encryptor*)decryptor; -- (Encryptor*)encryptor; +- (Encryptor *)decryptor; +- (Encryptor *)encryptor; @end diff --git a/client/iOS/Controllers/EncryptionController.m b/client/iOS/Controllers/EncryptionController.m index 7f5a2599f..d7431bf55 100644 --- a/client/iOS/Controllers/EncryptionController.m +++ b/client/iOS/Controllers/EncryptionController.m @@ -1,10 +1,11 @@ /* Password Encryption Controller - + Copyright 2013 Thincast Technologies GmbH, Author: Dorian Johnson - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "EncryptionController.h" @@ -13,63 +14,65 @@ @interface EncryptionController (Private) -- (BOOL)verifyPassword:(Encryptor*)decryptor; -- (NSData*)encryptedVerificationData; -- (void)setEncryptedVerificationData:(Encryptor*)encryptor; +- (BOOL)verifyPassword:(Encryptor *)decryptor; +- (NSData *)encryptedVerificationData; +- (void)setEncryptedVerificationData:(Encryptor *)encryptor; -- (NSString*)keychainServerName; -- (NSString*)keychainUsername; -- (void)setKeychainPassword:(NSString*)password; -- (NSString*)keychainPassword; -- (NSString*)keychainDefaultPassword; +- (NSString *)keychainServerName; +- (NSString *)keychainUsername; +- (void)setKeychainPassword:(NSString *)password; +- (NSString *)keychainPassword; +- (NSString *)keychainDefaultPassword; @end -static EncryptionController* _shared_encryption_controller = nil; - +static EncryptionController *_shared_encryption_controller = nil; #pragma mark - @implementation EncryptionController -+ (EncryptionController*)sharedEncryptionController ++ (EncryptionController *)sharedEncryptionController { @synchronized(self) { if (_shared_encryption_controller == nil) - _shared_encryption_controller = [[EncryptionController alloc] init]; + _shared_encryption_controller = [[EncryptionController alloc] init]; } - - return _shared_encryption_controller; + + return _shared_encryption_controller; } #pragma mark Getting an encryptor or decryptor -- (Encryptor*)encryptor +- (Encryptor *)encryptor { if (_shared_encryptor) return _shared_encryptor; - - NSString* saved_password = [self keychainPassword]; + + NSString *saved_password = [self keychainPassword]; if (saved_password == nil) - { - saved_password = [self keychainDefaultPassword]; - Encryptor* encryptor = [[[Encryptor alloc] initWithPassword:saved_password] autorelease]; - [self setEncryptedVerificationData:encryptor]; - _shared_encryptor = [encryptor retain]; - } - else - { - Encryptor* encryptor = [[[Encryptor alloc] initWithPassword:saved_password] autorelease]; - if ([self verifyPassword:encryptor]) - _shared_encryptor = [encryptor retain]; - } - - return _shared_encryptor; + { + saved_password = [self keychainDefaultPassword]; + Encryptor *encryptor = [[[Encryptor alloc] initWithPassword:saved_password] autorelease]; + [self setEncryptedVerificationData:encryptor]; + _shared_encryptor = [encryptor retain]; + } + else + { + Encryptor *encryptor = [[[Encryptor alloc] initWithPassword:saved_password] autorelease]; + if ([self verifyPassword:encryptor]) + _shared_encryptor = [encryptor retain]; + } + + return _shared_encryptor; } // For the current implementation, decryptors and encryptors are equivilant. -- (Encryptor*)decryptor { return [self encryptor]; } +- (Encryptor *)decryptor +{ + return [self encryptor]; +} @end @@ -80,62 +83,73 @@ static EncryptionController* _shared_encryption_controller = nil; #pragma mark - #pragma mark Keychain password storage -- (NSString*)keychainServerName +- (NSString *)keychainServerName { return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"]; } -- (NSString*)keychainUsername +- (NSString *)keychainUsername { return @"master.password"; } -- (void)setKeychainPassword:(NSString*)password -{ - NSError* error; +- (void)setKeychainPassword:(NSString *)password +{ + NSError *error; if (password == nil) { - [SFHFKeychainUtils deleteItemForUsername:[self keychainUsername] andServerName:[self keychainServerName] error:&error]; + [SFHFKeychainUtils deleteItemForUsername:[self keychainUsername] + andServerName:[self keychainServerName] + error:&error]; return; } - [SFHFKeychainUtils storeUsername:[self keychainUsername] andPassword:password forServerName:[self keychainServerName] updateExisting:YES error:&error]; + [SFHFKeychainUtils storeUsername:[self keychainUsername] + andPassword:password + forServerName:[self keychainServerName] + updateExisting:YES + error:&error]; } -- (NSString*)keychainPassword +- (NSString *)keychainPassword { - NSError* error; - return [SFHFKeychainUtils getPasswordForUsername:[self keychainUsername] andServerName:[self keychainServerName] error:&error]; + NSError *error; + return [SFHFKeychainUtils getPasswordForUsername:[self keychainUsername] + andServerName:[self keychainServerName] + error:&error]; } -- (NSString*)keychainDefaultPassword +- (NSString *)keychainDefaultPassword { - NSString* password = [[NSUserDefaults standardUserDefaults] stringForKey:@"UUID"]; - if ([password length] == 0) - { - password = [NSString stringWithUUID]; - [[NSUserDefaults standardUserDefaults] setObject:password forKey:@"UUID"]; - [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"TSXMasterPasswordVerification"]; - } - return password; + NSString *password = [[NSUserDefaults standardUserDefaults] stringForKey:@"UUID"]; + if ([password length] == 0) + { + password = [NSString stringWithUUID]; + [[NSUserDefaults standardUserDefaults] setObject:password forKey:@"UUID"]; + [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"TSXMasterPasswordVerification"]; + } + return password; } #pragma mark - #pragma mark Verification of encryption key against verification data -- (BOOL)verifyPassword:(Encryptor*)decryptor +- (BOOL)verifyPassword:(Encryptor *)decryptor { - return [[decryptor plaintextPassword] isEqualToString:[decryptor decryptString:[self encryptedVerificationData]]]; + return [[decryptor plaintextPassword] + isEqualToString:[decryptor decryptString:[self encryptedVerificationData]]]; } -- (NSData*)encryptedVerificationData +- (NSData *)encryptedVerificationData { return [[NSUserDefaults standardUserDefaults] dataForKey:@"TSXMasterPasswordVerification"]; } -- (void)setEncryptedVerificationData:(Encryptor*)encryptor +- (void)setEncryptedVerificationData:(Encryptor *)encryptor { - [[NSUserDefaults standardUserDefaults] setObject:[encryptor encryptString:[encryptor plaintextPassword]] forKey:@"TSXMasterPasswordVerification"]; + [[NSUserDefaults standardUserDefaults] + setObject:[encryptor encryptString:[encryptor plaintextPassword]] + forKey:@"TSXMasterPasswordVerification"]; } @end diff --git a/client/iOS/Controllers/HelpController.h b/client/iOS/Controllers/HelpController.h index 0d6c736be..9e7b93341 100644 --- a/client/iOS/Controllers/HelpController.h +++ b/client/iOS/Controllers/HelpController.h @@ -1,16 +1,17 @@ /* Application help controller - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @interface HelpController : UIViewController { - UIWebView* webView; + UIWebView *webView; } @end diff --git a/client/iOS/Controllers/HelpController.m b/client/iOS/Controllers/HelpController.m index f7b44dc79..7ea97c799 100644 --- a/client/iOS/Controllers/HelpController.m +++ b/client/iOS/Controllers/HelpController.m @@ -1,10 +1,11 @@ /* Application help controller - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "HelpController.h" @@ -14,45 +15,62 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) + { // set title and tab-bar image [self setTitle:NSLocalizedString(@"Help", @"Help Controller title")]; - UIImage* tabBarIcon = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"tabbar_icon_help" ofType:@"png"]]; - [self setTabBarItem:[[[UITabBarItem alloc] initWithTitle:NSLocalizedString(@"Help", @"Tabbar item help") image:tabBarIcon tag:0] autorelease]]; - } - return self; + UIImage *tabBarIcon = [UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"tabbar_icon_help" + ofType:@"png"]]; + [self setTabBarItem:[[[UITabBarItem alloc] + initWithTitle:NSLocalizedString(@"Help", @"Tabbar item help") + image:tabBarIcon + tag:0] autorelease]]; + } + return self; } // Implement loadView to create a view hierarchy programmatically, without using a nib. -- (void)loadView +- (void)loadView { webView = [[[UIWebView alloc] initWithFrame:CGRectZero] autorelease]; - [webView setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [webView + setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; [webView setAutoresizesSubviews:YES]; - [webView setDelegate:self]; - [webView setDataDetectorTypes:UIDataDetectorTypeNone]; + [webView setDelegate:self]; + [webView setDataDetectorTypes:UIDataDetectorTypeNone]; [self setView:webView]; } -- (void)dealloc { - [super dealloc]; +- (void)dealloc +{ + [super dealloc]; } // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad +- (void)viewDidLoad { - [super viewDidLoad]; - - NSString *filename = (IsPhone() ? @"gestures_phone" : @"gestures"); - NSString *htmlString = [[[NSString alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:filename ofType:@"html" inDirectory:@"help_page"] encoding:NSUTF8StringEncoding error:nil] autorelease]; - - [webView loadHTMLString:htmlString baseURL:[NSURL fileURLWithPath:[[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"help_page"]]]; + [super viewDidLoad]; + + NSString *filename = (IsPhone() ? @"gestures_phone" : @"gestures"); + NSString *htmlString = [[[NSString alloc] + initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:filename + ofType:@"html" + inDirectory:@"help_page"] + encoding:NSUTF8StringEncoding + error:nil] autorelease]; + + [webView + loadHTMLString:htmlString + baseURL:[NSURL fileURLWithPath:[[[NSBundle mainBundle] bundlePath] + stringByAppendingPathComponent:@"help_page"]]]; } // Override to allow orientations other than the default portrait orientation. -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return YES; +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; } @end diff --git a/client/iOS/Controllers/MainTabBarController.h b/client/iOS/Controllers/MainTabBarController.h index f369d8a30..d1b4c584b 100644 --- a/client/iOS/Controllers/MainTabBarController.h +++ b/client/iOS/Controllers/MainTabBarController.h @@ -1,17 +1,18 @@ /* main tabbar controller - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import #import -@interface MainTabBarController : UITabBarController { - +@interface MainTabBarController : UITabBarController +{ } @end diff --git a/client/iOS/Controllers/MainTabBarController.m b/client/iOS/Controllers/MainTabBarController.m index 76a437e56..afd71e8be 100644 --- a/client/iOS/Controllers/MainTabBarController.m +++ b/client/iOS/Controllers/MainTabBarController.m @@ -1,20 +1,20 @@ /* main tabbar controller - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "MainTabBarController.h" - @implementation MainTabBarController --(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { - return YES; + return YES; } @end diff --git a/client/iOS/Controllers/PerformanceEditorController.h b/client/iOS/Controllers/PerformanceEditorController.h index 5d6fafb24..c83cb47ee 100644 --- a/client/iOS/Controllers/PerformanceEditorController.h +++ b/client/iOS/Controllers/PerformanceEditorController.h @@ -1,10 +1,11 @@ /* controller for performance settings selection - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "EditorBaseController.h" @@ -13,12 +14,12 @@ @interface PerformanceEditorController : EditorBaseController { -@private - ConnectionParams* _params; - NSString* _keyPath; + @private + ConnectionParams *_params; + NSString *_keyPath; } -- (id)initWithConnectionParams:(ConnectionParams*)params; -- (id)initWithConnectionParams:(ConnectionParams*)params keyPath:(NSString*)keyPath; +- (id)initWithConnectionParams:(ConnectionParams *)params; +- (id)initWithConnectionParams:(ConnectionParams *)params keyPath:(NSString *)keyPath; @end diff --git a/client/iOS/Controllers/PerformanceEditorController.m b/client/iOS/Controllers/PerformanceEditorController.m index 3f15e2219..1c50982c4 100644 --- a/client/iOS/Controllers/PerformanceEditorController.m +++ b/client/iOS/Controllers/PerformanceEditorController.m @@ -4,26 +4,26 @@ Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "PerformanceEditorController.h" #import "ConnectionParams.h" #import "Utils.h" -@interface PerformanceEditorController(Private) --(NSString*)keyPathForKey:(NSString*)key; +@interface PerformanceEditorController (Private) +- (NSString *)keyPathForKey:(NSString *)key; @end @implementation PerformanceEditorController -- (id)initWithConnectionParams:(ConnectionParams*)params +- (id)initWithConnectionParams:(ConnectionParams *)params { return [self initWithConnectionParams:params keyPath:nil]; } -- (id)initWithConnectionParams:(ConnectionParams*)params keyPath: - (NSString*)keyPath; +- (id)initWithConnectionParams:(ConnectionParams *)params keyPath:(NSString *)keyPath; { self = [super initWithStyle:UITableViewStyleGrouped]; @@ -48,13 +48,12 @@ // Release any retained subviews of the main view. } -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) - interfaceOrientation +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } --(NSString*)keyPathForKey:(NSString*)key +- (NSString *)keyPathForKey:(NSString *)key { if (_keyPath) return [_keyPath stringByAppendingFormat:@".%@", key]; @@ -71,124 +70,118 @@ #pragma mark - #pragma mark Table view data source -- (NSInteger)numberOfSectionsInTableView:(UITableView*)tableView +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections. return 1; } - -- (NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection: - (NSInteger)section +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 7; } - // set section headers -- (NSString*)tableView:(UITableView*)tableView titleForHeaderInSection: - (NSInteger)section +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { return NSLocalizedString(@"Performance Settings", @"'Performance Settings': performance settings header"); } // Customize the appearance of table view cells. -- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath: - (NSIndexPath*)indexPath +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath { // get the table view cell - EditFlagTableViewCell* cell = (EditFlagTableViewCell*)[self - tableViewCellFromIdentifier:TableCellIdentifierYesNo]; + EditFlagTableViewCell *cell = + (EditFlagTableViewCell *)[self tableViewCellFromIdentifier:TableCellIdentifierYesNo]; NSAssert(cell, @"Invalid cell"); switch ([indexPath row]) { case 0: - { - [[cell label] setText:NSLocalizedString(@"RemoteFX", - @"RemoteFX performance setting")]; - [[cell toggle] setOn:[_params boolForKeyPath:[self keyPathForKey: - @"perf_remotefx"]]]; - break; - } + { + [[cell label] setText:NSLocalizedString(@"RemoteFX", @"RemoteFX performance setting")]; + [[cell toggle] setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_remotefx"]]]; + break; + } case 1: - { - [[cell label] setText:NSLocalizedString(@"GFX", @"GFX performance setting")]; - [[cell toggle] setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_gfx"]]]; - break; - } + { + [[cell label] setText:NSLocalizedString(@"GFX", @"GFX performance setting")]; + [[cell toggle] setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_gfx"]]]; + break; + } case 2: - { - [[cell label] setText:NSLocalizedString(@"H264", @"H264 performance setting")]; - [[cell toggle] setOn:[_params boolForKeyPath:[self keyPathForKey: - @"perf_h264"]]]; - break; - } + { + [[cell label] setText:NSLocalizedString(@"H264", @"H264 performance setting")]; + [[cell toggle] setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_h264"]]]; + break; + } case 3: - { - [[cell label] setText:NSLocalizedString(@"Desktop Background", - @"Desktop background performance setting")]; - [[cell toggle] setOn:[_params boolForKeyPath:[self keyPathForKey: - @"perf_show_desktop"]]]; - break; - } + { + [[cell label] setText:NSLocalizedString(@"Desktop Background", + @"Desktop background performance setting")]; + [[cell toggle] + setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_show_desktop"]]]; + break; + } case 4: - { - [[cell label] setText:NSLocalizedString(@"Font Smoothing", - @"Font smoothing performance setting")]; - [[cell toggle] setOn:[_params boolForKeyPath:[self keyPathForKey: - @"perf_font_smoothing"]]]; - break; - } + { + [[cell label] setText:NSLocalizedString(@"Font Smoothing", + @"Font smoothing performance setting")]; + [[cell toggle] + setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_font_smoothing"]]]; + break; + } case 5: - { - [[cell label] setText:NSLocalizedString(@"Desktop Composition", - @"Desktop composition performance setting")]; - [[cell toggle] setOn:[_params boolForKeyPath:[self keyPathForKey: - @"perf_desktop_composition"]]]; - break; - } + { + [[cell label] setText:NSLocalizedString(@"Desktop Composition", + @"Desktop composition performance setting")]; + [[cell toggle] + setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_desktop_composition"]]]; + break; + } case 6: - { - [[cell label] setText:NSLocalizedString(@"Window contents while dragging", - @"Window Dragging performance setting")]; - [[cell toggle] setOn:[_params boolForKeyPath:[self keyPathForKey: - @"perf_window_dragging"]]]; - break; - } + { + [[cell label] setText:NSLocalizedString(@"Window contents while dragging", + @"Window Dragging performance setting")]; + [[cell toggle] + setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_window_dragging"]]]; + break; + } case 7: - { - [[cell label] setText:NSLocalizedString(@"Menu Animation", - @"Menu Animations performance setting")]; - [[cell toggle] setOn:[_params boolForKeyPath:[self keyPathForKey: - @"perf_menu_animation"]]]; - break; - } + { + [[cell label] setText:NSLocalizedString(@"Menu Animation", + @"Menu Animations performance setting")]; + [[cell toggle] + setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_menu_animation"]]]; + break; + } case 8: - { - [[cell label] setText:NSLocalizedString(@"Visual Styles", - @"Use Themes performance setting")]; - [[cell toggle] setOn:[_params boolForKeyPath:[self keyPathForKey: - @"perf_windows_themes"]]]; - break; - } + { + [[cell label] + setText:NSLocalizedString(@"Visual Styles", @"Use Themes performance setting")]; + [[cell toggle] + setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_windows_themes"]]]; + break; + } default: break; } [[cell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; - [[cell toggle] addTarget:self action:@selector(togglePerformanceSetting:) - forControlEvents:UIControlEventValueChanged]; + [[cell toggle] addTarget:self + action:@selector(togglePerformanceSetting:) + forControlEvents:UIControlEventValueChanged]; return cell; } @@ -197,53 +190,50 @@ - (void)togglePerformanceSetting:(id)sender { - UISwitch* valueSwitch = (UISwitch*)sender; + UISwitch *valueSwitch = (UISwitch *)sender; switch (valueSwitch.tag) { case GET_TAG(0, 0): - [_params setBool:[valueSwitch isOn] forKeyPath:[self keyPathForKey: - @"perf_remotefx"]]; + [_params setBool:[valueSwitch isOn] forKeyPath:[self keyPathForKey:@"perf_remotefx"]]; break; case GET_TAG(0, 1): - [_params setBool:[valueSwitch isOn] forKeyPath:[self keyPathForKey: - @"perf_gfx"]]; + [_params setBool:[valueSwitch isOn] forKeyPath:[self keyPathForKey:@"perf_gfx"]]; break; case GET_TAG(0, 2): - [_params setBool:[valueSwitch isOn] forKeyPath:[self keyPathForKey: - @"perf_h264"]]; + [_params setBool:[valueSwitch isOn] forKeyPath:[self keyPathForKey:@"perf_h264"]]; break; case GET_TAG(0, 3): - [_params setBool:[valueSwitch isOn] forKeyPath:[self keyPathForKey: - @"perf_show_desktop"]]; + [_params setBool:[valueSwitch isOn] + forKeyPath:[self keyPathForKey:@"perf_show_desktop"]]; break; case GET_TAG(0, 4): - [_params setBool:[valueSwitch isOn] forKeyPath:[self keyPathForKey: - @"perf_font_smoothing"]]; + [_params setBool:[valueSwitch isOn] + forKeyPath:[self keyPathForKey:@"perf_font_smoothing"]]; break; case GET_TAG(0, 5): - [_params setBool:[valueSwitch isOn] forKeyPath:[self keyPathForKey: - @"perf_desktop_composition"]]; + [_params setBool:[valueSwitch isOn] + forKeyPath:[self keyPathForKey:@"perf_desktop_composition"]]; break; case GET_TAG(0, 6): - [_params setBool:[valueSwitch isOn] forKeyPath:[self keyPathForKey: - @"perf_window_dragging"]]; + [_params setBool:[valueSwitch isOn] + forKeyPath:[self keyPathForKey:@"perf_window_dragging"]]; break; case GET_TAG(0, 7): - [_params setBool:[valueSwitch isOn] forKeyPath:[self keyPathForKey: - @"perf_menu_animation"]]; + [_params setBool:[valueSwitch isOn] + forKeyPath:[self keyPathForKey:@"perf_menu_animation"]]; break; case GET_TAG(0, 8): - [_params setBool:[valueSwitch isOn] forKeyPath:[self keyPathForKey: - @"perf_windows_themes"]]; + [_params setBool:[valueSwitch isOn] + forKeyPath:[self keyPathForKey:@"perf_windows_themes"]]; break; default: diff --git a/client/iOS/Controllers/RDPSessionViewController.h b/client/iOS/Controllers/RDPSessionViewController.h index 36e64a93d..202708e25 100644 --- a/client/iOS/Controllers/RDPSessionViewController.h +++ b/client/iOS/Controllers/RDPSessionViewController.h @@ -1,10 +1,11 @@ /* RDP Session View Controller - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @@ -14,57 +15,61 @@ #import "TouchPointerView.h" #import "AdvancedKeyboardView.h" -@interface RDPSessionViewController : UIViewController +@interface RDPSessionViewController + : UIViewController { // scrollview that hosts the rdp session view - IBOutlet UIScrollView* _session_scrollview; - - // rdp session view - IBOutlet RDPSessionView* _session_view; + IBOutlet UIScrollView *_session_scrollview; - // touch pointer view - IBOutlet TouchPointerView* _touchpointer_view; - BOOL _autoscroll_with_touchpointer; - BOOL _is_autoscrolling; + // rdp session view + IBOutlet RDPSessionView *_session_view; + + // touch pointer view + IBOutlet TouchPointerView *_touchpointer_view; + BOOL _autoscroll_with_touchpointer; + BOOL _is_autoscrolling; // rdp session toolbar - IBOutlet UIToolbar* _session_toolbar; - BOOL _session_toolbar_visible; - + IBOutlet UIToolbar *_session_toolbar; + BOOL _session_toolbar_visible; + // dummy text field used to display the keyboard - IBOutlet UITextField* _dummy_textfield; - - // connecting view and the controls within that view - IBOutlet UIView* _connecting_view; - IBOutlet UILabel* _lbl_connecting; - IBOutlet UIActivityIndicatorView* _connecting_indicator_view; - IBOutlet UIButton* _cancel_connect_button; - - // extended keyboard toolbar - UIToolbar* _keyboard_toolbar; - - // rdp session - RDPSession* _session; - BOOL _session_initilized; - + IBOutlet UITextField *_dummy_textfield; + + // connecting view and the controls within that view + IBOutlet UIView *_connecting_view; + IBOutlet UILabel *_lbl_connecting; + IBOutlet UIActivityIndicatorView *_connecting_indicator_view; + IBOutlet UIButton *_cancel_connect_button; + + // extended keyboard toolbar + UIToolbar *_keyboard_toolbar; + + // rdp session + RDPSession *_session; + BOOL _session_initilized; + // flag that indicates whether the keyboard is visible or not BOOL _keyboard_visible; - - // flag to switch between left/right mouse button mode - BOOL _toggle_mouse_button; - - // keyboard extension view - AdvancedKeyboardView* _advanced_keyboard_view; - BOOL _advanced_keyboard_visible; - BOOL _requesting_advanced_keyboard; - CGFloat _keyboard_last_height; - - // delayed mouse move event sending - NSTimer* _mouse_move_event_timer; - int _mouse_move_events_skipped; - CGPoint _prev_long_press_position; + + // flag to switch between left/right mouse button mode + BOOL _toggle_mouse_button; + + // keyboard extension view + AdvancedKeyboardView *_advanced_keyboard_view; + BOOL _advanced_keyboard_visible; + BOOL _requesting_advanced_keyboard; + CGFloat _keyboard_last_height; + + // delayed mouse move event sending + NSTimer *_mouse_move_event_timer; + int _mouse_move_events_skipped; + CGPoint _prev_long_press_position; } -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil session:(RDPSession*)session; +- (id)initWithNibName:(NSString *)nibNameOrNil + bundle:(NSBundle *)nibBundleOrNil + session:(RDPSession *)session; @end diff --git a/client/iOS/Controllers/RDPSessionViewController.m b/client/iOS/Controllers/RDPSessionViewController.m index c312cef96..257f70af8 100644 --- a/client/iOS/Controllers/RDPSessionViewController.m +++ b/client/iOS/Controllers/RDPSessionViewController.m @@ -1,10 +1,11 @@ /* RDP Session View Controller - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @@ -23,489 +24,539 @@ #define AUTOSCROLLTIMEOUT 0.05 @interface RDPSessionViewController (Private) --(void)showSessionToolbar:(BOOL)show; --(UIToolbar*)keyboardToolbar; --(void)initGestureRecognizers; +- (void)showSessionToolbar:(BOOL)show; +- (UIToolbar *)keyboardToolbar; +- (void)initGestureRecognizers; - (void)suspendSession; -- (NSDictionary*)eventDescriptorForMouseEvent:(int)event position:(CGPoint)position; +- (NSDictionary *)eventDescriptorForMouseEvent:(int)event position:(CGPoint)position; - (void)handleMouseMoveForPosition:(CGPoint)position; @end - @implementation RDPSessionViewController #pragma mark class methods -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil session:(RDPSession *)session +- (id)initWithNibName:(NSString *)nibNameOrNil + bundle:(NSBundle *)nibBundleOrNil + session:(RDPSession *)session { - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) - { - _session = [session retain]; - [_session setDelegate:self]; - _session_initilized = NO; - - _mouse_move_events_skipped = 0; - _mouse_move_event_timer = nil; + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) + { + _session = [session retain]; + [_session setDelegate:self]; + _session_initilized = NO; - _advanced_keyboard_view = nil; - _advanced_keyboard_visible = NO; - _requesting_advanced_keyboard = NO; + _mouse_move_events_skipped = 0; + _mouse_move_event_timer = nil; + + _advanced_keyboard_view = nil; + _advanced_keyboard_visible = NO; + _requesting_advanced_keyboard = NO; _keyboard_last_height = 0; - _session_toolbar_visible = NO; - - _toggle_mouse_button = NO; - - _autoscroll_with_touchpointer = [[NSUserDefaults standardUserDefaults] boolForKey:@"ui.auto_scroll_touchpointer"]; - _is_autoscrolling = NO; - - [UIView setAnimationDelegate:self]; - [UIView setAnimationDidStopSelector:@selector(animationStopped:finished:context:)]; - } - - return self; + _session_toolbar_visible = NO; + + _toggle_mouse_button = NO; + + _autoscroll_with_touchpointer = + [[NSUserDefaults standardUserDefaults] boolForKey:@"ui.auto_scroll_touchpointer"]; + _is_autoscrolling = NO; + + [UIView setAnimationDelegate:self]; + [UIView setAnimationDidStopSelector:@selector(animationStopped:finished:context:)]; + } + + return self; } // Implement loadView to create a view hierarchy programmatically, without using a nib. -- (void)loadView +- (void)loadView { // load default view and set background color and resizing mask [super loadView]; - // init keyboard handling vars - _keyboard_visible = NO; + // init keyboard handling vars + _keyboard_visible = NO; - // init keyboard toolbar - _keyboard_toolbar = [[self keyboardToolbar] retain]; - [_dummy_textfield setInputAccessoryView:_keyboard_toolbar]; - - // init gesture recognizers - [self initGestureRecognizers]; - - // hide session toolbar - [_session_toolbar setFrame:CGRectMake(0.0, -TOOLBAR_HEIGHT, [[self view] bounds].size.width, TOOLBAR_HEIGHT)]; + // init keyboard toolbar + _keyboard_toolbar = [[self keyboardToolbar] retain]; + [_dummy_textfield setInputAccessoryView:_keyboard_toolbar]; + + // init gesture recognizers + [self initGestureRecognizers]; + + // hide session toolbar + [_session_toolbar + setFrame:CGRectMake(0.0, -TOOLBAR_HEIGHT, [[self view] bounds].size.width, TOOLBAR_HEIGHT)]; } - // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad +- (void)viewDidLoad { - [super viewDidLoad]; + [super viewDidLoad]; } - -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return YES; +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; } - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { - if (![_touchpointer_view isHidden]) - [_touchpointer_view ensurePointerIsVisible]; + if (![_touchpointer_view isHidden]) + [_touchpointer_view ensurePointerIsVisible]; } -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc. that aren't in use. +- (void)didReceiveMemoryWarning +{ + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Release any cached data, images, etc. that aren't in use. } -- (void)viewDidUnload { - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; +- (void)viewDidUnload +{ + [super viewDidUnload]; + // Release any retained subviews of the main view. + // e.g. self.myOutlet = nil; } -- (void)viewWillAppear:(BOOL)animated +- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - // hide navigation bar and (if enabled) the status bar - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"ui.hide_status_bar"]) - { - if(animated == YES) - [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]; - else - [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone]; - } - [[self navigationController] setNavigationBarHidden:YES animated:animated]; - - // if sesssion is suspended - notify that we got a new bitmap context - if ([_session isSuspended]) - [self sessionBitmapContextWillChange:_session]; + // hide navigation bar and (if enabled) the status bar + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"ui.hide_status_bar"]) + { + if (animated == YES) + [[UIApplication sharedApplication] setStatusBarHidden:YES + withAnimation:UIStatusBarAnimationSlide]; + else + [[UIApplication sharedApplication] setStatusBarHidden:YES + withAnimation:UIStatusBarAnimationNone]; + } + [[self navigationController] setNavigationBarHidden:YES animated:animated]; - // init keyboard - [[RDPKeyboard getSharedRDPKeyboard] initWithSession:_session delegate:self]; + // if sesssion is suspended - notify that we got a new bitmap context + if ([_session isSuspended]) + [self sessionBitmapContextWillChange:_session]; + + // init keyboard + [[RDPKeyboard getSharedRDPKeyboard] initWithSession:_session delegate:self]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; - - if (!_session_initilized) - { - if ([_session isSuspended]) - { - [_session resume]; - [self sessionBitmapContextDidChange:_session]; - [_session_view setNeedsDisplay]; - } - else - [_session connect]; - - _session_initilized = YES; - } + + if (!_session_initilized) + { + if ([_session isSuspended]) + { + [_session resume]; + [self sessionBitmapContextDidChange:_session]; + [_session_view setNeedsDisplay]; + } + else + [_session connect]; + + _session_initilized = YES; + } } -- (void)viewWillDisappear:(BOOL)animated +- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; + [super viewWillDisappear:animated]; - // show navigation and status bar again - if(animated == YES) - [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide]; + // show navigation and status bar again + if (animated == YES) + [[UIApplication sharedApplication] setStatusBarHidden:NO + withAnimation:UIStatusBarAnimationSlide]; else - [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone]; + [[UIApplication sharedApplication] setStatusBarHidden:NO + withAnimation:UIStatusBarAnimationNone]; [[self navigationController] setNavigationBarHidden:NO animated:animated]; - - // reset all modifier keys on rdp keyboard - [[RDPKeyboard getSharedRDPKeyboard] reset]; - + + // reset all modifier keys on rdp keyboard + [[RDPKeyboard getSharedRDPKeyboard] reset]; + // hide toolbar and keyboard - [self showSessionToolbar:NO]; + [self showSessionToolbar:NO]; [_dummy_textfield resignFirstResponder]; } +- (void)dealloc +{ + // remove any observers + [[NSNotificationCenter defaultCenter] removeObserver:self]; -- (void)dealloc { - // remove any observers - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - // the session lives on longer so set the delegate to nil - [_session setDelegate:nil]; + // the session lives on longer so set the delegate to nil + [_session setDelegate:nil]; - [_advanced_keyboard_view release]; - [_keyboard_toolbar release]; - [_session release]; - [super dealloc]; + [_advanced_keyboard_view release]; + [_keyboard_toolbar release]; + [_session release]; + [super dealloc]; } #pragma mark - #pragma mark ScrollView delegate methods - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView -{ - return _session_view; +{ + return _session_view; } --(void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale +- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView + withView:(UIView *)view + atScale:(float)scale { - NSLog(@"New zoom scale: %f", scale); + NSLog(@"New zoom scale: %f", scale); [_session_view setNeedsDisplay]; } #pragma mark - #pragma mark TextField delegate methods --(BOOL)textFieldShouldBeginEditing:(UITextField *)textField +- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField { _keyboard_visible = YES; - _advanced_keyboard_visible = NO; + _advanced_keyboard_visible = NO; return YES; } --(BOOL)textFieldShouldEndEditing:(UITextField *)textField +- (BOOL)textFieldShouldEndEditing:(UITextField *)textField { _keyboard_visible = NO; - _advanced_keyboard_visible = NO; + _advanced_keyboard_visible = NO; return YES; } -- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string -{ - if([string length] > 0) +- (BOOL)textField:(UITextField *)textField + shouldChangeCharactersInRange:(NSRange)range + replacementString:(NSString *)string +{ + if ([string length] > 0) { - for(int i = 0 ; i < [string length] ; i++) + for (int i = 0; i < [string length]; i++) { - unichar curChar = [string characterAtIndex:i]; + unichar curChar = [string characterAtIndex:i]; - // special handling for return/enter key - if(curChar == '\n') - [[RDPKeyboard getSharedRDPKeyboard] sendEnterKeyStroke]; - else - [[RDPKeyboard getSharedRDPKeyboard] sendUnicode:curChar]; + // special handling for return/enter key + if (curChar == '\n') + [[RDPKeyboard getSharedRDPKeyboard] sendEnterKeyStroke]; + else + [[RDPKeyboard getSharedRDPKeyboard] sendUnicode:curChar]; } } else { [[RDPKeyboard getSharedRDPKeyboard] sendBackspaceKeyStroke]; - } - + } + return NO; } #pragma mark - #pragma mark AdvancedKeyboardDelegate functions --(void)advancedKeyPressedVKey:(int)key +- (void)advancedKeyPressedVKey:(int)key { - [[RDPKeyboard getSharedRDPKeyboard] sendVirtualKeyCode:key]; + [[RDPKeyboard getSharedRDPKeyboard] sendVirtualKeyCode:key]; } --(void)advancedKeyPressedUnicode:(int)key +- (void)advancedKeyPressedUnicode:(int)key { - [[RDPKeyboard getSharedRDPKeyboard] sendUnicode:key]; + [[RDPKeyboard getSharedRDPKeyboard] sendUnicode:key]; } #pragma mark - RDP keyboard handler - (void)modifiersChangedForKeyboard:(RDPKeyboard *)keyboard { - UIBarButtonItem* curItem; - - // shift button (only on iPad) - int objectIdx = 0; - if (IsPad()) - { - objectIdx = 2; - curItem = (UIBarButtonItem*)[[_keyboard_toolbar items] objectAtIndex:objectIdx]; - [curItem setStyle:[keyboard shiftPressed] ? UIBarButtonItemStyleDone : UIBarButtonItemStyleBordered]; - } - - // ctrl button - objectIdx += 2; - curItem = (UIBarButtonItem*)[[_keyboard_toolbar items] objectAtIndex:objectIdx]; - [curItem setStyle:[keyboard ctrlPressed] ? UIBarButtonItemStyleDone : UIBarButtonItemStyleBordered]; - - // win button - objectIdx += 2; - curItem = (UIBarButtonItem*)[[_keyboard_toolbar items] objectAtIndex:objectIdx]; - [curItem setStyle:[keyboard winPressed] ? UIBarButtonItemStyleDone : UIBarButtonItemStyleBordered]; - - // alt button - objectIdx += 2; - curItem = (UIBarButtonItem*)[[_keyboard_toolbar items] objectAtIndex:objectIdx]; - [curItem setStyle:[keyboard altPressed] ? UIBarButtonItemStyleDone : UIBarButtonItemStyleBordered]; + UIBarButtonItem *curItem; + + // shift button (only on iPad) + int objectIdx = 0; + if (IsPad()) + { + objectIdx = 2; + curItem = (UIBarButtonItem *)[[_keyboard_toolbar items] objectAtIndex:objectIdx]; + [curItem setStyle:[keyboard shiftPressed] ? UIBarButtonItemStyleDone + : UIBarButtonItemStyleBordered]; + } + + // ctrl button + objectIdx += 2; + curItem = (UIBarButtonItem *)[[_keyboard_toolbar items] objectAtIndex:objectIdx]; + [curItem + setStyle:[keyboard ctrlPressed] ? UIBarButtonItemStyleDone : UIBarButtonItemStyleBordered]; + + // win button + objectIdx += 2; + curItem = (UIBarButtonItem *)[[_keyboard_toolbar items] objectAtIndex:objectIdx]; + [curItem + setStyle:[keyboard winPressed] ? UIBarButtonItemStyleDone : UIBarButtonItemStyleBordered]; + + // alt button + objectIdx += 2; + curItem = (UIBarButtonItem *)[[_keyboard_toolbar items] objectAtIndex:objectIdx]; + [curItem + setStyle:[keyboard altPressed] ? UIBarButtonItemStyleDone : UIBarButtonItemStyleBordered]; } #pragma mark - #pragma mark RDPSessionDelegate functions -- (void)session:(RDPSession*)session didFailToConnect:(int)reason +- (void)session:(RDPSession *)session didFailToConnect:(int)reason { - // remove and release connecting view - [_connecting_indicator_view stopAnimating]; - [_connecting_view removeFromSuperview]; - [_connecting_view autorelease]; + // remove and release connecting view + [_connecting_indicator_view stopAnimating]; + [_connecting_view removeFromSuperview]; + [_connecting_view autorelease]; - // return to bookmark list - [[self navigationController] popViewControllerAnimated:YES]; + // return to bookmark list + [[self navigationController] popViewControllerAnimated:YES]; } -- (void)sessionWillConnect:(RDPSession*)session +- (void)sessionWillConnect:(RDPSession *)session { - // load connecting view - [[NSBundle mainBundle] loadNibNamed:@"RDPConnectingView" owner:self options:nil]; - - // set strings - [_lbl_connecting setText:NSLocalizedString(@"Connecting", @"Connecting progress view - label")]; - [_cancel_connect_button setTitle:NSLocalizedString(@"Cancel", @"Cancel Button") forState:UIControlStateNormal]; - - // center view and give it round corners - [_connecting_view setCenter:[[self view] center]]; - [[_connecting_view layer] setCornerRadius:10]; + // load connecting view + [[NSBundle mainBundle] loadNibNamed:@"RDPConnectingView" owner:self options:nil]; - // display connecting view and start indicator - [[self view] addSubview:_connecting_view]; - [_connecting_indicator_view startAnimating]; + // set strings + [_lbl_connecting setText:NSLocalizedString(@"Connecting", @"Connecting progress view - label")]; + [_cancel_connect_button setTitle:NSLocalizedString(@"Cancel", @"Cancel Button") + forState:UIControlStateNormal]; + + // center view and give it round corners + [_connecting_view setCenter:[[self view] center]]; + [[_connecting_view layer] setCornerRadius:10]; + + // display connecting view and start indicator + [[self view] addSubview:_connecting_view]; + [_connecting_indicator_view startAnimating]; } -- (void)sessionDidConnect:(RDPSession*)session +- (void)sessionDidConnect:(RDPSession *)session { - // register keyboard notification handlers - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name: UIKeyboardWillShowNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name: UIKeyboardDidShowNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name: UIKeyboardWillHideNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name: UIKeyboardDidHideNotification object:nil]; + // register keyboard notification handlers + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardWillShow:) + name:UIKeyboardWillShowNotification + object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardDidShow:) + name:UIKeyboardDidShowNotification + object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardWillHide:) + name:UIKeyboardWillHideNotification + object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardDidHide:) + name:UIKeyboardDidHideNotification + object:nil]; - // remove and release connecting view - [_connecting_indicator_view stopAnimating]; - [_connecting_view removeFromSuperview]; - [_connecting_view autorelease]; - - // check if session settings changed ... - // The 2nd width check is to ignore changes in resolution settings due to the RDVH display bug (refer to RDPSEssion.m for more details) - ConnectionParams* orig_params = [session params]; - rdpSettings* sess_params = [session getSessionParams]; - if (([orig_params intForKey:@"width"] != sess_params->DesktopWidth && [orig_params intForKey:@"width"] != (sess_params->DesktopWidth + 1)) || - [orig_params intForKey:@"height"] != sess_params->DesktopHeight || [orig_params intForKey:@"colors"] != sess_params->ColorDepth) - { - // display notification that the session params have been changed by the server - NSString* message = [NSString stringWithFormat:NSLocalizedString(@"The server changed the screen settings to %dx%dx%d", @"Screen settings not supported message with width, height and colors parameter"), sess_params->DesktopWidth, sess_params->DesktopHeight, sess_params->ColorDepth]; - [[self view] makeToast:message duration:ToastDurationNormal position:@"bottom"]; - } + // remove and release connecting view + [_connecting_indicator_view stopAnimating]; + [_connecting_view removeFromSuperview]; + [_connecting_view autorelease]; + + // check if session settings changed ... + // The 2nd width check is to ignore changes in resolution settings due to the RDVH display bug + // (refer to RDPSEssion.m for more details) + ConnectionParams *orig_params = [session params]; + rdpSettings *sess_params = [session getSessionParams]; + if (([orig_params intForKey:@"width"] != sess_params->DesktopWidth && + [orig_params intForKey:@"width"] != (sess_params->DesktopWidth + 1)) || + [orig_params intForKey:@"height"] != sess_params->DesktopHeight || + [orig_params intForKey:@"colors"] != sess_params->ColorDepth) + { + // display notification that the session params have been changed by the server + NSString *message = + [NSString stringWithFormat:NSLocalizedString( + @"The server changed the screen settings to %dx%dx%d", + @"Screen settings not supported message with width, " + @"height and colors parameter"), + sess_params->DesktopWidth, sess_params->DesktopHeight, + sess_params->ColorDepth]; + [[self view] makeToast:message duration:ToastDurationNormal position:@"bottom"]; + } } -- (void)sessionWillDisconnect:(RDPSession*)session +- (void)sessionWillDisconnect:(RDPSession *)session { - } -- (void)sessionDidDisconnect:(RDPSession*)session +- (void)sessionDidDisconnect:(RDPSession *)session { - // return to bookmark list - [[self navigationController] popViewControllerAnimated:YES]; + // return to bookmark list + [[self navigationController] popViewControllerAnimated:YES]; } -- (void)sessionBitmapContextWillChange:(RDPSession*)session +- (void)sessionBitmapContextWillChange:(RDPSession *)session { - // calc new view frame - rdpSettings* sess_params = [session getSessionParams]; - CGRect view_rect = CGRectMake(0, 0, sess_params->DesktopWidth, sess_params->DesktopHeight); + // calc new view frame + rdpSettings *sess_params = [session getSessionParams]; + CGRect view_rect = CGRectMake(0, 0, sess_params->DesktopWidth, sess_params->DesktopHeight); - // reset zoom level and update content size - [_session_scrollview setZoomScale:1.0]; - [_session_scrollview setContentSize:view_rect.size]; + // reset zoom level and update content size + [_session_scrollview setZoomScale:1.0]; + [_session_scrollview setContentSize:view_rect.size]; - // set session view size - [_session_view setFrame:view_rect]; - - // show/hide toolbar - [_session setToolbarVisible:![[NSUserDefaults standardUserDefaults] boolForKey:@"ui.hide_tool_bar"]]; - [self showSessionToolbar:[_session toolbarVisible]]; + // set session view size + [_session_view setFrame:view_rect]; + + // show/hide toolbar + [_session + setToolbarVisible:![[NSUserDefaults standardUserDefaults] boolForKey:@"ui.hide_tool_bar"]]; + [self showSessionToolbar:[_session toolbarVisible]]; } -- (void)sessionBitmapContextDidChange:(RDPSession*)session +- (void)sessionBitmapContextDidChange:(RDPSession *)session { - // associate view with session - [_session_view setSession:session]; + // associate view with session + [_session_view setSession:session]; - // issue an update (this might be needed in case we had a resize for instance) - [_session_view setNeedsDisplay]; + // issue an update (this might be needed in case we had a resize for instance) + [_session_view setNeedsDisplay]; } -- (void)session:(RDPSession*)session needsRedrawInRect:(CGRect)rect +- (void)session:(RDPSession *)session needsRedrawInRect:(CGRect)rect { - [_session_view setNeedsDisplayInRect:rect]; + [_session_view setNeedsDisplayInRect:rect]; } - (void)session:(RDPSession *)session requestsAuthenticationWithParams:(NSMutableDictionary *)params { - CredentialsInputController* view_controller = [[[CredentialsInputController alloc] initWithNibName:@"CredentialsInputView" bundle:nil session:_session params:params] autorelease]; - [self presentModalViewController:view_controller animated:YES]; + CredentialsInputController *view_controller = + [[[CredentialsInputController alloc] initWithNibName:@"CredentialsInputView" + bundle:nil + session:_session + params:params] autorelease]; + [self presentModalViewController:view_controller animated:YES]; } - (void)session:(RDPSession *)session verifyCertificateWithParams:(NSMutableDictionary *)params { - VerifyCertificateController* view_controller = [[[VerifyCertificateController alloc] initWithNibName:@"VerifyCertificateView" bundle:nil session:_session params:params] autorelease]; - [self presentModalViewController:view_controller animated:YES]; + VerifyCertificateController *view_controller = + [[[VerifyCertificateController alloc] initWithNibName:@"VerifyCertificateView" + bundle:nil + session:_session + params:params] autorelease]; + [self presentModalViewController:view_controller animated:YES]; } -- (CGSize)sizeForFitScreenForSession:(RDPSession*)session +- (CGSize)sizeForFitScreenForSession:(RDPSession *)session { - if (IsPad()) - return [self view].bounds.size; - else - { - // on phones make a resolution that has a 16:10 ratio with the phone's height - CGSize size = [self view].bounds.size; - CGFloat maxSize = (size.width > size.height) ? size.width : size.height; - return CGSizeMake(maxSize * 1.6f, maxSize); - } + if (IsPad()) + return [self view].bounds.size; + else + { + // on phones make a resolution that has a 16:10 ratio with the phone's height + CGSize size = [self view].bounds.size; + CGFloat maxSize = (size.width > size.height) ? size.width : size.height; + return CGSizeMake(maxSize * 1.6f, maxSize); + } } #pragma mark - Keyboard Toolbar Handlers --(void)showAdvancedKeyboardAnimated +- (void)showAdvancedKeyboardAnimated { - // calc initial and final rect of the advanced keyboard view - CGRect rect = [[_keyboard_toolbar superview] bounds]; - rect.origin.y = [_keyboard_toolbar bounds].size.height; - rect.size.height -= rect.origin.y; - - // create new view (hidden) and add to host-view of keyboard toolbar - _advanced_keyboard_view = [[AdvancedKeyboardView alloc] initWithFrame:CGRectMake(rect.origin.x, - [[_keyboard_toolbar superview] bounds].size.height, - rect.size.width, rect.size.height) delegate:self]; - [[_keyboard_toolbar superview] addSubview:_advanced_keyboard_view]; - // we set autoresize to YES for the keyboard toolbar's superview so that our adv. keyboard view gets properly resized - [[_keyboard_toolbar superview] setAutoresizesSubviews:YES]; - - // show view with animation - [UIView beginAnimations:nil context:NULL]; - [_advanced_keyboard_view setFrame:rect]; - [UIView commitAnimations]; + // calc initial and final rect of the advanced keyboard view + CGRect rect = [[_keyboard_toolbar superview] bounds]; + rect.origin.y = [_keyboard_toolbar bounds].size.height; + rect.size.height -= rect.origin.y; + + // create new view (hidden) and add to host-view of keyboard toolbar + _advanced_keyboard_view = [[AdvancedKeyboardView alloc] + initWithFrame:CGRectMake(rect.origin.x, [[_keyboard_toolbar superview] bounds].size.height, + rect.size.width, rect.size.height) + delegate:self]; + [[_keyboard_toolbar superview] addSubview:_advanced_keyboard_view]; + // we set autoresize to YES for the keyboard toolbar's superview so that our adv. keyboard view + // gets properly resized + [[_keyboard_toolbar superview] setAutoresizesSubviews:YES]; + + // show view with animation + [UIView beginAnimations:nil context:NULL]; + [_advanced_keyboard_view setFrame:rect]; + [UIView commitAnimations]; } --(IBAction)toggleKeyboardWhenOtherVisible:(id)sender -{ - if(_advanced_keyboard_visible == NO) - { - [self showAdvancedKeyboardAnimated]; - } - else - { - // hide existing view - [UIView beginAnimations:@"hide_advanced_keyboard_view" context:NULL]; - CGRect rect = [_advanced_keyboard_view frame]; - rect.origin.y = [[_keyboard_toolbar superview] bounds].size.height; - [_advanced_keyboard_view setFrame:rect]; - [UIView commitAnimations]; - - // the view is released in the animationDidStop selector registered in init - } - - // toggle flag - _advanced_keyboard_visible = !_advanced_keyboard_visible; +- (IBAction)toggleKeyboardWhenOtherVisible:(id)sender +{ + if (_advanced_keyboard_visible == NO) + { + [self showAdvancedKeyboardAnimated]; + } + else + { + // hide existing view + [UIView beginAnimations:@"hide_advanced_keyboard_view" context:NULL]; + CGRect rect = [_advanced_keyboard_view frame]; + rect.origin.y = [[_keyboard_toolbar superview] bounds].size.height; + [_advanced_keyboard_view setFrame:rect]; + [UIView commitAnimations]; + + // the view is released in the animationDidStop selector registered in init + } + + // toggle flag + _advanced_keyboard_visible = !_advanced_keyboard_visible; } --(IBAction)toggleWinKey:(id)sender +- (IBAction)toggleWinKey:(id)sender { - [[RDPKeyboard getSharedRDPKeyboard] toggleWinKey]; + [[RDPKeyboard getSharedRDPKeyboard] toggleWinKey]; } --(IBAction)toggleShiftKey:(id)sender +- (IBAction)toggleShiftKey:(id)sender { - [[RDPKeyboard getSharedRDPKeyboard] toggleShiftKey]; + [[RDPKeyboard getSharedRDPKeyboard] toggleShiftKey]; } --(IBAction)toggleCtrlKey:(id)sender +- (IBAction)toggleCtrlKey:(id)sender { - [[RDPKeyboard getSharedRDPKeyboard] toggleCtrlKey]; + [[RDPKeyboard getSharedRDPKeyboard] toggleCtrlKey]; } --(IBAction)toggleAltKey:(id)sender +- (IBAction)toggleAltKey:(id)sender { - [[RDPKeyboard getSharedRDPKeyboard] toggleAltKey]; + [[RDPKeyboard getSharedRDPKeyboard] toggleAltKey]; } --(IBAction)pressEscKey:(id)sender +- (IBAction)pressEscKey:(id)sender { - [[RDPKeyboard getSharedRDPKeyboard] sendEscapeKeyStroke]; + [[RDPKeyboard getSharedRDPKeyboard] sendEscapeKeyStroke]; } #pragma mark - #pragma mark event handlers -- (void)animationStopped:(NSString*)animationID finished:(NSNumber*)finished context:(void*)context +- (void)animationStopped:(NSString *)animationID + finished:(NSNumber *)finished + context:(void *)context { - if ([animationID isEqualToString:@"hide_advanced_keyboard_view"]) - { - // cleanup advanced keyboard view - [_advanced_keyboard_view removeFromSuperview]; - [_advanced_keyboard_view autorelease]; - _advanced_keyboard_view = nil; - } + if ([animationID isEqualToString:@"hide_advanced_keyboard_view"]) + { + // cleanup advanced keyboard view + [_advanced_keyboard_view removeFromSuperview]; + [_advanced_keyboard_view autorelease]; + _advanced_keyboard_view = nil; + } } - (IBAction)switchSession:(id)sender { - [self suspendSession]; + [self suspendSession]; } - (IBAction)toggleKeyboard:(id)sender { - if(!_keyboard_visible) + if (!_keyboard_visible) [_dummy_textfield becomeFirstResponder]; else [_dummy_textfield resignFirstResponder]; @@ -513,471 +564,550 @@ - (IBAction)toggleExtKeyboard:(id)sender { - // if the sys kb is shown but not the advanced kb then toggle the advanced kb - if(_keyboard_visible && !_advanced_keyboard_visible) - [self toggleKeyboardWhenOtherVisible:nil]; - else - { - // if not visible request the advanced keyboard view - if(_advanced_keyboard_visible == NO) - _requesting_advanced_keyboard = YES; - [self toggleKeyboard:nil]; - } + // if the sys kb is shown but not the advanced kb then toggle the advanced kb + if (_keyboard_visible && !_advanced_keyboard_visible) + [self toggleKeyboardWhenOtherVisible:nil]; + else + { + // if not visible request the advanced keyboard view + if (_advanced_keyboard_visible == NO) + _requesting_advanced_keyboard = YES; + [self toggleKeyboard:nil]; + } } - (IBAction)toggleTouchPointer:(id)sender { - BOOL toggle_visibilty = ![_touchpointer_view isHidden]; - [_touchpointer_view setHidden:toggle_visibilty]; - if(toggle_visibilty) - [_session_scrollview setContentInset:UIEdgeInsetsZero]; - else - [_session_scrollview setContentInset:[_touchpointer_view getEdgeInsets]]; + BOOL toggle_visibilty = ![_touchpointer_view isHidden]; + [_touchpointer_view setHidden:toggle_visibilty]; + if (toggle_visibilty) + [_session_scrollview setContentInset:UIEdgeInsetsZero]; + else + [_session_scrollview setContentInset:[_touchpointer_view getEdgeInsets]]; } - (IBAction)disconnectSession:(id)sender { - [_session disconnect]; + [_session disconnect]; } - --(IBAction)cancelButtonPressed:(id)sender +- (IBAction)cancelButtonPressed:(id)sender { - [_session disconnect]; + [_session disconnect]; } #pragma mark - #pragma mark iOS Keyboard Notification Handlers // the keyboard is given in a portrait frame of reference -- (BOOL)isLandscape { - +- (BOOL)isLandscape +{ + UIInterfaceOrientation ori = [[UIApplication sharedApplication] statusBarOrientation]; - return ( ori == UIInterfaceOrientationLandscapeLeft || ori == UIInterfaceOrientationLandscapeRight ); - + return (ori == UIInterfaceOrientationLandscapeLeft || + ori == UIInterfaceOrientationLandscapeRight); } -- (void)shiftKeyboard: (NSNotification*)notification { - - CGRect keyboardEndFrame = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; - +- (void)shiftKeyboard:(NSNotification *)notification +{ + + CGRect keyboardEndFrame = + [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; + CGFloat previousHeight = _keyboard_last_height; - - if( [self isLandscape] ) { + + if ([self isLandscape]) + { // landscape has the keyboard based on x, so x can go negative _keyboard_last_height = keyboardEndFrame.size.width + keyboardEndFrame.origin.x; - } else { + } + else + { // portrait has the keyboard based on the difference of the height and the frames y. CGFloat height = [[UIScreen mainScreen] bounds].size.height; _keyboard_last_height = height - keyboardEndFrame.origin.y; } - + CGFloat shiftHeight = _keyboard_last_height - previousHeight; - + [UIView beginAnimations:nil context:NULL]; - [UIView setAnimationCurve:[[[notification userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]]; - [UIView setAnimationDuration:[[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]]; + [UIView setAnimationCurve:[[[notification userInfo] + objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]]; + [UIView + setAnimationDuration:[[[notification userInfo] + objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]]; CGRect frame = [_session_scrollview frame]; frame.size.height -= shiftHeight; [_session_scrollview setFrame:frame]; - [_touchpointer_view setFrame:frame]; + [_touchpointer_view setFrame:frame]; [UIView commitAnimations]; - } - (void)keyboardWillShow:(NSNotification *)notification { - [self shiftKeyboard: notification]; - - [_touchpointer_view ensurePointerIsVisible]; + [self shiftKeyboard:notification]; + + [_touchpointer_view ensurePointerIsVisible]; } - (void)keyboardDidShow:(NSNotification *)notification { - if(_requesting_advanced_keyboard) - { - [self showAdvancedKeyboardAnimated]; - _advanced_keyboard_visible = YES; - _requesting_advanced_keyboard = NO; - } + if (_requesting_advanced_keyboard) + { + [self showAdvancedKeyboardAnimated]; + _advanced_keyboard_visible = YES; + _requesting_advanced_keyboard = NO; + } } - (void)keyboardWillHide:(NSNotification *)notification { - - [self shiftKeyboard: notification]; - + + [self shiftKeyboard:notification]; } -- (void)keyboardDidHide:(NSNotification*)notification +- (void)keyboardDidHide:(NSNotification *)notification { - // release adanced keyboard view - if(_advanced_keyboard_visible == YES) - { - _advanced_keyboard_visible = NO; - [_advanced_keyboard_view removeFromSuperview]; - [_advanced_keyboard_view autorelease]; - _advanced_keyboard_view = nil; - } + // release adanced keyboard view + if (_advanced_keyboard_visible == YES) + { + _advanced_keyboard_visible = NO; + [_advanced_keyboard_view removeFromSuperview]; + [_advanced_keyboard_view autorelease]; + _advanced_keyboard_view = nil; + } } #pragma mark - #pragma mark Gesture handlers -- (void)handleSingleTap:(UITapGestureRecognizer*)gesture +- (void)handleSingleTap:(UITapGestureRecognizer *)gesture { CGPoint pos = [gesture locationInView:_session_view]; - if (_toggle_mouse_button) - { - [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetRightMouseButtonClickEvent(YES) position:pos]]; - [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetRightMouseButtonClickEvent(NO) position:pos]]; - } - else - { - [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(YES) position:pos]]; - [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(NO) position:pos]]; - } + if (_toggle_mouse_button) + { + [_session + sendInputEvent:[self eventDescriptorForMouseEvent:GetRightMouseButtonClickEvent(YES) + position:pos]]; + [_session + sendInputEvent:[self eventDescriptorForMouseEvent:GetRightMouseButtonClickEvent(NO) + position:pos]]; + } + else + { + [_session + sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(YES) + position:pos]]; + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(NO) + position:pos]]; + } - _toggle_mouse_button = NO; + _toggle_mouse_button = NO; } -- (void)handleDoubleTap:(UITapGestureRecognizer*)gesture +- (void)handleDoubleTap:(UITapGestureRecognizer *)gesture { - CGPoint pos = [gesture locationInView:_session_view]; - [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(YES) position:pos]]; - [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(NO) position:pos]]; - [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(YES) position:pos]]; - [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(NO) position:pos]]; - _toggle_mouse_button = NO; -} - -- (void)handleLongPress:(UILongPressGestureRecognizer*)gesture -{ CGPoint pos = [gesture locationInView:_session_view]; - - if([gesture state] == UIGestureRecognizerStateBegan) - [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(YES) position:pos]]; - else if([gesture state] == UIGestureRecognizerStateChanged) - [self handleMouseMoveForPosition:pos]; - else if([gesture state] == UIGestureRecognizerStateEnded) - [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(NO) position:pos]]; + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(YES) + position:pos]]; + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(NO) + position:pos]]; + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(YES) + position:pos]]; + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(NO) + position:pos]]; + _toggle_mouse_button = NO; } - -- (void)handleDoubleLongPress:(UILongPressGestureRecognizer*)gesture +- (void)handleLongPress:(UILongPressGestureRecognizer *)gesture { - // this point is mapped against the scroll view because we want to have relative movement to the screen/scrollview + CGPoint pos = [gesture locationInView:_session_view]; + + if ([gesture state] == UIGestureRecognizerStateBegan) + [_session + sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(YES) + position:pos]]; + else if ([gesture state] == UIGestureRecognizerStateChanged) + [self handleMouseMoveForPosition:pos]; + else if ([gesture state] == UIGestureRecognizerStateEnded) + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(NO) + position:pos]]; +} + +- (void)handleDoubleLongPress:(UILongPressGestureRecognizer *)gesture +{ + // this point is mapped against the scroll view because we want to have relative movement to the + // screen/scrollview CGPoint pos = [gesture locationInView:_session_scrollview]; - - if([gesture state] == UIGestureRecognizerStateBegan) - _prev_long_press_position = pos; - else if([gesture state] == UIGestureRecognizerStateChanged) - { - int delta = _prev_long_press_position.y - pos.y; - - if(delta > GetScrollGestureDelta()) - { - [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetMouseWheelEvent(YES) position:pos]]; - _prev_long_press_position = pos; - } - else if(delta < -GetScrollGestureDelta()) - { - [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetMouseWheelEvent(NO) position:pos]]; - _prev_long_press_position = pos; - } - } + + if ([gesture state] == UIGestureRecognizerStateBegan) + _prev_long_press_position = pos; + else if ([gesture state] == UIGestureRecognizerStateChanged) + { + int delta = _prev_long_press_position.y - pos.y; + + if (delta > GetScrollGestureDelta()) + { + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetMouseWheelEvent(YES) + position:pos]]; + _prev_long_press_position = pos; + } + else if (delta < -GetScrollGestureDelta()) + { + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetMouseWheelEvent(NO) + position:pos]]; + _prev_long_press_position = pos; + } + } } --(void)handleSingle2FingersTap:(UITapGestureRecognizer*)gesture +- (void)handleSingle2FingersTap:(UITapGestureRecognizer *)gesture { - _toggle_mouse_button = !_toggle_mouse_button; + _toggle_mouse_button = !_toggle_mouse_button; } --(void)handleSingle3FingersTap:(UITapGestureRecognizer*)gesture +- (void)handleSingle3FingersTap:(UITapGestureRecognizer *)gesture { - [_session setToolbarVisible:![_session toolbarVisible]]; - [self showSessionToolbar:[_session toolbarVisible]]; + [_session setToolbarVisible:![_session toolbarVisible]]; + [self showSessionToolbar:[_session toolbarVisible]]; } #pragma mark - #pragma mark Touch Pointer delegates // callback if touch pointer should be closed --(void)touchPointerClose +- (void)touchPointerClose { - [self toggleTouchPointer:nil]; + [self toggleTouchPointer:nil]; } // callback for a left click action --(void)touchPointerLeftClick:(CGPoint)pos down:(BOOL)down +- (void)touchPointerLeftClick:(CGPoint)pos down:(BOOL)down { - CGPoint session_view_pos = [_touchpointer_view convertPoint:pos toView:_session_view]; - [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(down) position:session_view_pos]]; + CGPoint session_view_pos = [_touchpointer_view convertPoint:pos toView:_session_view]; + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(down) + position:session_view_pos]]; } // callback for a right click action --(void)touchPointerRightClick:(CGPoint)pos down:(BOOL)down +- (void)touchPointerRightClick:(CGPoint)pos down:(BOOL)down { - CGPoint session_view_pos = [_touchpointer_view convertPoint:pos toView:_session_view]; - [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetRightMouseButtonClickEvent(down) position:session_view_pos]]; + CGPoint session_view_pos = [_touchpointer_view convertPoint:pos toView:_session_view]; + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetRightMouseButtonClickEvent(down) + position:session_view_pos]]; } - (void)doAutoScrolling { - int scrollX = 0; - int scrollY = 0; - CGPoint curPointerPos = [_touchpointer_view getPointerPosition]; - CGRect viewBounds = [_touchpointer_view bounds]; - CGRect scrollBounds = [_session_view bounds]; + int scrollX = 0; + int scrollY = 0; + CGPoint curPointerPos = [_touchpointer_view getPointerPosition]; + CGRect viewBounds = [_touchpointer_view bounds]; + CGRect scrollBounds = [_session_view bounds]; - // add content insets to scroll bounds - scrollBounds.size.width += [_session_scrollview contentInset].right; - scrollBounds.size.height += [_session_scrollview contentInset].bottom; - - // add zoom factor - scrollBounds.size.width *= [_session_scrollview zoomScale]; - scrollBounds.size.height *= [_session_scrollview zoomScale]; - - if (curPointerPos.x > (viewBounds.size.width - [_touchpointer_view getPointerWidth])) - scrollX = AUTOSCROLLDISTANCE; - else if (curPointerPos.x < 0) - scrollX = -AUTOSCROLLDISTANCE; + // add content insets to scroll bounds + scrollBounds.size.width += [_session_scrollview contentInset].right; + scrollBounds.size.height += [_session_scrollview contentInset].bottom; - if (curPointerPos.y > (viewBounds.size.height - [_touchpointer_view getPointerHeight])) - scrollY = AUTOSCROLLDISTANCE; - else if (curPointerPos.y < (_session_toolbar_visible ? TOOLBAR_HEIGHT : 0)) - scrollY = -AUTOSCROLLDISTANCE; + // add zoom factor + scrollBounds.size.width *= [_session_scrollview zoomScale]; + scrollBounds.size.height *= [_session_scrollview zoomScale]; - CGPoint newOffset = [_session_scrollview contentOffset]; - newOffset.x += scrollX; - newOffset.y += scrollY; + if (curPointerPos.x > (viewBounds.size.width - [_touchpointer_view getPointerWidth])) + scrollX = AUTOSCROLLDISTANCE; + else if (curPointerPos.x < 0) + scrollX = -AUTOSCROLLDISTANCE; - // if offset is going off screen - stop scrolling in that direction - if (newOffset.x < 0) - { - scrollX = 0; - newOffset.x = 0; - } - else if (newOffset.x > (scrollBounds.size.width - viewBounds.size.width)) - { - scrollX = 0; - newOffset.x = MAX(scrollBounds.size.width - viewBounds.size.width, 0); - } - if (newOffset.y < 0) - { - scrollY = 0; - newOffset.y = 0; - } - else if (newOffset.y > (scrollBounds.size.height - viewBounds.size.height)) - { - scrollY = 0; - newOffset.y = MAX(scrollBounds.size.height - viewBounds.size.height, 0); - } + if (curPointerPos.y > (viewBounds.size.height - [_touchpointer_view getPointerHeight])) + scrollY = AUTOSCROLLDISTANCE; + else if (curPointerPos.y < (_session_toolbar_visible ? TOOLBAR_HEIGHT : 0)) + scrollY = -AUTOSCROLLDISTANCE; - // perform scrolling - [_session_scrollview setContentOffset:newOffset]; + CGPoint newOffset = [_session_scrollview contentOffset]; + newOffset.x += scrollX; + newOffset.y += scrollY; - // continue scrolling? - if (scrollX != 0 || scrollY != 0) - [self performSelector:@selector(doAutoScrolling) withObject:nil afterDelay:AUTOSCROLLTIMEOUT]; - else - _is_autoscrolling = NO; + // if offset is going off screen - stop scrolling in that direction + if (newOffset.x < 0) + { + scrollX = 0; + newOffset.x = 0; + } + else if (newOffset.x > (scrollBounds.size.width - viewBounds.size.width)) + { + scrollX = 0; + newOffset.x = MAX(scrollBounds.size.width - viewBounds.size.width, 0); + } + if (newOffset.y < 0) + { + scrollY = 0; + newOffset.y = 0; + } + else if (newOffset.y > (scrollBounds.size.height - viewBounds.size.height)) + { + scrollY = 0; + newOffset.y = MAX(scrollBounds.size.height - viewBounds.size.height, 0); + } + + // perform scrolling + [_session_scrollview setContentOffset:newOffset]; + + // continue scrolling? + if (scrollX != 0 || scrollY != 0) + [self performSelector:@selector(doAutoScrolling) + withObject:nil + afterDelay:AUTOSCROLLTIMEOUT]; + else + _is_autoscrolling = NO; } // callback for a right click action --(void)touchPointerMove:(CGPoint)pos +- (void)touchPointerMove:(CGPoint)pos { - CGPoint session_view_pos = [_touchpointer_view convertPoint:pos toView:_session_view]; - [self handleMouseMoveForPosition:session_view_pos]; - - if (_autoscroll_with_touchpointer && !_is_autoscrolling) - { - _is_autoscrolling = YES; - [self performSelector:@selector(doAutoScrolling) withObject:nil afterDelay:AUTOSCROLLTIMEOUT]; - } + CGPoint session_view_pos = [_touchpointer_view convertPoint:pos toView:_session_view]; + [self handleMouseMoveForPosition:session_view_pos]; + + if (_autoscroll_with_touchpointer && !_is_autoscrolling) + { + _is_autoscrolling = YES; + [self performSelector:@selector(doAutoScrolling) + withObject:nil + afterDelay:AUTOSCROLLTIMEOUT]; + } } // callback if scrolling is performed --(void)touchPointerScrollDown:(BOOL)down -{ - [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetMouseWheelEvent(down) position:CGPointZero]]; +- (void)touchPointerScrollDown:(BOOL)down +{ + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetMouseWheelEvent(down) + position:CGPointZero]]; } // callback for toggling the standard keyboard --(void)touchPointerToggleKeyboard +- (void)touchPointerToggleKeyboard { - if(_advanced_keyboard_visible) - [self toggleKeyboardWhenOtherVisible:nil]; - else - [self toggleKeyboard:nil]; + if (_advanced_keyboard_visible) + [self toggleKeyboardWhenOtherVisible:nil]; + else + [self toggleKeyboard:nil]; } // callback for toggling the extended keyboard --(void)touchPointerToggleExtendedKeyboard +- (void)touchPointerToggleExtendedKeyboard { - [self toggleExtKeyboard:nil]; + [self toggleExtKeyboard:nil]; } // callback for reset view --(void)touchPointerResetSessionView +- (void)touchPointerResetSessionView { - [_session_scrollview setZoomScale:1.0 animated:YES]; + [_session_scrollview setZoomScale:1.0 animated:YES]; } @end - @implementation RDPSessionViewController (Private) #pragma mark - #pragma mark Helper functions --(void)showSessionToolbar:(BOOL)show +- (void)showSessionToolbar:(BOOL)show { - // already shown or hidden? - if (_session_toolbar_visible == show) - return; - - if(show) - { - [UIView beginAnimations:@"showToolbar" context:nil]; - [UIView setAnimationDuration:.4]; - [UIView setAnimationCurve:UIViewAnimationCurveLinear]; - [_session_toolbar setFrame:CGRectMake(0.0, 0.0, [[self view] bounds].size.width, TOOLBAR_HEIGHT)]; - [UIView commitAnimations]; - _session_toolbar_visible = YES; - } - else - { - [UIView beginAnimations:@"hideToolbar" context:nil]; - [UIView setAnimationDuration:.4]; - [UIView setAnimationCurve:UIViewAnimationCurveLinear]; - [_session_toolbar setFrame:CGRectMake(0.0, -TOOLBAR_HEIGHT, [[self view] bounds].size.width, TOOLBAR_HEIGHT)]; - [UIView commitAnimations]; - _session_toolbar_visible = NO; - } + // already shown or hidden? + if (_session_toolbar_visible == show) + return; + + if (show) + { + [UIView beginAnimations:@"showToolbar" context:nil]; + [UIView setAnimationDuration:.4]; + [UIView setAnimationCurve:UIViewAnimationCurveLinear]; + [_session_toolbar + setFrame:CGRectMake(0.0, 0.0, [[self view] bounds].size.width, TOOLBAR_HEIGHT)]; + [UIView commitAnimations]; + _session_toolbar_visible = YES; + } + else + { + [UIView beginAnimations:@"hideToolbar" context:nil]; + [UIView setAnimationDuration:.4]; + [UIView setAnimationCurve:UIViewAnimationCurveLinear]; + [_session_toolbar setFrame:CGRectMake(0.0, -TOOLBAR_HEIGHT, [[self view] bounds].size.width, + TOOLBAR_HEIGHT)]; + [UIView commitAnimations]; + _session_toolbar_visible = NO; + } } --(UIToolbar*)keyboardToolbar +- (UIToolbar *)keyboardToolbar { - UIToolbar* keyboard_toolbar = [[[UIToolbar alloc] initWithFrame:CGRectNull] autorelease]; + UIToolbar *keyboard_toolbar = [[[UIToolbar alloc] initWithFrame:CGRectNull] autorelease]; [keyboard_toolbar setBarStyle:UIBarStyleBlackOpaque]; - - UIBarButtonItem* esc_btn = [[[UIBarButtonItem alloc] initWithTitle:@"Esc" style:UIBarButtonItemStyleBordered target:self action:@selector(pressEscKey:)] autorelease]; - UIImage* win_icon = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"toolbar_icon_win" ofType:@"png"]]; - UIBarButtonItem* win_btn = [[[UIBarButtonItem alloc] initWithImage:win_icon style:UIBarButtonItemStyleBordered target:self action:@selector(toggleWinKey:)] autorelease]; - UIBarButtonItem* ctrl_btn = [[[UIBarButtonItem alloc] initWithTitle:@"Ctrl" style:UIBarButtonItemStyleBordered target:self action:@selector(toggleCtrlKey:)] autorelease]; - UIBarButtonItem* alt_btn = [[[UIBarButtonItem alloc] initWithTitle:@"Alt" style:UIBarButtonItemStyleBordered target:self action:@selector(toggleAltKey:)] autorelease]; - UIBarButtonItem* ext_btn = [[[UIBarButtonItem alloc] initWithTitle:@"Ext" style:UIBarButtonItemStyleBordered target:self action:@selector(toggleKeyboardWhenOtherVisible:)] autorelease]; - UIBarButtonItem* done_btn = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(toggleKeyboard:)] autorelease]; - UIBarButtonItem* flex_spacer = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease]; - - // iPad gets a shift button, iphone doesn't (there's just not enough space ...) - NSArray* items; - if(IsPad()) - { - UIBarButtonItem* shift_btn = [[[UIBarButtonItem alloc] initWithTitle:@"Shift" style:UIBarButtonItemStyleBordered target:self action:@selector(toggleShiftKey:)] autorelease]; - items = [NSArray arrayWithObjects:esc_btn, flex_spacer, - shift_btn, flex_spacer, - ctrl_btn, flex_spacer, - win_btn, flex_spacer, - alt_btn, flex_spacer, - ext_btn, flex_spacer, done_btn, nil]; - } - else - { - items = [NSArray arrayWithObjects:esc_btn, flex_spacer, ctrl_btn, flex_spacer, win_btn, flex_spacer, alt_btn, flex_spacer, ext_btn, flex_spacer, done_btn, nil]; - } - + + UIBarButtonItem *esc_btn = + [[[UIBarButtonItem alloc] initWithTitle:@"Esc" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(pressEscKey:)] autorelease]; + UIImage *win_icon = + [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"toolbar_icon_win" + ofType:@"png"]]; + UIBarButtonItem *win_btn = + [[[UIBarButtonItem alloc] initWithImage:win_icon + style:UIBarButtonItemStyleBordered + target:self + action:@selector(toggleWinKey:)] autorelease]; + UIBarButtonItem *ctrl_btn = + [[[UIBarButtonItem alloc] initWithTitle:@"Ctrl" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(toggleCtrlKey:)] autorelease]; + UIBarButtonItem *alt_btn = + [[[UIBarButtonItem alloc] initWithTitle:@"Alt" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(toggleAltKey:)] autorelease]; + UIBarButtonItem *ext_btn = [[[UIBarButtonItem alloc] + initWithTitle:@"Ext" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(toggleKeyboardWhenOtherVisible:)] autorelease]; + UIBarButtonItem *done_btn = [[[UIBarButtonItem alloc] + initWithBarButtonSystemItem:UIBarButtonSystemItemDone + target:self + action:@selector(toggleKeyboard:)] autorelease]; + UIBarButtonItem *flex_spacer = + [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace + target:nil + action:nil] autorelease]; + + // iPad gets a shift button, iphone doesn't (there's just not enough space ...) + NSArray *items; + if (IsPad()) + { + UIBarButtonItem *shift_btn = + [[[UIBarButtonItem alloc] initWithTitle:@"Shift" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(toggleShiftKey:)] autorelease]; + items = [NSArray arrayWithObjects:esc_btn, flex_spacer, shift_btn, flex_spacer, ctrl_btn, + flex_spacer, win_btn, flex_spacer, alt_btn, flex_spacer, + ext_btn, flex_spacer, done_btn, nil]; + } + else + { + items = [NSArray arrayWithObjects:esc_btn, flex_spacer, ctrl_btn, flex_spacer, win_btn, + flex_spacer, alt_btn, flex_spacer, ext_btn, flex_spacer, + done_btn, nil]; + } + [keyboard_toolbar setItems:items]; - [keyboard_toolbar sizeToFit]; - return keyboard_toolbar; + [keyboard_toolbar sizeToFit]; + return keyboard_toolbar; } - (void)initGestureRecognizers -{ - // single and double tap recognizer - UITapGestureRecognizer* doubleTapRecognizer = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)] autorelease]; - [doubleTapRecognizer setNumberOfTouchesRequired:1]; - [doubleTapRecognizer setNumberOfTapsRequired:2]; - - UITapGestureRecognizer* singleTapRecognizer = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)] autorelease]; - [singleTapRecognizer requireGestureRecognizerToFail:doubleTapRecognizer]; - [singleTapRecognizer setNumberOfTouchesRequired:1]; +{ + // single and double tap recognizer + UITapGestureRecognizer *doubleTapRecognizer = + [[[UITapGestureRecognizer alloc] initWithTarget:self + action:@selector(handleDoubleTap:)] autorelease]; + [doubleTapRecognizer setNumberOfTouchesRequired:1]; + [doubleTapRecognizer setNumberOfTapsRequired:2]; + + UITapGestureRecognizer *singleTapRecognizer = + [[[UITapGestureRecognizer alloc] initWithTarget:self + action:@selector(handleSingleTap:)] autorelease]; + [singleTapRecognizer requireGestureRecognizerToFail:doubleTapRecognizer]; + [singleTapRecognizer setNumberOfTouchesRequired:1]; [singleTapRecognizer setNumberOfTapsRequired:1]; - - // 2 fingers - tap recognizer - UITapGestureRecognizer* single2FingersTapRecognizer = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingle2FingersTap:)] autorelease]; - [single2FingersTapRecognizer setNumberOfTouchesRequired:2]; + + // 2 fingers - tap recognizer + UITapGestureRecognizer *single2FingersTapRecognizer = [[[UITapGestureRecognizer alloc] + initWithTarget:self + action:@selector(handleSingle2FingersTap:)] autorelease]; + [single2FingersTapRecognizer setNumberOfTouchesRequired:2]; [single2FingersTapRecognizer setNumberOfTapsRequired:1]; - + // long press gesture recognizer - UILongPressGestureRecognizer* longPressRecognizer = [[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)] autorelease]; + UILongPressGestureRecognizer *longPressRecognizer = [[[UILongPressGestureRecognizer alloc] + initWithTarget:self + action:@selector(handleLongPress:)] autorelease]; [longPressRecognizer setMinimumPressDuration:0.5]; - - // double long press gesture recognizer - UILongPressGestureRecognizer* doubleLongPressRecognizer = [[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleLongPress:)] autorelease]; - [doubleLongPressRecognizer setNumberOfTouchesRequired:2]; + + // double long press gesture recognizer + UILongPressGestureRecognizer *doubleLongPressRecognizer = [[[UILongPressGestureRecognizer alloc] + initWithTarget:self + action:@selector(handleDoubleLongPress:)] autorelease]; + [doubleLongPressRecognizer setNumberOfTouchesRequired:2]; [doubleLongPressRecognizer setMinimumPressDuration:0.5]; - - // 3 finger, single tap gesture for showing/hiding the toolbar - UITapGestureRecognizer* single3FingersTapRecognizer = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingle3FingersTap:)] autorelease]; - [single3FingersTapRecognizer setNumberOfTapsRequired:1]; - [single3FingersTapRecognizer setNumberOfTouchesRequired:3]; - - // add gestures to scroll view + + // 3 finger, single tap gesture for showing/hiding the toolbar + UITapGestureRecognizer *single3FingersTapRecognizer = [[[UITapGestureRecognizer alloc] + initWithTarget:self + action:@selector(handleSingle3FingersTap:)] autorelease]; + [single3FingersTapRecognizer setNumberOfTapsRequired:1]; + [single3FingersTapRecognizer setNumberOfTouchesRequired:3]; + + // add gestures to scroll view [_session_scrollview addGestureRecognizer:singleTapRecognizer]; [_session_scrollview addGestureRecognizer:doubleTapRecognizer]; [_session_scrollview addGestureRecognizer:single2FingersTapRecognizer]; [_session_scrollview addGestureRecognizer:longPressRecognizer]; [_session_scrollview addGestureRecognizer:doubleLongPressRecognizer]; - [_session_scrollview addGestureRecognizer:single3FingersTapRecognizer]; + [_session_scrollview addGestureRecognizer:single3FingersTapRecognizer]; } - (void)suspendSession { // suspend session and pop navigation controller - [_session suspend]; - - // pop current view controller - [[self navigationController] popViewControllerAnimated:YES]; + [_session suspend]; + + // pop current view controller + [[self navigationController] popViewControllerAnimated:YES]; } -- (NSDictionary*)eventDescriptorForMouseEvent:(int)event position:(CGPoint)position +- (NSDictionary *)eventDescriptorForMouseEvent:(int)event position:(CGPoint)position { - return [NSDictionary dictionaryWithObjectsAndKeys: - @"mouse", @"type", - [NSNumber numberWithUnsignedShort:event], @"flags", - [NSNumber numberWithUnsignedShort:lrintf(position.x)], @"coord_x", - [NSNumber numberWithUnsignedShort:lrintf(position.y)], @"coord_y", - nil]; + return [NSDictionary + dictionaryWithObjectsAndKeys:@"mouse", @"type", [NSNumber numberWithUnsignedShort:event], + @"flags", + [NSNumber numberWithUnsignedShort:lrintf(position.x)], + @"coord_x", + [NSNumber numberWithUnsignedShort:lrintf(position.y)], + @"coord_y", nil]; } -- (void)sendDelayedMouseEventWithTimer:(NSTimer*)timer +- (void)sendDelayedMouseEventWithTimer:(NSTimer *)timer { - _mouse_move_event_timer = nil; - NSDictionary* event = [timer userInfo]; - [_session sendInputEvent:event]; - [timer autorelease]; + _mouse_move_event_timer = nil; + NSDictionary *event = [timer userInfo]; + [_session sendInputEvent:event]; + [timer autorelease]; } - (void)handleMouseMoveForPosition:(CGPoint)position { - NSDictionary* event = [self eventDescriptorForMouseEvent:PTR_FLAGS_MOVE position:position]; - - // cancel pending mouse move events - [_mouse_move_event_timer invalidate]; - _mouse_move_events_skipped++; - - if (_mouse_move_events_skipped >= 5) - { - [_session sendInputEvent:event]; - _mouse_move_events_skipped = 0; - } - else - { - [_mouse_move_event_timer autorelease]; - _mouse_move_event_timer = [[NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(sendDelayedMouseEventWithTimer:) userInfo:event repeats:NO] retain]; - } + NSDictionary *event = [self eventDescriptorForMouseEvent:PTR_FLAGS_MOVE position:position]; + + // cancel pending mouse move events + [_mouse_move_event_timer invalidate]; + _mouse_move_events_skipped++; + + if (_mouse_move_events_skipped >= 5) + { + [_session sendInputEvent:event]; + _mouse_move_events_skipped = 0; + } + else + { + [_mouse_move_event_timer autorelease]; + _mouse_move_event_timer = + [[NSTimer scheduledTimerWithTimeInterval:0.05 + target:self + selector:@selector(sendDelayedMouseEventWithTimer:) + userInfo:event + repeats:NO] retain]; + } } @end diff --git a/client/iOS/Controllers/ScreenSelectionController.h b/client/iOS/Controllers/ScreenSelectionController.h index 3ccf973da..a4d8f9bab 100644 --- a/client/iOS/Controllers/ScreenSelectionController.h +++ b/client/iOS/Controllers/ScreenSelectionController.h @@ -1,10 +1,11 @@ /* controller for screen settings selection - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "EditorBaseController.h" @@ -14,20 +15,20 @@ @interface ScreenSelectionController : EditorBaseController { -@private - NSString* _keyPath; - ConnectionParams* _params; - - // avaiable options - OrderedDictionary* _color_options; - NSArray* _resolution_modes; + @private + NSString *_keyPath; + ConnectionParams *_params; - // current selections - int _selection_color; - int _selection_resolution; + // avaiable options + OrderedDictionary *_color_options; + NSArray *_resolution_modes; + + // current selections + int _selection_color; + int _selection_resolution; } -- (id)initWithConnectionParams:(ConnectionParams*)params; -- (id)initWithConnectionParams:(ConnectionParams*)params keyPath:(NSString*)keyPath; +- (id)initWithConnectionParams:(ConnectionParams *)params; +- (id)initWithConnectionParams:(ConnectionParams *)params keyPath:(NSString *)keyPath; @end diff --git a/client/iOS/Controllers/ScreenSelectionController.m b/client/iOS/Controllers/ScreenSelectionController.m index 099e4c07f..cfe747dda 100644 --- a/client/iOS/Controllers/ScreenSelectionController.m +++ b/client/iOS/Controllers/ScreenSelectionController.m @@ -1,10 +1,11 @@ /* controller for screen settings selection - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "ScreenSelectionController.h" @@ -13,197 +14,213 @@ #import "ConnectionParams.h" @interface ScreenSelectionController (Private) --(NSString*)keyPathForKey:(NSString*)key; +- (NSString *)keyPathForKey:(NSString *)key; @end @implementation ScreenSelectionController -- (id)initWithConnectionParams:(ConnectionParams*)params +- (id)initWithConnectionParams:(ConnectionParams *)params { - return [self initWithConnectionParams:params keyPath:nil]; + return [self initWithConnectionParams:params keyPath:nil]; } -- (id)initWithConnectionParams:(ConnectionParams*)params keyPath:(NSString*)keyPath +- (id)initWithConnectionParams:(ConnectionParams *)params keyPath:(NSString *)keyPath { - self = [super initWithStyle:UITableViewStyleGrouped]; - if (self) - { - _params = [params retain]; - _keyPath = (keyPath != nil ? [keyPath retain] : nil); - - _color_options = (OrderedDictionary*)[SelectionForColorSetting() retain]; - _resolution_modes = [ResolutionModes() retain]; - - // init current selections - NSUInteger idx = [_color_options indexForValue:[NSNumber numberWithInt:[_params intForKeyPath:[self keyPathForKey:@"colors"]]]]; - _selection_color = (idx != NSNotFound) ? idx : 0; + self = [super initWithStyle:UITableViewStyleGrouped]; + if (self) + { + _params = [params retain]; + _keyPath = (keyPath != nil ? [keyPath retain] : nil); - idx = [_resolution_modes indexOfObject:ScreenResolutionDescription([_params intForKeyPath:[self keyPathForKey:@"screen_resolution_type"]], - [_params intForKeyPath:[self keyPathForKey:@"width"]], - [_params intForKeyPath:[self keyPathForKey:@"height"]])]; - _selection_resolution = (idx != NSNotFound) ? idx : 0; - } - return self; + _color_options = (OrderedDictionary *)[SelectionForColorSetting() retain]; + _resolution_modes = [ResolutionModes() retain]; + + // init current selections + NSUInteger idx = [_color_options + indexForValue:[NSNumber + numberWithInt:[_params + intForKeyPath:[self keyPathForKey:@"colors"]]]]; + _selection_color = (idx != NSNotFound) ? idx : 0; + + idx = [_resolution_modes + indexOfObject:ScreenResolutionDescription( + [_params + intForKeyPath:[self keyPathForKey:@"screen_resolution_type"]], + [_params intForKeyPath:[self keyPathForKey:@"width"]], + [_params intForKeyPath:[self keyPathForKey:@"height"]])]; + _selection_resolution = (idx != NSNotFound) ? idx : 0; + } + return self; } - (void)dealloc { - [super dealloc]; - [_params autorelease]; - [_keyPath autorelease]; - [_color_options autorelease]; - [_resolution_modes autorelease]; + [super dealloc]; + [_params autorelease]; + [_keyPath autorelease]; + [_color_options autorelease]; + [_resolution_modes autorelease]; } --(NSString*)keyPathForKey:(NSString*)key +- (NSString *)keyPathForKey:(NSString *)key { - if (_keyPath) - return [_keyPath stringByAppendingFormat:@".%@", key]; - return key; + if (_keyPath) + return [_keyPath stringByAppendingFormat:@".%@", key]; + return key; } #pragma mark - View lifecycle - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - // Return YES for supported orientations - return YES; + // Return YES for supported orientations + return YES; } #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 2; + return 2; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - // Return the number of rows in the section. - if (section == 0) - return [_color_options count]; - return [_resolution_modes count] + 2; // +2 for custom width/height input fields + // Return the number of rows in the section. + if (section == 0) + return [_color_options count]; + return [_resolution_modes count] + 2; // +2 for custom width/height input fields } -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell *cell = nil; - switch ([indexPath section]) - { - case 0: - cell = [self tableViewCellFromIdentifier:TableCellIdentifierMultiChoice]; - [[cell textLabel] setText:[_color_options keyAtIndex:[indexPath row]]]; - break; - - case 1: - if ([indexPath row] < [_resolution_modes count]) - { - cell = [self tableViewCellFromIdentifier:TableCellIdentifierMultiChoice]; - [[cell textLabel] setText:[_resolution_modes objectAtIndex:[indexPath row]]]; - } - else - cell = [self tableViewCellFromIdentifier:TableCellIdentifierText]; - break; - - default: - break; - } - - if ([indexPath section] == 1) - { - BOOL enabled = ([_params intForKeyPath:[self keyPathForKey:@"screen_resolution_type"]] == TSXScreenOptionCustom); - if ([indexPath row] == [_resolution_modes count]) - { - int value = [_params intForKeyPath:[self keyPathForKey:@"width"]]; - EditTextTableViewCell* textCell = (EditTextTableViewCell*)cell; - [[textCell label] setText:NSLocalizedString(@"Width", @"Custom Screen Width")]; - [[textCell textfield] setText:[NSString stringWithFormat:@"%d", value ? value : 800]]; - [[textCell textfield] setKeyboardType:UIKeyboardTypeNumberPad]; - [[textCell label] setEnabled:enabled]; - [[textCell textfield] setEnabled:enabled]; - [[textCell textfield] setTag:1]; - } - else if ([indexPath row] == ([_resolution_modes count] + 1)) - { - int value = [_params intForKeyPath:[self keyPathForKey:@"height"]]; - EditTextTableViewCell* textCell = (EditTextTableViewCell*)cell; - [[textCell label] setText:NSLocalizedString(@"Height", @"Custom Screen Height")]; - [[textCell textfield] setText:[NSString stringWithFormat:@"%d", value ? value : 600]]; - [[textCell textfield] setKeyboardType:UIKeyboardTypeNumberPad]; - [[textCell label] setEnabled:enabled]; - [[textCell textfield] setEnabled:enabled]; - [[textCell textfield] setTag:2]; - } - } - + UITableViewCell *cell = nil; + switch ([indexPath section]) + { + case 0: + cell = [self tableViewCellFromIdentifier:TableCellIdentifierMultiChoice]; + [[cell textLabel] setText:[_color_options keyAtIndex:[indexPath row]]]; + break; + + case 1: + if ([indexPath row] < [_resolution_modes count]) + { + cell = [self tableViewCellFromIdentifier:TableCellIdentifierMultiChoice]; + [[cell textLabel] setText:[_resolution_modes objectAtIndex:[indexPath row]]]; + } + else + cell = [self tableViewCellFromIdentifier:TableCellIdentifierText]; + break; + + default: + break; + } + + if ([indexPath section] == 1) + { + BOOL enabled = ([_params intForKeyPath:[self keyPathForKey:@"screen_resolution_type"]] == + TSXScreenOptionCustom); + if ([indexPath row] == [_resolution_modes count]) + { + int value = [_params intForKeyPath:[self keyPathForKey:@"width"]]; + EditTextTableViewCell *textCell = (EditTextTableViewCell *)cell; + [[textCell label] setText:NSLocalizedString(@"Width", @"Custom Screen Width")]; + [[textCell textfield] setText:[NSString stringWithFormat:@"%d", value ? value : 800]]; + [[textCell textfield] setKeyboardType:UIKeyboardTypeNumberPad]; + [[textCell label] setEnabled:enabled]; + [[textCell textfield] setEnabled:enabled]; + [[textCell textfield] setTag:1]; + } + else if ([indexPath row] == ([_resolution_modes count] + 1)) + { + int value = [_params intForKeyPath:[self keyPathForKey:@"height"]]; + EditTextTableViewCell *textCell = (EditTextTableViewCell *)cell; + [[textCell label] setText:NSLocalizedString(@"Height", @"Custom Screen Height")]; + [[textCell textfield] setText:[NSString stringWithFormat:@"%d", value ? value : 600]]; + [[textCell textfield] setKeyboardType:UIKeyboardTypeNumberPad]; + [[textCell label] setEnabled:enabled]; + [[textCell textfield] setEnabled:enabled]; + [[textCell textfield] setTag:2]; + } + } + // set default checkmark - if([indexPath row] == ([indexPath section] == 0 ? _selection_color : _selection_resolution)) + if ([indexPath row] == ([indexPath section] == 0 ? _selection_color : _selection_resolution)) [cell setAccessoryType:UITableViewCellAccessoryCheckmark]; else [cell setAccessoryType:UITableViewCellAccessoryNone]; - - return cell; + + return cell; } #pragma mark - Table view delegate - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - // custom widht/height cells are not selectable - if ([indexPath section] == 1 && [indexPath row] >= [_resolution_modes count]) - return; - + // custom widht/height cells are not selectable + if ([indexPath section] == 1 && [indexPath row] >= [_resolution_modes count]) + return; + // has selection change? - int cur_selection = ([indexPath section] == 0 ? _selection_color : _selection_resolution); - if([indexPath row] != cur_selection) + int cur_selection = ([indexPath section] == 0 ? _selection_color : _selection_resolution); + if ([indexPath row] != cur_selection) { [tableView deselectRowAtIndexPath:indexPath animated:NO]; - - NSIndexPath* oldIndexPath = [NSIndexPath indexPathForRow:cur_selection inSection:[indexPath section]]; - - // clear old checkmark - UITableViewCell* old_sel_cell = [tableView cellForRowAtIndexPath:oldIndexPath]; - old_sel_cell.accessoryType = UITableViewCellAccessoryNone; - - // set new checkmark - UITableViewCell* new_sel_cell = [tableView cellForRowAtIndexPath:indexPath]; - new_sel_cell.accessoryType = UITableViewCellAccessoryCheckmark; - - if ([indexPath section] == 0) - { - // get value from color dictionary - int sel_value = [[_color_options valueForKey:[_color_options keyAtIndex:[indexPath row]]] intValue]; - - // update selection index and params value - [_params setInt:sel_value forKeyPath:[self keyPathForKey:@"colors"]]; - _selection_color = [indexPath row]; - } - else - { - // update selection index and params value - int width, height; - TSXScreenOptions mode; - ScanScreenResolution([_resolution_modes objectAtIndex:[indexPath row]], &width, &height, &mode); - [_params setInt:mode forKeyPath:[self keyPathForKey:@"screen_resolution_type"]]; - if (mode != TSXScreenOptionCustom) - { - [_params setInt:width forKeyPath:[self keyPathForKey:@"width"]]; - [_params setInt:height forKeyPath:[self keyPathForKey:@"height"]]; - } - _selection_resolution = [indexPath row]; - // refresh width/height edit fields if custom selection changed - NSArray* indexPaths = [NSArray arrayWithObjects:[NSIndexPath indexPathForRow:[_resolution_modes count] inSection:1], - [NSIndexPath indexPathForRow:([_resolution_modes count] + 1) inSection:1], nil]; - [[self tableView] reloadRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone]; - } - } + NSIndexPath *oldIndexPath = [NSIndexPath indexPathForRow:cur_selection + inSection:[indexPath section]]; + + // clear old checkmark + UITableViewCell *old_sel_cell = [tableView cellForRowAtIndexPath:oldIndexPath]; + old_sel_cell.accessoryType = UITableViewCellAccessoryNone; + + // set new checkmark + UITableViewCell *new_sel_cell = [tableView cellForRowAtIndexPath:indexPath]; + new_sel_cell.accessoryType = UITableViewCellAccessoryCheckmark; + + if ([indexPath section] == 0) + { + // get value from color dictionary + int sel_value = + [[_color_options valueForKey:[_color_options keyAtIndex:[indexPath row]]] intValue]; + + // update selection index and params value + [_params setInt:sel_value forKeyPath:[self keyPathForKey:@"colors"]]; + _selection_color = [indexPath row]; + } + else + { + // update selection index and params value + int width, height; + TSXScreenOptions mode; + ScanScreenResolution([_resolution_modes objectAtIndex:[indexPath row]], &width, &height, + &mode); + [_params setInt:mode forKeyPath:[self keyPathForKey:@"screen_resolution_type"]]; + if (mode != TSXScreenOptionCustom) + { + [_params setInt:width forKeyPath:[self keyPathForKey:@"width"]]; + [_params setInt:height forKeyPath:[self keyPathForKey:@"height"]]; + } + _selection_resolution = [indexPath row]; + + // refresh width/height edit fields if custom selection changed + NSArray *indexPaths = [NSArray + arrayWithObjects:[NSIndexPath indexPathForRow:[_resolution_modes count] + inSection:1], + [NSIndexPath indexPathForRow:([_resolution_modes count] + 1) + inSection:1], + nil]; + [[self tableView] reloadRowsAtIndexPaths:indexPaths + withRowAnimation:UITableViewRowAnimationNone]; + } + } } #pragma mark - #pragma mark Text Field delegate -- (BOOL)textFieldShouldReturn:(UITextField*)textField +- (BOOL)textFieldShouldReturn:(UITextField *)textField { [textField resignFirstResponder]; return NO; @@ -211,20 +228,22 @@ - (BOOL)textFieldShouldEndEditing:(UITextField *)textField { - - switch([textField tag]) - { - // update resolution settings (and check for invalid input) + + switch ([textField tag]) + { + // update resolution settings (and check for invalid input) case 1: - if ([[textField text] intValue] < 640) [textField setText:@"640"]; + if ([[textField text] intValue] < 640) + [textField setText:@"640"]; [_params setInt:[[textField text] intValue] forKeyPath:[self keyPathForKey:@"width"]]; break; - + case 2: - if ([[textField text] intValue] < 480) [textField setText:@"480"]; + if ([[textField text] intValue] < 480) + [textField setText:@"480"]; [_params setInt:[[textField text] intValue] forKeyPath:[self keyPathForKey:@"height"]]; break; - + default: break; } diff --git a/client/iOS/Controllers/VerifyCertificateController.h b/client/iOS/Controllers/VerifyCertificateController.h index 78a0e7d5f..cc7453fa8 100644 --- a/client/iOS/Controllers/VerifyCertificateController.h +++ b/client/iOS/Controllers/VerifyCertificateController.h @@ -1,10 +1,11 @@ /* Certificate verification controller - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @@ -13,17 +14,20 @@ @interface VerifyCertificateController : UIViewController { -@private - IBOutlet UILabel* _label_issuer; - IBOutlet UIButton* _btn_accept; - IBOutlet UIButton* _btn_decline; - IBOutlet UILabel* _label_message; - IBOutlet UILabel* _label_for_issuer; + @private + IBOutlet UILabel *_label_issuer; + IBOutlet UIButton *_btn_accept; + IBOutlet UIButton *_btn_decline; + IBOutlet UILabel *_label_message; + IBOutlet UILabel *_label_for_issuer; - RDPSession* _session; - NSMutableDictionary* _params; + RDPSession *_session; + NSMutableDictionary *_params; } -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil session:(RDPSession*)session params:(NSMutableDictionary*)params; +- (id)initWithNibName:(NSString *)nibNameOrNil + bundle:(NSBundle *)nibBundleOrNil + session:(RDPSession *)session + params:(NSMutableDictionary *)params; @end diff --git a/client/iOS/Controllers/VerifyCertificateController.m b/client/iOS/Controllers/VerifyCertificateController.m index d677868a6..c6412393f 100644 --- a/client/iOS/Controllers/VerifyCertificateController.m +++ b/client/iOS/Controllers/VerifyCertificateController.m @@ -1,10 +1,11 @@ /* Certificate verification controller - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "VerifyCertificateController.h" @@ -12,68 +13,74 @@ @implementation VerifyCertificateController -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil session:(RDPSession *)session params:(NSMutableDictionary *)params +- (id)initWithNibName:(NSString *)nibNameOrNil + bundle:(NSBundle *)nibBundleOrNil + session:(RDPSession *)session + params:(NSMutableDictionary *)params { - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - _session = session; - _params = params; - [self setModalPresentationStyle:UIModalPresentationFormSheet]; - } - return self; + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) + { + _session = session; + _params = params; + [self setModalPresentationStyle:UIModalPresentationFormSheet]; + } + return self; } - (void)viewDidLoad { - [super viewDidLoad]; + [super viewDidLoad]; - NSString* message = NSLocalizedString(@"The identity of the remote computer cannot be verified. Do you want to connect anyway?", @"Verify certificate view message"); - - // init strings - [_label_message setText:message]; - [_label_for_issuer setText:NSLocalizedString(@"Issuer:", @"Verify certificate view issuer label")]; - [_btn_accept setTitle:NSLocalizedString(@"Yes", @"Yes Button") forState:UIControlStateNormal]; - [_btn_decline setTitle:NSLocalizedString(@"No", @"No Button") forState:UIControlStateNormal]; + NSString *message = NSLocalizedString( + @"The identity of the remote computer cannot be verified. Do you want to connect anyway?", + @"Verify certificate view message"); - [_label_issuer setText:[_params valueForKey:@"issuer"]]; + // init strings + [_label_message setText:message]; + [_label_for_issuer + setText:NSLocalizedString(@"Issuer:", @"Verify certificate view issuer label")]; + [_btn_accept setTitle:NSLocalizedString(@"Yes", @"Yes Button") forState:UIControlStateNormal]; + [_btn_decline setTitle:NSLocalizedString(@"No", @"No Button") forState:UIControlStateNormal]; + + [_label_issuer setText:[_params valueForKey:@"issuer"]]; } - (void)viewDidUnload { - [super viewDidUnload]; - // Release any retained subviews of the main view. + [super viewDidUnload]; + // Release any retained subviews of the main view. } - (void)viewDidDisappear:(BOOL)animated { - [super viewDidDisappear:animated]; + [super viewDidDisappear:animated]; - // set signal - [[_session uiRequestCompleted] signal]; + // set signal + [[_session uiRequestCompleted] signal]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return YES; + return YES; } - #pragma mark - Action handlers - (IBAction)acceptPressed:(id)sender { - [_params setValue:[NSNumber numberWithBool:YES] forKey:@"result"]; - - // dismiss controller - [self dismissModalViewControllerAnimated:YES]; + [_params setValue:[NSNumber numberWithBool:YES] forKey:@"result"]; + + // dismiss controller + [self dismissModalViewControllerAnimated:YES]; } - (IBAction)declinePressed:(id)sender { - [_params setValue:[NSNumber numberWithBool:NO] forKey:@"result"]; - - // dismiss controller - [self dismissModalViewControllerAnimated:YES]; + [_params setValue:[NSNumber numberWithBool:NO] forKey:@"result"]; + + // dismiss controller + [self dismissModalViewControllerAnimated:YES]; } @end diff --git a/client/iOS/FreeRDP/ios_freerdp.h b/client/iOS/FreeRDP/ios_freerdp.h index d374a321d..8cc7df5ed 100644 --- a/client/iOS/FreeRDP/ios_freerdp.h +++ b/client/iOS/FreeRDP/ios_freerdp.h @@ -1,10 +1,11 @@ /* RDP run-loop - + Copyright 2013 Thincast Technologies GmbH, Authors: Martin Fleisz, Dorian Johnson - + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @@ -18,40 +19,37 @@ // FreeRDP extended structs typedef struct mf_info mfInfo; - typedef struct mf_context { rdpContext _p; - - mfInfo* mfi; - rdpSettings* settings; -} mfContext; + mfInfo *mfi; + rdpSettings *settings; +} mfContext; struct mf_info { // RDP - freerdp* instance; - mfContext* context; - rdpContext* _context; - + freerdp *instance; + mfContext *context; + rdpContext *_context; + // UI - RDPSession* session; - + RDPSession *session; + // Graphics CGContextRef bitmap_context; - + // Events int event_pipe_producer, event_pipe_consumer; // Tracking connection state volatile TSXConnectionState connection_state; - volatile BOOL unwanted; // set when controlling Session no longer wants the connection to continue + volatile BOOL + unwanted; // set when controlling Session no longer wants the connection to continue }; - -#define MFI_FROM_INSTANCE(inst) (((mfContext*)((inst)->context))->mfi) - +#define MFI_FROM_INSTANCE(inst) (((mfContext *)((inst)->context))->mfi) enum MF_EXIT_CODE { @@ -59,17 +57,13 @@ enum MF_EXIT_CODE MF_EXIT_CONN_FAILED = 128, MF_EXIT_CONN_CANCELED = 129, - MF_EXIT_LOGON_TIMEOUT = 130, - + MF_EXIT_LOGON_TIMEOUT = 130, + MF_EXIT_UNKNOWN = 255 }; void ios_init_freerdp(void); void ios_uninit_freerdp(void); -freerdp* ios_freerdp_new(void); -int ios_run_freerdp(freerdp* instance); -void ios_freerdp_free(freerdp* instance); - - - - +freerdp *ios_freerdp_new(void); +int ios_run_freerdp(freerdp *instance); +void ios_freerdp_free(freerdp *instance); diff --git a/client/iOS/FreeRDP/ios_freerdp.m b/client/iOS/FreeRDP/ios_freerdp.m index 4e63da50e..295d769a8 100644 --- a/client/iOS/FreeRDP/ios_freerdp.m +++ b/client/iOS/FreeRDP/ios_freerdp.m @@ -4,7 +4,8 @@ Copyright 2013 Thincast Technologies GmbH, Authors: Martin Fleisz, Dorian Johnson This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @@ -27,94 +28,85 @@ #pragma mark Connection helpers -static void ios_OnChannelConnectedEventHandler( - void* context, - ChannelConnectedEventArgs* e) +static void ios_OnChannelConnectedEventHandler(void *context, ChannelConnectedEventArgs *e) { - rdpSettings* settings; - mfContext* afc; + rdpSettings *settings; + mfContext *afc; if (!context || !e) { - WLog_FATAL(TAG, "%s(context=%p, EventArgs=%p", - __FUNCTION__, context, (void*) e); + WLog_FATAL(TAG, "%s(context=%p, EventArgs=%p", __FUNCTION__, context, (void *)e); return; } - afc = (mfContext*) context; + afc = (mfContext *)context; settings = afc->_p.settings; if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) { if (settings->SoftwareGdi) { - gdi_graphics_pipeline_init(afc->_p.gdi, - (RdpgfxClientContext*) e->pInterface); + gdi_graphics_pipeline_init(afc->_p.gdi, (RdpgfxClientContext *)e->pInterface); } else { WLog_WARN(TAG, "GFX without software GDI requested. " - " This is not supported, add /gdi:sw"); + " This is not supported, add /gdi:sw"); } } } -static void ios_OnChannelDisconnectedEventHandler( - void* context, ChannelDisconnectedEventArgs* e) +static void ios_OnChannelDisconnectedEventHandler(void *context, ChannelDisconnectedEventArgs *e) { - rdpSettings* settings; - mfContext* afc; + rdpSettings *settings; + mfContext *afc; if (!context || !e) { - WLog_FATAL(TAG, "%s(context=%p, EventArgs=%p", - __FUNCTION__, context, (void*) e); + WLog_FATAL(TAG, "%s(context=%p, EventArgs=%p", __FUNCTION__, context, (void *)e); return; } - afc = (mfContext*) context; + afc = (mfContext *)context; settings = afc->_p.settings; if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) { if (settings->SoftwareGdi) { - gdi_graphics_pipeline_uninit(afc->_p.gdi, - (RdpgfxClientContext*) e->pInterface); + gdi_graphics_pipeline_uninit(afc->_p.gdi, (RdpgfxClientContext *)e->pInterface); } else { WLog_WARN(TAG, "GFX without software GDI requested. " - " This is not supported, add /gdi:sw"); + " This is not supported, add /gdi:sw"); } } } -static BOOL ios_pre_connect(freerdp* instance) +static BOOL ios_pre_connect(freerdp *instance) { int rc; - rdpSettings* settings; + rdpSettings *settings; if (!instance || !instance->settings) return FALSE; settings = instance->settings; - settings->AutoLogonEnabled = settings->Password - && (strlen(settings->Password) > 0); + settings->AutoLogonEnabled = settings->Password && (strlen(settings->Password) > 0); // Verify screen width/height are sane - if ((settings->DesktopWidth < 64) || (settings->DesktopHeight < 64) - || (settings->DesktopWidth > 4096) || (settings->DesktopHeight > 4096)) + if ((settings->DesktopWidth < 64) || (settings->DesktopHeight < 64) || + (settings->DesktopWidth > 4096) || (settings->DesktopHeight > 4096)) { NSLog(@"%s: invalid dimensions %d %d", __func__, settings->DesktopWidth, settings->DesktopHeight); return FALSE; } - rc = PubSub_SubscribeChannelConnected( - instance->context->pubSub, - ios_OnChannelConnectedEventHandler); + rc = PubSub_SubscribeChannelConnected(instance->context->pubSub, + ios_OnChannelConnectedEventHandler); if (rc != CHANNEL_RC_OK) { @@ -122,9 +114,8 @@ static BOOL ios_pre_connect(freerdp* instance) return FALSE; } - rc = PubSub_SubscribeChannelDisconnected( - instance->context->pubSub, - ios_OnChannelDisconnectedEventHandler); + rc = PubSub_SubscribeChannelDisconnected(instance->context->pubSub, + ios_OnChannelDisconnectedEventHandler); if (rc != CHANNEL_RC_OK) { @@ -132,8 +123,7 @@ static BOOL ios_pre_connect(freerdp* instance) return FALSE; } - if (!freerdp_client_load_addins(instance->context->channels, - instance->settings)) + if (!freerdp_client_load_addins(instance->context->channels, instance->settings)) { WLog_ERR(TAG, "Failed to load addins [%l08X]", GetLastError()); return FALSE; @@ -142,7 +132,7 @@ static BOOL ios_pre_connect(freerdp* instance) return TRUE; } -static BOOL ios_Pointer_New(rdpContext* context, rdpPointer* pointer) +static BOOL ios_Pointer_New(rdpContext *context, rdpPointer *pointer) { if (!context || !pointer || !context->gdi) return FALSE; @@ -150,14 +140,13 @@ static BOOL ios_Pointer_New(rdpContext* context, rdpPointer* pointer) return TRUE; } -static void ios_Pointer_Free(rdpContext* context, rdpPointer* pointer) +static void ios_Pointer_Free(rdpContext *context, rdpPointer *pointer) { if (!context || !pointer) return; } -static BOOL ios_Pointer_Set(rdpContext* context, - const rdpPointer* pointer) +static BOOL ios_Pointer_Set(rdpContext *context, const rdpPointer *pointer) { if (!context) return FALSE; @@ -165,8 +154,7 @@ static BOOL ios_Pointer_Set(rdpContext* context, return TRUE; } -static BOOL ios_Pointer_SetPosition(rdpContext* context, - UINT32 x, UINT32 y) +static BOOL ios_Pointer_SetPosition(rdpContext *context, UINT32 x, UINT32 y) { if (!context) return FALSE; @@ -174,7 +162,7 @@ static BOOL ios_Pointer_SetPosition(rdpContext* context, return TRUE; } -static BOOL ios_Pointer_SetNull(rdpContext* context) +static BOOL ios_Pointer_SetNull(rdpContext *context) { if (!context) return FALSE; @@ -182,7 +170,7 @@ static BOOL ios_Pointer_SetNull(rdpContext* context) return TRUE; } -static BOOL ios_Pointer_SetDefault(rdpContext* context) +static BOOL ios_Pointer_SetDefault(rdpContext *context) { if (!context) return FALSE; @@ -190,7 +178,7 @@ static BOOL ios_Pointer_SetDefault(rdpContext* context) return TRUE; } -static BOOL ios_register_pointer(rdpGraphics* graphics) +static BOOL ios_register_pointer(rdpGraphics *graphics) { rdpPointer pointer; @@ -208,9 +196,9 @@ static BOOL ios_register_pointer(rdpGraphics* graphics) return TRUE; } -static BOOL ios_post_connect(freerdp* instance) +static BOOL ios_post_connect(freerdp *instance) { - mfInfo* mfi; + mfInfo *mfi; if (!instance) return FALSE; @@ -231,11 +219,12 @@ static BOOL ios_post_connect(freerdp* instance) instance->update->EndPaint = ios_ui_end_paint; instance->update->DesktopResize = ios_ui_resize_window; [mfi->session performSelectorOnMainThread:@selector(sessionDidConnect) - withObject:nil waitUntilDone:YES]; + withObject:nil + waitUntilDone:YES]; return TRUE; } -static void ios_post_disconnect(freerdp* instance) +static void ios_post_disconnect(freerdp *instance) { gdi_free(instance); } @@ -243,11 +232,11 @@ static void ios_post_disconnect(freerdp* instance) #pragma mark - #pragma mark Running the connection -int ios_run_freerdp(freerdp* instance) +int ios_run_freerdp(freerdp *instance) { - mfContext* context = (mfContext*)instance->context; - mfInfo* mfi = context->mfi; - rdpChannels* channels = instance->context->channels; + mfContext *context = (mfContext *)instance->context; + mfInfo *mfi = context->mfi; + rdpChannels *channels = instance->context->channels; mfi->connection_state = TSXConnectionConnecting; if (!freerdp_connect(instance)) @@ -261,14 +250,14 @@ int ios_run_freerdp(freerdp* instance) mfi->connection_state = TSXConnectionConnected; // Connection main loop - NSAutoreleasePool* pool; + NSAutoreleasePool *pool; int i; int fds; int max_fds; int rcount; int wcount; - void* rfds[32]; - void* wfds[32]; + void *rfds[32]; + void *wfds[32]; fd_set rfds_set; fd_set wfds_set; struct timeval timeout; @@ -287,8 +276,7 @@ int ios_run_freerdp(freerdp* instance) break; } - if (freerdp_channels_get_fds(channels, instance, rfds, &rcount, wfds, - &wcount) != TRUE) + if (freerdp_channels_get_fds(channels, instance, rfds, &rcount, wfds, &wcount) != TRUE) { NSLog(@"%s: freerdp_chanman_get_fds failed", __func__); break; @@ -329,9 +317,7 @@ int ios_run_freerdp(freerdp* instance) else if (select_status == -1) { /* these are not really errors */ - if (!((errno == EAGAIN) || - (errno == EWOULDBLOCK) || - (errno == EINPROGRESS) || + if (!((errno == EAGAIN) || (errno == EWOULDBLOCK) || (errno == EINPROGRESS) || (errno == EINTR))) /* signal occurred */ { NSLog(@"%s: select failed!", __func__); @@ -350,7 +336,7 @@ int ios_run_freerdp(freerdp* instance) if (ios_events_check_fds(mfi, &rfds_set) != TRUE) { // This event will fail when the app asks for a disconnect. - //NSLog(@"%s: ios_events_check_fds failed: terminating connection.", __func__); + // NSLog(@"%s: ios_events_check_fds failed: terminating connection.", __func__); break; } @@ -380,9 +366,9 @@ int ios_run_freerdp(freerdp* instance) #pragma mark - #pragma mark Context callbacks -static BOOL ios_client_new(freerdp* instance, rdpContext* context) +static BOOL ios_client_new(freerdp *instance, rdpContext *context) { - mfContext* ctx = (mfContext*)context; + mfContext *ctx = (mfContext *)context; if (!instance || !context) return FALSE; @@ -390,7 +376,7 @@ static BOOL ios_client_new(freerdp* instance, rdpContext* context) if ((ctx->mfi = calloc(1, sizeof(mfInfo))) == NULL) return FALSE; - ctx->mfi->context = (mfContext*)context; + ctx->mfi->context = (mfContext *)context; ctx->mfi->_context = context; ctx->mfi->context->settings = instance->settings; ctx->mfi->instance = instance; @@ -409,19 +395,19 @@ static BOOL ios_client_new(freerdp* instance, rdpContext* context) return TRUE; } -static void ios_client_free(freerdp* instance, rdpContext* context) +static void ios_client_free(freerdp *instance, rdpContext *context) { - mfInfo* mfi; + mfInfo *mfi; if (!context) return; - mfi = ((mfContext*) context)->mfi; + mfi = ((mfContext *)context)->mfi; ios_events_free_pipe(mfi); free(mfi); } -static int RdpClientEntry(RDP_CLIENT_ENTRY_POINTS* pEntryPoints) +static int RdpClientEntry(RDP_CLIENT_ENTRY_POINTS *pEntryPoints) { ZeroMemory(pEntryPoints, sizeof(RDP_CLIENT_ENTRY_POINTS)); pEntryPoints->Version = RDP_CLIENT_INTERFACE_VERSION; @@ -439,9 +425,9 @@ static int RdpClientEntry(RDP_CLIENT_ENTRY_POINTS* pEntryPoints) #pragma mark - #pragma mark Initialization and cleanup -freerdp* ios_freerdp_new() +freerdp *ios_freerdp_new() { - rdpContext* context; + rdpContext *context; RDP_CLIENT_ENTRY_POINTS clientEntryPoints; RdpClientEntry(&clientEntryPoints); context = freerdp_client_context_new(&clientEntryPoints); @@ -452,7 +438,7 @@ freerdp* ios_freerdp_new() return context->instance; } -void ios_freerdp_free(freerdp* instance) +void ios_freerdp_free(freerdp *instance) { if (!instance || !instance->context) return; @@ -470,7 +456,7 @@ void ios_uninit_freerdp() } /* compatibilty functions */ -size_t fwrite$UNIX2003(const void* ptr, size_t size, size_t nmemb, FILE* stream) +size_t fwrite$UNIX2003(const void *ptr, size_t size, size_t nmemb, FILE *stream) { return fwrite(ptr, size, nmemb, stream); } diff --git a/client/iOS/FreeRDP/ios_freerdp_events.h b/client/iOS/FreeRDP/ios_freerdp_events.h index 630c6b21e..7caf327f0 100644 --- a/client/iOS/FreeRDP/ios_freerdp_events.h +++ b/client/iOS/FreeRDP/ios_freerdp_events.h @@ -1,10 +1,11 @@ /* - RDP event queuing - + RDP event queuing + Copyright 2013 Thincast Technologies GmbH, Author: Dorian Johnson - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #ifndef IOS_RDP_EVENT_H @@ -14,12 +15,13 @@ #import "ios_freerdp.h" // For UI: use to send events -BOOL ios_events_send(mfInfo* mfi, NSDictionary * event_description); +BOOL ios_events_send(mfInfo *mfi, NSDictionary *event_description); // For connection runloop: use to poll for queued input events -BOOL ios_events_get_fds(mfInfo* mfi, void ** read_fds, int * read_count, void ** write_fds, int * write_count); -BOOL ios_events_check_fds(mfInfo* mfi, fd_set* rfds); -BOOL ios_events_create_pipe(mfInfo* mfi); -void ios_events_free_pipe(mfInfo* mfi); +BOOL ios_events_get_fds(mfInfo *mfi, void **read_fds, int *read_count, void **write_fds, + int *write_count); +BOOL ios_events_check_fds(mfInfo *mfi, fd_set *rfds); +BOOL ios_events_create_pipe(mfInfo *mfi); +void ios_events_free_pipe(mfInfo *mfi); #endif /* IOS_RDP_EVENT_H */ diff --git a/client/iOS/FreeRDP/ios_freerdp_events.m b/client/iOS/FreeRDP/ios_freerdp_events.m index c3e7b5888..0685c42d9 100644 --- a/client/iOS/FreeRDP/ios_freerdp_events.m +++ b/client/iOS/FreeRDP/ios_freerdp_events.m @@ -1,10 +1,11 @@ /* - RDP event queuing - + RDP event queuing + Copyright 2013 Thincast Technologies GmbH, Author: Dorian Johnson - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #include "ios_freerdp_events.h" @@ -12,107 +13,114 @@ #pragma mark - #pragma mark Sending compacted input events (from main thread) -// While this function may be called from any thread that has an autorelease pool allocated, it is not threadsafe: caller is responsible for synchronization -BOOL ios_events_send(mfInfo* mfi, NSDictionary * event_description) -{ - NSData * encoded_description = [NSKeyedArchiver archivedDataWithRootObject:event_description]; - - if ([encoded_description length] > 32000 || (mfi->event_pipe_producer == -1) ) +// While this function may be called from any thread that has an autorelease pool allocated, it is +// not threadsafe: caller is responsible for synchronization +BOOL ios_events_send(mfInfo *mfi, NSDictionary *event_description) +{ + NSData *encoded_description = [NSKeyedArchiver archivedDataWithRootObject:event_description]; + + if ([encoded_description length] > 32000 || (mfi->event_pipe_producer == -1)) return FALSE; - + uint32_t archived_data_len = (uint32_t)[encoded_description length]; - - //NSLog(@"writing %d bytes to input event pipe", archived_data_len); - + + // NSLog(@"writing %d bytes to input event pipe", archived_data_len); + if (write(mfi->event_pipe_producer, &archived_data_len, 4) == -1) { NSLog(@"%s: Failed to write length descriptor to pipe.", __func__); return FALSE; } - + if (write(mfi->event_pipe_producer, [encoded_description bytes], archived_data_len) == -1) { - NSLog(@"%s: Failed to write %d bytes into the event queue (event type: %@).", __func__, (int)[encoded_description length], [event_description objectForKey:@"type"]); + NSLog(@"%s: Failed to write %d bytes into the event queue (event type: %@).", __func__, + (int)[encoded_description length], [event_description objectForKey:@"type"]); return FALSE; } - - return TRUE; -} + return TRUE; +} #pragma mark - #pragma mark Processing compacted input events (from connection thread runloop) -static BOOL ios_events_handle_event(mfInfo* mfi, NSDictionary * event_description) +static BOOL ios_events_handle_event(mfInfo *mfi, NSDictionary *event_description) { - NSString * event_type = [event_description objectForKey:@"type"]; + NSString *event_type = [event_description objectForKey:@"type"]; BOOL should_continue = TRUE; - freerdp* instance = mfi->instance; - + freerdp *instance = mfi->instance; + if ([event_type isEqualToString:@"mouse"]) - { - instance->input->MouseEvent(instance->input, - [[event_description objectForKey:@"flags"] unsignedShortValue], - [[event_description objectForKey:@"coord_x"] unsignedShortValue], - [[event_description objectForKey:@"coord_y"] unsignedShortValue]); + { + instance->input->MouseEvent( + instance->input, [[event_description objectForKey:@"flags"] unsignedShortValue], + [[event_description objectForKey:@"coord_x"] unsignedShortValue], + [[event_description objectForKey:@"coord_y"] unsignedShortValue]); } else if ([event_type isEqualToString:@"keyboard"]) { if ([[event_description objectForKey:@"subtype"] isEqualToString:@"scancode"]) - instance->input->KeyboardEvent(instance->input, - [[event_description objectForKey:@"flags"] unsignedShortValue], - [[event_description objectForKey:@"scancode"] unsignedShortValue]); + instance->input->KeyboardEvent( + instance->input, [[event_description objectForKey:@"flags"] unsignedShortValue], + [[event_description objectForKey:@"scancode"] unsignedShortValue]); else if ([[event_description objectForKey:@"subtype"] isEqualToString:@"unicode"]) - instance->input->UnicodeKeyboardEvent(instance->input, - [[event_description objectForKey:@"flags"] unsignedShortValue], - [[event_description objectForKey:@"unicode_char"] unsignedShortValue]); + instance->input->UnicodeKeyboardEvent( + instance->input, [[event_description objectForKey:@"flags"] unsignedShortValue], + [[event_description objectForKey:@"unicode_char"] unsignedShortValue]); else - NSLog(@"%s: doesn't know how to send keyboard input with subtype %@", __func__, [event_description objectForKey:@"subtype"]); + NSLog(@"%s: doesn't know how to send keyboard input with subtype %@", __func__, + [event_description objectForKey:@"subtype"]); } else if ([event_type isEqualToString:@"disconnect"]) should_continue = FALSE; else NSLog(@"%s: unrecognized event type: %@", __func__, event_type); - + return should_continue; } -BOOL ios_events_check_fds(mfInfo* mfi, fd_set* rfds) -{ - if ( (mfi->event_pipe_consumer == -1) || !FD_ISSET(mfi->event_pipe_consumer, rfds)) +BOOL ios_events_check_fds(mfInfo *mfi, fd_set *rfds) +{ + if ((mfi->event_pipe_consumer == -1) || !FD_ISSET(mfi->event_pipe_consumer, rfds)) return TRUE; - + uint32_t archived_data_length = 0; ssize_t bytes_read; - + // First, read the length of the blob bytes_read = read(mfi->event_pipe_consumer, &archived_data_length, 4); - + if (bytes_read == -1 || archived_data_length < 1 || archived_data_length > 32000) { - NSLog(@"%s: just read length descriptor. bytes_read=%ld, archived_data_length=%u", __func__, bytes_read, archived_data_length); + NSLog(@"%s: just read length descriptor. bytes_read=%ld, archived_data_length=%u", __func__, + bytes_read, archived_data_length); return FALSE; } - - //NSLog(@"reading %d bytes from input event pipe", archived_data_length); - - NSMutableData * archived_object_data = [[NSMutableData alloc] initWithLength:archived_data_length]; - bytes_read = read(mfi->event_pipe_consumer, [archived_object_data mutableBytes], archived_data_length); - + + // NSLog(@"reading %d bytes from input event pipe", archived_data_length); + + NSMutableData *archived_object_data = + [[NSMutableData alloc] initWithLength:archived_data_length]; + bytes_read = + read(mfi->event_pipe_consumer, [archived_object_data mutableBytes], archived_data_length); + if (bytes_read != archived_data_length) { - NSLog(@"%s: attempted to read data; read %ld bytes but wanted %d bytes.", __func__, bytes_read, archived_data_length); + NSLog(@"%s: attempted to read data; read %ld bytes but wanted %d bytes.", __func__, + bytes_read, archived_data_length); [archived_object_data release]; return FALSE; } - + id unarchived_object_data = [NSKeyedUnarchiver unarchiveObjectWithData:archived_object_data]; [archived_object_data release]; - + return ios_events_handle_event(mfi, unarchived_object_data); } -BOOL ios_events_get_fds(mfInfo* mfi, void ** read_fds, int * read_count, void ** write_fds, int * write_count) +BOOL ios_events_get_fds(mfInfo *mfi, void **read_fds, int *read_count, void **write_fds, + int *write_count) { read_fds[*read_count] = (void *)(long)(mfi->event_pipe_consumer); (*read_count)++; @@ -120,26 +128,26 @@ BOOL ios_events_get_fds(mfInfo* mfi, void ** read_fds, int * read_count, void ** } // Sets up the event pipe -BOOL ios_events_create_pipe(mfInfo* mfi) +BOOL ios_events_create_pipe(mfInfo *mfi) { int pipe_fds[2]; - + if (pipe(pipe_fds) == -1) { NSLog(@"%s: pipe failed.", __func__); return FALSE; } - + mfi->event_pipe_consumer = pipe_fds[0]; mfi->event_pipe_producer = pipe_fds[1]; return TRUE; } -void ios_events_free_pipe(mfInfo* mfi) +void ios_events_free_pipe(mfInfo *mfi) { int consumer_fd = mfi->event_pipe_consumer, producer_fd = mfi->event_pipe_producer; - + mfi->event_pipe_consumer = mfi->event_pipe_producer = -1; close(producer_fd); - close(consumer_fd); + close(consumer_fd); } diff --git a/client/iOS/FreeRDP/ios_freerdp_ui.h b/client/iOS/FreeRDP/ios_freerdp_ui.h index 9dc5b135e..daa6c1f7d 100644 --- a/client/iOS/FreeRDP/ios_freerdp_ui.h +++ b/client/iOS/FreeRDP/ios_freerdp_ui.h @@ -4,7 +4,8 @@ Copyright 2013 Thincast Technologies GmbH, Authors: Martin Fleisz, Dorian Johnson This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "ios_freerdp.h" @@ -13,23 +14,13 @@ BOOL ios_ui_begin_paint(rdpContext* context); BOOL ios_ui_end_paint(rdpContext* context); BOOL ios_ui_resize_window(rdpContext* context); -BOOL ios_ui_authenticate(freerdp* instance, char** username, char** password, - char** domain); -BOOL ios_ui_gw_authenticate(freerdp* instance, char** username, char** password, - char** domain); -DWORD ios_ui_verify_certificate(freerdp* instance, - const char* common_name, - const char* subject, - const char* issuer, - const char* fingerprint, - BOOL host_mismatch); -DWORD ios_ui_verify_changed_certificate(freerdp* instance, - const char* common_name, - const char* subject, - const char* issuer, - const char* new_fingerprint, - const char* old_subject, - const char* old_issuer, - const char* old_fingerprint); +BOOL ios_ui_authenticate(freerdp* instance, char** username, char** password, char** domain); +BOOL ios_ui_gw_authenticate(freerdp* instance, char** username, char** password, char** domain); +DWORD ios_ui_verify_certificate(freerdp* instance, const char* common_name, const char* subject, + const char* issuer, const char* fingerprint, BOOL host_mismatch); +DWORD ios_ui_verify_changed_certificate(freerdp* instance, const char* common_name, + const char* subject, const char* issuer, + const char* new_fingerprint, const char* old_subject, + const char* old_issuer, const char* old_fingerprint); void ios_allocate_display_buffer(mfInfo* mfi); diff --git a/client/iOS/FreeRDP/ios_freerdp_ui.m b/client/iOS/FreeRDP/ios_freerdp_ui.m index abf3e722a..b7cb3626a 100644 --- a/client/iOS/FreeRDP/ios_freerdp_ui.m +++ b/client/iOS/FreeRDP/ios_freerdp_ui.m @@ -4,7 +4,8 @@ Copyright 2013 Thincast Technologies GmbH, Authors: Martin Fleisz, Dorian Johnson This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @@ -17,22 +18,26 @@ #pragma mark - #pragma mark Certificate authentication -static void ios_resize_display_buffer(mfInfo* mfi); -static BOOL ios_ui_authenticate_raw(freerdp* instance, char** username, - char** password, - char** domain, const char* title) +static void ios_resize_display_buffer(mfInfo *mfi); +static BOOL ios_ui_authenticate_raw(freerdp *instance, char **username, char **password, + char **domain, const char *title) { - mfInfo* mfi = MFI_FROM_INSTANCE(instance); - NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: - (*username) ? [NSString stringWithUTF8String:*username] : @"", @"username", - (*password) ? [NSString stringWithUTF8String:*password] : @"", @"password", - (*domain) ? [NSString stringWithUTF8String:*domain] : @"", @"domain", - [NSString stringWithUTF8String:instance->settings->ServerHostname], - @"hostname", // used for the auth prompt message; not changed - nil]; + mfInfo *mfi = MFI_FROM_INSTANCE(instance); + NSMutableDictionary *params = [NSMutableDictionary + dictionaryWithObjectsAndKeys:(*username) ? [NSString stringWithUTF8String:*username] : @"", + @"username", + (*password) ? [NSString stringWithUTF8String:*password] : @"", + @"password", + (*domain) ? [NSString stringWithUTF8String:*domain] : @"", + @"domain", + [NSString + stringWithUTF8String:instance->settings->ServerHostname], + @"hostname", // used for the auth prompt message; not changed + nil]; // request auth UI - [mfi->session performSelectorOnMainThread:@selector( - sessionRequestsAuthenticationWithParams:) withObject:params waitUntilDone:YES]; + [mfi->session performSelectorOnMainThread:@selector(sessionRequestsAuthenticationWithParams:) + withObject:params + waitUntilDone:YES]; // wait for UI request to be completed [[mfi->session uiRequestCompleted] lock]; [[mfi->session uiRequestCompleted] wait]; @@ -64,40 +69,35 @@ static BOOL ios_ui_authenticate_raw(freerdp* instance, char** username, return TRUE; } -BOOL ios_ui_authenticate(freerdp* instance, char** username, char** password, - char** domain) +BOOL ios_ui_authenticate(freerdp *instance, char **username, char **password, char **domain) { return ios_ui_authenticate_raw(instance, username, password, domain, ""); } -BOOL ios_ui_gw_authenticate(freerdp* instance, char** username, char** password, - char** domain) +BOOL ios_ui_gw_authenticate(freerdp *instance, char **username, char **password, char **domain) { return ios_ui_authenticate_raw(instance, username, password, domain, "gateway"); } - -DWORD ios_ui_verify_certificate(freerdp* instance, - const char* common_name, - const char* subject, - const char* issuer, - const char* fingerprint, - BOOL host_mismatch) +DWORD ios_ui_verify_certificate(freerdp *instance, const char *common_name, const char *subject, + const char *issuer, const char *fingerprint, BOOL host_mismatch) { // check whether we accept all certificates - if ([[NSUserDefaults standardUserDefaults] boolForKey: - @"security.accept_certificates"] == YES) + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"security.accept_certificates"] == YES) return 2; - mfInfo* mfi = MFI_FROM_INSTANCE(instance); - NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: - (subject) ? [NSString stringWithUTF8String:subject] : @"", @"subject", - (issuer) ? [NSString stringWithUTF8String:issuer] : @"", @"issuer", - (fingerprint) ? [NSString stringWithUTF8String:subject] : @"", @"fingerprint", - nil]; + mfInfo *mfi = MFI_FROM_INSTANCE(instance); + NSMutableDictionary *params = [NSMutableDictionary + dictionaryWithObjectsAndKeys:(subject) ? [NSString stringWithUTF8String:subject] : @"", + @"subject", + (issuer) ? [NSString stringWithUTF8String:issuer] : @"", + @"issuer", + (fingerprint) ? [NSString stringWithUTF8String:subject] : @"", + @"fingerprint", nil]; // request certificate verification UI - [mfi->session performSelectorOnMainThread:@selector( - sessionVerifyCertificateWithParams:) withObject:params waitUntilDone:YES]; + [mfi->session performSelectorOnMainThread:@selector(sessionVerifyCertificateWithParams:) + withObject:params + waitUntilDone:YES]; // wait for UI request to be completed [[mfi->session uiRequestCompleted] lock]; [[mfi->session uiRequestCompleted] wait]; @@ -112,51 +112,45 @@ DWORD ios_ui_verify_certificate(freerdp* instance, return 1; } -DWORD ios_ui_verify_changed_certificate(freerdp* instance, - const char* common_name, - const char* subject, - const char* issuer, - const char* new_fingerprint, - const char* old_subject, - const char* old_issuer, - const char* old_fingerprint) +DWORD ios_ui_verify_changed_certificate(freerdp *instance, const char *common_name, + const char *subject, const char *issuer, + const char *new_fingerprint, const char *old_subject, + const char *old_issuer, const char *old_fingerprint) { - return ios_ui_verify_certificate(instance, common_name, subject, issuer, - new_fingerprint, FALSE); + return ios_ui_verify_certificate(instance, common_name, subject, issuer, new_fingerprint, + FALSE); } - #pragma mark - #pragma mark Graphics updates -BOOL ios_ui_begin_paint(rdpContext* context) +BOOL ios_ui_begin_paint(rdpContext *context) { - rdpGdi* gdi = context->gdi; + rdpGdi *gdi = context->gdi; gdi->primary->hdc->hwnd->invalid->null = TRUE; return TRUE; } -BOOL ios_ui_end_paint(rdpContext* context) +BOOL ios_ui_end_paint(rdpContext *context) { - mfInfo* mfi = MFI_FROM_INSTANCE(context->instance); - rdpGdi* gdi = context->gdi; - CGRect dirty_rect = CGRectMake(gdi->primary->hdc->hwnd->invalid->x, - gdi->primary->hdc->hwnd->invalid->y, gdi->primary->hdc->hwnd->invalid->w, - gdi->primary->hdc->hwnd->invalid->h); + mfInfo *mfi = MFI_FROM_INSTANCE(context->instance); + rdpGdi *gdi = context->gdi; + CGRect dirty_rect = + CGRectMake(gdi->primary->hdc->hwnd->invalid->x, gdi->primary->hdc->hwnd->invalid->y, + gdi->primary->hdc->hwnd->invalid->w, gdi->primary->hdc->hwnd->invalid->h); if (!gdi->primary->hdc->hwnd->invalid->null) - [mfi->session performSelectorOnMainThread:@selector( - setNeedsDisplayInRectAsValue:) withObject:[NSValue valueWithCGRect:dirty_rect] - waitUntilDone:NO]; + [mfi->session performSelectorOnMainThread:@selector(setNeedsDisplayInRectAsValue:) + withObject:[NSValue valueWithCGRect:dirty_rect] + waitUntilDone:NO]; return TRUE; } - -BOOL ios_ui_resize_window(rdpContext* context) +BOOL ios_ui_resize_window(rdpContext *context) { - rdpSettings* settings; - rdpGdi* gdi; + rdpSettings *settings; + rdpGdi *gdi; if (!context || !context->settings) return FALSE; @@ -171,37 +165,38 @@ BOOL ios_ui_resize_window(rdpContext* context) return TRUE; } - #pragma mark - #pragma mark Exported -static void ios_create_bitmap_context(mfInfo* mfi) +static void ios_create_bitmap_context(mfInfo *mfi) { - [mfi->session performSelectorOnMainThread:@selector( - sessionBitmapContextWillChange) withObject:nil waitUntilDone:YES]; - rdpGdi* gdi = mfi->instance->context->gdi; + [mfi->session performSelectorOnMainThread:@selector(sessionBitmapContextWillChange) + withObject:nil + waitUntilDone:YES]; + rdpGdi *gdi = mfi->instance->context->gdi; CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); if (GetBytesPerPixel(gdi->dstFormat) == 2) - mfi->bitmap_context = CGBitmapContextCreate(gdi->primary_buffer, gdi->width, - gdi->height, 5, gdi->stride, colorSpace, - kCGBitmapByteOrder16Little | kCGImageAlphaNoneSkipFirst); + mfi->bitmap_context = CGBitmapContextCreate( + gdi->primary_buffer, gdi->width, gdi->height, 5, gdi->stride, colorSpace, + kCGBitmapByteOrder16Little | kCGImageAlphaNoneSkipFirst); else - mfi->bitmap_context = CGBitmapContextCreate(gdi->primary_buffer, gdi->width, - gdi->height, 8, gdi->stride, colorSpace, - kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst); + mfi->bitmap_context = CGBitmapContextCreate( + gdi->primary_buffer, gdi->width, gdi->height, 8, gdi->stride, colorSpace, + kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst); CGColorSpaceRelease(colorSpace); - [mfi->session performSelectorOnMainThread:@selector( - sessionBitmapContextDidChange) withObject:nil waitUntilDone:YES]; + [mfi->session performSelectorOnMainThread:@selector(sessionBitmapContextDidChange) + withObject:nil + waitUntilDone:YES]; } -void ios_allocate_display_buffer(mfInfo* mfi) +void ios_allocate_display_buffer(mfInfo *mfi) { ios_create_bitmap_context(mfi); } -void ios_resize_display_buffer(mfInfo* mfi) +void ios_resize_display_buffer(mfInfo *mfi) { // Release the old context in a thread-safe manner CGContextRef old_context = mfi->bitmap_context; @@ -210,4 +205,3 @@ void ios_resize_display_buffer(mfInfo* mfi) // Create the new context ios_create_bitmap_context(mfi); } - diff --git a/client/iOS/Misc/Reachability.h b/client/iOS/Misc/Reachability.h index fa5f9b64a..077ce93ee 100644 --- a/client/iOS/Misc/Reachability.h +++ b/client/iOS/Misc/Reachability.h @@ -1,16 +1,16 @@ /* - + File: Reachability.h Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. - + Version: 2.2 - + Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. - + In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software"), to @@ -26,13 +26,13 @@ including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. - + The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) @@ -40,50 +40,48 @@ DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - Copyright (C) 2010 Apple Inc. All Rights Reserved. - -*/ + Copyright (C) 2010 Apple Inc. All Rights Reserved. + +*/ #import #import #import -typedef enum { +typedef enum +{ NotReachable = 0, ReachableViaWiFi = 1, ReachableViaWWAN = 2 } NetworkStatus; #define kReachabilityChangedNotification @"kNetworkReachabilityChangedNotification" -@interface Reachability: NSObject +@interface Reachability : NSObject { BOOL localWiFiRef; SCNetworkReachabilityRef reachabilityRef; } -//reachabilityWithHostName- Use to check the reachability of a particular host name. -+ (Reachability*) reachabilityWithHostName: (NSString*) hostName; +// reachabilityWithHostName- Use to check the reachability of a particular host name. ++ (Reachability *)reachabilityWithHostName:(NSString *)hostName; -//reachabilityWithAddress- Use to check the reachability of a particular IP address. -+ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress; +// reachabilityWithAddress- Use to check the reachability of a particular IP address. ++ (Reachability *)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress; -//reachabilityForInternetConnection- checks whether the default route is available. +// reachabilityForInternetConnection- checks whether the default route is available. // Should be used by applications that do not connect to a particular host -+ (Reachability*) reachabilityForInternetConnection; ++ (Reachability *)reachabilityForInternetConnection; -//reachabilityForLocalWiFi- checks whether a local wifi connection is available. -+ (Reachability*) reachabilityForLocalWiFi; +// reachabilityForLocalWiFi- checks whether a local wifi connection is available. ++ (Reachability *)reachabilityForLocalWiFi; -//Start listening for reachability notifications on the current run loop -- (BOOL) startNotifier; -- (void) stopNotifier; +// Start listening for reachability notifications on the current run loop +- (BOOL)startNotifier; +- (void)stopNotifier; -- (NetworkStatus) currentReachabilityStatus; -//WWAN may be available, but not active until a connection has been established. -//WiFi may require a connection for VPN on Demand. -- (BOOL) connectionRequired; +- (NetworkStatus)currentReachabilityStatus; +// WWAN may be available, but not active until a connection has been established. +// WiFi may require a connection for VPN on Demand. +- (BOOL)connectionRequired; @end - - diff --git a/client/iOS/Misc/Reachability.m b/client/iOS/Misc/Reachability.m index 5ecdcf4e3..6a3eb2ecd 100644 --- a/client/iOS/Misc/Reachability.m +++ b/client/iOS/Misc/Reachability.m @@ -1,16 +1,16 @@ /* - + File: Reachability.m Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. - + Version: 2.2 - + Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. - + In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software"), to @@ -26,13 +26,13 @@ including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. - + The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) @@ -40,9 +40,9 @@ DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - + Copyright (C) 2010 Apple Inc. All Rights Reserved. - + */ #import @@ -58,52 +58,53 @@ #define kShouldPrintReachabilityFlags 1 -static void PrintReachabilityFlags(SCNetworkReachabilityFlags flags, const char* comment) +static void PrintReachabilityFlags(SCNetworkReachabilityFlags flags, const char *comment) { #if kShouldPrintReachabilityFlags - - NSLog(@"Reachability Flag Status: %c%c %c%c%c%c%c%c%c %s\n", - (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', - (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', - - (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-', - (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', - (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', - (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-', - comment - ); + + NSLog(@"Reachability Flag Status: %c%c %c%c%c%c%c%c%c %s\n", + (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', + (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', + + (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-', + (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', + (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', + (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-', comment); #endif } - @implementation Reachability -static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) +static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, + void *info) { - #pragma unused (target, flags) +#pragma unused(target, flags) NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback"); - NSCAssert([(NSObject*) info isKindOfClass: [Reachability class]], @"info was wrong class in ReachabilityCallback"); + NSCAssert([(NSObject *)info isKindOfClass:[Reachability class]], + @"info was wrong class in ReachabilityCallback"); - //We're on the main RunLoop, so an NSAutoreleasePool is not necessary, but is added defensively + // We're on the main RunLoop, so an NSAutoreleasePool is not necessary, but is added defensively // in case someon uses the Reachablity object in a different thread. - NSAutoreleasePool* myPool = [[NSAutoreleasePool alloc] init]; - - Reachability* noteObject = (Reachability*) info; + NSAutoreleasePool *myPool = [[NSAutoreleasePool alloc] init]; + + Reachability *noteObject = (Reachability *)info; // Post a notification to notify the client that the network reachability changed. - [[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification object: noteObject]; - + [[NSNotificationCenter defaultCenter] postNotificationName:kReachabilityChangedNotification + object:noteObject]; + [myPool release]; } -- (BOOL) startNotifier +- (BOOL)startNotifier { BOOL retVal = NO; - SCNetworkReachabilityContext context = {0, self, NULL, NULL, NULL}; - if(SCNetworkReachabilitySetCallback(reachabilityRef, ReachabilityCallback, &context)) + SCNetworkReachabilityContext context = { 0, self, NULL, NULL, NULL }; + if (SCNetworkReachabilitySetCallback(reachabilityRef, ReachabilityCallback, &context)) { - if(SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)) + if (SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetCurrent(), + kCFRunLoopDefaultMode)) { retVal = YES; } @@ -111,32 +112,34 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach return retVal; } -- (void) stopNotifier +- (void)stopNotifier { - if(reachabilityRef!= NULL) + if (reachabilityRef != NULL) { - SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); + SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetCurrent(), + kCFRunLoopDefaultMode); } } -- (void) dealloc +- (void)dealloc { [self stopNotifier]; - if(reachabilityRef!= NULL) + if (reachabilityRef != NULL) { CFRelease(reachabilityRef); } [super dealloc]; } -+ (Reachability*) reachabilityWithHostName: (NSString*) hostName; ++ (Reachability *)reachabilityWithHostName:(NSString *)hostName; { - Reachability* retVal = NULL; - SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]); - if(reachability!= NULL) + Reachability *retVal = NULL; + SCNetworkReachabilityRef reachability = + SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]); + if (reachability != NULL) { - retVal= [[[self alloc] init] autorelease]; - if(retVal!= NULL) + retVal = [[[self alloc] init] autorelease]; + if (retVal != NULL) { retVal->reachabilityRef = reachability; retVal->localWiFiRef = NO; @@ -145,14 +148,15 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach return retVal; } -+ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress; ++ (Reachability *)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress; { - SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress); - Reachability* retVal = NULL; - if(reachability!= NULL) + SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress( + kCFAllocatorDefault, (const struct sockaddr *)hostAddress); + Reachability *retVal = NULL; + if (reachability != NULL) { - retVal= [[[self alloc] init] autorelease]; - if(retVal!= NULL) + retVal = [[[self alloc] init] autorelease]; + if (retVal != NULL) { retVal->reachabilityRef = reachability; retVal->localWiFiRef = NO; @@ -161,16 +165,16 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach return retVal; } -+ (Reachability*) reachabilityForInternetConnection; ++ (Reachability *)reachabilityForInternetConnection; { struct sockaddr_in zeroAddress; bzero(&zeroAddress, sizeof(zeroAddress)); zeroAddress.sin_len = sizeof(zeroAddress); zeroAddress.sin_family = AF_INET; - return [self reachabilityWithAddress: &zeroAddress]; + return [self reachabilityWithAddress:&zeroAddress]; } -+ (Reachability*) reachabilityForLocalWiFi; ++ (Reachability *)reachabilityForLocalWiFi; { struct sockaddr_in localWifiAddress; bzero(&localWifiAddress, sizeof(localWifiAddress)); @@ -178,8 +182,8 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach localWifiAddress.sin_family = AF_INET; // IN_LINKLOCALNETNUM is defined in as 169.254.0.0 localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM); - Reachability* retVal = [self reachabilityWithAddress: &localWifiAddress]; - if(retVal!= NULL) + Reachability *retVal = [self reachabilityWithAddress:&localWifiAddress]; + if (retVal != NULL) { retVal->localWiFiRef = YES; } @@ -188,19 +192,20 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach #pragma mark Network Flag Handling -- (NetworkStatus) localWiFiStatusForFlags: (SCNetworkReachabilityFlags) flags +- (NetworkStatus)localWiFiStatusForFlags:(SCNetworkReachabilityFlags)flags { PrintReachabilityFlags(flags, "localWiFiStatusForFlags"); BOOL retVal = NotReachable; - if((flags & kSCNetworkReachabilityFlagsReachable) && (flags & kSCNetworkReachabilityFlagsIsDirect)) + if ((flags & kSCNetworkReachabilityFlagsReachable) && + (flags & kSCNetworkReachabilityFlagsIsDirect)) { - retVal = ReachableViaWiFi; + retVal = ReachableViaWiFi; } return retVal; } -- (NetworkStatus) networkStatusForFlags: (SCNetworkReachabilityFlags) flags +- (NetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags { PrintReachabilityFlags(flags, "networkStatusForFlags"); if ((flags & kSCNetworkReachabilityFlagsReachable) == 0) @@ -210,28 +215,27 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach } BOOL retVal = NotReachable; - + if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0) { // if target host is reachable and no connection is required // then we'll assume (for now) that your on Wi-Fi retVal = ReachableViaWiFi; } - - - if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) || - (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0)) - { - // ... and the connection is on-demand (or on-traffic) if the - // calling application is using the CFSocketStream or higher APIs - if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0) - { - // ... and no [user] intervention is needed - retVal = ReachableViaWiFi; - } + if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand) != 0) || + (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0)) + { + // ... and the connection is on-demand (or on-traffic) if the + // calling application is using the CFSocketStream or higher APIs + + if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0) + { + // ... and no [user] intervention is needed + retVal = ReachableViaWiFi; } - + } + if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN) { // ... but WWAN connections are OK if the calling application @@ -241,7 +245,7 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach return retVal; } -- (BOOL) connectionRequired; +- (BOOL)connectionRequired; { NSAssert(reachabilityRef != NULL, @"connectionRequired called with NULL reachabilityRef"); SCNetworkReachabilityFlags flags; @@ -252,20 +256,20 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach return NO; } -- (NetworkStatus) currentReachabilityStatus +- (NetworkStatus)currentReachabilityStatus { NSAssert(reachabilityRef != NULL, @"currentNetworkStatus called with NULL reachabilityRef"); NetworkStatus retVal = NotReachable; SCNetworkReachabilityFlags flags; if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { - if(localWiFiRef) + if (localWiFiRef) { - retVal = [self localWiFiStatusForFlags: flags]; + retVal = [self localWiFiStatusForFlags:flags]; } else { - retVal = [self networkStatusForFlags: flags]; + retVal = [self networkStatusForFlags:flags]; } } return retVal; diff --git a/client/iOS/Misc/SFHFKeychainUtils.h b/client/iOS/Misc/SFHFKeychainUtils.h index 45bd642b3..b85925f9f 100644 --- a/client/iOS/Misc/SFHFKeychainUtils.h +++ b/client/iOS/Misc/SFHFKeychainUtils.h @@ -29,13 +29,20 @@ #import - -@interface SFHFKeychainUtils : NSObject { - +@interface SFHFKeychainUtils : NSObject +{ } -+ (NSString *) getPasswordForUsername: (NSString *) username andServerName: (NSString *) serverName error: (NSError **) error; -+ (BOOL) storeUsername: (NSString *) username andPassword: (NSString *) password forServerName: (NSString *) serverName updateExisting: (BOOL) updateExisting error: (NSError **) error; -+ (BOOL) deleteItemForUsername: (NSString *) username andServerName: (NSString *) serverName error: (NSError **) error; ++ (NSString *)getPasswordForUsername:(NSString *)username + andServerName:(NSString *)serverName + error:(NSError **)error; ++ (BOOL)storeUsername:(NSString *)username + andPassword:(NSString *)password + forServerName:(NSString *)serverName + updateExisting:(BOOL)updateExisting + error:(NSError **)error; ++ (BOOL)deleteItemForUsername:(NSString *)username + andServerName:(NSString *)serverName + error:(NSError **)error; @end \ No newline at end of file diff --git a/client/iOS/Misc/SFHFKeychainUtils.m b/client/iOS/Misc/SFHFKeychainUtils.m index dba1e4706..ebf8ad2ed 100644 --- a/client/iOS/Misc/SFHFKeychainUtils.m +++ b/client/iOS/Misc/SFHFKeychainUtils.m @@ -34,7 +34,9 @@ static NSString *SFHFKeychainUtilsErrorDomain = @"SFHFKeychainUtilsErrorDomain"; #if __IPHONE_OS_VERSION_MIN_REQUIRED < 30000 && TARGET_IPHONE_SIMULATOR @interface SFHFKeychainUtils (PrivateMethods) -+ (SecKeychainItemRef) getKeychainItemReferenceForUsername: (NSString *) username andServerName: (NSString *) serverName error: (NSError **) error; ++ (SecKeychainItemRef)getKeychainItemReferenceForUsername:(NSString *)username + andServerName:(NSString *)serverName + error:(NSError **)error; @end #endif @@ -42,391 +44,456 @@ static NSString *SFHFKeychainUtilsErrorDomain = @"SFHFKeychainUtilsErrorDomain"; #if __IPHONE_OS_VERSION_MIN_REQUIRED < 30000 && TARGET_IPHONE_SIMULATOR -+ (NSString *) getPasswordForUsername: (NSString *) username andServerName: (NSString *) serverName error: (NSError **) error { - if (!username || !serviceName) { - *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: -2000 userInfo: nil]; ++ (NSString *)getPasswordForUsername:(NSString *)username + andServerName:(NSString *)serverName + error:(NSError **)error +{ + if (!username || !serviceName) + { + *error = [NSError errorWithDomain:SFHFKeychainUtilsErrorDomain code:-2000 userInfo:nil]; return nil; } - - SecKeychainItemRef item = [SFHFKeychainUtils getKeychainItemReferenceForUsername: username andServerName: serverName error: error]; - - if (*error || !item) { + + SecKeychainItemRef item = [SFHFKeychainUtils getKeychainItemReferenceForUsername:username + andServerName:serverName + error:error]; + + if (*error || !item) + { return nil; } - + // from Advanced Mac OS X Programming, ch. 16 - UInt32 length; - char *password; - SecKeychainAttribute attributes[8]; - SecKeychainAttributeList list; - - attributes[0].tag = kSecAccountItemAttr; - attributes[1].tag = kSecDescriptionItemAttr; - attributes[2].tag = kSecLabelItemAttr; - attributes[3].tag = kSecModDateItemAttr; - - list.count = 4; - list.attr = attributes; - - OSStatus status = SecKeychainItemCopyContent(item, NULL, &list, &length, (void **)&password); - - if (status != noErr) { - *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: status userInfo: nil]; + UInt32 length; + char *password; + SecKeychainAttribute attributes[8]; + SecKeychainAttributeList list; + + attributes[0].tag = kSecAccountItemAttr; + attributes[1].tag = kSecDescriptionItemAttr; + attributes[2].tag = kSecLabelItemAttr; + attributes[3].tag = kSecModDateItemAttr; + + list.count = 4; + list.attr = attributes; + + OSStatus status = SecKeychainItemCopyContent(item, NULL, &list, &length, (void **)&password); + + if (status != noErr) + { + *error = [NSError errorWithDomain:SFHFKeychainUtilsErrorDomain code:status userInfo:nil]; return nil; - } - + } + NSString *passwordString = nil; - - if (password != NULL) { + + if (password != NULL) + { char passwordBuffer[1024]; - - if (length > 1023) { + + if (length > 1023) + { length = 1023; } strncpy(passwordBuffer, password, length); - + passwordBuffer[length] = '\0'; passwordString = [NSString stringWithCString:passwordBuffer]; } - + SecKeychainItemFreeContent(&list, password); - - CFRelease(item); - - return passwordString; + + CFRelease(item); + + return passwordString; } -+ (void) storeUsername: (NSString *) username andPassword: (NSString *) password forServerName: (NSString *) serverName updateExisting: (BOOL) updateExisting error: (NSError **) error { - if (!username || !password || !serverName) { - *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: -2000 userInfo: nil]; ++ (void)storeUsername:(NSString *)username + andPassword:(NSString *)password + forServerName:(NSString *)serverName + updateExisting:(BOOL)updateExisting + error:(NSError **)error +{ + if (!username || !password || !serverName) + { + *error = [NSError errorWithDomain:SFHFKeychainUtilsErrorDomain code:-2000 userInfo:nil]; return; } - + OSStatus status = noErr; - - SecKeychainItemRef item = [SFHFKeychainUtils getKeychainItemReferenceForUsername: username andServerName: serverName error: error]; - - if (*error && [*error code] != noErr) { + + SecKeychainItemRef item = [SFHFKeychainUtils getKeychainItemReferenceForUsername:username + andServerName:serverName + error:error]; + + if (*error && [*error code] != noErr) + { return; } - + *error = nil; - - if (item) { - status = SecKeychainItemModifyAttributesAndData(item, - NULL, - strlen([password UTF8String]), - [password UTF8String]); - + + if (item) + { + status = SecKeychainItemModifyAttributesAndData(item, NULL, strlen([password UTF8String]), + [password UTF8String]); + CFRelease(item); } - else { - status = SecKeychainAddGenericPassword(NULL, - strlen([serverName UTF8String]), - [serverName UTF8String], - strlen([username UTF8String]), - [username UTF8String], - strlen([password UTF8String]), - [password UTF8String], - NULL); + else + { + status = SecKeychainAddGenericPassword( + NULL, strlen([serverName UTF8String]), [serverName UTF8String], + strlen([username UTF8String]), [username UTF8String], strlen([password UTF8String]), + [password UTF8String], NULL); } - - if (status != noErr) { - *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: status userInfo: nil]; + + if (status != noErr) + { + *error = [NSError errorWithDomain:SFHFKeychainUtilsErrorDomain code:status userInfo:nil]; } } -+ (void) deleteItemForUsername: (NSString *) username andServerName: (NSString *) serverName error: (NSError **) error { - if (!username || !serverName) { - *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: 2000 userInfo: nil]; ++ (void)deleteItemForUsername:(NSString *)username + andServerName:(NSString *)serverName + error:(NSError **)error +{ + if (!username || !serverName) + { + *error = [NSError errorWithDomain:SFHFKeychainUtilsErrorDomain code:2000 userInfo:nil]; return; } - + *error = nil; - - SecKeychainItemRef item = [SFHFKeychainUtils getKeychainItemReferenceForUsername: username andServerName: serverName error: error]; - - if (*error && [*error code] != noErr) { + + SecKeychainItemRef item = [SFHFKeychainUtils getKeychainItemReferenceForUsername:username + andServerName:serverName + error:error]; + + if (*error && [*error code] != noErr) + { return; } - + OSStatus status; - - if (item) { + + if (item) + { status = SecKeychainItemDelete(item); - + CFRelease(item); } - - if (status != noErr) { - *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: status userInfo: nil]; + + if (status != noErr) + { + *error = [NSError errorWithDomain:SFHFKeychainUtilsErrorDomain code:status userInfo:nil]; } } -+ (SecKeychainItemRef) getKeychainItemReferenceForUsername: (NSString *) username andServerName: (NSString *) serverName error: (NSError **) error { - if (!username || !serverName) { - *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: -2000 userInfo: nil]; ++ (SecKeychainItemRef)getKeychainItemReferenceForUsername:(NSString *)username + andServerName:(NSString *)serverName + error:(NSError **)error +{ + if (!username || !serverName) + { + *error = [NSError errorWithDomain:SFHFKeychainUtilsErrorDomain code:-2000 userInfo:nil]; return nil; } - + *error = nil; - + SecKeychainItemRef item; - - OSStatus status = SecKeychainFindGenericPassword(NULL, - strlen([serverName UTF8String]), - [serverName UTF8String], - strlen([username UTF8String]), - [username UTF8String], - NULL, - NULL, - &item); - - if (status != noErr) { - if (status != errSecItemNotFound) { - *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: status userInfo: nil]; + + OSStatus status = SecKeychainFindGenericPassword( + NULL, strlen([serverName UTF8String]), [serverName UTF8String], + strlen([username UTF8String]), [username UTF8String], NULL, NULL, &item); + + if (status != noErr) + { + if (status != errSecItemNotFound) + { + *error = [NSError errorWithDomain:SFHFKeychainUtilsErrorDomain + code:status + userInfo:nil]; } - - return nil; + + return nil; } - + return item; } #else -+ (NSString *) getPasswordForUsername: (NSString *) username andServerName: (NSString *) serverName error: (NSError **) error { - if (!username || !serverName) { - if (error != nil) { - *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: -2000 userInfo: nil]; ++ (NSString *)getPasswordForUsername:(NSString *)username + andServerName:(NSString *)serverName + error:(NSError **)error +{ + if (!username || !serverName) + { + if (error != nil) + { + *error = [NSError errorWithDomain:SFHFKeychainUtilsErrorDomain code:-2000 userInfo:nil]; } return nil; } - - if (error != nil) { + + if (error != nil) + { *error = nil; } - - // Set up a query dictionary with the base query attributes: item type (generic), username, and service - - NSArray *keys = [[[NSArray alloc] initWithObjects: (NSString *) kSecClass, kSecAttrAccount, kSecAttrService, nil] autorelease]; - NSArray *objects = [[[NSArray alloc] initWithObjects: (NSString *) kSecClassGenericPassword, username, serverName, nil] autorelease]; - - NSMutableDictionary *query = [[[NSMutableDictionary alloc] initWithObjects: objects forKeys: keys] autorelease]; - - // First do a query for attributes, in case we already have a Keychain item with no password data set. - // One likely way such an incorrect item could have come about is due to the previous (incorrect) - // version of this code (which set the password as a generic attribute instead of password data). - + + // Set up a query dictionary with the base query attributes: item type (generic), username, and + // service + + NSArray *keys = [[[NSArray alloc] + initWithObjects:(NSString *)kSecClass, kSecAttrAccount, kSecAttrService, nil] autorelease]; + NSArray *objects = [[[NSArray alloc] initWithObjects:(NSString *)kSecClassGenericPassword, + username, serverName, nil] autorelease]; + + NSMutableDictionary *query = [[[NSMutableDictionary alloc] initWithObjects:objects + forKeys:keys] autorelease]; + + // First do a query for attributes, in case we already have a Keychain item with no password + // data set. One likely way such an incorrect item could have come about is due to the previous + // (incorrect) version of this code (which set the password as a generic attribute instead of + // password data). + NSDictionary *attributeResult = NULL; NSMutableDictionary *attributeQuery = [query mutableCopy]; - [attributeQuery setObject: (id) kCFBooleanTrue forKey:(id) kSecReturnAttributes]; - OSStatus status = SecItemCopyMatching((CFDictionaryRef) attributeQuery, (CFTypeRef *) &attributeResult); - + [attributeQuery setObject:(id)kCFBooleanTrue forKey:(id)kSecReturnAttributes]; + OSStatus status = + SecItemCopyMatching((CFDictionaryRef)attributeQuery, (CFTypeRef *)&attributeResult); + [attributeResult release]; [attributeQuery release]; - - if (status != noErr) { + + if (status != noErr) + { // No existing item found--simply return nil for the password - if (error != nil && status != errSecItemNotFound) { - //Only return an error if a real exception happened--not simply for "not found." - *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: status userInfo: nil]; + if (error != nil && status != errSecItemNotFound) + { + // Only return an error if a real exception happened--not simply for "not found." + *error = [NSError errorWithDomain:SFHFKeychainUtilsErrorDomain + code:status + userInfo:nil]; } - + return nil; } - + // We have an existing item, now query for the password data associated with it. - + NSData *resultData = nil; NSMutableDictionary *passwordQuery = [query mutableCopy]; - [passwordQuery setObject: (id) kCFBooleanTrue forKey: (id) kSecReturnData]; - - status = SecItemCopyMatching((CFDictionaryRef) passwordQuery, (CFTypeRef *) &resultData); - + [passwordQuery setObject:(id)kCFBooleanTrue forKey:(id)kSecReturnData]; + + status = SecItemCopyMatching((CFDictionaryRef)passwordQuery, (CFTypeRef *)&resultData); + [resultData autorelease]; [passwordQuery release]; - - if (status != noErr) { - if (status == errSecItemNotFound) { - // We found attributes for the item previously, but no password now, so return a special error. - // Users of this API will probably want to detect this error and prompt the user to - // re-enter their credentials. When you attempt to store the re-entered credentials + + if (status != noErr) + { + if (status == errSecItemNotFound) + { + // We found attributes for the item previously, but no password now, so return a special + // error. Users of this API will probably want to detect this error and prompt the user + // to re-enter their credentials. When you attempt to store the re-entered credentials // using storeUsername:andPassword:forServiceName:updateExisting:error // the old, incorrect entry will be deleted and a new one with a properly encrypted // password will be added. - if (error != nil) { - *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: -1999 userInfo: nil]; + if (error != nil) + { + *error = [NSError errorWithDomain:SFHFKeychainUtilsErrorDomain + code:-1999 + userInfo:nil]; } } - else { + else + { // Something else went wrong. Simply return the normal Keychain API error code. - if (error != nil) { - *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: status userInfo: nil]; + if (error != nil) + { + *error = [NSError errorWithDomain:SFHFKeychainUtilsErrorDomain + code:status + userInfo:nil]; } } - + return nil; } - - NSString *password = nil; - - if (resultData) { - password = [[NSString alloc] initWithData: resultData encoding: NSUTF8StringEncoding]; + + NSString *password = nil; + + if (resultData) + { + password = [[NSString alloc] initWithData:resultData encoding:NSUTF8StringEncoding]; } - else { - // There is an existing item, but we weren't able to get password data for it for some reason, - // Possibly as a result of an item being incorrectly entered by the previous code. + else + { + // There is an existing item, but we weren't able to get password data for it for some + // reason, Possibly as a result of an item being incorrectly entered by the previous code. // Set the -1999 error so the code above us can prompt the user again. - if (error != nil) { - *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: -1999 userInfo: nil]; + if (error != nil) + { + *error = [NSError errorWithDomain:SFHFKeychainUtilsErrorDomain code:-1999 userInfo:nil]; } } - + return [password autorelease]; } -+ (BOOL) storeUsername: (NSString *) username andPassword: (NSString *) password forServerName: (NSString *) serverName updateExisting: (BOOL) updateExisting error: (NSError **) error -{ - if (!username || !password || !serverName) - { - if (error != nil) - { - *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: -2000 userInfo: nil]; ++ (BOOL)storeUsername:(NSString *)username + andPassword:(NSString *)password + forServerName:(NSString *)serverName + updateExisting:(BOOL)updateExisting + error:(NSError **)error +{ + if (!username || !password || !serverName) + { + if (error != nil) + { + *error = [NSError errorWithDomain:SFHFKeychainUtilsErrorDomain code:-2000 userInfo:nil]; } return NO; } - + // See if we already have a password entered for these credentials. NSError *getError = nil; - NSString *existingPassword = [SFHFKeychainUtils getPasswordForUsername: username andServerName: serverName error:&getError]; - - if ([getError code] == -1999) - { - // There is an existing entry without a password properly stored (possibly as a result of the previous incorrect version of this code. - // Delete the existing item before moving on entering a correct one. - + NSString *existingPassword = [SFHFKeychainUtils getPasswordForUsername:username + andServerName:serverName + error:&getError]; + + if ([getError code] == -1999) + { + // There is an existing entry without a password properly stored (possibly as a result of + // the previous incorrect version of this code. Delete the existing item before moving on + // entering a correct one. + getError = nil; - - [self deleteItemForUsername: username andServerName: serverName error: &getError]; - - if ([getError code] != noErr) - { - if (error != nil) - { + + [self deleteItemForUsername:username andServerName:serverName error:&getError]; + + if ([getError code] != noErr) + { + if (error != nil) + { *error = getError; } return NO; } } - else if ([getError code] != noErr) - { - if (error != nil) - { + else if ([getError code] != noErr) + { + if (error != nil) + { *error = getError; } return NO; } - - if (error != nil) - { + + if (error != nil) + { *error = nil; } - + OSStatus status = noErr; - - if (existingPassword) - { + + if (existingPassword) + { // We have an existing, properly entered item with a password. // Update the existing item. - - if (![existingPassword isEqualToString:password] && updateExisting) - { - //Only update if we're allowed to update existing. If not, simply do nothing. - - NSArray *keys = [[[NSArray alloc] initWithObjects: (NSString *) kSecClass, - kSecAttrService, - kSecAttrLabel, - kSecAttrAccount, - nil] autorelease]; - - NSArray *objects = [[[NSArray alloc] initWithObjects: (NSString *) kSecClassGenericPassword, - serverName, - serverName, - username, - nil] autorelease]; - - NSDictionary *query = [[[NSDictionary alloc] initWithObjects: objects forKeys: keys] autorelease]; - - status = SecItemUpdate((CFDictionaryRef) query, (CFDictionaryRef) [NSDictionary dictionaryWithObject: [password dataUsingEncoding: NSUTF8StringEncoding] forKey: (NSString *) kSecValueData]); + + if (![existingPassword isEqualToString:password] && updateExisting) + { + // Only update if we're allowed to update existing. If not, simply do nothing. + + NSArray *keys = + [[[NSArray alloc] initWithObjects:(NSString *)kSecClass, kSecAttrService, + kSecAttrLabel, kSecAttrAccount, nil] autorelease]; + + NSArray *objects = + [[[NSArray alloc] initWithObjects:(NSString *)kSecClassGenericPassword, serverName, + serverName, username, nil] autorelease]; + + NSDictionary *query = [[[NSDictionary alloc] initWithObjects:objects + forKeys:keys] autorelease]; + + status = SecItemUpdate( + (CFDictionaryRef)query, + (CFDictionaryRef)[NSDictionary + dictionaryWithObject:[password dataUsingEncoding:NSUTF8StringEncoding] + forKey:(NSString *)kSecValueData]); } } - else - { + else + { // No existing entry (or an existing, improperly entered, and therefore now // deleted, entry). Create a new entry. - - NSArray *keys = [[[NSArray alloc] initWithObjects: (NSString *) kSecClass, - kSecAttrService, - kSecAttrLabel, - kSecAttrAccount, - kSecValueData, - nil] autorelease]; - - NSArray *objects = [[[NSArray alloc] initWithObjects: (NSString *) kSecClassGenericPassword, - serverName, - serverName, - username, - [password dataUsingEncoding: NSUTF8StringEncoding], - nil] autorelease]; - - NSDictionary *query = [[[NSDictionary alloc] initWithObjects: objects forKeys: keys] autorelease]; - - status = SecItemAdd((CFDictionaryRef) query, NULL); + + NSArray *keys = + [[[NSArray alloc] initWithObjects:(NSString *)kSecClass, kSecAttrService, kSecAttrLabel, + kSecAttrAccount, kSecValueData, nil] autorelease]; + + NSArray *objects = [[[NSArray alloc] + initWithObjects:(NSString *)kSecClassGenericPassword, serverName, serverName, username, + [password dataUsingEncoding:NSUTF8StringEncoding], nil] autorelease]; + + NSDictionary *query = [[[NSDictionary alloc] initWithObjects:objects + forKeys:keys] autorelease]; + + status = SecItemAdd((CFDictionaryRef)query, NULL); } - - if (error != nil && status != noErr) - { + + if (error != nil && status != noErr) + { // Something went wrong with adding the new item. Return the Keychain error code. - *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: status userInfo: nil]; - - return NO; + *error = [NSError errorWithDomain:SFHFKeychainUtilsErrorDomain code:status userInfo:nil]; + + return NO; } - - return YES; + + return YES; } -+ (BOOL) deleteItemForUsername: (NSString *) username andServerName: (NSString *) serverName error: (NSError **) error ++ (BOOL)deleteItemForUsername:(NSString *)username + andServerName:(NSString *)serverName + error:(NSError **)error { - if (!username || !serverName) - { - if (error != nil) - { - *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: -2000 userInfo: nil]; + if (!username || !serverName) + { + if (error != nil) + { + *error = [NSError errorWithDomain:SFHFKeychainUtilsErrorDomain code:-2000 userInfo:nil]; } return NO; } - - if (error != nil) - { + + if (error != nil) + { *error = nil; } - - NSArray *keys = [[[NSArray alloc] initWithObjects: (NSString *) kSecClass, kSecAttrAccount, kSecAttrService, kSecReturnAttributes, nil] autorelease]; - NSArray *objects = [[[NSArray alloc] initWithObjects: (NSString *) kSecClassGenericPassword, username, serverName, kCFBooleanTrue, nil] autorelease]; - - NSDictionary *query = [[[NSDictionary alloc] initWithObjects: objects forKeys: keys] autorelease]; - - OSStatus status = SecItemDelete((CFDictionaryRef) query); - - if (error != nil && status != noErr) - { - *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: status userInfo: nil]; - - return NO; + + NSArray *keys = + [[[NSArray alloc] initWithObjects:(NSString *)kSecClass, kSecAttrAccount, kSecAttrService, + kSecReturnAttributes, nil] autorelease]; + NSArray *objects = + [[[NSArray alloc] initWithObjects:(NSString *)kSecClassGenericPassword, username, + serverName, kCFBooleanTrue, nil] autorelease]; + + NSDictionary *query = [[[NSDictionary alloc] initWithObjects:objects forKeys:keys] autorelease]; + + OSStatus status = SecItemDelete((CFDictionaryRef)query); + + if (error != nil && status != noErr) + { + *error = [NSError errorWithDomain:SFHFKeychainUtilsErrorDomain code:status userInfo:nil]; + + return NO; } - - return YES; + + return YES; } #endif diff --git a/client/iOS/Misc/TSXTypes.h b/client/iOS/Misc/TSXTypes.h index 1b18c5ef7..51c52c1fa 100644 --- a/client/iOS/Misc/TSXTypes.h +++ b/client/iOS/Misc/TSXTypes.h @@ -1,10 +1,11 @@ /* Basic type defines for TSX RDC - + Copyright 2013 Thincast Technologies GmbH, Authors: Martin Fleisz, Dorian Johnson - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #ifndef TSXRemoteDesktop_TSXTypes_h @@ -15,33 +16,40 @@ // Represents the underlying state of a TWSession RDP connection. typedef enum _TSXConnectionState { - TSXConnectionClosed = 0, // Session either hasn't begun connecting, or its connection has finished disconnecting. - TSXConnectionConnecting = 1, // Session is in the process of establishing an RDP connection. A TCP or SSL connection might be established, but the RDP initialization sequence isn't finished. - TSXConnectionConnected = 2, // Session has a full RDP connection established; though if the windows computer doesn't support NLA, a login screen might be shown in the session. - TSXConnectionDisconnected = 3 // Session is disconnected at the RDP layer. TSX RDC might still be disposing of resources, however. + TSXConnectionClosed = + 0, // Session either hasn't begun connecting, or its connection has finished disconnecting. + TSXConnectionConnecting = + 1, // Session is in the process of establishing an RDP connection. A TCP or SSL connection + // might be established, but the RDP initialization sequence isn't finished. + TSXConnectionConnected = + 2, // Session has a full RDP connection established; though if the windows computer doesn't + // support NLA, a login screen might be shown in the session. + TSXConnectionDisconnected = 3 // Session is disconnected at the RDP layer. TSX RDC might still + // be disposing of resources, however. } TSXConnectionState; #pragma mark Session settings -// Represents the type of screen resolution the user has selected. Most are dynamic sizes, meaning that the actual session dimensions are calculated when connecting. +// Represents the type of screen resolution the user has selected. Most are dynamic sizes, meaning +// that the actual session dimensions are calculated when connecting. typedef enum _TSXScreenOptions { - TSXScreenOptionFixed = 0, // A static resolution, like 1024x768 - TSXScreenOptionFitScreen = 1, // Upon connection, fit the session to the entire screen size - TSXScreenOptionCustom = 2, // Like fixed just specified by the user + TSXScreenOptionFixed = 0, // A static resolution, like 1024x768 + TSXScreenOptionFitScreen = 1, // Upon connection, fit the session to the entire screen size + TSXScreenOptionCustom = 2, // Like fixed just specified by the user } TSXScreenOptions; typedef enum _TSXAudioPlaybackOptions { - TSXAudioPlaybackLocal = 0, + TSXAudioPlaybackLocal = 0, TSXAudioPlaybackServer = 1, TSXAudioPlaybackSilent = 2 } TSXAudioPlaybackOptions; typedef enum _TSXProtocolSecurityOptions { - TSXProtocolSecurityAutomatic = 0, - TSXProtocolSecurityRDP = 1, + TSXProtocolSecurityAutomatic = 0, + TSXProtocolSecurityRDP = 1, TSXProtocolSecurityTLS = 2, TSXProtocolSecurityNLA = 3 } TSXProtocolSecurityOptions; diff --git a/client/iOS/Misc/Utils.h b/client/iOS/Misc/Utils.h index 8f64e57fc..65dace60d 100644 --- a/client/iOS/Misc/Utils.h +++ b/client/iOS/Misc/Utils.h @@ -1,42 +1,43 @@ /* Utility functions - + Copyright 2013 Thincast Technologies GmbH, Authors: Martin Fleisz, Dorian Johnson - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import #import #import "TSXTypes.h" -// helper macro to encode a table path into a tag value (used to identify controls in their delegate handlers) +// helper macro to encode a table path into a tag value (used to identify controls in their delegate +// handlers) #define GET_TAG(section, row) ((((int)section) << 16) | ((int)(row))) #define GET_TAG_FROM_PATH(path) ((((int)path.section) << 16) | ((int)(path.row))) - -BOOL ScanHostNameAndPort(NSString* address, NSString** host, unsigned short* port); +BOOL ScanHostNameAndPort(NSString *address, NSString **host, unsigned short *port); #pragma mark - #pragma mark Screen Resolutions -NSString* ScreenResolutionDescription(TSXScreenOptions type, int width, int height); -BOOL ScanScreenResolution(NSString* description, int* width, int* height, TSXScreenOptions* type); +NSString *ScreenResolutionDescription(TSXScreenOptions type, int width, int height); +BOOL ScanScreenResolution(NSString *description, int *width, int *height, TSXScreenOptions *type); -NSDictionary* SelectionForColorSetting(void); -NSArray* ResolutionModes(void); +NSDictionary *SelectionForColorSetting(void); +NSArray *ResolutionModes(void); #pragma mark Security Protocol -NSString* ProtocolSecurityDescription(TSXProtocolSecurityOptions type); -BOOL ScanProtocolSecurity(NSString* description, TSXProtocolSecurityOptions* type); -NSDictionary* SelectionForSecuritySetting(void); +NSString *ProtocolSecurityDescription(TSXProtocolSecurityOptions type); +BOOL ScanProtocolSecurity(NSString *description, TSXProtocolSecurityOptions *type); +NSDictionary *SelectionForSecuritySetting(void); #pragma mark Bookmarks @class BookmarkBase; -NSMutableArray* FilterBookmarks(NSArray* bookmarks, NSArray* filter_words); -NSMutableArray* FilterHistory(NSArray* history, NSString* filterStr); +NSMutableArray *FilterBookmarks(NSArray *bookmarks, NSArray *filter_words); +NSMutableArray *FilterHistory(NSArray *history, NSString *filterStr); #pragma mark iPad/iPhone detection @@ -44,7 +45,7 @@ BOOL IsPad(void); BOOL IsPhone(void); #pragma mark Version Info -NSString* TSXAppFullVersion(void); +NSString *TSXAppFullVersion(void); #pragma mark Touch/Mouse handling @@ -54,10 +55,10 @@ void SetSwapMouseButtonsFlag(BOOL swapped); // set invert scrolling flag void SetInvertScrollingFlag(BOOL invert); -// return event value for left mouse button +// return event value for left mouse button int GetLeftMouseButtonClickEvent(BOOL down); -// return event value for right mouse button +// return event value for right mouse button int GetRightMouseButtonClickEvent(BOOL down); // return event value for mouse move event @@ -74,7 +75,6 @@ CGFloat GetScrollGestureDelta(void); void WakeUpWWAN(void); #pragma mark System Info functions -NSString* TSXGetPlatform(void); +NSString *TSXGetPlatform(void); BOOL TSXDeviceHasJailBreak(void); -NSString* TSXGetPrimaryMACAddress(NSString *sep); - +NSString *TSXGetPrimaryMACAddress(NSString *sep); diff --git a/client/iOS/Misc/Utils.m b/client/iOS/Misc/Utils.m index af41e108a..9b70b5cfc 100644 --- a/client/iOS/Misc/Utils.m +++ b/client/iOS/Misc/Utils.m @@ -4,7 +4,8 @@ Copyright 2013 Thincast Technologies GmbH, Authors: Martin Fleisz, Dorian Johnson This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "Utils.h" @@ -21,8 +22,7 @@ #include #include -BOOL ScanHostNameAndPort(NSString* address, NSString** host, - unsigned short* port) +BOOL ScanHostNameAndPort(NSString *address, NSString **host, unsigned short *port) { *host = @""; *port = 0; @@ -30,8 +30,7 @@ BOOL ScanHostNameAndPort(NSString* address, NSString** host, if (![address length]) return NO; - NSURL* url = [NSURL URLWithString:[NSString stringWithFormat:@"rdp://%@", - address]]; + NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"rdp://%@", address]]; if (!url || ![[url host] length]) return NO; @@ -44,19 +43,18 @@ BOOL ScanHostNameAndPort(NSString* address, NSString** host, #pragma mark - #pragma mark Working with Screen Resolutions -NSString* LocalizedFitScreen() +NSString *LocalizedFitScreen() { - return NSLocalizedString(@"Automatic", - @"Screen resolution selector: Automatic resolution (Full Screen on iPad, reasonable size on iPhone)"); + return NSLocalizedString(@"Automatic", @"Screen resolution selector: Automatic resolution " + @"(Full Screen on iPad, reasonable size on iPhone)"); } -NSString* LocalizedCustom() +NSString *LocalizedCustom() { return NSLocalizedString(@"Custom", @"Screen resolution selector: Custom"); } -BOOL ScanScreenResolution(NSString* description, int* width, int* height, - TSXScreenOptions* type) +BOOL ScanScreenResolution(NSString *description, int *width, int *height, TSXScreenOptions *type) { *height = 0; *width = 0; @@ -73,9 +71,9 @@ BOOL ScanScreenResolution(NSString* description, int* width, int* height, return YES; } - NSArray* resolution_components = [description - componentsSeparatedByCharactersInSet:[NSCharacterSet - characterSetWithCharactersInString:@"x*×"]]; + NSArray *resolution_components = [description + componentsSeparatedByCharactersInSet:[NSCharacterSet + characterSetWithCharactersInString:@"x*×"]]; if ([resolution_components count] != 2) return NO; @@ -85,8 +83,7 @@ BOOL ScanScreenResolution(NSString* description, int* width, int* height, return YES; } -NSString* ScreenResolutionDescription(TSXScreenOptions type, int width, - int height) +NSString *ScreenResolutionDescription(TSXScreenOptions type, int width, int height) { if (type == TSXScreenOptionFitScreen) return LocalizedFitScreen(); @@ -96,48 +93,47 @@ NSString* ScreenResolutionDescription(TSXScreenOptions type, int width, return [NSString stringWithFormat:@"%dx%d", width, height]; } - -NSDictionary* SelectionForColorSetting() +NSDictionary *SelectionForColorSetting() { - OrderedDictionary* dict = [OrderedDictionary dictionaryWithCapacity:3]; - [dict setValue:[NSNumber numberWithInt:8] forKey:NSLocalizedString( - @"Palette Color (8 Bit)", @"8 bit color selection")]; - [dict setValue:[NSNumber numberWithInt:15] forKey:NSLocalizedString( - @"High Color (15 Bit)", @"15 bit color selection")]; - [dict setValue:[NSNumber numberWithInt:16] forKey:NSLocalizedString( - @"High Color (16 Bit)", @"16 bit color selection")]; - [dict setValue:[NSNumber numberWithInt:24] forKey:NSLocalizedString( - @"True Color (24 Bit)", @"24 bit color selection")]; - [dict setValue:[NSNumber numberWithInt:32] forKey:NSLocalizedString( - @"Highest Quality (32 Bit)", @"32 bit color selection")]; + OrderedDictionary *dict = [OrderedDictionary dictionaryWithCapacity:3]; + [dict setValue:[NSNumber numberWithInt:8] + forKey:NSLocalizedString(@"Palette Color (8 Bit)", @"8 bit color selection")]; + [dict setValue:[NSNumber numberWithInt:15] + forKey:NSLocalizedString(@"High Color (15 Bit)", @"15 bit color selection")]; + [dict setValue:[NSNumber numberWithInt:16] + forKey:NSLocalizedString(@"High Color (16 Bit)", @"16 bit color selection")]; + [dict setValue:[NSNumber numberWithInt:24] + forKey:NSLocalizedString(@"True Color (24 Bit)", @"24 bit color selection")]; + [dict setValue:[NSNumber numberWithInt:32] + forKey:NSLocalizedString(@"Highest Quality (32 Bit)", @"32 bit color selection")]; return dict; } -NSArray* ResolutionModes() +NSArray *ResolutionModes() { - NSArray* array = [NSArray arrayWithObjects:ScreenResolutionDescription( - TSXScreenOptionFitScreen, 0, 0), - ScreenResolutionDescription(TSXScreenOptionFixed, 640, 480), - ScreenResolutionDescription(TSXScreenOptionFixed, 800, 600), - ScreenResolutionDescription(TSXScreenOptionFixed, 1024, 768), - ScreenResolutionDescription(TSXScreenOptionFixed, 1280, 1024), - ScreenResolutionDescription(TSXScreenOptionFixed, 1440, 900), - ScreenResolutionDescription(TSXScreenOptionFixed, 1440, 1050), - ScreenResolutionDescription(TSXScreenOptionFixed, 1600, 1200), - ScreenResolutionDescription(TSXScreenOptionFixed, 1920, 1080), - ScreenResolutionDescription(TSXScreenOptionFixed, 1920, 1200), - ScreenResolutionDescription(TSXScreenOptionCustom, 0, 0), nil]; + NSArray *array = + [NSArray arrayWithObjects:ScreenResolutionDescription(TSXScreenOptionFitScreen, 0, 0), + ScreenResolutionDescription(TSXScreenOptionFixed, 640, 480), + ScreenResolutionDescription(TSXScreenOptionFixed, 800, 600), + ScreenResolutionDescription(TSXScreenOptionFixed, 1024, 768), + ScreenResolutionDescription(TSXScreenOptionFixed, 1280, 1024), + ScreenResolutionDescription(TSXScreenOptionFixed, 1440, 900), + ScreenResolutionDescription(TSXScreenOptionFixed, 1440, 1050), + ScreenResolutionDescription(TSXScreenOptionFixed, 1600, 1200), + ScreenResolutionDescription(TSXScreenOptionFixed, 1920, 1080), + ScreenResolutionDescription(TSXScreenOptionFixed, 1920, 1200), + ScreenResolutionDescription(TSXScreenOptionCustom, 0, 0), nil]; return array; } #pragma mark Working with Security Protocols -NSString* LocalizedAutomaticSecurity() +NSString *LocalizedAutomaticSecurity() { return NSLocalizedString(@"Automatic", @"Automatic protocl security selection"); } -NSString* ProtocolSecurityDescription(TSXProtocolSecurityOptions type) +NSString *ProtocolSecurityDescription(TSXProtocolSecurityOptions type) { if (type == TSXProtocolSecurityNLA) return @"NLA"; @@ -149,8 +145,7 @@ NSString* ProtocolSecurityDescription(TSXProtocolSecurityOptions type) return LocalizedAutomaticSecurity(); } -BOOL ScanProtocolSecurity(NSString* description, - TSXProtocolSecurityOptions* type) +BOOL ScanProtocolSecurity(NSString *description, TSXProtocolSecurityOptions *type) { *type = TSXProtocolSecurityRDP; @@ -178,69 +173,69 @@ BOOL ScanProtocolSecurity(NSString* description, return NO; } -NSDictionary* SelectionForSecuritySetting() +NSDictionary *SelectionForSecuritySetting() { - OrderedDictionary* dict = [OrderedDictionary dictionaryWithCapacity:4]; - [dict setValue:[NSNumber numberWithInt:TSXProtocolSecurityAutomatic] forKey: - ProtocolSecurityDescription(TSXProtocolSecurityAutomatic)]; - [dict setValue:[NSNumber numberWithInt:TSXProtocolSecurityRDP] forKey: - ProtocolSecurityDescription(TSXProtocolSecurityRDP)]; - [dict setValue:[NSNumber numberWithInt:TSXProtocolSecurityTLS] forKey: - ProtocolSecurityDescription(TSXProtocolSecurityTLS)]; - [dict setValue:[NSNumber numberWithInt:TSXProtocolSecurityNLA] forKey: - ProtocolSecurityDescription(TSXProtocolSecurityNLA)]; + OrderedDictionary *dict = [OrderedDictionary dictionaryWithCapacity:4]; + [dict setValue:[NSNumber numberWithInt:TSXProtocolSecurityAutomatic] + forKey:ProtocolSecurityDescription(TSXProtocolSecurityAutomatic)]; + [dict setValue:[NSNumber numberWithInt:TSXProtocolSecurityRDP] + forKey:ProtocolSecurityDescription(TSXProtocolSecurityRDP)]; + [dict setValue:[NSNumber numberWithInt:TSXProtocolSecurityTLS] + forKey:ProtocolSecurityDescription(TSXProtocolSecurityTLS)]; + [dict setValue:[NSNumber numberWithInt:TSXProtocolSecurityNLA] + forKey:ProtocolSecurityDescription(TSXProtocolSecurityNLA)]; return dict; } - #pragma mark - #pragma mark Bookmarks #import "Bookmark.h" -NSMutableArray* FilterBookmarks(NSArray* bookmarks, NSArray* filter_words) +NSMutableArray *FilterBookmarks(NSArray *bookmarks, NSArray *filter_words) { - NSMutableArray* matching_items = [NSMutableArray array]; - NSArray* searched_keys = [NSArray arrayWithObjects:@"label", @"params.hostname", - @"params.username", @"params.domain", nil]; + NSMutableArray *matching_items = [NSMutableArray array]; + NSArray *searched_keys = [NSArray + arrayWithObjects:@"label", @"params.hostname", @"params.username", @"params.domain", nil]; - for (ComputerBookmark * cur_bookmark in bookmarks) + for (ComputerBookmark *cur_bookmark in bookmarks) { double match_score = 0.0; for (int i = 0; i < [searched_keys count]; i++) { - NSString* val = [cur_bookmark valueForKeyPath:[searched_keys objectAtIndex:i]]; + NSString *val = [cur_bookmark valueForKeyPath:[searched_keys objectAtIndex:i]]; if (![val isKindOfClass:[NSString class]] || ![val length]) continue; - for (NSString * word in filter_words) - if ([val rangeOfString:word options:(NSCaseInsensitiveSearch | - NSWidthInsensitiveSearch)].location != NSNotFound) + for (NSString *word in filter_words) + if ([val rangeOfString:word + options:(NSCaseInsensitiveSearch | NSWidthInsensitiveSearch)] + .location != NSNotFound) match_score += (1.0 / [filter_words count]) * pow(2, [searched_keys count] - i); } if (match_score > 0.001) - [matching_items addObject:[NSDictionary dictionaryWithObjectsAndKeys: - cur_bookmark, @"bookmark", - [NSNumber numberWithFloat:match_score], @"score", - nil]]; + [matching_items + addObject:[NSDictionary + dictionaryWithObjectsAndKeys:cur_bookmark, @"bookmark", + [NSNumber numberWithFloat:match_score], + @"score", nil]]; } - [matching_items sortUsingComparator:^NSComparisonResult(NSDictionary * obj1, - NSDictionary * obj2) - { - return [[obj2 objectForKey:@"score"] compare:[obj1 objectForKey:@"score"]]; - }]; + [matching_items + sortUsingComparator:^NSComparisonResult(NSDictionary *obj1, NSDictionary *obj2) { + return [[obj2 objectForKey:@"score"] compare:[obj1 objectForKey:@"score"]]; + }]; return matching_items; } -NSMutableArray* FilterHistory(NSArray* history, NSString* filterStr) +NSMutableArray *FilterHistory(NSArray *history, NSString *filterStr) { - NSMutableArray* result = [NSMutableArray array]; + NSMutableArray *result = [NSMutableArray array]; - for (NSString * item in history) + for (NSString *item in history) { if ([item rangeOfString:filterStr].location != NSNotFound) [result addObject:item]; @@ -250,7 +245,7 @@ NSMutableArray* FilterHistory(NSArray* history, NSString* filterStr) } #pragma mark Version Info -NSString* TSXAppFullVersion() +NSString *TSXAppFullVersion() { return [NSString stringWithUTF8String:GIT_REVISION]; } @@ -334,20 +329,18 @@ CGFloat GetScrollGestureDelta() // this hack activates the iphone's WWAN interface in case it is offline void WakeUpWWAN() { - NSURL* url = [[[NSURL alloc] initWithString: - @"http://www.nonexistingdummyurl.com"] autorelease]; - //NSData * data = - [NSData dataWithContentsOfURL: - url]; // we don't need data but assigning one causes a "data not used" compiler warning + NSURL *url = [[[NSURL alloc] initWithString:@"http://www.nonexistingdummyurl.com"] autorelease]; + // NSData * data = + [NSData dataWithContentsOfURL:url]; // we don't need data but assigning one causes a "data not + // used" compiler warning } - #pragma mark System Info functions -NSString* TSXGetPrimaryMACAddress(NSString* sep) +NSString *TSXGetPrimaryMACAddress(NSString *sep) { - NSString* macaddress = @""; - struct ifaddrs* addrs; + NSString *macaddress = @""; + struct ifaddrs *addrs; if (getifaddrs(&addrs) < 0) { @@ -355,22 +348,24 @@ NSString* TSXGetPrimaryMACAddress(NSString* sep) return macaddress; } - for (struct ifaddrs* cursor = addrs; cursor != NULL; cursor = cursor->ifa_next) + for (struct ifaddrs *cursor = addrs; cursor != NULL; cursor = cursor->ifa_next) { if (strcmp(cursor->ifa_name, "en0")) continue; - if ((cursor->ifa_addr->sa_family == AF_LINK) - && (((struct sockaddr_dl*) cursor->ifa_addr)->sdl_type == 0x6 /*IFT_ETHER*/)) + if ((cursor->ifa_addr->sa_family == AF_LINK) && + (((struct sockaddr_dl *)cursor->ifa_addr)->sdl_type == 0x6 /*IFT_ETHER*/)) { - struct sockaddr_dl* dlAddr = (struct sockaddr_dl*) cursor->ifa_addr; + struct sockaddr_dl *dlAddr = (struct sockaddr_dl *)cursor->ifa_addr; if (dlAddr->sdl_alen != 6) continue; - unsigned char* base = (unsigned char*) &dlAddr->sdl_data[dlAddr->sdl_nlen]; - macaddress = [NSString hexStringFromData:base ofSize:6 withSeparator:sep - afterNthChar:1]; + unsigned char *base = (unsigned char *)&dlAddr->sdl_data[dlAddr->sdl_nlen]; + macaddress = [NSString hexStringFromData:base + ofSize:6 + withSeparator:sep + afterNthChar:1]; break; } } @@ -381,8 +376,7 @@ NSString* TSXGetPrimaryMACAddress(NSString* sep) BOOL TSXDeviceHasJailBreak() { - if ([[NSFileManager defaultManager] fileExistsAtPath: - @"/Applications/Cydia.app/"]) + if ([[NSFileManager defaultManager] fileExistsAtPath:@"/Applications/Cydia.app/"]) return YES; if ([[NSFileManager defaultManager] fileExistsAtPath:@"/etc/apt/"]) @@ -391,15 +385,13 @@ BOOL TSXDeviceHasJailBreak() return NO; } -NSString* TSXGetPlatform() +NSString *TSXGetPlatform() { size_t size; sysctlbyname("hw.machine", NULL, &size, NULL, 0); - char* machine = malloc(size); + char *machine = malloc(size); sysctlbyname("hw.machine", machine, &size, NULL, 0); - NSString* platform = [NSString stringWithCString:machine encoding: - NSASCIIStringEncoding]; + NSString *platform = [NSString stringWithCString:machine encoding:NSASCIIStringEncoding]; free(machine); return platform; } - diff --git a/client/iOS/Models/Bookmark.h b/client/iOS/Models/Bookmark.h index 1b7c542be..11f0fb2ce 100644 --- a/client/iOS/Models/Bookmark.h +++ b/client/iOS/Models/Bookmark.h @@ -1,32 +1,33 @@ /* Bookmark model abstraction - - Copyright 2013 Thincast Technologies GmbH, Authors: Dorian Johnson - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ + Copyright 2013 Thincast Technologies GmbH, Authors: Dorian Johnson + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ #import #import #import "ConnectionParams.h" -@interface ComputerBookmark : NSObject { -@protected - ComputerBookmark* _parent; - NSString* _uuid, * _label; - UIImage* _image; - ConnectionParams* _connection_params; - BOOL _connected_via_wlan; +@interface ComputerBookmark : NSObject +{ + @protected + ComputerBookmark *_parent; + NSString *_uuid, *_label; + UIImage *_image; + ConnectionParams *_connection_params; + BOOL _connected_via_wlan; } -@property (nonatomic,assign) ComputerBookmark* parent; -@property (nonatomic,readonly) NSString* uuid; -@property (nonatomic,copy) NSString* label; -@property (nonatomic,retain) UIImage* image; -@property (readonly, nonatomic) ConnectionParams* params; -@property (nonatomic, assign) BOOL conntectedViaWLAN; +@property(nonatomic, assign) ComputerBookmark *parent; +@property(nonatomic, readonly) NSString *uuid; +@property(nonatomic, copy) NSString *label; +@property(nonatomic, retain) UIImage *image; +@property(readonly, nonatomic) ConnectionParams *params; +@property(nonatomic, assign) BOOL conntectedViaWLAN; // Creates a copy of this object, with a new UUID - (id)copy; @@ -38,11 +39,10 @@ - (BOOL)isRenamable; - (BOOL)hasImmutableHost; -- (id)initWithConnectionParameters:(ConnectionParams*)params; +- (id)initWithConnectionParameters:(ConnectionParams *)params; - (id)initWithBaseDefaultParameters; // A copy of @params, with _bookmark_uuid set. -- (ConnectionParams*)copyMarkedParams; +- (ConnectionParams *)copyMarkedParams; @end - diff --git a/client/iOS/Models/Bookmark.m b/client/iOS/Models/Bookmark.m index dc3038032..b496c614b 100644 --- a/client/iOS/Models/Bookmark.m +++ b/client/iOS/Models/Bookmark.m @@ -1,12 +1,12 @@ /* Bookmark model abstraction - - Copyright 2013 Thincast Technologies GmbH, Author: Dorian Johnson - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ + Copyright 2013 Thincast Technologies GmbH, Author: Dorian Johnson + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ #import "Bookmark.h" #import "TSXAdditions.h" @@ -21,67 +21,66 @@ @implementation ComputerBookmark -@synthesize parent=_parent, uuid=_uuid, label=_label, image=_image; -@synthesize params=_connection_params, conntectedViaWLAN = _connected_via_wlan; - +@synthesize parent = _parent, uuid = _uuid, label = _label, image = _image; +@synthesize params = _connection_params, conntectedViaWLAN = _connected_via_wlan; - (id)init { - if (!(self = [super init])) + if (!(self = [super init])) return nil; - + _uuid = [[NSString stringWithUUID] retain]; _label = @""; - _connected_via_wlan = NO; - return self; -} - -// Designated initializer. -- (id)initWithConnectionParameters:(ConnectionParams*)params -{ - if (!(self = [self init])) - return nil; - - _connection_params = [params copy]; - _connected_via_wlan = NO; + _connected_via_wlan = NO; return self; } +// Designated initializer. +- (id)initWithConnectionParameters:(ConnectionParams *)params +{ + if (!(self = [self init])) + return nil; + + _connection_params = [params copy]; + _connected_via_wlan = NO; + return self; +} - (id)initWithCoder:(NSCoder *)decoder { if (!(self = [self init])) return nil; - + if (![decoder allowsKeyedCoding]) [NSException raise:NSInvalidArgumentException format:@"coder must support keyed archiving"]; - + if ([decoder containsValueForKey:@"uuid"]) { [_uuid release]; - _uuid = [[decoder decodeObjectForKey:@"uuid"] retain]; + _uuid = [[decoder decodeObjectForKey:@"uuid"] retain]; } - + if ([decoder containsValueForKey:@"label"]) [self setLabel:[decoder decodeObjectForKey:@"label"]]; - + if ([decoder containsValueForKey:@"connectionParams"]) { [_connection_params release]; _connection_params = [[decoder decodeObjectForKey:@"connectionParams"] retain]; } - + return self; } - (id)initWithBaseDefaultParameters { - return [self initWithConnectionParameters:[[[ConnectionParams alloc] initWithBaseDefaultParameters] autorelease]]; + return [self initWithConnectionParameters:[[[ConnectionParams alloc] + initWithBaseDefaultParameters] autorelease]]; } - (id)copy { - ComputerBookmark* copy = [[[self class] alloc] init]; + ComputerBookmark *copy = [[[self class] alloc] init]; [copy setLabel:[self label]]; copy->_connection_params = [_connection_params copy]; return copy; @@ -89,33 +88,36 @@ - (id)copyWithUUID { - ComputerBookmark* copy = [self copy]; - copy->_uuid = [[self uuid] copy]; - return copy; + ComputerBookmark *copy = [self copy]; + copy->_uuid = [[self uuid] copy]; + return copy; } - (void)encodeWithCoder:(NSCoder *)coder { if (![coder allowsKeyedCoding]) [NSException raise:NSInvalidArgumentException format:@"coder must support keyed archiving"]; - + [coder encodeObject:_uuid forKey:@"uuid"]; [coder encodeObject:_label forKey:@"label"]; [coder encodeObject:_connection_params forKey:@"connectionParams"]; } - (void)dealloc -{ +{ _parent = nil; - [_label release]; _label = nil; - [_uuid release]; _uuid = nil; - [_connection_params release]; _connection_params = nil; + [_label release]; + _label = nil; + [_uuid release]; + _uuid = nil; + [_connection_params release]; + _connection_params = nil; [super dealloc]; } -- (UIImage*)image +- (UIImage *)image { - return nil; + return nil; } - (BOOL)isEqual:(id)object @@ -123,29 +125,40 @@ return [object respondsToSelector:@selector(uuid)] && [[object uuid] isEqual:_uuid]; } -- (NSString*)description +- (NSString *)description { - return ([self label] != nil) ? [self label] : _uuid; + return ([self label] != nil) ? [self label] : _uuid; } - (BOOL)validateValue:(id *)val forKey:(NSString *)key error:(NSError **)error { - NSString* string_value = *val; - + NSString *string_value = *val; + if ([key isEqualToString:@"label"]) { - if (![[string_value stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length]) + if (![[string_value stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] + length]) { if (error) - *error = [NSError errorWithDomain:@"" code:NSKeyValueValidationError userInfo: - [NSDictionary dictionaryWithObjectsAndKeys: - NSLocalizedString(@"Connection labels cannot be blank", @"Bookmark data validation: label blank title."), NSLocalizedDescriptionKey, - NSLocalizedString(@"Please enter the short description of this Connection that will appear in the Connection list.", @"Bookmark data validation: label blank message."), NSLocalizedRecoverySuggestionErrorKey, - nil]]; + *error = [NSError + errorWithDomain:@"" + code:NSKeyValueValidationError + userInfo: + [NSDictionary + dictionaryWithObjectsAndKeys: + NSLocalizedString( + @"Connection labels cannot be blank", + @"Bookmark data validation: label blank title."), + NSLocalizedDescriptionKey, + NSLocalizedString( + @"Please enter the short description of this Connection " + @"that will appear in the Connection list.", + @"Bookmark data validation: label blank message."), + NSLocalizedRecoverySuggestionErrorKey, nil]]; return NO; } } - + return YES; } @@ -155,11 +168,22 @@ return [super validateValue:val forKeyPath:keyPath error:error]; } -- (BOOL)isDeletable { return YES; } -- (BOOL)isMovable { return YES; } -- (BOOL)isRenamable { return YES; } -- (BOOL)hasImmutableHost { return NO; } - +- (BOOL)isDeletable +{ + return YES; +} +- (BOOL)isMovable +{ + return YES; +} +- (BOOL)isRenamable +{ + return YES; +} +- (BOOL)hasImmutableHost +{ + return NO; +} #pragma mark Custom KVC @@ -173,7 +197,7 @@ { [_connection_params willChangeValueForKey:@"resolution"]; [[self params] setInt:type forKey:@"screen_resolution_type"]; - + if (type == TSXScreenOptionFixed) { [[self params] setInt:width forKey:@"width"]; @@ -182,12 +206,13 @@ [_connection_params didChangeValueForKey:@"resolution"]; } else - [NSException raise:NSInvalidArgumentException format:@"%s got invalid screen resolution '%@'", __func__, value]; + [NSException raise:NSInvalidArgumentException + format:@"%s got invalid screen resolution '%@'", __func__, value]; } else { [self willChangeValueForKeyPath:keyPath]; - [super setValue:value forKeyPath:keyPath]; + [super setValue:value forKeyPath:keyPath]; [self didChangeValueForKeyPath:keyPath]; } } @@ -195,63 +220,93 @@ - (id)valueForKeyPath:(NSString *)keyPath { if ([keyPath isEqualToString:@"params.resolution"]) - return ScreenResolutionDescription([[self params] intForKey:@"screen_resolution_type"], [[self params] intForKey:@"width"], [[self params] intForKey:@"height"]); - + return ScreenResolutionDescription([[self params] intForKey:@"screen_resolution_type"], + [[self params] intForKey:@"width"], + [[self params] intForKey:@"height"]); + return [super valueForKeyPath:keyPath]; } -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context -{ +- (void)observeValueForKeyPath:(NSString *)keyPath + ofObject:(id)object + change:(NSDictionary *)change + context:(void *)context +{ if ([[change objectForKey:NSKeyValueChangeNotificationIsPriorKey] boolValue]) [self willChangeValueForKeyPath:keyPath]; else - [self didChangeValueForKeyPath:keyPath]; + [self didChangeValueForKeyPath:keyPath]; } -- (NSDictionary*)targetForChangeNotificationForKeyPath:(NSString*)keyPath +- (NSDictionary *)targetForChangeNotificationForKeyPath:(NSString *)keyPath { - NSString* changed_key = keyPath; - NSObject* changed_object = self; - + NSString *changed_key = keyPath; + NSObject *changed_object = self; + if ([keyPath rangeOfString:@"params."].location == 0) { changed_key = [keyPath substringFromIndex:[@"params." length]]; changed_object = _connection_params; } - - return [NSDictionary dictionaryWithObjectsAndKeys:changed_key, @"key", changed_object, @"object", nil]; + + return [NSDictionary + dictionaryWithObjectsAndKeys:changed_key, @"key", changed_object, @"object", nil]; } - (void)willChangeValueForKeyPath:(NSString *)keyPath { - NSDictionary* target = [self targetForChangeNotificationForKeyPath:keyPath]; + NSDictionary *target = [self targetForChangeNotificationForKeyPath:keyPath]; [[target objectForKey:@"object"] willChangeValueForKey:[target objectForKey:@"key"]]; } - (void)didChangeValueForKeyPath:(NSString *)keyPath { - NSDictionary* target = [self targetForChangeNotificationForKeyPath:keyPath]; + NSDictionary *target = [self targetForChangeNotificationForKeyPath:keyPath]; [[target objectForKey:@"object"] didChangeValueForKey:[target objectForKey:@"key"]]; } -- (ConnectionParams*)copyMarkedParams +- (ConnectionParams *)copyMarkedParams { - ConnectionParams* param_copy = [[self params] copy]; + ConnectionParams *param_copy = [[self params] copy]; [param_copy setValue:[self uuid] forKey:@"_bookmark_uuid"]; return param_copy; } - #pragma mark No children -- (NSUInteger)numberOfChildren { return 0; } -- (NSUInteger)numberOfDescendants { return 1; } -- (BookmarkBase *)childAtIndex:(NSUInteger)index { return nil; } -- (NSUInteger)indexOfChild:(BookmarkBase *)child { return 0; } -- (void)removeChild:(BookmarkBase *)child { } -- (void)addChild:(BookmarkBase *)child { } -- (void)addChild:(BookmarkBase *)child afterExistingChild:(BookmarkBase *)existingChild { } -- (void)addChild:(BookmarkBase *)child atIndex:(NSInteger)index { } -- (BOOL)hasDescendant:(BookmarkBase *)needle { return NO; } -- (BOOL)canContainChildren { return NO; } +- (NSUInteger)numberOfChildren +{ + return 0; +} +- (NSUInteger)numberOfDescendants +{ + return 1; +} +- (BookmarkBase *)childAtIndex:(NSUInteger)index +{ + return nil; +} +- (NSUInteger)indexOfChild:(BookmarkBase *)child +{ + return 0; +} +- (void)removeChild:(BookmarkBase *)child +{ +} +- (void)addChild:(BookmarkBase *)child +{ +} +- (void)addChild:(BookmarkBase *)child afterExistingChild:(BookmarkBase *)existingChild +{ +} +- (void)addChild:(BookmarkBase *)child atIndex:(NSInteger)index +{ +} +- (BOOL)hasDescendant:(BookmarkBase *)needle +{ + return NO; +} +- (BOOL)canContainChildren +{ + return NO; +} @end - diff --git a/client/iOS/Models/ConnectionParams.h b/client/iOS/Models/ConnectionParams.h index d6dc24966..e0e8fa405 100644 --- a/client/iOS/Models/ConnectionParams.h +++ b/client/iOS/Models/ConnectionParams.h @@ -1,47 +1,46 @@ /* Connection Parameters abstraction - - Copyright 2013 Thincast Technologies GmbH, Author: Dorian Johnson - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ + Copyright 2013 Thincast Technologies GmbH, Author: Dorian Johnson + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ #import @interface ConnectionParams : NSObject { -@private - NSMutableDictionary* _connection_params; + @private + NSMutableDictionary *_connection_params; } // Designated initializer. -- (id)initWithDictionary:(NSDictionary*)dict; +- (id)initWithDictionary:(NSDictionary *)dict; - (id)initWithBaseDefaultParameters; // Getting/setting values -- (NSArray*)allKeys; +- (NSArray *)allKeys; - (void)setValue:(id)value forKey:(NSString *)key; -- (id)valueForKey:(NSString*)key; -- (BOOL)hasValueForKey:(NSString*)key; -- (void)setInt:(int)integer forKey:(NSString*)key; -- (int)intForKey:(NSString*)key; -- (void)setBool:(BOOL)v forKey:(NSString*)key; -- (BOOL)boolForKey:(NSString*)key; -- (const char*)UTF8StringForKey:(NSString*)key; -- (NSString*)StringForKey:(NSString*)key; +- (id)valueForKey:(NSString *)key; +- (BOOL)hasValueForKey:(NSString *)key; +- (void)setInt:(int)integer forKey:(NSString *)key; +- (int)intForKey:(NSString *)key; +- (void)setBool:(BOOL)v forKey:(NSString *)key; +- (BOOL)boolForKey:(NSString *)key; +- (const char *)UTF8StringForKey:(NSString *)key; +- (NSString *)StringForKey:(NSString *)key; -- (BOOL)hasValueForKeyPath:(NSString*)key; -- (void)setInt:(int)integer forKeyPath:(NSString*)key; -- (int)intForKeyPath:(NSString*)key; -- (void)setBool:(BOOL)v forKeyPath:(NSString*)key; -- (BOOL)boolForKeyPath:(NSString*)key; -- (const char*)UTF8StringForKeyPath:(NSString*)key; -- (NSString*)StringForKeyPath:(NSString*)key; +- (BOOL)hasValueForKeyPath:(NSString *)key; +- (void)setInt:(int)integer forKeyPath:(NSString *)key; +- (int)intForKeyPath:(NSString *)key; +- (void)setBool:(BOOL)v forKeyPath:(NSString *)key; +- (BOOL)boolForKeyPath:(NSString *)key; +- (const char *)UTF8StringForKeyPath:(NSString *)key; +- (NSString *)StringForKeyPath:(NSString *)key; - -- (int)intForKey:(NSString*)key with3GEnabled:(BOOL)enabled; -- (BOOL)boolForKey:(NSString*)key with3GEnabled:(BOOL)enabled; +- (int)intForKey:(NSString *)key with3GEnabled:(BOOL)enabled; +- (BOOL)boolForKey:(NSString *)key with3GEnabled:(BOOL)enabled; @end diff --git a/client/iOS/Models/ConnectionParams.m b/client/iOS/Models/ConnectionParams.m index 0477c82a5..4cdc91464 100644 --- a/client/iOS/Models/ConnectionParams.m +++ b/client/iOS/Models/ConnectionParams.m @@ -1,12 +1,12 @@ /* Connection Parameters abstraction - - Copyright 2013 Thincast Technologies GmbH, Author: Dorian Johnson - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ + Copyright 2013 Thincast Technologies GmbH, Author: Dorian Johnson + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ #import "ConnectionParams.h" #import "GlobalDefaults.h" @@ -15,37 +15,39 @@ #import "TSXAdditions.h" @interface ConnectionParams (Private) -- (id)initWithConnectionParams:(ConnectionParams*)params; +- (id)initWithConnectionParams:(ConnectionParams *)params; @end @implementation ConnectionParams // Designated initializer. -- (id)initWithDictionary:(NSDictionary*)dict +- (id)initWithDictionary:(NSDictionary *)dict { if (!(self = [super init])) return nil; - + _connection_params = [dict mutableDeepCopy]; - - [self decryptPasswordForKey:@"password"]; - [self decryptPasswordForKey:@"tsg_password"]; - + + [self decryptPasswordForKey:@"password"]; + [self decryptPasswordForKey:@"tsg_password"]; + return self; } -- (void)decryptPasswordForKey:(NSString*)key +- (void)decryptPasswordForKey:(NSString *)key { if ([[_connection_params objectForKey:key] isKindOfClass:[NSData class]]) { - NSString* plaintext_password = [[[EncryptionController sharedEncryptionController] decryptor] decryptString:[_connection_params objectForKey:key]]; + NSString *plaintext_password = [[[EncryptionController sharedEncryptionController] + decryptor] decryptString:[_connection_params objectForKey:key]]; [self setValue:plaintext_password forKey:key]; } } - (id)initWithBaseDefaultParameters { - return [self initWithDictionary:[[NSUserDefaults standardUserDefaults] dictionaryForKey:@"TSXDefaultComputerBookmarkSettings"]]; + return [self initWithDictionary:[[NSUserDefaults standardUserDefaults] + dictionaryForKey:@"TSXDefaultComputerBookmarkSettings"]]; } - (id)init @@ -53,13 +55,14 @@ return [self initWithDictionary:[NSDictionary dictionary]]; } -- (id)initWithConnectionParams:(ConnectionParams*)params +- (id)initWithConnectionParams:(ConnectionParams *)params { return [self initWithDictionary:params->_connection_params]; } - (void)dealloc { - [_connection_params release]; _connection_params = nil; + [_connection_params release]; + _connection_params = nil; [super dealloc]; } @@ -68,7 +71,7 @@ return [[ConnectionParams alloc] initWithDictionary:_connection_params]; } -- (NSString*)description +- (NSString *)description { return [NSString stringWithFormat:@"ConnectionParams: %@", [_connection_params description]]; } @@ -80,36 +83,38 @@ { if ([decoder containsValueForKey:@"connectionParams"]) return [self initWithDictionary:[decoder decodeObjectForKey:@"connectionParams"]]; - + return [self init]; } - (void)encodeWithCoder:(NSCoder *)coder -{ - NSSet* unserializable_keys = [NSSet setWithObjects:@"view", nil]; - NSMutableDictionary* serializable_params = [[NSMutableDictionary alloc] initWithCapacity:[_connection_params count]]; - - for (NSString* k in _connection_params) - if ( ([k characterAtIndex:0] != '_') && ![unserializable_keys containsObject:k]) +{ + NSSet *unserializable_keys = [NSSet setWithObjects:@"view", nil]; + NSMutableDictionary *serializable_params = + [[NSMutableDictionary alloc] initWithCapacity:[_connection_params count]]; + + for (NSString *k in _connection_params) + if (([k characterAtIndex:0] != '_') && ![unserializable_keys containsObject:k]) [serializable_params setObject:[_connection_params objectForKey:k] forKey:k]; - + if ([serializable_params objectForKey:@"password"] != nil) - [self serializeDecryptedForKey:@"password" forParams:serializable_params]; + [self serializeDecryptedForKey:@"password" forParams:serializable_params]; if ([serializable_params objectForKey:@"tsg_password"] != nil) - [self serializeDecryptedForKey:@"tsg_password" forParams:serializable_params]; - + [self serializeDecryptedForKey:@"tsg_password" forParams:serializable_params]; + [coder encodeObject:serializable_params forKey:@"connectionParams"]; [serializable_params release]; } -- (void)serializeDecryptedForKey:(NSString*)key forParams:(NSMutableDictionary*)params +- (void)serializeDecryptedForKey:(NSString *)key forParams:(NSMutableDictionary *)params { - NSData* encrypted_password = [[[EncryptionController sharedEncryptionController] encryptor] encryptString:[params objectForKey:key]]; - - if (encrypted_password) - [params setObject:encrypted_password forKey:key]; - else - [params removeObjectForKey:key]; + NSData *encrypted_password = [[[EncryptionController sharedEncryptionController] encryptor] + encryptString:[params objectForKey:key]]; + + if (encrypted_password) + [params setObject:encrypted_password forKey:key]; + else + [params removeObjectForKey:key]; } #pragma mark - @@ -118,24 +123,24 @@ - (void)setValue:(id)value forKey:(NSString *)key { [self willChangeValueForKey:key]; - + if (value == nil) [self setNilValueForKey:key]; else [_connection_params setValue:value forKey:key]; - + [self didChangeValueForKey:key]; } - (void)setValue:(id)value forKeyPath:(NSString *)key { [self willChangeValueForKey:key]; - + if (value == nil) [self setNilValueForKey:key]; else [_connection_params setValue:value forKeyPath:key]; - + [self didChangeValueForKey:key]; } @@ -144,12 +149,12 @@ [_connection_params removeObjectForKey:key]; } -- (id)valueForKey:(NSString*)key +- (id)valueForKey:(NSString *)key { return [_connection_params valueForKey:key]; } -- (NSArray*)allKeys +- (NSArray *)allKeys { return [_connection_params allKeys]; } @@ -157,100 +162,97 @@ #pragma mark - #pragma mark KV convenience -- (BOOL)hasValueForKey:(NSString*)key +- (BOOL)hasValueForKey:(NSString *)key { return [_connection_params objectForKey:key] != nil; } -- (void)setInt:(int)integer forKey:(NSString*)key +- (void)setInt:(int)integer forKey:(NSString *)key { [self setValue:[NSNumber numberWithInteger:integer] forKey:key]; } -- (int)intForKey:(NSString*)key +- (int)intForKey:(NSString *)key { return [[self valueForKey:key] intValue]; } - -- (void)setBool:(BOOL)v forKey:(NSString*)key +- (void)setBool:(BOOL)v forKey:(NSString *)key { [self setValue:[NSNumber numberWithBool:v] forKey:key]; } -- (BOOL)boolForKey:(NSString*)key +- (BOOL)boolForKey:(NSString *)key { return [[_connection_params objectForKey:key] boolValue]; } - -- (const char*)UTF8StringForKey:(NSString*)key +- (const char *)UTF8StringForKey:(NSString *)key { id val = [self valueForKey:key]; - const char* str; - + const char *str; + if ([val respondsToSelector:@selector(UTF8String)] && (str = [val UTF8String])) return str; - + return ""; } -- (NSString*)StringForKey:(NSString*)key +- (NSString *)StringForKey:(NSString *)key { return [self valueForKey:key]; } -- (BOOL)hasValueForKeyPath:(NSString*)key +- (BOOL)hasValueForKeyPath:(NSString *)key { - return [_connection_params valueForKeyPath:key] != nil; + return [_connection_params valueForKeyPath:key] != nil; } -- (void)setInt:(int)integer forKeyPath:(NSString*)key +- (void)setInt:(int)integer forKeyPath:(NSString *)key { [self setValue:[NSNumber numberWithInteger:integer] forKeyPath:key]; } -- (int)intForKeyPath:(NSString*)key +- (int)intForKeyPath:(NSString *)key { return [[self valueForKeyPath:key] intValue]; } -- (void)setBool:(BOOL)v forKeyPath:(NSString*)key +- (void)setBool:(BOOL)v forKeyPath:(NSString *)key { [self setValue:[NSNumber numberWithBool:v] forKeyPath:key]; } -- (BOOL)boolForKeyPath:(NSString*)key +- (BOOL)boolForKeyPath:(NSString *)key { return [[self valueForKeyPath:key] boolValue]; } -- (const char*)UTF8StringForKeyPath:(NSString*)key +- (const char *)UTF8StringForKeyPath:(NSString *)key { id val = [self valueForKeyPath:key]; - const char* str; - + const char *str; + if ([val respondsToSelector:@selector(UTF8String)] && (str = [val UTF8String])) return str; - + return ""; } -- (NSString*)StringForKeyPath:(NSString*)key +- (NSString *)StringForKeyPath:(NSString *)key { return [self valueForKeyPath:key]; } -- (int)intForKey:(NSString*)key with3GEnabled:(BOOL)enabled +- (int)intForKey:(NSString *)key with3GEnabled:(BOOL)enabled { - if (enabled && [self boolForKey:@"enable_3g_settings"]) - return [self intForKeyPath:[NSString stringWithFormat:@"settings_3g.%@", key]]; - return [self intForKeyPath:key]; + if (enabled && [self boolForKey:@"enable_3g_settings"]) + return [self intForKeyPath:[NSString stringWithFormat:@"settings_3g.%@", key]]; + return [self intForKeyPath:key]; } -- (BOOL)boolForKey:(NSString*)key with3GEnabled:(BOOL)enabled +- (BOOL)boolForKey:(NSString *)key with3GEnabled:(BOOL)enabled { - if (enabled && [self boolForKey:@"enable_3g_settings"]) - return [self boolForKeyPath:[NSString stringWithFormat:@"settings_3g.%@", key]]; - return [self boolForKeyPath:key]; + if (enabled && [self boolForKey:@"enable_3g_settings"]) + return [self boolForKeyPath:[NSString stringWithFormat:@"settings_3g.%@", key]]; + return [self boolForKeyPath:key]; } @end - diff --git a/client/iOS/Models/Encryptor.h b/client/iOS/Models/Encryptor.h index 7f3305733..c0592c0db 100644 --- a/client/iOS/Models/Encryptor.h +++ b/client/iOS/Models/Encryptor.h @@ -1,10 +1,11 @@ /* Password Encryptor - + Copyright 2013 Thincast Technologies GmbH, Author: Dorian Johnson - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ /* Encrypts data using AES 128 with a 256 bit key derived using PBKDF2-HMAC-SHA1 */ @@ -23,20 +24,20 @@ #define TSXEncryptorPBKDF2SaltLen TSXEncryptorBlockCipherOptions #define TSXEncryptorPBKDF2KeySize TSXEncryptorBlockCipherKeySize - -@interface Encryptor : NSObject { -@private - NSData* _encryption_key; - NSString* _plaintext_password; +@interface Encryptor : NSObject +{ + @private + NSData *_encryption_key; + NSString *_plaintext_password; } -@property(readonly) NSString* plaintextPassword; +@property(readonly) NSString *plaintextPassword; -- (id)initWithPassword:(NSString*)plaintext_password; +- (id)initWithPassword:(NSString *)plaintext_password; -- (NSData*)encryptData:(NSData*)plaintext_data; -- (NSData*)decryptData:(NSData*)encrypted_data; -- (NSData*)encryptString:(NSString*)plaintext_string; -- (NSString*)decryptString:(NSData*)encrypted_string; +- (NSData *)encryptData:(NSData *)plaintext_data; +- (NSData *)decryptData:(NSData *)encrypted_data; +- (NSData *)encryptString:(NSString *)plaintext_string; +- (NSString *)decryptString:(NSData *)encrypted_string; @end diff --git a/client/iOS/Models/Encryptor.m b/client/iOS/Models/Encryptor.m index 5ca686b98..7bebb9615 100644 --- a/client/iOS/Models/Encryptor.m +++ b/client/iOS/Models/Encryptor.m @@ -1,56 +1,64 @@ /* Password Encryptor - + Copyright 2013 Thincast Technologies GmbH, Author: Dorian Johnson - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ -/* We try to use CommonCrypto as much as possible. PBKDF2 was added to CommonCrypto in iOS 5, so use OpenSSL only as a fallback to do PBKDF2 on pre iOS 5 systems. */ +/* We try to use CommonCrypto as much as possible. PBKDF2 was added to CommonCrypto in iOS 5, so use + * OpenSSL only as a fallback to do PBKDF2 on pre iOS 5 systems. */ #import "Encryptor.h" -#import -#import -#import +#import +#import +#import #import // For PBKDF2 on < 5.0 #include #pragma mark - @interface Encryptor (Private) -- (NSData*)randomInitializationVector; +- (NSData *)randomInitializationVector; @end @implementation Encryptor -@synthesize plaintextPassword=_plaintext_password; +@synthesize plaintextPassword = _plaintext_password; -- (id)initWithPassword:(NSString*)plaintext_password +- (id)initWithPassword:(NSString *)plaintext_password { if (plaintext_password == nil) - return nil; - - if ( !(self = [super init]) ) return nil; - + + if (!(self = [super init])) + return nil; + _plaintext_password = [plaintext_password retain]; - const char* plaintext_password_data = [plaintext_password length] ? [plaintext_password UTF8String] : " "; - + const char *plaintext_password_data = + [plaintext_password length] ? [plaintext_password UTF8String] : " "; + if (!plaintext_password_data || !strlen(plaintext_password_data)) - [NSException raise:NSInternalInconsistencyException format:@"%s: plaintext password data is zero length!", __func__]; - - - uint8_t* derived_key = calloc(1, TSXEncryptorPBKDF2KeySize); - + [NSException raise:NSInternalInconsistencyException + format:@"%s: plaintext password data is zero length!", __func__]; + + uint8_t *derived_key = calloc(1, TSXEncryptorPBKDF2KeySize); + if (CCKeyDerivationPBKDF != NULL) { - int ret = CCKeyDerivationPBKDF(kCCPBKDF2, plaintext_password_data, strlen(plaintext_password_data)-1, (const uint8_t*)TSXEncryptorPBKDF2Salt, TSXEncryptorPBKDF2SaltLen, kCCPRFHmacAlgSHA1, TSXEncryptorPBKDF2Rounds, derived_key, TSXEncryptorPBKDF2KeySize); - //NSLog(@"CCKeyDerivationPBKDF ret = %d; key: %@", ret, [NSData dataWithBytesNoCopy:derived_key length:TWEncryptorPBKDF2KeySize freeWhenDone:NO]); - + int ret = CCKeyDerivationPBKDF( + kCCPBKDF2, plaintext_password_data, strlen(plaintext_password_data) - 1, + (const uint8_t *)TSXEncryptorPBKDF2Salt, TSXEncryptorPBKDF2SaltLen, kCCPRFHmacAlgSHA1, + TSXEncryptorPBKDF2Rounds, derived_key, TSXEncryptorPBKDF2KeySize); + // NSLog(@"CCKeyDerivationPBKDF ret = %d; key: %@", ret, [NSData + // dataWithBytesNoCopy:derived_key length:TWEncryptorPBKDF2KeySize freeWhenDone:NO]); + if (ret) { - NSLog(@"%s: CCKeyDerivationPBKDF ret == %d, indicating some sort of failure.", __func__, ret); - free(derived_key); + NSLog(@"%s: CCKeyDerivationPBKDF ret == %d, indicating some sort of failure.", __func__, + ret); + free(derived_key); [self autorelease]; return nil; } @@ -58,115 +66,139 @@ else { // iOS 4.x or earlier -- use OpenSSL - unsigned long ret = PKCS5_PBKDF2_HMAC_SHA1(plaintext_password_data, (int)strlen(plaintext_password_data)-1, (const unsigned char*)TSXEncryptorPBKDF2Salt, TSXEncryptorPBKDF2SaltLen, TSXEncryptorPBKDF2Rounds, TSXEncryptorPBKDF2KeySize, derived_key); - //NSLog(@"PKCS5_PBKDF2_HMAC_SHA1 ret = %lu; key: %@", ret, [NSData dataWithBytesNoCopy:derived_key length:TWEncryptorPBKDF2KeySize freeWhenDone:NO]); - + unsigned long ret = PKCS5_PBKDF2_HMAC_SHA1( + plaintext_password_data, (int)strlen(plaintext_password_data) - 1, + (const unsigned char *)TSXEncryptorPBKDF2Salt, TSXEncryptorPBKDF2SaltLen, + TSXEncryptorPBKDF2Rounds, TSXEncryptorPBKDF2KeySize, derived_key); + // NSLog(@"PKCS5_PBKDF2_HMAC_SHA1 ret = %lu; key: %@", ret, [NSData + // dataWithBytesNoCopy:derived_key length:TWEncryptorPBKDF2KeySize freeWhenDone:NO]); + if (ret != 1) { - NSLog(@"%s: PKCS5_PBKDF2_HMAC_SHA1 ret == %lu, indicating some sort of failure.", __func__, ret); - free(derived_key); + NSLog(@"%s: PKCS5_PBKDF2_HMAC_SHA1 ret == %lu, indicating some sort of failure.", + __func__, ret); + free(derived_key); [self release]; return nil; } - } - - - _encryption_key = [[NSData alloc] initWithBytesNoCopy:derived_key length:TSXEncryptorPBKDF2KeySize freeWhenDone:YES]; + } + + _encryption_key = [[NSData alloc] initWithBytesNoCopy:derived_key + length:TSXEncryptorPBKDF2KeySize + freeWhenDone:YES]; return self; } - #pragma mark - #pragma mark Encrypting/Decrypting data -- (NSData*)encryptData:(NSData*)plaintext_data +- (NSData *)encryptData:(NSData *)plaintext_data { if (![plaintext_data length]) return nil; - - NSData* iv = [self randomInitializationVector]; - NSMutableData* encrypted_data = [NSMutableData dataWithLength:[iv length] + [plaintext_data length] + TSXEncryptorBlockCipherBlockSize]; + + NSData *iv = [self randomInitializationVector]; + NSMutableData *encrypted_data = [NSMutableData + dataWithLength:[iv length] + [plaintext_data length] + TSXEncryptorBlockCipherBlockSize]; [encrypted_data replaceBytesInRange:NSMakeRange(0, [iv length]) withBytes:[iv bytes]]; - + size_t data_out_moved = 0; - int ret = CCCrypt(kCCEncrypt, TSXEncryptorBlockCipherAlgo, TSXEncryptorBlockCipherOptions, [_encryption_key bytes], TSXEncryptorBlockCipherKeySize, [iv bytes], [plaintext_data bytes], [plaintext_data length], [encrypted_data mutableBytes]+[iv length], [encrypted_data length]-[iv length], &data_out_moved); - + int ret = CCCrypt(kCCEncrypt, TSXEncryptorBlockCipherAlgo, TSXEncryptorBlockCipherOptions, + [_encryption_key bytes], TSXEncryptorBlockCipherKeySize, [iv bytes], + [plaintext_data bytes], [plaintext_data length], + [encrypted_data mutableBytes] + [iv length], + [encrypted_data length] - [iv length], &data_out_moved); + switch (ret) { case kCCSuccess: [encrypted_data setLength:[iv length] + data_out_moved]; return encrypted_data; - + default: - NSLog(@"%s: uncaught error, ret CCCryptorStatus = %d (plaintext len = %lu; buffer size = %lu)", __func__, ret, (unsigned long)[plaintext_data length], (unsigned long)([encrypted_data length]-[iv length])); + NSLog( + @"%s: uncaught error, ret CCCryptorStatus = %d (plaintext len = %lu; buffer size = " + @"%lu)", + __func__, ret, (unsigned long)[plaintext_data length], + (unsigned long)([encrypted_data length] - [iv length])); return nil; } - + return nil; } -- (NSData*)decryptData:(NSData*)encrypted_data +- (NSData *)decryptData:(NSData *)encrypted_data { if ([encrypted_data length] <= TSXEncryptorBlockCipherBlockSize) return nil; - - NSMutableData* plaintext_data = [NSMutableData dataWithLength:[encrypted_data length] + TSXEncryptorBlockCipherBlockSize]; + + NSMutableData *plaintext_data = + [NSMutableData dataWithLength:[encrypted_data length] + TSXEncryptorBlockCipherBlockSize]; size_t data_out_moved = 0; - - int ret = CCCrypt(kCCDecrypt, TSXEncryptorBlockCipherAlgo, TSXEncryptorBlockCipherOptions, [_encryption_key bytes], TSXEncryptorBlockCipherKeySize, [encrypted_data bytes], [encrypted_data bytes] + TSXEncryptorBlockCipherBlockSize, [encrypted_data length] - TSXEncryptorBlockCipherBlockSize, [plaintext_data mutableBytes], [plaintext_data length], &data_out_moved); - + + int ret = + CCCrypt(kCCDecrypt, TSXEncryptorBlockCipherAlgo, TSXEncryptorBlockCipherOptions, + [_encryption_key bytes], TSXEncryptorBlockCipherKeySize, [encrypted_data bytes], + [encrypted_data bytes] + TSXEncryptorBlockCipherBlockSize, + [encrypted_data length] - TSXEncryptorBlockCipherBlockSize, + [plaintext_data mutableBytes], [plaintext_data length], &data_out_moved); + switch (ret) { case kCCSuccess: [plaintext_data setLength:data_out_moved]; return plaintext_data; - - case kCCBufferTooSmall: // Our output buffer is big enough to decrypt valid data. This return code indicates malformed data. + + case kCCBufferTooSmall: // Our output buffer is big enough to decrypt valid data. This + // return code indicates malformed data. case kCCAlignmentError: // Shouldn't get this, since we're using padding. - case kCCDecodeError: // Wrong key. + case kCCDecodeError: // Wrong key. return nil; - + default: - NSLog(@"%s: uncaught error, ret CCCryptorStatus = %d (encrypted data len = %lu; buffer size = %lu; dom = %lu)", __func__, ret, (unsigned long)[encrypted_data length], (unsigned long)[plaintext_data length], data_out_moved); + NSLog(@"%s: uncaught error, ret CCCryptorStatus = %d (encrypted data len = %lu; buffer " + @"size = %lu; dom = %lu)", + __func__, ret, (unsigned long)[encrypted_data length], + (unsigned long)[plaintext_data length], data_out_moved); return nil; } - + return nil; } - -- (NSData*)encryptString:(NSString*)plaintext_string +- (NSData *)encryptString:(NSString *)plaintext_string { return [self encryptData:[plaintext_string dataUsingEncoding:NSUTF8StringEncoding]]; } -- (NSString*)decryptString:(NSData*)encrypted_string +- (NSString *)decryptString:(NSData *)encrypted_string { - return [[[NSString alloc] initWithData:[self decryptData:encrypted_string] encoding:NSUTF8StringEncoding] autorelease]; + return [[[NSString alloc] initWithData:[self decryptData:encrypted_string] + encoding:NSUTF8StringEncoding] autorelease]; } -- (NSData*)randomInitializationVector +- (NSData *)randomInitializationVector { - NSMutableData* iv = [NSMutableData dataWithLength:TSXEncryptorBlockCipherBlockSize]; + NSMutableData *iv = [NSMutableData dataWithLength:TSXEncryptorBlockCipherBlockSize]; int fd; - - if ( (fd = open("/dev/urandom", O_RDONLY)) < 0) + + if ((fd = open("/dev/urandom", O_RDONLY)) < 0) return nil; - + NSInteger bytes_needed = [iv length]; - char* p = [iv mutableBytes]; - + char *p = [iv mutableBytes]; + while (bytes_needed) { long bytes_read = read(fd, p, bytes_needed); - + if (bytes_read < 0) continue; - + p += bytes_read; bytes_needed -= bytes_read; } - + close(fd); return iv; } diff --git a/client/iOS/Models/GlobalDefaults.h b/client/iOS/Models/GlobalDefaults.h index 9bcc3f322..4d98aa3a5 100644 --- a/client/iOS/Models/GlobalDefaults.h +++ b/client/iOS/Models/GlobalDefaults.h @@ -1,29 +1,30 @@ /* Global default bookmark settings - - Copyright 2013 Thincast Technologies GmbH, Author: Dorian Johnson - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ + Copyright 2013 Thincast Technologies GmbH, Author: Dorian Johnson + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ #import @class ConnectionParams, ComputerBookmark; -@interface GlobalDefaults : NSObject{ -@private - ComputerBookmark* _default_bookmark; +@interface GlobalDefaults : NSObject +{ + @private + ComputerBookmark *_default_bookmark; } -+ (GlobalDefaults*)sharedGlobalDefaults; ++ (GlobalDefaults *)sharedGlobalDefaults; // The same object is always returned from this method. -@property (readonly,nonatomic) ComputerBookmark* bookmark; +@property(readonly, nonatomic) ComputerBookmark *bookmark; -- (ConnectionParams*)newParams; -- (ComputerBookmark*)newBookmark; -- (ComputerBookmark*)newTestServerBookmark; +- (ConnectionParams *)newParams; +- (ComputerBookmark *)newBookmark; +- (ComputerBookmark *)newTestServerBookmark; @end diff --git a/client/iOS/Models/GlobalDefaults.m b/client/iOS/Models/GlobalDefaults.m index fcb09b064..2ed06f05c 100644 --- a/client/iOS/Models/GlobalDefaults.m +++ b/client/iOS/Models/GlobalDefaults.m @@ -4,7 +4,8 @@ Copyright 2013 Thincast Technologies GmbH, Author: Dorian Johnson This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "GlobalDefaults.h" @@ -13,9 +14,9 @@ @implementation GlobalDefaults -+ (GlobalDefaults*)sharedGlobalDefaults ++ (GlobalDefaults *)sharedGlobalDefaults { - static GlobalDefaults* _shared_global_defaults = nil; + static GlobalDefaults *_shared_global_defaults = nil; if (_shared_global_defaults == nil) { @@ -34,16 +35,15 @@ if (!(self = [super init])) return nil; - ComputerBookmark* bookmark = nil; - NSData* bookmark_data = [[NSUserDefaults standardUserDefaults] objectForKey: - @"TSXSharedGlobalDefaultBookmark"]; + ComputerBookmark *bookmark = nil; + NSData *bookmark_data = + [[NSUserDefaults standardUserDefaults] objectForKey:@"TSXSharedGlobalDefaultBookmark"]; if (bookmark_data && [bookmark_data length]) bookmark = [NSKeyedUnarchiver unarchiveObjectWithData:bookmark_data]; if (!bookmark) - bookmark = [[[ComputerBookmark alloc] initWithBaseDefaultParameters] - autorelease]; + bookmark = [[[ComputerBookmark alloc] initWithBaseDefaultParameters] autorelease]; _default_bookmark = [bookmark retain]; return self; @@ -59,21 +59,20 @@ @synthesize bookmark = _default_bookmark; -- (ComputerBookmark*)newBookmark +- (ComputerBookmark *)newBookmark { - return [[ComputerBookmark alloc] initWithConnectionParameters:[[self newParams] - autorelease]]; + return [[ComputerBookmark alloc] initWithConnectionParameters:[[self newParams] autorelease]]; } -- (ConnectionParams*)newParams +- (ConnectionParams *)newParams { - ConnectionParams* param_copy = [[[self bookmark] params] copy]; + ConnectionParams *param_copy = [[[self bookmark] params] copy]; return param_copy; } -- (ComputerBookmark*)newTestServerBookmark +- (ComputerBookmark *)newTestServerBookmark { - ComputerBookmark* bm = [self newBookmark]; + ComputerBookmark *bm = [self newBookmark]; [bm setLabel:@"Test Server"]; [[bm params] setValue:@"testservice.ifreerdp.com" forKey:@"hostname"]; [[bm params] setInt:0 forKey:@"screen_resolution_type"]; diff --git a/client/iOS/Models/RDPKeyboard.h b/client/iOS/Models/RDPKeyboard.h index 3e23069ca..0757d994b 100644 --- a/client/iOS/Models/RDPKeyboard.h +++ b/client/iOS/Models/RDPKeyboard.h @@ -1,10 +1,11 @@ /* - RDP Keyboard helper - + RDP Keyboard helper + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @@ -12,40 +13,39 @@ @class RDPKeyboard; - @protocol RDPKeyboardDelegate @optional -- (void)modifiersChangedForKeyboard:(RDPKeyboard*)keyboard; +- (void)modifiersChangedForKeyboard:(RDPKeyboard *)keyboard; @end +@interface RDPKeyboard : NSObject +{ -@interface RDPKeyboard : NSObject { + RDPSession *_session; - RDPSession* _session; - int _virtual_key_map[256]; - int _unicode_map[256]; - NSDictionary* _special_keys; + int _unicode_map[256]; + NSDictionary *_special_keys; + + NSObject *_delegate; - NSObject* _delegate; - BOOL _ctrl_pressed; - BOOL _alt_pressed; - BOOL _shift_pressed; - BOOL _win_pressed; + BOOL _alt_pressed; + BOOL _shift_pressed; + BOOL _win_pressed; } -@property (assign) id delegate; -@property (readonly) BOOL ctrlPressed; -@property (readonly) BOOL altPressed; -@property (readonly) BOOL shiftPressed; -@property (readonly) BOOL winPressed; +@property(assign) id delegate; +@property(readonly) BOOL ctrlPressed; +@property(readonly) BOOL altPressed; +@property(readonly) BOOL shiftPressed; +@property(readonly) BOOL winPressed; // returns a keyboard instance -+ (RDPKeyboard*)getSharedRDPKeyboard; ++ (RDPKeyboard *)getSharedRDPKeyboard; // init the keyboard and assign the given rdp session and delegate -- (void)initWithSession:(RDPSession*)session delegate:(NSObject*)delegate; +- (void)initWithSession:(RDPSession *)session delegate:(NSObject *)delegate; // called to reset any pending key states (i.e. pressed modifier keys) - (void)reset; diff --git a/client/iOS/Models/RDPKeyboard.m b/client/iOS/Models/RDPKeyboard.m index 8b5545082..47ebdd90c 100644 --- a/client/iOS/Models/RDPKeyboard.m +++ b/client/iOS/Models/RDPKeyboard.m @@ -1,10 +1,11 @@ /* - RDP Keyboard helper - + RDP Keyboard helper + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "RDPKeyboard.h" @@ -19,17 +20,18 @@ @implementation RDPKeyboard -@synthesize delegate = _delegate, ctrlPressed = _ctrl_pressed, altPressed = _alt_pressed, shiftPressed = _shift_pressed, winPressed = _win_pressed; +@synthesize delegate = _delegate, ctrlPressed = _ctrl_pressed, altPressed = _alt_pressed, + shiftPressed = _shift_pressed, winPressed = _win_pressed; - (id)init { - if((self = [super init]) != nil) + if ((self = [super init]) != nil) { - [self initWithSession:nil delegate:nil]; - + [self initWithSession:nil delegate:nil]; + memset(_virtual_key_map, 0, sizeof(_virtual_key_map)); - memset(_unicode_map, 0, sizeof(_unicode_map)); - + memset(_unicode_map, 0, sizeof(_unicode_map)); + // init vkey map - used for alpha-num characters _virtual_key_map['0'] = VK_KEY_0; _virtual_key_map['1'] = VK_KEY_1; @@ -41,7 +43,7 @@ _virtual_key_map['7'] = VK_KEY_7; _virtual_key_map['8'] = VK_KEY_8; _virtual_key_map['9'] = VK_KEY_9; - + _virtual_key_map['a'] = VK_KEY_A; _virtual_key_map['b'] = VK_KEY_B; _virtual_key_map['c'] = VK_KEY_C; @@ -68,42 +70,42 @@ _virtual_key_map['x'] = VK_KEY_X; _virtual_key_map['y'] = VK_KEY_Y; _virtual_key_map['z'] = VK_KEY_Z; - - // init scancode map - used for special characters - _unicode_map['-'] = 45; - _unicode_map['/'] = 47; - _unicode_map[':'] = 58; - _unicode_map[';'] = 59; - _unicode_map['('] = 40; - _unicode_map[')'] = 41; - _unicode_map['&'] = 38; - _unicode_map['@'] = 64; - _unicode_map['.'] = 46; - _unicode_map[','] = 44; - _unicode_map['?'] = 63; - _unicode_map['!'] = 33; - _unicode_map['\''] = 39; - _unicode_map['\"'] = 34; - - _unicode_map['['] = 91; - _unicode_map[']'] = 93; - _unicode_map['{'] = 123; - _unicode_map['}'] = 125; - _unicode_map['#'] = 35; - _unicode_map['%'] = 37; - _unicode_map['^'] = 94; - _unicode_map['*'] = 42; - _unicode_map['+'] = 43; - _unicode_map['='] = 61; - _unicode_map['_'] = 95; - _unicode_map['\\'] = 92; - _unicode_map['|'] = 124; - _unicode_map['~'] = 126; - _unicode_map['<'] = 60; - _unicode_map['>'] = 62; - _unicode_map['$'] = 36; - } + // init scancode map - used for special characters + _unicode_map['-'] = 45; + _unicode_map['/'] = 47; + _unicode_map[':'] = 58; + _unicode_map[';'] = 59; + _unicode_map['('] = 40; + _unicode_map[')'] = 41; + _unicode_map['&'] = 38; + _unicode_map['@'] = 64; + _unicode_map['.'] = 46; + _unicode_map[','] = 44; + _unicode_map['?'] = 63; + _unicode_map['!'] = 33; + _unicode_map['\''] = 39; + _unicode_map['\"'] = 34; + + _unicode_map['['] = 91; + _unicode_map[']'] = 93; + _unicode_map['{'] = 123; + _unicode_map['}'] = 125; + _unicode_map['#'] = 35; + _unicode_map['%'] = 37; + _unicode_map['^'] = 94; + _unicode_map['*'] = 42; + _unicode_map['+'] = 43; + _unicode_map['='] = 61; + + _unicode_map['_'] = 95; + _unicode_map['\\'] = 92; + _unicode_map['|'] = 124; + _unicode_map['~'] = 126; + _unicode_map['<'] = 60; + _unicode_map['>'] = 62; + _unicode_map['$'] = 36; + } return self; } @@ -116,114 +118,114 @@ #pragma mark class methods // return a keyboard instance -+ (RDPKeyboard*)getSharedRDPKeyboard ++ (RDPKeyboard *)getSharedRDPKeyboard { - static RDPKeyboard* _shared_keyboard = nil; - + static RDPKeyboard *_shared_keyboard = nil; + if (_shared_keyboard == nil) { @synchronized(self) { if (_shared_keyboard == nil) - _shared_keyboard = [[RDPKeyboard alloc] init]; + _shared_keyboard = [[RDPKeyboard alloc] init]; } } - - return _shared_keyboard; + + return _shared_keyboard; } // reset the keyboard instance and assign the given rdp instance - (void)initWithSession:(RDPSession *)session delegate:(NSObject *)delegate { - _alt_pressed = NO; - _ctrl_pressed = NO; - _shift_pressed = NO; - _win_pressed = NO; - - _session = session; - _delegate = delegate; + _alt_pressed = NO; + _ctrl_pressed = NO; + _shift_pressed = NO; + _win_pressed = NO; + + _session = session; + _delegate = delegate; } - (void)reset { - // reset pressed ctrl, alt, shift or win key - if(_shift_pressed) - [self toggleShiftKey]; - if(_alt_pressed) - [self toggleAltKey]; - if(_ctrl_pressed) - [self toggleCtrlKey]; - if(_win_pressed) - [self toggleWinKey]; + // reset pressed ctrl, alt, shift or win key + if (_shift_pressed) + [self toggleShiftKey]; + if (_alt_pressed) + [self toggleAltKey]; + if (_ctrl_pressed) + [self toggleCtrlKey]; + if (_win_pressed) + [self toggleWinKey]; } // handles button pressed input event from the iOS keyboard // performs all conversions etc. - (void)sendUnicode:(int)character -{ - if(isalnum(character)) - [self handleAlphaNumChar:character]; - else - [self handleSpecialKey:character]; +{ + if (isalnum(character)) + [self handleAlphaNumChar:character]; + else + [self handleSpecialKey:character]; - [self reset]; + [self reset]; } // send a backspace key press - (void)sendVirtualKeyCode:(int)keyCode { - [self sendVirtualKey:keyCode up:NO]; - [self sendVirtualKey:keyCode up:YES]; + [self sendVirtualKey:keyCode up:NO]; + [self sendVirtualKey:keyCode up:YES]; } #pragma mark modifier key handling // toggle ctrl key, returns true if pressed, otherwise false - (void)toggleCtrlKey -{ - [self sendVirtualKey:VK_LCONTROL up:_ctrl_pressed]; - _ctrl_pressed = !_ctrl_pressed; - [self notifyDelegateModifiersChanged]; +{ + [self sendVirtualKey:VK_LCONTROL up:_ctrl_pressed]; + _ctrl_pressed = !_ctrl_pressed; + [self notifyDelegateModifiersChanged]; } // toggle alt key, returns true if pressed, otherwise false - (void)toggleAltKey { - [self sendVirtualKey:VK_LMENU up:_alt_pressed]; - _alt_pressed = !_alt_pressed; - [self notifyDelegateModifiersChanged]; + [self sendVirtualKey:VK_LMENU up:_alt_pressed]; + _alt_pressed = !_alt_pressed; + [self notifyDelegateModifiersChanged]; } // toggle shift key, returns true if pressed, otherwise false - (void)toggleShiftKey { - [self sendVirtualKey:VK_LSHIFT up:_shift_pressed]; - _shift_pressed = !_shift_pressed; - [self notifyDelegateModifiersChanged]; + [self sendVirtualKey:VK_LSHIFT up:_shift_pressed]; + _shift_pressed = !_shift_pressed; + [self notifyDelegateModifiersChanged]; } // toggle windows key, returns true if pressed, otherwise false - (void)toggleWinKey { - [self sendVirtualKey:(VK_LWIN | KBDEXT) up:_win_pressed]; - _win_pressed = !_win_pressed; - [self notifyDelegateModifiersChanged]; + [self sendVirtualKey:(VK_LWIN | KBDEXT) up:_win_pressed]; + _win_pressed = !_win_pressed; + [self notifyDelegateModifiersChanged]; } #pragma mark Sending special key strokes - (void)sendEnterKeyStroke { - [self sendVirtualKeyCode:(VK_RETURN | KBDEXT)]; + [self sendVirtualKeyCode:(VK_RETURN | KBDEXT)]; } - (void)sendEscapeKeyStroke { - [self sendVirtualKeyCode:VK_ESCAPE]; + [self sendVirtualKeyCode:VK_ESCAPE]; } - (void)sendBackspaceKeyStroke { - [self sendVirtualKeyCode:VK_BACK]; + [self sendVirtualKeyCode:VK_BACK]; } @end @@ -233,74 +235,76 @@ - (void)handleAlphaNumChar:(int)character { - // if we recive an uppercase letter - make it lower and send an shift down event to server - BOOL shift_was_sent = NO; - if(isupper(character) && _shift_pressed == NO) - { - character = tolower(character); - [self sendVirtualKey:VK_LSHIFT up:NO]; - shift_was_sent = YES; - } - - // convert the character to a VK - int vk = _virtual_key_map[character]; - if(vk != 0) - { - // send key pressed - [self sendVirtualKey:vk up:NO]; - [self sendVirtualKey:vk up:YES]; - } - - // send the missing shift up if we had a shift down - if(shift_was_sent) - [self sendVirtualKey:VK_LSHIFT up:YES]; + // if we recive an uppercase letter - make it lower and send an shift down event to server + BOOL shift_was_sent = NO; + if (isupper(character) && _shift_pressed == NO) + { + character = tolower(character); + [self sendVirtualKey:VK_LSHIFT up:NO]; + shift_was_sent = YES; + } + + // convert the character to a VK + int vk = _virtual_key_map[character]; + if (vk != 0) + { + // send key pressed + [self sendVirtualKey:vk up:NO]; + [self sendVirtualKey:vk up:YES]; + } + + // send the missing shift up if we had a shift down + if (shift_was_sent) + [self sendVirtualKey:VK_LSHIFT up:YES]; } - (void)handleSpecialKey:(int)character { - NSDictionary* eventDescriptor = nil; - if(character < 256) - { - // convert the character to a unicode character - int code = _unicode_map[character]; - if(code != 0) - eventDescriptor = [NSDictionary dictionaryWithObjectsAndKeys: - @"keyboard", @"type", - @"unicode", @"subtype", - [NSNumber numberWithUnsignedShort:0], @"flags", - [NSNumber numberWithUnsignedShort:code], @"unicode_char", - nil]; - } + NSDictionary *eventDescriptor = nil; + if (character < 256) + { + // convert the character to a unicode character + int code = _unicode_map[character]; + if (code != 0) + eventDescriptor = [NSDictionary + dictionaryWithObjectsAndKeys:@"keyboard", @"type", @"unicode", @"subtype", + [NSNumber numberWithUnsignedShort:0], @"flags", + [NSNumber numberWithUnsignedShort:code], + @"unicode_char", nil]; + } - if (eventDescriptor == nil) - eventDescriptor = [NSDictionary dictionaryWithObjectsAndKeys: - @"keyboard", @"type", - @"unicode", @"subtype", - [NSNumber numberWithUnsignedShort:0], @"flags", - [NSNumber numberWithUnsignedShort:character], @"unicode_char", - nil]; + if (eventDescriptor == nil) + eventDescriptor = [NSDictionary + dictionaryWithObjectsAndKeys:@"keyboard", @"type", @"unicode", @"subtype", + [NSNumber numberWithUnsignedShort:0], @"flags", + [NSNumber numberWithUnsignedShort:character], + @"unicode_char", nil]; - [_session sendInputEvent:eventDescriptor]; + [_session sendInputEvent:eventDescriptor]; } // sends the vk code to the session - (void)sendVirtualKey:(int)vKey up:(BOOL)up { - DWORD scancode = GetVirtualScanCodeFromVirtualKeyCode(vKey, 4); - int flags = (up ? KBD_FLAGS_RELEASE : KBD_FLAGS_DOWN); - flags |= ((scancode & KBDEXT) ? KBD_FLAGS_EXTENDED : 0); - [_session sendInputEvent:[NSDictionary dictionaryWithObjectsAndKeys: - @"keyboard", @"type", - @"scancode", @"subtype", - [NSNumber numberWithUnsignedShort:flags], @"flags", - [NSNumber numberWithUnsignedShort:(scancode & 0xFF)], @"scancode", - nil]]; + DWORD scancode = GetVirtualScanCodeFromVirtualKeyCode(vKey, 4); + int flags = (up ? KBD_FLAGS_RELEASE : KBD_FLAGS_DOWN); + flags |= ((scancode & KBDEXT) ? KBD_FLAGS_EXTENDED : 0); + [_session + sendInputEvent:[NSDictionary + dictionaryWithObjectsAndKeys:@"keyboard", @"type", @"scancode", + @"subtype", + [NSNumber numberWithUnsignedShort:flags], + @"flags", + [NSNumber + numberWithUnsignedShort:(scancode & + 0xFF)], + @"scancode", nil]]; } - (void)notifyDelegateModifiersChanged { - if ([[self delegate] respondsToSelector:@selector(modifiersChangedForKeyboard:)]) - [[self delegate] modifiersChangedForKeyboard:self]; + if ([[self delegate] respondsToSelector:@selector(modifiersChangedForKeyboard:)]) + [[self delegate] modifiersChangedForKeyboard:self]; } @end diff --git a/client/iOS/Models/RDPSession.h b/client/iOS/Models/RDPSession.h index 67e04eaa4..f010b775e 100644 --- a/client/iOS/Models/RDPSession.h +++ b/client/iOS/Models/RDPSession.h @@ -1,10 +1,11 @@ /* - RDP Session object - + RDP Session object + Copyright 2013 Thincast Technologies GmbH, Authors: Martin Fleisz, Dorian Johnson - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @@ -18,91 +19,91 @@ @class ConnectionParams; // notification handler for session disconnect -extern NSString* TSXSessionDidDisconnectNotification; -extern NSString* TSXSessionDidFailToConnectNotification; +extern NSString *TSXSessionDidDisconnectNotification; +extern NSString *TSXSessionDidFailToConnectNotification; // protocol for session notifications @protocol RDPSessionDelegate @optional -- (void)session:(RDPSession*)session didFailToConnect:(int)reason; -- (void)sessionWillConnect:(RDPSession*)session; -- (void)sessionDidConnect:(RDPSession*)session; -- (void)sessionWillDisconnect:(RDPSession*)session; -- (void)sessionDidDisconnect:(RDPSession*)session; -- (void)sessionBitmapContextWillChange:(RDPSession*)session; -- (void)sessionBitmapContextDidChange:(RDPSession*)session; -- (void)session:(RDPSession*)session needsRedrawInRect:(CGRect)rect; -- (CGSize)sizeForFitScreenForSession:(RDPSession*)session; +- (void)session:(RDPSession *)session didFailToConnect:(int)reason; +- (void)sessionWillConnect:(RDPSession *)session; +- (void)sessionDidConnect:(RDPSession *)session; +- (void)sessionWillDisconnect:(RDPSession *)session; +- (void)sessionDidDisconnect:(RDPSession *)session; +- (void)sessionBitmapContextWillChange:(RDPSession *)session; +- (void)sessionBitmapContextDidChange:(RDPSession *)session; +- (void)session:(RDPSession *)session needsRedrawInRect:(CGRect)rect; +- (CGSize)sizeForFitScreenForSession:(RDPSession *)session; -- (void)session:(RDPSession*)session requestsAuthenticationWithParams:(NSMutableDictionary*)params; -- (void)session:(RDPSession*)session verifyCertificateWithParams:(NSMutableDictionary*)params; +- (void)session:(RDPSession *)session + requestsAuthenticationWithParams:(NSMutableDictionary *)params; +- (void)session:(RDPSession *)session verifyCertificateWithParams:(NSMutableDictionary *)params; @end // rdp session -@interface RDPSession : NSObject +@interface RDPSession : NSObject { -@private - freerdp* _freerdp; + @private + freerdp *_freerdp; + + ComputerBookmark *_bookmark; + + ConnectionParams *_params; + + NSObject *_delegate; + + NSCondition *_ui_request_completed; + + NSString *_name; + + // flag if the session is suspended + BOOL _suspended; - ComputerBookmark* _bookmark; - - ConnectionParams* _params; - - NSObject* _delegate; - - NSCondition* _ui_request_completed; - - NSString* _name; - - // flag if the session is suspended - BOOL _suspended; - // flag that specifies whether the RDP toolbar is visible - BOOL _toolbar_visible; + BOOL _toolbar_visible; } -@property (readonly) ConnectionParams* params; -@property (readonly) ComputerBookmark* bookmark; -@property (assign) id delegate; -@property (assign) BOOL toolbarVisible; -@property (readonly) CGContextRef bitmapContext; -@property (readonly) NSCondition* uiRequestCompleted; - +@property(readonly) ConnectionParams *params; +@property(readonly) ComputerBookmark *bookmark; +@property(assign) id delegate; +@property(assign) BOOL toolbarVisible; +@property(readonly) CGContextRef bitmapContext; +@property(readonly) NSCondition *uiRequestCompleted; // initialize a new session with the given bookmark -- (id)initWithBookmark:(ComputerBookmark*)bookmark; +- (id)initWithBookmark:(ComputerBookmark *)bookmark; #pragma mark - session control functions // connect the session --(void)connect; +- (void)connect; // disconnect session --(void)disconnect; +- (void)disconnect; // suspends the session --(void)suspend; +- (void)suspend; // resumes a previously suspended session --(void)resume; +- (void)resume; // returns YES if the session is started --(BOOL)isSuspended; +- (BOOL)isSuspended; // send input event to the server --(void)sendInputEvent:(NSDictionary*)event; +- (void)sendInputEvent:(NSDictionary *)event; // session needs a refresh of its view -- (void)setNeedsDisplayInRectAsValue:(NSValue*)rect_value; +- (void)setNeedsDisplayInRectAsValue:(NSValue *)rect_value; // get a small session screenshot -- (UIImage*)getScreenshotWithSize:(CGSize)size; +- (UIImage *)getScreenshotWithSize:(CGSize)size; // returns the session's current paramters -- (rdpSettings*)getSessionParams; +- (rdpSettings *)getSessionParams; // returns the session's name (usually the label of the bookmark the session was created with) -- (NSString*)sessionName; +- (NSString *)sessionName; @end diff --git a/client/iOS/Models/RDPSession.m b/client/iOS/Models/RDPSession.m index 252997f1f..220311b57 100644 --- a/client/iOS/Models/RDPSession.m +++ b/client/iOS/Models/RDPSession.m @@ -4,7 +4,8 @@ Copyright 2013 Thincast Technologies GmbH, Authors: Martin Fleisz, Dorian Johnson This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "ios_freerdp.h" @@ -16,14 +17,13 @@ #import "Bookmark.h" #import "ConnectionParams.h" -NSString* TSXSessionDidDisconnectNotification = @"TSXSessionDidDisconnect"; -NSString* TSXSessionDidFailToConnectNotification = - @"TSXSessionDidFailToConnect"; +NSString *TSXSessionDidDisconnectNotification = @"TSXSessionDidDisconnect"; +NSString *TSXSessionDidFailToConnectNotification = @"TSXSessionDidFailToConnect"; -@interface RDPSession(Private) +@interface RDPSession (Private) - (void)runSession; -- (void)runSessionFinished:(NSNumber*)result; -- (mfInfo*)mfi; +- (void)runSessionFinished:(NSNumber *)result; +- (mfInfo *)mfi; // The connection thread calls these on the main thread. - (void)sessionWillConnect; @@ -36,20 +36,19 @@ NSString* TSXSessionDidFailToConnectNotification = @implementation RDPSession -@synthesize delegate = _delegate, params = _params, - toolbarVisible = _toolbar_visible, uiRequestCompleted = _ui_request_completed, - bookmark = _bookmark; +@synthesize delegate = _delegate, params = _params, toolbarVisible = _toolbar_visible, + uiRequestCompleted = _ui_request_completed, bookmark = _bookmark; + (void)initialize { ios_init_freerdp(); } -static BOOL addArgument(int* argc, char** *argv, const char* fmt, ...) +static BOOL addArgument(int *argc, char ***argv, const char *fmt, ...) { va_list ap; - char* arg = NULL; - char** tmp = realloc(*argv, (*argc + 1) * sizeof(char*)); + char *arg = NULL; + char **tmp = realloc(*argv, (*argc + 1) * sizeof(char *)); if (!tmp) return FALSE; @@ -63,12 +62,12 @@ static BOOL addArgument(int* argc, char** *argv, const char* fmt, ...) return TRUE; } -static BOOL addFlag(int* argc, char** *argv, const char* str, BOOL flag) +static BOOL addFlag(int *argc, char ***argv, const char *str, BOOL flag) { return addArgument(argc, argv, "%s%s", flag ? "+" : "-", str); } -static void freeArguments(int argc, char** argv) +static void freeArguments(int argc, char **argv) { int i; @@ -79,18 +78,18 @@ static void freeArguments(int argc, char** argv) } // Designated initializer. -- (id)initWithBookmark:(ComputerBookmark*)bookmark +- (id)initWithBookmark:(ComputerBookmark *)bookmark { int status; - char** argv = NULL; + char **argv = NULL; int argc = 0; if (!(self = [super init])) return nil; if (!bookmark) - [NSException raise:NSInvalidArgumentException format: - @"%s: params may not be nil.", __func__]; + [NSException raise:NSInvalidArgumentException + format:@"%s: params may not be nil.", __func__]; _bookmark = [bookmark retain]; _params = [[bookmark params] copy]; @@ -107,13 +106,13 @@ static void freeArguments(int argc, char** argv) if (!addArgument(&argc, &argv, "/gdi:sw")) goto out_free; - // Screen Size is set on connect (we need a valid delegate in case the user choose an automatic screen size) + // Screen Size is set on connect (we need a valid delegate in case the user choose an automatic + // screen size) // Other simple numeric settings if ([_params hasValueForKey:@"colors"]) - if (!addArgument(&argc, &argv, - "/bpp:%d", [_params intForKey:@"colors" with3GEnabled: - connected_via_3g])) + if (!addArgument(&argc, &argv, "/bpp:%d", + [_params intForKey:@"colors" with3GEnabled:connected_via_3g])) goto out_free; if ([_params hasValueForKey:@"port"]) @@ -124,43 +123,38 @@ static void freeArguments(int argc, char** argv) if (!addArgument(&argc, &argv, "/admin")) goto out_free; - if (!addArgument(&argc, &argv, "/v:%s", [_params UTF8StringForKey: - @"hostname"])) + if (!addArgument(&argc, &argv, "/v:%s", [_params UTF8StringForKey:@"hostname"])) goto out_free; // String settings if ([[_params StringForKey:@"username"] length]) { - if (!addArgument(&argc, &argv, "/u:%s", [_params UTF8StringForKey: - @"username"])) + if (!addArgument(&argc, &argv, "/u:%s", [_params UTF8StringForKey:@"username"])) goto out_free; } if ([[_params StringForKey:@"password"] length]) { - if (!addArgument(&argc, &argv, "/p:%s", [_params UTF8StringForKey: - @"password"])) + if (!addArgument(&argc, &argv, "/p:%s", [_params UTF8StringForKey:@"password"])) goto out_free; } if ([[_params StringForKey:@"domain"] length]) { - if (!addArgument(&argc, &argv, "/d:%s", [_params UTF8StringForKey: - @"domain"])) + if (!addArgument(&argc, &argv, "/d:%s", [_params UTF8StringForKey:@"domain"])) goto out_free; } if ([[_params StringForKey:@"working_directory"] length]) { - if (!addArgument(&argc, &argv, "/shell-dir:%s", [_params UTF8StringForKey: - @"working_directory"])) + if (!addArgument(&argc, &argv, "/shell-dir:%s", + [_params UTF8StringForKey:@"working_directory"])) goto out_free; } if ([[_params StringForKey:@"remote_program"] length]) { - if (!addArgument(&argc, &argv, "/shell:%s", [_params UTF8StringForKey: - @"remote_program"])) + if (!addArgument(&argc, &argv, "/shell:%s", [_params UTF8StringForKey:@"remote_program"])) goto out_free; } @@ -186,30 +180,28 @@ static void freeArguments(int argc, char** argv) if (!addFlag(&argc, &argv, "bitmap-cache", TRUE)) goto out_free; - if (!addFlag(&argc, &argv, "wallpaper", [_params boolForKey:@"perf_show_desktop" - with3GEnabled:connected_via_3g])) + if (!addFlag(&argc, &argv, "wallpaper", + [_params boolForKey:@"perf_show_desktop" with3GEnabled:connected_via_3g])) goto out_free; - if (!addFlag(&argc, &argv, - "window-drag", [_params boolForKey:@"perf_window_dragging" - with3GEnabled:connected_via_3g])) + if (!addFlag(&argc, &argv, "window-drag", + [_params boolForKey:@"perf_window_dragging" with3GEnabled:connected_via_3g])) goto out_free; - if (!addFlag(&argc, &argv, - "menu-anims", [_params boolForKey:@"perf_menu_animation" - with3GEnabled:connected_via_3g])) + if (!addFlag(&argc, &argv, "menu-anims", + [_params boolForKey:@"perf_menu_animation" with3GEnabled:connected_via_3g])) goto out_free; - if (!addFlag(&argc, &argv, "themes", [_params boolForKey:@"perf_windows_themes" - with3GEnabled:connected_via_3g])) + if (!addFlag(&argc, &argv, "themes", + [_params boolForKey:@"perf_windows_themes" with3GEnabled:connected_via_3g])) goto out_free; - if (!addFlag(&argc, &argv, "fonts", [_params boolForKey:@"perf_font_smoothing" - with3GEnabled:connected_via_3g])) + if (!addFlag(&argc, &argv, "fonts", + [_params boolForKey:@"perf_font_smoothing" with3GEnabled:connected_via_3g])) goto out_free; - if (!addFlag(&argc, &argv, "aero", [_params boolForKey: - @"perf_desktop_composition" with3GEnabled:connected_via_3g])) + if (!addFlag(&argc, &argv, "aero", + [_params boolForKey:@"perf_desktop_composition" with3GEnabled:connected_via_3g])) goto out_free; if ([_params hasValueForKey:@"width"]) @@ -248,8 +240,7 @@ static void freeArguments(int argc, char** argv) // ts gateway settings if ([_params boolForKey:@"enable_tsg_settings"]) { - if (!addArgument(&argc, &argv, - "/g:%s", [_params UTF8StringForKey:@"tsg_hostname"])) + if (!addArgument(&argc, &argv, "/g:%s", [_params UTF8StringForKey:@"tsg_hostname"])) goto out_free; if (!addArgument(&argc, &argv, "/gp:%d", [_params intForKey:@"tsg_port"])) @@ -269,9 +260,7 @@ static void freeArguments(int argc, char** argv) if (!addArgument(&argc, &argv, "/kbd:%d", 0x409)) goto out_free; - status = freerdp_client_settings_parse_command_line(_freerdp->settings, argc, - argv, - FALSE); + status = freerdp_client_settings_parse_command_line(_freerdp->settings, argc, argv, FALSE); if (0 != status) goto out_free; @@ -307,7 +296,7 @@ out_free: - (void)connect { // Set Screen Size to automatic if widht or height are still 0 - rdpSettings* settings = _freerdp->settings; + rdpSettings *settings = _freerdp->settings; if (settings->DesktopWidth == 0 || settings->DesktopHeight == 0) { @@ -325,7 +314,8 @@ out_free: } } - // TODO: This is a hack to ensure connections to RDVH with 16bpp don't have an odd screen resolution width + // TODO: This is a hack to ensure connections to RDVH with 16bpp don't have an odd screen + // resolution width // Otherwise this could result in screen corruption .. if (settings->ColorDepth <= 16) settings->DesktopWidth &= (~1); @@ -335,9 +325,8 @@ out_free: - (void)disconnect { - mfInfo* mfi = [self mfi]; - ios_events_send(mfi, [NSDictionary dictionaryWithObject:@"disconnect" forKey: - @"type"]); + mfInfo *mfi = [self mfi]; + ios_events_send(mfi, [NSDictionary dictionaryWithObject:@"disconnect" forKey:@"type"]); if (mfi->connection_state == TSXConnectionConnecting) { @@ -353,7 +342,7 @@ out_free: } // suspends the session --(void)suspend +- (void)suspend { if (!_suspended) { @@ -363,7 +352,7 @@ out_free: } // resumes a previously suspended session --(void)resume +- (void)resume { if (_suspended) { @@ -380,7 +369,7 @@ out_free: } // returns YES if the session is started --(BOOL)isSuspended +- (BOOL)isSuspended { return _suspended; } @@ -388,7 +377,7 @@ out_free: #pragma mark - #pragma mark Input events -- (void)sendInputEvent:(NSDictionary*)eventDescriptor +- (void)sendInputEvent:(NSDictionary *)eventDescriptor { if ([self mfi]->connection_state == TSXConnectionConnected) ios_events_send([self mfi], eventDescriptor); @@ -397,17 +386,16 @@ out_free: #pragma mark - #pragma mark Server events (main thread) -- (void)setNeedsDisplayInRectAsValue:(NSValue*)rect_value +- (void)setNeedsDisplayInRectAsValue:(NSValue *)rect_value { if ([[self delegate] respondsToSelector:@selector(session:needsRedrawInRect:)]) [[self delegate] session:self needsRedrawInRect:[rect_value CGRectValue]]; } - #pragma mark - #pragma mark interface functions -- (UIImage*)getScreenshotWithSize:(CGSize)size +- (UIImage *)getScreenshotWithSize:(CGSize)size { NSAssert([self mfi]->bitmap_context != nil, @"Screenshot requested while having no valid RDP drawing context"); @@ -415,20 +403,20 @@ out_free: UIGraphicsBeginImageContext(size); CGContextTranslateCTM(UIGraphicsGetCurrentContext(), 0, size.height); CGContextScaleCTM(UIGraphicsGetCurrentContext(), 1.0, -1.0); - CGContextDrawImage(UIGraphicsGetCurrentContext(), CGRectMake(0, 0, size.width, - size.height), cgImage); - UIImage* viewImage = UIGraphicsGetImageFromCurrentImageContext(); + CGContextDrawImage(UIGraphicsGetCurrentContext(), CGRectMake(0, 0, size.width, size.height), + cgImage); + UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); CGImageRelease(cgImage); return viewImage; } -- (rdpSettings*)getSessionParams +- (rdpSettings *)getSessionParams { return _freerdp->settings; } -- (NSString*)sessionName +- (NSString *)sessionName { return _name; } @@ -436,9 +424,9 @@ out_free: @end #pragma mark - -@implementation RDPSession(Private) +@implementation RDPSession (Private) -- (mfInfo*)mfi +- (mfInfo *)mfi { return MFI_FROM_INSTANCE(_freerdp); } @@ -446,19 +434,21 @@ out_free: // Blocks until rdp session finishes. - (void)runSession { - NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // Run the session - [self performSelectorOnMainThread:@selector(sessionWillConnect) withObject:nil - waitUntilDone:YES]; + [self performSelectorOnMainThread:@selector(sessionWillConnect) + withObject:nil + waitUntilDone:YES]; int result_code = ios_run_freerdp(_freerdp); [self mfi]->connection_state = TSXConnectionDisconnected; - [self performSelectorOnMainThread:@selector(runSessionFinished:) withObject: - [NSNumber numberWithInt:result_code] waitUntilDone:YES]; + [self performSelectorOnMainThread:@selector(runSessionFinished:) + withObject:[NSNumber numberWithInt:result_code] + waitUntilDone:YES]; [pool release]; } // Main thread. -- (void)runSessionFinished:(NSNumber*)result +- (void)runSessionFinished:(NSNumber *)result { int result_code = [result intValue]; @@ -497,8 +487,9 @@ out_free: - (void)sessionDidFailToConnect:(int)reason { - [[NSNotificationCenter defaultCenter] postNotificationName: - TSXSessionDidFailToConnectNotification object:self]; + [[NSNotificationCenter defaultCenter] + postNotificationName:TSXSessionDidFailToConnectNotification + object:self]; if ([[self delegate] respondsToSelector:@selector(session:didFailToConnect:)]) [[self delegate] session:self didFailToConnect:reason]; @@ -506,8 +497,8 @@ out_free: - (void)sessionDidDisconnect { - [[NSNotificationCenter defaultCenter] postNotificationName: - TSXSessionDidDisconnectNotification object:self]; + [[NSNotificationCenter defaultCenter] postNotificationName:TSXSessionDidDisconnectNotification + object:self]; if ([[self delegate] respondsToSelector:@selector(sessionDidDisconnect:)]) [[self delegate] sessionDidDisconnect:self]; @@ -515,29 +506,25 @@ out_free: - (void)sessionBitmapContextWillChange { - if ([[self delegate] respondsToSelector:@selector( - sessionBitmapContextWillChange:)]) + if ([[self delegate] respondsToSelector:@selector(sessionBitmapContextWillChange:)]) [[self delegate] sessionBitmapContextWillChange:self]; } - (void)sessionBitmapContextDidChange { - if ([[self delegate] respondsToSelector:@selector(sessionBitmapContextDidChange - :)]) + if ([[self delegate] respondsToSelector:@selector(sessionBitmapContextDidChange:)]) [[self delegate] sessionBitmapContextDidChange:self]; } -- (void)sessionRequestsAuthenticationWithParams:(NSMutableDictionary*)params +- (void)sessionRequestsAuthenticationWithParams:(NSMutableDictionary *)params { - if ([[self delegate] respondsToSelector:@selector(session: - requestsAuthenticationWithParams:)]) + if ([[self delegate] respondsToSelector:@selector(session:requestsAuthenticationWithParams:)]) [[self delegate] session:self requestsAuthenticationWithParams:params]; } -- (void)sessionVerifyCertificateWithParams:(NSMutableDictionary*)params +- (void)sessionVerifyCertificateWithParams:(NSMutableDictionary *)params { - if ([[self delegate] respondsToSelector:@selector(session: - verifyCertificateWithParams:)]) + if ([[self delegate] respondsToSelector:@selector(session:verifyCertificateWithParams:)]) [[self delegate] session:self verifyCertificateWithParams:params]; } diff --git a/client/iOS/Views/AdvancedKeyboardView.h b/client/iOS/Views/AdvancedKeyboardView.h index b86584bd3..2aa6cae27 100644 --- a/client/iOS/Views/AdvancedKeyboardView.h +++ b/client/iOS/Views/AdvancedKeyboardView.h @@ -1,12 +1,12 @@ /* Advanced keyboard view interface - - Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ #import @@ -15,36 +15,34 @@ @optional // called when a function key was pressed and a virtual keycode is provided // @key: virtual key code --(void)advancedKeyPressedVKey:(int)key; +- (void)advancedKeyPressedVKey:(int)key; // called when a function key was pressed and the keys unicode is provided // @key: unicode character --(void)advancedKeyPressedUnicode:(int)key; +- (void)advancedKeyPressedUnicode:(int)key; @end - -@interface AdvancedKeyboardView : UIView +@interface AdvancedKeyboardView : UIView { -@private - // view containing function keys (F-keys) and function block (ins, del, home, end, ...) - UIView* _function_keys_view; + @private + // view containing function keys (F-keys) and function block (ins, del, home, end, ...) + UIView *_function_keys_view; - // view containing numpad keys (0-9, +-/*) - UIView* _numpad_keys_view; - - // view containing cursor keys (up, down, left, right) - UIView* _cursor_keys_view; - - // currently visible view - UIView* _cur_view; + // view containing numpad keys (0-9, +-/*) + UIView *_numpad_keys_view; - // delegate - NSObject* _delegate; + // view containing cursor keys (up, down, left, right) + UIView *_cursor_keys_view; + + // currently visible view + UIView *_cur_view; + + // delegate + NSObject *_delegate; } -@property (assign) NSObject* delegate; +@property(assign) NSObject *delegate; // init keyboard view with frame and delegate -- (id)initWithFrame:(CGRect)frame delegate:(NSObject*)delegate; +- (id)initWithFrame:(CGRect)frame delegate:(NSObject *)delegate; @end - diff --git a/client/iOS/Views/AdvancedKeyboardView.m b/client/iOS/Views/AdvancedKeyboardView.m index 5cdf6a26d..a6e3299de 100644 --- a/client/iOS/Views/AdvancedKeyboardView.m +++ b/client/iOS/Views/AdvancedKeyboardView.m @@ -1,12 +1,12 @@ /* Advanced keyboard view interface - - Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ #import "AdvancedKeyboardView.h" #include @@ -14,12 +14,12 @@ // helper struct to define button layouts/settings struct ButtonItem { - NSString* title; - int tag; + NSString *title; + int tag; }; @interface AdvancedKeyboardView (Private) -- (UIView*)keyboardViewForItems:(struct ButtonItem*)items columns:(int)columns rows:(int)rows; +- (UIView *)keyboardViewForItems:(struct ButtonItem *)items columns:(int)columns rows:(int)rows; @end @implementation AdvancedKeyboardView @@ -27,151 +27,137 @@ struct ButtonItem @synthesize delegate = _delegate; // defines for the different views -#define KEY_SHOW_FUNCVIEW 0x1000 -#define KEY_SHOW_CURSORVIEW 0x1001 -#define KEY_SHOW_NUMPADVIEW 0x1002 -#define KEY_SKIP 0x8000 -#define KEY_MERGE_COLUMN 0x8001 +#define KEY_SHOW_FUNCVIEW 0x1000 +#define KEY_SHOW_CURSORVIEW 0x1001 +#define KEY_SHOW_NUMPADVIEW 0x1002 +#define KEY_SKIP 0x8000 +#define KEY_MERGE_COLUMN 0x8001 -#define KEYCODE_UNICODE 0x80000000 +#define KEYCODE_UNICODE 0x80000000 -struct ButtonItem functionKeysItems[24] = -{ - { @"F1", VK_F1 }, - { @"F2", VK_F2 }, - { @"F3", VK_F3 }, - { @"F4", VK_F4 }, - { @"F5", VK_F5 }, - { @"F6", VK_F6 }, - { @"F7", VK_F7 }, - { @"F8", VK_F8 }, - { @"F9", VK_F9 }, - { @"F10", VK_F10 }, - { @"F11", VK_F11 }, - { @"F12", VK_F12 }, - - { @"img:icon_key_arrows", KEY_SHOW_CURSORVIEW }, - { @"Tab", VK_TAB }, - { @"Ins", VK_INSERT | KBDEXT }, - { @"Home", VK_HOME | KBDEXT }, - { @"PgUp", VK_PRIOR | KBDEXT }, - { @"img:icon_key_win", VK_LWIN | KBDEXT }, +struct ButtonItem functionKeysItems[24] = { { @"F1", VK_F1 }, + { @"F2", VK_F2 }, + { @"F3", VK_F3 }, + { @"F4", VK_F4 }, + { @"F5", VK_F5 }, + { @"F6", VK_F6 }, + { @"F7", VK_F7 }, + { @"F8", VK_F8 }, + { @"F9", VK_F9 }, + { @"F10", VK_F10 }, + { @"F11", VK_F11 }, + { @"F12", VK_F12 }, - { @"123", KEY_SHOW_NUMPADVIEW }, - { @"Print", VK_PRINT }, - { @"Del", VK_DELETE | KBDEXT }, - { @"End", VK_END | KBDEXT }, - { @"PgDn", VK_NEXT | KBDEXT }, - { @"img:icon_key_menu", VK_APPS | KBDEXT } -}; + { @"img:icon_key_arrows", KEY_SHOW_CURSORVIEW }, + { @"Tab", VK_TAB }, + { @"Ins", VK_INSERT | KBDEXT }, + { @"Home", VK_HOME | KBDEXT }, + { @"PgUp", VK_PRIOR | KBDEXT }, + { @"img:icon_key_win", VK_LWIN | KBDEXT }, + { @"123", KEY_SHOW_NUMPADVIEW }, + { @"Print", VK_PRINT }, + { @"Del", VK_DELETE | KBDEXT }, + { @"End", VK_END | KBDEXT }, + { @"PgDn", VK_NEXT | KBDEXT }, + { @"img:icon_key_menu", VK_APPS | KBDEXT } }; -struct ButtonItem numPadKeysItems[24] = -{ - { @"(", KEYCODE_UNICODE | 40 }, - { @")", KEYCODE_UNICODE | 41 }, - { @"7", VK_NUMPAD7 }, - { @"8", VK_NUMPAD8 }, - { @"9", VK_NUMPAD9 }, - { @"-", VK_SUBTRACT }, +struct ButtonItem numPadKeysItems[24] = { { @"(", KEYCODE_UNICODE | 40 }, + { @")", KEYCODE_UNICODE | 41 }, + { @"7", VK_NUMPAD7 }, + { @"8", VK_NUMPAD8 }, + { @"9", VK_NUMPAD9 }, + { @"-", VK_SUBTRACT }, - { @"/", VK_DIVIDE | KBDEXT }, - { @"*", VK_MULTIPLY }, - { @"4", VK_NUMPAD4 }, - { @"5", VK_NUMPAD5 }, - { @"6", VK_NUMPAD6 }, - { @"+", VK_ADD }, + { @"/", VK_DIVIDE | KBDEXT }, + { @"*", VK_MULTIPLY }, + { @"4", VK_NUMPAD4 }, + { @"5", VK_NUMPAD5 }, + { @"6", VK_NUMPAD6 }, + { @"+", VK_ADD }, - { @"Fn", KEY_SHOW_FUNCVIEW }, - { @"Num", VK_NUMLOCK }, - { @"1", VK_NUMPAD1 }, - { @"2", VK_NUMPAD2 }, - { @"3", VK_NUMPAD3 }, - { @"img:icon_key_backspace", VK_BACK }, + { @"Fn", KEY_SHOW_FUNCVIEW }, + { @"Num", VK_NUMLOCK }, + { @"1", VK_NUMPAD1 }, + { @"2", VK_NUMPAD2 }, + { @"3", VK_NUMPAD3 }, + { @"img:icon_key_backspace", VK_BACK }, - { @"img:icon_key_arrows", KEY_SHOW_CURSORVIEW }, - { @"=", KEYCODE_UNICODE | 61 }, - { @"", KEY_MERGE_COLUMN }, - { @"0", VK_NUMPAD0 }, - { @".", VK_DECIMAL }, - { @"img:icon_key_return", VK_RETURN | KBDEXT } -}; + { @"img:icon_key_arrows", KEY_SHOW_CURSORVIEW }, + { @"=", KEYCODE_UNICODE | 61 }, + { @"", KEY_MERGE_COLUMN }, + { @"0", VK_NUMPAD0 }, + { @".", VK_DECIMAL }, + { @"img:icon_key_return", VK_RETURN | KBDEXT } }; +struct ButtonItem cursorKeysItems[24] = { { @"", KEY_SKIP }, + { @"", KEY_SKIP }, + { @"", KEY_SKIP }, + { @"", KEY_SKIP }, + { @"", KEY_SKIP }, + { @"", KEY_SKIP }, -struct ButtonItem cursorKeysItems[24] = -{ - { @"", KEY_SKIP }, - { @"", KEY_SKIP }, - { @"", KEY_SKIP }, - { @"", KEY_SKIP }, - { @"", KEY_SKIP }, - { @"", KEY_SKIP }, + { @"", KEY_SKIP }, + { @"", KEY_SKIP }, + { @"", KEY_SKIP }, + { @"img:icon_key_arrow_up", VK_UP | KBDEXT }, + { @"", KEY_SKIP }, + { @"", KEY_SKIP }, - { @"", KEY_SKIP }, - { @"", KEY_SKIP }, - { @"", KEY_SKIP }, - { @"img:icon_key_arrow_up", VK_UP | KBDEXT }, - { @"", KEY_SKIP }, - { @"", KEY_SKIP }, - - { @"Fn", KEY_SHOW_FUNCVIEW }, - { @"", KEY_SKIP }, - { @"img:icon_key_arrow_left", VK_LEFT | KBDEXT }, - { @"", KEY_SKIP }, - { @"img:icon_key_arrow_right", VK_RIGHT | KBDEXT }, - { @"img:icon_key_backspace", VK_BACK }, - - { @"123", KEY_SHOW_NUMPADVIEW }, - { @"", KEY_SKIP }, - { @"", KEY_SKIP }, - { @"img:icon_key_arrow_down", VK_DOWN | KBDEXT }, - { @"", KEY_SKIP }, - { @"img:icon_key_return", VK_RETURN | KBDEXT } -}; + { @"Fn", KEY_SHOW_FUNCVIEW }, + { @"", KEY_SKIP }, + { @"img:icon_key_arrow_left", VK_LEFT | KBDEXT }, + { @"", KEY_SKIP }, + { @"img:icon_key_arrow_right", VK_RIGHT | KBDEXT }, + { @"img:icon_key_backspace", VK_BACK }, + { @"123", KEY_SHOW_NUMPADVIEW }, + { @"", KEY_SKIP }, + { @"", KEY_SKIP }, + { @"img:icon_key_arrow_down", VK_DOWN | KBDEXT }, + { @"", KEY_SKIP }, + { @"img:icon_key_return", VK_RETURN | KBDEXT } }; - (void)initFunctionKeysView { - _function_keys_view = [[self keyboardViewForItems:functionKeysItems columns:6 rows:4] retain]; - [self addSubview:_function_keys_view]; + _function_keys_view = [[self keyboardViewForItems:functionKeysItems columns:6 rows:4] retain]; + [self addSubview:_function_keys_view]; } - (void)initNumPadKeysView { - _numpad_keys_view = [[self keyboardViewForItems:numPadKeysItems columns:6 rows:4] retain]; - [self addSubview:_numpad_keys_view]; + _numpad_keys_view = [[self keyboardViewForItems:numPadKeysItems columns:6 rows:4] retain]; + [self addSubview:_numpad_keys_view]; } - (void)initCursorKeysView { - _cursor_keys_view = [[self keyboardViewForItems:cursorKeysItems columns:6 rows:4] retain]; - [self addSubview:_cursor_keys_view]; + _cursor_keys_view = [[self keyboardViewForItems:cursorKeysItems columns:6 rows:4] retain]; + [self addSubview:_cursor_keys_view]; } - -- (id)initWithFrame:(CGRect)frame delegate:(NSObject*)delegate +- (id)initWithFrame:(CGRect)frame delegate:(NSObject *)delegate { - self = [super initWithFrame:frame]; - if (self) - { - _delegate = delegate; - - self.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; - self.backgroundColor = [UIColor blackColor]; - // Initialization code - - [self initCursorKeysView]; - [self initNumPadKeysView]; - [self initFunctionKeysView]; - - // set function keys view to the initial view and hide others - _cur_view = _function_keys_view; - [_numpad_keys_view setHidden:YES]; - [_cursor_keys_view setHidden:YES]; - } - return self; -} + self = [super initWithFrame:frame]; + if (self) + { + _delegate = delegate; + self.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; + self.backgroundColor = [UIColor blackColor]; + // Initialization code + + [self initCursorKeysView]; + [self initNumPadKeysView]; + [self initFunctionKeysView]; + + // set function keys view to the initial view and hide others + _cur_view = _function_keys_view; + [_numpad_keys_view setHidden:YES]; + [_cursor_keys_view setHidden:YES]; + } + return self; +} /* // Only override drawRect: if you perform custom drawing. @@ -182,165 +168,178 @@ struct ButtonItem cursorKeysItems[24] = } */ -- (void)drawRect:(CGRect)rect +- (void)drawRect:(CGRect)rect { - // draw a nice background gradient - CGContextRef currentContext = UIGraphicsGetCurrentContext(); - - CGGradientRef glossGradient; - CGColorSpaceRef rgbColorspace; - size_t num_locations = 2; - CGFloat locations[2] = { 0.0, 1.0 }; - CGFloat components[8] = { 1.0, 1.0, 1.0, 0.35, // Start color - 1.0, 1.0, 1.0, 0.06 }; // End color - - rgbColorspace = CGColorSpaceCreateDeviceRGB(); - glossGradient = CGGradientCreateWithColorComponents(rgbColorspace, components, locations, num_locations); - - CGRect currentBounds = self.bounds; - CGPoint topCenter = CGPointMake(CGRectGetMidX(currentBounds), 0.0f); - CGPoint midCenter = CGPointMake(CGRectGetMidX(currentBounds), currentBounds.size.height); - CGContextDrawLinearGradient(currentContext, glossGradient, topCenter, midCenter, 0); - - CGGradientRelease(glossGradient); - CGColorSpaceRelease(rgbColorspace); -} + // draw a nice background gradient + CGContextRef currentContext = UIGraphicsGetCurrentContext(); + CGGradientRef glossGradient; + CGColorSpaceRef rgbColorspace; + size_t num_locations = 2; + CGFloat locations[2] = { 0.0, 1.0 }; + CGFloat components[8] = { 1.0, 1.0, 1.0, 0.35, // Start color + 1.0, 1.0, 1.0, 0.06 }; // End color + + rgbColorspace = CGColorSpaceCreateDeviceRGB(); + glossGradient = + CGGradientCreateWithColorComponents(rgbColorspace, components, locations, num_locations); + + CGRect currentBounds = self.bounds; + CGPoint topCenter = CGPointMake(CGRectGetMidX(currentBounds), 0.0f); + CGPoint midCenter = CGPointMake(CGRectGetMidX(currentBounds), currentBounds.size.height); + CGContextDrawLinearGradient(currentContext, glossGradient, topCenter, midCenter, 0); + + CGGradientRelease(glossGradient); + CGColorSpaceRelease(rgbColorspace); +} - (void)dealloc { - [_function_keys_view autorelease]; - [_numpad_keys_view autorelease]; - [_cursor_keys_view autorelease]; - [super dealloc]; + [_function_keys_view autorelease]; + [_numpad_keys_view autorelease]; + [_cursor_keys_view autorelease]; + [super dealloc]; } #pragma mark - #pragma mark button events --(IBAction)keyPressed:(id)sender +- (IBAction)keyPressed:(id)sender { - UIButton* btn = (UIButton*)sender; - switch([btn tag]) - { - case KEY_SHOW_CURSORVIEW: - // switch to cursor view - [_cur_view setHidden:YES]; - [_cursor_keys_view setHidden:NO]; - _cur_view = _cursor_keys_view; - break; - - case KEY_SHOW_NUMPADVIEW: - // switch to numpad view - [_cur_view setHidden:YES]; - [_numpad_keys_view setHidden:NO]; - _cur_view = _numpad_keys_view; - break; - - case KEY_SHOW_FUNCVIEW: - // switch to function keys view - [_cur_view setHidden:YES]; - [_function_keys_view setHidden:NO]; - _cur_view = _function_keys_view; - break; - - default: - if([btn tag] & KEYCODE_UNICODE) - { - if ([[self delegate] respondsToSelector:@selector(advancedKeyPressedUnicode:)]) - [[self delegate] advancedKeyPressedUnicode:([btn tag] & ~KEYCODE_UNICODE)]; - } - else - { - if ([[self delegate] respondsToSelector:@selector(advancedKeyPressedVKey:)]) - [[self delegate] advancedKeyPressedVKey:[btn tag]]; - } - break; - } + UIButton *btn = (UIButton *)sender; + switch ([btn tag]) + { + case KEY_SHOW_CURSORVIEW: + // switch to cursor view + [_cur_view setHidden:YES]; + [_cursor_keys_view setHidden:NO]; + _cur_view = _cursor_keys_view; + break; + + case KEY_SHOW_NUMPADVIEW: + // switch to numpad view + [_cur_view setHidden:YES]; + [_numpad_keys_view setHidden:NO]; + _cur_view = _numpad_keys_view; + break; + + case KEY_SHOW_FUNCVIEW: + // switch to function keys view + [_cur_view setHidden:YES]; + [_function_keys_view setHidden:NO]; + _cur_view = _function_keys_view; + break; + + default: + if ([btn tag] & KEYCODE_UNICODE) + { + if ([[self delegate] respondsToSelector:@selector(advancedKeyPressedUnicode:)]) + [[self delegate] advancedKeyPressedUnicode:([btn tag] & ~KEYCODE_UNICODE)]; + } + else + { + if ([[self delegate] respondsToSelector:@selector(advancedKeyPressedVKey:)]) + [[self delegate] advancedKeyPressedVKey:[btn tag]]; + } + break; + } } @end - #pragma mark - @implementation AdvancedKeyboardView (Private) - -- (UIView*)keyboardViewForItems:(struct ButtonItem*)items columns:(int)columns rows:(int)rows + +- (UIView *)keyboardViewForItems:(struct ButtonItem *)items columns:(int)columns rows:(int)rows { - UIView* result_view = [[[UIView alloc] initWithFrame:self.bounds] autorelease]; - result_view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; - - // calculate maximum button size - int max_btn_width = result_view.bounds.size.width / ((columns * 2) + 1); - int max_btn_height = result_view.bounds.size.height / ((rows * 2) + 1); - - // ensure minimum button size - CGSize btn_size = CGSizeMake(45, 30); - if(btn_size.width < max_btn_width) - btn_size.width = max_btn_width; - if(btn_size.height < max_btn_height) - btn_size.height = max_btn_height; - - // calc distance width and height between buttons - int dist_width = (result_view.bounds.size.width - (columns * btn_size.width)) / (columns + 1); - int dist_height = (result_view.bounds.size.height - (rows * btn_size.height)) / (rows + 1); - - UIImage* btn_background_img = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"keyboard_button_background" ofType:@"png"]]; - for(int j = 0; j < rows; j++) - { - for(int i = 0; i < columns; i++) - { - struct ButtonItem* curItem = &items[j * columns + i]; - - // skip this spot? - if(curItem->tag == KEY_SKIP) - continue; - - // create button, set autoresizing mask and add action handler - UIButton* btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; - [btn setAutoresizingMask:(UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; - [btn addTarget:self action:@selector(keyPressed:) forControlEvents:UIControlEventTouchUpInside]; - - // if merge is specified we merge this button's position with the next one - if(curItem->tag == KEY_MERGE_COLUMN) - { - // calc merged frame - [btn setFrame:CGRectMake(dist_width + (i * dist_width) + (i * btn_size.width), - dist_height + (j * dist_height) + (j * btn_size.height), - btn_size.width * 2 + dist_width, btn_size.height)]; - - // proceed to the next column item - i++; - curItem = &items[j * columns + i]; - } - else - { - [btn setFrame:CGRectMake(dist_width + (i * dist_width) + (i * btn_size.width), - dist_height + (j * dist_height) + (j * btn_size.height), - btn_size.width, btn_size.height)]; - } - - // set button text or image parameters - if([curItem->title hasPrefix:@"img:"] == YES) - { - UIImage* btn_image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[curItem->title substringFromIndex:4] ofType:@"png"]]; - [btn setImage:btn_image forState:UIControlStateNormal]; - } - else - { - [btn setTitle:curItem->title forState:UIControlStateNormal]; - [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; - } - - [btn setBackgroundImage:btn_background_img forState:UIControlStateNormal]; - [btn setTag:curItem->tag]; - - // add button to view - [result_view addSubview:btn]; - } - } - - return result_view; + UIView *result_view = [[[UIView alloc] initWithFrame:self.bounds] autorelease]; + result_view.autoresizingMask = + UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; + + // calculate maximum button size + int max_btn_width = result_view.bounds.size.width / ((columns * 2) + 1); + int max_btn_height = result_view.bounds.size.height / ((rows * 2) + 1); + + // ensure minimum button size + CGSize btn_size = CGSizeMake(45, 30); + if (btn_size.width < max_btn_width) + btn_size.width = max_btn_width; + if (btn_size.height < max_btn_height) + btn_size.height = max_btn_height; + + // calc distance width and height between buttons + int dist_width = (result_view.bounds.size.width - (columns * btn_size.width)) / (columns + 1); + int dist_height = (result_view.bounds.size.height - (rows * btn_size.height)) / (rows + 1); + + UIImage *btn_background_img = [UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"keyboard_button_background" + ofType:@"png"]]; + for (int j = 0; j < rows; j++) + { + for (int i = 0; i < columns; i++) + { + struct ButtonItem *curItem = &items[j * columns + i]; + + // skip this spot? + if (curItem->tag == KEY_SKIP) + continue; + + // create button, set autoresizing mask and add action handler + UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + [btn setAutoresizingMask:(UIViewAutoresizingFlexibleLeftMargin | + UIViewAutoresizingFlexibleRightMargin | + UIViewAutoresizingFlexibleTopMargin | + UIViewAutoresizingFlexibleBottomMargin | + UIViewAutoresizingFlexibleWidth | + UIViewAutoresizingFlexibleHeight)]; + [btn addTarget:self + action:@selector(keyPressed:) + forControlEvents:UIControlEventTouchUpInside]; + + // if merge is specified we merge this button's position with the next one + if (curItem->tag == KEY_MERGE_COLUMN) + { + // calc merged frame + [btn setFrame:CGRectMake(dist_width + (i * dist_width) + (i * btn_size.width), + dist_height + (j * dist_height) + (j * btn_size.height), + btn_size.width * 2 + dist_width, btn_size.height)]; + + // proceed to the next column item + i++; + curItem = &items[j * columns + i]; + } + else + { + [btn setFrame:CGRectMake(dist_width + (i * dist_width) + (i * btn_size.width), + dist_height + (j * dist_height) + (j * btn_size.height), + btn_size.width, btn_size.height)]; + } + + // set button text or image parameters + if ([curItem->title hasPrefix:@"img:"] == YES) + { + UIImage *btn_image = + [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] + pathForResource:[curItem->title + substringFromIndex:4] + ofType:@"png"]]; + [btn setImage:btn_image forState:UIControlStateNormal]; + } + else + { + [btn setTitle:curItem->title forState:UIControlStateNormal]; + [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; + } + + [btn setBackgroundImage:btn_background_img forState:UIControlStateNormal]; + [btn setTag:curItem->tag]; + + // add button to view + [result_view addSubview:btn]; + } + } + + return result_view; } @end diff --git a/client/iOS/Views/BlockAlertView.h b/client/iOS/Views/BlockAlertView.h index a7441b13c..dbeb0eede 100644 --- a/client/iOS/Views/BlockAlertView.h +++ b/client/iOS/Views/BlockAlertView.h @@ -5,15 +5,16 @@ #import -@interface BlockAlertView : NSObject { -@protected - UIView *_view; - NSMutableArray *_blocks; - CGFloat _height; - NSString *_title; - NSString *_message; - BOOL _shown; - BOOL _cancelBounce; +@interface BlockAlertView : NSObject +{ + @protected + UIView *_view; + NSMutableArray *_blocks; + CGFloat _height; + NSString *_title; + NSString *_message; + BOOL _shown; + BOOL _cancelBounce; } + (BlockAlertView *)alertWithTitle:(NSString *)title message:(NSString *)message; @@ -34,8 +35,8 @@ - (void)setupDisplay; -@property (nonatomic, retain) UIImage *backgroundImage; -@property (nonatomic, readonly) UIView *view; -@property (nonatomic, readwrite) BOOL vignetteBackground; +@property(nonatomic, retain) UIImage *backgroundImage; +@property(nonatomic, readonly) UIView *view; +@property(nonatomic, readwrite) BOOL vignetteBackground; @end diff --git a/client/iOS/Views/BlockAlertView.m b/client/iOS/Views/BlockAlertView.m index 8b938286c..030f151ce 100644 --- a/client/iOS/Views/BlockAlertView.m +++ b/client/iOS/Views/BlockAlertView.m @@ -19,429 +19,457 @@ static UIFont *titleFont = nil; static UIFont *messageFont = nil; static UIFont *buttonFont = nil; - #pragma mark - init + (void)initialize { - if (self == [BlockAlertView class]) - { - background = [UIImage imageNamed:kAlertViewBackground]; - background = [[background stretchableImageWithLeftCapWidth:0 topCapHeight:kAlertViewBackgroundCapHeight] retain]; - - backgroundlandscape = [UIImage imageNamed:kAlertViewBackgroundLandscape]; - backgroundlandscape = [[backgroundlandscape stretchableImageWithLeftCapWidth:0 topCapHeight:kAlertViewBackgroundCapHeight] retain]; - - titleFont = [kAlertViewTitleFont retain]; - messageFont = [kAlertViewMessageFont retain]; - buttonFont = [kAlertViewButtonFont retain]; - } + if (self == [BlockAlertView class]) + { + background = [UIImage imageNamed:kAlertViewBackground]; + background = + [[background stretchableImageWithLeftCapWidth:0 + topCapHeight:kAlertViewBackgroundCapHeight] retain]; + + backgroundlandscape = [UIImage imageNamed:kAlertViewBackgroundLandscape]; + backgroundlandscape = [[backgroundlandscape + stretchableImageWithLeftCapWidth:0 + topCapHeight:kAlertViewBackgroundCapHeight] retain]; + + titleFont = [kAlertViewTitleFont retain]; + messageFont = [kAlertViewMessageFont retain]; + buttonFont = [kAlertViewButtonFont retain]; + } } + (BlockAlertView *)alertWithTitle:(NSString *)title message:(NSString *)message { - return [[[BlockAlertView alloc] initWithTitle:title message:message] autorelease]; + return [[[BlockAlertView alloc] initWithTitle:title message:message] autorelease]; } + (void)showInfoAlertWithTitle:(NSString *)title message:(NSString *)message { - BlockAlertView *alert = [[BlockAlertView alloc] initWithTitle:title message:message]; - [alert setCancelButtonWithTitle:NSLocalizedString(@"Dismiss", nil) block:nil]; - [alert show]; - [alert release]; + BlockAlertView *alert = [[BlockAlertView alloc] initWithTitle:title message:message]; + [alert setCancelButtonWithTitle:NSLocalizedString(@"Dismiss", nil) block:nil]; + [alert show]; + [alert release]; } + (void)showErrorAlert:(NSError *)error { - BlockAlertView *alert = [[BlockAlertView alloc] initWithTitle:NSLocalizedString(@"Operation Failed", nil) message:[NSString stringWithFormat:NSLocalizedString(@"The operation did not complete successfully: %@", nil), error]]; - [alert setCancelButtonWithTitle:@"Dismiss" block:nil]; - [alert show]; - [alert release]; + BlockAlertView *alert = [[BlockAlertView alloc] + initWithTitle:NSLocalizedString(@"Operation Failed", nil) + message:[NSString + stringWithFormat:NSLocalizedString( + @"The operation did not complete successfully: %@", + nil), + error]]; + [alert setCancelButtonWithTitle:@"Dismiss" block:nil]; + [alert show]; + [alert release]; } /////////////////////////////////////////////////////////////////////////////////////////////////// #pragma mark - NSObject -- (void)addComponents:(CGRect)frame { - if (_title) - { - CGSize size = [_title sizeWithFont:titleFont - constrainedToSize:CGSizeMake(frame.size.width-kAlertViewBorder*2, 1000) - lineBreakMode:NSLineBreakByWordWrapping]; - - UILabel *labelView = [[UILabel alloc] initWithFrame:CGRectMake(kAlertViewBorder, _height, frame.size.width-kAlertViewBorder*2, size.height)]; - labelView.font = titleFont; - labelView.numberOfLines = 0; - labelView.lineBreakMode = NSLineBreakByWordWrapping; - labelView.textColor = kAlertViewTitleTextColor; - labelView.backgroundColor = [UIColor clearColor]; - labelView.textAlignment = NSTextAlignmentCenter; - labelView.shadowColor = kAlertViewTitleShadowColor; - labelView.shadowOffset = kAlertViewTitleShadowOffset; - labelView.text = _title; - [_view addSubview:labelView]; - [labelView release]; - - _height += size.height + kAlertViewBorder; - } - - if (_message) - { - CGSize size = [_message sizeWithFont:messageFont - constrainedToSize:CGSizeMake(frame.size.width-kAlertViewBorder*2, 1000) - lineBreakMode:NSLineBreakByWordWrapping]; - - UILabel *labelView = [[UILabel alloc] initWithFrame:CGRectMake(kAlertViewBorder, _height, frame.size.width-kAlertViewBorder*2, size.height)]; - labelView.font = messageFont; - labelView.numberOfLines = 0; - labelView.lineBreakMode = NSLineBreakByWordWrapping; - labelView.textColor = kAlertViewMessageTextColor; - labelView.backgroundColor = [UIColor clearColor]; - labelView.textAlignment = NSTextAlignmentCenter; - labelView.shadowColor = kAlertViewMessageShadowColor; - labelView.shadowOffset = kAlertViewMessageShadowOffset; - labelView.text = _message; - [_view addSubview:labelView]; - [labelView release]; - - _height += size.height + kAlertViewBorder; - } +- (void)addComponents:(CGRect)frame +{ + if (_title) + { + CGSize size = [_title sizeWithFont:titleFont + constrainedToSize:CGSizeMake(frame.size.width - kAlertViewBorder * 2, 1000) + lineBreakMode:NSLineBreakByWordWrapping]; + + UILabel *labelView = [[UILabel alloc] + initWithFrame:CGRectMake(kAlertViewBorder, _height, + frame.size.width - kAlertViewBorder * 2, size.height)]; + labelView.font = titleFont; + labelView.numberOfLines = 0; + labelView.lineBreakMode = NSLineBreakByWordWrapping; + labelView.textColor = kAlertViewTitleTextColor; + labelView.backgroundColor = [UIColor clearColor]; + labelView.textAlignment = NSTextAlignmentCenter; + labelView.shadowColor = kAlertViewTitleShadowColor; + labelView.shadowOffset = kAlertViewTitleShadowOffset; + labelView.text = _title; + [_view addSubview:labelView]; + [labelView release]; + + _height += size.height + kAlertViewBorder; + } + + if (_message) + { + CGSize size = + [_message sizeWithFont:messageFont + constrainedToSize:CGSizeMake(frame.size.width - kAlertViewBorder * 2, 1000) + lineBreakMode:NSLineBreakByWordWrapping]; + + UILabel *labelView = [[UILabel alloc] + initWithFrame:CGRectMake(kAlertViewBorder, _height, + frame.size.width - kAlertViewBorder * 2, size.height)]; + labelView.font = messageFont; + labelView.numberOfLines = 0; + labelView.lineBreakMode = NSLineBreakByWordWrapping; + labelView.textColor = kAlertViewMessageTextColor; + labelView.backgroundColor = [UIColor clearColor]; + labelView.textAlignment = NSTextAlignmentCenter; + labelView.shadowColor = kAlertViewMessageShadowColor; + labelView.shadowOffset = kAlertViewMessageShadowOffset; + labelView.text = _message; + [_view addSubview:labelView]; + [labelView release]; + + _height += size.height + kAlertViewBorder; + } } - (void)setupDisplay { - [[_view subviews] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - [obj removeFromSuperview]; - }]; - - UIWindow *parentView = [BlockBackground sharedInstance]; - CGRect frame = parentView.bounds; - frame.origin.x = floorf((frame.size.width - background.size.width) * 0.5); - frame.size.width = background.size.width; - - UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; - if (UIInterfaceOrientationIsLandscape(orientation)) { - frame.size.width += 150; - frame.origin.x -= 75; - } - - _view.frame = frame; - - _height = kAlertViewBorder + 15; - - if (NeedsLandscapePhoneTweaks) { - _height -= 15; // landscape phones need to trimmed a bit - } + [[_view subviews] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + [obj removeFromSuperview]; + }]; - [self addComponents:frame]; + UIWindow *parentView = [BlockBackground sharedInstance]; + CGRect frame = parentView.bounds; + frame.origin.x = floorf((frame.size.width - background.size.width) * 0.5); + frame.size.width = background.size.width; - if (_shown) - [self show]; + UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; + if (UIInterfaceOrientationIsLandscape(orientation)) + { + frame.size.width += 150; + frame.origin.x -= 75; + } + + _view.frame = frame; + + _height = kAlertViewBorder + 15; + + if (NeedsLandscapePhoneTweaks) + { + _height -= 15; // landscape phones need to trimmed a bit + } + + [self addComponents:frame]; + + if (_shown) + [self show]; } -- (id)initWithTitle:(NSString *)title message:(NSString *)message +- (id)initWithTitle:(NSString *)title message:(NSString *)message { - self = [super init]; - - if (self) - { - _title = [title copy]; - _message = [message copy]; - - _view = [[UIView alloc] init]; - - _view.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; - - _blocks = [[NSMutableArray alloc] init]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(setupDisplay) - name:UIApplicationDidChangeStatusBarOrientationNotification - object:nil]; - - if ([self class] == [BlockAlertView class]) - [self setupDisplay]; - - _vignetteBackground = NO; - } - - return self; + self = [super init]; + + if (self) + { + _title = [title copy]; + _message = [message copy]; + + _view = [[UIView alloc] init]; + + _view.autoresizingMask = + UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin | + UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; + + _blocks = [[NSMutableArray alloc] init]; + + [[NSNotificationCenter defaultCenter] + addObserver:self + selector:@selector(setupDisplay) + name:UIApplicationDidChangeStatusBarOrientationNotification + object:nil]; + + if ([self class] == [BlockAlertView class]) + [self setupDisplay]; + + _vignetteBackground = NO; + } + + return self; } -- (void)dealloc +- (void)dealloc { - [_title release]; - [_message release]; - [_backgroundImage release]; - [_view release]; - [_blocks release]; - [super dealloc]; + [_title release]; + [_message release]; + [_backgroundImage release]; + [_view release]; + [_blocks release]; + [super dealloc]; } /////////////////////////////////////////////////////////////////////////////////////////////////// #pragma mark - Public -- (void)addButtonWithTitle:(NSString *)title color:(NSString*)color block:(void (^)())block +- (void)addButtonWithTitle:(NSString *)title color:(NSString *)color block:(void (^)())block { - [_blocks addObject:[NSArray arrayWithObjects: - block ? [[block copy] autorelease] : [NSNull null], - title, - color, - nil]]; + [_blocks addObject:[NSArray arrayWithObjects:block ? [[block copy] autorelease] : [NSNull null], + title, color, nil]]; } -- (void)addButtonWithTitle:(NSString *)title block:(void (^)())block +- (void)addButtonWithTitle:(NSString *)title block:(void (^)())block { - [self addButtonWithTitle:title color:@"gray" block:block]; + [self addButtonWithTitle:title color:@"gray" block:block]; } -- (void)setCancelButtonWithTitle:(NSString *)title block:(void (^)())block +- (void)setCancelButtonWithTitle:(NSString *)title block:(void (^)())block { - [self addButtonWithTitle:title color:@"black" block:block]; + [self addButtonWithTitle:title color:@"black" block:block]; } - (void)setDestructiveButtonWithTitle:(NSString *)title block:(void (^)())block { - [self addButtonWithTitle:title color:@"red" block:block]; + [self addButtonWithTitle:title color:@"red" block:block]; } - (void)show { - _shown = YES; - - BOOL isSecondButton = NO; - NSUInteger index = 0; - for (NSUInteger i = 0; i < _blocks.count; i++) - { - NSArray *block = [_blocks objectAtIndex:i]; - NSString *title = [block objectAtIndex:1]; - NSString *color = [block objectAtIndex:2]; + _shown = YES; - UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"alert-%@-button.png", color]]; - image = [image stretchableImageWithLeftCapWidth:(int)(image.size.width+1)>>1 topCapHeight:0]; - - CGFloat maxHalfWidth = floorf((_view.bounds.size.width-kAlertViewBorder*3)*0.5); - CGFloat width = _view.bounds.size.width-kAlertViewBorder*2; - CGFloat xOffset = kAlertViewBorder; - if (isSecondButton) - { - width = maxHalfWidth; - xOffset = width + kAlertViewBorder * 2; - isSecondButton = NO; - } - else if (i + 1 < _blocks.count) - { - // In this case there's another button. - // Let's check if they fit on the same line. - CGSize size = [title sizeWithFont:buttonFont - minFontSize:10 - actualFontSize:nil - forWidth:_view.bounds.size.width-kAlertViewBorder*2 - lineBreakMode:NSLineBreakByClipping]; - - if (size.width < maxHalfWidth - kAlertViewBorder) - { - // It might fit. Check the next Button - NSArray *block2 = [_blocks objectAtIndex:i+1]; - NSString *title2 = [block2 objectAtIndex:1]; - size = [title2 sizeWithFont:buttonFont - minFontSize:10 - actualFontSize:nil - forWidth:_view.bounds.size.width-kAlertViewBorder*2 - lineBreakMode:NSLineBreakByClipping]; - - if (size.width < maxHalfWidth - kAlertViewBorder) - { - // They'll fit! - isSecondButton = YES; // For the next iteration - width = maxHalfWidth; - } - } - } - else if (_blocks.count == 1) - { - // In this case this is the ony button. We'll size according to the text - CGSize size = [title sizeWithFont:buttonFont - minFontSize:10 - actualFontSize:nil - forWidth:_view.bounds.size.width-kAlertViewBorder*2 - lineBreakMode:UILineBreakModeClip]; - - size.width = MAX(size.width, 80); - if (size.width + 2 * kAlertViewBorder < width) - { - width = size.width + 2 * kAlertViewBorder; - xOffset = floorf((_view.bounds.size.width - width) * 0.5); - } - } - - UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; - button.frame = CGRectMake(xOffset, _height, width, kAlertButtonHeight); - button.titleLabel.font = buttonFont; - if (IOS_LESS_THAN_6) { + BOOL isSecondButton = NO; + NSUInteger index = 0; + for (NSUInteger i = 0; i < _blocks.count; i++) + { + NSArray *block = [_blocks objectAtIndex:i]; + NSString *title = [block objectAtIndex:1]; + NSString *color = [block objectAtIndex:2]; + + UIImage *image = + [UIImage imageNamed:[NSString stringWithFormat:@"alert-%@-button.png", color]]; + image = [image stretchableImageWithLeftCapWidth:(int)(image.size.width + 1) >> 1 + topCapHeight:0]; + + CGFloat maxHalfWidth = floorf((_view.bounds.size.width - kAlertViewBorder * 3) * 0.5); + CGFloat width = _view.bounds.size.width - kAlertViewBorder * 2; + CGFloat xOffset = kAlertViewBorder; + if (isSecondButton) + { + width = maxHalfWidth; + xOffset = width + kAlertViewBorder * 2; + isSecondButton = NO; + } + else if (i + 1 < _blocks.count) + { + // In this case there's another button. + // Let's check if they fit on the same line. + CGSize size = [title sizeWithFont:buttonFont + minFontSize:10 + actualFontSize:nil + forWidth:_view.bounds.size.width - kAlertViewBorder * 2 + lineBreakMode:NSLineBreakByClipping]; + + if (size.width < maxHalfWidth - kAlertViewBorder) + { + // It might fit. Check the next Button + NSArray *block2 = [_blocks objectAtIndex:i + 1]; + NSString *title2 = [block2 objectAtIndex:1]; + size = [title2 sizeWithFont:buttonFont + minFontSize:10 + actualFontSize:nil + forWidth:_view.bounds.size.width - kAlertViewBorder * 2 + lineBreakMode:NSLineBreakByClipping]; + + if (size.width < maxHalfWidth - kAlertViewBorder) + { + // They'll fit! + isSecondButton = YES; // For the next iteration + width = maxHalfWidth; + } + } + } + else if (_blocks.count == 1) + { + // In this case this is the ony button. We'll size according to the text + CGSize size = [title sizeWithFont:buttonFont + minFontSize:10 + actualFontSize:nil + forWidth:_view.bounds.size.width - kAlertViewBorder * 2 + lineBreakMode:UILineBreakModeClip]; + + size.width = MAX(size.width, 80); + if (size.width + 2 * kAlertViewBorder < width) + { + width = size.width + 2 * kAlertViewBorder; + xOffset = floorf((_view.bounds.size.width - width) * 0.5); + } + } + + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; + button.frame = CGRectMake(xOffset, _height, width, kAlertButtonHeight); + button.titleLabel.font = buttonFont; + if (IOS_LESS_THAN_6) + { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - button.titleLabel.minimumFontSize = 10; + button.titleLabel.minimumFontSize = 10; #pragma clang diagnostic pop - } - else { - button.titleLabel.adjustsFontSizeToFitWidth = YES; - button.titleLabel.adjustsLetterSpacingToFitWidth = YES; - button.titleLabel.minimumScaleFactor = 0.1; - } - button.titleLabel.textAlignment = NSTextAlignmentCenter; - button.titleLabel.shadowOffset = kAlertViewButtonShadowOffset; - button.backgroundColor = [UIColor clearColor]; - button.tag = i+1; - - [button setBackgroundImage:image forState:UIControlStateNormal]; - [button setTitleColor:kAlertViewButtonTextColor forState:UIControlStateNormal]; - [button setTitleShadowColor:kAlertViewButtonShadowColor forState:UIControlStateNormal]; - [button setTitle:title forState:UIControlStateNormal]; - button.accessibilityLabel = title; - - [button addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside]; - - [_view addSubview:button]; - - if (!isSecondButton) - _height += kAlertButtonHeight + kAlertViewBorder; - - index++; - } + } + else + { + button.titleLabel.adjustsFontSizeToFitWidth = YES; + button.titleLabel.adjustsLetterSpacingToFitWidth = YES; + button.titleLabel.minimumScaleFactor = 0.1; + } + button.titleLabel.textAlignment = NSTextAlignmentCenter; + button.titleLabel.shadowOffset = kAlertViewButtonShadowOffset; + button.backgroundColor = [UIColor clearColor]; + button.tag = i + 1; - _height += 10; // Margin for the shadow - - if (_height < background.size.height) - { - CGFloat offset = background.size.height - _height; - _height = background.size.height; - CGRect frame; - for (NSUInteger i = 0; i < _blocks.count; i++) - { - UIButton *btn = (UIButton *)[_view viewWithTag:i+1]; - frame = btn.frame; - frame.origin.y += offset; - btn.frame = frame; - } - } - - - CGRect frame = _view.frame; - frame.origin.y = - _height; - frame.size.height = _height; - _view.frame = frame; - - UIImageView *modalBackground = [[UIImageView alloc] initWithFrame:_view.bounds]; - - if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) - modalBackground.image = backgroundlandscape; - else - modalBackground.image = background; + [button setBackgroundImage:image forState:UIControlStateNormal]; + [button setTitleColor:kAlertViewButtonTextColor forState:UIControlStateNormal]; + [button setTitleShadowColor:kAlertViewButtonShadowColor forState:UIControlStateNormal]; + [button setTitle:title forState:UIControlStateNormal]; + button.accessibilityLabel = title; - modalBackground.contentMode = UIViewContentModeScaleToFill; - modalBackground.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - [_view insertSubview:modalBackground atIndex:0]; - [modalBackground release]; - - if (_backgroundImage) - { - [BlockBackground sharedInstance].backgroundImage = _backgroundImage; - [_backgroundImage release]; - _backgroundImage = nil; - } - - [BlockBackground sharedInstance].vignetteBackground = _vignetteBackground; - [[BlockBackground sharedInstance] addToMainWindow:_view]; + [button addTarget:self + action:@selector(buttonClicked:) + forControlEvents:UIControlEventTouchUpInside]; - __block CGPoint center = _view.center; - center.y = floorf([BlockBackground sharedInstance].bounds.size.height * 0.5) + kAlertViewBounce; - - _cancelBounce = NO; - - [UIView animateWithDuration:0.4 - delay:0.0 - options:UIViewAnimationCurveEaseOut - animations:^{ - [BlockBackground sharedInstance].alpha = 1.0f; - _view.center = center; - } - completion:^(BOOL finished) { - if (_cancelBounce) return; - - [UIView animateWithDuration:0.1 - delay:0.0 - options:0 - animations:^{ - center.y -= kAlertViewBounce; - _view.center = center; - } - completion:^(BOOL finished) { - [[NSNotificationCenter defaultCenter] postNotificationName:@"AlertViewFinishedAnimations" object:nil]; - }]; - }]; - - [self retain]; + [_view addSubview:button]; + + if (!isSecondButton) + _height += kAlertButtonHeight + kAlertViewBorder; + + index++; + } + + _height += 10; // Margin for the shadow + + if (_height < background.size.height) + { + CGFloat offset = background.size.height - _height; + _height = background.size.height; + CGRect frame; + for (NSUInteger i = 0; i < _blocks.count; i++) + { + UIButton *btn = (UIButton *)[_view viewWithTag:i + 1]; + frame = btn.frame; + frame.origin.y += offset; + btn.frame = frame; + } + } + + CGRect frame = _view.frame; + frame.origin.y = -_height; + frame.size.height = _height; + _view.frame = frame; + + UIImageView *modalBackground = [[UIImageView alloc] initWithFrame:_view.bounds]; + + if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) + modalBackground.image = backgroundlandscape; + else + modalBackground.image = background; + + modalBackground.contentMode = UIViewContentModeScaleToFill; + modalBackground.autoresizingMask = + UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + [_view insertSubview:modalBackground atIndex:0]; + [modalBackground release]; + + if (_backgroundImage) + { + [BlockBackground sharedInstance].backgroundImage = _backgroundImage; + [_backgroundImage release]; + _backgroundImage = nil; + } + + [BlockBackground sharedInstance].vignetteBackground = _vignetteBackground; + [[BlockBackground sharedInstance] addToMainWindow:_view]; + + __block CGPoint center = _view.center; + center.y = floorf([BlockBackground sharedInstance].bounds.size.height * 0.5) + kAlertViewBounce; + + _cancelBounce = NO; + + [UIView animateWithDuration:0.4 + delay:0.0 + options:UIViewAnimationCurveEaseOut + animations:^{ + [BlockBackground sharedInstance].alpha = 1.0f; + _view.center = center; + } + completion:^(BOOL finished) { + if (_cancelBounce) + return; + + [UIView animateWithDuration:0.1 + delay:0.0 + options:0 + animations:^{ + center.y -= kAlertViewBounce; + _view.center = center; + } + completion:^(BOOL finished) { + [[NSNotificationCenter defaultCenter] + postNotificationName:@"AlertViewFinishedAnimations" + object:nil]; + }]; + }]; + + [self retain]; } -- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated +- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated { - _shown = NO; - - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - if (buttonIndex >= 0 && buttonIndex < [_blocks count]) - { - id obj = [[_blocks objectAtIndex: buttonIndex] objectAtIndex:0]; - if (![obj isEqual:[NSNull null]]) - { - ((void (^)())obj)(); - } - } - - if (animated) - { - [UIView animateWithDuration:0.1 - delay:0.0 - options:0 - animations:^{ - CGPoint center = _view.center; - center.y += 20; - _view.center = center; - } - completion:^(BOOL finished) { - [UIView animateWithDuration:0.4 - delay:0.0 - options:UIViewAnimationCurveEaseIn - animations:^{ - CGRect frame = _view.frame; - frame.origin.y = -frame.size.height; - _view.frame = frame; - [[BlockBackground sharedInstance] reduceAlphaIfEmpty]; - } - completion:^(BOOL finished) { - [[BlockBackground sharedInstance] removeView:_view]; - [_view release]; _view = nil; - [self autorelease]; - }]; - }]; - } - else - { - [[BlockBackground sharedInstance] removeView:_view]; - [_view release]; _view = nil; - [self autorelease]; - } + _shown = NO; + + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + if (buttonIndex >= 0 && buttonIndex < [_blocks count]) + { + id obj = [[_blocks objectAtIndex:buttonIndex] objectAtIndex:0]; + if (![obj isEqual:[NSNull null]]) + { + ((void (^)())obj)(); + } + } + + if (animated) + { + [UIView animateWithDuration:0.1 + delay:0.0 + options:0 + animations:^{ + CGPoint center = _view.center; + center.y += 20; + _view.center = center; + } + completion:^(BOOL finished) { + [UIView animateWithDuration:0.4 + delay:0.0 + options:UIViewAnimationCurveEaseIn + animations:^{ + CGRect frame = _view.frame; + frame.origin.y = -frame.size.height; + _view.frame = frame; + [[BlockBackground sharedInstance] reduceAlphaIfEmpty]; + } + completion:^(BOOL finished) { + [[BlockBackground sharedInstance] removeView:_view]; + [_view release]; + _view = nil; + [self autorelease]; + }]; + }]; + } + else + { + [[BlockBackground sharedInstance] removeView:_view]; + [_view release]; + _view = nil; + [self autorelease]; + } } /////////////////////////////////////////////////////////////////////////////////////////////////// #pragma mark - Action -- (void)buttonClicked:(id)sender +- (void)buttonClicked:(id)sender { - /* Run the button's block */ - int buttonIndex = [sender tag] - 1; - [self dismissWithClickedButtonIndex:buttonIndex animated:YES]; + /* Run the button's block */ + int buttonIndex = [sender tag] - 1; + [self dismissWithClickedButtonIndex:buttonIndex animated:YES]; } @end diff --git a/client/iOS/Views/BlockBackground.h b/client/iOS/Views/BlockBackground.h index 8eabc209d..1593ebf4e 100644 --- a/client/iOS/Views/BlockBackground.h +++ b/client/iOS/Views/BlockBackground.h @@ -8,18 +8,19 @@ #import -@interface BlockBackground : UIWindow { -@private - UIWindow *_previousKeyWindow; +@interface BlockBackground : UIWindow +{ + @private + UIWindow *_previousKeyWindow; } -+ (BlockBackground *) sharedInstance; ++ (BlockBackground *)sharedInstance; - (void)addToMainWindow:(UIView *)view; - (void)reduceAlphaIfEmpty; - (void)removeView:(UIView *)view; -@property (nonatomic, retain) UIImage *backgroundImage; -@property (nonatomic, readwrite) BOOL vignetteBackground; +@property(nonatomic, retain) UIImage *backgroundImage; +@property(nonatomic, readwrite) BOOL vignetteBackground; @end diff --git a/client/iOS/Views/BlockBackground.m b/client/iOS/Views/BlockBackground.m index 9d7709a47..f1f9422dd 100644 --- a/client/iOS/Views/BlockBackground.m +++ b/client/iOS/Views/BlockBackground.m @@ -15,46 +15,51 @@ static BlockBackground *_sharedInstance = nil; -+ (BlockBackground*)sharedInstance ++ (BlockBackground *)sharedInstance { - if (_sharedInstance != nil) { - return _sharedInstance; - } + if (_sharedInstance != nil) + { + return _sharedInstance; + } - @synchronized(self) { - if (_sharedInstance == nil) { - [[[self alloc] init] autorelease]; - } - } + @synchronized(self) + { + if (_sharedInstance == nil) + { + [[[self alloc] init] autorelease]; + } + } - return _sharedInstance; + return _sharedInstance; } -+ (id)allocWithZone:(NSZone*)zone ++ (id)allocWithZone:(NSZone *)zone { - @synchronized(self) { - if (_sharedInstance == nil) { - _sharedInstance = [super allocWithZone:zone]; - return _sharedInstance; - } - } - NSAssert(NO, @ "[BlockBackground alloc] explicitly called on singleton class."); - return nil; + @synchronized(self) + { + if (_sharedInstance == nil) + { + _sharedInstance = [super allocWithZone:zone]; + return _sharedInstance; + } + } + NSAssert(NO, @ "[BlockBackground alloc] explicitly called on singleton class."); + return nil; } -- (id)copyWithZone:(NSZone*)zone +- (id)copyWithZone:(NSZone *)zone { - return self; + return self; } - (id)retain { - return self; + return self; } - (unsigned)retainCount { - return UINT_MAX; + return UINT_MAX; } - (oneway void)release @@ -63,165 +68,171 @@ static BlockBackground *_sharedInstance = nil; - (id)autorelease { - return self; + return self; } -- (void)setRotation:(NSNotification*)notification +- (void)setRotation:(NSNotification *)notification { - UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; - - CGRect orientationFrame = [UIScreen mainScreen].bounds; - - if( - (UIInterfaceOrientationIsLandscape(orientation) && orientationFrame.size.height > orientationFrame.size.width) || - (UIInterfaceOrientationIsPortrait(orientation) && orientationFrame.size.width > orientationFrame.size.height) - ) { - float temp = orientationFrame.size.width; - orientationFrame.size.width = orientationFrame.size.height; - orientationFrame.size.height = temp; - } - - self.transform = CGAffineTransformIdentity; - self.frame = orientationFrame; - - CGFloat posY = orientationFrame.size.height/2; - CGFloat posX = orientationFrame.size.width/2; - - CGPoint newCenter; - CGFloat rotateAngle; - - switch (orientation) { - case UIInterfaceOrientationPortraitUpsideDown: - rotateAngle = M_PI; - newCenter = CGPointMake(posX, orientationFrame.size.height-posY); - break; - case UIInterfaceOrientationLandscapeLeft: - rotateAngle = -M_PI/2.0f; - newCenter = CGPointMake(posY, posX); - break; - case UIInterfaceOrientationLandscapeRight: - rotateAngle = M_PI/2.0f; - newCenter = CGPointMake(orientationFrame.size.height-posY, posX); - break; - default: // UIInterfaceOrientationPortrait - rotateAngle = 0.0; - newCenter = CGPointMake(posX, posY); - break; - } - - self.transform = CGAffineTransformMakeRotation(rotateAngle); - self.center = newCenter; - - [self setNeedsLayout]; - [self layoutSubviews]; + UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; + + CGRect orientationFrame = [UIScreen mainScreen].bounds; + + if ((UIInterfaceOrientationIsLandscape(orientation) && + orientationFrame.size.height > orientationFrame.size.width) || + (UIInterfaceOrientationIsPortrait(orientation) && + orientationFrame.size.width > orientationFrame.size.height)) + { + float temp = orientationFrame.size.width; + orientationFrame.size.width = orientationFrame.size.height; + orientationFrame.size.height = temp; + } + + self.transform = CGAffineTransformIdentity; + self.frame = orientationFrame; + + CGFloat posY = orientationFrame.size.height / 2; + CGFloat posX = orientationFrame.size.width / 2; + + CGPoint newCenter; + CGFloat rotateAngle; + + switch (orientation) + { + case UIInterfaceOrientationPortraitUpsideDown: + rotateAngle = M_PI; + newCenter = CGPointMake(posX, orientationFrame.size.height - posY); + break; + case UIInterfaceOrientationLandscapeLeft: + rotateAngle = -M_PI / 2.0f; + newCenter = CGPointMake(posY, posX); + break; + case UIInterfaceOrientationLandscapeRight: + rotateAngle = M_PI / 2.0f; + newCenter = CGPointMake(orientationFrame.size.height - posY, posX); + break; + default: // UIInterfaceOrientationPortrait + rotateAngle = 0.0; + newCenter = CGPointMake(posX, posY); + break; + } + + self.transform = CGAffineTransformMakeRotation(rotateAngle); + self.center = newCenter; + + [self setNeedsLayout]; + [self layoutSubviews]; } - (id)init { - self = [super initWithFrame:[[UIScreen mainScreen] bounds]]; - if (self) { - self.windowLevel = UIWindowLevelStatusBar; - self.hidden = YES; - self.userInteractionEnabled = NO; - self.backgroundColor = [UIColor colorWithWhite:0.4 alpha:0.5f]; - self.vignetteBackground = NO; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(setRotation:) - name:UIApplicationDidChangeStatusBarOrientationNotification - object:nil]; - [self setRotation:nil]; + self = [super initWithFrame:[[UIScreen mainScreen] bounds]]; + if (self) + { + self.windowLevel = UIWindowLevelStatusBar; + self.hidden = YES; + self.userInteractionEnabled = NO; + self.backgroundColor = [UIColor colorWithWhite:0.4 alpha:0.5f]; + self.vignetteBackground = NO; - } - return self; + [[NSNotificationCenter defaultCenter] + addObserver:self + selector:@selector(setRotation:) + name:UIApplicationDidChangeStatusBarOrientationNotification + object:nil]; + [self setRotation:nil]; + } + return self; } - (void)addToMainWindow:(UIView *)view { - [self setRotation:nil]; - - if ([self.subviews containsObject:view]) return; + [self setRotation:nil]; - if (self.hidden) - { - _previousKeyWindow = [[[UIApplication sharedApplication] keyWindow] retain]; - self.alpha = 0.0f; - self.hidden = NO; - self.userInteractionEnabled = YES; - [self makeKeyWindow]; - } - - if (self.subviews.count > 0) - { - ((UIView*)[self.subviews lastObject]).userInteractionEnabled = NO; - } - - if (_backgroundImage) - { - UIImageView *backgroundView = [[UIImageView alloc] initWithImage:_backgroundImage]; - backgroundView.frame = self.bounds; - backgroundView.contentMode = UIViewContentModeScaleToFill; - [self addSubview:backgroundView]; - [backgroundView release]; - [_backgroundImage release]; - _backgroundImage = nil; - } - - [self addSubview:view]; + if ([self.subviews containsObject:view]) + return; + + if (self.hidden) + { + _previousKeyWindow = [[[UIApplication sharedApplication] keyWindow] retain]; + self.alpha = 0.0f; + self.hidden = NO; + self.userInteractionEnabled = YES; + [self makeKeyWindow]; + } + + if (self.subviews.count > 0) + { + ((UIView *)[self.subviews lastObject]).userInteractionEnabled = NO; + } + + if (_backgroundImage) + { + UIImageView *backgroundView = [[UIImageView alloc] initWithImage:_backgroundImage]; + backgroundView.frame = self.bounds; + backgroundView.contentMode = UIViewContentModeScaleToFill; + [self addSubview:backgroundView]; + [backgroundView release]; + [_backgroundImage release]; + _backgroundImage = nil; + } + + [self addSubview:view]; } - (void)reduceAlphaIfEmpty { - if (self.subviews.count == 1 || (self.subviews.count == 2 && [[self.subviews objectAtIndex:0] isKindOfClass:[UIImageView class]])) - { - self.alpha = 0.0f; - self.userInteractionEnabled = NO; - } + if (self.subviews.count == 1 || + (self.subviews.count == 2 && + [[self.subviews objectAtIndex:0] isKindOfClass:[UIImageView class]])) + { + self.alpha = 0.0f; + self.userInteractionEnabled = NO; + } } - (void)removeView:(UIView *)view { - [view removeFromSuperview]; + [view removeFromSuperview]; - UIView *topView = [self.subviews lastObject]; - if ([topView isKindOfClass:[UIImageView class]]) - { - // It's a background. Remove it too - [topView removeFromSuperview]; - } - - if (self.subviews.count == 0) - { - self.hidden = YES; - [_previousKeyWindow makeKeyWindow]; - [_previousKeyWindow release]; - _previousKeyWindow = nil; - } - else - { - ((UIView*)[self.subviews lastObject]).userInteractionEnabled = YES; - } + UIView *topView = [self.subviews lastObject]; + if ([topView isKindOfClass:[UIImageView class]]) + { + // It's a background. Remove it too + [topView removeFromSuperview]; + } + + if (self.subviews.count == 0) + { + self.hidden = YES; + [_previousKeyWindow makeKeyWindow]; + [_previousKeyWindow release]; + _previousKeyWindow = nil; + } + else + { + ((UIView *)[self.subviews lastObject]).userInteractionEnabled = YES; + } } -- (void)drawRect:(CGRect)rect -{ - if (_backgroundImage || !_vignetteBackground) return; - CGContextRef context = UIGraphicsGetCurrentContext(); - +- (void)drawRect:(CGRect)rect +{ + if (_backgroundImage || !_vignetteBackground) + return; + CGContextRef context = UIGraphicsGetCurrentContext(); + size_t locationsCount = 2; - CGFloat locations[2] = {0.0f, 1.0f}; - CGFloat colors[8] = {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.75f}; + CGFloat locations[2] = { 0.0f, 1.0f }; + CGFloat colors[8] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.75f }; CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); - CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, colors, locations, locationsCount); + CGGradientRef gradient = + CGGradientCreateWithColorComponents(colorSpace, colors, locations, locationsCount); CGColorSpaceRelease(colorSpace); - - CGPoint center = CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2); - float radius = MIN(self.bounds.size.width , self.bounds.size.height) ; - CGContextDrawRadialGradient (context, gradient, center, 0, center, radius, kCGGradientDrawsAfterEndLocation); + + CGPoint center = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2); + float radius = MIN(self.bounds.size.width, self.bounds.size.height); + CGContextDrawRadialGradient(context, gradient, center, 0, center, radius, + kCGGradientDrawsAfterEndLocation); CGGradientRelease(gradient); } - - - @end diff --git a/client/iOS/Views/BlockUI.h b/client/iOS/Views/BlockUI.h index 903b28646..a88323edb 100644 --- a/client/iOS/Views/BlockUI.h +++ b/client/iOS/Views/BlockUI.h @@ -8,65 +8,67 @@ #define BlockUI_h #if __IPHONE_OS_VERSION_MAX_ALLOWED < 60000 -#define NSTextAlignmentCenter UITextAlignmentCenter -#define NSLineBreakByWordWrapping UILineBreakModeWordWrap -#define NSLineBreakByClipping UILineBreakModeClip +#define NSTextAlignmentCenter UITextAlignmentCenter +#define NSLineBreakByWordWrapping UILineBreakModeWordWrap +#define NSLineBreakByClipping UILineBreakModeClip #endif #ifndef IOS_LESS_THAN_6 -#define IOS_LESS_THAN_6 !([[[UIDevice currentDevice] systemVersion] compare:@"6.0" options:NSNumericSearch] != NSOrderedAscending) +#define IOS_LESS_THAN_6 \ + !([[[UIDevice currentDevice] systemVersion] compare:@"6.0" \ + options:NSNumericSearch] != NSOrderedAscending) #endif -#define NeedsLandscapePhoneTweaks (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]) && UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) - +#define NeedsLandscapePhoneTweaks \ + (UIInterfaceOrientationIsLandscape( \ + [[UIApplication sharedApplication] statusBarOrientation]) && \ + UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) // Action Sheet constants -#define kActionSheetBounce 10 -#define kActionSheetBorder 10 -#define kActionSheetButtonHeight 45 -#define kActionSheetTopMargin 15 +#define kActionSheetBounce 10 +#define kActionSheetBorder 10 +#define kActionSheetButtonHeight 45 +#define kActionSheetTopMargin 15 -#define kActionSheetTitleFont [UIFont systemFontOfSize:18] -#define kActionSheetTitleTextColor [UIColor whiteColor] -#define kActionSheetTitleShadowColor [UIColor blackColor] -#define kActionSheetTitleShadowOffset CGSizeMake(0, -1) +#define kActionSheetTitleFont [UIFont systemFontOfSize:18] +#define kActionSheetTitleTextColor [UIColor whiteColor] +#define kActionSheetTitleShadowColor [UIColor blackColor] +#define kActionSheetTitleShadowOffset CGSizeMake(0, -1) -#define kActionSheetButtonFont [UIFont boldSystemFontOfSize:20] -#define kActionSheetButtonTextColor [UIColor whiteColor] -#define kActionSheetButtonShadowColor [UIColor blackColor] -#define kActionSheetButtonShadowOffset CGSizeMake(0, -1) - -#define kActionSheetBackground @"action-sheet-panel.png" -#define kActionSheetBackgroundCapHeight 30 +#define kActionSheetButtonFont [UIFont boldSystemFontOfSize:20] +#define kActionSheetButtonTextColor [UIColor whiteColor] +#define kActionSheetButtonShadowColor [UIColor blackColor] +#define kActionSheetButtonShadowOffset CGSizeMake(0, -1) +#define kActionSheetBackground @"action-sheet-panel.png" +#define kActionSheetBackgroundCapHeight 30 // Alert View constants -#define kAlertViewBounce 20 -#define kAlertViewBorder (NeedsLandscapePhoneTweaks ? 5 : 10) -#define kAlertButtonHeight (NeedsLandscapePhoneTweaks ? 35 : 44) +#define kAlertViewBounce 20 +#define kAlertViewBorder (NeedsLandscapePhoneTweaks ? 5 : 10) +#define kAlertButtonHeight (NeedsLandscapePhoneTweaks ? 35 : 44) +#define kAlertViewTitleFont [UIFont boldSystemFontOfSize:20] +#define kAlertViewTitleTextColor [UIColor colorWithWhite:244.0 / 255.0 alpha:1.0] +#define kAlertViewTitleShadowColor [UIColor blackColor] +#define kAlertViewTitleShadowOffset CGSizeMake(0, -1) -#define kAlertViewTitleFont [UIFont boldSystemFontOfSize:20] -#define kAlertViewTitleTextColor [UIColor colorWithWhite:244.0/255.0 alpha:1.0] -#define kAlertViewTitleShadowColor [UIColor blackColor] -#define kAlertViewTitleShadowOffset CGSizeMake(0, -1) +#define kAlertViewMessageFont [UIFont systemFontOfSize:18] +#define kAlertViewMessageTextColor [UIColor colorWithWhite:244.0 / 255.0 alpha:1.0] +#define kAlertViewMessageShadowColor [UIColor blackColor] +#define kAlertViewMessageShadowOffset CGSizeMake(0, -1) -#define kAlertViewMessageFont [UIFont systemFontOfSize:18] -#define kAlertViewMessageTextColor [UIColor colorWithWhite:244.0/255.0 alpha:1.0] -#define kAlertViewMessageShadowColor [UIColor blackColor] -#define kAlertViewMessageShadowOffset CGSizeMake(0, -1) +#define kAlertViewButtonFont [UIFont boldSystemFontOfSize:18] +#define kAlertViewButtonTextColor [UIColor whiteColor] +#define kAlertViewButtonShadowColor [UIColor blackColor] +#define kAlertViewButtonShadowOffset CGSizeMake(0, -1) -#define kAlertViewButtonFont [UIFont boldSystemFontOfSize:18] -#define kAlertViewButtonTextColor [UIColor whiteColor] -#define kAlertViewButtonShadowColor [UIColor blackColor] -#define kAlertViewButtonShadowOffset CGSizeMake(0, -1) - -#define kAlertViewBackground @"alert-window.png" -#define kAlertViewBackgroundLandscape @"alert-window-landscape.png" -#define kAlertViewBackgroundCapHeight 38 +#define kAlertViewBackground @"alert-window.png" +#define kAlertViewBackgroundLandscape @"alert-window-landscape.png" +#define kAlertViewBackgroundCapHeight 38 #endif diff --git a/client/iOS/Views/BookmarkTableCell.h b/client/iOS/Views/BookmarkTableCell.h index 3afa13cc4..544e4e541 100644 --- a/client/iOS/Views/BookmarkTableCell.h +++ b/client/iOS/Views/BookmarkTableCell.h @@ -1,25 +1,24 @@ /* Custom bookmark table cell - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import - -@interface BookmarkTableCell : UITableViewCell +@interface BookmarkTableCell : UITableViewCell { - IBOutlet UILabel* _title; - IBOutlet UILabel* _sub_title; - IBOutlet UIImageView* _connection_state_icon; + IBOutlet UILabel *_title; + IBOutlet UILabel *_sub_title; + IBOutlet UIImageView *_connection_state_icon; } -@property (retain, nonatomic) UILabel* title; -@property (retain, nonatomic) UILabel* subTitle; -@property (retain, nonatomic) UIImageView* connectionStateIcon; - +@property(retain, nonatomic) UILabel *title; +@property(retain, nonatomic) UILabel *subTitle; +@property(retain, nonatomic) UIImageView *connectionStateIcon; @end diff --git a/client/iOS/Views/BookmarkTableCell.m b/client/iOS/Views/BookmarkTableCell.m index 4adf6e8de..cb93af4a9 100644 --- a/client/iOS/Views/BookmarkTableCell.m +++ b/client/iOS/Views/BookmarkTableCell.m @@ -1,38 +1,39 @@ /* Custom bookmark table cell - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "BookmarkTableCell.h" - @implementation BookmarkTableCell @synthesize title = _title, subTitle = _sub_title, connectionStateIcon = _connection_state_icon; -- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) { - // Initialization code - } - return self; +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) + { + // Initialization code + } + return self; } +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ -- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; - [super setSelected:selected animated:animated]; - - // Configure the view for the selected state + // Configure the view for the selected state } - -- (void)dealloc { - [super dealloc]; +- (void)dealloc +{ + [super dealloc]; } - @end diff --git a/client/iOS/Views/EditButtonTableViewCell.h b/client/iOS/Views/EditButtonTableViewCell.h index 296287baa..3a39d12fc 100644 --- a/client/iOS/Views/EditButtonTableViewCell.h +++ b/client/iOS/Views/EditButtonTableViewCell.h @@ -1,21 +1,22 @@ /* Custom table cell with a button - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @interface EditButtonTableViewCell : UITableViewCell { - IBOutlet UILabel* _label; - IBOutlet UIButton* _button; + IBOutlet UILabel *_label; + IBOutlet UIButton *_button; } -@property (retain, nonatomic) UILabel* label; -@property (retain, nonatomic) UIButton* button; +@property(retain, nonatomic) UILabel *label; +@property(retain, nonatomic) UIButton *button; @end diff --git a/client/iOS/Views/EditButtonTableViewCell.m b/client/iOS/Views/EditButtonTableViewCell.m index e57129565..eed8afe2a 100644 --- a/client/iOS/Views/EditButtonTableViewCell.m +++ b/client/iOS/Views/EditButtonTableViewCell.m @@ -1,10 +1,11 @@ /* Custom table cell with a button - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "EditButtonTableViewCell.h" @@ -15,18 +16,19 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; - if (self) { - // Initialization code - } - return self; + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) + { + // Initialization code + } + return self; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { - [super setSelected:selected animated:animated]; + [super setSelected:selected animated:animated]; - // Configure the view for the selected state + // Configure the view for the selected state } @end diff --git a/client/iOS/Views/EditFlagTableViewCell.h b/client/iOS/Views/EditFlagTableViewCell.h index 724eb96fd..ac9a93650 100644 --- a/client/iOS/Views/EditFlagTableViewCell.h +++ b/client/iOS/Views/EditFlagTableViewCell.h @@ -1,21 +1,22 @@ /* Custom table cell with toggle switch - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @interface EditFlagTableViewCell : UITableViewCell { - IBOutlet UILabel* _label; - IBOutlet UISwitch* _toggle; + IBOutlet UILabel *_label; + IBOutlet UISwitch *_toggle; } -@property (retain, nonatomic) UILabel* label; -@property (retain, nonatomic) UISwitch* toggle; +@property(retain, nonatomic) UILabel *label; +@property(retain, nonatomic) UISwitch *toggle; @end diff --git a/client/iOS/Views/EditFlagTableViewCell.m b/client/iOS/Views/EditFlagTableViewCell.m index 4a3a1f210..e27a0c6c2 100644 --- a/client/iOS/Views/EditFlagTableViewCell.m +++ b/client/iOS/Views/EditFlagTableViewCell.m @@ -1,10 +1,11 @@ /* Custom table cell with toggle switch - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "EditFlagTableViewCell.h" @@ -15,18 +16,19 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; - if (self) { - // Initialization code - } - return self; + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) + { + // Initialization code + } + return self; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { - [super setSelected:selected animated:animated]; + [super setSelected:selected animated:animated]; - // Configure the view for the selected state + // Configure the view for the selected state } @end diff --git a/client/iOS/Views/EditSecretTextTableViewCell.h b/client/iOS/Views/EditSecretTextTableViewCell.h index 3bc773c4f..2bc90c7df 100644 --- a/client/iOS/Views/EditSecretTextTableViewCell.h +++ b/client/iOS/Views/EditSecretTextTableViewCell.h @@ -1,23 +1,24 @@ /* Custom table cell with secret edit text field - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @interface EditSecretTextTableViewCell : UITableViewCell { - IBOutlet UILabel* _label; - IBOutlet UITextField* _textfield; - IBOutlet UIButton* _unhide_button; + IBOutlet UILabel *_label; + IBOutlet UITextField *_textfield; + IBOutlet UIButton *_unhide_button; } -@property (retain, nonatomic) UILabel* label; -@property (retain, nonatomic) UITextField* textfield; +@property(retain, nonatomic) UILabel *label; +@property(retain, nonatomic) UITextField *textfield; - (void)setEnabled:(BOOL)enabled; diff --git a/client/iOS/Views/EditSecretTextTableViewCell.m b/client/iOS/Views/EditSecretTextTableViewCell.m index 623ef0810..2c2617320 100644 --- a/client/iOS/Views/EditSecretTextTableViewCell.m +++ b/client/iOS/Views/EditSecretTextTableViewCell.m @@ -1,10 +1,11 @@ /* Custom table cell with secret edit text field - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "EditSecretTextTableViewCell.h" @@ -15,40 +16,46 @@ - (void)awakeFromNib { - [super awakeFromNib]; - [_unhide_button setTitle:NSLocalizedString(@"Unhide", @"Button title 'Unhide'") forState:UIControlStateNormal]; - [_unhide_button addTarget:self action:@selector(togglePasswordMode:) forControlEvents:UIControlEventTouchUpInside]; + [super awakeFromNib]; + [_unhide_button setTitle:NSLocalizedString(@"Unhide", @"Button title 'Unhide'") + forState:UIControlStateNormal]; + [_unhide_button addTarget:self + action:@selector(togglePasswordMode:) + forControlEvents:UIControlEventTouchUpInside]; } - (void)setEnabled:(BOOL)enabled { - [_label setEnabled:enabled]; - [_textfield setEnabled:enabled]; - [_unhide_button setEnabled:enabled]; + [_label setEnabled:enabled]; + [_textfield setEnabled:enabled]; + [_unhide_button setEnabled:enabled]; } #pragma mark - action handlers - (void)togglePasswordMode:(id)sender { - BOOL isSecure = [_textfield isSecureTextEntry]; + BOOL isSecure = [_textfield isSecureTextEntry]; - if (isSecure) - { - [_unhide_button setTitle:NSLocalizedString(@"Hide", @"Button title 'Hide'") forState:UIControlStateNormal]; - [_textfield setSecureTextEntry:NO]; - } - else - { - BOOL first_responder = [_textfield isFirstResponder]; - // little trick to make non-secure to secure transition working - this seems to be an ios bug: - // http://stackoverflow.com/questions/6710019/uitextfield-securetextentry-works-going-from-yes-to-no-but-changing-back-to-y - [_textfield setEnabled:NO]; - [_unhide_button setTitle:NSLocalizedString(@"Unhide", @"Button title 'Unhide'") forState:UIControlStateNormal]; - [_textfield setSecureTextEntry:YES]; - [_textfield setEnabled:YES]; - if (first_responder) - [_textfield becomeFirstResponder]; - } + if (isSecure) + { + [_unhide_button setTitle:NSLocalizedString(@"Hide", @"Button title 'Hide'") + forState:UIControlStateNormal]; + [_textfield setSecureTextEntry:NO]; + } + else + { + BOOL first_responder = [_textfield isFirstResponder]; + // little trick to make non-secure to secure transition working - this seems to be an ios + // bug: + // http://stackoverflow.com/questions/6710019/uitextfield-securetextentry-works-going-from-yes-to-no-but-changing-back-to-y + [_textfield setEnabled:NO]; + [_unhide_button setTitle:NSLocalizedString(@"Unhide", @"Button title 'Unhide'") + forState:UIControlStateNormal]; + [_textfield setSecureTextEntry:YES]; + [_textfield setEnabled:YES]; + if (first_responder) + [_textfield becomeFirstResponder]; + } } @end diff --git a/client/iOS/Views/EditSelectionTableViewCell.h b/client/iOS/Views/EditSelectionTableViewCell.h index ffc8d833d..22ddb55fe 100644 --- a/client/iOS/Views/EditSelectionTableViewCell.h +++ b/client/iOS/Views/EditSelectionTableViewCell.h @@ -1,21 +1,22 @@ /* Custom table cell with a label on the right, showing the current selection - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @interface EditSelectionTableViewCell : UITableViewCell { - IBOutlet UILabel* _label; - IBOutlet UILabel* _selection; + IBOutlet UILabel *_label; + IBOutlet UILabel *_selection; } -@property (retain, nonatomic) UILabel* label; -@property (retain, nonatomic) UILabel* selection; +@property(retain, nonatomic) UILabel *label; +@property(retain, nonatomic) UILabel *selection; @end diff --git a/client/iOS/Views/EditSelectionTableViewCell.m b/client/iOS/Views/EditSelectionTableViewCell.m index 3873aac71..969b8fe14 100644 --- a/client/iOS/Views/EditSelectionTableViewCell.m +++ b/client/iOS/Views/EditSelectionTableViewCell.m @@ -1,10 +1,11 @@ /* Custom table cell with a label on the right, showing the current selection - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "EditSelectionTableViewCell.h" @@ -15,18 +16,19 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; - if (self) { - // Initialization code - } - return self; + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) + { + // Initialization code + } + return self; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { - [super setSelected:selected animated:animated]; + [super setSelected:selected animated:animated]; - // Configure the view for the selected state + // Configure the view for the selected state } @end diff --git a/client/iOS/Views/EditSubEditTableViewCell.h b/client/iOS/Views/EditSubEditTableViewCell.h index 6a2f08f4a..276827363 100644 --- a/client/iOS/Views/EditSubEditTableViewCell.h +++ b/client/iOS/Views/EditSubEditTableViewCell.h @@ -1,19 +1,20 @@ /* Custom table cell indicating a switch to a sub-view - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @interface EditSubEditTableViewCell : UITableViewCell { - IBOutlet UILabel* _label; + IBOutlet UILabel *_label; } -@property (retain, nonatomic) UILabel* label; +@property(retain, nonatomic) UILabel *label; @end diff --git a/client/iOS/Views/EditSubEditTableViewCell.m b/client/iOS/Views/EditSubEditTableViewCell.m index 170e81d49..5e5b68259 100644 --- a/client/iOS/Views/EditSubEditTableViewCell.m +++ b/client/iOS/Views/EditSubEditTableViewCell.m @@ -1,10 +1,11 @@ /* Custom table cell indicating a switch to a sub-view - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "EditSubEditTableViewCell.h" @@ -15,18 +16,19 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; - if (self) { - // Initialization code - } - return self; + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) + { + // Initialization code + } + return self; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { - [super setSelected:selected animated:animated]; + [super setSelected:selected animated:animated]; - // Configure the view for the selected state + // Configure the view for the selected state } @end diff --git a/client/iOS/Views/EditTextTableViewCell.h b/client/iOS/Views/EditTextTableViewCell.h index eaf99b1c2..baf8bc8b5 100644 --- a/client/iOS/Views/EditTextTableViewCell.h +++ b/client/iOS/Views/EditTextTableViewCell.h @@ -1,21 +1,22 @@ /* Custom table cell with edit text field - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @interface EditTextTableViewCell : UITableViewCell { - IBOutlet UILabel* _label; - IBOutlet UITextField* _textfield; + IBOutlet UILabel *_label; + IBOutlet UITextField *_textfield; } -@property (retain, nonatomic) UILabel* label; -@property (retain, nonatomic) UITextField* textfield; +@property(retain, nonatomic) UILabel *label; +@property(retain, nonatomic) UITextField *textfield; @end diff --git a/client/iOS/Views/EditTextTableViewCell.m b/client/iOS/Views/EditTextTableViewCell.m index 765572425..26f70482e 100644 --- a/client/iOS/Views/EditTextTableViewCell.m +++ b/client/iOS/Views/EditTextTableViewCell.m @@ -1,10 +1,11 @@ /* Custom table cell with edit text field - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "EditTextTableViewCell.h" @@ -15,18 +16,19 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; - if (self) { - // Initialization code - } - return self; + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) + { + // Initialization code + } + return self; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { - [super setSelected:selected animated:animated]; + [super setSelected:selected animated:animated]; - // Configure the view for the selected state + // Configure the view for the selected state } @end diff --git a/client/iOS/Views/RDPSessionView.h b/client/iOS/Views/RDPSessionView.h index cf90ea1a1..dbe9b4230 100644 --- a/client/iOS/Views/RDPSessionView.h +++ b/client/iOS/Views/RDPSessionView.h @@ -1,10 +1,11 @@ /* RDP Session View - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @@ -12,9 +13,9 @@ @interface RDPSessionView : UIView { - RDPSession* _session; + RDPSession *_session; } -- (void)setSession:(RDPSession*)session; +- (void)setSession:(RDPSession *)session; @end diff --git a/client/iOS/Views/RDPSessionView.m b/client/iOS/Views/RDPSessionView.m index efda38bbe..110db01bf 100644 --- a/client/iOS/Views/RDPSessionView.m +++ b/client/iOS/Views/RDPSessionView.m @@ -1,51 +1,58 @@ /* RDP Session View - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "RDPSessionView.h" @implementation RDPSessionView -- (void)setSession:(RDPSession*)session +- (void)setSession:(RDPSession *)session { - _session = session; + _session = session; } - (void)awakeFromNib { - [super awakeFromNib]; - _session = nil; + [super awakeFromNib]; + _session = nil; } -- (void)drawRect:(CGRect)rect +- (void)drawRect:(CGRect)rect { - if(_session != nil && [_session bitmapContext]) + if (_session != nil && [_session bitmapContext]) { CGContextRef context = UIGraphicsGetCurrentContext(); CGImageRef cgImage = CGBitmapContextCreateImage([_session bitmapContext]); - CGContextTranslateCTM(context, 0, [self bounds].size.height); - CGContextScaleCTM(context, 1.0, -1.0); - CGContextClipToRect(context, CGRectMake(rect.origin.x, [self bounds].size.height - rect.origin.y - rect.size.height, rect.size.width, rect.size.height)); - CGContextDrawImage(context, CGRectMake(0, 0, [self bounds].size.width, [self bounds].size.height), cgImage); - - CGImageRelease(cgImage); + CGContextTranslateCTM(context, 0, [self bounds].size.height); + CGContextScaleCTM(context, 1.0, -1.0); + CGContextClipToRect(context, + CGRectMake(rect.origin.x, + [self bounds].size.height - rect.origin.y - rect.size.height, + rect.size.width, rect.size.height)); + CGContextDrawImage(context, + CGRectMake(0, 0, [self bounds].size.width, [self bounds].size.height), + cgImage); + + CGImageRelease(cgImage); + } + else + { + // just clear the screen with black + [[UIColor blackColor] set]; + UIRectFill([self bounds]); } - else - { - // just clear the screen with black - [[UIColor blackColor] set]; - UIRectFill([self bounds]); - } } -- (void)dealloc { - [super dealloc]; +- (void)dealloc +{ + [super dealloc]; } @end diff --git a/client/iOS/Views/SessionTableCell.h b/client/iOS/Views/SessionTableCell.h index 7aed07d77..726b4f1aa 100644 --- a/client/iOS/Views/SessionTableCell.h +++ b/client/iOS/Views/SessionTableCell.h @@ -1,28 +1,28 @@ /* Custom session table cell - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import - -@interface SessionTableCell : UITableViewCell +@interface SessionTableCell : UITableViewCell { - IBOutlet UILabel* _title; - IBOutlet UILabel* _server; - IBOutlet UILabel* _username; - IBOutlet UIImageView* _screenshot; - IBOutlet UIButton* _disconnect_button; + IBOutlet UILabel *_title; + IBOutlet UILabel *_server; + IBOutlet UILabel *_username; + IBOutlet UIImageView *_screenshot; + IBOutlet UIButton *_disconnect_button; } -@property (retain, nonatomic) UILabel* title; -@property (retain, nonatomic) UILabel* server; -@property (retain, nonatomic) UILabel* username; -@property (retain, nonatomic) UIImageView* screenshot; -@property (retain, nonatomic) UIButton* disconnectButton; +@property(retain, nonatomic) UILabel *title; +@property(retain, nonatomic) UILabel *server; +@property(retain, nonatomic) UILabel *username; +@property(retain, nonatomic) UIImageView *screenshot; +@property(retain, nonatomic) UIButton *disconnectButton; @end diff --git a/client/iOS/Views/SessionTableCell.m b/client/iOS/Views/SessionTableCell.m index 14a62072b..d506439bb 100644 --- a/client/iOS/Views/SessionTableCell.m +++ b/client/iOS/Views/SessionTableCell.m @@ -1,40 +1,42 @@ /* Custom session table cell - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "SessionTableCell.h" - @implementation SessionTableCell -@synthesize title = _title, server = _server, username = _username, screenshot = _screenshot, disconnectButton = _disconnect_button; +@synthesize title = _title, server = _server, username = _username, screenshot = _screenshot, + disconnectButton = _disconnect_button; -- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - - self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; - if (self) { - // Initialization code. - } - return self; +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) + { + // Initialization code. + } + return self; } +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ -- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - - [super setSelected:selected animated:animated]; - - // Configure the view for the selected state. + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state. } - -- (void)dealloc { - [super dealloc]; +- (void)dealloc +{ + [super dealloc]; } - @end diff --git a/client/iOS/Views/TouchPointerView.h b/client/iOS/Views/TouchPointerView.h index 8bc1bb171..2dcb054cf 100644 --- a/client/iOS/Views/TouchPointerView.h +++ b/client/iOS/Views/TouchPointerView.h @@ -1,10 +1,11 @@ /* - RDP Touch Pointer View - + RDP Touch Pointer View + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import @@ -12,58 +13,59 @@ // protocol for touch pointer callbacks @protocol TouchPointerDelegate // callback if touch pointer should be closed --(void)touchPointerClose; +- (void)touchPointerClose; // callback for a left click action --(void)touchPointerLeftClick:(CGPoint)pos down:(BOOL)down; +- (void)touchPointerLeftClick:(CGPoint)pos down:(BOOL)down; // callback for a right click action --(void)touchPointerRightClick:(CGPoint)pos down:(BOOL)down; +- (void)touchPointerRightClick:(CGPoint)pos down:(BOOL)down; // callback for pointer move action --(void)touchPointerMove:(CGPoint)pos; +- (void)touchPointerMove:(CGPoint)pos; // callback if scrolling is performed --(void)touchPointerScrollDown:(BOOL)down; +- (void)touchPointerScrollDown:(BOOL)down; // callback for toggling the standard keyboard --(void)touchPointerToggleKeyboard; +- (void)touchPointerToggleKeyboard; // callback for toggling the extended keyboard --(void)touchPointerToggleExtendedKeyboard; +- (void)touchPointerToggleExtendedKeyboard; // callback for reset session view --(void)touchPointerResetSessionView; +- (void)touchPointerResetSessionView; @end - @interface TouchPointerView : UIView { - // transformation and image currently drawn - CGAffineTransform _pointer_transformation; - UIImage* _cur_pointer_img; + // transformation and image currently drawn + CGAffineTransform _pointer_transformation; + UIImage *_cur_pointer_img; - // action images - UIImage* _default_pointer_img; - UIImage* _active_pointer_img; - UIImage* _lclick_pointer_img; - UIImage* _rclick_pointer_img; - UIImage* _scroll_pointer_img; - UIImage* _extkeyboard_pointer_img; - UIImage* _keyboard_pointer_img; - UIImage* _reset_pointer_img; + // action images + UIImage *_default_pointer_img; + UIImage *_active_pointer_img; + UIImage *_lclick_pointer_img; + UIImage *_rclick_pointer_img; + UIImage *_scroll_pointer_img; + UIImage *_extkeyboard_pointer_img; + UIImage *_keyboard_pointer_img; + UIImage *_reset_pointer_img; - // predefined areas for all actions - CGRect _pointer_areas[9]; - - // scroll/drag n drop handling - CGPoint _prev_touch_location; - BOOL _pointer_moving; - BOOL _pointer_scrolling; - - NSObject* _delegate; + // predefined areas for all actions + CGRect _pointer_areas[9]; + + // scroll/drag n drop handling + CGPoint _prev_touch_location; + BOOL _pointer_moving; + BOOL _pointer_scrolling; + + NSObject *_delegate; } -@property (assign) IBOutlet NSObject* delegate; +@property(assign) IBOutlet NSObject *delegate; -// positions the pointer on screen if it got offscreen after an orentation change or after displaying the keyboard --(void)ensurePointerIsVisible; +// positions the pointer on screen if it got offscreen after an orentation change or after +// displaying the keyboard +- (void)ensurePointerIsVisible; -// returns the extent required for the scrollview to use the touch pointer near the edges of the session view --(UIEdgeInsets)getEdgeInsets; +// returns the extent required for the scrollview to use the touch pointer near the edges of the +// session view +- (UIEdgeInsets)getEdgeInsets; // return pointer dimension and position information - (CGPoint)getPointerPosition; diff --git a/client/iOS/Views/TouchPointerView.m b/client/iOS/Views/TouchPointerView.m index 11ed8737b..8bd76c8db 100644 --- a/client/iOS/Views/TouchPointerView.m +++ b/client/iOS/Views/TouchPointerView.m @@ -1,37 +1,37 @@ /* - RDP Touch Pointer View - + RDP Touch Pointer View + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import "TouchPointerView.h" #import "Utils.h" - #define RESET_DEFAULT_POINTER_IMAGE_DELAY 0.15 -#define POINTER_ACTION_CURSOR 0 -#define POINTER_ACTION_CLOSE 3 -#define POINTER_ACTION_RCLICK 2 -#define POINTER_ACTION_LCLICK 4 -#define POINTER_ACTION_MOVE 4 -#define POINTER_ACTION_SCROLL 5 +#define POINTER_ACTION_CURSOR 0 +#define POINTER_ACTION_CLOSE 3 +#define POINTER_ACTION_RCLICK 2 +#define POINTER_ACTION_LCLICK 4 +#define POINTER_ACTION_MOVE 4 +#define POINTER_ACTION_SCROLL 5 #define POINTER_ACTION_KEYBOARD 7 #define POINTER_ACTION_EXTKEYBOARD 8 #define POINTER_ACTION_RESET 6 @interface TouchPointerView (Private) -- (void)setCurrentPointerImage:(UIImage*)image; -- (void)displayPointerActionImage:(UIImage*)image; +- (void)setCurrentPointerImage:(UIImage *)image; +- (void)displayPointerActionImage:(UIImage *)image; - (BOOL)pointInsidePointer:(CGPoint)point; - (BOOL)pointInsidePointerArea:(int)area point:(CGPoint)point; - (CGPoint)getCursorPosition; - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event; -- (void)handleSingleTap:(UITapGestureRecognizer*)gesture; -- (void)handlerForGesture:(UIGestureRecognizer*)gesture sendClick:(BOOL)sendClick; +- (void)handleSingleTap:(UITapGestureRecognizer *)gesture; +- (void)handlerForGesture:(UIGestureRecognizer *)gesture sendClick:(BOOL)sendClick; @end @implementation TouchPointerView @@ -40,289 +40,320 @@ - (void)awakeFromNib { - [super awakeFromNib]; - - // set content mode when rotating (keep aspect ratio) - [self setContentMode:UIViewContentModeTopLeft]; - - // load touchPointerImage - _default_pointer_img = [[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_default" ofType:@"png"]] retain]; - _active_pointer_img = [[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_active" ofType:@"png"]] retain]; - _lclick_pointer_img = [[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_lclick" ofType:@"png"]] retain]; - _rclick_pointer_img = [[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_rclick" ofType:@"png"]] retain]; - _scroll_pointer_img = [[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_scroll" ofType:@"png"]] retain]; - _extkeyboard_pointer_img = [[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_ext_keyboard" ofType:@"png"]] retain]; - _keyboard_pointer_img = [[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_keyboard" ofType:@"png"]] retain]; - _reset_pointer_img = [[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_reset" ofType:@"png"]] retain]; - _cur_pointer_img = _default_pointer_img; - _pointer_transformation = CGAffineTransformMake(1, 0, 0, 1, 0, 0); - - // init flags - _pointer_moving = NO; - _pointer_scrolling = NO; - - // create areas array - int i, j; - CGFloat area_width = [_cur_pointer_img size].width / 3.0f; - CGFloat area_height = [_cur_pointer_img size].height / 3.0f; - for(i = 0; i < 3; i++) - { - for(j = 0; j < 3; j++) - { - _pointer_areas[j + i * 3] = CGRectMake(j * area_width, i * area_height, area_width, area_height); - } - } - - // init gesture recognizers - UITapGestureRecognizer* singleTapRecognizer = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)] autorelease]; - [singleTapRecognizer setNumberOfTouchesRequired:1]; - [singleTapRecognizer setNumberOfTapsRequired:1]; - - UILongPressGestureRecognizer* dragDropRecognizer = [[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleDragDrop:)] autorelease]; - dragDropRecognizer.minimumPressDuration = 0.4; - // dragDropRecognizer.allowableMovement = 1000.0; - - UILongPressGestureRecognizer* pointerMoveScrollRecognizer = [[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handlePointerMoveScroll:)] autorelease]; - pointerMoveScrollRecognizer.minimumPressDuration = 0.15; - pointerMoveScrollRecognizer.allowableMovement = 1000.0; - [pointerMoveScrollRecognizer requireGestureRecognizerToFail:dragDropRecognizer]; - - [self addGestureRecognizer:singleTapRecognizer]; - [self addGestureRecognizer:dragDropRecognizer]; - [self addGestureRecognizer:pointerMoveScrollRecognizer]; + [super awakeFromNib]; + + // set content mode when rotating (keep aspect ratio) + [self setContentMode:UIViewContentModeTopLeft]; + + // load touchPointerImage + _default_pointer_img = [[UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_default" + ofType:@"png"]] retain]; + _active_pointer_img = [[UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_active" + ofType:@"png"]] retain]; + _lclick_pointer_img = [[UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_lclick" + ofType:@"png"]] retain]; + _rclick_pointer_img = [[UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_rclick" + ofType:@"png"]] retain]; + _scroll_pointer_img = [[UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_scroll" + ofType:@"png"]] retain]; + _extkeyboard_pointer_img = [[UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_ext_keyboard" + ofType:@"png"]] retain]; + _keyboard_pointer_img = [[UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_keyboard" + ofType:@"png"]] retain]; + _reset_pointer_img = [[UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_reset" + ofType:@"png"]] retain]; + _cur_pointer_img = _default_pointer_img; + _pointer_transformation = CGAffineTransformMake(1, 0, 0, 1, 0, 0); + + // init flags + _pointer_moving = NO; + _pointer_scrolling = NO; + + // create areas array + int i, j; + CGFloat area_width = [_cur_pointer_img size].width / 3.0f; + CGFloat area_height = [_cur_pointer_img size].height / 3.0f; + for (i = 0; i < 3; i++) + { + for (j = 0; j < 3; j++) + { + _pointer_areas[j + i * 3] = + CGRectMake(j * area_width, i * area_height, area_width, area_height); + } + } + + // init gesture recognizers + UITapGestureRecognizer *singleTapRecognizer = + [[[UITapGestureRecognizer alloc] initWithTarget:self + action:@selector(handleSingleTap:)] autorelease]; + [singleTapRecognizer setNumberOfTouchesRequired:1]; + [singleTapRecognizer setNumberOfTapsRequired:1]; + + UILongPressGestureRecognizer *dragDropRecognizer = [[[UILongPressGestureRecognizer alloc] + initWithTarget:self + action:@selector(handleDragDrop:)] autorelease]; + dragDropRecognizer.minimumPressDuration = 0.4; + // dragDropRecognizer.allowableMovement = 1000.0; + + UILongPressGestureRecognizer *pointerMoveScrollRecognizer = + [[[UILongPressGestureRecognizer alloc] initWithTarget:self + action:@selector(handlePointerMoveScroll:)] + autorelease]; + pointerMoveScrollRecognizer.minimumPressDuration = 0.15; + pointerMoveScrollRecognizer.allowableMovement = 1000.0; + [pointerMoveScrollRecognizer requireGestureRecognizerToFail:dragDropRecognizer]; + + [self addGestureRecognizer:singleTapRecognizer]; + [self addGestureRecognizer:dragDropRecognizer]; + [self addGestureRecognizer:pointerMoveScrollRecognizer]; } - (void)dealloc { - [super dealloc]; - [_default_pointer_img autorelease]; - [_active_pointer_img autorelease]; - [_lclick_pointer_img autorelease]; - [_rclick_pointer_img autorelease]; - [_scroll_pointer_img autorelease]; - [_extkeyboard_pointer_img autorelease]; - [_keyboard_pointer_img autorelease]; - [_reset_pointer_img autorelease]; + [super dealloc]; + [_default_pointer_img autorelease]; + [_active_pointer_img autorelease]; + [_lclick_pointer_img autorelease]; + [_rclick_pointer_img autorelease]; + [_scroll_pointer_img autorelease]; + [_extkeyboard_pointer_img autorelease]; + [_keyboard_pointer_img autorelease]; + [_reset_pointer_img autorelease]; } #pragma mark - Public interface // positions the pointer on screen if it got offscreen after an orentation change --(void)ensurePointerIsVisible +- (void)ensurePointerIsVisible { - CGRect bounds = [self bounds]; - if(_pointer_transformation.tx > (bounds.size.width - _cur_pointer_img.size.width)) - _pointer_transformation.tx = bounds.size.width - _cur_pointer_img.size.width; - if(_pointer_transformation.ty > (bounds.size.height - _cur_pointer_img.size.height)) - _pointer_transformation.ty = bounds.size.height - _cur_pointer_img.size.height; - [self setNeedsDisplay]; + CGRect bounds = [self bounds]; + if (_pointer_transformation.tx > (bounds.size.width - _cur_pointer_img.size.width)) + _pointer_transformation.tx = bounds.size.width - _cur_pointer_img.size.width; + if (_pointer_transformation.ty > (bounds.size.height - _cur_pointer_img.size.height)) + _pointer_transformation.ty = bounds.size.height - _cur_pointer_img.size.height; + [self setNeedsDisplay]; } // show/hides the touch pointer --(void)setHidden:(BOOL)hidden -{ - [super setHidden:hidden]; +- (void)setHidden:(BOOL)hidden +{ + [super setHidden:hidden]; - // if shown center pointer in view - if(!hidden) - { - _pointer_transformation = CGAffineTransformMakeTranslation(([self bounds].size.width - [_cur_pointer_img size].width) / 2, - ([self bounds].size.height - [_cur_pointer_img size].height) / 2); - [self setNeedsDisplay]; - } + // if shown center pointer in view + if (!hidden) + { + _pointer_transformation = CGAffineTransformMakeTranslation( + ([self bounds].size.width - [_cur_pointer_img size].width) / 2, + ([self bounds].size.height - [_cur_pointer_img size].height) / 2); + [self setNeedsDisplay]; + } } --(UIEdgeInsets)getEdgeInsets +- (UIEdgeInsets)getEdgeInsets { - return UIEdgeInsetsMake(0, 0, [_cur_pointer_img size].width, [_cur_pointer_img size].height); + return UIEdgeInsetsMake(0, 0, [_cur_pointer_img size].width, [_cur_pointer_img size].height); } - (CGPoint)getPointerPosition { - return CGPointMake(_pointer_transformation.tx, _pointer_transformation.ty); + return CGPointMake(_pointer_transformation.tx, _pointer_transformation.ty); } - (int)getPointerWidth { - return [_cur_pointer_img size].width; + return [_cur_pointer_img size].width; } - (int)getPointerHeight { - return [_cur_pointer_img size].height; + return [_cur_pointer_img size].height; } - @end @implementation TouchPointerView (Private) -- (void)setCurrentPointerImage:(UIImage*)image +- (void)setCurrentPointerImage:(UIImage *)image { - _cur_pointer_img = image; - [self setNeedsDisplay]; + _cur_pointer_img = image; + [self setNeedsDisplay]; } -- (void)displayPointerActionImage:(UIImage*)image +- (void)displayPointerActionImage:(UIImage *)image { - [self setCurrentPointerImage:image]; - [self performSelector:@selector(setCurrentPointerImage:) withObject:_default_pointer_img afterDelay:RESET_DEFAULT_POINTER_IMAGE_DELAY]; + [self setCurrentPointerImage:image]; + [self performSelector:@selector(setCurrentPointerImage:) + withObject:_default_pointer_img + afterDelay:RESET_DEFAULT_POINTER_IMAGE_DELAY]; } // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. - (void)drawRect:(CGRect)rect { - // Drawing code - CGContextRef context = UIGraphicsGetCurrentContext(); - CGContextSaveGState(context); - CGContextConcatCTM(context, _pointer_transformation); - CGContextDrawImage(context, CGRectMake(0, 0, [_cur_pointer_img size].width, [_cur_pointer_img size].height), [_cur_pointer_img CGImage]); - CGContextRestoreGState(context); + // Drawing code + CGContextRef context = UIGraphicsGetCurrentContext(); + CGContextSaveGState(context); + CGContextConcatCTM(context, _pointer_transformation); + CGContextDrawImage( + context, CGRectMake(0, 0, [_cur_pointer_img size].width, [_cur_pointer_img size].height), + [_cur_pointer_img CGImage]); + CGContextRestoreGState(context); } // helper that returns YES if the given point is within the pointer --(BOOL) pointInsidePointer:(CGPoint)point +- (BOOL)pointInsidePointer:(CGPoint)point { - CGRect rec = CGRectMake(0, 0, [_cur_pointer_img size].width, [_cur_pointer_img size].height); - return CGRectContainsPoint(CGRectApplyAffineTransform(rec, _pointer_transformation), point); + CGRect rec = CGRectMake(0, 0, [_cur_pointer_img size].width, [_cur_pointer_img size].height); + return CGRectContainsPoint(CGRectApplyAffineTransform(rec, _pointer_transformation), point); } // helper that returns YES if the given point is within the given pointer area --(BOOL) pointInsidePointerArea:(int)area point:(CGPoint)point +- (BOOL)pointInsidePointerArea:(int)area point:(CGPoint)point { - CGRect rec = _pointer_areas[area]; - return CGRectContainsPoint(CGRectApplyAffineTransform(rec, _pointer_transformation), point); + CGRect rec = _pointer_areas[area]; + return CGRectContainsPoint(CGRectApplyAffineTransform(rec, _pointer_transformation), point); } // returns the position of the cursor --(CGPoint) getCursorPosition +- (CGPoint)getCursorPosition { - CGRect transPointerArea = CGRectApplyAffineTransform(_pointer_areas[POINTER_ACTION_CURSOR], _pointer_transformation); - return CGPointMake(CGRectGetMidX(transPointerArea), CGRectGetMidY(transPointerArea)); + CGRect transPointerArea = + CGRectApplyAffineTransform(_pointer_areas[POINTER_ACTION_CURSOR], _pointer_transformation); + return CGPointMake(CGRectGetMidX(transPointerArea), CGRectGetMidY(transPointerArea)); } // this filters events - if the pointer was clicked the scrollview won't get any events --(BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event +- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event { - return [self pointInsidePointer:point]; + return [self pointInsidePointer:point]; } #pragma mark - Action handlers // handles single tap gestures, returns YES if the event was handled by the pointer, NO otherwise --(void) handleSingleTap:(UITapGestureRecognizer*)gesture +- (void)handleSingleTap:(UITapGestureRecognizer *)gesture { - // get touch position within our view - CGPoint touchPos = [gesture locationInView:self]; - - // look if pointer was in one of our action areas - if([self pointInsidePointerArea:POINTER_ACTION_CLOSE point:touchPos]) - [[self delegate] touchPointerClose]; - else if([self pointInsidePointerArea:POINTER_ACTION_LCLICK point:touchPos]) - { - [self displayPointerActionImage:_lclick_pointer_img]; - [[self delegate] touchPointerLeftClick:[self getCursorPosition] down:YES]; - [[self delegate] touchPointerLeftClick:[self getCursorPosition] down:NO]; - } - else if([self pointInsidePointerArea:POINTER_ACTION_RCLICK point:touchPos]) - { - [self displayPointerActionImage:_rclick_pointer_img]; - [[self delegate] touchPointerRightClick:[self getCursorPosition] down:YES]; - [[self delegate] touchPointerRightClick:[self getCursorPosition] down:NO]; - } - else if([self pointInsidePointerArea:POINTER_ACTION_KEYBOARD point:touchPos]) - { - [self displayPointerActionImage:_keyboard_pointer_img]; - [[self delegate] touchPointerToggleKeyboard]; - } - else if([self pointInsidePointerArea:POINTER_ACTION_EXTKEYBOARD point:touchPos]) - { - [self displayPointerActionImage:_extkeyboard_pointer_img]; - [[self delegate] touchPointerToggleExtendedKeyboard]; - } - else if([self pointInsidePointerArea:POINTER_ACTION_RESET point:touchPos]) - { - [self displayPointerActionImage:_reset_pointer_img]; - [[self delegate] touchPointerResetSessionView]; - } + // get touch position within our view + CGPoint touchPos = [gesture locationInView:self]; + + // look if pointer was in one of our action areas + if ([self pointInsidePointerArea:POINTER_ACTION_CLOSE point:touchPos]) + [[self delegate] touchPointerClose]; + else if ([self pointInsidePointerArea:POINTER_ACTION_LCLICK point:touchPos]) + { + [self displayPointerActionImage:_lclick_pointer_img]; + [[self delegate] touchPointerLeftClick:[self getCursorPosition] down:YES]; + [[self delegate] touchPointerLeftClick:[self getCursorPosition] down:NO]; + } + else if ([self pointInsidePointerArea:POINTER_ACTION_RCLICK point:touchPos]) + { + [self displayPointerActionImage:_rclick_pointer_img]; + [[self delegate] touchPointerRightClick:[self getCursorPosition] down:YES]; + [[self delegate] touchPointerRightClick:[self getCursorPosition] down:NO]; + } + else if ([self pointInsidePointerArea:POINTER_ACTION_KEYBOARD point:touchPos]) + { + [self displayPointerActionImage:_keyboard_pointer_img]; + [[self delegate] touchPointerToggleKeyboard]; + } + else if ([self pointInsidePointerArea:POINTER_ACTION_EXTKEYBOARD point:touchPos]) + { + [self displayPointerActionImage:_extkeyboard_pointer_img]; + [[self delegate] touchPointerToggleExtendedKeyboard]; + } + else if ([self pointInsidePointerArea:POINTER_ACTION_RESET point:touchPos]) + { + [self displayPointerActionImage:_reset_pointer_img]; + [[self delegate] touchPointerResetSessionView]; + } } --(void) handlerForGesture:(UIGestureRecognizer*)gesture sendClick:(BOOL)sendClick +- (void)handlerForGesture:(UIGestureRecognizer *)gesture sendClick:(BOOL)sendClick { - if([gesture state] == UIGestureRecognizerStateBegan) - { - CGPoint touchPos = [gesture locationInView:self]; - if([self pointInsidePointerArea:POINTER_ACTION_LCLICK point:touchPos]) - { - _prev_touch_location = touchPos; - _pointer_moving = YES; - if(sendClick == YES) - { - [[self delegate] touchPointerLeftClick:[self getCursorPosition] down:YES]; - [self setCurrentPointerImage:_active_pointer_img]; - } - } - else if([self pointInsidePointerArea:POINTER_ACTION_SCROLL point:touchPos]) - { - [self setCurrentPointerImage:_scroll_pointer_img]; - _prev_touch_location = touchPos; - _pointer_scrolling = YES; - } - } - else if([gesture state] == UIGestureRecognizerStateChanged) - { - if(_pointer_moving) - { - CGPoint touchPos = [gesture locationInView:self]; - _pointer_transformation = CGAffineTransformTranslate(_pointer_transformation, touchPos.x - _prev_touch_location.x, touchPos.y - _prev_touch_location.y); - [[self delegate] touchPointerMove:[self getCursorPosition]]; - _prev_touch_location = touchPos; - [self setNeedsDisplay]; - } - else if(_pointer_scrolling) - { - CGPoint touchPos = [gesture locationInView:self]; - float delta = touchPos.y - _prev_touch_location.y; - if(delta > GetScrollGestureDelta()) - { - [[self delegate] touchPointerScrollDown:YES]; - _prev_touch_location = touchPos; - } - else if(delta < -GetScrollGestureDelta()) - { - [[self delegate] touchPointerScrollDown:NO]; - _prev_touch_location = touchPos; - } - } - } - else if([gesture state] == UIGestureRecognizerStateEnded) - { - if(_pointer_moving) - { - if(sendClick == YES) - [[self delegate] touchPointerLeftClick:[self getCursorPosition] down:NO]; - _pointer_moving = NO; - [self setCurrentPointerImage:_default_pointer_img]; - } + if ([gesture state] == UIGestureRecognizerStateBegan) + { + CGPoint touchPos = [gesture locationInView:self]; + if ([self pointInsidePointerArea:POINTER_ACTION_LCLICK point:touchPos]) + { + _prev_touch_location = touchPos; + _pointer_moving = YES; + if (sendClick == YES) + { + [[self delegate] touchPointerLeftClick:[self getCursorPosition] down:YES]; + [self setCurrentPointerImage:_active_pointer_img]; + } + } + else if ([self pointInsidePointerArea:POINTER_ACTION_SCROLL point:touchPos]) + { + [self setCurrentPointerImage:_scroll_pointer_img]; + _prev_touch_location = touchPos; + _pointer_scrolling = YES; + } + } + else if ([gesture state] == UIGestureRecognizerStateChanged) + { + if (_pointer_moving) + { + CGPoint touchPos = [gesture locationInView:self]; + _pointer_transformation = CGAffineTransformTranslate( + _pointer_transformation, touchPos.x - _prev_touch_location.x, + touchPos.y - _prev_touch_location.y); + [[self delegate] touchPointerMove:[self getCursorPosition]]; + _prev_touch_location = touchPos; + [self setNeedsDisplay]; + } + else if (_pointer_scrolling) + { + CGPoint touchPos = [gesture locationInView:self]; + float delta = touchPos.y - _prev_touch_location.y; + if (delta > GetScrollGestureDelta()) + { + [[self delegate] touchPointerScrollDown:YES]; + _prev_touch_location = touchPos; + } + else if (delta < -GetScrollGestureDelta()) + { + [[self delegate] touchPointerScrollDown:NO]; + _prev_touch_location = touchPos; + } + } + } + else if ([gesture state] == UIGestureRecognizerStateEnded) + { + if (_pointer_moving) + { + if (sendClick == YES) + [[self delegate] touchPointerLeftClick:[self getCursorPosition] down:NO]; + _pointer_moving = NO; + [self setCurrentPointerImage:_default_pointer_img]; + } - if(_pointer_scrolling) - { - [self setCurrentPointerImage:_default_pointer_img]; - _pointer_scrolling = NO; - } - } + if (_pointer_scrolling) + { + [self setCurrentPointerImage:_default_pointer_img]; + _pointer_scrolling = NO; + } + } } // handles long press gestures --(void) handleDragDrop:(UILongPressGestureRecognizer*)gesture +- (void)handleDragDrop:(UILongPressGestureRecognizer *)gesture { - [self handlerForGesture:gesture sendClick:YES]; + [self handlerForGesture:gesture sendClick:YES]; } --(void) handlePointerMoveScroll:(UILongPressGestureRecognizer*)gesture +- (void)handlePointerMoveScroll:(UILongPressGestureRecognizer *)gesture { - [self handlerForGesture:gesture sendClick:NO]; + [self handlerForGesture:gesture sendClick:NO]; } @end diff --git a/client/iOS/main.m b/client/iOS/main.m index cefffeaf9..afddfa4a8 100644 --- a/client/iOS/main.m +++ b/client/iOS/main.m @@ -1,18 +1,19 @@ /* Main App Entry - + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. */ #import int main(int argc, char *argv[]) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, nil); - [pool release]; - return retVal; +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + int retVal = UIApplicationMain(argc, argv, nil, nil); + [pool release]; + return retVal; } diff --git a/include/freerdp/addin.h b/include/freerdp/addin.h index 2fe1f58a2..2249e8f57 100644 --- a/include/freerdp/addin.h +++ b/include/freerdp/addin.h @@ -23,20 +23,20 @@ #include #include -#define FREERDP_ADDIN_CLIENT 0x00000001 -#define FREERDP_ADDIN_SERVER 0x00000002 +#define FREERDP_ADDIN_CLIENT 0x00000001 +#define FREERDP_ADDIN_SERVER 0x00000002 -#define FREERDP_ADDIN_STATIC 0x00000010 -#define FREERDP_ADDIN_DYNAMIC 0x00000020 +#define FREERDP_ADDIN_STATIC 0x00000010 +#define FREERDP_ADDIN_DYNAMIC 0x00000020 -#define FREERDP_ADDIN_NAME 0x00000100 -#define FREERDP_ADDIN_SUBSYSTEM 0x00000200 -#define FREERDP_ADDIN_TYPE 0x00000400 +#define FREERDP_ADDIN_NAME 0x00000100 +#define FREERDP_ADDIN_SUBSYSTEM 0x00000200 +#define FREERDP_ADDIN_TYPE 0x00000400 -#define FREERDP_ADDIN_CHANNEL_STATIC 0x00001000 -#define FREERDP_ADDIN_CHANNEL_DYNAMIC 0x00002000 -#define FREERDP_ADDIN_CHANNEL_DEVICE 0x00004000 -#define FREERDP_ADDIN_CHANNEL_ENTRYEX 0x00008000 +#define FREERDP_ADDIN_CHANNEL_STATIC 0x00001000 +#define FREERDP_ADDIN_CHANNEL_DYNAMIC 0x00002000 +#define FREERDP_ADDIN_CHANNEL_DEVICE 0x00004000 +#define FREERDP_ADDIN_CHANNEL_ENTRYEX 0x00008000 struct _FREERDP_ADDIN { @@ -47,29 +47,34 @@ struct _FREERDP_ADDIN }; typedef struct _FREERDP_ADDIN FREERDP_ADDIN; -typedef PVIRTUALCHANNELENTRY(*FREERDP_LOAD_CHANNEL_ADDIN_ENTRY_FN)( - LPCSTR pszName, LPCSTR pszSubsystem, LPCSTR pszType, DWORD dwFlags); +typedef PVIRTUALCHANNELENTRY (*FREERDP_LOAD_CHANNEL_ADDIN_ENTRY_FN)(LPCSTR pszName, + LPCSTR pszSubsystem, + LPCSTR pszType, DWORD dwFlags); #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API LPSTR freerdp_get_library_install_path(void); -FREERDP_API LPSTR freerdp_get_dynamic_addin_install_path(void); + FREERDP_API LPSTR freerdp_get_library_install_path(void); + FREERDP_API LPSTR freerdp_get_dynamic_addin_install_path(void); -FREERDP_API int freerdp_register_addin_provider( - FREERDP_LOAD_CHANNEL_ADDIN_ENTRY_FN provider, DWORD dwFlags); + FREERDP_API int freerdp_register_addin_provider(FREERDP_LOAD_CHANNEL_ADDIN_ENTRY_FN provider, + DWORD dwFlags); -FREERDP_API PVIRTUALCHANNELENTRY freerdp_load_dynamic_addin(LPCSTR pszFileName, - LPCSTR pszPath, LPCSTR pszEntryName); -FREERDP_API PVIRTUALCHANNELENTRY freerdp_load_dynamic_channel_addin_entry( - LPCSTR pszName, LPCSTR pszSubsystem, LPCSTR pszType, DWORD dwFlags); -FREERDP_API PVIRTUALCHANNELENTRY freerdp_load_channel_addin_entry( - LPCSTR pszName, LPCSTR pszSubsystem, LPCSTR pszType, DWORD dwFlags); + FREERDP_API PVIRTUALCHANNELENTRY freerdp_load_dynamic_addin(LPCSTR pszFileName, LPCSTR pszPath, + LPCSTR pszEntryName); + FREERDP_API PVIRTUALCHANNELENTRY freerdp_load_dynamic_channel_addin_entry(LPCSTR pszName, + LPCSTR pszSubsystem, + LPCSTR pszType, + DWORD dwFlags); + FREERDP_API PVIRTUALCHANNELENTRY freerdp_load_channel_addin_entry(LPCSTR pszName, + LPCSTR pszSubsystem, + LPCSTR pszType, + DWORD dwFlags); #ifdef __cplusplus } #endif #endif /* FREERDP_COMMON_ADDIN_H */ - diff --git a/include/freerdp/altsec.h b/include/freerdp/altsec.h index cd6a50371..96a71ed8a 100644 --- a/include/freerdp/altsec.h +++ b/include/freerdp/altsec.h @@ -22,19 +22,19 @@ #include -#define DSDNG_STRETCH 0x00000001 -#define DSDNG_TILE 0x00000002 -#define DSDNG_PERPIXELALPHA 0x00000004 -#define DSDNG_TRANSPARENT 0x00000008 -#define DSDNG_MUSTFLIP 0x00000010 -#define DSDNG_TRUESIZE 0x00000020 +#define DSDNG_STRETCH 0x00000001 +#define DSDNG_TILE 0x00000002 +#define DSDNG_PERPIXELALPHA 0x00000004 +#define DSDNG_TRANSPARENT 0x00000008 +#define DSDNG_MUSTFLIP 0x00000010 +#define DSDNG_TRUESIZE 0x00000020 -#define FRAME_START 0x00000000 -#define FRAME_END 0x00000001 +#define FRAME_START 0x00000000 +#define FRAME_END 0x00000001 -#define STREAM_BITMAP_END 0x01 -#define STREAM_BITMAP_COMPRESSED 0x02 -#define STREAM_BITMAP_V2 0x04 +#define STREAM_BITMAP_END 0x01 +#define STREAM_BITMAP_COMPRESSED 0x02 +#define STREAM_BITMAP_V2 0x04 struct _OFFSCREEN_DELETE_LIST { @@ -165,14 +165,12 @@ struct _DRAW_GDIPLUS_CACHE_END_ORDER }; typedef struct _DRAW_GDIPLUS_CACHE_END_ORDER DRAW_GDIPLUS_CACHE_END_ORDER; -typedef BOOL (*pCreateOffscreenBitmap)(rdpContext* context, - const CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap); -typedef BOOL (*pSwitchSurface)(rdpContext* context, - const SWITCH_SURFACE_ORDER* switch_surface); +typedef BOOL (*pCreateOffscreenBitmap)( + rdpContext* context, const CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap); +typedef BOOL (*pSwitchSurface)(rdpContext* context, const SWITCH_SURFACE_ORDER* switch_surface); typedef BOOL (*pCreateNineGridBitmap)(rdpContext* context, const CREATE_NINE_GRID_BITMAP_ORDER* create_nine_grid_bitmap); -typedef BOOL (*pFrameMarker)(rdpContext* context, - const FRAME_MARKER_ORDER* frame_marker); +typedef BOOL (*pFrameMarker)(rdpContext* context, const FRAME_MARKER_ORDER* frame_marker); typedef BOOL (*pStreamBitmapFirst)(rdpContext* context, const STREAM_BITMAP_FIRST_ORDER* stream_bitmap_first); typedef BOOL (*pStreamBitmapNext)(rdpContext* context, @@ -183,8 +181,8 @@ typedef BOOL (*pDrawGdiPlusNext)(rdpContext* context, const DRAW_GDIPLUS_NEXT_ORDER* draw_gdiplus_next); typedef BOOL (*pDrawGdiPlusEnd)(rdpContext* context, const DRAW_GDIPLUS_END_ORDER* draw_gdiplus_end); -typedef BOOL (*pDrawGdiPlusCacheFirst)(rdpContext* context, - const DRAW_GDIPLUS_CACHE_FIRST_ORDER* draw_gdiplus_cache_first); +typedef BOOL (*pDrawGdiPlusCacheFirst)( + rdpContext* context, const DRAW_GDIPLUS_CACHE_FIRST_ORDER* draw_gdiplus_cache_first); typedef BOOL (*pDrawGdiPlusCacheNext)(rdpContext* context, const DRAW_GDIPLUS_CACHE_NEXT_ORDER* draw_gdiplus_cache_next); typedef BOOL (*pDrawGdiPlusCacheEnd)(rdpContext* context, @@ -192,22 +190,22 @@ typedef BOOL (*pDrawGdiPlusCacheEnd)(rdpContext* context, struct rdp_altsec_update { - rdpContext* context; /* 0 */ + rdpContext* context; /* 0 */ UINT32 paddingA[16 - 1]; /* 1 */ pCreateOffscreenBitmap CreateOffscreenBitmap; /* 16 */ - pSwitchSurface SwitchSurface; /* 17 */ - pCreateNineGridBitmap CreateNineGridBitmap; /* 18 */ - pFrameMarker FrameMarker; /* 19 */ - pStreamBitmapFirst StreamBitmapFirst; /* 20 */ - pStreamBitmapNext StreamBitmapNext; /* 21 */ - pDrawGdiPlusFirst DrawGdiPlusFirst; /* 22 */ - pDrawGdiPlusNext DrawGdiPlusNext; /* 23 */ - pDrawGdiPlusEnd DrawGdiPlusEnd; /* 24 */ + pSwitchSurface SwitchSurface; /* 17 */ + pCreateNineGridBitmap CreateNineGridBitmap; /* 18 */ + pFrameMarker FrameMarker; /* 19 */ + pStreamBitmapFirst StreamBitmapFirst; /* 20 */ + pStreamBitmapNext StreamBitmapNext; /* 21 */ + pDrawGdiPlusFirst DrawGdiPlusFirst; /* 22 */ + pDrawGdiPlusNext DrawGdiPlusNext; /* 23 */ + pDrawGdiPlusEnd DrawGdiPlusEnd; /* 24 */ pDrawGdiPlusCacheFirst DrawGdiPlusCacheFirst; /* 25 */ - pDrawGdiPlusCacheNext DrawGdiPlusCacheNext; /* 26 */ - pDrawGdiPlusCacheEnd DrawGdiPlusCacheEnd; /* 27 */ - UINT32 paddingB[32 - 28]; /* 28 */ + pDrawGdiPlusCacheNext DrawGdiPlusCacheNext; /* 26 */ + pDrawGdiPlusCacheEnd DrawGdiPlusCacheEnd; /* 27 */ + UINT32 paddingB[32 - 28]; /* 28 */ /* internal */ diff --git a/include/freerdp/api.h b/include/freerdp/api.h index a4164beab..c6cecf875 100644 --- a/include/freerdp/api.h +++ b/include/freerdp/api.h @@ -29,9 +29,9 @@ #endif #ifdef _WIN32 -#define INLINE __inline +#define INLINE __inline #else -#define INLINE inline +#define INLINE inline #endif #ifdef _WIN32 @@ -54,7 +54,7 @@ #endif #else #if __GNUC__ >= 4 -#define FREERDP_API __attribute__ ((visibility("default"))) +#define FREERDP_API __attribute__((visibility("default"))) #else #define FREERDP_API #endif @@ -67,7 +67,7 @@ #define FREERDP_LOCAL #else #if __GNUC__ >= 4 -#define FREERDP_LOCAL __attribute__ ((visibility("hidden"))) +#define FREERDP_LOCAL __attribute__((visibility("hidden"))) #else #define FREERDP_LOCAL #endif @@ -75,13 +75,28 @@ #endif #ifdef FREERDP_TEST_EXPORTS -#define FREERDP_TEST_API FREERDP_API +#define FREERDP_TEST_API FREERDP_API #else #define FREERDP_TEST_API #endif -#define IFCALL(_cb, ...) do { if (_cb != NULL) { _cb( __VA_ARGS__ ); } } while (0) -#define IFCALLRET(_cb, _ret, ...) do { if (_cb != NULL) { _ret = _cb( __VA_ARGS__ ); } } while (0) -#define IFCALLRESULT(_default_return, _cb, ...) ((_cb != NULL) ? _cb( __VA_ARGS__ ) : (_default_return)) +#define IFCALL(_cb, ...) \ + do \ + { \ + if (_cb != NULL) \ + { \ + _cb(__VA_ARGS__); \ + } \ + } while (0) +#define IFCALLRET(_cb, _ret, ...) \ + do \ + { \ + if (_cb != NULL) \ + { \ + _ret = _cb(__VA_ARGS__); \ + } \ + } while (0) +#define IFCALLRESULT(_default_return, _cb, ...) \ + ((_cb != NULL) ? _cb(__VA_ARGS__) : (_default_return)) #endif /* FREERDP_API */ diff --git a/include/freerdp/assistance.h b/include/freerdp/assistance.h index d41fef433..e94656cb9 100644 --- a/include/freerdp/assistance.h +++ b/include/freerdp/assistance.h @@ -26,38 +26,41 @@ typedef struct rdp_assistance_file rdpAssistanceFile; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API BYTE* freerdp_assistance_hex_string_to_bin(const void* str, size_t* size); -FREERDP_API char* freerdp_assistance_bin_to_hex_string(const void* data, size_t size); + FREERDP_API BYTE* freerdp_assistance_hex_string_to_bin(const void* str, size_t* size); + FREERDP_API char* freerdp_assistance_bin_to_hex_string(const void* data, size_t size); -FREERDP_API char* freerdp_assistance_generate_pass_stub(DWORD flags); -FREERDP_API char* freerdp_assistance_construct_expert_blob(const char* name, const char* pass); -FREERDP_API BYTE* freerdp_assistance_encrypt_pass_stub(const char* password, const char* passStub, - size_t* pEncryptedSize); + FREERDP_API char* freerdp_assistance_generate_pass_stub(DWORD flags); + FREERDP_API char* freerdp_assistance_construct_expert_blob(const char* name, const char* pass); + FREERDP_API BYTE* freerdp_assistance_encrypt_pass_stub(const char* password, + const char* passStub, + size_t* pEncryptedSize); -FREERDP_API int freerdp_assistance_set_connection_string2(rdpAssistanceFile* file, - const char* string, const char* password); + FREERDP_API int freerdp_assistance_set_connection_string2(rdpAssistanceFile* file, + const char* string, + const char* password); -FREERDP_API int freerdp_assistance_parse_file_buffer(rdpAssistanceFile* file, const char* buffer, - size_t size, const char* password); -FREERDP_API int freerdp_assistance_parse_file(rdpAssistanceFile* file, const char* name, - const char* password); + FREERDP_API int freerdp_assistance_parse_file_buffer(rdpAssistanceFile* file, + const char* buffer, size_t size, + const char* password); + FREERDP_API int freerdp_assistance_parse_file(rdpAssistanceFile* file, const char* name, + const char* password); -FREERDP_API BOOL freerdp_assistance_populate_settings_from_assistance_file(rdpAssistanceFile* file, - rdpSettings* settings); -FREERDP_API BOOL freerdp_assistance_get_encrypted_pass_stub(rdpAssistanceFile* file, - const char** pwd, size_t* size); + FREERDP_API BOOL freerdp_assistance_populate_settings_from_assistance_file( + rdpAssistanceFile* file, rdpSettings* settings); + FREERDP_API BOOL freerdp_assistance_get_encrypted_pass_stub(rdpAssistanceFile* file, + const char** pwd, size_t* size); -FREERDP_API rdpAssistanceFile* freerdp_assistance_file_new(void); -FREERDP_API void freerdp_assistance_file_free(rdpAssistanceFile* file); + FREERDP_API rdpAssistanceFile* freerdp_assistance_file_new(void); + FREERDP_API void freerdp_assistance_file_free(rdpAssistanceFile* file); -FREERDP_API void freerdp_assistance_print_file(rdpAssistanceFile* file, wLog* log, DWORD level); + FREERDP_API void freerdp_assistance_print_file(rdpAssistanceFile* file, wLog* log, DWORD level); #ifdef __cplusplus } #endif #endif /* FREERDP_REMOTE_ASSISTANCE_H */ - diff --git a/include/freerdp/autodetect.h b/include/freerdp/autodetect.h index 9d95c9571..c6a41ac46 100644 --- a/include/freerdp/autodetect.h +++ b/include/freerdp/autodetect.h @@ -41,21 +41,20 @@ struct rdp_autodetect ALIGN64 UINT64 bandwidthMeasureTimeDelta; /* 3 */ ALIGN64 UINT32 bandwidthMeasureByteCount; /* 4 */ /* Network characteristics (as reported by server) */ - ALIGN64 UINT32 netCharBandwidth; /* 5 */ - ALIGN64 UINT32 netCharBaseRTT; /* 6 */ - ALIGN64 UINT32 netCharAverageRTT; /* 7 */ + ALIGN64 UINT32 netCharBandwidth; /* 5 */ + ALIGN64 UINT32 netCharBaseRTT; /* 6 */ + ALIGN64 UINT32 netCharAverageRTT; /* 7 */ ALIGN64 BOOL bandwidthMeasureStarted; /* 8 */ - UINT64 paddingA[16 - 9]; /* 9 */ + UINT64 paddingA[16 - 9]; /* 9 */ - ALIGN64 pRTTMeasureRequest RTTMeasureRequest; /* 16 */ - ALIGN64 pRTTMeasureResponse RTTMeasureResponse; /* 17 */ - ALIGN64 pBandwidthMeasureStart BandwidthMeasureStart; /* 18 */ - ALIGN64 pBandwidthMeasureStop BandwidthMeasureStop; /* 19 */ - ALIGN64 pBandwidthMeasureResults BandwidthMeasureResults; /* 20 */ + ALIGN64 pRTTMeasureRequest RTTMeasureRequest; /* 16 */ + ALIGN64 pRTTMeasureResponse RTTMeasureResponse; /* 17 */ + ALIGN64 pBandwidthMeasureStart BandwidthMeasureStart; /* 18 */ + ALIGN64 pBandwidthMeasureStop BandwidthMeasureStop; /* 19 */ + ALIGN64 pBandwidthMeasureResults BandwidthMeasureResults; /* 20 */ ALIGN64 pNetworkCharacteristicsResult NetworkCharacteristicsResult; /* 21 */ ALIGN64 pClientBandwidthMeasureResult ClientBandwidthMeasureResult; /* 22 */ - UINT64 paddingB[32 - 23]; /* 23 */ + UINT64 paddingB[32 - 23]; /* 23 */ }; - #endif /* FREERDP_AUTODETECT_H */ diff --git a/include/freerdp/cache/bitmap.h b/include/freerdp/cache/bitmap.h index ad12c31f8..58a8f5dbd 100644 --- a/include/freerdp/cache/bitmap.h +++ b/include/freerdp/cache/bitmap.h @@ -40,16 +40,16 @@ struct _BITMAP_V2_CELL struct rdp_bitmap_cache { - pMemBlt MemBlt; /* 0 */ - pMem3Blt Mem3Blt; /* 1 */ - pCacheBitmap CacheBitmap; /* 2 */ + pMemBlt MemBlt; /* 0 */ + pMem3Blt Mem3Blt; /* 1 */ + pCacheBitmap CacheBitmap; /* 2 */ pCacheBitmapV2 CacheBitmapV2; /* 3 */ pCacheBitmapV3 CacheBitmapV3; /* 4 */ - pBitmapUpdate BitmapUpdate; /* 5 */ - UINT32 paddingA[16 - 6]; /* 6 */ + pBitmapUpdate BitmapUpdate; /* 5 */ + UINT32 paddingA[16 - 6]; /* 6 */ - UINT32 maxCells; /* 16 */ - BITMAP_V2_CELL* cells; /* 17 */ + UINT32 maxCells; /* 16 */ + BITMAP_V2_CELL* cells; /* 17 */ UINT32 paddingB[32 - 18]; /* 18 */ /* internal */ @@ -59,13 +59,14 @@ struct rdp_bitmap_cache }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API void bitmap_cache_register_callbacks(rdpUpdate* update); + FREERDP_API void bitmap_cache_register_callbacks(rdpUpdate* update); -FREERDP_API rdpBitmapCache* bitmap_cache_new(rdpSettings* settings); -FREERDP_API void bitmap_cache_free(rdpBitmapCache* bitmap_cache); + FREERDP_API rdpBitmapCache* bitmap_cache_new(rdpSettings* settings); + FREERDP_API void bitmap_cache_free(rdpBitmapCache* bitmap_cache); #ifdef __cplusplus } diff --git a/include/freerdp/cache/brush.h b/include/freerdp/cache/brush.h index 4c40fdc16..2c116ecef 100644 --- a/include/freerdp/cache/brush.h +++ b/include/freerdp/cache/brush.h @@ -40,15 +40,15 @@ struct _BRUSH_ENTRY struct rdp_brush_cache { - pPatBlt PatBlt; /* 0 */ - pCacheBrush CacheBrush; /* 1 */ - pPolygonSC PolygonSC; /* 2 */ - pPolygonCB PolygonCB; /* 3 */ + pPatBlt PatBlt; /* 0 */ + pCacheBrush CacheBrush; /* 1 */ + pPolygonSC PolygonSC; /* 2 */ + pPolygonCB PolygonCB; /* 3 */ UINT32 paddingA[16 - 4]; /* 4 */ - UINT32 maxEntries; /* 16 */ - UINT32 maxMonoEntries; /* 17 */ - BRUSH_ENTRY* entries; /* 18 */ + UINT32 maxEntries; /* 16 */ + UINT32 maxMonoEntries; /* 17 */ + BRUSH_ENTRY* entries; /* 18 */ BRUSH_ENTRY* monoEntries; /* 19 */ UINT32 paddingB[32 - 20]; /* 20 */ @@ -58,18 +58,17 @@ struct rdp_brush_cache }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API void* brush_cache_get(rdpBrushCache* brush, UINT32 index, - UINT32* bpp); -FREERDP_API void brush_cache_put(rdpBrushCache* brush, UINT32 index, - void* entry, UINT32 bpp); + FREERDP_API void* brush_cache_get(rdpBrushCache* brush, UINT32 index, UINT32* bpp); + FREERDP_API void brush_cache_put(rdpBrushCache* brush, UINT32 index, void* entry, UINT32 bpp); -FREERDP_API void brush_cache_register_callbacks(rdpUpdate* update); + FREERDP_API void brush_cache_register_callbacks(rdpUpdate* update); -FREERDP_API rdpBrushCache* brush_cache_new(rdpSettings* settings); -FREERDP_API void brush_cache_free(rdpBrushCache* brush); + FREERDP_API rdpBrushCache* brush_cache_new(rdpSettings* settings); + FREERDP_API void brush_cache_free(rdpBrushCache* brush); #ifdef __cplusplus } diff --git a/include/freerdp/cache/cache.h b/include/freerdp/cache/cache.h index 30721f566..152137339 100644 --- a/include/freerdp/cache/cache.h +++ b/include/freerdp/cache/cache.h @@ -36,21 +36,22 @@ struct rdp_cache { - rdpGlyphCache* glyph; /* 0 */ - rdpBrushCache* brush; /* 1 */ - rdpPointerCache* pointer; /* 2 */ - rdpBitmapCache* bitmap; /* 3 */ + rdpGlyphCache* glyph; /* 0 */ + rdpBrushCache* brush; /* 1 */ + rdpPointerCache* pointer; /* 2 */ + rdpBitmapCache* bitmap; /* 3 */ rdpOffscreenCache* offscreen; /* 4 */ - rdpPaletteCache* palette; /* 5 */ - rdpNineGridCache* nine_grid; /* 6 */ + rdpPaletteCache* palette; /* 5 */ + rdpNineGridCache* nine_grid; /* 6 */ }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API rdpCache* cache_new(rdpSettings* settings); -FREERDP_API void cache_free(rdpCache* cache); + FREERDP_API rdpCache* cache_new(rdpSettings* settings); + FREERDP_API void cache_free(rdpCache* cache); #ifdef __cplusplus } diff --git a/include/freerdp/cache/glyph.h b/include/freerdp/cache/glyph.h index 4af0118b6..3c5c16583 100644 --- a/include/freerdp/cache/glyph.h +++ b/include/freerdp/cache/glyph.h @@ -63,13 +63,14 @@ struct rdp_glyph_cache }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API void glyph_cache_register_callbacks(rdpUpdate* update); + FREERDP_API void glyph_cache_register_callbacks(rdpUpdate* update); -FREERDP_API rdpGlyphCache* glyph_cache_new(rdpSettings* settings); -FREERDP_API void glyph_cache_free(rdpGlyphCache* glyph); + FREERDP_API rdpGlyphCache* glyph_cache_new(rdpSettings* settings); + FREERDP_API void glyph_cache_free(rdpGlyphCache* glyph); #ifdef __cplusplus } diff --git a/include/freerdp/cache/nine_grid.h b/include/freerdp/cache/nine_grid.h index 2b85f978e..3b8e2b127 100644 --- a/include/freerdp/cache/nine_grid.h +++ b/include/freerdp/cache/nine_grid.h @@ -39,12 +39,12 @@ struct _NINE_GRID_ENTRY struct rdp_nine_grid_cache { - pDrawNineGrid DrawNineGrid; /* 0 */ + pDrawNineGrid DrawNineGrid; /* 0 */ pMultiDrawNineGrid MultiDrawNineGrid; /* 1 */ - UINT32 paddingA[16 - 2]; /* 2 */ + UINT32 paddingA[16 - 2]; /* 2 */ - UINT32 maxEntries; /* 16 */ - UINT32 maxSize; /* 17 */ + UINT32 maxEntries; /* 16 */ + UINT32 maxSize; /* 17 */ NINE_GRID_ENTRY* entries; /* 18 */ UINT32 paddingB[32 - 19]; /* 19 */ @@ -54,13 +54,14 @@ struct rdp_nine_grid_cache }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API void nine_grid_cache_register_callbacks(rdpUpdate* update); + FREERDP_API void nine_grid_cache_register_callbacks(rdpUpdate* update); -FREERDP_API rdpNineGridCache* nine_grid_cache_new(rdpSettings* settings); -FREERDP_API void nine_grid_cache_free(rdpNineGridCache* nine_grid); + FREERDP_API rdpNineGridCache* nine_grid_cache_new(rdpSettings* settings); + FREERDP_API void nine_grid_cache_free(rdpNineGridCache* nine_grid); #ifdef __cplusplus } diff --git a/include/freerdp/cache/offscreen.h b/include/freerdp/cache/offscreen.h index 97a3ea442..1af0dd725 100644 --- a/include/freerdp/cache/offscreen.h +++ b/include/freerdp/cache/offscreen.h @@ -33,9 +33,9 @@ typedef struct rdp_offscreen_cache rdpOffscreenCache; struct rdp_offscreen_cache { - UINT32 maxSize; /* 0 */ - UINT32 maxEntries; /* 1 */ - rdpBitmap** entries; /* 2 */ + UINT32 maxSize; /* 0 */ + UINT32 maxEntries; /* 1 */ + rdpBitmap** entries; /* 2 */ UINT32 currentSurface; /* 3 */ /* internal */ @@ -45,16 +45,16 @@ struct rdp_offscreen_cache }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreen_cache, - UINT32 index); + FREERDP_API rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreen_cache, UINT32 index); -FREERDP_API void offscreen_cache_register_callbacks(rdpUpdate* update); + FREERDP_API void offscreen_cache_register_callbacks(rdpUpdate* update); -FREERDP_API rdpOffscreenCache* offscreen_cache_new(rdpSettings* settings); -FREERDP_API void offscreen_cache_free(rdpOffscreenCache* offscreen); + FREERDP_API rdpOffscreenCache* offscreen_cache_new(rdpSettings* settings); + FREERDP_API void offscreen_cache_free(rdpOffscreenCache* offscreen); #ifdef __cplusplus } diff --git a/include/freerdp/cache/palette.h b/include/freerdp/cache/palette.h index 31aa93e28..cbfe3b51b 100644 --- a/include/freerdp/cache/palette.h +++ b/include/freerdp/cache/palette.h @@ -39,7 +39,7 @@ struct _PALETTE_TABLE_ENTRY struct rdp_palette_cache { - UINT32 maxEntries; /* 0 */ + UINT32 maxEntries; /* 0 */ PALETTE_TABLE_ENTRY* entries; /* 1 */ /* internal */ @@ -48,13 +48,14 @@ struct rdp_palette_cache }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API void palette_cache_register_callbacks(rdpUpdate* update); + FREERDP_API void palette_cache_register_callbacks(rdpUpdate* update); -FREERDP_API rdpPaletteCache* palette_cache_new(rdpSettings* settings); -FREERDP_API void palette_cache_free(rdpPaletteCache* palette_cache); + FREERDP_API rdpPaletteCache* palette_cache_new(rdpSettings* settings); + FREERDP_API void palette_cache_free(rdpPaletteCache* palette_cache); #ifdef __cplusplus } diff --git a/include/freerdp/cache/pointer.h b/include/freerdp/cache/pointer.h index 6a9a72edd..e2692f400 100644 --- a/include/freerdp/cache/pointer.h +++ b/include/freerdp/cache/pointer.h @@ -34,7 +34,7 @@ typedef struct rdp_pointer_cache rdpPointerCache; struct rdp_pointer_cache { - UINT32 cacheSize; /* 0 */ + UINT32 cacheSize; /* 0 */ rdpPointer** entries; /* 1 */ /* internal */ @@ -44,13 +44,14 @@ struct rdp_pointer_cache }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API void pointer_cache_register_callbacks(rdpUpdate* update); + FREERDP_API void pointer_cache_register_callbacks(rdpUpdate* update); -FREERDP_API rdpPointerCache* pointer_cache_new(rdpSettings* settings); -FREERDP_API void pointer_cache_free(rdpPointerCache* pointer_cache); + FREERDP_API rdpPointerCache* pointer_cache_new(rdpSettings* settings); + FREERDP_API void pointer_cache_free(rdpPointerCache* pointer_cache); #ifdef __cplusplus } diff --git a/include/freerdp/channels/audin.h b/include/freerdp/channels/audin.h index 690b89323..e7a6a093c 100644 --- a/include/freerdp/channels/audin.h +++ b/include/freerdp/channels/audin.h @@ -24,7 +24,4 @@ #include #include - - #endif /* FREERDP_CHANNEL_AUDIN_H */ - diff --git a/include/freerdp/channels/channels.h b/include/freerdp/channels/channels.h index e0b21a7eb..e0059d00d 100644 --- a/include/freerdp/channels/channels.h +++ b/include/freerdp/channels/channels.h @@ -29,32 +29,31 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API int freerdp_channels_client_load(rdpChannels* channels, - rdpSettings* settings, PVIRTUALCHANNELENTRY entry, void* data); -FREERDP_API int freerdp_channels_client_load_ex(rdpChannels* channels, - rdpSettings* settings, PVIRTUALCHANNELENTRYEX entryEx, void* data); -FREERDP_API int freerdp_channels_load_plugin(rdpChannels* channels, - rdpSettings* settings, - const char* name, void* data); -FREERDP_API BOOL freerdp_channels_get_fds(rdpChannels* channels, - freerdp* instance, void** read_fds, - int* read_count, void** write_fds, int* write_count); -FREERDP_API BOOL freerdp_channels_check_fds(rdpChannels* channels, - freerdp* instance); + FREERDP_API int freerdp_channels_client_load(rdpChannels* channels, rdpSettings* settings, + PVIRTUALCHANNELENTRY entry, void* data); + FREERDP_API int freerdp_channels_client_load_ex(rdpChannels* channels, rdpSettings* settings, + PVIRTUALCHANNELENTRYEX entryEx, void* data); + FREERDP_API int freerdp_channels_load_plugin(rdpChannels* channels, rdpSettings* settings, + const char* name, void* data); + FREERDP_API BOOL freerdp_channels_get_fds(rdpChannels* channels, freerdp* instance, + void** read_fds, int* read_count, void** write_fds, + int* write_count); + FREERDP_API BOOL freerdp_channels_check_fds(rdpChannels* channels, freerdp* instance); -FREERDP_API void* freerdp_channels_get_static_channel_interface( - rdpChannels* channels, const char* name); + FREERDP_API void* freerdp_channels_get_static_channel_interface(rdpChannels* channels, + const char* name); -FREERDP_API HANDLE freerdp_channels_get_event_handle(freerdp* instance); -FREERDP_API int freerdp_channels_process_pending_messages(freerdp* instance); + FREERDP_API HANDLE freerdp_channels_get_event_handle(freerdp* instance); + FREERDP_API int freerdp_channels_process_pending_messages(freerdp* instance); -FREERDP_API int freerdp_channels_data(freerdp* instance, - UINT16 channelId, BYTE* data, int dataSize, int flags, int totalSize); + FREERDP_API int freerdp_channels_data(freerdp* instance, UINT16 channelId, BYTE* data, + int dataSize, int flags, int totalSize); -FREERDP_API PWtsApiFunctionTable FreeRDP_InitWtsApi(void); + FREERDP_API PWtsApiFunctionTable FreeRDP_InitWtsApi(void); #ifdef __cplusplus } diff --git a/include/freerdp/channels/cliprdr.h b/include/freerdp/channels/cliprdr.h index de1ff7f60..24f91cde1 100644 --- a/include/freerdp/channels/cliprdr.h +++ b/include/freerdp/channels/cliprdr.h @@ -25,55 +25,55 @@ #include -#define CLIPRDR_SVC_CHANNEL_NAME "cliprdr" +#define CLIPRDR_SVC_CHANNEL_NAME "cliprdr" /** * Clipboard Formats */ -#define CB_FORMAT_HTML 0xD010 -#define CB_FORMAT_PNG 0xD011 -#define CB_FORMAT_JPEG 0xD012 -#define CB_FORMAT_GIF 0xD013 -#define CB_FORMAT_TEXTURILIST 0xD014 +#define CB_FORMAT_HTML 0xD010 +#define CB_FORMAT_PNG 0xD011 +#define CB_FORMAT_JPEG 0xD012 +#define CB_FORMAT_GIF 0xD013 +#define CB_FORMAT_TEXTURILIST 0xD014 /* CLIPRDR_HEADER.msgType */ -#define CB_MONITOR_READY 0x0001 -#define CB_FORMAT_LIST 0x0002 -#define CB_FORMAT_LIST_RESPONSE 0x0003 -#define CB_FORMAT_DATA_REQUEST 0x0004 -#define CB_FORMAT_DATA_RESPONSE 0x0005 -#define CB_TEMP_DIRECTORY 0x0006 -#define CB_CLIP_CAPS 0x0007 -#define CB_FILECONTENTS_REQUEST 0x0008 -#define CB_FILECONTENTS_RESPONSE 0x0009 -#define CB_LOCK_CLIPDATA 0x000A -#define CB_UNLOCK_CLIPDATA 0x000B +#define CB_MONITOR_READY 0x0001 +#define CB_FORMAT_LIST 0x0002 +#define CB_FORMAT_LIST_RESPONSE 0x0003 +#define CB_FORMAT_DATA_REQUEST 0x0004 +#define CB_FORMAT_DATA_RESPONSE 0x0005 +#define CB_TEMP_DIRECTORY 0x0006 +#define CB_CLIP_CAPS 0x0007 +#define CB_FILECONTENTS_REQUEST 0x0008 +#define CB_FILECONTENTS_RESPONSE 0x0009 +#define CB_LOCK_CLIPDATA 0x000A +#define CB_UNLOCK_CLIPDATA 0x000B /* CLIPRDR_HEADER.msgFlags */ -#define CB_RESPONSE_OK 0x0001 -#define CB_RESPONSE_FAIL 0x0002 -#define CB_ASCII_NAMES 0x0004 +#define CB_RESPONSE_OK 0x0001 +#define CB_RESPONSE_FAIL 0x0002 +#define CB_ASCII_NAMES 0x0004 /* CLIPRDR_CAPS_SET.capabilitySetType */ -#define CB_CAPSTYPE_GENERAL 0x0001 +#define CB_CAPSTYPE_GENERAL 0x0001 /* CLIPRDR_GENERAL_CAPABILITY.lengthCapability */ -#define CB_CAPSTYPE_GENERAL_LEN 12 +#define CB_CAPSTYPE_GENERAL_LEN 12 /* CLIPRDR_GENERAL_CAPABILITY.version */ -#define CB_CAPS_VERSION_1 0x00000001 -#define CB_CAPS_VERSION_2 0x00000002 +#define CB_CAPS_VERSION_1 0x00000001 +#define CB_CAPS_VERSION_2 0x00000002 /* CLIPRDR_GENERAL_CAPABILITY.generalFlags */ -#define CB_USE_LONG_FORMAT_NAMES 0x00000002 -#define CB_STREAM_FILECLIP_ENABLED 0x00000004 -#define CB_FILECLIP_NO_FILE_PATHS 0x00000008 -#define CB_CAN_LOCK_CLIPDATA 0x00000010 +#define CB_USE_LONG_FORMAT_NAMES 0x00000002 +#define CB_STREAM_FILECLIP_ENABLED 0x00000004 +#define CB_FILECLIP_NO_FILE_PATHS 0x00000008 +#define CB_CAN_LOCK_CLIPDATA 0x00000010 /* File Contents Request Flags */ -#define FILECONTENTS_SIZE 0x00000001 -#define FILECONTENTS_RANGE 0x00000002 +#define FILECONTENTS_SIZE 0x00000001 +#define FILECONTENTS_RANGE 0x00000002 /* Special Clipboard Response Formats */ @@ -88,13 +88,16 @@ struct _CLIPRDR_MFPICT typedef struct _CLIPRDR_MFPICT CLIPRDR_MFPICT; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API UINT cliprdr_parse_file_list(const BYTE* format_data, UINT32 format_data_length, - FILEDESCRIPTOR** file_descriptor_array, UINT32* file_descriptor_count); -FREERDP_API UINT cliprdr_serialize_file_list(const FILEDESCRIPTOR* file_descriptor_array, - UINT32 file_descriptor_count, BYTE** format_data, UINT32* format_data_length); + FREERDP_API UINT cliprdr_parse_file_list(const BYTE* format_data, UINT32 format_data_length, + FILEDESCRIPTOR** file_descriptor_array, + UINT32* file_descriptor_count); + FREERDP_API UINT cliprdr_serialize_file_list(const FILEDESCRIPTOR* file_descriptor_array, + UINT32 file_descriptor_count, BYTE** format_data, + UINT32* format_data_length); #ifdef __cplusplus } @@ -103,8 +106,8 @@ FREERDP_API UINT cliprdr_serialize_file_list(const FILEDESCRIPTOR* file_descript /* Clipboard Messages */ #define DEFINE_CLIPRDR_HEADER_COMMON() \ - UINT16 msgType; \ - UINT16 msgFlags; \ + UINT16 msgType; \ + UINT16 msgFlags; \ UINT32 dataLen struct _CLIPRDR_HEADER @@ -233,4 +236,3 @@ struct _CLIPRDR_FILE_CONTENTS_RESPONSE typedef struct _CLIPRDR_FILE_CONTENTS_RESPONSE CLIPRDR_FILE_CONTENTS_RESPONSE; #endif /* FREERDP_CHANNEL_CLIPRDR_H */ - diff --git a/include/freerdp/channels/disp.h b/include/freerdp/channels/disp.h index 7e6eefe9a..427e64e1b 100644 --- a/include/freerdp/channels/disp.h +++ b/include/freerdp/channels/disp.h @@ -23,27 +23,27 @@ #include #include -#define DISPLAY_CONTROL_PDU_TYPE_CAPS 0x00000005 -#define DISPLAY_CONTROL_PDU_TYPE_MONITOR_LAYOUT 0x00000002 -#define DISPLAY_CONTROL_MONITOR_LAYOUT_SIZE 40 +#define DISPLAY_CONTROL_PDU_TYPE_CAPS 0x00000005 +#define DISPLAY_CONTROL_PDU_TYPE_MONITOR_LAYOUT 0x00000002 +#define DISPLAY_CONTROL_MONITOR_LAYOUT_SIZE 40 -#define DISP_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::DisplayControl" -#define ORIENTATION_LANDSCAPE 0 -#define ORIENTATION_PORTRAIT 90 -#define ORIENTATION_LANDSCAPE_FLIPPED 180 -#define ORIENTATION_PORTRAIT_FLIPPED 270 +#define DISP_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::DisplayControl" +#define ORIENTATION_LANDSCAPE 0 +#define ORIENTATION_PORTRAIT 90 +#define ORIENTATION_LANDSCAPE_FLIPPED 180 +#define ORIENTATION_PORTRAIT_FLIPPED 270 -#define DISPLAY_CONTROL_MONITOR_PRIMARY 0x00000001 -#define DISPLAY_CONTROL_HEADER_LENGTH 0x00000008 +#define DISPLAY_CONTROL_MONITOR_PRIMARY 0x00000001 +#define DISPLAY_CONTROL_HEADER_LENGTH 0x00000008 -#define DISPLAY_CONTROL_MIN_MONITOR_WIDTH 200 -#define DISPLAY_CONTROL_MAX_MONITOR_WIDTH 8192 +#define DISPLAY_CONTROL_MIN_MONITOR_WIDTH 200 +#define DISPLAY_CONTROL_MAX_MONITOR_WIDTH 8192 -#define DISPLAY_CONTROL_MIN_MONITOR_HEIGHT 200 -#define DISPLAY_CONTROL_MAX_MONITOR_HEIGHT 8192 +#define DISPLAY_CONTROL_MIN_MONITOR_HEIGHT 200 +#define DISPLAY_CONTROL_MAX_MONITOR_HEIGHT 8192 -#define DISPLAY_CONTROL_MIN_PHYSICAL_MONITOR_WIDTH 10 -#define DISPLAY_CONTROL_MAX_PHYSICAL_MONITOR_WIDTH 10000 +#define DISPLAY_CONTROL_MIN_PHYSICAL_MONITOR_WIDTH 10 +#define DISPLAY_CONTROL_MAX_PHYSICAL_MONITOR_WIDTH 10000 #define DISPLAY_CONTROL_MIN_PHYSICAL_MONITOR_HEIGHT 10 #define DISPLAY_CONTROL_MAX_PHYSICAL_MONITOR_HEIGHT 10000 diff --git a/include/freerdp/channels/encomsp.h b/include/freerdp/channels/encomsp.h index b2fffc5b4..e3a29974b 100644 --- a/include/freerdp/channels/encomsp.h +++ b/include/freerdp/channels/encomsp.h @@ -23,7 +23,7 @@ #include #include -#define ENCOMSP_SVC_CHANNEL_NAME "encomsp" +#define ENCOMSP_SVC_CHANNEL_NAME "encomsp" struct _ENCOMSP_UNICODE_STRING { @@ -34,52 +34,52 @@ typedef struct _ENCOMSP_UNICODE_STRING ENCOMSP_UNICODE_STRING; /* Filter Updated PDU Flags */ -#define ENCOMSP_FILTER_ENABLED 0x0001 +#define ENCOMSP_FILTER_ENABLED 0x0001 /* Application Created PDU Flags */ -#define ENCOMSP_APPLICATION_SHARED 0x0001 +#define ENCOMSP_APPLICATION_SHARED 0x0001 /* Window Created PDU Flags */ -#define ENCOMSP_WINDOW_SHARED 0x0001 +#define ENCOMSP_WINDOW_SHARED 0x0001 /* Participant Created PDU Flags */ -#define ENCOMSP_MAY_VIEW 0x0001 -#define ENCOMSP_MAY_INTERACT 0x0002 -#define ENCOMSP_IS_PARTICIPANT 0x0004 +#define ENCOMSP_MAY_VIEW 0x0001 +#define ENCOMSP_MAY_INTERACT 0x0002 +#define ENCOMSP_IS_PARTICIPANT 0x0004 /* Participant Removed PDU Disconnection Types */ -#define ENCOMSP_PARTICIPANT_DISCONNECTION_REASON_APP 0x00000000 -#define ENCOMSP_PARTICIPANT_DISCONNECTION_REASON_CLI 0x00000002 +#define ENCOMSP_PARTICIPANT_DISCONNECTION_REASON_APP 0x00000000 +#define ENCOMSP_PARTICIPANT_DISCONNECTION_REASON_CLI 0x00000002 /* Change Participant Control Level PDU Flags */ -#define ENCOMSP_REQUEST_VIEW 0x0001 -#define ENCOMSP_REQUEST_INTERACT 0x0002 -#define ENCOMSP_ALLOW_CONTROL_REQUESTS 0x0008 +#define ENCOMSP_REQUEST_VIEW 0x0001 +#define ENCOMSP_REQUEST_INTERACT 0x0002 +#define ENCOMSP_ALLOW_CONTROL_REQUESTS 0x0008 /* PDU Order Types */ -#define ODTYPE_FILTER_STATE_UPDATED 0x0001 -#define ODTYPE_APP_REMOVED 0x0002 -#define ODTYPE_APP_CREATED 0x0003 -#define ODTYPE_WND_REMOVED 0x0004 -#define ODTYPE_WND_CREATED 0x0005 -#define ODTYPE_WND_SHOW 0x0006 -#define ODTYPE_PARTICIPANT_REMOVED 0x0007 -#define ODTYPE_PARTICIPANT_CREATED 0x0008 -#define ODTYPE_PARTICIPANT_CTRL_CHANGED 0x0009 -#define ODTYPE_GRAPHICS_STREAM_PAUSED 0x000A -#define ODTYPE_GRAPHICS_STREAM_RESUMED 0x000B +#define ODTYPE_FILTER_STATE_UPDATED 0x0001 +#define ODTYPE_APP_REMOVED 0x0002 +#define ODTYPE_APP_CREATED 0x0003 +#define ODTYPE_WND_REMOVED 0x0004 +#define ODTYPE_WND_CREATED 0x0005 +#define ODTYPE_WND_SHOW 0x0006 +#define ODTYPE_PARTICIPANT_REMOVED 0x0007 +#define ODTYPE_PARTICIPANT_CREATED 0x0008 +#define ODTYPE_PARTICIPANT_CTRL_CHANGED 0x0009 +#define ODTYPE_GRAPHICS_STREAM_PAUSED 0x000A +#define ODTYPE_GRAPHICS_STREAM_RESUMED 0x000B #define DEFINE_ENCOMSP_HEADER_COMMON() \ - UINT16 Type; \ + UINT16 Type; \ UINT16 Length -#define ENCOMSP_ORDER_HEADER_SIZE 4 +#define ENCOMSP_ORDER_HEADER_SIZE 4 struct _ENCOMSP_ORDER_HEADER { @@ -168,7 +168,8 @@ struct _ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU UINT16 Flags; UINT32 ParticipantId; }; -typedef struct _ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU; +typedef struct _ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU + ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU; struct _ENCOMSP_GRAPHICS_STREAM_PAUSED_PDU { @@ -183,4 +184,3 @@ struct _ENCOMSP_GRAPHICS_STREAM_RESUMED_PDU typedef struct _ENCOMSP_GRAPHICS_STREAM_RESUMED_PDU ENCOMSP_GRAPHICS_STREAM_RESUMED_PDU; #endif /* FREERDP_CHANNEL_ENCOMSP_H */ - diff --git a/include/freerdp/channels/geometry.h b/include/freerdp/channels/geometry.h index af098b029..31b842a22 100644 --- a/include/freerdp/channels/geometry.h +++ b/include/freerdp/channels/geometry.h @@ -27,8 +27,8 @@ enum { - GEOMETRY_UPDATE = 1, - GEOMETRY_CLEAR = 2 + GEOMETRY_UPDATE = 1, + GEOMETRY_CLEAR = 2 }; enum @@ -40,12 +40,11 @@ struct _FREERDP_RGNDATA { RDP_RECT boundingRect; UINT32 nRectCount; - RDP_RECT *rects; + RDP_RECT* rects; }; typedef struct _FREERDP_RGNDATA FREERDP_RGNDATA; - struct _MAPPED_GEOMETRY_PACKET { UINT32 version; diff --git a/include/freerdp/channels/rail.h b/include/freerdp/channels/rail.h index 3b1c65dcc..b8d6b4670 100644 --- a/include/freerdp/channels/rail.h +++ b/include/freerdp/channels/rail.h @@ -23,7 +23,4 @@ #include #include - - #endif /* FREERDP_CHANNEL_RAIL_H */ - diff --git a/include/freerdp/channels/rdpdr.h b/include/freerdp/channels/rdpdr.h index b40ae2a5d..b61a4c7e1 100644 --- a/include/freerdp/channels/rdpdr.h +++ b/include/freerdp/channels/rdpdr.h @@ -35,11 +35,11 @@ #include -#define RDPDR_DEVICE_IO_REQUEST_LENGTH 24 -#define RDPDR_DEVICE_IO_RESPONSE_LENGTH 16 +#define RDPDR_DEVICE_IO_REQUEST_LENGTH 24 +#define RDPDR_DEVICE_IO_RESPONSE_LENGTH 16 -#define RDPDR_DEVICE_IO_CONTROL_REQ_HDR_LENGTH 32 -#define RDPDR_DEVICE_IO_CONTROL_RSP_HDR_LENGTH 4 +#define RDPDR_DEVICE_IO_CONTROL_REQ_HDR_LENGTH 32 +#define RDPDR_DEVICE_IO_CONTROL_RSP_HDR_LENGTH 4 /* RDPDR_HEADER.Component */ enum RDPDR_CTYP @@ -120,8 +120,8 @@ enum IRP_MN /* DR_CREATE_RSP.Information */ /* DR_DRIVE_CREATE_RSP.DeviceCreateResponse */ -#define FILE_OPENED 0x00000001 -#define FILE_OVERWRITTEN 0x00000003 +#define FILE_OPENED 0x00000001 +#define FILE_OVERWRITTEN 0x00000003 /* DR_CORE_CLIENT_ANNOUNCE_RSP.VersionMinor */ enum RDPDR_MINOR_RDP_VERSION @@ -196,93 +196,93 @@ enum RDPDR_PRINTER_ANNOUNCE_FLAG #ifndef _WIN32 -#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 -#define FILE_ATTRIBUTE_COMPRESSED 0x00000800 -#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 -#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000 -#define FILE_ATTRIBUTE_HIDDEN 0x00000002 -#define FILE_ATTRIBUTE_NORMAL 0x00000080 -#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000 -#define FILE_ATTRIBUTE_OFFLINE 0x00001000 -#define FILE_ATTRIBUTE_READONLY 0x00000001 -#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 -#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200 -#define FILE_ATTRIBUTE_SYSTEM 0x00000004 -#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 +#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 +#define FILE_ATTRIBUTE_COMPRESSED 0x00000800 +#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 +#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000 +#define FILE_ATTRIBUTE_HIDDEN 0x00000002 +#define FILE_ATTRIBUTE_NORMAL 0x00000080 +#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000 +#define FILE_ATTRIBUTE_OFFLINE 0x00001000 +#define FILE_ATTRIBUTE_READONLY 0x00000001 +#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 +#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200 +#define FILE_ATTRIBUTE_SYSTEM 0x00000004 +#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 #endif /* [MS-FSCC] FSCTL Structures */ #if !defined(_WIN32) || (defined(_WIN32) && (_WIN32_WINNT < 0x0600)) -#define FSCTL_LMR_SET_LINK_TRACKING_INFORMATION 0x1400ec -#define FSCTL_PIPE_PEEK 0x11400c -#define FSCTL_PIPE_TRANSCEIVE 0x11c017 -#define FSCTL_PIPE_WAIT 0x110018 -#define FSCTL_QUERY_ON_DISK_VOLUME_INFO 0x9013c -#define FSCTL_QUERY_SPARING_INFO 0x90138 +#define FSCTL_LMR_SET_LINK_TRACKING_INFORMATION 0x1400ec +#define FSCTL_PIPE_PEEK 0x11400c +#define FSCTL_PIPE_TRANSCEIVE 0x11c017 +#define FSCTL_PIPE_WAIT 0x110018 +#define FSCTL_QUERY_ON_DISK_VOLUME_INFO 0x9013c +#define FSCTL_QUERY_SPARING_INFO 0x90138 #endif #ifndef _WIN32 -#define FSCTL_CREATE_OR_GET_OBJECT_ID 0x900c0 -#define FSCTL_GET_REPARSE_POINT 0x900a8 -#define FSCTL_GET_RETRIEVAL_POINTERS 0x90073 -#define FSCTL_IS_PATHNAME_VALID 0x9002c -#define FSCTL_READ_FILE_USN_DATA 0x900eb -#define FSCTL_RECALL_FILE 0x90117 -#define FSCTL_QUERY_FAT_BPB 0x90058 -#define FSCTL_QUERY_ALLOCATED_RANGES 0x940cf -#define FSCTL_SET_COMPRESSION 0x9c040 -#define FSCTL_SET_ENCRYPTION 0x900D7 -#define FSCTL_SET_OBJECT_ID 0x90098 -#define FSCTL_SET_OBJECT_ID_EXTENDED 0x900bc -#define FSCTL_SET_REPARSE_POINT 0x900a4 -#define FSCTL_SET_SPARSE 0x900c4 -#define FSCTL_SET_ZERO_DATA 0x980c8 -#define FSCTL_SIS_COPYFILE 0x90100 -#define FSCTL_WRITE_USN_CLOSE_RECORD 0x900ef +#define FSCTL_CREATE_OR_GET_OBJECT_ID 0x900c0 +#define FSCTL_GET_REPARSE_POINT 0x900a8 +#define FSCTL_GET_RETRIEVAL_POINTERS 0x90073 +#define FSCTL_IS_PATHNAME_VALID 0x9002c +#define FSCTL_READ_FILE_USN_DATA 0x900eb +#define FSCTL_RECALL_FILE 0x90117 +#define FSCTL_QUERY_FAT_BPB 0x90058 +#define FSCTL_QUERY_ALLOCATED_RANGES 0x940cf +#define FSCTL_SET_COMPRESSION 0x9c040 +#define FSCTL_SET_ENCRYPTION 0x900D7 +#define FSCTL_SET_OBJECT_ID 0x90098 +#define FSCTL_SET_OBJECT_ID_EXTENDED 0x900bc +#define FSCTL_SET_REPARSE_POINT 0x900a4 +#define FSCTL_SET_SPARSE 0x900c4 +#define FSCTL_SET_ZERO_DATA 0x980c8 +#define FSCTL_SIS_COPYFILE 0x90100 +#define FSCTL_WRITE_USN_CLOSE_RECORD 0x900ef #endif #if !defined(_WIN32) || (defined(_WIN32) && (_WIN32_WINNT < 0x0600)) -#define FSCTL_SET_DEFECT_MANAGEMENT 0x98134 -#define FSCTL_SET_ZERO_ON_DEALLOCATION 0x90194 +#define FSCTL_SET_DEFECT_MANAGEMENT 0x98134 +#define FSCTL_SET_ZERO_ON_DEALLOCATION 0x90194 #endif /* [MS-FSCC] FileFsAttributeInformation.FileSystemAttributes */ #ifndef _WIN32 -#define FILE_SUPPORTS_USN_JOURNAL 0x02000000 -#define FILE_SUPPORTS_OPEN_BY_FILE_ID 0x01000000 -#define FILE_SUPPORTS_EXTENDED_ATTRIBUTES 0x00800000 -#define FILE_SUPPORTS_HARD_LINKS 0x00400000 -#define FILE_SUPPORTS_TRANSACTIONS 0x00200000 -#define FILE_SEQUENTIAL_WRITE_ONCE 0x00100000 -#define FILE_READ_ONLY_VOLUME 0x00080000 -#define FILE_NAMED_STREAMS 0x00040000 -#define FILE_SUPPORTS_ENCRYPTION 0x00020000 -#define FILE_SUPPORTS_OBJECT_IDS 0x00010000 -#define FILE_VOLUME_IS_COMPRESSED 0x00008000 -#define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100 -#define FILE_SUPPORTS_REPARSE_POINTS 0x00000080 -#define FILE_SUPPORTS_SPARSE_FILES 0x00000040 -#define FILE_VOLUME_QUOTAS 0x00000020 -#define FILE_FILE_COMPRESSION 0x00000010 -#define FILE_PERSISTENT_ACLS 0x00000008 -#define FILE_UNICODE_ON_DISK 0x00000004 -#define FILE_CASE_PRESERVED_NAMES 0x00000002 -#define FILE_CASE_SENSITIVE_SEARCH 0x00000001 +#define FILE_SUPPORTS_USN_JOURNAL 0x02000000 +#define FILE_SUPPORTS_OPEN_BY_FILE_ID 0x01000000 +#define FILE_SUPPORTS_EXTENDED_ATTRIBUTES 0x00800000 +#define FILE_SUPPORTS_HARD_LINKS 0x00400000 +#define FILE_SUPPORTS_TRANSACTIONS 0x00200000 +#define FILE_SEQUENTIAL_WRITE_ONCE 0x00100000 +#define FILE_READ_ONLY_VOLUME 0x00080000 +#define FILE_NAMED_STREAMS 0x00040000 +#define FILE_SUPPORTS_ENCRYPTION 0x00020000 +#define FILE_SUPPORTS_OBJECT_IDS 0x00010000 +#define FILE_VOLUME_IS_COMPRESSED 0x00008000 +#define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100 +#define FILE_SUPPORTS_REPARSE_POINTS 0x00000080 +#define FILE_SUPPORTS_SPARSE_FILES 0x00000040 +#define FILE_VOLUME_QUOTAS 0x00000020 +#define FILE_FILE_COMPRESSION 0x00000010 +#define FILE_PERSISTENT_ACLS 0x00000008 +#define FILE_UNICODE_ON_DISK 0x00000004 +#define FILE_CASE_PRESERVED_NAMES 0x00000002 +#define FILE_CASE_SENSITIVE_SEARCH 0x00000001 #endif /* [MS-FSCC] FileFsDeviceInformation.DeviceType */ #ifndef FILE_DEVICE_CD_ROM -#define FILE_DEVICE_CD_ROM 0x00000002 +#define FILE_DEVICE_CD_ROM 0x00000002 #endif #ifndef FILE_DEVICE_DISK -#define FILE_DEVICE_DISK 0x00000007 +#define FILE_DEVICE_DISK 0x00000007 #endif /* [MS-FSCC] FileFsDeviceInformation.Characteristics */ @@ -316,11 +316,11 @@ typedef struct _DEVICE DEVICE; typedef struct _IRP IRP; typedef struct _DEVMAN DEVMAN; -typedef UINT(*pcCustomComponentRequest)(DEVICE* device, UINT16 component, UINT16 packetId, - wStream* s); -typedef UINT(*pcIRPRequest)(DEVICE* device, IRP* irp); -typedef UINT(*pcInitDevice)(DEVICE* device); -typedef UINT(*pcFreeDevice)(DEVICE* device); +typedef UINT (*pcCustomComponentRequest)(DEVICE* device, UINT16 component, UINT16 packetId, + wStream* s); +typedef UINT (*pcIRPRequest)(DEVICE* device, IRP* irp); +typedef UINT (*pcInitDevice)(DEVICE* device); +typedef UINT (*pcFreeDevice)(DEVICE* device); struct _DEVICE { @@ -336,7 +336,7 @@ struct _DEVICE pcFreeDevice Free; }; -typedef UINT(*pcIRPResponse)(IRP* irp); +typedef UINT (*pcIRPResponse)(IRP* irp); struct _IRP { @@ -367,7 +367,7 @@ struct _DEVMAN wListDictionary* devices; }; -typedef UINT(*pcRegisterDevice)(DEVMAN* devman, DEVICE* device); +typedef UINT (*pcRegisterDevice)(DEVMAN* devman, DEVICE* device); struct _DEVICE_SERVICE_ENTRY_POINTS { @@ -380,6 +380,6 @@ struct _DEVICE_SERVICE_ENTRY_POINTS typedef struct _DEVICE_SERVICE_ENTRY_POINTS DEVICE_SERVICE_ENTRY_POINTS; typedef DEVICE_SERVICE_ENTRY_POINTS* PDEVICE_SERVICE_ENTRY_POINTS; -typedef UINT(*PDEVICE_SERVICE_ENTRY)(PDEVICE_SERVICE_ENTRY_POINTS); +typedef UINT (*PDEVICE_SERVICE_ENTRY)(PDEVICE_SERVICE_ENTRY_POINTS); #endif /* FREERDP_CHANNEL_RDPDR_H */ diff --git a/include/freerdp/channels/rdpei.h b/include/freerdp/channels/rdpei.h index 375fa6099..de09ffcf6 100644 --- a/include/freerdp/channels/rdpei.h +++ b/include/freerdp/channels/rdpei.h @@ -24,31 +24,31 @@ #include -#define RDPINPUT_HEADER_LENGTH 6 +#define RDPINPUT_HEADER_LENGTH 6 -#define RDPEI_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::Input" +#define RDPEI_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::Input" /** @brief protocol version */ -enum { +enum +{ RDPINPUT_PROTOCOL_V10 = 0x00010000, RDPINPUT_PROTOCOL_V101 = 0x00010001 }; /* Client Ready Flags */ -#define READY_FLAGS_SHOW_TOUCH_VISUALS 0x00000001 -#define READY_FLAGS_DISABLE_TIMESTAMP_INJECTION 0x00000002 +#define READY_FLAGS_SHOW_TOUCH_VISUALS 0x00000001 +#define READY_FLAGS_DISABLE_TIMESTAMP_INJECTION 0x00000002 +#define CONTACT_DATA_CONTACTRECT_PRESENT 0x0001 +#define CONTACT_DATA_ORIENTATION_PRESENT 0x0002 +#define CONTACT_DATA_PRESSURE_PRESENT 0x0004 -#define CONTACT_DATA_CONTACTRECT_PRESENT 0x0001 -#define CONTACT_DATA_ORIENTATION_PRESENT 0x0002 -#define CONTACT_DATA_PRESSURE_PRESENT 0x0004 - -#define CONTACT_FLAG_DOWN 0x0001 -#define CONTACT_FLAG_UPDATE 0x0002 -#define CONTACT_FLAG_UP 0x0004 -#define CONTACT_FLAG_INRANGE 0x0008 -#define CONTACT_FLAG_INCONTACT 0x0010 -#define CONTACT_FLAG_CANCELED 0x0020 +#define CONTACT_FLAG_DOWN 0x0001 +#define CONTACT_FLAG_UPDATE 0x0002 +#define CONTACT_FLAG_UP 0x0004 +#define CONTACT_FLAG_INRANGE 0x0008 +#define CONTACT_FLAG_INCONTACT 0x0010 +#define CONTACT_FLAG_CANCELED 0x0020 /** @brief a contact point */ struct _RDPINPUT_CONTACT_DATA @@ -76,7 +76,6 @@ struct _RDPINPUT_TOUCH_FRAME }; typedef struct _RDPINPUT_TOUCH_FRAME RDPINPUT_TOUCH_FRAME; - /** @brief a touch event with some frames*/ struct _RDPINPUT_TOUCH_EVENT { @@ -86,6 +85,4 @@ struct _RDPINPUT_TOUCH_EVENT }; typedef struct _RDPINPUT_TOUCH_EVENT RDPINPUT_TOUCH_EVENT; - #endif /* FREERDP_CHANNEL_RDPEI_H */ - diff --git a/include/freerdp/channels/rdpgfx.h b/include/freerdp/channels/rdpgfx.h index 9caaf4fac..a4e97ffb1 100644 --- a/include/freerdp/channels/rdpgfx.h +++ b/include/freerdp/channels/rdpgfx.h @@ -24,7 +24,7 @@ #include #include -#define RDPGFX_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::Graphics" +#define RDPGFX_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::Graphics" /** * Common Data Types @@ -46,38 +46,38 @@ struct _RDPGFX_COLOR32 }; typedef struct _RDPGFX_COLOR32 RDPGFX_COLOR32; -#define GFX_PIXEL_FORMAT_XRGB_8888 0x20 -#define GFX_PIXEL_FORMAT_ARGB_8888 0x21 +#define GFX_PIXEL_FORMAT_XRGB_8888 0x20 +#define GFX_PIXEL_FORMAT_ARGB_8888 0x21 typedef BYTE RDPGFX_PIXELFORMAT; -#define RDPGFX_CMDID_UNUSED_0000 0x0000 -#define RDPGFX_CMDID_WIRETOSURFACE_1 0x0001 -#define RDPGFX_CMDID_WIRETOSURFACE_2 0x0002 -#define RDPGFX_CMDID_DELETEENCODINGCONTEXT 0x0003 -#define RDPGFX_CMDID_SOLIDFILL 0x0004 -#define RDPGFX_CMDID_SURFACETOSURFACE 0x0005 -#define RDPGFX_CMDID_SURFACETOCACHE 0x0006 -#define RDPGFX_CMDID_CACHETOSURFACE 0x0007 -#define RDPGFX_CMDID_EVICTCACHEENTRY 0x0008 -#define RDPGFX_CMDID_CREATESURFACE 0x0009 -#define RDPGFX_CMDID_DELETESURFACE 0x000A -#define RDPGFX_CMDID_STARTFRAME 0x000B -#define RDPGFX_CMDID_ENDFRAME 0x000C -#define RDPGFX_CMDID_FRAMEACKNOWLEDGE 0x000D -#define RDPGFX_CMDID_RESETGRAPHICS 0x000E -#define RDPGFX_CMDID_MAPSURFACETOOUTPUT 0x000F -#define RDPGFX_CMDID_CACHEIMPORTOFFER 0x0010 -#define RDPGFX_CMDID_CACHEIMPORTREPLY 0x0011 -#define RDPGFX_CMDID_CAPSADVERTISE 0x0012 -#define RDPGFX_CMDID_CAPSCONFIRM 0x0013 -#define RDPGFX_CMDID_UNUSED_0014 0x0014 -#define RDPGFX_CMDID_MAPSURFACETOWINDOW 0x0015 -#define RDPGFX_CMDID_QOEFRAMEACKNOWLEDGE 0x0016 -#define RDPGFX_CMDID_MAPSURFACETOSCALEDOUTPUT 0x0017 -#define RDPGFX_CMDID_MAPSURFACETOSCALEDWINDOW 0x0018 +#define RDPGFX_CMDID_UNUSED_0000 0x0000 +#define RDPGFX_CMDID_WIRETOSURFACE_1 0x0001 +#define RDPGFX_CMDID_WIRETOSURFACE_2 0x0002 +#define RDPGFX_CMDID_DELETEENCODINGCONTEXT 0x0003 +#define RDPGFX_CMDID_SOLIDFILL 0x0004 +#define RDPGFX_CMDID_SURFACETOSURFACE 0x0005 +#define RDPGFX_CMDID_SURFACETOCACHE 0x0006 +#define RDPGFX_CMDID_CACHETOSURFACE 0x0007 +#define RDPGFX_CMDID_EVICTCACHEENTRY 0x0008 +#define RDPGFX_CMDID_CREATESURFACE 0x0009 +#define RDPGFX_CMDID_DELETESURFACE 0x000A +#define RDPGFX_CMDID_STARTFRAME 0x000B +#define RDPGFX_CMDID_ENDFRAME 0x000C +#define RDPGFX_CMDID_FRAMEACKNOWLEDGE 0x000D +#define RDPGFX_CMDID_RESETGRAPHICS 0x000E +#define RDPGFX_CMDID_MAPSURFACETOOUTPUT 0x000F +#define RDPGFX_CMDID_CACHEIMPORTOFFER 0x0010 +#define RDPGFX_CMDID_CACHEIMPORTREPLY 0x0011 +#define RDPGFX_CMDID_CAPSADVERTISE 0x0012 +#define RDPGFX_CMDID_CAPSCONFIRM 0x0013 +#define RDPGFX_CMDID_UNUSED_0014 0x0014 +#define RDPGFX_CMDID_MAPSURFACETOWINDOW 0x0015 +#define RDPGFX_CMDID_QOEFRAMEACKNOWLEDGE 0x0016 +#define RDPGFX_CMDID_MAPSURFACETOSCALEDOUTPUT 0x0017 +#define RDPGFX_CMDID_MAPSURFACETOSCALEDWINDOW 0x0018 -#define RDPGFX_HEADER_SIZE 8 +#define RDPGFX_HEADER_SIZE 8 struct _RDPGFX_HEADER { @@ -91,18 +91,18 @@ typedef struct _RDPGFX_HEADER RDPGFX_HEADER; * Capability Sets [MS-RDPEGFX] 2.2.3 */ -#define RDPGFX_CAPVERSION_8 0x00080004 /** [MS-RDPEGFX] 2.2.3.1 */ -#define RDPGFX_CAPVERSION_81 0x00080105 /** [MS-RDPEGFX] 2.2.3.2 */ -#define RDPGFX_CAPVERSION_10 0x000A0002 /** [MS-RDPEGFX] 2.2.3.3 */ -#define RDPGFX_CAPVERSION_101 0x000A0100 /** [MS-RDPEGFX] 2.2.3.4 */ -#define RDPGFX_CAPVERSION_102 0x000A0200 /** [MS-RDPEGFX] 2.2.3.5 */ -#define RDPGFX_CAPVERSION_103 0x000A0301 /** [MS-RDPEGFX] 2.2.3.6 */ -#define RDPGFX_CAPVERSION_104 0x000A0400 /** [MS-RDPEGFX] 2.2.3.7 */ -#define RDPGFX_CAPVERSION_105 0x000A0502 /** [MS-RDPEGFX] 2.2.3.8 */ -#define RDPGFX_CAPVERSION_106 0x000A0601 /** [MS-RDPEGFX] 2.2.3.9 */ +#define RDPGFX_CAPVERSION_8 0x00080004 /** [MS-RDPEGFX] 2.2.3.1 */ +#define RDPGFX_CAPVERSION_81 0x00080105 /** [MS-RDPEGFX] 2.2.3.2 */ +#define RDPGFX_CAPVERSION_10 0x000A0002 /** [MS-RDPEGFX] 2.2.3.3 */ +#define RDPGFX_CAPVERSION_101 0x000A0100 /** [MS-RDPEGFX] 2.2.3.4 */ +#define RDPGFX_CAPVERSION_102 0x000A0200 /** [MS-RDPEGFX] 2.2.3.5 */ +#define RDPGFX_CAPVERSION_103 0x000A0301 /** [MS-RDPEGFX] 2.2.3.6 */ +#define RDPGFX_CAPVERSION_104 0x000A0400 /** [MS-RDPEGFX] 2.2.3.7 */ +#define RDPGFX_CAPVERSION_105 0x000A0502 /** [MS-RDPEGFX] 2.2.3.8 */ +#define RDPGFX_CAPVERSION_106 0x000A0601 /** [MS-RDPEGFX] 2.2.3.9 */ -#define RDPGFX_NUMBER_CAPSETS 9 -#define RDPGFX_CAPSET_BASE_SIZE 8 +#define RDPGFX_NUMBER_CAPSETS 9 +#define RDPGFX_CAPSET_BASE_SIZE 8 struct _RDPGFX_CAPSET { @@ -112,11 +112,11 @@ struct _RDPGFX_CAPSET }; typedef struct _RDPGFX_CAPSET RDPGFX_CAPSET; -#define RDPGFX_CAPS_FLAG_THINCLIENT 0x00000001U /* 8.0+ */ -#define RDPGFX_CAPS_FLAG_SMALL_CACHE 0x00000002U /* 8.0+ */ -#define RDPGFX_CAPS_FLAG_AVC420_ENABLED 0x00000010U /* 8.1+ */ -#define RDPGFX_CAPS_FLAG_AVC_DISABLED 0x00000020U /* 10.0+ */ -#define RDPGFX_CAPS_FLAG_AVC_THINCLIENT 0x00000040U /* 10.3+ */ +#define RDPGFX_CAPS_FLAG_THINCLIENT 0x00000001U /* 8.0+ */ +#define RDPGFX_CAPS_FLAG_SMALL_CACHE 0x00000002U /* 8.0+ */ +#define RDPGFX_CAPS_FLAG_AVC420_ENABLED 0x00000010U /* 8.1+ */ +#define RDPGFX_CAPS_FLAG_AVC_DISABLED 0x00000020U /* 10.0+ */ +#define RDPGFX_CAPS_FLAG_AVC_THINCLIENT 0x00000040U /* 10.3+ */ struct _RDPGFX_CAPSET_VERSION8 { @@ -146,16 +146,16 @@ typedef struct _RDPGFX_CAPSET_VERSION10 RDPGFX_CAPSET_VERSION10; * Graphics Messages */ -#define RDPGFX_CODECID_UNCOMPRESSED 0x0000 -#define RDPGFX_CODECID_CAVIDEO 0x0003 -#define RDPGFX_CODECID_CLEARCODEC 0x0008 -#define RDPGFX_CODECID_PLANAR 0x000A -#define RDPGFX_CODECID_AVC420 0x000B -#define RDPGFX_CODECID_ALPHA 0x000C -#define RDPGFX_CODECID_AVC444 0x000E -#define RDPGFX_CODECID_AVC444v2 0x000F +#define RDPGFX_CODECID_UNCOMPRESSED 0x0000 +#define RDPGFX_CODECID_CAVIDEO 0x0003 +#define RDPGFX_CODECID_CLEARCODEC 0x0008 +#define RDPGFX_CODECID_PLANAR 0x000A +#define RDPGFX_CODECID_AVC420 0x000B +#define RDPGFX_CODECID_ALPHA 0x000C +#define RDPGFX_CODECID_AVC444 0x000E +#define RDPGFX_CODECID_AVC444v2 0x000F -#define RDPGFX_WIRE_TO_SURFACE_PDU_1_SIZE 17 +#define RDPGFX_WIRE_TO_SURFACE_PDU_1_SIZE 17 struct _RDPGFX_WIRE_TO_SURFACE_PDU_1 { @@ -168,10 +168,10 @@ struct _RDPGFX_WIRE_TO_SURFACE_PDU_1 }; typedef struct _RDPGFX_WIRE_TO_SURFACE_PDU_1 RDPGFX_WIRE_TO_SURFACE_PDU_1; -#define RDPGFX_CODECID_CAPROGRESSIVE 0x0009 -#define RDPGFX_CODECID_CAPROGRESSIVE_V2 0x000D +#define RDPGFX_CODECID_CAPROGRESSIVE 0x0009 +#define RDPGFX_CODECID_CAPROGRESSIVE_V2 0x000D -#define RDPGFX_WIRE_TO_SURFACE_PDU_2_SIZE 13 +#define RDPGFX_WIRE_TO_SURFACE_PDU_2_SIZE 13 struct _RDPGFX_WIRE_TO_SURFACE_PDU_2 { @@ -207,8 +207,7 @@ struct _RDPGFX_DELETE_ENCODING_CONTEXT_PDU UINT16 surfaceId; UINT32 codecContextId; }; -typedef struct _RDPGFX_DELETE_ENCODING_CONTEXT_PDU - RDPGFX_DELETE_ENCODING_CONTEXT_PDU; +typedef struct _RDPGFX_DELETE_ENCODING_CONTEXT_PDU RDPGFX_DELETE_ENCODING_CONTEXT_PDU; struct _RDPGFX_SOLID_FILL_PDU { @@ -268,7 +267,7 @@ struct _RDPGFX_DELETE_SURFACE_PDU }; typedef struct _RDPGFX_DELETE_SURFACE_PDU RDPGFX_DELETE_SURFACE_PDU; -#define RDPGFX_START_FRAME_PDU_SIZE 8 +#define RDPGFX_START_FRAME_PDU_SIZE 8 struct _RDPGFX_START_FRAME_PDU { @@ -277,7 +276,7 @@ struct _RDPGFX_START_FRAME_PDU }; typedef struct _RDPGFX_START_FRAME_PDU RDPGFX_START_FRAME_PDU; -#define RDPGFX_END_FRAME_PDU_SIZE 4 +#define RDPGFX_END_FRAME_PDU_SIZE 4 struct _RDPGFX_END_FRAME_PDU { @@ -285,8 +284,8 @@ struct _RDPGFX_END_FRAME_PDU }; typedef struct _RDPGFX_END_FRAME_PDU RDPGFX_END_FRAME_PDU; -#define QUEUE_DEPTH_UNAVAILABLE 0x00000000 -#define SUSPEND_FRAME_ACKNOWLEDGEMENT 0xFFFFFFFF +#define QUEUE_DEPTH_UNAVAILABLE 0x00000000 +#define SUSPEND_FRAME_ACKNOWLEDGEMENT 0xFFFFFFFF struct _RDPGFX_FRAME_ACKNOWLEDGE_PDU { @@ -312,8 +311,7 @@ struct _RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU UINT32 outputOriginX; UINT32 outputOriginY; }; -typedef struct _RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU - RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU; +typedef struct _RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU; struct _RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU { @@ -324,8 +322,7 @@ struct _RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU UINT32 targetWidth; UINT32 targetHeight; }; -typedef struct _RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU - RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU; +typedef struct _RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU; struct _RDPGFX_CACHE_ENTRY_METADATA { @@ -368,8 +365,7 @@ struct _RDPGFX_MAP_SURFACE_TO_WINDOW_PDU UINT32 mappedWidth; UINT32 mappedHeight; }; -typedef struct _RDPGFX_MAP_SURFACE_TO_WINDOW_PDU - RDPGFX_MAP_SURFACE_TO_WINDOW_PDU; +typedef struct _RDPGFX_MAP_SURFACE_TO_WINDOW_PDU RDPGFX_MAP_SURFACE_TO_WINDOW_PDU; struct _RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU { @@ -380,8 +376,7 @@ struct _RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU UINT32 targetWidth; UINT32 targetHeight; }; -typedef struct _RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU - RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU; +typedef struct _RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU; /* H264 */ @@ -427,8 +422,6 @@ struct _RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU UINT16 timeDiffSE; UINT16 timeDiffEDR; }; -typedef struct _RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU - RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU; +typedef struct _RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU; #endif /* FREERDP_CHANNEL_RDPGFX_H */ - diff --git a/include/freerdp/channels/rdpsnd.h b/include/freerdp/channels/rdpsnd.h index b206ea843..207375405 100644 --- a/include/freerdp/channels/rdpsnd.h +++ b/include/freerdp/channels/rdpsnd.h @@ -26,4 +26,3 @@ #include #endif /* FREERDP_CHANNEL_RDPSND_H */ - diff --git a/include/freerdp/channels/remdesk.h b/include/freerdp/channels/remdesk.h index 22b6f6db4..a60f0e2d6 100644 --- a/include/freerdp/channels/remdesk.h +++ b/include/freerdp/channels/remdesk.h @@ -23,56 +23,56 @@ #include #include -#define REMDESK_SVC_CHANNEL_NAME "remdesk" +#define REMDESK_SVC_CHANNEL_NAME "remdesk" -#define REMDESK_ERROR_NOERROR 0 -#define REMDESK_ERROR_NOINFO 1 -#define REMDESK_ERROR_LOCALNOTERROR 3 -#define REMDESK_ERROR_REMOTEBYUSER 4 -#define REMDESK_ERROR_BYSERVER 5 -#define REMDESK_ERROR_DNSLOOKUPFAILED 6 -#define REMDESK_ERROR_OUTOFMEMORY 7 -#define REMDESK_ERROR_CONNECTIONTIMEDOUT 8 -#define REMDESK_ERROR_SOCKETCONNECTFAILED 9 -#define REMDESK_ERROR_HOSTNOTFOUND 11 -#define REMDESK_ERROR_WINSOCKSENDFAILED 12 -#define REMDESK_ERROR_INVALIDIPADDR 14 -#define REMDESK_ERROR_SOCKETRECVFAILED 15 -#define REMDESK_ERROR_INVALIDENCRYPTION 18 -#define REMDESK_ERROR_GETHOSTBYNAMEFAILED 20 -#define REMDESK_ERROR_LICENSINGFAILED 21 -#define REMDESK_ERROR_ENCRYPTIONERROR 22 -#define REMDESK_ERROR_DECRYPTIONERROR 23 -#define REMDESK_ERROR_INVALIDPARAMETERSTRING 24 -#define REMDESK_ERROR_HELPSESSIONNOTFOUND 25 -#define REMDESK_ERROR_INVALIDPASSWORD 26 -#define REMDESK_ERROR_HELPSESSIONEXPIRED 27 -#define REMDESK_ERROR_CANTOPENRESOLVER 28 -#define REMDESK_ERROR_UNKNOWNSESSMGRERROR 29 -#define REMDESK_ERROR_CANTFORMLINKTOUSERSESSION 30 -#define REMDESK_ERROR_RCPROTOCOLERROR 32 -#define REMDESK_ERROR_RCUNKNOWNERROR 33 -#define REMDESK_ERROR_INTERNALERROR 34 -#define REMDESK_ERROR_HELPEERESPONSEPENDING 35 -#define REMDESK_ERROR_HELPEESAIDYES 36 -#define REMDESK_ERROR_HELPEEALREADYBEINGHELPED 37 -#define REMDESK_ERROR_HELPEECONSIDERINGHELP 38 -#define REMDESK_ERROR_HELPEENEVERRESPONDED 40 -#define REMDESK_ERROR_HELPEESAIDNO 41 -#define REMDESK_ERROR_HELPSESSIONACCESSDENIED 42 -#define REMDESK_ERROR_USERNOTFOUND 43 -#define REMDESK_ERROR_SESSMGRERRORNOTINIT 44 -#define REMDESK_ERROR_SELFHELPNOTSUPPORTED 45 -#define REMDESK_ERROR_INCOMPATIBLEVERSION 47 -#define REMDESK_ERROR_SESSIONNOTCONNECTED 48 -#define REMDESK_ERROR_SYSTEMSHUTDOWN 50 -#define REMDESK_ERROR_STOPLISTENBYUSER 51 -#define REMDESK_ERROR_WINSOCK_FAILED 52 -#define REMDESK_ERROR_MISMATCHPARMS 53 -#define REMDESK_ERROR_PASSWORDS_DONT_MATCH 61 -#define REMDESK_ERROR_SHADOWEND_BASE 300 -#define REMDESK_ERROR_SHADOWEND_CONFIGCHANGE 301 -#define REMDESK_ERROR_SHADOWEND_UNKNOWN 302 +#define REMDESK_ERROR_NOERROR 0 +#define REMDESK_ERROR_NOINFO 1 +#define REMDESK_ERROR_LOCALNOTERROR 3 +#define REMDESK_ERROR_REMOTEBYUSER 4 +#define REMDESK_ERROR_BYSERVER 5 +#define REMDESK_ERROR_DNSLOOKUPFAILED 6 +#define REMDESK_ERROR_OUTOFMEMORY 7 +#define REMDESK_ERROR_CONNECTIONTIMEDOUT 8 +#define REMDESK_ERROR_SOCKETCONNECTFAILED 9 +#define REMDESK_ERROR_HOSTNOTFOUND 11 +#define REMDESK_ERROR_WINSOCKSENDFAILED 12 +#define REMDESK_ERROR_INVALIDIPADDR 14 +#define REMDESK_ERROR_SOCKETRECVFAILED 15 +#define REMDESK_ERROR_INVALIDENCRYPTION 18 +#define REMDESK_ERROR_GETHOSTBYNAMEFAILED 20 +#define REMDESK_ERROR_LICENSINGFAILED 21 +#define REMDESK_ERROR_ENCRYPTIONERROR 22 +#define REMDESK_ERROR_DECRYPTIONERROR 23 +#define REMDESK_ERROR_INVALIDPARAMETERSTRING 24 +#define REMDESK_ERROR_HELPSESSIONNOTFOUND 25 +#define REMDESK_ERROR_INVALIDPASSWORD 26 +#define REMDESK_ERROR_HELPSESSIONEXPIRED 27 +#define REMDESK_ERROR_CANTOPENRESOLVER 28 +#define REMDESK_ERROR_UNKNOWNSESSMGRERROR 29 +#define REMDESK_ERROR_CANTFORMLINKTOUSERSESSION 30 +#define REMDESK_ERROR_RCPROTOCOLERROR 32 +#define REMDESK_ERROR_RCUNKNOWNERROR 33 +#define REMDESK_ERROR_INTERNALERROR 34 +#define REMDESK_ERROR_HELPEERESPONSEPENDING 35 +#define REMDESK_ERROR_HELPEESAIDYES 36 +#define REMDESK_ERROR_HELPEEALREADYBEINGHELPED 37 +#define REMDESK_ERROR_HELPEECONSIDERINGHELP 38 +#define REMDESK_ERROR_HELPEENEVERRESPONDED 40 +#define REMDESK_ERROR_HELPEESAIDNO 41 +#define REMDESK_ERROR_HELPSESSIONACCESSDENIED 42 +#define REMDESK_ERROR_USERNOTFOUND 43 +#define REMDESK_ERROR_SESSMGRERRORNOTINIT 44 +#define REMDESK_ERROR_SELFHELPNOTSUPPORTED 45 +#define REMDESK_ERROR_INCOMPATIBLEVERSION 47 +#define REMDESK_ERROR_SESSIONNOTCONNECTED 48 +#define REMDESK_ERROR_SYSTEMSHUTDOWN 50 +#define REMDESK_ERROR_STOPLISTENBYUSER 51 +#define REMDESK_ERROR_WINSOCK_FAILED 52 +#define REMDESK_ERROR_MISMATCHPARMS 53 +#define REMDESK_ERROR_PASSWORDS_DONT_MATCH 61 +#define REMDESK_ERROR_SHADOWEND_BASE 300 +#define REMDESK_ERROR_SHADOWEND_CONFIGCHANGE 301 +#define REMDESK_ERROR_SHADOWEND_UNKNOWN 302 struct _REMDESK_CHANNEL_HEADER { @@ -81,8 +81,8 @@ struct _REMDESK_CHANNEL_HEADER }; typedef struct _REMDESK_CHANNEL_HEADER REMDESK_CHANNEL_HEADER; -#define REMDESK_CHANNEL_CTL_NAME "RC_CTL" -#define REMDESK_CHANNEL_CTL_SIZE 22 +#define REMDESK_CHANNEL_CTL_NAME "RC_CTL" +#define REMDESK_CHANNEL_CTL_SIZE 22 struct _REMDESK_CTL_HEADER { @@ -93,18 +93,18 @@ struct _REMDESK_CTL_HEADER }; typedef struct _REMDESK_CTL_HEADER REMDESK_CTL_HEADER; -#define REMDESK_CTL_REMOTE_CONTROL_DESKTOP 1 -#define REMDESK_CTL_RESULT 2 -#define REMDESK_CTL_AUTHENTICATE 3 -#define REMDESK_CTL_SERVER_ANNOUNCE 4 -#define REMDESK_CTL_DISCONNECT 5 -#define REMDESK_CTL_VERSIONINFO 6 -#define REMDESK_CTL_ISCONNECTED 7 -#define REMDESK_CTL_VERIFY_PASSWORD 8 -#define REMDESK_CTL_EXPERT_ON_VISTA 9 -#define REMDESK_CTL_RANOVICE_NAME 10 -#define REMDESK_CTL_RAEXPERT_NAME 11 -#define REMDESK_CTL_TOKEN 12 +#define REMDESK_CTL_REMOTE_CONTROL_DESKTOP 1 +#define REMDESK_CTL_RESULT 2 +#define REMDESK_CTL_AUTHENTICATE 3 +#define REMDESK_CTL_SERVER_ANNOUNCE 4 +#define REMDESK_CTL_DISCONNECT 5 +#define REMDESK_CTL_VERSIONINFO 6 +#define REMDESK_CTL_ISCONNECTED 7 +#define REMDESK_CTL_VERIFY_PASSWORD 8 +#define REMDESK_CTL_EXPERT_ON_VISTA 9 +#define REMDESK_CTL_RANOVICE_NAME 10 +#define REMDESK_CTL_RAEXPERT_NAME 11 +#define REMDESK_CTL_TOKEN 12 struct _REMDESK_CTL_RESULT_PDU { @@ -158,4 +158,3 @@ struct _REMDESK_CTL_EXPERT_ON_VISTA_PDU typedef struct _REMDESK_CTL_EXPERT_ON_VISTA_PDU REMDESK_CTL_EXPERT_ON_VISTA_PDU; #endif /* FREERDP_CHANNEL_REMDESK_H */ - diff --git a/include/freerdp/channels/tsmf.h b/include/freerdp/channels/tsmf.h index 3ef76d40f..83da56f2f 100644 --- a/include/freerdp/channels/tsmf.h +++ b/include/freerdp/channels/tsmf.h @@ -23,6 +23,6 @@ #include -#define TSMF_DVC_CHANNEL_NAME "TSMF" +#define TSMF_DVC_CHANNEL_NAME "TSMF" #endif /* FREERDP_CHANNEL_TSMF_H */ diff --git a/include/freerdp/channels/video.h b/include/freerdp/channels/video.h index 236751263..c1197c0ba 100644 --- a/include/freerdp/channels/video.h +++ b/include/freerdp/channels/video.h @@ -29,17 +29,17 @@ /** @brief TSNM packet type */ enum { - TSMM_PACKET_TYPE_PRESENTATION_REQUEST = 1, - TSMM_PACKET_TYPE_PRESENTATION_RESPONSE = 2, - TSMM_PACKET_TYPE_CLIENT_NOTIFICATION = 3, - TSMM_PACKET_TYPE_VIDEO_DATA = 4 + TSMM_PACKET_TYPE_PRESENTATION_REQUEST = 1, + TSMM_PACKET_TYPE_PRESENTATION_RESPONSE = 2, + TSMM_PACKET_TYPE_CLIENT_NOTIFICATION = 3, + TSMM_PACKET_TYPE_VIDEO_DATA = 4 }; /** @brief TSMM_PRESENTATION_REQUEST commands */ enum { TSMM_START_PRESENTATION = 1, - TSMM_STOP_PRESENTATION = 2 + TSMM_STOP_PRESENTATION = 2 }; /** @brief presentation request struct */ @@ -55,7 +55,7 @@ struct _TSMM_PRESENTATION_REQUEST UINT64 GeometryMappingId; BYTE VideoSubtypeId[16]; UINT32 cbExtra; - BYTE *pExtraData; + BYTE* pExtraData; }; typedef struct _TSMM_PRESENTATION_REQUEST TSMM_PRESENTATION_REQUEST; @@ -69,9 +69,9 @@ typedef struct _TSMM_PRESENTATION_RESPONSE TSMM_PRESENTATION_RESPONSE; /** @brief TSMM_VIDEO_DATA flags */ enum { - TSMM_VIDEO_DATA_FLAG_HAS_TIMESTAMPS = 0x01, - TSMM_VIDEO_DATA_FLAG_KEYFRAME = 0x02, - TSMM_VIDEO_DATA_FLAG_NEW_FRAMERATE = 0x04 + TSMM_VIDEO_DATA_FLAG_HAS_TIMESTAMPS = 0x01, + TSMM_VIDEO_DATA_FLAG_KEYFRAME = 0x02, + TSMM_VIDEO_DATA_FLAG_NEW_FRAMERATE = 0x04 }; /** @brief a video data packet */ @@ -86,7 +86,7 @@ struct _TSMM_VIDEO_DATA UINT16 PacketsInSample; UINT32 SampleNumber; UINT32 cbSample; - BYTE *pSample; + BYTE* pSample; }; typedef struct _TSMM_VIDEO_DATA TSMM_VIDEO_DATA; @@ -103,7 +103,8 @@ struct _TSMM_CLIENT_NOTIFICATION_FRAMERATE_OVERRIDE UINT32 Flags; UINT32 DesiredFrameRate; }; -typedef struct _TSMM_CLIENT_NOTIFICATION_FRAMERATE_OVERRIDE TSMM_CLIENT_NOTIFICATION_FRAMERATE_OVERRIDE; +typedef struct _TSMM_CLIENT_NOTIFICATION_FRAMERATE_OVERRIDE + TSMM_CLIENT_NOTIFICATION_FRAMERATE_OVERRIDE; /** @brief a client to server notification struct */ struct _TSMM_CLIENT_NOTIFICATION @@ -114,5 +115,4 @@ struct _TSMM_CLIENT_NOTIFICATION }; typedef struct _TSMM_CLIENT_NOTIFICATION TSMM_CLIENT_NOTIFICATION; - #endif /* FREERDP_CHANNEL_VIDEO_H */ diff --git a/include/freerdp/channels/wtsvc.h b/include/freerdp/channels/wtsvc.h index 68d9f1232..ef76f7d9b 100644 --- a/include/freerdp/channels/wtsvc.h +++ b/include/freerdp/channels/wtsvc.h @@ -40,37 +40,41 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -enum -{ - DRDYNVC_STATE_NONE = 0, - DRDYNVC_STATE_INITIALIZED = 1, - DRDYNVC_STATE_READY = 2, - DRDYNVC_STATE_FAILED = 3 -}; + enum + { + DRDYNVC_STATE_NONE = 0, + DRDYNVC_STATE_INITIALIZED = 1, + DRDYNVC_STATE_READY = 2, + DRDYNVC_STATE_FAILED = 3 + }; -/** - * WTSVirtualChannelManager functions are FreeRDP extensions to the API. - */ + /** + * WTSVirtualChannelManager functions are FreeRDP extensions to the API. + */ -FREERDP_API void WTSVirtualChannelManagerGetFileDescriptor(HANDLE hServer, void** fds, int* fds_count); -FREERDP_API BOOL WTSVirtualChannelManagerCheckFileDescriptor(HANDLE hServer); -FREERDP_API HANDLE WTSVirtualChannelManagerGetEventHandle(HANDLE hServer); -FREERDP_API BOOL WTSVirtualChannelManagerIsChannelJoined(HANDLE hServer, const char* name); -FREERDP_API BYTE WTSVirtualChannelManagerGetDrdynvcState(HANDLE hServer); + FREERDP_API void WTSVirtualChannelManagerGetFileDescriptor(HANDLE hServer, void** fds, + int* fds_count); + FREERDP_API BOOL WTSVirtualChannelManagerCheckFileDescriptor(HANDLE hServer); + FREERDP_API HANDLE WTSVirtualChannelManagerGetEventHandle(HANDLE hServer); + FREERDP_API BOOL WTSVirtualChannelManagerIsChannelJoined(HANDLE hServer, const char* name); + FREERDP_API BYTE WTSVirtualChannelManagerGetDrdynvcState(HANDLE hServer); -/** - * Extended FreeRDP WTS functions for channel handling - */ -FREERDP_API UINT16 WTSChannelGetId(freerdp_peer *client, const char *channel_name); -FREERDP_API BOOL WTSIsChannelJoinedByName(freerdp_peer *client, const char *channel_name); -FREERDP_API BOOL WTSIsChannelJoinedById(freerdp_peer *client, const UINT16 channel_id); -FREERDP_API BOOL WTSChannelSetHandleByName(freerdp_peer *client, const char *channel_name, void *handle); -FREERDP_API BOOL WTSChannelSetHandleById(freerdp_peer *client, const UINT16 channel_id, void *handle); -FREERDP_API void *WTSChannelGetHandleByName(freerdp_peer *client, const char *channel_name); -FREERDP_API void *WTSChannelGetHandleById(freerdp_peer *client, const UINT16 channel_id); + /** + * Extended FreeRDP WTS functions for channel handling + */ + FREERDP_API UINT16 WTSChannelGetId(freerdp_peer* client, const char* channel_name); + FREERDP_API BOOL WTSIsChannelJoinedByName(freerdp_peer* client, const char* channel_name); + FREERDP_API BOOL WTSIsChannelJoinedById(freerdp_peer* client, const UINT16 channel_id); + FREERDP_API BOOL WTSChannelSetHandleByName(freerdp_peer* client, const char* channel_name, + void* handle); + FREERDP_API BOOL WTSChannelSetHandleById(freerdp_peer* client, const UINT16 channel_id, + void* handle); + FREERDP_API void* WTSChannelGetHandleByName(freerdp_peer* client, const char* channel_name); + FREERDP_API void* WTSChannelGetHandleById(freerdp_peer* client, const UINT16 channel_id); #ifdef __cplusplus } diff --git a/include/freerdp/client.h b/include/freerdp/client.h index 8ade2114e..942f55057 100644 --- a/include/freerdp/client.h +++ b/include/freerdp/client.h @@ -24,111 +24,108 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/** - * Client Entry Points - */ + /** + * Client Entry Points + */ -typedef BOOL (*pRdpGlobalInit)(void); -typedef void (*pRdpGlobalUninit)(void); + typedef BOOL (*pRdpGlobalInit)(void); + typedef void (*pRdpGlobalUninit)(void); -typedef BOOL (*pRdpClientNew)(freerdp* instance, rdpContext* context); -typedef void (*pRdpClientFree)(freerdp* instance, rdpContext* context); + typedef BOOL (*pRdpClientNew)(freerdp* instance, rdpContext* context); + typedef void (*pRdpClientFree)(freerdp* instance, rdpContext* context); -typedef int (*pRdpClientStart)(rdpContext* context); -typedef int (*pRdpClientStop)(rdpContext* context); + typedef int (*pRdpClientStart)(rdpContext* context); + typedef int (*pRdpClientStop)(rdpContext* context); -struct rdp_client_entry_points_v1 -{ - DWORD Size; - DWORD Version; + struct rdp_client_entry_points_v1 + { + DWORD Size; + DWORD Version; - rdpSettings* settings; + rdpSettings* settings; - pRdpGlobalInit GlobalInit; - pRdpGlobalUninit GlobalUninit; + pRdpGlobalInit GlobalInit; + pRdpGlobalUninit GlobalUninit; - DWORD ContextSize; - pRdpClientNew ClientNew; - pRdpClientFree ClientFree; + DWORD ContextSize; + pRdpClientNew ClientNew; + pRdpClientFree ClientFree; - pRdpClientStart ClientStart; - pRdpClientStop ClientStop; -}; + pRdpClientStart ClientStart; + pRdpClientStop ClientStop; + }; -#define RDP_CLIENT_INTERFACE_VERSION 1 -#define RDP_CLIENT_ENTRY_POINT_NAME "RdpClientEntry" +#define RDP_CLIENT_INTERFACE_VERSION 1 +#define RDP_CLIENT_ENTRY_POINT_NAME "RdpClientEntry" -typedef int (*pRdpClientEntry)(RDP_CLIENT_ENTRY_POINTS* pEntryPoints); + typedef int (*pRdpClientEntry)(RDP_CLIENT_ENTRY_POINTS* pEntryPoints); -/* Common Client Interface */ + /* Common Client Interface */ -#define DEFINE_RDP_CLIENT_COMMON() \ - HANDLE thread +#define DEFINE_RDP_CLIENT_COMMON() HANDLE thread -struct rdp_client_context -{ - rdpContext context; - DEFINE_RDP_CLIENT_COMMON(); -}; + struct rdp_client_context + { + rdpContext context; + DEFINE_RDP_CLIENT_COMMON(); + }; -/* Common client functions */ + /* Common client functions */ -FREERDP_API rdpContext* freerdp_client_context_new(RDP_CLIENT_ENTRY_POINTS* pEntryPoints); -FREERDP_API void freerdp_client_context_free(rdpContext* context); + FREERDP_API rdpContext* freerdp_client_context_new(RDP_CLIENT_ENTRY_POINTS* pEntryPoints); + FREERDP_API void freerdp_client_context_free(rdpContext* context); -FREERDP_API int freerdp_client_start(rdpContext* context); -FREERDP_API int freerdp_client_stop(rdpContext* context); + FREERDP_API int freerdp_client_start(rdpContext* context); + FREERDP_API int freerdp_client_stop(rdpContext* context); -FREERDP_API freerdp* freerdp_client_get_instance(rdpContext* context); -FREERDP_API HANDLE freerdp_client_get_thread(rdpContext* context); + FREERDP_API freerdp* freerdp_client_get_instance(rdpContext* context); + FREERDP_API HANDLE freerdp_client_get_thread(rdpContext* context); -FREERDP_API int freerdp_client_settings_parse_command_line(rdpSettings* settings, - int argc, char** argv, BOOL allowUnknown); + FREERDP_API int freerdp_client_settings_parse_command_line(rdpSettings* settings, int argc, + char** argv, BOOL allowUnknown); -FREERDP_API int freerdp_client_settings_parse_connection_file(rdpSettings* settings, - const char* filename); -FREERDP_API int freerdp_client_settings_parse_connection_file_buffer(rdpSettings* settings, - const BYTE* buffer, size_t size); -FREERDP_API int freerdp_client_settings_write_connection_file(const rdpSettings* settings, - const char* filename, BOOL unicode); + FREERDP_API int freerdp_client_settings_parse_connection_file(rdpSettings* settings, + const char* filename); + FREERDP_API int freerdp_client_settings_parse_connection_file_buffer(rdpSettings* settings, + const BYTE* buffer, + size_t size); + FREERDP_API int freerdp_client_settings_write_connection_file(const rdpSettings* settings, + const char* filename, + BOOL unicode); -FREERDP_API int freerdp_client_settings_parse_assistance_file(rdpSettings* settings, - int argc, char* argv[]); + FREERDP_API int freerdp_client_settings_parse_assistance_file(rdpSettings* settings, int argc, + char* argv[]); -FREERDP_API BOOL client_cli_authenticate(freerdp* instance, char** username, char** password, - char** domain); -FREERDP_API BOOL client_cli_gw_authenticate(freerdp* instance, char** username, char** password, - char** domain); + FREERDP_API BOOL client_cli_authenticate(freerdp* instance, char** username, char** password, + char** domain); + FREERDP_API BOOL client_cli_gw_authenticate(freerdp* instance, char** username, char** password, + char** domain); -FREERDP_API DWORD client_cli_verify_certificate(freerdp* instance, const char* common_name, - const char* subject, const char* issuer, - const char* fingerprint, BOOL host_mismatch); + FREERDP_API DWORD client_cli_verify_certificate(freerdp* instance, const char* common_name, + const char* subject, const char* issuer, + const char* fingerprint, BOOL host_mismatch); -FREERDP_API DWORD client_cli_verify_certificate_ex(freerdp* instance, - const char* host, UINT16 port, - const char* common_name, - const char* subject, const char* issuer, - const char* fingerprint, DWORD flags); + FREERDP_API DWORD client_cli_verify_certificate_ex(freerdp* instance, const char* host, + UINT16 port, const char* common_name, + const char* subject, const char* issuer, + const char* fingerprint, DWORD flags); -FREERDP_API DWORD client_cli_verify_changed_certificate(freerdp* instance, const char* common_name, - const char* subject, const char* issuer, - const char* fingerprint, - const char* old_subject, const char* old_issuer, - const char* old_fingerprint); + FREERDP_API DWORD client_cli_verify_changed_certificate( + freerdp* instance, const char* common_name, const char* subject, const char* issuer, + const char* fingerprint, const char* old_subject, const char* old_issuer, + const char* old_fingerprint); -FREERDP_API DWORD client_cli_verify_changed_certificate_ex(freerdp* instance, - const char* host, UINT16 port, - const char* common_name, - const char* subject, const char* issuer, - const char* fingerprint, - const char* old_subject, const char* old_issuer, - const char* old_fingerprint, DWORD flags); -FREERDP_API BOOL client_auto_reconnect(freerdp* instance); -FREERDP_API BOOL client_auto_reconnect_ex(freerdp* instance, - BOOL(*window_events)(freerdp* instance)); + FREERDP_API DWORD client_cli_verify_changed_certificate_ex( + freerdp* instance, const char* host, UINT16 port, const char* common_name, + const char* subject, const char* issuer, const char* fingerprint, const char* old_subject, + const char* old_issuer, const char* old_fingerprint, DWORD flags); + FREERDP_API BOOL client_auto_reconnect(freerdp* instance); + FREERDP_API BOOL client_auto_reconnect_ex(freerdp* instance, + BOOL (*window_events)(freerdp* instance)); #ifdef __cplusplus } diff --git a/include/freerdp/client/audin.h b/include/freerdp/client/audin.h index d85487b7b..ade0c09f3 100644 --- a/include/freerdp/client/audin.h +++ b/include/freerdp/client/audin.h @@ -30,8 +30,8 @@ * Subsystem Interface */ -typedef UINT (*AudinReceive)(const AUDIO_FORMAT* format, - const BYTE* data, size_t size, void* userData); +typedef UINT (*AudinReceive)(const AUDIO_FORMAT* format, const BYTE* data, size_t size, + void* userData); typedef struct _IAudinDevice IAudinDevice; struct _IAudinDevice @@ -60,4 +60,3 @@ typedef FREERDP_AUDIN_DEVICE_ENTRY_POINTS* PFREERDP_AUDIN_DEVICE_ENTRY_POINTS; typedef UINT (*PFREERDP_AUDIN_DEVICE_ENTRY)(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints); #endif /* FREERDP_CHANNEL_AUDIN_CLIENT_AUDIN_H */ - diff --git a/include/freerdp/client/channels.h b/include/freerdp/client/channels.h index e298dce28..baf82adc0 100644 --- a/include/freerdp/client/channels.h +++ b/include/freerdp/client/channels.h @@ -25,18 +25,23 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API void* freerdp_channels_client_find_static_entry(const char* name, const char* identifier); -FREERDP_API PVIRTUALCHANNELENTRY freerdp_channels_load_static_addin_entry(LPCSTR pszName, LPCSTR pszSubsystem, LPCSTR pszType, DWORD dwFlags); + FREERDP_API void* freerdp_channels_client_find_static_entry(const char* name, + const char* identifier); + FREERDP_API PVIRTUALCHANNELENTRY freerdp_channels_load_static_addin_entry(LPCSTR pszName, + LPCSTR pszSubsystem, + LPCSTR pszType, + DWORD dwFlags); -FREERDP_API FREERDP_ADDIN** freerdp_channels_list_addins(LPCSTR lpName, LPCSTR lpSubsystem, LPCSTR lpType, DWORD dwFlags); -FREERDP_API void freerdp_channels_addin_list_free(FREERDP_ADDIN** ppAddins); + FREERDP_API FREERDP_ADDIN** freerdp_channels_list_addins(LPCSTR lpName, LPCSTR lpSubsystem, + LPCSTR lpType, DWORD dwFlags); + FREERDP_API void freerdp_channels_addin_list_free(FREERDP_ADDIN** ppAddins); #ifdef __cplusplus } #endif #endif /* FREERDP_CHANNELS_CLIENT_H */ - diff --git a/include/freerdp/client/cliprdr.h b/include/freerdp/client/cliprdr.h index 9f435e086..b4c54afc6 100644 --- a/include/freerdp/client/cliprdr.h +++ b/include/freerdp/client/cliprdr.h @@ -34,26 +34,46 @@ typedef struct _cliprdr_client_context CliprdrClientContext; -typedef UINT (*pcCliprdrServerCapabilities)(CliprdrClientContext* context, const CLIPRDR_CAPABILITIES* capabilities); -typedef UINT (*pcCliprdrClientCapabilities)(CliprdrClientContext* context, const CLIPRDR_CAPABILITIES* capabilities); -typedef UINT (*pcCliprdrMonitorReady)(CliprdrClientContext* context, const CLIPRDR_MONITOR_READY* monitorReady); -typedef UINT (*pcCliprdrTempDirectory)(CliprdrClientContext* context, const CLIPRDR_TEMP_DIRECTORY* tempDirectory); -typedef UINT (*pcCliprdrClientFormatList)(CliprdrClientContext* context, const CLIPRDR_FORMAT_LIST* formatList); -typedef UINT (*pcCliprdrServerFormatList)(CliprdrClientContext* context, const CLIPRDR_FORMAT_LIST* formatList); -typedef UINT (*pcCliprdrClientFormatListResponse)(CliprdrClientContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); -typedef UINT (*pcCliprdrServerFormatListResponse)(CliprdrClientContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); -typedef UINT (*pcCliprdrClientLockClipboardData)(CliprdrClientContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); -typedef UINT (*pcCliprdrServerLockClipboardData)(CliprdrClientContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); -typedef UINT (*pcCliprdrClientUnlockClipboardData)(CliprdrClientContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); -typedef UINT (*pcCliprdrServerUnlockClipboardData)(CliprdrClientContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); -typedef UINT (*pcCliprdrClientFormatDataRequest)(CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); -typedef UINT (*pcCliprdrServerFormatDataRequest)(CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); -typedef UINT (*pcCliprdrClientFormatDataResponse)(CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); -typedef UINT (*pcCliprdrServerFormatDataResponse)(CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); -typedef UINT (*pcCliprdrClientFileContentsRequest)(CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); -typedef UINT (*pcCliprdrServerFileContentsRequest)(CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); -typedef UINT (*pcCliprdrClientFileContentsResponse)(CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); -typedef UINT (*pcCliprdrServerFileContentsResponse)(CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); +typedef UINT (*pcCliprdrServerCapabilities)(CliprdrClientContext* context, + const CLIPRDR_CAPABILITIES* capabilities); +typedef UINT (*pcCliprdrClientCapabilities)(CliprdrClientContext* context, + const CLIPRDR_CAPABILITIES* capabilities); +typedef UINT (*pcCliprdrMonitorReady)(CliprdrClientContext* context, + const CLIPRDR_MONITOR_READY* monitorReady); +typedef UINT (*pcCliprdrTempDirectory)(CliprdrClientContext* context, + const CLIPRDR_TEMP_DIRECTORY* tempDirectory); +typedef UINT (*pcCliprdrClientFormatList)(CliprdrClientContext* context, + const CLIPRDR_FORMAT_LIST* formatList); +typedef UINT (*pcCliprdrServerFormatList)(CliprdrClientContext* context, + const CLIPRDR_FORMAT_LIST* formatList); +typedef UINT (*pcCliprdrClientFormatListResponse)( + CliprdrClientContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); +typedef UINT (*pcCliprdrServerFormatListResponse)( + CliprdrClientContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); +typedef UINT (*pcCliprdrClientLockClipboardData)( + CliprdrClientContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); +typedef UINT (*pcCliprdrServerLockClipboardData)( + CliprdrClientContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); +typedef UINT (*pcCliprdrClientUnlockClipboardData)( + CliprdrClientContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); +typedef UINT (*pcCliprdrServerUnlockClipboardData)( + CliprdrClientContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); +typedef UINT (*pcCliprdrClientFormatDataRequest)( + CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); +typedef UINT (*pcCliprdrServerFormatDataRequest)( + CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); +typedef UINT (*pcCliprdrClientFormatDataResponse)( + CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); +typedef UINT (*pcCliprdrServerFormatDataResponse)( + CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); +typedef UINT (*pcCliprdrClientFileContentsRequest)( + CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); +typedef UINT (*pcCliprdrServerFileContentsRequest)( + CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); +typedef UINT (*pcCliprdrClientFileContentsResponse)( + CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); +typedef UINT (*pcCliprdrServerFileContentsResponse)( + CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); struct _cliprdr_client_context { @@ -137,7 +157,6 @@ struct _RDP_CB_DATA_RESPONSE_EVENT }; typedef struct _RDP_CB_DATA_RESPONSE_EVENT RDP_CB_DATA_RESPONSE_EVENT; - struct _RDP_CB_FILECONTENTS_REQUEST_EVENT { wMessage event; @@ -165,14 +184,14 @@ struct _RDP_CB_LOCK_CLIPDATA_EVENT wMessage event; UINT32 clipDataId; }; -typedef struct _RDP_CB_LOCK_CLIPDATA_EVENT RDP_CB_LOCK_CLIPDATA_EVENT ; +typedef struct _RDP_CB_LOCK_CLIPDATA_EVENT RDP_CB_LOCK_CLIPDATA_EVENT; struct _RDP_CB_UNLOCK_CLIPDATA_EVENT { wMessage event; UINT32 clipDataId; }; -typedef struct _RDP_CB_UNLOCK_CLIPDATA_EVENT RDP_CB_UNLOCK_CLIPDATA_EVENT ; +typedef struct _RDP_CB_UNLOCK_CLIPDATA_EVENT RDP_CB_UNLOCK_CLIPDATA_EVENT; struct _RDP_CB_TEMPDIR_EVENT { diff --git a/include/freerdp/client/cmdline.h b/include/freerdp/client/cmdline.h index 76693eda4..a2bc599a9 100644 --- a/include/freerdp/client/cmdline.h +++ b/include/freerdp/client/cmdline.h @@ -26,32 +26,36 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API int freerdp_client_settings_parse_command_line_arguments( - rdpSettings* settings, int argc, char** argv, BOOL allowUnknown); -FREERDP_API int freerdp_client_settings_command_line_status_print( - rdpSettings* settings, int status, int argc, char** argv); -FREERDP_API int freerdp_client_settings_command_line_status_print_ex( - rdpSettings* settings, int status, int argc, char** argv, - COMMAND_LINE_ARGUMENT_A* custom); -FREERDP_API BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings); + FREERDP_API int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, + int argc, char** argv, + BOOL allowUnknown); + FREERDP_API int freerdp_client_settings_command_line_status_print(rdpSettings* settings, + int status, int argc, + char** argv); + FREERDP_API int freerdp_client_settings_command_line_status_print_ex( + rdpSettings* settings, int status, int argc, char** argv, COMMAND_LINE_ARGUMENT_A* custom); + FREERDP_API BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings); -FREERDP_API BOOL freerdp_client_print_version(void); -FREERDP_API BOOL freerdp_client_print_buildconfig(void); -FREERDP_API BOOL freerdp_client_print_command_line_help(int argc, char** argv); -FREERDP_API BOOL freerdp_client_print_command_line_help_ex( - int argc, char** argv, COMMAND_LINE_ARGUMENT_A* custom); + FREERDP_API BOOL freerdp_client_print_version(void); + FREERDP_API BOOL freerdp_client_print_buildconfig(void); + FREERDP_API BOOL freerdp_client_print_command_line_help(int argc, char** argv); + FREERDP_API BOOL freerdp_client_print_command_line_help_ex(int argc, char** argv, + COMMAND_LINE_ARGUMENT_A* custom); -FREERDP_API BOOL freerdp_parse_username(const char* username, char** user, char** domain); -FREERDP_API BOOL freerdp_parse_hostname(const char* hostname, char** host, int* port); -FREERDP_API BOOL freerdp_set_connection_type(rdpSettings* settings, UINT32 type); + FREERDP_API BOOL freerdp_parse_username(const char* username, char** user, char** domain); + FREERDP_API BOOL freerdp_parse_hostname(const char* hostname, char** host, int* port); + FREERDP_API BOOL freerdp_set_connection_type(rdpSettings* settings, UINT32 type); -FREERDP_API BOOL freerdp_client_add_device_channel(rdpSettings* settings, size_t count, char** params); -FREERDP_API BOOL freerdp_client_add_static_channel(rdpSettings* settings, size_t count, char** params); -FREERDP_API BOOL freerdp_client_add_dynamic_channel(rdpSettings* settings, size_t count, - char** params); + FREERDP_API BOOL freerdp_client_add_device_channel(rdpSettings* settings, size_t count, + char** params); + FREERDP_API BOOL freerdp_client_add_static_channel(rdpSettings* settings, size_t count, + char** params); + FREERDP_API BOOL freerdp_client_add_dynamic_channel(rdpSettings* settings, size_t count, + char** params); #ifdef __cplusplus } diff --git a/include/freerdp/client/disp.h b/include/freerdp/client/disp.h index 18423d715..02f876eec 100644 --- a/include/freerdp/client/disp.h +++ b/include/freerdp/client/disp.h @@ -26,11 +26,10 @@ typedef struct _disp_client_context DispClientContext; -typedef UINT(*pcDispCaps)(DispClientContext* context, UINT32 MaxNumMonitors, - UINT32 MaxMonitorAreaFactorA, - UINT32 MaxMonitorAreaFactorB); -typedef UINT(*pcDispSendMonitorLayout)(DispClientContext* context, UINT32 NumMonitors, - DISPLAY_CONTROL_MONITOR_LAYOUT* Monitors); +typedef UINT (*pcDispCaps)(DispClientContext* context, UINT32 MaxNumMonitors, + UINT32 MaxMonitorAreaFactorA, UINT32 MaxMonitorAreaFactorB); +typedef UINT (*pcDispSendMonitorLayout)(DispClientContext* context, UINT32 NumMonitors, + DISPLAY_CONTROL_MONITOR_LAYOUT* Monitors); struct _disp_client_context { diff --git a/include/freerdp/client/drdynvc.h b/include/freerdp/client/drdynvc.h index 332927cc4..e0410c82d 100644 --- a/include/freerdp/client/drdynvc.h +++ b/include/freerdp/client/drdynvc.h @@ -29,14 +29,14 @@ typedef struct _drdynvc_client_context DrdynvcClientContext; typedef int (*pcDrdynvcGetVersion)(DrdynvcClientContext* context); -typedef UINT(*pcDrdynvcOnChannelConnected)(DrdynvcClientContext* context, const char* name, - void* pInterface); -typedef UINT(*pcDrdynvcOnChannelDisconnected)(DrdynvcClientContext* context, const char* name, - void* pInterface); -typedef UINT(*pcDrdynvcOnChannelAttached)(DrdynvcClientContext* context, const char* name, - void* pInterface); -typedef UINT(*pcDrdynvcOnChannelDetached)(DrdynvcClientContext* context, const char* name, - void* pInterface); +typedef UINT (*pcDrdynvcOnChannelConnected)(DrdynvcClientContext* context, const char* name, + void* pInterface); +typedef UINT (*pcDrdynvcOnChannelDisconnected)(DrdynvcClientContext* context, const char* name, + void* pInterface); +typedef UINT (*pcDrdynvcOnChannelAttached)(DrdynvcClientContext* context, const char* name, + void* pInterface); +typedef UINT (*pcDrdynvcOnChannelDetached)(DrdynvcClientContext* context, const char* name, + void* pInterface); struct _drdynvc_client_context { diff --git a/include/freerdp/client/encomsp.h b/include/freerdp/client/encomsp.h index 0ac5a2d62..f69ef474c 100644 --- a/include/freerdp/client/encomsp.h +++ b/include/freerdp/client/encomsp.h @@ -30,17 +30,29 @@ typedef struct _encomsp_client_context EncomspClientContext; -typedef UINT (*pcEncomspFilterUpdated)(EncomspClientContext* context, ENCOMSP_FILTER_UPDATED_PDU* filterUpdated); -typedef UINT (*pcEncomspApplicationCreated)(EncomspClientContext* context, ENCOMSP_APPLICATION_CREATED_PDU* applicationCreated); -typedef UINT (*pcEncomspApplicationRemoved)(EncomspClientContext* context, ENCOMSP_APPLICATION_REMOVED_PDU* applicationRemoved); -typedef UINT (*pcEncomspWindowCreated)(EncomspClientContext* context, ENCOMSP_WINDOW_CREATED_PDU* windowCreated); -typedef UINT (*pcEncomspWindowRemoved)(EncomspClientContext* context, ENCOMSP_WINDOW_REMOVED_PDU* windowRemoved); -typedef UINT (*pcEncomspShowWindow)(EncomspClientContext* context, ENCOMSP_SHOW_WINDOW_PDU* showWindow); -typedef UINT (*pcEncomspParticipantCreated)(EncomspClientContext* context, ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated); -typedef UINT (*pcEncomspParticipantRemoved)(EncomspClientContext* context, ENCOMSP_PARTICIPANT_REMOVED_PDU* participantRemoved); -typedef UINT (*pcEncomspChangeParticipantControlLevel)(EncomspClientContext* context, ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* changeParticipantControlLevel); -typedef UINT (*pcEncomspGraphicsStreamPaused)(EncomspClientContext* context, ENCOMSP_GRAPHICS_STREAM_PAUSED_PDU* graphicsStreamPaused); -typedef UINT (*pcEncomspGraphicsStreamResumed)(EncomspClientContext* context, ENCOMSP_GRAPHICS_STREAM_RESUMED_PDU* graphicsStreamResumed); +typedef UINT (*pcEncomspFilterUpdated)(EncomspClientContext* context, + ENCOMSP_FILTER_UPDATED_PDU* filterUpdated); +typedef UINT (*pcEncomspApplicationCreated)(EncomspClientContext* context, + ENCOMSP_APPLICATION_CREATED_PDU* applicationCreated); +typedef UINT (*pcEncomspApplicationRemoved)(EncomspClientContext* context, + ENCOMSP_APPLICATION_REMOVED_PDU* applicationRemoved); +typedef UINT (*pcEncomspWindowCreated)(EncomspClientContext* context, + ENCOMSP_WINDOW_CREATED_PDU* windowCreated); +typedef UINT (*pcEncomspWindowRemoved)(EncomspClientContext* context, + ENCOMSP_WINDOW_REMOVED_PDU* windowRemoved); +typedef UINT (*pcEncomspShowWindow)(EncomspClientContext* context, + ENCOMSP_SHOW_WINDOW_PDU* showWindow); +typedef UINT (*pcEncomspParticipantCreated)(EncomspClientContext* context, + ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated); +typedef UINT (*pcEncomspParticipantRemoved)(EncomspClientContext* context, + ENCOMSP_PARTICIPANT_REMOVED_PDU* participantRemoved); +typedef UINT (*pcEncomspChangeParticipantControlLevel)( + EncomspClientContext* context, + ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* changeParticipantControlLevel); +typedef UINT (*pcEncomspGraphicsStreamPaused)( + EncomspClientContext* context, ENCOMSP_GRAPHICS_STREAM_PAUSED_PDU* graphicsStreamPaused); +typedef UINT (*pcEncomspGraphicsStreamResumed)( + EncomspClientContext* context, ENCOMSP_GRAPHICS_STREAM_RESUMED_PDU* graphicsStreamResumed); struct _encomsp_client_context { diff --git a/include/freerdp/client/file.h b/include/freerdp/client/file.h index da67a9e0c..b70d27924 100644 --- a/include/freerdp/client/file.h +++ b/include/freerdp/client/file.h @@ -30,33 +30,43 @@ typedef struct rdp_file rdpFile; typedef BOOL (*rdp_file_fkt_parse)(void* context, const char* key, char type, const char* value); #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* When using freerdp_client_parse_rdp_file_ex or freerdp_client_parse_rdp_file_buffer_ex - * set the context for the callback with this function. */ -FREERDP_API void freerdp_client_rdp_file_set_callback_context(rdpFile* file, void* context); + /* When using freerdp_client_parse_rdp_file_ex or freerdp_client_parse_rdp_file_buffer_ex + * set the context for the callback with this function. */ + FREERDP_API void freerdp_client_rdp_file_set_callback_context(rdpFile* file, void* context); -FREERDP_API BOOL freerdp_client_parse_rdp_file(rdpFile* file, const char* name); -FREERDP_API BOOL freerdp_client_parse_rdp_file_ex(rdpFile* file, const char* name, rdp_file_fkt_parse parse); -FREERDP_API BOOL freerdp_client_parse_rdp_file_buffer(rdpFile* file, const BYTE* buffer, size_t size); -FREERDP_API BOOL freerdp_client_parse_rdp_file_buffer_ex(rdpFile* file, const BYTE* buffer, size_t size, - rdp_file_fkt_parse parse); -FREERDP_API BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* settings); + FREERDP_API BOOL freerdp_client_parse_rdp_file(rdpFile* file, const char* name); + FREERDP_API BOOL freerdp_client_parse_rdp_file_ex(rdpFile* file, const char* name, + rdp_file_fkt_parse parse); + FREERDP_API BOOL freerdp_client_parse_rdp_file_buffer(rdpFile* file, const BYTE* buffer, + size_t size); + FREERDP_API BOOL freerdp_client_parse_rdp_file_buffer_ex(rdpFile* file, const BYTE* buffer, + size_t size, rdp_file_fkt_parse parse); + FREERDP_API BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, + rdpSettings* settings); -FREERDP_API BOOL freerdp_client_populate_rdp_file_from_settings(rdpFile* file, const rdpSettings* settings); -FREERDP_API BOOL freerdp_client_write_rdp_file(const rdpFile* file, const char* name, BOOL unicode); -FREERDP_API size_t freerdp_client_write_rdp_file_buffer(const rdpFile* file, char* buffer, size_t size); + FREERDP_API BOOL freerdp_client_populate_rdp_file_from_settings(rdpFile* file, + const rdpSettings* settings); + FREERDP_API BOOL freerdp_client_write_rdp_file(const rdpFile* file, const char* name, + BOOL unicode); + FREERDP_API size_t freerdp_client_write_rdp_file_buffer(const rdpFile* file, char* buffer, + size_t size); -FREERDP_API int freerdp_client_rdp_file_set_string_option(rdpFile* file, const char* name, const char* value); -FREERDP_API const char* freerdp_client_rdp_file_get_string_option(rdpFile* file, const char* name); + FREERDP_API int freerdp_client_rdp_file_set_string_option(rdpFile* file, const char* name, + const char* value); + FREERDP_API const char* freerdp_client_rdp_file_get_string_option(rdpFile* file, + const char* name); -FREERDP_API int freerdp_client_rdp_file_set_integer_option(rdpFile* file, const char* name, int value); -FREERDP_API int freerdp_client_rdp_file_get_integer_option(rdpFile* file, const char* name); + FREERDP_API int freerdp_client_rdp_file_set_integer_option(rdpFile* file, const char* name, + int value); + FREERDP_API int freerdp_client_rdp_file_get_integer_option(rdpFile* file, const char* name); -FREERDP_API rdpFile* freerdp_client_rdp_file_new(void); -FREERDP_API rdpFile* freerdp_client_rdp_file_new_ex(DWORD flags); -FREERDP_API void freerdp_client_rdp_file_free(rdpFile* file); + FREERDP_API rdpFile* freerdp_client_rdp_file_new(void); + FREERDP_API rdpFile* freerdp_client_rdp_file_new_ex(DWORD flags); + FREERDP_API void freerdp_client_rdp_file_free(rdpFile* file); #ifdef __cplusplus } diff --git a/include/freerdp/client/geometry.h b/include/freerdp/client/geometry.h index 1beee8ce5..c3dcbd615 100644 --- a/include/freerdp/client/geometry.h +++ b/include/freerdp/client/geometry.h @@ -30,9 +30,9 @@ typedef struct _geometry_client_context GeometryClientContext; typedef struct _MAPPED_GEOMETRY MAPPED_GEOMETRY; -typedef BOOL (*pcMappedGeometryAdded)(GeometryClientContext* context, MAPPED_GEOMETRY *geometry); -typedef BOOL (*pcMappedGeometryUpdate)(MAPPED_GEOMETRY *geometry); -typedef BOOL (*pcMappedGeometryClear)(MAPPED_GEOMETRY *geometry); +typedef BOOL (*pcMappedGeometryAdded)(GeometryClientContext* context, MAPPED_GEOMETRY* geometry); +typedef BOOL (*pcMappedGeometryUpdate)(MAPPED_GEOMETRY* geometry); +typedef BOOL (*pcMappedGeometryClear)(MAPPED_GEOMETRY* geometry); /** @brief a geometry record tracked by the geometry channel */ struct _MAPPED_GEOMETRY @@ -44,16 +44,15 @@ struct _MAPPED_GEOMETRY INT32 topLevelLeft, topLevelTop, topLevelRight, topLevelBottom; FREERDP_RGNDATA geometry; - void *custom; + void* custom; pcMappedGeometryUpdate MappedGeometryUpdate; pcMappedGeometryClear MappedGeometryClear; }; - /** @brief the geometry context for client channel */ struct _geometry_client_context { - wHashTable *geometries; + wHashTable* geometries; void* handle; void* custom; @@ -61,16 +60,15 @@ struct _geometry_client_context }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API void mappedGeometryRef(MAPPED_GEOMETRY *g); -FREERDP_API void mappedGeometryUnref(MAPPED_GEOMETRY *g); + FREERDP_API void mappedGeometryRef(MAPPED_GEOMETRY* g); + FREERDP_API void mappedGeometryUnref(MAPPED_GEOMETRY* g); #ifdef __cplusplus } #endif - #endif /* FREERDP_CHANNELS_CLIENT_GEOMETRY_H */ - diff --git a/include/freerdp/client/rail.h b/include/freerdp/client/rail.h index 43a8f490b..82d5a7bc9 100644 --- a/include/freerdp/client/rail.h +++ b/include/freerdp/client/rail.h @@ -31,63 +31,59 @@ * Client Interface */ -#define RAIL_SVC_CHANNEL_NAME "rail" +#define RAIL_SVC_CHANNEL_NAME "rail" typedef struct _rail_client_context RailClientContext; -typedef UINT(*pcRailClientExecute)(RailClientContext* context, const RAIL_EXEC_ORDER* exec); -typedef UINT(*pcRailClientActivate)(RailClientContext* context, - const RAIL_ACTIVATE_ORDER* activate); -typedef UINT(*pcRailClientSystemParam)(RailClientContext* context, - const RAIL_SYSPARAM_ORDER* sysparam); -typedef UINT(*pcRailServerSystemParam)(RailClientContext* context, - const RAIL_SYSPARAM_ORDER* sysparam); -typedef UINT(*pcRailClientSystemCommand)(RailClientContext* context, - const RAIL_SYSCOMMAND_ORDER* syscommand); -typedef UINT(*pcRailClientHandshake)(RailClientContext* context, - const RAIL_HANDSHAKE_ORDER* handshake); -typedef UINT(*pcRailServerHandshake)(RailClientContext* context, - const RAIL_HANDSHAKE_ORDER* handshake); -typedef UINT(*pcRailServerHandshakeEx)(RailClientContext* context, - const RAIL_HANDSHAKE_EX_ORDER* handshakeEx); -typedef UINT(*pcRailClientNotifyEvent)(RailClientContext* context, - const RAIL_NOTIFY_EVENT_ORDER* notifyEvent); -typedef UINT(*pcRailClientWindowMove)(RailClientContext* context, - const RAIL_WINDOW_MOVE_ORDER* windowMove); -typedef UINT(*pcRailServerLocalMoveSize)(RailClientContext* context, - const RAIL_LOCALMOVESIZE_ORDER* localMoveSize); -typedef UINT(*pcRailServerMinMaxInfo)(RailClientContext* context, - const RAIL_MINMAXINFO_ORDER* minMaxInfo); -typedef UINT(*pcRailClientInformation)(RailClientContext* context, - const RAIL_CLIENT_STATUS_ORDER* clientStatus); -typedef UINT(*pcRailClientSystemMenu)(RailClientContext* context, - const RAIL_SYSMENU_ORDER* sysmenu); -typedef UINT(*pcRailServerTaskBarInfo)(RailClientContext* context, - const RAIL_TASKBAR_INFO_ORDER* taskBarInfo); -typedef UINT(*pcRailClientLanguageBarInfo)(RailClientContext* context, - const RAIL_LANGBAR_INFO_ORDER* langBarInfo); -typedef UINT(*pcRailServerLanguageBarInfo)(RailClientContext* context, - const RAIL_LANGBAR_INFO_ORDER* langBarInfo); -typedef UINT(*pcRailClientLanguageIMEInfo)(RailClientContext* context, - const RAIL_LANGUAGEIME_INFO_ORDER* langBarInfo); -typedef UINT(*pcRailServerExecuteResult)(RailClientContext* context, - const RAIL_EXEC_RESULT_ORDER* execResult); -typedef UINT(*pcRailClientGetAppIdRequest)(RailClientContext* context, - const RAIL_GET_APPID_REQ_ORDER* getAppIdReq); -typedef UINT(*pcRailServerGetAppIdResponse)(RailClientContext* context, - const RAIL_GET_APPID_RESP_ORDER* getAppIdResp); -typedef UINT(*pcRailServerZOrderSync)(RailClientContext* context, - const RAIL_ZORDER_SYNC* zorder); -typedef UINT(*pcRailServerCloak)(RailClientContext* context, - const RAIL_CLOAK* cloak); -typedef UINT(*pcRailClientCloak)(RailClientContext* context, - const RAIL_CLOAK* cloak); -typedef UINT(*pcRailServerPowerDisplayRequest)(RailClientContext* context, - const RAIL_POWER_DISPLAY_REQUEST* power); -typedef UINT(*pcRailClientSnapArrange)(RailClientContext* context, - const RAIL_SNAP_ARRANGE* snap); -typedef UINT(*pcRailServerGetAppidResponseExtended)(RailClientContext* context, - const RAIL_GET_APPID_RESP_EX* id); +typedef UINT (*pcRailClientExecute)(RailClientContext* context, const RAIL_EXEC_ORDER* exec); +typedef UINT (*pcRailClientActivate)(RailClientContext* context, + const RAIL_ACTIVATE_ORDER* activate); +typedef UINT (*pcRailClientSystemParam)(RailClientContext* context, + const RAIL_SYSPARAM_ORDER* sysparam); +typedef UINT (*pcRailServerSystemParam)(RailClientContext* context, + const RAIL_SYSPARAM_ORDER* sysparam); +typedef UINT (*pcRailClientSystemCommand)(RailClientContext* context, + const RAIL_SYSCOMMAND_ORDER* syscommand); +typedef UINT (*pcRailClientHandshake)(RailClientContext* context, + const RAIL_HANDSHAKE_ORDER* handshake); +typedef UINT (*pcRailServerHandshake)(RailClientContext* context, + const RAIL_HANDSHAKE_ORDER* handshake); +typedef UINT (*pcRailServerHandshakeEx)(RailClientContext* context, + const RAIL_HANDSHAKE_EX_ORDER* handshakeEx); +typedef UINT (*pcRailClientNotifyEvent)(RailClientContext* context, + const RAIL_NOTIFY_EVENT_ORDER* notifyEvent); +typedef UINT (*pcRailClientWindowMove)(RailClientContext* context, + const RAIL_WINDOW_MOVE_ORDER* windowMove); +typedef UINT (*pcRailServerLocalMoveSize)(RailClientContext* context, + const RAIL_LOCALMOVESIZE_ORDER* localMoveSize); +typedef UINT (*pcRailServerMinMaxInfo)(RailClientContext* context, + const RAIL_MINMAXINFO_ORDER* minMaxInfo); +typedef UINT (*pcRailClientInformation)(RailClientContext* context, + const RAIL_CLIENT_STATUS_ORDER* clientStatus); +typedef UINT (*pcRailClientSystemMenu)(RailClientContext* context, + const RAIL_SYSMENU_ORDER* sysmenu); +typedef UINT (*pcRailServerTaskBarInfo)(RailClientContext* context, + const RAIL_TASKBAR_INFO_ORDER* taskBarInfo); +typedef UINT (*pcRailClientLanguageBarInfo)(RailClientContext* context, + const RAIL_LANGBAR_INFO_ORDER* langBarInfo); +typedef UINT (*pcRailServerLanguageBarInfo)(RailClientContext* context, + const RAIL_LANGBAR_INFO_ORDER* langBarInfo); +typedef UINT (*pcRailClientLanguageIMEInfo)(RailClientContext* context, + const RAIL_LANGUAGEIME_INFO_ORDER* langBarInfo); +typedef UINT (*pcRailServerExecuteResult)(RailClientContext* context, + const RAIL_EXEC_RESULT_ORDER* execResult); +typedef UINT (*pcRailClientGetAppIdRequest)(RailClientContext* context, + const RAIL_GET_APPID_REQ_ORDER* getAppIdReq); +typedef UINT (*pcRailServerGetAppIdResponse)(RailClientContext* context, + const RAIL_GET_APPID_RESP_ORDER* getAppIdResp); +typedef UINT (*pcRailServerZOrderSync)(RailClientContext* context, const RAIL_ZORDER_SYNC* zorder); +typedef UINT (*pcRailServerCloak)(RailClientContext* context, const RAIL_CLOAK* cloak); +typedef UINT (*pcRailClientCloak)(RailClientContext* context, const RAIL_CLOAK* cloak); +typedef UINT (*pcRailServerPowerDisplayRequest)(RailClientContext* context, + const RAIL_POWER_DISPLAY_REQUEST* power); +typedef UINT (*pcRailClientSnapArrange)(RailClientContext* context, const RAIL_SNAP_ARRANGE* snap); +typedef UINT (*pcRailServerGetAppidResponseExtended)(RailClientContext* context, + const RAIL_GET_APPID_RESP_EX* id); struct _rail_client_context { @@ -124,4 +120,3 @@ struct _rail_client_context }; #endif /* FREERDP_CHANNEL_RAIL_CLIENT_RAIL_H */ - diff --git a/include/freerdp/client/rdpei.h b/include/freerdp/client/rdpei.h index 3b8e961a7..fae6a00ae 100644 --- a/include/freerdp/client/rdpei.h +++ b/include/freerdp/client/rdpei.h @@ -33,9 +33,12 @@ typedef struct _rdpei_client_context RdpeiClientContext; typedef int (*pcRdpeiGetVersion)(RdpeiClientContext* context); typedef UINT (*pcRdpeiAddContact)(RdpeiClientContext* context, RDPINPUT_CONTACT_DATA* contact); -typedef UINT (*pcRdpeiTouchBegin)(RdpeiClientContext* context, int externalId, int x, int y, int* contactId); -typedef UINT (*pcRdpeiTouchUpdate)(RdpeiClientContext* context, int externalId, int x, int y, int* contactId); -typedef UINT (*pcRdpeiTouchEnd)(RdpeiClientContext* context, int externalId, int x, int y, int* contactId); +typedef UINT (*pcRdpeiTouchBegin)(RdpeiClientContext* context, int externalId, int x, int y, + int* contactId); +typedef UINT (*pcRdpeiTouchUpdate)(RdpeiClientContext* context, int externalId, int x, int y, + int* contactId); +typedef UINT (*pcRdpeiTouchEnd)(RdpeiClientContext* context, int externalId, int x, int y, + int* contactId); typedef UINT (*pcRdpeiSuspendTouch)(RdpeiClientContext* context); typedef UINT (*pcRdpeiResumeTouch)(RdpeiClientContext* context); diff --git a/include/freerdp/client/rdpgfx.h b/include/freerdp/client/rdpgfx.h index af90520f6..dfc123c9d 100644 --- a/include/freerdp/client/rdpgfx.h +++ b/include/freerdp/client/rdpgfx.h @@ -31,73 +31,70 @@ typedef struct _rdpgfx_client_context RdpgfxClientContext; -typedef UINT(*pcRdpgfxResetGraphics)(RdpgfxClientContext* context, - const RDPGFX_RESET_GRAPHICS_PDU* resetGraphics); -typedef UINT(*pcRdpgfxStartFrame)(RdpgfxClientContext* context, - const RDPGFX_START_FRAME_PDU* startFrame); -typedef UINT(*pcRdpgfxEndFrame)(RdpgfxClientContext* context, - const RDPGFX_END_FRAME_PDU* endFrame); -typedef UINT(*pcRdpgfxSurfaceCommand)(RdpgfxClientContext* context, - const RDPGFX_SURFACE_COMMAND* cmd); -typedef UINT(*pcRdpgfxDeleteEncodingContext)(RdpgfxClientContext* context, - const RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext); -typedef UINT(*pcRdpgfxCreateSurface)(RdpgfxClientContext* context, - const RDPGFX_CREATE_SURFACE_PDU* createSurface); -typedef UINT(*pcRdpgfxDeleteSurface)(RdpgfxClientContext* context, - const RDPGFX_DELETE_SURFACE_PDU* deleteSurface); -typedef UINT(*pcRdpgfxSolidFill)(RdpgfxClientContext* context, - const RDPGFX_SOLID_FILL_PDU* solidFill); -typedef UINT(*pcRdpgfxSurfaceToSurface)(RdpgfxClientContext* context, - const RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface); -typedef UINT(*pcRdpgfxSurfaceToCache)(RdpgfxClientContext* context, - const RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache); -typedef UINT(*pcRdpgfxCacheToSurface)(RdpgfxClientContext* context, - const RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface); -typedef UINT(*pcRdpgfxCacheImportOffer)(RdpgfxClientContext* context, - const RDPGFX_CACHE_IMPORT_OFFER_PDU* cacheImportOffer); -typedef UINT(*pcRdpgfxCacheImportReply)(RdpgfxClientContext* context, - const RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply); -typedef UINT(*pcRdpgfxEvictCacheEntry)(RdpgfxClientContext* context, - const RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry); -typedef UINT(*pcRdpgfxMapSurfaceToOutput)(RdpgfxClientContext* context, - const RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput); -typedef UINT(*pcRdpgfxMapSurfaceToScaledOutput)(RdpgfxClientContext* context, - const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* surfaceToOutput); -typedef UINT(*pcRdpgfxMapSurfaceToWindow)(RdpgfxClientContext* context, - const RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow); -typedef UINT(*pcRdpgfxMapSurfaceToScaledWindow)(RdpgfxClientContext* context, - const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* surfaceToWindow); -typedef UINT(*pcRdpgfxSetSurfaceData)(RdpgfxClientContext* context, - UINT16 surfaceId, void* pData); -typedef void* (*pcRdpgfxGetSurfaceData)(RdpgfxClientContext* context, - UINT16 surfaceId); -typedef UINT(*pcRdpgfxGetSurfaceIds)(RdpgfxClientContext* context, - UINT16** ppSurfaceIds, UINT16* count); -typedef UINT(*pcRdpgfxSetCacheSlotData)(RdpgfxClientContext* context, - UINT16 cacheSlot, void* pData); -typedef void* (*pcRdpgfxGetCacheSlotData)(RdpgfxClientContext* context, - UINT16 cacheSlot); +typedef UINT (*pcRdpgfxResetGraphics)(RdpgfxClientContext* context, + const RDPGFX_RESET_GRAPHICS_PDU* resetGraphics); +typedef UINT (*pcRdpgfxStartFrame)(RdpgfxClientContext* context, + const RDPGFX_START_FRAME_PDU* startFrame); +typedef UINT (*pcRdpgfxEndFrame)(RdpgfxClientContext* context, + const RDPGFX_END_FRAME_PDU* endFrame); +typedef UINT (*pcRdpgfxSurfaceCommand)(RdpgfxClientContext* context, + const RDPGFX_SURFACE_COMMAND* cmd); +typedef UINT (*pcRdpgfxDeleteEncodingContext)( + RdpgfxClientContext* context, const RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext); +typedef UINT (*pcRdpgfxCreateSurface)(RdpgfxClientContext* context, + const RDPGFX_CREATE_SURFACE_PDU* createSurface); +typedef UINT (*pcRdpgfxDeleteSurface)(RdpgfxClientContext* context, + const RDPGFX_DELETE_SURFACE_PDU* deleteSurface); +typedef UINT (*pcRdpgfxSolidFill)(RdpgfxClientContext* context, + const RDPGFX_SOLID_FILL_PDU* solidFill); +typedef UINT (*pcRdpgfxSurfaceToSurface)(RdpgfxClientContext* context, + const RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface); +typedef UINT (*pcRdpgfxSurfaceToCache)(RdpgfxClientContext* context, + const RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache); +typedef UINT (*pcRdpgfxCacheToSurface)(RdpgfxClientContext* context, + const RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface); +typedef UINT (*pcRdpgfxCacheImportOffer)(RdpgfxClientContext* context, + const RDPGFX_CACHE_IMPORT_OFFER_PDU* cacheImportOffer); +typedef UINT (*pcRdpgfxCacheImportReply)(RdpgfxClientContext* context, + const RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply); +typedef UINT (*pcRdpgfxEvictCacheEntry)(RdpgfxClientContext* context, + const RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry); +typedef UINT (*pcRdpgfxMapSurfaceToOutput)(RdpgfxClientContext* context, + const RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput); +typedef UINT (*pcRdpgfxMapSurfaceToScaledOutput)( + RdpgfxClientContext* context, const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* surfaceToOutput); +typedef UINT (*pcRdpgfxMapSurfaceToWindow)(RdpgfxClientContext* context, + const RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow); +typedef UINT (*pcRdpgfxMapSurfaceToScaledWindow)( + RdpgfxClientContext* context, const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* surfaceToWindow); +typedef UINT (*pcRdpgfxSetSurfaceData)(RdpgfxClientContext* context, UINT16 surfaceId, void* pData); +typedef void* (*pcRdpgfxGetSurfaceData)(RdpgfxClientContext* context, UINT16 surfaceId); +typedef UINT (*pcRdpgfxGetSurfaceIds)(RdpgfxClientContext* context, UINT16** ppSurfaceIds, + UINT16* count); +typedef UINT (*pcRdpgfxSetCacheSlotData)(RdpgfxClientContext* context, UINT16 cacheSlot, + void* pData); +typedef void* (*pcRdpgfxGetCacheSlotData)(RdpgfxClientContext* context, UINT16 cacheSlot); -typedef UINT(*pcRdpgfxUpdateSurfaces)(RdpgfxClientContext* context); +typedef UINT (*pcRdpgfxUpdateSurfaces)(RdpgfxClientContext* context); -typedef UINT(*pcRdpgfxUpdateSurfaceArea)(RdpgfxClientContext* context, UINT16 surfaceId, - UINT32 nrRects, const RECTANGLE_16* rects); +typedef UINT (*pcRdpgfxUpdateSurfaceArea)(RdpgfxClientContext* context, UINT16 surfaceId, + UINT32 nrRects, const RECTANGLE_16* rects); -typedef UINT(*pcRdpgfxOnOpen)(RdpgfxClientContext* context, BOOL* do_caps_advertise, - BOOL* do_frame_acks); -typedef UINT(*pcRdpgfxOnClose)(RdpgfxClientContext* context); -typedef UINT(*pcRdpgfxCapsAdvertise)(RdpgfxClientContext* context, - const RDPGFX_CAPS_ADVERTISE_PDU* capsAdvertise); -typedef UINT(*pcRdpgfxCapsConfirm)(RdpgfxClientContext* context, - const RDPGFX_CAPS_CONFIRM_PDU* capsConfirm); -typedef UINT(*pcRdpgfxFrameAcknowledge)(RdpgfxClientContext* context, - const RDPGFX_FRAME_ACKNOWLEDGE_PDU* frameAcknowledge); -typedef UINT(*pcRdpgfxQoeFrameAcknowledge)(RdpgfxClientContext* context, - const RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU* qoeFrameAcknowledge); +typedef UINT (*pcRdpgfxOnOpen)(RdpgfxClientContext* context, BOOL* do_caps_advertise, + BOOL* do_frame_acks); +typedef UINT (*pcRdpgfxOnClose)(RdpgfxClientContext* context); +typedef UINT (*pcRdpgfxCapsAdvertise)(RdpgfxClientContext* context, + const RDPGFX_CAPS_ADVERTISE_PDU* capsAdvertise); +typedef UINT (*pcRdpgfxCapsConfirm)(RdpgfxClientContext* context, + const RDPGFX_CAPS_CONFIRM_PDU* capsConfirm); +typedef UINT (*pcRdpgfxFrameAcknowledge)(RdpgfxClientContext* context, + const RDPGFX_FRAME_ACKNOWLEDGE_PDU* frameAcknowledge); +typedef UINT (*pcRdpgfxQoeFrameAcknowledge)( + RdpgfxClientContext* context, const RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU* qoeFrameAcknowledge); -typedef UINT(*pcRdpgfxMapWindowForSurface)(RdpgfxClientContext* context, UINT16 surfaceID, - UINT64 windowID); -typedef UINT(*pcRdpgfxUnmapWindowForSurface)(RdpgfxClientContext* context, UINT64 windowID); +typedef UINT (*pcRdpgfxMapWindowForSurface)(RdpgfxClientContext* context, UINT16 surfaceID, + UINT64 windowID); +typedef UINT (*pcRdpgfxUnmapWindowForSurface)(RdpgfxClientContext* context, UINT64 windowID); struct _rdpgfx_client_context { diff --git a/include/freerdp/client/rdpsnd.h b/include/freerdp/client/rdpsnd.h index 99c8016a2..6b491e834 100644 --- a/include/freerdp/client/rdpsnd.h +++ b/include/freerdp/client/rdpsnd.h @@ -66,6 +66,6 @@ struct _FREERDP_RDPSND_DEVICE_ENTRY_POINTS typedef struct _FREERDP_RDPSND_DEVICE_ENTRY_POINTS FREERDP_RDPSND_DEVICE_ENTRY_POINTS; typedef FREERDP_RDPSND_DEVICE_ENTRY_POINTS* PFREERDP_RDPSND_DEVICE_ENTRY_POINTS; -typedef UINT(*PFREERDP_RDPSND_DEVICE_ENTRY)(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints); +typedef UINT (*PFREERDP_RDPSND_DEVICE_ENTRY)(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints); #endif /* FREERDP_CHANNEL_RDPSND_CLIENT_RDPSND_H */ diff --git a/include/freerdp/client/remdesk.h b/include/freerdp/client/remdesk.h index dae72f8de..58a10ba10 100644 --- a/include/freerdp/client/remdesk.h +++ b/include/freerdp/client/remdesk.h @@ -35,4 +35,3 @@ struct _remdesk_client_context }; #endif /* FREERDP_CHANNEL_REMDESK_CLIENT_REMDESK_H */ - diff --git a/include/freerdp/client/sshagent.h b/include/freerdp/client/sshagent.h index 64ada334a..dfb27ca6c 100644 --- a/include/freerdp/client/sshagent.h +++ b/include/freerdp/client/sshagent.h @@ -28,11 +28,10 @@ typedef struct _sshagent_client_context { - int ProtocolVersion; - int MaxConnections; + int ProtocolVersion; + int MaxConnections; } SSHAgentClientContext; - /* * The channel is defined by the sshagent channel in xrdp as follows. * @@ -51,7 +50,7 @@ typedef struct _sshagent_client_context * INT32 Connection id (0, ..., SSHAGENT_MAX_CONNECTIONS - 1) * * Send data: - * + * * INT32 SA_TAG_WRITE * INT32 Connection id (0, ..., SSHAGENT_MAX_CONNECTIONS - 1) * INT32 Data length @@ -61,7 +60,7 @@ typedef struct _sshagent_client_context * * INT32 SA_TAG_CLOSE * INT32 Connection id (0, ..., SSHAGENT_MAX_CONNECTIONS - 1) - * + * * Client to server commands * ------------------------- * @@ -72,7 +71,7 @@ typedef struct _sshagent_client_context * INT32 SSHAGENT_MAX_CONNECTIONS * * Send data: - * + * * INT32 SA_TAG_WRITE * INT32 Connection id (0, ..., SSHAGENT_MAX_CONNECTIONS - 1) * INT32 Data length diff --git a/include/freerdp/client/tsmf.h b/include/freerdp/client/tsmf.h index 3730716ef..0ca4d472e 100644 --- a/include/freerdp/client/tsmf.h +++ b/include/freerdp/client/tsmf.h @@ -26,8 +26,8 @@ /* RDP_VIDEO_FRAME_EVENT.frame_pixfmt */ /* http://www.fourcc.org/yuv.php */ -#define RDP_PIXFMT_I420 0x30323449 -#define RDP_PIXFMT_YV12 0x32315659 +#define RDP_PIXFMT_I420 0x30323449 +#define RDP_PIXFMT_YV12 0x32315659 struct _TSMF_VIDEO_FRAME_EVENT { diff --git a/include/freerdp/client/video.h b/include/freerdp/client/video.h index 7ddaa5c76..5216506d7 100644 --- a/include/freerdp/client/video.h +++ b/include/freerdp/client/video.h @@ -27,27 +27,26 @@ typedef struct _VideoClientContext VideoClientContext; typedef struct _VideoClientContextPriv VideoClientContextPriv; typedef struct _VideoSurface VideoSurface; - /** @brief an implementation of surface used by the video channel */ struct _VideoSurface { UINT32 x, y, w, h; - BYTE *data; + BYTE* data; }; -typedef void (*pcVideoTimer)(VideoClientContext *video, UINT64 now); -typedef void (*pcVideoSetGeometry)(VideoClientContext *video, GeometryClientContext *geometry); -typedef VideoSurface *(*pcVideoCreateSurface)(VideoClientContext *video, BYTE *data, UINT32 x, UINT32 y, - UINT32 width, UINT32 height); -typedef BOOL (*pcVideoShowSurface)(VideoClientContext *video, VideoSurface *surface); -typedef BOOL (*pcVideoDeleteSurface)(VideoClientContext *video, VideoSurface *surface); +typedef void (*pcVideoTimer)(VideoClientContext* video, UINT64 now); +typedef void (*pcVideoSetGeometry)(VideoClientContext* video, GeometryClientContext* geometry); +typedef VideoSurface* (*pcVideoCreateSurface)(VideoClientContext* video, BYTE* data, UINT32 x, + UINT32 y, UINT32 width, UINT32 height); +typedef BOOL (*pcVideoShowSurface)(VideoClientContext* video, VideoSurface* surface); +typedef BOOL (*pcVideoDeleteSurface)(VideoClientContext* video, VideoSurface* surface); /** @brief context for the video (MS-RDPEVOR) channel */ struct _VideoClientContext { void* handle; void* custom; - VideoClientContextPriv *priv; + VideoClientContextPriv* priv; pcVideoSetGeometry setGeometry; pcVideoTimer timer; @@ -56,6 +55,4 @@ struct _VideoClientContext pcVideoDeleteSurface deleteSurface; }; - #endif /* FREERDP_CHANNELS_CLIENT_VIDEO_H */ - diff --git a/include/freerdp/codec/audio.h b/include/freerdp/codec/audio.h index 21e9fc538..e9c0408e8 100644 --- a/include/freerdp/codec/audio.h +++ b/include/freerdp/codec/audio.h @@ -42,175 +42,176 @@ struct AUDIO_FORMAT }; typedef struct AUDIO_FORMAT AUDIO_FORMAT; -#define SNDC_CLOSE 1 -#define SNDC_WAVE 2 -#define SNDC_SETVOLUME 3 -#define SNDC_SETPITCH 4 -#define SNDC_WAVECONFIRM 5 -#define SNDC_TRAINING 6 -#define SNDC_FORMATS 7 -#define SNDC_CRYPTKEY 8 -#define SNDC_WAVEENCRYPT 9 -#define SNDC_UDPWAVE 10 -#define SNDC_UDPWAVELAST 11 -#define SNDC_QUALITYMODE 12 -#define SNDC_WAVE2 13 +#define SNDC_CLOSE 1 +#define SNDC_WAVE 2 +#define SNDC_SETVOLUME 3 +#define SNDC_SETPITCH 4 +#define SNDC_WAVECONFIRM 5 +#define SNDC_TRAINING 6 +#define SNDC_FORMATS 7 +#define SNDC_CRYPTKEY 8 +#define SNDC_WAVEENCRYPT 9 +#define SNDC_UDPWAVE 10 +#define SNDC_UDPWAVELAST 11 +#define SNDC_QUALITYMODE 12 +#define SNDC_WAVE2 13 -#define TSSNDCAPS_ALIVE 1 -#define TSSNDCAPS_VOLUME 2 -#define TSSNDCAPS_PITCH 4 +#define TSSNDCAPS_ALIVE 1 +#define TSSNDCAPS_VOLUME 2 +#define TSSNDCAPS_PITCH 4 -#define DYNAMIC_QUALITY 0x0000 -#define MEDIUM_QUALITY 0x0001 -#define HIGH_QUALITY 0x0002 +#define DYNAMIC_QUALITY 0x0000 +#define MEDIUM_QUALITY 0x0001 +#define HIGH_QUALITY 0x0002 /* * Format Tags: * http://tools.ietf.org/html/rfc2361 */ -#define WAVE_FORMAT_UNKNOWN 0x0000 +#define WAVE_FORMAT_UNKNOWN 0x0000 #ifndef WAVE_FORMAT_PCM -#define WAVE_FORMAT_PCM 0x0001 +#define WAVE_FORMAT_PCM 0x0001 #endif -#define WAVE_FORMAT_ADPCM 0x0002 -#define WAVE_FORMAT_IEEE_FLOAT 0x0003 -#define WAVE_FORMAT_VSELP 0x0004 -#define WAVE_FORMAT_IBM_CVSD 0x0005 -#define WAVE_FORMAT_ALAW 0x0006 -#define WAVE_FORMAT_MULAW 0x0007 -#define WAVE_FORMAT_OKI_ADPCM 0x0010 -#define WAVE_FORMAT_DVI_ADPCM 0x0011 -#define WAVE_FORMAT_MEDIASPACE_ADPCM 0x0012 -#define WAVE_FORMAT_SIERRA_ADPCM 0x0013 -#define WAVE_FORMAT_G723_ADPCM 0x0014 -#define WAVE_FORMAT_DIGISTD 0x0015 -#define WAVE_FORMAT_DIGIFIX 0x0016 -#define WAVE_FORMAT_DIALOGIC_OKI_ADPCM 0x0017 -#define WAVE_FORMAT_MEDIAVISION_ADPCM 0x0018 -#define WAVE_FORMAT_CU_CODEC 0x0019 -#define WAVE_FORMAT_YAMAHA_ADPCM 0x0020 -#define WAVE_FORMAT_SONARC 0x0021 -#define WAVE_FORMAT_DSPGROUP_TRUESPEECH 0x0022 -#define WAVE_FORMAT_ECHOSC1 0x0023 -#define WAVE_FORMAT_AUDIOFILE_AF36 0x0024 -#define WAVE_FORMAT_APTX 0x0025 -#define WAVE_FORMAT_AUDIOFILE_AF10 0x0026 -#define WAVE_FORMAT_PROSODY_1612 0x0027 -#define WAVE_FORMAT_LRC 0x0028 -#define WAVE_FORMAT_DOLBY_AC2 0x0030 -#define WAVE_FORMAT_GSM610 0x0031 -#define WAVE_FORMAT_MSNAUDIO 0x0032 -#define WAVE_FORMAT_ANTEX_ADPCME 0x0033 -#define WAVE_FORMAT_CONTROL_RES_VQLPC 0x0034 -#define WAVE_FORMAT_DIGIREAL 0x0035 -#define WAVE_FORMAT_DIGIADPCM 0x0036 -#define WAVE_FORMAT_CONTROL_RES_CR10 0x0037 -#define WAVE_FORMAT_NMS_VBXADPCM 0x0038 -#define WAVE_FORMAT_ROLAND_RDAC 0x0039 -#define WAVE_FORMAT_ECHOSC3 0x003A -#define WAVE_FORMAT_ROCKWELL_ADPCM 0x003B -#define WAVE_FORMAT_ROCKWELL_DIGITALK 0x003C -#define WAVE_FORMAT_XEBEC 0x003D -#define WAVE_FORMAT_G721_ADPCM 0x0040 -#define WAVE_FORMAT_G728_CELP 0x0041 -#define WAVE_FORMAT_MSG723 0x0042 -#define WAVE_FORMAT_MPEG 0x0050 -#define WAVE_FORMAT_RT24 0x0052 -#define WAVE_FORMAT_PAC 0x0053 +#define WAVE_FORMAT_ADPCM 0x0002 +#define WAVE_FORMAT_IEEE_FLOAT 0x0003 +#define WAVE_FORMAT_VSELP 0x0004 +#define WAVE_FORMAT_IBM_CVSD 0x0005 +#define WAVE_FORMAT_ALAW 0x0006 +#define WAVE_FORMAT_MULAW 0x0007 +#define WAVE_FORMAT_OKI_ADPCM 0x0010 +#define WAVE_FORMAT_DVI_ADPCM 0x0011 +#define WAVE_FORMAT_MEDIASPACE_ADPCM 0x0012 +#define WAVE_FORMAT_SIERRA_ADPCM 0x0013 +#define WAVE_FORMAT_G723_ADPCM 0x0014 +#define WAVE_FORMAT_DIGISTD 0x0015 +#define WAVE_FORMAT_DIGIFIX 0x0016 +#define WAVE_FORMAT_DIALOGIC_OKI_ADPCM 0x0017 +#define WAVE_FORMAT_MEDIAVISION_ADPCM 0x0018 +#define WAVE_FORMAT_CU_CODEC 0x0019 +#define WAVE_FORMAT_YAMAHA_ADPCM 0x0020 +#define WAVE_FORMAT_SONARC 0x0021 +#define WAVE_FORMAT_DSPGROUP_TRUESPEECH 0x0022 +#define WAVE_FORMAT_ECHOSC1 0x0023 +#define WAVE_FORMAT_AUDIOFILE_AF36 0x0024 +#define WAVE_FORMAT_APTX 0x0025 +#define WAVE_FORMAT_AUDIOFILE_AF10 0x0026 +#define WAVE_FORMAT_PROSODY_1612 0x0027 +#define WAVE_FORMAT_LRC 0x0028 +#define WAVE_FORMAT_DOLBY_AC2 0x0030 +#define WAVE_FORMAT_GSM610 0x0031 +#define WAVE_FORMAT_MSNAUDIO 0x0032 +#define WAVE_FORMAT_ANTEX_ADPCME 0x0033 +#define WAVE_FORMAT_CONTROL_RES_VQLPC 0x0034 +#define WAVE_FORMAT_DIGIREAL 0x0035 +#define WAVE_FORMAT_DIGIADPCM 0x0036 +#define WAVE_FORMAT_CONTROL_RES_CR10 0x0037 +#define WAVE_FORMAT_NMS_VBXADPCM 0x0038 +#define WAVE_FORMAT_ROLAND_RDAC 0x0039 +#define WAVE_FORMAT_ECHOSC3 0x003A +#define WAVE_FORMAT_ROCKWELL_ADPCM 0x003B +#define WAVE_FORMAT_ROCKWELL_DIGITALK 0x003C +#define WAVE_FORMAT_XEBEC 0x003D +#define WAVE_FORMAT_G721_ADPCM 0x0040 +#define WAVE_FORMAT_G728_CELP 0x0041 +#define WAVE_FORMAT_MSG723 0x0042 +#define WAVE_FORMAT_MPEG 0x0050 +#define WAVE_FORMAT_RT24 0x0052 +#define WAVE_FORMAT_PAC 0x0053 #ifndef WAVE_FORMAT_MPEGLAYER3 -#define WAVE_FORMAT_MPEGLAYER3 0x0055 +#define WAVE_FORMAT_MPEGLAYER3 0x0055 #endif -#define WAVE_FORMAT_LUCENT_G723 0x0059 -#define WAVE_FORMAT_CIRRUS 0x0060 -#define WAVE_FORMAT_ESPCM 0x0061 -#define WAVE_FORMAT_VOXWARE 0x0062 -#define WAVE_FORMAT_CANOPUS_ATRAC 0x0063 -#define WAVE_FORMAT_G726_ADPCM 0x0064 -#define WAVE_FORMAT_G722_ADPCM 0x0065 -#define WAVE_FORMAT_DSAT 0x0066 -#define WAVE_FORMAT_DSAT_DISPLAY 0x0067 -#define WAVE_FORMAT_VOXWARE_BYTE_ALIGNED 0x0069 -#define WAVE_FORMAT_VOXWARE_AC8 0x0070 -#define WAVE_FORMAT_VOXWARE_AC10 0x0071 -#define WAVE_FORMAT_VOXWARE_AC16 0x0072 -#define WAVE_FORMAT_VOXWARE_AC20 0x0073 -#define WAVE_FORMAT_VOXWARE_RT24 0x0074 -#define WAVE_FORMAT_VOXWARE_RT29 0x0075 -#define WAVE_FORMAT_VOXWARE_RT29HW 0x0076 -#define WAVE_FORMAT_VOXWARE_VR12 0x0077 -#define WAVE_FORMAT_VOXWARE_VR18 0x0078 -#define WAVE_FORMAT_VOXWARE_TQ40 0x0079 -#define WAVE_FORMAT_SOFTSOUND 0x0080 -#define WAVE_FORMAT_VOXWARE_TQ60 0x0081 -#define WAVE_FORMAT_MSRT24 0x0082 -#define WAVE_FORMAT_G729A 0x0083 -#define WAVE_FORMAT_MVI_MV12 0x0084 -#define WAVE_FORMAT_DF_G726 0x0085 -#define WAVE_FORMAT_DF_GSM610 0x0086 -#define WAVE_FORMAT_ISIAUDIO 0x0088 -#define WAVE_FORMAT_ONLIVE 0x0089 -#define WAVE_FORMAT_SBC24 0x0091 -#define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092 -#define WAVE_FORMAT_ZYXEL_ADPCM 0x0097 -#define WAVE_FORMAT_PHILIPS_LPCBB 0x0098 -#define WAVE_FORMAT_PACKED 0x0099 -#define WAVE_FORMAT_RHETOREX_ADPCM 0x0100 -#define WAVE_FORMAT_IRAT 0x0101 -#define WAVE_FORMAT_VIVO_G723 0x0111 -#define WAVE_FORMAT_VIVO_SIREN 0x0112 -#define WAVE_FORMAT_DIGITAL_G723 0x0123 -#define WAVE_FORMAT_WMAUDIO2 0x0161 -#define WAVE_FORMAT_WMAUDIO3 0x0162 -#define WAVE_FORMAT_WMAUDIO_LOSSLESS 0x0163 -#define WAVE_FORMAT_CREATIVE_ADPCM 0x0200 -#define WAVE_FORMAT_CREATIVE_FASTSPEECH8 0x0202 -#define WAVE_FORMAT_CREATIVE_FASTSPEECH10 0x0203 -#define WAVE_FORMAT_QUARTERDECK 0x0220 -#define WAVE_FORMAT_FM_TOWNS_SND 0x0300 -#define WAVE_FORMAT_BTV_DIGITAL 0x0400 -#define WAVE_FORMAT_VME_VMPCM 0x0680 -#define WAVE_FORMAT_OLIGSM 0x1000 -#define WAVE_FORMAT_OLIADPCM 0x1001 -#define WAVE_FORMAT_OLICELP 0x1002 -#define WAVE_FORMAT_OLISBC 0x1003 -#define WAVE_FORMAT_OLIOPR 0x1004 -#define WAVE_FORMAT_LH_CODEC 0x1100 -#define WAVE_FORMAT_NORRIS 0x1400 -#define WAVE_FORMAT_SOUNDSPACE_MUSICOMPRESS 0x1500 -#define WAVE_FORMAT_DVM 0x2000 -#define WAVE_FORMAT_AAC_MS 0xA106 +#define WAVE_FORMAT_LUCENT_G723 0x0059 +#define WAVE_FORMAT_CIRRUS 0x0060 +#define WAVE_FORMAT_ESPCM 0x0061 +#define WAVE_FORMAT_VOXWARE 0x0062 +#define WAVE_FORMAT_CANOPUS_ATRAC 0x0063 +#define WAVE_FORMAT_G726_ADPCM 0x0064 +#define WAVE_FORMAT_G722_ADPCM 0x0065 +#define WAVE_FORMAT_DSAT 0x0066 +#define WAVE_FORMAT_DSAT_DISPLAY 0x0067 +#define WAVE_FORMAT_VOXWARE_BYTE_ALIGNED 0x0069 +#define WAVE_FORMAT_VOXWARE_AC8 0x0070 +#define WAVE_FORMAT_VOXWARE_AC10 0x0071 +#define WAVE_FORMAT_VOXWARE_AC16 0x0072 +#define WAVE_FORMAT_VOXWARE_AC20 0x0073 +#define WAVE_FORMAT_VOXWARE_RT24 0x0074 +#define WAVE_FORMAT_VOXWARE_RT29 0x0075 +#define WAVE_FORMAT_VOXWARE_RT29HW 0x0076 +#define WAVE_FORMAT_VOXWARE_VR12 0x0077 +#define WAVE_FORMAT_VOXWARE_VR18 0x0078 +#define WAVE_FORMAT_VOXWARE_TQ40 0x0079 +#define WAVE_FORMAT_SOFTSOUND 0x0080 +#define WAVE_FORMAT_VOXWARE_TQ60 0x0081 +#define WAVE_FORMAT_MSRT24 0x0082 +#define WAVE_FORMAT_G729A 0x0083 +#define WAVE_FORMAT_MVI_MV12 0x0084 +#define WAVE_FORMAT_DF_G726 0x0085 +#define WAVE_FORMAT_DF_GSM610 0x0086 +#define WAVE_FORMAT_ISIAUDIO 0x0088 +#define WAVE_FORMAT_ONLIVE 0x0089 +#define WAVE_FORMAT_SBC24 0x0091 +#define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092 +#define WAVE_FORMAT_ZYXEL_ADPCM 0x0097 +#define WAVE_FORMAT_PHILIPS_LPCBB 0x0098 +#define WAVE_FORMAT_PACKED 0x0099 +#define WAVE_FORMAT_RHETOREX_ADPCM 0x0100 +#define WAVE_FORMAT_IRAT 0x0101 +#define WAVE_FORMAT_VIVO_G723 0x0111 +#define WAVE_FORMAT_VIVO_SIREN 0x0112 +#define WAVE_FORMAT_DIGITAL_G723 0x0123 +#define WAVE_FORMAT_WMAUDIO2 0x0161 +#define WAVE_FORMAT_WMAUDIO3 0x0162 +#define WAVE_FORMAT_WMAUDIO_LOSSLESS 0x0163 +#define WAVE_FORMAT_CREATIVE_ADPCM 0x0200 +#define WAVE_FORMAT_CREATIVE_FASTSPEECH8 0x0202 +#define WAVE_FORMAT_CREATIVE_FASTSPEECH10 0x0203 +#define WAVE_FORMAT_QUARTERDECK 0x0220 +#define WAVE_FORMAT_FM_TOWNS_SND 0x0300 +#define WAVE_FORMAT_BTV_DIGITAL 0x0400 +#define WAVE_FORMAT_VME_VMPCM 0x0680 +#define WAVE_FORMAT_OLIGSM 0x1000 +#define WAVE_FORMAT_OLIADPCM 0x1001 +#define WAVE_FORMAT_OLICELP 0x1002 +#define WAVE_FORMAT_OLISBC 0x1003 +#define WAVE_FORMAT_OLIOPR 0x1004 +#define WAVE_FORMAT_LH_CODEC 0x1100 +#define WAVE_FORMAT_NORRIS 0x1400 +#define WAVE_FORMAT_SOUNDSPACE_MUSICOMPRESS 0x1500 +#define WAVE_FORMAT_DVM 0x2000 +#define WAVE_FORMAT_AAC_MS 0xA106 /** * Audio Format Functions */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API UINT32 audio_format_compute_time_length(const AUDIO_FORMAT* format, size_t size); + FREERDP_API UINT32 audio_format_compute_time_length(const AUDIO_FORMAT* format, size_t size); -FREERDP_API char* audio_format_get_tag_string(UINT16 wFormatTag); + FREERDP_API char* audio_format_get_tag_string(UINT16 wFormatTag); -FREERDP_API void audio_format_print(wLog* log, DWORD level, const AUDIO_FORMAT* format); -FREERDP_API void audio_formats_print(wLog* log, DWORD level, const AUDIO_FORMAT* formats, - UINT16 count); + FREERDP_API void audio_format_print(wLog* log, DWORD level, const AUDIO_FORMAT* format); + FREERDP_API void audio_formats_print(wLog* log, DWORD level, const AUDIO_FORMAT* formats, + UINT16 count); -FREERDP_API BOOL audio_format_read(wStream* s, AUDIO_FORMAT* format); -FREERDP_API BOOL audio_format_write(wStream* s, const AUDIO_FORMAT* format); -FREERDP_API BOOL audio_format_copy(const AUDIO_FORMAT* srcFormat, AUDIO_FORMAT* dstFormat); -FREERDP_API BOOL audio_format_compatible(const AUDIO_FORMAT* with, const AUDIO_FORMAT* what); + FREERDP_API BOOL audio_format_read(wStream* s, AUDIO_FORMAT* format); + FREERDP_API BOOL audio_format_write(wStream* s, const AUDIO_FORMAT* format); + FREERDP_API BOOL audio_format_copy(const AUDIO_FORMAT* srcFormat, AUDIO_FORMAT* dstFormat); + FREERDP_API BOOL audio_format_compatible(const AUDIO_FORMAT* with, const AUDIO_FORMAT* what); -FREERDP_API AUDIO_FORMAT* audio_format_new(void); -FREERDP_API AUDIO_FORMAT* audio_formats_new(size_t count); + FREERDP_API AUDIO_FORMAT* audio_format_new(void); + FREERDP_API AUDIO_FORMAT* audio_formats_new(size_t count); -FREERDP_API void audio_format_free(AUDIO_FORMAT* format); -FREERDP_API void audio_formats_free(AUDIO_FORMAT* formats, size_t count); + FREERDP_API void audio_format_free(AUDIO_FORMAT* format); + FREERDP_API void audio_formats_free(AUDIO_FORMAT* formats, size_t count); #ifdef __cplusplus } diff --git a/include/freerdp/codec/bitmap.h b/include/freerdp/codec/bitmap.h index 6509e255d..d64bbef7c 100644 --- a/include/freerdp/codec/bitmap.h +++ b/include/freerdp/codec/bitmap.h @@ -29,11 +29,13 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API SSIZE_T freerdp_bitmap_compress(const void* in_data, UINT32 width, UINT32 height, - wStream* s, UINT32 bpp, UINT32 byte_limit, UINT32 start_line, wStream* temp_s, UINT32 e); + FREERDP_API SSIZE_T freerdp_bitmap_compress(const void* in_data, UINT32 width, UINT32 height, + wStream* s, UINT32 bpp, UINT32 byte_limit, + UINT32 start_line, wStream* temp_s, UINT32 e); #ifdef __cplusplus } diff --git a/include/freerdp/codec/bulk.h b/include/freerdp/codec/bulk.h index ccc6a4d85..6f20c8061 100644 --- a/include/freerdp/codec/bulk.h +++ b/include/freerdp/codec/bulk.h @@ -25,16 +25,15 @@ /* Level-2 Compression Flags */ -#define PACKET_COMPRESSED 0x20 -#define PACKET_AT_FRONT 0x40 -#define PACKET_FLUSHED 0x80 +#define PACKET_COMPRESSED 0x20 +#define PACKET_AT_FRONT 0x40 +#define PACKET_FLUSHED 0x80 /* Level-1 Compression Flags */ -#define L1_PACKET_AT_FRONT 0x04 -#define L1_NO_COMPRESSION 0x02 -#define L1_COMPRESSED 0x01 -#define L1_INNER_COMPRESSION 0x10 +#define L1_PACKET_AT_FRONT 0x04 +#define L1_NO_COMPRESSION 0x02 +#define L1_COMPRESSED 0x01 +#define L1_INNER_COMPRESSION 0x10 #endif /* FREERDP_CODEC_BULK_H */ - diff --git a/include/freerdp/codec/clear.h b/include/freerdp/codec/clear.h index 55b841b07..84393086a 100644 --- a/include/freerdp/codec/clear.h +++ b/include/freerdp/codec/clear.h @@ -29,26 +29,26 @@ typedef struct _CLEAR_CONTEXT CLEAR_CONTEXT; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API int clear_compress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, - UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize); + FREERDP_API int clear_compress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, UINT32 SrcSize, + BYTE** ppDstData, UINT32* pDstSize); -FREERDP_API INT32 clear_decompress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, - UINT32 SrcSize, UINT32 nWidth, UINT32 nHeight, - BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, - UINT32 nXDst, UINT32 nYDst, UINT32 nDstWidth, UINT32 nDstHeight, - const gdiPalette* palette); + FREERDP_API INT32 clear_decompress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, UINT32 SrcSize, + UINT32 nWidth, UINT32 nHeight, BYTE* pDstData, + UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, + UINT32 nYDst, UINT32 nDstWidth, UINT32 nDstHeight, + const gdiPalette* palette); -FREERDP_API BOOL clear_context_reset(CLEAR_CONTEXT* clear); + FREERDP_API BOOL clear_context_reset(CLEAR_CONTEXT* clear); -FREERDP_API CLEAR_CONTEXT* clear_context_new(BOOL Compressor); -FREERDP_API void clear_context_free(CLEAR_CONTEXT* clear); + FREERDP_API CLEAR_CONTEXT* clear_context_new(BOOL Compressor); + FREERDP_API void clear_context_free(CLEAR_CONTEXT* clear); #ifdef __cplusplus } #endif #endif /* FREERDP_CODEC_CLEAR_H */ - diff --git a/include/freerdp/codec/color.h b/include/freerdp/codec/color.h index 80594dde2..127271c16 100644 --- a/include/freerdp/codec/color.h +++ b/include/freerdp/codec/color.h @@ -27,22 +27,23 @@ #include #define CTAG FREERDP_TAG("codec.color") -#define FREERDP_PIXEL_FORMAT_TYPE_A 0 -#define FREERDP_PIXEL_FORMAT_TYPE_ARGB 1 -#define FREERDP_PIXEL_FORMAT_TYPE_ABGR 2 -#define FREERDP_PIXEL_FORMAT_TYPE_RGBA 3 -#define FREERDP_PIXEL_FORMAT_TYPE_BGRA 4 +#define FREERDP_PIXEL_FORMAT_TYPE_A 0 +#define FREERDP_PIXEL_FORMAT_TYPE_ARGB 1 +#define FREERDP_PIXEL_FORMAT_TYPE_ABGR 2 +#define FREERDP_PIXEL_FORMAT_TYPE_RGBA 3 +#define FREERDP_PIXEL_FORMAT_TYPE_BGRA 4 -#define FREERDP_PIXEL_FORMAT_IS_ABGR(_format) (FREERDP_PIXEL_FORMAT_TYPE(_format) == FREERDP_PIXEL_FORMAT_TYPE_ABGR) +#define FREERDP_PIXEL_FORMAT_IS_ABGR(_format) \ + (FREERDP_PIXEL_FORMAT_TYPE(_format) == FREERDP_PIXEL_FORMAT_TYPE_ABGR) -#define FREERDP_FLIP_NONE 0 -#define FREERDP_FLIP_VERTICAL 1 -#define FREERDP_FLIP_HORIZONTAL 2 +#define FREERDP_FLIP_NONE 0 +#define FREERDP_FLIP_VERTICAL 1 +#define FREERDP_FLIP_HORIZONTAL 2 #define FREERDP_PIXEL_FORMAT(_bpp, _type, _a, _r, _g, _b) \ ((_bpp << 24) | (_type << 16) | (_a << 12) | (_r << 8) | (_g << 4) | (_b)) -#define FREERDP_PIXEL_FORMAT_TYPE(_format) (((_format) >> 16) & 0x07) +#define FREERDP_PIXEL_FORMAT_TYPE(_format) (((_format) >> 16) & 0x07) /*** Design considerations * @@ -59,35 +60,35 @@ */ /* 32bpp formats */ -#define PIXEL_FORMAT_ARGB32 FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 8, 8, 8, 8) -#define PIXEL_FORMAT_XRGB32 FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 0, 8, 8, 8) -#define PIXEL_FORMAT_ABGR32 FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 8, 8, 8, 8) -#define PIXEL_FORMAT_XBGR32 FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 0, 8, 8, 8) -#define PIXEL_FORMAT_BGRA32 FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_BGRA, 8, 8, 8, 8) -#define PIXEL_FORMAT_BGRX32 FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_BGRA, 0, 8, 8, 8) -#define PIXEL_FORMAT_RGBA32 FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_RGBA, 8, 8, 8, 8) -#define PIXEL_FORMAT_RGBX32 FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_RGBA, 0, 8, 8, 8) +#define PIXEL_FORMAT_ARGB32 FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 8, 8, 8, 8) +#define PIXEL_FORMAT_XRGB32 FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 0, 8, 8, 8) +#define PIXEL_FORMAT_ABGR32 FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 8, 8, 8, 8) +#define PIXEL_FORMAT_XBGR32 FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 0, 8, 8, 8) +#define PIXEL_FORMAT_BGRA32 FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_BGRA, 8, 8, 8, 8) +#define PIXEL_FORMAT_BGRX32 FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_BGRA, 0, 8, 8, 8) +#define PIXEL_FORMAT_RGBA32 FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_RGBA, 8, 8, 8, 8) +#define PIXEL_FORMAT_RGBX32 FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_RGBA, 0, 8, 8, 8) /* 24bpp formats */ -#define PIXEL_FORMAT_RGB24 FREERDP_PIXEL_FORMAT(24, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 0, 8, 8, 8) -#define PIXEL_FORMAT_BGR24 FREERDP_PIXEL_FORMAT(24, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 0, 8, 8, 8) +#define PIXEL_FORMAT_RGB24 FREERDP_PIXEL_FORMAT(24, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 0, 8, 8, 8) +#define PIXEL_FORMAT_BGR24 FREERDP_PIXEL_FORMAT(24, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 0, 8, 8, 8) /* 16bpp formats */ -#define PIXEL_FORMAT_RGB16 FREERDP_PIXEL_FORMAT(16, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 0, 5, 6, 5) -#define PIXEL_FORMAT_BGR16 FREERDP_PIXEL_FORMAT(16, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 0, 5, 6, 5) -#define PIXEL_FORMAT_ARGB15 FREERDP_PIXEL_FORMAT(16, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 1, 5, 5, 5) -#define PIXEL_FORMAT_RGB15 FREERDP_PIXEL_FORMAT(15, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 0, 5, 5, 5) -#define PIXEL_FORMAT_ABGR15 FREERDP_PIXEL_FORMAT(16, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 1, 5, 5, 5) -#define PIXEL_FORMAT_BGR15 FREERDP_PIXEL_FORMAT(15, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 0, 5, 5, 5) +#define PIXEL_FORMAT_RGB16 FREERDP_PIXEL_FORMAT(16, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 0, 5, 6, 5) +#define PIXEL_FORMAT_BGR16 FREERDP_PIXEL_FORMAT(16, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 0, 5, 6, 5) +#define PIXEL_FORMAT_ARGB15 FREERDP_PIXEL_FORMAT(16, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 1, 5, 5, 5) +#define PIXEL_FORMAT_RGB15 FREERDP_PIXEL_FORMAT(15, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 0, 5, 5, 5) +#define PIXEL_FORMAT_ABGR15 FREERDP_PIXEL_FORMAT(16, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 1, 5, 5, 5) +#define PIXEL_FORMAT_BGR15 FREERDP_PIXEL_FORMAT(15, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 0, 5, 5, 5) /* 8bpp formats */ -#define PIXEL_FORMAT_RGB8 FREERDP_PIXEL_FORMAT(8, FREERDP_PIXEL_FORMAT_TYPE_A, 8, 0, 0, 0) +#define PIXEL_FORMAT_RGB8 FREERDP_PIXEL_FORMAT(8, FREERDP_PIXEL_FORMAT_TYPE_A, 8, 0, 0, 0) /* 4 bpp formats */ -#define PIXEL_FORMAT_A4 FREERDP_PIXEL_FORMAT(4, FREERDP_PIXEL_FORMAT_TYPE_A, 4, 0, 0, 0) +#define PIXEL_FORMAT_A4 FREERDP_PIXEL_FORMAT(4, FREERDP_PIXEL_FORMAT_TYPE_A, 4, 0, 0, 0) /* 1bpp formats */ -#define PIXEL_FORMAT_MONO FREERDP_PIXEL_FORMAT(1, FREERDP_PIXEL_FORMAT_TYPE_A, 1, 0, 0, 0) +#define PIXEL_FORMAT_MONO FREERDP_PIXEL_FORMAT(1, FREERDP_PIXEL_FORMAT_TYPE_A, 1, 0, 0, 0) struct gdi_palette { @@ -97,444 +98,479 @@ struct gdi_palette typedef struct gdi_palette gdiPalette; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Compare two color formats but ignore differences in alpha channel. - */ -static INLINE DWORD AreColorFormatsEqualNoAlpha(DWORD first, DWORD second) -{ - const DWORD mask = ~(8 << 12); - return (first & mask) == (second & mask); -} - -/* Color Space Conversions: http://msdn.microsoft.com/en-us/library/ff566496/ */ - -/*** - * - * Get a string representation of a color - * - * @param format The pixel color format - * - * @return A string representation of format - */ -static const char* FreeRDPGetColorFormatName(UINT32 format) -{ - switch (format) + /* Compare two color formats but ignore differences in alpha channel. + */ + static INLINE DWORD AreColorFormatsEqualNoAlpha(DWORD first, DWORD second) { - /* 32bpp formats */ - case PIXEL_FORMAT_ARGB32: - return "PIXEL_FORMAT_ARGB32"; - - case PIXEL_FORMAT_XRGB32: - return "PIXEL_FORMAT_XRGB32"; - - case PIXEL_FORMAT_ABGR32: - return "PIXEL_FORMAT_ABGR32"; - - case PIXEL_FORMAT_XBGR32: - return "PIXEL_FORMAT_XBGR32"; - - case PIXEL_FORMAT_BGRA32: - return "PIXEL_FORMAT_BGRA32"; - - case PIXEL_FORMAT_BGRX32: - return "PIXEL_FORMAT_BGRX32"; - - case PIXEL_FORMAT_RGBA32: - return "PIXEL_FORMAT_RGBA32"; - - case PIXEL_FORMAT_RGBX32: - return "PIXEL_FORMAT_RGBX32"; - - /* 24bpp formats */ - case PIXEL_FORMAT_RGB24: - return "PIXEL_FORMAT_RGB24"; - - case PIXEL_FORMAT_BGR24: - return "PIXEL_FORMAT_BGR24"; - - /* 16bpp formats */ - case PIXEL_FORMAT_RGB16: - return "PIXEL_FORMAT_RGB16"; - - case PIXEL_FORMAT_BGR16: - return "PIXEL_FORMAT_BGR16"; - - case PIXEL_FORMAT_ARGB15: - return "PIXEL_FORMAT_ARGB15"; - - case PIXEL_FORMAT_RGB15: - return "PIXEL_FORMAT_RGB15"; - - case PIXEL_FORMAT_ABGR15: - return "PIXEL_FORMAT_ABGR15"; - - case PIXEL_FORMAT_BGR15: - return "PIXEL_FORMAT_BGR15"; - - /* 8bpp formats */ - case PIXEL_FORMAT_RGB8: - return "PIXEL_FORMAT_RGB8"; - - /* 4 bpp formats */ - case PIXEL_FORMAT_A4: - return "PIXEL_FORMAT_A4"; - - /* 1bpp formats */ - case PIXEL_FORMAT_MONO: - return "PIXEL_FORMAT_MONO"; - - default: - return "UNKNOWN"; + const DWORD mask = ~(8 << 12); + return (first & mask) == (second & mask); } -} -/*** - * - * Converts a pixel color in internal representation to its red, green, blue - * and alpha components. - * - * @param color The color in format internal representation - * @param format one of PIXEL_FORMAT_* color format defines - * @param _r red color value - * @param _g green color value - * @param _b blue color value - * @param _a alpha color value - * @param palette pallete to use (only used for 8 bit color!) - */ -static INLINE void SplitColor(UINT32 color, UINT32 format, BYTE* _r, BYTE* _g, - BYTE* _b, BYTE* _a, const gdiPalette* palette) -{ - UINT32 tmp; + /* Color Space Conversions: http://msdn.microsoft.com/en-us/library/ff566496/ */ - switch (format) + /*** + * + * Get a string representation of a color + * + * @param format The pixel color format + * + * @return A string representation of format + */ + static const char* FreeRDPGetColorFormatName(UINT32 format) { - /* 32bpp formats */ - case PIXEL_FORMAT_ARGB32: - if (_a) - *_a = (BYTE)(color >> 24); + switch (format) + { + /* 32bpp formats */ + case PIXEL_FORMAT_ARGB32: + return "PIXEL_FORMAT_ARGB32"; - if (_r) - *_r = (BYTE)(color >> 16); + case PIXEL_FORMAT_XRGB32: + return "PIXEL_FORMAT_XRGB32"; + + case PIXEL_FORMAT_ABGR32: + return "PIXEL_FORMAT_ABGR32"; + + case PIXEL_FORMAT_XBGR32: + return "PIXEL_FORMAT_XBGR32"; - if (_g) - *_g = (BYTE)(color >> 8); + case PIXEL_FORMAT_BGRA32: + return "PIXEL_FORMAT_BGRA32"; - if (_b) - *_b = (BYTE)color; + case PIXEL_FORMAT_BGRX32: + return "PIXEL_FORMAT_BGRX32"; - break; + case PIXEL_FORMAT_RGBA32: + return "PIXEL_FORMAT_RGBA32"; - case PIXEL_FORMAT_XRGB32: - if (_r) - *_r = (BYTE)(color >> 16); + case PIXEL_FORMAT_RGBX32: + return "PIXEL_FORMAT_RGBX32"; - if (_g) - *_g = (BYTE)(color >> 8); + /* 24bpp formats */ + case PIXEL_FORMAT_RGB24: + return "PIXEL_FORMAT_RGB24"; - if (_b) - *_b = (BYTE)color; + case PIXEL_FORMAT_BGR24: + return "PIXEL_FORMAT_BGR24"; - if (_a) - *_a = 0xFF; + /* 16bpp formats */ + case PIXEL_FORMAT_RGB16: + return "PIXEL_FORMAT_RGB16"; - break; + case PIXEL_FORMAT_BGR16: + return "PIXEL_FORMAT_BGR16"; - case PIXEL_FORMAT_ABGR32: - if (_a) - *_a = (BYTE)(color >> 24); + case PIXEL_FORMAT_ARGB15: + return "PIXEL_FORMAT_ARGB15"; - if (_b) - *_b = (BYTE)(color >> 16); + case PIXEL_FORMAT_RGB15: + return "PIXEL_FORMAT_RGB15"; - if (_g) - *_g = (BYTE)(color >> 8); + case PIXEL_FORMAT_ABGR15: + return "PIXEL_FORMAT_ABGR15"; - if (_r) - *_r = (BYTE)color; + case PIXEL_FORMAT_BGR15: + return "PIXEL_FORMAT_BGR15"; - break; + /* 8bpp formats */ + case PIXEL_FORMAT_RGB8: + return "PIXEL_FORMAT_RGB8"; - case PIXEL_FORMAT_XBGR32: - if (_b) - *_b = (BYTE)(color >> 16); + /* 4 bpp formats */ + case PIXEL_FORMAT_A4: + return "PIXEL_FORMAT_A4"; - if (_g) - *_g = (BYTE)(color >> 8); + /* 1bpp formats */ + case PIXEL_FORMAT_MONO: + return "PIXEL_FORMAT_MONO"; - if (_r) - *_r = (BYTE)color; + default: + return "UNKNOWN"; + } + } - if (_a) - *_a = 0xFF; + /*** + * + * Converts a pixel color in internal representation to its red, green, blue + * and alpha components. + * + * @param color The color in format internal representation + * @param format one of PIXEL_FORMAT_* color format defines + * @param _r red color value + * @param _g green color value + * @param _b blue color value + * @param _a alpha color value + * @param palette pallete to use (only used for 8 bit color!) + */ + static INLINE void SplitColor(UINT32 color, UINT32 format, BYTE* _r, BYTE* _g, BYTE* _b, + BYTE* _a, const gdiPalette* palette) + { + UINT32 tmp; - break; + switch (format) + { + /* 32bpp formats */ + case PIXEL_FORMAT_ARGB32: + if (_a) + *_a = (BYTE)(color >> 24); - case PIXEL_FORMAT_RGBA32: - if (_r) - *_r = (BYTE)(color >> 24); + if (_r) + *_r = (BYTE)(color >> 16); - if (_g) - *_g = (BYTE)(color >> 16); + if (_g) + *_g = (BYTE)(color >> 8); - if (_b) - *_b = (BYTE)(color >> 8); + if (_b) + *_b = (BYTE)color; - if (_a) - *_a = (BYTE)color; + break; - break; + case PIXEL_FORMAT_XRGB32: + if (_r) + *_r = (BYTE)(color >> 16); - case PIXEL_FORMAT_RGBX32: - if (_r) - *_r = (BYTE)(color >> 24); + if (_g) + *_g = (BYTE)(color >> 8); - if (_g) - *_g = (BYTE)(color >> 16); + if (_b) + *_b = (BYTE)color; - if (_b) - *_b = (BYTE)(color >> 8); + if (_a) + *_a = 0xFF; - if (_a) - *_a = 0xFF; + break; - break; + case PIXEL_FORMAT_ABGR32: + if (_a) + *_a = (BYTE)(color >> 24); - case PIXEL_FORMAT_BGRA32: - if (_b) - *_b = (BYTE)(color >> 24); + if (_b) + *_b = (BYTE)(color >> 16); - if (_g) - *_g = (BYTE)(color >> 16); + if (_g) + *_g = (BYTE)(color >> 8); - if (_r) - *_r = (BYTE)(color >> 8); + if (_r) + *_r = (BYTE)color; - if (_a) - *_a = (BYTE)color; + break; - break; + case PIXEL_FORMAT_XBGR32: + if (_b) + *_b = (BYTE)(color >> 16); - case PIXEL_FORMAT_BGRX32: - if (_b) - *_b = (BYTE)(color >> 24); + if (_g) + *_g = (BYTE)(color >> 8); - if (_g) - *_g = (BYTE)(color >> 16); + if (_r) + *_r = (BYTE)color; - if (_r) - *_r = (BYTE)(color >> 8); + if (_a) + *_a = 0xFF; - if (_a) - *_a = 0xFF; + break; - break; + case PIXEL_FORMAT_RGBA32: + if (_r) + *_r = (BYTE)(color >> 24); - /* 24bpp formats */ - case PIXEL_FORMAT_RGB24: - if (_r) - *_r = (BYTE)(color >> 16); + if (_g) + *_g = (BYTE)(color >> 16); - if (_g) - *_g = (BYTE)(color >> 8); + if (_b) + *_b = (BYTE)(color >> 8); - if (_b) - *_b = (BYTE)color; + if (_a) + *_a = (BYTE)color; - if (_a) - *_a = 0xFF; + break; - break; + case PIXEL_FORMAT_RGBX32: + if (_r) + *_r = (BYTE)(color >> 24); - case PIXEL_FORMAT_BGR24: - if (_b) - *_b = (BYTE)(color >> 16); + if (_g) + *_g = (BYTE)(color >> 16); - if (_g) - *_g = (BYTE)(color >> 8); + if (_b) + *_b = (BYTE)(color >> 8); - if (_r) - *_r = (BYTE)color; + if (_a) + *_a = 0xFF; - if (_a) - *_a = 0xFF; + break; - break; + case PIXEL_FORMAT_BGRA32: + if (_b) + *_b = (BYTE)(color >> 24); - /* 16bpp formats */ - case PIXEL_FORMAT_RGB16: - if (_r) - { - const UINT32 c = (color >> 11) & 0x1F; - const UINT32 val = (c << 3) + c / 4; - *_r = (BYTE) (val > 255 ? 255 : val); - } + if (_g) + *_g = (BYTE)(color >> 16); - if (_g) - { - const UINT32 c = (color >> 5) & 0x3F; - const UINT32 val = (c << 2) + c / 4 / 2; - *_g = (BYTE) (val > 255 ? 255 : val); - } - - if (_b) - { - const UINT32 c = (color) & 0x1F; - const UINT32 val = (c << 3) + c / 4; - *_b = (BYTE) (val > 255 ? 255 : val); - } - - if (_a) - *_a = 0xFF; - - break; - - case PIXEL_FORMAT_BGR16: - if (_r) - { - const UINT32 c = (color) & 0x1F; - const UINT32 val = (c << 3) + c / 4; - *_r = (BYTE) (val > 255 ? 255 : val); - } - - if (_g) - { - const UINT32 c = (color >> 5) & 0x3F; - const UINT32 val = (c << 2) + c / 4 / 2; - *_g = (BYTE) (val > 255 ? 255 : val); - } - - if (_b) - { - const UINT32 c = (color >> 11) & 0x1F; - const UINT32 val = (c << 3) + c / 4; - *_b = (BYTE) (val > 255 ? 255 : val); - } - - if (_a) - *_a = 0xFF; - - break; - - case PIXEL_FORMAT_ARGB15: - if (_r) - { - const UINT32 c = (color >> 10) & 0x1F; - const UINT32 val = (c << 3) + c / 4; - *_r = (BYTE) (val > 255 ? 255 : val); - } - - if (_g) - { - const UINT32 c = (color >> 5) & 0x1F; - const UINT32 val = (c << 3) + c / 4; - *_g = (BYTE) (val > 255 ? 255 : val); - } - - if (_b) - { - const UINT32 c = (color) & 0x1F; - const UINT32 val = (c << 3) + c / 4; - *_b = (BYTE) (val > 255 ? 255 : val); - } - - if (_a) - *_a = color & 0x8000 ? 0xFF : 0x00; - - break; - - case PIXEL_FORMAT_ABGR15: - if (_r) - { - const UINT32 c = (color) & 0x1F; - const UINT32 val = (c << 3) + c / 4; - *_r = (BYTE) (val > 255 ? 255 : val); - } - - if (_g) - { - const UINT32 c = (color >> 5) & 0x1F; - const UINT32 val = (c << 3) + c / 4; - *_g = (BYTE) (val > 255 ? 255 : val); - } - - if (_b) - { - const UINT32 c = (color >> 10) & 0x1F; - const UINT32 val = (c << 3) + c / 4; - *_b = (BYTE) (val > 255 ? 255 : val); - } - - if (_a) - *_a = color & 0x8000 ? 0xFF : 0x00; - - break; - - /* 15bpp formats */ - case PIXEL_FORMAT_RGB15: - if (_r) - { - const UINT32 c = (color >> 10) & 0x1F; - const UINT32 val = (c << 3) + c / 4; - *_r = (BYTE) (val > 255 ? 255 : val); - } - - if (_g) - { - const UINT32 c = (color >> 5) & 0x1F; - const UINT32 val = (c << 3) + c / 4; - *_g = (BYTE) (val > 255 ? 255 : val); - } - - if (_b) - { - const UINT32 c = (color) & 0x1F; - const UINT32 val = (c << 3) + c / 4; - *_b = (BYTE) (val > 255 ? 255 : val); - } - - if (_a) - *_a = 0xFF; - - break; - - case PIXEL_FORMAT_BGR15: - if (_r) - { - const UINT32 c = (color) & 0x1F; - const UINT32 val = (c << 3) + c / 4; - *_r = (BYTE) (val > 255 ? 255 : val); - } - - if (_g) - { - const UINT32 c = (color >> 5) & 0x1F; - const UINT32 val = (c << 3) + c / 4; - *_g = (BYTE) (val > 255 ? 255 : val); - } - - if (_b) - { - const UINT32 c = (color >> 10) & 0x1F; - const UINT32 val = (c << 3) + c / 4; - *_b = (BYTE) (val > 255 ? 255 : val); - } - - if (_a) - *_a = 0xFF; - - break; - - /* 8bpp formats */ - case PIXEL_FORMAT_RGB8: - if (color <= 0xFF) - { - tmp = palette->palette[color]; - SplitColor(tmp, palette->format, _r, _g, _b, _a, NULL); - } - else - { + if (_r) + *_r = (BYTE)(color >> 8); + + if (_a) + *_a = (BYTE)color; + + break; + + case PIXEL_FORMAT_BGRX32: + if (_b) + *_b = (BYTE)(color >> 24); + + if (_g) + *_g = (BYTE)(color >> 16); + + if (_r) + *_r = (BYTE)(color >> 8); + + if (_a) + *_a = 0xFF; + + break; + + /* 24bpp formats */ + case PIXEL_FORMAT_RGB24: + if (_r) + *_r = (BYTE)(color >> 16); + + if (_g) + *_g = (BYTE)(color >> 8); + + if (_b) + *_b = (BYTE)color; + + if (_a) + *_a = 0xFF; + + break; + + case PIXEL_FORMAT_BGR24: + if (_b) + *_b = (BYTE)(color >> 16); + + if (_g) + *_g = (BYTE)(color >> 8); + + if (_r) + *_r = (BYTE)color; + + if (_a) + *_a = 0xFF; + + break; + + /* 16bpp formats */ + case PIXEL_FORMAT_RGB16: + if (_r) + { + const UINT32 c = (color >> 11) & 0x1F; + const UINT32 val = (c << 3) + c / 4; + *_r = (BYTE)(val > 255 ? 255 : val); + } + + if (_g) + { + const UINT32 c = (color >> 5) & 0x3F; + const UINT32 val = (c << 2) + c / 4 / 2; + *_g = (BYTE)(val > 255 ? 255 : val); + } + + if (_b) + { + const UINT32 c = (color)&0x1F; + const UINT32 val = (c << 3) + c / 4; + *_b = (BYTE)(val > 255 ? 255 : val); + } + + if (_a) + *_a = 0xFF; + + break; + + case PIXEL_FORMAT_BGR16: + if (_r) + { + const UINT32 c = (color)&0x1F; + const UINT32 val = (c << 3) + c / 4; + *_r = (BYTE)(val > 255 ? 255 : val); + } + + if (_g) + { + const UINT32 c = (color >> 5) & 0x3F; + const UINT32 val = (c << 2) + c / 4 / 2; + *_g = (BYTE)(val > 255 ? 255 : val); + } + + if (_b) + { + const UINT32 c = (color >> 11) & 0x1F; + const UINT32 val = (c << 3) + c / 4; + *_b = (BYTE)(val > 255 ? 255 : val); + } + + if (_a) + *_a = 0xFF; + + break; + + case PIXEL_FORMAT_ARGB15: + if (_r) + { + const UINT32 c = (color >> 10) & 0x1F; + const UINT32 val = (c << 3) + c / 4; + *_r = (BYTE)(val > 255 ? 255 : val); + } + + if (_g) + { + const UINT32 c = (color >> 5) & 0x1F; + const UINT32 val = (c << 3) + c / 4; + *_g = (BYTE)(val > 255 ? 255 : val); + } + + if (_b) + { + const UINT32 c = (color)&0x1F; + const UINT32 val = (c << 3) + c / 4; + *_b = (BYTE)(val > 255 ? 255 : val); + } + + if (_a) + *_a = color & 0x8000 ? 0xFF : 0x00; + + break; + + case PIXEL_FORMAT_ABGR15: + if (_r) + { + const UINT32 c = (color)&0x1F; + const UINT32 val = (c << 3) + c / 4; + *_r = (BYTE)(val > 255 ? 255 : val); + } + + if (_g) + { + const UINT32 c = (color >> 5) & 0x1F; + const UINT32 val = (c << 3) + c / 4; + *_g = (BYTE)(val > 255 ? 255 : val); + } + + if (_b) + { + const UINT32 c = (color >> 10) & 0x1F; + const UINT32 val = (c << 3) + c / 4; + *_b = (BYTE)(val > 255 ? 255 : val); + } + + if (_a) + *_a = color & 0x8000 ? 0xFF : 0x00; + + break; + + /* 15bpp formats */ + case PIXEL_FORMAT_RGB15: + if (_r) + { + const UINT32 c = (color >> 10) & 0x1F; + const UINT32 val = (c << 3) + c / 4; + *_r = (BYTE)(val > 255 ? 255 : val); + } + + if (_g) + { + const UINT32 c = (color >> 5) & 0x1F; + const UINT32 val = (c << 3) + c / 4; + *_g = (BYTE)(val > 255 ? 255 : val); + } + + if (_b) + { + const UINT32 c = (color)&0x1F; + const UINT32 val = (c << 3) + c / 4; + *_b = (BYTE)(val > 255 ? 255 : val); + } + + if (_a) + *_a = 0xFF; + + break; + + case PIXEL_FORMAT_BGR15: + if (_r) + { + const UINT32 c = (color)&0x1F; + const UINT32 val = (c << 3) + c / 4; + *_r = (BYTE)(val > 255 ? 255 : val); + } + + if (_g) + { + const UINT32 c = (color >> 5) & 0x1F; + const UINT32 val = (c << 3) + c / 4; + *_g = (BYTE)(val > 255 ? 255 : val); + } + + if (_b) + { + const UINT32 c = (color >> 10) & 0x1F; + const UINT32 val = (c << 3) + c / 4; + *_b = (BYTE)(val > 255 ? 255 : val); + } + + if (_a) + *_a = 0xFF; + + break; + + /* 8bpp formats */ + case PIXEL_FORMAT_RGB8: + if (color <= 0xFF) + { + tmp = palette->palette[color]; + SplitColor(tmp, palette->format, _r, _g, _b, _a, NULL); + } + else + { + if (_r) + *_r = 0x00; + + if (_g) + *_g = 0x00; + + if (_b) + *_b = 0x00; + + if (_a) + *_a = 0x00; + } + + break; + + /* 1bpp formats */ + case PIXEL_FORMAT_MONO: + if (_r) + *_r = (color) ? 0xFF : 0x00; + + if (_g) + *_g = (color) ? 0xFF : 0x00; + + if (_b) + *_b = (color) ? 0xFF : 0x00; + + if (_a) + *_a = (color) ? 0xFF : 0x00; + + break; + + /* 4 bpp formats */ + case PIXEL_FORMAT_A4: + default: if (_r) *_r = 0x00; @@ -546,464 +582,420 @@ static INLINE void SplitColor(UINT32 color, UINT32 format, BYTE* _r, BYTE* _g, if (_a) *_a = 0x00; - } - break; - - /* 1bpp formats */ - case PIXEL_FORMAT_MONO: - if (_r) - *_r = (color) ? 0xFF : 0x00; - - if (_g) - *_g = (color) ? 0xFF : 0x00; - - if (_b) - *_b = (color) ? 0xFF : 0x00; - - if (_a) - *_a = (color) ? 0xFF : 0x00; - - break; - - /* 4 bpp formats */ - case PIXEL_FORMAT_A4: - default: - if (_r) - *_r = 0x00; - - if (_g) - *_g = 0x00; - - if (_b) - *_b = 0x00; - - if (_a) - *_a = 0x00; - - WLog_ERR(CTAG, "Unsupported format %s", FreeRDPGetColorFormatName(format)); - break; - } -} - -/*** - * - * Converts red, green, blue and alpha values to internal representation. - * - * @param format one of PIXEL_FORMAT_* color format defines - * @param r red color value - * @param g green color value - * @param b blue color value - * @param a alpha color value - * - * @return The pixel color in the desired format. Value is in internal - * representation. - */ -static INLINE UINT32 FreeRDPGetColor(UINT32 format, BYTE r, BYTE g, BYTE b, BYTE a) -{ - UINT32 _r = r; - UINT32 _g = g; - UINT32 _b = b; - UINT32 _a = a; - - switch (format) - { - /* 32bpp formats */ - case PIXEL_FORMAT_ARGB32: - return (_a << 24) | (_r << 16) | (_g << 8) | _b; - - case PIXEL_FORMAT_XRGB32: - return (_r << 16) | (_g << 8) | _b; - - case PIXEL_FORMAT_ABGR32: - return (_a << 24) | (_b << 16) | (_g << 8) | _r; - - case PIXEL_FORMAT_XBGR32: - return (_b << 16) | (_g << 8) | _r; - - case PIXEL_FORMAT_RGBA32: - return (_r << 24) | (_g << 16) | (_b << 8) | _a; - - case PIXEL_FORMAT_RGBX32: - return (_r << 24) | (_g << 16) | (_b << 8) | _a; - - case PIXEL_FORMAT_BGRA32: - return (_b << 24) | (_g << 16) | (_r << 8) | _a; - - case PIXEL_FORMAT_BGRX32: - return (_b << 24) | (_g << 16) | (_r << 8) | _a; - - /* 24bpp formats */ - case PIXEL_FORMAT_RGB24: - return (_r << 16) | (_g << 8) | _b; - - case PIXEL_FORMAT_BGR24: - return (_b << 16) | (_g << 8) | _r; - - /* 16bpp formats */ - case PIXEL_FORMAT_RGB16: - return (((_r >> 3) & 0x1F) << 11) | (((_g >> 2) & 0x3F) << 5) | (( - _b >> 3) & 0x1F); - - case PIXEL_FORMAT_BGR16: - return (((_b >> 3) & 0x1F) << 11) | (((_g >> 2) & 0x3F) << 5) | (( - _r >> 3) & 0x1F); - - case PIXEL_FORMAT_ARGB15: - return (((_r >> 3) & 0x1F) << 10) | (((_g >> 3) & 0x1F) << 5) | (( - _b >> 3) & 0x1F) | (_a ? 0x8000 : 0x0000); - - case PIXEL_FORMAT_ABGR15: - return (((_b >> 3) & 0x1F) << 10) | (((_g >> 3) & 0x1F) << 5) | (( - _r >> 3) & 0x1F) | (_a ? 0x8000 : 0x0000); - - /* 15bpp formats */ - case PIXEL_FORMAT_RGB15: - return (((_r >> 3) & 0x1F) << 10) | (((_g >> 3) & 0x1F) << 5) | (( - _b >> 3) & 0x1F); - - case PIXEL_FORMAT_BGR15: - return (((_b >> 3) & 0x1F) << 10) | (((_g >> 3) & 0x1F) << 5) | (( - _r >> 3) & 0x1F); - - /* 8bpp formats */ - case PIXEL_FORMAT_RGB8: - - /* 4 bpp formats */ - case PIXEL_FORMAT_A4: - - /* 1bpp formats */ - case PIXEL_FORMAT_MONO: - default: - WLog_ERR(CTAG, "Unsupported format %s", FreeRDPGetColorFormatName(format)); - return 0; - } -} - -/*** - * - * Returns the number of bits the format format uses. - * - * @param format One of PIXEL_FORMAT_* defines - * - * @return The number of bits the format requires per pixel. - */ -static INLINE UINT32 GetBitsPerPixel(UINT32 format) -{ - return (((format) >> 24) & 0x3F); -} - -/*** - * @param format one of PIXEL_FORMAT_* color format defines - * - * @return TRUE if the format has an alpha channel, FALSE otherwise. - */ -static INLINE BOOL ColorHasAlpha(UINT32 format) -{ - UINT32 alpha = (((format) >> 12) & 0x0F); - - if (alpha == 0) - return FALSE; - - return TRUE; -} - -/*** - * - * Read a pixel from memory to internal representation - * - * @param src The source buffer - * @param format The PIXEL_FORMAT_* define the source buffer uses for encoding - * - * @return The pixel color in internal representation - */ -static INLINE UINT32 ReadColor(const BYTE* src, UINT32 format) -{ - UINT32 color; - - switch (GetBitsPerPixel(format)) - { - case 32: - color = ((UINT32)src[0] << 24) | ((UINT32)src[1] << 16) | - ((UINT32)src[2] << 8) | src[3]; - break; - - case 24: - color = ((UINT32)src[0] << 16) | ((UINT32)src[1] << 8) | src[2]; - break; - - case 16: - color = ((UINT32)src[1] << 8) | src[0]; - break; - - case 15: - color = ((UINT32)src[1] << 8) | src[0]; - - if (!ColorHasAlpha(format)) - color = color & 0x7FFF; - - break; - - case 8: - case 4: - case 1: - color = *src; - break; - - default: - WLog_ERR(CTAG, "Unsupported format %s", FreeRDPGetColorFormatName(format)); - color = 0; - break; + WLog_ERR(CTAG, "Unsupported format %s", FreeRDPGetColorFormatName(format)); + break; + } } - return color; -} - -/*** - * - * Write a pixel from internal representation to memory - * - * @param dst The destination buffer - * @param format The PIXEL_FORMAT_* define for encoding - * @param color The pixel color in internal representation - * - * @return TRUE if successful, FALSE otherwise - */ -static INLINE BOOL WriteColor(BYTE* dst, UINT32 format, UINT32 color) -{ - switch (GetBitsPerPixel(format)) + /*** + * + * Converts red, green, blue and alpha values to internal representation. + * + * @param format one of PIXEL_FORMAT_* color format defines + * @param r red color value + * @param g green color value + * @param b blue color value + * @param a alpha color value + * + * @return The pixel color in the desired format. Value is in internal + * representation. + */ + static INLINE UINT32 FreeRDPGetColor(UINT32 format, BYTE r, BYTE g, BYTE b, BYTE a) { - case 32: - dst[0] = (BYTE)(color >> 24); - dst[1] = (BYTE)(color >> 16); - dst[2] = (BYTE)(color >> 8); - dst[3] = (BYTE)color; - break; + UINT32 _r = r; + UINT32 _g = g; + UINT32 _b = b; + UINT32 _a = a; - case 24: - dst[0] = (BYTE)(color >> 16); - dst[1] = (BYTE)(color >> 8); - dst[2] = (BYTE)color; - break; + switch (format) + { + /* 32bpp formats */ + case PIXEL_FORMAT_ARGB32: + return (_a << 24) | (_r << 16) | (_g << 8) | _b; - case 16: - dst[1] = (BYTE)(color >> 8); - dst[0] = (BYTE)color; - break; + case PIXEL_FORMAT_XRGB32: + return (_r << 16) | (_g << 8) | _b; - case 15: - if (!ColorHasAlpha(format)) - color = color & 0x7FFF; + case PIXEL_FORMAT_ABGR32: + return (_a << 24) | (_b << 16) | (_g << 8) | _r; - dst[1] = (BYTE)(color >> 8); - dst[0] = (BYTE)color; - break; + case PIXEL_FORMAT_XBGR32: + return (_b << 16) | (_g << 8) | _r; - case 8: - dst[0] = (BYTE)color; - break; + case PIXEL_FORMAT_RGBA32: + return (_r << 24) | (_g << 16) | (_b << 8) | _a; - default: - WLog_ERR(CTAG, "Unsupported format %s", FreeRDPGetColorFormatName(format)); + case PIXEL_FORMAT_RGBX32: + return (_r << 24) | (_g << 16) | (_b << 8) | _a; + + case PIXEL_FORMAT_BGRA32: + return (_b << 24) | (_g << 16) | (_r << 8) | _a; + + case PIXEL_FORMAT_BGRX32: + return (_b << 24) | (_g << 16) | (_r << 8) | _a; + + /* 24bpp formats */ + case PIXEL_FORMAT_RGB24: + return (_r << 16) | (_g << 8) | _b; + + case PIXEL_FORMAT_BGR24: + return (_b << 16) | (_g << 8) | _r; + + /* 16bpp formats */ + case PIXEL_FORMAT_RGB16: + return (((_r >> 3) & 0x1F) << 11) | (((_g >> 2) & 0x3F) << 5) | ((_b >> 3) & 0x1F); + + case PIXEL_FORMAT_BGR16: + return (((_b >> 3) & 0x1F) << 11) | (((_g >> 2) & 0x3F) << 5) | ((_r >> 3) & 0x1F); + + case PIXEL_FORMAT_ARGB15: + return (((_r >> 3) & 0x1F) << 10) | (((_g >> 3) & 0x1F) << 5) | ((_b >> 3) & 0x1F) | + (_a ? 0x8000 : 0x0000); + + case PIXEL_FORMAT_ABGR15: + return (((_b >> 3) & 0x1F) << 10) | (((_g >> 3) & 0x1F) << 5) | ((_r >> 3) & 0x1F) | + (_a ? 0x8000 : 0x0000); + + /* 15bpp formats */ + case PIXEL_FORMAT_RGB15: + return (((_r >> 3) & 0x1F) << 10) | (((_g >> 3) & 0x1F) << 5) | ((_b >> 3) & 0x1F); + + case PIXEL_FORMAT_BGR15: + return (((_b >> 3) & 0x1F) << 10) | (((_g >> 3) & 0x1F) << 5) | ((_r >> 3) & 0x1F); + + /* 8bpp formats */ + case PIXEL_FORMAT_RGB8: + + /* 4 bpp formats */ + case PIXEL_FORMAT_A4: + + /* 1bpp formats */ + case PIXEL_FORMAT_MONO: + default: + WLog_ERR(CTAG, "Unsupported format %s", FreeRDPGetColorFormatName(format)); + return 0; + } + } + + /*** + * + * Returns the number of bits the format format uses. + * + * @param format One of PIXEL_FORMAT_* defines + * + * @return The number of bits the format requires per pixel. + */ + static INLINE UINT32 GetBitsPerPixel(UINT32 format) + { + return (((format) >> 24) & 0x3F); + } + + /*** + * @param format one of PIXEL_FORMAT_* color format defines + * + * @return TRUE if the format has an alpha channel, FALSE otherwise. + */ + static INLINE BOOL ColorHasAlpha(UINT32 format) + { + UINT32 alpha = (((format) >> 12) & 0x0F); + + if (alpha == 0) return FALSE; + + return TRUE; } - return TRUE; -} + /*** + * + * Read a pixel from memory to internal representation + * + * @param src The source buffer + * @param format The PIXEL_FORMAT_* define the source buffer uses for encoding + * + * @return The pixel color in internal representation + */ + static INLINE UINT32 ReadColor(const BYTE* src, UINT32 format) + { + UINT32 color; -/*** - * - * Converts a pixel in internal representation format srcFormat to internal - * representation format dstFormat - * - * @param color The pixel color in srcFormat representation - * @param srcFormat The PIXEL_FORMAT_* of color - * @param dstFormat The PIXEL_FORMAT_* of the return. - * @param palette pallete to use (only used for 8 bit color!) - * - * @return The converted pixel color in dstFormat representation - */ -static INLINE UINT32 FreeRDPConvertColor(UINT32 color, UINT32 srcFormat, - UINT32 dstFormat, const gdiPalette* palette) -{ - BYTE r = 0; - BYTE g = 0; - BYTE b = 0; - BYTE a = 0; - SplitColor(color, srcFormat, &r, &g, &b, &a, palette); - return FreeRDPGetColor(dstFormat, r, g, b, a); -} + switch (GetBitsPerPixel(format)) + { + case 32: + color = ((UINT32)src[0] << 24) | ((UINT32)src[1] << 16) | ((UINT32)src[2] << 8) | + src[3]; + break; -/*** - * - * Returns the number of bytes the format format uses. - * - * @param format One of PIXEL_FORMAT_* defines - * - * @return The number of bytes the format requires per pixel. - */ -static INLINE UINT32 GetBytesPerPixel(UINT32 format) -{ - return (GetBitsPerPixel(format) + 7) / 8; -} + case 24: + color = ((UINT32)src[0] << 16) | ((UINT32)src[1] << 8) | src[2]; + break; -/*** - * - * @param nWidth width to copy in pixels - * @param nHeight height to copy in pixels - * @param data source buffer, must be (nWidth + 7) / 8 bytes long - * - * @return A buffer allocated with _aligned_malloc(width * height, 16) - * if successufl, NULL otherwise. - */ -FREERDP_API BYTE* freerdp_glyph_convert(UINT32 width, UINT32 height, - const BYTE* data); + case 16: + color = ((UINT32)src[1] << 8) | src[0]; + break; -/*** - * - * @param pDstData destination buffer - * @param DstFormat destination buffer format - * @param nDstStep destination buffer stride (line in bytes) 0 for default - * @param nXDst destination buffer offset x - * @param nYDst destination buffer offset y - * @param nWidth width to copy in pixels - * @param nHeight height to copy in pixels - * @param pSrcData source buffer, must be (nWidth + 7) / 8 bytes long - * @param backColor The background color in internal representation format - * @param foreColor The foreground color in internal representation format - * @param palette palette to use (only used for 8 bit color!) - * - * @return TRUE if success, FALSE otherwise - */ -FREERDP_API BOOL freerdp_image_copy_from_monochrome(BYTE* pDstData, - UINT32 DstFormat, - UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, - UINT32 nWidth, UINT32 nHeight, - const BYTE* pSrcData, - UINT32 backColor, UINT32 foreColor, - const gdiPalette* palette); + case 15: + color = ((UINT32)src[1] << 8) | src[0]; -/*** - * - * @param pDstData destination buffer - * @param DstFormat destination buffer format - * @param nDstStep destination buffer stride (line in bytes) 0 for default - * @param nXDst destination buffer offset x - * @param nYDst destination buffer offset y - * @param nWidth width to copy in pixels - * @param nHeight height to copy in pixels - * @param bitsColor icon's image data buffer - * @param cbBitsColor length of the image data buffer in bytes - * @param bitsMask icon's 1bpp image mask buffer - * @param cbBitsMask length of the image mask buffer in bytes - * @param colorTable icon's image color table - * @param cbBitsColor length of the image color table buffer in bytes - * @param bpp color image data bits per pixel - * - * @return TRUE if success, FALSE otherwise - */ -FREERDP_API BOOL freerdp_image_copy_from_icon_data( - BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, - UINT32 nXDst, UINT32 nYDst, UINT16 nWidth, UINT16 nHeight, - const BYTE* bitsColor, UINT16 cbBitsColor, - const BYTE* bitsMask, UINT16 cbBitsMask, - const BYTE* colorTable, UINT16 cbColorTable, - UINT32 bpp); + if (!ColorHasAlpha(format)) + color = color & 0x7FFF; -/*** - * - * @param pDstData destination buffer - * @param DstFormat destination buffer format - * @param nDstStep destination buffer stride (line in bytes) 0 for default - * @param nXDst destination buffer offset x - * @param nYDst destination buffer offset y - * @param nWidth width to copy in pixels - * @param nHeight height to copy in pixels - * @param xorMask XOR mask buffer - * @param xorMaskLength XOR mask length in bytes - * @param andMask AND mask buffer - * @param andMaskLength AND mask length in bytes - * @param xorBpp XOR bits per pixel - * @param palette palette to use (only used for 8 bit color!) - * - * @return TRUE if success, FALSE otherwise - */ -FREERDP_API BOOL freerdp_image_copy_from_pointer_data( - BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, - UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, - const BYTE* xorMask, UINT32 xorMaskLength, - const BYTE* andMask, UINT32 andMaskLength, - UINT32 xorBpp, const gdiPalette* palette); + break; -/*** - * - * @param pDstData destination buffer - * @param DstFormat destination buffer format - * @param nDstStep destination buffer stride (line in bytes) 0 for default - * @param nXDst destination buffer offset x - * @param nYDst destination buffer offset y - * @param nWidth width to copy in pixels - * @param nHeight height to copy in pixels - * @param pSrcData source buffer - * @param SrcFormat source buffer format - * @param nSrcStep source buffer stride (line in bytes) 0 for default - * @param nXSrc source buffer x offset in pixels - * @param nYSrc source buffer y offset in pixels - * @param palette palette to use (only used for 8 bit color!) - * @param flags Image flipping flags FREERDP_FLIP_NONE et al - * - * @return TRUE if success, FALSE otherwise - */ -FREERDP_API BOOL freerdp_image_copy(BYTE* pDstData, DWORD DstFormat, - UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, - UINT32 nWidth, UINT32 nHeight, - const BYTE* pSrcData, DWORD SrcFormat, - UINT32 nSrcStep, UINT32 nXSrc, UINT32 nYSrc, - const gdiPalette* palette, UINT32 flags); + case 8: + case 4: + case 1: + color = *src; + break; -/*** - * - * @param pDstData destination buffer - * @param DstFormat destination buffer format - * @param nDstStep destination buffer stride (line in bytes) 0 for default - * @param nXDst destination buffer offset x - * @param nYDst destination buffer offset y - * @param nDstWidth width of destination in pixels - * @param nDstHeight height of destination in pixels - * @param pSrcData source buffer - * @param SrcFormat source buffer format - * @param nSrcStep source buffer stride (line in bytes) 0 for default - * @param nXSrc source buffer x offset in pixels - * @param nYSrc source buffer y offset in pixels - * @param nSrcWidth width of source in pixels - * @param nSrcHeight height of source in pixels - * - * @return TRUE if success, FALSE otherwise - */ -FREERDP_API BOOL freerdp_image_scale(BYTE* pDstData, DWORD DstFormat, - UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, - UINT32 nDstWidth, UINT32 nDstHeight, - const BYTE* pSrcData, DWORD SrcFormat, - UINT32 nSrcStep, UINT32 nXSrc, UINT32 nYSrc, - UINT32 nSrcWidth, UINT32 nSrcHeight); + default: + WLog_ERR(CTAG, "Unsupported format %s", FreeRDPGetColorFormatName(format)); + color = 0; + break; + } -/*** - * - * @param pDstData destionation buffer - * @param DstFormat destionation buffer format - * @param nDstStep destionation buffer stride (line in bytes) 0 for default - * @param nXDst destination buffer offset x - * @param nYDst destination buffer offset y - * @param nWidth width to copy in pixels - * @param nHeight height to copy in pixels - * @param color Pixel color in DstFormat (internal representation format, - * use FreeRDPGetColor to create) - * - * @return TRUE if success, FALSE otherwise - */ -FREERDP_API BOOL freerdp_image_fill(BYTE* pDstData, DWORD DstFormat, - UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, - UINT32 nWidth, UINT32 nHeight, UINT32 color); + return color; + } + + /*** + * + * Write a pixel from internal representation to memory + * + * @param dst The destination buffer + * @param format The PIXEL_FORMAT_* define for encoding + * @param color The pixel color in internal representation + * + * @return TRUE if successful, FALSE otherwise + */ + static INLINE BOOL WriteColor(BYTE* dst, UINT32 format, UINT32 color) + { + switch (GetBitsPerPixel(format)) + { + case 32: + dst[0] = (BYTE)(color >> 24); + dst[1] = (BYTE)(color >> 16); + dst[2] = (BYTE)(color >> 8); + dst[3] = (BYTE)color; + break; + + case 24: + dst[0] = (BYTE)(color >> 16); + dst[1] = (BYTE)(color >> 8); + dst[2] = (BYTE)color; + break; + + case 16: + dst[1] = (BYTE)(color >> 8); + dst[0] = (BYTE)color; + break; + + case 15: + if (!ColorHasAlpha(format)) + color = color & 0x7FFF; + + dst[1] = (BYTE)(color >> 8); + dst[0] = (BYTE)color; + break; + + case 8: + dst[0] = (BYTE)color; + break; + + default: + WLog_ERR(CTAG, "Unsupported format %s", FreeRDPGetColorFormatName(format)); + return FALSE; + } + + return TRUE; + } + + /*** + * + * Converts a pixel in internal representation format srcFormat to internal + * representation format dstFormat + * + * @param color The pixel color in srcFormat representation + * @param srcFormat The PIXEL_FORMAT_* of color + * @param dstFormat The PIXEL_FORMAT_* of the return. + * @param palette pallete to use (only used for 8 bit color!) + * + * @return The converted pixel color in dstFormat representation + */ + static INLINE UINT32 FreeRDPConvertColor(UINT32 color, UINT32 srcFormat, UINT32 dstFormat, + const gdiPalette* palette) + { + BYTE r = 0; + BYTE g = 0; + BYTE b = 0; + BYTE a = 0; + SplitColor(color, srcFormat, &r, &g, &b, &a, palette); + return FreeRDPGetColor(dstFormat, r, g, b, a); + } + + /*** + * + * Returns the number of bytes the format format uses. + * + * @param format One of PIXEL_FORMAT_* defines + * + * @return The number of bytes the format requires per pixel. + */ + static INLINE UINT32 GetBytesPerPixel(UINT32 format) + { + return (GetBitsPerPixel(format) + 7) / 8; + } + + /*** + * + * @param nWidth width to copy in pixels + * @param nHeight height to copy in pixels + * @param data source buffer, must be (nWidth + 7) / 8 bytes long + * + * @return A buffer allocated with _aligned_malloc(width * height, 16) + * if successufl, NULL otherwise. + */ + FREERDP_API BYTE* freerdp_glyph_convert(UINT32 width, UINT32 height, const BYTE* data); + + /*** + * + * @param pDstData destination buffer + * @param DstFormat destination buffer format + * @param nDstStep destination buffer stride (line in bytes) 0 for default + * @param nXDst destination buffer offset x + * @param nYDst destination buffer offset y + * @param nWidth width to copy in pixels + * @param nHeight height to copy in pixels + * @param pSrcData source buffer, must be (nWidth + 7) / 8 bytes long + * @param backColor The background color in internal representation format + * @param foreColor The foreground color in internal representation format + * @param palette palette to use (only used for 8 bit color!) + * + * @return TRUE if success, FALSE otherwise + */ + FREERDP_API BOOL freerdp_image_copy_from_monochrome(BYTE* pDstData, UINT32 DstFormat, + UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, + UINT32 nWidth, UINT32 nHeight, + const BYTE* pSrcData, UINT32 backColor, + UINT32 foreColor, + const gdiPalette* palette); + + /*** + * + * @param pDstData destination buffer + * @param DstFormat destination buffer format + * @param nDstStep destination buffer stride (line in bytes) 0 for default + * @param nXDst destination buffer offset x + * @param nYDst destination buffer offset y + * @param nWidth width to copy in pixels + * @param nHeight height to copy in pixels + * @param bitsColor icon's image data buffer + * @param cbBitsColor length of the image data buffer in bytes + * @param bitsMask icon's 1bpp image mask buffer + * @param cbBitsMask length of the image mask buffer in bytes + * @param colorTable icon's image color table + * @param cbBitsColor length of the image color table buffer in bytes + * @param bpp color image data bits per pixel + * + * @return TRUE if success, FALSE otherwise + */ + FREERDP_API BOOL freerdp_image_copy_from_icon_data(BYTE* pDstData, UINT32 DstFormat, + UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, + UINT16 nWidth, UINT16 nHeight, + const BYTE* bitsColor, UINT16 cbBitsColor, + const BYTE* bitsMask, UINT16 cbBitsMask, + const BYTE* colorTable, UINT16 cbColorTable, + UINT32 bpp); + + /*** + * + * @param pDstData destination buffer + * @param DstFormat destination buffer format + * @param nDstStep destination buffer stride (line in bytes) 0 for default + * @param nXDst destination buffer offset x + * @param nYDst destination buffer offset y + * @param nWidth width to copy in pixels + * @param nHeight height to copy in pixels + * @param xorMask XOR mask buffer + * @param xorMaskLength XOR mask length in bytes + * @param andMask AND mask buffer + * @param andMaskLength AND mask length in bytes + * @param xorBpp XOR bits per pixel + * @param palette palette to use (only used for 8 bit color!) + * + * @return TRUE if success, FALSE otherwise + */ + FREERDP_API BOOL freerdp_image_copy_from_pointer_data( + BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, + UINT32 nWidth, UINT32 nHeight, const BYTE* xorMask, UINT32 xorMaskLength, + const BYTE* andMask, UINT32 andMaskLength, UINT32 xorBpp, const gdiPalette* palette); + + /*** + * + * @param pDstData destination buffer + * @param DstFormat destination buffer format + * @param nDstStep destination buffer stride (line in bytes) 0 for default + * @param nXDst destination buffer offset x + * @param nYDst destination buffer offset y + * @param nWidth width to copy in pixels + * @param nHeight height to copy in pixels + * @param pSrcData source buffer + * @param SrcFormat source buffer format + * @param nSrcStep source buffer stride (line in bytes) 0 for default + * @param nXSrc source buffer x offset in pixels + * @param nYSrc source buffer y offset in pixels + * @param palette palette to use (only used for 8 bit color!) + * @param flags Image flipping flags FREERDP_FLIP_NONE et al + * + * @return TRUE if success, FALSE otherwise + */ + FREERDP_API BOOL freerdp_image_copy(BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep, + UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, + const BYTE* pSrcData, DWORD SrcFormat, UINT32 nSrcStep, + UINT32 nXSrc, UINT32 nYSrc, const gdiPalette* palette, + UINT32 flags); + + /*** + * + * @param pDstData destination buffer + * @param DstFormat destination buffer format + * @param nDstStep destination buffer stride (line in bytes) 0 for default + * @param nXDst destination buffer offset x + * @param nYDst destination buffer offset y + * @param nDstWidth width of destination in pixels + * @param nDstHeight height of destination in pixels + * @param pSrcData source buffer + * @param SrcFormat source buffer format + * @param nSrcStep source buffer stride (line in bytes) 0 for default + * @param nXSrc source buffer x offset in pixels + * @param nYSrc source buffer y offset in pixels + * @param nSrcWidth width of source in pixels + * @param nSrcHeight height of source in pixels + * + * @return TRUE if success, FALSE otherwise + */ + FREERDP_API BOOL freerdp_image_scale(BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep, + UINT32 nXDst, UINT32 nYDst, UINT32 nDstWidth, + UINT32 nDstHeight, const BYTE* pSrcData, DWORD SrcFormat, + UINT32 nSrcStep, UINT32 nXSrc, UINT32 nYSrc, + UINT32 nSrcWidth, UINT32 nSrcHeight); + + /*** + * + * @param pDstData destionation buffer + * @param DstFormat destionation buffer format + * @param nDstStep destionation buffer stride (line in bytes) 0 for default + * @param nXDst destination buffer offset x + * @param nYDst destination buffer offset y + * @param nWidth width to copy in pixels + * @param nHeight height to copy in pixels + * @param color Pixel color in DstFormat (internal representation format, + * use FreeRDPGetColor to create) + * + * @return TRUE if success, FALSE otherwise + */ + FREERDP_API BOOL freerdp_image_fill(BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep, + UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, + UINT32 color); #if !defined(__APPLE__) #define GetColorFormatName FreeRDPGetColorFormatName diff --git a/include/freerdp/codec/dsp.h b/include/freerdp/codec/dsp.h index 10a6f2941..7776885ff 100644 --- a/include/freerdp/codec/dsp.h +++ b/include/freerdp/codec/dsp.h @@ -28,26 +28,22 @@ typedef struct _FREERDP_DSP_CONTEXT FREERDP_DSP_CONTEXT; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API FREERDP_DSP_CONTEXT* freerdp_dsp_context_new(BOOL encoder); -FREERDP_API BOOL freerdp_dsp_supports_format(const AUDIO_FORMAT* format, BOOL encode); -FREERDP_API BOOL freerdp_dsp_encode(FREERDP_DSP_CONTEXT* context, - const AUDIO_FORMAT* srcFormat, - const BYTE* data, size_t length, - wStream* out); -FREERDP_API BOOL freerdp_dsp_decode(FREERDP_DSP_CONTEXT* context, - const AUDIO_FORMAT* srcFormat, - const BYTE* data, size_t length, - wStream* out); -FREERDP_API void freerdp_dsp_context_free(FREERDP_DSP_CONTEXT* context); -FREERDP_API BOOL freerdp_dsp_context_reset(FREERDP_DSP_CONTEXT* context, - const AUDIO_FORMAT* targetFormat); + FREERDP_API FREERDP_DSP_CONTEXT* freerdp_dsp_context_new(BOOL encoder); + FREERDP_API BOOL freerdp_dsp_supports_format(const AUDIO_FORMAT* format, BOOL encode); + FREERDP_API BOOL freerdp_dsp_encode(FREERDP_DSP_CONTEXT* context, const AUDIO_FORMAT* srcFormat, + const BYTE* data, size_t length, wStream* out); + FREERDP_API BOOL freerdp_dsp_decode(FREERDP_DSP_CONTEXT* context, const AUDIO_FORMAT* srcFormat, + const BYTE* data, size_t length, wStream* out); + FREERDP_API void freerdp_dsp_context_free(FREERDP_DSP_CONTEXT* context); + FREERDP_API BOOL freerdp_dsp_context_reset(FREERDP_DSP_CONTEXT* context, + const AUDIO_FORMAT* targetFormat); #ifdef __cplusplus } #endif #endif /* FREERDP_CODEC_DSP_H */ - diff --git a/include/freerdp/codec/h264.h b/include/freerdp/codec/h264.h index 77e9dd525..4f27ebce3 100644 --- a/include/freerdp/codec/h264.h +++ b/include/freerdp/codec/h264.h @@ -31,11 +31,9 @@ typedef struct _H264_CONTEXT H264_CONTEXT; typedef BOOL (*pfnH264SubsystemInit)(H264_CONTEXT* h264); typedef void (*pfnH264SubsystemUninit)(H264_CONTEXT* h264); -typedef int (*pfnH264SubsystemDecompress)(H264_CONTEXT* h264, const BYTE* pSrcData, - UINT32 SrcSize); +typedef int (*pfnH264SubsystemDecompress)(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSize); typedef int (*pfnH264SubsystemCompress)(H264_CONTEXT* h264, const BYTE** pSrcYuv, - const UINT32* pStride, - BYTE** ppDstData, UINT32* pDstSize); + const UINT32* pStride, BYTE** ppDstData, UINT32* pDstSize); struct _H264_CONTEXT_SUBSYSTEM { @@ -82,43 +80,38 @@ struct _H264_CONTEXT wLog* log; }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API INT32 avc420_compress(H264_CONTEXT* h264, const BYTE* pSrcData, - DWORD SrcFormat, UINT32 nSrcStep, - UINT32 nSrcWidth, UINT32 nSrcHeight, - BYTE** ppDstData, UINT32* pDstSize); + FREERDP_API INT32 avc420_compress(H264_CONTEXT* h264, const BYTE* pSrcData, DWORD SrcFormat, + UINT32 nSrcStep, UINT32 nSrcWidth, UINT32 nSrcHeight, + BYTE** ppDstData, UINT32* pDstSize); -FREERDP_API INT32 avc420_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, - UINT32 SrcSize, BYTE* pDstData, - DWORD DstFormat, UINT32 nDstStep, - UINT32 nDstWidth, UINT32 nDstHeight, - RECTANGLE_16* regionRects, UINT32 numRegionRect); + FREERDP_API INT32 avc420_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSize, + BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep, + UINT32 nDstWidth, UINT32 nDstHeight, + RECTANGLE_16* regionRects, UINT32 numRegionRect); -FREERDP_API INT32 avc444_compress(H264_CONTEXT* h264, const BYTE* pSrcData, DWORD SrcFormat, - UINT32 nSrcStep, UINT32 nSrcWidth, UINT32 nSrcHeight, - BYTE version, BYTE* op, - BYTE** pDstData, UINT32* pDstSize, - BYTE** pAuxDstData, UINT32* pAuxDstSize); + FREERDP_API INT32 avc444_compress(H264_CONTEXT* h264, const BYTE* pSrcData, DWORD SrcFormat, + UINT32 nSrcStep, UINT32 nSrcWidth, UINT32 nSrcHeight, + BYTE version, BYTE* op, BYTE** pDstData, UINT32* pDstSize, + BYTE** pAuxDstData, UINT32* pAuxDstSize); -FREERDP_API INT32 avc444_decompress(H264_CONTEXT* h264, BYTE op, - RECTANGLE_16* regionRects, UINT32 numRegionRect, - const BYTE* pSrcData, UINT32 SrcSize, - RECTANGLE_16* auxRegionRects, UINT32 numAuxRegionRect, - const BYTE* pAuxSrcData, UINT32 AuxSrcSize, - BYTE* pDstData, DWORD DstFormat, - UINT32 nDstStep, UINT32 nDstWidth, UINT32 nDstHeight, - UINT32 codecId); + FREERDP_API INT32 avc444_decompress(H264_CONTEXT* h264, BYTE op, RECTANGLE_16* regionRects, + UINT32 numRegionRect, const BYTE* pSrcData, UINT32 SrcSize, + RECTANGLE_16* auxRegionRects, UINT32 numAuxRegionRect, + const BYTE* pAuxSrcData, UINT32 AuxSrcSize, BYTE* pDstData, + DWORD DstFormat, UINT32 nDstStep, UINT32 nDstWidth, + UINT32 nDstHeight, UINT32 codecId); -FREERDP_API BOOL h264_context_reset(H264_CONTEXT* h264, UINT32 width, UINT32 height); + FREERDP_API BOOL h264_context_reset(H264_CONTEXT* h264, UINT32 width, UINT32 height); -FREERDP_API H264_CONTEXT* h264_context_new(BOOL Compressor); -FREERDP_API void h264_context_free(H264_CONTEXT* h264); + FREERDP_API H264_CONTEXT* h264_context_new(BOOL Compressor); + FREERDP_API void h264_context_free(H264_CONTEXT* h264); #ifdef __cplusplus } #endif #endif /* FREERDP_CODEC_H264_H */ - diff --git a/include/freerdp/codec/interleaved.h b/include/freerdp/codec/interleaved.h index 2db260ffc..63d295b33 100644 --- a/include/freerdp/codec/interleaved.h +++ b/include/freerdp/codec/interleaved.h @@ -39,36 +39,30 @@ struct _BITMAP_INTERLEAVED_CONTEXT }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API BOOL interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, - const BYTE* pSrcData, UINT32 SrcSize, - UINT32 nSrcWidth, UINT32 nSrcHeight, - UINT32 bpp, - BYTE* pDstData, UINT32 DstFormat, - UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, - UINT32 nDstWidth, UINT32 nDstHeight, - const gdiPalette* palette); + FREERDP_API BOOL interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, + const BYTE* pSrcData, UINT32 SrcSize, UINT32 nSrcWidth, + UINT32 nSrcHeight, UINT32 bpp, BYTE* pDstData, + UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, + UINT32 nYDst, UINT32 nDstWidth, UINT32 nDstHeight, + const gdiPalette* palette); -FREERDP_API BOOL interleaved_compress(BITMAP_INTERLEAVED_CONTEXT* interleaved, - BYTE* pDstData, UINT32* pDstSize, - UINT32 nWidth, UINT32 nHeight, - const BYTE* pSrcData, UINT32 SrcFormat, - UINT32 nSrcStep, UINT32 nXSrc, UINT32 nYSrc, - const gdiPalette* palette, UINT32 bpp); + FREERDP_API BOOL interleaved_compress(BITMAP_INTERLEAVED_CONTEXT* interleaved, BYTE* pDstData, + UINT32* pDstSize, UINT32 nWidth, UINT32 nHeight, + const BYTE* pSrcData, UINT32 SrcFormat, UINT32 nSrcStep, + UINT32 nXSrc, UINT32 nYSrc, const gdiPalette* palette, + UINT32 bpp); -FREERDP_API BOOL bitmap_interleaved_context_reset( - BITMAP_INTERLEAVED_CONTEXT* interleaved); + FREERDP_API BOOL bitmap_interleaved_context_reset(BITMAP_INTERLEAVED_CONTEXT* interleaved); -FREERDP_API BITMAP_INTERLEAVED_CONTEXT* bitmap_interleaved_context_new( - BOOL Compressor); -FREERDP_API void bitmap_interleaved_context_free(BITMAP_INTERLEAVED_CONTEXT* - interleaved); + FREERDP_API BITMAP_INTERLEAVED_CONTEXT* bitmap_interleaved_context_new(BOOL Compressor); + FREERDP_API void bitmap_interleaved_context_free(BITMAP_INTERLEAVED_CONTEXT* interleaved); #ifdef __cplusplus } #endif #endif /* FREERDP_CODEC_INTERLEAVED_H */ - diff --git a/include/freerdp/codec/jpeg.h b/include/freerdp/codec/jpeg.h index 197f0b410..2371e4889 100644 --- a/include/freerdp/codec/jpeg.h +++ b/include/freerdp/codec/jpeg.h @@ -24,13 +24,15 @@ #include #ifdef __cplusplus - extern "C" { +extern "C" +{ #endif -FREERDP_API BOOL jpeg_decompress(BYTE* input, BYTE* output, int width, int height, int size, int bpp); + FREERDP_API BOOL jpeg_decompress(BYTE* input, BYTE* output, int width, int height, int size, + int bpp); #ifdef __cplusplus - } +} #endif #endif /* FREERDP_CODEC_JPEG_H */ diff --git a/include/freerdp/codec/mppc.h b/include/freerdp/codec/mppc.h index b61c30c6f..c754b7864 100644 --- a/include/freerdp/codec/mppc.h +++ b/include/freerdp/codec/mppc.h @@ -41,18 +41,21 @@ struct _MPPC_CONTEXT typedef struct _MPPC_CONTEXT MPPC_CONTEXT; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags); -FREERDP_API int mppc_decompress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32 flags); + FREERDP_API int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, + BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags); + FREERDP_API int mppc_decompress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, + BYTE** ppDstData, UINT32* pDstSize, UINT32 flags); -FREERDP_API void mppc_set_compression_level(MPPC_CONTEXT* mppc, DWORD CompressionLevel); + FREERDP_API void mppc_set_compression_level(MPPC_CONTEXT* mppc, DWORD CompressionLevel); -FREERDP_API void mppc_context_reset(MPPC_CONTEXT* mppc, BOOL flush); + FREERDP_API void mppc_context_reset(MPPC_CONTEXT* mppc, BOOL flush); -FREERDP_API MPPC_CONTEXT* mppc_context_new(DWORD CompressionLevel, BOOL Compressor); -FREERDP_API void mppc_context_free(MPPC_CONTEXT* mppc); + FREERDP_API MPPC_CONTEXT* mppc_context_new(DWORD CompressionLevel, BOOL Compressor); + FREERDP_API void mppc_context_free(MPPC_CONTEXT* mppc); #ifdef __cplusplus } diff --git a/include/freerdp/codec/ncrush.h b/include/freerdp/codec/ncrush.h index d472eb1f3..999c8e7c8 100644 --- a/include/freerdp/codec/ncrush.h +++ b/include/freerdp/codec/ncrush.h @@ -45,20 +45,22 @@ struct _NCRUSH_CONTEXT typedef struct _NCRUSH_CONTEXT NCRUSH_CONTEXT; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API int ncrush_compress(NCRUSH_CONTEXT* ncrush, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags); -FREERDP_API int ncrush_decompress(NCRUSH_CONTEXT* ncrush, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32 flags); + FREERDP_API int ncrush_compress(NCRUSH_CONTEXT* ncrush, BYTE* pSrcData, UINT32 SrcSize, + BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags); + FREERDP_API int ncrush_decompress(NCRUSH_CONTEXT* ncrush, BYTE* pSrcData, UINT32 SrcSize, + BYTE** ppDstData, UINT32* pDstSize, UINT32 flags); -FREERDP_API void ncrush_context_reset(NCRUSH_CONTEXT* ncrush, BOOL flush); + FREERDP_API void ncrush_context_reset(NCRUSH_CONTEXT* ncrush, BOOL flush); -FREERDP_API NCRUSH_CONTEXT* ncrush_context_new(BOOL Compressor); -FREERDP_API void ncrush_context_free(NCRUSH_CONTEXT* ncrush); + FREERDP_API NCRUSH_CONTEXT* ncrush_context_new(BOOL Compressor); + FREERDP_API void ncrush_context_free(NCRUSH_CONTEXT* ncrush); #ifdef __cplusplus } #endif #endif /* FREERDP_CODEC_NCRUSH_H */ - diff --git a/include/freerdp/codec/nsc.h b/include/freerdp/codec/nsc.h index c1b663841..8e5ed3202 100644 --- a/include/freerdp/codec/nsc.h +++ b/include/freerdp/codec/nsc.h @@ -45,20 +45,20 @@ extern "C" typedef struct _NSC_CONTEXT NSC_CONTEXT; FREERDP_API WINPR_DEPRECATED(BOOL nsc_context_set_pixel_format(NSC_CONTEXT* context, - UINT32 pixel_format)); + UINT32 pixel_format)); FREERDP_API BOOL nsc_context_set_parameters(NSC_CONTEXT* context, NSC_PARAMETER what, - UINT32 value); + UINT32 value); FREERDP_API BOOL nsc_process_message(NSC_CONTEXT* context, UINT16 bpp, UINT32 width, - UINT32 height, const BYTE* data, UINT32 length, - BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStride, - UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, - UINT32 flip); + UINT32 height, const BYTE* data, UINT32 length, + BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStride, + UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, + UINT32 flip); FREERDP_API BOOL nsc_compose_message(NSC_CONTEXT* context, wStream* s, const BYTE* bmpdata, - UINT32 width, UINT32 height, UINT32 rowstride); + UINT32 width, UINT32 height, UINT32 rowstride); FREERDP_API BOOL nsc_decompose_message(NSC_CONTEXT* context, wStream* s, BYTE* bmpdata, - UINT32 x, UINT32 y, UINT32 width, UINT32 height, - UINT32 rowstride, UINT32 format, UINT32 flip); + UINT32 x, UINT32 y, UINT32 width, UINT32 height, + UINT32 rowstride, UINT32 format, UINT32 flip); FREERDP_API BOOL nsc_context_reset(NSC_CONTEXT* context, UINT32 width, UINT32 height); diff --git a/include/freerdp/codec/planar.h b/include/freerdp/codec/planar.h index bcaba436a..245b93fb2 100644 --- a/include/freerdp/codec/planar.h +++ b/include/freerdp/codec/planar.h @@ -29,16 +29,16 @@ typedef struct _BITMAP_PLANAR_CONTEXT BITMAP_PLANAR_CONTEXT; #include #include -#define PLANAR_FORMAT_HEADER_CS (1 << 3) -#define PLANAR_FORMAT_HEADER_RLE (1 << 4) -#define PLANAR_FORMAT_HEADER_NA (1 << 5) -#define PLANAR_FORMAT_HEADER_CLL_MASK 0x07 +#define PLANAR_FORMAT_HEADER_CS (1 << 3) +#define PLANAR_FORMAT_HEADER_RLE (1 << 4) +#define PLANAR_FORMAT_HEADER_NA (1 << 5) +#define PLANAR_FORMAT_HEADER_CLL_MASK 0x07 #define PLANAR_CONTROL_BYTE(_nRunLength, _cRawBytes) \ (_nRunLength & 0x0F) | ((_cRawBytes & 0x0F) << 4) -#define PLANAR_CONTROL_BYTE_RUN_LENGTH(_controlByte) (_controlByte & 0x0F) -#define PLANAR_CONTROL_BYTE_RAW_BYTES(_controlByte) ((_controlByte >> 4) & 0x0F) +#define PLANAR_CONTROL_BYTE_RUN_LENGTH(_controlByte) (_controlByte & 0x0F) +#define PLANAR_CONTROL_BYTE_RAW_BYTES(_controlByte) ((_controlByte >> 4) & 0x0F) struct _RDP6_RLE_SEGMENT { @@ -100,33 +100,30 @@ struct _BITMAP_PLANAR_CONTEXT }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API BYTE* freerdp_bitmap_compress_planar( - BITMAP_PLANAR_CONTEXT* context, - const BYTE* data, UINT32 format, - UINT32 width, UINT32 height, UINT32 scanline, - BYTE* dstData, UINT32* pDstSize); + FREERDP_API BYTE* freerdp_bitmap_compress_planar(BITMAP_PLANAR_CONTEXT* context, + const BYTE* data, UINT32 format, UINT32 width, + UINT32 height, UINT32 scanline, BYTE* dstData, + UINT32* pDstSize); -FREERDP_API BOOL freerdp_bitmap_planar_context_reset( - BITMAP_PLANAR_CONTEXT* context, UINT32 width, UINT32 height); + FREERDP_API BOOL freerdp_bitmap_planar_context_reset(BITMAP_PLANAR_CONTEXT* context, + UINT32 width, UINT32 height); -FREERDP_API BITMAP_PLANAR_CONTEXT* freerdp_bitmap_planar_context_new( - DWORD flags, UINT32 width, UINT32 height); -FREERDP_API void freerdp_bitmap_planar_context_free( - BITMAP_PLANAR_CONTEXT* context); + FREERDP_API BITMAP_PLANAR_CONTEXT* freerdp_bitmap_planar_context_new(DWORD flags, UINT32 width, + UINT32 height); + FREERDP_API void freerdp_bitmap_planar_context_free(BITMAP_PLANAR_CONTEXT* context); -FREERDP_API BOOL planar_decompress(BITMAP_PLANAR_CONTEXT* planar, - const BYTE* pSrcData, UINT32 SrcSize, - UINT32 nSrcWidth, UINT32 nSrcHeight, - BYTE* pDstData, UINT32 DstFormat, - UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, - UINT32 nDstWidth, UINT32 nDstHeight, BOOL vFlip); + FREERDP_API BOOL planar_decompress(BITMAP_PLANAR_CONTEXT* planar, const BYTE* pSrcData, + UINT32 SrcSize, UINT32 nSrcWidth, UINT32 nSrcHeight, + BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, + UINT32 nXDst, UINT32 nYDst, UINT32 nDstWidth, + UINT32 nDstHeight, BOOL vFlip); #ifdef __cplusplus } #endif #endif /* FREERDP_CODEC_PLANAR_H */ - diff --git a/include/freerdp/codec/progressive.h b/include/freerdp/codec/progressive.h index 27d530a8f..dda22f86d 100644 --- a/include/freerdp/codec/progressive.h +++ b/include/freerdp/codec/progressive.h @@ -33,31 +33,31 @@ typedef struct _PROGRESSIVE_CONTEXT PROGRESSIVE_CONTEXT; #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API int progressive_compress(PROGRESSIVE_CONTEXT* progressive, - const BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize); + FREERDP_API int progressive_compress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, + UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize); -FREERDP_API INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, - const BYTE* pSrcData, UINT32 SrcSize, - BYTE* pDstData, UINT32 DstFormat, - UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, - REGION16* invalidRegion, UINT16 surfaceId); + FREERDP_API INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, + UINT32 SrcSize, BYTE* pDstData, UINT32 DstFormat, + UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, + REGION16* invalidRegion, UINT16 surfaceId); -FREERDP_API INT32 progressive_create_surface_context(PROGRESSIVE_CONTEXT* progressive, - UINT16 surfaceId, UINT32 width, UINT32 height); -FREERDP_API int progressive_delete_surface_context(PROGRESSIVE_CONTEXT* progressive, - UINT16 surfaceId); + FREERDP_API INT32 progressive_create_surface_context(PROGRESSIVE_CONTEXT* progressive, + UINT16 surfaceId, UINT32 width, + UINT32 height); + FREERDP_API int progressive_delete_surface_context(PROGRESSIVE_CONTEXT* progressive, + UINT16 surfaceId); -FREERDP_API BOOL progressive_context_reset(PROGRESSIVE_CONTEXT* progressive); + FREERDP_API BOOL progressive_context_reset(PROGRESSIVE_CONTEXT* progressive); -FREERDP_API PROGRESSIVE_CONTEXT* progressive_context_new(BOOL Compressor); -FREERDP_API void progressive_context_free(PROGRESSIVE_CONTEXT* progressive); + FREERDP_API PROGRESSIVE_CONTEXT* progressive_context_new(BOOL Compressor); + FREERDP_API void progressive_context_free(PROGRESSIVE_CONTEXT* progressive); #ifdef __cplusplus } #endif #endif /* FREERDP_CODEC_PROGRESSIVE_H */ - diff --git a/include/freerdp/codec/region.h b/include/freerdp/codec/region.h index c66705241..ccacdb254 100644 --- a/include/freerdp/codec/region.h +++ b/include/freerdp/codec/region.h @@ -28,126 +28,123 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct _REGION16_DATA; -typedef struct _REGION16_DATA REGION16_DATA; + struct _REGION16_DATA; + typedef struct _REGION16_DATA REGION16_DATA; -/** - * @brief - */ -struct _REGION16 -{ - RECTANGLE_16 extents; - REGION16_DATA* data; -}; -typedef struct _REGION16 REGION16; + /** + * @brief + */ + struct _REGION16 + { + RECTANGLE_16 extents; + REGION16_DATA* data; + }; + typedef struct _REGION16 REGION16; -/** computes if two rectangles are equal - * @param r1 first rectangle - * @param r2 second rectangle - * @return if the two rectangles are equal - */ -FREERDP_API BOOL rectangles_equal(const RECTANGLE_16* r1, - const RECTANGLE_16* r2); + /** computes if two rectangles are equal + * @param r1 first rectangle + * @param r2 second rectangle + * @return if the two rectangles are equal + */ + FREERDP_API BOOL rectangles_equal(const RECTANGLE_16* r1, const RECTANGLE_16* r2); -/** computes if two rectangles intersect - * @param r1 first rectangle - * @param r2 second rectangle - * @return if the two rectangles intersect - */ -FREERDP_API BOOL rectangles_intersects(const RECTANGLE_16* r1, - const RECTANGLE_16* r2); + /** computes if two rectangles intersect + * @param r1 first rectangle + * @param r2 second rectangle + * @return if the two rectangles intersect + */ + FREERDP_API BOOL rectangles_intersects(const RECTANGLE_16* r1, const RECTANGLE_16* r2); -/** computes the intersection of two rectangles - * @param r1 first rectangle - * @param r2 second rectangle - * @param dst resulting intersection - * @return if the two rectangles intersect - */ -FREERDP_API BOOL rectangles_intersection(const RECTANGLE_16* r1, - const RECTANGLE_16* r2, RECTANGLE_16* dst); + /** computes the intersection of two rectangles + * @param r1 first rectangle + * @param r2 second rectangle + * @param dst resulting intersection + * @return if the two rectangles intersect + */ + FREERDP_API BOOL rectangles_intersection(const RECTANGLE_16* r1, const RECTANGLE_16* r2, + RECTANGLE_16* dst); -/** initialize a region16 - * @param region the region to initialise - */ -FREERDP_API void region16_init(REGION16* region); + /** initialize a region16 + * @param region the region to initialise + */ + FREERDP_API void region16_init(REGION16* region); -/** @return the number of rectangles of this region16 */ -FREERDP_API int region16_n_rects(const REGION16* region); + /** @return the number of rectangles of this region16 */ + FREERDP_API int region16_n_rects(const REGION16* region); -/** returns a pointer to rectangles and the number of rectangles in this region. - * nbRects can be set to NULL if not interested in the number of rectangles. - * @param region the input region - * @param nbRects if non-NULL returns the number of rectangles - * @return a pointer on the rectangles - */ -FREERDP_API const RECTANGLE_16* region16_rects(const REGION16* region, - UINT32* nbRects); + /** returns a pointer to rectangles and the number of rectangles in this region. + * nbRects can be set to NULL if not interested in the number of rectangles. + * @param region the input region + * @param nbRects if non-NULL returns the number of rectangles + * @return a pointer on the rectangles + */ + FREERDP_API const RECTANGLE_16* region16_rects(const REGION16* region, UINT32* nbRects); -/** @return the extents rectangle of this region */ -FREERDP_API const RECTANGLE_16* region16_extents(const REGION16* region); + /** @return the extents rectangle of this region */ + FREERDP_API const RECTANGLE_16* region16_extents(const REGION16* region); -/** returns if the rectangle is empty - * @param rect - * @return if the rectangle is empty - */ -FREERDP_API BOOL rectangle_is_empty(const RECTANGLE_16* rect); + /** returns if the rectangle is empty + * @param rect + * @return if the rectangle is empty + */ + FREERDP_API BOOL rectangle_is_empty(const RECTANGLE_16* rect); -/** returns if the region is empty - * @param region - * @return if the region is empty - */ -FREERDP_API BOOL region16_is_empty(const REGION16* region); + /** returns if the region is empty + * @param region + * @return if the region is empty + */ + FREERDP_API BOOL region16_is_empty(const REGION16* region); -/** clears the region, the region is resetted to a (0,0,0,0) region - * @param region - */ -FREERDP_API void region16_clear(REGION16* region); + /** clears the region, the region is resetted to a (0,0,0,0) region + * @param region + */ + FREERDP_API void region16_clear(REGION16* region); -/** dumps the region on stderr - * @param region the region to dump - */ -FREERDP_API void region16_print(const REGION16* region); + /** dumps the region on stderr + * @param region the region to dump + */ + FREERDP_API void region16_print(const REGION16* region); -/** copies the region to another region - * @param dst destination region - * @param src source region - * @return if the operation was successful (false meaning out-of-memory) - */ -FREERDP_API BOOL region16_copy(REGION16* dst, const REGION16* src); + /** copies the region to another region + * @param dst destination region + * @param src source region + * @return if the operation was successful (false meaning out-of-memory) + */ + FREERDP_API BOOL region16_copy(REGION16* dst, const REGION16* src); -/** adds a rectangle in src and stores the resulting region in dst - * @param dst destination region - * @param src source region - * @param rect the rectangle to add - * @return if the operation was successful (false meaning out-of-memory) - */ -FREERDP_API BOOL region16_union_rect(REGION16* dst, const REGION16* src, - const RECTANGLE_16* rect); + /** adds a rectangle in src and stores the resulting region in dst + * @param dst destination region + * @param src source region + * @param rect the rectangle to add + * @return if the operation was successful (false meaning out-of-memory) + */ + FREERDP_API BOOL region16_union_rect(REGION16* dst, const REGION16* src, + const RECTANGLE_16* rect); -/** returns if a rectangle intersects the region - * @param src the region - * @param arg2 the rectangle - * @return if region and rectangle intersect - */ -FREERDP_API BOOL region16_intersects_rect(const REGION16* src, - const RECTANGLE_16* arg2); + /** returns if a rectangle intersects the region + * @param src the region + * @param arg2 the rectangle + * @return if region and rectangle intersect + */ + FREERDP_API BOOL region16_intersects_rect(const REGION16* src, const RECTANGLE_16* arg2); -/** computes the intersection between a region and a rectangle - * @param dst destination region - * @param src the source region - * @param arg2 the rectangle that intersects - * @return if the operation was successful (false meaning out-of-memory) - */ -FREERDP_API BOOL region16_intersect_rect(REGION16* dst, const REGION16* src, - const RECTANGLE_16* arg2); + /** computes the intersection between a region and a rectangle + * @param dst destination region + * @param src the source region + * @param arg2 the rectangle that intersects + * @return if the operation was successful (false meaning out-of-memory) + */ + FREERDP_API BOOL region16_intersect_rect(REGION16* dst, const REGION16* src, + const RECTANGLE_16* arg2); -/** release internal data associated with this region - * @param region the region to release - */ -FREERDP_API void region16_uninit(REGION16* region); + /** release internal data associated with this region + * @param region the region to release + */ + FREERDP_API void region16_uninit(REGION16* region); #ifdef __cplusplus } diff --git a/include/freerdp/codec/rfx.h b/include/freerdp/codec/rfx.h index f8e9132f5..278af87c9 100644 --- a/include/freerdp/codec/rfx.h +++ b/include/freerdp/codec/rfx.h @@ -36,171 +36,168 @@ typedef struct _RFX_CONTEXT RFX_CONTEXT; #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -enum _RLGR_MODE -{ - RLGR1, - RLGR3 -}; -typedef enum _RLGR_MODE RLGR_MODE; + enum _RLGR_MODE + { + RLGR1, + RLGR3 + }; + typedef enum _RLGR_MODE RLGR_MODE; -struct _RFX_RECT -{ - UINT16 x; - UINT16 y; - UINT16 width; - UINT16 height; -}; + struct _RFX_RECT + { + UINT16 x; + UINT16 y; + UINT16 width; + UINT16 height; + }; -struct _RFX_TILE -{ - UINT16 x; - UINT16 y; - UINT32 width; - UINT32 height; - BYTE* data; - UINT32 scanline; - BOOL allocated; - BYTE quantIdxY; - BYTE quantIdxCb; - BYTE quantIdxCr; - UINT16 xIdx; - UINT16 yIdx; - UINT16 YLen; - UINT16 CbLen; - UINT16 CrLen; - BYTE* YData; - BYTE* CbData; - BYTE* CrData; - BYTE* YCbCrData; -}; + struct _RFX_TILE + { + UINT16 x; + UINT16 y; + UINT32 width; + UINT32 height; + BYTE* data; + UINT32 scanline; + BOOL allocated; + BYTE quantIdxY; + BYTE quantIdxCb; + BYTE quantIdxCr; + UINT16 xIdx; + UINT16 yIdx; + UINT16 YLen; + UINT16 CbLen; + UINT16 CrLen; + BYTE* YData; + BYTE* CbData; + BYTE* CrData; + BYTE* YCbCrData; + }; -struct _RFX_MESSAGE -{ - UINT32 frameIdx; + struct _RFX_MESSAGE + { + UINT32 frameIdx; - /** - * The rects array represents the updated region of the frame. The UI - * requires to clip drawing destination base on the union of the rects. - */ - UINT16 numRects; - RFX_RECT* rects; - BOOL freeRects; + /** + * The rects array represents the updated region of the frame. The UI + * requires to clip drawing destination base on the union of the rects. + */ + UINT16 numRects; + RFX_RECT* rects; + BOOL freeRects; - /** - * The tiles array represents the actual frame data. Each tile is always - * 64x64. Note that only pixels inside the updated region (represented as - * rects described above) are valid. Pixels outside of the region may - * contain arbitrary data. - */ - UINT16 numTiles; - RFX_TILE** tiles; + /** + * The tiles array represents the actual frame data. Each tile is always + * 64x64. Note that only pixels inside the updated region (represented as + * rects described above) are valid. Pixels outside of the region may + * contain arbitrary data. + */ + UINT16 numTiles; + RFX_TILE** tiles; - UINT16 numQuant; - UINT32* quantVals; + UINT16 numQuant; + UINT32* quantVals; - UINT32 tilesDataSize; + UINT32 tilesDataSize; - BOOL freeArray; -}; + BOOL freeArray; + }; -typedef struct _RFX_CONTEXT_PRIV RFX_CONTEXT_PRIV; + typedef struct _RFX_CONTEXT_PRIV RFX_CONTEXT_PRIV; -enum _RFX_STATE -{ - RFX_STATE_INITIAL, - RFX_STATE_SERVER_UNINITIALIZED, - RFX_STATE_SEND_HEADERS, - RFX_STATE_SEND_FRAME_DATA, - RFX_STATE_FRAME_DATA_SENT, - RFX_STATE_FINAL -}; -typedef enum _RFX_STATE RFX_STATE; + enum _RFX_STATE + { + RFX_STATE_INITIAL, + RFX_STATE_SERVER_UNINITIALIZED, + RFX_STATE_SEND_HEADERS, + RFX_STATE_SEND_FRAME_DATA, + RFX_STATE_FRAME_DATA_SENT, + RFX_STATE_FINAL + }; + typedef enum _RFX_STATE RFX_STATE; -#define _RFX_DECODED_SYNC 0x00000001 -#define _RFX_DECODED_CONTEXT 0x00000002 -#define _RFX_DECODED_VERSIONS 0x00000004 -#define _RFX_DECODED_CHANNELS 0x00000008 -#define _RFX_DECODED_HEADERS 0x0000000F +#define _RFX_DECODED_SYNC 0x00000001 +#define _RFX_DECODED_CONTEXT 0x00000002 +#define _RFX_DECODED_VERSIONS 0x00000004 +#define _RFX_DECODED_CHANNELS 0x00000008 +#define _RFX_DECODED_HEADERS 0x0000000F + struct _RFX_CONTEXT + { + RFX_STATE state; -struct _RFX_CONTEXT -{ - RFX_STATE state; + BOOL encoder; + UINT16 flags; + UINT16 properties; + UINT16 width; + UINT16 height; + RLGR_MODE mode; + UINT32 version; + UINT32 codec_id; + UINT32 codec_version; + UINT32 pixel_format; + BYTE bits_per_pixel; - BOOL encoder; - UINT16 flags; - UINT16 properties; - UINT16 width; - UINT16 height; - RLGR_MODE mode; - UINT32 version; - UINT32 codec_id; - UINT32 codec_version; - UINT32 pixel_format; - BYTE bits_per_pixel; + /* color palette allocated by the application */ + const BYTE* palette; - /* color palette allocated by the application */ - const BYTE* palette; + /* temporary data within a frame */ + UINT32 frameIdx; + BYTE numQuant; + UINT32* quants; + BYTE quantIdxY; + BYTE quantIdxCb; + BYTE quantIdxCr; - /* temporary data within a frame */ - UINT32 frameIdx; - BYTE numQuant; - UINT32* quants; - BYTE quantIdxY; - BYTE quantIdxCb; - BYTE quantIdxCr; + /* decoded header blocks */ + UINT32 decodedHeaderBlocks; + UINT16 expectedDataBlockType; + RFX_MESSAGE currentMessage; - /* decoded header blocks */ - UINT32 decodedHeaderBlocks; - UINT16 expectedDataBlockType; - RFX_MESSAGE currentMessage; + /* routines */ + void (*quantization_decode)(INT16* buffer, const UINT32* quantization_values); + void (*quantization_encode)(INT16* buffer, const UINT32* quantization_values); + void (*dwt_2d_decode)(INT16* buffer, INT16* dwt_buffer); + void (*dwt_2d_encode)(INT16* buffer, INT16* dwt_buffer); + int (*rlgr_decode)(RLGR_MODE mode, const BYTE* data, UINT32 data_size, INT16* buffer, + UINT32 buffer_size); + int (*rlgr_encode)(RLGR_MODE mode, const INT16* data, UINT32 data_size, BYTE* buffer, + UINT32 buffer_size); - /* routines */ - void (*quantization_decode)(INT16* buffer, const UINT32* quantization_values); - void (*quantization_encode)(INT16* buffer, const UINT32* quantization_values); - void (*dwt_2d_decode)(INT16* buffer, INT16* dwt_buffer); - void (*dwt_2d_encode)(INT16* buffer, INT16* dwt_buffer); - int (*rlgr_decode)(RLGR_MODE mode, const BYTE* data, UINT32 data_size, INT16* buffer, UINT32 buffer_size); - int (*rlgr_encode)(RLGR_MODE mode, const INT16* data, UINT32 data_size, BYTE* buffer, UINT32 buffer_size); + /* private definitions */ + RFX_CONTEXT_PRIV* priv; + }; - /* private definitions */ - RFX_CONTEXT_PRIV* priv; -}; + FREERDP_API void rfx_context_set_pixel_format(RFX_CONTEXT* context, UINT32 pixel_format); -FREERDP_API void rfx_context_set_pixel_format(RFX_CONTEXT* context, - UINT32 pixel_format); + FREERDP_API BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length, + UINT32 left, UINT32 top, BYTE* dst, UINT32 dstFormat, + UINT32 dstStride, UINT32 dstHeight, + REGION16* invalidRegion); + FREERDP_API UINT16 rfx_message_get_tile_count(RFX_MESSAGE* message); + FREERDP_API UINT16 rfx_message_get_rect_count(RFX_MESSAGE* message); + FREERDP_API void rfx_message_free(RFX_CONTEXT* context, RFX_MESSAGE* message); -FREERDP_API BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length, - UINT32 left, UINT32 top, - BYTE* dst, UINT32 dstFormat, - UINT32 dstStride, UINT32 dstHeight, - REGION16* invalidRegion); -FREERDP_API UINT16 rfx_message_get_tile_count(RFX_MESSAGE* message); -FREERDP_API UINT16 rfx_message_get_rect_count(RFX_MESSAGE* message); -FREERDP_API void rfx_message_free(RFX_CONTEXT* context, RFX_MESSAGE* message); + FREERDP_API BOOL rfx_compose_message(RFX_CONTEXT* context, wStream* s, const RFX_RECT* rects, + int num_rects, BYTE* image_data, int width, int height, + int rowstride); -FREERDP_API BOOL rfx_compose_message(RFX_CONTEXT* context, wStream* s, - const RFX_RECT* rects, int num_rects, BYTE* image_data, int width, int height, - int rowstride); + FREERDP_API RFX_MESSAGE* rfx_encode_message(RFX_CONTEXT* context, const RFX_RECT* rects, + int numRects, BYTE* data, int width, int height, + int scanline); + FREERDP_API RFX_MESSAGE* rfx_encode_messages(RFX_CONTEXT* context, const RFX_RECT* rects, + int numRects, BYTE* data, int width, int height, + int scanline, int* numMessages, int maxDataSize); + FREERDP_API BOOL rfx_write_message(RFX_CONTEXT* context, wStream* s, RFX_MESSAGE* message); -FREERDP_API RFX_MESSAGE* rfx_encode_message(RFX_CONTEXT* context, - const RFX_RECT* rects, - int numRects, BYTE* data, int width, int height, int scanline); -FREERDP_API RFX_MESSAGE* rfx_encode_messages(RFX_CONTEXT* context, - const RFX_RECT* rects, int numRects, - BYTE* data, int width, int height, int scanline, int* numMessages, - int maxDataSize); -FREERDP_API BOOL rfx_write_message(RFX_CONTEXT* context, wStream* s, - RFX_MESSAGE* message); + FREERDP_API BOOL rfx_context_reset(RFX_CONTEXT* context, UINT32 width, UINT32 height); -FREERDP_API BOOL rfx_context_reset(RFX_CONTEXT* context, UINT32 width, - UINT32 height); - -FREERDP_API RFX_CONTEXT* rfx_context_new(BOOL encoder); -FREERDP_API void rfx_context_free(RFX_CONTEXT* context); + FREERDP_API RFX_CONTEXT* rfx_context_new(BOOL encoder); + FREERDP_API void rfx_context_free(RFX_CONTEXT* context); #ifdef __cplusplus } diff --git a/include/freerdp/codec/xcrush.h b/include/freerdp/codec/xcrush.h index 1feb96d57..62e9a2464 100644 --- a/include/freerdp/codec/xcrush.h +++ b/include/freerdp/codec/xcrush.h @@ -97,20 +97,22 @@ struct _XCRUSH_CONTEXT typedef struct _XCRUSH_CONTEXT XCRUSH_CONTEXT; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API int xcrush_compress(XCRUSH_CONTEXT* xcrush, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags); -FREERDP_API int xcrush_decompress(XCRUSH_CONTEXT* xcrush, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32 flags); + FREERDP_API int xcrush_compress(XCRUSH_CONTEXT* xcrush, BYTE* pSrcData, UINT32 SrcSize, + BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags); + FREERDP_API int xcrush_decompress(XCRUSH_CONTEXT* xcrush, BYTE* pSrcData, UINT32 SrcSize, + BYTE** ppDstData, UINT32* pDstSize, UINT32 flags); -FREERDP_API void xcrush_context_reset(XCRUSH_CONTEXT* xcrush, BOOL flush); + FREERDP_API void xcrush_context_reset(XCRUSH_CONTEXT* xcrush, BOOL flush); -FREERDP_API XCRUSH_CONTEXT* xcrush_context_new(BOOL Compressor); -FREERDP_API void xcrush_context_free(XCRUSH_CONTEXT* xcrush); + FREERDP_API XCRUSH_CONTEXT* xcrush_context_new(BOOL Compressor); + FREERDP_API void xcrush_context_free(XCRUSH_CONTEXT* xcrush); #ifdef __cplusplus } #endif #endif /* FREERDP_CODEC_XCRUSH_H */ - diff --git a/include/freerdp/codec/yuv.h b/include/freerdp/codec/yuv.h index 1497db2f6..b23c347f1 100644 --- a/include/freerdp/codec/yuv.h +++ b/include/freerdp/codec/yuv.h @@ -27,19 +27,19 @@ typedef struct _YUV_CONTEXT YUV_CONTEXT; #include #include - #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif + FREERDP_API BOOL yuv_context_decode(YUV_CONTEXT* context, const BYTE* pYUVData[3], + UINT32 iStride[3], DWORD DstFormat, BYTE* dest, + UINT32 nDstStep); -FREERDP_API BOOL yuv_context_decode(YUV_CONTEXT* context, const BYTE* pYUVData[3], UINT32 iStride[3], - DWORD DstFormat, BYTE *dest, UINT32 nDstStep); + FREERDP_API void yuv_context_reset(YUV_CONTEXT* context, UINT32 width, UINT32 height); -FREERDP_API void yuv_context_reset(YUV_CONTEXT* context, UINT32 width, UINT32 height); - -FREERDP_API YUV_CONTEXT* yuv_context_new(BOOL encoder); -FREERDP_API void yuv_context_free(YUV_CONTEXT* context); + FREERDP_API YUV_CONTEXT* yuv_context_new(BOOL encoder); + FREERDP_API void yuv_context_free(YUV_CONTEXT* context); #ifdef __cplusplus } diff --git a/include/freerdp/codec/zgfx.h b/include/freerdp/codec/zgfx.h index b0faf6e0d..17038b6b6 100644 --- a/include/freerdp/codec/zgfx.h +++ b/include/freerdp/codec/zgfx.h @@ -25,34 +25,35 @@ #include -#define ZGFX_SEGMENTED_SINGLE 0xE0 -#define ZGFX_SEGMENTED_MULTIPART 0xE1 +#define ZGFX_SEGMENTED_SINGLE 0xE0 +#define ZGFX_SEGMENTED_MULTIPART 0xE1 -#define ZGFX_PACKET_COMPR_TYPE_RDP8 0x04 +#define ZGFX_PACKET_COMPR_TYPE_RDP8 0x04 -#define ZGFX_SEGMENTED_MAXSIZE 65535 +#define ZGFX_SEGMENTED_MAXSIZE 65535 typedef struct _ZGFX_CONTEXT ZGFX_CONTEXT; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API int zgfx_decompress(ZGFX_CONTEXT* zgfx, const BYTE* pSrcData, UINT32 SrcSize, - BYTE** ppDstData, UINT32* pDstSize, UINT32 flags); -FREERDP_API int zgfx_compress(ZGFX_CONTEXT* zgfx, const BYTE* pSrcData, UINT32 SrcSize, - BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags); -FREERDP_API int zgfx_compress_to_stream(ZGFX_CONTEXT* zgfx, wStream* sDst, - const BYTE* pUncompressed, UINT32 uncompressedSize, UINT32* pFlags); + FREERDP_API int zgfx_decompress(ZGFX_CONTEXT* zgfx, const BYTE* pSrcData, UINT32 SrcSize, + BYTE** ppDstData, UINT32* pDstSize, UINT32 flags); + FREERDP_API int zgfx_compress(ZGFX_CONTEXT* zgfx, const BYTE* pSrcData, UINT32 SrcSize, + BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags); + FREERDP_API int zgfx_compress_to_stream(ZGFX_CONTEXT* zgfx, wStream* sDst, + const BYTE* pUncompressed, UINT32 uncompressedSize, + UINT32* pFlags); -FREERDP_API void zgfx_context_reset(ZGFX_CONTEXT* zgfx, BOOL flush); + FREERDP_API void zgfx_context_reset(ZGFX_CONTEXT* zgfx, BOOL flush); -FREERDP_API ZGFX_CONTEXT* zgfx_context_new(BOOL Compressor); -FREERDP_API void zgfx_context_free(ZGFX_CONTEXT* zgfx); + FREERDP_API ZGFX_CONTEXT* zgfx_context_new(BOOL Compressor); + FREERDP_API void zgfx_context_free(ZGFX_CONTEXT* zgfx); #ifdef __cplusplus } #endif #endif /* FREERDP_CODEC_ZGFX_H */ - diff --git a/include/freerdp/codecs.h b/include/freerdp/codecs.h index 37661c080..b1134d121 100644 --- a/include/freerdp/codecs.h +++ b/include/freerdp/codecs.h @@ -32,16 +32,16 @@ #include #include -#define FREERDP_CODEC_INTERLEAVED 0x00000001 -#define FREERDP_CODEC_PLANAR 0x00000002 -#define FREERDP_CODEC_NSCODEC 0x00000004 -#define FREERDP_CODEC_REMOTEFX 0x00000008 -#define FREERDP_CODEC_CLEARCODEC 0x00000010 -#define FREERDP_CODEC_ALPHACODEC 0x00000020 -#define FREERDP_CODEC_PROGRESSIVE 0x00000040 -#define FREERDP_CODEC_AVC420 0x00000080 -#define FREERDP_CODEC_AVC444 0x00000100 -#define FREERDP_CODEC_ALL 0xFFFFFFFF +#define FREERDP_CODEC_INTERLEAVED 0x00000001 +#define FREERDP_CODEC_PLANAR 0x00000002 +#define FREERDP_CODEC_NSCODEC 0x00000004 +#define FREERDP_CODEC_REMOTEFX 0x00000008 +#define FREERDP_CODEC_CLEARCODEC 0x00000010 +#define FREERDP_CODEC_ALPHACODEC 0x00000020 +#define FREERDP_CODEC_PROGRESSIVE 0x00000040 +#define FREERDP_CODEC_AVC420 0x00000080 +#define FREERDP_CODEC_AVC444 0x00000100 +#define FREERDP_CODEC_ALL 0xFFFFFFFF struct rdp_codecs { @@ -57,20 +57,20 @@ struct rdp_codecs }; #ifdef __cplusplus - extern "C" { +extern "C" +{ #endif -FREERDP_API BOOL freerdp_client_codecs_prepare(rdpCodecs* codecs, UINT32 flags, - UINT32 width, UINT32 height); -FREERDP_API BOOL freerdp_client_codecs_reset(rdpCodecs* codecs, UINT32 flags, - UINT32 width, UINT32 height); + FREERDP_API BOOL freerdp_client_codecs_prepare(rdpCodecs* codecs, UINT32 flags, UINT32 width, + UINT32 height); + FREERDP_API BOOL freerdp_client_codecs_reset(rdpCodecs* codecs, UINT32 flags, UINT32 width, + UINT32 height); -FREERDP_API rdpCodecs* codecs_new(rdpContext* context); -FREERDP_API void codecs_free(rdpCodecs* codecs); + FREERDP_API rdpCodecs* codecs_new(rdpContext* context); + FREERDP_API void codecs_free(rdpCodecs* codecs); #ifdef __cplusplus - } +} #endif #endif /* FREERDP_CODECS_H */ - diff --git a/include/freerdp/constants.h b/include/freerdp/constants.h index b6d17de87..d7949efa4 100644 --- a/include/freerdp/constants.h +++ b/include/freerdp/constants.h @@ -35,29 +35,29 @@ enum RDP_CODEC_ID /** * CPU Optimization flags */ -#define CPU_SSE2 0x1 +#define CPU_SSE2 0x1 /** * OSMajorType */ -#define OSMAJORTYPE_UNSPECIFIED 0x0000 -#define OSMAJORTYPE_WINDOWS 0x0001 -#define OSMAJORTYPE_OS2 0x0002 -#define OSMAJORTYPE_MACINTOSH 0x0003 -#define OSMAJORTYPE_UNIX 0x0004 +#define OSMAJORTYPE_UNSPECIFIED 0x0000 +#define OSMAJORTYPE_WINDOWS 0x0001 +#define OSMAJORTYPE_OS2 0x0002 +#define OSMAJORTYPE_MACINTOSH 0x0003 +#define OSMAJORTYPE_UNIX 0x0004 /** * OSMinorType */ -#define OSMINORTYPE_UNSPECIFIED 0x0000 -#define OSMINORTYPE_WINDOWS_31X 0x0001 -#define OSMINORTYPE_WINDOWS_95 0x0002 -#define OSMINORTYPE_WINDOWS_NT 0x0003 -#define OSMINORTYPE_OS2_V21 0x0004 -#define OSMINORTYPE_POWER_PC 0x0005 -#define OSMINORTYPE_MACINTOSH 0x0006 -#define OSMINORTYPE_NATIVE_XSERVER 0x0007 -#define OSMINORTYPE_PSEUDO_XSERVER 0x0008 -#define OSMINORTYPE_NATIVE_WAYLAND 0x0009 +#define OSMINORTYPE_UNSPECIFIED 0x0000 +#define OSMINORTYPE_WINDOWS_31X 0x0001 +#define OSMINORTYPE_WINDOWS_95 0x0002 +#define OSMINORTYPE_WINDOWS_NT 0x0003 +#define OSMINORTYPE_OS2_V21 0x0004 +#define OSMINORTYPE_POWER_PC 0x0005 +#define OSMINORTYPE_MACINTOSH 0x0006 +#define OSMINORTYPE_NATIVE_XSERVER 0x0007 +#define OSMINORTYPE_PSEUDO_XSERVER 0x0008 +#define OSMINORTYPE_NATIVE_WAYLAND 0x0009 #endif /* FREERDP_CONSTANTS_H */ diff --git a/include/freerdp/crypto/ber.h b/include/freerdp/crypto/ber.h index 1d0a9f793..e6035c8df 100644 --- a/include/freerdp/crypto/ber.h +++ b/include/freerdp/crypto/ber.h @@ -28,61 +28,62 @@ /* BER type */ /* Class - bits 8 and 7 */ -#define BER_CLASS_MASK 0xC0 -#define BER_CLASS_UNIV 0x00 /* 0 0 */ -#define BER_CLASS_APPL 0x40 /* 0 1 */ -#define BER_CLASS_CTXT 0x80 /* 1 0 */ -#define BER_CLASS_PRIV 0xC0 /* 1 1 */ +#define BER_CLASS_MASK 0xC0 +#define BER_CLASS_UNIV 0x00 /* 0 0 */ +#define BER_CLASS_APPL 0x40 /* 0 1 */ +#define BER_CLASS_CTXT 0x80 /* 1 0 */ +#define BER_CLASS_PRIV 0xC0 /* 1 1 */ /* P/C - bit 6 */ -#define BER_PC_MASK 0x20 -#define BER_PRIMITIVE 0x00 /* 0 */ -#define BER_CONSTRUCT 0x20 /* 1 */ +#define BER_PC_MASK 0x20 +#define BER_PRIMITIVE 0x00 /* 0 */ +#define BER_CONSTRUCT 0x20 /* 1 */ /* Tag - bits 5 to 1 */ -#define BER_TAG_MASK 0x1F -#define BER_TAG_BOOLEAN 0x01 -#define BER_TAG_INTEGER 0x02 -#define BER_TAG_BIT_STRING 0x03 -#define BER_TAG_OCTET_STRING 0x04 -#define BER_TAG_OBJECT_IDENFIER 0x06 -#define BER_TAG_ENUMERATED 0x0A -#define BER_TAG_SEQUENCE 0x10 -#define BER_TAG_SEQUENCE_OF 0x10 +#define BER_TAG_MASK 0x1F +#define BER_TAG_BOOLEAN 0x01 +#define BER_TAG_INTEGER 0x02 +#define BER_TAG_BIT_STRING 0x03 +#define BER_TAG_OCTET_STRING 0x04 +#define BER_TAG_OBJECT_IDENFIER 0x06 +#define BER_TAG_ENUMERATED 0x0A +#define BER_TAG_SEQUENCE 0x10 +#define BER_TAG_SEQUENCE_OF 0x10 -#define BER_PC(_pc) (_pc ? BER_CONSTRUCT : BER_PRIMITIVE) +#define BER_PC(_pc) (_pc ? BER_CONSTRUCT : BER_PRIMITIVE) #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API BOOL ber_read_length(wStream* s, size_t* length); -FREERDP_API size_t ber_write_length(wStream* s, size_t length); -FREERDP_API size_t _ber_sizeof_length(size_t length); -FREERDP_API BOOL ber_read_universal_tag(wStream* s, BYTE tag, BOOL pc); -FREERDP_API size_t ber_write_universal_tag(wStream* s, BYTE tag, BOOL pc); -FREERDP_API BOOL ber_read_application_tag(wStream* s, BYTE tag, size_t* length); -FREERDP_API void ber_write_application_tag(wStream* s, BYTE tag, size_t length); -FREERDP_API BOOL ber_read_enumerated(wStream* s, BYTE* enumerated, BYTE count); -FREERDP_API void ber_write_enumerated(wStream* s, BYTE enumerated, BYTE count); -FREERDP_API BOOL ber_read_contextual_tag(wStream* s, BYTE tag, size_t* length, BOOL pc); -FREERDP_API size_t ber_write_contextual_tag(wStream* s, BYTE tag, size_t length, BOOL pc); -FREERDP_API size_t ber_sizeof_contextual_tag(size_t length); -FREERDP_API BOOL ber_read_sequence_tag(wStream* s, size_t* length); -FREERDP_API size_t ber_write_sequence_tag(wStream* s, size_t length); -FREERDP_API size_t ber_sizeof_sequence(size_t length); -FREERDP_API size_t ber_sizeof_sequence_tag(size_t length); -FREERDP_API BOOL ber_read_bit_string(wStream* s, size_t* length, BYTE* padding); -FREERDP_API size_t ber_write_octet_string(wStream* s, const BYTE* oct_str, size_t length); -FREERDP_API BOOL ber_read_octet_string_tag(wStream* s, size_t* length); -FREERDP_API size_t ber_write_octet_string_tag(wStream* s, size_t length); -FREERDP_API size_t ber_sizeof_octet_string(size_t length); -FREERDP_API BOOL ber_read_BOOL(wStream* s, BOOL* value); -FREERDP_API void ber_write_BOOL(wStream* s, BOOL value); -FREERDP_API BOOL ber_read_integer(wStream* s, UINT32* value); -FREERDP_API size_t ber_write_integer(wStream* s, UINT32 value); -FREERDP_API BOOL ber_read_integer_length(wStream* s, size_t* length); -FREERDP_API size_t ber_sizeof_integer(UINT32 value); + FREERDP_API BOOL ber_read_length(wStream* s, size_t* length); + FREERDP_API size_t ber_write_length(wStream* s, size_t length); + FREERDP_API size_t _ber_sizeof_length(size_t length); + FREERDP_API BOOL ber_read_universal_tag(wStream* s, BYTE tag, BOOL pc); + FREERDP_API size_t ber_write_universal_tag(wStream* s, BYTE tag, BOOL pc); + FREERDP_API BOOL ber_read_application_tag(wStream* s, BYTE tag, size_t* length); + FREERDP_API void ber_write_application_tag(wStream* s, BYTE tag, size_t length); + FREERDP_API BOOL ber_read_enumerated(wStream* s, BYTE* enumerated, BYTE count); + FREERDP_API void ber_write_enumerated(wStream* s, BYTE enumerated, BYTE count); + FREERDP_API BOOL ber_read_contextual_tag(wStream* s, BYTE tag, size_t* length, BOOL pc); + FREERDP_API size_t ber_write_contextual_tag(wStream* s, BYTE tag, size_t length, BOOL pc); + FREERDP_API size_t ber_sizeof_contextual_tag(size_t length); + FREERDP_API BOOL ber_read_sequence_tag(wStream* s, size_t* length); + FREERDP_API size_t ber_write_sequence_tag(wStream* s, size_t length); + FREERDP_API size_t ber_sizeof_sequence(size_t length); + FREERDP_API size_t ber_sizeof_sequence_tag(size_t length); + FREERDP_API BOOL ber_read_bit_string(wStream* s, size_t* length, BYTE* padding); + FREERDP_API size_t ber_write_octet_string(wStream* s, const BYTE* oct_str, size_t length); + FREERDP_API BOOL ber_read_octet_string_tag(wStream* s, size_t* length); + FREERDP_API size_t ber_write_octet_string_tag(wStream* s, size_t length); + FREERDP_API size_t ber_sizeof_octet_string(size_t length); + FREERDP_API BOOL ber_read_BOOL(wStream* s, BOOL* value); + FREERDP_API void ber_write_BOOL(wStream* s, BOOL value); + FREERDP_API BOOL ber_read_integer(wStream* s, UINT32* value); + FREERDP_API size_t ber_write_integer(wStream* s, UINT32 value); + FREERDP_API BOOL ber_read_integer_length(wStream* s, size_t* length); + FREERDP_API size_t ber_sizeof_integer(UINT32 value); #ifdef __cplusplus } diff --git a/include/freerdp/crypto/certificate.h b/include/freerdp/crypto/certificate.h index 64364f22d..12929f49a 100644 --- a/include/freerdp/crypto/certificate.h +++ b/include/freerdp/crypto/certificate.h @@ -51,32 +51,25 @@ struct rdp_certificate_store }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API rdpCertificateData* certificate_data_new( - const char* hostname, UINT16 port, const char* subject, - const char* issuer, const char* fingerprint); -FREERDP_API void certificate_data_free( - rdpCertificateData* certificate_data); -FREERDP_API rdpCertificateStore* certificate_store_new( - rdpSettings* settings); -FREERDP_API BOOL certificate_data_replace( - rdpCertificateStore* certificate_store, - rdpCertificateData* certificate_data); -FREERDP_API void certificate_store_free( - rdpCertificateStore* certificate_store); -FREERDP_API int certificate_data_match( - rdpCertificateStore* certificate_store, - rdpCertificateData* certificate_data); -FREERDP_API BOOL certificate_data_print( - rdpCertificateStore* certificate_store, - rdpCertificateData* certificate_data); -FREERDP_API BOOL certificate_get_stored_data( - rdpCertificateStore* certificate_store, - rdpCertificateData* certificate_data, - char** subject, char** issuer, - char** fingerprint); + FREERDP_API rdpCertificateData* certificate_data_new(const char* hostname, UINT16 port, + const char* subject, const char* issuer, + const char* fingerprint); + FREERDP_API void certificate_data_free(rdpCertificateData* certificate_data); + FREERDP_API rdpCertificateStore* certificate_store_new(rdpSettings* settings); + FREERDP_API BOOL certificate_data_replace(rdpCertificateStore* certificate_store, + rdpCertificateData* certificate_data); + FREERDP_API void certificate_store_free(rdpCertificateStore* certificate_store); + FREERDP_API int certificate_data_match(rdpCertificateStore* certificate_store, + rdpCertificateData* certificate_data); + FREERDP_API BOOL certificate_data_print(rdpCertificateStore* certificate_store, + rdpCertificateData* certificate_data); + FREERDP_API BOOL certificate_get_stored_data(rdpCertificateStore* certificate_store, + rdpCertificateData* certificate_data, + char** subject, char** issuer, char** fingerprint); #ifdef __cplusplus } diff --git a/include/freerdp/crypto/crypto.h b/include/freerdp/crypto/crypto.h index f96b1787c..463ff43c5 100644 --- a/include/freerdp/crypto/crypto.h +++ b/include/freerdp/crypto/crypto.h @@ -34,7 +34,7 @@ #define D2I_X509_CONST #endif -#define EXPONENT_MAX_SIZE 4 +#define EXPONENT_MAX_SIZE 4 #include #include @@ -43,61 +43,66 @@ struct crypto_cert_struct { X509* px509; - STACK_OF(X509)* px509chain; + STACK_OF(X509) * px509chain; }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct crypto_cert_struct* CryptoCert; + typedef struct crypto_cert_struct* CryptoCert; -FREERDP_API CryptoCert crypto_cert_read(BYTE* data, UINT32 length); -FREERDP_API char* crypto_cert_fingerprint(X509* xcert); -FREERDP_API char* crypto_cert_subject(X509* xcert); -FREERDP_API char* crypto_cert_subject_common_name(X509* xcert, int* length); -FREERDP_API char** crypto_cert_get_dns_names(X509* xcert, int* count, int** lengths); -FREERDP_API char* crypto_cert_get_email(X509* x509); -FREERDP_API char* crypto_cert_get_upn(X509* x509); -FREERDP_API void crypto_cert_dns_names_free(int count, int* lengths, char** dns_names); -FREERDP_API char* crypto_cert_issuer(X509* xcert); -FREERDP_API void crypto_cert_print_info(X509* xcert); -FREERDP_API void crypto_cert_free(CryptoCert cert); + FREERDP_API CryptoCert crypto_cert_read(BYTE* data, UINT32 length); + FREERDP_API char* crypto_cert_fingerprint(X509* xcert); + FREERDP_API char* crypto_cert_subject(X509* xcert); + FREERDP_API char* crypto_cert_subject_common_name(X509* xcert, int* length); + FREERDP_API char** crypto_cert_get_dns_names(X509* xcert, int* count, int** lengths); + FREERDP_API char* crypto_cert_get_email(X509* x509); + FREERDP_API char* crypto_cert_get_upn(X509* x509); + FREERDP_API void crypto_cert_dns_names_free(int count, int* lengths, char** dns_names); + FREERDP_API char* crypto_cert_issuer(X509* xcert); + FREERDP_API void crypto_cert_print_info(X509* xcert); + FREERDP_API void crypto_cert_free(CryptoCert cert); -/* -Deprecated function names: crypto_cert_subject_alt_name and crypto_cert_subject_alt_name_free. -Use crypto_cert_get_dns_names and crypto_cert_dns_names_free instead. -(old names kept for now for compatibility of FREERDP_API). -Note: email and upn amongst others are also alt_names, -but the old crypto_cert_get_alt_names returned only the dns_names -*/ -FREERDP_API char** crypto_cert_subject_alt_name(X509* xcert, int* count, int** lengths); -FREERDP_API void crypto_cert_subject_alt_name_free(int count, int* lengths, char** alt_names); + /* + Deprecated function names: crypto_cert_subject_alt_name and crypto_cert_subject_alt_name_free. + Use crypto_cert_get_dns_names and crypto_cert_dns_names_free instead. + (old names kept for now for compatibility of FREERDP_API). + Note: email and upn amongst others are also alt_names, + but the old crypto_cert_get_alt_names returned only the dns_names + */ + FREERDP_API char** crypto_cert_subject_alt_name(X509* xcert, int* count, int** lengths); + FREERDP_API void crypto_cert_subject_alt_name_free(int count, int* lengths, char** alt_names); -FREERDP_API BOOL x509_verify_certificate(CryptoCert cert, const char* certificate_store_path); -FREERDP_API rdpCertificateData* crypto_get_certificate_data(X509* xcert, const char* hostname, - UINT16 port); -FREERDP_API BOOL crypto_cert_get_public_key(CryptoCert cert, BYTE** PublicKey, - DWORD* PublicKeyLength); + FREERDP_API BOOL x509_verify_certificate(CryptoCert cert, const char* certificate_store_path); + FREERDP_API rdpCertificateData* crypto_get_certificate_data(X509* xcert, const char* hostname, + UINT16 port); + FREERDP_API BOOL crypto_cert_get_public_key(CryptoCert cert, BYTE** PublicKey, + DWORD* PublicKeyLength); -#define TSSK_KEY_LENGTH 64 -extern const BYTE tssk_modulus[]; -extern const BYTE tssk_privateExponent[]; -extern const BYTE tssk_exponent[]; +#define TSSK_KEY_LENGTH 64 + extern const BYTE tssk_modulus[]; + extern const BYTE tssk_privateExponent[]; + extern const BYTE tssk_exponent[]; -FREERDP_API int crypto_rsa_public_encrypt(const BYTE* input, int length, UINT32 key_length, - const BYTE* modulus, const BYTE* exponent, BYTE* output); -FREERDP_API int crypto_rsa_public_decrypt(const BYTE* input, int length, UINT32 key_length, - const BYTE* modulus, const BYTE* exponent, BYTE* output); -FREERDP_API int crypto_rsa_private_encrypt(const BYTE* input, int length, UINT32 key_length, - const BYTE* modulus, const BYTE* private_exponent, BYTE* output); -FREERDP_API int crypto_rsa_private_decrypt(const BYTE* input, int length, UINT32 key_length, - const BYTE* modulus, const BYTE* private_exponent, BYTE* output); -FREERDP_API void crypto_reverse(BYTE* data, int length); + FREERDP_API int crypto_rsa_public_encrypt(const BYTE* input, int length, UINT32 key_length, + const BYTE* modulus, const BYTE* exponent, + BYTE* output); + FREERDP_API int crypto_rsa_public_decrypt(const BYTE* input, int length, UINT32 key_length, + const BYTE* modulus, const BYTE* exponent, + BYTE* output); + FREERDP_API int crypto_rsa_private_encrypt(const BYTE* input, int length, UINT32 key_length, + const BYTE* modulus, const BYTE* private_exponent, + BYTE* output); + FREERDP_API int crypto_rsa_private_decrypt(const BYTE* input, int length, UINT32 key_length, + const BYTE* modulus, const BYTE* private_exponent, + BYTE* output); + FREERDP_API void crypto_reverse(BYTE* data, int length); -FREERDP_API char* crypto_base64_encode(const BYTE* data, int length); -FREERDP_API void crypto_base64_decode(const char* enc_data, int length, BYTE** dec_data, - int* res_length); + FREERDP_API char* crypto_base64_encode(const BYTE* data, int length); + FREERDP_API void crypto_base64_decode(const char* enc_data, int length, BYTE** dec_data, + int* res_length); #ifdef __cplusplus } diff --git a/include/freerdp/crypto/der.h b/include/freerdp/crypto/der.h index 3e75a4d39..8ec27f08f 100644 --- a/include/freerdp/crypto/der.h +++ b/include/freerdp/crypto/der.h @@ -23,21 +23,22 @@ #include #ifdef __cplusplus - extern "C" { +extern "C" +{ #endif -FREERDP_API int _der_skip_length(int length); -FREERDP_API int der_write_length(wStream* s, int length); -FREERDP_API int der_get_content_length(int length); -FREERDP_API int der_skip_octet_string(int length); -FREERDP_API int der_skip_sequence_tag(int length); -FREERDP_API int der_write_sequence_tag(wStream* s, int length); -FREERDP_API int der_skip_contextual_tag(int length); -FREERDP_API int der_write_contextual_tag(wStream* s, BYTE tag, int length, BOOL pc); -FREERDP_API void der_write_octet_string(wStream* s, BYTE* oct_str, int length); + FREERDP_API int _der_skip_length(int length); + FREERDP_API int der_write_length(wStream* s, int length); + FREERDP_API int der_get_content_length(int length); + FREERDP_API int der_skip_octet_string(int length); + FREERDP_API int der_skip_sequence_tag(int length); + FREERDP_API int der_write_sequence_tag(wStream* s, int length); + FREERDP_API int der_skip_contextual_tag(int length); + FREERDP_API int der_write_contextual_tag(wStream* s, BYTE tag, int length, BOOL pc); + FREERDP_API void der_write_octet_string(wStream* s, BYTE* oct_str, int length); #ifdef __cplusplus - } +} #endif #endif /* FREERDP_CRYPTO_DER_H */ diff --git a/include/freerdp/crypto/er.h b/include/freerdp/crypto/er.h index 3f70fef3b..43cb8af55 100644 --- a/include/freerdp/crypto/er.h +++ b/include/freerdp/crypto/er.h @@ -24,74 +24,74 @@ #include #include - #include /* ER type */ /* Class - bits 8 and 7 */ -#define ER_CLASS_MASK 0xC0 -#define ER_CLASS_UNIV 0x00 /* 0 0 */ -#define ER_CLASS_APPL 0x40 /* 0 1 */ -#define ER_CLASS_CTXT 0x80 /* 1 0 */ -#define ER_CLASS_PRIV 0xC0 /* 1 1 */ +#define ER_CLASS_MASK 0xC0 +#define ER_CLASS_UNIV 0x00 /* 0 0 */ +#define ER_CLASS_APPL 0x40 /* 0 1 */ +#define ER_CLASS_CTXT 0x80 /* 1 0 */ +#define ER_CLASS_PRIV 0xC0 /* 1 1 */ /* P/C - bit 6 */ -#define ER_PC_MASK 0x20 -#define ER_PRIMITIVE 0x00 /* 0 */ -#define ER_CONSTRUCT 0x20 /* 1 */ +#define ER_PC_MASK 0x20 +#define ER_PRIMITIVE 0x00 /* 0 */ +#define ER_CONSTRUCT 0x20 /* 1 */ /* Tag - bits 5 to 1 */ -#define ER_TAG_MASK 0x1F -#define ER_TAG_BOOLEAN 0x01 -#define ER_TAG_INTEGER 0x02 -#define ER_TAG_BIT_STRING 0x03 -#define ER_TAG_OCTET_STRING 0x04 -#define ER_TAG_OBJECT_IDENFIER 0x06 -#define ER_TAG_ENUMERATED 0x0A -#define ER_TAG_SEQUENCE 0x10 -#define ER_TAG_SEQUENCE_OF 0x10 -#define ER_TAG_GENERAL_STRING 0x1B +#define ER_TAG_MASK 0x1F +#define ER_TAG_BOOLEAN 0x01 +#define ER_TAG_INTEGER 0x02 +#define ER_TAG_BIT_STRING 0x03 +#define ER_TAG_OCTET_STRING 0x04 +#define ER_TAG_OBJECT_IDENFIER 0x06 +#define ER_TAG_ENUMERATED 0x0A +#define ER_TAG_SEQUENCE 0x10 +#define ER_TAG_SEQUENCE_OF 0x10 +#define ER_TAG_GENERAL_STRING 0x1B #define ER_TAG_GENERALIZED_TIME 0x18 -#define ER_PC(_pc) (_pc ? ER_CONSTRUCT : ER_PRIMITIVE) +#define ER_PC(_pc) (_pc ? ER_CONSTRUCT : ER_PRIMITIVE) #ifdef __cplusplus - extern "C" { +extern "C" +{ #endif -FREERDP_API void er_read_length(wStream* s, int* length); -FREERDP_API int er_write_length(wStream* s, int length, BOOL flag); -FREERDP_API int _er_skip_length(int length); -FREERDP_API int er_get_content_length(int length); -FREERDP_API BOOL er_read_universal_tag(wStream* s, BYTE tag, BOOL pc); -FREERDP_API void er_write_universal_tag(wStream* s, BYTE tag, BOOL pc); -FREERDP_API BOOL er_read_application_tag(wStream* s, BYTE tag, int* length); -FREERDP_API void er_write_application_tag(wStream* s, BYTE tag, int length, BOOL flag); -FREERDP_API BOOL er_read_enumerated(wStream* s, BYTE* enumerated, BYTE count); -FREERDP_API void er_write_enumerated(wStream* s, BYTE enumerated, BYTE count, BOOL flag); -FREERDP_API BOOL er_read_contextual_tag(wStream* s, BYTE tag, int* length, BOOL pc); -FREERDP_API int er_write_contextual_tag(wStream* s, BYTE tag, int length, BOOL pc, BOOL flag); -FREERDP_API int er_skip_contextual_tag(int length); -FREERDP_API BOOL er_read_sequence_tag(wStream* s, int* length); -FREERDP_API int er_write_sequence_tag(wStream* s, int length, BOOL flag); -FREERDP_API int er_skip_sequence(int length); -FREERDP_API int er_skip_sequence_tag(int length); -FREERDP_API BOOL er_read_bit_string(wStream* s, int* length, BYTE* padding); -FREERDP_API BOOL er_write_bit_string_tag(wStream* s, UINT32 length, BYTE padding, BOOL flag); -FREERDP_API BOOL er_read_octet_string(wStream* s, int* length); -FREERDP_API void er_write_octet_string(wStream* s, BYTE* oct_str, int length, BOOL flag); -FREERDP_API int er_write_octet_string_tag(wStream* s, int length, BOOL flag); -FREERDP_API int er_skip_octet_string(int length); -FREERDP_API BOOL er_read_BOOL(wStream* s, BOOL* value); -FREERDP_API void er_write_BOOL(wStream* s, BOOL value); -FREERDP_API BOOL er_read_integer(wStream* s, UINT32* value); -FREERDP_API int er_write_integer(wStream* s, INT32 value); -FREERDP_API BOOL er_read_integer_length(wStream* s, int* length); -FREERDP_API int er_skip_integer(INT32 value); + FREERDP_API void er_read_length(wStream* s, int* length); + FREERDP_API int er_write_length(wStream* s, int length, BOOL flag); + FREERDP_API int _er_skip_length(int length); + FREERDP_API int er_get_content_length(int length); + FREERDP_API BOOL er_read_universal_tag(wStream* s, BYTE tag, BOOL pc); + FREERDP_API void er_write_universal_tag(wStream* s, BYTE tag, BOOL pc); + FREERDP_API BOOL er_read_application_tag(wStream* s, BYTE tag, int* length); + FREERDP_API void er_write_application_tag(wStream* s, BYTE tag, int length, BOOL flag); + FREERDP_API BOOL er_read_enumerated(wStream* s, BYTE* enumerated, BYTE count); + FREERDP_API void er_write_enumerated(wStream* s, BYTE enumerated, BYTE count, BOOL flag); + FREERDP_API BOOL er_read_contextual_tag(wStream* s, BYTE tag, int* length, BOOL pc); + FREERDP_API int er_write_contextual_tag(wStream* s, BYTE tag, int length, BOOL pc, BOOL flag); + FREERDP_API int er_skip_contextual_tag(int length); + FREERDP_API BOOL er_read_sequence_tag(wStream* s, int* length); + FREERDP_API int er_write_sequence_tag(wStream* s, int length, BOOL flag); + FREERDP_API int er_skip_sequence(int length); + FREERDP_API int er_skip_sequence_tag(int length); + FREERDP_API BOOL er_read_bit_string(wStream* s, int* length, BYTE* padding); + FREERDP_API BOOL er_write_bit_string_tag(wStream* s, UINT32 length, BYTE padding, BOOL flag); + FREERDP_API BOOL er_read_octet_string(wStream* s, int* length); + FREERDP_API void er_write_octet_string(wStream* s, BYTE* oct_str, int length, BOOL flag); + FREERDP_API int er_write_octet_string_tag(wStream* s, int length, BOOL flag); + FREERDP_API int er_skip_octet_string(int length); + FREERDP_API BOOL er_read_BOOL(wStream* s, BOOL* value); + FREERDP_API void er_write_BOOL(wStream* s, BOOL value); + FREERDP_API BOOL er_read_integer(wStream* s, UINT32* value); + FREERDP_API int er_write_integer(wStream* s, INT32 value); + FREERDP_API BOOL er_read_integer_length(wStream* s, int* length); + FREERDP_API int er_skip_integer(INT32 value); #ifdef __cplusplus - } +} #endif #endif /* FREERDP_CRYPTO_ER_H */ diff --git a/include/freerdp/crypto/per.h b/include/freerdp/crypto/per.h index e53cabb4f..71543cb50 100644 --- a/include/freerdp/crypto/per.h +++ b/include/freerdp/crypto/per.h @@ -25,34 +25,35 @@ #include #ifdef __cplusplus - extern "C" { +extern "C" +{ #endif -FREERDP_API BOOL per_read_length(wStream* s, UINT16* length); -FREERDP_API void per_write_length(wStream* s, int length); -FREERDP_API BOOL per_read_choice(wStream* s, BYTE* choice); -FREERDP_API void per_write_choice(wStream* s, BYTE choice); -FREERDP_API BOOL per_read_selection(wStream* s, BYTE* selection); -FREERDP_API void per_write_selection(wStream* s, BYTE selection); -FREERDP_API BOOL per_read_number_of_sets(wStream* s, BYTE* number); -FREERDP_API void per_write_number_of_sets(wStream* s, BYTE number); -FREERDP_API BOOL per_read_padding(wStream* s, int length); -FREERDP_API void per_write_padding(wStream* s, int length); -FREERDP_API BOOL per_read_integer(wStream* s, UINT32* integer); -FREERDP_API BOOL per_read_integer16(wStream* s, UINT16* integer, UINT16 min); -FREERDP_API void per_write_integer(wStream* s, UINT32 integer); -FREERDP_API void per_write_integer16(wStream* s, UINT16 integer, UINT16 min); -FREERDP_API BOOL per_read_enumerated(wStream* s, BYTE* enumerated, BYTE count); -FREERDP_API void per_write_enumerated(wStream* s, BYTE enumerated, BYTE count); -FREERDP_API void per_write_object_identifier(wStream* s, BYTE oid[6]); -FREERDP_API BOOL per_read_object_identifier(wStream* s, BYTE oid[6]); -FREERDP_API BOOL per_read_octet_string(wStream* s, BYTE* oct_str, int length, int min); -FREERDP_API void per_write_octet_string(wStream* s, BYTE* oct_str, int length, int min); -FREERDP_API BOOL per_read_numeric_string(wStream* s, int min); -FREERDP_API void per_write_numeric_string(wStream* s, BYTE* num_str, int length, int min); + FREERDP_API BOOL per_read_length(wStream* s, UINT16* length); + FREERDP_API void per_write_length(wStream* s, int length); + FREERDP_API BOOL per_read_choice(wStream* s, BYTE* choice); + FREERDP_API void per_write_choice(wStream* s, BYTE choice); + FREERDP_API BOOL per_read_selection(wStream* s, BYTE* selection); + FREERDP_API void per_write_selection(wStream* s, BYTE selection); + FREERDP_API BOOL per_read_number_of_sets(wStream* s, BYTE* number); + FREERDP_API void per_write_number_of_sets(wStream* s, BYTE number); + FREERDP_API BOOL per_read_padding(wStream* s, int length); + FREERDP_API void per_write_padding(wStream* s, int length); + FREERDP_API BOOL per_read_integer(wStream* s, UINT32* integer); + FREERDP_API BOOL per_read_integer16(wStream* s, UINT16* integer, UINT16 min); + FREERDP_API void per_write_integer(wStream* s, UINT32 integer); + FREERDP_API void per_write_integer16(wStream* s, UINT16 integer, UINT16 min); + FREERDP_API BOOL per_read_enumerated(wStream* s, BYTE* enumerated, BYTE count); + FREERDP_API void per_write_enumerated(wStream* s, BYTE enumerated, BYTE count); + FREERDP_API void per_write_object_identifier(wStream* s, BYTE oid[6]); + FREERDP_API BOOL per_read_object_identifier(wStream* s, BYTE oid[6]); + FREERDP_API BOOL per_read_octet_string(wStream* s, BYTE* oct_str, int length, int min); + FREERDP_API void per_write_octet_string(wStream* s, BYTE* oct_str, int length, int min); + FREERDP_API BOOL per_read_numeric_string(wStream* s, int min); + FREERDP_API void per_write_numeric_string(wStream* s, BYTE* num_str, int length, int min); #ifdef __cplusplus - } +} #endif #endif /* FREERDP_CRYPTO_PER_H */ diff --git a/include/freerdp/crypto/tls.h b/include/freerdp/crypto/tls.h index 0b528cfb3..e273ec3b4 100644 --- a/include/freerdp/crypto/tls.h +++ b/include/freerdp/crypto/tls.h @@ -34,34 +34,34 @@ #include -#define TLS_ALERT_LEVEL_WARNING 1 -#define TLS_ALERT_LEVEL_FATAL 2 +#define TLS_ALERT_LEVEL_WARNING 1 +#define TLS_ALERT_LEVEL_FATAL 2 -#define TLS_ALERT_DESCRIPTION_CLOSE_NOTIFY 0 -#define TLS_ALERT_DESCRIPTION_UNEXPECTED_MESSAGE 10 -#define TLS_ALERT_DESCRIPTION_BAD_RECORD_MAC 20 -#define TLS_ALERT_DESCRIPTION_DECRYPTION_FAILED 21 -#define TLS_ALERT_DESCRIPTION_RECORD_OVERFLOW 22 -#define TLS_ALERT_DESCRIPTION_DECOMPRESSION_FAILURE 30 -#define TLS_ALERT_DESCRIPTION_HANSHAKE_FAILURE 40 -#define TLS_ALERT_DESCRIPTION_NO_CERTIFICATE 41 -#define TLS_ALERT_DESCRIPTION_BAD_CERTIFICATE 42 -#define TLS_ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE 43 -#define TLS_ALERT_DESCRIPTION_CERTIFICATE_REVOKED 44 -#define TLS_ALERT_DESCRIPTION_CERTIFICATE_EXPIRED 45 -#define TLS_ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN 46 -#define TLS_ALERT_DESCRIPTION_ILLEGAL_PARAMETER 47 -#define TLS_ALERT_DESCRIPTION_UNKNOWN_CA 48 -#define TLS_ALERT_DESCRIPTION_ACCESS_DENIED 49 -#define TLS_ALERT_DESCRIPTION_DECODE_ERROR 50 -#define TLS_ALERT_DESCRIPTION_DECRYPT_ERROR 51 -#define TLS_ALERT_DESCRIPTION_EXPORT_RESTRICTION 60 -#define TLS_ALERT_DESCRIPTION_PROTOCOL_VERSION 70 -#define TLS_ALERT_DESCRIPTION_INSUFFICIENT_SECURITY 71 -#define TLS_ALERT_DESCRIPTION_INTERNAL_ERROR 80 -#define TLS_ALERT_DESCRIPTION_USER_CANCELED 90 -#define TLS_ALERT_DESCRIPTION_NO_RENEGOTIATION 100 -#define TLS_ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION 110 +#define TLS_ALERT_DESCRIPTION_CLOSE_NOTIFY 0 +#define TLS_ALERT_DESCRIPTION_UNEXPECTED_MESSAGE 10 +#define TLS_ALERT_DESCRIPTION_BAD_RECORD_MAC 20 +#define TLS_ALERT_DESCRIPTION_DECRYPTION_FAILED 21 +#define TLS_ALERT_DESCRIPTION_RECORD_OVERFLOW 22 +#define TLS_ALERT_DESCRIPTION_DECOMPRESSION_FAILURE 30 +#define TLS_ALERT_DESCRIPTION_HANSHAKE_FAILURE 40 +#define TLS_ALERT_DESCRIPTION_NO_CERTIFICATE 41 +#define TLS_ALERT_DESCRIPTION_BAD_CERTIFICATE 42 +#define TLS_ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE 43 +#define TLS_ALERT_DESCRIPTION_CERTIFICATE_REVOKED 44 +#define TLS_ALERT_DESCRIPTION_CERTIFICATE_EXPIRED 45 +#define TLS_ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN 46 +#define TLS_ALERT_DESCRIPTION_ILLEGAL_PARAMETER 47 +#define TLS_ALERT_DESCRIPTION_UNKNOWN_CA 48 +#define TLS_ALERT_DESCRIPTION_ACCESS_DENIED 49 +#define TLS_ALERT_DESCRIPTION_DECODE_ERROR 50 +#define TLS_ALERT_DESCRIPTION_DECRYPT_ERROR 51 +#define TLS_ALERT_DESCRIPTION_EXPORT_RESTRICTION 60 +#define TLS_ALERT_DESCRIPTION_PROTOCOL_VERSION 70 +#define TLS_ALERT_DESCRIPTION_INSUFFICIENT_SECURITY 71 +#define TLS_ALERT_DESCRIPTION_INTERNAL_ERROR 80 +#define TLS_ALERT_DESCRIPTION_USER_CANCELED 90 +#define TLS_ALERT_DESCRIPTION_NO_RENEGOTIATION 100 +#define TLS_ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION 110 typedef struct rdp_tls rdpTls; @@ -85,19 +85,20 @@ struct rdp_tls }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API int tls_connect(rdpTls* tls, BIO* underlying); -FREERDP_API BOOL tls_accept(rdpTls* tls, BIO* underlying, rdpSettings* settings); -FREERDP_API BOOL tls_send_alert(rdpTls* tls); + FREERDP_API int tls_connect(rdpTls* tls, BIO* underlying); + FREERDP_API BOOL tls_accept(rdpTls* tls, BIO* underlying, rdpSettings* settings); + FREERDP_API BOOL tls_send_alert(rdpTls* tls); -FREERDP_API int tls_write_all(rdpTls* tls, const BYTE* data, int length); + FREERDP_API int tls_write_all(rdpTls* tls, const BYTE* data, int length); -FREERDP_API int tls_set_alert_code(rdpTls* tls, int level, int description); + FREERDP_API int tls_set_alert_code(rdpTls* tls, int level, int description); -FREERDP_API rdpTls* tls_new(rdpSettings* settings); -FREERDP_API void tls_free(rdpTls* tls); + FREERDP_API rdpTls* tls_new(rdpSettings* settings); + FREERDP_API void tls_free(rdpTls* tls); #ifdef __cplusplus } diff --git a/include/freerdp/display.h b/include/freerdp/display.h index a884ec3d3..b942367f8 100644 --- a/include/freerdp/display.h +++ b/include/freerdp/display.h @@ -23,11 +23,12 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API BOOL freerdp_display_send_monitor_layout(rdpContext* context, UINT32 monitorCount, - const MONITOR_DEF* monitorDefArray); + FREERDP_API BOOL freerdp_display_send_monitor_layout(rdpContext* context, UINT32 monitorCount, + const MONITOR_DEF* monitorDefArray); #ifdef __cplusplus } diff --git a/include/freerdp/dvc.h b/include/freerdp/dvc.h index 44bff5143..df2f1a2df 100644 --- a/include/freerdp/dvc.h +++ b/include/freerdp/dvc.h @@ -67,8 +67,7 @@ typedef struct _IWTSVirtualChannelCallback IWTSVirtualChannelCallback; struct _IWTSListener { /* Retrieves the listener-specific configuration. */ - UINT(*GetConfiguration)(IWTSListener* pListener, - void** ppPropertyBag); + UINT (*GetConfiguration)(IWTSListener* pListener, void** ppPropertyBag); void* pInterface; }; @@ -76,25 +75,20 @@ struct _IWTSListener struct _IWTSVirtualChannel { /* Starts a write request on the channel. */ - UINT(*Write)(IWTSVirtualChannel* pChannel, - ULONG cbSize, - const BYTE* pBuffer, - void* pReserved); + UINT (*Write)(IWTSVirtualChannel* pChannel, ULONG cbSize, const BYTE* pBuffer, void* pReserved); /* Closes the channel. */ - UINT(*Close)(IWTSVirtualChannel* pChannel); + UINT (*Close)(IWTSVirtualChannel* pChannel); }; struct _IWTSVirtualChannelManager { /* Returns an instance of a listener object that listens on a specific endpoint, or creates a static channel. */ - UINT(*CreateListener)(IWTSVirtualChannelManager* pChannelMgr, - const char* pszChannelName, - ULONG ulFlags, - IWTSListenerCallback* pListenerCallback, - IWTSListener** ppListener); + UINT(*CreateListener) + (IWTSVirtualChannelManager* pChannelMgr, const char* pszChannelName, ULONG ulFlags, + IWTSListenerCallback* pListenerCallback, IWTSListener** ppListener); /* Find the channel or ID to send data to a specific endpoint. */ - UINT32(*GetChannelId)(IWTSVirtualChannel* channel); + UINT32 (*GetChannelId)(IWTSVirtualChannel* channel); IWTSVirtualChannel* (*FindChannelById)(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId); }; @@ -102,23 +96,21 @@ struct _IWTSVirtualChannelManager struct _IWTSPlugin { /* Used for the first call that is made from the client to the plug-in. */ - UINT(*Initialize)(IWTSPlugin* pPlugin, - IWTSVirtualChannelManager* pChannelMgr); + UINT (*Initialize)(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr); /* Notifies the plug-in that the Remote Desktop Connection (RDC) client has successfully connected to the Remote Desktop Session Host (RD Session Host) server. */ - UINT(*Connected)(IWTSPlugin* pPlugin); + UINT (*Connected)(IWTSPlugin* pPlugin); /* Notifies the plug-in that the Remote Desktop Connection (RDC) client has disconnected from the RD Session Host server. */ - UINT(*Disconnected)(IWTSPlugin* pPlugin, - DWORD dwDisconnectCode); + UINT (*Disconnected)(IWTSPlugin* pPlugin, DWORD dwDisconnectCode); /* Notifies the plug-in that the Remote Desktop Connection (RDC) client has terminated. */ - UINT(*Terminated)(IWTSPlugin* pPlugin); + UINT (*Terminated)(IWTSPlugin* pPlugin); - UINT(*Attached)(IWTSPlugin* pPlugin); + UINT (*Attached)(IWTSPlugin* pPlugin); - UINT(*Detached)(IWTSPlugin* pPlugin); + UINT (*Detached)(IWTSPlugin* pPlugin); /* Extended */ @@ -129,36 +121,33 @@ struct _IWTSListenerCallback { /* Accepts or denies a connection request for an incoming connection to the associated listener. */ - UINT(*OnNewChannelConnection)(IWTSListenerCallback* pListenerCallback, - IWTSVirtualChannel* pChannel, - BYTE* Data, - BOOL* pbAccept, - IWTSVirtualChannelCallback** ppCallback); + UINT(*OnNewChannelConnection) + (IWTSListenerCallback* pListenerCallback, IWTSVirtualChannel* pChannel, BYTE* Data, + BOOL* pbAccept, IWTSVirtualChannelCallback** ppCallback); }; struct _IWTSVirtualChannelCallback { /* Notifies the user about data that is being received. */ - UINT(*OnDataReceived)(IWTSVirtualChannelCallback* pChannelCallback, wStream* data); + UINT (*OnDataReceived)(IWTSVirtualChannelCallback* pChannelCallback, wStream* data); /* Notifies the user that the channel has been opened. */ - UINT(*OnOpen)(IWTSVirtualChannelCallback* pChannelCallback); + UINT (*OnOpen)(IWTSVirtualChannelCallback* pChannelCallback); /* Notifies the user that the channel has been closed. */ - UINT(*OnClose)(IWTSVirtualChannelCallback* pChannelCallback); + UINT (*OnClose)(IWTSVirtualChannelCallback* pChannelCallback); }; /* The DVC Plugin entry points */ typedef struct _IDRDYNVC_ENTRY_POINTS IDRDYNVC_ENTRY_POINTS; struct _IDRDYNVC_ENTRY_POINTS { - UINT(*RegisterPlugin)(IDRDYNVC_ENTRY_POINTS* pEntryPoints, - const char* name, IWTSPlugin* pPlugin); - IWTSPlugin* (*GetPlugin)(IDRDYNVC_ENTRY_POINTS* pEntryPoints, - const char* name); + UINT(*RegisterPlugin) + (IDRDYNVC_ENTRY_POINTS* pEntryPoints, const char* name, IWTSPlugin* pPlugin); + IWTSPlugin* (*GetPlugin)(IDRDYNVC_ENTRY_POINTS* pEntryPoints, const char* name); ADDIN_ARGV* (*GetPluginData)(IDRDYNVC_ENTRY_POINTS* pEntryPoints); void* (*GetRdpSettings)(IDRDYNVC_ENTRY_POINTS* pEntryPoints); }; -typedef UINT(*PDVC_PLUGIN_ENTRY)(IDRDYNVC_ENTRY_POINTS*); +typedef UINT (*PDVC_PLUGIN_ENTRY)(IDRDYNVC_ENTRY_POINTS*); void* get_callback_by_name(const char* name, void** context); void add_callback_by_name(const char* name, void* fkt, void* context); diff --git a/include/freerdp/error.h b/include/freerdp/error.h index 89475faba..f9d4b6ab0 100644 --- a/include/freerdp/error.h +++ b/include/freerdp/error.h @@ -24,8 +24,9 @@ #include -#ifdef __cplusplus -extern "C" { +#ifdef __cplusplus +extern "C" +{ #endif /* Error categories */ @@ -44,17 +45,17 @@ extern "C" { */ /* Protocol-independent codes */ -#define ERRINFO_RPC_INITIATED_DISCONNECT 0x00000001 -#define ERRINFO_RPC_INITIATED_LOGOFF 0x00000002 -#define ERRINFO_IDLE_TIMEOUT 0x00000003 -#define ERRINFO_LOGON_TIMEOUT 0x00000004 -#define ERRINFO_DISCONNECTED_BY_OTHER_CONNECTION 0x00000005 -#define ERRINFO_OUT_OF_MEMORY 0x00000006 -#define ERRINFO_SERVER_DENIED_CONNECTION 0x00000007 -#define ERRINFO_SERVER_INSUFFICIENT_PRIVILEGES 0x00000009 -#define ERRINFO_SERVER_FRESH_CREDENTIALS_REQUIRED 0x0000000A -#define ERRINFO_RPC_INITIATED_DISCONNECT_BY_USER 0x0000000B -#define ERRINFO_LOGOFF_BY_USER 0x0000000C +#define ERRINFO_RPC_INITIATED_DISCONNECT 0x00000001 +#define ERRINFO_RPC_INITIATED_LOGOFF 0x00000002 +#define ERRINFO_IDLE_TIMEOUT 0x00000003 +#define ERRINFO_LOGON_TIMEOUT 0x00000004 +#define ERRINFO_DISCONNECTED_BY_OTHER_CONNECTION 0x00000005 +#define ERRINFO_OUT_OF_MEMORY 0x00000006 +#define ERRINFO_SERVER_DENIED_CONNECTION 0x00000007 +#define ERRINFO_SERVER_INSUFFICIENT_PRIVILEGES 0x00000009 +#define ERRINFO_SERVER_FRESH_CREDENTIALS_REQUIRED 0x0000000A +#define ERRINFO_RPC_INITIATED_DISCONNECT_BY_USER 0x0000000B +#define ERRINFO_LOGOFF_BY_USER 0x0000000C #define ERRINFO_CLOSE_STACK_ON_DRIVER_NOT_READY 0x0000000F #define ERRINFO_SERVER_DWM_CRASH 0x00000010 #define ERRINFO_CLOSE_STACK_ON_DRIVER_FAILURE 0x00000011 @@ -63,261 +64,262 @@ extern "C" { #define ERRINFO_SERVER_CSRSS_CRASH 0x00000018 /* Protocol-independent licensing codes */ -#define ERRINFO_LICENSE_INTERNAL 0x00000100 -#define ERRINFO_LICENSE_NO_LICENSE_SERVER 0x00000101 -#define ERRINFO_LICENSE_NO_LICENSE 0x00000102 -#define ERRINFO_LICENSE_BAD_CLIENT_MSG 0x00000103 -#define ERRINFO_LICENSE_HWID_DOESNT_MATCH_LICENSE 0x00000104 -#define ERRINFO_LICENSE_BAD_CLIENT_LICENSE 0x00000105 -#define ERRINFO_LICENSE_CANT_FINISH_PROTOCOL 0x00000106 -#define ERRINFO_LICENSE_CLIENT_ENDED_PROTOCOL 0x00000107 -#define ERRINFO_LICENSE_BAD_CLIENT_ENCRYPTION 0x00000108 -#define ERRINFO_LICENSE_CANT_UPGRADE_LICENSE 0x00000109 -#define ERRINFO_LICENSE_NO_REMOTE_CONNECTIONS 0x0000010A +#define ERRINFO_LICENSE_INTERNAL 0x00000100 +#define ERRINFO_LICENSE_NO_LICENSE_SERVER 0x00000101 +#define ERRINFO_LICENSE_NO_LICENSE 0x00000102 +#define ERRINFO_LICENSE_BAD_CLIENT_MSG 0x00000103 +#define ERRINFO_LICENSE_HWID_DOESNT_MATCH_LICENSE 0x00000104 +#define ERRINFO_LICENSE_BAD_CLIENT_LICENSE 0x00000105 +#define ERRINFO_LICENSE_CANT_FINISH_PROTOCOL 0x00000106 +#define ERRINFO_LICENSE_CLIENT_ENDED_PROTOCOL 0x00000107 +#define ERRINFO_LICENSE_BAD_CLIENT_ENCRYPTION 0x00000108 +#define ERRINFO_LICENSE_CANT_UPGRADE_LICENSE 0x00000109 +#define ERRINFO_LICENSE_NO_REMOTE_CONNECTIONS 0x0000010A /* Protocol-independent codes generated by the Connection Broker */ -#define ERRINFO_CB_DESTINATION_NOT_FOUND 0x0000400 -#define ERRINFO_CB_LOADING_DESTINATION 0x0000402 -#define ERRINFO_CB_REDIRECTING_TO_DESTINATION 0x0000404 -#define ERRINFO_CB_SESSION_ONLINE_VM_WAKE 0x0000405 -#define ERRINFO_CB_SESSION_ONLINE_VM_BOOT 0x0000406 -#define ERRINFO_CB_SESSION_ONLINE_VM_NO_DNS 0x0000407 -#define ERRINFO_CB_DESTINATION_POOL_NOT_FREE 0x0000408 -#define ERRINFO_CB_CONNECTION_CANCELLED 0x0000409 -#define ERRINFO_CB_CONNECTION_ERROR_INVALID_SETTINGS 0x0000410 -#define ERRINFO_CB_SESSION_ONLINE_VM_BOOT_TIMEOUT 0x0000411 -#define ERRINFO_CB_SESSION_ONLINE_VM_SESSMON_FAILED 0x0000412 +#define ERRINFO_CB_DESTINATION_NOT_FOUND 0x0000400 +#define ERRINFO_CB_LOADING_DESTINATION 0x0000402 +#define ERRINFO_CB_REDIRECTING_TO_DESTINATION 0x0000404 +#define ERRINFO_CB_SESSION_ONLINE_VM_WAKE 0x0000405 +#define ERRINFO_CB_SESSION_ONLINE_VM_BOOT 0x0000406 +#define ERRINFO_CB_SESSION_ONLINE_VM_NO_DNS 0x0000407 +#define ERRINFO_CB_DESTINATION_POOL_NOT_FREE 0x0000408 +#define ERRINFO_CB_CONNECTION_CANCELLED 0x0000409 +#define ERRINFO_CB_CONNECTION_ERROR_INVALID_SETTINGS 0x0000410 +#define ERRINFO_CB_SESSION_ONLINE_VM_BOOT_TIMEOUT 0x0000411 +#define ERRINFO_CB_SESSION_ONLINE_VM_SESSMON_FAILED 0x0000412 /* RDP specific codes */ -#define ERRINFO_UNKNOWN_DATA_PDU_TYPE 0x000010C9 -#define ERRINFO_UNKNOWN_PDU_TYPE 0x000010CA -#define ERRINFO_DATA_PDU_SEQUENCE 0x000010CB -#define ERRINFO_CONTROL_PDU_SEQUENCE 0x000010CD -#define ERRINFO_INVALID_CONTROL_PDU_ACTION 0x000010CE -#define ERRINFO_INVALID_INPUT_PDU_TYPE 0x000010CF -#define ERRINFO_INVALID_INPUT_PDU_MOUSE 0x000010D0 -#define ERRINFO_INVALID_REFRESH_RECT_PDU 0x000010D1 -#define ERRINFO_CREATE_USER_DATA_FAILED 0x000010D2 -#define ERRINFO_CONNECT_FAILED 0x000010D3 -#define ERRINFO_CONFIRM_ACTIVE_HAS_WRONG_SHAREID 0x000010D4 -#define ERRINFO_CONFIRM_ACTIVE_HAS_WRONG_ORIGINATOR 0x000010D5 -#define ERRINFO_PERSISTENT_KEY_PDU_BAD_LENGTH 0x000010DA -#define ERRINFO_PERSISTENT_KEY_PDU_ILLEGAL_FIRST 0x000010DB -#define ERRINFO_PERSISTENT_KEY_PDU_TOO_MANY_TOTAL_KEYS 0x000010DC -#define ERRINFO_PERSISTENT_KEY_PDU_TOO_MANY_CACHE_KEYS 0x000010DD -#define ERRINFO_INPUT_PDU_BAD_LENGTH 0x000010DE -#define ERRINFO_BITMAP_CACHE_ERROR_PDU_BAD_LENGTH 0x000010DF -#define ERRINFO_SECURITY_DATA_TOO_SHORT 0x000010E0 -#define ERRINFO_VCHANNEL_DATA_TOO_SHORT 0x000010E1 -#define ERRINFO_SHARE_DATA_TOO_SHORT 0x000010E2 -#define ERRINFO_BAD_SUPPRESS_OUTPUT_PDU 0x000010E3 -#define ERRINFO_CONFIRM_ACTIVE_PDU_TOO_SHORT 0x000010E5 -#define ERRINFO_CAPABILITY_SET_TOO_SMALL 0x000010E7 -#define ERRINFO_CAPABILITY_SET_TOO_LARGE 0x000010E8 -#define ERRINFO_NO_CURSOR_CACHE 0x000010E9 -#define ERRINFO_BAD_CAPABILITIES 0x000010EA -#define ERRINFO_VIRTUAL_CHANNEL_DECOMPRESSION 0x000010EC -#define ERRINFO_INVALID_VC_COMPRESSION_TYPE 0x000010ED -#define ERRINFO_INVALID_CHANNEL_ID 0x000010EF -#define ERRINFO_VCHANNELS_TOO_MANY 0x000010F0 -#define ERRINFO_REMOTEAPP_NOT_ENABLED 0x000010F3 -#define ERRINFO_CACHE_CAP_NOT_SET 0x000010F4 -#define ERRINFO_BITMAP_CACHE_ERROR_PDU_BAD_LENGTH2 0x000010F5 -#define ERRINFO_OFFSCREEN_CACHE_ERROR_PDU_BAD_LENGTH 0x000010F6 -#define ERRINFO_DRAWNINEGRID_CACHE_ERROR_PDU_BAD_LENGTH 0x000010F7 -#define ERRINFO_GDIPLUS_PDU_BAD_LENGTH 0x000010F8 -#define ERRINFO_SECURITY_DATA_TOO_SHORT2 0x00001111 -#define ERRINFO_SECURITY_DATA_TOO_SHORT3 0x00001112 -#define ERRINFO_SECURITY_DATA_TOO_SHORT4 0x00001113 -#define ERRINFO_SECURITY_DATA_TOO_SHORT5 0x00001114 -#define ERRINFO_SECURITY_DATA_TOO_SHORT6 0x00001115 -#define ERRINFO_SECURITY_DATA_TOO_SHORT7 0x00001116 -#define ERRINFO_SECURITY_DATA_TOO_SHORT8 0x00001117 -#define ERRINFO_SECURITY_DATA_TOO_SHORT9 0x00001118 -#define ERRINFO_SECURITY_DATA_TOO_SHORT10 0x00001119 -#define ERRINFO_SECURITY_DATA_TOO_SHORT11 0x0000111A -#define ERRINFO_SECURITY_DATA_TOO_SHORT12 0x0000111B -#define ERRINFO_SECURITY_DATA_TOO_SHORT13 0x0000111C -#define ERRINFO_SECURITY_DATA_TOO_SHORT14 0x0000111D -#define ERRINFO_SECURITY_DATA_TOO_SHORT15 0x0000111E -#define ERRINFO_SECURITY_DATA_TOO_SHORT16 0x0000111F -#define ERRINFO_SECURITY_DATA_TOO_SHORT17 0x00001120 -#define ERRINFO_SECURITY_DATA_TOO_SHORT18 0x00001121 -#define ERRINFO_SECURITY_DATA_TOO_SHORT19 0x00001122 -#define ERRINFO_SECURITY_DATA_TOO_SHORT20 0x00001123 -#define ERRINFO_SECURITY_DATA_TOO_SHORT21 0x00001124 -#define ERRINFO_SECURITY_DATA_TOO_SHORT22 0x00001125 -#define ERRINFO_SECURITY_DATA_TOO_SHORT23 0x00001126 -#define ERRINFO_BAD_MONITOR_DATA 0x00001129 -#define ERRINFO_VC_DECOMPRESSED_REASSEMBLE_FAILED 0x0000112A -#define ERRINFO_VC_DATA_TOO_LONG 0x0000112B -#define ERRINFO_BAD_FRAME_ACK_DATA 0x0000112C -#define ERRINFO_GRAPHICS_MODE_NOT_SUPPORTED 0x0000112D -#define ERRINFO_GRAPHICS_SUBSYSTEM_RESET_FAILED 0x0000112E -#define ERRINFO_GRAPHICS_SUBSYSTEM_FAILED 0x0000112F -#define ERRINFO_TIMEZONE_KEY_NAME_LENGTH_TOO_SHORT 0x00001130 -#define ERRINFO_TIMEZONE_KEY_NAME_LENGTH_TOO_LONG 0x00001131 -#define ERRINFO_DYNAMIC_DST_DISABLED_FIELD_MISSING 0x00001132 -#define ERRINFO_VC_DECODING_ERROR 0x00001133 -#define ERRINFO_VIRTUALDESKTOPTOOLARGE 0x00001134 -#define ERRINFO_MONITORGEOMETRYVALIDATIONFAILED 0x00001135 -#define ERRINFO_INVALIDMONITORCOUNT 0x00001136 -#define ERRINFO_UPDATE_SESSION_KEY_FAILED 0x00001191 -#define ERRINFO_DECRYPT_FAILED 0x00001192 -#define ERRINFO_ENCRYPT_FAILED 0x00001193 -#define ERRINFO_ENCRYPTION_PACKAGE_MISMATCH 0x00001194 -#define ERRINFO_DECRYPT_FAILED2 0x00001195 -#define ERRINFO_PEER_DISCONNECTED 0x00001196 +#define ERRINFO_UNKNOWN_DATA_PDU_TYPE 0x000010C9 +#define ERRINFO_UNKNOWN_PDU_TYPE 0x000010CA +#define ERRINFO_DATA_PDU_SEQUENCE 0x000010CB +#define ERRINFO_CONTROL_PDU_SEQUENCE 0x000010CD +#define ERRINFO_INVALID_CONTROL_PDU_ACTION 0x000010CE +#define ERRINFO_INVALID_INPUT_PDU_TYPE 0x000010CF +#define ERRINFO_INVALID_INPUT_PDU_MOUSE 0x000010D0 +#define ERRINFO_INVALID_REFRESH_RECT_PDU 0x000010D1 +#define ERRINFO_CREATE_USER_DATA_FAILED 0x000010D2 +#define ERRINFO_CONNECT_FAILED 0x000010D3 +#define ERRINFO_CONFIRM_ACTIVE_HAS_WRONG_SHAREID 0x000010D4 +#define ERRINFO_CONFIRM_ACTIVE_HAS_WRONG_ORIGINATOR 0x000010D5 +#define ERRINFO_PERSISTENT_KEY_PDU_BAD_LENGTH 0x000010DA +#define ERRINFO_PERSISTENT_KEY_PDU_ILLEGAL_FIRST 0x000010DB +#define ERRINFO_PERSISTENT_KEY_PDU_TOO_MANY_TOTAL_KEYS 0x000010DC +#define ERRINFO_PERSISTENT_KEY_PDU_TOO_MANY_CACHE_KEYS 0x000010DD +#define ERRINFO_INPUT_PDU_BAD_LENGTH 0x000010DE +#define ERRINFO_BITMAP_CACHE_ERROR_PDU_BAD_LENGTH 0x000010DF +#define ERRINFO_SECURITY_DATA_TOO_SHORT 0x000010E0 +#define ERRINFO_VCHANNEL_DATA_TOO_SHORT 0x000010E1 +#define ERRINFO_SHARE_DATA_TOO_SHORT 0x000010E2 +#define ERRINFO_BAD_SUPPRESS_OUTPUT_PDU 0x000010E3 +#define ERRINFO_CONFIRM_ACTIVE_PDU_TOO_SHORT 0x000010E5 +#define ERRINFO_CAPABILITY_SET_TOO_SMALL 0x000010E7 +#define ERRINFO_CAPABILITY_SET_TOO_LARGE 0x000010E8 +#define ERRINFO_NO_CURSOR_CACHE 0x000010E9 +#define ERRINFO_BAD_CAPABILITIES 0x000010EA +#define ERRINFO_VIRTUAL_CHANNEL_DECOMPRESSION 0x000010EC +#define ERRINFO_INVALID_VC_COMPRESSION_TYPE 0x000010ED +#define ERRINFO_INVALID_CHANNEL_ID 0x000010EF +#define ERRINFO_VCHANNELS_TOO_MANY 0x000010F0 +#define ERRINFO_REMOTEAPP_NOT_ENABLED 0x000010F3 +#define ERRINFO_CACHE_CAP_NOT_SET 0x000010F4 +#define ERRINFO_BITMAP_CACHE_ERROR_PDU_BAD_LENGTH2 0x000010F5 +#define ERRINFO_OFFSCREEN_CACHE_ERROR_PDU_BAD_LENGTH 0x000010F6 +#define ERRINFO_DRAWNINEGRID_CACHE_ERROR_PDU_BAD_LENGTH 0x000010F7 +#define ERRINFO_GDIPLUS_PDU_BAD_LENGTH 0x000010F8 +#define ERRINFO_SECURITY_DATA_TOO_SHORT2 0x00001111 +#define ERRINFO_SECURITY_DATA_TOO_SHORT3 0x00001112 +#define ERRINFO_SECURITY_DATA_TOO_SHORT4 0x00001113 +#define ERRINFO_SECURITY_DATA_TOO_SHORT5 0x00001114 +#define ERRINFO_SECURITY_DATA_TOO_SHORT6 0x00001115 +#define ERRINFO_SECURITY_DATA_TOO_SHORT7 0x00001116 +#define ERRINFO_SECURITY_DATA_TOO_SHORT8 0x00001117 +#define ERRINFO_SECURITY_DATA_TOO_SHORT9 0x00001118 +#define ERRINFO_SECURITY_DATA_TOO_SHORT10 0x00001119 +#define ERRINFO_SECURITY_DATA_TOO_SHORT11 0x0000111A +#define ERRINFO_SECURITY_DATA_TOO_SHORT12 0x0000111B +#define ERRINFO_SECURITY_DATA_TOO_SHORT13 0x0000111C +#define ERRINFO_SECURITY_DATA_TOO_SHORT14 0x0000111D +#define ERRINFO_SECURITY_DATA_TOO_SHORT15 0x0000111E +#define ERRINFO_SECURITY_DATA_TOO_SHORT16 0x0000111F +#define ERRINFO_SECURITY_DATA_TOO_SHORT17 0x00001120 +#define ERRINFO_SECURITY_DATA_TOO_SHORT18 0x00001121 +#define ERRINFO_SECURITY_DATA_TOO_SHORT19 0x00001122 +#define ERRINFO_SECURITY_DATA_TOO_SHORT20 0x00001123 +#define ERRINFO_SECURITY_DATA_TOO_SHORT21 0x00001124 +#define ERRINFO_SECURITY_DATA_TOO_SHORT22 0x00001125 +#define ERRINFO_SECURITY_DATA_TOO_SHORT23 0x00001126 +#define ERRINFO_BAD_MONITOR_DATA 0x00001129 +#define ERRINFO_VC_DECOMPRESSED_REASSEMBLE_FAILED 0x0000112A +#define ERRINFO_VC_DATA_TOO_LONG 0x0000112B +#define ERRINFO_BAD_FRAME_ACK_DATA 0x0000112C +#define ERRINFO_GRAPHICS_MODE_NOT_SUPPORTED 0x0000112D +#define ERRINFO_GRAPHICS_SUBSYSTEM_RESET_FAILED 0x0000112E +#define ERRINFO_GRAPHICS_SUBSYSTEM_FAILED 0x0000112F +#define ERRINFO_TIMEZONE_KEY_NAME_LENGTH_TOO_SHORT 0x00001130 +#define ERRINFO_TIMEZONE_KEY_NAME_LENGTH_TOO_LONG 0x00001131 +#define ERRINFO_DYNAMIC_DST_DISABLED_FIELD_MISSING 0x00001132 +#define ERRINFO_VC_DECODING_ERROR 0x00001133 +#define ERRINFO_VIRTUALDESKTOPTOOLARGE 0x00001134 +#define ERRINFO_MONITORGEOMETRYVALIDATIONFAILED 0x00001135 +#define ERRINFO_INVALIDMONITORCOUNT 0x00001136 +#define ERRINFO_UPDATE_SESSION_KEY_FAILED 0x00001191 +#define ERRINFO_DECRYPT_FAILED 0x00001192 +#define ERRINFO_ENCRYPT_FAILED 0x00001193 +#define ERRINFO_ENCRYPTION_PACKAGE_MISMATCH 0x00001194 +#define ERRINFO_DECRYPT_FAILED2 0x00001195 +#define ERRINFO_PEER_DISCONNECTED 0x00001196 -#define ERRINFO_SUCCESS 0x00000000 -#define ERRINFO_NONE 0xFFFFFFFF +#define ERRINFO_SUCCESS 0x00000000 +#define ERRINFO_NONE 0xFFFFFFFF -FREERDP_API const char* freerdp_get_error_info_string(UINT32 code); -FREERDP_API const char* freerdp_get_error_info_name(UINT32 code); -FREERDP_API const char* freerdp_get_error_info_category(UINT32 code); + FREERDP_API const char* freerdp_get_error_info_string(UINT32 code); + FREERDP_API const char* freerdp_get_error_info_name(UINT32 code); + FREERDP_API const char* freerdp_get_error_info_category(UINT32 code); -/** -* This static variable holds an error code if the return value from connect is FALSE. -* This variable is always set to 0 in the beginning of the connect sequence. -* The returned code can be used to inform the user of the detailed connect error. -* The value can hold one of the defined error codes below OR an error according to errno -*/ + /** + * This static variable holds an error code if the return value from connect is FALSE. + * This variable is always set to 0 in the beginning of the connect sequence. + * The returned code can be used to inform the user of the detailed connect error. + * The value can hold one of the defined error codes below OR an error according to errno + */ -FREERDP_API extern int connectErrorCode; + FREERDP_API extern int connectErrorCode; #define ERRORSTART 10000 #define PREECONNECTERROR ERRORSTART + 1 #define UNDEFINEDCONNECTERROR ERRORSTART + 2 #define POSTCONNECTERROR ERRORSTART + 3 -#define DNSERROR ERRORSTART + 4 /* general DNS ERROR */ +#define DNSERROR ERRORSTART + 4 /* general DNS ERROR */ #define DNSNAMENOTFOUND ERRORSTART + 5 /* EAI_NONAME */ -#define CONNECTERROR ERRORSTART + 6 /* a connect error if errno is not define during tcp connect */ +#define CONNECTERROR \ + ERRORSTART + 6 /* a connect error if errno is not define during tcp connect \ + */ #define MCSCONNECTINITIALERROR ERRORSTART + 7 #define TLSCONNECTERROR ERRORSTART + 8 #define AUTHENTICATIONERROR ERRORSTART + 9 #define INSUFFICIENTPRIVILEGESERROR ERRORSTART + 10 #define CANCELEDBYUSER ERRORSTART + 11 + /** + * FreeRDP Context Error Codes + */ -/** - * FreeRDP Context Error Codes - */ +#define MAKE_FREERDP_ERROR(_class, _type) (((FREERDP_ERROR_##_class##_CLASS) << 16) | (_type)) -#define MAKE_FREERDP_ERROR(_class, _type) \ - (((FREERDP_ERROR_ ## _class ## _CLASS) << 16) | (_type)) +#define GET_FREERDP_ERROR_CLASS(_errorCode) ((_errorCode >> 16) & 0xFFFF) -#define GET_FREERDP_ERROR_CLASS(_errorCode) \ - ((_errorCode >> 16) & 0xFFFF) - -#define GET_FREERDP_ERROR_TYPE(_errorCode) \ - (_errorCode & 0xFFFF) +#define GET_FREERDP_ERROR_TYPE(_errorCode) (_errorCode & 0xFFFF) #define GET_FREERDP_ERROR_SUBCODE -#define FREERDP_ERROR_BASE 0 +#define FREERDP_ERROR_BASE 0 /** * Error Base Codes */ -#define FREERDP_ERROR_ERRBASE_CLASS (FREERDP_ERROR_BASE + 0) +#define FREERDP_ERROR_ERRBASE_CLASS (FREERDP_ERROR_BASE + 0) -#define ERRBASE_SUCCESS ERRINFO_SUCCESS -#define ERRBASE_NONE ERRINFO_NONE +#define ERRBASE_SUCCESS ERRINFO_SUCCESS +#define ERRBASE_NONE ERRINFO_NONE -FREERDP_API const char* freerdp_get_error_base_string(UINT32 code); -FREERDP_API const char* freerdp_get_error_base_name(UINT32 code); -FREERDP_API const char* freerdp_get_error_base_category(UINT32 code); + FREERDP_API const char* freerdp_get_error_base_string(UINT32 code); + FREERDP_API const char* freerdp_get_error_base_name(UINT32 code); + FREERDP_API const char* freerdp_get_error_base_category(UINT32 code); -#define FREERDP_ERROR_SUCCESS ERRINFO_SUCCESS -#define FREERDP_ERROR_NONE ERRINFO_NONE +#define FREERDP_ERROR_SUCCESS ERRINFO_SUCCESS +#define FREERDP_ERROR_NONE ERRINFO_NONE -/* Error Info Codes */ + /* Error Info Codes */ -#define FREERDP_ERROR_ERRINFO_CLASS (FREERDP_ERROR_BASE + 1) +#define FREERDP_ERROR_ERRINFO_CLASS (FREERDP_ERROR_BASE + 1) -#define FREERDP_ERROR_RPC_INITIATED_DISCONNECT MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_RPC_INITIATED_DISCONNECT) -#define FREERDP_ERROR_RPC_INITIATED_LOGOFF MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_RPC_INITIATED_LOGOFF) -#define FREERDP_ERROR_IDLE_TIMEOUT MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_IDLE_TIMEOUT) -#define FREERDP_ERROR_LOGON_TIMEOUT MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_LOGON_TIMEOUT) -#define FREERDP_ERROR_DISCONNECTED_BY_OTHER_CONNECTION MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_DISCONNECTED_BY_OTHER_CONNECTION) -#define FREERDP_ERROR_OUT_OF_MEMORY MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_OUT_OF_MEMORY) -#define FREERDP_ERROR_SERVER_DENIED_CONNECTION MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_SERVER_DENIED_CONNECTION) -#define FREERDP_ERROR_SERVER_INSUFFICIENT_PRIVILEGES MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_SERVER_INSUFFICIENT_PRIVILEGES) -#define FREERDP_ERROR_SERVER_FRESH_CREDENTIALS_REQUIRED MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_SERVER_FRESH_CREDENTIALS_REQUIRED) -#define FREERDP_ERROR_RPC_INITIATED_DISCONNECT_BY_USER MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_RPC_INITIATED_DISCONNECT_BY_USER) -#define FREERDP_ERROR_LOGOFF_BY_USER MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_LOGOFF_BY_USER) +#define FREERDP_ERROR_RPC_INITIATED_DISCONNECT \ + MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_RPC_INITIATED_DISCONNECT) +#define FREERDP_ERROR_RPC_INITIATED_LOGOFF MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_RPC_INITIATED_LOGOFF) +#define FREERDP_ERROR_IDLE_TIMEOUT MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_IDLE_TIMEOUT) +#define FREERDP_ERROR_LOGON_TIMEOUT MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_LOGON_TIMEOUT) +#define FREERDP_ERROR_DISCONNECTED_BY_OTHER_CONNECTION \ + MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_DISCONNECTED_BY_OTHER_CONNECTION) +#define FREERDP_ERROR_OUT_OF_MEMORY MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_OUT_OF_MEMORY) +#define FREERDP_ERROR_SERVER_DENIED_CONNECTION \ + MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_SERVER_DENIED_CONNECTION) +#define FREERDP_ERROR_SERVER_INSUFFICIENT_PRIVILEGES \ + MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_SERVER_INSUFFICIENT_PRIVILEGES) +#define FREERDP_ERROR_SERVER_FRESH_CREDENTIALS_REQUIRED \ + MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_SERVER_FRESH_CREDENTIALS_REQUIRED) +#define FREERDP_ERROR_RPC_INITIATED_DISCONNECT_BY_USER \ + MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_RPC_INITIATED_DISCONNECT_BY_USER) +#define FREERDP_ERROR_LOGOFF_BY_USER MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_LOGOFF_BY_USER) -#define FREERDP_ERROR_CLOSE_STACK_ON_DRIVER_NOT_READY MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_CLOSE_STACK_ON_DRIVER_NOT_READY) -#define FREERDP_ERROR_SERVER_DWM_CRASH MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_SERVER_DWM_CRASH) -#define FREERDP_ERROR_CLOSE_STACK_ON_DRIVER_FAILURE MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_CLOSE_STACK_ON_DRIVER_FAILURE) -#define FREERDP_ERROR_CLOSE_STACK_ON_DRIVER_IFACE_FAILURE MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_CLOSE_STACK_ON_DRIVER_IFACE_FAILURE) -#define FREERDP_ERROR_SERVER_WINLOGON_CRASH MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_SERVER_WINLOGON_CRASH) -#define FREERDP_ERROR_SERVER_CSRSS_CRASH MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_SERVER_CSRSS_CRASH) +#define FREERDP_ERROR_CLOSE_STACK_ON_DRIVER_NOT_READY \ + MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_CLOSE_STACK_ON_DRIVER_NOT_READY) +#define FREERDP_ERROR_SERVER_DWM_CRASH MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_SERVER_DWM_CRASH) +#define FREERDP_ERROR_CLOSE_STACK_ON_DRIVER_FAILURE \ + MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_CLOSE_STACK_ON_DRIVER_FAILURE) +#define FREERDP_ERROR_CLOSE_STACK_ON_DRIVER_IFACE_FAILURE \ + MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_CLOSE_STACK_ON_DRIVER_IFACE_FAILURE) +#define FREERDP_ERROR_SERVER_WINLOGON_CRASH \ + MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_SERVER_WINLOGON_CRASH) +#define FREERDP_ERROR_SERVER_CSRSS_CRASH MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_SERVER_CSRSS_CRASH) /* Connection Error Codes */ -#define ERRCONNECT_PRE_CONNECT_FAILED 0x00000001 -#define ERRCONNECT_CONNECT_UNDEFINED 0x00000002 -#define ERRCONNECT_POST_CONNECT_FAILED 0x00000003 -#define ERRCONNECT_DNS_ERROR 0x00000004 -#define ERRCONNECT_DNS_NAME_NOT_FOUND 0x00000005 -#define ERRCONNECT_CONNECT_FAILED 0x00000006 -#define ERRCONNECT_MCS_CONNECT_INITIAL_ERROR 0x00000007 -#define ERRCONNECT_TLS_CONNECT_FAILED 0x00000008 -#define ERRCONNECT_AUTHENTICATION_FAILED 0x00000009 -#define ERRCONNECT_INSUFFICIENT_PRIVILEGES 0x0000000A -#define ERRCONNECT_CONNECT_CANCELLED 0x0000000B -#define ERRCONNECT_SECURITY_NEGO_CONNECT_FAILED 0x0000000C -#define ERRCONNECT_CONNECT_TRANSPORT_FAILED 0x0000000D -#define ERRCONNECT_PASSWORD_EXPIRED 0x0000000E +#define ERRCONNECT_PRE_CONNECT_FAILED 0x00000001 +#define ERRCONNECT_CONNECT_UNDEFINED 0x00000002 +#define ERRCONNECT_POST_CONNECT_FAILED 0x00000003 +#define ERRCONNECT_DNS_ERROR 0x00000004 +#define ERRCONNECT_DNS_NAME_NOT_FOUND 0x00000005 +#define ERRCONNECT_CONNECT_FAILED 0x00000006 +#define ERRCONNECT_MCS_CONNECT_INITIAL_ERROR 0x00000007 +#define ERRCONNECT_TLS_CONNECT_FAILED 0x00000008 +#define ERRCONNECT_AUTHENTICATION_FAILED 0x00000009 +#define ERRCONNECT_INSUFFICIENT_PRIVILEGES 0x0000000A +#define ERRCONNECT_CONNECT_CANCELLED 0x0000000B +#define ERRCONNECT_SECURITY_NEGO_CONNECT_FAILED 0x0000000C +#define ERRCONNECT_CONNECT_TRANSPORT_FAILED 0x0000000D +#define ERRCONNECT_PASSWORD_EXPIRED 0x0000000E /* For non-domain workstation where we can't contact a kerberos server */ -#define ERRCONNECT_PASSWORD_CERTAINLY_EXPIRED 0x0000000F -#define ERRCONNECT_CLIENT_REVOKED 0x00000010 -#define ERRCONNECT_KDC_UNREACHABLE 0x00000011 +#define ERRCONNECT_PASSWORD_CERTAINLY_EXPIRED 0x0000000F +#define ERRCONNECT_CLIENT_REVOKED 0x00000010 +#define ERRCONNECT_KDC_UNREACHABLE 0x00000011 -#define ERRCONNECT_ACCOUNT_DISABLED 0x00000012 -#define ERRCONNECT_PASSWORD_MUST_CHANGE 0x00000013 -#define ERRCONNECT_LOGON_FAILURE 0x00000014 -#define ERRCONNECT_WRONG_PASSWORD 0x00000015 -#define ERRCONNECT_ACCESS_DENIED 0x00000016 -#define ERRCONNECT_ACCOUNT_RESTRICTION 0x00000017 -#define ERRCONNECT_ACCOUNT_LOCKED_OUT 0x00000018 -#define ERRCONNECT_ACCOUNT_EXPIRED 0x00000019 -#define ERRCONNECT_LOGON_TYPE_NOT_GRANTED 0x0000001A -#define ERRCONNECT_NO_OR_MISSING_CREDENTIALS 0x0000001B +#define ERRCONNECT_ACCOUNT_DISABLED 0x00000012 +#define ERRCONNECT_PASSWORD_MUST_CHANGE 0x00000013 +#define ERRCONNECT_LOGON_FAILURE 0x00000014 +#define ERRCONNECT_WRONG_PASSWORD 0x00000015 +#define ERRCONNECT_ACCESS_DENIED 0x00000016 +#define ERRCONNECT_ACCOUNT_RESTRICTION 0x00000017 +#define ERRCONNECT_ACCOUNT_LOCKED_OUT 0x00000018 +#define ERRCONNECT_ACCOUNT_EXPIRED 0x00000019 +#define ERRCONNECT_LOGON_TYPE_NOT_GRANTED 0x0000001A +#define ERRCONNECT_NO_OR_MISSING_CREDENTIALS 0x0000001B +#define ERRCONNECT_SUCCESS ERRINFO_SUCCESS +#define ERRCONNECT_NONE ERRINFO_NONE -#define ERRCONNECT_SUCCESS ERRINFO_SUCCESS -#define ERRCONNECT_NONE ERRINFO_NONE + FREERDP_API const char* freerdp_get_error_connect_string(UINT32 code); + FREERDP_API const char* freerdp_get_error_connect_name(UINT32 code); + FREERDP_API const char* freerdp_get_error_connect_category(UINT32 code); -FREERDP_API const char* freerdp_get_error_connect_string(UINT32 code); -FREERDP_API const char* freerdp_get_error_connect_name(UINT32 code); -FREERDP_API const char* freerdp_get_error_connect_category(UINT32 code); +#define FREERDP_ERROR_CONNECT_CLASS (FREERDP_ERROR_BASE + 2) -#define FREERDP_ERROR_CONNECT_CLASS (FREERDP_ERROR_BASE + 2) +#define FREERDP_ERROR_PRE_CONNECT_FAILED MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_PRE_CONNECT_FAILED) -#define FREERDP_ERROR_PRE_CONNECT_FAILED \ - MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_PRE_CONNECT_FAILED) +#define FREERDP_ERROR_CONNECT_UNDEFINED MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_CONNECT_UNDEFINED) -#define FREERDP_ERROR_CONNECT_UNDEFINED \ - MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_CONNECT_UNDEFINED) - -#define FREERDP_ERROR_POST_CONNECT_FAILED \ +#define FREERDP_ERROR_POST_CONNECT_FAILED \ MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_POST_CONNECT_FAILED) -#define FREERDP_ERROR_DNS_ERROR \ - MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_DNS_ERROR) +#define FREERDP_ERROR_DNS_ERROR MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_DNS_ERROR) -#define FREERDP_ERROR_DNS_NAME_NOT_FOUND \ - MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_DNS_NAME_NOT_FOUND) +#define FREERDP_ERROR_DNS_NAME_NOT_FOUND MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_DNS_NAME_NOT_FOUND) -#define FREERDP_ERROR_CONNECT_FAILED \ - MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_CONNECT_FAILED) +#define FREERDP_ERROR_CONNECT_FAILED MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_CONNECT_FAILED) #define FREERDP_ERROR_MCS_CONNECT_INITIAL_ERROR \ MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_MCS_CONNECT_INITIAL_ERROR) -#define FREERDP_ERROR_TLS_CONNECT_FAILED \ - MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_TLS_CONNECT_FAILED) +#define FREERDP_ERROR_TLS_CONNECT_FAILED MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_TLS_CONNECT_FAILED) #define FREERDP_ERROR_AUTHENTICATION_FAILED \ MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_AUTHENTICATION_FAILED) @@ -325,8 +327,7 @@ FREERDP_API const char* freerdp_get_error_connect_category(UINT32 code); #define FREERDP_ERROR_INSUFFICIENT_PRIVILEGES \ MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_INSUFFICIENT_PRIVILEGES) -#define FREERDP_ERROR_CONNECT_CANCELLED \ - MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_CONNECT_CANCELLED) +#define FREERDP_ERROR_CONNECT_CANCELLED MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_CONNECT_CANCELLED) #define FREERDP_ERROR_SECURITY_NEGO_CONNECT_FAILED \ MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_SECURITY_NEGO_CONNECT_FAILED) @@ -349,17 +350,13 @@ FREERDP_API const char* freerdp_get_error_connect_category(UINT32 code); #define FREERDP_ERROR_CONNECT_PASSWORD_CERTAINLY_EXPIRED \ MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_PASSWORD_CERTAINLY_EXPIRED) -#define FREERDP_ERROR_CONNECT_CLIENT_REVOKED \ - MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_CLIENT_REVOKED) +#define FREERDP_ERROR_CONNECT_CLIENT_REVOKED MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_CLIENT_REVOKED) -#define FREERDP_ERROR_CONNECT_LOGON_FAILURE \ - MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_LOGON_FAILURE) +#define FREERDP_ERROR_CONNECT_LOGON_FAILURE MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_LOGON_FAILURE) -#define FREERDP_ERROR_CONNECT_WRONG_PASSWORD \ - MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_WRONG_PASSWORD) +#define FREERDP_ERROR_CONNECT_WRONG_PASSWORD MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_WRONG_PASSWORD) -#define FREERDP_ERROR_CONNECT_ACCESS_DENIED \ - MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_ACCESS_DENIED) +#define FREERDP_ERROR_CONNECT_ACCESS_DENIED MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_ACCESS_DENIED) #define FREERDP_ERROR_CONNECT_ACCOUNT_RESTRICTION \ MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_ACCOUNT_RESTRICTION) @@ -376,8 +373,8 @@ FREERDP_API const char* freerdp_get_error_connect_category(UINT32 code); #define FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS \ MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_NO_OR_MISSING_CREDENTIALS) -#ifdef __cplusplus +#ifdef __cplusplus } #endif -#endif /* FREERDP_ERROR_H */ +#endif /* FREERDP_ERROR_H */ diff --git a/include/freerdp/event.h b/include/freerdp/event.h index 68444845e..74346b30f 100644 --- a/include/freerdp/event.h +++ b/include/freerdp/event.h @@ -23,104 +23,105 @@ #include #include -#ifdef __cplusplus -extern "C" { +#ifdef __cplusplus +extern "C" +{ #endif -#define FREERDP_WINDOW_STATE_NORMAL 0 -#define FREERDP_WINDOW_STATE_MINIMIZED 1 -#define FREERDP_WINDOW_STATE_MAXIMIZED 2 -#define FREERDP_WINDOW_STATE_FULLSCREEN 3 -#define FREERDP_WINDOW_STATE_ACTIVE 4 +#define FREERDP_WINDOW_STATE_NORMAL 0 +#define FREERDP_WINDOW_STATE_MINIMIZED 1 +#define FREERDP_WINDOW_STATE_MAXIMIZED 2 +#define FREERDP_WINDOW_STATE_FULLSCREEN 3 +#define FREERDP_WINDOW_STATE_ACTIVE 4 -DEFINE_EVENT_BEGIN(WindowStateChange) -int state; -DEFINE_EVENT_END(WindowStateChange) + DEFINE_EVENT_BEGIN(WindowStateChange) + int state; + DEFINE_EVENT_END(WindowStateChange) -DEFINE_EVENT_BEGIN(ResizeWindow) -int width; -int height; -DEFINE_EVENT_END(ResizeWindow) + DEFINE_EVENT_BEGIN(ResizeWindow) + int width; + int height; + DEFINE_EVENT_END(ResizeWindow) -DEFINE_EVENT_BEGIN(PanningChange) -int dx; -int dy; -DEFINE_EVENT_END(PanningChange) + DEFINE_EVENT_BEGIN(PanningChange) + int dx; + int dy; + DEFINE_EVENT_END(PanningChange) -DEFINE_EVENT_BEGIN(ZoomingChange) -int dx; -int dy; -DEFINE_EVENT_END(ZoomingChange) + DEFINE_EVENT_BEGIN(ZoomingChange) + int dx; + int dy; + DEFINE_EVENT_END(ZoomingChange) -DEFINE_EVENT_BEGIN(LocalResizeWindow) -int width; -int height; -DEFINE_EVENT_END(LocalResizeWindow) + DEFINE_EVENT_BEGIN(LocalResizeWindow) + int width; + int height; + DEFINE_EVENT_END(LocalResizeWindow) -DEFINE_EVENT_BEGIN(EmbedWindow) -BOOL embed; -void* handle; -DEFINE_EVENT_END(EmbedWindow) + DEFINE_EVENT_BEGIN(EmbedWindow) + BOOL embed; + void* handle; + DEFINE_EVENT_END(EmbedWindow) -DEFINE_EVENT_BEGIN(ErrorInfo) -UINT32 code; -DEFINE_EVENT_END(ErrorInfo) + DEFINE_EVENT_BEGIN(ErrorInfo) + UINT32 code; + DEFINE_EVENT_END(ErrorInfo) -DEFINE_EVENT_BEGIN(Activated) -BOOL firstActivation; -DEFINE_EVENT_END(Activated) + DEFINE_EVENT_BEGIN(Activated) + BOOL firstActivation; + DEFINE_EVENT_END(Activated) -DEFINE_EVENT_BEGIN(Terminate) -int code; -DEFINE_EVENT_END(Terminate) + DEFINE_EVENT_BEGIN(Terminate) + int code; + DEFINE_EVENT_END(Terminate) -DEFINE_EVENT_BEGIN(ConnectionResult) -int result; -DEFINE_EVENT_END(ConnectionResult) + DEFINE_EVENT_BEGIN(ConnectionResult) + int result; + DEFINE_EVENT_END(ConnectionResult) -DEFINE_EVENT_BEGIN(ChannelConnected) -const char* name; -void* pInterface; -DEFINE_EVENT_END(ChannelConnected) + DEFINE_EVENT_BEGIN(ChannelConnected) + const char* name; + void* pInterface; + DEFINE_EVENT_END(ChannelConnected) -DEFINE_EVENT_BEGIN(ChannelDisconnected) -const char* name; -void* pInterface; -DEFINE_EVENT_END(ChannelDisconnected) + DEFINE_EVENT_BEGIN(ChannelDisconnected) + const char* name; + void* pInterface; + DEFINE_EVENT_END(ChannelDisconnected) -DEFINE_EVENT_BEGIN(ChannelAttached) -const char* name; -void* pInterface; -DEFINE_EVENT_END(ChannelAttached) + DEFINE_EVENT_BEGIN(ChannelAttached) + const char* name; + void* pInterface; + DEFINE_EVENT_END(ChannelAttached) -DEFINE_EVENT_BEGIN(ChannelDetached) -const char* name; -void* pInterface; -DEFINE_EVENT_END(ChannelDetached) + DEFINE_EVENT_BEGIN(ChannelDetached) + const char* name; + void* pInterface; + DEFINE_EVENT_END(ChannelDetached) -DEFINE_EVENT_BEGIN(MouseEvent) -UINT16 flags; -UINT16 x; -UINT16 y; -DEFINE_EVENT_END(MouseEvent) + DEFINE_EVENT_BEGIN(MouseEvent) + UINT16 flags; + UINT16 x; + UINT16 y; + DEFINE_EVENT_END(MouseEvent) -DEFINE_EVENT_BEGIN(MouseEventEx) -UINT16 flags; -UINT16 x; -UINT16 y; -DEFINE_EVENT_END(MouseEventEx) + DEFINE_EVENT_BEGIN(MouseEventEx) + UINT16 flags; + UINT16 x; + UINT16 y; + DEFINE_EVENT_END(MouseEventEx) -DEFINE_EVENT_BEGIN(Timer) -UINT64 now; -DEFINE_EVENT_END(Timer) + DEFINE_EVENT_BEGIN(Timer) + UINT64 now; + DEFINE_EVENT_END(Timer) -DEFINE_EVENT_BEGIN(GraphicsReset) -UINT32 width; -UINT32 height; -DEFINE_EVENT_END(GraphicsReset) + DEFINE_EVENT_BEGIN(GraphicsReset) + UINT32 width; + UINT32 height; + DEFINE_EVENT_END(GraphicsReset) -#ifdef __cplusplus +#ifdef __cplusplus } #endif -#endif /* FREERDP_EVENT_H */ +#endif /* FREERDP_EVENT_H */ diff --git a/include/freerdp/extension.h b/include/freerdp/extension.h index 665b0634e..40b4283a6 100644 --- a/include/freerdp/extension.h +++ b/include/freerdp/extension.h @@ -24,22 +24,24 @@ #include #include -#define FREERDP_EXT_EXPORT_FUNC_NAME "FreeRDPExtensionEntry" +#define FREERDP_EXT_EXPORT_FUNC_NAME "FreeRDPExtensionEntry" typedef struct rdp_ext_plugin rdpExtPlugin; struct rdp_ext_plugin { void* ext; - int (*init) (rdpExtPlugin* plugin, freerdp* instance); - int (*uninit) (rdpExtPlugin* plugin, freerdp* instance); + int (*init)(rdpExtPlugin* plugin, freerdp* instance); + int (*uninit)(rdpExtPlugin* plugin, freerdp* instance); }; -typedef UINT32 (FREERDP_CC* PFREERDP_EXTENSION_HOOK)(rdpExtPlugin* plugin, freerdp* instance); +typedef UINT32(FREERDP_CC* PFREERDP_EXTENSION_HOOK)(rdpExtPlugin* plugin, freerdp* instance); -typedef UINT32 (FREERDP_CC* PREGISTEREXTENSION)(rdpExtPlugin* plugin); -typedef UINT32 (FREERDP_CC* PREGISTERPRECONNECTHOOK)(rdpExtPlugin* plugin, PFREERDP_EXTENSION_HOOK hook); -typedef UINT32 (FREERDP_CC* PREGISTERPOSTCONNECTHOOK)(rdpExtPlugin* plugin, PFREERDP_EXTENSION_HOOK hook); +typedef UINT32(FREERDP_CC* PREGISTEREXTENSION)(rdpExtPlugin* plugin); +typedef UINT32(FREERDP_CC* PREGISTERPRECONNECTHOOK)(rdpExtPlugin* plugin, + PFREERDP_EXTENSION_HOOK hook); +typedef UINT32(FREERDP_CC* PREGISTERPOSTCONNECTHOOK)(rdpExtPlugin* plugin, + PFREERDP_EXTENSION_HOOK hook); struct _FREERDP_EXTENSION_ENTRY_POINTS { @@ -53,6 +55,6 @@ struct _FREERDP_EXTENSION_ENTRY_POINTS typedef struct _FREERDP_EXTENSION_ENTRY_POINTS FREERDP_EXTENSION_ENTRY_POINTS; typedef FREERDP_EXTENSION_ENTRY_POINTS* PFREERDP_EXTENSION_ENTRY_POINTS; -typedef int (FREERDP_CC* PFREERDP_EXTENSION_ENTRY)(PFREERDP_EXTENSION_ENTRY_POINTS pEntryPoints); +typedef int(FREERDP_CC* PFREERDP_EXTENSION_ENTRY)(PFREERDP_EXTENSION_ENTRY_POINTS pEntryPoints); #endif /* FREERDP_EXTENSION_H */ diff --git a/include/freerdp/freerdp.h b/include/freerdp/freerdp.h index 6c43e2260..c4b5c2b9e 100644 --- a/include/freerdp/freerdp.h +++ b/include/freerdp/freerdp.h @@ -56,444 +56,447 @@ typedef RDP_CLIENT_ENTRY_POINTS_V1 RDP_CLIENT_ENTRY_POINTS; #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif /* Flags used by certificate callbacks */ -#define VERIFY_CERT_FLAG_NONE 0x00 -#define VERIFY_CERT_FLAG_LEGACY 0x02 +#define VERIFY_CERT_FLAG_NONE 0x00 +#define VERIFY_CERT_FLAG_LEGACY 0x02 #define VERIFY_CERT_FLAG_REDIRECT 0x10 -#define VERIFY_CERT_FLAG_GATEWAY 0x20 -#define VERIFY_CERT_FLAG_CHANGED 0x40 +#define VERIFY_CERT_FLAG_GATEWAY 0x20 +#define VERIFY_CERT_FLAG_CHANGED 0x40 #define VERIFY_CERT_FLAG_MISMATCH 0x80 -typedef BOOL (*pContextNew)(freerdp* instance, rdpContext* context); -typedef void (*pContextFree)(freerdp* instance, rdpContext* context); + typedef BOOL (*pContextNew)(freerdp* instance, rdpContext* context); + typedef void (*pContextFree)(freerdp* instance, rdpContext* context); -typedef BOOL (*pPreConnect)(freerdp* instance); -typedef BOOL (*pPostConnect)(freerdp* instance); -typedef void (*pPostDisconnect)(freerdp* instance); -typedef BOOL (*pAuthenticate)(freerdp* instance, char** username, - char** password, char** domain); + typedef BOOL (*pPreConnect)(freerdp* instance); + typedef BOOL (*pPostConnect)(freerdp* instance); + typedef void (*pPostDisconnect)(freerdp* instance); + typedef BOOL (*pAuthenticate)(freerdp* instance, char** username, char** password, + char** domain); -/** @brief Callback used if user interaction is required to accept - * an unknown certificate. - * - * @deprecated Use pVerifyCertificateEx - * @param common_name The certificate registered hostname. - * @param subject The common name of the certificate. - * @param issuer The issuer of the certificate. - * @param fingerprint The fingerprint of the certificate. - * @param host_mismatch A flag indicating the certificate - * subject does not match the host connecting to. - * - * @return 1 to accept and store a certificate, 2 to accept - * a certificate only for this session, 0 otherwise. - */ -typedef DWORD (*pVerifyCertificate)(freerdp* instance, - const char* common_name, - const char* subject, - const char* issuer, - const char* fingerprint, - BOOL host_mismatch); + /** @brief Callback used if user interaction is required to accept + * an unknown certificate. + * + * @deprecated Use pVerifyCertificateEx + * @param common_name The certificate registered hostname. + * @param subject The common name of the certificate. + * @param issuer The issuer of the certificate. + * @param fingerprint The fingerprint of the certificate. + * @param host_mismatch A flag indicating the certificate + * subject does not match the host connecting to. + * + * @return 1 to accept and store a certificate, 2 to accept + * a certificate only for this session, 0 otherwise. + */ + typedef DWORD (*pVerifyCertificate)(freerdp* instance, const char* common_name, + const char* subject, const char* issuer, + const char* fingerprint, BOOL host_mismatch); -/** @brief Callback used if user interaction is required to accept - * an unknown certificate. - * - * @param host The hostname connecting to. - * @param port The port connecting to. - * @param common_name The certificate registered hostname. - * @param subject The common name of the certificate. - * @param issuer The issuer of the certificate. - * @param fingerprint The fingerprint of the certificate. - * @param flags Flags of type VERIFY_CERT_FLAG* - * - * @return 1 to accept and store a certificate, 2 to accept - * a certificate only for this session, 0 otherwise. - */ -typedef DWORD (*pVerifyCertificateEx)(freerdp* instance, - const char* host, - UINT16 port, - const char* common_name, - const char* subject, - const char* issuer, - const char* fingerprint, - DWORD flags); + /** @brief Callback used if user interaction is required to accept + * an unknown certificate. + * + * @param host The hostname connecting to. + * @param port The port connecting to. + * @param common_name The certificate registered hostname. + * @param subject The common name of the certificate. + * @param issuer The issuer of the certificate. + * @param fingerprint The fingerprint of the certificate. + * @param flags Flags of type VERIFY_CERT_FLAG* + * + * @return 1 to accept and store a certificate, 2 to accept + * a certificate only for this session, 0 otherwise. + */ + typedef DWORD (*pVerifyCertificateEx)(freerdp* instance, const char* host, UINT16 port, + const char* common_name, const char* subject, + const char* issuer, const char* fingerprint, DWORD flags); -/** @brief Callback used if user interaction is required to accept - * a changed certificate. - * - * @deprecated Use pVerifyChangedCertificateEx - * @param common_name The certificate registered hostname. - * @param subject The common name of the new certificate. - * @param issuer The issuer of the new certificate. - * @param fingerprint The fingerprint of the new certificate. - * @param old_subject The common name of the old certificate. - * @param old_issuer The issuer of the new certificate. - * @param old_fingerprint The fingerprint of the old certificate. - * - * @return 1 to accept and store a certificate, 2 to accept - * a certificate only for this session, 0 otherwise. - */ + /** @brief Callback used if user interaction is required to accept + * a changed certificate. + * + * @deprecated Use pVerifyChangedCertificateEx + * @param common_name The certificate registered hostname. + * @param subject The common name of the new certificate. + * @param issuer The issuer of the new certificate. + * @param fingerprint The fingerprint of the new certificate. + * @param old_subject The common name of the old certificate. + * @param old_issuer The issuer of the new certificate. + * @param old_fingerprint The fingerprint of the old certificate. + * + * @return 1 to accept and store a certificate, 2 to accept + * a certificate only for this session, 0 otherwise. + */ -typedef DWORD (*pVerifyChangedCertificate)(freerdp* instance, - const char* common_name, - const char* subject, - const char* issuer, - const char* new_fingerprint, - const char* old_subject, - const char* old_issuer, - const char* old_fingerprint); + typedef DWORD (*pVerifyChangedCertificate)(freerdp* instance, const char* common_name, + const char* subject, const char* issuer, + const char* new_fingerprint, const char* old_subject, + const char* old_issuer, const char* old_fingerprint); -/** @brief Callback used if user interaction is required to accept - * a changed certificate. - * - * @param host The hostname connecting to. - * @param port The port connecting to. - * @param common_name The certificate registered hostname. - * @param subject The common name of the new certificate. - * @param issuer The issuer of the new certificate. - * @param fingerprint The fingerprint of the new certificate. - * @param old_subject The common name of the old certificate. - * @param old_issuer The issuer of the new certificate. - * @param old_fingerprint The fingerprint of the old certificate. - * @param flags Flags of type VERIFY_CERT_FLAG* - * - * @return 1 to accept and store a certificate, 2 to accept - * a certificate only for this session, 0 otherwise. - */ + /** @brief Callback used if user interaction is required to accept + * a changed certificate. + * + * @param host The hostname connecting to. + * @param port The port connecting to. + * @param common_name The certificate registered hostname. + * @param subject The common name of the new certificate. + * @param issuer The issuer of the new certificate. + * @param fingerprint The fingerprint of the new certificate. + * @param old_subject The common name of the old certificate. + * @param old_issuer The issuer of the new certificate. + * @param old_fingerprint The fingerprint of the old certificate. + * @param flags Flags of type VERIFY_CERT_FLAG* + * + * @return 1 to accept and store a certificate, 2 to accept + * a certificate only for this session, 0 otherwise. + */ -typedef DWORD (*pVerifyChangedCertificateEx)(freerdp* instance, - const char* host, - UINT16 port, - const char* common_name, - const char* subject, - const char* issuer, - const char* new_fingerprint, - const char* old_subject, - const char* old_issuer, - const char* old_fingerprint, - DWORD flags); + typedef DWORD (*pVerifyChangedCertificateEx)(freerdp* instance, const char* host, UINT16 port, + const char* common_name, const char* subject, + const char* issuer, const char* new_fingerprint, + const char* old_subject, const char* old_issuer, + const char* old_fingerprint, DWORD flags); -/** @brief Callback used if user interaction is required to accept - * a certificate. - * - * @param instance Pointer to the freerdp instance. - * @param data Pointer to certificate data in PEM format. - * @param length The length of the certificate data. - * @param hostname The hostname connecting to. - * @param port The port connecting to. - * @param flags Flags of type VERIFY_CERT_FLAG* - * - * @return 1 to accept and store a certificate, 2 to accept - * a certificate only for this session, 0 otherwise. - */ -typedef int (*pVerifyX509Certificate)(freerdp* instance, const BYTE* data, - size_t length, const char* hostname, - UINT16 port, DWORD flags); + /** @brief Callback used if user interaction is required to accept + * a certificate. + * + * @param instance Pointer to the freerdp instance. + * @param data Pointer to certificate data in PEM format. + * @param length The length of the certificate data. + * @param hostname The hostname connecting to. + * @param port The port connecting to. + * @param flags Flags of type VERIFY_CERT_FLAG* + * + * @return 1 to accept and store a certificate, 2 to accept + * a certificate only for this session, 0 otherwise. + */ + typedef int (*pVerifyX509Certificate)(freerdp* instance, const BYTE* data, size_t length, + const char* hostname, UINT16 port, DWORD flags); -typedef int (*pLogonErrorInfo)(freerdp* instance, UINT32 data, UINT32 type); + typedef int (*pLogonErrorInfo)(freerdp* instance, UINT32 data, UINT32 type); -typedef int (*pSendChannelData)(freerdp* instance, UINT16 channelId, BYTE* data, - int size); -typedef int (*pReceiveChannelData)(freerdp* instance, UINT16 channelId, - BYTE* data, int size, int flags, int totalSize); + typedef int (*pSendChannelData)(freerdp* instance, UINT16 channelId, BYTE* data, int size); + typedef int (*pReceiveChannelData)(freerdp* instance, UINT16 channelId, BYTE* data, int size, + int flags, int totalSize); -typedef BOOL (*pPresentGatewayMessage)(freerdp* instance, UINT32 type, BOOL isDisplayMandatory, - BOOL isConsentMandatory, size_t length, const WCHAR* message); + typedef BOOL (*pPresentGatewayMessage)(freerdp* instance, UINT32 type, BOOL isDisplayMandatory, + BOOL isConsentMandatory, size_t length, + const WCHAR* message); -/** - * Defines the context for a given instance of RDP connection. - * It is embedded in the rdp_freerdp structure, and allocated by a call to freerdp_context_new(). - * It is deallocated by a call to freerdp_context_free(). - */ -struct rdp_context -{ - ALIGN64 freerdp* instance; /**< (offset 0) - Pointer to a rdp_freerdp structure. - This is a back-link to retrieve the freerdp instance from the context. - It is set by the freerdp_context_new() function */ - ALIGN64 freerdp_peer* peer; /**< (offset 1) - Pointer to the client peer. - This is set by a call to freerdp_peer_context_new() during peer initialization. - This field is used only on the server side. */ - ALIGN64 BOOL ServerMode; /**< (offset 2) true when context is in server mode */ + /** + * Defines the context for a given instance of RDP connection. + * It is embedded in the rdp_freerdp structure, and allocated by a call to + * freerdp_context_new(). It is deallocated by a call to freerdp_context_free(). + */ + struct rdp_context + { + ALIGN64 freerdp* instance; /**< (offset 0) + Pointer to a rdp_freerdp structure. + This is a back-link to retrieve the freerdp instance from the context. + It is set by the freerdp_context_new() function */ + ALIGN64 freerdp_peer* peer; /**< (offset 1) + Pointer to the client peer. + This is set by a call to freerdp_peer_context_new() during peer + initialization. This field is used only on the server side. */ + ALIGN64 BOOL ServerMode; /**< (offset 2) true when context is in server mode */ - ALIGN64 UINT32 LastError; /* 3 */ + ALIGN64 UINT32 LastError; /* 3 */ - UINT64 paddingA[16 - 4]; /* 4 */ + UINT64 paddingA[16 - 4]; /* 4 */ - ALIGN64 int argc; /**< (offset 16) - Number of arguments given to the program at launch time. - Used to keep this data available and used later on, typically just before connection initialization. - @see freerdp_parse_args() */ - ALIGN64 char** argv; /**< (offset 17) - List of arguments given to the program at launch time. - Used to keep this data available and used later on, typically just before connection initialization. - @see freerdp_parse_args() */ + ALIGN64 int argc; /**< (offset 16) + Number of arguments given to the program at launch time. + Used to keep this data available and used later on, typically just before + connection initialization. + @see freerdp_parse_args() */ + ALIGN64 char** argv; /**< (offset 17) + List of arguments given to the program at launch time. + Used to keep this data available and used later on, typically just before + connection initialization. + @see freerdp_parse_args() */ - ALIGN64 wPubSub* pubSub; /* (offset 18) */ + ALIGN64 wPubSub* pubSub; /* (offset 18) */ - ALIGN64 HANDLE channelErrorEvent; /* (offset 19)*/ - ALIGN64 UINT channelErrorNum; /*(offset 20)*/ - ALIGN64 char* errorDescription; /*(offset 21)*/ + ALIGN64 HANDLE channelErrorEvent; /* (offset 19)*/ + ALIGN64 UINT channelErrorNum; /*(offset 20)*/ + ALIGN64 char* errorDescription; /*(offset 21)*/ - UINT64 paddingB[32 - 22]; /* 22 */ + UINT64 paddingB[32 - 22]; /* 22 */ - ALIGN64 rdpRdp* rdp; /**< (offset 32) - Pointer to a rdp_rdp structure used to keep the connection's parameters. - It is allocated by freerdp_context_new() and deallocated by freerdp_context_free(), at the same - time that this rdp_context structure - there is no need to specifically allocate/deallocate this. */ - ALIGN64 rdpGdi* gdi; /**< (offset 33) - Pointer to a rdp_gdi structure used to keep the gdi settings. - It is allocated by gdi_init() and deallocated by gdi_free(). - It must be deallocated before deallocating this rdp_context structure. */ - ALIGN64 rdpRail* rail; /* 34 */ - ALIGN64 rdpCache* cache; /* 35 */ - ALIGN64 rdpChannels* channels; /* 36 */ - ALIGN64 rdpGraphics* graphics; /* 37 */ - ALIGN64 rdpInput* input; /* 38 */ - ALIGN64 rdpUpdate* update; /* 39 */ - ALIGN64 rdpSettings* settings; /* 40 */ - ALIGN64 rdpMetrics* metrics; /* 41 */ - ALIGN64 rdpCodecs* codecs; /* 42 */ - ALIGN64 rdpAutoDetect* autodetect; /* 43 */ - ALIGN64 HANDLE abortEvent; /* 44 */ - ALIGN64 int disconnectUltimatum; /* 45 */ - UINT64 paddingC[64 - 46]; /* 46 */ + ALIGN64 rdpRdp* + rdp; /**< (offset 32) + Pointer to a rdp_rdp structure used to keep the connection's parameters. + It is allocated by freerdp_context_new() and deallocated by + freerdp_context_free(), at the same time that this rdp_context + structure - there is no need to specifically allocate/deallocate this. */ + ALIGN64 rdpGdi* gdi; /**< (offset 33) + Pointer to a rdp_gdi structure used to keep the gdi settings. + It is allocated by gdi_init() and deallocated by gdi_free(). + It must be deallocated before deallocating this rdp_context structure. */ + ALIGN64 rdpRail* rail; /* 34 */ + ALIGN64 rdpCache* cache; /* 35 */ + ALIGN64 rdpChannels* channels; /* 36 */ + ALIGN64 rdpGraphics* graphics; /* 37 */ + ALIGN64 rdpInput* input; /* 38 */ + ALIGN64 rdpUpdate* update; /* 39 */ + ALIGN64 rdpSettings* settings; /* 40 */ + ALIGN64 rdpMetrics* metrics; /* 41 */ + ALIGN64 rdpCodecs* codecs; /* 42 */ + ALIGN64 rdpAutoDetect* autodetect; /* 43 */ + ALIGN64 HANDLE abortEvent; /* 44 */ + ALIGN64 int disconnectUltimatum; /* 45 */ + UINT64 paddingC[64 - 46]; /* 46 */ - UINT64 paddingD[96 - 64]; /* 64 */ - UINT64 paddingE[128 - 96]; /* 96 */ -}; + UINT64 paddingD[96 - 64]; /* 64 */ + UINT64 paddingE[128 - 96]; /* 96 */ + }; -/** - * Defines the possible disconnect reasons in the MCS Disconnect Provider - * Ultimatum PDU - */ + /** + * Defines the possible disconnect reasons in the MCS Disconnect Provider + * Ultimatum PDU + */ -enum Disconnect_Ultimatum -{ - Disconnect_Ultimatum_domain_disconnected = 0, - Disconnect_Ultimatum_provider_initiated = 1, - Disconnect_Ultimatum_token_purged = 2, - Disconnect_Ultimatum_user_requested = 3, - Disconnect_Ultimatum_channel_purged = 4 -}; + enum Disconnect_Ultimatum + { + Disconnect_Ultimatum_domain_disconnected = 0, + Disconnect_Ultimatum_provider_initiated = 1, + Disconnect_Ultimatum_token_purged = 2, + Disconnect_Ultimatum_user_requested = 3, + Disconnect_Ultimatum_channel_purged = 4 + }; #include -/** Defines the options for a given instance of RDP connection. - * This is built by the client and given to the FreeRDP library to create the connection - * with the expected options. - * It is allocated by a call to freerdp_new() and deallocated by a call to freerdp_free(). - * Some of its content need specific allocation/deallocation - see field description for details. - */ -struct rdp_freerdp -{ - ALIGN64 rdpContext* context; /**< (offset 0) - Pointer to a rdpContext structure. - Client applications can use the ContextSize field to register a context bigger than the rdpContext - structure. This allow clients to use additional context information. - When using this capability, client application should ALWAYS declare their structure with the - rdpContext field first, and any additional content following it. - Can be allocated by a call to freerdp_context_new(). - Must be deallocated by a call to freerdp_context_free() before deallocating the current instance. */ + /** Defines the options for a given instance of RDP connection. + * This is built by the client and given to the FreeRDP library to create the connection + * with the expected options. + * It is allocated by a call to freerdp_new() and deallocated by a call to freerdp_free(). + * Some of its content need specific allocation/deallocation - see field description for + * details. + */ + struct rdp_freerdp + { + ALIGN64 + rdpContext* context; /**< (offset 0) + Pointer to a rdpContext structure. + Client applications can use the ContextSize field to register a + context bigger than the rdpContext structure. This allow clients to + use additional context information. When using this capability, client + application should ALWAYS declare their structure with the rdpContext + field first, and any additional content following it. Can be allocated + by a call to freerdp_context_new(). Must be deallocated by a call to + freerdp_context_free() before deallocating the current instance. */ - ALIGN64 RDP_CLIENT_ENTRY_POINTS* pClientEntryPoints; + ALIGN64 RDP_CLIENT_ENTRY_POINTS* pClientEntryPoints; - UINT64 paddingA[16 - 2]; /* 2 */ + UINT64 paddingA[16 - 2]; /* 2 */ - ALIGN64 rdpInput* input; /* (offset 16) - Input handle for the connection. - Will be initialized by a call to freerdp_context_new() */ - ALIGN64 rdpUpdate* update; /* (offset 17) - Update display parameters. Used to register display events callbacks and settings. - Will be initialized by a call to freerdp_context_new() */ - ALIGN64 rdpSettings* settings; /**< (offset 18) - Pointer to a rdpSettings structure. Will be used to maintain the required RDP settings. - Will be initialized by a call to freerdp_context_new() */ - ALIGN64 rdpAutoDetect* autodetect; /* (offset 19) - Auto-Detect handle for the connection. - Will be initialized by a call to freerdp_context_new() */ - UINT64 paddingB[32 - 20]; /* 20 */ + ALIGN64 rdpInput* input; /* (offset 16) + Input handle for the connection. + Will be initialized by a call to freerdp_context_new() */ + ALIGN64 rdpUpdate* + update; /* (offset 17) + Update display parameters. Used to register display events callbacks and settings. + Will be initialized by a call to freerdp_context_new() */ + ALIGN64 rdpSettings* settings; /**< (offset 18) + Pointer to a rdpSettings structure. Will be used to maintain the + required RDP settings. Will be + initialized by a call to freerdp_context_new() + */ + ALIGN64 rdpAutoDetect* autodetect; /* (offset 19) + Auto-Detect handle for the connection. + Will be initialized by a call to freerdp_context_new() */ + UINT64 paddingB[32 - 20]; /* 20 */ - ALIGN64 size_t ContextSize; /* (offset 32) - Specifies the size of the 'context' field. freerdp_context_new() will use this size to allocate the context buffer. - freerdp_new() sets it to sizeof(rdpContext). - If modifying it, there should always be a minimum of sizeof(rdpContext), as the freerdp library will assume it can use the - 'context' field to set the required informations in it. - Clients will typically make it bigger, and use a context structure embedding the rdpContext, and - adding additional information after that. - */ + ALIGN64 size_t + ContextSize; /* (offset 32) + Specifies the size of the 'context' field. freerdp_context_new() will use this + size to allocate the context buffer. freerdp_new() sets it to + sizeof(rdpContext). If modifying it, there should always be a minimum of + sizeof(rdpContext), as the freerdp library will assume it can use the 'context' + field to set the required informations in it. Clients will typically make it + bigger, and use a context structure embedding the rdpContext, and adding + additional information after that. + */ - ALIGN64 pContextNew ContextNew; /**< (offset 33) - Callback for context allocation - Can be set before calling freerdp_context_new() to have it executed after allocation and initialization. - Must be set to NULL if not needed. */ + ALIGN64 pContextNew + ContextNew; /**< (offset 33) + Callback for context allocation + Can be set before calling freerdp_context_new() to have it executed after + allocation and initialization. Must be set to NULL if not needed. */ - ALIGN64 pContextFree ContextFree; /**< (offset 34) - Callback for context deallocation - Can be set before calling freerdp_context_free() to have it executed before deallocation. - Must be set to NULL if not needed. */ - UINT64 paddingC[47 - 35]; /* 35 */ + ALIGN64 pContextFree + ContextFree; /**< (offset 34) + Callback for context deallocation + Can be set before calling freerdp_context_free() to have it executed before + deallocation. Must be set to NULL if not needed. */ + UINT64 paddingC[47 - 35]; /* 35 */ - ALIGN64 UINT ConnectionCallbackState; /* 47 */ + ALIGN64 UINT ConnectionCallbackState; /* 47 */ - ALIGN64 pPreConnect PreConnect; /**< (offset 48) - Callback for pre-connect operations. - Can be set before calling freerdp_connect() to have it executed before the actual connection happens. - Must be set to NULL if not needed. */ + ALIGN64 pPreConnect + PreConnect; /**< (offset 48) + Callback for pre-connect operations. + Can be set before calling freerdp_connect() to have it executed before the + actual connection happens. Must be set to NULL if not needed. */ - ALIGN64 pPostConnect PostConnect; /**< (offset 49) - Callback for post-connect operations. - Can be set before calling freerdp_connect() to have it executed after the actual connection has succeeded. - Must be set to NULL if not needed. */ + ALIGN64 pPostConnect + PostConnect; /**< (offset 49) + Callback for post-connect operations. + Can be set before calling freerdp_connect() to have it executed after the + actual connection has succeeded. Must be set to NULL if not needed. */ - ALIGN64 pAuthenticate Authenticate; /**< (offset 50) - Callback for authentication. - It is used to get the username/password when it was not provided at connection time. */ - ALIGN64 pVerifyCertificate VerifyCertificate; /**< (offset 51) - Callback for certificate validation. - Used to verify that an unknown certificate is trusted. - DEPRECATED: Use VerifyChangedCertificateEx*/ - ALIGN64 pVerifyChangedCertificate VerifyChangedCertificate; /**< (offset 52) - Callback for changed certificate validation. - Used when a certificate differs from stored fingerprint. - DEPRECATED: Use VerifyChangedCertificateEx */ + ALIGN64 pAuthenticate Authenticate; /**< (offset 50) + Callback for authentication. + It is used to get the username/password when it was not + provided at connection time. */ + ALIGN64 pVerifyCertificate VerifyCertificate; /**< (offset 51) + Callback for certificate validation. + Used to verify that an unknown certificate is + trusted. DEPRECATED: Use VerifyChangedCertificateEx*/ + ALIGN64 pVerifyChangedCertificate VerifyChangedCertificate; /**< (offset 52) + Callback for changed certificate + validation. Used when a certificate differs from stored fingerprint. + DEPRECATED: Use VerifyChangedCertificateEx */ - ALIGN64 pVerifyX509Certificate - VerifyX509Certificate; /**< (offset 53) Callback for X509 certificate verification (PEM format) */ + ALIGN64 pVerifyX509Certificate + VerifyX509Certificate; /**< (offset 53) Callback for X509 certificate verification (PEM + format) */ - ALIGN64 pLogonErrorInfo - LogonErrorInfo; /**< (offset 54) Callback for logon error info, important for logon system messages with RemoteApp */ + ALIGN64 pLogonErrorInfo + LogonErrorInfo; /**< (offset 54) Callback for logon error info, important for logon + system messages with RemoteApp */ - ALIGN64 pPostDisconnect PostDisconnect; /**< (offset 55) - Callback for cleaning up resources allocated - by connect callbacks. */ + ALIGN64 pPostDisconnect + PostDisconnect; /**< (offset 55) + Callback for cleaning up + resources allocated by connect callbacks. */ - ALIGN64 pAuthenticate GatewayAuthenticate; /**< (offset 56) - Callback for gateway authentication. - It is used to get the username/password when it was not provided at connection time. */ + ALIGN64 pAuthenticate GatewayAuthenticate; /**< (offset 56) + Callback for gateway authentication. + It is used to get the username/password when it was not + provided at connection time. */ - ALIGN64 pPresentGatewayMessage PresentGatewayMessage;/**< (offset 57) - Callback for gateway consent messages. - It is used to present consent messages to the user. */ + ALIGN64 pPresentGatewayMessage PresentGatewayMessage; /**< (offset 57) + Callback for gateway consent messages. + It is used to present consent messages to the user. */ - UINT64 paddingD[64 - 58]; /* 58 */ + UINT64 paddingD[64 - 58]; /* 58 */ - ALIGN64 pSendChannelData SendChannelData; /* (offset 64) - Callback for sending data to a channel. - By default, it is set by freerdp_new() to freerdp_send_channel_data(), which eventually calls - freerdp_channel_send() */ - ALIGN64 pReceiveChannelData ReceiveChannelData; /* (offset 65) - Callback for receiving data from a channel. - This is called by freerdp_channel_process() (if not NULL). - Clients will typically use a function that calls freerdp_channels_data() to perform the needed tasks. */ + ALIGN64 pSendChannelData + SendChannelData; /* (offset 64) + Callback for sending data to a channel. + By default, it is set by freerdp_new() to freerdp_send_channel_data(), which + eventually calls freerdp_channel_send() */ + ALIGN64 pReceiveChannelData + ReceiveChannelData; /* (offset 65) + Callback for receiving data from a channel. + This is called by freerdp_channel_process() (if not NULL). + Clients will typically use a function that calls freerdp_channels_data() + to perform the needed tasks. */ - ALIGN64 pVerifyCertificateEx VerifyCertificateEx; /**< (offset 66) - Callback for certificate validation. - Used to verify that an unknown certificate is trusted. */ - ALIGN64 pVerifyChangedCertificateEx VerifyChangedCertificateEx; /**< (offset 67) - Callback for changed certificate validation. - Used when a certificate differs from stored fingerprint. */ - UINT64 paddingE[80 - 68]; /* 68 */ -}; + ALIGN64 pVerifyCertificateEx + VerifyCertificateEx; /**< (offset 66) + Callback for certificate validation. + Used to verify that an unknown certificate is trusted. */ + ALIGN64 pVerifyChangedCertificateEx + VerifyChangedCertificateEx; /**< (offset 67) + Callback for changed certificate validation. + Used when a certificate differs from stored fingerprint. */ + UINT64 paddingE[80 - 68]; /* 68 */ + }; -struct rdp_channel_handles -{ - wListDictionary* init; - wListDictionary* open; -}; -typedef struct rdp_channel_handles rdpChannelHandles; + struct rdp_channel_handles + { + wListDictionary* init; + wListDictionary* open; + }; + typedef struct rdp_channel_handles rdpChannelHandles; -FREERDP_API BOOL freerdp_context_new(freerdp* instance); -FREERDP_API void freerdp_context_free(freerdp* instance); + FREERDP_API BOOL freerdp_context_new(freerdp* instance); + FREERDP_API void freerdp_context_free(freerdp* instance); -FREERDP_API BOOL freerdp_connect(freerdp* instance); -FREERDP_API BOOL freerdp_abort_connect(freerdp* instance); -FREERDP_API BOOL freerdp_shall_disconnect(freerdp* instance); -FREERDP_API BOOL freerdp_disconnect(freerdp* instance); + FREERDP_API BOOL freerdp_connect(freerdp* instance); + FREERDP_API BOOL freerdp_abort_connect(freerdp* instance); + FREERDP_API BOOL freerdp_shall_disconnect(freerdp* instance); + FREERDP_API BOOL freerdp_disconnect(freerdp* instance); -FREERDP_API BOOL freerdp_disconnect_before_reconnect(freerdp* instance); -FREERDP_API BOOL freerdp_reconnect(freerdp* instance); + FREERDP_API BOOL freerdp_disconnect_before_reconnect(freerdp* instance); + FREERDP_API BOOL freerdp_reconnect(freerdp* instance); -FREERDP_API UINT freerdp_channel_add_init_handle_data(rdpChannelHandles* handles, void* pInitHandle, - void* pUserData); -FREERDP_API void* freerdp_channel_get_init_handle_data(rdpChannelHandles* handles, - void* pInitHandle); -FREERDP_API void freerdp_channel_remove_init_handle_data(rdpChannelHandles* handles, - void* pInitHandle); + FREERDP_API UINT freerdp_channel_add_init_handle_data(rdpChannelHandles* handles, + void* pInitHandle, void* pUserData); + FREERDP_API void* freerdp_channel_get_init_handle_data(rdpChannelHandles* handles, + void* pInitHandle); + FREERDP_API void freerdp_channel_remove_init_handle_data(rdpChannelHandles* handles, + void* pInitHandle); -FREERDP_API UINT freerdp_channel_add_open_handle_data(rdpChannelHandles* handles, DWORD openHandle, - void* pUserData); -FREERDP_API void* freerdp_channel_get_open_handle_data(rdpChannelHandles* handles, - DWORD openHandle); -FREERDP_API void freerdp_channel_remove_open_handle_data(rdpChannelHandles* handles, - DWORD openHandle); + FREERDP_API UINT freerdp_channel_add_open_handle_data(rdpChannelHandles* handles, + DWORD openHandle, void* pUserData); + FREERDP_API void* freerdp_channel_get_open_handle_data(rdpChannelHandles* handles, + DWORD openHandle); + FREERDP_API void freerdp_channel_remove_open_handle_data(rdpChannelHandles* handles, + DWORD openHandle); -FREERDP_API UINT freerdp_channels_attach(freerdp* instance); -FREERDP_API UINT freerdp_channels_detach(freerdp* instance); + FREERDP_API UINT freerdp_channels_attach(freerdp* instance); + FREERDP_API UINT freerdp_channels_detach(freerdp* instance); -FREERDP_API BOOL freerdp_get_fds(freerdp* instance, void** rfds, int* rcount, - void** wfds, int* wcount); -FREERDP_API BOOL freerdp_check_fds(freerdp* instance); + FREERDP_API BOOL freerdp_get_fds(freerdp* instance, void** rfds, int* rcount, void** wfds, + int* wcount); + FREERDP_API BOOL freerdp_check_fds(freerdp* instance); -FREERDP_API DWORD freerdp_get_event_handles(rdpContext* context, HANDLE* events, - DWORD count); -FREERDP_API BOOL freerdp_check_event_handles(rdpContext* context); + FREERDP_API DWORD freerdp_get_event_handles(rdpContext* context, HANDLE* events, DWORD count); + FREERDP_API BOOL freerdp_check_event_handles(rdpContext* context); -FREERDP_API wMessageQueue* freerdp_get_message_queue(freerdp* instance, - DWORD id); -FREERDP_API HANDLE freerdp_get_message_queue_event_handle(freerdp* instance, - DWORD id); -FREERDP_API int freerdp_message_queue_process_message(freerdp* instance, - DWORD id, wMessage* message); -FREERDP_API int freerdp_message_queue_process_pending_messages( - freerdp* instance, DWORD id); + FREERDP_API wMessageQueue* freerdp_get_message_queue(freerdp* instance, DWORD id); + FREERDP_API HANDLE freerdp_get_message_queue_event_handle(freerdp* instance, DWORD id); + FREERDP_API int freerdp_message_queue_process_message(freerdp* instance, DWORD id, + wMessage* message); + FREERDP_API int freerdp_message_queue_process_pending_messages(freerdp* instance, DWORD id); -FREERDP_API UINT32 freerdp_error_info(freerdp* instance); -FREERDP_API void freerdp_set_error_info(rdpRdp* rdp, UINT32 error); -FREERDP_API BOOL freerdp_send_error_info(rdpRdp* rdp); -FREERDP_API BOOL freerdp_get_stats(rdpRdp* rdp, UINT64 *inBytes, UINT64 *outBytes, UINT64 *inPackets, UINT64 *outPackets); + FREERDP_API UINT32 freerdp_error_info(freerdp* instance); + FREERDP_API void freerdp_set_error_info(rdpRdp* rdp, UINT32 error); + FREERDP_API BOOL freerdp_send_error_info(rdpRdp* rdp); + FREERDP_API BOOL freerdp_get_stats(rdpRdp* rdp, UINT64* inBytes, UINT64* outBytes, + UINT64* inPackets, UINT64* outPackets); -FREERDP_API void freerdp_get_version(int* major, int* minor, int* revision); -FREERDP_API const char* freerdp_get_version_string(void); -FREERDP_API const char* freerdp_get_build_date(void); -FREERDP_API const char* freerdp_get_build_revision(void); -FREERDP_API const char* freerdp_get_build_config(void); + FREERDP_API void freerdp_get_version(int* major, int* minor, int* revision); + FREERDP_API const char* freerdp_get_version_string(void); + FREERDP_API const char* freerdp_get_build_date(void); + FREERDP_API const char* freerdp_get_build_revision(void); + FREERDP_API const char* freerdp_get_build_config(void); -FREERDP_API freerdp* freerdp_new(void); -FREERDP_API void freerdp_free(freerdp* instance); + FREERDP_API freerdp* freerdp_new(void); + FREERDP_API void freerdp_free(freerdp* instance); -FREERDP_API BOOL freerdp_focus_required(freerdp* instance); -FREERDP_API void freerdp_set_focus(freerdp* instance); + FREERDP_API BOOL freerdp_focus_required(freerdp* instance); + FREERDP_API void freerdp_set_focus(freerdp* instance); -FREERDP_API int freerdp_get_disconnect_ultimatum(rdpContext* context); + FREERDP_API int freerdp_get_disconnect_ultimatum(rdpContext* context); -FREERDP_API UINT32 freerdp_get_last_error(rdpContext* context); -FREERDP_API const char* freerdp_get_last_error_name(UINT32 error); -FREERDP_API const char* freerdp_get_last_error_string(UINT32 error); -FREERDP_API const char* freerdp_get_last_error_category(UINT32 error); -FREERDP_API void freerdp_set_last_error(rdpContext* context, UINT32 lastError); + FREERDP_API UINT32 freerdp_get_last_error(rdpContext* context); + FREERDP_API const char* freerdp_get_last_error_name(UINT32 error); + FREERDP_API const char* freerdp_get_last_error_string(UINT32 error); + FREERDP_API const char* freerdp_get_last_error_category(UINT32 error); + FREERDP_API void freerdp_set_last_error(rdpContext* context, UINT32 lastError); -FREERDP_API const char* freerdp_get_logon_error_info_type(UINT32 type); -FREERDP_API const char* freerdp_get_logon_error_info_data(UINT32 data); + FREERDP_API const char* freerdp_get_logon_error_info_type(UINT32 type); + FREERDP_API const char* freerdp_get_logon_error_info_data(UINT32 data); -FREERDP_API ULONG freerdp_get_transport_sent(rdpContext* context, - BOOL resetCount); + FREERDP_API ULONG freerdp_get_transport_sent(rdpContext* context, BOOL resetCount); -FREERDP_API BOOL freerdp_nla_impersonate(rdpContext* context); -FREERDP_API BOOL freerdp_nla_revert_to_self(rdpContext* context); + FREERDP_API BOOL freerdp_nla_impersonate(rdpContext* context); + FREERDP_API BOOL freerdp_nla_revert_to_self(rdpContext* context); -FREERDP_API void clearChannelError(rdpContext* context); -FREERDP_API HANDLE getChannelErrorEventHandle(rdpContext* context); -FREERDP_API UINT getChannelError(rdpContext* context); -FREERDP_API const char* getChannelErrorDescription(rdpContext* context); -FREERDP_API void setChannelError(rdpContext* context, UINT errorNum, - char* description); -FREERDP_API BOOL checkChannelErrorEvent(rdpContext* context); + FREERDP_API void clearChannelError(rdpContext* context); + FREERDP_API HANDLE getChannelErrorEventHandle(rdpContext* context); + FREERDP_API UINT getChannelError(rdpContext* context); + FREERDP_API const char* getChannelErrorDescription(rdpContext* context); + FREERDP_API void setChannelError(rdpContext* context, UINT errorNum, char* description); + FREERDP_API BOOL checkChannelErrorEvent(rdpContext* context); -FREERDP_API const char* freerdp_nego_get_routing_token(rdpContext* context, DWORD* length); + FREERDP_API const char* freerdp_nego_get_routing_token(rdpContext* context, DWORD* length); #ifdef __cplusplus } diff --git a/include/freerdp/gdi/bitmap.h b/include/freerdp/gdi/bitmap.h index d20399704..5f784f0ce 100644 --- a/include/freerdp/gdi/bitmap.h +++ b/include/freerdp/gdi/bitmap.h @@ -26,30 +26,26 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API UINT32 gdi_GetPixel(HGDI_DC hdc, UINT32 nXPos, UINT32 nYPos); -FREERDP_API UINT32 gdi_SetPixel(HGDI_DC hdc, UINT32 X, UINT32 Y, - UINT32 crColor); -FREERDP_API BYTE* gdi_GetPointer(HGDI_BITMAP hBmp, UINT32 X, UINT32 Y); + FREERDP_API UINT32 gdi_GetPixel(HGDI_DC hdc, UINT32 nXPos, UINT32 nYPos); + FREERDP_API UINT32 gdi_SetPixel(HGDI_DC hdc, UINT32 X, UINT32 Y, UINT32 crColor); + FREERDP_API BYTE* gdi_GetPointer(HGDI_BITMAP hBmp, UINT32 X, UINT32 Y); -FREERDP_API HGDI_BITMAP gdi_CreateBitmap(UINT32 nWidth, UINT32 nHeight, - UINT32 format, BYTE* data); -FREERDP_API HGDI_BITMAP gdi_CreateBitmapEx(UINT32 nWidth, UINT32 nHeight, - UINT32 format, UINT32 stride, - BYTE* data, void (*fkt_free)(void*)); -FREERDP_API HGDI_BITMAP gdi_CreateCompatibleBitmap(HGDI_DC hdc, - UINT32 nWidth, UINT32 nHeight); + FREERDP_API HGDI_BITMAP gdi_CreateBitmap(UINT32 nWidth, UINT32 nHeight, UINT32 format, + BYTE* data); + FREERDP_API HGDI_BITMAP gdi_CreateBitmapEx(UINT32 nWidth, UINT32 nHeight, UINT32 format, + UINT32 stride, BYTE* data, void (*fkt_free)(void*)); + FREERDP_API HGDI_BITMAP gdi_CreateCompatibleBitmap(HGDI_DC hdc, UINT32 nWidth, UINT32 nHeight); -FREERDP_API BOOL gdi_BitBlt(HGDI_DC hdcDest, INT32 nXDest, INT32 nYDest, - INT32 nWidth, INT32 nHeight, HGDI_DC hdcSrc, - INT32 nXSrc, INT32 nYSrc, DWORD rop, - const gdiPalette* palette); + FREERDP_API BOOL gdi_BitBlt(HGDI_DC hdcDest, INT32 nXDest, INT32 nYDest, INT32 nWidth, + INT32 nHeight, HGDI_DC hdcSrc, INT32 nXSrc, INT32 nYSrc, DWORD rop, + const gdiPalette* palette); -typedef BOOL (*p_BitBlt)(HGDI_DC hdcDest, INT32 nXDest, INT32 nYDest, - INT32 nWidth, INT32 nHeight, HGDI_DC hdcSrc, - INT32 nXSrc, INT32 nYSrc, DWORD rop); + typedef BOOL (*p_BitBlt)(HGDI_DC hdcDest, INT32 nXDest, INT32 nYDest, INT32 nWidth, + INT32 nHeight, HGDI_DC hdcSrc, INT32 nXSrc, INT32 nYSrc, DWORD rop); #ifdef __cplusplus } diff --git a/include/freerdp/gdi/dc.h b/include/freerdp/gdi/dc.h index f11d65581..d9b5c2bc2 100644 --- a/include/freerdp/gdi/dc.h +++ b/include/freerdp/gdi/dc.h @@ -26,18 +26,19 @@ #include #ifdef __cplusplus - extern "C" { +extern "C" +{ #endif -FREERDP_API HGDI_DC gdi_GetDC(void); -FREERDP_API HGDI_DC gdi_CreateDC(UINT32 format); -FREERDP_API HGDI_DC gdi_CreateCompatibleDC(HGDI_DC hdc); -FREERDP_API HGDIOBJECT gdi_SelectObject(HGDI_DC hdc, HGDIOBJECT hgdiobject); -FREERDP_API BOOL gdi_DeleteObject(HGDIOBJECT hgdiobject); -FREERDP_API BOOL gdi_DeleteDC(HGDI_DC hdc); + FREERDP_API HGDI_DC gdi_GetDC(void); + FREERDP_API HGDI_DC gdi_CreateDC(UINT32 format); + FREERDP_API HGDI_DC gdi_CreateCompatibleDC(HGDI_DC hdc); + FREERDP_API HGDIOBJECT gdi_SelectObject(HGDI_DC hdc, HGDIOBJECT hgdiobject); + FREERDP_API BOOL gdi_DeleteObject(HGDIOBJECT hgdiobject); + FREERDP_API BOOL gdi_DeleteDC(HGDI_DC hdc); #ifdef __cplusplus - } +} #endif #endif /* FREERDP_GDI_DC_H */ diff --git a/include/freerdp/gdi/gdi.h b/include/freerdp/gdi/gdi.h index c6baf47d5..77dfe318c 100644 --- a/include/freerdp/gdi/gdi.h +++ b/include/freerdp/gdi/gdi.h @@ -38,323 +38,322 @@ /* For more information, see [MS-RDPEGDI] */ /* Binary Raster Operations (ROP2) */ -#define GDI_R2_BLACK 0x01 /* D = 0 */ -#define GDI_R2_NOTMERGEPEN 0x02 /* D = ~(D | P) */ -#define GDI_R2_MASKNOTPEN 0x03 /* D = D & ~P */ -#define GDI_R2_NOTCOPYPEN 0x04 /* D = ~P */ -#define GDI_R2_MASKPENNOT 0x05 /* D = P & ~D */ -#define GDI_R2_NOT 0x06 /* D = ~D */ -#define GDI_R2_XORPEN 0x07 /* D = D ^ P */ -#define GDI_R2_NOTMASKPEN 0x08 /* D = ~(D & P) */ -#define GDI_R2_MASKPEN 0x09 /* D = D & P */ -#define GDI_R2_NOTXORPEN 0x0A /* D = ~(D ^ P) */ -#define GDI_R2_NOP 0x0B /* D = D */ -#define GDI_R2_MERGENOTPEN 0x0C /* D = D | ~P */ -#define GDI_R2_COPYPEN 0x0D /* D = P */ -#define GDI_R2_MERGEPENNOT 0x0E /* D = P | ~D */ -#define GDI_R2_MERGEPEN 0x0F /* D = P | D */ -#define GDI_R2_WHITE 0x10 /* D = 1 */ +#define GDI_R2_BLACK 0x01 /* D = 0 */ +#define GDI_R2_NOTMERGEPEN 0x02 /* D = ~(D | P) */ +#define GDI_R2_MASKNOTPEN 0x03 /* D = D & ~P */ +#define GDI_R2_NOTCOPYPEN 0x04 /* D = ~P */ +#define GDI_R2_MASKPENNOT 0x05 /* D = P & ~D */ +#define GDI_R2_NOT 0x06 /* D = ~D */ +#define GDI_R2_XORPEN 0x07 /* D = D ^ P */ +#define GDI_R2_NOTMASKPEN 0x08 /* D = ~(D & P) */ +#define GDI_R2_MASKPEN 0x09 /* D = D & P */ +#define GDI_R2_NOTXORPEN 0x0A /* D = ~(D ^ P) */ +#define GDI_R2_NOP 0x0B /* D = D */ +#define GDI_R2_MERGENOTPEN 0x0C /* D = D | ~P */ +#define GDI_R2_COPYPEN 0x0D /* D = P */ +#define GDI_R2_MERGEPENNOT 0x0E /* D = P | ~D */ +#define GDI_R2_MERGEPEN 0x0F /* D = P | D */ +#define GDI_R2_WHITE 0x10 /* D = 1 */ /* Ternary Raster Operations (ROP3) */ -#define GDI_BLACKNESS 0x00000042 -#define GDI_DPSoon 0x00010289 -#define GDI_DPSona 0x00020C89 -#define GDI_PSon 0x000300AA -#define GDI_SDPona 0x00040C88 -#define GDI_DPon 0x000500A9 -#define GDI_PDSxnon 0x00060865 -#define GDI_PDSaon 0x000702C5 -#define GDI_SDPnaa 0x00080F08 -#define GDI_PDSxon 0x00090245 -#define GDI_DPna 0x000A0329 -#define GDI_PSDnaon 0x000B0B2A -#define GDI_SPna 0x000C0324 -#define GDI_PDSnaon 0x000D0B25 -#define GDI_PDSonon 0x000E08A5 -#define GDI_Pn 0x000F0001 -#define GDI_PDSona 0x00100C85 -#define GDI_NOTSRCERASE 0x001100A6 -#define GDI_SDPxnon 0x00120868 -#define GDI_SDPaon 0x001302C8 -#define GDI_DPSxnon 0x00140869 -#define GDI_DPSaon 0x001502C9 -#define GDI_PSDPSanaxx 0x00165CCA -#define GDI_SSPxDSxaxn 0x00171D54 -#define GDI_SPxPDxa 0x00180D59 -#define GDI_SDPSanaxn 0x00191CC8 -#define GDI_PDSPaox 0x001A06C5 -#define GDI_SDPSxaxn 0x001B0768 -#define GDI_PSDPaox 0x001C06CA -#define GDI_DSPDxaxn 0x001D0766 -#define GDI_PDSox 0x001E01A5 -#define GDI_PDSoan 0x001F0385 -#define GDI_DPSnaa 0x00200F09 -#define GDI_SDPxon 0x00210248 -#define GDI_DSna 0x00220326 -#define GDI_SPDnaon 0x00230B24 -#define GDI_SPxDSxa 0x00240D55 -#define GDI_PDSPanaxn 0x00251CC5 -#define GDI_SDPSaox 0x002606C8 -#define GDI_SDPSxnox 0x00271868 -#define GDI_DPSxa 0x00280369 -#define GDI_PSDPSaoxxn 0x002916CA -#define GDI_DPSana 0x002A0CC9 -#define GDI_SSPxPDxaxn 0x002B1D58 -#define GDI_SPDSoax 0x002C0784 -#define GDI_PSDnox 0x002D060A -#define GDI_PSDPxox 0x002E064A -#define GDI_PSDnoan 0x002F0E2A -#define GDI_PSna 0x0030032A -#define GDI_SDPnaon 0x00310B28 -#define GDI_SDPSoox 0x00320688 -#define GDI_NOTSRCCOPY 0x00330008 -#define GDI_SPDSaox 0x003406C4 -#define GDI_SPDSxnox 0x00351864 -#define GDI_SDPox 0x003601A8 -#define GDI_SDPoan 0x00370388 -#define GDI_PSDPoax 0x0038078A -#define GDI_SPDnox 0x00390604 -#define GDI_SPDSxox 0x003A0644 -#define GDI_SPDnoan 0x003B0E24 -#define GDI_PSx 0x003C004A -#define GDI_SPDSonox 0x003D18A4 -#define GDI_SPDSnaox 0x003E1B24 -#define GDI_PSan 0x003F00EA -#define GDI_PSDnaa 0x00400F0A -#define GDI_DPSxon 0x00410249 -#define GDI_SDxPDxa 0x00420D5D -#define GDI_SPDSanaxn 0x00431CC4 -#define GDI_SRCERASE 0x00440328 -#define GDI_DPSnaon 0x00450B29 -#define GDI_DSPDaox 0x004606C6 -#define GDI_PSDPxaxn 0x0047076A -#define GDI_SDPxa 0x00480368 -#define GDI_PDSPDaoxxn 0x004916C5 -#define GDI_DPSDoax 0x004A0789 -#define GDI_PDSnox 0x004B0605 -#define GDI_SDPana 0x004C0CC8 -#define GDI_SSPxDSxoxn 0x004D1954 -#define GDI_PDSPxox 0x004E0645 -#define GDI_PDSnoan 0x004F0E25 -#define GDI_PDna 0x00500325 -#define GDI_DSPnaon 0x00510B26 -#define GDI_DPSDaox 0x005206C9 -#define GDI_SPDSxaxn 0x00530764 -#define GDI_DPSonon 0x005408A9 -#define GDI_DSTINVERT 0x00550009 -#define GDI_DPSox 0x005601A9 -#define GDI_DPSoan 0x00570389 -#define GDI_PDSPoax 0x00580785 -#define GDI_DPSnox 0x00590609 -#define GDI_PATINVERT 0x005A0049 -#define GDI_DPSDonox 0x005B18A9 -#define GDI_DPSDxox 0x005C0649 -#define GDI_DPSnoan 0x005D0E29 -#define GDI_DPSDnaox 0x005E1B29 -#define GDI_DPan 0x005F00E9 -#define GDI_PDSxa 0x00600365 -#define GDI_DSPDSaoxxn 0x006116C6 -#define GDI_DSPDoax 0x00620786 -#define GDI_SDPnox 0x00630608 -#define GDI_SDPSoax 0x00640788 -#define GDI_DSPnox 0x00650606 -#define GDI_SRCINVERT 0x00660046 -#define GDI_SDPSonox 0x006718A8 -#define GDI_DSPDSonoxxn 0x006858A6 -#define GDI_PDSxxn 0x00690145 -#define GDI_DPSax 0x006A01E9 -#define GDI_PSDPSoaxxn 0x006B178A -#define GDI_SDPax 0x006C01E8 -#define GDI_PDSPDoaxxn 0x006D1785 -#define GDI_SDPSnoax 0x006E1E28 -#define GDI_PDSxnan 0x006F0C65 -#define GDI_PDSana 0x00700CC5 -#define GDI_SSDxPDxaxn 0x00711D5C -#define GDI_SDPSxox 0x00720648 -#define GDI_SDPnoan 0x00730E28 -#define GDI_DSPDxox 0x00740646 -#define GDI_DSPnoan 0x00750E26 -#define GDI_SDPSnaox 0x00761B28 -#define GDI_DSan 0x007700E6 -#define GDI_PDSax 0x007801E5 -#define GDI_DSPDSoaxxn 0x00791786 -#define GDI_DPSDnoax 0x007A1E29 -#define GDI_SDPxnan 0x007B0C68 -#define GDI_SPDSnoax 0x007C1E24 -#define GDI_DPSxnan 0x007D0C69 -#define GDI_SPxDSxo 0x007E0955 -#define GDI_DPSaan 0x007F03C9 -#define GDI_DPSaa 0x008003E9 -#define GDI_SPxDSxon 0x00810975 -#define GDI_DPSxna 0x00820C49 -#define GDI_SPDSnoaxn 0x00831E04 -#define GDI_SDPxna 0x00840C48 -#define GDI_PDSPnoaxn 0x00851E05 -#define GDI_DSPDSoaxx 0x008617A6 -#define GDI_PDSaxn 0x008701C5 -#define GDI_SRCAND 0x008800C6 -#define GDI_SDPSnaoxn 0x00891B08 -#define GDI_DSPnoa 0x008A0E06 -#define GDI_DSPDxoxn 0x008B0666 -#define GDI_SDPnoa 0x008C0E08 -#define GDI_SDPSxoxn 0x008D0668 -#define GDI_SSDxPDxax 0x008E1D7C -#define GDI_PDSanan 0x008F0CE5 -#define GDI_PDSxna 0x00900C45 -#define GDI_SDPSnoaxn 0x00911E08 -#define GDI_DPSDPoaxx 0x009217A9 -#define GDI_SPDaxn 0x009301C4 -#define GDI_PSDPSoaxx 0x009417AA -#define GDI_DPSaxn 0x009501C9 -#define GDI_DPSxx 0x00960169 -#define GDI_PSDPSonoxx 0x0097588A -#define GDI_SDPSonoxn 0x00981888 -#define GDI_DSxn 0x00990066 -#define GDI_DPSnax 0x009A0709 -#define GDI_SDPSoaxn 0x009B07A8 -#define GDI_SPDnax 0x009C0704 -#define GDI_DSPDoaxn 0x009D07A6 -#define GDI_DSPDSaoxx 0x009E16E6 -#define GDI_PDSxan 0x009F0345 -#define GDI_DPa 0x00A000C9 -#define GDI_PDSPnaoxn 0x00A11B05 -#define GDI_DPSnoa 0x00A20E09 -#define GDI_DPSDxoxn 0x00A30669 -#define GDI_PDSPonoxn 0x00A41885 -#define GDI_PDxn 0x00A50065 -#define GDI_DSPnax 0x00A60706 -#define GDI_PDSPoaxn 0x00A707A5 -#define GDI_DPSoa 0x00A803A9 -#define GDI_DPSoxn 0x00A90189 -#define GDI_DSTCOPY 0x00AA0029 -#define GDI_DPSono 0x00AB0889 -#define GDI_SPDSxax 0x00AC0744 -#define GDI_DPSDaoxn 0x00AD06E9 -#define GDI_DSPnao 0x00AE0B06 -#define GDI_DPno 0x00AF0229 -#define GDI_PDSnoa 0x00B00E05 -#define GDI_PDSPxoxn 0x00B10665 -#define GDI_SSPxDSxox 0x00B21974 -#define GDI_SDPanan 0x00B30CE8 -#define GDI_PSDnax 0x00B4070A -#define GDI_DPSDoaxn 0x00B507A9 -#define GDI_DPSDPaoxx 0x00B616E9 -#define GDI_SDPxan 0x00B70348 -#define GDI_PSDPxax 0x00B8074A -#define GDI_DSPDaoxn 0x00B906E6 -#define GDI_DPSnao 0x00BA0B09 -#define GDI_MERGEPAINT 0x00BB0226 -#define GDI_SPDSanax 0x00BC1CE4 -#define GDI_SDxPDxan 0x00BD0D7D -#define GDI_DPSxo 0x00BE0269 -#define GDI_DPSano 0x00BF08C9 -#define GDI_MERGECOPY 0x00C000CA -#define GDI_SPDSnaoxn 0x00C11B04 -#define GDI_SPDSonoxn 0x00C21884 -#define GDI_PSxn 0x00C3006A -#define GDI_SPDnoa 0x00C40E04 -#define GDI_SPDSxoxn 0x00C50664 -#define GDI_SDPnax 0x00C60708 -#define GDI_PSDPoaxn 0x00C707AA -#define GDI_SDPoa 0x00C803A8 -#define GDI_SPDoxn 0x00C90184 -#define GDI_DPSDxax 0x00CA0749 -#define GDI_SPDSaoxn 0x00CB06E4 -#define GDI_SRCCOPY 0x00CC0020 -#define GDI_SDPono 0x00CD0888 -#define GDI_SDPnao 0x00CE0B08 -#define GDI_SPno 0x00CF0224 -#define GDI_PSDnoa 0x00D00E0A -#define GDI_PSDPxoxn 0x00D1066A -#define GDI_PDSnax 0x00D20705 -#define GDI_SPDSoaxn 0x00D307A4 -#define GDI_SSPxPDxax 0x00D41D78 -#define GDI_DPSanan 0x00D50CE9 -#define GDI_PSDPSaoxx 0x00D616EA -#define GDI_DPSxan 0x00D70349 -#define GDI_PDSPxax 0x00D80745 -#define GDI_SDPSaoxn 0x00D906E8 -#define GDI_DPSDanax 0x00DA1CE9 -#define GDI_SPxDSxan 0x00DB0D75 -#define GDI_SPDnao 0x00DC0B04 -#define GDI_SDno 0x00DD0228 -#define GDI_SDPxo 0x00DE0268 -#define GDI_SDPano 0x00DF08C8 -#define GDI_PDSoa 0x00E003A5 -#define GDI_PDSoxn 0x00E10185 -#define GDI_DSPDxax 0x00E20746 -#define GDI_PSDPaoxn 0x00E306EA -#define GDI_SDPSxax 0x00E40748 -#define GDI_PDSPaoxn 0x00E506E5 -#define GDI_SDPSanax 0x00E61CE8 -#define GDI_SPxPDxan 0x00E70D79 -#define GDI_SSPxDSxax 0x00E81D74 -#define GDI_DSPDSanaxxn 0x00E95CE6 -#define GDI_DPSao 0x00EA02E9 -#define GDI_DPSxno 0x00EB0849 -#define GDI_SDPao 0x00EC02E8 -#define GDI_SDPxno 0x00ED0848 -#define GDI_SRCPAINT 0x00EE0086 -#define GDI_SDPnoo 0x00EF0A08 -#define GDI_PATCOPY 0x00F00021 -#define GDI_PDSono 0x00F10885 -#define GDI_PDSnao 0x00F20B05 -#define GDI_PSno 0x00F3022A -#define GDI_PSDnao 0x00F40B0A -#define GDI_PDno 0x00F50225 -#define GDI_PDSxo 0x00F60265 -#define GDI_PDSano 0x00F708C5 -#define GDI_PDSao 0x00F802E5 -#define GDI_PDSxno 0x00F90845 -#define GDI_DPo 0x00FA0089 -#define GDI_PATPAINT 0x00FB0A09 -#define GDI_PSo 0x00FC008A -#define GDI_PSDnoo 0x00FD0A0A -#define GDI_DPSoo 0x00FE02A9 -#define GDI_WHITENESS 0x00FF0062 -#define GDI_GLYPH_ORDER 0xFFFFFFFF - +#define GDI_BLACKNESS 0x00000042 +#define GDI_DPSoon 0x00010289 +#define GDI_DPSona 0x00020C89 +#define GDI_PSon 0x000300AA +#define GDI_SDPona 0x00040C88 +#define GDI_DPon 0x000500A9 +#define GDI_PDSxnon 0x00060865 +#define GDI_PDSaon 0x000702C5 +#define GDI_SDPnaa 0x00080F08 +#define GDI_PDSxon 0x00090245 +#define GDI_DPna 0x000A0329 +#define GDI_PSDnaon 0x000B0B2A +#define GDI_SPna 0x000C0324 +#define GDI_PDSnaon 0x000D0B25 +#define GDI_PDSonon 0x000E08A5 +#define GDI_Pn 0x000F0001 +#define GDI_PDSona 0x00100C85 +#define GDI_NOTSRCERASE 0x001100A6 +#define GDI_SDPxnon 0x00120868 +#define GDI_SDPaon 0x001302C8 +#define GDI_DPSxnon 0x00140869 +#define GDI_DPSaon 0x001502C9 +#define GDI_PSDPSanaxx 0x00165CCA +#define GDI_SSPxDSxaxn 0x00171D54 +#define GDI_SPxPDxa 0x00180D59 +#define GDI_SDPSanaxn 0x00191CC8 +#define GDI_PDSPaox 0x001A06C5 +#define GDI_SDPSxaxn 0x001B0768 +#define GDI_PSDPaox 0x001C06CA +#define GDI_DSPDxaxn 0x001D0766 +#define GDI_PDSox 0x001E01A5 +#define GDI_PDSoan 0x001F0385 +#define GDI_DPSnaa 0x00200F09 +#define GDI_SDPxon 0x00210248 +#define GDI_DSna 0x00220326 +#define GDI_SPDnaon 0x00230B24 +#define GDI_SPxDSxa 0x00240D55 +#define GDI_PDSPanaxn 0x00251CC5 +#define GDI_SDPSaox 0x002606C8 +#define GDI_SDPSxnox 0x00271868 +#define GDI_DPSxa 0x00280369 +#define GDI_PSDPSaoxxn 0x002916CA +#define GDI_DPSana 0x002A0CC9 +#define GDI_SSPxPDxaxn 0x002B1D58 +#define GDI_SPDSoax 0x002C0784 +#define GDI_PSDnox 0x002D060A +#define GDI_PSDPxox 0x002E064A +#define GDI_PSDnoan 0x002F0E2A +#define GDI_PSna 0x0030032A +#define GDI_SDPnaon 0x00310B28 +#define GDI_SDPSoox 0x00320688 +#define GDI_NOTSRCCOPY 0x00330008 +#define GDI_SPDSaox 0x003406C4 +#define GDI_SPDSxnox 0x00351864 +#define GDI_SDPox 0x003601A8 +#define GDI_SDPoan 0x00370388 +#define GDI_PSDPoax 0x0038078A +#define GDI_SPDnox 0x00390604 +#define GDI_SPDSxox 0x003A0644 +#define GDI_SPDnoan 0x003B0E24 +#define GDI_PSx 0x003C004A +#define GDI_SPDSonox 0x003D18A4 +#define GDI_SPDSnaox 0x003E1B24 +#define GDI_PSan 0x003F00EA +#define GDI_PSDnaa 0x00400F0A +#define GDI_DPSxon 0x00410249 +#define GDI_SDxPDxa 0x00420D5D +#define GDI_SPDSanaxn 0x00431CC4 +#define GDI_SRCERASE 0x00440328 +#define GDI_DPSnaon 0x00450B29 +#define GDI_DSPDaox 0x004606C6 +#define GDI_PSDPxaxn 0x0047076A +#define GDI_SDPxa 0x00480368 +#define GDI_PDSPDaoxxn 0x004916C5 +#define GDI_DPSDoax 0x004A0789 +#define GDI_PDSnox 0x004B0605 +#define GDI_SDPana 0x004C0CC8 +#define GDI_SSPxDSxoxn 0x004D1954 +#define GDI_PDSPxox 0x004E0645 +#define GDI_PDSnoan 0x004F0E25 +#define GDI_PDna 0x00500325 +#define GDI_DSPnaon 0x00510B26 +#define GDI_DPSDaox 0x005206C9 +#define GDI_SPDSxaxn 0x00530764 +#define GDI_DPSonon 0x005408A9 +#define GDI_DSTINVERT 0x00550009 +#define GDI_DPSox 0x005601A9 +#define GDI_DPSoan 0x00570389 +#define GDI_PDSPoax 0x00580785 +#define GDI_DPSnox 0x00590609 +#define GDI_PATINVERT 0x005A0049 +#define GDI_DPSDonox 0x005B18A9 +#define GDI_DPSDxox 0x005C0649 +#define GDI_DPSnoan 0x005D0E29 +#define GDI_DPSDnaox 0x005E1B29 +#define GDI_DPan 0x005F00E9 +#define GDI_PDSxa 0x00600365 +#define GDI_DSPDSaoxxn 0x006116C6 +#define GDI_DSPDoax 0x00620786 +#define GDI_SDPnox 0x00630608 +#define GDI_SDPSoax 0x00640788 +#define GDI_DSPnox 0x00650606 +#define GDI_SRCINVERT 0x00660046 +#define GDI_SDPSonox 0x006718A8 +#define GDI_DSPDSonoxxn 0x006858A6 +#define GDI_PDSxxn 0x00690145 +#define GDI_DPSax 0x006A01E9 +#define GDI_PSDPSoaxxn 0x006B178A +#define GDI_SDPax 0x006C01E8 +#define GDI_PDSPDoaxxn 0x006D1785 +#define GDI_SDPSnoax 0x006E1E28 +#define GDI_PDSxnan 0x006F0C65 +#define GDI_PDSana 0x00700CC5 +#define GDI_SSDxPDxaxn 0x00711D5C +#define GDI_SDPSxox 0x00720648 +#define GDI_SDPnoan 0x00730E28 +#define GDI_DSPDxox 0x00740646 +#define GDI_DSPnoan 0x00750E26 +#define GDI_SDPSnaox 0x00761B28 +#define GDI_DSan 0x007700E6 +#define GDI_PDSax 0x007801E5 +#define GDI_DSPDSoaxxn 0x00791786 +#define GDI_DPSDnoax 0x007A1E29 +#define GDI_SDPxnan 0x007B0C68 +#define GDI_SPDSnoax 0x007C1E24 +#define GDI_DPSxnan 0x007D0C69 +#define GDI_SPxDSxo 0x007E0955 +#define GDI_DPSaan 0x007F03C9 +#define GDI_DPSaa 0x008003E9 +#define GDI_SPxDSxon 0x00810975 +#define GDI_DPSxna 0x00820C49 +#define GDI_SPDSnoaxn 0x00831E04 +#define GDI_SDPxna 0x00840C48 +#define GDI_PDSPnoaxn 0x00851E05 +#define GDI_DSPDSoaxx 0x008617A6 +#define GDI_PDSaxn 0x008701C5 +#define GDI_SRCAND 0x008800C6 +#define GDI_SDPSnaoxn 0x00891B08 +#define GDI_DSPnoa 0x008A0E06 +#define GDI_DSPDxoxn 0x008B0666 +#define GDI_SDPnoa 0x008C0E08 +#define GDI_SDPSxoxn 0x008D0668 +#define GDI_SSDxPDxax 0x008E1D7C +#define GDI_PDSanan 0x008F0CE5 +#define GDI_PDSxna 0x00900C45 +#define GDI_SDPSnoaxn 0x00911E08 +#define GDI_DPSDPoaxx 0x009217A9 +#define GDI_SPDaxn 0x009301C4 +#define GDI_PSDPSoaxx 0x009417AA +#define GDI_DPSaxn 0x009501C9 +#define GDI_DPSxx 0x00960169 +#define GDI_PSDPSonoxx 0x0097588A +#define GDI_SDPSonoxn 0x00981888 +#define GDI_DSxn 0x00990066 +#define GDI_DPSnax 0x009A0709 +#define GDI_SDPSoaxn 0x009B07A8 +#define GDI_SPDnax 0x009C0704 +#define GDI_DSPDoaxn 0x009D07A6 +#define GDI_DSPDSaoxx 0x009E16E6 +#define GDI_PDSxan 0x009F0345 +#define GDI_DPa 0x00A000C9 +#define GDI_PDSPnaoxn 0x00A11B05 +#define GDI_DPSnoa 0x00A20E09 +#define GDI_DPSDxoxn 0x00A30669 +#define GDI_PDSPonoxn 0x00A41885 +#define GDI_PDxn 0x00A50065 +#define GDI_DSPnax 0x00A60706 +#define GDI_PDSPoaxn 0x00A707A5 +#define GDI_DPSoa 0x00A803A9 +#define GDI_DPSoxn 0x00A90189 +#define GDI_DSTCOPY 0x00AA0029 +#define GDI_DPSono 0x00AB0889 +#define GDI_SPDSxax 0x00AC0744 +#define GDI_DPSDaoxn 0x00AD06E9 +#define GDI_DSPnao 0x00AE0B06 +#define GDI_DPno 0x00AF0229 +#define GDI_PDSnoa 0x00B00E05 +#define GDI_PDSPxoxn 0x00B10665 +#define GDI_SSPxDSxox 0x00B21974 +#define GDI_SDPanan 0x00B30CE8 +#define GDI_PSDnax 0x00B4070A +#define GDI_DPSDoaxn 0x00B507A9 +#define GDI_DPSDPaoxx 0x00B616E9 +#define GDI_SDPxan 0x00B70348 +#define GDI_PSDPxax 0x00B8074A +#define GDI_DSPDaoxn 0x00B906E6 +#define GDI_DPSnao 0x00BA0B09 +#define GDI_MERGEPAINT 0x00BB0226 +#define GDI_SPDSanax 0x00BC1CE4 +#define GDI_SDxPDxan 0x00BD0D7D +#define GDI_DPSxo 0x00BE0269 +#define GDI_DPSano 0x00BF08C9 +#define GDI_MERGECOPY 0x00C000CA +#define GDI_SPDSnaoxn 0x00C11B04 +#define GDI_SPDSonoxn 0x00C21884 +#define GDI_PSxn 0x00C3006A +#define GDI_SPDnoa 0x00C40E04 +#define GDI_SPDSxoxn 0x00C50664 +#define GDI_SDPnax 0x00C60708 +#define GDI_PSDPoaxn 0x00C707AA +#define GDI_SDPoa 0x00C803A8 +#define GDI_SPDoxn 0x00C90184 +#define GDI_DPSDxax 0x00CA0749 +#define GDI_SPDSaoxn 0x00CB06E4 +#define GDI_SRCCOPY 0x00CC0020 +#define GDI_SDPono 0x00CD0888 +#define GDI_SDPnao 0x00CE0B08 +#define GDI_SPno 0x00CF0224 +#define GDI_PSDnoa 0x00D00E0A +#define GDI_PSDPxoxn 0x00D1066A +#define GDI_PDSnax 0x00D20705 +#define GDI_SPDSoaxn 0x00D307A4 +#define GDI_SSPxPDxax 0x00D41D78 +#define GDI_DPSanan 0x00D50CE9 +#define GDI_PSDPSaoxx 0x00D616EA +#define GDI_DPSxan 0x00D70349 +#define GDI_PDSPxax 0x00D80745 +#define GDI_SDPSaoxn 0x00D906E8 +#define GDI_DPSDanax 0x00DA1CE9 +#define GDI_SPxDSxan 0x00DB0D75 +#define GDI_SPDnao 0x00DC0B04 +#define GDI_SDno 0x00DD0228 +#define GDI_SDPxo 0x00DE0268 +#define GDI_SDPano 0x00DF08C8 +#define GDI_PDSoa 0x00E003A5 +#define GDI_PDSoxn 0x00E10185 +#define GDI_DSPDxax 0x00E20746 +#define GDI_PSDPaoxn 0x00E306EA +#define GDI_SDPSxax 0x00E40748 +#define GDI_PDSPaoxn 0x00E506E5 +#define GDI_SDPSanax 0x00E61CE8 +#define GDI_SPxPDxan 0x00E70D79 +#define GDI_SSPxDSxax 0x00E81D74 +#define GDI_DSPDSanaxxn 0x00E95CE6 +#define GDI_DPSao 0x00EA02E9 +#define GDI_DPSxno 0x00EB0849 +#define GDI_SDPao 0x00EC02E8 +#define GDI_SDPxno 0x00ED0848 +#define GDI_SRCPAINT 0x00EE0086 +#define GDI_SDPnoo 0x00EF0A08 +#define GDI_PATCOPY 0x00F00021 +#define GDI_PDSono 0x00F10885 +#define GDI_PDSnao 0x00F20B05 +#define GDI_PSno 0x00F3022A +#define GDI_PSDnao 0x00F40B0A +#define GDI_PDno 0x00F50225 +#define GDI_PDSxo 0x00F60265 +#define GDI_PDSano 0x00F708C5 +#define GDI_PDSao 0x00F802E5 +#define GDI_PDSxno 0x00F90845 +#define GDI_DPo 0x00FA0089 +#define GDI_PATPAINT 0x00FB0A09 +#define GDI_PSo 0x00FC008A +#define GDI_PSDnoo 0x00FD0A0A +#define GDI_DPSoo 0x00FE02A9 +#define GDI_WHITENESS 0x00FF0062 +#define GDI_GLYPH_ORDER 0xFFFFFFFF /* Brush Styles */ -#define GDI_BS_SOLID 0x00 -#define GDI_BS_NULL 0x01 -#define GDI_BS_HATCHED 0x02 -#define GDI_BS_PATTERN 0x03 +#define GDI_BS_SOLID 0x00 +#define GDI_BS_NULL 0x01 +#define GDI_BS_HATCHED 0x02 +#define GDI_BS_PATTERN 0x03 /* Hatch Patterns */ -#define GDI_HS_HORIZONTAL 0x00 -#define GDI_HS_VERTICAL 0x01 -#define GDI_HS_FDIAGONAL 0x02 -#define GDI_HS_BDIAGONAL 0x03 -#define GDI_HS_CROSS 0x04 -#define GDI_HS_DIAGCROSS 0x05 +#define GDI_HS_HORIZONTAL 0x00 +#define GDI_HS_VERTICAL 0x01 +#define GDI_HS_FDIAGONAL 0x02 +#define GDI_HS_BDIAGONAL 0x03 +#define GDI_HS_CROSS 0x04 +#define GDI_HS_DIAGCROSS 0x05 /* Pen Styles */ -#define GDI_PS_SOLID 0x00 -#define GDI_PS_DASH 0x01 -#define GDI_PS_NULL 0x05 +#define GDI_PS_SOLID 0x00 +#define GDI_PS_DASH 0x01 +#define GDI_PS_NULL 0x05 /* Background Modes */ -#define GDI_OPAQUE 0x00000001 -#define GDI_TRANSPARENT 0x00000002 +#define GDI_OPAQUE 0x00000001 +#define GDI_TRANSPARENT 0x00000002 /* Fill Modes */ -#define GDI_FILL_ALTERNATE 0x01 -#define GDI_FILL_WINDING 0x02 +#define GDI_FILL_ALTERNATE 0x01 +#define GDI_FILL_WINDING 0x02 /* GDI Object Types */ -#define GDIOBJECT_BITMAP 0x00 -#define GDIOBJECT_PEN 0x01 -#define GDIOBJECT_PALETTE 0x02 -#define GDIOBJECT_BRUSH 0x03 -#define GDIOBJECT_RECT 0x04 -#define GDIOBJECT_REGION 0x05 +#define GDIOBJECT_BITMAP 0x00 +#define GDIOBJECT_PEN 0x01 +#define GDIOBJECT_PALETTE 0x02 +#define GDIOBJECT_BRUSH 0x03 +#define GDIOBJECT_RECT 0x04 +#define GDIOBJECT_REGION 0x05 /* Region return values */ #ifndef NULLREGION -#define NULLREGION 0x01 -#define SIMPLEREGION 0x02 -#define COMPLEXREGION 0x03 +#define NULLREGION 0x01 +#define SIMPLEREGION 0x02 +#define COMPLEXREGION 0x03 #endif struct _GDIOBJECT @@ -378,10 +377,10 @@ typedef GDI_RECT* HGDI_RECT; struct _GDI_RGN { BYTE objectType; - INT32 x; /* left */ - INT32 y; /* top */ - INT32 w; /* width */ - INT32 h; /* height */ + INT32 x; /* left */ + INT32 y; /* top */ + INT32 w; /* width */ + INT32 h; /* height */ BOOL null; /* null region */ }; typedef struct _GDI_RGN GDI_RGN; @@ -529,27 +528,26 @@ struct rdp_gdi }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API DWORD gdi_rop3_code(BYTE code); -FREERDP_API const char* gdi_rop3_code_string(BYTE code); -FREERDP_API const char* gdi_rop3_string(DWORD rop); + FREERDP_API DWORD gdi_rop3_code(BYTE code); + FREERDP_API const char* gdi_rop3_code_string(BYTE code); + FREERDP_API const char* gdi_rop3_string(DWORD rop); -FREERDP_API UINT32 gdi_get_pixel_format(UINT32 bitsPerPixel); -FREERDP_API BOOL gdi_decode_color(rdpGdi* gdi, const UINT32 srcColor, - UINT32* color, UINT32* format); -FREERDP_API BOOL gdi_resize(rdpGdi* gdi, UINT32 width, UINT32 height); -FREERDP_API BOOL gdi_resize_ex(rdpGdi* gdi, UINT32 width, UINT32 height, - UINT32 stride, UINT32 format, BYTE* buffer, - void (*pfree)(void*)); -FREERDP_API BOOL gdi_init(freerdp* instance, UINT32 format); -FREERDP_API BOOL gdi_init_ex(freerdp* instance, UINT32 format, - UINT32 stride, BYTE* buffer, - void (*pfree)(void*)); -FREERDP_API void gdi_free(freerdp* instance); + FREERDP_API UINT32 gdi_get_pixel_format(UINT32 bitsPerPixel); + FREERDP_API BOOL gdi_decode_color(rdpGdi* gdi, const UINT32 srcColor, UINT32* color, + UINT32* format); + FREERDP_API BOOL gdi_resize(rdpGdi* gdi, UINT32 width, UINT32 height); + FREERDP_API BOOL gdi_resize_ex(rdpGdi* gdi, UINT32 width, UINT32 height, UINT32 stride, + UINT32 format, BYTE* buffer, void (*pfree)(void*)); + FREERDP_API BOOL gdi_init(freerdp* instance, UINT32 format); + FREERDP_API BOOL gdi_init_ex(freerdp* instance, UINT32 format, UINT32 stride, BYTE* buffer, + void (*pfree)(void*)); + FREERDP_API void gdi_free(freerdp* instance); -FREERDP_API BOOL gdi_send_suppress_output(rdpGdi* gdi, BOOL suppress); + FREERDP_API BOOL gdi_send_suppress_output(rdpGdi* gdi, BOOL suppress); #ifdef __cplusplus } diff --git a/include/freerdp/gdi/gfx.h b/include/freerdp/gdi/gfx.h index 9ba087cb4..85ee7cec2 100644 --- a/include/freerdp/gdi/gfx.h +++ b/include/freerdp/gdi/gfx.h @@ -57,19 +57,19 @@ struct gdi_gfx_cache_entry typedef struct gdi_gfx_cache_entry gdiGfxCacheEntry; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API BOOL gdi_graphics_pipeline_init(rdpGdi* gdi, RdpgfxClientContext* gfx); -FREERDP_API BOOL gdi_graphics_pipeline_init_ex(rdpGdi* gdi, RdpgfxClientContext* gfx, - pcRdpgfxMapWindowForSurface map, - pcRdpgfxUnmapWindowForSurface unmap, - pcRdpgfxUpdateSurfaceArea update); -FREERDP_API void gdi_graphics_pipeline_uninit(rdpGdi* gdi, RdpgfxClientContext* gfx); + FREERDP_API BOOL gdi_graphics_pipeline_init(rdpGdi* gdi, RdpgfxClientContext* gfx); + FREERDP_API BOOL gdi_graphics_pipeline_init_ex(rdpGdi* gdi, RdpgfxClientContext* gfx, + pcRdpgfxMapWindowForSurface map, + pcRdpgfxUnmapWindowForSurface unmap, + pcRdpgfxUpdateSurfaceArea update); + FREERDP_API void gdi_graphics_pipeline_uninit(rdpGdi* gdi, RdpgfxClientContext* gfx); #ifdef __cplusplus } #endif #endif /* FREERDP_GDI_GFX_H */ - diff --git a/include/freerdp/gdi/pen.h b/include/freerdp/gdi/pen.h index 130f10949..880ef2536 100644 --- a/include/freerdp/gdi/pen.h +++ b/include/freerdp/gdi/pen.h @@ -24,15 +24,16 @@ #include #ifdef __cplusplus - extern "C" { +extern "C" +{ #endif -FREERDP_API HGDI_PEN gdi_CreatePen(UINT32 fnPenStyle, UINT32 nWidth, - UINT32 crColor, UINT32 format, const gdiPalette* palette); -FREERDP_API UINT32 gdi_GetPenColor(HGDI_PEN pen, UINT32 format); + FREERDP_API HGDI_PEN gdi_CreatePen(UINT32 fnPenStyle, UINT32 nWidth, UINT32 crColor, + UINT32 format, const gdiPalette* palette); + FREERDP_API UINT32 gdi_GetPenColor(HGDI_PEN pen, UINT32 format); #ifdef __cplusplus - } +} #endif #endif /* FREERDP_GDI_PEN_H */ diff --git a/include/freerdp/gdi/region.h b/include/freerdp/gdi/region.h index 21377dd8d..8c4c0e61f 100644 --- a/include/freerdp/gdi/region.h +++ b/include/freerdp/gdi/region.h @@ -26,40 +26,36 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API HGDI_RGN gdi_CreateRectRgn(INT32 nLeftRect, INT32 nTopRect, - INT32 nRightRect, INT32 nBottomRect); -FREERDP_API HGDI_RECT gdi_CreateRect(INT32 xLeft, INT32 yTop, - INT32 xRight, INT32 yBottom); -FREERDP_API void gdi_RectToRgn(HGDI_RECT rect, HGDI_RGN rgn); -FREERDP_API void gdi_CRectToRgn(INT32 left, INT32 top, - INT32 right, INT32 bottom, HGDI_RGN rgn); -FREERDP_API void gdi_RectToCRgn(const HGDI_RECT rect, INT32* x, INT32* y, - INT32* w, INT32* h); -FREERDP_API void gdi_CRectToCRgn(INT32 left, INT32 top, - INT32 right, INT32 bottom, - INT32* x, INT32* y, INT32* w, INT32* h); -FREERDP_API void gdi_RgnToRect(HGDI_RGN rgn, HGDI_RECT rect); -FREERDP_API void gdi_CRgnToRect(INT64 x, INT64 y, INT32 w, INT32 h, HGDI_RECT rect); -FREERDP_API void gdi_RgnToCRect(HGDI_RGN rgn, INT32* left, - INT32* top, INT32* right, INT32* bottom); -FREERDP_API void gdi_CRgnToCRect(INT32 x, INT32 y, INT32 w, INT32 h, - INT32* left, INT32* top, INT32* right, INT32* bottom); -FREERDP_API BOOL gdi_CopyOverlap(INT32 x, INT32 y, INT32 width, INT32 height, - INT32 srcx, INT32 srcy); -FREERDP_API BOOL gdi_SetRect(HGDI_RECT rc, INT32 xLeft, INT32 yTop, - INT32 xRight, INT32 yBottom); -FREERDP_API BOOL gdi_SetRgn(HGDI_RGN hRgn, INT32 nXLeft, INT32 nYLeft, - INT32 nWidth, INT32 nHeight); -FREERDP_API BOOL gdi_SetRectRgn(HGDI_RGN hRgn, INT32 nLeftRect, INT32 nTopRect, - INT32 nRightRect, INT32 nBottomRect); -FREERDP_API BOOL gdi_EqualRgn(HGDI_RGN hSrcRgn1, HGDI_RGN hSrcRgn2); -FREERDP_API BOOL gdi_CopyRect(HGDI_RECT dst, HGDI_RECT src); -FREERDP_API BOOL gdi_PtInRect(HGDI_RECT rc, INT32 x, INT32 y); -FREERDP_API BOOL gdi_InvalidateRegion(HGDI_DC hdc, INT32 x, INT32 y, - INT32 w, INT32 h); + FREERDP_API HGDI_RGN gdi_CreateRectRgn(INT32 nLeftRect, INT32 nTopRect, INT32 nRightRect, + INT32 nBottomRect); + FREERDP_API HGDI_RECT gdi_CreateRect(INT32 xLeft, INT32 yTop, INT32 xRight, INT32 yBottom); + FREERDP_API void gdi_RectToRgn(HGDI_RECT rect, HGDI_RGN rgn); + FREERDP_API void gdi_CRectToRgn(INT32 left, INT32 top, INT32 right, INT32 bottom, HGDI_RGN rgn); + FREERDP_API void gdi_RectToCRgn(const HGDI_RECT rect, INT32* x, INT32* y, INT32* w, INT32* h); + FREERDP_API void gdi_CRectToCRgn(INT32 left, INT32 top, INT32 right, INT32 bottom, INT32* x, + INT32* y, INT32* w, INT32* h); + FREERDP_API void gdi_RgnToRect(HGDI_RGN rgn, HGDI_RECT rect); + FREERDP_API void gdi_CRgnToRect(INT64 x, INT64 y, INT32 w, INT32 h, HGDI_RECT rect); + FREERDP_API void gdi_RgnToCRect(HGDI_RGN rgn, INT32* left, INT32* top, INT32* right, + INT32* bottom); + FREERDP_API void gdi_CRgnToCRect(INT32 x, INT32 y, INT32 w, INT32 h, INT32* left, INT32* top, + INT32* right, INT32* bottom); + FREERDP_API BOOL gdi_CopyOverlap(INT32 x, INT32 y, INT32 width, INT32 height, INT32 srcx, + INT32 srcy); + FREERDP_API BOOL gdi_SetRect(HGDI_RECT rc, INT32 xLeft, INT32 yTop, INT32 xRight, + INT32 yBottom); + FREERDP_API BOOL gdi_SetRgn(HGDI_RGN hRgn, INT32 nXLeft, INT32 nYLeft, INT32 nWidth, + INT32 nHeight); + FREERDP_API BOOL gdi_SetRectRgn(HGDI_RGN hRgn, INT32 nLeftRect, INT32 nTopRect, + INT32 nRightRect, INT32 nBottomRect); + FREERDP_API BOOL gdi_EqualRgn(HGDI_RGN hSrcRgn1, HGDI_RGN hSrcRgn2); + FREERDP_API BOOL gdi_CopyRect(HGDI_RECT dst, HGDI_RECT src); + FREERDP_API BOOL gdi_PtInRect(HGDI_RECT rc, INT32 x, INT32 y); + FREERDP_API BOOL gdi_InvalidateRegion(HGDI_DC hdc, INT32 x, INT32 y, INT32 w, INT32 h); #ifdef __cplusplus } diff --git a/include/freerdp/gdi/shape.h b/include/freerdp/gdi/shape.h index 7fcf63533..d4a183e85 100644 --- a/include/freerdp/gdi/shape.h +++ b/include/freerdp/gdi/shape.h @@ -24,18 +24,18 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API BOOL gdi_Ellipse(HGDI_DC hdc, int nLeftRect, int nTopRect, - int nRightRect, int nBottomRect); -FREERDP_API BOOL gdi_FillRect(HGDI_DC hdc, const HGDI_RECT rect, - HGDI_BRUSH hbr); -FREERDP_API BOOL gdi_Polygon(HGDI_DC hdc, GDI_POINT* lpPoints, int nCount); -FREERDP_API BOOL gdi_PolyPolygon(HGDI_DC hdc, GDI_POINT* lpPoints, - int* lpPolyCounts, int nCount); -FREERDP_API BOOL gdi_Rectangle(HGDI_DC hdc, INT32 nXDst, INT32 nYDst, - INT32 nWidth, INT32 nHeight); + FREERDP_API BOOL gdi_Ellipse(HGDI_DC hdc, int nLeftRect, int nTopRect, int nRightRect, + int nBottomRect); + FREERDP_API BOOL gdi_FillRect(HGDI_DC hdc, const HGDI_RECT rect, HGDI_BRUSH hbr); + FREERDP_API BOOL gdi_Polygon(HGDI_DC hdc, GDI_POINT* lpPoints, int nCount); + FREERDP_API BOOL gdi_PolyPolygon(HGDI_DC hdc, GDI_POINT* lpPoints, int* lpPolyCounts, + int nCount); + FREERDP_API BOOL gdi_Rectangle(HGDI_DC hdc, INT32 nXDst, INT32 nYDst, INT32 nWidth, + INT32 nHeight); #ifdef __cplusplus } diff --git a/include/freerdp/gdi/video.h b/include/freerdp/gdi/video.h index 3f13013f1..f34b45ddb 100644 --- a/include/freerdp/gdi/video.h +++ b/include/freerdp/gdi/video.h @@ -39,5 +39,4 @@ FREERDP_API void gdi_video_data_uninit(rdpGdi* gdi, VideoClientContext* context) FREERDP_API gdiVideoContext* gdi_video_new(rdpGdi* gdi); FREERDP_API void gdi_video_free(gdiVideoContext* context); - #endif /* FREERDP_GDI_VIDEO_H_ */ diff --git a/include/freerdp/graphics.h b/include/freerdp/graphics.h index fa3fcfa75..68f1e7da6 100644 --- a/include/freerdp/graphics.h +++ b/include/freerdp/graphics.h @@ -32,146 +32,138 @@ typedef struct rdp_glyph rdpGlyph; #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Bitmap Class */ -typedef BOOL (*pBitmap_New)(rdpContext* context, rdpBitmap* bitmap); -typedef void (*pBitmap_Free)(rdpContext* context, rdpBitmap* bitmap); -typedef BOOL (*pBitmap_Paint)(rdpContext* context, rdpBitmap* bitmap); -typedef BOOL (*pBitmap_Decompress)(rdpContext* context, rdpBitmap* bitmap, - const BYTE* data, UINT32 width, UINT32 height, - UINT32 bpp, UINT32 length, BOOL compressed, - UINT32 codec_id); -typedef BOOL (*pBitmap_SetSurface)(rdpContext* context, rdpBitmap* bitmap, - BOOL primary); + /* Bitmap Class */ + typedef BOOL (*pBitmap_New)(rdpContext* context, rdpBitmap* bitmap); + typedef void (*pBitmap_Free)(rdpContext* context, rdpBitmap* bitmap); + typedef BOOL (*pBitmap_Paint)(rdpContext* context, rdpBitmap* bitmap); + typedef BOOL (*pBitmap_Decompress)(rdpContext* context, rdpBitmap* bitmap, const BYTE* data, + UINT32 width, UINT32 height, UINT32 bpp, UINT32 length, + BOOL compressed, UINT32 codec_id); + typedef BOOL (*pBitmap_SetSurface)(rdpContext* context, rdpBitmap* bitmap, BOOL primary); -struct rdp_bitmap -{ - size_t size; /* 0 */ - pBitmap_New New; /* 1 */ - pBitmap_Free Free; /* 2 */ - pBitmap_Paint Paint; /* 3 */ - pBitmap_Decompress Decompress; /* 4 */ - pBitmap_SetSurface SetSurface; /* 5 */ - UINT32 paddingA[16 - 6]; /* 6 */ + struct rdp_bitmap + { + size_t size; /* 0 */ + pBitmap_New New; /* 1 */ + pBitmap_Free Free; /* 2 */ + pBitmap_Paint Paint; /* 3 */ + pBitmap_Decompress Decompress; /* 4 */ + pBitmap_SetSurface SetSurface; /* 5 */ + UINT32 paddingA[16 - 6]; /* 6 */ - UINT32 left; /* 16 */ - UINT32 top; /* 17 */ - UINT32 right; /* 18 */ - UINT32 bottom; /* 19 */ - UINT32 width; /* 20 */ - UINT32 height; /* 21 */ - UINT32 format; /* 22 */ - UINT32 flags; /* 23 */ - UINT32 length; /* 24 */ - BYTE* data; /* 25 */ - UINT32 paddingB[32 - 26]; /* 26 */ + UINT32 left; /* 16 */ + UINT32 top; /* 17 */ + UINT32 right; /* 18 */ + UINT32 bottom; /* 19 */ + UINT32 width; /* 20 */ + UINT32 height; /* 21 */ + UINT32 format; /* 22 */ + UINT32 flags; /* 23 */ + UINT32 length; /* 24 */ + BYTE* data; /* 25 */ + UINT32 paddingB[32 - 26]; /* 26 */ - BOOL compressed; /* 32 */ - BOOL ephemeral; /* 33 */ - UINT32 paddingC[64 - 34]; /* 34 */ -}; + BOOL compressed; /* 32 */ + BOOL ephemeral; /* 33 */ + UINT32 paddingC[64 - 34]; /* 34 */ + }; -FREERDP_API rdpBitmap* Bitmap_Alloc(rdpContext* context); -FREERDP_API BOOL Bitmap_SetRectangle(rdpBitmap* bitmap, - UINT16 left, - UINT16 top, UINT16 right, UINT16 bottom); -FREERDP_API BOOL Bitmap_SetDimensions(rdpBitmap* bitmap, - UINT16 width, - UINT16 height); + FREERDP_API rdpBitmap* Bitmap_Alloc(rdpContext* context); + FREERDP_API BOOL Bitmap_SetRectangle(rdpBitmap* bitmap, UINT16 left, UINT16 top, UINT16 right, + UINT16 bottom); + FREERDP_API BOOL Bitmap_SetDimensions(rdpBitmap* bitmap, UINT16 width, UINT16 height); -/* Pointer Class */ + /* Pointer Class */ -typedef BOOL (*pPointer_New)(rdpContext* context, rdpPointer* pointer); -typedef void (*pPointer_Free)(rdpContext* context, rdpPointer* pointer); -typedef BOOL (*pPointer_Set)(rdpContext* context, const rdpPointer* pointer); -typedef BOOL (*pPointer_SetNull)(rdpContext* context); -typedef BOOL (*pPointer_SetDefault)(rdpContext* context); -typedef BOOL (*pPointer_SetPosition)(rdpContext* context, UINT32 x, UINT32 y); + typedef BOOL (*pPointer_New)(rdpContext* context, rdpPointer* pointer); + typedef void (*pPointer_Free)(rdpContext* context, rdpPointer* pointer); + typedef BOOL (*pPointer_Set)(rdpContext* context, const rdpPointer* pointer); + typedef BOOL (*pPointer_SetNull)(rdpContext* context); + typedef BOOL (*pPointer_SetDefault)(rdpContext* context); + typedef BOOL (*pPointer_SetPosition)(rdpContext* context, UINT32 x, UINT32 y); -struct rdp_pointer -{ - size_t size; /* 0 */ - pPointer_New New; /* 1 */ - pPointer_Free Free; /* 2 */ - pPointer_Set Set; /* 3 */ - pPointer_SetNull SetNull; /* 4*/ - pPointer_SetDefault SetDefault; /* 5 */ - pPointer_SetPosition SetPosition; /* 6 */ - UINT32 paddingA[16 - 7]; /* 7 */ + struct rdp_pointer + { + size_t size; /* 0 */ + pPointer_New New; /* 1 */ + pPointer_Free Free; /* 2 */ + pPointer_Set Set; /* 3 */ + pPointer_SetNull SetNull; /* 4*/ + pPointer_SetDefault SetDefault; /* 5 */ + pPointer_SetPosition SetPosition; /* 6 */ + UINT32 paddingA[16 - 7]; /* 7 */ - UINT32 xPos; /* 16 */ - UINT32 yPos; /* 17 */ - UINT32 width; /* 18 */ - UINT32 height; /* 19 */ - UINT32 xorBpp; /* 20 */ - UINT32 lengthAndMask; /* 21 */ - UINT32 lengthXorMask; /* 22 */ - BYTE* xorMaskData; /* 23 */ - BYTE* andMaskData; /* 24 */ - UINT32 paddingB[32 - 25]; /* 25 */ -}; + UINT32 xPos; /* 16 */ + UINT32 yPos; /* 17 */ + UINT32 width; /* 18 */ + UINT32 height; /* 19 */ + UINT32 xorBpp; /* 20 */ + UINT32 lengthAndMask; /* 21 */ + UINT32 lengthXorMask; /* 22 */ + BYTE* xorMaskData; /* 23 */ + BYTE* andMaskData; /* 24 */ + UINT32 paddingB[32 - 25]; /* 25 */ + }; -FREERDP_API rdpPointer* Pointer_Alloc(rdpContext* context); + FREERDP_API rdpPointer* Pointer_Alloc(rdpContext* context); -/* Glyph Class */ -typedef BOOL (*pGlyph_New)(rdpContext* context, const rdpGlyph* glyph); -typedef void (*pGlyph_Free)(rdpContext* context, rdpGlyph* glyph); -typedef BOOL (*pGlyph_Draw)(rdpContext* context, const rdpGlyph* glyph, - INT32 x, INT32 y, INT32 w, INT32 h, - INT32 sx, INT32 sy, BOOL fOpRedundant); -typedef BOOL (*pGlyph_BeginDraw)(rdpContext* context, INT32 x, INT32 y, - INT32 width, INT32 height, UINT32 bgcolor, - UINT32 fgcolor, BOOL fOpRedundant); -typedef BOOL (*pGlyph_EndDraw)(rdpContext* context, INT32 x, INT32 y, - INT32 width, INT32 height, UINT32 bgcolor, UINT32 fgcolor); -typedef BOOL (*pGlyph_SetBounds)(rdpContext* context, INT32 x, INT32 y, - INT32 width, INT32 height); + /* Glyph Class */ + typedef BOOL (*pGlyph_New)(rdpContext* context, const rdpGlyph* glyph); + typedef void (*pGlyph_Free)(rdpContext* context, rdpGlyph* glyph); + typedef BOOL (*pGlyph_Draw)(rdpContext* context, const rdpGlyph* glyph, INT32 x, INT32 y, + INT32 w, INT32 h, INT32 sx, INT32 sy, BOOL fOpRedundant); + typedef BOOL (*pGlyph_BeginDraw)(rdpContext* context, INT32 x, INT32 y, INT32 width, + INT32 height, UINT32 bgcolor, UINT32 fgcolor, + BOOL fOpRedundant); + typedef BOOL (*pGlyph_EndDraw)(rdpContext* context, INT32 x, INT32 y, INT32 width, INT32 height, + UINT32 bgcolor, UINT32 fgcolor); + typedef BOOL (*pGlyph_SetBounds)(rdpContext* context, INT32 x, INT32 y, INT32 width, + INT32 height); -struct rdp_glyph -{ - size_t size; /* 0 */ - pGlyph_New New; /* 1 */ - pGlyph_Free Free; /* 2 */ - pGlyph_Draw Draw; /* 3 */ - pGlyph_BeginDraw BeginDraw; /* 4 */ - pGlyph_EndDraw EndDraw; /* 5 */ - pGlyph_SetBounds SetBounds; /* 6 */ - UINT32 paddingA[16 - 7]; /* 7 */ + struct rdp_glyph + { + size_t size; /* 0 */ + pGlyph_New New; /* 1 */ + pGlyph_Free Free; /* 2 */ + pGlyph_Draw Draw; /* 3 */ + pGlyph_BeginDraw BeginDraw; /* 4 */ + pGlyph_EndDraw EndDraw; /* 5 */ + pGlyph_SetBounds SetBounds; /* 6 */ + UINT32 paddingA[16 - 7]; /* 7 */ - INT32 x; /* 16 */ - INT32 y; /* 17 */ - UINT32 cx; /* 18 */ - UINT32 cy; /* 19 */ - UINT32 cb; /* 20 */ - BYTE* aj; /* 21 */ - UINT32 paddingB[32 - 22]; /* 22 */ -}; + INT32 x; /* 16 */ + INT32 y; /* 17 */ + UINT32 cx; /* 18 */ + UINT32 cy; /* 19 */ + UINT32 cb; /* 20 */ + BYTE* aj; /* 21 */ + UINT32 paddingB[32 - 22]; /* 22 */ + }; -FREERDP_API rdpGlyph* Glyph_Alloc(rdpContext* context, INT32 x, INT32 y, - UINT32 cx, UINT32 cy, UINT32 cb, const BYTE* aj); + FREERDP_API rdpGlyph* Glyph_Alloc(rdpContext* context, INT32 x, INT32 y, UINT32 cx, UINT32 cy, + UINT32 cb, const BYTE* aj); -/* Graphics Module */ + /* Graphics Module */ -struct rdp_graphics -{ - rdpContext* context; /* 0 */ - rdpBitmap* Bitmap_Prototype; /* 1 */ - rdpPointer* Pointer_Prototype; /* 2 */ - rdpGlyph* Glyph_Prototype; /* 3 */ - UINT32 paddingA[16 - 4]; /* 4 */ -}; + struct rdp_graphics + { + rdpContext* context; /* 0 */ + rdpBitmap* Bitmap_Prototype; /* 1 */ + rdpPointer* Pointer_Prototype; /* 2 */ + rdpGlyph* Glyph_Prototype; /* 3 */ + UINT32 paddingA[16 - 4]; /* 4 */ + }; -FREERDP_API void graphics_register_bitmap(rdpGraphics* graphics, - rdpBitmap* bitmap); -FREERDP_API void graphics_register_pointer(rdpGraphics* graphics, - rdpPointer* pointer); -FREERDP_API void graphics_register_glyph(rdpGraphics* graphics, - rdpGlyph* glyph); + FREERDP_API void graphics_register_bitmap(rdpGraphics* graphics, rdpBitmap* bitmap); + FREERDP_API void graphics_register_pointer(rdpGraphics* graphics, rdpPointer* pointer); + FREERDP_API void graphics_register_glyph(rdpGraphics* graphics, rdpGlyph* glyph); -FREERDP_API rdpGraphics* graphics_new(rdpContext* context); -FREERDP_API void graphics_free(rdpGraphics* graphics); + FREERDP_API rdpGraphics* graphics_new(rdpContext* context); + FREERDP_API void graphics_free(rdpGraphics* graphics); #ifdef __cplusplus } diff --git a/include/freerdp/input.h b/include/freerdp/input.h index 95ca1b517..3a05f08bb 100644 --- a/include/freerdp/input.h +++ b/include/freerdp/input.h @@ -30,34 +30,34 @@ typedef struct rdp_input rdpInput; #include /* keyboard Flags */ -#define KBD_FLAGS_EXTENDED 0x0100 -#define KBD_FLAGS_EXTENDED1 0x0200 -#define KBD_FLAGS_DOWN 0x4000 -#define KBD_FLAGS_RELEASE 0x8000 +#define KBD_FLAGS_EXTENDED 0x0100 +#define KBD_FLAGS_EXTENDED1 0x0200 +#define KBD_FLAGS_DOWN 0x4000 +#define KBD_FLAGS_RELEASE 0x8000 /* Pointer Flags */ -#define PTR_FLAGS_HWHEEL 0x0400 -#define PTR_FLAGS_WHEEL 0x0200 -#define PTR_FLAGS_WHEEL_NEGATIVE 0x0100 -#define PTR_FLAGS_MOVE 0x0800 -#define PTR_FLAGS_DOWN 0x8000 -#define PTR_FLAGS_BUTTON1 0x1000 /* left */ -#define PTR_FLAGS_BUTTON2 0x2000 /* right */ -#define PTR_FLAGS_BUTTON3 0x4000 /* middle */ -#define WheelRotationMask 0x01FF +#define PTR_FLAGS_HWHEEL 0x0400 +#define PTR_FLAGS_WHEEL 0x0200 +#define PTR_FLAGS_WHEEL_NEGATIVE 0x0100 +#define PTR_FLAGS_MOVE 0x0800 +#define PTR_FLAGS_DOWN 0x8000 +#define PTR_FLAGS_BUTTON1 0x1000 /* left */ +#define PTR_FLAGS_BUTTON2 0x2000 /* right */ +#define PTR_FLAGS_BUTTON3 0x4000 /* middle */ +#define WheelRotationMask 0x01FF /* Extended Pointer Flags */ -#define PTR_XFLAGS_DOWN 0x8000 -#define PTR_XFLAGS_BUTTON1 0x0001 -#define PTR_XFLAGS_BUTTON2 0x0002 +#define PTR_XFLAGS_DOWN 0x8000 +#define PTR_XFLAGS_BUTTON1 0x0001 +#define PTR_XFLAGS_BUTTON2 0x0002 /* Keyboard Toggle Flags */ -#define KBD_SYNC_SCROLL_LOCK 0x00000001 -#define KBD_SYNC_NUM_LOCK 0x00000002 -#define KBD_SYNC_CAPS_LOCK 0x00000004 -#define KBD_SYNC_KANA_LOCK 0x00000008 +#define KBD_SYNC_SCROLL_LOCK 0x00000001 +#define KBD_SYNC_NUM_LOCK 0x00000002 +#define KBD_SYNC_CAPS_LOCK 0x00000004 +#define KBD_SYNC_KANA_LOCK 0x00000008 -#define RDP_CLIENT_INPUT_PDU_HEADER_LENGTH 4 +#define RDP_CLIENT_INPUT_PDU_HEADER_LENGTH 4 /* defined inside libfreerdp-core */ typedef struct rdp_input_proxy rdpInputProxy; @@ -74,17 +74,17 @@ typedef BOOL (*pKeyboardPauseEvent)(rdpInput* input); struct rdp_input { - rdpContext* context; /* 0 */ - void* param1; /* 1 */ + rdpContext* context; /* 0 */ + void* param1; /* 1 */ UINT32 paddingA[16 - 2]; /* 2 */ - pSynchronizeEvent SynchronizeEvent; /* 16 */ - pKeyboardEvent KeyboardEvent; /* 17 */ + pSynchronizeEvent SynchronizeEvent; /* 16 */ + pKeyboardEvent KeyboardEvent; /* 17 */ pUnicodeKeyboardEvent UnicodeKeyboardEvent; /* 18 */ - pMouseEvent MouseEvent; /* 19 */ - pExtendedMouseEvent ExtendedMouseEvent; /* 20 */ - pFocusInEvent FocusInEvent; /*21 */ - pKeyboardPauseEvent KeyboardPauseEvent; /* 22 */ + pMouseEvent MouseEvent; /* 19 */ + pExtendedMouseEvent ExtendedMouseEvent; /* 20 */ + pFocusInEvent FocusInEvent; /*21 */ + pKeyboardPauseEvent KeyboardPauseEvent; /* 22 */ UINT32 paddingB[32 - 23]; /* 23 */ @@ -96,20 +96,22 @@ struct rdp_input }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API BOOL freerdp_input_send_synchronize_event(rdpInput* input, UINT32 flags); -FREERDP_API BOOL freerdp_input_send_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code); -FREERDP_API BOOL freerdp_input_send_keyboard_event_ex(rdpInput* input, BOOL down, - UINT32 rdp_scancode); -FREERDP_API BOOL freerdp_input_send_keyboard_pause_event(rdpInput* input); -FREERDP_API BOOL freerdp_input_send_unicode_keyboard_event(rdpInput* input, UINT16 flags, - UINT16 code); -FREERDP_API BOOL freerdp_input_send_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y); -FREERDP_API BOOL freerdp_input_send_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, - UINT16 y); -FREERDP_API BOOL freerdp_input_send_focus_in_event(rdpInput* input, UINT16 toggleStates); + FREERDP_API BOOL freerdp_input_send_synchronize_event(rdpInput* input, UINT32 flags); + FREERDP_API BOOL freerdp_input_send_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code); + FREERDP_API BOOL freerdp_input_send_keyboard_event_ex(rdpInput* input, BOOL down, + UINT32 rdp_scancode); + FREERDP_API BOOL freerdp_input_send_keyboard_pause_event(rdpInput* input); + FREERDP_API BOOL freerdp_input_send_unicode_keyboard_event(rdpInput* input, UINT16 flags, + UINT16 code); + FREERDP_API BOOL freerdp_input_send_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, + UINT16 y); + FREERDP_API BOOL freerdp_input_send_extended_mouse_event(rdpInput* input, UINT16 flags, + UINT16 x, UINT16 y); + FREERDP_API BOOL freerdp_input_send_focus_in_event(rdpInput* input, UINT16 toggleStates); #ifdef __cplusplus } diff --git a/include/freerdp/license.h b/include/freerdp/license.h index ca6833510..046e9757d 100644 --- a/include/freerdp/license.h +++ b/include/freerdp/license.h @@ -22,89 +22,90 @@ #include - typedef struct rdp_license rdpLicense; /** @brief Licensing Packet Types */ enum { - LICENSE_REQUEST = 0x01, - PLATFORM_CHALLENGE = 0x02, - NEW_LICENSE = 0x03, - UPGRADE_LICENSE = 0x04, - LICENSE_INFO = 0x12, - NEW_LICENSE_REQUEST = 0x13, - PLATFORM_CHALLENGE_RESPONSE = 0x15, - ERROR_ALERT = 0xFF + LICENSE_REQUEST = 0x01, + PLATFORM_CHALLENGE = 0x02, + NEW_LICENSE = 0x03, + UPGRADE_LICENSE = 0x04, + LICENSE_INFO = 0x12, + NEW_LICENSE_REQUEST = 0x13, + PLATFORM_CHALLENGE_RESPONSE = 0x15, + ERROR_ALERT = 0xFF }; -#define LICENSE_PKT_CS_MASK (LICENSE_INFO | NEW_LICENSE_REQUEST | PLATFORM_CHALLENGE_RESPONSE | ERROR_ALERT) -#define LICENSE_PKT_SC_MASK (LICENSE_REQUEST | PLATFORM_CHALLENGE | NEW_LICENSE | UPGRADE_LICENSE | ERROR_ALERT) -#define LICENSE_PKT_MASK (LICENSE_PKT_CS_MASK | LICENSE_PKT_SC_MASK) +#define LICENSE_PKT_CS_MASK \ + (LICENSE_INFO | NEW_LICENSE_REQUEST | PLATFORM_CHALLENGE_RESPONSE | ERROR_ALERT) +#define LICENSE_PKT_SC_MASK \ + (LICENSE_REQUEST | PLATFORM_CHALLENGE | NEW_LICENSE | UPGRADE_LICENSE | ERROR_ALERT) +#define LICENSE_PKT_MASK (LICENSE_PKT_CS_MASK | LICENSE_PKT_SC_MASK) -#define LICENSE_PREAMBLE_LENGTH 4 +#define LICENSE_PREAMBLE_LENGTH 4 /* Cryptographic Lengths */ -#define CLIENT_RANDOM_LENGTH 32 -#define SERVER_RANDOM_LENGTH 32 -#define MASTER_SECRET_LENGTH 48 -#define PREMASTER_SECRET_LENGTH 48 -#define SESSION_KEY_BLOB_LENGTH 48 -#define MAC_SALT_KEY_LENGTH 16 -#define LICENSING_ENCRYPTION_KEY_LENGTH 16 -#define HWID_PLATFORM_ID_LENGTH 4 -#define HWID_UNIQUE_DATA_LENGTH 16 -#define HWID_LENGTH 20 -#define LICENSING_PADDING_SIZE 8 +#define CLIENT_RANDOM_LENGTH 32 +#define SERVER_RANDOM_LENGTH 32 +#define MASTER_SECRET_LENGTH 48 +#define PREMASTER_SECRET_LENGTH 48 +#define SESSION_KEY_BLOB_LENGTH 48 +#define MAC_SALT_KEY_LENGTH 16 +#define LICENSING_ENCRYPTION_KEY_LENGTH 16 +#define HWID_PLATFORM_ID_LENGTH 4 +#define HWID_UNIQUE_DATA_LENGTH 16 +#define HWID_LENGTH 20 +#define LICENSING_PADDING_SIZE 8 /* Preamble Flags */ -#define PREAMBLE_VERSION_2_0 0x02 -#define PREAMBLE_VERSION_3_0 0x03 -#define LicenseProtocolVersionMask 0x0F -#define EXTENDED_ERROR_MSG_SUPPORTED 0x80 +#define PREAMBLE_VERSION_2_0 0x02 +#define PREAMBLE_VERSION_3_0 0x03 +#define LicenseProtocolVersionMask 0x0F +#define EXTENDED_ERROR_MSG_SUPPORTED 0x80 /** @brief binary Blob Types */ enum { - BB_ANY_BLOB = 0x0000, - BB_DATA_BLOB = 0x0001, - BB_RANDOM_BLOB = 0x0002, - BB_CERTIFICATE_BLOB = 0x0003, - BB_ERROR_BLOB = 0x0004, - BB_ENCRYPTED_DATA_BLOB = 0x0009, - BB_KEY_EXCHG_ALG_BLOB = 0x000D, - BB_SCOPE_BLOB = 0x000E, - BB_CLIENT_USER_NAME_BLOB = 0x000F, - BB_CLIENT_MACHINE_NAME_BLOB = 0x0010 + BB_ANY_BLOB = 0x0000, + BB_DATA_BLOB = 0x0001, + BB_RANDOM_BLOB = 0x0002, + BB_CERTIFICATE_BLOB = 0x0003, + BB_ERROR_BLOB = 0x0004, + BB_ENCRYPTED_DATA_BLOB = 0x0009, + BB_KEY_EXCHG_ALG_BLOB = 0x000D, + BB_SCOPE_BLOB = 0x000E, + BB_CLIENT_USER_NAME_BLOB = 0x000F, + BB_CLIENT_MACHINE_NAME_BLOB = 0x0010 }; /* License Key Exchange Algorithms */ -#define KEY_EXCHANGE_ALG_RSA 0x00000001 +#define KEY_EXCHANGE_ALG_RSA 0x00000001 /** @brief license Error Codes */ enum { - ERR_INVALID_SERVER_CERTIFICATE = 0x00000001, - ERR_NO_LICENSE = 0x00000002, - ERR_INVALID_MAC = 0x00000003, - ERR_INVALID_SCOPE = 0x00000004, - ERR_NO_LICENSE_SERVER = 0x00000006, - STATUS_VALID_CLIENT = 0x00000007, - ERR_INVALID_CLIENT = 0x00000008, - ERR_INVALID_PRODUCT_ID = 0x0000000B, - ERR_INVALID_MESSAGE_LENGTH = 0x0000000C + ERR_INVALID_SERVER_CERTIFICATE = 0x00000001, + ERR_NO_LICENSE = 0x00000002, + ERR_INVALID_MAC = 0x00000003, + ERR_INVALID_SCOPE = 0x00000004, + ERR_NO_LICENSE_SERVER = 0x00000006, + STATUS_VALID_CLIENT = 0x00000007, + ERR_INVALID_CLIENT = 0x00000008, + ERR_INVALID_PRODUCT_ID = 0x0000000B, + ERR_INVALID_MESSAGE_LENGTH = 0x0000000C }; /** @brief state Transition Codes */ enum { - ST_TOTAL_ABORT = 0x00000001, - ST_NO_TRANSITION = 0x00000002, - ST_RESET_PHASE_TO_START = 0x00000003, - ST_RESEND_LAST_MESSAGE = 0x00000004 + ST_TOTAL_ABORT = 0x00000001, + ST_NO_TRANSITION = 0x00000002, + ST_RESET_PHASE_TO_START = 0x00000003, + ST_RESEND_LAST_MESSAGE = 0x00000004 }; /** @brief Platform Challenge Types */ @@ -119,17 +120,18 @@ enum /** @brief License Detail Levels */ enum { - LICENSE_DETAIL_SIMPLE = 0x0001, - LICENSE_DETAIL_MODERATE = 0x0002, - LICENSE_DETAIL_DETAIL = 0x0003 + LICENSE_DETAIL_SIMPLE = 0x0001, + LICENSE_DETAIL_MODERATE = 0x0002, + LICENSE_DETAIL_DETAIL = 0x0003 }; /* * PlatformId: * - * The most significant byte of the PlatformId field contains the operating system version of the client. - * The second most significant byte of the PlatformId field identifies the ISV that provided the client image. - * The remaining two bytes in the PlatformId field are used by the ISV to identify the build number of the operating system. + * The most significant byte of the PlatformId field contains the operating system version of the + * client. The second most significant byte of the PlatformId field identifies the ISV that provided + * the client image. The remaining two bytes in the PlatformId field are used by the ISV to identify + * the build number of the operating system. * * 0x04010000: * @@ -138,20 +140,21 @@ enum */ enum { - CLIENT_OS_ID_WINNT_351 = 0x01000000, - CLIENT_OS_ID_WINNT_40 = 0x02000000, - CLIENT_OS_ID_WINNT_50 = 0x03000000, - CLIENT_OS_ID_WINNT_POST_52 = 0x04000000, + CLIENT_OS_ID_WINNT_351 = 0x01000000, + CLIENT_OS_ID_WINNT_40 = 0x02000000, + CLIENT_OS_ID_WINNT_50 = 0x03000000, + CLIENT_OS_ID_WINNT_POST_52 = 0x04000000, - CLIENT_IMAGE_ID_MICROSOFT = 0x00010000, - CLIENT_IMAGE_ID_CITRIX = 0x00020000, + CLIENT_IMAGE_ID_MICROSOFT = 0x00010000, + CLIENT_IMAGE_ID_CITRIX = 0x00020000, }; #ifdef __cpluscplus -extern "C" { +extern "C" +{ #endif -FREERDP_API BOOL license_send_valid_client_error_packet(rdpRdp* rdp); + FREERDP_API BOOL license_send_valid_client_error_packet(rdpRdp* rdp); #ifdef __cpluscplus } diff --git a/include/freerdp/listener.h b/include/freerdp/listener.h index 95a03797f..755ac46ea 100644 --- a/include/freerdp/listener.h +++ b/include/freerdp/listener.h @@ -28,40 +28,44 @@ typedef struct rdp_freerdp_listener freerdp_listener; #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef BOOL (*psListenerOpen)(freerdp_listener* instance, const char* bind_address, UINT16 port); -typedef BOOL (*psListenerOpenLocal)(freerdp_listener* instance, const char* path); -typedef BOOL (*psListenerOpenFromSocket)(freerdp_listener* instance, int fd); -typedef BOOL (*psListenerGetFileDescriptor)(freerdp_listener* instance, void** rfds, int* rcount); -typedef DWORD (*psListenerGetEventHandles)(freerdp_listener* instance, HANDLE* events, DWORD nCount); -typedef BOOL (*psListenerCheckFileDescriptor)(freerdp_listener* instance); -typedef void (*psListenerClose)(freerdp_listener* instance); -typedef BOOL (*psPeerAccepted)(freerdp_listener* instance, freerdp_peer* client); + typedef BOOL (*psListenerOpen)(freerdp_listener* instance, const char* bind_address, + UINT16 port); + typedef BOOL (*psListenerOpenLocal)(freerdp_listener* instance, const char* path); + typedef BOOL (*psListenerOpenFromSocket)(freerdp_listener* instance, int fd); + typedef BOOL (*psListenerGetFileDescriptor)(freerdp_listener* instance, void** rfds, + int* rcount); + typedef DWORD (*psListenerGetEventHandles)(freerdp_listener* instance, HANDLE* events, + DWORD nCount); + typedef BOOL (*psListenerCheckFileDescriptor)(freerdp_listener* instance); + typedef void (*psListenerClose)(freerdp_listener* instance); + typedef BOOL (*psPeerAccepted)(freerdp_listener* instance, freerdp_peer* client); -struct rdp_freerdp_listener -{ - void* info; - void* listener; - void* param1; - void* param2; - void* param3; - void* param4; + struct rdp_freerdp_listener + { + void* info; + void* listener; + void* param1; + void* param2; + void* param3; + void* param4; - psListenerOpen Open; - psListenerOpenLocal OpenLocal; - psListenerGetFileDescriptor GetFileDescriptor; - psListenerGetEventHandles GetEventHandles; - psListenerCheckFileDescriptor CheckFileDescriptor; - psListenerClose Close; + psListenerOpen Open; + psListenerOpenLocal OpenLocal; + psListenerGetFileDescriptor GetFileDescriptor; + psListenerGetEventHandles GetEventHandles; + psListenerCheckFileDescriptor CheckFileDescriptor; + psListenerClose Close; - psPeerAccepted PeerAccepted; - psListenerOpenFromSocket OpenFromSocket; -}; + psPeerAccepted PeerAccepted; + psListenerOpenFromSocket OpenFromSocket; + }; -FREERDP_API freerdp_listener* freerdp_listener_new(void); -FREERDP_API void freerdp_listener_free(freerdp_listener* instance); + FREERDP_API freerdp_listener* freerdp_listener_new(void); + FREERDP_API void freerdp_listener_free(freerdp_listener* instance); #ifdef __cplusplus } diff --git a/include/freerdp/locale/keyboard.h b/include/freerdp/locale/keyboard.h index 661020558..3b1437777 100644 --- a/include/freerdp/locale/keyboard.h +++ b/include/freerdp/locale/keyboard.h @@ -26,9 +26,9 @@ #include #include -#define RDP_KEYBOARD_LAYOUT_TYPE_STANDARD 1 -#define RDP_KEYBOARD_LAYOUT_TYPE_VARIANT 2 -#define RDP_KEYBOARD_LAYOUT_TYPE_IME 4 +#define RDP_KEYBOARD_LAYOUT_TYPE_STANDARD 1 +#define RDP_KEYBOARD_LAYOUT_TYPE_VARIANT 2 +#define RDP_KEYBOARD_LAYOUT_TYPE_IME 4 struct _RDP_KEYBOARD_LAYOUT { @@ -39,179 +39,181 @@ typedef struct _RDP_KEYBOARD_LAYOUT RDP_KEYBOARD_LAYOUT; /* Keyboard layout IDs */ -#define KBD_ARABIC_101 0x00000401 -#define KBD_BULGARIAN 0x00000402 -#define KBD_CHINESE_TRADITIONAL_US 0x00000404 -#define KBD_CZECH 0x00000405 -#define KBD_DANISH 0x00000406 -#define KBD_GERMAN 0x00000407 -#define KBD_GREEK 0x00000408 -#define KBD_US 0x00000409 -#define KBD_SPANISH 0x0000040A -#define KBD_FINNISH 0x0000040B -#define KBD_FRENCH 0x0000040C -#define KBD_HEBREW 0x0000040D -#define KBD_HUNGARIAN 0x0000040E -#define KBD_ICELANDIC 0x0000040F -#define KBD_ITALIAN 0x00000410 -#define KBD_JAPANESE 0x00000411 -#define KBD_KOREAN 0x00000412 -#define KBD_DUTCH 0x00000413 -#define KBD_NORWEGIAN 0x00000414 -#define KBD_POLISH_PROGRAMMERS 0x00000415 -#define KBD_PORTUGUESE_BRAZILIAN_ABNT 0x00000416 -#define KBD_ROMANIAN 0x00000418 -#define KBD_RUSSIAN 0x00000419 -#define KBD_CROATIAN 0x0000041A -#define KBD_SLOVAK 0x0000041B -#define KBD_ALBANIAN 0x0000041C -#define KBD_SWEDISH 0x0000041D -#define KBD_THAI_KEDMANEE 0x0000041E -#define KBD_TURKISH_Q 0x0000041F -#define KBD_URDU 0x00000420 -#define KBD_UKRAINIAN 0x00000422 -#define KBD_BELARUSIAN 0x00000423 -#define KBD_SLOVENIAN 0x00000424 -#define KBD_ESTONIAN 0x00000425 -#define KBD_LATVIAN 0x00000426 -#define KBD_LITHUANIAN_IBM 0x00000427 -#define KBD_FARSI 0x00000429 -#define KBD_VIETNAMESE 0x0000042A -#define KBD_ARMENIAN_EASTERN 0x0000042B -#define KBD_AZERI_LATIN 0x0000042C -#define KBD_FYRO_MACEDONIAN 0x0000042F -#define KBD_GEORGIAN 0x00000437 -#define KBD_FAEROESE 0x00000438 -#define KBD_DEVANAGARI_INSCRIPT 0x00000439 -#define KBD_MALTESE_47_KEY 0x0000043A -#define KBD_NORWEGIAN_WITH_SAMI 0x0000043B -#define KBD_KAZAKH 0x0000043F -#define KBD_KYRGYZ_CYRILLIC 0x00000440 -#define KBD_TATAR 0x00000444 -#define KBD_BENGALI 0x00000445 -#define KBD_PUNJABI 0x00000446 -#define KBD_GUJARATI 0x00000447 -#define KBD_TAMIL 0x00000449 -#define KBD_TELUGU 0x0000044A -#define KBD_KANNADA 0x0000044B -#define KBD_MALAYALAM 0x0000044C -#define KBD_MARATHI 0x0000044E -#define KBD_MONGOLIAN_CYRILLIC 0x00000450 -#define KBD_UNITED_KINGDOM_EXTENDED 0x00000452 -#define KBD_SYRIAC 0x0000045A -#define KBD_NEPALI 0x00000461 -#define KBD_PASHTO 0x00000463 -#define KBD_DIVEHI_PHONETIC 0x00000465 -#define KBD_LUXEMBOURGISH 0x0000046E -#define KBD_MAORI 0x00000481 -#define KBD_CHINESE_SIMPLIFIED_US 0x00000804 -#define KBD_SWISS_GERMAN 0x00000807 -#define KBD_UNITED_KINGDOM 0x00000809 -#define KBD_LATIN_AMERICAN 0x0000080A -#define KBD_BELGIAN_FRENCH 0x0000080C -#define KBD_BELGIAN_PERIOD 0x00000813 -#define KBD_PORTUGUESE 0x00000816 -#define KBD_SERBIAN_LATIN 0x0000081A -#define KBD_AZERI_CYRILLIC 0x0000082C -#define KBD_SWEDISH_WITH_SAMI 0x0000083B -#define KBD_UZBEK_CYRILLIC 0x00000843 -#define KBD_INUKTITUT_LATIN 0x0000085D -#define KBD_CANADIAN_FRENCH_LEGACY 0x00000C0C -#define KBD_SERBIAN_CYRILLIC 0x00000C1A -#define KBD_CANADIAN_FRENCH 0x00001009 -#define KBD_SWISS_FRENCH 0x0000100C -#define KBD_BOSNIAN 0x0000141A -#define KBD_IRISH 0x00001809 -#define KBD_BOSNIAN_CYRILLIC 0x0000201A +#define KBD_ARABIC_101 0x00000401 +#define KBD_BULGARIAN 0x00000402 +#define KBD_CHINESE_TRADITIONAL_US 0x00000404 +#define KBD_CZECH 0x00000405 +#define KBD_DANISH 0x00000406 +#define KBD_GERMAN 0x00000407 +#define KBD_GREEK 0x00000408 +#define KBD_US 0x00000409 +#define KBD_SPANISH 0x0000040A +#define KBD_FINNISH 0x0000040B +#define KBD_FRENCH 0x0000040C +#define KBD_HEBREW 0x0000040D +#define KBD_HUNGARIAN 0x0000040E +#define KBD_ICELANDIC 0x0000040F +#define KBD_ITALIAN 0x00000410 +#define KBD_JAPANESE 0x00000411 +#define KBD_KOREAN 0x00000412 +#define KBD_DUTCH 0x00000413 +#define KBD_NORWEGIAN 0x00000414 +#define KBD_POLISH_PROGRAMMERS 0x00000415 +#define KBD_PORTUGUESE_BRAZILIAN_ABNT 0x00000416 +#define KBD_ROMANIAN 0x00000418 +#define KBD_RUSSIAN 0x00000419 +#define KBD_CROATIAN 0x0000041A +#define KBD_SLOVAK 0x0000041B +#define KBD_ALBANIAN 0x0000041C +#define KBD_SWEDISH 0x0000041D +#define KBD_THAI_KEDMANEE 0x0000041E +#define KBD_TURKISH_Q 0x0000041F +#define KBD_URDU 0x00000420 +#define KBD_UKRAINIAN 0x00000422 +#define KBD_BELARUSIAN 0x00000423 +#define KBD_SLOVENIAN 0x00000424 +#define KBD_ESTONIAN 0x00000425 +#define KBD_LATVIAN 0x00000426 +#define KBD_LITHUANIAN_IBM 0x00000427 +#define KBD_FARSI 0x00000429 +#define KBD_VIETNAMESE 0x0000042A +#define KBD_ARMENIAN_EASTERN 0x0000042B +#define KBD_AZERI_LATIN 0x0000042C +#define KBD_FYRO_MACEDONIAN 0x0000042F +#define KBD_GEORGIAN 0x00000437 +#define KBD_FAEROESE 0x00000438 +#define KBD_DEVANAGARI_INSCRIPT 0x00000439 +#define KBD_MALTESE_47_KEY 0x0000043A +#define KBD_NORWEGIAN_WITH_SAMI 0x0000043B +#define KBD_KAZAKH 0x0000043F +#define KBD_KYRGYZ_CYRILLIC 0x00000440 +#define KBD_TATAR 0x00000444 +#define KBD_BENGALI 0x00000445 +#define KBD_PUNJABI 0x00000446 +#define KBD_GUJARATI 0x00000447 +#define KBD_TAMIL 0x00000449 +#define KBD_TELUGU 0x0000044A +#define KBD_KANNADA 0x0000044B +#define KBD_MALAYALAM 0x0000044C +#define KBD_MARATHI 0x0000044E +#define KBD_MONGOLIAN_CYRILLIC 0x00000450 +#define KBD_UNITED_KINGDOM_EXTENDED 0x00000452 +#define KBD_SYRIAC 0x0000045A +#define KBD_NEPALI 0x00000461 +#define KBD_PASHTO 0x00000463 +#define KBD_DIVEHI_PHONETIC 0x00000465 +#define KBD_LUXEMBOURGISH 0x0000046E +#define KBD_MAORI 0x00000481 +#define KBD_CHINESE_SIMPLIFIED_US 0x00000804 +#define KBD_SWISS_GERMAN 0x00000807 +#define KBD_UNITED_KINGDOM 0x00000809 +#define KBD_LATIN_AMERICAN 0x0000080A +#define KBD_BELGIAN_FRENCH 0x0000080C +#define KBD_BELGIAN_PERIOD 0x00000813 +#define KBD_PORTUGUESE 0x00000816 +#define KBD_SERBIAN_LATIN 0x0000081A +#define KBD_AZERI_CYRILLIC 0x0000082C +#define KBD_SWEDISH_WITH_SAMI 0x0000083B +#define KBD_UZBEK_CYRILLIC 0x00000843 +#define KBD_INUKTITUT_LATIN 0x0000085D +#define KBD_CANADIAN_FRENCH_LEGACY 0x00000C0C +#define KBD_SERBIAN_CYRILLIC 0x00000C1A +#define KBD_CANADIAN_FRENCH 0x00001009 +#define KBD_SWISS_FRENCH 0x0000100C +#define KBD_BOSNIAN 0x0000141A +#define KBD_IRISH 0x00001809 +#define KBD_BOSNIAN_CYRILLIC 0x0000201A /* Keyboard layout variant IDs */ -#define KBD_ARABIC_102 0x00010401 -#define KBD_BULGARIAN_LATIN 0x00010402 -#define KBD_CZECH_QWERTY 0x00010405 -#define KBD_GERMAN_IBM 0x00010407 -#define KBD_GREEK_220 0x00010408 -#define KBD_UNITED_STATES_DVORAK 0x00010409 -#define KBD_SPANISH_VARIATION 0x0001040A -#define KBD_HUNGARIAN_101_KEY 0x0001040E -#define KBD_ITALIAN_142 0x00010410 -#define KBD_POLISH_214 0x00010415 -#define KBD_PORTUGUESE_BRAZILIAN_ABNT2 0x00010416 -#define KBD_RUSSIAN_TYPEWRITER 0x00010419 -#define KBD_SLOVAK_QWERTY 0x0001041B -#define KBD_THAI_PATTACHOTE 0x0001041E -#define KBD_TURKISH_F 0x0001041F -#define KBD_LATVIAN_QWERTY 0x00010426 -#define KBD_LITHUANIAN 0x00010427 -#define KBD_ARMENIAN_WESTERN 0x0001042B -#define KBD_HINDI_TRADITIONAL 0x00010439 -#define KBD_MALTESE_48_KEY 0x0001043A -#define KBD_SAMI_EXTENDED_NORWAY 0x0001043B -#define KBD_BENGALI_INSCRIPT 0x00010445 -#define KBD_SYRIAC_PHONETIC 0x0001045A -#define KBD_DIVEHI_TYPEWRITER 0x00010465 -#define KBD_BELGIAN_COMMA 0x0001080C -#define KBD_FINNISH_WITH_SAMI 0x0001083B -#define KBD_CANADIAN_MULTILINGUAL_STANDARD 0x00011009 -#define KBD_GAELIC 0x00011809 -#define KBD_ARABIC_102_AZERTY 0x00020401 -#define KBD_CZECH_PROGRAMMERS 0x00020405 -#define KBD_GREEK_319 0x00020408 -#define KBD_UNITED_STATES_INTERNATIONAL 0x00020409 -#define KBD_THAI_KEDMANEE_NON_SHIFTLOCK 0x0002041E -#define KBD_SAMI_EXTENDED_FINLAND_SWEDEN 0x0002083B -#define KBD_GREEK_220_LATIN 0x00030408 -#define KBD_UNITED_STATES_DVORAK_FOR_LEFT_HAND 0x00030409 -#define KBD_THAI_PATTACHOTE_NON_SHIFTLOCK 0x0003041E -#define KBD_GREEK_319_LATIN 0x00040408 -#define KBD_UNITED_STATES_DVORAK_FOR_RIGHT_HAND 0x00040409 -#define KBD_UNITED_STATES_DVORAK_PROGRAMMER 0x19360409 -#define KBD_GREEK_LATIN 0x00050408 -#define KBD_US_ENGLISH_TABLE_FOR_IBM_ARABIC_238_L 0x00050409 -#define KBD_GREEK_POLYTONIC 0x00060408 -#define KBD_FRENCH_BEPO 0xa000040c -#define KBD_GERMAN_NEO 0xB0000407 +#define KBD_ARABIC_102 0x00010401 +#define KBD_BULGARIAN_LATIN 0x00010402 +#define KBD_CZECH_QWERTY 0x00010405 +#define KBD_GERMAN_IBM 0x00010407 +#define KBD_GREEK_220 0x00010408 +#define KBD_UNITED_STATES_DVORAK 0x00010409 +#define KBD_SPANISH_VARIATION 0x0001040A +#define KBD_HUNGARIAN_101_KEY 0x0001040E +#define KBD_ITALIAN_142 0x00010410 +#define KBD_POLISH_214 0x00010415 +#define KBD_PORTUGUESE_BRAZILIAN_ABNT2 0x00010416 +#define KBD_RUSSIAN_TYPEWRITER 0x00010419 +#define KBD_SLOVAK_QWERTY 0x0001041B +#define KBD_THAI_PATTACHOTE 0x0001041E +#define KBD_TURKISH_F 0x0001041F +#define KBD_LATVIAN_QWERTY 0x00010426 +#define KBD_LITHUANIAN 0x00010427 +#define KBD_ARMENIAN_WESTERN 0x0001042B +#define KBD_HINDI_TRADITIONAL 0x00010439 +#define KBD_MALTESE_48_KEY 0x0001043A +#define KBD_SAMI_EXTENDED_NORWAY 0x0001043B +#define KBD_BENGALI_INSCRIPT 0x00010445 +#define KBD_SYRIAC_PHONETIC 0x0001045A +#define KBD_DIVEHI_TYPEWRITER 0x00010465 +#define KBD_BELGIAN_COMMA 0x0001080C +#define KBD_FINNISH_WITH_SAMI 0x0001083B +#define KBD_CANADIAN_MULTILINGUAL_STANDARD 0x00011009 +#define KBD_GAELIC 0x00011809 +#define KBD_ARABIC_102_AZERTY 0x00020401 +#define KBD_CZECH_PROGRAMMERS 0x00020405 +#define KBD_GREEK_319 0x00020408 +#define KBD_UNITED_STATES_INTERNATIONAL 0x00020409 +#define KBD_THAI_KEDMANEE_NON_SHIFTLOCK 0x0002041E +#define KBD_SAMI_EXTENDED_FINLAND_SWEDEN 0x0002083B +#define KBD_GREEK_220_LATIN 0x00030408 +#define KBD_UNITED_STATES_DVORAK_FOR_LEFT_HAND 0x00030409 +#define KBD_THAI_PATTACHOTE_NON_SHIFTLOCK 0x0003041E +#define KBD_GREEK_319_LATIN 0x00040408 +#define KBD_UNITED_STATES_DVORAK_FOR_RIGHT_HAND 0x00040409 +#define KBD_UNITED_STATES_DVORAK_PROGRAMMER 0x19360409 +#define KBD_GREEK_LATIN 0x00050408 +#define KBD_US_ENGLISH_TABLE_FOR_IBM_ARABIC_238_L 0x00050409 +#define KBD_GREEK_POLYTONIC 0x00060408 +#define KBD_FRENCH_BEPO 0xa000040c +#define KBD_GERMAN_NEO 0xB0000407 /* Global Input Method Editor (IME) IDs */ -#define KBD_CHINESE_TRADITIONAL_PHONETIC 0xE0010404 -#define KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 0xE0010411 -#define KBD_KOREAN_INPUT_SYSTEM_IME_2000 0xE0010412 -#define KBD_CHINESE_SIMPLIFIED_QUANPIN 0xE0010804 -#define KBD_CHINESE_TRADITIONAL_CHANGJIE 0xE0020404 -#define KBD_CHINESE_SIMPLIFIED_SHUANGPIN 0xE0020804 -#define KBD_CHINESE_TRADITIONAL_QUICK 0xE0030404 -#define KBD_CHINESE_SIMPLIFIED_ZHENGMA 0xE0030804 -#define KBD_CHINESE_TRADITIONAL_BIG5_CODE 0xE0040404 -#define KBD_CHINESE_TRADITIONAL_ARRAY 0xE0050404 -#define KBD_CHINESE_SIMPLIFIED_NEIMA 0xE0050804 -#define KBD_CHINESE_TRADITIONAL_DAYI 0xE0060404 -#define KBD_CHINESE_TRADITIONAL_UNICODE 0xE0070404 -#define KBD_CHINESE_TRADITIONAL_NEW_PHONETIC 0xE0080404 -#define KBD_CHINESE_TRADITIONAL_NEW_CHANGJIE 0xE0090404 -#define KBD_CHINESE_TRADITIONAL_MICROSOFT_PINYIN_IME_3 0xE00E0804 -#define KBD_CHINESE_TRADITIONAL_ALPHANUMERIC 0xE00F0404 +#define KBD_CHINESE_TRADITIONAL_PHONETIC 0xE0010404 +#define KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 0xE0010411 +#define KBD_KOREAN_INPUT_SYSTEM_IME_2000 0xE0010412 +#define KBD_CHINESE_SIMPLIFIED_QUANPIN 0xE0010804 +#define KBD_CHINESE_TRADITIONAL_CHANGJIE 0xE0020404 +#define KBD_CHINESE_SIMPLIFIED_SHUANGPIN 0xE0020804 +#define KBD_CHINESE_TRADITIONAL_QUICK 0xE0030404 +#define KBD_CHINESE_SIMPLIFIED_ZHENGMA 0xE0030804 +#define KBD_CHINESE_TRADITIONAL_BIG5_CODE 0xE0040404 +#define KBD_CHINESE_TRADITIONAL_ARRAY 0xE0050404 +#define KBD_CHINESE_SIMPLIFIED_NEIMA 0xE0050804 +#define KBD_CHINESE_TRADITIONAL_DAYI 0xE0060404 +#define KBD_CHINESE_TRADITIONAL_UNICODE 0xE0070404 +#define KBD_CHINESE_TRADITIONAL_NEW_PHONETIC 0xE0080404 +#define KBD_CHINESE_TRADITIONAL_NEW_CHANGJIE 0xE0090404 +#define KBD_CHINESE_TRADITIONAL_MICROSOFT_PINYIN_IME_3 0xE00E0804 +#define KBD_CHINESE_TRADITIONAL_ALPHANUMERIC 0xE00F0404 /* Keyboard Types */ -#define KBD_TYPE_IBM_PC_XT 0x00000001 /* IBM PC/XT or compatible (83-key) keyboard */ -#define KBD_TYPE_OLIVETTI_ICO 0x00000002 /* Olivetti "ICO" (102-key) keyboard */ -#define KBD_TYPE_IBM_PC_AT 0x00000003 /* IBM PC/AT (84-key) and similar keyboards */ -#define KBD_TYPE_IBM_ENHANCED 0x00000004 /* IBM enhanced (101-key or 102-key) keyboard */ -#define KBD_TYPE_NOKIA_1050 0x00000005 /* Nokia 1050 and similar keyboards */ -#define KBD_TYPE_NOKIA_9140 0x00000006 /* Nokia 9140 and similar keyboards */ -#define KBD_TYPE_JAPANESE 0x00000007 /* Japanese keyboard */ +#define KBD_TYPE_IBM_PC_XT 0x00000001 /* IBM PC/XT or compatible (83-key) keyboard */ +#define KBD_TYPE_OLIVETTI_ICO 0x00000002 /* Olivetti "ICO" (102-key) keyboard */ +#define KBD_TYPE_IBM_PC_AT 0x00000003 /* IBM PC/AT (84-key) and similar keyboards */ +#define KBD_TYPE_IBM_ENHANCED 0x00000004 /* IBM enhanced (101-key or 102-key) keyboard */ +#define KBD_TYPE_NOKIA_1050 0x00000005 /* Nokia 1050 and similar keyboards */ +#define KBD_TYPE_NOKIA_9140 0x00000006 /* Nokia 9140 and similar keyboards */ +#define KBD_TYPE_JAPANESE 0x00000007 /* Japanese keyboard */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API DWORD freerdp_keyboard_init(DWORD keyboardLayoutId); -FREERDP_API RDP_KEYBOARD_LAYOUT* freerdp_keyboard_get_layouts(DWORD types); -FREERDP_API void freerdp_keyboard_layouts_free(RDP_KEYBOARD_LAYOUT* layouts); -FREERDP_API const char* freerdp_keyboard_get_layout_name_from_id(DWORD keyboardLayoutId); -FREERDP_API DWORD freerdp_keyboard_get_layout_id_from_name(const char* name); -FREERDP_API DWORD freerdp_keyboard_get_rdp_scancode_from_x11_keycode(DWORD keycode); -FREERDP_API DWORD freerdp_keyboard_get_x11_keycode_from_rdp_scancode(DWORD scancode, BOOL extended); + FREERDP_API DWORD freerdp_keyboard_init(DWORD keyboardLayoutId); + FREERDP_API RDP_KEYBOARD_LAYOUT* freerdp_keyboard_get_layouts(DWORD types); + FREERDP_API void freerdp_keyboard_layouts_free(RDP_KEYBOARD_LAYOUT* layouts); + FREERDP_API const char* freerdp_keyboard_get_layout_name_from_id(DWORD keyboardLayoutId); + FREERDP_API DWORD freerdp_keyboard_get_layout_id_from_name(const char* name); + FREERDP_API DWORD freerdp_keyboard_get_rdp_scancode_from_x11_keycode(DWORD keycode); + FREERDP_API DWORD freerdp_keyboard_get_x11_keycode_from_rdp_scancode(DWORD scancode, + BOOL extended); #ifdef __cplusplus } diff --git a/include/freerdp/locale/locale.h b/include/freerdp/locale/locale.h index d2b767b0a..54ab2c660 100644 --- a/include/freerdp/locale/locale.h +++ b/include/freerdp/locale/locale.h @@ -30,216 +30,217 @@ #include #include -#define AFRIKAANS 0x0436 -#define ALBANIAN 0x041C -#define ALSATIAN 0x0484 -#define AMHARIC 0x045E -#define ARABIC_SAUDI_ARABIA 0x0401 -#define ARABIC_IRAQ 0x0801 -#define ARABIC_EGYPT 0x0C01 -#define ARABIC_LIBYA 0x1001 -#define ARABIC_ALGERIA 0x1401 -#define ARABIC_MOROCCO 0x1801 -#define ARABIC_TUNISIA 0x1C01 -#define ARABIC_OMAN 0x2001 -#define ARABIC_YEMEN 0x2401 -#define ARABIC_SYRIA 0x2801 -#define ARABIC_JORDAN 0x2C01 -#define ARABIC_LEBANON 0x3001 -#define ARABIC_KUWAIT 0x3401 -#define ARABIC_UAE 0x3801 -#define ARABIC_BAHRAIN 0x3C01 -#define ARABIC_QATAR 0x4001 -#define ARMENIAN 0x042B -#define ASSAMESE 0x044D -#define AZERI_LATIN 0x042C -#define AZERI_CYRILLIC 0x082C -#define BASHKIR 0x046D -#define BASQUE 0x042D -#define BELARUSIAN 0x0423 -#define BENGALI_INDIA 0x0445 -#define BOSNIAN_LATIN 0x141A -#define BRETON 0x047E -#define BULGARIAN 0x0402 -#define CATALAN 0x0403 -#define CHINESE_TAIWAN 0x0404 -#define CHINESE_PRC 0x0804 -#define CHINESE_HONG_KONG 0x0C04 -#define CHINESE_SINGAPORE 0x1004 -#define CHINESE_MACAU 0x1404 -#define CROATIAN 0x041A -#define CROATIAN_BOSNIA_HERZEGOVINA 0x101A -#define CZECH 0x0405 -#define DANISH 0x0406 -#define DARI 0x048C -#define DIVEHI 0x0465 -#define DUTCH_STANDARD 0x0413 -#define DUTCH_BELGIAN 0x0813 -#define ENGLISH_UNITED_STATES 0x0409 -#define ENGLISH_UNITED_KINGDOM 0x0809 -#define ENGLISH_AUSTRALIAN 0x0C09 -#define ENGLISH_CANADIAN 0x1009 -#define ENGLISH_NEW_ZEALAND 0x1409 -#define ENGLISH_INDIA 0x4009 -#define ENGLISH_IRELAND 0x1809 -#define ENGLISH_MALAYSIA 0x4409 -#define ENGLISH_SOUTH_AFRICA 0x1C09 -#define ENGLISH_JAMAICA 0x2009 -#define ENGLISH_CARIBBEAN 0x2409 -#define ENGLISH_BELIZE 0x2809 -#define ENGLISH_TRINIDAD 0x2C09 -#define ENGLISH_ZIMBABWE 0x3009 -#define ENGLISH_PHILIPPINES 0x3409 -#define ENGLISH_SINGAPORE 0x4809 -#define ESTONIAN 0x0425 -#define FAEROESE 0x0438 -#define FARSI 0x0429 -#define FILIPINO 0x0464 -#define FINNISH 0x040B -#define FRENCH_STANDARD 0x040C -#define FRENCH_BELGIAN 0x080C -#define FRENCH_CANADIAN 0x0C0C -#define FRENCH_SWISS 0x100C -#define FRENCH_LUXEMBOURG 0x140C -#define FRENCH_MONACO 0x180C -#define FRISIAN 0x0462 -#define GEORGIAN 0x0437 -#define GALICIAN 0x0456 -#define GERMAN_STANDARD 0x0407 -#define GERMAN_SWISS 0x0807 -#define GERMAN_AUSTRIAN 0x0C07 -#define GERMAN_LUXEMBOURG 0x1007 -#define GERMAN_LIECHTENSTEIN 0x1407 -#define GREEK 0x0408 -#define GREENLANDIC 0x046F -#define GUJARATI 0x0447 -#define HEBREW 0x040D -#define HINDI 0x0439 -#define HUNGARIAN 0x040E -#define ICELANDIC 0x040F -#define IGBO 0x0470 -#define INDONESIAN 0x0421 -#define IRISH 0x083C -#define ITALIAN_STANDARD 0x0410 -#define ITALIAN_SWISS 0x0810 -#define JAPANESE 0x0411 -#define KANNADA 0x044B -#define KAZAKH 0x043F -#define KHMER 0x0453 -#define KICHE 0x0486 -#define KINYARWANDA 0x0487 -#define KONKANI 0x0457 -#define KOREAN 0x0412 -#define KYRGYZ 0x0440 -#define LAO 0x0454 -#define LATVIAN 0x0426 -#define LITHUANIAN 0x0427 -#define LOWER_SORBIAN 0x082E -#define LUXEMBOURGISH 0x046E -#define MACEDONIAN 0x042F -#define MALAY_MALAYSIA 0x043E -#define MALAY_BRUNEI_DARUSSALAM 0x083E -#define MALAYALAM 0x044C -#define MALTESE 0x043A -#define MAPUDUNGUN 0x047A -#define MAORI 0x0481 -#define MARATHI 0x044E -#define MOHAWK 0x047C -#define MONGOLIAN 0x0450 -#define NEPALI 0x0461 -#define NORWEGIAN_BOKMAL 0x0414 -#define NORWEGIAN_NYNORSK 0x0814 -#define OCCITAN 0x0482 -#define ORIYA 0x0448 -#define PASHTO 0x0463 -#define POLISH 0x0415 -#define PORTUGUESE_BRAZILIAN 0x0416 -#define PORTUGUESE_STANDARD 0x0816 -#define PUNJABI 0x0446 -#define QUECHUA_BOLIVIA 0x046B -#define QUECHUA_ECUADOR 0x086B -#define QUECHUA_PERU 0x0C6B -#define ROMANIAN 0x0418 -#define ROMANSH 0x0417 -#define RUSSIAN 0x0419 -#define SAMI_INARI 0x243B -#define SAMI_LULE_NORWAY 0x103B -#define SAMI_LULE_SWEDEN 0x143B -#define SAMI_NORTHERN_FINLAND 0x0C3B -#define SAMI_NORTHERN_NORWAY 0x043B -#define SAMI_NORTHERN_SWEDEN 0x083B -#define SAMI_SKOLT 0x203B -#define SAMI_SOUTHERN_NORWAY 0x183B -#define SAMI_SOUTHERN_SWEDEN 0x1C3B -#define SANSKRIT 0x044F -#define SERBIAN_LATIN 0x081A -#define SERBIAN_LATIN_BOSNIA_HERZEGOVINA 0x181A -#define SERBIAN_CYRILLIC 0x0C1A -#define SERBIAN_CYRILLIC_BOSNIA_HERZEGOVINA 0x1C1A -#define SESOTHO_SA_LEBOA 0x046C -#define SINHALA 0x045B -#define SLOVAK 0x041B -#define SLOVENIAN 0x0424 -#define SPANISH_TRADITIONAL_SORT 0x040A -#define SPANISH_MEXICAN 0x080A -#define SPANISH_MODERN_SORT 0x0C0A -#define SPANISH_GUATEMALA 0x100A -#define SPANISH_COSTA_RICA 0x140A -#define SPANISH_PANAMA 0x180A -#define SPANISH_DOMINICAN_REPUBLIC 0x1C0A -#define SPANISH_VENEZUELA 0x200A -#define SPANISH_COLOMBIA 0x240A -#define SPANISH_PERU 0x280A -#define SPANISH_ARGENTINA 0x2C0A -#define SPANISH_ECUADOR 0x300A -#define SPANISH_CHILE 0x340A -#define SPANISH_UNITED_STATES 0x540A -#define SPANISH_URUGUAY 0x380A -#define SPANISH_PARAGUAY 0x3C0A -#define SPANISH_BOLIVIA 0x400A -#define SPANISH_EL_SALVADOR 0x440A -#define SPANISH_HONDURAS 0x480A -#define SPANISH_NICARAGUA 0x4C0A -#define SPANISH_PUERTO_RICO 0x500A -#define SWAHILI 0x0441 -#define SWEDISH 0x041D -#define SWEDISH_FINLAND 0x081D -#define SYRIAC 0x045A -#define TAMIL 0x0449 -#define TATAR 0x0444 -#define TELUGU 0x044A -#define THAI 0x041E -#define TIBETAN_BHUTAN 0x0851 -#define TIBETAN_PRC 0x0451 -#define TSWANA 0x0432 -#define UKRAINIAN 0x0422 -#define TURKISH 0x041F -#define TURKMEN 0x0442 -#define UIGHUR 0x0480 -#define UPPER_SORBIAN 0x042E -#define URDU 0x0420 -#define URDU_INDIA 0x0820 -#define UZBEK_LATIN 0x0443 -#define UZBEK_CYRILLIC 0x0843 -#define VIETNAMESE 0x042A -#define WELSH 0x0452 -#define WOLOF 0x0488 -#define XHOSA 0x0434 -#define YAKUT 0x0485 -#define YI 0x0478 -#define YORUBA 0x046A -#define ZULU 0x0435 +#define AFRIKAANS 0x0436 +#define ALBANIAN 0x041C +#define ALSATIAN 0x0484 +#define AMHARIC 0x045E +#define ARABIC_SAUDI_ARABIA 0x0401 +#define ARABIC_IRAQ 0x0801 +#define ARABIC_EGYPT 0x0C01 +#define ARABIC_LIBYA 0x1001 +#define ARABIC_ALGERIA 0x1401 +#define ARABIC_MOROCCO 0x1801 +#define ARABIC_TUNISIA 0x1C01 +#define ARABIC_OMAN 0x2001 +#define ARABIC_YEMEN 0x2401 +#define ARABIC_SYRIA 0x2801 +#define ARABIC_JORDAN 0x2C01 +#define ARABIC_LEBANON 0x3001 +#define ARABIC_KUWAIT 0x3401 +#define ARABIC_UAE 0x3801 +#define ARABIC_BAHRAIN 0x3C01 +#define ARABIC_QATAR 0x4001 +#define ARMENIAN 0x042B +#define ASSAMESE 0x044D +#define AZERI_LATIN 0x042C +#define AZERI_CYRILLIC 0x082C +#define BASHKIR 0x046D +#define BASQUE 0x042D +#define BELARUSIAN 0x0423 +#define BENGALI_INDIA 0x0445 +#define BOSNIAN_LATIN 0x141A +#define BRETON 0x047E +#define BULGARIAN 0x0402 +#define CATALAN 0x0403 +#define CHINESE_TAIWAN 0x0404 +#define CHINESE_PRC 0x0804 +#define CHINESE_HONG_KONG 0x0C04 +#define CHINESE_SINGAPORE 0x1004 +#define CHINESE_MACAU 0x1404 +#define CROATIAN 0x041A +#define CROATIAN_BOSNIA_HERZEGOVINA 0x101A +#define CZECH 0x0405 +#define DANISH 0x0406 +#define DARI 0x048C +#define DIVEHI 0x0465 +#define DUTCH_STANDARD 0x0413 +#define DUTCH_BELGIAN 0x0813 +#define ENGLISH_UNITED_STATES 0x0409 +#define ENGLISH_UNITED_KINGDOM 0x0809 +#define ENGLISH_AUSTRALIAN 0x0C09 +#define ENGLISH_CANADIAN 0x1009 +#define ENGLISH_NEW_ZEALAND 0x1409 +#define ENGLISH_INDIA 0x4009 +#define ENGLISH_IRELAND 0x1809 +#define ENGLISH_MALAYSIA 0x4409 +#define ENGLISH_SOUTH_AFRICA 0x1C09 +#define ENGLISH_JAMAICA 0x2009 +#define ENGLISH_CARIBBEAN 0x2409 +#define ENGLISH_BELIZE 0x2809 +#define ENGLISH_TRINIDAD 0x2C09 +#define ENGLISH_ZIMBABWE 0x3009 +#define ENGLISH_PHILIPPINES 0x3409 +#define ENGLISH_SINGAPORE 0x4809 +#define ESTONIAN 0x0425 +#define FAEROESE 0x0438 +#define FARSI 0x0429 +#define FILIPINO 0x0464 +#define FINNISH 0x040B +#define FRENCH_STANDARD 0x040C +#define FRENCH_BELGIAN 0x080C +#define FRENCH_CANADIAN 0x0C0C +#define FRENCH_SWISS 0x100C +#define FRENCH_LUXEMBOURG 0x140C +#define FRENCH_MONACO 0x180C +#define FRISIAN 0x0462 +#define GEORGIAN 0x0437 +#define GALICIAN 0x0456 +#define GERMAN_STANDARD 0x0407 +#define GERMAN_SWISS 0x0807 +#define GERMAN_AUSTRIAN 0x0C07 +#define GERMAN_LUXEMBOURG 0x1007 +#define GERMAN_LIECHTENSTEIN 0x1407 +#define GREEK 0x0408 +#define GREENLANDIC 0x046F +#define GUJARATI 0x0447 +#define HEBREW 0x040D +#define HINDI 0x0439 +#define HUNGARIAN 0x040E +#define ICELANDIC 0x040F +#define IGBO 0x0470 +#define INDONESIAN 0x0421 +#define IRISH 0x083C +#define ITALIAN_STANDARD 0x0410 +#define ITALIAN_SWISS 0x0810 +#define JAPANESE 0x0411 +#define KANNADA 0x044B +#define KAZAKH 0x043F +#define KHMER 0x0453 +#define KICHE 0x0486 +#define KINYARWANDA 0x0487 +#define KONKANI 0x0457 +#define KOREAN 0x0412 +#define KYRGYZ 0x0440 +#define LAO 0x0454 +#define LATVIAN 0x0426 +#define LITHUANIAN 0x0427 +#define LOWER_SORBIAN 0x082E +#define LUXEMBOURGISH 0x046E +#define MACEDONIAN 0x042F +#define MALAY_MALAYSIA 0x043E +#define MALAY_BRUNEI_DARUSSALAM 0x083E +#define MALAYALAM 0x044C +#define MALTESE 0x043A +#define MAPUDUNGUN 0x047A +#define MAORI 0x0481 +#define MARATHI 0x044E +#define MOHAWK 0x047C +#define MONGOLIAN 0x0450 +#define NEPALI 0x0461 +#define NORWEGIAN_BOKMAL 0x0414 +#define NORWEGIAN_NYNORSK 0x0814 +#define OCCITAN 0x0482 +#define ORIYA 0x0448 +#define PASHTO 0x0463 +#define POLISH 0x0415 +#define PORTUGUESE_BRAZILIAN 0x0416 +#define PORTUGUESE_STANDARD 0x0816 +#define PUNJABI 0x0446 +#define QUECHUA_BOLIVIA 0x046B +#define QUECHUA_ECUADOR 0x086B +#define QUECHUA_PERU 0x0C6B +#define ROMANIAN 0x0418 +#define ROMANSH 0x0417 +#define RUSSIAN 0x0419 +#define SAMI_INARI 0x243B +#define SAMI_LULE_NORWAY 0x103B +#define SAMI_LULE_SWEDEN 0x143B +#define SAMI_NORTHERN_FINLAND 0x0C3B +#define SAMI_NORTHERN_NORWAY 0x043B +#define SAMI_NORTHERN_SWEDEN 0x083B +#define SAMI_SKOLT 0x203B +#define SAMI_SOUTHERN_NORWAY 0x183B +#define SAMI_SOUTHERN_SWEDEN 0x1C3B +#define SANSKRIT 0x044F +#define SERBIAN_LATIN 0x081A +#define SERBIAN_LATIN_BOSNIA_HERZEGOVINA 0x181A +#define SERBIAN_CYRILLIC 0x0C1A +#define SERBIAN_CYRILLIC_BOSNIA_HERZEGOVINA 0x1C1A +#define SESOTHO_SA_LEBOA 0x046C +#define SINHALA 0x045B +#define SLOVAK 0x041B +#define SLOVENIAN 0x0424 +#define SPANISH_TRADITIONAL_SORT 0x040A +#define SPANISH_MEXICAN 0x080A +#define SPANISH_MODERN_SORT 0x0C0A +#define SPANISH_GUATEMALA 0x100A +#define SPANISH_COSTA_RICA 0x140A +#define SPANISH_PANAMA 0x180A +#define SPANISH_DOMINICAN_REPUBLIC 0x1C0A +#define SPANISH_VENEZUELA 0x200A +#define SPANISH_COLOMBIA 0x240A +#define SPANISH_PERU 0x280A +#define SPANISH_ARGENTINA 0x2C0A +#define SPANISH_ECUADOR 0x300A +#define SPANISH_CHILE 0x340A +#define SPANISH_UNITED_STATES 0x540A +#define SPANISH_URUGUAY 0x380A +#define SPANISH_PARAGUAY 0x3C0A +#define SPANISH_BOLIVIA 0x400A +#define SPANISH_EL_SALVADOR 0x440A +#define SPANISH_HONDURAS 0x480A +#define SPANISH_NICARAGUA 0x4C0A +#define SPANISH_PUERTO_RICO 0x500A +#define SWAHILI 0x0441 +#define SWEDISH 0x041D +#define SWEDISH_FINLAND 0x081D +#define SYRIAC 0x045A +#define TAMIL 0x0449 +#define TATAR 0x0444 +#define TELUGU 0x044A +#define THAI 0x041E +#define TIBETAN_BHUTAN 0x0851 +#define TIBETAN_PRC 0x0451 +#define TSWANA 0x0432 +#define UKRAINIAN 0x0422 +#define TURKISH 0x041F +#define TURKMEN 0x0442 +#define UIGHUR 0x0480 +#define UPPER_SORBIAN 0x042E +#define URDU 0x0420 +#define URDU_INDIA 0x0820 +#define UZBEK_LATIN 0x0443 +#define UZBEK_CYRILLIC 0x0843 +#define VIETNAMESE 0x042A +#define WELSH 0x0452 +#define WOLOF 0x0488 +#define XHOSA 0x0434 +#define YAKUT 0x0485 +#define YI 0x0478 +#define YORUBA 0x046A +#define ZULU 0x0435 #ifdef __cplusplus - extern "C" { +extern "C" +{ #endif -FREERDP_API DWORD freerdp_get_system_locale_id(void); -FREERDP_API const char* freerdp_get_system_locale_name_from_id(DWORD localeId); -FREERDP_API int freerdp_detect_keyboard_layout_from_system_locale(DWORD* keyboardLayoutId); + FREERDP_API DWORD freerdp_get_system_locale_id(void); + FREERDP_API const char* freerdp_get_system_locale_name_from_id(DWORD localeId); + FREERDP_API int freerdp_detect_keyboard_layout_from_system_locale(DWORD* keyboardLayoutId); #ifdef __cplusplus - } +} #endif #endif /* FREERDP_LOCALE_H */ diff --git a/include/freerdp/message.h b/include/freerdp/message.h index ddd980f04..ee1fa1f2c 100644 --- a/include/freerdp/message.h +++ b/include/freerdp/message.h @@ -20,347 +20,355 @@ #ifndef FREERDP_CORE_MESSAGE_H #define FREERDP_CORE_MESSAGE_H -#define GetMessageType(_id) (_id & 0xFF) -#define GetMessageClass(_id) ((_id >> 16) & 0xFF) +#define GetMessageType(_id) (_id & 0xFF) +#define GetMessageClass(_id) ((_id >> 16) & 0xFF) -#define GetMessageId(_class, _type) ((_class << 16) | _type) +#define GetMessageId(_class, _type) ((_class << 16) | _type) -#define MakeMessageId(_class, _type) \ - (((_class ##_Class) << 16) | (_class ## _ ## _type)) +#define MakeMessageId(_class, _type) (((_class##_Class) << 16) | (_class##_##_type)) /** * Update Message Queue */ -#define FREERDP_UPDATE_MESSAGE_QUEUE 1 +#define FREERDP_UPDATE_MESSAGE_QUEUE 1 -#define Update_Base 0 +#define Update_Base 0 /* Update */ -#define Update_Class (Update_Base + 1) +#define Update_Class (Update_Base + 1) -#define Update_BeginPaint 1 -#define Update_EndPaint 2 -#define Update_SetBounds 3 -#define Update_Synchronize 4 -#define Update_DesktopResize 5 -#define Update_BitmapUpdate 6 -#define Update_Palette 7 -#define Update_PlaySound 8 -#define Update_RefreshRect 9 -#define Update_SuppressOutput 10 -#define Update_SurfaceCommand 11 -#define Update_SurfaceBits 12 -#define Update_SurfaceFrameMarker 13 -#define Update_SurfaceFrameAcknowledge 14 -#define Update_SetKeyboardIndicators 15 -#define Update_SetKeyboardImeStatus 16 +#define Update_BeginPaint 1 +#define Update_EndPaint 2 +#define Update_SetBounds 3 +#define Update_Synchronize 4 +#define Update_DesktopResize 5 +#define Update_BitmapUpdate 6 +#define Update_Palette 7 +#define Update_PlaySound 8 +#define Update_RefreshRect 9 +#define Update_SuppressOutput 10 +#define Update_SurfaceCommand 11 +#define Update_SurfaceBits 12 +#define Update_SurfaceFrameMarker 13 +#define Update_SurfaceFrameAcknowledge 14 +#define Update_SetKeyboardIndicators 15 +#define Update_SetKeyboardImeStatus 16 -#define FREERDP_UPDATE_BEGIN_PAINT MakeMessageId(Update, BeginPaint) -#define FREERDP_UPDATE_ END_PAINT MakeMessageId(Update, EndPaint) -#define FREERDP_UPDATE_SET_BOUNDS MakeMessageId(Update, SetBounds) -#define FREERDP_UPDATE_SYNCHRONIZE MakeMessageId(Update, Synchronize) -#define FREERDP_UPDATE_DESKTOP_RESIZE MakeMessageId(Update, DesktopResize) -#define FREERDP_UPDATE_BITMAP_UPDATE MakeMessageId(Update, BitmapUpdate) -#define FREERDP_UPDATE_PALETTE MakeMessageId(Update, Palette) -#define FREERDP_UPDATE_PLAY_SOUND MakeMessageId(Update, PlaySound) -#define FREERDP_UPDATE_REFRESH_RECT MakeMessageId(Update, RefreshRect) -#define FREERDP_UPDATE_SUPPRESS_OUTPUT MakeMessageId(Update, SuppressOutput) -#define FREERDP_UPDATE_SURFACE_COMMAND MakeMessageId(Update, SurfaceCommand) -#define FREERDP_UPDATE_SURFACE_BITS MakeMessageId(Update, SurfaceBits) -#define FREERDP_UPDATE_SURFACE_FRAME_MARKER MakeMessageId(Update, SurfaceFrameMarker) -#define FREERDP_UPDATE_SURFACE_FRAME_ACKNOWLEDGE MakeMessageId(Update, SurfaceFrameAcknowledge) -#define FREERDP_UPDATE_SET_KEYBOARD_INDICATORS MakeMessageId(Update, SetKeyboardIndicators) +#define FREERDP_UPDATE_BEGIN_PAINT MakeMessageId(Update, BeginPaint) +#define FREERDP_UPDATE_ END_PAINT MakeMessageId(Update, EndPaint) +#define FREERDP_UPDATE_SET_BOUNDS MakeMessageId(Update, SetBounds) +#define FREERDP_UPDATE_SYNCHRONIZE MakeMessageId(Update, Synchronize) +#define FREERDP_UPDATE_DESKTOP_RESIZE MakeMessageId(Update, DesktopResize) +#define FREERDP_UPDATE_BITMAP_UPDATE MakeMessageId(Update, BitmapUpdate) +#define FREERDP_UPDATE_PALETTE MakeMessageId(Update, Palette) +#define FREERDP_UPDATE_PLAY_SOUND MakeMessageId(Update, PlaySound) +#define FREERDP_UPDATE_REFRESH_RECT MakeMessageId(Update, RefreshRect) +#define FREERDP_UPDATE_SUPPRESS_OUTPUT MakeMessageId(Update, SuppressOutput) +#define FREERDP_UPDATE_SURFACE_COMMAND MakeMessageId(Update, SurfaceCommand) +#define FREERDP_UPDATE_SURFACE_BITS MakeMessageId(Update, SurfaceBits) +#define FREERDP_UPDATE_SURFACE_FRAME_MARKER MakeMessageId(Update, SurfaceFrameMarker) +#define FREERDP_UPDATE_SURFACE_FRAME_ACKNOWLEDGE MakeMessageId(Update, SurfaceFrameAcknowledge) +#define FREERDP_UPDATE_SET_KEYBOARD_INDICATORS MakeMessageId(Update, SetKeyboardIndicators) /* Primary Update */ -#define PrimaryUpdate_Class (Update_Base + 2) +#define PrimaryUpdate_Class (Update_Base + 2) -#define PrimaryUpdate_DstBlt 1 -#define PrimaryUpdate_PatBlt 2 -#define PrimaryUpdate_ScrBlt 3 -#define PrimaryUpdate_OpaqueRect 4 -#define PrimaryUpdate_DrawNineGrid 5 -#define PrimaryUpdate_MultiDstBlt 6 -#define PrimaryUpdate_MultiPatBlt 7 -#define PrimaryUpdate_MultiScrBlt 8 -#define PrimaryUpdate_MultiOpaqueRect 9 -#define PrimaryUpdate_MultiDrawNineGrid 10 -#define PrimaryUpdate_LineTo 11 -#define PrimaryUpdate_Polyline 12 -#define PrimaryUpdate_MemBlt 13 -#define PrimaryUpdate_Mem3Blt 14 -#define PrimaryUpdate_SaveBitmap 15 -#define PrimaryUpdate_GlyphIndex 16 -#define PrimaryUpdate_FastIndex 17 -#define PrimaryUpdate_FastGlyph 18 -#define PrimaryUpdate_PolygonSC 19 -#define PrimaryUpdate_PolygonCB 20 -#define PrimaryUpdate_EllipseSC 21 -#define PrimaryUpdate_EllipseCB 22 +#define PrimaryUpdate_DstBlt 1 +#define PrimaryUpdate_PatBlt 2 +#define PrimaryUpdate_ScrBlt 3 +#define PrimaryUpdate_OpaqueRect 4 +#define PrimaryUpdate_DrawNineGrid 5 +#define PrimaryUpdate_MultiDstBlt 6 +#define PrimaryUpdate_MultiPatBlt 7 +#define PrimaryUpdate_MultiScrBlt 8 +#define PrimaryUpdate_MultiOpaqueRect 9 +#define PrimaryUpdate_MultiDrawNineGrid 10 +#define PrimaryUpdate_LineTo 11 +#define PrimaryUpdate_Polyline 12 +#define PrimaryUpdate_MemBlt 13 +#define PrimaryUpdate_Mem3Blt 14 +#define PrimaryUpdate_SaveBitmap 15 +#define PrimaryUpdate_GlyphIndex 16 +#define PrimaryUpdate_FastIndex 17 +#define PrimaryUpdate_FastGlyph 18 +#define PrimaryUpdate_PolygonSC 19 +#define PrimaryUpdate_PolygonCB 20 +#define PrimaryUpdate_EllipseSC 21 +#define PrimaryUpdate_EllipseCB 22 -#define FREERDP_PRIMARY_UPDATE_DSTBLT MakeMessageId(PrimaryUpdate, DstBlt) -#define FREERDP_PRIMARY_UPDATE_PATBLT MakeMessageId(PrimaryUpdate, PatBlt) -#define FREERDP_PRIMARY_UPDATE_SCRBLT MakeMessageId(PrimaryUpdate, ScrBlt) -#define FREERDP_PRIMARY_UPDATE_OPAQUE_RECT MakeMessageId(PrimaryUpdate, OpaqueRect) -#define FREERDP_PRIMARY_UPDATE_DRAW_NINE_GRID MakeMessageId(PrimaryUpdate, DrawNineGrid) -#define FREERDP_PRIMARY_UPDATE_MULTI_DSTBLT MakeMessageId(PrimaryUpdate, MultiDstBlt) -#define FREERDP_PRIMARY_UPDATE_MULTI_PATBLT MakeMessageId(PrimaryUpdate, MultiPatBlt) -#define FREERDP_PRIMARY_UPDATE_MULTI_SCRBLT MakeMessageId(PrimaryUpdate, MultiScrBlt) -#define FREERDP_PRIMARY_UPDATE_MULTI_OPAQUE_RECT MakeMessageId(PrimaryUpdate, MultiOpaqueRect) -#define FREERDP_PRIMARY_UPDATE_MULTI_DRAW_NINE_GRID MakeMessageId(PrimaryUpdate, MultiDrawNineGrid) -#define FREERDP_PRIMARY_UPDATE_LINE_TO MakeMessageId(PrimaryUpdate, LineTo) -#define FREERDP_PRIMARY_UPDATE_POLYLINE MakeMessageId(PrimaryUpdate, Polyline) -#define FREERDP_PRIMARY_UPDATE_MEMBLT MakeMessageId(PrimaryUpdate, MemBlt) -#define FREERDP_PRIMARY_UPDATE_MEM3BLT MakeMessageId(PrimaryUpdate, Mem3Blt) -#define FREERDP_PRIMARY_UPDATE_SAVE_BITMAP MakeMessageId(PrimaryUpdate, SaveBitmap) -#define FREERDP_PRIMARY_UPDATE_GLYPH_INDEX MakeMessageId(PrimaryUpdate, GlyphIndex) -#define FREERDP_PRIMARY_UPDATE_FAST_INDEX MakeMessageId(PrimaryUpdate, FastIndex) -#define FREERDP_PRIMARY_UPDATE_FAST_GLYPH MakeMessageId(PrimaryUpdate, FastGlyph) -#define FREERDP_PRIMARY_UPDATE_POLYGON_SC MakeMessageId(PrimaryUpdate, PolygonSC) -#define FREERDP_PRIMARY_UPDATE_POLYGON_CB MakeMessageId(PrimaryUpdate, PolygonCB) -#define FREERDP_PRIMARY_UPDATE_ELLIPSE_SC MakeMessageId(PrimaryUpdate, EllipseSC) -#define FREERDP_PRIMARY_UPDATE_ELLIPSE_CB MakeMessageId(PrimaryUpdate, EllipseCB) +#define FREERDP_PRIMARY_UPDATE_DSTBLT MakeMessageId(PrimaryUpdate, DstBlt) +#define FREERDP_PRIMARY_UPDATE_PATBLT MakeMessageId(PrimaryUpdate, PatBlt) +#define FREERDP_PRIMARY_UPDATE_SCRBLT MakeMessageId(PrimaryUpdate, ScrBlt) +#define FREERDP_PRIMARY_UPDATE_OPAQUE_RECT MakeMessageId(PrimaryUpdate, OpaqueRect) +#define FREERDP_PRIMARY_UPDATE_DRAW_NINE_GRID MakeMessageId(PrimaryUpdate, DrawNineGrid) +#define FREERDP_PRIMARY_UPDATE_MULTI_DSTBLT MakeMessageId(PrimaryUpdate, MultiDstBlt) +#define FREERDP_PRIMARY_UPDATE_MULTI_PATBLT MakeMessageId(PrimaryUpdate, MultiPatBlt) +#define FREERDP_PRIMARY_UPDATE_MULTI_SCRBLT MakeMessageId(PrimaryUpdate, MultiScrBlt) +#define FREERDP_PRIMARY_UPDATE_MULTI_OPAQUE_RECT MakeMessageId(PrimaryUpdate, MultiOpaqueRect) +#define FREERDP_PRIMARY_UPDATE_MULTI_DRAW_NINE_GRID MakeMessageId(PrimaryUpdate, MultiDrawNineGrid) +#define FREERDP_PRIMARY_UPDATE_LINE_TO MakeMessageId(PrimaryUpdate, LineTo) +#define FREERDP_PRIMARY_UPDATE_POLYLINE MakeMessageId(PrimaryUpdate, Polyline) +#define FREERDP_PRIMARY_UPDATE_MEMBLT MakeMessageId(PrimaryUpdate, MemBlt) +#define FREERDP_PRIMARY_UPDATE_MEM3BLT MakeMessageId(PrimaryUpdate, Mem3Blt) +#define FREERDP_PRIMARY_UPDATE_SAVE_BITMAP MakeMessageId(PrimaryUpdate, SaveBitmap) +#define FREERDP_PRIMARY_UPDATE_GLYPH_INDEX MakeMessageId(PrimaryUpdate, GlyphIndex) +#define FREERDP_PRIMARY_UPDATE_FAST_INDEX MakeMessageId(PrimaryUpdate, FastIndex) +#define FREERDP_PRIMARY_UPDATE_FAST_GLYPH MakeMessageId(PrimaryUpdate, FastGlyph) +#define FREERDP_PRIMARY_UPDATE_POLYGON_SC MakeMessageId(PrimaryUpdate, PolygonSC) +#define FREERDP_PRIMARY_UPDATE_POLYGON_CB MakeMessageId(PrimaryUpdate, PolygonCB) +#define FREERDP_PRIMARY_UPDATE_ELLIPSE_SC MakeMessageId(PrimaryUpdate, EllipseSC) +#define FREERDP_PRIMARY_UPDATE_ELLIPSE_CB MakeMessageId(PrimaryUpdate, EllipseCB) /* Secondary Update */ -#define SecondaryUpdate_Class (Update_Base + 3) +#define SecondaryUpdate_Class (Update_Base + 3) -#define SecondaryUpdate_CacheBitmap 1 -#define SecondaryUpdate_CacheBitmapV2 2 -#define SecondaryUpdate_CacheBitmapV3 3 -#define SecondaryUpdate_CacheColorTable 4 -#define SecondaryUpdate_CacheGlyph 5 -#define SecondaryUpdate_CacheGlyphV2 6 -#define SecondaryUpdate_CacheBrush 7 +#define SecondaryUpdate_CacheBitmap 1 +#define SecondaryUpdate_CacheBitmapV2 2 +#define SecondaryUpdate_CacheBitmapV3 3 +#define SecondaryUpdate_CacheColorTable 4 +#define SecondaryUpdate_CacheGlyph 5 +#define SecondaryUpdate_CacheGlyphV2 6 +#define SecondaryUpdate_CacheBrush 7 -#define FREERDP_SECONDARY_UPDATE_CACHE_BITMAP MakeMessageId(SecondaryUpdate, CacheBitmap) -#define FREERDP_SECONDARY_UPDATE_CACHE_BITMAP_V2 MakeMessageId(SecondaryUpdate, CacheBitmapV2) -#define FREERDP_SECONDARY_UPDATE_CACHE_BITMAP_V3 MakeMessageId(SecondaryUpdate, CacheBitmapV3) -#define FREERDP_SECONDARY_UPDATE_CACHE_COLOR_TABLE MakeMessageId(SecondaryUpdate, CacheColorTable) -#define FREERDP_SECONDARY_UPDATE_CACHE_GLYPH MakeMessageId(SecondaryUpdate, CacheGlyph) -#define FREERDP_SECONDARY_UPDATE_CACHE_GLYPH_V2 MakeMessageId(SecondaryUpdate, CacheGlyphV2) -#define FREERDP_SECONDARY_UPDATE_CACHE_BRUSH MakeMessageId(SecondaryUpdate, CacheBrush) +#define FREERDP_SECONDARY_UPDATE_CACHE_BITMAP MakeMessageId(SecondaryUpdate, CacheBitmap) +#define FREERDP_SECONDARY_UPDATE_CACHE_BITMAP_V2 MakeMessageId(SecondaryUpdate, CacheBitmapV2) +#define FREERDP_SECONDARY_UPDATE_CACHE_BITMAP_V3 MakeMessageId(SecondaryUpdate, CacheBitmapV3) +#define FREERDP_SECONDARY_UPDATE_CACHE_COLOR_TABLE MakeMessageId(SecondaryUpdate, CacheColorTable) +#define FREERDP_SECONDARY_UPDATE_CACHE_GLYPH MakeMessageId(SecondaryUpdate, CacheGlyph) +#define FREERDP_SECONDARY_UPDATE_CACHE_GLYPH_V2 MakeMessageId(SecondaryUpdate, CacheGlyphV2) +#define FREERDP_SECONDARY_UPDATE_CACHE_BRUSH MakeMessageId(SecondaryUpdate, CacheBrush) /* Alternate Secondary Update */ -#define AltSecUpdate_Class (Update_Base + 4) +#define AltSecUpdate_Class (Update_Base + 4) -#define AltSecUpdate_CreateOffscreenBitmap 1 -#define AltSecUpdate_SwitchSurface 2 -#define AltSecUpdate_CreateNineGridBitmap 3 -#define AltSecUpdate_FrameMarker 4 -#define AltSecUpdate_StreamBitmapFirst 5 -#define AltSecUpdate_StreamBitmapNext 6 -#define AltSecUpdate_DrawGdiPlusFirst 7 -#define AltSecUpdate_DrawGdiPlusNext 8 -#define AltSecUpdate_DrawGdiPlusEnd 9 -#define AltSecUpdate_DrawGdiPlusCacheFirst 10 -#define AltSecUpdate_DrawGdiPlusCacheNext 11 -#define AltSecUpdate_DrawGdiPlusCacheEnd 12 +#define AltSecUpdate_CreateOffscreenBitmap 1 +#define AltSecUpdate_SwitchSurface 2 +#define AltSecUpdate_CreateNineGridBitmap 3 +#define AltSecUpdate_FrameMarker 4 +#define AltSecUpdate_StreamBitmapFirst 5 +#define AltSecUpdate_StreamBitmapNext 6 +#define AltSecUpdate_DrawGdiPlusFirst 7 +#define AltSecUpdate_DrawGdiPlusNext 8 +#define AltSecUpdate_DrawGdiPlusEnd 9 +#define AltSecUpdate_DrawGdiPlusCacheFirst 10 +#define AltSecUpdate_DrawGdiPlusCacheNext 11 +#define AltSecUpdate_DrawGdiPlusCacheEnd 12 -#define FREERDP_ALTSEC_UPDATE_CREATE_OFFSCREEN_BITMAP MakeMessageId(AltSecUpdate, CreateOffscreenBitmap) -#define FREERDP_ALTSEC_UPDATE_SWITCH_SURFACE MakeMessageId(AltSecUpdate, SwitchSurface) -#define FREERDP_ALTSEC_UPDATE_CREATE_NINE_GRID_BITMAP MakeMessageId(AltSecUpdate, CreateNineGridBitmap) -#define FREERDP_ALTSEC_UPDATE_FRAME_MARKER MakeMessageId(AltSecUpdate, FrameMarker) -#define FREERDP_ALTSEC_UPDATE_STREAM_BITMAP_FIRST MakeMessageId(AltSecUpdate, StreamBitmapFirst) -#define FREERDP_ALTSEC_UPDATE_STREAM_BITMAP_NEXT MakeMessageId(AltSecUpdate, StreamBitmapNext) -#define FREERDP_ALTSEC_UPDATE_DRAW_GDI_PLUS_FIRST MakeMessageId(AltSecUpdate, DrawGdiPlusFirst) -#define FREERDP_ALTSEC_UPDATE_DRAW_GDI_PLUS_NEXT MakeMessageId(AltSecUpdate, DrawGdiPlusNext) -#define FREERDP_ALTSEC_UPDATE_DRAW_GDI_PLUS_END MakeMessageId(AltSecUpdate, DrawGdiPlusEnd) -#define FREERDP_ALTSEC_UPDATE_DRAW_GDI_PLUS_CACHE_FIRST MakeMessageId(AltSecUpdate, DrawGdiPlusCacheFirst) -#define FREERDP_ALTSEC_UPDATE_DRAW_GDI_PLUS_CACHE_NEXT MakeMessageId(AltSecUpdate, DrawGdiPlusCacheNext) -#define FREERDP_ALTSEC_UPDATE_DRAW_GDI_PLUS_CACHE_END MakeMessageId(AltSecUpdate, DrawGdiPlusCacheEnd) +#define FREERDP_ALTSEC_UPDATE_CREATE_OFFSCREEN_BITMAP \ + MakeMessageId(AltSecUpdate, CreateOffscreenBitmap) +#define FREERDP_ALTSEC_UPDATE_SWITCH_SURFACE MakeMessageId(AltSecUpdate, SwitchSurface) +#define FREERDP_ALTSEC_UPDATE_CREATE_NINE_GRID_BITMAP \ + MakeMessageId(AltSecUpdate, CreateNineGridBitmap) +#define FREERDP_ALTSEC_UPDATE_FRAME_MARKER MakeMessageId(AltSecUpdate, FrameMarker) +#define FREERDP_ALTSEC_UPDATE_STREAM_BITMAP_FIRST MakeMessageId(AltSecUpdate, StreamBitmapFirst) +#define FREERDP_ALTSEC_UPDATE_STREAM_BITMAP_NEXT MakeMessageId(AltSecUpdate, StreamBitmapNext) +#define FREERDP_ALTSEC_UPDATE_DRAW_GDI_PLUS_FIRST MakeMessageId(AltSecUpdate, DrawGdiPlusFirst) +#define FREERDP_ALTSEC_UPDATE_DRAW_GDI_PLUS_NEXT MakeMessageId(AltSecUpdate, DrawGdiPlusNext) +#define FREERDP_ALTSEC_UPDATE_DRAW_GDI_PLUS_END MakeMessageId(AltSecUpdate, DrawGdiPlusEnd) +#define FREERDP_ALTSEC_UPDATE_DRAW_GDI_PLUS_CACHE_FIRST \ + MakeMessageId(AltSecUpdate, DrawGdiPlusCacheFirst) +#define FREERDP_ALTSEC_UPDATE_DRAW_GDI_PLUS_CACHE_NEXT \ + MakeMessageId(AltSecUpdate, DrawGdiPlusCacheNext) +#define FREERDP_ALTSEC_UPDATE_DRAW_GDI_PLUS_CACHE_END \ + MakeMessageId(AltSecUpdate, DrawGdiPlusCacheEnd) /* Window Update */ -#define WindowUpdate_Class (Update_Base + 5) +#define WindowUpdate_Class (Update_Base + 5) -#define WindowUpdate_WindowCreate 1 -#define WindowUpdate_WindowUpdate 2 -#define WindowUpdate_WindowIcon 3 -#define WindowUpdate_WindowCachedIcon 4 -#define WindowUpdate_WindowDelete 5 -#define WindowUpdate_NotifyIconCreate 6 -#define WindowUpdate_NotifyIconUpdate 7 -#define WindowUpdate_NotifyIconDelete 8 -#define WindowUpdate_MonitoredDesktop 9 -#define WindowUpdate_NonMonitoredDesktop 10 +#define WindowUpdate_WindowCreate 1 +#define WindowUpdate_WindowUpdate 2 +#define WindowUpdate_WindowIcon 3 +#define WindowUpdate_WindowCachedIcon 4 +#define WindowUpdate_WindowDelete 5 +#define WindowUpdate_NotifyIconCreate 6 +#define WindowUpdate_NotifyIconUpdate 7 +#define WindowUpdate_NotifyIconDelete 8 +#define WindowUpdate_MonitoredDesktop 9 +#define WindowUpdate_NonMonitoredDesktop 10 -#define FREERDP_WINDOW_UPDATE_WINDOW_CREATE MakeMessageId(WindowUpdate, WindowCreate) -#define FREERDP_WINDOW_UPDATE_WINDOW_UPDATE MakeMessageId(WindowUpdate, WindowUpdate) -#define FREERDP_WINDOW_UPDATE_WINDOW_ICON MakeMessageId(WindowUpdate, WindowIcon) -#define FREERDP_WINDOW_UPDATE_WINDOW_CACHED_ICON MakeMessageId(WindowUpdate, WindowCachedIcon) -#define FREERDP_WINDOW_UPDATE_WINDOW_DELETE MakeMessageId(WindowUpdate, WindowDelete) -#define FREERDP_WINDOW_UPDATE_NOTIFY_ICON_CREATE MakeMessageId(WindowUpdate, NotifyIconCreate) -#define FREERDP_WINDOW_UPDATE_NOTIFY_ICON_UPDATE MakeMessageId(WindowUpdate, NotifyIconUpdate) -#define FREERDP_WINDOW_UPDATE_NOTIFY_ICON_DELETE MakeMessageId(WindowUpdate, NotifyIconDelete) -#define FREERDP_WINDOW_UPDATE_MONITORED_DESKTOP MakeMessageId(WindowUpdate, MonitoredDesktop) -#define FREERDP_WINDOW_UPDATE_NON_MONITORED_DESKTOP MakeMessageId(WindowUpdate, NonMonitoredDesktop) +#define FREERDP_WINDOW_UPDATE_WINDOW_CREATE MakeMessageId(WindowUpdate, WindowCreate) +#define FREERDP_WINDOW_UPDATE_WINDOW_UPDATE MakeMessageId(WindowUpdate, WindowUpdate) +#define FREERDP_WINDOW_UPDATE_WINDOW_ICON MakeMessageId(WindowUpdate, WindowIcon) +#define FREERDP_WINDOW_UPDATE_WINDOW_CACHED_ICON MakeMessageId(WindowUpdate, WindowCachedIcon) +#define FREERDP_WINDOW_UPDATE_WINDOW_DELETE MakeMessageId(WindowUpdate, WindowDelete) +#define FREERDP_WINDOW_UPDATE_NOTIFY_ICON_CREATE MakeMessageId(WindowUpdate, NotifyIconCreate) +#define FREERDP_WINDOW_UPDATE_NOTIFY_ICON_UPDATE MakeMessageId(WindowUpdate, NotifyIconUpdate) +#define FREERDP_WINDOW_UPDATE_NOTIFY_ICON_DELETE MakeMessageId(WindowUpdate, NotifyIconDelete) +#define FREERDP_WINDOW_UPDATE_MONITORED_DESKTOP MakeMessageId(WindowUpdate, MonitoredDesktop) +#define FREERDP_WINDOW_UPDATE_NON_MONITORED_DESKTOP MakeMessageId(WindowUpdate, NonMonitoredDesktop) /* Pointer Update */ -#define PointerUpdate_Class (Update_Base + 6) +#define PointerUpdate_Class (Update_Base + 6) -#define PointerUpdate_PointerPosition 1 -#define PointerUpdate_PointerSystem 2 -#define PointerUpdate_PointerColor 3 -#define PointerUpdate_PointerNew 4 -#define PointerUpdate_PointerCached 5 +#define PointerUpdate_PointerPosition 1 +#define PointerUpdate_PointerSystem 2 +#define PointerUpdate_PointerColor 3 +#define PointerUpdate_PointerNew 4 +#define PointerUpdate_PointerCached 5 -#define FREERDP_POINTER_UPDATE_ POINTER_POSITION MakeMessageId(PointerUpdate, PointerPosition) -#define FREERDP_POINTER_UPDATE_POINTER_SYSTEM MakeMessageId(PointerUpdate, PointerSystem) -#define FREERDP_POINTER_UPDATE_POINTER_COLOR MakeMessageId(PointerUpdate, PointerColor) -#define FREERDP_POINTER_UPDATE_POINTER_NEW MakeMessageId(PointerUpdate, PointerNew) -#define FREERDP_POINTER_UPDATE_POINTER_CACHED MakeMessageId(PointerUpdate, PointerCached) +#define FREERDP_POINTER_UPDATE_ POINTER_POSITION MakeMessageId(PointerUpdate, PointerPosition) +#define FREERDP_POINTER_UPDATE_POINTER_SYSTEM MakeMessageId(PointerUpdate, PointerSystem) +#define FREERDP_POINTER_UPDATE_POINTER_COLOR MakeMessageId(PointerUpdate, PointerColor) +#define FREERDP_POINTER_UPDATE_POINTER_NEW MakeMessageId(PointerUpdate, PointerNew) +#define FREERDP_POINTER_UPDATE_POINTER_CACHED MakeMessageId(PointerUpdate, PointerCached) /** * Input Message Queue */ -#define FREERDP_INPUT_MESSAGE_QUEUE 2 +#define FREERDP_INPUT_MESSAGE_QUEUE 2 -#define Input_Base 16 +#define Input_Base 16 /* Input */ -#define Input_Class (Input_Base + 1) +#define Input_Class (Input_Base + 1) -#define Input_SynchronizeEvent 1 -#define Input_KeyboardEvent 2 -#define Input_UnicodeKeyboardEvent 3 -#define Input_MouseEvent 4 -#define Input_ExtendedMouseEvent 5 -#define Input_FocusInEvent 6 -#define Input_KeyboardPauseEvent 7 +#define Input_SynchronizeEvent 1 +#define Input_KeyboardEvent 2 +#define Input_UnicodeKeyboardEvent 3 +#define Input_MouseEvent 4 +#define Input_ExtendedMouseEvent 5 +#define Input_FocusInEvent 6 +#define Input_KeyboardPauseEvent 7 -#define FREERDP_INPUT_SYNCHRONIZE_EVENT MakeMessageId(Input, SynchronizeEvent) -#define FREERDP_INPUT_KEYBOARD_EVENT MakeMessageId(Input, KeyboardEvent) -#define FREERDP_INPUT_UNICODE_KEYBOARD_EVENT MakeMessageId(Input, UnicodeKeyboardEvent) -#define FREERDP_INPUT_MOUSE_EVENT MakeMessageId(Input, MouseEvent) -#define FREERDP_INPUT_EXTENDED_MOUSE_EVENT MakeMessageId(Input, ExtendedMouseEvent) -#define FREERDP_INPUT_FOCUS_IN_EVENT MakeMessageId(Input, FocusInEvent) -#define FREERDP_INPUT_KEYBOARD_PAUSE_EVENT MakeMessageId(Input, KeyboardPauseEvent) +#define FREERDP_INPUT_SYNCHRONIZE_EVENT MakeMessageId(Input, SynchronizeEvent) +#define FREERDP_INPUT_KEYBOARD_EVENT MakeMessageId(Input, KeyboardEvent) +#define FREERDP_INPUT_UNICODE_KEYBOARD_EVENT MakeMessageId(Input, UnicodeKeyboardEvent) +#define FREERDP_INPUT_MOUSE_EVENT MakeMessageId(Input, MouseEvent) +#define FREERDP_INPUT_EXTENDED_MOUSE_EVENT MakeMessageId(Input, ExtendedMouseEvent) +#define FREERDP_INPUT_FOCUS_IN_EVENT MakeMessageId(Input, FocusInEvent) +#define FREERDP_INPUT_KEYBOARD_PAUSE_EVENT MakeMessageId(Input, KeyboardPauseEvent) /** * Static Channel Message Queues */ -#define FREERDP_CHANNEL_MESSAGE_QUEUE 3 +#define FREERDP_CHANNEL_MESSAGE_QUEUE 3 -#define Channel_Base 20 +#define Channel_Base 20 /** * Debug Channel */ -#define DebugChannel_Class (Channel_Base + 1) +#define DebugChannel_Class (Channel_Base + 1) /** * Clipboard Channel */ -#define CliprdrChannel_Class (Channel_Base + 2) +#define CliprdrChannel_Class (Channel_Base + 2) -#define CliprdrChannel_MonitorReady 1 -#define CliprdrChannel_FormatList 2 -#define CliprdrChannel_DataRequest 3 -#define CliprdrChannel_DataResponse 4 -#define CliprdrChannel_ClipCaps 5 -#define CliprdrChannel_FilecontentsRequest 6 -#define CliprdrChannel_FilecontentsResponse 7 -#define CliprdrChannel_LockClipdata 8 -#define CliprdrChannel_UnLockClipdata 9 -#define CliprdrChannel_TemporaryDirectory 10 +#define CliprdrChannel_MonitorReady 1 +#define CliprdrChannel_FormatList 2 +#define CliprdrChannel_DataRequest 3 +#define CliprdrChannel_DataResponse 4 +#define CliprdrChannel_ClipCaps 5 +#define CliprdrChannel_FilecontentsRequest 6 +#define CliprdrChannel_FilecontentsResponse 7 +#define CliprdrChannel_LockClipdata 8 +#define CliprdrChannel_UnLockClipdata 9 +#define CliprdrChannel_TemporaryDirectory 10 -#define FREERDP_CLIPRDR_CHANNEL_MONITOR_READY MakeMessageId(CliprdrChannel, MonitorReady) -#define FREERDP_CLIPRDR_CHANNEL_FORMAT_LIST MakeMessageId(CliprdrChannel, FormatList) -#define FREERDP_CLIPRDR_CHANNEL_DATA_REQUEST MakeMessageId(CliprdrChannel, DataRequest) -#define FREERDP_CLIPRDR_CHANNEL_DATA_RESPONSE MakeMessageId(CliprdrChannel, DataResponse) -#define FREERDP_CLIPRDR_CHANNEL_CLIP_CAPS MakeMessageId(CliprdrChannel, ClipCaps) +#define FREERDP_CLIPRDR_CHANNEL_MONITOR_READY MakeMessageId(CliprdrChannel, MonitorReady) +#define FREERDP_CLIPRDR_CHANNEL_FORMAT_LIST MakeMessageId(CliprdrChannel, FormatList) +#define FREERDP_CLIPRDR_CHANNEL_DATA_REQUEST MakeMessageId(CliprdrChannel, DataRequest) +#define FREERDP_CLIPRDR_CHANNEL_DATA_RESPONSE MakeMessageId(CliprdrChannel, DataResponse) +#define FREERDP_CLIPRDR_CHANNEL_CLIP_CAPS MakeMessageId(CliprdrChannel, ClipCaps) /** * Multimedia Redirection Channel */ -#define TsmfChannel_Class (Channel_Base + 3) +#define TsmfChannel_Class (Channel_Base + 3) -#define TsmfChannel_VideoFrame 1 -#define TsmfChannel_Redraw 2 +#define TsmfChannel_VideoFrame 1 +#define TsmfChannel_Redraw 2 -#define FREERDP_TSMF_CHANNEL_VIDEO_FRAME MakeMessageId(TsmfChannel, VideoFrame) -#define FREERDP_TSMF_CHANNEL_REDRAW MakeMessageId(TsmfChannel, Redraw) +#define FREERDP_TSMF_CHANNEL_VIDEO_FRAME MakeMessageId(TsmfChannel, VideoFrame) +#define FREERDP_TSMF_CHANNEL_REDRAW MakeMessageId(TsmfChannel, Redraw) /** * RemoteApp Channel */ -#define RailChannel_Class (Channel_Base + 4) +#define RailChannel_Class (Channel_Base + 4) -#define RailChannel_ClientExecute 1 -#define RailChannel_ClientActivate 2 -#define RailChannel_GetSystemParam 3 -#define RailChannel_ClientSystemParam 4 -#define RailChannel_ServerSystemParam 5 -#define RailChannel_ClientSystemCommand 6 -#define RailChannel_ClientHandshake 7 -#define RailChannel_ServerHandshake 8 -#define RailChannel_ClientNotifyEvent 9 -#define RailChannel_ClientWindowMove 10 -#define RailChannel_ServerLocalMoveSize 11 -#define RailChannel_ServerMinMaxInfo 12 -#define RailChannel_ClientInformation 13 -#define RailChannel_ClientSystemMenu 14 -#define RailChannel_ClientLanguageBarInfo 15 -#define RailChannel_ServerLanguageBarInfo 16 -#define RailChannel_ServerExecuteResult 17 -#define RailChannel_ClientGetAppIdRequest 18 -#define RailChannel_ServerGetAppIdResponse 19 -#define RailChannel_ClientHandshakeEx 20 -#define RailChannel_ServerHandshakeEx 21 +#define RailChannel_ClientExecute 1 +#define RailChannel_ClientActivate 2 +#define RailChannel_GetSystemParam 3 +#define RailChannel_ClientSystemParam 4 +#define RailChannel_ServerSystemParam 5 +#define RailChannel_ClientSystemCommand 6 +#define RailChannel_ClientHandshake 7 +#define RailChannel_ServerHandshake 8 +#define RailChannel_ClientNotifyEvent 9 +#define RailChannel_ClientWindowMove 10 +#define RailChannel_ServerLocalMoveSize 11 +#define RailChannel_ServerMinMaxInfo 12 +#define RailChannel_ClientInformation 13 +#define RailChannel_ClientSystemMenu 14 +#define RailChannel_ClientLanguageBarInfo 15 +#define RailChannel_ServerLanguageBarInfo 16 +#define RailChannel_ServerExecuteResult 17 +#define RailChannel_ClientGetAppIdRequest 18 +#define RailChannel_ServerGetAppIdResponse 19 +#define RailChannel_ClientHandshakeEx 20 +#define RailChannel_ServerHandshakeEx 21 -#define FREERDP_RAIL_CHANNEL_CLIENT_EXECUTE MakeMessageId(RailChannel, ClientExecute) -#define FREERDP_RAIL_CHANNEL_CLIENT_ACTIVATE MakeMessageId(RailChannel, ClientActivate) -#define FREERDP_RAIL_CHANNEL_GET_SYSTEM_PARAM MakeMessageId(RailChannel, GetSystemParam) -#define FREERDP_RAIL_CHANNEL_CLIENT_SYSTEM_PARAM MakeMessageId(RailChannel, ClientSystemParam) -#define FREERDP_RAIL_CHANNEL_SERVER_SYSTEM_PARAM MakeMessageId(RailChannel, ClientSystemParam) -#define FREERDP_RAIL_CHANNEL_CLIENT_SYSTEM_COMMAND MakeMessageId(RailChannel, ClientSystemCommand) -#define FREERDP_RAIL_CHANNEL_CLIENT_HANDSHAKE MakeMessageId(RailChannel, ClientHandshake) -#define FREERDP_RAIL_CHANNEL_SERVER_HANDSHAKE MakeMessageId(RailChannel, ServerHandshake) -#define FREERDP_RAIL_CHANNEL_CLIENT_NOTIFY_EVENT MakeMessageId(RailChannel, ClientNotifyEvent) -#define FREERDP_RAIL_CHANNEL_CLIENT_WINDOW_MOVE MakeMessageId(RailChannel, ClientWindowMove) -#define FREERDP_RAIL_CHANNEL_SERVER_LOCAL_MOVE_SIZE MakeMessageId(RailChannel, ServerLocalMoveSize) -#define FREERDP_RAIL_CHANNEL_SERVER_MIN_MAX_INFO MakeMessageId(RailChannel, ServerMinMaxInfo) -#define FREERDP_RAIL_CHANNEL_CLIENT_INFORMATION MakeMessageId(RailChannel, ClientInformation) -#define FREERDP_RAIL_CHANNEL_CLIENT_SYSTEM_MENU MakeMessageId(RailChannel, ClientSystemMenu) -#define FREERDP_RAIL_CHANNEL_CLIENT_LANGUAGE_BAR_INFO MakeMessageId(RailChannel, ClientLanguageBarInfo) -#define FREERDP_RAIL_CHANNEL_SERVER_LANGUAGE_BAR_INFO MakeMessageId(RailChannel, ServerLanguageBarInfo) -#define FREERDP_RAIL_CHANNEL_SERVER_EXECUTE_RESULT MakeMessageId(RailChannel, ServerExecuteResult) -#define FREERDP_RAIL_CHANNEL_CLIENT_GET_APP_ID_REQUEST MakeMessageId(RailChannel, ClientGetAppIdRequest) -#define FREERDP_RAIL_CHANNEL_SERVER_GET_APP_ID_RESPONSE MakeMessageId(RailChannel, ServerGetAppIdResponse) -#define FREERDP_RAIL_CHANNEL_CLIENT_HANDSHAKE_EX MakeMessageId(RailChannel, ClientHandshakeEx) -#define FREERDP_RAIL_CHANNEL_SERVER_HANDSHAKE_EX MakeMessageId(RailChannel, ServerHandshakeEx) +#define FREERDP_RAIL_CHANNEL_CLIENT_EXECUTE MakeMessageId(RailChannel, ClientExecute) +#define FREERDP_RAIL_CHANNEL_CLIENT_ACTIVATE MakeMessageId(RailChannel, ClientActivate) +#define FREERDP_RAIL_CHANNEL_GET_SYSTEM_PARAM MakeMessageId(RailChannel, GetSystemParam) +#define FREERDP_RAIL_CHANNEL_CLIENT_SYSTEM_PARAM MakeMessageId(RailChannel, ClientSystemParam) +#define FREERDP_RAIL_CHANNEL_SERVER_SYSTEM_PARAM MakeMessageId(RailChannel, ClientSystemParam) +#define FREERDP_RAIL_CHANNEL_CLIENT_SYSTEM_COMMAND MakeMessageId(RailChannel, ClientSystemCommand) +#define FREERDP_RAIL_CHANNEL_CLIENT_HANDSHAKE MakeMessageId(RailChannel, ClientHandshake) +#define FREERDP_RAIL_CHANNEL_SERVER_HANDSHAKE MakeMessageId(RailChannel, ServerHandshake) +#define FREERDP_RAIL_CHANNEL_CLIENT_NOTIFY_EVENT MakeMessageId(RailChannel, ClientNotifyEvent) +#define FREERDP_RAIL_CHANNEL_CLIENT_WINDOW_MOVE MakeMessageId(RailChannel, ClientWindowMove) +#define FREERDP_RAIL_CHANNEL_SERVER_LOCAL_MOVE_SIZE MakeMessageId(RailChannel, ServerLocalMoveSize) +#define FREERDP_RAIL_CHANNEL_SERVER_MIN_MAX_INFO MakeMessageId(RailChannel, ServerMinMaxInfo) +#define FREERDP_RAIL_CHANNEL_CLIENT_INFORMATION MakeMessageId(RailChannel, ClientInformation) +#define FREERDP_RAIL_CHANNEL_CLIENT_SYSTEM_MENU MakeMessageId(RailChannel, ClientSystemMenu) +#define FREERDP_RAIL_CHANNEL_CLIENT_LANGUAGE_BAR_INFO \ + MakeMessageId(RailChannel, ClientLanguageBarInfo) +#define FREERDP_RAIL_CHANNEL_SERVER_LANGUAGE_BAR_INFO \ + MakeMessageId(RailChannel, ServerLanguageBarInfo) +#define FREERDP_RAIL_CHANNEL_SERVER_EXECUTE_RESULT MakeMessageId(RailChannel, ServerExecuteResult) +#define FREERDP_RAIL_CHANNEL_CLIENT_GET_APP_ID_REQUEST \ + MakeMessageId(RailChannel, ClientGetAppIdRequest) +#define FREERDP_RAIL_CHANNEL_SERVER_GET_APP_ID_RESPONSE \ + MakeMessageId(RailChannel, ServerGetAppIdResponse) +#define FREERDP_RAIL_CHANNEL_CLIENT_HANDSHAKE_EX MakeMessageId(RailChannel, ClientHandshakeEx) +#define FREERDP_RAIL_CHANNEL_SERVER_HANDSHAKE_EX MakeMessageId(RailChannel, ServerHandshakeEx) /** * MultiTouch Input Channel Extension (MS-RDPEDI) */ -#define RdpeiChannel_Class (Channel_Base + 5) +#define RdpeiChannel_Class (Channel_Base + 5) -#define RdpeiChannel_ServerReady 1 -#define RdpeiChannel_ClientReady 2 -#define RdpeiChannel_TouchEvent 3 -#define RdpeiChannel_SuspendTouch 4 -#define RdpeiChannel_ResumeTouch 5 -#define RdpeiChannel_DismissHoveringContact 6 +#define RdpeiChannel_ServerReady 1 +#define RdpeiChannel_ClientReady 2 +#define RdpeiChannel_TouchEvent 3 +#define RdpeiChannel_SuspendTouch 4 +#define RdpeiChannel_ResumeTouch 5 +#define RdpeiChannel_DismissHoveringContact 6 -#define FREERDP_RDPEI_CHANNEL_SERVER_READY MakeMessageId(RdpeiChannel, ServerReady) -#define FREERDP_RDPEI_CHANNEL_CLIENT_READY MakeMessageId(RdpeiChannel, ClientReady) -#define FREERDP_RDPEI_CHANNEL_TOUCH_EVENT MakeMessageId(RdpeiChannel, TouchEvent) -#define FREERDP_RDPEI_CHANNEL_SUSPEND_TOUCH MakeMessageId(RdpeiChannel, SuspendTouch) -#define FREERDP_RDPEI_CHANNEL_RESUME_TOUCH MakeMessageId(RdpeiChannel, ResumeTouch) -#define FREERDP_RDPEI_CHANNEL_DISMISS_HOVERING_CONTACT MakeMessageId(RdpeiChannel, DismissHoveringContact) +#define FREERDP_RDPEI_CHANNEL_SERVER_READY MakeMessageId(RdpeiChannel, ServerReady) +#define FREERDP_RDPEI_CHANNEL_CLIENT_READY MakeMessageId(RdpeiChannel, ClientReady) +#define FREERDP_RDPEI_CHANNEL_TOUCH_EVENT MakeMessageId(RdpeiChannel, TouchEvent) +#define FREERDP_RDPEI_CHANNEL_SUSPEND_TOUCH MakeMessageId(RdpeiChannel, SuspendTouch) +#define FREERDP_RDPEI_CHANNEL_RESUME_TOUCH MakeMessageId(RdpeiChannel, ResumeTouch) +#define FREERDP_RDPEI_CHANNEL_DISMISS_HOVERING_CONTACT \ + MakeMessageId(RdpeiChannel, DismissHoveringContact) #endif /* FREERDP_CORE_MESSAGE_H */ - diff --git a/include/freerdp/metrics.h b/include/freerdp/metrics.h index 8706aa31d..6d6b7d40a 100644 --- a/include/freerdp/metrics.h +++ b/include/freerdp/metrics.h @@ -32,17 +32,18 @@ struct rdp_metrics }; #ifdef __cplusplus - extern "C" { +extern "C" +{ #endif -FREERDP_API double metrics_write_bytes(rdpMetrics* metrics, UINT32 UncompressedBytes, UINT32 CompressedBytes); + FREERDP_API double metrics_write_bytes(rdpMetrics* metrics, UINT32 UncompressedBytes, + UINT32 CompressedBytes); -FREERDP_API rdpMetrics* metrics_new(rdpContext* context); -FREERDP_API void metrics_free(rdpMetrics* metrics); + FREERDP_API rdpMetrics* metrics_new(rdpContext* context); + FREERDP_API void metrics_free(rdpMetrics* metrics); #ifdef __cplusplus - } +} #endif #endif /* FREERDP_METRICS_H */ - diff --git a/include/freerdp/peer.h b/include/freerdp/peer.h index b231e9943..e3b9c3bf8 100644 --- a/include/freerdp/peer.h +++ b/include/freerdp/peer.h @@ -30,15 +30,14 @@ #include #include - typedef BOOL (*psPeerContextNew)(freerdp_peer* peer, rdpContext* context); typedef void (*psPeerContextFree)(freerdp_peer* peer, rdpContext* context); typedef BOOL (*psPeerInitialize)(freerdp_peer* peer); typedef BOOL (*psPeerGetFileDescriptor)(freerdp_peer* peer, void** rfds, int* rcount); -typedef HANDLE(*psPeerGetEventHandle)(freerdp_peer* peer); +typedef HANDLE (*psPeerGetEventHandle)(freerdp_peer* peer); typedef DWORD (*psPeerGetEventHandles)(freerdp_peer* peer, HANDLE* events, DWORD count); -typedef HANDLE(*psPeerGetReceiveEventHandle)(freerdp_peer* peer); +typedef HANDLE (*psPeerGetReceiveEventHandle)(freerdp_peer* peer); typedef BOOL (*psPeerCheckFileDescriptor)(freerdp_peer* peer); typedef BOOL (*psPeerIsWriteBlocked)(freerdp_peer* peer); typedef int (*psPeerDrainOutputBuffer)(freerdp_peer* peer); @@ -55,30 +54,29 @@ typedef BOOL (*psPeerClientCapabilities)(freerdp_peer* peer); typedef int (*psPeerSendChannelData)(freerdp_peer* peer, UINT16 channelId, const BYTE* data, int size); typedef int (*psPeerReceiveChannelData)(freerdp_peer* peer, UINT16 channelId, const BYTE* data, - int size, - int flags, int totalSize); + int size, int flags, int totalSize); -typedef HANDLE(*psPeerVirtualChannelOpen)(freerdp_peer* peer, const char* name, UINT32 flags); +typedef HANDLE (*psPeerVirtualChannelOpen)(freerdp_peer* peer, const char* name, UINT32 flags); typedef BOOL (*psPeerVirtualChannelClose)(freerdp_peer* peer, HANDLE hChannel); typedef int (*psPeerVirtualChannelRead)(freerdp_peer* peer, HANDLE hChannel, BYTE* buffer, UINT32 length); typedef int (*psPeerVirtualChannelWrite)(freerdp_peer* peer, HANDLE hChannel, BYTE* buffer, - UINT32 length); + UINT32 length); typedef void* (*psPeerVirtualChannelGetData)(freerdp_peer* peer, HANDLE hChannel); typedef int (*psPeerVirtualChannelSetData)(freerdp_peer* peer, HANDLE hChannel, void* data); /** @brief the result of the license callback */ typedef enum { - LICENSE_CB_INTERNAL_ERROR, /** an internal error happened in the callback */ - LICENSE_CB_ABORT, /** licensing process failed, abort the connection */ - LICENSE_CB_IN_PROGRESS, /** incoming packet has been treated, we're waiting for further packets to complete the workflow */ - LICENSE_CB_COMPLETED /** the licensing workflow has completed, go to next step */ + LICENSE_CB_INTERNAL_ERROR, /** an internal error happened in the callback */ + LICENSE_CB_ABORT, /** licensing process failed, abort the connection */ + LICENSE_CB_IN_PROGRESS, /** incoming packet has been treated, we're waiting for further packets + to complete the workflow */ + LICENSE_CB_COMPLETED /** the licensing workflow has completed, go to next step */ } LicenseCallbackResult; typedef LicenseCallbackResult (*psPeerLicenseCallback)(freerdp_peer* peer, wStream* s); - struct rdp_freerdp_peer { rdpContext* context; @@ -138,14 +136,15 @@ struct rdp_freerdp_peer }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API BOOL freerdp_peer_context_new(freerdp_peer* client); -FREERDP_API void freerdp_peer_context_free(freerdp_peer* client); + FREERDP_API BOOL freerdp_peer_context_new(freerdp_peer* client); + FREERDP_API void freerdp_peer_context_free(freerdp_peer* client); -FREERDP_API freerdp_peer* freerdp_peer_new(int sockfd); -FREERDP_API void freerdp_peer_free(freerdp_peer* client); + FREERDP_API freerdp_peer* freerdp_peer_new(int sockfd); + FREERDP_API void freerdp_peer_free(freerdp_peer* client); #ifdef __cplusplus } diff --git a/include/freerdp/pointer.h b/include/freerdp/pointer.h index 6e2047eb7..0a788761e 100644 --- a/include/freerdp/pointer.h +++ b/include/freerdp/pointer.h @@ -22,14 +22,14 @@ #include -#define PTR_MSG_TYPE_SYSTEM 0x0001 -#define PTR_MSG_TYPE_POSITION 0x0003 -#define PTR_MSG_TYPE_COLOR 0x0006 -#define PTR_MSG_TYPE_CACHED 0x0007 -#define PTR_MSG_TYPE_POINTER 0x0008 +#define PTR_MSG_TYPE_SYSTEM 0x0001 +#define PTR_MSG_TYPE_POSITION 0x0003 +#define PTR_MSG_TYPE_COLOR 0x0006 +#define PTR_MSG_TYPE_CACHED 0x0007 +#define PTR_MSG_TYPE_POINTER 0x0008 -#define SYSPTR_NULL 0x00000000 -#define SYSPTR_DEFAULT 0x00007F00 +#define SYSPTR_NULL 0x00000000 +#define SYSPTR_DEFAULT 0x00007F00 struct _POINTER_POSITION_UPDATE { @@ -73,26 +73,22 @@ typedef struct _POINTER_CACHED_UPDATE POINTER_CACHED_UPDATE; typedef BOOL (*pPointerPosition)(rdpContext* context, const POINTER_POSITION_UPDATE* pointer_position); -typedef BOOL (*pPointerSystem)(rdpContext* context, - const POINTER_SYSTEM_UPDATE* pointer_system); -typedef BOOL (*pPointerColor)(rdpContext* context, - const POINTER_COLOR_UPDATE* pointer_color); -typedef BOOL (*pPointerNew)(rdpContext* context, - const POINTER_NEW_UPDATE* pointer_new); -typedef BOOL (*pPointerCached)(rdpContext* context, - const POINTER_CACHED_UPDATE* pointer_cached); +typedef BOOL (*pPointerSystem)(rdpContext* context, const POINTER_SYSTEM_UPDATE* pointer_system); +typedef BOOL (*pPointerColor)(rdpContext* context, const POINTER_COLOR_UPDATE* pointer_color); +typedef BOOL (*pPointerNew)(rdpContext* context, const POINTER_NEW_UPDATE* pointer_new); +typedef BOOL (*pPointerCached)(rdpContext* context, const POINTER_CACHED_UPDATE* pointer_cached); struct rdp_pointer_update { - rdpContext* context; /* 0 */ + rdpContext* context; /* 0 */ UINT32 paddingA[16 - 1]; /* 1 */ pPointerPosition PointerPosition; /* 16 */ - pPointerSystem PointerSystem; /* 17 */ - pPointerColor PointerColor; /* 18 */ - pPointerNew PointerNew; /* 19 */ - pPointerCached PointerCached; /* 20 */ - UINT32 paddingB[32 - 21]; /* 21 */ + pPointerSystem PointerSystem; /* 17 */ + pPointerColor PointerColor; /* 18 */ + pPointerNew PointerNew; /* 19 */ + pPointerCached PointerCached; /* 20 */ + UINT32 paddingB[32 - 21]; /* 21 */ }; typedef struct rdp_pointer_update rdpPointerUpdate; diff --git a/include/freerdp/primary.h b/include/freerdp/primary.h index a1f810fdb..1b66a8550 100644 --- a/include/freerdp/primary.h +++ b/include/freerdp/primary.h @@ -46,8 +46,8 @@ struct _GLYPH_DATA_V2 }; typedef struct _GLYPH_DATA_V2 GLYPH_DATA_V2; -#define BACKMODE_TRANSPARENT 0x0001 -#define BACKMODE_OPAQUE 0x0002 +#define BACKMODE_TRANSPARENT 0x0001 +#define BACKMODE_OPAQUE 0x0002 struct rdp_bounds { @@ -441,16 +441,11 @@ typedef struct _ELLIPSE_CB_ORDER ELLIPSE_CB_ORDER; typedef BOOL (*pDstBlt)(rdpContext* context, const DSTBLT_ORDER* dstblt); typedef BOOL (*pPatBlt)(rdpContext* context, PATBLT_ORDER* patblt); typedef BOOL (*pScrBlt)(rdpContext* context, const SCRBLT_ORDER* scrblt); -typedef BOOL (*pOpaqueRect)(rdpContext* context, - const OPAQUE_RECT_ORDER* opaque_rect); -typedef BOOL (*pDrawNineGrid)(rdpContext* context, - const DRAW_NINE_GRID_ORDER* draw_nine_grid); -typedef BOOL (*pMultiDstBlt)(rdpContext* context, - const MULTI_DSTBLT_ORDER* multi_dstblt); -typedef BOOL (*pMultiPatBlt)(rdpContext* context, - const MULTI_PATBLT_ORDER* multi_patblt); -typedef BOOL (*pMultiScrBlt)(rdpContext* context, - const MULTI_SCRBLT_ORDER* multi_scrblt); +typedef BOOL (*pOpaqueRect)(rdpContext* context, const OPAQUE_RECT_ORDER* opaque_rect); +typedef BOOL (*pDrawNineGrid)(rdpContext* context, const DRAW_NINE_GRID_ORDER* draw_nine_grid); +typedef BOOL (*pMultiDstBlt)(rdpContext* context, const MULTI_DSTBLT_ORDER* multi_dstblt); +typedef BOOL (*pMultiPatBlt)(rdpContext* context, const MULTI_PATBLT_ORDER* multi_patblt); +typedef BOOL (*pMultiScrBlt)(rdpContext* context, const MULTI_SCRBLT_ORDER* multi_scrblt); typedef BOOL (*pMultiOpaqueRect)(rdpContext* context, const MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect); typedef BOOL (*pMultiDrawNineGrid)(rdpContext* context, @@ -459,50 +454,43 @@ typedef BOOL (*pLineTo)(rdpContext* context, const LINE_TO_ORDER* line_to); typedef BOOL (*pPolyline)(rdpContext* context, const POLYLINE_ORDER* polyline); typedef BOOL (*pMemBlt)(rdpContext* context, MEMBLT_ORDER* memblt); typedef BOOL (*pMem3Blt)(rdpContext* context, MEM3BLT_ORDER* memblt); -typedef BOOL (*pSaveBitmap)(rdpContext* context, - const SAVE_BITMAP_ORDER* save_bitmap); -typedef BOOL (*pGlyphIndex)(rdpContext* context, - GLYPH_INDEX_ORDER* glyph_index); -typedef BOOL (*pFastIndex)(rdpContext* context, - const FAST_INDEX_ORDER* fast_index); -typedef BOOL (*pFastGlyph)(rdpContext* context, - const FAST_GLYPH_ORDER* fast_glyph); -typedef BOOL (*pPolygonSC)(rdpContext* context, - const POLYGON_SC_ORDER* polygon_sc); +typedef BOOL (*pSaveBitmap)(rdpContext* context, const SAVE_BITMAP_ORDER* save_bitmap); +typedef BOOL (*pGlyphIndex)(rdpContext* context, GLYPH_INDEX_ORDER* glyph_index); +typedef BOOL (*pFastIndex)(rdpContext* context, const FAST_INDEX_ORDER* fast_index); +typedef BOOL (*pFastGlyph)(rdpContext* context, const FAST_GLYPH_ORDER* fast_glyph); +typedef BOOL (*pPolygonSC)(rdpContext* context, const POLYGON_SC_ORDER* polygon_sc); typedef BOOL (*pPolygonCB)(rdpContext* context, POLYGON_CB_ORDER* polygon_cb); -typedef BOOL (*pEllipseSC)(rdpContext* context, - const ELLIPSE_SC_ORDER* ellipse_sc); -typedef BOOL (*pEllipseCB)(rdpContext* context, - const ELLIPSE_CB_ORDER* ellipse_cb); +typedef BOOL (*pEllipseSC)(rdpContext* context, const ELLIPSE_SC_ORDER* ellipse_sc); +typedef BOOL (*pEllipseCB)(rdpContext* context, const ELLIPSE_CB_ORDER* ellipse_cb); struct rdp_primary_update { - rdpContext* context; /* 0 */ + rdpContext* context; /* 0 */ UINT32 paddingA[16 - 1]; /* 1 */ - pDstBlt DstBlt; /* 16 */ - pPatBlt PatBlt; /* 17 */ - pScrBlt ScrBlt; /* 18 */ - pOpaqueRect OpaqueRect; /* 19 */ - pDrawNineGrid DrawNineGrid; /* 20 */ - pMultiDstBlt MultiDstBlt; /* 21 */ - pMultiPatBlt MultiPatBlt; /* 22 */ - pMultiScrBlt MultiScrBlt; /* 23 */ - pMultiOpaqueRect MultiOpaqueRect; /* 24 */ + pDstBlt DstBlt; /* 16 */ + pPatBlt PatBlt; /* 17 */ + pScrBlt ScrBlt; /* 18 */ + pOpaqueRect OpaqueRect; /* 19 */ + pDrawNineGrid DrawNineGrid; /* 20 */ + pMultiDstBlt MultiDstBlt; /* 21 */ + pMultiPatBlt MultiPatBlt; /* 22 */ + pMultiScrBlt MultiScrBlt; /* 23 */ + pMultiOpaqueRect MultiOpaqueRect; /* 24 */ pMultiDrawNineGrid MultiDrawNineGrid; /* 25 */ - pLineTo LineTo; /* 26 */ - pPolyline Polyline; /* 27 */ - pMemBlt MemBlt; /* 28 */ - pMem3Blt Mem3Blt; /* 29 */ - pSaveBitmap SaveBitmap; /* 30 */ - pGlyphIndex GlyphIndex; /* 31 */ - pFastIndex FastIndex; /* 32 */ - pFastGlyph FastGlyph; /* 33 */ - pPolygonSC PolygonSC; /* 34 */ - pPolygonCB PolygonCB; /* 35 */ - pEllipseSC EllipseSC; /* 36 */ - pEllipseCB EllipseCB; /* 37 */ - UINT32 paddingB[48 - 38]; /* 38 */ + pLineTo LineTo; /* 26 */ + pPolyline Polyline; /* 27 */ + pMemBlt MemBlt; /* 28 */ + pMem3Blt Mem3Blt; /* 29 */ + pSaveBitmap SaveBitmap; /* 30 */ + pGlyphIndex GlyphIndex; /* 31 */ + pFastIndex FastIndex; /* 32 */ + pFastGlyph FastGlyph; /* 33 */ + pPolygonSC PolygonSC; /* 34 */ + pPolygonCB PolygonCB; /* 35 */ + pEllipseSC EllipseSC; /* 36 */ + pEllipseCB EllipseCB; /* 37 */ + UINT32 paddingB[48 - 38]; /* 38 */ /* internal */ diff --git a/include/freerdp/primitives.h b/include/freerdp/primitives.h index ee29e7f40..4c87784d7 100644 --- a/include/freerdp/primitives.h +++ b/include/freerdp/primitives.h @@ -14,7 +14,7 @@ */ #ifdef __GNUC__ -# pragma once +#pragma once #endif #ifndef FREERDP_PRIMITIVES_H @@ -26,42 +26,42 @@ #include -typedef INT32 pstatus_t; /* match IppStatus. */ -#define PRIMITIVES_SUCCESS (0) /* match ippStsNoErr */ +typedef INT32 pstatus_t; /* match IppStatus. */ +#define PRIMITIVES_SUCCESS (0) /* match ippStsNoErr */ /* Simple macro for address of an x,y location in 2d 4-byte memory block */ #define PIXMAP4_ADDR(_dst_, _x_, _y_, _span_) \ - ((void *) (((BYTE *) (_dst_)) + (((_x_) + (_y_)*(_span_)) << 2))) + ((void*)(((BYTE*)(_dst_)) + (((_x_) + (_y_) * (_span_)) << 2))) -#define PRIM_X86_MMX_AVAILABLE (1U<<0) -#define PRIM_X86_3DNOW_AVAILABLE (1U<<1) -#define PRIM_X86_3DNOW_PREFETCH_AVAILABLE (1U<<2) -#define PRIM_X86_SSE_AVAILABLE (1U<<3) -#define PRIM_X86_SSE2_AVAILABLE (1U<<4) -#define PRIM_X86_SSE3_AVAILABLE (1U<<5) -#define PRIM_X86_SSSE3_AVAILABLE (1U<<6) -#define PRIM_X86_SSE41_AVAILABLE (1U<<7) -#define PRIM_X86_SSE42_AVAILABLE (1U<<8) -#define PRIM_X86_AVX_AVAILABLE (1U<<9) -#define PRIM_X86_FMA_AVAILABLE (1U<<10) -#define PRIM_X86_AVX_AES_AVAILABLE (1U<<11) -#define PRIM_X86_AVX2_AVAILABLE (1U<<12) +#define PRIM_X86_MMX_AVAILABLE (1U << 0) +#define PRIM_X86_3DNOW_AVAILABLE (1U << 1) +#define PRIM_X86_3DNOW_PREFETCH_AVAILABLE (1U << 2) +#define PRIM_X86_SSE_AVAILABLE (1U << 3) +#define PRIM_X86_SSE2_AVAILABLE (1U << 4) +#define PRIM_X86_SSE3_AVAILABLE (1U << 5) +#define PRIM_X86_SSSE3_AVAILABLE (1U << 6) +#define PRIM_X86_SSE41_AVAILABLE (1U << 7) +#define PRIM_X86_SSE42_AVAILABLE (1U << 8) +#define PRIM_X86_AVX_AVAILABLE (1U << 9) +#define PRIM_X86_FMA_AVAILABLE (1U << 10) +#define PRIM_X86_AVX_AES_AVAILABLE (1U << 11) +#define PRIM_X86_AVX2_AVAILABLE (1U << 12) -#define PRIM_ARM_VFP1_AVAILABLE (1U<<0) -#define PRIM_ARM_VFP2_AVAILABLE (1U<<1) -#define PRIM_ARM_VFP3_AVAILABLE (1U<<2) -#define PRIM_ARM_VFP4_AVAILABLE (1U<<3) -#define PRIM_ARM_FPA_AVAILABLE (1U<<4) -#define PRIM_ARM_FPE_AVAILABLE (1U<<5) -#define PRIM_ARM_IWMMXT_AVAILABLE (1U<<6) -#define PRIM_ARM_NEON_AVAILABLE (1U<<7) +#define PRIM_ARM_VFP1_AVAILABLE (1U << 0) +#define PRIM_ARM_VFP2_AVAILABLE (1U << 1) +#define PRIM_ARM_VFP3_AVAILABLE (1U << 2) +#define PRIM_ARM_VFP4_AVAILABLE (1U << 3) +#define PRIM_ARM_FPA_AVAILABLE (1U << 4) +#define PRIM_ARM_FPE_AVAILABLE (1U << 5) +#define PRIM_ARM_IWMMXT_AVAILABLE (1U << 6) +#define PRIM_ARM_NEON_AVAILABLE (1U << 7) /* Structures compatible with IPP */ typedef struct { UINT32 width; UINT32 height; -} prim_size_t; /* like IppiSize */ +} prim_size_t; /* like IppiSize */ typedef enum { @@ -71,160 +71,80 @@ typedef enum } avc444_frame_type; /* Function prototypes for all of the supported primitives. */ -typedef pstatus_t (*__copy_t)( - const void* pSrc, - void* pDst, - INT32 bytes); -typedef pstatus_t (*__copy_8u_t)( - const BYTE* pSrc, - BYTE* pDst, - INT32 len); -typedef pstatus_t (*__copy_8u_AC4r_t)( - const BYTE* pSrc, - INT32 srcStep, /* bytes */ - BYTE* pDst, - INT32 dstStep, /* bytes */ - INT32 width, INT32 height); /* pixels */ -typedef pstatus_t (*__set_8u_t)( - BYTE val, - BYTE* pDst, - UINT32 len); -typedef pstatus_t (*__set_32s_t)( - INT32 val, - INT32* pDst, - UINT32 len); -typedef pstatus_t (*__set_32u_t)( - UINT32 val, - UINT32* pDst, - UINT32 len); -typedef pstatus_t (*__zero_t)( - void* pDst, - size_t bytes); -typedef pstatus_t (*__alphaComp_argb_t)( - const BYTE* pSrc1, UINT32 src1Step, - const BYTE* pSrc2, UINT32 src2Step, - BYTE* pDst, UINT32 dstStep, - UINT32 width, UINT32 height); -typedef pstatus_t (*__add_16s_t)( - const INT16* pSrc1, - const INT16* pSrc2, - INT16* pDst, - UINT32 len); -typedef pstatus_t (*__lShiftC_16s_t)( - const INT16* pSrc, - UINT32 val, - INT16* pSrcDst, - UINT32 len); -typedef pstatus_t (*__lShiftC_16u_t)( - const UINT16* pSrc, - UINT32 val, - UINT16* pSrcDst, - UINT32 len); -typedef pstatus_t (*__rShiftC_16s_t)( - const INT16* pSrc, - UINT32 val, - INT16* pSrcDst, - UINT32 len); -typedef pstatus_t (*__rShiftC_16u_t)( - const UINT16* pSrc, - UINT32 val, - UINT16* pSrcDst, - UINT32 len); -typedef pstatus_t (*__shiftC_16s_t)( - const INT16* pSrc, - INT32 val, - INT16* pSrcDst, - UINT32 len); -typedef pstatus_t (*__shiftC_16u_t)( - const UINT16* pSrc, - INT32 val, - UINT16* pSrcDst, - UINT32 len); -typedef pstatus_t (*__sign_16s_t)( - const INT16* pSrc, - INT16* pDst, - UINT32 len); -typedef pstatus_t (*__yCbCrToRGB_16s8u_P3AC4R_t)( - const INT16* pSrc[3], UINT32 srcStep, - BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, - const prim_size_t* roi); -typedef pstatus_t (*__yCbCrToRGB_16s16s_P3P3_t)( - const INT16* pSrc[3], INT32 srcStep, - INT16* pDst[3], INT32 dstStep, - const prim_size_t* roi); -typedef pstatus_t (*__RGBToYCbCr_16s16s_P3P3_t)( - const INT16* pSrc[3], INT32 srcStep, - INT16* pDst[3], INT32 dstStep, - const prim_size_t* roi); -typedef pstatus_t (*__RGBToRGB_16s8u_P3AC4R_t)( - const INT16* const pSrc[3], UINT32 srcStep, - BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, - const prim_size_t* roi); -typedef pstatus_t (*__YCoCgToRGB_8u_AC4R_t)( - const BYTE* pSrc, INT32 srcStep, - BYTE* pDst, UINT32 DstFormat, INT32 dstStep, - UINT32 width, UINT32 height, - UINT8 shift, - BOOL withAlpha); -typedef pstatus_t (*__RGB565ToARGB_16u32u_C3C4_t)( - const UINT16* pSrc, INT32 srcStep, - UINT32* pDst, INT32 dstStep, - UINT32 width, UINT32 height, - UINT32 format); -typedef pstatus_t (*__YUV420ToRGB_8u_P3AC4R_t)( - const BYTE* pSrc[3], const UINT32 srcStep[3], - BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, - const prim_size_t* roi); -typedef pstatus_t (*__YUV444ToRGB_8u_P3AC4R_t)( - const BYTE* pSrc[3], const UINT32 srcStep[3], - BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, - const prim_size_t* roi); -typedef pstatus_t (*__RGBToYUV420_8u_P3AC4R_t)( - const BYTE* pSrc, UINT32 SrcFormat, UINT32 srcStep, - BYTE* pDst[3], UINT32 dstStep[3], - const prim_size_t* roi); -typedef pstatus_t (*__RGBToYUV444_8u_P3AC4R_t)( - const BYTE* pSrc, UINT32 SrcFormat, UINT32 srcStep, - BYTE* pDst[3], UINT32 dstStep[3], - const prim_size_t* roi); -typedef pstatus_t (*__YUV420CombineToYUV444_t)( - avc444_frame_type type, - const BYTE* pSrc[3], const UINT32 srcStep[3], - UINT32 nWidth, UINT32 nHeight, - BYTE* pDst[3], const UINT32 dstStep[3], - const RECTANGLE_16* roi); -typedef pstatus_t (*__YUV444SplitToYUV420_t)( - const BYTE* pSrc[3], const UINT32 srcStep[3], - BYTE* pMainDst[3], const UINT32 dstMainStep[3], - BYTE* pAuxDst[3], const UINT32 srcAuxStep[3], - const prim_size_t* roi); -typedef pstatus_t (*__RGBToAVC444YUV_t)( - const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, - BYTE* pMainDst[3], const UINT32 dstMainStep[3], - BYTE* pAuxDst[3], const UINT32 dstAuxStep[3], - const prim_size_t* roi); -typedef pstatus_t (*__andC_32u_t)( - const UINT32* pSrc, - UINT32 val, - UINT32* pDst, - INT32 len); -typedef pstatus_t (*__orC_32u_t)( - const UINT32* pSrc, - UINT32 val, - UINT32* pDst, - INT32 len); +typedef pstatus_t (*__copy_t)(const void* pSrc, void* pDst, INT32 bytes); +typedef pstatus_t (*__copy_8u_t)(const BYTE* pSrc, BYTE* pDst, INT32 len); +typedef pstatus_t (*__copy_8u_AC4r_t)(const BYTE* pSrc, INT32 srcStep, /* bytes */ + BYTE* pDst, INT32 dstStep, /* bytes */ + INT32 width, INT32 height); /* pixels */ +typedef pstatus_t (*__set_8u_t)(BYTE val, BYTE* pDst, UINT32 len); +typedef pstatus_t (*__set_32s_t)(INT32 val, INT32* pDst, UINT32 len); +typedef pstatus_t (*__set_32u_t)(UINT32 val, UINT32* pDst, UINT32 len); +typedef pstatus_t (*__zero_t)(void* pDst, size_t bytes); +typedef pstatus_t (*__alphaComp_argb_t)(const BYTE* pSrc1, UINT32 src1Step, const BYTE* pSrc2, + UINT32 src2Step, BYTE* pDst, UINT32 dstStep, UINT32 width, + UINT32 height); +typedef pstatus_t (*__add_16s_t)(const INT16* pSrc1, const INT16* pSrc2, INT16* pDst, UINT32 len); +typedef pstatus_t (*__lShiftC_16s_t)(const INT16* pSrc, UINT32 val, INT16* pSrcDst, UINT32 len); +typedef pstatus_t (*__lShiftC_16u_t)(const UINT16* pSrc, UINT32 val, UINT16* pSrcDst, UINT32 len); +typedef pstatus_t (*__rShiftC_16s_t)(const INT16* pSrc, UINT32 val, INT16* pSrcDst, UINT32 len); +typedef pstatus_t (*__rShiftC_16u_t)(const UINT16* pSrc, UINT32 val, UINT16* pSrcDst, UINT32 len); +typedef pstatus_t (*__shiftC_16s_t)(const INT16* pSrc, INT32 val, INT16* pSrcDst, UINT32 len); +typedef pstatus_t (*__shiftC_16u_t)(const UINT16* pSrc, INT32 val, UINT16* pSrcDst, UINT32 len); +typedef pstatus_t (*__sign_16s_t)(const INT16* pSrc, INT16* pDst, UINT32 len); +typedef pstatus_t (*__yCbCrToRGB_16s8u_P3AC4R_t)(const INT16* pSrc[3], UINT32 srcStep, BYTE* pDst, + UINT32 dstStep, UINT32 DstFormat, + const prim_size_t* roi); +typedef pstatus_t (*__yCbCrToRGB_16s16s_P3P3_t)(const INT16* pSrc[3], INT32 srcStep, INT16* pDst[3], + INT32 dstStep, const prim_size_t* roi); +typedef pstatus_t (*__RGBToYCbCr_16s16s_P3P3_t)(const INT16* pSrc[3], INT32 srcStep, INT16* pDst[3], + INT32 dstStep, const prim_size_t* roi); +typedef pstatus_t (*__RGBToRGB_16s8u_P3AC4R_t)(const INT16* const pSrc[3], UINT32 srcStep, + BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, + const prim_size_t* roi); +typedef pstatus_t (*__YCoCgToRGB_8u_AC4R_t)(const BYTE* pSrc, INT32 srcStep, BYTE* pDst, + UINT32 DstFormat, INT32 dstStep, UINT32 width, + UINT32 height, UINT8 shift, BOOL withAlpha); +typedef pstatus_t (*__RGB565ToARGB_16u32u_C3C4_t)(const UINT16* pSrc, INT32 srcStep, UINT32* pDst, + INT32 dstStep, UINT32 width, UINT32 height, + UINT32 format); +typedef pstatus_t (*__YUV420ToRGB_8u_P3AC4R_t)(const BYTE* pSrc[3], const UINT32 srcStep[3], + BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, + const prim_size_t* roi); +typedef pstatus_t (*__YUV444ToRGB_8u_P3AC4R_t)(const BYTE* pSrc[3], const UINT32 srcStep[3], + BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, + const prim_size_t* roi); +typedef pstatus_t (*__RGBToYUV420_8u_P3AC4R_t)(const BYTE* pSrc, UINT32 SrcFormat, UINT32 srcStep, + BYTE* pDst[3], UINT32 dstStep[3], + const prim_size_t* roi); +typedef pstatus_t (*__RGBToYUV444_8u_P3AC4R_t)(const BYTE* pSrc, UINT32 SrcFormat, UINT32 srcStep, + BYTE* pDst[3], UINT32 dstStep[3], + const prim_size_t* roi); +typedef pstatus_t (*__YUV420CombineToYUV444_t)(avc444_frame_type type, const BYTE* pSrc[3], + const UINT32 srcStep[3], UINT32 nWidth, + UINT32 nHeight, BYTE* pDst[3], + const UINT32 dstStep[3], const RECTANGLE_16* roi); +typedef pstatus_t (*__YUV444SplitToYUV420_t)(const BYTE* pSrc[3], const UINT32 srcStep[3], + BYTE* pMainDst[3], const UINT32 dstMainStep[3], + BYTE* pAuxDst[3], const UINT32 srcAuxStep[3], + const prim_size_t* roi); +typedef pstatus_t (*__RGBToAVC444YUV_t)(const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, + BYTE* pMainDst[3], const UINT32 dstMainStep[3], + BYTE* pAuxDst[3], const UINT32 dstAuxStep[3], + const prim_size_t* roi); +typedef pstatus_t (*__andC_32u_t)(const UINT32* pSrc, UINT32 val, UINT32* pDst, INT32 len); +typedef pstatus_t (*__orC_32u_t)(const UINT32* pSrc, UINT32 val, UINT32* pDst, INT32 len); typedef struct { /* Memory-to-memory copy routines */ - __copy_t copy; /* memcpy/memmove, basically */ - __copy_8u_t copy_8u; /* more strongly typed */ - __copy_8u_AC4r_t copy_8u_AC4r; /* pixel copy function */ + __copy_t copy; /* memcpy/memmove, basically */ + __copy_8u_t copy_8u; /* more strongly typed */ + __copy_8u_AC4r_t copy_8u_AC4r; /* pixel copy function */ /* Memory setting routines */ - __set_8u_t set_8u; /* memset, basically */ + __set_8u_t set_8u; /* memset, basically */ __set_32s_t set_32s; __set_32u_t set_32u; - __zero_t zero; /* bzero or faster */ + __zero_t zero; /* bzero or faster */ /* Arithmetic functions */ __add_16s_t add_16s; /* And/or */ @@ -235,8 +155,8 @@ typedef struct __lShiftC_16u_t lShiftC_16u; __rShiftC_16s_t rShiftC_16s; __rShiftC_16u_t rShiftC_16u; - __shiftC_16s_t shiftC_16s; - __shiftC_16u_t shiftC_16u; + __shiftC_16s_t shiftC_16s; + __shiftC_16u_t shiftC_16u; /* Alpha Composition */ __alphaComp_argb_t alphaComp_argb; /* Sign */ @@ -258,11 +178,12 @@ typedef struct } primitives_t; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API primitives_t* primitives_get(void); -FREERDP_API primitives_t* primitives_get_generic(void); + FREERDP_API primitives_t* primitives_get(void); + FREERDP_API primitives_t* primitives_get_generic(void); #ifdef __cplusplus } diff --git a/include/freerdp/rail.h b/include/freerdp/rail.h index 400d00c2d..9abd8174f 100644 --- a/include/freerdp/rail.h +++ b/include/freerdp/rail.h @@ -27,96 +27,96 @@ #include /* DEPRECATED: RAIL PDU flags use the spec conformant naming with TS_ prefix */ -#define RAIL_EXEC_FLAG_EXPAND_WORKINGDIRECTORY 0x0001 -#define RAIL_EXEC_FLAG_TRANSLATE_FILES 0x0002 -#define RAIL_EXEC_FLAG_FILE 0x0004 -#define RAIL_EXEC_FLAG_EXPAND_ARGUMENTS 0x0008 +#define RAIL_EXEC_FLAG_EXPAND_WORKINGDIRECTORY 0x0001 +#define RAIL_EXEC_FLAG_TRANSLATE_FILES 0x0002 +#define RAIL_EXEC_FLAG_FILE 0x0004 +#define RAIL_EXEC_FLAG_EXPAND_ARGUMENTS 0x0008 /* RAIL PDU flags */ #define TS_RAIL_EXEC_FLAG_EXPAND_WORKINGDIRECTORY 0x0001 -#define TS_RAIL_EXEC_FLAG_TRANSLATE_FILES 0x0002 -#define TS_RAIL_EXEC_FLAG_FILE 0x0004 -#define TS_RAIL_EXEC_FLAG_EXPAND_ARGUMENTS 0x0008 -#define TS_RAIL_EXEC_FLAG_APP_USER_MODEL_ID 0x0010 +#define TS_RAIL_EXEC_FLAG_TRANSLATE_FILES 0x0002 +#define TS_RAIL_EXEC_FLAG_FILE 0x0004 +#define TS_RAIL_EXEC_FLAG_EXPAND_ARGUMENTS 0x0008 +#define TS_RAIL_EXEC_FLAG_APP_USER_MODEL_ID 0x0010 /* Notification Icon Balloon Tooltip */ -#define NIIF_NONE 0x00000000 -#define NIIF_INFO 0x00000001 -#define NIIF_WARNING 0x00000002 -#define NIIF_ERROR 0x00000003 -#define NIIF_NOSOUND 0x00000010 -#define NIIF_LARGE_ICON 0x00000020 +#define NIIF_NONE 0x00000000 +#define NIIF_INFO 0x00000001 +#define NIIF_WARNING 0x00000002 +#define NIIF_ERROR 0x00000003 +#define NIIF_NOSOUND 0x00000010 +#define NIIF_LARGE_ICON 0x00000020 /* Client Execute PDU Flags */ -#define RAIL_EXEC_FLAG_EXPAND_WORKING_DIRECTORY 0x0001 -#define RAIL_EXEC_FLAG_TRANSLATE_FILES 0x0002 -#define RAIL_EXEC_FLAG_FILE 0x0004 -#define RAIL_EXEC_FLAG_EXPAND_ARGUMENTS 0x0008 -#define RAIL_EXEC_FLAG_APP_USER_MODEL_ID 0x0010 +#define RAIL_EXEC_FLAG_EXPAND_WORKING_DIRECTORY 0x0001 +#define RAIL_EXEC_FLAG_TRANSLATE_FILES 0x0002 +#define RAIL_EXEC_FLAG_FILE 0x0004 +#define RAIL_EXEC_FLAG_EXPAND_ARGUMENTS 0x0008 +#define RAIL_EXEC_FLAG_APP_USER_MODEL_ID 0x0010 /* Server Execute Result PDU */ -#define RAIL_EXEC_S_OK 0x0000 -#define RAIL_EXEC_E_HOOK_NOT_LOADED 0x0001 -#define RAIL_EXEC_E_DECODE_FAILED 0x0002 -#define RAIL_EXEC_E_NOT_IN_ALLOWLIST 0x0003 -#define RAIL_EXEC_E_FILE_NOT_FOUND 0x0005 -#define RAIL_EXEC_E_FAIL 0x0006 -#define RAIL_EXEC_E_SESSION_LOCKED 0x0007 +#define RAIL_EXEC_S_OK 0x0000 +#define RAIL_EXEC_E_HOOK_NOT_LOADED 0x0001 +#define RAIL_EXEC_E_DECODE_FAILED 0x0002 +#define RAIL_EXEC_E_NOT_IN_ALLOWLIST 0x0003 +#define RAIL_EXEC_E_FILE_NOT_FOUND 0x0005 +#define RAIL_EXEC_E_FAIL 0x0006 +#define RAIL_EXEC_E_SESSION_LOCKED 0x0007 /* DEPRECATED: Server System Parameters Update PDU * use the spec conformant naming scheme from winpr/windows.h */ -#define SPI_SET_SCREEN_SAVE_ACTIVE 0x00000011 -#define SPI_SET_SCREEN_SAVE_SECURE 0x00000077 +#define SPI_SET_SCREEN_SAVE_ACTIVE 0x00000011 +#define SPI_SET_SCREEN_SAVE_SECURE 0x00000077 /*Bit mask values for SPI_ parameters*/ enum SPI_MASK { - SPI_MASK_SET_DRAG_FULL_WINDOWS = 0x00000001, - SPI_MASK_SET_KEYBOARD_CUES = 0x00000002, - SPI_MASK_SET_KEYBOARD_PREF = 0x00000004, - SPI_MASK_SET_MOUSE_BUTTON_SWAP = 0x00000008, - SPI_MASK_SET_WORK_AREA = 0x00000010, - SPI_MASK_DISPLAY_CHANGE = 0x00000020, - SPI_MASK_TASKBAR_POS = 0x00000040, - SPI_MASK_SET_HIGH_CONTRAST = 0x00000080, - SPI_MASK_SET_SCREEN_SAVE_ACTIVE = 0x00000100, - SPI_MASK_SET_SET_SCREEN_SAVE_SECURE = 0x00000200, - SPI_MASK_SET_CARET_WIDTH = 0x00000400, - SPI_MASK_SET_STICKY_KEYS = 0x00000800, - SPI_MASK_SET_TOGGLE_KEYS = 0x00001000, - SPI_MASK_SET_FILTER_KEYS = 0x00002000, + SPI_MASK_SET_DRAG_FULL_WINDOWS = 0x00000001, + SPI_MASK_SET_KEYBOARD_CUES = 0x00000002, + SPI_MASK_SET_KEYBOARD_PREF = 0x00000004, + SPI_MASK_SET_MOUSE_BUTTON_SWAP = 0x00000008, + SPI_MASK_SET_WORK_AREA = 0x00000010, + SPI_MASK_DISPLAY_CHANGE = 0x00000020, + SPI_MASK_TASKBAR_POS = 0x00000040, + SPI_MASK_SET_HIGH_CONTRAST = 0x00000080, + SPI_MASK_SET_SCREEN_SAVE_ACTIVE = 0x00000100, + SPI_MASK_SET_SET_SCREEN_SAVE_SECURE = 0x00000200, + SPI_MASK_SET_CARET_WIDTH = 0x00000400, + SPI_MASK_SET_STICKY_KEYS = 0x00000800, + SPI_MASK_SET_TOGGLE_KEYS = 0x00001000, + SPI_MASK_SET_FILTER_KEYS = 0x00002000, }; /* Client System Parameters Update PDU * some are defined in winuser.h (winpr/windows.h wrapper) */ -#define SPI_SET_DRAG_FULL_WINDOWS 0x00000025 -#define SPI_SET_KEYBOARD_CUES 0x0000100B -#define SPI_SET_KEYBOARD_PREF 0x00000045 -#define SPI_SET_MOUSE_BUTTON_SWAP 0x00000021 -#define SPI_SET_WORK_AREA 0x0000002F -#define SPI_DISPLAY_CHANGE 0x0000F001 -#define SPI_TASKBAR_POS 0x0000F000 -#define SPI_SET_HIGH_CONTRAST 0x00000043 +#define SPI_SET_DRAG_FULL_WINDOWS 0x00000025 +#define SPI_SET_KEYBOARD_CUES 0x0000100B +#define SPI_SET_KEYBOARD_PREF 0x00000045 +#define SPI_SET_MOUSE_BUTTON_SWAP 0x00000021 +#define SPI_SET_WORK_AREA 0x0000002F +#define SPI_DISPLAY_CHANGE 0x0000F001 +#define SPI_TASKBAR_POS 0x0000F000 +#define SPI_SET_HIGH_CONTRAST 0x00000043 /* Client System Command PDU */ -#define SC_SIZE 0xF000 -#define SC_MOVE 0xF010 -#define SC_MINIMIZE 0xF020 -#define SC_MAXIMIZE 0xF030 -#define SC_CLOSE 0xF060 -#define SC_KEYMENU 0xF100 -#define SC_RESTORE 0xF120 -#define SC_DEFAULT 0xF160 +#define SC_SIZE 0xF000 +#define SC_MOVE 0xF010 +#define SC_MINIMIZE 0xF020 +#define SC_MAXIMIZE 0xF030 +#define SC_CLOSE 0xF060 +#define SC_KEYMENU 0xF100 +#define SC_RESTORE 0xF120 +#define SC_DEFAULT 0xF160 /* Client Notify Event PDU */ #ifndef _WIN32 -#define NIN_SELECT 0x00000400 -#define NIN_KEYSELECT 0x00000401 -#define NIN_BALLOONSHOW 0x00000402 -#define NIN_BALLOONHIDE 0x00000403 -#define NIN_BALLOONTIMEOUT 0x00000404 +#define NIN_SELECT 0x00000400 +#define NIN_KEYSELECT 0x00000401 +#define NIN_BALLOONSHOW 0x00000402 +#define NIN_BALLOONHIDE 0x00000403 +#define NIN_BALLOONTIMEOUT 0x00000404 #define NIN_BALLOONUSERCLICK 0x00000405 #else #include @@ -125,126 +125,165 @@ enum SPI_MASK /* DEPRECATED: Client Information PDU * use the spec conformant naming scheme TS_ below */ -#define RAIL_CLIENTSTATUS_ALLOWLOCALMOVESIZE 0x00000001 -#define RAIL_CLIENTSTATUS_AUTORECONNECT 0x00000002 +#define RAIL_CLIENTSTATUS_ALLOWLOCALMOVESIZE 0x00000001 +#define RAIL_CLIENTSTATUS_AUTORECONNECT 0x00000002 /* Client Information PDU */ -#define TS_RAIL_CLIENTSTATUS_ALLOWLOCALMOVESIZE 0x00000001 -#define TS_RAIL_CLIENTSTATUS_AUTORECONNECT 0x00000002 -#define TS_RAIL_CLIENTSTATUS_ZORDER_SYNC 0x00000004 -#define TS_RAIL_CLIENTSTATUS_WINDOW_RESIZE_MARGIN_SUPPORTED 0x00000010 -#define TS_RAIL_CLIENTSTATUS_HIGH_DPI_ICONS_SUPPORTED 0x00000020 -#define TS_RAIL_CLIENTSTATUS_APPBAR_REMOTING_SUPPORTED 0x00000040 +#define TS_RAIL_CLIENTSTATUS_ALLOWLOCALMOVESIZE 0x00000001 +#define TS_RAIL_CLIENTSTATUS_AUTORECONNECT 0x00000002 +#define TS_RAIL_CLIENTSTATUS_ZORDER_SYNC 0x00000004 +#define TS_RAIL_CLIENTSTATUS_WINDOW_RESIZE_MARGIN_SUPPORTED 0x00000010 +#define TS_RAIL_CLIENTSTATUS_HIGH_DPI_ICONS_SUPPORTED 0x00000020 +#define TS_RAIL_CLIENTSTATUS_APPBAR_REMOTING_SUPPORTED 0x00000040 #define TS_RAIL_CLIENTSTATUS_POWER_DISPLAY_REQUEST_SUPPORTED 0x00000080 -#define TS_RAIL_CLIENTSTATUS_BIDIRECTIONAL_CLOAK_SUPPORTED 0x00000200 +#define TS_RAIL_CLIENTSTATUS_BIDIRECTIONAL_CLOAK_SUPPORTED 0x00000200 /* Server Move/Size Start PDU */ -#define RAIL_WMSZ_LEFT 0x0001 -#define RAIL_WMSZ_RIGHT 0x0002 -#define RAIL_WMSZ_TOP 0x0003 -#define RAIL_WMSZ_TOPLEFT 0x0004 -#define RAIL_WMSZ_TOPRIGHT 0x0005 -#define RAIL_WMSZ_BOTTOM 0x0006 -#define RAIL_WMSZ_BOTTOMLEFT 0x0007 -#define RAIL_WMSZ_BOTTOMRIGHT 0x0008 -#define RAIL_WMSZ_MOVE 0x0009 -#define RAIL_WMSZ_KEYMOVE 0x000A -#define RAIL_WMSZ_KEYSIZE 0x000B +#define RAIL_WMSZ_LEFT 0x0001 +#define RAIL_WMSZ_RIGHT 0x0002 +#define RAIL_WMSZ_TOP 0x0003 +#define RAIL_WMSZ_TOPLEFT 0x0004 +#define RAIL_WMSZ_TOPRIGHT 0x0005 +#define RAIL_WMSZ_BOTTOM 0x0006 +#define RAIL_WMSZ_BOTTOMLEFT 0x0007 +#define RAIL_WMSZ_BOTTOMRIGHT 0x0008 +#define RAIL_WMSZ_MOVE 0x0009 +#define RAIL_WMSZ_KEYMOVE 0x000A +#define RAIL_WMSZ_KEYSIZE 0x000B /* Language Bar Information PDU */ -#define TF_SFT_SHOWNORMAL 0x00000001 -#define TF_SFT_DOCK 0x00000002 -#define TF_SFT_MINIMIZED 0x00000004 -#define TF_SFT_HIDDEN 0x00000008 -#define TF_SFT_NOTRANSPARENCY 0x00000010 -#define TF_SFT_LOWTRANSPARENCY 0x00000020 -#define TF_SFT_HIGHTRANSPARENCY 0x00000040 -#define TF_SFT_LABELS 0x00000080 -#define TF_SFT_NOLABELS 0x00000100 -#define TF_SFT_EXTRAICONSONMINIMIZED 0x00000200 -#define TF_SFT_NOEXTRAICONSONMINIMIZED 0x00000400 -#define TF_SFT_DESKBAND 0x00000800 +#define TF_SFT_SHOWNORMAL 0x00000001 +#define TF_SFT_DOCK 0x00000002 +#define TF_SFT_MINIMIZED 0x00000004 +#define TF_SFT_HIDDEN 0x00000008 +#define TF_SFT_NOTRANSPARENCY 0x00000010 +#define TF_SFT_LOWTRANSPARENCY 0x00000020 +#define TF_SFT_HIGHTRANSPARENCY 0x00000040 +#define TF_SFT_LABELS 0x00000080 +#define TF_SFT_NOLABELS 0x00000100 +#define TF_SFT_EXTRAICONSONMINIMIZED 0x00000200 +#define TF_SFT_NOEXTRAICONSONMINIMIZED 0x00000400 +#define TF_SFT_DESKBAND 0x00000800 /* DEPRECATED: Extended Handshake Flags * use the spec conformant naming scheme TS_ below */ -#define RAIL_ORDER_HANDSHAKEEX_FLAGS_HIDEF 0x00000001 -#define RAIL_ORDER_HANDSHAKE_EX_FLAGS_EXTENDED_SPI_SUPPORTED 0x00000002 -#define RAIL_ORDER_HANDSHAKE_EX_FLAGS_SNAP_ARRANGE_SUPPORTED 0x00000004 +#define RAIL_ORDER_HANDSHAKEEX_FLAGS_HIDEF 0x00000001 +#define RAIL_ORDER_HANDSHAKE_EX_FLAGS_EXTENDED_SPI_SUPPORTED 0x00000002 +#define RAIL_ORDER_HANDSHAKE_EX_FLAGS_SNAP_ARRANGE_SUPPORTED 0x00000004 /* Extended Handshake Flags */ -#define TS_RAIL_ORDER_HANDSHAKEEX_FLAGS_HIDEF 0x00000001 -#define TS_RAIL_ORDER_HANDSHAKE_EX_FLAGS_EXTENDED_SPI_SUPPORTED 0x00000002 -#define TS_RAIL_ORDER_HANDSHAKE_EX_FLAGS_SNAP_ARRANGE_SUPPORTED 0x00000004 +#define TS_RAIL_ORDER_HANDSHAKEEX_FLAGS_HIDEF 0x00000001 +#define TS_RAIL_ORDER_HANDSHAKE_EX_FLAGS_EXTENDED_SPI_SUPPORTED 0x00000002 +#define TS_RAIL_ORDER_HANDSHAKE_EX_FLAGS_SNAP_ARRANGE_SUPPORTED 0x00000004 /* Language Profile Information Flags */ -#define TF_PROFILETYPE_INPUTPROCESSOR 0x00000001 -#define TF_PROFILETYPE_KEYBOARDLAYOUT 0x00000002 +#define TF_PROFILETYPE_INPUTPROCESSOR 0x00000001 +#define TF_PROFILETYPE_KEYBOARDLAYOUT 0x00000002 /* LanguageProfileCLSID and ProfileGUID */ #ifndef _WIN32 -#define GUID_NULL {0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} +#define GUID_NULL \ + { \ + 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 \ + } #else #include #endif -#define GUID_MSIME_JPN {0x03B5835F, 0xF03C, 0x411B, 0x9C, 0xE2, 0xAA, 0x23, 0xE1, 0x17, 0x1E, 0x36} -#define GUID_MSIME_KOR {0xA028AE76, 0x01B1, 0x46C2, 0x99, 0xC4, 0xAC, 0xD9, 0x85, 0x8A, 0xE0, 0x02} -#define GUID_CHSIME {0x81D4E9C9, 0x1D3B, 0x41BC, 0x9E, 0x6C, 0x4B, 0x40, 0xBF, 0x79, 0xE3, 0x5E} -#define GUID_CHTIME {0x531FDEBF, 0x9B4C, 0x4A43, 0xA2, 0xAA, 0x96, 0x0E, 0x8F, 0xCD, 0xC7, 0x32} -#define GUID_PROFILE_NEWPHONETIC {0xB2F9C502, 0x1742, 0x11D4, 0x97, 0x90, 0x00, 0x80, 0xC8, 0x82, 0x68, 0x7E} -#define GUID_PROFILE_CHANGJIE {0x4BDF9F03, 0xC7D3, 0x11D4, 0xB2, 0xAB, 0x00, 0x80, 0xC8, 0x82, 0x68, 0x7E} -#define GUID_PROFILE_QUICK {0x6024B45F, 0x5C54, 0x11D4, 0xB9, 0x21, 0x00, 0x80, 0xC8, 0x82, 0x68, 0x7E} -#define GUID_PROFILE_CANTONESE {0x0AEC109C, 0x7E96, 0x11D4, 0xB2, 0xEF, 0x00, 0x80, 0xC8, 0x82, 0x68, 0x7E} -#define GUID_PROFILE_PINYIN {0xF3BA9077, 0x6C7E, 0x11D4, 0x97, 0xFA, 0x00, 0x80, 0xC8, 0x82, 0x68, 0x7E} -#define GUID_PROFILE_SIMPLEFAST {0xFA550B04, 0x5AD7, 0x411F, 0xA5, 0xAC, 0xCA, 0x03, 0x8E, 0xC5, 0x15, 0xD7} -#define GUID_GUID_PROFILE_MSIME_JPN {0xA76C93D9, 0x5523, 0x4E90, 0xAA, 0xFA, 0x4D, 0xB1, 0x12, 0xF9, 0xAC, 0x76} -#define GUID_PROFILE_MSIME_KOR {0xB5FE1F02, 0xD5F2, 0x4445, 0x9C, 0x03, 0xC5, 0x68, 0xF2, 0x3C, 0x99, 0xA1} +#define GUID_MSIME_JPN \ + { \ + 0x03B5835F, 0xF03C, 0x411B, 0x9C, 0xE2, 0xAA, 0x23, 0xE1, 0x17, 0x1E, 0x36 \ + } +#define GUID_MSIME_KOR \ + { \ + 0xA028AE76, 0x01B1, 0x46C2, 0x99, 0xC4, 0xAC, 0xD9, 0x85, 0x8A, 0xE0, 0x02 \ + } +#define GUID_CHSIME \ + { \ + 0x81D4E9C9, 0x1D3B, 0x41BC, 0x9E, 0x6C, 0x4B, 0x40, 0xBF, 0x79, 0xE3, 0x5E \ + } +#define GUID_CHTIME \ + { \ + 0x531FDEBF, 0x9B4C, 0x4A43, 0xA2, 0xAA, 0x96, 0x0E, 0x8F, 0xCD, 0xC7, 0x32 \ + } +#define GUID_PROFILE_NEWPHONETIC \ + { \ + 0xB2F9C502, 0x1742, 0x11D4, 0x97, 0x90, 0x00, 0x80, 0xC8, 0x82, 0x68, 0x7E \ + } +#define GUID_PROFILE_CHANGJIE \ + { \ + 0x4BDF9F03, 0xC7D3, 0x11D4, 0xB2, 0xAB, 0x00, 0x80, 0xC8, 0x82, 0x68, 0x7E \ + } +#define GUID_PROFILE_QUICK \ + { \ + 0x6024B45F, 0x5C54, 0x11D4, 0xB9, 0x21, 0x00, 0x80, 0xC8, 0x82, 0x68, 0x7E \ + } +#define GUID_PROFILE_CANTONESE \ + { \ + 0x0AEC109C, 0x7E96, 0x11D4, 0xB2, 0xEF, 0x00, 0x80, 0xC8, 0x82, 0x68, 0x7E \ + } +#define GUID_PROFILE_PINYIN \ + { \ + 0xF3BA9077, 0x6C7E, 0x11D4, 0x97, 0xFA, 0x00, 0x80, 0xC8, 0x82, 0x68, 0x7E \ + } +#define GUID_PROFILE_SIMPLEFAST \ + { \ + 0xFA550B04, 0x5AD7, 0x411F, 0xA5, 0xAC, 0xCA, 0x03, 0x8E, 0xC5, 0x15, 0xD7 \ + } +#define GUID_GUID_PROFILE_MSIME_JPN \ + { \ + 0xA76C93D9, 0x5523, 0x4E90, 0xAA, 0xFA, 0x4D, 0xB1, 0x12, 0xF9, 0xAC, 0x76 \ + } +#define GUID_PROFILE_MSIME_KOR \ + { \ + 0xB5FE1F02, 0xD5F2, 0x4445, 0x9C, 0x03, 0xC5, 0x68, 0xF2, 0x3C, 0x99, 0xA1 \ + } /* ImeState */ -#define IME_STATE_CLOSED 0x00000000 -#define IME_STATE_OPEN 0x00000001 +#define IME_STATE_CLOSED 0x00000000 +#define IME_STATE_OPEN 0x00000001 /* ImeConvMode */ #ifndef _IME_CMODES_ -#define IME_CMODE_NATIVE 0x00000001 -#define IME_CMODE_KATAKANA 0x00000002 -#define IME_CMODE_FULLSHAPE 0x00000008 -#define IME_CMODE_ROMAN 0x00000010 -#define IME_CMODE_CHARCODE 0x00000020 -#define IME_CMODE_HANJACONVERT 0x00000040 -#define IME_CMODE_SOFTKBD 0x00000080 -#define IME_CMODE_NOCONVERSION 0x00000100 -#define IME_CMODE_EUDC 0x00000200 -#define IME_CMODE_SYMBOL 0x00000400 -#define IME_CMODE_FIXED 0x00000800 +#define IME_CMODE_NATIVE 0x00000001 +#define IME_CMODE_KATAKANA 0x00000002 +#define IME_CMODE_FULLSHAPE 0x00000008 +#define IME_CMODE_ROMAN 0x00000010 +#define IME_CMODE_CHARCODE 0x00000020 +#define IME_CMODE_HANJACONVERT 0x00000040 +#define IME_CMODE_SOFTKBD 0x00000080 +#define IME_CMODE_NOCONVERSION 0x00000100 +#define IME_CMODE_EUDC 0x00000200 +#define IME_CMODE_SYMBOL 0x00000400 +#define IME_CMODE_FIXED 0x00000800 #endif /* ImeSentenceMode */ #ifndef _IMM_ -#define IME_SMODE_NONE 0x00000000 -#define IME_SMODE_PLURALCASE 0x00000001 -#define IME_SMODE_SINGLECONVERT 0x00000002 -#define IME_SMODE_AUTOMATIC 0x00000004 -#define IME_SMODE_PHRASEPREDICT 0x00000008 -#define IME_SMODE_CONVERSATION 0x00000010 +#define IME_SMODE_NONE 0x00000000 +#define IME_SMODE_PLURALCASE 0x00000001 +#define IME_SMODE_SINGLECONVERT 0x00000002 +#define IME_SMODE_AUTOMATIC 0x00000004 +#define IME_SMODE_PHRASEPREDICT 0x00000008 +#define IME_SMODE_CONVERSATION 0x00000010 #endif /* KANAMode */ -#define KANA_MODE_OFF 0x00000000 -#define KANA_MODE_ON 0x00000001 +#define KANA_MODE_OFF 0x00000000 +#define KANA_MODE_ON 0x00000001 /* Taskbar */ -#define RAIL_TASKBAR_MSG_TAB_REGISTER 0x00000001 +#define RAIL_TASKBAR_MSG_TAB_REGISTER 0x00000001 #define RAIL_TASKBAR_MSG_TAB_UNREGISTER 0x00000002 -#define RAIL_TASKBAR_MSG_TAB_ORDER 0x00000003 -#define RAIL_TASKBAR_MSG_TAB_ACTIVE 0x00000004 +#define RAIL_TASKBAR_MSG_TAB_ORDER 0x00000003 +#define RAIL_TASKBAR_MSG_TAB_ACTIVE 0x00000004 #define RAIL_TASKBAR_MSG_TAB_PROPERTIES 0x00000005 /* Taskbar body */ -#define RAIL_TASKBAR_MSG_TAB_REGISTER 0x00000001 +#define RAIL_TASKBAR_MSG_TAB_REGISTER 0x00000001 #define RAIL_TASKBAR_MSG_TAB_UNREGISTER 0x00000002 -#define RAIL_TASKBAR_MSG_TAB_ORDER 0x00000003 -#define RAIL_TASKBAR_MSG_TAB_ACTIVE 0x00000004 +#define RAIL_TASKBAR_MSG_TAB_ORDER 0x00000003 +#define RAIL_TASKBAR_MSG_TAB_ACTIVE 0x00000004 #define RAIL_TASKBAR_MSG_TAB_PROPERTIES 0x00000005 struct _RAIL_UNICODE_STRING @@ -484,66 +523,66 @@ typedef struct _RAIL_GET_APPID_RESP_EX RAIL_GET_APPID_RESP_EX; * use the spec conformant naming scheme TS_ below */ -#define RDP_RAIL_ORDER_EXEC 0x0001 -#define RDP_RAIL_ORDER_ACTIVATE 0x0002 -#define RDP_RAIL_ORDER_SYSPARAM 0x0003 -#define RDP_RAIL_ORDER_SYSCOMMAND 0x0004 -#define RDP_RAIL_ORDER_HANDSHAKE 0x0005 -#define RDP_RAIL_ORDER_NOTIFY_EVENT 0x0006 -#define RDP_RAIL_ORDER_WINDOWMOVE 0x0008 -#define RDP_RAIL_ORDER_LOCALMOVESIZE 0x0009 -#define RDP_RAIL_ORDER_MINMAXINFO 0x000A -#define RDP_RAIL_ORDER_CLIENTSTATUS 0x000B -#define RDP_RAIL_ORDER_SYSMENU 0x000C -#define RDP_RAIL_ORDER_LANGBARINFO 0x000D -#define RDP_RAIL_ORDER_EXEC_RESULT 0x0080 -#define RDP_RAIL_ORDER_GET_APPID_REQ 0x000E -#define RDP_RAIL_ORDER_GET_APPID_RESP 0x000F -#define RDP_RAIL_ORDER_LANGUAGEIMEINFO 0x0011 -#define RDP_RAIL_ORDER_COMPARTMENTINFO 0x0012 -#define RDP_RAIL_ORDER_HANDSHAKE_EX 0x0013 -#define RDP_RAIL_ORDER_ZORDER_SYNC 0x0014 -#define RDP_RAIL_ORDER_CLOAK 0x0015 -#define RDP_RAIL_ORDER_POWER_DISPLAY_REQUEST 0x0016 -#define RDP_RAIL_ORDER_SNAP_ARRANGE 0x0017 -#define RDP_RAIL_ORDER_GET_APPID_RESP_EX 0x0018 +#define RDP_RAIL_ORDER_EXEC 0x0001 +#define RDP_RAIL_ORDER_ACTIVATE 0x0002 +#define RDP_RAIL_ORDER_SYSPARAM 0x0003 +#define RDP_RAIL_ORDER_SYSCOMMAND 0x0004 +#define RDP_RAIL_ORDER_HANDSHAKE 0x0005 +#define RDP_RAIL_ORDER_NOTIFY_EVENT 0x0006 +#define RDP_RAIL_ORDER_WINDOWMOVE 0x0008 +#define RDP_RAIL_ORDER_LOCALMOVESIZE 0x0009 +#define RDP_RAIL_ORDER_MINMAXINFO 0x000A +#define RDP_RAIL_ORDER_CLIENTSTATUS 0x000B +#define RDP_RAIL_ORDER_SYSMENU 0x000C +#define RDP_RAIL_ORDER_LANGBARINFO 0x000D +#define RDP_RAIL_ORDER_EXEC_RESULT 0x0080 +#define RDP_RAIL_ORDER_GET_APPID_REQ 0x000E +#define RDP_RAIL_ORDER_GET_APPID_RESP 0x000F +#define RDP_RAIL_ORDER_LANGUAGEIMEINFO 0x0011 +#define RDP_RAIL_ORDER_COMPARTMENTINFO 0x0012 +#define RDP_RAIL_ORDER_HANDSHAKE_EX 0x0013 +#define RDP_RAIL_ORDER_ZORDER_SYNC 0x0014 +#define RDP_RAIL_ORDER_CLOAK 0x0015 +#define RDP_RAIL_ORDER_POWER_DISPLAY_REQUEST 0x0016 +#define RDP_RAIL_ORDER_SNAP_ARRANGE 0x0017 +#define RDP_RAIL_ORDER_GET_APPID_RESP_EX 0x0018 /* RAIL Constants */ -#define TS_RAIL_ORDER_EXEC 0x0001 -#define TS_RAIL_ORDER_ACTIVATE 0x0002 -#define TS_RAIL_ORDER_SYSPARAM 0x0003 -#define TS_RAIL_ORDER_SYSCOMMAND 0x0004 -#define TS_RAIL_ORDER_HANDSHAKE 0x0005 -#define TS_RAIL_ORDER_NOTIFY_EVENT 0x0006 -#define TS_RAIL_ORDER_WINDOWMOVE 0x0008 -#define TS_RAIL_ORDER_LOCALMOVESIZE 0x0009 -#define TS_RAIL_ORDER_MINMAXINFO 0x000A -#define TS_RAIL_ORDER_CLIENTSTATUS 0x000B -#define TS_RAIL_ORDER_SYSMENU 0x000C -#define TS_RAIL_ORDER_LANGBARINFO 0x000D -#define TS_RAIL_ORDER_GET_APPID_REQ 0x000E -#define TS_RAIL_ORDER_GET_APPID_RESP 0x000F -#define TS_RAIL_ORDER_TASKBARINFO 0x0010 -#define TS_RAIL_ORDER_LANGUAGEIMEINFO 0x0011 -#define TS_RAIL_ORDER_COMPARTMENTINFO 0x0012 -#define TS_RAIL_ORDER_HANDSHAKE_EX 0x0013 -#define TS_RAIL_ORDER_ZORDER_SYNC 0x0014 -#define TS_RAIL_ORDER_CLOAK 0x0015 -#define TS_RAIL_ORDER_POWER_DISPLAY_REQUEST 0x0016 -#define TS_RAIL_ORDER_SNAP_ARRANGE 0x0017 -#define TS_RAIL_ORDER_GET_APPID_RESP_EX 0x0018 -#define TS_RAIL_ORDER_EXEC_RESULT 0x0080 +#define TS_RAIL_ORDER_EXEC 0x0001 +#define TS_RAIL_ORDER_ACTIVATE 0x0002 +#define TS_RAIL_ORDER_SYSPARAM 0x0003 +#define TS_RAIL_ORDER_SYSCOMMAND 0x0004 +#define TS_RAIL_ORDER_HANDSHAKE 0x0005 +#define TS_RAIL_ORDER_NOTIFY_EVENT 0x0006 +#define TS_RAIL_ORDER_WINDOWMOVE 0x0008 +#define TS_RAIL_ORDER_LOCALMOVESIZE 0x0009 +#define TS_RAIL_ORDER_MINMAXINFO 0x000A +#define TS_RAIL_ORDER_CLIENTSTATUS 0x000B +#define TS_RAIL_ORDER_SYSMENU 0x000C +#define TS_RAIL_ORDER_LANGBARINFO 0x000D +#define TS_RAIL_ORDER_GET_APPID_REQ 0x000E +#define TS_RAIL_ORDER_GET_APPID_RESP 0x000F +#define TS_RAIL_ORDER_TASKBARINFO 0x0010 +#define TS_RAIL_ORDER_LANGUAGEIMEINFO 0x0011 +#define TS_RAIL_ORDER_COMPARTMENTINFO 0x0012 +#define TS_RAIL_ORDER_HANDSHAKE_EX 0x0013 +#define TS_RAIL_ORDER_ZORDER_SYNC 0x0014 +#define TS_RAIL_ORDER_CLOAK 0x0015 +#define TS_RAIL_ORDER_POWER_DISPLAY_REQUEST 0x0016 +#define TS_RAIL_ORDER_SNAP_ARRANGE 0x0017 +#define TS_RAIL_ORDER_GET_APPID_RESP_EX 0x0018 +#define TS_RAIL_ORDER_EXEC_RESULT 0x0080 #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API BOOL rail_read_unicode_string(wStream* s, RAIL_UNICODE_STRING* unicode_string); + FREERDP_API BOOL rail_read_unicode_string(wStream* s, RAIL_UNICODE_STRING* unicode_string); #ifdef __cplusplus } #endif - #endif /* FREERDP_RAIL_GLOBAL_H */ diff --git a/include/freerdp/scancode.h b/include/freerdp/scancode.h index 8f3c5a3fa..226f711a5 100644 --- a/include/freerdp/scancode.h +++ b/include/freerdp/scancode.h @@ -24,188 +24,209 @@ /* @msdn{cc240584} says: * "... (a scancode is an 8-bit value specifying a key location on the keyboard). - * The server accepts a scancode value and translates it into the correct character depending on the language locale and keyboard layout used in the session." - * The 8-bit value is later called "keyCode" - * The extended flag is for all practical an important 9th bit with a strange encoding - not just a modifier. + * The server accepts a scancode value and translates it into the correct character depending on the + * language locale and keyboard layout used in the session." The 8-bit value is later called + * "keyCode" The extended flag is for all practical an important 9th bit with a strange encoding - + * not just a modifier. */ #define RDP_SCANCODE_CODE(_rdp_scancode) ((BYTE)(_rdp_scancode & 0xFF)) -#define RDP_SCANCODE_EXTENDED(_rdp_scancode) (((_rdp_scancode) & KBDEXT) ? TRUE : FALSE) -#define MAKE_RDP_SCANCODE(_code, _extended) (((_code) & 0xFF) | ((_extended) ? KBDEXT : 0)) +#define RDP_SCANCODE_EXTENDED(_rdp_scancode) (((_rdp_scancode)&KBDEXT) ? TRUE : FALSE) +#define MAKE_RDP_SCANCODE(_code, _extended) (((_code)&0xFF) | ((_extended) ? KBDEXT : 0)) /* Defines for known RDP_SCANCODE protocol values. - * Mostly the same as the PKBDLLHOOKSTRUCT scanCode, "A hardware scan code for the key", @msdn{ms644967}. - * Based @msdn{ms894073} US, @msdn{ms894072} UK, @msdn{ms892472} */ + * Mostly the same as the PKBDLLHOOKSTRUCT scanCode, "A hardware scan code for the key", + * @msdn{ms644967}. Based @msdn{ms894073} US, @msdn{ms894072} UK, @msdn{ms892472} */ -#define RDP_SCANCODE_UNKNOWN MAKE_RDP_SCANCODE(0x00, FALSE) +#define RDP_SCANCODE_UNKNOWN MAKE_RDP_SCANCODE(0x00, FALSE) -#define RDP_SCANCODE_ESCAPE MAKE_RDP_SCANCODE(0x01, FALSE) /* VK_ESCAPE */ -#define RDP_SCANCODE_KEY_1 MAKE_RDP_SCANCODE(0x02, FALSE) /* VK_KEY_1 */ -#define RDP_SCANCODE_KEY_2 MAKE_RDP_SCANCODE(0x03, FALSE) /* VK_KEY_2 */ -#define RDP_SCANCODE_KEY_3 MAKE_RDP_SCANCODE(0x04, FALSE) /* VK_KEY_3 */ -#define RDP_SCANCODE_KEY_4 MAKE_RDP_SCANCODE(0x05, FALSE) /* VK_KEY_4 */ -#define RDP_SCANCODE_KEY_5 MAKE_RDP_SCANCODE(0x06, FALSE) /* VK_KEY_5 */ -#define RDP_SCANCODE_KEY_6 MAKE_RDP_SCANCODE(0x07, FALSE) /* VK_KEY_6 */ -#define RDP_SCANCODE_KEY_7 MAKE_RDP_SCANCODE(0x08, FALSE) /* VK_KEY_7 */ -#define RDP_SCANCODE_KEY_8 MAKE_RDP_SCANCODE(0x09, FALSE) /* VK_KEY_8 */ -#define RDP_SCANCODE_KEY_9 MAKE_RDP_SCANCODE(0x0A, FALSE) /* VK_KEY_9 */ -#define RDP_SCANCODE_KEY_0 MAKE_RDP_SCANCODE(0x0B, FALSE) /* VK_KEY_0 */ -#define RDP_SCANCODE_OEM_MINUS MAKE_RDP_SCANCODE(0x0C, FALSE) /* VK_OEM_MINUS */ -#define RDP_SCANCODE_OEM_PLUS MAKE_RDP_SCANCODE(0x0D, FALSE) /* VK_OEM_PLUS */ -#define RDP_SCANCODE_BACKSPACE MAKE_RDP_SCANCODE(0x0E, FALSE) /* VK_BACK Backspace */ -#define RDP_SCANCODE_TAB MAKE_RDP_SCANCODE(0x0F, FALSE) /* VK_TAB */ -#define RDP_SCANCODE_KEY_Q MAKE_RDP_SCANCODE(0x10, FALSE) /* VK_KEY_Q */ -#define RDP_SCANCODE_KEY_W MAKE_RDP_SCANCODE(0x11, FALSE) /* VK_KEY_W */ -#define RDP_SCANCODE_KEY_E MAKE_RDP_SCANCODE(0x12, FALSE) /* VK_KEY_E */ -#define RDP_SCANCODE_KEY_R MAKE_RDP_SCANCODE(0x13, FALSE) /* VK_KEY_R */ -#define RDP_SCANCODE_KEY_T MAKE_RDP_SCANCODE(0x14, FALSE) /* VK_KEY_T */ -#define RDP_SCANCODE_KEY_Y MAKE_RDP_SCANCODE(0x15, FALSE) /* VK_KEY_Y */ -#define RDP_SCANCODE_KEY_U MAKE_RDP_SCANCODE(0x16, FALSE) /* VK_KEY_U */ -#define RDP_SCANCODE_KEY_I MAKE_RDP_SCANCODE(0x17, FALSE) /* VK_KEY_I */ -#define RDP_SCANCODE_KEY_O MAKE_RDP_SCANCODE(0x18, FALSE) /* VK_KEY_O */ -#define RDP_SCANCODE_KEY_P MAKE_RDP_SCANCODE(0x19, FALSE) /* VK_KEY_P */ -#define RDP_SCANCODE_OEM_4 MAKE_RDP_SCANCODE(0x1A, FALSE) /* VK_OEM_4 '[' on US */ -#define RDP_SCANCODE_OEM_6 MAKE_RDP_SCANCODE(0x1B, FALSE) /* VK_OEM_6 ']' on US */ -#define RDP_SCANCODE_RETURN MAKE_RDP_SCANCODE(0x1C, FALSE) /* VK_RETURN Normal Enter */ -#define RDP_SCANCODE_LCONTROL MAKE_RDP_SCANCODE(0x1D, FALSE) /* VK_LCONTROL */ -#define RDP_SCANCODE_KEY_A MAKE_RDP_SCANCODE(0x1E, FALSE) /* VK_KEY_A */ -#define RDP_SCANCODE_KEY_S MAKE_RDP_SCANCODE(0x1F, FALSE) /* VK_KEY_S */ -#define RDP_SCANCODE_KEY_D MAKE_RDP_SCANCODE(0x20, FALSE) /* VK_KEY_D */ -#define RDP_SCANCODE_KEY_F MAKE_RDP_SCANCODE(0x21, FALSE) /* VK_KEY_F */ -#define RDP_SCANCODE_KEY_G MAKE_RDP_SCANCODE(0x22, FALSE) /* VK_KEY_G */ -#define RDP_SCANCODE_KEY_H MAKE_RDP_SCANCODE(0x23, FALSE) /* VK_KEY_H */ -#define RDP_SCANCODE_KEY_J MAKE_RDP_SCANCODE(0x24, FALSE) /* VK_KEY_J */ -#define RDP_SCANCODE_KEY_K MAKE_RDP_SCANCODE(0x25, FALSE) /* VK_KEY_K */ -#define RDP_SCANCODE_KEY_L MAKE_RDP_SCANCODE(0x26, FALSE) /* VK_KEY_L */ -#define RDP_SCANCODE_OEM_1 MAKE_RDP_SCANCODE(0x27, FALSE) /* VK_OEM_1 ';' on US */ -#define RDP_SCANCODE_OEM_7 MAKE_RDP_SCANCODE(0x28, FALSE) /* VK_OEM_7 "'" on US */ -#define RDP_SCANCODE_OEM_3 MAKE_RDP_SCANCODE(0x29, FALSE) /* VK_OEM_3 Top left, '`' on US, JP DBE_SBCSCHAR */ -#define RDP_SCANCODE_LSHIFT MAKE_RDP_SCANCODE(0x2A, FALSE) /* VK_LSHIFT */ -#define RDP_SCANCODE_OEM_5 MAKE_RDP_SCANCODE(0x2B, FALSE) /* VK_OEM_5 Next to Enter, '\' on US */ -#define RDP_SCANCODE_KEY_Z MAKE_RDP_SCANCODE(0x2C, FALSE) /* VK_KEY_Z */ -#define RDP_SCANCODE_KEY_X MAKE_RDP_SCANCODE(0x2D, FALSE) /* VK_KEY_X */ -#define RDP_SCANCODE_KEY_C MAKE_RDP_SCANCODE(0x2E, FALSE) /* VK_KEY_C */ -#define RDP_SCANCODE_KEY_V MAKE_RDP_SCANCODE(0x2F, FALSE) /* VK_KEY_V */ -#define RDP_SCANCODE_KEY_B MAKE_RDP_SCANCODE(0x30, FALSE) /* VK_KEY_B */ -#define RDP_SCANCODE_KEY_N MAKE_RDP_SCANCODE(0x31, FALSE) /* VK_KEY_N */ -#define RDP_SCANCODE_KEY_M MAKE_RDP_SCANCODE(0x32, FALSE) /* VK_KEY_M */ -#define RDP_SCANCODE_OEM_COMMA MAKE_RDP_SCANCODE(0x33, FALSE) /* VK_OEM_COMMA */ -#define RDP_SCANCODE_OEM_PERIOD MAKE_RDP_SCANCODE(0x34, FALSE) /* VK_OEM_PERIOD */ -#define RDP_SCANCODE_OEM_2 MAKE_RDP_SCANCODE(0x35, FALSE) /* VK_OEM_2 '/' on US */ -#define RDP_SCANCODE_RSHIFT MAKE_RDP_SCANCODE(0x36, FALSE) /* VK_RSHIFT */ -#define RDP_SCANCODE_MULTIPLY MAKE_RDP_SCANCODE(0x37, FALSE) /* VK_MULTIPLY Numerical */ -#define RDP_SCANCODE_LMENU MAKE_RDP_SCANCODE(0x38, FALSE) /* VK_LMENU Left 'Alt' key */ -#define RDP_SCANCODE_SPACE MAKE_RDP_SCANCODE(0x39, FALSE) /* VK_SPACE */ -#define RDP_SCANCODE_CAPSLOCK MAKE_RDP_SCANCODE(0x3A, FALSE) /* VK_CAPITAL 'Caps Lock', JP DBE_ALPHANUMERIC */ -#define RDP_SCANCODE_F1 MAKE_RDP_SCANCODE(0x3B, FALSE) /* VK_F1 */ -#define RDP_SCANCODE_F2 MAKE_RDP_SCANCODE(0x3C, FALSE) /* VK_F2 */ -#define RDP_SCANCODE_F3 MAKE_RDP_SCANCODE(0x3D, FALSE) /* VK_F3 */ -#define RDP_SCANCODE_F4 MAKE_RDP_SCANCODE(0x3E, FALSE) /* VK_F4 */ -#define RDP_SCANCODE_F5 MAKE_RDP_SCANCODE(0x3F, FALSE) /* VK_F5 */ -#define RDP_SCANCODE_F6 MAKE_RDP_SCANCODE(0x40, FALSE) /* VK_F6 */ -#define RDP_SCANCODE_F7 MAKE_RDP_SCANCODE(0x41, FALSE) /* VK_F7 */ -#define RDP_SCANCODE_F8 MAKE_RDP_SCANCODE(0x42, FALSE) /* VK_F8 */ -#define RDP_SCANCODE_F9 MAKE_RDP_SCANCODE(0x43, FALSE) /* VK_F9 */ -#define RDP_SCANCODE_F10 MAKE_RDP_SCANCODE(0x44, FALSE) /* VK_F10 */ -#define RDP_SCANCODE_NUMLOCK MAKE_RDP_SCANCODE(0x45, FALSE) /* VK_NUMLOCK */ /* Note: when this seems to appear in PKBDLLHOOKSTRUCT it means Pause which must be sent as Ctrl + NumLock */ -#define RDP_SCANCODE_SCROLLLOCK MAKE_RDP_SCANCODE(0x46, FALSE) /* VK_SCROLL 'Scroll Lock', JP OEM_SCROLL */ -#define RDP_SCANCODE_NUMPAD7 MAKE_RDP_SCANCODE(0x47, FALSE) /* VK_NUMPAD7 */ -#define RDP_SCANCODE_NUMPAD8 MAKE_RDP_SCANCODE(0x48, FALSE) /* VK_NUMPAD8 */ -#define RDP_SCANCODE_NUMPAD9 MAKE_RDP_SCANCODE(0x49, FALSE) /* VK_NUMPAD9 */ -#define RDP_SCANCODE_SUBTRACT MAKE_RDP_SCANCODE(0x4A, FALSE) /* VK_SUBTRACT */ -#define RDP_SCANCODE_NUMPAD4 MAKE_RDP_SCANCODE(0x4B, FALSE) /* VK_NUMPAD4 */ -#define RDP_SCANCODE_NUMPAD5 MAKE_RDP_SCANCODE(0x4C, FALSE) /* VK_NUMPAD5 */ -#define RDP_SCANCODE_NUMPAD6 MAKE_RDP_SCANCODE(0x4D, FALSE) /* VK_NUMPAD6 */ -#define RDP_SCANCODE_ADD MAKE_RDP_SCANCODE(0x4E, FALSE) /* VK_ADD */ -#define RDP_SCANCODE_NUMPAD1 MAKE_RDP_SCANCODE(0x4F, FALSE) /* VK_NUMPAD1 */ -#define RDP_SCANCODE_NUMPAD2 MAKE_RDP_SCANCODE(0x50, FALSE) /* VK_NUMPAD2 */ -#define RDP_SCANCODE_NUMPAD3 MAKE_RDP_SCANCODE(0x51, FALSE) /* VK_NUMPAD3 */ -#define RDP_SCANCODE_NUMPAD0 MAKE_RDP_SCANCODE(0x52, FALSE) /* VK_NUMPAD0 */ -#define RDP_SCANCODE_DECIMAL MAKE_RDP_SCANCODE(0x53, FALSE) /* VK_DECIMAL Numerical, '.' on US */ -#define RDP_SCANCODE_SYSREQ MAKE_RDP_SCANCODE(0x54, FALSE) /* Sys Req */ -#define RDP_SCANCODE_OEM_102 MAKE_RDP_SCANCODE(0x56, FALSE) /* VK_OEM_102 Lower left '\' on US */ -#define RDP_SCANCODE_F11 MAKE_RDP_SCANCODE(0x57, FALSE) /* VK_F11 */ -#define RDP_SCANCODE_F12 MAKE_RDP_SCANCODE(0x58, FALSE) /* VK_F12 */ -#define RDP_SCANCODE_SLEEP MAKE_RDP_SCANCODE(0x5F, FALSE) /* VK_SLEEP OEM_8 on FR (undocumented?) */ -#define RDP_SCANCODE_ZOOM MAKE_RDP_SCANCODE(0x62, FALSE) /* VK_ZOOM (undocumented?) */ -#define RDP_SCANCODE_HELP MAKE_RDP_SCANCODE(0x63, FALSE) /* VK_HELP (undocumented?) */ +#define RDP_SCANCODE_ESCAPE MAKE_RDP_SCANCODE(0x01, FALSE) /* VK_ESCAPE */ +#define RDP_SCANCODE_KEY_1 MAKE_RDP_SCANCODE(0x02, FALSE) /* VK_KEY_1 */ +#define RDP_SCANCODE_KEY_2 MAKE_RDP_SCANCODE(0x03, FALSE) /* VK_KEY_2 */ +#define RDP_SCANCODE_KEY_3 MAKE_RDP_SCANCODE(0x04, FALSE) /* VK_KEY_3 */ +#define RDP_SCANCODE_KEY_4 MAKE_RDP_SCANCODE(0x05, FALSE) /* VK_KEY_4 */ +#define RDP_SCANCODE_KEY_5 MAKE_RDP_SCANCODE(0x06, FALSE) /* VK_KEY_5 */ +#define RDP_SCANCODE_KEY_6 MAKE_RDP_SCANCODE(0x07, FALSE) /* VK_KEY_6 */ +#define RDP_SCANCODE_KEY_7 MAKE_RDP_SCANCODE(0x08, FALSE) /* VK_KEY_7 */ +#define RDP_SCANCODE_KEY_8 MAKE_RDP_SCANCODE(0x09, FALSE) /* VK_KEY_8 */ +#define RDP_SCANCODE_KEY_9 MAKE_RDP_SCANCODE(0x0A, FALSE) /* VK_KEY_9 */ +#define RDP_SCANCODE_KEY_0 MAKE_RDP_SCANCODE(0x0B, FALSE) /* VK_KEY_0 */ +#define RDP_SCANCODE_OEM_MINUS MAKE_RDP_SCANCODE(0x0C, FALSE) /* VK_OEM_MINUS */ +#define RDP_SCANCODE_OEM_PLUS MAKE_RDP_SCANCODE(0x0D, FALSE) /* VK_OEM_PLUS */ +#define RDP_SCANCODE_BACKSPACE MAKE_RDP_SCANCODE(0x0E, FALSE) /* VK_BACK Backspace */ +#define RDP_SCANCODE_TAB MAKE_RDP_SCANCODE(0x0F, FALSE) /* VK_TAB */ +#define RDP_SCANCODE_KEY_Q MAKE_RDP_SCANCODE(0x10, FALSE) /* VK_KEY_Q */ +#define RDP_SCANCODE_KEY_W MAKE_RDP_SCANCODE(0x11, FALSE) /* VK_KEY_W */ +#define RDP_SCANCODE_KEY_E MAKE_RDP_SCANCODE(0x12, FALSE) /* VK_KEY_E */ +#define RDP_SCANCODE_KEY_R MAKE_RDP_SCANCODE(0x13, FALSE) /* VK_KEY_R */ +#define RDP_SCANCODE_KEY_T MAKE_RDP_SCANCODE(0x14, FALSE) /* VK_KEY_T */ +#define RDP_SCANCODE_KEY_Y MAKE_RDP_SCANCODE(0x15, FALSE) /* VK_KEY_Y */ +#define RDP_SCANCODE_KEY_U MAKE_RDP_SCANCODE(0x16, FALSE) /* VK_KEY_U */ +#define RDP_SCANCODE_KEY_I MAKE_RDP_SCANCODE(0x17, FALSE) /* VK_KEY_I */ +#define RDP_SCANCODE_KEY_O MAKE_RDP_SCANCODE(0x18, FALSE) /* VK_KEY_O */ +#define RDP_SCANCODE_KEY_P MAKE_RDP_SCANCODE(0x19, FALSE) /* VK_KEY_P */ +#define RDP_SCANCODE_OEM_4 MAKE_RDP_SCANCODE(0x1A, FALSE) /* VK_OEM_4 '[' on US */ +#define RDP_SCANCODE_OEM_6 MAKE_RDP_SCANCODE(0x1B, FALSE) /* VK_OEM_6 ']' on US */ +#define RDP_SCANCODE_RETURN MAKE_RDP_SCANCODE(0x1C, FALSE) /* VK_RETURN Normal Enter */ +#define RDP_SCANCODE_LCONTROL MAKE_RDP_SCANCODE(0x1D, FALSE) /* VK_LCONTROL */ +#define RDP_SCANCODE_KEY_A MAKE_RDP_SCANCODE(0x1E, FALSE) /* VK_KEY_A */ +#define RDP_SCANCODE_KEY_S MAKE_RDP_SCANCODE(0x1F, FALSE) /* VK_KEY_S */ +#define RDP_SCANCODE_KEY_D MAKE_RDP_SCANCODE(0x20, FALSE) /* VK_KEY_D */ +#define RDP_SCANCODE_KEY_F MAKE_RDP_SCANCODE(0x21, FALSE) /* VK_KEY_F */ +#define RDP_SCANCODE_KEY_G MAKE_RDP_SCANCODE(0x22, FALSE) /* VK_KEY_G */ +#define RDP_SCANCODE_KEY_H MAKE_RDP_SCANCODE(0x23, FALSE) /* VK_KEY_H */ +#define RDP_SCANCODE_KEY_J MAKE_RDP_SCANCODE(0x24, FALSE) /* VK_KEY_J */ +#define RDP_SCANCODE_KEY_K MAKE_RDP_SCANCODE(0x25, FALSE) /* VK_KEY_K */ +#define RDP_SCANCODE_KEY_L MAKE_RDP_SCANCODE(0x26, FALSE) /* VK_KEY_L */ +#define RDP_SCANCODE_OEM_1 MAKE_RDP_SCANCODE(0x27, FALSE) /* VK_OEM_1 ';' on US */ +#define RDP_SCANCODE_OEM_7 MAKE_RDP_SCANCODE(0x28, FALSE) /* VK_OEM_7 "'" on US */ +#define RDP_SCANCODE_OEM_3 \ + MAKE_RDP_SCANCODE(0x29, FALSE) /* VK_OEM_3 Top left, '`' on US, JP DBE_SBCSCHAR */ +#define RDP_SCANCODE_LSHIFT MAKE_RDP_SCANCODE(0x2A, FALSE) /* VK_LSHIFT */ +#define RDP_SCANCODE_OEM_5 MAKE_RDP_SCANCODE(0x2B, FALSE) /* VK_OEM_5 Next to Enter, '\' on US */ +#define RDP_SCANCODE_KEY_Z MAKE_RDP_SCANCODE(0x2C, FALSE) /* VK_KEY_Z */ +#define RDP_SCANCODE_KEY_X MAKE_RDP_SCANCODE(0x2D, FALSE) /* VK_KEY_X */ +#define RDP_SCANCODE_KEY_C MAKE_RDP_SCANCODE(0x2E, FALSE) /* VK_KEY_C */ +#define RDP_SCANCODE_KEY_V MAKE_RDP_SCANCODE(0x2F, FALSE) /* VK_KEY_V */ +#define RDP_SCANCODE_KEY_B MAKE_RDP_SCANCODE(0x30, FALSE) /* VK_KEY_B */ +#define RDP_SCANCODE_KEY_N MAKE_RDP_SCANCODE(0x31, FALSE) /* VK_KEY_N */ +#define RDP_SCANCODE_KEY_M MAKE_RDP_SCANCODE(0x32, FALSE) /* VK_KEY_M */ +#define RDP_SCANCODE_OEM_COMMA MAKE_RDP_SCANCODE(0x33, FALSE) /* VK_OEM_COMMA */ +#define RDP_SCANCODE_OEM_PERIOD MAKE_RDP_SCANCODE(0x34, FALSE) /* VK_OEM_PERIOD */ +#define RDP_SCANCODE_OEM_2 MAKE_RDP_SCANCODE(0x35, FALSE) /* VK_OEM_2 '/' on US */ +#define RDP_SCANCODE_RSHIFT MAKE_RDP_SCANCODE(0x36, FALSE) /* VK_RSHIFT */ +#define RDP_SCANCODE_MULTIPLY MAKE_RDP_SCANCODE(0x37, FALSE) /* VK_MULTIPLY Numerical */ +#define RDP_SCANCODE_LMENU MAKE_RDP_SCANCODE(0x38, FALSE) /* VK_LMENU Left 'Alt' key */ +#define RDP_SCANCODE_SPACE MAKE_RDP_SCANCODE(0x39, FALSE) /* VK_SPACE */ +#define RDP_SCANCODE_CAPSLOCK \ + MAKE_RDP_SCANCODE(0x3A, FALSE) /* VK_CAPITAL 'Caps Lock', JP DBE_ALPHANUMERIC */ +#define RDP_SCANCODE_F1 MAKE_RDP_SCANCODE(0x3B, FALSE) /* VK_F1 */ +#define RDP_SCANCODE_F2 MAKE_RDP_SCANCODE(0x3C, FALSE) /* VK_F2 */ +#define RDP_SCANCODE_F3 MAKE_RDP_SCANCODE(0x3D, FALSE) /* VK_F3 */ +#define RDP_SCANCODE_F4 MAKE_RDP_SCANCODE(0x3E, FALSE) /* VK_F4 */ +#define RDP_SCANCODE_F5 MAKE_RDP_SCANCODE(0x3F, FALSE) /* VK_F5 */ +#define RDP_SCANCODE_F6 MAKE_RDP_SCANCODE(0x40, FALSE) /* VK_F6 */ +#define RDP_SCANCODE_F7 MAKE_RDP_SCANCODE(0x41, FALSE) /* VK_F7 */ +#define RDP_SCANCODE_F8 MAKE_RDP_SCANCODE(0x42, FALSE) /* VK_F8 */ +#define RDP_SCANCODE_F9 MAKE_RDP_SCANCODE(0x43, FALSE) /* VK_F9 */ +#define RDP_SCANCODE_F10 MAKE_RDP_SCANCODE(0x44, FALSE) /* VK_F10 */ +#define RDP_SCANCODE_NUMLOCK \ + MAKE_RDP_SCANCODE(0x45, FALSE) \ + /* VK_NUMLOCK */ /* Note: when this seems to appear in PKBDLLHOOKSTRUCT it means Pause which \ + must be sent as Ctrl + NumLock */ +#define RDP_SCANCODE_SCROLLLOCK \ + MAKE_RDP_SCANCODE(0x46, FALSE) /* VK_SCROLL 'Scroll Lock', JP OEM_SCROLL */ +#define RDP_SCANCODE_NUMPAD7 MAKE_RDP_SCANCODE(0x47, FALSE) /* VK_NUMPAD7 */ +#define RDP_SCANCODE_NUMPAD8 MAKE_RDP_SCANCODE(0x48, FALSE) /* VK_NUMPAD8 */ +#define RDP_SCANCODE_NUMPAD9 MAKE_RDP_SCANCODE(0x49, FALSE) /* VK_NUMPAD9 */ +#define RDP_SCANCODE_SUBTRACT MAKE_RDP_SCANCODE(0x4A, FALSE) /* VK_SUBTRACT */ +#define RDP_SCANCODE_NUMPAD4 MAKE_RDP_SCANCODE(0x4B, FALSE) /* VK_NUMPAD4 */ +#define RDP_SCANCODE_NUMPAD5 MAKE_RDP_SCANCODE(0x4C, FALSE) /* VK_NUMPAD5 */ +#define RDP_SCANCODE_NUMPAD6 MAKE_RDP_SCANCODE(0x4D, FALSE) /* VK_NUMPAD6 */ +#define RDP_SCANCODE_ADD MAKE_RDP_SCANCODE(0x4E, FALSE) /* VK_ADD */ +#define RDP_SCANCODE_NUMPAD1 MAKE_RDP_SCANCODE(0x4F, FALSE) /* VK_NUMPAD1 */ +#define RDP_SCANCODE_NUMPAD2 MAKE_RDP_SCANCODE(0x50, FALSE) /* VK_NUMPAD2 */ +#define RDP_SCANCODE_NUMPAD3 MAKE_RDP_SCANCODE(0x51, FALSE) /* VK_NUMPAD3 */ +#define RDP_SCANCODE_NUMPAD0 MAKE_RDP_SCANCODE(0x52, FALSE) /* VK_NUMPAD0 */ +#define RDP_SCANCODE_DECIMAL MAKE_RDP_SCANCODE(0x53, FALSE) /* VK_DECIMAL Numerical, '.' on US */ +#define RDP_SCANCODE_SYSREQ MAKE_RDP_SCANCODE(0x54, FALSE) /* Sys Req */ +#define RDP_SCANCODE_OEM_102 MAKE_RDP_SCANCODE(0x56, FALSE) /* VK_OEM_102 Lower left '\' on US */ +#define RDP_SCANCODE_F11 MAKE_RDP_SCANCODE(0x57, FALSE) /* VK_F11 */ +#define RDP_SCANCODE_F12 MAKE_RDP_SCANCODE(0x58, FALSE) /* VK_F12 */ +#define RDP_SCANCODE_SLEEP \ + MAKE_RDP_SCANCODE(0x5F, FALSE) /* VK_SLEEP OEM_8 on FR (undocumented?) \ + */ +#define RDP_SCANCODE_ZOOM MAKE_RDP_SCANCODE(0x62, FALSE) /* VK_ZOOM (undocumented?) */ +#define RDP_SCANCODE_HELP MAKE_RDP_SCANCODE(0x63, FALSE) /* VK_HELP (undocumented?) */ -#define RDP_SCANCODE_F13 MAKE_RDP_SCANCODE(0x64, FALSE) /* VK_F13 */ /* JP agree, should 0x7d according to ms894073 */ -#define RDP_SCANCODE_F14 MAKE_RDP_SCANCODE(0x65, FALSE) /* VK_F14 */ -#define RDP_SCANCODE_F15 MAKE_RDP_SCANCODE(0x66, FALSE) /* VK_F15 */ -#define RDP_SCANCODE_F16 MAKE_RDP_SCANCODE(0x67, FALSE) /* VK_F16 */ -#define RDP_SCANCODE_F17 MAKE_RDP_SCANCODE(0x68, FALSE) /* VK_F17 */ -#define RDP_SCANCODE_F18 MAKE_RDP_SCANCODE(0x69, FALSE) /* VK_F18 */ -#define RDP_SCANCODE_F19 MAKE_RDP_SCANCODE(0x6A, FALSE) /* VK_F19 */ -#define RDP_SCANCODE_F20 MAKE_RDP_SCANCODE(0x6B, FALSE) /* VK_F20 */ -#define RDP_SCANCODE_F21 MAKE_RDP_SCANCODE(0x6C, FALSE) /* VK_F21 */ -#define RDP_SCANCODE_F22 MAKE_RDP_SCANCODE(0x6D, FALSE) /* VK_F22 */ -#define RDP_SCANCODE_F23 MAKE_RDP_SCANCODE(0x6E, FALSE) /* VK_F23 */ /* JP agree */ -#define RDP_SCANCODE_F24 MAKE_RDP_SCANCODE(0x6F, FALSE) /* VK_F24 */ /* 0x87 according to ms894073 */ +#define RDP_SCANCODE_F13 \ + MAKE_RDP_SCANCODE(0x64, FALSE) /* VK_F13 */ /* JP agree, should 0x7d according to ms894073 */ +#define RDP_SCANCODE_F14 MAKE_RDP_SCANCODE(0x65, FALSE) /* VK_F14 */ +#define RDP_SCANCODE_F15 MAKE_RDP_SCANCODE(0x66, FALSE) /* VK_F15 */ +#define RDP_SCANCODE_F16 MAKE_RDP_SCANCODE(0x67, FALSE) /* VK_F16 */ +#define RDP_SCANCODE_F17 MAKE_RDP_SCANCODE(0x68, FALSE) /* VK_F17 */ +#define RDP_SCANCODE_F18 MAKE_RDP_SCANCODE(0x69, FALSE) /* VK_F18 */ +#define RDP_SCANCODE_F19 MAKE_RDP_SCANCODE(0x6A, FALSE) /* VK_F19 */ +#define RDP_SCANCODE_F20 MAKE_RDP_SCANCODE(0x6B, FALSE) /* VK_F20 */ +#define RDP_SCANCODE_F21 MAKE_RDP_SCANCODE(0x6C, FALSE) /* VK_F21 */ +#define RDP_SCANCODE_F22 MAKE_RDP_SCANCODE(0x6D, FALSE) /* VK_F22 */ +#define RDP_SCANCODE_F23 MAKE_RDP_SCANCODE(0x6E, FALSE) /* VK_F23 */ /* JP agree */ +#define RDP_SCANCODE_F24 \ + MAKE_RDP_SCANCODE(0x6F, FALSE) /* VK_F24 */ /* 0x87 according to ms894073 */ -#define RDP_SCANCODE_HIRAGANA MAKE_RDP_SCANCODE(0x70, FALSE) /* JP DBE_HIRAGANA */ -#define RDP_SCANCODE_HANJA_KANJI MAKE_RDP_SCANCODE(0x71, FALSE) /* VK_HANJA / VK_KANJI (undocumented?) */ -#define RDP_SCANCODE_KANA_HANGUL MAKE_RDP_SCANCODE(0x72, FALSE) /* VK_KANA / VK_HANGUL (undocumented?) */ -#define RDP_SCANCODE_ABNT_C1 MAKE_RDP_SCANCODE(0x73, FALSE) /* VK_ABNT_C1 JP OEM_102 */ -#define RDP_SCANCODE_F24_JP MAKE_RDP_SCANCODE(0x76, FALSE) /* JP F24 */ -#define RDP_SCANCODE_CONVERT_JP MAKE_RDP_SCANCODE(0x79, FALSE) /* JP VK_CONVERT */ +#define RDP_SCANCODE_HIRAGANA MAKE_RDP_SCANCODE(0x70, FALSE) /* JP DBE_HIRAGANA */ +#define RDP_SCANCODE_HANJA_KANJI \ + MAKE_RDP_SCANCODE(0x71, FALSE) /* VK_HANJA / VK_KANJI (undocumented?) */ +#define RDP_SCANCODE_KANA_HANGUL \ + MAKE_RDP_SCANCODE(0x72, FALSE) /* VK_KANA / VK_HANGUL (undocumented?) */ +#define RDP_SCANCODE_ABNT_C1 MAKE_RDP_SCANCODE(0x73, FALSE) /* VK_ABNT_C1 JP OEM_102 */ +#define RDP_SCANCODE_F24_JP MAKE_RDP_SCANCODE(0x76, FALSE) /* JP F24 */ +#define RDP_SCANCODE_CONVERT_JP MAKE_RDP_SCANCODE(0x79, FALSE) /* JP VK_CONVERT */ #define RDP_SCANCODE_NONCONVERT_JP MAKE_RDP_SCANCODE(0x7B, FALSE) /* JP VK_NONCONVERT */ -#define RDP_SCANCODE_TAB_JP MAKE_RDP_SCANCODE(0x7C, FALSE) /* JP TAB */ -#define RDP_SCANCODE_BACKSLASH_JP MAKE_RDP_SCANCODE(0x7D, FALSE) /* JP OEM_5 ('\') */ -#define RDP_SCANCODE_ABNT_C2 MAKE_RDP_SCANCODE(0x7E, FALSE) /* VK_ABNT_C2, JP */ -#define RDP_SCANCODE_ABNT_C2 MAKE_RDP_SCANCODE(0x7E, FALSE) /* JP OEM_PA2 */ -#define RDP_SCANCODE_HANJA MAKE_RDP_SCANCODE(0x71, FALSE) /* KR VK_HANJA */ -#define RDP_SCANCODE_HANGUL MAKE_RDP_SCANCODE(0x72, FALSE) /* KR VK_HANGUL */ +#define RDP_SCANCODE_TAB_JP MAKE_RDP_SCANCODE(0x7C, FALSE) /* JP TAB */ +#define RDP_SCANCODE_BACKSLASH_JP MAKE_RDP_SCANCODE(0x7D, FALSE) /* JP OEM_5 ('\') */ +#define RDP_SCANCODE_ABNT_C2 MAKE_RDP_SCANCODE(0x7E, FALSE) /* VK_ABNT_C2, JP */ +#define RDP_SCANCODE_ABNT_C2 MAKE_RDP_SCANCODE(0x7E, FALSE) /* JP OEM_PA2 */ +#define RDP_SCANCODE_HANJA MAKE_RDP_SCANCODE(0x71, FALSE) /* KR VK_HANJA */ +#define RDP_SCANCODE_HANGUL MAKE_RDP_SCANCODE(0x72, FALSE) /* KR VK_HANGUL */ -#define RDP_SCANCODE_RETURN_KP MAKE_RDP_SCANCODE(0x1C, TRUE) /* not RDP_SCANCODE_RETURN Numerical Enter */ -#define RDP_SCANCODE_RCONTROL MAKE_RDP_SCANCODE(0x1D, TRUE) /* VK_RCONTROL */ -#define RDP_SCANCODE_DIVIDE MAKE_RDP_SCANCODE(0x35, TRUE) /* VK_DIVIDE Numerical */ -#define RDP_SCANCODE_PRINTSCREEN MAKE_RDP_SCANCODE(0x37, TRUE) /* VK_EXECUTE/VK_PRINT/VK_SNAPSHOT Print Screen */ -#define RDP_SCANCODE_RMENU MAKE_RDP_SCANCODE(0x38, TRUE) /* VK_RMENU Right 'Alt' / 'Alt Gr' */ -#define RDP_SCANCODE_PAUSE MAKE_RDP_SCANCODE(0x46, TRUE) /* VK_PAUSE Pause / Break (Slightly special handling) */ -#define RDP_SCANCODE_HOME MAKE_RDP_SCANCODE(0x47, TRUE) /* VK_HOME */ -#define RDP_SCANCODE_UP MAKE_RDP_SCANCODE(0x48, TRUE) /* VK_UP */ -#define RDP_SCANCODE_PRIOR MAKE_RDP_SCANCODE(0x49, TRUE) /* VK_PRIOR 'Page Up' */ -#define RDP_SCANCODE_LEFT MAKE_RDP_SCANCODE(0x4B, TRUE) /* VK_LEFT */ -#define RDP_SCANCODE_RIGHT MAKE_RDP_SCANCODE(0x4D, TRUE) /* VK_RIGHT */ -#define RDP_SCANCODE_END MAKE_RDP_SCANCODE(0x4F, TRUE) /* VK_END */ -#define RDP_SCANCODE_DOWN MAKE_RDP_SCANCODE(0x50, TRUE) /* VK_DOWN */ -#define RDP_SCANCODE_NEXT MAKE_RDP_SCANCODE(0x51, TRUE) /* VK_NEXT 'Page Down' */ -#define RDP_SCANCODE_INSERT MAKE_RDP_SCANCODE(0x52, TRUE) /* VK_INSERT */ -#define RDP_SCANCODE_DELETE MAKE_RDP_SCANCODE(0x53, TRUE) /* VK_DELETE */ -#define RDP_SCANCODE_NULL MAKE_RDP_SCANCODE(0x54, TRUE) /* <00> */ -#define RDP_SCANCODE_HELP2 MAKE_RDP_SCANCODE(0x56, TRUE) /* Help - documented, different from VK_HELP */ -#define RDP_SCANCODE_LWIN MAKE_RDP_SCANCODE(0x5B, TRUE) /* VK_LWIN */ -#define RDP_SCANCODE_RWIN MAKE_RDP_SCANCODE(0x5C, TRUE) /* VK_RWIN */ -#define RDP_SCANCODE_APPS MAKE_RDP_SCANCODE(0x5D, TRUE) /* VK_APPS Application */ -#define RDP_SCANCODE_POWER_JP MAKE_RDP_SCANCODE(0x5E, TRUE) /* JP POWER */ -#define RDP_SCANCODE_SLEEP_JP MAKE_RDP_SCANCODE(0x5F, TRUE) /* JP SLEEP */ +#define RDP_SCANCODE_RETURN_KP \ + MAKE_RDP_SCANCODE(0x1C, TRUE) /* not RDP_SCANCODE_RETURN Numerical Enter */ +#define RDP_SCANCODE_RCONTROL MAKE_RDP_SCANCODE(0x1D, TRUE) /* VK_RCONTROL */ +#define RDP_SCANCODE_DIVIDE MAKE_RDP_SCANCODE(0x35, TRUE) /* VK_DIVIDE Numerical */ +#define RDP_SCANCODE_PRINTSCREEN \ + MAKE_RDP_SCANCODE(0x37, TRUE) /* VK_EXECUTE/VK_PRINT/VK_SNAPSHOT Print Screen */ +#define RDP_SCANCODE_RMENU MAKE_RDP_SCANCODE(0x38, TRUE) /* VK_RMENU Right 'Alt' / 'Alt Gr' */ +#define RDP_SCANCODE_PAUSE \ + MAKE_RDP_SCANCODE(0x46, TRUE) /* VK_PAUSE Pause / Break (Slightly special handling) */ +#define RDP_SCANCODE_HOME MAKE_RDP_SCANCODE(0x47, TRUE) /* VK_HOME */ +#define RDP_SCANCODE_UP MAKE_RDP_SCANCODE(0x48, TRUE) /* VK_UP */ +#define RDP_SCANCODE_PRIOR MAKE_RDP_SCANCODE(0x49, TRUE) /* VK_PRIOR 'Page Up' */ +#define RDP_SCANCODE_LEFT MAKE_RDP_SCANCODE(0x4B, TRUE) /* VK_LEFT */ +#define RDP_SCANCODE_RIGHT MAKE_RDP_SCANCODE(0x4D, TRUE) /* VK_RIGHT */ +#define RDP_SCANCODE_END MAKE_RDP_SCANCODE(0x4F, TRUE) /* VK_END */ +#define RDP_SCANCODE_DOWN MAKE_RDP_SCANCODE(0x50, TRUE) /* VK_DOWN */ +#define RDP_SCANCODE_NEXT MAKE_RDP_SCANCODE(0x51, TRUE) /* VK_NEXT 'Page Down' */ +#define RDP_SCANCODE_INSERT MAKE_RDP_SCANCODE(0x52, TRUE) /* VK_INSERT */ +#define RDP_SCANCODE_DELETE MAKE_RDP_SCANCODE(0x53, TRUE) /* VK_DELETE */ +#define RDP_SCANCODE_NULL MAKE_RDP_SCANCODE(0x54, TRUE) /* <00> */ +#define RDP_SCANCODE_HELP2 \ + MAKE_RDP_SCANCODE(0x56, TRUE) /* Help - documented, different from VK_HELP */ +#define RDP_SCANCODE_LWIN MAKE_RDP_SCANCODE(0x5B, TRUE) /* VK_LWIN */ +#define RDP_SCANCODE_RWIN MAKE_RDP_SCANCODE(0x5C, TRUE) /* VK_RWIN */ +#define RDP_SCANCODE_APPS MAKE_RDP_SCANCODE(0x5D, TRUE) /* VK_APPS Application */ +#define RDP_SCANCODE_POWER_JP MAKE_RDP_SCANCODE(0x5E, TRUE) /* JP POWER */ +#define RDP_SCANCODE_SLEEP_JP MAKE_RDP_SCANCODE(0x5F, TRUE) /* JP SLEEP */ /* _not_ valid scancode, but this is what a windows PKBDLLHOOKSTRUCT for NumLock contains */ -#define RDP_SCANCODE_NUMLOCK_EXTENDED MAKE_RDP_SCANCODE(0x45, TRUE) /* should be RDP_SCANCODE_NUMLOCK */ -#define RDP_SCANCODE_RSHIFT_EXTENDED MAKE_RDP_SCANCODE(0x36, TRUE) /* should be RDP_SCANCODE_RSHIFT */ +#define RDP_SCANCODE_NUMLOCK_EXTENDED \ + MAKE_RDP_SCANCODE(0x45, TRUE) /* should be RDP_SCANCODE_NUMLOCK */ +#define RDP_SCANCODE_RSHIFT_EXTENDED \ + MAKE_RDP_SCANCODE(0x36, TRUE) /* should be RDP_SCANCODE_RSHIFT */ /* Audio */ -#define RDP_SCANCODE_VOLUME_MUTE MAKE_RDP_SCANCODE(0x20, TRUE) /* VK_VOLUME_MUTE */ -#define RDP_SCANCODE_VOLUME_DOWN MAKE_RDP_SCANCODE(0x2E, TRUE) /* VK_VOLUME_DOWN */ -#define RDP_SCANCODE_VOLUME_UP MAKE_RDP_SCANCODE(0x30, TRUE) /* VK_VOLUME_UP */ +#define RDP_SCANCODE_VOLUME_MUTE MAKE_RDP_SCANCODE(0x20, TRUE) /* VK_VOLUME_MUTE */ +#define RDP_SCANCODE_VOLUME_DOWN MAKE_RDP_SCANCODE(0x2E, TRUE) /* VK_VOLUME_DOWN */ +#define RDP_SCANCODE_VOLUME_UP MAKE_RDP_SCANCODE(0x30, TRUE) /* VK_VOLUME_UP */ /* Media */ -#define RDP_SCANCODE_MEDIA_NEXT_TRACK MAKE_RDP_SCANCODE(0x19, TRUE) /* VK_MEDIA_NEXT_TRACK */ -#define RDP_SCANCODE_MEDIA_PREV_TRACK MAKE_RDP_SCANCODE(0x10, TRUE) /* VK_MEDIA_PREV_TRACK */ -#define RDP_SCANCODE_MEDIA_STOP MAKE_RDP_SCANCODE(0x24, TRUE) /* VK_MEDIA_MEDIA_STOP */ -#define RDP_SCANCODE_MEDIA_PLAY_PAUSE MAKE_RDP_SCANCODE(0x22, TRUE) /* VK_MEDIA_MEDIA_PLAY_PAUSE */ +#define RDP_SCANCODE_MEDIA_NEXT_TRACK MAKE_RDP_SCANCODE(0x19, TRUE) /* VK_MEDIA_NEXT_TRACK */ +#define RDP_SCANCODE_MEDIA_PREV_TRACK MAKE_RDP_SCANCODE(0x10, TRUE) /* VK_MEDIA_PREV_TRACK */ +#define RDP_SCANCODE_MEDIA_STOP MAKE_RDP_SCANCODE(0x24, TRUE) /* VK_MEDIA_MEDIA_STOP */ +#define RDP_SCANCODE_MEDIA_PLAY_PAUSE \ + MAKE_RDP_SCANCODE(0x22, TRUE) /* VK_MEDIA_MEDIA_PLAY_PAUSE \ + */ /* Browser functions */ -#define RDP_SCANCODE_BROWSER_BACK MAKE_RDP_SCANCODE(0x6A, TRUE) /* VK_BROWSER_BACK */ -#define RDP_SCANCODE_BROWSER_FORWARD MAKE_RDP_SCANCODE(0x69, TRUE) /* VK_BROWSER_FORWARD */ -#define RDP_SCANCODE_BROWSER_REFRESH MAKE_RDP_SCANCODE(0x67, TRUE) /* VK_BROWSER_REFRESH */ -#define RDP_SCANCODE_BROWSER_STOP MAKE_RDP_SCANCODE(0x68, TRUE) /* VK_BROWSER_STOP */ -#define RDP_SCANCODE_BROWSER_SEARCH MAKE_RDP_SCANCODE(0x65, TRUE) /* VK_BROWSER_SEARCH */ -#define RDP_SCANCODE_BROWSER_FAVORITES MAKE_RDP_SCANCODE(0x66, TRUE) /* VK_BROWSER_FAVORITES */ -#define RDP_SCANCODE_BROWSER_HOME MAKE_RDP_SCANCODE(0x32, TRUE) /* VK_BROWSER_HOME */ +#define RDP_SCANCODE_BROWSER_BACK MAKE_RDP_SCANCODE(0x6A, TRUE) /* VK_BROWSER_BACK */ +#define RDP_SCANCODE_BROWSER_FORWARD MAKE_RDP_SCANCODE(0x69, TRUE) /* VK_BROWSER_FORWARD */ +#define RDP_SCANCODE_BROWSER_REFRESH MAKE_RDP_SCANCODE(0x67, TRUE) /* VK_BROWSER_REFRESH */ +#define RDP_SCANCODE_BROWSER_STOP MAKE_RDP_SCANCODE(0x68, TRUE) /* VK_BROWSER_STOP */ +#define RDP_SCANCODE_BROWSER_SEARCH MAKE_RDP_SCANCODE(0x65, TRUE) /* VK_BROWSER_SEARCH */ +#define RDP_SCANCODE_BROWSER_FAVORITES MAKE_RDP_SCANCODE(0x66, TRUE) /* VK_BROWSER_FAVORITES */ +#define RDP_SCANCODE_BROWSER_HOME MAKE_RDP_SCANCODE(0x32, TRUE) /* VK_BROWSER_HOME */ /* Misc. */ -#define RDP_SCANCODE_LAUNCH_MAIL MAKE_RDP_SCANCODE(0x6C, TRUE) /* VK_LAUNCH_MAIL */ +#define RDP_SCANCODE_LAUNCH_MAIL MAKE_RDP_SCANCODE(0x6C, TRUE) /* VK_LAUNCH_MAIL */ #endif /* FREERDP_LOCALE_KEYBOARD_RDP_SCANCODE_H */ diff --git a/include/freerdp/secondary.h b/include/freerdp/secondary.h index ddaf514ee..10be945fd 100644 --- a/include/freerdp/secondary.h +++ b/include/freerdp/secondary.h @@ -23,49 +23,49 @@ #include #include -#define GLYPH_FRAGMENT_NOP 0x00 -#define GLYPH_FRAGMENT_USE 0xFE -#define GLYPH_FRAGMENT_ADD 0xFF +#define GLYPH_FRAGMENT_NOP 0x00 +#define GLYPH_FRAGMENT_USE 0xFE +#define GLYPH_FRAGMENT_ADD 0xFF -#define CBR2_HEIGHT_SAME_AS_WIDTH 0x01 -#define CBR2_PERSISTENT_KEY_PRESENT 0x02 -#define CBR2_NO_BITMAP_COMPRESSION_HDR 0x08 -#define CBR2_DO_NOT_CACHE 0x10 +#define CBR2_HEIGHT_SAME_AS_WIDTH 0x01 +#define CBR2_PERSISTENT_KEY_PRESENT 0x02 +#define CBR2_NO_BITMAP_COMPRESSION_HDR 0x08 +#define CBR2_DO_NOT_CACHE 0x10 -#define SCREEN_BITMAP_SURFACE 0xFFFF -#define BITMAP_CACHE_WAITING_LIST_INDEX 0x7FFF +#define SCREEN_BITMAP_SURFACE 0xFFFF +#define BITMAP_CACHE_WAITING_LIST_INDEX 0x7FFF -#define CACHED_BRUSH 0x80 +#define CACHED_BRUSH 0x80 -#define BMF_1BPP 0x1 -#define BMF_8BPP 0x3 -#define BMF_16BPP 0x4 -#define BMF_24BPP 0x5 -#define BMF_32BPP 0x6 +#define BMF_1BPP 0x1 +#define BMF_8BPP 0x3 +#define BMF_16BPP 0x4 +#define BMF_24BPP 0x5 +#define BMF_32BPP 0x6 #ifndef _WIN32 -#define BS_SOLID 0x00 -#define BS_NULL 0x01 -#define BS_HATCHED 0x02 -#define BS_PATTERN 0x03 +#define BS_SOLID 0x00 +#define BS_NULL 0x01 +#define BS_HATCHED 0x02 +#define BS_PATTERN 0x03 #endif #ifndef _WIN32 -#define HS_HORIZONTAL 0x00 -#define HS_VERTICAL 0x01 -#define HS_FDIAGONAL 0x02 -#define HS_BDIAGONAL 0x03 -#define HS_CROSS 0x04 -#define HS_DIAGCROSS 0x05 +#define HS_HORIZONTAL 0x00 +#define HS_VERTICAL 0x01 +#define HS_FDIAGONAL 0x02 +#define HS_BDIAGONAL 0x03 +#define HS_CROSS 0x04 +#define HS_DIAGCROSS 0x05 #endif -#define SO_FLAG_DEFAULT_PLACEMENT 0x01 -#define SO_HORIZONTAL 0x02 -#define SO_VERTICAL 0x04 -#define SO_REVERSED 0x08 -#define SO_ZERO_BEARINGS 0x10 -#define SO_CHAR_INC_EQUAL_BM_BASE 0x20 -#define SO_MAXEXT_EQUAL_BM_SIDE 0x40 +#define SO_FLAG_DEFAULT_PLACEMENT 0x01 +#define SO_HORIZONTAL 0x02 +#define SO_VERTICAL 0x04 +#define SO_REVERSED 0x08 +#define SO_ZERO_BEARINGS 0x10 +#define SO_CHAR_INC_EQUAL_BM_BASE 0x20 +#define SO_MAXEXT_EQUAL_BM_SIDE 0x40 struct _CACHE_BITMAP_ORDER { @@ -163,34 +163,29 @@ struct _CACHE_BRUSH_ORDER }; typedef struct _CACHE_BRUSH_ORDER CACHE_BRUSH_ORDER; -typedef BOOL (*pCacheBitmap)(rdpContext* context, - const CACHE_BITMAP_ORDER* cache_bitmap_order); -typedef BOOL (*pCacheBitmapV2)(rdpContext* context, - CACHE_BITMAP_V2_ORDER* cache_bitmap_v2_order); -typedef BOOL (*pCacheBitmapV3)(rdpContext* context, - CACHE_BITMAP_V3_ORDER* cache_bitmap_v3_order); +typedef BOOL (*pCacheBitmap)(rdpContext* context, const CACHE_BITMAP_ORDER* cache_bitmap_order); +typedef BOOL (*pCacheBitmapV2)(rdpContext* context, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2_order); +typedef BOOL (*pCacheBitmapV3)(rdpContext* context, CACHE_BITMAP_V3_ORDER* cache_bitmap_v3_order); typedef BOOL (*pCacheColorTable)(rdpContext* context, const CACHE_COLOR_TABLE_ORDER* cache_color_table_order); -typedef BOOL (*pCacheGlyph)(rdpContext* context, - const CACHE_GLYPH_ORDER* cache_glyph_order); +typedef BOOL (*pCacheGlyph)(rdpContext* context, const CACHE_GLYPH_ORDER* cache_glyph_order); typedef BOOL (*pCacheGlyphV2)(rdpContext* context, const CACHE_GLYPH_V2_ORDER* cache_glyph_v2_order); -typedef BOOL (*pCacheBrush)(rdpContext* context, - const CACHE_BRUSH_ORDER* cache_brush_order); +typedef BOOL (*pCacheBrush)(rdpContext* context, const CACHE_BRUSH_ORDER* cache_brush_order); struct rdp_secondary_update { - rdpContext* context; /* 0 */ + rdpContext* context; /* 0 */ UINT32 paddingA[16 - 1]; /* 1 */ - pCacheBitmap CacheBitmap; /* 16 */ - pCacheBitmapV2 CacheBitmapV2; /* 17 */ - pCacheBitmapV3 CacheBitmapV3; /* 18 */ + pCacheBitmap CacheBitmap; /* 16 */ + pCacheBitmapV2 CacheBitmapV2; /* 17 */ + pCacheBitmapV3 CacheBitmapV3; /* 18 */ pCacheColorTable CacheColorTable; /* 19 */ - pCacheGlyph CacheGlyph; /* 20 */ - pCacheGlyphV2 CacheGlyphV2; /* 21 */ - pCacheBrush CacheBrush; /* 22 */ - UINT32 paddingE[32 - 23]; /* 23 */ + pCacheGlyph CacheGlyph; /* 20 */ + pCacheGlyphV2 CacheGlyphV2; /* 21 */ + pCacheBrush CacheBrush; /* 22 */ + UINT32 paddingE[32 - 23]; /* 23 */ /* internal */ diff --git a/include/freerdp/server/audin.h b/include/freerdp/server/audin.h index ade14abfd..a8da17d27 100644 --- a/include/freerdp/server/audin.h +++ b/include/freerdp/server/audin.h @@ -28,16 +28,17 @@ typedef struct _audin_server_context audin_server_context; -typedef UINT(*psAudinServerSelectFormat)(audin_server_context* context, size_t client_format_index); +typedef UINT (*psAudinServerSelectFormat)(audin_server_context* context, + size_t client_format_index); typedef BOOL (*psAudinServerOpen)(audin_server_context* context); typedef BOOL (*psAudinServerIsOpen)(audin_server_context* context); typedef BOOL (*psAudinServerClose)(audin_server_context* context); -typedef UINT(*psAudinServerOpening)(audin_server_context* context); -typedef UINT(*psAudinServerOpenResult)(audin_server_context* context, UINT32 result); -typedef UINT(*psAudinServerReceiveSamples)(audin_server_context* context, - const AUDIO_FORMAT* format, wStream* buf, - size_t nframes); +typedef UINT (*psAudinServerOpening)(audin_server_context* context); +typedef UINT (*psAudinServerOpenResult)(audin_server_context* context, UINT32 result); +typedef UINT (*psAudinServerReceiveSamples)(audin_server_context* context, + const AUDIO_FORMAT* format, wStream* buf, + size_t nframes); struct _audin_server_context { @@ -101,11 +102,12 @@ struct _audin_server_context }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API audin_server_context* audin_server_context_new(HANDLE vcm); -FREERDP_API void audin_server_context_free(audin_server_context* context); + FREERDP_API audin_server_context* audin_server_context_new(HANDLE vcm); + FREERDP_API void audin_server_context_free(audin_server_context* context); #ifdef __cplusplus } diff --git a/include/freerdp/server/channels.h b/include/freerdp/server/channels.h index b2bcb3696..65b6b7f5b 100644 --- a/include/freerdp/server/channels.h +++ b/include/freerdp/server/channels.h @@ -23,4 +23,3 @@ #include #endif /* FREERDP_CHANNELS_SERVER_H */ - diff --git a/include/freerdp/server/cliprdr.h b/include/freerdp/server/cliprdr.h index ce1d49193..ddffdcd3b 100644 --- a/include/freerdp/server/cliprdr.h +++ b/include/freerdp/server/cliprdr.h @@ -42,33 +42,54 @@ typedef UINT (*psCliprdrStop)(CliprdrServerContext* context); typedef HANDLE (*psCliprdrGetEventHandle)(CliprdrServerContext* context); typedef UINT (*psCliprdrCheckEventHandle)(CliprdrServerContext* context); -typedef UINT (*psCliprdrServerCapabilities)(CliprdrServerContext* context, const CLIPRDR_CAPABILITIES* capabilities); -typedef UINT (*psCliprdrClientCapabilities)(CliprdrServerContext* context, const CLIPRDR_CAPABILITIES* capabilities); -typedef UINT (*psCliprdrMonitorReady)(CliprdrServerContext* context, const CLIPRDR_MONITOR_READY* monitorReady); -typedef UINT (*psCliprdrTempDirectory)(CliprdrServerContext* context, const CLIPRDR_TEMP_DIRECTORY* tempDirectory); -typedef UINT (*psCliprdrClientFormatList)(CliprdrServerContext* context, const CLIPRDR_FORMAT_LIST* formatList); -typedef UINT (*psCliprdrServerFormatList)(CliprdrServerContext* context, const CLIPRDR_FORMAT_LIST* formatList); -typedef UINT (*psCliprdrClientFormatListResponse)(CliprdrServerContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); -typedef UINT (*psCliprdrServerFormatListResponse)(CliprdrServerContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); -typedef UINT (*psCliprdrClientLockClipboardData)(CliprdrServerContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); -typedef UINT (*psCliprdrServerLockClipboardData)(CliprdrServerContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); -typedef UINT (*psCliprdrClientUnlockClipboardData)(CliprdrServerContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); -typedef UINT (*psCliprdrServerUnlockClipboardData)(CliprdrServerContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); -typedef UINT (*psCliprdrClientFormatDataRequest)(CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); -typedef UINT (*psCliprdrServerFormatDataRequest)(CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); -typedef UINT (*psCliprdrClientFormatDataResponse)(CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); -typedef UINT (*psCliprdrServerFormatDataResponse)(CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); -typedef UINT (*psCliprdrClientFileContentsRequest)(CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); -typedef UINT (*psCliprdrServerFileContentsRequest)(CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); -typedef UINT (*psCliprdrClientFileContentsResponse)(CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); -typedef UINT (*psCliprdrServerFileContentsResponse)(CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); +typedef UINT (*psCliprdrServerCapabilities)(CliprdrServerContext* context, + const CLIPRDR_CAPABILITIES* capabilities); +typedef UINT (*psCliprdrClientCapabilities)(CliprdrServerContext* context, + const CLIPRDR_CAPABILITIES* capabilities); +typedef UINT (*psCliprdrMonitorReady)(CliprdrServerContext* context, + const CLIPRDR_MONITOR_READY* monitorReady); +typedef UINT (*psCliprdrTempDirectory)(CliprdrServerContext* context, + const CLIPRDR_TEMP_DIRECTORY* tempDirectory); +typedef UINT (*psCliprdrClientFormatList)(CliprdrServerContext* context, + const CLIPRDR_FORMAT_LIST* formatList); +typedef UINT (*psCliprdrServerFormatList)(CliprdrServerContext* context, + const CLIPRDR_FORMAT_LIST* formatList); +typedef UINT (*psCliprdrClientFormatListResponse)( + CliprdrServerContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); +typedef UINT (*psCliprdrServerFormatListResponse)( + CliprdrServerContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); +typedef UINT (*psCliprdrClientLockClipboardData)( + CliprdrServerContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); +typedef UINT (*psCliprdrServerLockClipboardData)( + CliprdrServerContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); +typedef UINT (*psCliprdrClientUnlockClipboardData)( + CliprdrServerContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); +typedef UINT (*psCliprdrServerUnlockClipboardData)( + CliprdrServerContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); +typedef UINT (*psCliprdrClientFormatDataRequest)( + CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); +typedef UINT (*psCliprdrServerFormatDataRequest)( + CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); +typedef UINT (*psCliprdrClientFormatDataResponse)( + CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); +typedef UINT (*psCliprdrServerFormatDataResponse)( + CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); +typedef UINT (*psCliprdrClientFileContentsRequest)( + CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); +typedef UINT (*psCliprdrServerFileContentsRequest)( + CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); +typedef UINT (*psCliprdrClientFileContentsResponse)( + CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); +typedef UINT (*psCliprdrServerFileContentsResponse)( + CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); struct _cliprdr_server_context { void* handle; void* custom; - /* server clipboard capabilities - set by server - updated by the channel after client capability exchange */ + /* server clipboard capabilities - set by server - updated by the channel after client + * capability exchange */ BOOL useLongFormatNames; BOOL streamFileClipEnabled; BOOL fileClipNoFilePaths; @@ -108,14 +129,15 @@ struct _cliprdr_server_context }; #ifdef __cplusplus - extern "C" { +extern "C" +{ #endif -FREERDP_API CliprdrServerContext* cliprdr_server_context_new(HANDLE vcm); -FREERDP_API void cliprdr_server_context_free(CliprdrServerContext* context); + FREERDP_API CliprdrServerContext* cliprdr_server_context_new(HANDLE vcm); + FREERDP_API void cliprdr_server_context_free(CliprdrServerContext* context); #ifdef __cplusplus - } +} #endif #endif /* FREERDP_CHANNEL_CLIPRDR_SERVER_CLIPRDR_H */ diff --git a/include/freerdp/server/disp.h b/include/freerdp/server/disp.h index 65503b3bb..43aea647a 100644 --- a/include/freerdp/server/disp.h +++ b/include/freerdp/server/disp.h @@ -29,11 +29,11 @@ typedef struct _disp_server_private DispServerPrivate; typedef struct _disp_server_context DispServerContext; -typedef UINT(*psDispMonitorLayout)(DispServerContext* context, - const DISPLAY_CONTROL_MONITOR_LAYOUT_PDU* pdu); -typedef UINT(*psDispCaps)(DispServerContext* context); -typedef UINT(*psDispOpen)(DispServerContext* context); -typedef UINT(*psDispClose)(DispServerContext* context); +typedef UINT (*psDispMonitorLayout)(DispServerContext* context, + const DISPLAY_CONTROL_MONITOR_LAYOUT_PDU* pdu); +typedef UINT (*psDispCaps)(DispServerContext* context); +typedef UINT (*psDispOpen)(DispServerContext* context); +typedef UINT (*psDispClose)(DispServerContext* context); struct _disp_server_context { @@ -56,11 +56,12 @@ struct _disp_server_context }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API DispServerContext* disp_server_context_new(HANDLE vcm); -FREERDP_API void disp_server_context_free(DispServerContext* context); + FREERDP_API DispServerContext* disp_server_context_new(HANDLE vcm); + FREERDP_API void disp_server_context_free(DispServerContext* context); #ifdef __cplusplus } diff --git a/include/freerdp/server/drdynvc.h b/include/freerdp/server/drdynvc.h index 2b355c488..23f980279 100644 --- a/include/freerdp/server/drdynvc.h +++ b/include/freerdp/server/drdynvc.h @@ -47,14 +47,15 @@ struct _drdynvc_client_context }; #ifdef __cplusplus - extern "C" { +extern "C" +{ #endif -FREERDP_API DrdynvcServerContext* drdynvc_server_context_new(HANDLE vcm); -FREERDP_API void drdynvc_server_context_free(DrdynvcServerContext* context); + FREERDP_API DrdynvcServerContext* drdynvc_server_context_new(HANDLE vcm); + FREERDP_API void drdynvc_server_context_free(DrdynvcServerContext* context); #ifdef __cplusplus - } +} #endif #endif /* FREERDP_CHANNEL_DRDYNVC_SERVER_DRDYNVC_H */ diff --git a/include/freerdp/server/echo.h b/include/freerdp/server/echo.h index c4f3cdf4f..0643a5932 100644 --- a/include/freerdp/server/echo.h +++ b/include/freerdp/server/echo.h @@ -36,10 +36,13 @@ typedef struct _echo_server_context echo_server_context; typedef UINT (*psEchoServerOpen)(echo_server_context* context); typedef UINT (*psEchoServerClose)(echo_server_context* context); -typedef BOOL (*psEchoServerRequest)(echo_server_context* context, const BYTE* buffer, UINT32 length); +typedef BOOL (*psEchoServerRequest)(echo_server_context* context, const BYTE* buffer, + UINT32 length); -typedef UINT (*psEchoServerOpenResult)(echo_server_context* context, ECHO_SERVER_OPEN_RESULT result); -typedef UINT (*psEchoServerResponse)(echo_server_context* context, const BYTE* buffer, UINT32 length); +typedef UINT (*psEchoServerOpenResult)(echo_server_context* context, + ECHO_SERVER_OPEN_RESULT result); +typedef UINT (*psEchoServerResponse)(echo_server_context* context, const BYTE* buffer, + UINT32 length); struct _echo_server_context { @@ -76,11 +79,12 @@ struct _echo_server_context }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API echo_server_context* echo_server_context_new(HANDLE vcm); -FREERDP_API void echo_server_context_free(echo_server_context* context); + FREERDP_API echo_server_context* echo_server_context_new(HANDLE vcm); + FREERDP_API void echo_server_context_free(echo_server_context* context); #ifdef __cplusplus } diff --git a/include/freerdp/server/encomsp.h b/include/freerdp/server/encomsp.h index 111224060..9c562497d 100644 --- a/include/freerdp/server/encomsp.h +++ b/include/freerdp/server/encomsp.h @@ -38,17 +38,29 @@ typedef struct _encomsp_server_private EncomspServerPrivate; typedef UINT (*psEncomspStart)(EncomspServerContext* context); typedef UINT (*psEncomspStop)(EncomspServerContext* context); -typedef UINT (*psEncomspFilterUpdated)(EncomspServerContext* context, ENCOMSP_FILTER_UPDATED_PDU* filterUpdated); -typedef UINT (*psEncomspApplicationCreated)(EncomspServerContext* context, ENCOMSP_APPLICATION_CREATED_PDU* applicationCreated); -typedef UINT (*psEncomspApplicationRemoved)(EncomspServerContext* context, ENCOMSP_APPLICATION_REMOVED_PDU* applicationRemoved); -typedef UINT (*psEncomspWindowCreated)(EncomspServerContext* context, ENCOMSP_WINDOW_CREATED_PDU* windowCreated); -typedef UINT (*psEncomspWindowRemoved)(EncomspServerContext* context, ENCOMSP_WINDOW_REMOVED_PDU* windowRemoved); -typedef UINT (*psEncomspShowWindow)(EncomspServerContext* context, ENCOMSP_SHOW_WINDOW_PDU* showWindow); -typedef UINT (*psEncomspParticipantCreated)(EncomspServerContext* context, ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated); -typedef UINT (*psEncomspParticipantRemoved)(EncomspServerContext* context, ENCOMSP_PARTICIPANT_REMOVED_PDU* participantRemoved); -typedef UINT (*psEncomspChangeParticipantControlLevel)(EncomspServerContext* context, ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* changeParticipantControlLevel); -typedef UINT (*psEncomspGraphicsStreamPaused)(EncomspServerContext* context, ENCOMSP_GRAPHICS_STREAM_PAUSED_PDU* graphicsStreamPaused); -typedef UINT (*psEncomspGraphicsStreamResumed)(EncomspServerContext* context, ENCOMSP_GRAPHICS_STREAM_RESUMED_PDU* graphicsStreamResumed); +typedef UINT (*psEncomspFilterUpdated)(EncomspServerContext* context, + ENCOMSP_FILTER_UPDATED_PDU* filterUpdated); +typedef UINT (*psEncomspApplicationCreated)(EncomspServerContext* context, + ENCOMSP_APPLICATION_CREATED_PDU* applicationCreated); +typedef UINT (*psEncomspApplicationRemoved)(EncomspServerContext* context, + ENCOMSP_APPLICATION_REMOVED_PDU* applicationRemoved); +typedef UINT (*psEncomspWindowCreated)(EncomspServerContext* context, + ENCOMSP_WINDOW_CREATED_PDU* windowCreated); +typedef UINT (*psEncomspWindowRemoved)(EncomspServerContext* context, + ENCOMSP_WINDOW_REMOVED_PDU* windowRemoved); +typedef UINT (*psEncomspShowWindow)(EncomspServerContext* context, + ENCOMSP_SHOW_WINDOW_PDU* showWindow); +typedef UINT (*psEncomspParticipantCreated)(EncomspServerContext* context, + ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated); +typedef UINT (*psEncomspParticipantRemoved)(EncomspServerContext* context, + ENCOMSP_PARTICIPANT_REMOVED_PDU* participantRemoved); +typedef UINT (*psEncomspChangeParticipantControlLevel)( + EncomspServerContext* context, + ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* changeParticipantControlLevel); +typedef UINT (*psEncomspGraphicsStreamPaused)( + EncomspServerContext* context, ENCOMSP_GRAPHICS_STREAM_PAUSED_PDU* graphicsStreamPaused); +typedef UINT (*psEncomspGraphicsStreamResumed)( + EncomspServerContext* context, ENCOMSP_GRAPHICS_STREAM_RESUMED_PDU* graphicsStreamResumed); struct _encomsp_server_context { @@ -76,14 +88,15 @@ struct _encomsp_server_context }; #ifdef __cplusplus - extern "C" { +extern "C" +{ #endif -FREERDP_API EncomspServerContext* encomsp_server_context_new(HANDLE vcm); -FREERDP_API void encomsp_server_context_free(EncomspServerContext* context); + FREERDP_API EncomspServerContext* encomsp_server_context_new(HANDLE vcm); + FREERDP_API void encomsp_server_context_free(EncomspServerContext* context); #ifdef __cplusplus - } +} #endif #endif /* FREERDP_CHANNEL_ENCOMSP_SERVER_ENCOMSP_H */ diff --git a/include/freerdp/server/rdpdr.h b/include/freerdp/server/rdpdr.h index a533f61ae..63ddca564 100644 --- a/include/freerdp/server/rdpdr.h +++ b/include/freerdp/server/rdpdr.h @@ -53,35 +53,59 @@ typedef struct _FILE_DIRECTORY_INFORMATION FILE_DIRECTORY_INFORMATION; typedef UINT (*psRdpdrStart)(RdpdrServerContext* context); typedef UINT (*psRdpdrStop)(RdpdrServerContext* context); -typedef UINT (*psRdpdrDriveCreateDirectory)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path); -typedef UINT (*psRdpdrDriveDeleteDirectory)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path); -typedef UINT (*psRdpdrDriveQueryDirectory)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path); -typedef UINT (*psRdpdrDriveOpenFile)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path, UINT32 desiredAccess, UINT32 createDisposition); -typedef UINT (*psRdpdrDriveReadFile)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, UINT32 fileId, UINT32 length, UINT32 offset); -typedef UINT (*psRdpdrDriveWriteFile)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, UINT32 fileId, const char* buffer, UINT32 length, UINT32 offset); -typedef UINT (*psRdpdrDriveCloseFile)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, UINT32 fileId); -typedef UINT (*psRdpdrDriveDeleteFile)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path); -typedef UINT (*psRdpdrDriveRenameFile)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* oldPath, const char* newPath); +typedef UINT (*psRdpdrDriveCreateDirectory)(RdpdrServerContext* context, void* callbackData, + UINT32 deviceId, const char* path); +typedef UINT (*psRdpdrDriveDeleteDirectory)(RdpdrServerContext* context, void* callbackData, + UINT32 deviceId, const char* path); +typedef UINT (*psRdpdrDriveQueryDirectory)(RdpdrServerContext* context, void* callbackData, + UINT32 deviceId, const char* path); +typedef UINT (*psRdpdrDriveOpenFile)(RdpdrServerContext* context, void* callbackData, + UINT32 deviceId, const char* path, UINT32 desiredAccess, + UINT32 createDisposition); +typedef UINT (*psRdpdrDriveReadFile)(RdpdrServerContext* context, void* callbackData, + UINT32 deviceId, UINT32 fileId, UINT32 length, UINT32 offset); +typedef UINT (*psRdpdrDriveWriteFile)(RdpdrServerContext* context, void* callbackData, + UINT32 deviceId, UINT32 fileId, const char* buffer, + UINT32 length, UINT32 offset); +typedef UINT (*psRdpdrDriveCloseFile)(RdpdrServerContext* context, void* callbackData, + UINT32 deviceId, UINT32 fileId); +typedef UINT (*psRdpdrDriveDeleteFile)(RdpdrServerContext* context, void* callbackData, + UINT32 deviceId, const char* path); +typedef UINT (*psRdpdrDriveRenameFile)(RdpdrServerContext* context, void* callbackData, + UINT32 deviceId, const char* oldPath, const char* newPath); -typedef void (*psRdpdrOnDriveCreate)(RdpdrServerContext* context, UINT32 deviceId, const char* name); +typedef void (*psRdpdrOnDriveCreate)(RdpdrServerContext* context, UINT32 deviceId, + const char* name); typedef void (*psRdpdrOnDriveDelete)(RdpdrServerContext* context, UINT32 deviceId); -typedef void (*psRdpdrOnDriveCreateDirectoryComplete)(RdpdrServerContext* context, void* callbackData, UINT32 ioStatus); -typedef void (*psRdpdrOnDriveDeleteDirectoryComplete)(RdpdrServerContext* context, void* callbackData, UINT32 ioStatus); -typedef void (*psRdpdrOnDriveQueryDirectoryComplete)(RdpdrServerContext* context, void* callbackData, UINT32 ioStatus, FILE_DIRECTORY_INFORMATION* fdi); -typedef void (*psRdpdrOnDriveOpenFileComplete)(RdpdrServerContext* context, void* callbackData, UINT32 ioStatus, UINT32 deviceId, UINT32 fileId); -typedef void (*psRdpdrOnDriveReadFileComplete)(RdpdrServerContext* context, void* callbackData, UINT32 ioStatus, const char* buffer, UINT32 length); -typedef void (*psRdpdrOnDriveWriteFileComplete)(RdpdrServerContext* context, void* callbackData, UINT32 ioStatus, UINT32 bytesWritten); -typedef void (*psRdpdrOnDriveCloseFileComplete)(RdpdrServerContext* context, void* callbackData, UINT32 ioStatus); -typedef void (*psRdpdrOnDriveDeleteFileComplete)(RdpdrServerContext* context, void* callbackData, UINT32 ioStatus); -typedef void (*psRdpdrOnDriveRenameFileComplete)(RdpdrServerContext* context, void* callbackData, UINT32 ioStatus); +typedef void (*psRdpdrOnDriveCreateDirectoryComplete)(RdpdrServerContext* context, + void* callbackData, UINT32 ioStatus); +typedef void (*psRdpdrOnDriveDeleteDirectoryComplete)(RdpdrServerContext* context, + void* callbackData, UINT32 ioStatus); +typedef void (*psRdpdrOnDriveQueryDirectoryComplete)(RdpdrServerContext* context, + void* callbackData, UINT32 ioStatus, + FILE_DIRECTORY_INFORMATION* fdi); +typedef void (*psRdpdrOnDriveOpenFileComplete)(RdpdrServerContext* context, void* callbackData, + UINT32 ioStatus, UINT32 deviceId, UINT32 fileId); +typedef void (*psRdpdrOnDriveReadFileComplete)(RdpdrServerContext* context, void* callbackData, + UINT32 ioStatus, const char* buffer, UINT32 length); +typedef void (*psRdpdrOnDriveWriteFileComplete)(RdpdrServerContext* context, void* callbackData, + UINT32 ioStatus, UINT32 bytesWritten); +typedef void (*psRdpdrOnDriveCloseFileComplete)(RdpdrServerContext* context, void* callbackData, + UINT32 ioStatus); +typedef void (*psRdpdrOnDriveDeleteFileComplete)(RdpdrServerContext* context, void* callbackData, + UINT32 ioStatus); +typedef void (*psRdpdrOnDriveRenameFileComplete)(RdpdrServerContext* context, void* callbackData, + UINT32 ioStatus); typedef void (*psRdpdrOnPortCreate)(RdpdrServerContext* context, UINT32 deviceId, const char* name); typedef void (*psRdpdrOnPortDelete)(RdpdrServerContext* context, UINT32 deviceId); -typedef void (*psRdpdrOnPrinterCreate)(RdpdrServerContext* context, UINT32 deviceId, const char* name); +typedef void (*psRdpdrOnPrinterCreate)(RdpdrServerContext* context, UINT32 deviceId, + const char* name); typedef void (*psRdpdrOnPrinterDelete)(RdpdrServerContext* context, UINT32 deviceId); -typedef void (*psRdpdrOnSmartcardCreate)(RdpdrServerContext* context, UINT32 deviceId, const char* name); +typedef void (*psRdpdrOnSmartcardCreate)(RdpdrServerContext* context, UINT32 deviceId, + const char* name); typedef void (*psRdpdrOnSmartcardDelete)(RdpdrServerContext* context, UINT32 deviceId); struct _rdpdr_server_context @@ -142,14 +166,15 @@ struct _rdpdr_server_context }; #ifdef __cplusplus - extern "C" { +extern "C" +{ #endif -FREERDP_API RdpdrServerContext* rdpdr_server_context_new(HANDLE vcm); -FREERDP_API void rdpdr_server_context_free(RdpdrServerContext* context); + FREERDP_API RdpdrServerContext* rdpdr_server_context_new(HANDLE vcm); + FREERDP_API void rdpdr_server_context_free(RdpdrServerContext* context); #ifdef __cplusplus - } +} #endif #endif /* FREERDP_CHANNEL_RDPDR_SERVER_RDPDR_H */ diff --git a/include/freerdp/server/rdpei.h b/include/freerdp/server/rdpei.h index 86db2b4a8..9cd31a442 100644 --- a/include/freerdp/server/rdpei.h +++ b/include/freerdp/server/rdpei.h @@ -26,7 +26,6 @@ #include #include - typedef struct _rdpei_server_context RdpeiServerContext; typedef struct _rdpei_server_private RdpeiServerPrivate; @@ -41,32 +40,31 @@ struct _rdpei_server_context UINT32 protocolFlags; /** callbacks that can be set by the user */ - UINT (*onClientReady)(RdpeiServerContext *context); - UINT (*onTouchEvent)(RdpeiServerContext *context, RDPINPUT_TOUCH_EVENT *touchEvent); - UINT (*onTouchReleased)(RdpeiServerContext *context, BYTE contactId); + UINT (*onClientReady)(RdpeiServerContext* context); + UINT (*onTouchEvent)(RdpeiServerContext* context, RDPINPUT_TOUCH_EVENT* touchEvent); + UINT (*onTouchReleased)(RdpeiServerContext* context, BYTE contactId); - void *user_data; /* user data, useful for callbacks */ + void* user_data; /* user data, useful for callbacks */ }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API RdpeiServerContext* rdpei_server_context_new(HANDLE vcm); -FREERDP_API void rdpei_server_context_reset(RdpeiServerContext *context); -FREERDP_API void rdpei_server_context_free(RdpeiServerContext* context); -FREERDP_API HANDLE rdpei_server_get_event_handle(RdpeiServerContext *context); -FREERDP_API UINT rdpei_server_init(RdpeiServerContext *context); -FREERDP_API UINT rdpei_server_handle_messages(RdpeiServerContext *context); + FREERDP_API RdpeiServerContext* rdpei_server_context_new(HANDLE vcm); + FREERDP_API void rdpei_server_context_reset(RdpeiServerContext* context); + FREERDP_API void rdpei_server_context_free(RdpeiServerContext* context); + FREERDP_API HANDLE rdpei_server_get_event_handle(RdpeiServerContext* context); + FREERDP_API UINT rdpei_server_init(RdpeiServerContext* context); + FREERDP_API UINT rdpei_server_handle_messages(RdpeiServerContext* context); -FREERDP_API UINT rdpei_server_send_sc_ready(RdpeiServerContext *context, UINT32 version); -FREERDP_API UINT rdpei_server_suspend(RdpeiServerContext *context); -FREERDP_API UINT rdpei_server_resume(RdpeiServerContext *context); + FREERDP_API UINT rdpei_server_send_sc_ready(RdpeiServerContext* context, UINT32 version); + FREERDP_API UINT rdpei_server_suspend(RdpeiServerContext* context); + FREERDP_API UINT rdpei_server_resume(RdpeiServerContext* context); #ifdef __cplusplus } #endif - - #endif /* FREERDP_CHANNEL_RDPEI_SERVER_H */ diff --git a/include/freerdp/server/rdpgfx.h b/include/freerdp/server/rdpgfx.h index c8a2bf53b..9e52ca1de 100644 --- a/include/freerdp/server/rdpgfx.h +++ b/include/freerdp/server/rdpgfx.h @@ -29,52 +29,54 @@ typedef struct _rdpgfx_server_private RdpgfxServerPrivate; typedef BOOL (*psRdpgfxServerOpen)(RdpgfxServerContext* context); typedef BOOL (*psRdpgfxServerClose)(RdpgfxServerContext* context); -typedef UINT(*psRdpgfxResetGraphics)(RdpgfxServerContext* context, - const RDPGFX_RESET_GRAPHICS_PDU* resetGraphics); -typedef UINT(*psRdpgfxStartFrame)(RdpgfxServerContext* context, - const RDPGFX_START_FRAME_PDU* startFrame); -typedef UINT(*psRdpgfxEndFrame)(RdpgfxServerContext* context, const RDPGFX_END_FRAME_PDU* endFrame); -typedef UINT(*psRdpgfxSurfaceCommand)(RdpgfxServerContext* context, - const RDPGFX_SURFACE_COMMAND* cmd); -typedef UINT(*psRdpgfxSurfaceFrameCommand)(RdpgfxServerContext* context, - const RDPGFX_SURFACE_COMMAND* cmd, const RDPGFX_START_FRAME_PDU* startFrame, - const RDPGFX_END_FRAME_PDU* endFrame); -typedef UINT(*psRdpgfxDeleteEncodingContext)(RdpgfxServerContext* context, - const RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext); -typedef UINT(*psRdpgfxCreateSurface)(RdpgfxServerContext* context, - const RDPGFX_CREATE_SURFACE_PDU* createSurface); -typedef UINT(*psRdpgfxDeleteSurface)(RdpgfxServerContext* context, - const RDPGFX_DELETE_SURFACE_PDU* deleteSurface); -typedef UINT(*psRdpgfxSolidFill)(RdpgfxServerContext* context, - const RDPGFX_SOLID_FILL_PDU* solidFill); -typedef UINT(*psRdpgfxSurfaceToSurface)(RdpgfxServerContext* context, - const RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface); -typedef UINT(*psRdpgfxSurfaceToCache)(RdpgfxServerContext* context, - const RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache); -typedef UINT(*psRdpgfxCacheToSurface)(RdpgfxServerContext* context, - const RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface); -typedef UINT(*psRdpgfxCacheImportOffer)(RdpgfxServerContext* context, - const RDPGFX_CACHE_IMPORT_OFFER_PDU* cacheImportOffer); -typedef UINT(*psRdpgfxCacheImportReply)(RdpgfxServerContext* context, - const RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply); -typedef UINT(*psRdpgfxEvictCacheEntry)(RdpgfxServerContext* context, - const RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry); -typedef UINT(*psRdpgfxMapSurfaceToOutput)(RdpgfxServerContext* context, - const RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput); -typedef UINT(*psRdpgfxMapSurfaceToWindow)(RdpgfxServerContext* context, - const RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow); -typedef UINT(*psRdpgfxMapSurfaceToScaledOutput)(RdpgfxServerContext* context, - const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* surfaceToOutput); -typedef UINT(*psRdpgfxMapSurfaceToScaledWindow)(RdpgfxServerContext* context, - const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* surfaceToWindow); -typedef UINT(*psRdpgfxCapsAdvertise)(RdpgfxServerContext* context, - const RDPGFX_CAPS_ADVERTISE_PDU* capsAdvertise); -typedef UINT(*psRdpgfxCapsConfirm)(RdpgfxServerContext* context, - const RDPGFX_CAPS_CONFIRM_PDU* capsConfirm); -typedef UINT(*psRdpgfxFrameAcknowledge)(RdpgfxServerContext* context, - const RDPGFX_FRAME_ACKNOWLEDGE_PDU* frameAcknowledge); -typedef UINT(*psRdpgfxQoeFrameAcknowledge)(RdpgfxServerContext* context, - const RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU* qoeFrameAcknowledge); +typedef UINT (*psRdpgfxResetGraphics)(RdpgfxServerContext* context, + const RDPGFX_RESET_GRAPHICS_PDU* resetGraphics); +typedef UINT (*psRdpgfxStartFrame)(RdpgfxServerContext* context, + const RDPGFX_START_FRAME_PDU* startFrame); +typedef UINT (*psRdpgfxEndFrame)(RdpgfxServerContext* context, + const RDPGFX_END_FRAME_PDU* endFrame); +typedef UINT (*psRdpgfxSurfaceCommand)(RdpgfxServerContext* context, + const RDPGFX_SURFACE_COMMAND* cmd); +typedef UINT (*psRdpgfxSurfaceFrameCommand)(RdpgfxServerContext* context, + const RDPGFX_SURFACE_COMMAND* cmd, + const RDPGFX_START_FRAME_PDU* startFrame, + const RDPGFX_END_FRAME_PDU* endFrame); +typedef UINT (*psRdpgfxDeleteEncodingContext)( + RdpgfxServerContext* context, const RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext); +typedef UINT (*psRdpgfxCreateSurface)(RdpgfxServerContext* context, + const RDPGFX_CREATE_SURFACE_PDU* createSurface); +typedef UINT (*psRdpgfxDeleteSurface)(RdpgfxServerContext* context, + const RDPGFX_DELETE_SURFACE_PDU* deleteSurface); +typedef UINT (*psRdpgfxSolidFill)(RdpgfxServerContext* context, + const RDPGFX_SOLID_FILL_PDU* solidFill); +typedef UINT (*psRdpgfxSurfaceToSurface)(RdpgfxServerContext* context, + const RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface); +typedef UINT (*psRdpgfxSurfaceToCache)(RdpgfxServerContext* context, + const RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache); +typedef UINT (*psRdpgfxCacheToSurface)(RdpgfxServerContext* context, + const RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface); +typedef UINT (*psRdpgfxCacheImportOffer)(RdpgfxServerContext* context, + const RDPGFX_CACHE_IMPORT_OFFER_PDU* cacheImportOffer); +typedef UINT (*psRdpgfxCacheImportReply)(RdpgfxServerContext* context, + const RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply); +typedef UINT (*psRdpgfxEvictCacheEntry)(RdpgfxServerContext* context, + const RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry); +typedef UINT (*psRdpgfxMapSurfaceToOutput)(RdpgfxServerContext* context, + const RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput); +typedef UINT (*psRdpgfxMapSurfaceToWindow)(RdpgfxServerContext* context, + const RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow); +typedef UINT (*psRdpgfxMapSurfaceToScaledOutput)( + RdpgfxServerContext* context, const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* surfaceToOutput); +typedef UINT (*psRdpgfxMapSurfaceToScaledWindow)( + RdpgfxServerContext* context, const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* surfaceToWindow); +typedef UINT (*psRdpgfxCapsAdvertise)(RdpgfxServerContext* context, + const RDPGFX_CAPS_ADVERTISE_PDU* capsAdvertise); +typedef UINT (*psRdpgfxCapsConfirm)(RdpgfxServerContext* context, + const RDPGFX_CAPS_CONFIRM_PDU* capsConfirm); +typedef UINT (*psRdpgfxFrameAcknowledge)(RdpgfxServerContext* context, + const RDPGFX_FRAME_ACKNOWLEDGE_PDU* frameAcknowledge); +typedef UINT (*psRdpgfxQoeFrameAcknowledge)( + RdpgfxServerContext* context, const RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU* qoeFrameAcknowledge); struct _rdpgfx_server_context { @@ -113,13 +115,14 @@ struct _rdpgfx_server_context }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API RdpgfxServerContext* rdpgfx_server_context_new(HANDLE vcm); -FREERDP_API void rdpgfx_server_context_free(RdpgfxServerContext* context); -FREERDP_API HANDLE rdpgfx_server_get_event_handle(RdpgfxServerContext* context); -FREERDP_API UINT rdpgfx_server_handle_messages(RdpgfxServerContext* context); + FREERDP_API RdpgfxServerContext* rdpgfx_server_context_new(HANDLE vcm); + FREERDP_API void rdpgfx_server_context_free(RdpgfxServerContext* context); + FREERDP_API HANDLE rdpgfx_server_get_event_handle(RdpgfxServerContext* context); + FREERDP_API UINT rdpgfx_server_handle_messages(RdpgfxServerContext* context); #ifdef __cplusplus } diff --git a/include/freerdp/server/rdpsnd.h b/include/freerdp/server/rdpsnd.h index ee6e87536..fa8347359 100644 --- a/include/freerdp/server/rdpsnd.h +++ b/include/freerdp/server/rdpsnd.h @@ -29,18 +29,18 @@ typedef struct _rdpsnd_server_context RdpsndServerContext; typedef struct _rdpsnd_server_context rdpsnd_server_context; typedef struct _rdpsnd_server_private RdpsndServerPrivate; -typedef UINT(*psRdpsndStart)(RdpsndServerContext* context); -typedef UINT(*psRdpsndStop)(RdpsndServerContext* context); - -typedef UINT(*psRdpsndServerInitialize)(RdpsndServerContext* context, BOOL ownThread); -typedef UINT(*psRdpsndServerSelectFormat)(RdpsndServerContext* context, UINT16 client_format_index); -typedef UINT(*psRdpsndServerSendSamples)(RdpsndServerContext* context, const void* buf, int nframes, - UINT16 wTimestamp); -typedef UINT(*psRdpsndServerConfirmBlock)(RdpsndServerContext* context, BYTE confirmBlockNum, - UINT16 wtimestamp); -typedef UINT(*psRdpsndServerSetVolume)(RdpsndServerContext* context, int left, int right); -typedef UINT(*psRdpsndServerClose)(RdpsndServerContext* context); +typedef UINT (*psRdpsndStart)(RdpsndServerContext* context); +typedef UINT (*psRdpsndStop)(RdpsndServerContext* context); +typedef UINT (*psRdpsndServerInitialize)(RdpsndServerContext* context, BOOL ownThread); +typedef UINT (*psRdpsndServerSelectFormat)(RdpsndServerContext* context, + UINT16 client_format_index); +typedef UINT (*psRdpsndServerSendSamples)(RdpsndServerContext* context, const void* buf, + int nframes, UINT16 wTimestamp); +typedef UINT (*psRdpsndServerConfirmBlock)(RdpsndServerContext* context, BYTE confirmBlockNum, + UINT16 wtimestamp); +typedef UINT (*psRdpsndServerSetVolume)(RdpsndServerContext* context, int left, int right); +typedef UINT (*psRdpsndServerClose)(RdpsndServerContext* context); typedef void (*psRdpsndServerActivated)(RdpsndServerContext* context); @@ -122,15 +122,15 @@ struct _rdpsnd_server_context }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API RdpsndServerContext* rdpsnd_server_context_new(HANDLE vcm); -FREERDP_API void rdpsnd_server_context_reset(RdpsndServerContext*); -FREERDP_API void rdpsnd_server_context_free(RdpsndServerContext* context); -FREERDP_API HANDLE rdpsnd_server_get_event_handle(RdpsndServerContext* context); -FREERDP_API UINT rdpsnd_server_handle_messages(RdpsndServerContext* context); - + FREERDP_API RdpsndServerContext* rdpsnd_server_context_new(HANDLE vcm); + FREERDP_API void rdpsnd_server_context_reset(RdpsndServerContext*); + FREERDP_API void rdpsnd_server_context_free(RdpsndServerContext* context); + FREERDP_API HANDLE rdpsnd_server_get_event_handle(RdpsndServerContext* context); + FREERDP_API UINT rdpsnd_server_handle_messages(RdpsndServerContext* context); #ifdef __cplusplus } diff --git a/include/freerdp/server/remdesk.h b/include/freerdp/server/remdesk.h index e8f531d27..a64ebb47c 100644 --- a/include/freerdp/server/remdesk.h +++ b/include/freerdp/server/remdesk.h @@ -51,15 +51,15 @@ struct _remdesk_server_context }; #ifdef __cplusplus - extern "C" { +extern "C" +{ #endif -FREERDP_API RemdeskServerContext* remdesk_server_context_new(HANDLE vcm); -FREERDP_API void remdesk_server_context_free(RemdeskServerContext* context); + FREERDP_API RemdeskServerContext* remdesk_server_context_new(HANDLE vcm); + FREERDP_API void remdesk_server_context_free(RemdeskServerContext* context); #ifdef __cplusplus - } +} #endif #endif /* FREERDP_CHANNEL_REMDESK_SERVER_REMDESK_H */ - diff --git a/include/freerdp/server/shadow.h b/include/freerdp/server/shadow.h index 5e10422d1..042e34cf8 100644 --- a/include/freerdp/server/shadow.h +++ b/include/freerdp/server/shadow.h @@ -63,32 +63,29 @@ typedef int (*pfnShadowSubsystemUninit)(rdpShadowSubsystem* subsystem); typedef int (*pfnShadowSubsystemStart)(rdpShadowSubsystem* subsystem); typedef int (*pfnShadowSubsystemStop)(rdpShadowSubsystem* subsystem); -typedef UINT32(*pfnShadowEnumMonitors)(MONITOR_DEF* monitors, UINT32 maxMonitors); +typedef UINT32 (*pfnShadowEnumMonitors)(MONITOR_DEF* monitors, UINT32 maxMonitors); -typedef int (*pfnShadowAuthenticate)(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, +typedef int (*pfnShadowAuthenticate)(rdpShadowSubsystem* subsystem, rdpShadowClient* client, const char* user, const char* domain, const char* password); -typedef BOOL (*pfnShadowClientConnect)(rdpShadowSubsystem* subsystem, - rdpShadowClient* client); -typedef void (*pfnShadowClientDisconnect)(rdpShadowSubsystem* subsystem, - rdpShadowClient* client); -typedef BOOL (*pfnShadowClientCapabilities)(rdpShadowSubsystem* subsystem, - rdpShadowClient* client); +typedef BOOL (*pfnShadowClientConnect)(rdpShadowSubsystem* subsystem, rdpShadowClient* client); +typedef void (*pfnShadowClientDisconnect)(rdpShadowSubsystem* subsystem, rdpShadowClient* client); +typedef BOOL (*pfnShadowClientCapabilities)(rdpShadowSubsystem* subsystem, rdpShadowClient* client); -typedef BOOL (*pfnShadowSynchronizeEvent)(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT32 flags); -typedef BOOL (*pfnShadowKeyboardEvent)(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT16 flags, UINT16 code); +typedef BOOL (*pfnShadowSynchronizeEvent)(rdpShadowSubsystem* subsystem, rdpShadowClient* client, + UINT32 flags); +typedef BOOL (*pfnShadowKeyboardEvent)(rdpShadowSubsystem* subsystem, rdpShadowClient* client, + UINT16 flags, UINT16 code); typedef BOOL (*pfnShadowUnicodeKeyboardEvent)(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT16 flags, UINT16 code); -typedef BOOL (*pfnShadowMouseEvent)(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT16 flags, UINT16 x, UINT16 y); -typedef BOOL (*pfnShadowExtendedMouseEvent)(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT16 flags, UINT16 x, UINT16 y); + rdpShadowClient* client, UINT16 flags, UINT16 code); +typedef BOOL (*pfnShadowMouseEvent)(rdpShadowSubsystem* subsystem, rdpShadowClient* client, + UINT16 flags, UINT16 x, UINT16 y); +typedef BOOL (*pfnShadowExtendedMouseEvent)(rdpShadowSubsystem* subsystem, rdpShadowClient* client, + UINT16 flags, UINT16 x, UINT16 y); -typedef BOOL (*pfnShadowChannelAudinServerReceiveSamples)( - rdpShadowSubsystem* subsystem, rdpShadowClient* client, - const AUDIO_FORMAT* format, wStream* buf, size_t nframes); +typedef BOOL (*pfnShadowChannelAudinServerReceiveSamples)(rdpShadowSubsystem* subsystem, + rdpShadowClient* client, + const AUDIO_FORMAT* format, wStream* buf, + size_t nframes); struct rdp_shadow_client { @@ -224,7 +221,7 @@ struct rdp_shadow_subsystem }; /* Definition of message between subsystem and clients */ -#define SHADOW_MSG_IN_REFRESH_REQUEST_ID 1001 +#define SHADOW_MSG_IN_REFRESH_REQUEST_ID 1001 typedef struct _SHADOW_MSG_OUT SHADOW_MSG_OUT; typedef void (*MSG_OUT_FREE_FN)(UINT32 id, @@ -236,10 +233,10 @@ struct _SHADOW_MSG_OUT MSG_OUT_FREE_FN Free; }; -#define SHADOW_MSG_OUT_POINTER_POSITION_UPDATE_ID 2001 -#define SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE_ID 2002 -#define SHADOW_MSG_OUT_AUDIO_OUT_SAMPLES_ID 2003 -#define SHADOW_MSG_OUT_AUDIO_OUT_VOLUME_ID 2004 +#define SHADOW_MSG_OUT_POINTER_POSITION_UPDATE_ID 2001 +#define SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE_ID 2002 +#define SHADOW_MSG_OUT_AUDIO_OUT_SAMPLES_ID 2003 +#define SHADOW_MSG_OUT_AUDIO_OUT_VOLUME_ID 2004 struct _SHADOW_MSG_OUT_POINTER_POSITION_UPDATE { @@ -247,8 +244,7 @@ struct _SHADOW_MSG_OUT_POINTER_POSITION_UPDATE UINT32 xPos; UINT32 yPos; }; -typedef struct _SHADOW_MSG_OUT_POINTER_POSITION_UPDATE - SHADOW_MSG_OUT_POINTER_POSITION_UPDATE; +typedef struct _SHADOW_MSG_OUT_POINTER_POSITION_UPDATE SHADOW_MSG_OUT_POINTER_POSITION_UPDATE; struct _SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE { @@ -262,8 +258,7 @@ struct _SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE BYTE* xorMaskData; BYTE* andMaskData; }; -typedef struct _SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE - SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE; +typedef struct _SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE; struct _SHADOW_MSG_OUT_AUDIO_OUT_SAMPLES { @@ -273,8 +268,7 @@ struct _SHADOW_MSG_OUT_AUDIO_OUT_SAMPLES int nFrames; UINT16 wTimestamp; }; -typedef struct _SHADOW_MSG_OUT_AUDIO_OUT_SAMPLES - SHADOW_MSG_OUT_AUDIO_OUT_SAMPLES; +typedef struct _SHADOW_MSG_OUT_AUDIO_OUT_SAMPLES SHADOW_MSG_OUT_AUDIO_OUT_SAMPLES; struct _SHADOW_MSG_OUT_AUDIO_OUT_VOLUME { @@ -285,54 +279,53 @@ struct _SHADOW_MSG_OUT_AUDIO_OUT_VOLUME typedef struct _SHADOW_MSG_OUT_AUDIO_OUT_VOLUME SHADOW_MSG_OUT_AUDIO_OUT_VOLUME; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API void shadow_subsystem_set_entry_builtin(const char* name); -FREERDP_API void shadow_subsystem_set_entry(pfnShadowSubsystemEntry pEntry); + FREERDP_API void shadow_subsystem_set_entry_builtin(const char* name); + FREERDP_API void shadow_subsystem_set_entry(pfnShadowSubsystemEntry pEntry); -FREERDP_API int shadow_subsystem_pointer_convert_alpha_pointer_data( - BYTE* pixels, BOOL premultiplied, - UINT32 width, UINT32 height, SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE* pointerColor); + FREERDP_API int shadow_subsystem_pointer_convert_alpha_pointer_data( + BYTE* pixels, BOOL premultiplied, UINT32 width, UINT32 height, + SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE* pointerColor); -FREERDP_API int shadow_server_parse_command_line(rdpShadowServer* server, - int argc, char** argv); -FREERDP_API int shadow_server_command_line_status_print(rdpShadowServer* server, - int argc, char** argv, int status); + FREERDP_API int shadow_server_parse_command_line(rdpShadowServer* server, int argc, + char** argv); + FREERDP_API int shadow_server_command_line_status_print(rdpShadowServer* server, int argc, + char** argv, int status); -FREERDP_API int shadow_server_start(rdpShadowServer* server); -FREERDP_API int shadow_server_stop(rdpShadowServer* server); + FREERDP_API int shadow_server_start(rdpShadowServer* server); + FREERDP_API int shadow_server_stop(rdpShadowServer* server); -FREERDP_API int shadow_server_init(rdpShadowServer* server); -FREERDP_API int shadow_server_uninit(rdpShadowServer* server); + FREERDP_API int shadow_server_init(rdpShadowServer* server); + FREERDP_API int shadow_server_uninit(rdpShadowServer* server); -FREERDP_API UINT32 shadow_enum_monitors(MONITOR_DEF* monitors, UINT32 maxMonitors); + FREERDP_API UINT32 shadow_enum_monitors(MONITOR_DEF* monitors, UINT32 maxMonitors); -FREERDP_API rdpShadowServer* shadow_server_new(void); -FREERDP_API void shadow_server_free(rdpShadowServer* server); + FREERDP_API rdpShadowServer* shadow_server_new(void); + FREERDP_API void shadow_server_free(rdpShadowServer* server); -FREERDP_API int shadow_capture_align_clip_rect(RECTANGLE_16* rect, - RECTANGLE_16* clip); -FREERDP_API int shadow_capture_compare(BYTE* pData1, UINT32 nStep1, UINT32 nWidth, - UINT32 nHeight, BYTE* pData2, UINT32 nStep2, RECTANGLE_16* rect); + FREERDP_API int shadow_capture_align_clip_rect(RECTANGLE_16* rect, RECTANGLE_16* clip); + FREERDP_API int shadow_capture_compare(BYTE* pData1, UINT32 nStep1, UINT32 nWidth, + UINT32 nHeight, BYTE* pData2, UINT32 nStep2, + RECTANGLE_16* rect); -FREERDP_API void shadow_subsystem_frame_update(rdpShadowSubsystem* subsystem); + FREERDP_API void shadow_subsystem_frame_update(rdpShadowSubsystem* subsystem); -FREERDP_API BOOL shadow_client_post_msg(rdpShadowClient* client, void* context, - UINT32 type, SHADOW_MSG_OUT* msg, void* lParam); -FREERDP_API int shadow_client_boardcast_msg(rdpShadowServer* server, - void* context, UINT32 type, SHADOW_MSG_OUT* msg, void* lParam); -FREERDP_API int shadow_client_boardcast_quit(rdpShadowServer* server, - int nExitCode); + FREERDP_API BOOL shadow_client_post_msg(rdpShadowClient* client, void* context, UINT32 type, + SHADOW_MSG_OUT* msg, void* lParam); + FREERDP_API int shadow_client_boardcast_msg(rdpShadowServer* server, void* context, UINT32 type, + SHADOW_MSG_OUT* msg, void* lParam); + FREERDP_API int shadow_client_boardcast_quit(rdpShadowServer* server, int nExitCode); -FREERDP_API int shadow_encoder_preferred_fps(rdpShadowEncoder* encoder); -FREERDP_API UINT32 shadow_encoder_inflight_frames(rdpShadowEncoder* encoder); + FREERDP_API int shadow_encoder_preferred_fps(rdpShadowEncoder* encoder); + FREERDP_API UINT32 shadow_encoder_inflight_frames(rdpShadowEncoder* encoder); -FREERDP_API BOOL shadow_screen_resize(rdpShadowScreen* screen); + FREERDP_API BOOL shadow_screen_resize(rdpShadowScreen* screen); #ifdef __cplusplus } #endif #endif /* FREERDP_SERVER_SHADOW_H */ - diff --git a/include/freerdp/session.h b/include/freerdp/session.h index 489453a92..db2a40491 100644 --- a/include/freerdp/session.h +++ b/include/freerdp/session.h @@ -22,19 +22,21 @@ #include /* Logon Information Types */ -#define INFO_TYPE_LOGON 0x00000000 -#define INFO_TYPE_LOGON_LONG 0x00000001 -#define INFO_TYPE_LOGON_PLAIN_NOTIFY 0x00000002 -#define INFO_TYPE_LOGON_EXTENDED_INF 0x00000003 +#define INFO_TYPE_LOGON 0x00000000 +#define INFO_TYPE_LOGON_LONG 0x00000001 +#define INFO_TYPE_LOGON_PLAIN_NOTIFY 0x00000002 +#define INFO_TYPE_LOGON_EXTENDED_INF 0x00000003 -struct rdp_logon_info { +struct rdp_logon_info +{ UINT32 sessionId; - char *username; - char *domain; + char* username; + char* domain; }; typedef struct rdp_logon_info logon_info; -struct rdp_logon_info_ex { +struct rdp_logon_info_ex +{ BOOL haveCookie; UINT32 LogonId; BYTE ArcRandomBits[16]; diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index 7a89c2000..fcc749f1b 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -28,51 +28,51 @@ #include /* RAIL Support Level */ -#define RAIL_LEVEL_SUPPORTED 0x00000001 -#define RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED 0x00000002 -#define RAIL_LEVEL_SHELL_INTEGRATION_SUPPORTED 0x00000004 -#define RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED 0x00000008 +#define RAIL_LEVEL_SUPPORTED 0x00000001 +#define RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED 0x00000002 +#define RAIL_LEVEL_SHELL_INTEGRATION_SUPPORTED 0x00000004 +#define RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED 0x00000008 #define RAIL_LEVEL_SERVER_TO_CLIENT_IME_SYNC_SUPPORTED 0x00000010 -#define RAIL_LEVEL_HIDE_MINIMIZED_APPS_SUPPORTED 0x00000020 -#define RAIL_LEVEL_WINDOW_CLOAKING_SUPPORTED 0x00000040 -#define RAIL_LEVEL_HANDSHAKE_EX_SUPPORTED 0x00000080 +#define RAIL_LEVEL_HIDE_MINIMIZED_APPS_SUPPORTED 0x00000020 +#define RAIL_LEVEL_WINDOW_CLOAKING_SUPPORTED 0x00000040 +#define RAIL_LEVEL_HANDSHAKE_EX_SUPPORTED 0x00000080 /* Performance Flags */ -#define PERF_FLAG_NONE 0x00000000 -#define PERF_DISABLE_WALLPAPER 0x00000001 -#define PERF_DISABLE_FULLWINDOWDRAG 0x00000002 -#define PERF_DISABLE_MENUANIMATIONS 0x00000004 -#define PERF_DISABLE_THEMING 0x00000008 -#define PERF_DISABLE_CURSOR_SHADOW 0x00000020 -#define PERF_DISABLE_CURSORSETTINGS 0x00000040 -#define PERF_ENABLE_FONT_SMOOTHING 0x00000080 -#define PERF_ENABLE_DESKTOP_COMPOSITION 0x00000100 +#define PERF_FLAG_NONE 0x00000000 +#define PERF_DISABLE_WALLPAPER 0x00000001 +#define PERF_DISABLE_FULLWINDOWDRAG 0x00000002 +#define PERF_DISABLE_MENUANIMATIONS 0x00000004 +#define PERF_DISABLE_THEMING 0x00000008 +#define PERF_DISABLE_CURSOR_SHADOW 0x00000020 +#define PERF_DISABLE_CURSORSETTINGS 0x00000040 +#define PERF_ENABLE_FONT_SMOOTHING 0x00000080 +#define PERF_ENABLE_DESKTOP_COMPOSITION 0x00000100 /* Connection Types */ -#define CONNECTION_TYPE_MODEM 0x01 -#define CONNECTION_TYPE_BROADBAND_LOW 0x02 -#define CONNECTION_TYPE_SATELLITE 0x03 -#define CONNECTION_TYPE_BROADBAND_HIGH 0x04 -#define CONNECTION_TYPE_WAN 0x05 -#define CONNECTION_TYPE_LAN 0x06 -#define CONNECTION_TYPE_AUTODETECT 0x07 +#define CONNECTION_TYPE_MODEM 0x01 +#define CONNECTION_TYPE_BROADBAND_LOW 0x02 +#define CONNECTION_TYPE_SATELLITE 0x03 +#define CONNECTION_TYPE_BROADBAND_HIGH 0x04 +#define CONNECTION_TYPE_WAN 0x05 +#define CONNECTION_TYPE_LAN 0x06 +#define CONNECTION_TYPE_AUTODETECT 0x07 /* Client to Server (CS) data blocks */ -#define CS_CORE 0xC001 -#define CS_SECURITY 0xC002 -#define CS_NET 0xC003 -#define CS_CLUSTER 0xC004 -#define CS_MONITOR 0xC005 -#define CS_MCS_MSGCHANNEL 0xC006 -#define CS_MONITOR_EX 0xC008 -#define CS_MULTITRANSPORT 0xC00A +#define CS_CORE 0xC001 +#define CS_SECURITY 0xC002 +#define CS_NET 0xC003 +#define CS_CLUSTER 0xC004 +#define CS_MONITOR 0xC005 +#define CS_MCS_MSGCHANNEL 0xC006 +#define CS_MONITOR_EX 0xC008 +#define CS_MULTITRANSPORT 0xC00A /* Server to Client (SC) data blocks */ -#define SC_CORE 0x0C01 -#define SC_SECURITY 0x0C02 -#define SC_NET 0x0C03 -#define SC_MCS_MSGCHANNEL 0x0C04 -#define SC_MULTITRANSPORT 0x0C08 +#define SC_CORE 0x0C01 +#define SC_SECURITY 0x0C02 +#define SC_NET 0x0C03 +#define SC_MCS_MSGCHANNEL 0x0C04 +#define SC_MULTITRANSPORT 0x0C08 /* RDP versions, see * [MS-RDPBCGR] 2.2.1.3.2 Client Core Data (TS_UD_CS_CORE) @@ -80,181 +80,180 @@ */ typedef enum { - RDP_VERSION_4 = 0x00080001, - RDP_VERSION_5_PLUS = 0x00080004, - RDP_VERSION_10_0 = 0x00080005, - RDP_VERSION_10_1 = 0x00080006, - RDP_VERSION_10_2 = 0x00080007, - RDP_VERSION_10_3 = 0x00080008, - RDP_VERSION_10_4 = 0x00080009, - RDP_VERSION_10_5 = 0x0008000a, - RDP_VERSION_10_6 = 0x0008000b, -} -RDP_VERSION; + RDP_VERSION_4 = 0x00080001, + RDP_VERSION_5_PLUS = 0x00080004, + RDP_VERSION_10_0 = 0x00080005, + RDP_VERSION_10_1 = 0x00080006, + RDP_VERSION_10_2 = 0x00080007, + RDP_VERSION_10_3 = 0x00080008, + RDP_VERSION_10_4 = 0x00080009, + RDP_VERSION_10_5 = 0x0008000a, + RDP_VERSION_10_6 = 0x0008000b, +} RDP_VERSION; /* Color depth */ -#define RNS_UD_COLOR_4BPP 0xCA00 -#define RNS_UD_COLOR_8BPP 0xCA01 -#define RNS_UD_COLOR_16BPP_555 0xCA02 -#define RNS_UD_COLOR_16BPP_565 0xCA03 -#define RNS_UD_COLOR_24BPP 0xCA04 +#define RNS_UD_COLOR_4BPP 0xCA00 +#define RNS_UD_COLOR_8BPP 0xCA01 +#define RNS_UD_COLOR_16BPP_555 0xCA02 +#define RNS_UD_COLOR_16BPP_565 0xCA03 +#define RNS_UD_COLOR_24BPP 0xCA04 /* Secure Access Sequence */ -#define RNS_UD_SAS_DEL 0xAA03 +#define RNS_UD_SAS_DEL 0xAA03 /* Supported Color Depths */ -#define RNS_UD_24BPP_SUPPORT 0x0001 -#define RNS_UD_16BPP_SUPPORT 0x0002 -#define RNS_UD_15BPP_SUPPORT 0x0004 -#define RNS_UD_32BPP_SUPPORT 0x0008 +#define RNS_UD_24BPP_SUPPORT 0x0001 +#define RNS_UD_16BPP_SUPPORT 0x0002 +#define RNS_UD_15BPP_SUPPORT 0x0004 +#define RNS_UD_32BPP_SUPPORT 0x0008 /* Audio Mode */ -#define AUDIO_MODE_REDIRECT 0 /* Bring to this computer */ -#define AUDIO_MODE_PLAY_ON_SERVER 1 /* Leave at remote computer */ -#define AUDIO_MODE_NONE 2 /* Do not play */ +#define AUDIO_MODE_REDIRECT 0 /* Bring to this computer */ +#define AUDIO_MODE_PLAY_ON_SERVER 1 /* Leave at remote computer */ +#define AUDIO_MODE_NONE 2 /* Do not play */ /* Early Capability Flags (Client to Server) */ -#define RNS_UD_CS_SUPPORT_ERRINFO_PDU 0x0001 -#define RNS_UD_CS_WANT_32BPP_SESSION 0x0002 -#define RNS_UD_CS_SUPPORT_STATUSINFO_PDU 0x0004 -#define RNS_UD_CS_STRONG_ASYMMETRIC_KEYS 0x0008 -#define RNS_UD_CS_VALID_CONNECTION_TYPE 0x0020 -#define RNS_UD_CS_SUPPORT_MONITOR_LAYOUT_PDU 0x0040 -#define RNS_UD_CS_SUPPORT_NETWORK_AUTODETECT 0x0080 -#define RNS_UD_CS_SUPPORT_DYNVC_GFX_PROTOCOL 0x0100 -#define RNS_UD_CS_SUPPORT_DYNAMIC_TIME_ZONE 0x0200 -#define RNS_UD_CS_SUPPORT_HEARTBEAT_PDU 0x0400 +#define RNS_UD_CS_SUPPORT_ERRINFO_PDU 0x0001 +#define RNS_UD_CS_WANT_32BPP_SESSION 0x0002 +#define RNS_UD_CS_SUPPORT_STATUSINFO_PDU 0x0004 +#define RNS_UD_CS_STRONG_ASYMMETRIC_KEYS 0x0008 +#define RNS_UD_CS_VALID_CONNECTION_TYPE 0x0020 +#define RNS_UD_CS_SUPPORT_MONITOR_LAYOUT_PDU 0x0040 +#define RNS_UD_CS_SUPPORT_NETWORK_AUTODETECT 0x0080 +#define RNS_UD_CS_SUPPORT_DYNVC_GFX_PROTOCOL 0x0100 +#define RNS_UD_CS_SUPPORT_DYNAMIC_TIME_ZONE 0x0200 +#define RNS_UD_CS_SUPPORT_HEARTBEAT_PDU 0x0400 /* Early Capability Flags (Server to Client) */ -#define RNS_UD_SC_EDGE_ACTIONS_SUPPORTED 0x00000001 -#define RNS_UD_SC_DYNAMIC_DST_SUPPORTED 0x00000002 +#define RNS_UD_SC_EDGE_ACTIONS_SUPPORTED 0x00000001 +#define RNS_UD_SC_DYNAMIC_DST_SUPPORTED 0x00000002 /* Cluster Information Flags */ -#define REDIRECTION_SUPPORTED 0x00000001 -#define REDIRECTED_SESSIONID_FIELD_VALID 0x00000002 -#define REDIRECTED_SMARTCARD 0x00000040 +#define REDIRECTION_SUPPORTED 0x00000001 +#define REDIRECTED_SESSIONID_FIELD_VALID 0x00000002 +#define REDIRECTED_SMARTCARD 0x00000040 -#define REDIRECTION_VERSION1 0x00 -#define REDIRECTION_VERSION2 0x01 -#define REDIRECTION_VERSION3 0x02 -#define REDIRECTION_VERSION4 0x03 -#define REDIRECTION_VERSION5 0x04 -#define REDIRECTION_VERSION6 0x05 +#define REDIRECTION_VERSION1 0x00 +#define REDIRECTION_VERSION2 0x01 +#define REDIRECTION_VERSION3 0x02 +#define REDIRECTION_VERSION4 0x03 +#define REDIRECTION_VERSION5 0x04 +#define REDIRECTION_VERSION6 0x05 -#define MONITOR_PRIMARY 0x00000001 +#define MONITOR_PRIMARY 0x00000001 /* Encryption Methods */ -#define ENCRYPTION_METHOD_NONE 0x00000000 -#define ENCRYPTION_METHOD_40BIT 0x00000001 -#define ENCRYPTION_METHOD_128BIT 0x00000002 -#define ENCRYPTION_METHOD_56BIT 0x00000008 -#define ENCRYPTION_METHOD_FIPS 0x00000010 +#define ENCRYPTION_METHOD_NONE 0x00000000 +#define ENCRYPTION_METHOD_40BIT 0x00000001 +#define ENCRYPTION_METHOD_128BIT 0x00000002 +#define ENCRYPTION_METHOD_56BIT 0x00000008 +#define ENCRYPTION_METHOD_FIPS 0x00000010 /* Encryption Levels */ -#define ENCRYPTION_LEVEL_NONE 0x00000000 -#define ENCRYPTION_LEVEL_LOW 0x00000001 -#define ENCRYPTION_LEVEL_CLIENT_COMPATIBLE 0x00000002 -#define ENCRYPTION_LEVEL_HIGH 0x00000003 -#define ENCRYPTION_LEVEL_FIPS 0x00000004 +#define ENCRYPTION_LEVEL_NONE 0x00000000 +#define ENCRYPTION_LEVEL_LOW 0x00000001 +#define ENCRYPTION_LEVEL_CLIENT_COMPATIBLE 0x00000002 +#define ENCRYPTION_LEVEL_HIGH 0x00000003 +#define ENCRYPTION_LEVEL_FIPS 0x00000004 /* Multitransport Types */ -#define TRANSPORT_TYPE_UDP_FECR 0x00000001 -#define TRANSPORT_TYPE_UDP_FECL 0x00000004 -#define TRANSPORT_TYPE_UDP_PREFERRED 0x00000100 +#define TRANSPORT_TYPE_UDP_FECR 0x00000001 +#define TRANSPORT_TYPE_UDP_FECL 0x00000004 +#define TRANSPORT_TYPE_UDP_PREFERRED 0x00000100 /* Static Virtual Channel Options */ -#define CHANNEL_OPTION_INITIALIZED 0x80000000 -#define CHANNEL_OPTION_ENCRYPT_RDP 0x40000000 -#define CHANNEL_OPTION_ENCRYPT_SC 0x20000000 -#define CHANNEL_OPTION_ENCRYPT_CS 0x10000000 -#define CHANNEL_OPTION_PRI_HIGH 0x08000000 -#define CHANNEL_OPTION_PRI_MED 0x04000000 -#define CHANNEL_OPTION_PRI_LOW 0x02000000 -#define CHANNEL_OPTION_COMPRESS_RDP 0x00800000 -#define CHANNEL_OPTION_COMPRESS 0x00400000 -#define CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000 -#define CHANNEL_REMOTE_CONTROL_PERSISTENT 0x00100000 +#define CHANNEL_OPTION_INITIALIZED 0x80000000 +#define CHANNEL_OPTION_ENCRYPT_RDP 0x40000000 +#define CHANNEL_OPTION_ENCRYPT_SC 0x20000000 +#define CHANNEL_OPTION_ENCRYPT_CS 0x10000000 +#define CHANNEL_OPTION_PRI_HIGH 0x08000000 +#define CHANNEL_OPTION_PRI_MED 0x04000000 +#define CHANNEL_OPTION_PRI_LOW 0x02000000 +#define CHANNEL_OPTION_COMPRESS_RDP 0x00800000 +#define CHANNEL_OPTION_COMPRESS 0x00400000 +#define CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000 +#define CHANNEL_REMOTE_CONTROL_PERSISTENT 0x00100000 /* Auto Reconnect Version */ -#define AUTO_RECONNECT_VERSION_1 0x00000001 +#define AUTO_RECONNECT_VERSION_1 0x00000001 /* Cookie Lengths */ -#define MSTSC_COOKIE_MAX_LENGTH 9 -#define DEFAULT_COOKIE_MAX_LENGTH 0xFF +#define MSTSC_COOKIE_MAX_LENGTH 9 +#define DEFAULT_COOKIE_MAX_LENGTH 0xFF /* Order Support */ -#define NEG_DSTBLT_INDEX 0x00 -#define NEG_PATBLT_INDEX 0x01 -#define NEG_SCRBLT_INDEX 0x02 -#define NEG_MEMBLT_INDEX 0x03 -#define NEG_MEM3BLT_INDEX 0x04 -#define NEG_ATEXTOUT_INDEX 0x05 -#define NEG_AEXTTEXTOUT_INDEX 0x06 /* Must be ignored */ -#define NEG_DRAWNINEGRID_INDEX 0x07 /* Must be ignored */ -#define NEG_LINETO_INDEX 0x08 -#define NEG_MULTI_DRAWNINEGRID_INDEX 0x09 -#define NEG_OPAQUE_RECT_INDEX 0x0A /* Must be ignored */ -#define NEG_SAVEBITMAP_INDEX 0x0B -#define NEG_WTEXTOUT_INDEX 0x0C /* Must be ignored */ -#define NEG_MEMBLT_V2_INDEX 0x0D /* Must be ignored */ -#define NEG_MEM3BLT_V2_INDEX 0x0E /* Must be ignored */ -#define NEG_MULTIDSTBLT_INDEX 0x0F -#define NEG_MULTIPATBLT_INDEX 0x10 -#define NEG_MULTISCRBLT_INDEX 0x11 -#define NEG_MULTIOPAQUERECT_INDEX 0x12 -#define NEG_FAST_INDEX_INDEX 0x13 -#define NEG_POLYGON_SC_INDEX 0x14 -#define NEG_POLYGON_CB_INDEX 0x15 -#define NEG_POLYLINE_INDEX 0x16 -#define NEG_UNUSED23_INDEX 0x17 /* Must be ignored */ -#define NEG_FAST_GLYPH_INDEX 0x18 -#define NEG_ELLIPSE_SC_INDEX 0x19 -#define NEG_ELLIPSE_CB_INDEX 0x1A -#define NEG_GLYPH_INDEX_INDEX 0x1B -#define NEG_GLYPH_WEXTTEXTOUT_INDEX 0x1C /* Must be ignored */ -#define NEG_GLYPH_WLONGTEXTOUT_INDEX 0x1D /* Must be ignored */ -#define NEG_GLYPH_WLONGEXTTEXTOUT_INDEX 0x1E /* Must be ignored */ -#define NEG_UNUSED31_INDEX 0x1F /* Must be ignored */ +#define NEG_DSTBLT_INDEX 0x00 +#define NEG_PATBLT_INDEX 0x01 +#define NEG_SCRBLT_INDEX 0x02 +#define NEG_MEMBLT_INDEX 0x03 +#define NEG_MEM3BLT_INDEX 0x04 +#define NEG_ATEXTOUT_INDEX 0x05 +#define NEG_AEXTTEXTOUT_INDEX 0x06 /* Must be ignored */ +#define NEG_DRAWNINEGRID_INDEX 0x07 /* Must be ignored */ +#define NEG_LINETO_INDEX 0x08 +#define NEG_MULTI_DRAWNINEGRID_INDEX 0x09 +#define NEG_OPAQUE_RECT_INDEX 0x0A /* Must be ignored */ +#define NEG_SAVEBITMAP_INDEX 0x0B +#define NEG_WTEXTOUT_INDEX 0x0C /* Must be ignored */ +#define NEG_MEMBLT_V2_INDEX 0x0D /* Must be ignored */ +#define NEG_MEM3BLT_V2_INDEX 0x0E /* Must be ignored */ +#define NEG_MULTIDSTBLT_INDEX 0x0F +#define NEG_MULTIPATBLT_INDEX 0x10 +#define NEG_MULTISCRBLT_INDEX 0x11 +#define NEG_MULTIOPAQUERECT_INDEX 0x12 +#define NEG_FAST_INDEX_INDEX 0x13 +#define NEG_POLYGON_SC_INDEX 0x14 +#define NEG_POLYGON_CB_INDEX 0x15 +#define NEG_POLYLINE_INDEX 0x16 +#define NEG_UNUSED23_INDEX 0x17 /* Must be ignored */ +#define NEG_FAST_GLYPH_INDEX 0x18 +#define NEG_ELLIPSE_SC_INDEX 0x19 +#define NEG_ELLIPSE_CB_INDEX 0x1A +#define NEG_GLYPH_INDEX_INDEX 0x1B +#define NEG_GLYPH_WEXTTEXTOUT_INDEX 0x1C /* Must be ignored */ +#define NEG_GLYPH_WLONGTEXTOUT_INDEX 0x1D /* Must be ignored */ +#define NEG_GLYPH_WLONGEXTTEXTOUT_INDEX 0x1E /* Must be ignored */ +#define NEG_UNUSED31_INDEX 0x1F /* Must be ignored */ /* Glyph Support Level */ -#define GLYPH_SUPPORT_NONE 0x0000 -#define GLYPH_SUPPORT_PARTIAL 0x0001 -#define GLYPH_SUPPORT_FULL 0x0002 -#define GLYPH_SUPPORT_ENCODE 0x0003 +#define GLYPH_SUPPORT_NONE 0x0000 +#define GLYPH_SUPPORT_PARTIAL 0x0001 +#define GLYPH_SUPPORT_FULL 0x0002 +#define GLYPH_SUPPORT_ENCODE 0x0003 /* Gateway Usage Method */ -#define TSC_PROXY_MODE_NONE_DIRECT 0x0 -#define TSC_PROXY_MODE_DIRECT 0x1 -#define TSC_PROXY_MODE_DETECT 0x2 -#define TSC_PROXY_MODE_DEFAULT 0x3 -#define TSC_PROXY_MODE_NONE_DETECT 0x4 +#define TSC_PROXY_MODE_NONE_DIRECT 0x0 +#define TSC_PROXY_MODE_DIRECT 0x1 +#define TSC_PROXY_MODE_DETECT 0x2 +#define TSC_PROXY_MODE_DEFAULT 0x3 +#define TSC_PROXY_MODE_NONE_DETECT 0x4 /* Gateway Credentials Source */ -#define TSC_PROXY_CREDS_MODE_USERPASS 0x0 -#define TSC_PROXY_CREDS_MODE_SMARTCARD 0x1 -#define TSC_PROXY_CREDS_MODE_ANY 0x2 +#define TSC_PROXY_CREDS_MODE_USERPASS 0x0 +#define TSC_PROXY_CREDS_MODE_SMARTCARD 0x1 +#define TSC_PROXY_CREDS_MODE_ANY 0x2 /* Redirection Flags */ -#define LB_TARGET_NET_ADDRESS 0x00000001 -#define LB_LOAD_BALANCE_INFO 0x00000002 -#define LB_USERNAME 0x00000004 -#define LB_DOMAIN 0x00000008 -#define LB_PASSWORD 0x00000010 -#define LB_DONTSTOREUSERNAME 0x00000020 -#define LB_SMARTCARD_LOGON 0x00000040 -#define LB_NOREDIRECT 0x00000080 -#define LB_TARGET_FQDN 0x00000100 -#define LB_TARGET_NETBIOS_NAME 0x00000200 -#define LB_TARGET_NET_ADDRESSES 0x00000800 -#define LB_CLIENT_TSV_URL 0x00001000 -#define LB_SERVER_TSV_CAPABLE 0x00002000 +#define LB_TARGET_NET_ADDRESS 0x00000001 +#define LB_LOAD_BALANCE_INFO 0x00000002 +#define LB_USERNAME 0x00000004 +#define LB_DOMAIN 0x00000008 +#define LB_PASSWORD 0x00000010 +#define LB_DONTSTOREUSERNAME 0x00000020 +#define LB_SMARTCARD_LOGON 0x00000040 +#define LB_NOREDIRECT 0x00000080 +#define LB_TARGET_FQDN 0x00000100 +#define LB_TARGET_NETBIOS_NAME 0x00000200 +#define LB_TARGET_NET_ADDRESSES 0x00000800 +#define LB_CLIENT_TSV_URL 0x00001000 +#define LB_SERVER_TSV_CAPABLE 0x00002000 -#define LB_PASSWORD_MAX_LENGTH 512 +#define LB_PASSWORD_MAX_LENGTH 512 /* Keyboard Hook */ -#define KEYBOARD_HOOK_LOCAL 0 -#define KEYBOARD_HOOK_REMOTE 1 -#define KEYBOARD_HOOK_FULLSCREEN_ONLY 2 +#define KEYBOARD_HOOK_LOCAL 0 +#define KEYBOARD_HOOK_REMOTE 1 +#define KEYBOARD_HOOK_FULLSCREEN_ONLY 2 struct _TARGET_NET_ADDRESS { @@ -264,39 +263,39 @@ struct _TARGET_NET_ADDRESS typedef struct _TARGET_NET_ADDRESS TARGET_NET_ADDRESS; /* Logon Error Info */ -#define LOGON_MSG_DISCONNECT_REFUSED 0xFFFFFFF9 -#define LOGON_MSG_NO_PERMISSION 0xFFFFFFFA -#define LOGON_MSG_BUMP_OPTIONS 0xFFFFFFFB -#define LOGON_MSG_RECONNECT_OPTIONS 0xFFFFFFFC -#define LOGON_MSG_SESSION_TERMINATE 0xFFFFFFFD -#define LOGON_MSG_SESSION_CONTINUE 0xFFFFFFFE +#define LOGON_MSG_DISCONNECT_REFUSED 0xFFFFFFF9 +#define LOGON_MSG_NO_PERMISSION 0xFFFFFFFA +#define LOGON_MSG_BUMP_OPTIONS 0xFFFFFFFB +#define LOGON_MSG_RECONNECT_OPTIONS 0xFFFFFFFC +#define LOGON_MSG_SESSION_TERMINATE 0xFFFFFFFD +#define LOGON_MSG_SESSION_CONTINUE 0xFFFFFFFE -#define LOGON_FAILED_BAD_PASSWORD 0x00000000 -#define LOGON_FAILED_UPDATE_PASSWORD 0x00000001 -#define LOGON_FAILED_OTHER 0x00000002 -#define LOGON_WARNING 0x00000003 +#define LOGON_FAILED_BAD_PASSWORD 0x00000000 +#define LOGON_FAILED_UPDATE_PASSWORD 0x00000001 +#define LOGON_FAILED_OTHER 0x00000002 +#define LOGON_WARNING 0x00000003 /* Server Status Info */ -#define STATUS_FINDING_DESTINATION 0x00000401 -#define STATUS_LOADING_DESTINATION 0x00000402 -#define STATUS_BRINGING_SESSION_ONLINE 0x00000403 -#define STATUS_REDIRECTING_TO_DESTINATION 0x00000404 -#define STATUS_VM_LOADING 0x00000501 -#define STATUS_VM_WAKING 0x00000502 -#define STATUS_VM_BOOTING 0x00000503 +#define STATUS_FINDING_DESTINATION 0x00000401 +#define STATUS_LOADING_DESTINATION 0x00000402 +#define STATUS_BRINGING_SESSION_ONLINE 0x00000403 +#define STATUS_REDIRECTING_TO_DESTINATION 0x00000404 +#define STATUS_VM_LOADING 0x00000501 +#define STATUS_VM_WAKING 0x00000502 +#define STATUS_VM_BOOTING 0x00000503 /* Compression Flags */ -#define PACKET_COMPR_TYPE_8K 0x00 -#define PACKET_COMPR_TYPE_64K 0x01 -#define PACKET_COMPR_TYPE_RDP6 0x02 -#define PACKET_COMPR_TYPE_RDP61 0x03 -#define PACKET_COMPR_TYPE_RDP8 0x04 +#define PACKET_COMPR_TYPE_8K 0x00 +#define PACKET_COMPR_TYPE_64K 0x01 +#define PACKET_COMPR_TYPE_RDP6 0x02 +#define PACKET_COMPR_TYPE_RDP61 0x03 +#define PACKET_COMPR_TYPE_RDP8 0x04 /* Desktop Rotation Flags */ -#define ORIENTATION_LANDSCAPE 0 -#define ORIENTATION_PORTRAIT 90 -#define ORIENTATION_LANDSCAPE_FLIPPED 180 -#define ORIENTATION_PORTRAIT_FLIPPED 270 +#define ORIENTATION_LANDSCAPE 0 +#define ORIENTATION_PORTRAIT 90 +#define ORIENTATION_LANDSCAPE_FLIPPED 180 +#define ORIENTATION_PORTRAIT_FLIPPED 270 /* ARC_CS_PRIVATE_PACKET */ typedef struct @@ -371,7 +370,7 @@ typedef struct _ADDIN_ARGV ADDIN_ARGV; struct rdp_ext_set { char name[256]; /* plugin name or path */ - void* data; /* plugin data */ + void* data; /* plugin data */ }; /* Bitmap Cache */ @@ -435,11 +434,11 @@ typedef struct rdp_monitor rdpMonitor; /* Device Redirection */ -#define RDPDR_DTYP_SERIAL 0x00000001 -#define RDPDR_DTYP_PARALLEL 0x00000002 -#define RDPDR_DTYP_PRINT 0x00000004 -#define RDPDR_DTYP_FILESYSTEM 0x00000008 -#define RDPDR_DTYP_SMARTCARD 0x00000020 +#define RDPDR_DTYP_SERIAL 0x00000001 +#define RDPDR_DTYP_PARALLEL 0x00000002 +#define RDPDR_DTYP_PRINT 0x00000004 +#define RDPDR_DTYP_FILESYSTEM 0x00000008 +#define RDPDR_DTYP_SMARTCARD 0x00000020 struct _RDPDR_DEVICE { @@ -496,18 +495,18 @@ struct _RDPDR_PARALLEL }; typedef struct _RDPDR_PARALLEL RDPDR_PARALLEL; -#define PROXY_TYPE_NONE 0 -#define PROXY_TYPE_HTTP 1 -#define PROXY_TYPE_SOCKS 2 -#define PROXY_TYPE_IGNORE 0xFFFF +#define PROXY_TYPE_NONE 0 +#define PROXY_TYPE_HTTP 1 +#define PROXY_TYPE_SOCKS 2 +#define PROXY_TYPE_IGNORE 0xFFFF /* Settings */ #ifdef __GNUC__ -#define ALIGN64 __attribute__((aligned(8))) +#define ALIGN64 __attribute__((aligned(8))) #else #ifdef _WIN32 -#define ALIGN64 __declspec(align(8)) +#define ALIGN64 __declspec(align(8)) #else #define ALIGN64 #endif @@ -518,370 +517,369 @@ typedef struct _RDPDR_PARALLEL RDPDR_PARALLEL; * This is generated with a script parsing the rdpSettings data structure */ -#define FreeRDP_instance ( 0) -#define FreeRDP_ServerMode ( 16) -#define FreeRDP_ShareId ( 17) -#define FreeRDP_PduSource ( 18) -#define FreeRDP_ServerPort ( 19) -#define FreeRDP_ServerHostname ( 20) -#define FreeRDP_Username ( 21) -#define FreeRDP_Password ( 22) -#define FreeRDP_Domain ( 23) -#define FreeRDP_PasswordHash ( 24) -#define FreeRDP_WaitForOutputBufferFlush ( 25) -#define FreeRDP_MaxTimeInCheckLoop ( 26) -#define FreeRDP_AcceptedCert ( 27) -#define FreeRDP_AcceptedCertLength ( 28) -#define FreeRDP_RdpVersion ( 128) -#define FreeRDP_DesktopWidth ( 129) -#define FreeRDP_DesktopHeight ( 130) -#define FreeRDP_ColorDepth ( 131) -#define FreeRDP_ConnectionType ( 132) -#define FreeRDP_ClientBuild ( 133) -#define FreeRDP_ClientHostname ( 134) -#define FreeRDP_ClientProductId ( 135) -#define FreeRDP_EarlyCapabilityFlags ( 136) -#define FreeRDP_NetworkAutoDetect ( 137) -#define FreeRDP_SupportAsymetricKeys ( 138) -#define FreeRDP_SupportErrorInfoPdu ( 139) -#define FreeRDP_SupportStatusInfoPdu ( 140) -#define FreeRDP_SupportMonitorLayoutPdu ( 141) -#define FreeRDP_SupportGraphicsPipeline ( 142) -#define FreeRDP_SupportDynamicTimeZone ( 143) -#define FreeRDP_SupportHeartbeatPdu ( 144) -#define FreeRDP_DesktopPhysicalWidth ( 145) -#define FreeRDP_DesktopPhysicalHeight ( 146) -#define FreeRDP_DesktopOrientation ( 147) -#define FreeRDP_DesktopScaleFactor ( 148) -#define FreeRDP_DeviceScaleFactor ( 149) -#define FreeRDP_UseRdpSecurityLayer ( 192) -#define FreeRDP_EncryptionMethods ( 193) -#define FreeRDP_ExtEncryptionMethods ( 194) -#define FreeRDP_EncryptionLevel ( 195) -#define FreeRDP_ServerRandom ( 196) -#define FreeRDP_ServerRandomLength ( 197) -#define FreeRDP_ServerCertificate ( 198) -#define FreeRDP_ServerCertificateLength ( 199) -#define FreeRDP_ClientRandom ( 200) -#define FreeRDP_ClientRandomLength ( 201) -#define FreeRDP_ChannelCount ( 256) -#define FreeRDP_ChannelDefArraySize ( 257) -#define FreeRDP_ChannelDefArray ( 258) -#define FreeRDP_ClusterInfoFlags ( 320) -#define FreeRDP_RedirectedSessionId ( 321) -#define FreeRDP_ConsoleSession ( 322) -#define FreeRDP_MonitorCount ( 384) -#define FreeRDP_MonitorDefArraySize ( 385) -#define FreeRDP_MonitorDefArray ( 386) -#define FreeRDP_SpanMonitors ( 387) -#define FreeRDP_UseMultimon ( 388) -#define FreeRDP_ForceMultimon ( 389) -#define FreeRDP_DesktopPosX ( 390) -#define FreeRDP_DesktopPosY ( 391) -#define FreeRDP_ListMonitors ( 392) -#define FreeRDP_MonitorIds ( 393) -#define FreeRDP_NumMonitorIds ( 394) -#define FreeRDP_MonitorLocalShiftX ( 395) -#define FreeRDP_MonitorLocalShiftY ( 396) -#define FreeRDP_HasMonitorAttributes ( 397) -#define FreeRDP_MultitransportFlags ( 512) -#define FreeRDP_SupportMultitransport ( 513) -#define FreeRDP_AlternateShell ( 640) -#define FreeRDP_ShellWorkingDirectory ( 641) -#define FreeRDP_AutoLogonEnabled ( 704) -#define FreeRDP_CompressionEnabled ( 705) -#define FreeRDP_DisableCtrlAltDel ( 706) -#define FreeRDP_EnableWindowsKey ( 707) -#define FreeRDP_MaximizeShell ( 708) -#define FreeRDP_LogonNotify ( 709) -#define FreeRDP_LogonErrors ( 710) -#define FreeRDP_MouseAttached ( 711) -#define FreeRDP_MouseHasWheel ( 712) -#define FreeRDP_RemoteConsoleAudio ( 713) -#define FreeRDP_AudioPlayback ( 714) -#define FreeRDP_AudioCapture ( 715) -#define FreeRDP_VideoDisable ( 716) -#define FreeRDP_PasswordIsSmartcardPin ( 717) -#define FreeRDP_UsingSavedCredentials ( 718) -#define FreeRDP_ForceEncryptedCsPdu ( 719) -#define FreeRDP_HiDefRemoteApp ( 720) -#define FreeRDP_CompressionLevel ( 721) -#define FreeRDP_IPv6Enabled ( 768) -#define FreeRDP_ClientAddress ( 769) -#define FreeRDP_ClientDir ( 770) -#define FreeRDP_AutoReconnectionEnabled ( 832) -#define FreeRDP_AutoReconnectMaxRetries ( 833) -#define FreeRDP_ClientAutoReconnectCookie ( 834) -#define FreeRDP_ServerAutoReconnectCookie ( 835) -#define FreeRDP_PrintReconnectCookie ( 836) -#define FreeRDP_ClientTimeZone ( 896) -#define FreeRDP_DynamicDSTTimeZoneKeyName ( 897) -#define FreeRDP_DynamicDaylightTimeDisabled ( 898) -#define FreeRDP_PerformanceFlags ( 960) -#define FreeRDP_AllowFontSmoothing ( 961) -#define FreeRDP_DisableWallpaper ( 962) -#define FreeRDP_DisableFullWindowDrag ( 963) -#define FreeRDP_DisableMenuAnims ( 964) -#define FreeRDP_DisableThemes ( 965) -#define FreeRDP_DisableCursorShadow ( 966) -#define FreeRDP_DisableCursorBlinking ( 967) -#define FreeRDP_AllowDesktopComposition ( 968) -#define FreeRDP_RemoteAssistanceMode (1024) -#define FreeRDP_RemoteAssistanceSessionId (1025) -#define FreeRDP_RemoteAssistancePassStub (1026) -#define FreeRDP_RemoteAssistancePassword (1027) -#define FreeRDP_RemoteAssistanceRCTicket (1028) -#define FreeRDP_EncomspVirtualChannel (1029) -#define FreeRDP_RemdeskVirtualChannel (1030) -#define FreeRDP_LyncRdpMode (1031) -#define FreeRDP_TlsSecurity (1088) -#define FreeRDP_NlaSecurity (1089) -#define FreeRDP_RdpSecurity (1090) -#define FreeRDP_ExtSecurity (1091) -#define FreeRDP_Authentication (1092) -#define FreeRDP_RequestedProtocols (1093) -#define FreeRDP_SelectedProtocol (1094) -#define FreeRDP_NegotiationFlags (1095) -#define FreeRDP_NegotiateSecurityLayer (1096) -#define FreeRDP_RestrictedAdminModeRequired (1097) -#define FreeRDP_AuthenticationServiceClass (1098) -#define FreeRDP_DisableCredentialsDelegation (1099) -#define FreeRDP_AuthenticationLevel (1100) -#define FreeRDP_AllowedTlsCiphers (1101) -#define FreeRDP_VmConnectMode (1102) -#define FreeRDP_NtlmSamFile (1103) -#define FreeRDP_FIPSMode (1104) -#define FreeRDP_TlsSecLevel (1105) -#define FreeRDP_MstscCookieMode (1152) -#define FreeRDP_CookieMaxLength (1153) -#define FreeRDP_PreconnectionId (1154) -#define FreeRDP_PreconnectionBlob (1155) -#define FreeRDP_SendPreconnectionPdu (1156) -#define FreeRDP_RedirectionFlags (1216) -#define FreeRDP_TargetNetAddress (1217) -#define FreeRDP_LoadBalanceInfo (1218) -#define FreeRDP_LoadBalanceInfoLength (1219) -#define FreeRDP_RedirectionUsername (1220) -#define FreeRDP_RedirectionDomain (1221) -#define FreeRDP_RedirectionPassword (1222) -#define FreeRDP_RedirectionPasswordLength (1223) -#define FreeRDP_RedirectionTargetFQDN (1224) -#define FreeRDP_RedirectionTargetNetBiosName (1225) -#define FreeRDP_RedirectionTsvUrl (1226) -#define FreeRDP_RedirectionTsvUrlLength (1227) -#define FreeRDP_TargetNetAddressCount (1228) -#define FreeRDP_TargetNetAddresses (1229) -#define FreeRDP_TargetNetPorts (1230) -#define FreeRDP_RedirectionAcceptedCert (1231) -#define FreeRDP_RedirectionAcceptedCertLength (1232) -#define FreeRDP_RedirectionPreferType (1233) -#define FreeRDP_Password51 (1280) -#define FreeRDP_Password51Length (1281) -#define FreeRDP_SmartcardLogon (1282) -#define FreeRDP_PromptForCredentials (1283) -#define FreeRDP_KerberosKdc (1344) -#define FreeRDP_KerberosRealm (1345) -#define FreeRDP_IgnoreCertificate (1408) -#define FreeRDP_CertificateName (1409) -#define FreeRDP_CertificateFile (1410) -#define FreeRDP_PrivateKeyFile (1411) -#define FreeRDP_RdpKeyFile (1412) -#define FreeRDP_RdpServerRsaKey (1413) -#define FreeRDP_RdpServerCertificate (1414) -#define FreeRDP_ExternalCertificateManagement (1415) -#define FreeRDP_CertificateContent (1416) -#define FreeRDP_PrivateKeyContent (1417) -#define FreeRDP_RdpKeyContent (1418) -#define FreeRDP_AutoAcceptCertificate (1419) -#define FreeRDP_AutoDenyCertificate (1420) -#define FreeRDP_Workarea (1536) -#define FreeRDP_Fullscreen (1537) -#define FreeRDP_PercentScreen (1538) -#define FreeRDP_GrabKeyboard (1539) -#define FreeRDP_Decorations (1540) -#define FreeRDP_MouseMotion (1541) -#define FreeRDP_WindowTitle (1542) -#define FreeRDP_ParentWindowId (1543) -#define FreeRDP_AsyncInput (1544) -#define FreeRDP_AsyncUpdate (1545) -#define FreeRDP_AsyncChannels (1546) -#define FreeRDP_ToggleFullscreen (1548) -#define FreeRDP_WmClass (1549) -#define FreeRDP_EmbeddedWindow (1550) -#define FreeRDP_SmartSizing (1551) -#define FreeRDP_XPan (1552) -#define FreeRDP_YPan (1553) -#define FreeRDP_SmartSizingWidth (1554) -#define FreeRDP_SmartSizingHeight (1555) -#define FreeRDP_PercentScreenUseWidth (1556) -#define FreeRDP_PercentScreenUseHeight (1557) -#define FreeRDP_DynamicResolutionUpdate (1558) -#define FreeRDP_SoftwareGdi (1601) -#define FreeRDP_LocalConnection (1602) -#define FreeRDP_AuthenticationOnly (1603) -#define FreeRDP_CredentialsFromStdin (1604) -#define FreeRDP_UnmapButtons (1605) -#define FreeRDP_OldLicenseBehaviour (1606) -#define FreeRDP_ComputerName (1664) -#define FreeRDP_ConnectionFile (1728) -#define FreeRDP_AssistanceFile (1729) -#define FreeRDP_HomePath (1792) -#define FreeRDP_ConfigPath (1793) -#define FreeRDP_CurrentPath (1794) -#define FreeRDP_DumpRemoteFx (1856) -#define FreeRDP_PlayRemoteFx (1857) -#define FreeRDP_DumpRemoteFxFile (1858) -#define FreeRDP_PlayRemoteFxFile (1859) -#define FreeRDP_GatewayUsageMethod (1984) -#define FreeRDP_GatewayPort (1985) -#define FreeRDP_GatewayHostname (1986) -#define FreeRDP_GatewayUsername (1987) -#define FreeRDP_GatewayPassword (1988) -#define FreeRDP_GatewayDomain (1989) -#define FreeRDP_GatewayCredentialsSource (1990) -#define FreeRDP_GatewayUseSameCredentials (1991) -#define FreeRDP_GatewayEnabled (1992) -#define FreeRDP_GatewayBypassLocal (1993) -#define FreeRDP_GatewayRpcTransport (1994) -#define FreeRDP_GatewayHttpTransport (1995) -#define FreeRDP_GatewayUdpTransport (1996) -#define FreeRDP_GatewayAccessToken (1997) -#define FreeRDP_GatewayAcceptedCert (1998) -#define FreeRDP_GatewayAcceptedCertLength (1999) -#define FreeRDP_ProxyType (2015) -#define FreeRDP_ProxyHostname (2016) -#define FreeRDP_ProxyPort (2017) -#define FreeRDP_ProxyUsername (2018) -#define FreeRDP_ProxyPassword (2019) -#define FreeRDP_RemoteApplicationMode (2112) -#define FreeRDP_RemoteApplicationName (2113) -#define FreeRDP_RemoteApplicationIcon (2114) -#define FreeRDP_RemoteApplicationProgram (2115) -#define FreeRDP_RemoteApplicationFile (2116) -#define FreeRDP_RemoteApplicationGuid (2117) -#define FreeRDP_RemoteApplicationCmdLine (2118) -#define FreeRDP_RemoteApplicationExpandCmdLine (2119) -#define FreeRDP_RemoteApplicationExpandWorkingDir (2120) -#define FreeRDP_DisableRemoteAppCapsCheck (2121) -#define FreeRDP_RemoteAppNumIconCaches (2122) -#define FreeRDP_RemoteAppNumIconCacheEntries (2123) -#define FreeRDP_RemoteAppLanguageBarSupported (2124) -#define FreeRDP_RemoteWndSupportLevel (2125) -#define FreeRDP_RemoteApplicationSupportLevel (2126) -#define FreeRDP_RemoteApplicationSupportMask (2127) -#define FreeRDP_RemoteApplicationWorkingDir (2128) -#define FreeRDP_ReceivedCapabilities (2240) -#define FreeRDP_ReceivedCapabilitiesSize (2241) -#define FreeRDP_OsMajorType (2304) -#define FreeRDP_OsMinorType (2305) -#define FreeRDP_RefreshRect (2306) -#define FreeRDP_SuppressOutput (2307) -#define FreeRDP_FastPathOutput (2308) -#define FreeRDP_SaltedChecksum (2309) -#define FreeRDP_LongCredentialsSupported (2310) -#define FreeRDP_NoBitmapCompressionHeader (2311) -#define FreeRDP_BitmapCompressionDisabled (2312) -#define FreeRDP_DesktopResize (2368) -#define FreeRDP_DrawAllowDynamicColorFidelity (2369) -#define FreeRDP_DrawAllowColorSubsampling (2370) -#define FreeRDP_DrawAllowSkipAlpha (2371) -#define FreeRDP_OrderSupport (2432) -#define FreeRDP_BitmapCacheV3Enabled (2433) -#define FreeRDP_AltSecFrameMarkerSupport (2434) -#define FreeRDP_AllowUnanouncedOrdersFromServer (2435) -#define FreeRDP_BitmapCacheEnabled (2497) -#define FreeRDP_BitmapCacheVersion (2498) -#define FreeRDP_AllowCacheWaitingList (2499) -#define FreeRDP_BitmapCachePersistEnabled (2500) -#define FreeRDP_BitmapCacheV2NumCells (2501) -#define FreeRDP_BitmapCacheV2CellInfo (2502) -#define FreeRDP_ColorPointerFlag (2560) -#define FreeRDP_PointerCacheSize (2561) -#define FreeRDP_KeyboardLayout (2624) -#define FreeRDP_KeyboardType (2625) -#define FreeRDP_KeyboardSubType (2626) -#define FreeRDP_KeyboardFunctionKey (2627) -#define FreeRDP_ImeFileName (2628) -#define FreeRDP_UnicodeInput (2629) -#define FreeRDP_FastPathInput (2630) -#define FreeRDP_MultiTouchInput (2631) -#define FreeRDP_MultiTouchGestures (2632) -#define FreeRDP_KeyboardHook (2633) -#define FreeRDP_HasHorizontalWheel (2634) -#define FreeRDP_HasExtendedMouseEvent (2635) -#define FreeRDP_BrushSupportLevel (2688) -#define FreeRDP_GlyphSupportLevel (2752) -#define FreeRDP_GlyphCache (2753) -#define FreeRDP_FragCache (2754) -#define FreeRDP_OffscreenSupportLevel (2816) -#define FreeRDP_OffscreenCacheSize (2817) -#define FreeRDP_OffscreenCacheEntries (2818) -#define FreeRDP_VirtualChannelCompressionFlags (2880) -#define FreeRDP_VirtualChannelChunkSize (2881) -#define FreeRDP_SoundBeepsEnabled (2944) -#define FreeRDP_MultifragMaxRequestSize (3328) -#define FreeRDP_LargePointerFlag (3392) -#define FreeRDP_CompDeskSupportLevel (3456) -#define FreeRDP_SurfaceCommandsEnabled (3520) -#define FreeRDP_FrameMarkerCommandEnabled (3521) -#define FreeRDP_SurfaceFrameMarkerEnabled (3522) -#define FreeRDP_RemoteFxOnly (3648) -#define FreeRDP_RemoteFxCodec (3649) -#define FreeRDP_RemoteFxCodecId (3650) -#define FreeRDP_RemoteFxCodecMode (3651) -#define FreeRDP_RemoteFxImageCodec (3652) -#define FreeRDP_RemoteFxCaptureFlags (3653) -#define FreeRDP_NSCodec (3712) -#define FreeRDP_NSCodecId (3713) -#define FreeRDP_FrameAcknowledge (3714) -#define FreeRDP_NSCodecColorLossLevel (3715) -#define FreeRDP_NSCodecAllowSubsampling (3716) -#define FreeRDP_NSCodecAllowDynamicColorFidelity (3717) -#define FreeRDP_JpegCodec (3776) -#define FreeRDP_JpegCodecId (3777) -#define FreeRDP_JpegQuality (3778) -#define FreeRDP_GfxThinClient (3840) -#define FreeRDP_GfxSmallCache (3841) -#define FreeRDP_GfxProgressive (3842) -#define FreeRDP_GfxProgressiveV2 (3843) -#define FreeRDP_GfxH264 (3844) -#define FreeRDP_GfxAVC444 (3845) -#define FreeRDP_GfxSendQoeAck (3846) -#define FreeRDP_GfxAVC444v2 (3847) -#define FreeRDP_GfxCapsFilter (3848) -#define FreeRDP_BitmapCacheV3CodecId (3904) -#define FreeRDP_DrawNineGridEnabled (3968) -#define FreeRDP_DrawNineGridCacheSize (3969) -#define FreeRDP_DrawNineGridCacheEntries (3970) -#define FreeRDP_DrawGdiPlusEnabled (4032) -#define FreeRDP_DrawGdiPlusCacheEnabled (4033) -#define FreeRDP_DeviceRedirection (4160) -#define FreeRDP_DeviceCount (4161) -#define FreeRDP_DeviceArraySize (4162) -#define FreeRDP_DeviceArray (4163) -#define FreeRDP_RedirectDrives (4288) -#define FreeRDP_RedirectHomeDrive (4289) -#define FreeRDP_DrivesToRedirect (4290) -#define FreeRDP_RedirectSmartCards (4416) -#define FreeRDP_RedirectPrinters (4544) -#define FreeRDP_RedirectSerialPorts (4672) -#define FreeRDP_RedirectParallelPorts (4673) -#define FreeRDP_PreferIPv6OverIPv4 (4674) -#define FreeRDP_RedirectClipboard (4800) -#define FreeRDP_StaticChannelCount (4928) -#define FreeRDP_StaticChannelArraySize (4929) -#define FreeRDP_StaticChannelArray (4930) -#define FreeRDP_DynamicChannelCount (5056) -#define FreeRDP_DynamicChannelArraySize (5057) -#define FreeRDP_DynamicChannelArray (5058) -#define FreeRDP_SupportDynamicChannels (5059) -#define FreeRDP_SupportEchoChannel (5184) -#define FreeRDP_SupportDisplayControl (5185) -#define FreeRDP_SupportGeometryTracking (5186) -#define FreeRDP_SupportSSHAgentChannel (5187) -#define FreeRDP_SupportVideoOptimized (5188) -#define FreeRDP_RDP2TCPArgs (5189) - +#define FreeRDP_instance (0) +#define FreeRDP_ServerMode (16) +#define FreeRDP_ShareId (17) +#define FreeRDP_PduSource (18) +#define FreeRDP_ServerPort (19) +#define FreeRDP_ServerHostname (20) +#define FreeRDP_Username (21) +#define FreeRDP_Password (22) +#define FreeRDP_Domain (23) +#define FreeRDP_PasswordHash (24) +#define FreeRDP_WaitForOutputBufferFlush (25) +#define FreeRDP_MaxTimeInCheckLoop (26) +#define FreeRDP_AcceptedCert (27) +#define FreeRDP_AcceptedCertLength (28) +#define FreeRDP_RdpVersion (128) +#define FreeRDP_DesktopWidth (129) +#define FreeRDP_DesktopHeight (130) +#define FreeRDP_ColorDepth (131) +#define FreeRDP_ConnectionType (132) +#define FreeRDP_ClientBuild (133) +#define FreeRDP_ClientHostname (134) +#define FreeRDP_ClientProductId (135) +#define FreeRDP_EarlyCapabilityFlags (136) +#define FreeRDP_NetworkAutoDetect (137) +#define FreeRDP_SupportAsymetricKeys (138) +#define FreeRDP_SupportErrorInfoPdu (139) +#define FreeRDP_SupportStatusInfoPdu (140) +#define FreeRDP_SupportMonitorLayoutPdu (141) +#define FreeRDP_SupportGraphicsPipeline (142) +#define FreeRDP_SupportDynamicTimeZone (143) +#define FreeRDP_SupportHeartbeatPdu (144) +#define FreeRDP_DesktopPhysicalWidth (145) +#define FreeRDP_DesktopPhysicalHeight (146) +#define FreeRDP_DesktopOrientation (147) +#define FreeRDP_DesktopScaleFactor (148) +#define FreeRDP_DeviceScaleFactor (149) +#define FreeRDP_UseRdpSecurityLayer (192) +#define FreeRDP_EncryptionMethods (193) +#define FreeRDP_ExtEncryptionMethods (194) +#define FreeRDP_EncryptionLevel (195) +#define FreeRDP_ServerRandom (196) +#define FreeRDP_ServerRandomLength (197) +#define FreeRDP_ServerCertificate (198) +#define FreeRDP_ServerCertificateLength (199) +#define FreeRDP_ClientRandom (200) +#define FreeRDP_ClientRandomLength (201) +#define FreeRDP_ChannelCount (256) +#define FreeRDP_ChannelDefArraySize (257) +#define FreeRDP_ChannelDefArray (258) +#define FreeRDP_ClusterInfoFlags (320) +#define FreeRDP_RedirectedSessionId (321) +#define FreeRDP_ConsoleSession (322) +#define FreeRDP_MonitorCount (384) +#define FreeRDP_MonitorDefArraySize (385) +#define FreeRDP_MonitorDefArray (386) +#define FreeRDP_SpanMonitors (387) +#define FreeRDP_UseMultimon (388) +#define FreeRDP_ForceMultimon (389) +#define FreeRDP_DesktopPosX (390) +#define FreeRDP_DesktopPosY (391) +#define FreeRDP_ListMonitors (392) +#define FreeRDP_MonitorIds (393) +#define FreeRDP_NumMonitorIds (394) +#define FreeRDP_MonitorLocalShiftX (395) +#define FreeRDP_MonitorLocalShiftY (396) +#define FreeRDP_HasMonitorAttributes (397) +#define FreeRDP_MultitransportFlags (512) +#define FreeRDP_SupportMultitransport (513) +#define FreeRDP_AlternateShell (640) +#define FreeRDP_ShellWorkingDirectory (641) +#define FreeRDP_AutoLogonEnabled (704) +#define FreeRDP_CompressionEnabled (705) +#define FreeRDP_DisableCtrlAltDel (706) +#define FreeRDP_EnableWindowsKey (707) +#define FreeRDP_MaximizeShell (708) +#define FreeRDP_LogonNotify (709) +#define FreeRDP_LogonErrors (710) +#define FreeRDP_MouseAttached (711) +#define FreeRDP_MouseHasWheel (712) +#define FreeRDP_RemoteConsoleAudio (713) +#define FreeRDP_AudioPlayback (714) +#define FreeRDP_AudioCapture (715) +#define FreeRDP_VideoDisable (716) +#define FreeRDP_PasswordIsSmartcardPin (717) +#define FreeRDP_UsingSavedCredentials (718) +#define FreeRDP_ForceEncryptedCsPdu (719) +#define FreeRDP_HiDefRemoteApp (720) +#define FreeRDP_CompressionLevel (721) +#define FreeRDP_IPv6Enabled (768) +#define FreeRDP_ClientAddress (769) +#define FreeRDP_ClientDir (770) +#define FreeRDP_AutoReconnectionEnabled (832) +#define FreeRDP_AutoReconnectMaxRetries (833) +#define FreeRDP_ClientAutoReconnectCookie (834) +#define FreeRDP_ServerAutoReconnectCookie (835) +#define FreeRDP_PrintReconnectCookie (836) +#define FreeRDP_ClientTimeZone (896) +#define FreeRDP_DynamicDSTTimeZoneKeyName (897) +#define FreeRDP_DynamicDaylightTimeDisabled (898) +#define FreeRDP_PerformanceFlags (960) +#define FreeRDP_AllowFontSmoothing (961) +#define FreeRDP_DisableWallpaper (962) +#define FreeRDP_DisableFullWindowDrag (963) +#define FreeRDP_DisableMenuAnims (964) +#define FreeRDP_DisableThemes (965) +#define FreeRDP_DisableCursorShadow (966) +#define FreeRDP_DisableCursorBlinking (967) +#define FreeRDP_AllowDesktopComposition (968) +#define FreeRDP_RemoteAssistanceMode (1024) +#define FreeRDP_RemoteAssistanceSessionId (1025) +#define FreeRDP_RemoteAssistancePassStub (1026) +#define FreeRDP_RemoteAssistancePassword (1027) +#define FreeRDP_RemoteAssistanceRCTicket (1028) +#define FreeRDP_EncomspVirtualChannel (1029) +#define FreeRDP_RemdeskVirtualChannel (1030) +#define FreeRDP_LyncRdpMode (1031) +#define FreeRDP_TlsSecurity (1088) +#define FreeRDP_NlaSecurity (1089) +#define FreeRDP_RdpSecurity (1090) +#define FreeRDP_ExtSecurity (1091) +#define FreeRDP_Authentication (1092) +#define FreeRDP_RequestedProtocols (1093) +#define FreeRDP_SelectedProtocol (1094) +#define FreeRDP_NegotiationFlags (1095) +#define FreeRDP_NegotiateSecurityLayer (1096) +#define FreeRDP_RestrictedAdminModeRequired (1097) +#define FreeRDP_AuthenticationServiceClass (1098) +#define FreeRDP_DisableCredentialsDelegation (1099) +#define FreeRDP_AuthenticationLevel (1100) +#define FreeRDP_AllowedTlsCiphers (1101) +#define FreeRDP_VmConnectMode (1102) +#define FreeRDP_NtlmSamFile (1103) +#define FreeRDP_FIPSMode (1104) +#define FreeRDP_TlsSecLevel (1105) +#define FreeRDP_MstscCookieMode (1152) +#define FreeRDP_CookieMaxLength (1153) +#define FreeRDP_PreconnectionId (1154) +#define FreeRDP_PreconnectionBlob (1155) +#define FreeRDP_SendPreconnectionPdu (1156) +#define FreeRDP_RedirectionFlags (1216) +#define FreeRDP_TargetNetAddress (1217) +#define FreeRDP_LoadBalanceInfo (1218) +#define FreeRDP_LoadBalanceInfoLength (1219) +#define FreeRDP_RedirectionUsername (1220) +#define FreeRDP_RedirectionDomain (1221) +#define FreeRDP_RedirectionPassword (1222) +#define FreeRDP_RedirectionPasswordLength (1223) +#define FreeRDP_RedirectionTargetFQDN (1224) +#define FreeRDP_RedirectionTargetNetBiosName (1225) +#define FreeRDP_RedirectionTsvUrl (1226) +#define FreeRDP_RedirectionTsvUrlLength (1227) +#define FreeRDP_TargetNetAddressCount (1228) +#define FreeRDP_TargetNetAddresses (1229) +#define FreeRDP_TargetNetPorts (1230) +#define FreeRDP_RedirectionAcceptedCert (1231) +#define FreeRDP_RedirectionAcceptedCertLength (1232) +#define FreeRDP_RedirectionPreferType (1233) +#define FreeRDP_Password51 (1280) +#define FreeRDP_Password51Length (1281) +#define FreeRDP_SmartcardLogon (1282) +#define FreeRDP_PromptForCredentials (1283) +#define FreeRDP_KerberosKdc (1344) +#define FreeRDP_KerberosRealm (1345) +#define FreeRDP_IgnoreCertificate (1408) +#define FreeRDP_CertificateName (1409) +#define FreeRDP_CertificateFile (1410) +#define FreeRDP_PrivateKeyFile (1411) +#define FreeRDP_RdpKeyFile (1412) +#define FreeRDP_RdpServerRsaKey (1413) +#define FreeRDP_RdpServerCertificate (1414) +#define FreeRDP_ExternalCertificateManagement (1415) +#define FreeRDP_CertificateContent (1416) +#define FreeRDP_PrivateKeyContent (1417) +#define FreeRDP_RdpKeyContent (1418) +#define FreeRDP_AutoAcceptCertificate (1419) +#define FreeRDP_AutoDenyCertificate (1420) +#define FreeRDP_Workarea (1536) +#define FreeRDP_Fullscreen (1537) +#define FreeRDP_PercentScreen (1538) +#define FreeRDP_GrabKeyboard (1539) +#define FreeRDP_Decorations (1540) +#define FreeRDP_MouseMotion (1541) +#define FreeRDP_WindowTitle (1542) +#define FreeRDP_ParentWindowId (1543) +#define FreeRDP_AsyncInput (1544) +#define FreeRDP_AsyncUpdate (1545) +#define FreeRDP_AsyncChannels (1546) +#define FreeRDP_ToggleFullscreen (1548) +#define FreeRDP_WmClass (1549) +#define FreeRDP_EmbeddedWindow (1550) +#define FreeRDP_SmartSizing (1551) +#define FreeRDP_XPan (1552) +#define FreeRDP_YPan (1553) +#define FreeRDP_SmartSizingWidth (1554) +#define FreeRDP_SmartSizingHeight (1555) +#define FreeRDP_PercentScreenUseWidth (1556) +#define FreeRDP_PercentScreenUseHeight (1557) +#define FreeRDP_DynamicResolutionUpdate (1558) +#define FreeRDP_SoftwareGdi (1601) +#define FreeRDP_LocalConnection (1602) +#define FreeRDP_AuthenticationOnly (1603) +#define FreeRDP_CredentialsFromStdin (1604) +#define FreeRDP_UnmapButtons (1605) +#define FreeRDP_OldLicenseBehaviour (1606) +#define FreeRDP_ComputerName (1664) +#define FreeRDP_ConnectionFile (1728) +#define FreeRDP_AssistanceFile (1729) +#define FreeRDP_HomePath (1792) +#define FreeRDP_ConfigPath (1793) +#define FreeRDP_CurrentPath (1794) +#define FreeRDP_DumpRemoteFx (1856) +#define FreeRDP_PlayRemoteFx (1857) +#define FreeRDP_DumpRemoteFxFile (1858) +#define FreeRDP_PlayRemoteFxFile (1859) +#define FreeRDP_GatewayUsageMethod (1984) +#define FreeRDP_GatewayPort (1985) +#define FreeRDP_GatewayHostname (1986) +#define FreeRDP_GatewayUsername (1987) +#define FreeRDP_GatewayPassword (1988) +#define FreeRDP_GatewayDomain (1989) +#define FreeRDP_GatewayCredentialsSource (1990) +#define FreeRDP_GatewayUseSameCredentials (1991) +#define FreeRDP_GatewayEnabled (1992) +#define FreeRDP_GatewayBypassLocal (1993) +#define FreeRDP_GatewayRpcTransport (1994) +#define FreeRDP_GatewayHttpTransport (1995) +#define FreeRDP_GatewayUdpTransport (1996) +#define FreeRDP_GatewayAccessToken (1997) +#define FreeRDP_GatewayAcceptedCert (1998) +#define FreeRDP_GatewayAcceptedCertLength (1999) +#define FreeRDP_ProxyType (2015) +#define FreeRDP_ProxyHostname (2016) +#define FreeRDP_ProxyPort (2017) +#define FreeRDP_ProxyUsername (2018) +#define FreeRDP_ProxyPassword (2019) +#define FreeRDP_RemoteApplicationMode (2112) +#define FreeRDP_RemoteApplicationName (2113) +#define FreeRDP_RemoteApplicationIcon (2114) +#define FreeRDP_RemoteApplicationProgram (2115) +#define FreeRDP_RemoteApplicationFile (2116) +#define FreeRDP_RemoteApplicationGuid (2117) +#define FreeRDP_RemoteApplicationCmdLine (2118) +#define FreeRDP_RemoteApplicationExpandCmdLine (2119) +#define FreeRDP_RemoteApplicationExpandWorkingDir (2120) +#define FreeRDP_DisableRemoteAppCapsCheck (2121) +#define FreeRDP_RemoteAppNumIconCaches (2122) +#define FreeRDP_RemoteAppNumIconCacheEntries (2123) +#define FreeRDP_RemoteAppLanguageBarSupported (2124) +#define FreeRDP_RemoteWndSupportLevel (2125) +#define FreeRDP_RemoteApplicationSupportLevel (2126) +#define FreeRDP_RemoteApplicationSupportMask (2127) +#define FreeRDP_RemoteApplicationWorkingDir (2128) +#define FreeRDP_ReceivedCapabilities (2240) +#define FreeRDP_ReceivedCapabilitiesSize (2241) +#define FreeRDP_OsMajorType (2304) +#define FreeRDP_OsMinorType (2305) +#define FreeRDP_RefreshRect (2306) +#define FreeRDP_SuppressOutput (2307) +#define FreeRDP_FastPathOutput (2308) +#define FreeRDP_SaltedChecksum (2309) +#define FreeRDP_LongCredentialsSupported (2310) +#define FreeRDP_NoBitmapCompressionHeader (2311) +#define FreeRDP_BitmapCompressionDisabled (2312) +#define FreeRDP_DesktopResize (2368) +#define FreeRDP_DrawAllowDynamicColorFidelity (2369) +#define FreeRDP_DrawAllowColorSubsampling (2370) +#define FreeRDP_DrawAllowSkipAlpha (2371) +#define FreeRDP_OrderSupport (2432) +#define FreeRDP_BitmapCacheV3Enabled (2433) +#define FreeRDP_AltSecFrameMarkerSupport (2434) +#define FreeRDP_AllowUnanouncedOrdersFromServer (2435) +#define FreeRDP_BitmapCacheEnabled (2497) +#define FreeRDP_BitmapCacheVersion (2498) +#define FreeRDP_AllowCacheWaitingList (2499) +#define FreeRDP_BitmapCachePersistEnabled (2500) +#define FreeRDP_BitmapCacheV2NumCells (2501) +#define FreeRDP_BitmapCacheV2CellInfo (2502) +#define FreeRDP_ColorPointerFlag (2560) +#define FreeRDP_PointerCacheSize (2561) +#define FreeRDP_KeyboardLayout (2624) +#define FreeRDP_KeyboardType (2625) +#define FreeRDP_KeyboardSubType (2626) +#define FreeRDP_KeyboardFunctionKey (2627) +#define FreeRDP_ImeFileName (2628) +#define FreeRDP_UnicodeInput (2629) +#define FreeRDP_FastPathInput (2630) +#define FreeRDP_MultiTouchInput (2631) +#define FreeRDP_MultiTouchGestures (2632) +#define FreeRDP_KeyboardHook (2633) +#define FreeRDP_HasHorizontalWheel (2634) +#define FreeRDP_HasExtendedMouseEvent (2635) +#define FreeRDP_BrushSupportLevel (2688) +#define FreeRDP_GlyphSupportLevel (2752) +#define FreeRDP_GlyphCache (2753) +#define FreeRDP_FragCache (2754) +#define FreeRDP_OffscreenSupportLevel (2816) +#define FreeRDP_OffscreenCacheSize (2817) +#define FreeRDP_OffscreenCacheEntries (2818) +#define FreeRDP_VirtualChannelCompressionFlags (2880) +#define FreeRDP_VirtualChannelChunkSize (2881) +#define FreeRDP_SoundBeepsEnabled (2944) +#define FreeRDP_MultifragMaxRequestSize (3328) +#define FreeRDP_LargePointerFlag (3392) +#define FreeRDP_CompDeskSupportLevel (3456) +#define FreeRDP_SurfaceCommandsEnabled (3520) +#define FreeRDP_FrameMarkerCommandEnabled (3521) +#define FreeRDP_SurfaceFrameMarkerEnabled (3522) +#define FreeRDP_RemoteFxOnly (3648) +#define FreeRDP_RemoteFxCodec (3649) +#define FreeRDP_RemoteFxCodecId (3650) +#define FreeRDP_RemoteFxCodecMode (3651) +#define FreeRDP_RemoteFxImageCodec (3652) +#define FreeRDP_RemoteFxCaptureFlags (3653) +#define FreeRDP_NSCodec (3712) +#define FreeRDP_NSCodecId (3713) +#define FreeRDP_FrameAcknowledge (3714) +#define FreeRDP_NSCodecColorLossLevel (3715) +#define FreeRDP_NSCodecAllowSubsampling (3716) +#define FreeRDP_NSCodecAllowDynamicColorFidelity (3717) +#define FreeRDP_JpegCodec (3776) +#define FreeRDP_JpegCodecId (3777) +#define FreeRDP_JpegQuality (3778) +#define FreeRDP_GfxThinClient (3840) +#define FreeRDP_GfxSmallCache (3841) +#define FreeRDP_GfxProgressive (3842) +#define FreeRDP_GfxProgressiveV2 (3843) +#define FreeRDP_GfxH264 (3844) +#define FreeRDP_GfxAVC444 (3845) +#define FreeRDP_GfxSendQoeAck (3846) +#define FreeRDP_GfxAVC444v2 (3847) +#define FreeRDP_GfxCapsFilter (3848) +#define FreeRDP_BitmapCacheV3CodecId (3904) +#define FreeRDP_DrawNineGridEnabled (3968) +#define FreeRDP_DrawNineGridCacheSize (3969) +#define FreeRDP_DrawNineGridCacheEntries (3970) +#define FreeRDP_DrawGdiPlusEnabled (4032) +#define FreeRDP_DrawGdiPlusCacheEnabled (4033) +#define FreeRDP_DeviceRedirection (4160) +#define FreeRDP_DeviceCount (4161) +#define FreeRDP_DeviceArraySize (4162) +#define FreeRDP_DeviceArray (4163) +#define FreeRDP_RedirectDrives (4288) +#define FreeRDP_RedirectHomeDrive (4289) +#define FreeRDP_DrivesToRedirect (4290) +#define FreeRDP_RedirectSmartCards (4416) +#define FreeRDP_RedirectPrinters (4544) +#define FreeRDP_RedirectSerialPorts (4672) +#define FreeRDP_RedirectParallelPorts (4673) +#define FreeRDP_PreferIPv6OverIPv4 (4674) +#define FreeRDP_RedirectClipboard (4800) +#define FreeRDP_StaticChannelCount (4928) +#define FreeRDP_StaticChannelArraySize (4929) +#define FreeRDP_StaticChannelArray (4930) +#define FreeRDP_DynamicChannelCount (5056) +#define FreeRDP_DynamicChannelArraySize (5057) +#define FreeRDP_DynamicChannelArray (5058) +#define FreeRDP_SupportDynamicChannels (5059) +#define FreeRDP_SupportEchoChannel (5184) +#define FreeRDP_SupportDisplayControl (5185) +#define FreeRDP_SupportGeometryTracking (5186) +#define FreeRDP_SupportSSHAgentChannel (5187) +#define FreeRDP_SupportVideoOptimized (5188) +#define FreeRDP_RDP2TCPArgs (5189) /** * FreeRDP Settings Data Structure @@ -897,106 +895,105 @@ struct rdp_settings * very end of this data structure, in the zone marked as ABI unstable. */ - ALIGN64 void* instance; /* 0 */ + ALIGN64 void* instance; /* 0 */ UINT64 padding001[16 - 1]; /* 1 */ /* Core Parameters */ - ALIGN64 BOOL ServerMode; /* 16 */ - ALIGN64 UINT32 ShareId; /* 17 */ - ALIGN64 UINT32 PduSource; /* 18 */ - ALIGN64 UINT32 ServerPort; /* 19 */ - ALIGN64 char* ServerHostname; /* 20 */ - ALIGN64 char* Username; /* 21 */ - ALIGN64 char* Password; /* 22 */ - ALIGN64 char* Domain; /* 23 */ - ALIGN64 char* PasswordHash; /* 24 */ - ALIGN64 BOOL WaitForOutputBufferFlush; /* 25 */ - ALIGN64 UINT32 MaxTimeInCheckLoop; /* 26 */ - ALIGN64 char* AcceptedCert; /* 27 */ - ALIGN64 UINT32 AcceptedCertLength; /* 28 */ - UINT64 padding0064[64 - 29]; /* 29 */ - UINT64 padding0128[128 - 64]; /* 64 */ + ALIGN64 BOOL ServerMode; /* 16 */ + ALIGN64 UINT32 ShareId; /* 17 */ + ALIGN64 UINT32 PduSource; /* 18 */ + ALIGN64 UINT32 ServerPort; /* 19 */ + ALIGN64 char* ServerHostname; /* 20 */ + ALIGN64 char* Username; /* 21 */ + ALIGN64 char* Password; /* 22 */ + ALIGN64 char* Domain; /* 23 */ + ALIGN64 char* PasswordHash; /* 24 */ + ALIGN64 BOOL WaitForOutputBufferFlush; /* 25 */ + ALIGN64 UINT32 MaxTimeInCheckLoop; /* 26 */ + ALIGN64 char* AcceptedCert; /* 27 */ + ALIGN64 UINT32 AcceptedCertLength; /* 28 */ + UINT64 padding0064[64 - 29]; /* 29 */ + UINT64 padding0128[128 - 64]; /* 64 */ /** * GCC User Data Blocks */ /* Client/Server Core Data */ - ALIGN64 UINT32 RdpVersion; /* 128 */ - ALIGN64 UINT32 DesktopWidth; /* 129 */ - ALIGN64 UINT32 DesktopHeight; /* 130 */ - ALIGN64 UINT32 ColorDepth; /* 131 */ - ALIGN64 UINT32 ConnectionType; /* 132 */ - ALIGN64 UINT32 ClientBuild; /* 133 */ - ALIGN64 char* ClientHostname; /* 134 */ - ALIGN64 char* ClientProductId; /* 135 */ - ALIGN64 UINT32 EarlyCapabilityFlags; /* 136 */ - ALIGN64 BOOL NetworkAutoDetect; /* 137 */ - ALIGN64 BOOL SupportAsymetricKeys; /* 138 */ - ALIGN64 BOOL SupportErrorInfoPdu; /* 139 */ - ALIGN64 BOOL SupportStatusInfoPdu; /* 140 */ - ALIGN64 BOOL SupportMonitorLayoutPdu; /* 141 */ - ALIGN64 BOOL SupportGraphicsPipeline; /* 142 */ - ALIGN64 BOOL SupportDynamicTimeZone; /* 143 */ - ALIGN64 BOOL SupportHeartbeatPdu; /* 144 */ - ALIGN64 UINT32 DesktopPhysicalWidth; /* 145 */ - ALIGN64 UINT32 DesktopPhysicalHeight; /* 146 */ - ALIGN64 UINT16 DesktopOrientation; /* 147 */ - ALIGN64 UINT32 DesktopScaleFactor; /* 148 */ - ALIGN64 UINT32 DeviceScaleFactor; /* 149 */ - UINT64 padding0192[192 - 150]; /* 150 */ + ALIGN64 UINT32 RdpVersion; /* 128 */ + ALIGN64 UINT32 DesktopWidth; /* 129 */ + ALIGN64 UINT32 DesktopHeight; /* 130 */ + ALIGN64 UINT32 ColorDepth; /* 131 */ + ALIGN64 UINT32 ConnectionType; /* 132 */ + ALIGN64 UINT32 ClientBuild; /* 133 */ + ALIGN64 char* ClientHostname; /* 134 */ + ALIGN64 char* ClientProductId; /* 135 */ + ALIGN64 UINT32 EarlyCapabilityFlags; /* 136 */ + ALIGN64 BOOL NetworkAutoDetect; /* 137 */ + ALIGN64 BOOL SupportAsymetricKeys; /* 138 */ + ALIGN64 BOOL SupportErrorInfoPdu; /* 139 */ + ALIGN64 BOOL SupportStatusInfoPdu; /* 140 */ + ALIGN64 BOOL SupportMonitorLayoutPdu; /* 141 */ + ALIGN64 BOOL SupportGraphicsPipeline; /* 142 */ + ALIGN64 BOOL SupportDynamicTimeZone; /* 143 */ + ALIGN64 BOOL SupportHeartbeatPdu; /* 144 */ + ALIGN64 UINT32 DesktopPhysicalWidth; /* 145 */ + ALIGN64 UINT32 DesktopPhysicalHeight; /* 146 */ + ALIGN64 UINT16 DesktopOrientation; /* 147 */ + ALIGN64 UINT32 DesktopScaleFactor; /* 148 */ + ALIGN64 UINT32 DeviceScaleFactor; /* 149 */ + UINT64 padding0192[192 - 150]; /* 150 */ /* Client/Server Security Data */ - ALIGN64 BOOL UseRdpSecurityLayer; /* 192 */ + ALIGN64 BOOL UseRdpSecurityLayer; /* 192 */ ALIGN64 UINT32 EncryptionMethods; /* 193 */ ALIGN64 UINT32 ExtEncryptionMethods; /* 194 */ ALIGN64 UINT32 EncryptionLevel; /* 195 */ - ALIGN64 BYTE* ServerRandom; /* 196 */ + ALIGN64 BYTE* ServerRandom; /* 196 */ ALIGN64 UINT32 ServerRandomLength; /* 197 */ - ALIGN64 BYTE* ServerCertificate; /* 198 */ + ALIGN64 BYTE* ServerCertificate; /* 198 */ ALIGN64 UINT32 ServerCertificateLength; /* 199 */ - ALIGN64 BYTE* ClientRandom; /* 200 */ + ALIGN64 BYTE* ClientRandom; /* 200 */ ALIGN64 UINT32 ClientRandomLength; /* 201 */ - UINT64 padding0256[256 - 202]; /* 202 */ + UINT64 padding0256[256 - 202]; /* 202 */ /* Client Network Data */ - ALIGN64 UINT32 ChannelCount; /* 256 */ - ALIGN64 UINT32 ChannelDefArraySize; /* 257 */ - ALIGN64 CHANNEL_DEF* ChannelDefArray; /* 258 */ - UINT64 padding0320[320 - 259]; /* 259 */ + ALIGN64 UINT32 ChannelCount; /* 256 */ + ALIGN64 UINT32 ChannelDefArraySize; /* 257 */ + ALIGN64 CHANNEL_DEF* ChannelDefArray; /* 258 */ + UINT64 padding0320[320 - 259]; /* 259 */ /* Client Cluster Data */ ALIGN64 UINT32 ClusterInfoFlags; /* 320 */ ALIGN64 UINT32 RedirectedSessionId; /* 321 */ - ALIGN64 BOOL ConsoleSession; /* 322 */ - UINT64 padding0384[384 - 323]; /* 323 */ + ALIGN64 BOOL ConsoleSession; /* 322 */ + UINT64 padding0384[384 - 323]; /* 323 */ /* Client Monitor Data */ - ALIGN64 UINT32 MonitorCount; /* 384 */ - ALIGN64 UINT32 MonitorDefArraySize; /* 385 */ - ALIGN64 rdpMonitor* MonitorDefArray; /* 386 */ - ALIGN64 BOOL SpanMonitors; /* 387 */ - ALIGN64 BOOL UseMultimon; /* 388 */ - ALIGN64 BOOL ForceMultimon; /* 389 */ - ALIGN64 UINT32 DesktopPosX; /* 390 */ - ALIGN64 UINT32 DesktopPosY; /* 391 */ - ALIGN64 BOOL ListMonitors; /* 392 */ - ALIGN64 UINT32* MonitorIds; /* 393 */ - ALIGN64 UINT32 NumMonitorIds; /* 394 */ - ALIGN64 UINT32 MonitorLocalShiftX; /*395 */ - ALIGN64 UINT32 MonitorLocalShiftY; /* 396 */ - ALIGN64 BOOL HasMonitorAttributes; /* 397 */ - UINT64 padding0448[448 - 398]; /* 398 */ - + ALIGN64 UINT32 MonitorCount; /* 384 */ + ALIGN64 UINT32 MonitorDefArraySize; /* 385 */ + ALIGN64 rdpMonitor* MonitorDefArray; /* 386 */ + ALIGN64 BOOL SpanMonitors; /* 387 */ + ALIGN64 BOOL UseMultimon; /* 388 */ + ALIGN64 BOOL ForceMultimon; /* 389 */ + ALIGN64 UINT32 DesktopPosX; /* 390 */ + ALIGN64 UINT32 DesktopPosY; /* 391 */ + ALIGN64 BOOL ListMonitors; /* 392 */ + ALIGN64 UINT32* MonitorIds; /* 393 */ + ALIGN64 UINT32 NumMonitorIds; /* 394 */ + ALIGN64 UINT32 MonitorLocalShiftX; /*395 */ + ALIGN64 UINT32 MonitorLocalShiftY; /* 396 */ + ALIGN64 BOOL HasMonitorAttributes; /* 397 */ + UINT64 padding0448[448 - 398]; /* 398 */ /* Client Message Channel Data */ UINT64 padding0512[512 - 448]; /* 448 */ /* Client Multitransport Channel Data */ - ALIGN64 UINT32 MultitransportFlags; /* 512 */ - ALIGN64 BOOL SupportMultitransport; /* 513 */ - UINT64 padding0576[576 - 514]; /* 514 */ - UINT64 padding0640[640 - 576]; /* 576 */ + ALIGN64 UINT32 MultitransportFlags; /* 512 */ + ALIGN64 BOOL SupportMultitransport; /* 513 */ + UINT64 padding0576[576 - 514]; /* 514 */ + UINT64 padding0640[640 - 576]; /* 576 */ /* * Client Info @@ -1005,188 +1002,188 @@ struct rdp_settings /* Client Info (Shell) */ ALIGN64 char* AlternateShell; /* 640 */ ALIGN64 char* ShellWorkingDirectory; /* 641 */ - UINT64 padding0704[704 - 642]; /* 642 */ + UINT64 padding0704[704 - 642]; /* 642 */ /* Client Info Flags */ - ALIGN64 BOOL AutoLogonEnabled; /* 704 */ - ALIGN64 BOOL CompressionEnabled; /* 705 */ - ALIGN64 BOOL DisableCtrlAltDel; /* 706 */ - ALIGN64 BOOL EnableWindowsKey; /* 707 */ - ALIGN64 BOOL MaximizeShell; /* 708 */ - ALIGN64 BOOL LogonNotify; /* 709 */ - ALIGN64 BOOL LogonErrors; /* 710 */ - ALIGN64 BOOL MouseAttached; /* 711 */ - ALIGN64 BOOL MouseHasWheel; /* 712 */ - ALIGN64 BOOL RemoteConsoleAudio; /* 713 */ - ALIGN64 BOOL AudioPlayback; /* 714 */ - ALIGN64 BOOL AudioCapture; /* 715 */ - ALIGN64 BOOL VideoDisable; /* 716 */ - ALIGN64 BOOL PasswordIsSmartcardPin; /* 717 */ - ALIGN64 BOOL UsingSavedCredentials; /* 718 */ - ALIGN64 BOOL ForceEncryptedCsPdu; /* 719 */ - ALIGN64 BOOL HiDefRemoteApp; /* 720 */ - ALIGN64 UINT32 CompressionLevel; /* 721 */ - UINT64 padding0768[768 - 722]; /* 722 */ + ALIGN64 BOOL AutoLogonEnabled; /* 704 */ + ALIGN64 BOOL CompressionEnabled; /* 705 */ + ALIGN64 BOOL DisableCtrlAltDel; /* 706 */ + ALIGN64 BOOL EnableWindowsKey; /* 707 */ + ALIGN64 BOOL MaximizeShell; /* 708 */ + ALIGN64 BOOL LogonNotify; /* 709 */ + ALIGN64 BOOL LogonErrors; /* 710 */ + ALIGN64 BOOL MouseAttached; /* 711 */ + ALIGN64 BOOL MouseHasWheel; /* 712 */ + ALIGN64 BOOL RemoteConsoleAudio; /* 713 */ + ALIGN64 BOOL AudioPlayback; /* 714 */ + ALIGN64 BOOL AudioCapture; /* 715 */ + ALIGN64 BOOL VideoDisable; /* 716 */ + ALIGN64 BOOL PasswordIsSmartcardPin; /* 717 */ + ALIGN64 BOOL UsingSavedCredentials; /* 718 */ + ALIGN64 BOOL ForceEncryptedCsPdu; /* 719 */ + ALIGN64 BOOL HiDefRemoteApp; /* 720 */ + ALIGN64 UINT32 CompressionLevel; /* 721 */ + UINT64 padding0768[768 - 722]; /* 722 */ /* Client Info (Extra) */ - ALIGN64 BOOL IPv6Enabled; /* 768 */ - ALIGN64 char* ClientAddress; /* 769 */ - ALIGN64 char* ClientDir; /* 770 */ + ALIGN64 BOOL IPv6Enabled; /* 768 */ + ALIGN64 char* ClientAddress; /* 769 */ + ALIGN64 char* ClientDir; /* 770 */ UINT64 padding0832[832 - 771]; /* 771 */ /* Client Info (Auto Reconnection) */ - ALIGN64 BOOL AutoReconnectionEnabled; /* 832 */ - ALIGN64 UINT32 AutoReconnectMaxRetries; /* 833 */ + ALIGN64 BOOL AutoReconnectionEnabled; /* 832 */ + ALIGN64 UINT32 AutoReconnectMaxRetries; /* 833 */ ALIGN64 ARC_CS_PRIVATE_PACKET* ClientAutoReconnectCookie; /* 834 */ ALIGN64 ARC_SC_PRIVATE_PACKET* ServerAutoReconnectCookie; /* 835 */ - ALIGN64 BOOL PrintReconnectCookie; /* 836 */ - UINT64 padding0896[896 - 837]; /* 837 */ + ALIGN64 BOOL PrintReconnectCookie; /* 836 */ + UINT64 padding0896[896 - 837]; /* 837 */ /* Client Info (Time Zone) */ - ALIGN64 TIME_ZONE_INFORMATION* ClientTimeZone; /* 896 */ - ALIGN64 char* DynamicDSTTimeZoneKeyName; /* 897 */ - ALIGN64 BOOL DynamicDaylightTimeDisabled; /* 898 */ - UINT64 padding0960[960 - 899]; /* 899 */ + ALIGN64 TIME_ZONE_INFORMATION* ClientTimeZone; /* 896 */ + ALIGN64 char* DynamicDSTTimeZoneKeyName; /* 897 */ + ALIGN64 BOOL DynamicDaylightTimeDisabled; /* 898 */ + UINT64 padding0960[960 - 899]; /* 899 */ /* Client Info (Performance Flags) */ - ALIGN64 UINT32 PerformanceFlags; /* 960 */ - ALIGN64 BOOL AllowFontSmoothing; /* 961 */ - ALIGN64 BOOL DisableWallpaper; /* 962 */ - ALIGN64 BOOL DisableFullWindowDrag; /* 963 */ - ALIGN64 BOOL DisableMenuAnims; /* 964 */ - ALIGN64 BOOL DisableThemes; /* 965 */ - ALIGN64 BOOL DisableCursorShadow; /* 966 */ - ALIGN64 BOOL DisableCursorBlinking; /* 967 */ - ALIGN64 BOOL AllowDesktopComposition; /* 968 */ - UINT64 padding1024[1024 - 969]; /* 969 */ + ALIGN64 UINT32 PerformanceFlags; /* 960 */ + ALIGN64 BOOL AllowFontSmoothing; /* 961 */ + ALIGN64 BOOL DisableWallpaper; /* 962 */ + ALIGN64 BOOL DisableFullWindowDrag; /* 963 */ + ALIGN64 BOOL DisableMenuAnims; /* 964 */ + ALIGN64 BOOL DisableThemes; /* 965 */ + ALIGN64 BOOL DisableCursorShadow; /* 966 */ + ALIGN64 BOOL DisableCursorBlinking; /* 967 */ + ALIGN64 BOOL AllowDesktopComposition; /* 968 */ + UINT64 padding1024[1024 - 969]; /* 969 */ /* Remote Assistance */ - ALIGN64 BOOL RemoteAssistanceMode; /* 1024 */ + ALIGN64 BOOL RemoteAssistanceMode; /* 1024 */ ALIGN64 char* RemoteAssistanceSessionId; /* 1025 */ ALIGN64 char* RemoteAssistancePassStub; /* 1026 */ ALIGN64 char* RemoteAssistancePassword; /* 1027 */ ALIGN64 char* RemoteAssistanceRCTicket; /* 1028 */ - ALIGN64 BOOL EncomspVirtualChannel; /* 1029 */ - ALIGN64 BOOL RemdeskVirtualChannel; /* 1030 */ - ALIGN64 BOOL LyncRdpMode; /* 1031 */ - UINT64 padding1088[1088 - 1032]; /* 1032 */ + ALIGN64 BOOL EncomspVirtualChannel; /* 1029 */ + ALIGN64 BOOL RemdeskVirtualChannel; /* 1030 */ + ALIGN64 BOOL LyncRdpMode; /* 1031 */ + UINT64 padding1088[1088 - 1032]; /* 1032 */ /** * X.224 Connection Request/Confirm */ /* Protocol Security */ - ALIGN64 BOOL TlsSecurity; /* 1088 */ - ALIGN64 BOOL NlaSecurity; /* 1089 */ - ALIGN64 BOOL RdpSecurity; /* 1090 */ - ALIGN64 BOOL ExtSecurity; /* 1091 */ - ALIGN64 BOOL Authentication; /* 1092 */ - ALIGN64 UINT32 RequestedProtocols; /* 1093 */ - ALIGN64 UINT32 SelectedProtocol; /* 1094 */ - ALIGN64 UINT32 NegotiationFlags; /* 1095 */ - ALIGN64 BOOL NegotiateSecurityLayer; /* 1096 */ - ALIGN64 BOOL RestrictedAdminModeRequired; /* 1097 */ - ALIGN64 char* AuthenticationServiceClass; /* 1098 */ - ALIGN64 BOOL DisableCredentialsDelegation; /* 1099 */ - ALIGN64 UINT32 AuthenticationLevel; /* 1100 */ - ALIGN64 char* AllowedTlsCiphers; /* 1101 */ - ALIGN64 BOOL VmConnectMode; /* 1102 */ - ALIGN64 char* NtlmSamFile; /* 1103 */ - ALIGN64 BOOL FIPSMode; /* 1104 */ - ALIGN64 UINT32 TlsSecLevel; /* 1105 */ - UINT64 padding1152[1152 - 1106]; /* 1106 */ + ALIGN64 BOOL TlsSecurity; /* 1088 */ + ALIGN64 BOOL NlaSecurity; /* 1089 */ + ALIGN64 BOOL RdpSecurity; /* 1090 */ + ALIGN64 BOOL ExtSecurity; /* 1091 */ + ALIGN64 BOOL Authentication; /* 1092 */ + ALIGN64 UINT32 RequestedProtocols; /* 1093 */ + ALIGN64 UINT32 SelectedProtocol; /* 1094 */ + ALIGN64 UINT32 NegotiationFlags; /* 1095 */ + ALIGN64 BOOL NegotiateSecurityLayer; /* 1096 */ + ALIGN64 BOOL RestrictedAdminModeRequired; /* 1097 */ + ALIGN64 char* AuthenticationServiceClass; /* 1098 */ + ALIGN64 BOOL DisableCredentialsDelegation; /* 1099 */ + ALIGN64 UINT32 AuthenticationLevel; /* 1100 */ + ALIGN64 char* AllowedTlsCiphers; /* 1101 */ + ALIGN64 BOOL VmConnectMode; /* 1102 */ + ALIGN64 char* NtlmSamFile; /* 1103 */ + ALIGN64 BOOL FIPSMode; /* 1104 */ + ALIGN64 UINT32 TlsSecLevel; /* 1105 */ + UINT64 padding1152[1152 - 1106]; /* 1106 */ /* Connection Cookie */ - ALIGN64 BOOL MstscCookieMode; /* 1152 */ - ALIGN64 UINT32 CookieMaxLength; /* 1153 */ - ALIGN64 UINT32 PreconnectionId; /* 1154 */ - ALIGN64 char* PreconnectionBlob; /* 1155 */ - ALIGN64 BOOL SendPreconnectionPdu; /* 1156 */ - UINT64 padding1216[1216 - 1157]; /* 1157 */ + ALIGN64 BOOL MstscCookieMode; /* 1152 */ + ALIGN64 UINT32 CookieMaxLength; /* 1153 */ + ALIGN64 UINT32 PreconnectionId; /* 1154 */ + ALIGN64 char* PreconnectionBlob; /* 1155 */ + ALIGN64 BOOL SendPreconnectionPdu; /* 1156 */ + UINT64 padding1216[1216 - 1157]; /* 1157 */ /* Server Redirection */ - ALIGN64 UINT32 RedirectionFlags; /* 1216 */ - ALIGN64 char* TargetNetAddress; /* 1217 */ - ALIGN64 BYTE* LoadBalanceInfo; /* 1218 */ - ALIGN64 UINT32 LoadBalanceInfoLength; /* 1219 */ - ALIGN64 char* RedirectionUsername; /* 1220 */ - ALIGN64 char* RedirectionDomain; /* 1221 */ - ALIGN64 BYTE* RedirectionPassword; /* 1222 */ - ALIGN64 UINT32 RedirectionPasswordLength; /* 1223 */ - ALIGN64 char* RedirectionTargetFQDN; /* 1224 */ - ALIGN64 char* RedirectionTargetNetBiosName; /* 1225 */ - ALIGN64 BYTE* RedirectionTsvUrl; /* 1226 */ - ALIGN64 UINT32 RedirectionTsvUrlLength; /* 1227 */ - ALIGN64 UINT32 TargetNetAddressCount; /* 1228 */ - ALIGN64 char** TargetNetAddresses; /* 1229 */ + ALIGN64 UINT32 RedirectionFlags; /* 1216 */ + ALIGN64 char* TargetNetAddress; /* 1217 */ + ALIGN64 BYTE* LoadBalanceInfo; /* 1218 */ + ALIGN64 UINT32 LoadBalanceInfoLength; /* 1219 */ + ALIGN64 char* RedirectionUsername; /* 1220 */ + ALIGN64 char* RedirectionDomain; /* 1221 */ + ALIGN64 BYTE* RedirectionPassword; /* 1222 */ + ALIGN64 UINT32 RedirectionPasswordLength; /* 1223 */ + ALIGN64 char* RedirectionTargetFQDN; /* 1224 */ + ALIGN64 char* RedirectionTargetNetBiosName; /* 1225 */ + ALIGN64 BYTE* RedirectionTsvUrl; /* 1226 */ + ALIGN64 UINT32 RedirectionTsvUrlLength; /* 1227 */ + ALIGN64 UINT32 TargetNetAddressCount; /* 1228 */ + ALIGN64 char** TargetNetAddresses; /* 1229 */ ALIGN64 UINT32* TargetNetPorts; /* 1230 */ - ALIGN64 char* RedirectionAcceptedCert; /* 1231 */ - ALIGN64 UINT32 RedirectionAcceptedCertLength;/* 1232 */ - ALIGN64 UINT32 RedirectionPreferType; /* 1233 */ - UINT64 padding1280[1280 - 1234]; /* 1234 */ + ALIGN64 char* RedirectionAcceptedCert; /* 1231 */ + ALIGN64 UINT32 RedirectionAcceptedCertLength; /* 1232 */ + ALIGN64 UINT32 RedirectionPreferType; /* 1233 */ + UINT64 padding1280[1280 - 1234]; /* 1234 */ /** * Security */ /* Credentials Cache */ - ALIGN64 BYTE* Password51; /* 1280 */ - ALIGN64 UINT32 Password51Length; /* 1281 */ - ALIGN64 BOOL SmartcardLogon; /* 1282 */ - ALIGN64 BOOL PromptForCredentials; /* 1283 */ - UINT64 padding1344[1344 - 1284]; /* 1284 */ + ALIGN64 BYTE* Password51; /* 1280 */ + ALIGN64 UINT32 Password51Length; /* 1281 */ + ALIGN64 BOOL SmartcardLogon; /* 1282 */ + ALIGN64 BOOL PromptForCredentials; /* 1283 */ + UINT64 padding1344[1344 - 1284]; /* 1284 */ /* Kerberos Authentication */ - ALIGN64 char* KerberosKdc; /* 1344 */ - ALIGN64 char* KerberosRealm; /* 1345 */ + ALIGN64 char* KerberosKdc; /* 1344 */ + ALIGN64 char* KerberosRealm; /* 1345 */ UINT64 padding1408[1408 - 1346]; /* 1346 */ /* Server Certificate */ - ALIGN64 BOOL IgnoreCertificate; /* 1408 */ - ALIGN64 char* CertificateName; /* 1409 */ - ALIGN64 char* CertificateFile; /* 1410 */ - ALIGN64 char* PrivateKeyFile; /* 1411 */ - ALIGN64 char* RdpKeyFile; /* 1412 */ - ALIGN64 rdpRsaKey* RdpServerRsaKey; /* 1413 */ - ALIGN64 rdpCertificate* RdpServerCertificate; /* 1414 */ - ALIGN64 BOOL ExternalCertificateManagement; /* 1415 */ - ALIGN64 char* CertificateContent; /* 1416 */ - ALIGN64 char* PrivateKeyContent; /* 1417 */ - ALIGN64 char* RdpKeyContent; /* 1418 */ - ALIGN64 BOOL AutoAcceptCertificate; /* 1419 */ - ALIGN64 BOOL AutoDenyCertificate; /* 1420 */ - UINT64 padding1472[1472 - 1421]; /* 1421 */ - UINT64 padding1536[1536 - 1472]; /* 1472 */ + ALIGN64 BOOL IgnoreCertificate; /* 1408 */ + ALIGN64 char* CertificateName; /* 1409 */ + ALIGN64 char* CertificateFile; /* 1410 */ + ALIGN64 char* PrivateKeyFile; /* 1411 */ + ALIGN64 char* RdpKeyFile; /* 1412 */ + ALIGN64 rdpRsaKey* RdpServerRsaKey; /* 1413 */ + ALIGN64 rdpCertificate* RdpServerCertificate; /* 1414 */ + ALIGN64 BOOL ExternalCertificateManagement; /* 1415 */ + ALIGN64 char* CertificateContent; /* 1416 */ + ALIGN64 char* PrivateKeyContent; /* 1417 */ + ALIGN64 char* RdpKeyContent; /* 1418 */ + ALIGN64 BOOL AutoAcceptCertificate; /* 1419 */ + ALIGN64 BOOL AutoDenyCertificate; /* 1420 */ + UINT64 padding1472[1472 - 1421]; /* 1421 */ + UINT64 padding1536[1536 - 1472]; /* 1472 */ /** * User Interface */ /* Window Settings */ - ALIGN64 BOOL Workarea; /* 1536 */ - ALIGN64 BOOL Fullscreen; /* 1537 */ - ALIGN64 UINT32 PercentScreen; /* 1538 */ - ALIGN64 BOOL GrabKeyboard; /* 1539 */ - ALIGN64 BOOL Decorations; /* 1540 */ - ALIGN64 BOOL MouseMotion; /* 1541 */ - ALIGN64 char* WindowTitle; /* 1542 */ - ALIGN64 UINT64 ParentWindowId; /* 1543 */ - ALIGN64 BOOL AsyncInput; /* 1544 */ - ALIGN64 BOOL AsyncUpdate; /* 1545 */ - ALIGN64 BOOL AsyncChannels; /* 1546 */ - UINT64 padding1548[1548 - 1547]; /* 1547 */ - ALIGN64 BOOL ToggleFullscreen; /* 1548 */ - ALIGN64 char* WmClass; /* 1549 */ - ALIGN64 BOOL EmbeddedWindow; /* 1550 */ - ALIGN64 BOOL SmartSizing; /* 1551 */ - ALIGN64 INT32 XPan; /* 1552 */ - ALIGN64 INT32 YPan; /* 1553 */ - ALIGN64 UINT32 SmartSizingWidth; /* 1554 */ - ALIGN64 UINT32 SmartSizingHeight; /* 1555 */ - ALIGN64 BOOL PercentScreenUseWidth; /* 1556 */ - ALIGN64 BOOL PercentScreenUseHeight; /* 1557 */ - ALIGN64 BOOL DynamicResolutionUpdate; /* 1558 */ - UINT64 padding1601[1601 - 1559]; /* 1559 */ + ALIGN64 BOOL Workarea; /* 1536 */ + ALIGN64 BOOL Fullscreen; /* 1537 */ + ALIGN64 UINT32 PercentScreen; /* 1538 */ + ALIGN64 BOOL GrabKeyboard; /* 1539 */ + ALIGN64 BOOL Decorations; /* 1540 */ + ALIGN64 BOOL MouseMotion; /* 1541 */ + ALIGN64 char* WindowTitle; /* 1542 */ + ALIGN64 UINT64 ParentWindowId; /* 1543 */ + ALIGN64 BOOL AsyncInput; /* 1544 */ + ALIGN64 BOOL AsyncUpdate; /* 1545 */ + ALIGN64 BOOL AsyncChannels; /* 1546 */ + UINT64 padding1548[1548 - 1547]; /* 1547 */ + ALIGN64 BOOL ToggleFullscreen; /* 1548 */ + ALIGN64 char* WmClass; /* 1549 */ + ALIGN64 BOOL EmbeddedWindow; /* 1550 */ + ALIGN64 BOOL SmartSizing; /* 1551 */ + ALIGN64 INT32 XPan; /* 1552 */ + ALIGN64 INT32 YPan; /* 1553 */ + ALIGN64 UINT32 SmartSizingWidth; /* 1554 */ + ALIGN64 UINT32 SmartSizingHeight; /* 1555 */ + ALIGN64 BOOL PercentScreenUseWidth; /* 1556 */ + ALIGN64 BOOL PercentScreenUseHeight; /* 1557 */ + ALIGN64 BOOL DynamicResolutionUpdate; /* 1558 */ + UINT64 padding1601[1601 - 1559]; /* 1559 */ /* Miscellaneous */ ALIGN64 BOOL SoftwareGdi; /* 1601 */ @@ -1198,25 +1195,25 @@ struct rdp_settings UINT64 padding1664[1664 - 1607]; /* 1607 */ /* Names */ - ALIGN64 char* ComputerName; /* 1664 */ + ALIGN64 char* ComputerName; /* 1664 */ UINT64 padding1728[1728 - 1665]; /* 1665 */ /* Files */ - ALIGN64 char* ConnectionFile; /* 1728 */ - ALIGN64 char* AssistanceFile; /* 1729 */ + ALIGN64 char* ConnectionFile; /* 1728 */ + ALIGN64 char* AssistanceFile; /* 1729 */ UINT64 padding1792[1792 - 1730]; /* 1730 */ /* Paths */ - ALIGN64 char* HomePath; /* 1792 */ - ALIGN64 char* ConfigPath; /* 1793 */ - ALIGN64 char* CurrentPath; /* 1794 */ + ALIGN64 char* HomePath; /* 1792 */ + ALIGN64 char* ConfigPath; /* 1793 */ + ALIGN64 char* CurrentPath; /* 1794 */ UINT64 padding1856[1856 - 1795]; /* 1795 */ /* Recording */ - ALIGN64 BOOL DumpRemoteFx; /* 1856 */ - ALIGN64 BOOL PlayRemoteFx; /* 1857 */ - ALIGN64 char* DumpRemoteFxFile; /* 1858 */ - ALIGN64 char* PlayRemoteFxFile; /* 1859 */ + ALIGN64 BOOL DumpRemoteFx; /* 1856 */ + ALIGN64 BOOL PlayRemoteFx; /* 1857 */ + ALIGN64 char* DumpRemoteFxFile; /* 1858 */ + ALIGN64 char* PlayRemoteFxFile; /* 1859 */ UINT64 padding1920[1920 - 1860]; /* 1860 */ UINT64 padding1984[1984 - 1920]; /* 1920 */ @@ -1227,28 +1224,28 @@ struct rdp_settings /* Gateway */ ALIGN64 UINT32 GatewayUsageMethod; /* 1984 */ ALIGN64 UINT32 GatewayPort; /* 1985 */ - ALIGN64 char* GatewayHostname; /* 1986 */ - ALIGN64 char* GatewayUsername; /* 1987 */ - ALIGN64 char* GatewayPassword; /* 1988 */ - ALIGN64 char* GatewayDomain; /* 1989 */ + ALIGN64 char* GatewayHostname; /* 1986 */ + ALIGN64 char* GatewayUsername; /* 1987 */ + ALIGN64 char* GatewayPassword; /* 1988 */ + ALIGN64 char* GatewayDomain; /* 1989 */ ALIGN64 UINT32 GatewayCredentialsSource; /* 1990 */ - ALIGN64 BOOL GatewayUseSameCredentials; /* 1991 */ - ALIGN64 BOOL GatewayEnabled; /* 1992 */ - ALIGN64 BOOL GatewayBypassLocal; /* 1993 */ - ALIGN64 BOOL GatewayRpcTransport; /* 1994 */ - ALIGN64 BOOL GatewayHttpTransport; /* 1995 */ - ALIGN64 BOOL GatewayUdpTransport; /* 1996 */ - ALIGN64 char* GatewayAccessToken; /* 1997 */ - ALIGN64 char* GatewayAcceptedCert; /* 1998 */ + ALIGN64 BOOL GatewayUseSameCredentials; /* 1991 */ + ALIGN64 BOOL GatewayEnabled; /* 1992 */ + ALIGN64 BOOL GatewayBypassLocal; /* 1993 */ + ALIGN64 BOOL GatewayRpcTransport; /* 1994 */ + ALIGN64 BOOL GatewayHttpTransport; /* 1995 */ + ALIGN64 BOOL GatewayUdpTransport; /* 1996 */ + ALIGN64 char* GatewayAccessToken; /* 1997 */ + ALIGN64 char* GatewayAcceptedCert; /* 1998 */ ALIGN64 UINT32 GatewayAcceptedCertLength; /* 1999 */ - UINT64 padding2015[2015 - 2000]; /* 2000 */ + UINT64 padding2015[2015 - 2000]; /* 2000 */ /* Proxy */ - ALIGN64 UINT32 ProxyType; /* 2015 */ - ALIGN64 char* ProxyHostname; /* 2016 */ - ALIGN64 UINT16 ProxyPort; /* 2017 */ - ALIGN64 char* ProxyUsername; /* 2018 */ - ALIGN64 char* ProxyPassword; /* 2019 */ + ALIGN64 UINT32 ProxyType; /* 2015 */ + ALIGN64 char* ProxyHostname; /* 2016 */ + ALIGN64 UINT16 ProxyPort; /* 2017 */ + ALIGN64 char* ProxyUsername; /* 2018 */ + ALIGN64 char* ProxyPassword; /* 2019 */ UINT64 padding2112[2112 - 2020]; /* 2020 */ /** @@ -1256,113 +1253,113 @@ struct rdp_settings */ /* RemoteApp */ - ALIGN64 BOOL RemoteApplicationMode; /* 2112 */ - ALIGN64 char* RemoteApplicationName; /* 2113 */ - ALIGN64 char* RemoteApplicationIcon; /* 2114 */ - ALIGN64 char* RemoteApplicationProgram; /* 2115 */ - ALIGN64 char* RemoteApplicationFile; /* 2116 */ - ALIGN64 char* RemoteApplicationGuid; /* 2117 */ - ALIGN64 char* RemoteApplicationCmdLine; /* 2118 */ + ALIGN64 BOOL RemoteApplicationMode; /* 2112 */ + ALIGN64 char* RemoteApplicationName; /* 2113 */ + ALIGN64 char* RemoteApplicationIcon; /* 2114 */ + ALIGN64 char* RemoteApplicationProgram; /* 2115 */ + ALIGN64 char* RemoteApplicationFile; /* 2116 */ + ALIGN64 char* RemoteApplicationGuid; /* 2117 */ + ALIGN64 char* RemoteApplicationCmdLine; /* 2118 */ ALIGN64 UINT32 RemoteApplicationExpandCmdLine; /* 2119 */ ALIGN64 UINT32 RemoteApplicationExpandWorkingDir; /* 2120 */ - ALIGN64 BOOL DisableRemoteAppCapsCheck; /* 2121 */ + ALIGN64 BOOL DisableRemoteAppCapsCheck; /* 2121 */ ALIGN64 UINT32 RemoteAppNumIconCaches; /* 2122 */ ALIGN64 UINT32 RemoteAppNumIconCacheEntries; /* 2123 */ - ALIGN64 BOOL RemoteAppLanguageBarSupported; /* 2124 */ + ALIGN64 BOOL RemoteAppLanguageBarSupported; /* 2124 */ ALIGN64 UINT32 RemoteWndSupportLevel; /* 2125 */ ALIGN64 UINT32 RemoteApplicationSupportLevel; /* 2126 */ ALIGN64 UINT32 RemoteApplicationSupportMask; /* 2127 */ - ALIGN64 char* RemoteApplicationWorkingDir; /* 2128 */ - UINT64 padding2176[2176 - 2129]; /* 2129 */ - UINT64 padding2240[2240 - 2176]; /* 2176 */ + ALIGN64 char* RemoteApplicationWorkingDir; /* 2128 */ + UINT64 padding2176[2176 - 2129]; /* 2129 */ + UINT64 padding2240[2240 - 2176]; /* 2176 */ /** * Mandatory Capabilities */ /* Capabilities */ - ALIGN64 BYTE* ReceivedCapabilities; /* 2240 */ + ALIGN64 BYTE* ReceivedCapabilities; /* 2240 */ ALIGN64 UINT32 ReceivedCapabilitiesSize; /* 2241 */ - UINT64 padding2304[2304 - 2242]; /* 2242 */ + UINT64 padding2304[2304 - 2242]; /* 2242 */ /* General Capabilities */ - ALIGN64 UINT32 OsMajorType; /* 2304 */ - ALIGN64 UINT32 OsMinorType; /* 2305 */ - ALIGN64 BOOL RefreshRect; /* 2306 */ - ALIGN64 BOOL SuppressOutput; /* 2307 */ - ALIGN64 BOOL FastPathOutput; /* 2308 */ - ALIGN64 BOOL SaltedChecksum; /* 2309 */ - ALIGN64 BOOL LongCredentialsSupported; /* 2310 */ - ALIGN64 BOOL NoBitmapCompressionHeader; /* 2311 */ - ALIGN64 BOOL BitmapCompressionDisabled; /* 2312 */ - UINT64 padding2368[2368 - 2313]; /* 2313 */ + ALIGN64 UINT32 OsMajorType; /* 2304 */ + ALIGN64 UINT32 OsMinorType; /* 2305 */ + ALIGN64 BOOL RefreshRect; /* 2306 */ + ALIGN64 BOOL SuppressOutput; /* 2307 */ + ALIGN64 BOOL FastPathOutput; /* 2308 */ + ALIGN64 BOOL SaltedChecksum; /* 2309 */ + ALIGN64 BOOL LongCredentialsSupported; /* 2310 */ + ALIGN64 BOOL NoBitmapCompressionHeader; /* 2311 */ + ALIGN64 BOOL BitmapCompressionDisabled; /* 2312 */ + UINT64 padding2368[2368 - 2313]; /* 2313 */ /* Bitmap Capabilities */ ALIGN64 BOOL DesktopResize; /* 2368 */ ALIGN64 BOOL DrawAllowDynamicColorFidelity; /* 2369 */ ALIGN64 BOOL DrawAllowColorSubsampling; /* 2370 */ ALIGN64 BOOL DrawAllowSkipAlpha; /* 2371 */ - UINT64 padding2432[2432 - 2372]; /* 2372 */ + UINT64 padding2432[2432 - 2372]; /* 2372 */ /* Order Capabilities */ - ALIGN64 BYTE* OrderSupport; /* 2432 */ - ALIGN64 BOOL BitmapCacheV3Enabled; /* 2433 */ - ALIGN64 BOOL AltSecFrameMarkerSupport; /* 2434 */ - ALIGN64 BOOL AllowUnanouncedOrdersFromServer; /* 2435 */ - UINT64 padding2497[2497 - 2436]; /* 2436 */ + ALIGN64 BYTE* OrderSupport; /* 2432 */ + ALIGN64 BOOL BitmapCacheV3Enabled; /* 2433 */ + ALIGN64 BOOL AltSecFrameMarkerSupport; /* 2434 */ + ALIGN64 BOOL AllowUnanouncedOrdersFromServer; /* 2435 */ + UINT64 padding2497[2497 - 2436]; /* 2436 */ /* Bitmap Cache Capabilities */ - ALIGN64 BOOL BitmapCacheEnabled; /* 2497 */ - ALIGN64 UINT32 BitmapCacheVersion; /* 2498 */ - ALIGN64 BOOL AllowCacheWaitingList; /* 2499 */ - ALIGN64 BOOL BitmapCachePersistEnabled; /* 2500 */ - ALIGN64 UINT32 BitmapCacheV2NumCells; /* 2501 */ - ALIGN64 BITMAP_CACHE_V2_CELL_INFO* BitmapCacheV2CellInfo; /* 2502 */ - UINT64 padding2560[2560 - 2503]; /* 2503 */ + ALIGN64 BOOL BitmapCacheEnabled; /* 2497 */ + ALIGN64 UINT32 BitmapCacheVersion; /* 2498 */ + ALIGN64 BOOL AllowCacheWaitingList; /* 2499 */ + ALIGN64 BOOL BitmapCachePersistEnabled; /* 2500 */ + ALIGN64 UINT32 BitmapCacheV2NumCells; /* 2501 */ + ALIGN64 BITMAP_CACHE_V2_CELL_INFO* BitmapCacheV2CellInfo; /* 2502 */ + UINT64 padding2560[2560 - 2503]; /* 2503 */ /* Pointer Capabilities */ - ALIGN64 BOOL ColorPointerFlag; /* 2560 */ + ALIGN64 BOOL ColorPointerFlag; /* 2560 */ ALIGN64 UINT32 PointerCacheSize; /* 2561 */ UINT64 padding2624[2624 - 2562]; /* 2562 */ /* Input Capabilities */ - ALIGN64 UINT32 KeyboardLayout; /* 2624 */ - ALIGN64 UINT32 KeyboardType; /* 2625 */ - ALIGN64 UINT32 KeyboardSubType; /* 2626 */ - ALIGN64 UINT32 KeyboardFunctionKey; /* 2627 */ - ALIGN64 char* ImeFileName; /* 2628 */ - ALIGN64 BOOL UnicodeInput; /* 2629 */ - ALIGN64 BOOL FastPathInput; /* 2630 */ - ALIGN64 BOOL MultiTouchInput; /* 2631 */ - ALIGN64 BOOL MultiTouchGestures; /* 2632 */ - ALIGN64 UINT32 KeyboardHook; /* 2633 */ - ALIGN64 BOOL HasHorizontalWheel; /* 2634 */ - ALIGN64 BOOL HasExtendedMouseEvent; /* 2635 */ - UINT64 padding2688[2688 - 2636]; /* 2636 */ + ALIGN64 UINT32 KeyboardLayout; /* 2624 */ + ALIGN64 UINT32 KeyboardType; /* 2625 */ + ALIGN64 UINT32 KeyboardSubType; /* 2626 */ + ALIGN64 UINT32 KeyboardFunctionKey; /* 2627 */ + ALIGN64 char* ImeFileName; /* 2628 */ + ALIGN64 BOOL UnicodeInput; /* 2629 */ + ALIGN64 BOOL FastPathInput; /* 2630 */ + ALIGN64 BOOL MultiTouchInput; /* 2631 */ + ALIGN64 BOOL MultiTouchGestures; /* 2632 */ + ALIGN64 UINT32 KeyboardHook; /* 2633 */ + ALIGN64 BOOL HasHorizontalWheel; /* 2634 */ + ALIGN64 BOOL HasExtendedMouseEvent; /* 2635 */ + UINT64 padding2688[2688 - 2636]; /* 2636 */ /* Brush Capabilities */ ALIGN64 UINT32 BrushSupportLevel; /* 2688 */ - UINT64 padding2752[2752 - 2689]; /* 2689 */ + UINT64 padding2752[2752 - 2689]; /* 2689 */ /* Glyph Cache Capabilities */ - ALIGN64 UINT32 GlyphSupportLevel; /* 2752 */ - ALIGN64 GLYPH_CACHE_DEFINITION* GlyphCache; /* 2753 */ - ALIGN64 GLYPH_CACHE_DEFINITION* FragCache; /* 2754 */ - UINT64 padding2816[2816 - 2755]; /* 2755 */ + ALIGN64 UINT32 GlyphSupportLevel; /* 2752 */ + ALIGN64 GLYPH_CACHE_DEFINITION* GlyphCache; /* 2753 */ + ALIGN64 GLYPH_CACHE_DEFINITION* FragCache; /* 2754 */ + UINT64 padding2816[2816 - 2755]; /* 2755 */ /* Offscreen Bitmap Cache */ ALIGN64 UINT32 OffscreenSupportLevel; /* 2816 */ ALIGN64 UINT32 OffscreenCacheSize; /* 2817 */ ALIGN64 UINT32 OffscreenCacheEntries; /* 2818 */ - UINT64 padding2880[2880 - 2819]; /* 2819 */ + UINT64 padding2880[2880 - 2819]; /* 2819 */ /* Virtual Channel Capabilities */ ALIGN64 UINT32 VirtualChannelCompressionFlags; /* 2880 */ ALIGN64 UINT32 VirtualChannelChunkSize; /* 2881 */ - UINT64 padding2944[2944 - 2882]; /* 2882 */ + UINT64 padding2944[2944 - 2882]; /* 2882 */ /* Sound Capabilities */ - ALIGN64 BOOL SoundBeepsEnabled; /* 2944 */ + ALIGN64 BOOL SoundBeepsEnabled; /* 2944 */ UINT64 padding3008[3008 - 2945]; /* 2945 */ UINT64 padding3072[3072 - 3008]; /* 3008 */ @@ -1384,7 +1381,7 @@ struct rdp_settings /* Multifragment Update Capabilities */ ALIGN64 UINT32 MultifragMaxRequestSize; /* 3328 */ - UINT64 padding3392[3392 - 3329]; /* 3329 */ + UINT64 padding3392[3392 - 3329]; /* 3329 */ /* Large Pointer Update Capabilities */ ALIGN64 UINT32 LargePointerFlag; /* 3392 */ @@ -1392,52 +1389,52 @@ struct rdp_settings /* Desktop Composition Capabilities */ ALIGN64 UINT32 CompDeskSupportLevel; /* 3456 */ - UINT64 padding3520[3520 - 3457]; /* 3457 */ + UINT64 padding3520[3520 - 3457]; /* 3457 */ /* Surface Commands Capabilities */ ALIGN64 BOOL SurfaceCommandsEnabled; /* 3520 */ ALIGN64 BOOL FrameMarkerCommandEnabled; /* 3521 */ ALIGN64 BOOL SurfaceFrameMarkerEnabled; /* 3522 */ - UINT64 padding3584[3584 - 3523]; /* 3523 */ - UINT64 padding3648[3648 - 3584]; /* 3584 */ + UINT64 padding3584[3584 - 3523]; /* 3523 */ + UINT64 padding3648[3648 - 3584]; /* 3584 */ /* * Bitmap Codecs Capabilities */ /* RemoteFX */ - ALIGN64 BOOL RemoteFxOnly; /* 3648 */ - ALIGN64 BOOL RemoteFxCodec; /* 3649 */ + ALIGN64 BOOL RemoteFxOnly; /* 3648 */ + ALIGN64 BOOL RemoteFxCodec; /* 3649 */ ALIGN64 UINT32 RemoteFxCodecId; /* 3650 */ ALIGN64 UINT32 RemoteFxCodecMode; /* 3651 */ - ALIGN64 BOOL RemoteFxImageCodec; /* 3652 */ + ALIGN64 BOOL RemoteFxImageCodec; /* 3652 */ ALIGN64 UINT32 RemoteFxCaptureFlags; /* 3653 */ - UINT64 padding3712[3712 - 3654]; /* 3654 */ + UINT64 padding3712[3712 - 3654]; /* 3654 */ /* NSCodec */ - ALIGN64 BOOL NSCodec; /* 3712 */ - ALIGN64 UINT32 NSCodecId; /* 3713 */ - ALIGN64 UINT32 FrameAcknowledge; /* 3714 */ - ALIGN64 UINT32 NSCodecColorLossLevel; /* 3715 */ - ALIGN64 BOOL NSCodecAllowSubsampling; /* 3716 */ - ALIGN64 BOOL NSCodecAllowDynamicColorFidelity; /* 3717 */ - UINT64 padding3776[3776 - 3718]; /* 3718 */ + ALIGN64 BOOL NSCodec; /* 3712 */ + ALIGN64 UINT32 NSCodecId; /* 3713 */ + ALIGN64 UINT32 FrameAcknowledge; /* 3714 */ + ALIGN64 UINT32 NSCodecColorLossLevel; /* 3715 */ + ALIGN64 BOOL NSCodecAllowSubsampling; /* 3716 */ + ALIGN64 BOOL NSCodecAllowDynamicColorFidelity; /* 3717 */ + UINT64 padding3776[3776 - 3718]; /* 3718 */ /* JPEG */ - ALIGN64 BOOL JpegCodec; /* 3776 */ - ALIGN64 UINT32 JpegCodecId; /* 3777 */ - ALIGN64 UINT32 JpegQuality; /* 3778 */ + ALIGN64 BOOL JpegCodec; /* 3776 */ + ALIGN64 UINT32 JpegCodecId; /* 3777 */ + ALIGN64 UINT32 JpegQuality; /* 3778 */ UINT64 padding3840[3840 - 3779]; /* 3779 */ - ALIGN64 BOOL GfxThinClient; /* 3840 */ - ALIGN64 BOOL GfxSmallCache; /* 3841 */ - ALIGN64 BOOL GfxProgressive; /* 3842 */ - ALIGN64 BOOL GfxProgressiveV2; /* 3843 */ - ALIGN64 BOOL GfxH264; /* 3844 */ - ALIGN64 BOOL GfxAVC444; /* 3845 */ - ALIGN64 BOOL GfxSendQoeAck; /* 3846 */ - ALIGN64 BOOL GfxAVC444v2; /* 3847 */ - ALIGN64 UINT32 GfxCapsFilter; /* 3848 */ + ALIGN64 BOOL GfxThinClient; /* 3840 */ + ALIGN64 BOOL GfxSmallCache; /* 3841 */ + ALIGN64 BOOL GfxProgressive; /* 3842 */ + ALIGN64 BOOL GfxProgressiveV2; /* 3843 */ + ALIGN64 BOOL GfxH264; /* 3844 */ + ALIGN64 BOOL GfxAVC444; /* 3845 */ + ALIGN64 BOOL GfxSendQoeAck; /* 3846 */ + ALIGN64 BOOL GfxAVC444v2; /* 3847 */ + ALIGN64 UINT32 GfxCapsFilter; /* 3848 */ UINT64 padding3904[3904 - 3849]; /* 3849 */ /** @@ -1446,34 +1443,34 @@ struct rdp_settings /* Bitmap Cache V3 */ ALIGN64 UINT32 BitmapCacheV3CodecId; /* 3904 */ - UINT64 padding3968[3968 - 3905]; /* 3905 */ + UINT64 padding3968[3968 - 3905]; /* 3905 */ /* Draw Nine Grid */ - ALIGN64 BOOL DrawNineGridEnabled; /* 3968 */ + ALIGN64 BOOL DrawNineGridEnabled; /* 3968 */ ALIGN64 UINT32 DrawNineGridCacheSize; /* 3969 */ ALIGN64 UINT32 DrawNineGridCacheEntries; /* 3970 */ - UINT64 padding4032[4032 - 3971]; /* 3971 */ + UINT64 padding4032[4032 - 3971]; /* 3971 */ /* Draw GDI+ */ ALIGN64 BOOL DrawGdiPlusEnabled; /* 4032 */ ALIGN64 BOOL DrawGdiPlusCacheEnabled; /* 4033 */ - UINT64 padding4096[4096 - 4034]; /* 4034 */ - UINT64 padding4160[4160 - 4096]; /* 4096 */ + UINT64 padding4096[4096 - 4034]; /* 4034 */ + UINT64 padding4160[4160 - 4096]; /* 4096 */ /** * Device Redirection */ /* Device Redirection */ - ALIGN64 BOOL DeviceRedirection; /* 4160 */ - ALIGN64 UINT32 DeviceCount; /* 4161 */ - ALIGN64 UINT32 DeviceArraySize; /* 4162 */ - ALIGN64 RDPDR_DEVICE** DeviceArray; /* 4163 */ - UINT64 padding4288[4288 - 4164]; /* 4164 */ + ALIGN64 BOOL DeviceRedirection; /* 4160 */ + ALIGN64 UINT32 DeviceCount; /* 4161 */ + ALIGN64 UINT32 DeviceArraySize; /* 4162 */ + ALIGN64 RDPDR_DEVICE** DeviceArray; /* 4163 */ + UINT64 padding4288[4288 - 4164]; /* 4164 */ /* Drive Redirection */ - ALIGN64 BOOL RedirectDrives; /* 4288 */ - ALIGN64 BOOL RedirectHomeDrive; /* 4289 */ + ALIGN64 BOOL RedirectDrives; /* 4288 */ + ALIGN64 BOOL RedirectHomeDrive; /* 4289 */ ALIGN64 char* DrivesToRedirect; /* 4290 */ UINT64 padding4416[4416 - 4291]; /* 4291 */ @@ -1482,40 +1479,40 @@ struct rdp_settings UINT64 padding4544[4544 - 4417]; /* 4417 */ /* Printer Redirection */ - ALIGN64 BOOL RedirectPrinters; /* 4544 */ + ALIGN64 BOOL RedirectPrinters; /* 4544 */ UINT64 padding4672[4672 - 4545]; /* 4545 */ /* Serial and Parallel Port Redirection */ ALIGN64 BOOL RedirectSerialPorts; /* 4672 */ ALIGN64 BOOL RedirectParallelPorts; /* 4673 */ ALIGN64 BOOL PreferIPv6OverIPv4; /* 4674 */ - UINT64 padding4800[4800 - 4675]; /* 4675 */ + UINT64 padding4800[4800 - 4675]; /* 4675 */ /** * Other Redirection */ - ALIGN64 BOOL RedirectClipboard; /* 4800 */ + ALIGN64 BOOL RedirectClipboard; /* 4800 */ UINT64 padding4928[4928 - 4801]; /* 4801 */ /** * Static Virtual Channels */ - ALIGN64 UINT32 StaticChannelCount; /* 4928 */ - ALIGN64 UINT32 StaticChannelArraySize; /* 4929 */ - ALIGN64 ADDIN_ARGV** StaticChannelArray; /* 4930 */ - UINT64 padding5056[5056 - 4931]; /* 4931 */ + ALIGN64 UINT32 StaticChannelCount; /* 4928 */ + ALIGN64 UINT32 StaticChannelArraySize; /* 4929 */ + ALIGN64 ADDIN_ARGV** StaticChannelArray; /* 4930 */ + UINT64 padding5056[5056 - 4931]; /* 4931 */ /** * Dynamic Virtual Channels */ - ALIGN64 UINT32 DynamicChannelCount; /* 5056 */ - ALIGN64 UINT32 DynamicChannelArraySize; /* 5057 */ - ALIGN64 ADDIN_ARGV** DynamicChannelArray; /* 5058 */ - ALIGN64 BOOL SupportDynamicChannels; /* 5059 */ - UINT64 padding5184[5184 - 5060]; /* 5060 */ + ALIGN64 UINT32 DynamicChannelCount; /* 5056 */ + ALIGN64 UINT32 DynamicChannelArraySize; /* 5057 */ + ALIGN64 ADDIN_ARGV** DynamicChannelArray; /* 5058 */ + ALIGN64 BOOL SupportDynamicChannels; /* 5059 */ + UINT64 padding5184[5184 - 5060]; /* 5060 */ ALIGN64 BOOL SupportEchoChannel; /* 5184 */ ALIGN64 BOOL SupportDisplayControl; /* 5185 */ @@ -1523,7 +1520,7 @@ struct rdp_settings ALIGN64 BOOL SupportSSHAgentChannel; /* 5187 */ ALIGN64 BOOL SupportVideoOptimized; /* 5188 */ ALIGN64 char* RDP2TCPArgs; /* 5189 */ - UINT64 padding5312[5312 - 5190]; /* 5190 */ + UINT64 padding5312[5312 - 5190]; /* 5190 */ /** * WARNING: End of ABI stable zone! @@ -1537,108 +1534,121 @@ struct rdp_settings */ /* Extensions */ - ALIGN64 INT32 num_extensions; /* */ + ALIGN64 INT32 num_extensions; /* */ ALIGN64 struct rdp_ext_set extensions[16]; /* */ - ALIGN64 BYTE* - SettingsModified; /* byte array marking fields that have been modified from their default value */ + ALIGN64 BYTE* SettingsModified; /* byte array marking fields that have been modified from their + default value */ ALIGN64 char* ActionScript; - ALIGN64 DWORD Floatbar; - + ALIGN64 DWORD Floatbar; }; typedef struct rdp_settings rdpSettings; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif /** - * rdpSettings creation flags - */ -#define FREERDP_SETTINGS_SERVER_MODE 0x00000001 - -FREERDP_API rdpSettings* freerdp_settings_new(DWORD flags); -FREERDP_API rdpSettings* freerdp_settings_clone(const rdpSettings* settings); -FREERDP_API BOOL freerdp_settings_copy(rdpSettings* dst, const rdpSettings* src); -FREERDP_API void freerdp_settings_free(rdpSettings* settings); - -FREERDP_API int freerdp_addin_set_argument(ADDIN_ARGV* args, char* argument); -FREERDP_API int freerdp_addin_replace_argument(ADDIN_ARGV* args, char* previous, char* argument); -FREERDP_API int freerdp_addin_set_argument_value(ADDIN_ARGV* args, char* option, char* value); -FREERDP_API int freerdp_addin_replace_argument_value(ADDIN_ARGV* args, char* previous, char* option, - char* value); - -FREERDP_API BOOL freerdp_device_collection_add(rdpSettings* settings, RDPDR_DEVICE* device); -FREERDP_API RDPDR_DEVICE* freerdp_device_collection_find(rdpSettings* settings, const char* name); -FREERDP_API RDPDR_DEVICE* freerdp_device_collection_find_type(rdpSettings* settings, UINT32 type); -FREERDP_API RDPDR_DEVICE* freerdp_device_clone(RDPDR_DEVICE* device); -FREERDP_API void freerdp_device_collection_free(rdpSettings* settings); - -FREERDP_API BOOL freerdp_static_channel_collection_add(rdpSettings* settings, ADDIN_ARGV* channel); -FREERDP_API ADDIN_ARGV* freerdp_static_channel_collection_find(rdpSettings* settings, - const char* name); -FREERDP_API ADDIN_ARGV* freerdp_static_channel_clone(ADDIN_ARGV* channel); -FREERDP_API void freerdp_static_channel_collection_free(rdpSettings* settings); - -FREERDP_API BOOL freerdp_dynamic_channel_collection_add(rdpSettings* settings, ADDIN_ARGV* channel); -FREERDP_API ADDIN_ARGV* freerdp_dynamic_channel_collection_find(rdpSettings* settings, - const char* name); -FREERDP_API ADDIN_ARGV* freerdp_dynamic_channel_clone(ADDIN_ARGV* channel); -FREERDP_API void freerdp_dynamic_channel_collection_free(rdpSettings* settings); - -FREERDP_API void freerdp_target_net_addresses_free(rdpSettings* settings); - -FREERDP_API void freerdp_performance_flags_make(rdpSettings* settings); -FREERDP_API void freerdp_performance_flags_split(rdpSettings* settings); - -FREERDP_API BOOL freerdp_set_gateway_usage_method(rdpSettings* settings, UINT32 GatewayUsageMethod); -FREERDP_API void freerdp_update_gateway_usage_method(rdpSettings* settings, UINT32 GatewayEnabled, - UINT32 GatewayBypassLocal); - -/* DEPRECATED: - * the functions freerdp_get_param_* and freerdp_set_param_* are deprecated. - * use freerdp_settings_get_* and freerdp_settings_set_* as a replacement! + * rdpSettings creation flags */ -FREERDP_API WINPR_DEPRECATED(BOOL freerdp_get_param_bool(rdpSettings* settings, int id)); -FREERDP_API WINPR_DEPRECATED(int freerdp_set_param_bool(rdpSettings* settings, int id, BOOL param)); +#define FREERDP_SETTINGS_SERVER_MODE 0x00000001 -FREERDP_API WINPR_DEPRECATED(int freerdp_get_param_int(rdpSettings* settings, int id)); -FREERDP_API WINPR_DEPRECATED(int freerdp_set_param_int(rdpSettings* settings, int id, int param)); + FREERDP_API rdpSettings* freerdp_settings_new(DWORD flags); + FREERDP_API rdpSettings* freerdp_settings_clone(const rdpSettings* settings); + FREERDP_API BOOL freerdp_settings_copy(rdpSettings* dst, const rdpSettings* src); + FREERDP_API void freerdp_settings_free(rdpSettings* settings); -FREERDP_API WINPR_DEPRECATED(UINT32 freerdp_get_param_uint32(rdpSettings* settings, int id)); -FREERDP_API WINPR_DEPRECATED(int freerdp_set_param_uint32(rdpSettings* settings, int id, UINT32 param)); + FREERDP_API int freerdp_addin_set_argument(ADDIN_ARGV* args, char* argument); + FREERDP_API int freerdp_addin_replace_argument(ADDIN_ARGV* args, char* previous, + char* argument); + FREERDP_API int freerdp_addin_set_argument_value(ADDIN_ARGV* args, char* option, char* value); + FREERDP_API int freerdp_addin_replace_argument_value(ADDIN_ARGV* args, char* previous, + char* option, char* value); -FREERDP_API WINPR_DEPRECATED(UINT64 freerdp_get_param_uint64(rdpSettings* settings, int id)); -FREERDP_API WINPR_DEPRECATED(int freerdp_set_param_uint64(rdpSettings* settings, int id, UINT64 param)); + FREERDP_API BOOL freerdp_device_collection_add(rdpSettings* settings, RDPDR_DEVICE* device); + FREERDP_API RDPDR_DEVICE* freerdp_device_collection_find(rdpSettings* settings, + const char* name); + FREERDP_API RDPDR_DEVICE* freerdp_device_collection_find_type(rdpSettings* settings, + UINT32 type); + FREERDP_API RDPDR_DEVICE* freerdp_device_clone(RDPDR_DEVICE* device); + FREERDP_API void freerdp_device_collection_free(rdpSettings* settings); -FREERDP_API WINPR_DEPRECATED(char* freerdp_get_param_string(rdpSettings* settings, int id)); -FREERDP_API WINPR_DEPRECATED(int freerdp_set_param_string(rdpSettings* settings, int id, const char* param)); + FREERDP_API BOOL freerdp_static_channel_collection_add(rdpSettings* settings, + ADDIN_ARGV* channel); + FREERDP_API ADDIN_ARGV* freerdp_static_channel_collection_find(rdpSettings* settings, + const char* name); + FREERDP_API ADDIN_ARGV* freerdp_static_channel_clone(ADDIN_ARGV* channel); + FREERDP_API void freerdp_static_channel_collection_free(rdpSettings* settings); -FREERDP_API BOOL freerdp_settings_get_bool(rdpSettings* settings, size_t id); -FREERDP_API BOOL freerdp_settings_set_bool(rdpSettings* settings, size_t id, BOOL param); + FREERDP_API BOOL freerdp_dynamic_channel_collection_add(rdpSettings* settings, + ADDIN_ARGV* channel); + FREERDP_API ADDIN_ARGV* freerdp_dynamic_channel_collection_find(rdpSettings* settings, + const char* name); + FREERDP_API ADDIN_ARGV* freerdp_dynamic_channel_clone(ADDIN_ARGV* channel); + FREERDP_API void freerdp_dynamic_channel_collection_free(rdpSettings* settings); -FREERDP_API INT16 freerdp_settings_get_int16(rdpSettings* settings, size_t id); -FREERDP_API BOOL freerdp_settings_set_int16(rdpSettings* settings, size_t id, INT16 param); + FREERDP_API void freerdp_target_net_addresses_free(rdpSettings* settings); -FREERDP_API UINT16 freerdp_settings_get_uint16(rdpSettings* settings, size_t id); -FREERDP_API BOOL freerdp_settings_set_uint16(rdpSettings* settings, size_t id, UINT16 param); + FREERDP_API void freerdp_performance_flags_make(rdpSettings* settings); + FREERDP_API void freerdp_performance_flags_split(rdpSettings* settings); -FREERDP_API INT32 freerdp_settings_get_int32(rdpSettings* settings, size_t id); -FREERDP_API BOOL freerdp_settings_set_int32(rdpSettings* settings, size_t id, INT32 param); + FREERDP_API BOOL freerdp_set_gateway_usage_method(rdpSettings* settings, + UINT32 GatewayUsageMethod); + FREERDP_API void freerdp_update_gateway_usage_method(rdpSettings* settings, + UINT32 GatewayEnabled, + UINT32 GatewayBypassLocal); -FREERDP_API UINT32 freerdp_settings_get_uint32(rdpSettings* settings, size_t id); -FREERDP_API BOOL freerdp_settings_set_uint32(rdpSettings* settings, size_t id, UINT32 param); + /* DEPRECATED: + * the functions freerdp_get_param_* and freerdp_set_param_* are deprecated. + * use freerdp_settings_get_* and freerdp_settings_set_* as a replacement! + */ + FREERDP_API WINPR_DEPRECATED(BOOL freerdp_get_param_bool(rdpSettings* settings, int id)); + FREERDP_API WINPR_DEPRECATED(int freerdp_set_param_bool(rdpSettings* settings, int id, + BOOL param)); -FREERDP_API INT64 freerdp_settings_get_int64(rdpSettings* settings, size_t id); -FREERDP_API BOOL freerdp_settings_set_int64(rdpSettings* settings, size_t id, INT64 param); + FREERDP_API WINPR_DEPRECATED(int freerdp_get_param_int(rdpSettings* settings, int id)); + FREERDP_API WINPR_DEPRECATED(int freerdp_set_param_int(rdpSettings* settings, int id, + int param)); -FREERDP_API UINT64 freerdp_settings_get_uint64(rdpSettings* settings, size_t id); -FREERDP_API BOOL freerdp_settings_set_uint64(rdpSettings* settings, size_t id, UINT64 param); + FREERDP_API WINPR_DEPRECATED(UINT32 freerdp_get_param_uint32(rdpSettings* settings, int id)); + FREERDP_API WINPR_DEPRECATED(int freerdp_set_param_uint32(rdpSettings* settings, int id, + UINT32 param)); -FREERDP_API const char* freerdp_settings_get_string(rdpSettings* settings, size_t id); -FREERDP_API BOOL freerdp_settings_set_string(rdpSettings* settings, size_t id, const char* param); + FREERDP_API WINPR_DEPRECATED(UINT64 freerdp_get_param_uint64(rdpSettings* settings, int id)); + FREERDP_API WINPR_DEPRECATED(int freerdp_set_param_uint64(rdpSettings* settings, int id, + UINT64 param)); -FREERDP_API const void* freerdp_settings_get_pointer(rdpSettings* settings, size_t id); + FREERDP_API WINPR_DEPRECATED(char* freerdp_get_param_string(rdpSettings* settings, int id)); + FREERDP_API WINPR_DEPRECATED(int freerdp_set_param_string(rdpSettings* settings, int id, + const char* param)); + + FREERDP_API BOOL freerdp_settings_get_bool(rdpSettings* settings, size_t id); + FREERDP_API BOOL freerdp_settings_set_bool(rdpSettings* settings, size_t id, BOOL param); + + FREERDP_API INT16 freerdp_settings_get_int16(rdpSettings* settings, size_t id); + FREERDP_API BOOL freerdp_settings_set_int16(rdpSettings* settings, size_t id, INT16 param); + + FREERDP_API UINT16 freerdp_settings_get_uint16(rdpSettings* settings, size_t id); + FREERDP_API BOOL freerdp_settings_set_uint16(rdpSettings* settings, size_t id, UINT16 param); + + FREERDP_API INT32 freerdp_settings_get_int32(rdpSettings* settings, size_t id); + FREERDP_API BOOL freerdp_settings_set_int32(rdpSettings* settings, size_t id, INT32 param); + + FREERDP_API UINT32 freerdp_settings_get_uint32(rdpSettings* settings, size_t id); + FREERDP_API BOOL freerdp_settings_set_uint32(rdpSettings* settings, size_t id, UINT32 param); + + FREERDP_API INT64 freerdp_settings_get_int64(rdpSettings* settings, size_t id); + FREERDP_API BOOL freerdp_settings_set_int64(rdpSettings* settings, size_t id, INT64 param); + + FREERDP_API UINT64 freerdp_settings_get_uint64(rdpSettings* settings, size_t id); + FREERDP_API BOOL freerdp_settings_set_uint64(rdpSettings* settings, size_t id, UINT64 param); + + FREERDP_API const char* freerdp_settings_get_string(rdpSettings* settings, size_t id); + FREERDP_API BOOL freerdp_settings_set_string(rdpSettings* settings, size_t id, + const char* param); + + FREERDP_API const void* freerdp_settings_get_pointer(rdpSettings* settings, size_t id); #ifdef __cplusplus } diff --git a/include/freerdp/svc.h b/include/freerdp/svc.h index d0532c83a..34aa08b64 100644 --- a/include/freerdp/svc.h +++ b/include/freerdp/svc.h @@ -28,27 +28,27 @@ #include #include -#define CHANNEL_EVENT_USER 1000 +#define CHANNEL_EVENT_USER 1000 -#define CHANNEL_EXPORT_FUNC_NAME "VirtualChannelEntry" -#define CHANNEL_EXPORT_FUNC_NAME_EX "VirtualChannelEntryEx" +#define CHANNEL_EXPORT_FUNC_NAME "VirtualChannelEntry" +#define CHANNEL_EXPORT_FUNC_NAME_EX "VirtualChannelEntryEx" -#define FREERDP_CHANNEL_MAGIC_NUMBER 0x46524450 +#define FREERDP_CHANNEL_MAGIC_NUMBER 0x46524450 struct _CHANNEL_ENTRY_POINTS_FREERDP { UINT32 cbSize; UINT32 protocolVersion; - PVIRTUALCHANNELINIT pVirtualChannelInit; - PVIRTUALCHANNELOPEN pVirtualChannelOpen; + PVIRTUALCHANNELINIT pVirtualChannelInit; + PVIRTUALCHANNELOPEN pVirtualChannelOpen; PVIRTUALCHANNELCLOSE pVirtualChannelClose; PVIRTUALCHANNELWRITE pVirtualChannelWrite; /* Extended Fields */ - UINT32 MagicNumber; /* identifies FreeRDP */ + UINT32 MagicNumber; /* identifies FreeRDP */ void* pExtendedData; /* extended initial data */ - void* pInterface; /* channel callback interface, use after initialization */ - void** ppInterface; /* channel callback interface, use for initialization */ + void* pInterface; /* channel callback interface, use after initialization */ + void** ppInterface; /* channel callback interface, use for initialization */ rdpContext* context; }; typedef struct _CHANNEL_ENTRY_POINTS_FREERDP CHANNEL_ENTRY_POINTS_FREERDP; @@ -58,16 +58,16 @@ struct _CHANNEL_ENTRY_POINTS_FREERDP_EX { UINT32 cbSize; UINT32 protocolVersion; - PVIRTUALCHANNELINITEX pVirtualChannelInitEx; - PVIRTUALCHANNELOPENEX pVirtualChannelOpenEx; + PVIRTUALCHANNELINITEX pVirtualChannelInitEx; + PVIRTUALCHANNELOPENEX pVirtualChannelOpenEx; PVIRTUALCHANNELCLOSEEX pVirtualChannelCloseEx; PVIRTUALCHANNELWRITEEX pVirtualChannelWriteEx; /* Extended Fields */ - UINT32 MagicNumber; /* identifies FreeRDP */ + UINT32 MagicNumber; /* identifies FreeRDP */ void* pExtendedData; /* extended initial data */ - void* pInterface; /* channel callback interface, use after initialization */ - void** ppInterface; /* channel callback interface, use for initialization */ + void* pInterface; /* channel callback interface, use after initialization */ + void** ppInterface; /* channel callback interface, use for initialization */ rdpContext* context; }; typedef struct _CHANNEL_ENTRY_POINTS_FREERDP_EX CHANNEL_ENTRY_POINTS_FREERDP_EX; diff --git a/include/freerdp/types.h b/include/freerdp/types.h index a2ccb9c01..165c1717e 100644 --- a/include/freerdp/types.h +++ b/include/freerdp/types.h @@ -25,11 +25,11 @@ #include #ifndef MIN -#define MIN(x,y) (((x) < (y)) ? (x) : (y)) +#define MIN(x, y) (((x) < (y)) ? (x) : (y)) #endif #ifndef MAX -#define MAX(x,y) (((x) > (y)) ? (x) : (y)) +#define MAX(x, y) (((x) > (y)) ? (x) : (y)) #endif struct _PALETTE_ENTRY diff --git a/include/freerdp/update.h b/include/freerdp/update.h index 9970f6fd1..aa1c40417 100644 --- a/include/freerdp/update.h +++ b/include/freerdp/update.h @@ -182,12 +182,10 @@ typedef BOOL (*pSuppressOutput)(rdpContext* context, BYTE allow, const RECTANGLE typedef BOOL (*pRemoteMonitors)(rdpContext* context, UINT32 count, const MONITOR_DEF* monitors); typedef BOOL (*pSurfaceCommand)(rdpContext* context, wStream* s); -typedef BOOL (*pSurfaceBits)(rdpContext* context, - const SURFACE_BITS_COMMAND* surfaceBitsCommand); +typedef BOOL (*pSurfaceBits)(rdpContext* context, const SURFACE_BITS_COMMAND* surfaceBitsCommand); typedef BOOL (*pSurfaceFrameMarker)(rdpContext* context, const SURFACE_FRAME_MARKER* surfaceFrameMarker); -typedef BOOL (*pSurfaceFrameBits)(rdpContext* context, - const SURFACE_BITS_COMMAND* cmd, BOOL first, +typedef BOOL (*pSurfaceFrameBits)(rdpContext* context, const SURFACE_BITS_COMMAND* cmd, BOOL first, BOOL last, UINT32 frameId); typedef BOOL (*pSurfaceFrameAcknowledge)(rdpContext* context, UINT32 frameId); @@ -198,41 +196,41 @@ typedef BOOL (*pServerStatusInfo)(rdpContext* context, UINT32 status); struct rdp_update { - rdpContext* context; /* 0 */ + rdpContext* context; /* 0 */ UINT32 paddingA[16 - 1]; /* 1 */ - pBeginPaint BeginPaint; /* 16 */ - pEndPaint EndPaint; /* 17 */ - pSetBounds SetBounds; /* 18 */ - pSynchronize Synchronize; /* 19 */ - pDesktopResize DesktopResize; /* 20 */ - pBitmapUpdate BitmapUpdate; /* 21 */ - pPalette Palette; /* 22 */ - pPlaySound PlaySound; /* 23 */ + pBeginPaint BeginPaint; /* 16 */ + pEndPaint EndPaint; /* 17 */ + pSetBounds SetBounds; /* 18 */ + pSynchronize Synchronize; /* 19 */ + pDesktopResize DesktopResize; /* 20 */ + pBitmapUpdate BitmapUpdate; /* 21 */ + pPalette Palette; /* 22 */ + pPlaySound PlaySound; /* 23 */ pSetKeyboardIndicators SetKeyboardIndicators; /* 24 */ - pSetKeyboardImeStatus SetKeyboardImeStatus; /* 25 */ - UINT32 paddingB[32 - 26]; /* 26 */ + pSetKeyboardImeStatus SetKeyboardImeStatus; /* 25 */ + UINT32 paddingB[32 - 26]; /* 26 */ - rdpPointerUpdate* pointer; /* 32 */ - rdpPrimaryUpdate* primary; /* 33 */ + rdpPointerUpdate* pointer; /* 32 */ + rdpPrimaryUpdate* primary; /* 33 */ rdpSecondaryUpdate* secondary; /* 34 */ - rdpAltSecUpdate* altsec; /* 35 */ - rdpWindowUpdate* window; /* 36 */ - UINT32 paddingC[48 - 37]; /* 37 */ + rdpAltSecUpdate* altsec; /* 35 */ + rdpWindowUpdate* window; /* 36 */ + UINT32 paddingC[48 - 37]; /* 37 */ - pRefreshRect RefreshRect; /* 48 */ + pRefreshRect RefreshRect; /* 48 */ pSuppressOutput SuppressOutput; /* 49 */ pRemoteMonitors RemoteMonitors; /* 50 */ - UINT32 paddingD[64 - 51]; /* 51 */ + UINT32 paddingD[64 - 51]; /* 51 */ - pSurfaceCommand SurfaceCommand; /* 64 */ - pSurfaceBits SurfaceBits; /* 65 */ - pSurfaceFrameMarker SurfaceFrameMarker; /* 66 */ - pSurfaceFrameBits SurfaceFrameBits; /* 67 */ + pSurfaceCommand SurfaceCommand; /* 64 */ + pSurfaceBits SurfaceBits; /* 65 */ + pSurfaceFrameMarker SurfaceFrameMarker; /* 66 */ + pSurfaceFrameBits SurfaceFrameBits; /* 67 */ pSurfaceFrameAcknowledge SurfaceFrameAcknowledge; /* 68 */ - pSaveSessionInfo SaveSessionInfo; /* 69 */ - pServerStatusInfo ServerStatusInfo; /* 70 */ - UINT32 paddingE[80 - 71]; /* 71 */ + pSaveSessionInfo SaveSessionInfo; /* 69 */ + pServerStatusInfo ServerStatusInfo; /* 70 */ + UINT32 paddingE[80 - 71]; /* 71 */ /* internal */ @@ -254,9 +252,9 @@ struct rdp_update rdpBounds previousBounds; CRITICAL_SECTION mux; - /* if autoCalculateBitmapData is set to TRUE, the server automatically + /* if autoCalculateBitmapData is set to TRUE, the server automatically * fills BITMAP_DATA struct members: flags, cbCompMainBodySize and cbCompFirstRowSize. - */ + */ BOOL autoCalculateBitmapData; }; diff --git a/include/freerdp/utils/msusb.h b/include/freerdp/utils/msusb.h index 01af385ad..f0582b5f9 100644 --- a/include/freerdp/utils/msusb.h +++ b/include/freerdp/utils/msusb.h @@ -27,60 +27,77 @@ #include /* a safer free helper */ -#define zfree(p) do { if (p != NULL) {free(p); p = NULL;} } while (0) - -/* Data maintenance helper only used in URBDRC */ -#define data_read_BYTE(_p, _v) do { _v = \ - *((BYTE *) (_p)); \ - } while (0) -#define data_read_UINT16(_p, _v) do { _v = \ - ((UINT16) (*((BYTE *) (_p)))) + \ - ((UINT16) (*(((BYTE *) (_p)) + 1)) << 8); \ - } while (0) -#define data_read_UINT32(_p, _v) do { _v = \ - (UINT32) (*((BYTE *) (_p))) + \ - ((UINT32) (*(((BYTE *) (_p)) + 1)) << 8) + \ - ((UINT32) (*(((BYTE *) (_p)) + 2)) << 16) + \ - ((UINT32) (*(((BYTE *) (_p)) + 3)) << 24); \ - } while (0) -#define data_read_UINT64(_p, _v) do { _v = \ - (UINT64) (*((BYTE *) (_p))) + \ - ((UINT64) (*(((BYTE *) (_p)) + 1)) << 8) + \ - ((UINT64) (*(((BYTE *) (_p)) + 2)) << 16) + \ - ((UINT64) (*(((BYTE *) (_p)) + 3)) << 24) + \ - ((UINT64) (*(((BYTE *) (_p)) + 4)) << 32) + \ - ((UINT64) (*(((BYTE *) (_p)) + 5)) << 40) + \ - ((UINT64) (*(((BYTE *) (_p)) + 6)) << 48) + \ - ((UINT64) (*(((BYTE *) (_p)) + 7)) << 56); \ +#define zfree(p) \ + do \ + { \ + if (p != NULL) \ + { \ + free(p); \ + p = NULL; \ + } \ } while (0) -#define data_write_BYTE(_p, _v) do { \ - *((BYTE *) _p) = (BYTE) (_v); \ +/* Data maintenance helper only used in URBDRC */ +#define data_read_BYTE(_p, _v) \ + do \ + { \ + _v = *((BYTE*)(_p)); \ } while (0) -#define data_write_UINT16(_p, _v) do { \ - *((BYTE *) _p) = (BYTE) (((UINT16) (_v)) & 0xff); \ - *(((BYTE *) _p) + 1) = (BYTE) ((((UINT16) (_v)) >> 8) & 0xff); \ +#define data_read_UINT16(_p, _v) \ + do \ + { \ + _v = ((UINT16)(*((BYTE*)(_p)))) + ((UINT16)(*(((BYTE*)(_p)) + 1)) << 8); \ } while (0) -#define data_write_UINT32(_p, _v) do { \ - *((BYTE *) _p) = (BYTE) (((UINT32) (_v)) & 0xff); \ - *(((BYTE *) _p) + 1) = (BYTE) ((((UINT32) (_v)) >> 8) & 0xff); \ - *(((BYTE *) _p) + 2) = (BYTE) ((((UINT32) (_v)) >> 16) & 0xff); \ - *(((BYTE *) _p) + 3) = (BYTE) ((((UINT32) (_v)) >> 24) & 0xff); \ +#define data_read_UINT32(_p, _v) \ + do \ + { \ + _v = (UINT32)(*((BYTE*)(_p))) + ((UINT32)(*(((BYTE*)(_p)) + 1)) << 8) + \ + ((UINT32)(*(((BYTE*)(_p)) + 2)) << 16) + ((UINT32)(*(((BYTE*)(_p)) + 3)) << 24); \ } while (0) -#define data_write_UINT64(_p, _v) do { \ - *((BYTE *) _p) = (BYTE) (((UINT64) (_v)) & 0xff); \ - *(((BYTE *) _p) + 1) = (BYTE) ((((UINT64) (_v)) >> 8) & 0xff); \ - *(((BYTE *) _p) + 2) = (BYTE) ((((UINT64) (_v)) >> 16) & 0xff); \ - *(((BYTE *) _p) + 3) = (BYTE) ((((UINT64) (_v)) >> 24) & 0xff); \ - *(((BYTE *) _p) + 4) = (BYTE) ((((UINT64) (_v)) >> 32) & 0xff); \ - *(((BYTE *) _p) + 5) = (BYTE) ((((UINT64) (_v)) >> 40) & 0xff); \ - *(((BYTE *) _p) + 6) = (BYTE) ((((UINT64) (_v)) >> 48) & 0xff); \ - *(((BYTE *) _p) + 7) = (BYTE) ((((UINT64) (_v)) >> 56) & 0xff); \ +#define data_read_UINT64(_p, _v) \ + do \ + { \ + _v = (UINT64)(*((BYTE*)(_p))) + ((UINT64)(*(((BYTE*)(_p)) + 1)) << 8) + \ + ((UINT64)(*(((BYTE*)(_p)) + 2)) << 16) + ((UINT64)(*(((BYTE*)(_p)) + 3)) << 24) + \ + ((UINT64)(*(((BYTE*)(_p)) + 4)) << 32) + ((UINT64)(*(((BYTE*)(_p)) + 5)) << 40) + \ + ((UINT64)(*(((BYTE*)(_p)) + 6)) << 48) + ((UINT64)(*(((BYTE*)(_p)) + 7)) << 56); \ + } while (0) + +#define data_write_BYTE(_p, _v) \ + do \ + { \ + *((BYTE*)_p) = (BYTE)(_v); \ + } while (0) +#define data_write_UINT16(_p, _v) \ + do \ + { \ + *((BYTE*)_p) = (BYTE)(((UINT16)(_v)) & 0xff); \ + *(((BYTE*)_p) + 1) = (BYTE)((((UINT16)(_v)) >> 8) & 0xff); \ + } while (0) +#define data_write_UINT32(_p, _v) \ + do \ + { \ + *((BYTE*)_p) = (BYTE)(((UINT32)(_v)) & 0xff); \ + *(((BYTE*)_p) + 1) = (BYTE)((((UINT32)(_v)) >> 8) & 0xff); \ + *(((BYTE*)_p) + 2) = (BYTE)((((UINT32)(_v)) >> 16) & 0xff); \ + *(((BYTE*)_p) + 3) = (BYTE)((((UINT32)(_v)) >> 24) & 0xff); \ + } while (0) +#define data_write_UINT64(_p, _v) \ + do \ + { \ + *((BYTE*)_p) = (BYTE)(((UINT64)(_v)) & 0xff); \ + *(((BYTE*)_p) + 1) = (BYTE)((((UINT64)(_v)) >> 8) & 0xff); \ + *(((BYTE*)_p) + 2) = (BYTE)((((UINT64)(_v)) >> 16) & 0xff); \ + *(((BYTE*)_p) + 3) = (BYTE)((((UINT64)(_v)) >> 24) & 0xff); \ + *(((BYTE*)_p) + 4) = (BYTE)((((UINT64)(_v)) >> 32) & 0xff); \ + *(((BYTE*)_p) + 5) = (BYTE)((((UINT64)(_v)) >> 40) & 0xff); \ + *(((BYTE*)_p) + 6) = (BYTE)((((UINT64)(_v)) >> 48) & 0xff); \ + *(((BYTE*)_p) + 7) = (BYTE)((((UINT64)(_v)) >> 56) & 0xff); \ } while (0) typedef struct _MSUSB_INTERFACE_DESCRIPTOR MSUSB_INTERFACE_DESCRIPTOR; -typedef struct _MSUSB_PIPE_DESCRIPTOR MSUSB_PIPE_DESCRIPTOR; -typedef struct _MSUSB_CONFIG_DESCRIPTOR MSUSB_CONFIG_DESCRIPTOR; +typedef struct _MSUSB_PIPE_DESCRIPTOR MSUSB_PIPE_DESCRIPTOR; +typedef struct _MSUSB_CONFIG_DESCRIPTOR MSUSB_CONFIG_DESCRIPTOR; struct _MSUSB_PIPE_DESCRIPTOR { @@ -88,9 +105,9 @@ struct _MSUSB_PIPE_DESCRIPTOR UINT32 MaximumTransferSize; UINT32 PipeFlags; UINT32 PipeHandle; - BYTE bEndpointAddress; - BYTE bInterval; - BYTE PipeType; + BYTE bEndpointAddress; + BYTE bInterval; + BYTE PipeType; int InitCompleted; } __attribute__((packed)); @@ -98,46 +115,54 @@ struct _MSUSB_INTERFACE_DESCRIPTOR { UINT16 Length; UINT16 NumberOfPipesExpected; - BYTE InterfaceNumber; - BYTE AlternateSetting; + BYTE InterfaceNumber; + BYTE AlternateSetting; UINT32 NumberOfPipes; UINT32 InterfaceHandle; - BYTE bInterfaceClass; - BYTE bInterfaceSubClass; - BYTE bInterfaceProtocol; - MSUSB_PIPE_DESCRIPTOR ** MsPipes; + BYTE bInterfaceClass; + BYTE bInterfaceSubClass; + BYTE bInterfaceProtocol; + MSUSB_PIPE_DESCRIPTOR** MsPipes; int InitCompleted; } __attribute__((packed)); struct _MSUSB_CONFIG_DESCRIPTOR { UINT16 wTotalLength; - BYTE bConfigurationValue; + BYTE bConfigurationValue; UINT32 ConfigurationHandle; UINT32 NumInterfaces; - MSUSB_INTERFACE_DESCRIPTOR ** MsInterfaces; + MSUSB_INTERFACE_DESCRIPTOR** MsInterfaces; int InitCompleted; int MsOutSize; } __attribute__((packed)); #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* MSUSB_PIPE exported functions */ -FREERDP_API void msusb_mspipes_replace(MSUSB_INTERFACE_DESCRIPTOR* MsInterface, MSUSB_PIPE_DESCRIPTOR** NewMsPipes, UINT32 NewNumberOfPipes); + /* MSUSB_PIPE exported functions */ + FREERDP_API void msusb_mspipes_replace(MSUSB_INTERFACE_DESCRIPTOR* MsInterface, + MSUSB_PIPE_DESCRIPTOR** NewMsPipes, + UINT32 NewNumberOfPipes); -/* MSUSB_INTERFACE exported functions */ -FREERDP_API void msusb_msinterface_replace(MSUSB_CONFIG_DESCRIPTOR* MsConfig, BYTE InterfaceNumber, MSUSB_INTERFACE_DESCRIPTOR* NewMsInterface); -FREERDP_API MSUSB_INTERFACE_DESCRIPTOR* msusb_msinterface_read(BYTE* data, UINT32 data_size, int* offset); -FREERDP_API int msusb_msinterface_write(MSUSB_INTERFACE_DESCRIPTOR* MsInterface, BYTE* data, int* offset); + /* MSUSB_INTERFACE exported functions */ + FREERDP_API void msusb_msinterface_replace(MSUSB_CONFIG_DESCRIPTOR* MsConfig, + BYTE InterfaceNumber, + MSUSB_INTERFACE_DESCRIPTOR* NewMsInterface); + FREERDP_API MSUSB_INTERFACE_DESCRIPTOR* msusb_msinterface_read(BYTE* data, UINT32 data_size, + int* offset); + FREERDP_API int msusb_msinterface_write(MSUSB_INTERFACE_DESCRIPTOR* MsInterface, BYTE* data, + int* offset); -/* MSUSB_CONFIG exported functions */ -FREERDP_API MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_new(void); -FREERDP_API void msusb_msconfig_free(MSUSB_CONFIG_DESCRIPTOR* MsConfig); -FREERDP_API MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_read(BYTE* data, UINT32 data_size, UINT32 NumInterfaces); -FREERDP_API int msusb_msconfig_write(MSUSB_CONFIG_DESCRIPTOR* MsConfg, BYTE* data, int * offset); -FREERDP_API void msusb_msconfig_dump(MSUSB_CONFIG_DESCRIPTOR* MsConfg); + /* MSUSB_CONFIG exported functions */ + FREERDP_API MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_new(void); + FREERDP_API void msusb_msconfig_free(MSUSB_CONFIG_DESCRIPTOR* MsConfig); + FREERDP_API MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_read(BYTE* data, UINT32 data_size, + UINT32 NumInterfaces); + FREERDP_API int msusb_msconfig_write(MSUSB_CONFIG_DESCRIPTOR* MsConfg, BYTE* data, int* offset); + FREERDP_API void msusb_msconfig_dump(MSUSB_CONFIG_DESCRIPTOR* MsConfg); #ifdef __cplusplus } diff --git a/include/freerdp/utils/passphrase.h b/include/freerdp/utils/passphrase.h index 24424bf40..045f06437 100644 --- a/include/freerdp/utils/passphrase.h +++ b/include/freerdp/utils/passphrase.h @@ -24,10 +24,12 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API char* freerdp_passphrase_read(const char* prompt, char* buf, size_t bufsiz, int from_stdin); + FREERDP_API char* freerdp_passphrase_read(const char* prompt, char* buf, size_t bufsiz, + int from_stdin); #ifdef __cplusplus } diff --git a/include/freerdp/utils/pcap.h b/include/freerdp/utils/pcap.h index 360278a2f..4b23343b2 100644 --- a/include/freerdp/utils/pcap.h +++ b/include/freerdp/utils/pcap.h @@ -25,22 +25,22 @@ struct _pcap_header { - UINT32 magic_number; /* magic number */ - UINT16 version_major; /* major version number */ - UINT16 version_minor; /* minor version number */ + UINT32 magic_number; /* magic number */ + UINT16 version_major; /* major version number */ + UINT16 version_minor; /* minor version number */ INT32 thiszone; /* GMT to local correction */ - UINT32 sigfigs; /* accuracy of timestamps */ - UINT32 snaplen; /* max length of captured packets, in octets */ - UINT32 network; /* data link type */ + UINT32 sigfigs; /* accuracy of timestamps */ + UINT32 snaplen; /* max length of captured packets, in octets */ + UINT32 network; /* data link type */ }; typedef struct _pcap_header pcap_header; struct _pcap_record_header { - UINT32 ts_sec; /* timestamp seconds */ - UINT32 ts_usec; /* timestamp microseconds */ - UINT32 incl_len; /* number of octets of packet saved in file */ - UINT32 orig_len; /* actual length of packet */ + UINT32 ts_sec; /* timestamp seconds */ + UINT32 ts_usec; /* timestamp microseconds */ + UINT32 incl_len; /* number of octets of packet saved in file */ + UINT32 orig_len; /* actual length of packet */ }; typedef struct _pcap_record_header pcap_record_header; @@ -69,18 +69,19 @@ struct rdp_pcap typedef struct rdp_pcap rdpPcap; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API rdpPcap* pcap_open(char* name, BOOL write); -FREERDP_API void pcap_close(rdpPcap* pcap); + FREERDP_API rdpPcap* pcap_open(char* name, BOOL write); + FREERDP_API void pcap_close(rdpPcap* pcap); -FREERDP_API BOOL pcap_add_record(rdpPcap* pcap, void* data, UINT32 length); -FREERDP_API BOOL pcap_has_next_record(rdpPcap* pcap); -FREERDP_API BOOL pcap_get_next_record(rdpPcap* pcap, pcap_record* record); -FREERDP_API BOOL pcap_get_next_record_header(rdpPcap* pcap, pcap_record* record); -FREERDP_API BOOL pcap_get_next_record_content(rdpPcap* pcap, pcap_record* record); -FREERDP_API void pcap_flush(rdpPcap* pcap); + FREERDP_API BOOL pcap_add_record(rdpPcap* pcap, void* data, UINT32 length); + FREERDP_API BOOL pcap_has_next_record(rdpPcap* pcap); + FREERDP_API BOOL pcap_get_next_record(rdpPcap* pcap, pcap_record* record); + FREERDP_API BOOL pcap_get_next_record_header(rdpPcap* pcap, pcap_record* record); + FREERDP_API BOOL pcap_get_next_record_content(rdpPcap* pcap, pcap_record* record); + FREERDP_API void pcap_flush(rdpPcap* pcap); #ifdef __cplusplus } diff --git a/include/freerdp/utils/profiler.h b/include/freerdp/utils/profiler.h index a0ff76619..4402de68c 100644 --- a/include/freerdp/utils/profiler.h +++ b/include/freerdp/utils/profiler.h @@ -26,44 +26,74 @@ typedef struct _PROFILER PROFILER; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API PROFILER* profiler_create(const char* name); -FREERDP_API void profiler_free(PROFILER* profiler); + FREERDP_API PROFILER* profiler_create(const char* name); + FREERDP_API void profiler_free(PROFILER* profiler); -FREERDP_API void profiler_enter(PROFILER* profiler); -FREERDP_API void profiler_exit(PROFILER* profiler); + FREERDP_API void profiler_enter(PROFILER* profiler); + FREERDP_API void profiler_exit(PROFILER* profiler); -FREERDP_API void profiler_print_header(void); -FREERDP_API void profiler_print(PROFILER* profiler); -FREERDP_API void profiler_print_footer(void); + FREERDP_API void profiler_print_header(void); + FREERDP_API void profiler_print(PROFILER* profiler); + FREERDP_API void profiler_print_footer(void); #ifdef __cplusplus } #endif #ifdef WITH_PROFILER -#define PROFILER_RENAME(prof, name) do { profiler_free(prof); prof = profiler_create(name); } while(0) -#define PROFILER_DEFINE(prof) PROFILER* prof; -#define PROFILER_CREATE(prof,name) prof = profiler_create(name); -#define PROFILER_FREE(prof) profiler_free(prof); -#define PROFILER_ENTER(prof) profiler_enter(prof); -#define PROFILER_EXIT(prof) profiler_exit(prof); -#define PROFILER_PRINT_HEADER profiler_print_header(); -#define PROFILER_PRINT(prof) profiler_print(prof); -#define PROFILER_PRINT_FOOTER profiler_print_footer(); +#define PROFILER_RENAME(prof, name) \ + do \ + { \ + profiler_free(prof); \ + prof = profiler_create(name); \ + } while (0) +#define PROFILER_DEFINE(prof) PROFILER* prof; +#define PROFILER_CREATE(prof, name) prof = profiler_create(name); +#define PROFILER_FREE(prof) profiler_free(prof); +#define PROFILER_ENTER(prof) profiler_enter(prof); +#define PROFILER_EXIT(prof) profiler_exit(prof); +#define PROFILER_PRINT_HEADER profiler_print_header(); +#define PROFILER_PRINT(prof) profiler_print(prof); +#define PROFILER_PRINT_FOOTER profiler_print_footer(); #else -#define PROFILER_RENAME(prof, name) do { } while (0) +#define PROFILER_RENAME(prof, name) \ + do \ + { \ + } while (0) #define PROFILER_DEFINE(prof) -#define PROFILER_CREATE(prof,name) do { } while (0); -#define PROFILER_FREE(prof) do { } while (0); -#define PROFILER_ENTER(prof) do { } while (0); -#define PROFILER_EXIT(prof) do { } while (0); -#define PROFILER_PRINT_HEADER do { } while (0); -#define PROFILER_PRINT(prof) do { } while (0); -#define PROFILER_PRINT_FOOTER do { } while (0); +#define PROFILER_CREATE(prof, name) \ + do \ + { \ + } while (0); +#define PROFILER_FREE(prof) \ + do \ + { \ + } while (0); +#define PROFILER_ENTER(prof) \ + do \ + { \ + } while (0); +#define PROFILER_EXIT(prof) \ + do \ + { \ + } while (0); +#define PROFILER_PRINT_HEADER \ + do \ + { \ + } while (0); +#define PROFILER_PRINT(prof) \ + do \ + { \ + } while (0); +#define PROFILER_PRINT_FOOTER \ + do \ + { \ + } while (0); #endif #endif /* FREERDP_UTILS_PROFILER_H */ diff --git a/include/freerdp/utils/ringbuffer.h b/include/freerdp/utils/ringbuffer.h index 121578673..21f607e1c 100644 --- a/include/freerdp/utils/ringbuffer.h +++ b/include/freerdp/utils/ringbuffer.h @@ -23,103 +23,101 @@ #include #include - /** @brief ring buffer meta data */ -struct _RingBuffer { +struct _RingBuffer +{ size_t initialSize; size_t freeSize; size_t size; size_t readPtr; size_t writePtr; - BYTE *buffer; + BYTE* buffer; }; typedef struct _RingBuffer RingBuffer; - /** @brief a piece of data in the ring buffer, exactly like a glibc iovec */ -struct _DataChunk { +struct _DataChunk +{ size_t size; - const BYTE *data; + const BYTE* data; }; typedef struct _DataChunk DataChunk; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/** initialise a ringbuffer - * @param initialSize the initial capacity of the ringBuffer - * @return if the initialisation was successful - */ -FREERDP_API BOOL ringbuffer_init(RingBuffer *rb, size_t initialSize); + /** initialise a ringbuffer + * @param initialSize the initial capacity of the ringBuffer + * @return if the initialisation was successful + */ + FREERDP_API BOOL ringbuffer_init(RingBuffer* rb, size_t initialSize); -/** destroys internal data used by this ringbuffer - * @param ringbuffer - */ -FREERDP_API void ringbuffer_destroy(RingBuffer *ringbuffer); + /** destroys internal data used by this ringbuffer + * @param ringbuffer + */ + FREERDP_API void ringbuffer_destroy(RingBuffer* ringbuffer); -/** computes the space used in this ringbuffer - * @param ringbuffer - * @return the number of bytes stored in that ringbuffer - */ -FREERDP_API size_t ringbuffer_used(const RingBuffer *ringbuffer); + /** computes the space used in this ringbuffer + * @param ringbuffer + * @return the number of bytes stored in that ringbuffer + */ + FREERDP_API size_t ringbuffer_used(const RingBuffer* ringbuffer); -/** returns the capacity of the ring buffer - * @param ringbuffer - * @return the capacity of this ring buffer - */ -FREERDP_API size_t ringbuffer_capacity(const RingBuffer *ringbuffer); + /** returns the capacity of the ring buffer + * @param ringbuffer + * @return the capacity of this ring buffer + */ + FREERDP_API size_t ringbuffer_capacity(const RingBuffer* ringbuffer); -/** writes some bytes in the ringbuffer, if the data doesn't fit, the ringbuffer - * is resized automatically - * - * @param rb the ringbuffer - * @param ptr a pointer on the data to add - * @param sz the size of the data to add - * @return if the operation was successful, it could fail in case of OOM during realloc() - */ -FREERDP_API BOOL ringbuffer_write(RingBuffer *rb, const BYTE *ptr, size_t sz); + /** writes some bytes in the ringbuffer, if the data doesn't fit, the ringbuffer + * is resized automatically + * + * @param rb the ringbuffer + * @param ptr a pointer on the data to add + * @param sz the size of the data to add + * @return if the operation was successful, it could fail in case of OOM during realloc() + */ + FREERDP_API BOOL ringbuffer_write(RingBuffer* rb, const BYTE* ptr, size_t sz); + /** ensures that we have sz bytes available at the write head, and return a pointer + * on the write head + * + * @param rb the ring buffer + * @param sz the size to ensure + * @return a pointer on the write head, or NULL in case of OOM + */ + FREERDP_API BYTE* ringbuffer_ensure_linear_write(RingBuffer* rb, size_t sz); -/** ensures that we have sz bytes available at the write head, and return a pointer - * on the write head - * - * @param rb the ring buffer - * @param sz the size to ensure - * @return a pointer on the write head, or NULL in case of OOM - */ -FREERDP_API BYTE *ringbuffer_ensure_linear_write(RingBuffer *rb, size_t sz); + /** move ahead the write head in case some byte were written directly by using + * a pointer retrieved via ringbuffer_ensure_linear_write(). This function is + * used to commit the written bytes. The provided size should not exceed the + * size ensured by ringbuffer_ensure_linear_write() + * + * @param rb the ring buffer + * @param sz the number of bytes that have been written + * @return if the operation was successful, FALSE is sz is too big + */ + FREERDP_API BOOL ringbuffer_commit_written_bytes(RingBuffer* rb, size_t sz); -/** move ahead the write head in case some byte were written directly by using - * a pointer retrieved via ringbuffer_ensure_linear_write(). This function is - * used to commit the written bytes. The provided size should not exceed the - * size ensured by ringbuffer_ensure_linear_write() - * - * @param rb the ring buffer - * @param sz the number of bytes that have been written - * @return if the operation was successful, FALSE is sz is too big - */ -FREERDP_API BOOL ringbuffer_commit_written_bytes(RingBuffer *rb, size_t sz); - - -/** peeks the buffer chunks for sz bytes and returns how many chunks are filled. - * Note that the sum of the resulting chunks may be smaller than sz. - * - * @param rb the ringbuffer - * @param chunks an array of data chunks that will contain data / size of chunks - * @param sz the requested size - * @return the number of chunks used for reading sz bytes - */ -FREERDP_API int ringbuffer_peek(const RingBuffer *rb, DataChunk chunks[2], size_t sz); - -/** move ahead the read head in case some byte were read using ringbuffer_peek() - * This function is used to commit the bytes that were effectively consumed. - * - * @param rb the ring buffer - * @param sz the - */ -FREERDP_API void ringbuffer_commit_read_bytes(RingBuffer *rb, size_t sz); + /** peeks the buffer chunks for sz bytes and returns how many chunks are filled. + * Note that the sum of the resulting chunks may be smaller than sz. + * + * @param rb the ringbuffer + * @param chunks an array of data chunks that will contain data / size of chunks + * @param sz the requested size + * @return the number of chunks used for reading sz bytes + */ + FREERDP_API int ringbuffer_peek(const RingBuffer* rb, DataChunk chunks[2], size_t sz); + /** move ahead the read head in case some byte were read using ringbuffer_peek() + * This function is used to commit the bytes that were effectively consumed. + * + * @param rb the ring buffer + * @param sz the + */ + FREERDP_API void ringbuffer_commit_read_bytes(RingBuffer* rb, size_t sz); #ifdef __cplusplus } diff --git a/include/freerdp/utils/signal.h b/include/freerdp/utils/signal.h index 97f83ce4a..50847f405 100644 --- a/include/freerdp/utils/signal.h +++ b/include/freerdp/utils/signal.h @@ -34,10 +34,11 @@ FREERDP_API extern struct termios new_flags; #endif #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API int freerdp_handle_signals(void); + FREERDP_API int freerdp_handle_signals(void); #ifdef __cplusplus } diff --git a/include/freerdp/utils/stopwatch.h b/include/freerdp/utils/stopwatch.h index af6aa1ee3..eefa5b3b3 100644 --- a/include/freerdp/utils/stopwatch.h +++ b/include/freerdp/utils/stopwatch.h @@ -33,18 +33,20 @@ struct _STOPWATCH typedef struct _STOPWATCH STOPWATCH; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_API STOPWATCH* stopwatch_create(void); -FREERDP_API void stopwatch_free(STOPWATCH* stopwatch); + FREERDP_API STOPWATCH* stopwatch_create(void); + FREERDP_API void stopwatch_free(STOPWATCH* stopwatch); -FREERDP_API void stopwatch_start(STOPWATCH* stopwatch); -FREERDP_API void stopwatch_stop(STOPWATCH* stopwatch); -FREERDP_API void stopwatch_reset(STOPWATCH* stopwatch); + FREERDP_API void stopwatch_start(STOPWATCH* stopwatch); + FREERDP_API void stopwatch_stop(STOPWATCH* stopwatch); + FREERDP_API void stopwatch_reset(STOPWATCH* stopwatch); -FREERDP_API double stopwatch_get_elapsed_time_in_seconds(STOPWATCH* stopwatch); -FREERDP_API void stopwatch_get_elapsed_time_in_useconds(STOPWATCH* stopwatch, UINT32* sec, UINT32* usec); + FREERDP_API double stopwatch_get_elapsed_time_in_seconds(STOPWATCH* stopwatch); + FREERDP_API void stopwatch_get_elapsed_time_in_useconds(STOPWATCH* stopwatch, UINT32* sec, + UINT32* usec); #ifdef __cplusplus } diff --git a/include/freerdp/window.h b/include/freerdp/window.h index 4bfd5a2c4..fc89368a9 100644 --- a/include/freerdp/window.h +++ b/include/freerdp/window.h @@ -23,117 +23,117 @@ #include /* Window Order Header Flags */ -#define WINDOW_ORDER_TYPE_WINDOW 0x01000000 -#define WINDOW_ORDER_TYPE_NOTIFY 0x02000000 -#define WINDOW_ORDER_TYPE_DESKTOP 0x04000000 +#define WINDOW_ORDER_TYPE_WINDOW 0x01000000 +#define WINDOW_ORDER_TYPE_NOTIFY 0x02000000 +#define WINDOW_ORDER_TYPE_DESKTOP 0x04000000 -#define WINDOW_ORDER_STATE_NEW 0x10000000 -#define WINDOW_ORDER_STATE_DELETED 0x20000000 +#define WINDOW_ORDER_STATE_NEW 0x10000000 +#define WINDOW_ORDER_STATE_DELETED 0x20000000 /* Window Order Update */ -#define WINDOW_ORDER_FIELD_OWNER 0x00000002 -#define WINDOW_ORDER_FIELD_STYLE 0x00000008 -#define WINDOW_ORDER_FIELD_SHOW 0x00000010 -#define WINDOW_ORDER_FIELD_TITLE 0x00000004 -#define WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET 0x00004000 -#define WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE 0x00010000 -#define WINDOW_ORDER_FIELD_RESIZE_MARGIN_X 0x00000080 -#define WINDOW_ORDER_FIELD_RESIZE_MARGIN_Y 0x08000000 -#define WINDOW_ORDER_FIELD_RP_CONTENT 0x00020000 -#define WINDOW_ORDER_FIELD_ROOT_PARENT 0x00040000 -#define WINDOW_ORDER_FIELD_WND_OFFSET 0x00000800 -#define WINDOW_ORDER_FIELD_WND_CLIENT_DELTA 0x00008000 -#define WINDOW_ORDER_FIELD_WND_SIZE 0x00000400 -#define WINDOW_ORDER_FIELD_WND_RECTS 0x00000100 -#define WINDOW_ORDER_FIELD_VIS_OFFSET 0x00001000 -#define WINDOW_ORDER_FIELD_VISIBILITY 0x00000200 -#define WINDOW_ORDER_FIELD_OVERLAY_DESCRIPTION 0x00400000 -#define WINDOW_ORDER_FIELD_ICON_OVERLAY_NULL 0x00200000 -#define WINDOW_ORDER_FIELD_TASKBAR_BUTTON 0x00800000 -#define WINDOW_ORDER_FIELD_ENFORCE_SERVER_ZORDER 0x00080000 -#define WINDOW_ORDER_FIELD_APPBAR_STATE 0x00000040 -#define WINDOW_ORDER_FIELD_APPBAR_EDGE 0x00000001 +#define WINDOW_ORDER_FIELD_OWNER 0x00000002 +#define WINDOW_ORDER_FIELD_STYLE 0x00000008 +#define WINDOW_ORDER_FIELD_SHOW 0x00000010 +#define WINDOW_ORDER_FIELD_TITLE 0x00000004 +#define WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET 0x00004000 +#define WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE 0x00010000 +#define WINDOW_ORDER_FIELD_RESIZE_MARGIN_X 0x00000080 +#define WINDOW_ORDER_FIELD_RESIZE_MARGIN_Y 0x08000000 +#define WINDOW_ORDER_FIELD_RP_CONTENT 0x00020000 +#define WINDOW_ORDER_FIELD_ROOT_PARENT 0x00040000 +#define WINDOW_ORDER_FIELD_WND_OFFSET 0x00000800 +#define WINDOW_ORDER_FIELD_WND_CLIENT_DELTA 0x00008000 +#define WINDOW_ORDER_FIELD_WND_SIZE 0x00000400 +#define WINDOW_ORDER_FIELD_WND_RECTS 0x00000100 +#define WINDOW_ORDER_FIELD_VIS_OFFSET 0x00001000 +#define WINDOW_ORDER_FIELD_VISIBILITY 0x00000200 +#define WINDOW_ORDER_FIELD_OVERLAY_DESCRIPTION 0x00400000 +#define WINDOW_ORDER_FIELD_ICON_OVERLAY_NULL 0x00200000 +#define WINDOW_ORDER_FIELD_TASKBAR_BUTTON 0x00800000 +#define WINDOW_ORDER_FIELD_ENFORCE_SERVER_ZORDER 0x00080000 +#define WINDOW_ORDER_FIELD_APPBAR_STATE 0x00000040 +#define WINDOW_ORDER_FIELD_APPBAR_EDGE 0x00000001 /* Window (chached) Icon */ -#define WINDOW_ORDER_ICON 0x40000000 -#define WINDOW_ORDER_CACHED_ICON 0x80000000 -#define WINDOW_ORDER_FIELD_ICON_BIG 0x00002000 -#define WINDOW_ORDER_FIELD_ICON_OVERLAY 0x00100000 +#define WINDOW_ORDER_ICON 0x40000000 +#define WINDOW_ORDER_CACHED_ICON 0x80000000 +#define WINDOW_ORDER_FIELD_ICON_BIG 0x00002000 +#define WINDOW_ORDER_FIELD_ICON_OVERLAY 0x00100000 - -#define WINDOW_ORDER_FIELD_NOTIFY_VERSION 0x00000008 -#define WINDOW_ORDER_FIELD_NOTIFY_TIP 0x00000001 -#define WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP 0x00000002 -#define WINDOW_ORDER_FIELD_NOTIFY_STATE 0x00000004 -#define WINDOW_ORDER_FIELD_DESKTOP_NONE 0x00000001 -#define WINDOW_ORDER_FIELD_DESKTOP_HOOKED 0x00000002 -#define WINDOW_ORDER_FIELD_DESKTOP_ARC_COMPLETED 0x00000004 -#define WINDOW_ORDER_FIELD_DESKTOP_ARC_BEGAN 0x00000008 -#define WINDOW_ORDER_FIELD_DESKTOP_ZORDER 0x00000010 -#define WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND 0x00000020 +#define WINDOW_ORDER_FIELD_NOTIFY_VERSION 0x00000008 +#define WINDOW_ORDER_FIELD_NOTIFY_TIP 0x00000001 +#define WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP 0x00000002 +#define WINDOW_ORDER_FIELD_NOTIFY_STATE 0x00000004 +#define WINDOW_ORDER_FIELD_DESKTOP_NONE 0x00000001 +#define WINDOW_ORDER_FIELD_DESKTOP_HOOKED 0x00000002 +#define WINDOW_ORDER_FIELD_DESKTOP_ARC_COMPLETED 0x00000004 +#define WINDOW_ORDER_FIELD_DESKTOP_ARC_BEGAN 0x00000008 +#define WINDOW_ORDER_FIELD_DESKTOP_ZORDER 0x00000010 +#define WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND 0x00000020 /* Window Show States */ -#define WINDOW_HIDE 0x00 -#define WINDOW_SHOW_MINIMIZED 0x02 -#define WINDOW_SHOW_MAXIMIZED 0x03 -#define WINDOW_SHOW 0x05 +#define WINDOW_HIDE 0x00 +#define WINDOW_SHOW_MINIMIZED 0x02 +#define WINDOW_SHOW_MAXIMIZED 0x03 +#define WINDOW_SHOW 0x05 /* Window Styles */ #ifndef _WIN32 -#define WS_BORDER 0x00800000 -#define WS_CAPTION 0x00C00000 -#define WS_CHILD 0x40000000 -#define WS_CLIPCHILDREN 0x02000000 -#define WS_CLIPSIBLINGS 0x04000000 -#define WS_DISABLED 0x08000000 -#define WS_DLGFRAME 0x00400000 -#define WS_GROUP 0x00020000 -#define WS_HSCROLL 0x00100000 -#define WS_ICONIC 0x20000000 -#define WS_MAXIMIZE 0x01000000 -#define WS_MAXIMIZEBOX 0x00010000 -#define WS_MINIMIZE 0x20000000 -#define WS_MINIMIZEBOX 0x00020000 -#define WS_OVERLAPPED 0x00000000 -#define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX) -#define WS_POPUP 0x80000000 -#define WS_POPUPWINDOW (WS_POPUP | WS_BORDER | WS_SYSMENU) -#define WS_SIZEBOX 0x00040000 -#define WS_SYSMENU 0x00080000 -#define WS_TABSTOP 0x00010000 -#define WS_THICKFRAME 0x00040000 -#define WS_VISIBLE 0x10000000 -#define WS_VSCROLL 0x00200000 +#define WS_BORDER 0x00800000 +#define WS_CAPTION 0x00C00000 +#define WS_CHILD 0x40000000 +#define WS_CLIPCHILDREN 0x02000000 +#define WS_CLIPSIBLINGS 0x04000000 +#define WS_DISABLED 0x08000000 +#define WS_DLGFRAME 0x00400000 +#define WS_GROUP 0x00020000 +#define WS_HSCROLL 0x00100000 +#define WS_ICONIC 0x20000000 +#define WS_MAXIMIZE 0x01000000 +#define WS_MAXIMIZEBOX 0x00010000 +#define WS_MINIMIZE 0x20000000 +#define WS_MINIMIZEBOX 0x00020000 +#define WS_OVERLAPPED 0x00000000 +#define WS_OVERLAPPEDWINDOW \ + (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX) +#define WS_POPUP 0x80000000 +#define WS_POPUPWINDOW (WS_POPUP | WS_BORDER | WS_SYSMENU) +#define WS_SIZEBOX 0x00040000 +#define WS_SYSMENU 0x00080000 +#define WS_TABSTOP 0x00010000 +#define WS_THICKFRAME 0x00040000 +#define WS_VISIBLE 0x10000000 +#define WS_VSCROLL 0x00200000 #endif /* Extended Window Styles */ #ifndef _WIN32 -#define WS_EX_ACCEPTFILES 0x00000010 -#define WS_EX_APPWINDOW 0x00040000 -#define WS_EX_CLIENTEDGE 0x00000200 -#define WS_EX_COMPOSITED 0x02000000 -#define WS_EX_CONTEXTHELP 0x00000400 -#define WS_EX_CONTROLPARENT 0x00010000 -#define WS_EX_DLGMODALFRAME 0x00000001 -#define WS_EX_LAYERED 0x00080000 -#define WS_EX_LAYOUTRTL 0x00400000 -#define WS_EX_LEFT 0x00000000 -#define WS_EX_LEFTSCROLLBAR 0x00004000 -#define WS_EX_LTRREADING 0x00000000 -#define WS_EX_MDICHILD 0x00000040 -#define WS_EX_NOACTIVATE 0x08000000 -#define WS_EX_NOINHERITLAYOUT 0x00100000 -#define WS_EX_NOPARENTNOTIFY 0x00000004 -#define WS_EX_OVERLAPPEDWINDOW (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE) -#define WS_EX_PALETTEWINDOW (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST) -#define WS_EX_RIGHT 0x00001000 -#define WS_EX_RIGHTSCROLLBAR 0x00000000 -#define WS_EX_RTLREADING 0x00002000 -#define WS_EX_STATICEDGE 0x00020000 -#define WS_EX_TOOLWINDOW 0x00000080 -#define WS_EX_TOPMOST 0x00000008 -#define WS_EX_TRANSPARENT 0x00000020 -#define WS_EX_WINDOWEDGE 0x00000100 +#define WS_EX_ACCEPTFILES 0x00000010 +#define WS_EX_APPWINDOW 0x00040000 +#define WS_EX_CLIENTEDGE 0x00000200 +#define WS_EX_COMPOSITED 0x02000000 +#define WS_EX_CONTEXTHELP 0x00000400 +#define WS_EX_CONTROLPARENT 0x00010000 +#define WS_EX_DLGMODALFRAME 0x00000001 +#define WS_EX_LAYERED 0x00080000 +#define WS_EX_LAYOUTRTL 0x00400000 +#define WS_EX_LEFT 0x00000000 +#define WS_EX_LEFTSCROLLBAR 0x00004000 +#define WS_EX_LTRREADING 0x00000000 +#define WS_EX_MDICHILD 0x00000040 +#define WS_EX_NOACTIVATE 0x08000000 +#define WS_EX_NOINHERITLAYOUT 0x00100000 +#define WS_EX_NOPARENTNOTIFY 0x00000004 +#define WS_EX_OVERLAPPEDWINDOW (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE) +#define WS_EX_PALETTEWINDOW (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST) +#define WS_EX_RIGHT 0x00001000 +#define WS_EX_RIGHTSCROLLBAR 0x00000000 +#define WS_EX_RTLREADING 0x00002000 +#define WS_EX_STATICEDGE 0x00020000 +#define WS_EX_TOOLWINDOW 0x00000080 +#define WS_EX_TOPMOST 0x00000008 +#define WS_EX_TRANSPARENT 0x00000020 +#define WS_EX_WINDOWEDGE 0x00000100 #endif /** @@ -141,7 +141,7 @@ * instructing the client to use local window decorations */ -#define WS_EX_DECORATIONS 0x40000000 +#define WS_EX_DECORATIONS 0x40000000 struct _WINDOW_ORDER_INFO { @@ -271,20 +271,20 @@ typedef BOOL (*pNonMonitoredDesktop)(rdpContext* context, const WINDOW_ORDER_INF struct rdp_window_update { - rdpContext* context; /* 0 */ + rdpContext* context; /* 0 */ UINT32 paddingA[16 - 1]; /* 1 */ - pWindowCreate WindowCreate; /* 16 */ - pWindowUpdate WindowUpdate; /* 17 */ - pWindowIcon WindowIcon; /* 18 */ - pWindowCachedIcon WindowCachedIcon; /* 19 */ - pWindowDelete WindowDelete; /* 20 */ - pNotifyIconCreate NotifyIconCreate; /* 21 */ - pNotifyIconUpdate NotifyIconUpdate; /* 22 */ - pNotifyIconDelete NotifyIconDelete; /* 23 */ - pMonitoredDesktop MonitoredDesktop; /* 24 */ + pWindowCreate WindowCreate; /* 16 */ + pWindowUpdate WindowUpdate; /* 17 */ + pWindowIcon WindowIcon; /* 18 */ + pWindowCachedIcon WindowCachedIcon; /* 19 */ + pWindowDelete WindowDelete; /* 20 */ + pNotifyIconCreate NotifyIconCreate; /* 21 */ + pNotifyIconUpdate NotifyIconUpdate; /* 22 */ + pNotifyIconDelete NotifyIconDelete; /* 23 */ + pMonitoredDesktop MonitoredDesktop; /* 24 */ pNonMonitoredDesktop NonMonitoredDesktop; /* 25 */ - UINT32 paddingB[32 - 26]; /* 26 */ + UINT32 paddingB[32 - 26]; /* 26 */ /* internal */ }; diff --git a/libfreerdp/cache/bitmap.c b/libfreerdp/cache/bitmap.c index 0cc336afd..13bad4d5e 100644 --- a/libfreerdp/cache/bitmap.c +++ b/libfreerdp/cache/bitmap.c @@ -40,13 +40,11 @@ #define TAG FREERDP_TAG("cache.bitmap") -static rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmapCache, UINT32 id, - UINT32 index); -static BOOL bitmap_cache_put(rdpBitmapCache* bitmap_cache, UINT32 id, - UINT32 index, rdpBitmap* bitmap); +static rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmapCache, UINT32 id, UINT32 index); +static BOOL bitmap_cache_put(rdpBitmapCache* bitmap_cache, UINT32 id, UINT32 index, + rdpBitmap* bitmap); -static BOOL update_gdi_memblt(rdpContext* context, - MEMBLT_ORDER* memblt) +static BOOL update_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt) { rdpBitmap* bitmap; rdpCache* cache = context->cache; @@ -54,8 +52,7 @@ static BOOL update_gdi_memblt(rdpContext* context, if (memblt->cacheId == 0xFF) bitmap = offscreen_cache_get(cache->offscreen, memblt->cacheIndex); else - bitmap = bitmap_cache_get(cache->bitmap, (BYTE) memblt->cacheId, - memblt->cacheIndex); + bitmap = bitmap_cache_get(cache->bitmap, (BYTE)memblt->cacheId, memblt->cacheIndex); /* XP-SP2 servers sometimes ask for cached bitmaps they've never defined. */ if (bitmap == NULL) @@ -65,8 +62,7 @@ static BOOL update_gdi_memblt(rdpContext* context, return IFCALLRESULT(TRUE, cache->bitmap->MemBlt, context, memblt); } -static BOOL update_gdi_mem3blt(rdpContext* context, - MEM3BLT_ORDER* mem3blt) +static BOOL update_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt) { BYTE style; rdpBitmap* bitmap; @@ -77,8 +73,7 @@ static BOOL update_gdi_mem3blt(rdpContext* context, if (mem3blt->cacheId == 0xFF) bitmap = offscreen_cache_get(cache->offscreen, mem3blt->cacheIndex); else - bitmap = bitmap_cache_get(cache->bitmap, (BYTE) mem3blt->cacheId, - mem3blt->cacheIndex); + bitmap = bitmap_cache_get(cache->bitmap, (BYTE)mem3blt->cacheId, mem3blt->cacheIndex); /* XP-SP2 servers sometimes ask for cached bitmaps they've never defined. */ if (!bitmap) @@ -102,8 +97,7 @@ static BOOL update_gdi_mem3blt(rdpContext* context, return ret; } -static BOOL update_gdi_cache_bitmap(rdpContext* context, - const CACHE_BITMAP_ORDER* cacheBitmap) +static BOOL update_gdi_cache_bitmap(rdpContext* context, const CACHE_BITMAP_ORDER* cacheBitmap) { rdpBitmap* bitmap; rdpBitmap* prevBitmap; @@ -113,12 +107,10 @@ static BOOL update_gdi_cache_bitmap(rdpContext* context, if (!bitmap) return FALSE; - Bitmap_SetDimensions(bitmap, cacheBitmap->bitmapWidth, - cacheBitmap->bitmapHeight); + Bitmap_SetDimensions(bitmap, cacheBitmap->bitmapWidth, cacheBitmap->bitmapHeight); - if (!bitmap->Decompress(context, bitmap, - cacheBitmap->bitmapDataStream, cacheBitmap->bitmapWidth, - cacheBitmap->bitmapHeight, + if (!bitmap->Decompress(context, bitmap, cacheBitmap->bitmapDataStream, + cacheBitmap->bitmapWidth, cacheBitmap->bitmapHeight, cacheBitmap->bitmapBpp, cacheBitmap->bitmapLength, cacheBitmap->compressed, RDP_CODEC_ID_NONE)) { @@ -132,16 +124,12 @@ static BOOL update_gdi_cache_bitmap(rdpContext* context, return FALSE; } - prevBitmap = bitmap_cache_get(cache->bitmap, cacheBitmap->cacheId, - cacheBitmap->cacheIndex); + prevBitmap = bitmap_cache_get(cache->bitmap, cacheBitmap->cacheId, cacheBitmap->cacheIndex); Bitmap_Free(context, prevBitmap); - return bitmap_cache_put(cache->bitmap, cacheBitmap->cacheId, - cacheBitmap->cacheIndex, - bitmap); + return bitmap_cache_put(cache->bitmap, cacheBitmap->cacheId, cacheBitmap->cacheIndex, bitmap); } -static BOOL update_gdi_cache_bitmap_v2(rdpContext* context, - CACHE_BITMAP_V2_ORDER* cacheBitmapV2) +static BOOL update_gdi_cache_bitmap_v2(rdpContext* context, CACHE_BITMAP_V2_ORDER* cacheBitmapV2) { rdpBitmap* bitmap; @@ -159,24 +147,18 @@ static BOOL update_gdi_cache_bitmap_v2(rdpContext* context, if ((settings->ColorDepth == 15) && (cacheBitmapV2->bitmapBpp == 16)) cacheBitmapV2->bitmapBpp = settings->ColorDepth; - Bitmap_SetDimensions(bitmap, cacheBitmapV2->bitmapWidth, - cacheBitmapV2->bitmapHeight); + Bitmap_SetDimensions(bitmap, cacheBitmapV2->bitmapWidth, cacheBitmapV2->bitmapHeight); - if (!bitmap->Decompress(context, bitmap, - cacheBitmapV2->bitmapDataStream, - cacheBitmapV2->bitmapWidth, - cacheBitmapV2->bitmapHeight, - cacheBitmapV2->bitmapBpp, - cacheBitmapV2->bitmapLength, - cacheBitmapV2->compressed, - RDP_CODEC_ID_NONE)) + if (!bitmap->Decompress(context, bitmap, cacheBitmapV2->bitmapDataStream, + cacheBitmapV2->bitmapWidth, cacheBitmapV2->bitmapHeight, + cacheBitmapV2->bitmapBpp, cacheBitmapV2->bitmapLength, + cacheBitmapV2->compressed, RDP_CODEC_ID_NONE)) { Bitmap_Free(context, bitmap); return FALSE; } - prevBitmap = bitmap_cache_get(cache->bitmap, cacheBitmapV2->cacheId, - cacheBitmapV2->cacheIndex); + prevBitmap = bitmap_cache_get(cache->bitmap, cacheBitmapV2->cacheId, cacheBitmapV2->cacheIndex); if (!bitmap->New(context, bitmap)) { @@ -185,12 +167,11 @@ static BOOL update_gdi_cache_bitmap_v2(rdpContext* context, } Bitmap_Free(context, prevBitmap); - return bitmap_cache_put(cache->bitmap, cacheBitmapV2->cacheId, - cacheBitmapV2->cacheIndex, bitmap); + return bitmap_cache_put(cache->bitmap, cacheBitmapV2->cacheId, cacheBitmapV2->cacheIndex, + bitmap); } -static BOOL update_gdi_cache_bitmap_v3(rdpContext* context, - CACHE_BITMAP_V3_ORDER* cacheBitmapV3) +static BOOL update_gdi_cache_bitmap_v3(rdpContext* context, CACHE_BITMAP_V3_ORDER* cacheBitmapV3) { rdpBitmap* bitmap; rdpBitmap* prevBitmap; @@ -209,9 +190,8 @@ static BOOL update_gdi_cache_bitmap_v3(rdpContext* context, compressed = (bitmapData->codecID != RDP_CODEC_ID_NONE); Bitmap_SetDimensions(bitmap, bitmapData->width, bitmapData->height); - if (!bitmap->Decompress(context, bitmap, - bitmapData->data, bitmapData->width, bitmapData->height, - bitmapData->bpp, bitmapData->length, compressed, + if (!bitmap->Decompress(context, bitmap, bitmapData->data, bitmapData->width, + bitmapData->height, bitmapData->bpp, bitmapData->length, compressed, bitmapData->codecID)) { Bitmap_Free(context, bitmap); @@ -224,21 +204,19 @@ static BOOL update_gdi_cache_bitmap_v3(rdpContext* context, return FALSE; } - prevBitmap = bitmap_cache_get(cache->bitmap, cacheBitmapV3->cacheId, - cacheBitmapV3->cacheIndex); + prevBitmap = bitmap_cache_get(cache->bitmap, cacheBitmapV3->cacheId, cacheBitmapV3->cacheIndex); Bitmap_Free(context, prevBitmap); - return bitmap_cache_put(cache->bitmap, cacheBitmapV3->cacheId, - cacheBitmapV3->cacheIndex, bitmap); + return bitmap_cache_put(cache->bitmap, cacheBitmapV3->cacheId, cacheBitmapV3->cacheIndex, + bitmap); } -rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmapCache, UINT32 id, - UINT32 index) +rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmapCache, UINT32 id, UINT32 index) { rdpBitmap* bitmap; if (id > bitmapCache->maxCells) { - WLog_ERR(TAG, "get invalid bitmap cell id: %"PRIu32"", id); + WLog_ERR(TAG, "get invalid bitmap cell id: %" PRIu32 "", id); return NULL; } @@ -248,7 +226,7 @@ rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmapCache, UINT32 id, } else if (index > bitmapCache->cells[id].number) { - WLog_ERR(TAG, "get invalid bitmap index %"PRIu32" in cell id: %"PRIu32"", index, id); + WLog_ERR(TAG, "get invalid bitmap index %" PRIu32 " in cell id: %" PRIu32 "", index, id); return NULL; } @@ -256,12 +234,11 @@ rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmapCache, UINT32 id, return bitmap; } -BOOL bitmap_cache_put(rdpBitmapCache* bitmapCache, UINT32 id, UINT32 index, - rdpBitmap* bitmap) +BOOL bitmap_cache_put(rdpBitmapCache* bitmapCache, UINT32 id, UINT32 index, rdpBitmap* bitmap) { if (id > bitmapCache->maxCells) { - WLog_ERR(TAG, "put invalid bitmap cell id: %"PRIu32"", id); + WLog_ERR(TAG, "put invalid bitmap cell id: %" PRIu32 "", id); return FALSE; } @@ -271,7 +248,7 @@ BOOL bitmap_cache_put(rdpBitmapCache* bitmapCache, UINT32 id, UINT32 index, } else if (index > bitmapCache->cells[id].number) { - WLog_ERR(TAG, "put invalid bitmap index %"PRIu32" in cell id: %"PRIu32"", index, id); + WLog_ERR(TAG, "put invalid bitmap index %" PRIu32 " in cell id: %" PRIu32 "", index, id); return FALSE; } @@ -296,27 +273,26 @@ rdpBitmapCache* bitmap_cache_new(rdpSettings* settings) { int i; rdpBitmapCache* bitmapCache; - bitmapCache = (rdpBitmapCache*) calloc(1, sizeof(rdpBitmapCache)); + bitmapCache = (rdpBitmapCache*)calloc(1, sizeof(rdpBitmapCache)); if (!bitmapCache) return NULL; bitmapCache->settings = settings; - bitmapCache->update = ((freerdp*) settings->instance)->update; + bitmapCache->update = ((freerdp*)settings->instance)->update; bitmapCache->context = bitmapCache->update->context; bitmapCache->maxCells = settings->BitmapCacheV2NumCells; - bitmapCache->cells = (BITMAP_V2_CELL*) calloc(bitmapCache->maxCells, - sizeof(BITMAP_V2_CELL)); + bitmapCache->cells = (BITMAP_V2_CELL*)calloc(bitmapCache->maxCells, sizeof(BITMAP_V2_CELL)); if (!bitmapCache->cells) goto fail; - for (i = 0; i < (int) bitmapCache->maxCells; i++) + for (i = 0; i < (int)bitmapCache->maxCells; i++) { bitmapCache->cells[i].number = settings->BitmapCacheV2CellInfo[i].numEntries; /* allocate an extra entry for BITMAP_CACHE_WAITING_LIST_INDEX */ - bitmapCache->cells[i].entries = (rdpBitmap**) calloc(( - bitmapCache->cells[i].number + 1), sizeof(rdpBitmap*)); + bitmapCache->cells[i].entries = + (rdpBitmap**)calloc((bitmapCache->cells[i].number + 1), sizeof(rdpBitmap*)); if (!bitmapCache->cells[i].entries) goto fail; @@ -327,7 +303,7 @@ fail: if (bitmapCache->cells) { - for (i = 0; i < (int) bitmapCache->maxCells; i++) + for (i = 0; i < (int)bitmapCache->maxCells; i++) free(bitmapCache->cells[i].entries); } @@ -342,9 +318,9 @@ void bitmap_cache_free(rdpBitmapCache* bitmapCache) if (bitmapCache) { - for (i = 0; i < (int) bitmapCache->maxCells; i++) + for (i = 0; i < (int)bitmapCache->maxCells; i++) { - for (j = 0; j < (int) bitmapCache->cells[i].number + 1; j++) + for (j = 0; j < (int)bitmapCache->cells[i].number + 1; j++) { bitmap = bitmapCache->cells[i].entries[j]; Bitmap_Free(bitmapCache->context, bitmap); @@ -374,7 +350,7 @@ static void free_bitmap_data(BITMAP_DATA* data, size_t count) static BITMAP_DATA* copy_bitmap_data(const BITMAP_DATA* data, size_t count) { size_t x; - BITMAP_DATA* dst = (BITMAP_DATA*) calloc(count, sizeof(BITMAP_DATA)); + BITMAP_DATA* dst = (BITMAP_DATA*)calloc(count, sizeof(BITMAP_DATA)); if (!dst) goto fail; @@ -462,7 +438,7 @@ void free_cache_bitmap_order(rdpContext* context, CACHE_BITMAP_ORDER* order) } CACHE_BITMAP_V2_ORDER* copy_cache_bitmap_v2_order(rdpContext* context, - const CACHE_BITMAP_V2_ORDER* order) + const CACHE_BITMAP_V2_ORDER* order) { CACHE_BITMAP_V2_ORDER* dst = calloc(1, sizeof(CACHE_BITMAP_V2_ORDER)); @@ -496,7 +472,7 @@ void free_cache_bitmap_v2_order(rdpContext* context, CACHE_BITMAP_V2_ORDER* orde } CACHE_BITMAP_V3_ORDER* copy_cache_bitmap_v3_order(rdpContext* context, - const CACHE_BITMAP_V3_ORDER* order) + const CACHE_BITMAP_V3_ORDER* order) { CACHE_BITMAP_V3_ORDER* dst = calloc(1, sizeof(CACHE_BITMAP_V3_ORDER)); diff --git a/libfreerdp/cache/bitmap.h b/libfreerdp/cache/bitmap.h index ed54f72b4..d8e394fb3 100644 --- a/libfreerdp/cache/bitmap.h +++ b/libfreerdp/cache/bitmap.h @@ -27,15 +27,15 @@ FREERDP_LOCAL BITMAP_UPDATE* copy_bitmap_update(rdpContext* context, const BITMA FREERDP_LOCAL void free_bitmap_update(rdpContext* context, BITMAP_UPDATE* pointer); FREERDP_LOCAL CACHE_BITMAP_ORDER* copy_cache_bitmap_order(rdpContext* context, - const CACHE_BITMAP_ORDER* order); + const CACHE_BITMAP_ORDER* order); FREERDP_LOCAL void free_cache_bitmap_order(rdpContext* context, CACHE_BITMAP_ORDER* order); FREERDP_LOCAL CACHE_BITMAP_V2_ORDER* copy_cache_bitmap_v2_order(rdpContext* context, - const CACHE_BITMAP_V2_ORDER* order); + const CACHE_BITMAP_V2_ORDER* order); FREERDP_LOCAL void free_cache_bitmap_v2_order(rdpContext* context, CACHE_BITMAP_V2_ORDER* order); FREERDP_LOCAL CACHE_BITMAP_V3_ORDER* copy_cache_bitmap_v3_order(rdpContext* context, - const CACHE_BITMAP_V3_ORDER* order); + const CACHE_BITMAP_V3_ORDER* order); FREERDP_LOCAL void free_cache_bitmap_v3_order(rdpContext* context, CACHE_BITMAP_V3_ORDER* order); #endif /* FREERDP_LIB_CACHE_BITMAP_H */ diff --git a/libfreerdp/cache/brush.c b/libfreerdp/cache/brush.c index e048fd8d8..6a57e5753 100644 --- a/libfreerdp/cache/brush.c +++ b/libfreerdp/cache/brush.c @@ -35,8 +35,7 @@ #define TAG FREERDP_TAG("cache.brush") -static BOOL update_gdi_patblt(rdpContext* context, - PATBLT_ORDER* patblt) +static BOOL update_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt) { BYTE style; BOOL ret = TRUE; @@ -55,15 +54,13 @@ static BOOL update_gdi_patblt(rdpContext* context, return ret; } -static BOOL update_gdi_polygon_sc(rdpContext* context, - const POLYGON_SC_ORDER* polygon_sc) +static BOOL update_gdi_polygon_sc(rdpContext* context, const POLYGON_SC_ORDER* polygon_sc) { rdpCache* cache = context->cache; return IFCALLRESULT(TRUE, cache->brush->PolygonSC, context, polygon_sc); } -static BOOL update_gdi_polygon_cb(rdpContext* context, - POLYGON_CB_ORDER* polygon_cb) +static BOOL update_gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb) { BYTE style; rdpBrush* brush = &polygon_cb->brush; @@ -82,8 +79,7 @@ static BOOL update_gdi_polygon_cb(rdpContext* context, return ret; } -static BOOL update_gdi_cache_brush(rdpContext* context, - const CACHE_BRUSH_ORDER* cacheBrush) +static BOOL update_gdi_cache_brush(rdpContext* context, const CACHE_BRUSH_ORDER* cacheBrush) { UINT32 length; void* data = NULL; @@ -113,7 +109,7 @@ void* brush_cache_get(rdpBrushCache* brushCache, UINT32 index, UINT32* bpp) { if (index >= brushCache->maxMonoEntries) { - WLog_ERR(TAG, "invalid brush (%"PRIu32" bpp) index: 0x%08"PRIX32"", *bpp, index); + WLog_ERR(TAG, "invalid brush (%" PRIu32 " bpp) index: 0x%08" PRIX32 "", *bpp, index); return NULL; } @@ -124,7 +120,7 @@ void* brush_cache_get(rdpBrushCache* brushCache, UINT32 index, UINT32* bpp) { if (index >= brushCache->maxEntries) { - WLog_ERR(TAG, "invalid brush (%"PRIu32" bpp) index: 0x%08"PRIX32"", *bpp, index); + WLog_ERR(TAG, "invalid brush (%" PRIu32 " bpp) index: 0x%08" PRIX32 "", *bpp, index); return NULL; } @@ -134,7 +130,7 @@ void* brush_cache_get(rdpBrushCache* brushCache, UINT32 index, UINT32* bpp) if (entry == NULL) { - WLog_ERR(TAG, "invalid brush (%"PRIu32" bpp) at index: 0x%08"PRIX32"", *bpp, index); + WLog_ERR(TAG, "invalid brush (%" PRIu32 " bpp) at index: 0x%08" PRIX32 "", *bpp, index); return NULL; } @@ -147,7 +143,7 @@ void brush_cache_put(rdpBrushCache* brushCache, UINT32 index, void* entry, UINT3 { if (index >= brushCache->maxMonoEntries) { - WLog_ERR(TAG, "invalid brush (%"PRIu32" bpp) index: 0x%08"PRIX32"", bpp, index); + WLog_ERR(TAG, "invalid brush (%" PRIu32 " bpp) index: 0x%08" PRIX32 "", bpp, index); free(entry); return; } @@ -160,7 +156,7 @@ void brush_cache_put(rdpBrushCache* brushCache, UINT32 index, void* entry, UINT3 { if (index >= brushCache->maxEntries) { - WLog_ERR(TAG, "invalid brush (%"PRIu32" bpp) index: 0x%08"PRIX32"", bpp, index); + WLog_ERR(TAG, "invalid brush (%" PRIu32 " bpp) index: 0x%08" PRIX32 "", bpp, index); free(entry); return; } @@ -186,7 +182,7 @@ void brush_cache_register_callbacks(rdpUpdate* update) rdpBrushCache* brush_cache_new(rdpSettings* settings) { rdpBrushCache* brushCache; - brushCache = (rdpBrushCache*) calloc(1, sizeof(rdpBrushCache)); + brushCache = (rdpBrushCache*)calloc(1, sizeof(rdpBrushCache)); if (!brushCache) return NULL; @@ -199,7 +195,7 @@ rdpBrushCache* brush_cache_new(rdpSettings* settings) if (!brushCache->entries) goto error_entries; - brushCache->monoEntries = (BRUSH_ENTRY*) calloc(brushCache->maxMonoEntries, sizeof(BRUSH_ENTRY)); + brushCache->monoEntries = (BRUSH_ENTRY*)calloc(brushCache->maxMonoEntries, sizeof(BRUSH_ENTRY)); if (!brushCache->monoEntries) goto error_mono; @@ -220,7 +216,7 @@ void brush_cache_free(rdpBrushCache* brushCache) { if (brushCache->entries) { - for (i = 0; i < (int) brushCache->maxEntries; i++) + for (i = 0; i < (int)brushCache->maxEntries; i++) free(brushCache->entries[i].entry); free(brushCache->entries); @@ -228,7 +224,7 @@ void brush_cache_free(rdpBrushCache* brushCache) if (brushCache->monoEntries) { - for (i = 0; i < (int) brushCache->maxMonoEntries; i++) + for (i = 0; i < (int)brushCache->maxMonoEntries; i++) free(brushCache->monoEntries[i].entry); free(brushCache->monoEntries); diff --git a/libfreerdp/cache/brush.h b/libfreerdp/cache/brush.h index 712ac3577..3a2f019be 100644 --- a/libfreerdp/cache/brush.h +++ b/libfreerdp/cache/brush.h @@ -25,7 +25,7 @@ #include FREERDP_LOCAL CACHE_BRUSH_ORDER* copy_cache_brush_order(rdpContext* context, - const CACHE_BRUSH_ORDER* order); + const CACHE_BRUSH_ORDER* order); FREERDP_LOCAL void free_cache_brush_order(rdpContext* context, CACHE_BRUSH_ORDER* order); #endif /* FREERDP_LIB_CACHE_BRUSH_H */ diff --git a/libfreerdp/cache/cache.c b/libfreerdp/cache/cache.c index 53ff77869..2a3ee81de 100644 --- a/libfreerdp/cache/cache.c +++ b/libfreerdp/cache/cache.c @@ -32,7 +32,7 @@ rdpCache* cache_new(rdpSettings* settings) { rdpCache* cache; - cache = (rdpCache*) calloc(1, sizeof(rdpCache)); + cache = (rdpCache*)calloc(1, sizeof(rdpCache)); if (!cache) return NULL; @@ -94,7 +94,7 @@ void cache_free(rdpCache* cache) } CACHE_COLOR_TABLE_ORDER* copy_cache_color_table_order(rdpContext* context, - const CACHE_COLOR_TABLE_ORDER* order) + const CACHE_COLOR_TABLE_ORDER* order) { CACHE_COLOR_TABLE_ORDER* dst = calloc(1, sizeof(CACHE_COLOR_TABLE_ORDER)); @@ -113,7 +113,8 @@ void free_cache_color_table_order(rdpContext* context, CACHE_COLOR_TABLE_ORDER* free(order); } -SURFACE_BITS_COMMAND* copy_surface_bits_command(rdpContext* context, const SURFACE_BITS_COMMAND* order) +SURFACE_BITS_COMMAND* copy_surface_bits_command(rdpContext* context, + const SURFACE_BITS_COMMAND* order) { SURFACE_BITS_COMMAND* dst = calloc(1, sizeof(SURFACE_BITS_COMMAND)); if (!dst || !order) @@ -121,13 +122,12 @@ SURFACE_BITS_COMMAND* copy_surface_bits_command(rdpContext* context, const SURFA *dst = *order; - dst->bmp.bitmapData = (BYTE*) malloc(order->bmp.bitmapDataLength); + dst->bmp.bitmapData = (BYTE*)malloc(order->bmp.bitmapDataLength); if (!dst->bmp.bitmapData) goto fail; - CopyMemory(dst->bmp.bitmapData, order->bmp.bitmapData, - order->bmp.bitmapDataLength); + CopyMemory(dst->bmp.bitmapData, order->bmp.bitmapData, order->bmp.bitmapDataLength); return dst; diff --git a/libfreerdp/cache/cache.h b/libfreerdp/cache/cache.h index 52abee435..5cb15386f 100644 --- a/libfreerdp/cache/cache.h +++ b/libfreerdp/cache/cache.h @@ -24,13 +24,13 @@ #include #include -FREERDP_LOCAL CACHE_COLOR_TABLE_ORDER* copy_cache_color_table_order(rdpContext* context, - const CACHE_COLOR_TABLE_ORDER* order); +FREERDP_LOCAL CACHE_COLOR_TABLE_ORDER* +copy_cache_color_table_order(rdpContext* context, const CACHE_COLOR_TABLE_ORDER* order); FREERDP_LOCAL void free_cache_color_table_order(rdpContext* context, - CACHE_COLOR_TABLE_ORDER* order); + CACHE_COLOR_TABLE_ORDER* order); FREERDP_LOCAL SURFACE_BITS_COMMAND* copy_surface_bits_command(rdpContext* context, - const SURFACE_BITS_COMMAND* order); + const SURFACE_BITS_COMMAND* order); FREERDP_LOCAL void free_surface_bits_command(rdpContext* context, SURFACE_BITS_COMMAND* order); #endif /* FREERDP_LIB_CACHE_CACHE_H */ diff --git a/libfreerdp/cache/glyph.c b/libfreerdp/cache/glyph.c index 950540982..1c17f7eb6 100644 --- a/libfreerdp/cache/glyph.c +++ b/libfreerdp/cache/glyph.c @@ -35,18 +35,15 @@ #define TAG FREERDP_TAG("cache.glyph") -static rdpGlyph* glyph_cache_get(rdpGlyphCache* glyph_cache, UINT32 id, - UINT32 index); -static BOOL glyph_cache_put(rdpGlyphCache* glyph_cache, UINT32 id, UINT32 index, - rdpGlyph* entry); +static rdpGlyph* glyph_cache_get(rdpGlyphCache* glyph_cache, UINT32 id, UINT32 index); +static BOOL glyph_cache_put(rdpGlyphCache* glyph_cache, UINT32 id, UINT32 index, rdpGlyph* entry); -static const void* glyph_cache_fragment_get(rdpGlyphCache* glyph, UINT32 index, - UINT32* count); -static BOOL glyph_cache_fragment_put(rdpGlyphCache* glyph, UINT32 index, - UINT32 count, const void* entry); +static const void* glyph_cache_fragment_get(rdpGlyphCache* glyph, UINT32 index, UINT32* count); +static BOOL glyph_cache_fragment_put(rdpGlyphCache* glyph, UINT32 index, UINT32 count, + const void* entry); -static UINT32 update_glyph_offset(const BYTE* data, UINT32 index, INT32* x, - INT32* y, UINT32 ulCharInc, UINT32 flAccel) +static UINT32 update_glyph_offset(const BYTE* data, UINT32 index, INT32* x, INT32* y, + UINT32 ulCharInc, UINT32 flAccel) { if ((ulCharInc == 0) && (!(flAccel & SO_CHAR_INC_EQUAL_BM_BASE))) { @@ -68,9 +65,8 @@ static UINT32 update_glyph_offset(const BYTE* data, UINT32 index, INT32* x, return index; } -static BOOL update_process_glyph(rdpContext* context, const BYTE* data, - UINT32 cacheIndex, INT32* x, INT32* y, - UINT32 cacheId, UINT32 flAccel, BOOL fOpRedundant, +static BOOL update_process_glyph(rdpContext* context, const BYTE* data, UINT32 cacheIndex, INT32* x, + INT32* y, UINT32 cacheId, UINT32 flAccel, BOOL fOpRedundant, const RDP_RECT* bound) { INT32 sx = 0, sy = 0; @@ -78,8 +74,8 @@ static BOOL update_process_glyph(rdpContext* context, const BYTE* data, rdpGlyph* glyph; rdpGlyphCache* glyph_cache; - if (!context || !data || !x || !y || !context->graphics - || !context->cache || !context->cache->glyph) + if (!context || !data || !x || !y || !context->graphics || !context->cache || + !context->cache->glyph) return FALSE; glyph_cache = context->cache->glyph; @@ -127,17 +123,12 @@ static BOOL update_process_glyph(rdpContext* context, const BYTE* data, return TRUE; } -static BOOL update_process_glyph_fragments(rdpContext* context, - const BYTE* data, - UINT32 length, UINT32 cacheId, - UINT32 ulCharInc, UINT32 flAccel, - UINT32 bgcolor, UINT32 fgcolor, - INT32 x, INT32 y, - INT32 bkX, INT32 bkY, - INT32 bkWidth, INT32 bkHeight, - INT32 opX, INT32 opY, - INT32 opWidth, INT32 opHeight, - BOOL fOpRedundant) +static BOOL update_process_glyph_fragments(rdpContext* context, const BYTE* data, UINT32 length, + UINT32 cacheId, UINT32 ulCharInc, UINT32 flAccel, + UINT32 bgcolor, UINT32 fgcolor, INT32 x, INT32 y, + INT32 bkX, INT32 bkY, INT32 bkWidth, INT32 bkHeight, + INT32 opX, INT32 opY, INT32 opWidth, INT32 opHeight, + BOOL fOpRedundant) { UINT32 n; UINT32 id; @@ -149,8 +140,7 @@ static BOOL update_process_glyph_fragments(rdpContext* context, rdpGlyph* glyph; RDP_RECT bound; - if (!context || !data || !context->graphics || !context->cache - || !context->cache->glyph) + if (!context || !data || !context->graphics || !context->cache || !context->cache->glyph) return FALSE; graphics = context->graphics; @@ -231,8 +221,7 @@ static BOOL update_process_glyph_fragments(rdpContext* context, bound.width = bkWidth; bound.height = bkHeight; - if (!glyph->BeginDraw(context, opX, opY, opWidth, opHeight, bgcolor, fgcolor, - fOpRedundant)) + if (!glyph->BeginDraw(context, opX, opY, opWidth, opHeight, bgcolor, fgcolor, fOpRedundant)) return FALSE; if (!IFCALLRESULT(TRUE, glyph->SetBounds, context, bkX, bkY, bkWidth, bkHeight)) @@ -249,7 +238,7 @@ static BOOL update_process_glyph_fragments(rdpContext* context, return FALSE; id = data[index++]; - fragments = (BYTE*) glyph_cache_fragment_get(glyph_cache, id, &size); + fragments = (BYTE*)glyph_cache_fragment_get(glyph_cache, id, &size); if (fragments == NULL) return FALSE; @@ -259,8 +248,8 @@ static BOOL update_process_glyph_fragments(rdpContext* context, const UINT32 fop = fragments[n++]; n = update_glyph_offset(fragments, n, &x, &y, ulCharInc, flAccel); - if (!update_process_glyph(context, fragments, fop, &x, &y, cacheId, - flAccel, fOpRedundant, &bound)) + if (!update_process_glyph(context, fragments, fop, &x, &y, cacheId, flAccel, + fOpRedundant, &bound)) return FALSE; } @@ -278,8 +267,8 @@ static BOOL update_process_glyph_fragments(rdpContext* context, default: index = update_glyph_offset(data, index, &x, &y, ulCharInc, flAccel); - if (!update_process_glyph(context, data, op, &x, &y, cacheId, flAccel, - fOpRedundant, &bound)) + if (!update_process_glyph(context, data, op, &x, &y, cacheId, flAccel, fOpRedundant, + &bound)) return FALSE; break; @@ -289,8 +278,7 @@ static BOOL update_process_glyph_fragments(rdpContext* context, return glyph->EndDraw(context, opX, opY, opWidth, opHeight, bgcolor, fgcolor); } -static BOOL update_gdi_glyph_index(rdpContext* context, - GLYPH_INDEX_ORDER* glyphIndex) +static BOOL update_gdi_glyph_index(rdpContext* context, GLYPH_INDEX_ORDER* glyphIndex) { INT32 bkWidth = 0, bkHeight = 0, opWidth = 0, opHeight = 0; @@ -309,17 +297,14 @@ static BOOL update_gdi_glyph_index(rdpContext* context, if (glyphIndex->opBottom > glyphIndex->opTop) opHeight = glyphIndex->opBottom - glyphIndex->opTop + 1; - return update_process_glyph_fragments(context, glyphIndex->data, - glyphIndex->cbData, - glyphIndex->cacheId, glyphIndex->ulCharInc, glyphIndex->flAccel, - glyphIndex->backColor, glyphIndex->foreColor, glyphIndex->x, glyphIndex->y, - glyphIndex->bkLeft, glyphIndex->bkTop, bkWidth, bkHeight, - glyphIndex->opLeft, glyphIndex->opTop, opWidth, opHeight, - glyphIndex->fOpRedundant); + return update_process_glyph_fragments( + context, glyphIndex->data, glyphIndex->cbData, glyphIndex->cacheId, glyphIndex->ulCharInc, + glyphIndex->flAccel, glyphIndex->backColor, glyphIndex->foreColor, glyphIndex->x, + glyphIndex->y, glyphIndex->bkLeft, glyphIndex->bkTop, bkWidth, bkHeight, glyphIndex->opLeft, + glyphIndex->opTop, opWidth, opHeight, glyphIndex->fOpRedundant); } -static BOOL update_gdi_fast_index(rdpContext* context, - const FAST_INDEX_ORDER* fastIndex) +static BOOL update_gdi_fast_index(rdpContext* context, const FAST_INDEX_ORDER* fastIndex) { INT32 x, y; INT32 opLeft, opTop; @@ -384,16 +369,13 @@ static BOOL update_gdi_fast_index(rdpContext* context, if (opBottom > opTop) opHeight = opBottom - opTop + 1; - return update_process_glyph_fragments(context, fastIndex->data, - fastIndex->cbData, - fastIndex->cacheId, fastIndex->ulCharInc, fastIndex->flAccel, - fastIndex->backColor, fastIndex->foreColor, x, y, - fastIndex->bkLeft, fastIndex->bkTop, bkWidth, bkHeight, - opLeft, opTop, opWidth, opHeight, FALSE); + return update_process_glyph_fragments( + context, fastIndex->data, fastIndex->cbData, fastIndex->cacheId, fastIndex->ulCharInc, + fastIndex->flAccel, fastIndex->backColor, fastIndex->foreColor, x, y, fastIndex->bkLeft, + fastIndex->bkTop, bkWidth, bkHeight, opLeft, opTop, opWidth, opHeight, FALSE); } -static BOOL update_gdi_fast_glyph(rdpContext* context, - const FAST_GLYPH_ORDER* fastGlyph) +static BOOL update_gdi_fast_glyph(rdpContext* context, const FAST_GLYPH_ORDER* fastGlyph) { INT32 x, y; BYTE text_data[2]; @@ -453,15 +435,13 @@ static BOOL update_gdi_fast_glyph(rdpContext* context, rdpGlyph* glyph; const GLYPH_DATA_V2* glyphData = &fastGlyph->glyphData; - glyph = Glyph_Alloc(context, glyphData->x, glyphData->y, glyphData->cx, - glyphData->cy, + glyph = Glyph_Alloc(context, glyphData->x, glyphData->y, glyphData->cx, glyphData->cy, glyphData->cb, glyphData->aj); if (!glyph) return FALSE; - if (!glyph_cache_put(cache->glyph, fastGlyph->cacheId, fastGlyph->data[0], - glyph)) + if (!glyph_cache_put(cache->glyph, fastGlyph->cacheId, fastGlyph->data[0], glyph)) { glyph->Free(context, glyph); return FALSE; @@ -483,16 +463,13 @@ static BOOL update_gdi_fast_glyph(rdpContext* context, if (opBottom > opTop) opHeight = opBottom - opTop + 1; - return update_process_glyph_fragments(context, text_data, 1, - fastGlyph->cacheId, fastGlyph->ulCharInc, fastGlyph->flAccel, - fastGlyph->backColor, fastGlyph->foreColor, x, y, - fastGlyph->bkLeft, fastGlyph->bkTop, - bkWidth, bkHeight, opLeft, opTop, - opWidth, opHeight, FALSE); + return update_process_glyph_fragments( + context, text_data, 1, fastGlyph->cacheId, fastGlyph->ulCharInc, fastGlyph->flAccel, + fastGlyph->backColor, fastGlyph->foreColor, x, y, fastGlyph->bkLeft, fastGlyph->bkTop, + bkWidth, bkHeight, opLeft, opTop, opWidth, opHeight, FALSE); } -static BOOL update_gdi_cache_glyph(rdpContext* context, - const CACHE_GLYPH_ORDER* cacheGlyph) +static BOOL update_gdi_cache_glyph(rdpContext* context, const CACHE_GLYPH_ORDER* cacheGlyph) { UINT32 i; rdpCache* cache; @@ -510,16 +487,11 @@ static BOOL update_gdi_cache_glyph(rdpContext* context, if (!glyph_data) return FALSE; - if (!(glyph = Glyph_Alloc(context, glyph_data->x, - glyph_data->y, - glyph_data->cx, - glyph_data->cy, - glyph_data->cb, - glyph_data->aj))) + if (!(glyph = Glyph_Alloc(context, glyph_data->x, glyph_data->y, glyph_data->cx, + glyph_data->cy, glyph_data->cb, glyph_data->aj))) return FALSE; - if (!glyph_cache_put(cache->glyph, cacheGlyph->cacheId, glyph_data->cacheIndex, - glyph)) + if (!glyph_cache_put(cache->glyph, cacheGlyph->cacheId, glyph_data->cacheIndex, glyph)) { glyph->Free(context, glyph); return FALSE; @@ -529,8 +501,7 @@ static BOOL update_gdi_cache_glyph(rdpContext* context, return TRUE; } -static BOOL update_gdi_cache_glyph_v2(rdpContext* context, - const CACHE_GLYPH_V2_ORDER* cacheGlyphV2) +static BOOL update_gdi_cache_glyph_v2(rdpContext* context, const CACHE_GLYPH_V2_ORDER* cacheGlyphV2) { UINT32 i; rdpCache* cache; @@ -548,18 +519,13 @@ static BOOL update_gdi_cache_glyph_v2(rdpContext* context, if (!glyphData) return FALSE; - glyph = Glyph_Alloc(context, glyphData->x, - glyphData->y, - glyphData->cx, - glyphData->cy, - glyphData->cb, - glyphData->aj); + glyph = Glyph_Alloc(context, glyphData->x, glyphData->y, glyphData->cx, glyphData->cy, + glyphData->cb, glyphData->aj); if (!glyph) return FALSE; - if (!glyph_cache_put(cache->glyph, cacheGlyphV2->cacheId, glyphData->cacheIndex, - glyph)) + if (!glyph_cache_put(cache->glyph, cacheGlyphV2->cacheId, glyphData->cacheIndex, glyph)) { glyph->Free(context, glyph); return FALSE; @@ -572,47 +538,47 @@ static BOOL update_gdi_cache_glyph_v2(rdpContext* context, rdpGlyph* glyph_cache_get(rdpGlyphCache* glyphCache, UINT32 id, UINT32 index) { rdpGlyph* glyph; - WLog_Print(glyphCache->log, WLOG_DEBUG, "GlyphCacheGet: id: %"PRIu32" index: %"PRIu32"", id, + WLog_Print(glyphCache->log, WLOG_DEBUG, "GlyphCacheGet: id: %" PRIu32 " index: %" PRIu32 "", id, index); if (id > 9) { - WLog_ERR(TAG, "invalid glyph cache id: %"PRIu32"", id); + WLog_ERR(TAG, "invalid glyph cache id: %" PRIu32 "", id); return NULL; } if (index > glyphCache->glyphCache[id].number) { - WLog_ERR(TAG, "index %"PRIu32" out of range for cache id: %"PRIu32"", index, id); + WLog_ERR(TAG, "index %" PRIu32 " out of range for cache id: %" PRIu32 "", index, id); return NULL; } glyph = glyphCache->glyphCache[id].entries[index]; if (!glyph) - WLog_ERR(TAG, "no glyph found at cache index: %"PRIu32" in cache id: %"PRIu32"", index, id); + WLog_ERR(TAG, "no glyph found at cache index: %" PRIu32 " in cache id: %" PRIu32 "", index, + id); return glyph; } -BOOL glyph_cache_put(rdpGlyphCache* glyphCache, UINT32 id, UINT32 index, - rdpGlyph* glyph) +BOOL glyph_cache_put(rdpGlyphCache* glyphCache, UINT32 id, UINT32 index, rdpGlyph* glyph) { rdpGlyph* prevGlyph; if (id > 9) { - WLog_ERR(TAG, "invalid glyph cache id: %"PRIu32"", id); + WLog_ERR(TAG, "invalid glyph cache id: %" PRIu32 "", id); return FALSE; } if (index > glyphCache->glyphCache[id].number) { - WLog_ERR(TAG, "invalid glyph cache index: %"PRIu32" in cache id: %"PRIu32"", index, id); + WLog_ERR(TAG, "invalid glyph cache index: %" PRIu32 " in cache id: %" PRIu32 "", index, id); return FALSE; } - WLog_Print(glyphCache->log, WLOG_DEBUG, "GlyphCachePut: id: %"PRIu32" index: %"PRIu32"", id, + WLog_Print(glyphCache->log, WLOG_DEBUG, "GlyphCachePut: id: %" PRIu32 " index: %" PRIu32 "", id, index); prevGlyph = glyphCache->glyphCache[id].entries[index]; @@ -623,37 +589,36 @@ BOOL glyph_cache_put(rdpGlyphCache* glyphCache, UINT32 id, UINT32 index, return TRUE; } -const void* glyph_cache_fragment_get(rdpGlyphCache* glyphCache, UINT32 index, - UINT32* size) +const void* glyph_cache_fragment_get(rdpGlyphCache* glyphCache, UINT32 index, UINT32* size) { void* fragment; if (index > 255) { - WLog_ERR(TAG, "invalid glyph cache fragment index: %"PRIu32"", index); + WLog_ERR(TAG, "invalid glyph cache fragment index: %" PRIu32 "", index); return NULL; } fragment = glyphCache->fragCache.entries[index].fragment; - *size = (BYTE) glyphCache->fragCache.entries[index].size; + *size = (BYTE)glyphCache->fragCache.entries[index].size; WLog_Print(glyphCache->log, WLOG_DEBUG, - "GlyphCacheFragmentGet: index: %"PRIu32" size: %"PRIu32"", index, *size); + "GlyphCacheFragmentGet: index: %" PRIu32 " size: %" PRIu32 "", index, *size); if (!fragment) - WLog_ERR(TAG, "invalid glyph fragment at index:%"PRIu32"", index); + WLog_ERR(TAG, "invalid glyph fragment at index:%" PRIu32 "", index); return fragment; } -BOOL glyph_cache_fragment_put(rdpGlyphCache* glyphCache, UINT32 index, - UINT32 size, const void* fragment) +BOOL glyph_cache_fragment_put(rdpGlyphCache* glyphCache, UINT32 index, UINT32 size, + const void* fragment) { void* prevFragment; void* copy; if (index > 255) { - WLog_ERR(TAG, "invalid glyph cache fragment index: %"PRIu32"", index); + WLog_ERR(TAG, "invalid glyph cache fragment index: %" PRIu32 "", index); return FALSE; } @@ -663,7 +628,7 @@ BOOL glyph_cache_fragment_put(rdpGlyphCache* glyphCache, UINT32 index, return FALSE; WLog_Print(glyphCache->log, WLOG_DEBUG, - "GlyphCacheFragmentPut: index: %"PRIu32" size: %"PRIu32"", index, size); + "GlyphCacheFragmentPut: index: %" PRIu32 " size: %" PRIu32 "", index, size); CopyMemory(copy, fragment, size); prevFragment = glyphCache->fragCache.entries[index].fragment; glyphCache->fragCache.entries[index].fragment = copy; @@ -685,22 +650,21 @@ rdpGlyphCache* glyph_cache_new(rdpSettings* settings) { int i; rdpGlyphCache* glyphCache; - glyphCache = (rdpGlyphCache*) calloc(1, sizeof(rdpGlyphCache)); + glyphCache = (rdpGlyphCache*)calloc(1, sizeof(rdpGlyphCache)); if (!glyphCache) return NULL; glyphCache->log = WLog_Get("com.freerdp.cache.glyph"); glyphCache->settings = settings; - glyphCache->context = ((freerdp*) settings->instance)->update->context; + glyphCache->context = ((freerdp*)settings->instance)->update->context; for (i = 0; i < 10; i++) { glyphCache->glyphCache[i].number = settings->GlyphCache[i].cacheEntries; - glyphCache->glyphCache[i].maxCellSize = - settings->GlyphCache[i].cacheMaximumCellSize; - glyphCache->glyphCache[i].entries = (rdpGlyph**) calloc( - glyphCache->glyphCache[i].number, sizeof(rdpGlyph*)); + glyphCache->glyphCache[i].maxCellSize = settings->GlyphCache[i].cacheMaximumCellSize; + glyphCache->glyphCache[i].entries = + (rdpGlyph**)calloc(glyphCache->glyphCache[i].number, sizeof(rdpGlyph*)); if (!glyphCache->glyphCache[i].entries) goto fail; @@ -823,7 +787,7 @@ void free_cache_glyph_order(rdpContext* context, CACHE_GLYPH_ORDER* glyph) } CACHE_GLYPH_V2_ORDER* copy_cache_glyph_v2_order(rdpContext* context, - const CACHE_GLYPH_V2_ORDER* glyph) + const CACHE_GLYPH_V2_ORDER* glyph) { size_t x; CACHE_GLYPH_V2_ORDER* dst = calloc(1, sizeof(CACHE_GLYPH_V2_ORDER)); diff --git a/libfreerdp/cache/glyph.h b/libfreerdp/cache/glyph.h index 9f8d1b1d4..4866b6792 100644 --- a/libfreerdp/cache/glyph.h +++ b/libfreerdp/cache/glyph.h @@ -25,11 +25,11 @@ #include FREERDP_LOCAL CACHE_GLYPH_ORDER* copy_cache_glyph_order(rdpContext* context, - const CACHE_GLYPH_ORDER* glyph); + const CACHE_GLYPH_ORDER* glyph); FREERDP_LOCAL void free_cache_glyph_order(rdpContext* context, CACHE_GLYPH_ORDER* glyph); FREERDP_LOCAL CACHE_GLYPH_V2_ORDER* copy_cache_glyph_v2_order(rdpContext* context, - const CACHE_GLYPH_V2_ORDER* glyph); + const CACHE_GLYPH_V2_ORDER* glyph); FREERDP_LOCAL void free_cache_glyph_v2_order(rdpContext* context, CACHE_GLYPH_V2_ORDER* glyph); #endif /* FREERDP_LIB_CACHE_GLYPH_H */ diff --git a/libfreerdp/cache/nine_grid.c b/libfreerdp/cache/nine_grid.c index 7f5a7e825..e2953f4f3 100644 --- a/libfreerdp/cache/nine_grid.c +++ b/libfreerdp/cache/nine_grid.c @@ -30,7 +30,6 @@ #include #include - #include #define TAG FREERDP_TAG("cache.nine_grid") @@ -38,16 +37,15 @@ static void* nine_grid_cache_get(rdpNineGridCache* nine_grid, UINT32 index); static void nine_grid_cache_put(rdpNineGridCache* nine_grid, UINT32 index, void* entry); - static BOOL update_gdi_draw_nine_grid(rdpContext* context, - const DRAW_NINE_GRID_ORDER* draw_nine_grid) + const DRAW_NINE_GRID_ORDER* draw_nine_grid) { rdpCache* cache = context->cache; return IFCALLRESULT(TRUE, cache->nine_grid->DrawNineGrid, context, draw_nine_grid); } static BOOL update_gdi_multi_draw_nine_grid(rdpContext* context, - const MULTI_DRAW_NINE_GRID_ORDER* multi_draw_nine_grid) + const MULTI_DRAW_NINE_GRID_ORDER* multi_draw_nine_grid) { rdpCache* cache = context->cache; return IFCALLRESULT(TRUE, cache->nine_grid->MultiDrawNineGrid, context, multi_draw_nine_grid); @@ -70,7 +68,7 @@ void* nine_grid_cache_get(rdpNineGridCache* nine_grid, UINT32 index) if (index >= nine_grid->maxEntries) { - WLog_ERR(TAG, "invalid NineGrid index: 0x%08"PRIX32"", index); + WLog_ERR(TAG, "invalid NineGrid index: 0x%08" PRIX32 "", index); return NULL; } @@ -78,7 +76,7 @@ void* nine_grid_cache_get(rdpNineGridCache* nine_grid, UINT32 index) if (entry == NULL) { - WLog_ERR(TAG, "invalid NineGrid at index: 0x%08"PRIX32"", index); + WLog_ERR(TAG, "invalid NineGrid at index: 0x%08" PRIX32 "", index); return NULL; } @@ -89,7 +87,7 @@ void nine_grid_cache_put(rdpNineGridCache* nine_grid, UINT32 index, void* entry) { if (index >= nine_grid->maxEntries) { - WLog_ERR(TAG, "invalid NineGrid index: 0x%08"PRIX32"", index); + WLog_ERR(TAG, "invalid NineGrid index: 0x%08" PRIX32 "", index); return; } @@ -101,7 +99,7 @@ rdpNineGridCache* nine_grid_cache_new(rdpSettings* settings) { rdpNineGridCache* nine_grid; - nine_grid = (rdpNineGridCache*) calloc(1, sizeof(rdpNineGridCache)); + nine_grid = (rdpNineGridCache*)calloc(1, sizeof(rdpNineGridCache)); if (!nine_grid) return NULL; @@ -113,7 +111,7 @@ rdpNineGridCache* nine_grid_cache_new(rdpSettings* settings) nine_grid->settings->DrawNineGridCacheSize = nine_grid->maxSize; nine_grid->settings->DrawNineGridCacheEntries = nine_grid->maxEntries; - nine_grid->entries = (NINE_GRID_ENTRY*) calloc(nine_grid->maxEntries, sizeof(NINE_GRID_ENTRY)); + nine_grid->entries = (NINE_GRID_ENTRY*)calloc(nine_grid->maxEntries, sizeof(NINE_GRID_ENTRY)); if (!nine_grid->entries) { free(nine_grid); @@ -131,7 +129,7 @@ void nine_grid_cache_free(rdpNineGridCache* nine_grid) { if (nine_grid->entries != NULL) { - for (i = 0; i < (int) nine_grid->maxEntries; i++) + for (i = 0; i < (int)nine_grid->maxEntries; i++) free(nine_grid->entries[i].entry); free(nine_grid->entries); diff --git a/libfreerdp/cache/offscreen.c b/libfreerdp/cache/offscreen.c index a07012d6d..a308acf22 100644 --- a/libfreerdp/cache/offscreen.c +++ b/libfreerdp/cache/offscreen.c @@ -34,12 +34,13 @@ #define TAG FREERDP_TAG("cache.offscreen") -static void offscreen_cache_put(rdpOffscreenCache* offscreen_cache, - UINT32 index, rdpBitmap* bitmap); +static void offscreen_cache_put(rdpOffscreenCache* offscreen_cache, UINT32 index, + rdpBitmap* bitmap); static void offscreen_cache_delete(rdpOffscreenCache* offscreen, UINT32 index); -static BOOL update_gdi_create_offscreen_bitmap(rdpContext* context, - const CREATE_OFFSCREEN_BITMAP_ORDER* createOffscreenBitmap) +static BOOL +update_gdi_create_offscreen_bitmap(rdpContext* context, + const CREATE_OFFSCREEN_BITMAP_ORDER* createOffscreenBitmap) { UINT32 i; UINT16 index; @@ -55,8 +56,7 @@ static BOOL update_gdi_create_offscreen_bitmap(rdpContext* context, if (!bitmap) return FALSE; - Bitmap_SetDimensions(bitmap, createOffscreenBitmap->cx, - createOffscreenBitmap->cy); + Bitmap_SetDimensions(bitmap, createOffscreenBitmap->cx, createOffscreenBitmap->cy); if (!bitmap->New(context, bitmap)) { @@ -117,7 +117,7 @@ rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreenCache, UINT32 index) if (index >= offscreenCache->maxEntries) { - WLog_ERR(TAG, "invalid offscreen bitmap index: 0x%08"PRIX32"", index); + WLog_ERR(TAG, "invalid offscreen bitmap index: 0x%08" PRIX32 "", index); return NULL; } @@ -125,19 +125,18 @@ rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreenCache, UINT32 index) if (!bitmap) { - WLog_ERR(TAG, "invalid offscreen bitmap at index: 0x%08"PRIX32"", index); + WLog_ERR(TAG, "invalid offscreen bitmap at index: 0x%08" PRIX32 "", index); return NULL; } return bitmap; } -void offscreen_cache_put(rdpOffscreenCache* offscreenCache, UINT32 index, - rdpBitmap* bitmap) +void offscreen_cache_put(rdpOffscreenCache* offscreenCache, UINT32 index, rdpBitmap* bitmap) { if (index >= offscreenCache->maxEntries) { - WLog_ERR(TAG, "invalid offscreen bitmap index: 0x%08"PRIX32"", index); + WLog_ERR(TAG, "invalid offscreen bitmap index: 0x%08" PRIX32 "", index); return; } @@ -151,7 +150,7 @@ void offscreen_cache_delete(rdpOffscreenCache* offscreenCache, UINT32 index) if (index >= offscreenCache->maxEntries) { - WLog_ERR(TAG, "invalid offscreen bitmap index (delete): 0x%08"PRIX32"", index); + WLog_ERR(TAG, "invalid offscreen bitmap index (delete): 0x%08" PRIX32 "", index); return; } @@ -172,20 +171,19 @@ void offscreen_cache_register_callbacks(rdpUpdate* update) rdpOffscreenCache* offscreen_cache_new(rdpSettings* settings) { rdpOffscreenCache* offscreenCache; - offscreenCache = (rdpOffscreenCache*) calloc(1, sizeof(rdpOffscreenCache)); + offscreenCache = (rdpOffscreenCache*)calloc(1, sizeof(rdpOffscreenCache)); if (!offscreenCache) return NULL; offscreenCache->settings = settings; - offscreenCache->update = ((freerdp*) settings->instance)->update; + offscreenCache->update = ((freerdp*)settings->instance)->update; offscreenCache->currentSurface = SCREEN_BITMAP_SURFACE; offscreenCache->maxSize = 7680; offscreenCache->maxEntries = 2000; settings->OffscreenCacheSize = offscreenCache->maxSize; settings->OffscreenCacheEntries = offscreenCache->maxEntries; - offscreenCache->entries = (rdpBitmap**) calloc(offscreenCache->maxEntries, - sizeof(rdpBitmap*)); + offscreenCache->entries = (rdpBitmap**)calloc(offscreenCache->maxEntries, sizeof(rdpBitmap*)); if (!offscreenCache->entries) { @@ -203,7 +201,7 @@ void offscreen_cache_free(rdpOffscreenCache* offscreenCache) if (offscreenCache) { - for (i = 0; i < (int) offscreenCache->maxEntries; i++) + for (i = 0; i < (int)offscreenCache->maxEntries; i++) { bitmap = offscreenCache->entries[i]; Bitmap_Free(offscreenCache->update->context, bitmap); diff --git a/libfreerdp/cache/palette.c b/libfreerdp/cache/palette.c index 644888f6f..6a998b6e6 100644 --- a/libfreerdp/cache/palette.c +++ b/libfreerdp/cache/palette.c @@ -37,17 +37,17 @@ static void* palette_cache_get(rdpPaletteCache* palette, UINT32 index); static void palette_cache_put(rdpPaletteCache* palette, UINT32 index, void* entry); static BOOL update_gdi_cache_color_table(rdpContext* context, - const CACHE_COLOR_TABLE_ORDER* cacheColorTable) + const CACHE_COLOR_TABLE_ORDER* cacheColorTable) { UINT32* colorTable; rdpCache* cache = context->cache; - colorTable = (UINT32*) malloc(sizeof(UINT32) * 256); + colorTable = (UINT32*)malloc(sizeof(UINT32) * 256); if (!colorTable) return FALSE; CopyMemory(colorTable, cacheColorTable->colorTable, sizeof(UINT32) * 256); - palette_cache_put(cache->palette, cacheColorTable->cacheIndex, (void*) colorTable); + palette_cache_put(cache->palette, cacheColorTable->cacheIndex, (void*)colorTable); return TRUE; } @@ -57,7 +57,7 @@ void* palette_cache_get(rdpPaletteCache* paletteCache, UINT32 index) if (index >= paletteCache->maxEntries) { - WLog_ERR(TAG, "invalid color table index: 0x%08"PRIX32"", index); + WLog_ERR(TAG, "invalid color table index: 0x%08" PRIX32 "", index); return NULL; } @@ -65,7 +65,7 @@ void* palette_cache_get(rdpPaletteCache* paletteCache, UINT32 index) if (!entry) { - WLog_ERR(TAG, "invalid color table at index: 0x%08"PRIX32"", index); + WLog_ERR(TAG, "invalid color table at index: 0x%08" PRIX32 "", index); return NULL; } @@ -76,7 +76,7 @@ void palette_cache_put(rdpPaletteCache* paletteCache, UINT32 index, void* entry) { if (index >= paletteCache->maxEntries) { - WLog_ERR(TAG, "invalid color table index: 0x%08"PRIX32"", index); + WLog_ERR(TAG, "invalid color table index: 0x%08" PRIX32 "", index); free(entry); return; } @@ -93,14 +93,14 @@ void palette_cache_register_callbacks(rdpUpdate* update) rdpPaletteCache* palette_cache_new(rdpSettings* settings) { rdpPaletteCache* paletteCache; - paletteCache = (rdpPaletteCache*) calloc(1, sizeof(rdpPaletteCache)); + paletteCache = (rdpPaletteCache*)calloc(1, sizeof(rdpPaletteCache)); if (paletteCache) { paletteCache->settings = settings; paletteCache->maxEntries = 6; - paletteCache->entries = (PALETTE_TABLE_ENTRY*) calloc(paletteCache->maxEntries, - sizeof(PALETTE_TABLE_ENTRY)); + paletteCache->entries = + (PALETTE_TABLE_ENTRY*)calloc(paletteCache->maxEntries, sizeof(PALETTE_TABLE_ENTRY)); } return paletteCache; diff --git a/libfreerdp/cache/palette.h b/libfreerdp/cache/palette.h index 21edaafbf..cb2c7d70b 100644 --- a/libfreerdp/cache/palette.h +++ b/libfreerdp/cache/palette.h @@ -24,7 +24,7 @@ #include FREERDP_LOCAL PALETTE_UPDATE* copy_palette_update(rdpContext* context, - const PALETTE_UPDATE* pointer); + const PALETTE_UPDATE* pointer); FREERDP_LOCAL void free_palette_update(rdpContext* context, PALETTE_UPDATE* pointer); #endif /* FREERDP_LIB_CACHE_PALETTE_H */ diff --git a/libfreerdp/cache/pointer.c b/libfreerdp/cache/pointer.c index c536a3c19..7545c1301 100644 --- a/libfreerdp/cache/pointer.c +++ b/libfreerdp/cache/pointer.c @@ -34,10 +34,8 @@ #define TAG FREERDP_TAG("cache.pointer") -static BOOL pointer_cache_put(rdpPointerCache* pointer_cache, UINT32 index, - rdpPointer* pointer); -static const rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, - UINT32 index); +static BOOL pointer_cache_put(rdpPointerCache* pointer_cache, UINT32 index, rdpPointer* pointer); +static const rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, UINT32 index); static void pointer_free(rdpContext* context, rdpPointer* pointer) { @@ -66,22 +64,20 @@ static BOOL update_pointer_position(rdpContext* context, { rdpPointer* pointer; - if (!context || !context->graphics || !context->graphics->Pointer_Prototype - || !pointer_position) + if (!context || !context->graphics || !context->graphics->Pointer_Prototype || + !pointer_position) return FALSE; pointer = context->graphics->Pointer_Prototype; return IFCALLRESULT(TRUE, pointer->SetPosition, context, pointer_position->xPos, - pointer_position->yPos); + pointer_position->yPos); } -static BOOL update_pointer_system(rdpContext* context, - const POINTER_SYSTEM_UPDATE* pointer_system) +static BOOL update_pointer_system(rdpContext* context, const POINTER_SYSTEM_UPDATE* pointer_system) { rdpPointer* pointer; - if (!context || !context->graphics || !context->graphics->Pointer_Prototype - || !pointer_system) + if (!context || !context->graphics || !context->graphics->Pointer_Prototype || !pointer_system) return FALSE; pointer = context->graphics->Pointer_Prototype; @@ -95,13 +91,12 @@ static BOOL update_pointer_system(rdpContext* context, return IFCALLRESULT(TRUE, pointer->SetDefault, context); default: - WLog_ERR(TAG, "Unknown system pointer type (0x%08"PRIX32")", pointer_system->type); + WLog_ERR(TAG, "Unknown system pointer type (0x%08" PRIX32 ")", pointer_system->type); } return TRUE; } -static BOOL update_pointer_color(rdpContext* context, - const POINTER_COLOR_UPDATE* pointer_color) +static BOOL update_pointer_color(rdpContext* context, const POINTER_COLOR_UPDATE* pointer_color) { rdpPointer* pointer; rdpCache* cache = context->cache; @@ -119,24 +114,22 @@ static BOOL update_pointer_color(rdpContext* context, if (pointer->lengthAndMask && pointer_color->andMaskData) { - pointer->andMaskData = (BYTE*) malloc(pointer->lengthAndMask); + pointer->andMaskData = (BYTE*)malloc(pointer->lengthAndMask); if (!pointer->andMaskData) goto out_fail; - CopyMemory(pointer->andMaskData, pointer_color->andMaskData, - pointer->lengthAndMask); + CopyMemory(pointer->andMaskData, pointer_color->andMaskData, pointer->lengthAndMask); } if (pointer->lengthXorMask && pointer_color->xorMaskData) { - pointer->xorMaskData = (BYTE*) malloc(pointer->lengthXorMask); + pointer->xorMaskData = (BYTE*)malloc(pointer->lengthXorMask); if (!pointer->xorMaskData) goto out_fail; - CopyMemory(pointer->xorMaskData, pointer_color->xorMaskData, - pointer->lengthXorMask); + CopyMemory(pointer->xorMaskData, pointer_color->xorMaskData, pointer->lengthXorMask); } if (!IFCALLRESULT(TRUE, pointer->New, context, pointer)) @@ -154,8 +147,7 @@ out_fail: return FALSE; } -static BOOL update_pointer_new(rdpContext* context, - const POINTER_NEW_UPDATE* pointer_new) +static BOOL update_pointer_new(rdpContext* context, const POINTER_NEW_UPDATE* pointer_new) { rdpPointer* pointer; rdpCache* cache; @@ -179,7 +171,7 @@ static BOOL update_pointer_new(rdpContext* context, if (pointer->lengthAndMask) { - pointer->andMaskData = (BYTE*) malloc(pointer->lengthAndMask); + pointer->andMaskData = (BYTE*)malloc(pointer->lengthAndMask); if (!pointer->andMaskData) goto out_fail; @@ -190,7 +182,7 @@ static BOOL update_pointer_new(rdpContext* context, if (pointer->lengthXorMask) { - pointer->xorMaskData = (BYTE*) malloc(pointer->lengthXorMask); + pointer->xorMaskData = (BYTE*)malloc(pointer->lengthXorMask); if (!pointer->xorMaskData) goto out_fail; @@ -202,8 +194,7 @@ static BOOL update_pointer_new(rdpContext* context, if (!IFCALLRESULT(TRUE, pointer->New, context, pointer)) goto out_fail; - if (!pointer_cache_put(cache->pointer, pointer_new->colorPtrAttr.cacheIndex, - pointer)) + if (!pointer_cache_put(cache->pointer, pointer_new->colorPtrAttr.cacheIndex, pointer)) goto out_fail; return IFCALLRESULT(TRUE, pointer->Set, context, pointer); @@ -212,8 +203,7 @@ out_fail: return FALSE; } -static BOOL update_pointer_cached(rdpContext* context, - const POINTER_CACHED_UPDATE* pointer_cached) +static BOOL update_pointer_cached(rdpContext* context, const POINTER_CACHED_UPDATE* pointer_cached) { const rdpPointer* pointer; rdpCache* cache = context->cache; @@ -225,14 +215,13 @@ static BOOL update_pointer_cached(rdpContext* context, return FALSE; } -const rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, - UINT32 index) +const rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, UINT32 index) { const rdpPointer* pointer; if (index >= pointer_cache->cacheSize) { - WLog_ERR(TAG, "invalid pointer index:%"PRIu32"", index); + WLog_ERR(TAG, "invalid pointer index:%" PRIu32 "", index); return NULL; } @@ -240,14 +229,13 @@ const rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, return pointer; } -BOOL pointer_cache_put(rdpPointerCache* pointer_cache, UINT32 index, - rdpPointer* pointer) +BOOL pointer_cache_put(rdpPointerCache* pointer_cache, UINT32 index, rdpPointer* pointer) { rdpPointer* prevPointer; if (index >= pointer_cache->cacheSize) { - WLog_ERR(TAG, "invalid pointer index:%"PRIu32"", index); + WLog_ERR(TAG, "invalid pointer index:%" PRIu32 "", index); return FALSE; } @@ -270,16 +258,15 @@ void pointer_cache_register_callbacks(rdpUpdate* update) rdpPointerCache* pointer_cache_new(rdpSettings* settings) { rdpPointerCache* pointer_cache; - pointer_cache = (rdpPointerCache*) calloc(1, sizeof(rdpPointerCache)); + pointer_cache = (rdpPointerCache*)calloc(1, sizeof(rdpPointerCache)); if (!pointer_cache) return NULL; pointer_cache->settings = settings; pointer_cache->cacheSize = settings->PointerCacheSize; - pointer_cache->update = ((freerdp*) settings->instance)->update; - pointer_cache->entries = (rdpPointer**) calloc(pointer_cache->cacheSize, - sizeof(rdpPointer*)); + pointer_cache->update = ((freerdp*)settings->instance)->update; + pointer_cache->entries = (rdpPointer**)calloc(pointer_cache->cacheSize, sizeof(rdpPointer*)); if (!pointer_cache->entries) { @@ -309,7 +296,7 @@ void pointer_cache_free(rdpPointerCache* pointer_cache) } POINTER_COLOR_UPDATE* copy_pointer_color_update(rdpContext* context, - const POINTER_COLOR_UPDATE* src) + const POINTER_COLOR_UPDATE* src) { POINTER_COLOR_UPDATE* dst = calloc(1, sizeof(POINTER_COLOR_UPDATE)); @@ -402,7 +389,7 @@ void free_pointer_new_update(rdpContext* context, POINTER_NEW_UPDATE* pointer) } POINTER_CACHED_UPDATE* copy_pointer_cached_update(rdpContext* context, - const POINTER_CACHED_UPDATE* pointer) + const POINTER_CACHED_UPDATE* pointer) { POINTER_CACHED_UPDATE* dst = calloc(1, sizeof(POINTER_CACHED_UPDATE)); @@ -427,7 +414,7 @@ void free_pointer_position_update(rdpContext* context, POINTER_POSITION_UPDATE* } POINTER_POSITION_UPDATE* copy_pointer_position_update(rdpContext* context, - const POINTER_POSITION_UPDATE* pointer) + const POINTER_POSITION_UPDATE* pointer) { POINTER_POSITION_UPDATE* dst = calloc(1, sizeof(POINTER_POSITION_UPDATE)); @@ -447,7 +434,7 @@ void free_pointer_system_update(rdpContext* context, POINTER_SYSTEM_UPDATE* poin } POINTER_SYSTEM_UPDATE* copy_pointer_system_update(rdpContext* context, - const POINTER_SYSTEM_UPDATE* pointer) + const POINTER_SYSTEM_UPDATE* pointer) { POINTER_SYSTEM_UPDATE* dst = calloc(1, sizeof(POINTER_SYSTEM_UPDATE)); diff --git a/libfreerdp/cache/pointer.h b/libfreerdp/cache/pointer.h index acf1307ac..599dc0405 100644 --- a/libfreerdp/cache/pointer.h +++ b/libfreerdp/cache/pointer.h @@ -25,25 +25,24 @@ #include FREERDP_LOCAL POINTER_COLOR_UPDATE* copy_pointer_color_update(rdpContext* context, - const POINTER_COLOR_UPDATE* pointer); + const POINTER_COLOR_UPDATE* pointer); FREERDP_LOCAL void free_pointer_color_update(rdpContext* context, POINTER_COLOR_UPDATE* pointer); FREERDP_LOCAL POINTER_NEW_UPDATE* copy_pointer_new_update(rdpContext* context, - const POINTER_NEW_UPDATE* pointer); + const POINTER_NEW_UPDATE* pointer); FREERDP_LOCAL void free_pointer_new_update(rdpContext* context, POINTER_NEW_UPDATE* pointer); -FREERDP_LOCAL POINTER_CACHED_UPDATE* copy_pointer_cached_update(rdpContext* context, - const POINTER_CACHED_UPDATE* pointer); +FREERDP_LOCAL POINTER_CACHED_UPDATE* +copy_pointer_cached_update(rdpContext* context, const POINTER_CACHED_UPDATE* pointer); FREERDP_LOCAL void free_pointer_cached_update(rdpContext* context, POINTER_CACHED_UPDATE* pointer); -FREERDP_LOCAL POINTER_POSITION_UPDATE* copy_pointer_position_update(rdpContext* context, - const POINTER_POSITION_UPDATE* pointer); +FREERDP_LOCAL POINTER_POSITION_UPDATE* +copy_pointer_position_update(rdpContext* context, const POINTER_POSITION_UPDATE* pointer); FREERDP_LOCAL void free_pointer_position_update(rdpContext* context, - POINTER_POSITION_UPDATE* pointer); + POINTER_POSITION_UPDATE* pointer); -FREERDP_LOCAL POINTER_SYSTEM_UPDATE* copy_pointer_system_update(rdpContext* context, - const POINTER_SYSTEM_UPDATE* pointer); -FREERDP_LOCAL void free_pointer_system_update(rdpContext* context, - POINTER_SYSTEM_UPDATE* pointer); +FREERDP_LOCAL POINTER_SYSTEM_UPDATE* +copy_pointer_system_update(rdpContext* context, const POINTER_SYSTEM_UPDATE* pointer); +FREERDP_LOCAL void free_pointer_system_update(rdpContext* context, POINTER_SYSTEM_UPDATE* pointer); #endif /* FREERDP_LIB_CACHE_POINTER_H */ diff --git a/libfreerdp/codec/audio.c b/libfreerdp/codec/audio.c index e7f3735c8..caea6db95 100644 --- a/libfreerdp/codec/audio.c +++ b/libfreerdp/codec/audio.c @@ -53,18 +53,20 @@ UINT32 audio_format_compute_time_length(const AUDIO_FORMAT* format, size_t size) if ((format->cbSize == 2) && (format->data)) { - nSamplesPerBlock = *((UINT16*) format->data); + nSamplesPerBlock = *((UINT16*)format->data); wSamples = (size / format->nBlockAlign) * nSamplesPerBlock; mstime = (((wSamples * 1000) / format->nSamplesPerSec) / format->nChannels); } else { - WLog_ERR(TAG, "audio_format_compute_time_length: invalid WAVE_FORMAT_GSM610 format"); + WLog_ERR(TAG, + "audio_format_compute_time_length: invalid WAVE_FORMAT_GSM610 format"); } } else { - WLog_ERR(TAG, "audio_format_compute_time_length: unknown format %"PRIu16"", format->wFormatTag); + WLog_ERR(TAG, "audio_format_compute_time_length: unknown format %" PRIu16 "", + format->wFormatTag); } } @@ -115,8 +117,10 @@ char* audio_format_get_tag_string(UINT16 wFormatTag) void audio_format_print(wLog* log, DWORD level, const AUDIO_FORMAT* format) { WLog_Print(log, level, - "%s:\t wFormatTag: 0x%04"PRIX16" nChannels: %"PRIu16" nSamplesPerSec: %"PRIu32" " - "nAvgBytesPerSec: %"PRIu32" nBlockAlign: %"PRIu16" wBitsPerSample: %"PRIu16" cbSize: %"PRIu16"", + "%s:\t wFormatTag: 0x%04" PRIX16 " nChannels: %" PRIu16 " nSamplesPerSec: %" PRIu32 + " " + "nAvgBytesPerSec: %" PRIu32 " nBlockAlign: %" PRIu16 " wBitsPerSample: %" PRIu16 + " cbSize: %" PRIu16 "", audio_format_get_tag_string(format->wFormatTag), format->wFormatTag, format->nChannels, format->nSamplesPerSec, format->nAvgBytesPerSec, format->nBlockAlign, format->wBitsPerSample, format->cbSize); @@ -129,16 +133,16 @@ void audio_formats_print(wLog* log, DWORD level, const AUDIO_FORMAT* formats, UI if (formats) { - WLog_Print(log, level, "AUDIO_FORMATS (%"PRIu16") ={", count); + WLog_Print(log, level, "AUDIO_FORMATS (%" PRIu16 ") ={", count); for (index = 0; index < count; index++) { format = &formats[index]; - WLog_Print(log, level, "\t"); + WLog_Print(log, level, "\t"); audio_format_print(log, level, format); } - WLog_Print(log, level, "}"); + WLog_Print(log, level, "}"); } } @@ -184,13 +188,13 @@ BOOL audio_format_write(wStream* s, const AUDIO_FORMAT* format) if (!Stream_EnsureRemainingCapacity(s, 18 + format->cbSize)) return FALSE; - Stream_Write_UINT16(s, format->wFormatTag); /* wFormatTag (WAVE_FORMAT_PCM) */ - Stream_Write_UINT16(s, format->nChannels); /* nChannels */ - Stream_Write_UINT32(s, format->nSamplesPerSec); /* nSamplesPerSec */ + Stream_Write_UINT16(s, format->wFormatTag); /* wFormatTag (WAVE_FORMAT_PCM) */ + Stream_Write_UINT16(s, format->nChannels); /* nChannels */ + Stream_Write_UINT32(s, format->nSamplesPerSec); /* nSamplesPerSec */ Stream_Write_UINT32(s, format->nAvgBytesPerSec); /* nAvgBytesPerSec */ - Stream_Write_UINT16(s, format->nBlockAlign); /* nBlockAlign */ - Stream_Write_UINT16(s, format->wBitsPerSample); /* wBitsPerSample */ - Stream_Write_UINT16(s, format->cbSize); /* cbSize */ + Stream_Write_UINT16(s, format->nBlockAlign); /* nBlockAlign */ + Stream_Write_UINT16(s, format->wBitsPerSample); /* wBitsPerSample */ + Stream_Write_UINT16(s, format->cbSize); /* cbSize */ if (format->cbSize > 0) Stream_Write(s, format->data, format->cbSize); diff --git a/libfreerdp/codec/bitmap.c b/libfreerdp/codec/bitmap.c index 479c965e5..546da6dc7 100644 --- a/libfreerdp/codec/bitmap.c +++ b/libfreerdp/codec/bitmap.c @@ -33,7 +33,8 @@ static INLINE UINT16 GETPIXEL16(const void* d, UINT32 x, UINT32 y, UINT32 w) static INLINE UINT32 GETPIXEL32(const void* d, UINT32 x, UINT32 y, UINT32 w) { const BYTE* src = (const BYTE*)d + ((y * w + x) * sizeof(UINT32)); - return (((UINT32)src[3]) << 24) | (((UINT32)src[2]) << 16) | (((UINT32)src[1]) << 8) | (src[0] & 0xFF); + return (((UINT32)src[3]) << 24) | (((UINT32)src[2]) << 16) | (((UINT32)src[1]) << 8) | + (src[0] & 0xFF); } /*****************************************************************************/ @@ -115,7 +116,7 @@ static UINT16 out_color_count_3(UINT16 in_count, wStream* in_s, UINT32 in_data) } Stream_Write_UINT8(in_s, in_data & 0xFF); - \ + Stream_Write_UINT8(in_s, (in_data >> 8) & 0xFF); Stream_Write_UINT8(in_s, (in_data >> 16) & 0xFF); } @@ -193,7 +194,7 @@ static INLINE UINT16 out_copy_count_3(UINT16 in_count, wStream* in_s, wStream* i /*****************************************************************************/ /* bicolor */ static INLINE UINT16 out_bicolor_count_2(UINT16 in_count, wStream* in_s, UINT16 in_color1, - UINT16 in_color2) + UINT16 in_color2) { if (in_count > 0) { @@ -227,7 +228,7 @@ static INLINE UINT16 out_bicolor_count_2(UINT16 in_count, wStream* in_s, UINT16 /*****************************************************************************/ /* bicolor */ static INLINE UINT16 out_bicolor_count_3(UINT16 in_count, wStream* in_s, UINT32 in_color1, - UINT32 in_color2) + UINT32 in_color2) { if (in_count > 0) { @@ -288,8 +289,7 @@ static INLINE UINT16 out_fill_count_2(UINT16 in_count, wStream* in_s) return 0; } -#define OUT_FILL_COUNT2(in_count, in_s) \ - in_count = out_fill_count_2(in_count, in_s) +#define OUT_FILL_COUNT2(in_count, in_s) in_count = out_fill_count_2(in_count, in_s) /*****************************************************************************/ /* fill */ @@ -316,8 +316,7 @@ static INLINE UINT16 out_fill_count_3(UINT16 in_count, wStream* in_s) return 0; } -#define OUT_FILL_COUNT3(in_count, in_s) \ - in_count = out_fill_count_3(in_count, in_s) +#define OUT_FILL_COUNT3(in_count, in_s) in_count = out_fill_count_3(in_count, in_s) /*****************************************************************************/ /* mix */ @@ -345,8 +344,7 @@ static INLINE UINT16 out_mix_count_2(UINT16 in_count, wStream* in_s) return 0; } -#define OUT_MIX_COUNT2(in_count, in_s) \ - in_count = out_mix_count_2(in_count, in_s) +#define OUT_MIX_COUNT2(in_count, in_s) in_count = out_mix_count_2(in_count, in_s) /*****************************************************************************/ /* mix */ @@ -375,8 +373,7 @@ static INLINE UINT16 out_mix_count_3(UINT16 in_count, wStream* in_s) return 0; } -#define OUT_MIX_COUNT3(in_count, in_s) \ - in_count = out_mix_count_3(in_count, in_s) +#define OUT_MIX_COUNT3(in_count, in_s) in_count = out_mix_count_3(in_count, in_s) /*****************************************************************************/ /* fom */ @@ -442,35 +439,28 @@ static INLINE UINT16 out_from_count_3(UINT16 in_count, wStream* in_s, const char #define OUT_FOM_COUNT3(in_count, in_s, in_mask, in_mask_len) \ in_count = out_from_count_3(in_count, in_s, in_mask, in_mask_len) -#define TEST_FILL \ - ((last_line == 0 && pixel == 0) || \ - (last_line != 0 && pixel == ypixel)) -#define TEST_MIX \ - ((last_line == 0 && pixel == mix) || \ - (last_line != 0 && pixel == (ypixel ^ mix))) +#define TEST_FILL ((last_line == 0 && pixel == 0) || (last_line != 0 && pixel == ypixel)) +#define TEST_MIX ((last_line == 0 && pixel == mix) || (last_line != 0 && pixel == (ypixel ^ mix))) #define TEST_FOM TEST_FILL || TEST_MIX #define TEST_COLOR pixel == last_pixel -#define TEST_BICOLOR \ - ( \ - (pixel != last_pixel) && \ - ( \ - (!bicolor_spin && (pixel == bicolor1) && (last_pixel == bicolor2)) || \ - (bicolor_spin && (pixel == bicolor2) && (last_pixel == bicolor1)) \ - ) \ - ) -#define RESET_COUNTS \ - { \ - bicolor_count = 0; \ - fill_count = 0; \ - color_count = 0; \ - mix_count = 0; \ - fom_count = 0; \ - fom_mask_len = 0; \ +#define TEST_BICOLOR \ + ((pixel != last_pixel) && \ + ((!bicolor_spin && (pixel == bicolor1) && (last_pixel == bicolor2)) || \ + (bicolor_spin && (pixel == bicolor2) && (last_pixel == bicolor1)))) +#define RESET_COUNTS \ + { \ + bicolor_count = 0; \ + fill_count = 0; \ + color_count = 0; \ + mix_count = 0; \ + fom_count = 0; \ + fom_mask_len = 0; \ bicolor_spin = FALSE; \ } static SSIZE_T freerdp_bitmap_compress_24(const void* srcData, UINT32 width, UINT32 height, - wStream* s, UINT32 byte_limit, UINT32 start_line, wStream* temp_s, UINT32 e) + wStream* s, UINT32 byte_limit, UINT32 start_line, + wStream* temp_s, UINT32 e) { char fom_mask[8192]; /* good for up to 64K bitmap */ SSIZE_T lines_sent = 0; @@ -498,10 +488,8 @@ static SSIZE_T freerdp_bitmap_compress_24(const void* srcData, UINT32 width, UIN UINT32 j; size_t i = Stream_GetPosition(s) + count * 3U; - if ((i - (color_count * 3) >= byte_limit) && - (i - (bicolor_count * 3) >= byte_limit) && - (i - (fill_count * 3) >= byte_limit) && - (i - (mix_count * 3) >= byte_limit) && + if ((i - (color_count * 3) >= byte_limit) && (i - (bicolor_count * 3) >= byte_limit) && + (i - (fill_count * 3) >= byte_limit) && (i - (mix_count * 3) >= byte_limit) && (i - (fom_count * 3) >= byte_limit)) { break; @@ -513,15 +501,12 @@ static SSIZE_T freerdp_bitmap_compress_24(const void* srcData, UINT32 width, UIN { /* read next pixel */ const UINT32 pixel = IN_PIXEL32(line, j, 0, width, last_pixel); - const UINT32 ypixel = IN_PIXEL32(last_line, j, 0, width, last_ypixel); + const UINT32 ypixel = IN_PIXEL32(last_line, j, 0, width, last_ypixel); if (!TEST_FILL) { - if (fill_count > 3 && - fill_count >= color_count && - fill_count >= bicolor_count && - fill_count >= mix_count && - fill_count >= fom_count) + if (fill_count > 3 && fill_count >= color_count && fill_count >= bicolor_count && + fill_count >= mix_count && fill_count >= fom_count) { if (fill_count > count) return -1; @@ -537,11 +522,8 @@ static SSIZE_T freerdp_bitmap_compress_24(const void* srcData, UINT32 width, UIN if (!TEST_MIX) { - if (mix_count > 3 && - mix_count >= fill_count && - mix_count >= bicolor_count && - mix_count >= color_count && - mix_count >= fom_count) + if (mix_count > 3 && mix_count >= fill_count && mix_count >= bicolor_count && + mix_count >= color_count && mix_count >= fom_count) { if (mix_count > count) return -1; @@ -557,11 +539,8 @@ static SSIZE_T freerdp_bitmap_compress_24(const void* srcData, UINT32 width, UIN if (!(TEST_COLOR)) { - if (color_count > 3 && - color_count >= fill_count && - color_count >= bicolor_count && - color_count >= mix_count && - color_count >= fom_count) + if (color_count > 3 && color_count >= fill_count && color_count >= bicolor_count && + color_count >= mix_count && color_count >= fom_count) { if (color_count > count) return -1; @@ -577,10 +556,8 @@ static SSIZE_T freerdp_bitmap_compress_24(const void* srcData, UINT32 width, UIN if (!TEST_BICOLOR) { - if (bicolor_count > 3 && - bicolor_count >= fill_count && - bicolor_count >= color_count && - bicolor_count >= mix_count && + if (bicolor_count > 3 && bicolor_count >= fill_count && + bicolor_count >= color_count && bicolor_count >= mix_count && bicolor_count >= fom_count) { if ((bicolor_count % 2) != 0) @@ -603,11 +580,8 @@ static SSIZE_T freerdp_bitmap_compress_24(const void* srcData, UINT32 width, UIN if (!(TEST_FOM)) { - if (fom_count > 3 && - fom_count >= fill_count && - fom_count >= color_count && - fom_count >= mix_count && - fom_count >= bicolor_count) + if (fom_count > 3 && fom_count >= fill_count && fom_count >= color_count && + fom_count >= mix_count && fom_count >= bicolor_count) { if (fom_count > count) return -1; @@ -670,11 +644,8 @@ static SSIZE_T freerdp_bitmap_compress_24(const void* srcData, UINT32 width, UIN /* can't take fix, mix, or fom past first line */ if (last_line == 0) { - if (fill_count > 3 && - fill_count >= color_count && - fill_count >= bicolor_count && - fill_count >= mix_count && - fill_count >= fom_count) + if (fill_count > 3 && fill_count >= color_count && fill_count >= bicolor_count && + fill_count >= mix_count && fill_count >= fom_count) { if (fill_count > count) return -1; @@ -687,11 +658,8 @@ static SSIZE_T freerdp_bitmap_compress_24(const void* srcData, UINT32 width, UIN fill_count = 0; - if (mix_count > 3 && - mix_count >= fill_count && - mix_count >= bicolor_count && - mix_count >= color_count && - mix_count >= fom_count) + if (mix_count > 3 && mix_count >= fill_count && mix_count >= bicolor_count && + mix_count >= color_count && mix_count >= fom_count) { if (mix_count > count) return -1; @@ -704,11 +672,8 @@ static SSIZE_T freerdp_bitmap_compress_24(const void* srcData, UINT32 width, UIN mix_count = 0; - if (fom_count > 3 && - fom_count >= fill_count && - fom_count >= color_count && - fom_count >= mix_count && - fom_count >= bicolor_count) + if (fom_count > 3 && fom_count >= fill_count && fom_count >= color_count && + fom_count >= mix_count && fom_count >= bicolor_count) { if (fom_count > count) return -1; @@ -731,11 +696,8 @@ static SSIZE_T freerdp_bitmap_compress_24(const void* srcData, UINT32 width, UIN Stream_SetPosition(temp_s, 0); - if (fill_count > 3 && - fill_count >= color_count && - fill_count >= bicolor_count && - fill_count >= mix_count && - fill_count >= fom_count) + if (fill_count > 3 && fill_count >= color_count && fill_count >= bicolor_count && + fill_count >= mix_count && fill_count >= fom_count) { if (fill_count > count) return -1; @@ -744,11 +706,8 @@ static SSIZE_T freerdp_bitmap_compress_24(const void* srcData, UINT32 width, UIN OUT_COPY_COUNT3(count, s, temp_s); OUT_FILL_COUNT3(fill_count, s); } - else if (mix_count > 3 && - mix_count >= color_count && - mix_count >= bicolor_count && - mix_count >= fill_count && - mix_count >= fom_count) + else if (mix_count > 3 && mix_count >= color_count && mix_count >= bicolor_count && + mix_count >= fill_count && mix_count >= fom_count) { if (mix_count > count) return -1; @@ -757,11 +716,8 @@ static SSIZE_T freerdp_bitmap_compress_24(const void* srcData, UINT32 width, UIN OUT_COPY_COUNT3(count, s, temp_s); OUT_MIX_COUNT3(mix_count, s); } - else if (color_count > 3 && - color_count >= mix_count && - color_count >= bicolor_count && - color_count >= fill_count && - color_count >= fom_count) + else if (color_count > 3 && color_count >= mix_count && color_count >= bicolor_count && + color_count >= fill_count && color_count >= fom_count) { if (color_count > count) return -1; @@ -770,11 +726,8 @@ static SSIZE_T freerdp_bitmap_compress_24(const void* srcData, UINT32 width, UIN OUT_COPY_COUNT3(count, s, temp_s); OUT_COLOR_COUNT3(color_count, s, last_pixel); } - else if (bicolor_count > 3 && - bicolor_count >= mix_count && - bicolor_count >= color_count && - bicolor_count >= fill_count && - bicolor_count >= fom_count) + else if (bicolor_count > 3 && bicolor_count >= mix_count && bicolor_count >= color_count && + bicolor_count >= fill_count && bicolor_count >= fom_count) { if ((bicolor_count % 2) != 0) bicolor_count--; @@ -793,11 +746,8 @@ static SSIZE_T freerdp_bitmap_compress_24(const void* srcData, UINT32 width, UIN OUT_COPY_COUNT3(count, s, temp_s); OUT_BICOLOR_COUNT3(bicolor_count, s, bicolor1, bicolor2); } - else if (fom_count > 3 && - fom_count >= mix_count && - fom_count >= color_count && - fom_count >= fill_count && - fom_count >= bicolor_count) + else if (fom_count > 3 && fom_count >= mix_count && fom_count >= color_count && + fom_count >= fill_count && fom_count >= bicolor_count) { if (fom_count > count) return -1; @@ -815,7 +765,8 @@ static SSIZE_T freerdp_bitmap_compress_24(const void* srcData, UINT32 width, UIN } static SSIZE_T freerdp_bitmap_compress_16(const void* srcData, UINT32 width, UINT32 height, - wStream* s, UINT32 bpp, UINT32 byte_limit, UINT32 start_line, wStream* temp_s, UINT32 e) + wStream* s, UINT32 bpp, UINT32 byte_limit, + UINT32 start_line, wStream* temp_s, UINT32 e) { char fom_mask[8192]; /* good for up to 64K bitmap */ SSIZE_T lines_sent = 0; @@ -834,7 +785,7 @@ static SSIZE_T freerdp_bitmap_compress_16(const void* srcData, UINT32 width, UIN const UINT32 mix = (bpp == 15) ? 0xBA1F : 0xFFFF; UINT16 fom_count = 0; size_t fom_mask_len = 0; - const char* start = (const char*) srcData; + const char* start = (const char*)srcData; const char* line = start + width * start_line * 2; const char* last_line = NULL; @@ -843,10 +794,8 @@ static SSIZE_T freerdp_bitmap_compress_16(const void* srcData, UINT32 width, UIN UINT32 j; size_t i = Stream_GetPosition(s) + count * 2; - if ((i - (color_count * 2) >= byte_limit) && - (i - (bicolor_count * 2) >= byte_limit) && - (i - (fill_count * 2) >= byte_limit) && - (i - (mix_count * 2) >= byte_limit) && + if ((i - (color_count * 2) >= byte_limit) && (i - (bicolor_count * 2) >= byte_limit) && + (i - (fill_count * 2) >= byte_limit) && (i - (mix_count * 2) >= byte_limit) && (i - (fom_count * 2) >= byte_limit)) { break; @@ -862,11 +811,8 @@ static SSIZE_T freerdp_bitmap_compress_16(const void* srcData, UINT32 width, UIN if (!TEST_FILL) { - if (fill_count > 3 && - fill_count >= color_count && - fill_count >= bicolor_count && - fill_count >= mix_count && - fill_count >= fom_count) + if (fill_count > 3 && fill_count >= color_count && fill_count >= bicolor_count && + fill_count >= mix_count && fill_count >= fom_count) { if (fill_count > count) return -1; @@ -882,11 +828,8 @@ static SSIZE_T freerdp_bitmap_compress_16(const void* srcData, UINT32 width, UIN if (!TEST_MIX) { - if (mix_count > 3 && - mix_count >= fill_count && - mix_count >= bicolor_count && - mix_count >= color_count && - mix_count >= fom_count) + if (mix_count > 3 && mix_count >= fill_count && mix_count >= bicolor_count && + mix_count >= color_count && mix_count >= fom_count) { if (mix_count > count) return -1; @@ -902,11 +845,8 @@ static SSIZE_T freerdp_bitmap_compress_16(const void* srcData, UINT32 width, UIN if (!(TEST_COLOR)) { - if (color_count > 3 && - color_count >= fill_count && - color_count >= bicolor_count && - color_count >= mix_count && - color_count >= fom_count) + if (color_count > 3 && color_count >= fill_count && color_count >= bicolor_count && + color_count >= mix_count && color_count >= fom_count) { if (color_count > count) return -1; @@ -922,10 +862,8 @@ static SSIZE_T freerdp_bitmap_compress_16(const void* srcData, UINT32 width, UIN if (!TEST_BICOLOR) { - if ((bicolor_count > 3) && - (bicolor_count >= fill_count) && - (bicolor_count >= color_count) && - (bicolor_count >= mix_count) && + if ((bicolor_count > 3) && (bicolor_count >= fill_count) && + (bicolor_count >= color_count) && (bicolor_count >= mix_count) && (bicolor_count >= fom_count)) { if ((bicolor_count % 2) != 0) @@ -948,11 +886,8 @@ static SSIZE_T freerdp_bitmap_compress_16(const void* srcData, UINT32 width, UIN if (!(TEST_FOM)) { - if (fom_count > 3 && - fom_count >= fill_count && - fom_count >= color_count && - fom_count >= mix_count && - fom_count >= bicolor_count) + if (fom_count > 3 && fom_count >= fill_count && fom_count >= color_count && + fom_count >= mix_count && fom_count >= bicolor_count) { if (fom_count > count) return -1; @@ -1013,11 +948,8 @@ static SSIZE_T freerdp_bitmap_compress_16(const void* srcData, UINT32 width, UIN /* can't take fix, mix, or fom past first line */ if (last_line == 0) { - if (fill_count > 3 && - fill_count >= color_count && - fill_count >= bicolor_count && - fill_count >= mix_count && - fill_count >= fom_count) + if (fill_count > 3 && fill_count >= color_count && fill_count >= bicolor_count && + fill_count >= mix_count && fill_count >= fom_count) { if (fill_count > count) return -1; @@ -1030,11 +962,8 @@ static SSIZE_T freerdp_bitmap_compress_16(const void* srcData, UINT32 width, UIN fill_count = 0; - if (mix_count > 3 && - mix_count >= fill_count && - mix_count >= bicolor_count && - mix_count >= color_count && - mix_count >= fom_count) + if (mix_count > 3 && mix_count >= fill_count && mix_count >= bicolor_count && + mix_count >= color_count && mix_count >= fom_count) { if (mix_count > count) return -1; @@ -1047,11 +976,8 @@ static SSIZE_T freerdp_bitmap_compress_16(const void* srcData, UINT32 width, UIN mix_count = 0; - if (fom_count > 3 && - fom_count >= fill_count && - fom_count >= color_count && - fom_count >= mix_count && - fom_count >= bicolor_count) + if (fom_count > 3 && fom_count >= fill_count && fom_count >= color_count && + fom_count >= mix_count && fom_count >= bicolor_count) { if (fom_count > count) return -1; @@ -1074,11 +1000,8 @@ static SSIZE_T freerdp_bitmap_compress_16(const void* srcData, UINT32 width, UIN Stream_SetPosition(temp_s, 0); - if (fill_count > 3 && - fill_count >= color_count && - fill_count >= bicolor_count && - fill_count >= mix_count && - fill_count >= fom_count) + if (fill_count > 3 && fill_count >= color_count && fill_count >= bicolor_count && + fill_count >= mix_count && fill_count >= fom_count) { if (fill_count > count) return -1; @@ -1087,11 +1010,8 @@ static SSIZE_T freerdp_bitmap_compress_16(const void* srcData, UINT32 width, UIN OUT_COPY_COUNT2(count, s, temp_s); OUT_FILL_COUNT2(fill_count, s); } - else if (mix_count > 3 && - mix_count >= color_count && - mix_count >= bicolor_count && - mix_count >= fill_count && - mix_count >= fom_count) + else if (mix_count > 3 && mix_count >= color_count && mix_count >= bicolor_count && + mix_count >= fill_count && mix_count >= fom_count) { if (mix_count > count) return -1; @@ -1100,11 +1020,8 @@ static SSIZE_T freerdp_bitmap_compress_16(const void* srcData, UINT32 width, UIN OUT_COPY_COUNT2(count, s, temp_s); OUT_MIX_COUNT2(mix_count, s); } - else if (color_count > 3 && - color_count >= mix_count && - color_count >= bicolor_count && - color_count >= fill_count && - color_count >= fom_count) + else if (color_count > 3 && color_count >= mix_count && color_count >= bicolor_count && + color_count >= fill_count && color_count >= fom_count) { if (color_count > count) return -1; @@ -1113,11 +1030,8 @@ static SSIZE_T freerdp_bitmap_compress_16(const void* srcData, UINT32 width, UIN OUT_COPY_COUNT2(count, s, temp_s); OUT_COLOR_COUNT2(color_count, s, last_pixel); } - else if (bicolor_count > 3 && - bicolor_count >= mix_count && - bicolor_count >= color_count && - bicolor_count >= fill_count && - bicolor_count >= fom_count) + else if (bicolor_count > 3 && bicolor_count >= mix_count && bicolor_count >= color_count && + bicolor_count >= fill_count && bicolor_count >= fom_count) { if ((bicolor_count % 2) != 0) bicolor_count--; @@ -1136,11 +1050,8 @@ static SSIZE_T freerdp_bitmap_compress_16(const void* srcData, UINT32 width, UIN OUT_COPY_COUNT2(count, s, temp_s); OUT_BICOLOR_COUNT2(bicolor_count, s, bicolor1, bicolor2); } - else if (fom_count > 3 && - fom_count >= mix_count && - fom_count >= color_count && - fom_count >= fill_count && - fom_count >= bicolor_count) + else if (fom_count > 3 && fom_count >= mix_count && fom_count >= color_count && + fom_count >= fill_count && fom_count >= bicolor_count) { if (fom_count > count) return -1; @@ -1157,8 +1068,9 @@ static SSIZE_T freerdp_bitmap_compress_16(const void* srcData, UINT32 width, UIN return lines_sent; } -SSIZE_T freerdp_bitmap_compress(const void* srcData, UINT32 width, UINT32 height, - wStream* s, UINT32 bpp, UINT32 byte_limit, UINT32 start_line, wStream* temp_s, UINT32 e) +SSIZE_T freerdp_bitmap_compress(const void* srcData, UINT32 width, UINT32 height, wStream* s, + UINT32 bpp, UINT32 byte_limit, UINT32 start_line, wStream* temp_s, + UINT32 e) { Stream_SetPosition(temp_s, 0); @@ -1166,12 +1078,12 @@ SSIZE_T freerdp_bitmap_compress(const void* srcData, UINT32 width, UINT32 height { case 15: case 16: - return freerdp_bitmap_compress_16(srcData, width, height, s, bpp, - byte_limit, start_line, temp_s, e); + return freerdp_bitmap_compress_16(srcData, width, height, s, bpp, byte_limit, + start_line, temp_s, e); case 24: - return freerdp_bitmap_compress_24(srcData, width, height, s, - byte_limit, start_line, temp_s, e); + return freerdp_bitmap_compress_24(srcData, width, height, s, byte_limit, start_line, + temp_s, e); default: return -1; diff --git a/libfreerdp/codec/clear.c b/libfreerdp/codec/clear.c index 6747682bf..5be6cb12f 100644 --- a/libfreerdp/codec/clear.c +++ b/libfreerdp/codec/clear.c @@ -33,9 +33,9 @@ #define TAG FREERDP_TAG("codec.clear") -#define CLEARCODEC_FLAG_GLYPH_INDEX 0x01 -#define CLEARCODEC_FLAG_GLYPH_HIT 0x02 -#define CLEARCODEC_FLAG_CACHE_RESET 0x04 +#define CLEARCODEC_FLAG_GLYPH_INDEX 0x01 +#define CLEARCODEC_FLAG_GLYPH_HIT 0x02 +#define CLEARCODEC_FLAG_CACHE_RESET 0x04 #define CLEARCODEC_VBAR_SIZE 32768 #define CLEARCODEC_VBAR_SHORT_SIZE 16384 @@ -73,35 +73,23 @@ struct _CLEAR_CONTEXT CLEAR_VBAR_ENTRY ShortVBarStorage[CLEARCODEC_VBAR_SHORT_SIZE]; }; -static const UINT32 CLEAR_LOG2_FLOOR[256] = -{ - 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 +static const UINT32 CLEAR_LOG2_FLOOR[256] = { + 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }; -static const BYTE CLEAR_8BIT_MASKS[9] = -{ - 0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF -}; +static const BYTE CLEAR_8BIT_MASKS[9] = { 0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF }; -static BOOL convert_color(BYTE* dst, UINT32 nDstStep, UINT32 DstFormat, - UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, - const BYTE* src, UINT32 nSrcStep, UINT32 SrcFormat, - UINT32 nDstWidth, UINT32 nDstHeight, const gdiPalette* palette) +static BOOL convert_color(BYTE* dst, UINT32 nDstStep, UINT32 DstFormat, UINT32 nXDst, UINT32 nYDst, + UINT32 nWidth, UINT32 nHeight, const BYTE* src, UINT32 nSrcStep, + UINT32 SrcFormat, UINT32 nDstWidth, UINT32 nDstHeight, + const gdiPalette* palette) { if (nWidth + nXDst > nDstWidth) nWidth = nDstWidth - nXDst; @@ -109,37 +97,34 @@ static BOOL convert_color(BYTE* dst, UINT32 nDstStep, UINT32 DstFormat, if (nHeight + nYDst > nDstHeight) nHeight = nDstHeight - nYDst; - return freerdp_image_copy(dst, DstFormat, nDstStep, nXDst, nYDst, nWidth, nHeight, - src, SrcFormat, nSrcStep, 0, 0, palette, 0); + return freerdp_image_copy(dst, DstFormat, nDstStep, nXDst, nYDst, nWidth, nHeight, src, + SrcFormat, nSrcStep, 0, 0, palette, 0); } -static BOOL clear_decompress_nscodec(NSC_CONTEXT* nsc, UINT32 width, - UINT32 height, - wStream* s, UINT32 bitmapDataByteCount, - BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, - UINT32 nXDstRel, UINT32 nYDstRel) +static BOOL clear_decompress_nscodec(NSC_CONTEXT* nsc, UINT32 width, UINT32 height, wStream* s, + UINT32 bitmapDataByteCount, BYTE* pDstData, UINT32 DstFormat, + UINT32 nDstStep, UINT32 nXDstRel, UINT32 nYDstRel) { BOOL rc; if (Stream_GetRemainingLength(s) < bitmapDataByteCount) { - WLog_ERR(TAG, "stream short %"PRIuz" [%"PRIu32" expected]", Stream_GetRemainingLength(s), - bitmapDataByteCount); + WLog_ERR(TAG, "stream short %" PRIuz " [%" PRIu32 " expected]", + Stream_GetRemainingLength(s), bitmapDataByteCount); return FALSE; } - rc = nsc_process_message(nsc, 32, width, height, Stream_Pointer(s), - bitmapDataByteCount, pDstData, DstFormat, - nDstStep, nXDstRel, nYDstRel, width, height, FREERDP_FLIP_NONE); + rc = nsc_process_message(nsc, 32, width, height, Stream_Pointer(s), bitmapDataByteCount, + pDstData, DstFormat, nDstStep, nXDstRel, nYDstRel, width, height, + FREERDP_FLIP_NONE); Stream_Seek(s, bitmapDataByteCount); return rc; } -static BOOL clear_decompress_subcode_rlex(wStream* s, - UINT32 bitmapDataByteCount, - UINT32 width, UINT32 height, - BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, - UINT32 nXDstRel, UINT32 nYDstRel, UINT32 nDstWidth, UINT32 nDstHeight) +static BOOL clear_decompress_subcode_rlex(wStream* s, UINT32 bitmapDataByteCount, UINT32 width, + UINT32 height, BYTE* pDstData, UINT32 DstFormat, + UINT32 nDstStep, UINT32 nXDstRel, UINT32 nYDstRel, + UINT32 nDstWidth, UINT32 nDstHeight) { UINT32 x = 0, y = 0; UINT32 i; @@ -156,8 +141,8 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, if (Stream_GetRemainingLength(s) < bitmapDataByteCount) { - WLog_ERR(TAG, "stream short %"PRIuz" [%"PRIu32" expected]", Stream_GetRemainingLength(s), - bitmapDataByteCount); + WLog_ERR(TAG, "stream short %" PRIuz " [%" PRIu32 " expected]", + Stream_GetRemainingLength(s), bitmapDataByteCount); return FALSE; } @@ -166,7 +151,7 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, if ((paletteCount > 127) || (paletteCount < 1)) { - WLog_ERR(TAG, "paletteCount %"PRIu8"", paletteCount); + WLog_ERR(TAG, "paletteCount %" PRIu8 "", paletteCount); return FALSE; } @@ -191,7 +176,7 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, if (Stream_GetRemainingLength(s) < 2) { - WLog_ERR(TAG, "stream short %"PRIuz" [2 expected]", Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "stream short %" PRIuz " [2 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -206,7 +191,7 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, { if (Stream_GetRemainingLength(s) < 2) { - WLog_ERR(TAG, "stream short %"PRIuz" [2 expected]", Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "stream short %" PRIuz " [2 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -217,7 +202,8 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, { if (Stream_GetRemainingLength(s) < 4) { - WLog_ERR(TAG, "stream short %"PRIuz" [4 expected]", Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "stream short %" PRIuz " [4 expected]", + Stream_GetRemainingLength(s)); return FALSE; } @@ -228,13 +214,15 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, if (startIndex >= paletteCount) { - WLog_ERR(TAG, "startIndex %"PRIu8" > paletteCount %"PRIu8"]", startIndex, paletteCount); + WLog_ERR(TAG, "startIndex %" PRIu8 " > paletteCount %" PRIu8 "]", startIndex, + paletteCount); return FALSE; } if (stopIndex >= paletteCount) { - WLog_ERR(TAG, "stopIndex %"PRIu8" > paletteCount %"PRIu8"]", stopIndex, paletteCount); + WLog_ERR(TAG, "stopIndex %" PRIu8 " > paletteCount %" PRIu8 "]", stopIndex, + paletteCount); return FALSE; } @@ -242,7 +230,7 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, if (suiteIndex > 127) { - WLog_ERR(TAG, "suiteIndex %"PRIu8" > 127]", suiteIndex); + WLog_ERR(TAG, "suiteIndex %" PRIu8 " > 127]", suiteIndex); return FALSE; } @@ -250,16 +238,17 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, if ((pixelIndex + runLengthFactor) > pixelCount) { - WLog_ERR(TAG, "pixelIndex %"PRIu32" + runLengthFactor %"PRIu32" > pixelCount %"PRIu32"", - pixelIndex, runLengthFactor, - pixelCount); + WLog_ERR(TAG, + "pixelIndex %" PRIu32 " + runLengthFactor %" PRIu32 " > pixelCount %" PRIu32 + "", + pixelIndex, runLengthFactor, pixelCount); return FALSE; } for (i = 0; i < runLengthFactor; i++) { - BYTE* pTmpData = &pDstData[(nXDstRel + x) * GetBytesPerPixel(DstFormat) + - (nYDstRel + y) * nDstStep]; + BYTE* pTmpData = + &pDstData[(nXDstRel + x) * GetBytesPerPixel(DstFormat) + (nYDstRel + y) * nDstStep]; if ((nXDstRel + x < nDstWidth) && (nYDstRel + y < nDstHeight)) WriteColor(pTmpData, DstFormat, color); @@ -275,21 +264,21 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, if ((pixelIndex + (suiteDepth + 1)) > pixelCount) { - WLog_ERR(TAG, "pixelIndex %"PRIu32" + suiteDepth %"PRIu8" + 1 > pixelCount %"PRIu32"", - pixelIndex, suiteDepth, - pixelCount); + WLog_ERR(TAG, + "pixelIndex %" PRIu32 " + suiteDepth %" PRIu8 " + 1 > pixelCount %" PRIu32 "", + pixelIndex, suiteDepth, pixelCount); return FALSE; } for (i = 0; i <= suiteDepth; i++) { - BYTE* pTmpData = &pDstData[(nXDstRel + x) * GetBytesPerPixel(DstFormat) + - (nYDstRel + y) * nDstStep]; + BYTE* pTmpData = + &pDstData[(nXDstRel + x) * GetBytesPerPixel(DstFormat) + (nYDstRel + y) * nDstStep]; UINT32 color = palette[suiteIndex]; if (suiteIndex > 127) { - WLog_ERR(TAG, "suiteIndex %"PRIu8" > 127", suiteIndex); + WLog_ERR(TAG, "suiteIndex %" PRIu8 " > 127", suiteIndex); return FALSE; } @@ -310,7 +299,7 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, if (pixelIndex != pixelCount) { - WLog_ERR(TAG, "pixelIndex %"PRIu32" != pixelCount %"PRIu32"", pixelIndex, pixelCount); + WLog_ERR(TAG, "pixelIndex %" PRIu32 " != pixelCount %" PRIu32 "", pixelIndex, pixelCount); return FALSE; } @@ -328,12 +317,11 @@ static BOOL clear_resize_buffer(CLEAR_CONTEXT* clear, UINT32 width, UINT32 heigh if (size > clear->TempSize) { - BYTE* tmp = (BYTE*) realloc(clear->TempBuffer, size); + BYTE* tmp = (BYTE*)realloc(clear->TempBuffer, size); if (!tmp) { - WLog_ERR(TAG, "clear->TempBuffer realloc failed for %"PRIu32" bytes", - size); + WLog_ERR(TAG, "clear->TempBuffer realloc failed for %" PRIu32 " bytes", size); return FALSE; } @@ -344,14 +332,11 @@ static BOOL clear_resize_buffer(CLEAR_CONTEXT* clear, UINT32 width, UINT32 heigh return TRUE; } -static BOOL clear_decompress_residual_data(CLEAR_CONTEXT* clear, - wStream* s, - UINT32 residualByteCount, - UINT32 nWidth, UINT32 nHeight, - BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, - UINT32 nXDst, UINT32 nYDst, - UINT32 nDstWidth, UINT32 nDstHeight, - const gdiPalette* palette) +static BOOL clear_decompress_residual_data(CLEAR_CONTEXT* clear, wStream* s, + UINT32 residualByteCount, UINT32 nWidth, UINT32 nHeight, + BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, + UINT32 nXDst, UINT32 nYDst, UINT32 nDstWidth, + UINT32 nDstHeight, const gdiPalette* palette) { UINT32 i; UINT32 nSrcStep; @@ -362,8 +347,8 @@ static BOOL clear_decompress_residual_data(CLEAR_CONTEXT* clear, if (Stream_GetRemainingLength(s) < residualByteCount) { - WLog_ERR(TAG, "stream short %"PRIuz" [%"PRIu32" expected]", Stream_GetRemainingLength(s), - residualByteCount); + WLog_ERR(TAG, "stream short %" PRIuz " [%" PRIu32 " expected]", + Stream_GetRemainingLength(s), residualByteCount); return FALSE; } @@ -384,7 +369,7 @@ static BOOL clear_decompress_residual_data(CLEAR_CONTEXT* clear, if (Stream_GetRemainingLength(s) < 4) { - WLog_ERR(TAG, "stream short %"PRIuz" [4 expected]", Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "stream short %" PRIuz " [4 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -399,7 +384,7 @@ static BOOL clear_decompress_residual_data(CLEAR_CONTEXT* clear, { if (Stream_GetRemainingLength(s) < 2) { - WLog_ERR(TAG, "stream short %"PRIuz" [2 expected]", Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "stream short %" PRIuz " [2 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -410,7 +395,8 @@ static BOOL clear_decompress_residual_data(CLEAR_CONTEXT* clear, { if (Stream_GetRemainingLength(s) < 4) { - WLog_ERR(TAG, "stream short %"PRIuz" [4 expected]", Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "stream short %" PRIuz " [4 expected]", + Stream_GetRemainingLength(s)); return FALSE; } @@ -421,9 +407,10 @@ static BOOL clear_decompress_residual_data(CLEAR_CONTEXT* clear, if ((pixelIndex + runLengthFactor) > pixelCount) { - WLog_ERR(TAG, "pixelIndex %"PRIu32" + runLengthFactor %"PRIu32" > pixelCount %"PRIu32"", - pixelIndex, runLengthFactor, - pixelCount); + WLog_ERR(TAG, + "pixelIndex %" PRIu32 " + runLengthFactor %" PRIu32 " > pixelCount %" PRIu32 + "", + pixelIndex, runLengthFactor, pixelCount); return FALSE; } @@ -440,21 +427,20 @@ static BOOL clear_decompress_residual_data(CLEAR_CONTEXT* clear, if (pixelIndex != pixelCount) { - WLog_ERR(TAG, "pixelIndex %"PRIu32" != pixelCount %"PRIu32"", pixelIndex, pixelCount); + WLog_ERR(TAG, "pixelIndex %" PRIu32 " != pixelCount %" PRIu32 "", pixelIndex, pixelCount); return FALSE; } - return convert_color(pDstData, nDstStep, DstFormat, - nXDst, nYDst, nWidth, nHeight, - clear->TempBuffer, nSrcStep, clear->format, - nDstWidth, nDstHeight, palette); + return convert_color(pDstData, nDstStep, DstFormat, nXDst, nYDst, nWidth, nHeight, + clear->TempBuffer, nSrcStep, clear->format, nDstWidth, nDstHeight, + palette); } static BOOL clear_decompress_subcodecs_data(CLEAR_CONTEXT* clear, wStream* s, - UINT32 subcodecByteCount, UINT32 nWidth, UINT32 nHeight, - BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, - UINT32 nXDst, UINT32 nYDst, UINT32 nDstWidth, UINT32 nDstHeight, - const gdiPalette* palette) + UINT32 subcodecByteCount, UINT32 nWidth, UINT32 nHeight, + BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, + UINT32 nXDst, UINT32 nYDst, UINT32 nDstWidth, + UINT32 nDstHeight, const gdiPalette* palette) { UINT16 xStart; UINT16 yStart; @@ -466,8 +452,8 @@ static BOOL clear_decompress_subcodecs_data(CLEAR_CONTEXT* clear, wStream* s, if (Stream_GetRemainingLength(s) < subcodecByteCount) { - WLog_ERR(TAG, "stream short %"PRIuz" [%"PRIu32" expected]", Stream_GetRemainingLength(s), - subcodecByteCount); + WLog_ERR(TAG, "stream short %" PRIuz " [%" PRIu32 " expected]", + Stream_GetRemainingLength(s), subcodecByteCount); return FALSE; } @@ -480,7 +466,7 @@ static BOOL clear_decompress_subcodecs_data(CLEAR_CONTEXT* clear, wStream* s, if (Stream_GetRemainingLength(s) < 13) { - WLog_ERR(TAG, "stream short %"PRIuz" [13 expected]", Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "stream short %" PRIuz " [13 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -494,8 +480,8 @@ static BOOL clear_decompress_subcodecs_data(CLEAR_CONTEXT* clear, wStream* s, if (Stream_GetRemainingLength(s) < bitmapDataByteCount) { - WLog_ERR(TAG, "stream short %"PRIuz" [%"PRIu32" expected]", Stream_GetRemainingLength(s), - bitmapDataByteCount); + WLog_ERR(TAG, "stream short %" PRIuz " [%" PRIu32 " expected]", + Stream_GetRemainingLength(s), bitmapDataByteCount); return FALSE; } @@ -504,13 +490,13 @@ static BOOL clear_decompress_subcodecs_data(CLEAR_CONTEXT* clear, wStream* s, if (width > nWidth) { - WLog_ERR(TAG, "width %"PRIu16" > nWidth %"PRIu32"", width, nWidth); + WLog_ERR(TAG, "width %" PRIu16 " > nWidth %" PRIu32 "", width, nWidth); return FALSE; } if (height > nHeight) { - WLog_ERR(TAG, "height %"PRIu16" > nHeight %"PRIu32"", height, nHeight); + WLog_ERR(TAG, "height %" PRIu16 " > nHeight %" PRIu32 "", height, nHeight); return FALSE; } @@ -520,50 +506,43 @@ static BOOL clear_decompress_subcodecs_data(CLEAR_CONTEXT* clear, wStream* s, switch (subcodecId) { case 0: /* Uncompressed */ + { + UINT32 nSrcStep = width * GetBytesPerPixel(PIXEL_FORMAT_BGR24); + UINT32 nSrcSize = nSrcStep * height; + + if (bitmapDataByteCount != nSrcSize) { - UINT32 nSrcStep = width * GetBytesPerPixel(PIXEL_FORMAT_BGR24); - UINT32 nSrcSize = nSrcStep * height; - - if (bitmapDataByteCount != nSrcSize) - { - WLog_ERR(TAG, "bitmapDataByteCount %"PRIu32" != nSrcSize %"PRIu32"", bitmapDataByteCount, - nSrcSize); - return FALSE; - } - - if (!convert_color(pDstData, nDstStep, DstFormat, - nXDstRel, nYDstRel, width, height, - Stream_Pointer(s), nSrcStep, - PIXEL_FORMAT_BGR24, - nDstWidth, nDstHeight, palette)) - return FALSE; - - Stream_Seek(s, bitmapDataByteCount); + WLog_ERR(TAG, "bitmapDataByteCount %" PRIu32 " != nSrcSize %" PRIu32 "", + bitmapDataByteCount, nSrcSize); + return FALSE; } - break; + + if (!convert_color(pDstData, nDstStep, DstFormat, nXDstRel, nYDstRel, width, height, + Stream_Pointer(s), nSrcStep, PIXEL_FORMAT_BGR24, nDstWidth, + nDstHeight, palette)) + return FALSE; + + Stream_Seek(s, bitmapDataByteCount); + } + break; case 1: /* NSCodec */ - if (!clear_decompress_nscodec(clear->nsc, width, height, - s, bitmapDataByteCount, - pDstData, DstFormat, nDstStep, - nXDstRel, nYDstRel)) + if (!clear_decompress_nscodec(clear->nsc, width, height, s, bitmapDataByteCount, + pDstData, DstFormat, nDstStep, nXDstRel, nYDstRel)) return FALSE; break; case 2: /* CLEARCODEC_SUBCODEC_RLEX */ - if (!clear_decompress_subcode_rlex(s, - bitmapDataByteCount, - width, height, - pDstData, DstFormat, nDstStep, - nXDstRel, nYDstRel, + if (!clear_decompress_subcode_rlex(s, bitmapDataByteCount, width, height, pDstData, + DstFormat, nDstStep, nXDstRel, nYDstRel, nDstWidth, nDstHeight)) return FALSE; break; default: - WLog_ERR(TAG, "Unknown subcodec ID %"PRIu8"", subcodecId); + WLog_ERR(TAG, "Unknown subcodec ID %" PRIu8 "", subcodecId); return FALSE; } @@ -582,12 +561,11 @@ static BOOL resize_vbar_entry(CLEAR_CONTEXT* clear, CLEAR_VBAR_ENTRY* vBarEntry) const UINT32 diffSize = (vBarEntry->count - vBarEntry->size) * bpp; BYTE* tmp; vBarEntry->size = vBarEntry->count; - tmp = (BYTE*) realloc(vBarEntry->pixels, - vBarEntry->count * bpp); + tmp = (BYTE*)realloc(vBarEntry->pixels, vBarEntry->count * bpp); if (!tmp) { - WLog_ERR(TAG, "vBarEntry->pixels realloc %"PRIu32" failed", vBarEntry->count * bpp); + WLog_ERR(TAG, "vBarEntry->pixels realloc %" PRIu32 " failed", vBarEntry->count * bpp); return FALSE; } @@ -597,7 +575,7 @@ static BOOL resize_vbar_entry(CLEAR_CONTEXT* clear, CLEAR_VBAR_ENTRY* vBarEntry) if (!vBarEntry->pixels && vBarEntry->size) { - WLog_ERR(TAG, "vBarEntry->pixels is NULL but vBarEntry->size is %"PRIu32"", + WLog_ERR(TAG, "vBarEntry->pixels is NULL but vBarEntry->size is %" PRIu32 "", vBarEntry->size); return FALSE; } @@ -605,11 +583,10 @@ static BOOL resize_vbar_entry(CLEAR_CONTEXT* clear, CLEAR_VBAR_ENTRY* vBarEntry) return TRUE; } -static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, - wStream* s, UINT32 bandsByteCount, - UINT32 nWidth, UINT32 nHeight, - BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, - UINT32 nXDst, UINT32 nYDst) +static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, wStream* s, UINT32 bandsByteCount, + UINT32 nWidth, UINT32 nHeight, BYTE* pDstData, + UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, + UINT32 nYDst) { UINT32 i, y; UINT32 count; @@ -619,7 +596,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (Stream_GetRemainingLength(s) < bandsByteCount) { - WLog_ERR(TAG, "stream short %"PRIuz" [11 expected]", Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "stream short %" PRIuz " [11 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -642,7 +619,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (Stream_GetRemainingLength(s) < 11) { - WLog_ERR(TAG, "stream short %"PRIuz" [11 expected]", Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "stream short %" PRIuz " [11 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -658,13 +635,13 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (xEnd < xStart) { - WLog_ERR(TAG, "xEnd %"PRIu16" < xStart %"PRIu16"", xEnd, xStart); + WLog_ERR(TAG, "xEnd %" PRIu16 " < xStart %" PRIu16 "", xEnd, xStart); return FALSE; } if (yEnd < yStart) { - WLog_ERR(TAG, "yEnd %"PRIu16" < yStart %"PRIu16"", yEnd, yStart); + WLog_ERR(TAG, "yEnd %" PRIu16 " < yStart %" PRIu16 "", yEnd, yStart); return FALSE; } @@ -680,7 +657,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (Stream_GetRemainingLength(s) < 2) { - WLog_ERR(TAG, "stream short %"PRIuz" [2 expected]", Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "stream short %" PRIuz " [2 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -690,7 +667,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (vBarHeight > 52) { - WLog_ERR(TAG, "vBarHeight (%"PRIu32") > 52", vBarHeight); + WLog_ERR(TAG, "vBarHeight (%" PRIu32 ") > 52", vBarHeight); return FALSE; } @@ -701,13 +678,14 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (!vBarShortEntry) { - WLog_ERR(TAG, "missing vBarShortEntry %"PRIu16"", vBarIndex); + WLog_ERR(TAG, "missing vBarShortEntry %" PRIu16 "", vBarIndex); return FALSE; } if (Stream_GetRemainingLength(s) < 1) { - WLog_ERR(TAG, "stream short %"PRIuz" [1 expected]", Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "stream short %" PRIuz " [1 expected]", + Stream_GetRemainingLength(s)); return FALSE; } @@ -723,7 +701,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (vBarYOff < vBarYOn) { - WLog_ERR(TAG, "vBarYOff %"PRIu16" < vBarYOn %"PRIu16"", vBarYOff, vBarYOn); + WLog_ERR(TAG, "vBarYOff %" PRIu16 " < vBarYOn %" PRIu16 "", vBarYOff, vBarYOn); return FALSE; } @@ -731,21 +709,22 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (vBarShortPixelCount > 52) { - WLog_ERR(TAG, "vBarShortPixelCount %"PRIu32" > 52", vBarShortPixelCount); + WLog_ERR(TAG, "vBarShortPixelCount %" PRIu32 " > 52", vBarShortPixelCount); return FALSE; } if (Stream_GetRemainingLength(s) < (vBarShortPixelCount * 3)) { - WLog_ERR(TAG, "stream short %"PRIuz" [%"PRIu32" expected]", Stream_GetRemainingLength(s), - (vBarShortPixelCount * 3)); + WLog_ERR(TAG, "stream short %" PRIuz " [%" PRIu32 " expected]", + Stream_GetRemainingLength(s), (vBarShortPixelCount * 3)); return FALSE; } if (clear->ShortVBarStorageCursor >= CLEARCODEC_VBAR_SHORT_SIZE) { WLog_ERR(TAG, - "clear->ShortVBarStorageCursor %"PRIu32" >= CLEARCODEC_VBAR_SHORT_SIZE (%"PRIu32")", + "clear->ShortVBarStorageCursor %" PRIu32 + " >= CLEARCODEC_VBAR_SHORT_SIZE (%" PRIu32 ")", clear->ShortVBarStorageCursor, CLEARCODEC_VBAR_SHORT_SIZE); return FALSE; } @@ -759,8 +738,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, for (y = 0; y < vBarShortPixelCount; y++) { BYTE r, g, b; - BYTE* dstBuffer = - &vBarShortEntry->pixels[y * GetBytesPerPixel(clear->format)]; + BYTE* dstBuffer = &vBarShortEntry->pixels[y * GetBytesPerPixel(clear->format)]; UINT32 color; Stream_Read_UINT8(s, b); Stream_Read_UINT8(s, g); @@ -784,7 +762,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, /* If the cache was reset we need to fill in some dummy data. */ if (vBarEntry->size == 0) { - WLog_WARN(TAG, "Empty cache index %"PRIu16", filling dummy data", vBarIndex); + WLog_WARN(TAG, "Empty cache index %" PRIu16 ", filling dummy data", vBarIndex); vBarEntry->count = vBarHeight; if (!resize_vbar_entry(clear, vBarEntry)) @@ -793,7 +771,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, } else { - WLog_ERR(TAG, "invalid vBarHeader 0x%04"PRIX16"", vBarHeader); + WLog_ERR(TAG, "invalid vBarHeader 0x%04" PRIX16 "", vBarHeader); return FALSE; /* invalid vBarHeader */ } @@ -805,9 +783,10 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (clear->VBarStorageCursor >= CLEARCODEC_VBAR_SIZE) { - WLog_ERR(TAG, "clear->VBarStorageCursor %"PRIu32" >= CLEARCODEC_VBAR_SIZE %"PRIu32"", - clear->VBarStorageCursor, - CLEARCODEC_VBAR_SIZE); + WLog_ERR(TAG, + "clear->VBarStorageCursor %" PRIu32 " >= CLEARCODEC_VBAR_SIZE %" PRIu32 + "", + clear->VBarStorageCursor, CLEARCODEC_VBAR_SIZE); return FALSE; } @@ -842,14 +821,14 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if ((y + count) > vBarPixelCount) count = (vBarPixelCount > y) ? (vBarPixelCount - y) : 0; - pSrcPixel = &vBarShortEntry->pixels[(y - vBarYOn) * GetBytesPerPixel( - clear->format)]; + pSrcPixel = + &vBarShortEntry->pixels[(y - vBarYOn) * GetBytesPerPixel(clear->format)]; for (x = 0; x < count; x++) { UINT32 color; - color = ReadColor(&pSrcPixel[x * GetBytesPerPixel(clear->format)], - clear->format); + color = + ReadColor(&pSrcPixel[x * GetBytesPerPixel(clear->format)], clear->format); if (!WriteColor(dstBuffer, clear->format, color)) return FALSE; @@ -870,14 +849,13 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, } vBarEntry->count = vBarPixelCount; - clear->VBarStorageCursor = (clear->VBarStorageCursor + 1) % - CLEARCODEC_VBAR_SIZE; + clear->VBarStorageCursor = (clear->VBarStorageCursor + 1) % CLEARCODEC_VBAR_SIZE; } if (vBarEntry->count != vBarHeight) { - WLog_ERR(TAG, "vBarEntry->count %"PRIu32" != vBarHeight %"PRIu32"", vBarEntry->count, - vBarHeight); + WLog_ERR(TAG, "vBarEntry->count %" PRIu32 " != vBarHeight %" PRIu32 "", + vBarEntry->count, vBarHeight); vBarEntry->count = vBarHeight; if (!resize_vbar_entry(clear, vBarEntry)) @@ -898,10 +876,9 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, for (y = 0; y < count; y++) { BYTE* pDstPixel8 = &pDstData[((nYDstRel + y) * nDstStep) + - ((nXDstRel + i) * GetBytesPerPixel(DstFormat))]; + ((nXDstRel + i) * GetBytesPerPixel(DstFormat))]; UINT32 color = ReadColor(pSrcPixel, clear->format); - color = FreeRDPConvertColor(color, clear->format, - DstFormat, NULL); + color = FreeRDPConvertColor(color, clear->format, DstFormat, NULL); if (!WriteColor(pDstPixel8, DstFormat, color)) return FALSE; @@ -915,12 +892,10 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, return TRUE; } -static BOOL clear_decompress_glyph_data(CLEAR_CONTEXT* clear, - wStream* s, UINT32 glyphFlags, - UINT32 nWidth, UINT32 nHeight, - BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, - UINT32 nXDst, UINT32 nYDst, - UINT32 nDstWidth, UINT32 nDstHeight, +static BOOL clear_decompress_glyph_data(CLEAR_CONTEXT* clear, wStream* s, UINT32 glyphFlags, + UINT32 nWidth, UINT32 nHeight, BYTE* pDstData, + UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, + UINT32 nYDst, UINT32 nDstWidth, UINT32 nDstHeight, const gdiPalette* palette, BYTE** ppGlyphData) { UINT16 glyphIndex = 0; @@ -928,10 +903,9 @@ static BOOL clear_decompress_glyph_data(CLEAR_CONTEXT* clear, if (ppGlyphData) *ppGlyphData = NULL; - if ((glyphFlags & CLEARCODEC_FLAG_GLYPH_HIT) && - !(glyphFlags & CLEARCODEC_FLAG_GLYPH_INDEX)) + if ((glyphFlags & CLEARCODEC_FLAG_GLYPH_HIT) && !(glyphFlags & CLEARCODEC_FLAG_GLYPH_INDEX)) { - WLog_ERR(TAG, "Invalid glyph flags %08"PRIX32"", glyphFlags); + WLog_ERR(TAG, "Invalid glyph flags %08" PRIX32 "", glyphFlags); return FALSE; } @@ -940,13 +914,13 @@ static BOOL clear_decompress_glyph_data(CLEAR_CONTEXT* clear, if ((nWidth * nHeight) > (1024 * 1024)) { - WLog_ERR(TAG, "glyph too large: %"PRIu32"x%"PRIu32"", nWidth, nHeight); + WLog_ERR(TAG, "glyph too large: %" PRIu32 "x%" PRIu32 "", nWidth, nHeight); return FALSE; } if (Stream_GetRemainingLength(s) < 2) { - WLog_ERR(TAG, "stream short %"PRIuz" [2 expected]", Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "stream short %" PRIuz " [2 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -954,7 +928,7 @@ static BOOL clear_decompress_glyph_data(CLEAR_CONTEXT* clear, if (glyphIndex >= 4000) { - WLog_ERR(TAG, "Invalid glyphIndex %"PRIu16"", glyphIndex); + WLog_ERR(TAG, "Invalid glyphIndex %" PRIu16 "", glyphIndex); return FALSE; } @@ -966,31 +940,29 @@ static BOOL clear_decompress_glyph_data(CLEAR_CONTEXT* clear, if (!glyphEntry) { - WLog_ERR(TAG, "clear->GlyphCache[%"PRIu16"]=NULL", glyphIndex); + WLog_ERR(TAG, "clear->GlyphCache[%" PRIu16 "]=NULL", glyphIndex); return FALSE; } - glyphData = (BYTE*) glyphEntry->pixels; + glyphData = (BYTE*)glyphEntry->pixels; if (!glyphData) { - WLog_ERR(TAG, "clear->GlyphCache[%"PRIu16"]->pixels=NULL", glyphIndex); + WLog_ERR(TAG, "clear->GlyphCache[%" PRIu16 "]->pixels=NULL", glyphIndex); return FALSE; } if ((nWidth * nHeight) > glyphEntry->count) { - WLog_ERR(TAG, "(nWidth %"PRIu32" * nHeight %"PRIu32") > glyphEntry->count %"PRIu32"", nWidth, - nHeight, - glyphEntry->count); + WLog_ERR(TAG, + "(nWidth %" PRIu32 " * nHeight %" PRIu32 ") > glyphEntry->count %" PRIu32 "", + nWidth, nHeight, glyphEntry->count); return FALSE; } nSrcStep = nWidth * GetBytesPerPixel(clear->format); - return convert_color(pDstData, nDstStep, DstFormat, - nXDst, nYDst, nWidth, nHeight, - glyphData, nSrcStep, clear->format, - nDstWidth, nDstHeight, palette); + return convert_color(pDstData, nDstStep, DstFormat, nXDst, nYDst, nWidth, nHeight, + glyphData, nSrcStep, clear->format, nDstWidth, nDstHeight, palette); } if (glyphFlags & CLEARCODEC_FLAG_GLYPH_INDEX) @@ -1006,7 +978,8 @@ static BOOL clear_decompress_glyph_data(CLEAR_CONTEXT* clear, if (!tmp) { - WLog_ERR(TAG, "glyphEntry->pixels realloc %"PRIu32" failed!", glyphEntry->count * bpp); + WLog_ERR(TAG, "glyphEntry->pixels realloc %" PRIu32 " failed!", + glyphEntry->count * bpp); return FALSE; } @@ -1038,11 +1011,10 @@ static INLINE BOOL updateContextFormat(CLEAR_CONTEXT* clear, UINT32 DstFormat) return nsc_context_set_pixel_format(clear->nsc, DstFormat); } -INT32 clear_decompress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, - UINT32 SrcSize, UINT32 nWidth, UINT32 nHeight, - BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, - UINT32 nXDst, UINT32 nYDst, UINT32 nDstWidth, - UINT32 nDstHeight, const gdiPalette* palette) +INT32 clear_decompress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, UINT32 SrcSize, UINT32 nWidth, + UINT32 nHeight, BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, + UINT32 nXDst, UINT32 nYDst, UINT32 nDstWidth, UINT32 nDstHeight, + const gdiPalette* palette) { INT32 rc = -1; BYTE seqNumber; @@ -1071,7 +1043,7 @@ INT32 clear_decompress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, if (Stream_GetRemainingLength(s) < 2) { - WLog_ERR(TAG, "stream short %"PRIuz" [2 expected]", Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "stream short %" PRIuz " [2 expected]", Stream_GetRemainingLength(s)); goto fail; } @@ -1086,9 +1058,10 @@ INT32 clear_decompress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, if (seqNumber != clear->seqNumber) { - WLog_ERR(TAG, "Sequence number unexpected %"PRIu8" - %"PRIu32"", - seqNumber, clear->seqNumber); - WLog_ERR(TAG, "seqNumber %"PRIu8" != clear->seqNumber %"PRIu32"", seqNumber, clear->seqNumber); + WLog_ERR(TAG, "Sequence number unexpected %" PRIu8 " - %" PRIu32 "", seqNumber, + clear->seqNumber); + WLog_ERR(TAG, "seqNumber %" PRIu8 " != clear->seqNumber %" PRIu32 "", seqNumber, + clear->seqNumber); goto fail; } @@ -1100,10 +1073,9 @@ INT32 clear_decompress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, clear->ShortVBarStorageCursor = 0; } - if (!clear_decompress_glyph_data(clear, s, glyphFlags, nWidth, - nHeight, pDstData, DstFormat, - nDstStep, nXDst, nYDst, - nDstWidth, nDstHeight, palette, &glyphData)) + if (!clear_decompress_glyph_data(clear, s, glyphFlags, nWidth, nHeight, pDstData, DstFormat, + nDstStep, nXDst, nYDst, nDstWidth, nDstHeight, palette, + &glyphData)) { WLog_ERR(TAG, "clear_decompress_glyph_data failed!"); goto fail; @@ -1117,7 +1089,7 @@ INT32 clear_decompress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, if ((glyphFlags & mask) == mask) goto finish; - WLog_ERR(TAG, "stream short %"PRIuz" [12 expected]", Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "stream short %" PRIuz " [12 expected]", Stream_GetRemainingLength(s)); goto fail; } @@ -1127,9 +1099,9 @@ INT32 clear_decompress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, if (residualByteCount > 0) { - if (!clear_decompress_residual_data(clear, s, residualByteCount, nWidth, - nHeight, pDstData, DstFormat, nDstStep, nXDst, nYDst, - nDstWidth, nDstHeight, palette)) + if (!clear_decompress_residual_data(clear, s, residualByteCount, nWidth, nHeight, pDstData, + DstFormat, nDstStep, nXDst, nYDst, nDstWidth, + nDstHeight, palette)) { WLog_ERR(TAG, "clear_decompress_residual_data failed!"); goto fail; @@ -1138,8 +1110,8 @@ INT32 clear_decompress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, if (bandsByteCount > 0) { - if (!clear_decompress_bands_data(clear, s, bandsByteCount, nWidth, nHeight, - pDstData, DstFormat, nDstStep, nXDst, nYDst)) + if (!clear_decompress_bands_data(clear, s, bandsByteCount, nWidth, nHeight, pDstData, + DstFormat, nDstStep, nXDst, nYDst)) { WLog_ERR(TAG, "clear_decompress_bands_data failed!"); goto fail; @@ -1148,10 +1120,9 @@ INT32 clear_decompress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, if (subcodecByteCount > 0) { - if (!clear_decompress_subcodecs_data(clear, s, subcodecByteCount, nWidth, - nHeight, pDstData, DstFormat, - nDstStep, nXDst, nYDst, - nDstWidth, nDstHeight, palette)) + if (!clear_decompress_subcodecs_data(clear, s, subcodecByteCount, nWidth, nHeight, pDstData, + DstFormat, nDstStep, nXDst, nYDst, nDstWidth, + nDstHeight, palette)) { WLog_ERR(TAG, "clear_decompress_subcodecs_data failed!"); goto fail; @@ -1160,9 +1131,8 @@ INT32 clear_decompress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, if (glyphData) { - if (!freerdp_image_copy(glyphData, clear->format, 0, 0, 0, nWidth, nHeight, - pDstData, DstFormat, nDstStep, nXDst, nYDst, palette, - FREERDP_FLIP_NONE)) + if (!freerdp_image_copy(glyphData, clear->format, 0, 0, 0, nWidth, nHeight, pDstData, + DstFormat, nDstStep, nXDst, nYDst, palette, FREERDP_FLIP_NONE)) goto fail; } @@ -1173,8 +1143,8 @@ fail: return rc; } -int clear_compress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, UINT32 SrcSize, - BYTE** ppDstData, UINT32* pDstSize) +int clear_compress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, + UINT32* pDstSize) { WLog_ERR(TAG, "TODO: %s not implemented!", __FUNCTION__); return 1; @@ -1190,7 +1160,7 @@ BOOL clear_context_reset(CLEAR_CONTEXT* clear) CLEAR_CONTEXT* clear_context_new(BOOL Compressor) { CLEAR_CONTEXT* clear; - clear = (CLEAR_CONTEXT*) calloc(1, sizeof(CLEAR_CONTEXT)); + clear = (CLEAR_CONTEXT*)calloc(1, sizeof(CLEAR_CONTEXT)); if (!clear) return NULL; diff --git a/libfreerdp/codec/color.c b/libfreerdp/codec/color.c index e002f90e2..3e1beef90 100644 --- a/libfreerdp/codec/color.c +++ b/libfreerdp/codec/color.c @@ -56,7 +56,7 @@ BYTE* freerdp_glyph_convert(UINT32 width, UINT32 height, const BYTE* data) * means of accessing individual pixels in blitting operations */ scanline = (width + 7) / 8; - dstData = (BYTE*) _aligned_malloc(width * height, 16); + dstData = (BYTE*)_aligned_malloc(width * height, 16); if (!dstData) return NULL; @@ -83,11 +83,9 @@ BYTE* freerdp_glyph_convert(UINT32 width, UINT32 height, const BYTE* data) return dstData; } -BOOL freerdp_image_copy_from_monochrome(BYTE* pDstData, UINT32 DstFormat, - UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, - UINT32 nWidth, UINT32 nHeight, - const BYTE* pSrcData, - UINT32 backColor, UINT32 foreColor, +BOOL freerdp_image_copy_from_monochrome(BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, + UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, + const BYTE* pSrcData, UINT32 backColor, UINT32 foreColor, const gdiPalette* palette) { UINT32 x, y; @@ -136,8 +134,7 @@ BOOL freerdp_image_copy_from_monochrome(BYTE* pDstData, UINT32 DstFormat, return TRUE; } -static INLINE UINT32 freerdp_image_inverted_pointer_color(UINT32 x, UINT32 y, - UINT32 format) +static INLINE UINT32 freerdp_image_inverted_pointer_color(UINT32 x, UINT32 y, UINT32 format) { #if 1 /** @@ -156,12 +153,12 @@ static INLINE UINT32 freerdp_image_inverted_pointer_color(UINT32 x, UINT32 y, return FreeRDPGetColor(format, fill, fill, fill, 0xFF); } - /* * DIB color palettes are arrays of RGBQUAD structs with colors in BGRX format. * They are used only by 1, 2, 4, and 8-bit bitmaps. */ -static void fill_gdi_palette_for_icon(const BYTE* colorTable, UINT16 cbColorTable, gdiPalette* palette) +static void fill_gdi_palette_for_icon(const BYTE* colorTable, UINT16 cbColorTable, + gdiPalette* palette) { UINT16 i; palette->format = PIXEL_FORMAT_BGRX32; @@ -192,13 +189,11 @@ static INLINE UINT32 round_up(UINT32 a, UINT32 b) return b * div_ceil(a, b); } -BOOL freerdp_image_copy_from_icon_data( - BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, - UINT32 nXDst, UINT32 nYDst, UINT16 nWidth, UINT16 nHeight, - const BYTE* bitsColor, UINT16 cbBitsColor, - const BYTE* bitsMask, UINT16 cbBitsMask, - const BYTE* colorTable, UINT16 cbColorTable, - UINT32 bpp) +BOOL freerdp_image_copy_from_icon_data(BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, + UINT32 nXDst, UINT32 nYDst, UINT16 nWidth, UINT16 nHeight, + const BYTE* bitsColor, UINT16 cbBitsColor, + const BYTE* bitsMask, UINT16 cbBitsMask, + const BYTE* colorTable, UINT16 cbColorTable, UINT32 bpp) { DWORD format; gdiPalette palette; @@ -247,9 +242,8 @@ BOOL freerdp_image_copy_from_icon_data( } fill_gdi_palette_for_icon(colorTable, cbColorTable, &palette); - if (!freerdp_image_copy(pDstData, DstFormat, nDstStep, nXDst, nYDst, - nWidth, nHeight, bitsColor, format, 0, 0, 0, &palette, - FREERDP_FLIP_VERTICAL)) + if (!freerdp_image_copy(pDstData, DstFormat, nDstStep, nXDst, nYDst, nWidth, nHeight, bitsColor, + format, 0, 0, 0, &palette, FREERDP_FLIP_VERTICAL)) return FALSE; /* apply alpha mask */ @@ -300,7 +294,6 @@ BOOL freerdp_image_copy_from_icon_data( return TRUE; } - /** * Drawing Monochrome Pointers: * http://msdn.microsoft.com/en-us/library/windows/hardware/ff556143/ @@ -309,12 +302,11 @@ BOOL freerdp_image_copy_from_icon_data( * http://msdn.microsoft.com/en-us/library/windows/hardware/ff556138/ */ -BOOL freerdp_image_copy_from_pointer_data( - BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, - UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, - const BYTE* xorMask, UINT32 xorMaskLength, - const BYTE* andMask, UINT32 andMaskLength, - UINT32 xorBpp, const gdiPalette* palette) +BOOL freerdp_image_copy_from_pointer_data(BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, + UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, + const BYTE* xorMask, UINT32 xorMaskLength, + const BYTE* andMask, UINT32 andMaskLength, UINT32 xorBpp, + const gdiPalette* palette) { UINT32 x, y; BOOL vFlip; @@ -364,8 +356,8 @@ BOOL freerdp_image_copy_from_pointer_data( { const BYTE* andBits; const BYTE* xorBits; - BYTE* pDstPixel = &pDstData[((nYDst + y) * nDstStep) + - (nXDst * GetBytesPerPixel(DstFormat))]; + BYTE* pDstPixel = + &pDstData[((nYDst + y) * nDstStep) + (nXDst * GetBytesPerPixel(DstFormat))]; xorBit = andBit = 0x80; if (!vFlip) @@ -405,7 +397,8 @@ BOOL freerdp_image_copy_from_pointer_data( else if (andPixel && !xorPixel) color = FreeRDPGetColor(DstFormat, 0, 0, 0, 0); /* transparent */ else if (andPixel && xorPixel) - color = freerdp_image_inverted_pointer_color(x, y, DstFormat); /* inverted */ + color = + freerdp_image_inverted_pointer_color(x, y, DstFormat); /* inverted */ WriteColor(pDstPixel, DstFormat, color); pDstPixel += GetBytesPerPixel(DstFormat); @@ -418,123 +411,120 @@ BOOL freerdp_image_copy_from_pointer_data( case 16: case 24: case 32: + { + UINT32 xorBytesPerPixel = xorBpp >> 3; + xorStep = nWidth * xorBytesPerPixel; + xorStep += (xorStep % 2); + + if (xorBpp == 8 && !palette) { - UINT32 xorBytesPerPixel = xorBpp >> 3; - xorStep = nWidth * xorBytesPerPixel; - xorStep += (xorStep % 2); + WLog_ERR(TAG, "null palette in conversion from %" PRIu32 " bpp to %" PRIu32 " bpp", + xorBpp, dstBitsPerPixel); + return FALSE; + } - if (xorBpp == 8 && !palette) - { - WLog_ERR(TAG, "null palette in conversion from %"PRIu32" bpp to %"PRIu32" bpp", - xorBpp, dstBitsPerPixel); + if (xorStep * nHeight > xorMaskLength) + return FALSE; + + if (andMask) + { + if (andStep * nHeight > andMaskLength) return FALSE; + } + + for (y = 0; y < nHeight; y++) + { + const BYTE* xorBits; + const BYTE* andBits = NULL; + BYTE* pDstPixel = + &pDstData[((nYDst + y) * nDstStep) + (nXDst * GetBytesPerPixel(DstFormat))]; + andBit = 0x80; + + if (!vFlip) + { + if (andMask) + andBits = &andMask[andStep * y]; + + xorBits = &xorMask[xorStep * y]; + } + else + { + if (andMask) + andBits = &andMask[andStep * (nHeight - y - 1)]; + + xorBits = &xorMask[xorStep * (nHeight - y - 1)]; } - if (xorStep * nHeight > xorMaskLength) - return FALSE; - - if (andMask) + for (x = 0; x < nWidth; x++) { - if (andStep * nHeight > andMaskLength) - return FALSE; - } + UINT32 pixelFormat; + UINT32 color; - for (y = 0; y < nHeight; y++) - { - const BYTE* xorBits; - const BYTE* andBits = NULL; - BYTE* pDstPixel = &pDstData[((nYDst + y) * nDstStep) + - (nXDst * GetBytesPerPixel(DstFormat))]; - andBit = 0x80; - - if (!vFlip) + if (xorBpp == 32) { - if (andMask) - andBits = &andMask[andStep * y]; - - xorBits = &xorMask[xorStep * y]; + pixelFormat = PIXEL_FORMAT_BGRA32; + xorPixel = ReadColor(xorBits, pixelFormat); + } + else if (xorBpp == 16) + { + pixelFormat = PIXEL_FORMAT_RGB15; + xorPixel = ReadColor(xorBits, pixelFormat); + } + else if (xorBpp == 8) + { + pixelFormat = palette->format; + xorPixel = palette->palette[xorBits[0]]; } else { - if (andMask) - andBits = &andMask[andStep * (nHeight - y - 1)]; - - xorBits = &xorMask[xorStep * (nHeight - y - 1)]; + pixelFormat = PIXEL_FORMAT_BGR24; + xorPixel = ReadColor(xorBits, pixelFormat); } - for (x = 0; x < nWidth; x++) + xorPixel = + FreeRDPConvertColor(xorPixel, pixelFormat, PIXEL_FORMAT_ARGB32, palette); + xorBits += xorBytesPerPixel; + andPixel = 0; + + if (andMask) { - UINT32 pixelFormat; - UINT32 color; + andPixel = (*andBits & andBit) ? 1 : 0; - if (xorBpp == 32) + if (!(andBit >>= 1)) { - pixelFormat = PIXEL_FORMAT_BGRA32; - xorPixel = ReadColor(xorBits, pixelFormat); + andBits++; + andBit = 0x80; } - else if (xorBpp == 16) - { - pixelFormat = PIXEL_FORMAT_RGB15; - xorPixel = ReadColor(xorBits, pixelFormat); - } - else if (xorBpp == 8) - { - pixelFormat = palette->format; - xorPixel = palette->palette[xorBits[0]]; - } - else - { - pixelFormat = PIXEL_FORMAT_BGR24; - xorPixel = ReadColor(xorBits, pixelFormat); - } - - xorPixel = FreeRDPConvertColor(xorPixel, - pixelFormat, - PIXEL_FORMAT_ARGB32, - palette); - xorBits += xorBytesPerPixel; - andPixel = 0; - - if (andMask) - { - andPixel = (*andBits & andBit) ? 1 : 0; - - if (!(andBit >>= 1)) - { - andBits++; - andBit = 0x80; - } - } - - if (andPixel) - { - if (xorPixel == 0xFF000000) /* black -> transparent */ - xorPixel = 0x00000000; - else if (xorPixel == 0xFFFFFFFF) /* white -> inverted */ - xorPixel = freerdp_image_inverted_pointer_color(x, y, PIXEL_FORMAT_ARGB32); - } - - color = FreeRDPConvertColor(xorPixel, PIXEL_FORMAT_ARGB32, - DstFormat, palette); - WriteColor(pDstPixel, DstFormat, color); - pDstPixel += GetBytesPerPixel(DstFormat); } - } - return TRUE; + if (andPixel) + { + if (xorPixel == 0xFF000000) /* black -> transparent */ + xorPixel = 0x00000000; + else if (xorPixel == 0xFFFFFFFF) /* white -> inverted */ + xorPixel = + freerdp_image_inverted_pointer_color(x, y, PIXEL_FORMAT_ARGB32); + } + + color = FreeRDPConvertColor(xorPixel, PIXEL_FORMAT_ARGB32, DstFormat, palette); + WriteColor(pDstPixel, DstFormat, color); + pDstPixel += GetBytesPerPixel(DstFormat); + } } + return TRUE; + } + default: - WLog_ERR(TAG, "failed to convert from %"PRIu32" bpp to %"PRIu32" bpp", - xorBpp, dstBitsPerPixel); + WLog_ERR(TAG, "failed to convert from %" PRIu32 " bpp to %" PRIu32 " bpp", xorBpp, + dstBitsPerPixel); return FALSE; } } -static INLINE BOOL overlapping(const BYTE* pDstData, UINT32 nXDst, UINT32 nYDst, - UINT32 nDstStep, UINT32 dstBytesPerPixel, - const BYTE* pSrcData, UINT32 nXSrc, UINT32 nYSrc, - UINT32 nSrcStep, UINT32 srcBytesPerPixel, +static INLINE BOOL overlapping(const BYTE* pDstData, UINT32 nXDst, UINT32 nYDst, UINT32 nDstStep, + UINT32 dstBytesPerPixel, const BYTE* pSrcData, UINT32 nXSrc, + UINT32 nYSrc, UINT32 nSrcStep, UINT32 srcBytesPerPixel, UINT32 nWidth, UINT32 nHeight) { const BYTE* pDstStart = &pDstData[nXDst * dstBytesPerPixel + nYDst * nDstStep]; @@ -551,11 +541,9 @@ static INLINE BOOL overlapping(const BYTE* pDstData, UINT32 nXDst, UINT32 nYDst, return FALSE; } -BOOL freerdp_image_copy(BYTE* pDstData, DWORD DstFormat, - UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, - UINT32 nWidth, UINT32 nHeight, - const BYTE* pSrcData, DWORD SrcFormat, - UINT32 nSrcStep, UINT32 nXSrc, UINT32 nYSrc, +BOOL freerdp_image_copy(BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep, UINT32 nXDst, + UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, const BYTE* pSrcData, + DWORD SrcFormat, UINT32 nSrcStep, UINT32 nXSrc, UINT32 nYSrc, const gdiPalette* palette, UINT32 flags) { const UINT32 dstByte = GetBytesPerPixel(DstFormat); @@ -591,23 +579,18 @@ BOOL freerdp_image_copy(BYTE* pDstData, DWORD DstFormat, { INT32 y; - if (overlapping(pDstData, nXDst, nYDst, nDstStep, dstByte, - pSrcData, nXSrc, nYSrc, nSrcStep, srcByte, - nWidth, nHeight)) + if (overlapping(pDstData, nXDst, nYDst, nDstStep, dstByte, pSrcData, nXSrc, nYSrc, nSrcStep, + srcByte, nWidth, nHeight)) { /* Copy down */ if (nYDst < nYSrc) { for (y = 0; y < (INT32)nHeight; y++) { - const BYTE* srcLine = &pSrcData[(y + nYSrc) * - nSrcStep * srcVMultiplier + - srcVOffset]; - BYTE* dstLine = &pDstData[(y + nYDst) * - nDstStep * dstVMultiplier + - dstVOffset]; - memcpy(&dstLine[xDstOffset], - &srcLine[xSrcOffset], copyDstWidth); + const BYTE* srcLine = + &pSrcData[(y + nYSrc) * nSrcStep * srcVMultiplier + srcVOffset]; + BYTE* dstLine = &pDstData[(y + nYDst) * nDstStep * dstVMultiplier + dstVOffset]; + memcpy(&dstLine[xDstOffset], &srcLine[xSrcOffset], copyDstWidth); } } /* Copy up */ @@ -615,14 +598,10 @@ BOOL freerdp_image_copy(BYTE* pDstData, DWORD DstFormat, { for (y = nHeight - 1; y >= 0; y--) { - const BYTE* srcLine = &pSrcData[(y + nYSrc) * - nSrcStep * srcVMultiplier + - srcVOffset]; - BYTE* dstLine = &pDstData[(y + nYDst) * - nDstStep * dstVMultiplier + - dstVOffset]; - memcpy(&dstLine[xDstOffset], - &srcLine[xSrcOffset], copyDstWidth); + const BYTE* srcLine = + &pSrcData[(y + nYSrc) * nSrcStep * srcVMultiplier + srcVOffset]; + BYTE* dstLine = &pDstData[(y + nYDst) * nDstStep * dstVMultiplier + dstVOffset]; + memcpy(&dstLine[xDstOffset], &srcLine[xSrcOffset], copyDstWidth); } } /* Copy left */ @@ -630,14 +609,10 @@ BOOL freerdp_image_copy(BYTE* pDstData, DWORD DstFormat, { for (y = 0; y < (INT32)nHeight; y++) { - const BYTE* srcLine = &pSrcData[(y + nYSrc) * - nSrcStep * srcVMultiplier + - srcVOffset]; - BYTE* dstLine = &pDstData[(y + nYDst) * - nDstStep * dstVMultiplier + - dstVOffset]; - memmove(&dstLine[xDstOffset], - &srcLine[xSrcOffset], copyDstWidth); + const BYTE* srcLine = + &pSrcData[(y + nYSrc) * nSrcStep * srcVMultiplier + srcVOffset]; + BYTE* dstLine = &pDstData[(y + nYDst) * nDstStep * dstVMultiplier + dstVOffset]; + memmove(&dstLine[xDstOffset], &srcLine[xSrcOffset], copyDstWidth); } } /* Copy right */ @@ -645,14 +620,10 @@ BOOL freerdp_image_copy(BYTE* pDstData, DWORD DstFormat, { for (y = (INT32)nHeight - 1; y >= 0; y--) { - const BYTE* srcLine = &pSrcData[(y + nYSrc) * - nSrcStep * srcVMultiplier + - srcVOffset]; - BYTE* dstLine = &pDstData[(y + nYDst) * - nDstStep * dstVMultiplier + - dstVOffset]; - memmove(&dstLine[xDstOffset], - &srcLine[xSrcOffset], copyDstWidth); + const BYTE* srcLine = + &pSrcData[(y + nYSrc) * nSrcStep * srcVMultiplier + srcVOffset]; + BYTE* dstLine = &pDstData[(y + nYDst) * nDstStep * dstVMultiplier + dstVOffset]; + memmove(&dstLine[xDstOffset], &srcLine[xSrcOffset], copyDstWidth); } } /* Source and destination are equal... */ @@ -664,14 +635,10 @@ BOOL freerdp_image_copy(BYTE* pDstData, DWORD DstFormat, { for (y = 0; y < (INT32)nHeight; y++) { - const BYTE* srcLine = &pSrcData[(y + nYSrc) * - nSrcStep * srcVMultiplier + - srcVOffset]; - BYTE* dstLine = &pDstData[(y + nYDst) * - nDstStep * dstVMultiplier + - dstVOffset]; - memcpy(&dstLine[xDstOffset], - &srcLine[xSrcOffset], copyDstWidth); + const BYTE* srcLine = + &pSrcData[(y + nYSrc) * nSrcStep * srcVMultiplier + srcVOffset]; + BYTE* dstLine = &pDstData[(y + nYDst) * nDstStep * dstVMultiplier + dstVOffset]; + memcpy(&dstLine[xDstOffset], &srcLine[xSrcOffset], copyDstWidth); } } } @@ -681,17 +648,13 @@ BOOL freerdp_image_copy(BYTE* pDstData, DWORD DstFormat, for (y = 0; y < nHeight; y++) { - const BYTE* srcLine = &pSrcData[(y + nYSrc) * - nSrcStep * srcVMultiplier + - srcVOffset]; - BYTE* dstLine = &pDstData[(y + nYDst) * - nDstStep * dstVMultiplier + dstVOffset]; + const BYTE* srcLine = &pSrcData[(y + nYSrc) * nSrcStep * srcVMultiplier + srcVOffset]; + BYTE* dstLine = &pDstData[(y + nYDst) * nDstStep * dstVMultiplier + dstVOffset]; for (x = 0; x < nWidth; x++) { UINT32 dstColor; - UINT32 color = ReadColor(&srcLine[(x + nXSrc) * srcByte], - SrcFormat); + UINT32 color = ReadColor(&srcLine[(x + nXSrc) * srcByte], SrcFormat); dstColor = FreeRDPConvertColor(color, SrcFormat, DstFormat, palette); WriteColor(&dstLine[(x + nXDst) * dstByte], DstFormat, dstColor); } @@ -701,9 +664,8 @@ BOOL freerdp_image_copy(BYTE* pDstData, DWORD DstFormat, return TRUE; } -BOOL freerdp_image_fill(BYTE* pDstData, DWORD DstFormat, - UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, - UINT32 nWidth, UINT32 nHeight, UINT32 color) +BOOL freerdp_image_fill(BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep, UINT32 nXDst, + UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, UINT32 color) { UINT32 x, y; const UINT32 bpp = GetBytesPerPixel(DstFormat); @@ -748,10 +710,10 @@ static int av_format_for_buffer(UINT32 format) } #endif -BOOL freerdp_image_scale(BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep, - UINT32 nXDst, UINT32 nYDst, UINT32 nDstWidth, UINT32 nDstHeight, - const BYTE* pSrcData, DWORD SrcFormat, UINT32 nSrcStep, - UINT32 nXSrc, UINT32 nYSrc, UINT32 nSrcWidth, UINT32 nSrcHeight) +BOOL freerdp_image_scale(BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep, UINT32 nXDst, + UINT32 nYDst, UINT32 nDstWidth, UINT32 nDstHeight, const BYTE* pSrcData, + DWORD SrcFormat, UINT32 nSrcStep, UINT32 nXSrc, UINT32 nYSrc, + UINT32 nSrcWidth, UINT32 nSrcHeight) { BOOL rc = FALSE; const BYTE* src = &pSrcData[nXSrc * GetBytesPerPixel(SrcFormat) + nYSrc * nSrcStep]; @@ -760,9 +722,9 @@ BOOL freerdp_image_scale(BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep, /* direct copy is much faster than scaling, so check if we can simply copy... */ if ((nDstWidth == nSrcWidth) && (nDstHeight == nSrcHeight)) { - return freerdp_image_copy(pDstData, DstFormat, nDstStep, nXDst, nYDst, nDstWidth, nDstHeight, - pSrcData, SrcFormat, nSrcStep, nXSrc, nYSrc, - NULL, FREERDP_FLIP_NONE); + return freerdp_image_copy(pDstData, DstFormat, nDstStep, nXDst, nYDst, nDstWidth, + nDstHeight, pSrcData, SrcFormat, nSrcStep, nXSrc, nYSrc, NULL, + FREERDP_FLIP_NONE); } else #if defined(SWSCALE_FOUND) @@ -777,9 +739,8 @@ BOOL freerdp_image_scale(BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep, if ((srcFormat == AV_PIX_FMT_NONE) || (dstFormat == AV_PIX_FMT_NONE)) return FALSE; - resize = sws_getContext((int)nSrcWidth, (int)nSrcHeight, srcFormat, - (int)nDstWidth, (int)nDstHeight, dstFormat, - SWS_BILINEAR, NULL, NULL, NULL); + resize = sws_getContext((int)nSrcWidth, (int)nSrcHeight, srcFormat, (int)nDstWidth, + (int)nDstHeight, dstFormat, SWS_BILINEAR, NULL, NULL, NULL); if (!resize) goto fail; @@ -795,7 +756,7 @@ BOOL freerdp_image_scale(BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep, const double sx = (double)nDstWidth / (double)nSrcWidth; const double sy = (double)nDstHeight / (double)nSrcHeight; cairo_t* cairo_context; - cairo_surface_t* csrc, *cdst; + cairo_surface_t *csrc, *cdst; if ((nSrcWidth > INT_MAX) || (nSrcHeight > INT_MAX) || (nSrcStep > INT_MAX)) return FALSE; @@ -803,10 +764,10 @@ BOOL freerdp_image_scale(BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep, if ((nDstWidth > INT_MAX) || (nDstHeight > INT_MAX) || (nDstStep > INT_MAX)) return FALSE; - csrc = cairo_image_surface_create_for_data((void*)src, - CAIRO_FORMAT_ARGB32, (int)nSrcWidth, (int)nSrcHeight, (int)nSrcStep); - cdst = cairo_image_surface_create_for_data(dst, - CAIRO_FORMAT_ARGB32, (int)nDstWidth, (int)nDstHeight, (int)nDstStep); + csrc = cairo_image_surface_create_for_data((void*)src, CAIRO_FORMAT_ARGB32, (int)nSrcWidth, + (int)nSrcHeight, (int)nSrcStep); + cdst = cairo_image_surface_create_for_data(dst, CAIRO_FORMAT_ARGB32, (int)nDstWidth, + (int)nDstHeight, (int)nDstStep); if (!csrc || !cdst) goto fail; diff --git a/libfreerdp/codec/dsp.c b/libfreerdp/codec/dsp.c index 4e5e5e94f..a18d044cd 100644 --- a/libfreerdp/codec/dsp.c +++ b/libfreerdp/codec/dsp.c @@ -61,8 +61,7 @@ #if !defined(WITH_DSP_FFMPEG) -union _ADPCM -{ +union _ADPCM { struct { INT16 last_sample[2]; @@ -113,7 +112,7 @@ struct _FREERDP_DSP_CONTEXT static INT16 read_int16(const BYTE* src) { - return (INT16) (src[0] | (src[1] << 8)); + return (INT16)(src[0] | (src[1] << 8)); } static void write_int16(BYTE* dst, INT32 val) @@ -122,10 +121,9 @@ static void write_int16(BYTE* dst, INT32 val) dst[0] = val & 0xFF; } -static BOOL freerdp_dsp_channel_mix(FREERDP_DSP_CONTEXT* context, - const BYTE* src, size_t size, - const AUDIO_FORMAT* srcFormat, - const BYTE** data, size_t* length) +static BOOL freerdp_dsp_channel_mix(FREERDP_DSP_CONTEXT* context, const BYTE* src, size_t size, + const AUDIO_FORMAT* srcFormat, const BYTE** data, + size_t* length) { UINT32 bpp; size_t samples; @@ -172,7 +170,7 @@ static BOOL freerdp_dsp_channel_mix(FREERDP_DSP_CONTEXT* context, *length = Stream_Length(context->buffer); return TRUE; - case 2: /* We only support stereo, so we can not handle this case. */ + case 2: /* We only support stereo, so we can not handle this case. */ default: /* Unsupported number of channels */ return FALSE; } @@ -198,7 +196,7 @@ static BOOL freerdp_dsp_channel_mix(FREERDP_DSP_CONTEXT* context, *length = Stream_Length(context->buffer); return TRUE; - case 1: /* Invalid, do we want to use a 0 channel sound? */ + case 1: /* Invalid, do we want to use a 0 channel sound? */ default: /* Unsupported number of channels */ return FALSE; } @@ -211,10 +209,8 @@ static BOOL freerdp_dsp_channel_mix(FREERDP_DSP_CONTEXT* context, * http://download.microsoft.com/download/9/8/6/9863C72A-A3AA-4DDB-B1BA-CA8D17EFD2D4/RIFFNEW.pdf */ -static BOOL freerdp_dsp_resample(FREERDP_DSP_CONTEXT* context, - const BYTE* src, size_t size, - const AUDIO_FORMAT* srcFormat, - const BYTE** data, size_t* length) +static BOOL freerdp_dsp_resample(FREERDP_DSP_CONTEXT* context, const BYTE* src, size_t size, + const AUDIO_FORMAT* srcFormat, const BYTE** data, size_t* length) { #if defined(WITH_SOXR) soxr_error_t error; @@ -259,8 +255,7 @@ static BOOL freerdp_dsp_resample(FREERDP_DSP_CONTEXT* context, if (!Stream_EnsureCapacity(context->resample, rsize)) return FALSE; - error = soxr_process(context->sox, src, sframes, &idone, - Stream_Buffer(context->resample), + error = soxr_process(context->sox, src, sframes, &idone, Stream_Buffer(context->resample), Stream_Capacity(context->resample) / rbytes, &odone); Stream_SetLength(context->resample, odone * rbytes); *data = Stream_Buffer(context->resample); @@ -283,27 +278,21 @@ static BOOL freerdp_dsp_resample(FREERDP_DSP_CONTEXT* context, * http://wiki.multimedia.cx/index.php?title=IMA_ADPCM */ -static const INT16 ima_step_index_table[] = -{ - -1, -1, -1, -1, 2, 4, 6, 8, - -1, -1, -1, -1, 2, 4, 6, 8 - }; - -static const INT16 ima_step_size_table[] = -{ - 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, - 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, - 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, - 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, - 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, - 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, - 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358, - 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, - 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 +static const INT16 ima_step_index_table[] = { + -1, -1, -1, -1, 2, 4, 6, 8, -1, -1, -1, -1, 2, 4, 6, 8 }; -static UINT16 dsp_decode_ima_adpcm_sample(ADPCM* adpcm, - unsigned int channel, BYTE sample) +static const INT16 ima_step_size_table[] = { + 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, + 25, 28, 31, 34, 37, 41, 45, 50, 55, 60, 66, 73, 80, + 88, 97, 107, 118, 130, 143, 157, 173, 190, 209, 230, 253, 279, + 307, 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, 876, 963, + 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327, + 3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, + 12635, 13899, 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 +}; + +static UINT16 dsp_decode_ima_adpcm_sample(ADPCM* adpcm, unsigned int channel, BYTE sample) { INT32 ss; INT32 d; @@ -329,7 +318,7 @@ static UINT16 dsp_decode_ima_adpcm_sample(ADPCM* adpcm, else if (d > 32767) d = 32767; - adpcm->ima.last_sample[channel] = (INT16) d; + adpcm->ima.last_sample[channel] = (INT16)d; adpcm->ima.last_step[channel] += ima_step_index_table[sample]; if (adpcm->ima.last_step[channel] < 0) @@ -337,11 +326,11 @@ static UINT16 dsp_decode_ima_adpcm_sample(ADPCM* adpcm, else if (adpcm->ima.last_step[channel] > 88) adpcm->ima.last_step[channel] = 88; - return (UINT16) d; + return (UINT16)d; } -static BOOL freerdp_dsp_decode_ima_adpcm(FREERDP_DSP_CONTEXT* context, - const BYTE* src, size_t size, wStream* out) +static BOOL freerdp_dsp_decode_ima_adpcm(FREERDP_DSP_CONTEXT* context, const BYTE* src, size_t size, + wStream* out) { BYTE* dst; BYTE sample; @@ -361,7 +350,8 @@ static BOOL freerdp_dsp_decode_ima_adpcm(FREERDP_DSP_CONTEXT* context, { if (size % block_size == 0) { - context->adpcm.ima.last_sample[0] = (INT16)(((UINT16)(*src)) | (((UINT16)(*(src + 1))) << 8)); + context->adpcm.ima.last_sample[0] = + (INT16)(((UINT16)(*src)) | (((UINT16)(*(src + 1))) << 8)); context->adpcm.ima.last_step[0] = (INT16)(*(src + 2)); src += 4; size -= 4; @@ -369,7 +359,8 @@ static BOOL freerdp_dsp_decode_ima_adpcm(FREERDP_DSP_CONTEXT* context, if (channels > 1) { - context->adpcm.ima.last_sample[1] = (INT16)(((UINT16)(*src)) | (((UINT16)(*(src + 1))) << 8)); + context->adpcm.ima.last_sample[1] = + (INT16)(((UINT16)(*src)) | (((UINT16)(*(src + 1))) << 8)); context->adpcm.ima.last_step[1] = (INT16)(*(src + 2)); src += 4; size -= 4; @@ -416,8 +407,8 @@ static BOOL freerdp_dsp_decode_ima_adpcm(FREERDP_DSP_CONTEXT* context, } #if defined(WITH_GSM) -static BOOL freerdp_dsp_decode_gsm610(FREERDP_DSP_CONTEXT* context, - const BYTE* src, size_t size, wStream* out) +static BOOL freerdp_dsp_decode_gsm610(FREERDP_DSP_CONTEXT* context, const BYTE* src, size_t size, + wStream* out) { size_t offset = 0; @@ -425,7 +416,8 @@ static BOOL freerdp_dsp_decode_gsm610(FREERDP_DSP_CONTEXT* context, { int rc; gsm_signal gsmBlockBuffer[160] = { 0 }; - rc = gsm_decode(context->gsm, (gsm_byte*) /* API does not modify */ &src[offset], gsmBlockBuffer); + rc = gsm_decode(context->gsm, (gsm_byte*)/* API does not modify */ &src[offset], + gsmBlockBuffer); if (rc < 0) return FALSE; @@ -438,14 +430,14 @@ static BOOL freerdp_dsp_decode_gsm610(FREERDP_DSP_CONTEXT* context, if (!Stream_EnsureRemainingCapacity(out, sizeof(gsmBlockBuffer))) return FALSE; - Stream_Write(out, (void*) gsmBlockBuffer, sizeof(gsmBlockBuffer)); + Stream_Write(out, (void*)gsmBlockBuffer, sizeof(gsmBlockBuffer)); } return TRUE; } -static BOOL freerdp_dsp_encode_gsm610(FREERDP_DSP_CONTEXT* context, - const BYTE* src, size_t size, wStream* out) +static BOOL freerdp_dsp_encode_gsm610(FREERDP_DSP_CONTEXT* context, const BYTE* src, size_t size, + wStream* out) { size_t offset = 0; @@ -456,7 +448,8 @@ static BOOL freerdp_dsp_encode_gsm610(FREERDP_DSP_CONTEXT* context, if (!Stream_EnsureRemainingCapacity(out, sizeof(gsm_frame))) return FALSE; - gsm_encode(context->gsm, (gsm_signal*) /* API does not modify */ signal, Stream_Pointer(out)); + gsm_encode(context->gsm, (gsm_signal*)/* API does not modify */ signal, + Stream_Pointer(out)); if ((offset % 65) == 0) Stream_Seek(out, 33); @@ -471,8 +464,8 @@ static BOOL freerdp_dsp_encode_gsm610(FREERDP_DSP_CONTEXT* context, #endif #if defined(WITH_LAME) -static BOOL freerdp_dsp_decode_mp3(FREERDP_DSP_CONTEXT* context, - const BYTE* src, size_t size, wStream* out) +static BOOL freerdp_dsp_decode_mp3(FREERDP_DSP_CONTEXT* context, const BYTE* src, size_t size, + wStream* out) { int rc, x; short* pcm_l; @@ -489,8 +482,8 @@ static BOOL freerdp_dsp_decode_mp3(FREERDP_DSP_CONTEXT* context, pcm_l = (short*)Stream_Buffer(context->buffer); pcm_r = (short*)Stream_Buffer(context->buffer) + buffer_size; - rc = hip_decode(context->hip, (unsigned char*)/* API is not modifying content */src, - size, pcm_l, pcm_r); + rc = hip_decode(context->hip, (unsigned char*)/* API is not modifying content */ src, size, + pcm_l, pcm_r); if (rc <= 0) return FALSE; @@ -507,8 +500,8 @@ static BOOL freerdp_dsp_decode_mp3(FREERDP_DSP_CONTEXT* context, return TRUE; } -static BOOL freerdp_dsp_encode_mp3(FREERDP_DSP_CONTEXT* context, - const BYTE* src, size_t size, wStream* out) +static BOOL freerdp_dsp_encode_mp3(FREERDP_DSP_CONTEXT* context, const BYTE* src, size_t size, + wStream* out) { size_t samples_per_channel; int rc; @@ -535,8 +528,8 @@ static BOOL freerdp_dsp_encode_mp3(FREERDP_DSP_CONTEXT* context, #endif #if defined(WITH_FAAC) -static BOOL freerdp_dsp_encode_faac(FREERDP_DSP_CONTEXT* context, - const BYTE* src, size_t size, wStream* out) +static BOOL freerdp_dsp_encode_faac(FREERDP_DSP_CONTEXT* context, const BYTE* src, size_t size, + wStream* out) { const int16_t* inSamples = (const int16_t*)src; int32_t* outSamples; @@ -575,8 +568,8 @@ static BOOL freerdp_dsp_encode_faac(FREERDP_DSP_CONTEXT* context, #endif #if defined(WITH_FAAD2) -static BOOL freerdp_dsp_decode_faad(FREERDP_DSP_CONTEXT* context, - const BYTE* src, size_t size, wStream* out) +static BOOL freerdp_dsp_decode_faad(FREERDP_DSP_CONTEXT* context, const BYTE* src, size_t size, + wStream* out) { NeAACDecFrameInfo info; void* output; @@ -589,8 +582,9 @@ static BOOL freerdp_dsp_decode_faad(FREERDP_DSP_CONTEXT* context, { unsigned long samplerate; unsigned char channels; - long err = NeAACDecInit(context->faad, /* API is not modifying content */(unsigned char*)src, - size, &samplerate, &channels); + long err = + NeAACDecInit(context->faad, /* API is not modifying content */ (unsigned char*)src, + size, &samplerate, &channels); if (err != 0) return FALSE; @@ -645,25 +639,9 @@ static const struct { BYTE byte_num; BYTE byte_shift; -} ima_stereo_encode_map[] = -{ - { 0, 0 }, - { 4, 0 }, - { 0, 4 }, - { 4, 4 }, - { 1, 0 }, - { 5, 0 }, - { 1, 4 }, - { 5, 4 }, - { 2, 0 }, - { 6, 0 }, - { 2, 4 }, - { 6, 4 }, - { 3, 0 }, - { 7, 0 }, - { 3, 4 }, - { 7, 4 } -}; +} ima_stereo_encode_map[] = { { 0, 0 }, { 4, 0 }, { 0, 4 }, { 4, 4 }, { 1, 0 }, { 5, 0 }, + { 1, 4 }, { 5, 4 }, { 2, 0 }, { 6, 0 }, { 2, 4 }, { 6, 4 }, + { 3, 0 }, { 7, 0 }, { 3, 4 }, { 7, 4 } }; static BYTE dsp_encode_ima_adpcm_sample(ADPCM* adpcm, int channel, INT16 sample) { @@ -717,7 +695,7 @@ static BYTE dsp_encode_ima_adpcm_sample(ADPCM* adpcm, int channel, INT16 sample) else if (diff > 32767) diff = 32767; - adpcm->ima.last_sample[channel] = (INT16) diff; + adpcm->ima.last_sample[channel] = (INT16)diff; adpcm->ima.last_step[channel] += ima_step_index_table[enc]; if (adpcm->ima.last_step[channel] < 0) @@ -728,8 +706,8 @@ static BYTE dsp_encode_ima_adpcm_sample(ADPCM* adpcm, int channel, INT16 sample) return enc; } -static BOOL freerdp_dsp_encode_ima_adpcm(FREERDP_DSP_CONTEXT* context, - const BYTE* src, size_t size, wStream* out) +static BOOL freerdp_dsp_encode_ima_adpcm(FREERDP_DSP_CONTEXT* context, const BYTE* src, size_t size, + wStream* out) { int i; BYTE* dst; @@ -752,14 +730,14 @@ static BOOL freerdp_dsp_encode_ima_adpcm(FREERDP_DSP_CONTEXT* context, { *dst++ = context->adpcm.ima.last_sample[0] & 0xFF; *dst++ = (context->adpcm.ima.last_sample[0] >> 8) & 0xFF; - *dst++ = (BYTE) context->adpcm.ima.last_step[0]; + *dst++ = (BYTE)context->adpcm.ima.last_step[0]; *dst++ = 0; if (context->format.nChannels > 1) { *dst++ = context->adpcm.ima.last_sample[1] & 0xFF; *dst++ = (context->adpcm.ima.last_sample[1] >> 8) & 0xFF; - *dst++ = (BYTE) context->adpcm.ima.last_step[1]; + *dst++ = (BYTE)context->adpcm.ima.last_step[1]; *dst++ = 0; } } @@ -773,7 +751,8 @@ static BOOL freerdp_dsp_encode_ima_adpcm(FREERDP_DSP_CONTEXT* context, sample = (INT16)(((UINT16)(*src)) | (((UINT16)(*(src + 1))) << 8)); src += 2; encoded = dsp_encode_ima_adpcm_sample(&context->adpcm, i % 2, sample); - dst[ima_stereo_encode_map[i].byte_num] |= encoded << ima_stereo_encode_map[i].byte_shift; + dst[ima_stereo_encode_map[i].byte_num] |= encoded + << ima_stereo_encode_map[i].byte_shift; } dst += 8; @@ -802,29 +781,21 @@ static BOOL freerdp_dsp_encode_ima_adpcm(FREERDP_DSP_CONTEXT* context, * http://wiki.multimedia.cx/index.php?title=Microsoft_ADPCM */ -static const INT32 ms_adpcm_adaptation_table[] = -{ - 230, 230, 230, 230, 307, 409, 512, 614, - 768, 614, 512, 409, 307, 230, 230, 230 -}; +static const INT32 ms_adpcm_adaptation_table[] = { 230, 230, 230, 230, 307, 409, 512, 614, + 768, 614, 512, 409, 307, 230, 230, 230 }; -static const INT32 ms_adpcm_coeffs1[7] = -{ - 256, 512, 0, 192, 240, 460, 392 -}; +static const INT32 ms_adpcm_coeffs1[7] = { 256, 512, 0, 192, 240, 460, 392 }; -static const INT32 ms_adpcm_coeffs2[7] = -{ - 0, -256, 0, 64, 0, -208, -232 -}; +static const INT32 ms_adpcm_coeffs2[7] = { 0, -256, 0, 64, 0, -208, -232 }; static INLINE INT16 freerdp_dsp_decode_ms_adpcm_sample(ADPCM* adpcm, BYTE sample, int channel) { INT8 nibble; INT32 presample; - nibble = (sample & 0x08 ? (INT8) sample - 16 : (INT8)sample); + nibble = (sample & 0x08 ? (INT8)sample - 16 : (INT8)sample); presample = ((adpcm->ms.sample1[channel] * ms_adpcm_coeffs1[adpcm->ms.predictor[channel]]) + - (adpcm->ms.sample2[channel] * ms_adpcm_coeffs2[adpcm->ms.predictor[channel]])) / 256; + (adpcm->ms.sample2[channel] * ms_adpcm_coeffs2[adpcm->ms.predictor[channel]])) / + 256; presample += nibble * adpcm->ms.delta[channel]; if (presample > 32767) @@ -839,11 +810,11 @@ static INLINE INT16 freerdp_dsp_decode_ms_adpcm_sample(ADPCM* adpcm, BYTE sample if (adpcm->ms.delta[channel] < 16) adpcm->ms.delta[channel] = 16; - return (INT16) presample; + return (INT16)presample; } -static BOOL freerdp_dsp_decode_ms_adpcm(FREERDP_DSP_CONTEXT* context, - const BYTE* src, size_t size, wStream* out) +static BOOL freerdp_dsp_decode_ms_adpcm(FREERDP_DSP_CONTEXT* context, const BYTE* src, size_t size, + wStream* out) { BYTE* dst; BYTE sample; @@ -938,7 +909,8 @@ static BYTE freerdp_dsp_encode_ms_adpcm_sample(ADPCM* adpcm, INT32 sample, int c INT32 presample; INT32 errordelta; presample = ((adpcm->ms.sample1[channel] * ms_adpcm_coeffs1[adpcm->ms.predictor[channel]]) + - (adpcm->ms.sample2[channel] * ms_adpcm_coeffs2[adpcm->ms.predictor[channel]])) / 256; + (adpcm->ms.sample2[channel] * ms_adpcm_coeffs2[adpcm->ms.predictor[channel]])) / + 256; errordelta = (sample - presample) / adpcm->ms.delta[channel]; if ((sample - presample) % adpcm->ms.delta[channel] > adpcm->ms.delta[channel] / 2) @@ -958,13 +930,13 @@ static BYTE freerdp_dsp_encode_ms_adpcm_sample(ADPCM* adpcm, INT32 sample, int c adpcm->ms.sample2[channel] = adpcm->ms.sample1[channel]; adpcm->ms.sample1[channel] = presample; - adpcm->ms.delta[channel] = adpcm->ms.delta[channel] * ms_adpcm_adaptation_table[((( - BYTE) errordelta) & 0x0F)] / 256; + adpcm->ms.delta[channel] = + adpcm->ms.delta[channel] * ms_adpcm_adaptation_table[(((BYTE)errordelta) & 0x0F)] / 256; if (adpcm->ms.delta[channel] < 16) adpcm->ms.delta[channel] = 16; - return ((BYTE) errordelta) & 0x0F; + return ((BYTE)errordelta) & 0x0F; } static BOOL freerdp_dsp_encode_ms_adpcm(FREERDP_DSP_CONTEXT* context, const BYTE* src, size_t size, @@ -1033,7 +1005,7 @@ static BOOL freerdp_dsp_encode_ms_adpcm(FREERDP_DSP_CONTEXT* context, const BYTE sample = read_int16(src); src += 2; *dst += freerdp_dsp_encode_ms_adpcm_sample(&context->adpcm, sample, - context->format.nChannels > 1 ? 1 : 0); + context->format.nChannels > 1 ? 1 : 0); dst++; size -= 4; } @@ -1143,7 +1115,7 @@ void freerdp_dsp_context_free(FREERDP_DSP_CONTEXT* context) NeAACDecClose(context->faad); #endif -#if defined (WITH_FAAC) +#if defined(WITH_FAAC) if (context->faac) faacEncClose(context->faac); diff --git a/libfreerdp/codec/dsp_ffmpeg.c b/libfreerdp/codec/dsp_ffmpeg.c index 5576f416a..222ffa717 100644 --- a/libfreerdp/codec/dsp_ffmpeg.c +++ b/libfreerdp/codec/dsp_ffmpeg.c @@ -137,7 +137,6 @@ static enum AVCodecID ffmpeg_get_avcodec(const AUDIO_FORMAT* format) } } - static int ffmpeg_sample_format(const AUDIO_FORMAT* format) { switch (format->wFormatTag) @@ -344,8 +343,7 @@ fail: } #if defined(SWRESAMPLE_FOUND) -static BOOL ffmpeg_resample_frame(SwrContext* context, - AVFrame* in, AVFrame* out) +static BOOL ffmpeg_resample_frame(SwrContext* context, AVFrame* in, AVFrame* out) { int ret; @@ -376,8 +374,7 @@ static BOOL ffmpeg_resample_frame(SwrContext* context, return TRUE; } #else -static BOOL ffmpeg_resample_frame(AVAudioResampleContext* context, - AVFrame* in, AVFrame* out) +static BOOL ffmpeg_resample_frame(AVAudioResampleContext* context, AVFrame* in, AVFrame* out) { int ret; @@ -409,8 +406,8 @@ static BOOL ffmpeg_resample_frame(AVAudioResampleContext* context, } #endif -static BOOL ffmpeg_encode_frame(AVCodecContext* context, AVFrame* in, - AVPacket* packet, wStream* out) +static BOOL ffmpeg_encode_frame(AVCodecContext* context, AVFrame* in, AVPacket* packet, + wStream* out) { int ret; /* send the packet with the compressed data to the encoder */ @@ -419,8 +416,7 @@ static BOOL ffmpeg_encode_frame(AVCodecContext* context, AVFrame* in, if (ret < 0) { const char* err = av_err2str(ret); - WLog_ERR(TAG, "Error submitting the packet to the encoder %s [%d]", - err, ret); + WLog_ERR(TAG, "Error submitting the packet to the encoder %s [%d]", err, ret); return FALSE; } @@ -448,8 +444,8 @@ static BOOL ffmpeg_encode_frame(AVCodecContext* context, AVFrame* in, return TRUE; } -static BOOL ffmpeg_fill_frame(AVFrame* frame, const AUDIO_FORMAT* inputFormat, - const BYTE* data, size_t size) +static BOOL ffmpeg_fill_frame(AVFrame* frame, const AUDIO_FORMAT* inputFormat, const BYTE* data, + size_t size) { int ret, bpp; frame->channels = inputFormat->nChannels; @@ -459,9 +455,7 @@ static BOOL ffmpeg_fill_frame(AVFrame* frame, const AUDIO_FORMAT* inputFormat, bpp = av_get_bytes_per_sample(frame->format); frame->nb_samples = size / inputFormat->nChannels / bpp; - if ((ret = avcodec_fill_audio_frame(frame, frame->channels, - frame->format, - data, size, 1)) < 0) + if ((ret = avcodec_fill_audio_frame(frame, frame->channels, frame->format, data, size, 1)) < 0) { const char* err = av_err2str(ret); WLog_ERR(TAG, "Error during audio frame fill %s [%d]", err, ret); @@ -471,15 +465,11 @@ static BOOL ffmpeg_fill_frame(AVFrame* frame, const AUDIO_FORMAT* inputFormat, return TRUE; } #if defined(SWRESAMPLE_FOUND) -static BOOL ffmpeg_decode(AVCodecContext* dec_ctx, AVPacket* pkt, - AVFrame* frame, - SwrContext* resampleContext, - AVFrame* resampled, wStream* out) +static BOOL ffmpeg_decode(AVCodecContext* dec_ctx, AVPacket* pkt, AVFrame* frame, + SwrContext* resampleContext, AVFrame* resampled, wStream* out) #else -static BOOL ffmpeg_decode(AVCodecContext* dec_ctx, AVPacket* pkt, - AVFrame* frame, - AVAudioResampleContext* resampleContext, - AVFrame* resampled, wStream* out) +static BOOL ffmpeg_decode(AVCodecContext* dec_ctx, AVPacket* pkt, AVFrame* frame, + AVAudioResampleContext* resampleContext, AVFrame* resampled, wStream* out) #endif { int ret; @@ -489,8 +479,7 @@ static BOOL ffmpeg_decode(AVCodecContext* dec_ctx, AVPacket* pkt, if (ret < 0) { const char* err = av_err2str(ret); - WLog_ERR(TAG, "Error submitting the packet to the decoder %s [%d]", - err, ret); + WLog_ERR(TAG, "Error submitting the packet to the decoder %s [%d]", err, ret); return FALSE; } @@ -619,15 +608,12 @@ BOOL freerdp_dsp_ffmpeg_encode(FREERDP_DSP_CONTEXT* context, const AUDIO_FORMAT* return FALSE; /* Resample to desired format. */ - if (!ffmpeg_resample_frame(context->rcontext, - context->frame, - context->resampled)) + if (!ffmpeg_resample_frame(context->rcontext, context->frame, context->resampled)) return FALSE; if (context->context->frame_size <= 0) { - return ffmpeg_encode_frame(context->context, context->resampled, - context->packet, out); + return ffmpeg_encode_frame(context->context, context->resampled, context->packet, out); } else { @@ -644,9 +630,10 @@ BOOL freerdp_dsp_ffmpeg_encode(FREERDP_DSP_CONTEXT* context, const AUDIO_FORMAT* if (inSamples + (int)context->bufferedSamples > context->context->frame_size) inSamples = context->context->frame_size - (int)context->bufferedSamples; - rc = av_samples_copy(context->buffered->extended_data, context->resampled->extended_data, - (int)context->bufferedSamples, copied, inSamples, - context->context->channels, context->context->sample_fmt); + rc = + av_samples_copy(context->buffered->extended_data, context->resampled->extended_data, + (int)context->bufferedSamples, copied, inSamples, + context->context->channels, context->context->sample_fmt); rest -= inSamples; copied += inSamples; context->bufferedSamples += (UINT32)inSamples; @@ -654,14 +641,12 @@ BOOL freerdp_dsp_ffmpeg_encode(FREERDP_DSP_CONTEXT* context, const AUDIO_FORMAT* if (context->context->frame_size <= (int)context->bufferedSamples) { /* Encode in desired format. */ - if (!ffmpeg_encode_frame(context->context, context->buffered, - context->packet, out)) + if (!ffmpeg_encode_frame(context->context, context->buffered, context->packet, out)) return FALSE; context->bufferedSamples = 0; } - } - while (rest > 0); + } while (rest > 0); return TRUE; } @@ -676,6 +661,6 @@ BOOL freerdp_dsp_ffmpeg_decode(FREERDP_DSP_CONTEXT* context, const AUDIO_FORMAT* av_init_packet(context->packet); context->packet->data = (uint8_t*)data; context->packet->size = length; - return ffmpeg_decode(context->context, context->packet, context->frame, - context->rcontext, context->resampled, out); + return ffmpeg_decode(context->context, context->packet, context->frame, context->rcontext, + context->resampled, out); } diff --git a/libfreerdp/codec/dsp_ffmpeg.h b/libfreerdp/codec/dsp_ffmpeg.h index 5065da120..d9d057fd4 100644 --- a/libfreerdp/codec/dsp_ffmpeg.h +++ b/libfreerdp/codec/dsp_ffmpeg.h @@ -28,19 +28,16 @@ #include #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 48, 101) -#error "DSP module requires libavcodec version >= 57.48.101. Upgrade or set WITH_DSP_FFMPEG=OFF to continue" +#error \ + "DSP module requires libavcodec version >= 57.48.101. Upgrade or set WITH_DSP_FFMPEG=OFF to continue" #endif FREERDP_DSP_CONTEXT* freerdp_dsp_ffmpeg_context_new(BOOL encode); BOOL freerdp_dsp_ffmpeg_supports_format(const AUDIO_FORMAT* format, BOOL encode); -BOOL freerdp_dsp_ffmpeg_encode(FREERDP_DSP_CONTEXT* context, - const AUDIO_FORMAT* srcFormat, - const BYTE* data, size_t length, - wStream* out); -BOOL freerdp_dsp_ffmpeg_decode(FREERDP_DSP_CONTEXT* context, - const AUDIO_FORMAT* srcFormat, - const BYTE* data, size_t length, - wStream* out); +BOOL freerdp_dsp_ffmpeg_encode(FREERDP_DSP_CONTEXT* context, const AUDIO_FORMAT* srcFormat, + const BYTE* data, size_t length, wStream* out); +BOOL freerdp_dsp_ffmpeg_decode(FREERDP_DSP_CONTEXT* context, const AUDIO_FORMAT* srcFormat, + const BYTE* data, size_t length, wStream* out); void freerdp_dsp_ffmpeg_context_free(FREERDP_DSP_CONTEXT* context); BOOL freerdp_dsp_ffmpeg_context_reset(FREERDP_DSP_CONTEXT* context, const AUDIO_FORMAT* targetFormat); diff --git a/libfreerdp/codec/h264.c b/libfreerdp/codec/h264.c index f91a6f3c1..152883603 100644 --- a/libfreerdp/codec/h264.c +++ b/libfreerdp/codec/h264.c @@ -52,8 +52,8 @@ BOOL avc420_ensure_buffer(H264_CONTEXT* h264, UINT32 stride, UINT32 width, UINT3 if (height % 16 != 0) height += 16 - height % 16; - if (!h264->pYUVData[0] || !h264->pYUVData[1] || !h264->pYUVData[2] || - (width != h264->width) || (height != h264->height) || (stride != h264->iStride[0])) + if (!h264->pYUVData[0] || !h264->pYUVData[1] || !h264->pYUVData[2] || (width != h264->width) || + (height != h264->height) || (stride != h264->iStride[0])) { h264->iStride[0] = stride; h264->iStride[1] = (stride + 1) / 2; @@ -74,9 +74,8 @@ BOOL avc420_ensure_buffer(H264_CONTEXT* h264, UINT32 stride, UINT32 width, UINT3 return TRUE; } - -static BOOL check_rect(const H264_CONTEXT* h264, const RECTANGLE_16* rect, - UINT32 nDstWidth, UINT32 nDstHeight) +static BOOL check_rect(const H264_CONTEXT* h264, const RECTANGLE_16* rect, UINT32 nDstWidth, + UINT32 nDstHeight) { /* Check, if the output rectangle is valid in decoded h264 frame. */ if ((rect->right > h264->width) || (rect->left > h264->width)) @@ -96,9 +95,8 @@ static BOOL check_rect(const H264_CONTEXT* h264, const RECTANGLE_16* rect, } static BOOL avc_yuv_to_rgb(H264_CONTEXT* h264, const RECTANGLE_16* regionRects, - UINT32 numRegionRects, UINT32 nDstWidth, - UINT32 nDstHeight, UINT32 nDstStep, BYTE* pDstData, - DWORD DstFormat, BOOL use444) + UINT32 numRegionRects, UINT32 nDstWidth, UINT32 nDstHeight, + UINT32 nDstStep, BYTE* pDstData, DWORD DstFormat, BOOL use444) { UINT32 x; BYTE* pDstPoint; @@ -150,18 +148,16 @@ static BOOL avc_yuv_to_rgb(H264_CONTEXT* h264, const RECTANGLE_16* regionRects, if (use444) { - if (prims->YUV444ToRGB_8u_P3AC4R( - pYUVPoint, iStride, pDstPoint, nDstStep, - DstFormat, &roi) != PRIMITIVES_SUCCESS) + if (prims->YUV444ToRGB_8u_P3AC4R(pYUVPoint, iStride, pDstPoint, nDstStep, DstFormat, + &roi) != PRIMITIVES_SUCCESS) { return FALSE; } } else { - if (prims->YUV420ToRGB_8u_P3AC4R( - pYUVPoint, iStride, pDstPoint, nDstStep, - DstFormat, &roi) != PRIMITIVES_SUCCESS) + if (prims->YUV420ToRGB_8u_P3AC4R(pYUVPoint, iStride, pDstPoint, nDstStep, DstFormat, + &roi) != PRIMITIVES_SUCCESS) return FALSE; } } @@ -169,9 +165,8 @@ static BOOL avc_yuv_to_rgb(H264_CONTEXT* h264, const RECTANGLE_16* regionRects, return TRUE; } -INT32 avc420_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSize, - BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep, - UINT32 nDstWidth, UINT32 nDstHeight, +INT32 avc420_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSize, BYTE* pDstData, + DWORD DstFormat, UINT32 nDstStep, UINT32 nDstWidth, UINT32 nDstHeight, RECTANGLE_16* regionRects, UINT32 numRegionRects) { int status; @@ -187,16 +182,15 @@ INT32 avc420_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSize if (status < 0) return status; - if (!avc_yuv_to_rgb(h264, regionRects, numRegionRects, nDstWidth, - nDstHeight, nDstStep, pDstData, DstFormat, FALSE)) + if (!avc_yuv_to_rgb(h264, regionRects, numRegionRects, nDstWidth, nDstHeight, nDstStep, + pDstData, DstFormat, FALSE)) return -1002; return 1; } -INT32 avc420_compress(H264_CONTEXT* h264, const BYTE* pSrcData, DWORD SrcFormat, - UINT32 nSrcStep, UINT32 nSrcWidth, UINT32 nSrcHeight, - BYTE** ppDstData, UINT32* pDstSize) +INT32 avc420_compress(H264_CONTEXT* h264, const BYTE* pSrcData, DWORD SrcFormat, UINT32 nSrcStep, + UINT32 nSrcWidth, UINT32 nSrcHeight, BYTE** ppDstData, UINT32* pDstSize) { prim_size_t roi; primitives_t* prims = primitives_get(); @@ -218,15 +212,14 @@ INT32 avc420_compress(H264_CONTEXT* h264, const BYTE* pSrcData, DWORD SrcFormat, return -1; { - const BYTE* pYUVData[3] = {h264->pYUVData[0], h264->pYUVData[1], h264->pYUVData[2]}; + const BYTE* pYUVData[3] = { h264->pYUVData[0], h264->pYUVData[1], h264->pYUVData[2] }; return h264->subsystem->Compress(h264, pYUVData, h264->iStride, ppDstData, pDstSize); } } -INT32 avc444_compress(H264_CONTEXT* h264, const BYTE* pSrcData, DWORD SrcFormat, - UINT32 nSrcStep, UINT32 nSrcWidth, UINT32 nSrcHeight, - BYTE version, BYTE* op, BYTE** ppDstData, UINT32* pDstSize, - BYTE** ppAuxDstData, UINT32* pAuxDstSize) +INT32 avc444_compress(H264_CONTEXT* h264, const BYTE* pSrcData, DWORD SrcFormat, UINT32 nSrcStep, + UINT32 nSrcWidth, UINT32 nSrcHeight, BYTE version, BYTE* op, BYTE** ppDstData, + UINT32* pDstSize, BYTE** ppAuxDstData, UINT32* pAuxDstSize) { prim_size_t roi; primitives_t* prims = primitives_get(); @@ -251,15 +244,17 @@ INT32 avc444_compress(H264_CONTEXT* h264, const BYTE* pSrcData, DWORD SrcFormat, switch (version) { case 1: - if (prims->RGBToAVC444YUV(pSrcData, SrcFormat, nSrcStep, h264->pYUV444Data, h264->iStride, - h264->pYUVData, h264->iStride, &roi) != PRIMITIVES_SUCCESS) + if (prims->RGBToAVC444YUV(pSrcData, SrcFormat, nSrcStep, h264->pYUV444Data, + h264->iStride, h264->pYUVData, h264->iStride, + &roi) != PRIMITIVES_SUCCESS) return -1; break; case 2: - if (prims->RGBToAVC444YUVv2(pSrcData, SrcFormat, nSrcStep, h264->pYUV444Data, h264->iStride, - h264->pYUVData, h264->iStride, &roi) != PRIMITIVES_SUCCESS) + if (prims->RGBToAVC444YUVv2(pSrcData, SrcFormat, nSrcStep, h264->pYUV444Data, + h264->iStride, h264->pYUVData, h264->iStride, + &roi) != PRIMITIVES_SUCCESS) return -1; break; @@ -269,7 +264,8 @@ INT32 avc444_compress(H264_CONTEXT* h264, const BYTE* pSrcData, DWORD SrcFormat, } { - const BYTE* pYUV444Data[3] = {h264->pYUV444Data[0], h264->pYUV444Data[1], h264->pYUV444Data[2]}; + const BYTE* pYUV444Data[3] = { h264->pYUV444Data[0], h264->pYUV444Data[1], + h264->pYUV444Data[2] }; if (h264->subsystem->Compress(h264, pYUV444Data, h264->iStride, &coded, &codedSize) < 0) return -1; @@ -279,7 +275,7 @@ INT32 avc444_compress(H264_CONTEXT* h264, const BYTE* pSrcData, DWORD SrcFormat, *ppDstData = h264->lumaData; *pDstSize = codedSize; { - const BYTE* pYUVData[3] = {h264->pYUVData[0], h264->pYUVData[1], h264->pYUVData[2]}; + const BYTE* pYUVData[3] = { h264->pYUVData[0], h264->pYUVData[1], h264->pYUVData[2] }; if (h264->subsystem->Compress(h264, pYUVData, h264->iStride, &coded, &codedSize) < 0) return -1; @@ -290,8 +286,7 @@ INT32 avc444_compress(H264_CONTEXT* h264, const BYTE* pSrcData, DWORD SrcFormat, return 0; } -static BOOL avc444_ensure_buffer(H264_CONTEXT* h264, - DWORD nDstHeight) +static BOOL avc444_ensure_buffer(H264_CONTEXT* h264, DWORD nDstHeight) { UINT32 x; const UINT32* piMainStride = h264->iStride; @@ -304,8 +299,7 @@ static BOOL avc444_ensure_buffer(H264_CONTEXT* h264, if (pad != 0) padDstHeight += 16 - pad; - if ((piMainStride[0] != piDstStride[0]) || - (piDstSize[0] != piMainStride[0] * padDstHeight)) + if ((piMainStride[0] != piDstStride[0]) || (piDstSize[0] != piMainStride[0] * padDstHeight)) { for (x = 0; x < 3; x++) { @@ -328,7 +322,8 @@ static BOOL avc444_ensure_buffer(H264_CONTEXT* h264, { if (!ppYUVDstData[x] || (piDstSize[x] == 0) || (piDstStride[x] == 0)) { - WLog_Print(h264->log, WLOG_ERROR, "YUV buffer not initialized! check your decoder settings"); + WLog_Print(h264->log, WLOG_ERROR, + "YUV buffer not initialized! check your decoder settings"); goto fail; } } @@ -349,11 +344,10 @@ fail: return FALSE; } -static BOOL avc444_process_rects(H264_CONTEXT* h264, const BYTE* pSrcData, - UINT32 SrcSize, BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, - UINT32 nDstWidth, UINT32 nDstHeight, - const RECTANGLE_16* rects, UINT32 nrRects, - avc444_frame_type type) +static BOOL avc444_process_rects(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSize, + BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, + UINT32 nDstWidth, UINT32 nDstHeight, const RECTANGLE_16* rects, + UINT32 nrRects, avc444_frame_type type) { const primitives_t* prims = primitives_get(); UINT32 x; @@ -371,21 +365,21 @@ static BOOL avc444_process_rects(H264_CONTEXT* h264, const BYTE* pSrcData, for (x = 0; x < nrRects; x++) { const RECTANGLE_16* rect = &rects[x]; - const UINT32 alignedWidth = h264->width + ((h264->width % 16 != 0) ? 16 - h264->width % 16 : 0); - const UINT32 alignedHeight = h264->height + ((h264->height % 16 != 0) ? 16 - h264->height % 16 : 0); + const UINT32 alignedWidth = + h264->width + ((h264->width % 16 != 0) ? 16 - h264->width % 16 : 0); + const UINT32 alignedHeight = + h264->height + ((h264->height % 16 != 0) ? 16 - h264->height % 16 : 0); if (!check_rect(h264, rect, nDstWidth, nDstHeight)) continue; - if (prims->YUV420CombineToYUV444(type, ppYUVData, piStride, - alignedWidth, alignedHeight, - ppYUVDstData, piDstStride, - rect) != PRIMITIVES_SUCCESS) + if (prims->YUV420CombineToYUV444(type, ppYUVData, piStride, alignedWidth, alignedHeight, + ppYUVDstData, piDstStride, rect) != PRIMITIVES_SUCCESS) return FALSE; } - if (!avc_yuv_to_rgb(h264, rects, nrRects, nDstWidth, - nDstHeight, nDstStep, pDstData, DstFormat, TRUE)) + if (!avc_yuv_to_rgb(h264, rects, nrRects, nDstWidth, nDstHeight, nDstStep, pDstData, DstFormat, + TRUE)) return FALSE; return TRUE; @@ -407,33 +401,30 @@ static double avg(UINT64* count, double old, double size) } #endif -INT32 avc444_decompress(H264_CONTEXT* h264, BYTE op, - RECTANGLE_16* regionRects, UINT32 numRegionRects, - const BYTE* pSrcData, UINT32 SrcSize, +INT32 avc444_decompress(H264_CONTEXT* h264, BYTE op, RECTANGLE_16* regionRects, + UINT32 numRegionRects, const BYTE* pSrcData, UINT32 SrcSize, RECTANGLE_16* auxRegionRects, UINT32 numAuxRegionRect, - const BYTE* pAuxSrcData, UINT32 AuxSrcSize, - BYTE* pDstData, DWORD DstFormat, - UINT32 nDstStep, UINT32 nDstWidth, UINT32 nDstHeight, - UINT32 codecId) + const BYTE* pAuxSrcData, UINT32 AuxSrcSize, BYTE* pDstData, DWORD DstFormat, + UINT32 nDstStep, UINT32 nDstWidth, UINT32 nDstHeight, UINT32 codecId) { INT32 status = -1; - avc444_frame_type chroma = (codecId == RDPGFX_CODECID_AVC444) ? AVC444_CHROMAv1 : AVC444_CHROMAv2; + avc444_frame_type chroma = + (codecId == RDPGFX_CODECID_AVC444) ? AVC444_CHROMAv1 : AVC444_CHROMAv2; - if (!h264 || !regionRects || - !pSrcData || !pDstData) + if (!h264 || !regionRects || !pSrcData || !pDstData) return -1001; switch (op) { case 0: /* YUV420 in stream 1 - * Chroma420 in stream 2 */ - if (!avc444_process_rects(h264, pSrcData, SrcSize, pDstData, DstFormat, nDstStep, nDstWidth, - nDstHeight, - regionRects, numRegionRects, AVC444_LUMA)) + * Chroma420 in stream 2 */ + if (!avc444_process_rects(h264, pSrcData, SrcSize, pDstData, DstFormat, nDstStep, + nDstWidth, nDstHeight, regionRects, numRegionRects, + AVC444_LUMA)) status = -1; - else if (!avc444_process_rects(h264, pAuxSrcData, AuxSrcSize, pDstData, DstFormat, nDstStep, - nDstWidth, nDstHeight, - auxRegionRects, numAuxRegionRect, chroma)) + else if (!avc444_process_rects(h264, pAuxSrcData, AuxSrcSize, pDstData, DstFormat, + nDstStep, nDstWidth, nDstHeight, auxRegionRects, + numAuxRegionRect, chroma)) status = -1; else status = 0; @@ -441,9 +432,8 @@ INT32 avc444_decompress(H264_CONTEXT* h264, BYTE op, break; case 2: /* Chroma420 in stream 1 */ - if (!avc444_process_rects(h264, pSrcData, SrcSize, pDstData, DstFormat, nDstStep, nDstWidth, - nDstHeight, - regionRects, numRegionRects, chroma)) + if (!avc444_process_rects(h264, pSrcData, SrcSize, pDstData, DstFormat, nDstStep, + nDstWidth, nDstHeight, regionRects, numRegionRects, chroma)) status = -1; else status = 0; @@ -451,9 +441,9 @@ INT32 avc444_decompress(H264_CONTEXT* h264, BYTE op, break; case 1: /* YUV420 in stream 1 */ - if (!avc444_process_rects(h264, pSrcData, SrcSize, pDstData, DstFormat, nDstStep, nDstWidth, - nDstHeight, - regionRects, numRegionRects, AVC444_LUMA)) + if (!avc444_process_rects(h264, pSrcData, SrcSize, pDstData, DstFormat, nDstStep, + nDstWidth, nDstHeight, regionRects, numRegionRects, + AVC444_LUMA)) status = -1; else status = 0; @@ -485,7 +475,8 @@ INT32 avc444_decompress(H264_CONTEXT* h264, BYTE op, } WLog_Print(h264->log, WLOG_INFO, - "luma=%"PRIu64" [avg=%lf] chroma=%"PRIu64" [avg=%lf] combined=%"PRIu64" [avg=%lf]", + "luma=%" PRIu64 " [avg=%lf] chroma=%" PRIu64 " [avg=%lf] combined=%" PRIu64 + " [avg=%lf]", op1, op1sum, op2, op2sum, op3, op3sum); #endif return status; @@ -533,7 +524,6 @@ static BOOL CALLBACK h264_register_subsystems(PINIT_ONCE once, PVOID param, PVOI return i > 0; } - BOOL h264_context_init(H264_CONTEXT* h264) { int i; @@ -579,7 +569,7 @@ BOOL h264_context_reset(H264_CONTEXT* h264, UINT32 width, UINT32 height) H264_CONTEXT* h264_context_new(BOOL Compressor) { H264_CONTEXT* h264; - h264 = (H264_CONTEXT*) calloc(1, sizeof(H264_CONTEXT)); + h264 = (H264_CONTEXT*)calloc(1, sizeof(H264_CONTEXT)); if (h264) { diff --git a/libfreerdp/codec/h264.h b/libfreerdp/codec/h264.h index f87d17ad2..32e9dbe77 100644 --- a/libfreerdp/codec/h264.h +++ b/libfreerdp/codec/h264.h @@ -24,8 +24,7 @@ #include #include -FREERDP_LOCAL BOOL avc420_ensure_buffer(H264_CONTEXT* h264, - UINT32 stride, UINT32 width, UINT32 height); +FREERDP_LOCAL BOOL avc420_ensure_buffer(H264_CONTEXT* h264, UINT32 stride, UINT32 width, + UINT32 height); #endif /* FREERDP_LIB_CODEC_H264_H */ - diff --git a/libfreerdp/codec/h264_ffmpeg.c b/libfreerdp/codec/h264_ffmpeg.c index 19faeb974..d347dcbde 100644 --- a/libfreerdp/codec/h264_ffmpeg.c +++ b/libfreerdp/codec/h264_ffmpeg.c @@ -32,7 +32,8 @@ #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(55, 9, 0) #include #else -#pragma warning You have asked for VA-API decoding, but your version of libavutil is too old! Disabling. +#pragma warning You have asked for VA - API decoding, \ + but your version of libavutil is too old !Disabling. #undef WITH_VAAPI #endif #endif @@ -61,8 +62,7 @@ static inline char* error_string(char* errbuf, size_t errbuf_size, int errnum) return errbuf; } -#define av_err2str(errnum) \ - error_string((char[64]){0}, 64, errnum) +#define av_err2str(errnum) error_string((char[64]){ 0 }, 64, errnum) #endif #ifdef WITH_VAAPI @@ -165,15 +165,9 @@ static BOOL libavcodec_create_encoder(H264_CONTEXT* h264) sys->codecEncoderContext->height = h264->height; sys->codecEncoderContext->delay = 0; #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 13, 100) - sys->codecEncoderContext->framerate = (AVRational) - { - h264->FrameRate, 1 - }; + sys->codecEncoderContext->framerate = (AVRational){ h264->FrameRate, 1 }; #endif - sys->codecEncoderContext->time_base = (AVRational) - { - 1, h264->FrameRate - }; + sys->codecEncoderContext->time_base = (AVRational){ 1, h264->FrameRate }; av_opt_set(sys->codecEncoderContext, "preset", "medium", AV_OPT_SEARCH_CHILDREN); av_opt_set(sys->codecEncoderContext, "tune", "zerolatency", AV_OPT_SEARCH_CHILDREN); sys->codecEncoderContext->flags |= AV_CODEC_FLAG_LOOP_FILTER; @@ -188,12 +182,11 @@ EXCEPTION: return FALSE; } -static int libavcodec_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, - UINT32 SrcSize) +static int libavcodec_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSize) { int status; int gotFrame = 0; - H264_CONTEXT_LIBAVCODEC* sys = (H264_CONTEXT_LIBAVCODEC*) h264->pSystemData; + H264_CONTEXT_LIBAVCODEC* sys = (H264_CONTEXT_LIBAVCODEC*)h264->pSystemData; BYTE** pYUVData = h264->pYUVData; UINT32* iStride = h264->iStride; av_init_packet(&sys->packet); @@ -219,8 +212,7 @@ static int libavcodec_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, #else status = avcodec_receive_frame(sys->codecDecoderContext, sys->videoFrame); #endif - } - while (status == AVERROR(EAGAIN)); + } while (status == AVERROR(EAGAIN)); gotFrame = (status == 0); #else @@ -229,8 +221,8 @@ static int libavcodec_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, sys->hwctx ? sys->hwVideoFrame : sys->videoFrame, &gotFrame, &sys->packet); #else - status = avcodec_decode_video2(sys->codecDecoderContext, sys->videoFrame, &gotFrame, - &sys->packet); + status = + avcodec_decode_video2(sys->codecDecoderContext, sys->videoFrame, &gotFrame, &sys->packet); #endif #endif @@ -297,7 +289,7 @@ static int libavcodec_compress(H264_CONTEXT* h264, const BYTE** pSrcYuv, const U { int status; int gotFrame = 0; - H264_CONTEXT_LIBAVCODEC* sys = (H264_CONTEXT_LIBAVCODEC*) h264->pSystemData; + H264_CONTEXT_LIBAVCODEC* sys = (H264_CONTEXT_LIBAVCODEC*)h264->pSystemData; if (!libavcodec_create_encoder(h264)) return -1; @@ -311,7 +303,7 @@ static int libavcodec_compress(H264_CONTEXT* h264, const BYTE** pSrcYuv, const U sys->packet.data = NULL; sys->packet.size = 0; sys->videoFrame->format = sys->codecEncoderContext->pix_fmt; - sys->videoFrame->width = sys->codecEncoderContext->width; + sys->videoFrame->width = sys->codecEncoderContext->width; sys->videoFrame->height = sys->codecEncoderContext->height; #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(52, 48, 100) sys->videoFrame->colorspace = AVCOL_SPC_BT709; @@ -337,8 +329,7 @@ static int libavcodec_compress(H264_CONTEXT* h264, const BYTE** pSrcYuv, const U return -1; } - status = avcodec_receive_packet(sys->codecEncoderContext, - &sys->packet); + status = avcodec_receive_packet(sys->codecEncoderContext, &sys->packet); if (status < 0) { @@ -352,24 +343,22 @@ static int libavcodec_compress(H264_CONTEXT* h264, const BYTE** pSrcYuv, const U do { - status = avcodec_encode_video2(sys->codecEncoderContext, - &sys->packet, - sys->videoFrame, &gotFrame); - } - while ((status >= 0) && (gotFrame == 0)); + status = avcodec_encode_video2(sys->codecEncoderContext, &sys->packet, sys->videoFrame, + &gotFrame); + } while ((status >= 0) && (gotFrame == 0)); #else - sys->packet.size = avpicture_get_size(sys->codecDecoderContext->pix_fmt, - sys->codecDecoderContext->width, - sys->codecDecoderContext->height); + sys->packet.size = + avpicture_get_size(sys->codecDecoderContext->pix_fmt, sys->codecDecoderContext->width, + sys->codecDecoderContext->height); sys->packet.data = av_malloc(sys->packet.size); if (!sys->packet.data) status = -1; else { - status = avcodec_encode_video(sys->codecDecoderContext, sys->packet.data, - sys->packet.size, sys->videoFrame); + status = avcodec_encode_video(sys->codecDecoderContext, sys->packet.data, sys->packet.size, + sys->videoFrame); } #endif @@ -386,7 +375,8 @@ static int libavcodec_compress(H264_CONTEXT* h264, const BYTE** pSrcYuv, const U if (!gotFrame) { - WLog_Print(h264->log, WLOG_ERROR, "Did not get frame! (%s [%d])", av_err2str(status), status); + WLog_Print(h264->log, WLOG_ERROR, "Did not get frame! (%s [%d])", av_err2str(status), + status); return -2; } @@ -395,7 +385,7 @@ static int libavcodec_compress(H264_CONTEXT* h264, const BYTE** pSrcYuv, const U static void libavcodec_uninit(H264_CONTEXT* h264) { - H264_CONTEXT_LIBAVCODEC* sys = (H264_CONTEXT_LIBAVCODEC*) h264->pSystemData; + H264_CONTEXT_LIBAVCODEC* sys = (H264_CONTEXT_LIBAVCODEC*)h264->pSystemData; if (!sys) return; @@ -455,10 +445,10 @@ static void libavcodec_uninit(H264_CONTEXT* h264) #ifdef WITH_VAAPI static enum AVPixelFormat libavcodec_get_format(struct AVCodecContext* ctx, - const enum AVPixelFormat* fmts) + const enum AVPixelFormat* fmts) { - H264_CONTEXT* h264 = (H264_CONTEXT*) ctx->opaque; - H264_CONTEXT_LIBAVCODEC* sys = (H264_CONTEXT_LIBAVCODEC*) h264->subsystem; + H264_CONTEXT* h264 = (H264_CONTEXT*)ctx->opaque; + H264_CONTEXT_LIBAVCODEC* sys = (H264_CONTEXT_LIBAVCODEC*)h264->subsystem; const enum AVPixelFormat* p; for (p = fmts; *p != AV_PIX_FMT_NONE; p++) @@ -474,12 +464,13 @@ static enum AVPixelFormat libavcodec_get_format(struct AVCodecContext* ctx, } sys->codecDecoderContext->pix_fmt = *p; - AVHWFramesContext* frames = (AVHWFramesContext*) sys->hw_frames_ctx->data; + AVHWFramesContext* frames = (AVHWFramesContext*)sys->hw_frames_ctx->data; frames->format = *p; frames->height = sys->codecDecoderContext->coded_height; frames->width = sys->codecDecoderContext->coded_width; - frames->sw_format = (sys->codecDecoderContext->sw_pix_fmt == AV_PIX_FMT_YUV420P10 ? - AV_PIX_FMT_P010 : AV_PIX_FMT_NV12); + frames->sw_format = + (sys->codecDecoderContext->sw_pix_fmt == AV_PIX_FMT_YUV420P10 ? AV_PIX_FMT_P010 + : AV_PIX_FMT_NV12); frames->initial_pool_size = 20; if (sys->codecDecoderContext->active_thread_type & FF_THREAD_FRAME) @@ -489,7 +480,8 @@ static enum AVPixelFormat libavcodec_get_format(struct AVCodecContext* ctx, if (err < 0) { - WLog_Print(h264->log, WLOG_ERROR, "Could not init hwframes context: %s", av_err2str(err)); + WLog_Print(h264->log, WLOG_ERROR, "Could not init hwframes context: %s", + av_err2str(err)); return AV_PIX_FMT_NONE; } @@ -506,14 +498,14 @@ static enum AVPixelFormat libavcodec_get_format(struct AVCodecContext* ctx, static BOOL libavcodec_init(H264_CONTEXT* h264) { H264_CONTEXT_LIBAVCODEC* sys; - sys = (H264_CONTEXT_LIBAVCODEC*) calloc(1, sizeof(H264_CONTEXT_LIBAVCODEC)); + sys = (H264_CONTEXT_LIBAVCODEC*)calloc(1, sizeof(H264_CONTEXT_LIBAVCODEC)); if (!sys) { goto EXCEPTION; } - h264->pSystemData = (void*) sys; + h264->pSystemData = (void*)sys; avcodec_register_all(); if (!h264->Compressor) @@ -543,7 +535,8 @@ static BOOL libavcodec_init(H264_CONTEXT* h264) if (!sys->hwctx) { - int ret = av_hwdevice_ctx_create(&sys->hwctx, AV_HWDEVICE_TYPE_VAAPI, VAAPI_DEVICE, NULL, 0); + int ret = + av_hwdevice_ctx_create(&sys->hwctx, AV_HWDEVICE_TYPE_VAAPI, VAAPI_DEVICE, NULL, 0); if (ret < 0) { @@ -560,7 +553,7 @@ static BOOL libavcodec_init(H264_CONTEXT* h264) #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 80, 100) sys->codecDecoderContext->hw_device_ctx = av_buffer_ref(sys->hwctx); #endif - sys->codecDecoderContext->opaque = (void*) h264; + sys->codecDecoderContext->opaque = (void*)h264; fail_hwdevice_create: #endif @@ -610,11 +603,5 @@ EXCEPTION: return FALSE; } -H264_CONTEXT_SUBSYSTEM g_Subsystem_libavcodec = -{ - "libavcodec", - libavcodec_init, - libavcodec_uninit, - libavcodec_decompress, - libavcodec_compress -}; +H264_CONTEXT_SUBSYSTEM g_Subsystem_libavcodec = { "libavcodec", libavcodec_init, libavcodec_uninit, + libavcodec_decompress, libavcodec_compress }; diff --git a/libfreerdp/codec/h264_mf.c b/libfreerdp/codec/h264_mf.c index dc9c43239..a5da42321 100644 --- a/libfreerdp/codec/h264_mf.c +++ b/libfreerdp/codec/h264_mf.c @@ -32,40 +32,57 @@ #define TAG FREERDP_TAG("codec") -static const GUID sCLSID_CMSH264DecoderMFT = { 0x62CE7E72, 0x4C71, 0x4d20, { 0xB1, 0x5D, - 0x45, 0x28, 0x31, 0xA8, 0x7D, 0x9D } }; -static const GUID sCLSID_VideoProcessorMFT = { 0x88753b26, 0x5b24, 0x49bd, { 0xb2, 0xe7, - 0x0c, 0x44, 0x5c, 0x78, 0xc9, 0x82 } }; -static const GUID sIID_IMFTransform = { 0xbf94c121, 0x5b05, 0x4e6f, { 0x80, 0x00, 0xba, - 0x59, 0x89, 0x61, 0x41, 0x4d } }; -static const GUID sMF_MT_MAJOR_TYPE = { 0x48eba18e, 0xf8c9, 0x4687, { 0xbf, 0x11, 0x0a, - 0x74, 0xc9, 0xf9, 0x6a, 0x8f } }; -static const GUID sMF_MT_FRAME_SIZE = { 0x1652c33d, 0xd6b2, 0x4012, { 0xb8, 0x34, 0x72, - 0x03, 0x08, 0x49, 0xa3, 0x7d } }; -static const GUID sMF_MT_DEFAULT_STRIDE = { 0x644b4e48, 0x1e02, 0x4516, { 0xb0, 0xeb, 0xc0, - 0x1c, 0xa9, 0xd4, 0x9a, 0xc6 } }; -static const GUID sMF_MT_SUBTYPE = { 0xf7e34c9a, 0x42e8, 0x4714, { 0xb7, 0x4b, 0xcb, 0x29, - 0xd7, 0x2c, 0x35, 0xe5 } }; -static const GUID sMF_XVP_DISABLE_FRC = { 0x2c0afa19, 0x7a97, 0x4d5a, { 0x9e, 0xe8, 0x16, - 0xd4, 0xfc, 0x51, 0x8d, 0x8c } }; -static const GUID sMFMediaType_Video = { 0x73646976, 0x0000, 0x0010, { 0x80, 0x00, 0x00, - 0xAA, 0x00, 0x38, 0x9B, 0x71 } }; -static const GUID sMFVideoFormat_RGB32 = { 22, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, - 0x00, 0x38, 0x9B, 0x71 } }; -static const GUID sMFVideoFormat_ARGB32 = { 21, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, - 0x00, 0x38, 0x9B, 0x71 } }; -static const GUID sMFVideoFormat_H264 = { 0x34363248, 0x0000, 0x0010, { 0x80, 0x00, 0x00, - 0xaa, 0x00, 0x38, 0x9b, 0x71 } }; -static const GUID sMFVideoFormat_IYUV = { 0x56555949, 0x0000, 0x0010, { 0x80, 0x00, 0x00, - 0xaa, 0x00, 0x38, 0x9b, 0x71 } }; -static const GUID sIID_ICodecAPI = { 0x901db4c7, 0x31ce, 0x41a2, { 0x85, 0xdc, 0x8f, 0xa0, - 0xbf, 0x41, 0xb8, 0xda } }; -static const GUID sCODECAPI_AVLowLatencyMode = { 0x9c27891a, 0xed7a, 0x40e1, { 0x88, 0xe8, - 0xb2, 0x27, 0x27, 0xa0, 0x24, 0xee } }; -static const GUID sCODECAPI_AVDecVideoMaxCodedWidth = { 0x5ae557b8, 0x77af, 0x41f5, { 0x9f, - 0xa6, 0x4d, 0xb2, 0xfe, 0x1d, 0x4b, 0xca } }; -static const GUID sCODECAPI_AVDecVideoMaxCodedHeight = { 0x7262a16a, 0xd2dc, 0x4e75, { 0x9b, - 0xa8, 0x65, 0xc0, 0xc6, 0xd3, 0x2b, 0x13 } }; +static const GUID sCLSID_CMSH264DecoderMFT = { + 0x62CE7E72, 0x4C71, 0x4d20, { 0xB1, 0x5D, 0x45, 0x28, 0x31, 0xA8, 0x7D, 0x9D } +}; +static const GUID sCLSID_VideoProcessorMFT = { + 0x88753b26, 0x5b24, 0x49bd, { 0xb2, 0xe7, 0x0c, 0x44, 0x5c, 0x78, 0xc9, 0x82 } +}; +static const GUID sIID_IMFTransform = { + 0xbf94c121, 0x5b05, 0x4e6f, { 0x80, 0x00, 0xba, 0x59, 0x89, 0x61, 0x41, 0x4d } +}; +static const GUID sMF_MT_MAJOR_TYPE = { + 0x48eba18e, 0xf8c9, 0x4687, { 0xbf, 0x11, 0x0a, 0x74, 0xc9, 0xf9, 0x6a, 0x8f } +}; +static const GUID sMF_MT_FRAME_SIZE = { + 0x1652c33d, 0xd6b2, 0x4012, { 0xb8, 0x34, 0x72, 0x03, 0x08, 0x49, 0xa3, 0x7d } +}; +static const GUID sMF_MT_DEFAULT_STRIDE = { + 0x644b4e48, 0x1e02, 0x4516, { 0xb0, 0xeb, 0xc0, 0x1c, 0xa9, 0xd4, 0x9a, 0xc6 } +}; +static const GUID sMF_MT_SUBTYPE = { + 0xf7e34c9a, 0x42e8, 0x4714, { 0xb7, 0x4b, 0xcb, 0x29, 0xd7, 0x2c, 0x35, 0xe5 } +}; +static const GUID sMF_XVP_DISABLE_FRC = { + 0x2c0afa19, 0x7a97, 0x4d5a, { 0x9e, 0xe8, 0x16, 0xd4, 0xfc, 0x51, 0x8d, 0x8c } +}; +static const GUID sMFMediaType_Video = { + 0x73646976, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } +}; +static const GUID sMFVideoFormat_RGB32 = { + 22, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } +}; +static const GUID sMFVideoFormat_ARGB32 = { + 21, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } +}; +static const GUID sMFVideoFormat_H264 = { + 0x34363248, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } +}; +static const GUID sMFVideoFormat_IYUV = { + 0x56555949, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } +}; +static const GUID sIID_ICodecAPI = { + 0x901db4c7, 0x31ce, 0x41a2, { 0x85, 0xdc, 0x8f, 0xa0, 0xbf, 0x41, 0xb8, 0xda } +}; +static const GUID sCODECAPI_AVLowLatencyMode = { + 0x9c27891a, 0xed7a, 0x40e1, { 0x88, 0xe8, 0xb2, 0x27, 0x27, 0xa0, 0x24, 0xee } +}; +static const GUID sCODECAPI_AVDecVideoMaxCodedWidth = { + 0x5ae557b8, 0x77af, 0x41f5, { 0x9f, 0xa6, 0x4d, 0xb2, 0xfe, 0x1d, 0x4b, 0xca } +}; +static const GUID sCODECAPI_AVDecVideoMaxCodedHeight = { + 0x7262a16a, 0xd2dc, 0x4e75, { 0x9b, 0xa8, 0x65, 0xc0, 0xc6, 0xd3, 0x2b, 0x13 } +}; #ifndef __IMFDXGIDeviceManager_FWD_DEFINED__ #define __IMFDXGIDeviceManager_FWD_DEFINED__ @@ -77,26 +94,22 @@ typedef interface IMFDXGIDeviceManager IMFDXGIDeviceManager; typedef struct IMFDXGIDeviceManagerVtbl { - HRESULT(STDMETHODCALLTYPE* QueryInterface)(IMFDXGIDeviceManager* This, - REFIID riid, void** ppvObject); + HRESULT(STDMETHODCALLTYPE* QueryInterface) + (IMFDXGIDeviceManager* This, REFIID riid, void** ppvObject); ULONG(STDMETHODCALLTYPE* AddRef)(IMFDXGIDeviceManager* This); ULONG(STDMETHODCALLTYPE* Release)(IMFDXGIDeviceManager* This); - HRESULT(STDMETHODCALLTYPE* CloseDeviceHandle)(IMFDXGIDeviceManager* This, - HANDLE hDevice); - HRESULT(STDMETHODCALLTYPE* GetVideoService)(IMFDXGIDeviceManager* This, - HANDLE hDevice, REFIID riid, void** ppService); - HRESULT(STDMETHODCALLTYPE* LockDevice)(IMFDXGIDeviceManager* This, - HANDLE hDevice, REFIID riid, void** ppUnkDevice, BOOL fBlock); - HRESULT(STDMETHODCALLTYPE* OpenDeviceHandle)(IMFDXGIDeviceManager* This, - HANDLE* phDevice); - HRESULT(STDMETHODCALLTYPE* ResetDevice)(IMFDXGIDeviceManager* This, - IUnknown* pUnkDevice, UINT resetToken); - HRESULT(STDMETHODCALLTYPE* TestDevice)(IMFDXGIDeviceManager* This, - HANDLE hDevice); - HRESULT(STDMETHODCALLTYPE* UnlockDevice)(IMFDXGIDeviceManager* This, - HANDLE hDevice, BOOL fSaveState); -} -IMFDXGIDeviceManagerVtbl; + HRESULT(STDMETHODCALLTYPE* CloseDeviceHandle)(IMFDXGIDeviceManager* This, HANDLE hDevice); + HRESULT(STDMETHODCALLTYPE* GetVideoService) + (IMFDXGIDeviceManager* This, HANDLE hDevice, REFIID riid, void** ppService); + HRESULT(STDMETHODCALLTYPE* LockDevice) + (IMFDXGIDeviceManager* This, HANDLE hDevice, REFIID riid, void** ppUnkDevice, BOOL fBlock); + HRESULT(STDMETHODCALLTYPE* OpenDeviceHandle)(IMFDXGIDeviceManager* This, HANDLE* phDevice); + HRESULT(STDMETHODCALLTYPE* ResetDevice) + (IMFDXGIDeviceManager* This, IUnknown* pUnkDevice, UINT resetToken); + HRESULT(STDMETHODCALLTYPE* TestDevice)(IMFDXGIDeviceManager* This, HANDLE hDevice); + HRESULT(STDMETHODCALLTYPE* UnlockDevice) + (IMFDXGIDeviceManager* This, HANDLE hDevice, BOOL fSaveState); +} IMFDXGIDeviceManagerVtbl; interface IMFDXGIDeviceManager { @@ -108,8 +121,7 @@ interface IMFDXGIDeviceManager typedef HRESULT(__stdcall* pfnMFStartup)(ULONG Version, DWORD dwFlags); typedef HRESULT(__stdcall* pfnMFShutdown)(void); typedef HRESULT(__stdcall* pfnMFCreateSample)(IMFSample** ppIMFSample); -typedef HRESULT(__stdcall* pfnMFCreateMemoryBuffer)(DWORD cbMaxLength, - IMFMediaBuffer** ppBuffer); +typedef HRESULT(__stdcall* pfnMFCreateMemoryBuffer)(DWORD cbMaxLength, IMFMediaBuffer** ppBuffer); typedef HRESULT(__stdcall* pfnMFCreateMediaType)(IMFMediaType** ppMFType); struct _H264_CONTEXT_MF @@ -142,8 +154,7 @@ static HRESULT mf_find_output_type(H264_CONTEXT_MF* sys, const GUID* guid, while (1) { - hr = sys->transform->lpVtbl->GetOutputAvailableType(sys->transform, 0, idx, - &pMediaType); + hr = sys->transform->lpVtbl->GetOutputAvailableType(sys->transform, 0, idx, &pMediaType); if (FAILED(hr)) break; @@ -178,16 +189,15 @@ static HRESULT mf_create_output_sample(H264_CONTEXT* h264, H264_CONTEXT_MF* sys) if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "MFCreateSample failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "MFCreateSample failure: 0x%08" PRIX32 "", hr); goto error; } - hr = sys->transform->lpVtbl->GetOutputStreamInfo(sys->transform, 0, - &streamInfo); + hr = sys->transform->lpVtbl->GetOutputStreamInfo(sys->transform, 0, &streamInfo); if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "GetOutputStreamInfo failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "GetOutputStreamInfo failure: 0x%08" PRIX32 "", hr); goto error; } @@ -195,7 +205,7 @@ static HRESULT mf_create_output_sample(H264_CONTEXT* h264, H264_CONTEXT_MF* sys) if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "MFCreateMemoryBuffer failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "MFCreateMemoryBuffer failure: 0x%08" PRIX32 "", hr); goto error; } @@ -203,7 +213,7 @@ static HRESULT mf_create_output_sample(H264_CONTEXT* h264, H264_CONTEXT_MF* sys) if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "AddBuffer failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "AddBuffer failure: 0x%08" PRIX32 "", hr); goto error; } @@ -223,23 +233,22 @@ static int mf_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSiz IMFMediaBuffer* inputBuffer = NULL; IMFMediaBuffer* outputBuffer = NULL; MFT_OUTPUT_DATA_BUFFER outputDataBuffer; - H264_CONTEXT_MF* sys = (H264_CONTEXT_MF*) h264->pSystemData; + H264_CONTEXT_MF* sys = (H264_CONTEXT_MF*)h264->pSystemData; INT32* iStride = h264->iStride; BYTE** pYUVData = h264->pYUVData; hr = sys->MFCreateMemoryBuffer(SrcSize, &inputBuffer); if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "MFCreateMemoryBuffer failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "MFCreateMemoryBuffer failure: 0x%08" PRIX32 "", hr); goto error; } - hr = inputBuffer->lpVtbl->Lock(inputBuffer, &pbBuffer, &cbMaxLength, - &cbCurrentLength); + hr = inputBuffer->lpVtbl->Lock(inputBuffer, &pbBuffer, &cbMaxLength, &cbCurrentLength); if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "Lock failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "Lock failure: 0x%08" PRIX32 "", hr); goto error; } @@ -248,7 +257,7 @@ static int mf_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSiz if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "SetCurrentLength failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "SetCurrentLength failure: 0x%08" PRIX32 "", hr); goto error; } @@ -256,7 +265,7 @@ static int mf_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSiz if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "Unlock failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "Unlock failure: 0x%08" PRIX32 "", hr); goto error; } @@ -264,7 +273,7 @@ static int mf_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSiz if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "MFCreateSample failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "MFCreateSample failure: 0x%08" PRIX32 "", hr); goto error; } @@ -272,7 +281,7 @@ static int mf_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSiz if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "AddBuffer failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "AddBuffer failure: 0x%08" PRIX32 "", hr); goto error; } @@ -281,7 +290,7 @@ static int mf_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSiz if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "ProcessInput failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "ProcessInput failure: 0x%08" PRIX32 "", hr); goto error; } @@ -289,7 +298,7 @@ static int mf_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSiz if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "mf_create_output_sample failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "mf_create_output_sample failure: 0x%08" PRIX32 "", hr); goto error; } @@ -297,8 +306,8 @@ static int mf_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSiz outputDataBuffer.dwStatus = 0; outputDataBuffer.pEvents = NULL; outputDataBuffer.pSample = sys->outputSample; - hr = sys->transform->lpVtbl->ProcessOutput(sys->transform, 0, 1, - &outputDataBuffer, &outputStatus); + hr = sys->transform->lpVtbl->ProcessOutput(sys->transform, 0, 1, &outputDataBuffer, + &outputStatus); if (hr == MF_E_TRANSFORM_STREAM_CHANGE) { @@ -315,16 +324,15 @@ static int mf_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSiz if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "mf_find_output_type failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "mf_find_output_type failure: 0x%08" PRIX32 "", hr); goto error; } - hr = sys->transform->lpVtbl->SetOutputType(sys->transform, 0, sys->outputType, - 0); + hr = sys->transform->lpVtbl->SetOutputType(sys->transform, 0, sys->outputType, 0); if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "SetOutputType failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "SetOutputType failure: 0x%08" PRIX32 "", hr); goto error; } @@ -332,27 +340,28 @@ static int mf_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSiz if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "mf_create_output_sample failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "mf_create_output_sample failure: 0x%08" PRIX32 "", + hr); goto error; } - hr = sys->outputType->lpVtbl->GetUINT64(sys->outputType, &sMF_MT_FRAME_SIZE, - &frameSize); + hr = sys->outputType->lpVtbl->GetUINT64(sys->outputType, &sMF_MT_FRAME_SIZE, &frameSize); if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "GetUINT64(MF_MT_FRAME_SIZE) failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, + "GetUINT64(MF_MT_FRAME_SIZE) failure: 0x%08" PRIX32 "", hr); goto error; } sys->frameWidth = (UINT32)(frameSize >> 32); - sys->frameHeight = (UINT32) frameSize; - hr = sys->outputType->lpVtbl->GetUINT32(sys->outputType, &sMF_MT_DEFAULT_STRIDE, - &stride); + sys->frameHeight = (UINT32)frameSize; + hr = sys->outputType->lpVtbl->GetUINT32(sys->outputType, &sMF_MT_DEFAULT_STRIDE, &stride); if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "GetUINT32(MF_MT_DEFAULT_STRIDE) failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, + "GetUINT32(MF_MT_DEFAULT_STRIDE) failure: 0x%08" PRIX32 "", hr); goto error; } @@ -364,7 +373,7 @@ static int mf_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSiz } else if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "ProcessOutput failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "ProcessOutput failure: 0x%08" PRIX32 "", hr); goto error; } else @@ -378,25 +387,23 @@ static int mf_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSiz if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "GetBufferCount failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "GetBufferCount failure: 0x%08" PRIX32 "", hr); goto error; } - hr = sys->outputSample->lpVtbl->GetBufferByIndex(sys->outputSample, 0, - &outputBuffer); + hr = sys->outputSample->lpVtbl->GetBufferByIndex(sys->outputSample, 0, &outputBuffer); if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "GetBufferByIndex failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "GetBufferByIndex failure: 0x%08" PRIX32 "", hr); goto error; } - hr = outputBuffer->lpVtbl->Lock(outputBuffer, &buffer, &cbMaxLength, - &cbCurrentLength); + hr = outputBuffer->lpVtbl->Lock(outputBuffer, &buffer, &cbMaxLength, &cbCurrentLength); if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "Lock failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "Lock failure: 0x%08" PRIX32 "", hr); goto error; } @@ -410,7 +417,7 @@ static int mf_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSiz if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "Unlock failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "Unlock failure: 0x%08" PRIX32 "", hr); goto error; } @@ -427,20 +434,20 @@ error: static int mf_compress(H264_CONTEXT* h264, const BYTE** ppSrcYuv, const UINT32* pStride, BYTE** ppDstData, UINT32* pDstSize) { - H264_CONTEXT_MF* sys = (H264_CONTEXT_MF*) h264->pSystemData; + H264_CONTEXT_MF* sys = (H264_CONTEXT_MF*)h264->pSystemData; return 1; } static BOOL mf_plat_loaded(H264_CONTEXT_MF* sys) { - return sys->MFStartup && sys->MFShutdown && sys->MFCreateSample - && sys->MFCreateMemoryBuffer && sys->MFCreateMediaType; + return sys->MFStartup && sys->MFShutdown && sys->MFCreateSample && sys->MFCreateMemoryBuffer && + sys->MFCreateMediaType; } static void mf_uninit(H264_CONTEXT* h264) { UINT32 x; - H264_CONTEXT_MF* sys = (H264_CONTEXT_MF*) h264->pSystemData; + H264_CONTEXT_MF* sys = (H264_CONTEXT_MF*)h264->pSystemData; if (sys) { @@ -491,7 +498,7 @@ static void mf_uninit(H264_CONTEXT* h264) memset(h264->pYUVData, 0, sizeof(h264->pYUVData)); memset(h264->iStride, 0, sizeof(h264->iStride)); - + free(sys); h264->pSystemData = NULL; } @@ -500,26 +507,25 @@ static void mf_uninit(H264_CONTEXT* h264) static BOOL mf_init(H264_CONTEXT* h264) { HRESULT hr; - H264_CONTEXT_MF* sys = (H264_CONTEXT_MF*) calloc(1, sizeof(H264_CONTEXT_MF)); + H264_CONTEXT_MF* sys = (H264_CONTEXT_MF*)calloc(1, sizeof(H264_CONTEXT_MF)); if (!sys) goto error; - h264->pSystemData = (void*) sys; - /* http://decklink-sdk-delphi.googlecode.com/svn/trunk/Blackmagic%20DeckLink%20SDK%209.7/Win/Samples/Streaming/StreamingPreview/DecoderMF.cpp */ + h264->pSystemData = (void*)sys; + /* http://decklink-sdk-delphi.googlecode.com/svn/trunk/Blackmagic%20DeckLink%20SDK%209.7/Win/Samples/Streaming/StreamingPreview/DecoderMF.cpp + */ sys->mfplat = LoadLibraryA("mfplat.dll"); if (!sys->mfplat) goto error; - sys->MFStartup = (pfnMFStartup) GetProcAddress(sys->mfplat, "MFStartup"); - sys->MFShutdown = (pfnMFShutdown) GetProcAddress(sys->mfplat, "MFShutdown"); - sys->MFCreateSample = (pfnMFCreateSample) GetProcAddress(sys->mfplat, - "MFCreateSample"); - sys->MFCreateMemoryBuffer = (pfnMFCreateMemoryBuffer) GetProcAddress( - sys->mfplat, "MFCreateMemoryBuffer"); - sys->MFCreateMediaType = (pfnMFCreateMediaType) GetProcAddress(sys->mfplat, - "MFCreateMediaType"); + sys->MFStartup = (pfnMFStartup)GetProcAddress(sys->mfplat, "MFStartup"); + sys->MFShutdown = (pfnMFShutdown)GetProcAddress(sys->mfplat, "MFShutdown"); + sys->MFCreateSample = (pfnMFCreateSample)GetProcAddress(sys->mfplat, "MFCreateSample"); + sys->MFCreateMemoryBuffer = + (pfnMFCreateMemoryBuffer)GetProcAddress(sys->mfplat, "MFCreateMemoryBuffer"); + sys->MFCreateMediaType = (pfnMFCreateMediaType)GetProcAddress(sys->mfplat, "MFCreateMediaType"); if (!mf_plat_loaded(sys)) goto error; @@ -536,37 +542,38 @@ static BOOL mf_init(H264_CONTEXT* h264) if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "MFStartup failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "MFStartup failure: 0x%08" PRIX32 "", hr); goto error; } hr = CoCreateInstance(&sCLSID_CMSH264DecoderMFT, NULL, CLSCTX_INPROC_SERVER, - &sIID_IMFTransform, (void**) &sys->transform); + &sIID_IMFTransform, (void**)&sys->transform); if (FAILED(hr)) { WLog_Print(h264->log, WLOG_ERROR, - "CoCreateInstance(CLSID_CMSH264DecoderMFT) failure: 0x%08"PRIX32"", hr); + "CoCreateInstance(CLSID_CMSH264DecoderMFT) failure: 0x%08" PRIX32 "", hr); goto error; } hr = sys->transform->lpVtbl->QueryInterface(sys->transform, &sIID_ICodecAPI, - (void**) &sys->codecApi); + (void**)&sys->codecApi); if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "QueryInterface(IID_ICodecAPI) failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, + "QueryInterface(IID_ICodecAPI) failure: 0x%08" PRIX32 "", hr); goto error; } var.vt = VT_UI4; var.ulVal = 1; - hr = sys->codecApi->lpVtbl->SetValue(sys->codecApi, &sCODECAPI_AVLowLatencyMode, - &var); + hr = sys->codecApi->lpVtbl->SetValue(sys->codecApi, &sCODECAPI_AVLowLatencyMode, &var); if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "SetValue(CODECAPI_AVLowLatencyMode) failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, + "SetValue(CODECAPI_AVLowLatencyMode) failure: 0x%08" PRIX32 "", hr); goto error; } @@ -574,7 +581,7 @@ static BOOL mf_init(H264_CONTEXT* h264) if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "MFCreateMediaType failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "MFCreateMediaType failure: 0x%08" PRIX32 "", hr); goto error; } @@ -583,16 +590,17 @@ static BOOL mf_init(H264_CONTEXT* h264) if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "SetGUID(MF_MT_MAJOR_TYPE) failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "SetGUID(MF_MT_MAJOR_TYPE) failure: 0x%08" PRIX32 "", + hr); goto error; } - hr = sys->inputType->lpVtbl->SetGUID(sys->inputType, &sMF_MT_SUBTYPE, - &sMFVideoFormat_H264); + hr = sys->inputType->lpVtbl->SetGUID(sys->inputType, &sMF_MT_SUBTYPE, &sMFVideoFormat_H264); if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "SetGUID(MF_MT_SUBTYPE) failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "SetGUID(MF_MT_SUBTYPE) failure: 0x%08" PRIX32 "", + hr); goto error; } @@ -600,7 +608,7 @@ static BOOL mf_init(H264_CONTEXT* h264) if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "SetInputType failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "SetInputType failure: 0x%08" PRIX32 "", hr); goto error; } @@ -608,16 +616,15 @@ static BOOL mf_init(H264_CONTEXT* h264) if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "mf_find_output_type failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "mf_find_output_type failure: 0x%08" PRIX32 "", hr); goto error; } - hr = sys->transform->lpVtbl->SetOutputType(sys->transform, 0, sys->outputType, - 0); + hr = sys->transform->lpVtbl->SetOutputType(sys->transform, 0, sys->outputType, 0); if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "SetOutputType failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "SetOutputType failure: 0x%08" PRIX32 "", hr); goto error; } @@ -625,7 +632,8 @@ static BOOL mf_init(H264_CONTEXT* h264) if (FAILED(hr)) { - WLog_Print(h264->log, WLOG_ERROR, "mf_create_output_sample failure: 0x%08"PRIX32"", hr); + WLog_Print(h264->log, WLOG_ERROR, "mf_create_output_sample failure: 0x%08" PRIX32 "", + hr); goto error; } } @@ -637,12 +645,5 @@ error: return FALSE; } -H264_CONTEXT_SUBSYSTEM g_Subsystem_MF = -{ - "MediaFoundation", - mf_init, - mf_uninit, - mf_decompress, - mf_compress -}; - +H264_CONTEXT_SUBSYSTEM g_Subsystem_MF = { "MediaFoundation", mf_init, mf_uninit, mf_decompress, + mf_compress }; diff --git a/libfreerdp/codec/h264_openh264.c b/libfreerdp/codec/h264_openh264.c index aa1256eef..5321f30ec 100644 --- a/libfreerdp/codec/h264_openh264.c +++ b/libfreerdp/codec/h264_openh264.c @@ -40,7 +40,7 @@ typedef void (*pWelsDestroySVCEncoder)(ISVCEncoder* pEncoder); struct _H264_CONTEXT_OPENH264 { -#if defined (WITH_OPENH264_LOADING) +#if defined(WITH_OPENH264_LOADING) HMODULE lib; OpenH264Version version; #endif @@ -55,9 +55,8 @@ struct _H264_CONTEXT_OPENH264 }; typedef struct _H264_CONTEXT_OPENH264 H264_CONTEXT_OPENH264; -#if defined (WITH_OPENH264_LOADING) -static const char* openh264_library_names[] = -{ +#if defined(WITH_OPENH264_LOADING) +static const char* openh264_library_names[] = { #if defined(_WIN32) "openh264.dll" #elif defined(__APPLE__) @@ -68,20 +67,18 @@ static const char* openh264_library_names[] = }; #endif -static void openh264_trace_callback(H264_CONTEXT* h264, int level, - const char* message) +static void openh264_trace_callback(H264_CONTEXT* h264, int level, const char* message) { if (h264) WLog_Print(h264->log, WLOG_TRACE, "%d - %s", level, message); } -static int openh264_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, - UINT32 SrcSize) +static int openh264_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSize) { DECODING_STATE state; SBufferInfo sBufferInfo; SSysMEMBuffer* pSystemBuffer; - H264_CONTEXT_OPENH264* sys = (H264_CONTEXT_OPENH264*) h264->pSystemData; + H264_CONTEXT_OPENH264* sys = (H264_CONTEXT_OPENH264*)h264->pSystemData; UINT32* iStride = h264->iStride; BYTE** pYUVData = h264->pYUVData; @@ -95,22 +92,20 @@ static int openh264_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, pYUVData[1] = NULL; pYUVData[2] = NULL; ZeroMemory(&sBufferInfo, sizeof(sBufferInfo)); - state = (*sys->pDecoder)->DecodeFrame2(sys->pDecoder, pSrcData, SrcSize, - pYUVData, &sBufferInfo); + state = + (*sys->pDecoder)->DecodeFrame2(sys->pDecoder, pSrcData, SrcSize, pYUVData, &sBufferInfo); if (sBufferInfo.iBufferStatus != 1) { if (state == dsNoParamSets) { /* this happens on the first frame due to missing parameter sets */ - state = (*sys->pDecoder)->DecodeFrame2(sys->pDecoder, NULL, 0, pYUVData, - &sBufferInfo); + state = (*sys->pDecoder)->DecodeFrame2(sys->pDecoder, NULL, 0, pYUVData, &sBufferInfo); } else if (state == dsErrorFree) { /* call DecodeFrame2 again to decode without delay */ - state = (*sys->pDecoder)->DecodeFrame2(sys->pDecoder, NULL, 0, pYUVData, - &sBufferInfo); + state = (*sys->pDecoder)->DecodeFrame2(sys->pDecoder, NULL, 0, pYUVData, &sBufferInfo); } else { @@ -127,7 +122,8 @@ static int openh264_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, if (sBufferInfo.iBufferStatus != 1) { - WLog_Print(h264->log, WLOG_WARN, "DecodeFrame2 iBufferStatus: %d", sBufferInfo.iBufferStatus); + WLog_Print(h264->log, WLOG_WARN, "DecodeFrame2 iBufferStatus: %d", + sBufferInfo.iBufferStatus); return 0; } @@ -163,7 +159,7 @@ static int openh264_compress(H264_CONTEXT* h264, const BYTE** pYUVData, const UI SSourcePicture pic; SBitrateInfo bitrate; H264_CONTEXT_OPENH264* sys; - sys = &((H264_CONTEXT_OPENH264*) h264->pSystemData)[0]; + sys = &((H264_CONTEXT_OPENH264*)h264->pSystemData)[0]; if (!sys->pEncoder) return -1; @@ -175,17 +171,18 @@ static int openh264_compress(H264_CONTEXT* h264, const BYTE** pYUVData, const UI return -1; if ((h264->FrameRate > INT_MAX) || (h264->NumberOfThreads > INT_MAX) || - (h264->BitRate > INT_MAX) || (h264->QP > INT_MAX)) + (h264->BitRate > INT_MAX) || (h264->QP > INT_MAX)) return -1; - if ((sys->EncParamExt.iPicWidth != (int)h264->width) - || (sys->EncParamExt.iPicHeight != (int)h264->height)) + if ((sys->EncParamExt.iPicWidth != (int)h264->width) || + (sys->EncParamExt.iPicHeight != (int)h264->height)) { status = (*sys->pEncoder)->GetDefaultParams(sys->pEncoder, &sys->EncParamExt); if (status < 0) { - WLog_Print(h264->log, WLOG_ERROR, "Failed to get OpenH264 default parameters (status=%d)", status); + WLog_Print(h264->log, WLOG_ERROR, + "Failed to get OpenH264 default parameters (status=%d)", status); return status; } @@ -202,8 +199,7 @@ static int openh264_compress(H264_CONTEXT* h264, const BYTE** pYUVData, const UI sys->EncParamExt.sSpatialLayers[0].fFrameRate = h264->FrameRate; sys->EncParamExt.sSpatialLayers[0].iVideoWidth = sys->EncParamExt.iPicWidth; sys->EncParamExt.sSpatialLayers[0].iVideoHeight = sys->EncParamExt.iPicHeight; - sys->EncParamExt.sSpatialLayers[0].iMaxSpatialBitrate = - sys->EncParamExt.iMaxBitrate; + sys->EncParamExt.sSpatialLayers[0].iMaxSpatialBitrate = sys->EncParamExt.iMaxBitrate; switch (h264->RateControlMode) { @@ -233,18 +229,19 @@ static int openh264_compress(H264_CONTEXT* h264, const BYTE** pYUVData, const UI if (status < 0) { - WLog_Print(h264->log, WLOG_ERROR, "Failed to initialize OpenH264 encoder (status=%d)", status); + WLog_Print(h264->log, WLOG_ERROR, "Failed to initialize OpenH264 encoder (status=%d)", + status); return status; } - status = (*sys->pEncoder)->GetOption(sys->pEncoder, - ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, - &sys->EncParamExt); + status = + (*sys->pEncoder) + ->GetOption(sys->pEncoder, ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sys->EncParamExt); if (status < 0) { - WLog_Print(h264->log, WLOG_ERROR, "Failed to get initial OpenH264 encoder parameters (status=%d)", - status); + WLog_Print(h264->log, WLOG_ERROR, + "Failed to get initial OpenH264 encoder parameters (status=%d)", status); return status; } } @@ -258,12 +255,13 @@ static int openh264_compress(H264_CONTEXT* h264, const BYTE** pYUVData, const UI sys->EncParamExt.iTargetBitrate = (int)h264->BitRate; bitrate.iLayer = SPATIAL_LAYER_ALL; bitrate.iBitrate = (int)h264->BitRate; - status = (*sys->pEncoder)->SetOption(sys->pEncoder, ENCODER_OPTION_BITRATE, - &bitrate); + status = (*sys->pEncoder) + ->SetOption(sys->pEncoder, ENCODER_OPTION_BITRATE, &bitrate); if (status < 0) { - WLog_Print(h264->log, WLOG_ERROR, "Failed to set encoder bitrate (status=%d)", status); + WLog_Print(h264->log, WLOG_ERROR, + "Failed to set encoder bitrate (status=%d)", status); return status; } } @@ -271,12 +269,14 @@ static int openh264_compress(H264_CONTEXT* h264, const BYTE** pYUVData, const UI if (sys->EncParamExt.fMaxFrameRate != (int)h264->FrameRate) { sys->EncParamExt.fMaxFrameRate = (int)h264->FrameRate; - status = (*sys->pEncoder)->SetOption(sys->pEncoder, ENCODER_OPTION_FRAME_RATE, - &sys->EncParamExt.fMaxFrameRate); + status = (*sys->pEncoder) + ->SetOption(sys->pEncoder, ENCODER_OPTION_FRAME_RATE, + &sys->EncParamExt.fMaxFrameRate); if (status < 0) { - WLog_Print(h264->log, WLOG_ERROR, "Failed to set encoder framerate (status=%d)", status); + WLog_Print(h264->log, WLOG_ERROR, + "Failed to set encoder framerate (status=%d)", status); return status; } } @@ -287,13 +287,14 @@ static int openh264_compress(H264_CONTEXT* h264, const BYTE** pYUVData, const UI if (sys->EncParamExt.sSpatialLayers[0].iDLayerQp != (int)h264->QP) { sys->EncParamExt.sSpatialLayers[0].iDLayerQp = (int)h264->QP; - status = (*sys->pEncoder)->SetOption(sys->pEncoder, - ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, - &sys->EncParamExt); + status = (*sys->pEncoder) + ->SetOption(sys->pEncoder, ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, + &sys->EncParamExt); if (status < 0) { - WLog_Print(h264->log, WLOG_ERROR, "Failed to set encoder parameters (status=%d)", status); + WLog_Print(h264->log, WLOG_ERROR, + "Failed to set encoder parameters (status=%d)", status); return status; } } @@ -338,7 +339,7 @@ static int openh264_compress(H264_CONTEXT* h264, const BYTE** pYUVData, const UI static void openh264_uninit(H264_CONTEXT* h264) { UINT32 x; - H264_CONTEXT_OPENH264* sysContexts = (H264_CONTEXT_OPENH264*) h264->pSystemData; + H264_CONTEXT_OPENH264* sysContexts = (H264_CONTEXT_OPENH264*)h264->pSystemData; if (sysContexts) { @@ -361,7 +362,7 @@ static void openh264_uninit(H264_CONTEXT* h264) } } -#if defined (WITH_OPENH264_LOADING) +#if defined(WITH_OPENH264_LOADING) if (sysContexts->lib) FreeLibrary(sysContexts->lib); #endif @@ -370,7 +371,7 @@ static void openh264_uninit(H264_CONTEXT* h264) } } -#if defined (WITH_OPENH264_LOADING) +#if defined(WITH_OPENH264_LOADING) static BOOL openh264_load_functionpointers(H264_CONTEXT* h264, const char* name) { H264_CONTEXT_OPENH264* sysContexts; @@ -388,11 +389,16 @@ static BOOL openh264_load_functionpointers(H264_CONTEXT* h264, const char* name) if (!sysContexts->lib) return FALSE; - sysContexts->WelsGetCodecVersionEx = (pWelsGetCodecVersionEx) GetProcAddress(sysContexts->lib, "WelsGetCodecVersionEx"); - sysContexts->WelsCreateDecoder = (pWelsCreateDecoder) GetProcAddress(sysContexts->lib, "WelsCreateDecoder"); - sysContexts->WelsDestroyDecoder = (pWelsDestroyDecoder) GetProcAddress(sysContexts->lib, "WelsDestroyDecoder"); - sysContexts->WelsCreateSVCEncoder = (pWelsCreateSVCEncoder) GetProcAddress(sysContexts->lib, "WelsCreateSVCEncoder"); - sysContexts->WelsDestroySVCEncoder = (pWelsDestroySVCEncoder) GetProcAddress(sysContexts->lib, "WelsDestroySVCEncoder"); + sysContexts->WelsGetCodecVersionEx = + (pWelsGetCodecVersionEx)GetProcAddress(sysContexts->lib, "WelsGetCodecVersionEx"); + sysContexts->WelsCreateDecoder = + (pWelsCreateDecoder)GetProcAddress(sysContexts->lib, "WelsCreateDecoder"); + sysContexts->WelsDestroyDecoder = + (pWelsDestroyDecoder)GetProcAddress(sysContexts->lib, "WelsDestroyDecoder"); + sysContexts->WelsCreateSVCEncoder = + (pWelsCreateSVCEncoder)GetProcAddress(sysContexts->lib, "WelsCreateSVCEncoder"); + sysContexts->WelsDestroySVCEncoder = + (pWelsDestroySVCEncoder)GetProcAddress(sysContexts->lib, "WelsDestroySVCEncoder"); if (!sysContexts->WelsCreateDecoder || !sysContexts->WelsDestroyDecoder || !sysContexts->WelsCreateSVCEncoder || !sysContexts->WelsDestroySVCEncoder || @@ -405,15 +411,16 @@ static BOOL openh264_load_functionpointers(H264_CONTEXT* h264, const char* name) sysContexts->WelsGetCodecVersionEx(&sysContexts->version); WLog_Print(h264->log, WLOG_INFO, "loaded %s %d.%d.%d", name, sysContexts->version.uMajor, - sysContexts->version.uMinor, - sysContexts->version.uRevision); + sysContexts->version.uMinor, sysContexts->version.uRevision); - if ((sysContexts->version.uMajor < 1) || ((sysContexts->version.uMajor == 1) && (sysContexts->version.uMinor < 6))) + if ((sysContexts->version.uMajor < 1) || + ((sysContexts->version.uMajor == 1) && (sysContexts->version.uMinor < 6))) { - WLog_Print(h264->log, WLOG_ERROR, - "OpenH264 %s %d.%d.%d is too old, need at least version 1.6.0 for dynamic loading", - name, sysContexts->version.uMajor, sysContexts->version.uMinor, - sysContexts->version.uRevision); + WLog_Print( + h264->log, WLOG_ERROR, + "OpenH264 %s %d.%d.%d is too old, need at least version 1.6.0 for dynamic loading", + name, sysContexts->version.uMajor, sysContexts->version.uMinor, + sysContexts->version.uRevision); FreeLibrary(sysContexts->lib); sysContexts->lib = NULL; return FALSE; @@ -425,7 +432,7 @@ static BOOL openh264_load_functionpointers(H264_CONTEXT* h264, const char* name) static BOOL openh264_init(H264_CONTEXT* h264) { -#if defined (WITH_OPENH264_LOADING) +#if defined(WITH_OPENH264_LOADING) BOOL success = FALSE; size_t i; #endif @@ -437,17 +444,16 @@ static BOOL openh264_init(H264_CONTEXT* h264) #if (OPENH264_MAJOR == 1) && (OPENH264_MINOR <= 5) static EVideoFormatType videoFormat = videoFormatI420; #endif - static WelsTraceCallback traceCallback = (WelsTraceCallback) - openh264_trace_callback; + static WelsTraceCallback traceCallback = (WelsTraceCallback)openh264_trace_callback; h264->numSystemData = 1; - sysContexts = (H264_CONTEXT_OPENH264*) calloc(h264->numSystemData, - sizeof(H264_CONTEXT_OPENH264)); + sysContexts = + (H264_CONTEXT_OPENH264*)calloc(h264->numSystemData, sizeof(H264_CONTEXT_OPENH264)); if (!sysContexts) goto EXCEPTION; - h264->pSystemData = (void*) sysContexts; -#if defined (WITH_OPENH264_LOADING) + h264->pSystemData = (void*)sysContexts; +#if defined(WITH_OPENH264_LOADING) for (i = 0; i < ARRAYSIZE(openh264_library_names); i++) { @@ -495,7 +501,7 @@ static BOOL openh264_init(H264_CONTEXT* h264) ZeroMemory(&sDecParam, sizeof(sDecParam)); #if (OPENH264_MAJOR == 1) && (OPENH264_MINOR <= 5) - sDecParam.eOutputColorFormat = videoFormatI420; + sDecParam.eOutputColorFormat = videoFormatI420; #endif sDecParam.eEcActiveIdc = ERROR_CON_FRAME_COPY; sDecParam.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_AVC; @@ -503,15 +509,14 @@ static BOOL openh264_init(H264_CONTEXT* h264) if (status != 0) { - WLog_Print(h264->log, WLOG_ERROR, "Failed to initialize OpenH264 decoder (status=%ld)", - status); + WLog_Print(h264->log, WLOG_ERROR, + "Failed to initialize OpenH264 decoder (status=%ld)", status); goto EXCEPTION; } #if (OPENH264_MAJOR == 1) && (OPENH264_MINOR <= 5) - status = (*sys->pDecoder)->SetOption( - sys->pDecoder, DECODER_OPTION_DATAFORMAT, - &videoFormat); + status = + (*sys->pDecoder)->SetOption(sys->pDecoder, DECODER_OPTION_DATAFORMAT, &videoFormat); #endif if (status != 0) @@ -524,9 +529,8 @@ static BOOL openh264_init(H264_CONTEXT* h264) if (WLog_GetLogLevel(h264->log) == WLOG_TRACE) { - status = (*sys->pDecoder)->SetOption( - sys->pDecoder, DECODER_OPTION_TRACE_LEVEL, - &traceLevel); + status = (*sys->pDecoder) + ->SetOption(sys->pDecoder, DECODER_OPTION_TRACE_LEVEL, &traceLevel); if (status != 0) { @@ -536,28 +540,29 @@ static BOOL openh264_init(H264_CONTEXT* h264) goto EXCEPTION; } - status = (*sys->pDecoder)->SetOption( - sys->pDecoder, - DECODER_OPTION_TRACE_CALLBACK_CONTEXT, - &h264); + status = + (*sys->pDecoder) + ->SetOption(sys->pDecoder, DECODER_OPTION_TRACE_CALLBACK_CONTEXT, &h264); if (status != 0) { WLog_Print(h264->log, WLOG_ERROR, - "Failed to set trace callback context option on OpenH264 decoder (status=%ld)", + "Failed to set trace callback context option on OpenH264 decoder " + "(status=%ld)", status); goto EXCEPTION; } - status = (*sys->pDecoder)->SetOption( - sys->pDecoder, DECODER_OPTION_TRACE_CALLBACK, - &traceCallback); + status = + (*sys->pDecoder) + ->SetOption(sys->pDecoder, DECODER_OPTION_TRACE_CALLBACK, &traceCallback); if (status != 0) { - WLog_Print(h264->log, WLOG_ERROR, - "Failed to set trace callback option on OpenH264 decoder (status=%ld)", - status); + WLog_Print( + h264->log, WLOG_ERROR, + "Failed to set trace callback option on OpenH264 decoder (status=%ld)", + status); goto EXCEPTION; } } @@ -570,11 +575,5 @@ EXCEPTION: return FALSE; } -H264_CONTEXT_SUBSYSTEM g_Subsystem_OpenH264 = -{ - "OpenH264", - openh264_init, - openh264_uninit, - openh264_decompress, - openh264_compress -}; +H264_CONTEXT_SUBSYSTEM g_Subsystem_OpenH264 = { "OpenH264", openh264_init, openh264_uninit, + openh264_decompress, openh264_compress }; diff --git a/libfreerdp/codec/h264_x264.c b/libfreerdp/codec/h264_x264.c index 5252e3fa7..c3600946c 100644 --- a/libfreerdp/codec/h264_x264.c +++ b/libfreerdp/codec/h264_x264.c @@ -17,22 +17,22 @@ * limitations under the License. */ -#define NAL_UNKNOWN X264_NAL_UNKNOWN -#define NAL_SLICE X264_NAL_SLICE -#define NAL_SLICE_DPA X264_NAL_SLICE_DPA -#define NAL_SLICE_DPB X264_NAL_SLICE_DPB -#define NAL_SLICE_DPC X264_NAL_SLICE_DPC -#define NAL_SLICE_IDR X264_NAL_SLICE_IDR -#define NAL_SEI X264_NAL_SEI -#define NAL_SPS X264_NAL_SPS -#define NAL_PPS X264_NAL_PPS -#define NAL_AUD X264_NAL_AUD -#define NAL_FILLER X264_NAL_FILLER +#define NAL_UNKNOWN X264_NAL_UNKNOWN +#define NAL_SLICE X264_NAL_SLICE +#define NAL_SLICE_DPA X264_NAL_SLICE_DPA +#define NAL_SLICE_DPB X264_NAL_SLICE_DPB +#define NAL_SLICE_DPC X264_NAL_SLICE_DPC +#define NAL_SLICE_IDR X264_NAL_SLICE_IDR +#define NAL_SEI X264_NAL_SEI +#define NAL_SPS X264_NAL_SPS +#define NAL_PPS X264_NAL_PPS +#define NAL_AUD X264_NAL_AUD +#define NAL_FILLER X264_NAL_FILLER -#define NAL_PRIORITY_DISPOSABLE X264_NAL_PRIORITY_DISPOSABLE -#define NAL_PRIORITY_LOW X264_NAL_PRIORITY_LOW -#define NAL_PRIORITY_HIGH X264_NAL_PRIORITY_HIGH -#define NAL_PRIORITY_HIGHEST X264_NAL_PRIORITY_HIGHEST +#define NAL_PRIORITY_DISPOSABLE X264_NAL_PRIORITY_DISPOSABLE +#define NAL_PRIORITY_LOW X264_NAL_PRIORITY_LOW +#define NAL_PRIORITY_HIGH X264_NAL_PRIORITY_HIGH +#define NAL_PRIORITY_HIGHEST X264_NAL_PRIORITY_HIGHEST #include #include @@ -48,19 +48,20 @@ typedef struct _H264_CONTEXT_X264 H264_CONTEXT_X264; static int x264_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize) { - //H264_CONTEXT_X264* sys = (H264_CONTEXT_X264*) h264->pSystemData; + // H264_CONTEXT_X264* sys = (H264_CONTEXT_X264*) h264->pSystemData; return -1; } -static int x264_compress(H264_CONTEXT* h264, const BYTE** ppSrcYuv, const UINT32* pStride, BYTE** ppDstData, UINT32* pDstSize) +static int x264_compress(H264_CONTEXT* h264, const BYTE** ppSrcYuv, const UINT32* pStride, + BYTE** ppDstData, UINT32* pDstSize) { - //H264_CONTEXT_X264* sys = (H264_CONTEXT_X264*) h264->pSystemData; + // H264_CONTEXT_X264* sys = (H264_CONTEXT_X264*) h264->pSystemData; return -1; } static void x264_uninit(H264_CONTEXT* h264) { - H264_CONTEXT_X264* sys = (H264_CONTEXT_X264*) h264->pSystemData; + H264_CONTEXT_X264* sys = (H264_CONTEXT_X264*)h264->pSystemData; if (sys) { @@ -73,15 +74,14 @@ static BOOL x264_init(H264_CONTEXT* h264) { H264_CONTEXT_X264* sys; h264->numSystemData = 1; - sys = (H264_CONTEXT_X264*) calloc(h264->numSystemData, - sizeof(H264_CONTEXT_X264)); + sys = (H264_CONTEXT_X264*)calloc(h264->numSystemData, sizeof(H264_CONTEXT_X264)); if (!sys) { goto EXCEPTION; } - h264->pSystemData = (void*) sys; + h264->pSystemData = (void*)sys; if (h264->Compressor) { @@ -96,14 +96,8 @@ EXCEPTION: return FALSE; } -H264_CONTEXT_SUBSYSTEM g_Subsystem_x264 = -{ - "x264", - x264_init, - x264_uninit, - x264_decompress, - x264_compress -}; +H264_CONTEXT_SUBSYSTEM g_Subsystem_x264 = { "x264", x264_init, x264_uninit, x264_decompress, + x264_compress }; #undef NAL_UNKNOWN #undef NAL_SLICE diff --git a/libfreerdp/codec/include/bitmap.c b/libfreerdp/codec/include/bitmap.c index aa5da6715..68d10fe3a 100644 --- a/libfreerdp/codec/include/bitmap.c +++ b/libfreerdp/codec/include/bitmap.c @@ -36,8 +36,7 @@ static INLINE BYTE* WRITEFGBGIMAGE(BYTE* pbDest, const BYTE* pbDestEnd, UINT32 r if (!ENSURE_CAPACITY(pbDest, pbDestEnd, cBits)) return NULL; - UNROLL(cBits, - { + UNROLL(cBits, { UINT32 data; DESTREADPIXEL(xorPixel, pbDest - rowDelta); @@ -58,7 +57,7 @@ static INLINE BYTE* WRITEFGBGIMAGE(BYTE* pbDest, const BYTE* pbDestEnd, UINT32 r * for the first line of compressed data. */ static INLINE BYTE* WRITEFIRSTLINEFGBGIMAGE(BYTE* pbDest, const BYTE* pbDestEnd, BYTE bitmask, - PIXEL fgPel, UINT32 cBits) + PIXEL fgPel, UINT32 cBits) { BYTE mask = 0x01; @@ -68,14 +67,13 @@ static INLINE BYTE* WRITEFIRSTLINEFGBGIMAGE(BYTE* pbDest, const BYTE* pbDestEnd, if (!ENSURE_CAPACITY(pbDest, pbDestEnd, cBits)) return NULL; - UNROLL(cBits, - { + UNROLL(cBits, { UINT32 data; if (bitmask & mask) data = fgPel; else - data = BLACK_PIXEL; + data = BLACK_PIXEL; DESTWRITEPIXEL(pbDest, data); DESTNEXTPIXEL(pbDest); @@ -87,8 +85,7 @@ static INLINE BYTE* WRITEFIRSTLINEFGBGIMAGE(BYTE* pbDest, const BYTE* pbDestEnd, /** * Decompress an RLE compressed bitmap. */ -static INLINE BOOL RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer, - BYTE* pbDestBuffer, +static INLINE BOOL RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer, BYTE* pbDestBuffer, UINT32 rowDelta, UINT32 width, UINT32 height) { const BYTE* pbSrc = pbSrcBuffer; @@ -154,8 +151,7 @@ static INLINE BOOL RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer, if (!ENSURE_CAPACITY(pbDest, pbDestEnd, runLength)) return FALSE; - UNROLL(runLength, - { + UNROLL(runLength, { DESTWRITEPIXEL(pbDest, BLACK_PIXEL); DESTNEXTPIXEL(pbDest); }); @@ -177,8 +173,7 @@ static INLINE BOOL RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer, if (!ENSURE_CAPACITY(pbDest, pbDestEnd, runLength)) return FALSE; - UNROLL(runLength, - { + UNROLL(runLength, { DESTREADPIXEL(temp, pbDest - rowDelta); DESTWRITEPIXEL(pbDest, temp); DESTNEXTPIXEL(pbDest); @@ -191,7 +186,7 @@ static INLINE BOOL RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer, } /* For any of the other run-types a follow-on background run - order does not need a foreground pel inserted. */ + order does not need a foreground pel inserted. */ fInsertFgPel = FALSE; switch (code) @@ -215,16 +210,14 @@ static INLINE BOOL RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer, if (fFirstLine) { - UNROLL(runLength, - { + UNROLL(runLength, { DESTWRITEPIXEL(pbDest, fgPel); DESTNEXTPIXEL(pbDest); }); } else { - UNROLL(runLength, - { + UNROLL(runLength, { DESTREADPIXEL(temp, pbDest - rowDelta); DESTWRITEPIXEL(pbDest, temp ^ fgPel); DESTNEXTPIXEL(pbDest); @@ -246,8 +239,7 @@ static INLINE BOOL RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer, if (!ENSURE_CAPACITY(pbDest, pbDestEnd, runLength * 2)) return FALSE; - UNROLL(runLength, - { + UNROLL(runLength, { DESTWRITEPIXEL(pbDest, pixelA); DESTNEXTPIXEL(pbDest); DESTWRITEPIXEL(pbDest, pixelB); @@ -266,8 +258,7 @@ static INLINE BOOL RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer, if (!ENSURE_CAPACITY(pbDest, pbDestEnd, runLength)) return FALSE; - UNROLL(runLength, - { + UNROLL(runLength, { DESTWRITEPIXEL(pbDest, pixelA); DESTNEXTPIXEL(pbDest); }); @@ -323,11 +314,13 @@ static INLINE BOOL RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer, if (fFirstLine) { - pbDest = WRITEFIRSTLINEFGBGIMAGE(pbDest, pbDestEnd, bitmask, fgPel, runLength); + pbDest = + WRITEFIRSTLINEFGBGIMAGE(pbDest, pbDestEnd, bitmask, fgPel, runLength); } else { - pbDest = WRITEFGBGIMAGE(pbDest, pbDestEnd, rowDelta, bitmask, fgPel, runLength); + pbDest = + WRITEFGBGIMAGE(pbDest, pbDestEnd, rowDelta, bitmask, fgPel, runLength); } if (!pbDest) @@ -341,8 +334,7 @@ static INLINE BOOL RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer, case MEGA_MEGA_COLOR_IMAGE: runLength = ExtractRunLength(code, pbSrc, &advance); pbSrc = pbSrc + advance; - UNROLL(runLength, - { + UNROLL(runLength, { SRCREADPIXEL(temp, pbSrc); SRCNEXTPIXEL(pbSrc); DESTWRITEPIXEL(pbDest, temp); @@ -356,11 +348,13 @@ static INLINE BOOL RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer, if (fFirstLine) { - pbDest = WRITEFIRSTLINEFGBGIMAGE(pbDest, pbDestEnd, g_MaskSpecialFgBg1, fgPel, 8); + pbDest = + WRITEFIRSTLINEFGBGIMAGE(pbDest, pbDestEnd, g_MaskSpecialFgBg1, fgPel, 8); } else { - pbDest = WRITEFGBGIMAGE(pbDest, pbDestEnd, rowDelta, g_MaskSpecialFgBg1, fgPel, 8); + pbDest = + WRITEFGBGIMAGE(pbDest, pbDestEnd, rowDelta, g_MaskSpecialFgBg1, fgPel, 8); } if (!pbDest) @@ -374,11 +368,13 @@ static INLINE BOOL RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer, if (fFirstLine) { - pbDest = WRITEFIRSTLINEFGBGIMAGE(pbDest, pbDestEnd, g_MaskSpecialFgBg2, fgPel, 8); + pbDest = + WRITEFIRSTLINEFGBGIMAGE(pbDest, pbDestEnd, g_MaskSpecialFgBg2, fgPel, 8); } else { - pbDest = WRITEFGBGIMAGE(pbDest, pbDestEnd, rowDelta, g_MaskSpecialFgBg2, fgPel, 8); + pbDest = + WRITEFGBGIMAGE(pbDest, pbDestEnd, rowDelta, g_MaskSpecialFgBg2, fgPel, 8); } if (!pbDest) diff --git a/libfreerdp/codec/interleaved.c b/libfreerdp/codec/interleaved.c index a3fe7dd3f..5916811e3 100644 --- a/libfreerdp/codec/interleaved.c +++ b/libfreerdp/codec/interleaved.c @@ -30,33 +30,34 @@ #define TAG FREERDP_TAG("codec") -#define UNROLL_BODY(_exp, _count) do \ - { \ - size_t x; \ - for (x=0; x<(_count); x++) \ - { \ - do _exp while(FALSE); \ - } \ - } \ - while (FALSE) +#define UNROLL_BODY(_exp, _count) \ + do \ + { \ + size_t x; \ + for (x = 0; x < (_count); x++) \ + { \ + do \ + _exp while (FALSE); \ + } \ + } while (FALSE) -#define UNROLL_MULTIPLE(_condition, _exp, _count) do \ - { \ - while ((_condition) >= _count) \ - { \ - UNROLL_BODY(_exp, _count); \ - (_condition) -= _count; \ - } \ - } \ - while (FALSE) +#define UNROLL_MULTIPLE(_condition, _exp, _count) \ + do \ + { \ + while ((_condition) >= _count) \ + { \ + UNROLL_BODY(_exp, _count); \ + (_condition) -= _count; \ + } \ + } while (FALSE) -#define UNROLL(_condition, _exp) do \ - { \ +#define UNROLL(_condition, _exp) \ + do \ + { \ UNROLL_MULTIPLE(_condition, _exp, 16); \ - UNROLL_MULTIPLE(_condition, _exp, 4); \ - UNROLL_MULTIPLE(_condition, _exp, 1); \ - } \ - while (FALSE) + UNROLL_MULTIPLE(_condition, _exp, 4); \ + UNROLL_MULTIPLE(_condition, _exp, 1); \ + } while (FALSE) /* RLE Compressed Bitmap Stream (RLE_BITMAP_STREAM) @@ -65,26 +66,26 @@ http://msdn.microsoft.com/en-us/library/dd240593%28v=prot.10%29.aspx */ -#define REGULAR_BG_RUN 0x00 -#define MEGA_MEGA_BG_RUN 0xF0 -#define REGULAR_FG_RUN 0x01 -#define MEGA_MEGA_FG_RUN 0xF1 -#define LITE_SET_FG_FG_RUN 0x0C -#define MEGA_MEGA_SET_FG_RUN 0xF6 -#define LITE_DITHERED_RUN 0x0E -#define MEGA_MEGA_DITHERED_RUN 0xF8 -#define REGULAR_COLOR_RUN 0x03 -#define MEGA_MEGA_COLOR_RUN 0xF3 -#define REGULAR_FGBG_IMAGE 0x02 -#define MEGA_MEGA_FGBG_IMAGE 0xF2 -#define LITE_SET_FG_FGBG_IMAGE 0x0D -#define MEGA_MEGA_SET_FGBG_IMAGE 0xF7 -#define REGULAR_COLOR_IMAGE 0x04 -#define MEGA_MEGA_COLOR_IMAGE 0xF4 -#define SPECIAL_FGBG_1 0xF9 -#define SPECIAL_FGBG_2 0xFA -#define SPECIAL_WHITE 0xFD -#define SPECIAL_BLACK 0xFE +#define REGULAR_BG_RUN 0x00 +#define MEGA_MEGA_BG_RUN 0xF0 +#define REGULAR_FG_RUN 0x01 +#define MEGA_MEGA_FG_RUN 0xF1 +#define LITE_SET_FG_FG_RUN 0x0C +#define MEGA_MEGA_SET_FG_RUN 0xF6 +#define LITE_DITHERED_RUN 0x0E +#define MEGA_MEGA_DITHERED_RUN 0xF8 +#define REGULAR_COLOR_RUN 0x03 +#define MEGA_MEGA_COLOR_RUN 0xF3 +#define REGULAR_FGBG_IMAGE 0x02 +#define MEGA_MEGA_FGBG_IMAGE 0xF2 +#define LITE_SET_FG_FGBG_IMAGE 0x0D +#define MEGA_MEGA_SET_FGBG_IMAGE 0xF7 +#define REGULAR_COLOR_IMAGE 0x04 +#define MEGA_MEGA_COLOR_IMAGE 0xF4 +#define SPECIAL_FGBG_1 0xF9 +#define SPECIAL_FGBG_2 0xFA +#define SPECIAL_WHITE 0xFD +#define SPECIAL_BLACK 0xFE #define BLACK_PIXEL 0x000000 @@ -126,8 +127,7 @@ static INLINE UINT32 ExtractCodeId(BYTE bOrderHdr) /** * Extract the run length of a compression order. */ -static INLINE UINT32 ExtractRunLength(UINT32 code, const BYTE* pbOrderHdr, - UINT32* advance) +static INLINE UINT32 ExtractRunLength(UINT32 code, const BYTE* pbOrderHdr, UINT32* advance) { UINT32 runLength; UINT32 ladvance; @@ -202,7 +202,7 @@ static INLINE UINT32 ExtractRunLength(UINT32 code, const BYTE* pbOrderHdr, case MEGA_MEGA_FGBG_IMAGE: case MEGA_MEGA_SET_FGBG_IMAGE: case MEGA_MEGA_COLOR_IMAGE: - runLength = ((UINT16) pbOrderHdr[1]) | ((UINT16)(pbOrderHdr[2] << 8)); + runLength = ((UINT16)pbOrderHdr[1]) | ((UINT16)(pbOrderHdr[2] << 8)); ladvance += 2; break; } @@ -298,11 +298,9 @@ static INLINE void write_pixel_16(BYTE* _buf, UINT16 _pix) #undef RLEEXTRA #undef WHITE_PIXEL #define WHITE_PIXEL 0xFFFFFF -#define DESTWRITEPIXEL(_buf, _pix) write_pixel_24(_buf, _pix) -#define DESTREADPIXEL(_pix, _buf) _pix = (_buf)[0] | ((_buf)[1] << 8) | \ - ((_buf)[2] << 16) -#define SRCREADPIXEL(_pix, _buf) _pix = (_buf)[0] | ((_buf)[1] << 8) | \ - ((_buf)[2] << 16) +#define DESTWRITEPIXEL(_buf, _pix) write_pixel_24(_buf, _pix) +#define DESTREADPIXEL(_pix, _buf) _pix = (_buf)[0] | ((_buf)[1] << 8) | ((_buf)[2] << 16) +#define SRCREADPIXEL(_pix, _buf) _pix = (_buf)[0] | ((_buf)[1] << 8) | ((_buf)[2] << 16) #define DESTNEXTPIXEL(_buf) _buf += 3 #define SRCNEXTPIXEL(_buf) _buf += 3 #define WRITEFGBGIMAGE WriteFgBgImage24to24 @@ -313,13 +311,10 @@ static INLINE void write_pixel_16(BYTE* _buf, UINT16 _pix) #define ENSURE_CAPACITY(_start, _end, _size) ensure_capacity(_start, _end, _size, 3) #include "include/bitmap.c" -BOOL interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, - const BYTE* pSrcData, UINT32 SrcSize, - UINT32 nSrcWidth, UINT32 nSrcHeight, - UINT32 bpp, - BYTE* pDstData, UINT32 DstFormat, - UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, - UINT32 nDstWidth, UINT32 nDstHeight, +BOOL interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, const BYTE* pSrcData, + UINT32 SrcSize, UINT32 nSrcWidth, UINT32 nSrcHeight, UINT32 bpp, + BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, + UINT32 nYDst, UINT32 nDstWidth, UINT32 nDstHeight, const gdiPalette* palette) { UINT32 scanline; @@ -352,7 +347,7 @@ BOOL interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, break; default: - WLog_ERR(TAG, "Invalid color depth %"PRIu32"", bpp); + WLog_ERR(TAG, "Invalid color depth %" PRIu32 "", bpp); return FALSE; } @@ -360,9 +355,7 @@ BOOL interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, if (BufferSize > interleaved->TempSize) { - interleaved->TempBuffer = _aligned_realloc( - interleaved->TempBuffer, - BufferSize, 16); + interleaved->TempBuffer = _aligned_realloc(interleaved->TempBuffer, BufferSize, 16); interleaved->TempSize = BufferSize; } @@ -372,23 +365,23 @@ BOOL interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, switch (bpp) { case 24: - if (!RleDecompress24to24(pSrcData, SrcSize, interleaved->TempBuffer, - scanline, nSrcWidth, nSrcHeight)) + if (!RleDecompress24to24(pSrcData, SrcSize, interleaved->TempBuffer, scanline, + nSrcWidth, nSrcHeight)) return FALSE; break; case 16: case 15: - if (!RleDecompress16to16(pSrcData, SrcSize, interleaved->TempBuffer, - scanline, nSrcWidth, nSrcHeight)) + if (!RleDecompress16to16(pSrcData, SrcSize, interleaved->TempBuffer, scanline, + nSrcWidth, nSrcHeight)) return FALSE; break; case 8: - if (!RleDecompress8to8(pSrcData, SrcSize, interleaved->TempBuffer, - scanline, nSrcWidth, nSrcHeight)) + if (!RleDecompress8to8(pSrcData, SrcSize, interleaved->TempBuffer, scanline, nSrcWidth, + nSrcHeight)) return FALSE; break; @@ -397,17 +390,15 @@ BOOL interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, return FALSE; } - return freerdp_image_copy(pDstData, DstFormat, nDstStep, nXDst, nYDst, - nDstWidth, nDstHeight, interleaved->TempBuffer, - SrcFormat, scanline, 0, 0, palette, FREERDP_FLIP_VERTICAL); + return freerdp_image_copy(pDstData, DstFormat, nDstStep, nXDst, nYDst, nDstWidth, nDstHeight, + interleaved->TempBuffer, SrcFormat, scanline, 0, 0, palette, + FREERDP_FLIP_VERTICAL); } -BOOL interleaved_compress(BITMAP_INTERLEAVED_CONTEXT* interleaved, - BYTE* pDstData, UINT32* pDstSize, - UINT32 nWidth, UINT32 nHeight, - const BYTE* pSrcData, UINT32 SrcFormat, - UINT32 nSrcStep, UINT32 nXSrc, UINT32 nYSrc, - const gdiPalette* palette, UINT32 bpp) +BOOL interleaved_compress(BITMAP_INTERLEAVED_CONTEXT* interleaved, BYTE* pDstData, UINT32* pDstSize, + UINT32 nWidth, UINT32 nHeight, const BYTE* pSrcData, UINT32 SrcFormat, + UINT32 nSrcStep, UINT32 nXSrc, UINT32 nYSrc, const gdiPalette* palette, + UINT32 bpp) { BOOL status; wStream* s; @@ -429,8 +420,9 @@ BOOL interleaved_compress(BITMAP_INTERLEAVED_CONTEXT* interleaved, if ((nWidth > 64) || (nHeight > 64)) { WLog_ERR(TAG, - "interleaved_compress: width (%"PRIu32") or height (%"PRIu32") is greater than 64", nWidth, - nHeight); + "interleaved_compress: width (%" PRIu32 ") or height (%" PRIu32 + ") is greater than 64", + nWidth, nHeight); return FALSE; } @@ -452,9 +444,8 @@ BOOL interleaved_compress(BITMAP_INTERLEAVED_CONTEXT* interleaved, return FALSE; } - if (!freerdp_image_copy(interleaved->TempBuffer, DstFormat, 0, 0, 0, nWidth, - nHeight, pSrcData, SrcFormat, nSrcStep, nXSrc, nYSrc, - palette, FREERDP_FLIP_NONE)) + if (!freerdp_image_copy(interleaved->TempBuffer, DstFormat, 0, 0, 0, nWidth, nHeight, pSrcData, + SrcFormat, nSrcStep, nXSrc, nYSrc, palette, FREERDP_FLIP_NONE)) return FALSE; s = Stream_New(pDstData, *pDstSize); @@ -464,15 +455,14 @@ BOOL interleaved_compress(BITMAP_INTERLEAVED_CONTEXT* interleaved, Stream_SetPosition(interleaved->bts, 0); - if (freerdp_bitmap_compress(interleaved->TempBuffer, nWidth, nHeight, - s, bpp, maxSize, nHeight - 1, - interleaved->bts, 0) < 0) + if (freerdp_bitmap_compress(interleaved->TempBuffer, nWidth, nHeight, s, bpp, maxSize, + nHeight - 1, interleaved->bts, 0) < 0) status = FALSE; else status = TRUE; Stream_SealLength(s); - *pDstSize = (UINT32) Stream_Length(s); + *pDstSize = (UINT32)Stream_Length(s); Stream_Free(s, FALSE); return status; } @@ -488,8 +478,7 @@ BOOL bitmap_interleaved_context_reset(BITMAP_INTERLEAVED_CONTEXT* interleaved) BITMAP_INTERLEAVED_CONTEXT* bitmap_interleaved_context_new(BOOL Compressor) { BITMAP_INTERLEAVED_CONTEXT* interleaved; - interleaved = (BITMAP_INTERLEAVED_CONTEXT*) calloc(1, - sizeof(BITMAP_INTERLEAVED_CONTEXT)); + interleaved = (BITMAP_INTERLEAVED_CONTEXT*)calloc(1, sizeof(BITMAP_INTERLEAVED_CONTEXT)); if (interleaved) { diff --git a/libfreerdp/codec/jpeg.c b/libfreerdp/codec/jpeg.c index 9fa90bf15..2dcae11f6 100644 --- a/libfreerdp/codec/jpeg.c +++ b/libfreerdp/codec/jpeg.c @@ -72,10 +72,8 @@ static void my_term_source(j_decompress_ptr cinfo) } /*****************************************************************************/ -static int -do_decompress(char* comp_data, int comp_data_bytes, - int* width, int* height, int* bpp, - char* decomp_data, int* decomp_data_bytes) +static int do_decompress(char* comp_data, int comp_data_bytes, int* width, int* height, int* bpp, + char* decomp_data, int* decomp_data_bytes) { struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr jerr; @@ -110,14 +108,13 @@ do_decompress(char* comp_data, int comp_data_bytes, jpeg_start_decompress(&cinfo); - while(cinfo.output_scanline < cinfo.image_height) + while (cinfo.output_scanline < cinfo.image_height) { - row_pointer[0] = (JSAMPROW) decomp_data; + row_pointer[0] = (JSAMPROW)decomp_data; jpeg_read_scanlines(&cinfo, row_pointer, 1); decomp_data += cinfo.image_width * cinfo.num_components; } - *decomp_data_bytes = cinfo.output_width * - cinfo.output_height * cinfo.num_components; + *decomp_data_bytes = cinfo.output_width * cinfo.output_height * cinfo.num_components; jpeg_finish_decompress(&cinfo); jpeg_destroy_decompress(&cinfo); return 0; @@ -135,9 +132,8 @@ BOOL jpeg_decompress(BYTE* input, BYTE* output, int width, int height, int size, { return 0; } - if (do_decompress((char*)input, size, - &lwidth, &lheight, &lbpp, - (char*)output, &ldecomp_data_bytes) != 0) + if (do_decompress((char*)input, size, &lwidth, &lheight, &lbpp, (char*)output, + &ldecomp_data_bytes) != 0) { return 0; } diff --git a/libfreerdp/codec/mppc.c b/libfreerdp/codec/mppc.c index 0151b897e..7498eddb4 100644 --- a/libfreerdp/codec/mppc.c +++ b/libfreerdp/codec/mppc.c @@ -31,11 +31,13 @@ #define TAG FREERDP_TAG("codec.mppc") -#define MPPC_MATCH_INDEX(_sym1, _sym2, _sym3) \ - ((((MPPC_MATCH_TABLE[_sym3] << 16) + (MPPC_MATCH_TABLE[_sym2] << 8) + MPPC_MATCH_TABLE[_sym1]) & 0x07FFF000) >> 12) +#define MPPC_MATCH_INDEX(_sym1, _sym2, _sym3) \ + ((((MPPC_MATCH_TABLE[_sym3] << 16) + (MPPC_MATCH_TABLE[_sym2] << 8) + \ + MPPC_MATCH_TABLE[_sym1]) & \ + 0x07FFF000) >> \ + 12) -static const UINT32 MPPC_MATCH_TABLE[256] = -{ +static const UINT32 MPPC_MATCH_TABLE[256] = { 0x00000000, 0x009CCF93, 0x01399F26, 0x01D66EB9, 0x02733E4C, 0x03100DDF, 0x03ACDD72, 0x0449AD05, 0x04E67C98, 0x05834C2B, 0x06201BBE, 0x06BCEB51, 0x0759BAE4, 0x07F68A77, 0x08935A0A, 0x0930299D, 0x09CCF930, 0x0A69C8C3, 0x0B069856, 0x0BA367E9, 0x0C40377C, 0x0CDD070F, 0x0D79D6A2, 0x0E16A635, @@ -125,7 +127,7 @@ int mppc_decompress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** p if (HistoryPtr > HistoryBufferEnd) { - WLog_ERR(TAG, "history buffer index out of range"); + WLog_ERR(TAG, "history buffer index out of range"); return -1004; } @@ -384,23 +386,22 @@ int mppc_decompress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** p } #ifdef DEBUG_MPPC - WLog_DBG(TAG, "<%"PRIu32",%"PRIu32">", CopyOffset, LengthOfMatch); + WLog_DBG(TAG, "<%" PRIu32 ",%" PRIu32 ">", CopyOffset, LengthOfMatch); #endif if ((HistoryPtr + LengthOfMatch - 1) > HistoryBufferEnd) { - WLog_ERR(TAG, "history buffer overflow"); + WLog_ERR(TAG, "history buffer overflow"); return -1005; } - SrcPtr = &HistoryBuffer[(HistoryPtr - HistoryBuffer - CopyOffset) & (CompressionLevel ? 0xFFFF : - 0x1FFF)]; + SrcPtr = &HistoryBuffer[(HistoryPtr - HistoryBuffer - CopyOffset) & + (CompressionLevel ? 0xFFFF : 0x1FFF)]; do { *HistoryPtr++ = *SrcPtr++; - } - while (--LengthOfMatch); + } while (--LengthOfMatch); } *pDstSize = (UINT32)(HistoryPtr - mppc->HistoryPtr); @@ -496,7 +497,7 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppD accumulator = Sym1; #ifdef DEBUG_MPPC - WLog_DBG(TAG, "%"PRIu32"", accumulator); + WLog_DBG(TAG, "%" PRIu32 "", accumulator); #endif if (accumulator < 0x80) @@ -528,7 +529,7 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppD } #ifdef DEBUG_MPPC - WLog_DBG(TAG, "<%"PRIu32",%"PRIu32">", CopyOffset, LengthOfMatch); + WLog_DBG(TAG, "<%" PRIu32 ",%" PRIu32 ">", CopyOffset, LengthOfMatch); #endif /* Encode CopyOffset */ @@ -665,19 +666,22 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppD accumulator = 0xFFE000 | (LengthOfMatch & 0x0FFF); BitStream_Write_Bits(bs, accumulator, 24); } - else if (((LengthOfMatch >= 8192) && (LengthOfMatch < 16384)) && CompressionLevel) /* RDP5 */ + else if (((LengthOfMatch >= 8192) && (LengthOfMatch < 16384)) && + CompressionLevel) /* RDP5 */ { /* 1111111111110 + 13 lower bits of LengthOfMatch */ accumulator = 0x3FFC000 | (LengthOfMatch & 0x1FFF); BitStream_Write_Bits(bs, accumulator, 26); } - else if (((LengthOfMatch >= 16384) && (LengthOfMatch < 32768)) && CompressionLevel) /* RDP5 */ + else if (((LengthOfMatch >= 16384) && (LengthOfMatch < 32768)) && + CompressionLevel) /* RDP5 */ { /* 11111111111110 + 14 lower bits of LengthOfMatch */ accumulator = 0xFFF8000 | (LengthOfMatch & 0x3FFF); BitStream_Write_Bits(bs, accumulator, 28); } - else if (((LengthOfMatch >= 32768) && (LengthOfMatch < 65536)) && CompressionLevel) /* RDP5 */ + else if (((LengthOfMatch >= 32768) && (LengthOfMatch < 65536)) && + CompressionLevel) /* RDP5 */ { /* 111111111111110 + 15 lower bits of LengthOfMatch */ accumulator = 0x3FFF0000 | (LengthOfMatch & 0x7FFF); @@ -702,7 +706,7 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppD accumulator = *pSrcPtr; #ifdef DEBUG_MPPC - WLog_DBG(TAG, "%"PRIu32"", accumulator); + WLog_DBG(TAG, "%" PRIu32 "", accumulator); #endif if (accumulator < 0x80) diff --git a/libfreerdp/codec/ncrush.c b/libfreerdp/codec/ncrush.c index 1186c1a35..8b50b0b58 100644 --- a/libfreerdp/codec/ncrush.c +++ b/libfreerdp/codec/ncrush.c @@ -32,560 +32,739 @@ #define TAG FREERDP_TAG("codec") -static const UINT16 HuffTableLEC[8192] = -{ - 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA068, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B3, - 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA091, 0x5121, 0x7080, 0x6115, 0xA03A, 0x610A, 0x9012, 0x611D, 0xA0D7, - 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07A, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C4, - 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A1, 0x5121, 0x7102, 0x6116, 0xA056, 0x610C, 0x901D, 0x611E, 0xA0E8, - 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA071, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BB, - 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA099, 0x5121, 0x70FF, 0x6115, 0xA04C, 0x610A, 0x9017, 0x611D, 0xA0DF, - 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA087, 0x5111, 0x700A, 0x6114, 0xA023, 0x6109, 0x80FE, 0x611C, 0xA0CE, - 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0A9, 0x5121, 0x7103, 0x6116, 0xA05F, 0x610C, 0x9022, 0x611E, 0xA0F5, - 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06C, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B7, - 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA095, 0x5121, 0x7080, 0x6115, 0xA046, 0x610A, 0x9015, 0x611D, 0xA0DB, - 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA07E, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0C9, - 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A5, 0x5121, 0x7102, 0x6116, 0xA05B, 0x610C, 0x901F, 0x611E, 0xA0EC, - 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA075, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0BF, - 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09D, 0x5121, 0x70FF, 0x6115, 0xA052, 0x610A, 0x901B, 0x611D, 0xA0E4, - 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08C, 0x5111, 0x700A, 0x6114, 0xA02F, 0x6109, 0x8120, 0x611C, 0xA0D3, - 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AE, 0x5121, 0x7103, 0x6116, 0xA064, 0x610C, 0x9025, 0x611E, 0xA0FA, - 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06A, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B5, - 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA093, 0x5121, 0x7080, 0x6115, 0xA03D, 0x610A, 0x9014, 0x611D, 0xA0D9, - 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07C, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C7, - 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A3, 0x5121, 0x7102, 0x6116, 0xA058, 0x610C, 0x901E, 0x611E, 0xA0EA, - 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA073, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BD, - 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09B, 0x5121, 0x70FF, 0x6115, 0xA04E, 0x610A, 0x901A, 0x611D, 0xA0E2, - 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08A, 0x5111, 0x700A, 0x6114, 0xA02D, 0x6109, 0x80FE, 0x611C, 0xA0D1, - 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AC, 0x5121, 0x7103, 0x6116, 0xA062, 0x610C, 0x9024, 0x611E, 0xA0F7, - 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06E, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0B9, - 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA097, 0x5121, 0x7080, 0x6115, 0xA04A, 0x610A, 0x9016, 0x611D, 0xA0DD, - 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA085, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CB, - 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A7, 0x5121, 0x7102, 0x6116, 0xA05D, 0x610C, 0x9021, 0x611E, 0xA0EF, - 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA077, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C2, - 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA09F, 0x5121, 0x70FF, 0x6115, 0xA054, 0x610A, 0x901C, 0x611D, 0xA0E6, - 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08E, 0x5111, 0x700A, 0x6114, 0xA034, 0x6109, 0x8120, 0x611C, 0xA0D5, - 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B0, 0x5121, 0x7103, 0x6116, 0xA066, 0x610C, 0x9026, 0x611E, 0xA104, - 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA069, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B4, - 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA092, 0x5121, 0x7080, 0x6115, 0xA03B, 0x610A, 0x9012, 0x611D, 0xA0D8, - 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07B, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C5, - 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A2, 0x5121, 0x7102, 0x6116, 0xA057, 0x610C, 0x901D, 0x611E, 0xA0E9, - 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA072, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BC, - 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA09A, 0x5121, 0x70FF, 0x6115, 0xA04D, 0x610A, 0x9017, 0x611D, 0xA0E1, - 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA089, 0x5111, 0x700A, 0x6114, 0xA02B, 0x6109, 0x80FE, 0x611C, 0xA0CF, - 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0AA, 0x5121, 0x7103, 0x6116, 0xA061, 0x610C, 0x9022, 0x611E, 0xA0F6, - 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06D, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B8, - 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA096, 0x5121, 0x7080, 0x6115, 0xA047, 0x610A, 0x9015, 0x611D, 0xA0DC, - 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA083, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0CA, - 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A6, 0x5121, 0x7102, 0x6116, 0xA05C, 0x610C, 0x901F, 0x611E, 0xA0ED, - 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA076, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0C1, - 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09E, 0x5121, 0x70FF, 0x6115, 0xA053, 0x610A, 0x901B, 0x611D, 0xA0E5, - 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08D, 0x5111, 0x700A, 0x6114, 0xA032, 0x6109, 0x8120, 0x611C, 0xA0D4, - 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AF, 0x5121, 0x7103, 0x6116, 0xA065, 0x610C, 0x9025, 0x611E, 0xA0FB, - 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06B, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B6, - 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA094, 0x5121, 0x7080, 0x6115, 0xA045, 0x610A, 0x9014, 0x611D, 0xA0DA, - 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07D, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C8, - 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A4, 0x5121, 0x7102, 0x6116, 0xA05A, 0x610C, 0x901E, 0x611E, 0xA0EB, - 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA074, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BE, - 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09C, 0x5121, 0x70FF, 0x6115, 0xA04F, 0x610A, 0x901A, 0x611D, 0xA0E3, - 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08B, 0x5111, 0x700A, 0x6114, 0xA02E, 0x6109, 0x80FE, 0x611C, 0xA0D2, - 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AD, 0x5121, 0x7103, 0x6116, 0xA063, 0x610C, 0x9024, 0x611E, 0xA0F9, - 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06F, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0BA, - 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA098, 0x5121, 0x7080, 0x6115, 0xA04B, 0x610A, 0x9016, 0x611D, 0xA0DE, - 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA086, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CD, - 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A8, 0x5121, 0x7102, 0x6116, 0xA05E, 0x610C, 0x9021, 0x611E, 0xA0F3, - 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA079, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C3, - 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA0A0, 0x5121, 0x70FF, 0x6115, 0xA055, 0x610A, 0x901C, 0x611D, 0xA0E7, - 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08F, 0x5111, 0x700A, 0x6114, 0xA036, 0x6109, 0x8120, 0x611C, 0xA0D6, - 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B1, 0x5121, 0x7103, 0x6116, 0xA067, 0x610C, 0x9026, 0x611E, 0xB0B2, - 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA068, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B3, - 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA091, 0x5121, 0x7080, 0x6115, 0xA03A, 0x610A, 0x9012, 0x611D, 0xA0D7, - 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07A, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C4, - 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A1, 0x5121, 0x7102, 0x6116, 0xA056, 0x610C, 0x901D, 0x611E, 0xA0E8, - 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA071, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BB, - 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA099, 0x5121, 0x70FF, 0x6115, 0xA04C, 0x610A, 0x9017, 0x611D, 0xA0DF, - 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA087, 0x5111, 0x700A, 0x6114, 0xA023, 0x6109, 0x80FE, 0x611C, 0xA0CE, - 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0A9, 0x5121, 0x7103, 0x6116, 0xA05F, 0x610C, 0x9022, 0x611E, 0xA0F5, - 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06C, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B7, - 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA095, 0x5121, 0x7080, 0x6115, 0xA046, 0x610A, 0x9015, 0x611D, 0xA0DB, - 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA07E, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0C9, - 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A5, 0x5121, 0x7102, 0x6116, 0xA05B, 0x610C, 0x901F, 0x611E, 0xA0EC, - 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA075, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0BF, - 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09D, 0x5121, 0x70FF, 0x6115, 0xA052, 0x610A, 0x901B, 0x611D, 0xA0E4, - 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08C, 0x5111, 0x700A, 0x6114, 0xA02F, 0x6109, 0x8120, 0x611C, 0xA0D3, - 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AE, 0x5121, 0x7103, 0x6116, 0xA064, 0x610C, 0x9025, 0x611E, 0xA0FA, - 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06A, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B5, - 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA093, 0x5121, 0x7080, 0x6115, 0xA03D, 0x610A, 0x9014, 0x611D, 0xA0D9, - 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07C, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C7, - 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A3, 0x5121, 0x7102, 0x6116, 0xA058, 0x610C, 0x901E, 0x611E, 0xA0EA, - 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA073, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BD, - 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09B, 0x5121, 0x70FF, 0x6115, 0xA04E, 0x610A, 0x901A, 0x611D, 0xA0E2, - 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08A, 0x5111, 0x700A, 0x6114, 0xA02D, 0x6109, 0x80FE, 0x611C, 0xA0D1, - 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AC, 0x5121, 0x7103, 0x6116, 0xA062, 0x610C, 0x9024, 0x611E, 0xA0F7, - 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06E, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0B9, - 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA097, 0x5121, 0x7080, 0x6115, 0xA04A, 0x610A, 0x9016, 0x611D, 0xA0DD, - 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA085, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CB, - 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A7, 0x5121, 0x7102, 0x6116, 0xA05D, 0x610C, 0x9021, 0x611E, 0xA0EF, - 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA077, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C2, - 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA09F, 0x5121, 0x70FF, 0x6115, 0xA054, 0x610A, 0x901C, 0x611D, 0xA0E6, - 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08E, 0x5111, 0x700A, 0x6114, 0xA034, 0x6109, 0x8120, 0x611C, 0xA0D5, - 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B0, 0x5121, 0x7103, 0x6116, 0xA066, 0x610C, 0x9026, 0x611E, 0xA104, - 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA069, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B4, - 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA092, 0x5121, 0x7080, 0x6115, 0xA03B, 0x610A, 0x9012, 0x611D, 0xA0D8, - 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07B, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C5, - 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A2, 0x5121, 0x7102, 0x6116, 0xA057, 0x610C, 0x901D, 0x611E, 0xA0E9, - 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA072, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BC, - 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA09A, 0x5121, 0x70FF, 0x6115, 0xA04D, 0x610A, 0x9017, 0x611D, 0xA0E1, - 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA089, 0x5111, 0x700A, 0x6114, 0xA02B, 0x6109, 0x80FE, 0x611C, 0xA0CF, - 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0AA, 0x5121, 0x7103, 0x6116, 0xA061, 0x610C, 0x9022, 0x611E, 0xA0F6, - 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06D, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B8, - 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA096, 0x5121, 0x7080, 0x6115, 0xA047, 0x610A, 0x9015, 0x611D, 0xA0DC, - 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA083, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0CA, - 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A6, 0x5121, 0x7102, 0x6116, 0xA05C, 0x610C, 0x901F, 0x611E, 0xA0ED, - 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA076, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0C1, - 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09E, 0x5121, 0x70FF, 0x6115, 0xA053, 0x610A, 0x901B, 0x611D, 0xA0E5, - 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08D, 0x5111, 0x700A, 0x6114, 0xA032, 0x6109, 0x8120, 0x611C, 0xA0D4, - 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AF, 0x5121, 0x7103, 0x6116, 0xA065, 0x610C, 0x9025, 0x611E, 0xA0FB, - 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06B, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B6, - 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA094, 0x5121, 0x7080, 0x6115, 0xA045, 0x610A, 0x9014, 0x611D, 0xA0DA, - 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07D, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C8, - 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A4, 0x5121, 0x7102, 0x6116, 0xA05A, 0x610C, 0x901E, 0x611E, 0xA0EB, - 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA074, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BE, - 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09C, 0x5121, 0x70FF, 0x6115, 0xA04F, 0x610A, 0x901A, 0x611D, 0xA0E3, - 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08B, 0x5111, 0x700A, 0x6114, 0xA02E, 0x6109, 0x80FE, 0x611C, 0xA0D2, - 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AD, 0x5121, 0x7103, 0x6116, 0xA063, 0x610C, 0x9024, 0x611E, 0xA0F9, - 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06F, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0BA, - 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA098, 0x5121, 0x7080, 0x6115, 0xA04B, 0x610A, 0x9016, 0x611D, 0xA0DE, - 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA086, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CD, - 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A8, 0x5121, 0x7102, 0x6116, 0xA05E, 0x610C, 0x9021, 0x611E, 0xA0F3, - 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA079, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C3, - 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA0A0, 0x5121, 0x70FF, 0x6115, 0xA055, 0x610A, 0x901C, 0x611D, 0xA0E7, - 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08F, 0x5111, 0x700A, 0x6114, 0xA036, 0x6109, 0x8120, 0x611C, 0xA0D6, - 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B1, 0x5121, 0x7103, 0x6116, 0xA067, 0x610C, 0x9026, 0x611E, 0xD0AB, - 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA068, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B3, - 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA091, 0x5121, 0x7080, 0x6115, 0xA03A, 0x610A, 0x9012, 0x611D, 0xA0D7, - 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07A, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C4, - 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A1, 0x5121, 0x7102, 0x6116, 0xA056, 0x610C, 0x901D, 0x611E, 0xA0E8, - 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA071, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BB, - 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA099, 0x5121, 0x70FF, 0x6115, 0xA04C, 0x610A, 0x9017, 0x611D, 0xA0DF, - 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA087, 0x5111, 0x700A, 0x6114, 0xA023, 0x6109, 0x80FE, 0x611C, 0xA0CE, - 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0A9, 0x5121, 0x7103, 0x6116, 0xA05F, 0x610C, 0x9022, 0x611E, 0xA0F5, - 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06C, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B7, - 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA095, 0x5121, 0x7080, 0x6115, 0xA046, 0x610A, 0x9015, 0x611D, 0xA0DB, - 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA07E, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0C9, - 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A5, 0x5121, 0x7102, 0x6116, 0xA05B, 0x610C, 0x901F, 0x611E, 0xA0EC, - 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA075, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0BF, - 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09D, 0x5121, 0x70FF, 0x6115, 0xA052, 0x610A, 0x901B, 0x611D, 0xA0E4, - 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08C, 0x5111, 0x700A, 0x6114, 0xA02F, 0x6109, 0x8120, 0x611C, 0xA0D3, - 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AE, 0x5121, 0x7103, 0x6116, 0xA064, 0x610C, 0x9025, 0x611E, 0xA0FA, - 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06A, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B5, - 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA093, 0x5121, 0x7080, 0x6115, 0xA03D, 0x610A, 0x9014, 0x611D, 0xA0D9, - 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07C, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C7, - 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A3, 0x5121, 0x7102, 0x6116, 0xA058, 0x610C, 0x901E, 0x611E, 0xA0EA, - 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA073, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BD, - 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09B, 0x5121, 0x70FF, 0x6115, 0xA04E, 0x610A, 0x901A, 0x611D, 0xA0E2, - 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08A, 0x5111, 0x700A, 0x6114, 0xA02D, 0x6109, 0x80FE, 0x611C, 0xA0D1, - 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AC, 0x5121, 0x7103, 0x6116, 0xA062, 0x610C, 0x9024, 0x611E, 0xA0F7, - 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06E, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0B9, - 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA097, 0x5121, 0x7080, 0x6115, 0xA04A, 0x610A, 0x9016, 0x611D, 0xA0DD, - 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA085, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CB, - 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A7, 0x5121, 0x7102, 0x6116, 0xA05D, 0x610C, 0x9021, 0x611E, 0xA0EF, - 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA077, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C2, - 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA09F, 0x5121, 0x70FF, 0x6115, 0xA054, 0x610A, 0x901C, 0x611D, 0xA0E6, - 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08E, 0x5111, 0x700A, 0x6114, 0xA034, 0x6109, 0x8120, 0x611C, 0xA0D5, - 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B0, 0x5121, 0x7103, 0x6116, 0xA066, 0x610C, 0x9026, 0x611E, 0xA104, - 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA069, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B4, - 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA092, 0x5121, 0x7080, 0x6115, 0xA03B, 0x610A, 0x9012, 0x611D, 0xA0D8, - 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07B, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C5, - 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A2, 0x5121, 0x7102, 0x6116, 0xA057, 0x610C, 0x901D, 0x611E, 0xA0E9, - 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA072, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BC, - 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA09A, 0x5121, 0x70FF, 0x6115, 0xA04D, 0x610A, 0x9017, 0x611D, 0xA0E1, - 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA089, 0x5111, 0x700A, 0x6114, 0xA02B, 0x6109, 0x80FE, 0x611C, 0xA0CF, - 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0AA, 0x5121, 0x7103, 0x6116, 0xA061, 0x610C, 0x9022, 0x611E, 0xA0F6, - 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06D, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B8, - 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA096, 0x5121, 0x7080, 0x6115, 0xA047, 0x610A, 0x9015, 0x611D, 0xA0DC, - 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA083, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0CA, - 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A6, 0x5121, 0x7102, 0x6116, 0xA05C, 0x610C, 0x901F, 0x611E, 0xA0ED, - 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA076, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0C1, - 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09E, 0x5121, 0x70FF, 0x6115, 0xA053, 0x610A, 0x901B, 0x611D, 0xA0E5, - 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08D, 0x5111, 0x700A, 0x6114, 0xA032, 0x6109, 0x8120, 0x611C, 0xA0D4, - 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AF, 0x5121, 0x7103, 0x6116, 0xA065, 0x610C, 0x9025, 0x611E, 0xA0FB, - 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06B, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B6, - 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA094, 0x5121, 0x7080, 0x6115, 0xA045, 0x610A, 0x9014, 0x611D, 0xA0DA, - 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07D, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C8, - 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A4, 0x5121, 0x7102, 0x6116, 0xA05A, 0x610C, 0x901E, 0x611E, 0xA0EB, - 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA074, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BE, - 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09C, 0x5121, 0x70FF, 0x6115, 0xA04F, 0x610A, 0x901A, 0x611D, 0xA0E3, - 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08B, 0x5111, 0x700A, 0x6114, 0xA02E, 0x6109, 0x80FE, 0x611C, 0xA0D2, - 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AD, 0x5121, 0x7103, 0x6116, 0xA063, 0x610C, 0x9024, 0x611E, 0xA0F9, - 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06F, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0BA, - 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA098, 0x5121, 0x7080, 0x6115, 0xA04B, 0x610A, 0x9016, 0x611D, 0xA0DE, - 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA086, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CD, - 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A8, 0x5121, 0x7102, 0x6116, 0xA05E, 0x610C, 0x9021, 0x611E, 0xA0F3, - 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA079, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C3, - 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA0A0, 0x5121, 0x70FF, 0x6115, 0xA055, 0x610A, 0x901C, 0x611D, 0xA0E7, - 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08F, 0x5111, 0x700A, 0x6114, 0xA036, 0x6109, 0x8120, 0x611C, 0xA0D6, - 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B1, 0x5121, 0x7103, 0x6116, 0xA067, 0x610C, 0x9026, 0x611E, 0xB0B2, - 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA068, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B3, - 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA091, 0x5121, 0x7080, 0x6115, 0xA03A, 0x610A, 0x9012, 0x611D, 0xA0D7, - 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07A, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C4, - 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A1, 0x5121, 0x7102, 0x6116, 0xA056, 0x610C, 0x901D, 0x611E, 0xA0E8, - 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA071, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BB, - 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA099, 0x5121, 0x70FF, 0x6115, 0xA04C, 0x610A, 0x9017, 0x611D, 0xA0DF, - 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA087, 0x5111, 0x700A, 0x6114, 0xA023, 0x6109, 0x80FE, 0x611C, 0xA0CE, - 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0A9, 0x5121, 0x7103, 0x6116, 0xA05F, 0x610C, 0x9022, 0x611E, 0xA0F5, - 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06C, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B7, - 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA095, 0x5121, 0x7080, 0x6115, 0xA046, 0x610A, 0x9015, 0x611D, 0xA0DB, - 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA07E, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0C9, - 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A5, 0x5121, 0x7102, 0x6116, 0xA05B, 0x610C, 0x901F, 0x611E, 0xA0EC, - 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA075, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0BF, - 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09D, 0x5121, 0x70FF, 0x6115, 0xA052, 0x610A, 0x901B, 0x611D, 0xA0E4, - 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08C, 0x5111, 0x700A, 0x6114, 0xA02F, 0x6109, 0x8120, 0x611C, 0xA0D3, - 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AE, 0x5121, 0x7103, 0x6116, 0xA064, 0x610C, 0x9025, 0x611E, 0xA0FA, - 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06A, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B5, - 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA093, 0x5121, 0x7080, 0x6115, 0xA03D, 0x610A, 0x9014, 0x611D, 0xA0D9, - 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07C, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C7, - 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A3, 0x5121, 0x7102, 0x6116, 0xA058, 0x610C, 0x901E, 0x611E, 0xA0EA, - 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA073, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BD, - 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09B, 0x5121, 0x70FF, 0x6115, 0xA04E, 0x610A, 0x901A, 0x611D, 0xA0E2, - 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08A, 0x5111, 0x700A, 0x6114, 0xA02D, 0x6109, 0x80FE, 0x611C, 0xA0D1, - 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AC, 0x5121, 0x7103, 0x6116, 0xA062, 0x610C, 0x9024, 0x611E, 0xA0F7, - 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06E, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0B9, - 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA097, 0x5121, 0x7080, 0x6115, 0xA04A, 0x610A, 0x9016, 0x611D, 0xA0DD, - 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA085, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CB, - 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A7, 0x5121, 0x7102, 0x6116, 0xA05D, 0x610C, 0x9021, 0x611E, 0xA0EF, - 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA077, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C2, - 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA09F, 0x5121, 0x70FF, 0x6115, 0xA054, 0x610A, 0x901C, 0x611D, 0xA0E6, - 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08E, 0x5111, 0x700A, 0x6114, 0xA034, 0x6109, 0x8120, 0x611C, 0xA0D5, - 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B0, 0x5121, 0x7103, 0x6116, 0xA066, 0x610C, 0x9026, 0x611E, 0xA104, - 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA069, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B4, - 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA092, 0x5121, 0x7080, 0x6115, 0xA03B, 0x610A, 0x9012, 0x611D, 0xA0D8, - 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07B, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C5, - 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A2, 0x5121, 0x7102, 0x6116, 0xA057, 0x610C, 0x901D, 0x611E, 0xA0E9, - 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA072, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BC, - 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA09A, 0x5121, 0x70FF, 0x6115, 0xA04D, 0x610A, 0x9017, 0x611D, 0xA0E1, - 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA089, 0x5111, 0x700A, 0x6114, 0xA02B, 0x6109, 0x80FE, 0x611C, 0xA0CF, - 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0AA, 0x5121, 0x7103, 0x6116, 0xA061, 0x610C, 0x9022, 0x611E, 0xA0F6, - 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06D, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B8, - 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA096, 0x5121, 0x7080, 0x6115, 0xA047, 0x610A, 0x9015, 0x611D, 0xA0DC, - 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA083, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0CA, - 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A6, 0x5121, 0x7102, 0x6116, 0xA05C, 0x610C, 0x901F, 0x611E, 0xA0ED, - 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA076, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0C1, - 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09E, 0x5121, 0x70FF, 0x6115, 0xA053, 0x610A, 0x901B, 0x611D, 0xA0E5, - 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08D, 0x5111, 0x700A, 0x6114, 0xA032, 0x6109, 0x8120, 0x611C, 0xA0D4, - 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AF, 0x5121, 0x7103, 0x6116, 0xA065, 0x610C, 0x9025, 0x611E, 0xA0FB, - 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06B, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B6, - 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA094, 0x5121, 0x7080, 0x6115, 0xA045, 0x610A, 0x9014, 0x611D, 0xA0DA, - 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07D, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C8, - 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A4, 0x5121, 0x7102, 0x6116, 0xA05A, 0x610C, 0x901E, 0x611E, 0xA0EB, - 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA074, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BE, - 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09C, 0x5121, 0x70FF, 0x6115, 0xA04F, 0x610A, 0x901A, 0x611D, 0xA0E3, - 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08B, 0x5111, 0x700A, 0x6114, 0xA02E, 0x6109, 0x80FE, 0x611C, 0xA0D2, - 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AD, 0x5121, 0x7103, 0x6116, 0xA063, 0x610C, 0x9024, 0x611E, 0xA0F9, - 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06F, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0BA, - 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA098, 0x5121, 0x7080, 0x6115, 0xA04B, 0x610A, 0x9016, 0x611D, 0xA0DE, - 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA086, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CD, - 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A8, 0x5121, 0x7102, 0x6116, 0xA05E, 0x610C, 0x9021, 0x611E, 0xA0F3, - 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA079, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C3, - 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA0A0, 0x5121, 0x70FF, 0x6115, 0xA055, 0x610A, 0x901C, 0x611D, 0xA0E7, - 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08F, 0x5111, 0x700A, 0x6114, 0xA036, 0x6109, 0x8120, 0x611C, 0xA0D6, - 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B1, 0x5121, 0x7103, 0x6116, 0xA067, 0x610C, 0x9026, 0x611E, 0xD101, - 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA068, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B3, - 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA091, 0x5121, 0x7080, 0x6115, 0xA03A, 0x610A, 0x9012, 0x611D, 0xA0D7, - 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07A, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C4, - 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A1, 0x5121, 0x7102, 0x6116, 0xA056, 0x610C, 0x901D, 0x611E, 0xA0E8, - 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA071, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BB, - 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA099, 0x5121, 0x70FF, 0x6115, 0xA04C, 0x610A, 0x9017, 0x611D, 0xA0DF, - 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA087, 0x5111, 0x700A, 0x6114, 0xA023, 0x6109, 0x80FE, 0x611C, 0xA0CE, - 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0A9, 0x5121, 0x7103, 0x6116, 0xA05F, 0x610C, 0x9022, 0x611E, 0xA0F5, - 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06C, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B7, - 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA095, 0x5121, 0x7080, 0x6115, 0xA046, 0x610A, 0x9015, 0x611D, 0xA0DB, - 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA07E, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0C9, - 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A5, 0x5121, 0x7102, 0x6116, 0xA05B, 0x610C, 0x901F, 0x611E, 0xA0EC, - 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA075, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0BF, - 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09D, 0x5121, 0x70FF, 0x6115, 0xA052, 0x610A, 0x901B, 0x611D, 0xA0E4, - 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08C, 0x5111, 0x700A, 0x6114, 0xA02F, 0x6109, 0x8120, 0x611C, 0xA0D3, - 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AE, 0x5121, 0x7103, 0x6116, 0xA064, 0x610C, 0x9025, 0x611E, 0xA0FA, - 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06A, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B5, - 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA093, 0x5121, 0x7080, 0x6115, 0xA03D, 0x610A, 0x9014, 0x611D, 0xA0D9, - 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07C, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C7, - 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A3, 0x5121, 0x7102, 0x6116, 0xA058, 0x610C, 0x901E, 0x611E, 0xA0EA, - 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA073, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BD, - 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09B, 0x5121, 0x70FF, 0x6115, 0xA04E, 0x610A, 0x901A, 0x611D, 0xA0E2, - 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08A, 0x5111, 0x700A, 0x6114, 0xA02D, 0x6109, 0x80FE, 0x611C, 0xA0D1, - 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AC, 0x5121, 0x7103, 0x6116, 0xA062, 0x610C, 0x9024, 0x611E, 0xA0F7, - 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06E, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0B9, - 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA097, 0x5121, 0x7080, 0x6115, 0xA04A, 0x610A, 0x9016, 0x611D, 0xA0DD, - 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA085, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CB, - 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A7, 0x5121, 0x7102, 0x6116, 0xA05D, 0x610C, 0x9021, 0x611E, 0xA0EF, - 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA077, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C2, - 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA09F, 0x5121, 0x70FF, 0x6115, 0xA054, 0x610A, 0x901C, 0x611D, 0xA0E6, - 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08E, 0x5111, 0x700A, 0x6114, 0xA034, 0x6109, 0x8120, 0x611C, 0xA0D5, - 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B0, 0x5121, 0x7103, 0x6116, 0xA066, 0x610C, 0x9026, 0x611E, 0xA104, - 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA069, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B4, - 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA092, 0x5121, 0x7080, 0x6115, 0xA03B, 0x610A, 0x9012, 0x611D, 0xA0D8, - 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07B, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C5, - 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A2, 0x5121, 0x7102, 0x6116, 0xA057, 0x610C, 0x901D, 0x611E, 0xA0E9, - 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA072, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BC, - 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA09A, 0x5121, 0x70FF, 0x6115, 0xA04D, 0x610A, 0x9017, 0x611D, 0xA0E1, - 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA089, 0x5111, 0x700A, 0x6114, 0xA02B, 0x6109, 0x80FE, 0x611C, 0xA0CF, - 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0AA, 0x5121, 0x7103, 0x6116, 0xA061, 0x610C, 0x9022, 0x611E, 0xA0F6, - 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06D, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B8, - 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA096, 0x5121, 0x7080, 0x6115, 0xA047, 0x610A, 0x9015, 0x611D, 0xA0DC, - 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA083, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0CA, - 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A6, 0x5121, 0x7102, 0x6116, 0xA05C, 0x610C, 0x901F, 0x611E, 0xA0ED, - 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA076, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0C1, - 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09E, 0x5121, 0x70FF, 0x6115, 0xA053, 0x610A, 0x901B, 0x611D, 0xA0E5, - 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08D, 0x5111, 0x700A, 0x6114, 0xA032, 0x6109, 0x8120, 0x611C, 0xA0D4, - 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AF, 0x5121, 0x7103, 0x6116, 0xA065, 0x610C, 0x9025, 0x611E, 0xA0FB, - 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06B, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B6, - 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA094, 0x5121, 0x7080, 0x6115, 0xA045, 0x610A, 0x9014, 0x611D, 0xA0DA, - 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07D, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C8, - 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A4, 0x5121, 0x7102, 0x6116, 0xA05A, 0x610C, 0x901E, 0x611E, 0xA0EB, - 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA074, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BE, - 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09C, 0x5121, 0x70FF, 0x6115, 0xA04F, 0x610A, 0x901A, 0x611D, 0xA0E3, - 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08B, 0x5111, 0x700A, 0x6114, 0xA02E, 0x6109, 0x80FE, 0x611C, 0xA0D2, - 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AD, 0x5121, 0x7103, 0x6116, 0xA063, 0x610C, 0x9024, 0x611E, 0xA0F9, - 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06F, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0BA, - 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA098, 0x5121, 0x7080, 0x6115, 0xA04B, 0x610A, 0x9016, 0x611D, 0xA0DE, - 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA086, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CD, - 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A8, 0x5121, 0x7102, 0x6116, 0xA05E, 0x610C, 0x9021, 0x611E, 0xA0F3, - 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA079, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C3, - 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA0A0, 0x5121, 0x70FF, 0x6115, 0xA055, 0x610A, 0x901C, 0x611D, 0xA0E7, - 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08F, 0x5111, 0x700A, 0x6114, 0xA036, 0x6109, 0x8120, 0x611C, 0xA0D6, - 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B1, 0x5121, 0x7103, 0x6116, 0xA067, 0x610C, 0x9026, 0x611E, 0xB0B2, - 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA068, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B3, - 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA091, 0x5121, 0x7080, 0x6115, 0xA03A, 0x610A, 0x9012, 0x611D, 0xA0D7, - 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07A, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C4, - 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A1, 0x5121, 0x7102, 0x6116, 0xA056, 0x610C, 0x901D, 0x611E, 0xA0E8, - 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA071, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BB, - 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA099, 0x5121, 0x70FF, 0x6115, 0xA04C, 0x610A, 0x9017, 0x611D, 0xA0DF, - 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA087, 0x5111, 0x700A, 0x6114, 0xA023, 0x6109, 0x80FE, 0x611C, 0xA0CE, - 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0A9, 0x5121, 0x7103, 0x6116, 0xA05F, 0x610C, 0x9022, 0x611E, 0xA0F5, - 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06C, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B7, - 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA095, 0x5121, 0x7080, 0x6115, 0xA046, 0x610A, 0x9015, 0x611D, 0xA0DB, - 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA07E, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0C9, - 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A5, 0x5121, 0x7102, 0x6116, 0xA05B, 0x610C, 0x901F, 0x611E, 0xA0EC, - 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA075, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0BF, - 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09D, 0x5121, 0x70FF, 0x6115, 0xA052, 0x610A, 0x901B, 0x611D, 0xA0E4, - 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08C, 0x5111, 0x700A, 0x6114, 0xA02F, 0x6109, 0x8120, 0x611C, 0xA0D3, - 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AE, 0x5121, 0x7103, 0x6116, 0xA064, 0x610C, 0x9025, 0x611E, 0xA0FA, - 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06A, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B5, - 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA093, 0x5121, 0x7080, 0x6115, 0xA03D, 0x610A, 0x9014, 0x611D, 0xA0D9, - 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07C, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C7, - 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A3, 0x5121, 0x7102, 0x6116, 0xA058, 0x610C, 0x901E, 0x611E, 0xA0EA, - 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA073, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BD, - 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09B, 0x5121, 0x70FF, 0x6115, 0xA04E, 0x610A, 0x901A, 0x611D, 0xA0E2, - 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08A, 0x5111, 0x700A, 0x6114, 0xA02D, 0x6109, 0x80FE, 0x611C, 0xA0D1, - 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AC, 0x5121, 0x7103, 0x6116, 0xA062, 0x610C, 0x9024, 0x611E, 0xA0F7, - 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06E, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0B9, - 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA097, 0x5121, 0x7080, 0x6115, 0xA04A, 0x610A, 0x9016, 0x611D, 0xA0DD, - 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA085, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CB, - 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A7, 0x5121, 0x7102, 0x6116, 0xA05D, 0x610C, 0x9021, 0x611E, 0xA0EF, - 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA077, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C2, - 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA09F, 0x5121, 0x70FF, 0x6115, 0xA054, 0x610A, 0x901C, 0x611D, 0xA0E6, - 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08E, 0x5111, 0x700A, 0x6114, 0xA034, 0x6109, 0x8120, 0x611C, 0xA0D5, - 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B0, 0x5121, 0x7103, 0x6116, 0xA066, 0x610C, 0x9026, 0x611E, 0xA104, - 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA069, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B4, - 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA092, 0x5121, 0x7080, 0x6115, 0xA03B, 0x610A, 0x9012, 0x611D, 0xA0D8, - 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07B, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C5, - 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A2, 0x5121, 0x7102, 0x6116, 0xA057, 0x610C, 0x901D, 0x611E, 0xA0E9, - 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA072, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BC, - 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA09A, 0x5121, 0x70FF, 0x6115, 0xA04D, 0x610A, 0x9017, 0x611D, 0xA0E1, - 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA089, 0x5111, 0x700A, 0x6114, 0xA02B, 0x6109, 0x80FE, 0x611C, 0xA0CF, - 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0AA, 0x5121, 0x7103, 0x6116, 0xA061, 0x610C, 0x9022, 0x611E, 0xA0F6, - 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06D, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B8, - 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA096, 0x5121, 0x7080, 0x6115, 0xA047, 0x610A, 0x9015, 0x611D, 0xA0DC, - 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA083, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0CA, - 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A6, 0x5121, 0x7102, 0x6116, 0xA05C, 0x610C, 0x901F, 0x611E, 0xA0ED, - 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA076, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0C1, - 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09E, 0x5121, 0x70FF, 0x6115, 0xA053, 0x610A, 0x901B, 0x611D, 0xA0E5, - 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08D, 0x5111, 0x700A, 0x6114, 0xA032, 0x6109, 0x8120, 0x611C, 0xA0D4, - 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AF, 0x5121, 0x7103, 0x6116, 0xA065, 0x610C, 0x9025, 0x611E, 0xA0FB, - 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06B, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B6, - 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA094, 0x5121, 0x7080, 0x6115, 0xA045, 0x610A, 0x9014, 0x611D, 0xA0DA, - 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07D, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C8, - 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A4, 0x5121, 0x7102, 0x6116, 0xA05A, 0x610C, 0x901E, 0x611E, 0xA0EB, - 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA074, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BE, - 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09C, 0x5121, 0x70FF, 0x6115, 0xA04F, 0x610A, 0x901A, 0x611D, 0xA0E3, - 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08B, 0x5111, 0x700A, 0x6114, 0xA02E, 0x6109, 0x80FE, 0x611C, 0xA0D2, - 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AD, 0x5121, 0x7103, 0x6116, 0xA063, 0x610C, 0x9024, 0x611E, 0xA0F9, - 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06F, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0BA, - 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA098, 0x5121, 0x7080, 0x6115, 0xA04B, 0x610A, 0x9016, 0x611D, 0xA0DE, - 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA086, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CD, - 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A8, 0x5121, 0x7102, 0x6116, 0xA05E, 0x610C, 0x9021, 0x611E, 0xA0F3, - 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA079, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C3, - 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA0A0, 0x5121, 0x70FF, 0x6115, 0xA055, 0x610A, 0x901C, 0x611D, 0xA0E7, - 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08F, 0x5111, 0x700A, 0x6114, 0xA036, 0x6109, 0x8120, 0x611C, 0xA0D6, - 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B1, 0x5121, 0x7103, 0x6116, 0xA067, 0x610C, 0x9026, 0x611E, 0xD100, - 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA068, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B3, - 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA091, 0x5121, 0x7080, 0x6115, 0xA03A, 0x610A, 0x9012, 0x611D, 0xA0D7, - 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07A, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C4, - 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A1, 0x5121, 0x7102, 0x6116, 0xA056, 0x610C, 0x901D, 0x611E, 0xA0E8, - 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA071, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BB, - 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA099, 0x5121, 0x70FF, 0x6115, 0xA04C, 0x610A, 0x9017, 0x611D, 0xA0DF, - 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA087, 0x5111, 0x700A, 0x6114, 0xA023, 0x6109, 0x80FE, 0x611C, 0xA0CE, - 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0A9, 0x5121, 0x7103, 0x6116, 0xA05F, 0x610C, 0x9022, 0x611E, 0xA0F5, - 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06C, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B7, - 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA095, 0x5121, 0x7080, 0x6115, 0xA046, 0x610A, 0x9015, 0x611D, 0xA0DB, - 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA07E, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0C9, - 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A5, 0x5121, 0x7102, 0x6116, 0xA05B, 0x610C, 0x901F, 0x611E, 0xA0EC, - 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA075, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0BF, - 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09D, 0x5121, 0x70FF, 0x6115, 0xA052, 0x610A, 0x901B, 0x611D, 0xA0E4, - 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08C, 0x5111, 0x700A, 0x6114, 0xA02F, 0x6109, 0x8120, 0x611C, 0xA0D3, - 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AE, 0x5121, 0x7103, 0x6116, 0xA064, 0x610C, 0x9025, 0x611E, 0xA0FA, - 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06A, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B5, - 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA093, 0x5121, 0x7080, 0x6115, 0xA03D, 0x610A, 0x9014, 0x611D, 0xA0D9, - 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07C, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C7, - 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A3, 0x5121, 0x7102, 0x6116, 0xA058, 0x610C, 0x901E, 0x611E, 0xA0EA, - 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA073, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BD, - 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09B, 0x5121, 0x70FF, 0x6115, 0xA04E, 0x610A, 0x901A, 0x611D, 0xA0E2, - 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08A, 0x5111, 0x700A, 0x6114, 0xA02D, 0x6109, 0x80FE, 0x611C, 0xA0D1, - 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AC, 0x5121, 0x7103, 0x6116, 0xA062, 0x610C, 0x9024, 0x611E, 0xA0F7, - 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06E, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0B9, - 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA097, 0x5121, 0x7080, 0x6115, 0xA04A, 0x610A, 0x9016, 0x611D, 0xA0DD, - 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA085, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CB, - 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A7, 0x5121, 0x7102, 0x6116, 0xA05D, 0x610C, 0x9021, 0x611E, 0xA0EF, - 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA077, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C2, - 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA09F, 0x5121, 0x70FF, 0x6115, 0xA054, 0x610A, 0x901C, 0x611D, 0xA0E6, - 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08E, 0x5111, 0x700A, 0x6114, 0xA034, 0x6109, 0x8120, 0x611C, 0xA0D5, - 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B0, 0x5121, 0x7103, 0x6116, 0xA066, 0x610C, 0x9026, 0x611E, 0xA104, - 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA069, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B4, - 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA092, 0x5121, 0x7080, 0x6115, 0xA03B, 0x610A, 0x9012, 0x611D, 0xA0D8, - 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07B, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C5, - 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A2, 0x5121, 0x7102, 0x6116, 0xA057, 0x610C, 0x901D, 0x611E, 0xA0E9, - 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA072, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BC, - 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA09A, 0x5121, 0x70FF, 0x6115, 0xA04D, 0x610A, 0x9017, 0x611D, 0xA0E1, - 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA089, 0x5111, 0x700A, 0x6114, 0xA02B, 0x6109, 0x80FE, 0x611C, 0xA0CF, - 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0AA, 0x5121, 0x7103, 0x6116, 0xA061, 0x610C, 0x9022, 0x611E, 0xA0F6, - 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06D, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B8, - 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA096, 0x5121, 0x7080, 0x6115, 0xA047, 0x610A, 0x9015, 0x611D, 0xA0DC, - 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA083, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0CA, - 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A6, 0x5121, 0x7102, 0x6116, 0xA05C, 0x610C, 0x901F, 0x611E, 0xA0ED, - 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA076, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0C1, - 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09E, 0x5121, 0x70FF, 0x6115, 0xA053, 0x610A, 0x901B, 0x611D, 0xA0E5, - 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08D, 0x5111, 0x700A, 0x6114, 0xA032, 0x6109, 0x8120, 0x611C, 0xA0D4, - 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AF, 0x5121, 0x7103, 0x6116, 0xA065, 0x610C, 0x9025, 0x611E, 0xA0FB, - 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06B, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B6, - 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA094, 0x5121, 0x7080, 0x6115, 0xA045, 0x610A, 0x9014, 0x611D, 0xA0DA, - 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07D, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C8, - 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A4, 0x5121, 0x7102, 0x6116, 0xA05A, 0x610C, 0x901E, 0x611E, 0xA0EB, - 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA074, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BE, - 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09C, 0x5121, 0x70FF, 0x6115, 0xA04F, 0x610A, 0x901A, 0x611D, 0xA0E3, - 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08B, 0x5111, 0x700A, 0x6114, 0xA02E, 0x6109, 0x80FE, 0x611C, 0xA0D2, - 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AD, 0x5121, 0x7103, 0x6116, 0xA063, 0x610C, 0x9024, 0x611E, 0xA0F9, - 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06F, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0BA, - 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA098, 0x5121, 0x7080, 0x6115, 0xA04B, 0x610A, 0x9016, 0x611D, 0xA0DE, - 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA086, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CD, - 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A8, 0x5121, 0x7102, 0x6116, 0xA05E, 0x610C, 0x9021, 0x611E, 0xA0F3, - 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA079, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C3, - 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA0A0, 0x5121, 0x70FF, 0x6115, 0xA055, 0x610A, 0x901C, 0x611D, 0xA0E7, - 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08F, 0x5111, 0x700A, 0x6114, 0xA036, 0x6109, 0x8120, 0x611C, 0xA0D6, - 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B1, 0x5121, 0x7103, 0x6116, 0xA067, 0x610C, 0x9026, 0x611E, 0xB0B2, - 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA068, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B3, - 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA091, 0x5121, 0x7080, 0x6115, 0xA03A, 0x610A, 0x9012, 0x611D, 0xA0D7, - 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07A, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C4, - 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A1, 0x5121, 0x7102, 0x6116, 0xA056, 0x610C, 0x901D, 0x611E, 0xA0E8, - 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA071, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BB, - 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA099, 0x5121, 0x70FF, 0x6115, 0xA04C, 0x610A, 0x9017, 0x611D, 0xA0DF, - 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA087, 0x5111, 0x700A, 0x6114, 0xA023, 0x6109, 0x80FE, 0x611C, 0xA0CE, - 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0A9, 0x5121, 0x7103, 0x6116, 0xA05F, 0x610C, 0x9022, 0x611E, 0xA0F5, - 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06C, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B7, - 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA095, 0x5121, 0x7080, 0x6115, 0xA046, 0x610A, 0x9015, 0x611D, 0xA0DB, - 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA07E, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0C9, - 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A5, 0x5121, 0x7102, 0x6116, 0xA05B, 0x610C, 0x901F, 0x611E, 0xA0EC, - 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA075, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0BF, - 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09D, 0x5121, 0x70FF, 0x6115, 0xA052, 0x610A, 0x901B, 0x611D, 0xA0E4, - 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08C, 0x5111, 0x700A, 0x6114, 0xA02F, 0x6109, 0x8120, 0x611C, 0xA0D3, - 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AE, 0x5121, 0x7103, 0x6116, 0xA064, 0x610C, 0x9025, 0x611E, 0xA0FA, - 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06A, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B5, - 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA093, 0x5121, 0x7080, 0x6115, 0xA03D, 0x610A, 0x9014, 0x611D, 0xA0D9, - 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07C, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C7, - 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A3, 0x5121, 0x7102, 0x6116, 0xA058, 0x610C, 0x901E, 0x611E, 0xA0EA, - 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA073, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BD, - 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09B, 0x5121, 0x70FF, 0x6115, 0xA04E, 0x610A, 0x901A, 0x611D, 0xA0E2, - 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08A, 0x5111, 0x700A, 0x6114, 0xA02D, 0x6109, 0x80FE, 0x611C, 0xA0D1, - 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AC, 0x5121, 0x7103, 0x6116, 0xA062, 0x610C, 0x9024, 0x611E, 0xA0F7, - 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06E, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0B9, - 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA097, 0x5121, 0x7080, 0x6115, 0xA04A, 0x610A, 0x9016, 0x611D, 0xA0DD, - 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA085, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CB, - 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A7, 0x5121, 0x7102, 0x6116, 0xA05D, 0x610C, 0x9021, 0x611E, 0xA0EF, - 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA077, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C2, - 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA09F, 0x5121, 0x70FF, 0x6115, 0xA054, 0x610A, 0x901C, 0x611D, 0xA0E6, - 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08E, 0x5111, 0x700A, 0x6114, 0xA034, 0x6109, 0x8120, 0x611C, 0xA0D5, - 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B0, 0x5121, 0x7103, 0x6116, 0xA066, 0x610C, 0x9026, 0x611E, 0xA104, - 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA069, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B4, - 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA092, 0x5121, 0x7080, 0x6115, 0xA03B, 0x610A, 0x9012, 0x611D, 0xA0D8, - 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07B, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C5, - 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A2, 0x5121, 0x7102, 0x6116, 0xA057, 0x610C, 0x901D, 0x611E, 0xA0E9, - 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA072, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BC, - 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA09A, 0x5121, 0x70FF, 0x6115, 0xA04D, 0x610A, 0x9017, 0x611D, 0xA0E1, - 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA089, 0x5111, 0x700A, 0x6114, 0xA02B, 0x6109, 0x80FE, 0x611C, 0xA0CF, - 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0AA, 0x5121, 0x7103, 0x6116, 0xA061, 0x610C, 0x9022, 0x611E, 0xA0F6, - 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06D, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B8, - 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA096, 0x5121, 0x7080, 0x6115, 0xA047, 0x610A, 0x9015, 0x611D, 0xA0DC, - 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA083, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0CA, - 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A6, 0x5121, 0x7102, 0x6116, 0xA05C, 0x610C, 0x901F, 0x611E, 0xA0ED, - 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA076, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0C1, - 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09E, 0x5121, 0x70FF, 0x6115, 0xA053, 0x610A, 0x901B, 0x611D, 0xA0E5, - 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08D, 0x5111, 0x700A, 0x6114, 0xA032, 0x6109, 0x8120, 0x611C, 0xA0D4, - 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AF, 0x5121, 0x7103, 0x6116, 0xA065, 0x610C, 0x9025, 0x611E, 0xA0FB, - 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06B, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B6, - 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA094, 0x5121, 0x7080, 0x6115, 0xA045, 0x610A, 0x9014, 0x611D, 0xA0DA, - 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07D, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C8, - 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A4, 0x5121, 0x7102, 0x6116, 0xA05A, 0x610C, 0x901E, 0x611E, 0xA0EB, - 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA074, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BE, - 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09C, 0x5121, 0x70FF, 0x6115, 0xA04F, 0x610A, 0x901A, 0x611D, 0xA0E3, - 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08B, 0x5111, 0x700A, 0x6114, 0xA02E, 0x6109, 0x80FE, 0x611C, 0xA0D2, - 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AD, 0x5121, 0x7103, 0x6116, 0xA063, 0x610C, 0x9024, 0x611E, 0xA0F9, - 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06F, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0BA, - 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA098, 0x5121, 0x7080, 0x6115, 0xA04B, 0x610A, 0x9016, 0x611D, 0xA0DE, - 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA086, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CD, - 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A8, 0x5121, 0x7102, 0x6116, 0xA05E, 0x610C, 0x9021, 0x611E, 0xA0F3, - 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA079, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C3, - 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA0A0, 0x5121, 0x70FF, 0x6115, 0xA055, 0x610A, 0x901C, 0x611D, 0xA0E7, - 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08F, 0x5111, 0x700A, 0x6114, 0xA036, 0x6109, 0x8120, 0x611C, 0xA0D6, - 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B1, 0x5121, 0x7103, 0x6116, 0xA067, 0x610C, 0x9026, 0x611E, 0xD125 +static const UINT16 HuffTableLEC[8192] = { + 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA068, 0x5111, 0x7007, 0x6113, 0x90C0, + 0x6108, 0x8018, 0x611B, 0xA0B3, 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA091, + 0x5121, 0x7080, 0x6115, 0xA03A, 0x610A, 0x9012, 0x611D, 0xA0D7, 0x510B, 0x6122, 0x610E, 0x9035, + 0x6001, 0x7123, 0x6118, 0xA07A, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C4, + 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A1, 0x5121, 0x7102, 0x6116, 0xA056, + 0x610C, 0x901D, 0x611E, 0xA0E8, 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA071, + 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BB, 0x510F, 0x7004, 0x6110, 0x9049, + 0x6002, 0x800D, 0x6119, 0xA099, 0x5121, 0x70FF, 0x6115, 0xA04C, 0x610A, 0x9017, 0x611D, 0xA0DF, + 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA087, 0x5111, 0x700A, 0x6114, 0xA023, + 0x6109, 0x80FE, 0x611C, 0xA0CE, 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0A9, + 0x5121, 0x7103, 0x6116, 0xA05F, 0x610C, 0x9022, 0x611E, 0xA0F5, 0x510B, 0x611F, 0x610D, 0x9029, + 0x6000, 0x7105, 0x6117, 0xA06C, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B7, + 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA095, 0x5121, 0x7080, 0x6115, 0xA046, + 0x610A, 0x9015, 0x611D, 0xA0DB, 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA07E, + 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0C9, 0x510F, 0x7005, 0x6112, 0x907F, + 0x6107, 0x8010, 0x611A, 0xA0A5, 0x5121, 0x7102, 0x6116, 0xA05B, 0x610C, 0x901F, 0x611E, 0xA0EC, + 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA075, 0x5111, 0x7008, 0x6113, 0x90F1, + 0x6108, 0x8040, 0x611B, 0xA0BF, 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09D, + 0x5121, 0x70FF, 0x6115, 0xA052, 0x610A, 0x901B, 0x611D, 0xA0E4, 0x510B, 0x6122, 0x610E, 0x903F, + 0x6001, 0x7124, 0x6118, 0xA08C, 0x5111, 0x700A, 0x6114, 0xA02F, 0x6109, 0x8120, 0x611C, 0xA0D3, + 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AE, 0x5121, 0x7103, 0x6116, 0xA064, + 0x610C, 0x9025, 0x611E, 0xA0FA, 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06A, + 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B5, 0x510F, 0x7003, 0x6110, 0x9043, + 0x6002, 0x800B, 0x6119, 0xA093, 0x5121, 0x7080, 0x6115, 0xA03D, 0x610A, 0x9014, 0x611D, 0xA0D9, + 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07C, 0x5111, 0x7009, 0x6114, 0x90F8, + 0x6109, 0x8060, 0x611C, 0xA0C7, 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A3, + 0x5121, 0x7102, 0x6116, 0xA058, 0x610C, 0x901E, 0x611E, 0xA0EA, 0x510B, 0x611F, 0x610D, 0x9030, + 0x6000, 0x7106, 0x6117, 0xA073, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BD, + 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09B, 0x5121, 0x70FF, 0x6115, 0xA04E, + 0x610A, 0x901A, 0x611D, 0xA0E2, 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08A, + 0x5111, 0x700A, 0x6114, 0xA02D, 0x6109, 0x80FE, 0x611C, 0xA0D1, 0x510F, 0x7006, 0x6112, 0x9084, + 0x6107, 0x8011, 0x611A, 0xA0AC, 0x5121, 0x7103, 0x6116, 0xA062, 0x610C, 0x9024, 0x611E, 0xA0F7, + 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06E, 0x5111, 0x7007, 0x6113, 0x90D0, + 0x6108, 0x8019, 0x611B, 0xA0B9, 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA097, + 0x5121, 0x7080, 0x6115, 0xA04A, 0x610A, 0x9016, 0x611D, 0xA0DD, 0x510B, 0x6122, 0x610E, 0x9039, + 0x6001, 0x7123, 0x6118, 0xA085, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CB, + 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A7, 0x5121, 0x7102, 0x6116, 0xA05D, + 0x610C, 0x9021, 0x611E, 0xA0EF, 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA077, + 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C2, 0x510F, 0x7004, 0x6110, 0x9059, + 0x6002, 0x800E, 0x6119, 0xA09F, 0x5121, 0x70FF, 0x6115, 0xA054, 0x610A, 0x901C, 0x611D, 0xA0E6, + 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08E, 0x5111, 0x700A, 0x6114, 0xA034, + 0x6109, 0x8120, 0x611C, 0xA0D5, 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B0, + 0x5121, 0x7103, 0x6116, 0xA066, 0x610C, 0x9026, 0x611E, 0xA104, 0x510B, 0x611F, 0x610D, 0x9027, + 0x6000, 0x7105, 0x6117, 0xA069, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B4, + 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA092, 0x5121, 0x7080, 0x6115, 0xA03B, + 0x610A, 0x9012, 0x611D, 0xA0D8, 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07B, + 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C5, 0x510F, 0x7005, 0x6112, 0x9070, + 0x6107, 0x800F, 0x611A, 0xA0A2, 0x5121, 0x7102, 0x6116, 0xA057, 0x610C, 0x901D, 0x611E, 0xA0E9, + 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA072, 0x5111, 0x7008, 0x6113, 0x90E0, + 0x6108, 0x8020, 0x611B, 0xA0BC, 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA09A, + 0x5121, 0x70FF, 0x6115, 0xA04D, 0x610A, 0x9017, 0x611D, 0xA0E1, 0x510B, 0x6122, 0x610E, 0x903C, + 0x6001, 0x7124, 0x6118, 0xA089, 0x5111, 0x700A, 0x6114, 0xA02B, 0x6109, 0x80FE, 0x611C, 0xA0CF, + 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0AA, 0x5121, 0x7103, 0x6116, 0xA061, + 0x610C, 0x9022, 0x611E, 0xA0F6, 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06D, + 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B8, 0x510F, 0x7003, 0x6110, 0x9044, + 0x6002, 0x800C, 0x6119, 0xA096, 0x5121, 0x7080, 0x6115, 0xA047, 0x610A, 0x9015, 0x611D, 0xA0DC, + 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA083, 0x5111, 0x7009, 0x6114, 0x90FC, + 0x6109, 0x80F0, 0x611C, 0xA0CA, 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A6, + 0x5121, 0x7102, 0x6116, 0xA05C, 0x610C, 0x901F, 0x611E, 0xA0ED, 0x510B, 0x611F, 0x610D, 0x9031, + 0x6000, 0x7106, 0x6117, 0xA076, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0C1, + 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09E, 0x5121, 0x70FF, 0x6115, 0xA053, + 0x610A, 0x901B, 0x611D, 0xA0E5, 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08D, + 0x5111, 0x700A, 0x6114, 0xA032, 0x6109, 0x8120, 0x611C, 0xA0D4, 0x510F, 0x7006, 0x6112, 0x9088, + 0x6107, 0x8013, 0x611A, 0xA0AF, 0x5121, 0x7103, 0x6116, 0xA065, 0x610C, 0x9025, 0x611E, 0xA0FB, + 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06B, 0x5111, 0x7007, 0x6113, 0x90C6, + 0x6108, 0x8018, 0x611B, 0xA0B6, 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA094, + 0x5121, 0x7080, 0x6115, 0xA045, 0x610A, 0x9014, 0x611D, 0xA0DA, 0x510B, 0x6122, 0x610E, 0x9037, + 0x6001, 0x7123, 0x6118, 0xA07D, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C8, + 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A4, 0x5121, 0x7102, 0x6116, 0xA05A, + 0x610C, 0x901E, 0x611E, 0xA0EB, 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA074, + 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BE, 0x510F, 0x7004, 0x6110, 0x9050, + 0x6002, 0x800D, 0x6119, 0xA09C, 0x5121, 0x70FF, 0x6115, 0xA04F, 0x610A, 0x901A, 0x611D, 0xA0E3, + 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08B, 0x5111, 0x700A, 0x6114, 0xA02E, + 0x6109, 0x80FE, 0x611C, 0xA0D2, 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AD, + 0x5121, 0x7103, 0x6116, 0xA063, 0x610C, 0x9024, 0x611E, 0xA0F9, 0x510B, 0x611F, 0x610D, 0x902A, + 0x6000, 0x7105, 0x6117, 0xA06F, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0BA, + 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA098, 0x5121, 0x7080, 0x6115, 0xA04B, + 0x610A, 0x9016, 0x611D, 0xA0DE, 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA086, + 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CD, 0x510F, 0x7005, 0x6112, 0x9081, + 0x6107, 0x8010, 0x611A, 0xA0A8, 0x5121, 0x7102, 0x6116, 0xA05E, 0x610C, 0x9021, 0x611E, 0xA0F3, + 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA079, 0x5111, 0x7008, 0x6113, 0x90F2, + 0x6108, 0x8040, 0x611B, 0xA0C3, 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA0A0, + 0x5121, 0x70FF, 0x6115, 0xA055, 0x610A, 0x901C, 0x611D, 0xA0E7, 0x510B, 0x6122, 0x610E, 0x9041, + 0x6001, 0x7124, 0x6118, 0xA08F, 0x5111, 0x700A, 0x6114, 0xA036, 0x6109, 0x8120, 0x611C, 0xA0D6, + 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B1, 0x5121, 0x7103, 0x6116, 0xA067, + 0x610C, 0x9026, 0x611E, 0xB0B2, 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA068, + 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B3, 0x510F, 0x7003, 0x6110, 0x9042, + 0x6002, 0x800B, 0x6119, 0xA091, 0x5121, 0x7080, 0x6115, 0xA03A, 0x610A, 0x9012, 0x611D, 0xA0D7, + 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07A, 0x5111, 0x7009, 0x6114, 0x90F4, + 0x6109, 0x8060, 0x611C, 0xA0C4, 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A1, + 0x5121, 0x7102, 0x6116, 0xA056, 0x610C, 0x901D, 0x611E, 0xA0E8, 0x510B, 0x611F, 0x610D, 0x902C, + 0x6000, 0x7106, 0x6117, 0xA071, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BB, + 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA099, 0x5121, 0x70FF, 0x6115, 0xA04C, + 0x610A, 0x9017, 0x611D, 0xA0DF, 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA087, + 0x5111, 0x700A, 0x6114, 0xA023, 0x6109, 0x80FE, 0x611C, 0xA0CE, 0x510F, 0x7006, 0x6112, 0x9082, + 0x6107, 0x8011, 0x611A, 0xA0A9, 0x5121, 0x7103, 0x6116, 0xA05F, 0x610C, 0x9022, 0x611E, 0xA0F5, + 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06C, 0x5111, 0x7007, 0x6113, 0x90CC, + 0x6108, 0x8019, 0x611B, 0xA0B7, 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA095, + 0x5121, 0x7080, 0x6115, 0xA046, 0x610A, 0x9015, 0x611D, 0xA0DB, 0x510B, 0x6122, 0x610E, 0x9038, + 0x6001, 0x7123, 0x6118, 0xA07E, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0C9, + 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A5, 0x5121, 0x7102, 0x6116, 0xA05B, + 0x610C, 0x901F, 0x611E, 0xA0EC, 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA075, + 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0BF, 0x510F, 0x7004, 0x6110, 0x9051, + 0x6002, 0x800E, 0x6119, 0xA09D, 0x5121, 0x70FF, 0x6115, 0xA052, 0x610A, 0x901B, 0x611D, 0xA0E4, + 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08C, 0x5111, 0x700A, 0x6114, 0xA02F, + 0x6109, 0x8120, 0x611C, 0xA0D3, 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AE, + 0x5121, 0x7103, 0x6116, 0xA064, 0x610C, 0x9025, 0x611E, 0xA0FA, 0x510B, 0x611F, 0x610D, 0x9028, + 0x6000, 0x7105, 0x6117, 0xA06A, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B5, + 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA093, 0x5121, 0x7080, 0x6115, 0xA03D, + 0x610A, 0x9014, 0x611D, 0xA0D9, 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07C, + 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C7, 0x510F, 0x7005, 0x6112, 0x9078, + 0x6107, 0x800F, 0x611A, 0xA0A3, 0x5121, 0x7102, 0x6116, 0xA058, 0x610C, 0x901E, 0x611E, 0xA0EA, + 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA073, 0x5111, 0x7008, 0x6113, 0x90EE, + 0x6108, 0x8020, 0x611B, 0xA0BD, 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09B, + 0x5121, 0x70FF, 0x6115, 0xA04E, 0x610A, 0x901A, 0x611D, 0xA0E2, 0x510B, 0x6122, 0x610E, 0x903E, + 0x6001, 0x7124, 0x6118, 0xA08A, 0x5111, 0x700A, 0x6114, 0xA02D, 0x6109, 0x80FE, 0x611C, 0xA0D1, + 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AC, 0x5121, 0x7103, 0x6116, 0xA062, + 0x610C, 0x9024, 0x611E, 0xA0F7, 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06E, + 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0B9, 0x510F, 0x7003, 0x6110, 0x9048, + 0x6002, 0x800C, 0x6119, 0xA097, 0x5121, 0x7080, 0x6115, 0xA04A, 0x610A, 0x9016, 0x611D, 0xA0DD, + 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA085, 0x5111, 0x7009, 0x6114, 0x90FD, + 0x6109, 0x80F0, 0x611C, 0xA0CB, 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A7, + 0x5121, 0x7102, 0x6116, 0xA05D, 0x610C, 0x9021, 0x611E, 0xA0EF, 0x510B, 0x611F, 0x610D, 0x9033, + 0x6000, 0x7106, 0x6117, 0xA077, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C2, + 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA09F, 0x5121, 0x70FF, 0x6115, 0xA054, + 0x610A, 0x901C, 0x611D, 0xA0E6, 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08E, + 0x5111, 0x700A, 0x6114, 0xA034, 0x6109, 0x8120, 0x611C, 0xA0D5, 0x510F, 0x7006, 0x6112, 0x9090, + 0x6107, 0x8013, 0x611A, 0xA0B0, 0x5121, 0x7103, 0x6116, 0xA066, 0x610C, 0x9026, 0x611E, 0xA104, + 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA069, 0x5111, 0x7007, 0x6113, 0x90C0, + 0x6108, 0x8018, 0x611B, 0xA0B4, 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA092, + 0x5121, 0x7080, 0x6115, 0xA03B, 0x610A, 0x9012, 0x611D, 0xA0D8, 0x510B, 0x6122, 0x610E, 0x9035, + 0x6001, 0x7123, 0x6118, 0xA07B, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C5, + 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A2, 0x5121, 0x7102, 0x6116, 0xA057, + 0x610C, 0x901D, 0x611E, 0xA0E9, 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA072, + 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BC, 0x510F, 0x7004, 0x6110, 0x9049, + 0x6002, 0x800D, 0x6119, 0xA09A, 0x5121, 0x70FF, 0x6115, 0xA04D, 0x610A, 0x9017, 0x611D, 0xA0E1, + 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA089, 0x5111, 0x700A, 0x6114, 0xA02B, + 0x6109, 0x80FE, 0x611C, 0xA0CF, 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0AA, + 0x5121, 0x7103, 0x6116, 0xA061, 0x610C, 0x9022, 0x611E, 0xA0F6, 0x510B, 0x611F, 0x610D, 0x9029, + 0x6000, 0x7105, 0x6117, 0xA06D, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B8, + 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA096, 0x5121, 0x7080, 0x6115, 0xA047, + 0x610A, 0x9015, 0x611D, 0xA0DC, 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA083, + 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0CA, 0x510F, 0x7005, 0x6112, 0x907F, + 0x6107, 0x8010, 0x611A, 0xA0A6, 0x5121, 0x7102, 0x6116, 0xA05C, 0x610C, 0x901F, 0x611E, 0xA0ED, + 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA076, 0x5111, 0x7008, 0x6113, 0x90F1, + 0x6108, 0x8040, 0x611B, 0xA0C1, 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09E, + 0x5121, 0x70FF, 0x6115, 0xA053, 0x610A, 0x901B, 0x611D, 0xA0E5, 0x510B, 0x6122, 0x610E, 0x903F, + 0x6001, 0x7124, 0x6118, 0xA08D, 0x5111, 0x700A, 0x6114, 0xA032, 0x6109, 0x8120, 0x611C, 0xA0D4, + 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AF, 0x5121, 0x7103, 0x6116, 0xA065, + 0x610C, 0x9025, 0x611E, 0xA0FB, 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06B, + 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B6, 0x510F, 0x7003, 0x6110, 0x9043, + 0x6002, 0x800B, 0x6119, 0xA094, 0x5121, 0x7080, 0x6115, 0xA045, 0x610A, 0x9014, 0x611D, 0xA0DA, + 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07D, 0x5111, 0x7009, 0x6114, 0x90F8, + 0x6109, 0x8060, 0x611C, 0xA0C8, 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A4, + 0x5121, 0x7102, 0x6116, 0xA05A, 0x610C, 0x901E, 0x611E, 0xA0EB, 0x510B, 0x611F, 0x610D, 0x9030, + 0x6000, 0x7106, 0x6117, 0xA074, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BE, + 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09C, 0x5121, 0x70FF, 0x6115, 0xA04F, + 0x610A, 0x901A, 0x611D, 0xA0E3, 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08B, + 0x5111, 0x700A, 0x6114, 0xA02E, 0x6109, 0x80FE, 0x611C, 0xA0D2, 0x510F, 0x7006, 0x6112, 0x9084, + 0x6107, 0x8011, 0x611A, 0xA0AD, 0x5121, 0x7103, 0x6116, 0xA063, 0x610C, 0x9024, 0x611E, 0xA0F9, + 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06F, 0x5111, 0x7007, 0x6113, 0x90D0, + 0x6108, 0x8019, 0x611B, 0xA0BA, 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA098, + 0x5121, 0x7080, 0x6115, 0xA04B, 0x610A, 0x9016, 0x611D, 0xA0DE, 0x510B, 0x6122, 0x610E, 0x9039, + 0x6001, 0x7123, 0x6118, 0xA086, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CD, + 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A8, 0x5121, 0x7102, 0x6116, 0xA05E, + 0x610C, 0x9021, 0x611E, 0xA0F3, 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA079, + 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C3, 0x510F, 0x7004, 0x6110, 0x9059, + 0x6002, 0x800E, 0x6119, 0xA0A0, 0x5121, 0x70FF, 0x6115, 0xA055, 0x610A, 0x901C, 0x611D, 0xA0E7, + 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08F, 0x5111, 0x700A, 0x6114, 0xA036, + 0x6109, 0x8120, 0x611C, 0xA0D6, 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B1, + 0x5121, 0x7103, 0x6116, 0xA067, 0x610C, 0x9026, 0x611E, 0xD0AB, 0x510B, 0x611F, 0x610D, 0x9027, + 0x6000, 0x7105, 0x6117, 0xA068, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B3, + 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA091, 0x5121, 0x7080, 0x6115, 0xA03A, + 0x610A, 0x9012, 0x611D, 0xA0D7, 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07A, + 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C4, 0x510F, 0x7005, 0x6112, 0x9070, + 0x6107, 0x800F, 0x611A, 0xA0A1, 0x5121, 0x7102, 0x6116, 0xA056, 0x610C, 0x901D, 0x611E, 0xA0E8, + 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA071, 0x5111, 0x7008, 0x6113, 0x90E0, + 0x6108, 0x8020, 0x611B, 0xA0BB, 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA099, + 0x5121, 0x70FF, 0x6115, 0xA04C, 0x610A, 0x9017, 0x611D, 0xA0DF, 0x510B, 0x6122, 0x610E, 0x903C, + 0x6001, 0x7124, 0x6118, 0xA087, 0x5111, 0x700A, 0x6114, 0xA023, 0x6109, 0x80FE, 0x611C, 0xA0CE, + 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0A9, 0x5121, 0x7103, 0x6116, 0xA05F, + 0x610C, 0x9022, 0x611E, 0xA0F5, 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06C, + 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B7, 0x510F, 0x7003, 0x6110, 0x9044, + 0x6002, 0x800C, 0x6119, 0xA095, 0x5121, 0x7080, 0x6115, 0xA046, 0x610A, 0x9015, 0x611D, 0xA0DB, + 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA07E, 0x5111, 0x7009, 0x6114, 0x90FC, + 0x6109, 0x80F0, 0x611C, 0xA0C9, 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A5, + 0x5121, 0x7102, 0x6116, 0xA05B, 0x610C, 0x901F, 0x611E, 0xA0EC, 0x510B, 0x611F, 0x610D, 0x9031, + 0x6000, 0x7106, 0x6117, 0xA075, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0BF, + 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09D, 0x5121, 0x70FF, 0x6115, 0xA052, + 0x610A, 0x901B, 0x611D, 0xA0E4, 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08C, + 0x5111, 0x700A, 0x6114, 0xA02F, 0x6109, 0x8120, 0x611C, 0xA0D3, 0x510F, 0x7006, 0x6112, 0x9088, + 0x6107, 0x8013, 0x611A, 0xA0AE, 0x5121, 0x7103, 0x6116, 0xA064, 0x610C, 0x9025, 0x611E, 0xA0FA, + 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06A, 0x5111, 0x7007, 0x6113, 0x90C6, + 0x6108, 0x8018, 0x611B, 0xA0B5, 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA093, + 0x5121, 0x7080, 0x6115, 0xA03D, 0x610A, 0x9014, 0x611D, 0xA0D9, 0x510B, 0x6122, 0x610E, 0x9037, + 0x6001, 0x7123, 0x6118, 0xA07C, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C7, + 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A3, 0x5121, 0x7102, 0x6116, 0xA058, + 0x610C, 0x901E, 0x611E, 0xA0EA, 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA073, + 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BD, 0x510F, 0x7004, 0x6110, 0x9050, + 0x6002, 0x800D, 0x6119, 0xA09B, 0x5121, 0x70FF, 0x6115, 0xA04E, 0x610A, 0x901A, 0x611D, 0xA0E2, + 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08A, 0x5111, 0x700A, 0x6114, 0xA02D, + 0x6109, 0x80FE, 0x611C, 0xA0D1, 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AC, + 0x5121, 0x7103, 0x6116, 0xA062, 0x610C, 0x9024, 0x611E, 0xA0F7, 0x510B, 0x611F, 0x610D, 0x902A, + 0x6000, 0x7105, 0x6117, 0xA06E, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0B9, + 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA097, 0x5121, 0x7080, 0x6115, 0xA04A, + 0x610A, 0x9016, 0x611D, 0xA0DD, 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA085, + 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CB, 0x510F, 0x7005, 0x6112, 0x9081, + 0x6107, 0x8010, 0x611A, 0xA0A7, 0x5121, 0x7102, 0x6116, 0xA05D, 0x610C, 0x9021, 0x611E, 0xA0EF, + 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA077, 0x5111, 0x7008, 0x6113, 0x90F2, + 0x6108, 0x8040, 0x611B, 0xA0C2, 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA09F, + 0x5121, 0x70FF, 0x6115, 0xA054, 0x610A, 0x901C, 0x611D, 0xA0E6, 0x510B, 0x6122, 0x610E, 0x9041, + 0x6001, 0x7124, 0x6118, 0xA08E, 0x5111, 0x700A, 0x6114, 0xA034, 0x6109, 0x8120, 0x611C, 0xA0D5, + 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B0, 0x5121, 0x7103, 0x6116, 0xA066, + 0x610C, 0x9026, 0x611E, 0xA104, 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA069, + 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B4, 0x510F, 0x7003, 0x6110, 0x9042, + 0x6002, 0x800B, 0x6119, 0xA092, 0x5121, 0x7080, 0x6115, 0xA03B, 0x610A, 0x9012, 0x611D, 0xA0D8, + 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07B, 0x5111, 0x7009, 0x6114, 0x90F4, + 0x6109, 0x8060, 0x611C, 0xA0C5, 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A2, + 0x5121, 0x7102, 0x6116, 0xA057, 0x610C, 0x901D, 0x611E, 0xA0E9, 0x510B, 0x611F, 0x610D, 0x902C, + 0x6000, 0x7106, 0x6117, 0xA072, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BC, + 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA09A, 0x5121, 0x70FF, 0x6115, 0xA04D, + 0x610A, 0x9017, 0x611D, 0xA0E1, 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA089, + 0x5111, 0x700A, 0x6114, 0xA02B, 0x6109, 0x80FE, 0x611C, 0xA0CF, 0x510F, 0x7006, 0x6112, 0x9082, + 0x6107, 0x8011, 0x611A, 0xA0AA, 0x5121, 0x7103, 0x6116, 0xA061, 0x610C, 0x9022, 0x611E, 0xA0F6, + 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06D, 0x5111, 0x7007, 0x6113, 0x90CC, + 0x6108, 0x8019, 0x611B, 0xA0B8, 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA096, + 0x5121, 0x7080, 0x6115, 0xA047, 0x610A, 0x9015, 0x611D, 0xA0DC, 0x510B, 0x6122, 0x610E, 0x9038, + 0x6001, 0x7123, 0x6118, 0xA083, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0CA, + 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A6, 0x5121, 0x7102, 0x6116, 0xA05C, + 0x610C, 0x901F, 0x611E, 0xA0ED, 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA076, + 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0C1, 0x510F, 0x7004, 0x6110, 0x9051, + 0x6002, 0x800E, 0x6119, 0xA09E, 0x5121, 0x70FF, 0x6115, 0xA053, 0x610A, 0x901B, 0x611D, 0xA0E5, + 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08D, 0x5111, 0x700A, 0x6114, 0xA032, + 0x6109, 0x8120, 0x611C, 0xA0D4, 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AF, + 0x5121, 0x7103, 0x6116, 0xA065, 0x610C, 0x9025, 0x611E, 0xA0FB, 0x510B, 0x611F, 0x610D, 0x9028, + 0x6000, 0x7105, 0x6117, 0xA06B, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B6, + 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA094, 0x5121, 0x7080, 0x6115, 0xA045, + 0x610A, 0x9014, 0x611D, 0xA0DA, 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07D, + 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C8, 0x510F, 0x7005, 0x6112, 0x9078, + 0x6107, 0x800F, 0x611A, 0xA0A4, 0x5121, 0x7102, 0x6116, 0xA05A, 0x610C, 0x901E, 0x611E, 0xA0EB, + 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA074, 0x5111, 0x7008, 0x6113, 0x90EE, + 0x6108, 0x8020, 0x611B, 0xA0BE, 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09C, + 0x5121, 0x70FF, 0x6115, 0xA04F, 0x610A, 0x901A, 0x611D, 0xA0E3, 0x510B, 0x6122, 0x610E, 0x903E, + 0x6001, 0x7124, 0x6118, 0xA08B, 0x5111, 0x700A, 0x6114, 0xA02E, 0x6109, 0x80FE, 0x611C, 0xA0D2, + 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AD, 0x5121, 0x7103, 0x6116, 0xA063, + 0x610C, 0x9024, 0x611E, 0xA0F9, 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06F, + 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0BA, 0x510F, 0x7003, 0x6110, 0x9048, + 0x6002, 0x800C, 0x6119, 0xA098, 0x5121, 0x7080, 0x6115, 0xA04B, 0x610A, 0x9016, 0x611D, 0xA0DE, + 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA086, 0x5111, 0x7009, 0x6114, 0x90FD, + 0x6109, 0x80F0, 0x611C, 0xA0CD, 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A8, + 0x5121, 0x7102, 0x6116, 0xA05E, 0x610C, 0x9021, 0x611E, 0xA0F3, 0x510B, 0x611F, 0x610D, 0x9033, + 0x6000, 0x7106, 0x6117, 0xA079, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C3, + 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA0A0, 0x5121, 0x70FF, 0x6115, 0xA055, + 0x610A, 0x901C, 0x611D, 0xA0E7, 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08F, + 0x5111, 0x700A, 0x6114, 0xA036, 0x6109, 0x8120, 0x611C, 0xA0D6, 0x510F, 0x7006, 0x6112, 0x9090, + 0x6107, 0x8013, 0x611A, 0xA0B1, 0x5121, 0x7103, 0x6116, 0xA067, 0x610C, 0x9026, 0x611E, 0xB0B2, + 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA068, 0x5111, 0x7007, 0x6113, 0x90C0, + 0x6108, 0x8018, 0x611B, 0xA0B3, 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA091, + 0x5121, 0x7080, 0x6115, 0xA03A, 0x610A, 0x9012, 0x611D, 0xA0D7, 0x510B, 0x6122, 0x610E, 0x9035, + 0x6001, 0x7123, 0x6118, 0xA07A, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C4, + 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A1, 0x5121, 0x7102, 0x6116, 0xA056, + 0x610C, 0x901D, 0x611E, 0xA0E8, 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA071, + 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BB, 0x510F, 0x7004, 0x6110, 0x9049, + 0x6002, 0x800D, 0x6119, 0xA099, 0x5121, 0x70FF, 0x6115, 0xA04C, 0x610A, 0x9017, 0x611D, 0xA0DF, + 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA087, 0x5111, 0x700A, 0x6114, 0xA023, + 0x6109, 0x80FE, 0x611C, 0xA0CE, 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0A9, + 0x5121, 0x7103, 0x6116, 0xA05F, 0x610C, 0x9022, 0x611E, 0xA0F5, 0x510B, 0x611F, 0x610D, 0x9029, + 0x6000, 0x7105, 0x6117, 0xA06C, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B7, + 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA095, 0x5121, 0x7080, 0x6115, 0xA046, + 0x610A, 0x9015, 0x611D, 0xA0DB, 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA07E, + 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0C9, 0x510F, 0x7005, 0x6112, 0x907F, + 0x6107, 0x8010, 0x611A, 0xA0A5, 0x5121, 0x7102, 0x6116, 0xA05B, 0x610C, 0x901F, 0x611E, 0xA0EC, + 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA075, 0x5111, 0x7008, 0x6113, 0x90F1, + 0x6108, 0x8040, 0x611B, 0xA0BF, 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09D, + 0x5121, 0x70FF, 0x6115, 0xA052, 0x610A, 0x901B, 0x611D, 0xA0E4, 0x510B, 0x6122, 0x610E, 0x903F, + 0x6001, 0x7124, 0x6118, 0xA08C, 0x5111, 0x700A, 0x6114, 0xA02F, 0x6109, 0x8120, 0x611C, 0xA0D3, + 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AE, 0x5121, 0x7103, 0x6116, 0xA064, + 0x610C, 0x9025, 0x611E, 0xA0FA, 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06A, + 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B5, 0x510F, 0x7003, 0x6110, 0x9043, + 0x6002, 0x800B, 0x6119, 0xA093, 0x5121, 0x7080, 0x6115, 0xA03D, 0x610A, 0x9014, 0x611D, 0xA0D9, + 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07C, 0x5111, 0x7009, 0x6114, 0x90F8, + 0x6109, 0x8060, 0x611C, 0xA0C7, 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A3, + 0x5121, 0x7102, 0x6116, 0xA058, 0x610C, 0x901E, 0x611E, 0xA0EA, 0x510B, 0x611F, 0x610D, 0x9030, + 0x6000, 0x7106, 0x6117, 0xA073, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BD, + 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09B, 0x5121, 0x70FF, 0x6115, 0xA04E, + 0x610A, 0x901A, 0x611D, 0xA0E2, 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08A, + 0x5111, 0x700A, 0x6114, 0xA02D, 0x6109, 0x80FE, 0x611C, 0xA0D1, 0x510F, 0x7006, 0x6112, 0x9084, + 0x6107, 0x8011, 0x611A, 0xA0AC, 0x5121, 0x7103, 0x6116, 0xA062, 0x610C, 0x9024, 0x611E, 0xA0F7, + 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06E, 0x5111, 0x7007, 0x6113, 0x90D0, + 0x6108, 0x8019, 0x611B, 0xA0B9, 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA097, + 0x5121, 0x7080, 0x6115, 0xA04A, 0x610A, 0x9016, 0x611D, 0xA0DD, 0x510B, 0x6122, 0x610E, 0x9039, + 0x6001, 0x7123, 0x6118, 0xA085, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CB, + 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A7, 0x5121, 0x7102, 0x6116, 0xA05D, + 0x610C, 0x9021, 0x611E, 0xA0EF, 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA077, + 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C2, 0x510F, 0x7004, 0x6110, 0x9059, + 0x6002, 0x800E, 0x6119, 0xA09F, 0x5121, 0x70FF, 0x6115, 0xA054, 0x610A, 0x901C, 0x611D, 0xA0E6, + 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08E, 0x5111, 0x700A, 0x6114, 0xA034, + 0x6109, 0x8120, 0x611C, 0xA0D5, 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B0, + 0x5121, 0x7103, 0x6116, 0xA066, 0x610C, 0x9026, 0x611E, 0xA104, 0x510B, 0x611F, 0x610D, 0x9027, + 0x6000, 0x7105, 0x6117, 0xA069, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B4, + 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA092, 0x5121, 0x7080, 0x6115, 0xA03B, + 0x610A, 0x9012, 0x611D, 0xA0D8, 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07B, + 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C5, 0x510F, 0x7005, 0x6112, 0x9070, + 0x6107, 0x800F, 0x611A, 0xA0A2, 0x5121, 0x7102, 0x6116, 0xA057, 0x610C, 0x901D, 0x611E, 0xA0E9, + 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA072, 0x5111, 0x7008, 0x6113, 0x90E0, + 0x6108, 0x8020, 0x611B, 0xA0BC, 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA09A, + 0x5121, 0x70FF, 0x6115, 0xA04D, 0x610A, 0x9017, 0x611D, 0xA0E1, 0x510B, 0x6122, 0x610E, 0x903C, + 0x6001, 0x7124, 0x6118, 0xA089, 0x5111, 0x700A, 0x6114, 0xA02B, 0x6109, 0x80FE, 0x611C, 0xA0CF, + 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0AA, 0x5121, 0x7103, 0x6116, 0xA061, + 0x610C, 0x9022, 0x611E, 0xA0F6, 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06D, + 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B8, 0x510F, 0x7003, 0x6110, 0x9044, + 0x6002, 0x800C, 0x6119, 0xA096, 0x5121, 0x7080, 0x6115, 0xA047, 0x610A, 0x9015, 0x611D, 0xA0DC, + 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA083, 0x5111, 0x7009, 0x6114, 0x90FC, + 0x6109, 0x80F0, 0x611C, 0xA0CA, 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A6, + 0x5121, 0x7102, 0x6116, 0xA05C, 0x610C, 0x901F, 0x611E, 0xA0ED, 0x510B, 0x611F, 0x610D, 0x9031, + 0x6000, 0x7106, 0x6117, 0xA076, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0C1, + 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09E, 0x5121, 0x70FF, 0x6115, 0xA053, + 0x610A, 0x901B, 0x611D, 0xA0E5, 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08D, + 0x5111, 0x700A, 0x6114, 0xA032, 0x6109, 0x8120, 0x611C, 0xA0D4, 0x510F, 0x7006, 0x6112, 0x9088, + 0x6107, 0x8013, 0x611A, 0xA0AF, 0x5121, 0x7103, 0x6116, 0xA065, 0x610C, 0x9025, 0x611E, 0xA0FB, + 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06B, 0x5111, 0x7007, 0x6113, 0x90C6, + 0x6108, 0x8018, 0x611B, 0xA0B6, 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA094, + 0x5121, 0x7080, 0x6115, 0xA045, 0x610A, 0x9014, 0x611D, 0xA0DA, 0x510B, 0x6122, 0x610E, 0x9037, + 0x6001, 0x7123, 0x6118, 0xA07D, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C8, + 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A4, 0x5121, 0x7102, 0x6116, 0xA05A, + 0x610C, 0x901E, 0x611E, 0xA0EB, 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA074, + 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BE, 0x510F, 0x7004, 0x6110, 0x9050, + 0x6002, 0x800D, 0x6119, 0xA09C, 0x5121, 0x70FF, 0x6115, 0xA04F, 0x610A, 0x901A, 0x611D, 0xA0E3, + 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08B, 0x5111, 0x700A, 0x6114, 0xA02E, + 0x6109, 0x80FE, 0x611C, 0xA0D2, 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AD, + 0x5121, 0x7103, 0x6116, 0xA063, 0x610C, 0x9024, 0x611E, 0xA0F9, 0x510B, 0x611F, 0x610D, 0x902A, + 0x6000, 0x7105, 0x6117, 0xA06F, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0BA, + 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA098, 0x5121, 0x7080, 0x6115, 0xA04B, + 0x610A, 0x9016, 0x611D, 0xA0DE, 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA086, + 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CD, 0x510F, 0x7005, 0x6112, 0x9081, + 0x6107, 0x8010, 0x611A, 0xA0A8, 0x5121, 0x7102, 0x6116, 0xA05E, 0x610C, 0x9021, 0x611E, 0xA0F3, + 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA079, 0x5111, 0x7008, 0x6113, 0x90F2, + 0x6108, 0x8040, 0x611B, 0xA0C3, 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA0A0, + 0x5121, 0x70FF, 0x6115, 0xA055, 0x610A, 0x901C, 0x611D, 0xA0E7, 0x510B, 0x6122, 0x610E, 0x9041, + 0x6001, 0x7124, 0x6118, 0xA08F, 0x5111, 0x700A, 0x6114, 0xA036, 0x6109, 0x8120, 0x611C, 0xA0D6, + 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B1, 0x5121, 0x7103, 0x6116, 0xA067, + 0x610C, 0x9026, 0x611E, 0xD101, 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA068, + 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B3, 0x510F, 0x7003, 0x6110, 0x9042, + 0x6002, 0x800B, 0x6119, 0xA091, 0x5121, 0x7080, 0x6115, 0xA03A, 0x610A, 0x9012, 0x611D, 0xA0D7, + 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07A, 0x5111, 0x7009, 0x6114, 0x90F4, + 0x6109, 0x8060, 0x611C, 0xA0C4, 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A1, + 0x5121, 0x7102, 0x6116, 0xA056, 0x610C, 0x901D, 0x611E, 0xA0E8, 0x510B, 0x611F, 0x610D, 0x902C, + 0x6000, 0x7106, 0x6117, 0xA071, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BB, + 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA099, 0x5121, 0x70FF, 0x6115, 0xA04C, + 0x610A, 0x9017, 0x611D, 0xA0DF, 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA087, + 0x5111, 0x700A, 0x6114, 0xA023, 0x6109, 0x80FE, 0x611C, 0xA0CE, 0x510F, 0x7006, 0x6112, 0x9082, + 0x6107, 0x8011, 0x611A, 0xA0A9, 0x5121, 0x7103, 0x6116, 0xA05F, 0x610C, 0x9022, 0x611E, 0xA0F5, + 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06C, 0x5111, 0x7007, 0x6113, 0x90CC, + 0x6108, 0x8019, 0x611B, 0xA0B7, 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA095, + 0x5121, 0x7080, 0x6115, 0xA046, 0x610A, 0x9015, 0x611D, 0xA0DB, 0x510B, 0x6122, 0x610E, 0x9038, + 0x6001, 0x7123, 0x6118, 0xA07E, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0C9, + 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A5, 0x5121, 0x7102, 0x6116, 0xA05B, + 0x610C, 0x901F, 0x611E, 0xA0EC, 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA075, + 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0BF, 0x510F, 0x7004, 0x6110, 0x9051, + 0x6002, 0x800E, 0x6119, 0xA09D, 0x5121, 0x70FF, 0x6115, 0xA052, 0x610A, 0x901B, 0x611D, 0xA0E4, + 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08C, 0x5111, 0x700A, 0x6114, 0xA02F, + 0x6109, 0x8120, 0x611C, 0xA0D3, 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AE, + 0x5121, 0x7103, 0x6116, 0xA064, 0x610C, 0x9025, 0x611E, 0xA0FA, 0x510B, 0x611F, 0x610D, 0x9028, + 0x6000, 0x7105, 0x6117, 0xA06A, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B5, + 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA093, 0x5121, 0x7080, 0x6115, 0xA03D, + 0x610A, 0x9014, 0x611D, 0xA0D9, 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07C, + 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C7, 0x510F, 0x7005, 0x6112, 0x9078, + 0x6107, 0x800F, 0x611A, 0xA0A3, 0x5121, 0x7102, 0x6116, 0xA058, 0x610C, 0x901E, 0x611E, 0xA0EA, + 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA073, 0x5111, 0x7008, 0x6113, 0x90EE, + 0x6108, 0x8020, 0x611B, 0xA0BD, 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09B, + 0x5121, 0x70FF, 0x6115, 0xA04E, 0x610A, 0x901A, 0x611D, 0xA0E2, 0x510B, 0x6122, 0x610E, 0x903E, + 0x6001, 0x7124, 0x6118, 0xA08A, 0x5111, 0x700A, 0x6114, 0xA02D, 0x6109, 0x80FE, 0x611C, 0xA0D1, + 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AC, 0x5121, 0x7103, 0x6116, 0xA062, + 0x610C, 0x9024, 0x611E, 0xA0F7, 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06E, + 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0B9, 0x510F, 0x7003, 0x6110, 0x9048, + 0x6002, 0x800C, 0x6119, 0xA097, 0x5121, 0x7080, 0x6115, 0xA04A, 0x610A, 0x9016, 0x611D, 0xA0DD, + 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA085, 0x5111, 0x7009, 0x6114, 0x90FD, + 0x6109, 0x80F0, 0x611C, 0xA0CB, 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A7, + 0x5121, 0x7102, 0x6116, 0xA05D, 0x610C, 0x9021, 0x611E, 0xA0EF, 0x510B, 0x611F, 0x610D, 0x9033, + 0x6000, 0x7106, 0x6117, 0xA077, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C2, + 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA09F, 0x5121, 0x70FF, 0x6115, 0xA054, + 0x610A, 0x901C, 0x611D, 0xA0E6, 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08E, + 0x5111, 0x700A, 0x6114, 0xA034, 0x6109, 0x8120, 0x611C, 0xA0D5, 0x510F, 0x7006, 0x6112, 0x9090, + 0x6107, 0x8013, 0x611A, 0xA0B0, 0x5121, 0x7103, 0x6116, 0xA066, 0x610C, 0x9026, 0x611E, 0xA104, + 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA069, 0x5111, 0x7007, 0x6113, 0x90C0, + 0x6108, 0x8018, 0x611B, 0xA0B4, 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA092, + 0x5121, 0x7080, 0x6115, 0xA03B, 0x610A, 0x9012, 0x611D, 0xA0D8, 0x510B, 0x6122, 0x610E, 0x9035, + 0x6001, 0x7123, 0x6118, 0xA07B, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C5, + 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A2, 0x5121, 0x7102, 0x6116, 0xA057, + 0x610C, 0x901D, 0x611E, 0xA0E9, 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA072, + 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BC, 0x510F, 0x7004, 0x6110, 0x9049, + 0x6002, 0x800D, 0x6119, 0xA09A, 0x5121, 0x70FF, 0x6115, 0xA04D, 0x610A, 0x9017, 0x611D, 0xA0E1, + 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA089, 0x5111, 0x700A, 0x6114, 0xA02B, + 0x6109, 0x80FE, 0x611C, 0xA0CF, 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0AA, + 0x5121, 0x7103, 0x6116, 0xA061, 0x610C, 0x9022, 0x611E, 0xA0F6, 0x510B, 0x611F, 0x610D, 0x9029, + 0x6000, 0x7105, 0x6117, 0xA06D, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B8, + 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA096, 0x5121, 0x7080, 0x6115, 0xA047, + 0x610A, 0x9015, 0x611D, 0xA0DC, 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA083, + 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0CA, 0x510F, 0x7005, 0x6112, 0x907F, + 0x6107, 0x8010, 0x611A, 0xA0A6, 0x5121, 0x7102, 0x6116, 0xA05C, 0x610C, 0x901F, 0x611E, 0xA0ED, + 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA076, 0x5111, 0x7008, 0x6113, 0x90F1, + 0x6108, 0x8040, 0x611B, 0xA0C1, 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09E, + 0x5121, 0x70FF, 0x6115, 0xA053, 0x610A, 0x901B, 0x611D, 0xA0E5, 0x510B, 0x6122, 0x610E, 0x903F, + 0x6001, 0x7124, 0x6118, 0xA08D, 0x5111, 0x700A, 0x6114, 0xA032, 0x6109, 0x8120, 0x611C, 0xA0D4, + 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AF, 0x5121, 0x7103, 0x6116, 0xA065, + 0x610C, 0x9025, 0x611E, 0xA0FB, 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06B, + 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B6, 0x510F, 0x7003, 0x6110, 0x9043, + 0x6002, 0x800B, 0x6119, 0xA094, 0x5121, 0x7080, 0x6115, 0xA045, 0x610A, 0x9014, 0x611D, 0xA0DA, + 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07D, 0x5111, 0x7009, 0x6114, 0x90F8, + 0x6109, 0x8060, 0x611C, 0xA0C8, 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A4, + 0x5121, 0x7102, 0x6116, 0xA05A, 0x610C, 0x901E, 0x611E, 0xA0EB, 0x510B, 0x611F, 0x610D, 0x9030, + 0x6000, 0x7106, 0x6117, 0xA074, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BE, + 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09C, 0x5121, 0x70FF, 0x6115, 0xA04F, + 0x610A, 0x901A, 0x611D, 0xA0E3, 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08B, + 0x5111, 0x700A, 0x6114, 0xA02E, 0x6109, 0x80FE, 0x611C, 0xA0D2, 0x510F, 0x7006, 0x6112, 0x9084, + 0x6107, 0x8011, 0x611A, 0xA0AD, 0x5121, 0x7103, 0x6116, 0xA063, 0x610C, 0x9024, 0x611E, 0xA0F9, + 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06F, 0x5111, 0x7007, 0x6113, 0x90D0, + 0x6108, 0x8019, 0x611B, 0xA0BA, 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA098, + 0x5121, 0x7080, 0x6115, 0xA04B, 0x610A, 0x9016, 0x611D, 0xA0DE, 0x510B, 0x6122, 0x610E, 0x9039, + 0x6001, 0x7123, 0x6118, 0xA086, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CD, + 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A8, 0x5121, 0x7102, 0x6116, 0xA05E, + 0x610C, 0x9021, 0x611E, 0xA0F3, 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA079, + 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C3, 0x510F, 0x7004, 0x6110, 0x9059, + 0x6002, 0x800E, 0x6119, 0xA0A0, 0x5121, 0x70FF, 0x6115, 0xA055, 0x610A, 0x901C, 0x611D, 0xA0E7, + 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08F, 0x5111, 0x700A, 0x6114, 0xA036, + 0x6109, 0x8120, 0x611C, 0xA0D6, 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B1, + 0x5121, 0x7103, 0x6116, 0xA067, 0x610C, 0x9026, 0x611E, 0xB0B2, 0x510B, 0x611F, 0x610D, 0x9027, + 0x6000, 0x7105, 0x6117, 0xA068, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B3, + 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA091, 0x5121, 0x7080, 0x6115, 0xA03A, + 0x610A, 0x9012, 0x611D, 0xA0D7, 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07A, + 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C4, 0x510F, 0x7005, 0x6112, 0x9070, + 0x6107, 0x800F, 0x611A, 0xA0A1, 0x5121, 0x7102, 0x6116, 0xA056, 0x610C, 0x901D, 0x611E, 0xA0E8, + 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA071, 0x5111, 0x7008, 0x6113, 0x90E0, + 0x6108, 0x8020, 0x611B, 0xA0BB, 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA099, + 0x5121, 0x70FF, 0x6115, 0xA04C, 0x610A, 0x9017, 0x611D, 0xA0DF, 0x510B, 0x6122, 0x610E, 0x903C, + 0x6001, 0x7124, 0x6118, 0xA087, 0x5111, 0x700A, 0x6114, 0xA023, 0x6109, 0x80FE, 0x611C, 0xA0CE, + 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0A9, 0x5121, 0x7103, 0x6116, 0xA05F, + 0x610C, 0x9022, 0x611E, 0xA0F5, 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06C, + 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B7, 0x510F, 0x7003, 0x6110, 0x9044, + 0x6002, 0x800C, 0x6119, 0xA095, 0x5121, 0x7080, 0x6115, 0xA046, 0x610A, 0x9015, 0x611D, 0xA0DB, + 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA07E, 0x5111, 0x7009, 0x6114, 0x90FC, + 0x6109, 0x80F0, 0x611C, 0xA0C9, 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A5, + 0x5121, 0x7102, 0x6116, 0xA05B, 0x610C, 0x901F, 0x611E, 0xA0EC, 0x510B, 0x611F, 0x610D, 0x9031, + 0x6000, 0x7106, 0x6117, 0xA075, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0BF, + 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09D, 0x5121, 0x70FF, 0x6115, 0xA052, + 0x610A, 0x901B, 0x611D, 0xA0E4, 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08C, + 0x5111, 0x700A, 0x6114, 0xA02F, 0x6109, 0x8120, 0x611C, 0xA0D3, 0x510F, 0x7006, 0x6112, 0x9088, + 0x6107, 0x8013, 0x611A, 0xA0AE, 0x5121, 0x7103, 0x6116, 0xA064, 0x610C, 0x9025, 0x611E, 0xA0FA, + 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06A, 0x5111, 0x7007, 0x6113, 0x90C6, + 0x6108, 0x8018, 0x611B, 0xA0B5, 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA093, + 0x5121, 0x7080, 0x6115, 0xA03D, 0x610A, 0x9014, 0x611D, 0xA0D9, 0x510B, 0x6122, 0x610E, 0x9037, + 0x6001, 0x7123, 0x6118, 0xA07C, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C7, + 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A3, 0x5121, 0x7102, 0x6116, 0xA058, + 0x610C, 0x901E, 0x611E, 0xA0EA, 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA073, + 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BD, 0x510F, 0x7004, 0x6110, 0x9050, + 0x6002, 0x800D, 0x6119, 0xA09B, 0x5121, 0x70FF, 0x6115, 0xA04E, 0x610A, 0x901A, 0x611D, 0xA0E2, + 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08A, 0x5111, 0x700A, 0x6114, 0xA02D, + 0x6109, 0x80FE, 0x611C, 0xA0D1, 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AC, + 0x5121, 0x7103, 0x6116, 0xA062, 0x610C, 0x9024, 0x611E, 0xA0F7, 0x510B, 0x611F, 0x610D, 0x902A, + 0x6000, 0x7105, 0x6117, 0xA06E, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0B9, + 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA097, 0x5121, 0x7080, 0x6115, 0xA04A, + 0x610A, 0x9016, 0x611D, 0xA0DD, 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA085, + 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CB, 0x510F, 0x7005, 0x6112, 0x9081, + 0x6107, 0x8010, 0x611A, 0xA0A7, 0x5121, 0x7102, 0x6116, 0xA05D, 0x610C, 0x9021, 0x611E, 0xA0EF, + 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA077, 0x5111, 0x7008, 0x6113, 0x90F2, + 0x6108, 0x8040, 0x611B, 0xA0C2, 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA09F, + 0x5121, 0x70FF, 0x6115, 0xA054, 0x610A, 0x901C, 0x611D, 0xA0E6, 0x510B, 0x6122, 0x610E, 0x9041, + 0x6001, 0x7124, 0x6118, 0xA08E, 0x5111, 0x700A, 0x6114, 0xA034, 0x6109, 0x8120, 0x611C, 0xA0D5, + 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B0, 0x5121, 0x7103, 0x6116, 0xA066, + 0x610C, 0x9026, 0x611E, 0xA104, 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA069, + 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B4, 0x510F, 0x7003, 0x6110, 0x9042, + 0x6002, 0x800B, 0x6119, 0xA092, 0x5121, 0x7080, 0x6115, 0xA03B, 0x610A, 0x9012, 0x611D, 0xA0D8, + 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07B, 0x5111, 0x7009, 0x6114, 0x90F4, + 0x6109, 0x8060, 0x611C, 0xA0C5, 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A2, + 0x5121, 0x7102, 0x6116, 0xA057, 0x610C, 0x901D, 0x611E, 0xA0E9, 0x510B, 0x611F, 0x610D, 0x902C, + 0x6000, 0x7106, 0x6117, 0xA072, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BC, + 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA09A, 0x5121, 0x70FF, 0x6115, 0xA04D, + 0x610A, 0x9017, 0x611D, 0xA0E1, 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA089, + 0x5111, 0x700A, 0x6114, 0xA02B, 0x6109, 0x80FE, 0x611C, 0xA0CF, 0x510F, 0x7006, 0x6112, 0x9082, + 0x6107, 0x8011, 0x611A, 0xA0AA, 0x5121, 0x7103, 0x6116, 0xA061, 0x610C, 0x9022, 0x611E, 0xA0F6, + 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06D, 0x5111, 0x7007, 0x6113, 0x90CC, + 0x6108, 0x8019, 0x611B, 0xA0B8, 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA096, + 0x5121, 0x7080, 0x6115, 0xA047, 0x610A, 0x9015, 0x611D, 0xA0DC, 0x510B, 0x6122, 0x610E, 0x9038, + 0x6001, 0x7123, 0x6118, 0xA083, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0CA, + 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A6, 0x5121, 0x7102, 0x6116, 0xA05C, + 0x610C, 0x901F, 0x611E, 0xA0ED, 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA076, + 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0C1, 0x510F, 0x7004, 0x6110, 0x9051, + 0x6002, 0x800E, 0x6119, 0xA09E, 0x5121, 0x70FF, 0x6115, 0xA053, 0x610A, 0x901B, 0x611D, 0xA0E5, + 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08D, 0x5111, 0x700A, 0x6114, 0xA032, + 0x6109, 0x8120, 0x611C, 0xA0D4, 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AF, + 0x5121, 0x7103, 0x6116, 0xA065, 0x610C, 0x9025, 0x611E, 0xA0FB, 0x510B, 0x611F, 0x610D, 0x9028, + 0x6000, 0x7105, 0x6117, 0xA06B, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B6, + 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA094, 0x5121, 0x7080, 0x6115, 0xA045, + 0x610A, 0x9014, 0x611D, 0xA0DA, 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07D, + 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C8, 0x510F, 0x7005, 0x6112, 0x9078, + 0x6107, 0x800F, 0x611A, 0xA0A4, 0x5121, 0x7102, 0x6116, 0xA05A, 0x610C, 0x901E, 0x611E, 0xA0EB, + 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA074, 0x5111, 0x7008, 0x6113, 0x90EE, + 0x6108, 0x8020, 0x611B, 0xA0BE, 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09C, + 0x5121, 0x70FF, 0x6115, 0xA04F, 0x610A, 0x901A, 0x611D, 0xA0E3, 0x510B, 0x6122, 0x610E, 0x903E, + 0x6001, 0x7124, 0x6118, 0xA08B, 0x5111, 0x700A, 0x6114, 0xA02E, 0x6109, 0x80FE, 0x611C, 0xA0D2, + 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AD, 0x5121, 0x7103, 0x6116, 0xA063, + 0x610C, 0x9024, 0x611E, 0xA0F9, 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06F, + 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0BA, 0x510F, 0x7003, 0x6110, 0x9048, + 0x6002, 0x800C, 0x6119, 0xA098, 0x5121, 0x7080, 0x6115, 0xA04B, 0x610A, 0x9016, 0x611D, 0xA0DE, + 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA086, 0x5111, 0x7009, 0x6114, 0x90FD, + 0x6109, 0x80F0, 0x611C, 0xA0CD, 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A8, + 0x5121, 0x7102, 0x6116, 0xA05E, 0x610C, 0x9021, 0x611E, 0xA0F3, 0x510B, 0x611F, 0x610D, 0x9033, + 0x6000, 0x7106, 0x6117, 0xA079, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C3, + 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA0A0, 0x5121, 0x70FF, 0x6115, 0xA055, + 0x610A, 0x901C, 0x611D, 0xA0E7, 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08F, + 0x5111, 0x700A, 0x6114, 0xA036, 0x6109, 0x8120, 0x611C, 0xA0D6, 0x510F, 0x7006, 0x6112, 0x9090, + 0x6107, 0x8013, 0x611A, 0xA0B1, 0x5121, 0x7103, 0x6116, 0xA067, 0x610C, 0x9026, 0x611E, 0xD100, + 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA068, 0x5111, 0x7007, 0x6113, 0x90C0, + 0x6108, 0x8018, 0x611B, 0xA0B3, 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA091, + 0x5121, 0x7080, 0x6115, 0xA03A, 0x610A, 0x9012, 0x611D, 0xA0D7, 0x510B, 0x6122, 0x610E, 0x9035, + 0x6001, 0x7123, 0x6118, 0xA07A, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C4, + 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A1, 0x5121, 0x7102, 0x6116, 0xA056, + 0x610C, 0x901D, 0x611E, 0xA0E8, 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA071, + 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BB, 0x510F, 0x7004, 0x6110, 0x9049, + 0x6002, 0x800D, 0x6119, 0xA099, 0x5121, 0x70FF, 0x6115, 0xA04C, 0x610A, 0x9017, 0x611D, 0xA0DF, + 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA087, 0x5111, 0x700A, 0x6114, 0xA023, + 0x6109, 0x80FE, 0x611C, 0xA0CE, 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0A9, + 0x5121, 0x7103, 0x6116, 0xA05F, 0x610C, 0x9022, 0x611E, 0xA0F5, 0x510B, 0x611F, 0x610D, 0x9029, + 0x6000, 0x7105, 0x6117, 0xA06C, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B7, + 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA095, 0x5121, 0x7080, 0x6115, 0xA046, + 0x610A, 0x9015, 0x611D, 0xA0DB, 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA07E, + 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0C9, 0x510F, 0x7005, 0x6112, 0x907F, + 0x6107, 0x8010, 0x611A, 0xA0A5, 0x5121, 0x7102, 0x6116, 0xA05B, 0x610C, 0x901F, 0x611E, 0xA0EC, + 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA075, 0x5111, 0x7008, 0x6113, 0x90F1, + 0x6108, 0x8040, 0x611B, 0xA0BF, 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09D, + 0x5121, 0x70FF, 0x6115, 0xA052, 0x610A, 0x901B, 0x611D, 0xA0E4, 0x510B, 0x6122, 0x610E, 0x903F, + 0x6001, 0x7124, 0x6118, 0xA08C, 0x5111, 0x700A, 0x6114, 0xA02F, 0x6109, 0x8120, 0x611C, 0xA0D3, + 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AE, 0x5121, 0x7103, 0x6116, 0xA064, + 0x610C, 0x9025, 0x611E, 0xA0FA, 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06A, + 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B5, 0x510F, 0x7003, 0x6110, 0x9043, + 0x6002, 0x800B, 0x6119, 0xA093, 0x5121, 0x7080, 0x6115, 0xA03D, 0x610A, 0x9014, 0x611D, 0xA0D9, + 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07C, 0x5111, 0x7009, 0x6114, 0x90F8, + 0x6109, 0x8060, 0x611C, 0xA0C7, 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A3, + 0x5121, 0x7102, 0x6116, 0xA058, 0x610C, 0x901E, 0x611E, 0xA0EA, 0x510B, 0x611F, 0x610D, 0x9030, + 0x6000, 0x7106, 0x6117, 0xA073, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BD, + 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09B, 0x5121, 0x70FF, 0x6115, 0xA04E, + 0x610A, 0x901A, 0x611D, 0xA0E2, 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08A, + 0x5111, 0x700A, 0x6114, 0xA02D, 0x6109, 0x80FE, 0x611C, 0xA0D1, 0x510F, 0x7006, 0x6112, 0x9084, + 0x6107, 0x8011, 0x611A, 0xA0AC, 0x5121, 0x7103, 0x6116, 0xA062, 0x610C, 0x9024, 0x611E, 0xA0F7, + 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06E, 0x5111, 0x7007, 0x6113, 0x90D0, + 0x6108, 0x8019, 0x611B, 0xA0B9, 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA097, + 0x5121, 0x7080, 0x6115, 0xA04A, 0x610A, 0x9016, 0x611D, 0xA0DD, 0x510B, 0x6122, 0x610E, 0x9039, + 0x6001, 0x7123, 0x6118, 0xA085, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CB, + 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A7, 0x5121, 0x7102, 0x6116, 0xA05D, + 0x610C, 0x9021, 0x611E, 0xA0EF, 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA077, + 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C2, 0x510F, 0x7004, 0x6110, 0x9059, + 0x6002, 0x800E, 0x6119, 0xA09F, 0x5121, 0x70FF, 0x6115, 0xA054, 0x610A, 0x901C, 0x611D, 0xA0E6, + 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08E, 0x5111, 0x700A, 0x6114, 0xA034, + 0x6109, 0x8120, 0x611C, 0xA0D5, 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B0, + 0x5121, 0x7103, 0x6116, 0xA066, 0x610C, 0x9026, 0x611E, 0xA104, 0x510B, 0x611F, 0x610D, 0x9027, + 0x6000, 0x7105, 0x6117, 0xA069, 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B4, + 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA092, 0x5121, 0x7080, 0x6115, 0xA03B, + 0x610A, 0x9012, 0x611D, 0xA0D8, 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07B, + 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C5, 0x510F, 0x7005, 0x6112, 0x9070, + 0x6107, 0x800F, 0x611A, 0xA0A2, 0x5121, 0x7102, 0x6116, 0xA057, 0x610C, 0x901D, 0x611E, 0xA0E9, + 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA072, 0x5111, 0x7008, 0x6113, 0x90E0, + 0x6108, 0x8020, 0x611B, 0xA0BC, 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA09A, + 0x5121, 0x70FF, 0x6115, 0xA04D, 0x610A, 0x9017, 0x611D, 0xA0E1, 0x510B, 0x6122, 0x610E, 0x903C, + 0x6001, 0x7124, 0x6118, 0xA089, 0x5111, 0x700A, 0x6114, 0xA02B, 0x6109, 0x80FE, 0x611C, 0xA0CF, + 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0AA, 0x5121, 0x7103, 0x6116, 0xA061, + 0x610C, 0x9022, 0x611E, 0xA0F6, 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06D, + 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B8, 0x510F, 0x7003, 0x6110, 0x9044, + 0x6002, 0x800C, 0x6119, 0xA096, 0x5121, 0x7080, 0x6115, 0xA047, 0x610A, 0x9015, 0x611D, 0xA0DC, + 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA083, 0x5111, 0x7009, 0x6114, 0x90FC, + 0x6109, 0x80F0, 0x611C, 0xA0CA, 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A6, + 0x5121, 0x7102, 0x6116, 0xA05C, 0x610C, 0x901F, 0x611E, 0xA0ED, 0x510B, 0x611F, 0x610D, 0x9031, + 0x6000, 0x7106, 0x6117, 0xA076, 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0C1, + 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09E, 0x5121, 0x70FF, 0x6115, 0xA053, + 0x610A, 0x901B, 0x611D, 0xA0E5, 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08D, + 0x5111, 0x700A, 0x6114, 0xA032, 0x6109, 0x8120, 0x611C, 0xA0D4, 0x510F, 0x7006, 0x6112, 0x9088, + 0x6107, 0x8013, 0x611A, 0xA0AF, 0x5121, 0x7103, 0x6116, 0xA065, 0x610C, 0x9025, 0x611E, 0xA0FB, + 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06B, 0x5111, 0x7007, 0x6113, 0x90C6, + 0x6108, 0x8018, 0x611B, 0xA0B6, 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA094, + 0x5121, 0x7080, 0x6115, 0xA045, 0x610A, 0x9014, 0x611D, 0xA0DA, 0x510B, 0x6122, 0x610E, 0x9037, + 0x6001, 0x7123, 0x6118, 0xA07D, 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C8, + 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A4, 0x5121, 0x7102, 0x6116, 0xA05A, + 0x610C, 0x901E, 0x611E, 0xA0EB, 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA074, + 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BE, 0x510F, 0x7004, 0x6110, 0x9050, + 0x6002, 0x800D, 0x6119, 0xA09C, 0x5121, 0x70FF, 0x6115, 0xA04F, 0x610A, 0x901A, 0x611D, 0xA0E3, + 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08B, 0x5111, 0x700A, 0x6114, 0xA02E, + 0x6109, 0x80FE, 0x611C, 0xA0D2, 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AD, + 0x5121, 0x7103, 0x6116, 0xA063, 0x610C, 0x9024, 0x611E, 0xA0F9, 0x510B, 0x611F, 0x610D, 0x902A, + 0x6000, 0x7105, 0x6117, 0xA06F, 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0BA, + 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA098, 0x5121, 0x7080, 0x6115, 0xA04B, + 0x610A, 0x9016, 0x611D, 0xA0DE, 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA086, + 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CD, 0x510F, 0x7005, 0x6112, 0x9081, + 0x6107, 0x8010, 0x611A, 0xA0A8, 0x5121, 0x7102, 0x6116, 0xA05E, 0x610C, 0x9021, 0x611E, 0xA0F3, + 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA079, 0x5111, 0x7008, 0x6113, 0x90F2, + 0x6108, 0x8040, 0x611B, 0xA0C3, 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA0A0, + 0x5121, 0x70FF, 0x6115, 0xA055, 0x610A, 0x901C, 0x611D, 0xA0E7, 0x510B, 0x6122, 0x610E, 0x9041, + 0x6001, 0x7124, 0x6118, 0xA08F, 0x5111, 0x700A, 0x6114, 0xA036, 0x6109, 0x8120, 0x611C, 0xA0D6, + 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B1, 0x5121, 0x7103, 0x6116, 0xA067, + 0x610C, 0x9026, 0x611E, 0xB0B2, 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA068, + 0x5111, 0x7007, 0x6113, 0x90C0, 0x6108, 0x8018, 0x611B, 0xA0B3, 0x510F, 0x7003, 0x6110, 0x9042, + 0x6002, 0x800B, 0x6119, 0xA091, 0x5121, 0x7080, 0x6115, 0xA03A, 0x610A, 0x9012, 0x611D, 0xA0D7, + 0x510B, 0x6122, 0x610E, 0x9035, 0x6001, 0x7123, 0x6118, 0xA07A, 0x5111, 0x7009, 0x6114, 0x90F4, + 0x6109, 0x8060, 0x611C, 0xA0C4, 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A1, + 0x5121, 0x7102, 0x6116, 0xA056, 0x610C, 0x901D, 0x611E, 0xA0E8, 0x510B, 0x611F, 0x610D, 0x902C, + 0x6000, 0x7106, 0x6117, 0xA071, 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BB, + 0x510F, 0x7004, 0x6110, 0x9049, 0x6002, 0x800D, 0x6119, 0xA099, 0x5121, 0x70FF, 0x6115, 0xA04C, + 0x610A, 0x9017, 0x611D, 0xA0DF, 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA087, + 0x5111, 0x700A, 0x6114, 0xA023, 0x6109, 0x80FE, 0x611C, 0xA0CE, 0x510F, 0x7006, 0x6112, 0x9082, + 0x6107, 0x8011, 0x611A, 0xA0A9, 0x5121, 0x7103, 0x6116, 0xA05F, 0x610C, 0x9022, 0x611E, 0xA0F5, + 0x510B, 0x611F, 0x610D, 0x9029, 0x6000, 0x7105, 0x6117, 0xA06C, 0x5111, 0x7007, 0x6113, 0x90CC, + 0x6108, 0x8019, 0x611B, 0xA0B7, 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA095, + 0x5121, 0x7080, 0x6115, 0xA046, 0x610A, 0x9015, 0x611D, 0xA0DB, 0x510B, 0x6122, 0x610E, 0x9038, + 0x6001, 0x7123, 0x6118, 0xA07E, 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0C9, + 0x510F, 0x7005, 0x6112, 0x907F, 0x6107, 0x8010, 0x611A, 0xA0A5, 0x5121, 0x7102, 0x6116, 0xA05B, + 0x610C, 0x901F, 0x611E, 0xA0EC, 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA075, + 0x5111, 0x7008, 0x6113, 0x90F1, 0x6108, 0x8040, 0x611B, 0xA0BF, 0x510F, 0x7004, 0x6110, 0x9051, + 0x6002, 0x800E, 0x6119, 0xA09D, 0x5121, 0x70FF, 0x6115, 0xA052, 0x610A, 0x901B, 0x611D, 0xA0E4, + 0x510B, 0x6122, 0x610E, 0x903F, 0x6001, 0x7124, 0x6118, 0xA08C, 0x5111, 0x700A, 0x6114, 0xA02F, + 0x6109, 0x8120, 0x611C, 0xA0D3, 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AE, + 0x5121, 0x7103, 0x6116, 0xA064, 0x610C, 0x9025, 0x611E, 0xA0FA, 0x510B, 0x611F, 0x610D, 0x9028, + 0x6000, 0x7105, 0x6117, 0xA06A, 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B5, + 0x510F, 0x7003, 0x6110, 0x9043, 0x6002, 0x800B, 0x6119, 0xA093, 0x5121, 0x7080, 0x6115, 0xA03D, + 0x610A, 0x9014, 0x611D, 0xA0D9, 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07C, + 0x5111, 0x7009, 0x6114, 0x90F8, 0x6109, 0x8060, 0x611C, 0xA0C7, 0x510F, 0x7005, 0x6112, 0x9078, + 0x6107, 0x800F, 0x611A, 0xA0A3, 0x5121, 0x7102, 0x6116, 0xA058, 0x610C, 0x901E, 0x611E, 0xA0EA, + 0x510B, 0x611F, 0x610D, 0x9030, 0x6000, 0x7106, 0x6117, 0xA073, 0x5111, 0x7008, 0x6113, 0x90EE, + 0x6108, 0x8020, 0x611B, 0xA0BD, 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09B, + 0x5121, 0x70FF, 0x6115, 0xA04E, 0x610A, 0x901A, 0x611D, 0xA0E2, 0x510B, 0x6122, 0x610E, 0x903E, + 0x6001, 0x7124, 0x6118, 0xA08A, 0x5111, 0x700A, 0x6114, 0xA02D, 0x6109, 0x80FE, 0x611C, 0xA0D1, + 0x510F, 0x7006, 0x6112, 0x9084, 0x6107, 0x8011, 0x611A, 0xA0AC, 0x5121, 0x7103, 0x6116, 0xA062, + 0x610C, 0x9024, 0x611E, 0xA0F7, 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06E, + 0x5111, 0x7007, 0x6113, 0x90D0, 0x6108, 0x8019, 0x611B, 0xA0B9, 0x510F, 0x7003, 0x6110, 0x9048, + 0x6002, 0x800C, 0x6119, 0xA097, 0x5121, 0x7080, 0x6115, 0xA04A, 0x610A, 0x9016, 0x611D, 0xA0DD, + 0x510B, 0x6122, 0x610E, 0x9039, 0x6001, 0x7123, 0x6118, 0xA085, 0x5111, 0x7009, 0x6114, 0x90FD, + 0x6109, 0x80F0, 0x611C, 0xA0CB, 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A7, + 0x5121, 0x7102, 0x6116, 0xA05D, 0x610C, 0x9021, 0x611E, 0xA0EF, 0x510B, 0x611F, 0x610D, 0x9033, + 0x6000, 0x7106, 0x6117, 0xA077, 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C2, + 0x510F, 0x7004, 0x6110, 0x9059, 0x6002, 0x800E, 0x6119, 0xA09F, 0x5121, 0x70FF, 0x6115, 0xA054, + 0x610A, 0x901C, 0x611D, 0xA0E6, 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08E, + 0x5111, 0x700A, 0x6114, 0xA034, 0x6109, 0x8120, 0x611C, 0xA0D5, 0x510F, 0x7006, 0x6112, 0x9090, + 0x6107, 0x8013, 0x611A, 0xA0B0, 0x5121, 0x7103, 0x6116, 0xA066, 0x610C, 0x9026, 0x611E, 0xA104, + 0x510B, 0x611F, 0x610D, 0x9027, 0x6000, 0x7105, 0x6117, 0xA069, 0x5111, 0x7007, 0x6113, 0x90C0, + 0x6108, 0x8018, 0x611B, 0xA0B4, 0x510F, 0x7003, 0x6110, 0x9042, 0x6002, 0x800B, 0x6119, 0xA092, + 0x5121, 0x7080, 0x6115, 0xA03B, 0x610A, 0x9012, 0x611D, 0xA0D8, 0x510B, 0x6122, 0x610E, 0x9035, + 0x6001, 0x7123, 0x6118, 0xA07B, 0x5111, 0x7009, 0x6114, 0x90F4, 0x6109, 0x8060, 0x611C, 0xA0C5, + 0x510F, 0x7005, 0x6112, 0x9070, 0x6107, 0x800F, 0x611A, 0xA0A2, 0x5121, 0x7102, 0x6116, 0xA057, + 0x610C, 0x901D, 0x611E, 0xA0E9, 0x510B, 0x611F, 0x610D, 0x902C, 0x6000, 0x7106, 0x6117, 0xA072, + 0x5111, 0x7008, 0x6113, 0x90E0, 0x6108, 0x8020, 0x611B, 0xA0BC, 0x510F, 0x7004, 0x6110, 0x9049, + 0x6002, 0x800D, 0x6119, 0xA09A, 0x5121, 0x70FF, 0x6115, 0xA04D, 0x610A, 0x9017, 0x611D, 0xA0E1, + 0x510B, 0x6122, 0x610E, 0x903C, 0x6001, 0x7124, 0x6118, 0xA089, 0x5111, 0x700A, 0x6114, 0xA02B, + 0x6109, 0x80FE, 0x611C, 0xA0CF, 0x510F, 0x7006, 0x6112, 0x9082, 0x6107, 0x8011, 0x611A, 0xA0AA, + 0x5121, 0x7103, 0x6116, 0xA061, 0x610C, 0x9022, 0x611E, 0xA0F6, 0x510B, 0x611F, 0x610D, 0x9029, + 0x6000, 0x7105, 0x6117, 0xA06D, 0x5111, 0x7007, 0x6113, 0x90CC, 0x6108, 0x8019, 0x611B, 0xA0B8, + 0x510F, 0x7003, 0x6110, 0x9044, 0x6002, 0x800C, 0x6119, 0xA096, 0x5121, 0x7080, 0x6115, 0xA047, + 0x610A, 0x9015, 0x611D, 0xA0DC, 0x510B, 0x6122, 0x610E, 0x9038, 0x6001, 0x7123, 0x6118, 0xA083, + 0x5111, 0x7009, 0x6114, 0x90FC, 0x6109, 0x80F0, 0x611C, 0xA0CA, 0x510F, 0x7005, 0x6112, 0x907F, + 0x6107, 0x8010, 0x611A, 0xA0A6, 0x5121, 0x7102, 0x6116, 0xA05C, 0x610C, 0x901F, 0x611E, 0xA0ED, + 0x510B, 0x611F, 0x610D, 0x9031, 0x6000, 0x7106, 0x6117, 0xA076, 0x5111, 0x7008, 0x6113, 0x90F1, + 0x6108, 0x8040, 0x611B, 0xA0C1, 0x510F, 0x7004, 0x6110, 0x9051, 0x6002, 0x800E, 0x6119, 0xA09E, + 0x5121, 0x70FF, 0x6115, 0xA053, 0x610A, 0x901B, 0x611D, 0xA0E5, 0x510B, 0x6122, 0x610E, 0x903F, + 0x6001, 0x7124, 0x6118, 0xA08D, 0x5111, 0x700A, 0x6114, 0xA032, 0x6109, 0x8120, 0x611C, 0xA0D4, + 0x510F, 0x7006, 0x6112, 0x9088, 0x6107, 0x8013, 0x611A, 0xA0AF, 0x5121, 0x7103, 0x6116, 0xA065, + 0x610C, 0x9025, 0x611E, 0xA0FB, 0x510B, 0x611F, 0x610D, 0x9028, 0x6000, 0x7105, 0x6117, 0xA06B, + 0x5111, 0x7007, 0x6113, 0x90C6, 0x6108, 0x8018, 0x611B, 0xA0B6, 0x510F, 0x7003, 0x6110, 0x9043, + 0x6002, 0x800B, 0x6119, 0xA094, 0x5121, 0x7080, 0x6115, 0xA045, 0x610A, 0x9014, 0x611D, 0xA0DA, + 0x510B, 0x6122, 0x610E, 0x9037, 0x6001, 0x7123, 0x6118, 0xA07D, 0x5111, 0x7009, 0x6114, 0x90F8, + 0x6109, 0x8060, 0x611C, 0xA0C8, 0x510F, 0x7005, 0x6112, 0x9078, 0x6107, 0x800F, 0x611A, 0xA0A4, + 0x5121, 0x7102, 0x6116, 0xA05A, 0x610C, 0x901E, 0x611E, 0xA0EB, 0x510B, 0x611F, 0x610D, 0x9030, + 0x6000, 0x7106, 0x6117, 0xA074, 0x5111, 0x7008, 0x6113, 0x90EE, 0x6108, 0x8020, 0x611B, 0xA0BE, + 0x510F, 0x7004, 0x6110, 0x9050, 0x6002, 0x800D, 0x6119, 0xA09C, 0x5121, 0x70FF, 0x6115, 0xA04F, + 0x610A, 0x901A, 0x611D, 0xA0E3, 0x510B, 0x6122, 0x610E, 0x903E, 0x6001, 0x7124, 0x6118, 0xA08B, + 0x5111, 0x700A, 0x6114, 0xA02E, 0x6109, 0x80FE, 0x611C, 0xA0D2, 0x510F, 0x7006, 0x6112, 0x9084, + 0x6107, 0x8011, 0x611A, 0xA0AD, 0x5121, 0x7103, 0x6116, 0xA063, 0x610C, 0x9024, 0x611E, 0xA0F9, + 0x510B, 0x611F, 0x610D, 0x902A, 0x6000, 0x7105, 0x6117, 0xA06F, 0x5111, 0x7007, 0x6113, 0x90D0, + 0x6108, 0x8019, 0x611B, 0xA0BA, 0x510F, 0x7003, 0x6110, 0x9048, 0x6002, 0x800C, 0x6119, 0xA098, + 0x5121, 0x7080, 0x6115, 0xA04B, 0x610A, 0x9016, 0x611D, 0xA0DE, 0x510B, 0x6122, 0x610E, 0x9039, + 0x6001, 0x7123, 0x6118, 0xA086, 0x5111, 0x7009, 0x6114, 0x90FD, 0x6109, 0x80F0, 0x611C, 0xA0CD, + 0x510F, 0x7005, 0x6112, 0x9081, 0x6107, 0x8010, 0x611A, 0xA0A8, 0x5121, 0x7102, 0x6116, 0xA05E, + 0x610C, 0x9021, 0x611E, 0xA0F3, 0x510B, 0x611F, 0x610D, 0x9033, 0x6000, 0x7106, 0x6117, 0xA079, + 0x5111, 0x7008, 0x6113, 0x90F2, 0x6108, 0x8040, 0x611B, 0xA0C3, 0x510F, 0x7004, 0x6110, 0x9059, + 0x6002, 0x800E, 0x6119, 0xA0A0, 0x5121, 0x70FF, 0x6115, 0xA055, 0x610A, 0x901C, 0x611D, 0xA0E7, + 0x510B, 0x6122, 0x610E, 0x9041, 0x6001, 0x7124, 0x6118, 0xA08F, 0x5111, 0x700A, 0x6114, 0xA036, + 0x6109, 0x8120, 0x611C, 0xA0D6, 0x510F, 0x7006, 0x6112, 0x9090, 0x6107, 0x8013, 0x611A, 0xA0B1, + 0x5121, 0x7103, 0x6116, 0xA067, 0x610C, 0x9026, 0x611E, 0xD125 }; -static const UINT16 HuffTableLOM[512] = -{ - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x700D, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600B, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x8012, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x7010, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600C, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x9018, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x700E, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600B, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x9013, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x800F, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600C, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x901C, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x700D, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600B, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x8015, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x7010, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600C, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x901A, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x700E, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600B, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x9016, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x8011, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600C, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x901E, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x700D, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600B, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x8012, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x7010, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600C, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x9019, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x700E, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600B, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x9014, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x800F, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600C, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x901D, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x700D, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600B, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x8015, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x7010, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600C, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x901B, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x700E, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600B, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x9017, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x8011, - 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600C, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x901F +static const UINT16 HuffTableLOM[512] = { + 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, + 0x2001, 0x4006, 0x3004, 0x700D, 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600B, + 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x8012, 0x2001, 0x4000, 0x3002, 0x4008, + 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x7010, + 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600C, 0x2001, 0x4003, 0x3002, 0x5009, + 0x2001, 0x4006, 0x3004, 0x9018, 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, + 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x700E, 0x2001, 0x4000, 0x3002, 0x4008, + 0x2001, 0x4005, 0x3004, 0x600B, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x9013, + 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, + 0x2001, 0x4006, 0x3004, 0x800F, 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600C, + 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x901C, 0x2001, 0x4000, 0x3002, 0x4008, + 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x700D, + 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600B, 0x2001, 0x4003, 0x3002, 0x5009, + 0x2001, 0x4006, 0x3004, 0x8015, 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, + 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x7010, 0x2001, 0x4000, 0x3002, 0x4008, + 0x2001, 0x4005, 0x3004, 0x600C, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x901A, + 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, + 0x2001, 0x4006, 0x3004, 0x700E, 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600B, + 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x9016, 0x2001, 0x4000, 0x3002, 0x4008, + 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x8011, + 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600C, 0x2001, 0x4003, 0x3002, 0x5009, + 0x2001, 0x4006, 0x3004, 0x901E, 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, + 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x700D, 0x2001, 0x4000, 0x3002, 0x4008, + 0x2001, 0x4005, 0x3004, 0x600B, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x8012, + 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, + 0x2001, 0x4006, 0x3004, 0x7010, 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600C, + 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x9019, 0x2001, 0x4000, 0x3002, 0x4008, + 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x700E, + 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600B, 0x2001, 0x4003, 0x3002, 0x5009, + 0x2001, 0x4006, 0x3004, 0x9014, 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, + 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x800F, 0x2001, 0x4000, 0x3002, 0x4008, + 0x2001, 0x4005, 0x3004, 0x600C, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x901D, + 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, + 0x2001, 0x4006, 0x3004, 0x700D, 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600B, + 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x8015, 0x2001, 0x4000, 0x3002, 0x4008, + 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x7010, + 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600C, 0x2001, 0x4003, 0x3002, 0x5009, + 0x2001, 0x4006, 0x3004, 0x901B, 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, + 0x2001, 0x4003, 0x3002, 0x5007, 0x2001, 0x4006, 0x3004, 0x700E, 0x2001, 0x4000, 0x3002, 0x4008, + 0x2001, 0x4005, 0x3004, 0x600B, 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x9017, + 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x500A, 0x2001, 0x4003, 0x3002, 0x5007, + 0x2001, 0x4006, 0x3004, 0x8011, 0x2001, 0x4000, 0x3002, 0x4008, 0x2001, 0x4005, 0x3004, 0x600C, + 0x2001, 0x4003, 0x3002, 0x5009, 0x2001, 0x4006, 0x3004, 0x901F }; -static const BYTE HuffTableMask[39] = -{ +static const BYTE HuffTableMask[39] = { 0x11, /* 0 */ 0x9E, /* 1 */ 0xA1, /* 2 */ @@ -624,93 +803,92 @@ static const BYTE HuffTableMask[39] = 0xFF, /* 35 */ 0xFF, /* 36 */ 0x00, /* 37 */ - 0x00 /* 38 */ + 0x00 /* 38 */ }; -static const BYTE HuffLengthLEC[294] = -{ - 6, /* 0 */ - 6, /* 1 */ - 6, /* 2 */ - 7, /* 3 */ - 7, /* 4 */ - 7, /* 5 */ - 7, /* 6 */ - 7, /* 7 */ - 7, /* 8 */ - 7, /* 9 */ - 7, /* 10 */ - 8, /* 11 */ - 8, /* 12 */ - 8, /* 13 */ - 8, /* 14 */ - 8, /* 15 */ - 8, /* 16 */ - 8, /* 17 */ - 9, /* 18 */ - 8, /* 19 */ - 9, /* 20 */ - 9, /* 21 */ - 9, /* 22 */ - 9, /* 23 */ - 8, /* 24 */ - 8, /* 25 */ - 9, /* 26 */ - 9, /* 27 */ - 9, /* 28 */ - 9, /* 29 */ - 9, /* 30 */ - 9, /* 31 */ - 8, /* 32 */ - 9, /* 33 */ - 9, /* 34 */ +static const BYTE HuffLengthLEC[294] = { + 6, /* 0 */ + 6, /* 1 */ + 6, /* 2 */ + 7, /* 3 */ + 7, /* 4 */ + 7, /* 5 */ + 7, /* 6 */ + 7, /* 7 */ + 7, /* 8 */ + 7, /* 9 */ + 7, /* 10 */ + 8, /* 11 */ + 8, /* 12 */ + 8, /* 13 */ + 8, /* 14 */ + 8, /* 15 */ + 8, /* 16 */ + 8, /* 17 */ + 9, /* 18 */ + 8, /* 19 */ + 9, /* 20 */ + 9, /* 21 */ + 9, /* 22 */ + 9, /* 23 */ + 8, /* 24 */ + 8, /* 25 */ + 9, /* 26 */ + 9, /* 27 */ + 9, /* 28 */ + 9, /* 29 */ + 9, /* 30 */ + 9, /* 31 */ + 8, /* 32 */ + 9, /* 33 */ + 9, /* 34 */ 10, /* 35 */ - 9, /* 36 */ - 9, /* 37 */ - 9, /* 38 */ - 9, /* 39 */ - 9, /* 40 */ - 9, /* 41 */ - 9, /* 42 */ + 9, /* 36 */ + 9, /* 37 */ + 9, /* 38 */ + 9, /* 39 */ + 9, /* 40 */ + 9, /* 41 */ + 9, /* 42 */ 10, /* 43 */ - 9, /* 44 */ + 9, /* 44 */ 10, /* 45 */ 10, /* 46 */ 10, /* 47 */ - 9, /* 48 */ - 9, /* 49 */ + 9, /* 48 */ + 9, /* 49 */ 10, /* 50 */ - 9, /* 51 */ + 9, /* 51 */ 10, /* 52 */ - 9, /* 53 */ + 9, /* 53 */ 10, /* 54 */ - 9, /* 55 */ - 9, /* 56 */ - 9, /* 57 */ + 9, /* 55 */ + 9, /* 56 */ + 9, /* 57 */ 10, /* 58 */ 10, /* 59 */ - 9, /* 60 */ + 9, /* 60 */ 10, /* 61 */ - 9, /* 62 */ - 9, /* 63 */ - 8, /* 64 */ - 9, /* 65 */ - 9, /* 66 */ - 9, /* 67 */ - 9, /* 68 */ + 9, /* 62 */ + 9, /* 63 */ + 8, /* 64 */ + 9, /* 65 */ + 9, /* 66 */ + 9, /* 67 */ + 9, /* 68 */ 10, /* 69 */ 10, /* 70 */ 10, /* 71 */ - 9, /* 72 */ - 9, /* 73 */ + 9, /* 72 */ + 9, /* 73 */ 10, /* 74 */ 10, /* 75 */ 10, /* 76 */ 10, /* 77 */ 10, /* 78 */ 10, /* 79 */ - 9, /* 80 */ - 9, /* 81 */ + 9, /* 80 */ + 9, /* 81 */ 10, /* 82 */ 10, /* 83 */ 10, /* 84 */ @@ -718,14 +896,14 @@ static const BYTE HuffLengthLEC[294] = 10, /* 86 */ 10, /* 87 */ 10, /* 88 */ - 9, /* 89 */ + 9, /* 89 */ 10, /* 90 */ 10, /* 91 */ 10, /* 92 */ 10, /* 93 */ 10, /* 94 */ 10, /* 95 */ - 8, /* 96 */ + 8, /* 96 */ 10, /* 97 */ 10, /* 98 */ 10, /* 99 */ @@ -741,7 +919,7 @@ static const BYTE HuffLengthLEC[294] = 10, /* 109 */ 10, /* 110 */ 10, /* 111 */ - 9, /* 112 */ + 9, /* 112 */ 10, /* 113 */ 10, /* 114 */ 10, /* 115 */ @@ -749,23 +927,23 @@ static const BYTE HuffLengthLEC[294] = 10, /* 117 */ 10, /* 118 */ 10, /* 119 */ - 9, /* 120 */ + 9, /* 120 */ 10, /* 121 */ 10, /* 122 */ 10, /* 123 */ 10, /* 124 */ 10, /* 125 */ 10, /* 126 */ - 9, /* 127 */ - 7, /* 128 */ - 9, /* 129 */ - 9, /* 130 */ + 9, /* 127 */ + 7, /* 128 */ + 9, /* 129 */ + 9, /* 130 */ 10, /* 131 */ - 9, /* 132 */ + 9, /* 132 */ 10, /* 133 */ 10, /* 134 */ 10, /* 135 */ - 9, /* 136 */ + 9, /* 136 */ 10, /* 137 */ 10, /* 138 */ 10, /* 139 */ @@ -773,7 +951,7 @@ static const BYTE HuffLengthLEC[294] = 10, /* 141 */ 10, /* 142 */ 10, /* 143 */ - 9, /* 144 */ + 9, /* 144 */ 10, /* 145 */ 10, /* 146 */ 10, /* 147 */ @@ -821,23 +999,23 @@ static const BYTE HuffLengthLEC[294] = 10, /* 189 */ 10, /* 190 */ 10, /* 191 */ - 9, /* 192 */ + 9, /* 192 */ 10, /* 193 */ 10, /* 194 */ 10, /* 195 */ 10, /* 196 */ 10, /* 197 */ - 9, /* 198 */ + 9, /* 198 */ 10, /* 199 */ 10, /* 200 */ 10, /* 201 */ 10, /* 202 */ 10, /* 203 */ - 9, /* 204 */ + 9, /* 204 */ 10, /* 205 */ 10, /* 206 */ 10, /* 207 */ - 9, /* 208 */ + 9, /* 208 */ 10, /* 209 */ 10, /* 210 */ 10, /* 211 */ @@ -853,7 +1031,7 @@ static const BYTE HuffLengthLEC[294] = 10, /* 221 */ 10, /* 222 */ 10, /* 223 */ - 9, /* 224 */ + 9, /* 224 */ 10, /* 225 */ 10, /* 226 */ 10, /* 227 */ @@ -867,66 +1045,65 @@ static const BYTE HuffLengthLEC[294] = 10, /* 235 */ 10, /* 236 */ 10, /* 237 */ - 9, /* 238 */ + 9, /* 238 */ 10, /* 239 */ - 8, /* 240 */ - 9, /* 241 */ - 9, /* 242 */ + 8, /* 240 */ + 9, /* 241 */ + 9, /* 242 */ 10, /* 243 */ - 9, /* 244 */ + 9, /* 244 */ 10, /* 245 */ 10, /* 246 */ 10, /* 247 */ - 9, /* 248 */ + 9, /* 248 */ 10, /* 249 */ 10, /* 250 */ 10, /* 251 */ - 9, /* 252 */ - 9, /* 253 */ - 8, /* 254 */ - 7, /* 255 */ + 9, /* 252 */ + 9, /* 253 */ + 8, /* 254 */ + 7, /* 255 */ 13, /* 256 */ 13, /* 257 */ - 7, /* 258 */ - 7, /* 259 */ + 7, /* 258 */ + 7, /* 259 */ 10, /* 260 */ - 7, /* 261 */ - 7, /* 262 */ - 6, /* 263 */ - 6, /* 264 */ - 6, /* 265 */ - 6, /* 266 */ - 5, /* 267 */ - 6, /* 268 */ - 6, /* 269 */ - 6, /* 270 */ - 5, /* 271 */ - 6, /* 272 */ - 5, /* 273 */ - 6, /* 274 */ - 6, /* 275 */ - 6, /* 276 */ - 6, /* 277 */ - 6, /* 278 */ - 6, /* 279 */ - 6, /* 280 */ - 6, /* 281 */ - 6, /* 282 */ - 6, /* 283 */ - 6, /* 284 */ - 6, /* 285 */ - 6, /* 286 */ - 6, /* 287 */ - 8, /* 288 */ - 5, /* 289 */ - 6, /* 290 */ - 7, /* 291 */ - 7, /* 292 */ - 13 /* 293 */ + 7, /* 261 */ + 7, /* 262 */ + 6, /* 263 */ + 6, /* 264 */ + 6, /* 265 */ + 6, /* 266 */ + 5, /* 267 */ + 6, /* 268 */ + 6, /* 269 */ + 6, /* 270 */ + 5, /* 271 */ + 6, /* 272 */ + 5, /* 273 */ + 6, /* 274 */ + 6, /* 275 */ + 6, /* 276 */ + 6, /* 277 */ + 6, /* 278 */ + 6, /* 279 */ + 6, /* 280 */ + 6, /* 281 */ + 6, /* 282 */ + 6, /* 283 */ + 6, /* 284 */ + 6, /* 285 */ + 6, /* 286 */ + 6, /* 287 */ + 8, /* 288 */ + 5, /* 289 */ + 6, /* 290 */ + 7, /* 291 */ + 7, /* 292 */ + 13 /* 293 */ }; -static const BYTE HuffCodeLEC[588] = -{ +static const BYTE HuffCodeLEC[588] = { 0x04, /* 0 */ 0x00, /* 1 */ 0x24, /* 2 */ @@ -1517,8 +1694,7 @@ static const BYTE HuffCodeLEC[588] = 0x1F /* 587 */ }; -static const BYTE HuffLengthLOM[32] = -{ +static const BYTE HuffLengthLOM[32] = { 4, /* 0 */ 2, /* 1 */ 3, /* 2 */ @@ -1550,11 +1726,10 @@ static const BYTE HuffLengthLOM[32] = 9, /* 28 */ 9, /* 29 */ 9, /* 30 */ - 9 /* 31 */ + 9 /* 31 */ }; -static const UINT16 HuffCodeLOM[32] = -{ +static const UINT16 HuffCodeLOM[32] = { 0x0001, /* 0 */ 0x0000, /* 1 */ 0x0002, /* 2 */ @@ -1586,11 +1761,10 @@ static const UINT16 HuffCodeLOM[32] = 0x007F, /* 28 */ 0x017F, /* 29 */ 0x00FF, /* 30 */ - 0x01FF /* 31 */ + 0x01FF /* 31 */ }; -static const UINT32 CopyOffsetBitsLUT[32] = -{ +static const UINT32 CopyOffsetBitsLUT[32] = { 0x0, /* 0 */ 0x0, /* 1 */ 0x0, /* 2 */ @@ -1622,35 +1796,34 @@ static const UINT32 CopyOffsetBitsLUT[32] = 0xD, /* 28 */ 0xD, /* 29 */ 0xE, /* 30 */ - 0xE /* 31 */ + 0xE /* 31 */ }; -static const UINT32 CopyOffsetBaseLUT[32] = -{ - 0x1, /* 0 */ - 0x2, /* 1 */ - 0x3, /* 2 */ - 0x4, /* 3 */ - 0x5, /* 4 */ - 0x7, /* 5 */ - 0x9, /* 6 */ - 0xD, /* 7 */ - 0x11, /* 8 */ - 0x19, /* 9 */ - 0x21, /* 10 */ - 0x31, /* 11 */ - 0x41, /* 12 */ - 0x61, /* 13 */ - 0x81, /* 14 */ - 0xC1, /* 15 */ - 0x101, /* 16 */ - 0x181, /* 17 */ - 0x201, /* 18 */ - 0x301, /* 19 */ - 0x401, /* 20 */ - 0x601, /* 21 */ - 0x801, /* 22 */ - 0xC01, /* 23 */ +static const UINT32 CopyOffsetBaseLUT[32] = { + 0x1, /* 0 */ + 0x2, /* 1 */ + 0x3, /* 2 */ + 0x4, /* 3 */ + 0x5, /* 4 */ + 0x7, /* 5 */ + 0x9, /* 6 */ + 0xD, /* 7 */ + 0x11, /* 8 */ + 0x19, /* 9 */ + 0x21, /* 10 */ + 0x31, /* 11 */ + 0x41, /* 12 */ + 0x61, /* 13 */ + 0x81, /* 14 */ + 0xC1, /* 15 */ + 0x101, /* 16 */ + 0x181, /* 17 */ + 0x201, /* 18 */ + 0x301, /* 19 */ + 0x401, /* 20 */ + 0x601, /* 21 */ + 0x801, /* 22 */ + 0xC01, /* 23 */ 0x1001, /* 24 */ 0x1801, /* 25 */ 0x2001, /* 26 */ @@ -1658,11 +1831,10 @@ static const UINT32 CopyOffsetBaseLUT[32] = 0x4001, /* 28 */ 0x6001, /* 29 */ 0x8001, /* 30 */ - 0xC001 /* 31 */ + 0xC001 /* 31 */ }; -static const UINT32 LOMBitsLUT[30] = -{ +static const UINT32 LOMBitsLUT[30] = { 0x0, /* 0 */ 0x0, /* 1 */ 0x0, /* 2 */ @@ -1692,41 +1864,40 @@ static const UINT32 LOMBitsLUT[30] = 0x8, /* 26 */ 0x8, /* 27 */ 0xE, /* 28 */ - 0xE /* 29 */ + 0xE /* 29 */ }; -static const UINT32 LOMBaseLUT[30] = -{ - 0x2, /* 0 */ - 0x3, /* 1 */ - 0x4, /* 2 */ - 0x5, /* 3 */ - 0x6, /* 4 */ - 0x7, /* 5 */ - 0x8, /* 6 */ - 0x9, /* 7 */ - 0xA, /* 8 */ - 0xC, /* 9 */ - 0xE, /* 10 */ - 0x10, /* 11 */ - 0x12, /* 12 */ - 0x16, /* 13 */ - 0x1A, /* 14 */ - 0x1E, /* 15 */ - 0x22, /* 16 */ - 0x2A, /* 17 */ - 0x32, /* 18 */ - 0x3A, /* 19 */ - 0x42, /* 20 */ - 0x52, /* 21 */ - 0x62, /* 22 */ - 0x72, /* 23 */ - 0x82, /* 24 */ - 0xC2, /* 25 */ +static const UINT32 LOMBaseLUT[30] = { + 0x2, /* 0 */ + 0x3, /* 1 */ + 0x4, /* 2 */ + 0x5, /* 3 */ + 0x6, /* 4 */ + 0x7, /* 5 */ + 0x8, /* 6 */ + 0x9, /* 7 */ + 0xA, /* 8 */ + 0xC, /* 9 */ + 0xE, /* 10 */ + 0x10, /* 11 */ + 0x12, /* 12 */ + 0x16, /* 13 */ + 0x1A, /* 14 */ + 0x1E, /* 15 */ + 0x22, /* 16 */ + 0x2A, /* 17 */ + 0x32, /* 18 */ + 0x3A, /* 19 */ + 0x42, /* 20 */ + 0x52, /* 21 */ + 0x62, /* 22 */ + 0x72, /* 23 */ + 0x82, /* 24 */ + 0xC2, /* 25 */ 0x102, /* 26 */ 0x202, /* 27 */ - 0x2, /* 28 */ - 0x2 /* 29 */ + 0x2, /* 28 */ + 0x2 /* 29 */ }; static INLINE UINT16 get_word(const BYTE* data) @@ -1782,8 +1953,8 @@ static INLINE void NCrushWriteStart(UINT32* bits, UINT32* offset, UINT32* accumu *accumulator = 0; } -static INLINE void NCrushWriteBits(BYTE** DstPtr, UINT32* accumulator, UINT32* offset, - UINT32 _bits, UINT32 _nbits) +static INLINE void NCrushWriteBits(BYTE** DstPtr, UINT32* accumulator, UINT32* offset, UINT32 _bits, + UINT32 _nbits) { *accumulator |= _bits << *offset; *offset += _nbits; @@ -1888,7 +2059,7 @@ int ncrush_decompress(NCRUSH_CONTEXT* ncrush, BYTE* pSrcData, UINT32 SrcSize, BY if (HistoryPtr >= HistoryBufferEnd) { WLog_ERR(TAG, "ncrush_decompress error: HistoryPtr (%p) >= HistoryBufferEnd (%p)", - (void*) HistoryPtr, (void*) HistoryBufferEnd); + (void*)HistoryPtr, (void*)HistoryBufferEnd); return -1003; } @@ -2048,8 +2219,8 @@ int ncrush_decompress(NCRUSH_CONTEXT* ncrush, BYTE* pSrcData, UINT32 SrcSize, BY if (ncrush->HistoryBufferFence != 0xABABABAB) { - WLog_ERR(TAG, - "NCrushDecompress: history buffer fence was overwritten, potential buffer overflow detected!"); + WLog_ERR(TAG, "NCrushDecompress: history buffer fence was overwritten, potential buffer " + "overflow detected!"); return -1007; } @@ -2094,8 +2265,7 @@ static int ncrush_find_match_length(const BYTE* Ptr1, const BYTE* Ptr2, BYTE* Hi val1 = *Ptr1++; val2 = *Ptr2++; - } - while (val1 == val2); + } while (val1 == val2); return Ptr1 - (Ptr + 1); } @@ -2117,7 +2287,7 @@ static int ncrush_find_best_match(NCRUSH_CONTEXT* ncrush, UINT16 HistoryOffset, MatchLength = 2; Offset = HistoryOffset; - HistoryBuffer = (BYTE*) ncrush->HistoryBuffer; + HistoryBuffer = (BYTE*)ncrush->HistoryBuffer; ncrush->MatchTable[0] = HistoryOffset; MatchOffset = ncrush->MatchTable[HistoryOffset]; NextOffset = ncrush->MatchTable[Offset]; @@ -2183,7 +2353,8 @@ static int ncrush_find_best_match(NCRUSH_CONTEXT* ncrush, UINT16 HistoryOffset, if ((Offset != HistoryOffset) && Offset) { Length = ncrush_find_match_length(&HistoryBuffer[HistoryOffset + 2], - &HistoryBuffer[Offset + 2], ncrush->HistoryPtr) + 2; + &HistoryBuffer[Offset + 2], ncrush->HistoryPtr) + + 2; if (Length < 2) return -1; @@ -2197,7 +2368,8 @@ static int ncrush_find_best_match(NCRUSH_CONTEXT* ncrush, UINT16 HistoryOffset, MatchOffset = Offset; } - if ((Length <= MatchLength) || (&HistoryBuffer[HistoryOffset + 2] < ncrush->HistoryPtr)) + if ((Length <= MatchLength) || + (&HistoryBuffer[HistoryOffset + 2] < ncrush->HistoryPtr)) { NextOffset = ncrush->MatchTable[Offset]; MatchPtr = &HistoryBuffer[MatchLength]; @@ -2679,7 +2851,7 @@ void ncrush_context_reset(NCRUSH_CONTEXT* ncrush, BOOL flush) NCRUSH_CONTEXT* ncrush_context_new(BOOL Compressor) { NCRUSH_CONTEXT* ncrush; - ncrush = (NCRUSH_CONTEXT*) calloc(1, sizeof(NCRUSH_CONTEXT)); + ncrush = (NCRUSH_CONTEXT*)calloc(1, sizeof(NCRUSH_CONTEXT)); if (ncrush) { diff --git a/libfreerdp/codec/nsc.c b/libfreerdp/codec/nsc.c index 9b39af196..6c0755217 100644 --- a/libfreerdp/codec/nsc.c +++ b/libfreerdp/codec/nsc.c @@ -39,7 +39,10 @@ #include "nsc_sse2.h" #ifndef NSC_INIT_SIMD -#define NSC_INIT_SIMD(_nsc_context) do { } while (0) +#define NSC_INIT_SIMD(_nsc_context) \ + do \ + { \ + } while (0) #endif static BOOL nsc_decode(NSC_CONTEXT* context) @@ -70,22 +73,20 @@ static BOOL nsc_decode(NSC_CONTEXT* context) if (context->ChromaSubsamplingLevel) { - yplane = context->priv->PlaneBuffers[0] + y * rw; /* Y */ - coplane = context->priv->PlaneBuffers[1] + (y >> 1) * (rw >> - 1); /* Co, supersampled */ - cgplane = context->priv->PlaneBuffers[2] + (y >> 1) * (rw >> - 1); /* Cg, supersampled */ + yplane = context->priv->PlaneBuffers[0] + y * rw; /* Y */ + coplane = context->priv->PlaneBuffers[1] + (y >> 1) * (rw >> 1); /* Co, supersampled */ + cgplane = context->priv->PlaneBuffers[2] + (y >> 1) * (rw >> 1); /* Cg, supersampled */ } else { - yplane = context->priv->PlaneBuffers[0] + y * context->width; /* Y */ + yplane = context->priv->PlaneBuffers[0] + y * context->width; /* Y */ coplane = context->priv->PlaneBuffers[1] + y * context->width; /* Co */ cgplane = context->priv->PlaneBuffers[2] + y * context->width; /* Cg */ } for (x = 0; x < context->width; x++) { - INT16 y_val = (INT16) * yplane; + INT16 y_val = (INT16)*yplane; INT16 co_val = (INT16)(INT8)(*coplane << shift); INT16 cg_val = (INT16)(INT8)(*cgplane << shift); INT16 r_val = y_val + co_val - cg_val; @@ -136,13 +137,13 @@ static BOOL nsc_rle_decode(BYTE* in, BYTE* out, UINT32 outSize, UINT32 originalS if (*in < 0xFF) { - len = (UINT32) * in++; + len = (UINT32)*in++; len += 2; } else { in++; - len = *((UINT32*) in); + len = *((UINT32*)in); in += 4; } @@ -198,8 +199,8 @@ static BOOL nsc_rle_decompress_data(NSC_CONTEXT* context) } else if (planeSize < originalSize) { - if (!nsc_rle_decode(rle, context->priv->PlaneBuffers[i], context->priv->PlaneBuffersLength, - originalSize)) + if (!nsc_rle_decode(rle, context->priv->PlaneBuffers[i], + context->priv->PlaneBuffersLength, originalSize)) return FALSE; } else @@ -226,10 +227,9 @@ static BOOL nsc_stream_initialize(NSC_CONTEXT* context, wStream* s) for (i = 0; i < 4; i++) Stream_Read_UINT32(s, context->PlaneByteCount[i]); - Stream_Read_UINT8(s, context->ColorLossLevel); /* ColorLossLevel (1 byte) */ - Stream_Read_UINT8(s, - context->ChromaSubsamplingLevel); /* ChromaSubsamplingLevel (1 byte) */ - Stream_Seek(s, 2); /* Reserved (2 bytes) */ + Stream_Read_UINT8(s, context->ColorLossLevel); /* ColorLossLevel (1 byte) */ + Stream_Read_UINT8(s, context->ChromaSubsamplingLevel); /* ChromaSubsamplingLevel (1 byte) */ + Stream_Seek(s, 2); /* Reserved (2 bytes) */ context->Planes = Stream_Pointer(s); return TRUE; } @@ -276,7 +276,7 @@ static BOOL nsc_context_initialize(NSC_CONTEXT* context, wStream* s) { for (i = 0; i < 4; i++) { - void* tmp = (BYTE*) realloc(context->priv->PlaneBuffers[i], length); + void* tmp = (BYTE*)realloc(context->priv->PlaneBuffers[i], length); if (!tmp) return FALSE; @@ -302,14 +302,10 @@ static BOOL nsc_context_initialize(NSC_CONTEXT* context, wStream* s) return TRUE; } -static void nsc_profiler_print(NSC_CONTEXT_PRIV* priv) -{ - PROFILER_PRINT_HEADER - PROFILER_PRINT(priv->prof_nsc_rle_decompress_data) - PROFILER_PRINT(priv->prof_nsc_decode) - PROFILER_PRINT(priv->prof_nsc_rle_compress_data) - PROFILER_PRINT(priv->prof_nsc_encode) - PROFILER_PRINT_FOOTER +static void nsc_profiler_print(NSC_CONTEXT_PRIV* priv){ + PROFILER_PRINT_HEADER PROFILER_PRINT(priv->prof_nsc_rle_decompress_data) + PROFILER_PRINT(priv->prof_nsc_decode) PROFILER_PRINT(priv->prof_nsc_rle_compress_data) + PROFILER_PRINT(priv->prof_nsc_encode) PROFILER_PRINT_FOOTER } BOOL nsc_context_reset(NSC_CONTEXT* context, UINT32 width, UINT32 height) @@ -328,12 +324,12 @@ BOOL nsc_context_reset(NSC_CONTEXT* context, UINT32 width, UINT32 height) NSC_CONTEXT* nsc_context_new(void) { NSC_CONTEXT* context; - context = (NSC_CONTEXT*) calloc(1, sizeof(NSC_CONTEXT)); + context = (NSC_CONTEXT*)calloc(1, sizeof(NSC_CONTEXT)); if (!context) return NULL; - context->priv = (NSC_CONTEXT_PRIV*) calloc(1, sizeof(NSC_CONTEXT_PRIV)); + context->priv = (NSC_CONTEXT_PRIV*)calloc(1, sizeof(NSC_CONTEXT_PRIV)); if (!context->priv) goto error; @@ -344,11 +340,9 @@ NSC_CONTEXT* nsc_context_new(void) context->decode = nsc_decode; context->encode = nsc_encode; - PROFILER_CREATE(context->priv->prof_nsc_rle_decompress_data, - "nsc_rle_decompress_data") + PROFILER_CREATE(context->priv->prof_nsc_rle_decompress_data, "nsc_rle_decompress_data") PROFILER_CREATE(context->priv->prof_nsc_decode, "nsc_decode") - PROFILER_CREATE(context->priv->prof_nsc_rle_compress_data, - "nsc_rle_compress_data") + PROFILER_CREATE(context->priv->prof_nsc_rle_compress_data, "nsc_rle_compress_data") PROFILER_CREATE(context->priv->prof_nsc_encode, "nsc_encode") /* Default encoding parameters */ context->ColorLossLevel = 3; @@ -390,38 +384,34 @@ BOOL nsc_context_set_pixel_format(NSC_CONTEXT* context, UINT32 pixel_format) return nsc_context_set_parameters(context, NSC_COLOR_FORMAT, pixel_format); } -BOOL nsc_context_set_parameters(NSC_CONTEXT* context, NSC_PARAMETER what, - UINT32 value) +BOOL nsc_context_set_parameters(NSC_CONTEXT* context, NSC_PARAMETER what, UINT32 value) { if (!context) return FALSE; - switch(what) + switch (what) { - case NSC_COLOR_LOSS_LEVEL: - context->ColorLossLevel = value; - break; - case NSC_ALLOW_SUBSAMPLING: - context->ChromaSubsamplingLevel = value; - break; - case NSC_DYNAMIC_COLOR_FIDELITY: - context->DynamicColorFidelity = value != 0; - break; - case NSC_COLOR_FORMAT: - context->format = value; - break; - default: - return FALSE; + case NSC_COLOR_LOSS_LEVEL: + context->ColorLossLevel = value; + break; + case NSC_ALLOW_SUBSAMPLING: + context->ChromaSubsamplingLevel = value; + break; + case NSC_DYNAMIC_COLOR_FIDELITY: + context->DynamicColorFidelity = value != 0; + break; + case NSC_COLOR_FORMAT: + context->format = value; + break; + default: + return FALSE; } return TRUE; } -BOOL nsc_process_message(NSC_CONTEXT* context, UINT16 bpp, - UINT32 width, UINT32 height, - const BYTE* data, UINT32 length, - BYTE* pDstData, UINT32 DstFormat, - UINT32 nDstStride, - UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, +BOOL nsc_process_message(NSC_CONTEXT* context, UINT16 bpp, UINT32 width, UINT32 height, + const BYTE* data, UINT32 length, BYTE* pDstData, UINT32 DstFormat, + UINT32 nDstStride, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, UINT32 flip) { wStream* s; @@ -493,9 +483,8 @@ BOOL nsc_process_message(NSC_CONTEXT* context, UINT16 bpp, return FALSE; } - if (!freerdp_image_copy(pDstData, DstFormat, nDstStride, nXDst, nYDst, - width, height, context->BitmapData, - PIXEL_FORMAT_BGRA32, 0, 0, 0, NULL, flip)) + if (!freerdp_image_copy(pDstData, DstFormat, nDstStride, nXDst, nYDst, width, height, + context->BitmapData, PIXEL_FORMAT_BGRA32, 0, 0, 0, NULL, flip)) return FALSE; return TRUE; diff --git a/libfreerdp/codec/nsc_encode.c b/libfreerdp/codec/nsc_encode.c index 11a3c56f5..722ae6d51 100644 --- a/libfreerdp/codec/nsc_encode.c +++ b/libfreerdp/codec/nsc_encode.c @@ -57,8 +57,7 @@ struct _NSC_MESSAGE }; typedef struct _NSC_MESSAGE NSC_MESSAGE; -static BOOL nsc_write_message(NSC_CONTEXT* context, wStream* s, - const NSC_MESSAGE* message); +static BOOL nsc_write_message(NSC_CONTEXT* context, wStream* s, const NSC_MESSAGE* message); static BOOL nsc_context_initialize_encode(NSC_CONTEXT* context) { @@ -75,7 +74,7 @@ static BOOL nsc_context_initialize_encode(NSC_CONTEXT* context) { for (i = 0; i < 5; i++) { - BYTE* tmp = (BYTE*) realloc(context->priv->PlaneBuffers[i], length); + BYTE* tmp = (BYTE*)realloc(context->priv->PlaneBuffers[i], length); if (!tmp) goto fail; @@ -113,8 +112,7 @@ fail: return FALSE; } -static BOOL nsc_encode_argb_to_aycocg(NSC_CONTEXT* context, const BYTE* data, - UINT32 scanline) +static BOOL nsc_encode_argb_to_aycocg(NSC_CONTEXT* context, const BYTE* data, UINT32 scanline) { UINT16 x; UINT16 y; @@ -208,34 +206,34 @@ static BOOL nsc_encode_argb_to_aycocg(NSC_CONTEXT* context, const BYTE* data, break; case PIXEL_FORMAT_A4: - { - int shift; - BYTE idx; - shift = (7 - (x % 8)); - idx = ((*src) >> shift) & 1; - idx |= (((*(src + 1)) >> shift) & 1) << 1; - idx |= (((*(src + 2)) >> shift) & 1) << 2; - idx |= (((*(src + 3)) >> shift) & 1) << 3; - idx *= 3; - r_val = (INT16) context->palette[idx]; - g_val = (INT16) context->palette[idx + 1]; - b_val = (INT16) context->palette[idx + 2]; + { + int shift; + BYTE idx; + shift = (7 - (x % 8)); + idx = ((*src) >> shift) & 1; + idx |= (((*(src + 1)) >> shift) & 1) << 1; + idx |= (((*(src + 2)) >> shift) & 1) << 2; + idx |= (((*(src + 3)) >> shift) & 1) << 3; + idx *= 3; + r_val = (INT16)context->palette[idx]; + g_val = (INT16)context->palette[idx + 1]; + b_val = (INT16)context->palette[idx + 2]; - if (shift == 0) - src += 4; - } + if (shift == 0) + src += 4; + } a_val = 0xFF; break; case PIXEL_FORMAT_RGB8: - { - int idx = (*src) * 3; - r_val = (INT16) context->palette[idx]; - g_val = (INT16) context->palette[idx + 1]; - b_val = (INT16) context->palette[idx + 2]; - src++; - } + { + int idx = (*src) * 3; + r_val = (INT16)context->palette[idx]; + g_val = (INT16)context->palette[idx + 1]; + b_val = (INT16)context->palette[idx + 2]; + src++; + } a_val = 0xFF; break; @@ -292,21 +290,23 @@ static BOOL nsc_encode_subsampling(NSC_CONTEXT* context) if (tempWidth > context->priv->PlaneBuffersLength / tempHeight) return FALSE; - for (y = 0; y < tempHeight >> 1; y++) + for (y = 0; y> 1; y++) { BYTE* co_dst = context->priv->PlaneBuffers[1] + y * (tempWidth >> 1); BYTE* cg_dst = context->priv->PlaneBuffers[2] + y * (tempWidth >> 1); - const INT8* co_src0 = (INT8*) context->priv->PlaneBuffers[1] + (y << 1) * tempWidth; + const INT8* co_src0 = (INT8*)context->priv->PlaneBuffers[1] + (y << 1) * tempWidth; const INT8* co_src1 = co_src0 + tempWidth; - const INT8* cg_src0 = (INT8*) context->priv->PlaneBuffers[2] + (y << 1) * tempWidth; + const INT8* cg_src0 = (INT8*)context->priv->PlaneBuffers[2] + (y << 1) * tempWidth; const INT8* cg_src1 = cg_src0 + tempWidth; - for (x = 0; x < tempWidth >> 1; x++) + for (x = 0; x> 1; x++) { - *co_dst++ = (BYTE)(((INT16) * co_src0 + (INT16) * (co_src0 + 1) + - (INT16) * co_src1 + (INT16) * (co_src1 + 1)) >> 2); - *cg_dst++ = (BYTE)(((INT16) * cg_src0 + (INT16) * (cg_src0 + 1) + - (INT16) * cg_src1 + (INT16) * (cg_src1 + 1)) >> 2); + *co_dst++ = (BYTE)(((INT16)*co_src0 + (INT16) * (co_src0 + 1) + (INT16)*co_src1 + + (INT16) * (co_src1 + 1)) >> + 2); + *cg_dst++ = (BYTE)(((INT16)*cg_src0 + (INT16) * (cg_src0 + 1) + (INT16)*cg_src1 + + (INT16) * (cg_src1 + 1)) >> + 2); co_src0 += 2; co_src1 += 2; cg_src0 += 2; @@ -418,8 +418,7 @@ static void nsc_rle_compress_data(NSC_CONTEXT* context) } } -UINT32 nsc_compute_byte_count(NSC_CONTEXT* context, UINT32* ByteCount, - UINT32 width, UINT32 height) +UINT32 nsc_compute_byte_count(NSC_CONTEXT* context, UINT32* ByteCount, UINT32 width, UINT32 height) { UINT32 tempWidth; UINT32 tempHeight; @@ -449,29 +448,24 @@ UINT32 nsc_compute_byte_count(NSC_CONTEXT* context, UINT32* ByteCount, BOOL nsc_write_message(NSC_CONTEXT* context, wStream* s, const NSC_MESSAGE* message) { UINT32 totalPlaneByteCount; - totalPlaneByteCount = message->LumaPlaneByteCount + - message->OrangeChromaPlaneByteCount + + totalPlaneByteCount = message->LumaPlaneByteCount + message->OrangeChromaPlaneByteCount + message->GreenChromaPlaneByteCount + message->AlphaPlaneByteCount; if (!Stream_EnsureRemainingCapacity(s, 20 + totalPlaneByteCount)) return FALSE; - Stream_Write_UINT32(s, - message->LumaPlaneByteCount); /* LumaPlaneByteCount (4 bytes) */ - Stream_Write_UINT32(s, - message->OrangeChromaPlaneByteCount); /* OrangeChromaPlaneByteCount (4 bytes) */ - Stream_Write_UINT32(s, - message->GreenChromaPlaneByteCount); /* GreenChromaPlaneByteCount (4 bytes) */ - Stream_Write_UINT32(s, - message->AlphaPlaneByteCount); /* AlphaPlaneByteCount (4 bytes) */ - Stream_Write_UINT8(s, message->ColorLossLevel); /* ColorLossLevel (1 byte) */ - Stream_Write_UINT8(s, - message->ChromaSubsamplingLevel); /* ChromaSubsamplingLevel (1 byte) */ - Stream_Write_UINT16(s, 0); /* Reserved (2 bytes) */ + Stream_Write_UINT32(s, message->LumaPlaneByteCount); /* LumaPlaneByteCount (4 bytes) */ + Stream_Write_UINT32( + s, message->OrangeChromaPlaneByteCount); /* OrangeChromaPlaneByteCount (4 bytes) */ + Stream_Write_UINT32( + s, message->GreenChromaPlaneByteCount); /* GreenChromaPlaneByteCount (4 bytes) */ + Stream_Write_UINT32(s, message->AlphaPlaneByteCount); /* AlphaPlaneByteCount (4 bytes) */ + Stream_Write_UINT8(s, message->ColorLossLevel); /* ColorLossLevel (1 byte) */ + Stream_Write_UINT8(s, message->ChromaSubsamplingLevel); /* ChromaSubsamplingLevel (1 byte) */ + Stream_Write_UINT16(s, 0); /* Reserved (2 bytes) */ if (message->LumaPlaneByteCount) - Stream_Write(s, message->PlaneBuffers[0], - message->LumaPlaneByteCount); /* LumaPlane */ + Stream_Write(s, message->PlaneBuffers[0], message->LumaPlaneByteCount); /* LumaPlane */ if (message->OrangeChromaPlaneByteCount) Stream_Write(s, message->PlaneBuffers[1], @@ -482,14 +476,13 @@ BOOL nsc_write_message(NSC_CONTEXT* context, wStream* s, const NSC_MESSAGE* mess message->GreenChromaPlaneByteCount); /* GreenChromaPlane */ if (message->AlphaPlaneByteCount) - Stream_Write(s, message->PlaneBuffers[3], - message->AlphaPlaneByteCount); /* AlphaPlane */ + Stream_Write(s, message->PlaneBuffers[3], message->AlphaPlaneByteCount); /* AlphaPlane */ return TRUE; } -BOOL nsc_compose_message(NSC_CONTEXT* context, wStream* s, const BYTE* data, - UINT32 width, UINT32 height, UINT32 scanline) +BOOL nsc_compose_message(NSC_CONTEXT* context, wStream* s, const BYTE* data, UINT32 width, + UINT32 height, UINT32 scanline) { BOOL rc; NSC_MESSAGE message = { 0 }; @@ -527,18 +520,17 @@ BOOL nsc_compose_message(NSC_CONTEXT* context, wStream* s, const BYTE* data, return nsc_write_message(context, s, &message); } -BOOL nsc_decompose_message(NSC_CONTEXT* context, wStream* s, BYTE* bmpdata, - UINT32 x, UINT32 y, UINT32 width, UINT32 height, - UINT32 rowstride, UINT32 format, UINT32 flip) +BOOL nsc_decompose_message(NSC_CONTEXT* context, wStream* s, BYTE* bmpdata, UINT32 x, UINT32 y, + UINT32 width, UINT32 height, UINT32 rowstride, UINT32 format, + UINT32 flip) { size_t size = Stream_GetRemainingLength(s); if (size > UINT32_MAX) return FALSE; - if (!nsc_process_message(context, (UINT16)GetBitsPerPixel(context->format), - width, height, Stream_Pointer(s), - (UINT32)size, bmpdata, format, - rowstride, x, y, width, height, flip)) + if (!nsc_process_message(context, (UINT16)GetBitsPerPixel(context->format), width, height, + Stream_Pointer(s), (UINT32)size, bmpdata, format, rowstride, x, y, + width, height, flip)) return FALSE; Stream_Seek(s, size); return TRUE; diff --git a/libfreerdp/codec/nsc_encode.h b/libfreerdp/codec/nsc_encode.h index 784ccb6e3..a84a519f4 100644 --- a/libfreerdp/codec/nsc_encode.h +++ b/libfreerdp/codec/nsc_encode.h @@ -24,7 +24,6 @@ #include -FREERDP_LOCAL BOOL nsc_encode(NSC_CONTEXT* context, const BYTE* bmpdata, - UINT32 rowstride); +FREERDP_LOCAL BOOL nsc_encode(NSC_CONTEXT* context, const BYTE* bmpdata, UINT32 rowstride); #endif /* FREERDP_LIB_CODEC_NSC_ENCODE_H */ diff --git a/libfreerdp/codec/nsc_sse2.c b/libfreerdp/codec/nsc_sse2.c index d7828483d..3e393c902 100644 --- a/libfreerdp/codec/nsc_sse2.c +++ b/libfreerdp/codec/nsc_sse2.c @@ -35,8 +35,7 @@ #include "nsc_types.h" #include "nsc_sse2.h" -static BOOL nsc_encode_argb_to_aycocg_sse2(NSC_CONTEXT* context, - const BYTE* data, UINT32 scanline) +static BOOL nsc_encode_argb_to_aycocg_sse2(NSC_CONTEXT* context, const BYTE* data, UINT32 scanline) { UINT16 x; UINT16 y; @@ -144,147 +143,126 @@ static BOOL nsc_encode_argb_to_aycocg_sse2(NSC_CONTEXT* context, break; case PIXEL_FORMAT_BGR16: - b_val = _mm_set_epi16( - (((*(src + 15)) & 0xF8) | ((*(src + 15)) >> 5)), - (((*(src + 13)) & 0xF8) | ((*(src + 13)) >> 5)), - (((*(src + 11)) & 0xF8) | ((*(src + 11)) >> 5)), - (((*(src + 9)) & 0xF8) | ((*(src + 9)) >> 5)), - (((*(src + 7)) & 0xF8) | ((*(src + 7)) >> 5)), - (((*(src + 5)) & 0xF8) | ((*(src + 5)) >> 5)), - (((*(src + 3)) & 0xF8) | ((*(src + 3)) >> 5)), - (((*(src + 1)) & 0xF8) | ((*(src + 1)) >> 5))); + b_val = _mm_set_epi16((((*(src + 15)) & 0xF8) | ((*(src + 15)) >> 5)), + (((*(src + 13)) & 0xF8) | ((*(src + 13)) >> 5)), + (((*(src + 11)) & 0xF8) | ((*(src + 11)) >> 5)), + (((*(src + 9)) & 0xF8) | ((*(src + 9)) >> 5)), + (((*(src + 7)) & 0xF8) | ((*(src + 7)) >> 5)), + (((*(src + 5)) & 0xF8) | ((*(src + 5)) >> 5)), + (((*(src + 3)) & 0xF8) | ((*(src + 3)) >> 5)), + (((*(src + 1)) & 0xF8) | ((*(src + 1)) >> 5))); g_val = _mm_set_epi16( - ((((*(src + 15)) & 0x07) << 5) | (((*(src + 14)) & 0xE0) >> 3)), - ((((*(src + 13)) & 0x07) << 5) | (((*(src + 12)) & 0xE0) >> 3)), - ((((*(src + 11)) & 0x07) << 5) | (((*(src + 10)) & 0xE0) >> 3)), - ((((*(src + 9)) & 0x07) << 5) | (((*(src + 8)) & 0xE0) >> 3)), - ((((*(src + 7)) & 0x07) << 5) | (((*(src + 6)) & 0xE0) >> 3)), - ((((*(src + 5)) & 0x07) << 5) | (((*(src + 4)) & 0xE0) >> 3)), - ((((*(src + 3)) & 0x07) << 5) | (((*(src + 2)) & 0xE0) >> 3)), - ((((*(src + 1)) & 0x07) << 5) | (((*src) & 0xE0) >> 3))); + ((((*(src + 15)) & 0x07) << 5) | (((*(src + 14)) & 0xE0) >> 3)), + ((((*(src + 13)) & 0x07) << 5) | (((*(src + 12)) & 0xE0) >> 3)), + ((((*(src + 11)) & 0x07) << 5) | (((*(src + 10)) & 0xE0) >> 3)), + ((((*(src + 9)) & 0x07) << 5) | (((*(src + 8)) & 0xE0) >> 3)), + ((((*(src + 7)) & 0x07) << 5) | (((*(src + 6)) & 0xE0) >> 3)), + ((((*(src + 5)) & 0x07) << 5) | (((*(src + 4)) & 0xE0) >> 3)), + ((((*(src + 3)) & 0x07) << 5) | (((*(src + 2)) & 0xE0) >> 3)), + ((((*(src + 1)) & 0x07) << 5) | (((*src) & 0xE0) >> 3))); r_val = _mm_set_epi16( - ((((*(src + 14)) & 0x1F) << 3) | (((*(src + 14)) >> 2) & 0x07)), - ((((*(src + 12)) & 0x1F) << 3) | (((*(src + 12)) >> 2) & 0x07)), - ((((*(src + 10)) & 0x1F) << 3) | (((*(src + 10)) >> 2) & 0x07)), - ((((*(src + 8)) & 0x1F) << 3) | (((*(src + 8)) >> 2) & 0x07)), - ((((*(src + 6)) & 0x1F) << 3) | (((*(src + 6)) >> 2) & 0x07)), - ((((*(src + 4)) & 0x1F) << 3) | (((*(src + 4)) >> 2) & 0x07)), - ((((*(src + 2)) & 0x1F) << 3) | (((*(src + 2)) >> 2) & 0x07)), - ((((*src) & 0x1F) << 3) | (((*src) >> 2) & 0x07))); + ((((*(src + 14)) & 0x1F) << 3) | (((*(src + 14)) >> 2) & 0x07)), + ((((*(src + 12)) & 0x1F) << 3) | (((*(src + 12)) >> 2) & 0x07)), + ((((*(src + 10)) & 0x1F) << 3) | (((*(src + 10)) >> 2) & 0x07)), + ((((*(src + 8)) & 0x1F) << 3) | (((*(src + 8)) >> 2) & 0x07)), + ((((*(src + 6)) & 0x1F) << 3) | (((*(src + 6)) >> 2) & 0x07)), + ((((*(src + 4)) & 0x1F) << 3) | (((*(src + 4)) >> 2) & 0x07)), + ((((*(src + 2)) & 0x1F) << 3) | (((*(src + 2)) >> 2) & 0x07)), + ((((*src) & 0x1F) << 3) | (((*src) >> 2) & 0x07))); a_val = _mm_set1_epi16(0xFF); src += 16; break; case PIXEL_FORMAT_RGB16: - r_val = _mm_set_epi16( - (((*(src + 15)) & 0xF8) | ((*(src + 15)) >> 5)), - (((*(src + 13)) & 0xF8) | ((*(src + 13)) >> 5)), - (((*(src + 11)) & 0xF8) | ((*(src + 11)) >> 5)), - (((*(src + 9)) & 0xF8) | ((*(src + 9)) >> 5)), - (((*(src + 7)) & 0xF8) | ((*(src + 7)) >> 5)), - (((*(src + 5)) & 0xF8) | ((*(src + 5)) >> 5)), - (((*(src + 3)) & 0xF8) | ((*(src + 3)) >> 5)), - (((*(src + 1)) & 0xF8) | ((*(src + 1)) >> 5))); + r_val = _mm_set_epi16((((*(src + 15)) & 0xF8) | ((*(src + 15)) >> 5)), + (((*(src + 13)) & 0xF8) | ((*(src + 13)) >> 5)), + (((*(src + 11)) & 0xF8) | ((*(src + 11)) >> 5)), + (((*(src + 9)) & 0xF8) | ((*(src + 9)) >> 5)), + (((*(src + 7)) & 0xF8) | ((*(src + 7)) >> 5)), + (((*(src + 5)) & 0xF8) | ((*(src + 5)) >> 5)), + (((*(src + 3)) & 0xF8) | ((*(src + 3)) >> 5)), + (((*(src + 1)) & 0xF8) | ((*(src + 1)) >> 5))); g_val = _mm_set_epi16( - ((((*(src + 15)) & 0x07) << 5) | (((*(src + 14)) & 0xE0) >> 3)), - ((((*(src + 13)) & 0x07) << 5) | (((*(src + 12)) & 0xE0) >> 3)), - ((((*(src + 11)) & 0x07) << 5) | (((*(src + 10)) & 0xE0) >> 3)), - ((((*(src + 9)) & 0x07) << 5) | (((*(src + 8)) & 0xE0) >> 3)), - ((((*(src + 7)) & 0x07) << 5) | (((*(src + 6)) & 0xE0) >> 3)), - ((((*(src + 5)) & 0x07) << 5) | (((*(src + 4)) & 0xE0) >> 3)), - ((((*(src + 3)) & 0x07) << 5) | (((*(src + 2)) & 0xE0) >> 3)), - ((((*(src + 1)) & 0x07) << 5) | (((*src) & 0xE0) >> 3))); + ((((*(src + 15)) & 0x07) << 5) | (((*(src + 14)) & 0xE0) >> 3)), + ((((*(src + 13)) & 0x07) << 5) | (((*(src + 12)) & 0xE0) >> 3)), + ((((*(src + 11)) & 0x07) << 5) | (((*(src + 10)) & 0xE0) >> 3)), + ((((*(src + 9)) & 0x07) << 5) | (((*(src + 8)) & 0xE0) >> 3)), + ((((*(src + 7)) & 0x07) << 5) | (((*(src + 6)) & 0xE0) >> 3)), + ((((*(src + 5)) & 0x07) << 5) | (((*(src + 4)) & 0xE0) >> 3)), + ((((*(src + 3)) & 0x07) << 5) | (((*(src + 2)) & 0xE0) >> 3)), + ((((*(src + 1)) & 0x07) << 5) | (((*src) & 0xE0) >> 3))); b_val = _mm_set_epi16( - ((((*(src + 14)) & 0x1F) << 3) | (((*(src + 14)) >> 2) & 0x07)), - ((((*(src + 12)) & 0x1F) << 3) | (((*(src + 12)) >> 2) & 0x07)), - ((((*(src + 10)) & 0x1F) << 3) | (((*(src + 10)) >> 2) & 0x07)), - ((((*(src + 8)) & 0x1F) << 3) | (((*(src + 8)) >> 2) & 0x07)), - ((((*(src + 6)) & 0x1F) << 3) | (((*(src + 6)) >> 2) & 0x07)), - ((((*(src + 4)) & 0x1F) << 3) | (((*(src + 4)) >> 2) & 0x07)), - ((((*(src + 2)) & 0x1F) << 3) | (((*(src + 2)) >> 2) & 0x07)), - ((((*src) & 0x1F) << 3) | (((*src) >> 2) & 0x07))); + ((((*(src + 14)) & 0x1F) << 3) | (((*(src + 14)) >> 2) & 0x07)), + ((((*(src + 12)) & 0x1F) << 3) | (((*(src + 12)) >> 2) & 0x07)), + ((((*(src + 10)) & 0x1F) << 3) | (((*(src + 10)) >> 2) & 0x07)), + ((((*(src + 8)) & 0x1F) << 3) | (((*(src + 8)) >> 2) & 0x07)), + ((((*(src + 6)) & 0x1F) << 3) | (((*(src + 6)) >> 2) & 0x07)), + ((((*(src + 4)) & 0x1F) << 3) | (((*(src + 4)) >> 2) & 0x07)), + ((((*(src + 2)) & 0x1F) << 3) | (((*(src + 2)) >> 2) & 0x07)), + ((((*src) & 0x1F) << 3) | (((*src) >> 2) & 0x07))); a_val = _mm_set1_epi16(0xFF); src += 16; break; case PIXEL_FORMAT_A4: + { + int shift; + BYTE idx[8]; + + for (shift = 7; shift >= 0; shift--) { - int shift; - BYTE idx[8]; - - for (shift = 7; shift >= 0; shift--) - { - idx[shift] = ((*src) >> shift) & 1; - idx[shift] |= (((*(src + 1)) >> shift) & 1) << 1; - idx[shift] |= (((*(src + 2)) >> shift) & 1) << 2; - idx[shift] |= (((*(src + 3)) >> shift) & 1) << 3; - idx[shift] *= 3; - } - - r_val = _mm_set_epi16( - context->palette[idx[0]], - context->palette[idx[1]], - context->palette[idx[2]], - context->palette[idx[3]], - context->palette[idx[4]], - context->palette[idx[5]], - context->palette[idx[6]], - context->palette[idx[7]]); - g_val = _mm_set_epi16( - context->palette[idx[0] + 1], - context->palette[idx[1] + 1], - context->palette[idx[2] + 1], - context->palette[idx[3] + 1], - context->palette[idx[4] + 1], - context->palette[idx[5] + 1], - context->palette[idx[6] + 1], - context->palette[idx[7] + 1]); - b_val = _mm_set_epi16( - context->palette[idx[0] + 2], - context->palette[idx[1] + 2], - context->palette[idx[2] + 2], - context->palette[idx[3] + 2], - context->palette[idx[4] + 2], - context->palette[idx[5] + 2], - context->palette[idx[6] + 2], - context->palette[idx[7] + 2]); - src += 4; + idx[shift] = ((*src) >> shift) & 1; + idx[shift] |= (((*(src + 1)) >> shift) & 1) << 1; + idx[shift] |= (((*(src + 2)) >> shift) & 1) << 2; + idx[shift] |= (((*(src + 3)) >> shift) & 1) << 3; + idx[shift] *= 3; } + r_val = _mm_set_epi16(context->palette[idx[0]], context->palette[idx[1]], + context->palette[idx[2]], context->palette[idx[3]], + context->palette[idx[4]], context->palette[idx[5]], + context->palette[idx[6]], context->palette[idx[7]]); + g_val = + _mm_set_epi16(context->palette[idx[0] + 1], context->palette[idx[1] + 1], + context->palette[idx[2] + 1], context->palette[idx[3] + 1], + context->palette[idx[4] + 1], context->palette[idx[5] + 1], + context->palette[idx[6] + 1], context->palette[idx[7] + 1]); + b_val = + _mm_set_epi16(context->palette[idx[0] + 2], context->palette[idx[1] + 2], + context->palette[idx[2] + 2], context->palette[idx[3] + 2], + context->palette[idx[4] + 2], context->palette[idx[5] + 2], + context->palette[idx[6] + 2], context->palette[idx[7] + 2]); + src += 4; + } + a_val = _mm_set1_epi16(0xFF); break; case PIXEL_FORMAT_RGB8: - { - r_val = _mm_set_epi16( - context->palette[(*(src + 7)) * 3], - context->palette[(*(src + 6)) * 3], - context->palette[(*(src + 5)) * 3], - context->palette[(*(src + 4)) * 3], - context->palette[(*(src + 3)) * 3], - context->palette[(*(src + 2)) * 3], - context->palette[(*(src + 1)) * 3], - context->palette[(*src) * 3]); - g_val = _mm_set_epi16( - context->palette[(*(src + 7)) * 3 + 1], - context->palette[(*(src + 6)) * 3 + 1], - context->palette[(*(src + 5)) * 3 + 1], - context->palette[(*(src + 4)) * 3 + 1], - context->palette[(*(src + 3)) * 3 + 1], - context->palette[(*(src + 2)) * 3 + 1], - context->palette[(*(src + 1)) * 3 + 1], - context->palette[(*src) * 3 + 1]); - b_val = _mm_set_epi16( - context->palette[(*(src + 7)) * 3 + 2], - context->palette[(*(src + 6)) * 3 + 2], - context->palette[(*(src + 5)) * 3 + 2], - context->palette[(*(src + 4)) * 3 + 2], - context->palette[(*(src + 3)) * 3 + 2], - context->palette[(*(src + 2)) * 3 + 2], - context->palette[(*(src + 1)) * 3 + 2], - context->palette[(*src) * 3 + 2]); - src += 8; - } + { + r_val = _mm_set_epi16( + context->palette[(*(src + 7)) * 3], context->palette[(*(src + 6)) * 3], + context->palette[(*(src + 5)) * 3], context->palette[(*(src + 4)) * 3], + context->palette[(*(src + 3)) * 3], context->palette[(*(src + 2)) * 3], + context->palette[(*(src + 1)) * 3], context->palette[(*src) * 3]); + g_val = _mm_set_epi16(context->palette[(*(src + 7)) * 3 + 1], + context->palette[(*(src + 6)) * 3 + 1], + context->palette[(*(src + 5)) * 3 + 1], + context->palette[(*(src + 4)) * 3 + 1], + context->palette[(*(src + 3)) * 3 + 1], + context->palette[(*(src + 2)) * 3 + 1], + context->palette[(*(src + 1)) * 3 + 1], + context->palette[(*src) * 3 + 1]); + b_val = _mm_set_epi16(context->palette[(*(src + 7)) * 3 + 2], + context->palette[(*(src + 6)) * 3 + 2], + context->palette[(*(src + 5)) * 3 + 2], + context->palette[(*(src + 4)) * 3 + 2], + context->palette[(*(src + 3)) * 3 + 2], + context->palette[(*(src + 2)) * 3 + 2], + context->palette[(*(src + 1)) * 3 + 2], + context->palette[(*src) * 3 + 2]); + src += 8; + } a_val = _mm_set1_epi16(0xFF); break; @@ -303,13 +281,13 @@ static BOOL nsc_encode_argb_to_aycocg_sse2(NSC_CONTEXT* context, cg_val = _mm_sub_epi16(cg_val, _mm_srai_epi16(b_val, 1)); cg_val = _mm_srai_epi16(cg_val, ccl); y_val = _mm_packus_epi16(y_val, y_val); - _mm_storeu_si128((__m128i*) yplane, y_val); + _mm_storeu_si128((__m128i*)yplane, y_val); co_val = _mm_packs_epi16(co_val, co_val); - _mm_storeu_si128((__m128i*) coplane, co_val); + _mm_storeu_si128((__m128i*)coplane, co_val); cg_val = _mm_packs_epi16(cg_val, cg_val); - _mm_storeu_si128((__m128i*) cgplane, cg_val); + _mm_storeu_si128((__m128i*)cgplane, cg_val); a_val = _mm_packus_epi16(a_val, a_val); - _mm_storeu_si128((__m128i*) aplane, a_val); + _mm_storeu_si128((__m128i*)aplane, a_val); yplane += 8; coplane += 8; cgplane += 8; @@ -358,32 +336,32 @@ static void nsc_encode_subsampling_sse2(NSC_CONTEXT* context) tempWidth = ROUND_UP_TO(context->width, 8); tempHeight = ROUND_UP_TO(context->height, 2); - for (y = 0; y < tempHeight >> 1; y++) + for (y = 0; y> 1; y++) { co_dst = context->priv->PlaneBuffers[1] + y * (tempWidth >> 1); cg_dst = context->priv->PlaneBuffers[2] + y * (tempWidth >> 1); - co_src0 = (INT8*) context->priv->PlaneBuffers[1] + (y << 1) * tempWidth; + co_src0 = (INT8*)context->priv->PlaneBuffers[1] + (y << 1) * tempWidth; co_src1 = co_src0 + tempWidth; - cg_src0 = (INT8*) context->priv->PlaneBuffers[2] + (y << 1) * tempWidth; + cg_src0 = (INT8*)context->priv->PlaneBuffers[2] + (y << 1) * tempWidth; cg_src1 = cg_src0 + tempWidth; - for (x = 0; x < tempWidth >> 1; x += 8) + for (x = 0; x> 1; x += 8) { - t = _mm_loadu_si128((__m128i*) co_src0); - t = _mm_avg_epu8(t, _mm_loadu_si128((__m128i*) co_src1)); + t = _mm_loadu_si128((__m128i*)co_src0); + t = _mm_avg_epu8(t, _mm_loadu_si128((__m128i*)co_src1)); val = _mm_and_si128(_mm_srli_si128(t, 1), mask); val = _mm_avg_epu16(val, _mm_and_si128(t, mask)); val = _mm_packus_epi16(val, val); - _mm_storeu_si128((__m128i*) co_dst, val); + _mm_storeu_si128((__m128i*)co_dst, val); co_dst += 8; co_src0 += 16; co_src1 += 16; - t = _mm_loadu_si128((__m128i*) cg_src0); - t = _mm_avg_epu8(t, _mm_loadu_si128((__m128i*) cg_src1)); + t = _mm_loadu_si128((__m128i*)cg_src0); + t = _mm_avg_epu8(t, _mm_loadu_si128((__m128i*)cg_src1)); val = _mm_and_si128(_mm_srli_si128(t, 1), mask); val = _mm_avg_epu16(val, _mm_and_si128(t, mask)); val = _mm_packus_epi16(val, val); - _mm_storeu_si128((__m128i*) cg_dst, val); + _mm_storeu_si128((__m128i*)cg_dst, val); cg_dst += 8; cg_src0 += 16; cg_src1 += 16; @@ -391,8 +369,7 @@ static void nsc_encode_subsampling_sse2(NSC_CONTEXT* context) } } -static BOOL nsc_encode_sse2(NSC_CONTEXT* context, const BYTE* data, - UINT32 scanline) +static BOOL nsc_encode_sse2(NSC_CONTEXT* context, const BYTE* data, UINT32 scanline) { if (!nsc_encode_argb_to_aycocg_sse2(context, data, scanline)) return FALSE; diff --git a/libfreerdp/codec/nsc_types.h b/libfreerdp/codec/nsc_types.h index b9b997c55..14c1a946b 100644 --- a/libfreerdp/codec/nsc_types.h +++ b/libfreerdp/codec/nsc_types.h @@ -32,8 +32,8 @@ #include #include -#define ROUND_UP_TO(_b, _n) (_b + ((~(_b & (_n-1)) + 0x1) & (_n-1))) -#define MINMAX(_v,_l,_h) ((_v) < (_l) ? (_l) : ((_v) > (_h) ? (_h) : (_v))) +#define ROUND_UP_TO(_b, _n) (_b + ((~(_b & (_n - 1)) + 0x1) & (_n - 1))) +#define MINMAX(_v, _l, _h) ((_v) < (_l) ? (_l) : ((_v) > (_h) ? (_h) : (_v))) struct _NSC_CONTEXT_PRIV { @@ -49,30 +49,30 @@ struct _NSC_CONTEXT_PRIV PROFILER_DEFINE(prof_nsc_encode) }; - typedef struct _NSC_CONTEXT_PRIV NSC_CONTEXT_PRIV; +typedef struct _NSC_CONTEXT_PRIV NSC_CONTEXT_PRIV; - struct _NSC_CONTEXT - { - UINT32 OrgByteCount[4]; - UINT32 format; - UINT16 width; - UINT16 height; - BYTE* BitmapData; - UINT32 BitmapDataLength; +struct _NSC_CONTEXT +{ + UINT32 OrgByteCount[4]; + UINT32 format; + UINT16 width; + UINT16 height; + BYTE* BitmapData; + UINT32 BitmapDataLength; - BYTE* Planes; - UINT32 PlaneByteCount[4]; - UINT32 ColorLossLevel; - UINT32 ChromaSubsamplingLevel; - BOOL DynamicColorFidelity; + BYTE* Planes; + UINT32 PlaneByteCount[4]; + UINT32 ColorLossLevel; + UINT32 ChromaSubsamplingLevel; + BOOL DynamicColorFidelity; - /* color palette allocated by the application */ - const BYTE* palette; + /* color palette allocated by the application */ + const BYTE* palette; - BOOL (*decode)(NSC_CONTEXT* context); - BOOL (*encode)(NSC_CONTEXT* context, const BYTE* BitmapData, UINT32 rowstride); + BOOL (*decode)(NSC_CONTEXT* context); + BOOL (*encode)(NSC_CONTEXT* context, const BYTE* BitmapData, UINT32 rowstride); - NSC_CONTEXT_PRIV* priv; - }; + NSC_CONTEXT_PRIV* priv; +}; #endif /* FREERDP_LIB_CODEC_NSC_TYPES_H */ diff --git a/libfreerdp/codec/progressive.c b/libfreerdp/codec/progressive.c index f62ea3f70..937103053 100644 --- a/libfreerdp/codec/progressive.c +++ b/libfreerdp/codec/progressive.c @@ -88,7 +88,7 @@ static const char* progressive_get_block_type_string(UINT16 blockType) } static INLINE void progressive_component_codec_quant_read(const BYTE* block, - RFX_COMPONENT_CODEC_QUANT* quantVal) + RFX_COMPONENT_CODEC_QUANT* quantVal) { quantVal->LL3 = block[0] & 0x0F; quantVal->HL3 = block[0] >> 4; @@ -117,8 +117,8 @@ static INLINE void progressive_rfx_quant_ladd(RFX_COMPONENT_CODEC_QUANT* q, int } static INLINE void progressive_rfx_quant_add(RFX_COMPONENT_CODEC_QUANT* q1, - RFX_COMPONENT_CODEC_QUANT* q2, - RFX_COMPONENT_CODEC_QUANT* dst) + RFX_COMPONENT_CODEC_QUANT* q2, + RFX_COMPONENT_CODEC_QUANT* dst) { dst->HL1 = q1->HL1 + q2->HL1; /* HL1 */ dst->LH1 = q1->LH1 + q2->LH1; /* LH1 */ @@ -147,8 +147,8 @@ static INLINE void progressive_rfx_quant_lsub(RFX_COMPONENT_CODEC_QUANT* q, int } static INLINE void progressive_rfx_quant_sub(RFX_COMPONENT_CODEC_QUANT* q1, - RFX_COMPONENT_CODEC_QUANT* q2, - RFX_COMPONENT_CODEC_QUANT* dst) + RFX_COMPONENT_CODEC_QUANT* q2, + RFX_COMPONENT_CODEC_QUANT* dst) { dst->HL1 = q1->HL1 - q2->HL1; /* HL1 */ dst->LH1 = q1->LH1 - q2->LH1; /* LH1 */ @@ -162,132 +162,180 @@ static INLINE void progressive_rfx_quant_sub(RFX_COMPONENT_CODEC_QUANT* q1, dst->LL3 = q1->LL3 - q2->LL3; /* LL3 */ } -static INLINE BOOL progressive_rfx_quant_lcmp_less_equal(RFX_COMPONENT_CODEC_QUANT* q, - int val) +static INLINE BOOL progressive_rfx_quant_lcmp_less_equal(RFX_COMPONENT_CODEC_QUANT* q, int val) { - if (q->HL1 > val) return FALSE; /* HL1 */ + if (q->HL1 > val) + return FALSE; /* HL1 */ - if (q->LH1 > val) return FALSE; /* LH1 */ + if (q->LH1 > val) + return FALSE; /* LH1 */ - if (q->HH1 > val) return FALSE; /* HH1 */ + if (q->HH1 > val) + return FALSE; /* HH1 */ - if (q->HL2 > val) return FALSE; /* HL2 */ + if (q->HL2 > val) + return FALSE; /* HL2 */ - if (q->LH2 > val) return FALSE; /* LH2 */ + if (q->LH2 > val) + return FALSE; /* LH2 */ - if (q->HH2 > val) return FALSE; /* HH2 */ + if (q->HH2 > val) + return FALSE; /* HH2 */ - if (q->HL3 > val) return FALSE; /* HL3 */ + if (q->HL3 > val) + return FALSE; /* HL3 */ - if (q->LH3 > val) return FALSE; /* LH3 */ + if (q->LH3 > val) + return FALSE; /* LH3 */ - if (q->HH3 > val) return FALSE; /* HH3 */ + if (q->HH3 > val) + return FALSE; /* HH3 */ - if (q->LL3 > val) return FALSE; /* LL3 */ + if (q->LL3 > val) + return FALSE; /* LL3 */ return TRUE; } static INLINE BOOL progressive_rfx_quant_cmp_less_equal(RFX_COMPONENT_CODEC_QUANT* q1, - RFX_COMPONENT_CODEC_QUANT* q2) + RFX_COMPONENT_CODEC_QUANT* q2) { - if (q1->HL1 > q2->HL1) return FALSE; /* HL1 */ + if (q1->HL1 > q2->HL1) + return FALSE; /* HL1 */ - if (q1->LH1 > q2->LH1) return FALSE; /* LH1 */ + if (q1->LH1 > q2->LH1) + return FALSE; /* LH1 */ - if (q1->HH1 > q2->HH1) return FALSE; /* HH1 */ + if (q1->HH1 > q2->HH1) + return FALSE; /* HH1 */ - if (q1->HL2 > q2->HL2) return FALSE; /* HL2 */ + if (q1->HL2 > q2->HL2) + return FALSE; /* HL2 */ - if (q1->LH2 > q2->LH2) return FALSE; /* LH2 */ + if (q1->LH2 > q2->LH2) + return FALSE; /* LH2 */ - if (q1->HH2 > q2->HH2) return FALSE; /* HH2 */ + if (q1->HH2 > q2->HH2) + return FALSE; /* HH2 */ - if (q1->HL3 > q2->HL3) return FALSE; /* HL3 */ + if (q1->HL3 > q2->HL3) + return FALSE; /* HL3 */ - if (q1->LH3 > q2->LH3) return FALSE; /* LH3 */ + if (q1->LH3 > q2->LH3) + return FALSE; /* LH3 */ - if (q1->HH3 > q2->HH3) return FALSE; /* HH3 */ + if (q1->HH3 > q2->HH3) + return FALSE; /* HH3 */ - if (q1->LL3 > q2->LL3) return FALSE; /* LL3 */ + if (q1->LL3 > q2->LL3) + return FALSE; /* LL3 */ return TRUE; } -static INLINE BOOL progressive_rfx_quant_lcmp_greater_equal(RFX_COMPONENT_CODEC_QUANT* q, - int val) +static INLINE BOOL progressive_rfx_quant_lcmp_greater_equal(RFX_COMPONENT_CODEC_QUANT* q, int val) { - if (q->HL1 < val) return FALSE; /* HL1 */ + if (q->HL1 < val) + return FALSE; /* HL1 */ - if (q->LH1 < val) return FALSE; /* LH1 */ + if (q->LH1 < val) + return FALSE; /* LH1 */ - if (q->HH1 < val) return FALSE; /* HH1 */ + if (q->HH1 < val) + return FALSE; /* HH1 */ - if (q->HL2 < val) return FALSE; /* HL2 */ + if (q->HL2 < val) + return FALSE; /* HL2 */ - if (q->LH2 < val) return FALSE; /* LH2 */ + if (q->LH2 < val) + return FALSE; /* LH2 */ - if (q->HH2 < val) return FALSE; /* HH2 */ + if (q->HH2 < val) + return FALSE; /* HH2 */ - if (q->HL3 < val) return FALSE; /* HL3 */ + if (q->HL3 < val) + return FALSE; /* HL3 */ - if (q->LH3 < val) return FALSE; /* LH3 */ + if (q->LH3 < val) + return FALSE; /* LH3 */ - if (q->HH3 < val) return FALSE; /* HH3 */ + if (q->HH3 < val) + return FALSE; /* HH3 */ - if (q->LL3 < val) return FALSE; /* LL3 */ + if (q->LL3 < val) + return FALSE; /* LL3 */ return TRUE; } static INLINE BOOL progressive_rfx_quant_cmp_greater_equal(RFX_COMPONENT_CODEC_QUANT* q1, - RFX_COMPONENT_CODEC_QUANT* q2) + RFX_COMPONENT_CODEC_QUANT* q2) { - if (q1->HL1 < q2->HL1) return FALSE; /* HL1 */ + if (q1->HL1 < q2->HL1) + return FALSE; /* HL1 */ - if (q1->LH1 < q2->LH1) return FALSE; /* LH1 */ + if (q1->LH1 < q2->LH1) + return FALSE; /* LH1 */ - if (q1->HH1 < q2->HH1) return FALSE; /* HH1 */ + if (q1->HH1 < q2->HH1) + return FALSE; /* HH1 */ - if (q1->HL2 < q2->HL2) return FALSE; /* HL2 */ + if (q1->HL2 < q2->HL2) + return FALSE; /* HL2 */ - if (q1->LH2 < q2->LH2) return FALSE; /* LH2 */ + if (q1->LH2 < q2->LH2) + return FALSE; /* LH2 */ - if (q1->HH2 < q2->HH2) return FALSE; /* HH2 */ + if (q1->HH2 < q2->HH2) + return FALSE; /* HH2 */ - if (q1->HL3 < q2->HL3) return FALSE; /* HL3 */ + if (q1->HL3 < q2->HL3) + return FALSE; /* HL3 */ - if (q1->LH3 < q2->LH3) return FALSE; /* LH3 */ + if (q1->LH3 < q2->LH3) + return FALSE; /* LH3 */ - if (q1->HH3 < q2->HH3) return FALSE; /* HH3 */ + if (q1->HH3 < q2->HH3) + return FALSE; /* HH3 */ - if (q1->LL3 < q2->LL3) return FALSE; /* LL3 */ + if (q1->LL3 < q2->LL3) + return FALSE; /* LL3 */ return TRUE; } static INLINE BOOL progressive_rfx_quant_cmp_equal(RFX_COMPONENT_CODEC_QUANT* q1, - RFX_COMPONENT_CODEC_QUANT* q2) + RFX_COMPONENT_CODEC_QUANT* q2) { - if (q1->HL1 != q2->HL1) return FALSE; /* HL1 */ + if (q1->HL1 != q2->HL1) + return FALSE; /* HL1 */ - if (q1->LH1 != q2->LH1) return FALSE; /* LH1 */ + if (q1->LH1 != q2->LH1) + return FALSE; /* LH1 */ - if (q1->HH1 != q2->HH1) return FALSE; /* HH1 */ + if (q1->HH1 != q2->HH1) + return FALSE; /* HH1 */ - if (q1->HL2 != q2->HL2) return FALSE; /* HL2 */ + if (q1->HL2 != q2->HL2) + return FALSE; /* HL2 */ - if (q1->LH2 != q2->LH2) return FALSE; /* LH2 */ + if (q1->LH2 != q2->LH2) + return FALSE; /* LH2 */ - if (q1->HH2 != q2->HH2) return FALSE; /* HH2 */ + if (q1->HH2 != q2->HH2) + return FALSE; /* HH2 */ - if (q1->HL3 != q2->HL3) return FALSE; /* HL3 */ + if (q1->HL3 != q2->HL3) + return FALSE; /* HL3 */ - if (q1->LH3 != q2->LH3) return FALSE; /* LH3 */ + if (q1->LH3 != q2->LH3) + return FALSE; /* LH3 */ - if (q1->HH3 != q2->HH3) return FALSE; /* HH3 */ + if (q1->HH3 != q2->HH3) + return FALSE; /* HH3 */ - if (q1->LL3 != q2->LL3) return FALSE; /* LL3 */ + if (q1->LL3 != q2->LL3) + return FALSE; /* LL3 */ return TRUE; } @@ -295,22 +343,21 @@ static INLINE BOOL progressive_rfx_quant_cmp_equal(RFX_COMPONENT_CODEC_QUANT* q1 static void progressive_rfx_quant_print(RFX_COMPONENT_CODEC_QUANT* q, const char* name) { fprintf(stderr, - "%s: HL1: %"PRIu8" LH1: %"PRIu8" HH1: %"PRIu8" HL2: %"PRIu8" LH2: %"PRIu8" HH2: %"PRIu8" HL3: %"PRIu8" LH3: %"PRIu8" HH3: %"PRIu8" LL3: %"PRIu8"\n", - name, q->HL1, q->LH1, q->HH1, q->HL2, q->LH2, q->HH2, q->HL3, q->LH3, q->HH3, - q->LL3); + "%s: HL1: %" PRIu8 " LH1: %" PRIu8 " HH1: %" PRIu8 " HL2: %" PRIu8 " LH2: %" PRIu8 + " HH2: %" PRIu8 " HL3: %" PRIu8 " LH3: %" PRIu8 " HH3: %" PRIu8 " LL3: %" PRIu8 "\n", + name, q->HL1, q->LH1, q->HH1, q->HL2, q->LH2, q->HH2, q->HL3, q->LH3, q->HH3, q->LL3); } - -static INLINE BOOL progressive_set_surface_data(PROGRESSIVE_CONTEXT* progressive, - UINT16 surfaceId, void* pData) +static INLINE BOOL progressive_set_surface_data(PROGRESSIVE_CONTEXT* progressive, UINT16 surfaceId, + void* pData) { ULONG_PTR key; - key = ((ULONG_PTR) surfaceId) + 1; + key = ((ULONG_PTR)surfaceId) + 1; if (pData) - return HashTable_Add(progressive->SurfaceContexts, (void *)key, pData) >= 0; + return HashTable_Add(progressive->SurfaceContexts, (void*)key, pData) >= 0; - HashTable_Remove(progressive->SurfaceContexts, (void*) key); + HashTable_Remove(progressive->SurfaceContexts, (void*)key); return TRUE; } @@ -318,16 +365,16 @@ static INLINE void* progressive_get_surface_data(PROGRESSIVE_CONTEXT* progressiv { ULONG_PTR key; void* pData = NULL; - key = ((ULONG_PTR) surfaceId) + 1; - pData = HashTable_GetItemValue(progressive->SurfaceContexts, (void*) key); + key = ((ULONG_PTR)surfaceId) + 1; + pData = HashTable_GetItemValue(progressive->SurfaceContexts, (void*)key); return pData; } -static PROGRESSIVE_SURFACE_CONTEXT* progressive_surface_context_new(UINT16 surfaceId, UINT32 width, UINT32 height) +static PROGRESSIVE_SURFACE_CONTEXT* progressive_surface_context_new(UINT16 surfaceId, UINT32 width, + UINT32 height) { PROGRESSIVE_SURFACE_CONTEXT* surface; - surface = (PROGRESSIVE_SURFACE_CONTEXT*) calloc( - 1, sizeof(PROGRESSIVE_SURFACE_CONTEXT)); + surface = (PROGRESSIVE_SURFACE_CONTEXT*)calloc(1, sizeof(PROGRESSIVE_SURFACE_CONTEXT)); if (!surface) return NULL; @@ -338,7 +385,7 @@ static PROGRESSIVE_SURFACE_CONTEXT* progressive_surface_context_new(UINT16 surfa surface->gridWidth = (width + (64 - width % 64)) / 64; surface->gridHeight = (height + (64 - height % 64)) / 64; surface->gridSize = surface->gridWidth * surface->gridHeight; - surface->tiles = (RFX_PROGRESSIVE_TILE*) calloc(surface->gridSize, sizeof(RFX_PROGRESSIVE_TILE)); + surface->tiles = (RFX_PROGRESSIVE_TILE*)calloc(surface->gridSize, sizeof(RFX_PROGRESSIVE_TILE)); if (!surface->tiles) { @@ -372,11 +419,11 @@ static void progressive_surface_context_free(PROGRESSIVE_SURFACE_CONTEXT* surfac free(surface); } -INT32 progressive_create_surface_context(PROGRESSIVE_CONTEXT* progressive, - UINT16 surfaceId, UINT32 width, UINT32 height) +INT32 progressive_create_surface_context(PROGRESSIVE_CONTEXT* progressive, UINT16 surfaceId, + UINT32 width, UINT32 height) { PROGRESSIVE_SURFACE_CONTEXT* surface; - surface = (PROGRESSIVE_SURFACE_CONTEXT *)progressive_get_surface_data(progressive, surfaceId); + surface = (PROGRESSIVE_SURFACE_CONTEXT*)progressive_get_surface_data(progressive, surfaceId); if (!surface) { @@ -385,7 +432,7 @@ INT32 progressive_create_surface_context(PROGRESSIVE_CONTEXT* progressive, if (!surface) return -1; - if (!progressive_set_surface_data(progressive, surfaceId, (void*) surface)) + if (!progressive_set_surface_data(progressive, surfaceId, (void*)surface)) { progressive_surface_context_free(surface); return -1; @@ -395,11 +442,10 @@ INT32 progressive_create_surface_context(PROGRESSIVE_CONTEXT* progressive, return 1; } -int progressive_delete_surface_context(PROGRESSIVE_CONTEXT* progressive, - UINT16 surfaceId) +int progressive_delete_surface_context(PROGRESSIVE_CONTEXT* progressive, UINT16 surfaceId) { PROGRESSIVE_SURFACE_CONTEXT* surface; - surface = (PROGRESSIVE_SURFACE_CONTEXT *)progressive_get_surface_data(progressive, surfaceId); + surface = (PROGRESSIVE_SURFACE_CONTEXT*)progressive_get_surface_data(progressive, surfaceId); if (surface) { @@ -428,16 +474,15 @@ int progressive_delete_surface_context(PROGRESSIVE_CONTEXT* progressive, * LL3 4015 9x9 81 */ -static INLINE void progressive_rfx_idwt_x(INT16* pLowBand, int nLowStep, - INT16* pHighBand, - int nHighStep, INT16* pDstBand, int nDstStep, - int nLowCount, int nHighCount, int nDstCount) +static INLINE void progressive_rfx_idwt_x(INT16* pLowBand, int nLowStep, INT16* pHighBand, + int nHighStep, INT16* pDstBand, int nDstStep, + int nLowCount, int nHighCount, int nDstCount) { int i, j; INT16 L0; INT16 H0, H1; INT16 X0, X1, X2; - INT16* pL, *pH, *pX; + INT16 *pL, *pH, *pX; for (i = 0; i < nDstCount; i++) { @@ -502,16 +547,15 @@ static INLINE void progressive_rfx_idwt_x(INT16* pLowBand, int nLowStep, } } -static INLINE void progressive_rfx_idwt_y(INT16* pLowBand, int nLowStep, - INT16* pHighBand, - int nHighStep, INT16* pDstBand, int nDstStep, - int nLowCount, int nHighCount, int nDstCount) +static INLINE void progressive_rfx_idwt_y(INT16* pLowBand, int nLowStep, INT16* pHighBand, + int nHighStep, INT16* pDstBand, int nDstStep, + int nLowCount, int nHighCount, int nDstCount) { int i, j; INT16 L0; INT16 H0, H1; INT16 X0, X1, X2; - INT16* pL, *pH, *pX; + INT16 *pL, *pH, *pX; for (i = 0; i < nDstCount; i++) { @@ -594,17 +638,16 @@ static INLINE int progressive_rfx_get_band_h_count(int level) return (64 + (1 << (level - 1))) >> level; } -static INLINE void progressive_rfx_dwt_2d_decode_block(INT16* buffer, INT16* temp, - int level) +static INLINE void progressive_rfx_dwt_2d_decode_block(INT16* buffer, INT16* temp, int level) { int offset; int nBandL; int nBandH; int nDstStepX; int nDstStepY; - INT16* HL, *LH; - INT16* HH, *LL; - INT16* L, *H, *LLx; + INT16 *HL, *LH; + INT16 *HH, *LL; + INT16 *L, *H, *LLx; INT16* pLowBand[3]; INT16* pHighBand[3]; INT16* pDstBand[3]; @@ -641,8 +684,8 @@ static INLINE void progressive_rfx_dwt_2d_decode_block(INT16* buffer, INT16* tem nLowCount[0] = nBandL; nHighCount[0] = nBandH; nDstCount[0] = nBandL; - progressive_rfx_idwt_x(pLowBand[0], nLowStep[0], pHighBand[0], nHighStep[0], - pDstBand[0], nDstStep[0], nLowCount[0], nHighCount[0], nDstCount[0]); + progressive_rfx_idwt_x(pLowBand[0], nLowStep[0], pHighBand[0], nHighStep[0], pDstBand[0], + nDstStep[0], nLowCount[0], nHighCount[0], nDstCount[0]); /* horizontal (LH + HH -> H) */ pLowBand[1] = LH; nLowStep[1] = nBandL; @@ -653,8 +696,8 @@ static INLINE void progressive_rfx_dwt_2d_decode_block(INT16* buffer, INT16* tem nLowCount[1] = nBandL; nHighCount[1] = nBandH; nDstCount[1] = nBandH; - progressive_rfx_idwt_x(pLowBand[1], nLowStep[1], pHighBand[1], nHighStep[1], - pDstBand[1], nDstStep[1], nLowCount[1], nHighCount[1], nDstCount[1]); + progressive_rfx_idwt_x(pLowBand[1], nLowStep[1], pHighBand[1], nHighStep[1], pDstBand[1], + nDstStep[1], nLowCount[1], nHighCount[1], nDstCount[1]); /* vertical (L + H -> LL) */ pLowBand[2] = pDstBand[0]; nLowStep[2] = nDstStep[0]; @@ -665,12 +708,12 @@ static INLINE void progressive_rfx_dwt_2d_decode_block(INT16* buffer, INT16* tem nLowCount[2] = nBandL; nHighCount[2] = nBandH; nDstCount[2] = nBandL + nBandH; - progressive_rfx_idwt_y(pLowBand[2], nLowStep[2], pHighBand[2], nHighStep[2], - pDstBand[2], nDstStep[2], nLowCount[2], nHighCount[2], nDstCount[2]); + progressive_rfx_idwt_y(pLowBand[2], nLowStep[2], pHighBand[2], nHighStep[2], pDstBand[2], + nDstStep[2], nLowCount[2], nHighCount[2], nDstCount[2]); } -static INLINE void progressive_rfx_dwt_2d_decode(INT16* buffer, INT16* temp, - INT16* current, INT16* sign, BOOL diff) +static INLINE void progressive_rfx_dwt_2d_decode(INT16* buffer, INT16* temp, INT16* current, + INT16* sign, BOOL diff) { const primitives_t* prims = primitives_get(); @@ -683,9 +726,8 @@ static INLINE void progressive_rfx_dwt_2d_decode(INT16* buffer, INT16* temp, progressive_rfx_dwt_2d_decode_block(&buffer[0], temp, 1); } -static INLINE void progressive_rfx_decode_block(const primitives_t* prims, - INT16* buffer, - int length, UINT32 shift) +static INLINE void progressive_rfx_decode_block(const primitives_t* prims, INT16* buffer, + int length, UINT32 shift) { if (!shift) return; @@ -694,10 +736,9 @@ static INLINE void progressive_rfx_decode_block(const primitives_t* prims, } static INLINE int progressive_rfx_decode_component(PROGRESSIVE_CONTEXT* progressive, - RFX_COMPONENT_CODEC_QUANT* shift, - const BYTE* data, int length, - INT16* buffer, INT16* current, - INT16* sign, BOOL diff) + RFX_COMPONENT_CODEC_QUANT* shift, + const BYTE* data, int length, INT16* buffer, + INT16* current, INT16* sign, BOOL diff) { int status; INT16* temp; @@ -708,25 +749,25 @@ static INLINE int progressive_rfx_decode_component(PROGRESSIVE_CONTEXT* progress return status; CopyMemory(sign, buffer, 4096 * 2); - rfx_differential_decode(&buffer[4015], 81); /* LL3 */ - progressive_rfx_decode_block(prims, &buffer[0], 1023, shift->HL1); /* HL1 */ + rfx_differential_decode(&buffer[4015], 81); /* LL3 */ + progressive_rfx_decode_block(prims, &buffer[0], 1023, shift->HL1); /* HL1 */ progressive_rfx_decode_block(prims, &buffer[1023], 1023, shift->LH1); /* LH1 */ - progressive_rfx_decode_block(prims, &buffer[2046], 961, shift->HH1); /* HH1 */ - progressive_rfx_decode_block(prims, &buffer[3007], 272, shift->HL2); /* HL2 */ - progressive_rfx_decode_block(prims, &buffer[3279], 272, shift->LH2); /* LH2 */ - progressive_rfx_decode_block(prims, &buffer[3551], 256, shift->HH2); /* HH2 */ - progressive_rfx_decode_block(prims, &buffer[3807], 72, shift->HL3); /* HL3 */ - progressive_rfx_decode_block(prims, &buffer[3879], 72, shift->LH3); /* LH3 */ - progressive_rfx_decode_block(prims, &buffer[3951], 64, shift->HH3); /* HH3 */ - progressive_rfx_decode_block(prims, &buffer[4015], 81, shift->LL3); /* LL3 */ - temp = (INT16*) BufferPool_Take(progressive->bufferPool, -1); /* DWT buffer */ + progressive_rfx_decode_block(prims, &buffer[2046], 961, shift->HH1); /* HH1 */ + progressive_rfx_decode_block(prims, &buffer[3007], 272, shift->HL2); /* HL2 */ + progressive_rfx_decode_block(prims, &buffer[3279], 272, shift->LH2); /* LH2 */ + progressive_rfx_decode_block(prims, &buffer[3551], 256, shift->HH2); /* HH2 */ + progressive_rfx_decode_block(prims, &buffer[3807], 72, shift->HL3); /* HL3 */ + progressive_rfx_decode_block(prims, &buffer[3879], 72, shift->LH3); /* LH3 */ + progressive_rfx_decode_block(prims, &buffer[3951], 64, shift->HH3); /* HH3 */ + progressive_rfx_decode_block(prims, &buffer[4015], 81, shift->LL3); /* LL3 */ + temp = (INT16*)BufferPool_Take(progressive->bufferPool, -1); /* DWT buffer */ progressive_rfx_dwt_2d_decode(buffer, temp, current, sign, diff); BufferPool_Return(progressive->bufferPool, temp); return 1; } static INLINE int progressive_decompress_tile_first(PROGRESSIVE_CONTEXT* progressive, - RFX_PROGRESSIVE_TILE* tile) + RFX_PROGRESSIVE_TILE* tile) { BOOL diff; BYTE* pBuffer; @@ -750,11 +791,12 @@ static INLINE int progressive_decompress_tile_first(PROGRESSIVE_CONTEXT* progres tile->pass = 1; diff = tile->flags & RFX_TILE_DIFFERENCE; WLog_Print(progressive->log, WLOG_DEBUG, - "ProgressiveTile%s: quantIdx Y: %"PRIu8" Cb: %"PRIu8" Cr: %"PRIu8" xIdx: %"PRIu16" yIdx: %"PRIu16" flags: 0x%02"PRIX8" quality: %"PRIu8" yLen: %"PRIu16" cbLen: %"PRIu16" crLen: %"PRIu16" tailLen: %"PRIu16"", + "ProgressiveTile%s: quantIdx Y: %" PRIu8 " Cb: %" PRIu8 " Cr: %" PRIu8 + " xIdx: %" PRIu16 " yIdx: %" PRIu16 " flags: 0x%02" PRIX8 " quality: %" PRIu8 + " yLen: %" PRIu16 " cbLen: %" PRIu16 " crLen: %" PRIu16 " tailLen: %" PRIu16 "", (tile->blockType == PROGRESSIVE_WBT_TILE_FIRST) ? "First" : "Simple", - tile->quantIdxY, tile->quantIdxCb, tile->quantIdxCr, - tile->xIdx, tile->yIdx, tile->flags, tile->quality, tile->yLen, - tile->cbLen, tile->crLen, tile->tailLen); + tile->quantIdxY, tile->quantIdxCb, tile->quantIdxCr, tile->xIdx, tile->yIdx, + tile->flags, tile->quality, tile->yLen, tile->cbLen, tile->crLen, tile->tailLen); region = &(progressive->region); if (tile->quantIdxY >= region->numQuant) @@ -807,21 +849,21 @@ static INLINE int progressive_decompress_tile_first(PROGRESSIVE_CONTEXT* progres if (!tile->data) { - tile->data = (BYTE*) _aligned_malloc(64 * 64 * 4, 16); + tile->data = (BYTE*)_aligned_malloc(64 * 64 * 4, 16); if (!tile->data) return -1; } if (!tile->sign) { - tile->sign = (BYTE*) _aligned_malloc((8192 + 32) * 3, 16); + tile->sign = (BYTE*)_aligned_malloc((8192 + 32) * 3, 16); if (!tile->sign) return -1; } if (!tile->current) { - tile->current = (BYTE*) _aligned_malloc((8192 + 32) * 3, 16); + tile->current = (BYTE*)_aligned_malloc((8192 + 32) * 3, 16); if (!tile->current) return -1; } @@ -836,26 +878,25 @@ static INLINE int progressive_decompress_tile_first(PROGRESSIVE_CONTEXT* progres pCurrent[1] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 1) + 16])); /* Cb/G buffer */ pCurrent[2] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 2) + 16])); /* Cr/B buffer */ - pBuffer = (BYTE*) BufferPool_Take(progressive->bufferPool, -1); + pBuffer = (BYTE*)BufferPool_Take(progressive->bufferPool, -1); pSrcDst[0] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 0) + 16])); /* Y/R buffer */ pSrcDst[1] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 1) + 16])); /* Cb/G buffer */ pSrcDst[2] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 2) + 16])); /* Cr/B buffer */ - progressive_rfx_decode_component(progressive, &shiftY, tile->yData, tile->yLen, - pSrcDst[0], pCurrent[0], pSign[0], diff); /* Y */ - progressive_rfx_decode_component(progressive, &shiftCb, tile->cbData, tile->cbLen, - pSrcDst[1], pCurrent[1], pSign[1], diff); /* Cb */ - progressive_rfx_decode_component(progressive, &shiftCr, tile->crData, tile->crLen, - pSrcDst[2], pCurrent[2], pSign[2], diff); /* Cr */ + progressive_rfx_decode_component(progressive, &shiftY, tile->yData, tile->yLen, pSrcDst[0], + pCurrent[0], pSign[0], diff); /* Y */ + progressive_rfx_decode_component(progressive, &shiftCb, tile->cbData, tile->cbLen, pSrcDst[1], + pCurrent[1], pSign[1], diff); /* Cb */ + progressive_rfx_decode_component(progressive, &shiftCr, tile->crData, tile->crLen, pSrcDst[2], + pCurrent[2], pSign[2], diff); /* Cr */ - prims->yCbCrToRGB_16s8u_P3AC4R((const INT16**) pSrcDst, 64 * 2, tile->data, tile->stride, - tile->format, &roi_64x64); + prims->yCbCrToRGB_16s8u_P3AC4R((const INT16**)pSrcDst, 64 * 2, tile->data, tile->stride, + tile->format, &roi_64x64); BufferPool_Return(progressive->bufferPool, pBuffer); return 1; } -static INLINE INT16 progressive_rfx_srl_read(RFX_PROGRESSIVE_UPGRADE_STATE* state, - UINT32 numBits) +static INLINE INT16 progressive_rfx_srl_read(RFX_PROGRESSIVE_UPGRADE_STATE* state, UINT32 numBits) { int k; UINT32 bit; @@ -965,9 +1006,9 @@ static INLINE int progressive_rfx_upgrade_state_finish(RFX_PROGRESSIVE_UPGRADE_S return 1; } -static INLINE int progressive_rfx_upgrade_block(RFX_PROGRESSIVE_UPGRADE_STATE* state, - INT16* buffer, INT16* sign, UINT32 length, - UINT32 shift, UINT32 bitPos, UINT32 numBits) +static INLINE int progressive_rfx_upgrade_block(RFX_PROGRESSIVE_UPGRADE_STATE* state, INT16* buffer, + INT16* sign, UINT32 length, UINT32 shift, + UINT32 bitPos, UINT32 numBits) { UINT32 index; INT16 input; @@ -1022,14 +1063,12 @@ static INLINE int progressive_rfx_upgrade_block(RFX_PROGRESSIVE_UPGRADE_STATE* s } static INLINE int progressive_rfx_upgrade_component(PROGRESSIVE_CONTEXT* progressive, - RFX_COMPONENT_CODEC_QUANT* shift, - RFX_COMPONENT_CODEC_QUANT* bitPos, - RFX_COMPONENT_CODEC_QUANT* numBits, - INT16* buffer, - INT16* current, INT16* sign, - const BYTE* srlData, - UINT32 srlLen, const BYTE* rawData, - UINT32 rawLen) + RFX_COMPONENT_CODEC_QUANT* shift, + RFX_COMPONENT_CODEC_QUANT* bitPos, + RFX_COMPONENT_CODEC_QUANT* numBits, + INT16* buffer, INT16* current, INT16* sign, + const BYTE* srlData, UINT32 srlLen, + const BYTE* rawData, UINT32 rawLen) { INT16* temp; UINT32 aRawLen; @@ -1051,28 +1090,28 @@ static INLINE int progressive_rfx_upgrade_component(PROGRESSIVE_CONTEXT* progres BitStream_Fetch(state.raw); state.nonLL = TRUE; - progressive_rfx_upgrade_block(&state, ¤t[0], &sign[0], 1023, shift->HL1, - bitPos->HL1, numBits->HL1); /* HL1 */ - progressive_rfx_upgrade_block(&state, ¤t[1023], &sign[1023], 1023, - shift->LH1, bitPos->LH1, numBits->LH1); /* LH1 */ - progressive_rfx_upgrade_block(&state, ¤t[2046], &sign[2046], 961, - shift->HH1, bitPos->HH1, numBits->HH1); /* HH1 */ - progressive_rfx_upgrade_block(&state, ¤t[3007], &sign[3007], 272, - shift->HL2, bitPos->HL2, numBits->HL2); /* HL2 */ - progressive_rfx_upgrade_block(&state, ¤t[3279], &sign[3279], 272, - shift->LH2, bitPos->LH2, numBits->LH2); /* LH2 */ - progressive_rfx_upgrade_block(&state, ¤t[3551], &sign[3551], 256, - shift->HH2, bitPos->HH2, numBits->HH2); /* HH2 */ - progressive_rfx_upgrade_block(&state, ¤t[3807], &sign[3807], 72, - shift->HL3, bitPos->HL3, numBits->HL3); /* HL3 */ - progressive_rfx_upgrade_block(&state, ¤t[3879], &sign[3879], 72, - shift->LH3, bitPos->LH3, numBits->LH3); /* LH3 */ - progressive_rfx_upgrade_block(&state, ¤t[3951], &sign[3951], 64, - shift->HH3, bitPos->HH3, numBits->HH3); /* HH3 */ + progressive_rfx_upgrade_block(&state, ¤t[0], &sign[0], 1023, shift->HL1, bitPos->HL1, + numBits->HL1); /* HL1 */ + progressive_rfx_upgrade_block(&state, ¤t[1023], &sign[1023], 1023, shift->LH1, + bitPos->LH1, numBits->LH1); /* LH1 */ + progressive_rfx_upgrade_block(&state, ¤t[2046], &sign[2046], 961, shift->HH1, bitPos->HH1, + numBits->HH1); /* HH1 */ + progressive_rfx_upgrade_block(&state, ¤t[3007], &sign[3007], 272, shift->HL2, bitPos->HL2, + numBits->HL2); /* HL2 */ + progressive_rfx_upgrade_block(&state, ¤t[3279], &sign[3279], 272, shift->LH2, bitPos->LH2, + numBits->LH2); /* LH2 */ + progressive_rfx_upgrade_block(&state, ¤t[3551], &sign[3551], 256, shift->HH2, bitPos->HH2, + numBits->HH2); /* HH2 */ + progressive_rfx_upgrade_block(&state, ¤t[3807], &sign[3807], 72, shift->HL3, bitPos->HL3, + numBits->HL3); /* HL3 */ + progressive_rfx_upgrade_block(&state, ¤t[3879], &sign[3879], 72, shift->LH3, bitPos->LH3, + numBits->LH3); /* LH3 */ + progressive_rfx_upgrade_block(&state, ¤t[3951], &sign[3951], 64, shift->HH3, bitPos->HH3, + numBits->HH3); /* HH3 */ state.nonLL = FALSE; - progressive_rfx_upgrade_block(&state, ¤t[4015], &sign[4015], 81, - shift->LL3, bitPos->LL3, numBits->LL3); /* LL3 */ + progressive_rfx_upgrade_block(&state, ¤t[4015], &sign[4015], 81, shift->LL3, bitPos->LL3, + numBits->LL3); /* LL3 */ progressive_rfx_upgrade_state_finish(&state); aRawLen = (state.raw->position + 7) / 8; aSrlLen = (state.srl->position + 7) / 8; @@ -1083,21 +1122,21 @@ static INLINE int progressive_rfx_upgrade_component(PROGRESSIVE_CONTEXT* progres int pSrlLen = 0; if (rawLen) - pRawLen = (int)((((float) aRawLen) / ((float) rawLen)) * 100.0f); + pRawLen = (int)((((float)aRawLen) / ((float)rawLen)) * 100.0f); if (srlLen) - pSrlLen = (int)((((float) aSrlLen) / ((float) srlLen)) * 100.0f); + pSrlLen = (int)((((float)aSrlLen) / ((float)srlLen)) * 100.0f); WLog_Print(progressive->log, WLOG_INFO, - "RAW: %"PRIu32"/%"PRIu32" %d%% (%"PRIu32"/%"PRIu32":%"PRIu32")\tSRL: %"PRIu32"/%"PRIu32" %d%% (%"PRIu32"/%"PRIu32":%"PRIu32")", + "RAW: %" PRIu32 "/%" PRIu32 " %d%% (%" PRIu32 "/%" PRIu32 ":%" PRIu32 + ")\tSRL: %" PRIu32 "/%" PRIu32 " %d%% (%" PRIu32 "/%" PRIu32 ":%" PRIu32 ")", aRawLen, rawLen, pRawLen, state.raw->position, rawLen * 8, - (rawLen * 8) - state.raw->position, - aSrlLen, srlLen, pSrlLen, state.srl->position, srlLen * 8, - (srlLen * 8) - state.srl->position); + (rawLen * 8) - state.raw->position, aSrlLen, srlLen, pSrlLen, + state.srl->position, srlLen * 8, (srlLen * 8) - state.srl->position); return -1; } - temp = (INT16*) BufferPool_Take(progressive->bufferPool, -1); /* DWT buffer */ + temp = (INT16*)BufferPool_Take(progressive->bufferPool, -1); /* DWT buffer */ CopyMemory(buffer, current, 4096 * 2); progressive_rfx_dwt_2d_decode_block(&buffer[3807], temp, 3); progressive_rfx_dwt_2d_decode_block(&buffer[3007], temp, 2); @@ -1107,7 +1146,7 @@ static INLINE int progressive_rfx_upgrade_component(PROGRESSIVE_CONTEXT* progres } static INLINE int progressive_decompress_tile_upgrade(PROGRESSIVE_CONTEXT* progressive, - RFX_PROGRESSIVE_TILE* tile) + RFX_PROGRESSIVE_TILE* tile) { int status; BYTE* pBuffer; @@ -1135,7 +1174,10 @@ static INLINE int progressive_decompress_tile_upgrade(PROGRESSIVE_CONTEXT* progr const primitives_t* prims = primitives_get(); tile->pass++; WLog_Print(progressive->log, WLOG_DEBUG, - "ProgressiveTileUpgrade: pass: %"PRIu16" quantIdx Y: %"PRIu8" Cb: %"PRIu8" Cr: %"PRIu8" xIdx: %"PRIu16" yIdx: %"PRIu16" quality: %"PRIu8" ySrlLen: %"PRIu16" yRawLen: %"PRIu16" cbSrlLen: %"PRIu16" cbRawLen: %"PRIu16" crSrlLen: %"PRIu16" crRawLen: %"PRIu16"", + "ProgressiveTileUpgrade: pass: %" PRIu16 " quantIdx Y: %" PRIu8 " Cb: %" PRIu8 + " Cr: %" PRIu8 " xIdx: %" PRIu16 " yIdx: %" PRIu16 " quality: %" PRIu8 + " ySrlLen: %" PRIu16 " yRawLen: %" PRIu16 " cbSrlLen: %" PRIu16 " cbRawLen: %" PRIu16 + " crSrlLen: %" PRIu16 " crRawLen: %" PRIu16 "", tile->pass, tile->quantIdxY, tile->quantIdxCb, tile->quantIdxCr, tile->xIdx, tile->yIdx, tile->quality, tile->ySrlLen, tile->yRawLen, tile->cbSrlLen, tile->cbRawLen, tile->crSrlLen, tile->crRawLen); @@ -1214,45 +1256,41 @@ static INLINE int progressive_decompress_tile_upgrade(PROGRESSIVE_CONTEXT* progr pCurrent[1] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 1) + 16])); /* Cb/G buffer */ pCurrent[2] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 2) + 16])); /* Cr/B buffer */ - pBuffer = (BYTE*) BufferPool_Take(progressive->bufferPool, -1); + pBuffer = (BYTE*)BufferPool_Take(progressive->bufferPool, -1); pSrcDst[0] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 0) + 16])); /* Y/R buffer */ pSrcDst[1] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 1) + 16])); /* Cb/G buffer */ pSrcDst[2] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 2) + 16])); /* Cr/B buffer */ - status = progressive_rfx_upgrade_component(progressive, &shiftY, quantProgY, - &yNumBits, - pSrcDst[0], pCurrent[0], pSign[0], tile->ySrlData, tile->ySrlLen, - tile->yRawData, tile->yRawLen); /* Y */ + status = progressive_rfx_upgrade_component( + progressive, &shiftY, quantProgY, &yNumBits, pSrcDst[0], pCurrent[0], pSign[0], + tile->ySrlData, tile->ySrlLen, tile->yRawData, tile->yRawLen); /* Y */ if (status < 0) return -1; - status = progressive_rfx_upgrade_component(progressive, &shiftCb, quantProgCb, - &cbNumBits, - pSrcDst[1], pCurrent[1], pSign[1], tile->cbSrlData, tile->cbSrlLen, - tile->cbRawData, tile->cbRawLen); /* Cb */ + status = progressive_rfx_upgrade_component( + progressive, &shiftCb, quantProgCb, &cbNumBits, pSrcDst[1], pCurrent[1], pSign[1], + tile->cbSrlData, tile->cbSrlLen, tile->cbRawData, tile->cbRawLen); /* Cb */ if (status < 0) return -1; - status = progressive_rfx_upgrade_component(progressive, &shiftCr, quantProgCr, - &crNumBits, - pSrcDst[2], pCurrent[2], pSign[2], tile->crSrlData, tile->crSrlLen, - tile->crRawData, tile->crRawLen); /* Cr */ + status = progressive_rfx_upgrade_component( + progressive, &shiftCr, quantProgCr, &crNumBits, pSrcDst[2], pCurrent[2], pSign[2], + tile->crSrlData, tile->crSrlLen, tile->crRawData, tile->crRawLen); /* Cr */ if (status < 0) return -1; - prims->yCbCrToRGB_16s8u_P3AC4R((const INT16**) pSrcDst, 64 * 2, - tile->data, tile->stride, tile->format, - &roi_64x64); + prims->yCbCrToRGB_16s8u_P3AC4R((const INT16**)pSrcDst, 64 * 2, tile->data, tile->stride, + tile->format, &roi_64x64); BufferPool_Return(progressive->bufferPool, pBuffer); return 1; } -static INLINE int progressive_process_tiles(PROGRESSIVE_CONTEXT* progressive, - const BYTE* blocks, UINT32 blocksLen, - const PROGRESSIVE_SURFACE_CONTEXT* surface) +static INLINE int progressive_process_tiles(PROGRESSIVE_CONTEXT* progressive, const BYTE* blocks, + UINT32 blocksLen, + const PROGRESSIVE_SURFACE_CONTEXT* surface) { int status = -1; const BYTE* block; @@ -1275,10 +1313,11 @@ static INLINE int progressive_process_tiles(PROGRESSIVE_CONTEXT* progressive, { boffset = 0; block = &blocks[offset]; - blockType = *((UINT16*) &block[boffset + 0]); /* blockType (2 bytes) */ - blockLen = *((UINT32*) &block[boffset + 2]); /* blockLen (4 bytes) */ + blockType = *((UINT16*)&block[boffset + 0]); /* blockType (2 bytes) */ + blockLen = *((UINT32*)&block[boffset + 2]); /* blockLen (4 bytes) */ boffset += 6; - WLog_Print(progressive->log, WLOG_DEBUG, "%s", progressive_get_block_type_string(blockType)); + WLog_Print(progressive->log, WLOG_DEBUG, "%s", + progressive_get_block_type_string(blockType)); if ((blocksLen - offset) < blockLen) return -1003; @@ -1289,8 +1328,8 @@ static INLINE int progressive_process_tiles(PROGRESSIVE_CONTEXT* progressive, if ((blockLen - boffset) < 16) return -1022; - xIdx = *((UINT16*) &block[boffset + 3]); /* xIdx (2 bytes) */ - yIdx = *((UINT16*) &block[boffset + 5]); /* yIdx (2 bytes) */ + xIdx = *((UINT16*)&block[boffset + 3]); /* xIdx (2 bytes) */ + yIdx = *((UINT16*)&block[boffset + 5]); /* yIdx (2 bytes) */ zIdx = (yIdx * surface->gridWidth) + xIdx; if (zIdx >= surface->gridSize) @@ -1300,16 +1339,16 @@ static INLINE int progressive_process_tiles(PROGRESSIVE_CONTEXT* progressive, tile->blockType = blockType; tile->blockLen = blockLen; tile->quality = 0xFF; /* simple tiles use no progressive techniques */ - tile->quantIdxY = block[boffset + 0]; /* quantIdxY (1 byte) */ - tile->quantIdxCb = block[boffset + 1]; /* quantIdxCb (1 byte) */ - tile->quantIdxCr = block[boffset + 2]; /* quantIdxCr (1 byte) */ - tile->xIdx = *((UINT16*) &block[boffset + 3]); /* xIdx (2 bytes) */ - tile->yIdx = *((UINT16*) &block[boffset + 5]); /* yIdx (2 bytes) */ - tile->flags = block[boffset + 7] & 1; /* flags (1 byte) */ - tile->yLen = *((UINT16*) &block[boffset + 8]); /* yLen (2 bytes) */ - tile->cbLen = *((UINT16*) &block[boffset + 10]); /* cbLen (2 bytes) */ - tile->crLen = *((UINT16*) &block[boffset + 12]); /* crLen (2 bytes) */ - tile->tailLen = *((UINT16*) &block[boffset + 14]); /* tailLen (2 bytes) */ + tile->quantIdxY = block[boffset + 0]; /* quantIdxY (1 byte) */ + tile->quantIdxCb = block[boffset + 1]; /* quantIdxCb (1 byte) */ + tile->quantIdxCr = block[boffset + 2]; /* quantIdxCr (1 byte) */ + tile->xIdx = *((UINT16*)&block[boffset + 3]); /* xIdx (2 bytes) */ + tile->yIdx = *((UINT16*)&block[boffset + 5]); /* yIdx (2 bytes) */ + tile->flags = block[boffset + 7] & 1; /* flags (1 byte) */ + tile->yLen = *((UINT16*)&block[boffset + 8]); /* yLen (2 bytes) */ + tile->cbLen = *((UINT16*)&block[boffset + 10]); /* cbLen (2 bytes) */ + tile->crLen = *((UINT16*)&block[boffset + 12]); /* crLen (2 bytes) */ + tile->tailLen = *((UINT16*)&block[boffset + 14]); /* tailLen (2 bytes) */ boffset += 16; if ((tile->blockLen - boffset) < tile->yLen) @@ -1348,8 +1387,8 @@ static INLINE int progressive_process_tiles(PROGRESSIVE_CONTEXT* progressive, if ((blockLen - boffset) < 17) return -1027; - xIdx = *((UINT16*) &block[boffset + 3]); /* xIdx (2 bytes) */ - yIdx = *((UINT16*) &block[boffset + 5]); /* yIdx (2 bytes) */ + xIdx = *((UINT16*)&block[boffset + 3]); /* xIdx (2 bytes) */ + yIdx = *((UINT16*)&block[boffset + 5]); /* yIdx (2 bytes) */ zIdx = (yIdx * surface->gridWidth) + xIdx; if (zIdx >= surface->gridSize) @@ -1358,17 +1397,17 @@ static INLINE int progressive_process_tiles(PROGRESSIVE_CONTEXT* progressive, tiles[count] = tile = &(surface->tiles[zIdx]); tile->blockType = blockType; tile->blockLen = blockLen; - tile->quantIdxY = block[boffset + 0]; /* quantIdxY (1 byte) */ - tile->quantIdxCb = block[boffset + 1]; /* quantIdxCb (1 byte) */ - tile->quantIdxCr = block[boffset + 2]; /* quantIdxCr (1 byte) */ - tile->xIdx = *((UINT16*) &block[boffset + 3]); /* xIdx (2 bytes) */ - tile->yIdx = *((UINT16*) &block[boffset + 5]); /* yIdx (2 bytes) */ - tile->flags = block[boffset + 7] & 1; /* flags (1 byte) */ - tile->quality = block[boffset + 8]; /* quality (1 byte) */ - tile->yLen = *((UINT16*) &block[boffset + 9]); /* yLen (2 bytes) */ - tile->cbLen = *((UINT16*) &block[boffset + 11]); /* cbLen (2 bytes) */ - tile->crLen = *((UINT16*) &block[boffset + 13]); /* crLen (2 bytes) */ - tile->tailLen = *((UINT16*) &block[boffset + 15]); /* tailLen (2 bytes) */ + tile->quantIdxY = block[boffset + 0]; /* quantIdxY (1 byte) */ + tile->quantIdxCb = block[boffset + 1]; /* quantIdxCb (1 byte) */ + tile->quantIdxCr = block[boffset + 2]; /* quantIdxCr (1 byte) */ + tile->xIdx = *((UINT16*)&block[boffset + 3]); /* xIdx (2 bytes) */ + tile->yIdx = *((UINT16*)&block[boffset + 5]); /* yIdx (2 bytes) */ + tile->flags = block[boffset + 7] & 1; /* flags (1 byte) */ + tile->quality = block[boffset + 8]; /* quality (1 byte) */ + tile->yLen = *((UINT16*)&block[boffset + 9]); /* yLen (2 bytes) */ + tile->cbLen = *((UINT16*)&block[boffset + 11]); /* cbLen (2 bytes) */ + tile->crLen = *((UINT16*)&block[boffset + 13]); /* crLen (2 bytes) */ + tile->tailLen = *((UINT16*)&block[boffset + 15]); /* tailLen (2 bytes) */ boffset += 17; if ((tile->blockLen - boffset) < tile->yLen) @@ -1406,8 +1445,8 @@ static INLINE int progressive_process_tiles(PROGRESSIVE_CONTEXT* progressive, if ((blockLen - boffset) < 20) return -1032; - xIdx = *((UINT16*) &block[boffset + 3]); /* xIdx (2 bytes) */ - yIdx = *((UINT16*) &block[boffset + 5]); /* yIdx (2 bytes) */ + xIdx = *((UINT16*)&block[boffset + 3]); /* xIdx (2 bytes) */ + yIdx = *((UINT16*)&block[boffset + 5]); /* yIdx (2 bytes) */ zIdx = (yIdx * surface->gridWidth) + xIdx; if (zIdx >= surface->gridSize) @@ -1417,18 +1456,18 @@ static INLINE int progressive_process_tiles(PROGRESSIVE_CONTEXT* progressive, tile->blockType = blockType; tile->blockLen = blockLen; tile->flags = 0; - tile->quantIdxY = block[boffset + 0]; /* quantIdxY (1 byte) */ - tile->quantIdxCb = block[boffset + 1]; /* quantIdxCb (1 byte) */ - tile->quantIdxCr = block[boffset + 2]; /* quantIdxCr (1 byte) */ - tile->xIdx = *((UINT16*) &block[boffset + 3]); /* xIdx (2 bytes) */ - tile->yIdx = *((UINT16*) &block[boffset + 5]); /* yIdx (2 bytes) */ - tile->quality = block[boffset + 7]; /* quality (1 byte) */ - tile->ySrlLen = *((UINT16*) &block[boffset + 8]); /* ySrlLen (2 bytes) */ - tile->yRawLen = *((UINT16*) &block[boffset + 10]); /* yRawLen (2 bytes) */ - tile->cbSrlLen = *((UINT16*) &block[boffset + 12]); /* cbSrlLen (2 bytes) */ - tile->cbRawLen = *((UINT16*) &block[boffset + 14]); /* cbRawLen (2 bytes) */ - tile->crSrlLen = *((UINT16*) &block[boffset + 16]); /* crSrlLen (2 bytes) */ - tile->crRawLen = *((UINT16*) &block[boffset + 18]); /* crRawLen (2 bytes) */ + tile->quantIdxY = block[boffset + 0]; /* quantIdxY (1 byte) */ + tile->quantIdxCb = block[boffset + 1]; /* quantIdxCb (1 byte) */ + tile->quantIdxCr = block[boffset + 2]; /* quantIdxCr (1 byte) */ + tile->xIdx = *((UINT16*)&block[boffset + 3]); /* xIdx (2 bytes) */ + tile->yIdx = *((UINT16*)&block[boffset + 5]); /* yIdx (2 bytes) */ + tile->quality = block[boffset + 7]; /* quality (1 byte) */ + tile->ySrlLen = *((UINT16*)&block[boffset + 8]); /* ySrlLen (2 bytes) */ + tile->yRawLen = *((UINT16*)&block[boffset + 10]); /* yRawLen (2 bytes) */ + tile->cbSrlLen = *((UINT16*)&block[boffset + 12]); /* cbSrlLen (2 bytes) */ + tile->cbRawLen = *((UINT16*)&block[boffset + 14]); /* cbRawLen (2 bytes) */ + tile->crSrlLen = *((UINT16*)&block[boffset + 16]); /* crSrlLen (2 bytes) */ + tile->crRawLen = *((UINT16*)&block[boffset + 18]); /* crRawLen (2 bytes) */ boffset += 20; if ((tile->blockLen - boffset) < tile->ySrlLen) @@ -1491,7 +1530,7 @@ static INLINE int progressive_process_tiles(PROGRESSIVE_CONTEXT* progressive, if (count != region->numTiles) { WLog_Print(progressive->log, WLOG_WARN, - "numTiles inconsistency: actual: %"PRIu32", expected: %"PRIu16"\n", count, + "numTiles inconsistency: actual: %" PRIu32 ", expected: %" PRIu16 "\n", count, region->numTiles); } @@ -1515,14 +1554,12 @@ static INLINE int progressive_process_tiles(PROGRESSIVE_CONTEXT* progressive, return -1; } - return (int) offset; + return (int)offset; } -INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, - const BYTE* pSrcData, UINT32 SrcSize, - BYTE* pDstData, UINT32 DstFormat, - UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, - REGION16* invalidRegion, UINT16 surfaceId) +INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, UINT32 SrcSize, + BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, + UINT32 nYDst, REGION16* invalidRegion, UINT16 surfaceId) { INT32 rc = 1; INT32 status; @@ -1548,8 +1585,7 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, REGION16 clippingRects, updateRegion; PROGRESSIVE_SURFACE_CONTEXT* surface; PROGRESSIVE_BLOCK_REGION* region; - surface = (PROGRESSIVE_SURFACE_CONTEXT*) progressive_get_surface_data( - progressive, surfaceId); + surface = (PROGRESSIVE_SURFACE_CONTEXT*)progressive_get_surface_data(progressive, surfaceId); if (!surface) return -1001; @@ -1569,8 +1605,8 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, RFX_PROGRESSIVE_CODEC_QUANT* quantProgVal; boffset = 0; block = &blocks[offset]; - blockType = *((UINT16*) &block[boffset + 0]); /* blockType (2 bytes) */ - blockLen = *((UINT32*) &block[boffset + 2]); /* blockLen (4 bytes) */ + blockType = *((UINT16*)&block[boffset + 0]); /* blockType (2 bytes) */ + blockLen = *((UINT32*)&block[boffset + 2]); /* blockLen (4 bytes) */ boffset += 6; if ((blocksLen - offset) < blockLen) @@ -1586,9 +1622,8 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, if ((blockLen - boffset) != 6) return -1004; - sync.magic = (UINT32) * ((UINT32*) &block[boffset + 0]); /* magic (4 bytes) */ - sync.version = (UINT32) * ((UINT16*) &block[boffset + - 4]); /* version (2 bytes) */ + sync.magic = (UINT32) * ((UINT32*)&block[boffset + 0]); /* magic (4 bytes) */ + sync.version = (UINT32) * ((UINT16*)&block[boffset + 4]); /* version (2 bytes) */ boffset += 6; if (sync.magic != 0xCACCACCA) @@ -1606,13 +1641,14 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, if ((blockLen - boffset) < 6) return -1007; - frameBegin.frameIndex = (UINT32) * ((UINT32*) &block[boffset + - 0]); /* frameIndex (4 bytes) */ - frameBegin.regionCount = (UINT32) * ((UINT16*) &block[boffset + - 4]); /* regionCount (2 bytes) */ + frameBegin.frameIndex = + (UINT32) * ((UINT32*)&block[boffset + 0]); /* frameIndex (4 bytes) */ + frameBegin.regionCount = + (UINT32) * ((UINT16*)&block[boffset + 4]); /* regionCount (2 bytes) */ boffset += 6; WLog_Print(progressive->log, WLOG_DEBUG, - "ProgressiveFrameBegin: frameIndex: %"PRIu32" regionCount: %"PRIu16"", + "ProgressiveFrameBegin: frameIndex: %" PRIu32 " regionCount: %" PRIu16 + "", frameBegin.frameIndex, frameBegin.regionCount); /** * If the number of elements specified by the regionCount field is @@ -1638,15 +1674,16 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, if ((blockLen - boffset) != 4) return -1009; - context.ctxId = block[boffset + 0]; /* ctxId (1 byte) */ - context.tileSize = *((UINT16*) &block[boffset + 1]); /* tileSize (2 bytes) */ - context.flags = block[boffset + 3]; /* flags (1 byte) */ + context.ctxId = block[boffset + 0]; /* ctxId (1 byte) */ + context.tileSize = *((UINT16*)&block[boffset + 1]); /* tileSize (2 bytes) */ + context.flags = block[boffset + 3]; /* flags (1 byte) */ boffset += 4; if (context.tileSize != 64) return -1010; - WLog_Print(progressive->log, WLOG_DEBUG, "ProgressiveContext: flags: 0x%02"PRIX8"", context.flags); + WLog_Print(progressive->log, WLOG_DEBUG, + "ProgressiveContext: flags: 0x%02" PRIX8 "", context.flags); if (!(context.flags & RFX_SUBBAND_DIFFING)) WLog_Print(progressive->log, WLOG_WARN, "RFX_SUBBAND_DIFFING is not set"); @@ -1660,14 +1697,13 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, if ((blockLen - boffset) < 12) return -1011; - region->tileSize = block[boffset + 0]; /* tileSize (1 byte) */ - region->numRects = *((UINT16*) &block[boffset + 1]); /* numRects (2 bytes) */ - region->numQuant = block[boffset + 3]; /* numQuant (1 byte) */ - region->numProgQuant = block[boffset + 4]; /* numProgQuant (1 byte) */ - region->flags = block[boffset + 5]; /* flags (1 byte) */ - region->numTiles = *((UINT16*) &block[boffset + 6]); /* numTiles (2 bytes) */ - region->tileDataSize = *((UINT32*) &block[boffset + - 8]); /* tileDataSize (4 bytes) */ + region->tileSize = block[boffset + 0]; /* tileSize (1 byte) */ + region->numRects = *((UINT16*)&block[boffset + 1]); /* numRects (2 bytes) */ + region->numQuant = block[boffset + 3]; /* numQuant (1 byte) */ + region->numProgQuant = block[boffset + 4]; /* numProgQuant (1 byte) */ + region->flags = block[boffset + 5]; /* flags (1 byte) */ + region->numTiles = *((UINT16*)&block[boffset + 6]); /* numTiles (2 bytes) */ + region->tileDataSize = *((UINT32*)&block[boffset + 8]); /* tileDataSize (4 bytes) */ boffset += 12; if (region->tileSize != 64) @@ -1684,8 +1720,8 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, if (region->numRects > progressive->cRects) { - RFX_RECT* tmpBuf = (RFX_RECT*) realloc(progressive->rects, - region->numRects * sizeof(RFX_RECT)); + RFX_RECT* tmpBuf = + (RFX_RECT*)realloc(progressive->rects, region->numRects * sizeof(RFX_RECT)); if (!tmpBuf) return -1016; @@ -1701,10 +1737,10 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, for (index = 0; index < region->numRects; index++) { rect = &(region->rects[index]); - rect->x = *((UINT16*) &block[boffset + 0]); - rect->y = *((UINT16*) &block[boffset + 2]); - rect->width = *((UINT16*) &block[boffset + 4]); - rect->height = *((UINT16*) &block[boffset + 6]); + rect->x = *((UINT16*)&block[boffset + 0]); + rect->y = *((UINT16*)&block[boffset + 2]); + rect->width = *((UINT16*)&block[boffset + 4]); + rect->height = *((UINT16*)&block[boffset + 6]); boffset += 8; } @@ -1713,9 +1749,9 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, if (region->numQuant > progressive->cQuant) { - RFX_COMPONENT_CODEC_QUANT* tmpBuf = (RFX_COMPONENT_CODEC_QUANT*) realloc( - progressive->quantVals, - region->numQuant * sizeof(RFX_COMPONENT_CODEC_QUANT)); + RFX_COMPONENT_CODEC_QUANT* tmpBuf = (RFX_COMPONENT_CODEC_QUANT*)realloc( + progressive->quantVals, + region->numQuant * sizeof(RFX_COMPONENT_CODEC_QUANT)); if (!tmpBuf) return -1019; @@ -1746,9 +1782,9 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, if (region->numProgQuant > progressive->cProgQuant) { - RFX_PROGRESSIVE_CODEC_QUANT* tmpBuf = (RFX_PROGRESSIVE_CODEC_QUANT*) realloc( - progressive->quantProgVals, - region->numProgQuant * sizeof(RFX_PROGRESSIVE_CODEC_QUANT)); + RFX_PROGRESSIVE_CODEC_QUANT* tmpBuf = (RFX_PROGRESSIVE_CODEC_QUANT*)realloc( + progressive->quantProgVals, + region->numProgQuant * sizeof(RFX_PROGRESSIVE_CODEC_QUANT)); if (!tmpBuf) return -1022; @@ -1779,8 +1815,8 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, if (progressive->cTiles < surface->gridSize) { - RFX_PROGRESSIVE_TILE** tmpBuf = (RFX_PROGRESSIVE_TILE**) realloc(progressive->tiles, - surface->gridSize * sizeof(RFX_PROGRESSIVE_TILE*)); + RFX_PROGRESSIVE_TILE** tmpBuf = (RFX_PROGRESSIVE_TILE**)realloc( + progressive->tiles, surface->gridSize * sizeof(RFX_PROGRESSIVE_TILE*)); if (!tmpBuf) return -1025; @@ -1794,12 +1830,15 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, return -1; WLog_Print(progressive->log, WLOG_DEBUG, - "ProgressiveRegion: numRects: %"PRIu16" numTiles: %"PRIu16" tileDataSize: %"PRIu32" flags: 0x%02"PRIX8" numQuant: %"PRIu8" numProgQuant: %"PRIu8"", + "ProgressiveRegion: numRects: %" PRIu16 " numTiles: %" PRIu16 + " tileDataSize: %" PRIu32 " flags: 0x%02" PRIX8 " numQuant: %" PRIu8 + " numProgQuant: %" PRIu8 "", region->numRects, region->numTiles, region->tileDataSize, region->flags, region->numQuant, region->numProgQuant); if (!(region->flags & RFX_DWT_REDUCE_EXTRAPOLATE)) - WLog_Print(progressive->log, WLOG_WARN, "RFX_DWT_REDUCE_EXTRAPOLATE is not set"); + WLog_Print(progressive->log, WLOG_WARN, + "RFX_DWT_REDUCE_EXTRAPOLATE is not set"); boxLeft = surface->gridWidth; boxTop = surface->gridHeight; @@ -1827,7 +1866,8 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, boxBottom = idxBottom; WLog_Print(progressive->log, WLOG_DEBUG, - "rect[%"PRIu16"]: x: %"PRIu16" y: %"PRIu16" w: %"PRIu16" h: %"PRIu16"", + "rect[%" PRIu16 "]: x: %" PRIu16 " y: %" PRIu16 " w: %" PRIu16 + " h: %" PRIu16 "", index, rect->x, rect->y, rect->width, rect->height); } @@ -1855,7 +1895,7 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, region->tiles[region->numTiles++] = tile; } - boffset += (UINT32) status; + boffset += (UINT32)status; break; default: @@ -1909,11 +1949,9 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, const UINT32 width = rect->right - rect->left; const UINT32 height = rect->bottom - rect->top; - if (!freerdp_image_copy(pDstData, DstFormat, nDstStep, - rect->left, rect->top, - width, height, tile->data, tile->format, - tile->stride, - nXSrc, nYSrc, NULL, FREERDP_FLIP_NONE)) + if (!freerdp_image_copy(pDstData, DstFormat, nDstStep, rect->left, rect->top, width, + height, tile->data, tile->format, tile->stride, nXSrc, nYSrc, + NULL, FREERDP_FLIP_NONE)) { rc = -42; break; @@ -1930,8 +1968,8 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, return rc; } -int progressive_compress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, - UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize) +int progressive_compress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, UINT32 SrcSize, + BYTE** ppDstData, UINT32* pDstSize) { return -1; } @@ -1947,41 +1985,40 @@ BOOL progressive_context_reset(PROGRESSIVE_CONTEXT* progressive) PROGRESSIVE_CONTEXT* progressive_context_new(BOOL Compressor) { PROGRESSIVE_CONTEXT* progressive; - progressive = (PROGRESSIVE_CONTEXT*) calloc(1, sizeof(PROGRESSIVE_CONTEXT)); + progressive = (PROGRESSIVE_CONTEXT*)calloc(1, sizeof(PROGRESSIVE_CONTEXT)); if (progressive) { progressive->Compressor = Compressor; progressive->bufferPool = BufferPool_New(TRUE, (8192 + 32) * 3, 16); progressive->cRects = 64; - progressive->rects = (RFX_RECT*) calloc(progressive->cRects, sizeof(RFX_RECT)); + progressive->rects = (RFX_RECT*)calloc(progressive->cRects, sizeof(RFX_RECT)); if (!progressive->rects) goto cleanup; progressive->cTiles = 64; - progressive->tiles = (RFX_PROGRESSIVE_TILE**) calloc(progressive->cTiles, - sizeof(RFX_PROGRESSIVE_TILE*)); + progressive->tiles = + (RFX_PROGRESSIVE_TILE**)calloc(progressive->cTiles, sizeof(RFX_PROGRESSIVE_TILE*)); if (!progressive->tiles) goto cleanup; progressive->cQuant = 8; - progressive->quantVals = (RFX_COMPONENT_CODEC_QUANT*) calloc( - progressive->cQuant, sizeof(RFX_COMPONENT_CODEC_QUANT)); + progressive->quantVals = (RFX_COMPONENT_CODEC_QUANT*)calloc( + progressive->cQuant, sizeof(RFX_COMPONENT_CODEC_QUANT)); if (!progressive->quantVals) goto cleanup; progressive->cProgQuant = 8; - progressive->quantProgVals = (RFX_PROGRESSIVE_CODEC_QUANT*) calloc( - progressive->cProgQuant, sizeof(RFX_PROGRESSIVE_CODEC_QUANT)); + progressive->quantProgVals = (RFX_PROGRESSIVE_CODEC_QUANT*)calloc( + progressive->cProgQuant, sizeof(RFX_PROGRESSIVE_CODEC_QUANT)); if (!progressive->quantProgVals) goto cleanup; - ZeroMemory(&(progressive->quantProgValFull), - sizeof(RFX_PROGRESSIVE_CODEC_QUANT)); + ZeroMemory(&(progressive->quantProgValFull), sizeof(RFX_PROGRESSIVE_CODEC_QUANT)); progressive->quantProgValFull.quality = 100; progressive->SurfaceContexts = HashTable_New(TRUE); progressive_context_reset(progressive); @@ -2016,7 +2053,8 @@ void progressive_context_free(PROGRESSIVE_CONTEXT* progressive) for (index = 0; index < count; index++) { - surface = (PROGRESSIVE_SURFACE_CONTEXT*) HashTable_GetItemValue(progressive->SurfaceContexts, (void*) pKeys[index]); + surface = (PROGRESSIVE_SURFACE_CONTEXT*)HashTable_GetItemValue( + progressive->SurfaceContexts, (void*)pKeys[index]); progressive_surface_context_free(surface); } @@ -2026,4 +2064,3 @@ void progressive_context_free(PROGRESSIVE_CONTEXT* progressive) free(progressive); } - diff --git a/libfreerdp/codec/progressive.h b/libfreerdp/codec/progressive.h index 35a093efd..e54ed986d 100644 --- a/libfreerdp/codec/progressive.h +++ b/libfreerdp/codec/progressive.h @@ -26,20 +26,20 @@ #include -#define RFX_SUBBAND_DIFFING 0x01 +#define RFX_SUBBAND_DIFFING 0x01 -#define RFX_TILE_DIFFERENCE 0x01 +#define RFX_TILE_DIFFERENCE 0x01 -#define RFX_DWT_REDUCE_EXTRAPOLATE 0x01 +#define RFX_DWT_REDUCE_EXTRAPOLATE 0x01 -#define PROGRESSIVE_WBT_SYNC 0xCCC0 -#define PROGRESSIVE_WBT_FRAME_BEGIN 0xCCC1 -#define PROGRESSIVE_WBT_FRAME_END 0xCCC2 -#define PROGRESSIVE_WBT_CONTEXT 0xCCC3 -#define PROGRESSIVE_WBT_REGION 0xCCC4 -#define PROGRESSIVE_WBT_TILE_SIMPLE 0xCCC5 -#define PROGRESSIVE_WBT_TILE_FIRST 0xCCC6 -#define PROGRESSIVE_WBT_TILE_UPGRADE 0xCCC7 +#define PROGRESSIVE_WBT_SYNC 0xCCC0 +#define PROGRESSIVE_WBT_FRAME_BEGIN 0xCCC1 +#define PROGRESSIVE_WBT_FRAME_END 0xCCC2 +#define PROGRESSIVE_WBT_CONTEXT 0xCCC3 +#define PROGRESSIVE_WBT_REGION 0xCCC4 +#define PROGRESSIVE_WBT_TILE_SIMPLE 0xCCC5 +#define PROGRESSIVE_WBT_TILE_FIRST 0xCCC6 +#define PROGRESSIVE_WBT_TILE_UPGRADE 0xCCC7 struct _RFX_COMPONENT_CODEC_QUANT { @@ -230,4 +230,3 @@ struct _PROGRESSIVE_CONTEXT }; #endif /* INTERNAL_CODEC_PROGRESSIVE_H */ - diff --git a/libfreerdp/codec/region.c b/libfreerdp/codec/region.c index 28ad91a43..1009b852a 100644 --- a/libfreerdp/codec/region.c +++ b/libfreerdp/codec/region.c @@ -155,8 +155,10 @@ BOOL region16_is_empty(const REGION16* region) BOOL rectangles_equal(const RECTANGLE_16* r1, const RECTANGLE_16* r2) { - return ((r1->left == r2->left) && (r1->top == r2->top) && - (r1->right == r2->right) && (r1->bottom == r2->bottom)) ? TRUE : FALSE; + return ((r1->left == r2->left) && (r1->top == r2->top) && (r1->right == r2->right) && + (r1->bottom == r2->bottom)) + ? TRUE + : FALSE; } BOOL rectangles_intersects(const RECTANGLE_16* r1, const RECTANGLE_16* r2) @@ -165,8 +167,7 @@ BOOL rectangles_intersects(const RECTANGLE_16* r1, const RECTANGLE_16* r2) return rectangles_intersection(r1, r2, &tmp); } -BOOL rectangles_intersection(const RECTANGLE_16* r1, const RECTANGLE_16* r2, - RECTANGLE_16* dst) +BOOL rectangles_intersection(const RECTANGLE_16* r1, const RECTANGLE_16* r2, RECTANGLE_16* dst) { dst->left = MAX(r1->left, r2->left); dst->right = MIN(r1->right, r2->right); @@ -190,7 +191,7 @@ void region16_clear(REGION16* region) static INLINE REGION16_DATA* allocateRegion(long nbItems) { long allocSize = sizeof(REGION16_DATA) + (nbItems * sizeof(RECTANGLE_16)); - REGION16_DATA* ret = (REGION16_DATA*) malloc(allocSize); + REGION16_DATA* ret = (REGION16_DATA*)malloc(allocSize); if (!ret) return ret; @@ -236,30 +237,28 @@ void region16_print(const REGION16* region) UINT32 nbRects, i; int currentBandY = -1; rects = region16_rects(region, &nbRects); - WLog_DBG(TAG, "nrects=%"PRIu32"", nbRects); + WLog_DBG(TAG, "nrects=%" PRIu32 "", nbRects); for (i = 0; i < nbRects; i++, rects++) { if (rects->top != currentBandY) { currentBandY = rects->top; - WLog_DBG(TAG, "band %d: ", currentBandY); + WLog_DBG(TAG, "band %d: ", currentBandY); } - WLog_DBG(TAG, "(%"PRIu16",%"PRIu16"-%"PRIu16",%"PRIu16")", rects->left, rects->top, rects->right, - rects->bottom); + WLog_DBG(TAG, "(%" PRIu16 ",%" PRIu16 "-%" PRIu16 ",%" PRIu16 ")", rects->left, rects->top, + rects->right, rects->bottom); } } -static void region16_copy_band_with_union(RECTANGLE_16* dst, - const RECTANGLE_16* src, const RECTANGLE_16* end, - UINT16 newTop, UINT16 newBottom, - const RECTANGLE_16* unionRect, - UINT32* dstCounter, - const RECTANGLE_16** srcPtr, RECTANGLE_16** dstPtr) +static void region16_copy_band_with_union(RECTANGLE_16* dst, const RECTANGLE_16* src, + const RECTANGLE_16* end, UINT16 newTop, UINT16 newBottom, + const RECTANGLE_16* unionRect, UINT32* dstCounter, + const RECTANGLE_16** srcPtr, RECTANGLE_16** dstPtr) { UINT16 refY = src->top; - const RECTANGLE_16* startOverlap, *endOverlap; + const RECTANGLE_16 *startOverlap, *endOverlap; /* merges a band with the given rect * Input: @@ -418,7 +417,7 @@ static BOOL region16_simplify_bands(REGION16* region) * ==================== ==================== * */ - RECTANGLE_16* band1, *band2, *endPtr, *endBand, *tmp; + RECTANGLE_16 *band1, *band2, *endPtr, *endBand, *tmp; int nbRects, finalNbRects; int bandItems, toMove; finalNbRects = nbRects = region16_n_rects(region); @@ -462,8 +461,7 @@ static BOOL region16_simplify_bands(REGION16* region) { band1 = band2; } - } - while (TRUE); + } while (TRUE); if (finalNbRects != nbRects) { @@ -491,7 +489,7 @@ BOOL region16_union_rect(REGION16* dst, const REGION16* src, const RECTANGLE_16* { const RECTANGLE_16* srcExtents; RECTANGLE_16* dstExtents; - const RECTANGLE_16* currentBand, *endSrcRect, *nextBand; + const RECTANGLE_16 *currentBand, *endSrcRect, *nextBand; REGION16_DATA* newItems = NULL; REGION16_DATA* tmpItems = NULL; RECTANGLE_16* dstRect = NULL; @@ -551,28 +549,26 @@ BOOL region16_union_rect(REGION16* dst, const REGION16* src, const RECTANGLE_16* /* no overlap between rect and the band, rect is totally below or totally above * the current band, or rect is already covered by an item of the band. * let's copy all the rectangles from this band - +----+ - | | rect (case 1) - +----+ + +----+ + | | rect (case 1) + +----+ ================= band of srcRect ================= - +----+ - | | rect (case 2) - +----+ + +----+ + | | rect (case 2) + +----+ */ - region16_copy_band_with_union(dstRect, - currentBand, endSrcRect, - currentBand->top, currentBand->bottom, - NULL, &usedRects, - &nextBand, &dstRect); + region16_copy_band_with_union(dstRect, currentBand, endSrcRect, currentBand->top, + currentBand->bottom, NULL, &usedRects, &nextBand, + &dstRect); topInterBand = rect->top; } else { /* rect overlaps the band: - | | | | + | | | | ====^=================| |==| |=========================== band | top split | | | | v | 1 | | 2 | @@ -582,7 +578,7 @@ BOOL region16_union_rect(REGION16* dst, const REGION16* src, const RECTANGLE_16* ^ | | | 3 | | bottom split | | | | ====v=========================| |==| |=================== - | | | | + | | | | possible cases: 1) no top split, merge zone then a bottom split. The band will be splitted @@ -599,11 +595,8 @@ BOOL region16_union_rect(REGION16* dst, const REGION16* src, const RECTANGLE_16* /* test if we need a top split, case 3 and 4 */ if (rect->top > currentBand->top) { - region16_copy_band_with_union(dstRect, - currentBand, endSrcRect, - currentBand->top, rect->top, - NULL, &usedRects, - &nextBand, &dstRect); + region16_copy_band_with_union(dstRect, currentBand, endSrcRect, currentBand->top, + rect->top, NULL, &usedRects, &nextBand, &dstRect); mergeTop = rect->top; } @@ -611,20 +604,15 @@ BOOL region16_union_rect(REGION16* dst, const REGION16* src, const RECTANGLE_16* if (rect->bottom < currentBand->bottom) mergeBottom = rect->bottom; - region16_copy_band_with_union(dstRect, - currentBand, endSrcRect, - mergeTop, mergeBottom, - rect, &usedRects, - &nextBand, &dstRect); + region16_copy_band_with_union(dstRect, currentBand, endSrcRect, mergeTop, mergeBottom, + rect, &usedRects, &nextBand, &dstRect); /* test if we need a bottom split, case 1 and 4 */ if (rect->bottom < currentBand->bottom) { - region16_copy_band_with_union(dstRect, - currentBand, endSrcRect, - mergeBottom, currentBand->bottom, - NULL, &usedRects, - &nextBand, &dstRect); + region16_copy_band_with_union(dstRect, currentBand, endSrcRect, mergeBottom, + currentBand->bottom, NULL, &usedRects, &nextBand, + &dstRect); } topInterBand = currentBand->bottom; @@ -696,7 +684,7 @@ BOOL region16_union_rect(REGION16* dst, const REGION16* src, const RECTANGLE_16* BOOL region16_intersects_rect(const REGION16* src, const RECTANGLE_16* arg2) { - const RECTANGLE_16* rect, *endPtr, *srcExtents; + const RECTANGLE_16 *rect, *endPtr, *srcExtents; UINT32 nbRects; if (!src || !src->data || !arg2) @@ -727,7 +715,7 @@ BOOL region16_intersects_rect(const REGION16* src, const RECTANGLE_16* arg2) BOOL region16_intersect_rect(REGION16* dst, const REGION16* src, const RECTANGLE_16* rect) { REGION16_DATA* newItems; - const RECTANGLE_16* srcPtr, *endPtr, *srcExtents; + const RECTANGLE_16 *srcPtr, *endPtr, *srcExtents; RECTANGLE_16* dstPtr; UINT32 nbRects, usedRects; RECTANGLE_16 common, newExtents; diff --git a/libfreerdp/codec/rfx.c b/libfreerdp/codec/rfx.c index e02fac6ed..c36d9f7bf 100644 --- a/libfreerdp/codec/rfx.c +++ b/libfreerdp/codec/rfx.c @@ -56,11 +56,13 @@ #define TAG FREERDP_TAG("codec") #ifndef RFX_INIT_SIMD -#define RFX_INIT_SIMD(_rfx_context) do { } while (0) +#define RFX_INIT_SIMD(_rfx_context) \ + do \ + { \ + } while (0) #endif -#define RFX_KEY "Software\\"FREERDP_VENDOR_STRING"\\" \ - FREERDP_PRODUCT_STRING"\\RemoteFX" +#define RFX_KEY "Software\\" FREERDP_VENDOR_STRING "\\" FREERDP_PRODUCT_STRING "\\RemoteFX" /** * The quantization values control the compression rate and quality. The value @@ -74,10 +76,7 @@ * The order of the values are: * LL3, LH3, HL3, HH3, LH2, HL2, HH2, LH1, HL1, HH1 */ -static const UINT32 rfx_default_quantization_values[] = -{ - 6, 6, 6, 6, 7, 7, 8, 8, 8, 9 -}; +static const UINT32 rfx_default_quantization_values[] = { 6, 6, 6, 6, 7, 7, 8, 8, 8, 9 }; static void rfx_profiler_create(RFX_CONTEXT* context) { @@ -159,10 +158,10 @@ static void* rfx_decoder_tile_new(void* val) RFX_TILE* tile = NULL; WINPR_UNUSED(val); - if (!(tile = (RFX_TILE*) calloc(1, sizeof(RFX_TILE)))) + if (!(tile = (RFX_TILE*)calloc(1, sizeof(RFX_TILE)))) return NULL; - if (!(tile->data = (BYTE*) _aligned_malloc(4 * 64 * 64, 16))) + if (!(tile->data = (BYTE*)_aligned_malloc(4 * 64 * 64, 16))) { free(tile); return NULL; @@ -268,8 +267,8 @@ RFX_CONTEXT* rfx_context_new(BOOL encoder) ZeroMemory(&verinfo, sizeof(OSVERSIONINFOA)); verinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA); GetVersionExA(&verinfo); - isVistaOrLater = ((verinfo.dwMajorVersion >= 6) - && (verinfo.dwMinorVersion >= 0)) ? TRUE : FALSE; + isVistaOrLater = + ((verinfo.dwMajorVersion >= 6) && (verinfo.dwMinorVersion >= 0)) ? TRUE : FALSE; priv->UseThreads = isVistaOrLater; } #else @@ -278,23 +277,22 @@ RFX_CONTEXT* rfx_context_new(BOOL encoder) GetNativeSystemInfo(&sysinfo); priv->MinThreadCount = sysinfo.dwNumberOfProcessors; priv->MaxThreadCount = 0; - status = RegOpenKeyExA(HKEY_LOCAL_MACHINE, RFX_KEY, 0, - KEY_READ | KEY_WOW64_64KEY, &hKey); + status = RegOpenKeyExA(HKEY_LOCAL_MACHINE, RFX_KEY, 0, KEY_READ | KEY_WOW64_64KEY, &hKey); if (status == ERROR_SUCCESS) { dwSize = sizeof(dwValue); - if (RegQueryValueEx(hKey, _T("UseThreads"), NULL, &dwType, (BYTE*) &dwValue, - &dwSize) == ERROR_SUCCESS) + if (RegQueryValueEx(hKey, _T("UseThreads"), NULL, &dwType, (BYTE*)&dwValue, &dwSize) == + ERROR_SUCCESS) priv->UseThreads = dwValue ? 1 : 0; - if (RegQueryValueEx(hKey, _T("MinThreadCount"), NULL, &dwType, (BYTE*) &dwValue, - &dwSize) == ERROR_SUCCESS) + if (RegQueryValueEx(hKey, _T("MinThreadCount"), NULL, &dwType, (BYTE*)&dwValue, &dwSize) == + ERROR_SUCCESS) priv->MinThreadCount = dwValue; - if (RegQueryValueEx(hKey, _T("MaxThreadCount"), NULL, &dwType, (BYTE*) &dwValue, - &dwSize) == ERROR_SUCCESS) + if (RegQueryValueEx(hKey, _T("MaxThreadCount"), NULL, &dwType, (BYTE*)&dwValue, &dwSize) == + ERROR_SUCCESS) priv->MaxThreadCount = dwValue; RegCloseKey(hKey); @@ -429,18 +427,18 @@ static BOOL rfx_process_message_sync(RFX_CONTEXT* context, wStream* s) Stream_Read_UINT32(s, magic); /* magic (4 bytes), 0xCACCACCA */ if (magic != WF_MAGIC) { - WLog_ERR(TAG, "invalid magic number 0x%08"PRIX32"", magic); + WLog_ERR(TAG, "invalid magic number 0x%08" PRIX32 "", magic); return FALSE; } Stream_Read_UINT16(s, context->version); /* version (2 bytes), WF_VERSION_1_0 (0x0100) */ if (context->version != WF_VERSION_1_0) { - WLog_ERR(TAG, "invalid version number 0x%08"PRIX32"", context->version); + WLog_ERR(TAG, "invalid version number 0x%08" PRIX32 "", context->version); return FALSE; } - WLog_Print(context->priv->log, WLOG_DEBUG, "version 0x%08"PRIX32"", context->version); + WLog_Print(context->priv->log, WLOG_DEBUG, "version 0x%08" PRIX32 "", context->version); context->decodedHeaderBlocks |= _RFX_DECODED_SYNC; return TRUE; } @@ -456,30 +454,31 @@ static BOOL rfx_process_message_codec_versions(RFX_CONTEXT* context, wStream* s) return FALSE; } - Stream_Read_UINT8(s, numCodecs); /* numCodecs (1 byte), must be set to 0x01 */ + Stream_Read_UINT8(s, numCodecs); /* numCodecs (1 byte), must be set to 0x01 */ Stream_Read_UINT8(s, context->codec_id); /* codecId (1 byte), must be set to 0x01 */ - Stream_Read_UINT16(s, context->codec_version); /* version (2 bytes), must be set to WF_VERSION_1_0 (0x0100) */ + Stream_Read_UINT16( + s, context->codec_version); /* version (2 bytes), must be set to WF_VERSION_1_0 (0x0100) */ if (numCodecs != 1) { - WLog_ERR(TAG, "%s: numCodes is 0x%02"PRIX8" (must be 0x01)", __FUNCTION__, numCodecs); + WLog_ERR(TAG, "%s: numCodes is 0x%02" PRIX8 " (must be 0x01)", __FUNCTION__, numCodecs); return FALSE; } if (context->codec_id != 0x01) { - WLog_ERR(TAG, "%s: invalid codec id (0x%02"PRIX32")", __FUNCTION__, context->codec_id); + WLog_ERR(TAG, "%s: invalid codec id (0x%02" PRIX32 ")", __FUNCTION__, context->codec_id); return FALSE; } if (context->codec_version != WF_VERSION_1_0) { - WLog_ERR(TAG, "%s: invalid codec version (0x%08"PRIX32")", __FUNCTION__, + WLog_ERR(TAG, "%s: invalid codec version (0x%08" PRIX32 ")", __FUNCTION__, context->codec_version); return FALSE; } - WLog_Print(context->priv->log, WLOG_DEBUG, "id %"PRIu32" version 0x%"PRIX32".", + WLog_Print(context->priv->log, WLOG_DEBUG, "id %" PRIu32 " version 0x%" PRIX32 ".", context->codec_id, context->codec_version); context->decodedHeaderBlocks |= _RFX_DECODED_VERSIONS; return TRUE; @@ -510,7 +509,7 @@ static BOOL rfx_process_message_channels(RFX_CONTEXT* context, wStream* s) if (Stream_GetRemainingLength(s) < (size_t)(numChannels * 5)) { - WLog_ERR(TAG, "RfxMessageChannels packet too small for numChannels=%"PRIu8"", + WLog_ERR(TAG, "RfxMessageChannels packet too small for numChannels=%" PRIu8 "", numChannels); return FALSE; } @@ -520,24 +519,25 @@ static BOOL rfx_process_message_channels(RFX_CONTEXT* context, wStream* s) if (channelId != 0x00) { - WLog_ERR(TAG, "channelId:0x%02"PRIX8", expected:0x00", channelId); + WLog_ERR(TAG, "channelId:0x%02" PRIX8 ", expected:0x00", channelId); return FALSE; } - Stream_Read_UINT16(s, context->width); /* width (2 bytes) */ + Stream_Read_UINT16(s, context->width); /* width (2 bytes) */ Stream_Read_UINT16(s, context->height); /* height (2 bytes) */ if (!context->width || !context->height) { - WLog_ERR(TAG, "%s: invalid channel with/height: %"PRIu16"x%"PRIu16"", __FUNCTION__, + WLog_ERR(TAG, "%s: invalid channel with/height: %" PRIu16 "x%" PRIu16 "", __FUNCTION__, context->width, context->height); return FALSE; } /* Now, only the first monitor can be used, therefore the other channels will be ignored. */ Stream_Seek(s, 5 * (numChannels - 1)); - WLog_Print(context->priv->log, WLOG_DEBUG, "numChannels %"PRIu8" id %"PRIu8", %"PRIu16"x%"PRIu16".", - numChannels, channelId, context->width, context->height); + WLog_Print(context->priv->log, WLOG_DEBUG, + "numChannels %" PRIu8 " id %" PRIu8 ", %" PRIu16 "x%" PRIu16 ".", numChannels, + channelId, context->width, context->height); context->decodedHeaderBlocks |= _RFX_DECODED_CHANNELS; return TRUE; } @@ -555,12 +555,12 @@ static BOOL rfx_process_message_context(RFX_CONTEXT* context, wStream* s) return FALSE; } - Stream_Read_UINT8(s, ctxId); /* ctxId (1 byte), must be set to 0x00 */ + Stream_Read_UINT8(s, ctxId); /* ctxId (1 byte), must be set to 0x00 */ Stream_Read_UINT16(s, tileSize); /* tileSize (2 bytes), must be set to CT_TILE_64x64 (0x0040) */ Stream_Read_UINT16(s, properties); /* properties (2 bytes) */ WLog_Print(context->priv->log, WLOG_DEBUG, - "ctxId %"PRIu8" tileSize %"PRIu16" properties 0x%04"PRIX16".", - ctxId, tileSize, properties); + "ctxId %" PRIu8 " tileSize %" PRIu16 " properties 0x%04" PRIX16 ".", ctxId, tileSize, + properties); context->properties = properties; context->flags = (properties & 0x0007); @@ -594,8 +594,8 @@ static BOOL rfx_process_message_context(RFX_CONTEXT* context, wStream* s) return TRUE; } -static BOOL rfx_process_message_frame_begin(RFX_CONTEXT* context, - RFX_MESSAGE* message, wStream* s, UINT16* pExpectedBlockType) +static BOOL rfx_process_message_frame_begin(RFX_CONTEXT* context, RFX_MESSAGE* message, wStream* s, + UINT16* pExpectedBlockType) { UINT32 frameIdx; UINT16 numRegions; @@ -614,15 +614,17 @@ static BOOL rfx_process_message_frame_begin(RFX_CONTEXT* context, return FALSE; } - Stream_Read_UINT32(s, frameIdx); /* frameIdx (4 bytes), if codec is in video mode, must be ignored */ + Stream_Read_UINT32( + s, frameIdx); /* frameIdx (4 bytes), if codec is in video mode, must be ignored */ Stream_Read_UINT16(s, numRegions); /* numRegions (2 bytes) */ WLog_Print(context->priv->log, WLOG_DEBUG, - "RFX_FRAME_BEGIN: frameIdx: %"PRIu32" numRegions: %"PRIu16"", frameIdx, numRegions); + "RFX_FRAME_BEGIN: frameIdx: %" PRIu32 " numRegions: %" PRIu16 "", frameIdx, + numRegions); return TRUE; } -static BOOL rfx_process_message_frame_end(RFX_CONTEXT* context, - RFX_MESSAGE* message, wStream* s, UINT16* pExpectedBlockType) +static BOOL rfx_process_message_frame_end(RFX_CONTEXT* context, RFX_MESSAGE* message, wStream* s, + UINT16* pExpectedBlockType) { if (*pExpectedBlockType != WBT_FRAME_END) { @@ -635,13 +637,13 @@ static BOOL rfx_process_message_frame_end(RFX_CONTEXT* context, return TRUE; } -static BOOL rfx_process_message_region(RFX_CONTEXT* context, - RFX_MESSAGE* message, wStream* s, UINT16* pExpectedBlockType) +static BOOL rfx_process_message_region(RFX_CONTEXT* context, RFX_MESSAGE* message, wStream* s, + UINT16* pExpectedBlockType) { int i; UINT16 regionType; UINT16 numTileSets; - RFX_RECT *tmpRects; + RFX_RECT* tmpRects; if (*pExpectedBlockType != WBT_REGION) { @@ -657,7 +659,7 @@ static BOOL rfx_process_message_region(RFX_CONTEXT* context, return FALSE; } - Stream_Seek_UINT8(s); /* regionFlags (1 byte) */ + Stream_Seek_UINT8(s); /* regionFlags (1 byte) */ Stream_Read_UINT16(s, message->numRects); /* numRects (2 bytes) */ if (message->numRects < 1) @@ -683,7 +685,7 @@ static BOOL rfx_process_message_region(RFX_CONTEXT* context, if (Stream_GetRemainingLength(s) < (size_t)(8 * message->numRects)) { - WLog_ERR(TAG, "%s: packet too small for num_rects=%"PRIu16"", __FUNCTION__, + WLog_ERR(TAG, "%s: packet too small for num_rects=%" PRIu16 "", __FUNCTION__, message->numRects); return FALSE; } @@ -698,14 +700,13 @@ static BOOL rfx_process_message_region(RFX_CONTEXT* context, { RFX_RECT* rect = rfx_message_get_rect(message, i); /* RFX_RECT */ - Stream_Read_UINT16(s, rect->x); /* x (2 bytes) */ - Stream_Read_UINT16(s, rect->y); /* y (2 bytes) */ - Stream_Read_UINT16(s, rect->width); /* width (2 bytes) */ + Stream_Read_UINT16(s, rect->x); /* x (2 bytes) */ + Stream_Read_UINT16(s, rect->y); /* y (2 bytes) */ + Stream_Read_UINT16(s, rect->width); /* width (2 bytes) */ Stream_Read_UINT16(s, rect->height); /* height (2 bytes) */ WLog_Print(context->priv->log, WLOG_DEBUG, - "rect %d (x,y=%"PRIu16",%"PRIu16" w,h=%"PRIu16" %"PRIu16").", i, - rect->x, rect->y, - rect->width, rect->height); + "rect %d (x,y=%" PRIu16 ",%" PRIu16 " w,h=%" PRIu16 " %" PRIu16 ").", i, rect->x, + rect->y, rect->width, rect->height); } if (Stream_GetRemainingLength(s) < 4) @@ -714,18 +715,18 @@ static BOOL rfx_process_message_region(RFX_CONTEXT* context, return FALSE; } - Stream_Read_UINT16(s, regionType); /*regionType (2 bytes): MUST be set to CBT_REGION (0xCAC1)*/ + Stream_Read_UINT16(s, regionType); /*regionType (2 bytes): MUST be set to CBT_REGION (0xCAC1)*/ Stream_Read_UINT16(s, numTileSets); /*numTilesets (2 bytes): MUST be set to 0x0001.*/ if (regionType != CBT_REGION) { - WLog_ERR(TAG, "%s: invalid region type 0x%04"PRIX16"", __FUNCTION__, regionType); + WLog_ERR(TAG, "%s: invalid region type 0x%04" PRIX16 "", __FUNCTION__, regionType); return TRUE; } if (numTileSets != 0x0001) { - WLog_ERR(TAG, "%s: invalid number of tilesets (%"PRIu16")", __FUNCTION__, numTileSets); + WLog_ERR(TAG, "%s: invalid number of tilesets (%" PRIu16 ")", __FUNCTION__, numTileSets); return FALSE; } @@ -739,16 +740,15 @@ struct _RFX_TILE_PROCESS_WORK_PARAM }; typedef struct _RFX_TILE_PROCESS_WORK_PARAM RFX_TILE_PROCESS_WORK_PARAM; -static void CALLBACK rfx_process_message_tile_work_callback( - PTP_CALLBACK_INSTANCE - instance, void* context, PTP_WORK work) +static void CALLBACK rfx_process_message_tile_work_callback(PTP_CALLBACK_INSTANCE instance, + void* context, PTP_WORK work) { - RFX_TILE_PROCESS_WORK_PARAM* param = (RFX_TILE_PROCESS_WORK_PARAM*) context; + RFX_TILE_PROCESS_WORK_PARAM* param = (RFX_TILE_PROCESS_WORK_PARAM*)context; rfx_decode_rgb(param->context, param->tile, param->tile->data, 64 * 4); } -static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, - RFX_MESSAGE* message, wStream* s, UINT16* pExpectedBlockType) +static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, RFX_MESSAGE* message, wStream* s, + UINT16* pExpectedBlockType) { BOOL rc; int i, close_cnt; @@ -786,10 +786,10 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, return FALSE; } - Stream_Seek_UINT16(s); /* idx (2 bytes), must be set to 0x0000 */ - Stream_Seek_UINT16(s); /* properties (2 bytes) */ + Stream_Seek_UINT16(s); /* idx (2 bytes), must be set to 0x0000 */ + Stream_Seek_UINT16(s); /* properties (2 bytes) */ Stream_Read_UINT8(s, context->numQuant); /* numQuant (1 byte) */ - Stream_Seek_UINT8(s); /* tileSize (1 byte), must be set to 0x40 */ + Stream_Seek_UINT8(s); /* tileSize (1 byte), must be set to 0x40 */ if (context->numQuant < 1) { @@ -809,12 +809,12 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, if (!(pmem = realloc((void*)context->quants, context->numQuant * 10 * sizeof(UINT32)))) return FALSE; - quants = context->quants = (UINT32*) pmem; + quants = context->quants = (UINT32*)pmem; /* quantVals */ if (Stream_GetRemainingLength(s) < (size_t)(context->numQuant * 5)) { - WLog_ERR(TAG, "RfxMessageTileSet packet too small for num_quants=%"PRIu8"", + WLog_ERR(TAG, "RfxMessageTileSet packet too small for num_quants=%" PRIu8 "", context->numQuant); return FALSE; } @@ -838,7 +838,8 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, *quants++ = (quant & 0x0F); *quants++ = (quant >> 4); WLog_Print(context->priv->log, WLOG_DEBUG, - "quant %d (%"PRIu32" %"PRIu32" %"PRIu32" %"PRIu32" %"PRIu32" %"PRIu32" %"PRIu32" %"PRIu32" %"PRIu32" %"PRIu32").", + "quant %d (%" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 + " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 ").", i, context->quants[i * 10], context->quants[i * 10 + 1], context->quants[i * 10 + 2], context->quants[i * 10 + 3], context->quants[i * 10 + 4], context->quants[i * 10 + 5], @@ -852,7 +853,7 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, message->tiles[i] = NULL; } - tmpTiles = (RFX_TILE**)realloc(message->tiles, numTiles * sizeof(RFX_TILE *)); + tmpTiles = (RFX_TILE**)realloc(message->tiles, numTiles * sizeof(RFX_TILE*)); if (!tmpTiles) return FALSE; @@ -861,9 +862,9 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, if (context->priv->UseThreads) { - work_objects = (PTP_WORK*) calloc(message->numTiles, sizeof(PTP_WORK)); - params = (RFX_TILE_PROCESS_WORK_PARAM*) calloc(message->numTiles, - sizeof(RFX_TILE_PROCESS_WORK_PARAM)); + work_objects = (PTP_WORK*)calloc(message->numTiles, sizeof(PTP_WORK)); + params = (RFX_TILE_PROCESS_WORK_PARAM*)calloc(message->numTiles, + sizeof(RFX_TILE_PROCESS_WORK_PARAM)); if (!work_objects) { @@ -884,7 +885,7 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, for (i = 0; i < message->numTiles; i++) { - if (!(tile = (RFX_TILE*) ObjectPool_Take(context->priv->TilePool))) + if (!(tile = (RFX_TILE*)ObjectPool_Take(context->priv->TilePool))) { WLog_ERR(TAG, "RfxMessageTileSet failed to get tile from object pool"); rc = FALSE; @@ -896,19 +897,21 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, /* RFX_TILE */ if (Stream_GetRemainingLength(s) < 6) { - WLog_ERR(TAG, "RfxMessageTileSet packet too small to read tile %d/%"PRIu16"", i, + WLog_ERR(TAG, "RfxMessageTileSet packet too small to read tile %d/%" PRIu16 "", i, message->numTiles); rc = FALSE; break; } - Stream_Read_UINT16(s, blockType); /* blockType (2 bytes), must be set to CBT_TILE (0xCAC3) */ + Stream_Read_UINT16(s, + blockType); /* blockType (2 bytes), must be set to CBT_TILE (0xCAC3) */ Stream_Read_UINT32(s, blockLen); /* blockLen (4 bytes) */ if (Stream_GetRemainingLength(s) < blockLen - 6) { WLog_ERR(TAG, - "RfxMessageTileSet not enough bytes to read tile %d/%"PRIu16" with blocklen=%"PRIu32"", + "RfxMessageTileSet not enough bytes to read tile %d/%" PRIu16 + " with blocklen=%" PRIu32 "", i, message->numTiles, blockLen); rc = FALSE; break; @@ -918,20 +921,20 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, if (blockType != CBT_TILE) { - WLog_ERR(TAG, "unknown block type 0x%"PRIX32", expected CBT_TILE (0xCAC3).", + WLog_ERR(TAG, "unknown block type 0x%" PRIX32 ", expected CBT_TILE (0xCAC3).", blockType); rc = FALSE; break; } - Stream_Read_UINT8(s, tile->quantIdxY); /* quantIdxY (1 byte) */ + Stream_Read_UINT8(s, tile->quantIdxY); /* quantIdxY (1 byte) */ Stream_Read_UINT8(s, tile->quantIdxCb); /* quantIdxCb (1 byte) */ Stream_Read_UINT8(s, tile->quantIdxCr); /* quantIdxCr (1 byte) */ - Stream_Read_UINT16(s, tile->xIdx); /* xIdx (2 bytes) */ - Stream_Read_UINT16(s, tile->yIdx); /* yIdx (2 bytes) */ - Stream_Read_UINT16(s, tile->YLen); /* YLen (2 bytes) */ - Stream_Read_UINT16(s, tile->CbLen); /* CbLen (2 bytes) */ - Stream_Read_UINT16(s, tile->CrLen); /* CrLen (2 bytes) */ + Stream_Read_UINT16(s, tile->xIdx); /* xIdx (2 bytes) */ + Stream_Read_UINT16(s, tile->yIdx); /* yIdx (2 bytes) */ + Stream_Read_UINT16(s, tile->YLen); /* YLen (2 bytes) */ + Stream_Read_UINT16(s, tile->CbLen); /* CbLen (2 bytes) */ + Stream_Read_UINT16(s, tile->CrLen); /* CrLen (2 bytes) */ Stream_GetPointer(s, tile->YData); Stream_Seek(s, tile->YLen); Stream_GetPointer(s, tile->CbData); @@ -947,9 +950,9 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, params[i].context = context; params[i].tile = message->tiles[i]; - if (!(work_objects[i] = CreateThreadpoolWork( - rfx_process_message_tile_work_callback, - (void*) ¶ms[i], &context->priv->ThreadPoolEnv))) + if (!(work_objects[i] = + CreateThreadpoolWork(rfx_process_message_tile_work_callback, + (void*)¶ms[i], &context->priv->ThreadPoolEnv))) { WLog_ERR(TAG, "CreateThreadpoolWork failed."); rc = FALSE; @@ -991,11 +994,9 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, return rc; } -BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length, - UINT32 left, UINT32 top, - BYTE* dst, UINT32 dstFormat, - UINT32 dstStride, UINT32 dstHeight, - REGION16* invalidRegion) +BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length, UINT32 left, + UINT32 top, BYTE* dst, UINT32 dstFormat, UINT32 dstStride, + UINT32 dstHeight, REGION16* invalidRegion) { REGION16 updateRegion; UINT32 blockLen; @@ -1020,24 +1021,23 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length, /* RFX_BLOCKT */ Stream_Read_UINT16(s, blockType); /* blockType (2 bytes) */ - Stream_Read_UINT32(s, blockLen); /* blockLen (4 bytes) */ - WLog_Print(context->priv->log, WLOG_DEBUG, "blockType 0x%"PRIX32" blockLen %"PRIu32"", + Stream_Read_UINT32(s, blockLen); /* blockLen (4 bytes) */ + WLog_Print(context->priv->log, WLOG_DEBUG, "blockType 0x%" PRIX32 " blockLen %" PRIu32 "", blockType, blockLen); if (blockLen < 6) { - WLog_ERR(TAG, "blockLen too small(%"PRIu32")", blockLen); + WLog_ERR(TAG, "blockLen too small(%" PRIu32 ")", blockLen); return FALSE; } if (Stream_GetRemainingLength(s) < blockLen - 6) { - WLog_ERR(TAG, "%s: packet too small for blocklen=%"PRIu32"", __FUNCTION__, blockLen); + WLog_ERR(TAG, "%s: packet too small for blocklen=%" PRIu32 "", __FUNCTION__, blockLen); return FALSE; } - if (blockType > WBT_CONTEXT - && context->decodedHeaderBlocks != _RFX_DECODED_HEADERS) + if (blockType > WBT_CONTEXT && context->decodedHeaderBlocks != _RFX_DECODED_HEADERS) { WLog_ERR(TAG, "%s: incomplete header blocks processing", __FUNCTION__); return FALSE; @@ -1053,12 +1053,12 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length, return FALSE; extraBlockLen = 2; - Stream_Read_UINT8(s, codecId); /* codecId (1 byte) must be set to 0x01 */ + Stream_Read_UINT8(s, codecId); /* codecId (1 byte) must be set to 0x01 */ Stream_Read_UINT8(s, channelId); /* channelId (1 byte) 0xFF or 0x00, see below */ if (codecId != 0x01) { - WLog_ERR(TAG, "%s: invalid codecId 0x%02"PRIX8"", __FUNCTION__, codecId); + WLog_ERR(TAG, "%s: invalid codecId 0x%02" PRIX8 "", __FUNCTION__, codecId); return FALSE; } @@ -1067,8 +1067,9 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length, /* If the blockType is set to WBT_CONTEXT, then channelId MUST be set to 0xFF.*/ if (channelId != 0xFF) { - WLog_ERR(TAG, "%s: invalid channelId 0x%02"PRIX8" for blockType 0x%08"PRIX32"", __FUNCTION__, - channelId, blockType); + WLog_ERR(TAG, + "%s: invalid channelId 0x%02" PRIX8 " for blockType 0x%08" PRIX32 "", + __FUNCTION__, channelId, blockType); return FALSE; } } @@ -1077,7 +1078,7 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length, /* For all other values of blockType, channelId MUST be set to 0x00. */ if (channelId != 0x00) { - WLog_ERR(TAG, "%s: invalid channelId 0x%02"PRIX8" for blockType WBT_CONTEXT", + WLog_ERR(TAG, "%s: invalid channelId 0x%02" PRIX8 " for blockType WBT_CONTEXT", __FUNCTION__, channelId); return FALSE; } @@ -1109,31 +1110,35 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length, ok = rfx_process_message_channels(context, &subStream); break; - /* Data messages: - * The data associated with each encoded frame or image is always bracketed by the - * TS_RFX_FRAME_BEGIN (section 2.2.2.3.1) and TS_RFX_FRAME_END (section 2.2.2.3.2) messages. - * There MUST only be one TS_RFX_REGION (section 2.2.2.3.3) message per frame and one TS_RFX_TILESET - * (section 2.2.2.3.4) message per TS_RFX_REGION. - */ + /* Data messages: + * The data associated with each encoded frame or image is always bracketed by the + * TS_RFX_FRAME_BEGIN (section 2.2.2.3.1) and TS_RFX_FRAME_END (section 2.2.2.3.2) + * messages. There MUST only be one TS_RFX_REGION (section 2.2.2.3.3) message per + * frame and one TS_RFX_TILESET (section 2.2.2.3.4) message per TS_RFX_REGION. + */ case WBT_FRAME_BEGIN: - ok = rfx_process_message_frame_begin(context, message, &subStream, &context->expectedDataBlockType); + ok = rfx_process_message_frame_begin(context, message, &subStream, + &context->expectedDataBlockType); break; case WBT_REGION: - ok = rfx_process_message_region(context, message, &subStream, &context->expectedDataBlockType); + ok = rfx_process_message_region(context, message, &subStream, + &context->expectedDataBlockType); break; case WBT_EXTENSION: - ok = rfx_process_message_tileset(context, message, &subStream, &context->expectedDataBlockType); + ok = rfx_process_message_tileset(context, message, &subStream, + &context->expectedDataBlockType); break; case WBT_FRAME_END: - ok = rfx_process_message_frame_end(context, message, &subStream, &context->expectedDataBlockType); + ok = rfx_process_message_frame_end(context, message, &subStream, + &context->expectedDataBlockType); break; default: - WLog_ERR(TAG, "%s: unknown blockType 0x%"PRIX32"", __FUNCTION__, blockType); + WLog_ERR(TAG, "%s: unknown blockType 0x%" PRIX32 "", __FUNCTION__, blockType); return FALSE; } } @@ -1181,9 +1186,9 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length, const UINT32 nWidth = updateRects[j].right - updateRects[j].left; const UINT32 nHeight = updateRects[j].bottom - updateRects[j].top; - if (!freerdp_image_copy(dst, dstFormat, dstStride, - nXDst, nYDst, nWidth, nHeight, - tile->data, context->pixel_format, stride, nXSrc, nYSrc, NULL, FREERDP_FLIP_NONE)) + if (!freerdp_image_copy(dst, dstFormat, dstStride, nXDst, nYDst, nWidth, nHeight, + tile->data, context->pixel_format, stride, nXSrc, nYSrc, + NULL, FREERDP_FLIP_NONE)) { region16_uninit(&updateRegion); return FALSE; @@ -1238,7 +1243,7 @@ void rfx_message_free(RFX_CONTEXT* context, RFX_MESSAGE* message) tile->YCbCrData = NULL; } - ObjectPool_Return(context->priv->TilePool, (void*) tile); + ObjectPool_Return(context->priv->TilePool, (void*)tile); } free(message->tiles); @@ -1253,58 +1258,57 @@ static void rfx_update_context_properties(RFX_CONTEXT* context) { UINT16 properties; /* properties in tilesets: note that this has different format from the one in TS_RFX_CONTEXT */ - properties = 1; /* lt */ - properties |= (context->flags << 1); /* flags */ - properties |= (COL_CONV_ICT << 4); /* cct */ + properties = 1; /* lt */ + properties |= (context->flags << 1); /* flags */ + properties |= (COL_CONV_ICT << 4); /* cct */ properties |= (CLW_XFORM_DWT_53_A << 6); /* xft */ properties |= ((context->mode == RLGR1 ? CLW_ENTROPY_RLGR1 : CLW_ENTROPY_RLGR3) << 10); /* et */ - properties |= (SCALAR_QUANTIZATION << 14); /* qt */ + properties |= (SCALAR_QUANTIZATION << 14); /* qt */ context->properties = properties; } static void rfx_write_message_sync(RFX_CONTEXT* context, wStream* s) { - Stream_Write_UINT16(s, WBT_SYNC); /* BlockT.blockType (2 bytes) */ - Stream_Write_UINT32(s, 12); /* BlockT.blockLen (4 bytes) */ - Stream_Write_UINT32(s, WF_MAGIC); /* magic (4 bytes) */ + Stream_Write_UINT16(s, WBT_SYNC); /* BlockT.blockType (2 bytes) */ + Stream_Write_UINT32(s, 12); /* BlockT.blockLen (4 bytes) */ + Stream_Write_UINT32(s, WF_MAGIC); /* magic (4 bytes) */ Stream_Write_UINT16(s, WF_VERSION_1_0); /* version (2 bytes) */ } static void rfx_write_message_codec_versions(RFX_CONTEXT* context, wStream* s) { Stream_Write_UINT16(s, WBT_CODEC_VERSIONS); /* BlockT.blockType (2 bytes) */ - Stream_Write_UINT32(s, 10); /* BlockT.blockLen (4 bytes) */ - Stream_Write_UINT8(s, 1); /* numCodecs (1 byte) */ - Stream_Write_UINT8(s, 1); /* codecs.codecId (1 byte) */ - Stream_Write_UINT16(s, WF_VERSION_1_0); /* codecs.version (2 bytes) */ + Stream_Write_UINT32(s, 10); /* BlockT.blockLen (4 bytes) */ + Stream_Write_UINT8(s, 1); /* numCodecs (1 byte) */ + Stream_Write_UINT8(s, 1); /* codecs.codecId (1 byte) */ + Stream_Write_UINT16(s, WF_VERSION_1_0); /* codecs.version (2 bytes) */ } static void rfx_write_message_channels(RFX_CONTEXT* context, wStream* s) { - Stream_Write_UINT16(s, WBT_CHANNELS); /* BlockT.blockType (2 bytes) */ - Stream_Write_UINT32(s, 12); /* BlockT.blockLen (4 bytes) */ - Stream_Write_UINT8(s, 1); /* numChannels (1 byte) */ - Stream_Write_UINT8(s, 0); /* Channel.channelId (1 byte) */ - Stream_Write_UINT16(s, context->width); /* Channel.width (2 bytes) */ + Stream_Write_UINT16(s, WBT_CHANNELS); /* BlockT.blockType (2 bytes) */ + Stream_Write_UINT32(s, 12); /* BlockT.blockLen (4 bytes) */ + Stream_Write_UINT8(s, 1); /* numChannels (1 byte) */ + Stream_Write_UINT8(s, 0); /* Channel.channelId (1 byte) */ + Stream_Write_UINT16(s, context->width); /* Channel.width (2 bytes) */ Stream_Write_UINT16(s, context->height); /* Channel.height (2 bytes) */ } static void rfx_write_message_context(RFX_CONTEXT* context, wStream* s) { UINT16 properties; - Stream_Write_UINT16(s, WBT_CONTEXT); /* CodecChannelT.blockType (2 bytes) */ - Stream_Write_UINT32(s, 13); /* CodecChannelT.blockLen (4 bytes) */ - Stream_Write_UINT8(s, 1); /* CodecChannelT.codecId (1 byte) */ - Stream_Write_UINT8(s, 0xFF); /* CodecChannelT.channelId (1 byte) */ - Stream_Write_UINT8(s, 0); /* ctxId (1 byte) */ + Stream_Write_UINT16(s, WBT_CONTEXT); /* CodecChannelT.blockType (2 bytes) */ + Stream_Write_UINT32(s, 13); /* CodecChannelT.blockLen (4 bytes) */ + Stream_Write_UINT8(s, 1); /* CodecChannelT.codecId (1 byte) */ + Stream_Write_UINT8(s, 0xFF); /* CodecChannelT.channelId (1 byte) */ + Stream_Write_UINT8(s, 0); /* ctxId (1 byte) */ Stream_Write_UINT16(s, CT_TILE_64x64); /* tileSize (2 bytes) */ /* properties */ - properties = context->flags; /* flags */ - properties |= (COL_CONV_ICT << 3); /* cct */ + properties = context->flags; /* flags */ + properties |= (COL_CONV_ICT << 3); /* cct */ properties |= (CLW_XFORM_DWT_53_A << 5); /* xft */ - properties |= ((context->mode == RLGR1 ? CLW_ENTROPY_RLGR1 : CLW_ENTROPY_RLGR3) - << 9); /* et */ - properties |= (SCALAR_QUANTIZATION << 13); /* qt */ + properties |= ((context->mode == RLGR1 ? CLW_ENTROPY_RLGR1 : CLW_ENTROPY_RLGR3) << 9); /* et */ + properties |= (SCALAR_QUANTIZATION << 13); /* qt */ Stream_Write_UINT16(s, properties); /* properties (2 bytes) */ rfx_update_context_properties(context); } @@ -1334,17 +1338,17 @@ static BOOL rfx_write_tile(RFX_CONTEXT* context, wStream* s, RFX_TILE* tile) if (!Stream_EnsureRemainingCapacity(s, blockLen)) return FALSE; - Stream_Write_UINT16(s, CBT_TILE); /* BlockT.blockType (2 bytes) */ - Stream_Write_UINT32(s, blockLen); /* BlockT.blockLen (4 bytes) */ - Stream_Write_UINT8(s, tile->quantIdxY); /* quantIdxY (1 byte) */ - Stream_Write_UINT8(s, tile->quantIdxCb); /* quantIdxCb (1 byte) */ - Stream_Write_UINT8(s, tile->quantIdxCr); /* quantIdxCr (1 byte) */ - Stream_Write_UINT16(s, tile->xIdx); /* xIdx (2 bytes) */ - Stream_Write_UINT16(s, tile->yIdx); /* yIdx (2 bytes) */ - Stream_Write_UINT16(s, tile->YLen); /* YLen (2 bytes) */ - Stream_Write_UINT16(s, tile->CbLen); /* CbLen (2 bytes) */ - Stream_Write_UINT16(s, tile->CrLen); /* CrLen (2 bytes) */ - Stream_Write(s, tile->YData, tile->YLen); /* YData */ + Stream_Write_UINT16(s, CBT_TILE); /* BlockT.blockType (2 bytes) */ + Stream_Write_UINT32(s, blockLen); /* BlockT.blockLen (4 bytes) */ + Stream_Write_UINT8(s, tile->quantIdxY); /* quantIdxY (1 byte) */ + Stream_Write_UINT8(s, tile->quantIdxCb); /* quantIdxCb (1 byte) */ + Stream_Write_UINT8(s, tile->quantIdxCr); /* quantIdxCr (1 byte) */ + Stream_Write_UINT16(s, tile->xIdx); /* xIdx (2 bytes) */ + Stream_Write_UINT16(s, tile->yIdx); /* yIdx (2 bytes) */ + Stream_Write_UINT16(s, tile->YLen); /* YLen (2 bytes) */ + Stream_Write_UINT16(s, tile->CbLen); /* CbLen (2 bytes) */ + Stream_Write_UINT16(s, tile->CrLen); /* CrLen (2 bytes) */ + Stream_Write(s, tile->YData, tile->YLen); /* YData */ Stream_Write(s, tile->CbData, tile->CbLen); /* CbData */ Stream_Write(s, tile->CrData, tile->CrLen); /* CrData */ return TRUE; @@ -1356,16 +1360,15 @@ struct _RFX_TILE_COMPOSE_WORK_PARAM RFX_CONTEXT* context; }; -static void CALLBACK rfx_compose_message_tile_work_callback(PTP_CALLBACK_INSTANCE - instance, void* context, PTP_WORK work) +static void CALLBACK rfx_compose_message_tile_work_callback(PTP_CALLBACK_INSTANCE instance, + void* context, PTP_WORK work) { - RFX_TILE_COMPOSE_WORK_PARAM* param = (RFX_TILE_COMPOSE_WORK_PARAM*) context; + RFX_TILE_COMPOSE_WORK_PARAM* param = (RFX_TILE_COMPOSE_WORK_PARAM*)context; rfx_encode_rgb(param->context, param->tile); } - -static BOOL computeRegion(const RFX_RECT* rects, int numRects, REGION16* region, - int width, int height) +static BOOL computeRegion(const RFX_RECT* rects, int numRects, REGION16* region, int width, + int height) { int i; const RFX_RECT* rect = rects; @@ -1396,21 +1399,20 @@ BOOL setupWorkers(RFX_CONTEXT* context, int nbTiles) if (!context->priv->UseThreads) return TRUE; - if (!(pmem = realloc((void*) priv->workObjects, sizeof(PTP_WORK) * nbTiles))) + if (!(pmem = realloc((void*)priv->workObjects, sizeof(PTP_WORK) * nbTiles))) return FALSE; - priv->workObjects = (PTP_WORK*) pmem; + priv->workObjects = (PTP_WORK*)pmem; - if (!(pmem = realloc((void*) priv->tileWorkParams, - sizeof(RFX_TILE_COMPOSE_WORK_PARAM) * nbTiles))) + if (!(pmem = + realloc((void*)priv->tileWorkParams, sizeof(RFX_TILE_COMPOSE_WORK_PARAM) * nbTiles))) return FALSE; - priv->tileWorkParams = (RFX_TILE_COMPOSE_WORK_PARAM*) pmem; + priv->tileWorkParams = (RFX_TILE_COMPOSE_WORK_PARAM*)pmem; return TRUE; } -RFX_MESSAGE* rfx_encode_message(RFX_CONTEXT* context, const RFX_RECT* rects, - int numRects, +RFX_MESSAGE* rfx_encode_message(RFX_CONTEXT* context, const RFX_RECT* rects, int numRects, BYTE* data, int w, int h, int s) { const UINT32 width = (UINT32)w; @@ -1449,8 +1451,7 @@ RFX_MESSAGE* rfx_encode_message(RFX_CONTEXT* context, const RFX_RECT* rects, if (!context->numQuant) { - if (!(context->quants = (UINT32*) malloc(sizeof( - rfx_default_quantization_values)))) + if (!(context->quants = (UINT32*)malloc(sizeof(rfx_default_quantization_values)))) goto skip_encoding_loop; CopyMemory(context->quants, &rfx_default_quantization_values, @@ -1494,8 +1495,7 @@ RFX_MESSAGE* rfx_encode_message(RFX_CONTEXT* context, const RFX_RECT* rects, message->numRects = regionNbRects; - for (i = 0, rfxRect = message->rects; i < regionNbRects; - i++, regionRect++, rfxRect++) + for (i = 0, rfxRect = message->rects; i < regionNbRects; i++, regionRect++, rfxRect++) { UINT32 startTileX = regionRect->left / 64; UINT32 endTileX = (regionRect->right - 1) / 64; @@ -1532,7 +1532,7 @@ RFX_MESSAGE* rfx_encode_message(RFX_CONTEXT* context, const RFX_RECT* rects, if (region16_intersects_rect(&tilesRegion, ¤tTileRect)) continue; - if (!(tile = (RFX_TILE*) ObjectPool_Take(context->priv->TilePool))) + if (!(tile = (RFX_TILE*)ObjectPool_Take(context->priv->TilePool))) goto skip_encoding_loop; tile->xIdx = xIdx; @@ -1560,9 +1560,9 @@ RFX_MESSAGE* rfx_encode_message(RFX_CONTEXT* context, const RFX_RECT* rects, if (!(tile->YCbCrData = (BYTE*)BufferPool_Take(context->priv->BufferPool, -1))) goto skip_encoding_loop; - tile->YData = (BYTE*) & (tile->YCbCrData[((8192 + 32) * 0) + 16]); - tile->CbData = (BYTE*) & (tile->YCbCrData[((8192 + 32) * 1) + 16]); - tile->CrData = (BYTE*) & (tile->YCbCrData[((8192 + 32) * 2) + 16]); + tile->YData = (BYTE*)&(tile->YCbCrData[((8192 + 32) * 0) + 16]); + tile->CbData = (BYTE*)&(tile->YCbCrData[((8192 + 32) * 1) + 16]); + tile->CrData = (BYTE*)&(tile->YCbCrData[((8192 + 32) * 2) + 16]); message->tiles[message->numTiles] = tile; message->numTiles++; @@ -1571,10 +1571,9 @@ RFX_MESSAGE* rfx_encode_message(RFX_CONTEXT* context, const RFX_RECT* rects, workParam->context = context; workParam->tile = tile; - if (!(*workObject = CreateThreadpoolWork( - rfx_compose_message_tile_work_callback, - (void*) workParam, - &context->priv->ThreadPoolEnv))) + if (!(*workObject = CreateThreadpoolWork(rfx_compose_message_tile_work_callback, + (void*)workParam, + &context->priv->ThreadPoolEnv))) { goto skip_encoding_loop; } @@ -1591,8 +1590,8 @@ RFX_MESSAGE* rfx_encode_message(RFX_CONTEXT* context, const RFX_RECT* rects, if (!region16_union_rect(&tilesRegion, &tilesRegion, ¤tTileRect)) goto skip_encoding_loop; } /* xIdx */ - } /* yIdx */ - } /* rects */ + } /* yIdx */ + } /* rects */ success = TRUE; skip_encoding_loop: @@ -1601,11 +1600,10 @@ skip_encoding_loop: { if (message->numTiles > 0) { - void* pmem = realloc((void*) message->tiles, - sizeof(RFX_TILE*) * message->numTiles); + void* pmem = realloc((void*)message->tiles, sizeof(RFX_TILE*) * message->numTiles); if (pmem) - message->tiles = (RFX_TILE**) pmem; + message->tiles = (RFX_TILE**)pmem; else success = FALSE; } @@ -1649,8 +1647,8 @@ skip_encoding_loop: return NULL; } -RFX_MESSAGE* rfx_split_message(RFX_CONTEXT* context, RFX_MESSAGE* message, - int* numMessages, int maxDataSize) +RFX_MESSAGE* rfx_split_message(RFX_CONTEXT* context, RFX_MESSAGE* message, int* numMessages, + int maxDataSize) { int i, j; UINT32 tileDataSize; @@ -1658,7 +1656,7 @@ RFX_MESSAGE* rfx_split_message(RFX_CONTEXT* context, RFX_MESSAGE* message, maxDataSize -= 1024; /* reserve enough space for headers */ *numMessages = ((message->tilesDataSize + maxDataSize) / maxDataSize) * 4; - if (!(messages = (RFX_MESSAGE*) calloc((*numMessages), sizeof(RFX_MESSAGE)))) + if (!(messages = (RFX_MESSAGE*)calloc((*numMessages), sizeof(RFX_MESSAGE)))) return NULL; j = 0; @@ -1667,7 +1665,7 @@ RFX_MESSAGE* rfx_split_message(RFX_CONTEXT* context, RFX_MESSAGE* message, { tileDataSize = rfx_tile_length(message->tiles[i]); - if ((messages[j].tilesDataSize + tileDataSize) > ((UINT32) maxDataSize)) + if ((messages[j].tilesDataSize + tileDataSize) > ((UINT32)maxDataSize)) j++; if (!messages[j].numTiles) @@ -1680,8 +1678,7 @@ RFX_MESSAGE* rfx_split_message(RFX_CONTEXT* context, RFX_MESSAGE* message, messages[j].freeRects = FALSE; messages[j].freeArray = TRUE; - if (!(messages[j].tiles = (RFX_TILE**) calloc(message->numTiles, - sizeof(RFX_TILE*)))) + if (!(messages[j].tiles = (RFX_TILE**)calloc(message->numTiles, sizeof(RFX_TILE*)))) goto free_messages; } @@ -1703,20 +1700,17 @@ free_messages: return NULL; } -RFX_MESSAGE* rfx_encode_messages(RFX_CONTEXT* context, const RFX_RECT* rects, - int numRects, +RFX_MESSAGE* rfx_encode_messages(RFX_CONTEXT* context, const RFX_RECT* rects, int numRects, BYTE* data, int width, int height, int scanline, int* numMessages, int maxDataSize) { RFX_MESSAGE* message; RFX_MESSAGE* messageList; - if (!(message = rfx_encode_message(context, rects, numRects, data, width, - height, scanline))) + if (!(message = rfx_encode_message(context, rects, numRects, data, width, height, scanline))) return NULL; - if (!(messageList = rfx_split_message(context, message, numMessages, - maxDataSize))) + if (!(messageList = rfx_split_message(context, message, numMessages, maxDataSize))) { message->freeRects = TRUE; rfx_message_free(context, message); @@ -1727,8 +1721,7 @@ RFX_MESSAGE* rfx_encode_messages(RFX_CONTEXT* context, const RFX_RECT* rects, return messageList; } -static BOOL rfx_write_message_tileset(RFX_CONTEXT* context, wStream* s, - RFX_MESSAGE* message) +static BOOL rfx_write_message_tileset(RFX_CONTEXT* context, wStream* s, RFX_MESSAGE* message) { int i; RFX_TILE* tile; @@ -1739,16 +1732,16 @@ static BOOL rfx_write_message_tileset(RFX_CONTEXT* context, wStream* s, if (!Stream_EnsureRemainingCapacity(s, blockLen)) return FALSE; - Stream_Write_UINT16(s, WBT_EXTENSION); /* CodecChannelT.blockType (2 bytes) */ - Stream_Write_UINT32(s, blockLen); /* set CodecChannelT.blockLen (4 bytes) */ - Stream_Write_UINT8(s, 1); /* CodecChannelT.codecId (1 byte) */ - Stream_Write_UINT8(s, 0); /* CodecChannelT.channelId (1 byte) */ - Stream_Write_UINT16(s, CBT_TILESET); /* subtype (2 bytes) */ - Stream_Write_UINT16(s, 0); /* idx (2 bytes) */ - Stream_Write_UINT16(s, context->properties); /* properties (2 bytes) */ - Stream_Write_UINT8(s, message->numQuant); /* numQuant (1 byte) */ - Stream_Write_UINT8(s, 0x40); /* tileSize (1 byte) */ - Stream_Write_UINT16(s, message->numTiles); /* numTiles (2 bytes) */ + Stream_Write_UINT16(s, WBT_EXTENSION); /* CodecChannelT.blockType (2 bytes) */ + Stream_Write_UINT32(s, blockLen); /* set CodecChannelT.blockLen (4 bytes) */ + Stream_Write_UINT8(s, 1); /* CodecChannelT.codecId (1 byte) */ + Stream_Write_UINT8(s, 0); /* CodecChannelT.channelId (1 byte) */ + Stream_Write_UINT16(s, CBT_TILESET); /* subtype (2 bytes) */ + Stream_Write_UINT16(s, 0); /* idx (2 bytes) */ + Stream_Write_UINT16(s, context->properties); /* properties (2 bytes) */ + Stream_Write_UINT8(s, message->numQuant); /* numQuant (1 byte) */ + Stream_Write_UINT8(s, 0x40); /* tileSize (1 byte) */ + Stream_Write_UINT16(s, message->numTiles); /* numTiles (2 bytes) */ Stream_Write_UINT32(s, message->tilesDataSize); /* tilesDataSize (4 bytes) */ quantVals = message->quantVals; @@ -1769,29 +1762,27 @@ static BOOL rfx_write_message_tileset(RFX_CONTEXT* context, wStream* s, #ifdef WITH_DEBUG_RFX WLog_Print(context->priv->log, WLOG_DEBUG, - "numQuant: %"PRIu16" numTiles: %"PRIu16" tilesDataSize: %"PRIu32"", + "numQuant: %" PRIu16 " numTiles: %" PRIu16 " tilesDataSize: %" PRIu32 "", message->numQuant, message->numTiles, message->tilesDataSize); #endif return TRUE; } -static BOOL rfx_write_message_frame_begin(RFX_CONTEXT* context, wStream* s, - RFX_MESSAGE* message) +static BOOL rfx_write_message_frame_begin(RFX_CONTEXT* context, wStream* s, RFX_MESSAGE* message) { if (!Stream_EnsureRemainingCapacity(s, 14)) return FALSE; - Stream_Write_UINT16(s, WBT_FRAME_BEGIN); /* CodecChannelT.blockType */ - Stream_Write_UINT32(s, 14); /* CodecChannelT.blockLen */ - Stream_Write_UINT8(s, 1); /* CodecChannelT.codecId */ - Stream_Write_UINT8(s, 0); /* CodecChannelT.channelId */ + Stream_Write_UINT16(s, WBT_FRAME_BEGIN); /* CodecChannelT.blockType */ + Stream_Write_UINT32(s, 14); /* CodecChannelT.blockLen */ + Stream_Write_UINT8(s, 1); /* CodecChannelT.codecId */ + Stream_Write_UINT8(s, 0); /* CodecChannelT.channelId */ Stream_Write_UINT32(s, message->frameIdx); /* frameIdx */ - Stream_Write_UINT16(s, 1); /* numRegions */ + Stream_Write_UINT16(s, 1); /* numRegions */ return TRUE; } -static BOOL rfx_write_message_region(RFX_CONTEXT* context, wStream* s, - RFX_MESSAGE* message) +static BOOL rfx_write_message_region(RFX_CONTEXT* context, wStream* s, RFX_MESSAGE* message) { int i; UINT32 blockLen; @@ -1800,38 +1791,37 @@ static BOOL rfx_write_message_region(RFX_CONTEXT* context, wStream* s, if (!Stream_EnsureRemainingCapacity(s, blockLen)) return FALSE; - Stream_Write_UINT16(s, WBT_REGION); /* CodecChannelT.blockType (2 bytes) */ - Stream_Write_UINT32(s, blockLen); /* set CodecChannelT.blockLen (4 bytes) */ - Stream_Write_UINT8(s, 1); /* CodecChannelT.codecId (1 byte) */ - Stream_Write_UINT8(s, 0); /* CodecChannelT.channelId (1 byte) */ - Stream_Write_UINT8(s, 1); /* regionFlags (1 byte) */ + Stream_Write_UINT16(s, WBT_REGION); /* CodecChannelT.blockType (2 bytes) */ + Stream_Write_UINT32(s, blockLen); /* set CodecChannelT.blockLen (4 bytes) */ + Stream_Write_UINT8(s, 1); /* CodecChannelT.codecId (1 byte) */ + Stream_Write_UINT8(s, 0); /* CodecChannelT.channelId (1 byte) */ + Stream_Write_UINT8(s, 1); /* regionFlags (1 byte) */ Stream_Write_UINT16(s, message->numRects); /* numRects (2 bytes) */ for (i = 0; i < message->numRects; i++) { const RFX_RECT* rect = rfx_message_get_rect(message, i); /* Clipping rectangles are relative to destLeft, destTop */ - Stream_Write_UINT16(s, rect->x); /* x (2 bytes) */ - Stream_Write_UINT16(s, rect->y); /* y (2 bytes) */ - Stream_Write_UINT16(s, rect->width); /* width (2 bytes) */ + Stream_Write_UINT16(s, rect->x); /* x (2 bytes) */ + Stream_Write_UINT16(s, rect->y); /* y (2 bytes) */ + Stream_Write_UINT16(s, rect->width); /* width (2 bytes) */ Stream_Write_UINT16(s, rect->height); /* height (2 bytes) */ } Stream_Write_UINT16(s, CBT_REGION); /* regionType (2 bytes) */ - Stream_Write_UINT16(s, 1); /* numTilesets (2 bytes) */ + Stream_Write_UINT16(s, 1); /* numTilesets (2 bytes) */ return TRUE; } -BOOL rfx_write_message_frame_end(RFX_CONTEXT* context, wStream* s, - RFX_MESSAGE* message) +BOOL rfx_write_message_frame_end(RFX_CONTEXT* context, wStream* s, RFX_MESSAGE* message) { if (!Stream_EnsureRemainingCapacity(s, 8)) return FALSE; Stream_Write_UINT16(s, WBT_FRAME_END); /* CodecChannelT.blockType */ - Stream_Write_UINT32(s, 8); /* CodecChannelT.blockLen */ - Stream_Write_UINT8(s, 1); /* CodecChannelT.codecId */ - Stream_Write_UINT8(s, 0); /* CodecChannelT.channelId */ + Stream_Write_UINT32(s, 8); /* CodecChannelT.blockLen */ + Stream_Write_UINT8(s, 1); /* CodecChannelT.codecId */ + Stream_Write_UINT8(s, 0); /* CodecChannelT.channelId */ return TRUE; } @@ -1856,15 +1846,13 @@ BOOL rfx_write_message(RFX_CONTEXT* context, wStream* s, RFX_MESSAGE* message) return TRUE; } -BOOL rfx_compose_message(RFX_CONTEXT* context, wStream* s, - const RFX_RECT* rects, int numRects, BYTE* data, int width, int height, - int scanline) +BOOL rfx_compose_message(RFX_CONTEXT* context, wStream* s, const RFX_RECT* rects, int numRects, + BYTE* data, int width, int height, int scanline) { RFX_MESSAGE* message; BOOL ret = TRUE; - if (!(message = rfx_encode_message(context, rects, numRects, data, width, - height, scanline))) + if (!(message = rfx_encode_message(context, rects, numRects, data, width, height, scanline))) return FALSE; ret = rfx_write_message(context, s, message); diff --git a/libfreerdp/codec/rfx_bitstream.h b/libfreerdp/codec/rfx_bitstream.h index 655f59274..b2b57ccb6 100644 --- a/libfreerdp/codec/rfx_bitstream.h +++ b/libfreerdp/codec/rfx_bitstream.h @@ -31,62 +31,78 @@ struct _RFX_BITSTREAM }; typedef struct _RFX_BITSTREAM RFX_BITSTREAM; -#define rfx_bitstream_attach(bs, _buffer, _nbytes) do { \ - bs->buffer = (BYTE*) (_buffer); \ - bs->nbytes = (_nbytes); \ - bs->byte_pos = 0; \ - bs->bits_left = 8; } while (0) +#define rfx_bitstream_attach(bs, _buffer, _nbytes) \ + do \ + { \ + bs->buffer = (BYTE*)(_buffer); \ + bs->nbytes = (_nbytes); \ + bs->byte_pos = 0; \ + bs->bits_left = 8; \ + } while (0) -#define rfx_bitstream_get_bits(bs, _nbits, _r) do { \ - int nbits = _nbits; \ - int b; \ - UINT16 n = 0; \ - while (bs->byte_pos < bs->nbytes && nbits > 0) \ - { \ - b = nbits; \ - if (b > bs->bits_left) \ - b = bs->bits_left; \ - if (n) \ - n <<= b; \ - n |= (bs->buffer[bs->byte_pos] >> (bs->bits_left - b)) & ((1 << b) - 1); \ - bs->bits_left -= b; \ - nbits -= b; \ - if (bs->bits_left == 0) \ - { \ - bs->bits_left = 8; \ - bs->byte_pos++; \ - } \ - } \ - _r = n; } while (0) +#define rfx_bitstream_get_bits(bs, _nbits, _r) \ + do \ + { \ + int nbits = _nbits; \ + int b; \ + UINT16 n = 0; \ + while (bs->byte_pos < bs->nbytes && nbits > 0) \ + { \ + b = nbits; \ + if (b > bs->bits_left) \ + b = bs->bits_left; \ + if (n) \ + n <<= b; \ + n |= (bs->buffer[bs->byte_pos] >> (bs->bits_left - b)) & ((1 << b) - 1); \ + bs->bits_left -= b; \ + nbits -= b; \ + if (bs->bits_left == 0) \ + { \ + bs->bits_left = 8; \ + bs->byte_pos++; \ + } \ + } \ + _r = n; \ + } while (0) -#define rfx_bitstream_put_bits(bs, _bits, _nbits) do { \ - UINT16 bits = (_bits); \ - int nbits = (_nbits); \ - int b; \ - while (bs->byte_pos < bs->nbytes && nbits > 0) \ - { \ - b = nbits; \ - if (b > bs->bits_left) \ - b = bs->bits_left; \ - bs->buffer[bs->byte_pos] |= ((bits >> (nbits - b)) & ((1 << b) - 1)) << (bs->bits_left - b); \ - bs->bits_left -= b; \ - nbits -= b; \ - if (bs->bits_left == 0) \ - { \ - bs->bits_left = 8; \ - bs->byte_pos++; \ - } \ - } } while (0) -#define rfx_bitstream_flush(bs) do { \ - if (bs->bits_left != 8) \ - { \ - int _nbits = 8 - bs->bits_left; \ - rfx_bitstream_put_bits(bs, 0, _nbits); \ - } \ - } while(0) +#define rfx_bitstream_put_bits(bs, _bits, _nbits) \ + do \ + { \ + UINT16 bits = (_bits); \ + int nbits = (_nbits); \ + int b; \ + while (bs->byte_pos < bs->nbytes && nbits > 0) \ + { \ + b = nbits; \ + if (b > bs->bits_left) \ + b = bs->bits_left; \ + bs->buffer[bs->byte_pos] |= ((bits >> (nbits - b)) & ((1 << b) - 1)) \ + << (bs->bits_left - b); \ + bs->bits_left -= b; \ + nbits -= b; \ + if (bs->bits_left == 0) \ + { \ + bs->bits_left = 8; \ + bs->byte_pos++; \ + } \ + } \ + } while (0) +#define rfx_bitstream_flush(bs) \ + do \ + { \ + if (bs->bits_left != 8) \ + { \ + int _nbits = 8 - bs->bits_left; \ + rfx_bitstream_put_bits(bs, 0, _nbits); \ + } \ + } while (0) #define rfx_bitstream_eos(_bs) ((_bs)->byte_pos >= (_bs)->nbytes) -#define rfx_bitstream_left(_bs) ((_bs)->byte_pos >= (_bs)->nbytes ? 0 : ((_bs)->nbytes - (_bs)->byte_pos - 1) * 8 + (_bs)->bits_left) -#define rfx_bitstream_get_processed_bytes(_bs) ((_bs)->bits_left < 8 ? (_bs)->byte_pos + 1 : (_bs)->byte_pos) +#define rfx_bitstream_left(_bs) \ + ((_bs)->byte_pos >= (_bs)->nbytes \ + ? 0 \ + : ((_bs)->nbytes - (_bs)->byte_pos - 1) * 8 + (_bs)->bits_left) +#define rfx_bitstream_get_processed_bytes(_bs) \ + ((_bs)->bits_left < 8 ? (_bs)->byte_pos + 1 : (_bs)->byte_pos) #endif /* FREERDP_LIB_CODEC_RFX_BITSTREAM_H */ diff --git a/libfreerdp/codec/rfx_constants.h b/libfreerdp/codec/rfx_constants.h index 43ded828e..a07c356c0 100644 --- a/libfreerdp/codec/rfx_constants.h +++ b/libfreerdp/codec/rfx_constants.h @@ -21,40 +21,39 @@ #define FREERDP_LIB_CODEC_RFX_CONSTANTS_H /* sync */ -#define WF_MAGIC 0xCACCACCA -#define WF_VERSION_1_0 0x0100 +#define WF_MAGIC 0xCACCACCA +#define WF_VERSION_1_0 0x0100 /* blockType */ -#define WBT_SYNC 0xCCC0 -#define WBT_CODEC_VERSIONS 0xCCC1 -#define WBT_CHANNELS 0xCCC2 -#define WBT_CONTEXT 0xCCC3 -#define WBT_FRAME_BEGIN 0xCCC4 -#define WBT_FRAME_END 0xCCC5 -#define WBT_REGION 0xCCC6 -#define WBT_EXTENSION 0xCCC7 -#define CBT_REGION 0xCAC1 -#define CBT_TILESET 0xCAC2 -#define CBT_TILE 0xCAC3 +#define WBT_SYNC 0xCCC0 +#define WBT_CODEC_VERSIONS 0xCCC1 +#define WBT_CHANNELS 0xCCC2 +#define WBT_CONTEXT 0xCCC3 +#define WBT_FRAME_BEGIN 0xCCC4 +#define WBT_FRAME_END 0xCCC5 +#define WBT_REGION 0xCCC6 +#define WBT_EXTENSION 0xCCC7 +#define CBT_REGION 0xCAC1 +#define CBT_TILESET 0xCAC2 +#define CBT_TILE 0xCAC3 /* tileSize */ -#define CT_TILE_64x64 0x0040 +#define CT_TILE_64x64 0x0040 /* properties.flags */ -#define CODEC_MODE 0x02 +#define CODEC_MODE 0x02 /* properties.cct */ -#define COL_CONV_ICT 0x1 +#define COL_CONV_ICT 0x1 /* properties.xft */ -#define CLW_XFORM_DWT_53_A 0x1 +#define CLW_XFORM_DWT_53_A 0x1 /* properties.et */ -#define CLW_ENTROPY_RLGR1 0x01 -#define CLW_ENTROPY_RLGR3 0x04 +#define CLW_ENTROPY_RLGR1 0x01 +#define CLW_ENTROPY_RLGR3 0x04 /* properties.qt */ -#define SCALAR_QUANTIZATION 0x1 +#define SCALAR_QUANTIZATION 0x1 #endif /* FREERDP_LIB_CODEC_RFX_CONSTANTS_H */ - diff --git a/libfreerdp/codec/rfx_decode.c b/libfreerdp/codec/rfx_decode.c index 959fc58e4..8e130ae5c 100644 --- a/libfreerdp/codec/rfx_decode.c +++ b/libfreerdp/codec/rfx_decode.c @@ -37,8 +37,7 @@ #include "rfx_decode.h" -static void rfx_decode_component(RFX_CONTEXT* context, - const UINT32* quantization_values, +static void rfx_decode_component(RFX_CONTEXT* context, const UINT32* quantization_values, const BYTE* data, int size, INT16* buffer) { INT16* dwt_buffer; @@ -63,30 +62,30 @@ static void rfx_decode_component(RFX_CONTEXT* context, /* rfx_decode_ycbcr_to_rgb code now resides in the primitives library. */ /* stride is bytes between rows in the output buffer. */ -BOOL rfx_decode_rgb(RFX_CONTEXT* context, RFX_TILE* tile, BYTE* rgb_buffer, - int stride) +BOOL rfx_decode_rgb(RFX_CONTEXT* context, RFX_TILE* tile, BYTE* rgb_buffer, int stride) { BOOL rc = TRUE; BYTE* pBuffer; INT16* pSrcDst[3]; - UINT32* y_quants, *cb_quants, *cr_quants; + UINT32 *y_quants, *cb_quants, *cr_quants; static const prim_size_t roi_64x64 = { 64, 64 }; const primitives_t* prims = primitives_get(); PROFILER_ENTER(context->priv->prof_rfx_decode_rgb) y_quants = context->quants + (tile->quantIdxY * 10); cb_quants = context->quants + (tile->quantIdxCb * 10); cr_quants = context->quants + (tile->quantIdxCr * 10); - pBuffer = (BYTE*) BufferPool_Take(context->priv->BufferPool, -1); - pSrcDst[0] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 0) + 16])); /* y_r_buffer */ - pSrcDst[1] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 1) + 16])); /* cb_g_buffer */ - pSrcDst[2] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 2) + 16])); /* cr_b_buffer */ + pBuffer = (BYTE*)BufferPool_Take(context->priv->BufferPool, -1); + pSrcDst[0] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 0) + 16])); /* y_r_buffer */ + pSrcDst[1] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 1) + 16])); /* cb_g_buffer */ + pSrcDst[2] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 2) + 16])); /* cr_b_buffer */ rfx_decode_component(context, y_quants, tile->YData, tile->YLen, pSrcDst[0]); /* YData */ rfx_decode_component(context, cb_quants, tile->CbData, tile->CbLen, pSrcDst[1]); /* CbData */ rfx_decode_component(context, cr_quants, tile->CrData, tile->CrLen, pSrcDst[2]); /* CrData */ PROFILER_ENTER(context->priv->prof_rfx_ycbcr_to_rgb) - if (prims->yCbCrToRGB_16s8u_P3AC4R((const INT16**)pSrcDst, 64 * sizeof(INT16), - rgb_buffer, stride, context->pixel_format, &roi_64x64) != PRIMITIVES_SUCCESS) + if (prims->yCbCrToRGB_16s8u_P3AC4R((const INT16**)pSrcDst, 64 * sizeof(INT16), rgb_buffer, + stride, context->pixel_format, + &roi_64x64) != PRIMITIVES_SUCCESS) rc = FALSE; PROFILER_EXIT(context->priv->prof_rfx_ycbcr_to_rgb) diff --git a/libfreerdp/codec/rfx_decode.h b/libfreerdp/codec/rfx_decode.h index 9bf9cd94d..11dcf9f5f 100644 --- a/libfreerdp/codec/rfx_decode.h +++ b/libfreerdp/codec/rfx_decode.h @@ -24,8 +24,7 @@ #include /* stride is bytes between rows in the output buffer. */ -FREERDP_LOCAL BOOL rfx_decode_rgb(RFX_CONTEXT* context, RFX_TILE* tile, - BYTE* rgb_buffer, int stride); +FREERDP_LOCAL BOOL rfx_decode_rgb(RFX_CONTEXT* context, RFX_TILE* tile, BYTE* rgb_buffer, + int stride); #endif /* FREERDP_LIB_CODEC_RFX_DECODE_H */ - diff --git a/libfreerdp/codec/rfx_dwt.c b/libfreerdp/codec/rfx_dwt.c index 7e3b3ccc4..08fb044c2 100644 --- a/libfreerdp/codec/rfx_dwt.c +++ b/libfreerdp/codec/rfx_dwt.c @@ -38,7 +38,8 @@ static void rfx_dwt_2d_decode_block(INT16* buffer, INT16* idwt, int subband_widt total_width = subband_width << 1; - /* Inverse DWT in horizontal direction, results in 2 sub-bands in L, H order in tmp buffer idwt. */ + /* Inverse DWT in horizontal direction, results in 2 sub-bands in L, H order in tmp buffer idwt. + */ /* The 4 sub-bands are stored in HL(0), LH(1), HH(2), LL(3) order. */ /* The lower part L uses LL(3) and HL(0). */ /* The higher part H uses LH(1) and HH(2). */ @@ -59,12 +60,12 @@ static void rfx_dwt_2d_decode_block(INT16* buffer, INT16* idwt, int subband_widt for (n = 1; n < subband_width; n++) { x = n << 1; - l_dst[x] = ll[n] - ((hl[n-1] + hl[n] + 1) >> 1); - h_dst[x] = lh[n] - ((hh[n-1] + hh[n] + 1) >> 1); + l_dst[x] = ll[n] - ((hl[n - 1] + hl[n] + 1) >> 1); + h_dst[x] = lh[n] - ((hh[n - 1] + hh[n] + 1) >> 1); } /* Odd coefficients */ - for (n = 0; n < subband_width-1; n++) + for (n = 0; n < subband_width - 1; n++) { x = n << 1; l_dst[x + 1] = (hl[n] << 1) + ((l_dst[x] + l_dst[x + 2]) >> 1); @@ -72,7 +73,7 @@ static void rfx_dwt_2d_decode_block(INT16* buffer, INT16* idwt, int subband_widt } x = n << 1; l_dst[x + 1] = (hl[n] << 1) + (l_dst[x]); - h_dst[x + 1] = (hh[n] << 1) + (h_dst[x]); + h_dst[x + 1] = (hh[n] << 1) + (h_dst[x]); ll += subband_width; hl += subband_width; @@ -103,7 +104,8 @@ static void rfx_dwt_2d_decode_block(INT16* buffer, INT16* idwt, int subband_widt dst = buffer + y * total_width + x; l = idwt + n * total_width + x; h = l + subband_width * total_width; - dst[total_width] = (*h << 1) + ((dst[0] + dst[n < subband_width - 1 ? 2 * total_width : 0]) >> 1); + dst[total_width] = + (*h << 1) + ((dst[0] + dst[n < subband_width - 1 ? 2 * total_width : 0]) >> 1); } } } @@ -137,14 +139,17 @@ static void rfx_dwt_2d_encode_block(INT16* buffer, INT16* dwt, int subband_width src = buffer + y * total_width + x; /* H */ - *h = (src[total_width] - ((src[0] + src[n < subband_width - 1 ? 2 * total_width : 0]) >> 1)) >> 1; + *h = (src[total_width] - + ((src[0] + src[n < subband_width - 1 ? 2 * total_width : 0]) >> 1)) >> + 1; /* L */ *l = src[0] + (n == 0 ? *h : (*(h - total_width) + *h) >> 1); } } - /* DWT in horizontal direction, results in 4 sub-bands in HL(0), LH(1), HH(2), LL(3) order, stored in original buffer. */ + /* DWT in horizontal direction, results in 4 sub-bands in HL(0), LH(1), HH(2), LL(3) order, + * stored in original buffer. */ /* The lower part L generates LL(3) and HL(0). */ /* The higher part H generates LH(1) and HH(2). */ @@ -164,7 +169,8 @@ static void rfx_dwt_2d_encode_block(INT16* buffer, INT16* dwt, int subband_width x = n << 1; /* HL */ - hl[n] = (l_src[x + 1] - ((l_src[x] + l_src[n < subband_width - 1 ? x + 2 : x]) >> 1)) >> 1; + hl[n] = + (l_src[x + 1] - ((l_src[x] + l_src[n < subband_width - 1 ? x + 2 : x]) >> 1)) >> 1; /* LL */ ll[n] = l_src[x] + (n == 0 ? hl[n] : (hl[n - 1] + hl[n]) >> 1); } @@ -175,7 +181,8 @@ static void rfx_dwt_2d_encode_block(INT16* buffer, INT16* dwt, int subband_width x = n << 1; /* HH */ - hh[n] = (h_src[x + 1] - ((h_src[x] + h_src[n < subband_width - 1 ? x + 2 : x]) >> 1)) >> 1; + hh[n] = + (h_src[x + 1] - ((h_src[x] + h_src[n < subband_width - 1 ? x + 2 : x]) >> 1)) >> 1; /* LH */ lh[n] = h_src[x] + (n == 0 ? hh[n] : (hh[n - 1] + hh[n]) >> 1); } diff --git a/libfreerdp/codec/rfx_encode.c b/libfreerdp/codec/rfx_encode.c index 1ee102ac5..b4f393605 100644 --- a/libfreerdp/codec/rfx_encode.c +++ b/libfreerdp/codec/rfx_encode.c @@ -39,19 +39,18 @@ #include "rfx_encode.h" -#define MINMAX(_v,_l,_h) ((_v) < (_l) ? (_l) : ((_v) > (_h) ? (_h) : (_v))) +#define MINMAX(_v, _l, _h) ((_v) < (_l) ? (_l) : ((_v) > (_h) ? (_h) : (_v))) -static void rfx_encode_format_rgb(const BYTE* rgb_data, int width, int height, - int rowstride, - UINT32 pixel_format, const BYTE* palette, INT16* r_buf, INT16* g_buf, - INT16* b_buf) +static void rfx_encode_format_rgb(const BYTE* rgb_data, int width, int height, int rowstride, + UINT32 pixel_format, const BYTE* palette, INT16* r_buf, + INT16* g_buf, INT16* b_buf) { int x, y; int x_exceed; int y_exceed; const BYTE* src; INT16 r, g, b; - INT16* r_last, *g_last, *b_last; + INT16 *r_last, *g_last, *b_last; x_exceed = 64 - width; y_exceed = 64 - height; @@ -165,9 +164,9 @@ static void rfx_encode_format_rgb(const BYTE* rgb_data, int width, int height, idx |= (((*(src + 2)) >> shift) & 1) << 2; idx |= (((*(src + 3)) >> shift) & 1) << 3; idx *= 3; - *r_buf++ = (INT16) palette[idx]; - *g_buf++ = (INT16) palette[idx + 1]; - *b_buf++ = (INT16) palette[idx + 2]; + *r_buf++ = (INT16)palette[idx]; + *g_buf++ = (INT16)palette[idx + 1]; + *b_buf++ = (INT16)palette[idx + 2]; if (shift == 0) src += 4; @@ -182,9 +181,9 @@ static void rfx_encode_format_rgb(const BYTE* rgb_data, int width, int height, for (x = 0; x < width; x++) { int idx = (*src) * 3; - *r_buf++ = (INT16) palette[idx]; - *g_buf++ = (INT16) palette[idx + 1]; - *b_buf++ = (INT16) palette[idx + 2]; + *r_buf++ = (INT16)palette[idx]; + *g_buf++ = (INT16)palette[idx + 1]; + *b_buf++ = (INT16)palette[idx + 2]; src++; } @@ -194,7 +193,8 @@ static void rfx_encode_format_rgb(const BYTE* rgb_data, int width, int height, break; } - /* Fill the horizontal region outside of 64x64 tile size with the right-most pixel for best quality */ + /* Fill the horizontal region outside of 64x64 tile size with the right-most pixel for best + * quality */ if (x_exceed > 0) { r = *(r_buf - 1); @@ -232,8 +232,7 @@ static void rfx_encode_format_rgb(const BYTE* rgb_data, int width, int height, /* rfx_encode_rgb_to_ycbcr code now resides in the primitives library. */ -static void rfx_encode_component(RFX_CONTEXT* context, - const UINT32* quantization_values, +static void rfx_encode_component(RFX_CONTEXT* context, const UINT32* quantization_values, INT16* data, BYTE* buffer, int buffer_size, int* size) { INT16* dwt_buffer; @@ -260,31 +259,29 @@ void rfx_encode_rgb(RFX_CONTEXT* context, RFX_TILE* tile) BYTE* pBuffer; INT16* pSrcDst[3]; int YLen, CbLen, CrLen; - UINT32* YQuant, *CbQuant, *CrQuant; + UINT32 *YQuant, *CbQuant, *CrQuant; primitives_t* prims = primitives_get(); static const prim_size_t roi_64x64 = { 64, 64 }; - if (!(pBuffer = (BYTE*) BufferPool_Take(context->priv->BufferPool, -1))) + if (!(pBuffer = (BYTE*)BufferPool_Take(context->priv->BufferPool, -1))) return; YLen = CbLen = CrLen = 0; YQuant = context->quants + (tile->quantIdxY * 10); CbQuant = context->quants + (tile->quantIdxCb * 10); CrQuant = context->quants + (tile->quantIdxCr * 10); - pSrcDst[0] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 0) + - 16])); /* y_r_buffer */ - pSrcDst[1] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 1) + - 16])); /* cb_g_buffer */ - pSrcDst[2] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 2) + - 16])); /* cr_b_buffer */ + pSrcDst[0] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 0) + 16])); /* y_r_buffer */ + pSrcDst[1] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 1) + 16])); /* cb_g_buffer */ + pSrcDst[2] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 2) + 16])); /* cr_b_buffer */ PROFILER_ENTER(context->priv->prof_rfx_encode_rgb) PROFILER_ENTER(context->priv->prof_rfx_encode_format_rgb) rfx_encode_format_rgb(tile->data, tile->width, tile->height, tile->scanline, - context->pixel_format, context->palette, pSrcDst[0], pSrcDst[1], pSrcDst[2]); + context->pixel_format, context->palette, pSrcDst[0], pSrcDst[1], + pSrcDst[2]); PROFILER_EXIT(context->priv->prof_rfx_encode_format_rgb) PROFILER_ENTER(context->priv->prof_rfx_rgb_to_ycbcr) - prims->RGBToYCbCr_16s16s_P3P3((const INT16**) pSrcDst, 64 * sizeof(INT16), - pSrcDst, 64 * sizeof(INT16), &roi_64x64); + prims->RGBToYCbCr_16s16s_P3P3((const INT16**)pSrcDst, 64 * sizeof(INT16), pSrcDst, + 64 * sizeof(INT16), &roi_64x64); PROFILER_EXIT(context->priv->prof_rfx_rgb_to_ycbcr) /** * We need to clear the buffers as the RLGR encoder expects it to be initialized to zero. @@ -296,9 +293,9 @@ void rfx_encode_rgb(RFX_CONTEXT* context, RFX_TILE* tile) rfx_encode_component(context, YQuant, pSrcDst[0], tile->YData, 4096, &YLen); rfx_encode_component(context, CbQuant, pSrcDst[1], tile->CbData, 4096, &CbLen); rfx_encode_component(context, CrQuant, pSrcDst[2], tile->CrData, 4096, &CrLen); - tile->YLen = (UINT16) YLen; - tile->CbLen = (UINT16) CbLen; - tile->CrLen = (UINT16) CrLen; + tile->YLen = (UINT16)YLen; + tile->CbLen = (UINT16)CbLen; + tile->CrLen = (UINT16)CrLen; PROFILER_EXIT(context->priv->prof_rfx_encode_rgb) BufferPool_Return(context->priv->BufferPool, pBuffer); } diff --git a/libfreerdp/codec/rfx_encode.h b/libfreerdp/codec/rfx_encode.h index ad6ab0e06..008064533 100644 --- a/libfreerdp/codec/rfx_encode.h +++ b/libfreerdp/codec/rfx_encode.h @@ -26,4 +26,3 @@ FREERDP_LOCAL void rfx_encode_rgb(RFX_CONTEXT* context, RFX_TILE* tile); #endif /* FREERDP_LIB_CODEC_RFX_ENCODE_H */ - diff --git a/libfreerdp/codec/rfx_neon.c b/libfreerdp/codec/rfx_neon.c index bd2578b6c..7c719f91f 100644 --- a/libfreerdp/codec/rfx_neon.c +++ b/libfreerdp/codec/rfx_neon.c @@ -47,26 +47,23 @@ rfx_quantization_decode_block_NEON(INT16* buffer, const int buffer_size, const U val = vshlq_s16(val, quantFactors); vst1q_s16((INT16*)buf, val); buf++; - } - while (buf < buf_end); + } while (buf < buf_end); } void rfx_quantization_decode_NEON(INT16* buffer, const UINT32* quantVals) { - rfx_quantization_decode_block_NEON(&buffer[0], 1024, quantVals[8] - 1); /* HL1 */ + rfx_quantization_decode_block_NEON(&buffer[0], 1024, quantVals[8] - 1); /* HL1 */ rfx_quantization_decode_block_NEON(&buffer[1024], 1024, quantVals[7] - 1); /* LH1 */ rfx_quantization_decode_block_NEON(&buffer[2048], 1024, quantVals[9] - 1); /* HH1 */ - rfx_quantization_decode_block_NEON(&buffer[3072], 256, quantVals[5] - 1); /* HL2 */ - rfx_quantization_decode_block_NEON(&buffer[3328], 256, quantVals[4] - 1); /* LH2 */ - rfx_quantization_decode_block_NEON(&buffer[3584], 256, quantVals[6] - 1); /* HH2 */ - rfx_quantization_decode_block_NEON(&buffer[3840], 64, quantVals[2] - 1); /* HL3 */ - rfx_quantization_decode_block_NEON(&buffer[3904], 64, quantVals[1] - 1); /* LH3 */ - rfx_quantization_decode_block_NEON(&buffer[3968], 64, quantVals[3] - 1); /* HH3 */ - rfx_quantization_decode_block_NEON(&buffer[4032], 64, quantVals[0] - 1); /* LL3 */ + rfx_quantization_decode_block_NEON(&buffer[3072], 256, quantVals[5] - 1); /* HL2 */ + rfx_quantization_decode_block_NEON(&buffer[3328], 256, quantVals[4] - 1); /* LH2 */ + rfx_quantization_decode_block_NEON(&buffer[3584], 256, quantVals[6] - 1); /* HH2 */ + rfx_quantization_decode_block_NEON(&buffer[3840], 64, quantVals[2] - 1); /* HL3 */ + rfx_quantization_decode_block_NEON(&buffer[3904], 64, quantVals[1] - 1); /* LH3 */ + rfx_quantization_decode_block_NEON(&buffer[3968], 64, quantVals[3] - 1); /* HH3 */ + rfx_quantization_decode_block_NEON(&buffer[4032], 64, quantVals[0] - 1); /* LL3 */ } - - static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) rfx_dwt_2d_decode_block_horiz_NEON(INT16* l, INT16* h, INT16* dst, int subband_width) { @@ -204,9 +201,10 @@ rfx_dwt_2d_decode_block_vert_NEON(INT16* l, INT16* h, INT16* dst, int subband_wi static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) rfx_dwt_2d_decode_block_NEON(INT16* buffer, INT16* idwt, int subband_width) { - INT16* hl, * lh, * hh, * ll; - INT16* l_dst, * h_dst; - /* Inverse DWT in horizontal direction, results in 2 sub-bands in L, H order in tmp buffer idwt. */ + INT16 *hl, *lh, *hh, *ll; + INT16 *l_dst, *h_dst; + /* Inverse DWT in horizontal direction, results in 2 sub-bands in L, H order in tmp buffer idwt. + */ /* The 4 sub-bands are stored in HL(0), LH(1), HH(2), LL(3) order. */ /* The lower part L uses LL(3) and HL(0). */ /* The higher part H uses LH(1) and HH(2). */ @@ -235,7 +233,8 @@ void rfx_init_neon(RFX_CONTEXT* context) { DEBUG_RFX("Using NEON optimizations"); PROFILER_RENAME(context->priv->prof_rfx_ycbcr_to_rgb, "rfx_decode_YCbCr_to_RGB_NEON"); - PROFILER_RENAME(context->priv->prof_rfx_quantization_decode, "rfx_quantization_decode_NEON"); + PROFILER_RENAME(context->priv->prof_rfx_quantization_decode, + "rfx_quantization_decode_NEON"); PROFILER_RENAME(context->priv->prof_rfx_dwt_2d_decode, "rfx_dwt_2d_decode_NEON"); context->quantization_decode = rfx_quantization_decode_NEON; context->dwt_2d_decode = rfx_dwt_2d_decode_NEON; @@ -243,4 +242,3 @@ void rfx_init_neon(RFX_CONTEXT* context) } #endif // __ARM_NEON__ - diff --git a/libfreerdp/codec/rfx_neon.h b/libfreerdp/codec/rfx_neon.h index b6216c38a..ecb3ec08f 100644 --- a/libfreerdp/codec/rfx_neon.h +++ b/libfreerdp/codec/rfx_neon.h @@ -32,4 +32,3 @@ FREERDP_LOCAL void rfx_init_neon(RFX_CONTEXT* context); #endif #endif /* FREERDP_LIB_CODEC_RFX_NEON_H */ - diff --git a/libfreerdp/codec/rfx_quantization.c b/libfreerdp/codec/rfx_quantization.c index 6c497a65a..f9fd33a00 100644 --- a/libfreerdp/codec/rfx_quantization.c +++ b/libfreerdp/codec/rfx_quantization.c @@ -43,7 +43,8 @@ * LL3 4032 8x8 64 */ -void rfx_quantization_decode_block(const primitives_t *prims, INT16* buffer, int buffer_size, UINT32 factor) +void rfx_quantization_decode_block(const primitives_t* prims, INT16* buffer, int buffer_size, + UINT32 factor) { if (factor == 0) return; @@ -55,16 +56,16 @@ void rfx_quantization_decode(INT16* buffer, const UINT32* quantVals) { const primitives_t* prims = primitives_get(); - rfx_quantization_decode_block(prims, &buffer[0], 1024, quantVals[8] - 1); /* HL1 */ + rfx_quantization_decode_block(prims, &buffer[0], 1024, quantVals[8] - 1); /* HL1 */ rfx_quantization_decode_block(prims, &buffer[1024], 1024, quantVals[7] - 1); /* LH1 */ rfx_quantization_decode_block(prims, &buffer[2048], 1024, quantVals[9] - 1); /* HH1 */ - rfx_quantization_decode_block(prims, &buffer[3072], 256, quantVals[5] - 1); /* HL2 */ - rfx_quantization_decode_block(prims, &buffer[3328], 256, quantVals[4] - 1); /* LH2 */ - rfx_quantization_decode_block(prims, &buffer[3584], 256, quantVals[6] - 1); /* HH2 */ - rfx_quantization_decode_block(prims, &buffer[3840], 64, quantVals[2] - 1); /* HL3 */ - rfx_quantization_decode_block(prims, &buffer[3904], 64, quantVals[1] - 1); /* LH3 */ - rfx_quantization_decode_block(prims, &buffer[3968], 64, quantVals[3] - 1); /* HH3 */ - rfx_quantization_decode_block(prims, &buffer[4032], 64, quantVals[0] - 1); /* LL3 */ + rfx_quantization_decode_block(prims, &buffer[3072], 256, quantVals[5] - 1); /* HL2 */ + rfx_quantization_decode_block(prims, &buffer[3328], 256, quantVals[4] - 1); /* LH2 */ + rfx_quantization_decode_block(prims, &buffer[3584], 256, quantVals[6] - 1); /* HH2 */ + rfx_quantization_decode_block(prims, &buffer[3840], 64, quantVals[2] - 1); /* HL3 */ + rfx_quantization_decode_block(prims, &buffer[3904], 64, quantVals[1] - 1); /* LH3 */ + rfx_quantization_decode_block(prims, &buffer[3968], 64, quantVals[3] - 1); /* HH3 */ + rfx_quantization_decode_block(prims, &buffer[4032], 64, quantVals[0] - 1); /* LL3 */ } static void rfx_quantization_encode_block(INT16* buffer, int buffer_size, UINT32 factor) @@ -85,16 +86,16 @@ static void rfx_quantization_encode_block(INT16* buffer, int buffer_size, UINT32 void rfx_quantization_encode(INT16* buffer, const UINT32* quantization_values) { - rfx_quantization_encode_block(buffer, 1024, quantization_values[8] - 6); /* HL1 */ + rfx_quantization_encode_block(buffer, 1024, quantization_values[8] - 6); /* HL1 */ rfx_quantization_encode_block(buffer + 1024, 1024, quantization_values[7] - 6); /* LH1 */ rfx_quantization_encode_block(buffer + 2048, 1024, quantization_values[9] - 6); /* HH1 */ - rfx_quantization_encode_block(buffer + 3072, 256, quantization_values[5] - 6); /* HL2 */ - rfx_quantization_encode_block(buffer + 3328, 256, quantization_values[4] - 6); /* LH2 */ - rfx_quantization_encode_block(buffer + 3584, 256, quantization_values[6] - 6); /* HH2 */ - rfx_quantization_encode_block(buffer + 3840, 64, quantization_values[2] - 6); /* HL3 */ - rfx_quantization_encode_block(buffer + 3904, 64, quantization_values[1] - 6); /* LH3 */ - rfx_quantization_encode_block(buffer + 3968, 64, quantization_values[3] - 6); /* HH3 */ - rfx_quantization_encode_block(buffer + 4032, 64, quantization_values[0] - 6); /* LL3 */ + rfx_quantization_encode_block(buffer + 3072, 256, quantization_values[5] - 6); /* HL2 */ + rfx_quantization_encode_block(buffer + 3328, 256, quantization_values[4] - 6); /* LH2 */ + rfx_quantization_encode_block(buffer + 3584, 256, quantization_values[6] - 6); /* HH2 */ + rfx_quantization_encode_block(buffer + 3840, 64, quantization_values[2] - 6); /* HL3 */ + rfx_quantization_encode_block(buffer + 3904, 64, quantization_values[1] - 6); /* LH3 */ + rfx_quantization_encode_block(buffer + 3968, 64, quantization_values[3] - 6); /* HH3 */ + rfx_quantization_encode_block(buffer + 4032, 64, quantization_values[0] - 6); /* LL3 */ /* The coefficients are scaled by << 5 at RGB->YCbCr phase, so we round it back here */ rfx_quantization_encode_block(buffer, 4096, 5); diff --git a/libfreerdp/codec/rfx_quantization.h b/libfreerdp/codec/rfx_quantization.h index 9349c8976..ae6349d3c 100644 --- a/libfreerdp/codec/rfx_quantization.h +++ b/libfreerdp/codec/rfx_quantization.h @@ -23,12 +23,10 @@ #include #include -FREERDP_LOCAL void rfx_quantization_decode(INT16* buffer, - const UINT32* quantization_values); -FREERDP_LOCAL void rfx_quantization_encode(INT16* buffer, - const UINT32* quantization_values); +FREERDP_LOCAL void rfx_quantization_decode(INT16* buffer, const UINT32* quantization_values); +FREERDP_LOCAL void rfx_quantization_encode(INT16* buffer, const UINT32* quantization_values); -FREERDP_LOCAL void rfx_quantization_decode_block(const primitives_t* prims, - INT16* buffer, int buffer_size, UINT32 factor); +FREERDP_LOCAL void rfx_quantization_decode_block(const primitives_t* prims, INT16* buffer, + int buffer_size, UINT32 factor); #endif /* FREERDP_LIB_CODEC_RFX_QUANTIZATION_H */ diff --git a/libfreerdp/codec/rfx_rlgr.c b/libfreerdp/codec/rfx_rlgr.c index d117275be..655739244 100644 --- a/libfreerdp/codec/rfx_rlgr.c +++ b/libfreerdp/codec/rfx_rlgr.c @@ -41,44 +41,44 @@ #include "rfx_rlgr.h" /* Constants used in RLGR1/RLGR3 algorithm */ -#define KPMAX (80) /* max value for kp or krp */ -#define LSGR (3) /* shift count to convert kp to k */ -#define UP_GR (4) /* increase in kp after a zero run in RL mode */ -#define DN_GR (6) /* decrease in kp after a nonzero symbol in RL mode */ -#define UQ_GR (3) /* increase in kp after nonzero symbol in GR mode */ -#define DQ_GR (3) /* decrease in kp after zero symbol in GR mode */ +#define KPMAX (80) /* max value for kp or krp */ +#define LSGR (3) /* shift count to convert kp to k */ +#define UP_GR (4) /* increase in kp after a zero run in RL mode */ +#define DN_GR (6) /* decrease in kp after a nonzero symbol in RL mode */ +#define UQ_GR (3) /* increase in kp after nonzero symbol in GR mode */ +#define DQ_GR (3) /* decrease in kp after zero symbol in GR mode */ /* Returns the least number of bits required to represent a given value */ #define GetMinBits(_val, _nbits) \ -{ \ - UINT32 _v = _val; \ - _nbits = 0; \ - while (_v) \ - { \ - _v >>= 1; \ - _nbits++; \ - } \ -} + { \ + UINT32 _v = _val; \ + _nbits = 0; \ + while (_v) \ + { \ + _v >>= 1; \ + _nbits++; \ + } \ + } /* * Update the passed parameter and clamp it to the range [0, KPMAX] * Return the value of parameter right-shifted by LSGR */ #define UpdateParam(_param, _deltaP, _k) \ -{ \ - _param += _deltaP; \ - if (_param > KPMAX) \ - _param = KPMAX; \ - if (_param < 0) \ - _param = 0; \ - _k = (_param >> LSGR); \ -} + { \ + _param += _deltaP; \ + if (_param > KPMAX) \ + _param = KPMAX; \ + if (_param < 0) \ + _param = 0; \ + _k = (_param >> LSGR); \ + } static BOOL g_LZCNT = FALSE; static INIT_ONCE rfx_rlgr_init_once = INIT_ONCE_STATIC_INIT; -static BOOL CALLBACK rfx_rlgr_init(PINIT_ONCE once, PVOID param, PVOID *context) +static BOOL CALLBACK rfx_rlgr_init(PINIT_ONCE once, PVOID param, PVOID* context) { g_LZCNT = IsProcessorFeaturePresentEx(PF_EX_LZCNT); return TRUE; @@ -88,23 +88,46 @@ static INLINE UINT32 lzcnt_s(UINT32 x) { if (!x) return 32; - + if (!g_LZCNT) { UINT32 y; int n = 32; - y = x >> 16; if (y != 0) { n = n - 16; x = y; } - y = x >> 8; if (y != 0) { n = n - 8; x = y; } - y = x >> 4; if (y != 0) { n = n - 4; x = y; } - y = x >> 2; if (y != 0) { n = n - 2; x = y; } - y = x >> 1; if (y != 0) return n - 2; + y = x >> 16; + if (y != 0) + { + n = n - 16; + x = y; + } + y = x >> 8; + if (y != 0) + { + n = n - 8; + x = y; + } + y = x >> 4; + if (y != 0) + { + n = n - 4; + x = y; + } + y = x >> 2; + if (y != 0) + { + n = n - 2; + x = y; + } + y = x >> 1; + if (y != 0) + return n - 2; return n - x; } return __lzcnt(x); } -int rfx_rlgr_decode(RLGR_MODE mode, const BYTE* pSrcData, UINT32 SrcSize, INT16* pDstData, UINT32 DstSize) +int rfx_rlgr_decode(RLGR_MODE mode, const BYTE* pSrcData, UINT32 SrcSize, INT16* pDstData, + UINT32 DstSize) { int vk; int run; @@ -259,7 +282,7 @@ int rfx_rlgr_decode(RLGR_MODE mode, const BYTE* pSrcData, UINT32 SrcSize, INT16* break; bs->mask = ((1 << kr) - 1); - code = (UINT16) ((bs->accumulator >> (32 - kr)) & bs->mask); + code = (UINT16)((bs->accumulator >> (32 - kr)) & bs->mask); BitStream_Shift(bs, kr); /* add (vk << kr) to code */ @@ -301,9 +324,9 @@ int rfx_rlgr_decode(RLGR_MODE mode, const BYTE* pSrcData, UINT32 SrcSize, INT16* /* compute magnitude from code */ if (sign) - mag = ((INT16) (code + 1)) * -1; + mag = ((INT16)(code + 1)) * -1; else - mag = (INT16) (code + 1); + mag = (INT16)(code + 1); /* write to output stream */ @@ -367,7 +390,7 @@ int rfx_rlgr_decode(RLGR_MODE mode, const BYTE* pSrcData, UINT32 SrcSize, INT16* break; bs->mask = ((1 << kr) - 1); - code = (UINT16) ((bs->accumulator >> (32 - kr)) & bs->mask); + code = (UINT16)((bs->accumulator >> (32 - kr)) & bs->mask); BitStream_Shift(bs, kr); /* add (vk << kr) to code */ @@ -429,9 +452,9 @@ int rfx_rlgr_decode(RLGR_MODE mode, const BYTE* pSrcData, UINT32 SrcSize, INT16* */ if (code & 1) - mag = ((INT16) ((code + 1) >> 1)) * -1; + mag = ((INT16)((code + 1) >> 1)) * -1; else - mag = (INT16) (code >> 1); + mag = (INT16)(code >> 1); } if ((pOutput - pDstData) < DstSize) @@ -446,7 +469,7 @@ int rfx_rlgr_decode(RLGR_MODE mode, const BYTE* pSrcData, UINT32 SrcSize, INT16* if (code) { - mag = (UINT32) code; + mag = (UINT32)code; nIdx = 32 - lzcnt_s(mag); } @@ -483,9 +506,9 @@ int rfx_rlgr_decode(RLGR_MODE mode, const BYTE* pSrcData, UINT32 SrcSize, INT16* } if (val1 & 1) - mag = ((INT16) ((val1 + 1) >> 1)) * -1; + mag = ((INT16)((val1 + 1) >> 1)) * -1; else - mag = (INT16) (val1 >> 1); + mag = (INT16)(val1 >> 1); if ((pOutput - pDstData) < DstSize) { @@ -494,9 +517,9 @@ int rfx_rlgr_decode(RLGR_MODE mode, const BYTE* pSrcData, UINT32 SrcSize, INT16* } if (val2 & 1) - mag = ((INT16) ((val2 + 1) >> 1)) * -1; + mag = ((INT16)((val2 + 1) >> 1)) * -1; else - mag = (INT16) (val2 >> 1); + mag = (INT16)(val2 >> 1); if ((pOutput - pDstData) < DstSize) { @@ -525,33 +548,34 @@ int rfx_rlgr_decode(RLGR_MODE mode, const BYTE* pSrcData, UINT32 SrcSize, INT16* } /* Returns the next coefficient (a signed int) to encode, from the input stream */ -#define GetNextInput(_n) \ -{ \ - if (data_size > 0) \ - { \ - _n = *data++; \ - data_size--; \ - } \ - else \ - { \ - _n = 0; \ - } \ -} +#define GetNextInput(_n) \ + { \ + if (data_size > 0) \ + { \ + _n = *data++; \ + data_size--; \ + } \ + else \ + { \ + _n = 0; \ + } \ + } /* Emit bitPattern to the output bitstream */ #define OutputBits(numBits, bitPattern) rfx_bitstream_put_bits(bs, bitPattern, numBits) /* Emit a bit (0 or 1), count number of times, to the output bitstream */ -#define OutputBit(count, bit) \ -{ \ - UINT16 _b = (bit ? 0xFFFF : 0); \ - int _c = (count); \ - for (; _c > 0; _c -= 16) \ - rfx_bitstream_put_bits(bs, _b, (_c > 16 ? 16 : _c)); \ -} +#define OutputBit(count, bit) \ + { \ + UINT16 _b = (bit ? 0xFFFF : 0); \ + int _c = (count); \ + for (; _c > 0; _c -= 16) \ + rfx_bitstream_put_bits(bs, _b, (_c > 16 ? 16 : _c)); \ + } -/* Converts the input value to (2 * abs(input) - sign(input)), where sign(input) = (input < 0 ? 1 : 0) and returns it */ -#define Get2MagSign(input) ((input) >= 0 ? 2 * (input) : -2 * (input) - 1) +/* Converts the input value to (2 * abs(input) - sign(input)), where sign(input) = (input < 0 ? 1 : + * 0) and returns it */ +#define Get2MagSign(input) ((input) >= 0 ? 2 * (input) : -2 * (input)-1) /* Outputs the Golomb/Rice encoding of a non-negative integer */ #define CodeGR(krp, val) rfx_rlgr_code_gr(bs, krp, val) @@ -577,13 +601,14 @@ static void rfx_rlgr_code_gr(RFX_BITSTREAM* bs, int* krp, UINT32 val) { UpdateParam(*krp, -2, kr); } - else if (vk > 1) + else if (vk > 1) { UpdateParam(*krp, vk, kr); } } -int rfx_rlgr_encode(RLGR_MODE mode, const INT16* data, UINT32 data_size, BYTE* buffer, UINT32 buffer_size) +int rfx_rlgr_encode(RLGR_MODE mode, const INT16* data, UINT32 data_size, BYTE* buffer, + UINT32 buffer_size) { int k; int kp; @@ -591,7 +616,7 @@ int rfx_rlgr_encode(RLGR_MODE mode, const INT16* data, UINT32 data_size, BYTE* b RFX_BITSTREAM* bs; int processed_size; - if (!(bs = (RFX_BITSTREAM*) calloc(1, sizeof(RFX_BITSTREAM)))) + if (!(bs = (RFX_BITSTREAM*)calloc(1, sizeof(RFX_BITSTREAM)))) return 0; rfx_bitstream_attach(bs, buffer, buffer_size); @@ -645,9 +670,9 @@ int rfx_rlgr_encode(RLGR_MODE mode, const INT16* data, UINT32 data_size, BYTE* b /* encode the nonzero value using GR coding */ mag = (input < 0 ? -input : input); /* absolute value of input coefficient */ - sign = (input < 0 ? 1 : 0); /* sign of input coefficient */ + sign = (input < 0 ? 1 : 0); /* sign of input coefficient */ - OutputBit(1, sign); /* output the sign bit */ + OutputBit(1, sign); /* output the sign bit */ CodeGR(&krp, mag ? mag - 1 : 0); /* output GR code for (mag - 1) */ UpdateParam(kp, -DN_GR, k); diff --git a/libfreerdp/codec/rfx_rlgr.h b/libfreerdp/codec/rfx_rlgr.h index 49c0d6241..93738cee6 100644 --- a/libfreerdp/codec/rfx_rlgr.h +++ b/libfreerdp/codec/rfx_rlgr.h @@ -23,8 +23,8 @@ #include #include -FREERDP_LOCAL int rfx_rlgr_encode(RLGR_MODE mode, const INT16* data, - UINT32 data_size, BYTE* buffer, UINT32 buffer_size); +FREERDP_LOCAL int rfx_rlgr_encode(RLGR_MODE mode, const INT16* data, UINT32 data_size, BYTE* buffer, + UINT32 buffer_size); FREERDP_LOCAL int rfx_rlgr_decode(RLGR_MODE mode, const BYTE* pSrcData, UINT32 SrcSize, INT16* pDstData, UINT32 DstSize); diff --git a/libfreerdp/codec/rfx_sse2.c b/libfreerdp/codec/rfx_sse2.c index 0a28087cd..b9dbf9177 100644 --- a/libfreerdp/codec/rfx_sse2.c +++ b/libfreerdp/codec/rfx_sse2.c @@ -34,24 +34,26 @@ #include "rfx_sse2.h" #ifdef _MSC_VER -#define __attribute__(...) +#define __attribute__(...) #endif -#define CACHE_LINE_BYTES 64 +#define CACHE_LINE_BYTES 64 #ifndef __clang__ -#define ATTRIBUTES __gnu_inline__, __always_inline__, __artificial__ +#define ATTRIBUTES __gnu_inline__, __always_inline__, __artificial__ #else #define ATTRIBUTES __gnu_inline__, __always_inline__ #endif -#define _mm_between_epi16(_val, _min, _max) \ - do { _val = _mm_min_epi16(_max, _mm_max_epi16(_val, _min)); } while (0) +#define _mm_between_epi16(_val, _min, _max) \ + do \ + { \ + _val = _mm_min_epi16(_max, _mm_max_epi16(_val, _min)); \ + } while (0) -static __inline void __attribute__((ATTRIBUTES)) -_mm_prefetch_buffer(char* buffer, int num_bytes) +static __inline void __attribute__((ATTRIBUTES)) _mm_prefetch_buffer(char* buffer, int num_bytes) { - __m128i* buf = (__m128i*) buffer; + __m128i* buf = (__m128i*)buffer; unsigned int i; for (i = 0; i < (num_bytes / sizeof(__m128i)); i += (CACHE_LINE_BYTES / sizeof(__m128i))) @@ -67,7 +69,7 @@ static __inline void __attribute__((ATTRIBUTES)) rfx_quantization_decode_block_sse2(INT16* buffer, const int buffer_size, const UINT32 factor) { __m128i a; - __m128i* ptr = (__m128i*) buffer; + __m128i* ptr = (__m128i*)buffer; __m128i* buf_end = (__m128i*)(buffer + buffer_size); if (factor == 0) @@ -79,30 +81,29 @@ rfx_quantization_decode_block_sse2(INT16* buffer, const int buffer_size, const U a = _mm_slli_epi16(a, factor); _mm_store_si128(ptr, a); ptr++; - } - while (ptr < buf_end); + } while (ptr < buf_end); } static void rfx_quantization_decode_sse2(INT16* buffer, const UINT32* quantVals) { - _mm_prefetch_buffer((char*) buffer, 4096 * sizeof(INT16)); - rfx_quantization_decode_block_sse2(&buffer[0], 1024, quantVals[8] - 1); /* HL1 */ + _mm_prefetch_buffer((char*)buffer, 4096 * sizeof(INT16)); + rfx_quantization_decode_block_sse2(&buffer[0], 1024, quantVals[8] - 1); /* HL1 */ rfx_quantization_decode_block_sse2(&buffer[1024], 1024, quantVals[7] - 1); /* LH1 */ rfx_quantization_decode_block_sse2(&buffer[2048], 1024, quantVals[9] - 1); /* HH1 */ - rfx_quantization_decode_block_sse2(&buffer[3072], 256, quantVals[5] - 1); /* HL2 */ - rfx_quantization_decode_block_sse2(&buffer[3328], 256, quantVals[4] - 1); /* LH2 */ - rfx_quantization_decode_block_sse2(&buffer[3584], 256, quantVals[6] - 1); /* HH2 */ - rfx_quantization_decode_block_sse2(&buffer[3840], 64, quantVals[2] - 1); /* HL3 */ - rfx_quantization_decode_block_sse2(&buffer[3904], 64, quantVals[1] - 1); /* LH3 */ - rfx_quantization_decode_block_sse2(&buffer[3968], 64, quantVals[3] - 1); /* HH3 */ - rfx_quantization_decode_block_sse2(&buffer[4032], 64, quantVals[0] - 1); /* LL3 */ + rfx_quantization_decode_block_sse2(&buffer[3072], 256, quantVals[5] - 1); /* HL2 */ + rfx_quantization_decode_block_sse2(&buffer[3328], 256, quantVals[4] - 1); /* LH2 */ + rfx_quantization_decode_block_sse2(&buffer[3584], 256, quantVals[6] - 1); /* HH2 */ + rfx_quantization_decode_block_sse2(&buffer[3840], 64, quantVals[2] - 1); /* HL3 */ + rfx_quantization_decode_block_sse2(&buffer[3904], 64, quantVals[1] - 1); /* LH3 */ + rfx_quantization_decode_block_sse2(&buffer[3968], 64, quantVals[3] - 1); /* HH3 */ + rfx_quantization_decode_block_sse2(&buffer[4032], 64, quantVals[0] - 1); /* LL3 */ } static __inline void __attribute__((ATTRIBUTES)) rfx_quantization_encode_block_sse2(INT16* buffer, const int buffer_size, const UINT32 factor) { __m128i a; - __m128i* ptr = (__m128i*) buffer; + __m128i* ptr = (__m128i*)buffer; __m128i* buf_end = (__m128i*)(buffer + buffer_size); __m128i half; @@ -118,23 +119,22 @@ rfx_quantization_encode_block_sse2(INT16* buffer, const int buffer_size, const U a = _mm_srai_epi16(a, factor); _mm_store_si128(ptr, a); ptr++; - } - while (ptr < buf_end); + } while (ptr < buf_end); } static void rfx_quantization_encode_sse2(INT16* buffer, const UINT32* quantization_values) { - _mm_prefetch_buffer((char*) buffer, 4096 * sizeof(INT16)); - rfx_quantization_encode_block_sse2(buffer, 1024, quantization_values[8] - 6); /* HL1 */ + _mm_prefetch_buffer((char*)buffer, 4096 * sizeof(INT16)); + rfx_quantization_encode_block_sse2(buffer, 1024, quantization_values[8] - 6); /* HL1 */ rfx_quantization_encode_block_sse2(buffer + 1024, 1024, quantization_values[7] - 6); /* LH1 */ rfx_quantization_encode_block_sse2(buffer + 2048, 1024, quantization_values[9] - 6); /* HH1 */ - rfx_quantization_encode_block_sse2(buffer + 3072, 256, quantization_values[5] - 6); /* HL2 */ - rfx_quantization_encode_block_sse2(buffer + 3328, 256, quantization_values[4] - 6); /* LH2 */ - rfx_quantization_encode_block_sse2(buffer + 3584, 256, quantization_values[6] - 6); /* HH2 */ - rfx_quantization_encode_block_sse2(buffer + 3840, 64, quantization_values[2] - 6); /* HL3 */ - rfx_quantization_encode_block_sse2(buffer + 3904, 64, quantization_values[1] - 6); /* LH3 */ - rfx_quantization_encode_block_sse2(buffer + 3968, 64, quantization_values[3] - 6); /* HH3 */ - rfx_quantization_encode_block_sse2(buffer + 4032, 64, quantization_values[0] - 6); /* LL3 */ + rfx_quantization_encode_block_sse2(buffer + 3072, 256, quantization_values[5] - 6); /* HL2 */ + rfx_quantization_encode_block_sse2(buffer + 3328, 256, quantization_values[4] - 6); /* LH2 */ + rfx_quantization_encode_block_sse2(buffer + 3584, 256, quantization_values[6] - 6); /* HH2 */ + rfx_quantization_encode_block_sse2(buffer + 3840, 64, quantization_values[2] - 6); /* HL3 */ + rfx_quantization_encode_block_sse2(buffer + 3904, 64, quantization_values[1] - 6); /* LH3 */ + rfx_quantization_encode_block_sse2(buffer + 3968, 64, quantization_values[3] - 6); /* HH3 */ + rfx_quantization_encode_block_sse2(buffer + 4032, 64, quantization_values[0] - 6); /* LL3 */ rfx_quantization_encode_block_sse2(buffer, 4096, 5); } @@ -162,8 +162,8 @@ rfx_dwt_2d_decode_block_horiz_sse2(INT16* l, INT16* h, INT16* dst, int subband_w for (n = 0; n < subband_width; n += 8) { /* dst[2n] = l[n] - ((h[n-1] + h[n] + 1) >> 1); */ - l_n = _mm_load_si128((__m128i*) l_ptr); - h_n = _mm_load_si128((__m128i*) h_ptr); + l_n = _mm_load_si128((__m128i*)l_ptr); + h_n = _mm_load_si128((__m128i*)h_ptr); h_n_m = _mm_loadu_si128((__m128i*)(h_ptr - 1)); if (n == 0) @@ -176,7 +176,7 @@ rfx_dwt_2d_decode_block_horiz_sse2(INT16* l, INT16* h, INT16* dst, int subband_w tmp_n = _mm_add_epi16(tmp_n, _mm_set1_epi16(1)); tmp_n = _mm_srai_epi16(tmp_n, 1); dst_n = _mm_sub_epi16(l_n, tmp_n); - _mm_store_si128((__m128i*) l_ptr, dst_n); + _mm_store_si128((__m128i*)l_ptr, dst_n); l_ptr += 8; h_ptr += 8; } @@ -188,7 +188,7 @@ rfx_dwt_2d_decode_block_horiz_sse2(INT16* l, INT16* h, INT16* dst, int subband_w for (n = 0; n < subband_width; n += 8) { /* dst[2n + 1] = (h[n] << 1) + ((dst[2n] + dst[2n + 2]) >> 1); */ - h_n = _mm_load_si128((__m128i*) h_ptr); + h_n = _mm_load_si128((__m128i*)h_ptr); h_n = _mm_slli_epi16(h_n, 1); dst_n = _mm_load_si128((__m128i*)(l_ptr)); dst_n_p = _mm_loadu_si128((__m128i*)(l_ptr + 1)); @@ -204,7 +204,7 @@ rfx_dwt_2d_decode_block_horiz_sse2(INT16* l, INT16* h, INT16* dst, int subband_w tmp_n = _mm_add_epi16(tmp_n, h_n); dst1 = _mm_unpacklo_epi16(dst_n, tmp_n); dst2 = _mm_unpackhi_epi16(dst_n, tmp_n); - _mm_store_si128((__m128i*) dst_ptr, dst1); + _mm_store_si128((__m128i*)dst_ptr, dst1); _mm_store_si128((__m128i*)(dst_ptr + 8), dst2); l_ptr += 8; h_ptr += 8; @@ -235,8 +235,8 @@ rfx_dwt_2d_decode_block_vert_sse2(INT16* l, INT16* h, INT16* dst, int subband_wi for (x = 0; x < total_width; x += 8) { /* dst[2n] = l[n] - ((h[n-1] + h[n] + 1) >> 1); */ - l_n = _mm_load_si128((__m128i*) l_ptr); - h_n = _mm_load_si128((__m128i*) h_ptr); + l_n = _mm_load_si128((__m128i*)l_ptr); + h_n = _mm_load_si128((__m128i*)h_ptr); tmp_n = _mm_add_epi16(h_n, _mm_set1_epi16(1)); if (n == 0) @@ -249,7 +249,7 @@ rfx_dwt_2d_decode_block_vert_sse2(INT16* l, INT16* h, INT16* dst, int subband_wi tmp_n = _mm_srai_epi16(tmp_n, 1); dst_n = _mm_sub_epi16(l_n, tmp_n); - _mm_store_si128((__m128i*) dst_ptr, dst_n); + _mm_store_si128((__m128i*)dst_ptr, dst_n); l_ptr += 8; h_ptr += 8; dst_ptr += 8; @@ -267,7 +267,7 @@ rfx_dwt_2d_decode_block_vert_sse2(INT16* l, INT16* h, INT16* dst, int subband_wi for (x = 0; x < total_width; x += 8) { /* dst[2n + 1] = (h[n] << 1) + ((dst[2n] + dst[2n + 2]) >> 1); */ - h_n = _mm_load_si128((__m128i*) h_ptr); + h_n = _mm_load_si128((__m128i*)h_ptr); dst_n_m = _mm_load_si128((__m128i*)(dst_ptr - total_width)); h_n = _mm_slli_epi16(h_n, 1); tmp_n = dst_n_m; @@ -282,7 +282,7 @@ rfx_dwt_2d_decode_block_vert_sse2(INT16* l, INT16* h, INT16* dst, int subband_wi tmp_n = _mm_srai_epi16(tmp_n, 1); dst_n = _mm_add_epi16(tmp_n, h_n); - _mm_store_si128((__m128i*) dst_ptr, dst_n); + _mm_store_si128((__m128i*)dst_ptr, dst_n); h_ptr += 8; dst_ptr += 8; } @@ -294,10 +294,11 @@ rfx_dwt_2d_decode_block_vert_sse2(INT16* l, INT16* h, INT16* dst, int subband_wi static __inline void __attribute__((ATTRIBUTES)) rfx_dwt_2d_decode_block_sse2(INT16* buffer, INT16* idwt, int subband_width) { - INT16* hl, *lh, *hh, *ll; - INT16* l_dst, *h_dst; - _mm_prefetch_buffer((char*) idwt, subband_width * 4 * sizeof(INT16)); - /* Inverse DWT in horizontal direction, results in 2 sub-bands in L, H order in tmp buffer idwt. */ + INT16 *hl, *lh, *hh, *ll; + INT16 *l_dst, *h_dst; + _mm_prefetch_buffer((char*)idwt, subband_width * 4 * sizeof(INT16)); + /* Inverse DWT in horizontal direction, results in 2 sub-bands in L, H order in tmp buffer idwt. + */ /* The 4 sub-bands are stored in HL(0), LH(1), HH(2), LL(3) order. */ /* The lower part L uses LL(3) and HL(0). */ /* The higher part H uses LH(1) and HH(2). */ @@ -315,7 +316,7 @@ rfx_dwt_2d_decode_block_sse2(INT16* buffer, INT16* idwt, int subband_width) static void rfx_dwt_2d_decode_sse2(INT16* buffer, INT16* dwt_buffer) { - _mm_prefetch_buffer((char*) buffer, 4096 * sizeof(INT16)); + _mm_prefetch_buffer((char*)buffer, 4096 * sizeof(INT16)); rfx_dwt_2d_decode_block_sse2(&buffer[3840], dwt_buffer, 8); rfx_dwt_2d_decode_block_sse2(&buffer[3072], dwt_buffer, 16); rfx_dwt_2d_decode_block_sse2(&buffer[0], dwt_buffer, 32); @@ -339,7 +340,7 @@ rfx_dwt_2d_encode_block_vert_sse2(INT16* src, INT16* l, INT16* h, int subband_wi { for (x = 0; x < total_width; x += 8) { - src_2n = _mm_load_si128((__m128i*) src); + src_2n = _mm_load_si128((__m128i*)src); src_2n_1 = _mm_load_si128((__m128i*)(src + total_width)); if (n < subband_width - 1) @@ -352,7 +353,7 @@ rfx_dwt_2d_encode_block_vert_sse2(INT16* src, INT16* l, INT16* h, int subband_wi h_n = _mm_srai_epi16(h_n, 1); h_n = _mm_sub_epi16(src_2n_1, h_n); h_n = _mm_srai_epi16(h_n, 1); - _mm_store_si128((__m128i*) h, h_n); + _mm_store_si128((__m128i*)h, h_n); if (n == 0) h_n_m = h_n; @@ -363,7 +364,7 @@ rfx_dwt_2d_encode_block_vert_sse2(INT16* src, INT16* l, INT16* h, int subband_wi l_n = _mm_add_epi16(h_n_m, h_n); l_n = _mm_srai_epi16(l_n, 1); l_n = _mm_add_epi16(l_n, src_2n); - _mm_store_si128((__m128i*) l, l_n); + _mm_store_si128((__m128i*)l, l_n); src += 8; l += 8; h += 8; @@ -390,17 +391,20 @@ rfx_dwt_2d_encode_block_horiz_sse2(INT16* src, INT16* l, INT16* h, int subband_w { for (n = 0; n < subband_width; n += 8) { - /* The following 3 Set operations consumes more than half of the total DWT processing time! */ - src_2n = _mm_set_epi16(src[14], src[12], src[10], src[8], src[6], src[4], src[2], src[0]); - src_2n_1 = _mm_set_epi16(src[15], src[13], src[11], src[9], src[7], src[5], src[3], src[1]); - src_2n_2 = _mm_set_epi16(n == subband_width - 8 ? src[14] : src[16], - src[14], src[12], src[10], src[8], src[6], src[4], src[2]); + /* The following 3 Set operations consumes more than half of the total DWT processing + * time! */ + src_2n = + _mm_set_epi16(src[14], src[12], src[10], src[8], src[6], src[4], src[2], src[0]); + src_2n_1 = + _mm_set_epi16(src[15], src[13], src[11], src[9], src[7], src[5], src[3], src[1]); + src_2n_2 = _mm_set_epi16(n == subband_width - 8 ? src[14] : src[16], src[14], src[12], + src[10], src[8], src[6], src[4], src[2]); /* h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 */ h_n = _mm_add_epi16(src_2n, src_2n_2); h_n = _mm_srai_epi16(h_n, 1); h_n = _mm_sub_epi16(src_2n_1, h_n); h_n = _mm_srai_epi16(h_n, 1); - _mm_store_si128((__m128i*) h, h_n); + _mm_store_si128((__m128i*)h, h_n); h_n_m = _mm_loadu_si128((__m128i*)(h - 1)); if (n == 0) @@ -413,7 +417,7 @@ rfx_dwt_2d_encode_block_horiz_sse2(INT16* src, INT16* l, INT16* h, int subband_w l_n = _mm_add_epi16(h_n_m, h_n); l_n = _mm_srai_epi16(l_n, 1); l_n = _mm_add_epi16(l_n, src_2n); - _mm_store_si128((__m128i*) l, l_n); + _mm_store_si128((__m128i*)l, l_n); src += 16; l += 8; h += 8; @@ -424,14 +428,15 @@ rfx_dwt_2d_encode_block_horiz_sse2(INT16* src, INT16* l, INT16* h, int subband_w static __inline void __attribute__((ATTRIBUTES)) rfx_dwt_2d_encode_block_sse2(INT16* buffer, INT16* dwt, int subband_width) { - INT16* hl, *lh, *hh, *ll; - INT16* l_src, *h_src; - _mm_prefetch_buffer((char*) dwt, subband_width * 4 * sizeof(INT16)); + INT16 *hl, *lh, *hh, *ll; + INT16 *l_src, *h_src; + _mm_prefetch_buffer((char*)dwt, subband_width * 4 * sizeof(INT16)); /* DWT in vertical direction, results in 2 sub-bands in L, H order in tmp buffer dwt. */ l_src = dwt; h_src = dwt + subband_width * subband_width * 2; rfx_dwt_2d_encode_block_vert_sse2(buffer, l_src, h_src, subband_width); - /* DWT in horizontal direction, results in 4 sub-bands in HL(0), LH(1), HH(2), LL(3) order, stored in original buffer. */ + /* DWT in horizontal direction, results in 4 sub-bands in HL(0), LH(1), HH(2), LL(3) order, + * stored in original buffer. */ /* The lower part L generates LL(3) and HL(0). */ /* The higher part H generates LH(1) and HH(2). */ ll = buffer + subband_width * subband_width * 3; @@ -444,7 +449,7 @@ rfx_dwt_2d_encode_block_sse2(INT16* buffer, INT16* dwt, int subband_width) static void rfx_dwt_2d_encode_sse2(INT16* buffer, INT16* dwt_buffer) { - _mm_prefetch_buffer((char*) buffer, 4096 * sizeof(INT16)); + _mm_prefetch_buffer((char*)buffer, 4096 * sizeof(INT16)); rfx_dwt_2d_encode_block_sse2(buffer, dwt_buffer, 32); rfx_dwt_2d_encode_block_sse2(buffer + 3072, dwt_buffer, 16); rfx_dwt_2d_encode_block_sse2(buffer + 3840, dwt_buffer, 8); diff --git a/libfreerdp/codec/rfx_types.h b/libfreerdp/codec/rfx_types.h index 0552b155f..a55aa0d85 100644 --- a/libfreerdp/codec/rfx_types.h +++ b/libfreerdp/codec/rfx_types.h @@ -36,7 +36,10 @@ #ifdef WITH_DEBUG_RFX #define DEBUG_RFX(...) WLog_DBG(RFX_TAG, __VA_ARGS__) #else -#define DEBUG_RFX(...) do { } while (0) +#define DEBUG_RFX(...) \ + do \ + { \ + } while (0) #endif typedef struct _RFX_TILE_COMPOSE_WORK_PARAM RFX_TILE_COMPOSE_WORK_PARAM; diff --git a/libfreerdp/codec/test/TestFreeRDPCodecClear.c b/libfreerdp/codec/test/TestFreeRDPCodecClear.c index f48fe1e00..813641d0e 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecClear.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecClear.c @@ -6,10 +6,8 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-const-variable" /* [MS-RDPEGFX] 4.1.1.1 Example 1 */ -static const BYTE PREPARE_CLEAR_EXAMPLE_1[] = - "\x03\xc3\x11\x00"; -static const BYTE TEST_CLEAR_EXAMPLE_1[] = - "\x03\xc3\x11\x00"; +static const BYTE PREPARE_CLEAR_EXAMPLE_1[] = "\x03\xc3\x11\x00"; +static const BYTE TEST_CLEAR_EXAMPLE_1[] = "\x03\xc3\x11\x00"; #pragma GCC diagnostic pop /* [MS-RDPEGFX] 4.1.1.1 Example 2 */ @@ -47,10 +45,8 @@ static const BYTE TEST_CLEAR_EXAMPLE_4[] = "\xb6\xff\xff\xff\xff\xff\xff\xff\xff\xff\x46\x91\x47\x91\x48\x91" "\x49\x91\x4a\x91\x1b\x91"; - static BOOL test_ClearDecompressExample(UINT32 nr, UINT32 width, UINT32 height, - const BYTE* pSrcData, - const UINT32 SrcSize) + const BYTE* pSrcData, const UINT32 SrcSize) { BOOL rc = FALSE; int status; @@ -60,10 +56,9 @@ static BOOL test_ClearDecompressExample(UINT32 nr, UINT32 width, UINT32 height, if (!clear || !pDstData) goto fail; - status = clear_decompress(clear, pSrcData, SrcSize, width, height, - pDstData, PIXEL_FORMAT_XRGB32, 0, 0, 0, width, height, - NULL); - printf("clear_decompress example %"PRIu32" status: %d\n", nr, status); + status = clear_decompress(clear, pSrcData, SrcSize, width, height, pDstData, + PIXEL_FORMAT_XRGB32, 0, 0, 0, width, height, NULL); + printf("clear_decompress example %" PRIu32 " status: %d\n", nr, status); fflush(stdout); rc = (status == 0); fail: @@ -80,20 +75,16 @@ int TestFreeRDPCodecClear(int argc, char* argv[]) /* Example 1 needs a filled glyph cache if (!test_ClearDecompressExample(1, 8, 9, TEST_CLEAR_EXAMPLE_1, sizeof(TEST_CLEAR_EXAMPLE_1))) - return -1; + return -1; */ - if (!test_ClearDecompressExample(2, 78, 17, TEST_CLEAR_EXAMPLE_2, - sizeof(TEST_CLEAR_EXAMPLE_2))) + if (!test_ClearDecompressExample(2, 78, 17, TEST_CLEAR_EXAMPLE_2, sizeof(TEST_CLEAR_EXAMPLE_2))) return -1; - if (!test_ClearDecompressExample(3, 64, 24, TEST_CLEAR_EXAMPLE_3, - sizeof(TEST_CLEAR_EXAMPLE_3))) + if (!test_ClearDecompressExample(3, 64, 24, TEST_CLEAR_EXAMPLE_3, sizeof(TEST_CLEAR_EXAMPLE_3))) return -1; - if (!test_ClearDecompressExample(4, 7, 15, TEST_CLEAR_EXAMPLE_4, - sizeof(TEST_CLEAR_EXAMPLE_4))) + if (!test_ClearDecompressExample(4, 7, 15, TEST_CLEAR_EXAMPLE_4, sizeof(TEST_CLEAR_EXAMPLE_4))) return -1; return 0; } - diff --git a/libfreerdp/codec/test/TestFreeRDPCodecInterleaved.c b/libfreerdp/codec/test/TestFreeRDPCodecInterleaved.c index e85381a8b..b7d79d866 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecInterleaved.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecInterleaved.c @@ -18,9 +18,10 @@ static BOOL run_encode_decode_single(UINT16 bpp, BITMAP_INTERLEAVED_CONTEXT* encoder, BITMAP_INTERLEAVED_CONTEXT* decoder #if defined(WITH_PROFILER) - , PROFILER* profiler_comp, PROFILER* profiler_decomp + , + PROFILER* profiler_comp, PROFILER* profiler_decomp #endif - ) +) { BOOL rc2 = FALSE; BOOL rc; @@ -48,16 +49,16 @@ static BOOL run_encode_decode_single(UINT16 bpp, BITMAP_INTERLEAVED_CONTEXT* enc goto fail; PROFILER_ENTER(profiler_comp); - rc = interleaved_compress(encoder, tmp, &DstSize, w, h, pSrcData, - format, step, x, y, NULL, bpp); + rc = + interleaved_compress(encoder, tmp, &DstSize, w, h, pSrcData, format, step, x, y, NULL, bpp); PROFILER_EXIT(profiler_comp); if (!rc) goto fail; PROFILER_ENTER(profiler_decomp); - rc = interleaved_decompress(decoder, tmp, DstSize, w, h, bpp, pDstData, - format, step, x, y, w, h, NULL); + rc = interleaved_decompress(decoder, tmp, DstSize, w, h, bpp, pDstData, format, step, x, y, w, + h, NULL); PROFILER_EXIT(profiler_decomp); if (!rc) @@ -136,9 +137,10 @@ static BOOL run_encode_decode(UINT16 bpp, BITMAP_INTERLEAVED_CONTEXT* encoder, { if (!run_encode_decode_single(bpp, encoder, decoder #if defined(WITH_PROFILER) - , profiler_comp, profiler_decomp + , + profiler_comp, profiler_decomp #endif - )) + )) goto fail; } @@ -155,18 +157,12 @@ fail: static BOOL TestColorConversion(void) { - const UINT32 formats[] = { - PIXEL_FORMAT_RGB15, - PIXEL_FORMAT_BGR15, - PIXEL_FORMAT_ABGR15, - PIXEL_FORMAT_ARGB15, - PIXEL_FORMAT_BGR16, - PIXEL_FORMAT_RGB16 - }; + const UINT32 formats[] = { PIXEL_FORMAT_RGB15, PIXEL_FORMAT_BGR15, PIXEL_FORMAT_ABGR15, + PIXEL_FORMAT_ARGB15, PIXEL_FORMAT_BGR16, PIXEL_FORMAT_RGB16 }; UINT32 x; /* Check color conversion 15/16 -> 32bit maps to proper values */ - for (x=0; x #include -static const BYTE TEST_RDP5_COMPRESSED_DATA[] = -{ +static const BYTE TEST_RDP5_COMPRESSED_DATA[] = { 0x24, 0x02, 0x03, 0x09, 0x00, 0x20, 0x0c, 0x05, 0x10, 0x01, 0x40, 0x0a, 0xbf, 0xdf, 0xc3, 0x20, 0x80, 0x00, 0x1f, 0x0a, 0x00, 0x00, 0x07, 0x43, 0x4e, 0x00, 0x68, 0x02, 0x00, 0x22, 0x00, 0x34, 0xcb, 0xfb, 0xf8, 0x18, 0x40, 0x01, 0x00, 0x27, 0xe2, 0x90, 0x0f, 0xc3, 0x91, 0xa8, 0x00, 0x08, @@ -188,8 +187,7 @@ static const BYTE TEST_RDP5_COMPRESSED_DATA[] = 0x7f, 0x52, 0x00 }; -static const BYTE TEST_RDP5_UNCOMPRESSED_DATA[] = -{ +static const BYTE TEST_RDP5_UNCOMPRESSED_DATA[] = { 0x24, 0x02, 0x03, 0x09, 0x00, 0x20, 0x0c, 0x05, 0x10, 0x01, 0x40, 0x0a, 0xff, 0xff, 0x0c, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x0d, 0x38, 0x01, 0xc0, 0x10, 0x01, 0x10, 0x01, 0xcc, 0xff, 0x7f, 0x03, 0x08, 0x00, 0x20, 0x04, 0x05, 0x10, 0x01, 0x40, 0x0a, 0x00, 0x0c, @@ -705,16 +703,15 @@ static const BYTE TEST_MPPC_BELLS_RDP5[] = "\x6c\x2e\x74\x6f\x6c\x6c\x73\x2c\xfa\x1b\x97\x33\x7e\x87\xe3\x32" "\x90\x80"; -static const BYTE TEST_ISLAND_DATA[] = - "No man is an island entire of itself; every man " - "is a piece of the continent, a part of the main; " - "if a clod be washed away by the sea, Europe " - "is the less, as well as if a promontory were, as" - "well as any manner of thy friends or of thine " - "own were; any man's death diminishes me, " - "because I am involved in mankind. " - "And therefore never send to know for whom " - "the bell tolls; it tolls for thee."; +static const BYTE TEST_ISLAND_DATA[] = "No man is an island entire of itself; every man " + "is a piece of the continent, a part of the main; " + "if a clod be washed away by the sea, Europe " + "is the less, as well as if a promontory were, as" + "well as any manner of thy friends or of thine " + "own were; any man's death diminishes me, " + "because I am involved in mankind. " + "And therefore never send to know for whom " + "the bell tolls; it tolls for thee."; static const BYTE TEST_ISLAND_DATA_RDP5[] = "\x4e\x6f\x20\x6d\x61\x6e\x20\x69\x73\x20\xf8\xd2\xd8\xc2\xdc\xc8" @@ -755,7 +752,7 @@ static int test_MppcCompressBellsRdp5(void) return -1; SrcSize = sizeof(TEST_MPPC_BELLS) - 1; - pSrcData = (BYTE*) TEST_MPPC_BELLS; + pSrcData = (BYTE*)TEST_MPPC_BELLS; expectedSize = sizeof(TEST_MPPC_BELLS_RDP5) - 1; DstSize = sizeof(OutputBuffer); pDstData = OutputBuffer; @@ -764,11 +761,12 @@ static int test_MppcCompressBellsRdp5(void) if (status < 0) goto fail; - printf("Flags: 0x%08"PRIX32" DstSize: %"PRIu32"\n", Flags, DstSize); + printf("Flags: 0x%08" PRIX32 " DstSize: %" PRIu32 "\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("MppcCompressBellsRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + printf("MppcCompressBellsRdp5: output size mismatch: Actual: %" PRIu32 + ", Expected: %" PRIu32 "\n", DstSize, expectedSize); goto fail; } @@ -807,7 +805,7 @@ static int test_MppcCompressBellsRdp4(void) return -1; SrcSize = sizeof(TEST_MPPC_BELLS) - 1; - pSrcData = (BYTE*) TEST_MPPC_BELLS; + pSrcData = (BYTE*)TEST_MPPC_BELLS; expectedSize = sizeof(TEST_MPPC_BELLS_RDP4) - 1; DstSize = sizeof(OutputBuffer); pDstData = OutputBuffer; @@ -816,11 +814,12 @@ static int test_MppcCompressBellsRdp4(void) if (status < 0) goto fail; - printf("flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize); + printf("flags: 0x%08" PRIX32 " size: %" PRIu32 "\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("MppcCompressBellsRdp4: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + printf("MppcCompressBellsRdp4: output size mismatch: Actual: %" PRIu32 + ", Expected: %" PRIu32 "\n", DstSize, expectedSize); goto fail; } @@ -858,7 +857,7 @@ static int test_MppcDecompressBellsRdp5(void) return -1; SrcSize = sizeof(TEST_MPPC_BELLS_RDP5) - 1; - pSrcData = (BYTE*) TEST_MPPC_BELLS_RDP5; + pSrcData = (BYTE*)TEST_MPPC_BELLS_RDP5; Flags = PACKET_AT_FRONT | PACKET_COMPRESSED | 1; expectedSize = sizeof(TEST_MPPC_BELLS) - 1; status = mppc_decompress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, Flags); @@ -866,11 +865,12 @@ static int test_MppcDecompressBellsRdp5(void) if (status < 0) goto fail; - printf("flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize); + printf("flags: 0x%08" PRIX32 " size: %" PRIu32 "\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("MppcDecompressBellsRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + printf("MppcDecompressBellsRdp5: output size mismatch: Actual: %" PRIu32 + ", Expected: %" PRIu32 "\n", DstSize, expectedSize); goto fail; } @@ -904,7 +904,7 @@ static int test_MppcDecompressBellsRdp4(void) return -1; SrcSize = sizeof(TEST_MPPC_BELLS_RDP4) - 1; - pSrcData = (BYTE*) TEST_MPPC_BELLS_RDP4; + pSrcData = (BYTE*)TEST_MPPC_BELLS_RDP4; Flags = PACKET_AT_FRONT | PACKET_COMPRESSED | 0; expectedSize = sizeof(TEST_MPPC_BELLS) - 1; status = mppc_decompress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, Flags); @@ -912,11 +912,12 @@ static int test_MppcDecompressBellsRdp4(void) if (status < 0) goto fail; - printf("flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize); + printf("flags: 0x%08" PRIX32 " size: %" PRIu32 "\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("MppcDecompressBellsRdp4: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + printf("MppcDecompressBellsRdp4: output size mismatch: Actual: %" PRIu32 + ", Expected: %" PRIu32 "\n", DstSize, expectedSize); goto fail; } @@ -951,7 +952,7 @@ static int test_MppcCompressIslandRdp5(void) return -1; SrcSize = sizeof(TEST_ISLAND_DATA) - 1; - pSrcData = (BYTE*) TEST_ISLAND_DATA; + pSrcData = (BYTE*)TEST_ISLAND_DATA; expectedSize = sizeof(TEST_ISLAND_DATA_RDP5) - 1; DstSize = sizeof(OutputBuffer); pDstData = OutputBuffer; @@ -960,11 +961,12 @@ static int test_MppcCompressIslandRdp5(void) if (status < 0) goto fail; - printf("Flags: 0x%08"PRIX32" DstSize: %"PRIu32"\n", Flags, DstSize); + printf("Flags: 0x%08" PRIX32 " DstSize: %" PRIu32 "\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("MppcCompressIslandRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + printf("MppcCompressIslandRdp5: output size mismatch: Actual: %" PRIu32 + ", Expected: %" PRIu32 "\n", DstSize, expectedSize); goto fail; } @@ -1003,7 +1005,7 @@ static int test_MppcCompressBufferRdp5(void) return -1; SrcSize = sizeof(TEST_RDP5_UNCOMPRESSED_DATA); - pSrcData = (BYTE*) TEST_RDP5_UNCOMPRESSED_DATA; + pSrcData = (BYTE*)TEST_RDP5_UNCOMPRESSED_DATA; expectedSize = sizeof(TEST_RDP5_COMPRESSED_DATA); DstSize = sizeof(OutputBuffer); pDstData = OutputBuffer; @@ -1012,18 +1014,20 @@ static int test_MppcCompressBufferRdp5(void) if (status < 0) goto fail; - printf("flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize); + printf("flags: 0x%08" PRIX32 " size: %" PRIu32 "\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("MppcCompressBufferRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + printf("MppcCompressBufferRdp5: output size mismatch: Actual: %" PRIu32 + ", Expected: %" PRIu32 "\n", DstSize, expectedSize); goto fail; } if (memcmp(pDstData, TEST_RDP5_COMPRESSED_DATA, DstSize) != 0) { - printf("MppcCompressBufferRdp5: output mismatch: compressed output does not match Microsoft implementation\n"); + printf("MppcCompressBufferRdp5: output mismatch: compressed output does not match " + "Microsoft implementation\n"); goto fail; } @@ -1050,7 +1054,7 @@ static int test_MppcDecompressBufferRdp5(void) return -1; SrcSize = sizeof(TEST_RDP5_COMPRESSED_DATA); - pSrcData = (BYTE*) TEST_RDP5_COMPRESSED_DATA; + pSrcData = (BYTE*)TEST_RDP5_COMPRESSED_DATA; Flags = PACKET_AT_FRONT | PACKET_COMPRESSED | 1; expectedSize = sizeof(TEST_RDP5_UNCOMPRESSED_DATA); status = mppc_decompress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, Flags); @@ -1058,11 +1062,12 @@ static int test_MppcDecompressBufferRdp5(void) if (status < 0) goto fail; - printf("flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize); + printf("flags: 0x%08" PRIX32 " size: %" PRIu32 "\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("MppcDecompressBufferRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + printf("MppcDecompressBufferRdp5: output size mismatch: Actual: %" PRIu32 + ", Expected: %" PRIu32 "\n", DstSize, expectedSize); goto fail; } diff --git a/libfreerdp/codec/test/TestFreeRDPCodecNCrush.c b/libfreerdp/codec/test/TestFreeRDPCodecNCrush.c index c8864ad4e..00a8b779a 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecNCrush.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecNCrush.c @@ -27,7 +27,7 @@ static BOOL test_NCrushCompressBells(void) return rc; SrcSize = sizeof(TEST_BELLS_DATA) - 1; - pSrcData = (BYTE*) TEST_BELLS_DATA; + pSrcData = (BYTE*)TEST_BELLS_DATA; expectedSize = sizeof(TEST_BELLS_NCRUSH) - 1; pDstData = OutputBuffer; DstSize = sizeof(OutputBuffer); @@ -37,11 +37,12 @@ static BOOL test_NCrushCompressBells(void) if (status < 0) goto fail; - printf("status: %d Flags: 0x%08"PRIX32" DstSize: %"PRIu32"\n", status, Flags, DstSize); + printf("status: %d Flags: 0x%08" PRIX32 " DstSize: %" PRIu32 "\n", status, Flags, DstSize); if (DstSize != expectedSize) { - printf("NCrushCompressBells: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + printf("NCrushCompressBells: output size mismatch: Actual: %" PRIu32 ", Expected: %" PRIu32 + "\n", DstSize, expectedSize); printf("Actual\n"); BitDump(__FUNCTION__, WLOG_INFO, pDstData, DstSize * 8, 0); @@ -82,7 +83,7 @@ static BOOL test_NCrushDecompressBells(void) return rc; SrcSize = sizeof(TEST_BELLS_NCRUSH) - 1; - pSrcData = (BYTE*) TEST_BELLS_NCRUSH; + pSrcData = (BYTE*)TEST_BELLS_NCRUSH; Flags = PACKET_COMPRESSED | 2; expectedSize = sizeof(TEST_BELLS_DATA) - 1; status = ncrush_decompress(ncrush, pSrcData, SrcSize, &pDstData, &DstSize, Flags); @@ -90,11 +91,12 @@ static BOOL test_NCrushDecompressBells(void) if (status < 0) goto fail; - printf("Flags: 0x%08"PRIX32" DstSize: %"PRIu32"\n", Flags, DstSize); + printf("Flags: 0x%08" PRIX32 " DstSize: %" PRIu32 "\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("NCrushDecompressBells: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + printf("NCrushDecompressBells: output size mismatch: Actual: %" PRIu32 + ", Expected: %" PRIu32 "\n", DstSize, expectedSize); goto fail; } diff --git a/libfreerdp/codec/test/TestFreeRDPCodecPlanar.c b/libfreerdp/codec/test/TestFreeRDPCodecPlanar.c index 9ba35e29f..b1235ec8e 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecPlanar.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecPlanar.c @@ -14,2651 +14,5267 @@ */ static const BYTE TEST_RLE_BITMAP_EXPERIMENTAL_01[16384] = - "\x1B\x1A\x16\xFF\x1C\x1A\x16\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF\x17\x16\x12\xFF\x18\x16\x12\xFF\x19\x18\x14\xFF\x19\x18\x14\xFF" - "\x1D\x1C\x17\xFF\x1D\x1B\x17\xFF\x1C\x1B\x17\xFF\x1B\x1A\x16\xFF\x1A\x19\x15\xFF\x1A\x19\x15\xFF\x18\x17\x13\xFF\x1A\x19\x15\xFF" - "\x1B\x1A\x16\xFF\x19\x18\x14\xFF\x19\x18\x14\xFF\x18\x16\x14\xFF\x1C\x1A\x16\xFF\x1A\x18\x14\xFF\x1B\x1A\x16\xFF\x19\x17\x13\xFF" - "\x1B\x19\x16\xFF\x1A\x18\x15\xFF\x1A\x18\x13\xFF\x19\x17\x13\xFF\x1B\x19\x15\xFF\x1B\x1A\x16\xFF\x1A\x19\x15\xFF\x18\x16\x12\xFF" - "\x1A\x19\x15\xFF\x1C\x1B\x16\xFF\x1C\x1B\x17\xFF\x1D\x1C\x17\xFF\x1B\x1B\x16\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF\x1B\x19\x14\xFF" - "\x1A\x19\x15\xFF\x1A\x1A\x15\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x1C\x1B\x17\xFF\x1D\x1C\x17\xFF\x1B\x1A\x15\xFF\x18\x17\x12\xFF" - "\x1B\x1A\x16\xFF\x18\x17\x13\xFF\x1A\x19\x15\xFF\x1E\x1D\x18\xFF\x19\x18\x14\xFF\x1C\x1B\x17\xFF\x1C\x1A\x16\xFF\x1B\x1A\x18\xFF" - "\x1D\x1B\x16\xFF\x1E\x1B\x17\xFF\x1D\x1C\x18\xFF\x1B\x1A\x16\xFF\x1A\x1A\x14\xFF\x1B\x1B\x15\xFF\x1E\x1C\x17\xFF\x1D\x1B\x17\xFF" - "\x1C\x19\x15\xFF\x1D\x1C\x17\xFF\x1A\x19\x14\xFF\x1C\x1B\x17\xFF\x1E\x1D\x19\xFF\x1C\x1C\x17\xFF\x1B\x1C\x16\xFF\x1D\x1C\x18\xFF" - "\x1C\x1C\x16\xFF\x1D\x1C\x17\xFF\x1F\x1E\x19\xFF\x1A\x18\x14\xFF\x1B\x1A\x16\xFF\x1D\x1C\x18\xFF\x1D\x1C\x17\xFF\x1E\x1B\x19\xFF" - "\x1F\x1C\x18\xFF\x1D\x1C\x18\xFF\x20\x1F\x19\xFF\x1F\x1E\x19\xFF\x1B\x1A\x16\xFF\x1F\x1E\x1A\xFF\x1D\x1C\x17\xFF\x1F\x1C\x18\xFF" - "\x1F\x1D\x18\xFF\x1E\x1C\x18\xFF\x1D\x1C\x17\xFF\x1C\x1C\x16\xFF\x1D\x1C\x18\xFF\x1F\x1F\x19\xFF\x1D\x1C\x18\xFF\x1B\x1B\x16\xFF" - "\x1D\x1D\x17\xFF\x1F\x1E\x19\xFF\x1D\x1C\x16\xFF\x1B\x1A\x15\xFF\x1F\x1D\x19\xFF\x1E\x1C\x18\xFF\x1F\x1E\x1A\xFF\x22\x20\x1C\xFF" - "\x22\x20\x1B\xFF\x20\x1F\x1A\xFF\x1F\x1F\x1A\xFF\x1E\x1E\x1A\xFF\x1D\x1C\x18\xFF\x1F\x1D\x19\xFF\x20\x20\x1A\xFF\x22\x21\x1C\xFF" - "\x20\x1F\x1A\xFF\x1D\x1D\x18\xFF\x1E\x1D\x18\xFF\x22\x20\x1B\xFF\x20\x20\x1A\xFF\x1E\x1D\x18\xFF\x20\x20\x1B\xFF\x20\x1F\x1B\xFF" - "\x1F\x1D\x18\xFF\x1E\x1E\x19\xFF\x1E\x1E\x19\xFF\x1D\x1B\x18\xFF\x1D\x1B\x16\xFF\x1E\x1C\x17\xFF\x1B\x1A\x16\xFF\x1F\x1D\x18\xFF" - "\x1B\x1A\x16\xFF\x1A\x19\x15\xFF\x19\x18\x15\xFF\x1B\x19\x15\xFF\x1B\x19\x15\xFF\x18\x18\x14\xFF\x17\x17\x13\xFF\x19\x18\x15\xFF" - "\x15\x15\x11\xFF\x14\x13\x10\xFF\x4E\x4A\x3D\xFF\x21\x20\x1A\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1F\xFF" - "\x21\x20\x1A\xFF\x24\x23\x1F\xFF\x21\x20\x1A\xFF\x2A\x29\x23\xFF\x21\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x26\x25\x21\xFF\x25\x24\x20\xFF\x21\x20\x1A\xFF\x22\x20\x1B\xFF\x26\x25\x20\xFF" - "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x21\x1C\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x21\x20\x1A\xFF\x22\x21\x1C\xFF\x26\x25\x21\xFF\x23\x21\x1C\xFF" - "\x22\x20\x1A\xFF\x22\x20\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1C\xFF\x22\x22\x1C\xFF\x23\x22\x1D\xFF\x24\x23\x1E\xFF\x24\x24\x1E\xFF" - "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x29\x28\x23\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF" - "\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x24\x22\x1D\xFF\x22\x21\x1B\xFF\x23\x21\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1E\xFF" - "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x25\x24\x20\xFF\x23\x23\x1E\xFF\x24\x23\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" - "\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x25\x24\x20\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x22\x1D\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x21\x20\x1A\xFF\x22\x20\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x24\x22\x1D\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x23\x21\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x26\x24\x20\xFF\x24\x23\x1E\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1D\xFF\x21\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x21\x1C\xFF" - "\x22\x21\x1B\xFF\x28\x26\x21\xFF\x23\x22\x1C\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x26\x25\x20\xFF\x24\x23\x1E\xFF\x28\x26\x21\xFF" - "\x28\x26\x21\xFF\x22\x22\x1C\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x21\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x28\x26\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x25\x21\xFF" - "\x24\x23\x1E\xFF\x26\x25\x21\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x23\x22\x1E\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x25\x24\x20\xFF\x25\x25\x20\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x26\x25\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x25\x24\x1F\xFF" - "\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x2A\x29\x23\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF" - "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x26\x26\x21\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x27\x25\x20\xFF" - "\x22\x21\x1B\xFF\x26\x26\x20\xFF\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x27\x25\x20\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" - "\x23\x22\x1C\xFF\x23\x22\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x27\x26\x21\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x25\x24\x1F\xFF\x25\x24\x1F\xFF" - "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x29\x28\x23\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x29\x26\x21\xFF" - "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1E\xFF" - "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x26\x25\x20\xFF\x23\x23\x1E\xFF\x24\x23\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x25\x21\xFF\x29\x26\x21\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF" - "\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x27\x25\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x26\x24\x20\xFF\x23\x22\x1C\xFF\x26\x25\x21\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x23\x1E\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1E\xFF\x22\x21\x1B\xFF\x27\x25\x20\xFF\x23\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1E\xFF\x29\x26\x21\xFF\x23\x22\x1C\xFF" - "\x23\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x27\x26\x21\xFF\x24\x23\x1E\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x29\x26\x21\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x27\x26\x21\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x24\x23\x1E\xFF\x26\x24\x20\xFF\x23\x22\x1C\xFF\x26\x25\x20\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x28\x26\x21\xFF\x23\x22\x1C\xFF\x26\x25\x21\xFF\x23\x22\x1C\xFF\x26\x25\x20\xFF\x25\x24\x1F\xFF\x28\x26\x21\xFF" - "\x28\x26\x21\xFF\x22\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x4E\x49\x3C\xFF\x1A\x18\x14\xFF\x1A\x18\x15\xFF" - "\x1B\x1B\x16\xFF\x1D\x1B\x17\xFF\x1F\x1D\x19\xFF\x20\x1D\x19\xFF\x1E\x1D\x19\xFF\x1F\x1D\x19\xFF\x21\x20\x1B\xFF\x23\x21\x1C\xFF" - "\x22\x21\x1C\xFF\x25\x22\x1D\xFF\x25\x22\x1E\xFF\x25\x23\x1E\xFF\x25\x22\x1D\xFF\x25\x23\x1E\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF" - "\x26\x23\x1E\xFF\x25\x24\x1E\xFF\x26\x24\x1F\xFF\x25\x22\x1D\xFF\x26\x25\x1F\xFF\x27\x26\x20\xFF\x26\x25\x1F\xFF\x27\x24\x1F\xFF" - "\x27\x25\x20\xFF\x29\x26\x21\xFF\x26\x23\x1F\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF" - "\x27\x24\x1F\xFF\x28\x25\x20\xFF\x27\x26\x1F\xFF\x27\x24\x1F\xFF\x26\x23\x1F\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x2A\x27\x22\xFF" - "\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF\x26\x25\x20\xFF\x26\x24\x1E\xFF\x26\x23\x1D\xFF\x27\x24\x1F\xFF" - "\x26\x23\x1E\xFF\x26\x23\x1F\xFF\x24\x23\x1E\xFF\x26\x24\x1F\xFF\x27\x24\x1E\xFF\x27\x24\x20\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" - "\x28\x25\x20\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x28\x25\x20\xFF\x24\x23\x1E\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF\x26\x24\x1F\xFF" - "\x28\x26\x21\xFF\x28\x25\x20\xFF\x26\x23\x1E\xFF\x28\x26\x20\xFF\x25\x24\x1F\xFF\x27\x24\x1F\xFF\x29\x26\x21\xFF\x27\x24\x1F\xFF" - "\x25\x22\x1D\xFF\x25\x24\x1E\xFF\x29\x27\x20\xFF\x29\x26\x20\xFF\x28\x26\x20\xFF\x27\x26\x1F\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF" - "\x26\x25\x1F\xFF\x26\x25\x20\xFF\x27\x24\x1F\xFF\x25\x22\x1E\xFF\x24\x23\x1D\xFF\x23\x22\x1D\xFF\x24\x21\x1C\xFF\x26\x23\x1E\xFF" - "\x27\x24\x1E\xFF\x28\x27\x20\xFF\x27\x25\x1F\xFF\x27\x25\x20\xFF\x25\x22\x1D\xFF\x26\x24\x1E\xFF\x22\x20\x1A\xFF\x24\x24\x1D\xFF" - "\x28\x25\x20\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x26\x23\x1E\xFF\x26\x25\x1F\xFF\x27\x24\x1F\xFF\x26\x25\x1F\xFF" - "\x27\x25\x20\xFF\x28\x27\x21\xFF\x27\x25\x20\xFF\x26\x25\x1F\xFF\x26\x23\x1E\xFF\x22\x21\x1C\xFF\x25\x24\x1E\xFF\x26\x23\x1E\xFF" - "\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x25\x24\x1D\xFF\x23\x23\x1D\xFF\x25\x23\x1E\xFF\x27\x25\x20\xFF\x26\x24\x1E\xFF" - "\x25\x23\x1E\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x27\x26\x20\xFF\x29\x2F\x26\xFF\x3C\x70\x55\xFF\x54\xC5\x92\xFF\x57\xCD\x97\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF" - "\x56\xCC\x97\xFF\x4B\xA4\x7B\xFF\x2F\x47\x37\xFF\x26\x26\x20\xFF\x25\x23\x1D\xFF\x24\x23\x1D\xFF\x24\x22\x1D\xFF\x24\x22\x1D\xFF" - "\x26\x23\x1E\xFF\x27\x25\x20\xFF\x25\x22\x1D\xFF\x25\x22\x1D\xFF\x26\x24\x1F\xFF\x24\x23\x1D\xFF\x26\x24\x1F\xFF\x25\x25\x1D\xFF" - "\x27\x2D\x26\xFF\x39\x68\x50\xFF\x54\xC0\x8F\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x97\xFF\x56\xCD\x97\xFF\x49\x9F\x76\xFF\x2D\x42\x33\xFF\x24\x25\x20\xFF\x23\x22\x1D\xFF\x25\x22\x1D\xFF\x24\x21\x1C\xFF" - "\x22\x21\x1C\xFF\x25\x23\x1E\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF\x22\x20\x1B\xFF\x23\x22\x1C\xFF\x25\x25\x1F\xFF\x26\x24\x1E\xFF" - "\x24\x23\x1D\xFF\x24\x23\x1D\xFF\x26\x23\x1F\xFF\x23\x20\x1C\xFF\x28\x26\x1F\xFF\x25\x24\x1F\xFF\x25\x22\x1D\xFF\x24\x21\x1C\xFF" - "\x23\x23\x1D\xFF\x25\x22\x1E\xFF\x24\x22\x1E\xFF\x27\x24\x1F\xFF\x23\x21\x1B\xFF\x26\x25\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1E\xFF" - "\x26\x23\x1E\xFF\x28\x25\x20\xFF\x26\x23\x1E\xFF\x24\x21\x1C\xFF\x27\x26\x21\xFF\x25\x22\x1D\xFF\x22\x20\x1C\xFF\x25\x22\x1D\xFF" - "\x26\x24\x1E\xFF\x24\x23\x1D\xFF\x26\x25\x1F\xFF\x24\x22\x1E\xFF\x23\x21\x1C\xFF\x23\x22\x1D\xFF\x24\x22\x1D\xFF\x23\x21\x1C\xFF" - "\x24\x22\x1D\xFF\x24\x22\x1D\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF\x25\x22\x1D\xFF\x25\x23\x1E\xFF\x23\x20\x1B\xFF\x25\x22\x1D\xFF" - "\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x25\x22\x1E\xFF\x24\x21\x1D\xFF\x25\x23\x1E\xFF\x23\x22\x1C\xFF\x22\x21\x1C\xFF\x23\x1F\x1B\xFF" - "\x21\x21\x1B\xFF\x24\x22\x1D\xFF\x24\x23\x1D\xFF\x25\x23\x1E\xFF\x23\x20\x1C\xFF\x26\x24\x1E\xFF\x24\x22\x1D\xFF\x24\x22\x1D\xFF" - "\x21\x21\x1A\xFF\x21\x21\x1C\xFF\x20\x20\x1A\xFF\x22\x21\x1C\xFF\x26\x23\x1E\xFF\x21\x21\x1C\xFF\x22\x21\x1C\xFF\x23\x22\x1D\xFF" - "\x25\x23\x1C\xFF\x26\x23\x1E\xFF\x24\x22\x1D\xFF\x22\x22\x1C\xFF\x22\x22\x1C\xFF\x24\x22\x1D\xFF\x24\x23\x1D\xFF\x25\x22\x1D\xFF" - "\x22\x21\x1D\xFF\x21\x21\x1C\xFF\x23\x22\x1D\xFF\x23\x20\x1C\xFF\x21\x20\x1B\xFF\x24\x23\x1D\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF" - "\x22\x22\x1C\xFF\x24\x22\x1D\xFF\x23\x21\x1B\xFF\x22\x21\x1C\xFF\x24\x23\x1D\xFF\x23\x21\x1C\xFF\x21\x21\x1B\xFF\x24\x24\x1E\xFF" - "\x24\x22\x1D\xFF\x23\x22\x1D\xFF\x23\x22\x1D\xFF\x21\x20\x1B\xFF\x23\x21\x1C\xFF\x25\x24\x1E\xFF\x24\x21\x1C\xFF\x23\x21\x1C\xFF" - "\x21\x20\x1B\xFF\x22\x20\x1B\xFF\x21\x20\x1B\xFF\x23\x22\x1C\xFF\x23\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x22\x1C\xFF\x22\x22\x1D\xFF" - "\x24\x21\x1C\xFF\x21\x1F\x1B\xFF\x21\x1F\x1A\xFF\x20\x20\x19\xFF\x24\x22\x1B\xFF\x23\x22\x1C\xFF\x27\x25\x1E\xFF\x25\x24\x1E\xFF" - "\x26\x29\x23\xFF\x2F\x45\x37\xFF\x2B\x3E\x2F\xFF\x27\x26\x20\xFF\x21\x1F\x1A\xFF\x21\x20\x1C\xFF\x21\x20\x1B\xFF\x21\x21\x1B\xFF" - "\x20\x1F\x1A\xFF\x25\x23\x1E\xFF\x24\x23\x1D\xFF\x1F\x1E\x1A\xFF\x24\x22\x1C\xFF\x27\x23\x1F\xFF\x24\x22\x1E\xFF\x21\x20\x1C\xFF" - "\x1F\x1E\x19\xFF\x21\x1F\x1B\xFF\x21\x20\x1B\xFF\x22\x21\x1B\xFF\x25\x22\x1D\xFF\x21\x1F\x1A\xFF\x21\x1F\x1C\xFF\x21\x20\x1B\xFF" - "\x24\x21\x1C\xFF\x1F\x1D\x19\xFF\x22\x20\x1A\xFF\x22\x22\x1C\xFF\x22\x20\x1B\xFF\x21\x21\x1A\xFF\x20\x20\x1A\xFF\x21\x20\x1C\xFF" - "\x25\x24\x1E\xFF\x24\x22\x1D\xFF\x21\x20\x1B\xFF\x22\x1F\x1B\xFF\x22\x21\x1C\xFF\x23\x21\x1D\xFF\x20\x1F\x1C\xFF\x22\x21\x1C\xFF" - "\x15\x14\x11\xFF\x15\x13\x10\xFF\x15\x14\x10\xFF\x18\x17\x13\xFF\x16\x15\x11\xFF\x14\x13\x10\xFF\x15\x14\x10\xFF\x14\x13\x0F\xFF" - "\x12\x10\x0E\xFF\x11\x10\x0E\xFF\x10\x0F\x0D\xFF\x14\x12\x10\xFF\x14\x12\x0E\xFF\x14\x13\x0F\xFF\x15\x13\x10\xFF\x12\x10\x0D\xFF" - "\x12\x11\x0E\xFF\x12\x11\x0E\xFF\x17\x16\x12\xFF\x17\x15\x11\xFF\x18\x17\x13\xFF\x15\x13\x10\xFF\x16\x15\x12\xFF\x13\x12\x0E\xFF" - "\x12\x11\x0E\xFF\x14\x13\x0F\xFF\x13\x12\x0F\xFF\x12\x12\x0F\xFF\x15\x15\x11\xFF\x13\x12\x0F\xFF\x13\x11\x0E\xFF\x13\x12\x0F\xFF" - "\x13\x11\x0F\xFF\x13\x12\x0E\xFF\x14\x13\x0F\xFF\x15\x14\x10\xFF\x13\x11\x0F\xFF\x12\x12\x0F\xFF\x14\x13\x10\xFF\x14\x13\x0F\xFF" - "\x17\x16\x12\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x14\x13\x0F\xFF\x14\x13\x0F\xFF\x15\x14\x0F\xFF\x14\x13\x10\xFF\x14\x12\x10\xFF" - "\x15\x14\x10\xFF\x15\x13\x10\xFF\x15\x14\x10\xFF\x15\x13\x10\xFF\x11\x10\x0D\xFF\x14\x13\x10\xFF\x13\x12\x0E\xFF\x14\x12\x0F\xFF" - "\x16\x15\x10\xFF\x14\x13\x0F\xFF\x12\x10\x0E\xFF\x13\x11\x0F\xFF\x12\x10\x0F\xFF\x15\x14\x10\xFF\x15\x14\x11\xFF\x15\x13\x11\xFF" - "\x16\x15\x11\xFF\x17\x16\x12\xFF\x13\x12\x0E\xFF\x12\x11\x0D\xFF\x14\x13\x10\xFF\x17\x16\x12\xFF\x18\x17\x14\xFF\x17\x16\x13\xFF" - "\x15\x14\x10\xFF\x14\x13\x0F\xFF\x14\x13\x0F\xFF\x14\x13\x0F\xFF\x16\x14\x11\xFF\x16\x14\x12\xFF\x14\x13\x0F\xFF\x14\x12\x10\xFF" - "\x14\x13\x10\xFF\x15\x14\x12\xFF\x16\x14\x11\xFF\x15\x13\x0F\xFF\x14\x13\x10\xFF\x15\x13\x10\xFF\x18\x17\x13\xFF\x15\x13\x11\xFF" - "\x14\x13\x0F\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x15\x14\x11\xFF\x13\x12\x0F\xFF\x17\x15\x12\xFF\x15\x13\x11\xFF\x13\x12\x0E\xFF" - "\x17\x16\x13\xFF\x19\x18\x14\xFF\x18\x17\x14\xFF\x17\x16\x13\xFF\x15\x14\x10\xFF\x15\x14\x12\xFF\x14\x13\x0F\xFF\x15\x14\x11\xFF" - "\x16\x15\x11\xFF\x19\x18\x14\xFF\x18\x16\x13\xFF\x14\x13\x10\xFF\x14\x13\x0F\xFF\x15\x13\x11\xFF\x15\x14\x11\xFF\x14\x13\x10\xFF" - "\x15\x14\x11\xFF\x18\x17\x14\xFF\x17\x15\x12\xFF\x16\x15\x11\xFF\x18\x17\x13\xFF\x1B\x1A\x16\xFF\x1A\x19\x16\xFF\x16\x15\x11\xFF" - "\x16\x14\x12\xFF\x16\x15\x11\xFF\x17\x16\x13\xFF\x14\x13\x11\xFF\x17\x16\x12\xFF\x19\x19\x14\xFF\x16\x15\x12\xFF\x19\x18\x14\xFF" - "\x18\x17\x14\xFF\x18\x18\x13\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x17\x15\x13\xFF\x18\x17\x14\xFF\x17\x16\x13\xFF\x16\x15\x11\xFF" - "\x14\x13\x0F\xFF\x16\x15\x11\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF\x18\x17\x14\xFF\x15\x13\x12\xFF\x16\x15\x11\xFF\x18\x16\x12\xFF" - "\x14\x13\x0F\xFF\x15\x14\x10\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF\x1B\x1A\x16\xFF\x1A\x19\x15\xFF\x19\x18\x14\xFF\x16\x15\x11\xFF" - "\x15\x14\x10\xFF\x17\x16\x12\xFF\x19\x18\x13\xFF\x19\x18\x13\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF\x1B\x18\x15\xFF" - "\x17\x16\x12\xFF\x17\x16\x12\xFF\x19\x18\x14\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x1A\x19\x15\xFF\x1B\x19\x15\xFF\x1A\x19\x14\xFF" - "\x16\x15\x11\xFF\x1A\x19\x15\xFF\x1A\x18\x15\xFF\x17\x16\x12\xFF\x19\x19\x14\xFF\x19\x18\x14\xFF\x17\x16\x12\xFF\x18\x16\x12\xFF" - "\x19\x18\x14\xFF\x19\x18\x14\xFF\x1B\x1A\x16\xFF\x1C\x1A\x16\xFF\x17\x15\x11\xFF\x19\x19\x14\xFF\x19\x19\x14\xFF\x19\x18\x14\xFF" - "\x1D\x1B\x17\xFF\x1A\x19\x14\xFF\x1A\x19\x15\xFF\x17\x16\x12\xFF\x19\x18\x14\xFF\x19\x17\x14\xFF\x19\x18\x14\xFF\x19\x18\x13\xFF" - "\x1B\x1A\x16\xFF\x1B\x1A\x16\xFF\x19\x17\x13\xFF\x18\x17\x13\xFF\x1A\x18\x14\xFF\x1C\x1A\x16\xFF\x1D\x1C\x17\xFF\x1F\x1E\x19\xFF" - "\x19\x18\x14\xFF\x18\x17\x12\xFF\x18\x17\x12\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF" - "\x1B\x19\x15\xFF\x1B\x19\x15\xFF\x1A\x18\x14\xFF\x17\x16\x12\xFF\x16\x16\x11\xFF\x1A\x18\x14\xFF\x1B\x19\x15\xFF\x1E\x1C\x18\xFF" - "\x1B\x1A\x16\xFF\x1C\x1A\x15\xFF\x19\x18\x14\xFF\x1A\x18\x14\xFF\x1C\x1A\x16\xFF\x1C\x1A\x17\xFF\x1C\x1B\x17\xFF\x1A\x18\x14\xFF" - "\x1B\x19\x15\xFF\x1A\x18\x14\xFF\x1A\x19\x15\xFF\x1B\x1A\x16\xFF\x1B\x1A\x16\xFF\x1B\x1A\x15\xFF\x1C\x1C\x17\xFF\x1C\x1C\x17\xFF" - "\x1B\x19\x15\xFF\x1A\x19\x15\xFF\x1B\x19\x15\xFF\x1D\x1C\x17\xFF\x1C\x1A\x16\xFF\x1C\x1C\x17\xFF\x1C\x1B\x16\xFF\x1D\x1C\x17\xFF" - "\x1D\x1B\x17\xFF\x19\x19\x14\xFF\x1B\x1A\x16\xFF\x1F\x1D\x18\xFF\x1E\x1E\x18\xFF\x1E\x1D\x18\xFF\x1D\x1B\x18\xFF\x1D\x1B\x17\xFF" - "\x1B\x1A\x15\xFF\x1A\x1A\x15\xFF\x1C\x1B\x16\xFF\x1E\x1C\x18\xFF\x1A\x19\x15\xFF\x1A\x19\x15\xFF\x1D\x1C\x17\xFF\x1C\x19\x15\xFF" - "\x1D\x1B\x17\xFF\x1B\x1A\x15\xFF\x1A\x1A\x15\xFF\x1C\x1B\x16\xFF\x22\x20\x1B\xFF\x1E\x1D\x18\xFF\x1D\x1C\x18\xFF\x1C\x1C\x17\xFF" - "\x1B\x1B\x15\xFF\x1B\x1A\x16\xFF\x1A\x19\x15\xFF\x1A\x19\x15\xFF\x1D\x1C\x18\xFF\x1B\x19\x15\xFF\x1D\x1B\x17\xFF\x1B\x1B\x16\xFF" - "\x1F\x1C\x18\xFF\x1E\x1C\x18\xFF\x1F\x1C\x18\xFF\x1E\x1C\x18\xFF\x1C\x1C\x18\xFF\x1D\x1C\x18\xFF\x1D\x1B\x17\xFF\x1E\x1B\x17\xFF" - "\x1D\x1B\x17\xFF\x1D\x1C\x17\xFF\x1E\x1E\x19\xFF\x1E\x1D\x19\xFF\x1C\x1C\x18\xFF\x20\x1F\x19\xFF\x1F\x1D\x1A\xFF\x1F\x1E\x19\xFF" - "\x1D\x1B\x17\xFF\x1C\x1B\x17\xFF\x1B\x1A\x16\xFF\x1B\x1A\x16\xFF\x1E\x1C\x17\xFF\x1A\x19\x15\xFF\x20\x1F\x1A\xFF\x1E\x1D\x18\xFF" - "\x1E\x1D\x18\xFF\x1F\x1D\x19\xFF\x1F\x1E\x1A\xFF\x1F\x1D\x19\xFF\x1D\x1C\x18\xFF\x1E\x1C\x18\xFF\x1D\x1C\x18\xFF\x21\x20\x1B\xFF" - "\x1E\x1E\x19\xFF\x20\x1F\x1A\xFF\x20\x1E\x1A\xFF\x20\x1F\x1A\xFF\x20\x20\x1A\xFF\x21\x20\x1A\xFF\x23\x21\x1B\xFF\x21\x21\x1B\xFF" - "\x1E\x1D\x19\xFF\x1E\x1D\x18\xFF\x1F\x1E\x1A\xFF\x1C\x1B\x18\xFF\x1D\x1C\x17\xFF\x1E\x1C\x17\xFF\x1C\x1B\x17\xFF\x1E\x1D\x18\xFF" - "\x1B\x1A\x16\xFF\x1B\x1B\x16\xFF\x1A\x1A\x15\xFF\x19\x19\x15\xFF\x18\x18\x14\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF\x1A\x19\x15\xFF" - "\x15\x14\x11\xFF\x15\x14\x11\xFF\x51\x4E\x41\xFF\x21\x20\x1A\xFF\x26\x25\x20\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF" - "\x21\x20\x1A\xFF\x22\x21\x1C\xFF\x21\x20\x1A\xFF\x21\x20\x1A\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF" - "\x28\x26\x21\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1D\xFF\x24\x23\x1E\xFF\x21\x20\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1C\xFF\x24\x23\x1E\xFF\x24\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" - "\x22\x21\x1B\xFF\x28\x26\x21\xFF\x23\x21\x1C\xFF\x22\x21\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x24\x23\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x21\x1C\xFF" - "\x22\x21\x1B\xFF\x25\x23\x1E\xFF\x25\x24\x20\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x24\x23\x1D\xFF\x25\x23\x1F\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x25\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x21\x1C\xFF\x21\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x25\x24\x20\xFF\x26\x25\x20\xFF\x25\x24\x20\xFF\x23\x23\x1E\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF" - "\x25\x24\x20\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x25\x25\x20\xFF\x22\x21\x1B\xFF" - "\x26\x24\x20\xFF\x22\x21\x1B\xFF\x22\x22\x1C\xFF\x29\x28\x22\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF\x29\x28\x23\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x25\x25\x20\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x29\x28\x23\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x23\x21\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF" - "\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x27\x25\x20\xFF\x22\x21\x1B\xFF\x27\x25\x21\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF" - "\x23\x22\x1D\xFF\x23\x22\x1D\xFF\x25\x24\x1F\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x28\x26\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x24\x22\x1D\xFF" - "\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x25\x24\x1F\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x28\x26\x21\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x28\x26\x21\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF" - "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF" - "\x28\x26\x21\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x25\x20\xFF\x23\x22\x1E\xFF\x25\x23\x1E\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x23\x1E\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF" - "\x23\x22\x1C\xFF\x28\x26\x21\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x23\x1E\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x27\x25\x20\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x26\x25\x20\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x25\x24\x1F\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x26\x26\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x27\x25\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x26\x25\x21\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x26\x25\x20\xFF\x26\x25\x20\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF" - "\x26\x25\x21\xFF\x29\x27\x21\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x26\x26\x20\xFF\x22\x21\x1B\xFF" - "\x26\x24\x20\xFF\x22\x21\x1B\xFF\x22\x22\x1C\xFF\x29\x28\x22\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF\x29\x28\x23\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF\x26\x26\x21\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x29\x28\x23\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x27\x25\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF" - "\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x27\x25\x20\xFF\x22\x21\x1B\xFF\x27\x25\x21\xFF\x4F\x4A\x3D\xFF\x19\x18\x15\xFF\x1A\x19\x15\xFF" - "\x1D\x1B\x17\xFF\x1D\x1B\x17\xFF\x1E\x1C\x18\xFF\x1F\x1D\x18\xFF\x1D\x1B\x17\xFF\x1F\x1D\x19\xFF\x21\x1E\x1A\xFF\x22\x21\x1C\xFF" - "\x24\x22\x1D\xFF\x25\x22\x1C\xFF\x23\x22\x1D\xFF\x25\x22\x1D\xFF\x27\x24\x1F\xFF\x26\x23\x1F\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF" - "\x26\x23\x1E\xFF\x25\x23\x1E\xFF\x24\x23\x1D\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1E\xFF" - "\x25\x24\x1E\xFF\x29\x26\x21\xFF\x28\x25\x1F\xFF\x27\x25\x1F\xFF\x28\x26\x21\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF\x28\x27\x21\xFF" - "\x28\x25\x20\xFF\x28\x25\x1F\xFF\x27\x24\x1F\xFF\x28\x26\x1F\xFF\x25\x24\x1E\xFF\x26\x25\x1F\xFF\x26\x25\x1F\xFF\x28\x26\x1F\xFF" - "\x27\x24\x1F\xFF\x29\x26\x20\xFF\x27\x25\x1F\xFF\x25\x25\x1F\xFF\x27\x25\x1F\xFF\x27\x25\x1F\xFF\x27\x25\x1F\xFF\x27\x25\x20\xFF" - "\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x24\x24\x1E\xFF\x29\x26\x21\xFF\x28\x26\x1F\xFF\x26\x25\x1F\xFF\x25\x23\x1E\xFF\x26\x25\x1D\xFF" - "\x26\x23\x1E\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x27\x25\x20\xFF\x25\x24\x1E\xFF\x25\x24\x1E\xFF\x26\x24\x1E\xFF\x26\x24\x1F\xFF" - "\x26\x24\x1F\xFF\x28\x25\x20\xFF\x2A\x26\x21\xFF\x27\x26\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x28\x26\x20\xFF\x28\x25\x20\xFF" - "\x25\x23\x1E\xFF\x27\x25\x1F\xFF\x29\x26\x20\xFF\x24\x22\x1D\xFF\x26\x25\x20\xFF\x25\x24\x1F\xFF\x26\x23\x1E\xFF\x26\x24\x1F\xFF" - "\x26\x24\x1F\xFF\x26\x25\x20\xFF\x26\x25\x20\xFF\x25\x23\x1E\xFF\x27\x26\x1F\xFF\x26\x24\x1E\xFF\x24\x22\x1D\xFF\x26\x23\x1E\xFF" - "\x26\x24\x1E\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF" - "\x26\x22\x1D\xFF\x24\x21\x1C\xFF\x25\x23\x1E\xFF\x29\x28\x22\xFF\x25\x22\x1C\xFF\x27\x25\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" - "\x27\x23\x1E\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x25\x23\x1D\xFF\x25\x22\x1D\xFF\x24\x22\x1D\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF" - "\x29\x26\x20\xFF\x26\x24\x1E\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x25\x24\x1E\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF" - "\x26\x25\x1F\xFF\x28\x25\x20\xFF\x25\x23\x1E\xFF\x25\x23\x1D\xFF\x28\x2B\x23\xFF\x35\x57\x43\xFF\x4E\xB1\x84\xFF\x57\xCD\x98\xFF" - "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x51\xBB\x8A\xFF\x36\x60\x49\xFF\x25\x2A\x23\xFF\x27\x25\x1F\xFF\x26\x23\x1E\xFF\x25\x22\x1D\xFF\x25\x23\x1E\xFF" - "\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x24\x21\x1D\xFF\x27\x24\x1F\xFF\x25\x25\x1F\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF\x26\x24\x1E\xFF" - "\x28\x2A\x23\xFF\x33\x50\x3D\xFF\x4E\xAC\x80\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x52\xBF\x8D\xFF\x34\x58\x43\xFF\x26\x28\x21\xFF\x24\x23\x1E\xFF\x25\x23\x1E\xFF\x27\x24\x1F\xFF" - "\x22\x22\x1C\xFF\x22\x22\x1B\xFF\x25\x22\x1E\xFF\x27\x24\x1F\xFF\x24\x23\x1D\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF" - "\x25\x22\x1D\xFF\x25\x23\x1E\xFF\x24\x22\x1E\xFF\x22\x21\x1B\xFF\x25\x22\x1D\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x24\x21\x1C\xFF" - "\x24\x23\x1D\xFF\x23\x21\x1C\xFF\x25\x23\x1E\xFF\x27\x24\x1F\xFF\x22\x22\x1C\xFF\x23\x23\x1D\xFF\x24\x23\x1E\xFF\x25\x23\x1E\xFF" - "\x23\x21\x1C\xFF\x25\x23\x1E\xFF\x25\x22\x1D\xFF\x23\x22\x1C\xFF\x26\x25\x1F\xFF\x23\x22\x1D\xFF\x21\x21\x1C\xFF\x25\x23\x1E\xFF" - "\x26\x25\x1F\xFF\x25\x23\x1E\xFF\x26\x24\x1F\xFF\x25\x22\x1D\xFF\x24\x23\x1D\xFF\x22\x21\x1C\xFF\x25\x22\x1D\xFF\x23\x21\x1B\xFF" - "\x25\x22\x1D\xFF\x24\x21\x1C\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x24\x22\x1D\xFF\x24\x23\x1D\xFF\x23\x22\x1C\xFF\x23\x22\x1D\xFF" - "\x24\x22\x1D\xFF\x25\x23\x1E\xFF\x22\x21\x1C\xFF\x23\x22\x1D\xFF\x25\x22\x1D\xFF\x24\x23\x1D\xFF\x23\x22\x1C\xFF\x24\x22\x1D\xFF" - "\x24\x23\x1D\xFF\x24\x23\x1D\xFF\x25\x22\x1D\xFF\x23\x22\x1D\xFF\x25\x23\x1E\xFF\x25\x24\x1D\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF" - "\x22\x22\x1D\xFF\x23\x22\x1D\xFF\x24\x23\x1D\xFF\x24\x22\x1E\xFF\x24\x23\x1E\xFF\x22\x22\x1C\xFF\x24\x22\x1D\xFF\x23\x21\x1C\xFF" - "\x26\x23\x1E\xFF\x24\x23\x1E\xFF\x23\x21\x1C\xFF\x23\x22\x1C\xFF\x24\x22\x1D\xFF\x25\x22\x1D\xFF\x25\x23\x1D\xFF\x25\x23\x1E\xFF" - "\x25\x23\x1E\xFF\x24\x22\x1E\xFF\x24\x23\x1E\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF\x26\x24\x1F\xFF" - "\x25\x23\x1D\xFF\x25\x23\x1D\xFF\x23\x22\x1C\xFF\x25\x22\x1D\xFF\x24\x23\x1D\xFF\x24\x22\x1C\xFF\x22\x20\x1B\xFF\x23\x21\x1C\xFF" - "\x22\x22\x1C\xFF\x24\x21\x1D\xFF\x23\x22\x1D\xFF\x25\x22\x1D\xFF\x23\x22\x1C\xFF\x25\x23\x1D\xFF\x24\x21\x1C\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1C\xFF\x26\x23\x1E\xFF\x22\x21\x1C\xFF\x22\x20\x1B\xFF\x24\x21\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x22\x1D\xFF" - "\x24\x21\x1C\xFF\x24\x21\x1C\xFF\x23\x20\x1B\xFF\x20\x20\x19\xFF\x26\x23\x1E\xFF\x25\x23\x1C\xFF\x23\x22\x1C\xFF\x21\x22\x1B\xFF" - "\x22\x22\x1D\xFF\x27\x2C\x24\xFF\x26\x2A\x23\xFF\x23\x24\x1C\xFF\x23\x24\x1E\xFF\x23\x22\x1D\xFF\x24\x23\x1D\xFF\x22\x22\x1B\xFF" - "\x24\x22\x1D\xFF\x21\x1F\x1A\xFF\x22\x20\x1B\xFF\x21\x20\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x1E\xFF\x23\x22\x1D\xFF\x1F\x1F\x19\xFF" - "\x22\x21\x1B\xFF\x23\x20\x1B\xFF\x24\x22\x1D\xFF\x24\x23\x1D\xFF\x28\x25\x1E\xFF\x25\x22\x1D\xFF\x23\x22\x1D\xFF\x1F\x1E\x19\xFF" - "\x22\x22\x1C\xFF\x20\x1F\x1B\xFF\x22\x20\x1C\xFF\x20\x20\x1B\xFF\x21\x1F\x1B\xFF\x22\x21\x1C\xFF\x21\x20\x1B\xFF\x24\x22\x1D\xFF" - "\x26\x23\x1E\xFF\x26\x23\x1F\xFF\x24\x22\x1D\xFF\x22\x21\x1B\xFF\x24\x23\x1D\xFF\x23\x22\x1D\xFF\x23\x22\x1C\xFF\x25\x24\x1D\xFF" - "\x14\x12\x0F\xFF\x14\x13\x0F\xFF\x13\x12\x0F\xFF\x18\x17\x13\xFF\x13\x12\x0E\xFF\x14\x12\x10\xFF\x16\x13\x10\xFF\x14\x14\x0E\xFF" - "\x12\x10\x0E\xFF\x0F\x0E\x0B\xFF\x11\x10\x0D\xFF\x15\x13\x11\xFF\x16\x14\x10\xFF\x14\x12\x10\xFF\x15\x14\x10\xFF\x14\x13\x10\xFF" - "\x14\x13\x10\xFF\x11\x10\x0F\xFF\x14\x14\x10\xFF\x15\x14\x10\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x19\x18\x14\xFF\x15\x14\x10\xFF" - "\x12\x10\x0E\xFF\x10\x10\x0C\xFF\x10\x0F\x0D\xFF\x13\x12\x0F\xFF\x16\x15\x11\xFF\x14\x12\x10\xFF\x14\x13\x10\xFF\x14\x13\x10\xFF" - "\x12\x10\x0F\xFF\x13\x12\x0F\xFF\x15\x13\x11\xFF\x14\x13\x0F\xFF\x14\x13\x10\xFF\x14\x13\x10\xFF\x13\x11\x0F\xFF\x15\x13\x11\xFF" - "\x15\x14\x11\xFF\x13\x12\x0E\xFF\x12\x11\x0E\xFF\x12\x10\x0E\xFF\x12\x11\x0D\xFF\x14\x13\x0F\xFF\x14\x14\x0F\xFF\x12\x11\x0D\xFF" - "\x12\x11\x0E\xFF\x15\x13\x11\xFF\x15\x14\x11\xFF\x15\x14\x11\xFF\x12\x12\x0F\xFF\x14\x14\x0F\xFF\x14\x13\x11\xFF\x14\x13\x10\xFF" - "\x17\x16\x12\xFF\x15\x14\x10\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x14\x12\x10\xFF\x14\x12\x10\xFF\x15\x14\x10\xFF\x13\x12\x0E\xFF" - "\x14\x13\x0F\xFF\x13\x12\x0E\xFF\x11\x10\x0D\xFF\x11\x10\x0C\xFF\x15\x14\x10\xFF\x17\x16\x12\xFF\x16\x14\x11\xFF\x18\x17\x13\xFF" - "\x13\x11\x10\xFF\x14\x12\x10\xFF\x16\x15\x11\xFF\x14\x13\x0F\xFF\x12\x12\x10\xFF\x15\x13\x10\xFF\x12\x12\x0F\xFF\x0F\x0F\x0D\xFF" - "\x13\x11\x10\xFF\x14\x13\x10\xFF\x17\x14\x11\xFF\x15\x14\x10\xFF\x13\x12\x0E\xFF\x12\x11\x0F\xFF\x14\x13\x0F\xFF\x13\x11\x10\xFF" - "\x15\x14\x11\xFF\x16\x15\x11\xFF\x19\x18\x14\xFF\x15\x14\x11\xFF\x13\x11\x0E\xFF\x13\x11\x10\xFF\x14\x13\x11\xFF\x12\x11\x0F\xFF" - "\x17\x16\x12\xFF\x19\x18\x14\xFF\x18\x16\x12\xFF\x18\x16\x13\xFF\x14\x13\x11\xFF\x14\x13\x10\xFF\x17\x15\x14\xFF\x15\x14\x10\xFF" - "\x18\x17\x13\xFF\x18\x17\x12\xFF\x18\x17\x13\xFF\x1A\x19\x15\xFF\x14\x13\x0F\xFF\x16\x14\x12\xFF\x17\x16\x12\xFF\x14\x13\x0F\xFF" - "\x14\x12\x11\xFF\x18\x17\x13\xFF\x15\x14\x11\xFF\x15\x13\x11\xFF\x14\x13\x0F\xFF\x19\x16\x12\xFF\x1A\x19\x15\xFF\x17\x16\x12\xFF" - "\x15\x13\x11\xFF\x14\x13\x0F\xFF\x15\x14\x10\xFF\x14\x13\x10\xFF\x18\x17\x12\xFF\x15\x14\x11\xFF\x16\x14\x11\xFF\x17\x16\x12\xFF" - "\x19\x17\x13\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x19\x18\x13\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF\x18\x18\x14\xFF\x17\x16\x12\xFF" - "\x15\x14\x10\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF\x1B\x1A\x16\xFF\x1B\x1A\x16\xFF\x18\x17\x14\xFF\x18\x16\x13\xFF\x1B\x19\x15\xFF" - "\x17\x15\x11\xFF\x14\x15\x11\xFF\x15\x15\x11\xFF\x15\x14\x10\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x1B\x1A\x16\xFF" - "\x19\x18\x14\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF\x18\x17\x12\xFF\x14\x13\x0F\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF\x17\x15\x11\xFF" - "\x19\x18\x14\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x16\x14\x11\xFF\x1B\x1A\x16\xFF" - "\x1A\x19\x15\xFF\x1A\x19\x16\xFF\x19\x19\x15\xFF\x17\x15\x13\xFF\x19\x18\x14\xFF\x19\x18\x14\xFF\x16\x15\x11\xFF\x1A\x19\x15\xFF" - "\x1F\x1D\x19\xFF\x19\x18\x14\xFF\x1B\x19\x15\xFF\x1B\x1A\x15\xFF\x18\x17\x13\xFF\x1A\x18\x14\xFF\x19\x18\x14\xFF\x19\x17\x13\xFF" - "\x1B\x1A\x16\xFF\x19\x18\x14\xFF\x1A\x19\x15\xFF\x1A\x19\x15\xFF\x1D\x1C\x18\xFF\x19\x18\x14\xFF\x18\x17\x14\xFF\x18\x16\x13\xFF" - "\x19\x17\x13\xFF\x1D\x1A\x16\xFF\x1A\x19\x15\xFF\x17\x16\x12\xFF\x1A\x18\x14\xFF\x19\x18\x14\xFF\x18\x17\x14\xFF\x1A\x19\x15\xFF" - "\x19\x18\x14\xFF\x19\x18\x13\xFF\x19\x17\x13\xFF\x19\x17\x13\xFF\x1C\x1A\x16\xFF\x1B\x19\x15\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF" - "\x1A\x18\x14\xFF\x1C\x1A\x16\xFF\x19\x17\x13\xFF\x17\x16\x12\xFF\x1B\x1A\x16\xFF\x1E\x1B\x17\xFF\x1A\x17\x14\xFF\x19\x18\x14\xFF" - "\x1B\x1A\x16\xFF\x19\x18\x14\xFF\x1B\x19\x15\xFF\x1D\x1A\x16\xFF\x1C\x1B\x17\xFF\x1B\x1A\x16\xFF\x1C\x1B\x17\xFF\x1C\x1B\x16\xFF" - "\x1D\x1C\x18\xFF\x18\x16\x12\xFF\x19\x17\x15\xFF\x19\x18\x15\xFF\x1A\x19\x15\xFF\x1C\x1A\x16\xFF\x1E\x1C\x18\xFF\x20\x1F\x1A\xFF" - "\x18\x17\x13\xFF\x18\x16\x12\xFF\x1B\x19\x14\xFF\x1D\x1D\x17\xFF\x19\x1A\x15\xFF\x1F\x1E\x19\xFF\x1F\x1D\x19\xFF\x20\x1E\x19\xFF" - "\x1A\x19\x14\xFF\x1A\x18\x14\xFF\x1A\x19\x15\xFF\x1D\x1B\x17\xFF\x20\x1D\x1A\xFF\x1F\x1F\x19\xFF\x1E\x1D\x19\xFF\x1B\x19\x16\xFF" - "\x1C\x1B\x16\xFF\x1B\x1B\x16\xFF\x1D\x1C\x17\xFF\x1F\x1D\x18\xFF\x1B\x1B\x16\xFF\x1A\x19\x15\xFF\x1C\x1A\x16\xFF\x1D\x1B\x17\xFF" - "\x1D\x1C\x16\xFF\x19\x18\x14\xFF\x1A\x1A\x15\xFF\x1D\x1D\x17\xFF\x21\x1E\x1A\xFF\x1D\x1D\x18\xFF\x1F\x1E\x19\xFF\x1B\x1A\x16\xFF" - "\x1C\x1B\x16\xFF\x1D\x1C\x18\xFF\x1C\x1B\x16\xFF\x1A\x19\x15\xFF\x1A\x1A\x15\xFF\x1D\x1C\x18\xFF\x1F\x1D\x19\xFF\x1F\x1C\x18\xFF" - "\x1D\x1C\x16\xFF\x1E\x1D\x19\xFF\x1D\x1C\x18\xFF\x1D\x1A\x16\xFF\x1E\x1F\x19\xFF\x1F\x1E\x1A\xFF\x1E\x1C\x19\xFF\x20\x1E\x1A\xFF" - "\x1E\x1D\x18\xFF\x1E\x1C\x16\xFF\x1C\x1C\x17\xFF\x1D\x1D\x17\xFF\x1B\x1A\x16\xFF\x1C\x1A\x16\xFF\x1E\x1C\x18\xFF\x22\x20\x1B\xFF" - "\x1F\x1D\x18\xFF\x1D\x1C\x18\xFF\x1F\x1E\x19\xFF\x20\x1E\x1A\xFF\x1E\x1E\x18\xFF\x1F\x1D\x19\xFF\x1E\x1D\x18\xFF\x1D\x1C\x17\xFF" - "\x1F\x1E\x1A\xFF\x22\x21\x1C\xFF\x21\x20\x1A\xFF\x1E\x1E\x18\xFF\x1C\x1A\x16\xFF\x1F\x1D\x19\xFF\x21\x1F\x1A\xFF\x23\x20\x1B\xFF" - "\x1F\x1F\x1A\xFF\x22\x21\x1C\xFF\x21\x20\x1B\xFF\x22\x22\x1C\xFF\x1C\x1C\x18\xFF\x1D\x1D\x19\xFF\x22\x1F\x1A\xFF\x1F\x1E\x19\xFF" - "\x1A\x1A\x15\xFF\x1C\x1B\x16\xFF\x1D\x1A\x17\xFF\x1C\x1B\x18\xFF\x1F\x1E\x19\xFF\x1C\x1B\x16\xFF\x1B\x1A\x16\xFF\x1E\x1B\x17\xFF" - "\x1A\x1B\x17\xFF\x1D\x1B\x16\xFF\x1C\x1B\x17\xFF\x19\x18\x15\xFF\x17\x16\x13\xFF\x17\x16\x13\xFF\x19\x17\x14\xFF\x19\x19\x15\xFF" - "\x16\x16\x12\xFF\x15\x15\x11\xFF\x50\x4C\x40\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x21\x20\x1A\xFF\x21\x20\x1B\xFF\x24\x22\x1D\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x21\x20\x1A\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x28\x27\x21\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x23\x22\x1D\xFF\x21\x20\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1C\xFF\x23\x21\x1C\xFF\x22\x22\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" - "\x23\x22\x1C\xFF\x21\x20\x1B\xFF\x22\x20\x1B\xFF\x23\x21\x1C\xFF\x23\x21\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF" - "\x21\x20\x1A\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1D\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1D\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x29\x28\x23\xFF\x22\x21\x1B\xFF\x21\x20\x1A\xFF" - "\x26\x25\x20\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x23\x21\x1C\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x25\x20\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x21\x20\x1A\xFF\x21\x21\x1B\xFF" - "\x25\x24\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x23\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" - "\x23\x21\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x23\x1E\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x22\x20\x1B\xFF\x22\x21\x1B\xFF" - "\x24\x22\x1E\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x26\x25\x20\xFF\x22\x20\x1B\xFF\x26\x25\x20\xFF\x29\x28\x23\xFF\x26\x25\x20\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x29\x28\x23\xFF\x22\x21\x1B\xFF" - "\x23\x21\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1D\xFF\x22\x22\x1C\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x22\x1D\xFF" - "\x24\x23\x1E\xFF\x22\x22\x1C\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x24\x23\x1D\xFF\x22\x21\x1B\xFF\x24\x22\x1D\xFF\x24\x22\x1D\xFF" - "\x22\x20\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x21\x1C\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF" - "\x26\x24\x20\xFF\x27\x25\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1C\xFF" - "\x25\x24\x20\xFF\x25\x24\x1F\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x28\x26\x21\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x25\x25\x20\xFF\x22\x21\x1B\xFF\x29\x28\x23\xFF\x25\x24\x1F\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x2A\x29\x23\xFF\x26\x25\x20\xFF\x22\x20\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF\x23\x21\x1C\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF" - "\x23\x22\x1C\xFF\x27\x25\x21\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x26\x24\x20\xFF" - "\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x27\x25\x20\xFF\x25\x24\x20\xFF" - "\x27\x25\x20\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" - "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x23\x1E\xFF\x22\x21\x1B\xFF\x29\x28\x22\xFF\x27\x25\x20\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1E\xFF\x22\x21\x1B\xFF" - "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x29\x28\x23\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x27\x25\x20\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" - "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x27\x25\x20\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x26\x24\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x23\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" - "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x25\x24\x1E\xFF\x27\x26\x20\xFF\x22\x21\x1B\xFF\x27\x25\x20\xFF\x29\x28\x23\xFF\x26\x25\x21\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x29\x28\x23\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" - "\x24\x23\x1E\xFF\x22\x22\x1C\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x29\x26\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF" - "\x26\x25\x20\xFF\x26\x26\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" - "\x26\x25\x20\xFF\x25\x24\x1F\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x28\x26\x21\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x29\x28\x23\xFF\x25\x24\x1F\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x2A\x29\x23\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x27\x25\x21\xFF\x4F\x4A\x3D\xFF\x19\x18\x15\xFF\x1B\x1A\x16\xFF" - "\x1D\x1B\x16\xFF\x1D\x1D\x17\xFF\x1D\x1C\x18\xFF\x1E\x1E\x19\xFF\x20\x1D\x19\xFF\x22\x1F\x1B\xFF\x22\x20\x1B\xFF\x24\x21\x1D\xFF" - "\x22\x1F\x1B\xFF\x24\x22\x1D\xFF\x25\x22\x1E\xFF\x26\x24\x1F\xFF\x25\x24\x1E\xFF\x23\x23\x1D\xFF\x25\x22\x1D\xFF\x27\x23\x1E\xFF" - "\x26\x23\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x25\x25\x1F\xFF\x28\x27\x20\xFF\x28\x26\x21\xFF\x27\x24\x1F\xFF" - "\x25\x24\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x1F\xFF\x28\x26\x21\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x26\x24\x1F\xFF" - "\x27\x26\x20\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF\x27\x25\x20\xFF\x28\x25\x20\xFF\x24\x23\x1E\xFF\x26\x24\x1E\xFF" - "\x25\x23\x1E\xFF\x27\x26\x20\xFF\x27\x25\x1F\xFF\x29\x27\x20\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF" - "\x28\x25\x20\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x24\x23\x1E\xFF\x25\x23\x1E\xFF\x27\x25\x1F\xFF" - "\x27\x25\x1E\xFF\x27\x25\x20\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF\x25\x26\x1E\xFF\x26\x25\x1F\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF" - "\x28\x26\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x23\x22\x1D\xFF\x28\x25\x20\xFF\x29\x27\x20\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF" - "\x23\x22\x1C\xFF\x28\x25\x1F\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x25\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF" - "\x27\x24\x1F\xFF\x27\x25\x1F\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x26\x25\x20\xFF\x26\x24\x1F\xFF\x23\x23\x1E\xFF\x26\x23\x1E\xFF" - "\x24\x23\x1E\xFF\x25\x24\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1E\xFF\x27\x26\x1F\xFF\x26\x23\x1E\xFF\x25\x22\x1D\xFF" - "\x26\x23\x1E\xFF\x26\x24\x1E\xFF\x27\x26\x20\xFF\x28\x26\x21\xFF\x25\x22\x1D\xFF\x27\x26\x1F\xFF\x27\x25\x1E\xFF\x24\x23\x1D\xFF" - "\x24\x22\x1E\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x25\x26\x1D\xFF\x29\x26\x21\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x25\x1E\xFF" - "\x27\x24\x1F\xFF\x25\x23\x1D\xFF\x27\x25\x1E\xFF\x27\x27\x21\xFF\x27\x24\x21\xFF\x28\x26\x1F\xFF\x26\x23\x1E\xFF\x24\x23\x1E\xFF" - "\x24\x23\x1E\xFF\x24\x22\x1D\xFF\x23\x21\x1D\xFF\x26\x23\x1E\xFF\x29\x29\x22\xFF\x2E\x3E\x31\xFF\x48\x9C\x74\xFF\x56\xCC\x97\xFF" - "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x56\xCA\x96\xFF\x3F\x7F\x5F\xFF\x28\x33\x28\xFF\x27\x27\x20\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x24\x23\x1E\xFF" - "\x25\x22\x1D\xFF\x23\x21\x1C\xFF\x23\x21\x1C\xFF\x27\x24\x1F\xFF\x25\x24\x1E\xFF\x24\x24\x1E\xFF\x23\x22\x1E\xFF\x24\x23\x1F\xFF" - "\x25\x27\x1F\xFF\x2B\x38\x2C\xFF\x46\x94\x6F\xFF\x57\xCB\x97\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCC\x97\xFF\x3E\x7D\x5E\xFF\x28\x2E\x26\xFF\x24\x24\x1F\xFF\x23\x22\x1D\xFF\x26\x23\x1E\xFF" - "\x27\x25\x20\xFF\x26\x24\x1E\xFF\x24\x23\x1D\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x22\x20\x1C\xFF\x24\x22\x1D\xFF\x24\x24\x1E\xFF" - "\x25\x22\x1E\xFF\x26\x23\x1E\xFF\x25\x22\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x22\x21\x1B\xFF\x27\x24\x1F\xFF" - "\x27\x24\x1F\xFF\x24\x21\x1D\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x24\x22\x1C\xFF\x24\x23\x1D\xFF\x23\x23\x1D\xFF\x25\x22\x1D\xFF" - "\x21\x21\x1B\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x24\x21\x1D\xFF\x23\x22\x1C\xFF\x25\x23\x1E\xFF\x23\x22\x1C\xFF\x25\x22\x1D\xFF" - "\x26\x25\x1F\xFF\x26\x23\x1F\xFF\x23\x22\x1D\xFF\x24\x21\x1C\xFF\x26\x24\x1F\xFF\x23\x22\x1C\xFF\x22\x21\x1C\xFF\x22\x22\x1C\xFF" - "\x24\x22\x1D\xFF\x23\x21\x1C\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x22\x22\x1B\xFF\x25\x23\x1C\xFF\x26\x24\x1E\xFF\x22\x21\x1C\xFF" - "\x24\x22\x1D\xFF\x23\x22\x1C\xFF\x21\x21\x1C\xFF\x24\x22\x1D\xFF\x23\x22\x1C\xFF\x25\x25\x1E\xFF\x24\x23\x1E\xFF\x26\x24\x1D\xFF" - "\x23\x20\x1C\xFF\x23\x21\x1C\xFF\x24\x21\x1C\xFF\x25\x22\x1E\xFF\x23\x23\x1D\xFF\x26\x24\x1E\xFF\x24\x23\x1D\xFF\x24\x22\x1E\xFF" - "\x23\x23\x1D\xFF\x25\x22\x1D\xFF\x25\x22\x1D\xFF\x23\x22\x1D\xFF\x20\x1F\x1A\xFF\x21\x20\x1B\xFF\x25\x21\x1D\xFF\x25\x22\x1E\xFF" - "\x21\x20\x1B\xFF\x22\x20\x1C\xFF\x24\x22\x1D\xFF\x23\x21\x1C\xFF\x23\x20\x1C\xFF\x25\x22\x1D\xFF\x23\x21\x1C\xFF\x21\x22\x1A\xFF" - "\x24\x21\x1C\xFF\x25\x23\x1E\xFF\x26\x24\x1F\xFF\x25\x22\x1D\xFF\x24\x23\x1D\xFF\x25\x24\x1E\xFF\x25\x24\x1E\xFF\x25\x22\x1D\xFF" - "\x27\x24\x1F\xFF\x25\x22\x1D\xFF\x23\x22\x1C\xFF\x24\x23\x1D\xFF\x22\x22\x1A\xFF\x25\x22\x1D\xFF\x26\x22\x1D\xFF\x25\x22\x1D\xFF" - "\x23\x21\x1C\xFF\x22\x21\x1C\xFF\x24\x21\x1C\xFF\x24\x21\x1C\xFF\x22\x22\x1C\xFF\x22\x20\x1B\xFF\x22\x20\x1B\xFF\x23\x23\x1D\xFF" - "\x26\x24\x1F\xFF\x22\x22\x1C\xFF\x21\x20\x1B\xFF\x22\x1F\x1A\xFF\x21\x20\x1B\xFF\x21\x20\x1B\xFF\x22\x22\x1C\xFF\x23\x22\x1C\xFF" - "\x24\x21\x1C\xFF\x23\x20\x1B\xFF\x24\x21\x1C\xFF\x22\x20\x1B\xFF\x22\x21\x1B\xFF\x27\x24\x1F\xFF\x28\x25\x1F\xFF\x25\x23\x1D\xFF" - "\x21\x21\x1B\xFF\x24\x23\x1D\xFF\x26\x23\x1E\xFF\x26\x24\x1C\xFF\x26\x26\x20\xFF\x28\x25\x20\xFF\x23\x22\x1D\xFF\x20\x20\x1B\xFF" - "\x23\x22\x1D\xFF\x23\x21\x1C\xFF\x21\x21\x1B\xFF\x21\x21\x1C\xFF\x25\x23\x1D\xFF\x24\x22\x1D\xFF\x23\x21\x1C\xFF\x20\x20\x1A\xFF" - "\x22\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x23\x1D\xFF\x22\x21\x1C\xFF\x25\x23\x1D\xFF\x23\x21\x1D\xFF\x22\x20\x1B\xFF\x22\x22\x1D\xFF" - "\x25\x22\x1D\xFF\x22\x21\x1C\xFF\x21\x20\x1B\xFF\x20\x20\x1A\xFF\x21\x21\x1C\xFF\x21\x20\x1B\xFF\x20\x20\x1B\xFF\x25\x22\x1D\xFF" - "\x22\x20\x1C\xFF\x26\x24\x20\xFF\x23\x23\x1D\xFF\x24\x23\x1D\xFF\x22\x1F\x1B\xFF\x24\x22\x1E\xFF\x25\x22\x1E\xFF\x24\x23\x1D\xFF" - "\x0F\x0F\x0D\xFF\x13\x12\x0F\xFF\x12\x11\x0E\xFF\x12\x10\x0E\xFF\x11\x10\x0D\xFF\x12\x11\x0E\xFF\x13\x12\x0F\xFF\x11\x0F\x0E\xFF" - "\x12\x11\x0E\xFF\x12\x11\x0F\xFF\x13\x11\x0E\xFF\x12\x11\x0D\xFF\x19\x18\x14\xFF\x16\x15\x12\xFF\x12\x11\x0E\xFF\x11\x10\x0F\xFF" - "\x14\x13\x0F\xFF\x16\x14\x10\xFF\x13\x12\x0E\xFF\x16\x15\x11\xFF\x17\x15\x11\xFF\x13\x13\x0F\xFF\x12\x12\x0E\xFF\x13\x11\x0F\xFF" - "\x13\x12\x0F\xFF\x13\x11\x0F\xFF\x12\x10\x0E\xFF\x16\x14\x11\xFF\x18\x19\x12\xFF\x14\x12\x0F\xFF\x14\x10\x0F\xFF\x12\x10\x0F\xFF" - "\x12\x10\x0F\xFF\x14\x12\x11\xFF\x15\x14\x11\xFF\x18\x18\x12\xFF\x14\x13\x0F\xFF\x13\x12\x0E\xFF\x15\x14\x11\xFF\x14\x12\x11\xFF" - "\x13\x12\x0E\xFF\x13\x12\x0E\xFF\x13\x12\x0E\xFF\x13\x12\x10\xFF\x12\x11\x0F\xFF\x14\x13\x0F\xFF\x15\x14\x10\xFF\x19\x19\x14\xFF" - "\x14\x14\x0F\xFF\x12\x12\x0D\xFF\x12\x10\x0E\xFF\x14\x13\x0F\xFF\x11\x10\x0E\xFF\x13\x13\x10\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF" - "\x10\x0F\x0B\xFF\x11\x10\x0E\xFF\x15\x14\x10\xFF\x14\x12\x10\xFF\x15\x14\x10\xFF\x15\x14\x10\xFF\x14\x13\x0F\xFF\x16\x15\x11\xFF" - "\x13\x12\x0E\xFF\x14\x13\x0F\xFF\x15\x13\x10\xFF\x15\x13\x10\xFF\x14\x13\x0F\xFF\x14\x13\x10\xFF\x13\x12\x0F\xFF\x11\x10\x0C\xFF" - "\x14\x13\x0F\xFF\x14\x13\x10\xFF\x11\x11\x0F\xFF\x12\x11\x0D\xFF\x14\x11\x0D\xFF\x16\x13\x0F\xFF\x15\x13\x12\xFF\x16\x15\x11\xFF" - "\x13\x13\x0F\xFF\x13\x12\x0F\xFF\x16\x15\x12\xFF\x16\x15\x11\xFF\x12\x10\x0F\xFF\x14\x13\x0F\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF" - "\x15\x14\x11\xFF\x13\x12\x0E\xFF\x14\x13\x0F\xFF\x14\x13\x0F\xFF\x14\x13\x10\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x14\x13\x10\xFF" - "\x15\x14\x11\xFF\x16\x15\x13\xFF\x16\x14\x11\xFF\x17\x14\x10\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF\x15\x14\x11\xFF" - "\x17\x16\x13\xFF\x11\x10\x0E\xFF\x13\x12\x0E\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF" - "\x13\x11\x0F\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x16\x15\x12\xFF\x15\x14\x10\xFF\x14\x13\x0E\xFF\x17\x16\x11\xFF\x18\x17\x12\xFF" - "\x16\x15\x11\xFF\x16\x15\x11\xFF\x19\x18\x14\xFF\x16\x15\x11\xFF\x14\x12\x10\xFF\x14\x13\x0F\xFF\x14\x13\x0E\xFF\x14\x13\x0F\xFF" - "\x18\x17\x13\xFF\x16\x16\x12\xFF\x12\x12\x0F\xFF\x14\x13\x0F\xFF\x16\x14\x11\xFF\x15\x13\x11\xFF\x17\x15\x12\xFF\x18\x17\x13\xFF" - "\x18\x17\x13\xFF\x15\x14\x10\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x16\x15\x11\xFF\x13\x13\x0E\xFF\x16\x15\x11\xFF\x16\x14\x10\xFF" - "\x15\x13\x11\xFF\x18\x17\x14\xFF\x1C\x1A\x16\xFF\x17\x15\x11\xFF\x14\x13\x0F\xFF\x18\x16\x12\xFF\x1B\x18\x14\xFF\x17\x15\x11\xFF" - "\x14\x13\x0F\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x19\x18\x14\xFF\x17\x16\x12\xFF\x19\x18\x14\xFF\x1B\x1A\x16\xFF\x1B\x1A\x16\xFF" - "\x17\x16\x13\xFF\x15\x14\x10\xFF\x16\x15\x10\xFF\x1B\x1A\x16\xFF\x17\x16\x12\xFF\x1B\x1A\x16\xFF\x18\x17\x13\xFF\x18\x18\x12\xFF" - "\x1A\x17\x14\xFF\x1A\x18\x14\xFF\x1B\x1A\x15\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF\x1B\x1A\x16\xFF" - "\x19\x17\x13\xFF\x18\x17\x13\xFF\x1A\x18\x14\xFF\x1B\x19\x16\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF\x1B\x1A\x16\xFF\x1B\x1B\x16\xFF" - "\x1B\x19\x15\xFF\x18\x16\x12\xFF\x16\x15\x11\xFF\x18\x17\x15\xFF\x1E\x1E\x18\xFF\x1D\x1C\x18\xFF\x1A\x19\x14\xFF\x19\x18\x13\xFF" - "\x1A\x18\x14\xFF\x1A\x19\x15\xFF\x19\x18\x14\xFF\x19\x18\x14\xFF\x1A\x19\x15\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF" - "\x19\x18\x14\xFF\x1A\x19\x14\xFF\x1C\x1A\x15\xFF\x1A\x19\x14\xFF\x19\x1A\x15\xFF\x1B\x19\x15\xFF\x1D\x1A\x16\xFF\x1E\x1C\x18\xFF" - "\x1F\x1D\x19\xFF\x1A\x18\x14\xFF\x1A\x18\x14\xFF\x1A\x19\x15\xFF\x1B\x19\x17\xFF\x1A\x19\x14\xFF\x1B\x19\x15\xFF\x1A\x18\x14\xFF" - "\x1B\x1A\x16\xFF\x1B\x1A\x15\xFF\x1D\x1C\x17\xFF\x1F\x1E\x19\xFF\x1E\x1C\x17\xFF\x1B\x1B\x15\xFF\x1C\x1B\x17\xFF\x1B\x19\x15\xFF" - "\x1B\x1A\x16\xFF\x1B\x19\x15\xFF\x19\x18\x14\xFF\x17\x16\x12\xFF\x1B\x1A\x16\xFF\x1C\x1A\x17\xFF\x1D\x1B\x18\xFF\x1B\x1B\x15\xFF" - "\x20\x1E\x19\xFF\x1D\x1B\x17\xFF\x1D\x1C\x18\xFF\x1B\x1A\x16\xFF\x1D\x1B\x17\xFF\x1C\x1B\x17\xFF\x1E\x1D\x19\xFF\x1A\x19\x15\xFF" - "\x19\x18\x14\xFF\x19\x19\x15\xFF\x19\x17\x13\xFF\x19\x18\x14\xFF\x1F\x1E\x19\xFF\x1E\x1C\x18\xFF\x1F\x1D\x19\xFF\x1F\x1F\x1A\xFF" - "\x1D\x1B\x17\xFF\x1C\x1A\x16\xFF\x1A\x18\x16\xFF\x18\x17\x13\xFF\x19\x19\x14\xFF\x1E\x1C\x17\xFF\x1B\x19\x15\xFF\x1C\x1B\x17\xFF" - "\x1F\x1C\x18\xFF\x1B\x1A\x16\xFF\x1D\x1C\x18\xFF\x1A\x19\x16\xFF\x1E\x1B\x17\xFF\x20\x1E\x1A\xFF\x1F\x1E\x1A\xFF\x1C\x1B\x17\xFF" - "\x1C\x19\x15\xFF\x20\x1E\x1A\xFF\x22\x20\x1B\xFF\x1F\x1C\x17\xFF\x1F\x1C\x18\xFF\x1E\x1C\x18\xFF\x1C\x1B\x17\xFF\x1A\x19\x15\xFF" - "\x1C\x1B\x17\xFF\x1E\x1C\x18\xFF\x1C\x1B\x18\xFF\x1C\x1C\x17\xFF\x1F\x1E\x1A\xFF\x1D\x1B\x17\xFF\x1E\x1E\x19\xFF\x1D\x1B\x17\xFF" - "\x20\x1F\x1A\xFF\x1D\x1C\x17\xFF\x1D\x1C\x17\xFF\x20\x1D\x19\xFF\x1F\x1E\x19\xFF\x21\x21\x1A\xFF\x1F\x1D\x18\xFF\x1C\x1C\x18\xFF" - "\x1D\x1D\x18\xFF\x20\x20\x1A\xFF\x21\x21\x1B\xFF\x22\x20\x1B\xFF\x1E\x1E\x19\xFF\x1E\x1E\x19\xFF\x1E\x1D\x18\xFF\x1D\x1C\x18\xFF" - "\x20\x1F\x1A\xFF\x22\x20\x1C\xFF\x21\x1F\x1B\xFF\x1F\x1F\x19\xFF\x1E\x1E\x18\xFF\x1C\x1B\x17\xFF\x1F\x1D\x19\xFF\x1E\x1C\x18\xFF" - "\x1D\x1C\x18\xFF\x1C\x1B\x16\xFF\x1D\x1D\x17\xFF\x1F\x1E\x1A\xFF\x1E\x1F\x17\xFF\x1E\x1D\x18\xFF\x1F\x1E\x19\xFF\x20\x20\x1A\xFF" - "\x1F\x1E\x19\xFF\x1F\x1D\x18\xFF\x1F\x1D\x19\xFF\x1F\x1D\x1A\xFF\x1E\x1C\x17\xFF\x1D\x1B\x17\xFF\x1D\x1C\x18\xFF\x1F\x1E\x19\xFF" - "\x1E\x1C\x18\xFF\x1B\x1B\x16\xFF\x1A\x19\x15\xFF\x1C\x1B\x18\xFF\x1A\x18\x15\xFF\x18\x18\x14\xFF\x17\x17\x13\xFF\x17\x17\x13\xFF" - "\x16\x16\x12\xFF\x15\x14\x11\xFF\x4E\x4A\x3D\xFF\x23\x22\x1D\xFF\x21\x20\x1A\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF" - "\x22\x21\x1A\xFF\x26\x25\x20\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x21\x21\x1B\xFF" - "\x28\x27\x21\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x28\x26\x22\xFF\x26\x25\x21\xFF\x28\x26\x21\xFF\x21\x20\x1A\xFF" - "\x28\x26\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x21\x20\x1B\xFF\x22\x21\x1C\xFF\x29\x28\x22\xFF\x23\x22\x1C\xFF\x21\x20\x1A\xFF" - "\x25\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x23\x1E\xFF\x25\x25\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF" - "\x25\x24\x20\xFF\x28\x26\x21\xFF\x23\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" - "\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x22\x20\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x20\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x25\x24\x20\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF" - "\x24\x23\x1F\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x26\x25\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x22\x20\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF" - "\x25\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x23\x22\x1C\xFF\x22\x22\x1C\xFF\x2A\x29\x23\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF" - "\x26\x25\x21\xFF\x23\x22\x1C\xFF\x27\x25\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x28\x26\x21\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x22\x1C\xFF" - "\x24\x23\x1E\xFF\x29\x28\x22\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" - "\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x22\x1C\xFF\x23\x22\x1C\xFF\x28\x26\x22\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x21\x20\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x25\x23\x1E\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x28\x26\x21\xFF\x27\x25\x20\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF" - "\x25\x23\x1E\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x29\x28\x23\xFF\x26\x25\x20\xFF" - "\x25\x24\x20\xFF\x26\x25\x20\xFF\x29\x28\x22\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x2A\x29\x23\xFF\x25\x24\x20\xFF" - "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x2B\x2A\x24\xFF" - "\x26\x25\x21\xFF\x23\x23\x1E\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x27\x26\x20\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x29\x28\x22\xFF\x23\x22\x1C\xFF\x25\x24\x1F\xFF" - "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x26\x24\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF" - "\x26\x25\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" - "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x26\x24\x20\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x29\x28\x22\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x28\x26\x22\xFF\x26\x25\x21\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" - "\x28\x26\x21\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x29\x28\x22\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" - "\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" - "\x25\x24\x20\xFF\x28\x26\x21\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" - "\x23\x22\x1C\xFF\x25\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x27\x25\x20\xFF\x26\x24\x20\xFF\x23\x22\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF" - "\x25\x24\x20\xFF\x23\x22\x1C\xFF\x25\x24\x1F\xFF\x26\x25\x21\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" - "\x27\x25\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" - "\x26\x25\x20\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x22\x22\x1C\xFF\x2A\x29\x23\xFF\x22\x21\x1B\xFF\x27\x25\x20\xFF" - "\x27\x25\x21\xFF\x23\x22\x1C\xFF\x27\x25\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" - "\x28\x26\x21\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" - "\x24\x23\x1E\xFF\x29\x28\x22\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" - "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x22\x1C\xFF\x23\x22\x1C\xFF\x29\x27\x22\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x25\x24\x1F\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x28\x26\x21\xFF\x27\x26\x21\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x27\x26\x21\xFF" - "\x25\x24\x1F\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x29\x28\x23\xFF\x26\x25\x20\xFF" - "\x26\x24\x20\xFF\x27\x25\x20\xFF\x29\x28\x22\xFF\x26\x24\x20\xFF\x23\x22\x1C\xFF\x4F\x4A\x3D\xFF\x1A\x19\x15\xFF\x19\x19\x15\xFF" - "\x1B\x1A\x16\xFF\x1D\x1B\x17\xFF\x1D\x1C\x18\xFF\x1D\x1C\x18\xFF\x21\x1E\x19\xFF\x21\x1F\x1B\xFF\x21\x20\x1B\xFF\x21\x21\x1B\xFF" - "\x23\x20\x1C\xFF\x22\x22\x1C\xFF\x21\x21\x1C\xFF\x25\x22\x1D\xFF\x24\x24\x1D\xFF\x25\x24\x1F\xFF\x27\x25\x1F\xFF\x24\x23\x1E\xFF" - "\x24\x23\x1D\xFF\x28\x25\x20\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x25\x24\x1F\xFF\x25\x24\x1E\xFF\x23\x23\x1D\xFF\x27\x25\x1F\xFF" - "\x28\x25\x20\xFF\x29\x26\x21\xFF\x25\x24\x1E\xFF\x24\x22\x1D\xFF\x28\x26\x20\xFF\x27\x25\x1F\xFF\x26\x23\x1E\xFF\x27\x24\x1E\xFF" - "\x27\x24\x1F\xFF\x24\x23\x1E\xFF\x26\x24\x1F\xFF\x28\x28\x22\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF" - "\x26\x23\x1E\xFF\x29\x27\x20\xFF\x2A\x27\x22\xFF\x29\x26\x1F\xFF\x26\x25\x1F\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF" - "\x28\x25\x20\xFF\x27\x25\x1F\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF\x26\x25\x1F\xFF\x26\x24\x1F\xFF\x28\x24\x1F\xFF\x29\x25\x20\xFF" - "\x27\x26\x20\xFF\x23\x23\x1D\xFF\x26\x24\x1E\xFF\x29\x26\x21\xFF\x25\x24\x1E\xFF\x24\x24\x1E\xFF\x23\x24\x1E\xFF\x28\x28\x21\xFF" - "\x28\x25\x20\xFF\x27\x24\x1F\xFF\x25\x23\x1D\xFF\x25\x24\x1E\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF\x26\x23\x1E\xFF\x27\x25\x20\xFF" - "\x25\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x24\x23\x1E\xFF\x26\x24\x1F\xFF\x26\x25\x20\xFF\x28\x26\x21\xFF\x28\x26\x21\xFF" - "\x26\x24\x1F\xFF\x25\x24\x1E\xFF\x26\x25\x1F\xFF\x27\x25\x20\xFF\x25\x25\x1F\xFF\x24\x24\x1D\xFF\x27\x26\x1E\xFF\x27\x26\x20\xFF" - "\x25\x25\x1F\xFF\x26\x24\x1F\xFF\x25\x22\x1E\xFF\x26\x23\x1E\xFF\x24\x23\x1E\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x28\x26\x20\xFF" - "\x25\x22\x1E\xFF\x25\x23\x1E\xFF\x27\x25\x20\xFF\x28\x27\x20\xFF\x26\x26\x1E\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x25\x25\x1F\xFF" - "\x28\x26\x1F\xFF\x27\x25\x1F\xFF\x26\x24\x1F\xFF\x23\x23\x1D\xFF\x25\x24\x20\xFF\x26\x25\x20\xFF\x29\x25\x20\xFF\x26\x24\x1F\xFF" - "\x24\x22\x1D\xFF\x23\x23\x1D\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF\x24\x23\x1D\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF" - "\x25\x23\x1E\xFF\x26\x23\x1E\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x25\x26\x1F\xFF\x28\x2F\x25\xFF\x3E\x78\x5B\xFF\x54\xC4\x91\xFF" - "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x4C\xA5\x7B\xFF\x30\x46\x37\xFF\x27\x27\x21\xFF\x27\x25\x1F\xFF\x25\x24\x1E\xFF\x26\x23\x1E\xFF" - "\x24\x23\x1C\xFF\x26\x23\x1E\xFF\x24\x22\x1D\xFF\x27\x24\x1F\xFF\x25\x24\x1E\xFF\x29\x26\x21\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF" - "\x27\x26\x21\xFF\x28\x2C\x26\xFF\x39\x6C\x52\xFF\x53\xC1\x8F\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x97\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCC\x97\xFF\x4F\xB5\x85\xFF\x29\x38\x2D\xFF\x27\x28\x21\xFF\x24\x23\x1E\xFF\x26\x23\x1E\xFF" - "\x24\x24\x1E\xFF\x24\x22\x1D\xFF\x24\x23\x1D\xFF\x25\x25\x1F\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x24\x22\x1D\xFF\x22\x21\x1C\xFF" - "\x25\x22\x1D\xFF\x25\x24\x1F\xFF\x24\x23\x1D\xFF\x26\x24\x1E\xFF\x27\x25\x1F\xFF\x25\x23\x1E\xFF\x24\x22\x1E\xFF\x25\x25\x1E\xFF" - "\x26\x24\x1F\xFF\x23\x22\x1D\xFF\x25\x23\x1D\xFF\x25\x22\x1D\xFF\x25\x24\x1E\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x25\x23\x1E\xFF" - "\x23\x23\x1D\xFF\x25\x25\x1F\xFF\x27\x26\x21\xFF\x26\x24\x1E\xFF\x24\x23\x1E\xFF\x24\x22\x1C\xFF\x22\x21\x1C\xFF\x26\x23\x1E\xFF" - "\x25\x22\x1D\xFF\x24\x22\x1D\xFF\x26\x24\x1E\xFF\x24\x23\x1D\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x24\x22\x1D\xFF\x23\x22\x1D\xFF" - "\x24\x21\x1C\xFF\x23\x22\x1C\xFF\x25\x24\x1E\xFF\x25\x22\x1D\xFF\x25\x22\x1D\xFF\x24\x21\x1C\xFF\x26\x24\x1F\xFF\x27\x27\x1E\xFF" - "\x25\x24\x1E\xFF\x26\x23\x1E\xFF\x24\x23\x1D\xFF\x22\x23\x1E\xFF\x22\x21\x1B\xFF\x21\x20\x1C\xFF\x23\x22\x1D\xFF\x24\x22\x1D\xFF" - "\x20\x20\x1A\xFF\x21\x20\x1B\xFF\x24\x22\x1D\xFF\x26\x23\x1E\xFF\x24\x24\x1E\xFF\x25\x25\x1E\xFF\x23\x21\x1C\xFF\x21\x20\x1A\xFF" - "\x21\x20\x1B\xFF\x23\x21\x1C\xFF\x24\x22\x1D\xFF\x24\x21\x1D\xFF\x22\x22\x1C\xFF\x22\x21\x1C\xFF\x22\x21\x1C\xFF\x22\x21\x1C\xFF" - "\x24\x21\x1C\xFF\x21\x20\x1B\xFF\x22\x20\x1B\xFF\x26\x24\x1F\xFF\x22\x20\x1B\xFF\x22\x22\x1C\xFF\x24\x23\x1E\xFF\x21\x20\x1B\xFF" - "\x25\x22\x1D\xFF\x25\x22\x1D\xFF\x23\x22\x1D\xFF\x22\x23\x1E\xFF\x22\x22\x1C\xFF\x24\x23\x1D\xFF\x27\x24\x1F\xFF\x25\x22\x1D\xFF" - "\x25\x21\x1C\xFF\x25\x22\x1D\xFF\x25\x22\x1D\xFF\x24\x21\x1D\xFF\x22\x1E\x1A\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x25\x22\x1D\xFF" - "\x22\x22\x1C\xFF\x22\x22\x1D\xFF\x21\x21\x1B\xFF\x23\x23\x1C\xFF\x22\x20\x1B\xFF\x23\x22\x1C\xFF\x25\x23\x1D\xFF\x24\x22\x1D\xFF" - "\x26\x23\x1E\xFF\x24\x22\x1D\xFF\x23\x20\x1B\xFF\x21\x1F\x1A\xFF\x23\x23\x1D\xFF\x22\x22\x1C\xFF\x26\x23\x1E\xFF\x26\x25\x1F\xFF" - "\x27\x24\x1F\xFF\x21\x21\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1C\xFF\x23\x21\x1C\xFF\x21\x20\x1A\xFF\x22\x20\x1B\xFF\x20\x20\x1B\xFF" - "\x22\x22\x1C\xFF\x23\x20\x1B\xFF\x25\x22\x1D\xFF\x23\x22\x1C\xFF\x22\x22\x1C\xFF\x21\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x20\x1B\xFF" - "\x22\x20\x1B\xFF\x24\x22\x1D\xFF\x23\x22\x1D\xFF\x20\x20\x1A\xFF\x25\x21\x1C\xFF\x24\x23\x1D\xFF\x20\x21\x1B\xFF\x22\x22\x1C\xFF" - "\x22\x21\x1C\xFF\x1F\x1F\x19\xFF\x20\x1F\x1A\xFF\x1F\x20\x1A\xFF\x23\x20\x1C\xFF\x22\x21\x1C\xFF\x23\x22\x1C\xFF\x23\x21\x1C\xFF" - "\x1F\x1F\x1B\xFF\x21\x22\x1D\xFF\x20\x1F\x1B\xFF\x21\x21\x1B\xFF\x21\x1E\x1A\xFF\x22\x20\x1C\xFF\x23\x21\x1C\xFF\x21\x20\x1B\xFF" - "\x23\x22\x1D\xFF\x25\x21\x1D\xFF\x21\x20\x1B\xFF\x20\x1F\x1B\xFF\x22\x20\x1B\xFF\x25\x23\x1D\xFF\x24\x23\x1E\xFF\x24\x23\x1C\xFF" - "\x14\x13\x10\xFF\x12\x11\x0E\xFF\x12\x12\x0E\xFF\x12\x11\x0E\xFF\x10\x10\x0D\xFF\x10\x10\x0C\xFF\x10\x0F\x0B\xFF\x14\x13\x10\xFF" - "\x11\x0F\x0E\xFF\x12\x11\x0E\xFF\x14\x12\x10\xFF\x13\x11\x10\xFF\x14\x13\x0F\xFF\x11\x10\x0E\xFF\x12\x11\x0F\xFF\x10\x0F\x0E\xFF" - "\x15\x14\x0F\xFF\x12\x11\x0D\xFF\x13\x11\x0E\xFF\x16\x15\x11\xFF\x15\x15\x11\xFF\x16\x15\x11\xFF\x13\x12\x10\xFF\x13\x11\x0F\xFF" - "\x0F\x0F\x0D\xFF\x0F\x0E\x0C\xFF\x10\x0E\x0C\xFF\x14\x11\x10\xFF\x14\x13\x0E\xFF\x13\x12\x0E\xFF\x14\x12\x11\xFF\x12\x10\x0E\xFF" - "\x0F\x0E\x0D\xFF\x13\x11\x10\xFF\x13\x12\x0F\xFF\x14\x12\x0F\xFF\x12\x11\x0D\xFF\x14\x12\x0F\xFF\x15\x14\x10\xFF\x13\x11\x10\xFF" - "\x14\x12\x0E\xFF\x13\x12\x0F\xFF\x14\x13\x0F\xFF\x14\x13\x0E\xFF\x13\x11\x0F\xFF\x14\x13\x10\xFF\x16\x14\x10\xFF\x15\x14\x10\xFF" - "\x13\x11\x0F\xFF\x12\x11\x0D\xFF\x13\x12\x0F\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x14\x13\x10\xFF\x15\x13\x10\xFF\x13\x11\x0F\xFF" - "\x12\x12\x0E\xFF\x10\x0F\x0D\xFF\x14\x13\x0F\xFF\x15\x13\x11\xFF\x13\x12\x0F\xFF\x15\x13\x10\xFF\x16\x15\x11\xFF\x15\x13\x10\xFF" - "\x15\x14\x10\xFF\x14\x13\x0F\xFF\x15\x14\x10\xFF\x15\x14\x10\xFF\x14\x13\x0F\xFF\x13\x12\x0E\xFF\x14\x13\x0F\xFF\x15\x14\x10\xFF" - "\x16\x15\x11\xFF\x14\x13\x0F\xFF\x15\x14\x10\xFF\x14\x13\x0F\xFF\x14\x13\x0F\xFF\x16\x15\x10\xFF\x15\x14\x11\xFF\x15\x14\x10\xFF" - "\x11\x10\x0F\xFF\x14\x12\x0F\xFF\x13\x11\x0F\xFF\x13\x11\x0F\xFF\x15\x13\x10\xFF\x15\x14\x10\xFF\x15\x14\x11\xFF\x16\x15\x11\xFF" - "\x15\x14\x11\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x16\x14\x10\xFF\x16\x15\x13\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF" - "\x12\x10\x0E\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x15\x14\x11\xFF\x15\x14\x10\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF\x15\x13\x10\xFF" - "\x17\x16\x13\xFF\x13\x11\x10\xFF\x16\x14\x11\xFF\x15\x14\x10\xFF\x13\x11\x10\xFF\x14\x13\x0F\xFF\x15\x14\x10\xFF\x15\x14\x10\xFF" - "\x16\x15\x11\xFF\x16\x15\x10\xFF\x16\x15\x10\xFF\x15\x13\x11\xFF\x16\x15\x11\xFF\x17\x15\x12\xFF\x15\x14\x11\xFF\x12\x12\x0E\xFF" - "\x15\x14\x10\xFF\x16\x15\x11\xFF\x1A\x19\x15\xFF\x19\x18\x14\xFF\x14\x13\x0F\xFF\x15\x14\x10\xFF\x18\x17\x13\xFF\x15\x14\x11\xFF" - "\x17\x15\x11\xFF\x17\x16\x12\xFF\x18\x16\x12\xFF\x18\x16\x12\xFF\x14\x13\x10\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF\x1A\x19\x15\xFF" - "\x19\x18\x14\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF\x16\x15\x11\xFF\x16\x15\x12\xFF\x17\x16\x13\xFF\x18\x17\x13\xFF\x17\x15\x11\xFF" - "\x18\x16\x12\xFF\x16\x15\x12\xFF\x16\x14\x12\xFF\x18\x16\x13\xFF\x15\x14\x10\xFF\x17\x15\x11\xFF\x17\x15\x11\xFF\x14\x13\x0F\xFF" - "\x16\x15\x11\xFF\x16\x15\x11\xFF\x16\x15\x12\xFF\x1B\x1A\x16\xFF\x16\x15\x11\xFF\x19\x18\x14\xFF\x19\x18\x14\xFF\x1C\x1C\x17\xFF" - "\x17\x16\x12\xFF\x18\x17\x12\xFF\x18\x17\x13\xFF\x17\x15\x13\xFF\x16\x15\x12\xFF\x1A\x19\x14\xFF\x1A\x19\x15\xFF\x1A\x19\x15\xFF" - "\x19\x18\x15\xFF\x19\x17\x13\xFF\x19\x17\x13\xFF\x15\x14\x11\xFF\x15\x14\x10\xFF\x17\x16\x12\xFF\x19\x18\x14\xFF\x18\x17\x13\xFF" - "\x18\x17\x13\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x18\x17\x14\xFF\x1B\x1A\x16\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x1B\x1A\x15\xFF" - "\x17\x16\x12\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x1E\x1E\x19\xFF\x1D\x1D\x18\xFF\x1A\x19\x16\xFF\x19\x18\x14\xFF"; - + "\x1B\x1A\x16\xFF\x1C\x1A\x16\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF\x17\x16\x12\xFF\x18\x16\x12" + "\xFF\x19\x18\x14\xFF\x19\x18\x14\xFF" + "\x1D\x1C\x17\xFF\x1D\x1B\x17\xFF\x1C\x1B\x17\xFF\x1B\x1A\x16\xFF\x1A\x19\x15\xFF\x1A\x19\x15" + "\xFF\x18\x17\x13\xFF\x1A\x19\x15\xFF" + "\x1B\x1A\x16\xFF\x19\x18\x14\xFF\x19\x18\x14\xFF\x18\x16\x14\xFF\x1C\x1A\x16\xFF\x1A\x18\x14" + "\xFF\x1B\x1A\x16\xFF\x19\x17\x13\xFF" + "\x1B\x19\x16\xFF\x1A\x18\x15\xFF\x1A\x18\x13\xFF\x19\x17\x13\xFF\x1B\x19\x15\xFF\x1B\x1A\x16" + "\xFF\x1A\x19\x15\xFF\x18\x16\x12\xFF" + "\x1A\x19\x15\xFF\x1C\x1B\x16\xFF\x1C\x1B\x17\xFF\x1D\x1C\x17\xFF\x1B\x1B\x16\xFF\x18\x17\x13" + "\xFF\x19\x18\x14\xFF\x1B\x19\x14\xFF" + "\x1A\x19\x15\xFF\x1A\x1A\x15\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x1C\x1B\x17\xFF\x1D\x1C\x17" + "\xFF\x1B\x1A\x15\xFF\x18\x17\x12\xFF" + "\x1B\x1A\x16\xFF\x18\x17\x13\xFF\x1A\x19\x15\xFF\x1E\x1D\x18\xFF\x19\x18\x14\xFF\x1C\x1B\x17" + "\xFF\x1C\x1A\x16\xFF\x1B\x1A\x18\xFF" + "\x1D\x1B\x16\xFF\x1E\x1B\x17\xFF\x1D\x1C\x18\xFF\x1B\x1A\x16\xFF\x1A\x1A\x14\xFF\x1B\x1B\x15" + "\xFF\x1E\x1C\x17\xFF\x1D\x1B\x17\xFF" + "\x1C\x19\x15\xFF\x1D\x1C\x17\xFF\x1A\x19\x14\xFF\x1C\x1B\x17\xFF\x1E\x1D\x19\xFF\x1C\x1C\x17" + "\xFF\x1B\x1C\x16\xFF\x1D\x1C\x18\xFF" + "\x1C\x1C\x16\xFF\x1D\x1C\x17\xFF\x1F\x1E\x19\xFF\x1A\x18\x14\xFF\x1B\x1A\x16\xFF\x1D\x1C\x18" + "\xFF\x1D\x1C\x17\xFF\x1E\x1B\x19\xFF" + "\x1F\x1C\x18\xFF\x1D\x1C\x18\xFF\x20\x1F\x19\xFF\x1F\x1E\x19\xFF\x1B\x1A\x16\xFF\x1F\x1E\x1A" + "\xFF\x1D\x1C\x17\xFF\x1F\x1C\x18\xFF" + "\x1F\x1D\x18\xFF\x1E\x1C\x18\xFF\x1D\x1C\x17\xFF\x1C\x1C\x16\xFF\x1D\x1C\x18\xFF\x1F\x1F\x19" + "\xFF\x1D\x1C\x18\xFF\x1B\x1B\x16\xFF" + "\x1D\x1D\x17\xFF\x1F\x1E\x19\xFF\x1D\x1C\x16\xFF\x1B\x1A\x15\xFF\x1F\x1D\x19\xFF\x1E\x1C\x18" + "\xFF\x1F\x1E\x1A\xFF\x22\x20\x1C\xFF" + "\x22\x20\x1B\xFF\x20\x1F\x1A\xFF\x1F\x1F\x1A\xFF\x1E\x1E\x1A\xFF\x1D\x1C\x18\xFF\x1F\x1D\x19" + "\xFF\x20\x20\x1A\xFF\x22\x21\x1C\xFF" + "\x20\x1F\x1A\xFF\x1D\x1D\x18\xFF\x1E\x1D\x18\xFF\x22\x20\x1B\xFF\x20\x20\x1A\xFF\x1E\x1D\x18" + "\xFF\x20\x20\x1B\xFF\x20\x1F\x1B\xFF" + "\x1F\x1D\x18\xFF\x1E\x1E\x19\xFF\x1E\x1E\x19\xFF\x1D\x1B\x18\xFF\x1D\x1B\x16\xFF\x1E\x1C\x17" + "\xFF\x1B\x1A\x16\xFF\x1F\x1D\x18\xFF" + "\x1B\x1A\x16\xFF\x1A\x19\x15\xFF\x19\x18\x15\xFF\x1B\x19\x15\xFF\x1B\x19\x15\xFF\x18\x18\x14" + "\xFF\x17\x17\x13\xFF\x19\x18\x15\xFF" + "\x15\x15\x11\xFF\x14\x13\x10\xFF\x4E\x4A\x3D\xFF\x21\x20\x1A\xFF\x25\x24\x20\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x24\x23\x1F\xFF" + "\x21\x20\x1A\xFF\x24\x23\x1F\xFF\x21\x20\x1A\xFF\x2A\x29\x23\xFF\x21\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x26\x25\x21\xFF\x25\x24\x20\xFF\x21\x20\x1A" + "\xFF\x22\x20\x1B\xFF\x26\x25\x20\xFF" + "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x23\x21\x1C\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x21\x20\x1A\xFF\x22\x21\x1C" + "\xFF\x26\x25\x21\xFF\x23\x21\x1C\xFF" + "\x22\x20\x1A\xFF\x22\x20\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1C\xFF\x22\x22\x1C\xFF\x23\x22\x1D" + "\xFF\x24\x23\x1E\xFF\x24\x24\x1E\xFF" + "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x29\x28\x23\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1E" + "\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF" + "\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x24\x22\x1D\xFF\x22\x21\x1B\xFF\x23\x21\x1C" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1E\xFF" + "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x25\x24\x20\xFF\x23\x23\x1E\xFF\x24\x23\x1F" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x28\x26\x21" + "\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" + "\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x25\x24\x20\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x22\x22\x1D\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x21\x20\x1A\xFF\x22\x20\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1D" + "\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B" + "\xFF\x26\x25\x20\xFF\x24\x22\x1D\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x23\x21\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x26\x24\x20\xFF\x24\x23\x1E\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x25\x24\x20" + "\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1D\xFF\x21\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C" + "\xFF\x23\x22\x1C\xFF\x23\x21\x1C\xFF" + "\x22\x21\x1B\xFF\x28\x26\x21\xFF\x23\x22\x1C\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x26\x25\x20" + "\xFF\x24\x23\x1E\xFF\x28\x26\x21\xFF" + "\x28\x26\x21\xFF\x22\x22\x1C\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x21\x1C\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x28\x26\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x26\x25\x21\xFF" + "\x24\x23\x1E\xFF\x26\x25\x21\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x23\x22\x1E\xFF\x25\x24\x20" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x25\x24\x20\xFF\x25\x25\x20\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x26\x25\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x23\x22\x1C" + "\xFF\x23\x22\x1C\xFF\x25\x24\x1F\xFF" + "\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x2A\x29\x23\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF" + "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x26\x26\x21\xFF\x26\x25\x20\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x27\x25\x20\xFF" + "\x22\x21\x1B\xFF\x26\x26\x20\xFF\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x27\x25\x20\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" + "\x23\x22\x1C\xFF\x23\x22\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x27\x26\x21\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x24\x23\x1E" + "\xFF\x25\x24\x1F\xFF\x25\x24\x1F\xFF" + "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x29\x28\x23\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x24\x1F" + "\xFF\x22\x21\x1B\xFF\x29\x26\x21\xFF" + "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x22\x1C\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1E\xFF" + "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x26\x25\x20\xFF\x23\x23\x1E\xFF\x24\x23\x1F" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x25\x21\xFF\x29\x26\x21" + "\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF" + "\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x27\x25\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x1F" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x26\x24\x20\xFF\x23\x22\x1C\xFF\x26\x25\x21\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x23\x23\x1E\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1E\xFF\x22\x21\x1B\xFF\x27\x25\x20\xFF\x23\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1E" + "\xFF\x29\x26\x21\xFF\x23\x22\x1C\xFF" + "\x23\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B" + "\xFF\x27\x26\x21\xFF\x24\x23\x1E\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x29\x26\x21\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x27\x26\x21\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x24\x23\x1E\xFF\x26\x24\x20\xFF\x23\x22\x1C\xFF\x26\x25\x20" + "\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C" + "\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x28\x26\x21\xFF\x23\x22\x1C\xFF\x26\x25\x21\xFF\x23\x22\x1C\xFF\x26\x25\x20" + "\xFF\x25\x24\x1F\xFF\x28\x26\x21\xFF" + "\x28\x26\x21\xFF\x22\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x4E\x49\x3C" + "\xFF\x1A\x18\x14\xFF\x1A\x18\x15\xFF" + "\x1B\x1B\x16\xFF\x1D\x1B\x17\xFF\x1F\x1D\x19\xFF\x20\x1D\x19\xFF\x1E\x1D\x19\xFF\x1F\x1D\x19" + "\xFF\x21\x20\x1B\xFF\x23\x21\x1C\xFF" + "\x22\x21\x1C\xFF\x25\x22\x1D\xFF\x25\x22\x1E\xFF\x25\x23\x1E\xFF\x25\x22\x1D\xFF\x25\x23\x1E" + "\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF" + "\x26\x23\x1E\xFF\x25\x24\x1E\xFF\x26\x24\x1F\xFF\x25\x22\x1D\xFF\x26\x25\x1F\xFF\x27\x26\x20" + "\xFF\x26\x25\x1F\xFF\x27\x24\x1F\xFF" + "\x27\x25\x20\xFF\x29\x26\x21\xFF\x26\x23\x1F\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20" + "\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF" + "\x27\x24\x1F\xFF\x28\x25\x20\xFF\x27\x26\x1F\xFF\x27\x24\x1F\xFF\x26\x23\x1F\xFF\x28\x25\x20" + "\xFF\x29\x26\x21\xFF\x2A\x27\x22\xFF" + "\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF\x26\x25\x20\xFF\x26\x24\x1E" + "\xFF\x26\x23\x1D\xFF\x27\x24\x1F\xFF" + "\x26\x23\x1E\xFF\x26\x23\x1F\xFF\x24\x23\x1E\xFF\x26\x24\x1F\xFF\x27\x24\x1E\xFF\x27\x24\x20" + "\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" + "\x28\x25\x20\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x28\x25\x20\xFF\x24\x23\x1E\xFF\x25\x23\x1E" + "\xFF\x25\x24\x1E\xFF\x26\x24\x1F\xFF" + "\x28\x26\x21\xFF\x28\x25\x20\xFF\x26\x23\x1E\xFF\x28\x26\x20\xFF\x25\x24\x1F\xFF\x27\x24\x1F" + "\xFF\x29\x26\x21\xFF\x27\x24\x1F\xFF" + "\x25\x22\x1D\xFF\x25\x24\x1E\xFF\x29\x27\x20\xFF\x29\x26\x20\xFF\x28\x26\x20\xFF\x27\x26\x1F" + "\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF" + "\x26\x25\x1F\xFF\x26\x25\x20\xFF\x27\x24\x1F\xFF\x25\x22\x1E\xFF\x24\x23\x1D\xFF\x23\x22\x1D" + "\xFF\x24\x21\x1C\xFF\x26\x23\x1E\xFF" + "\x27\x24\x1E\xFF\x28\x27\x20\xFF\x27\x25\x1F\xFF\x27\x25\x20\xFF\x25\x22\x1D\xFF\x26\x24\x1E" + "\xFF\x22\x20\x1A\xFF\x24\x24\x1D\xFF" + "\x28\x25\x20\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x26\x23\x1E\xFF\x26\x25\x1F" + "\xFF\x27\x24\x1F\xFF\x26\x25\x1F\xFF" + "\x27\x25\x20\xFF\x28\x27\x21\xFF\x27\x25\x20\xFF\x26\x25\x1F\xFF\x26\x23\x1E\xFF\x22\x21\x1C" + "\xFF\x25\x24\x1E\xFF\x26\x23\x1E\xFF" + "\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x25\x24\x1D\xFF\x23\x23\x1D\xFF\x25\x23\x1E" + "\xFF\x27\x25\x20\xFF\x26\x24\x1E\xFF" + "\x25\x23\x1E\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x27\x26\x20\xFF\x29\x2F\x26\xFF\x3C\x70\x55" + "\xFF\x54\xC5\x92\xFF\x57\xCD\x97\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF" + "\x56\xCC\x97\xFF\x4B\xA4\x7B\xFF\x2F\x47\x37\xFF\x26\x26\x20\xFF\x25\x23\x1D\xFF\x24\x23\x1D" + "\xFF\x24\x22\x1D\xFF\x24\x22\x1D\xFF" + "\x26\x23\x1E\xFF\x27\x25\x20\xFF\x25\x22\x1D\xFF\x25\x22\x1D\xFF\x26\x24\x1F\xFF\x24\x23\x1D" + "\xFF\x26\x24\x1F\xFF\x25\x25\x1D\xFF" + "\x27\x2D\x26\xFF\x39\x68\x50\xFF\x54\xC0\x8F\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x97\xFF\x56\xCD\x97\xFF\x49\x9F\x76\xFF\x2D\x42\x33\xFF\x24\x25\x20\xFF\x23\x22\x1D" + "\xFF\x25\x22\x1D\xFF\x24\x21\x1C\xFF" + "\x22\x21\x1C\xFF\x25\x23\x1E\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF\x22\x20\x1B\xFF\x23\x22\x1C" + "\xFF\x25\x25\x1F\xFF\x26\x24\x1E\xFF" + "\x24\x23\x1D\xFF\x24\x23\x1D\xFF\x26\x23\x1F\xFF\x23\x20\x1C\xFF\x28\x26\x1F\xFF\x25\x24\x1F" + "\xFF\x25\x22\x1D\xFF\x24\x21\x1C\xFF" + "\x23\x23\x1D\xFF\x25\x22\x1E\xFF\x24\x22\x1E\xFF\x27\x24\x1F\xFF\x23\x21\x1B\xFF\x26\x25\x1F" + "\xFF\x27\x24\x1F\xFF\x26\x24\x1E\xFF" + "\x26\x23\x1E\xFF\x28\x25\x20\xFF\x26\x23\x1E\xFF\x24\x21\x1C\xFF\x27\x26\x21\xFF\x25\x22\x1D" + "\xFF\x22\x20\x1C\xFF\x25\x22\x1D\xFF" + "\x26\x24\x1E\xFF\x24\x23\x1D\xFF\x26\x25\x1F\xFF\x24\x22\x1E\xFF\x23\x21\x1C\xFF\x23\x22\x1D" + "\xFF\x24\x22\x1D\xFF\x23\x21\x1C\xFF" + "\x24\x22\x1D\xFF\x24\x22\x1D\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF\x25\x22\x1D\xFF\x25\x23\x1E" + "\xFF\x23\x20\x1B\xFF\x25\x22\x1D\xFF" + "\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x25\x22\x1E\xFF\x24\x21\x1D\xFF\x25\x23\x1E\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1C\xFF\x23\x1F\x1B\xFF" + "\x21\x21\x1B\xFF\x24\x22\x1D\xFF\x24\x23\x1D\xFF\x25\x23\x1E\xFF\x23\x20\x1C\xFF\x26\x24\x1E" + "\xFF\x24\x22\x1D\xFF\x24\x22\x1D\xFF" + "\x21\x21\x1A\xFF\x21\x21\x1C\xFF\x20\x20\x1A\xFF\x22\x21\x1C\xFF\x26\x23\x1E\xFF\x21\x21\x1C" + "\xFF\x22\x21\x1C\xFF\x23\x22\x1D\xFF" + "\x25\x23\x1C\xFF\x26\x23\x1E\xFF\x24\x22\x1D\xFF\x22\x22\x1C\xFF\x22\x22\x1C\xFF\x24\x22\x1D" + "\xFF\x24\x23\x1D\xFF\x25\x22\x1D\xFF" + "\x22\x21\x1D\xFF\x21\x21\x1C\xFF\x23\x22\x1D\xFF\x23\x20\x1C\xFF\x21\x20\x1B\xFF\x24\x23\x1D" + "\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF" + "\x22\x22\x1C\xFF\x24\x22\x1D\xFF\x23\x21\x1B\xFF\x22\x21\x1C\xFF\x24\x23\x1D\xFF\x23\x21\x1C" + "\xFF\x21\x21\x1B\xFF\x24\x24\x1E\xFF" + "\x24\x22\x1D\xFF\x23\x22\x1D\xFF\x23\x22\x1D\xFF\x21\x20\x1B\xFF\x23\x21\x1C\xFF\x25\x24\x1E" + "\xFF\x24\x21\x1C\xFF\x23\x21\x1C\xFF" + "\x21\x20\x1B\xFF\x22\x20\x1B\xFF\x21\x20\x1B\xFF\x23\x22\x1C\xFF\x23\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x22\x1C\xFF\x22\x22\x1D\xFF" + "\x24\x21\x1C\xFF\x21\x1F\x1B\xFF\x21\x1F\x1A\xFF\x20\x20\x19\xFF\x24\x22\x1B\xFF\x23\x22\x1C" + "\xFF\x27\x25\x1E\xFF\x25\x24\x1E\xFF" + "\x26\x29\x23\xFF\x2F\x45\x37\xFF\x2B\x3E\x2F\xFF\x27\x26\x20\xFF\x21\x1F\x1A\xFF\x21\x20\x1C" + "\xFF\x21\x20\x1B\xFF\x21\x21\x1B\xFF" + "\x20\x1F\x1A\xFF\x25\x23\x1E\xFF\x24\x23\x1D\xFF\x1F\x1E\x1A\xFF\x24\x22\x1C\xFF\x27\x23\x1F" + "\xFF\x24\x22\x1E\xFF\x21\x20\x1C\xFF" + "\x1F\x1E\x19\xFF\x21\x1F\x1B\xFF\x21\x20\x1B\xFF\x22\x21\x1B\xFF\x25\x22\x1D\xFF\x21\x1F\x1A" + "\xFF\x21\x1F\x1C\xFF\x21\x20\x1B\xFF" + "\x24\x21\x1C\xFF\x1F\x1D\x19\xFF\x22\x20\x1A\xFF\x22\x22\x1C\xFF\x22\x20\x1B\xFF\x21\x21\x1A" + "\xFF\x20\x20\x1A\xFF\x21\x20\x1C\xFF" + "\x25\x24\x1E\xFF\x24\x22\x1D\xFF\x21\x20\x1B\xFF\x22\x1F\x1B\xFF\x22\x21\x1C\xFF\x23\x21\x1D" + "\xFF\x20\x1F\x1C\xFF\x22\x21\x1C\xFF" + "\x15\x14\x11\xFF\x15\x13\x10\xFF\x15\x14\x10\xFF\x18\x17\x13\xFF\x16\x15\x11\xFF\x14\x13\x10" + "\xFF\x15\x14\x10\xFF\x14\x13\x0F\xFF" + "\x12\x10\x0E\xFF\x11\x10\x0E\xFF\x10\x0F\x0D\xFF\x14\x12\x10\xFF\x14\x12\x0E\xFF\x14\x13\x0F" + "\xFF\x15\x13\x10\xFF\x12\x10\x0D\xFF" + "\x12\x11\x0E\xFF\x12\x11\x0E\xFF\x17\x16\x12\xFF\x17\x15\x11\xFF\x18\x17\x13\xFF\x15\x13\x10" + "\xFF\x16\x15\x12\xFF\x13\x12\x0E\xFF" + "\x12\x11\x0E\xFF\x14\x13\x0F\xFF\x13\x12\x0F\xFF\x12\x12\x0F\xFF\x15\x15\x11\xFF\x13\x12\x0F" + "\xFF\x13\x11\x0E\xFF\x13\x12\x0F\xFF" + "\x13\x11\x0F\xFF\x13\x12\x0E\xFF\x14\x13\x0F\xFF\x15\x14\x10\xFF\x13\x11\x0F\xFF\x12\x12\x0F" + "\xFF\x14\x13\x10\xFF\x14\x13\x0F\xFF" + "\x17\x16\x12\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x14\x13\x0F\xFF\x14\x13\x0F\xFF\x15\x14\x0F" + "\xFF\x14\x13\x10\xFF\x14\x12\x10\xFF" + "\x15\x14\x10\xFF\x15\x13\x10\xFF\x15\x14\x10\xFF\x15\x13\x10\xFF\x11\x10\x0D\xFF\x14\x13\x10" + "\xFF\x13\x12\x0E\xFF\x14\x12\x0F\xFF" + "\x16\x15\x10\xFF\x14\x13\x0F\xFF\x12\x10\x0E\xFF\x13\x11\x0F\xFF\x12\x10\x0F\xFF\x15\x14\x10" + "\xFF\x15\x14\x11\xFF\x15\x13\x11\xFF" + "\x16\x15\x11\xFF\x17\x16\x12\xFF\x13\x12\x0E\xFF\x12\x11\x0D\xFF\x14\x13\x10\xFF\x17\x16\x12" + "\xFF\x18\x17\x14\xFF\x17\x16\x13\xFF" + "\x15\x14\x10\xFF\x14\x13\x0F\xFF\x14\x13\x0F\xFF\x14\x13\x0F\xFF\x16\x14\x11\xFF\x16\x14\x12" + "\xFF\x14\x13\x0F\xFF\x14\x12\x10\xFF" + "\x14\x13\x10\xFF\x15\x14\x12\xFF\x16\x14\x11\xFF\x15\x13\x0F\xFF\x14\x13\x10\xFF\x15\x13\x10" + "\xFF\x18\x17\x13\xFF\x15\x13\x11\xFF" + "\x14\x13\x0F\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x15\x14\x11\xFF\x13\x12\x0F\xFF\x17\x15\x12" + "\xFF\x15\x13\x11\xFF\x13\x12\x0E\xFF" + "\x17\x16\x13\xFF\x19\x18\x14\xFF\x18\x17\x14\xFF\x17\x16\x13\xFF\x15\x14\x10\xFF\x15\x14\x12" + "\xFF\x14\x13\x0F\xFF\x15\x14\x11\xFF" + "\x16\x15\x11\xFF\x19\x18\x14\xFF\x18\x16\x13\xFF\x14\x13\x10\xFF\x14\x13\x0F\xFF\x15\x13\x11" + "\xFF\x15\x14\x11\xFF\x14\x13\x10\xFF" + "\x15\x14\x11\xFF\x18\x17\x14\xFF\x17\x15\x12\xFF\x16\x15\x11\xFF\x18\x17\x13\xFF\x1B\x1A\x16" + "\xFF\x1A\x19\x16\xFF\x16\x15\x11\xFF" + "\x16\x14\x12\xFF\x16\x15\x11\xFF\x17\x16\x13\xFF\x14\x13\x11\xFF\x17\x16\x12\xFF\x19\x19\x14" + "\xFF\x16\x15\x12\xFF\x19\x18\x14\xFF" + "\x18\x17\x14\xFF\x18\x18\x13\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x17\x15\x13\xFF\x18\x17\x14" + "\xFF\x17\x16\x13\xFF\x16\x15\x11\xFF" + "\x14\x13\x0F\xFF\x16\x15\x11\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF\x18\x17\x14\xFF\x15\x13\x12" + "\xFF\x16\x15\x11\xFF\x18\x16\x12\xFF" + "\x14\x13\x0F\xFF\x15\x14\x10\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF\x1B\x1A\x16\xFF\x1A\x19\x15" + "\xFF\x19\x18\x14\xFF\x16\x15\x11\xFF" + "\x15\x14\x10\xFF\x17\x16\x12\xFF\x19\x18\x13\xFF\x19\x18\x13\xFF\x17\x16\x12\xFF\x17\x16\x12" + "\xFF\x18\x17\x13\xFF\x1B\x18\x15\xFF" + "\x17\x16\x12\xFF\x17\x16\x12\xFF\x19\x18\x14\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x1A\x19\x15" + "\xFF\x1B\x19\x15\xFF\x1A\x19\x14\xFF" + "\x16\x15\x11\xFF\x1A\x19\x15\xFF\x1A\x18\x15\xFF\x17\x16\x12\xFF\x19\x19\x14\xFF\x19\x18\x14" + "\xFF\x17\x16\x12\xFF\x18\x16\x12\xFF" + "\x19\x18\x14\xFF\x19\x18\x14\xFF\x1B\x1A\x16\xFF\x1C\x1A\x16\xFF\x17\x15\x11\xFF\x19\x19\x14" + "\xFF\x19\x19\x14\xFF\x19\x18\x14\xFF" + "\x1D\x1B\x17\xFF\x1A\x19\x14\xFF\x1A\x19\x15\xFF\x17\x16\x12\xFF\x19\x18\x14\xFF\x19\x17\x14" + "\xFF\x19\x18\x14\xFF\x19\x18\x13\xFF" + "\x1B\x1A\x16\xFF\x1B\x1A\x16\xFF\x19\x17\x13\xFF\x18\x17\x13\xFF\x1A\x18\x14\xFF\x1C\x1A\x16" + "\xFF\x1D\x1C\x17\xFF\x1F\x1E\x19\xFF" + "\x19\x18\x14\xFF\x18\x17\x12\xFF\x18\x17\x12\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF\x19\x18\x14" + "\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF" + "\x1B\x19\x15\xFF\x1B\x19\x15\xFF\x1A\x18\x14\xFF\x17\x16\x12\xFF\x16\x16\x11\xFF\x1A\x18\x14" + "\xFF\x1B\x19\x15\xFF\x1E\x1C\x18\xFF" + "\x1B\x1A\x16\xFF\x1C\x1A\x15\xFF\x19\x18\x14\xFF\x1A\x18\x14\xFF\x1C\x1A\x16\xFF\x1C\x1A\x17" + "\xFF\x1C\x1B\x17\xFF\x1A\x18\x14\xFF" + "\x1B\x19\x15\xFF\x1A\x18\x14\xFF\x1A\x19\x15\xFF\x1B\x1A\x16\xFF\x1B\x1A\x16\xFF\x1B\x1A\x15" + "\xFF\x1C\x1C\x17\xFF\x1C\x1C\x17\xFF" + "\x1B\x19\x15\xFF\x1A\x19\x15\xFF\x1B\x19\x15\xFF\x1D\x1C\x17\xFF\x1C\x1A\x16\xFF\x1C\x1C\x17" + "\xFF\x1C\x1B\x16\xFF\x1D\x1C\x17\xFF" + "\x1D\x1B\x17\xFF\x19\x19\x14\xFF\x1B\x1A\x16\xFF\x1F\x1D\x18\xFF\x1E\x1E\x18\xFF\x1E\x1D\x18" + "\xFF\x1D\x1B\x18\xFF\x1D\x1B\x17\xFF" + "\x1B\x1A\x15\xFF\x1A\x1A\x15\xFF\x1C\x1B\x16\xFF\x1E\x1C\x18\xFF\x1A\x19\x15\xFF\x1A\x19\x15" + "\xFF\x1D\x1C\x17\xFF\x1C\x19\x15\xFF" + "\x1D\x1B\x17\xFF\x1B\x1A\x15\xFF\x1A\x1A\x15\xFF\x1C\x1B\x16\xFF\x22\x20\x1B\xFF\x1E\x1D\x18" + "\xFF\x1D\x1C\x18\xFF\x1C\x1C\x17\xFF" + "\x1B\x1B\x15\xFF\x1B\x1A\x16\xFF\x1A\x19\x15\xFF\x1A\x19\x15\xFF\x1D\x1C\x18\xFF\x1B\x19\x15" + "\xFF\x1D\x1B\x17\xFF\x1B\x1B\x16\xFF" + "\x1F\x1C\x18\xFF\x1E\x1C\x18\xFF\x1F\x1C\x18\xFF\x1E\x1C\x18\xFF\x1C\x1C\x18\xFF\x1D\x1C\x18" + "\xFF\x1D\x1B\x17\xFF\x1E\x1B\x17\xFF" + "\x1D\x1B\x17\xFF\x1D\x1C\x17\xFF\x1E\x1E\x19\xFF\x1E\x1D\x19\xFF\x1C\x1C\x18\xFF\x20\x1F\x19" + "\xFF\x1F\x1D\x1A\xFF\x1F\x1E\x19\xFF" + "\x1D\x1B\x17\xFF\x1C\x1B\x17\xFF\x1B\x1A\x16\xFF\x1B\x1A\x16\xFF\x1E\x1C\x17\xFF\x1A\x19\x15" + "\xFF\x20\x1F\x1A\xFF\x1E\x1D\x18\xFF" + "\x1E\x1D\x18\xFF\x1F\x1D\x19\xFF\x1F\x1E\x1A\xFF\x1F\x1D\x19\xFF\x1D\x1C\x18\xFF\x1E\x1C\x18" + "\xFF\x1D\x1C\x18\xFF\x21\x20\x1B\xFF" + "\x1E\x1E\x19\xFF\x20\x1F\x1A\xFF\x20\x1E\x1A\xFF\x20\x1F\x1A\xFF\x20\x20\x1A\xFF\x21\x20\x1A" + "\xFF\x23\x21\x1B\xFF\x21\x21\x1B\xFF" + "\x1E\x1D\x19\xFF\x1E\x1D\x18\xFF\x1F\x1E\x1A\xFF\x1C\x1B\x18\xFF\x1D\x1C\x17\xFF\x1E\x1C\x17" + "\xFF\x1C\x1B\x17\xFF\x1E\x1D\x18\xFF" + "\x1B\x1A\x16\xFF\x1B\x1B\x16\xFF\x1A\x1A\x15\xFF\x19\x19\x15\xFF\x18\x18\x14\xFF\x17\x16\x12" + "\xFF\x18\x17\x13\xFF\x1A\x19\x15\xFF" + "\x15\x14\x11\xFF\x15\x14\x11\xFF\x51\x4E\x41\xFF\x21\x20\x1A\xFF\x26\x25\x20\xFF\x28\x26\x21" + "\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF" + "\x21\x20\x1A\xFF\x22\x21\x1C\xFF\x21\x20\x1A\xFF\x21\x20\x1A\xFF\x21\x20\x1A\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF" + "\x28\x26\x21\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1D" + "\xFF\x24\x23\x1E\xFF\x21\x20\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1C\xFF\x24\x23\x1E\xFF\x24\x22\x1D\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x26\x25\x20\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" + "\x22\x21\x1B\xFF\x28\x26\x21\xFF\x23\x21\x1C\xFF\x22\x21\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1D" + "\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x24\x23\x1D\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x23\x21\x1C\xFF" + "\x22\x21\x1B\xFF\x25\x23\x1E\xFF\x25\x24\x20\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1D" + "\xFF\x24\x23\x1D\xFF\x25\x23\x1F\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x25\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x23\x21\x1C\xFF\x21\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B" + "\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x25\x24\x20\xFF\x26\x25\x20\xFF\x25\x24\x20\xFF\x23\x23\x1E\xFF\x22\x21\x1B" + "\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF" + "\x25\x24\x20\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x26\x24\x20" + "\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x25\x24\x20" + "\xFF\x25\x25\x20\xFF\x22\x21\x1B\xFF" + "\x26\x24\x20\xFF\x22\x21\x1B\xFF\x22\x22\x1C\xFF\x29\x28\x22\xFF\x23\x22\x1C\xFF\x24\x23\x1E" + "\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF\x29\x28\x23" + "\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B" + "\xFF\x25\x25\x20\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x29\x28\x23" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x23\x21\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x24\x23\x1E" + "\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF" + "\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x27\x25\x20\xFF\x22\x21\x1B\xFF\x27\x25\x21\xFF\x23\x22\x1C" + "\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF" + "\x23\x22\x1D\xFF\x23\x22\x1D\xFF\x25\x24\x1F\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x28\x26\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x25\x24\x1F" + "\xFF\x22\x21\x1B\xFF\x24\x22\x1D\xFF" + "\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x25\x24\x1F\xFF\x24\x23\x1E\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x28\x26\x21\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x28\x26\x21" + "\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF" + "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF" + "\x28\x26\x21\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x25\x20\xFF\x23\x22\x1E" + "\xFF\x25\x23\x1E\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x23\x1E\xFF\x24\x23\x1E\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x26\x25\x20\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF" + "\x23\x22\x1C\xFF\x28\x26\x21\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x23\x1E" + "\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x27\x25\x20\xFF\x24\x23\x1E\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x26\x25\x20\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E" + "\xFF\x24\x23\x1E\xFF\x25\x24\x1F\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x26\x26\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x22\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x27\x25\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C" + "\xFF\x26\x25\x21\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x26\x25\x20\xFF\x26\x25\x20\xFF\x24\x23\x1E\xFF\x22\x21\x1B" + "\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF" + "\x26\x25\x21\xFF\x29\x27\x21\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x25\x24\x20" + "\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x26\x25\x20" + "\xFF\x26\x26\x20\xFF\x22\x21\x1B\xFF" + "\x26\x24\x20\xFF\x22\x21\x1B\xFF\x22\x22\x1C\xFF\x29\x28\x22\xFF\x23\x22\x1C\xFF\x24\x23\x1E" + "\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF\x29\x28\x23" + "\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF\x22\x21\x1B" + "\xFF\x26\x26\x21\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x29\x28\x23" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x27\x25\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x24\x1F" + "\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF" + "\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x27\x25\x20\xFF\x22\x21\x1B\xFF\x27\x25\x21\xFF\x4F\x4A\x3D" + "\xFF\x19\x18\x15\xFF\x1A\x19\x15\xFF" + "\x1D\x1B\x17\xFF\x1D\x1B\x17\xFF\x1E\x1C\x18\xFF\x1F\x1D\x18\xFF\x1D\x1B\x17\xFF\x1F\x1D\x19" + "\xFF\x21\x1E\x1A\xFF\x22\x21\x1C\xFF" + "\x24\x22\x1D\xFF\x25\x22\x1C\xFF\x23\x22\x1D\xFF\x25\x22\x1D\xFF\x27\x24\x1F\xFF\x26\x23\x1F" + "\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF" + "\x26\x23\x1E\xFF\x25\x23\x1E\xFF\x24\x23\x1D\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x27\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x26\x24\x1E\xFF" + "\x25\x24\x1E\xFF\x29\x26\x21\xFF\x28\x25\x1F\xFF\x27\x25\x1F\xFF\x28\x26\x21\xFF\x28\x25\x20" + "\xFF\x26\x24\x1F\xFF\x28\x27\x21\xFF" + "\x28\x25\x20\xFF\x28\x25\x1F\xFF\x27\x24\x1F\xFF\x28\x26\x1F\xFF\x25\x24\x1E\xFF\x26\x25\x1F" + "\xFF\x26\x25\x1F\xFF\x28\x26\x1F\xFF" + "\x27\x24\x1F\xFF\x29\x26\x20\xFF\x27\x25\x1F\xFF\x25\x25\x1F\xFF\x27\x25\x1F\xFF\x27\x25\x1F" + "\xFF\x27\x25\x1F\xFF\x27\x25\x20\xFF" + "\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x24\x24\x1E\xFF\x29\x26\x21\xFF\x28\x26\x1F\xFF\x26\x25\x1F" + "\xFF\x25\x23\x1E\xFF\x26\x25\x1D\xFF" + "\x26\x23\x1E\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x27\x25\x20\xFF\x25\x24\x1E\xFF\x25\x24\x1E" + "\xFF\x26\x24\x1E\xFF\x26\x24\x1F\xFF" + "\x26\x24\x1F\xFF\x28\x25\x20\xFF\x2A\x26\x21\xFF\x27\x26\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F" + "\xFF\x28\x26\x20\xFF\x28\x25\x20\xFF" + "\x25\x23\x1E\xFF\x27\x25\x1F\xFF\x29\x26\x20\xFF\x24\x22\x1D\xFF\x26\x25\x20\xFF\x25\x24\x1F" + "\xFF\x26\x23\x1E\xFF\x26\x24\x1F\xFF" + "\x26\x24\x1F\xFF\x26\x25\x20\xFF\x26\x25\x20\xFF\x25\x23\x1E\xFF\x27\x26\x1F\xFF\x26\x24\x1E" + "\xFF\x24\x22\x1D\xFF\x26\x23\x1E\xFF" + "\x26\x24\x1E\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x26\x23\x1E" + "\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF" + "\x26\x22\x1D\xFF\x24\x21\x1C\xFF\x25\x23\x1E\xFF\x29\x28\x22\xFF\x25\x22\x1C\xFF\x27\x25\x1F" + "\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" + "\x27\x23\x1E\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x25\x23\x1D\xFF\x25\x22\x1D\xFF\x24\x22\x1D" + "\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF" + "\x29\x26\x20\xFF\x26\x24\x1E\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x25\x24\x1E\xFF\x26\x24\x1F" + "\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF" + "\x26\x25\x1F\xFF\x28\x25\x20\xFF\x25\x23\x1E\xFF\x25\x23\x1D\xFF\x28\x2B\x23\xFF\x35\x57\x43" + "\xFF\x4E\xB1\x84\xFF\x57\xCD\x98\xFF" + "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x51\xBB\x8A\xFF\x36\x60\x49\xFF\x25\x2A\x23\xFF\x27\x25\x1F\xFF\x26\x23\x1E" + "\xFF\x25\x22\x1D\xFF\x25\x23\x1E\xFF" + "\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x24\x21\x1D\xFF\x27\x24\x1F\xFF\x25\x25\x1F\xFF\x25\x23\x1E" + "\xFF\x25\x23\x1E\xFF\x26\x24\x1E\xFF" + "\x28\x2A\x23\xFF\x33\x50\x3D\xFF\x4E\xAC\x80\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x52\xBF\x8D\xFF\x34\x58\x43\xFF\x26\x28\x21\xFF\x24\x23\x1E" + "\xFF\x25\x23\x1E\xFF\x27\x24\x1F\xFF" + "\x22\x22\x1C\xFF\x22\x22\x1B\xFF\x25\x22\x1E\xFF\x27\x24\x1F\xFF\x24\x23\x1D\xFF\x26\x24\x1F" + "\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF" + "\x25\x22\x1D\xFF\x25\x23\x1E\xFF\x24\x22\x1E\xFF\x22\x21\x1B\xFF\x25\x22\x1D\xFF\x24\x23\x1E" + "\xFF\x23\x22\x1C\xFF\x24\x21\x1C\xFF" + "\x24\x23\x1D\xFF\x23\x21\x1C\xFF\x25\x23\x1E\xFF\x27\x24\x1F\xFF\x22\x22\x1C\xFF\x23\x23\x1D" + "\xFF\x24\x23\x1E\xFF\x25\x23\x1E\xFF" + "\x23\x21\x1C\xFF\x25\x23\x1E\xFF\x25\x22\x1D\xFF\x23\x22\x1C\xFF\x26\x25\x1F\xFF\x23\x22\x1D" + "\xFF\x21\x21\x1C\xFF\x25\x23\x1E\xFF" + "\x26\x25\x1F\xFF\x25\x23\x1E\xFF\x26\x24\x1F\xFF\x25\x22\x1D\xFF\x24\x23\x1D\xFF\x22\x21\x1C" + "\xFF\x25\x22\x1D\xFF\x23\x21\x1B\xFF" + "\x25\x22\x1D\xFF\x24\x21\x1C\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x24\x22\x1D\xFF\x24\x23\x1D" + "\xFF\x23\x22\x1C\xFF\x23\x22\x1D\xFF" + "\x24\x22\x1D\xFF\x25\x23\x1E\xFF\x22\x21\x1C\xFF\x23\x22\x1D\xFF\x25\x22\x1D\xFF\x24\x23\x1D" + "\xFF\x23\x22\x1C\xFF\x24\x22\x1D\xFF" + "\x24\x23\x1D\xFF\x24\x23\x1D\xFF\x25\x22\x1D\xFF\x23\x22\x1D\xFF\x25\x23\x1E\xFF\x25\x24\x1D" + "\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF" + "\x22\x22\x1D\xFF\x23\x22\x1D\xFF\x24\x23\x1D\xFF\x24\x22\x1E\xFF\x24\x23\x1E\xFF\x22\x22\x1C" + "\xFF\x24\x22\x1D\xFF\x23\x21\x1C\xFF" + "\x26\x23\x1E\xFF\x24\x23\x1E\xFF\x23\x21\x1C\xFF\x23\x22\x1C\xFF\x24\x22\x1D\xFF\x25\x22\x1D" + "\xFF\x25\x23\x1D\xFF\x25\x23\x1E\xFF" + "\x25\x23\x1E\xFF\x24\x22\x1E\xFF\x24\x23\x1E\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x25\x23\x1E" + "\xFF\x25\x24\x1E\xFF\x26\x24\x1F\xFF" + "\x25\x23\x1D\xFF\x25\x23\x1D\xFF\x23\x22\x1C\xFF\x25\x22\x1D\xFF\x24\x23\x1D\xFF\x24\x22\x1C" + "\xFF\x22\x20\x1B\xFF\x23\x21\x1C\xFF" + "\x22\x22\x1C\xFF\x24\x21\x1D\xFF\x23\x22\x1D\xFF\x25\x22\x1D\xFF\x23\x22\x1C\xFF\x25\x23\x1D" + "\xFF\x24\x21\x1C\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1C\xFF\x26\x23\x1E\xFF\x22\x21\x1C\xFF\x22\x20\x1B\xFF\x24\x21\x1C\xFF\x23\x22\x1C" + "\xFF\x23\x22\x1C\xFF\x22\x22\x1D\xFF" + "\x24\x21\x1C\xFF\x24\x21\x1C\xFF\x23\x20\x1B\xFF\x20\x20\x19\xFF\x26\x23\x1E\xFF\x25\x23\x1C" + "\xFF\x23\x22\x1C\xFF\x21\x22\x1B\xFF" + "\x22\x22\x1D\xFF\x27\x2C\x24\xFF\x26\x2A\x23\xFF\x23\x24\x1C\xFF\x23\x24\x1E\xFF\x23\x22\x1D" + "\xFF\x24\x23\x1D\xFF\x22\x22\x1B\xFF" + "\x24\x22\x1D\xFF\x21\x1F\x1A\xFF\x22\x20\x1B\xFF\x21\x20\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x1E" + "\xFF\x23\x22\x1D\xFF\x1F\x1F\x19\xFF" + "\x22\x21\x1B\xFF\x23\x20\x1B\xFF\x24\x22\x1D\xFF\x24\x23\x1D\xFF\x28\x25\x1E\xFF\x25\x22\x1D" + "\xFF\x23\x22\x1D\xFF\x1F\x1E\x19\xFF" + "\x22\x22\x1C\xFF\x20\x1F\x1B\xFF\x22\x20\x1C\xFF\x20\x20\x1B\xFF\x21\x1F\x1B\xFF\x22\x21\x1C" + "\xFF\x21\x20\x1B\xFF\x24\x22\x1D\xFF" + "\x26\x23\x1E\xFF\x26\x23\x1F\xFF\x24\x22\x1D\xFF\x22\x21\x1B\xFF\x24\x23\x1D\xFF\x23\x22\x1D" + "\xFF\x23\x22\x1C\xFF\x25\x24\x1D\xFF" + "\x14\x12\x0F\xFF\x14\x13\x0F\xFF\x13\x12\x0F\xFF\x18\x17\x13\xFF\x13\x12\x0E\xFF\x14\x12\x10" + "\xFF\x16\x13\x10\xFF\x14\x14\x0E\xFF" + "\x12\x10\x0E\xFF\x0F\x0E\x0B\xFF\x11\x10\x0D\xFF\x15\x13\x11\xFF\x16\x14\x10\xFF\x14\x12\x10" + "\xFF\x15\x14\x10\xFF\x14\x13\x10\xFF" + "\x14\x13\x10\xFF\x11\x10\x0F\xFF\x14\x14\x10\xFF\x15\x14\x10\xFF\x16\x15\x11\xFF\x15\x14\x10" + "\xFF\x19\x18\x14\xFF\x15\x14\x10\xFF" + "\x12\x10\x0E\xFF\x10\x10\x0C\xFF\x10\x0F\x0D\xFF\x13\x12\x0F\xFF\x16\x15\x11\xFF\x14\x12\x10" + "\xFF\x14\x13\x10\xFF\x14\x13\x10\xFF" + "\x12\x10\x0F\xFF\x13\x12\x0F\xFF\x15\x13\x11\xFF\x14\x13\x0F\xFF\x14\x13\x10\xFF\x14\x13\x10" + "\xFF\x13\x11\x0F\xFF\x15\x13\x11\xFF" + "\x15\x14\x11\xFF\x13\x12\x0E\xFF\x12\x11\x0E\xFF\x12\x10\x0E\xFF\x12\x11\x0D\xFF\x14\x13\x0F" + "\xFF\x14\x14\x0F\xFF\x12\x11\x0D\xFF" + "\x12\x11\x0E\xFF\x15\x13\x11\xFF\x15\x14\x11\xFF\x15\x14\x11\xFF\x12\x12\x0F\xFF\x14\x14\x0F" + "\xFF\x14\x13\x11\xFF\x14\x13\x10\xFF" + "\x17\x16\x12\xFF\x15\x14\x10\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x14\x12\x10\xFF\x14\x12\x10" + "\xFF\x15\x14\x10\xFF\x13\x12\x0E\xFF" + "\x14\x13\x0F\xFF\x13\x12\x0E\xFF\x11\x10\x0D\xFF\x11\x10\x0C\xFF\x15\x14\x10\xFF\x17\x16\x12" + "\xFF\x16\x14\x11\xFF\x18\x17\x13\xFF" + "\x13\x11\x10\xFF\x14\x12\x10\xFF\x16\x15\x11\xFF\x14\x13\x0F\xFF\x12\x12\x10\xFF\x15\x13\x10" + "\xFF\x12\x12\x0F\xFF\x0F\x0F\x0D\xFF" + "\x13\x11\x10\xFF\x14\x13\x10\xFF\x17\x14\x11\xFF\x15\x14\x10\xFF\x13\x12\x0E\xFF\x12\x11\x0F" + "\xFF\x14\x13\x0F\xFF\x13\x11\x10\xFF" + "\x15\x14\x11\xFF\x16\x15\x11\xFF\x19\x18\x14\xFF\x15\x14\x11\xFF\x13\x11\x0E\xFF\x13\x11\x10" + "\xFF\x14\x13\x11\xFF\x12\x11\x0F\xFF" + "\x17\x16\x12\xFF\x19\x18\x14\xFF\x18\x16\x12\xFF\x18\x16\x13\xFF\x14\x13\x11\xFF\x14\x13\x10" + "\xFF\x17\x15\x14\xFF\x15\x14\x10\xFF" + "\x18\x17\x13\xFF\x18\x17\x12\xFF\x18\x17\x13\xFF\x1A\x19\x15\xFF\x14\x13\x0F\xFF\x16\x14\x12" + "\xFF\x17\x16\x12\xFF\x14\x13\x0F\xFF" + "\x14\x12\x11\xFF\x18\x17\x13\xFF\x15\x14\x11\xFF\x15\x13\x11\xFF\x14\x13\x0F\xFF\x19\x16\x12" + "\xFF\x1A\x19\x15\xFF\x17\x16\x12\xFF" + "\x15\x13\x11\xFF\x14\x13\x0F\xFF\x15\x14\x10\xFF\x14\x13\x10\xFF\x18\x17\x12\xFF\x15\x14\x11" + "\xFF\x16\x14\x11\xFF\x17\x16\x12\xFF" + "\x19\x17\x13\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x19\x18\x13\xFF\x17\x16\x12\xFF\x18\x17\x13" + "\xFF\x18\x18\x14\xFF\x17\x16\x12\xFF" + "\x15\x14\x10\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF\x1B\x1A\x16\xFF\x1B\x1A\x16\xFF\x18\x17\x14" + "\xFF\x18\x16\x13\xFF\x1B\x19\x15\xFF" + "\x17\x15\x11\xFF\x14\x15\x11\xFF\x15\x15\x11\xFF\x15\x14\x10\xFF\x17\x16\x12\xFF\x17\x16\x12" + "\xFF\x17\x16\x12\xFF\x1B\x1A\x16\xFF" + "\x19\x18\x14\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF\x18\x17\x12\xFF\x14\x13\x0F\xFF\x16\x15\x11" + "\xFF\x17\x16\x12\xFF\x17\x15\x11\xFF" + "\x19\x18\x14\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x16\x15\x11" + "\xFF\x16\x14\x11\xFF\x1B\x1A\x16\xFF" + "\x1A\x19\x15\xFF\x1A\x19\x16\xFF\x19\x19\x15\xFF\x17\x15\x13\xFF\x19\x18\x14\xFF\x19\x18\x14" + "\xFF\x16\x15\x11\xFF\x1A\x19\x15\xFF" + "\x1F\x1D\x19\xFF\x19\x18\x14\xFF\x1B\x19\x15\xFF\x1B\x1A\x15\xFF\x18\x17\x13\xFF\x1A\x18\x14" + "\xFF\x19\x18\x14\xFF\x19\x17\x13\xFF" + "\x1B\x1A\x16\xFF\x19\x18\x14\xFF\x1A\x19\x15\xFF\x1A\x19\x15\xFF\x1D\x1C\x18\xFF\x19\x18\x14" + "\xFF\x18\x17\x14\xFF\x18\x16\x13\xFF" + "\x19\x17\x13\xFF\x1D\x1A\x16\xFF\x1A\x19\x15\xFF\x17\x16\x12\xFF\x1A\x18\x14\xFF\x19\x18\x14" + "\xFF\x18\x17\x14\xFF\x1A\x19\x15\xFF" + "\x19\x18\x14\xFF\x19\x18\x13\xFF\x19\x17\x13\xFF\x19\x17\x13\xFF\x1C\x1A\x16\xFF\x1B\x19\x15" + "\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF" + "\x1A\x18\x14\xFF\x1C\x1A\x16\xFF\x19\x17\x13\xFF\x17\x16\x12\xFF\x1B\x1A\x16\xFF\x1E\x1B\x17" + "\xFF\x1A\x17\x14\xFF\x19\x18\x14\xFF" + "\x1B\x1A\x16\xFF\x19\x18\x14\xFF\x1B\x19\x15\xFF\x1D\x1A\x16\xFF\x1C\x1B\x17\xFF\x1B\x1A\x16" + "\xFF\x1C\x1B\x17\xFF\x1C\x1B\x16\xFF" + "\x1D\x1C\x18\xFF\x18\x16\x12\xFF\x19\x17\x15\xFF\x19\x18\x15\xFF\x1A\x19\x15\xFF\x1C\x1A\x16" + "\xFF\x1E\x1C\x18\xFF\x20\x1F\x1A\xFF" + "\x18\x17\x13\xFF\x18\x16\x12\xFF\x1B\x19\x14\xFF\x1D\x1D\x17\xFF\x19\x1A\x15\xFF\x1F\x1E\x19" + "\xFF\x1F\x1D\x19\xFF\x20\x1E\x19\xFF" + "\x1A\x19\x14\xFF\x1A\x18\x14\xFF\x1A\x19\x15\xFF\x1D\x1B\x17\xFF\x20\x1D\x1A\xFF\x1F\x1F\x19" + "\xFF\x1E\x1D\x19\xFF\x1B\x19\x16\xFF" + "\x1C\x1B\x16\xFF\x1B\x1B\x16\xFF\x1D\x1C\x17\xFF\x1F\x1D\x18\xFF\x1B\x1B\x16\xFF\x1A\x19\x15" + "\xFF\x1C\x1A\x16\xFF\x1D\x1B\x17\xFF" + "\x1D\x1C\x16\xFF\x19\x18\x14\xFF\x1A\x1A\x15\xFF\x1D\x1D\x17\xFF\x21\x1E\x1A\xFF\x1D\x1D\x18" + "\xFF\x1F\x1E\x19\xFF\x1B\x1A\x16\xFF" + "\x1C\x1B\x16\xFF\x1D\x1C\x18\xFF\x1C\x1B\x16\xFF\x1A\x19\x15\xFF\x1A\x1A\x15\xFF\x1D\x1C\x18" + "\xFF\x1F\x1D\x19\xFF\x1F\x1C\x18\xFF" + "\x1D\x1C\x16\xFF\x1E\x1D\x19\xFF\x1D\x1C\x18\xFF\x1D\x1A\x16\xFF\x1E\x1F\x19\xFF\x1F\x1E\x1A" + "\xFF\x1E\x1C\x19\xFF\x20\x1E\x1A\xFF" + "\x1E\x1D\x18\xFF\x1E\x1C\x16\xFF\x1C\x1C\x17\xFF\x1D\x1D\x17\xFF\x1B\x1A\x16\xFF\x1C\x1A\x16" + "\xFF\x1E\x1C\x18\xFF\x22\x20\x1B\xFF" + "\x1F\x1D\x18\xFF\x1D\x1C\x18\xFF\x1F\x1E\x19\xFF\x20\x1E\x1A\xFF\x1E\x1E\x18\xFF\x1F\x1D\x19" + "\xFF\x1E\x1D\x18\xFF\x1D\x1C\x17\xFF" + "\x1F\x1E\x1A\xFF\x22\x21\x1C\xFF\x21\x20\x1A\xFF\x1E\x1E\x18\xFF\x1C\x1A\x16\xFF\x1F\x1D\x19" + "\xFF\x21\x1F\x1A\xFF\x23\x20\x1B\xFF" + "\x1F\x1F\x1A\xFF\x22\x21\x1C\xFF\x21\x20\x1B\xFF\x22\x22\x1C\xFF\x1C\x1C\x18\xFF\x1D\x1D\x19" + "\xFF\x22\x1F\x1A\xFF\x1F\x1E\x19\xFF" + "\x1A\x1A\x15\xFF\x1C\x1B\x16\xFF\x1D\x1A\x17\xFF\x1C\x1B\x18\xFF\x1F\x1E\x19\xFF\x1C\x1B\x16" + "\xFF\x1B\x1A\x16\xFF\x1E\x1B\x17\xFF" + "\x1A\x1B\x17\xFF\x1D\x1B\x16\xFF\x1C\x1B\x17\xFF\x19\x18\x15\xFF\x17\x16\x13\xFF\x17\x16\x13" + "\xFF\x19\x17\x14\xFF\x19\x19\x15\xFF" + "\x16\x16\x12\xFF\x15\x15\x11\xFF\x50\x4C\x40\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x21\x20\x1A" + "\xFF\x21\x20\x1B\xFF\x24\x22\x1D\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x21\x20\x1A\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x28\x27\x21" + "\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x23\x22\x1D\xFF\x21\x20\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1C\xFF\x23\x21\x1C\xFF\x22\x22\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" + "\x23\x22\x1C\xFF\x21\x20\x1B\xFF\x22\x20\x1B\xFF\x23\x21\x1C\xFF\x23\x21\x1C\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF" + "\x21\x20\x1A\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1D\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1D\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x29\x28\x23" + "\xFF\x22\x21\x1B\xFF\x21\x20\x1A\xFF" + "\x26\x25\x20\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x28\x26\x21" + "\xFF\x23\x21\x1C\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x25\x20\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x21\x20\x1A\xFF\x21\x21\x1B\xFF" + "\x25\x24\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x23\x23\x1E\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" + "\x23\x21\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x23\x1E\xFF\x25\x24\x20\xFF\x22\x21\x1B" + "\xFF\x22\x20\x1B\xFF\x22\x21\x1B\xFF" + "\x24\x22\x1E\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x26\x25\x20\xFF\x22\x20\x1B\xFF\x26\x25\x20" + "\xFF\x29\x28\x23\xFF\x26\x25\x20\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x29\x28\x23\xFF\x22\x21\x1B\xFF" + "\x23\x21\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1D\xFF\x22\x22\x1C\xFF\x24\x23\x1E\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x24\x22\x1D\xFF" + "\x24\x23\x1E\xFF\x22\x22\x1C\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x24\x23\x1D\xFF\x22\x21\x1B" + "\xFF\x24\x22\x1D\xFF\x24\x22\x1D\xFF" + "\x22\x20\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x21\x1C\xFF\x28\x26\x21\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF" + "\x26\x24\x20\xFF\x27\x25\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x28\x26\x21" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1C\xFF" + "\x25\x24\x20\xFF\x25\x24\x1F\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x24\x20" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x28\x26\x21\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x25\x25\x20\xFF\x22\x21\x1B" + "\xFF\x29\x28\x23\xFF\x25\x24\x1F\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x2A\x29\x23\xFF\x26\x25\x20\xFF\x22\x20\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF\x23\x21\x1C" + "\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF" + "\x23\x22\x1C\xFF\x27\x25\x21\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x26\x25\x20\xFF\x26\x24\x20\xFF" + "\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x27\x25\x20\xFF\x25\x24\x20\xFF" + "\x27\x25\x20\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" + "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x23\x1E\xFF\x22\x21\x1B\xFF\x29\x28\x22" + "\xFF\x27\x25\x20\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1E\xFF\x22\x21\x1B\xFF" + "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x29\x28\x23" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x27\x25\x20\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x28\x26\x21" + "\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" + "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x27\x25\x20\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x26\x24\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x23\x23\x1E\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" + "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x26\x25\x20\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x25\x24\x1E\xFF\x27\x26\x20\xFF\x22\x21\x1B\xFF\x27\x25\x20" + "\xFF\x29\x28\x23\xFF\x26\x25\x21\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x29\x28\x23\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" + "\x24\x23\x1E\xFF\x22\x22\x1C\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B" + "\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x29\x26\x21\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF" + "\x26\x25\x20\xFF\x26\x26\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x28\x26\x21" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" + "\x26\x25\x20\xFF\x25\x24\x1F\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x25\x20" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x28\x26\x21\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x22\x21\x1B" + "\xFF\x29\x28\x23\xFF\x25\x24\x1F\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x2A\x29\x23\xFF\x26\x25\x20\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x27\x25\x21\xFF\x4F\x4A\x3D" + "\xFF\x19\x18\x15\xFF\x1B\x1A\x16\xFF" + "\x1D\x1B\x16\xFF\x1D\x1D\x17\xFF\x1D\x1C\x18\xFF\x1E\x1E\x19\xFF\x20\x1D\x19\xFF\x22\x1F\x1B" + "\xFF\x22\x20\x1B\xFF\x24\x21\x1D\xFF" + "\x22\x1F\x1B\xFF\x24\x22\x1D\xFF\x25\x22\x1E\xFF\x26\x24\x1F\xFF\x25\x24\x1E\xFF\x23\x23\x1D" + "\xFF\x25\x22\x1D\xFF\x27\x23\x1E\xFF" + "\x26\x23\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x25\x25\x1F\xFF\x28\x27\x20" + "\xFF\x28\x26\x21\xFF\x27\x24\x1F\xFF" + "\x25\x24\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x1F\xFF\x28\x26\x21\xFF\x27\x25\x20\xFF\x26\x24\x1F" + "\xFF\x25\x23\x1E\xFF\x26\x24\x1F\xFF" + "\x27\x26\x20\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF\x27\x25\x20\xFF\x28\x25\x20" + "\xFF\x24\x23\x1E\xFF\x26\x24\x1E\xFF" + "\x25\x23\x1E\xFF\x27\x26\x20\xFF\x27\x25\x1F\xFF\x29\x27\x20\xFF\x27\x24\x1F\xFF\x28\x25\x20" + "\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF" + "\x28\x25\x20\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x24\x23\x1E" + "\xFF\x25\x23\x1E\xFF\x27\x25\x1F\xFF" + "\x27\x25\x1E\xFF\x27\x25\x20\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF\x25\x26\x1E\xFF\x26\x25\x1F" + "\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF" + "\x28\x26\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x23\x22\x1D\xFF\x28\x25\x20\xFF\x29\x27\x20" + "\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF" + "\x23\x22\x1C\xFF\x28\x25\x1F\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x25\x1E" + "\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF" + "\x27\x24\x1F\xFF\x27\x25\x1F\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x26\x25\x20\xFF\x26\x24\x1F" + "\xFF\x23\x23\x1E\xFF\x26\x23\x1E\xFF" + "\x24\x23\x1E\xFF\x25\x24\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1E\xFF\x27\x26\x1F" + "\xFF\x26\x23\x1E\xFF\x25\x22\x1D\xFF" + "\x26\x23\x1E\xFF\x26\x24\x1E\xFF\x27\x26\x20\xFF\x28\x26\x21\xFF\x25\x22\x1D\xFF\x27\x26\x1F" + "\xFF\x27\x25\x1E\xFF\x24\x23\x1D\xFF" + "\x24\x22\x1E\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x25\x26\x1D\xFF\x29\x26\x21\xFF\x26\x24\x1F" + "\xFF\x26\x24\x1F\xFF\x26\x25\x1E\xFF" + "\x27\x24\x1F\xFF\x25\x23\x1D\xFF\x27\x25\x1E\xFF\x27\x27\x21\xFF\x27\x24\x21\xFF\x28\x26\x1F" + "\xFF\x26\x23\x1E\xFF\x24\x23\x1E\xFF" + "\x24\x23\x1E\xFF\x24\x22\x1D\xFF\x23\x21\x1D\xFF\x26\x23\x1E\xFF\x29\x29\x22\xFF\x2E\x3E\x31" + "\xFF\x48\x9C\x74\xFF\x56\xCC\x97\xFF" + "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x56\xCA\x96\xFF\x3F\x7F\x5F\xFF\x28\x33\x28\xFF\x27\x27\x20\xFF\x27\x24\x1F" + "\xFF\x25\x23\x1E\xFF\x24\x23\x1E\xFF" + "\x25\x22\x1D\xFF\x23\x21\x1C\xFF\x23\x21\x1C\xFF\x27\x24\x1F\xFF\x25\x24\x1E\xFF\x24\x24\x1E" + "\xFF\x23\x22\x1E\xFF\x24\x23\x1F\xFF" + "\x25\x27\x1F\xFF\x2B\x38\x2C\xFF\x46\x94\x6F\xFF\x57\xCB\x97\xFF\x57\xCD\x98\xFF\x56\xCD\x98" + "\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCC\x97\xFF\x3E\x7D\x5E\xFF\x28\x2E\x26\xFF\x24\x24\x1F" + "\xFF\x23\x22\x1D\xFF\x26\x23\x1E\xFF" + "\x27\x25\x20\xFF\x26\x24\x1E\xFF\x24\x23\x1D\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x22\x20\x1C" + "\xFF\x24\x22\x1D\xFF\x24\x24\x1E\xFF" + "\x25\x22\x1E\xFF\x26\x23\x1E\xFF\x25\x22\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x25\x23\x1E" + "\xFF\x22\x21\x1B\xFF\x27\x24\x1F\xFF" + "\x27\x24\x1F\xFF\x24\x21\x1D\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x24\x22\x1C\xFF\x24\x23\x1D" + "\xFF\x23\x23\x1D\xFF\x25\x22\x1D\xFF" + "\x21\x21\x1B\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x24\x21\x1D\xFF\x23\x22\x1C\xFF\x25\x23\x1E" + "\xFF\x23\x22\x1C\xFF\x25\x22\x1D\xFF" + "\x26\x25\x1F\xFF\x26\x23\x1F\xFF\x23\x22\x1D\xFF\x24\x21\x1C\xFF\x26\x24\x1F\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1C\xFF\x22\x22\x1C\xFF" + "\x24\x22\x1D\xFF\x23\x21\x1C\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x22\x22\x1B\xFF\x25\x23\x1C" + "\xFF\x26\x24\x1E\xFF\x22\x21\x1C\xFF" + "\x24\x22\x1D\xFF\x23\x22\x1C\xFF\x21\x21\x1C\xFF\x24\x22\x1D\xFF\x23\x22\x1C\xFF\x25\x25\x1E" + "\xFF\x24\x23\x1E\xFF\x26\x24\x1D\xFF" + "\x23\x20\x1C\xFF\x23\x21\x1C\xFF\x24\x21\x1C\xFF\x25\x22\x1E\xFF\x23\x23\x1D\xFF\x26\x24\x1E" + "\xFF\x24\x23\x1D\xFF\x24\x22\x1E\xFF" + "\x23\x23\x1D\xFF\x25\x22\x1D\xFF\x25\x22\x1D\xFF\x23\x22\x1D\xFF\x20\x1F\x1A\xFF\x21\x20\x1B" + "\xFF\x25\x21\x1D\xFF\x25\x22\x1E\xFF" + "\x21\x20\x1B\xFF\x22\x20\x1C\xFF\x24\x22\x1D\xFF\x23\x21\x1C\xFF\x23\x20\x1C\xFF\x25\x22\x1D" + "\xFF\x23\x21\x1C\xFF\x21\x22\x1A\xFF" + "\x24\x21\x1C\xFF\x25\x23\x1E\xFF\x26\x24\x1F\xFF\x25\x22\x1D\xFF\x24\x23\x1D\xFF\x25\x24\x1E" + "\xFF\x25\x24\x1E\xFF\x25\x22\x1D\xFF" + "\x27\x24\x1F\xFF\x25\x22\x1D\xFF\x23\x22\x1C\xFF\x24\x23\x1D\xFF\x22\x22\x1A\xFF\x25\x22\x1D" + "\xFF\x26\x22\x1D\xFF\x25\x22\x1D\xFF" + "\x23\x21\x1C\xFF\x22\x21\x1C\xFF\x24\x21\x1C\xFF\x24\x21\x1C\xFF\x22\x22\x1C\xFF\x22\x20\x1B" + "\xFF\x22\x20\x1B\xFF\x23\x23\x1D\xFF" + "\x26\x24\x1F\xFF\x22\x22\x1C\xFF\x21\x20\x1B\xFF\x22\x1F\x1A\xFF\x21\x20\x1B\xFF\x21\x20\x1B" + "\xFF\x22\x22\x1C\xFF\x23\x22\x1C\xFF" + "\x24\x21\x1C\xFF\x23\x20\x1B\xFF\x24\x21\x1C\xFF\x22\x20\x1B\xFF\x22\x21\x1B\xFF\x27\x24\x1F" + "\xFF\x28\x25\x1F\xFF\x25\x23\x1D\xFF" + "\x21\x21\x1B\xFF\x24\x23\x1D\xFF\x26\x23\x1E\xFF\x26\x24\x1C\xFF\x26\x26\x20\xFF\x28\x25\x20" + "\xFF\x23\x22\x1D\xFF\x20\x20\x1B\xFF" + "\x23\x22\x1D\xFF\x23\x21\x1C\xFF\x21\x21\x1B\xFF\x21\x21\x1C\xFF\x25\x23\x1D\xFF\x24\x22\x1D" + "\xFF\x23\x21\x1C\xFF\x20\x20\x1A\xFF" + "\x22\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x23\x1D\xFF\x22\x21\x1C\xFF\x25\x23\x1D\xFF\x23\x21\x1D" + "\xFF\x22\x20\x1B\xFF\x22\x22\x1D\xFF" + "\x25\x22\x1D\xFF\x22\x21\x1C\xFF\x21\x20\x1B\xFF\x20\x20\x1A\xFF\x21\x21\x1C\xFF\x21\x20\x1B" + "\xFF\x20\x20\x1B\xFF\x25\x22\x1D\xFF" + "\x22\x20\x1C\xFF\x26\x24\x20\xFF\x23\x23\x1D\xFF\x24\x23\x1D\xFF\x22\x1F\x1B\xFF\x24\x22\x1E" + "\xFF\x25\x22\x1E\xFF\x24\x23\x1D\xFF" + "\x0F\x0F\x0D\xFF\x13\x12\x0F\xFF\x12\x11\x0E\xFF\x12\x10\x0E\xFF\x11\x10\x0D\xFF\x12\x11\x0E" + "\xFF\x13\x12\x0F\xFF\x11\x0F\x0E\xFF" + "\x12\x11\x0E\xFF\x12\x11\x0F\xFF\x13\x11\x0E\xFF\x12\x11\x0D\xFF\x19\x18\x14\xFF\x16\x15\x12" + "\xFF\x12\x11\x0E\xFF\x11\x10\x0F\xFF" + "\x14\x13\x0F\xFF\x16\x14\x10\xFF\x13\x12\x0E\xFF\x16\x15\x11\xFF\x17\x15\x11\xFF\x13\x13\x0F" + "\xFF\x12\x12\x0E\xFF\x13\x11\x0F\xFF" + "\x13\x12\x0F\xFF\x13\x11\x0F\xFF\x12\x10\x0E\xFF\x16\x14\x11\xFF\x18\x19\x12\xFF\x14\x12\x0F" + "\xFF\x14\x10\x0F\xFF\x12\x10\x0F\xFF" + "\x12\x10\x0F\xFF\x14\x12\x11\xFF\x15\x14\x11\xFF\x18\x18\x12\xFF\x14\x13\x0F\xFF\x13\x12\x0E" + "\xFF\x15\x14\x11\xFF\x14\x12\x11\xFF" + "\x13\x12\x0E\xFF\x13\x12\x0E\xFF\x13\x12\x0E\xFF\x13\x12\x10\xFF\x12\x11\x0F\xFF\x14\x13\x0F" + "\xFF\x15\x14\x10\xFF\x19\x19\x14\xFF" + "\x14\x14\x0F\xFF\x12\x12\x0D\xFF\x12\x10\x0E\xFF\x14\x13\x0F\xFF\x11\x10\x0E\xFF\x13\x13\x10" + "\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF" + "\x10\x0F\x0B\xFF\x11\x10\x0E\xFF\x15\x14\x10\xFF\x14\x12\x10\xFF\x15\x14\x10\xFF\x15\x14\x10" + "\xFF\x14\x13\x0F\xFF\x16\x15\x11\xFF" + "\x13\x12\x0E\xFF\x14\x13\x0F\xFF\x15\x13\x10\xFF\x15\x13\x10\xFF\x14\x13\x0F\xFF\x14\x13\x10" + "\xFF\x13\x12\x0F\xFF\x11\x10\x0C\xFF" + "\x14\x13\x0F\xFF\x14\x13\x10\xFF\x11\x11\x0F\xFF\x12\x11\x0D\xFF\x14\x11\x0D\xFF\x16\x13\x0F" + "\xFF\x15\x13\x12\xFF\x16\x15\x11\xFF" + "\x13\x13\x0F\xFF\x13\x12\x0F\xFF\x16\x15\x12\xFF\x16\x15\x11\xFF\x12\x10\x0F\xFF\x14\x13\x0F" + "\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF" + "\x15\x14\x11\xFF\x13\x12\x0E\xFF\x14\x13\x0F\xFF\x14\x13\x0F\xFF\x14\x13\x10\xFF\x17\x16\x12" + "\xFF\x16\x15\x11\xFF\x14\x13\x10\xFF" + "\x15\x14\x11\xFF\x16\x15\x13\xFF\x16\x14\x11\xFF\x17\x14\x10\xFF\x16\x15\x11\xFF\x16\x15\x11" + "\xFF\x17\x16\x12\xFF\x15\x14\x11\xFF" + "\x17\x16\x13\xFF\x11\x10\x0E\xFF\x13\x12\x0E\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x16\x15\x11" + "\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF" + "\x13\x11\x0F\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x16\x15\x12\xFF\x15\x14\x10\xFF\x14\x13\x0E" + "\xFF\x17\x16\x11\xFF\x18\x17\x12\xFF" + "\x16\x15\x11\xFF\x16\x15\x11\xFF\x19\x18\x14\xFF\x16\x15\x11\xFF\x14\x12\x10\xFF\x14\x13\x0F" + "\xFF\x14\x13\x0E\xFF\x14\x13\x0F\xFF" + "\x18\x17\x13\xFF\x16\x16\x12\xFF\x12\x12\x0F\xFF\x14\x13\x0F\xFF\x16\x14\x11\xFF\x15\x13\x11" + "\xFF\x17\x15\x12\xFF\x18\x17\x13\xFF" + "\x18\x17\x13\xFF\x15\x14\x10\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x16\x15\x11\xFF\x13\x13\x0E" + "\xFF\x16\x15\x11\xFF\x16\x14\x10\xFF" + "\x15\x13\x11\xFF\x18\x17\x14\xFF\x1C\x1A\x16\xFF\x17\x15\x11\xFF\x14\x13\x0F\xFF\x18\x16\x12" + "\xFF\x1B\x18\x14\xFF\x17\x15\x11\xFF" + "\x14\x13\x0F\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x19\x18\x14\xFF\x17\x16\x12\xFF\x19\x18\x14" + "\xFF\x1B\x1A\x16\xFF\x1B\x1A\x16\xFF" + "\x17\x16\x13\xFF\x15\x14\x10\xFF\x16\x15\x10\xFF\x1B\x1A\x16\xFF\x17\x16\x12\xFF\x1B\x1A\x16" + "\xFF\x18\x17\x13\xFF\x18\x18\x12\xFF" + "\x1A\x17\x14\xFF\x1A\x18\x14\xFF\x1B\x1A\x15\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x17\x16\x12" + "\xFF\x18\x17\x13\xFF\x1B\x1A\x16\xFF" + "\x19\x17\x13\xFF\x18\x17\x13\xFF\x1A\x18\x14\xFF\x1B\x19\x16\xFF\x17\x16\x12\xFF\x18\x17\x13" + "\xFF\x1B\x1A\x16\xFF\x1B\x1B\x16\xFF" + "\x1B\x19\x15\xFF\x18\x16\x12\xFF\x16\x15\x11\xFF\x18\x17\x15\xFF\x1E\x1E\x18\xFF\x1D\x1C\x18" + "\xFF\x1A\x19\x14\xFF\x19\x18\x13\xFF" + "\x1A\x18\x14\xFF\x1A\x19\x15\xFF\x19\x18\x14\xFF\x19\x18\x14\xFF\x1A\x19\x15\xFF\x18\x17\x13" + "\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF" + "\x19\x18\x14\xFF\x1A\x19\x14\xFF\x1C\x1A\x15\xFF\x1A\x19\x14\xFF\x19\x1A\x15\xFF\x1B\x19\x15" + "\xFF\x1D\x1A\x16\xFF\x1E\x1C\x18\xFF" + "\x1F\x1D\x19\xFF\x1A\x18\x14\xFF\x1A\x18\x14\xFF\x1A\x19\x15\xFF\x1B\x19\x17\xFF\x1A\x19\x14" + "\xFF\x1B\x19\x15\xFF\x1A\x18\x14\xFF" + "\x1B\x1A\x16\xFF\x1B\x1A\x15\xFF\x1D\x1C\x17\xFF\x1F\x1E\x19\xFF\x1E\x1C\x17\xFF\x1B\x1B\x15" + "\xFF\x1C\x1B\x17\xFF\x1B\x19\x15\xFF" + "\x1B\x1A\x16\xFF\x1B\x19\x15\xFF\x19\x18\x14\xFF\x17\x16\x12\xFF\x1B\x1A\x16\xFF\x1C\x1A\x17" + "\xFF\x1D\x1B\x18\xFF\x1B\x1B\x15\xFF" + "\x20\x1E\x19\xFF\x1D\x1B\x17\xFF\x1D\x1C\x18\xFF\x1B\x1A\x16\xFF\x1D\x1B\x17\xFF\x1C\x1B\x17" + "\xFF\x1E\x1D\x19\xFF\x1A\x19\x15\xFF" + "\x19\x18\x14\xFF\x19\x19\x15\xFF\x19\x17\x13\xFF\x19\x18\x14\xFF\x1F\x1E\x19\xFF\x1E\x1C\x18" + "\xFF\x1F\x1D\x19\xFF\x1F\x1F\x1A\xFF" + "\x1D\x1B\x17\xFF\x1C\x1A\x16\xFF\x1A\x18\x16\xFF\x18\x17\x13\xFF\x19\x19\x14\xFF\x1E\x1C\x17" + "\xFF\x1B\x19\x15\xFF\x1C\x1B\x17\xFF" + "\x1F\x1C\x18\xFF\x1B\x1A\x16\xFF\x1D\x1C\x18\xFF\x1A\x19\x16\xFF\x1E\x1B\x17\xFF\x20\x1E\x1A" + "\xFF\x1F\x1E\x1A\xFF\x1C\x1B\x17\xFF" + "\x1C\x19\x15\xFF\x20\x1E\x1A\xFF\x22\x20\x1B\xFF\x1F\x1C\x17\xFF\x1F\x1C\x18\xFF\x1E\x1C\x18" + "\xFF\x1C\x1B\x17\xFF\x1A\x19\x15\xFF" + "\x1C\x1B\x17\xFF\x1E\x1C\x18\xFF\x1C\x1B\x18\xFF\x1C\x1C\x17\xFF\x1F\x1E\x1A\xFF\x1D\x1B\x17" + "\xFF\x1E\x1E\x19\xFF\x1D\x1B\x17\xFF" + "\x20\x1F\x1A\xFF\x1D\x1C\x17\xFF\x1D\x1C\x17\xFF\x20\x1D\x19\xFF\x1F\x1E\x19\xFF\x21\x21\x1A" + "\xFF\x1F\x1D\x18\xFF\x1C\x1C\x18\xFF" + "\x1D\x1D\x18\xFF\x20\x20\x1A\xFF\x21\x21\x1B\xFF\x22\x20\x1B\xFF\x1E\x1E\x19\xFF\x1E\x1E\x19" + "\xFF\x1E\x1D\x18\xFF\x1D\x1C\x18\xFF" + "\x20\x1F\x1A\xFF\x22\x20\x1C\xFF\x21\x1F\x1B\xFF\x1F\x1F\x19\xFF\x1E\x1E\x18\xFF\x1C\x1B\x17" + "\xFF\x1F\x1D\x19\xFF\x1E\x1C\x18\xFF" + "\x1D\x1C\x18\xFF\x1C\x1B\x16\xFF\x1D\x1D\x17\xFF\x1F\x1E\x1A\xFF\x1E\x1F\x17\xFF\x1E\x1D\x18" + "\xFF\x1F\x1E\x19\xFF\x20\x20\x1A\xFF" + "\x1F\x1E\x19\xFF\x1F\x1D\x18\xFF\x1F\x1D\x19\xFF\x1F\x1D\x1A\xFF\x1E\x1C\x17\xFF\x1D\x1B\x17" + "\xFF\x1D\x1C\x18\xFF\x1F\x1E\x19\xFF" + "\x1E\x1C\x18\xFF\x1B\x1B\x16\xFF\x1A\x19\x15\xFF\x1C\x1B\x18\xFF\x1A\x18\x15\xFF\x18\x18\x14" + "\xFF\x17\x17\x13\xFF\x17\x17\x13\xFF" + "\x16\x16\x12\xFF\x15\x14\x11\xFF\x4E\x4A\x3D\xFF\x23\x22\x1D\xFF\x21\x20\x1A\xFF\x21\x20\x1A" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF" + "\x22\x21\x1A\xFF\x26\x25\x20\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x21\x21\x1B\xFF" + "\x28\x27\x21\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x28\x26\x22\xFF\x26\x25\x21" + "\xFF\x28\x26\x21\xFF\x21\x20\x1A\xFF" + "\x28\x26\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x21\x20\x1B\xFF\x22\x21\x1C\xFF\x29\x28\x22" + "\xFF\x23\x22\x1C\xFF\x21\x20\x1A\xFF" + "\x25\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x23\x1E\xFF\x25\x25\x20\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF" + "\x25\x24\x20\xFF\x28\x26\x21\xFF\x23\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" + "\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x22\x20\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x20\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x25\x24\x20\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF" + "\x24\x23\x1F\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x26\x25\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x22\x20\x1B\xFF\x25\x24\x20" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF" + "\x25\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x23\x22\x1C\xFF\x22\x22\x1C\xFF\x2A\x29\x23" + "\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF" + "\x26\x25\x21\xFF\x23\x22\x1C\xFF\x27\x25\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x28\x26\x21\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x22\x22\x1C\xFF" + "\x24\x23\x1E\xFF\x29\x28\x22\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" + "\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x22\x1C\xFF\x23\x22\x1C\xFF\x28\x26\x22" + "\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x21\x20\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x25\x23\x1E\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x28\x26\x21\xFF\x27\x25\x20\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x24\x23\x1E" + "\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF" + "\x25\x23\x1E\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x24\x23\x1E\xFF\x24\x23\x1E" + "\xFF\x29\x28\x23\xFF\x26\x25\x20\xFF" + "\x25\x24\x20\xFF\x26\x25\x20\xFF\x29\x28\x22\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x23\x22\x1C" + "\xFF\x2A\x29\x23\xFF\x25\x24\x20\xFF" + "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x24\x23\x1E\xFF\x2B\x2A\x24\xFF" + "\x26\x25\x21\xFF\x23\x23\x1E\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x27\x26\x20\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x29\x28\x22" + "\xFF\x23\x22\x1C\xFF\x25\x24\x1F\xFF" + "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x26\x24\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF" + "\x26\x25\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" + "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x26\x24\x20\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x29\x28\x22\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x28\x26\x22\xFF\x26\x25\x21" + "\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" + "\x28\x26\x21\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x29\x28\x22" + "\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" + "\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x26\x25\x20\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" + "\x25\x24\x20\xFF\x28\x26\x21\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" + "\x23\x22\x1C\xFF\x25\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x27\x25\x20\xFF\x26\x24\x20\xFF\x23\x22\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF" + "\x25\x24\x20\xFF\x23\x22\x1C\xFF\x25\x24\x1F\xFF\x26\x25\x21\xFF\x23\x22\x1C\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" + "\x27\x25\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x26\x25\x20" + "\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" + "\x26\x25\x20\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x22\x22\x1C\xFF\x2A\x29\x23" + "\xFF\x22\x21\x1B\xFF\x27\x25\x20\xFF" + "\x27\x25\x21\xFF\x23\x22\x1C\xFF\x27\x25\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" + "\x28\x26\x21\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" + "\x24\x23\x1E\xFF\x29\x28\x22\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" + "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x22\x1C\xFF\x23\x22\x1C\xFF\x29\x27\x22" + "\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x25\x24\x1F\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x28\x26\x21\xFF\x27\x26\x21\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x24\x23\x1E" + "\xFF\x22\x21\x1B\xFF\x27\x26\x21\xFF" + "\x25\x24\x1F\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x24\x23\x1E\xFF\x24\x23\x1E" + "\xFF\x29\x28\x23\xFF\x26\x25\x20\xFF" + "\x26\x24\x20\xFF\x27\x25\x20\xFF\x29\x28\x22\xFF\x26\x24\x20\xFF\x23\x22\x1C\xFF\x4F\x4A\x3D" + "\xFF\x1A\x19\x15\xFF\x19\x19\x15\xFF" + "\x1B\x1A\x16\xFF\x1D\x1B\x17\xFF\x1D\x1C\x18\xFF\x1D\x1C\x18\xFF\x21\x1E\x19\xFF\x21\x1F\x1B" + "\xFF\x21\x20\x1B\xFF\x21\x21\x1B\xFF" + "\x23\x20\x1C\xFF\x22\x22\x1C\xFF\x21\x21\x1C\xFF\x25\x22\x1D\xFF\x24\x24\x1D\xFF\x25\x24\x1F" + "\xFF\x27\x25\x1F\xFF\x24\x23\x1E\xFF" + "\x24\x23\x1D\xFF\x28\x25\x20\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x25\x24\x1F\xFF\x25\x24\x1E" + "\xFF\x23\x23\x1D\xFF\x27\x25\x1F\xFF" + "\x28\x25\x20\xFF\x29\x26\x21\xFF\x25\x24\x1E\xFF\x24\x22\x1D\xFF\x28\x26\x20\xFF\x27\x25\x1F" + "\xFF\x26\x23\x1E\xFF\x27\x24\x1E\xFF" + "\x27\x24\x1F\xFF\x24\x23\x1E\xFF\x26\x24\x1F\xFF\x28\x28\x22\xFF\x28\x25\x20\xFF\x28\x25\x20" + "\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF" + "\x26\x23\x1E\xFF\x29\x27\x20\xFF\x2A\x27\x22\xFF\x29\x26\x1F\xFF\x26\x25\x1F\xFF\x27\x24\x1F" + "\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF" + "\x28\x25\x20\xFF\x27\x25\x1F\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF\x26\x25\x1F\xFF\x26\x24\x1F" + "\xFF\x28\x24\x1F\xFF\x29\x25\x20\xFF" + "\x27\x26\x20\xFF\x23\x23\x1D\xFF\x26\x24\x1E\xFF\x29\x26\x21\xFF\x25\x24\x1E\xFF\x24\x24\x1E" + "\xFF\x23\x24\x1E\xFF\x28\x28\x21\xFF" + "\x28\x25\x20\xFF\x27\x24\x1F\xFF\x25\x23\x1D\xFF\x25\x24\x1E\xFF\x27\x25\x20\xFF\x27\x25\x1F" + "\xFF\x26\x23\x1E\xFF\x27\x25\x20\xFF" + "\x25\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x24\x23\x1E\xFF\x26\x24\x1F\xFF\x26\x25\x20" + "\xFF\x28\x26\x21\xFF\x28\x26\x21\xFF" + "\x26\x24\x1F\xFF\x25\x24\x1E\xFF\x26\x25\x1F\xFF\x27\x25\x20\xFF\x25\x25\x1F\xFF\x24\x24\x1D" + "\xFF\x27\x26\x1E\xFF\x27\x26\x20\xFF" + "\x25\x25\x1F\xFF\x26\x24\x1F\xFF\x25\x22\x1E\xFF\x26\x23\x1E\xFF\x24\x23\x1E\xFF\x26\x24\x1F" + "\xFF\x26\x24\x1F\xFF\x28\x26\x20\xFF" + "\x25\x22\x1E\xFF\x25\x23\x1E\xFF\x27\x25\x20\xFF\x28\x27\x20\xFF\x26\x26\x1E\xFF\x27\x24\x1F" + "\xFF\x26\x23\x1E\xFF\x25\x25\x1F\xFF" + "\x28\x26\x1F\xFF\x27\x25\x1F\xFF\x26\x24\x1F\xFF\x23\x23\x1D\xFF\x25\x24\x20\xFF\x26\x25\x20" + "\xFF\x29\x25\x20\xFF\x26\x24\x1F\xFF" + "\x24\x22\x1D\xFF\x23\x23\x1D\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF\x24\x23\x1D" + "\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF" + "\x25\x23\x1E\xFF\x26\x23\x1E\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x25\x26\x1F\xFF\x28\x2F\x25" + "\xFF\x3E\x78\x5B\xFF\x54\xC4\x91\xFF" + "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x4C\xA5\x7B\xFF\x30\x46\x37\xFF\x27\x27\x21\xFF\x27\x25\x1F" + "\xFF\x25\x24\x1E\xFF\x26\x23\x1E\xFF" + "\x24\x23\x1C\xFF\x26\x23\x1E\xFF\x24\x22\x1D\xFF\x27\x24\x1F\xFF\x25\x24\x1E\xFF\x29\x26\x21" + "\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF" + "\x27\x26\x21\xFF\x28\x2C\x26\xFF\x39\x6C\x52\xFF\x53\xC1\x8F\xFF\x57\xCD\x98\xFF\x56\xCD\x98" + "\xFF\x56\xCD\x98\xFF\x56\xCD\x97\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCC\x97\xFF\x4F\xB5\x85\xFF\x29\x38\x2D\xFF\x27\x28\x21" + "\xFF\x24\x23\x1E\xFF\x26\x23\x1E\xFF" + "\x24\x24\x1E\xFF\x24\x22\x1D\xFF\x24\x23\x1D\xFF\x25\x25\x1F\xFF\x27\x24\x1F\xFF\x25\x23\x1E" + "\xFF\x24\x22\x1D\xFF\x22\x21\x1C\xFF" + "\x25\x22\x1D\xFF\x25\x24\x1F\xFF\x24\x23\x1D\xFF\x26\x24\x1E\xFF\x27\x25\x1F\xFF\x25\x23\x1E" + "\xFF\x24\x22\x1E\xFF\x25\x25\x1E\xFF" + "\x26\x24\x1F\xFF\x23\x22\x1D\xFF\x25\x23\x1D\xFF\x25\x22\x1D\xFF\x25\x24\x1E\xFF\x27\x24\x1F" + "\xFF\x26\x23\x1E\xFF\x25\x23\x1E\xFF" + "\x23\x23\x1D\xFF\x25\x25\x1F\xFF\x27\x26\x21\xFF\x26\x24\x1E\xFF\x24\x23\x1E\xFF\x24\x22\x1C" + "\xFF\x22\x21\x1C\xFF\x26\x23\x1E\xFF" + "\x25\x22\x1D\xFF\x24\x22\x1D\xFF\x26\x24\x1E\xFF\x24\x23\x1D\xFF\x27\x24\x1F\xFF\x26\x24\x1F" + "\xFF\x24\x22\x1D\xFF\x23\x22\x1D\xFF" + "\x24\x21\x1C\xFF\x23\x22\x1C\xFF\x25\x24\x1E\xFF\x25\x22\x1D\xFF\x25\x22\x1D\xFF\x24\x21\x1C" + "\xFF\x26\x24\x1F\xFF\x27\x27\x1E\xFF" + "\x25\x24\x1E\xFF\x26\x23\x1E\xFF\x24\x23\x1D\xFF\x22\x23\x1E\xFF\x22\x21\x1B\xFF\x21\x20\x1C" + "\xFF\x23\x22\x1D\xFF\x24\x22\x1D\xFF" + "\x20\x20\x1A\xFF\x21\x20\x1B\xFF\x24\x22\x1D\xFF\x26\x23\x1E\xFF\x24\x24\x1E\xFF\x25\x25\x1E" + "\xFF\x23\x21\x1C\xFF\x21\x20\x1A\xFF" + "\x21\x20\x1B\xFF\x23\x21\x1C\xFF\x24\x22\x1D\xFF\x24\x21\x1D\xFF\x22\x22\x1C\xFF\x22\x21\x1C" + "\xFF\x22\x21\x1C\xFF\x22\x21\x1C\xFF" + "\x24\x21\x1C\xFF\x21\x20\x1B\xFF\x22\x20\x1B\xFF\x26\x24\x1F\xFF\x22\x20\x1B\xFF\x22\x22\x1C" + "\xFF\x24\x23\x1E\xFF\x21\x20\x1B\xFF" + "\x25\x22\x1D\xFF\x25\x22\x1D\xFF\x23\x22\x1D\xFF\x22\x23\x1E\xFF\x22\x22\x1C\xFF\x24\x23\x1D" + "\xFF\x27\x24\x1F\xFF\x25\x22\x1D\xFF" + "\x25\x21\x1C\xFF\x25\x22\x1D\xFF\x25\x22\x1D\xFF\x24\x21\x1D\xFF\x22\x1E\x1A\xFF\x26\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x25\x22\x1D\xFF" + "\x22\x22\x1C\xFF\x22\x22\x1D\xFF\x21\x21\x1B\xFF\x23\x23\x1C\xFF\x22\x20\x1B\xFF\x23\x22\x1C" + "\xFF\x25\x23\x1D\xFF\x24\x22\x1D\xFF" + "\x26\x23\x1E\xFF\x24\x22\x1D\xFF\x23\x20\x1B\xFF\x21\x1F\x1A\xFF\x23\x23\x1D\xFF\x22\x22\x1C" + "\xFF\x26\x23\x1E\xFF\x26\x25\x1F\xFF" + "\x27\x24\x1F\xFF\x21\x21\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1C\xFF\x23\x21\x1C\xFF\x21\x20\x1A" + "\xFF\x22\x20\x1B\xFF\x20\x20\x1B\xFF" + "\x22\x22\x1C\xFF\x23\x20\x1B\xFF\x25\x22\x1D\xFF\x23\x22\x1C\xFF\x22\x22\x1C\xFF\x21\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x23\x20\x1B\xFF" + "\x22\x20\x1B\xFF\x24\x22\x1D\xFF\x23\x22\x1D\xFF\x20\x20\x1A\xFF\x25\x21\x1C\xFF\x24\x23\x1D" + "\xFF\x20\x21\x1B\xFF\x22\x22\x1C\xFF" + "\x22\x21\x1C\xFF\x1F\x1F\x19\xFF\x20\x1F\x1A\xFF\x1F\x20\x1A\xFF\x23\x20\x1C\xFF\x22\x21\x1C" + "\xFF\x23\x22\x1C\xFF\x23\x21\x1C\xFF" + "\x1F\x1F\x1B\xFF\x21\x22\x1D\xFF\x20\x1F\x1B\xFF\x21\x21\x1B\xFF\x21\x1E\x1A\xFF\x22\x20\x1C" + "\xFF\x23\x21\x1C\xFF\x21\x20\x1B\xFF" + "\x23\x22\x1D\xFF\x25\x21\x1D\xFF\x21\x20\x1B\xFF\x20\x1F\x1B\xFF\x22\x20\x1B\xFF\x25\x23\x1D" + "\xFF\x24\x23\x1E\xFF\x24\x23\x1C\xFF" + "\x14\x13\x10\xFF\x12\x11\x0E\xFF\x12\x12\x0E\xFF\x12\x11\x0E\xFF\x10\x10\x0D\xFF\x10\x10\x0C" + "\xFF\x10\x0F\x0B\xFF\x14\x13\x10\xFF" + "\x11\x0F\x0E\xFF\x12\x11\x0E\xFF\x14\x12\x10\xFF\x13\x11\x10\xFF\x14\x13\x0F\xFF\x11\x10\x0E" + "\xFF\x12\x11\x0F\xFF\x10\x0F\x0E\xFF" + "\x15\x14\x0F\xFF\x12\x11\x0D\xFF\x13\x11\x0E\xFF\x16\x15\x11\xFF\x15\x15\x11\xFF\x16\x15\x11" + "\xFF\x13\x12\x10\xFF\x13\x11\x0F\xFF" + "\x0F\x0F\x0D\xFF\x0F\x0E\x0C\xFF\x10\x0E\x0C\xFF\x14\x11\x10\xFF\x14\x13\x0E\xFF\x13\x12\x0E" + "\xFF\x14\x12\x11\xFF\x12\x10\x0E\xFF" + "\x0F\x0E\x0D\xFF\x13\x11\x10\xFF\x13\x12\x0F\xFF\x14\x12\x0F\xFF\x12\x11\x0D\xFF\x14\x12\x0F" + "\xFF\x15\x14\x10\xFF\x13\x11\x10\xFF" + "\x14\x12\x0E\xFF\x13\x12\x0F\xFF\x14\x13\x0F\xFF\x14\x13\x0E\xFF\x13\x11\x0F\xFF\x14\x13\x10" + "\xFF\x16\x14\x10\xFF\x15\x14\x10\xFF" + "\x13\x11\x0F\xFF\x12\x11\x0D\xFF\x13\x12\x0F\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x14\x13\x10" + "\xFF\x15\x13\x10\xFF\x13\x11\x0F\xFF" + "\x12\x12\x0E\xFF\x10\x0F\x0D\xFF\x14\x13\x0F\xFF\x15\x13\x11\xFF\x13\x12\x0F\xFF\x15\x13\x10" + "\xFF\x16\x15\x11\xFF\x15\x13\x10\xFF" + "\x15\x14\x10\xFF\x14\x13\x0F\xFF\x15\x14\x10\xFF\x15\x14\x10\xFF\x14\x13\x0F\xFF\x13\x12\x0E" + "\xFF\x14\x13\x0F\xFF\x15\x14\x10\xFF" + "\x16\x15\x11\xFF\x14\x13\x0F\xFF\x15\x14\x10\xFF\x14\x13\x0F\xFF\x14\x13\x0F\xFF\x16\x15\x10" + "\xFF\x15\x14\x11\xFF\x15\x14\x10\xFF" + "\x11\x10\x0F\xFF\x14\x12\x0F\xFF\x13\x11\x0F\xFF\x13\x11\x0F\xFF\x15\x13\x10\xFF\x15\x14\x10" + "\xFF\x15\x14\x11\xFF\x16\x15\x11\xFF" + "\x15\x14\x11\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x16\x14\x10\xFF\x16\x15\x13\xFF\x16\x15\x11" + "\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF" + "\x12\x10\x0E\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x15\x14\x11\xFF\x15\x14\x10\xFF\x18\x17\x13" + "\xFF\x17\x16\x12\xFF\x15\x13\x10\xFF" + "\x17\x16\x13\xFF\x13\x11\x10\xFF\x16\x14\x11\xFF\x15\x14\x10\xFF\x13\x11\x10\xFF\x14\x13\x0F" + "\xFF\x15\x14\x10\xFF\x15\x14\x10\xFF" + "\x16\x15\x11\xFF\x16\x15\x10\xFF\x16\x15\x10\xFF\x15\x13\x11\xFF\x16\x15\x11\xFF\x17\x15\x12" + "\xFF\x15\x14\x11\xFF\x12\x12\x0E\xFF" + "\x15\x14\x10\xFF\x16\x15\x11\xFF\x1A\x19\x15\xFF\x19\x18\x14\xFF\x14\x13\x0F\xFF\x15\x14\x10" + "\xFF\x18\x17\x13\xFF\x15\x14\x11\xFF" + "\x17\x15\x11\xFF\x17\x16\x12\xFF\x18\x16\x12\xFF\x18\x16\x12\xFF\x14\x13\x10\xFF\x18\x17\x13" + "\xFF\x17\x16\x12\xFF\x1A\x19\x15\xFF" + "\x19\x18\x14\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF\x16\x15\x11\xFF\x16\x15\x12\xFF\x17\x16\x13" + "\xFF\x18\x17\x13\xFF\x17\x15\x11\xFF" + "\x18\x16\x12\xFF\x16\x15\x12\xFF\x16\x14\x12\xFF\x18\x16\x13\xFF\x15\x14\x10\xFF\x17\x15\x11" + "\xFF\x17\x15\x11\xFF\x14\x13\x0F\xFF" + "\x16\x15\x11\xFF\x16\x15\x11\xFF\x16\x15\x12\xFF\x1B\x1A\x16\xFF\x16\x15\x11\xFF\x19\x18\x14" + "\xFF\x19\x18\x14\xFF\x1C\x1C\x17\xFF" + "\x17\x16\x12\xFF\x18\x17\x12\xFF\x18\x17\x13\xFF\x17\x15\x13\xFF\x16\x15\x12\xFF\x1A\x19\x14" + "\xFF\x1A\x19\x15\xFF\x1A\x19\x15\xFF" + "\x19\x18\x15\xFF\x19\x17\x13\xFF\x19\x17\x13\xFF\x15\x14\x11\xFF\x15\x14\x10\xFF\x17\x16\x12" + "\xFF\x19\x18\x14\xFF\x18\x17\x13\xFF" + "\x18\x17\x13\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x18\x17\x14\xFF\x1B\x1A\x16\xFF\x18\x17\x13" + "\xFF\x18\x17\x13\xFF\x1B\x1A\x15\xFF" + "\x17\x16\x12\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x1E\x1E\x19\xFF\x1D\x1D\x18" + "\xFF\x1A\x19\x16\xFF\x19\x18\x14\xFF"; /** * Experimental Case 02: 64x64 (32bpp) */ static const BYTE TEST_RLE_BITMAP_EXPERIMENTAL_02[16384] = - "\x1C\x1C\x17\xFF\x1D\x1B\x18\xFF\x1B\x19\x15\xFF\x19\x18\x13\xFF\x19\x18\x14\xFF\x17\x16\x12\xFF\x17\x17\x13\xFF\x19\x17\x14\xFF" - "\x15\x14\x11\xFF\x13\x13\x10\xFF\x4F\x4B\x3E\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x22\x21\x1C\xFF\x22\x21\x1B\xFF\x21\x21\x1A\xFF" - "\x22\x21\x1B\xFF\x21\x20\x1A\xFF\x21\x20\x1A\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x22\x20\x1A\xFF\x21\x20\x1A\xFF" - "\x21\x20\x1B\xFF\x24\x23\x1E\xFF\x21\x20\x1B\xFF\x22\x22\x1C\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x29\x28\x23\xFF" - "\x26\x25\x21\xFF\x21\x20\x1B\xFF\x29\x28\x22\xFF\x21\x20\x1A\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x24\x22\x1D\xFF\x26\x25\x20\xFF" - "\x23\x23\x1D\xFF\x2A\x29\x23\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x23\x22\x1D\xFF\x24\x23\x1E\xFF\x21\x20\x1B\xFF" - "\x26\x25\x20\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x25\x24\x20\xFF" - "\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1D\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x28\x26\x21\xFF\x24\x22\x1D\xFF" - "\x23\x22\x1E\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" - "\x24\x23\x1E\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x21\x20\x1A\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x21\x20\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x2A\x29\x24\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x22\x1D\xFF\x26\x25\x20\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x26\x25\x20\xFF\x21\x20\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x25\x20\xFF\x28\x26\x21\xFF\x25\x24\x20\xFF" - "\x24\x23\x1D\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x29\x28\x23\xFF\x29\x28\x22\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x23\x1E\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x20\x1B\xFF\x22\x21\x1B\xFF" - "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x21\x20\x1B\xFF\x29\x29\x23\xFF\x21\x20\x1A\xFF\x25\x24\x20\xFF\x26\x24\x20\xFF\x21\x21\x1B\xFF" - "\x21\x20\x1B\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x25\x20\xFF" - "\x29\x28\x22\xFF\x23\x23\x1E\xFF\x23\x22\x1C\xFF\x22\x22\x1C\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF" - "\x25\x25\x20\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x29\x28\x22\xFF\x23\x22\x1C\xFF\x23\x22\x1E\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x28\x26\x21\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF" - "\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x22\x1D\xFF\x24\x23\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x25\x24\x1F\xFF\x25\x24\x20\xFF\x28\x26\x21\xFF\x25\x24\x20\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x25\x24\x20\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF" - "\x28\x26\x21\xFF\x23\x22\x1C\xFF\x25\x23\x1F\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x29\x28\x23\xFF" - "\x27\x25\x21\xFF\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x26\x25\x20\xFF" - "\x24\x23\x1E\xFF\x2A\x29\x23\xFF\x25\x23\x1E\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x23\x23\x1E\xFF\x24\x24\x1E\xFF\x22\x21\x1B\xFF" - "\x26\x25\x20\xFF\x26\x24\x20\xFF\x23\x22\x1C\xFF\x26\x25\x20\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x26\x25\x21\xFF" - "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1E\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x28\x26\x21\xFF\x24\x23\x1E\xFF" - "\x23\x23\x1E\xFF\x27\x25\x20\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" - "\x25\x24\x1F\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x2A\x29\x24\xFF\x22\x21\x1B\xFF" - "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1E\xFF\x27\x25\x20\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x27\x25\x20\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x25\x20\xFF\x28\x26\x21\xFF\x25\x24\x20\xFF" - "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x29\x28\x23\xFF\x29\x28\x22\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x23\x1E\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x2A\x29\x23\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF\x26\x25\x21\xFF\x22\x23\x1C\xFF" - "\x23\x23\x1C\xFF\x24\x25\x1E\xFF\x27\x2B\x25\xFF\x2B\x2F\x27\xFF\x25\x2C\x23\xFF\x26\x2E\x24\xFF\x26\x2F\x25\xFF\x2A\x35\x2B\xFF" - "\x2E\x39\x2E\xFF\x28\x34\x2A\xFF\x28\x33\x28\xFF\x28\x33\x28\xFF\x2A\x35\x2C\xFF\x27\x32\x27\xFF\x2A\x35\x2C\xFF\x27\x32\x27\xFF" - "\x2A\x36\x2C\xFF\x2B\x36\x2D\xFF\x27\x32\x27\xFF\x28\x33\x28\xFF\x27\x32\x27\xFF\x28\x33\x28\xFF\x28\x33\x28\xFF\x27\x32\x27\xFF" - "\x27\x32\x27\xFF\x27\x32\x27\xFF\x2A\x35\x2C\xFF\x2E\x39\x2E\xFF\x28\x33\x28\xFF\x28\x33\x2A\xFF\x28\x33\x28\xFF\x27\x32\x27\xFF" - "\x27\x32\x27\xFF\x28\x33\x28\xFF\x2D\x37\x2D\xFF\x27\x32\x27\xFF\x2A\x35\x2B\xFF\x54\x51\x43\xFF\x37\x82\x60\xFF\x36\x7A\x5A\xFF" - "\x34\x71\x54\xFF\x32\x68\x4D\xFF\x30\x5D\x46\xFF\x2D\x53\x3F\xFF\x2B\x45\x35\xFF\x26\x35\x29\xFF\x25\x2D\x23\xFF\x26\x2C\x25\xFF" - "\x27\x2A\x23\xFF\x23\x25\x1F\xFF\x23\x23\x1E\xFF\x24\x23\x1D\xFF\x25\x23\x1D\xFF\x25\x23\x1E\xFF\x25\x23\x1D\xFF\x25\x24\x1F\xFF" - "\x28\x2B\x23\xFF\x37\x60\x4A\xFF\x4A\xA2\x78\xFF\x47\x97\x71\xFF\x41\x84\x64\xFF\x3D\x75\x58\xFF\x38\x62\x4B\xFF\x33\x50\x3E\xFF" - "\x2E\x3C\x30\xFF\x2A\x34\x29\xFF\x28\x30\x26\xFF\x27\x2C\x24\xFF\x26\x29\x22\xFF\x27\x28\x21\xFF\x27\x26\x20\xFF\x27\x25\x20\xFF" - "\x25\x25\x20\xFF\x24\x23\x1D\xFF\x26\x23\x1E\xFF\x28\x25\x20\xFF\x26\x24\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF" - "\x26\x25\x1F\xFF\x28\x25\x20\xFF\x28\x26\x21\xFF\x2A\x27\x22\xFF\x26\x25\x1E\xFF\x27\x24\x1F\xFF\x27\x25\x1F\xFF\x28\x25\x1F\xFF" - "\x27\x27\x1F\xFF\x27\x24\x1F\xFF\x25\x24\x1F\xFF\x26\x24\x1F\xFF\x24\x24\x1E\xFF\x25\x24\x1D\xFF\x27\x25\x1F\xFF\x28\x25\x20\xFF" - "\x27\x24\x1F\xFF\x28\x25\x1F\xFF\x27\x26\x1F\xFF\x27\x25\x1E\xFF\x25\x23\x1E\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x25\x20\xFF" - "\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1E\xFF\x25\x22\x1D\xFF\x26\x23\x1E\xFF\x23\x21\x1C\xFF" - "\x26\x24\x1F\xFF\x28\x25\x20\xFF\x28\x26\x1F\xFF\x28\x25\x1F\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF" - "\x26\x24\x1F\xFF\x25\x25\x1E\xFF\x27\x25\x1F\xFF\x28\x24\x1F\xFF\x29\x27\x1F\xFF\x25\x24\x1E\xFF\x24\x24\x1E\xFF\x25\x24\x1E\xFF" - "\x25\x23\x1E\xFF\x25\x24\x1E\xFF\x25\x24\x1E\xFF\x27\x24\x1F\xFF\x2A\x27\x22\xFF\x2B\x28\x22\xFF\x2B\x28\x21\xFF\x25\x24\x1E\xFF" - "\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x27\x23\x1E\xFF\x28\x25\x20\xFF\x25\x22\x1E\xFF\x25\x23\x1E\xFF\x23\x22\x1C\xFF\x25\x25\x1E\xFF" - "\x26\x26\x20\xFF\x26\x24\x1E\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x26\x25\x1F\xFF\x26\x25\x1F\xFF\x27\x25\x1E\xFF\x25\x23\x1C\xFF" - "\x25\x23\x1E\xFF\x25\x24\x1E\xFF\x24\x23\x1E\xFF\x24\x21\x1C\xFF\x25\x22\x1D\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF" - "\x25\x22\x1E\xFF\x25\x22\x1E\xFF\x25\x22\x1D\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x26\x20\xFF\x26\x26\x1F\xFF\x27\x25\x1F\xFF" - "\x27\x26\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1E\xFF\x23\x22\x1C\xFF\x25\x23\x1D\xFF\x25\x22\x1E\xFF\x26\x24\x1E\xFF\x24\x23\x1E\xFF" - "\x26\x24\x1F\xFF\x27\x26\x20\xFF\x29\x27\x21\xFF\x2A\x26\x21\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x26\x24\x1F\xFF\x28\x29\x23\xFF" - "\x2F\x46\x36\xFF\x4B\xA5\x7B\xFF\x57\xCD\x97\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x4D\xAC\x7F\xFF\x32\x50\x3D\xFF\x26\x29\x22\xFF" - "\x23\x21\x1C\xFF\x26\x23\x1E\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF\x26\x24\x1F\xFF\x25\x24\x1E\xFF\x25\x24\x1F\xFF" - "\x22\x21\x1C\xFF\x24\x23\x1D\xFF\x24\x24\x1D\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF\x26\x24\x1F\xFF\x25\x27\x21\xFF\x2B\x36\x2B\xFF" - "\x4B\xA7\x7D\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x50\xB9\x89\xFF\x32\x54\x40\xFF\x27\x2A\x23\xFF\x23\x22\x1C\xFF\x25\x24\x1F\xFF\x25\x22\x1D\xFF\x25\x23\x1D\xFF\x25\x22\x1D\xFF" - "\x24\x23\x1D\xFF\x25\x23\x1E\xFF\x24\x22\x1D\xFF\x25\x22\x1D\xFF\x23\x22\x1C\xFF\x24\x23\x1D\xFF\x27\x25\x1F\xFF\x28\x25\x1F\xFF" - "\x25\x23\x1E\xFF\x23\x22\x1D\xFF\x24\x22\x1C\xFF\x24\x23\x1D\xFF\x24\x22\x1D\xFF\x24\x21\x1C\xFF\x25\x24\x1E\xFF\x23\x22\x1C\xFF" - "\x24\x21\x1C\xFF\x25\x23\x1E\xFF\x27\x25\x1F\xFF\x25\x25\x1F\xFF\x24\x22\x1D\xFF\x24\x21\x1C\xFF\x25\x23\x1E\xFF\x22\x21\x1C\xFF" - "\x26\x23\x1F\xFF\x24\x21\x1D\xFF\x24\x22\x1D\xFF\x23\x22\x1C\xFF\x23\x21\x1C\xFF\x24\x21\x1C\xFF\x26\x23\x1E\xFF\x23\x22\x1D\xFF" - "\x22\x21\x1C\xFF\x26\x25\x1F\xFF\x26\x23\x1E\xFF\x25\x23\x1E\xFF\x23\x23\x1D\xFF\x25\x24\x1E\xFF\x26\x25\x1E\xFF\x26\x23\x1E\xFF" - "\x24\x22\x1D\xFF\x24\x22\x1E\xFF\x24\x22\x1D\xFF\x25\x22\x1D\xFF\x23\x22\x1D\xFF\x24\x22\x1D\xFF\x26\x23\x1E\xFF\x26\x24\x1F\xFF" - "\x24\x21\x1D\xFF\x23\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x23\x1E\xFF\x24\x22\x1D\xFF\x21\x1F\x1B\xFF\x22\x20\x1B\xFF\x22\x21\x1B\xFF" - "\x25\x24\x1E\xFF\x24\x24\x1D\xFF\x24\x23\x1D\xFF\x25\x23\x1E\xFF\x23\x22\x1D\xFF\x23\x22\x1D\xFF\x23\x21\x1C\xFF\x22\x21\x1C\xFF" - "\x20\x20\x1B\xFF\x25\x25\x1E\xFF\x24\x22\x1D\xFF\x24\x22\x1D\xFF\x26\x23\x1E\xFF\x23\x22\x1D\xFF\x24\x22\x1D\xFF\x25\x22\x1D\xFF" - "\x24\x22\x1D\xFF\x24\x22\x1D\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x24\x23\x1D\xFF\x25\x24\x1E\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF" - "\x25\x23\x1E\xFF\x25\x23\x1E\xFF\x22\x22\x1C\xFF\x22\x20\x1B\xFF\x20\x20\x1A\xFF\x22\x20\x1B\xFF\x21\x20\x1B\xFF\x23\x22\x1C\xFF" - "\x23\x22\x1D\xFF\x22\x21\x1C\xFF\x20\x1F\x1A\xFF\x20\x1F\x1A\xFF\x24\x21\x1C\xFF\x25\x24\x1E\xFF\x25\x23\x1E\xFF\x24\x22\x1D\xFF" - "\x26\x23\x1E\xFF\x24\x22\x1D\xFF\x23\x20\x1B\xFF\x24\x22\x1C\xFF\x25\x23\x1D\xFF\x23\x22\x1D\xFF\x20\x20\x1A\xFF\x20\x1F\x19\xFF" - "\x1F\x1F\x1A\xFF\x23\x23\x1D\xFF\x23\x21\x1C\xFF\x22\x1F\x1B\xFF\x21\x21\x1A\xFF\x22\x22\x1C\xFF\x23\x22\x1D\xFF\x21\x21\x1B\xFF" - "\x21\x21\x1B\xFF\x23\x21\x1C\xFF\x23\x20\x1B\xFF\x20\x20\x1A\xFF\x21\x1F\x1B\xFF\x24\x21\x1C\xFF\x25\x22\x1D\xFF\x22\x22\x1C\xFF" - "\x23\x21\x1C\xFF\x24\x22\x1D\xFF\x23\x21\x1C\xFF\x21\x1E\x19\xFF\x21\x1F\x1B\xFF\x22\x20\x1B\xFF\x23\x21\x1C\xFF\x22\x20\x1B\xFF" - "\x22\x21\x1C\xFF\x20\x20\x1C\xFF\x1F\x1E\x1A\xFF\x22\x21\x1C\xFF\x22\x21\x1C\xFF\x21\x21\x1B\xFF\x21\x21\x1B\xFF\x24\x22\x1F\xFF" - "\x12\x11\x0F\xFF\x11\x10\x0C\xFF\x11\x10\x0D\xFF\x13\x12\x0F\xFF\x12\x11\x0D\xFF\x12\x11\x0E\xFF\x12\x11\x0F\xFF\x16\x15\x11\xFF" - "\x17\x15\x12\xFF\x12\x10\x0E\xFF\x14\x13\x0F\xFF\x14\x13\x10\xFF\x11\x11\x0D\xFF\x10\x10\x0D\xFF\x13\x13\x0F\xFF\x13\x11\x0F\xFF" - "\x13\x12\x0F\xFF\x15\x13\x11\xFF\x13\x12\x0F\xFF\x10\x0E\x0E\xFF\x11\x0F\x0E\xFF\x13\x11\x10\xFF\x13\x11\x10\xFF\x13\x12\x0F\xFF" - "\x15\x13\x12\xFF\x12\x11\x0E\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x14\x12\x0F\xFF\x15\x13\x11\xFF\x17\x16\x12\xFF\x14\x13\x0F\xFF" - "\x14\x13\x11\xFF\x13\x13\x10\xFF\x14\x13\x10\xFF\x16\x16\x12\xFF\x0F\x0F\x0D\xFF\x11\x10\x0D\xFF\x11\x10\x0D\xFF\x12\x10\x0D\xFF" - "\x12\x10\x0E\xFF\x14\x12\x0F\xFF\x15\x13\x11\xFF\x13\x12\x0E\xFF\x14\x13\x0F\xFF\x17\x15\x12\xFF\x15\x14\x12\xFF\x16\x15\x11\xFF" - "\x15\x14\x10\xFF\x18\x17\x13\xFF\x16\x16\x11\xFF\x15\x14\x10\xFF\x15\x14\x10\xFF\x15\x14\x11\xFF\x14\x12\x11\xFF\x13\x12\x10\xFF" - "\x15\x13\x12\xFF\x18\x17\x13\xFF\x16\x15\x11\xFF\x11\x10\x0D\xFF\x14\x13\x10\xFF\x17\x16\x12\xFF\x14\x13\x0F\xFF\x14\x12\x10\xFF" - "\x16\x15\x11\xFF\x19\x17\x13\xFF\x16\x15\x11\xFF\x14\x12\x10\xFF\x14\x12\x10\xFF\x14\x13\x10\xFF\x15\x13\x10\xFF\x13\x11\x10\xFF" - "\x13\x12\x0F\xFF\x13\x11\x0F\xFF\x12\x10\x0F\xFF\x16\x14\x11\xFF\x12\x11\x0F\xFF\x14\x13\x10\xFF\x17\x17\x12\xFF\x18\x18\x12\xFF" - "\x18\x17\x13\xFF\x15\x14\x11\xFF\x16\x15\x11\xFF\x16\x14\x12\xFF\x15\x13\x10\xFF\x15\x13\x11\xFF\x1A\x19\x15\xFF\x19\x18\x14\xFF" - "\x16\x14\x11\xFF\x14\x13\x10\xFF\x14\x13\x0F\xFF\x13\x12\x0E\xFF\x15\x13\x11\xFF\x14\x13\x10\xFF\x15\x14\x10\xFF\x14\x13\x0F\xFF" - "\x15\x14\x10\xFF\x15\x14\x11\xFF\x16\x15\x11\xFF\x16\x14\x12\xFF\x16\x16\x10\xFF\x16\x15\x11\xFF\x15\x14\x11\xFF\x14\x13\x10\xFF" - "\x15\x14\x10\xFF\x16\x14\x11\xFF\x14\x13\x10\xFF\x14\x13\x10\xFF\x17\x16\x12\xFF\x17\x15\x14\xFF\x13\x12\x0F\xFF\x17\x15\x12\xFF" - "\x1A\x18\x14\xFF\x18\x16\x13\xFF\x18\x16\x13\xFF\x18\x16\x12\xFF\x15\x14\x10\xFF\x12\x11\x0E\xFF\x15\x13\x12\xFF\x17\x16\x13\xFF" - "\x15\x14\x12\xFF\x18\x17\x13\xFF\x18\x16\x14\xFF\x12\x11\x10\xFF\x15\x14\x10\xFF\x18\x16\x13\xFF\x17\x15\x12\xFF\x19\x18\x15\xFF" - "\x17\x16\x12\xFF\x17\x16\x12\xFF\x19\x17\x14\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x17\x15\x11\xFF" - "\x16\x15\x11\xFF\x15\x14\x10\xFF\x15\x14\x10\xFF\x18\x16\x12\xFF\x16\x15\x11\xFF\x16\x15\x12\xFF\x19\x18\x14\xFF\x18\x17\x13\xFF" - "\x18\x16\x13\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x14\x13\x0F\xFF\x17\x16\x13\xFF\x18\x17\x13\xFF\x18\x16\x14\xFF\x18\x17\x14\xFF" - "\x16\x15\x11\xFF\x1C\x1A\x16\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF\x1A\x18\x14\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF" - "\x16\x15\x11\xFF\x15\x14\x10\xFF\x17\x16\x12\xFF\x1A\x19\x15\xFF\x19\x18\x14\xFF\x16\x15\x11\xFF\x16\x14\x11\xFF\x16\x15\x11\xFF" - "\x1A\x19\x15\xFF\x15\x14\x11\xFF\x19\x17\x13\xFF\x1E\x1E\x19\xFF\x19\x18\x14\xFF\x1B\x19\x15\xFF\x1C\x1A\x16\xFF\x17\x16\x13\xFF" - "\x16\x14\x12\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF\x19\x18\x14\xFF\x1A\x19\x15\xFF\x1A\x19\x15\xFF\x1A\x19\x15\xFF\x14\x13\x0F\xFF" - "\x16\x15\x11\xFF\x1A\x18\x14\xFF\x18\x16\x12\xFF\x13\x12\x0E\xFF\x16\x16\x12\xFF\x19\x18\x14\xFF\x19\x18\x14\xFF\x1A\x19\x15\xFF" - "\x1C\x1A\x16\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF\x18\x15\x11\xFF\x19\x18\x14\xFF\x1A\x19\x15\xFF\x1B\x1A\x15\xFF\x22\x22\x1D\xFF" - "\x1F\x1D\x18\xFF\x1B\x18\x14\xFF\x1C\x1B\x16\xFF\x19\x18\x14\xFF\x1B\x1A\x16\xFF\x1B\x1A\x16\xFF\x1B\x1A\x15\xFF\x1A\x19\x15\xFF" - "\x1A\x18\x14\xFF\x1C\x1B\x16\xFF\x1C\x1A\x16\xFF\x1C\x19\x15\xFF\x1B\x19\x15\xFF\x19\x18\x14\xFF\x1E\x1C\x18\xFF\x1D\x1A\x16\xFF" - "\x17\x16\x11\xFF\x19\x18\x14\xFF\x18\x17\x13\xFF\x1C\x1B\x17\xFF\x1D\x1C\x17\xFF\x1A\x18\x14\xFF\x19\x17\x14\xFF\x19\x19\x15\xFF" - "\x1B\x1A\x16\xFF\x1C\x1B\x17\xFF\x1E\x1D\x18\xFF\x1C\x1A\x16\xFF\x1A\x18\x14\xFF\x1B\x1A\x16\xFF\x1D\x1C\x17\xFF\x1F\x1E\x19\xFF" - "\x1B\x1A\x16\xFF\x1B\x1A\x16\xFF\x1D\x1C\x17\xFF\x1D\x1B\x17\xFF\x1B\x1A\x16\xFF\x1B\x1A\x16\xFF\x1A\x19\x15\xFF\x1D\x1C\x18\xFF" - "\x1B\x19\x15\xFF\x1C\x1B\x17\xFF\x1C\x1B\x18\xFF\x1A\x1A\x16\xFF\x1E\x1C\x18\xFF\x1E\x1C\x18\xFF\x1F\x1C\x18\xFF\x1F\x1E\x19\xFF" - "\x1C\x1B\x17\xFF\x1B\x1B\x17\xFF\x1A\x19\x15\xFF\x1E\x1C\x18\xFF\x1F\x1F\x19\xFF\x1C\x1C\x17\xFF\x1C\x1A\x18\xFF\x1F\x1C\x19\xFF" - "\x1F\x1D\x18\xFF\x1D\x1C\x18\xFF\x1D\x1B\x17\xFF\x1E\x1D\x19\xFF\x20\x1D\x19\xFF\x1E\x1C\x18\xFF\x1F\x1E\x19\xFF\x1D\x1C\x18\xFF" - "\x1D\x1C\x18\xFF\x22\x21\x1C\xFF\x20\x1F\x1A\xFF\x1F\x1D\x18\xFF\x1C\x1B\x17\xFF\x20\x1F\x19\xFF\x1B\x1B\x16\xFF\x1A\x19\x15\xFF" - "\x1C\x1A\x16\xFF\x1E\x1B\x17\xFF\x1F\x1D\x18\xFF\x1F\x1E\x19\xFF\x21\x1E\x1A\xFF\x1D\x1B\x17\xFF\x1D\x1D\x18\xFF\x1E\x1E\x18\xFF" - "\x1E\x1E\x18\xFF\x1F\x1D\x19\xFF\x1E\x1C\x17\xFF\x1E\x1D\x18\xFF\x1E\x1C\x18\xFF\x1F\x1E\x19\xFF\x1D\x1C\x18\xFF\x1F\x1D\x1A\xFF" - "\x1F\x1E\x18\xFF\x1E\x1D\x18\xFF\x1F\x1E\x19\xFF\x22\x22\x1C\xFF\x1D\x1D\x18\xFF\x1D\x1C\x18\xFF\x20\x1F\x1C\xFF\x1E\x1E\x17\xFF" - "\x1D\x1C\x18\xFF\x1D\x1D\x18\xFF\x20\x21\x1B\xFF\x21\x20\x1B\xFF\x1D\x1C\x18\xFF\x1B\x19\x15\xFF\x1D\x1B\x17\xFF\x20\x1D\x1B\xFF" - "\x1F\x1E\x19\xFF\x1E\x1D\x18\xFF\x20\x1F\x1A\xFF\x1F\x1F\x19\xFF\x22\x20\x1B\xFF\x1F\x1E\x19\xFF\x1E\x1D\x19\xFF\x22\x1F\x1B\xFF" - "\x1E\x1E\x17\xFF\x1C\x1C\x16\xFF\x1B\x1C\x15\xFF\x1D\x1B\x18\xFF\x1E\x1C\x19\xFF\x20\x1E\x19\xFF\x21\x1E\x1A\xFF\x1F\x1D\x18\xFF" - "\x1A\x1A\x15\xFF\x19\x17\x14\xFF\x1B\x1A\x16\xFF\x1B\x19\x15\xFF\x1B\x19\x15\xFF\x18\x18\x14\xFF\x18\x17\x14\xFF\x18\x18\x14\xFF" - "\x19\x17\x14\xFF\x15\x16\x12\xFF\x52\x4E\x42\xFF\x22\x21\x1B\xFF\x22\x20\x1A\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x21\x20\x1B\xFF\x25\x24\x20\xFF\x26\x25\x21\xFF\x23\x22\x1D\xFF\x24\x23\x1E\xFF" - "\x21\x20\x1A\xFF\x26\x25\x20\xFF\x23\x22\x1D\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x20\x1B\xFF\x21\x20\x1A\xFF\x21\x21\x1B\xFF" - "\x26\x25\x20\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x25\x20\xFF" - "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x21\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x28\x26\x22\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x21\x20\x1B\xFF\x26\x25\x21\xFF\x21\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x23\x22\x1D\xFF" - "\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x24\x22\x1D\xFF\x24\x23\x1F\xFF\x25\x24\x20\xFF" - "\x22\x20\x1B\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x20\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x26\x25\x20\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF" - "\x28\x26\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1C\xFF\x22\x21\x1B\xFF\x21\x20\x1A\xFF\x24\x23\x1E\xFF\x29\x28\x23\xFF\x25\x24\x20\xFF" - "\x24\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x21\x1C\xFF\x23\x21\x1C\xFF" - "\x24\x23\x1E\xFF\x22\x20\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x22\x22\x1C\xFF\x26\x25\x20\xFF\x22\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x21\x21\x1B\xFF\x26\x25\x20\xFF" - "\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x22\x22\x1C\xFF\x26\x25\x21\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x21\x1C\xFF\x23\x22\x1C\xFF\x26\x25\x21\xFF\x25\x24\x20\xFF\x25\x24\x1F\xFF\x24\x22\x1D\xFF" - "\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" - "\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x25\x25\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF" - "\x23\x21\x1C\xFF\x23\x23\x1E\xFF\x23\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF" - "\x23\x21\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x25\x23\x1F\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x23\x1E\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x26\x25\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x25\x24\x1F\xFF\x26\x24\x20\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x21\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x26\x25\x21\xFF\x24\x23\x1E\xFF\x25\x24\x1F\xFF" - "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x26\x25\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x25\x20\xFF" - "\x23\x22\x1C\xFF\x27\x25\x20\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x28\x26\x22\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF" - "\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x25\x24\x1F\xFF\x26\x24\x20\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x27\x25\x20\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x27\x26\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x26\x20\xFF" - "\x28\x26\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x29\x28\x23\xFF\x25\x25\x20\xFF" - "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" - "\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x22\x22\x1C\xFF\x27\x26\x20\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF" - "\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF\x23\x22\x1C\xFF\x22\x22\x1C\xFF\x26\x25\x21\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x27\x26\x22\xFF\x26\x26\x22\xFF\x26\x27\x21\xFF\x26\x2A\x23\xFF" - "\x26\x2E\x26\xFF\x26\x2F\x25\xFF\x27\x31\x27\xFF\x27\x31\x27\xFF\x28\x33\x28\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x29\x34\x2A\xFF" - "\x27\x32\x27\xFF\x2A\x35\x2B\xFF\x2A\x36\x2C\xFF\x28\x33\x28\xFF\x27\x32\x27\xFF\x2A\x35\x2C\xFF\x27\x32\x27\xFF\x2D\x37\x2D\xFF" - "\x28\x33\x28\xFF\x28\x34\x2A\xFF\x28\x34\x2A\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x2B\x36\x2C\xFF\x27\x32\x27\xFF" - "\x28\x33\x28\xFF\x27\x32\x27\xFF\x28\x33\x28\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x2D\x37\x2D\xFF\x2A\x35\x2C\xFF\x27\x32\x27\xFF" - "\x27\x32\x27\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x28\x33\x28\xFF\x29\x34\x2A\xFF\x4F\x4D\x3F\xFF\x3A\x8B\x67\xFF\x3B\x8C\x68\xFF" - "\x3E\x93\x6D\xFF\x40\x98\x71\xFF\x42\x9A\x72\xFF\x42\x9A\x72\xFF\x42\x97\x70\xFF\x41\x93\x6D\xFF\x3E\x87\x64\xFF\x3B\x75\x56\xFF" - "\x32\x51\x3F\xFF\x29\x37\x2C\xFF\x29\x31\x28\xFF\x27\x2C\x24\xFF\x26\x29\x21\xFF\x28\x28\x22\xFF\x27\x27\x20\xFF\x27\x27\x21\xFF" - "\x29\x2F\x25\xFF\x3C\x73\x56\xFF\x55\xC9\x94\xFF\x56\xCC\x96\xFF\x56\xCB\x97\xFF\x54\xC5\x92\xFF\x52\xBD\x8C\xFF\x50\xB5\x86\xFF" - "\x4D\xAA\x7F\xFF\x48\x99\x71\xFF\x40\x80\x61\xFF\x37\x66\x4D\xFF\x2F\x48\x38\xFF\x2C\x38\x2C\xFF\x2B\x33\x29\xFF\x2A\x2E\x26\xFF" - "\x27\x29\x23\xFF\x27\x27\x21\xFF\x27\x27\x21\xFF\x27\x26\x20\xFF\x26\x25\x1F\xFF\x26\x25\x1F\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF" - "\x27\x26\x20\xFF\x28\x26\x20\xFF\x28\x25\x20\xFF\x28\x27\x20\xFF\x27\x25\x1F\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF\x28\x26\x20\xFF" - "\x25\x23\x1E\xFF\x26\x24\x1E\xFF\x25\x23\x1D\xFF\x27\x25\x1F\xFF\x26\x24\x1E\xFF\x26\x23\x1E\xFF\x29\x26\x21\xFF\x28\x25\x20\xFF" - "\x26\x25\x1F\xFF\x27\x25\x1F\xFF\x25\x25\x1F\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x26\x25\x1F\xFF\x25\x23\x1D\xFF\x27\x24\x1F\xFF" - "\x25\x24\x1F\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x27\x24\x1E\xFF\x26\x26\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" - "\x29\x26\x20\xFF\x28\x25\x20\xFF\x27\x26\x1E\xFF\x26\x24\x1E\xFF\x28\x26\x21\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" - "\x28\x25\x20\xFF\x27\x24\x1F\xFF\x27\x26\x20\xFF\x27\x25\x1F\xFF\x28\x26\x20\xFF\x26\x23\x1E\xFF\x25\x24\x1D\xFF\x26\x24\x1E\xFF" - "\x26\x24\x1F\xFF\x22\x21\x1B\xFF\x23\x23\x1D\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x26\x23\x1E\xFF\x27\x24\x1E\xFF\x27\x24\x1F\xFF" - "\x27\x25\x1E\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x26\x23\x1F\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x24\x23\x1D\xFF\x21\x21\x1C\xFF" - "\x26\x23\x1F\xFF\x26\x23\x1F\xFF\x26\x23\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x24\x1E\xFF\x26\x24\x1E\xFF\x24\x24\x1D\xFF" - "\x25\x24\x1E\xFF\x26\x24\x1F\xFF\x27\x26\x1F\xFF\x25\x22\x1D\xFF\x25\x22\x1D\xFF\x26\x24\x1E\xFF\x26\x24\x1E\xFF\x26\x24\x1F\xFF" - "\x26\x24\x1F\xFF\x24\x21\x1C\xFF\x23\x22\x1C\xFF\x23\x23\x1D\xFF\x27\x25\x20\xFF\x26\x25\x1F\xFF\x27\x26\x20\xFF\x27\x27\x1F\xFF" - "\x29\x26\x21\xFF\x26\x25\x1F\xFF\x23\x23\x1D\xFF\x24\x22\x1D\xFF\x22\x21\x1B\xFF\x23\x21\x1D\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF" - "\x25\x24\x1F\xFF\x27\x25\x21\xFF\x25\x24\x1F\xFF\x28\x25\x20\xFF\x27\x26\x1F\xFF\x26\x23\x1E\xFF\x25\x22\x1D\xFF\x26\x26\x20\xFF" - "\x2A\x37\x2D\xFF\x42\x87\x66\xFF\x56\xCD\x98\xFF\x56\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x52\xBF\x8E\xFF\x37\x66\x4D\xFF\x28\x2C\x25\xFF" - "\x26\x26\x21\xFF\x27\x24\x1F\xFF\x24\x23\x1E\xFF\x24\x22\x1D\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x25\x22\x1D\xFF" - "\x22\x22\x1C\xFF\x23\x21\x1C\xFF\x26\x23\x1E\xFF\x24\x23\x1D\xFF\x25\x22\x1C\xFF\x23\x21\x1C\xFF\x28\x27\x20\xFF\x2B\x31\x27\xFF" - "\x3E\x79\x5B\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCC\x97\xFF\x57\xCD\x97\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF" - "\x54\xC4\x91\xFF\x3E\x79\x5B\xFF\x29\x30\x28\xFF\x25\x25\x1F\xFF\x25\x24\x1E\xFF\x27\x24\x1E\xFF\x24\x23\x1D\xFF\x25\x23\x1F\xFF" - "\x25\x22\x1D\xFF\x26\x24\x1E\xFF\x24\x22\x1D\xFF\x22\x22\x1C\xFF\x22\x1F\x1A\xFF\x23\x21\x1C\xFF\x23\x21\x1C\xFF\x27\x24\x1F\xFF" - "\x27\x26\x21\xFF\x27\x24\x1F\xFF\x24\x21\x1C\xFF\x22\x21\x1C\xFF\x24\x23\x1D\xFF\x23\x20\x1B\xFF\x24\x23\x1D\xFF\x24\x23\x1E\xFF" - "\x25\x24\x1E\xFF\x26\x25\x1F\xFF\x26\x25\x1F\xFF\x28\x26\x21\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF" - "\x26\x23\x1E\xFF\x24\x21\x1C\xFF\x24\x23\x1D\xFF\x22\x22\x1C\xFF\x22\x20\x1A\xFF\x22\x21\x1B\xFF\x24\x24\x1D\xFF\x25\x23\x1E\xFF" - "\x24\x23\x1E\xFF\x25\x23\x1E\xFF\x23\x22\x1D\xFF\x21\x20\x1B\xFF\x25\x23\x1E\xFF\x24\x23\x1D\xFF\x23\x22\x1C\xFF\x25\x22\x1D\xFF" - "\x23\x21\x1C\xFF\x22\x22\x1D\xFF\x23\x22\x1D\xFF\x27\x25\x20\xFF\x23\x22\x1D\xFF\x26\x22\x1F\xFF\x23\x20\x1D\xFF\x24\x21\x1D\xFF" - "\x25\x22\x1D\xFF\x24\x23\x1E\xFF\x20\x1F\x1A\xFF\x20\x1E\x19\xFF\x23\x22\x1D\xFF\x23\x22\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" - "\x24\x22\x1D\xFF\x24\x23\x1D\xFF\x24\x23\x1D\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x25\x22\x1E\xFF\x21\x20\x1B\xFF\x21\x21\x1B\xFF" - "\x20\x20\x1A\xFF\x24\x23\x1D\xFF\x25\x24\x1E\xFF\x26\x24\x1F\xFF\x22\x1F\x1A\xFF\x24\x21\x1C\xFF\x23\x20\x1C\xFF\x20\x1F\x1A\xFF" - "\x24\x22\x1D\xFF\x23\x21\x1C\xFF\x24\x22\x1C\xFF\x24\x21\x1C\xFF\x22\x22\x1C\xFF\x22\x22\x1C\xFF\x24\x21\x1C\xFF\x23\x21\x1C\xFF" - "\x23\x22\x1C\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x25\x22\x1D\xFF\x25\x22\x1D\xFF\x24\x21\x1C\xFF\x22\x20\x1B\xFF\x21\x21\x1B\xFF" - "\x23\x21\x1C\xFF\x23\x21\x1C\xFF\x20\x1E\x19\xFF\x21\x1E\x1A\xFF\x23\x22\x1D\xFF\x26\x24\x1E\xFF\x23\x23\x1C\xFF\x23\x21\x1C\xFF" - "\x22\x20\x1C\xFF\x22\x21\x1C\xFF\x23\x20\x1C\xFF\x24\x22\x1D\xFF\x24\x22\x1C\xFF\x22\x20\x1C\xFF\x22\x20\x1B\xFF\x22\x22\x1C\xFF" - "\x22\x20\x1B\xFF\x22\x20\x1B\xFF\x25\x23\x1D\xFF\x26\x23\x1E\xFF\x21\x21\x1C\xFF\x20\x1F\x1A\xFF\x20\x1F\x1B\xFF\x1F\x1E\x1A\xFF" - "\x22\x1F\x1A\xFF\x27\x25\x1F\xFF\x23\x22\x1D\xFF\x22\x23\x1B\xFF\x25\x22\x1D\xFF\x27\x24\x1F\xFF\x24\x22\x1D\xFF\x23\x23\x1D\xFF" - "\x25\x23\x1D\xFF\x23\x22\x1C\xFF\x24\x22\x1D\xFF\x26\x23\x1C\xFF\x24\x21\x1D\xFF\x22\x20\x1B\xFF\x20\x1E\x1B\xFF\x1D\x1C\x18\xFF" - "\x20\x20\x1A\xFF\x20\x1F\x1A\xFF\x1F\x1D\x19\xFF\x20\x1F\x1A\xFF\x23\x22\x1D\xFF\x23\x22\x1D\xFF\x23\x22\x1D\xFF\x23\x22\x1C\xFF" - "\x13\x12\x0F\xFF\x13\x12\x0E\xFF\x13\x12\x0F\xFF\x12\x10\x0E\xFF\x12\x11\x0F\xFF\x13\x12\x0E\xFF\x14\x13\x0F\xFF\x13\x12\x0E\xFF" - "\x14\x12\x0F\xFF\x12\x11\x0E\xFF\x12\x10\x0E\xFF\x12\x11\x0E\xFF\x13\x11\x0E\xFF\x17\x13\x10\xFF\x13\x12\x0E\xFF\x0E\x0D\x0A\xFF" - "\x0E\x0E\x0C\xFF\x0F\x0F\x0D\xFF\x11\x10\x0D\xFF\x13\x11\x0F\xFF\x0F\x10\x0E\xFF\x11\x10\x0F\xFF\x13\x11\x10\xFF\x13\x12\x10\xFF" - "\x11\x10\x0D\xFF\x12\x11\x0E\xFF\x14\x12\x10\xFF\x14\x12\x10\xFF\x10\x0F\x0D\xFF\x13\x11\x0F\xFF\x14\x13\x10\xFF\x13\x12\x10\xFF" - "\x15\x13\x0F\xFF\x14\x12\x0F\xFF\x12\x10\x0E\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x14\x12\x10\xFF\x13\x11\x0E\xFF\x12\x11\x0F\xFF" - "\x11\x10\x0C\xFF\x14\x13\x0F\xFF\x14\x13\x0F\xFF\x14\x12\x10\xFF\x15\x14\x10\xFF\x15\x14\x10\xFF\x15\x13\x10\xFF\x14\x13\x0F\xFF" - "\x12\x11\x0E\xFF\x13\x12\x0E\xFF\x15\x13\x10\xFF\x12\x11\x0D\xFF\x17\x16\x12\xFF\x17\x16\x13\xFF\x12\x10\x0F\xFF\x14\x13\x0F\xFF" - "\x13\x13\x0F\xFF\x14\x14\x11\xFF\x14\x14\x11\xFF\x13\x12\x0E\xFF\x15\x13\x12\xFF\x14\x13\x10\xFF\x13\x12\x0F\xFF\x15\x13\x11\xFF" - "\x18\x17\x13\xFF\x14\x13\x10\xFF\x17\x16\x13\xFF\x17\x16\x12\xFF\x16\x15\x12\xFF\x14\x12\x10\xFF\x15\x15\x11\xFF\x12\x11\x0D\xFF" - "\x13\x10\x0F\xFF\x13\x12\x0F\xFF\x12\x11\x0D\xFF\x12\x13\x10\xFF\x11\x0F\x0D\xFF\x13\x12\x0E\xFF\x14\x13\x0F\xFF\x12\x11\x0E\xFF" - "\x12\x11\x0D\xFF\x13\x12\x0F\xFF\x14\x12\x0F\xFF\x11\x10\x0D\xFF\x14\x13\x10\xFF\x13\x11\x10\xFF\x11\x10\x0D\xFF\x15\x14\x10\xFF" - "\x18\x16\x14\xFF\x17\x17\x12\xFF\x14\x13\x0F\xFF\x15\x14\x11\xFF\x19\x18\x14\xFF\x16\x15\x11\xFF\x17\x16\x11\xFF\x15\x14\x10\xFF" - "\x19\x17\x15\xFF\x1B\x1B\x16\xFF\x19\x18\x13\xFF\x16\x15\x13\xFF\x14\x13\x0F\xFF\x15\x14\x10\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF" - "\x16\x14\x12\xFF\x15\x14\x10\xFF\x15\x13\x11\xFF\x14\x13\x0F\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF" - "\x17\x16\x12\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x15\x14\x10\xFF\x14\x13\x0F\xFF\x16\x15\x11\xFF" - "\x19\x17\x14\xFF\x16\x15\x12\xFF\x15\x14\x10\xFF\x15\x14\x10\xFF\x17\x16\x12\xFF\x17\x15\x13\xFF\x18\x17\x12\xFF\x1B\x1A\x16\xFF" - "\x18\x15\x11\xFF\x14\x13\x0F\xFF\x17\x15\x11\xFF\x15\x13\x10\xFF\x15\x14\x10\xFF\x17\x15\x11\xFF\x14\x13\x0F\xFF\x17\x16\x12\xFF" - "\x18\x17\x13\xFF\x16\x14\x12\xFF\x15\x14\x11\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF\x16\x15\x12\xFF\x18\x17\x14\xFF\x16\x15\x11\xFF" - "\x17\x16\x12\xFF\x19\x18\x14\xFF\x19\x18\x14\xFF\x15\x13\x11\xFF\x1B\x1A\x16\xFF\x1A\x19\x15\xFF\x1B\x1A\x16\xFF\x19\x18\x14\xFF" - "\x19\x18\x14\xFF\x1A\x19\x15\xFF\x17\x16\x12\xFF\x13\x12\x0E\xFF\x1C\x1A\x16\xFF\x1B\x19\x15\xFF\x1A\x19\x15\xFF\x16\x14\x10\xFF" - "\x14\x13\x10\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF\x19\x18\x14\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF" - "\x16\x15\x11\xFF\x16\x15\x11\xFF\x1B\x19\x15\xFF\x1B\x19\x15\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF" - "\x1A\x19\x15\xFF\x19\x18\x14\xFF\x1B\x18\x16\xFF\x1C\x19\x16\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x19\x18\x13\xFF\x19\x17\x13\xFF" - "\x1B\x18\x14\xFF\x19\x16\x14\xFF\x16\x15\x11\xFF\x17\x16\x13\xFF\x19\x17\x13\xFF\x19\x18\x13\xFF\x18\x17\x13\xFF\x17\x15\x11\xFF" - "\x16\x15\x12\xFF\x16\x16\x12\xFF\x18\x18\x13\xFF\x1B\x1A\x16\xFF\x1D\x1C\x17\xFF\x1A\x17\x13\xFF\x1B\x19\x15\xFF\x1A\x18\x14\xFF" - "\x1A\x19\x15\xFF\x19\x18\x14\xFF\x19\x18\x14\xFF\x1A\x19\x15\xFF\x19\x18\x14\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF\x19\x17\x13\xFF" - "\x19\x18\x14\xFF\x1D\x1B\x17\xFF\x1C\x1B\x17\xFF\x1C\x1A\x16\xFF\x17\x16\x14\xFF\x1B\x1A\x16\xFF\x1A\x19\x15\xFF\x1D\x1B\x17\xFF" - "\x1C\x1B\x17\xFF\x1C\x1A\x16\xFF\x1C\x1A\x16\xFF\x1C\x1A\x16\xFF\x1A\x19\x15\xFF\x19\x18\x14\xFF\x17\x16\x12\xFF\x1A\x19\x15\xFF" - "\x1D\x1C\x17\xFF\x1B\x1A\x16\xFF\x1D\x1C\x18\xFF\x19\x18\x14\xFF\x19\x18\x14\xFF\x1A\x18\x14\xFF\x1C\x1B\x17\xFF\x1A\x19\x15\xFF" - "\x1A\x1A\x16\xFF\x1C\x1B\x16\xFF\x1D\x1C\x18\xFF\x1B\x1A\x17\xFF\x1F\x1F\x19\xFF\x1C\x1C\x17\xFF\x1D\x1B\x17\xFF\x1A\x19\x15\xFF" - "\x18\x19\x14\xFF\x1B\x19\x16\xFF\x1A\x19\x15\xFF\x1A\x1A\x16\xFF\x1C\x1B\x17\xFF\x1C\x1C\x17\xFF\x1D\x1C\x16\xFF\x1E\x1D\x18\xFF" - "\x20\x1E\x19\xFF\x1E\x1B\x17\xFF\x1B\x19\x14\xFF\x1D\x1B\x17\xFF\x1F\x1E\x1A\xFF\x1B\x1A\x16\xFF\x1D\x1C\x17\xFF\x1D\x1D\x17\xFF" - "\x1B\x1A\x16\xFF\x1C\x1B\x16\xFF\x1B\x1A\x15\xFF\x1F\x1F\x1A\xFF\x20\x1D\x19\xFF\x1E\x1C\x18\xFF\x1E\x1C\x17\xFF\x1B\x1A\x16\xFF" - "\x1C\x1B\x17\xFF\x1C\x1C\x17\xFF\x1E\x1F\x19\xFF\x1F\x1D\x18\xFF\x1D\x1B\x19\xFF\x1D\x1C\x17\xFF\x1D\x1C\x17\xFF\x1D\x1B\x17\xFF" - "\x1B\x1A\x17\xFF\x1D\x1D\x18\xFF\x1D\x1C\x17\xFF\x1E\x1D\x18\xFF\x1C\x1C\x17\xFF\x1E\x1C\x18\xFF\x20\x1E\x1A\xFF\x1F\x1E\x19\xFF" - "\x1F\x1E\x19\xFF\x1D\x1C\x18\xFF\x1E\x1C\x18\xFF\x1F\x1D\x19\xFF\x1A\x19\x15\xFF\x1C\x1B\x16\xFF\x1E\x1D\x19\xFF\x22\x21\x1B\xFF" - "\x20\x1F\x19\xFF\x1E\x1E\x18\xFF\x1E\x1E\x18\xFF\x1E\x1E\x18\xFF\x20\x20\x1A\xFF\x1C\x1A\x16\xFF\x1D\x1B\x17\xFF\x1F\x1E\x19\xFF" - "\x20\x1F\x1A\xFF\x1F\x1C\x18\xFF\x20\x1E\x19\xFF\x21\x21\x1B\xFF\x1F\x1E\x19\xFF\x1D\x1D\x18\xFF\x1C\x1B\x16\xFF\x1E\x1D\x18\xFF" - "\x1D\x1C\x18\xFF\x20\x20\x1A\xFF\x1E\x1D\x18\xFF\x1E\x1E\x19\xFF\x22\x20\x1C\xFF\x22\x1F\x1A\xFF\x1E\x1C\x17\xFF\x20\x1D\x18\xFF" - "\x20\x1E\x1A\xFF\x1F\x1D\x19\xFF\x1F\x1E\x19\xFF\x20\x1F\x1B\xFF\x1F\x1E\x18\xFF\x1F\x1C\x17\xFF\x1A\x19\x15\xFF\x1C\x1B\x16\xFF" - "\x1D\x1B\x18\xFF\x1C\x1B\x18\xFF\x1C\x1A\x16\xFF\x1A\x18\x15\xFF\x1C\x19\x15\xFF\x1B\x1B\x17\xFF\x1A\x19\x15\xFF\x16\x16\x13\xFF" - "\x18\x15\x12\xFF\x14\x13\x10\xFF\x4F\x4B\x3F\xFF\x23\x22\x1D\xFF\x26\x25\x21\xFF\x21\x21\x1B\xFF\x26\x25\x20\xFF\x22\x20\x1A\xFF" - "\x22\x21\x1B\xFF\x21\x20\x1A\xFF\x28\x26\x21\xFF\x21\x20\x1A\xFF\x23\x22\x1D\xFF\x26\x25\x20\xFF\x24\x23\x1E\xFF\x25\x24\x20\xFF" - "\x29\x28\x22\xFF\x25\x24\x20\xFF\x22\x20\x1B\xFF\x23\x22\x1C\xFF\x21\x20\x1B\xFF\x21\x20\x1B\xFF\x21\x20\x1B\xFF\x21\x20\x1B\xFF" - "\x22\x21\x1B\xFF\x29\x28\x22\xFF\x21\x20\x1B\xFF\x21\x21\x1B\xFF\x21\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x2A\x29\x23\xFF" - "\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x28\x26\x22\xFF\x21\x20\x1A\xFF\x21\x20\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x25\x24\x20\xFF\x26\x25\x20\xFF\x25\x25\x20\xFF\x21\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x28\x26\x21\xFF" - "\x28\x26\x21\xFF\x25\x25\x20\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x25\x23\x1E\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF" - "\x26\x25\x20\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1C\xFF\x22\x21\x1B\xFF" - "\x28\x26\x21\xFF\x21\x21\x1B\xFF\x25\x24\x20\xFF\x24\x23\x1E\xFF\x27\x25\x21\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF" - "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" - "\x26\x25\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x24\x22\x1D\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1C\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x29\x28\x23\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x25\x24\x20\xFF" - "\x23\x22\x1C\xFF\x25\x24\x20\xFF\x24\x23\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x20\x1B\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" - "\x26\x25\x21\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x25\x24\x20\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x24\x23\x1E\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x24\x24\x1E\xFF\x26\x25\x20\xFF\x24\x23\x1E\xFF" - "\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x25\x23\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" - "\x26\x25\x20\xFF\x25\x24\x1F\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x25\x24\x1E\xFF\x29\x28\x22\xFF\x24\x23\x1E\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF" - "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF" - "\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x28\x26\x21\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1F\xFF" - "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x24\x22\x1E\xFF\x26\x25\x20\xFF\x25\x24\x1F\xFF\x26\x25\x21\xFF" - "\x29\x28\x22\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x22\x1C\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF\x2A\x29\x23\xFF" - "\x24\x22\x1D\xFF\x23\x22\x1C\xFF\x28\x26\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x25\x24\x20\xFF\x26\x25\x20\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x29\x27\x22\xFF" - "\x29\x26\x21\xFF\x26\x26\x21\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF" - "\x27\x25\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" - "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x22\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" - "\x28\x26\x21\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x24\x23\x1E\xFF\x26\x25\x21\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF" - "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" - "\x26\x25\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x25\x21\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x29\x28\x23\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x26\x25\x20\xFF" - "\x23\x22\x1C\xFF\x26\x25\x21\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" - "\x27\x26\x22\xFF\x22\x22\x1C\xFF\x29\x29\x23\xFF\x23\x26\x1F\xFF\x29\x2F\x27\xFF\x26\x2F\x25\xFF\x27\x31\x27\xFF\x27\x32\x27\xFF" - "\x2A\x35\x2C\xFF\x27\x32\x27\xFF\x2A\x35\x2C\xFF\x29\x34\x2A\xFF\x2D\x37\x2D\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x28\x33\x28\xFF" - "\x27\x32\x27\xFF\x27\x32\x27\xFF\x2A\x35\x2C\xFF\x27\x32\x27\xFF\x2A\x35\x2C\xFF\x29\x35\x2B\xFF\x2A\x35\x2C\xFF\x29\x34\x2B\xFF" - "\x29\x34\x2A\xFF\x29\x34\x2A\xFF\x29\x35\x2B\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x28\x33\x28\xFF\x27\x32\x27\xFF\x29\x35\x2B\xFF" - "\x2B\x36\x2C\xFF\x2A\x35\x2B\xFF\x2A\x35\x2C\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x29\x34\x2A\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF" - "\x2A\x35\x2B\xFF\x2E\x39\x2E\xFF\x2A\x35\x2B\xFF\x29\x34\x2A\xFF\x28\x33\x28\xFF\x4F\x4D\x3F\xFF\x3B\x8B\x67\xFF\x3B\x8C\x68\xFF" - "\x3E\x93\x6D\xFF\x41\x99\x71\xFF\x43\x9F\x76\xFF\x45\xA4\x7A\xFF\x48\xAA\x7E\xFF\x49\xAE\x81\xFF\x4B\xB2\x84\xFF\x4C\xB6\x87\xFF" - "\x4E\xBA\x89\xFF\x4D\xB3\x83\xFF\x45\x97\x70\xFF\x3D\x79\x5B\xFF\x35\x58\x44\xFF\x30\x48\x39\xFF\x2D\x3A\x2F\xFF\x29\x31\x27\xFF" - "\x2B\x37\x2C\xFF\x3E\x79\x5B\xFF\x56\xCA\x95\xFF\x56\xCC\x96\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x52\xBC\x8B\xFF\x49\x9D\x76\xFF\x3E\x7A\x5C\xFF" - "\x36\x5C\x47\xFF\x31\x4C\x3B\xFF\x2D\x3D\x2F\xFF\x29\x30\x28\xFF\x27\x2B\x23\xFF\x27\x29\x22\xFF\x27\x28\x21\xFF\x28\x27\x21\xFF" - "\x27\x25\x20\xFF\x27\x24\x1F\xFF\x24\x24\x1E\xFF\x25\x23\x1F\xFF\x28\x25\x20\xFF\x29\x26\x20\xFF\x27\x25\x20\xFF\x28\x25\x20\xFF" - "\x26\x23\x1F\xFF\x27\x24\x1F\xFF\x29\x27\x21\xFF\x2A\x27\x21\xFF\x27\x24\x1F\xFF\x25\x24\x1E\xFF\x24\x24\x1F\xFF\x26\x24\x1F\xFF" - "\x28\x25\x1F\xFF\x27\x25\x1E\xFF\x27\x25\x20\xFF\x25\x25\x1F\xFF\x29\x26\x21\xFF\x27\x27\x20\xFF\x26\x25\x1F\xFF\x25\x23\x1E\xFF" - "\x26\x23\x1E\xFF\x23\x23\x1D\xFF\x26\x25\x1E\xFF\x27\x24\x1E\xFF\x25\x22\x1E\xFF\x27\x24\x1F\xFF\x29\x26\x21\xFF\x26\x26\x1E\xFF" - "\x28\x27\x21\xFF\x28\x26\x21\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x25\x23\x1E\xFF\x25\x23\x1F\xFF\x27\x24\x1F\xFF" - "\x27\x24\x1D\xFF\x29\x26\x20\xFF\x27\x26\x20\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x25\x24\x1D\xFF\x26\x26\x20\xFF" - "\x25\x22\x1D\xFF\x26\x25\x1E\xFF\x27\x24\x1F\xFF\x25\x22\x1D\xFF\x27\x25\x1F\xFF\x27\x24\x1D\xFF\x24\x22\x1D\xFF\x24\x22\x1D\xFF" - "\x26\x24\x1E\xFF\x25\x24\x1E\xFF\x27\x25\x1F\xFF\x28\x24\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x29\x28\x20\xFF" - "\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x24\x23\x1D\xFF\x25\x24\x1E\xFF\x25\x22\x1D\xFF\x25\x23\x1E\xFF\x26\x24\x1F\xFF\x26\x24\x1E\xFF" - "\x22\x23\x1D\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x25\x24\x1F\xFF\x24\x23\x1E\xFF\x26\x23\x1E\xFF\x27\x25\x20\xFF\x25\x24\x1E\xFF" - "\x27\x25\x20\xFF\x26\x23\x1E\xFF\x25\x23\x1E\xFF\x24\x21\x1C\xFF\x25\x24\x1E\xFF\x24\x24\x1E\xFF\x23\x23\x1D\xFF\x25\x23\x1E\xFF" - "\x26\x25\x1F\xFF\x23\x21\x1C\xFF\x24\x23\x1D\xFF\x26\x24\x1F\xFF\x23\x22\x1D\xFF\x23\x21\x1C\xFF\x25\x23\x1E\xFF\x28\x25\x20\xFF" - "\x28\x26\x1F\xFF\x28\x25\x1E\xFF\x25\x24\x1D\xFF\x26\x25\x20\xFF\x24\x22\x1E\xFF\x25\x23\x1E\xFF\x24\x21\x1D\xFF\x26\x23\x1E\xFF" - "\x27\x2D\x26\xFF\x39\x6A\x50\xFF\x53\xC1\x90\xFF\x58\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x41\x85\x65\xFF\x2A\x35\x2C\xFF" - "\x27\x27\x21\xFF\x26\x25\x1F\xFF\x24\x23\x1E\xFF\x25\x22\x1D\xFF\x26\x22\x1F\xFF\x24\x23\x1E\xFF\x24\x24\x1E\xFF\x22\x21\x1C\xFF" - "\x20\x20\x1A\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x29\x26\x21\xFF\x27\x24\x1F\xFF\x26\x25\x1E\xFF\x27\x27\x1F\xFF\x27\x2A\x24\xFF" - "\x31\x52\x3E\xFF\x51\xBA\x8A\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x97\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF" - "\x56\xCC\x97\xFF\x48\x9C\x75\xFF\x2D\x3E\x31\xFF\x27\x28\x22\xFF\x25\x22\x1E\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF\x27\x24\x1F\xFF" - "\x28\x26\x20\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x24\x23\x1E\xFF\x26\x23\x1E\xFF\x25\x24\x1E\xFF\x25\x22\x1E\xFF\x25\x22\x1E\xFF" - "\x27\x24\x1F\xFF\x25\x22\x1D\xFF\x24\x22\x1E\xFF\x22\x22\x1D\xFF\x24\x23\x1D\xFF\x21\x21\x1B\xFF\x1F\x1E\x19\xFF\x23\x20\x1B\xFF" - "\x20\x1F\x1A\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF\x24\x21\x1D\xFF\x23\x23\x1D\xFF\x24\x23\x1D\xFF\x23\x21\x1C\xFF\x24\x21\x1C\xFF" - "\x27\x24\x1F\xFF\x24\x22\x1D\xFF\x22\x21\x1B\xFF\x26\x23\x1E\xFF\x26\x25\x1E\xFF\x23\x23\x1D\xFF\x25\x22\x1D\xFF\x28\x24\x20\xFF" - "\x24\x21\x1F\xFF\x26\x24\x1F\xFF\x25\x24\x1E\xFF\x23\x23\x1D\xFF\x23\x21\x1C\xFF\x24\x21\x1C\xFF\x24\x21\x1C\xFF\x21\x20\x1A\xFF" - "\x22\x21\x1B\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF\x23\x21\x1F\xFF\x23\x21\x1C\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x23\x21\x1C\xFF" - "\x24\x24\x1E\xFF\x23\x23\x1D\xFF\x21\x21\x1B\xFF\x24\x23\x1D\xFF\x22\x22\x1C\xFF\x25\x23\x1E\xFF\x24\x21\x1C\xFF\x21\x1D\x1A\xFF" - "\x23\x22\x1D\xFF\x25\x22\x1D\xFF\x21\x20\x1B\xFF\x21\x1F\x1B\xFF\x21\x1F\x1B\xFF\x25\x23\x1E\xFF\x24\x21\x1D\xFF\x24\x23\x1D\xFF" - "\x26\x24\x1E\xFF\x22\x21\x1C\xFF\x23\x21\x1C\xFF\x22\x22\x1C\xFF\x22\x20\x1B\xFF\x24\x24\x1E\xFF\x25\x23\x1E\xFF\x23\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x21\x21\x1C\xFF\x22\x21\x1C\xFF\x23\x22\x1C\xFF\x21\x1F\x1B\xFF\x23\x20\x1C\xFF\x24\x23\x1D\xFF\x21\x21\x1B\xFF" - "\x22\x22\x1D\xFF\x25\x24\x1E\xFF\x26\x23\x1E\xFF\x25\x22\x1E\xFF\x22\x22\x1C\xFF\x23\x23\x1D\xFF\x23\x23\x1D\xFF\x24\x21\x1C\xFF" - "\x1F\x1E\x1A\xFF\x21\x20\x1A\xFF\x1F\x1D\x18\xFF\x1E\x1D\x19\xFF\x22\x22\x1C\xFF\x21\x21\x1B\xFF\x21\x20\x1B\xFF\x20\x1F\x1A\xFF" - "\x24\x23\x1D\xFF\x21\x20\x1A\xFF\x21\x1F\x1A\xFF\x22\x21\x1C\xFF\x25\x23\x1E\xFF\x23\x22\x1D\xFF\x23\x21\x1D\xFF\x24\x21\x1C\xFF" - "\x23\x21\x1C\xFF\x25\x23\x1E\xFF\x23\x21\x1C\xFF\x22\x22\x1C\xFF\x21\x20\x1B\xFF\x21\x21\x1B\xFF\x23\x21\x1B\xFF\x24\x21\x1C\xFF" - "\x23\x23\x1D\xFF\x23\x21\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x20\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1D\xFF\x20\x1F\x1B\xFF" - "\x25\x23\x1E\xFF\x23\x23\x1E\xFF\x23\x21\x1C\xFF\x28\x25\x20\xFF\x21\x1F\x1B\xFF\x20\x1E\x1A\xFF\x23\x21\x1C\xFF\x23\x21\x1C\xFF" - "\x22\x20\x1B\xFF\x21\x20\x1B\xFF\x23\x22\x1D\xFF\x23\x22\x1C\xFF\x23\x21\x1C\xFF\x24\x23\x1D\xFF\x24\x22\x1C\xFF\x23\x21\x1D\xFF" - "\x12\x11\x0E\xFF\x13\x11\x0F\xFF\x13\x11\x0F\xFF\x12\x11\x0D\xFF\x15\x13\x12\xFF\x15\x14\x11\xFF\x15\x15\x10\xFF\x11\x0F\x0E\xFF" - "\x11\x0E\x0D\xFF\x11\x10\x0E\xFF\x12\x10\x0E\xFF\x11\x0E\x0D\xFF\x10\x0E\x0D\xFF\x12\x10\x0E\xFF\x11\x0F\x0D\xFF\x11\x10\x0E\xFF" - "\x13\x12\x0F\xFF\x13\x12\x0E\xFF\x13\x12\x0F\xFF\x13\x12\x0F\xFF\x10\x10\x0C\xFF\x12\x11\x0E\xFF\x13\x12\x0F\xFF\x12\x12\x0F\xFF" - "\x11\x0F\x0E\xFF\x14\x13\x0F\xFF\x13\x12\x0F\xFF\x14\x13\x0F\xFF\x13\x12\x0F\xFF\x13\x11\x10\xFF\x12\x11\x0F\xFF\x11\x11\x0E\xFF" - "\x11\x11\x0E\xFF\x16\x14\x11\xFF\x13\x11\x0F\xFF\x13\x12\x10\xFF\x16\x14\x10\xFF\x15\x13\x10\xFF\x15\x14\x11\xFF\x12\x12\x0E\xFF" - "\x14\x13\x0F\xFF\x16\x14\x11\xFF\x14\x12\x0F\xFF\x15\x15\x11\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x13\x12\x0F\xFF\x12\x11\x0E\xFF" - "\x13\x11\x0F\xFF\x14\x12\x10\xFF\x14\x12\x11\xFF\x13\x13\x10\xFF\x16\x15\x11\xFF\x15\x15\x10\xFF\x13\x13\x0E\xFF\x17\x15\x11\xFF" - "\x10\x10\x0D\xFF\x14\x13\x0F\xFF\x15\x13\x10\xFF\x13\x12\x0F\xFF\x15\x14\x11\xFF\x15\x14\x10\xFF\x11\x10\x0D\xFF\x14\x13\x0F\xFF" - "\x16\x14\x10\xFF\x12\x11\x0E\xFF\x11\x10\x0D\xFF\x14\x12\x10\xFF\x14\x13\x10\xFF\x14\x13\x10\xFF\x13\x12\x0F\xFF\x13\x11\x0E\xFF" - "\x17\x15\x11\xFF\x18\x16\x13\xFF\x18\x17\x13\xFF\x12\x11\x0E\xFF\x15\x14\x10\xFF\x13\x12\x0E\xFF\x14\x13\x0F\xFF\x14\x12\x0F\xFF" - "\x18\x17\x13\xFF\x19\x18\x14\xFF\x16\x15\x11\xFF\x12\x11\x0D\xFF\x14\x13\x10\xFF\x15\x14\x11\xFF\x14\x13\x10\xFF\x13\x13\x0E\xFF" - "\x15\x14\x11\xFF\x18\x17\x13\xFF\x14\x12\x0F\xFF\x13\x12\x0F\xFF\x13\x12\x0E\xFF\x14\x13\x10\xFF\x16\x15\x11\xFF\x18\x16\x13\xFF" - "\x16\x14\x12\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x15\x14\x10\xFF\x17\x16\x12\xFF\x15\x14\x11\xFF\x17\x15\x13\xFF\x15\x14\x11\xFF" - "\x16\x14\x10\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x14\x13\x10\xFF\x16\x16\x12\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x14\x13\x0F\xFF" - "\x17\x16\x12\xFF\x17\x16\x12\xFF\x15\x14\x10\xFF\x14\x13\x0F\xFF\x16\x15\x11\xFF\x13\x12\x0F\xFF\x13\x12\x0E\xFF\x13\x11\x0F\xFF" - "\x15\x14\x11\xFF\x15\x14\x11\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x1A\x19\x15\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF" - "\x13\x13\x0F\xFF\x17\x15\x11\xFF\x18\x16\x14\xFF\x15\x14\x11\xFF\x15\x14\x10\xFF\x19\x17\x13\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF" - "\x1A\x19\x15\xFF\x19\x18\x14\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x16\x15\x11\xFF" - "\x19\x18\x14\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x16\x14\x11\xFF\x19\x18\x14\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF" - "\x1B\x1A\x16\xFF\x16\x16\x12\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF\x17\x16\x12\xFF" - "\x15\x14\x10\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF\x17\x16\x12\xFF\x1A\x18\x14\xFF\x1A\x19\x15\xFF\x19\x18\x14\xFF\x19\x17\x13\xFF" - "\x19\x18\x14\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF\x19\x18\x14\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF" - "\x1A\x18\x14\xFF\x1A\x17\x14\xFF\x1A\x18\x14\xFF\x13\x13\x11\xFF\x19\x19\x15\xFF\x19\x18\x14\xFF\x19\x19\x14\xFF\x1B\x1A\x16\xFF" - "\x1A\x18\x14\xFF\x18\x17\x13\xFF\x15\x14\x11\xFF\x19\x18\x14\xFF\x1A\x18\x14\xFF\x1B\x1C\x16\xFF\x1A\x19\x15\xFF\x18\x16\x12\xFF" - "\x18\x17\x13\xFF\x1A\x19\x14\xFF\x19\x18\x13\xFF\x1A\x19\x15\xFF\x19\x18\x15\xFF\x1A\x19\x15\xFF\x19\x18\x14\xFF\x1A\x1A\x15\xFF" - "\x1A\x18\x14\xFF\x19\x19\x15\xFF\x1A\x1A\x16\xFF\x1A\x19\x15\xFF\x17\x17\x13\xFF\x19\x19\x15\xFF\x1B\x19\x15\xFF\x19\x17\x13\xFF" - "\x1A\x1A\x15\xFF\x1A\x19\x14\xFF\x1D\x1C\x18\xFF\x1E\x1C\x18\xFF\x19\x17\x14\xFF\x19\x17\x13\xFF\x1A\x19\x15\xFF\x1C\x1A\x16\xFF" - "\x1B\x19\x15\xFF\x18\x16\x13\xFF\x18\x16\x13\xFF\x19\x18\x14\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x1A\x19\x14\xFF\x1C\x1B\x16\xFF" - "\x1E\x1B\x17\xFF\x1A\x1A\x15\xFF\x1C\x1A\x16\xFF\x1B\x1A\x15\xFF\x1C\x1B\x17\xFF\x1B\x1B\x16\xFF\x1E\x1C\x18\xFF\x1D\x1B\x17\xFF" - "\x1D\x1B\x16\xFF\x1C\x1B\x16\xFF\x1B\x1A\x17\xFF\x1A\x18\x16\xFF\x1B\x19\x15\xFF\x1B\x1B\x16\xFF\x1A\x19\x15\xFF\x1B\x1A\x16\xFF" - "\x20\x1F\x19\xFF\x1B\x1A\x17\xFF\x1B\x1A\x16\xFF\x19\x19\x15\xFF\x1D\x1C\x18\xFF\x20\x20\x19\xFF\x1F\x1F\x18\xFF\x1D\x1C\x18\xFF" - "\x1E\x1E\x18\xFF\x1C\x1A\x16\xFF\x1A\x19\x14\xFF\x19\x18\x14\xFF\x1C\x1A\x17\xFF\x1B\x1A\x16\xFF\x1E\x1E\x19\xFF\x1F\x1E\x18\xFF" - "\x1C\x1B\x17\xFF\x1B\x1A\x16\xFF\x1C\x1C\x17\xFF\x1F\x1E\x19\xFF\x1F\x1F\x19\xFF\x1F\x1C\x18\xFF\x1E\x1C\x17\xFF\x1C\x1C\x17\xFF" - "\x1D\x1B\x16\xFF\x1F\x1D\x19\xFF\x1F\x1E\x19\xFF\x1C\x1B\x16\xFF\x1E\x1C\x17\xFF\x1B\x1A\x16\xFF\x1D\x1B\x18\xFF\x1E\x1C\x18\xFF" - "\x1C\x1C\x17\xFF\x1F\x1F\x19\xFF\x1D\x1C\x17\xFF\x1E\x1B\x17\xFF\x1F\x1D\x18\xFF\x1D\x1C\x18\xFF\x1D\x1D\x18\xFF\x21\x20\x1B\xFF" - "\x21\x1F\x1C\xFF\x1E\x1D\x19\xFF\x1E\x1C\x18\xFF\x1F\x1D\x19\xFF\x1D\x1C\x18\xFF\x1E\x1C\x17\xFF\x1F\x1D\x18\xFF\x20\x1F\x19\xFF" - "\x20\x1D\x19\xFF\x1C\x1B\x16\xFF\x20\x1F\x1A\xFF\x22\x1F\x1B\xFF\x21\x1F\x1A\xFF\x1E\x1C\x18\xFF\x1D\x1B\x17\xFF\x1E\x1C\x18\xFF" - "\x1D\x1C\x18\xFF\x1E\x1C\x18\xFF\x1F\x1D\x19\xFF\x20\x1F\x1B\xFF\x1F\x1E\x1A\xFF\x1F\x1E\x1A\xFF\x21\x1F\x1A\xFF\x1E\x1D\x19\xFF" - "\x20\x1F\x1B\xFF\x1E\x1E\x18\xFF\x1D\x1D\x18\xFF\x20\x1E\x1A\xFF\x20\x1E\x1A\xFF\x20\x1E\x19\xFF\x1D\x1C\x17\xFF\x1C\x1C\x16\xFF" - "\x1C\x1B\x17\xFF\x1F\x1C\x18\xFF\x20\x1E\x19\xFF\x20\x1E\x1A\xFF\x1D\x1B\x16\xFF\x1C\x1C\x16\xFF\x1C\x1D\x18\xFF\x1D\x1D\x18\xFF" - "\x1B\x19\x16\xFF\x1B\x1B\x15\xFF\x1A\x19\x15\xFF\x1B\x19\x16\xFF\x1C\x1A\x16\xFF\x1D\x1B\x18\xFF\x17\x16\x13\xFF\x16\x15\x11\xFF" - "\x15\x13\x10\xFF\x14\x13\x10\xFF\x4F\x4B\x3E\xFF\x28\x26\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x26\x25\x20\xFF" - "\x29\x28\x23\xFF\x22\x22\x1D\xFF\x26\x25\x20\xFF\x22\x21\x1C\xFF\x24\x23\x1E\xFF\x25\x24\x20\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" - "\x22\x20\x1B\xFF\x25\x25\x20\xFF\x26\x25\x20\xFF\x24\x22\x1D\xFF\x28\x26\x21\xFF\x23\x22\x1D\xFF\x24\x23\x1E\xFF\x28\x26\x21\xFF" - "\x21\x20\x1A\xFF\x28\x26\x21\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1D\xFF" - "\x23\x22\x1C\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x22\x1D\xFF\x25\x24\x20\xFF\x29\x28\x22\xFF\x23\x22\x1C\xFF" - "\x23\x22\x1C\xFF\x21\x20\x1B\xFF\x22\x20\x1B\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x21\x1C\xFF\x23\x22\x1D\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x23\x1E\xFF\x28\x26\x21\xFF\x23\x22\x1E\xFF\x24\x22\x1D\xFF\x22\x21\x1B\xFF\x24\x23\x1D\xFF" - "\x28\x26\x21\xFF\x24\x22\x1D\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x20\x1B\xFF\x23\x21\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x25\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1E\xFF" - "\x21\x21\x1B\xFF\x26\x25\x20\xFF\x25\x24\x20\xFF\x22\x22\x1C\xFF\x25\x23\x1E\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF" - "\x24\x22\x1D\xFF\x23\x22\x1D\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" - "\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1F\xFF" - "\x26\x25\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x23\x1F\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF" - "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF" - "\x22\x22\x1C\xFF\x28\x26\x22\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF" - "\x24\x23\x1E\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x26\x25\x21\xFF\x23\x22\x1C\xFF\x24\x24\x1E\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" - "\x24\x23\x1E\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" - "\x23\x22\x1C\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" - "\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF" - "\x28\x26\x21\xFF\x23\x22\x1C\xFF\x23\x23\x1E\xFF\x25\x23\x1E\xFF\x24\x23\x1E\xFF\x29\x28\x22\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x22\x1C\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x28\x26\x22\xFF\x22\x21\x1B\xFF\x24\x22\x1D\xFF" - "\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x29\x28\x22\xFF\x22\x21\x1C\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x28\x26\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x26\x25\x20\xFF" - "\x29\x28\x23\xFF\x23\x23\x1E\xFF\x27\x25\x20\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x25\x24\x20\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x25\x25\x20\xFF\x27\x25\x20\xFF\x24\x22\x1D\xFF\x28\x26\x21\xFF\x24\x23\x1E\xFF\x25\x23\x1E\xFF\x28\x26\x21\xFF" - "\x22\x21\x1B\xFF\x28\x26\x21\xFF\x24\x22\x1D\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x25\x24\x20\xFF\x29\x28\x22\xFF\x23\x22\x1C\xFF" - "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x27\x26\x21\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x24\x1F\xFF\x28\x26\x21\xFF\x23\x22\x1E\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" - "\x28\x26\x21\xFF\x24\x23\x1E\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" - "\x23\x22\x1C\xFF\x25\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x26\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1E\xFF" - "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x26\x24\x20\xFF\x23\x22\x1C\xFF\x25\x24\x1F\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" - "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x23\x22\x1C\xFF" - "\x24\x22\x1D\xFF\x24\x23\x1E\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" - "\x23\x22\x1C\xFF\x25\x24\x1F\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF" - "\x27\x26\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x24\x1F\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x25\x20\xFF" - "\x22\x21\x1B\xFF\x27\x25\x20\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x28\x27\x21\xFF\x22\x22\x1B\xFF\x24\x24\x1F\xFF" - "\x23\x26\x1F\xFF\x2A\x2E\x28\xFF\x25\x2D\x24\xFF\x27\x31\x27\xFF\x29\x34\x2A\xFF\x27\x32\x27\xFF\x2B\x36\x2D\xFF\x27\x32\x27\xFF" - "\x29\x34\x2A\xFF\x2A\x35\x2C\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF" - "\x27\x32\x27\xFF\x2B\x36\x2D\xFF\x28\x33\x28\xFF\x2A\x35\x2B\xFF\x27\x32\x27\xFF\x29\x34\x2A\xFF\x28\x33\x28\xFF\x28\x33\x28\xFF" - "\x2A\x35\x2B\xFF\x2A\x35\x2C\xFF\x28\x33\x28\xFF\x27\x32\x27\xFF\x28\x33\x28\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x28\x33\x28\xFF" - "\x28\x33\x28\xFF\x2B\x36\x2C\xFF\x27\x32\x27\xFF\x2A\x35\x2B\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x28\x33\x28\xFF\x27\x32\x27\xFF" - "\x29\x34\x2A\xFF\x28\x33\x28\xFF\x29\x34\x2A\xFF\x28\x33\x28\xFF\x2A\x35\x2B\xFF\x4F\x4D\x3F\xFF\x3B\x8B\x67\xFF\x3B\x8C\x68\xFF" - "\x3E\x93\x6D\xFF\x41\x99\x71\xFF\x43\x9F\x76\xFF\x45\xA4\x7A\xFF\x48\xAA\x7E\xFF\x4A\xAF\x81\xFF\x4C\xB3\x84\xFF\x4D\xB7\x87\xFF" - "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x50\xC0\x8E\xFF\x51\xC2\x8F\xFF\x52\xBC\x8B\xFF\x4A\xA7\x7C\xFF\x44\x90\x6B\xFF\x3E\x78\x5B\xFF" - "\x36\x63\x4B\xFF\x41\x87\x66\xFF\x55\xCB\x96\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x53\xC2\x90\xFF\x4D\xAD\x81\xFF\x47\x96\x70\xFF\x40\x7E\x5F\xFF\x39\x63\x4C\xFF\x31\x48\x39\xFF\x2D\x36\x2B\xFF\x27\x2C\x24\xFF" - "\x25\x27\x21\xFF\x27\x27\x21\xFF\x26\x24\x1E\xFF\x25\x24\x1E\xFF\x28\x25\x1F\xFF\x26\x24\x1E\xFF\x25\x25\x20\xFF\x26\x24\x1F\xFF" - "\x25\x22\x1E\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x29\x26\x21\xFF\x25\x23\x1D\xFF\x25\x23\x1D\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF" - "\x2A\x27\x21\xFF\x29\x26\x21\xFF\x28\x25\x20\xFF\x26\x26\x20\xFF\x29\x26\x21\xFF\x29\x26\x21\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" - "\x26\x24\x1F\xFF\x25\x24\x1E\xFF\x25\x23\x1E\xFF\x24\x22\x1E\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x25\x24\x1F\xFF" - "\x28\x27\x1F\xFF\x27\x25\x1F\xFF\x25\x25\x1F\xFF\x27\x25\x1F\xFF\x27\x24\x1F\xFF\x26\x23\x1F\xFF\x25\x23\x1E\xFF\x28\x25\x20\xFF" - "\x28\x25\x20\xFF\x28\x26\x20\xFF\x26\x24\x1F\xFF\x26\x25\x1E\xFF\x26\x24\x1E\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x25\x20\xFF" - "\x25\x23\x1E\xFF\x27\x25\x1E\xFF\x27\x26\x1F\xFF\x26\x24\x1D\xFF\x25\x24\x1D\xFF\x28\x26\x1F\xFF\x28\x27\x21\xFF\x26\x25\x1F\xFF" - "\x25\x23\x1E\xFF\x26\x25\x1F\xFF\x27\x24\x1F\xFF\x27\x25\x1E\xFF\x24\x23\x1E\xFF\x27\x25\x1F\xFF\x27\x25\x20\xFF\x27\x26\x1F\xFF" - "\x29\x26\x20\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF\x26\x23\x1D\xFF\x23\x22\x1C\xFF\x26\x25\x1F\xFF\x25\x25\x1E\xFF\x25\x24\x1E\xFF" - "\x25\x24\x1E\xFF\x24\x23\x1D\xFF\x24\x23\x1E\xFF\x25\x25\x1F\xFF\x25\x24\x1E\xFF\x25\x23\x1E\xFF\x23\x23\x1E\xFF\x25\x24\x1F\xFF" - "\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x23\x1F\xFF\x25\x22\x1D\xFF\x27\x24\x1E\xFF\x27\x25\x1F\xFF\x25\x24\x1E\xFF\x25\x23\x1E\xFF" - "\x26\x24\x1F\xFF\x23\x22\x1D\xFF\x26\x24\x1E\xFF\x24\x24\x1E\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF\x26\x24\x1E\xFF" - "\x26\x24\x1E\xFF\x27\x25\x1E\xFF\x25\x23\x1E\xFF\x28\x25\x20\xFF\x24\x21\x1E\xFF\x25\x23\x1E\xFF\x26\x23\x1F\xFF\x25\x22\x1C\xFF" - "\x26\x29\x22\xFF\x32\x53\x3F\xFF\x4E\xAF\x82\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x4A\xA4\x7A\xFF\x2C\x43\x35\xFF" - "\x28\x28\x22\xFF\x26\x25\x20\xFF\x26\x24\x1F\xFF\x25\x23\x1F\xFF\x25\x23\x1C\xFF\x25\x22\x1D\xFF\x25\x24\x1D\xFF\x23\x23\x1D\xFF" - "\x23\x23\x1D\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x27\x25\x20\xFF\x23\x22\x1C\xFF\x24\x22\x1D\xFF\x24\x23\x1D\xFF\x24\x25\x1F\xFF" - "\x2C\x40\x30\xFF\x47\x98\x71\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x56\xCC\x98\xFF\x56\xCC\x97\xFF\x57\xCC\x97\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x4E\xB2\x84\xFF\x32\x56\x42\xFF\x25\x2A\x22\xFF\x25\x25\x1F\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x25\x22\x1D\xFF" - "\x24\x24\x1E\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF\x27\x24\x1E\xFF\x25\x23\x1D\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF" - "\x25\x22\x1D\xFF\x24\x23\x1E\xFF\x25\x23\x1E\xFF\x23\x22\x1E\xFF\x24\x22\x1E\xFF\x23\x20\x1B\xFF\x23\x22\x1C\xFF\x26\x23\x1E\xFF" - "\x25\x23\x1E\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF\x27\x26\x1F\xFF\x25\x24\x1E\xFF\x22\x20\x1B\xFF" - "\x23\x20\x1B\xFF\x23\x21\x1C\xFF\x23\x21\x1C\xFF\x24\x22\x1D\xFF\x23\x21\x1C\xFF\x23\x22\x1C\xFF\x26\x24\x1E\xFF\x25\x23\x1E\xFF" - "\x23\x21\x1C\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF\x22\x21\x1B\xFF\x22\x22\x1C\xFF\x24\x22\x1C\xFF\x24\x21\x1C\xFF\x23\x21\x1C\xFF" - "\x25\x23\x1E\xFF\x26\x22\x1D\xFF\x25\x22\x1D\xFF\x23\x21\x1D\xFF\x24\x22\x1D\xFF\x21\x21\x1B\xFF\x23\x22\x1D\xFF\x24\x23\x1D\xFF" - "\x23\x22\x1D\xFF\x22\x21\x1C\xFF\x23\x20\x1C\xFF\x23\x21\x1D\xFF\x21\x21\x1C\xFF\x25\x23\x1E\xFF\x28\x25\x20\xFF\x23\x20\x1B\xFF" - "\x23\x21\x1C\xFF\x25\x22\x1D\xFF\x26\x23\x1E\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x20\x1C\xFF\x21\x20\x1B\xFF\x23\x22\x1D\xFF" - "\x26\x24\x1E\xFF\x24\x21\x1D\xFF\x25\x22\x1E\xFF\x24\x22\x1D\xFF\x24\x23\x1E\xFF\x23\x22\x1D\xFF\x23\x22\x1D\xFF\x25\x24\x1E\xFF" - "\x24\x21\x1D\xFF\x27\x24\x20\xFF\x25\x22\x1D\xFF\x26\x24\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1C\xFF\x24\x21\x1D\xFF\x25\x23\x1F\xFF" - "\x26\x24\x1F\xFF\x26\x23\x1E\xFF\x25\x23\x1E\xFF\x25\x22\x1D\xFF\x23\x21\x1D\xFF\x24\x22\x1D\xFF\x22\x1F\x1A\xFF\x22\x21\x1B\xFF" - "\x20\x1E\x1A\xFF\x21\x20\x1B\xFF\x22\x20\x1B\xFF\x21\x20\x1A\xFF\x22\x22\x1C\xFF\x23\x21\x1C\xFF\x23\x21\x1C\xFF\x21\x20\x1B\xFF" - "\x23\x20\x1C\xFF\x21\x20\x1B\xFF\x22\x20\x1B\xFF\x21\x1F\x1B\xFF\x23\x21\x1C\xFF\x23\x21\x1C\xFF\x24\x22\x1D\xFF\x21\x20\x1B\xFF" - "\x20\x1F\x1A\xFF\x26\x23\x1E\xFF\x25\x22\x1D\xFF\x23\x22\x1B\xFF\x21\x1F\x1B\xFF\x22\x1F\x1B\xFF\x24\x21\x1D\xFF\x25\x23\x1D\xFF" - "\x25\x22\x1D\xFF\x21\x21\x1B\xFF\x21\x20\x1B\xFF\x22\x20\x1C\xFF\x22\x21\x1B\xFF\x1F\x1E\x19\xFF\x22\x20\x1B\xFF\x21\x20\x1B\xFF" - "\x25\x23\x1E\xFF\x21\x21\x1C\xFF\x20\x1F\x1B\xFF\x21\x20\x1B\xFF\x24\x23\x1E\xFF\x22\x22\x1C\xFF\x21\x20\x1B\xFF\x20\x1F\x1A\xFF" - "\x23\x21\x1C\xFF\x24\x22\x1D\xFF\x24\x21\x1D\xFF\x25\x24\x1E\xFF\x22\x21\x1C\xFF\x23\x22\x1C\xFF\x24\x22\x1E\xFF\x22\x21\x1D\xFF" - "\x18\x18\x13\xFF\x15\x14\x10\xFF\x15\x13\x10\xFF\x13\x12\x0E\xFF\x12\x10\x0D\xFF\x12\x11\x0D\xFF\x16\x15\x10\xFF\x14\x12\x10\xFF" - "\x12\x10\x10\xFF\x12\x10\x0E\xFF\x12\x11\x0E\xFF\x11\x10\x0D\xFF\x14\x13\x0F\xFF\x10\x0F\x0C\xFF\x10\x0E\x0D\xFF\x10\x0E\x0D\xFF" - "\x13\x12\x0E\xFF\x10\x0F\x0D\xFF\x10\x0F\x0C\xFF\x13\x11\x0F\xFF\x13\x12\x0E\xFF\x13\x12\x0E\xFF\x14\x13\x0F\xFF\x12\x11\x0F\xFF" - "\x12\x10\x0E\xFF\x13\x12\x0E\xFF\x11\x10\x0D\xFF\x14\x13\x0F\xFF\x14\x13\x10\xFF\x12\x10\x0E\xFF\x13\x11\x0F\xFF\x14\x12\x10\xFF" - "\x13\x10\x0D\xFF\x17\x15\x12\xFF\x17\x17\x13\xFF\x12\x11\x0E\xFF\x16\x15\x11\xFF\x14\x13\x0F\xFF\x13\x11\x0F\xFF\x13\x12\x0E\xFF" - "\x16\x15\x11\xFF\x14\x13\x0F\xFF\x14\x13\x0F\xFF\x1E\x1E\x18\xFF\x17\x15\x13\xFF\x16\x15\x11\xFF\x13\x12\x0E\xFF\x12\x11\x0D\xFF" - "\x14\x12\x10\xFF\x13\x12\x0F\xFF\x14\x13\x0F\xFF\x13\x12\x0F\xFF\x14\x12\x10\xFF\x15\x14\x10\xFF\x14\x14\x10\xFF\x15\x13\x0F\xFF" - "\x15\x14\x10\xFF\x12\x11\x0E\xFF\x12\x10\x0D\xFF\x14\x13\x0F\xFF\x14\x12\x11\xFF\x15\x14\x11\xFF\x12\x11\x0E\xFF\x16\x14\x0F\xFF" - "\x15\x14\x10\xFF\x11\x10\x0C\xFF\x12\x11\x0D\xFF\x16\x15\x12\xFF\x15\x14\x10\xFF\x14\x13\x0F\xFF\x14\x13\x0F\xFF\x12\x11\x0F\xFF" - "\x13\x12\x10\xFF\x14\x12\x11\xFF\x14\x12\x0F\xFF\x12\x11\x0E\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF\x15\x14\x11\xFF\x15\x15\x0F\xFF" - "\x17\x16\x12\xFF\x1A\x18\x15\xFF\x17\x16\x13\xFF\x14\x13\x0F\xFF\x11\x0F\x0E\xFF\x12\x11\x0F\xFF\x14\x13\x10\xFF\x16\x15\x11\xFF" - "\x16\x15\x11\xFF\x16\x15\x11\xFF\x18\x17\x13\xFF\x15\x13\x10\xFF\x12\x11\x0E\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF\x15\x13\x11\xFF" - "\x16\x15\x12\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF\x14\x12\x0F\xFF" - "\x16\x15\x11\xFF\x15\x14\x10\xFF\x15\x14\x10\xFF\x13\x11\x0F\xFF\x15\x13\x11\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF" - "\x16\x15\x11\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF\x1C\x1B\x17\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x18\x17\x13\xFF" - "\x14\x13\x0F\xFF\x15\x13\x11\xFF\x14\x12\x0F\xFF\x14\x13\x0F\xFF\x19\x18\x15\xFF\x17\x16\x13\xFF\x15\x14\x11\xFF\x1B\x1A\x16\xFF" - "\x13\x12\x0E\xFF\x17\x15\x11\xFF\x16\x15\x11\xFF\x13\x12\x0F\xFF\x16\x15\x11\xFF\x18\x16\x13\xFF\x18\x16\x13\xFF\x17\x16\x12\xFF" - "\x17\x16\x12\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x1B\x1A\x16\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF" - "\x17\x16\x12\xFF\x1A\x1A\x15\xFF\x18\x17\x13\xFF\x18\x17\x14\xFF\x16\x15\x11\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF\x16\x15\x11\xFF" - "\x19\x18\x14\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x1C\x1B\x17\xFF\x1D\x1B\x17\xFF\x18\x17\x13\xFF\x1C\x1A\x16\xFF\x19\x16\x12\xFF" - "\x16\x15\x11\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x1A\x18\x14\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF\x1A\x19\x15\xFF" - "\x19\x18\x14\xFF\x18\x16\x12\xFF\x1A\x18\x14\xFF\x18\x16\x12\xFF\x15\x14\x10\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x18\x16\x12\xFF" - "\x17\x17\x13\xFF\x18\x17\x13\xFF\x1B\x1A\x15\xFF\x1B\x1B\x16\xFF\x18\x18\x14\xFF\x18\x18\x14\xFF\x1A\x19\x15\xFF\x19\x18\x14\xFF" - "\x1B\x19\x15\xFF\x1B\x1A\x16\xFF\x19\x18\x14\xFF\x1C\x1A\x16\xFF\x1B\x1A\x16\xFF\x1A\x19\x15\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF" - "\x1A\x19\x15\xFF\x19\x18\x14\xFF\x19\x19\x15\xFF\x1A\x18\x14\xFF\x1D\x1C\x18\xFF\x1B\x1A\x16\xFF\x1E\x1C\x18\xFF\x1D\x1B\x17\xFF" - "\x1B\x18\x14\xFF\x1B\x1A\x16\xFF\x1B\x19\x15\xFF\x1B\x1A\x15\xFF\x18\x16\x12\xFF\x19\x18\x13\xFF\x1B\x1A\x16\xFF\x1A\x19\x15\xFF" - "\x1B\x1A\x16\xFF\x20\x1D\x19\xFF\x1D\x1B\x17\xFF\x18\x18\x13\xFF\x1E\x1B\x17\xFF\x1B\x19\x15\xFF\x1B\x1A\x16\xFF\x1A\x19\x14\xFF" - "\x19\x17\x14\xFF\x1C\x19\x16\xFF\x1B\x19\x15\xFF\x19\x17\x15\xFF\x1A\x19\x15\xFF\x1A\x19\x15\xFF\x19\x19\x14\xFF\x1A\x1A\x15\xFF" - "\x1B\x1A\x15\xFF\x1E\x1C\x17\xFF\x1B\x1A\x15\xFF\x1B\x1A\x15\xFF\x1D\x1D\x17\xFF\x1E\x1D\x17\xFF\x1C\x1B\x16\xFF\x17\x15\x11\xFF" - "\x19\x19\x15\xFF\x1C\x19\x15\xFF\x1D\x1B\x17\xFF\x1D\x1B\x18\xFF\x19\x18\x14\xFF\x1B\x1A\x16\xFF\x1C\x1B\x17\xFF\x18\x17\x13\xFF" - "\x1B\x1A\x16\xFF\x1D\x1C\x17\xFF\x1B\x1A\x15\xFF\x17\x17\x12\xFF\x1A\x19\x15\xFF\x1A\x19\x15\xFF\x17\x17\x13\xFF\x18\x17\x13\xFF" - "\x1D\x1D\x17\xFF\x1F\x1E\x19\xFF\x1A\x19\x14\xFF\x1A\x18\x16\xFF\x1D\x1A\x16\xFF\x1C\x1A\x16\xFF\x1A\x1A\x16\xFF\x1D\x1C\x17\xFF" - "\x1B\x1A\x16\xFF\x1C\x1A\x16\xFF\x1D\x1B\x17\xFF\x1B\x1A\x16\xFF\x1C\x18\x14\xFF\x1D\x1B\x17\xFF\x1C\x1B\x17\xFF\x1E\x1C\x18\xFF" - "\x1F\x1D\x19\xFF\x1E\x1E\x19\xFF\x1F\x1F\x1A\xFF\x1C\x1B\x17\xFF\x1E\x1E\x18\xFF\x1D\x1B\x18\xFF\x1D\x1C\x17\xFF\x1D\x1C\x18\xFF" - "\x1A\x1A\x18\xFF\x1D\x1D\x18\xFF\x1D\x1C\x18\xFF\x1D\x1D\x17\xFF\x1E\x1D\x19\xFF\x1E\x1D\x18\xFF\x1B\x1A\x15\xFF\x1F\x1E\x19\xFF" - "\x1B\x1A\x16\xFF\x1C\x1B\x17\xFF\x1B\x1A\x16\xFF\x1E\x1D\x18\xFF\x1E\x1D\x19\xFF\x1C\x1B\x16\xFF\x1D\x1B\x17\xFF\x1F\x1E\x19\xFF" - "\x1D\x1A\x17\xFF\x1F\x1D\x19\xFF\x22\x21\x1B\xFF\x21\x20\x1B\xFF\x1C\x1B\x17\xFF\x1E\x1D\x18\xFF\x1C\x1B\x17\xFF\x1D\x1D\x17\xFF" - "\x1D\x1C\x16\xFF\x1F\x1D\x18\xFF\x1C\x1B\x16\xFF\x1C\x1B\x17\xFF\x1E\x1C\x18\xFF\x20\x1F\x1A\xFF\x24\x21\x1D\xFF\x21\x21\x1B\xFF" - "\x24\x22\x1D\xFF\x1E\x1D\x18\xFF\x1D\x1C\x18\xFF\x1D\x1C\x17\xFF\x20\x1F\x1B\xFF\x1F\x1E\x19\xFF\x1B\x1A\x16\xFF\x1E\x1C\x17\xFF" - "\x1E\x1D\x19\xFF\x1E\x1D\x18\xFF\x1F\x1D\x18\xFF\x1E\x1B\x18\xFF\x1D\x1C\x17\xFF\x1D\x1C\x17\xFF\x1D\x1D\x19\xFF\x1E\x1E\x18\xFF"; + "\x1C\x1C\x17\xFF\x1D\x1B\x18\xFF\x1B\x19\x15\xFF\x19\x18\x13\xFF\x19\x18\x14\xFF\x17\x16\x12" + "\xFF\x17\x17\x13\xFF\x19\x17\x14\xFF" + "\x15\x14\x11\xFF\x13\x13\x10\xFF\x4F\x4B\x3E\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x22\x21\x1C" + "\xFF\x22\x21\x1B\xFF\x21\x21\x1A\xFF" + "\x22\x21\x1B\xFF\x21\x20\x1A\xFF\x21\x20\x1A\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x23\x22\x1D" + "\xFF\x22\x20\x1A\xFF\x21\x20\x1A\xFF" + "\x21\x20\x1B\xFF\x24\x23\x1E\xFF\x21\x20\x1B\xFF\x22\x22\x1C\xFF\x25\x24\x20\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x29\x28\x23\xFF" + "\x26\x25\x21\xFF\x21\x20\x1B\xFF\x29\x28\x22\xFF\x21\x20\x1A\xFF\x26\x25\x20\xFF\x22\x21\x1B" + "\xFF\x24\x22\x1D\xFF\x26\x25\x20\xFF" + "\x23\x23\x1D\xFF\x2A\x29\x23\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x23\x22\x1D" + "\xFF\x24\x23\x1E\xFF\x21\x20\x1B\xFF" + "\x26\x25\x20\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x24\x23\x1E\xFF\x22\x21\x1B" + "\xFF\x25\x24\x20\xFF\x25\x24\x20\xFF" + "\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1D\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20" + "\xFF\x28\x26\x21\xFF\x24\x22\x1D\xFF" + "\x23\x22\x1E\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" + "\x24\x23\x1E\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x21\x20\x1A\xFF\x24\x23\x1E\xFF\x24\x23\x1E" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x21\x20\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1D" + "\xFF\x2A\x29\x24\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x22\x1D\xFF\x26\x25\x20\xFF\x23\x22\x1D" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x26\x25\x20\xFF\x21\x20\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x25\x20" + "\xFF\x28\x26\x21\xFF\x25\x24\x20\xFF" + "\x24\x23\x1D\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x29\x28\x23" + "\xFF\x29\x28\x22\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x23\x1E\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x24\x20" + "\xFF\x22\x20\x1B\xFF\x22\x21\x1B\xFF" + "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x21\x20\x1B\xFF\x29\x29\x23\xFF\x21\x20\x1A\xFF\x25\x24\x20" + "\xFF\x26\x24\x20\xFF\x21\x21\x1B\xFF" + "\x21\x20\x1B\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x25\x25\x20\xFF" + "\x29\x28\x22\xFF\x23\x23\x1E\xFF\x23\x22\x1C\xFF\x22\x22\x1C\xFF\x25\x24\x20\xFF\x22\x21\x1B" + "\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF" + "\x25\x25\x20\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x29\x28\x22\xFF\x23\x22\x1C\xFF\x23\x22\x1E" + "\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x28\x26\x21" + "\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF" + "\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x22\x1D\xFF\x24\x23\x1D\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x25\x24\x1F\xFF\x25\x24\x20\xFF\x28\x26\x21\xFF\x25\x24\x20\xFF\x25\x24\x20\xFF\x22\x21\x1B" + "\xFF\x28\x26\x21\xFF\x25\x24\x20\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E" + "\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF" + "\x28\x26\x21\xFF\x23\x22\x1C\xFF\x25\x23\x1F\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x24\x23\x1E" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF\x23\x22\x1C" + "\xFF\x23\x22\x1C\xFF\x29\x28\x23\xFF" + "\x27\x25\x21\xFF\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B" + "\xFF\x24\x23\x1E\xFF\x26\x25\x20\xFF" + "\x24\x23\x1E\xFF\x2A\x29\x23\xFF\x25\x23\x1E\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x23\x23\x1E" + "\xFF\x24\x24\x1E\xFF\x22\x21\x1B\xFF" + "\x26\x25\x20\xFF\x26\x24\x20\xFF\x23\x22\x1C\xFF\x26\x25\x20\xFF\x24\x23\x1E\xFF\x22\x21\x1B" + "\xFF\x26\x25\x20\xFF\x26\x25\x21\xFF" + "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1E\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20" + "\xFF\x28\x26\x21\xFF\x24\x23\x1E\xFF" + "\x23\x23\x1E\xFF\x27\x25\x20\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" + "\x25\x24\x1F\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x25\x24\x1F" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1E" + "\xFF\x2A\x29\x24\xFF\x22\x21\x1B\xFF" + "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1E\xFF\x27\x25\x20\xFF\x24\x23\x1E" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x27\x25\x20\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x25\x20" + "\xFF\x28\x26\x21\xFF\x25\x24\x20\xFF" + "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x29\x28\x23" + "\xFF\x29\x28\x22\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x23\x1E\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x26\x25\x20" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x2A\x29\x23\xFF\x22\x21\x1B\xFF\x26\x25\x21" + "\xFF\x26\x25\x21\xFF\x22\x23\x1C\xFF" + "\x23\x23\x1C\xFF\x24\x25\x1E\xFF\x27\x2B\x25\xFF\x2B\x2F\x27\xFF\x25\x2C\x23\xFF\x26\x2E\x24" + "\xFF\x26\x2F\x25\xFF\x2A\x35\x2B\xFF" + "\x2E\x39\x2E\xFF\x28\x34\x2A\xFF\x28\x33\x28\xFF\x28\x33\x28\xFF\x2A\x35\x2C\xFF\x27\x32\x27" + "\xFF\x2A\x35\x2C\xFF\x27\x32\x27\xFF" + "\x2A\x36\x2C\xFF\x2B\x36\x2D\xFF\x27\x32\x27\xFF\x28\x33\x28\xFF\x27\x32\x27\xFF\x28\x33\x28" + "\xFF\x28\x33\x28\xFF\x27\x32\x27\xFF" + "\x27\x32\x27\xFF\x27\x32\x27\xFF\x2A\x35\x2C\xFF\x2E\x39\x2E\xFF\x28\x33\x28\xFF\x28\x33\x2A" + "\xFF\x28\x33\x28\xFF\x27\x32\x27\xFF" + "\x27\x32\x27\xFF\x28\x33\x28\xFF\x2D\x37\x2D\xFF\x27\x32\x27\xFF\x2A\x35\x2B\xFF\x54\x51\x43" + "\xFF\x37\x82\x60\xFF\x36\x7A\x5A\xFF" + "\x34\x71\x54\xFF\x32\x68\x4D\xFF\x30\x5D\x46\xFF\x2D\x53\x3F\xFF\x2B\x45\x35\xFF\x26\x35\x29" + "\xFF\x25\x2D\x23\xFF\x26\x2C\x25\xFF" + "\x27\x2A\x23\xFF\x23\x25\x1F\xFF\x23\x23\x1E\xFF\x24\x23\x1D\xFF\x25\x23\x1D\xFF\x25\x23\x1E" + "\xFF\x25\x23\x1D\xFF\x25\x24\x1F\xFF" + "\x28\x2B\x23\xFF\x37\x60\x4A\xFF\x4A\xA2\x78\xFF\x47\x97\x71\xFF\x41\x84\x64\xFF\x3D\x75\x58" + "\xFF\x38\x62\x4B\xFF\x33\x50\x3E\xFF" + "\x2E\x3C\x30\xFF\x2A\x34\x29\xFF\x28\x30\x26\xFF\x27\x2C\x24\xFF\x26\x29\x22\xFF\x27\x28\x21" + "\xFF\x27\x26\x20\xFF\x27\x25\x20\xFF" + "\x25\x25\x20\xFF\x24\x23\x1D\xFF\x26\x23\x1E\xFF\x28\x25\x20\xFF\x26\x24\x1E\xFF\x27\x24\x1F" + "\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF" + "\x26\x25\x1F\xFF\x28\x25\x20\xFF\x28\x26\x21\xFF\x2A\x27\x22\xFF\x26\x25\x1E\xFF\x27\x24\x1F" + "\xFF\x27\x25\x1F\xFF\x28\x25\x1F\xFF" + "\x27\x27\x1F\xFF\x27\x24\x1F\xFF\x25\x24\x1F\xFF\x26\x24\x1F\xFF\x24\x24\x1E\xFF\x25\x24\x1D" + "\xFF\x27\x25\x1F\xFF\x28\x25\x20\xFF" + "\x27\x24\x1F\xFF\x28\x25\x1F\xFF\x27\x26\x1F\xFF\x27\x25\x1E\xFF\x25\x23\x1E\xFF\x26\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x27\x25\x20\xFF" + "\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1E\xFF\x25\x22\x1D" + "\xFF\x26\x23\x1E\xFF\x23\x21\x1C\xFF" + "\x26\x24\x1F\xFF\x28\x25\x20\xFF\x28\x26\x1F\xFF\x28\x25\x1F\xFF\x28\x25\x20\xFF\x26\x24\x1F" + "\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF" + "\x26\x24\x1F\xFF\x25\x25\x1E\xFF\x27\x25\x1F\xFF\x28\x24\x1F\xFF\x29\x27\x1F\xFF\x25\x24\x1E" + "\xFF\x24\x24\x1E\xFF\x25\x24\x1E\xFF" + "\x25\x23\x1E\xFF\x25\x24\x1E\xFF\x25\x24\x1E\xFF\x27\x24\x1F\xFF\x2A\x27\x22\xFF\x2B\x28\x22" + "\xFF\x2B\x28\x21\xFF\x25\x24\x1E\xFF" + "\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x27\x23\x1E\xFF\x28\x25\x20\xFF\x25\x22\x1E\xFF\x25\x23\x1E" + "\xFF\x23\x22\x1C\xFF\x25\x25\x1E\xFF" + "\x26\x26\x20\xFF\x26\x24\x1E\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x26\x25\x1F\xFF\x26\x25\x1F" + "\xFF\x27\x25\x1E\xFF\x25\x23\x1C\xFF" + "\x25\x23\x1E\xFF\x25\x24\x1E\xFF\x24\x23\x1E\xFF\x24\x21\x1C\xFF\x25\x22\x1D\xFF\x27\x24\x1F" + "\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF" + "\x25\x22\x1E\xFF\x25\x22\x1E\xFF\x25\x22\x1D\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x26\x20" + "\xFF\x26\x26\x1F\xFF\x27\x25\x1F\xFF" + "\x27\x26\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1E\xFF\x23\x22\x1C\xFF\x25\x23\x1D\xFF\x25\x22\x1E" + "\xFF\x26\x24\x1E\xFF\x24\x23\x1E\xFF" + "\x26\x24\x1F\xFF\x27\x26\x20\xFF\x29\x27\x21\xFF\x2A\x26\x21\xFF\x27\x24\x1F\xFF\x25\x23\x1E" + "\xFF\x26\x24\x1F\xFF\x28\x29\x23\xFF" + "\x2F\x46\x36\xFF\x4B\xA5\x7B\xFF\x57\xCD\x97\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x4D\xAC\x7F" + "\xFF\x32\x50\x3D\xFF\x26\x29\x22\xFF" + "\x23\x21\x1C\xFF\x26\x23\x1E\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF\x26\x24\x1F" + "\xFF\x25\x24\x1E\xFF\x25\x24\x1F\xFF" + "\x22\x21\x1C\xFF\x24\x23\x1D\xFF\x24\x24\x1D\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF\x26\x24\x1F" + "\xFF\x25\x27\x21\xFF\x2B\x36\x2B\xFF" + "\x4B\xA7\x7D\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x50\xB9\x89\xFF\x32\x54\x40\xFF\x27\x2A\x23\xFF\x23\x22\x1C\xFF\x25\x24\x1F\xFF\x25\x22\x1D" + "\xFF\x25\x23\x1D\xFF\x25\x22\x1D\xFF" + "\x24\x23\x1D\xFF\x25\x23\x1E\xFF\x24\x22\x1D\xFF\x25\x22\x1D\xFF\x23\x22\x1C\xFF\x24\x23\x1D" + "\xFF\x27\x25\x1F\xFF\x28\x25\x1F\xFF" + "\x25\x23\x1E\xFF\x23\x22\x1D\xFF\x24\x22\x1C\xFF\x24\x23\x1D\xFF\x24\x22\x1D\xFF\x24\x21\x1C" + "\xFF\x25\x24\x1E\xFF\x23\x22\x1C\xFF" + "\x24\x21\x1C\xFF\x25\x23\x1E\xFF\x27\x25\x1F\xFF\x25\x25\x1F\xFF\x24\x22\x1D\xFF\x24\x21\x1C" + "\xFF\x25\x23\x1E\xFF\x22\x21\x1C\xFF" + "\x26\x23\x1F\xFF\x24\x21\x1D\xFF\x24\x22\x1D\xFF\x23\x22\x1C\xFF\x23\x21\x1C\xFF\x24\x21\x1C" + "\xFF\x26\x23\x1E\xFF\x23\x22\x1D\xFF" + "\x22\x21\x1C\xFF\x26\x25\x1F\xFF\x26\x23\x1E\xFF\x25\x23\x1E\xFF\x23\x23\x1D\xFF\x25\x24\x1E" + "\xFF\x26\x25\x1E\xFF\x26\x23\x1E\xFF" + "\x24\x22\x1D\xFF\x24\x22\x1E\xFF\x24\x22\x1D\xFF\x25\x22\x1D\xFF\x23\x22\x1D\xFF\x24\x22\x1D" + "\xFF\x26\x23\x1E\xFF\x26\x24\x1F\xFF" + "\x24\x21\x1D\xFF\x23\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x23\x1E\xFF\x24\x22\x1D\xFF\x21\x1F\x1B" + "\xFF\x22\x20\x1B\xFF\x22\x21\x1B\xFF" + "\x25\x24\x1E\xFF\x24\x24\x1D\xFF\x24\x23\x1D\xFF\x25\x23\x1E\xFF\x23\x22\x1D\xFF\x23\x22\x1D" + "\xFF\x23\x21\x1C\xFF\x22\x21\x1C\xFF" + "\x20\x20\x1B\xFF\x25\x25\x1E\xFF\x24\x22\x1D\xFF\x24\x22\x1D\xFF\x26\x23\x1E\xFF\x23\x22\x1D" + "\xFF\x24\x22\x1D\xFF\x25\x22\x1D\xFF" + "\x24\x22\x1D\xFF\x24\x22\x1D\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x24\x23\x1D\xFF\x25\x24\x1E" + "\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF" + "\x25\x23\x1E\xFF\x25\x23\x1E\xFF\x22\x22\x1C\xFF\x22\x20\x1B\xFF\x20\x20\x1A\xFF\x22\x20\x1B" + "\xFF\x21\x20\x1B\xFF\x23\x22\x1C\xFF" + "\x23\x22\x1D\xFF\x22\x21\x1C\xFF\x20\x1F\x1A\xFF\x20\x1F\x1A\xFF\x24\x21\x1C\xFF\x25\x24\x1E" + "\xFF\x25\x23\x1E\xFF\x24\x22\x1D\xFF" + "\x26\x23\x1E\xFF\x24\x22\x1D\xFF\x23\x20\x1B\xFF\x24\x22\x1C\xFF\x25\x23\x1D\xFF\x23\x22\x1D" + "\xFF\x20\x20\x1A\xFF\x20\x1F\x19\xFF" + "\x1F\x1F\x1A\xFF\x23\x23\x1D\xFF\x23\x21\x1C\xFF\x22\x1F\x1B\xFF\x21\x21\x1A\xFF\x22\x22\x1C" + "\xFF\x23\x22\x1D\xFF\x21\x21\x1B\xFF" + "\x21\x21\x1B\xFF\x23\x21\x1C\xFF\x23\x20\x1B\xFF\x20\x20\x1A\xFF\x21\x1F\x1B\xFF\x24\x21\x1C" + "\xFF\x25\x22\x1D\xFF\x22\x22\x1C\xFF" + "\x23\x21\x1C\xFF\x24\x22\x1D\xFF\x23\x21\x1C\xFF\x21\x1E\x19\xFF\x21\x1F\x1B\xFF\x22\x20\x1B" + "\xFF\x23\x21\x1C\xFF\x22\x20\x1B\xFF" + "\x22\x21\x1C\xFF\x20\x20\x1C\xFF\x1F\x1E\x1A\xFF\x22\x21\x1C\xFF\x22\x21\x1C\xFF\x21\x21\x1B" + "\xFF\x21\x21\x1B\xFF\x24\x22\x1F\xFF" + "\x12\x11\x0F\xFF\x11\x10\x0C\xFF\x11\x10\x0D\xFF\x13\x12\x0F\xFF\x12\x11\x0D\xFF\x12\x11\x0E" + "\xFF\x12\x11\x0F\xFF\x16\x15\x11\xFF" + "\x17\x15\x12\xFF\x12\x10\x0E\xFF\x14\x13\x0F\xFF\x14\x13\x10\xFF\x11\x11\x0D\xFF\x10\x10\x0D" + "\xFF\x13\x13\x0F\xFF\x13\x11\x0F\xFF" + "\x13\x12\x0F\xFF\x15\x13\x11\xFF\x13\x12\x0F\xFF\x10\x0E\x0E\xFF\x11\x0F\x0E\xFF\x13\x11\x10" + "\xFF\x13\x11\x10\xFF\x13\x12\x0F\xFF" + "\x15\x13\x12\xFF\x12\x11\x0E\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x14\x12\x0F\xFF\x15\x13\x11" + "\xFF\x17\x16\x12\xFF\x14\x13\x0F\xFF" + "\x14\x13\x11\xFF\x13\x13\x10\xFF\x14\x13\x10\xFF\x16\x16\x12\xFF\x0F\x0F\x0D\xFF\x11\x10\x0D" + "\xFF\x11\x10\x0D\xFF\x12\x10\x0D\xFF" + "\x12\x10\x0E\xFF\x14\x12\x0F\xFF\x15\x13\x11\xFF\x13\x12\x0E\xFF\x14\x13\x0F\xFF\x17\x15\x12" + "\xFF\x15\x14\x12\xFF\x16\x15\x11\xFF" + "\x15\x14\x10\xFF\x18\x17\x13\xFF\x16\x16\x11\xFF\x15\x14\x10\xFF\x15\x14\x10\xFF\x15\x14\x11" + "\xFF\x14\x12\x11\xFF\x13\x12\x10\xFF" + "\x15\x13\x12\xFF\x18\x17\x13\xFF\x16\x15\x11\xFF\x11\x10\x0D\xFF\x14\x13\x10\xFF\x17\x16\x12" + "\xFF\x14\x13\x0F\xFF\x14\x12\x10\xFF" + "\x16\x15\x11\xFF\x19\x17\x13\xFF\x16\x15\x11\xFF\x14\x12\x10\xFF\x14\x12\x10\xFF\x14\x13\x10" + "\xFF\x15\x13\x10\xFF\x13\x11\x10\xFF" + "\x13\x12\x0F\xFF\x13\x11\x0F\xFF\x12\x10\x0F\xFF\x16\x14\x11\xFF\x12\x11\x0F\xFF\x14\x13\x10" + "\xFF\x17\x17\x12\xFF\x18\x18\x12\xFF" + "\x18\x17\x13\xFF\x15\x14\x11\xFF\x16\x15\x11\xFF\x16\x14\x12\xFF\x15\x13\x10\xFF\x15\x13\x11" + "\xFF\x1A\x19\x15\xFF\x19\x18\x14\xFF" + "\x16\x14\x11\xFF\x14\x13\x10\xFF\x14\x13\x0F\xFF\x13\x12\x0E\xFF\x15\x13\x11\xFF\x14\x13\x10" + "\xFF\x15\x14\x10\xFF\x14\x13\x0F\xFF" + "\x15\x14\x10\xFF\x15\x14\x11\xFF\x16\x15\x11\xFF\x16\x14\x12\xFF\x16\x16\x10\xFF\x16\x15\x11" + "\xFF\x15\x14\x11\xFF\x14\x13\x10\xFF" + "\x15\x14\x10\xFF\x16\x14\x11\xFF\x14\x13\x10\xFF\x14\x13\x10\xFF\x17\x16\x12\xFF\x17\x15\x14" + "\xFF\x13\x12\x0F\xFF\x17\x15\x12\xFF" + "\x1A\x18\x14\xFF\x18\x16\x13\xFF\x18\x16\x13\xFF\x18\x16\x12\xFF\x15\x14\x10\xFF\x12\x11\x0E" + "\xFF\x15\x13\x12\xFF\x17\x16\x13\xFF" + "\x15\x14\x12\xFF\x18\x17\x13\xFF\x18\x16\x14\xFF\x12\x11\x10\xFF\x15\x14\x10\xFF\x18\x16\x13" + "\xFF\x17\x15\x12\xFF\x19\x18\x15\xFF" + "\x17\x16\x12\xFF\x17\x16\x12\xFF\x19\x17\x14\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x17\x16\x12" + "\xFF\x16\x15\x11\xFF\x17\x15\x11\xFF" + "\x16\x15\x11\xFF\x15\x14\x10\xFF\x15\x14\x10\xFF\x18\x16\x12\xFF\x16\x15\x11\xFF\x16\x15\x12" + "\xFF\x19\x18\x14\xFF\x18\x17\x13\xFF" + "\x18\x16\x13\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x14\x13\x0F\xFF\x17\x16\x13\xFF\x18\x17\x13" + "\xFF\x18\x16\x14\xFF\x18\x17\x14\xFF" + "\x16\x15\x11\xFF\x1C\x1A\x16\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF\x1A\x18\x14" + "\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF" + "\x16\x15\x11\xFF\x15\x14\x10\xFF\x17\x16\x12\xFF\x1A\x19\x15\xFF\x19\x18\x14\xFF\x16\x15\x11" + "\xFF\x16\x14\x11\xFF\x16\x15\x11\xFF" + "\x1A\x19\x15\xFF\x15\x14\x11\xFF\x19\x17\x13\xFF\x1E\x1E\x19\xFF\x19\x18\x14\xFF\x1B\x19\x15" + "\xFF\x1C\x1A\x16\xFF\x17\x16\x13\xFF" + "\x16\x14\x12\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF\x19\x18\x14\xFF\x1A\x19\x15\xFF\x1A\x19\x15" + "\xFF\x1A\x19\x15\xFF\x14\x13\x0F\xFF" + "\x16\x15\x11\xFF\x1A\x18\x14\xFF\x18\x16\x12\xFF\x13\x12\x0E\xFF\x16\x16\x12\xFF\x19\x18\x14" + "\xFF\x19\x18\x14\xFF\x1A\x19\x15\xFF" + "\x1C\x1A\x16\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF\x18\x15\x11\xFF\x19\x18\x14\xFF\x1A\x19\x15" + "\xFF\x1B\x1A\x15\xFF\x22\x22\x1D\xFF" + "\x1F\x1D\x18\xFF\x1B\x18\x14\xFF\x1C\x1B\x16\xFF\x19\x18\x14\xFF\x1B\x1A\x16\xFF\x1B\x1A\x16" + "\xFF\x1B\x1A\x15\xFF\x1A\x19\x15\xFF" + "\x1A\x18\x14\xFF\x1C\x1B\x16\xFF\x1C\x1A\x16\xFF\x1C\x19\x15\xFF\x1B\x19\x15\xFF\x19\x18\x14" + "\xFF\x1E\x1C\x18\xFF\x1D\x1A\x16\xFF" + "\x17\x16\x11\xFF\x19\x18\x14\xFF\x18\x17\x13\xFF\x1C\x1B\x17\xFF\x1D\x1C\x17\xFF\x1A\x18\x14" + "\xFF\x19\x17\x14\xFF\x19\x19\x15\xFF" + "\x1B\x1A\x16\xFF\x1C\x1B\x17\xFF\x1E\x1D\x18\xFF\x1C\x1A\x16\xFF\x1A\x18\x14\xFF\x1B\x1A\x16" + "\xFF\x1D\x1C\x17\xFF\x1F\x1E\x19\xFF" + "\x1B\x1A\x16\xFF\x1B\x1A\x16\xFF\x1D\x1C\x17\xFF\x1D\x1B\x17\xFF\x1B\x1A\x16\xFF\x1B\x1A\x16" + "\xFF\x1A\x19\x15\xFF\x1D\x1C\x18\xFF" + "\x1B\x19\x15\xFF\x1C\x1B\x17\xFF\x1C\x1B\x18\xFF\x1A\x1A\x16\xFF\x1E\x1C\x18\xFF\x1E\x1C\x18" + "\xFF\x1F\x1C\x18\xFF\x1F\x1E\x19\xFF" + "\x1C\x1B\x17\xFF\x1B\x1B\x17\xFF\x1A\x19\x15\xFF\x1E\x1C\x18\xFF\x1F\x1F\x19\xFF\x1C\x1C\x17" + "\xFF\x1C\x1A\x18\xFF\x1F\x1C\x19\xFF" + "\x1F\x1D\x18\xFF\x1D\x1C\x18\xFF\x1D\x1B\x17\xFF\x1E\x1D\x19\xFF\x20\x1D\x19\xFF\x1E\x1C\x18" + "\xFF\x1F\x1E\x19\xFF\x1D\x1C\x18\xFF" + "\x1D\x1C\x18\xFF\x22\x21\x1C\xFF\x20\x1F\x1A\xFF\x1F\x1D\x18\xFF\x1C\x1B\x17\xFF\x20\x1F\x19" + "\xFF\x1B\x1B\x16\xFF\x1A\x19\x15\xFF" + "\x1C\x1A\x16\xFF\x1E\x1B\x17\xFF\x1F\x1D\x18\xFF\x1F\x1E\x19\xFF\x21\x1E\x1A\xFF\x1D\x1B\x17" + "\xFF\x1D\x1D\x18\xFF\x1E\x1E\x18\xFF" + "\x1E\x1E\x18\xFF\x1F\x1D\x19\xFF\x1E\x1C\x17\xFF\x1E\x1D\x18\xFF\x1E\x1C\x18\xFF\x1F\x1E\x19" + "\xFF\x1D\x1C\x18\xFF\x1F\x1D\x1A\xFF" + "\x1F\x1E\x18\xFF\x1E\x1D\x18\xFF\x1F\x1E\x19\xFF\x22\x22\x1C\xFF\x1D\x1D\x18\xFF\x1D\x1C\x18" + "\xFF\x20\x1F\x1C\xFF\x1E\x1E\x17\xFF" + "\x1D\x1C\x18\xFF\x1D\x1D\x18\xFF\x20\x21\x1B\xFF\x21\x20\x1B\xFF\x1D\x1C\x18\xFF\x1B\x19\x15" + "\xFF\x1D\x1B\x17\xFF\x20\x1D\x1B\xFF" + "\x1F\x1E\x19\xFF\x1E\x1D\x18\xFF\x20\x1F\x1A\xFF\x1F\x1F\x19\xFF\x22\x20\x1B\xFF\x1F\x1E\x19" + "\xFF\x1E\x1D\x19\xFF\x22\x1F\x1B\xFF" + "\x1E\x1E\x17\xFF\x1C\x1C\x16\xFF\x1B\x1C\x15\xFF\x1D\x1B\x18\xFF\x1E\x1C\x19\xFF\x20\x1E\x19" + "\xFF\x21\x1E\x1A\xFF\x1F\x1D\x18\xFF" + "\x1A\x1A\x15\xFF\x19\x17\x14\xFF\x1B\x1A\x16\xFF\x1B\x19\x15\xFF\x1B\x19\x15\xFF\x18\x18\x14" + "\xFF\x18\x17\x14\xFF\x18\x18\x14\xFF" + "\x19\x17\x14\xFF\x15\x16\x12\xFF\x52\x4E\x42\xFF\x22\x21\x1B\xFF\x22\x20\x1A\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x21\x20\x1B\xFF\x25\x24\x20\xFF\x26\x25\x21" + "\xFF\x23\x22\x1D\xFF\x24\x23\x1E\xFF" + "\x21\x20\x1A\xFF\x26\x25\x20\xFF\x23\x22\x1D\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x20\x1B" + "\xFF\x21\x20\x1A\xFF\x21\x21\x1B\xFF" + "\x26\x25\x20\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x25\x25\x20\xFF" + "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x21\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x28\x26\x22\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x21\x20\x1B" + "\xFF\x26\x25\x21\xFF\x21\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1D\xFF\x23\x22\x1D\xFF" + "\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x24\x22\x1D" + "\xFF\x24\x23\x1F\xFF\x25\x24\x20\xFF" + "\x22\x20\x1B\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x20\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x26\x25\x20\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x26\x25\x20\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF" + "\x28\x26\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1C\xFF\x22\x21\x1B\xFF\x21\x20\x1A\xFF\x24\x23\x1E" + "\xFF\x29\x28\x23\xFF\x25\x24\x20\xFF" + "\x24\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x23\x21\x1C\xFF\x23\x21\x1C\xFF" + "\x24\x23\x1E\xFF\x22\x20\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x22\x22\x1C\xFF\x26\x25\x20\xFF\x22\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B" + "\xFF\x21\x21\x1B\xFF\x26\x25\x20\xFF" + "\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF\x22\x21\x1B" + "\xFF\x22\x22\x1C\xFF\x26\x25\x21\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x21\x1C\xFF\x23\x22\x1C\xFF\x26\x25\x21\xFF\x25\x24\x20" + "\xFF\x25\x24\x1F\xFF\x24\x22\x1D\xFF" + "\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" + "\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x25\x25\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x24\x20" + "\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF" + "\x23\x21\x1C\xFF\x23\x23\x1E\xFF\x23\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF" + "\x23\x21\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x28\x26\x21" + "\xFF\x25\x23\x1F\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1D\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x23\x1E\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x26\x25\x20" + "\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x26\x25\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x1F" + "\xFF\x25\x24\x1F\xFF\x26\x24\x20\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x21\x1C\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x26\x25\x21" + "\xFF\x24\x23\x1E\xFF\x25\x24\x1F\xFF" + "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x26\x25\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x25\x25\x20\xFF" + "\x23\x22\x1C\xFF\x27\x25\x20\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x28\x26\x22\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B" + "\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF" + "\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x24\x23\x1E" + "\xFF\x25\x24\x1F\xFF\x26\x24\x20\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x27\x25\x20\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x27\x26\x21\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x26\x26\x20\xFF" + "\x28\x26\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E" + "\xFF\x29\x28\x23\xFF\x25\x25\x20\xFF" + "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" + "\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x22\x22\x1C\xFF\x27\x26\x20\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF" + "\x22\x21\x1B\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x26\x24\x20\xFF\x23\x22\x1C" + "\xFF\x22\x22\x1C\xFF\x26\x25\x21\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x27\x26\x22\xFF\x26\x26\x22" + "\xFF\x26\x27\x21\xFF\x26\x2A\x23\xFF" + "\x26\x2E\x26\xFF\x26\x2F\x25\xFF\x27\x31\x27\xFF\x27\x31\x27\xFF\x28\x33\x28\xFF\x27\x32\x27" + "\xFF\x27\x32\x27\xFF\x29\x34\x2A\xFF" + "\x27\x32\x27\xFF\x2A\x35\x2B\xFF\x2A\x36\x2C\xFF\x28\x33\x28\xFF\x27\x32\x27\xFF\x2A\x35\x2C" + "\xFF\x27\x32\x27\xFF\x2D\x37\x2D\xFF" + "\x28\x33\x28\xFF\x28\x34\x2A\xFF\x28\x34\x2A\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x27\x32\x27" + "\xFF\x2B\x36\x2C\xFF\x27\x32\x27\xFF" + "\x28\x33\x28\xFF\x27\x32\x27\xFF\x28\x33\x28\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x2D\x37\x2D" + "\xFF\x2A\x35\x2C\xFF\x27\x32\x27\xFF" + "\x27\x32\x27\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x28\x33\x28\xFF\x29\x34\x2A\xFF\x4F\x4D\x3F" + "\xFF\x3A\x8B\x67\xFF\x3B\x8C\x68\xFF" + "\x3E\x93\x6D\xFF\x40\x98\x71\xFF\x42\x9A\x72\xFF\x42\x9A\x72\xFF\x42\x97\x70\xFF\x41\x93\x6D" + "\xFF\x3E\x87\x64\xFF\x3B\x75\x56\xFF" + "\x32\x51\x3F\xFF\x29\x37\x2C\xFF\x29\x31\x28\xFF\x27\x2C\x24\xFF\x26\x29\x21\xFF\x28\x28\x22" + "\xFF\x27\x27\x20\xFF\x27\x27\x21\xFF" + "\x29\x2F\x25\xFF\x3C\x73\x56\xFF\x55\xC9\x94\xFF\x56\xCC\x96\xFF\x56\xCB\x97\xFF\x54\xC5\x92" + "\xFF\x52\xBD\x8C\xFF\x50\xB5\x86\xFF" + "\x4D\xAA\x7F\xFF\x48\x99\x71\xFF\x40\x80\x61\xFF\x37\x66\x4D\xFF\x2F\x48\x38\xFF\x2C\x38\x2C" + "\xFF\x2B\x33\x29\xFF\x2A\x2E\x26\xFF" + "\x27\x29\x23\xFF\x27\x27\x21\xFF\x27\x27\x21\xFF\x27\x26\x20\xFF\x26\x25\x1F\xFF\x26\x25\x1F" + "\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF" + "\x27\x26\x20\xFF\x28\x26\x20\xFF\x28\x25\x20\xFF\x28\x27\x20\xFF\x27\x25\x1F\xFF\x27\x25\x20" + "\xFF\x27\x25\x1F\xFF\x28\x26\x20\xFF" + "\x25\x23\x1E\xFF\x26\x24\x1E\xFF\x25\x23\x1D\xFF\x27\x25\x1F\xFF\x26\x24\x1E\xFF\x26\x23\x1E" + "\xFF\x29\x26\x21\xFF\x28\x25\x20\xFF" + "\x26\x25\x1F\xFF\x27\x25\x1F\xFF\x25\x25\x1F\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x26\x25\x1F" + "\xFF\x25\x23\x1D\xFF\x27\x24\x1F\xFF" + "\x25\x24\x1F\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x27\x24\x1E\xFF\x26\x26\x1E\xFF\x27\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" + "\x29\x26\x20\xFF\x28\x25\x20\xFF\x27\x26\x1E\xFF\x26\x24\x1E\xFF\x28\x26\x21\xFF\x27\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" + "\x28\x25\x20\xFF\x27\x24\x1F\xFF\x27\x26\x20\xFF\x27\x25\x1F\xFF\x28\x26\x20\xFF\x26\x23\x1E" + "\xFF\x25\x24\x1D\xFF\x26\x24\x1E\xFF" + "\x26\x24\x1F\xFF\x22\x21\x1B\xFF\x23\x23\x1D\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x26\x23\x1E" + "\xFF\x27\x24\x1E\xFF\x27\x24\x1F\xFF" + "\x27\x25\x1E\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x26\x23\x1F\xFF\x27\x24\x1F\xFF\x25\x23\x1E" + "\xFF\x24\x23\x1D\xFF\x21\x21\x1C\xFF" + "\x26\x23\x1F\xFF\x26\x23\x1F\xFF\x26\x23\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x24\x1E" + "\xFF\x26\x24\x1E\xFF\x24\x24\x1D\xFF" + "\x25\x24\x1E\xFF\x26\x24\x1F\xFF\x27\x26\x1F\xFF\x25\x22\x1D\xFF\x25\x22\x1D\xFF\x26\x24\x1E" + "\xFF\x26\x24\x1E\xFF\x26\x24\x1F\xFF" + "\x26\x24\x1F\xFF\x24\x21\x1C\xFF\x23\x22\x1C\xFF\x23\x23\x1D\xFF\x27\x25\x20\xFF\x26\x25\x1F" + "\xFF\x27\x26\x20\xFF\x27\x27\x1F\xFF" + "\x29\x26\x21\xFF\x26\x25\x1F\xFF\x23\x23\x1D\xFF\x24\x22\x1D\xFF\x22\x21\x1B\xFF\x23\x21\x1D" + "\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF" + "\x25\x24\x1F\xFF\x27\x25\x21\xFF\x25\x24\x1F\xFF\x28\x25\x20\xFF\x27\x26\x1F\xFF\x26\x23\x1E" + "\xFF\x25\x22\x1D\xFF\x26\x26\x20\xFF" + "\x2A\x37\x2D\xFF\x42\x87\x66\xFF\x56\xCD\x98\xFF\x56\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x52\xBF\x8E" + "\xFF\x37\x66\x4D\xFF\x28\x2C\x25\xFF" + "\x26\x26\x21\xFF\x27\x24\x1F\xFF\x24\x23\x1E\xFF\x24\x22\x1D\xFF\x27\x24\x1F\xFF\x26\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x25\x22\x1D\xFF" + "\x22\x22\x1C\xFF\x23\x21\x1C\xFF\x26\x23\x1E\xFF\x24\x23\x1D\xFF\x25\x22\x1C\xFF\x23\x21\x1C" + "\xFF\x28\x27\x20\xFF\x2B\x31\x27\xFF" + "\x3E\x79\x5B\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCC\x97\xFF\x57\xCD\x97" + "\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF" + "\x54\xC4\x91\xFF\x3E\x79\x5B\xFF\x29\x30\x28\xFF\x25\x25\x1F\xFF\x25\x24\x1E\xFF\x27\x24\x1E" + "\xFF\x24\x23\x1D\xFF\x25\x23\x1F\xFF" + "\x25\x22\x1D\xFF\x26\x24\x1E\xFF\x24\x22\x1D\xFF\x22\x22\x1C\xFF\x22\x1F\x1A\xFF\x23\x21\x1C" + "\xFF\x23\x21\x1C\xFF\x27\x24\x1F\xFF" + "\x27\x26\x21\xFF\x27\x24\x1F\xFF\x24\x21\x1C\xFF\x22\x21\x1C\xFF\x24\x23\x1D\xFF\x23\x20\x1B" + "\xFF\x24\x23\x1D\xFF\x24\x23\x1E\xFF" + "\x25\x24\x1E\xFF\x26\x25\x1F\xFF\x26\x25\x1F\xFF\x28\x26\x21\xFF\x27\x24\x1F\xFF\x25\x23\x1E" + "\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF" + "\x26\x23\x1E\xFF\x24\x21\x1C\xFF\x24\x23\x1D\xFF\x22\x22\x1C\xFF\x22\x20\x1A\xFF\x22\x21\x1B" + "\xFF\x24\x24\x1D\xFF\x25\x23\x1E\xFF" + "\x24\x23\x1E\xFF\x25\x23\x1E\xFF\x23\x22\x1D\xFF\x21\x20\x1B\xFF\x25\x23\x1E\xFF\x24\x23\x1D" + "\xFF\x23\x22\x1C\xFF\x25\x22\x1D\xFF" + "\x23\x21\x1C\xFF\x22\x22\x1D\xFF\x23\x22\x1D\xFF\x27\x25\x20\xFF\x23\x22\x1D\xFF\x26\x22\x1F" + "\xFF\x23\x20\x1D\xFF\x24\x21\x1D\xFF" + "\x25\x22\x1D\xFF\x24\x23\x1E\xFF\x20\x1F\x1A\xFF\x20\x1E\x19\xFF\x23\x22\x1D\xFF\x23\x22\x1B" + "\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" + "\x24\x22\x1D\xFF\x24\x23\x1D\xFF\x24\x23\x1D\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x25\x22\x1E" + "\xFF\x21\x20\x1B\xFF\x21\x21\x1B\xFF" + "\x20\x20\x1A\xFF\x24\x23\x1D\xFF\x25\x24\x1E\xFF\x26\x24\x1F\xFF\x22\x1F\x1A\xFF\x24\x21\x1C" + "\xFF\x23\x20\x1C\xFF\x20\x1F\x1A\xFF" + "\x24\x22\x1D\xFF\x23\x21\x1C\xFF\x24\x22\x1C\xFF\x24\x21\x1C\xFF\x22\x22\x1C\xFF\x22\x22\x1C" + "\xFF\x24\x21\x1C\xFF\x23\x21\x1C\xFF" + "\x23\x22\x1C\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x25\x22\x1D\xFF\x25\x22\x1D\xFF\x24\x21\x1C" + "\xFF\x22\x20\x1B\xFF\x21\x21\x1B\xFF" + "\x23\x21\x1C\xFF\x23\x21\x1C\xFF\x20\x1E\x19\xFF\x21\x1E\x1A\xFF\x23\x22\x1D\xFF\x26\x24\x1E" + "\xFF\x23\x23\x1C\xFF\x23\x21\x1C\xFF" + "\x22\x20\x1C\xFF\x22\x21\x1C\xFF\x23\x20\x1C\xFF\x24\x22\x1D\xFF\x24\x22\x1C\xFF\x22\x20\x1C" + "\xFF\x22\x20\x1B\xFF\x22\x22\x1C\xFF" + "\x22\x20\x1B\xFF\x22\x20\x1B\xFF\x25\x23\x1D\xFF\x26\x23\x1E\xFF\x21\x21\x1C\xFF\x20\x1F\x1A" + "\xFF\x20\x1F\x1B\xFF\x1F\x1E\x1A\xFF" + "\x22\x1F\x1A\xFF\x27\x25\x1F\xFF\x23\x22\x1D\xFF\x22\x23\x1B\xFF\x25\x22\x1D\xFF\x27\x24\x1F" + "\xFF\x24\x22\x1D\xFF\x23\x23\x1D\xFF" + "\x25\x23\x1D\xFF\x23\x22\x1C\xFF\x24\x22\x1D\xFF\x26\x23\x1C\xFF\x24\x21\x1D\xFF\x22\x20\x1B" + "\xFF\x20\x1E\x1B\xFF\x1D\x1C\x18\xFF" + "\x20\x20\x1A\xFF\x20\x1F\x1A\xFF\x1F\x1D\x19\xFF\x20\x1F\x1A\xFF\x23\x22\x1D\xFF\x23\x22\x1D" + "\xFF\x23\x22\x1D\xFF\x23\x22\x1C\xFF" + "\x13\x12\x0F\xFF\x13\x12\x0E\xFF\x13\x12\x0F\xFF\x12\x10\x0E\xFF\x12\x11\x0F\xFF\x13\x12\x0E" + "\xFF\x14\x13\x0F\xFF\x13\x12\x0E\xFF" + "\x14\x12\x0F\xFF\x12\x11\x0E\xFF\x12\x10\x0E\xFF\x12\x11\x0E\xFF\x13\x11\x0E\xFF\x17\x13\x10" + "\xFF\x13\x12\x0E\xFF\x0E\x0D\x0A\xFF" + "\x0E\x0E\x0C\xFF\x0F\x0F\x0D\xFF\x11\x10\x0D\xFF\x13\x11\x0F\xFF\x0F\x10\x0E\xFF\x11\x10\x0F" + "\xFF\x13\x11\x10\xFF\x13\x12\x10\xFF" + "\x11\x10\x0D\xFF\x12\x11\x0E\xFF\x14\x12\x10\xFF\x14\x12\x10\xFF\x10\x0F\x0D\xFF\x13\x11\x0F" + "\xFF\x14\x13\x10\xFF\x13\x12\x10\xFF" + "\x15\x13\x0F\xFF\x14\x12\x0F\xFF\x12\x10\x0E\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x14\x12\x10" + "\xFF\x13\x11\x0E\xFF\x12\x11\x0F\xFF" + "\x11\x10\x0C\xFF\x14\x13\x0F\xFF\x14\x13\x0F\xFF\x14\x12\x10\xFF\x15\x14\x10\xFF\x15\x14\x10" + "\xFF\x15\x13\x10\xFF\x14\x13\x0F\xFF" + "\x12\x11\x0E\xFF\x13\x12\x0E\xFF\x15\x13\x10\xFF\x12\x11\x0D\xFF\x17\x16\x12\xFF\x17\x16\x13" + "\xFF\x12\x10\x0F\xFF\x14\x13\x0F\xFF" + "\x13\x13\x0F\xFF\x14\x14\x11\xFF\x14\x14\x11\xFF\x13\x12\x0E\xFF\x15\x13\x12\xFF\x14\x13\x10" + "\xFF\x13\x12\x0F\xFF\x15\x13\x11\xFF" + "\x18\x17\x13\xFF\x14\x13\x10\xFF\x17\x16\x13\xFF\x17\x16\x12\xFF\x16\x15\x12\xFF\x14\x12\x10" + "\xFF\x15\x15\x11\xFF\x12\x11\x0D\xFF" + "\x13\x10\x0F\xFF\x13\x12\x0F\xFF\x12\x11\x0D\xFF\x12\x13\x10\xFF\x11\x0F\x0D\xFF\x13\x12\x0E" + "\xFF\x14\x13\x0F\xFF\x12\x11\x0E\xFF" + "\x12\x11\x0D\xFF\x13\x12\x0F\xFF\x14\x12\x0F\xFF\x11\x10\x0D\xFF\x14\x13\x10\xFF\x13\x11\x10" + "\xFF\x11\x10\x0D\xFF\x15\x14\x10\xFF" + "\x18\x16\x14\xFF\x17\x17\x12\xFF\x14\x13\x0F\xFF\x15\x14\x11\xFF\x19\x18\x14\xFF\x16\x15\x11" + "\xFF\x17\x16\x11\xFF\x15\x14\x10\xFF" + "\x19\x17\x15\xFF\x1B\x1B\x16\xFF\x19\x18\x13\xFF\x16\x15\x13\xFF\x14\x13\x0F\xFF\x15\x14\x10" + "\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF" + "\x16\x14\x12\xFF\x15\x14\x10\xFF\x15\x13\x11\xFF\x14\x13\x0F\xFF\x18\x17\x13\xFF\x17\x16\x12" + "\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF" + "\x17\x16\x12\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x15\x14\x10" + "\xFF\x14\x13\x0F\xFF\x16\x15\x11\xFF" + "\x19\x17\x14\xFF\x16\x15\x12\xFF\x15\x14\x10\xFF\x15\x14\x10\xFF\x17\x16\x12\xFF\x17\x15\x13" + "\xFF\x18\x17\x12\xFF\x1B\x1A\x16\xFF" + "\x18\x15\x11\xFF\x14\x13\x0F\xFF\x17\x15\x11\xFF\x15\x13\x10\xFF\x15\x14\x10\xFF\x17\x15\x11" + "\xFF\x14\x13\x0F\xFF\x17\x16\x12\xFF" + "\x18\x17\x13\xFF\x16\x14\x12\xFF\x15\x14\x11\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF\x16\x15\x12" + "\xFF\x18\x17\x14\xFF\x16\x15\x11\xFF" + "\x17\x16\x12\xFF\x19\x18\x14\xFF\x19\x18\x14\xFF\x15\x13\x11\xFF\x1B\x1A\x16\xFF\x1A\x19\x15" + "\xFF\x1B\x1A\x16\xFF\x19\x18\x14\xFF" + "\x19\x18\x14\xFF\x1A\x19\x15\xFF\x17\x16\x12\xFF\x13\x12\x0E\xFF\x1C\x1A\x16\xFF\x1B\x19\x15" + "\xFF\x1A\x19\x15\xFF\x16\x14\x10\xFF" + "\x14\x13\x10\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF\x19\x18\x14" + "\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF" + "\x16\x15\x11\xFF\x16\x15\x11\xFF\x1B\x19\x15\xFF\x1B\x19\x15\xFF\x17\x16\x12\xFF\x17\x16\x12" + "\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF" + "\x1A\x19\x15\xFF\x19\x18\x14\xFF\x1B\x18\x16\xFF\x1C\x19\x16\xFF\x18\x17\x13\xFF\x18\x17\x13" + "\xFF\x19\x18\x13\xFF\x19\x17\x13\xFF" + "\x1B\x18\x14\xFF\x19\x16\x14\xFF\x16\x15\x11\xFF\x17\x16\x13\xFF\x19\x17\x13\xFF\x19\x18\x13" + "\xFF\x18\x17\x13\xFF\x17\x15\x11\xFF" + "\x16\x15\x12\xFF\x16\x16\x12\xFF\x18\x18\x13\xFF\x1B\x1A\x16\xFF\x1D\x1C\x17\xFF\x1A\x17\x13" + "\xFF\x1B\x19\x15\xFF\x1A\x18\x14\xFF" + "\x1A\x19\x15\xFF\x19\x18\x14\xFF\x19\x18\x14\xFF\x1A\x19\x15\xFF\x19\x18\x14\xFF\x18\x17\x13" + "\xFF\x19\x18\x14\xFF\x19\x17\x13\xFF" + "\x19\x18\x14\xFF\x1D\x1B\x17\xFF\x1C\x1B\x17\xFF\x1C\x1A\x16\xFF\x17\x16\x14\xFF\x1B\x1A\x16" + "\xFF\x1A\x19\x15\xFF\x1D\x1B\x17\xFF" + "\x1C\x1B\x17\xFF\x1C\x1A\x16\xFF\x1C\x1A\x16\xFF\x1C\x1A\x16\xFF\x1A\x19\x15\xFF\x19\x18\x14" + "\xFF\x17\x16\x12\xFF\x1A\x19\x15\xFF" + "\x1D\x1C\x17\xFF\x1B\x1A\x16\xFF\x1D\x1C\x18\xFF\x19\x18\x14\xFF\x19\x18\x14\xFF\x1A\x18\x14" + "\xFF\x1C\x1B\x17\xFF\x1A\x19\x15\xFF" + "\x1A\x1A\x16\xFF\x1C\x1B\x16\xFF\x1D\x1C\x18\xFF\x1B\x1A\x17\xFF\x1F\x1F\x19\xFF\x1C\x1C\x17" + "\xFF\x1D\x1B\x17\xFF\x1A\x19\x15\xFF" + "\x18\x19\x14\xFF\x1B\x19\x16\xFF\x1A\x19\x15\xFF\x1A\x1A\x16\xFF\x1C\x1B\x17\xFF\x1C\x1C\x17" + "\xFF\x1D\x1C\x16\xFF\x1E\x1D\x18\xFF" + "\x20\x1E\x19\xFF\x1E\x1B\x17\xFF\x1B\x19\x14\xFF\x1D\x1B\x17\xFF\x1F\x1E\x1A\xFF\x1B\x1A\x16" + "\xFF\x1D\x1C\x17\xFF\x1D\x1D\x17\xFF" + "\x1B\x1A\x16\xFF\x1C\x1B\x16\xFF\x1B\x1A\x15\xFF\x1F\x1F\x1A\xFF\x20\x1D\x19\xFF\x1E\x1C\x18" + "\xFF\x1E\x1C\x17\xFF\x1B\x1A\x16\xFF" + "\x1C\x1B\x17\xFF\x1C\x1C\x17\xFF\x1E\x1F\x19\xFF\x1F\x1D\x18\xFF\x1D\x1B\x19\xFF\x1D\x1C\x17" + "\xFF\x1D\x1C\x17\xFF\x1D\x1B\x17\xFF" + "\x1B\x1A\x17\xFF\x1D\x1D\x18\xFF\x1D\x1C\x17\xFF\x1E\x1D\x18\xFF\x1C\x1C\x17\xFF\x1E\x1C\x18" + "\xFF\x20\x1E\x1A\xFF\x1F\x1E\x19\xFF" + "\x1F\x1E\x19\xFF\x1D\x1C\x18\xFF\x1E\x1C\x18\xFF\x1F\x1D\x19\xFF\x1A\x19\x15\xFF\x1C\x1B\x16" + "\xFF\x1E\x1D\x19\xFF\x22\x21\x1B\xFF" + "\x20\x1F\x19\xFF\x1E\x1E\x18\xFF\x1E\x1E\x18\xFF\x1E\x1E\x18\xFF\x20\x20\x1A\xFF\x1C\x1A\x16" + "\xFF\x1D\x1B\x17\xFF\x1F\x1E\x19\xFF" + "\x20\x1F\x1A\xFF\x1F\x1C\x18\xFF\x20\x1E\x19\xFF\x21\x21\x1B\xFF\x1F\x1E\x19\xFF\x1D\x1D\x18" + "\xFF\x1C\x1B\x16\xFF\x1E\x1D\x18\xFF" + "\x1D\x1C\x18\xFF\x20\x20\x1A\xFF\x1E\x1D\x18\xFF\x1E\x1E\x19\xFF\x22\x20\x1C\xFF\x22\x1F\x1A" + "\xFF\x1E\x1C\x17\xFF\x20\x1D\x18\xFF" + "\x20\x1E\x1A\xFF\x1F\x1D\x19\xFF\x1F\x1E\x19\xFF\x20\x1F\x1B\xFF\x1F\x1E\x18\xFF\x1F\x1C\x17" + "\xFF\x1A\x19\x15\xFF\x1C\x1B\x16\xFF" + "\x1D\x1B\x18\xFF\x1C\x1B\x18\xFF\x1C\x1A\x16\xFF\x1A\x18\x15\xFF\x1C\x19\x15\xFF\x1B\x1B\x17" + "\xFF\x1A\x19\x15\xFF\x16\x16\x13\xFF" + "\x18\x15\x12\xFF\x14\x13\x10\xFF\x4F\x4B\x3F\xFF\x23\x22\x1D\xFF\x26\x25\x21\xFF\x21\x21\x1B" + "\xFF\x26\x25\x20\xFF\x22\x20\x1A\xFF" + "\x22\x21\x1B\xFF\x21\x20\x1A\xFF\x28\x26\x21\xFF\x21\x20\x1A\xFF\x23\x22\x1D\xFF\x26\x25\x20" + "\xFF\x24\x23\x1E\xFF\x25\x24\x20\xFF" + "\x29\x28\x22\xFF\x25\x24\x20\xFF\x22\x20\x1B\xFF\x23\x22\x1C\xFF\x21\x20\x1B\xFF\x21\x20\x1B" + "\xFF\x21\x20\x1B\xFF\x21\x20\x1B\xFF" + "\x22\x21\x1B\xFF\x29\x28\x22\xFF\x21\x20\x1B\xFF\x21\x21\x1B\xFF\x21\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x25\x24\x20\xFF\x2A\x29\x23\xFF" + "\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x28\x26\x22\xFF\x21\x20\x1A\xFF\x21\x20\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x25\x24\x20\xFF\x26\x25\x20\xFF\x25\x25\x20\xFF\x21\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B" + "\xFF\x25\x24\x20\xFF\x28\x26\x21\xFF" + "\x28\x26\x21\xFF\x25\x25\x20\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x25\x23\x1E\xFF\x24\x23\x1E" + "\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF" + "\x26\x25\x20\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x26\x25\x21\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1C\xFF\x22\x21\x1B\xFF" + "\x28\x26\x21\xFF\x21\x21\x1B\xFF\x25\x24\x20\xFF\x24\x23\x1E\xFF\x27\x25\x21\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF" + "\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20" + "\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" + "\x26\x25\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x24\x22\x1D\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1C\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x23\x22\x1C" + "\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x29\x28\x23\xFF\x22\x21\x1B" + "\xFF\x25\x24\x20\xFF\x25\x24\x20\xFF" + "\x23\x22\x1C\xFF\x25\x24\x20\xFF\x24\x23\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x20\x1B" + "\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" + "\x26\x25\x21\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x25\x24\x20\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x24\x23\x1E\xFF\x28\x26\x21\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF\x24\x24\x1E" + "\xFF\x26\x25\x20\xFF\x24\x23\x1E\xFF" + "\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x25\x23\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" + "\x26\x25\x20\xFF\x25\x24\x1F\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1D" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x25\x24\x1E\xFF\x29\x28\x22\xFF\x24\x23\x1E\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF" + "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x24\x20" + "\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF" + "\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x28\x26\x21\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x28\x26\x21\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x24\x23\x1F\xFF" + "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x26\x25\x21\xFF\x22\x21\x1B" + "\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF\x24\x22\x1E\xFF\x26\x25\x20" + "\xFF\x25\x24\x1F\xFF\x26\x25\x21\xFF" + "\x29\x28\x22\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x22\x1C\xFF\x23\x22\x1C" + "\xFF\x25\x24\x20\xFF\x2A\x29\x23\xFF" + "\x24\x22\x1D\xFF\x23\x22\x1C\xFF\x28\x26\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x25\x24\x20\xFF\x26\x25\x20\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B" + "\xFF\x26\x25\x20\xFF\x29\x27\x22\xFF" + "\x29\x26\x21\xFF\x26\x26\x21\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x25\x23\x1E\xFF\x25\x24\x1E" + "\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF" + "\x27\x25\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x24\x20\xFF\x26\x25\x21\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" + "\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x22\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" + "\x28\x26\x21\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x24\x23\x1E\xFF\x26\x25\x21\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x28\x26\x21\xFF" + "\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x21" + "\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" + "\x26\x25\x20\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x26\x25\x21\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF\x23\x22\x1C\xFF\x23\x22\x1C" + "\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x29\x28\x23\xFF\x22\x21\x1B" + "\xFF\x26\x25\x20\xFF\x26\x25\x20\xFF" + "\x23\x22\x1C\xFF\x26\x25\x21\xFF\x25\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" + "\x27\x26\x22\xFF\x22\x22\x1C\xFF\x29\x29\x23\xFF\x23\x26\x1F\xFF\x29\x2F\x27\xFF\x26\x2F\x25" + "\xFF\x27\x31\x27\xFF\x27\x32\x27\xFF" + "\x2A\x35\x2C\xFF\x27\x32\x27\xFF\x2A\x35\x2C\xFF\x29\x34\x2A\xFF\x2D\x37\x2D\xFF\x27\x32\x27" + "\xFF\x27\x32\x27\xFF\x28\x33\x28\xFF" + "\x27\x32\x27\xFF\x27\x32\x27\xFF\x2A\x35\x2C\xFF\x27\x32\x27\xFF\x2A\x35\x2C\xFF\x29\x35\x2B" + "\xFF\x2A\x35\x2C\xFF\x29\x34\x2B\xFF" + "\x29\x34\x2A\xFF\x29\x34\x2A\xFF\x29\x35\x2B\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x28\x33\x28" + "\xFF\x27\x32\x27\xFF\x29\x35\x2B\xFF" + "\x2B\x36\x2C\xFF\x2A\x35\x2B\xFF\x2A\x35\x2C\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x29\x34\x2A" + "\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF" + "\x2A\x35\x2B\xFF\x2E\x39\x2E\xFF\x2A\x35\x2B\xFF\x29\x34\x2A\xFF\x28\x33\x28\xFF\x4F\x4D\x3F" + "\xFF\x3B\x8B\x67\xFF\x3B\x8C\x68\xFF" + "\x3E\x93\x6D\xFF\x41\x99\x71\xFF\x43\x9F\x76\xFF\x45\xA4\x7A\xFF\x48\xAA\x7E\xFF\x49\xAE\x81" + "\xFF\x4B\xB2\x84\xFF\x4C\xB6\x87\xFF" + "\x4E\xBA\x89\xFF\x4D\xB3\x83\xFF\x45\x97\x70\xFF\x3D\x79\x5B\xFF\x35\x58\x44\xFF\x30\x48\x39" + "\xFF\x2D\x3A\x2F\xFF\x29\x31\x27\xFF" + "\x2B\x37\x2C\xFF\x3E\x79\x5B\xFF\x56\xCA\x95\xFF\x56\xCC\x96\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x52\xBC\x8B" + "\xFF\x49\x9D\x76\xFF\x3E\x7A\x5C\xFF" + "\x36\x5C\x47\xFF\x31\x4C\x3B\xFF\x2D\x3D\x2F\xFF\x29\x30\x28\xFF\x27\x2B\x23\xFF\x27\x29\x22" + "\xFF\x27\x28\x21\xFF\x28\x27\x21\xFF" + "\x27\x25\x20\xFF\x27\x24\x1F\xFF\x24\x24\x1E\xFF\x25\x23\x1F\xFF\x28\x25\x20\xFF\x29\x26\x20" + "\xFF\x27\x25\x20\xFF\x28\x25\x20\xFF" + "\x26\x23\x1F\xFF\x27\x24\x1F\xFF\x29\x27\x21\xFF\x2A\x27\x21\xFF\x27\x24\x1F\xFF\x25\x24\x1E" + "\xFF\x24\x24\x1F\xFF\x26\x24\x1F\xFF" + "\x28\x25\x1F\xFF\x27\x25\x1E\xFF\x27\x25\x20\xFF\x25\x25\x1F\xFF\x29\x26\x21\xFF\x27\x27\x20" + "\xFF\x26\x25\x1F\xFF\x25\x23\x1E\xFF" + "\x26\x23\x1E\xFF\x23\x23\x1D\xFF\x26\x25\x1E\xFF\x27\x24\x1E\xFF\x25\x22\x1E\xFF\x27\x24\x1F" + "\xFF\x29\x26\x21\xFF\x26\x26\x1E\xFF" + "\x28\x27\x21\xFF\x28\x26\x21\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x25\x23\x1E" + "\xFF\x25\x23\x1F\xFF\x27\x24\x1F\xFF" + "\x27\x24\x1D\xFF\x29\x26\x20\xFF\x27\x26\x20\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x26\x23\x1E" + "\xFF\x25\x24\x1D\xFF\x26\x26\x20\xFF" + "\x25\x22\x1D\xFF\x26\x25\x1E\xFF\x27\x24\x1F\xFF\x25\x22\x1D\xFF\x27\x25\x1F\xFF\x27\x24\x1D" + "\xFF\x24\x22\x1D\xFF\x24\x22\x1D\xFF" + "\x26\x24\x1E\xFF\x25\x24\x1E\xFF\x27\x25\x1F\xFF\x28\x24\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x20" + "\xFF\x27\x24\x1F\xFF\x29\x28\x20\xFF" + "\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x24\x23\x1D\xFF\x25\x24\x1E\xFF\x25\x22\x1D\xFF\x25\x23\x1E" + "\xFF\x26\x24\x1F\xFF\x26\x24\x1E\xFF" + "\x22\x23\x1D\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x25\x24\x1F\xFF\x24\x23\x1E\xFF\x26\x23\x1E" + "\xFF\x27\x25\x20\xFF\x25\x24\x1E\xFF" + "\x27\x25\x20\xFF\x26\x23\x1E\xFF\x25\x23\x1E\xFF\x24\x21\x1C\xFF\x25\x24\x1E\xFF\x24\x24\x1E" + "\xFF\x23\x23\x1D\xFF\x25\x23\x1E\xFF" + "\x26\x25\x1F\xFF\x23\x21\x1C\xFF\x24\x23\x1D\xFF\x26\x24\x1F\xFF\x23\x22\x1D\xFF\x23\x21\x1C" + "\xFF\x25\x23\x1E\xFF\x28\x25\x20\xFF" + "\x28\x26\x1F\xFF\x28\x25\x1E\xFF\x25\x24\x1D\xFF\x26\x25\x20\xFF\x24\x22\x1E\xFF\x25\x23\x1E" + "\xFF\x24\x21\x1D\xFF\x26\x23\x1E\xFF" + "\x27\x2D\x26\xFF\x39\x6A\x50\xFF\x53\xC1\x90\xFF\x58\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98" + "\xFF\x41\x85\x65\xFF\x2A\x35\x2C\xFF" + "\x27\x27\x21\xFF\x26\x25\x1F\xFF\x24\x23\x1E\xFF\x25\x22\x1D\xFF\x26\x22\x1F\xFF\x24\x23\x1E" + "\xFF\x24\x24\x1E\xFF\x22\x21\x1C\xFF" + "\x20\x20\x1A\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x29\x26\x21\xFF\x27\x24\x1F\xFF\x26\x25\x1E" + "\xFF\x27\x27\x1F\xFF\x27\x2A\x24\xFF" + "\x31\x52\x3E\xFF\x51\xBA\x8A\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x97" + "\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF" + "\x56\xCC\x97\xFF\x48\x9C\x75\xFF\x2D\x3E\x31\xFF\x27\x28\x22\xFF\x25\x22\x1E\xFF\x25\x23\x1E" + "\xFF\x25\x23\x1E\xFF\x27\x24\x1F\xFF" + "\x28\x26\x20\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x24\x23\x1E\xFF\x26\x23\x1E\xFF\x25\x24\x1E" + "\xFF\x25\x22\x1E\xFF\x25\x22\x1E\xFF" + "\x27\x24\x1F\xFF\x25\x22\x1D\xFF\x24\x22\x1E\xFF\x22\x22\x1D\xFF\x24\x23\x1D\xFF\x21\x21\x1B" + "\xFF\x1F\x1E\x19\xFF\x23\x20\x1B\xFF" + "\x20\x1F\x1A\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF\x24\x21\x1D\xFF\x23\x23\x1D\xFF\x24\x23\x1D" + "\xFF\x23\x21\x1C\xFF\x24\x21\x1C\xFF" + "\x27\x24\x1F\xFF\x24\x22\x1D\xFF\x22\x21\x1B\xFF\x26\x23\x1E\xFF\x26\x25\x1E\xFF\x23\x23\x1D" + "\xFF\x25\x22\x1D\xFF\x28\x24\x20\xFF" + "\x24\x21\x1F\xFF\x26\x24\x1F\xFF\x25\x24\x1E\xFF\x23\x23\x1D\xFF\x23\x21\x1C\xFF\x24\x21\x1C" + "\xFF\x24\x21\x1C\xFF\x21\x20\x1A\xFF" + "\x22\x21\x1B\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF\x23\x21\x1F\xFF\x23\x21\x1C\xFF\x23\x22\x1C" + "\xFF\x24\x23\x1E\xFF\x23\x21\x1C\xFF" + "\x24\x24\x1E\xFF\x23\x23\x1D\xFF\x21\x21\x1B\xFF\x24\x23\x1D\xFF\x22\x22\x1C\xFF\x25\x23\x1E" + "\xFF\x24\x21\x1C\xFF\x21\x1D\x1A\xFF" + "\x23\x22\x1D\xFF\x25\x22\x1D\xFF\x21\x20\x1B\xFF\x21\x1F\x1B\xFF\x21\x1F\x1B\xFF\x25\x23\x1E" + "\xFF\x24\x21\x1D\xFF\x24\x23\x1D\xFF" + "\x26\x24\x1E\xFF\x22\x21\x1C\xFF\x23\x21\x1C\xFF\x22\x22\x1C\xFF\x22\x20\x1B\xFF\x24\x24\x1E" + "\xFF\x25\x23\x1E\xFF\x23\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x21\x21\x1C\xFF\x22\x21\x1C\xFF\x23\x22\x1C\xFF\x21\x1F\x1B\xFF\x23\x20\x1C" + "\xFF\x24\x23\x1D\xFF\x21\x21\x1B\xFF" + "\x22\x22\x1D\xFF\x25\x24\x1E\xFF\x26\x23\x1E\xFF\x25\x22\x1E\xFF\x22\x22\x1C\xFF\x23\x23\x1D" + "\xFF\x23\x23\x1D\xFF\x24\x21\x1C\xFF" + "\x1F\x1E\x1A\xFF\x21\x20\x1A\xFF\x1F\x1D\x18\xFF\x1E\x1D\x19\xFF\x22\x22\x1C\xFF\x21\x21\x1B" + "\xFF\x21\x20\x1B\xFF\x20\x1F\x1A\xFF" + "\x24\x23\x1D\xFF\x21\x20\x1A\xFF\x21\x1F\x1A\xFF\x22\x21\x1C\xFF\x25\x23\x1E\xFF\x23\x22\x1D" + "\xFF\x23\x21\x1D\xFF\x24\x21\x1C\xFF" + "\x23\x21\x1C\xFF\x25\x23\x1E\xFF\x23\x21\x1C\xFF\x22\x22\x1C\xFF\x21\x20\x1B\xFF\x21\x21\x1B" + "\xFF\x23\x21\x1B\xFF\x24\x21\x1C\xFF" + "\x23\x23\x1D\xFF\x23\x21\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x20\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1D\xFF\x20\x1F\x1B\xFF" + "\x25\x23\x1E\xFF\x23\x23\x1E\xFF\x23\x21\x1C\xFF\x28\x25\x20\xFF\x21\x1F\x1B\xFF\x20\x1E\x1A" + "\xFF\x23\x21\x1C\xFF\x23\x21\x1C\xFF" + "\x22\x20\x1B\xFF\x21\x20\x1B\xFF\x23\x22\x1D\xFF\x23\x22\x1C\xFF\x23\x21\x1C\xFF\x24\x23\x1D" + "\xFF\x24\x22\x1C\xFF\x23\x21\x1D\xFF" + "\x12\x11\x0E\xFF\x13\x11\x0F\xFF\x13\x11\x0F\xFF\x12\x11\x0D\xFF\x15\x13\x12\xFF\x15\x14\x11" + "\xFF\x15\x15\x10\xFF\x11\x0F\x0E\xFF" + "\x11\x0E\x0D\xFF\x11\x10\x0E\xFF\x12\x10\x0E\xFF\x11\x0E\x0D\xFF\x10\x0E\x0D\xFF\x12\x10\x0E" + "\xFF\x11\x0F\x0D\xFF\x11\x10\x0E\xFF" + "\x13\x12\x0F\xFF\x13\x12\x0E\xFF\x13\x12\x0F\xFF\x13\x12\x0F\xFF\x10\x10\x0C\xFF\x12\x11\x0E" + "\xFF\x13\x12\x0F\xFF\x12\x12\x0F\xFF" + "\x11\x0F\x0E\xFF\x14\x13\x0F\xFF\x13\x12\x0F\xFF\x14\x13\x0F\xFF\x13\x12\x0F\xFF\x13\x11\x10" + "\xFF\x12\x11\x0F\xFF\x11\x11\x0E\xFF" + "\x11\x11\x0E\xFF\x16\x14\x11\xFF\x13\x11\x0F\xFF\x13\x12\x10\xFF\x16\x14\x10\xFF\x15\x13\x10" + "\xFF\x15\x14\x11\xFF\x12\x12\x0E\xFF" + "\x14\x13\x0F\xFF\x16\x14\x11\xFF\x14\x12\x0F\xFF\x15\x15\x11\xFF\x16\x15\x11\xFF\x15\x14\x10" + "\xFF\x13\x12\x0F\xFF\x12\x11\x0E\xFF" + "\x13\x11\x0F\xFF\x14\x12\x10\xFF\x14\x12\x11\xFF\x13\x13\x10\xFF\x16\x15\x11\xFF\x15\x15\x10" + "\xFF\x13\x13\x0E\xFF\x17\x15\x11\xFF" + "\x10\x10\x0D\xFF\x14\x13\x0F\xFF\x15\x13\x10\xFF\x13\x12\x0F\xFF\x15\x14\x11\xFF\x15\x14\x10" + "\xFF\x11\x10\x0D\xFF\x14\x13\x0F\xFF" + "\x16\x14\x10\xFF\x12\x11\x0E\xFF\x11\x10\x0D\xFF\x14\x12\x10\xFF\x14\x13\x10\xFF\x14\x13\x10" + "\xFF\x13\x12\x0F\xFF\x13\x11\x0E\xFF" + "\x17\x15\x11\xFF\x18\x16\x13\xFF\x18\x17\x13\xFF\x12\x11\x0E\xFF\x15\x14\x10\xFF\x13\x12\x0E" + "\xFF\x14\x13\x0F\xFF\x14\x12\x0F\xFF" + "\x18\x17\x13\xFF\x19\x18\x14\xFF\x16\x15\x11\xFF\x12\x11\x0D\xFF\x14\x13\x10\xFF\x15\x14\x11" + "\xFF\x14\x13\x10\xFF\x13\x13\x0E\xFF" + "\x15\x14\x11\xFF\x18\x17\x13\xFF\x14\x12\x0F\xFF\x13\x12\x0F\xFF\x13\x12\x0E\xFF\x14\x13\x10" + "\xFF\x16\x15\x11\xFF\x18\x16\x13\xFF" + "\x16\x14\x12\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x15\x14\x10\xFF\x17\x16\x12\xFF\x15\x14\x11" + "\xFF\x17\x15\x13\xFF\x15\x14\x11\xFF" + "\x16\x14\x10\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x14\x13\x10\xFF\x16\x16\x12\xFF\x17\x16\x12" + "\xFF\x16\x15\x11\xFF\x14\x13\x0F\xFF" + "\x17\x16\x12\xFF\x17\x16\x12\xFF\x15\x14\x10\xFF\x14\x13\x0F\xFF\x16\x15\x11\xFF\x13\x12\x0F" + "\xFF\x13\x12\x0E\xFF\x13\x11\x0F\xFF" + "\x15\x14\x11\xFF\x15\x14\x11\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF\x1A\x19\x15\xFF\x18\x17\x13" + "\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF" + "\x13\x13\x0F\xFF\x17\x15\x11\xFF\x18\x16\x14\xFF\x15\x14\x11\xFF\x15\x14\x10\xFF\x19\x17\x13" + "\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF" + "\x1A\x19\x15\xFF\x19\x18\x14\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x16\x15\x11" + "\xFF\x15\x14\x10\xFF\x16\x15\x11\xFF" + "\x19\x18\x14\xFF\x17\x16\x12\xFF\x17\x16\x12\xFF\x16\x14\x11\xFF\x19\x18\x14\xFF\x17\x16\x12" + "\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF" + "\x1B\x1A\x16\xFF\x16\x16\x12\xFF\x17\x16\x12\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF\x18\x17\x13" + "\xFF\x19\x18\x14\xFF\x17\x16\x12\xFF" + "\x15\x14\x10\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF\x17\x16\x12\xFF\x1A\x18\x14\xFF\x1A\x19\x15" + "\xFF\x19\x18\x14\xFF\x19\x17\x13\xFF" + "\x19\x18\x14\xFF\x16\x15\x11\xFF\x17\x16\x12\xFF\x19\x18\x14\xFF\x18\x17\x13\xFF\x19\x18\x14" + "\xFF\x18\x17\x13\xFF\x19\x18\x14\xFF" + "\x1A\x18\x14\xFF\x1A\x17\x14\xFF\x1A\x18\x14\xFF\x13\x13\x11\xFF\x19\x19\x15\xFF\x19\x18\x14" + "\xFF\x19\x19\x14\xFF\x1B\x1A\x16\xFF" + "\x1A\x18\x14\xFF\x18\x17\x13\xFF\x15\x14\x11\xFF\x19\x18\x14\xFF\x1A\x18\x14\xFF\x1B\x1C\x16" + "\xFF\x1A\x19\x15\xFF\x18\x16\x12\xFF" + "\x18\x17\x13\xFF\x1A\x19\x14\xFF\x19\x18\x13\xFF\x1A\x19\x15\xFF\x19\x18\x15\xFF\x1A\x19\x15" + "\xFF\x19\x18\x14\xFF\x1A\x1A\x15\xFF" + "\x1A\x18\x14\xFF\x19\x19\x15\xFF\x1A\x1A\x16\xFF\x1A\x19\x15\xFF\x17\x17\x13\xFF\x19\x19\x15" + "\xFF\x1B\x19\x15\xFF\x19\x17\x13\xFF" + "\x1A\x1A\x15\xFF\x1A\x19\x14\xFF\x1D\x1C\x18\xFF\x1E\x1C\x18\xFF\x19\x17\x14\xFF\x19\x17\x13" + "\xFF\x1A\x19\x15\xFF\x1C\x1A\x16\xFF" + "\x1B\x19\x15\xFF\x18\x16\x13\xFF\x18\x16\x13\xFF\x19\x18\x14\xFF\x18\x17\x13\xFF\x18\x17\x13" + "\xFF\x1A\x19\x14\xFF\x1C\x1B\x16\xFF" + "\x1E\x1B\x17\xFF\x1A\x1A\x15\xFF\x1C\x1A\x16\xFF\x1B\x1A\x15\xFF\x1C\x1B\x17\xFF\x1B\x1B\x16" + "\xFF\x1E\x1C\x18\xFF\x1D\x1B\x17\xFF" + "\x1D\x1B\x16\xFF\x1C\x1B\x16\xFF\x1B\x1A\x17\xFF\x1A\x18\x16\xFF\x1B\x19\x15\xFF\x1B\x1B\x16" + "\xFF\x1A\x19\x15\xFF\x1B\x1A\x16\xFF" + "\x20\x1F\x19\xFF\x1B\x1A\x17\xFF\x1B\x1A\x16\xFF\x19\x19\x15\xFF\x1D\x1C\x18\xFF\x20\x20\x19" + "\xFF\x1F\x1F\x18\xFF\x1D\x1C\x18\xFF" + "\x1E\x1E\x18\xFF\x1C\x1A\x16\xFF\x1A\x19\x14\xFF\x19\x18\x14\xFF\x1C\x1A\x17\xFF\x1B\x1A\x16" + "\xFF\x1E\x1E\x19\xFF\x1F\x1E\x18\xFF" + "\x1C\x1B\x17\xFF\x1B\x1A\x16\xFF\x1C\x1C\x17\xFF\x1F\x1E\x19\xFF\x1F\x1F\x19\xFF\x1F\x1C\x18" + "\xFF\x1E\x1C\x17\xFF\x1C\x1C\x17\xFF" + "\x1D\x1B\x16\xFF\x1F\x1D\x19\xFF\x1F\x1E\x19\xFF\x1C\x1B\x16\xFF\x1E\x1C\x17\xFF\x1B\x1A\x16" + "\xFF\x1D\x1B\x18\xFF\x1E\x1C\x18\xFF" + "\x1C\x1C\x17\xFF\x1F\x1F\x19\xFF\x1D\x1C\x17\xFF\x1E\x1B\x17\xFF\x1F\x1D\x18\xFF\x1D\x1C\x18" + "\xFF\x1D\x1D\x18\xFF\x21\x20\x1B\xFF" + "\x21\x1F\x1C\xFF\x1E\x1D\x19\xFF\x1E\x1C\x18\xFF\x1F\x1D\x19\xFF\x1D\x1C\x18\xFF\x1E\x1C\x17" + "\xFF\x1F\x1D\x18\xFF\x20\x1F\x19\xFF" + "\x20\x1D\x19\xFF\x1C\x1B\x16\xFF\x20\x1F\x1A\xFF\x22\x1F\x1B\xFF\x21\x1F\x1A\xFF\x1E\x1C\x18" + "\xFF\x1D\x1B\x17\xFF\x1E\x1C\x18\xFF" + "\x1D\x1C\x18\xFF\x1E\x1C\x18\xFF\x1F\x1D\x19\xFF\x20\x1F\x1B\xFF\x1F\x1E\x1A\xFF\x1F\x1E\x1A" + "\xFF\x21\x1F\x1A\xFF\x1E\x1D\x19\xFF" + "\x20\x1F\x1B\xFF\x1E\x1E\x18\xFF\x1D\x1D\x18\xFF\x20\x1E\x1A\xFF\x20\x1E\x1A\xFF\x20\x1E\x19" + "\xFF\x1D\x1C\x17\xFF\x1C\x1C\x16\xFF" + "\x1C\x1B\x17\xFF\x1F\x1C\x18\xFF\x20\x1E\x19\xFF\x20\x1E\x1A\xFF\x1D\x1B\x16\xFF\x1C\x1C\x16" + "\xFF\x1C\x1D\x18\xFF\x1D\x1D\x18\xFF" + "\x1B\x19\x16\xFF\x1B\x1B\x15\xFF\x1A\x19\x15\xFF\x1B\x19\x16\xFF\x1C\x1A\x16\xFF\x1D\x1B\x18" + "\xFF\x17\x16\x13\xFF\x16\x15\x11\xFF" + "\x15\x13\x10\xFF\x14\x13\x10\xFF\x4F\x4B\x3E\xFF\x28\x26\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x28\x26\x21\xFF\x26\x25\x20\xFF" + "\x29\x28\x23\xFF\x22\x22\x1D\xFF\x26\x25\x20\xFF\x22\x21\x1C\xFF\x24\x23\x1E\xFF\x25\x24\x20" + "\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" + "\x22\x20\x1B\xFF\x25\x25\x20\xFF\x26\x25\x20\xFF\x24\x22\x1D\xFF\x28\x26\x21\xFF\x23\x22\x1D" + "\xFF\x24\x23\x1E\xFF\x28\x26\x21\xFF" + "\x21\x20\x1A\xFF\x28\x26\x21\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x24\x23\x1D\xFF" + "\x23\x22\x1C\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x22\x1D\xFF\x25\x24\x20" + "\xFF\x29\x28\x22\xFF\x23\x22\x1C\xFF" + "\x23\x22\x1C\xFF\x21\x20\x1B\xFF\x22\x20\x1B\xFF\x21\x20\x1A\xFF\x22\x21\x1B\xFF\x26\x25\x20" + "\xFF\x23\x21\x1C\xFF\x23\x22\x1D\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x23\x1E\xFF\x28\x26\x21\xFF\x23\x22\x1E\xFF\x24\x22\x1D" + "\xFF\x22\x21\x1B\xFF\x24\x23\x1D\xFF" + "\x28\x26\x21\xFF\x24\x22\x1D\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x20\x1B\xFF\x23\x21\x1C" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x25\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x21" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1E\xFF" + "\x21\x21\x1B\xFF\x26\x25\x20\xFF\x25\x24\x20\xFF\x22\x22\x1C\xFF\x25\x23\x1E\xFF\x23\x22\x1C" + "\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF" + "\x24\x22\x1D\xFF\x23\x22\x1D\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x25\x24\x20" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" + "\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x21\x20\x1A\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x24\x23\x1F\xFF" + "\x26\x25\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x23\x1F\xFF\x25\x24\x1F\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x25\x24\x20\xFF" + "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x28\x26\x21" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1D\xFF" + "\x22\x22\x1C\xFF\x28\x26\x22\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x23\x22\x1D\xFF\x22\x21\x1B" + "\xFF\x26\x25\x21\xFF\x22\x21\x1B\xFF" + "\x24\x23\x1E\xFF\x26\x24\x20\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x26\x25\x21\xFF\x23\x22\x1C\xFF\x24\x24\x1E\xFF\x22\x21\x1B\xFF\x24\x23\x1E" + "\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF" + "\x24\x23\x1E\xFF\x26\x25\x20\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" + "\x23\x22\x1C\xFF\x26\x25\x20\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF" + "\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x22\x21\x1B" + "\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF" + "\x28\x26\x21\xFF\x23\x22\x1C\xFF\x23\x23\x1E\xFF\x25\x23\x1E\xFF\x24\x23\x1E\xFF\x29\x28\x22" + "\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x22\x22\x1C\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x28\x26\x22" + "\xFF\x22\x21\x1B\xFF\x24\x22\x1D\xFF" + "\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x26\x24\x20" + "\xFF\x29\x28\x22\xFF\x22\x21\x1C\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x28\x26\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x28\x26\x21\xFF\x26\x25\x20\xFF" + "\x29\x28\x23\xFF\x23\x23\x1E\xFF\x27\x25\x20\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x25\x24\x20" + "\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x25\x25\x20\xFF\x27\x25\x20\xFF\x24\x22\x1D\xFF\x28\x26\x21\xFF\x24\x23\x1E" + "\xFF\x25\x23\x1E\xFF\x28\x26\x21\xFF" + "\x22\x21\x1B\xFF\x28\x26\x21\xFF\x24\x22\x1D\xFF\x23\x22\x1C\xFF\x23\x22\x1C\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x25\x24\x20" + "\xFF\x29\x28\x22\xFF\x23\x22\x1C\xFF" + "\x23\x22\x1C\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x27\x26\x21" + "\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x24\x1F\xFF\x28\x26\x21\xFF\x23\x22\x1E\xFF\x24\x23\x1E" + "\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF" + "\x28\x26\x21\xFF\x24\x23\x1E\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x23\x22\x1C" + "\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF" + "\x23\x22\x1C\xFF\x25\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x26\x21" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1E\xFF" + "\x22\x21\x1B\xFF\x26\x25\x20\xFF\x26\x24\x20\xFF\x23\x22\x1C\xFF\x25\x24\x1F\xFF\x23\x22\x1C" + "\xFF\x28\x26\x21\xFF\x22\x21\x1B\xFF" + "\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x25\x24\x1F\xFF\x23\x22\x1C\xFF" + "\x24\x22\x1D\xFF\x24\x23\x1E\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x26\x25\x20" + "\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF" + "\x23\x22\x1C\xFF\x25\x24\x1F\xFF\x29\x28\x22\xFF\x22\x21\x1B\xFF\x22\x21\x1B\xFF\x22\x21\x1B" + "\xFF\x22\x21\x1B\xFF\x25\x24\x20\xFF" + "\x27\x26\x21\xFF\x22\x21\x1B\xFF\x23\x22\x1C\xFF\x25\x24\x1F\xFF\x25\x24\x1F\xFF\x22\x21\x1B" + "\xFF\x23\x22\x1C\xFF\x26\x25\x20\xFF" + "\x22\x21\x1B\xFF\x27\x25\x20\xFF\x22\x21\x1B\xFF\x25\x24\x1F\xFF\x22\x21\x1B\xFF\x28\x27\x21" + "\xFF\x22\x22\x1B\xFF\x24\x24\x1F\xFF" + "\x23\x26\x1F\xFF\x2A\x2E\x28\xFF\x25\x2D\x24\xFF\x27\x31\x27\xFF\x29\x34\x2A\xFF\x27\x32\x27" + "\xFF\x2B\x36\x2D\xFF\x27\x32\x27\xFF" + "\x29\x34\x2A\xFF\x2A\x35\x2C\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF\x27\x32\x27" + "\xFF\x27\x32\x27\xFF\x27\x32\x27\xFF" + "\x27\x32\x27\xFF\x2B\x36\x2D\xFF\x28\x33\x28\xFF\x2A\x35\x2B\xFF\x27\x32\x27\xFF\x29\x34\x2A" + "\xFF\x28\x33\x28\xFF\x28\x33\x28\xFF" + "\x2A\x35\x2B\xFF\x2A\x35\x2C\xFF\x28\x33\x28\xFF\x27\x32\x27\xFF\x28\x33\x28\xFF\x27\x32\x27" + "\xFF\x27\x32\x27\xFF\x28\x33\x28\xFF" + "\x28\x33\x28\xFF\x2B\x36\x2C\xFF\x27\x32\x27\xFF\x2A\x35\x2B\xFF\x27\x32\x27\xFF\x27\x32\x27" + "\xFF\x28\x33\x28\xFF\x27\x32\x27\xFF" + "\x29\x34\x2A\xFF\x28\x33\x28\xFF\x29\x34\x2A\xFF\x28\x33\x28\xFF\x2A\x35\x2B\xFF\x4F\x4D\x3F" + "\xFF\x3B\x8B\x67\xFF\x3B\x8C\x68\xFF" + "\x3E\x93\x6D\xFF\x41\x99\x71\xFF\x43\x9F\x76\xFF\x45\xA4\x7A\xFF\x48\xAA\x7E\xFF\x4A\xAF\x81" + "\xFF\x4C\xB3\x84\xFF\x4D\xB7\x87\xFF" + "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x50\xC0\x8E\xFF\x51\xC2\x8F\xFF\x52\xBC\x8B\xFF\x4A\xA7\x7C" + "\xFF\x44\x90\x6B\xFF\x3E\x78\x5B\xFF" + "\x36\x63\x4B\xFF\x41\x87\x66\xFF\x55\xCB\x96\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x53\xC2\x90\xFF\x4D\xAD\x81\xFF\x47\x96\x70\xFF\x40\x7E\x5F\xFF\x39\x63\x4C\xFF\x31\x48\x39" + "\xFF\x2D\x36\x2B\xFF\x27\x2C\x24\xFF" + "\x25\x27\x21\xFF\x27\x27\x21\xFF\x26\x24\x1E\xFF\x25\x24\x1E\xFF\x28\x25\x1F\xFF\x26\x24\x1E" + "\xFF\x25\x25\x20\xFF\x26\x24\x1F\xFF" + "\x25\x22\x1E\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x29\x26\x21\xFF\x25\x23\x1D\xFF\x25\x23\x1D" + "\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF" + "\x2A\x27\x21\xFF\x29\x26\x21\xFF\x28\x25\x20\xFF\x26\x26\x20\xFF\x29\x26\x21\xFF\x29\x26\x21" + "\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" + "\x26\x24\x1F\xFF\x25\x24\x1E\xFF\x25\x23\x1E\xFF\x24\x22\x1E\xFF\x28\x25\x20\xFF\x27\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x25\x24\x1F\xFF" + "\x28\x27\x1F\xFF\x27\x25\x1F\xFF\x25\x25\x1F\xFF\x27\x25\x1F\xFF\x27\x24\x1F\xFF\x26\x23\x1F" + "\xFF\x25\x23\x1E\xFF\x28\x25\x20\xFF" + "\x28\x25\x20\xFF\x28\x26\x20\xFF\x26\x24\x1F\xFF\x26\x25\x1E\xFF\x26\x24\x1E\xFF\x26\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x27\x25\x20\xFF" + "\x25\x23\x1E\xFF\x27\x25\x1E\xFF\x27\x26\x1F\xFF\x26\x24\x1D\xFF\x25\x24\x1D\xFF\x28\x26\x1F" + "\xFF\x28\x27\x21\xFF\x26\x25\x1F\xFF" + "\x25\x23\x1E\xFF\x26\x25\x1F\xFF\x27\x24\x1F\xFF\x27\x25\x1E\xFF\x24\x23\x1E\xFF\x27\x25\x1F" + "\xFF\x27\x25\x20\xFF\x27\x26\x1F\xFF" + "\x29\x26\x20\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF\x26\x23\x1D\xFF\x23\x22\x1C\xFF\x26\x25\x1F" + "\xFF\x25\x25\x1E\xFF\x25\x24\x1E\xFF" + "\x25\x24\x1E\xFF\x24\x23\x1D\xFF\x24\x23\x1E\xFF\x25\x25\x1F\xFF\x25\x24\x1E\xFF\x25\x23\x1E" + "\xFF\x23\x23\x1E\xFF\x25\x24\x1F\xFF" + "\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x23\x1F\xFF\x25\x22\x1D\xFF\x27\x24\x1E\xFF\x27\x25\x1F" + "\xFF\x25\x24\x1E\xFF\x25\x23\x1E\xFF" + "\x26\x24\x1F\xFF\x23\x22\x1D\xFF\x26\x24\x1E\xFF\x24\x24\x1E\xFF\x26\x24\x1F\xFF\x25\x23\x1E" + "\xFF\x26\x23\x1E\xFF\x26\x24\x1E\xFF" + "\x26\x24\x1E\xFF\x27\x25\x1E\xFF\x25\x23\x1E\xFF\x28\x25\x20\xFF\x24\x21\x1E\xFF\x25\x23\x1E" + "\xFF\x26\x23\x1F\xFF\x25\x22\x1C\xFF" + "\x26\x29\x22\xFF\x32\x53\x3F\xFF\x4E\xAF\x82\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x4A\xA4\x7A\xFF\x2C\x43\x35\xFF" + "\x28\x28\x22\xFF\x26\x25\x20\xFF\x26\x24\x1F\xFF\x25\x23\x1F\xFF\x25\x23\x1C\xFF\x25\x22\x1D" + "\xFF\x25\x24\x1D\xFF\x23\x23\x1D\xFF" + "\x23\x23\x1D\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x27\x25\x20\xFF\x23\x22\x1C\xFF\x24\x22\x1D" + "\xFF\x24\x23\x1D\xFF\x24\x25\x1F\xFF" + "\x2C\x40\x30\xFF\x47\x98\x71\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x56\xCC\x98\xFF\x56\xCC\x97" + "\xFF\x57\xCC\x97\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x4E\xB2\x84\xFF\x32\x56\x42\xFF\x25\x2A\x22\xFF\x25\x25\x1F\xFF\x26\x24\x1F" + "\xFF\x25\x23\x1E\xFF\x25\x22\x1D\xFF" + "\x24\x24\x1E\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF\x27\x24\x1E\xFF\x25\x23\x1D" + "\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF" + "\x25\x22\x1D\xFF\x24\x23\x1E\xFF\x25\x23\x1E\xFF\x23\x22\x1E\xFF\x24\x22\x1E\xFF\x23\x20\x1B" + "\xFF\x23\x22\x1C\xFF\x26\x23\x1E\xFF" + "\x25\x23\x1E\xFF\x23\x22\x1C\xFF\x24\x23\x1E\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF\x27\x26\x1F" + "\xFF\x25\x24\x1E\xFF\x22\x20\x1B\xFF" + "\x23\x20\x1B\xFF\x23\x21\x1C\xFF\x23\x21\x1C\xFF\x24\x22\x1D\xFF\x23\x21\x1C\xFF\x23\x22\x1C" + "\xFF\x26\x24\x1E\xFF\x25\x23\x1E\xFF" + "\x23\x21\x1C\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF\x22\x21\x1B\xFF\x22\x22\x1C\xFF\x24\x22\x1C" + "\xFF\x24\x21\x1C\xFF\x23\x21\x1C\xFF" + "\x25\x23\x1E\xFF\x26\x22\x1D\xFF\x25\x22\x1D\xFF\x23\x21\x1D\xFF\x24\x22\x1D\xFF\x21\x21\x1B" + "\xFF\x23\x22\x1D\xFF\x24\x23\x1D\xFF" + "\x23\x22\x1D\xFF\x22\x21\x1C\xFF\x23\x20\x1C\xFF\x23\x21\x1D\xFF\x21\x21\x1C\xFF\x25\x23\x1E" + "\xFF\x28\x25\x20\xFF\x23\x20\x1B\xFF" + "\x23\x21\x1C\xFF\x25\x22\x1D\xFF\x26\x23\x1E\xFF\x24\x23\x1E\xFF\x22\x21\x1B\xFF\x22\x20\x1C" + "\xFF\x21\x20\x1B\xFF\x23\x22\x1D\xFF" + "\x26\x24\x1E\xFF\x24\x21\x1D\xFF\x25\x22\x1E\xFF\x24\x22\x1D\xFF\x24\x23\x1E\xFF\x23\x22\x1D" + "\xFF\x23\x22\x1D\xFF\x25\x24\x1E\xFF" + "\x24\x21\x1D\xFF\x27\x24\x20\xFF\x25\x22\x1D\xFF\x26\x24\x1E\xFF\x22\x21\x1B\xFF\x22\x21\x1C" + "\xFF\x24\x21\x1D\xFF\x25\x23\x1F\xFF" + "\x26\x24\x1F\xFF\x26\x23\x1E\xFF\x25\x23\x1E\xFF\x25\x22\x1D\xFF\x23\x21\x1D\xFF\x24\x22\x1D" + "\xFF\x22\x1F\x1A\xFF\x22\x21\x1B\xFF" + "\x20\x1E\x1A\xFF\x21\x20\x1B\xFF\x22\x20\x1B\xFF\x21\x20\x1A\xFF\x22\x22\x1C\xFF\x23\x21\x1C" + "\xFF\x23\x21\x1C\xFF\x21\x20\x1B\xFF" + "\x23\x20\x1C\xFF\x21\x20\x1B\xFF\x22\x20\x1B\xFF\x21\x1F\x1B\xFF\x23\x21\x1C\xFF\x23\x21\x1C" + "\xFF\x24\x22\x1D\xFF\x21\x20\x1B\xFF" + "\x20\x1F\x1A\xFF\x26\x23\x1E\xFF\x25\x22\x1D\xFF\x23\x22\x1B\xFF\x21\x1F\x1B\xFF\x22\x1F\x1B" + "\xFF\x24\x21\x1D\xFF\x25\x23\x1D\xFF" + "\x25\x22\x1D\xFF\x21\x21\x1B\xFF\x21\x20\x1B\xFF\x22\x20\x1C\xFF\x22\x21\x1B\xFF\x1F\x1E\x19" + "\xFF\x22\x20\x1B\xFF\x21\x20\x1B\xFF" + "\x25\x23\x1E\xFF\x21\x21\x1C\xFF\x20\x1F\x1B\xFF\x21\x20\x1B\xFF\x24\x23\x1E\xFF\x22\x22\x1C" + "\xFF\x21\x20\x1B\xFF\x20\x1F\x1A\xFF" + "\x23\x21\x1C\xFF\x24\x22\x1D\xFF\x24\x21\x1D\xFF\x25\x24\x1E\xFF\x22\x21\x1C\xFF\x23\x22\x1C" + "\xFF\x24\x22\x1E\xFF\x22\x21\x1D\xFF" + "\x18\x18\x13\xFF\x15\x14\x10\xFF\x15\x13\x10\xFF\x13\x12\x0E\xFF\x12\x10\x0D\xFF\x12\x11\x0D" + "\xFF\x16\x15\x10\xFF\x14\x12\x10\xFF" + "\x12\x10\x10\xFF\x12\x10\x0E\xFF\x12\x11\x0E\xFF\x11\x10\x0D\xFF\x14\x13\x0F\xFF\x10\x0F\x0C" + "\xFF\x10\x0E\x0D\xFF\x10\x0E\x0D\xFF" + "\x13\x12\x0E\xFF\x10\x0F\x0D\xFF\x10\x0F\x0C\xFF\x13\x11\x0F\xFF\x13\x12\x0E\xFF\x13\x12\x0E" + "\xFF\x14\x13\x0F\xFF\x12\x11\x0F\xFF" + "\x12\x10\x0E\xFF\x13\x12\x0E\xFF\x11\x10\x0D\xFF\x14\x13\x0F\xFF\x14\x13\x10\xFF\x12\x10\x0E" + "\xFF\x13\x11\x0F\xFF\x14\x12\x10\xFF" + "\x13\x10\x0D\xFF\x17\x15\x12\xFF\x17\x17\x13\xFF\x12\x11\x0E\xFF\x16\x15\x11\xFF\x14\x13\x0F" + "\xFF\x13\x11\x0F\xFF\x13\x12\x0E\xFF" + "\x16\x15\x11\xFF\x14\x13\x0F\xFF\x14\x13\x0F\xFF\x1E\x1E\x18\xFF\x17\x15\x13\xFF\x16\x15\x11" + "\xFF\x13\x12\x0E\xFF\x12\x11\x0D\xFF" + "\x14\x12\x10\xFF\x13\x12\x0F\xFF\x14\x13\x0F\xFF\x13\x12\x0F\xFF\x14\x12\x10\xFF\x15\x14\x10" + "\xFF\x14\x14\x10\xFF\x15\x13\x0F\xFF" + "\x15\x14\x10\xFF\x12\x11\x0E\xFF\x12\x10\x0D\xFF\x14\x13\x0F\xFF\x14\x12\x11\xFF\x15\x14\x11" + "\xFF\x12\x11\x0E\xFF\x16\x14\x0F\xFF" + "\x15\x14\x10\xFF\x11\x10\x0C\xFF\x12\x11\x0D\xFF\x16\x15\x12\xFF\x15\x14\x10\xFF\x14\x13\x0F" + "\xFF\x14\x13\x0F\xFF\x12\x11\x0F\xFF" + "\x13\x12\x10\xFF\x14\x12\x11\xFF\x14\x12\x0F\xFF\x12\x11\x0E\xFF\x16\x15\x11\xFF\x17\x16\x12" + "\xFF\x15\x14\x11\xFF\x15\x15\x0F\xFF" + "\x17\x16\x12\xFF\x1A\x18\x15\xFF\x17\x16\x13\xFF\x14\x13\x0F\xFF\x11\x0F\x0E\xFF\x12\x11\x0F" + "\xFF\x14\x13\x10\xFF\x16\x15\x11\xFF" + "\x16\x15\x11\xFF\x16\x15\x11\xFF\x18\x17\x13\xFF\x15\x13\x10\xFF\x12\x11\x0E\xFF\x16\x15\x11" + "\xFF\x17\x16\x12\xFF\x15\x13\x11\xFF" + "\x16\x15\x12\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x18\x17\x13\xFF\x17\x16\x12" + "\xFF\x18\x17\x13\xFF\x14\x12\x0F\xFF" + "\x16\x15\x11\xFF\x15\x14\x10\xFF\x15\x14\x10\xFF\x13\x11\x0F\xFF\x15\x13\x11\xFF\x17\x16\x12" + "\xFF\x18\x17\x13\xFF\x17\x16\x12\xFF" + "\x16\x15\x11\xFF\x17\x16\x12\xFF\x18\x17\x13\xFF\x1C\x1B\x17\xFF\x17\x16\x12\xFF\x16\x15\x11" + "\xFF\x16\x15\x11\xFF\x18\x17\x13\xFF" + "\x14\x13\x0F\xFF\x15\x13\x11\xFF\x14\x12\x0F\xFF\x14\x13\x0F\xFF\x19\x18\x15\xFF\x17\x16\x13" + "\xFF\x15\x14\x11\xFF\x1B\x1A\x16\xFF" + "\x13\x12\x0E\xFF\x17\x15\x11\xFF\x16\x15\x11\xFF\x13\x12\x0F\xFF\x16\x15\x11\xFF\x18\x16\x13" + "\xFF\x18\x16\x13\xFF\x17\x16\x12\xFF" + "\x17\x16\x12\xFF\x16\x15\x11\xFF\x16\x15\x11\xFF\x1B\x1A\x16\xFF\x17\x16\x12\xFF\x17\x16\x12" + "\xFF\x16\x15\x11\xFF\x15\x14\x10\xFF" + "\x17\x16\x12\xFF\x1A\x1A\x15\xFF\x18\x17\x13\xFF\x18\x17\x14\xFF\x16\x15\x11\xFF\x18\x17\x13" + "\xFF\x19\x18\x14\xFF\x16\x15\x11\xFF" + "\x19\x18\x14\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x1C\x1B\x17\xFF\x1D\x1B\x17\xFF\x18\x17\x13" + "\xFF\x1C\x1A\x16\xFF\x19\x16\x12\xFF" + "\x16\x15\x11\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF\x1A\x18\x14\xFF\x18\x17\x13" + "\xFF\x19\x18\x14\xFF\x1A\x19\x15\xFF" + "\x19\x18\x14\xFF\x18\x16\x12\xFF\x1A\x18\x14\xFF\x18\x16\x12\xFF\x15\x14\x10\xFF\x17\x16\x12" + "\xFF\x16\x15\x11\xFF\x18\x16\x12\xFF" + "\x17\x17\x13\xFF\x18\x17\x13\xFF\x1B\x1A\x15\xFF\x1B\x1B\x16\xFF\x18\x18\x14\xFF\x18\x18\x14" + "\xFF\x1A\x19\x15\xFF\x19\x18\x14\xFF" + "\x1B\x19\x15\xFF\x1B\x1A\x16\xFF\x19\x18\x14\xFF\x1C\x1A\x16\xFF\x1B\x1A\x16\xFF\x1A\x19\x15" + "\xFF\x18\x17\x13\xFF\x18\x17\x13\xFF" + "\x1A\x19\x15\xFF\x19\x18\x14\xFF\x19\x19\x15\xFF\x1A\x18\x14\xFF\x1D\x1C\x18\xFF\x1B\x1A\x16" + "\xFF\x1E\x1C\x18\xFF\x1D\x1B\x17\xFF" + "\x1B\x18\x14\xFF\x1B\x1A\x16\xFF\x1B\x19\x15\xFF\x1B\x1A\x15\xFF\x18\x16\x12\xFF\x19\x18\x13" + "\xFF\x1B\x1A\x16\xFF\x1A\x19\x15\xFF" + "\x1B\x1A\x16\xFF\x20\x1D\x19\xFF\x1D\x1B\x17\xFF\x18\x18\x13\xFF\x1E\x1B\x17\xFF\x1B\x19\x15" + "\xFF\x1B\x1A\x16\xFF\x1A\x19\x14\xFF" + "\x19\x17\x14\xFF\x1C\x19\x16\xFF\x1B\x19\x15\xFF\x19\x17\x15\xFF\x1A\x19\x15\xFF\x1A\x19\x15" + "\xFF\x19\x19\x14\xFF\x1A\x1A\x15\xFF" + "\x1B\x1A\x15\xFF\x1E\x1C\x17\xFF\x1B\x1A\x15\xFF\x1B\x1A\x15\xFF\x1D\x1D\x17\xFF\x1E\x1D\x17" + "\xFF\x1C\x1B\x16\xFF\x17\x15\x11\xFF" + "\x19\x19\x15\xFF\x1C\x19\x15\xFF\x1D\x1B\x17\xFF\x1D\x1B\x18\xFF\x19\x18\x14\xFF\x1B\x1A\x16" + "\xFF\x1C\x1B\x17\xFF\x18\x17\x13\xFF" + "\x1B\x1A\x16\xFF\x1D\x1C\x17\xFF\x1B\x1A\x15\xFF\x17\x17\x12\xFF\x1A\x19\x15\xFF\x1A\x19\x15" + "\xFF\x17\x17\x13\xFF\x18\x17\x13\xFF" + "\x1D\x1D\x17\xFF\x1F\x1E\x19\xFF\x1A\x19\x14\xFF\x1A\x18\x16\xFF\x1D\x1A\x16\xFF\x1C\x1A\x16" + "\xFF\x1A\x1A\x16\xFF\x1D\x1C\x17\xFF" + "\x1B\x1A\x16\xFF\x1C\x1A\x16\xFF\x1D\x1B\x17\xFF\x1B\x1A\x16\xFF\x1C\x18\x14\xFF\x1D\x1B\x17" + "\xFF\x1C\x1B\x17\xFF\x1E\x1C\x18\xFF" + "\x1F\x1D\x19\xFF\x1E\x1E\x19\xFF\x1F\x1F\x1A\xFF\x1C\x1B\x17\xFF\x1E\x1E\x18\xFF\x1D\x1B\x18" + "\xFF\x1D\x1C\x17\xFF\x1D\x1C\x18\xFF" + "\x1A\x1A\x18\xFF\x1D\x1D\x18\xFF\x1D\x1C\x18\xFF\x1D\x1D\x17\xFF\x1E\x1D\x19\xFF\x1E\x1D\x18" + "\xFF\x1B\x1A\x15\xFF\x1F\x1E\x19\xFF" + "\x1B\x1A\x16\xFF\x1C\x1B\x17\xFF\x1B\x1A\x16\xFF\x1E\x1D\x18\xFF\x1E\x1D\x19\xFF\x1C\x1B\x16" + "\xFF\x1D\x1B\x17\xFF\x1F\x1E\x19\xFF" + "\x1D\x1A\x17\xFF\x1F\x1D\x19\xFF\x22\x21\x1B\xFF\x21\x20\x1B\xFF\x1C\x1B\x17\xFF\x1E\x1D\x18" + "\xFF\x1C\x1B\x17\xFF\x1D\x1D\x17\xFF" + "\x1D\x1C\x16\xFF\x1F\x1D\x18\xFF\x1C\x1B\x16\xFF\x1C\x1B\x17\xFF\x1E\x1C\x18\xFF\x20\x1F\x1A" + "\xFF\x24\x21\x1D\xFF\x21\x21\x1B\xFF" + "\x24\x22\x1D\xFF\x1E\x1D\x18\xFF\x1D\x1C\x18\xFF\x1D\x1C\x17\xFF\x20\x1F\x1B\xFF\x1F\x1E\x19" + "\xFF\x1B\x1A\x16\xFF\x1E\x1C\x17\xFF" + "\x1E\x1D\x19\xFF\x1E\x1D\x18\xFF\x1F\x1D\x18\xFF\x1E\x1B\x18\xFF\x1D\x1C\x17\xFF\x1D\x1C\x17" + "\xFF\x1D\x1D\x19\xFF\x1E\x1E\x18\xFF"; /** * Experimental Case 03: 64x64 (32bpp) */ static const BYTE TEST_RLE_BITMAP_EXPERIMENTAL_03[16384] = - "\x27\x2A\x23\xFF\x23\x25\x1F\xFF\x23\x23\x1E\xFF\x24\x23\x1D\xFF\x25\x23\x1D\xFF\x25\x23\x1E\xFF\x25\x23\x1D\xFF\x25\x24\x1F\xFF" - "\x28\x2B\x23\xFF\x37\x60\x4A\xFF\x4A\xA2\x78\xFF\x47\x97\x71\xFF\x41\x84\x64\xFF\x3D\x75\x58\xFF\x38\x62\x4B\xFF\x33\x50\x3E\xFF" - "\x2E\x3C\x30\xFF\x2A\x34\x29\xFF\x28\x30\x26\xFF\x27\x2C\x24\xFF\x26\x29\x22\xFF\x27\x28\x21\xFF\x27\x26\x20\xFF\x27\x25\x20\xFF" - "\x25\x25\x20\xFF\x24\x23\x1D\xFF\x26\x23\x1E\xFF\x28\x25\x20\xFF\x26\x24\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF" - "\x26\x25\x1F\xFF\x28\x25\x20\xFF\x28\x26\x21\xFF\x2A\x27\x22\xFF\x26\x25\x1E\xFF\x27\x24\x1F\xFF\x27\x25\x1F\xFF\x28\x25\x1F\xFF" - "\x27\x27\x1F\xFF\x27\x24\x1F\xFF\x25\x24\x1F\xFF\x26\x24\x1F\xFF\x24\x24\x1E\xFF\x25\x24\x1D\xFF\x27\x25\x1F\xFF\x28\x25\x20\xFF" - "\x27\x24\x1F\xFF\x28\x25\x1F\xFF\x27\x26\x1F\xFF\x27\x25\x1E\xFF\x25\x23\x1E\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x25\x20\xFF" - "\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1E\xFF\x25\x22\x1D\xFF\x26\x23\x1E\xFF\x23\x21\x1C\xFF" - "\x32\x51\x3F\xFF\x29\x37\x2C\xFF\x29\x31\x28\xFF\x27\x2C\x24\xFF\x26\x29\x21\xFF\x28\x28\x22\xFF\x27\x27\x20\xFF\x27\x27\x21\xFF" - "\x29\x2F\x25\xFF\x3C\x73\x56\xFF\x55\xC9\x94\xFF\x56\xCC\x96\xFF\x56\xCB\x97\xFF\x54\xC5\x92\xFF\x52\xBD\x8C\xFF\x50\xB5\x86\xFF" - "\x4D\xAA\x7F\xFF\x48\x99\x71\xFF\x40\x80\x61\xFF\x37\x66\x4D\xFF\x2F\x48\x38\xFF\x2C\x38\x2C\xFF\x2B\x33\x29\xFF\x2A\x2E\x26\xFF" - "\x27\x29\x23\xFF\x27\x27\x21\xFF\x27\x27\x21\xFF\x27\x26\x20\xFF\x26\x25\x1F\xFF\x26\x25\x1F\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF" - "\x27\x26\x20\xFF\x28\x26\x20\xFF\x28\x25\x20\xFF\x28\x27\x20\xFF\x27\x25\x1F\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF\x28\x26\x20\xFF" - "\x25\x23\x1E\xFF\x26\x24\x1E\xFF\x25\x23\x1D\xFF\x27\x25\x1F\xFF\x26\x24\x1E\xFF\x26\x23\x1E\xFF\x29\x26\x21\xFF\x28\x25\x20\xFF" - "\x26\x25\x1F\xFF\x27\x25\x1F\xFF\x25\x25\x1F\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x26\x25\x1F\xFF\x25\x23\x1D\xFF\x27\x24\x1F\xFF" - "\x25\x24\x1F\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x27\x24\x1E\xFF\x26\x26\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" - "\x4E\xBA\x89\xFF\x4D\xB3\x83\xFF\x45\x97\x70\xFF\x3D\x79\x5B\xFF\x35\x58\x44\xFF\x30\x48\x39\xFF\x2D\x3A\x2F\xFF\x29\x31\x27\xFF" - "\x2B\x37\x2C\xFF\x3E\x79\x5B\xFF\x56\xCA\x95\xFF\x56\xCC\x96\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x52\xBC\x8B\xFF\x49\x9D\x76\xFF\x3E\x7A\x5C\xFF" - "\x36\x5C\x47\xFF\x31\x4C\x3B\xFF\x2D\x3D\x2F\xFF\x29\x30\x28\xFF\x27\x2B\x23\xFF\x27\x29\x22\xFF\x27\x28\x21\xFF\x28\x27\x21\xFF" - "\x27\x25\x20\xFF\x27\x24\x1F\xFF\x24\x24\x1E\xFF\x25\x23\x1F\xFF\x28\x25\x20\xFF\x29\x26\x20\xFF\x27\x25\x20\xFF\x28\x25\x20\xFF" - "\x26\x23\x1F\xFF\x27\x24\x1F\xFF\x29\x27\x21\xFF\x2A\x27\x21\xFF\x27\x24\x1F\xFF\x25\x24\x1E\xFF\x24\x24\x1F\xFF\x26\x24\x1F\xFF" - "\x28\x25\x1F\xFF\x27\x25\x1E\xFF\x27\x25\x20\xFF\x25\x25\x1F\xFF\x29\x26\x21\xFF\x27\x27\x20\xFF\x26\x25\x1F\xFF\x25\x23\x1E\xFF" - "\x26\x23\x1E\xFF\x23\x23\x1D\xFF\x26\x25\x1E\xFF\x27\x24\x1E\xFF\x25\x22\x1E\xFF\x27\x24\x1F\xFF\x29\x26\x21\xFF\x26\x26\x1E\xFF" - "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x50\xC0\x8E\xFF\x51\xC2\x8F\xFF\x52\xBC\x8B\xFF\x4A\xA7\x7C\xFF\x44\x90\x6B\xFF\x3E\x78\x5B\xFF" - "\x36\x63\x4B\xFF\x41\x87\x66\xFF\x55\xCB\x96\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x53\xC2\x90\xFF\x4D\xAD\x81\xFF\x47\x96\x70\xFF\x40\x7E\x5F\xFF\x39\x63\x4C\xFF\x31\x48\x39\xFF\x2D\x36\x2B\xFF\x27\x2C\x24\xFF" - "\x25\x27\x21\xFF\x27\x27\x21\xFF\x26\x24\x1E\xFF\x25\x24\x1E\xFF\x28\x25\x1F\xFF\x26\x24\x1E\xFF\x25\x25\x20\xFF\x26\x24\x1F\xFF" - "\x25\x22\x1E\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x29\x26\x21\xFF\x25\x23\x1D\xFF\x25\x23\x1D\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF" - "\x2A\x27\x21\xFF\x29\x26\x21\xFF\x28\x25\x20\xFF\x26\x26\x20\xFF\x29\x26\x21\xFF\x29\x26\x21\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" - "\x26\x24\x1F\xFF\x25\x24\x1E\xFF\x25\x23\x1E\xFF\x24\x22\x1E\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x25\x24\x1F\xFF" - "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x50\xC0\x8E\xFF\x51\xC2\x8F\xFF\x53\xC5\x91\xFF\x54\xC7\x92\xFF\x55\xC8\x95\xFF\x53\xC3\x92\xFF" - "\x50\xBA\x89\xFF\x51\xBD\x8C\xFF\x56\xCC\x97\xFF\x57\xCC\x97\xFF\x57\xCD\x99\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x58\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x55\xC8\x95\xFF\x52\xBD\x8D\xFF\x4E\xB0\x82\xFF\x47\x93\x6E\xFF\x38\x65\x4C\xFF" - "\x2D\x3A\x2F\xFF\x2C\x33\x2A\xFF\x26\x2A\x23\xFF\x27\x28\x20\xFF\x28\x27\x21\xFF\x27\x24\x1F\xFF\x26\x23\x1F\xFF\x28\x25\x20\xFF" - "\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x24\x23\x1E\xFF\x26\x24\x1D\xFF\x24\x24\x1D\xFF\x24\x22\x1D\xFF\x24\x21\x1D\xFF\x27\x24\x1F\xFF" - "\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF\x28\x25\x20\xFF\x27\x26\x20\xFF\x27\x25\x1E\xFF\x25\x25\x1E\xFF\x26\x23\x1E\xFF" - "\x26\x23\x1E\xFF\x27\x25\x1E\xFF\x26\x24\x1F\xFF\x27\x24\x20\xFF\x27\x26\x20\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x24\x24\x1E\xFF" - "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x52\xC4\x91\xFF\x54\xC7\x92\xFF\x55\xC8\x95\xFF\x54\xC8\x94\xFF" - "\x55\xCB\x96\xFF\x55\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x97\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCC\x97\xFF\x57\xCC\x97\xFF\x56\xCC\x97\xFF" - "\x52\xBE\x8D\xFF\x45\x90\x6C\xFF\x38\x62\x4B\xFF\x2F\x42\x34\xFF\x29\x30\x27\xFF\x27\x28\x22\xFF\x28\x27\x21\xFF\x25\x22\x1E\xFF" - "\x23\x23\x1D\xFF\x25\x24\x1F\xFF\x28\x25\x20\xFF\x26\x25\x1F\xFF\x27\x25\x1F\xFF\x27\x25\x1E\xFF\x25\x24\x1E\xFF\x27\x24\x20\xFF" - "\x27\x25\x1F\xFF\x26\x25\x1F\xFF\x25\x24\x1E\xFF\x28\x26\x20\xFF\x25\x24\x1F\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x27\x23\x1F\xFF" - "\x27\x25\x1E\xFF\x26\x25\x1F\xFF\x2A\x27\x21\xFF\x2C\x29\x24\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x29\x26\x20\xFF" - "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x53\xC7\x93\xFF\x54\xC8\x95\xFF\x55\xC9\x95\xFF" - "\x55\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x56\xCD\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCC\x97\xFF" - "\x56\xCD\x97\xFF\x56\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x56\xCC\x98\xFF\x52\xC0\x8E\xFF\x49\x9D\x76\xFF\x3A\x6A\x51\xFF\x2E\x3F\x31\xFF\x29\x2E\x24\xFF\x28\x27\x21\xFF" - "\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x24\x1E\xFF\x25\x24\x1E\xFF\x25\x25\x1F\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" - "\x27\x25\x20\xFF\x27\x24\x1E\xFF\x27\x25\x20\xFF\x27\x27\x21\xFF\x25\x24\x1E\xFF\x26\x25\x1F\xFF\x27\x25\x1F\xFF\x25\x24\x1E\xFF" - "\x25\x25\x1F\xFF\x28\x25\x20\xFF\x28\x26\x20\xFF\x28\x25\x20\xFF\x25\x23\x1D\xFF\x25\x23\x1E\xFF\x26\x25\x1F\xFF\x27\x26\x20\xFF" - "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x52\xC4\x91\xFF\x53\xC7\x93\xFF\x54\xC8\x95\xFF\x55\xC9\x95\xFF" - "\x55\xCB\x95\xFF\x55\xCA\x95\xFF\x56\xCC\x96\xFF\x56\xCB\x96\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x58\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x96\xFF\x56\xCC\x97\xFF" - "\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x52\xC1\x8E\xFF\x4C\xA8\x7C\xFF\x45\x92\x6D\xFF\x42\x86\x64\xFF\x47\x99\x72\xFF" - "\x51\xB9\x89\xFF\x56\xCB\x96\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x53\xBF\x8E\xFF\x45\x8F\x6B\xFF\x30\x47\x38\xFF\x28\x2E\x25\xFF" - "\x27\x26\x1E\xFF\x27\x25\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x29\x26\x20\xFF\x28\x25\x1F\xFF\x26\x25\x1F\xFF" - "\x25\x24\x1F\xFF\x26\x25\x1F\xFF\x28\x25\x1F\xFF\x26\x24\x1E\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF\x29\x26\x21\xFF\x26\x24\x1F\xFF" - "\x27\x25\x1F\xFF\x29\x27\x20\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x26\x24\x1D\xFF\x26\x23\x1E\xFF\x25\x23\x1D\xFF\x26\x24\x1E\xFF" - "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x52\xC4\x91\xFF\x54\xC7\x93\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" - "\x55\xCA\x95\xFF\x55\xCA\x95\xFF\x56\xCC\x96\xFF\x56\xCB\x96\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x99\xFF\x57\xCD\x98\xFF\x56\xCD\x97\xFF\x56\xCD\x98\xFF" - "\x56\xCA\x96\xFF\x50\xB6\x87\xFF\x42\x83\x62\xFF\x30\x48\x39\xFF\x2A\x3B\x2E\xFF\x2B\x39\x2E\xFF\x2D\x3B\x2F\xFF\x2D\x3B\x2F\xFF" - "\x2E\x40\x32\xFF\x35\x58\x45\xFF\x48\x9B\x74\xFF\x54\xC5\x92\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x4C\xA9\x7D\xFF\x34\x52\x3E\xFF" - "\x27\x2B\x22\xFF\x27\x26\x20\xFF\x29\x26\x21\xFF\x2A\x27\x22\xFF\x28\x25\x1E\xFF\x26\x23\x1E\xFF\x29\x26\x21\xFF\x26\x24\x1E\xFF" - "\x25\x24\x1F\xFF\x26\x25\x1F\xFF\x28\x25\x20\xFF\x25\x23\x1E\xFF\x27\x25\x20\xFF\x25\x23\x1E\xFF\x25\x22\x1D\xFF\x25\x23\x1E\xFF" - "\x27\x25\x1F\xFF\x25\x24\x1E\xFF\x27\x24\x1E\xFF\x25\x24\x1F\xFF\x26\x24\x1E\xFF\x25\x22\x1E\xFF\x25\x23\x1D\xFF\x26\x25\x1E\xFF" - "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" - "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCD\x98\xFF" - "\x4C\xA8\x7D\xFF\x37\x5D\x47\xFF\x2D\x3D\x31\xFF\x2E\x3D\x30\xFF\x34\x5F\x49\xFF\x3B\x71\x55\xFF\x3D\x79\x5B\xFF\x3A\x6C\x52\xFF" - "\x33\x50\x3D\xFF\x2F\x3D\x30\xFF\x2F\x47\x37\xFF\x3E\x7A\x5D\xFF\x54\xC5\x92\xFF\x56\xCD\x98\xFF\x56\xCC\x97\xFF\x48\x98\x72\xFF" - "\x2C\x37\x2C\xFF\x29\x2A\x23\xFF\x27\x26\x1F\xFF\x25\x24\x1E\xFF\x27\x25\x20\xFF\x26\x25\x1F\xFF\x29\x27\x21\xFF\x25\x25\x1F\xFF" - "\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x28\x26\x21\xFF\x28\x25\x20\xFF\x26\x23\x1E\xFF\x24\x23\x1D\xFF\x25\x22\x1D\xFF" - "\x25\x23\x1E\xFF\x24\x23\x1E\xFF\x29\x26\x21\xFF\x28\x26\x20\xFF\x25\x24\x1F\xFF\x25\x24\x1F\xFF\x25\x24\x1E\xFF\x24\x23\x1D\xFF" - "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" - "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x53\xC3\x91\xFF" - "\x35\x59\x45\xFF\x2D\x3B\x2F\xFF\x32\x50\x3E\xFF\x46\x92\x6D\xFF\x51\xBB\x8B\xFF\x54\xC4\x91\xFF\x55\xC7\x93\xFF\x53\xC1\x8F\xFF" - "\x4E\xAE\x81\xFF\x3F\x75\x59\xFF\x2D\x40\x32\xFF\x2D\x3D\x31\xFF\x43\x8C\x68\xFF\x56\xCC\x97\xFF\x56\xCD\x97\xFF\x56\xC8\x94\xFF" - "\x39\x65\x4D\xFF\x2A\x30\x26\xFF\x28\x28\x22\xFF\x27\x25\x1E\xFF\x2A\x27\x22\xFF\x28\x26\x21\xFF\x29\x26\x21\xFF\x26\x25\x1E\xFF" - "\x27\x24\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x26\x24\x1E\xFF\x26\x25\x20\xFF\x27\x25\x1E\xFF\x28\x25\x1F\xFF" - "\x27\x24\x20\xFF\x26\x23\x1E\xFF\x25\x24\x1E\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF" - "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" - "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x97\xFF\x55\xC7\x93\xFF\x3B\x70\x56\xFF" - "\x2E\x3B\x2F\xFF\x36\x59\x44\xFF\x4E\xAE\x81\xFF\x57\xCC\x97\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x55\xC9\x94\xFF\x54\xC4\x91\xFF" - "\x56\xCB\x96\xFF\x56\xCA\x96\xFF\x43\x8A\x69\xFF\x2E\x41\x33\xFF\x31\x4C\x3A\xFF\x4A\xA1\x79\xFF\x56\xCC\x97\xFF\x57\xCD\x97\xFF" - "\x4E\xB0\x81\xFF\x2F\x45\x37\xFF\x28\x2B\x24\xFF\x25\x23\x1E\xFF\x27\x25\x20\xFF\x27\x25\x20\xFF\x28\x26\x20\xFF\x27\x24\x20\xFF" - "\x26\x23\x1E\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x25\x1F\xFF\x26\x24\x1E\xFF\x26\x23\x1E\xFF" - "\x28\x26\x21\xFF\x25\x25\x1E\xFF\x26\x23\x1E\xFF\x26\x24\x20\xFF\x27\x24\x1F\xFF\x27\x24\x20\xFF\x26\x23\x1F\xFF\x27\x24\x1F\xFF" - "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" - "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x4E\xAF\x82\xFF\x32\x50\x3E\xFF" - "\x2F\x42\x35\xFF\x45\x90\x6C\xFF\x56\xCA\x96\xFF\x57\xCD\x98\xFF\x56\xCB\x96\xFF\x4E\xB0\x82\xFF\x42\x84\x63\xFF\x3D\x74\x57\xFF" - "\x44\x8B\x69\xFF\x50\xB7\x88\xFF\x53\xC0\x8F\xFF\x36\x64\x4C\xFF\x2D\x3C\x2F\xFF\x3E\x76\x59\xFF\x54\xC7\x92\xFF\x57\xCD\x97\xFF" - "\x54\xC3\x91\xFF\x3D\x74\x58\xFF\x2A\x31\x28\xFF\x27\x26\x1F\xFF\x27\x25\x20\xFF\x26\x25\x1F\xFF\x27\x26\x20\xFF\x27\x26\x20\xFF" - "\x27\x24\x1F\xFF\x27\x25\x1F\xFF\x27\x25\x1F\xFF\x26\x25\x20\xFF\x27\x24\x1F\xFF\x27\x26\x1F\xFF\x27\x26\x1F\xFF\x23\x23\x1D\xFF" - "\x25\x23\x1E\xFF\x27\x26\x1F\xFF\x27\x24\x1E\xFF\x29\x26\x20\xFF\x26\x25\x1F\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF" - "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" - "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF\x49\x98\x72\xFF\x2E\x44\x36\xFF" - "\x33\x51\x3F\xFF\x4F\xB4\x86\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x53\xC0\x8F\xFF\x3D\x73\x57\xFF\x2F\x3E\x32\xFF\x2C\x38\x2C\xFF" - "\x2F\x42\x35\xFF\x41\x83\x62\xFF\x55\xC8\x94\xFF\x43\x8F\x6A\xFF\x2E\x3A\x2F\xFF\x39\x66\x4E\xFF\x52\xBB\x8B\xFF\x56\xCD\x97\xFF" - "\x56\xCB\x97\xFF\x48\x9C\x75\xFF\x2E\x42\x34\xFF\x28\x29\x22\xFF\x28\x27\x21\xFF\x28\x26\x1F\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF" - "\x28\x26\x20\xFF\x2A\x27\x21\xFF\x27\x26\x20\xFF\x25\x23\x1E\xFF\x29\x26\x21\xFF\x29\x28\x22\xFF\x26\x25\x1F\xFF\x25\x22\x1D\xFF" - "\x27\x24\x1F\xFF\x28\x25\x1F\xFF\x27\x24\x1E\xFF\x27\x26\x1F\xFF\x27\x25\x1F\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF" - "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" - "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x56\xCD\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCD\x97\xFF\x57\xCD\x98\xFF\x41\x80\x61\xFF\x2B\x39\x2E\xFF" - "\x33\x58\x44\xFF\x54\xC7\x93\xFF\x56\xCD\x98\xFF\x56\xCC\x97\xFF\x55\xC9\x94\xFF\x46\x96\x70\xFF\x34\x5B\x46\xFF\x32\x51\x3E\xFF" - "\x38\x67\x4D\xFF\x49\xA3\x79\xFF\x56\xCD\x97\xFF\x4C\xAC\x80\xFF\x2F\x3D\x31\xFF\x36\x58\x44\xFF\x4E\xAF\x82\xFF\x56\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x52\xBF\x8E\xFF\x39\x69\x50\xFF\x2A\x30\x26\xFF\x26\x25\x1F\xFF\x26\x23\x1E\xFF\x27\x25\x1E\xFF\x28\x25\x20\xFF" - "\x28\x26\x21\xFF\x28\x25\x20\xFF\x26\x25\x1E\xFF\x27\x25\x1F\xFF\x28\x26\x21\xFF\x28\x26\x20\xFF\x28\x26\x1F\xFF\x25\x24\x1D\xFF" - "\x25\x24\x1E\xFF\x25\x25\x1F\xFF\x24\x23\x1D\xFF\x26\x24\x1F\xFF\x25\x22\x1D\xFF\x23\x23\x1D\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF" - "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" - "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x56\xCC\x98\xFF\x56\xCC\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x44\x8C\x69\xFF\x2D\x40\x31\xFF" - "\x33\x55\x41\xFF\x52\xBE\x8D\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x55\xC9\x95\xFF\x50\xBA\x8A\xFF\x4D\xAD\x80\xFF" - "\x52\xC0\x8D\xFF\x56\xCC\x97\xFF\x57\xCD\x97\xFF\x4A\xA5\x7A\xFF\x2E\x3B\x2F\xFF\x36\x5A\x45\xFF\x4F\xB1\x83\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x42\x8A\x68\xFF\x2B\x3B\x2E\xFF\x28\x28\x20\xFF\x27\x24\x1E\xFF\x28\x25\x1F\xFF\x28\x25\x1F\xFF" - "\x24\x23\x1E\xFF\x25\x24\x1E\xFF\x27\x25\x1F\xFF\x28\x26\x20\xFF\x26\x25\x1F\xFF\x27\x26\x1F\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF" - "\x27\x25\x1F\xFF\x26\x24\x1E\xFF\x25\x24\x1D\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF" - "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" - "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x99\xFF\x56\xCD\x97\xFF\x56\xCD\x98\xFF\x49\x9E\x77\xFF\x31\x47\x38\xFF" - "\x2F\x4A\x39\xFF\x4B\xA9\x7E\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x58\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF" - "\x57\xCE\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x40\x80\x61\xFF\x2E\x3B\x2F\xFF\x38\x6A\x50\xFF\x52\xBF\x8E\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x4D\xAC\x80\xFF\x2F\x4B\x3A\xFF\x28\x2A\x21\xFF\x27\x26\x1F\xFF\x28\x25\x1F\xFF\x29\x26\x21\xFF" - "\x26\x23\x1F\xFF\x27\x26\x20\xFF\x27\x25\x1F\xFF\x27\x25\x20\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x1F\xFF\x28\x25\x20\xFF" - "\x27\x25\x20\xFF\x26\x25\x1F\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x26\x24\x1E\xFF\x24\x23\x1D\xFF\x27\x24\x1F\xFF\x24\x22\x1D\xFF" - "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" - "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCA\x96\xFF\x53\xC1\x8F\xFF\x57\xC7\x94\xFF\x57\xCC\x97\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x97\xFF\x56\xCC\x97\xFF\x56\xCD\x97\xFF\x51\xBA\x89\xFF\x37\x5E\x47\xFF" - "\x2D\x39\x2E\xFF\x39\x6B\x52\xFF\x52\xBE\x8D\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCB\x97\xFF\x4C\xA8\x7C\xFF\x31\x4D\x3B\xFF\x2F\x3F\x31\xFF\x41\x86\x65\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF" - "\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xC9\x96\xFF\x39\x63\x4D\xFF\x27\x2D\x26\xFF\x26\x27\x1F\xFF\x27\x26\x20\xFF\x24\x23\x1D\xFF" - "\x24\x22\x1D\xFF\x26\x24\x1D\xFF\x27\x26\x20\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF\x26\x25\x1F\xFF\x26\x23\x1F\xFF\x25\x23\x1E\xFF" - "\x25\x24\x1F\xFF\x26\x23\x1E\xFF\x28\x26\x20\xFF\x28\x26\x21\xFF\x27\x24\x1F\xFF\x27\x25\x1F\xFF\x26\x23\x1E\xFF\x27\x24\x20\xFF" - "\x4F\xBA\x8A\xFF\x50\xBD\x8C\xFF\x51\xC0\x8F\xFF\x52\xC2\x90\xFF\x53\xC4\x92\xFF\x54\xC6\x93\xFF\x54\xC8\x94\xFF\x55\xC8\x95\xFF" - "\x55\xCA\x96\xFF\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x55\xC8\x94\xFF\x49\x9E\x76\xFF\x43\x8B\x68\xFF\x50\xB5\x87\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCD\x97\xFF\x48\x9A\x72\xFF" - "\x2C\x3B\x2F\xFF\x30\x42\x34\xFF\x3F\x7C\x5D\xFF\x51\xBB\x8B\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF" - "\x56\xC9\x95\xFF\x4C\xA9\x7D\xFF\x37\x5F\x49\xFF\x2C\x3A\x2E\xFF\x36\x5D\x47\xFF\x50\xB4\x86\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCC\x99\xFF\x57\xCC\x98\xFF\x57\xCD\x98\xFF\x44\x8C\x69\xFF\x29\x30\x27\xFF\x27\x27\x20\xFF\x27\x26\x1F\xFF\x25\x23\x1E\xFF" - "\x23\x22\x1C\xFF\x26\x23\x1E\xFF\x27\x25\x20\xFF\x27\x25\x20\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x27\x25\x1F\xFF\x26\x23\x1D\xFF" - "\x27\x24\x1F\xFF\x26\x24\x1E\xFF\x26\x25\x1F\xFF\x25\x23\x1E\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF" - "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC4\x92\xFF\x54\xC6\x93\xFF\x54\xC8\x94\xFF\x55\xC9\x95\xFF" - "\x55\xCA\x96\xFF\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x4C\xAA\x7F\xFF\x35\x5E\x49\xFF\x35\x59\x45\xFF" - "\x46\x99\x72\xFF\x55\xC8\x94\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x55\xC8\x94\xFF" - "\x3B\x6C\x51\xFF\x2C\x3A\x2E\xFF\x2E\x3F\x31\xFF\x38\x5F\x49\xFF\x46\x94\x6F\xFF\x4E\xB1\x83\xFF\x50\xB9\x88\xFF\x4C\xAA\x7F\xFF" - "\x41\x80\x61\xFF\x32\x50\x3E\xFF\x2C\x3A\x2E\xFF\x2B\x40\x32\xFF\x4B\xA7\x7C\xFF\x57\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x4F\xB6\x86\xFF\x2D\x38\x2D\xFF\x29\x2A\x23\xFF\x27\x25\x1F\xFF\x26\x23\x1E\xFF" - "\x26\x24\x1F\xFF\x27\x26\x20\xFF\x29\x26\x21\xFF\x27\x25\x20\xFF\x28\x26\x1F\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x25\x22\x1D\xFF" - "\x25\x24\x1E\xFF\x25\x24\x1E\xFF\x25\x24\x1F\xFF\x24\x23\x1D\xFF\x25\x24\x1E\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF" - "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x54\xC8\x94\xFF\x55\xC9\x95\xFF" - "\x55\xCA\x96\xFF\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x55\xC7\x94\xFF\x40\x7B\x5D\xFF\x2C\x3B\x2E\xFF" - "\x2B\x37\x2C\xFF\x35\x5B\x46\xFF\x48\x9E\x76\xFF\x52\xBF\x8D\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x54\xC4\x91\xFF\x44\x89\x67\xFF\x31\x4D\x3C\xFF\x29\x37\x2C\xFF\x2C\x39\x2D\xFF\x2C\x3A\x2E\xFF\x2D\x3C\x2E\xFF\x2C\x3B\x2E\xFF" - "\x2C\x39\x2D\xFF\x2E\x41\x32\xFF\x38\x60\x4B\xFF\x4B\xA2\x79\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x97\xFF\x57\xCC\x97\xFF\x33\x52\x3F\xFF\x28\x2C\x23\xFF\x28\x27\x1F\xFF\x27\x24\x1F\xFF" - "\x23\x22\x1D\xFF\x26\x25\x1F\xFF\x27\x24\x1F\xFF\x24\x23\x1E\xFF\x27\x24\x1F\xFF\x27\x25\x1F\xFF\x26\x25\x1F\xFF\x26\x24\x1F\xFF" - "\x25\x22\x1D\xFF\x27\x24\x1F\xFF\x27\x26\x21\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF\x26\x23\x1F\xFF\x26\x23\x1F\xFF\x27\x24\x1F\xFF" - "\x4F\xBC\x8B\xFF\x51\xBF\x8D\xFF\x52\xC1\x8F\xFF\x53\xC4\x91\xFF\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x54\xC8\x94\xFF\x55\xC9\x95\xFF" - "\x55\xCA\x96\xFF\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x4A\xA4\x7A\xFF\x30\x4B\x39\xFF" - "\x2A\x30\x28\xFF\x2A\x32\x28\xFF\x2E\x40\x32\xFF\x38\x67\x4E\xFF\x48\x9B\x74\xFF\x53\xC0\x8F\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x55\xC8\x94\xFF\x4A\xA5\x7A\xFF\x3F\x7D\x5E\xFF\x37\x62\x4C\xFF\x31\x4C\x3A\xFF\x31\x49\x39\xFF\x35\x57\x42\xFF" - "\x3A\x6B\x52\xFF\x44\x8D\x6A\xFF\x50\xBB\x8B\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCA\x96\xFF\x4F\xAC\x80\xFF\x2F\x4A\x39\xFF\x28\x2A\x23\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF" - "\x25\x23\x1E\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF\x29\x26\x21\xFF\x28\x26\x20\xFF\x27\x24\x1F\xFF\x27\x25\x1F\xFF" - "\x28\x25\x20\xFF\x26\x25\x1F\xFF\x25\x24\x1F\xFF\x27\x25\x1F\xFF\x26\x23\x1E\xFF\x28\x25\x20\xFF\x27\x25\x1F\xFF\x26\x25\x20\xFF" - "\x50\xBC\x8C\xFF\x51\xBF\x8D\xFF\x52\xC1\x8F\xFF\x53\xC4\x91\xFF\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" - "\x55\xCA\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x54\xC6\x93\xFF\x41\x82\x62\xFF" - "\x2D\x3C\x30\xFF\x2B\x34\x29\xFF\x29\x2F\x26\xFF\x27\x30\x27\xFF\x2F\x42\x34\xFF\x38\x63\x4C\xFF\x48\x98\x72\xFF\x55\xC6\x93\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x55\xC7\x94\xFF\x52\xBC\x8C\xFF\x4F\xB2\x84\xFF\x4E\xB0\x83\xFF\x53\xB7\x88\xFF" - "\x53\xC0\x8E\xFF\x55\xC9\x95\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCD\x97\xFF\x52\xBC\x8C\xFF\x40\x81\x62\xFF\x32\x4E\x3D\xFF\x29\x2C\x25\xFF\x29\x27\x21\xFF\x29\x27\x20\xFF\x27\x25\x1F\xFF" - "\x25\x23\x1E\xFF\x26\x24\x1F\xFF\x26\x26\x20\xFF\x26\x25\x20\xFF\x26\x25\x1F\xFF\x28\x26\x20\xFF\x27\x25\x20\xFF\x29\x26\x20\xFF" - "\x27\x25\x1F\xFF\x28\x25\x20\xFF\x25\x23\x1E\xFF\x26\x24\x1E\xFF\x26\x25\x20\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x27\x25\x1F\xFF" - "\x50\xBD\x8C\xFF\x51\xC0\x8E\xFF\x52\xC2\x90\xFF\x53\xC4\x91\xFF\x54\xC6\x93\xFF\x54\xC7\x93\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" - "\x55\xCA\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x97\xFF\x56\xCC\x97\xFF" - "\x52\xBA\x8B\xFF\x42\x85\x64\xFF\x36\x59\x46\xFF\x2F\x40\x33\xFF\x2B\x31\x28\xFF\x2B\x31\x27\xFF\x2C\x36\x2B\xFF\x31\x4B\x3A\xFF" - "\x41\x82\x61\xFF\x4C\xA8\x7E\xFF\x52\xBC\x8C\xFF\x55\xC9\x95\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x97\xFF\x54\xC8\x93\xFF\x51\xB8\x89\xFF" - "\x3F\x82\x62\xFF\x2F\x47\x38\xFF\x2A\x34\x29\xFF\x26\x2B\x22\xFF\x27\x27\x21\xFF\x26\x25\x1F\xFF\x26\x26\x1F\xFF\x26\x25\x1E\xFF" - "\x27\x24\x20\xFF\x27\x24\x20\xFF\x28\x26\x20\xFF\x28\x26\x21\xFF\x26\x25\x1F\xFF\x26\x25\x1F\xFF\x28\x25\x20\xFF\x26\x23\x1E\xFF" - "\x26\x23\x1E\xFF\x27\x25\x20\xFF\x26\x25\x1F\xFF\x28\x27\x20\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x28\x26\x1F\xFF" - "\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC4\x92\xFF\x54\xC6\x93\xFF\x54\xC8\x94\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" - "\x55\xCA\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x56\xCB\x96\xFF\x50\xBA\x8A\xFF\x46\x94\x6F\xFF\x38\x64\x4B\xFF\x2D\x3F\x32\xFF\x29\x33\x29\xFF\x29\x32\x27\xFF" - "\x2A\x35\x29\xFF\x30\x43\x34\xFF\x38\x61\x4A\xFF\x40\x81\x61\xFF\x49\x9F\x78\xFF\x4E\xB0\x83\xFF\x52\xC0\x8E\xFF\x56\xCB\x97\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xC9\x95\xFF\x4F\xB7\x86\xFF\x48\x9B\x74\xFF\x3F\x7E\x5F\xFF\x35\x5A\x44\xFF" - "\x2A\x36\x2B\xFF\x2B\x34\x2A\xFF\x2B\x37\x2C\xFF\x2D\x3D\x30\xFF\x28\x29\x21\xFF\x25\x25\x1E\xFF\x26\x25\x20\xFF\x26\x26\x1E\xFF" - "\x27\x24\x1F\xFF\x27\x25\x1F\xFF\x27\x24\x1F\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x24\x23\x1D\xFF\x28\x24\x1F\xFF\x25\x22\x1E\xFF" - "\x25\x22\x1E\xFF\x24\x25\x1F\xFF\x27\x25\x20\xFF\x29\x27\x21\xFF\x26\x23\x1E\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x26\x25\x1E\xFF" - "\x51\xBF\x8D\xFF\x52\xC1\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC6\x93\xFF\x54\xC8\x94\xFF\x55\xC8\x95\xFF\x55\xCA\x96\xFF" - "\x55\xCA\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x51\xBD\x8C\xFF\x49\xA2\x79\xFF\x3D\x72\x57\xFF\x31\x47\x37\xFF" - "\x2D\x36\x2C\xFF\x2B\x34\x29\xFF\x2A\x33\x28\xFF\x29\x34\x29\xFF\x2F\x43\x35\xFF\x31\x4D\x3C\xFF\x35\x5A\x45\xFF\x3A\x67\x50\xFF" - "\x3D\x73\x57\xFF\x3B\x6B\x52\xFF\x39\x66\x4D\xFF\x37\x61\x4A\xFF\x33\x53\x3F\xFF\x2E\x42\x34\xFF\x29\x35\x2A\xFF\x2A\x34\x2A\xFF" - "\x2B\x3B\x2F\xFF\x37\x5F\x49\xFF\x46\x95\x6F\xFF\x47\x97\x70\xFF\x28\x2E\x25\xFF\x25\x25\x1F\xFF\x27\x24\x1F\xFF\x27\x25\x1F\xFF" - "\x28\x25\x20\xFF\x26\x25\x1F\xFF\x25\x24\x1E\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x25\x23\x1E\xFF" - "\x26\x23\x1E\xFF\x24\x24\x1E\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x25\x22\x1D\xFF\x28\x25\x1F\xFF\x26\x25\x1F\xFF\x25\x25\x1F\xFF" - "\x51\xC0\x8E\xFF\x52\xC2\x90\xFF\x53\xC4\x91\xFF\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x54\xC8\x94\xFF\x55\xC9\x95\xFF\x55\xCA\x96\xFF" - "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCD\x98\xFF\x57\xCC\x97\xFF\x57\xCD\x98\xFF\x54\xC7\x94\xFF" - "\x4A\x9E\x77\xFF\x3E\x75\x58\xFF\x35\x57\x42\xFF\x2E\x40\x32\xFF\x28\x33\x28\xFF\x29\x33\x28\xFF\x28\x32\x27\xFF\x29\x32\x28\xFF" - "\x29\x31\x27\xFF\x2A\x32\x2A\xFF\x2C\x34\x2A\xFF\x2B\x34\x2A\xFF\x2B\x37\x2C\xFF\x2F\x42\x35\xFF\x35\x55\x42\xFF\x3E\x74\x58\xFF" - "\x4E\xB2\x85\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x45\x90\x6B\xFF\x2B\x32\x28\xFF\x25\x25\x20\xFF\x27\x24\x20\xFF\x29\x25\x20\xFF" - "\x25\x23\x1E\xFF\x26\x24\x1F\xFF\x27\x26\x1F\xFF\x25\x23\x1D\xFF\x25\x25\x1F\xFF\x26\x25\x1F\xFF\x26\x25\x1F\xFF\x27\x24\x1F\xFF" - "\x26\x24\x1F\xFF\x22\x21\x1C\xFF\x25\x21\x1D\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF\x27\x25\x1F\xFF\x25\x25\x1F\xFF\x27\x26\x20\xFF" - "\x51\xC0\x8F\xFF\x52\xC2\x90\xFF\x53\xC4\x92\xFF\x54\xC6\x93\xFF\x54\xC7\x93\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF\x55\xCA\x96\xFF" - "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x56\xCA\x96\xFF\x50\xB8\x89\xFF\x48\x9C\x74\xFF\x41\x83\x62\xFF\x3E\x76\x59\xFF\x38\x66\x4D\xFF\x34\x56\x42\xFF" - "\x31\x4A\x38\xFF\x33\x51\x3F\xFF\x38\x5E\x48\xFF\x3B\x6B\x51\xFF\x41\x83\x62\xFF\x48\x9B\x74\xFF\x4F\xB5\x86\xFF\x55\xC9\x95\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x55\xC5\x92\xFF\x38\x66\x4E\xFF\x2A\x2E\x26\xFF\x28\x26\x21\xFF\x28\x25\x20\xFF\x27\x25\x1F\xFF" - "\x25\x25\x1E\xFF\x26\x25\x1F\xFF\x26\x25\x20\xFF\x22\x23\x1D\xFF\x27\x25\x20\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF\x26\x24\x1F\xFF" - "\x25\x23\x1D\xFF\x25\x22\x1D\xFF\x26\x24\x1E\xFF\x26\x24\x1F\xFF\x27\x26\x20\xFF\x27\x27\x1F\xFF\x27\x25\x20\xFF\x28\x25\x20\xFF" - "\x52\xC1\x8F\xFF\x52\xC3\x90\xFF\x53\xC4\x92\xFF\x54\xC6\x93\xFF\x54\xC8\x94\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF\x55\xCA\x96\xFF" - "\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCB\x96\xFF\x54\xC5\x92\xFF\x52\xBE\x8D\xFF\x51\xB7\x88\xFF" - "\x4F\xB2\x84\xFF\x4F\xB5\x87\xFF\x52\xBB\x8B\xFF\x53\xC1\x8F\xFF\x55\xCA\x95\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x49\x9C\x75\xFF\x2F\x44\x35\xFF\x26\x27\x23\xFF\x26\x25\x1E\xFF\x29\x26\x20\xFF\x26\x26\x1E\xFF" - "\x26\x22\x1D\xFF\x26\x23\x1F\xFF\x27\x25\x20\xFF\x27\x24\x20\xFF\x27\x24\x1F\xFF\x25\x23\x1D\xFF\x26\x25\x1E\xFF\x28\x25\x20\xFF" - "\x26\x24\x1D\xFF\x27\x24\x1F\xFF\x27\x25\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x25\x1E\xFF\x27\x25\x1F\xFF\x27\x24\x1F\xFF" - "\x52\xC2\x90\xFF\x53\xC4\x91\xFF\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x54\xC8\x94\xFF\x55\xC9\x95\xFF\x55\xCA\x96\xFF\x55\xCA\x96\xFF" - "\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF" - "\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF" - "\x51\xBC\x8B\xFF\x43\x8C\x69\xFF\x30\x48\x39\xFF\x2A\x2D\x27\xFF\x24\x25\x20\xFF\x24\x24\x1E\xFF\x25\x24\x1E\xFF\x25\x22\x1D\xFF" - "\x27\x25\x1F\xFF\x28\x26\x20\xFF\x25\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x25\x1F\xFF\x27\x24\x1F\xFF\x28\x25\x1F\xFF\x25\x24\x1E\xFF" - "\x25\x22\x1D\xFF\x27\x25\x1F\xFF\x27\x26\x20\xFF\x26\x24\x1E\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF\x29\x26\x21\xFF\x26\x26\x20\xFF" - "\x52\xC3\x90\xFF\x53\xC4\x92\xFF\x54\xC6\x93\xFF\x54\xC8\x94\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF\x55\xCA\x96\xFF\x56\xCB\x96\xFF" - "\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x52\xBE\x8D\xFF\x48\x9A\x73\xFF" - "\x38\x63\x4D\xFF\x2C\x39\x2E\xFF\x27\x2B\x24\xFF\x27\x26\x21\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF\x25\x24\x1D\xFF\x25\x26\x1D\xFF" - "\x25\x24\x1F\xFF\x27\x25\x1E\xFF\x26\x25\x1E\xFF\x26\x23\x1E\xFF\x25\x23\x1E\xFF\x26\x25\x20\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF" - "\x27\x25\x1F\xFF\x26\x25\x1E\xFF\x25\x24\x1D\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x27\x24\x20\xFF\x25\x23\x1E\xFF\x26\x24\x1F\xFF" - "\x53\xC4\x91\xFF\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x54\xC8\x94\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF\x55\xCA\x96\xFF\x56\xCB\x96\xFF" - "\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x58\xCC\x99\xFF\x57\xCD\x98\xFF\x57\xCD\x99\xFF\x57\xCD\x98\xFF\x52\xBE\x8D\xFF\x43\x8C\x68\xFF\x35\x5D\x47\xFF\x2E\x40\x32\xFF" - "\x27\x2C\x26\xFF\x28\x2A\x23\xFF\x29\x29\x22\xFF\x27\x26\x20\xFF\x23\x22\x1C\xFF\x25\x23\x1D\xFF\x26\x24\x1E\xFF\x27\x25\x20\xFF" - "\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x26\x1E\xFF\x28\x25\x20\xFF\x26\x24\x1D\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF\x24\x23\x1E\xFF" - "\x25\x22\x1C\xFF\x25\x23\x1E\xFF\x25\x23\x1D\xFF\x25\x24\x1E\xFF\x26\x23\x1F\xFF\x28\x25\x20\xFF\x27\x24\x1E\xFF\x27\x24\x1E\xFF" - "\x53\xC4\x92\xFF\x54\xC6\x93\xFF\x54\xC7\x92\xFF\x55\xC8\x94\xFF\x55\xC9\x95\xFF\x54\xC9\x95\xFF\x54\xC9\x95\xFF\x55\xCA\x95\xFF" - "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x56\xCD\x99\xFF\x56\xCD\x97\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCE\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x99\xFF" - "\x56\xCD\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x58\xCD\x98\xFF\x56\xCD\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x54\xC7\x93\xFF" - "\x51\xBC\x8B\xFF\x4E\xAF\x83\xFF\x46\x92\x6D\xFF\x39\x67\x4E\xFF\x2D\x3B\x30\xFF\x2B\x32\x29\xFF\x29\x2D\x24\xFF\x28\x28\x22\xFF" - "\x27\x26\x20\xFF\x27\x25\x1F\xFF\x28\x26\x20\xFF\x28\x25\x20\xFF\x26\x25\x1F\xFF\x26\x26\x1F\xFF\x26\x25\x1E\xFF\x28\x25\x20\xFF" - "\x2A\x27\x22\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x26\x23\x1C\xFF\x26\x23\x1E\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF" - "\x26\x24\x1F\xFF\x28\x25\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x25\x23\x1E\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x25\x24\x1E\xFF" - "\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x53\xC8\x93\xFF\x54\xC8\x94\xFF\x55\xC8\x94\xFF\x52\xBD\x8C\xFF\x4C\xAD\x80\xFF\x4B\xA7\x7D\xFF" - "\x48\xA1\x77\xFF\x48\xA0\x77\xFF\x4B\xA7\x7D\xFF\x4F\xB0\x83\xFF\x51\xB9\x8A\xFF\x52\xC0\x8E\xFF\x55\xC6\x92\xFF\x56\xCB\x96\xFF" - "\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x97\xFF" - "\x57\xCD\x98\xFF\x56\xCB\x97\xFF\x54\xC4\x91\xFF\x50\xBA\x8B\xFF\x4E\xAF\x81\xFF\x49\x9F\x77\xFF\x43\x8B\x68\xFF\x3F\x78\x5B\xFF" - "\x37\x61\x4A\xFF\x30\x48\x38\xFF\x2A\x35\x2B\xFF\x2A\x30\x27\xFF\x28\x2B\x22\xFF\x27\x27\x20\xFF\x28\x26\x20\xFF\x28\x25\x20\xFF" - "\x27\x24\x1F\xFF\x25\x24\x1D\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x27\x26\x20\xFF" - "\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x27\x24\x20\xFF\x28\x27\x20\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x26\x24\x1F\xFF\x27\x24\x20\xFF" - "\x26\x24\x1E\xFF\x27\x24\x1E\xFF\x25\x22\x1D\xFF\x26\x24\x1E\xFF\x26\x25\x1F\xFF\x27\x25\x1F\xFF\x27\x26\x1F\xFF\x26\x24\x1E\xFF" - "\x54\xC6\x92\xFF\x54\xC8\x94\xFF\x54\xC8\x94\xFF\x54\xC8\x94\xFF\x44\x8C\x69\xFF\x37\x5E\x49\xFF\x32\x4D\x3C\xFF\x31\x49\x38\xFF" - "\x2D\x42\x33\xFF\x2D\x44\x33\xFF\x2E\x47\x37\xFF\x32\x4E\x3C\xFF\x35\x54\x42\xFF\x34\x58\x43\xFF\x34\x5C\x45\xFF\x38\x63\x4C\xFF" - "\x3C\x6F\x55\xFF\x40\x7B\x5C\xFF\x43\x87\x65\xFF\x45\x91\x6D\xFF\x44\x8E\x6B\xFF\x43\x8A\x68\xFF\x43\x86\x65\xFF\x41\x81\x61\xFF" - "\x3D\x75\x59\xFF\x38\x67\x4E\xFF\x36\x5C\x47\xFF\x33\x55\x42\xFF\x33\x4E\x3C\xFF\x2F\x41\x34\xFF\x2A\x34\x2A\xFF\x2B\x31\x27\xFF" - "\x27\x2C\x23\xFF\x29\x2B\x23\xFF\x28\x29\x22\xFF\x26\x25\x20\xFF\x29\x28\x22\xFF\x27\x26\x20\xFF\x27\x25\x20\xFF\x27\x24\x20\xFF" - "\x29\x26\x21\xFF\x27\x25\x1F\xFF\x27\x25\x20\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF\x25\x25\x1F\xFF\x26\x25\x1E\xFF\x28\x26\x21\xFF" - "\x27\x25\x20\xFF\x25\x25\x1E\xFF\x25\x24\x1F\xFF\x27\x25\x20\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF\x26\x24\x20\xFF\x25\x24\x1F\xFF" - "\x26\x25\x1F\xFF\x26\x23\x1E\xFF\x23\x21\x1C\xFF\x25\x23\x1C\xFF\x28\x25\x20\xFF\x26\x25\x1F\xFF\x28\x27\x1F\xFF\x27\x25\x1F\xFF" - "\x53\xC7\x92\xFF\x53\xC8\x94\xFF\x53\xC3\x91\xFF\x3E\x7B\x5D\xFF\x2B\x35\x2D\xFF\x25\x2B\x22\xFF\x23\x26\x1E\xFF\x25\x26\x20\xFF" - "\x24\x24\x1E\xFF\x27\x27\x1F\xFF\x28\x28\x22\xFF\x28\x29\x23\xFF\x27\x29\x23\xFF\x27\x29\x23\xFF\x2A\x2C\x25\xFF\x2A\x2D\x25\xFF" - "\x27\x2D\x25\xFF\x27\x2D\x25\xFF\x27\x2D\x24\xFF\x29\x30\x27\xFF\x29\x2F\x28\xFF\x28\x2F\x26\xFF\x29\x30\x27\xFF\x29\x2F\x26\xFF" - "\x28\x2C\x23\xFF\x2A\x2D\x24\xFF\x29\x2B\x23\xFF\x28\x29\x22\xFF\x27\x27\x21\xFF\x26\x26\x21\xFF\x27\x26\x1F\xFF\x29\x26\x21\xFF" - "\x26\x26\x20\xFF\x26\x24\x1F\xFF\x26\x24\x1E\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x24\x1E\xFF\x26\x25\x1F\xFF" - "\x28\x25\x20\xFF\x28\x25\x20\xFF\x29\x27\x21\xFF\x29\x26\x21\xFF\x27\x24\x20\xFF\x25\x24\x1F\xFF\x25\x24\x1F\xFF\x28\x25\x21\xFF" - "\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x29\x26\x20\xFF\x26\x25\x20\xFF\x29\x26\x21\xFF\x26\x23\x1F\xFF\x27\x26\x20\xFF\x27\x24\x1F\xFF" - "\x27\x24\x1F\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x26\x25\x1F\xFF\x25\x22\x1D\xFF\x25\x23\x1F\xFF\x26\x25\x20\xFF\x26\x25\x1F\xFF" - "\x53\xC8\x94\xFF\x54\xC8\x95\xFF\x49\xA4\x7A\xFF\x30\x49\x39\xFF\x26\x29\x23\xFF\x24\x25\x1F\xFF\x23\x22\x1D\xFF\x25\x22\x1D\xFF" - "\x25\x24\x1D\xFF\x28\x25\x1F\xFF\x28\x26\x20\xFF\x26\x25\x1F\xFF\x25\x24\x1F\xFF\x27\x25\x20\xFF\x27\x25\x20\xFF\x25\x24\x1F\xFF" - "\x26\x25\x1E\xFF\x28\x26\x20\xFF\x28\x27\x20\xFF\x26\x25\x1F\xFF\x27\x26\x20\xFF\x28\x26\x21\xFF\x27\x26\x20\xFF\x26\x25\x20\xFF" - "\x27\x25\x20\xFF\x26\x25\x1F\xFF\x26\x26\x20\xFF\x27\x26\x1F\xFF\x25\x25\x20\xFF\x24\x23\x1D\xFF\x25\x24\x1D\xFF\x27\x25\x1F\xFF" - "\x25\x25\x1E\xFF\x26\x23\x1F\xFF\x27\x25\x1F\xFF\x27\x26\x21\xFF\x29\x27\x22\xFF\x27\x25\x20\xFF\x26\x24\x1D\xFF\x26\x25\x1E\xFF" - "\x27\x26\x20\xFF\x2A\x27\x21\xFF\x29\x27\x21\xFF\x27\x25\x1F\xFF\x25\x22\x1F\xFF\x24\x22\x1D\xFF\x25\x23\x1D\xFF\x28\x26\x21\xFF" - "\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x26\x24\x1F\xFF\x27\x26\x20\xFF\x26\x25\x1F\xFF" - "\x26\x23\x1F\xFF\x28\x25\x21\xFF\x28\x25\x20\xFF\x26\x25\x1E\xFF\x26\x25\x1F\xFF\x26\x25\x1F\xFF\x26\x26\x1F\xFF\x26\x24\x1F\xFF" - "\x55\xC8\x94\xFF\x54\xC8\x94\xFF\x40\x80\x60\xFF\x29\x36\x2A\xFF\x26\x26\x20\xFF\x24\x23\x1D\xFF\x24\x22\x1D\xFF\x27\x23\x1F\xFF" - "\x25\x23\x1D\xFF\x26\x24\x1F\xFF\x27\x27\x20\xFF\x29\x27\x21\xFF\x26\x24\x1F\xFF\x24\x24\x1E\xFF\x26\x25\x1F\xFF\x26\x24\x1F\xFF" - "\x27\x24\x1F\xFF\x29\x27\x20\xFF\x29\x26\x20\xFF\x25\x24\x1E\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x26\x24\x1D\xFF" - "\x28\x25\x20\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x25\x24\x1F\xFF\x28\x25\x1F\xFF\x27\x25\x1E\xFF\x27\x24\x1F\xFF" - "\x27\x25\x1F\xFF\x27\x25\x1F\xFF\x25\x25\x1F\xFF\x25\x24\x1E\xFF\x26\x23\x1F\xFF\x27\x24\x20\xFF\x27\x25\x1F\xFF\x26\x24\x1F\xFF" - "\x25\x24\x1E\xFF\x28\x25\x20\xFF\x26\x23\x1E\xFF\x24\x23\x1E\xFF\x27\x24\x1F\xFF\x25\x25\x1F\xFF\x26\x24\x1F\xFF\x27\x25\x20\xFF" - "\x27\x24\x1F\xFF\x27\x25\x1F\xFF\x27\x27\x20\xFF\x28\x27\x21\xFF\x24\x24\x1E\xFF\x27\x24\x1F\xFF\x27\x26\x20\xFF\x28\x26\x20\xFF" - "\x26\x24\x1F\xFF\x26\x26\x1F\xFF\x29\x27\x21\xFF\x26\x25\x1F\xFF\x25\x25\x1F\xFF\x26\x25\x1F\xFF\x26\x24\x1F\xFF\x26\x26\x1D\xFF" - "\x54\xC9\x94\xFF\x52\xC1\x8E\xFF\x3A\x6C\x52\xFF\x29\x30\x26\xFF\x25\x25\x1F\xFF\x24\x22\x1D\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF" - "\x26\x23\x1E\xFF\x25\x24\x1F\xFF\x26\x25\x1F\xFF\x26\x26\x20\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x25\x1F\xFF\x28\x26\x20\xFF" - "\x29\x26\x22\xFF\x2A\x27\x21\xFF\x28\x26\x20\xFF\x29\x26\x20\xFF\x27\x24\x1F\xFF\x26\x24\x20\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF" - "\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x28\x26\x20\xFF\x29\x26\x21\xFF\x28\x25\x21\xFF\x27\x25\x20\xFF\x27\x25\x20\xFF\x28\x25\x20\xFF" - "\x27\x24\x1F\xFF\x28\x26\x21\xFF\x25\x23\x1E\xFF\x23\x23\x1D\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x26\x25\x1E\xFF" - "\x23\x23\x1D\xFF\x25\x24\x1F\xFF\x26\x23\x1E\xFF\x26\x24\x1F\xFF\x28\x25\x1F\xFF\x26\x23\x1E\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF" - "\x26\x25\x1F\xFF\x27\x25\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x24\x24\x1E\xFF\x24\x23\x1D\xFF\x26\x24\x1E\xFF\x27\x25\x20\xFF" - "\x27\x26\x20\xFF\x27\x25\x1F\xFF\x28\x25\x1F\xFF\x28\x25\x1E\xFF\x27\x24\x1F\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF" - "\x55\xC9\x94\xFF\x52\xBE\x8C\xFF\x38\x68\x4F\xFF\x29\x2E\x25\xFF\x24\x24\x1D\xFF\x26\x23\x1F\xFF\x28\x25\x20\xFF\x26\x23\x1E\xFF" - "\x25\x23\x1D\xFF\x25\x24\x1E\xFF\x27\x24\x1E\xFF\x27\x24\x1E\xFF\x26\x24\x1F\xFF\x26\x25\x1F\xFF\x27\x25\x20\xFF\x26\x26\x20\xFF" - "\x29\x27\x21\xFF\x27\x25\x20\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF\x27\x24\x20\xFF" - "\x27\x25\x1E\xFF\x26\x25\x1E\xFF\x27\x26\x20\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x27\x25\x1F\xFF\x28\x26\x20\xFF\x28\x26\x20\xFF" - "\x27\x25\x20\xFF\x27\x24\x1F\xFF\x24\x22\x1D\xFF\x25\x23\x1E\xFF\x28\x26\x20\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" - "\x26\x25\x20\xFF\x27\x25\x20\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF\x26\x25\x1E\xFF" - "\x28\x25\x1F\xFF\x27\x26\x20\xFF\x28\x25\x20\xFF\x27\x25\x1F\xFF\x26\x24\x1F\xFF\x25\x24\x1E\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF" - "\x25\x23\x1E\xFF\x26\x24\x1E\xFF\x26\x23\x1E\xFF\x26\x25\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF\x24\x24\x1E\xFF" - "\x55\xCA\x95\xFF\x51\xBB\x8A\xFF\x38\x66\x4D\xFF\x28\x2D\x25\xFF\x24\x22\x1C\xFF\x26\x23\x1D\xFF\x25\x23\x1D\xFF\x25\x24\x1E\xFF" - "\x26\x23\x1E\xFF\x25\x24\x1E\xFF\x25\x25\x1F\xFF\x27\x25\x1F\xFF\x29\x27\x20\xFF\x28\x26\x21\xFF\x27\x24\x1F\xFF\x24\x23\x1D\xFF" - "\x27\x24\x1F\xFF\x28\x25\x20\xFF\x28\x27\x21\xFF\x26\x24\x1F\xFF\x23\x22\x1C\xFF\x25\x24\x1E\xFF\x27\x25\x1F\xFF\x27\x24\x1F\xFF" - "\x25\x25\x1E\xFF\x28\x27\x20\xFF\x27\x25\x1F\xFF\x26\x24\x20\xFF\x29\x26\x21\xFF\x28\x26\x20\xFF\x27\x26\x20\xFF\x2A\x28\x22\xFF" - "\x28\x25\x20\xFF\x28\x25\x20\xFF\x26\x25\x20\xFF\x27\x25\x20\xFF\x26\x23\x1E\xFF\x27\x25\x20\xFF\x27\x26\x1F\xFF\x27\x25\x1F\xFF" - "\x28\x25\x20\xFF\x26\x24\x1E\xFF\x26\x24\x1E\xFF\x24\x21\x1C\xFF\x23\x22\x1C\xFF\x25\x23\x1E\xFF\x25\x25\x1F\xFF\x27\x25\x1E\xFF" - "\x27\x26\x20\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x29\x27\x20\xFF\x27\x24\x20\xFF\x27\x26\x1F\xFF\x27\x25\x1F\xFF\x29\x26\x21\xFF" - "\x25\x24\x1E\xFF\x28\x25\x20\xFF\x26\x24\x1E\xFF\x24\x24\x1E\xFF\x26\x25\x1E\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x24\x23\x1E\xFF" - "\x56\xCB\x96\xFF\x53\xC0\x8F\xFF\x39\x6A\x50\xFF\x28\x2D\x25\xFF\x28\x25\x20\xFF\x28\x25\x1F\xFF\x28\x26\x1F\xFF\x27\x24\x1F\xFF" - "\x28\x25\x20\xFF\x27\x25\x20\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF\x2A\x27\x21\xFF\x2A\x27\x22\xFF\x29\x26\x21\xFF\x29\x26\x21\xFF" - "\x27\x24\x1F\xFF\x27\x25\x1F\xFF\x27\x25\x1F\xFF\x26\x25\x1F\xFF\x25\x23\x1E\xFF\x26\x25\x1F\xFF\x27\x25\x20\xFF\x28\x26\x1F\xFF" - "\x28\x26\x21\xFF\x26\x25\x20\xFF\x27\x25\x20\xFF\x28\x26\x21\xFF\x26\x24\x1F\xFF\x27\x26\x20\xFF\x28\x25\x20\xFF\x27\x25\x1F\xFF" - "\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF\x24\x23\x1D\xFF\x26\x23\x1E\xFF\x26\x25\x1F\xFF\x27\x24\x20\xFF" - "\x25\x25\x1F\xFF\x25\x23\x1E\xFF\x23\x23\x1D\xFF\x25\x22\x1D\xFF\x27\x25\x1D\xFF\x26\x25\x1E\xFF\x28\x27\x20\xFF\x27\x24\x1F\xFF" - "\x27\x24\x1F\xFF\x27\x26\x1F\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x29\x26\x21\xFF\x27\x24\x1F\xFF\x27\x26\x1F\xFF\x27\x25\x1F\xFF" - "\x28\x24\x1F\xFF\x26\x23\x1F\xFF\x26\x23\x1E\xFF\x25\x24\x1E\xFF\x26\x25\x1E\xFF\x25\x23\x1E\xFF\x26\x25\x1F\xFF\x26\x26\x20\xFF" - "\x56\xCB\x96\xFF\x55\xC6\x92\xFF\x3B\x71\x56\xFF\x27\x2F\x26\xFF\x26\x25\x1F\xFF\x24\x23\x1D\xFF\x26\x25\x1F\xFF\x27\x25\x20\xFF" - "\x24\x23\x1D\xFF\x26\x24\x1F\xFF\x27\x25\x20\xFF\x28\x26\x21\xFF\x25\x24\x1E\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF\x27\x25\x1F\xFF" - "\x29\x26\x20\xFF\x27\x24\x1F\xFF\x26\x24\x1E\xFF\x26\x23\x1E\xFF\x27\x25\x1F\xFF\x26\x25\x1E\xFF\x27\x25\x1F\xFF\x27\x24\x1F\xFF" - "\x28\x26\x20\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x28\x26\x21\xFF\x25\x24\x1F\xFF\x28\x26\x21\xFF\x27\x24\x1F\xFF\x26\x25\x1F\xFF" - "\x26\x25\x1F\xFF\x25\x23\x1D\xFF\x26\x24\x1F\xFF\x27\x25\x1F\xFF\x26\x23\x1E\xFF\x25\x23\x1E\xFF\x27\x25\x1F\xFF\x28\x26\x21\xFF" - "\x27\x25\x20\xFF\x25\x24\x1F\xFF\x25\x24\x1E\xFF\x26\x24\x1F\xFF\x28\x26\x20\xFF\x26\x26\x1F\xFF\x26\x25\x1E\xFF\x28\x26\x1F\xFF" - "\x26\x22\x1E\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x27\x25\x20\xFF\x26\x23\x1E\xFF\x26\x24\x1E\xFF\x27\x25\x1F\xFF\x26\x25\x1E\xFF" - "\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x28\x25\x1F\xFF\x27\x25\x1F\xFF\x27\x24\x1E\xFF\x27\x25\x20\xFF\x26\x25\x1F\xFF\x25\x24\x1E\xFF" - "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x43\x87\x66\xFF\x2C\x39\x2D\xFF\x25\x25\x1D\xFF\x25\x22\x1D\xFF\x27\x24\x1F\xFF\x29\x26\x21\xFF" - "\x27\x25\x1F\xFF\x27\x24\x20\xFF\x28\x24\x20\xFF\x28\x27\x22\xFF\x26\x24\x1F\xFF\x25\x24\x1E\xFF\x27\x24\x1F\xFF\x23\x20\x1B\xFF" - "\x23\x23\x1C\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x28\x26\x21\xFF\x27\x24\x1E\xFF\x26\x24\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" - "\x28\x25\x20\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x26\x25\x1F\xFF\x2A\x28\x21\xFF\x29\x26\x20\xFF\x27\x26\x20\xFF" - "\x29\x27\x21\xFF\x29\x27\x20\xFF\x29\x26\x21\xFF\x27\x25\x1F\xFF\x28\x25\x20\xFF\x28\x26\x20\xFF\x29\x26\x20\xFF\x27\x25\x1E\xFF" - "\x28\x23\x20\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x24\x1E\xFF\x25\x24\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x28\x25\x1E\xFF" - "\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x25\x25\x1D\xFF\x25\x22\x1E\xFF\x27\x24\x1F\xFF\x29\x27\x20\xFF\x26\x24\x1E\xFF" - "\x25\x24\x1F\xFF\x28\x26\x20\xFF\x28\x25\x1E\xFF\x25\x24\x1E\xFF\x28\x26\x1E\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF" - "\x55\xCC\x96\xFF\x56\xCC\x97\xFF\x4B\xA6\x7A\xFF\x2E\x47\x36\xFF\x25\x25\x20\xFF\x28\x26\x21\xFF\x29\x26\x21\xFF\x28\x25\x20\xFF" - "\x25\x25\x1F\xFF\x25\x22\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x25\x24\x1E\xFF\x25\x25\x1F\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF" - "\x23\x23\x1D\xFF\x24\x22\x1D\xFF\x25\x23\x1E\xFF\x26\x26\x20\xFF\x26\x24\x1F\xFF\x26\x23\x1F\xFF\x26\x25\x1F\xFF\x24\x23\x1E\xFF" - "\x25\x24\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x25\x23\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x24\x23\x1E\xFF" - "\x26\x23\x1F\xFF\x29\x26\x21\xFF\x26\x23\x1E\xFF\x23\x22\x1D\xFF\x27\x24\x1F\xFF\x28\x25\x1F\xFF\x27\x25\x20\xFF\x28\x26\x20\xFF" - "\x26\x24\x1E\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x27\x25\x1F\xFF\x25\x23\x1E\xFF" - "\x28\x26\x1F\xFF\x27\x24\x1F\xFF\x27\x25\x1F\xFF\x26\x24\x1F\xFF\x29\x26\x21\xFF\x28\x25\x20\xFF\x27\x24\x20\xFF\x24\x22\x1D\xFF" - "\x29\x26\x21\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x27\x25\x20\xFF\x26\x23\x1E\xFF\x28\x25\x20\xFF\x28\x25\x1F\xFF\x25\x23\x1E\xFF" - "\x55\xCC\x97\xFF\x56\xCC\x97\xFF\x51\xBE\x8C\xFF\x32\x52\x3F\xFF\x27\x2A\x22\xFF\x28\x26\x21\xFF\x27\x24\x20\xFF\x27\x25\x20\xFF" - "\x26\x24\x1F\xFF\x29\x26\x21\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x27\x25\x1F\xFF" - "\x26\x25\x20\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x29\x29\x22\xFF\x25\x25\x1F\xFF\x27\x24\x20\xFF\x29\x26\x21\xFF\x26\x24\x1F\xFF" - "\x26\x24\x1E\xFF\x27\x25\x1F\xFF\x29\x26\x21\xFF\x27\x24\x1F\xFF\x26\x25\x1F\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF" - "\x25\x22\x1D\xFF\x25\x22\x1D\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x27\x25\x1F\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF" - "\x26\x25\x1E\xFF\x26\x24\x1F\xFF\x28\x26\x20\xFF\x2A\x27\x22\xFF\x29\x26\x21\xFF\x25\x24\x1E\xFF\x24\x22\x1C\xFF\x24\x23\x1D\xFF" - "\x26\x24\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x28\x25\x1F\xFF\x26\x24\x1F\xFF\x26\x25\x1F\xFF\x26\x25\x1E\xFF\x25\x23\x1D\xFF" - "\x26\x24\x1E\xFF\x24\x23\x1E\xFF\x26\x23\x1E\xFF\x27\x26\x20\xFF\x26\x23\x1E\xFF\x27\x25\x1E\xFF\x28\x25\x1F\xFF\x27\x25\x1F\xFF" - "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x55\xCA\x95\xFF\x39\x6C\x51\xFF\x29\x2F\x26\xFF\x29\x28\x22\xFF\x28\x25\x20\xFF\x29\x27\x22\xFF" - "\x28\x25\x20\xFF\x26\x25\x1F\xFF\x26\x24\x1F\xFF\x27\x25\x20\xFF\x26\x25\x1E\xFF\x26\x24\x1F\xFF\x25\x22\x1E\xFF\x27\x24\x1F\xFF" - "\x25\x25\x1F\xFF\x25\x24\x1F\xFF\x26\x25\x1F\xFF\x25\x23\x1E\xFF\x26\x24\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF" - "\x27\x24\x1F\xFF\x26\x25\x1E\xFF\x28\x26\x20\xFF\x27\x25\x20\xFF\x26\x24\x1E\xFF\x27\x26\x1F\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF" - "\x26\x25\x1F\xFF\x27\x24\x20\xFF\x27\x26\x20\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF" - "\x29\x27\x21\xFF\x28\x25\x20\xFF\x26\x25\x1F\xFF\x29\x26\x21\xFF\x29\x26\x21\xFF\x28\x26\x20\xFF\x27\x25\x1E\xFF\x28\x25\x1E\xFF" - "\x27\x26\x21\xFF\x29\x26\x21\xFF\x27\x24\x1F\xFF\x26\x26\x1E\xFF\x25\x24\x1E\xFF\x26\x24\x1E\xFF\x25\x24\x1E\xFF\x26\x25\x1F\xFF" - "\x24\x23\x1D\xFF\x25\x24\x1D\xFF\x26\x24\x1E\xFF\x27\x24\x1F\xFF\x26\x24\x1E\xFF\x25\x23\x1D\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF" - "\x57\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x4A\xA3\x79\xFF\x29\x35\x2B\xFF\x27\x29\x23\xFF\x27\x25\x1F\xFF\x27\x25\x1E\xFF" - "\x27\x26\x1F\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x29\x27\x20\xFF\x27\x25\x20\xFF\x29\x26\x21\xFF\x25\x23\x1E\xFF\x25\x22\x1D\xFF" - "\x25\x25\x1F\xFF\x25\x24\x1E\xFF\x27\x24\x1F\xFF\x29\x26\x21\xFF\x26\x26\x20\xFF\x26\x24\x1F\xFF\x27\x25\x1F\xFF\x26\x25\x1F\xFF" - "\x28\x25\x20\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x25\x23\x1E\xFF\x29\x26\x21\xFF\x29\x27\x20\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" - "\x25\x22\x1D\xFF\x26\x24\x1E\xFF\x26\x24\x1F\xFF\x24\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF" - "\x26\x23\x1F\xFF\x28\x26\x20\xFF\x27\x26\x20\xFF\x27\x25\x20\xFF\x27\x25\x20\xFF\x26\x24\x1E\xFF\x27\x25\x1F\xFF\x27\x25\x1E\xFF" - "\x27\x24\x1F\xFF\x28\x27\x21\xFF\x27\x25\x20\xFF\x26\x25\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x24\x1E\xFF\x2A\x26\x21\xFF" - "\x28\x25\x20\xFF\x26\x24\x1E\xFF\x26\x24\x1F\xFF\x25\x24\x1E\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x23\x1D\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x55\xC8\x93\xFF\x32\x53\x40\xFF\x28\x2E\x25\xFF\x25\x25\x20\xFF\x24\x23\x1E\xFF" - "\x28\x25\x20\xFF\x28\x26\x21\xFF\x27\x26\x1F\xFF\x27\x26\x20\xFF\x27\x24\x1F\xFF\x27\x26\x1F\xFF\x27\x27\x21\xFF\x26\x25\x20\xFF" - "\x26\x25\x20\xFF\x27\x25\x1F\xFF\x28\x25\x1F\xFF\x26\x24\x1F\xFF\x25\x24\x1E\xFF\x27\x25\x20\xFF\x29\x27\x22\xFF\x27\x25\x20\xFF" - "\x27\x24\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x24\x23\x1D\xFF\x29\x26\x21\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF" - "\x25\x23\x1E\xFF\x28\x25\x20\xFF\x26\x23\x1E\xFF\x25\x23\x1E\xFF\x29\x25\x20\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x25\x1F\xFF" - "\x26\x23\x1E\xFF\x29\x26\x21\xFF\x28\x25\x20\xFF\x25\x25\x1F\xFF\x25\x24\x1E\xFF\x25\x22\x1D\xFF\x27\x25\x1F\xFF\x28\x26\x21\xFF" - "\x26\x24\x1F\xFF\x26\x25\x1F\xFF\x26\x25\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x25\x24\x1F\xFF\x27\x24\x1F\xFF\x28\x26\x20\xFF" - "\x28\x25\x20\xFF\x28\x26\x20\xFF\x28\x25\x1F\xFF\x24\x23\x1D\xFF\x26\x24\x1F\xFF\x26\x25\x1F\xFF\x25\x24\x1E\xFF\x25\x23\x1C\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x97\xFF\x43\x8E\x6A\xFF\x2B\x3C\x2F\xFF\x29\x32\x28\xFF\x28\x30\x26\xFF" - "\x2A\x2F\x28\xFF\x29\x2F\x26\xFF\x29\x2D\x25\xFF\x2A\x2E\x26\xFF\x28\x2B\x23\xFF\x27\x2A\x24\xFF\x28\x2B\x25\xFF\x27\x2A\x23\xFF" - "\x27\x29\x21\xFF\x27\x29\x22\xFF\x27\x28\x20\xFF\x29\x27\x22\xFF\x26\x25\x1F\xFF\x2A\x28\x23\xFF\x28\x28\x21\xFF\x24\x24\x1D\xFF" - "\x26\x23\x1E\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x25\x23\x1E\xFF\x24\x22\x1E\xFF\x26\x23\x1E\xFF\x26\x24\x1F\xFF\x26\x25\x1F\xFF" - "\x26\x24\x1F\xFF\x28\x25\x20\xFF\x28\x26\x21\xFF\x27\x25\x20\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x25\x24\x1F\xFF\x25\x23\x1E\xFF" - "\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x27\x25\x20\xFF\x23\x23\x1D\xFF\x24\x23\x1E\xFF\x25\x23\x1E\xFF\x25\x25\x1F\xFF\x26\x24\x1F\xFF" - "\x28\x25\x20\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF\x27\x24\x20\xFF\x26\x25\x20\xFF\x26\x23\x1E\xFF\x28\x25\x20\xFF\x25\x22\x1D\xFF" - "\x27\x24\x1F\xFF\x27\x25\x20\xFF\x28\x25\x1F\xFF\x26\x24\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x25\x24\x1E\xFF" - "\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x97\xFF\x54\xC5\x93\xFF\x49\xA2\x78\xFF\x47\x94\x6F\xFF\x44\x8D\x6A\xFF" - "\x42\x87\x64\xFF\x40\x7F\x5F\xFF\x3F\x79\x5B\xFF\x3D\x71\x57\xFF\x37\x68\x4F\xFF\x39\x65\x4D\xFF\x38\x60\x4B\xFF\x36\x5E\x49\xFF" - "\x37\x5A\x45\xFF\x32\x51\x3E\xFF\x30\x48\x38\xFF\x2F\x41\x33\xFF\x2A\x35\x2A\xFF\x2C\x31\x2A\xFF\x2B\x31\x29\xFF\x29\x2E\x26\xFF" - "\x2B\x2D\x27\xFF\x28\x2A\x23\xFF\x28\x2A\x23\xFF\x26\x27\x21\xFF\x26\x26\x20\xFF\x26\x25\x1F\xFF\x27\x24\x1E\xFF\x28\x27\x1F\xFF" - "\x27\x26\x1D\xFF\x25\x24\x1F\xFF\x26\x25\x1F\xFF\x26\x24\x1D\xFF\x24\x23\x1D\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF" - "\x29\x26\x21\xFF\x27\x24\x20\xFF\x28\x27\x20\xFF\x27\x26\x1E\xFF\x28\x26\x21\xFF\x26\x24\x1E\xFF\x27\x25\x1F\xFF\x26\x24\x1F\xFF" - "\x26\x26\x1E\xFF\x28\x26\x20\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x27\x25\x20\xFF\x25\x24\x1E\xFF" - "\x28\x25\x20\xFF\x26\x23\x1E\xFF\x29\x26\x21\xFF\x27\x25\x20\xFF\x27\x26\x20\xFF\x26\x25\x1F\xFF\x27\x26\x1F\xFF\x28\x26\x20\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x55\xC9\x95\xFF\x54\xC6\x93\xFF" - "\x53\xBF\x8D\xFF\x4F\xB4\x85\xFF\x4C\xA8\x7D\xFF\x48\x9C\x74\xFF\x44\x8D\x6A\xFF\x41\x82\x62\xFF\x3D\x76\x59\xFF\x3B\x6A\x51\xFF" - "\x36\x5A\x46\xFF\x30\x4B\x3B\xFF\x2C\x3D\x30\xFF\x2B\x35\x2B\xFF\x2B\x32\x2A\xFF\x2A\x2F\x27\xFF\x2A\x2C\x24\xFF\x2A\x2B\x24\xFF" - "\x28\x29\x22\xFF\x27\x26\x20\xFF\x26\x25\x1F\xFF\x27\x24\x1F\xFF\x28\x25\x1E\xFF\x26\x23\x1E\xFF\x26\x24\x1F\xFF\x27\x26\x1F\xFF" - "\x28\x25\x20\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x26\x25\x20\xFF\x25\x24\x1E\xFF\x25\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x20\xFF" - "\x27\x24\x1F\xFF\x25\x25\x1F\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x28\x26\x1F\xFF\x28\x26\x1F\xFF" - "\x28\x26\x20\xFF\x28\x26\x1F\xFF\x27\x25\x20\xFF\x27\x26\x20\xFF\x27\x26\x1F\xFF\x28\x26\x20\xFF\x29\x25\x20\xFF\x27\x25\x20\xFF" - "\x56\xCC\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x97\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCA\x96\xFF\x54\xC5\x92\xFF\x53\xC0\x8F\xFF" - "\x51\xB9\x89\xFF\x50\xB3\x85\xFF\x4D\xAC\x80\xFF\x49\xA1\x78\xFF\x43\x8E\x6A\xFF\x3D\x76\x59\xFF\x34\x56\x42\xFF\x2E\x3D\x30\xFF" - "\x2D\x36\x2C\xFF\x2A\x31\x28\xFF\x26\x2A\x23\xFF\x25\x28\x21\xFF\x28\x29\x22\xFF\x27\x26\x1F\xFF\x28\x27\x20\xFF\x26\x26\x1E\xFF" - "\x28\x25\x20\xFF\x29\x26\x21\xFF\x27\x24\x1F\xFF\x25\x25\x1F\xFF\x26\x24\x1F\xFF\x27\x25\x20\xFF\x27\x26\x20\xFF\x27\x24\x1F\xFF" - "\x24\x25\x1F\xFF\x26\x25\x1F\xFF\x28\x26\x20\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x25\x23\x1D\xFF\x29\x26\x20\xFF" - "\x28\x26\x1F\xFF\x29\x26\x21\xFF\x27\x26\x20\xFF\x26\x24\x1E\xFF\x27\x25\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF" - "\x56\xCE\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x97\xFF\x58\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCC\x97\xFF\x56\xC6\x91\xFF" - "\x4B\xA9\x7D\xFF\x42\x8C\x69\xFF\x3A\x6D\x54\xFF\x36\x5B\x46\xFF\x2F\x49\x38\xFF\x2C\x3D\x2F\xFF\x29\x32\x27\xFF\x28\x2E\x26\xFF" - "\x27\x2B\x23\xFF\x27\x28\x22\xFF\x24\x25\x1E\xFF\x23\x23\x1D\xFF\x26\x24\x1F\xFF\x27\x24\x1E\xFF\x26\x23\x1E\xFF\x28\x26\x20\xFF" - "\x27\x26\x20\xFF\x27\x25\x20\xFF\x26\x24\x1E\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF\x24\x23\x1D\xFF\x25\x24\x1E\xFF\x27\x24\x1F\xFF" - "\x27\x26\x1E\xFF\x27\x26\x20\xFF\x28\x26\x21\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x25\x24\x1E\xFF\x22\x21\x1C\xFF\x26\x24\x1F\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x56\xCD\x97\xFF\x56\xCC\x97\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x56\xCB\x96\xFF\x52\xC0\x8E\xFF\x4C\xAB\x7E\xFF\x46\x97\x70\xFF\x41\x82\x62\xFF\x3C\x6E\x53\xFF" - "\x34\x54\x41\xFF\x2C\x3C\x31\xFF\x28\x30\x27\xFF\x27\x2C\x23\xFF\x27\x29\x22\xFF\x28\x27\x21\xFF\x26\x25\x1F\xFF\x27\x27\x20\xFF" - "\x28\x25\x20\xFF\x26\x25\x20\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF" - "\x28\x26\x21\xFF\x26\x24\x1E\xFF\x25\x25\x1F\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x97\xFF\x56\xCD\x97\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCD\x97\xFF\x57\xCD\x97\xFF\x55\xCA\x95\xFF\x53\xC2\x90\xFF" - "\x50\xB6\x88\xFF\x4B\xA7\x7C\xFF\x41\x86\x64\xFF\x35\x5A\x45\xFF\x2B\x38\x2D\xFF\x29\x31\x28\xFF\x28\x2C\x25\xFF\x26\x28\x22\xFF" - "\x26\x26\x21\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x28\x25\x1F\xFF\x29\x26\x20\xFF\x29\x26\x21\xFF" - "\x2B\x29\x22\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x28\x26\x20\xFF\x29\x27\x20\xFF\x28\x25\x20\xFF\x28\x25\x1F\xFF\x28\x26\x20\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x97\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCD\x97\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF" - "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCC\x97\xFF\x56\xCD\x97\xFF\x57\xCC\x97\xFF\x52\xBB\x89\xFF\x46\x91\x6C\xFF\x38\x68\x4F\xFF\x31\x4F\x3D\xFF" - "\x2C\x3A\x30\xFF\x2A\x30\x28\xFF\x27\x2A\x24\xFF\x26\x28\x21\xFF\x25\x26\x1E\xFF\x27\x25\x1F\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF" - "\x25\x24\x1D\xFF\x24\x24\x1D\xFF\x27\x25\x1F\xFF\x28\x26\x1F\xFF\x23\x23\x1D\xFF\x26\x23\x1E\xFF\x28\x26\x20\xFF\x27\x25\x1F\xFF" - "\x56\xCB\x96\xFF\x55\xCA\x95\xFF\x55\xC9\x94\xFF\x56\xCB\x96\xFF\x58\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x55\xC8\x94\xFF\x4F\xB4\x86\xFF" - "\x46\x93\x6E\xFF\x3F\x76\x59\xFF\x34\x57\x42\xFF\x2B\x3B\x2E\xFF\x29\x30\x27\xFF\x2B\x2D\x24\xFF\x28\x28\x22\xFF\x26\x25\x1F\xFF" - "\x25\x25\x1E\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x27\x25\x1E\xFF\x24\x22\x1D\xFF\x26\x23\x1E\xFF\x28\x24\x1F\xFF\x25\x25\x1E\xFF" - "\x39\x64\x4C\xFF\x38\x62\x4B\xFF\x37\x61\x4A\xFF\x37\x62\x4B\xFF\x39\x68\x4F\xFF\x3B\x71\x55\xFF\x3F\x7B\x5B\xFF\x40\x81\x60\xFF" - "\x44\x8C\x69\xFF\x47\x94\x6F\xFF\x49\x9C\x75\xFF\x4A\xA3\x7A\xFF\x4C\xAB\x7F\xFF\x50\xB5\x86\xFF\x53\xC3\x90\xFF\x56\xCC\x97\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x58\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF" - "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x58\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCC\x97\xFF\x54\xC5\x92\xFF\x50\xB8\x88\xFF\x4B\xA5\x7A\xFF\x3F\x79\x5B\xFF\x31\x4C\x3C\xFF\x29\x34\x29\xFF\x27\x2E\x25\xFF" - "\x26\x26\x22\xFF\x26\x25\x20\xFF\x26\x25\x20\xFF\x27\x27\x1F\xFF\x23\x21\x1C\xFF\x29\x26\x20\xFF\x27\x26\x21\xFF\x27\x25\x1F\xFF" - "\x2A\x2C\x24\xFF\x29\x2B\x24\xFF\x26\x28\x23\xFF\x2A\x2C\x25\xFF\x28\x2C\x24\xFF\x27\x2B\x23\xFF\x26\x2B\x23\xFF\x28\x2F\x25\xFF" - "\x27\x2E\x25\xFF\x2A\x31\x28\xFF\x29\x33\x2A\xFF\x29\x34\x2A\xFF\x2D\x37\x2C\xFF\x2D\x38\x2D\xFF\x2C\x3B\x2E\xFF\x2F\x43\x35\xFF" - "\x35\x5B\x47\xFF\x3C\x70\x55\xFF\x41\x83\x62\xFF\x47\x95\x6E\xFF\x4B\xA7\x7B\xFF\x4E\xAF\x82\xFF\x50\xB6\x87\xFF\x52\xBC\x8C\xFF" - "\x54\xC5\x92\xFF\x56\xCB\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF" - "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF" - "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF" - "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x97\xFF\x56\xCC\x97\xFF\x54\xC6\x92\xFF\x4A\xA1\x78\xFF\x3D\x6E\x54\xFF" - "\x32\x4A\x39\xFF\x2E\x35\x2B\xFF\x27\x29\x22\xFF\x24\x24\x1E\xFF\x28\x27\x1F\xFF\x26\x26\x20\xFF\x26\x24\x1F\xFF\x25\x24\x1E\xFF" - "\x26\x26\x20\xFF\x25\x25\x1F\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x27\x26\x20\xFF\x26\x25\x1F\xFF\x26\x26\x1F\xFF\x25\x25\x1F\xFF" - "\x26\x25\x1F\xFF\x24\x24\x1F\xFF\x28\x28\x21\xFF\x2A\x2A\x23\xFF\x26\x26\x20\xFF\x26\x28\x21\xFF\x26\x29\x21\xFF\x2A\x2C\x24\xFF" - "\x27\x2B\x24\xFF\x29\x2E\x25\xFF\x29\x30\x27\xFF\x2B\x33\x2A\xFF\x2B\x37\x2D\xFF\x31\x44\x35\xFF\x34\x53\x40\xFF\x38\x61\x4A\xFF" - "\x3C\x74\x58\xFF\x43\x88\x66\xFF\x4A\x9D\x76\xFF\x4E\xB1\x83\xFF\x54\xC4\x91\xFF\x56\xCD\x97\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF" - "\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF" - "\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xC9\x94\xFF" - "\x4C\xA7\x7C\xFF\x41\x81\x61\xFF\x35\x58\x44\xFF\x2D\x39\x2F\xFF\x2B\x30\x28\xFF\x28\x2A\x22\xFF\x27\x26\x20\xFF\x27\x25\x20\xFF" - "\x27\x25\x1F\xFF\x26\x24\x1D\xFF\x28\x26\x1F\xFF\x28\x26\x20\xFF\x25\x24\x1F\xFF\x25\x24\x1E\xFF\x25\x23\x1E\xFF\x26\x24\x1F\xFF" - "\x26\x23\x1E\xFF\x25\x24\x1E\xFF\x29\x26\x21\xFF\x2A\x28\x20\xFF\x28\x25\x20\xFF\x28\x26\x20\xFF\x27\x25\x1E\xFF\x26\x26\x1F\xFF" - "\x26\x27\x1F\xFF\x27\x25\x1F\xFF\x25\x26\x1E\xFF\x26\x27\x21\xFF\x27\x28\x22\xFF\x29\x28\x22\xFF\x28\x2A\x23\xFF\x29\x2C\x24\xFF" - "\x2A\x31\x27\xFF\x2A\x35\x2A\xFF\x2F\x42\x35\xFF\x34\x50\x3E\xFF\x38\x61\x4A\xFF\x3C\x74\x56\xFF\x46\x92\x6D\xFF\x4D\xAF\x82\xFF" - "\x53\xC9\x94\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCE\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCC\x97\xFF\x55\xC8\x94\xFF\x51\xB8\x89\xFF\x48\x9B\x74\xFF\x38\x5E\x48\xFF\x2C\x39\x2D\xFF\x28\x2F\x26\xFF\x27\x2A\x22\xFF" - "\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x26\x26\x20\xFF" - "\x27\x25\x1F\xFF\x26\x25\x1F\xFF\x25\x25\x1F\xFF\x25\x25\x1F\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x25\x20\xFF\x25\x24\x1E\xFF" - "\x26\x24\x1F\xFF\x25\x24\x1D\xFF\x25\x22\x1C\xFF\x26\x25\x1F\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" - "\x29\x27\x22\xFF\x27\x27\x21\xFF\x28\x28\x22\xFF\x2B\x2C\x26\xFF\x29\x2B\x23\xFF\x28\x2C\x25\xFF\x29\x31\x27\xFF\x2B\x36\x2C\xFF" - "\x2D\x3F\x31\xFF\x34\x5A\x46\xFF\x3F\x7D\x5E\xFF\x4A\xA0\x77\xFF\x51\xB8\x88\xFF\x55\xC5\x92\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCC\x97\xFF\x57\xCC\x97\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCD\x98\xFF\x56\xCD\x97\xFF\x56\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCA\x96\xFF\x4E\xB2\x85\xFF\x3F\x7D\x5E\xFF\x33\x55\x42\xFF" - "\x25\x22\x1E\xFF\x26\x23\x1E\xFF\x27\x25\x1F\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF\x25\x24\x1D\xFF" - "\x27\x24\x1E\xFF\x27\x24\x1F\xFF\x25\x23\x1D\xFF\x27\x24\x1F\xFF\x25\x25\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" - "\x27\x25\x20\xFF\x29\x26\x21\xFF\x28\x26\x21\xFF\x28\x25\x20\xFF\x25\x24\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x26\x25\x1E\xFF" - "\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x27\x26\x20\xFF\x26\x25\x20\xFF\x28\x26\x20\xFF\x27\x27\x20\xFF\x27\x29\x21\xFF" - "\x28\x2A\x24\xFF\x28\x2C\x25\xFF\x2A\x31\x29\xFF\x2C\x38\x2D\xFF\x35\x57\x43\xFF\x3E\x74\x59\xFF\x46\x91\x6E\xFF\x4E\xAD\x81\xFF" - "\x55\xC7\x93\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" - "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCB\x96\xFF\x51\xB7\x88\xFF"; + "\x27\x2A\x23\xFF\x23\x25\x1F\xFF\x23\x23\x1E\xFF\x24\x23\x1D\xFF\x25\x23\x1D\xFF\x25\x23\x1E" + "\xFF\x25\x23\x1D\xFF\x25\x24\x1F\xFF" + "\x28\x2B\x23\xFF\x37\x60\x4A\xFF\x4A\xA2\x78\xFF\x47\x97\x71\xFF\x41\x84\x64\xFF\x3D\x75\x58" + "\xFF\x38\x62\x4B\xFF\x33\x50\x3E\xFF" + "\x2E\x3C\x30\xFF\x2A\x34\x29\xFF\x28\x30\x26\xFF\x27\x2C\x24\xFF\x26\x29\x22\xFF\x27\x28\x21" + "\xFF\x27\x26\x20\xFF\x27\x25\x20\xFF" + "\x25\x25\x20\xFF\x24\x23\x1D\xFF\x26\x23\x1E\xFF\x28\x25\x20\xFF\x26\x24\x1E\xFF\x27\x24\x1F" + "\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF" + "\x26\x25\x1F\xFF\x28\x25\x20\xFF\x28\x26\x21\xFF\x2A\x27\x22\xFF\x26\x25\x1E\xFF\x27\x24\x1F" + "\xFF\x27\x25\x1F\xFF\x28\x25\x1F\xFF" + "\x27\x27\x1F\xFF\x27\x24\x1F\xFF\x25\x24\x1F\xFF\x26\x24\x1F\xFF\x24\x24\x1E\xFF\x25\x24\x1D" + "\xFF\x27\x25\x1F\xFF\x28\x25\x20\xFF" + "\x27\x24\x1F\xFF\x28\x25\x1F\xFF\x27\x26\x1F\xFF\x27\x25\x1E\xFF\x25\x23\x1E\xFF\x26\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x27\x25\x20\xFF" + "\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1E\xFF\x25\x22\x1D" + "\xFF\x26\x23\x1E\xFF\x23\x21\x1C\xFF" + "\x32\x51\x3F\xFF\x29\x37\x2C\xFF\x29\x31\x28\xFF\x27\x2C\x24\xFF\x26\x29\x21\xFF\x28\x28\x22" + "\xFF\x27\x27\x20\xFF\x27\x27\x21\xFF" + "\x29\x2F\x25\xFF\x3C\x73\x56\xFF\x55\xC9\x94\xFF\x56\xCC\x96\xFF\x56\xCB\x97\xFF\x54\xC5\x92" + "\xFF\x52\xBD\x8C\xFF\x50\xB5\x86\xFF" + "\x4D\xAA\x7F\xFF\x48\x99\x71\xFF\x40\x80\x61\xFF\x37\x66\x4D\xFF\x2F\x48\x38\xFF\x2C\x38\x2C" + "\xFF\x2B\x33\x29\xFF\x2A\x2E\x26\xFF" + "\x27\x29\x23\xFF\x27\x27\x21\xFF\x27\x27\x21\xFF\x27\x26\x20\xFF\x26\x25\x1F\xFF\x26\x25\x1F" + "\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF" + "\x27\x26\x20\xFF\x28\x26\x20\xFF\x28\x25\x20\xFF\x28\x27\x20\xFF\x27\x25\x1F\xFF\x27\x25\x20" + "\xFF\x27\x25\x1F\xFF\x28\x26\x20\xFF" + "\x25\x23\x1E\xFF\x26\x24\x1E\xFF\x25\x23\x1D\xFF\x27\x25\x1F\xFF\x26\x24\x1E\xFF\x26\x23\x1E" + "\xFF\x29\x26\x21\xFF\x28\x25\x20\xFF" + "\x26\x25\x1F\xFF\x27\x25\x1F\xFF\x25\x25\x1F\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x26\x25\x1F" + "\xFF\x25\x23\x1D\xFF\x27\x24\x1F\xFF" + "\x25\x24\x1F\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x27\x24\x1E\xFF\x26\x26\x1E\xFF\x27\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" + "\x4E\xBA\x89\xFF\x4D\xB3\x83\xFF\x45\x97\x70\xFF\x3D\x79\x5B\xFF\x35\x58\x44\xFF\x30\x48\x39" + "\xFF\x2D\x3A\x2F\xFF\x29\x31\x27\xFF" + "\x2B\x37\x2C\xFF\x3E\x79\x5B\xFF\x56\xCA\x95\xFF\x56\xCC\x96\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x52\xBC\x8B" + "\xFF\x49\x9D\x76\xFF\x3E\x7A\x5C\xFF" + "\x36\x5C\x47\xFF\x31\x4C\x3B\xFF\x2D\x3D\x2F\xFF\x29\x30\x28\xFF\x27\x2B\x23\xFF\x27\x29\x22" + "\xFF\x27\x28\x21\xFF\x28\x27\x21\xFF" + "\x27\x25\x20\xFF\x27\x24\x1F\xFF\x24\x24\x1E\xFF\x25\x23\x1F\xFF\x28\x25\x20\xFF\x29\x26\x20" + "\xFF\x27\x25\x20\xFF\x28\x25\x20\xFF" + "\x26\x23\x1F\xFF\x27\x24\x1F\xFF\x29\x27\x21\xFF\x2A\x27\x21\xFF\x27\x24\x1F\xFF\x25\x24\x1E" + "\xFF\x24\x24\x1F\xFF\x26\x24\x1F\xFF" + "\x28\x25\x1F\xFF\x27\x25\x1E\xFF\x27\x25\x20\xFF\x25\x25\x1F\xFF\x29\x26\x21\xFF\x27\x27\x20" + "\xFF\x26\x25\x1F\xFF\x25\x23\x1E\xFF" + "\x26\x23\x1E\xFF\x23\x23\x1D\xFF\x26\x25\x1E\xFF\x27\x24\x1E\xFF\x25\x22\x1E\xFF\x27\x24\x1F" + "\xFF\x29\x26\x21\xFF\x26\x26\x1E\xFF" + "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x50\xC0\x8E\xFF\x51\xC2\x8F\xFF\x52\xBC\x8B\xFF\x4A\xA7\x7C" + "\xFF\x44\x90\x6B\xFF\x3E\x78\x5B\xFF" + "\x36\x63\x4B\xFF\x41\x87\x66\xFF\x55\xCB\x96\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x53\xC2\x90\xFF\x4D\xAD\x81\xFF\x47\x96\x70\xFF\x40\x7E\x5F\xFF\x39\x63\x4C\xFF\x31\x48\x39" + "\xFF\x2D\x36\x2B\xFF\x27\x2C\x24\xFF" + "\x25\x27\x21\xFF\x27\x27\x21\xFF\x26\x24\x1E\xFF\x25\x24\x1E\xFF\x28\x25\x1F\xFF\x26\x24\x1E" + "\xFF\x25\x25\x20\xFF\x26\x24\x1F\xFF" + "\x25\x22\x1E\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x29\x26\x21\xFF\x25\x23\x1D\xFF\x25\x23\x1D" + "\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF" + "\x2A\x27\x21\xFF\x29\x26\x21\xFF\x28\x25\x20\xFF\x26\x26\x20\xFF\x29\x26\x21\xFF\x29\x26\x21" + "\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" + "\x26\x24\x1F\xFF\x25\x24\x1E\xFF\x25\x23\x1E\xFF\x24\x22\x1E\xFF\x28\x25\x20\xFF\x27\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x25\x24\x1F\xFF" + "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x50\xC0\x8E\xFF\x51\xC2\x8F\xFF\x53\xC5\x91\xFF\x54\xC7\x92" + "\xFF\x55\xC8\x95\xFF\x53\xC3\x92\xFF" + "\x50\xBA\x89\xFF\x51\xBD\x8C\xFF\x56\xCC\x97\xFF\x57\xCC\x97\xFF\x57\xCD\x99\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x58\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x55\xC8\x95\xFF\x52\xBD\x8D\xFF\x4E\xB0\x82" + "\xFF\x47\x93\x6E\xFF\x38\x65\x4C\xFF" + "\x2D\x3A\x2F\xFF\x2C\x33\x2A\xFF\x26\x2A\x23\xFF\x27\x28\x20\xFF\x28\x27\x21\xFF\x27\x24\x1F" + "\xFF\x26\x23\x1F\xFF\x28\x25\x20\xFF" + "\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x24\x23\x1E\xFF\x26\x24\x1D\xFF\x24\x24\x1D\xFF\x24\x22\x1D" + "\xFF\x24\x21\x1D\xFF\x27\x24\x1F\xFF" + "\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF\x28\x25\x20\xFF\x27\x26\x20\xFF\x27\x25\x1E" + "\xFF\x25\x25\x1E\xFF\x26\x23\x1E\xFF" + "\x26\x23\x1E\xFF\x27\x25\x1E\xFF\x26\x24\x1F\xFF\x27\x24\x20\xFF\x27\x26\x20\xFF\x28\x25\x20" + "\xFF\x27\x24\x1F\xFF\x24\x24\x1E\xFF" + "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x52\xC4\x91\xFF\x54\xC7\x92" + "\xFF\x55\xC8\x95\xFF\x54\xC8\x94\xFF" + "\x55\xCB\x96\xFF\x55\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x97\xFF\x57\xCD\x97\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCC\x97" + "\xFF\x57\xCC\x97\xFF\x56\xCC\x97\xFF" + "\x52\xBE\x8D\xFF\x45\x90\x6C\xFF\x38\x62\x4B\xFF\x2F\x42\x34\xFF\x29\x30\x27\xFF\x27\x28\x22" + "\xFF\x28\x27\x21\xFF\x25\x22\x1E\xFF" + "\x23\x23\x1D\xFF\x25\x24\x1F\xFF\x28\x25\x20\xFF\x26\x25\x1F\xFF\x27\x25\x1F\xFF\x27\x25\x1E" + "\xFF\x25\x24\x1E\xFF\x27\x24\x20\xFF" + "\x27\x25\x1F\xFF\x26\x25\x1F\xFF\x25\x24\x1E\xFF\x28\x26\x20\xFF\x25\x24\x1F\xFF\x26\x24\x1F" + "\xFF\x25\x23\x1E\xFF\x27\x23\x1F\xFF" + "\x27\x25\x1E\xFF\x26\x25\x1F\xFF\x2A\x27\x21\xFF\x2C\x29\x24\xFF\x27\x24\x1F\xFF\x27\x24\x1F" + "\xFF\x28\x25\x20\xFF\x29\x26\x20\xFF" + "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x53\xC7\x93" + "\xFF\x54\xC8\x95\xFF\x55\xC9\x95\xFF" + "\x55\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x56\xCD\x97\xFF\x56\xCC\x97" + "\xFF\x56\xCC\x97\xFF\x57\xCC\x97\xFF" + "\x56\xCD\x97\xFF\x56\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x56\xCC\x98\xFF\x52\xC0\x8E\xFF\x49\x9D\x76\xFF\x3A\x6A\x51\xFF\x2E\x3F\x31" + "\xFF\x29\x2E\x24\xFF\x28\x27\x21\xFF" + "\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x24\x1E\xFF\x25\x24\x1E\xFF\x25\x25\x1F\xFF\x26\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" + "\x27\x25\x20\xFF\x27\x24\x1E\xFF\x27\x25\x20\xFF\x27\x27\x21\xFF\x25\x24\x1E\xFF\x26\x25\x1F" + "\xFF\x27\x25\x1F\xFF\x25\x24\x1E\xFF" + "\x25\x25\x1F\xFF\x28\x25\x20\xFF\x28\x26\x20\xFF\x28\x25\x20\xFF\x25\x23\x1D\xFF\x25\x23\x1E" + "\xFF\x26\x25\x1F\xFF\x27\x26\x20\xFF" + "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x52\xC4\x91\xFF\x53\xC7\x93" + "\xFF\x54\xC8\x95\xFF\x55\xC9\x95\xFF" + "\x55\xCB\x95\xFF\x55\xCA\x95\xFF\x56\xCC\x96\xFF\x56\xCB\x96\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x58\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97" + "\xFF\x56\xCC\x96\xFF\x56\xCC\x97\xFF" + "\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x52\xC1\x8E\xFF\x4C\xA8\x7C\xFF\x45\x92\x6D" + "\xFF\x42\x86\x64\xFF\x47\x99\x72\xFF" + "\x51\xB9\x89\xFF\x56\xCB\x96\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x53\xBF\x8E\xFF\x45\x8F\x6B" + "\xFF\x30\x47\x38\xFF\x28\x2E\x25\xFF" + "\x27\x26\x1E\xFF\x27\x25\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x29\x26\x20" + "\xFF\x28\x25\x1F\xFF\x26\x25\x1F\xFF" + "\x25\x24\x1F\xFF\x26\x25\x1F\xFF\x28\x25\x1F\xFF\x26\x24\x1E\xFF\x25\x23\x1E\xFF\x25\x24\x1E" + "\xFF\x29\x26\x21\xFF\x26\x24\x1F\xFF" + "\x27\x25\x1F\xFF\x29\x27\x20\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x26\x24\x1D\xFF\x26\x23\x1E" + "\xFF\x25\x23\x1D\xFF\x26\x24\x1E\xFF" + "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x52\xC4\x91\xFF\x54\xC7\x93" + "\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" + "\x55\xCA\x95\xFF\x55\xCA\x95\xFF\x56\xCC\x96\xFF\x56\xCB\x96\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x99\xFF\x57\xCD\x98" + "\xFF\x56\xCD\x97\xFF\x56\xCD\x98\xFF" + "\x56\xCA\x96\xFF\x50\xB6\x87\xFF\x42\x83\x62\xFF\x30\x48\x39\xFF\x2A\x3B\x2E\xFF\x2B\x39\x2E" + "\xFF\x2D\x3B\x2F\xFF\x2D\x3B\x2F\xFF" + "\x2E\x40\x32\xFF\x35\x58\x45\xFF\x48\x9B\x74\xFF\x54\xC5\x92\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x4C\xA9\x7D\xFF\x34\x52\x3E\xFF" + "\x27\x2B\x22\xFF\x27\x26\x20\xFF\x29\x26\x21\xFF\x2A\x27\x22\xFF\x28\x25\x1E\xFF\x26\x23\x1E" + "\xFF\x29\x26\x21\xFF\x26\x24\x1E\xFF" + "\x25\x24\x1F\xFF\x26\x25\x1F\xFF\x28\x25\x20\xFF\x25\x23\x1E\xFF\x27\x25\x20\xFF\x25\x23\x1E" + "\xFF\x25\x22\x1D\xFF\x25\x23\x1E\xFF" + "\x27\x25\x1F\xFF\x25\x24\x1E\xFF\x27\x24\x1E\xFF\x25\x24\x1F\xFF\x26\x24\x1E\xFF\x25\x22\x1E" + "\xFF\x25\x23\x1D\xFF\x26\x25\x1E\xFF" + "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93" + "\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" + "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x56\xCC\x97\xFF\x56\xCD\x98\xFF" + "\x4C\xA8\x7D\xFF\x37\x5D\x47\xFF\x2D\x3D\x31\xFF\x2E\x3D\x30\xFF\x34\x5F\x49\xFF\x3B\x71\x55" + "\xFF\x3D\x79\x5B\xFF\x3A\x6C\x52\xFF" + "\x33\x50\x3D\xFF\x2F\x3D\x30\xFF\x2F\x47\x37\xFF\x3E\x7A\x5D\xFF\x54\xC5\x92\xFF\x56\xCD\x98" + "\xFF\x56\xCC\x97\xFF\x48\x98\x72\xFF" + "\x2C\x37\x2C\xFF\x29\x2A\x23\xFF\x27\x26\x1F\xFF\x25\x24\x1E\xFF\x27\x25\x20\xFF\x26\x25\x1F" + "\xFF\x29\x27\x21\xFF\x25\x25\x1F\xFF" + "\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x28\x26\x21\xFF\x28\x25\x20\xFF\x26\x23\x1E" + "\xFF\x24\x23\x1D\xFF\x25\x22\x1D\xFF" + "\x25\x23\x1E\xFF\x24\x23\x1E\xFF\x29\x26\x21\xFF\x28\x26\x20\xFF\x25\x24\x1F\xFF\x25\x24\x1F" + "\xFF\x25\x24\x1E\xFF\x24\x23\x1D\xFF" + "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93" + "\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" + "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x56\xCC\x97\xFF\x53\xC3\x91\xFF" + "\x35\x59\x45\xFF\x2D\x3B\x2F\xFF\x32\x50\x3E\xFF\x46\x92\x6D\xFF\x51\xBB\x8B\xFF\x54\xC4\x91" + "\xFF\x55\xC7\x93\xFF\x53\xC1\x8F\xFF" + "\x4E\xAE\x81\xFF\x3F\x75\x59\xFF\x2D\x40\x32\xFF\x2D\x3D\x31\xFF\x43\x8C\x68\xFF\x56\xCC\x97" + "\xFF\x56\xCD\x97\xFF\x56\xC8\x94\xFF" + "\x39\x65\x4D\xFF\x2A\x30\x26\xFF\x28\x28\x22\xFF\x27\x25\x1E\xFF\x2A\x27\x22\xFF\x28\x26\x21" + "\xFF\x29\x26\x21\xFF\x26\x25\x1E\xFF" + "\x27\x24\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x26\x24\x1E\xFF\x26\x25\x20" + "\xFF\x27\x25\x1E\xFF\x28\x25\x1F\xFF" + "\x27\x24\x20\xFF\x26\x23\x1E\xFF\x25\x24\x1E\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF\x26\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF" + "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93" + "\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" + "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x97" + "\xFF\x55\xC7\x93\xFF\x3B\x70\x56\xFF" + "\x2E\x3B\x2F\xFF\x36\x59\x44\xFF\x4E\xAE\x81\xFF\x57\xCC\x97\xFF\x57\xCD\x98\xFF\x56\xCC\x97" + "\xFF\x55\xC9\x94\xFF\x54\xC4\x91\xFF" + "\x56\xCB\x96\xFF\x56\xCA\x96\xFF\x43\x8A\x69\xFF\x2E\x41\x33\xFF\x31\x4C\x3A\xFF\x4A\xA1\x79" + "\xFF\x56\xCC\x97\xFF\x57\xCD\x97\xFF" + "\x4E\xB0\x81\xFF\x2F\x45\x37\xFF\x28\x2B\x24\xFF\x25\x23\x1E\xFF\x27\x25\x20\xFF\x27\x25\x20" + "\xFF\x28\x26\x20\xFF\x27\x24\x20\xFF" + "\x26\x23\x1E\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x25\x1F" + "\xFF\x26\x24\x1E\xFF\x26\x23\x1E\xFF" + "\x28\x26\x21\xFF\x25\x25\x1E\xFF\x26\x23\x1E\xFF\x26\x24\x20\xFF\x27\x24\x1F\xFF\x27\x24\x20" + "\xFF\x26\x23\x1F\xFF\x27\x24\x1F\xFF" + "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93" + "\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" + "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x98" + "\xFF\x4E\xAF\x82\xFF\x32\x50\x3E\xFF" + "\x2F\x42\x35\xFF\x45\x90\x6C\xFF\x56\xCA\x96\xFF\x57\xCD\x98\xFF\x56\xCB\x96\xFF\x4E\xB0\x82" + "\xFF\x42\x84\x63\xFF\x3D\x74\x57\xFF" + "\x44\x8B\x69\xFF\x50\xB7\x88\xFF\x53\xC0\x8F\xFF\x36\x64\x4C\xFF\x2D\x3C\x2F\xFF\x3E\x76\x59" + "\xFF\x54\xC7\x92\xFF\x57\xCD\x97\xFF" + "\x54\xC3\x91\xFF\x3D\x74\x58\xFF\x2A\x31\x28\xFF\x27\x26\x1F\xFF\x27\x25\x20\xFF\x26\x25\x1F" + "\xFF\x27\x26\x20\xFF\x27\x26\x20\xFF" + "\x27\x24\x1F\xFF\x27\x25\x1F\xFF\x27\x25\x1F\xFF\x26\x25\x20\xFF\x27\x24\x1F\xFF\x27\x26\x1F" + "\xFF\x27\x26\x1F\xFF\x23\x23\x1D\xFF" + "\x25\x23\x1E\xFF\x27\x26\x1F\xFF\x27\x24\x1E\xFF\x29\x26\x20\xFF\x26\x25\x1F\xFF\x26\x24\x1F" + "\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF" + "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93" + "\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" + "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x98" + "\xFF\x49\x98\x72\xFF\x2E\x44\x36\xFF" + "\x33\x51\x3F\xFF\x4F\xB4\x86\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x53\xC0\x8F\xFF\x3D\x73\x57" + "\xFF\x2F\x3E\x32\xFF\x2C\x38\x2C\xFF" + "\x2F\x42\x35\xFF\x41\x83\x62\xFF\x55\xC8\x94\xFF\x43\x8F\x6A\xFF\x2E\x3A\x2F\xFF\x39\x66\x4E" + "\xFF\x52\xBB\x8B\xFF\x56\xCD\x97\xFF" + "\x56\xCB\x97\xFF\x48\x9C\x75\xFF\x2E\x42\x34\xFF\x28\x29\x22\xFF\x28\x27\x21\xFF\x28\x26\x1F" + "\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF" + "\x28\x26\x20\xFF\x2A\x27\x21\xFF\x27\x26\x20\xFF\x25\x23\x1E\xFF\x29\x26\x21\xFF\x29\x28\x22" + "\xFF\x26\x25\x1F\xFF\x25\x22\x1D\xFF" + "\x27\x24\x1F\xFF\x28\x25\x1F\xFF\x27\x24\x1E\xFF\x27\x26\x1F\xFF\x27\x25\x1F\xFF\x26\x24\x1F" + "\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF" + "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93" + "\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" + "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x56\xCD\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCD\x97\xFF\x57\xCD\x98" + "\xFF\x41\x80\x61\xFF\x2B\x39\x2E\xFF" + "\x33\x58\x44\xFF\x54\xC7\x93\xFF\x56\xCD\x98\xFF\x56\xCC\x97\xFF\x55\xC9\x94\xFF\x46\x96\x70" + "\xFF\x34\x5B\x46\xFF\x32\x51\x3E\xFF" + "\x38\x67\x4D\xFF\x49\xA3\x79\xFF\x56\xCD\x97\xFF\x4C\xAC\x80\xFF\x2F\x3D\x31\xFF\x36\x58\x44" + "\xFF\x4E\xAF\x82\xFF\x56\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x52\xBF\x8E\xFF\x39\x69\x50\xFF\x2A\x30\x26\xFF\x26\x25\x1F\xFF\x26\x23\x1E" + "\xFF\x27\x25\x1E\xFF\x28\x25\x20\xFF" + "\x28\x26\x21\xFF\x28\x25\x20\xFF\x26\x25\x1E\xFF\x27\x25\x1F\xFF\x28\x26\x21\xFF\x28\x26\x20" + "\xFF\x28\x26\x1F\xFF\x25\x24\x1D\xFF" + "\x25\x24\x1E\xFF\x25\x25\x1F\xFF\x24\x23\x1D\xFF\x26\x24\x1F\xFF\x25\x22\x1D\xFF\x23\x23\x1D" + "\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF" + "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93" + "\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" + "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x56\xCC\x98\xFF\x56\xCC\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x98" + "\xFF\x44\x8C\x69\xFF\x2D\x40\x31\xFF" + "\x33\x55\x41\xFF\x52\xBE\x8D\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x55\xC9\x95" + "\xFF\x50\xBA\x8A\xFF\x4D\xAD\x80\xFF" + "\x52\xC0\x8D\xFF\x56\xCC\x97\xFF\x57\xCD\x97\xFF\x4A\xA5\x7A\xFF\x2E\x3B\x2F\xFF\x36\x5A\x45" + "\xFF\x4F\xB1\x83\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x42\x8A\x68\xFF\x2B\x3B\x2E\xFF\x28\x28\x20\xFF\x27\x24\x1E" + "\xFF\x28\x25\x1F\xFF\x28\x25\x1F\xFF" + "\x24\x23\x1E\xFF\x25\x24\x1E\xFF\x27\x25\x1F\xFF\x28\x26\x20\xFF\x26\x25\x1F\xFF\x27\x26\x1F" + "\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF" + "\x27\x25\x1F\xFF\x26\x24\x1E\xFF\x25\x24\x1D\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x25\x23\x1E" + "\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF" + "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93" + "\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" + "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x97" + "\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x99\xFF\x56\xCD\x97\xFF\x56\xCD\x98" + "\xFF\x49\x9E\x77\xFF\x31\x47\x38\xFF" + "\x2F\x4A\x39\xFF\x4B\xA9\x7E\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x58\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF" + "\x57\xCE\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x40\x80\x61\xFF\x2E\x3B\x2F\xFF\x38\x6A\x50" + "\xFF\x52\xBF\x8E\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x4D\xAC\x80\xFF\x2F\x4B\x3A\xFF\x28\x2A\x21\xFF\x27\x26\x1F" + "\xFF\x28\x25\x1F\xFF\x29\x26\x21\xFF" + "\x26\x23\x1F\xFF\x27\x26\x20\xFF\x27\x25\x1F\xFF\x27\x25\x20\xFF\x26\x23\x1E\xFF\x27\x24\x1F" + "\xFF\x28\x25\x1F\xFF\x28\x25\x20\xFF" + "\x27\x25\x20\xFF\x26\x25\x1F\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x26\x24\x1E\xFF\x24\x23\x1D" + "\xFF\x27\x24\x1F\xFF\x24\x22\x1D\xFF" + "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93" + "\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" + "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCA\x96\xFF\x53\xC1\x8F" + "\xFF\x57\xC7\x94\xFF\x57\xCC\x97\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x97\xFF\x56\xCC\x97\xFF\x56\xCD\x97" + "\xFF\x51\xBA\x89\xFF\x37\x5E\x47\xFF" + "\x2D\x39\x2E\xFF\x39\x6B\x52\xFF\x52\xBE\x8D\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCB\x97\xFF\x4C\xA8\x7C\xFF\x31\x4D\x3B\xFF\x2F\x3F\x31\xFF\x41\x86\x65" + "\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF" + "\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xC9\x96\xFF\x39\x63\x4D\xFF\x27\x2D\x26\xFF\x26\x27\x1F" + "\xFF\x27\x26\x20\xFF\x24\x23\x1D\xFF" + "\x24\x22\x1D\xFF\x26\x24\x1D\xFF\x27\x26\x20\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF\x26\x25\x1F" + "\xFF\x26\x23\x1F\xFF\x25\x23\x1E\xFF" + "\x25\x24\x1F\xFF\x26\x23\x1E\xFF\x28\x26\x20\xFF\x28\x26\x21\xFF\x27\x24\x1F\xFF\x27\x25\x1F" + "\xFF\x26\x23\x1E\xFF\x27\x24\x20\xFF" + "\x4F\xBA\x8A\xFF\x50\xBD\x8C\xFF\x51\xC0\x8F\xFF\x52\xC2\x90\xFF\x53\xC4\x92\xFF\x54\xC6\x93" + "\xFF\x54\xC8\x94\xFF\x55\xC8\x95\xFF" + "\x55\xCA\x96\xFF\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x55\xC8\x94\xFF\x49\x9E\x76" + "\xFF\x43\x8B\x68\xFF\x50\xB5\x87\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97" + "\xFF\x56\xCD\x97\xFF\x48\x9A\x72\xFF" + "\x2C\x3B\x2F\xFF\x30\x42\x34\xFF\x3F\x7C\x5D\xFF\x51\xBB\x8B\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF" + "\x56\xC9\x95\xFF\x4C\xA9\x7D\xFF\x37\x5F\x49\xFF\x2C\x3A\x2E\xFF\x36\x5D\x47\xFF\x50\xB4\x86" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCC\x99\xFF\x57\xCC\x98\xFF\x57\xCD\x98\xFF\x44\x8C\x69\xFF\x29\x30\x27\xFF\x27\x27\x20" + "\xFF\x27\x26\x1F\xFF\x25\x23\x1E\xFF" + "\x23\x22\x1C\xFF\x26\x23\x1E\xFF\x27\x25\x20\xFF\x27\x25\x20\xFF\x26\x23\x1E\xFF\x26\x23\x1E" + "\xFF\x27\x25\x1F\xFF\x26\x23\x1D\xFF" + "\x27\x24\x1F\xFF\x26\x24\x1E\xFF\x26\x25\x1F\xFF\x25\x23\x1E\xFF\x28\x25\x20\xFF\x27\x25\x20" + "\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF" + "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC4\x92\xFF\x54\xC6\x93" + "\xFF\x54\xC8\x94\xFF\x55\xC9\x95\xFF" + "\x55\xCA\x96\xFF\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x4C\xAA\x7F" + "\xFF\x35\x5E\x49\xFF\x35\x59\x45\xFF" + "\x46\x99\x72\xFF\x55\xC8\x94\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x55\xC8\x94\xFF" + "\x3B\x6C\x51\xFF\x2C\x3A\x2E\xFF\x2E\x3F\x31\xFF\x38\x5F\x49\xFF\x46\x94\x6F\xFF\x4E\xB1\x83" + "\xFF\x50\xB9\x88\xFF\x4C\xAA\x7F\xFF" + "\x41\x80\x61\xFF\x32\x50\x3E\xFF\x2C\x3A\x2E\xFF\x2B\x40\x32\xFF\x4B\xA7\x7C\xFF\x57\xCC\x97" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x4F\xB6\x86\xFF\x2D\x38\x2D\xFF\x29\x2A\x23" + "\xFF\x27\x25\x1F\xFF\x26\x23\x1E\xFF" + "\x26\x24\x1F\xFF\x27\x26\x20\xFF\x29\x26\x21\xFF\x27\x25\x20\xFF\x28\x26\x1F\xFF\x26\x24\x1F" + "\xFF\x25\x23\x1E\xFF\x25\x22\x1D\xFF" + "\x25\x24\x1E\xFF\x25\x24\x1E\xFF\x25\x24\x1F\xFF\x24\x23\x1D\xFF\x25\x24\x1E\xFF\x26\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF" + "\x4F\xBB\x8A\xFF\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC7\x93" + "\xFF\x54\xC8\x94\xFF\x55\xC9\x95\xFF" + "\x55\xCA\x96\xFF\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x55\xC7\x94" + "\xFF\x40\x7B\x5D\xFF\x2C\x3B\x2E\xFF" + "\x2B\x37\x2C\xFF\x35\x5B\x46\xFF\x48\x9E\x76\xFF\x52\xBF\x8D\xFF\x56\xCC\x97\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x54\xC4\x91\xFF\x44\x89\x67\xFF\x31\x4D\x3C\xFF\x29\x37\x2C\xFF\x2C\x39\x2D\xFF\x2C\x3A\x2E" + "\xFF\x2D\x3C\x2E\xFF\x2C\x3B\x2E\xFF" + "\x2C\x39\x2D\xFF\x2E\x41\x32\xFF\x38\x60\x4B\xFF\x4B\xA2\x79\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x97\xFF\x57\xCC\x97\xFF\x33\x52\x3F\xFF\x28\x2C\x23" + "\xFF\x28\x27\x1F\xFF\x27\x24\x1F\xFF" + "\x23\x22\x1D\xFF\x26\x25\x1F\xFF\x27\x24\x1F\xFF\x24\x23\x1E\xFF\x27\x24\x1F\xFF\x27\x25\x1F" + "\xFF\x26\x25\x1F\xFF\x26\x24\x1F\xFF" + "\x25\x22\x1D\xFF\x27\x24\x1F\xFF\x27\x26\x21\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF\x26\x23\x1F" + "\xFF\x26\x23\x1F\xFF\x27\x24\x1F\xFF" + "\x4F\xBC\x8B\xFF\x51\xBF\x8D\xFF\x52\xC1\x8F\xFF\x53\xC4\x91\xFF\x53\xC5\x92\xFF\x54\xC7\x93" + "\xFF\x54\xC8\x94\xFF\x55\xC9\x95\xFF" + "\x55\xCA\x96\xFF\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x4A\xA4\x7A\xFF\x30\x4B\x39\xFF" + "\x2A\x30\x28\xFF\x2A\x32\x28\xFF\x2E\x40\x32\xFF\x38\x67\x4E\xFF\x48\x9B\x74\xFF\x53\xC0\x8F" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x55\xC8\x94\xFF\x4A\xA5\x7A\xFF\x3F\x7D\x5E\xFF\x37\x62\x4C\xFF\x31\x4C\x3A" + "\xFF\x31\x49\x39\xFF\x35\x57\x42\xFF" + "\x3A\x6B\x52\xFF\x44\x8D\x6A\xFF\x50\xBB\x8B\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x56\xCD\x98" + "\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCA\x96\xFF\x4F\xAC\x80\xFF\x2F\x4A\x39\xFF\x28\x2A\x23" + "\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF" + "\x25\x23\x1E\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF\x29\x26\x21\xFF\x28\x26\x20" + "\xFF\x27\x24\x1F\xFF\x27\x25\x1F\xFF" + "\x28\x25\x20\xFF\x26\x25\x1F\xFF\x25\x24\x1F\xFF\x27\x25\x1F\xFF\x26\x23\x1E\xFF\x28\x25\x20" + "\xFF\x27\x25\x1F\xFF\x26\x25\x20\xFF" + "\x50\xBC\x8C\xFF\x51\xBF\x8D\xFF\x52\xC1\x8F\xFF\x53\xC4\x91\xFF\x53\xC5\x92\xFF\x54\xC7\x93" + "\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" + "\x55\xCA\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x54\xC6\x93\xFF\x41\x82\x62\xFF" + "\x2D\x3C\x30\xFF\x2B\x34\x29\xFF\x29\x2F\x26\xFF\x27\x30\x27\xFF\x2F\x42\x34\xFF\x38\x63\x4C" + "\xFF\x48\x98\x72\xFF\x55\xC6\x93\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x55\xC7\x94\xFF\x52\xBC\x8C\xFF\x4F\xB2\x84" + "\xFF\x4E\xB0\x83\xFF\x53\xB7\x88\xFF" + "\x53\xC0\x8E\xFF\x55\xC9\x95\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98" + "\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCD\x97\xFF\x52\xBC\x8C\xFF\x40\x81\x62\xFF\x32\x4E\x3D\xFF\x29\x2C\x25\xFF\x29\x27\x21" + "\xFF\x29\x27\x20\xFF\x27\x25\x1F\xFF" + "\x25\x23\x1E\xFF\x26\x24\x1F\xFF\x26\x26\x20\xFF\x26\x25\x20\xFF\x26\x25\x1F\xFF\x28\x26\x20" + "\xFF\x27\x25\x20\xFF\x29\x26\x20\xFF" + "\x27\x25\x1F\xFF\x28\x25\x20\xFF\x25\x23\x1E\xFF\x26\x24\x1E\xFF\x26\x25\x20\xFF\x27\x24\x1F" + "\xFF\x26\x24\x1F\xFF\x27\x25\x1F\xFF" + "\x50\xBD\x8C\xFF\x51\xC0\x8E\xFF\x52\xC2\x90\xFF\x53\xC4\x91\xFF\x54\xC6\x93\xFF\x54\xC7\x93" + "\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" + "\x55\xCA\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x56\xCD\x97\xFF\x56\xCC\x97\xFF" + "\x52\xBA\x8B\xFF\x42\x85\x64\xFF\x36\x59\x46\xFF\x2F\x40\x33\xFF\x2B\x31\x28\xFF\x2B\x31\x27" + "\xFF\x2C\x36\x2B\xFF\x31\x4B\x3A\xFF" + "\x41\x82\x61\xFF\x4C\xA8\x7E\xFF\x52\xBC\x8C\xFF\x55\xC9\x95\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x97" + "\xFF\x54\xC8\x93\xFF\x51\xB8\x89\xFF" + "\x3F\x82\x62\xFF\x2F\x47\x38\xFF\x2A\x34\x29\xFF\x26\x2B\x22\xFF\x27\x27\x21\xFF\x26\x25\x1F" + "\xFF\x26\x26\x1F\xFF\x26\x25\x1E\xFF" + "\x27\x24\x20\xFF\x27\x24\x20\xFF\x28\x26\x20\xFF\x28\x26\x21\xFF\x26\x25\x1F\xFF\x26\x25\x1F" + "\xFF\x28\x25\x20\xFF\x26\x23\x1E\xFF" + "\x26\x23\x1E\xFF\x27\x25\x20\xFF\x26\x25\x1F\xFF\x28\x27\x20\xFF\x27\x24\x1F\xFF\x27\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x28\x26\x1F\xFF" + "\x50\xBE\x8D\xFF\x51\xC0\x8F\xFF\x52\xC3\x90\xFF\x53\xC4\x92\xFF\x54\xC6\x93\xFF\x54\xC8\x94" + "\xFF\x55\xC8\x95\xFF\x55\xC9\x95\xFF" + "\x55\xCA\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x56\xCB\x96\xFF\x50\xBA\x8A\xFF\x46\x94\x6F\xFF\x38\x64\x4B\xFF\x2D\x3F\x32" + "\xFF\x29\x33\x29\xFF\x29\x32\x27\xFF" + "\x2A\x35\x29\xFF\x30\x43\x34\xFF\x38\x61\x4A\xFF\x40\x81\x61\xFF\x49\x9F\x78\xFF\x4E\xB0\x83" + "\xFF\x52\xC0\x8E\xFF\x56\xCB\x97\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xC9\x95\xFF\x4F\xB7\x86\xFF\x48\x9B\x74" + "\xFF\x3F\x7E\x5F\xFF\x35\x5A\x44\xFF" + "\x2A\x36\x2B\xFF\x2B\x34\x2A\xFF\x2B\x37\x2C\xFF\x2D\x3D\x30\xFF\x28\x29\x21\xFF\x25\x25\x1E" + "\xFF\x26\x25\x20\xFF\x26\x26\x1E\xFF" + "\x27\x24\x1F\xFF\x27\x25\x1F\xFF\x27\x24\x1F\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x24\x23\x1D" + "\xFF\x28\x24\x1F\xFF\x25\x22\x1E\xFF" + "\x25\x22\x1E\xFF\x24\x25\x1F\xFF\x27\x25\x20\xFF\x29\x27\x21\xFF\x26\x23\x1E\xFF\x28\x25\x20" + "\xFF\x28\x25\x20\xFF\x26\x25\x1E\xFF" + "\x51\xBF\x8D\xFF\x52\xC1\x8F\xFF\x52\xC3\x90\xFF\x53\xC5\x92\xFF\x54\xC6\x93\xFF\x54\xC8\x94" + "\xFF\x55\xC8\x95\xFF\x55\xCA\x96\xFF" + "\x55\xCA\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x51\xBD\x8C\xFF\x49\xA2\x79" + "\xFF\x3D\x72\x57\xFF\x31\x47\x37\xFF" + "\x2D\x36\x2C\xFF\x2B\x34\x29\xFF\x2A\x33\x28\xFF\x29\x34\x29\xFF\x2F\x43\x35\xFF\x31\x4D\x3C" + "\xFF\x35\x5A\x45\xFF\x3A\x67\x50\xFF" + "\x3D\x73\x57\xFF\x3B\x6B\x52\xFF\x39\x66\x4D\xFF\x37\x61\x4A\xFF\x33\x53\x3F\xFF\x2E\x42\x34" + "\xFF\x29\x35\x2A\xFF\x2A\x34\x2A\xFF" + "\x2B\x3B\x2F\xFF\x37\x5F\x49\xFF\x46\x95\x6F\xFF\x47\x97\x70\xFF\x28\x2E\x25\xFF\x25\x25\x1F" + "\xFF\x27\x24\x1F\xFF\x27\x25\x1F\xFF" + "\x28\x25\x20\xFF\x26\x25\x1F\xFF\x25\x24\x1E\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x26\x24\x1F" + "\xFF\x28\x25\x20\xFF\x25\x23\x1E\xFF" + "\x26\x23\x1E\xFF\x24\x24\x1E\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x25\x22\x1D\xFF\x28\x25\x1F" + "\xFF\x26\x25\x1F\xFF\x25\x25\x1F\xFF" + "\x51\xC0\x8E\xFF\x52\xC2\x90\xFF\x53\xC4\x91\xFF\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x54\xC8\x94" + "\xFF\x55\xC9\x95\xFF\x55\xCA\x96\xFF" + "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCD\x98\xFF\x57\xCC\x97" + "\xFF\x57\xCD\x98\xFF\x54\xC7\x94\xFF" + "\x4A\x9E\x77\xFF\x3E\x75\x58\xFF\x35\x57\x42\xFF\x2E\x40\x32\xFF\x28\x33\x28\xFF\x29\x33\x28" + "\xFF\x28\x32\x27\xFF\x29\x32\x28\xFF" + "\x29\x31\x27\xFF\x2A\x32\x2A\xFF\x2C\x34\x2A\xFF\x2B\x34\x2A\xFF\x2B\x37\x2C\xFF\x2F\x42\x35" + "\xFF\x35\x55\x42\xFF\x3E\x74\x58\xFF" + "\x4E\xB2\x85\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x45\x90\x6B\xFF\x2B\x32\x28\xFF\x25\x25\x20" + "\xFF\x27\x24\x20\xFF\x29\x25\x20\xFF" + "\x25\x23\x1E\xFF\x26\x24\x1F\xFF\x27\x26\x1F\xFF\x25\x23\x1D\xFF\x25\x25\x1F\xFF\x26\x25\x1F" + "\xFF\x26\x25\x1F\xFF\x27\x24\x1F\xFF" + "\x26\x24\x1F\xFF\x22\x21\x1C\xFF\x25\x21\x1D\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF\x27\x25\x1F" + "\xFF\x25\x25\x1F\xFF\x27\x26\x20\xFF" + "\x51\xC0\x8F\xFF\x52\xC2\x90\xFF\x53\xC4\x92\xFF\x54\xC6\x93\xFF\x54\xC7\x93\xFF\x55\xC8\x95" + "\xFF\x55\xC9\x95\xFF\x55\xCA\x96\xFF" + "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x56\xCA\x96\xFF\x50\xB8\x89\xFF\x48\x9C\x74\xFF\x41\x83\x62\xFF\x3E\x76\x59" + "\xFF\x38\x66\x4D\xFF\x34\x56\x42\xFF" + "\x31\x4A\x38\xFF\x33\x51\x3F\xFF\x38\x5E\x48\xFF\x3B\x6B\x51\xFF\x41\x83\x62\xFF\x48\x9B\x74" + "\xFF\x4F\xB5\x86\xFF\x55\xC9\x95\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x55\xC5\x92\xFF\x38\x66\x4E\xFF\x2A\x2E\x26\xFF\x28\x26\x21" + "\xFF\x28\x25\x20\xFF\x27\x25\x1F\xFF" + "\x25\x25\x1E\xFF\x26\x25\x1F\xFF\x26\x25\x20\xFF\x22\x23\x1D\xFF\x27\x25\x20\xFF\x27\x25\x20" + "\xFF\x27\x25\x1F\xFF\x26\x24\x1F\xFF" + "\x25\x23\x1D\xFF\x25\x22\x1D\xFF\x26\x24\x1E\xFF\x26\x24\x1F\xFF\x27\x26\x20\xFF\x27\x27\x1F" + "\xFF\x27\x25\x20\xFF\x28\x25\x20\xFF" + "\x52\xC1\x8F\xFF\x52\xC3\x90\xFF\x53\xC4\x92\xFF\x54\xC6\x93\xFF\x54\xC8\x94\xFF\x55\xC8\x95" + "\xFF\x55\xC9\x95\xFF\x55\xCA\x96\xFF" + "\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCB\x96\xFF\x54\xC5\x92" + "\xFF\x52\xBE\x8D\xFF\x51\xB7\x88\xFF" + "\x4F\xB2\x84\xFF\x4F\xB5\x87\xFF\x52\xBB\x8B\xFF\x53\xC1\x8F\xFF\x55\xCA\x95\xFF\x56\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x49\x9C\x75\xFF\x2F\x44\x35\xFF\x26\x27\x23\xFF\x26\x25\x1E" + "\xFF\x29\x26\x20\xFF\x26\x26\x1E\xFF" + "\x26\x22\x1D\xFF\x26\x23\x1F\xFF\x27\x25\x20\xFF\x27\x24\x20\xFF\x27\x24\x1F\xFF\x25\x23\x1D" + "\xFF\x26\x25\x1E\xFF\x28\x25\x20\xFF" + "\x26\x24\x1D\xFF\x27\x24\x1F\xFF\x27\x25\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x25\x1E" + "\xFF\x27\x25\x1F\xFF\x27\x24\x1F\xFF" + "\x52\xC2\x90\xFF\x53\xC4\x91\xFF\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x54\xC8\x94\xFF\x55\xC9\x95" + "\xFF\x55\xCA\x96\xFF\x55\xCA\x96\xFF" + "\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF" + "\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98" + "\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF" + "\x51\xBC\x8B\xFF\x43\x8C\x69\xFF\x30\x48\x39\xFF\x2A\x2D\x27\xFF\x24\x25\x20\xFF\x24\x24\x1E" + "\xFF\x25\x24\x1E\xFF\x25\x22\x1D\xFF" + "\x27\x25\x1F\xFF\x28\x26\x20\xFF\x25\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x25\x1F\xFF\x27\x24\x1F" + "\xFF\x28\x25\x1F\xFF\x25\x24\x1E\xFF" + "\x25\x22\x1D\xFF\x27\x25\x1F\xFF\x27\x26\x20\xFF\x26\x24\x1E\xFF\x27\x25\x20\xFF\x27\x24\x1F" + "\xFF\x29\x26\x21\xFF\x26\x26\x20\xFF" + "\x52\xC3\x90\xFF\x53\xC4\x92\xFF\x54\xC6\x93\xFF\x54\xC8\x94\xFF\x55\xC8\x95\xFF\x55\xC9\x95" + "\xFF\x55\xCA\x96\xFF\x56\xCB\x96\xFF" + "\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97" + "\xFF\x52\xBE\x8D\xFF\x48\x9A\x73\xFF" + "\x38\x63\x4D\xFF\x2C\x39\x2E\xFF\x27\x2B\x24\xFF\x27\x26\x21\xFF\x25\x23\x1E\xFF\x25\x24\x1E" + "\xFF\x25\x24\x1D\xFF\x25\x26\x1D\xFF" + "\x25\x24\x1F\xFF\x27\x25\x1E\xFF\x26\x25\x1E\xFF\x26\x23\x1E\xFF\x25\x23\x1E\xFF\x26\x25\x20" + "\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF" + "\x27\x25\x1F\xFF\x26\x25\x1E\xFF\x25\x24\x1D\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x27\x24\x20" + "\xFF\x25\x23\x1E\xFF\x26\x24\x1F\xFF" + "\x53\xC4\x91\xFF\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x54\xC8\x94\xFF\x55\xC8\x95\xFF\x55\xC9\x95" + "\xFF\x55\xCA\x96\xFF\x56\xCB\x96\xFF" + "\x56\xCB\x96\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x58\xCC\x99\xFF\x57\xCD\x98\xFF\x57\xCD\x99\xFF\x57\xCD\x98\xFF\x52\xBE\x8D\xFF\x43\x8C\x68" + "\xFF\x35\x5D\x47\xFF\x2E\x40\x32\xFF" + "\x27\x2C\x26\xFF\x28\x2A\x23\xFF\x29\x29\x22\xFF\x27\x26\x20\xFF\x23\x22\x1C\xFF\x25\x23\x1D" + "\xFF\x26\x24\x1E\xFF\x27\x25\x20\xFF" + "\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x26\x1E\xFF\x28\x25\x20\xFF\x26\x24\x1D\xFF\x25\x23\x1E" + "\xFF\x26\x23\x1E\xFF\x24\x23\x1E\xFF" + "\x25\x22\x1C\xFF\x25\x23\x1E\xFF\x25\x23\x1D\xFF\x25\x24\x1E\xFF\x26\x23\x1F\xFF\x28\x25\x20" + "\xFF\x27\x24\x1E\xFF\x27\x24\x1E\xFF" + "\x53\xC4\x92\xFF\x54\xC6\x93\xFF\x54\xC7\x92\xFF\x55\xC8\x94\xFF\x55\xC9\x95\xFF\x54\xC9\x95" + "\xFF\x54\xC9\x95\xFF\x55\xCA\x95\xFF" + "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x56\xCD\x99\xFF\x56\xCD\x97" + "\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCE\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x99\xFF" + "\x56\xCD\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x58\xCD\x98\xFF\x56\xCD\x97\xFF\x56\xCC\x97" + "\xFF\x56\xCC\x97\xFF\x54\xC7\x93\xFF" + "\x51\xBC\x8B\xFF\x4E\xAF\x83\xFF\x46\x92\x6D\xFF\x39\x67\x4E\xFF\x2D\x3B\x30\xFF\x2B\x32\x29" + "\xFF\x29\x2D\x24\xFF\x28\x28\x22\xFF" + "\x27\x26\x20\xFF\x27\x25\x1F\xFF\x28\x26\x20\xFF\x28\x25\x20\xFF\x26\x25\x1F\xFF\x26\x26\x1F" + "\xFF\x26\x25\x1E\xFF\x28\x25\x20\xFF" + "\x2A\x27\x22\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x26\x23\x1C\xFF\x26\x23\x1E" + "\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF" + "\x26\x24\x1F\xFF\x28\x25\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x25\x23\x1E\xFF\x28\x25\x20" + "\xFF\x29\x26\x21\xFF\x25\x24\x1E\xFF" + "\x53\xC5\x92\xFF\x54\xC7\x93\xFF\x53\xC8\x93\xFF\x54\xC8\x94\xFF\x55\xC8\x94\xFF\x52\xBD\x8C" + "\xFF\x4C\xAD\x80\xFF\x4B\xA7\x7D\xFF" + "\x48\xA1\x77\xFF\x48\xA0\x77\xFF\x4B\xA7\x7D\xFF\x4F\xB0\x83\xFF\x51\xB9\x8A\xFF\x52\xC0\x8E" + "\xFF\x55\xC6\x92\xFF\x56\xCB\x96\xFF" + "\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x56\xCD\x97\xFF" + "\x57\xCD\x98\xFF\x56\xCB\x97\xFF\x54\xC4\x91\xFF\x50\xBA\x8B\xFF\x4E\xAF\x81\xFF\x49\x9F\x77" + "\xFF\x43\x8B\x68\xFF\x3F\x78\x5B\xFF" + "\x37\x61\x4A\xFF\x30\x48\x38\xFF\x2A\x35\x2B\xFF\x2A\x30\x27\xFF\x28\x2B\x22\xFF\x27\x27\x20" + "\xFF\x28\x26\x20\xFF\x28\x25\x20\xFF" + "\x27\x24\x1F\xFF\x25\x24\x1D\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x27\x24\x1F" + "\xFF\x26\x24\x1F\xFF\x27\x26\x20\xFF" + "\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x27\x24\x20\xFF\x28\x27\x20\xFF\x27\x24\x1F\xFF\x26\x23\x1E" + "\xFF\x26\x24\x1F\xFF\x27\x24\x20\xFF" + "\x26\x24\x1E\xFF\x27\x24\x1E\xFF\x25\x22\x1D\xFF\x26\x24\x1E\xFF\x26\x25\x1F\xFF\x27\x25\x1F" + "\xFF\x27\x26\x1F\xFF\x26\x24\x1E\xFF" + "\x54\xC6\x92\xFF\x54\xC8\x94\xFF\x54\xC8\x94\xFF\x54\xC8\x94\xFF\x44\x8C\x69\xFF\x37\x5E\x49" + "\xFF\x32\x4D\x3C\xFF\x31\x49\x38\xFF" + "\x2D\x42\x33\xFF\x2D\x44\x33\xFF\x2E\x47\x37\xFF\x32\x4E\x3C\xFF\x35\x54\x42\xFF\x34\x58\x43" + "\xFF\x34\x5C\x45\xFF\x38\x63\x4C\xFF" + "\x3C\x6F\x55\xFF\x40\x7B\x5C\xFF\x43\x87\x65\xFF\x45\x91\x6D\xFF\x44\x8E\x6B\xFF\x43\x8A\x68" + "\xFF\x43\x86\x65\xFF\x41\x81\x61\xFF" + "\x3D\x75\x59\xFF\x38\x67\x4E\xFF\x36\x5C\x47\xFF\x33\x55\x42\xFF\x33\x4E\x3C\xFF\x2F\x41\x34" + "\xFF\x2A\x34\x2A\xFF\x2B\x31\x27\xFF" + "\x27\x2C\x23\xFF\x29\x2B\x23\xFF\x28\x29\x22\xFF\x26\x25\x20\xFF\x29\x28\x22\xFF\x27\x26\x20" + "\xFF\x27\x25\x20\xFF\x27\x24\x20\xFF" + "\x29\x26\x21\xFF\x27\x25\x1F\xFF\x27\x25\x20\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF\x25\x25\x1F" + "\xFF\x26\x25\x1E\xFF\x28\x26\x21\xFF" + "\x27\x25\x20\xFF\x25\x25\x1E\xFF\x25\x24\x1F\xFF\x27\x25\x20\xFF\x28\x25\x20\xFF\x26\x24\x1F" + "\xFF\x26\x24\x20\xFF\x25\x24\x1F\xFF" + "\x26\x25\x1F\xFF\x26\x23\x1E\xFF\x23\x21\x1C\xFF\x25\x23\x1C\xFF\x28\x25\x20\xFF\x26\x25\x1F" + "\xFF\x28\x27\x1F\xFF\x27\x25\x1F\xFF" + "\x53\xC7\x92\xFF\x53\xC8\x94\xFF\x53\xC3\x91\xFF\x3E\x7B\x5D\xFF\x2B\x35\x2D\xFF\x25\x2B\x22" + "\xFF\x23\x26\x1E\xFF\x25\x26\x20\xFF" + "\x24\x24\x1E\xFF\x27\x27\x1F\xFF\x28\x28\x22\xFF\x28\x29\x23\xFF\x27\x29\x23\xFF\x27\x29\x23" + "\xFF\x2A\x2C\x25\xFF\x2A\x2D\x25\xFF" + "\x27\x2D\x25\xFF\x27\x2D\x25\xFF\x27\x2D\x24\xFF\x29\x30\x27\xFF\x29\x2F\x28\xFF\x28\x2F\x26" + "\xFF\x29\x30\x27\xFF\x29\x2F\x26\xFF" + "\x28\x2C\x23\xFF\x2A\x2D\x24\xFF\x29\x2B\x23\xFF\x28\x29\x22\xFF\x27\x27\x21\xFF\x26\x26\x21" + "\xFF\x27\x26\x1F\xFF\x29\x26\x21\xFF" + "\x26\x26\x20\xFF\x26\x24\x1F\xFF\x26\x24\x1E\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1F" + "\xFF\x26\x24\x1E\xFF\x26\x25\x1F\xFF" + "\x28\x25\x20\xFF\x28\x25\x20\xFF\x29\x27\x21\xFF\x29\x26\x21\xFF\x27\x24\x20\xFF\x25\x24\x1F" + "\xFF\x25\x24\x1F\xFF\x28\x25\x21\xFF" + "\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x29\x26\x20\xFF\x26\x25\x20\xFF\x29\x26\x21\xFF\x26\x23\x1F" + "\xFF\x27\x26\x20\xFF\x27\x24\x1F\xFF" + "\x27\x24\x1F\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x26\x25\x1F\xFF\x25\x22\x1D\xFF\x25\x23\x1F" + "\xFF\x26\x25\x20\xFF\x26\x25\x1F\xFF" + "\x53\xC8\x94\xFF\x54\xC8\x95\xFF\x49\xA4\x7A\xFF\x30\x49\x39\xFF\x26\x29\x23\xFF\x24\x25\x1F" + "\xFF\x23\x22\x1D\xFF\x25\x22\x1D\xFF" + "\x25\x24\x1D\xFF\x28\x25\x1F\xFF\x28\x26\x20\xFF\x26\x25\x1F\xFF\x25\x24\x1F\xFF\x27\x25\x20" + "\xFF\x27\x25\x20\xFF\x25\x24\x1F\xFF" + "\x26\x25\x1E\xFF\x28\x26\x20\xFF\x28\x27\x20\xFF\x26\x25\x1F\xFF\x27\x26\x20\xFF\x28\x26\x21" + "\xFF\x27\x26\x20\xFF\x26\x25\x20\xFF" + "\x27\x25\x20\xFF\x26\x25\x1F\xFF\x26\x26\x20\xFF\x27\x26\x1F\xFF\x25\x25\x20\xFF\x24\x23\x1D" + "\xFF\x25\x24\x1D\xFF\x27\x25\x1F\xFF" + "\x25\x25\x1E\xFF\x26\x23\x1F\xFF\x27\x25\x1F\xFF\x27\x26\x21\xFF\x29\x27\x22\xFF\x27\x25\x20" + "\xFF\x26\x24\x1D\xFF\x26\x25\x1E\xFF" + "\x27\x26\x20\xFF\x2A\x27\x21\xFF\x29\x27\x21\xFF\x27\x25\x1F\xFF\x25\x22\x1F\xFF\x24\x22\x1D" + "\xFF\x25\x23\x1D\xFF\x28\x26\x21\xFF" + "\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x26\x24\x1F" + "\xFF\x27\x26\x20\xFF\x26\x25\x1F\xFF" + "\x26\x23\x1F\xFF\x28\x25\x21\xFF\x28\x25\x20\xFF\x26\x25\x1E\xFF\x26\x25\x1F\xFF\x26\x25\x1F" + "\xFF\x26\x26\x1F\xFF\x26\x24\x1F\xFF" + "\x55\xC8\x94\xFF\x54\xC8\x94\xFF\x40\x80\x60\xFF\x29\x36\x2A\xFF\x26\x26\x20\xFF\x24\x23\x1D" + "\xFF\x24\x22\x1D\xFF\x27\x23\x1F\xFF" + "\x25\x23\x1D\xFF\x26\x24\x1F\xFF\x27\x27\x20\xFF\x29\x27\x21\xFF\x26\x24\x1F\xFF\x24\x24\x1E" + "\xFF\x26\x25\x1F\xFF\x26\x24\x1F\xFF" + "\x27\x24\x1F\xFF\x29\x27\x20\xFF\x29\x26\x20\xFF\x25\x24\x1E\xFF\x26\x24\x1F\xFF\x28\x25\x20" + "\xFF\x28\x25\x20\xFF\x26\x24\x1D\xFF" + "\x28\x25\x20\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x25\x24\x1F\xFF\x28\x25\x1F" + "\xFF\x27\x25\x1E\xFF\x27\x24\x1F\xFF" + "\x27\x25\x1F\xFF\x27\x25\x1F\xFF\x25\x25\x1F\xFF\x25\x24\x1E\xFF\x26\x23\x1F\xFF\x27\x24\x20" + "\xFF\x27\x25\x1F\xFF\x26\x24\x1F\xFF" + "\x25\x24\x1E\xFF\x28\x25\x20\xFF\x26\x23\x1E\xFF\x24\x23\x1E\xFF\x27\x24\x1F\xFF\x25\x25\x1F" + "\xFF\x26\x24\x1F\xFF\x27\x25\x20\xFF" + "\x27\x24\x1F\xFF\x27\x25\x1F\xFF\x27\x27\x20\xFF\x28\x27\x21\xFF\x24\x24\x1E\xFF\x27\x24\x1F" + "\xFF\x27\x26\x20\xFF\x28\x26\x20\xFF" + "\x26\x24\x1F\xFF\x26\x26\x1F\xFF\x29\x27\x21\xFF\x26\x25\x1F\xFF\x25\x25\x1F\xFF\x26\x25\x1F" + "\xFF\x26\x24\x1F\xFF\x26\x26\x1D\xFF" + "\x54\xC9\x94\xFF\x52\xC1\x8E\xFF\x3A\x6C\x52\xFF\x29\x30\x26\xFF\x25\x25\x1F\xFF\x24\x22\x1D" + "\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF" + "\x26\x23\x1E\xFF\x25\x24\x1F\xFF\x26\x25\x1F\xFF\x26\x26\x20\xFF\x27\x24\x1F\xFF\x27\x24\x1F" + "\xFF\x27\x25\x1F\xFF\x28\x26\x20\xFF" + "\x29\x26\x22\xFF\x2A\x27\x21\xFF\x28\x26\x20\xFF\x29\x26\x20\xFF\x27\x24\x1F\xFF\x26\x24\x20" + "\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF" + "\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x28\x26\x20\xFF\x29\x26\x21\xFF\x28\x25\x21\xFF\x27\x25\x20" + "\xFF\x27\x25\x20\xFF\x28\x25\x20\xFF" + "\x27\x24\x1F\xFF\x28\x26\x21\xFF\x25\x23\x1E\xFF\x23\x23\x1D\xFF\x27\x25\x20\xFF\x26\x24\x1F" + "\xFF\x28\x25\x20\xFF\x26\x25\x1E\xFF" + "\x23\x23\x1D\xFF\x25\x24\x1F\xFF\x26\x23\x1E\xFF\x26\x24\x1F\xFF\x28\x25\x1F\xFF\x26\x23\x1E" + "\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF" + "\x26\x25\x1F\xFF\x27\x25\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x24\x24\x1E\xFF\x24\x23\x1D" + "\xFF\x26\x24\x1E\xFF\x27\x25\x20\xFF" + "\x27\x26\x20\xFF\x27\x25\x1F\xFF\x28\x25\x1F\xFF\x28\x25\x1E\xFF\x27\x24\x1F\xFF\x27\x25\x20" + "\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF" + "\x55\xC9\x94\xFF\x52\xBE\x8C\xFF\x38\x68\x4F\xFF\x29\x2E\x25\xFF\x24\x24\x1D\xFF\x26\x23\x1F" + "\xFF\x28\x25\x20\xFF\x26\x23\x1E\xFF" + "\x25\x23\x1D\xFF\x25\x24\x1E\xFF\x27\x24\x1E\xFF\x27\x24\x1E\xFF\x26\x24\x1F\xFF\x26\x25\x1F" + "\xFF\x27\x25\x20\xFF\x26\x26\x20\xFF" + "\x29\x27\x21\xFF\x27\x25\x20\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF\x27\x24\x1F\xFF\x25\x23\x1E" + "\xFF\x25\x23\x1E\xFF\x27\x24\x20\xFF" + "\x27\x25\x1E\xFF\x26\x25\x1E\xFF\x27\x26\x20\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x27\x25\x1F" + "\xFF\x28\x26\x20\xFF\x28\x26\x20\xFF" + "\x27\x25\x20\xFF\x27\x24\x1F\xFF\x24\x22\x1D\xFF\x25\x23\x1E\xFF\x28\x26\x20\xFF\x27\x25\x20" + "\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" + "\x26\x25\x20\xFF\x27\x25\x20\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF\x25\x23\x1E" + "\xFF\x26\x23\x1E\xFF\x26\x25\x1E\xFF" + "\x28\x25\x1F\xFF\x27\x26\x20\xFF\x28\x25\x20\xFF\x27\x25\x1F\xFF\x26\x24\x1F\xFF\x25\x24\x1E" + "\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF" + "\x25\x23\x1E\xFF\x26\x24\x1E\xFF\x26\x23\x1E\xFF\x26\x25\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x20" + "\xFF\x26\x24\x1F\xFF\x24\x24\x1E\xFF" + "\x55\xCA\x95\xFF\x51\xBB\x8A\xFF\x38\x66\x4D\xFF\x28\x2D\x25\xFF\x24\x22\x1C\xFF\x26\x23\x1D" + "\xFF\x25\x23\x1D\xFF\x25\x24\x1E\xFF" + "\x26\x23\x1E\xFF\x25\x24\x1E\xFF\x25\x25\x1F\xFF\x27\x25\x1F\xFF\x29\x27\x20\xFF\x28\x26\x21" + "\xFF\x27\x24\x1F\xFF\x24\x23\x1D\xFF" + "\x27\x24\x1F\xFF\x28\x25\x20\xFF\x28\x27\x21\xFF\x26\x24\x1F\xFF\x23\x22\x1C\xFF\x25\x24\x1E" + "\xFF\x27\x25\x1F\xFF\x27\x24\x1F\xFF" + "\x25\x25\x1E\xFF\x28\x27\x20\xFF\x27\x25\x1F\xFF\x26\x24\x20\xFF\x29\x26\x21\xFF\x28\x26\x20" + "\xFF\x27\x26\x20\xFF\x2A\x28\x22\xFF" + "\x28\x25\x20\xFF\x28\x25\x20\xFF\x26\x25\x20\xFF\x27\x25\x20\xFF\x26\x23\x1E\xFF\x27\x25\x20" + "\xFF\x27\x26\x1F\xFF\x27\x25\x1F\xFF" + "\x28\x25\x20\xFF\x26\x24\x1E\xFF\x26\x24\x1E\xFF\x24\x21\x1C\xFF\x23\x22\x1C\xFF\x25\x23\x1E" + "\xFF\x25\x25\x1F\xFF\x27\x25\x1E\xFF" + "\x27\x26\x20\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x29\x27\x20\xFF\x27\x24\x20\xFF\x27\x26\x1F" + "\xFF\x27\x25\x1F\xFF\x29\x26\x21\xFF" + "\x25\x24\x1E\xFF\x28\x25\x20\xFF\x26\x24\x1E\xFF\x24\x24\x1E\xFF\x26\x25\x1E\xFF\x28\x25\x20" + "\xFF\x28\x25\x20\xFF\x24\x23\x1E\xFF" + "\x56\xCB\x96\xFF\x53\xC0\x8F\xFF\x39\x6A\x50\xFF\x28\x2D\x25\xFF\x28\x25\x20\xFF\x28\x25\x1F" + "\xFF\x28\x26\x1F\xFF\x27\x24\x1F\xFF" + "\x28\x25\x20\xFF\x27\x25\x20\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF\x2A\x27\x21\xFF\x2A\x27\x22" + "\xFF\x29\x26\x21\xFF\x29\x26\x21\xFF" + "\x27\x24\x1F\xFF\x27\x25\x1F\xFF\x27\x25\x1F\xFF\x26\x25\x1F\xFF\x25\x23\x1E\xFF\x26\x25\x1F" + "\xFF\x27\x25\x20\xFF\x28\x26\x1F\xFF" + "\x28\x26\x21\xFF\x26\x25\x20\xFF\x27\x25\x20\xFF\x28\x26\x21\xFF\x26\x24\x1F\xFF\x27\x26\x20" + "\xFF\x28\x25\x20\xFF\x27\x25\x1F\xFF" + "\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF\x24\x23\x1D\xFF\x26\x23\x1E" + "\xFF\x26\x25\x1F\xFF\x27\x24\x20\xFF" + "\x25\x25\x1F\xFF\x25\x23\x1E\xFF\x23\x23\x1D\xFF\x25\x22\x1D\xFF\x27\x25\x1D\xFF\x26\x25\x1E" + "\xFF\x28\x27\x20\xFF\x27\x24\x1F\xFF" + "\x27\x24\x1F\xFF\x27\x26\x1F\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x29\x26\x21\xFF\x27\x24\x1F" + "\xFF\x27\x26\x1F\xFF\x27\x25\x1F\xFF" + "\x28\x24\x1F\xFF\x26\x23\x1F\xFF\x26\x23\x1E\xFF\x25\x24\x1E\xFF\x26\x25\x1E\xFF\x25\x23\x1E" + "\xFF\x26\x25\x1F\xFF\x26\x26\x20\xFF" + "\x56\xCB\x96\xFF\x55\xC6\x92\xFF\x3B\x71\x56\xFF\x27\x2F\x26\xFF\x26\x25\x1F\xFF\x24\x23\x1D" + "\xFF\x26\x25\x1F\xFF\x27\x25\x20\xFF" + "\x24\x23\x1D\xFF\x26\x24\x1F\xFF\x27\x25\x20\xFF\x28\x26\x21\xFF\x25\x24\x1E\xFF\x27\x25\x20" + "\xFF\x27\x24\x1F\xFF\x27\x25\x1F\xFF" + "\x29\x26\x20\xFF\x27\x24\x1F\xFF\x26\x24\x1E\xFF\x26\x23\x1E\xFF\x27\x25\x1F\xFF\x26\x25\x1E" + "\xFF\x27\x25\x1F\xFF\x27\x24\x1F\xFF" + "\x28\x26\x20\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x28\x26\x21\xFF\x25\x24\x1F\xFF\x28\x26\x21" + "\xFF\x27\x24\x1F\xFF\x26\x25\x1F\xFF" + "\x26\x25\x1F\xFF\x25\x23\x1D\xFF\x26\x24\x1F\xFF\x27\x25\x1F\xFF\x26\x23\x1E\xFF\x25\x23\x1E" + "\xFF\x27\x25\x1F\xFF\x28\x26\x21\xFF" + "\x27\x25\x20\xFF\x25\x24\x1F\xFF\x25\x24\x1E\xFF\x26\x24\x1F\xFF\x28\x26\x20\xFF\x26\x26\x1F" + "\xFF\x26\x25\x1E\xFF\x28\x26\x1F\xFF" + "\x26\x22\x1E\xFF\x26\x23\x1E\xFF\x26\x23\x1E\xFF\x27\x25\x20\xFF\x26\x23\x1E\xFF\x26\x24\x1E" + "\xFF\x27\x25\x1F\xFF\x26\x25\x1E\xFF" + "\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x28\x25\x1F\xFF\x27\x25\x1F\xFF\x27\x24\x1E\xFF\x27\x25\x20" + "\xFF\x26\x25\x1F\xFF\x25\x24\x1E\xFF" + "\x56\xCB\x96\xFF\x56\xCB\x96\xFF\x43\x87\x66\xFF\x2C\x39\x2D\xFF\x25\x25\x1D\xFF\x25\x22\x1D" + "\xFF\x27\x24\x1F\xFF\x29\x26\x21\xFF" + "\x27\x25\x1F\xFF\x27\x24\x20\xFF\x28\x24\x20\xFF\x28\x27\x22\xFF\x26\x24\x1F\xFF\x25\x24\x1E" + "\xFF\x27\x24\x1F\xFF\x23\x20\x1B\xFF" + "\x23\x23\x1C\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x28\x26\x21\xFF\x27\x24\x1E\xFF\x26\x24\x1E" + "\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" + "\x28\x25\x20\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x26\x25\x1F\xFF\x2A\x28\x21" + "\xFF\x29\x26\x20\xFF\x27\x26\x20\xFF" + "\x29\x27\x21\xFF\x29\x27\x20\xFF\x29\x26\x21\xFF\x27\x25\x1F\xFF\x28\x25\x20\xFF\x28\x26\x20" + "\xFF\x29\x26\x20\xFF\x27\x25\x1E\xFF" + "\x28\x23\x20\xFF\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x26\x24\x1E\xFF\x25\x24\x1E\xFF\x27\x24\x1F" + "\xFF\x28\x25\x20\xFF\x28\x25\x1E\xFF" + "\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x25\x25\x1D\xFF\x25\x22\x1E\xFF\x27\x24\x1F" + "\xFF\x29\x27\x20\xFF\x26\x24\x1E\xFF" + "\x25\x24\x1F\xFF\x28\x26\x20\xFF\x28\x25\x1E\xFF\x25\x24\x1E\xFF\x28\x26\x1E\xFF\x27\x25\x20" + "\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF" + "\x55\xCC\x96\xFF\x56\xCC\x97\xFF\x4B\xA6\x7A\xFF\x2E\x47\x36\xFF\x25\x25\x20\xFF\x28\x26\x21" + "\xFF\x29\x26\x21\xFF\x28\x25\x20\xFF" + "\x25\x25\x1F\xFF\x25\x22\x1E\xFF\x27\x24\x1F\xFF\x28\x25\x20\xFF\x25\x24\x1E\xFF\x25\x25\x1F" + "\xFF\x27\x25\x20\xFF\x27\x24\x1F\xFF" + "\x23\x23\x1D\xFF\x24\x22\x1D\xFF\x25\x23\x1E\xFF\x26\x26\x20\xFF\x26\x24\x1F\xFF\x26\x23\x1F" + "\xFF\x26\x25\x1F\xFF\x24\x23\x1E\xFF" + "\x25\x24\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x25\x23\x1F\xFF\x27\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x24\x23\x1E\xFF" + "\x26\x23\x1F\xFF\x29\x26\x21\xFF\x26\x23\x1E\xFF\x23\x22\x1D\xFF\x27\x24\x1F\xFF\x28\x25\x1F" + "\xFF\x27\x25\x20\xFF\x28\x26\x20\xFF" + "\x26\x24\x1E\xFF\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x26\x23\x1E" + "\xFF\x27\x25\x1F\xFF\x25\x23\x1E\xFF" + "\x28\x26\x1F\xFF\x27\x24\x1F\xFF\x27\x25\x1F\xFF\x26\x24\x1F\xFF\x29\x26\x21\xFF\x28\x25\x20" + "\xFF\x27\x24\x20\xFF\x24\x22\x1D\xFF" + "\x29\x26\x21\xFF\x28\x25\x20\xFF\x27\x24\x1F\xFF\x27\x25\x20\xFF\x26\x23\x1E\xFF\x28\x25\x20" + "\xFF\x28\x25\x1F\xFF\x25\x23\x1E\xFF" + "\x55\xCC\x97\xFF\x56\xCC\x97\xFF\x51\xBE\x8C\xFF\x32\x52\x3F\xFF\x27\x2A\x22\xFF\x28\x26\x21" + "\xFF\x27\x24\x20\xFF\x27\x25\x20\xFF" + "\x26\x24\x1F\xFF\x29\x26\x21\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF\x26\x24\x1F\xFF\x26\x24\x1F" + "\xFF\x28\x25\x20\xFF\x27\x25\x1F\xFF" + "\x26\x25\x20\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x29\x29\x22\xFF\x25\x25\x1F\xFF\x27\x24\x20" + "\xFF\x29\x26\x21\xFF\x26\x24\x1F\xFF" + "\x26\x24\x1E\xFF\x27\x25\x1F\xFF\x29\x26\x21\xFF\x27\x24\x1F\xFF\x26\x25\x1F\xFF\x28\x25\x20" + "\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF" + "\x25\x22\x1D\xFF\x25\x22\x1D\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x27\x25\x1F" + "\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF" + "\x26\x25\x1E\xFF\x26\x24\x1F\xFF\x28\x26\x20\xFF\x2A\x27\x22\xFF\x29\x26\x21\xFF\x25\x24\x1E" + "\xFF\x24\x22\x1C\xFF\x24\x23\x1D\xFF" + "\x26\x24\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x28\x25\x1F\xFF\x26\x24\x1F\xFF\x26\x25\x1F" + "\xFF\x26\x25\x1E\xFF\x25\x23\x1D\xFF" + "\x26\x24\x1E\xFF\x24\x23\x1E\xFF\x26\x23\x1E\xFF\x27\x26\x20\xFF\x26\x23\x1E\xFF\x27\x25\x1E" + "\xFF\x28\x25\x1F\xFF\x27\x25\x1F\xFF" + "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x55\xCA\x95\xFF\x39\x6C\x51\xFF\x29\x2F\x26\xFF\x29\x28\x22" + "\xFF\x28\x25\x20\xFF\x29\x27\x22\xFF" + "\x28\x25\x20\xFF\x26\x25\x1F\xFF\x26\x24\x1F\xFF\x27\x25\x20\xFF\x26\x25\x1E\xFF\x26\x24\x1F" + "\xFF\x25\x22\x1E\xFF\x27\x24\x1F\xFF" + "\x25\x25\x1F\xFF\x25\x24\x1F\xFF\x26\x25\x1F\xFF\x25\x23\x1E\xFF\x26\x24\x1E\xFF\x27\x24\x1F" + "\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF" + "\x27\x24\x1F\xFF\x26\x25\x1E\xFF\x28\x26\x20\xFF\x27\x25\x20\xFF\x26\x24\x1E\xFF\x27\x26\x1F" + "\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF" + "\x26\x25\x1F\xFF\x27\x24\x20\xFF\x27\x26\x20\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x28\x25\x20" + "\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF" + "\x29\x27\x21\xFF\x28\x25\x20\xFF\x26\x25\x1F\xFF\x29\x26\x21\xFF\x29\x26\x21\xFF\x28\x26\x20" + "\xFF\x27\x25\x1E\xFF\x28\x25\x1E\xFF" + "\x27\x26\x21\xFF\x29\x26\x21\xFF\x27\x24\x1F\xFF\x26\x26\x1E\xFF\x25\x24\x1E\xFF\x26\x24\x1E" + "\xFF\x25\x24\x1E\xFF\x26\x25\x1F\xFF" + "\x24\x23\x1D\xFF\x25\x24\x1D\xFF\x26\x24\x1E\xFF\x27\x24\x1F\xFF\x26\x24\x1E\xFF\x25\x23\x1D" + "\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF" + "\x57\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x4A\xA3\x79\xFF\x29\x35\x2B\xFF\x27\x29\x23" + "\xFF\x27\x25\x1F\xFF\x27\x25\x1E\xFF" + "\x27\x26\x1F\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x29\x27\x20\xFF\x27\x25\x20\xFF\x29\x26\x21" + "\xFF\x25\x23\x1E\xFF\x25\x22\x1D\xFF" + "\x25\x25\x1F\xFF\x25\x24\x1E\xFF\x27\x24\x1F\xFF\x29\x26\x21\xFF\x26\x26\x20\xFF\x26\x24\x1F" + "\xFF\x27\x25\x1F\xFF\x26\x25\x1F\xFF" + "\x28\x25\x20\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x25\x23\x1E\xFF\x29\x26\x21\xFF\x29\x27\x20" + "\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" + "\x25\x22\x1D\xFF\x26\x24\x1E\xFF\x26\x24\x1F\xFF\x24\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F" + "\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF" + "\x26\x23\x1F\xFF\x28\x26\x20\xFF\x27\x26\x20\xFF\x27\x25\x20\xFF\x27\x25\x20\xFF\x26\x24\x1E" + "\xFF\x27\x25\x1F\xFF\x27\x25\x1E\xFF" + "\x27\x24\x1F\xFF\x28\x27\x21\xFF\x27\x25\x20\xFF\x26\x25\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1F" + "\xFF\x26\x24\x1E\xFF\x2A\x26\x21\xFF" + "\x28\x25\x20\xFF\x26\x24\x1E\xFF\x26\x24\x1F\xFF\x25\x24\x1E\xFF\x28\x25\x20\xFF\x26\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x26\x23\x1D\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x55\xC8\x93\xFF\x32\x53\x40\xFF\x28\x2E\x25" + "\xFF\x25\x25\x20\xFF\x24\x23\x1E\xFF" + "\x28\x25\x20\xFF\x28\x26\x21\xFF\x27\x26\x1F\xFF\x27\x26\x20\xFF\x27\x24\x1F\xFF\x27\x26\x1F" + "\xFF\x27\x27\x21\xFF\x26\x25\x20\xFF" + "\x26\x25\x20\xFF\x27\x25\x1F\xFF\x28\x25\x1F\xFF\x26\x24\x1F\xFF\x25\x24\x1E\xFF\x27\x25\x20" + "\xFF\x29\x27\x22\xFF\x27\x25\x20\xFF" + "\x27\x24\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x24\x23\x1D\xFF\x29\x26\x21\xFF\x27\x25\x20" + "\xFF\x26\x24\x1F\xFF\x26\x23\x1E\xFF" + "\x25\x23\x1E\xFF\x28\x25\x20\xFF\x26\x23\x1E\xFF\x25\x23\x1E\xFF\x29\x25\x20\xFF\x26\x24\x1F" + "\xFF\x26\x24\x1F\xFF\x26\x25\x1F\xFF" + "\x26\x23\x1E\xFF\x29\x26\x21\xFF\x28\x25\x20\xFF\x25\x25\x1F\xFF\x25\x24\x1E\xFF\x25\x22\x1D" + "\xFF\x27\x25\x1F\xFF\x28\x26\x21\xFF" + "\x26\x24\x1F\xFF\x26\x25\x1F\xFF\x26\x25\x1F\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x25\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x28\x26\x20\xFF" + "\x28\x25\x20\xFF\x28\x26\x20\xFF\x28\x25\x1F\xFF\x24\x23\x1D\xFF\x26\x24\x1F\xFF\x26\x25\x1F" + "\xFF\x25\x24\x1E\xFF\x25\x23\x1C\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x97\xFF\x43\x8E\x6A\xFF\x2B\x3C\x2F" + "\xFF\x29\x32\x28\xFF\x28\x30\x26\xFF" + "\x2A\x2F\x28\xFF\x29\x2F\x26\xFF\x29\x2D\x25\xFF\x2A\x2E\x26\xFF\x28\x2B\x23\xFF\x27\x2A\x24" + "\xFF\x28\x2B\x25\xFF\x27\x2A\x23\xFF" + "\x27\x29\x21\xFF\x27\x29\x22\xFF\x27\x28\x20\xFF\x29\x27\x22\xFF\x26\x25\x1F\xFF\x2A\x28\x23" + "\xFF\x28\x28\x21\xFF\x24\x24\x1D\xFF" + "\x26\x23\x1E\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x25\x23\x1E\xFF\x24\x22\x1E\xFF\x26\x23\x1E" + "\xFF\x26\x24\x1F\xFF\x26\x25\x1F\xFF" + "\x26\x24\x1F\xFF\x28\x25\x20\xFF\x28\x26\x21\xFF\x27\x25\x20\xFF\x28\x25\x20\xFF\x27\x24\x1F" + "\xFF\x25\x24\x1F\xFF\x25\x23\x1E\xFF" + "\x26\x23\x1E\xFF\x27\x24\x1F\xFF\x27\x25\x20\xFF\x23\x23\x1D\xFF\x24\x23\x1E\xFF\x25\x23\x1E" + "\xFF\x25\x25\x1F\xFF\x26\x24\x1F\xFF" + "\x28\x25\x20\xFF\x27\x25\x20\xFF\x27\x25\x1F\xFF\x27\x24\x20\xFF\x26\x25\x20\xFF\x26\x23\x1E" + "\xFF\x28\x25\x20\xFF\x25\x22\x1D\xFF" + "\x27\x24\x1F\xFF\x27\x25\x20\xFF\x28\x25\x1F\xFF\x26\x24\x1E\xFF\x27\x24\x1F\xFF\x27\x24\x1F" + "\xFF\x26\x23\x1E\xFF\x25\x24\x1E\xFF" + "\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x56\xCD\x97\xFF\x54\xC5\x93\xFF\x49\xA2\x78" + "\xFF\x47\x94\x6F\xFF\x44\x8D\x6A\xFF" + "\x42\x87\x64\xFF\x40\x7F\x5F\xFF\x3F\x79\x5B\xFF\x3D\x71\x57\xFF\x37\x68\x4F\xFF\x39\x65\x4D" + "\xFF\x38\x60\x4B\xFF\x36\x5E\x49\xFF" + "\x37\x5A\x45\xFF\x32\x51\x3E\xFF\x30\x48\x38\xFF\x2F\x41\x33\xFF\x2A\x35\x2A\xFF\x2C\x31\x2A" + "\xFF\x2B\x31\x29\xFF\x29\x2E\x26\xFF" + "\x2B\x2D\x27\xFF\x28\x2A\x23\xFF\x28\x2A\x23\xFF\x26\x27\x21\xFF\x26\x26\x20\xFF\x26\x25\x1F" + "\xFF\x27\x24\x1E\xFF\x28\x27\x1F\xFF" + "\x27\x26\x1D\xFF\x25\x24\x1F\xFF\x26\x25\x1F\xFF\x26\x24\x1D\xFF\x24\x23\x1D\xFF\x25\x23\x1E" + "\xFF\x25\x23\x1E\xFF\x26\x23\x1E\xFF" + "\x29\x26\x21\xFF\x27\x24\x20\xFF\x28\x27\x20\xFF\x27\x26\x1E\xFF\x28\x26\x21\xFF\x26\x24\x1E" + "\xFF\x27\x25\x1F\xFF\x26\x24\x1F\xFF" + "\x26\x26\x1E\xFF\x28\x26\x20\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x24\x1F" + "\xFF\x27\x25\x20\xFF\x25\x24\x1E\xFF" + "\x28\x25\x20\xFF\x26\x23\x1E\xFF\x29\x26\x21\xFF\x27\x25\x20\xFF\x27\x26\x20\xFF\x26\x25\x1F" + "\xFF\x27\x26\x1F\xFF\x28\x26\x20\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97" + "\xFF\x55\xC9\x95\xFF\x54\xC6\x93\xFF" + "\x53\xBF\x8D\xFF\x4F\xB4\x85\xFF\x4C\xA8\x7D\xFF\x48\x9C\x74\xFF\x44\x8D\x6A\xFF\x41\x82\x62" + "\xFF\x3D\x76\x59\xFF\x3B\x6A\x51\xFF" + "\x36\x5A\x46\xFF\x30\x4B\x3B\xFF\x2C\x3D\x30\xFF\x2B\x35\x2B\xFF\x2B\x32\x2A\xFF\x2A\x2F\x27" + "\xFF\x2A\x2C\x24\xFF\x2A\x2B\x24\xFF" + "\x28\x29\x22\xFF\x27\x26\x20\xFF\x26\x25\x1F\xFF\x27\x24\x1F\xFF\x28\x25\x1E\xFF\x26\x23\x1E" + "\xFF\x26\x24\x1F\xFF\x27\x26\x1F\xFF" + "\x28\x25\x20\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x26\x25\x20\xFF\x25\x24\x1E\xFF\x25\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x27\x24\x20\xFF" + "\x27\x24\x1F\xFF\x25\x25\x1F\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x27\x24\x1F" + "\xFF\x28\x26\x1F\xFF\x28\x26\x1F\xFF" + "\x28\x26\x20\xFF\x28\x26\x1F\xFF\x27\x25\x20\xFF\x27\x26\x20\xFF\x27\x26\x1F\xFF\x28\x26\x20" + "\xFF\x29\x25\x20\xFF\x27\x25\x20\xFF" + "\x56\xCC\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x97\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCA\x96" + "\xFF\x54\xC5\x92\xFF\x53\xC0\x8F\xFF" + "\x51\xB9\x89\xFF\x50\xB3\x85\xFF\x4D\xAC\x80\xFF\x49\xA1\x78\xFF\x43\x8E\x6A\xFF\x3D\x76\x59" + "\xFF\x34\x56\x42\xFF\x2E\x3D\x30\xFF" + "\x2D\x36\x2C\xFF\x2A\x31\x28\xFF\x26\x2A\x23\xFF\x25\x28\x21\xFF\x28\x29\x22\xFF\x27\x26\x1F" + "\xFF\x28\x27\x20\xFF\x26\x26\x1E\xFF" + "\x28\x25\x20\xFF\x29\x26\x21\xFF\x27\x24\x1F\xFF\x25\x25\x1F\xFF\x26\x24\x1F\xFF\x27\x25\x20" + "\xFF\x27\x26\x20\xFF\x27\x24\x1F\xFF" + "\x24\x25\x1F\xFF\x26\x25\x1F\xFF\x28\x26\x20\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x26\x23\x1E" + "\xFF\x25\x23\x1D\xFF\x29\x26\x20\xFF" + "\x28\x26\x1F\xFF\x29\x26\x21\xFF\x27\x26\x20\xFF\x26\x24\x1E\xFF\x27\x25\x1F\xFF\x27\x24\x1F" + "\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF" + "\x56\xCE\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x97\xFF\x58\xCC\x97\xFF\x56\xCC\x97" + "\xFF\x57\xCC\x97\xFF\x56\xC6\x91\xFF" + "\x4B\xA9\x7D\xFF\x42\x8C\x69\xFF\x3A\x6D\x54\xFF\x36\x5B\x46\xFF\x2F\x49\x38\xFF\x2C\x3D\x2F" + "\xFF\x29\x32\x27\xFF\x28\x2E\x26\xFF" + "\x27\x2B\x23\xFF\x27\x28\x22\xFF\x24\x25\x1E\xFF\x23\x23\x1D\xFF\x26\x24\x1F\xFF\x27\x24\x1E" + "\xFF\x26\x23\x1E\xFF\x28\x26\x20\xFF" + "\x27\x26\x20\xFF\x27\x25\x20\xFF\x26\x24\x1E\xFF\x25\x23\x1E\xFF\x25\x24\x1E\xFF\x24\x23\x1D" + "\xFF\x25\x24\x1E\xFF\x27\x24\x1F\xFF" + "\x27\x26\x1E\xFF\x27\x26\x20\xFF\x28\x26\x21\xFF\x28\x25\x20\xFF\x29\x26\x21\xFF\x25\x24\x1E" + "\xFF\x22\x21\x1C\xFF\x26\x24\x1F\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x57\xCD\x98" + "\xFF\x56\xCD\x97\xFF\x56\xCC\x97\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x56\xCB\x96\xFF\x52\xC0\x8E\xFF\x4C\xAB\x7E\xFF\x46\x97\x70" + "\xFF\x41\x82\x62\xFF\x3C\x6E\x53\xFF" + "\x34\x54\x41\xFF\x2C\x3C\x31\xFF\x28\x30\x27\xFF\x27\x2C\x23\xFF\x27\x29\x22\xFF\x28\x27\x21" + "\xFF\x26\x25\x1F\xFF\x27\x27\x20\xFF" + "\x28\x25\x20\xFF\x26\x25\x20\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x25\x23\x1E\xFF\x25\x24\x1E" + "\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF" + "\x28\x26\x21\xFF\x26\x24\x1E\xFF\x25\x25\x1F\xFF\x26\x24\x1F\xFF\x25\x23\x1E\xFF\x27\x24\x1F" + "\xFF\x28\x25\x20\xFF\x26\x24\x1F\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x56\xCD\x97\xFF\x56\xCD\x97\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCD\x97\xFF\x57\xCD\x97" + "\xFF\x55\xCA\x95\xFF\x53\xC2\x90\xFF" + "\x50\xB6\x88\xFF\x4B\xA7\x7C\xFF\x41\x86\x64\xFF\x35\x5A\x45\xFF\x2B\x38\x2D\xFF\x29\x31\x28" + "\xFF\x28\x2C\x25\xFF\x26\x28\x22\xFF" + "\x26\x26\x21\xFF\x27\x25\x20\xFF\x26\x24\x1F\xFF\x26\x24\x1F\xFF\x27\x24\x1F\xFF\x28\x25\x1F" + "\xFF\x29\x26\x20\xFF\x29\x26\x21\xFF" + "\x2B\x29\x22\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x28\x26\x20\xFF\x29\x27\x20\xFF\x28\x25\x20" + "\xFF\x28\x25\x1F\xFF\x28\x26\x20\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x97\xFF\x57\xCD\x97\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCD\x97\xFF\x57\xCD\x97\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF" + "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x97" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97" + "\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCC\x97\xFF\x56\xCD\x97\xFF\x57\xCC\x97\xFF\x52\xBB\x89\xFF\x46\x91\x6C" + "\xFF\x38\x68\x4F\xFF\x31\x4F\x3D\xFF" + "\x2C\x3A\x30\xFF\x2A\x30\x28\xFF\x27\x2A\x24\xFF\x26\x28\x21\xFF\x25\x26\x1E\xFF\x27\x25\x1F" + "\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF" + "\x25\x24\x1D\xFF\x24\x24\x1D\xFF\x27\x25\x1F\xFF\x28\x26\x1F\xFF\x23\x23\x1D\xFF\x26\x23\x1E" + "\xFF\x28\x26\x20\xFF\x27\x25\x1F\xFF" + "\x56\xCB\x96\xFF\x55\xCA\x95\xFF\x55\xC9\x94\xFF\x56\xCB\x96\xFF\x58\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x55\xC8\x94\xFF\x4F\xB4\x86\xFF" + "\x46\x93\x6E\xFF\x3F\x76\x59\xFF\x34\x57\x42\xFF\x2B\x3B\x2E\xFF\x29\x30\x27\xFF\x2B\x2D\x24" + "\xFF\x28\x28\x22\xFF\x26\x25\x1F\xFF" + "\x25\x25\x1E\xFF\x28\x25\x20\xFF\x28\x25\x20\xFF\x27\x25\x1E\xFF\x24\x22\x1D\xFF\x26\x23\x1E" + "\xFF\x28\x24\x1F\xFF\x25\x25\x1E\xFF" + "\x39\x64\x4C\xFF\x38\x62\x4B\xFF\x37\x61\x4A\xFF\x37\x62\x4B\xFF\x39\x68\x4F\xFF\x3B\x71\x55" + "\xFF\x3F\x7B\x5B\xFF\x40\x81\x60\xFF" + "\x44\x8C\x69\xFF\x47\x94\x6F\xFF\x49\x9C\x75\xFF\x4A\xA3\x7A\xFF\x4C\xAB\x7F\xFF\x50\xB5\x86" + "\xFF\x53\xC3\x90\xFF\x56\xCC\x97\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x58\xCD\x98\xFF\x57\xCD\x97\xFF\x57\xCD\x97" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x97\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97" + "\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF" + "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x58\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCC\x97\xFF\x54\xC5\x92\xFF\x50\xB8\x88\xFF\x4B\xA5\x7A\xFF\x3F\x79\x5B\xFF\x31\x4C\x3C" + "\xFF\x29\x34\x29\xFF\x27\x2E\x25\xFF" + "\x26\x26\x22\xFF\x26\x25\x20\xFF\x26\x25\x20\xFF\x27\x27\x1F\xFF\x23\x21\x1C\xFF\x29\x26\x20" + "\xFF\x27\x26\x21\xFF\x27\x25\x1F\xFF" + "\x2A\x2C\x24\xFF\x29\x2B\x24\xFF\x26\x28\x23\xFF\x2A\x2C\x25\xFF\x28\x2C\x24\xFF\x27\x2B\x23" + "\xFF\x26\x2B\x23\xFF\x28\x2F\x25\xFF" + "\x27\x2E\x25\xFF\x2A\x31\x28\xFF\x29\x33\x2A\xFF\x29\x34\x2A\xFF\x2D\x37\x2C\xFF\x2D\x38\x2D" + "\xFF\x2C\x3B\x2E\xFF\x2F\x43\x35\xFF" + "\x35\x5B\x47\xFF\x3C\x70\x55\xFF\x41\x83\x62\xFF\x47\x95\x6E\xFF\x4B\xA7\x7B\xFF\x4E\xAF\x82" + "\xFF\x50\xB6\x87\xFF\x52\xBC\x8C\xFF" + "\x54\xC5\x92\xFF\x56\xCB\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x97" + "\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF" + "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97" + "\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF" + "\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97" + "\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF" + "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x97\xFF\x56\xCC\x97\xFF\x54\xC6\x92" + "\xFF\x4A\xA1\x78\xFF\x3D\x6E\x54\xFF" + "\x32\x4A\x39\xFF\x2E\x35\x2B\xFF\x27\x29\x22\xFF\x24\x24\x1E\xFF\x28\x27\x1F\xFF\x26\x26\x20" + "\xFF\x26\x24\x1F\xFF\x25\x24\x1E\xFF" + "\x26\x26\x20\xFF\x25\x25\x1F\xFF\x24\x23\x1E\xFF\x24\x23\x1E\xFF\x27\x26\x20\xFF\x26\x25\x1F" + "\xFF\x26\x26\x1F\xFF\x25\x25\x1F\xFF" + "\x26\x25\x1F\xFF\x24\x24\x1F\xFF\x28\x28\x21\xFF\x2A\x2A\x23\xFF\x26\x26\x20\xFF\x26\x28\x21" + "\xFF\x26\x29\x21\xFF\x2A\x2C\x24\xFF" + "\x27\x2B\x24\xFF\x29\x2E\x25\xFF\x29\x30\x27\xFF\x2B\x33\x2A\xFF\x2B\x37\x2D\xFF\x31\x44\x35" + "\xFF\x34\x53\x40\xFF\x38\x61\x4A\xFF" + "\x3C\x74\x58\xFF\x43\x88\x66\xFF\x4A\x9D\x76\xFF\x4E\xB1\x83\xFF\x54\xC4\x91\xFF\x56\xCD\x97" + "\xFF\x57\xCD\x97\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF" + "\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x56\xCC\x97" + "\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF" + "\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x56\xC9\x94\xFF" + "\x4C\xA7\x7C\xFF\x41\x81\x61\xFF\x35\x58\x44\xFF\x2D\x39\x2F\xFF\x2B\x30\x28\xFF\x28\x2A\x22" + "\xFF\x27\x26\x20\xFF\x27\x25\x20\xFF" + "\x27\x25\x1F\xFF\x26\x24\x1D\xFF\x28\x26\x1F\xFF\x28\x26\x20\xFF\x25\x24\x1F\xFF\x25\x24\x1E" + "\xFF\x25\x23\x1E\xFF\x26\x24\x1F\xFF" + "\x26\x23\x1E\xFF\x25\x24\x1E\xFF\x29\x26\x21\xFF\x2A\x28\x20\xFF\x28\x25\x20\xFF\x28\x26\x20" + "\xFF\x27\x25\x1E\xFF\x26\x26\x1F\xFF" + "\x26\x27\x1F\xFF\x27\x25\x1F\xFF\x25\x26\x1E\xFF\x26\x27\x21\xFF\x27\x28\x22\xFF\x29\x28\x22" + "\xFF\x28\x2A\x23\xFF\x29\x2C\x24\xFF" + "\x2A\x31\x27\xFF\x2A\x35\x2A\xFF\x2F\x42\x35\xFF\x34\x50\x3E\xFF\x38\x61\x4A\xFF\x3C\x74\x56" + "\xFF\x46\x92\x6D\xFF\x4D\xAF\x82\xFF" + "\x53\xC9\x94\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCE\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCC\x97\xFF\x55\xC8\x94\xFF\x51\xB8\x89\xFF\x48\x9B\x74\xFF\x38\x5E\x48\xFF\x2C\x39\x2D" + "\xFF\x28\x2F\x26\xFF\x27\x2A\x22\xFF" + "\x27\x24\x1F\xFF\x25\x23\x1E\xFF\x25\x23\x1E\xFF\x27\x24\x1F\xFF\x26\x23\x1E\xFF\x26\x24\x1F" + "\xFF\x28\x25\x20\xFF\x26\x26\x20\xFF" + "\x27\x25\x1F\xFF\x26\x25\x1F\xFF\x25\x25\x1F\xFF\x25\x25\x1F\xFF\x26\x24\x1F\xFF\x27\x24\x1F" + "\xFF\x27\x25\x20\xFF\x25\x24\x1E\xFF" + "\x26\x24\x1F\xFF\x25\x24\x1D\xFF\x25\x22\x1C\xFF\x26\x25\x1F\xFF\x27\x25\x20\xFF\x27\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" + "\x29\x27\x22\xFF\x27\x27\x21\xFF\x28\x28\x22\xFF\x2B\x2C\x26\xFF\x29\x2B\x23\xFF\x28\x2C\x25" + "\xFF\x29\x31\x27\xFF\x2B\x36\x2C\xFF" + "\x2D\x3F\x31\xFF\x34\x5A\x46\xFF\x3F\x7D\x5E\xFF\x4A\xA0\x77\xFF\x51\xB8\x88\xFF\x55\xC5\x92" + "\xFF\x56\xCC\x97\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCC\x97\xFF\x57\xCC\x97\xFF\x57\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCC\x97" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCD\x98\xFF\x56\xCD\x97\xFF\x56\xCD\x98\xFF\x56\xCC\x97\xFF\x56\xCA\x96\xFF\x4E\xB2\x85" + "\xFF\x3F\x7D\x5E\xFF\x33\x55\x42\xFF" + "\x25\x22\x1E\xFF\x26\x23\x1E\xFF\x27\x25\x1F\xFF\x28\x25\x20\xFF\x27\x25\x20\xFF\x27\x25\x20" + "\xFF\x27\x25\x1F\xFF\x25\x24\x1D\xFF" + "\x27\x24\x1E\xFF\x27\x24\x1F\xFF\x25\x23\x1D\xFF\x27\x24\x1F\xFF\x25\x25\x1F\xFF\x27\x24\x1F" + "\xFF\x27\x24\x1F\xFF\x27\x24\x1F\xFF" + "\x27\x25\x20\xFF\x29\x26\x21\xFF\x28\x26\x21\xFF\x28\x25\x20\xFF\x25\x24\x1F\xFF\x28\x25\x20" + "\xFF\x28\x25\x20\xFF\x26\x25\x1E\xFF" + "\x27\x24\x1F\xFF\x26\x24\x1F\xFF\x28\x25\x20\xFF\x27\x26\x20\xFF\x26\x25\x20\xFF\x28\x26\x20" + "\xFF\x27\x27\x20\xFF\x27\x29\x21\xFF" + "\x28\x2A\x24\xFF\x28\x2C\x25\xFF\x2A\x31\x29\xFF\x2C\x38\x2D\xFF\x35\x57\x43\xFF\x3E\x74\x59" + "\xFF\x46\x91\x6E\xFF\x4E\xAD\x81\xFF" + "\x55\xC7\x93\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x56\xCC\x97\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF" + "\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x56\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98\xFF\x57\xCD\x98" + "\xFF\x56\xCB\x96\xFF\x51\xB7\x88\xFF"; BYTE TEST_RLE_BITMAP_EXPERIMENTAL_03_RLE[11160] = - "\x30\xF0\x23\x1F\x1E\x1D\x1D\x1E\x1D\x1F\x23\x4A\x78\x71\x64\x58\x4B\xF0\x3E\x30\x29\x26\x24\x22\x21\x20\x20\x20\x1D\x1E\x20\x1E" - "\x1F\x86\x20\x20\x1F\x20\x21\x22\x1E\x1F\xF0\x1E\x1D\x1F\x20\x1F\x1F\x1F\x1E\x1E\x1F\x1F\x20\x1E\x1F\x1F\x50\x1F\x1E\x1D\x1E\x1C" - "\xF0\x38\x1A\x14\x0E\x08\x08\x06\x04\x04\x18\x38\x4A\x66\x74\x82\xF0\x90\x9E\x90\x76\x52\x2C\x16\x12\x0C\x06\x08\x06\x00\x02\x00" - "\xF0\x03\x03\x02\x00\x01\x03\x02\x02\x00\x02\x01\x01\x03\x00\x00\x33\x02\x04\x00\xD0\x02\x00\x00\x03\x01\x02\x00\x02\x01\x00\x04" - "\x02\x06\xF0\x94\xAE\x90\x6E\x46\x2E\x1E\x0C\x0E\x0A\x02\x00\x02\x0C\x18\xF0\x24\x30\x4C\x6C\x94\xBE\xBE\x9A\x6C\x48\x34\x1C\x10" - "\x08\x06\xF0\x06\x06\x00\x01\x03\x01\x02\x00\x02\x00\x02\x02\x08\x04\x02\xF0\x00\x03\x01\x00\x01\x02\x00\x06\x02\x04\x01\x01\x03" - "\x03\x00\x40\x00\x00\x04\x01\xD3\x02\x14\x3C\x68\x8E\x86\x78\x68\x3E\x16\x02\x02\x00\x14\x02\xF0\x1A\x44\x78\x92\x8C\x82\x6E\x52" - "\x2E\x14\x06\x02\x04\x00\x01\xF0\x01\x03\x00\x01\x01\x02\x00\x00\x03\x01\x01\x01\x04\x06\x00\xD0\x02\x00\x02\x00\x02\x02\x02\x00" - "\x00\x04\x00\x03\x02\x04\xAA\x0C\x2C\x54\x6E\x7C\x4C\x02\x00\x02\x00\xF0\x10\x2E\x50\x6C\x82\x92\x86\x50\x1C\x12\x0A\x04\x04\x02" - "\x01\xF0\x02\x02\x01\x05\x07\x00\x00\x01\x02\x03\x05\x03\x00\x01\x05\xA0\x01\x01\x01\x00\x02\x04\x00\x02\x00\x01\xE5\x00\x00\x02" - "\x02\x00\x00\x00\x04\x1A\x14\x00\x00\x01\x00\x35\x01\x01\x00\xF0\x06\x16\x2A\x52\x96\xBC\x84\x50\x28\x0C\x06\x04\x03\x03\x00\xF0" - "\x04\x04\x04\x02\x02\x02\x00\x02\x00\x00\x01\x02\x00\x02\x00\x70\x02\x04\x08\x01\x01\x02\x04\x04\x5C\x02\x02\x00\x02\x00\x14\x01" - "\xF0\x00\x00\x00\x02\x02\x02\x16\x58\x86\x84\x54\x1E\x06\x06\x04\xF0\x00\x03\x01\x00\x02\x02\x01\x02\x01\x04\x02\x01\x00\x02\x01" - "\x80\x02\x02\x01\x07\x03\x01\x01\x00\x04\x53\x01\x00\x00\x00\x01\x16\x00\xF0\x02\x00\x00\x01\x00\x02\x00\x01\x13\x37\x55\x67\x4B" - "\x1D\x03\xF0\x14\x44\x7A\x74\x28\x08\x01\x01\x02\x04\x00\x02\x00\x00\x01\xF0\x02\x01\x05\x00\x01\x04\x02\x00\x00\x00\x01\x00\x00" - "\x03\x03\x41\xF0\x04\x02\x02\x02\x03\x1F\x69\xA9\x9B\x7D\x69\x85\xAD\xA1\x47\xF0\x0B\x14\x5A\x8A\x32\x08\x04\x04\x04\x01\x03\x04" - "\x01\x00\x00\xE0\x02\x00\x04\x00\x07\x01\x00\x03\x03\x00\x02\x00\x00\x00\x04\x53\x02\x00\x00\x00\x02\x17\x00\xF0\x01\x00\x00\x00" - "\x31\x7F\x61\x11\x36\x4E\x58\x46\x16\x29\x79\xF0\x69\x0B\x00\x34\x68\x14\x06\x03\x07\x04\x02\x00\x02\x00\x00\xA3\x00\x06\x00\x00" - "\x00\x01\x01\x00\x06\x02\x10\x01\x71\xF0\x0D\x6F\x2F\x1A\x7A\x84\x78\x70\x7A\x88\x52\x09\x57\x53\x01\xF0\x00\x44\x42\x06\x06\x00" - "\x04\x04\x00\x01\x00\x02\x00\x00\x03\xB0\x04\x02\x04\x04\x00\x05\x00\x00\x00\x02\x02\x41\xF0\x01\x01\x07\x75\x2B\x2A\x86\x54\x1A" - "\x0C\x02\x04\x2A\x7A\x6E\xF0\x04\x5B\x3B\x00\x06\x68\x22\x04\x00\x03\x01\x01\x04\x01\x00\x83\x01\x03\x02\x01\x00\x01\x02\x00\x30" - "\x02\x00\x02\x51\xF0\x02\x21\x2F\x0C\x50\x2A\x02\x03\x29\x61\x73\x59\x1B\x4C\x32\xF0\x15\x3F\x09\x00\x20\x42\x08\x02\x00\x01\x00" - "\x00\x02\x01\x00\xD0\x02\x00\x00\x02\x01\x05\x02\x00\x00\x00\x01\x01\x01\x61\xF0\x1F\x0F\x14\x34\x04\x00\x0D\x55\x61\x55\x67\x4B" - "\x0A\x3C\x00\xF0\x15\x0D\x00\x0C\x3A\x18\x06\x02\x00\x01\x00\x02\x04\x02\x03\xC0\x04\x06\x00\x00\x02\x00\x00\x01\x00\x00\x02\x00" - "\x11\xF0\x01\x01\x01\x00\x00\x21\x0F\x0A\x1A\x00\x01\x0A\x32\x28\x24\xF0\x30\x2E\x06\x2C\x04\x13\x11\x02\x02\x32\x38\x08\x03\x01" - "\x01\xF0\x00\x02\x01\x03\x02\x00\x03\x00\x00\x01\x00\x01\x00\x03\x03\x20\x00\x02\x0E\xF0\x01\x00\x00\x02\x02\x02\x00\x00\x10\x06" - "\x05\x0B\x00\x00\x06\xF0\x4A\x88\x84\x80\x3C\x00\x0B\x03\x02\x02\x00\x00\x12\x30\x10\xF0\x02\x00\x02\x01\x05\x03\x02\x02\x03\x01" - "\x00\x06\x02\x01\x00\x50\x00\x04\x02\x00\x02\x0D\x24\x01\x00\xF0\x02\x00\x00\x1C\x0E\x0F\x1D\x00\x02\x02\x06\x1A\x2E\x16\x02\xF0" - "\x02\x31\x00\x16\x16\x00\x00\x02\x30\x18\x02\x02\x00\x04\x02\xF0\x04\x00\x00\x01\x00\x00\x00\x02\x02\x06\x04\x01\x01\x00\x05\x0C" - "\xF0\x03\x0F\x05\x01\x00\x00\x01\x03\x00\x01\x24\x1E\x15\x57\x15\xF0\x01\x00\x00\x00\x02\x00\x01\x37\x4B\x04\x2A\x12\x00\x00\x00" - "\xF0\x2C\x26\x0A\x00\x02\x07\x03\x05\x02\x00\x02\x00\x00\x03\x01\x70\x01\x00\x00\x02\x04\x01\x06\x33\x00\x01\x00\xF0\x01\x00\x00" - "\x00\x01\x00\x03\x31\x57\x1F\x00\x00\x02\x02\x00\x83\x00\x1C\x56\x02\x3B\x5F\x17\x00\xF0\x05\x33\x65\x19\x2C\x42\x02\x00\x02\x00" - "\x04\x38\x02\x02\x01\xF0\x02\x01\x02\x00\x00\x01\x01\x00\x01\x00\x00\x01\x05\x02\x02\x20\x02\x01\x39\x00\x02\x00\xF0\x06\x12\x3D" - "\x83\x4B\x07\x00\x00\x02\x02\x02\x44\x44\x0B\x57\xF0\x83\x51\x29\x1D\x31\x67\x7D\x35\x08\x6A\x22\x00\x00\x01\x00\xF0\x00\x3A\x0C" - "\x06\x00\x00\x06\x04\x02\x00\x02\x02\x01\x00\x01\x70\x00\x00\x01\x03\x01\x00\x00\x0C\xF0\x02\x2A\x28\x2D\x8B\x9B\x43\x15\x01\x00" - "\x00\x08\x80\x72\x16\xF0\x39\x83\xA9\xB3\xA1\x67\x17\x3A\x8E\x38\x02\x00\x00\x00\x01\xF0\x01\x22\x24\x00\x00\x02\x03\x01\x03\x03" - "\x00\x00\x02\x04\x01\x70\x02\x04\x06\x02\x00\x00\x00\x58\x02\x00\x00\x02\x00\xF0\x08\x3A\x16\x07\x3B\x87\x7D\x45\x11\x00\x00\x0E" - "\x5A\x7C\x64\x94\x3E\x18\x16\x28\x4A\x70\x80\x3C\x00\x83\x02\x01\x2D\x0B\x00\x02\x00\x02\xC0\x04\x02\x00\x00\x06\x00\x03\x01\x01" - "\x02\x00\x02\x24\x02\x00\xF0\x02\x00\x00\x00\x02\x00\x00\x00\x32\x52\x10\x02\x17\x4D\x7F\xF0\x85\x4B\x09\x00\x08\x3A\x6C\x80\x94" - "\x94\x8C\x78\x56\x1A\x02\x13\x00\xF0\x01\x17\x67\x85\x27\x03\x00\x00\x00\x01\x00\x02\x03\x00\x02\x90\x02\x01\x02\x01\x01\x04\x01" - "\x00\x01\x68\x00\x02\x02\x00\x02\x00\xF0\x08\x6A\xB6\x76\x40\x18\x17\x49\x8D\xB1\x6D\x33\x15\x02\x18\xF0\x28\x2A\x20\x12\x04\x01" - "\x00\x00\x01\x09\x1D\x69\xA7\x71\x35\xF0\x07\x03\x01\x01\x04\x02\x00\x02\x00\x01\x00\x03\x01\x00\x02\x50\x04\x01\x00\x00\x00\x77" - "\x02\x02\x00\x02\x00\x02\x00\xF0\x02\x02\x1A\x64\x88\x78\x46\x16\x03\x25\x6F\x93\x83\x67\x3F\xF0\x29\x13\x01\x02\x02\x00\x05\x23" - "\x45\x67\x89\x6D\x1B\x06\x1C\x53\x00\x01\x02\x00\x01\xC0\x00\x03\x01\x00\x00\x01\x02\x02\x01\x02\x02\x01\x07\x28\x02\x00\xF0\x04" - "\x1C\x50\x82\x8E\x5C\x20\x06\x15\x43\x6F\x85\x8D\x91\x8D\xF0\x81\x8B\x93\x95\x8D\x7F\x69\x33\x08\x3E\x86\x80\x08\x02\x01\xF0\x02" - "\x02\x00\x01\x01\x02\x04\x02\x00\x00\x01\x00\x00\x01\x01\x20\x01\x02\x4D\x02\x02\x02\x00\x03\xF0\x18\x3C\x82\xBA\x96\x5E\x34\x12" - "\x19\x27\x3B\x4F\x5F\x4F\x45\xF0\x3F\x25\x02\x30\x5C\xAC\x9C\x50\x09\x06\x02\x02\x02\x03\x00\xE0\x02\x03\x01\x00\x01\x02\x02\x03" - "\x05\x03\x02\x00\x00\x02\x7C\x02\x00\x02\x02\x00\x02\x00\xF0\x02\x00\x02\x00\x08\x42\x7C\x8E\x84\x74\x62\x4C\x34\x22\x2A\xF0\x3C" - "\x4E\x6C\x7E\x88\x7A\x26\x02\x09\x39\x03\x02\x00\x01\x00\xF0\x00\x02\x00\x02\x02\x00\x00\x03\x02\x02\x00\x04\x00\x02\x00\x04\x23" - "\x02\x00\x2E\x02\x00\xF0\x04\x1E\x48\x68\x72\x80\x8C\x98\x90\x86\x7C\x66\x48\x24\x06\xF0\x00\x00\x39\x31\x05\x05\x00\x01\x01\x00" - "\x00\x06\x01\x05\x01\x63\x02\x00\x04\x00\x00\x01\x33\x02\x02\x00\x2F\x02\x00\x05\xF0\x04\x0C\x14\x1E\x28\x22\x1A\x12\x06\x00\x01" - "\x00\x19\x5D\x77\xF0\x1B\x05\x00\x03\x01\x04\x02\x01\x01\x00\x04\x02\x03\x00\x00\x60\x04\x01\x02\x02\x04\x02\x23\x00\x02\x1F\x00" - "\x0F\xF0\x01\x01\x13\x49\x7B\x75\x29\x0B\x03\x00\x01\x00\x00\x03\x01\xD0\x01\x01\x02\x02\x04\x04\x01\x05\x02\x00\x02\x05\x01\x29" - "\x02\x00\x26\x02\x00\x23\x01\x00\x33\x01\x01\x00\xF0\x02\x02\x02\x00\x02\x00\x13\x5D\x8B\x81\x4D\x15\x03\x01\x03\xF0\x01\x02\x06" - "\x00\x02\x00\x04\x01\x03\x03\x03\x05\x00\x00\x01\x40\x01\x00\x00\x01\xF4\x02\x02\x01\x00\x00\x00\x01\x01\x02\x00\x00\x00\x02\x01" - "\x00\xF0\x02\x00\x00\x00\x02\x00\x00\x01\x00\x01\x01\x01\x09\x1B\x29\xF0\x57\x93\xB9\x7D\x45\x1F\x0B\x07\x03\x00\x06\x04\x00\x00" - "\x06\xF0\x02\x04\x00\x01\x00\x02\x00\x06\x02\x06\x04\x01\x00\x06\x00\xF0\x00\x00\x02\x00\x01\x11\x29\x2F\x3F\x3F\x33\x29\x1D\x11" - "\x0B\x26\x03\x00\xF0\x03\x02\x00\x0B\x19\x2B\x3F\x5D\x6F\x81\x95\x83\x4D\x1B\x11\xF0\x07\x03\x01\x03\x03\x01\x00\x00\x02\x00\x05" - "\x03\x00\x00\x06\xB0\x00\x00\x04\x01\x01\x05\x03\x02\x01\x03\x00\xF0\x00\x02\x02\x00\x55\x85\x87\x89\x87\x87\x8B\x8D\x8F\x95\x99" - "\xF0\x93\x85\x77\x65\x55\x59\x5F\x65\x6B\x7D\x91\x93\x91\x89\x85\x73\x7B\x67\x4D\x29\x11\x0D\x00\xF0\x04\x04\x04\x02\x00\x00\x01" - "\x02\x02\x00\x01\x00\x02\x02\x02\x90\x01\x02\x00\x01\x03\x02\x00\x00\x02\xF0\x00\x00\x05\x6D\x77\x4D\x3B\x2F\x29\x27\x29\x31\x3D" - "\x3F\x3F\xF0\x4D\x5F\x6D\x81\x8B\x85\x83\x7B\x75\x6B\x53\x47\x3F\x35\x25\xC3\x15\x0B\x05\x07\x07\x01\x05\x01\x03\x01\x01\x02\x93" - "\x00\x02\x00\x01\x02\x02\x00\x02\x00\x70\x04\x06\x06\x05\x00\x02\x00\xF0\x04\x02\x2D\x47\x13\x05\x01\x05\x01\x00\x03\x07\x07\x05" - "\x09\xF0\x0B\x0D\x09\x07\x0F\x0F\x09\x0D\x0B\x05\x09\x05\x05\x01\x07\xF0\x03\x03\x03\x00\x02\x04\x06\x02\x01\x01\x00\x02\x00\x03" - "\x01\x75\x03\x03\x00\x00\x00\x01\x00\x70\x02\x02\x01\x04\x00\x01\x00\xF0\x00\x01\x33\x1D\x05\x03\x00\x04\x00\x00\x00\x04\x00\x03" - "\x01\xF0\x00\x02\x00\x00\x01\x01\x01\x00\x05\x00\x00\x00\x02\x01\x04\xF0\x02\x00\x02\x00\x00\x05\x05\x00\x04\x02\x03\x01\x05\x01" - "\x00\xF0\x04\x04\x01\x00\x00\x02\x02\x05\x00\x00\x02\x00\x03\x02\x02\x40\x00\x00\x00\x03\xF0\x00\x0B\x1B\x07\x01\x00\x02\x01\x02" - "\x00\x01\x01\x00\x02\x00\xF0\x02\x06\x02\x00\x04\x00\x00\x00\x04\x01\x00\x00\x02\x04\x02\xF0\x04\x02\x00\x04\x01\x01\x02\x01\x02" - "\x01\x01\x01\x00\x02\x00\xF0\x01\x00\x03\x00\x00\x01\x03\x00\x03\x03\x00\x02\x00\x03\x01\x40\x00\x02\x00\x04\xF0\x00\x03\x05\x01" - "\x03\x04\x04\x00\x01\x01\x01\x03\x00\x00\x02\xF0\x00\x01\x01\x00\x01\x00\x03\x03\x02\x01\x01\x00\x01\x01\x01\xF0\x00\x00\x02\x03" - "\x01\x02\x00\x02\x01\x02\x06\x02\x04\x02\x00\xF3\x00\x01\x00\x00\x02\x02\x00\x02\x02\x00\x03\x03\x01\x01\x00\x10\x01\xF0\x02\x03" - "\x03\x00\x01\x03\x05\x00\x02\x00\x02\x02\x02\x04\x01\xF0\x05\x03\x00\x02\x00\x05\x00\x02\x01\x00\x04\x01\x00\x02\x02\x83\x00\x04" - "\x00\x02\x06\x04\x03\x00\xB3\x03\x03\x07\x05\x00\x02\x00\x02\x01\x01\x02\x90\x06\x00\x04\x00\x00\x01\x00\x02\x00\xF0\x02\x0A\x06" - "\x00\x08\x04\x04\x02\x04\x04\x02\x00\x02\x02\x04\xF0\x08\x00\x01\x03\x00\x04\x02\x02\x00\x06\x00\x02\x02\x03\x00\xF0\x00\x05\x01" - "\x03\x01\x03\x01\x03\x00\x02\x01\x00\x01\x02\x02\xF0\x00\x02\x02\x01\x00\x01\x03\x02\x00\x00\x03\x02\x01\x00\x00\x40\x00\x03\x01" - "\x04\xF0\x00\x06\x0C\x02\x01\x03\x00\x02\x05\x01\x00\x04\x05\x03\x03\xB3\x03\x02\x00\x01\x01\x02\x01\x01\x00\x01\x00\xB3\x02\x01" - "\x00\x00\x01\x00\x02\x02\x00\x00\x02\xF0\x04\x06\x02\x03\x00\x01\x01\x00\x04\x05\x01\x00\x01\x00\x00\x60\x02\x02\x00\x04\x00\x03" - "\xF0\x00\x08\x20\x0E\x03\x00\x00\x02\x04\x02\x00\x02\x02\x03\x00\x73\x07\x07\x02\x02\x06\x01\x00\xF0\x03\x01\x01\x00\x00\x02\x02" - "\x04\x06\x04\x00\x04\x04\x02\x05\xF0\x00\x00\x02\x01\x03\x00\x04\x01\x00\x02\x00\x05\x00\x02\x02\x63\x00\x00\x02\x01\x01\x00\xF0" - "\x00\x02\x28\x12\x06\x08\x04\x01\x00\x03\x01\x03\x01\x02\x02\xF0\x08\x02\x05\x01\x01\x02\x02\x00\x01\x01\x04\x02\x01\x00\x03\xF0" - "\x01\x03\x03\x02\x05\x03\x01\x01\x00\x04\x03\x01\x00\x02\x00\xF0\x01\x01\x00\x02\x00\x02\x04\x06\x02\x00\x01\x04\x00\x02\x04\x13" - "\x00\xF0\x02\x00\x24\x12\x04\x00\x01\x00\x00\x06\x00\x03\x02\x00\x00\xF0\x00\x06\x06\x04\x04\x00\x02\x04\x02\x01\x01\x02\x00\x00" - "\x02\xF0\x00\x00\x03\x07\x02\x04\x01\x00\x00\x01\x00\x02\x02\x06\x06\xF0\x00\x05\x01\x00\x02\x02\x00\x03\x01\x03\x00\x05\x03\x01" - "\x00\x40\x00\x03\x00\x02\xF0\x00\x00\x12\x24\x08\x02\x00\x04\x02\x03\x00\x04\x01\x00\x03\xF0\x00\x01\x01\x01\x07\x01\x01\x01\x00" - "\x02\x01\x01\x02\x01\x01\xF0\x02\x02\x04\x06\x02\x00\x02\x02\x00\x00\x06\x02\x01\x01\x00\x63\x04\x04\x02\x04\x02\x01\xA0\x00\x04" - "\x01\x01\x00\x01\x00\x01\x00\x02\xF0\x00\x02\x06\x50\x0A\x02\x01\x07\x01\x02\x04\x00\x04\x04\x00\xF0\x03\x00\x01\x00\x06\x04\x00" - "\x01\x00\x02\x04\x00\x03\x06\x02\xF0\x01\x00\x03\x03\x01\x00\x00\x01\x01\x01\x03\x00\x02\x01\x01\x63\x03\x02\x00\x03\x00\x02\xA0" - "\x00\x04\x06\x02\x02\x01\x04\x04\x00\x05\xF0\x02\x00\x00\x34\x2A\x04\x02\x00\x02\x02\x03\x00\x01\x03\x06\xF0\x06\x02\x02\x00\x03" - "\x03\x02\x06\x02\x01\x00\x00\x01\x00\x00\xF0\x00\x01\x02\x04\x01\x01\x02\x00\x00\x02\x01\x02\x00\x01\x03\xF0\x01\x00\x06\x00\x03" - "\x01\x02\x02\x00\x02\x01\x00\x04\x00\x01\x40\x01\x00\x01\x01\x03\xF0\x08\x54\x14\x10\x10\x10\x0A\x0C\x0C\x08\x0A\x08\x06\x02\x06" - "\xF0\x02\x06\x02\x06\x01\x05\x01\x00\x00\x02\x05\x03\x00\x02\x02\xF0\x00\x06\x04\x00\x00\x00\x01\x00\x03\x00\x03\x00\x02\x00\x03" - "\xF0\x02\x02\x00\x00\x00\x01\x02\x05\x01\x00\x00\x02\x00\x00\x00\x10\x04\x04\xF0\x52\x92\x8E\x88\x78\x72\x6C\x62\x58\x52\x4C\x4C" - "\x48\x38\x30\xF0\x22\x16\x0E\x10\x12\x12\x06\x06\x06\x04\x02\x01\x00\x03\x01\xF0\x03\x05\x05\x01\x01\x00\x06\x02\x00\x02\x06\x00" - "\x00\x00\x03\xF0\x00\x00\x01\x01\x02\x00\x02\x02\x03\x04\x04\x02\x00\x02\x04\x03\xF0\x02\x0A\x40\x52\x5C\x68\x72\x7A\x82\x92\x94" - "\x94\x94\x90\x8E\xF0\x8A\x82\x80\x70\x60\x56\x3E\x30\x1A\x14\x14\x10\x0C\x0A\x0A\xF0\x02\x00\x04\x02\x00\x02\x02\x01\x00\x00\x04" - "\x05\x02\x00\x02\xF0\x02\x01\x00\x00\x02\x00\x01\x02\x00\x02\x01\x00\x01\x02\x02\x10\x00\x39\x00\x01\x00\xF0\x01\x02\x06\x0A\x16" - "\x26\x34\x48\x5A\x68\x72\x7C\x86\x94\xA0\xF0\x9A\x80\x64\x3C\x18\x14\x10\x08\x04\x08\x02\x02\x01\x00\x02\xF0\x01\x01\x02\x02\x02" - "\x01\x00\x00\x02\x00\x01\x01\x03\x02\x01\x70\x04\x00\x03\x00\x01\x01\x01\x04\x5A\x01\x00\x00\x01\x00\xF0\x01\x02\x04\x0C\x10\x1E" - "\x26\x30\x3E\x5A\x7C\xAA\xC2\xA2\x82\xF0\x62\x4A\x2C\x20\x0E\x10\x06\x02\x01\x03\x00\x03\x03\x02\x02\xF0\x02\x03\x01\x01\x01\x02" - "\x01\x01\x01\x02\x04\x04\x01\x05\x00\x33\x00\x02\x00\x24\x01\x00\x29\x02\x00\x53\x02\x00\x00\x00\x02\xF0\x0E\x34\x5E\x84\x90\x8C" - "\x82\x76\x5A\x3C\x1E\x12\x0C\x06\x06\xF0\x02\x00\x00\x00\x02\x00\x00\x02\x02\x00\x06\x03\x03\x01\x05\x30\x02\x08\x00\x03\x3A\x01" - "\x02\x00\x53\x01\x00\x02\x02\x00\x28\x01\x00\xF0\x04\x12\x32\x4E\x66\x7A\x8E\x96\x7A\x44\x16\x0E\x0C\x04\x02\x33\x00\x00\x02\x90" - "\x04\x02\x04\x02\x02\x04\x02\x01\x02\x55\x00\x01\x01\x02\x00\xA8\x01\x01\x01\x00\x00\x01\x00\x01\x01\x00\xF0\x01\x01\x00\x00\x02" - "\x00\x00\x02\x02\x00\x04\x10\x20\x36\x66\xF0\xA4\xB8\x88\x54\x36\x1E\x10\x0A\x04\x01\x00\x01\x05\x09\x05\x60\x01\x01\x05\x03\x02" - "\x01\xF0\x03\x03\x05\x03\x00\x00\x02\x02\x00\x01\x02\x02\x02\x00\x00\x54\x02\x00\x00\x02\x00\x94\x02\x00\x00\x00\x02\x02\x00\x01" - "\x00\xF0\x02\x02\x00\x01\x02\x02\x02\x1E\x58\x8A\x92\x7C\x62\x3C\x1A\xC0\x12\x0A\x06\x02\x02\x06\x02\x01\x00\x00\x01\x01\xF0\x93" - "\x93\x93\x95\x91\x85\x79\x6F\x5D\x4F\x45\x3B\x31\x23\x0F\x8D\x01\x02\x02\x00\x00\x01\x01\x00\x13\x01\xF0\x00\x01\x01\x00\x00\x00" - "\x08\x24\x52\x72\x8C\x98\x68\x30\x0E\x90\x0C\x08\x00\x00\x02\x01\x04\x04\x02\xF0\x4F\x4D\x4D\x4B\x55\x63\x6F\x75\x87\x8D\x95\x9F" - "\xA5\xB1\xC3\xF0\xC3\xA1\x85\x6B\x53\x37\x29\x21\x17\x0B\x01\x00\x00\x00\x01\x49\x01\x02\x01\x00\x14\x01\xF0\x00\x0C\x20\x3A\x78" - "\xAC\x9E\x5E\x2E\x16\x04\x01\x06\x00\x03\x10\x01\xF0\x07\x09\x09\x0D\x07\x07\x07\x0B\x0B\x11\x11\x0D\x17\x17\x19\xF0\x21\x45\x5F" - "\x75\x87\x9B\x99\x8D\x83\x73\x61\x43\x29\x0D\x00\xC6\x00\x00\x02\x00\x00\x00\x02\x02\x00\x00\x02\x00\xF0\x02\x01\x00\x02\x02\x0C" - "\x40\x80\x86\x6C\x44\x22\x12\x04\x02\x10\x04\xF0\x01\x03\x02\x04\x01\x01\x01\x00\x01\x01\x00\x05\x00\x01\x05\xF0\x09\x09\x0B\x11" - "\x11\x15\x25\x39\x4B\x61\x77\x81\x89\x8D\x81\xE4\x53\x2B\x07\x00\x01\x01\x00\x00\x02\x02\x00\x00\x00\x02\x34\x00\x02\x00\x90\x08" - "\x36\x66\x8A\x8A\x40\x16\x0C\x04\xF0\x00\x02\x01\x01\x01\x02\x04\x02\x02\x02\x03\x01\x01\x01\x04\x33\x01\x00\x03\xF0\x05\x07\x09" - "\x09\x11\x25\x2F\x4D\x61\x8B\xAB\xC5\xA3\x71\x3F\x44\x1F\x0B\x01\x00\x66\x01\x01\x00\x00\x01\x00\x80\x02\x06\x1E\x46\x9C\xB0\x70" - "\x40\xF0\x01\x00\x02\x02\x04\x02\x01\x05\x01\x00\x03\x00\x00\x00\x01\xF0\x02\x02\x08\x0A\x02\x01\x02\x02\x01\x05\x03\x03\x0B\x05" - "\x09\xF0\x0D\x15\x19\x41\x69\x93\x89\x71\x51\x2D\x09\x02\x02\x00\x02\x2A\x02\x00\x70\x02\x00\x02\x04\x26\x70\x8C\x34\x2A\x25\x23" - "\xF0\x24\x2B\x60\xA2\x97\x84\x75\x62\x50\x3C\x34\x30\x2C\x29\x28\x93\x26\x25\x25\x23\x23\x25\x24\x24\x25\x84\x26\x27\x25\x24\x25" - "\x25\x27\x24\xC3\x25\x25\x24\x25\x26\x25\x23\x24\x24\x25\x23\x24\x30\x22\x23\x21\xF0\x4E\x24\x1C\x12\x0C\x0A\x08\x06\x08\x26\x4E" - "\x6A\x8E\xA0\xB6\xF0\xCA\xDC\xCA\xA0\x74\x3E\x20\x1A\x12\x08\x08\x08\x02\x02\x02\xF0\x03\x03\x02\x02\x01\x00\x00\x02\x00\x02\x07" - "\x00\x01\x02\x00\xF0\x01\x02\x00\x02\x00\x01\x01\x00\x02\x01\x01\x02\x00\x02\x00\x40\x04\x04\x02\x06\xF0\xD2\xF8\xCC\x9A\x5E\x40" - "\x26\x14\x10\x0C\x02\x00\x04\x10\x20\xF0\x30\x44\x66\x98\xCC\xF7\xF7\xD4\x98\x66\x4A\x2C\x14\x0C\x08\xF0\x0A\x08\x01\x03\x01\x07" - "\x00\x02\x00\x01\x00\x00\x08\x04\x00\xF0\x02\x03\x01\x00\x00\x00\x02\x06\x04\x04\x01\x01\x01\x00\x00\x40\x07\x00\x04\x04\xC4\x02" - "\x16\x52\x92\xC8\xBE\xAC\x8E\x58\x1C\x02\x00\x14\x02\xF0\x22\x60\xA6\xCC\xC2\xB2\x9C\x70\x3E\x1C\x0A\x04\x06\x00\x02\x75\x00\x03" - "\x00\x01\x01\x02\x01\xF0\x04\x02\x00\x02\x00\x01\x01\x02\x02\x02\x03\x03\x06\x00\x03\x10\x03\x04\x8C\x12\x40\x70\x96\xAE\x6C\x02" - "\x00\xF0\x16\x40\x6E\x94\xB4\xD0\xBA\x72\x26\x18\x0C\x08\x04\x00\x03\xF0\x02\x04\x01\x05\x03\x02\x01\x03\x02\x05\x05\x03\x01\x00" - "\x01\xA0\x02\x01\x01\x02\x02\x04\x02\x02\x00\x00\x03\x8D\x02\x01\x00\x00\x0A\x22\x1C\x00\x03\xF0\x0A\x20\x38\x72\xCE\xF7\xBA\x70" - "\x34\x12\x08\x08\x05\x01\x00\xF0\x04\x02\x02\x06\x06\x00\x02\x04\x02\x02\x03\x01\x03\x00\x04\x70\x00\x06\x0A\x03\x01\x02\x04\x04" - "\x5C\x02\x00\x00\x02\x00\x44\x01\x01\x01\x00\xF0\x02\x02\x02\x1E\x78\xBC\xB6\x74\x2E\x0E\x0A\x02\x00\x01\x01\xF0\x00\x01\x00\x00" - "\x00\x01\x02\x02\x00\x02\x04\x02\x00\x00\x01\x50\x07\x01\x01\x00\x00\x04\x23\x01\x00\x47\x01\x00\x01\x00\x23\x01\x00\xF0\x01\x01" - "\x17\x49\x75\x8D\x67\x27\x01\x1A\x60\xAA\xA0\x32\x0E\xF0\x04\x02\x00\x02\x01\x04\x02\x02\x01\x02\x00\x05\x01\x01\x02\x90\x00\x00" - "\x04\x01\x01\x02\x00\x03\x03\x08\x2A\x01\x00\x13\x02\xF0\x05\x2B\x91\xF1\xD9\xB1\x95\xBB\xF1\xE5\x63\x0F\x1C\x7C\xC4\xF0\x48\x0A" - "\x02\x04\x04\x02\x05\x02\x01\x00\x00\x00\x01\x04\x01\xA0\x07\x01\x00\x05\x01\x00\x00\x01\x00\x02\x04\x99\x02\x00\x00\x00\x02\x02" - "\x00\x02\x00\xF0\x01\x00\x43\xB1\x8B\x15\x48\x70\x7C\x62\x20\x35\xA7\x95\x0F\xF0\x00\x46\x8C\x18\x08\x00\x05\x00\x04\x02\x02\x00" - "\x01\x00\x06\xC0\x00\x00\x02\x01\x03\x01\x04\x04\x00\x04\x02\x03\x71\xF0\x13\x9D\x43\x26\xAA\xB8\xA6\x9C\xAA\xBC\x70\x0D\x79\x71" - "\x01\xF0\x02\x60\x5C\x0C\x04\x02\x04\x02\x01\x00\x00\x02\x00\x00\x01\x83\x04\x04\x06\x02\x00\x03\x01\x00\x41\xF0\x01\x00\x09\xA5" - "\x3B\x3C\xBC\x74\x24\x10\x04\x06\x3A\xAA\x94\xF0\x08\x7F\x55\x01\x0A\x96\x2A\x06\x03\x03\x01\x00\x01\x01\x00\xE0\x01\x03\x00\x00" - "\x01\x03\x04\x04\x01\x01\x00\x00\x01\x02\x61\xF0\x2F\x3F\x0E\x6E\x38\x02\x03\x37\x89\x9F\x7F\x25\x6C\x46\x1F\xF0\x55\x09\x00\x26" - "\x5E\x0C\x06\x00\x00\x00\x04\x02\x00\x02\x02\xC0\x00\x02\x04\x00\x05\x02\x02\x04\x02\x00\x00\x01\x41\xF0\x02\x00\x2D\x17\x1E\x48" - "\x06\x00\x15\x79\x8B\x77\x91\x67\x10\xF0\x56\x03\x1F\x17\x00\x10\x50\x22\x06\x04\x02\x03\x01\x04\x04\x93\x02\x03\x04\x04\x01\x01" - "\x02\x01\x00\x20\x02\x00\x21\xF0\x01\x01\x00\x00\x2F\x15\x0E\x26\x00\x01\x12\x46\x3A\x32\x4A\xF0\x40\x0A\x3A\x06\x1B\x17\x00\x04" - "\x46\x4E\x0E\x03\x05\x02\x00\xF0\x00\x03\x01\x04\x00\x03\x02\x04\x00\x00\x01\x03\x05\x01\x00\x10\x02\x11\xF0\x01\x00\x02\x01\x00" - "\x18\x0E\x05\x11\x00\x00\x06\x66\xBE\xB8\xF0\xB2\x52\x00\x0D\x03\x04\x04\x00\x00\x1A\x42\x16\x06\x02\x00\xF0\x00\x05\x01\x00\x02" - "\x01\x00\x03\x02\x02\x01\x02\x00\x04\x00\x20\x00\x02\x11\xF0\x02\x02\x00\x02\x00\x24\x0E\x15\x29\x00\x02\x02\x08\x24\x3E\xF0\x1C" - "\x02\x00\x49\x00\x20\x1C\x00\x00\x02\x44\x20\x04\x04\x00\xF0\x02\x00\x04\x00\x01\x03\x03\x02\x00\x00\x02\x02\x04\x00\x00\x20\x00" - "\x05\x0C\x53\x05\x17\x0B\x01\x00\xF0\x01\x00\x38\x2E\x21\x7B\x1D\x01\x00\x00\x02\x02\x01\x03\x49\xF0\x65\x08\x38\x1A\x00\x00\x00" - "\x3A\x30\x06\x02\x02\x05\x01\x03\xE0\x02\x00\x04\x02\x03\x03\x01\x03\x02\x00\x00\x04\x01\x04\xF0\x01\x01\x00\x01\x01\x01\x00\x01" - "\x01\x00\x01\x00\x03\x45\x77\x24\x2D\x00\x83\x01\x26\x78\x04\x51\x83\x21\x00\xE3\x07\x43\x91\x25\x3C\x5C\x02\x00\x01\x01\x08\x52" - "\x06\x00\xF0\x01\x01\x00\x03\x03\x04\x00\x00\x02\x01\x05\x02\x00\x02\x00\x93\x02\x02\x00\x02\x00\x00\x00\x02\x00\xF0\x08\x18\x59" - "\xB7\x67\x09\x00\x00\x02\x02\x00\x5C\x62\x0F\x79\xF0\xB7\x71\x37\x27\x45\x91\xB1\x49\x0C\x94\x30\x00\x00\x02\x02\xF0\x00\x54\x10" - "\x06\x01\x00\x04\x06\x02\x00\x06\x02\x03\x01\x00\x70\x00\x01\x00\x01\x01\x00\x00\x04\x35\x02\x02\x00\xF0\x02\x3A\x3A\x3B\xC3\xD9" - "\x5D\x1B\x01\x00\x00\x0A\xB0\x9E\x1C\xC4\x4F\xB5\xED\xF9\xDD\x8D\x1D\x4C\xC4\x4C\x02\x00\xF0\x2C\x34\x04\x04\x02\x03\x01\x03\x03" - "\x03\x02\x04\x04\x03\x00\x60\x04\x04\x00\x01\x01\x00\x13\x02\x18\x00\xF0\x0C\x52\x20\x0D\x51\xBB\xAF\x61\x19\x00\x00\x12\x7E\xB0" - "\x8C\x95\x52\x24\x1A\x38\x64\x98\xB6\x54\x00\xF0\x05\x3F\x0F\x03\x03\x02\x02\x00\x02\x04\x04\x02\x01\x02\x06\x70\x02\x03\x00\x01" - "\x04\x04\x02\x0A\xF0\x02\x00\x00\x00\x44\x6E\x18\x04\x21\x6D\xB1\xB9\x69\x0D\x00\xC4\x0A\x4E\x94\xB4\xCC\xCE\xC0\xAA\x78\x24\x02" - "\x00\xF0\x21\x91\xBB\x3B\x05\x04\x00\x00\x01\x02\x00\x01\x00\x02\x02\x80\x00\x00\x01\x01\x04\x01\x01\x00\x68\x02\x02\x02\x00\x02" - "\x00\xF0\x0E\x94\xFC\xA2\x54\x20\x21\x63\xC3\xF5\x95\x49\x1F\x04\x22\xF0\x36\x3A\x2C\x18\x06\x01\x00\x00\x00\x09\x29\x95\xE9\x99" - "\x45\xF0\x09\x03\x01\x00\x02\x00\x00\x02\x00\x01\x00\x05\x03\x00\x04\x50\x06\x01\x00\x00\x02\x78\x02\x00\x02\x00\x00\x02\x00\xF0" - "\x02\x26\x8C\xC2\xA8\x66\x1C\x05\x31\x99\xC9\xB5\x8F\x5B\x39\xF0\x19\x03\x02\x02\x00\x07\x2B\x63\x93\xBB\x97\x25\x06\x24\x04\xF0" - "\x00\x01\x02\x00\x02\x03\x01\x01\x03\x01\x01\x01\x00\x00\x00\x40\x01\x02\x02\x01\x98\x02\x02\x00\x02\x00\x00\x00\x02\x00\xF0\x04" - "\x26\x70\xB2\xC6\x7E\x2A\x02\x1D\x5B\x99\xB7\xC5\xCB\xC7\xF0\xB3\xC3\xCB\xCF\xC7\xB1\x91\x4B\x0A\x56\xBC\xB4\x0A\x00\x01\x64\x01" - "\x02\x00\x00\x01\x02\x70\x01\x00\x01\x01\x00\x00\x00\xAA\x02\x02\x02\x00\x02\x00\x02\x00\x02\x00\xF0\x20\x54\xB6\xFF\xD0\x82\x48" - "\x18\x1F\x33\x4F\x69\x83\x71\x63\xF0\x59\x37\x00\x40\x80\xEE\xDA\x6E\x0D\x08\x00\x00\x00\x03\x01\xE0\x04\x01\x00\x02\x00\x02\x02" - "\x05\x07\x03\x02\x00\x00\x02\x03\x2E\x02\x00\xF0\x02\x00\x02\x00\x0C\x5E\xAA\xC2\xB8\xA0\x86\x68\x48\x32\x3E\xF0\x54\x6E\x98\xB2" - "\xC0\xAA\x36\x02\x0D\x53\x07\x02\x02\x00\x04\x34\x02\x01\x00\x80\x01\x02\x06\x00\x06\x04\x00\x01\x63\x02\x02\x00\x00\x02\x00\x2E" - "\x02\x00\xF0\x06\x2A\x62\x90\x9E\xB0\xC2\xD0\xC8\xBA\xAC\x8E\x64\x30\x08\xF0\x00\x00\x51\x43\x0D\x01\x02\x02\x05\x03\x00\x02\x01" - "\x03\x00\x90\x02\x02\x04\x02\x00\x03\x03\x00\x01\x13\x02\x4F\x00\x02\x02\x00\x05\xF0\x04\x10\x1C\x2A\x36\x30\x24\x18\x06\x00\x01" - "\x00\x21\x81\xA7\xF0\x2D\x03\x01\x03\x07\x06\x06\x01\x00\x02\x02\x00\x01\x03\x02\x60\x02\x00\x02\x01\x02\x04\x9F\x02\x00\x02\x02" - "\x00\x00\x00\x02\x00\x0C\xF0\x01\x01\x1B\x65\xB1\xA5\x39\x0D\x03\x00\x00\x08\x01\x01\x02\xD0\x01\x03\x02\x00\x02\x06\x00\x03\x00" - "\x00\x00\x05\x03\x47\x02\x02\x02\x00\x2B\x02\x00\x33\x01\x01\x00\xF0\x02\x02\x01\x00\x00\x00\x1B\x7F\xC1\xB3\x6D\x1D\x03\x00\x01" - "\xF0\x01\x00\x01\x00\x01\x02\x04\x02\x03\x03\x03\x05\x03\x01\x00\x40\x03\x02\x02\x00\xA6\x00\x02\x00\x00\x02\x00\x01\x01\x02\x00" - "\x26\x02\x00\xF0\x02\x00\x01\x00\x00\x01\x01\x0B\x1F\x3B\x75\xCB\xFA\xB3\x5F\xF0\x2F\x0B\x09\x05\x01\x06\x06\x02\x00\x06\x02\x01" - "\x00\x01\x00\xA0\x02\x00\x04\x04\x04\x02\x00\x00\x04\x00\xF0\x02\x02\x02\x00\x01\x17\x37\x45\x55\x57\x49\x39\x27\x19\x0D\x37\x03" - "\x01\x00\xF0\x01\x0F\x25\x3B\x59\x81\x9D\xB5\xCD\xB9\x6D\x1F\x15\x0D\x05\xF0\x03\x01\x05\x01\x01\x03\x01\x02\x05\x03\x01\x04\x02" - "\x00\x00\x90\x02\x00\x01\x05\x01\x04\x00\x00\x00\xF0\x02\x02\x00\x00\x77\xBD\xBF\xBB\xBD\xB7\xBF\xC3\xC9\xCF\xD3\xF0\xCF\xBB\xA3" - "\x8B\x77\x7D\x85\x8D\x97\xAF\xC7\xCF\xC9\xC1\xBB\xF0\xAD\x8D\x69\x39\x17\x15\x05\x01\x01\x01\x04\x02\x04\x02\x00\xF0\x02\x02\x00" - "\x02\x04\x00\x03\x02\x02\x00\x00\x02\x01\x01\x01\x40\x00\x00\x02\x02\xF0\x02\x00\x09\x99\xAD\x65\x4D\x45\x3B\x39\x3D\x49\x55\x5D" - "\x5F\xF0\x6B\x83\x9B\xB3\xC1\xBD\xB5\xAB\xA3\x91\x73\x61\x57\x4D\x35\xF0\x1B\x15\x0B\x0D\x09\x01\x07\x03\x01\x02\x01\x00\x04\x02" - "\x00\x14\x01\xE0\x04\x00\x02\x01\x04\x00\x01\x04\x06\x04\x05\x03\x03\x00\xF0\x02\x00\x3D\x63\x17\x0B\x07\x07\x00\x03\x03\x07\x09" - "\x07\x0D\xF0\x11\x0F\x0D\x0B\x15\x11\x11\x13\x13\x0D\x0F\x09\x05\x03\x05\xF0\x03\x01\x01\x01\x02\x04\x06\x02\x00\x00\x02\x04\x00" - "\x01\x03\xF0\x03\x01\x02\x00\x00\x03\x00\x00\x02\x00\x02\x01\x00\x02\x00\x40\x06\x04\x02\x01\xF0\x00\x00\x47\x25\x05\x03\x00\x02" - "\x01\x01\x02\x04\x00\x01\x00\xB3\x00\x01\x02\x01\x01\x03\x01\x01\x01\x00\x01\xF0\x04\x02\x01\x00\x04\x00\x03\x07\x01\x02\x01\x03" - "\x03\x07\x03\xF0\x04\x06\x02\x01\x00\x02\x06\x04\x03\x00\x00\x02\x02\x02\x04\x50\x00\x00\x00\x03\x04\xF0\x02\x0D\x27\x0B\x01\x01" - "\x02\x00\x00\x00\x03\x01\x00\x00\x00\xF0\x04\x04\x00\x00\x04\x00\x01\x00\x00\x01\x00\x02\x02\x02\x00\xF0\x00\x02\x01\x02\x03\x01" - "\x04\x00\x00\x02\x01\x01\x00\x02\x02\xF0\x03\x00\x03\x02\x00\x05\x05\x00\x01\x03\x01\x04\x01\x03\x00\x40\x01\x00\x00\x03\xF0\x00" - "\x05\x07\x03\x01\x02\x04\x00\x00\x00\x01\x03\x00\x02\x00\xF0\x00\x02\x03\x01\x01\x00\x01\x03\x00\x02\x02\x00\x01\x00\x00\xF0\x02" - "\x02\x02\x03\x01\x00\x02\x02\x01\x01\x04\x02\x04\x02\x01\xF4\x00\x01\x04\x00\x02\x02\x02\x00\x02\x01\x03\x05\x01\x03\x00\xF0\x02" - "\x05\x03\x01\x03\x00\x03\x02\x00\x00\x02\x02\x06\x02\x01\xF0\x05\x05\x00\x04\x01\x03\x02\x04\x00\x00\x04\x01\x01\x02\x02\xF0\x00" - "\x04\x00\x02\x06\x04\x05\x00\x04\x02\x00\x01\x01\x07\x03\xF0\x00\x04\x00\x02\x03\x01\x04\x00\x04\x04\x06\x02\x02\x02\x01\x40\x02" - "\x00\x02\x01\xF0\x02\x0A\x08\x00\x06\x04\x06\x00\x04\x02\x00\x01\x00\x02\x04\xF0\x06\x00\x00\x03\x02\x02\x02\x00\x04\x02\x03\x00" - "\x04\x03\x00\xF0\x01\x05\x01\x03\x01\x03\x00\x03\x01\x01\x00\x01\x01\x02\x06\xF0\x04\x04\x01\x03\x04\x01\x07\x04\x03\x02\x01\x00" - "\x03\x01\x00\x40\x00\x03\x00\x06\xF0\x00\x0C\x0E\x04\x00\x03\x01\x02\x03\x01\x00\x04\x05\x03\x03\xA5\x01\x04\x01\x01\x03\x04\x00" - "\x00\x03\x00\xF0\x01\x00\x02\x00\x00\x04\x00\x00\x00\x04\x00\x02\x02\x04\x02\xF0\x02\x03\x04\x03\x05\x00\x04\x05\x00\x01\x00\x00" - "\x02\x04\x02\x40\x01\x04\x00\x03\xF0\x00\x0A\x2C\x14\x00\x01\x01\x02\x04\x00\x01\x02\x00\x01\x00\xF0\x09\x05\x02\x00\x06\x01\x01" - "\x01\x00\x01\x03\x01\x01\x02\x04\xF0\x04\x02\x04\x08\x04\x00\x04\x06\x02\x01\x03\x00\x00\x00\x03\xF0\x03\x00\x01\x02\x02\x00\x00" - "\x01\x00\x04\x01\x00\x04\x00\x01\x40\x04\x00\x01\x01\xF0\x02\x02\x3E\x1C\x00\x08\x04\x01\x00\x03\x00\x03\x00\x02\x02\xF0\x08\x00" - "\x05\x01\x00\x00\x01\x02\x01\x01\x04\x02\x01\x03\x07\xF0\x03\x05\x07\x01\x05\x05\x01\x01\x01\x02\x02\x01\x00\x00\x01\xF0\x01\x00" - "\x03\x06\x00\x04\x01\x08\x02\x05\x03\x04\x01\x01\x02\x40\x05\x00\x02\x00\xF0\x00\x00\x30\x16\x0A\x00\x03\x00\x01\x08\x00\x03\x00" - "\x01\x00\x63\x02\x04\x06\x04\x06\x02\xF0\x00\x00\x02\x00\x04\x02\x00\x00\x01\x07\x02\x04\x01\x00\x00\xF0\x03\x02\x02\x04\x06\x06" - "\x02\x05\x00\x03\x02\x00\x02\x03\x00\xA0\x02\x02\x03\x03\x01\x02\x00\x00\x00\x04\xF0\x00\x00\x18\x34\x0A\x04\x02\x04\x02\x01\x00" - "\x04\x02\x00\x05\x93\x01\x00\x01\x00\x0B\x01\x00\x01\x00\xF0\x02\x01\x02\x02\x02\x06\x04\x04\x00\x02\x00\x00\x00\x04\x02\xF0\x01" - "\x01\x00\x04\x06\x04\x04\x02\x01\x02\x00\x01\x01\x04\x01\x70\x02\x02\x03\x02\x03\x01\x00\xF0\x00\x02\x06\x6E\x0C\x02\x00\x03\x02" - "\x00\x04\x04\x00\x04\x02\xF0\x03\x00\x00\x01\x06\x04\x00\x00\x02\x02\x00\x01\x03\x04\x02\xF0\x01\x00\x05\x00\x03\x00\x00\x01\x01" - "\x01\x07\x02\x02\x01\x01\xF0\x03\x00\x00\x03\x02\x02\x01\x00\x00\x00\x02\x04\x00\x00\x00\x40\x02\x02\x00\x03\xF0\x02\x00\x00\x4A" - "\x3C\x0A\x00\x03\x01\x02\x00\x01\x01\x00\x08\xB3\x06\x00\x02\x02\x03\x03\x02\x04\x00\x01\x00\xF0\x03\x00\x01\x02\x02\x01\x01\x02" - "\x00\x00\x04\x00\x00\x01\x00\xA3\x01\x03\x00\x02\x00\x03\x00\x00\x02\x00\x70\x04\x02\x01\x01\x02\x00\x00\x03\xF0\x0A\x76\x1C\x1A" - "\x1A\x14\x12\x0E\x10\x0E\x08\x08\x0A\x08\x08\xF0\x06\x06\x02\x06\x02\x01\x01\x00\x00\x00\x07\x03\x00\x04\x02\xF0\x00\x06\x04\x00" - "\x00\x00\x03\x00\x03\x00\x03\x01\x02\x00\x03\xF0\x02\x00\x00\x01\x00\x01\x02\x07\x01\x01\x00\x02\x00\x01\x01\x10\x02\x04\xF0\x6E" - "\xCC\xC4\xBA\xB0\xA0\x98\x86\x7A\x76\x6A\x68\x62\x50\x40\xF0\x34\x20\x12\x12\x14\x14\x0A\x0A\x08\x08\x04\x00\x04\x04\x01\xF0\x01" - "\x01\x03\x01\x01\x00\x06\x00\x04\x06\x06\x02\x00\x00\x02\xF0\x02\x01\x00\x01\x02\x00\x04\x02\x03\x02\x02\x04\x02\x06\x04\x04\xF0" - "\x10\x56\x72\x80\x8C\x9C\xA8\xB8\xCA\xCE\xD2\xD0\xCA\xC6\xC0\xF0\xB6\xB0\xA2\x8A\x78\x5A\x42\x26\x1C\x18\x14\x10\x08\x06\x04\xF0" - "\x00\x00\x04\x00\x02\x06\x01\x02\x03\x01\x03\x00\x01\x00\x03\xF0\x01\x00\x00\x02\x00\x02\x04\x02\x06\x01\x02\x00\x02\x01\x01\x39" - "\x01\x01\x00\xF0\x01\x02\x08\x0E\x1C\x32\x4A\x62\x7E\x90\x9E\xAC\xBE\xD0\xDE\xF0\xD8\xB8\x8E\x54\x24\x1A\x16\x0A\x08\x08\x06\x06" - "\x00\x00\x02\xF0\x01\x00\x00\x02\x04\x00\x02\x00\x04\x00\x01\x01\x05\x00\x00\x70\x00\x02\x03\x01\x03\x01\x01\x6C\x04\x00\x00\x00" - "\x01\x00\xF0\x01\x01\x02\x06\x10\x1A\x28\x34\x42\x58\x7C\xAC\xEC\xED\xE6\xF0\xB6\x86\x66\x40\x2E\x16\x10\x0C\x04\x02\x03\x00\x01" - "\x05\x04\xF0\x02\x00\x03\x01\x00\x00\x02\x03\x00\x00\x00\x02\x02\x00\x05\x10\x00\x34\x01\x02\x00\x23\x01\x00\x2E\x02\x00\xF0\x02" - "\x02\x02\x0E\x46\x82\xBC\xCA\xC4\xB4\xA0\x80\x52\x28\x16\xF0\x12\x0A\x06\x04\x02\x01\x00\x00\x00\x01\x02\x00\x00\x00\x03\x60\x01" - "\x01\x05\x00\x08\x00\x03\x67\x01\x02\x00\x00\x02\x00\x53\x01\x00\x02\x02\x00\x28\x01\x00\xF0\x04\x18\x44\x6C\x90\xA8\xC4\xD6\xAC" - "\x5C\x1E\x14\x0E\x02\x02\xF0\x00\x00\x02\x02\x02\x04\x04\x06\x02\x00\x04\x08\x02\x00\x04\x03\x25\x02\x00\x25\x01\x00\x34\x01\x01" - "\x00\x26\x02\x00\xF0\x02\x00\x00\x02\x00\x00\x06\x16\x2E\x4A\x8E\xE4\xF9\xC0\x78\xF0\x4E\x28\x16\x0C\x08\x04\x00\x03\x05\x09\x01" - "\x00\x00\x07\x03\x20\x02\x01\x55\x03\x05\x07\x03\x00\x2F\x02\x00\x0D\xF0\x01\x02\x00\x02\x24\x78\xC0\xCA\xB2\x8C\x5A\x26\x14\x10" - "\x08\x90\x04\x02\x02\x00\x01\x01\x00\x03\x00\xF0\xCD\xCF\xCF\xD1\xC9\xB7\xA3\x97\x81\x71\x61\x53\x43\x2F\x13\x5D\x01\x02\x02\x02" - "\x00\x03\x13\x01\xF0\x00\x01\x01\x00\x00\x00\x0A\x32\x72\x9E\xC2\xD4\x92\x3E\x18\x90\x12\x02\x00\x00\x04\x01\x06\x04\x00\xF0\x6F" - "\x6D\x71\x6B\x77\x8B\x9F\xA3\xBB\xC5\xD1\xDD\xE7\xF9\xF0\xC5\xEE\xE3\xB9\x93\x6F\x4B\x3B\x2D\x21\x0F\x03\x00\x29\x01\x00\x14\x01" - "\xF0\x00\x10\x2A\x50\xA6\xF4\xDA\x80\x48\x20\x08\x05\x0C\x00\x03\x10\x01\xF0\x0B\x0B\x09\x11\x0B\x0B\x09\x13\x11\x19\x15\x13\x21" - "\x1F\x23\xF0\x2D\x5F\x83\xA5\xC3\xDF\xD5\xC5\xB5\xA1\x85\x5F\x37\x11\x00\xC6\x00\x00\x02\x00\x00\x00\x02\x02\x00\x00\x02\x00\xF0" - "\x02\x01\x00\x00\x02\x0E\x58\xB6\xBA\x98\x5E\x2A\x12\x08\x04\x10\x02\xF0\x01\x01\x06\x06\x03\x01\x05\x01\x03\x00\x03\x03\x01\x03" - "\x07\xF0\x0B\x07\x11\x13\x17\x1D\x37\x51\x69\x85\xA5\xB5\xC1\xC5\xB1\xE4\x75\x3B\x07\x00\x01\x01\x00\x00\x02\x02\x00\x00\x00\x02" - "\xF0\x00\x02\x00\x00\x02\x00\x00\x08\x4A\x8E\xC0\xC4\x5C\x1E\x12\x10\x0A\xF0\x01\x01\x05\x03\x01\x00\x04\x04\x04\x02\x01\x05\x01" - "\x03\x00\xF0\x03\x05\x01\x07\x03\x05\x07\x0B\x0F\x13\x1B\x33\x47\x6B\x8F\xA4\xC1\xF1\xEC\xE5\x9D\x57\x29\x0F\x01\x00\xF0\x01\x01" - "\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x02\x0A\x2A\x50\x62\xD8\xF2\x9C\x56\xF0\x03\x00\x04\x02\x04\x02\x00\x03\x01\x01\x03\x01" - "\x02\x00\x01\xF0\x00\x02\x04\x08\x00\x01\x02\x02\x02\x05\x05\x05\x0B\x0B\x0B\xF0\x13\x19\x29\x5B\x97\xCF\xC1\xA1\x75\x3F\x0B\x02" - "\x02\x00\x02\x2C\x02\x00\x50\x02\x06\x36\x9C\xC4\x53\x27\x23\x23\x24\x25\xF0\x28\x37\x4A\x47\x41\x3D\x38\x33\x2E\x2A\x28\x27\x26" - "\x27\x27\xF0\x27\x25\x24\x26\x28\x26\x27\x28\x28\x26\x28\x28\x2A\x26\x27\xF0\x27\x28\x27\x27\x25\x26\x24\x25\x27\x28\x27\x28\x27" - "\x27\x25\xB0\x26\x27\x27\x26\x27\x27\x27\x26\x25\x26\x23\xF0\x16\x0C\x0C\x06\x02\x06\x04\x04\x02\x0A\x16\x1E\x2A\x2E\x34\xF0\x3A" - "\x3E\x3C\x30\x20\x12\x0A\x08\x06\x04\x06\x02\x01\x00\x01\xF0\x05\x03\x02\x00\x00\x03\x02\x00\x00\x00\x03\x01\x00\x02\x04\xF0\x02" - "\x04\x00\x01\x01\x03\x00\x00\x00\x03\x00\x01\x00\x02\x00\x40\x00\x04\x02\x08\xF0\x38\x48\x38\x2C\x1E\x10\x0C\x04\x04\x04\x02\x00" - "\x02\x06\x0A\xF0\x0E\x12\x1C\x2C\x3E\x4E\x4C\x3C\x28\x1E\x14\x0C\x04\x02\x02\xF0\x04\x04\x00\x01\x07\x05\x02\x04\x00\x00\x02\x02" - "\x08\x06\x02\xF0\x01\x09\x03\x04\x00\x04\x03\x08\x02\x02\x03\x02\x07\x03\x00\x40\x01\x00\x04\x01\xC4\x02\x06\x16\x28\x3A\x34\x2E" - "\x2A\x16\x06\x01\x00\x13\x02\xF0\x00\x0A\x1C\x32\x3A\x38\x34\x2E\x24\x14\x0C\x01\x03\x00\x04\xF0\x00\x00\x05\x03\x03\x01\x02\x00" - "\x01\x03\x00\x04\x00\x04\x04\xE0\x02\x02\x00\x04\x02\x04\x00\x04\x01\x05\x06\x00\x03\x01\x04\x96\x02\x14\x22\x2A\x34\x20\x02\x02" - "\x00\xF0\x01\x02\x00\x00\x00\x0A\x14\x20\x2A\x32\x3A\x34\x22\x10\x0A\xF0\x00\x04\x00\x02\x02\x04\x04\x03\x09\x05\x01\x01\x03\x02" - "\x05\xF0\x07\x03\x04\x03\x03\x03\x01\x00\x04\x02\x06\x01\x02\x00\x01\xDB\x00\x00\x02\x02\x01\x00\x00\x02\x0A\x08\x00\x01\x00\xF0" - "\x03\x01\x00\x04\x0A\x12\x20\x3C\x4A\x32\x24\x10\x02\x00\x04\xF0\x05\x07\x01\x08\x00\x06\x06\x02\x00\x00\x02\x01\x00\x03\x01\xA0" - "\x00\x02\x02\x01\x08\x0A\x00\x01\x02\x0A\x04\x78\x02\x01\x01\x02\x00\x02\x00\x57\x02\x01\x01\x01\x00\xF0\x02\x0A\x22\x34\x34\x22" - "\x0E\x02\x06\x08\x02\x03\x01\x03\x01\xF3\x04\x00\x00\x02\x04\x01\x00\x00\x04\x03\x03\x04\x03\x07\x03\x04\x23\x01\x00\x28\x01\x00" - "\xF0\x02\x00\x00\x00\x01\x02\x00\x01\x09\x15\x23\x29\x1F\x0B\x00\xF0\x0A\x1C\x32\x2E\x0E\x00\x00\x02\x02\x06\x04\x06\x02\x01\x03" - "\xF0\x01\x02\x01\x00\x01\x04\x02\x04\x02\x01\x03\x02\x02\x01\x01\x05\x3B\x02\x02\x00\xF0\x01\x02\x02\x00\x00\x01\x0B\x27\x43\x43" - "\x33\x29\x33\x45\x41\xE3\x1D\x05\x08\x24\x38\x18\x00\x00\x04\x04\x02\x05\x02\x00\xD0\x01\x04\x00\x07\x01\x00\x07\x00\x01\x00\x01" - "\x00\x00\x04\x7D\x02\x00\x00\x00\x02\x02\x00\xF0\x13\x31\x29\x03\x14\x20\x20\x1A\x0A\x0B\x31\x2B\x05\x01\x14\xF0\x28\x0A\x04\x03" - "\x09\x01\x00\x00\x01\x04\x00\x00\x06\x02\x02\xA0\x01\x00\x03\x01\x04\x06\x01\x00\x00\x03\x71\xF0\x05\x2D\x13\x0A\x30\x3A\x32\x30" - "\x32\x36\x20\x03\x21\x21\x00\xF0\x00\x1C\x1A\x02\x02\x04\x06\x04\x00\x02\x00\x04\x00\x02\x03\xB0\x00\x06\x06\x04\x04\x07\x00\x02" - "\x02\x04\x02\x41\xF0\x01\x00\x01\x2F\x0D\x12\x38\x22\x0C\x04\x00\x02\x10\x2E\x2C\xF0\x02\x23\x17\x00\x02\x2A\x0A\x00\x03\x05\x01" - "\x01\x02\x01\x01\xE0\x01\x05\x00\x00\x01\x03\x02\x01\x02\x03\x02\x02\x01\x04\x61\xF0\x0D\x11\x02\x1E\x10\x00\x01\x0F\x25\x2D\x23" - "\x0B\x20\x10\x07\xF0\x17\x03\x00\x0C\x1C\x04\x04\x00\x01\x01\x00\x02\x00\x00\x00\x93\x02\x02\x02\x05\x05\x04\x02\x06\x01\x41\xF0" - "\x02\x00\x09\x07\x08\x14\x02\x00\x05\x21\x25\x21\x29\x1D\x04\xF0\x1A\x02\x09\x03\x01\x04\x16\x08\x02\x02\x04\x01\x02\x02\x06\xE0" - "\x00\x01\x04\x04\x01\x04\x04\x02\x00\x03\x02\x00\x02\x01\x11\x13\x01\xF0\x00\x0F\x05\x00\x0A\x01\x01\x04\x12\x0A\x0C\x12\x10\x02" - "\x12\xF0\x02\x05\x07\x00\x02\x14\x16\x04\x03\x03\x02\x00\x00\x03\x01\xD0\x04\x01\x01\x04\x00\x03\x05\x05\x01\x03\x05\x00\x04\x31" - "\xF0\x02\x00\x00\x06\x04\x00\x03\x02\x00\x02\x1E\x38\x36\x34\x1A\xF0\x02\x03\x01\x00\x02\x02\x00\x08\x12\x02\x04\x02\x02\x00\x07" - "\xF0\x05\x02\x02\x03\x01\x01\x06\x04\x02\x02\x00\x02\x04\x02\x02\x11\xF0\x02\x02\x00\x00\x01\x0A\x08\x07\x0D\x00\x02\x04\x04\x0C" - "\x12\xF0\x0A\x02\x00\x13\x00\x04\x06\x00\x00\x02\x16\x08\x00\x00\x00\xF0\x02\x04\x04\x00\x01\x00\x00\x02\x00\x00\x00\x06\x06\x00" - "\x01\x20\x00\x07\x0C\x37\x01\x07\x00\xF0\x10\x0C\x03\x23\x09\x01\x01\x00\x02\x02\x00\x00\x15\x1D\x02\xF0\x12\x08\x00\x01\x01\x12" - "\x14\x01\x01\x01\x09\x03\x01\x00\x00\xC0\x02\x01\x03\x05\x03\x00\x00\x01\x02\x06\x01\x06\x06\xF0\x01\x00\x01\x00\x00\x00\x01\x13" - "\x27\x0D\x00\x00\x01\x01\x00\x83\x00\x0A\x22\x01\x11\x25\x09\x00\xF0\x01\x15\x29\x09\x0E\x1E\x02\x00\x02\x02\x02\x16\x04\x02\x00" - "\xF0\x02\x01\x00\x00\x00\x01\x00\x02\x02\x04\x00\x03\x05\x02\x00\x20\x02\x01\x0C\xF0\x02\x06\x1B\x35\x21\x03\x00\x00\x02\x02\x02" - "\x1A\x1E\x07\x21\xC4\x31\x21\x11\x0D\x15\x29\x33\x15\x01\x2A\x0E\x00\xF0\x16\x08\x04\x00\x02\x06\x02\x04\x00\x04\x00\x03\x01\x03" - "\x01\x60\x01\x01\x05\x01\x00\x00\x0C\xF0\x02\x12\x16\x11\x35\x3F\x1B\x07\x01\x00\x00\x04\x32\x30\x06\xB5\x1D\x33\x43\x45\x3F\x29" - "\x07\x18\x40\x18\x00\xF0\x10\x0C\x01\x02\x02\x05\x01\x03\x05\x01\x02\x02\x02\x00\x04\x60\x04\x08\x02\x00\x01\x02\x58\x00\x02\x02" - "\x02\x00\xF0\x04\x14\x08\x01\x15\x33\x33\x1B\x07\x00\x00\x06\x22\x32\x2C\xF0\x16\x0A\x08\x12\x1C\x2C\x30\x16\x00\x01\x01\x00\x01" - "\x00\x01\xF0\x0F\x07\x00\x01\x00\x04\x04\x00\x06\x04\x02\x02\x02\x06\x01\x60\x03\x01\x00\x04\x02\x01\x24\x02\x00\x26\x02\x00\xF0" - "\x14\x22\x06\x02\x09\x21\x31\x35\x1D\x03\x00\x04\x18\x2C\x36\x84\x3C\x3A\x3C\x32\x22\x0E\x02\x00\xF0\x09\x2B\x39\x0B\x02\x04\x00" - "\x00\x03\x01\x01\x05\x00\x00\x04\x80\x01\x04\x00\x01\x00\x01\x01\x02\x04\x28\x02\x00\xF0\x04\x2A\x4A\x2E\x1A\x10\x07\x19\x37\x47" - "\x2B\x15\x07\x00\x0A\xF0\x10\x12\x08\x06\x02\x01\x00\x01\x00\x03\x0B\x2D\x45\x2B\x17\xF0\x03\x05\x05\x01\x04\x02\x04\x04\x00\x03" - "\x02\x05\x01\x01\x02\x50\x04\x02\x00\x02\x02\x0E\xF0\x02\x00\x0A\x28\x34\x2E\x1A\x04\x05\x0F\x2D\x37\x33\x29\x1B\xF0\x11\x09\x01" - "\x02\x02\x00\x01\x0D\x1B\x29\x37\x29\x07\x02\x0E\x33\x02\x01\x00\xE0\x01\x01\x00\x03\x00\x01\x01\x05\x02\x02\x01\x02\x02\x03\x3E" - "\x02\x02\x00\xF0\x02\x0E\x20\x32\x38\x28\x10\x06\x09\x1B\x2D\x33\x39\x39\x37\xF0\x33\x37\x39\x3D\x37\x33\x2B\x15\x02\x18\x36\x34" - "\x00\x00\x02\xF0\x02\x02\x01\x03\x01\x04\x04\x00\x00\x02\x00\x02\x00\x01\x00\x20\x03\x01\x44\x00\x00\x02\x00\x25\x02\x00\x23\x02" - "\x00\xF0\x0A\x1C\x34\x46\x3A\x26\x16\x0A\x0D\x0F\x19\x21\x27\x21\x19\xF0\x17\x0F\x02\x18\x28\x46\x3E\x20\x03\x06\x00\x00\x04\x05" - "\x00\xE0\x04\x01\x05\x00\x03\x04\x00\x03\x05\x05\x02\x01\x01\x04\x03\x4C\x02\x00\x02\x00\xF0\x02\x02\x00\x00\x06\x1A\x30\x36\x34" - "\x32\x2A\x20\x16\x10\x12\xF0\x18\x20\x2C\x32\x34\x2E\x12\x02\x01\x19\x01\x06\x02\x03\x00\xF0\x00\x01\x05\x04\x02\x02\x01\x01\x06" - "\x02\x00\x02\x00\x04\x02\x2F\x02\x00\x08\xF0\x02\x0E\x1C\x2A\x2C\x34\x3A\x3C\x38\x34\x30\x28\x1C\x10\x04\xF0\x00\x00\x17\x11\x07" - "\x03\x02\x01\x02\x00\x02\x0A\x00\x03\x01\x90\x04\x02\x04\x02\x02\x00\x00\x00\x01\x3F\x00\x02\x00\x09\xF0\x02\x02\x06\x08\x0A\x10" - "\x0E\x08\x06\x02\x00\x01\x00\x0B\x27\xF0\x31\x09\x03\x03\x07\x01\x02\x04\x03\x01\x01\x04\x04\x05\x01\x70\x00\x00\x01\x00\x00\x04" - "\x01\x9F\x00\x00\x02\x00\x02\x00\x00\x02\x00\x09\x23\x02\x00\xF0\x07\x1D\x31\x2D\x11\x05\x02\x02\x00\x00\x03\x01\x02\x00\x01\xB0" - "\x01\x00\x04\x04\x01\x03\x00\x02\x00\x07\x00\x29\x02\x00\x2B\x02\x00\x33\x01\x01\x00\xF0\x02\x02\x02\x00\x02\x02\x07\x25\x39\x33" - "\x21\x07\x04\x00\x03\xF0\x00\x02\x04\x04\x00\x02\x04\x02\x01\x03\x05\x03\x01\x00\x01\x40\x03\x02\x04\x02\x93\x00\x02\x00\x02\x00" - "\x01\x01\x01\x00\xA4\x01\x01\x01\x00\x01\x01\x00\x00\x01\x00\xF0\x01\x02\x01\x01\x01\x05\x0D\x11\x21\x3B\x49\x2F\x17\x0B\x00\xF0" - "\x01\x01\x02\x06\x02\x00\x02\x06\x02\x02\x00\x00\x02\x00\x04\x80\x02\x06\x06\x06\x01\x00\x04\x03\xF0\x00\x00\x01\x01\x00\x03\x0F" - "\x13\x1B\x1B\x15\x0F\x09\x07\x01\x24\x01\x00\xF0\x01\x00\x01\x02\x00\x03\x0F\x0F\x19\x25\x29\x33\x3B\x37\x1D\xF0\x09\x07\x01\x00" - "\x00\x03\x03\x01\x00\x02\x00\x01\x05\x05\x01\xD0\x00\x02\x00\x00\x02\x00\x01\x05\x03\x02\x01\x03\x02\xF0\x02\x00\x02\x00\x21\x35" - "\x33\x33\x35\x35\x39\x39\x37\x3B\x41\xF0\x3B\x33\x2B\x27\x23\x23\x25\x27\x29\x33\x3B\x3B\x39\x35\x33\xF0\x31\x27\x1F\x0D\x03\x07" - "\x02\x00\x01\x01\x04\x04\x02\x02\x00\xF0\x03\x00\x02\x00\x00\x03\x01\x02\x00\x00\x03\x00\x01\x03\x01\x40\x04\x01\x02\x02\xF0\x01" - "\x01\x01\x2B\x31\x23\x1D\x17\x11\x0B\x0B\x13\x1B\x19\x13\xF0\x1B\x29\x31\x37\x37\x35\x35\x33\x2F\x29\x1B\x19\x15\x17\x11\x83\x05" - "\x03\x01\x05\x03\x00\x03\x01\xF0\x02\x04\x02\x02\x00\x01\x00\x00\x04\x08\x01\x02\x00\x02\x04\x80\x02\x02\x06\x02\x05\x01\x03\x01" - "\xF0\x00\x02\x13\x1B\x09\x01\x00\x00\x02\x02\x00\x03\x03\x00\x05\xE3\x09\x01\x02\x02\x05\x03\x00\x03\x05\x01\x07\x05\x01\x03\xF0" - "\x01\x00\x02\x02\x04\x02\x00\x00\x01\x04\x00\x03\x03\x01\x00\xF0\x00\x00\x01\x03\x04\x00\x00\x00\x01\x01\x02\x04\x00\x02\x02\x20" - "\x00\x00\xF0\x04\x00\x11\x0D\x00\x00\x02\x04\x00\x03\x01\x06\x02\x05\x01\x13\x02\xF0\x01\x01\x00\x02\x00\x02\x02\x04\x00\x00\x08" - "\x04\x00\x04\x02\xF0\x03\x03\x05\x00\x02\x00\x03\x03\x05\x05\x04\x02\x02\x01\x00\xF0\x02\x00\x00\x09\x02\x00\x04\x00\x03\x02\x00" - "\x01\x00\x00\x00\xF0\x01\x03\x0B\x00\x01\x00\x04\x01\x02\x01\x01\x05\x02\x06\x02\xF0\x04\x04\x02\x01\x08\x02\x03\x01\x02\x01\x00" - "\x00\x04\x06\x01\xF0\x00\x02\x00\x02\x00\x03\x02\x01\x02\x00\x03\x05\x00\x04\x02\xF0\x02\x00\x03\x01\x00\x00\x01\x00\x05\x01\x01" - "\x02\x02\x01\x04\x40\x04\x02\x00\x02\xF0\x02\x00\x03\x00\x01\x04\x04\x00\x01\x00\x02\x02\x01\x01\x00\xF0\x03\x00\x05\x01\x03\x00" - "\x01\x03\x00\x00\x01\x01\x01\x00\x00\xF0\x02\x00\x00\x01\x01\x04\x02\x02\x01\x02\x06\x04\x04\x02\x01\xF0\x01\x00\x02\x04\x00\x02" - "\x00\x04\x02\x01\x01\x03\x01\x03\x03\x40\x00\x02\x00\x05\xF0\x00\x01\x00\x01\x00\x00\x05\x01\x02\x00\x03\x00\x06\x04\x00\xF0\x03" - "\x03\x02\x02\x01\x07\x00\x04\x00\x03\x04\x00\x03\x02\x02\xF0\x01\x04\x02\x02\x04\x04\x03\x00\x00\x00\x04\x01\x03\x05\x07\xF0\x00" - "\x01\x02\x01\x01\x01\x04\x02\x04\x04\x06\x00\x04\x00\x03\x40\x01\x00\x04\x00\x83\x02\x04\x02\x00\x08\x04\x06\x04\xF0\x00\x02\x04" - "\x04\x0A\x00\x01\x01\x00\x04\x02\x00\x02\x06\x03\xF0\x00\x04\x05\x01\x02\x05\x03\x05\x00\x01\x03\x01\x01\x00\x05\xF0\x01\x05\x02" - "\x08\x02\x06\x00\x00\x02\x01\x05\x04\x00\x00\x03\x80\x06\x03\x00\x02\x00\x05\x03\x04\xF0\x00\x04\x04\x01\x03\x07\x03\x00\x07\x01" - "\x00\x02\x09\x05\x03\xF0\x03\x04\x00\x01\x00\x04\x00\x00\x01\x00\x04\x02\x00\x01\x02\xF0\x01\x01\x00\x00\x00\x02\x04\x01\x02\x02" - "\x04\x00\x04\x02\x02\xF0\x00\x03\x02\x01\x01\x00\x02\x05\x01\x00\x01\x01\x00\x04\x04\x40\x02\x04\x00\x01\xF0\x00\x02\x10\x0A\x01" - "\x02\x02\x04\x06\x02\x02\x00\x02\x03\x00\x64\x07\x0B\x00\x00\x04\x00\xF0\x03\x01\x00\x02\x04\x04\x02\x06\x08\x06\x00\x04\x06\x04" - "\x01\xF0\x02\x04\x02\x00\x05\x02\x04\x00\x00\x02\x01\x03\x01\x02\x04\x90\x00\x03\x04\x00\x03\x02\x00\x02\x02\xF0\x01\x00\x10\x04" - "\x00\x06\x04\x01\x03\x03\x01\x00\x01\x00\x00\xF0\x08\x00\x05\x01\x03\x01\x00\x01\x05\x05\x04\x02\x01\x01\x05\xF0\x03\x05\x05\x00" - "\x05\x07\x01\x00\x03\x02\x03\x01\x02\x02\x02\xF0\x01\x01\x05\x04\x00\x04\x02\x08\x02\x03\x03\x08\x00\x01\x04\x40\x03\x02\x02\x01" - "\xF0\x00\x00\x0C\x08\x04\x00\x03\x01\x02\x08\x01\x03\x02\x02\x02\xF0\x00\x06\x08\x06\x06\x01\x02\x06\x04\x02\x01\x02\x00\x02\x02" - "\xF0\x00\x02\x01\x07\x00\x08\x03\x01\x02\x03\x00\x00\x02\x06\x06\xF0\x01\x05\x01\x03\x02\x02\x04\x05\x03\x01\x02\x05\x07\x01\x00" - "\x40\x00\x01\x00\x04\xF0\x02\x00\x08\x0E\x04\x02\x02\x04\x04\x05\x00\x02\x00\x00\x05\xF0\x00\x01\x05\x03\x07\x02\x00\x01\x00\x02" - "\x01\x01\x00\x00\x01\xF0\x00\x02\x02\x04\x02\x00\x04\x02\x00\x00\x06\x04\x03\x01\x00\xF0\x06\x06\x08\x02\x02\x01\x03\x01\x00\x01" - "\x02\x03\x02\x00\x00\x40\x00\x03\x03\x02\xF0\x02\x02\x04\x22\x00\x03\x01\x03\x01\x04\x06\x04\x02\x06\x00\xF0\x03\x00\x00\x02\x08" - "\x00\x01\x01\x00\x02\x04\x01\x03\x06\x04\xF0\x00\x02\x01\x01\x01\x05\x00\x01\x03\x00\x05\x00\x02\x03\x03\xF0\x03\x00\x01\x00\x01" - "\x00\x00\x04\x00\x02\x08\x08\x02\x00\x03\x40\x04\x02\x02\x03\x03\xF0\x16\x12\x02\x03\x05\x02\x00\x03\x03\x00\x03\x04\x02\x02\x04" - "\xF0\x02\x05\x01\x02\x04\x02\x01\x00\x02\x01\x00\x03\x01\x01\x00\xF0\x04\x00\x02\x04\x01\x00\x00\x00\x02\x02\x03\x03\x01\x00\x02" - "\xF0\x01\x03\x01\x04\x02\x01\x02\x03\x00\x04\x04\x01\x03\x00\x03\x10\x01\xF0\x00\x00\x01\x02\x22\x06\x08\x08\x04\x02\x04\x06\x02" - "\x00\x02\xF0\x02\x02\x00\x01\x06\x02\x06\x01\x05\x01\x00\x00\x02\x09\x01\xF0\x00\x00\x02\x00\x04\x04\x01\x02\x01\x01\x00\x03\x01" - "\x03\x01\xF0\x00\x03\x03\x04\x02\x02\x01\x03\x02\x02\x05\x01\x01\x00\x04\x40\x02\x02\x02\x00\xF0\x01\x00\x00\x00\x22\x3C\x3C\x38" - "\x30\x2E\x2C\x26\x1E\x24\x20\xF0\x1E\x20\x16\x12\x0C\x08\x04\x06\x0A\x0A\x00\x00\x02\x04\x00\xF0\x02\x04\x02\x05\x03\x01\x07\x03" - "\x00\x02\x06\x00\x02\x08\x08\xF0\x02\x04\x00\x03\x02\x00\x00\x02\x00\x01\x00\x02\x01\x02\x02\x40\x00\x01\x02\x06\xF0\x02\x00\x02" - "\x02\x06\x1C\x20\x26\x2A\x2E\x30\x34\x40\x3A\x3A\xF0\x3C\x38\x3A\x38\x32\x34\x2A\x24\x24\x16\x10\x08\x0A\x0A\x08\xF0\x06\x04\x02" - "\x04\x00\x02\x08\x02\x02\x02\x01\x02\x00\x01\x05\xF0\x01\x00\x02\x02\x05\x01\x01\x02\x02\x02\x06\x00\x04\x03\x00\x40\x00\x04\x04" - "\x01\x66\x01\x01\x00\x00\x01\x00\xF0\x01\x02\x04\x06\x08\x10\x14\x1E\x24\x2A\x2E\x30\x36\x40\x42\xF0\x3C\x30\x26\x14\x08\x0A\x06" - "\x00\x03\x00\x02\x04\x01\x00\x02\xF0\x01\x01\x02\x04\x00\x00\x05\x02\x04\x00\x01\x01\x05\x02\x00\x70\x02\x00\x01\x00\x01\x05\x01" - "\x31\xF0\x01\x02\x02\x06\x08\x0C\x0E\x12\x1C\x2A\x32\x46\x50\x3C\x30\xF0\x28\x22\x0E\x0A\x02\x04\x01\x03\x05\x03\x00\x00\x01\x02" - "\x06\xF0\x02\x03\x01\x03\x03\x00\x03\x01\x03\x02\x04\x04\x03\x07\x00\x33\x02\x02\x00\x33\x01\x01\x00\x2E\x02\x00\xF0\x01\x02\x00" - "\x02\x16\x2A\x38\x38\x3A\x34\x30\x28\x1A\x0A\x08\xF0\x08\x02\x02\x00\x01\x02\x01\x02\x02\x00\x02\x02\x00\x02\x01\x60\x05\x03\x07" - "\x04\x0C\x00\x04\x2A\x02\x00\x53\x01\x00\x02\x02\x00\x46\x01\x00\x02\x00\xF0\x02\x08\x14\x22\x28\x2E\x38\x3E\x32\x1C\x08\x02\x04" - "\x01\x03\xF0\x02\x01\x00\x04\x06\x06\x04\x06\x04\x04\x04\x08\x02\x00\x04\x06\x74\x02\x02\x00\x00\x01\x01\x00\x37\x01\x01\x00\x23" - "\x01\x00\xF0\x02\x00\x00\x02\x02\x00\x04\x08\x0E\x18\x2A\x44\x4E\x3A\x20\xF0\x16\x0C\x06\x02\x00\x03\x01\x03\x05\x0B\x07\x00\x00" - "\x0B\x03\x20\x00\x01\x64\x01\x03\x03\x01\x02\x00\x3B\x02\x02\x00\x5B\x02\x00\x00\x02\x00\xF0\x01\x00\x02\x00\x0A\x22\x3A\x3C\x34" - "\x2A\x1A\x0A\x08\x08\x02\x90\x00\x00\x08\x02\x01\x02\x00\x00\x03\xF0\x39\x39\x3B\x3D\x3D\x37\x2F\x2D\x25\x1F\x1B\x19\x15\x0D\x07" - "\x23\x01\x02\x1F\x00\x13\x01\xF0\x00\x01\x01\x02\x01\x00\x04\x10\x20\x2A\x38\x40\x2C\x0C\x02\x90\x02\x02\x03\x03\x00\x01\x06\x01" - "\x04\xF0\x1D\x1D\x21\x19\x21\x27\x31\x2F\x39\x39\x3F\x41\x3D\x45\x4D\xC5\x4D\x43\x35\x2B\x21\x17\x11\x0D\x09\x05\x01\x00\x29\x01" - "\x00\xF0\x03\x00\x01\x01\x01\x00\x06\x0E\x16\x2E\x46\x42\x2C\x18\x10\x60\x02\x05\x0A\x05\x01\x03\xF0\x07\x07\x03\x0B\x01\x01\x00" - "\x05\x01\x0B\x01\x02\x0D\x0D\x0B\xF0\x09\x1B\x25\x2F\x37\x3F\x39\x37\x33\x2F\x25\x19\x11\x05\x01\xC6\x00\x00\x02\x00\x00\x00\x02" - "\x02\x00\x00\x02\x00\xF0\x02\x01\x01\x00\x02\x06\x1A\x32\x34\x26\x1C\x12\x06\x04\x02\x10\x04\xF0\x02\x02\x08\x08\x03\x01\x01\x02" - "\x00\x02\x02\x00\x04\x04\x02\xF0\x07\x01\x03\x07\x09\x07\x0F\x17\x1D\x23\x31\x35\x33\x37\x33\xE4\x21\x13\x07\x00\x01\x01\x00\x00" - "\x02\x02\x00\x00\x00\x02\xF0\x00\x02\x02\x02\x00\x00\x00\x02\x14\x28\x38\x36\x1A\x08\x02\x10\x00\xF0\x00\x01\x05\x01\x02\x02\x06" - "\x00\x02\x02\x07\x09\x03\x01\x00\xF0\x01\x00\x03\x00\x00\x00\x03\x01\x03\x01\x05\x0D\x11\x1D\x27\xF0\x39\x43\x4B\x45\x2D\x17\x0B" - "\x03\x01\x00\x00\x02\x02\x00\x01\x84\x01\x00\x00\x01\x00\x00\x01\x00\x70\x02\x0A\x1C\x3C\x44\x2E\x18\xF0\x03\x02\x04\x02\x02\x02" - "\x01\x01\x00\x02\x00\x04\x01\x00\x00\xF0\x04\x02\x08\x06\x04\x03\x02\x02\x01\x03\x01\x00\x07\x05\x00\xF0\x03\x07\x09\x17\x29\x3B" - "\x37\x2D\x1F\x11\x03\x00\x00\x00\x02\x24\x02\x00\x23\x02\x00\x80\x02\x02\x00\x02\x02\x12\x2E\x3C"; + "\x30\xF0\x23\x1F\x1E\x1D\x1D\x1E\x1D\x1F\x23\x4A\x78\x71\x64\x58\x4B\xF0\x3E\x30\x29\x26\x24" + "\x22\x21\x20\x20\x20\x1D\x1E\x20\x1E" + "\x1F\x86\x20\x20\x1F\x20\x21\x22\x1E\x1F\xF0\x1E\x1D\x1F\x20\x1F\x1F\x1F\x1E\x1E\x1F\x1F\x20" + "\x1E\x1F\x1F\x50\x1F\x1E\x1D\x1E\x1C" + "\xF0\x38\x1A\x14\x0E\x08\x08\x06\x04\x04\x18\x38\x4A\x66\x74\x82\xF0\x90\x9E\x90\x76\x52\x2C" + "\x16\x12\x0C\x06\x08\x06\x00\x02\x00" + "\xF0\x03\x03\x02\x00\x01\x03\x02\x02\x00\x02\x01\x01\x03\x00\x00\x33\x02\x04\x00\xD0\x02\x00" + "\x00\x03\x01\x02\x00\x02\x01\x00\x04" + "\x02\x06\xF0\x94\xAE\x90\x6E\x46\x2E\x1E\x0C\x0E\x0A\x02\x00\x02\x0C\x18\xF0\x24\x30\x4C\x6C" + "\x94\xBE\xBE\x9A\x6C\x48\x34\x1C\x10" + "\x08\x06\xF0\x06\x06\x00\x01\x03\x01\x02\x00\x02\x00\x02\x02\x08\x04\x02\xF0\x00\x03\x01\x00" + "\x01\x02\x00\x06\x02\x04\x01\x01\x03" + "\x03\x00\x40\x00\x00\x04\x01\xD3\x02\x14\x3C\x68\x8E\x86\x78\x68\x3E\x16\x02\x02\x00\x14\x02" + "\xF0\x1A\x44\x78\x92\x8C\x82\x6E\x52" + "\x2E\x14\x06\x02\x04\x00\x01\xF0\x01\x03\x00\x01\x01\x02\x00\x00\x03\x01\x01\x01\x04\x06\x00" + "\xD0\x02\x00\x02\x00\x02\x02\x02\x00" + "\x00\x04\x00\x03\x02\x04\xAA\x0C\x2C\x54\x6E\x7C\x4C\x02\x00\x02\x00\xF0\x10\x2E\x50\x6C\x82" + "\x92\x86\x50\x1C\x12\x0A\x04\x04\x02" + "\x01\xF0\x02\x02\x01\x05\x07\x00\x00\x01\x02\x03\x05\x03\x00\x01\x05\xA0\x01\x01\x01\x00\x02" + "\x04\x00\x02\x00\x01\xE5\x00\x00\x02" + "\x02\x00\x00\x00\x04\x1A\x14\x00\x00\x01\x00\x35\x01\x01\x00\xF0\x06\x16\x2A\x52\x96\xBC\x84" + "\x50\x28\x0C\x06\x04\x03\x03\x00\xF0" + "\x04\x04\x04\x02\x02\x02\x00\x02\x00\x00\x01\x02\x00\x02\x00\x70\x02\x04\x08\x01\x01\x02\x04" + "\x04\x5C\x02\x02\x00\x02\x00\x14\x01" + "\xF0\x00\x00\x00\x02\x02\x02\x16\x58\x86\x84\x54\x1E\x06\x06\x04\xF0\x00\x03\x01\x00\x02\x02" + "\x01\x02\x01\x04\x02\x01\x00\x02\x01" + "\x80\x02\x02\x01\x07\x03\x01\x01\x00\x04\x53\x01\x00\x00\x00\x01\x16\x00\xF0\x02\x00\x00\x01" + "\x00\x02\x00\x01\x13\x37\x55\x67\x4B" + "\x1D\x03\xF0\x14\x44\x7A\x74\x28\x08\x01\x01\x02\x04\x00\x02\x00\x00\x01\xF0\x02\x01\x05\x00" + "\x01\x04\x02\x00\x00\x00\x01\x00\x00" + "\x03\x03\x41\xF0\x04\x02\x02\x02\x03\x1F\x69\xA9\x9B\x7D\x69\x85\xAD\xA1\x47\xF0\x0B\x14\x5A" + "\x8A\x32\x08\x04\x04\x04\x01\x03\x04" + "\x01\x00\x00\xE0\x02\x00\x04\x00\x07\x01\x00\x03\x03\x00\x02\x00\x00\x00\x04\x53\x02\x00\x00" + "\x00\x02\x17\x00\xF0\x01\x00\x00\x00" + "\x31\x7F\x61\x11\x36\x4E\x58\x46\x16\x29\x79\xF0\x69\x0B\x00\x34\x68\x14\x06\x03\x07\x04\x02" + "\x00\x02\x00\x00\xA3\x00\x06\x00\x00" + "\x00\x01\x01\x00\x06\x02\x10\x01\x71\xF0\x0D\x6F\x2F\x1A\x7A\x84\x78\x70\x7A\x88\x52\x09\x57" + "\x53\x01\xF0\x00\x44\x42\x06\x06\x00" + "\x04\x04\x00\x01\x00\x02\x00\x00\x03\xB0\x04\x02\x04\x04\x00\x05\x00\x00\x00\x02\x02\x41\xF0" + "\x01\x01\x07\x75\x2B\x2A\x86\x54\x1A" + "\x0C\x02\x04\x2A\x7A\x6E\xF0\x04\x5B\x3B\x00\x06\x68\x22\x04\x00\x03\x01\x01\x04\x01\x00\x83" + "\x01\x03\x02\x01\x00\x01\x02\x00\x30" + "\x02\x00\x02\x51\xF0\x02\x21\x2F\x0C\x50\x2A\x02\x03\x29\x61\x73\x59\x1B\x4C\x32\xF0\x15\x3F" + "\x09\x00\x20\x42\x08\x02\x00\x01\x00" + "\x00\x02\x01\x00\xD0\x02\x00\x00\x02\x01\x05\x02\x00\x00\x00\x01\x01\x01\x61\xF0\x1F\x0F\x14" + "\x34\x04\x00\x0D\x55\x61\x55\x67\x4B" + "\x0A\x3C\x00\xF0\x15\x0D\x00\x0C\x3A\x18\x06\x02\x00\x01\x00\x02\x04\x02\x03\xC0\x04\x06\x00" + "\x00\x02\x00\x00\x01\x00\x00\x02\x00" + "\x11\xF0\x01\x01\x01\x00\x00\x21\x0F\x0A\x1A\x00\x01\x0A\x32\x28\x24\xF0\x30\x2E\x06\x2C\x04" + "\x13\x11\x02\x02\x32\x38\x08\x03\x01" + "\x01\xF0\x00\x02\x01\x03\x02\x00\x03\x00\x00\x01\x00\x01\x00\x03\x03\x20\x00\x02\x0E\xF0\x01" + "\x00\x00\x02\x02\x02\x00\x00\x10\x06" + "\x05\x0B\x00\x00\x06\xF0\x4A\x88\x84\x80\x3C\x00\x0B\x03\x02\x02\x00\x00\x12\x30\x10\xF0\x02" + "\x00\x02\x01\x05\x03\x02\x02\x03\x01" + "\x00\x06\x02\x01\x00\x50\x00\x04\x02\x00\x02\x0D\x24\x01\x00\xF0\x02\x00\x00\x1C\x0E\x0F\x1D" + "\x00\x02\x02\x06\x1A\x2E\x16\x02\xF0" + "\x02\x31\x00\x16\x16\x00\x00\x02\x30\x18\x02\x02\x00\x04\x02\xF0\x04\x00\x00\x01\x00\x00\x00" + "\x02\x02\x06\x04\x01\x01\x00\x05\x0C" + "\xF0\x03\x0F\x05\x01\x00\x00\x01\x03\x00\x01\x24\x1E\x15\x57\x15\xF0\x01\x00\x00\x00\x02\x00" + "\x01\x37\x4B\x04\x2A\x12\x00\x00\x00" + "\xF0\x2C\x26\x0A\x00\x02\x07\x03\x05\x02\x00\x02\x00\x00\x03\x01\x70\x01\x00\x00\x02\x04\x01" + "\x06\x33\x00\x01\x00\xF0\x01\x00\x00" + "\x00\x01\x00\x03\x31\x57\x1F\x00\x00\x02\x02\x00\x83\x00\x1C\x56\x02\x3B\x5F\x17\x00\xF0\x05" + "\x33\x65\x19\x2C\x42\x02\x00\x02\x00" + "\x04\x38\x02\x02\x01\xF0\x02\x01\x02\x00\x00\x01\x01\x00\x01\x00\x00\x01\x05\x02\x02\x20\x02" + "\x01\x39\x00\x02\x00\xF0\x06\x12\x3D" + "\x83\x4B\x07\x00\x00\x02\x02\x02\x44\x44\x0B\x57\xF0\x83\x51\x29\x1D\x31\x67\x7D\x35\x08\x6A" + "\x22\x00\x00\x01\x00\xF0\x00\x3A\x0C" + "\x06\x00\x00\x06\x04\x02\x00\x02\x02\x01\x00\x01\x70\x00\x00\x01\x03\x01\x00\x00\x0C\xF0\x02" + "\x2A\x28\x2D\x8B\x9B\x43\x15\x01\x00" + "\x00\x08\x80\x72\x16\xF0\x39\x83\xA9\xB3\xA1\x67\x17\x3A\x8E\x38\x02\x00\x00\x00\x01\xF0\x01" + "\x22\x24\x00\x00\x02\x03\x01\x03\x03" + "\x00\x00\x02\x04\x01\x70\x02\x04\x06\x02\x00\x00\x00\x58\x02\x00\x00\x02\x00\xF0\x08\x3A\x16" + "\x07\x3B\x87\x7D\x45\x11\x00\x00\x0E" + "\x5A\x7C\x64\x94\x3E\x18\x16\x28\x4A\x70\x80\x3C\x00\x83\x02\x01\x2D\x0B\x00\x02\x00\x02\xC0" + "\x04\x02\x00\x00\x06\x00\x03\x01\x01" + "\x02\x00\x02\x24\x02\x00\xF0\x02\x00\x00\x00\x02\x00\x00\x00\x32\x52\x10\x02\x17\x4D\x7F\xF0" + "\x85\x4B\x09\x00\x08\x3A\x6C\x80\x94" + "\x94\x8C\x78\x56\x1A\x02\x13\x00\xF0\x01\x17\x67\x85\x27\x03\x00\x00\x00\x01\x00\x02\x03\x00" + "\x02\x90\x02\x01\x02\x01\x01\x04\x01" + "\x00\x01\x68\x00\x02\x02\x00\x02\x00\xF0\x08\x6A\xB6\x76\x40\x18\x17\x49\x8D\xB1\x6D\x33\x15" + "\x02\x18\xF0\x28\x2A\x20\x12\x04\x01" + "\x00\x00\x01\x09\x1D\x69\xA7\x71\x35\xF0\x07\x03\x01\x01\x04\x02\x00\x02\x00\x01\x00\x03\x01" + "\x00\x02\x50\x04\x01\x00\x00\x00\x77" + "\x02\x02\x00\x02\x00\x02\x00\xF0\x02\x02\x1A\x64\x88\x78\x46\x16\x03\x25\x6F\x93\x83\x67\x3F" + "\xF0\x29\x13\x01\x02\x02\x00\x05\x23" + "\x45\x67\x89\x6D\x1B\x06\x1C\x53\x00\x01\x02\x00\x01\xC0\x00\x03\x01\x00\x00\x01\x02\x02\x01" + "\x02\x02\x01\x07\x28\x02\x00\xF0\x04" + "\x1C\x50\x82\x8E\x5C\x20\x06\x15\x43\x6F\x85\x8D\x91\x8D\xF0\x81\x8B\x93\x95\x8D\x7F\x69\x33" + "\x08\x3E\x86\x80\x08\x02\x01\xF0\x02" + "\x02\x00\x01\x01\x02\x04\x02\x00\x00\x01\x00\x00\x01\x01\x20\x01\x02\x4D\x02\x02\x02\x00\x03" + "\xF0\x18\x3C\x82\xBA\x96\x5E\x34\x12" + "\x19\x27\x3B\x4F\x5F\x4F\x45\xF0\x3F\x25\x02\x30\x5C\xAC\x9C\x50\x09\x06\x02\x02\x02\x03\x00" + "\xE0\x02\x03\x01\x00\x01\x02\x02\x03" + "\x05\x03\x02\x00\x00\x02\x7C\x02\x00\x02\x02\x00\x02\x00\xF0\x02\x00\x02\x00\x08\x42\x7C\x8E" + "\x84\x74\x62\x4C\x34\x22\x2A\xF0\x3C" + "\x4E\x6C\x7E\x88\x7A\x26\x02\x09\x39\x03\x02\x00\x01\x00\xF0\x00\x02\x00\x02\x02\x00\x00\x03" + "\x02\x02\x00\x04\x00\x02\x00\x04\x23" + "\x02\x00\x2E\x02\x00\xF0\x04\x1E\x48\x68\x72\x80\x8C\x98\x90\x86\x7C\x66\x48\x24\x06\xF0\x00" + "\x00\x39\x31\x05\x05\x00\x01\x01\x00" + "\x00\x06\x01\x05\x01\x63\x02\x00\x04\x00\x00\x01\x33\x02\x02\x00\x2F\x02\x00\x05\xF0\x04\x0C" + "\x14\x1E\x28\x22\x1A\x12\x06\x00\x01" + "\x00\x19\x5D\x77\xF0\x1B\x05\x00\x03\x01\x04\x02\x01\x01\x00\x04\x02\x03\x00\x00\x60\x04\x01" + "\x02\x02\x04\x02\x23\x00\x02\x1F\x00" + "\x0F\xF0\x01\x01\x13\x49\x7B\x75\x29\x0B\x03\x00\x01\x00\x00\x03\x01\xD0\x01\x01\x02\x02\x04" + "\x04\x01\x05\x02\x00\x02\x05\x01\x29" + "\x02\x00\x26\x02\x00\x23\x01\x00\x33\x01\x01\x00\xF0\x02\x02\x02\x00\x02\x00\x13\x5D\x8B\x81" + "\x4D\x15\x03\x01\x03\xF0\x01\x02\x06" + "\x00\x02\x00\x04\x01\x03\x03\x03\x05\x00\x00\x01\x40\x01\x00\x00\x01\xF4\x02\x02\x01\x00\x00" + "\x00\x01\x01\x02\x00\x00\x00\x02\x01" + "\x00\xF0\x02\x00\x00\x00\x02\x00\x00\x01\x00\x01\x01\x01\x09\x1B\x29\xF0\x57\x93\xB9\x7D\x45" + "\x1F\x0B\x07\x03\x00\x06\x04\x00\x00" + "\x06\xF0\x02\x04\x00\x01\x00\x02\x00\x06\x02\x06\x04\x01\x00\x06\x00\xF0\x00\x00\x02\x00\x01" + "\x11\x29\x2F\x3F\x3F\x33\x29\x1D\x11" + "\x0B\x26\x03\x00\xF0\x03\x02\x00\x0B\x19\x2B\x3F\x5D\x6F\x81\x95\x83\x4D\x1B\x11\xF0\x07\x03" + "\x01\x03\x03\x01\x00\x00\x02\x00\x05" + "\x03\x00\x00\x06\xB0\x00\x00\x04\x01\x01\x05\x03\x02\x01\x03\x00\xF0\x00\x02\x02\x00\x55\x85" + "\x87\x89\x87\x87\x8B\x8D\x8F\x95\x99" + "\xF0\x93\x85\x77\x65\x55\x59\x5F\x65\x6B\x7D\x91\x93\x91\x89\x85\x73\x7B\x67\x4D\x29\x11\x0D" + "\x00\xF0\x04\x04\x04\x02\x00\x00\x01" + "\x02\x02\x00\x01\x00\x02\x02\x02\x90\x01\x02\x00\x01\x03\x02\x00\x00\x02\xF0\x00\x00\x05\x6D" + "\x77\x4D\x3B\x2F\x29\x27\x29\x31\x3D" + "\x3F\x3F\xF0\x4D\x5F\x6D\x81\x8B\x85\x83\x7B\x75\x6B\x53\x47\x3F\x35\x25\xC3\x15\x0B\x05\x07" + "\x07\x01\x05\x01\x03\x01\x01\x02\x93" + "\x00\x02\x00\x01\x02\x02\x00\x02\x00\x70\x04\x06\x06\x05\x00\x02\x00\xF0\x04\x02\x2D\x47\x13" + "\x05\x01\x05\x01\x00\x03\x07\x07\x05" + "\x09\xF0\x0B\x0D\x09\x07\x0F\x0F\x09\x0D\x0B\x05\x09\x05\x05\x01\x07\xF0\x03\x03\x03\x00\x02" + "\x04\x06\x02\x01\x01\x00\x02\x00\x03" + "\x01\x75\x03\x03\x00\x00\x00\x01\x00\x70\x02\x02\x01\x04\x00\x01\x00\xF0\x00\x01\x33\x1D\x05" + "\x03\x00\x04\x00\x00\x00\x04\x00\x03" + "\x01\xF0\x00\x02\x00\x00\x01\x01\x01\x00\x05\x00\x00\x00\x02\x01\x04\xF0\x02\x00\x02\x00\x00" + "\x05\x05\x00\x04\x02\x03\x01\x05\x01" + "\x00\xF0\x04\x04\x01\x00\x00\x02\x02\x05\x00\x00\x02\x00\x03\x02\x02\x40\x00\x00\x00\x03\xF0" + "\x00\x0B\x1B\x07\x01\x00\x02\x01\x02" + "\x00\x01\x01\x00\x02\x00\xF0\x02\x06\x02\x00\x04\x00\x00\x00\x04\x01\x00\x00\x02\x04\x02\xF0" + "\x04\x02\x00\x04\x01\x01\x02\x01\x02" + "\x01\x01\x01\x00\x02\x00\xF0\x01\x00\x03\x00\x00\x01\x03\x00\x03\x03\x00\x02\x00\x03\x01\x40" + "\x00\x02\x00\x04\xF0\x00\x03\x05\x01" + "\x03\x04\x04\x00\x01\x01\x01\x03\x00\x00\x02\xF0\x00\x01\x01\x00\x01\x00\x03\x03\x02\x01\x01" + "\x00\x01\x01\x01\xF0\x00\x00\x02\x03" + "\x01\x02\x00\x02\x01\x02\x06\x02\x04\x02\x00\xF3\x00\x01\x00\x00\x02\x02\x00\x02\x02\x00\x03" + "\x03\x01\x01\x00\x10\x01\xF0\x02\x03" + "\x03\x00\x01\x03\x05\x00\x02\x00\x02\x02\x02\x04\x01\xF0\x05\x03\x00\x02\x00\x05\x00\x02\x01" + "\x00\x04\x01\x00\x02\x02\x83\x00\x04" + "\x00\x02\x06\x04\x03\x00\xB3\x03\x03\x07\x05\x00\x02\x00\x02\x01\x01\x02\x90\x06\x00\x04\x00" + "\x00\x01\x00\x02\x00\xF0\x02\x0A\x06" + "\x00\x08\x04\x04\x02\x04\x04\x02\x00\x02\x02\x04\xF0\x08\x00\x01\x03\x00\x04\x02\x02\x00\x06" + "\x00\x02\x02\x03\x00\xF0\x00\x05\x01" + "\x03\x01\x03\x01\x03\x00\x02\x01\x00\x01\x02\x02\xF0\x00\x02\x02\x01\x00\x01\x03\x02\x00\x00" + "\x03\x02\x01\x00\x00\x40\x00\x03\x01" + "\x04\xF0\x00\x06\x0C\x02\x01\x03\x00\x02\x05\x01\x00\x04\x05\x03\x03\xB3\x03\x02\x00\x01\x01" + "\x02\x01\x01\x00\x01\x00\xB3\x02\x01" + "\x00\x00\x01\x00\x02\x02\x00\x00\x02\xF0\x04\x06\x02\x03\x00\x01\x01\x00\x04\x05\x01\x00\x01" + "\x00\x00\x60\x02\x02\x00\x04\x00\x03" + "\xF0\x00\x08\x20\x0E\x03\x00\x00\x02\x04\x02\x00\x02\x02\x03\x00\x73\x07\x07\x02\x02\x06\x01" + "\x00\xF0\x03\x01\x01\x00\x00\x02\x02" + "\x04\x06\x04\x00\x04\x04\x02\x05\xF0\x00\x00\x02\x01\x03\x00\x04\x01\x00\x02\x00\x05\x00\x02" + "\x02\x63\x00\x00\x02\x01\x01\x00\xF0" + "\x00\x02\x28\x12\x06\x08\x04\x01\x00\x03\x01\x03\x01\x02\x02\xF0\x08\x02\x05\x01\x01\x02\x02" + "\x00\x01\x01\x04\x02\x01\x00\x03\xF0" + "\x01\x03\x03\x02\x05\x03\x01\x01\x00\x04\x03\x01\x00\x02\x00\xF0\x01\x01\x00\x02\x00\x02\x04" + "\x06\x02\x00\x01\x04\x00\x02\x04\x13" + "\x00\xF0\x02\x00\x24\x12\x04\x00\x01\x00\x00\x06\x00\x03\x02\x00\x00\xF0\x00\x06\x06\x04\x04" + "\x00\x02\x04\x02\x01\x01\x02\x00\x00" + "\x02\xF0\x00\x00\x03\x07\x02\x04\x01\x00\x00\x01\x00\x02\x02\x06\x06\xF0\x00\x05\x01\x00\x02" + "\x02\x00\x03\x01\x03\x00\x05\x03\x01" + "\x00\x40\x00\x03\x00\x02\xF0\x00\x00\x12\x24\x08\x02\x00\x04\x02\x03\x00\x04\x01\x00\x03\xF0" + "\x00\x01\x01\x01\x07\x01\x01\x01\x00" + "\x02\x01\x01\x02\x01\x01\xF0\x02\x02\x04\x06\x02\x00\x02\x02\x00\x00\x06\x02\x01\x01\x00\x63" + "\x04\x04\x02\x04\x02\x01\xA0\x00\x04" + "\x01\x01\x00\x01\x00\x01\x00\x02\xF0\x00\x02\x06\x50\x0A\x02\x01\x07\x01\x02\x04\x00\x04\x04" + "\x00\xF0\x03\x00\x01\x00\x06\x04\x00" + "\x01\x00\x02\x04\x00\x03\x06\x02\xF0\x01\x00\x03\x03\x01\x00\x00\x01\x01\x01\x03\x00\x02\x01" + "\x01\x63\x03\x02\x00\x03\x00\x02\xA0" + "\x00\x04\x06\x02\x02\x01\x04\x04\x00\x05\xF0\x02\x00\x00\x34\x2A\x04\x02\x00\x02\x02\x03\x00" + "\x01\x03\x06\xF0\x06\x02\x02\x00\x03" + "\x03\x02\x06\x02\x01\x00\x00\x01\x00\x00\xF0\x00\x01\x02\x04\x01\x01\x02\x00\x00\x02\x01\x02" + "\x00\x01\x03\xF0\x01\x00\x06\x00\x03" + "\x01\x02\x02\x00\x02\x01\x00\x04\x00\x01\x40\x01\x00\x01\x01\x03\xF0\x08\x54\x14\x10\x10\x10" + "\x0A\x0C\x0C\x08\x0A\x08\x06\x02\x06" + "\xF0\x02\x06\x02\x06\x01\x05\x01\x00\x00\x02\x05\x03\x00\x02\x02\xF0\x00\x06\x04\x00\x00\x00" + "\x01\x00\x03\x00\x03\x00\x02\x00\x03" + "\xF0\x02\x02\x00\x00\x00\x01\x02\x05\x01\x00\x00\x02\x00\x00\x00\x10\x04\x04\xF0\x52\x92\x8E" + "\x88\x78\x72\x6C\x62\x58\x52\x4C\x4C" + "\x48\x38\x30\xF0\x22\x16\x0E\x10\x12\x12\x06\x06\x06\x04\x02\x01\x00\x03\x01\xF0\x03\x05\x05" + "\x01\x01\x00\x06\x02\x00\x02\x06\x00" + "\x00\x00\x03\xF0\x00\x00\x01\x01\x02\x00\x02\x02\x03\x04\x04\x02\x00\x02\x04\x03\xF0\x02\x0A" + "\x40\x52\x5C\x68\x72\x7A\x82\x92\x94" + "\x94\x94\x90\x8E\xF0\x8A\x82\x80\x70\x60\x56\x3E\x30\x1A\x14\x14\x10\x0C\x0A\x0A\xF0\x02\x00" + "\x04\x02\x00\x02\x02\x01\x00\x00\x04" + "\x05\x02\x00\x02\xF0\x02\x01\x00\x00\x02\x00\x01\x02\x00\x02\x01\x00\x01\x02\x02\x10\x00\x39" + "\x00\x01\x00\xF0\x01\x02\x06\x0A\x16" + "\x26\x34\x48\x5A\x68\x72\x7C\x86\x94\xA0\xF0\x9A\x80\x64\x3C\x18\x14\x10\x08\x04\x08\x02\x02" + "\x01\x00\x02\xF0\x01\x01\x02\x02\x02" + "\x01\x00\x00\x02\x00\x01\x01\x03\x02\x01\x70\x04\x00\x03\x00\x01\x01\x01\x04\x5A\x01\x00\x00" + "\x01\x00\xF0\x01\x02\x04\x0C\x10\x1E" + "\x26\x30\x3E\x5A\x7C\xAA\xC2\xA2\x82\xF0\x62\x4A\x2C\x20\x0E\x10\x06\x02\x01\x03\x00\x03\x03" + "\x02\x02\xF0\x02\x03\x01\x01\x01\x02" + "\x01\x01\x01\x02\x04\x04\x01\x05\x00\x33\x00\x02\x00\x24\x01\x00\x29\x02\x00\x53\x02\x00\x00" + "\x00\x02\xF0\x0E\x34\x5E\x84\x90\x8C" + "\x82\x76\x5A\x3C\x1E\x12\x0C\x06\x06\xF0\x02\x00\x00\x00\x02\x00\x00\x02\x02\x00\x06\x03\x03" + "\x01\x05\x30\x02\x08\x00\x03\x3A\x01" + "\x02\x00\x53\x01\x00\x02\x02\x00\x28\x01\x00\xF0\x04\x12\x32\x4E\x66\x7A\x8E\x96\x7A\x44\x16" + "\x0E\x0C\x04\x02\x33\x00\x00\x02\x90" + "\x04\x02\x04\x02\x02\x04\x02\x01\x02\x55\x00\x01\x01\x02\x00\xA8\x01\x01\x01\x00\x00\x01\x00" + "\x01\x01\x00\xF0\x01\x01\x00\x00\x02" + "\x00\x00\x02\x02\x00\x04\x10\x20\x36\x66\xF0\xA4\xB8\x88\x54\x36\x1E\x10\x0A\x04\x01\x00\x01" + "\x05\x09\x05\x60\x01\x01\x05\x03\x02" + "\x01\xF0\x03\x03\x05\x03\x00\x00\x02\x02\x00\x01\x02\x02\x02\x00\x00\x54\x02\x00\x00\x02\x00" + "\x94\x02\x00\x00\x00\x02\x02\x00\x01" + "\x00\xF0\x02\x02\x00\x01\x02\x02\x02\x1E\x58\x8A\x92\x7C\x62\x3C\x1A\xC0\x12\x0A\x06\x02\x02" + "\x06\x02\x01\x00\x00\x01\x01\xF0\x93" + "\x93\x93\x95\x91\x85\x79\x6F\x5D\x4F\x45\x3B\x31\x23\x0F\x8D\x01\x02\x02\x00\x00\x01\x01\x00" + "\x13\x01\xF0\x00\x01\x01\x00\x00\x00" + "\x08\x24\x52\x72\x8C\x98\x68\x30\x0E\x90\x0C\x08\x00\x00\x02\x01\x04\x04\x02\xF0\x4F\x4D\x4D" + "\x4B\x55\x63\x6F\x75\x87\x8D\x95\x9F" + "\xA5\xB1\xC3\xF0\xC3\xA1\x85\x6B\x53\x37\x29\x21\x17\x0B\x01\x00\x00\x00\x01\x49\x01\x02\x01" + "\x00\x14\x01\xF0\x00\x0C\x20\x3A\x78" + "\xAC\x9E\x5E\x2E\x16\x04\x01\x06\x00\x03\x10\x01\xF0\x07\x09\x09\x0D\x07\x07\x07\x0B\x0B\x11" + "\x11\x0D\x17\x17\x19\xF0\x21\x45\x5F" + "\x75\x87\x9B\x99\x8D\x83\x73\x61\x43\x29\x0D\x00\xC6\x00\x00\x02\x00\x00\x00\x02\x02\x00\x00" + "\x02\x00\xF0\x02\x01\x00\x02\x02\x0C" + "\x40\x80\x86\x6C\x44\x22\x12\x04\x02\x10\x04\xF0\x01\x03\x02\x04\x01\x01\x01\x00\x01\x01\x00" + "\x05\x00\x01\x05\xF0\x09\x09\x0B\x11" + "\x11\x15\x25\x39\x4B\x61\x77\x81\x89\x8D\x81\xE4\x53\x2B\x07\x00\x01\x01\x00\x00\x02\x02\x00" + "\x00\x00\x02\x34\x00\x02\x00\x90\x08" + "\x36\x66\x8A\x8A\x40\x16\x0C\x04\xF0\x00\x02\x01\x01\x01\x02\x04\x02\x02\x02\x03\x01\x01\x01" + "\x04\x33\x01\x00\x03\xF0\x05\x07\x09" + "\x09\x11\x25\x2F\x4D\x61\x8B\xAB\xC5\xA3\x71\x3F\x44\x1F\x0B\x01\x00\x66\x01\x01\x00\x00\x01" + "\x00\x80\x02\x06\x1E\x46\x9C\xB0\x70" + "\x40\xF0\x01\x00\x02\x02\x04\x02\x01\x05\x01\x00\x03\x00\x00\x00\x01\xF0\x02\x02\x08\x0A\x02" + "\x01\x02\x02\x01\x05\x03\x03\x0B\x05" + "\x09\xF0\x0D\x15\x19\x41\x69\x93\x89\x71\x51\x2D\x09\x02\x02\x00\x02\x2A\x02\x00\x70\x02\x00" + "\x02\x04\x26\x70\x8C\x34\x2A\x25\x23" + "\xF0\x24\x2B\x60\xA2\x97\x84\x75\x62\x50\x3C\x34\x30\x2C\x29\x28\x93\x26\x25\x25\x23\x23\x25" + "\x24\x24\x25\x84\x26\x27\x25\x24\x25" + "\x25\x27\x24\xC3\x25\x25\x24\x25\x26\x25\x23\x24\x24\x25\x23\x24\x30\x22\x23\x21\xF0\x4E\x24" + "\x1C\x12\x0C\x0A\x08\x06\x08\x26\x4E" + "\x6A\x8E\xA0\xB6\xF0\xCA\xDC\xCA\xA0\x74\x3E\x20\x1A\x12\x08\x08\x08\x02\x02\x02\xF0\x03\x03" + "\x02\x02\x01\x00\x00\x02\x00\x02\x07" + "\x00\x01\x02\x00\xF0\x01\x02\x00\x02\x00\x01\x01\x00\x02\x01\x01\x02\x00\x02\x00\x40\x04\x04" + "\x02\x06\xF0\xD2\xF8\xCC\x9A\x5E\x40" + "\x26\x14\x10\x0C\x02\x00\x04\x10\x20\xF0\x30\x44\x66\x98\xCC\xF7\xF7\xD4\x98\x66\x4A\x2C\x14" + "\x0C\x08\xF0\x0A\x08\x01\x03\x01\x07" + "\x00\x02\x00\x01\x00\x00\x08\x04\x00\xF0\x02\x03\x01\x00\x00\x00\x02\x06\x04\x04\x01\x01\x01" + "\x00\x00\x40\x07\x00\x04\x04\xC4\x02" + "\x16\x52\x92\xC8\xBE\xAC\x8E\x58\x1C\x02\x00\x14\x02\xF0\x22\x60\xA6\xCC\xC2\xB2\x9C\x70\x3E" + "\x1C\x0A\x04\x06\x00\x02\x75\x00\x03" + "\x00\x01\x01\x02\x01\xF0\x04\x02\x00\x02\x00\x01\x01\x02\x02\x02\x03\x03\x06\x00\x03\x10\x03" + "\x04\x8C\x12\x40\x70\x96\xAE\x6C\x02" + "\x00\xF0\x16\x40\x6E\x94\xB4\xD0\xBA\x72\x26\x18\x0C\x08\x04\x00\x03\xF0\x02\x04\x01\x05\x03" + "\x02\x01\x03\x02\x05\x05\x03\x01\x00" + "\x01\xA0\x02\x01\x01\x02\x02\x04\x02\x02\x00\x00\x03\x8D\x02\x01\x00\x00\x0A\x22\x1C\x00\x03" + "\xF0\x0A\x20\x38\x72\xCE\xF7\xBA\x70" + "\x34\x12\x08\x08\x05\x01\x00\xF0\x04\x02\x02\x06\x06\x00\x02\x04\x02\x02\x03\x01\x03\x00\x04" + "\x70\x00\x06\x0A\x03\x01\x02\x04\x04" + "\x5C\x02\x00\x00\x02\x00\x44\x01\x01\x01\x00\xF0\x02\x02\x02\x1E\x78\xBC\xB6\x74\x2E\x0E\x0A" + "\x02\x00\x01\x01\xF0\x00\x01\x00\x00" + "\x00\x01\x02\x02\x00\x02\x04\x02\x00\x00\x01\x50\x07\x01\x01\x00\x00\x04\x23\x01\x00\x47\x01" + "\x00\x01\x00\x23\x01\x00\xF0\x01\x01" + "\x17\x49\x75\x8D\x67\x27\x01\x1A\x60\xAA\xA0\x32\x0E\xF0\x04\x02\x00\x02\x01\x04\x02\x02\x01" + "\x02\x00\x05\x01\x01\x02\x90\x00\x00" + "\x04\x01\x01\x02\x00\x03\x03\x08\x2A\x01\x00\x13\x02\xF0\x05\x2B\x91\xF1\xD9\xB1\x95\xBB\xF1" + "\xE5\x63\x0F\x1C\x7C\xC4\xF0\x48\x0A" + "\x02\x04\x04\x02\x05\x02\x01\x00\x00\x00\x01\x04\x01\xA0\x07\x01\x00\x05\x01\x00\x00\x01\x00" + "\x02\x04\x99\x02\x00\x00\x00\x02\x02" + "\x00\x02\x00\xF0\x01\x00\x43\xB1\x8B\x15\x48\x70\x7C\x62\x20\x35\xA7\x95\x0F\xF0\x00\x46\x8C" + "\x18\x08\x00\x05\x00\x04\x02\x02\x00" + "\x01\x00\x06\xC0\x00\x00\x02\x01\x03\x01\x04\x04\x00\x04\x02\x03\x71\xF0\x13\x9D\x43\x26\xAA" + "\xB8\xA6\x9C\xAA\xBC\x70\x0D\x79\x71" + "\x01\xF0\x02\x60\x5C\x0C\x04\x02\x04\x02\x01\x00\x00\x02\x00\x00\x01\x83\x04\x04\x06\x02\x00" + "\x03\x01\x00\x41\xF0\x01\x00\x09\xA5" + "\x3B\x3C\xBC\x74\x24\x10\x04\x06\x3A\xAA\x94\xF0\x08\x7F\x55\x01\x0A\x96\x2A\x06\x03\x03\x01" + "\x00\x01\x01\x00\xE0\x01\x03\x00\x00" + "\x01\x03\x04\x04\x01\x01\x00\x00\x01\x02\x61\xF0\x2F\x3F\x0E\x6E\x38\x02\x03\x37\x89\x9F\x7F" + "\x25\x6C\x46\x1F\xF0\x55\x09\x00\x26" + "\x5E\x0C\x06\x00\x00\x00\x04\x02\x00\x02\x02\xC0\x00\x02\x04\x00\x05\x02\x02\x04\x02\x00\x00" + "\x01\x41\xF0\x02\x00\x2D\x17\x1E\x48" + "\x06\x00\x15\x79\x8B\x77\x91\x67\x10\xF0\x56\x03\x1F\x17\x00\x10\x50\x22\x06\x04\x02\x03\x01" + "\x04\x04\x93\x02\x03\x04\x04\x01\x01" + "\x02\x01\x00\x20\x02\x00\x21\xF0\x01\x01\x00\x00\x2F\x15\x0E\x26\x00\x01\x12\x46\x3A\x32\x4A" + "\xF0\x40\x0A\x3A\x06\x1B\x17\x00\x04" + "\x46\x4E\x0E\x03\x05\x02\x00\xF0\x00\x03\x01\x04\x00\x03\x02\x04\x00\x00\x01\x03\x05\x01\x00" + "\x10\x02\x11\xF0\x01\x00\x02\x01\x00" + "\x18\x0E\x05\x11\x00\x00\x06\x66\xBE\xB8\xF0\xB2\x52\x00\x0D\x03\x04\x04\x00\x00\x1A\x42\x16" + "\x06\x02\x00\xF0\x00\x05\x01\x00\x02" + "\x01\x00\x03\x02\x02\x01\x02\x00\x04\x00\x20\x00\x02\x11\xF0\x02\x02\x00\x02\x00\x24\x0E\x15" + "\x29\x00\x02\x02\x08\x24\x3E\xF0\x1C" + "\x02\x00\x49\x00\x20\x1C\x00\x00\x02\x44\x20\x04\x04\x00\xF0\x02\x00\x04\x00\x01\x03\x03\x02" + "\x00\x00\x02\x02\x04\x00\x00\x20\x00" + "\x05\x0C\x53\x05\x17\x0B\x01\x00\xF0\x01\x00\x38\x2E\x21\x7B\x1D\x01\x00\x00\x02\x02\x01\x03" + "\x49\xF0\x65\x08\x38\x1A\x00\x00\x00" + "\x3A\x30\x06\x02\x02\x05\x01\x03\xE0\x02\x00\x04\x02\x03\x03\x01\x03\x02\x00\x00\x04\x01\x04" + "\xF0\x01\x01\x00\x01\x01\x01\x00\x01" + "\x01\x00\x01\x00\x03\x45\x77\x24\x2D\x00\x83\x01\x26\x78\x04\x51\x83\x21\x00\xE3\x07\x43\x91" + "\x25\x3C\x5C\x02\x00\x01\x01\x08\x52" + "\x06\x00\xF0\x01\x01\x00\x03\x03\x04\x00\x00\x02\x01\x05\x02\x00\x02\x00\x93\x02\x02\x00\x02" + "\x00\x00\x00\x02\x00\xF0\x08\x18\x59" + "\xB7\x67\x09\x00\x00\x02\x02\x00\x5C\x62\x0F\x79\xF0\xB7\x71\x37\x27\x45\x91\xB1\x49\x0C\x94" + "\x30\x00\x00\x02\x02\xF0\x00\x54\x10" + "\x06\x01\x00\x04\x06\x02\x00\x06\x02\x03\x01\x00\x70\x00\x01\x00\x01\x01\x00\x00\x04\x35\x02" + "\x02\x00\xF0\x02\x3A\x3A\x3B\xC3\xD9" + "\x5D\x1B\x01\x00\x00\x0A\xB0\x9E\x1C\xC4\x4F\xB5\xED\xF9\xDD\x8D\x1D\x4C\xC4\x4C\x02\x00\xF0" + "\x2C\x34\x04\x04\x02\x03\x01\x03\x03" + "\x03\x02\x04\x04\x03\x00\x60\x04\x04\x00\x01\x01\x00\x13\x02\x18\x00\xF0\x0C\x52\x20\x0D\x51" + "\xBB\xAF\x61\x19\x00\x00\x12\x7E\xB0" + "\x8C\x95\x52\x24\x1A\x38\x64\x98\xB6\x54\x00\xF0\x05\x3F\x0F\x03\x03\x02\x02\x00\x02\x04\x04" + "\x02\x01\x02\x06\x70\x02\x03\x00\x01" + "\x04\x04\x02\x0A\xF0\x02\x00\x00\x00\x44\x6E\x18\x04\x21\x6D\xB1\xB9\x69\x0D\x00\xC4\x0A\x4E" + "\x94\xB4\xCC\xCE\xC0\xAA\x78\x24\x02" + "\x00\xF0\x21\x91\xBB\x3B\x05\x04\x00\x00\x01\x02\x00\x01\x00\x02\x02\x80\x00\x00\x01\x01\x04" + "\x01\x01\x00\x68\x02\x02\x02\x00\x02" + "\x00\xF0\x0E\x94\xFC\xA2\x54\x20\x21\x63\xC3\xF5\x95\x49\x1F\x04\x22\xF0\x36\x3A\x2C\x18\x06" + "\x01\x00\x00\x00\x09\x29\x95\xE9\x99" + "\x45\xF0\x09\x03\x01\x00\x02\x00\x00\x02\x00\x01\x00\x05\x03\x00\x04\x50\x06\x01\x00\x00\x02" + "\x78\x02\x00\x02\x00\x00\x02\x00\xF0" + "\x02\x26\x8C\xC2\xA8\x66\x1C\x05\x31\x99\xC9\xB5\x8F\x5B\x39\xF0\x19\x03\x02\x02\x00\x07\x2B" + "\x63\x93\xBB\x97\x25\x06\x24\x04\xF0" + "\x00\x01\x02\x00\x02\x03\x01\x01\x03\x01\x01\x01\x00\x00\x00\x40\x01\x02\x02\x01\x98\x02\x02" + "\x00\x02\x00\x00\x00\x02\x00\xF0\x04" + "\x26\x70\xB2\xC6\x7E\x2A\x02\x1D\x5B\x99\xB7\xC5\xCB\xC7\xF0\xB3\xC3\xCB\xCF\xC7\xB1\x91\x4B" + "\x0A\x56\xBC\xB4\x0A\x00\x01\x64\x01" + "\x02\x00\x00\x01\x02\x70\x01\x00\x01\x01\x00\x00\x00\xAA\x02\x02\x02\x00\x02\x00\x02\x00\x02" + "\x00\xF0\x20\x54\xB6\xFF\xD0\x82\x48" + "\x18\x1F\x33\x4F\x69\x83\x71\x63\xF0\x59\x37\x00\x40\x80\xEE\xDA\x6E\x0D\x08\x00\x00\x00\x03" + "\x01\xE0\x04\x01\x00\x02\x00\x02\x02" + "\x05\x07\x03\x02\x00\x00\x02\x03\x2E\x02\x00\xF0\x02\x00\x02\x00\x0C\x5E\xAA\xC2\xB8\xA0\x86" + "\x68\x48\x32\x3E\xF0\x54\x6E\x98\xB2" + "\xC0\xAA\x36\x02\x0D\x53\x07\x02\x02\x00\x04\x34\x02\x01\x00\x80\x01\x02\x06\x00\x06\x04\x00" + "\x01\x63\x02\x02\x00\x00\x02\x00\x2E" + "\x02\x00\xF0\x06\x2A\x62\x90\x9E\xB0\xC2\xD0\xC8\xBA\xAC\x8E\x64\x30\x08\xF0\x00\x00\x51\x43" + "\x0D\x01\x02\x02\x05\x03\x00\x02\x01" + "\x03\x00\x90\x02\x02\x04\x02\x00\x03\x03\x00\x01\x13\x02\x4F\x00\x02\x02\x00\x05\xF0\x04\x10" + "\x1C\x2A\x36\x30\x24\x18\x06\x00\x01" + "\x00\x21\x81\xA7\xF0\x2D\x03\x01\x03\x07\x06\x06\x01\x00\x02\x02\x00\x01\x03\x02\x60\x02\x00" + "\x02\x01\x02\x04\x9F\x02\x00\x02\x02" + "\x00\x00\x00\x02\x00\x0C\xF0\x01\x01\x1B\x65\xB1\xA5\x39\x0D\x03\x00\x00\x08\x01\x01\x02\xD0" + "\x01\x03\x02\x00\x02\x06\x00\x03\x00" + "\x00\x00\x05\x03\x47\x02\x02\x02\x00\x2B\x02\x00\x33\x01\x01\x00\xF0\x02\x02\x01\x00\x00\x00" + "\x1B\x7F\xC1\xB3\x6D\x1D\x03\x00\x01" + "\xF0\x01\x00\x01\x00\x01\x02\x04\x02\x03\x03\x03\x05\x03\x01\x00\x40\x03\x02\x02\x00\xA6\x00" + "\x02\x00\x00\x02\x00\x01\x01\x02\x00" + "\x26\x02\x00\xF0\x02\x00\x01\x00\x00\x01\x01\x0B\x1F\x3B\x75\xCB\xFA\xB3\x5F\xF0\x2F\x0B\x09" + "\x05\x01\x06\x06\x02\x00\x06\x02\x01" + "\x00\x01\x00\xA0\x02\x00\x04\x04\x04\x02\x00\x00\x04\x00\xF0\x02\x02\x02\x00\x01\x17\x37\x45" + "\x55\x57\x49\x39\x27\x19\x0D\x37\x03" + "\x01\x00\xF0\x01\x0F\x25\x3B\x59\x81\x9D\xB5\xCD\xB9\x6D\x1F\x15\x0D\x05\xF0\x03\x01\x05\x01" + "\x01\x03\x01\x02\x05\x03\x01\x04\x02" + "\x00\x00\x90\x02\x00\x01\x05\x01\x04\x00\x00\x00\xF0\x02\x02\x00\x00\x77\xBD\xBF\xBB\xBD\xB7" + "\xBF\xC3\xC9\xCF\xD3\xF0\xCF\xBB\xA3" + "\x8B\x77\x7D\x85\x8D\x97\xAF\xC7\xCF\xC9\xC1\xBB\xF0\xAD\x8D\x69\x39\x17\x15\x05\x01\x01\x01" + "\x04\x02\x04\x02\x00\xF0\x02\x02\x00" + "\x02\x04\x00\x03\x02\x02\x00\x00\x02\x01\x01\x01\x40\x00\x00\x02\x02\xF0\x02\x00\x09\x99\xAD" + "\x65\x4D\x45\x3B\x39\x3D\x49\x55\x5D" + "\x5F\xF0\x6B\x83\x9B\xB3\xC1\xBD\xB5\xAB\xA3\x91\x73\x61\x57\x4D\x35\xF0\x1B\x15\x0B\x0D\x09" + "\x01\x07\x03\x01\x02\x01\x00\x04\x02" + "\x00\x14\x01\xE0\x04\x00\x02\x01\x04\x00\x01\x04\x06\x04\x05\x03\x03\x00\xF0\x02\x00\x3D\x63" + "\x17\x0B\x07\x07\x00\x03\x03\x07\x09" + "\x07\x0D\xF0\x11\x0F\x0D\x0B\x15\x11\x11\x13\x13\x0D\x0F\x09\x05\x03\x05\xF0\x03\x01\x01\x01" + "\x02\x04\x06\x02\x00\x00\x02\x04\x00" + "\x01\x03\xF0\x03\x01\x02\x00\x00\x03\x00\x00\x02\x00\x02\x01\x00\x02\x00\x40\x06\x04\x02\x01" + "\xF0\x00\x00\x47\x25\x05\x03\x00\x02" + "\x01\x01\x02\x04\x00\x01\x00\xB3\x00\x01\x02\x01\x01\x03\x01\x01\x01\x00\x01\xF0\x04\x02\x01" + "\x00\x04\x00\x03\x07\x01\x02\x01\x03" + "\x03\x07\x03\xF0\x04\x06\x02\x01\x00\x02\x06\x04\x03\x00\x00\x02\x02\x02\x04\x50\x00\x00\x00" + "\x03\x04\xF0\x02\x0D\x27\x0B\x01\x01" + "\x02\x00\x00\x00\x03\x01\x00\x00\x00\xF0\x04\x04\x00\x00\x04\x00\x01\x00\x00\x01\x00\x02\x02" + "\x02\x00\xF0\x00\x02\x01\x02\x03\x01" + "\x04\x00\x00\x02\x01\x01\x00\x02\x02\xF0\x03\x00\x03\x02\x00\x05\x05\x00\x01\x03\x01\x04\x01" + "\x03\x00\x40\x01\x00\x00\x03\xF0\x00" + "\x05\x07\x03\x01\x02\x04\x00\x00\x00\x01\x03\x00\x02\x00\xF0\x00\x02\x03\x01\x01\x00\x01\x03" + "\x00\x02\x02\x00\x01\x00\x00\xF0\x02" + "\x02\x02\x03\x01\x00\x02\x02\x01\x01\x04\x02\x04\x02\x01\xF4\x00\x01\x04\x00\x02\x02\x02\x00" + "\x02\x01\x03\x05\x01\x03\x00\xF0\x02" + "\x05\x03\x01\x03\x00\x03\x02\x00\x00\x02\x02\x06\x02\x01\xF0\x05\x05\x00\x04\x01\x03\x02\x04" + "\x00\x00\x04\x01\x01\x02\x02\xF0\x00" + "\x04\x00\x02\x06\x04\x05\x00\x04\x02\x00\x01\x01\x07\x03\xF0\x00\x04\x00\x02\x03\x01\x04\x00" + "\x04\x04\x06\x02\x02\x02\x01\x40\x02" + "\x00\x02\x01\xF0\x02\x0A\x08\x00\x06\x04\x06\x00\x04\x02\x00\x01\x00\x02\x04\xF0\x06\x00\x00" + "\x03\x02\x02\x02\x00\x04\x02\x03\x00" + "\x04\x03\x00\xF0\x01\x05\x01\x03\x01\x03\x00\x03\x01\x01\x00\x01\x01\x02\x06\xF0\x04\x04\x01" + "\x03\x04\x01\x07\x04\x03\x02\x01\x00" + "\x03\x01\x00\x40\x00\x03\x00\x06\xF0\x00\x0C\x0E\x04\x00\x03\x01\x02\x03\x01\x00\x04\x05\x03" + "\x03\xA5\x01\x04\x01\x01\x03\x04\x00" + "\x00\x03\x00\xF0\x01\x00\x02\x00\x00\x04\x00\x00\x00\x04\x00\x02\x02\x04\x02\xF0\x02\x03\x04" + "\x03\x05\x00\x04\x05\x00\x01\x00\x00" + "\x02\x04\x02\x40\x01\x04\x00\x03\xF0\x00\x0A\x2C\x14\x00\x01\x01\x02\x04\x00\x01\x02\x00\x01" + "\x00\xF0\x09\x05\x02\x00\x06\x01\x01" + "\x01\x00\x01\x03\x01\x01\x02\x04\xF0\x04\x02\x04\x08\x04\x00\x04\x06\x02\x01\x03\x00\x00\x00" + "\x03\xF0\x03\x00\x01\x02\x02\x00\x00" + "\x01\x00\x04\x01\x00\x04\x00\x01\x40\x04\x00\x01\x01\xF0\x02\x02\x3E\x1C\x00\x08\x04\x01\x00" + "\x03\x00\x03\x00\x02\x02\xF0\x08\x00" + "\x05\x01\x00\x00\x01\x02\x01\x01\x04\x02\x01\x03\x07\xF0\x03\x05\x07\x01\x05\x05\x01\x01\x01" + "\x02\x02\x01\x00\x00\x01\xF0\x01\x00" + "\x03\x06\x00\x04\x01\x08\x02\x05\x03\x04\x01\x01\x02\x40\x05\x00\x02\x00\xF0\x00\x00\x30\x16" + "\x0A\x00\x03\x00\x01\x08\x00\x03\x00" + "\x01\x00\x63\x02\x04\x06\x04\x06\x02\xF0\x00\x00\x02\x00\x04\x02\x00\x00\x01\x07\x02\x04\x01" + "\x00\x00\xF0\x03\x02\x02\x04\x06\x06" + "\x02\x05\x00\x03\x02\x00\x02\x03\x00\xA0\x02\x02\x03\x03\x01\x02\x00\x00\x00\x04\xF0\x00\x00" + "\x18\x34\x0A\x04\x02\x04\x02\x01\x00" + "\x04\x02\x00\x05\x93\x01\x00\x01\x00\x0B\x01\x00\x01\x00\xF0\x02\x01\x02\x02\x02\x06\x04\x04" + "\x00\x02\x00\x00\x00\x04\x02\xF0\x01" + "\x01\x00\x04\x06\x04\x04\x02\x01\x02\x00\x01\x01\x04\x01\x70\x02\x02\x03\x02\x03\x01\x00\xF0" + "\x00\x02\x06\x6E\x0C\x02\x00\x03\x02" + "\x00\x04\x04\x00\x04\x02\xF0\x03\x00\x00\x01\x06\x04\x00\x00\x02\x02\x00\x01\x03\x04\x02\xF0" + "\x01\x00\x05\x00\x03\x00\x00\x01\x01" + "\x01\x07\x02\x02\x01\x01\xF0\x03\x00\x00\x03\x02\x02\x01\x00\x00\x00\x02\x04\x00\x00\x00\x40" + "\x02\x02\x00\x03\xF0\x02\x00\x00\x4A" + "\x3C\x0A\x00\x03\x01\x02\x00\x01\x01\x00\x08\xB3\x06\x00\x02\x02\x03\x03\x02\x04\x00\x01\x00" + "\xF0\x03\x00\x01\x02\x02\x01\x01\x02" + "\x00\x00\x04\x00\x00\x01\x00\xA3\x01\x03\x00\x02\x00\x03\x00\x00\x02\x00\x70\x04\x02\x01\x01" + "\x02\x00\x00\x03\xF0\x0A\x76\x1C\x1A" + "\x1A\x14\x12\x0E\x10\x0E\x08\x08\x0A\x08\x08\xF0\x06\x06\x02\x06\x02\x01\x01\x00\x00\x00\x07" + "\x03\x00\x04\x02\xF0\x00\x06\x04\x00" + "\x00\x00\x03\x00\x03\x00\x03\x01\x02\x00\x03\xF0\x02\x00\x00\x01\x00\x01\x02\x07\x01\x01\x00" + "\x02\x00\x01\x01\x10\x02\x04\xF0\x6E" + "\xCC\xC4\xBA\xB0\xA0\x98\x86\x7A\x76\x6A\x68\x62\x50\x40\xF0\x34\x20\x12\x12\x14\x14\x0A\x0A" + "\x08\x08\x04\x00\x04\x04\x01\xF0\x01" + "\x01\x03\x01\x01\x00\x06\x00\x04\x06\x06\x02\x00\x00\x02\xF0\x02\x01\x00\x01\x02\x00\x04\x02" + "\x03\x02\x02\x04\x02\x06\x04\x04\xF0" + "\x10\x56\x72\x80\x8C\x9C\xA8\xB8\xCA\xCE\xD2\xD0\xCA\xC6\xC0\xF0\xB6\xB0\xA2\x8A\x78\x5A\x42" + "\x26\x1C\x18\x14\x10\x08\x06\x04\xF0" + "\x00\x00\x04\x00\x02\x06\x01\x02\x03\x01\x03\x00\x01\x00\x03\xF0\x01\x00\x00\x02\x00\x02\x04" + "\x02\x06\x01\x02\x00\x02\x01\x01\x39" + "\x01\x01\x00\xF0\x01\x02\x08\x0E\x1C\x32\x4A\x62\x7E\x90\x9E\xAC\xBE\xD0\xDE\xF0\xD8\xB8\x8E" + "\x54\x24\x1A\x16\x0A\x08\x08\x06\x06" + "\x00\x00\x02\xF0\x01\x00\x00\x02\x04\x00\x02\x00\x04\x00\x01\x01\x05\x00\x00\x70\x00\x02\x03" + "\x01\x03\x01\x01\x6C\x04\x00\x00\x00" + "\x01\x00\xF0\x01\x01\x02\x06\x10\x1A\x28\x34\x42\x58\x7C\xAC\xEC\xED\xE6\xF0\xB6\x86\x66\x40" + "\x2E\x16\x10\x0C\x04\x02\x03\x00\x01" + "\x05\x04\xF0\x02\x00\x03\x01\x00\x00\x02\x03\x00\x00\x00\x02\x02\x00\x05\x10\x00\x34\x01\x02" + "\x00\x23\x01\x00\x2E\x02\x00\xF0\x02" + "\x02\x02\x0E\x46\x82\xBC\xCA\xC4\xB4\xA0\x80\x52\x28\x16\xF0\x12\x0A\x06\x04\x02\x01\x00\x00" + "\x00\x01\x02\x00\x00\x00\x03\x60\x01" + "\x01\x05\x00\x08\x00\x03\x67\x01\x02\x00\x00\x02\x00\x53\x01\x00\x02\x02\x00\x28\x01\x00\xF0" + "\x04\x18\x44\x6C\x90\xA8\xC4\xD6\xAC" + "\x5C\x1E\x14\x0E\x02\x02\xF0\x00\x00\x02\x02\x02\x04\x04\x06\x02\x00\x04\x08\x02\x00\x04\x03" + "\x25\x02\x00\x25\x01\x00\x34\x01\x01" + "\x00\x26\x02\x00\xF0\x02\x00\x00\x02\x00\x00\x06\x16\x2E\x4A\x8E\xE4\xF9\xC0\x78\xF0\x4E\x28" + "\x16\x0C\x08\x04\x00\x03\x05\x09\x01" + "\x00\x00\x07\x03\x20\x02\x01\x55\x03\x05\x07\x03\x00\x2F\x02\x00\x0D\xF0\x01\x02\x00\x02\x24" + "\x78\xC0\xCA\xB2\x8C\x5A\x26\x14\x10" + "\x08\x90\x04\x02\x02\x00\x01\x01\x00\x03\x00\xF0\xCD\xCF\xCF\xD1\xC9\xB7\xA3\x97\x81\x71\x61" + "\x53\x43\x2F\x13\x5D\x01\x02\x02\x02" + "\x00\x03\x13\x01\xF0\x00\x01\x01\x00\x00\x00\x0A\x32\x72\x9E\xC2\xD4\x92\x3E\x18\x90\x12\x02" + "\x00\x00\x04\x01\x06\x04\x00\xF0\x6F" + "\x6D\x71\x6B\x77\x8B\x9F\xA3\xBB\xC5\xD1\xDD\xE7\xF9\xF0\xC5\xEE\xE3\xB9\x93\x6F\x4B\x3B\x2D" + "\x21\x0F\x03\x00\x29\x01\x00\x14\x01" + "\xF0\x00\x10\x2A\x50\xA6\xF4\xDA\x80\x48\x20\x08\x05\x0C\x00\x03\x10\x01\xF0\x0B\x0B\x09\x11" + "\x0B\x0B\x09\x13\x11\x19\x15\x13\x21" + "\x1F\x23\xF0\x2D\x5F\x83\xA5\xC3\xDF\xD5\xC5\xB5\xA1\x85\x5F\x37\x11\x00\xC6\x00\x00\x02\x00" + "\x00\x00\x02\x02\x00\x00\x02\x00\xF0" + "\x02\x01\x00\x00\x02\x0E\x58\xB6\xBA\x98\x5E\x2A\x12\x08\x04\x10\x02\xF0\x01\x01\x06\x06\x03" + "\x01\x05\x01\x03\x00\x03\x03\x01\x03" + "\x07\xF0\x0B\x07\x11\x13\x17\x1D\x37\x51\x69\x85\xA5\xB5\xC1\xC5\xB1\xE4\x75\x3B\x07\x00\x01" + "\x01\x00\x00\x02\x02\x00\x00\x00\x02" + "\xF0\x00\x02\x00\x00\x02\x00\x00\x08\x4A\x8E\xC0\xC4\x5C\x1E\x12\x10\x0A\xF0\x01\x01\x05\x03" + "\x01\x00\x04\x04\x04\x02\x01\x05\x01" + "\x03\x00\xF0\x03\x05\x01\x07\x03\x05\x07\x0B\x0F\x13\x1B\x33\x47\x6B\x8F\xA4\xC1\xF1\xEC\xE5" + "\x9D\x57\x29\x0F\x01\x00\xF0\x01\x01" + "\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x02\x0A\x2A\x50\x62\xD8\xF2\x9C\x56\xF0\x03\x00\x04" + "\x02\x04\x02\x00\x03\x01\x01\x03\x01" + "\x02\x00\x01\xF0\x00\x02\x04\x08\x00\x01\x02\x02\x02\x05\x05\x05\x0B\x0B\x0B\xF0\x13\x19\x29" + "\x5B\x97\xCF\xC1\xA1\x75\x3F\x0B\x02" + "\x02\x00\x02\x2C\x02\x00\x50\x02\x06\x36\x9C\xC4\x53\x27\x23\x23\x24\x25\xF0\x28\x37\x4A\x47" + "\x41\x3D\x38\x33\x2E\x2A\x28\x27\x26" + "\x27\x27\xF0\x27\x25\x24\x26\x28\x26\x27\x28\x28\x26\x28\x28\x2A\x26\x27\xF0\x27\x28\x27\x27" + "\x25\x26\x24\x25\x27\x28\x27\x28\x27" + "\x27\x25\xB0\x26\x27\x27\x26\x27\x27\x27\x26\x25\x26\x23\xF0\x16\x0C\x0C\x06\x02\x06\x04\x04" + "\x02\x0A\x16\x1E\x2A\x2E\x34\xF0\x3A" + "\x3E\x3C\x30\x20\x12\x0A\x08\x06\x04\x06\x02\x01\x00\x01\xF0\x05\x03\x02\x00\x00\x03\x02\x00" + "\x00\x00\x03\x01\x00\x02\x04\xF0\x02" + "\x04\x00\x01\x01\x03\x00\x00\x00\x03\x00\x01\x00\x02\x00\x40\x00\x04\x02\x08\xF0\x38\x48\x38" + "\x2C\x1E\x10\x0C\x04\x04\x04\x02\x00" + "\x02\x06\x0A\xF0\x0E\x12\x1C\x2C\x3E\x4E\x4C\x3C\x28\x1E\x14\x0C\x04\x02\x02\xF0\x04\x04\x00" + "\x01\x07\x05\x02\x04\x00\x00\x02\x02" + "\x08\x06\x02\xF0\x01\x09\x03\x04\x00\x04\x03\x08\x02\x02\x03\x02\x07\x03\x00\x40\x01\x00\x04" + "\x01\xC4\x02\x06\x16\x28\x3A\x34\x2E" + "\x2A\x16\x06\x01\x00\x13\x02\xF0\x00\x0A\x1C\x32\x3A\x38\x34\x2E\x24\x14\x0C\x01\x03\x00\x04" + "\xF0\x00\x00\x05\x03\x03\x01\x02\x00" + "\x01\x03\x00\x04\x00\x04\x04\xE0\x02\x02\x00\x04\x02\x04\x00\x04\x01\x05\x06\x00\x03\x01\x04" + "\x96\x02\x14\x22\x2A\x34\x20\x02\x02" + "\x00\xF0\x01\x02\x00\x00\x00\x0A\x14\x20\x2A\x32\x3A\x34\x22\x10\x0A\xF0\x00\x04\x00\x02\x02" + "\x04\x04\x03\x09\x05\x01\x01\x03\x02" + "\x05\xF0\x07\x03\x04\x03\x03\x03\x01\x00\x04\x02\x06\x01\x02\x00\x01\xDB\x00\x00\x02\x02\x01" + "\x00\x00\x02\x0A\x08\x00\x01\x00\xF0" + "\x03\x01\x00\x04\x0A\x12\x20\x3C\x4A\x32\x24\x10\x02\x00\x04\xF0\x05\x07\x01\x08\x00\x06\x06" + "\x02\x00\x00\x02\x01\x00\x03\x01\xA0" + "\x00\x02\x02\x01\x08\x0A\x00\x01\x02\x0A\x04\x78\x02\x01\x01\x02\x00\x02\x00\x57\x02\x01\x01" + "\x01\x00\xF0\x02\x0A\x22\x34\x34\x22" + "\x0E\x02\x06\x08\x02\x03\x01\x03\x01\xF3\x04\x00\x00\x02\x04\x01\x00\x00\x04\x03\x03\x04\x03" + "\x07\x03\x04\x23\x01\x00\x28\x01\x00" + "\xF0\x02\x00\x00\x00\x01\x02\x00\x01\x09\x15\x23\x29\x1F\x0B\x00\xF0\x0A\x1C\x32\x2E\x0E\x00" + "\x00\x02\x02\x06\x04\x06\x02\x01\x03" + "\xF0\x01\x02\x01\x00\x01\x04\x02\x04\x02\x01\x03\x02\x02\x01\x01\x05\x3B\x02\x02\x00\xF0\x01" + "\x02\x02\x00\x00\x01\x0B\x27\x43\x43" + "\x33\x29\x33\x45\x41\xE3\x1D\x05\x08\x24\x38\x18\x00\x00\x04\x04\x02\x05\x02\x00\xD0\x01\x04" + "\x00\x07\x01\x00\x07\x00\x01\x00\x01" + "\x00\x00\x04\x7D\x02\x00\x00\x00\x02\x02\x00\xF0\x13\x31\x29\x03\x14\x20\x20\x1A\x0A\x0B\x31" + "\x2B\x05\x01\x14\xF0\x28\x0A\x04\x03" + "\x09\x01\x00\x00\x01\x04\x00\x00\x06\x02\x02\xA0\x01\x00\x03\x01\x04\x06\x01\x00\x00\x03\x71" + "\xF0\x05\x2D\x13\x0A\x30\x3A\x32\x30" + "\x32\x36\x20\x03\x21\x21\x00\xF0\x00\x1C\x1A\x02\x02\x04\x06\x04\x00\x02\x00\x04\x00\x02\x03" + "\xB0\x00\x06\x06\x04\x04\x07\x00\x02" + "\x02\x04\x02\x41\xF0\x01\x00\x01\x2F\x0D\x12\x38\x22\x0C\x04\x00\x02\x10\x2E\x2C\xF0\x02\x23" + "\x17\x00\x02\x2A\x0A\x00\x03\x05\x01" + "\x01\x02\x01\x01\xE0\x01\x05\x00\x00\x01\x03\x02\x01\x02\x03\x02\x02\x01\x04\x61\xF0\x0D\x11" + "\x02\x1E\x10\x00\x01\x0F\x25\x2D\x23" + "\x0B\x20\x10\x07\xF0\x17\x03\x00\x0C\x1C\x04\x04\x00\x01\x01\x00\x02\x00\x00\x00\x93\x02\x02" + "\x02\x05\x05\x04\x02\x06\x01\x41\xF0" + "\x02\x00\x09\x07\x08\x14\x02\x00\x05\x21\x25\x21\x29\x1D\x04\xF0\x1A\x02\x09\x03\x01\x04\x16" + "\x08\x02\x02\x04\x01\x02\x02\x06\xE0" + "\x00\x01\x04\x04\x01\x04\x04\x02\x00\x03\x02\x00\x02\x01\x11\x13\x01\xF0\x00\x0F\x05\x00\x0A" + "\x01\x01\x04\x12\x0A\x0C\x12\x10\x02" + "\x12\xF0\x02\x05\x07\x00\x02\x14\x16\x04\x03\x03\x02\x00\x00\x03\x01\xD0\x04\x01\x01\x04\x00" + "\x03\x05\x05\x01\x03\x05\x00\x04\x31" + "\xF0\x02\x00\x00\x06\x04\x00\x03\x02\x00\x02\x1E\x38\x36\x34\x1A\xF0\x02\x03\x01\x00\x02\x02" + "\x00\x08\x12\x02\x04\x02\x02\x00\x07" + "\xF0\x05\x02\x02\x03\x01\x01\x06\x04\x02\x02\x00\x02\x04\x02\x02\x11\xF0\x02\x02\x00\x00\x01" + "\x0A\x08\x07\x0D\x00\x02\x04\x04\x0C" + "\x12\xF0\x0A\x02\x00\x13\x00\x04\x06\x00\x00\x02\x16\x08\x00\x00\x00\xF0\x02\x04\x04\x00\x01" + "\x00\x00\x02\x00\x00\x00\x06\x06\x00" + "\x01\x20\x00\x07\x0C\x37\x01\x07\x00\xF0\x10\x0C\x03\x23\x09\x01\x01\x00\x02\x02\x00\x00\x15" + "\x1D\x02\xF0\x12\x08\x00\x01\x01\x12" + "\x14\x01\x01\x01\x09\x03\x01\x00\x00\xC0\x02\x01\x03\x05\x03\x00\x00\x01\x02\x06\x01\x06\x06" + "\xF0\x01\x00\x01\x00\x00\x00\x01\x13" + "\x27\x0D\x00\x00\x01\x01\x00\x83\x00\x0A\x22\x01\x11\x25\x09\x00\xF0\x01\x15\x29\x09\x0E\x1E" + "\x02\x00\x02\x02\x02\x16\x04\x02\x00" + "\xF0\x02\x01\x00\x00\x00\x01\x00\x02\x02\x04\x00\x03\x05\x02\x00\x20\x02\x01\x0C\xF0\x02\x06" + "\x1B\x35\x21\x03\x00\x00\x02\x02\x02" + "\x1A\x1E\x07\x21\xC4\x31\x21\x11\x0D\x15\x29\x33\x15\x01\x2A\x0E\x00\xF0\x16\x08\x04\x00\x02" + "\x06\x02\x04\x00\x04\x00\x03\x01\x03" + "\x01\x60\x01\x01\x05\x01\x00\x00\x0C\xF0\x02\x12\x16\x11\x35\x3F\x1B\x07\x01\x00\x00\x04\x32" + "\x30\x06\xB5\x1D\x33\x43\x45\x3F\x29" + "\x07\x18\x40\x18\x00\xF0\x10\x0C\x01\x02\x02\x05\x01\x03\x05\x01\x02\x02\x02\x00\x04\x60\x04" + "\x08\x02\x00\x01\x02\x58\x00\x02\x02" + "\x02\x00\xF0\x04\x14\x08\x01\x15\x33\x33\x1B\x07\x00\x00\x06\x22\x32\x2C\xF0\x16\x0A\x08\x12" + "\x1C\x2C\x30\x16\x00\x01\x01\x00\x01" + "\x00\x01\xF0\x0F\x07\x00\x01\x00\x04\x04\x00\x06\x04\x02\x02\x02\x06\x01\x60\x03\x01\x00\x04" + "\x02\x01\x24\x02\x00\x26\x02\x00\xF0" + "\x14\x22\x06\x02\x09\x21\x31\x35\x1D\x03\x00\x04\x18\x2C\x36\x84\x3C\x3A\x3C\x32\x22\x0E\x02" + "\x00\xF0\x09\x2B\x39\x0B\x02\x04\x00" + "\x00\x03\x01\x01\x05\x00\x00\x04\x80\x01\x04\x00\x01\x00\x01\x01\x02\x04\x28\x02\x00\xF0\x04" + "\x2A\x4A\x2E\x1A\x10\x07\x19\x37\x47" + "\x2B\x15\x07\x00\x0A\xF0\x10\x12\x08\x06\x02\x01\x00\x01\x00\x03\x0B\x2D\x45\x2B\x17\xF0\x03" + "\x05\x05\x01\x04\x02\x04\x04\x00\x03" + "\x02\x05\x01\x01\x02\x50\x04\x02\x00\x02\x02\x0E\xF0\x02\x00\x0A\x28\x34\x2E\x1A\x04\x05\x0F" + "\x2D\x37\x33\x29\x1B\xF0\x11\x09\x01" + "\x02\x02\x00\x01\x0D\x1B\x29\x37\x29\x07\x02\x0E\x33\x02\x01\x00\xE0\x01\x01\x00\x03\x00\x01" + "\x01\x05\x02\x02\x01\x02\x02\x03\x3E" + "\x02\x02\x00\xF0\x02\x0E\x20\x32\x38\x28\x10\x06\x09\x1B\x2D\x33\x39\x39\x37\xF0\x33\x37\x39" + "\x3D\x37\x33\x2B\x15\x02\x18\x36\x34" + "\x00\x00\x02\xF0\x02\x02\x01\x03\x01\x04\x04\x00\x00\x02\x00\x02\x00\x01\x00\x20\x03\x01\x44" + "\x00\x00\x02\x00\x25\x02\x00\x23\x02" + "\x00\xF0\x0A\x1C\x34\x46\x3A\x26\x16\x0A\x0D\x0F\x19\x21\x27\x21\x19\xF0\x17\x0F\x02\x18\x28" + "\x46\x3E\x20\x03\x06\x00\x00\x04\x05" + "\x00\xE0\x04\x01\x05\x00\x03\x04\x00\x03\x05\x05\x02\x01\x01\x04\x03\x4C\x02\x00\x02\x00\xF0" + "\x02\x02\x00\x00\x06\x1A\x30\x36\x34" + "\x32\x2A\x20\x16\x10\x12\xF0\x18\x20\x2C\x32\x34\x2E\x12\x02\x01\x19\x01\x06\x02\x03\x00\xF0" + "\x00\x01\x05\x04\x02\x02\x01\x01\x06" + "\x02\x00\x02\x00\x04\x02\x2F\x02\x00\x08\xF0\x02\x0E\x1C\x2A\x2C\x34\x3A\x3C\x38\x34\x30\x28" + "\x1C\x10\x04\xF0\x00\x00\x17\x11\x07" + "\x03\x02\x01\x02\x00\x02\x0A\x00\x03\x01\x90\x04\x02\x04\x02\x02\x00\x00\x00\x01\x3F\x00\x02" + "\x00\x09\xF0\x02\x02\x06\x08\x0A\x10" + "\x0E\x08\x06\x02\x00\x01\x00\x0B\x27\xF0\x31\x09\x03\x03\x07\x01\x02\x04\x03\x01\x01\x04\x04" + "\x05\x01\x70\x00\x00\x01\x00\x00\x04" + "\x01\x9F\x00\x00\x02\x00\x02\x00\x00\x02\x00\x09\x23\x02\x00\xF0\x07\x1D\x31\x2D\x11\x05\x02" + "\x02\x00\x00\x03\x01\x02\x00\x01\xB0" + "\x01\x00\x04\x04\x01\x03\x00\x02\x00\x07\x00\x29\x02\x00\x2B\x02\x00\x33\x01\x01\x00\xF0\x02" + "\x02\x02\x00\x02\x02\x07\x25\x39\x33" + "\x21\x07\x04\x00\x03\xF0\x00\x02\x04\x04\x00\x02\x04\x02\x01\x03\x05\x03\x01\x00\x01\x40\x03" + "\x02\x04\x02\x93\x00\x02\x00\x02\x00" + "\x01\x01\x01\x00\xA4\x01\x01\x01\x00\x01\x01\x00\x00\x01\x00\xF0\x01\x02\x01\x01\x01\x05\x0D" + "\x11\x21\x3B\x49\x2F\x17\x0B\x00\xF0" + "\x01\x01\x02\x06\x02\x00\x02\x06\x02\x02\x00\x00\x02\x00\x04\x80\x02\x06\x06\x06\x01\x00\x04" + "\x03\xF0\x00\x00\x01\x01\x00\x03\x0F" + "\x13\x1B\x1B\x15\x0F\x09\x07\x01\x24\x01\x00\xF0\x01\x00\x01\x02\x00\x03\x0F\x0F\x19\x25\x29" + "\x33\x3B\x37\x1D\xF0\x09\x07\x01\x00" + "\x00\x03\x03\x01\x00\x02\x00\x01\x05\x05\x01\xD0\x00\x02\x00\x00\x02\x00\x01\x05\x03\x02\x01" + "\x03\x02\xF0\x02\x00\x02\x00\x21\x35" + "\x33\x33\x35\x35\x39\x39\x37\x3B\x41\xF0\x3B\x33\x2B\x27\x23\x23\x25\x27\x29\x33\x3B\x3B\x39" + "\x35\x33\xF0\x31\x27\x1F\x0D\x03\x07" + "\x02\x00\x01\x01\x04\x04\x02\x02\x00\xF0\x03\x00\x02\x00\x00\x03\x01\x02\x00\x00\x03\x00\x01" + "\x03\x01\x40\x04\x01\x02\x02\xF0\x01" + "\x01\x01\x2B\x31\x23\x1D\x17\x11\x0B\x0B\x13\x1B\x19\x13\xF0\x1B\x29\x31\x37\x37\x35\x35\x33" + "\x2F\x29\x1B\x19\x15\x17\x11\x83\x05" + "\x03\x01\x05\x03\x00\x03\x01\xF0\x02\x04\x02\x02\x00\x01\x00\x00\x04\x08\x01\x02\x00\x02\x04" + "\x80\x02\x02\x06\x02\x05\x01\x03\x01" + "\xF0\x00\x02\x13\x1B\x09\x01\x00\x00\x02\x02\x00\x03\x03\x00\x05\xE3\x09\x01\x02\x02\x05\x03" + "\x00\x03\x05\x01\x07\x05\x01\x03\xF0" + "\x01\x00\x02\x02\x04\x02\x00\x00\x01\x04\x00\x03\x03\x01\x00\xF0\x00\x00\x01\x03\x04\x00\x00" + "\x00\x01\x01\x02\x04\x00\x02\x02\x20" + "\x00\x00\xF0\x04\x00\x11\x0D\x00\x00\x02\x04\x00\x03\x01\x06\x02\x05\x01\x13\x02\xF0\x01\x01" + "\x00\x02\x00\x02\x02\x04\x00\x00\x08" + "\x04\x00\x04\x02\xF0\x03\x03\x05\x00\x02\x00\x03\x03\x05\x05\x04\x02\x02\x01\x00\xF0\x02\x00" + "\x00\x09\x02\x00\x04\x00\x03\x02\x00" + "\x01\x00\x00\x00\xF0\x01\x03\x0B\x00\x01\x00\x04\x01\x02\x01\x01\x05\x02\x06\x02\xF0\x04\x04" + "\x02\x01\x08\x02\x03\x01\x02\x01\x00" + "\x00\x04\x06\x01\xF0\x00\x02\x00\x02\x00\x03\x02\x01\x02\x00\x03\x05\x00\x04\x02\xF0\x02\x00" + "\x03\x01\x00\x00\x01\x00\x05\x01\x01" + "\x02\x02\x01\x04\x40\x04\x02\x00\x02\xF0\x02\x00\x03\x00\x01\x04\x04\x00\x01\x00\x02\x02\x01" + "\x01\x00\xF0\x03\x00\x05\x01\x03\x00" + "\x01\x03\x00\x00\x01\x01\x01\x00\x00\xF0\x02\x00\x00\x01\x01\x04\x02\x02\x01\x02\x06\x04\x04" + "\x02\x01\xF0\x01\x00\x02\x04\x00\x02" + "\x00\x04\x02\x01\x01\x03\x01\x03\x03\x40\x00\x02\x00\x05\xF0\x00\x01\x00\x01\x00\x00\x05\x01" + "\x02\x00\x03\x00\x06\x04\x00\xF0\x03" + "\x03\x02\x02\x01\x07\x00\x04\x00\x03\x04\x00\x03\x02\x02\xF0\x01\x04\x02\x02\x04\x04\x03\x00" + "\x00\x00\x04\x01\x03\x05\x07\xF0\x00" + "\x01\x02\x01\x01\x01\x04\x02\x04\x04\x06\x00\x04\x00\x03\x40\x01\x00\x04\x00\x83\x02\x04\x02" + "\x00\x08\x04\x06\x04\xF0\x00\x02\x04" + "\x04\x0A\x00\x01\x01\x00\x04\x02\x00\x02\x06\x03\xF0\x00\x04\x05\x01\x02\x05\x03\x05\x00\x01" + "\x03\x01\x01\x00\x05\xF0\x01\x05\x02" + "\x08\x02\x06\x00\x00\x02\x01\x05\x04\x00\x00\x03\x80\x06\x03\x00\x02\x00\x05\x03\x04\xF0\x00" + "\x04\x04\x01\x03\x07\x03\x00\x07\x01" + "\x00\x02\x09\x05\x03\xF0\x03\x04\x00\x01\x00\x04\x00\x00\x01\x00\x04\x02\x00\x01\x02\xF0\x01" + "\x01\x00\x00\x00\x02\x04\x01\x02\x02" + "\x04\x00\x04\x02\x02\xF0\x00\x03\x02\x01\x01\x00\x02\x05\x01\x00\x01\x01\x00\x04\x04\x40\x02" + "\x04\x00\x01\xF0\x00\x02\x10\x0A\x01" + "\x02\x02\x04\x06\x02\x02\x00\x02\x03\x00\x64\x07\x0B\x00\x00\x04\x00\xF0\x03\x01\x00\x02\x04" + "\x04\x02\x06\x08\x06\x00\x04\x06\x04" + "\x01\xF0\x02\x04\x02\x00\x05\x02\x04\x00\x00\x02\x01\x03\x01\x02\x04\x90\x00\x03\x04\x00\x03" + "\x02\x00\x02\x02\xF0\x01\x00\x10\x04" + "\x00\x06\x04\x01\x03\x03\x01\x00\x01\x00\x00\xF0\x08\x00\x05\x01\x03\x01\x00\x01\x05\x05\x04" + "\x02\x01\x01\x05\xF0\x03\x05\x05\x00" + "\x05\x07\x01\x00\x03\x02\x03\x01\x02\x02\x02\xF0\x01\x01\x05\x04\x00\x04\x02\x08\x02\x03\x03" + "\x08\x00\x01\x04\x40\x03\x02\x02\x01" + "\xF0\x00\x00\x0C\x08\x04\x00\x03\x01\x02\x08\x01\x03\x02\x02\x02\xF0\x00\x06\x08\x06\x06\x01" + "\x02\x06\x04\x02\x01\x02\x00\x02\x02" + "\xF0\x00\x02\x01\x07\x00\x08\x03\x01\x02\x03\x00\x00\x02\x06\x06\xF0\x01\x05\x01\x03\x02\x02" + "\x04\x05\x03\x01\x02\x05\x07\x01\x00" + "\x40\x00\x01\x00\x04\xF0\x02\x00\x08\x0E\x04\x02\x02\x04\x04\x05\x00\x02\x00\x00\x05\xF0\x00" + "\x01\x05\x03\x07\x02\x00\x01\x00\x02" + "\x01\x01\x00\x00\x01\xF0\x00\x02\x02\x04\x02\x00\x04\x02\x00\x00\x06\x04\x03\x01\x00\xF0\x06" + "\x06\x08\x02\x02\x01\x03\x01\x00\x01" + "\x02\x03\x02\x00\x00\x40\x00\x03\x03\x02\xF0\x02\x02\x04\x22\x00\x03\x01\x03\x01\x04\x06\x04" + "\x02\x06\x00\xF0\x03\x00\x00\x02\x08" + "\x00\x01\x01\x00\x02\x04\x01\x03\x06\x04\xF0\x00\x02\x01\x01\x01\x05\x00\x01\x03\x00\x05\x00" + "\x02\x03\x03\xF0\x03\x00\x01\x00\x01" + "\x00\x00\x04\x00\x02\x08\x08\x02\x00\x03\x40\x04\x02\x02\x03\x03\xF0\x16\x12\x02\x03\x05\x02" + "\x00\x03\x03\x00\x03\x04\x02\x02\x04" + "\xF0\x02\x05\x01\x02\x04\x02\x01\x00\x02\x01\x00\x03\x01\x01\x00\xF0\x04\x00\x02\x04\x01\x00" + "\x00\x00\x02\x02\x03\x03\x01\x00\x02" + "\xF0\x01\x03\x01\x04\x02\x01\x02\x03\x00\x04\x04\x01\x03\x00\x03\x10\x01\xF0\x00\x00\x01\x02" + "\x22\x06\x08\x08\x04\x02\x04\x06\x02" + "\x00\x02\xF0\x02\x02\x00\x01\x06\x02\x06\x01\x05\x01\x00\x00\x02\x09\x01\xF0\x00\x00\x02\x00" + "\x04\x04\x01\x02\x01\x01\x00\x03\x01" + "\x03\x01\xF0\x00\x03\x03\x04\x02\x02\x01\x03\x02\x02\x05\x01\x01\x00\x04\x40\x02\x02\x02\x00" + "\xF0\x01\x00\x00\x00\x22\x3C\x3C\x38" + "\x30\x2E\x2C\x26\x1E\x24\x20\xF0\x1E\x20\x16\x12\x0C\x08\x04\x06\x0A\x0A\x00\x00\x02\x04\x00" + "\xF0\x02\x04\x02\x05\x03\x01\x07\x03" + "\x00\x02\x06\x00\x02\x08\x08\xF0\x02\x04\x00\x03\x02\x00\x00\x02\x00\x01\x00\x02\x01\x02\x02" + "\x40\x00\x01\x02\x06\xF0\x02\x00\x02" + "\x02\x06\x1C\x20\x26\x2A\x2E\x30\x34\x40\x3A\x3A\xF0\x3C\x38\x3A\x38\x32\x34\x2A\x24\x24\x16" + "\x10\x08\x0A\x0A\x08\xF0\x06\x04\x02" + "\x04\x00\x02\x08\x02\x02\x02\x01\x02\x00\x01\x05\xF0\x01\x00\x02\x02\x05\x01\x01\x02\x02\x02" + "\x06\x00\x04\x03\x00\x40\x00\x04\x04" + "\x01\x66\x01\x01\x00\x00\x01\x00\xF0\x01\x02\x04\x06\x08\x10\x14\x1E\x24\x2A\x2E\x30\x36\x40" + "\x42\xF0\x3C\x30\x26\x14\x08\x0A\x06" + "\x00\x03\x00\x02\x04\x01\x00\x02\xF0\x01\x01\x02\x04\x00\x00\x05\x02\x04\x00\x01\x01\x05\x02" + "\x00\x70\x02\x00\x01\x00\x01\x05\x01" + "\x31\xF0\x01\x02\x02\x06\x08\x0C\x0E\x12\x1C\x2A\x32\x46\x50\x3C\x30\xF0\x28\x22\x0E\x0A\x02" + "\x04\x01\x03\x05\x03\x00\x00\x01\x02" + "\x06\xF0\x02\x03\x01\x03\x03\x00\x03\x01\x03\x02\x04\x04\x03\x07\x00\x33\x02\x02\x00\x33\x01" + "\x01\x00\x2E\x02\x00\xF0\x01\x02\x00" + "\x02\x16\x2A\x38\x38\x3A\x34\x30\x28\x1A\x0A\x08\xF0\x08\x02\x02\x00\x01\x02\x01\x02\x02\x00" + "\x02\x02\x00\x02\x01\x60\x05\x03\x07" + "\x04\x0C\x00\x04\x2A\x02\x00\x53\x01\x00\x02\x02\x00\x46\x01\x00\x02\x00\xF0\x02\x08\x14\x22" + "\x28\x2E\x38\x3E\x32\x1C\x08\x02\x04" + "\x01\x03\xF0\x02\x01\x00\x04\x06\x06\x04\x06\x04\x04\x04\x08\x02\x00\x04\x06\x74\x02\x02\x00" + "\x00\x01\x01\x00\x37\x01\x01\x00\x23" + "\x01\x00\xF0\x02\x00\x00\x02\x02\x00\x04\x08\x0E\x18\x2A\x44\x4E\x3A\x20\xF0\x16\x0C\x06\x02" + "\x00\x03\x01\x03\x05\x0B\x07\x00\x00" + "\x0B\x03\x20\x00\x01\x64\x01\x03\x03\x01\x02\x00\x3B\x02\x02\x00\x5B\x02\x00\x00\x02\x00\xF0" + "\x01\x00\x02\x00\x0A\x22\x3A\x3C\x34" + "\x2A\x1A\x0A\x08\x08\x02\x90\x00\x00\x08\x02\x01\x02\x00\x00\x03\xF0\x39\x39\x3B\x3D\x3D\x37" + "\x2F\x2D\x25\x1F\x1B\x19\x15\x0D\x07" + "\x23\x01\x02\x1F\x00\x13\x01\xF0\x00\x01\x01\x02\x01\x00\x04\x10\x20\x2A\x38\x40\x2C\x0C\x02" + "\x90\x02\x02\x03\x03\x00\x01\x06\x01" + "\x04\xF0\x1D\x1D\x21\x19\x21\x27\x31\x2F\x39\x39\x3F\x41\x3D\x45\x4D\xC5\x4D\x43\x35\x2B\x21" + "\x17\x11\x0D\x09\x05\x01\x00\x29\x01" + "\x00\xF0\x03\x00\x01\x01\x01\x00\x06\x0E\x16\x2E\x46\x42\x2C\x18\x10\x60\x02\x05\x0A\x05\x01" + "\x03\xF0\x07\x07\x03\x0B\x01\x01\x00" + "\x05\x01\x0B\x01\x02\x0D\x0D\x0B\xF0\x09\x1B\x25\x2F\x37\x3F\x39\x37\x33\x2F\x25\x19\x11\x05" + "\x01\xC6\x00\x00\x02\x00\x00\x00\x02" + "\x02\x00\x00\x02\x00\xF0\x02\x01\x01\x00\x02\x06\x1A\x32\x34\x26\x1C\x12\x06\x04\x02\x10\x04" + "\xF0\x02\x02\x08\x08\x03\x01\x01\x02" + "\x00\x02\x02\x00\x04\x04\x02\xF0\x07\x01\x03\x07\x09\x07\x0F\x17\x1D\x23\x31\x35\x33\x37\x33" + "\xE4\x21\x13\x07\x00\x01\x01\x00\x00" + "\x02\x02\x00\x00\x00\x02\xF0\x00\x02\x02\x02\x00\x00\x00\x02\x14\x28\x38\x36\x1A\x08\x02\x10" + "\x00\xF0\x00\x01\x05\x01\x02\x02\x06" + "\x00\x02\x02\x07\x09\x03\x01\x00\xF0\x01\x00\x03\x00\x00\x00\x03\x01\x03\x01\x05\x0D\x11\x1D" + "\x27\xF0\x39\x43\x4B\x45\x2D\x17\x0B" + "\x03\x01\x00\x00\x02\x02\x00\x01\x84\x01\x00\x00\x01\x00\x00\x01\x00\x70\x02\x0A\x1C\x3C\x44" + "\x2E\x18\xF0\x03\x02\x04\x02\x02\x02" + "\x01\x01\x00\x02\x00\x04\x01\x00\x00\xF0\x04\x02\x08\x06\x04\x03\x02\x02\x01\x03\x01\x00\x07" + "\x05\x00\xF0\x03\x07\x09\x17\x29\x3B" + "\x37\x2D\x1F\x11\x03\x00\x00\x00\x02\x24\x02\x00\x23\x02\x00\x80\x02\x02\x00\x02\x02\x12\x2E" + "\x3C"; BYTE TEST_64X64_RED_PLANE[4096] = - "\x23\x1F\x1E\x1D\x1D\x1E\x1D\x1F\x23\x4A\x78\x71\x64\x58\x4B\x3E\x30\x29\x26\x24\x22\x21\x20\x20\x20\x1D\x1E\x20\x1E\x1F\x20\x20" - "\x1F\x20\x21\x22\x1E\x1F\x1F\x1F\x1F\x1F\x1F\x1F\x1E\x1D\x1F\x20\x1F\x1F\x1F\x1E\x1E\x1F\x1F\x20\x1E\x1F\x1F\x1F\x1E\x1D\x1E\x1C" - "\x3F\x2C\x28\x24\x21\x22\x20\x21\x25\x56\x94\x96\x97\x92\x8C\x86\x7F\x71\x61\x4D\x38\x2C\x29\x26\x23\x21\x21\x20\x1F\x1F\x1E\x1E" - "\x20\x20\x20\x20\x1F\x20\x1F\x20\x1E\x1E\x1D\x1F\x1E\x1E\x21\x20\x1F\x1F\x1F\x1F\x1E\x1F\x1D\x1F\x1F\x1F\x20\x1E\x1E\x1F\x1F\x1F" - "\x89\x83\x70\x5B\x44\x39\x2F\x27\x2C\x5B\x95\x96\x98\x98\x98\x98\x97\x97\x97\x97\x97\x8B\x76\x5C\x47\x3B\x2F\x28\x23\x22\x21\x21" - "\x20\x1F\x1E\x1F\x20\x20\x20\x20\x1F\x1F\x21\x21\x1F\x1E\x1F\x1F\x1F\x1E\x20\x1F\x21\x20\x1F\x1E\x1E\x1D\x1E\x1E\x1E\x1F\x21\x1E" - "\x8A\x8D\x8E\x8F\x8B\x7C\x6B\x5B\x4B\x66\x96\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x90\x81\x70\x5F\x4C\x39\x2B\x24" - "\x21\x21\x1E\x1E\x1F\x1E\x20\x1F\x1E\x20\x21\x21\x1D\x1D\x1E\x1E\x21\x21\x20\x20\x21\x21\x1F\x1F\x1F\x1E\x1E\x1E\x20\x1F\x1F\x1F" - "\x8A\x8D\x8E\x8F\x91\x92\x95\x92\x89\x8C\x97\x97\x99\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x95\x8D\x82\x6E\x4C" - "\x2F\x2A\x23\x20\x21\x1F\x1F\x20\x1F\x1F\x1E\x1D\x1D\x1D\x1D\x1F\x1F\x1E\x1E\x20\x20\x1E\x1E\x1E\x1E\x1E\x1F\x20\x20\x20\x1F\x1E" - "\x8A\x8D\x8F\x90\x91\x92\x95\x94\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x97\x97\x97" - "\x8D\x6C\x4B\x34\x27\x22\x21\x1E\x1D\x1F\x20\x1F\x1F\x1E\x1E\x20\x1F\x1F\x1E\x20\x1F\x1F\x1E\x1F\x1E\x1F\x21\x24\x1F\x1F\x20\x20" - "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x97\x97\x97\x97\x97\x97\x97\x98\x98\x98\x98\x98\x98" - "\x98\x98\x8E\x76\x51\x31\x24\x21\x1F\x1F\x1E\x1E\x1F\x1F\x1F\x1F\x20\x1E\x20\x21\x1E\x1F\x1F\x1E\x1F\x20\x20\x20\x1D\x1E\x1F\x20" - "\x8A\x8D\x8F\x90\x91\x93\x95\x95\x95\x95\x96\x96\x98\x98\x98\x98\x98\x98\x98\x98\x97\x97\x96\x97\x98\x97\x97\x8E\x7C\x6D\x64\x72" - "\x89\x96\x98\x98\x8E\x6B\x38\x25\x1E\x1E\x1F\x20\x1F\x20\x1F\x1F\x1F\x1F\x1F\x1E\x1E\x1E\x21\x1F\x1F\x20\x20\x1F\x1D\x1E\x1D\x1E" - "\x8A\x8D\x8F\x90\x91\x93\x95\x95\x95\x95\x96\x96\x98\x98\x98\x98\x98\x98\x98\x98\x99\x98\x97\x98\x96\x87\x62\x39\x2E\x2E\x2F\x2F" - "\x32\x45\x74\x92\x98\x98\x7D\x3E\x22\x20\x21\x22\x1E\x1E\x21\x1E\x1F\x1F\x20\x1E\x20\x1E\x1D\x1E\x1F\x1E\x1E\x1F\x1E\x1E\x1D\x1E" - "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x97\x98\x7D\x47\x31\x30\x49\x55\x5B\x52" - "\x3D\x30\x37\x5D\x92\x98\x97\x72\x2C\x23\x1F\x1E\x20\x1F\x21\x1F\x1F\x1F\x20\x21\x20\x1E\x1D\x1D\x1E\x1E\x21\x20\x1F\x1F\x1E\x1D" - "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x97\x91\x45\x2F\x3E\x6D\x8B\x91\x93\x8F" - "\x81\x59\x32\x31\x68\x97\x97\x94\x4D\x26\x22\x1E\x22\x21\x21\x1E\x1F\x20\x20\x21\x1E\x20\x1E\x1F\x20\x1E\x1E\x20\x1F\x1F\x1F\x1E" - "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x97\x97\x93\x56\x2F\x44\x81\x97\x98\x97\x94\x91" - "\x96\x96\x69\x33\x3A\x79\x97\x97\x81\x37\x24\x1E\x20\x20\x20\x20\x1E\x20\x1F\x1F\x1F\x1F\x1E\x1E\x21\x1E\x1E\x20\x1F\x20\x1F\x1F" - "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x97\x98\x82\x3E\x35\x6C\x96\x98\x96\x82\x63\x57" - "\x69\x88\x8F\x4C\x2F\x59\x92\x97\x91\x58\x28\x1F\x20\x1F\x20\x20\x1F\x1F\x1F\x20\x1F\x1F\x1F\x1D\x1E\x1F\x1E\x20\x1F\x1F\x1E\x1E" - "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x97\x98\x72\x36\x3F\x86\x98\x98\x8F\x57\x32\x2C" - "\x35\x62\x94\x6A\x2F\x4E\x8B\x97\x97\x75\x34\x22\x21\x1F\x1F\x20\x20\x21\x20\x1E\x21\x22\x1F\x1D\x1F\x1F\x1E\x1F\x1F\x1F\x1F\x1E" - "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x98\x98\x98\x98\x98\x97\x97\x97\x97\x98\x61\x2E\x44\x93\x98\x97\x94\x70\x46\x3E" - "\x4D\x79\x97\x80\x31\x44\x82\x98\x98\x8E\x50\x26\x1F\x1E\x1E\x20\x21\x20\x1E\x1F\x21\x20\x1F\x1D\x1E\x1F\x1D\x1F\x1D\x1D\x1F\x1F" - "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x98\x98\x97\x98\x98\x98\x98\x98\x97\x98\x69\x31\x41\x8D\x98\x97\x97\x95\x8A\x80" - "\x8D\x97\x97\x7A\x2F\x45\x83\x98\x98\x97\x68\x2E\x20\x1E\x1F\x1F\x1E\x1E\x1F\x20\x1F\x1F\x1F\x20\x1F\x1E\x1D\x1F\x1F\x1E\x1F\x20" - "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x98\x97\x97\x98\x98\x98\x98\x99\x97\x98\x77\x38\x39\x7E\x98\x98\x98\x98\x97\x97" - "\x98\x98\x98\x61\x2F\x50\x8E\x98\x98\x98\x80\x3A\x21\x1F\x1F\x21\x1F\x20\x1F\x20\x1E\x1F\x1F\x20\x20\x1F\x20\x21\x1E\x1D\x1F\x1D" - "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x96\x8F\x94\x97\x98\x98\x97\x97\x97\x97\x89\x47\x2E\x52\x8D\x97\x98\x98\x97\x98" - "\x98\x97\x7C\x3B\x31\x65\x97\x98\x98\x98\x96\x4D\x26\x1F\x20\x1D\x1D\x1D\x20\x20\x1F\x1F\x1F\x1E\x1F\x1E\x20\x21\x1F\x1F\x1E\x20" - "\x8A\x8C\x8F\x90\x92\x93\x94\x95\x96\x96\x96\x97\x94\x76\x68\x87\x98\x98\x98\x98\x97\x97\x97\x72\x2F\x34\x5D\x8B\x98\x98\x97\x98" - "\x95\x7D\x49\x2E\x47\x86\x98\x98\x99\x98\x98\x69\x27\x20\x1F\x1E\x1C\x1E\x20\x20\x1E\x1E\x1F\x1D\x1F\x1E\x1F\x1E\x20\x20\x1F\x1F" - "\x8A\x8D\x8F\x90\x92\x93\x94\x95\x96\x96\x96\x97\x97\x7F\x49\x45\x72\x94\x98\x98\x98\x98\x98\x94\x51\x2E\x31\x49\x6F\x83\x88\x7F" - "\x61\x3E\x2E\x32\x7C\x97\x98\x98\x98\x98\x98\x86\x2D\x23\x1F\x1E\x1F\x20\x21\x20\x1F\x1F\x1E\x1D\x1E\x1E\x1F\x1D\x1E\x1F\x1F\x1F" - "\x8A\x8D\x8F\x90\x92\x93\x94\x95\x96\x96\x96\x97\x98\x94\x5D\x2E\x2C\x46\x76\x8D\x97\x98\x98\x98\x91\x67\x3C\x2C\x2D\x2E\x2E\x2E" - "\x2D\x32\x4B\x79\x98\x98\x98\x98\x98\x97\x97\x97\x3F\x23\x1F\x1F\x1D\x1F\x1F\x1E\x1F\x1F\x1F\x1F\x1D\x1F\x21\x20\x1F\x1F\x1F\x1F" - "\x8B\x8D\x8F\x91\x92\x93\x94\x95\x96\x96\x96\x97\x98\x98\x7A\x39\x28\x28\x32\x4E\x74\x8F\x98\x98\x98\x94\x7A\x5E\x4C\x3A\x39\x42" - "\x52\x6A\x8B\x97\x98\x98\x98\x98\x98\x98\x96\x80\x39\x23\x20\x1F\x1E\x20\x20\x1F\x21\x20\x1F\x1F\x20\x1F\x1F\x1F\x1E\x20\x1F\x20" - "\x8C\x8D\x8F\x91\x92\x93\x95\x95\x96\x96\x97\x97\x98\x98\x93\x62\x30\x29\x26\x27\x34\x4C\x72\x93\x98\x98\x97\x94\x8C\x84\x83\x88" - "\x8E\x95\x98\x98\x98\x98\x98\x98\x97\x8C\x62\x3D\x25\x21\x20\x1F\x1E\x1F\x20\x20\x1F\x20\x20\x20\x1F\x20\x1E\x1E\x20\x1F\x1F\x1F" - "\x8C\x8E\x90\x91\x93\x93\x95\x95\x96\x96\x97\x97\x98\x98\x97\x97\x8B\x64\x46\x33\x28\x27\x2B\x3A\x61\x7E\x8C\x95\x98\x98\x98\x98" - "\x97\x97\x97\x98\x98\x97\x93\x89\x62\x38\x29\x22\x21\x1F\x1F\x1E\x20\x20\x20\x21\x1F\x1F\x20\x1E\x1E\x20\x1F\x20\x1F\x1F\x1F\x1F" - "\x8D\x8F\x90\x92\x93\x94\x95\x95\x96\x96\x97\x97\x98\x98\x98\x98\x98\x96\x8A\x6F\x4B\x32\x29\x27\x29\x34\x4A\x61\x78\x83\x8E\x97" - "\x98\x98\x97\x95\x86\x74\x5F\x44\x2B\x2A\x2C\x30\x21\x1E\x20\x1E\x1F\x1F\x1F\x20\x1F\x1D\x1F\x1E\x1E\x1F\x20\x21\x1E\x20\x20\x1E" - "\x8D\x8F\x90\x92\x93\x94\x95\x96\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x97\x8C\x79\x57\x37\x2C\x29\x28\x29\x35\x3C\x45\x50" - "\x57\x52\x4D\x4A\x3F\x34\x2A\x2A\x2F\x49\x6F\x70\x25\x1F\x1F\x1F\x20\x1F\x1E\x1F\x20\x1F\x20\x1E\x1E\x1E\x20\x21\x1D\x1F\x1F\x1F" - "\x8E\x90\x91\x92\x93\x94\x95\x96\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x97\x98\x97\x98\x94\x77\x58\x42\x32\x28\x28\x27\x28" - "\x27\x2A\x2A\x2A\x2C\x35\x42\x58\x85\x97\x97\x6B\x28\x20\x20\x20\x1E\x1F\x1F\x1D\x1F\x1F\x1F\x1F\x1F\x1C\x1D\x1F\x1E\x1F\x1F\x20" - "\x8F\x90\x92\x93\x93\x95\x95\x96\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x96\x89\x74\x62\x59\x4D\x42" - "\x38\x3F\x48\x51\x62\x74\x86\x95\x98\x98\x92\x4E\x26\x21\x20\x1F\x1E\x1F\x20\x1D\x20\x20\x1F\x1F\x1D\x1D\x1E\x1F\x20\x1F\x20\x20" - "\x8F\x90\x92\x93\x94\x95\x95\x96\x96\x97\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x96\x92\x8D\x88" - "\x84\x87\x8B\x8F\x95\x98\x98\x98\x98\x98\x75\x35\x23\x1E\x20\x1E\x1D\x1F\x20\x20\x1F\x1D\x1E\x20\x1D\x1F\x1E\x1F\x1F\x1E\x1F\x1F" - "\x90\x91\x92\x93\x94\x95\x96\x96\x96\x97\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x97\x97" - "\x98\x98\x98\x98\x98\x98\x97\x98\x8B\x69\x39\x27\x20\x1E\x1E\x1D\x1F\x20\x1F\x1F\x1F\x1F\x1F\x1E\x1D\x1F\x20\x1E\x20\x1F\x21\x20" - "\x90\x92\x93\x94\x95\x95\x96\x96\x96\x97\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x97\x97" - "\x98\x98\x98\x98\x97\x97\x8D\x73\x4D\x2E\x24\x21\x1E\x1E\x1D\x1D\x1F\x1E\x1E\x1E\x1E\x20\x20\x20\x1F\x1E\x1D\x1F\x20\x20\x1E\x1F" - "\x91\x92\x93\x94\x95\x95\x96\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x97\x98\x98\x98\x98\x97\x97\x98\x98\x98\x98\x98\x98" - "\x99\x98\x99\x98\x8D\x68\x47\x32\x26\x23\x22\x20\x1C\x1D\x1E\x20\x1F\x1F\x1E\x20\x1D\x1E\x1E\x1E\x1C\x1E\x1D\x1E\x1F\x20\x1E\x1E" - "\x92\x93\x92\x94\x95\x95\x95\x95\x97\x97\x97\x98\x99\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x99\x97\x97\x97\x98\x97\x97\x97\x93" - "\x8B\x83\x6D\x4E\x30\x29\x24\x22\x20\x1F\x20\x20\x1F\x1F\x1E\x20\x22\x20\x20\x20\x1C\x1E\x1F\x1E\x1F\x1F\x20\x20\x1E\x20\x21\x1E" - "\x92\x93\x93\x94\x94\x8C\x80\x7D\x77\x77\x7D\x83\x8A\x8E\x92\x96\x98\x98\x98\x98\x98\x98\x98\x97\x98\x97\x91\x8B\x81\x77\x68\x5B" - "\x4A\x38\x2B\x27\x22\x20\x20\x20\x1F\x1D\x1E\x1F\x1F\x1F\x1F\x20\x1F\x1E\x20\x20\x1F\x1E\x1F\x20\x1E\x1E\x1D\x1E\x1F\x1F\x1F\x1E" - "\x92\x94\x94\x94\x69\x49\x3C\x38\x33\x33\x37\x3C\x42\x43\x45\x4C\x55\x5C\x65\x6D\x6B\x68\x65\x61\x59\x4E\x47\x42\x3C\x34\x2A\x27" - "\x23\x23\x22\x20\x22\x20\x20\x20\x21\x1F\x20\x20\x1F\x1F\x1E\x21\x20\x1E\x1F\x20\x20\x1F\x20\x1F\x1F\x1E\x1C\x1C\x20\x1F\x1F\x1F" - "\x92\x94\x91\x5D\x2D\x22\x1E\x20\x1E\x1F\x22\x23\x23\x23\x25\x25\x25\x25\x24\x27\x28\x26\x27\x26\x23\x24\x23\x22\x21\x21\x1F\x21" - "\x20\x1F\x1E\x1F\x1F\x1F\x1E\x1F\x20\x20\x21\x21\x20\x1F\x1F\x21\x1F\x1F\x20\x20\x21\x1F\x20\x1F\x1F\x20\x1F\x1F\x1D\x1F\x20\x1F" - "\x94\x95\x7A\x39\x23\x1F\x1D\x1D\x1D\x1F\x20\x1F\x1F\x20\x20\x1F\x1E\x20\x20\x1F\x20\x21\x20\x20\x20\x1F\x20\x1F\x20\x1D\x1D\x1F" - "\x1E\x1F\x1F\x21\x22\x20\x1D\x1E\x20\x21\x21\x1F\x1F\x1D\x1D\x21\x1F\x1F\x1F\x20\x21\x1F\x20\x1F\x1F\x21\x20\x1E\x1F\x1F\x1F\x1F" - "\x94\x94\x60\x2A\x20\x1D\x1D\x1F\x1D\x1F\x20\x21\x1F\x1E\x1F\x1F\x1F\x20\x20\x1E\x1F\x20\x20\x1D\x20\x1F\x20\x20\x1F\x1F\x1E\x1F" - "\x1F\x1F\x1F\x1E\x1F\x20\x1F\x1F\x1E\x20\x1E\x1E\x1F\x1F\x1F\x20\x1F\x1F\x20\x21\x1E\x1F\x20\x20\x1F\x1F\x21\x1F\x1F\x1F\x1F\x1D" - "\x94\x8E\x52\x26\x1F\x1D\x1E\x1E\x1E\x1F\x1F\x20\x1F\x1F\x1F\x20\x22\x21\x20\x20\x1F\x20\x20\x1F\x1F\x1F\x20\x21\x21\x20\x20\x20" - "\x1F\x21\x1E\x1D\x20\x1F\x20\x1E\x1D\x1F\x1E\x1F\x1F\x1E\x1F\x1E\x1F\x1F\x1F\x1F\x1E\x1D\x1E\x20\x20\x1F\x1F\x1E\x1F\x20\x1F\x1F" - "\x94\x8C\x4F\x25\x1D\x1F\x20\x1E\x1D\x1E\x1E\x1E\x1F\x1F\x20\x20\x21\x20\x20\x1F\x1F\x1E\x1E\x20\x1E\x1E\x20\x20\x20\x1F\x20\x20" - "\x20\x1F\x1D\x1E\x20\x20\x1F\x1F\x20\x20\x20\x20\x1F\x1E\x1E\x1E\x1F\x20\x20\x1F\x1F\x1E\x1E\x1E\x1E\x1E\x1E\x1E\x1F\x20\x1F\x1E" - "\x95\x8A\x4D\x25\x1C\x1D\x1D\x1E\x1E\x1E\x1F\x1F\x20\x21\x1F\x1D\x1F\x20\x21\x1F\x1C\x1E\x1F\x1F\x1E\x20\x1F\x20\x21\x20\x20\x22" - "\x20\x20\x20\x20\x1E\x20\x1F\x1F\x20\x1E\x1E\x1C\x1C\x1E\x1F\x1E\x20\x1F\x1F\x20\x20\x1F\x1F\x21\x1E\x20\x1E\x1E\x1E\x20\x20\x1E" - "\x96\x8F\x50\x25\x20\x1F\x1F\x1F\x20\x20\x20\x1F\x21\x22\x21\x21\x1F\x1F\x1F\x1F\x1E\x1F\x20\x1F\x21\x20\x20\x21\x1F\x20\x20\x1F" - "\x1F\x1E\x1F\x1E\x1D\x1E\x1F\x20\x1F\x1E\x1D\x1D\x1D\x1E\x20\x1F\x1F\x1F\x1E\x1E\x21\x1F\x1F\x1F\x1F\x1F\x1E\x1E\x1E\x1E\x1F\x20" - "\x96\x92\x56\x26\x1F\x1D\x1F\x20\x1D\x1F\x20\x21\x1E\x20\x1F\x1F\x20\x1F\x1E\x1E\x1F\x1E\x1F\x1F\x20\x20\x20\x21\x1F\x21\x1F\x1F" - "\x1F\x1D\x1F\x1F\x1E\x1E\x1F\x21\x20\x1F\x1E\x1F\x20\x1F\x1E\x1F\x1E\x1E\x1E\x20\x1E\x1E\x1F\x1E\x1F\x1F\x1F\x1F\x1E\x20\x1F\x1E" - "\x96\x96\x66\x2D\x1D\x1D\x1F\x21\x1F\x20\x20\x22\x1F\x1E\x1F\x1B\x1C\x20\x1F\x21\x1E\x1E\x1F\x1F\x20\x1E\x1F\x20\x1F\x21\x20\x20" - "\x21\x20\x21\x1F\x20\x20\x20\x1E\x20\x1F\x1F\x1E\x1E\x1F\x20\x1E\x1E\x1F\x1E\x1D\x1E\x1F\x20\x1E\x1F\x20\x1E\x1E\x1E\x20\x1F\x1E" - "\x96\x97\x7A\x36\x20\x21\x21\x20\x1F\x1E\x1F\x20\x1E\x1F\x20\x1F\x1D\x1D\x1E\x20\x1F\x1F\x1F\x1E\x1F\x20\x20\x1F\x1F\x1F\x1F\x1E" - "\x1F\x21\x1E\x1D\x1F\x1F\x20\x20\x1E\x1E\x1F\x1F\x1E\x1E\x1F\x1E\x1F\x1F\x1F\x1F\x21\x20\x20\x1D\x21\x20\x1F\x20\x1E\x20\x1F\x1E" - "\x97\x97\x8C\x3F\x22\x21\x20\x20\x1F\x21\x1F\x1E\x1F\x1F\x20\x1F\x20\x20\x20\x22\x1F\x20\x21\x1F\x1E\x1F\x21\x1F\x1F\x20\x1F\x1E" - "\x1D\x1D\x1F\x1F\x1E\x1F\x20\x1F\x1E\x1F\x20\x22\x21\x1E\x1C\x1D\x1F\x20\x20\x1F\x1F\x1F\x1E\x1D\x1E\x1E\x1E\x20\x1E\x1E\x1F\x1F" - "\x97\x97\x95\x51\x26\x22\x20\x22\x20\x1F\x1F\x20\x1E\x1F\x1E\x1F\x1F\x1F\x1F\x1E\x1E\x1F\x20\x1F\x1F\x1E\x20\x20\x1E\x1F\x20\x1F" - "\x1F\x20\x20\x1F\x1F\x20\x20\x1F\x21\x20\x1F\x21\x21\x20\x1E\x1E\x21\x21\x1F\x1E\x1E\x1E\x1E\x1F\x1D\x1D\x1E\x1F\x1E\x1D\x1F\x20" - "\x97\x98\x98\x79\x2B\x23\x1F\x1E\x1F\x20\x21\x20\x20\x21\x1E\x1D\x1F\x1E\x1F\x21\x20\x1F\x1F\x1F\x20\x20\x20\x1E\x21\x20\x1F\x1F" - "\x1D\x1E\x1F\x1F\x1F\x1F\x1F\x1E\x1F\x20\x20\x20\x20\x1E\x1F\x1E\x1F\x21\x20\x1F\x1F\x1F\x1E\x21\x20\x1E\x1F\x1E\x20\x1F\x1F\x1D" - "\x98\x98\x98\x93\x40\x25\x20\x1E\x20\x21\x1F\x20\x1F\x1F\x21\x20\x20\x1F\x1F\x1F\x1E\x20\x22\x20\x1F\x20\x20\x1D\x21\x20\x1F\x1E" - "\x1E\x20\x1E\x1E\x20\x1F\x1F\x1F\x1E\x21\x20\x1F\x1E\x1D\x1F\x21\x1F\x1F\x1F\x20\x20\x1F\x1F\x20\x20\x20\x1F\x1D\x1F\x1F\x1E\x1C" - "\x98\x98\x98\x97\x6A\x2F\x28\x26\x28\x26\x25\x26\x23\x24\x25\x23\x21\x22\x20\x22\x1F\x23\x21\x1D\x1E\x20\x20\x1E\x1E\x1E\x1F\x1F" - "\x1F\x20\x21\x20\x20\x1F\x1F\x1E\x1E\x1F\x20\x1D\x1E\x1E\x1F\x1F\x20\x20\x1F\x20\x20\x1E\x20\x1D\x1F\x20\x1F\x1E\x1F\x1F\x1E\x1E" - "\x98\x98\x98\x97\x93\x78\x6F\x6A\x64\x5F\x5B\x57\x4F\x4D\x4B\x49\x45\x3E\x38\x33\x2A\x2A\x29\x26\x27\x23\x23\x21\x20\x1F\x1E\x1F" - "\x1D\x1F\x1F\x1D\x1D\x1E\x1E\x1E\x21\x20\x20\x1E\x21\x1E\x1F\x1F\x1E\x20\x1F\x1F\x1F\x1F\x20\x1E\x20\x1E\x21\x20\x20\x1F\x1F\x20" - "\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x97\x95\x93\x8D\x85\x7D\x74\x6A\x62\x59\x51\x46\x3B\x30\x2B\x2A\x27\x24\x24" - "\x22\x20\x1F\x1F\x1E\x1E\x1F\x1F\x20\x20\x20\x20\x1E\x1F\x1F\x20\x1F\x1F\x1F\x1F\x20\x1F\x1F\x1F\x20\x1F\x20\x20\x1F\x20\x20\x20" - "\x98\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x97\x98\x98\x98\x98\x98\x97\x98\x97\x96\x92\x8F\x89\x85\x80\x78\x6A\x59\x42\x30" - "\x2C\x28\x23\x21\x22\x1F\x20\x1E\x20\x21\x1F\x1F\x1F\x20\x20\x1F\x1F\x1F\x20\x1F\x1F\x1E\x1D\x20\x1F\x21\x20\x1E\x1F\x1F\x1F\x1F" - "\x98\x97\x98\x98\x97\x98\x98\x97\x98\x98\x98\x98\x97\x98\x98\x98\x98\x98\x97\x97\x98\x98\x98\x97\x98\x98\x98\x97\x97\x97\x97\x91" - "\x7D\x69\x54\x46\x38\x2F\x27\x26\x23\x22\x1E\x1D\x1F\x1E\x1E\x20\x20\x20\x1E\x1E\x1E\x1D\x1E\x1F\x1E\x20\x21\x20\x21\x1E\x1C\x1F" - "\x98\x98\x98\x98\x97\x98\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98" - "\x97\x98\x96\x8E\x7E\x70\x62\x53\x41\x31\x27\x23\x22\x21\x1F\x20\x20\x20\x1F\x1E\x1E\x1E\x1F\x1F\x21\x1E\x1F\x1F\x1E\x1F\x20\x1F" - "\x98\x98\x98\x97\x98\x98\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x97\x98\x98\x98\x98\x98\x98\x98\x97\x98\x98\x98\x98\x98\x98\x98" - "\x97\x98\x98\x97\x97\x97\x95\x90\x88\x7C\x64\x45\x2D\x28\x25\x22\x21\x20\x1F\x1F\x1F\x1F\x20\x21\x22\x20\x20\x20\x20\x20\x1F\x20" - "\x98\x97\x97\x98\x98\x98\x97\x97\x98\x98\x97\x97\x97\x98\x98\x97\x97\x97\x97\x98\x98\x98\x98\x98\x97\x98\x98\x98\x97\x97\x98\x98" - "\x98\x98\x98\x98\x98\x97\x97\x98\x98\x97\x97\x97\x89\x6C\x4F\x3D\x30\x28\x24\x21\x1E\x1F\x1F\x1E\x1D\x1D\x1F\x1F\x1D\x1E\x20\x1F" - "\x96\x95\x94\x96\x98\x98\x98\x98\x98\x97\x98\x98\x98\x98\x98\x98\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x97" - "\x98\x98\x98\x98\x98\x98\x98\x98\x97\x98\x98\x98\x98\x98\x94\x86\x6E\x59\x42\x2E\x27\x24\x22\x1F\x1E\x20\x20\x1E\x1D\x1E\x1F\x1E" - "\x4C\x4B\x4A\x4B\x4F\x55\x5B\x60\x69\x6F\x75\x7A\x7F\x86\x90\x97\x98\x98\x98\x98\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x97" - "\x98\x98\x98\x98\x97\x97\x97\x97\x97\x97\x97\x98\x98\x98\x98\x98\x97\x92\x88\x7A\x5B\x3C\x29\x25\x22\x20\x20\x1F\x1C\x20\x21\x1F" - "\x24\x24\x23\x25\x24\x23\x23\x25\x25\x28\x2A\x2A\x2C\x2D\x2E\x35\x47\x55\x62\x6E\x7B\x82\x87\x8C\x92\x97\x98\x98\x98\x97\x97\x98" - "\x97\x98\x98\x98\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x98\x98\x97\x97\x92\x78\x54\x39\x2B\x22\x1E\x1F\x20\x1F\x1E" - "\x20\x1F\x1E\x1E\x20\x1F\x1F\x1F\x1F\x1F\x21\x23\x20\x21\x21\x24\x24\x25\x27\x2A\x2D\x35\x40\x4A\x58\x66\x76\x83\x91\x97\x97\x98" - "\x98\x98\x98\x98\x98\x98\x97\x97\x98\x97\x97\x97\x97\x97\x97\x97\x98\x97\x98\x98\x98\x98\x98\x94\x7C\x61\x44\x2F\x28\x22\x20\x20" - "\x1F\x1D\x1F\x20\x1F\x1E\x1E\x1F\x1E\x1E\x21\x20\x20\x20\x1E\x1F\x1F\x1F\x1E\x21\x22\x22\x23\x24\x27\x2A\x35\x3E\x4A\x56\x6D\x82" - "\x94\x98\x97\x97\x98\x98\x98\x98\x98\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x97\x94\x89\x74\x48\x2D\x26\x22" - "\x1F\x1E\x1E\x1F\x1E\x1F\x20\x20\x1F\x1F\x1F\x1F\x1F\x1F\x20\x1E\x1F\x1D\x1C\x1F\x20\x1F\x1F\x1F\x22\x21\x22\x26\x23\x25\x27\x2C" - "\x31\x46\x5E\x77\x88\x92\x97\x98\x98\x97\x97\x98\x97\x97\x98\x98\x97\x98\x98\x98\x98\x98\x98\x98\x98\x97\x98\x97\x96\x85\x5E\x42" - "\x1E\x1E\x1F\x20\x20\x20\x1F\x1D\x1E\x1F\x1D\x1F\x1F\x1F\x1F\x1F\x20\x21\x21\x20\x1F\x20\x20\x1E\x1F\x1F\x20\x20\x20\x20\x20\x21" - "\x24\x25\x29\x2D\x43\x59\x6E\x81\x93\x98\x98\x98\x98\x98\x98\x98\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x96\x88"; + "\x23\x1F\x1E\x1D\x1D\x1E\x1D\x1F\x23\x4A\x78\x71\x64\x58\x4B\x3E\x30\x29\x26\x24\x22\x21\x20" + "\x20\x20\x1D\x1E\x20\x1E\x1F\x20\x20" + "\x1F\x20\x21\x22\x1E\x1F\x1F\x1F\x1F\x1F\x1F\x1F\x1E\x1D\x1F\x20\x1F\x1F\x1F\x1E\x1E\x1F\x1F" + "\x20\x1E\x1F\x1F\x1F\x1E\x1D\x1E\x1C" + "\x3F\x2C\x28\x24\x21\x22\x20\x21\x25\x56\x94\x96\x97\x92\x8C\x86\x7F\x71\x61\x4D\x38\x2C\x29" + "\x26\x23\x21\x21\x20\x1F\x1F\x1E\x1E" + "\x20\x20\x20\x20\x1F\x20\x1F\x20\x1E\x1E\x1D\x1F\x1E\x1E\x21\x20\x1F\x1F\x1F\x1F\x1E\x1F\x1D" + "\x1F\x1F\x1F\x20\x1E\x1E\x1F\x1F\x1F" + "\x89\x83\x70\x5B\x44\x39\x2F\x27\x2C\x5B\x95\x96\x98\x98\x98\x98\x97\x97\x97\x97\x97\x8B\x76" + "\x5C\x47\x3B\x2F\x28\x23\x22\x21\x21" + "\x20\x1F\x1E\x1F\x20\x20\x20\x20\x1F\x1F\x21\x21\x1F\x1E\x1F\x1F\x1F\x1E\x20\x1F\x21\x20\x1F" + "\x1E\x1E\x1D\x1E\x1E\x1E\x1F\x21\x1E" + "\x8A\x8D\x8E\x8F\x8B\x7C\x6B\x5B\x4B\x66\x96\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98" + "\x98\x90\x81\x70\x5F\x4C\x39\x2B\x24" + "\x21\x21\x1E\x1E\x1F\x1E\x20\x1F\x1E\x20\x21\x21\x1D\x1D\x1E\x1E\x21\x21\x20\x20\x21\x21\x1F" + "\x1F\x1F\x1E\x1E\x1E\x20\x1F\x1F\x1F" + "\x8A\x8D\x8E\x8F\x91\x92\x95\x92\x89\x8C\x97\x97\x99\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98" + "\x98\x98\x98\x98\x95\x8D\x82\x6E\x4C" + "\x2F\x2A\x23\x20\x21\x1F\x1F\x20\x1F\x1F\x1E\x1D\x1D\x1D\x1D\x1F\x1F\x1E\x1E\x20\x20\x1E\x1E" + "\x1E\x1E\x1E\x1F\x20\x20\x20\x1F\x1E" + "\x8A\x8D\x8F\x90\x91\x92\x95\x94\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x97\x97\x98\x98" + "\x98\x98\x98\x98\x98\x98\x97\x97\x97" + "\x8D\x6C\x4B\x34\x27\x22\x21\x1E\x1D\x1F\x20\x1F\x1F\x1E\x1E\x20\x1F\x1F\x1E\x20\x1F\x1F\x1E" + "\x1F\x1E\x1F\x21\x24\x1F\x1F\x20\x20" + "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x97\x97\x97\x97" + "\x97\x97\x97\x98\x98\x98\x98\x98\x98" + "\x98\x98\x8E\x76\x51\x31\x24\x21\x1F\x1F\x1E\x1E\x1F\x1F\x1F\x1F\x20\x1E\x20\x21\x1E\x1F\x1F" + "\x1E\x1F\x20\x20\x20\x1D\x1E\x1F\x20" + "\x8A\x8D\x8F\x90\x91\x93\x95\x95\x95\x95\x96\x96\x98\x98\x98\x98\x98\x98\x98\x98\x97\x97\x96" + "\x97\x98\x97\x97\x8E\x7C\x6D\x64\x72" + "\x89\x96\x98\x98\x8E\x6B\x38\x25\x1E\x1E\x1F\x20\x1F\x20\x1F\x1F\x1F\x1F\x1F\x1E\x1E\x1E\x21" + "\x1F\x1F\x20\x20\x1F\x1D\x1E\x1D\x1E" + "\x8A\x8D\x8F\x90\x91\x93\x95\x95\x95\x95\x96\x96\x98\x98\x98\x98\x98\x98\x98\x98\x99\x98\x97" + "\x98\x96\x87\x62\x39\x2E\x2E\x2F\x2F" + "\x32\x45\x74\x92\x98\x98\x7D\x3E\x22\x20\x21\x22\x1E\x1E\x21\x1E\x1F\x1F\x20\x1E\x20\x1E\x1D" + "\x1E\x1F\x1E\x1E\x1F\x1E\x1E\x1D\x1E" + "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x97" + "\x98\x7D\x47\x31\x30\x49\x55\x5B\x52" + "\x3D\x30\x37\x5D\x92\x98\x97\x72\x2C\x23\x1F\x1E\x20\x1F\x21\x1F\x1F\x1F\x20\x21\x20\x1E\x1D" + "\x1D\x1E\x1E\x21\x20\x1F\x1F\x1E\x1D" + "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x97" + "\x91\x45\x2F\x3E\x6D\x8B\x91\x93\x8F" + "\x81\x59\x32\x31\x68\x97\x97\x94\x4D\x26\x22\x1E\x22\x21\x21\x1E\x1F\x20\x20\x21\x1E\x20\x1E" + "\x1F\x20\x1E\x1E\x20\x1F\x1F\x1F\x1E" + "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x97\x97\x93" + "\x56\x2F\x44\x81\x97\x98\x97\x94\x91" + "\x96\x96\x69\x33\x3A\x79\x97\x97\x81\x37\x24\x1E\x20\x20\x20\x20\x1E\x20\x1F\x1F\x1F\x1F\x1E" + "\x1E\x21\x1E\x1E\x20\x1F\x20\x1F\x1F" + "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x97\x98\x82" + "\x3E\x35\x6C\x96\x98\x96\x82\x63\x57" + "\x69\x88\x8F\x4C\x2F\x59\x92\x97\x91\x58\x28\x1F\x20\x1F\x20\x20\x1F\x1F\x1F\x20\x1F\x1F\x1F" + "\x1D\x1E\x1F\x1E\x20\x1F\x1F\x1E\x1E" + "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x97\x98\x72" + "\x36\x3F\x86\x98\x98\x8F\x57\x32\x2C" + "\x35\x62\x94\x6A\x2F\x4E\x8B\x97\x97\x75\x34\x22\x21\x1F\x1F\x20\x20\x21\x20\x1E\x21\x22\x1F" + "\x1D\x1F\x1F\x1E\x1F\x1F\x1F\x1F\x1E" + "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x98\x98\x98\x98\x98\x97\x97\x97\x97\x98\x61" + "\x2E\x44\x93\x98\x97\x94\x70\x46\x3E" + "\x4D\x79\x97\x80\x31\x44\x82\x98\x98\x8E\x50\x26\x1F\x1E\x1E\x20\x21\x20\x1E\x1F\x21\x20\x1F" + "\x1D\x1E\x1F\x1D\x1F\x1D\x1D\x1F\x1F" + "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x98\x98\x97\x98\x98\x98\x98\x98\x97\x98\x69" + "\x31\x41\x8D\x98\x97\x97\x95\x8A\x80" + "\x8D\x97\x97\x7A\x2F\x45\x83\x98\x98\x97\x68\x2E\x20\x1E\x1F\x1F\x1E\x1E\x1F\x20\x1F\x1F\x1F" + "\x20\x1F\x1E\x1D\x1F\x1F\x1E\x1F\x20" + "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x98\x97\x97\x98\x98\x98\x98\x99\x97\x98\x77" + "\x38\x39\x7E\x98\x98\x98\x98\x97\x97" + "\x98\x98\x98\x61\x2F\x50\x8E\x98\x98\x98\x80\x3A\x21\x1F\x1F\x21\x1F\x20\x1F\x20\x1E\x1F\x1F" + "\x20\x20\x1F\x20\x21\x1E\x1D\x1F\x1D" + "\x8A\x8D\x8F\x90\x92\x93\x95\x95\x96\x96\x97\x97\x96\x8F\x94\x97\x98\x98\x97\x97\x97\x97\x89" + "\x47\x2E\x52\x8D\x97\x98\x98\x97\x98" + "\x98\x97\x7C\x3B\x31\x65\x97\x98\x98\x98\x96\x4D\x26\x1F\x20\x1D\x1D\x1D\x20\x20\x1F\x1F\x1F" + "\x1E\x1F\x1E\x20\x21\x1F\x1F\x1E\x20" + "\x8A\x8C\x8F\x90\x92\x93\x94\x95\x96\x96\x96\x97\x94\x76\x68\x87\x98\x98\x98\x98\x97\x97\x97" + "\x72\x2F\x34\x5D\x8B\x98\x98\x97\x98" + "\x95\x7D\x49\x2E\x47\x86\x98\x98\x99\x98\x98\x69\x27\x20\x1F\x1E\x1C\x1E\x20\x20\x1E\x1E\x1F" + "\x1D\x1F\x1E\x1F\x1E\x20\x20\x1F\x1F" + "\x8A\x8D\x8F\x90\x92\x93\x94\x95\x96\x96\x96\x97\x97\x7F\x49\x45\x72\x94\x98\x98\x98\x98\x98" + "\x94\x51\x2E\x31\x49\x6F\x83\x88\x7F" + "\x61\x3E\x2E\x32\x7C\x97\x98\x98\x98\x98\x98\x86\x2D\x23\x1F\x1E\x1F\x20\x21\x20\x1F\x1F\x1E" + "\x1D\x1E\x1E\x1F\x1D\x1E\x1F\x1F\x1F" + "\x8A\x8D\x8F\x90\x92\x93\x94\x95\x96\x96\x96\x97\x98\x94\x5D\x2E\x2C\x46\x76\x8D\x97\x98\x98" + "\x98\x91\x67\x3C\x2C\x2D\x2E\x2E\x2E" + "\x2D\x32\x4B\x79\x98\x98\x98\x98\x98\x97\x97\x97\x3F\x23\x1F\x1F\x1D\x1F\x1F\x1E\x1F\x1F\x1F" + "\x1F\x1D\x1F\x21\x20\x1F\x1F\x1F\x1F" + "\x8B\x8D\x8F\x91\x92\x93\x94\x95\x96\x96\x96\x97\x98\x98\x7A\x39\x28\x28\x32\x4E\x74\x8F\x98" + "\x98\x98\x94\x7A\x5E\x4C\x3A\x39\x42" + "\x52\x6A\x8B\x97\x98\x98\x98\x98\x98\x98\x96\x80\x39\x23\x20\x1F\x1E\x20\x20\x1F\x21\x20\x1F" + "\x1F\x20\x1F\x1F\x1F\x1E\x20\x1F\x20" + "\x8C\x8D\x8F\x91\x92\x93\x95\x95\x96\x96\x97\x97\x98\x98\x93\x62\x30\x29\x26\x27\x34\x4C\x72" + "\x93\x98\x98\x97\x94\x8C\x84\x83\x88" + "\x8E\x95\x98\x98\x98\x98\x98\x98\x97\x8C\x62\x3D\x25\x21\x20\x1F\x1E\x1F\x20\x20\x1F\x20\x20" + "\x20\x1F\x20\x1E\x1E\x20\x1F\x1F\x1F" + "\x8C\x8E\x90\x91\x93\x93\x95\x95\x96\x96\x97\x97\x98\x98\x97\x97\x8B\x64\x46\x33\x28\x27\x2B" + "\x3A\x61\x7E\x8C\x95\x98\x98\x98\x98" + "\x97\x97\x97\x98\x98\x97\x93\x89\x62\x38\x29\x22\x21\x1F\x1F\x1E\x20\x20\x20\x21\x1F\x1F\x20" + "\x1E\x1E\x20\x1F\x20\x1F\x1F\x1F\x1F" + "\x8D\x8F\x90\x92\x93\x94\x95\x95\x96\x96\x97\x97\x98\x98\x98\x98\x98\x96\x8A\x6F\x4B\x32\x29" + "\x27\x29\x34\x4A\x61\x78\x83\x8E\x97" + "\x98\x98\x97\x95\x86\x74\x5F\x44\x2B\x2A\x2C\x30\x21\x1E\x20\x1E\x1F\x1F\x1F\x20\x1F\x1D\x1F" + "\x1E\x1E\x1F\x20\x21\x1E\x20\x20\x1E" + "\x8D\x8F\x90\x92\x93\x94\x95\x96\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x97\x8C\x79\x57" + "\x37\x2C\x29\x28\x29\x35\x3C\x45\x50" + "\x57\x52\x4D\x4A\x3F\x34\x2A\x2A\x2F\x49\x6F\x70\x25\x1F\x1F\x1F\x20\x1F\x1E\x1F\x20\x1F\x20" + "\x1E\x1E\x1E\x20\x21\x1D\x1F\x1F\x1F" + "\x8E\x90\x91\x92\x93\x94\x95\x96\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x97\x98\x97\x98" + "\x94\x77\x58\x42\x32\x28\x28\x27\x28" + "\x27\x2A\x2A\x2A\x2C\x35\x42\x58\x85\x97\x97\x6B\x28\x20\x20\x20\x1E\x1F\x1F\x1D\x1F\x1F\x1F" + "\x1F\x1F\x1C\x1D\x1F\x1E\x1F\x1F\x20" + "\x8F\x90\x92\x93\x93\x95\x95\x96\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98" + "\x98\x98\x96\x89\x74\x62\x59\x4D\x42" + "\x38\x3F\x48\x51\x62\x74\x86\x95\x98\x98\x92\x4E\x26\x21\x20\x1F\x1E\x1F\x20\x1D\x20\x20\x1F" + "\x1F\x1D\x1D\x1E\x1F\x20\x1F\x20\x20" + "\x8F\x90\x92\x93\x94\x95\x95\x96\x96\x97\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98" + "\x98\x98\x98\x98\x98\x96\x92\x8D\x88" + "\x84\x87\x8B\x8F\x95\x98\x98\x98\x98\x98\x75\x35\x23\x1E\x20\x1E\x1D\x1F\x20\x20\x1F\x1D\x1E" + "\x20\x1D\x1F\x1E\x1F\x1F\x1E\x1F\x1F" + "\x90\x91\x92\x93\x94\x95\x96\x96\x96\x97\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98" + "\x98\x98\x98\x98\x98\x98\x98\x97\x97" + "\x98\x98\x98\x98\x98\x98\x97\x98\x8B\x69\x39\x27\x20\x1E\x1E\x1D\x1F\x20\x1F\x1F\x1F\x1F\x1F" + "\x1E\x1D\x1F\x20\x1E\x20\x1F\x21\x20" + "\x90\x92\x93\x94\x95\x95\x96\x96\x96\x97\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98" + "\x98\x98\x98\x98\x98\x98\x98\x97\x97" + "\x98\x98\x98\x98\x97\x97\x8D\x73\x4D\x2E\x24\x21\x1E\x1E\x1D\x1D\x1F\x1E\x1E\x1E\x1E\x20\x20" + "\x20\x1F\x1E\x1D\x1F\x20\x20\x1E\x1F" + "\x91\x92\x93\x94\x95\x95\x96\x96\x96\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x97\x98\x98\x98" + "\x98\x97\x97\x98\x98\x98\x98\x98\x98" + "\x99\x98\x99\x98\x8D\x68\x47\x32\x26\x23\x22\x20\x1C\x1D\x1E\x20\x1F\x1F\x1E\x20\x1D\x1E\x1E" + "\x1E\x1C\x1E\x1D\x1E\x1F\x20\x1E\x1E" + "\x92\x93\x92\x94\x95\x95\x95\x95\x97\x97\x97\x98\x99\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98" + "\x99\x97\x97\x97\x98\x97\x97\x97\x93" + "\x8B\x83\x6D\x4E\x30\x29\x24\x22\x20\x1F\x20\x20\x1F\x1F\x1E\x20\x22\x20\x20\x20\x1C\x1E\x1F" + "\x1E\x1F\x1F\x20\x20\x1E\x20\x21\x1E" + "\x92\x93\x93\x94\x94\x8C\x80\x7D\x77\x77\x7D\x83\x8A\x8E\x92\x96\x98\x98\x98\x98\x98\x98\x98" + "\x97\x98\x97\x91\x8B\x81\x77\x68\x5B" + "\x4A\x38\x2B\x27\x22\x20\x20\x20\x1F\x1D\x1E\x1F\x1F\x1F\x1F\x20\x1F\x1E\x20\x20\x1F\x1E\x1F" + "\x20\x1E\x1E\x1D\x1E\x1F\x1F\x1F\x1E" + "\x92\x94\x94\x94\x69\x49\x3C\x38\x33\x33\x37\x3C\x42\x43\x45\x4C\x55\x5C\x65\x6D\x6B\x68\x65" + "\x61\x59\x4E\x47\x42\x3C\x34\x2A\x27" + "\x23\x23\x22\x20\x22\x20\x20\x20\x21\x1F\x20\x20\x1F\x1F\x1E\x21\x20\x1E\x1F\x20\x20\x1F\x20" + "\x1F\x1F\x1E\x1C\x1C\x20\x1F\x1F\x1F" + "\x92\x94\x91\x5D\x2D\x22\x1E\x20\x1E\x1F\x22\x23\x23\x23\x25\x25\x25\x25\x24\x27\x28\x26\x27" + "\x26\x23\x24\x23\x22\x21\x21\x1F\x21" + "\x20\x1F\x1E\x1F\x1F\x1F\x1E\x1F\x20\x20\x21\x21\x20\x1F\x1F\x21\x1F\x1F\x20\x20\x21\x1F\x20" + "\x1F\x1F\x20\x1F\x1F\x1D\x1F\x20\x1F" + "\x94\x95\x7A\x39\x23\x1F\x1D\x1D\x1D\x1F\x20\x1F\x1F\x20\x20\x1F\x1E\x20\x20\x1F\x20\x21\x20" + "\x20\x20\x1F\x20\x1F\x20\x1D\x1D\x1F" + "\x1E\x1F\x1F\x21\x22\x20\x1D\x1E\x20\x21\x21\x1F\x1F\x1D\x1D\x21\x1F\x1F\x1F\x20\x21\x1F\x20" + "\x1F\x1F\x21\x20\x1E\x1F\x1F\x1F\x1F" + "\x94\x94\x60\x2A\x20\x1D\x1D\x1F\x1D\x1F\x20\x21\x1F\x1E\x1F\x1F\x1F\x20\x20\x1E\x1F\x20\x20" + "\x1D\x20\x1F\x20\x20\x1F\x1F\x1E\x1F" + "\x1F\x1F\x1F\x1E\x1F\x20\x1F\x1F\x1E\x20\x1E\x1E\x1F\x1F\x1F\x20\x1F\x1F\x20\x21\x1E\x1F\x20" + "\x20\x1F\x1F\x21\x1F\x1F\x1F\x1F\x1D" + "\x94\x8E\x52\x26\x1F\x1D\x1E\x1E\x1E\x1F\x1F\x20\x1F\x1F\x1F\x20\x22\x21\x20\x20\x1F\x20\x20" + "\x1F\x1F\x1F\x20\x21\x21\x20\x20\x20" + "\x1F\x21\x1E\x1D\x20\x1F\x20\x1E\x1D\x1F\x1E\x1F\x1F\x1E\x1F\x1E\x1F\x1F\x1F\x1F\x1E\x1D\x1E" + "\x20\x20\x1F\x1F\x1E\x1F\x20\x1F\x1F" + "\x94\x8C\x4F\x25\x1D\x1F\x20\x1E\x1D\x1E\x1E\x1E\x1F\x1F\x20\x20\x21\x20\x20\x1F\x1F\x1E\x1E" + "\x20\x1E\x1E\x20\x20\x20\x1F\x20\x20" + "\x20\x1F\x1D\x1E\x20\x20\x1F\x1F\x20\x20\x20\x20\x1F\x1E\x1E\x1E\x1F\x20\x20\x1F\x1F\x1E\x1E" + "\x1E\x1E\x1E\x1E\x1E\x1F\x20\x1F\x1E" + "\x95\x8A\x4D\x25\x1C\x1D\x1D\x1E\x1E\x1E\x1F\x1F\x20\x21\x1F\x1D\x1F\x20\x21\x1F\x1C\x1E\x1F" + "\x1F\x1E\x20\x1F\x20\x21\x20\x20\x22" + "\x20\x20\x20\x20\x1E\x20\x1F\x1F\x20\x1E\x1E\x1C\x1C\x1E\x1F\x1E\x20\x1F\x1F\x20\x20\x1F\x1F" + "\x21\x1E\x20\x1E\x1E\x1E\x20\x20\x1E" + "\x96\x8F\x50\x25\x20\x1F\x1F\x1F\x20\x20\x20\x1F\x21\x22\x21\x21\x1F\x1F\x1F\x1F\x1E\x1F\x20" + "\x1F\x21\x20\x20\x21\x1F\x20\x20\x1F" + "\x1F\x1E\x1F\x1E\x1D\x1E\x1F\x20\x1F\x1E\x1D\x1D\x1D\x1E\x20\x1F\x1F\x1F\x1E\x1E\x21\x1F\x1F" + "\x1F\x1F\x1F\x1E\x1E\x1E\x1E\x1F\x20" + "\x96\x92\x56\x26\x1F\x1D\x1F\x20\x1D\x1F\x20\x21\x1E\x20\x1F\x1F\x20\x1F\x1E\x1E\x1F\x1E\x1F" + "\x1F\x20\x20\x20\x21\x1F\x21\x1F\x1F" + "\x1F\x1D\x1F\x1F\x1E\x1E\x1F\x21\x20\x1F\x1E\x1F\x20\x1F\x1E\x1F\x1E\x1E\x1E\x20\x1E\x1E\x1F" + "\x1E\x1F\x1F\x1F\x1F\x1E\x20\x1F\x1E" + "\x96\x96\x66\x2D\x1D\x1D\x1F\x21\x1F\x20\x20\x22\x1F\x1E\x1F\x1B\x1C\x20\x1F\x21\x1E\x1E\x1F" + "\x1F\x20\x1E\x1F\x20\x1F\x21\x20\x20" + "\x21\x20\x21\x1F\x20\x20\x20\x1E\x20\x1F\x1F\x1E\x1E\x1F\x20\x1E\x1E\x1F\x1E\x1D\x1E\x1F\x20" + "\x1E\x1F\x20\x1E\x1E\x1E\x20\x1F\x1E" + "\x96\x97\x7A\x36\x20\x21\x21\x20\x1F\x1E\x1F\x20\x1E\x1F\x20\x1F\x1D\x1D\x1E\x20\x1F\x1F\x1F" + "\x1E\x1F\x20\x20\x1F\x1F\x1F\x1F\x1E" + "\x1F\x21\x1E\x1D\x1F\x1F\x20\x20\x1E\x1E\x1F\x1F\x1E\x1E\x1F\x1E\x1F\x1F\x1F\x1F\x21\x20\x20" + "\x1D\x21\x20\x1F\x20\x1E\x20\x1F\x1E" + "\x97\x97\x8C\x3F\x22\x21\x20\x20\x1F\x21\x1F\x1E\x1F\x1F\x20\x1F\x20\x20\x20\x22\x1F\x20\x21" + "\x1F\x1E\x1F\x21\x1F\x1F\x20\x1F\x1E" + "\x1D\x1D\x1F\x1F\x1E\x1F\x20\x1F\x1E\x1F\x20\x22\x21\x1E\x1C\x1D\x1F\x20\x20\x1F\x1F\x1F\x1E" + "\x1D\x1E\x1E\x1E\x20\x1E\x1E\x1F\x1F" + "\x97\x97\x95\x51\x26\x22\x20\x22\x20\x1F\x1F\x20\x1E\x1F\x1E\x1F\x1F\x1F\x1F\x1E\x1E\x1F\x20" + "\x1F\x1F\x1E\x20\x20\x1E\x1F\x20\x1F" + "\x1F\x20\x20\x1F\x1F\x20\x20\x1F\x21\x20\x1F\x21\x21\x20\x1E\x1E\x21\x21\x1F\x1E\x1E\x1E\x1E" + "\x1F\x1D\x1D\x1E\x1F\x1E\x1D\x1F\x20" + "\x97\x98\x98\x79\x2B\x23\x1F\x1E\x1F\x20\x21\x20\x20\x21\x1E\x1D\x1F\x1E\x1F\x21\x20\x1F\x1F" + "\x1F\x20\x20\x20\x1E\x21\x20\x1F\x1F" + "\x1D\x1E\x1F\x1F\x1F\x1F\x1F\x1E\x1F\x20\x20\x20\x20\x1E\x1F\x1E\x1F\x21\x20\x1F\x1F\x1F\x1E" + "\x21\x20\x1E\x1F\x1E\x20\x1F\x1F\x1D" + "\x98\x98\x98\x93\x40\x25\x20\x1E\x20\x21\x1F\x20\x1F\x1F\x21\x20\x20\x1F\x1F\x1F\x1E\x20\x22" + "\x20\x1F\x20\x20\x1D\x21\x20\x1F\x1E" + "\x1E\x20\x1E\x1E\x20\x1F\x1F\x1F\x1E\x21\x20\x1F\x1E\x1D\x1F\x21\x1F\x1F\x1F\x20\x20\x1F\x1F" + "\x20\x20\x20\x1F\x1D\x1F\x1F\x1E\x1C" + "\x98\x98\x98\x97\x6A\x2F\x28\x26\x28\x26\x25\x26\x23\x24\x25\x23\x21\x22\x20\x22\x1F\x23\x21" + "\x1D\x1E\x20\x20\x1E\x1E\x1E\x1F\x1F" + "\x1F\x20\x21\x20\x20\x1F\x1F\x1E\x1E\x1F\x20\x1D\x1E\x1E\x1F\x1F\x20\x20\x1F\x20\x20\x1E\x20" + "\x1D\x1F\x20\x1F\x1E\x1F\x1F\x1E\x1E" + "\x98\x98\x98\x97\x93\x78\x6F\x6A\x64\x5F\x5B\x57\x4F\x4D\x4B\x49\x45\x3E\x38\x33\x2A\x2A\x29" + "\x26\x27\x23\x23\x21\x20\x1F\x1E\x1F" + "\x1D\x1F\x1F\x1D\x1D\x1E\x1E\x1E\x21\x20\x20\x1E\x21\x1E\x1F\x1F\x1E\x20\x1F\x1F\x1F\x1F\x20" + "\x1E\x20\x1E\x21\x20\x20\x1F\x1F\x20" + "\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x97\x95\x93\x8D\x85\x7D\x74\x6A\x62\x59" + "\x51\x46\x3B\x30\x2B\x2A\x27\x24\x24" + "\x22\x20\x1F\x1F\x1E\x1E\x1F\x1F\x20\x20\x20\x20\x1E\x1F\x1F\x20\x1F\x1F\x1F\x1F\x20\x1F\x1F" + "\x1F\x20\x1F\x20\x20\x1F\x20\x20\x20" + "\x98\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x97\x98\x98\x98\x98\x98\x97\x98\x97\x96\x92" + "\x8F\x89\x85\x80\x78\x6A\x59\x42\x30" + "\x2C\x28\x23\x21\x22\x1F\x20\x1E\x20\x21\x1F\x1F\x1F\x20\x20\x1F\x1F\x1F\x20\x1F\x1F\x1E\x1D" + "\x20\x1F\x21\x20\x1E\x1F\x1F\x1F\x1F" + "\x98\x97\x98\x98\x97\x98\x98\x97\x98\x98\x98\x98\x97\x98\x98\x98\x98\x98\x97\x97\x98\x98\x98" + "\x97\x98\x98\x98\x97\x97\x97\x97\x91" + "\x7D\x69\x54\x46\x38\x2F\x27\x26\x23\x22\x1E\x1D\x1F\x1E\x1E\x20\x20\x20\x1E\x1E\x1E\x1D\x1E" + "\x1F\x1E\x20\x21\x20\x21\x1E\x1C\x1F" + "\x98\x98\x98\x98\x97\x98\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x97\x97\x98\x98\x98" + "\x98\x98\x98\x98\x98\x98\x98\x98\x98" + "\x97\x98\x96\x8E\x7E\x70\x62\x53\x41\x31\x27\x23\x22\x21\x1F\x20\x20\x20\x1F\x1E\x1E\x1E\x1F" + "\x1F\x21\x1E\x1F\x1F\x1E\x1F\x20\x1F" + "\x98\x98\x98\x97\x98\x98\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x97\x98\x98\x98\x98\x98\x98" + "\x98\x97\x98\x98\x98\x98\x98\x98\x98" + "\x97\x98\x98\x97\x97\x97\x95\x90\x88\x7C\x64\x45\x2D\x28\x25\x22\x21\x20\x1F\x1F\x1F\x1F\x20" + "\x21\x22\x20\x20\x20\x20\x20\x1F\x20" + "\x98\x97\x97\x98\x98\x98\x97\x97\x98\x98\x97\x97\x97\x98\x98\x97\x97\x97\x97\x98\x98\x98\x98" + "\x98\x97\x98\x98\x98\x97\x97\x98\x98" + "\x98\x98\x98\x98\x98\x97\x97\x98\x98\x97\x97\x97\x89\x6C\x4F\x3D\x30\x28\x24\x21\x1E\x1F\x1F" + "\x1E\x1D\x1D\x1F\x1F\x1D\x1E\x20\x1F" + "\x96\x95\x94\x96\x98\x98\x98\x98\x98\x97\x98\x98\x98\x98\x98\x98\x97\x97\x98\x98\x98\x98\x98" + "\x98\x98\x98\x98\x98\x98\x98\x98\x97" + "\x98\x98\x98\x98\x98\x98\x98\x98\x97\x98\x98\x98\x98\x98\x94\x86\x6E\x59\x42\x2E\x27\x24\x22" + "\x1F\x1E\x20\x20\x1E\x1D\x1E\x1F\x1E" + "\x4C\x4B\x4A\x4B\x4F\x55\x5B\x60\x69\x6F\x75\x7A\x7F\x86\x90\x97\x98\x98\x98\x98\x97\x97\x98" + "\x98\x98\x98\x98\x98\x98\x98\x98\x97" + "\x98\x98\x98\x98\x97\x97\x97\x97\x97\x97\x97\x98\x98\x98\x98\x98\x97\x92\x88\x7A\x5B\x3C\x29" + "\x25\x22\x20\x20\x1F\x1C\x20\x21\x1F" + "\x24\x24\x23\x25\x24\x23\x23\x25\x25\x28\x2A\x2A\x2C\x2D\x2E\x35\x47\x55\x62\x6E\x7B\x82\x87" + "\x8C\x92\x97\x98\x98\x98\x97\x97\x98" + "\x97\x98\x98\x98\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x98\x98\x97\x97\x92\x78" + "\x54\x39\x2B\x22\x1E\x1F\x20\x1F\x1E" + "\x20\x1F\x1E\x1E\x20\x1F\x1F\x1F\x1F\x1F\x21\x23\x20\x21\x21\x24\x24\x25\x27\x2A\x2D\x35\x40" + "\x4A\x58\x66\x76\x83\x91\x97\x97\x98" + "\x98\x98\x98\x98\x98\x98\x97\x97\x98\x97\x97\x97\x97\x97\x97\x97\x98\x97\x98\x98\x98\x98\x98" + "\x94\x7C\x61\x44\x2F\x28\x22\x20\x20" + "\x1F\x1D\x1F\x20\x1F\x1E\x1E\x1F\x1E\x1E\x21\x20\x20\x20\x1E\x1F\x1F\x1F\x1E\x21\x22\x22\x23" + "\x24\x27\x2A\x35\x3E\x4A\x56\x6D\x82" + "\x94\x98\x97\x97\x98\x98\x98\x98\x98\x97\x97\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98\x98" + "\x98\x97\x94\x89\x74\x48\x2D\x26\x22" + "\x1F\x1E\x1E\x1F\x1E\x1F\x20\x20\x1F\x1F\x1F\x1F\x1F\x1F\x20\x1E\x1F\x1D\x1C\x1F\x20\x1F\x1F" + "\x1F\x22\x21\x22\x26\x23\x25\x27\x2C" + "\x31\x46\x5E\x77\x88\x92\x97\x98\x98\x97\x97\x98\x97\x97\x98\x98\x97\x98\x98\x98\x98\x98\x98" + "\x98\x98\x97\x98\x97\x96\x85\x5E\x42" + "\x1E\x1E\x1F\x20\x20\x20\x1F\x1D\x1E\x1F\x1D\x1F\x1F\x1F\x1F\x1F\x20\x21\x21\x20\x1F\x20\x20" + "\x1E\x1F\x1F\x20\x20\x20\x20\x20\x21" + "\x24\x25\x29\x2D\x43\x59\x6E\x81\x93\x98\x98\x98\x98\x98\x98\x98\x97\x98\x98\x98\x98\x98\x98" + "\x98\x98\x98\x98\x98\x98\x98\x96\x88"; BYTE TEST_64X64_RED_PLANE_RLE[3739] = - "\xF0\x23\x1F\x1E\x1D\x1D\x1E\x1D\x1F\x23\x4A\x78\x71\x64\x58\x4B\xF0\x3E\x30\x29\x26\x24\x22\x21\x20\x20\x20\x1D\x1E\x20\x1E\x1F" - "\x86\x20\x20\x1F\x20\x21\x22\x1E\x1F\xF0\x1E\x1D\x1F\x20\x1F\x1F\x1F\x1E\x1E\x1F\x1F\x20\x1E\x1F\x1F\x50\x1F\x1E\x1D\x1E\x1C\xF0" - "\x38\x1A\x14\x0E\x08\x08\x06\x04\x04\x18\x38\x4A\x66\x74\x82\xF0\x90\x9E\x90\x76\x52\x2C\x16\x12\x0C\x06\x08\x06\x00\x02\x00\xF0" - "\x03\x03\x02\x00\x01\x03\x02\x02\x00\x02\x01\x01\x03\x00\x00\x33\x02\x04\x00\xD0\x02\x00\x00\x03\x01\x02\x00\x02\x01\x00\x04\x02" - "\x06\xF0\x94\xAE\x90\x6E\x46\x2E\x1E\x0C\x0E\x0A\x02\x00\x02\x0C\x18\xF0\x24\x30\x4C\x6C\x94\xBE\xBE\x9A\x6C\x48\x34\x1C\x10\x08" - "\x06\xF0\x06\x06\x00\x01\x03\x01\x02\x00\x02\x00\x02\x02\x08\x04\x02\xF0\x00\x03\x01\x00\x01\x02\x00\x06\x02\x04\x01\x01\x03\x03" - "\x00\x40\x00\x00\x04\x01\xD3\x02\x14\x3C\x68\x8E\x86\x78\x68\x3E\x16\x02\x02\x00\x14\x02\xF0\x1A\x44\x78\x92\x8C\x82\x6E\x52\x2E" - "\x14\x06\x02\x04\x00\x01\xF0\x01\x03\x00\x01\x01\x02\x00\x00\x03\x01\x01\x01\x04\x06\x00\xD0\x02\x00\x02\x00\x02\x02\x02\x00\x00" - "\x04\x00\x03\x02\x04\xAA\x0C\x2C\x54\x6E\x7C\x4C\x02\x00\x02\x00\xF0\x10\x2E\x50\x6C\x82\x92\x86\x50\x1C\x12\x0A\x04\x04\x02\x01" - "\xF0\x02\x02\x01\x05\x07\x00\x00\x01\x02\x03\x05\x03\x00\x01\x05\xA0\x01\x01\x01\x00\x02\x04\x00\x02\x00\x01\xE5\x00\x00\x02\x02" - "\x00\x00\x00\x04\x1A\x14\x00\x00\x01\x00\x35\x01\x01\x00\xF0\x06\x16\x2A\x52\x96\xBC\x84\x50\x28\x0C\x06\x04\x03\x03\x00\xF0\x04" - "\x04\x04\x02\x02\x02\x00\x02\x00\x00\x01\x02\x00\x02\x00\x70\x02\x04\x08\x01\x01\x02\x04\x04\x5C\x02\x02\x00\x02\x00\x14\x01\xF0" - "\x00\x00\x00\x02\x02\x02\x16\x58\x86\x84\x54\x1E\x06\x06\x04\xF0\x00\x03\x01\x00\x02\x02\x01\x02\x01\x04\x02\x01\x00\x02\x01\x80" - "\x02\x02\x01\x07\x03\x01\x01\x00\x04\x53\x01\x00\x00\x00\x01\x16\x00\xF0\x02\x00\x00\x01\x00\x02\x00\x01\x13\x37\x55\x67\x4B\x1D" - "\x03\xF0\x14\x44\x7A\x74\x28\x08\x01\x01\x02\x04\x00\x02\x00\x00\x01\xF0\x02\x01\x05\x00\x01\x04\x02\x00\x00\x00\x01\x00\x00\x03" - "\x03\x41\xF0\x04\x02\x02\x02\x03\x1F\x69\xA9\x9B\x7D\x69\x85\xAD\xA1\x47\xF0\x0B\x14\x5A\x8A\x32\x08\x04\x04\x04\x01\x03\x04\x01" - "\x00\x00\xE0\x02\x00\x04\x00\x07\x01\x00\x03\x03\x00\x02\x00\x00\x00\x04\x53\x02\x00\x00\x00\x02\x17\x00\xF0\x01\x00\x00\x00\x31" - "\x7F\x61\x11\x36\x4E\x58\x46\x16\x29\x79\xF0\x69\x0B\x00\x34\x68\x14\x06\x03\x07\x04\x02\x00\x02\x00\x00\xA3\x00\x06\x00\x00\x00" - "\x01\x01\x00\x06\x02\x10\x01\x71\xF0\x0D\x6F\x2F\x1A\x7A\x84\x78\x70\x7A\x88\x52\x09\x57\x53\x01\xF0\x00\x44\x42\x06\x06\x00\x04" - "\x04\x00\x01\x00\x02\x00\x00\x03\xB0\x04\x02\x04\x04\x00\x05\x00\x00\x00\x02\x02\x41\xF0\x01\x01\x07\x75\x2B\x2A\x86\x54\x1A\x0C" - "\x02\x04\x2A\x7A\x6E\xF0\x04\x5B\x3B\x00\x06\x68\x22\x04\x00\x03\x01\x01\x04\x01\x00\x83\x01\x03\x02\x01\x00\x01\x02\x00\x30\x02" - "\x00\x02\x51\xF0\x02\x21\x2F\x0C\x50\x2A\x02\x03\x29\x61\x73\x59\x1B\x4C\x32\xF0\x15\x3F\x09\x00\x20\x42\x08\x02\x00\x01\x00\x00" - "\x02\x01\x00\xD0\x02\x00\x00\x02\x01\x05\x02\x00\x00\x00\x01\x01\x01\x61\xF0\x1F\x0F\x14\x34\x04\x00\x0D\x55\x61\x55\x67\x4B\x0A" - "\x3C\x00\xF0\x15\x0D\x00\x0C\x3A\x18\x06\x02\x00\x01\x00\x02\x04\x02\x03\xC0\x04\x06\x00\x00\x02\x00\x00\x01\x00\x00\x02\x00\x11" - "\xF0\x01\x01\x01\x00\x00\x21\x0F\x0A\x1A\x00\x01\x0A\x32\x28\x24\xF0\x30\x2E\x06\x2C\x04\x13\x11\x02\x02\x32\x38\x08\x03\x01\x01" - "\xF0\x00\x02\x01\x03\x02\x00\x03\x00\x00\x01\x00\x01\x00\x03\x03\x20\x00\x02\x0E\xF0\x01\x00\x00\x02\x02\x02\x00\x00\x10\x06\x05" - "\x0B\x00\x00\x06\xF0\x4A\x88\x84\x80\x3C\x00\x0B\x03\x02\x02\x00\x00\x12\x30\x10\xF0\x02\x00\x02\x01\x05\x03\x02\x02\x03\x01\x00" - "\x06\x02\x01\x00\x50\x00\x04\x02\x00\x02\x0D\x24\x01\x00\xF0\x02\x00\x00\x1C\x0E\x0F\x1D\x00\x02\x02\x06\x1A\x2E\x16\x02\xF0\x02" - "\x31\x00\x16\x16\x00\x00\x02\x30\x18\x02\x02\x00\x04\x02\xF0\x04\x00\x00\x01\x00\x00\x00\x02\x02\x06\x04\x01\x01\x00\x05\x0C\xF0" - "\x03\x0F\x05\x01\x00\x00\x01\x03\x00\x01\x24\x1E\x15\x57\x15\xF0\x01\x00\x00\x00\x02\x00\x01\x37\x4B\x04\x2A\x12\x00\x00\x00\xF0" - "\x2C\x26\x0A\x00\x02\x07\x03\x05\x02\x00\x02\x00\x00\x03\x01\x70\x01\x00\x00\x02\x04\x01\x06\x33\x00\x01\x00\xF0\x01\x00\x00\x00" - "\x01\x00\x03\x31\x57\x1F\x00\x00\x02\x02\x00\x83\x00\x1C\x56\x02\x3B\x5F\x17\x00\xF0\x05\x33\x65\x19\x2C\x42\x02\x00\x02\x00\x04" - "\x38\x02\x02\x01\xF0\x02\x01\x02\x00\x00\x01\x01\x00\x01\x00\x00\x01\x05\x02\x02\x20\x02\x01\x39\x00\x02\x00\xF0\x06\x12\x3D\x83" - "\x4B\x07\x00\x00\x02\x02\x02\x44\x44\x0B\x57\xF0\x83\x51\x29\x1D\x31\x67\x7D\x35\x08\x6A\x22\x00\x00\x01\x00\xF0\x00\x3A\x0C\x06" - "\x00\x00\x06\x04\x02\x00\x02\x02\x01\x00\x01\x70\x00\x00\x01\x03\x01\x00\x00\x0C\xF0\x02\x2A\x28\x2D\x8B\x9B\x43\x15\x01\x00\x00" - "\x08\x80\x72\x16\xF0\x39\x83\xA9\xB3\xA1\x67\x17\x3A\x8E\x38\x02\x00\x00\x00\x01\xF0\x01\x22\x24\x00\x00\x02\x03\x01\x03\x03\x00" - "\x00\x02\x04\x01\x70\x02\x04\x06\x02\x00\x00\x00\x58\x02\x00\x00\x02\x00\xF0\x08\x3A\x16\x07\x3B\x87\x7D\x45\x11\x00\x00\x0E\x5A" - "\x7C\x64\x94\x3E\x18\x16\x28\x4A\x70\x80\x3C\x00\x83\x02\x01\x2D\x0B\x00\x02\x00\x02\xC0\x04\x02\x00\x00\x06\x00\x03\x01\x01\x02" - "\x00\x02\x24\x02\x00\xF0\x02\x00\x00\x00\x02\x00\x00\x00\x32\x52\x10\x02\x17\x4D\x7F\xF0\x85\x4B\x09\x00\x08\x3A\x6C\x80\x94\x94" - "\x8C\x78\x56\x1A\x02\x13\x00\xF0\x01\x17\x67\x85\x27\x03\x00\x00\x00\x01\x00\x02\x03\x00\x02\x90\x02\x01\x02\x01\x01\x04\x01\x00" - "\x01\x68\x00\x02\x02\x00\x02\x00\xF0\x08\x6A\xB6\x76\x40\x18\x17\x49\x8D\xB1\x6D\x33\x15\x02\x18\xF0\x28\x2A\x20\x12\x04\x01\x00" - "\x00\x01\x09\x1D\x69\xA7\x71\x35\xF0\x07\x03\x01\x01\x04\x02\x00\x02\x00\x01\x00\x03\x01\x00\x02\x50\x04\x01\x00\x00\x00\x77\x02" - "\x02\x00\x02\x00\x02\x00\xF0\x02\x02\x1A\x64\x88\x78\x46\x16\x03\x25\x6F\x93\x83\x67\x3F\xF0\x29\x13\x01\x02\x02\x00\x05\x23\x45" - "\x67\x89\x6D\x1B\x06\x1C\x53\x00\x01\x02\x00\x01\xC0\x00\x03\x01\x00\x00\x01\x02\x02\x01\x02\x02\x01\x07\x28\x02\x00\xF0\x04\x1C" - "\x50\x82\x8E\x5C\x20\x06\x15\x43\x6F\x85\x8D\x91\x8D\xF0\x81\x8B\x93\x95\x8D\x7F\x69\x33\x08\x3E\x86\x80\x08\x02\x01\xF0\x02\x02" - "\x00\x01\x01\x02\x04\x02\x00\x00\x01\x00\x00\x01\x01\x20\x01\x02\x4D\x02\x02\x02\x00\x03\xF0\x18\x3C\x82\xBA\x96\x5E\x34\x12\x19" - "\x27\x3B\x4F\x5F\x4F\x45\xF0\x3F\x25\x02\x30\x5C\xAC\x9C\x50\x09\x06\x02\x02\x02\x03\x00\xE0\x02\x03\x01\x00\x01\x02\x02\x03\x05" - "\x03\x02\x00\x00\x02\x7C\x02\x00\x02\x02\x00\x02\x00\xF0\x02\x00\x02\x00\x08\x42\x7C\x8E\x84\x74\x62\x4C\x34\x22\x2A\xF0\x3C\x4E" - "\x6C\x7E\x88\x7A\x26\x02\x09\x39\x03\x02\x00\x01\x00\xF0\x00\x02\x00\x02\x02\x00\x00\x03\x02\x02\x00\x04\x00\x02\x00\x04\x23\x02" - "\x00\x2E\x02\x00\xF0\x04\x1E\x48\x68\x72\x80\x8C\x98\x90\x86\x7C\x66\x48\x24\x06\xF0\x00\x00\x39\x31\x05\x05\x00\x01\x01\x00\x00" - "\x06\x01\x05\x01\x63\x02\x00\x04\x00\x00\x01\x33\x02\x02\x00\x2F\x02\x00\x05\xF0\x04\x0C\x14\x1E\x28\x22\x1A\x12\x06\x00\x01\x00" - "\x19\x5D\x77\xF0\x1B\x05\x00\x03\x01\x04\x02\x01\x01\x00\x04\x02\x03\x00\x00\x60\x04\x01\x02\x02\x04\x02\x23\x00\x02\x1F\x00\x0F" - "\xF0\x01\x01\x13\x49\x7B\x75\x29\x0B\x03\x00\x01\x00\x00\x03\x01\xD0\x01\x01\x02\x02\x04\x04\x01\x05\x02\x00\x02\x05\x01\x29\x02" - "\x00\x26\x02\x00\x23\x01\x00\x33\x01\x01\x00\xF0\x02\x02\x02\x00\x02\x00\x13\x5D\x8B\x81\x4D\x15\x03\x01\x03\xF0\x01\x02\x06\x00" - "\x02\x00\x04\x01\x03\x03\x03\x05\x00\x00\x01\x40\x01\x00\x00\x01\xF4\x02\x02\x01\x00\x00\x00\x01\x01\x02\x00\x00\x00\x02\x01\x00" - "\xF0\x02\x00\x00\x00\x02\x00\x00\x01\x00\x01\x01\x01\x09\x1B\x29\xF0\x57\x93\xB9\x7D\x45\x1F\x0B\x07\x03\x00\x06\x04\x00\x00\x06" - "\xF0\x02\x04\x00\x01\x00\x02\x00\x06\x02\x06\x04\x01\x00\x06\x00\xF0\x00\x00\x02\x00\x01\x11\x29\x2F\x3F\x3F\x33\x29\x1D\x11\x0B" - "\x26\x03\x00\xF0\x03\x02\x00\x0B\x19\x2B\x3F\x5D\x6F\x81\x95\x83\x4D\x1B\x11\xF0\x07\x03\x01\x03\x03\x01\x00\x00\x02\x00\x05\x03" - "\x00\x00\x06\xB0\x00\x00\x04\x01\x01\x05\x03\x02\x01\x03\x00\xF0\x00\x02\x02\x00\x55\x85\x87\x89\x87\x87\x8B\x8D\x8F\x95\x99\xF0" - "\x93\x85\x77\x65\x55\x59\x5F\x65\x6B\x7D\x91\x93\x91\x89\x85\x73\x7B\x67\x4D\x29\x11\x0D\x00\xF0\x04\x04\x04\x02\x00\x00\x01\x02" - "\x02\x00\x01\x00\x02\x02\x02\x90\x01\x02\x00\x01\x03\x02\x00\x00\x02\xF0\x00\x00\x05\x6D\x77\x4D\x3B\x2F\x29\x27\x29\x31\x3D\x3F" - "\x3F\xF0\x4D\x5F\x6D\x81\x8B\x85\x83\x7B\x75\x6B\x53\x47\x3F\x35\x25\xC3\x15\x0B\x05\x07\x07\x01\x05\x01\x03\x01\x01\x02\x93\x00" - "\x02\x00\x01\x02\x02\x00\x02\x00\x70\x04\x06\x06\x05\x00\x02\x00\xF0\x04\x02\x2D\x47\x13\x05\x01\x05\x01\x00\x03\x07\x07\x05\x09" - "\xF0\x0B\x0D\x09\x07\x0F\x0F\x09\x0D\x0B\x05\x09\x05\x05\x01\x07\xF0\x03\x03\x03\x00\x02\x04\x06\x02\x01\x01\x00\x02\x00\x03\x01" - "\x75\x03\x03\x00\x00\x00\x01\x00\x70\x02\x02\x01\x04\x00\x01\x00\xF0\x00\x01\x33\x1D\x05\x03\x00\x04\x00\x00\x00\x04\x00\x03\x01" - "\xF0\x00\x02\x00\x00\x01\x01\x01\x00\x05\x00\x00\x00\x02\x01\x04\xF0\x02\x00\x02\x00\x00\x05\x05\x00\x04\x02\x03\x01\x05\x01\x00" - "\xF0\x04\x04\x01\x00\x00\x02\x02\x05\x00\x00\x02\x00\x03\x02\x02\x40\x00\x00\x00\x03\xF0\x00\x0B\x1B\x07\x01\x00\x02\x01\x02\x00" - "\x01\x01\x00\x02\x00\xF0\x02\x06\x02\x00\x04\x00\x00\x00\x04\x01\x00\x00\x02\x04\x02\xF0\x04\x02\x00\x04\x01\x01\x02\x01\x02\x01" - "\x01\x01\x00\x02\x00\xF0\x01\x00\x03\x00\x00\x01\x03\x00\x03\x03\x00\x02\x00\x03\x01\x40\x00\x02\x00\x04\xF0\x00\x03\x05\x01\x03" - "\x04\x04\x00\x01\x01\x01\x03\x00\x00\x02\xF0\x00\x01\x01\x00\x01\x00\x03\x03\x02\x01\x01\x00\x01\x01\x01\xF0\x00\x00\x02\x03\x01" - "\x02\x00\x02\x01\x02\x06\x02\x04\x02\x00\xF3\x00\x01\x00\x00\x02\x02\x00\x02\x02\x00\x03\x03\x01\x01\x00\x10\x01\xF0\x02\x03\x03" - "\x00\x01\x03\x05\x00\x02\x00\x02\x02\x02\x04\x01\xF0\x05\x03\x00\x02\x00\x05\x00\x02\x01\x00\x04\x01\x00\x02\x02\x83\x00\x04\x00" - "\x02\x06\x04\x03\x00\xB3\x03\x03\x07\x05\x00\x02\x00\x02\x01\x01\x02\x90\x06\x00\x04\x00\x00\x01\x00\x02\x00\xF0\x02\x0A\x06\x00" - "\x08\x04\x04\x02\x04\x04\x02\x00\x02\x02\x04\xF0\x08\x00\x01\x03\x00\x04\x02\x02\x00\x06\x00\x02\x02\x03\x00\xF0\x00\x05\x01\x03" - "\x01\x03\x01\x03\x00\x02\x01\x00\x01\x02\x02\xF0\x00\x02\x02\x01\x00\x01\x03\x02\x00\x00\x03\x02\x01\x00\x00\x40\x00\x03\x01\x04" - "\xF0\x00\x06\x0C\x02\x01\x03\x00\x02\x05\x01\x00\x04\x05\x03\x03\xB3\x03\x02\x00\x01\x01\x02\x01\x01\x00\x01\x00\xB3\x02\x01\x00" - "\x00\x01\x00\x02\x02\x00\x00\x02\xF0\x04\x06\x02\x03\x00\x01\x01\x00\x04\x05\x01\x00\x01\x00\x00\x60\x02\x02\x00\x04\x00\x03\xF0" - "\x00\x08\x20\x0E\x03\x00\x00\x02\x04\x02\x00\x02\x02\x03\x00\x73\x07\x07\x02\x02\x06\x01\x00\xF0\x03\x01\x01\x00\x00\x02\x02\x04" - "\x06\x04\x00\x04\x04\x02\x05\xF0\x00\x00\x02\x01\x03\x00\x04\x01\x00\x02\x00\x05\x00\x02\x02\x63\x00\x00\x02\x01\x01\x00\xF0\x00" - "\x02\x28\x12\x06\x08\x04\x01\x00\x03\x01\x03\x01\x02\x02\xF0\x08\x02\x05\x01\x01\x02\x02\x00\x01\x01\x04\x02\x01\x00\x03\xF0\x01" - "\x03\x03\x02\x05\x03\x01\x01\x00\x04\x03\x01\x00\x02\x00\xF0\x01\x01\x00\x02\x00\x02\x04\x06\x02\x00\x01\x04\x00\x02\x04\x13\x00" - "\xF0\x02\x00\x24\x12\x04\x00\x01\x00\x00\x06\x00\x03\x02\x00\x00\xF0\x00\x06\x06\x04\x04\x00\x02\x04\x02\x01\x01\x02\x00\x00\x02" - "\xF0\x00\x00\x03\x07\x02\x04\x01\x00\x00\x01\x00\x02\x02\x06\x06\xF0\x00\x05\x01\x00\x02\x02\x00\x03\x01\x03\x00\x05\x03\x01\x00" - "\x40\x00\x03\x00\x02\xF0\x00\x00\x12\x24\x08\x02\x00\x04\x02\x03\x00\x04\x01\x00\x03\xF0\x00\x01\x01\x01\x07\x01\x01\x01\x00\x02" - "\x01\x01\x02\x01\x01\xF0\x02\x02\x04\x06\x02\x00\x02\x02\x00\x00\x06\x02\x01\x01\x00\x63\x04\x04\x02\x04\x02\x01\xA0\x00\x04\x01" - "\x01\x00\x01\x00\x01\x00\x02\xF0\x00\x02\x06\x50\x0A\x02\x01\x07\x01\x02\x04\x00\x04\x04\x00\xF0\x03\x00\x01\x00\x06\x04\x00\x01" - "\x00\x02\x04\x00\x03\x06\x02\xF0\x01\x00\x03\x03\x01\x00\x00\x01\x01\x01\x03\x00\x02\x01\x01\x63\x03\x02\x00\x03\x00\x02\xA0\x00" - "\x04\x06\x02\x02\x01\x04\x04\x00\x05\xF0\x02\x00\x00\x34\x2A\x04\x02\x00\x02\x02\x03\x00\x01\x03\x06\xF0\x06\x02\x02\x00\x03\x03" - "\x02\x06\x02\x01\x00\x00\x01\x00\x00\xF0\x00\x01\x02\x04\x01\x01\x02\x00\x00\x02\x01\x02\x00\x01\x03\xF0\x01\x00\x06\x00\x03\x01" - "\x02\x02\x00\x02\x01\x00\x04\x00\x01\x40\x01\x00\x01\x01\x03\xF0\x08\x54\x14\x10\x10\x10\x0A\x0C\x0C\x08\x0A\x08\x06\x02\x06\xF0" - "\x02\x06\x02\x06\x01\x05\x01\x00\x00\x02\x05\x03\x00\x02\x02\xF0\x00\x06\x04\x00\x00\x00\x01\x00\x03\x00\x03\x00\x02\x00\x03\xF0" - "\x02\x02\x00\x00\x00\x01\x02\x05\x01\x00\x00\x02\x00\x00\x00\x10\x04\x04\xF0\x52\x92\x8E\x88\x78\x72\x6C\x62\x58\x52\x4C\x4C\x48" - "\x38\x30\xF0\x22\x16\x0E\x10\x12\x12\x06\x06\x06\x04\x02\x01\x00\x03\x01\xF0\x03\x05\x05\x01\x01\x00\x06\x02\x00\x02\x06\x00\x00" - "\x00\x03\xF0\x00\x00\x01\x01\x02\x00\x02\x02\x03\x04\x04\x02\x00\x02\x04\x03\xF0\x02\x0A\x40\x52\x5C\x68\x72\x7A\x82\x92\x94\x94" - "\x94\x90\x8E\xF0\x8A\x82\x80\x70\x60\x56\x3E\x30\x1A\x14\x14\x10\x0C\x0A\x0A\xF0\x02\x00\x04\x02\x00\x02\x02\x01\x00\x00\x04\x05" - "\x02\x00\x02\xF0\x02\x01\x00\x00\x02\x00\x01\x02\x00\x02\x01\x00\x01\x02\x02\x10\x00\x39\x00\x01\x00\xF0\x01\x02\x06\x0A\x16\x26" - "\x34\x48\x5A\x68\x72\x7C\x86\x94\xA0\xF0\x9A\x80\x64\x3C\x18\x14\x10\x08\x04\x08\x02\x02\x01\x00\x02\xF0\x01\x01\x02\x02\x02\x01" - "\x00\x00\x02\x00\x01\x01\x03\x02\x01\x70\x04\x00\x03\x00\x01\x01\x01\x04\x5A\x01\x00\x00\x01\x00\xF0\x01\x02\x04\x0C\x10\x1E\x26" - "\x30\x3E\x5A\x7C\xAA\xC2\xA2\x82\xF0\x62\x4A\x2C\x20\x0E\x10\x06\x02\x01\x03\x00\x03\x03\x02\x02\xF0\x02\x03\x01\x01\x01\x02\x01" - "\x01\x01\x02\x04\x04\x01\x05\x00\x33\x00\x02\x00\x24\x01\x00\x29\x02\x00\x53\x02\x00\x00\x00\x02\xF0\x0E\x34\x5E\x84\x90\x8C\x82" - "\x76\x5A\x3C\x1E\x12\x0C\x06\x06\xF0\x02\x00\x00\x00\x02\x00\x00\x02\x02\x00\x06\x03\x03\x01\x05\x30\x02\x08\x00\x03\x3A\x01\x02" - "\x00\x53\x01\x00\x02\x02\x00\x28\x01\x00\xF0\x04\x12\x32\x4E\x66\x7A\x8E\x96\x7A\x44\x16\x0E\x0C\x04\x02\x33\x00\x00\x02\x90\x04" - "\x02\x04\x02\x02\x04\x02\x01\x02\x55\x00\x01\x01\x02\x00\xA8\x01\x01\x01\x00\x00\x01\x00\x01\x01\x00\xF0\x01\x01\x00\x00\x02\x00" - "\x00\x02\x02\x00\x04\x10\x20\x36\x66\xF0\xA4\xB8\x88\x54\x36\x1E\x10\x0A\x04\x01\x00\x01\x05\x09\x05\x60\x01\x01\x05\x03\x02\x01" - "\xF0\x03\x03\x05\x03\x00\x00\x02\x02\x00\x01\x02\x02\x02\x00\x00\x54\x02\x00\x00\x02\x00\x94\x02\x00\x00\x00\x02\x02\x00\x01\x00" - "\xF0\x02\x02\x00\x01\x02\x02\x02\x1E\x58\x8A\x92\x7C\x62\x3C\x1A\xC0\x12\x0A\x06\x02\x02\x06\x02\x01\x00\x00\x01\x01\xF0\x93\x93" - "\x93\x95\x91\x85\x79\x6F\x5D\x4F\x45\x3B\x31\x23\x0F\x8D\x01\x02\x02\x00\x00\x01\x01\x00\x13\x01\xF0\x00\x01\x01\x00\x00\x00\x08" - "\x24\x52\x72\x8C\x98\x68\x30\x0E\x90\x0C\x08\x00\x00\x02\x01\x04\x04\x02\xF0\x4F\x4D\x4D\x4B\x55\x63\x6F\x75\x87\x8D\x95\x9F\xA5" - "\xB1\xC3\xF0\xC3\xA1\x85\x6B\x53\x37\x29\x21\x17\x0B\x01\x00\x00\x00\x01\x49\x01\x02\x01\x00\x14\x01\xF0\x00\x0C\x20\x3A\x78\xAC" - "\x9E\x5E\x2E\x16\x04\x01\x06\x00\x03\x10\x01\xF0\x07\x09\x09\x0D\x07\x07\x07\x0B\x0B\x11\x11\x0D\x17\x17\x19\xF0\x21\x45\x5F\x75" - "\x87\x9B\x99\x8D\x83\x73\x61\x43\x29\x0D\x00\xC6\x00\x00\x02\x00\x00\x00\x02\x02\x00\x00\x02\x00\xF0\x02\x01\x00\x02\x02\x0C\x40" - "\x80\x86\x6C\x44\x22\x12\x04\x02\x10\x04\xF0\x01\x03\x02\x04\x01\x01\x01\x00\x01\x01\x00\x05\x00\x01\x05\xF0\x09\x09\x0B\x11\x11" - "\x15\x25\x39\x4B\x61\x77\x81\x89\x8D\x81\xE4\x53\x2B\x07\x00\x01\x01\x00\x00\x02\x02\x00\x00\x00\x02\x34\x00\x02\x00\x90\x08\x36" - "\x66\x8A\x8A\x40\x16\x0C\x04\xF0\x00\x02\x01\x01\x01\x02\x04\x02\x02\x02\x03\x01\x01\x01\x04\x33\x01\x00\x03\xF0\x05\x07\x09\x09" - "\x11\x25\x2F\x4D\x61\x8B\xAB\xC5\xA3\x71\x3F\x44\x1F\x0B\x01\x00\x66\x01\x01\x00\x00\x01\x00\x80\x02\x06\x1E\x46\x9C\xB0\x70\x40" - "\xF0\x01\x00\x02\x02\x04\x02\x01\x05\x01\x00\x03\x00\x00\x00\x01\xF0\x02\x02\x08\x0A\x02\x01\x02\x02\x01\x05\x03\x03\x0B\x05\x09" - "\xF0\x0D\x15\x19\x41\x69\x93\x89\x71\x51\x2D\x09\x02\x02\x00\x02\x2A\x02\x00\x70\x02\x00\x02\x04\x26\x70\x8C"; + "\xF0\x23\x1F\x1E\x1D\x1D\x1E\x1D\x1F\x23\x4A\x78\x71\x64\x58\x4B\xF0\x3E\x30\x29\x26\x24\x22" + "\x21\x20\x20\x20\x1D\x1E\x20\x1E\x1F" + "\x86\x20\x20\x1F\x20\x21\x22\x1E\x1F\xF0\x1E\x1D\x1F\x20\x1F\x1F\x1F\x1E\x1E\x1F\x1F\x20\x1E" + "\x1F\x1F\x50\x1F\x1E\x1D\x1E\x1C\xF0" + "\x38\x1A\x14\x0E\x08\x08\x06\x04\x04\x18\x38\x4A\x66\x74\x82\xF0\x90\x9E\x90\x76\x52\x2C\x16" + "\x12\x0C\x06\x08\x06\x00\x02\x00\xF0" + "\x03\x03\x02\x00\x01\x03\x02\x02\x00\x02\x01\x01\x03\x00\x00\x33\x02\x04\x00\xD0\x02\x00\x00" + "\x03\x01\x02\x00\x02\x01\x00\x04\x02" + "\x06\xF0\x94\xAE\x90\x6E\x46\x2E\x1E\x0C\x0E\x0A\x02\x00\x02\x0C\x18\xF0\x24\x30\x4C\x6C\x94" + "\xBE\xBE\x9A\x6C\x48\x34\x1C\x10\x08" + "\x06\xF0\x06\x06\x00\x01\x03\x01\x02\x00\x02\x00\x02\x02\x08\x04\x02\xF0\x00\x03\x01\x00\x01" + "\x02\x00\x06\x02\x04\x01\x01\x03\x03" + "\x00\x40\x00\x00\x04\x01\xD3\x02\x14\x3C\x68\x8E\x86\x78\x68\x3E\x16\x02\x02\x00\x14\x02\xF0" + "\x1A\x44\x78\x92\x8C\x82\x6E\x52\x2E" + "\x14\x06\x02\x04\x00\x01\xF0\x01\x03\x00\x01\x01\x02\x00\x00\x03\x01\x01\x01\x04\x06\x00\xD0" + "\x02\x00\x02\x00\x02\x02\x02\x00\x00" + "\x04\x00\x03\x02\x04\xAA\x0C\x2C\x54\x6E\x7C\x4C\x02\x00\x02\x00\xF0\x10\x2E\x50\x6C\x82\x92" + "\x86\x50\x1C\x12\x0A\x04\x04\x02\x01" + "\xF0\x02\x02\x01\x05\x07\x00\x00\x01\x02\x03\x05\x03\x00\x01\x05\xA0\x01\x01\x01\x00\x02\x04" + "\x00\x02\x00\x01\xE5\x00\x00\x02\x02" + "\x00\x00\x00\x04\x1A\x14\x00\x00\x01\x00\x35\x01\x01\x00\xF0\x06\x16\x2A\x52\x96\xBC\x84\x50" + "\x28\x0C\x06\x04\x03\x03\x00\xF0\x04" + "\x04\x04\x02\x02\x02\x00\x02\x00\x00\x01\x02\x00\x02\x00\x70\x02\x04\x08\x01\x01\x02\x04\x04" + "\x5C\x02\x02\x00\x02\x00\x14\x01\xF0" + "\x00\x00\x00\x02\x02\x02\x16\x58\x86\x84\x54\x1E\x06\x06\x04\xF0\x00\x03\x01\x00\x02\x02\x01" + "\x02\x01\x04\x02\x01\x00\x02\x01\x80" + "\x02\x02\x01\x07\x03\x01\x01\x00\x04\x53\x01\x00\x00\x00\x01\x16\x00\xF0\x02\x00\x00\x01\x00" + "\x02\x00\x01\x13\x37\x55\x67\x4B\x1D" + "\x03\xF0\x14\x44\x7A\x74\x28\x08\x01\x01\x02\x04\x00\x02\x00\x00\x01\xF0\x02\x01\x05\x00\x01" + "\x04\x02\x00\x00\x00\x01\x00\x00\x03" + "\x03\x41\xF0\x04\x02\x02\x02\x03\x1F\x69\xA9\x9B\x7D\x69\x85\xAD\xA1\x47\xF0\x0B\x14\x5A\x8A" + "\x32\x08\x04\x04\x04\x01\x03\x04\x01" + "\x00\x00\xE0\x02\x00\x04\x00\x07\x01\x00\x03\x03\x00\x02\x00\x00\x00\x04\x53\x02\x00\x00\x00" + "\x02\x17\x00\xF0\x01\x00\x00\x00\x31" + "\x7F\x61\x11\x36\x4E\x58\x46\x16\x29\x79\xF0\x69\x0B\x00\x34\x68\x14\x06\x03\x07\x04\x02\x00" + "\x02\x00\x00\xA3\x00\x06\x00\x00\x00" + "\x01\x01\x00\x06\x02\x10\x01\x71\xF0\x0D\x6F\x2F\x1A\x7A\x84\x78\x70\x7A\x88\x52\x09\x57\x53" + "\x01\xF0\x00\x44\x42\x06\x06\x00\x04" + "\x04\x00\x01\x00\x02\x00\x00\x03\xB0\x04\x02\x04\x04\x00\x05\x00\x00\x00\x02\x02\x41\xF0\x01" + "\x01\x07\x75\x2B\x2A\x86\x54\x1A\x0C" + "\x02\x04\x2A\x7A\x6E\xF0\x04\x5B\x3B\x00\x06\x68\x22\x04\x00\x03\x01\x01\x04\x01\x00\x83\x01" + "\x03\x02\x01\x00\x01\x02\x00\x30\x02" + "\x00\x02\x51\xF0\x02\x21\x2F\x0C\x50\x2A\x02\x03\x29\x61\x73\x59\x1B\x4C\x32\xF0\x15\x3F\x09" + "\x00\x20\x42\x08\x02\x00\x01\x00\x00" + "\x02\x01\x00\xD0\x02\x00\x00\x02\x01\x05\x02\x00\x00\x00\x01\x01\x01\x61\xF0\x1F\x0F\x14\x34" + "\x04\x00\x0D\x55\x61\x55\x67\x4B\x0A" + "\x3C\x00\xF0\x15\x0D\x00\x0C\x3A\x18\x06\x02\x00\x01\x00\x02\x04\x02\x03\xC0\x04\x06\x00\x00" + "\x02\x00\x00\x01\x00\x00\x02\x00\x11" + "\xF0\x01\x01\x01\x00\x00\x21\x0F\x0A\x1A\x00\x01\x0A\x32\x28\x24\xF0\x30\x2E\x06\x2C\x04\x13" + "\x11\x02\x02\x32\x38\x08\x03\x01\x01" + "\xF0\x00\x02\x01\x03\x02\x00\x03\x00\x00\x01\x00\x01\x00\x03\x03\x20\x00\x02\x0E\xF0\x01\x00" + "\x00\x02\x02\x02\x00\x00\x10\x06\x05" + "\x0B\x00\x00\x06\xF0\x4A\x88\x84\x80\x3C\x00\x0B\x03\x02\x02\x00\x00\x12\x30\x10\xF0\x02\x00" + "\x02\x01\x05\x03\x02\x02\x03\x01\x00" + "\x06\x02\x01\x00\x50\x00\x04\x02\x00\x02\x0D\x24\x01\x00\xF0\x02\x00\x00\x1C\x0E\x0F\x1D\x00" + "\x02\x02\x06\x1A\x2E\x16\x02\xF0\x02" + "\x31\x00\x16\x16\x00\x00\x02\x30\x18\x02\x02\x00\x04\x02\xF0\x04\x00\x00\x01\x00\x00\x00\x02" + "\x02\x06\x04\x01\x01\x00\x05\x0C\xF0" + "\x03\x0F\x05\x01\x00\x00\x01\x03\x00\x01\x24\x1E\x15\x57\x15\xF0\x01\x00\x00\x00\x02\x00\x01" + "\x37\x4B\x04\x2A\x12\x00\x00\x00\xF0" + "\x2C\x26\x0A\x00\x02\x07\x03\x05\x02\x00\x02\x00\x00\x03\x01\x70\x01\x00\x00\x02\x04\x01\x06" + "\x33\x00\x01\x00\xF0\x01\x00\x00\x00" + "\x01\x00\x03\x31\x57\x1F\x00\x00\x02\x02\x00\x83\x00\x1C\x56\x02\x3B\x5F\x17\x00\xF0\x05\x33" + "\x65\x19\x2C\x42\x02\x00\x02\x00\x04" + "\x38\x02\x02\x01\xF0\x02\x01\x02\x00\x00\x01\x01\x00\x01\x00\x00\x01\x05\x02\x02\x20\x02\x01" + "\x39\x00\x02\x00\xF0\x06\x12\x3D\x83" + "\x4B\x07\x00\x00\x02\x02\x02\x44\x44\x0B\x57\xF0\x83\x51\x29\x1D\x31\x67\x7D\x35\x08\x6A\x22" + "\x00\x00\x01\x00\xF0\x00\x3A\x0C\x06" + "\x00\x00\x06\x04\x02\x00\x02\x02\x01\x00\x01\x70\x00\x00\x01\x03\x01\x00\x00\x0C\xF0\x02\x2A" + "\x28\x2D\x8B\x9B\x43\x15\x01\x00\x00" + "\x08\x80\x72\x16\xF0\x39\x83\xA9\xB3\xA1\x67\x17\x3A\x8E\x38\x02\x00\x00\x00\x01\xF0\x01\x22" + "\x24\x00\x00\x02\x03\x01\x03\x03\x00" + "\x00\x02\x04\x01\x70\x02\x04\x06\x02\x00\x00\x00\x58\x02\x00\x00\x02\x00\xF0\x08\x3A\x16\x07" + "\x3B\x87\x7D\x45\x11\x00\x00\x0E\x5A" + "\x7C\x64\x94\x3E\x18\x16\x28\x4A\x70\x80\x3C\x00\x83\x02\x01\x2D\x0B\x00\x02\x00\x02\xC0\x04" + "\x02\x00\x00\x06\x00\x03\x01\x01\x02" + "\x00\x02\x24\x02\x00\xF0\x02\x00\x00\x00\x02\x00\x00\x00\x32\x52\x10\x02\x17\x4D\x7F\xF0\x85" + "\x4B\x09\x00\x08\x3A\x6C\x80\x94\x94" + "\x8C\x78\x56\x1A\x02\x13\x00\xF0\x01\x17\x67\x85\x27\x03\x00\x00\x00\x01\x00\x02\x03\x00\x02" + "\x90\x02\x01\x02\x01\x01\x04\x01\x00" + "\x01\x68\x00\x02\x02\x00\x02\x00\xF0\x08\x6A\xB6\x76\x40\x18\x17\x49\x8D\xB1\x6D\x33\x15\x02" + "\x18\xF0\x28\x2A\x20\x12\x04\x01\x00" + "\x00\x01\x09\x1D\x69\xA7\x71\x35\xF0\x07\x03\x01\x01\x04\x02\x00\x02\x00\x01\x00\x03\x01\x00" + "\x02\x50\x04\x01\x00\x00\x00\x77\x02" + "\x02\x00\x02\x00\x02\x00\xF0\x02\x02\x1A\x64\x88\x78\x46\x16\x03\x25\x6F\x93\x83\x67\x3F\xF0" + "\x29\x13\x01\x02\x02\x00\x05\x23\x45" + "\x67\x89\x6D\x1B\x06\x1C\x53\x00\x01\x02\x00\x01\xC0\x00\x03\x01\x00\x00\x01\x02\x02\x01\x02" + "\x02\x01\x07\x28\x02\x00\xF0\x04\x1C" + "\x50\x82\x8E\x5C\x20\x06\x15\x43\x6F\x85\x8D\x91\x8D\xF0\x81\x8B\x93\x95\x8D\x7F\x69\x33\x08" + "\x3E\x86\x80\x08\x02\x01\xF0\x02\x02" + "\x00\x01\x01\x02\x04\x02\x00\x00\x01\x00\x00\x01\x01\x20\x01\x02\x4D\x02\x02\x02\x00\x03\xF0" + "\x18\x3C\x82\xBA\x96\x5E\x34\x12\x19" + "\x27\x3B\x4F\x5F\x4F\x45\xF0\x3F\x25\x02\x30\x5C\xAC\x9C\x50\x09\x06\x02\x02\x02\x03\x00\xE0" + "\x02\x03\x01\x00\x01\x02\x02\x03\x05" + "\x03\x02\x00\x00\x02\x7C\x02\x00\x02\x02\x00\x02\x00\xF0\x02\x00\x02\x00\x08\x42\x7C\x8E\x84" + "\x74\x62\x4C\x34\x22\x2A\xF0\x3C\x4E" + "\x6C\x7E\x88\x7A\x26\x02\x09\x39\x03\x02\x00\x01\x00\xF0\x00\x02\x00\x02\x02\x00\x00\x03\x02" + "\x02\x00\x04\x00\x02\x00\x04\x23\x02" + "\x00\x2E\x02\x00\xF0\x04\x1E\x48\x68\x72\x80\x8C\x98\x90\x86\x7C\x66\x48\x24\x06\xF0\x00\x00" + "\x39\x31\x05\x05\x00\x01\x01\x00\x00" + "\x06\x01\x05\x01\x63\x02\x00\x04\x00\x00\x01\x33\x02\x02\x00\x2F\x02\x00\x05\xF0\x04\x0C\x14" + "\x1E\x28\x22\x1A\x12\x06\x00\x01\x00" + "\x19\x5D\x77\xF0\x1B\x05\x00\x03\x01\x04\x02\x01\x01\x00\x04\x02\x03\x00\x00\x60\x04\x01\x02" + "\x02\x04\x02\x23\x00\x02\x1F\x00\x0F" + "\xF0\x01\x01\x13\x49\x7B\x75\x29\x0B\x03\x00\x01\x00\x00\x03\x01\xD0\x01\x01\x02\x02\x04\x04" + "\x01\x05\x02\x00\x02\x05\x01\x29\x02" + "\x00\x26\x02\x00\x23\x01\x00\x33\x01\x01\x00\xF0\x02\x02\x02\x00\x02\x00\x13\x5D\x8B\x81\x4D" + "\x15\x03\x01\x03\xF0\x01\x02\x06\x00" + "\x02\x00\x04\x01\x03\x03\x03\x05\x00\x00\x01\x40\x01\x00\x00\x01\xF4\x02\x02\x01\x00\x00\x00" + "\x01\x01\x02\x00\x00\x00\x02\x01\x00" + "\xF0\x02\x00\x00\x00\x02\x00\x00\x01\x00\x01\x01\x01\x09\x1B\x29\xF0\x57\x93\xB9\x7D\x45\x1F" + "\x0B\x07\x03\x00\x06\x04\x00\x00\x06" + "\xF0\x02\x04\x00\x01\x00\x02\x00\x06\x02\x06\x04\x01\x00\x06\x00\xF0\x00\x00\x02\x00\x01\x11" + "\x29\x2F\x3F\x3F\x33\x29\x1D\x11\x0B" + "\x26\x03\x00\xF0\x03\x02\x00\x0B\x19\x2B\x3F\x5D\x6F\x81\x95\x83\x4D\x1B\x11\xF0\x07\x03\x01" + "\x03\x03\x01\x00\x00\x02\x00\x05\x03" + "\x00\x00\x06\xB0\x00\x00\x04\x01\x01\x05\x03\x02\x01\x03\x00\xF0\x00\x02\x02\x00\x55\x85\x87" + "\x89\x87\x87\x8B\x8D\x8F\x95\x99\xF0" + "\x93\x85\x77\x65\x55\x59\x5F\x65\x6B\x7D\x91\x93\x91\x89\x85\x73\x7B\x67\x4D\x29\x11\x0D\x00" + "\xF0\x04\x04\x04\x02\x00\x00\x01\x02" + "\x02\x00\x01\x00\x02\x02\x02\x90\x01\x02\x00\x01\x03\x02\x00\x00\x02\xF0\x00\x00\x05\x6D\x77" + "\x4D\x3B\x2F\x29\x27\x29\x31\x3D\x3F" + "\x3F\xF0\x4D\x5F\x6D\x81\x8B\x85\x83\x7B\x75\x6B\x53\x47\x3F\x35\x25\xC3\x15\x0B\x05\x07\x07" + "\x01\x05\x01\x03\x01\x01\x02\x93\x00" + "\x02\x00\x01\x02\x02\x00\x02\x00\x70\x04\x06\x06\x05\x00\x02\x00\xF0\x04\x02\x2D\x47\x13\x05" + "\x01\x05\x01\x00\x03\x07\x07\x05\x09" + "\xF0\x0B\x0D\x09\x07\x0F\x0F\x09\x0D\x0B\x05\x09\x05\x05\x01\x07\xF0\x03\x03\x03\x00\x02\x04" + "\x06\x02\x01\x01\x00\x02\x00\x03\x01" + "\x75\x03\x03\x00\x00\x00\x01\x00\x70\x02\x02\x01\x04\x00\x01\x00\xF0\x00\x01\x33\x1D\x05\x03" + "\x00\x04\x00\x00\x00\x04\x00\x03\x01" + "\xF0\x00\x02\x00\x00\x01\x01\x01\x00\x05\x00\x00\x00\x02\x01\x04\xF0\x02\x00\x02\x00\x00\x05" + "\x05\x00\x04\x02\x03\x01\x05\x01\x00" + "\xF0\x04\x04\x01\x00\x00\x02\x02\x05\x00\x00\x02\x00\x03\x02\x02\x40\x00\x00\x00\x03\xF0\x00" + "\x0B\x1B\x07\x01\x00\x02\x01\x02\x00" + "\x01\x01\x00\x02\x00\xF0\x02\x06\x02\x00\x04\x00\x00\x00\x04\x01\x00\x00\x02\x04\x02\xF0\x04" + "\x02\x00\x04\x01\x01\x02\x01\x02\x01" + "\x01\x01\x00\x02\x00\xF0\x01\x00\x03\x00\x00\x01\x03\x00\x03\x03\x00\x02\x00\x03\x01\x40\x00" + "\x02\x00\x04\xF0\x00\x03\x05\x01\x03" + "\x04\x04\x00\x01\x01\x01\x03\x00\x00\x02\xF0\x00\x01\x01\x00\x01\x00\x03\x03\x02\x01\x01\x00" + "\x01\x01\x01\xF0\x00\x00\x02\x03\x01" + "\x02\x00\x02\x01\x02\x06\x02\x04\x02\x00\xF3\x00\x01\x00\x00\x02\x02\x00\x02\x02\x00\x03\x03" + "\x01\x01\x00\x10\x01\xF0\x02\x03\x03" + "\x00\x01\x03\x05\x00\x02\x00\x02\x02\x02\x04\x01\xF0\x05\x03\x00\x02\x00\x05\x00\x02\x01\x00" + "\x04\x01\x00\x02\x02\x83\x00\x04\x00" + "\x02\x06\x04\x03\x00\xB3\x03\x03\x07\x05\x00\x02\x00\x02\x01\x01\x02\x90\x06\x00\x04\x00\x00" + "\x01\x00\x02\x00\xF0\x02\x0A\x06\x00" + "\x08\x04\x04\x02\x04\x04\x02\x00\x02\x02\x04\xF0\x08\x00\x01\x03\x00\x04\x02\x02\x00\x06\x00" + "\x02\x02\x03\x00\xF0\x00\x05\x01\x03" + "\x01\x03\x01\x03\x00\x02\x01\x00\x01\x02\x02\xF0\x00\x02\x02\x01\x00\x01\x03\x02\x00\x00\x03" + "\x02\x01\x00\x00\x40\x00\x03\x01\x04" + "\xF0\x00\x06\x0C\x02\x01\x03\x00\x02\x05\x01\x00\x04\x05\x03\x03\xB3\x03\x02\x00\x01\x01\x02" + "\x01\x01\x00\x01\x00\xB3\x02\x01\x00" + "\x00\x01\x00\x02\x02\x00\x00\x02\xF0\x04\x06\x02\x03\x00\x01\x01\x00\x04\x05\x01\x00\x01\x00" + "\x00\x60\x02\x02\x00\x04\x00\x03\xF0" + "\x00\x08\x20\x0E\x03\x00\x00\x02\x04\x02\x00\x02\x02\x03\x00\x73\x07\x07\x02\x02\x06\x01\x00" + "\xF0\x03\x01\x01\x00\x00\x02\x02\x04" + "\x06\x04\x00\x04\x04\x02\x05\xF0\x00\x00\x02\x01\x03\x00\x04\x01\x00\x02\x00\x05\x00\x02\x02" + "\x63\x00\x00\x02\x01\x01\x00\xF0\x00" + "\x02\x28\x12\x06\x08\x04\x01\x00\x03\x01\x03\x01\x02\x02\xF0\x08\x02\x05\x01\x01\x02\x02\x00" + "\x01\x01\x04\x02\x01\x00\x03\xF0\x01" + "\x03\x03\x02\x05\x03\x01\x01\x00\x04\x03\x01\x00\x02\x00\xF0\x01\x01\x00\x02\x00\x02\x04\x06" + "\x02\x00\x01\x04\x00\x02\x04\x13\x00" + "\xF0\x02\x00\x24\x12\x04\x00\x01\x00\x00\x06\x00\x03\x02\x00\x00\xF0\x00\x06\x06\x04\x04\x00" + "\x02\x04\x02\x01\x01\x02\x00\x00\x02" + "\xF0\x00\x00\x03\x07\x02\x04\x01\x00\x00\x01\x00\x02\x02\x06\x06\xF0\x00\x05\x01\x00\x02\x02" + "\x00\x03\x01\x03\x00\x05\x03\x01\x00" + "\x40\x00\x03\x00\x02\xF0\x00\x00\x12\x24\x08\x02\x00\x04\x02\x03\x00\x04\x01\x00\x03\xF0\x00" + "\x01\x01\x01\x07\x01\x01\x01\x00\x02" + "\x01\x01\x02\x01\x01\xF0\x02\x02\x04\x06\x02\x00\x02\x02\x00\x00\x06\x02\x01\x01\x00\x63\x04" + "\x04\x02\x04\x02\x01\xA0\x00\x04\x01" + "\x01\x00\x01\x00\x01\x00\x02\xF0\x00\x02\x06\x50\x0A\x02\x01\x07\x01\x02\x04\x00\x04\x04\x00" + "\xF0\x03\x00\x01\x00\x06\x04\x00\x01" + "\x00\x02\x04\x00\x03\x06\x02\xF0\x01\x00\x03\x03\x01\x00\x00\x01\x01\x01\x03\x00\x02\x01\x01" + "\x63\x03\x02\x00\x03\x00\x02\xA0\x00" + "\x04\x06\x02\x02\x01\x04\x04\x00\x05\xF0\x02\x00\x00\x34\x2A\x04\x02\x00\x02\x02\x03\x00\x01" + "\x03\x06\xF0\x06\x02\x02\x00\x03\x03" + "\x02\x06\x02\x01\x00\x00\x01\x00\x00\xF0\x00\x01\x02\x04\x01\x01\x02\x00\x00\x02\x01\x02\x00" + "\x01\x03\xF0\x01\x00\x06\x00\x03\x01" + "\x02\x02\x00\x02\x01\x00\x04\x00\x01\x40\x01\x00\x01\x01\x03\xF0\x08\x54\x14\x10\x10\x10\x0A" + "\x0C\x0C\x08\x0A\x08\x06\x02\x06\xF0" + "\x02\x06\x02\x06\x01\x05\x01\x00\x00\x02\x05\x03\x00\x02\x02\xF0\x00\x06\x04\x00\x00\x00\x01" + "\x00\x03\x00\x03\x00\x02\x00\x03\xF0" + "\x02\x02\x00\x00\x00\x01\x02\x05\x01\x00\x00\x02\x00\x00\x00\x10\x04\x04\xF0\x52\x92\x8E\x88" + "\x78\x72\x6C\x62\x58\x52\x4C\x4C\x48" + "\x38\x30\xF0\x22\x16\x0E\x10\x12\x12\x06\x06\x06\x04\x02\x01\x00\x03\x01\xF0\x03\x05\x05\x01" + "\x01\x00\x06\x02\x00\x02\x06\x00\x00" + "\x00\x03\xF0\x00\x00\x01\x01\x02\x00\x02\x02\x03\x04\x04\x02\x00\x02\x04\x03\xF0\x02\x0A\x40" + "\x52\x5C\x68\x72\x7A\x82\x92\x94\x94" + "\x94\x90\x8E\xF0\x8A\x82\x80\x70\x60\x56\x3E\x30\x1A\x14\x14\x10\x0C\x0A\x0A\xF0\x02\x00\x04" + "\x02\x00\x02\x02\x01\x00\x00\x04\x05" + "\x02\x00\x02\xF0\x02\x01\x00\x00\x02\x00\x01\x02\x00\x02\x01\x00\x01\x02\x02\x10\x00\x39\x00" + "\x01\x00\xF0\x01\x02\x06\x0A\x16\x26" + "\x34\x48\x5A\x68\x72\x7C\x86\x94\xA0\xF0\x9A\x80\x64\x3C\x18\x14\x10\x08\x04\x08\x02\x02\x01" + "\x00\x02\xF0\x01\x01\x02\x02\x02\x01" + "\x00\x00\x02\x00\x01\x01\x03\x02\x01\x70\x04\x00\x03\x00\x01\x01\x01\x04\x5A\x01\x00\x00\x01" + "\x00\xF0\x01\x02\x04\x0C\x10\x1E\x26" + "\x30\x3E\x5A\x7C\xAA\xC2\xA2\x82\xF0\x62\x4A\x2C\x20\x0E\x10\x06\x02\x01\x03\x00\x03\x03\x02" + "\x02\xF0\x02\x03\x01\x01\x01\x02\x01" + "\x01\x01\x02\x04\x04\x01\x05\x00\x33\x00\x02\x00\x24\x01\x00\x29\x02\x00\x53\x02\x00\x00\x00" + "\x02\xF0\x0E\x34\x5E\x84\x90\x8C\x82" + "\x76\x5A\x3C\x1E\x12\x0C\x06\x06\xF0\x02\x00\x00\x00\x02\x00\x00\x02\x02\x00\x06\x03\x03\x01" + "\x05\x30\x02\x08\x00\x03\x3A\x01\x02" + "\x00\x53\x01\x00\x02\x02\x00\x28\x01\x00\xF0\x04\x12\x32\x4E\x66\x7A\x8E\x96\x7A\x44\x16\x0E" + "\x0C\x04\x02\x33\x00\x00\x02\x90\x04" + "\x02\x04\x02\x02\x04\x02\x01\x02\x55\x00\x01\x01\x02\x00\xA8\x01\x01\x01\x00\x00\x01\x00\x01" + "\x01\x00\xF0\x01\x01\x00\x00\x02\x00" + "\x00\x02\x02\x00\x04\x10\x20\x36\x66\xF0\xA4\xB8\x88\x54\x36\x1E\x10\x0A\x04\x01\x00\x01\x05" + "\x09\x05\x60\x01\x01\x05\x03\x02\x01" + "\xF0\x03\x03\x05\x03\x00\x00\x02\x02\x00\x01\x02\x02\x02\x00\x00\x54\x02\x00\x00\x02\x00\x94" + "\x02\x00\x00\x00\x02\x02\x00\x01\x00" + "\xF0\x02\x02\x00\x01\x02\x02\x02\x1E\x58\x8A\x92\x7C\x62\x3C\x1A\xC0\x12\x0A\x06\x02\x02\x06" + "\x02\x01\x00\x00\x01\x01\xF0\x93\x93" + "\x93\x95\x91\x85\x79\x6F\x5D\x4F\x45\x3B\x31\x23\x0F\x8D\x01\x02\x02\x00\x00\x01\x01\x00\x13" + "\x01\xF0\x00\x01\x01\x00\x00\x00\x08" + "\x24\x52\x72\x8C\x98\x68\x30\x0E\x90\x0C\x08\x00\x00\x02\x01\x04\x04\x02\xF0\x4F\x4D\x4D\x4B" + "\x55\x63\x6F\x75\x87\x8D\x95\x9F\xA5" + "\xB1\xC3\xF0\xC3\xA1\x85\x6B\x53\x37\x29\x21\x17\x0B\x01\x00\x00\x00\x01\x49\x01\x02\x01\x00" + "\x14\x01\xF0\x00\x0C\x20\x3A\x78\xAC" + "\x9E\x5E\x2E\x16\x04\x01\x06\x00\x03\x10\x01\xF0\x07\x09\x09\x0D\x07\x07\x07\x0B\x0B\x11\x11" + "\x0D\x17\x17\x19\xF0\x21\x45\x5F\x75" + "\x87\x9B\x99\x8D\x83\x73\x61\x43\x29\x0D\x00\xC6\x00\x00\x02\x00\x00\x00\x02\x02\x00\x00\x02" + "\x00\xF0\x02\x01\x00\x02\x02\x0C\x40" + "\x80\x86\x6C\x44\x22\x12\x04\x02\x10\x04\xF0\x01\x03\x02\x04\x01\x01\x01\x00\x01\x01\x00\x05" + "\x00\x01\x05\xF0\x09\x09\x0B\x11\x11" + "\x15\x25\x39\x4B\x61\x77\x81\x89\x8D\x81\xE4\x53\x2B\x07\x00\x01\x01\x00\x00\x02\x02\x00\x00" + "\x00\x02\x34\x00\x02\x00\x90\x08\x36" + "\x66\x8A\x8A\x40\x16\x0C\x04\xF0\x00\x02\x01\x01\x01\x02\x04\x02\x02\x02\x03\x01\x01\x01\x04" + "\x33\x01\x00\x03\xF0\x05\x07\x09\x09" + "\x11\x25\x2F\x4D\x61\x8B\xAB\xC5\xA3\x71\x3F\x44\x1F\x0B\x01\x00\x66\x01\x01\x00\x00\x01\x00" + "\x80\x02\x06\x1E\x46\x9C\xB0\x70\x40" + "\xF0\x01\x00\x02\x02\x04\x02\x01\x05\x01\x00\x03\x00\x00\x00\x01\xF0\x02\x02\x08\x0A\x02\x01" + "\x02\x02\x01\x05\x03\x03\x0B\x05\x09" + "\xF0\x0D\x15\x19\x41\x69\x93\x89\x71\x51\x2D\x09\x02\x02\x00\x02\x2A\x02\x00\x70\x02\x00\x02" + "\x04\x26\x70\x8C"; BYTE TEST_64X64_GREEN_PLANE[4096] = - "\x2A\x25\x23\x23\x23\x23\x23\x24\x2B\x60\xA2\x97\x84\x75\x62\x50\x3C\x34\x30\x2C\x29\x28\x26\x25\x25\x23\x23\x25\x24\x24\x25\x25" - "\x25\x25\x26\x27\x25\x24\x25\x25\x27\x24\x24\x24\x24\x24\x25\x25\x24\x25\x26\x25\x23\x24\x24\x25\x23\x24\x24\x24\x24\x22\x23\x21" - "\x51\x37\x31\x2C\x29\x28\x27\x27\x2F\x73\xC9\xCC\xCB\xC5\xBD\xB5\xAA\x99\x80\x66\x48\x38\x33\x2E\x29\x27\x27\x26\x25\x25\x23\x23" - "\x26\x26\x25\x27\x25\x25\x25\x26\x23\x24\x23\x25\x24\x23\x26\x25\x25\x25\x25\x24\x23\x25\x23\x24\x24\x24\x25\x24\x26\x24\x24\x24" - "\xBA\xB3\x97\x79\x58\x48\x3A\x31\x37\x79\xCA\xCC\xCD\xCD\xCD\xCD\xCC\xCC\xCC\xCC\xCC\xBC\x9D\x7A\x5C\x4C\x3D\x30\x2B\x29\x28\x27" - "\x25\x24\x24\x23\x25\x26\x25\x25\x23\x24\x27\x27\x24\x24\x24\x24\x25\x25\x25\x25\x26\x27\x25\x23\x23\x23\x25\x24\x22\x24\x26\x26" - "\xBB\xBE\xC0\xC2\xBC\xA7\x90\x78\x63\x87\xCB\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xC2\xAD\x96\x7E\x63\x48\x36\x2C" - "\x27\x27\x24\x24\x25\x24\x25\x24\x22\x25\x26\x26\x23\x23\x23\x23\x27\x26\x25\x26\x26\x26\x24\x24\x24\x24\x23\x22\x25\x24\x24\x24" - "\xBB\xBE\xC0\xC2\xC5\xC7\xC8\xC3\xBA\xBD\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xC8\xBD\xB0\x93\x65" - "\x3A\x33\x2A\x28\x27\x24\x23\x25\x24\x24\x23\x24\x24\x22\x21\x24\x24\x23\x23\x25\x26\x25\x25\x23\x23\x25\x24\x24\x26\x25\x24\x24" - "\xBB\xBE\xC0\xC3\xC4\xC7\xC8\xC8\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCC" - "\xBE\x90\x62\x42\x30\x28\x27\x22\x23\x24\x25\x25\x25\x25\x24\x24\x25\x25\x24\x26\x24\x24\x23\x23\x25\x25\x27\x29\x24\x24\x25\x26" - "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" - "\xCD\xCC\xC0\x9D\x6A\x3F\x2E\x27\x24\x24\x24\x24\x25\x24\x24\x24\x25\x24\x25\x27\x24\x25\x25\x24\x25\x25\x26\x25\x23\x23\x25\x26" - "\xBB\xBE\xC0\xC3\xC4\xC7\xC8\xC9\xCB\xCA\xCC\xCB\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCC\xCC\xCD\xCC\xCC\xC1\xA8\x92\x86\x99" - "\xB9\xCB\xCD\xCD\xBF\x8F\x47\x2E\x26\x25\x24\x25\x24\x26\x25\x25\x24\x25\x25\x24\x23\x24\x26\x24\x25\x27\x25\x24\x24\x23\x23\x24" - "\xBB\xBE\xC0\xC3\xC4\xC7\xC8\xC9\xCA\xCA\xCC\xCB\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCA\xB6\x83\x48\x3B\x39\x3B\x3B" - "\x40\x58\x9B\xC5\xCD\xCD\xA9\x52\x2B\x26\x26\x27\x25\x23\x26\x24\x24\x25\x25\x23\x25\x23\x22\x23\x25\x24\x24\x24\x24\x22\x23\x25" - "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xA8\x5D\x3D\x3D\x5F\x71\x79\x6C" - "\x50\x3D\x47\x7A\xC5\xCD\xCC\x98\x37\x2A\x26\x24\x25\x25\x27\x25\x24\x24\x25\x26\x25\x23\x23\x22\x23\x23\x26\x26\x24\x24\x24\x23" - "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xC3\x59\x3B\x50\x92\xBB\xC4\xC7\xC1" - "\xAE\x75\x40\x3D\x8C\xCC\xCD\xC8\x65\x30\x28\x25\x27\x26\x26\x25\x24\x25\x25\x26\x24\x25\x25\x25\x24\x23\x24\x25\x24\x24\x24\x23" - "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xC7\x70\x3B\x59\xAE\xCC\xCD\xCC\xC9\xC4" - "\xCB\xCA\x8A\x41\x4C\xA1\xCC\xCD\xB0\x45\x2B\x23\x25\x25\x26\x24\x23\x25\x24\x24\x24\x25\x24\x23\x26\x25\x23\x24\x24\x24\x23\x24" - "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xAF\x50\x42\x90\xCA\xCD\xCB\xB0\x84\x74" - "\x8B\xB7\xC0\x64\x3C\x76\xC7\xCD\xC3\x74\x31\x26\x25\x25\x26\x26\x24\x25\x25\x25\x24\x26\x26\x23\x23\x26\x24\x26\x25\x24\x23\x23" - "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\x98\x44\x51\xB4\xCD\xCD\xC0\x73\x3E\x38" - "\x42\x83\xC8\x8F\x3A\x66\xBB\xCD\xCB\x9C\x42\x29\x27\x26\x24\x25\x26\x27\x26\x23\x26\x28\x25\x22\x24\x25\x24\x26\x25\x24\x24\x23" - "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCD\xCD\x80\x39\x58\xC7\xCD\xCC\xC9\x96\x5B\x51" - "\x67\xA3\xCD\xAC\x3D\x58\xAF\xCD\xCD\xBF\x69\x30\x25\x23\x25\x25\x26\x25\x25\x25\x26\x26\x26\x24\x24\x25\x23\x24\x22\x23\x24\x24" - "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCD\xCC\xCD\x8C\x40\x55\xBE\xCD\xCC\xCC\xC9\xBA\xAD" - "\xC0\xCC\xCD\xA5\x3B\x5A\xB1\xCD\xCD\xCC\x8A\x3B\x28\x24\x25\x25\x23\x24\x25\x26\x25\x26\x24\x25\x25\x24\x24\x24\x24\x23\x24\x25" - "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\x9E\x47\x4A\xA9\xCD\xCD\xCD\xCD\xCC\xCC" - "\xCE\xCD\xCD\x80\x3B\x6A\xBF\xCD\xCD\xCD\xAC\x4B\x2A\x26\x25\x26\x23\x26\x25\x25\x23\x24\x25\x25\x25\x25\x25\x26\x24\x23\x24\x22" - "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCA\xC1\xC7\xCC\xCD\xCD\xCD\xCD\xCC\xCD\xBA\x5E\x39\x6B\xBE\xCC\xCD\xCD\xCD\xCD" - "\xCD\xCB\xA8\x4D\x3F\x86\xCC\xCD\xCD\xCD\xC9\x63\x2D\x27\x26\x23\x22\x24\x26\x25\x25\x25\x23\x23\x24\x23\x26\x26\x24\x25\x23\x24" - "\xBA\xBD\xC0\xC2\xC4\xC6\xC8\xC8\xCA\xCB\xCB\xCC\xC8\x9E\x8B\xB5\xCD\xCD\xCD\xCD\xCC\xCC\xCD\x9A\x3B\x42\x7C\xBB\xCD\xCD\xCD\xCD" - "\xC9\xA9\x5F\x3A\x5D\xB4\xCD\xCD\xCC\xCC\xCD\x8C\x30\x27\x26\x23\x22\x23\x25\x25\x23\x23\x25\x23\x24\x24\x25\x23\x25\x25\x24\x24" - "\xBB\xBE\xC0\xC3\xC4\xC6\xC8\xC9\xCA\xCB\xCB\xCC\xCC\xAA\x5E\x59\x99\xC8\xCD\xCD\xCD\xCD\xCD\xC8\x6C\x3A\x3F\x5F\x94\xB1\xB9\xAA" - "\x80\x50\x3A\x40\xA7\xCC\xCD\xCD\xCD\xCD\xCD\xB6\x38\x2A\x25\x23\x24\x26\x26\x25\x26\x24\x23\x22\x24\x24\x24\x23\x24\x24\x24\x24" - "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCA\xCB\xCB\xCC\xCD\xC7\x7B\x3B\x37\x5B\x9E\xBF\xCC\xCD\xCD\xCD\xC4\x89\x4D\x37\x39\x3A\x3C\x3B" - "\x39\x41\x60\xA2\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\x52\x2C\x27\x24\x22\x25\x24\x23\x24\x25\x25\x24\x22\x24\x26\x25\x24\x23\x23\x24" - "\xBC\xBF\xC1\xC4\xC5\xC7\xC8\xC9\xCA\xCB\xCB\xCC\xCD\xCD\xA4\x4B\x30\x32\x40\x67\x9B\xC0\xCD\xCD\xCD\xC8\xA5\x7D\x62\x4C\x49\x57" - "\x6B\x8D\xBB\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCA\xAC\x4A\x2A\x25\x25\x23\x25\x25\x25\x26\x26\x24\x25\x25\x25\x24\x25\x23\x25\x25\x25" - "\xBC\xBF\xC1\xC4\xC5\xC7\xC8\xC9\xCA\xCB\xCC\xCC\xCD\xCD\xC6\x82\x3C\x34\x2F\x30\x42\x63\x98\xC6\xCD\xCD\xCC\xC7\xBC\xB2\xB0\xB7" - "\xC0\xC9\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBC\x81\x4E\x2C\x27\x27\x25\x23\x24\x26\x25\x25\x26\x25\x26\x25\x25\x23\x24\x25\x24\x24\x25" - "\xBD\xC0\xC2\xC4\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCC\xCD\xCD\xCD\xCC\xBA\x85\x59\x40\x31\x31\x36\x4B\x82\xA8\xBC\xC9\xCD\xCD\xCD\xCD" - "\xCC\xCC\xCC\xCD\xCD\xCD\xC8\xB8\x82\x47\x34\x2B\x27\x25\x26\x25\x24\x24\x26\x26\x25\x25\x25\x23\x23\x25\x25\x27\x24\x24\x24\x26" - "\xBE\xC0\xC3\xC4\xC6\xC8\xC8\xC9\xCA\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCB\xBA\x94\x64\x3F\x33\x32\x35\x43\x61\x81\x9F\xB0\xC0\xCB" - "\xCD\xCD\xCC\xC9\xB7\x9B\x7E\x5A\x36\x34\x37\x3D\x29\x25\x25\x26\x24\x25\x24\x25\x24\x23\x24\x22\x22\x25\x25\x27\x23\x25\x25\x25" - "\xBF\xC1\xC3\xC5\xC6\xC8\xC8\xCA\xCA\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xBD\xA2\x72\x47\x36\x34\x33\x34\x43\x4D\x5A\x67" - "\x73\x6B\x66\x61\x53\x42\x35\x34\x3B\x5F\x95\x97\x2E\x25\x24\x25\x25\x25\x24\x24\x25\x24\x25\x23\x23\x24\x25\x26\x22\x25\x25\x25" - "\xC0\xC2\xC4\xC5\xC7\xC8\xC9\xCA\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xCC\xCD\xC7\x9E\x75\x57\x40\x33\x33\x32\x32" - "\x31\x32\x34\x34\x37\x42\x55\x74\xB2\xCC\xCC\x90\x32\x25\x24\x25\x23\x24\x26\x23\x25\x25\x25\x24\x24\x21\x21\x24\x23\x25\x25\x26" - "\xC0\xC2\xC4\xC6\xC7\xC8\xC9\xCA\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCA\xB8\x9C\x83\x76\x66\x56" - "\x4A\x51\x5E\x6B\x83\x9B\xB5\xC9\xCD\xCD\xC5\x66\x2E\x26\x25\x25\x25\x25\x25\x23\x25\x25\x25\x24\x23\x22\x24\x24\x26\x27\x25\x25" - "\xC1\xC3\xC4\xC6\xC8\xC8\xC9\xCA\xCB\xCC\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCB\xC5\xBE\xB7" - "\xB2\xB5\xBB\xC1\xCA\xCD\xCD\xCD\xCD\xCD\x9C\x44\x27\x25\x26\x26\x22\x23\x25\x24\x24\x23\x25\x25\x24\x24\x25\x24\x24\x25\x25\x24" - "\xC2\xC4\xC5\xC7\xC8\xC9\xCA\xCA\xCB\xCC\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC" - "\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xBC\x8C\x48\x2D\x25\x24\x24\x22\x25\x26\x24\x24\x25\x24\x25\x24\x22\x25\x26\x24\x25\x24\x26\x26" - "\xC3\xC4\xC6\xC8\xC8\xC9\xCA\xCB\xCB\xCC\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC" - "\xCD\xCD\xCD\xCD\xCC\xCC\xBE\x9A\x63\x39\x2B\x26\x23\x24\x24\x26\x24\x25\x25\x23\x23\x25\x25\x25\x25\x25\x24\x24\x25\x24\x23\x24" - "\xC4\xC5\xC7\xC8\xC8\xC9\xCA\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD" - "\xCC\xCD\xCD\xCD\xBE\x8C\x5D\x40\x2C\x2A\x29\x26\x22\x23\x24\x25\x24\x24\x26\x25\x24\x23\x23\x23\x22\x23\x23\x24\x23\x25\x24\x24" - "\xC4\xC6\xC7\xC8\xC9\xC9\xC9\xCA\xCC\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCD\xCD\xCC\xCC\xC7" - "\xBC\xAF\x92\x67\x3B\x32\x2D\x28\x26\x25\x26\x25\x25\x26\x25\x25\x27\x25\x25\x25\x23\x23\x24\x23\x24\x25\x25\x25\x23\x25\x26\x24" - "\xC5\xC7\xC8\xC8\xC8\xBD\xAD\xA7\xA1\xA0\xA7\xB0\xB9\xC0\xC6\xCB\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCB\xC4\xBA\xAF\x9F\x8B\x78" - "\x61\x48\x35\x30\x2B\x27\x26\x25\x24\x24\x23\x24\x24\x24\x24\x26\x24\x23\x24\x27\x24\x23\x24\x24\x24\x24\x22\x24\x25\x25\x26\x24" - "\xC6\xC8\xC8\xC8\x8C\x5E\x4D\x49\x42\x44\x47\x4E\x54\x58\x5C\x63\x6F\x7B\x87\x91\x8E\x8A\x86\x81\x75\x67\x5C\x55\x4E\x41\x34\x31" - "\x2C\x2B\x29\x25\x28\x26\x25\x24\x26\x25\x25\x25\x24\x25\x25\x26\x25\x25\x24\x25\x25\x24\x24\x24\x25\x23\x21\x23\x25\x25\x27\x25" - "\xC7\xC8\xC3\x7B\x35\x2B\x26\x26\x24\x27\x28\x29\x29\x29\x2C\x2D\x2D\x2D\x2D\x30\x2F\x2F\x30\x2F\x2C\x2D\x2B\x29\x27\x26\x26\x26" - "\x26\x24\x24\x24\x24\x24\x24\x25\x25\x25\x27\x26\x24\x24\x24\x25\x24\x24\x26\x25\x26\x23\x26\x24\x24\x25\x24\x25\x22\x23\x25\x25" - "\xC8\xC8\xA4\x49\x29\x25\x22\x22\x24\x25\x26\x25\x24\x25\x25\x24\x25\x26\x27\x25\x26\x26\x26\x25\x25\x25\x26\x26\x25\x23\x24\x25" - "\x25\x23\x25\x26\x27\x25\x24\x25\x26\x27\x27\x25\x22\x22\x23\x26\x24\x24\x24\x25\x26\x24\x26\x25\x23\x25\x25\x25\x25\x25\x26\x24" - "\xC8\xC8\x80\x36\x26\x23\x22\x23\x23\x24\x27\x27\x24\x24\x25\x24\x24\x27\x26\x24\x24\x25\x25\x24\x25\x24\x25\x25\x24\x25\x25\x24" - "\x25\x25\x25\x24\x23\x24\x25\x24\x24\x25\x23\x23\x24\x25\x24\x25\x24\x25\x27\x27\x24\x24\x26\x26\x24\x26\x27\x25\x25\x25\x24\x26" - "\xC9\xC1\x6C\x30\x25\x22\x23\x23\x23\x24\x25\x26\x24\x24\x25\x26\x26\x27\x26\x26\x24\x24\x25\x24\x24\x24\x26\x26\x25\x25\x25\x25" - "\x24\x26\x23\x23\x25\x24\x25\x25\x23\x24\x23\x24\x25\x23\x24\x23\x25\x25\x24\x24\x24\x23\x24\x25\x26\x25\x25\x25\x24\x25\x24\x24" - "\xC9\xBE\x68\x2E\x24\x23\x25\x23\x23\x24\x24\x24\x24\x25\x25\x26\x27\x25\x25\x25\x24\x23\x23\x24\x25\x25\x26\x25\x25\x25\x26\x26" - "\x25\x24\x22\x23\x26\x25\x24\x24\x25\x25\x25\x25\x24\x23\x23\x25\x25\x26\x25\x25\x24\x24\x23\x23\x23\x24\x23\x25\x24\x25\x24\x24" - "\xCA\xBB\x66\x2D\x22\x23\x23\x24\x23\x24\x25\x25\x27\x26\x24\x23\x24\x25\x27\x24\x22\x24\x25\x24\x25\x27\x25\x24\x26\x26\x26\x28" - "\x25\x25\x25\x25\x23\x25\x26\x25\x25\x24\x24\x21\x22\x23\x25\x25\x26\x24\x24\x27\x24\x26\x25\x26\x24\x25\x24\x24\x25\x25\x25\x23" - "\xCB\xC0\x6A\x2D\x25\x25\x26\x24\x25\x25\x25\x24\x27\x27\x26\x26\x24\x25\x25\x25\x23\x25\x25\x26\x26\x25\x25\x26\x24\x26\x25\x25" - "\x24\x23\x24\x23\x23\x23\x25\x24\x25\x23\x23\x22\x25\x25\x27\x24\x24\x26\x23\x23\x26\x24\x26\x25\x24\x23\x23\x24\x25\x23\x25\x26" - "\xCB\xC6\x71\x2F\x25\x23\x25\x25\x23\x24\x25\x26\x24\x25\x24\x25\x26\x24\x24\x23\x25\x25\x25\x24\x26\x25\x25\x26\x24\x26\x24\x25" - "\x25\x23\x24\x25\x23\x23\x25\x26\x25\x24\x24\x24\x26\x26\x25\x26\x22\x23\x23\x25\x23\x24\x25\x25\x24\x24\x25\x25\x24\x25\x25\x24" - "\xCB\xCB\x87\x39\x25\x22\x24\x26\x25\x24\x24\x27\x24\x24\x24\x20\x23\x25\x24\x26\x24\x24\x24\x24\x25\x23\x24\x25\x25\x28\x26\x26" - "\x27\x27\x26\x25\x25\x26\x26\x25\x23\x24\x24\x24\x24\x24\x25\x25\x23\x24\x23\x25\x22\x24\x27\x24\x24\x26\x25\x24\x26\x25\x24\x23" - "\xCC\xCC\xA6\x47\x25\x26\x26\x25\x25\x22\x24\x25\x24\x25\x25\x24\x23\x22\x23\x26\x24\x23\x25\x23\x24\x25\x25\x24\x23\x24\x24\x23" - "\x23\x26\x23\x22\x24\x25\x25\x26\x24\x23\x24\x24\x23\x23\x25\x23\x26\x24\x25\x24\x26\x25\x24\x22\x26\x25\x24\x25\x23\x25\x25\x23" - "\xCC\xCC\xBE\x52\x2A\x26\x24\x25\x24\x26\x24\x23\x24\x24\x25\x25\x25\x25\x25\x29\x25\x24\x26\x24\x24\x25\x26\x24\x25\x25\x24\x23" - "\x22\x22\x24\x24\x23\x25\x25\x24\x25\x24\x26\x27\x26\x24\x22\x23\x24\x25\x25\x25\x24\x25\x25\x23\x24\x23\x23\x26\x23\x25\x25\x25" - "\xCC\xCC\xCA\x6C\x2F\x28\x25\x27\x25\x25\x24\x25\x25\x24\x22\x24\x25\x24\x25\x23\x24\x24\x25\x24\x24\x25\x26\x25\x24\x26\x25\x24" - "\x25\x24\x26\x24\x24\x25\x25\x24\x27\x25\x25\x26\x26\x26\x25\x25\x26\x26\x24\x26\x24\x24\x24\x25\x23\x24\x24\x24\x24\x23\x24\x25" - "\xCC\xCD\xCD\xA3\x35\x29\x25\x25\x26\x25\x26\x27\x25\x26\x23\x22\x25\x24\x24\x26\x26\x24\x25\x25\x25\x25\x25\x23\x26\x27\x24\x24" - "\x22\x24\x24\x24\x24\x24\x24\x23\x23\x26\x26\x25\x25\x24\x25\x25\x24\x27\x25\x25\x24\x24\x24\x26\x25\x24\x24\x24\x25\x24\x24\x23" - "\xCD\xCD\xCD\xC8\x53\x2E\x25\x23\x25\x26\x26\x26\x24\x26\x27\x25\x25\x25\x25\x24\x24\x25\x27\x25\x24\x25\x25\x23\x26\x25\x24\x23" - "\x23\x25\x23\x23\x25\x24\x24\x25\x23\x26\x25\x25\x24\x22\x25\x26\x24\x25\x25\x25\x25\x24\x24\x26\x25\x26\x25\x23\x24\x25\x24\x23" - "\xCD\xCD\xCD\xCD\x8E\x3C\x32\x30\x2F\x2F\x2D\x2E\x2B\x2A\x2B\x2A\x29\x29\x28\x27\x25\x28\x28\x24\x23\x25\x25\x23\x22\x23\x24\x25" - "\x24\x25\x26\x25\x25\x24\x24\x23\x23\x24\x25\x23\x23\x23\x25\x24\x25\x25\x25\x24\x25\x23\x25\x22\x24\x25\x25\x24\x24\x24\x23\x24" - "\xCD\xCD\xCD\xCD\xC5\xA2\x94\x8D\x87\x7F\x79\x71\x68\x65\x60\x5E\x5A\x51\x48\x41\x35\x31\x31\x2E\x2D\x2A\x2A\x27\x26\x25\x24\x27" - "\x26\x24\x25\x24\x23\x23\x23\x23\x26\x24\x27\x26\x26\x24\x25\x24\x26\x26\x24\x24\x24\x24\x25\x24\x25\x23\x26\x25\x26\x25\x26\x26" - "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xC9\xC6\xBF\xB4\xA8\x9C\x8D\x82\x76\x6A\x5A\x4B\x3D\x35\x32\x2F\x2C\x2B" - "\x29\x26\x25\x24\x25\x23\x24\x26\x25\x25\x25\x25\x24\x24\x24\x24\x24\x25\x24\x24\x25\x24\x26\x26\x26\x26\x25\x26\x26\x26\x25\x25" - "\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCA\xC5\xC0\xB9\xB3\xAC\xA1\x8E\x76\x56\x3D" - "\x36\x31\x2A\x28\x29\x26\x27\x26\x25\x26\x24\x25\x24\x25\x26\x24\x25\x25\x26\x24\x24\x23\x23\x26\x26\x26\x26\x24\x25\x24\x24\x24" - "\xCE\xCC\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCC\xC6" - "\xA9\x8C\x6D\x5B\x49\x3D\x32\x2E\x2B\x28\x25\x23\x24\x24\x23\x26\x26\x25\x24\x23\x24\x23\x24\x24\x26\x26\x26\x25\x26\x24\x21\x24" - "\xCD\xCD\xCD\xCD\xCC\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" - "\xCC\xCD\xCB\xC0\xAB\x97\x82\x6E\x54\x3C\x30\x2C\x29\x27\x25\x27\x25\x25\x24\x23\x23\x24\x24\x24\x26\x24\x25\x24\x23\x24\x25\x24" - "\xCD\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD" - "\xCC\xCD\xCD\xCC\xCD\xCD\xCA\xC2\xB6\xA7\x86\x5A\x38\x31\x2C\x28\x26\x25\x24\x24\x24\x25\x26\x26\x29\x25\x25\x26\x27\x25\x25\x26" - "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" - "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xCC\xBB\x91\x68\x4F\x3A\x30\x2A\x28\x26\x25\x24\x23\x24\x24\x25\x26\x23\x23\x26\x25" - "\xCB\xCA\xC9\xCB\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" - "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xC8\xB4\x93\x76\x57\x3B\x30\x2D\x28\x25\x25\x25\x25\x25\x22\x23\x24\x25" - "\x64\x62\x61\x62\x68\x71\x7B\x81\x8C\x94\x9C\xA3\xAB\xB5\xC3\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" - "\xCD\xCD\xCD\xCD\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCC\xC5\xB8\xA5\x79\x4C\x34\x2E\x26\x25\x25\x27\x21\x26\x26\x25" - "\x2C\x2B\x28\x2C\x2C\x2B\x2B\x2F\x2E\x31\x33\x34\x37\x38\x3B\x43\x5B\x70\x83\x95\xA7\xAF\xB6\xBC\xC5\xCB\xCD\xCD\xCD\xCD\xCD\xCD" - "\xCC\xCD\xCD\xCD\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCD\xCD\xCD\xCC\xC6\xA1\x6E\x4A\x35\x29\x24\x27\x26\x24\x24" - "\x26\x25\x23\x23\x26\x25\x26\x25\x25\x24\x28\x2A\x26\x28\x29\x2C\x2B\x2E\x30\x33\x37\x44\x53\x61\x74\x88\x9D\xB1\xC4\xCD\xCD\xCD" - "\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCD\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xC9\xA7\x81\x58\x39\x30\x2A\x26\x25" - "\x25\x24\x26\x26\x24\x24\x23\x24\x23\x24\x26\x28\x25\x26\x25\x26\x27\x25\x26\x27\x28\x28\x2A\x2C\x31\x35\x42\x50\x61\x74\x92\xAF" - "\xC9\xCD\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCC\xC8\xB8\x9B\x5E\x39\x2F\x2A" - "\x24\x23\x23\x24\x23\x24\x25\x26\x25\x25\x25\x25\x24\x24\x25\x24\x24\x24\x22\x25\x25\x24\x24\x24\x27\x27\x28\x2C\x2B\x2C\x31\x36" - "\x3F\x5A\x7D\xA0\xB8\xC5\xCC\xCD\xCD\xCC\xCC\xCD\xCC\xCC\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCA\xB2\x7D\x55" - "\x22\x23\x25\x25\x25\x25\x25\x24\x24\x24\x23\x24\x25\x24\x24\x24\x25\x26\x26\x25\x24\x25\x25\x25\x24\x24\x25\x26\x25\x26\x27\x29" - "\x2A\x2C\x31\x38\x57\x74\x91\xAD\xC7\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCB\xB7"; + "\x2A\x25\x23\x23\x23\x23\x23\x24\x2B\x60\xA2\x97\x84\x75\x62\x50\x3C\x34\x30\x2C\x29\x28\x26" + "\x25\x25\x23\x23\x25\x24\x24\x25\x25" + "\x25\x25\x26\x27\x25\x24\x25\x25\x27\x24\x24\x24\x24\x24\x25\x25\x24\x25\x26\x25\x23\x24\x24" + "\x25\x23\x24\x24\x24\x24\x22\x23\x21" + "\x51\x37\x31\x2C\x29\x28\x27\x27\x2F\x73\xC9\xCC\xCB\xC5\xBD\xB5\xAA\x99\x80\x66\x48\x38\x33" + "\x2E\x29\x27\x27\x26\x25\x25\x23\x23" + "\x26\x26\x25\x27\x25\x25\x25\x26\x23\x24\x23\x25\x24\x23\x26\x25\x25\x25\x25\x24\x23\x25\x23" + "\x24\x24\x24\x25\x24\x26\x24\x24\x24" + "\xBA\xB3\x97\x79\x58\x48\x3A\x31\x37\x79\xCA\xCC\xCD\xCD\xCD\xCD\xCC\xCC\xCC\xCC\xCC\xBC\x9D" + "\x7A\x5C\x4C\x3D\x30\x2B\x29\x28\x27" + "\x25\x24\x24\x23\x25\x26\x25\x25\x23\x24\x27\x27\x24\x24\x24\x24\x25\x25\x25\x25\x26\x27\x25" + "\x23\x23\x23\x25\x24\x22\x24\x26\x26" + "\xBB\xBE\xC0\xC2\xBC\xA7\x90\x78\x63\x87\xCB\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xC2\xAD\x96\x7E\x63\x48\x36\x2C" + "\x27\x27\x24\x24\x25\x24\x25\x24\x22\x25\x26\x26\x23\x23\x23\x23\x27\x26\x25\x26\x26\x26\x24" + "\x24\x24\x24\x23\x22\x25\x24\x24\x24" + "\xBB\xBE\xC0\xC2\xC5\xC7\xC8\xC3\xBA\xBD\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xC8\xBD\xB0\x93\x65" + "\x3A\x33\x2A\x28\x27\x24\x23\x25\x24\x24\x23\x24\x24\x22\x21\x24\x24\x23\x23\x25\x26\x25\x25" + "\x23\x23\x25\x24\x24\x26\x25\x24\x24" + "\xBB\xBE\xC0\xC3\xC4\xC7\xC8\xC8\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCC" + "\xBE\x90\x62\x42\x30\x28\x27\x22\x23\x24\x25\x25\x25\x25\x24\x24\x25\x25\x24\x26\x24\x24\x23" + "\x23\x25\x25\x27\x29\x24\x24\x25\x26" + "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC" + "\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCC\xC0\x9D\x6A\x3F\x2E\x27\x24\x24\x24\x24\x25\x24\x24\x24\x25\x24\x25\x27\x24\x25\x25" + "\x24\x25\x25\x26\x25\x23\x23\x25\x26" + "\xBB\xBE\xC0\xC3\xC4\xC7\xC8\xC9\xCB\xCA\xCC\xCB\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCC" + "\xCC\xCD\xCC\xCC\xC1\xA8\x92\x86\x99" + "\xB9\xCB\xCD\xCD\xBF\x8F\x47\x2E\x26\x25\x24\x25\x24\x26\x25\x25\x24\x25\x25\x24\x23\x24\x26" + "\x24\x25\x27\x25\x24\x24\x23\x23\x24" + "\xBB\xBE\xC0\xC3\xC4\xC7\xC8\xC9\xCA\xCA\xCC\xCB\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCA\xB6\x83\x48\x3B\x39\x3B\x3B" + "\x40\x58\x9B\xC5\xCD\xCD\xA9\x52\x2B\x26\x26\x27\x25\x23\x26\x24\x24\x25\x25\x23\x25\x23\x22" + "\x23\x25\x24\x24\x24\x24\x22\x23\x25" + "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC" + "\xCD\xA8\x5D\x3D\x3D\x5F\x71\x79\x6C" + "\x50\x3D\x47\x7A\xC5\xCD\xCC\x98\x37\x2A\x26\x24\x25\x25\x27\x25\x24\x24\x25\x26\x25\x23\x23" + "\x22\x23\x23\x26\x26\x24\x24\x24\x23" + "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC" + "\xC3\x59\x3B\x50\x92\xBB\xC4\xC7\xC1" + "\xAE\x75\x40\x3D\x8C\xCC\xCD\xC8\x65\x30\x28\x25\x27\x26\x26\x25\x24\x25\x25\x26\x24\x25\x25" + "\x25\x24\x23\x24\x25\x24\x24\x24\x23" + "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xC7" + "\x70\x3B\x59\xAE\xCC\xCD\xCC\xC9\xC4" + "\xCB\xCA\x8A\x41\x4C\xA1\xCC\xCD\xB0\x45\x2B\x23\x25\x25\x26\x24\x23\x25\x24\x24\x24\x25\x24" + "\x23\x26\x25\x23\x24\x24\x24\x23\x24" + "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xAF" + "\x50\x42\x90\xCA\xCD\xCB\xB0\x84\x74" + "\x8B\xB7\xC0\x64\x3C\x76\xC7\xCD\xC3\x74\x31\x26\x25\x25\x26\x26\x24\x25\x25\x25\x24\x26\x26" + "\x23\x23\x26\x24\x26\x25\x24\x23\x23" + "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\x98" + "\x44\x51\xB4\xCD\xCD\xC0\x73\x3E\x38" + "\x42\x83\xC8\x8F\x3A\x66\xBB\xCD\xCB\x9C\x42\x29\x27\x26\x24\x25\x26\x27\x26\x23\x26\x28\x25" + "\x22\x24\x25\x24\x26\x25\x24\x24\x23" + "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCD\xCD\x80" + "\x39\x58\xC7\xCD\xCC\xC9\x96\x5B\x51" + "\x67\xA3\xCD\xAC\x3D\x58\xAF\xCD\xCD\xBF\x69\x30\x25\x23\x25\x25\x26\x25\x25\x25\x26\x26\x26" + "\x24\x24\x25\x23\x24\x22\x23\x24\x24" + "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCD\xCC\xCD\x8C" + "\x40\x55\xBE\xCD\xCC\xCC\xC9\xBA\xAD" + "\xC0\xCC\xCD\xA5\x3B\x5A\xB1\xCD\xCD\xCC\x8A\x3B\x28\x24\x25\x25\x23\x24\x25\x26\x25\x26\x24" + "\x25\x25\x24\x24\x24\x24\x23\x24\x25" + "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\x9E" + "\x47\x4A\xA9\xCD\xCD\xCD\xCD\xCC\xCC" + "\xCE\xCD\xCD\x80\x3B\x6A\xBF\xCD\xCD\xCD\xAC\x4B\x2A\x26\x25\x26\x23\x26\x25\x25\x23\x24\x25" + "\x25\x25\x25\x25\x26\x24\x23\x24\x22" + "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCB\xCB\xCC\xCC\xCA\xC1\xC7\xCC\xCD\xCD\xCD\xCD\xCC\xCD\xBA" + "\x5E\x39\x6B\xBE\xCC\xCD\xCD\xCD\xCD" + "\xCD\xCB\xA8\x4D\x3F\x86\xCC\xCD\xCD\xCD\xC9\x63\x2D\x27\x26\x23\x22\x24\x26\x25\x25\x25\x23" + "\x23\x24\x23\x26\x26\x24\x25\x23\x24" + "\xBA\xBD\xC0\xC2\xC4\xC6\xC8\xC8\xCA\xCB\xCB\xCC\xC8\x9E\x8B\xB5\xCD\xCD\xCD\xCD\xCC\xCC\xCD" + "\x9A\x3B\x42\x7C\xBB\xCD\xCD\xCD\xCD" + "\xC9\xA9\x5F\x3A\x5D\xB4\xCD\xCD\xCC\xCC\xCD\x8C\x30\x27\x26\x23\x22\x23\x25\x25\x23\x23\x25" + "\x23\x24\x24\x25\x23\x25\x25\x24\x24" + "\xBB\xBE\xC0\xC3\xC4\xC6\xC8\xC9\xCA\xCB\xCB\xCC\xCC\xAA\x5E\x59\x99\xC8\xCD\xCD\xCD\xCD\xCD" + "\xC8\x6C\x3A\x3F\x5F\x94\xB1\xB9\xAA" + "\x80\x50\x3A\x40\xA7\xCC\xCD\xCD\xCD\xCD\xCD\xB6\x38\x2A\x25\x23\x24\x26\x26\x25\x26\x24\x23" + "\x22\x24\x24\x24\x23\x24\x24\x24\x24" + "\xBB\xBE\xC0\xC3\xC5\xC7\xC8\xC9\xCA\xCB\xCB\xCC\xCD\xC7\x7B\x3B\x37\x5B\x9E\xBF\xCC\xCD\xCD" + "\xCD\xC4\x89\x4D\x37\x39\x3A\x3C\x3B" + "\x39\x41\x60\xA2\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\x52\x2C\x27\x24\x22\x25\x24\x23\x24\x25\x25" + "\x24\x22\x24\x26\x25\x24\x23\x23\x24" + "\xBC\xBF\xC1\xC4\xC5\xC7\xC8\xC9\xCA\xCB\xCB\xCC\xCD\xCD\xA4\x4B\x30\x32\x40\x67\x9B\xC0\xCD" + "\xCD\xCD\xC8\xA5\x7D\x62\x4C\x49\x57" + "\x6B\x8D\xBB\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCA\xAC\x4A\x2A\x25\x25\x23\x25\x25\x25\x26\x26\x24" + "\x25\x25\x25\x24\x25\x23\x25\x25\x25" + "\xBC\xBF\xC1\xC4\xC5\xC7\xC8\xC9\xCA\xCB\xCC\xCC\xCD\xCD\xC6\x82\x3C\x34\x2F\x30\x42\x63\x98" + "\xC6\xCD\xCD\xCC\xC7\xBC\xB2\xB0\xB7" + "\xC0\xC9\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBC\x81\x4E\x2C\x27\x27\x25\x23\x24\x26\x25\x25\x26\x25" + "\x26\x25\x25\x23\x24\x25\x24\x24\x25" + "\xBD\xC0\xC2\xC4\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCC\xCD\xCD\xCD\xCC\xBA\x85\x59\x40\x31\x31\x36" + "\x4B\x82\xA8\xBC\xC9\xCD\xCD\xCD\xCD" + "\xCC\xCC\xCC\xCD\xCD\xCD\xC8\xB8\x82\x47\x34\x2B\x27\x25\x26\x25\x24\x24\x26\x26\x25\x25\x25" + "\x23\x23\x25\x25\x27\x24\x24\x24\x26" + "\xBE\xC0\xC3\xC4\xC6\xC8\xC8\xC9\xCA\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCB\xBA\x94\x64\x3F\x33" + "\x32\x35\x43\x61\x81\x9F\xB0\xC0\xCB" + "\xCD\xCD\xCC\xC9\xB7\x9B\x7E\x5A\x36\x34\x37\x3D\x29\x25\x25\x26\x24\x25\x24\x25\x24\x23\x24" + "\x22\x22\x25\x25\x27\x23\x25\x25\x25" + "\xBF\xC1\xC3\xC5\xC6\xC8\xC8\xCA\xCA\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xBD\xA2\x72" + "\x47\x36\x34\x33\x34\x43\x4D\x5A\x67" + "\x73\x6B\x66\x61\x53\x42\x35\x34\x3B\x5F\x95\x97\x2E\x25\x24\x25\x25\x25\x24\x24\x25\x24\x25" + "\x23\x23\x24\x25\x26\x22\x25\x25\x25" + "\xC0\xC2\xC4\xC5\xC7\xC8\xC9\xCA\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xCC\xCD" + "\xC7\x9E\x75\x57\x40\x33\x33\x32\x32" + "\x31\x32\x34\x34\x37\x42\x55\x74\xB2\xCC\xCC\x90\x32\x25\x24\x25\x23\x24\x26\x23\x25\x25\x25" + "\x24\x24\x21\x21\x24\x23\x25\x25\x26" + "\xC0\xC2\xC4\xC6\xC7\xC8\xC9\xCA\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCA\xB8\x9C\x83\x76\x66\x56" + "\x4A\x51\x5E\x6B\x83\x9B\xB5\xC9\xCD\xCD\xC5\x66\x2E\x26\x25\x25\x25\x25\x25\x23\x25\x25\x25" + "\x24\x23\x22\x24\x24\x26\x27\x25\x25" + "\xC1\xC3\xC4\xC6\xC8\xC8\xC9\xCA\xCB\xCC\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCD\xCB\xC5\xBE\xB7" + "\xB2\xB5\xBB\xC1\xCA\xCD\xCD\xCD\xCD\xCD\x9C\x44\x27\x25\x26\x26\x22\x23\x25\x24\x24\x23\x25" + "\x25\x24\x24\x25\x24\x24\x25\x25\x24" + "\xC2\xC4\xC5\xC7\xC8\xC9\xCA\xCA\xCB\xCC\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC" + "\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xBC\x8C\x48\x2D\x25\x24\x24\x22\x25\x26\x24\x24\x25\x24\x25" + "\x24\x22\x25\x26\x24\x25\x24\x26\x26" + "\xC3\xC4\xC6\xC8\xC8\xC9\xCA\xCB\xCB\xCC\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC" + "\xCD\xCD\xCD\xCD\xCC\xCC\xBE\x9A\x63\x39\x2B\x26\x23\x24\x24\x26\x24\x25\x25\x23\x23\x25\x25" + "\x25\x25\x25\x24\x24\x25\x24\x23\x24" + "\xC4\xC5\xC7\xC8\xC8\xC9\xCA\xCB\xCB\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCC\xCD\xCD\xCD\xBE\x8C\x5D\x40\x2C\x2A\x29\x26\x22\x23\x24\x25\x24\x24\x26\x25\x24\x23\x23" + "\x23\x22\x23\x23\x24\x23\x25\x24\x24" + "\xC4\xC6\xC7\xC8\xC9\xC9\xC9\xCA\xCC\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCC\xCC\xCD\xCD\xCC\xCC\xC7" + "\xBC\xAF\x92\x67\x3B\x32\x2D\x28\x26\x25\x26\x25\x25\x26\x25\x25\x27\x25\x25\x25\x23\x23\x24" + "\x23\x24\x25\x25\x25\x23\x25\x26\x24" + "\xC5\xC7\xC8\xC8\xC8\xBD\xAD\xA7\xA1\xA0\xA7\xB0\xB9\xC0\xC6\xCB\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCB\xC4\xBA\xAF\x9F\x8B\x78" + "\x61\x48\x35\x30\x2B\x27\x26\x25\x24\x24\x23\x24\x24\x24\x24\x26\x24\x23\x24\x27\x24\x23\x24" + "\x24\x24\x24\x22\x24\x25\x25\x26\x24" + "\xC6\xC8\xC8\xC8\x8C\x5E\x4D\x49\x42\x44\x47\x4E\x54\x58\x5C\x63\x6F\x7B\x87\x91\x8E\x8A\x86" + "\x81\x75\x67\x5C\x55\x4E\x41\x34\x31" + "\x2C\x2B\x29\x25\x28\x26\x25\x24\x26\x25\x25\x25\x24\x25\x25\x26\x25\x25\x24\x25\x25\x24\x24" + "\x24\x25\x23\x21\x23\x25\x25\x27\x25" + "\xC7\xC8\xC3\x7B\x35\x2B\x26\x26\x24\x27\x28\x29\x29\x29\x2C\x2D\x2D\x2D\x2D\x30\x2F\x2F\x30" + "\x2F\x2C\x2D\x2B\x29\x27\x26\x26\x26" + "\x26\x24\x24\x24\x24\x24\x24\x25\x25\x25\x27\x26\x24\x24\x24\x25\x24\x24\x26\x25\x26\x23\x26" + "\x24\x24\x25\x24\x25\x22\x23\x25\x25" + "\xC8\xC8\xA4\x49\x29\x25\x22\x22\x24\x25\x26\x25\x24\x25\x25\x24\x25\x26\x27\x25\x26\x26\x26" + "\x25\x25\x25\x26\x26\x25\x23\x24\x25" + "\x25\x23\x25\x26\x27\x25\x24\x25\x26\x27\x27\x25\x22\x22\x23\x26\x24\x24\x24\x25\x26\x24\x26" + "\x25\x23\x25\x25\x25\x25\x25\x26\x24" + "\xC8\xC8\x80\x36\x26\x23\x22\x23\x23\x24\x27\x27\x24\x24\x25\x24\x24\x27\x26\x24\x24\x25\x25" + "\x24\x25\x24\x25\x25\x24\x25\x25\x24" + "\x25\x25\x25\x24\x23\x24\x25\x24\x24\x25\x23\x23\x24\x25\x24\x25\x24\x25\x27\x27\x24\x24\x26" + "\x26\x24\x26\x27\x25\x25\x25\x24\x26" + "\xC9\xC1\x6C\x30\x25\x22\x23\x23\x23\x24\x25\x26\x24\x24\x25\x26\x26\x27\x26\x26\x24\x24\x25" + "\x24\x24\x24\x26\x26\x25\x25\x25\x25" + "\x24\x26\x23\x23\x25\x24\x25\x25\x23\x24\x23\x24\x25\x23\x24\x23\x25\x25\x24\x24\x24\x23\x24" + "\x25\x26\x25\x25\x25\x24\x25\x24\x24" + "\xC9\xBE\x68\x2E\x24\x23\x25\x23\x23\x24\x24\x24\x24\x25\x25\x26\x27\x25\x25\x25\x24\x23\x23" + "\x24\x25\x25\x26\x25\x25\x25\x26\x26" + "\x25\x24\x22\x23\x26\x25\x24\x24\x25\x25\x25\x25\x24\x23\x23\x25\x25\x26\x25\x25\x24\x24\x23" + "\x23\x23\x24\x23\x25\x24\x25\x24\x24" + "\xCA\xBB\x66\x2D\x22\x23\x23\x24\x23\x24\x25\x25\x27\x26\x24\x23\x24\x25\x27\x24\x22\x24\x25" + "\x24\x25\x27\x25\x24\x26\x26\x26\x28" + "\x25\x25\x25\x25\x23\x25\x26\x25\x25\x24\x24\x21\x22\x23\x25\x25\x26\x24\x24\x27\x24\x26\x25" + "\x26\x24\x25\x24\x24\x25\x25\x25\x23" + "\xCB\xC0\x6A\x2D\x25\x25\x26\x24\x25\x25\x25\x24\x27\x27\x26\x26\x24\x25\x25\x25\x23\x25\x25" + "\x26\x26\x25\x25\x26\x24\x26\x25\x25" + "\x24\x23\x24\x23\x23\x23\x25\x24\x25\x23\x23\x22\x25\x25\x27\x24\x24\x26\x23\x23\x26\x24\x26" + "\x25\x24\x23\x23\x24\x25\x23\x25\x26" + "\xCB\xC6\x71\x2F\x25\x23\x25\x25\x23\x24\x25\x26\x24\x25\x24\x25\x26\x24\x24\x23\x25\x25\x25" + "\x24\x26\x25\x25\x26\x24\x26\x24\x25" + "\x25\x23\x24\x25\x23\x23\x25\x26\x25\x24\x24\x24\x26\x26\x25\x26\x22\x23\x23\x25\x23\x24\x25" + "\x25\x24\x24\x25\x25\x24\x25\x25\x24" + "\xCB\xCB\x87\x39\x25\x22\x24\x26\x25\x24\x24\x27\x24\x24\x24\x20\x23\x25\x24\x26\x24\x24\x24" + "\x24\x25\x23\x24\x25\x25\x28\x26\x26" + "\x27\x27\x26\x25\x25\x26\x26\x25\x23\x24\x24\x24\x24\x24\x25\x25\x23\x24\x23\x25\x22\x24\x27" + "\x24\x24\x26\x25\x24\x26\x25\x24\x23" + "\xCC\xCC\xA6\x47\x25\x26\x26\x25\x25\x22\x24\x25\x24\x25\x25\x24\x23\x22\x23\x26\x24\x23\x25" + "\x23\x24\x25\x25\x24\x23\x24\x24\x23" + "\x23\x26\x23\x22\x24\x25\x25\x26\x24\x23\x24\x24\x23\x23\x25\x23\x26\x24\x25\x24\x26\x25\x24" + "\x22\x26\x25\x24\x25\x23\x25\x25\x23" + "\xCC\xCC\xBE\x52\x2A\x26\x24\x25\x24\x26\x24\x23\x24\x24\x25\x25\x25\x25\x25\x29\x25\x24\x26" + "\x24\x24\x25\x26\x24\x25\x25\x24\x23" + "\x22\x22\x24\x24\x23\x25\x25\x24\x25\x24\x26\x27\x26\x24\x22\x23\x24\x25\x25\x25\x24\x25\x25" + "\x23\x24\x23\x23\x26\x23\x25\x25\x25" + "\xCC\xCC\xCA\x6C\x2F\x28\x25\x27\x25\x25\x24\x25\x25\x24\x22\x24\x25\x24\x25\x23\x24\x24\x25" + "\x24\x24\x25\x26\x25\x24\x26\x25\x24" + "\x25\x24\x26\x24\x24\x25\x25\x24\x27\x25\x25\x26\x26\x26\x25\x25\x26\x26\x24\x26\x24\x24\x24" + "\x25\x23\x24\x24\x24\x24\x23\x24\x25" + "\xCC\xCD\xCD\xA3\x35\x29\x25\x25\x26\x25\x26\x27\x25\x26\x23\x22\x25\x24\x24\x26\x26\x24\x25" + "\x25\x25\x25\x25\x23\x26\x27\x24\x24" + "\x22\x24\x24\x24\x24\x24\x24\x23\x23\x26\x26\x25\x25\x24\x25\x25\x24\x27\x25\x25\x24\x24\x24" + "\x26\x25\x24\x24\x24\x25\x24\x24\x23" + "\xCD\xCD\xCD\xC8\x53\x2E\x25\x23\x25\x26\x26\x26\x24\x26\x27\x25\x25\x25\x25\x24\x24\x25\x27" + "\x25\x24\x25\x25\x23\x26\x25\x24\x23" + "\x23\x25\x23\x23\x25\x24\x24\x25\x23\x26\x25\x25\x24\x22\x25\x26\x24\x25\x25\x25\x25\x24\x24" + "\x26\x25\x26\x25\x23\x24\x25\x24\x23" + "\xCD\xCD\xCD\xCD\x8E\x3C\x32\x30\x2F\x2F\x2D\x2E\x2B\x2A\x2B\x2A\x29\x29\x28\x27\x25\x28\x28" + "\x24\x23\x25\x25\x23\x22\x23\x24\x25" + "\x24\x25\x26\x25\x25\x24\x24\x23\x23\x24\x25\x23\x23\x23\x25\x24\x25\x25\x25\x24\x25\x23\x25" + "\x22\x24\x25\x25\x24\x24\x24\x23\x24" + "\xCD\xCD\xCD\xCD\xC5\xA2\x94\x8D\x87\x7F\x79\x71\x68\x65\x60\x5E\x5A\x51\x48\x41\x35\x31\x31" + "\x2E\x2D\x2A\x2A\x27\x26\x25\x24\x27" + "\x26\x24\x25\x24\x23\x23\x23\x23\x26\x24\x27\x26\x26\x24\x25\x24\x26\x26\x24\x24\x24\x24\x25" + "\x24\x25\x23\x26\x25\x26\x25\x26\x26" + "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xC9\xC6\xBF\xB4\xA8\x9C\x8D\x82\x76" + "\x6A\x5A\x4B\x3D\x35\x32\x2F\x2C\x2B" + "\x29\x26\x25\x24\x25\x23\x24\x26\x25\x25\x25\x25\x24\x24\x24\x24\x24\x25\x24\x24\x25\x24\x26" + "\x26\x26\x26\x25\x26\x26\x26\x25\x25" + "\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCA\xC5" + "\xC0\xB9\xB3\xAC\xA1\x8E\x76\x56\x3D" + "\x36\x31\x2A\x28\x29\x26\x27\x26\x25\x26\x24\x25\x24\x25\x26\x24\x25\x25\x26\x24\x24\x23\x23" + "\x26\x26\x26\x26\x24\x25\x24\x24\x24" + "\xCE\xCC\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCC\xC6" + "\xA9\x8C\x6D\x5B\x49\x3D\x32\x2E\x2B\x28\x25\x23\x24\x24\x23\x26\x26\x25\x24\x23\x24\x23\x24" + "\x24\x26\x26\x26\x25\x26\x24\x21\x24" + "\xCD\xCD\xCD\xCD\xCC\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCC\xCD\xCB\xC0\xAB\x97\x82\x6E\x54\x3C\x30\x2C\x29\x27\x25\x27\x25\x25\x24\x23\x23\x24\x24" + "\x24\x26\x24\x25\x24\x23\x24\x25\x24" + "\xCD\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCC\xCD\xCD\xCC\xCD\xCD\xCA\xC2\xB6\xA7\x86\x5A\x38\x31\x2C\x28\x26\x25\x24\x24\x24\x25\x26" + "\x26\x29\x25\x25\x26\x27\x25\x25\x26" + "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCC\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xCC\xBB\x91\x68\x4F\x3A\x30\x2A\x28\x26\x25\x24" + "\x23\x24\x24\x25\x26\x23\x23\x26\x25" + "\xCB\xCA\xC9\xCB\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCC\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xC8\xB4\x93\x76\x57\x3B\x30\x2D\x28" + "\x25\x25\x25\x25\x25\x22\x23\x24\x25" + "\x64\x62\x61\x62\x68\x71\x7B\x81\x8C\x94\x9C\xA3\xAB\xB5\xC3\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCC\xC5\xB8\xA5\x79\x4C\x34" + "\x2E\x26\x25\x25\x27\x21\x26\x26\x25" + "\x2C\x2B\x28\x2C\x2C\x2B\x2B\x2F\x2E\x31\x33\x34\x37\x38\x3B\x43\x5B\x70\x83\x95\xA7\xAF\xB6" + "\xBC\xC5\xCB\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCC\xCD\xCD\xCD\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCD\xCD\xCD\xCC\xC6\xA1" + "\x6E\x4A\x35\x29\x24\x27\x26\x24\x24" + "\x26\x25\x23\x23\x26\x25\x26\x25\x25\x24\x28\x2A\x26\x28\x29\x2C\x2B\x2E\x30\x33\x37\x44\x53" + "\x61\x74\x88\x9D\xB1\xC4\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCD\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCD\xCC\xCD\xCD\xCD\xCD\xCD" + "\xC9\xA7\x81\x58\x39\x30\x2A\x26\x25" + "\x25\x24\x26\x26\x24\x24\x23\x24\x23\x24\x26\x28\x25\x26\x25\x26\x27\x25\x26\x27\x28\x28\x2A" + "\x2C\x31\x35\x42\x50\x61\x74\x92\xAF" + "\xC9\xCD\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCC\xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD" + "\xCD\xCC\xC8\xB8\x9B\x5E\x39\x2F\x2A" + "\x24\x23\x23\x24\x23\x24\x25\x26\x25\x25\x25\x25\x24\x24\x25\x24\x24\x24\x22\x25\x25\x24\x24" + "\x24\x27\x27\x28\x2C\x2B\x2C\x31\x36" + "\x3F\x5A\x7D\xA0\xB8\xC5\xCC\xCD\xCD\xCC\xCC\xCD\xCC\xCC\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCC\xCA\xB2\x7D\x55" + "\x22\x23\x25\x25\x25\x25\x25\x24\x24\x24\x23\x24\x25\x24\x24\x24\x25\x26\x26\x25\x24\x25\x25" + "\x25\x24\x24\x25\x26\x25\x26\x27\x29" + "\x2A\x2C\x31\x38\x57\x74\x91\xAD\xC7\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCC\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCB\xB7"; BYTE TEST_64X64_GREEN_PLANE_RLE[3696] = - "\x34\x2A\x25\x23\xF0\x24\x2B\x60\xA2\x97\x84\x75\x62\x50\x3C\x34\x30\x2C\x29\x28\x93\x26\x25\x25\x23\x23\x25\x24\x24\x25\x84\x26" - "\x27\x25\x24\x25\x25\x27\x24\xC3\x25\x25\x24\x25\x26\x25\x23\x24\x24\x25\x23\x24\x30\x22\x23\x21\xF0\x4E\x24\x1C\x12\x0C\x0A\x08" - "\x06\x08\x26\x4E\x6A\x8E\xA0\xB6\xF0\xCA\xDC\xCA\xA0\x74\x3E\x20\x1A\x12\x08\x08\x08\x02\x02\x02\xF0\x03\x03\x02\x02\x01\x00\x00" - "\x02\x00\x02\x07\x00\x01\x02\x00\xF0\x01\x02\x00\x02\x00\x01\x01\x00\x02\x01\x01\x02\x00\x02\x00\x40\x04\x04\x02\x06\xF0\xD2\xF8" - "\xCC\x9A\x5E\x40\x26\x14\x10\x0C\x02\x00\x04\x10\x20\xF0\x30\x44\x66\x98\xCC\xF7\xF7\xD4\x98\x66\x4A\x2C\x14\x0C\x08\xF0\x0A\x08" - "\x01\x03\x01\x07\x00\x02\x00\x01\x00\x00\x08\x04\x00\xF0\x02\x03\x01\x00\x00\x00\x02\x06\x04\x04\x01\x01\x01\x00\x00\x40\x07\x00" - "\x04\x04\xC4\x02\x16\x52\x92\xC8\xBE\xAC\x8E\x58\x1C\x02\x00\x14\x02\xF0\x22\x60\xA6\xCC\xC2\xB2\x9C\x70\x3E\x1C\x0A\x04\x06\x00" - "\x02\x75\x00\x03\x00\x01\x01\x02\x01\xF0\x04\x02\x00\x02\x00\x01\x01\x02\x02\x02\x03\x03\x06\x00\x03\x10\x03\x04\x8C\x12\x40\x70" - "\x96\xAE\x6C\x02\x00\xF0\x16\x40\x6E\x94\xB4\xD0\xBA\x72\x26\x18\x0C\x08\x04\x00\x03\xF0\x02\x04\x01\x05\x03\x02\x01\x03\x02\x05" - "\x05\x03\x01\x00\x01\xA0\x02\x01\x01\x02\x02\x04\x02\x02\x00\x00\x03\x8D\x02\x01\x00\x00\x0A\x22\x1C\x00\x03\xF0\x0A\x20\x38\x72" - "\xCE\xF7\xBA\x70\x34\x12\x08\x08\x05\x01\x00\xF0\x04\x02\x02\x06\x06\x00\x02\x04\x02\x02\x03\x01\x03\x00\x04\x70\x00\x06\x0A\x03" - "\x01\x02\x04\x04\x5C\x02\x00\x00\x02\x00\x44\x01\x01\x01\x00\xF0\x02\x02\x02\x1E\x78\xBC\xB6\x74\x2E\x0E\x0A\x02\x00\x01\x01\xF0" - "\x00\x01\x00\x00\x00\x01\x02\x02\x00\x02\x04\x02\x00\x00\x01\x50\x07\x01\x01\x00\x00\x04\x23\x01\x00\x47\x01\x00\x01\x00\x23\x01" - "\x00\xF0\x01\x01\x17\x49\x75\x8D\x67\x27\x01\x1A\x60\xAA\xA0\x32\x0E\xF0\x04\x02\x00\x02\x01\x04\x02\x02\x01\x02\x00\x05\x01\x01" - "\x02\x90\x00\x00\x04\x01\x01\x02\x00\x03\x03\x08\x2A\x01\x00\x13\x02\xF0\x05\x2B\x91\xF1\xD9\xB1\x95\xBB\xF1\xE5\x63\x0F\x1C\x7C" - "\xC4\xF0\x48\x0A\x02\x04\x04\x02\x05\x02\x01\x00\x00\x00\x01\x04\x01\xA0\x07\x01\x00\x05\x01\x00\x00\x01\x00\x02\x04\x99\x02\x00" - "\x00\x00\x02\x02\x00\x02\x00\xF0\x01\x00\x43\xB1\x8B\x15\x48\x70\x7C\x62\x20\x35\xA7\x95\x0F\xF0\x00\x46\x8C\x18\x08\x00\x05\x00" - "\x04\x02\x02\x00\x01\x00\x06\xC0\x00\x00\x02\x01\x03\x01\x04\x04\x00\x04\x02\x03\x71\xF0\x13\x9D\x43\x26\xAA\xB8\xA6\x9C\xAA\xBC" - "\x70\x0D\x79\x71\x01\xF0\x02\x60\x5C\x0C\x04\x02\x04\x02\x01\x00\x00\x02\x00\x00\x01\x83\x04\x04\x06\x02\x00\x03\x01\x00\x41\xF0" - "\x01\x00\x09\xA5\x3B\x3C\xBC\x74\x24\x10\x04\x06\x3A\xAA\x94\xF0\x08\x7F\x55\x01\x0A\x96\x2A\x06\x03\x03\x01\x00\x01\x01\x00\xE0" - "\x01\x03\x00\x00\x01\x03\x04\x04\x01\x01\x00\x00\x01\x02\x61\xF0\x2F\x3F\x0E\x6E\x38\x02\x03\x37\x89\x9F\x7F\x25\x6C\x46\x1F\xF0" - "\x55\x09\x00\x26\x5E\x0C\x06\x00\x00\x00\x04\x02\x00\x02\x02\xC0\x00\x02\x04\x00\x05\x02\x02\x04\x02\x00\x00\x01\x41\xF0\x02\x00" - "\x2D\x17\x1E\x48\x06\x00\x15\x79\x8B\x77\x91\x67\x10\xF0\x56\x03\x1F\x17\x00\x10\x50\x22\x06\x04\x02\x03\x01\x04\x04\x93\x02\x03" - "\x04\x04\x01\x01\x02\x01\x00\x20\x02\x00\x21\xF0\x01\x01\x00\x00\x2F\x15\x0E\x26\x00\x01\x12\x46\x3A\x32\x4A\xF0\x40\x0A\x3A\x06" - "\x1B\x17\x00\x04\x46\x4E\x0E\x03\x05\x02\x00\xF0\x00\x03\x01\x04\x00\x03\x02\x04\x00\x00\x01\x03\x05\x01\x00\x10\x02\x11\xF0\x01" - "\x00\x02\x01\x00\x18\x0E\x05\x11\x00\x00\x06\x66\xBE\xB8\xF0\xB2\x52\x00\x0D\x03\x04\x04\x00\x00\x1A\x42\x16\x06\x02\x00\xF0\x00" - "\x05\x01\x00\x02\x01\x00\x03\x02\x02\x01\x02\x00\x04\x00\x20\x00\x02\x11\xF0\x02\x02\x00\x02\x00\x24\x0E\x15\x29\x00\x02\x02\x08" - "\x24\x3E\xF0\x1C\x02\x00\x49\x00\x20\x1C\x00\x00\x02\x44\x20\x04\x04\x00\xF0\x02\x00\x04\x00\x01\x03\x03\x02\x00\x00\x02\x02\x04" - "\x00\x00\x20\x00\x05\x0C\x53\x05\x17\x0B\x01\x00\xF0\x01\x00\x38\x2E\x21\x7B\x1D\x01\x00\x00\x02\x02\x01\x03\x49\xF0\x65\x08\x38" - "\x1A\x00\x00\x00\x3A\x30\x06\x02\x02\x05\x01\x03\xE0\x02\x00\x04\x02\x03\x03\x01\x03\x02\x00\x00\x04\x01\x04\xF0\x01\x01\x00\x01" - "\x01\x01\x00\x01\x01\x00\x01\x00\x03\x45\x77\x24\x2D\x00\x83\x01\x26\x78\x04\x51\x83\x21\x00\xE3\x07\x43\x91\x25\x3C\x5C\x02\x00" - "\x01\x01\x08\x52\x06\x00\xF0\x01\x01\x00\x03\x03\x04\x00\x00\x02\x01\x05\x02\x00\x02\x00\x93\x02\x02\x00\x02\x00\x00\x00\x02\x00" - "\xF0\x08\x18\x59\xB7\x67\x09\x00\x00\x02\x02\x00\x5C\x62\x0F\x79\xF0\xB7\x71\x37\x27\x45\x91\xB1\x49\x0C\x94\x30\x00\x00\x02\x02" - "\xF0\x00\x54\x10\x06\x01\x00\x04\x06\x02\x00\x06\x02\x03\x01\x00\x70\x00\x01\x00\x01\x01\x00\x00\x04\x35\x02\x02\x00\xF0\x02\x3A" - "\x3A\x3B\xC3\xD9\x5D\x1B\x01\x00\x00\x0A\xB0\x9E\x1C\xC4\x4F\xB5\xED\xF9\xDD\x8D\x1D\x4C\xC4\x4C\x02\x00\xF0\x2C\x34\x04\x04\x02" - "\x03\x01\x03\x03\x03\x02\x04\x04\x03\x00\x60\x04\x04\x00\x01\x01\x00\x13\x02\x18\x00\xF0\x0C\x52\x20\x0D\x51\xBB\xAF\x61\x19\x00" - "\x00\x12\x7E\xB0\x8C\x95\x52\x24\x1A\x38\x64\x98\xB6\x54\x00\xF0\x05\x3F\x0F\x03\x03\x02\x02\x00\x02\x04\x04\x02\x01\x02\x06\x70" - "\x02\x03\x00\x01\x04\x04\x02\x0A\xF0\x02\x00\x00\x00\x44\x6E\x18\x04\x21\x6D\xB1\xB9\x69\x0D\x00\xC4\x0A\x4E\x94\xB4\xCC\xCE\xC0" - "\xAA\x78\x24\x02\x00\xF0\x21\x91\xBB\x3B\x05\x04\x00\x00\x01\x02\x00\x01\x00\x02\x02\x80\x00\x00\x01\x01\x04\x01\x01\x00\x68\x02" - "\x02\x02\x00\x02\x00\xF0\x0E\x94\xFC\xA2\x54\x20\x21\x63\xC3\xF5\x95\x49\x1F\x04\x22\xF0\x36\x3A\x2C\x18\x06\x01\x00\x00\x00\x09" - "\x29\x95\xE9\x99\x45\xF0\x09\x03\x01\x00\x02\x00\x00\x02\x00\x01\x00\x05\x03\x00\x04\x50\x06\x01\x00\x00\x02\x78\x02\x00\x02\x00" - "\x00\x02\x00\xF0\x02\x26\x8C\xC2\xA8\x66\x1C\x05\x31\x99\xC9\xB5\x8F\x5B\x39\xF0\x19\x03\x02\x02\x00\x07\x2B\x63\x93\xBB\x97\x25" - "\x06\x24\x04\xF0\x00\x01\x02\x00\x02\x03\x01\x01\x03\x01\x01\x01\x00\x00\x00\x40\x01\x02\x02\x01\x98\x02\x02\x00\x02\x00\x00\x00" - "\x02\x00\xF0\x04\x26\x70\xB2\xC6\x7E\x2A\x02\x1D\x5B\x99\xB7\xC5\xCB\xC7\xF0\xB3\xC3\xCB\xCF\xC7\xB1\x91\x4B\x0A\x56\xBC\xB4\x0A" - "\x00\x01\x64\x01\x02\x00\x00\x01\x02\x70\x01\x00\x01\x01\x00\x00\x00\xAA\x02\x02\x02\x00\x02\x00\x02\x00\x02\x00\xF0\x20\x54\xB6" - "\xFF\xD0\x82\x48\x18\x1F\x33\x4F\x69\x83\x71\x63\xF0\x59\x37\x00\x40\x80\xEE\xDA\x6E\x0D\x08\x00\x00\x00\x03\x01\xE0\x04\x01\x00" - "\x02\x00\x02\x02\x05\x07\x03\x02\x00\x00\x02\x03\x2E\x02\x00\xF0\x02\x00\x02\x00\x0C\x5E\xAA\xC2\xB8\xA0\x86\x68\x48\x32\x3E\xF0" - "\x54\x6E\x98\xB2\xC0\xAA\x36\x02\x0D\x53\x07\x02\x02\x00\x04\x34\x02\x01\x00\x80\x01\x02\x06\x00\x06\x04\x00\x01\x63\x02\x02\x00" - "\x00\x02\x00\x2E\x02\x00\xF0\x06\x2A\x62\x90\x9E\xB0\xC2\xD0\xC8\xBA\xAC\x8E\x64\x30\x08\xF0\x00\x00\x51\x43\x0D\x01\x02\x02\x05" - "\x03\x00\x02\x01\x03\x00\x90\x02\x02\x04\x02\x00\x03\x03\x00\x01\x13\x02\x4F\x00\x02\x02\x00\x05\xF0\x04\x10\x1C\x2A\x36\x30\x24" - "\x18\x06\x00\x01\x00\x21\x81\xA7\xF0\x2D\x03\x01\x03\x07\x06\x06\x01\x00\x02\x02\x00\x01\x03\x02\x60\x02\x00\x02\x01\x02\x04\x9F" - "\x02\x00\x02\x02\x00\x00\x00\x02\x00\x0C\xF0\x01\x01\x1B\x65\xB1\xA5\x39\x0D\x03\x00\x00\x08\x01\x01\x02\xD0\x01\x03\x02\x00\x02" - "\x06\x00\x03\x00\x00\x00\x05\x03\x47\x02\x02\x02\x00\x2B\x02\x00\x33\x01\x01\x00\xF0\x02\x02\x01\x00\x00\x00\x1B\x7F\xC1\xB3\x6D" - "\x1D\x03\x00\x01\xF0\x01\x00\x01\x00\x01\x02\x04\x02\x03\x03\x03\x05\x03\x01\x00\x40\x03\x02\x02\x00\xA6\x00\x02\x00\x00\x02\x00" - "\x01\x01\x02\x00\x26\x02\x00\xF0\x02\x00\x01\x00\x00\x01\x01\x0B\x1F\x3B\x75\xCB\xFA\xB3\x5F\xF0\x2F\x0B\x09\x05\x01\x06\x06\x02" - "\x00\x06\x02\x01\x00\x01\x00\xA0\x02\x00\x04\x04\x04\x02\x00\x00\x04\x00\xF0\x02\x02\x02\x00\x01\x17\x37\x45\x55\x57\x49\x39\x27" - "\x19\x0D\x37\x03\x01\x00\xF0\x01\x0F\x25\x3B\x59\x81\x9D\xB5\xCD\xB9\x6D\x1F\x15\x0D\x05\xF0\x03\x01\x05\x01\x01\x03\x01\x02\x05" - "\x03\x01\x04\x02\x00\x00\x90\x02\x00\x01\x05\x01\x04\x00\x00\x00\xF0\x02\x02\x00\x00\x77\xBD\xBF\xBB\xBD\xB7\xBF\xC3\xC9\xCF\xD3" - "\xF0\xCF\xBB\xA3\x8B\x77\x7D\x85\x8D\x97\xAF\xC7\xCF\xC9\xC1\xBB\xF0\xAD\x8D\x69\x39\x17\x15\x05\x01\x01\x01\x04\x02\x04\x02\x00" - "\xF0\x02\x02\x00\x02\x04\x00\x03\x02\x02\x00\x00\x02\x01\x01\x01\x40\x00\x00\x02\x02\xF0\x02\x00\x09\x99\xAD\x65\x4D\x45\x3B\x39" - "\x3D\x49\x55\x5D\x5F\xF0\x6B\x83\x9B\xB3\xC1\xBD\xB5\xAB\xA3\x91\x73\x61\x57\x4D\x35\xF0\x1B\x15\x0B\x0D\x09\x01\x07\x03\x01\x02" - "\x01\x00\x04\x02\x00\x14\x01\xE0\x04\x00\x02\x01\x04\x00\x01\x04\x06\x04\x05\x03\x03\x00\xF0\x02\x00\x3D\x63\x17\x0B\x07\x07\x00" - "\x03\x03\x07\x09\x07\x0D\xF0\x11\x0F\x0D\x0B\x15\x11\x11\x13\x13\x0D\x0F\x09\x05\x03\x05\xF0\x03\x01\x01\x01\x02\x04\x06\x02\x00" - "\x00\x02\x04\x00\x01\x03\xF0\x03\x01\x02\x00\x00\x03\x00\x00\x02\x00\x02\x01\x00\x02\x00\x40\x06\x04\x02\x01\xF0\x00\x00\x47\x25" - "\x05\x03\x00\x02\x01\x01\x02\x04\x00\x01\x00\xB3\x00\x01\x02\x01\x01\x03\x01\x01\x01\x00\x01\xF0\x04\x02\x01\x00\x04\x00\x03\x07" - "\x01\x02\x01\x03\x03\x07\x03\xF0\x04\x06\x02\x01\x00\x02\x06\x04\x03\x00\x00\x02\x02\x02\x04\x50\x00\x00\x00\x03\x04\xF0\x02\x0D" - "\x27\x0B\x01\x01\x02\x00\x00\x00\x03\x01\x00\x00\x00\xF0\x04\x04\x00\x00\x04\x00\x01\x00\x00\x01\x00\x02\x02\x02\x00\xF0\x00\x02" - "\x01\x02\x03\x01\x04\x00\x00\x02\x01\x01\x00\x02\x02\xF0\x03\x00\x03\x02\x00\x05\x05\x00\x01\x03\x01\x04\x01\x03\x00\x40\x01\x00" - "\x00\x03\xF0\x00\x05\x07\x03\x01\x02\x04\x00\x00\x00\x01\x03\x00\x02\x00\xF0\x00\x02\x03\x01\x01\x00\x01\x03\x00\x02\x02\x00\x01" - "\x00\x00\xF0\x02\x02\x02\x03\x01\x00\x02\x02\x01\x01\x04\x02\x04\x02\x01\xF4\x00\x01\x04\x00\x02\x02\x02\x00\x02\x01\x03\x05\x01" - "\x03\x00\xF0\x02\x05\x03\x01\x03\x00\x03\x02\x00\x00\x02\x02\x06\x02\x01\xF0\x05\x05\x00\x04\x01\x03\x02\x04\x00\x00\x04\x01\x01" - "\x02\x02\xF0\x00\x04\x00\x02\x06\x04\x05\x00\x04\x02\x00\x01\x01\x07\x03\xF0\x00\x04\x00\x02\x03\x01\x04\x00\x04\x04\x06\x02\x02" - "\x02\x01\x40\x02\x00\x02\x01\xF0\x02\x0A\x08\x00\x06\x04\x06\x00\x04\x02\x00\x01\x00\x02\x04\xF0\x06\x00\x00\x03\x02\x02\x02\x00" - "\x04\x02\x03\x00\x04\x03\x00\xF0\x01\x05\x01\x03\x01\x03\x00\x03\x01\x01\x00\x01\x01\x02\x06\xF0\x04\x04\x01\x03\x04\x01\x07\x04" - "\x03\x02\x01\x00\x03\x01\x00\x40\x00\x03\x00\x06\xF0\x00\x0C\x0E\x04\x00\x03\x01\x02\x03\x01\x00\x04\x05\x03\x03\xA5\x01\x04\x01" - "\x01\x03\x04\x00\x00\x03\x00\xF0\x01\x00\x02\x00\x00\x04\x00\x00\x00\x04\x00\x02\x02\x04\x02\xF0\x02\x03\x04\x03\x05\x00\x04\x05" - "\x00\x01\x00\x00\x02\x04\x02\x40\x01\x04\x00\x03\xF0\x00\x0A\x2C\x14\x00\x01\x01\x02\x04\x00\x01\x02\x00\x01\x00\xF0\x09\x05\x02" - "\x00\x06\x01\x01\x01\x00\x01\x03\x01\x01\x02\x04\xF0\x04\x02\x04\x08\x04\x00\x04\x06\x02\x01\x03\x00\x00\x00\x03\xF0\x03\x00\x01" - "\x02\x02\x00\x00\x01\x00\x04\x01\x00\x04\x00\x01\x40\x04\x00\x01\x01\xF0\x02\x02\x3E\x1C\x00\x08\x04\x01\x00\x03\x00\x03\x00\x02" - "\x02\xF0\x08\x00\x05\x01\x00\x00\x01\x02\x01\x01\x04\x02\x01\x03\x07\xF0\x03\x05\x07\x01\x05\x05\x01\x01\x01\x02\x02\x01\x00\x00" - "\x01\xF0\x01\x00\x03\x06\x00\x04\x01\x08\x02\x05\x03\x04\x01\x01\x02\x40\x05\x00\x02\x00\xF0\x00\x00\x30\x16\x0A\x00\x03\x00\x01" - "\x08\x00\x03\x00\x01\x00\x63\x02\x04\x06\x04\x06\x02\xF0\x00\x00\x02\x00\x04\x02\x00\x00\x01\x07\x02\x04\x01\x00\x00\xF0\x03\x02" - "\x02\x04\x06\x06\x02\x05\x00\x03\x02\x00\x02\x03\x00\xA0\x02\x02\x03\x03\x01\x02\x00\x00\x00\x04\xF0\x00\x00\x18\x34\x0A\x04\x02" - "\x04\x02\x01\x00\x04\x02\x00\x05\x93\x01\x00\x01\x00\x0B\x01\x00\x01\x00\xF0\x02\x01\x02\x02\x02\x06\x04\x04\x00\x02\x00\x00\x00" - "\x04\x02\xF0\x01\x01\x00\x04\x06\x04\x04\x02\x01\x02\x00\x01\x01\x04\x01\x70\x02\x02\x03\x02\x03\x01\x00\xF0\x00\x02\x06\x6E\x0C" - "\x02\x00\x03\x02\x00\x04\x04\x00\x04\x02\xF0\x03\x00\x00\x01\x06\x04\x00\x00\x02\x02\x00\x01\x03\x04\x02\xF0\x01\x00\x05\x00\x03" - "\x00\x00\x01\x01\x01\x07\x02\x02\x01\x01\xF0\x03\x00\x00\x03\x02\x02\x01\x00\x00\x00\x02\x04\x00\x00\x00\x40\x02\x02\x00\x03\xF0" - "\x02\x00\x00\x4A\x3C\x0A\x00\x03\x01\x02\x00\x01\x01\x00\x08\xB3\x06\x00\x02\x02\x03\x03\x02\x04\x00\x01\x00\xF0\x03\x00\x01\x02" - "\x02\x01\x01\x02\x00\x00\x04\x00\x00\x01\x00\xA3\x01\x03\x00\x02\x00\x03\x00\x00\x02\x00\x70\x04\x02\x01\x01\x02\x00\x00\x03\xF0" - "\x0A\x76\x1C\x1A\x1A\x14\x12\x0E\x10\x0E\x08\x08\x0A\x08\x08\xF0\x06\x06\x02\x06\x02\x01\x01\x00\x00\x00\x07\x03\x00\x04\x02\xF0" - "\x00\x06\x04\x00\x00\x00\x03\x00\x03\x00\x03\x01\x02\x00\x03\xF0\x02\x00\x00\x01\x00\x01\x02\x07\x01\x01\x00\x02\x00\x01\x01\x10" - "\x02\x04\xF0\x6E\xCC\xC4\xBA\xB0\xA0\x98\x86\x7A\x76\x6A\x68\x62\x50\x40\xF0\x34\x20\x12\x12\x14\x14\x0A\x0A\x08\x08\x04\x00\x04" - "\x04\x01\xF0\x01\x01\x03\x01\x01\x00\x06\x00\x04\x06\x06\x02\x00\x00\x02\xF0\x02\x01\x00\x01\x02\x00\x04\x02\x03\x02\x02\x04\x02" - "\x06\x04\x04\xF0\x10\x56\x72\x80\x8C\x9C\xA8\xB8\xCA\xCE\xD2\xD0\xCA\xC6\xC0\xF0\xB6\xB0\xA2\x8A\x78\x5A\x42\x26\x1C\x18\x14\x10" - "\x08\x06\x04\xF0\x00\x00\x04\x00\x02\x06\x01\x02\x03\x01\x03\x00\x01\x00\x03\xF0\x01\x00\x00\x02\x00\x02\x04\x02\x06\x01\x02\x00" - "\x02\x01\x01\x39\x01\x01\x00\xF0\x01\x02\x08\x0E\x1C\x32\x4A\x62\x7E\x90\x9E\xAC\xBE\xD0\xDE\xF0\xD8\xB8\x8E\x54\x24\x1A\x16\x0A" - "\x08\x08\x06\x06\x00\x00\x02\xF0\x01\x00\x00\x02\x04\x00\x02\x00\x04\x00\x01\x01\x05\x00\x00\x70\x00\x02\x03\x01\x03\x01\x01\x6C" - "\x04\x00\x00\x00\x01\x00\xF0\x01\x01\x02\x06\x10\x1A\x28\x34\x42\x58\x7C\xAC\xEC\xED\xE6\xF0\xB6\x86\x66\x40\x2E\x16\x10\x0C\x04" - "\x02\x03\x00\x01\x05\x04\xF0\x02\x00\x03\x01\x00\x00\x02\x03\x00\x00\x00\x02\x02\x00\x05\x10\x00\x34\x01\x02\x00\x23\x01\x00\x2E" - "\x02\x00\xF0\x02\x02\x02\x0E\x46\x82\xBC\xCA\xC4\xB4\xA0\x80\x52\x28\x16\xF0\x12\x0A\x06\x04\x02\x01\x00\x00\x00\x01\x02\x00\x00" - "\x00\x03\x60\x01\x01\x05\x00\x08\x00\x03\x67\x01\x02\x00\x00\x02\x00\x53\x01\x00\x02\x02\x00\x28\x01\x00\xF0\x04\x18\x44\x6C\x90" - "\xA8\xC4\xD6\xAC\x5C\x1E\x14\x0E\x02\x02\xF0\x00\x00\x02\x02\x02\x04\x04\x06\x02\x00\x04\x08\x02\x00\x04\x03\x25\x02\x00\x25\x01" - "\x00\x34\x01\x01\x00\x26\x02\x00\xF0\x02\x00\x00\x02\x00\x00\x06\x16\x2E\x4A\x8E\xE4\xF9\xC0\x78\xF0\x4E\x28\x16\x0C\x08\x04\x00" - "\x03\x05\x09\x01\x00\x00\x07\x03\x20\x02\x01\x55\x03\x05\x07\x03\x00\x2F\x02\x00\x0D\xF0\x01\x02\x00\x02\x24\x78\xC0\xCA\xB2\x8C" - "\x5A\x26\x14\x10\x08\x90\x04\x02\x02\x00\x01\x01\x00\x03\x00\xF0\xCD\xCF\xCF\xD1\xC9\xB7\xA3\x97\x81\x71\x61\x53\x43\x2F\x13\x5D" - "\x01\x02\x02\x02\x00\x03\x13\x01\xF0\x00\x01\x01\x00\x00\x00\x0A\x32\x72\x9E\xC2\xD4\x92\x3E\x18\x90\x12\x02\x00\x00\x04\x01\x06" - "\x04\x00\xF0\x6F\x6D\x71\x6B\x77\x8B\x9F\xA3\xBB\xC5\xD1\xDD\xE7\xF9\xF0\xC5\xEE\xE3\xB9\x93\x6F\x4B\x3B\x2D\x21\x0F\x03\x00\x29" - "\x01\x00\x14\x01\xF0\x00\x10\x2A\x50\xA6\xF4\xDA\x80\x48\x20\x08\x05\x0C\x00\x03\x10\x01\xF0\x0B\x0B\x09\x11\x0B\x0B\x09\x13\x11" - "\x19\x15\x13\x21\x1F\x23\xF0\x2D\x5F\x83\xA5\xC3\xDF\xD5\xC5\xB5\xA1\x85\x5F\x37\x11\x00\xC6\x00\x00\x02\x00\x00\x00\x02\x02\x00" - "\x00\x02\x00\xF0\x02\x01\x00\x00\x02\x0E\x58\xB6\xBA\x98\x5E\x2A\x12\x08\x04\x10\x02\xF0\x01\x01\x06\x06\x03\x01\x05\x01\x03\x00" - "\x03\x03\x01\x03\x07\xF0\x0B\x07\x11\x13\x17\x1D\x37\x51\x69\x85\xA5\xB5\xC1\xC5\xB1\xE4\x75\x3B\x07\x00\x01\x01\x00\x00\x02\x02" - "\x00\x00\x00\x02\xF0\x00\x02\x00\x00\x02\x00\x00\x08\x4A\x8E\xC0\xC4\x5C\x1E\x12\x10\x0A\xF0\x01\x01\x05\x03\x01\x00\x04\x04\x04" - "\x02\x01\x05\x01\x03\x00\xF0\x03\x05\x01\x07\x03\x05\x07\x0B\x0F\x13\x1B\x33\x47\x6B\x8F\xA4\xC1\xF1\xEC\xE5\x9D\x57\x29\x0F\x01" - "\x00\xF0\x01\x01\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x02\x0A\x2A\x50\x62\xD8\xF2\x9C\x56\xF0\x03\x00\x04\x02\x04\x02\x00\x03" - "\x01\x01\x03\x01\x02\x00\x01\xF0\x00\x02\x04\x08\x00\x01\x02\x02\x02\x05\x05\x05\x0B\x0B\x0B\xF0\x13\x19\x29\x5B\x97\xCF\xC1\xA1" + "\x34\x2A\x25\x23\xF0\x24\x2B\x60\xA2\x97\x84\x75\x62\x50\x3C\x34\x30\x2C\x29\x28\x93\x26\x25" + "\x25\x23\x23\x25\x24\x24\x25\x84\x26" + "\x27\x25\x24\x25\x25\x27\x24\xC3\x25\x25\x24\x25\x26\x25\x23\x24\x24\x25\x23\x24\x30\x22\x23" + "\x21\xF0\x4E\x24\x1C\x12\x0C\x0A\x08" + "\x06\x08\x26\x4E\x6A\x8E\xA0\xB6\xF0\xCA\xDC\xCA\xA0\x74\x3E\x20\x1A\x12\x08\x08\x08\x02\x02" + "\x02\xF0\x03\x03\x02\x02\x01\x00\x00" + "\x02\x00\x02\x07\x00\x01\x02\x00\xF0\x01\x02\x00\x02\x00\x01\x01\x00\x02\x01\x01\x02\x00\x02" + "\x00\x40\x04\x04\x02\x06\xF0\xD2\xF8" + "\xCC\x9A\x5E\x40\x26\x14\x10\x0C\x02\x00\x04\x10\x20\xF0\x30\x44\x66\x98\xCC\xF7\xF7\xD4\x98" + "\x66\x4A\x2C\x14\x0C\x08\xF0\x0A\x08" + "\x01\x03\x01\x07\x00\x02\x00\x01\x00\x00\x08\x04\x00\xF0\x02\x03\x01\x00\x00\x00\x02\x06\x04" + "\x04\x01\x01\x01\x00\x00\x40\x07\x00" + "\x04\x04\xC4\x02\x16\x52\x92\xC8\xBE\xAC\x8E\x58\x1C\x02\x00\x14\x02\xF0\x22\x60\xA6\xCC\xC2" + "\xB2\x9C\x70\x3E\x1C\x0A\x04\x06\x00" + "\x02\x75\x00\x03\x00\x01\x01\x02\x01\xF0\x04\x02\x00\x02\x00\x01\x01\x02\x02\x02\x03\x03\x06" + "\x00\x03\x10\x03\x04\x8C\x12\x40\x70" + "\x96\xAE\x6C\x02\x00\xF0\x16\x40\x6E\x94\xB4\xD0\xBA\x72\x26\x18\x0C\x08\x04\x00\x03\xF0\x02" + "\x04\x01\x05\x03\x02\x01\x03\x02\x05" + "\x05\x03\x01\x00\x01\xA0\x02\x01\x01\x02\x02\x04\x02\x02\x00\x00\x03\x8D\x02\x01\x00\x00\x0A" + "\x22\x1C\x00\x03\xF0\x0A\x20\x38\x72" + "\xCE\xF7\xBA\x70\x34\x12\x08\x08\x05\x01\x00\xF0\x04\x02\x02\x06\x06\x00\x02\x04\x02\x02\x03" + "\x01\x03\x00\x04\x70\x00\x06\x0A\x03" + "\x01\x02\x04\x04\x5C\x02\x00\x00\x02\x00\x44\x01\x01\x01\x00\xF0\x02\x02\x02\x1E\x78\xBC\xB6" + "\x74\x2E\x0E\x0A\x02\x00\x01\x01\xF0" + "\x00\x01\x00\x00\x00\x01\x02\x02\x00\x02\x04\x02\x00\x00\x01\x50\x07\x01\x01\x00\x00\x04\x23" + "\x01\x00\x47\x01\x00\x01\x00\x23\x01" + "\x00\xF0\x01\x01\x17\x49\x75\x8D\x67\x27\x01\x1A\x60\xAA\xA0\x32\x0E\xF0\x04\x02\x00\x02\x01" + "\x04\x02\x02\x01\x02\x00\x05\x01\x01" + "\x02\x90\x00\x00\x04\x01\x01\x02\x00\x03\x03\x08\x2A\x01\x00\x13\x02\xF0\x05\x2B\x91\xF1\xD9" + "\xB1\x95\xBB\xF1\xE5\x63\x0F\x1C\x7C" + "\xC4\xF0\x48\x0A\x02\x04\x04\x02\x05\x02\x01\x00\x00\x00\x01\x04\x01\xA0\x07\x01\x00\x05\x01" + "\x00\x00\x01\x00\x02\x04\x99\x02\x00" + "\x00\x00\x02\x02\x00\x02\x00\xF0\x01\x00\x43\xB1\x8B\x15\x48\x70\x7C\x62\x20\x35\xA7\x95\x0F" + "\xF0\x00\x46\x8C\x18\x08\x00\x05\x00" + "\x04\x02\x02\x00\x01\x00\x06\xC0\x00\x00\x02\x01\x03\x01\x04\x04\x00\x04\x02\x03\x71\xF0\x13" + "\x9D\x43\x26\xAA\xB8\xA6\x9C\xAA\xBC" + "\x70\x0D\x79\x71\x01\xF0\x02\x60\x5C\x0C\x04\x02\x04\x02\x01\x00\x00\x02\x00\x00\x01\x83\x04" + "\x04\x06\x02\x00\x03\x01\x00\x41\xF0" + "\x01\x00\x09\xA5\x3B\x3C\xBC\x74\x24\x10\x04\x06\x3A\xAA\x94\xF0\x08\x7F\x55\x01\x0A\x96\x2A" + "\x06\x03\x03\x01\x00\x01\x01\x00\xE0" + "\x01\x03\x00\x00\x01\x03\x04\x04\x01\x01\x00\x00\x01\x02\x61\xF0\x2F\x3F\x0E\x6E\x38\x02\x03" + "\x37\x89\x9F\x7F\x25\x6C\x46\x1F\xF0" + "\x55\x09\x00\x26\x5E\x0C\x06\x00\x00\x00\x04\x02\x00\x02\x02\xC0\x00\x02\x04\x00\x05\x02\x02" + "\x04\x02\x00\x00\x01\x41\xF0\x02\x00" + "\x2D\x17\x1E\x48\x06\x00\x15\x79\x8B\x77\x91\x67\x10\xF0\x56\x03\x1F\x17\x00\x10\x50\x22\x06" + "\x04\x02\x03\x01\x04\x04\x93\x02\x03" + "\x04\x04\x01\x01\x02\x01\x00\x20\x02\x00\x21\xF0\x01\x01\x00\x00\x2F\x15\x0E\x26\x00\x01\x12" + "\x46\x3A\x32\x4A\xF0\x40\x0A\x3A\x06" + "\x1B\x17\x00\x04\x46\x4E\x0E\x03\x05\x02\x00\xF0\x00\x03\x01\x04\x00\x03\x02\x04\x00\x00\x01" + "\x03\x05\x01\x00\x10\x02\x11\xF0\x01" + "\x00\x02\x01\x00\x18\x0E\x05\x11\x00\x00\x06\x66\xBE\xB8\xF0\xB2\x52\x00\x0D\x03\x04\x04\x00" + "\x00\x1A\x42\x16\x06\x02\x00\xF0\x00" + "\x05\x01\x00\x02\x01\x00\x03\x02\x02\x01\x02\x00\x04\x00\x20\x00\x02\x11\xF0\x02\x02\x00\x02" + "\x00\x24\x0E\x15\x29\x00\x02\x02\x08" + "\x24\x3E\xF0\x1C\x02\x00\x49\x00\x20\x1C\x00\x00\x02\x44\x20\x04\x04\x00\xF0\x02\x00\x04\x00" + "\x01\x03\x03\x02\x00\x00\x02\x02\x04" + "\x00\x00\x20\x00\x05\x0C\x53\x05\x17\x0B\x01\x00\xF0\x01\x00\x38\x2E\x21\x7B\x1D\x01\x00\x00" + "\x02\x02\x01\x03\x49\xF0\x65\x08\x38" + "\x1A\x00\x00\x00\x3A\x30\x06\x02\x02\x05\x01\x03\xE0\x02\x00\x04\x02\x03\x03\x01\x03\x02\x00" + "\x00\x04\x01\x04\xF0\x01\x01\x00\x01" + "\x01\x01\x00\x01\x01\x00\x01\x00\x03\x45\x77\x24\x2D\x00\x83\x01\x26\x78\x04\x51\x83\x21\x00" + "\xE3\x07\x43\x91\x25\x3C\x5C\x02\x00" + "\x01\x01\x08\x52\x06\x00\xF0\x01\x01\x00\x03\x03\x04\x00\x00\x02\x01\x05\x02\x00\x02\x00\x93" + "\x02\x02\x00\x02\x00\x00\x00\x02\x00" + "\xF0\x08\x18\x59\xB7\x67\x09\x00\x00\x02\x02\x00\x5C\x62\x0F\x79\xF0\xB7\x71\x37\x27\x45\x91" + "\xB1\x49\x0C\x94\x30\x00\x00\x02\x02" + "\xF0\x00\x54\x10\x06\x01\x00\x04\x06\x02\x00\x06\x02\x03\x01\x00\x70\x00\x01\x00\x01\x01\x00" + "\x00\x04\x35\x02\x02\x00\xF0\x02\x3A" + "\x3A\x3B\xC3\xD9\x5D\x1B\x01\x00\x00\x0A\xB0\x9E\x1C\xC4\x4F\xB5\xED\xF9\xDD\x8D\x1D\x4C\xC4" + "\x4C\x02\x00\xF0\x2C\x34\x04\x04\x02" + "\x03\x01\x03\x03\x03\x02\x04\x04\x03\x00\x60\x04\x04\x00\x01\x01\x00\x13\x02\x18\x00\xF0\x0C" + "\x52\x20\x0D\x51\xBB\xAF\x61\x19\x00" + "\x00\x12\x7E\xB0\x8C\x95\x52\x24\x1A\x38\x64\x98\xB6\x54\x00\xF0\x05\x3F\x0F\x03\x03\x02\x02" + "\x00\x02\x04\x04\x02\x01\x02\x06\x70" + "\x02\x03\x00\x01\x04\x04\x02\x0A\xF0\x02\x00\x00\x00\x44\x6E\x18\x04\x21\x6D\xB1\xB9\x69\x0D" + "\x00\xC4\x0A\x4E\x94\xB4\xCC\xCE\xC0" + "\xAA\x78\x24\x02\x00\xF0\x21\x91\xBB\x3B\x05\x04\x00\x00\x01\x02\x00\x01\x00\x02\x02\x80\x00" + "\x00\x01\x01\x04\x01\x01\x00\x68\x02" + "\x02\x02\x00\x02\x00\xF0\x0E\x94\xFC\xA2\x54\x20\x21\x63\xC3\xF5\x95\x49\x1F\x04\x22\xF0\x36" + "\x3A\x2C\x18\x06\x01\x00\x00\x00\x09" + "\x29\x95\xE9\x99\x45\xF0\x09\x03\x01\x00\x02\x00\x00\x02\x00\x01\x00\x05\x03\x00\x04\x50\x06" + "\x01\x00\x00\x02\x78\x02\x00\x02\x00" + "\x00\x02\x00\xF0\x02\x26\x8C\xC2\xA8\x66\x1C\x05\x31\x99\xC9\xB5\x8F\x5B\x39\xF0\x19\x03\x02" + "\x02\x00\x07\x2B\x63\x93\xBB\x97\x25" + "\x06\x24\x04\xF0\x00\x01\x02\x00\x02\x03\x01\x01\x03\x01\x01\x01\x00\x00\x00\x40\x01\x02\x02" + "\x01\x98\x02\x02\x00\x02\x00\x00\x00" + "\x02\x00\xF0\x04\x26\x70\xB2\xC6\x7E\x2A\x02\x1D\x5B\x99\xB7\xC5\xCB\xC7\xF0\xB3\xC3\xCB\xCF" + "\xC7\xB1\x91\x4B\x0A\x56\xBC\xB4\x0A" + "\x00\x01\x64\x01\x02\x00\x00\x01\x02\x70\x01\x00\x01\x01\x00\x00\x00\xAA\x02\x02\x02\x00\x02" + "\x00\x02\x00\x02\x00\xF0\x20\x54\xB6" + "\xFF\xD0\x82\x48\x18\x1F\x33\x4F\x69\x83\x71\x63\xF0\x59\x37\x00\x40\x80\xEE\xDA\x6E\x0D\x08" + "\x00\x00\x00\x03\x01\xE0\x04\x01\x00" + "\x02\x00\x02\x02\x05\x07\x03\x02\x00\x00\x02\x03\x2E\x02\x00\xF0\x02\x00\x02\x00\x0C\x5E\xAA" + "\xC2\xB8\xA0\x86\x68\x48\x32\x3E\xF0" + "\x54\x6E\x98\xB2\xC0\xAA\x36\x02\x0D\x53\x07\x02\x02\x00\x04\x34\x02\x01\x00\x80\x01\x02\x06" + "\x00\x06\x04\x00\x01\x63\x02\x02\x00" + "\x00\x02\x00\x2E\x02\x00\xF0\x06\x2A\x62\x90\x9E\xB0\xC2\xD0\xC8\xBA\xAC\x8E\x64\x30\x08\xF0" + "\x00\x00\x51\x43\x0D\x01\x02\x02\x05" + "\x03\x00\x02\x01\x03\x00\x90\x02\x02\x04\x02\x00\x03\x03\x00\x01\x13\x02\x4F\x00\x02\x02\x00" + "\x05\xF0\x04\x10\x1C\x2A\x36\x30\x24" + "\x18\x06\x00\x01\x00\x21\x81\xA7\xF0\x2D\x03\x01\x03\x07\x06\x06\x01\x00\x02\x02\x00\x01\x03" + "\x02\x60\x02\x00\x02\x01\x02\x04\x9F" + "\x02\x00\x02\x02\x00\x00\x00\x02\x00\x0C\xF0\x01\x01\x1B\x65\xB1\xA5\x39\x0D\x03\x00\x00\x08" + "\x01\x01\x02\xD0\x01\x03\x02\x00\x02" + "\x06\x00\x03\x00\x00\x00\x05\x03\x47\x02\x02\x02\x00\x2B\x02\x00\x33\x01\x01\x00\xF0\x02\x02" + "\x01\x00\x00\x00\x1B\x7F\xC1\xB3\x6D" + "\x1D\x03\x00\x01\xF0\x01\x00\x01\x00\x01\x02\x04\x02\x03\x03\x03\x05\x03\x01\x00\x40\x03\x02" + "\x02\x00\xA6\x00\x02\x00\x00\x02\x00" + "\x01\x01\x02\x00\x26\x02\x00\xF0\x02\x00\x01\x00\x00\x01\x01\x0B\x1F\x3B\x75\xCB\xFA\xB3\x5F" + "\xF0\x2F\x0B\x09\x05\x01\x06\x06\x02" + "\x00\x06\x02\x01\x00\x01\x00\xA0\x02\x00\x04\x04\x04\x02\x00\x00\x04\x00\xF0\x02\x02\x02\x00" + "\x01\x17\x37\x45\x55\x57\x49\x39\x27" + "\x19\x0D\x37\x03\x01\x00\xF0\x01\x0F\x25\x3B\x59\x81\x9D\xB5\xCD\xB9\x6D\x1F\x15\x0D\x05\xF0" + "\x03\x01\x05\x01\x01\x03\x01\x02\x05" + "\x03\x01\x04\x02\x00\x00\x90\x02\x00\x01\x05\x01\x04\x00\x00\x00\xF0\x02\x02\x00\x00\x77\xBD" + "\xBF\xBB\xBD\xB7\xBF\xC3\xC9\xCF\xD3" + "\xF0\xCF\xBB\xA3\x8B\x77\x7D\x85\x8D\x97\xAF\xC7\xCF\xC9\xC1\xBB\xF0\xAD\x8D\x69\x39\x17\x15" + "\x05\x01\x01\x01\x04\x02\x04\x02\x00" + "\xF0\x02\x02\x00\x02\x04\x00\x03\x02\x02\x00\x00\x02\x01\x01\x01\x40\x00\x00\x02\x02\xF0\x02" + "\x00\x09\x99\xAD\x65\x4D\x45\x3B\x39" + "\x3D\x49\x55\x5D\x5F\xF0\x6B\x83\x9B\xB3\xC1\xBD\xB5\xAB\xA3\x91\x73\x61\x57\x4D\x35\xF0\x1B" + "\x15\x0B\x0D\x09\x01\x07\x03\x01\x02" + "\x01\x00\x04\x02\x00\x14\x01\xE0\x04\x00\x02\x01\x04\x00\x01\x04\x06\x04\x05\x03\x03\x00\xF0" + "\x02\x00\x3D\x63\x17\x0B\x07\x07\x00" + "\x03\x03\x07\x09\x07\x0D\xF0\x11\x0F\x0D\x0B\x15\x11\x11\x13\x13\x0D\x0F\x09\x05\x03\x05\xF0" + "\x03\x01\x01\x01\x02\x04\x06\x02\x00" + "\x00\x02\x04\x00\x01\x03\xF0\x03\x01\x02\x00\x00\x03\x00\x00\x02\x00\x02\x01\x00\x02\x00\x40" + "\x06\x04\x02\x01\xF0\x00\x00\x47\x25" + "\x05\x03\x00\x02\x01\x01\x02\x04\x00\x01\x00\xB3\x00\x01\x02\x01\x01\x03\x01\x01\x01\x00\x01" + "\xF0\x04\x02\x01\x00\x04\x00\x03\x07" + "\x01\x02\x01\x03\x03\x07\x03\xF0\x04\x06\x02\x01\x00\x02\x06\x04\x03\x00\x00\x02\x02\x02\x04" + "\x50\x00\x00\x00\x03\x04\xF0\x02\x0D" + "\x27\x0B\x01\x01\x02\x00\x00\x00\x03\x01\x00\x00\x00\xF0\x04\x04\x00\x00\x04\x00\x01\x00\x00" + "\x01\x00\x02\x02\x02\x00\xF0\x00\x02" + "\x01\x02\x03\x01\x04\x00\x00\x02\x01\x01\x00\x02\x02\xF0\x03\x00\x03\x02\x00\x05\x05\x00\x01" + "\x03\x01\x04\x01\x03\x00\x40\x01\x00" + "\x00\x03\xF0\x00\x05\x07\x03\x01\x02\x04\x00\x00\x00\x01\x03\x00\x02\x00\xF0\x00\x02\x03\x01" + "\x01\x00\x01\x03\x00\x02\x02\x00\x01" + "\x00\x00\xF0\x02\x02\x02\x03\x01\x00\x02\x02\x01\x01\x04\x02\x04\x02\x01\xF4\x00\x01\x04\x00" + "\x02\x02\x02\x00\x02\x01\x03\x05\x01" + "\x03\x00\xF0\x02\x05\x03\x01\x03\x00\x03\x02\x00\x00\x02\x02\x06\x02\x01\xF0\x05\x05\x00\x04" + "\x01\x03\x02\x04\x00\x00\x04\x01\x01" + "\x02\x02\xF0\x00\x04\x00\x02\x06\x04\x05\x00\x04\x02\x00\x01\x01\x07\x03\xF0\x00\x04\x00\x02" + "\x03\x01\x04\x00\x04\x04\x06\x02\x02" + "\x02\x01\x40\x02\x00\x02\x01\xF0\x02\x0A\x08\x00\x06\x04\x06\x00\x04\x02\x00\x01\x00\x02\x04" + "\xF0\x06\x00\x00\x03\x02\x02\x02\x00" + "\x04\x02\x03\x00\x04\x03\x00\xF0\x01\x05\x01\x03\x01\x03\x00\x03\x01\x01\x00\x01\x01\x02\x06" + "\xF0\x04\x04\x01\x03\x04\x01\x07\x04" + "\x03\x02\x01\x00\x03\x01\x00\x40\x00\x03\x00\x06\xF0\x00\x0C\x0E\x04\x00\x03\x01\x02\x03\x01" + "\x00\x04\x05\x03\x03\xA5\x01\x04\x01" + "\x01\x03\x04\x00\x00\x03\x00\xF0\x01\x00\x02\x00\x00\x04\x00\x00\x00\x04\x00\x02\x02\x04\x02" + "\xF0\x02\x03\x04\x03\x05\x00\x04\x05" + "\x00\x01\x00\x00\x02\x04\x02\x40\x01\x04\x00\x03\xF0\x00\x0A\x2C\x14\x00\x01\x01\x02\x04\x00" + "\x01\x02\x00\x01\x00\xF0\x09\x05\x02" + "\x00\x06\x01\x01\x01\x00\x01\x03\x01\x01\x02\x04\xF0\x04\x02\x04\x08\x04\x00\x04\x06\x02\x01" + "\x03\x00\x00\x00\x03\xF0\x03\x00\x01" + "\x02\x02\x00\x00\x01\x00\x04\x01\x00\x04\x00\x01\x40\x04\x00\x01\x01\xF0\x02\x02\x3E\x1C\x00" + "\x08\x04\x01\x00\x03\x00\x03\x00\x02" + "\x02\xF0\x08\x00\x05\x01\x00\x00\x01\x02\x01\x01\x04\x02\x01\x03\x07\xF0\x03\x05\x07\x01\x05" + "\x05\x01\x01\x01\x02\x02\x01\x00\x00" + "\x01\xF0\x01\x00\x03\x06\x00\x04\x01\x08\x02\x05\x03\x04\x01\x01\x02\x40\x05\x00\x02\x00\xF0" + "\x00\x00\x30\x16\x0A\x00\x03\x00\x01" + "\x08\x00\x03\x00\x01\x00\x63\x02\x04\x06\x04\x06\x02\xF0\x00\x00\x02\x00\x04\x02\x00\x00\x01" + "\x07\x02\x04\x01\x00\x00\xF0\x03\x02" + "\x02\x04\x06\x06\x02\x05\x00\x03\x02\x00\x02\x03\x00\xA0\x02\x02\x03\x03\x01\x02\x00\x00\x00" + "\x04\xF0\x00\x00\x18\x34\x0A\x04\x02" + "\x04\x02\x01\x00\x04\x02\x00\x05\x93\x01\x00\x01\x00\x0B\x01\x00\x01\x00\xF0\x02\x01\x02\x02" + "\x02\x06\x04\x04\x00\x02\x00\x00\x00" + "\x04\x02\xF0\x01\x01\x00\x04\x06\x04\x04\x02\x01\x02\x00\x01\x01\x04\x01\x70\x02\x02\x03\x02" + "\x03\x01\x00\xF0\x00\x02\x06\x6E\x0C" + "\x02\x00\x03\x02\x00\x04\x04\x00\x04\x02\xF0\x03\x00\x00\x01\x06\x04\x00\x00\x02\x02\x00\x01" + "\x03\x04\x02\xF0\x01\x00\x05\x00\x03" + "\x00\x00\x01\x01\x01\x07\x02\x02\x01\x01\xF0\x03\x00\x00\x03\x02\x02\x01\x00\x00\x00\x02\x04" + "\x00\x00\x00\x40\x02\x02\x00\x03\xF0" + "\x02\x00\x00\x4A\x3C\x0A\x00\x03\x01\x02\x00\x01\x01\x00\x08\xB3\x06\x00\x02\x02\x03\x03\x02" + "\x04\x00\x01\x00\xF0\x03\x00\x01\x02" + "\x02\x01\x01\x02\x00\x00\x04\x00\x00\x01\x00\xA3\x01\x03\x00\x02\x00\x03\x00\x00\x02\x00\x70" + "\x04\x02\x01\x01\x02\x00\x00\x03\xF0" + "\x0A\x76\x1C\x1A\x1A\x14\x12\x0E\x10\x0E\x08\x08\x0A\x08\x08\xF0\x06\x06\x02\x06\x02\x01\x01" + "\x00\x00\x00\x07\x03\x00\x04\x02\xF0" + "\x00\x06\x04\x00\x00\x00\x03\x00\x03\x00\x03\x01\x02\x00\x03\xF0\x02\x00\x00\x01\x00\x01\x02" + "\x07\x01\x01\x00\x02\x00\x01\x01\x10" + "\x02\x04\xF0\x6E\xCC\xC4\xBA\xB0\xA0\x98\x86\x7A\x76\x6A\x68\x62\x50\x40\xF0\x34\x20\x12\x12" + "\x14\x14\x0A\x0A\x08\x08\x04\x00\x04" + "\x04\x01\xF0\x01\x01\x03\x01\x01\x00\x06\x00\x04\x06\x06\x02\x00\x00\x02\xF0\x02\x01\x00\x01" + "\x02\x00\x04\x02\x03\x02\x02\x04\x02" + "\x06\x04\x04\xF0\x10\x56\x72\x80\x8C\x9C\xA8\xB8\xCA\xCE\xD2\xD0\xCA\xC6\xC0\xF0\xB6\xB0\xA2" + "\x8A\x78\x5A\x42\x26\x1C\x18\x14\x10" + "\x08\x06\x04\xF0\x00\x00\x04\x00\x02\x06\x01\x02\x03\x01\x03\x00\x01\x00\x03\xF0\x01\x00\x00" + "\x02\x00\x02\x04\x02\x06\x01\x02\x00" + "\x02\x01\x01\x39\x01\x01\x00\xF0\x01\x02\x08\x0E\x1C\x32\x4A\x62\x7E\x90\x9E\xAC\xBE\xD0\xDE" + "\xF0\xD8\xB8\x8E\x54\x24\x1A\x16\x0A" + "\x08\x08\x06\x06\x00\x00\x02\xF0\x01\x00\x00\x02\x04\x00\x02\x00\x04\x00\x01\x01\x05\x00\x00" + "\x70\x00\x02\x03\x01\x03\x01\x01\x6C" + "\x04\x00\x00\x00\x01\x00\xF0\x01\x01\x02\x06\x10\x1A\x28\x34\x42\x58\x7C\xAC\xEC\xED\xE6\xF0" + "\xB6\x86\x66\x40\x2E\x16\x10\x0C\x04" + "\x02\x03\x00\x01\x05\x04\xF0\x02\x00\x03\x01\x00\x00\x02\x03\x00\x00\x00\x02\x02\x00\x05\x10" + "\x00\x34\x01\x02\x00\x23\x01\x00\x2E" + "\x02\x00\xF0\x02\x02\x02\x0E\x46\x82\xBC\xCA\xC4\xB4\xA0\x80\x52\x28\x16\xF0\x12\x0A\x06\x04" + "\x02\x01\x00\x00\x00\x01\x02\x00\x00" + "\x00\x03\x60\x01\x01\x05\x00\x08\x00\x03\x67\x01\x02\x00\x00\x02\x00\x53\x01\x00\x02\x02\x00" + "\x28\x01\x00\xF0\x04\x18\x44\x6C\x90" + "\xA8\xC4\xD6\xAC\x5C\x1E\x14\x0E\x02\x02\xF0\x00\x00\x02\x02\x02\x04\x04\x06\x02\x00\x04\x08" + "\x02\x00\x04\x03\x25\x02\x00\x25\x01" + "\x00\x34\x01\x01\x00\x26\x02\x00\xF0\x02\x00\x00\x02\x00\x00\x06\x16\x2E\x4A\x8E\xE4\xF9\xC0" + "\x78\xF0\x4E\x28\x16\x0C\x08\x04\x00" + "\x03\x05\x09\x01\x00\x00\x07\x03\x20\x02\x01\x55\x03\x05\x07\x03\x00\x2F\x02\x00\x0D\xF0\x01" + "\x02\x00\x02\x24\x78\xC0\xCA\xB2\x8C" + "\x5A\x26\x14\x10\x08\x90\x04\x02\x02\x00\x01\x01\x00\x03\x00\xF0\xCD\xCF\xCF\xD1\xC9\xB7\xA3" + "\x97\x81\x71\x61\x53\x43\x2F\x13\x5D" + "\x01\x02\x02\x02\x00\x03\x13\x01\xF0\x00\x01\x01\x00\x00\x00\x0A\x32\x72\x9E\xC2\xD4\x92\x3E" + "\x18\x90\x12\x02\x00\x00\x04\x01\x06" + "\x04\x00\xF0\x6F\x6D\x71\x6B\x77\x8B\x9F\xA3\xBB\xC5\xD1\xDD\xE7\xF9\xF0\xC5\xEE\xE3\xB9\x93" + "\x6F\x4B\x3B\x2D\x21\x0F\x03\x00\x29" + "\x01\x00\x14\x01\xF0\x00\x10\x2A\x50\xA6\xF4\xDA\x80\x48\x20\x08\x05\x0C\x00\x03\x10\x01\xF0" + "\x0B\x0B\x09\x11\x0B\x0B\x09\x13\x11" + "\x19\x15\x13\x21\x1F\x23\xF0\x2D\x5F\x83\xA5\xC3\xDF\xD5\xC5\xB5\xA1\x85\x5F\x37\x11\x00\xC6" + "\x00\x00\x02\x00\x00\x00\x02\x02\x00" + "\x00\x02\x00\xF0\x02\x01\x00\x00\x02\x0E\x58\xB6\xBA\x98\x5E\x2A\x12\x08\x04\x10\x02\xF0\x01" + "\x01\x06\x06\x03\x01\x05\x01\x03\x00" + "\x03\x03\x01\x03\x07\xF0\x0B\x07\x11\x13\x17\x1D\x37\x51\x69\x85\xA5\xB5\xC1\xC5\xB1\xE4\x75" + "\x3B\x07\x00\x01\x01\x00\x00\x02\x02" + "\x00\x00\x00\x02\xF0\x00\x02\x00\x00\x02\x00\x00\x08\x4A\x8E\xC0\xC4\x5C\x1E\x12\x10\x0A\xF0" + "\x01\x01\x05\x03\x01\x00\x04\x04\x04" + "\x02\x01\x05\x01\x03\x00\xF0\x03\x05\x01\x07\x03\x05\x07\x0B\x0F\x13\x1B\x33\x47\x6B\x8F\xA4" + "\xC1\xF1\xEC\xE5\x9D\x57\x29\x0F\x01" + "\x00\xF0\x01\x01\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x02\x0A\x2A\x50\x62\xD8\xF2\x9C\x56" + "\xF0\x03\x00\x04\x02\x04\x02\x00\x03" + "\x01\x01\x03\x01\x02\x00\x01\xF0\x00\x02\x04\x08\x00\x01\x02\x02\x02\x05\x05\x05\x0B\x0B\x0B" + "\xF0\x13\x19\x29\x5B\x97\xCF\xC1\xA1" "\x75\x3F\x0B\x02\x02\x00\x02\x2C\x02\x00\x50\x02\x06\x36\x9C\xC4"; BYTE TEST_64X64_BLUE_PLANE[4096] = - "\x27\x23\x23\x24\x25\x25\x25\x25\x28\x37\x4A\x47\x41\x3D\x38\x33\x2E\x2A\x28\x27\x26\x27\x27\x27\x25\x24\x26\x28\x26\x27\x28\x28" - "\x26\x28\x28\x2A\x26\x27\x27\x28\x27\x27\x25\x26\x24\x25\x27\x28\x27\x28\x27\x27\x25\x26\x27\x27\x26\x27\x27\x27\x26\x25\x26\x23" - "\x32\x29\x29\x27\x26\x28\x27\x27\x29\x3C\x55\x56\x56\x54\x52\x50\x4D\x48\x40\x37\x2F\x2C\x2B\x2A\x27\x27\x27\x27\x26\x26\x25\x26" - "\x27\x28\x28\x28\x27\x27\x27\x28\x25\x26\x25\x27\x26\x26\x29\x28\x26\x27\x25\x27\x25\x26\x25\x27\x25\x27\x28\x27\x26\x27\x27\x27" - "\x4E\x4D\x45\x3D\x35\x30\x2D\x29\x2B\x3E\x56\x56\x57\x57\x57\x57\x56\x56\x56\x56\x56\x52\x49\x3E\x36\x31\x2D\x29\x27\x27\x27\x28" - "\x27\x27\x24\x25\x28\x29\x27\x28\x26\x27\x29\x2A\x27\x25\x24\x26\x28\x27\x27\x25\x29\x27\x26\x25\x26\x23\x26\x27\x25\x27\x29\x26" - "\x4F\x50\x50\x51\x52\x4A\x44\x3E\x36\x41\x55\x56\x57\x57\x57\x57\x57\x57\x57\x57\x56\x57\x57\x57\x53\x4D\x47\x40\x39\x31\x2D\x27" - "\x25\x27\x26\x25\x28\x26\x25\x26\x25\x28\x29\x29\x25\x25\x26\x26\x2A\x29\x28\x26\x29\x29\x27\x27\x26\x25\x25\x24\x28\x27\x27\x25" - "\x4F\x50\x50\x51\x53\x54\x55\x53\x50\x51\x56\x57\x57\x57\x57\x57\x57\x57\x57\x56\x57\x57\x57\x57\x58\x57\x57\x55\x52\x4E\x47\x38" - "\x2D\x2C\x26\x27\x28\x27\x26\x28\x27\x26\x24\x26\x24\x24\x24\x27\x27\x25\x26\x28\x27\x27\x25\x26\x26\x27\x26\x27\x27\x28\x27\x24" - "\x4F\x50\x51\x52\x52\x54\x55\x54\x55\x55\x56\x56\x57\x57\x57\x57\x57\x57\x57\x56\x57\x57\x57\x57\x56\x56\x57\x57\x57\x57\x57\x56" - "\x52\x45\x38\x2F\x29\x27\x28\x25\x23\x25\x28\x26\x27\x27\x25\x27\x27\x26\x25\x28\x25\x26\x25\x27\x27\x26\x2A\x2C\x27\x27\x28\x29" - "\x4F\x50\x51\x52\x53\x53\x54\x55\x55\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x56\x56\x56\x57\x56\x56\x57\x57\x57\x57\x57\x57" - "\x57\x56\x52\x49\x3A\x2E\x29\x28\x27\x26\x26\x25\x25\x26\x27\x27\x27\x27\x27\x27\x25\x26\x27\x25\x25\x28\x28\x28\x25\x25\x26\x27" - "\x4F\x50\x51\x52\x52\x53\x54\x55\x55\x55\x56\x56\x57\x57\x57\x57\x57\x57\x57\x58\x56\x56\x56\x56\x57\x56\x56\x52\x4C\x45\x42\x47" - "\x51\x56\x57\x57\x53\x45\x30\x28\x27\x27\x27\x28\x27\x29\x28\x26\x25\x26\x28\x26\x25\x25\x29\x26\x27\x29\x27\x26\x26\x26\x25\x26" - "\x4F\x50\x51\x52\x52\x54\x55\x55\x55\x55\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x56\x56\x50\x42\x30\x2A\x2B\x2D\x2D" - "\x2E\x35\x48\x54\x57\x57\x4C\x34\x27\x27\x29\x2A\x28\x26\x29\x26\x25\x26\x28\x25\x27\x25\x25\x25\x27\x25\x27\x25\x26\x25\x25\x26" - "\x4F\x50\x51\x52\x53\x54\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x56\x4C\x37\x2D\x2E\x34\x3B\x3D\x3A" - "\x33\x2F\x2F\x3E\x54\x56\x56\x48\x2C\x29\x27\x25\x27\x26\x29\x25\x27\x26\x28\x28\x28\x26\x24\x25\x25\x24\x29\x28\x25\x25\x25\x24" - "\x4F\x50\x51\x52\x53\x54\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x53\x35\x2D\x32\x46\x51\x54\x55\x53" - "\x4E\x3F\x2D\x2D\x43\x56\x56\x56\x39\x2A\x28\x27\x2A\x28\x29\x26\x27\x28\x28\x29\x26\x26\x27\x28\x27\x26\x25\x28\x26\x26\x27\x25" - "\x4F\x50\x51\x52\x53\x54\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x56\x57\x55\x3B\x2E\x36\x4E\x57\x57\x56\x55\x54" - "\x56\x56\x43\x2E\x31\x4A\x56\x57\x4E\x2F\x28\x25\x27\x27\x28\x27\x26\x27\x27\x26\x26\x26\x26\x26\x28\x25\x26\x26\x27\x27\x26\x27" - "\x4F\x50\x51\x52\x53\x54\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x56\x57\x4E\x32\x2F\x45\x56\x57\x56\x4E\x42\x3D" - "\x44\x50\x53\x36\x2D\x3E\x54\x57\x54\x3D\x2A\x27\x27\x26\x27\x27\x27\x27\x27\x26\x27\x27\x27\x23\x25\x27\x27\x29\x26\x26\x25\x26" - "\x4F\x50\x51\x52\x53\x54\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x49\x2E\x33\x4F\x57\x57\x53\x3D\x2F\x2C" - "\x2F\x41\x55\x43\x2E\x39\x52\x56\x56\x48\x2E\x28\x28\x28\x26\x28\x28\x2A\x27\x25\x29\x29\x26\x25\x27\x28\x27\x27\x27\x26\x26\x25" - "\x4F\x50\x51\x52\x53\x54\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x56\x56\x56\x56\x57\x41\x2B\x33\x54\x56\x56\x55\x46\x34\x32" - "\x38\x49\x56\x4C\x2F\x36\x4E\x56\x57\x52\x39\x2A\x26\x26\x27\x28\x28\x28\x26\x27\x28\x28\x28\x25\x25\x25\x24\x26\x25\x23\x26\x27" - "\x4F\x50\x51\x52\x53\x54\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x56\x56\x57\x56\x57\x44\x2D\x33\x52\x57\x56\x56\x55\x50\x4D" - "\x52\x56\x57\x4A\x2E\x36\x4F\x57\x57\x56\x42\x2B\x28\x27\x28\x28\x24\x25\x27\x28\x26\x27\x27\x28\x27\x26\x25\x26\x26\x25\x27\x28" - "\x4F\x50\x51\x52\x53\x54\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x56\x56\x49\x31\x2F\x4B\x57\x57\x58\x57\x56\x56" - "\x57\x57\x57\x40\x2E\x38\x52\x57\x57\x57\x4D\x2F\x28\x27\x28\x29\x26\x27\x27\x27\x26\x27\x28\x28\x27\x26\x28\x29\x26\x24\x27\x24" - "\x4F\x50\x51\x52\x53\x54\x55\x55\x56\x56\x56\x56\x56\x53\x57\x57\x57\x57\x57\x57\x56\x56\x51\x37\x2D\x39\x52\x56\x57\x57\x57\x57" - "\x57\x57\x4C\x31\x2F\x41\x56\x57\x56\x56\x56\x39\x27\x26\x27\x24\x24\x26\x27\x27\x27\x26\x26\x25\x25\x26\x28\x28\x27\x27\x26\x27" - "\x4F\x50\x51\x52\x53\x54\x54\x55\x55\x56\x56\x56\x55\x49\x43\x50\x57\x57\x56\x56\x56\x56\x56\x48\x2C\x30\x3F\x51\x57\x57\x57\x57" - "\x56\x4C\x37\x2C\x36\x50\x57\x57\x57\x57\x57\x44\x29\x27\x27\x25\x23\x26\x27\x27\x26\x26\x27\x26\x27\x26\x26\x25\x28\x27\x27\x26" - "\x4F\x50\x51\x52\x53\x54\x54\x55\x55\x56\x56\x56\x56\x4C\x35\x35\x46\x55\x56\x56\x57\x57\x57\x55\x3B\x2C\x2E\x38\x46\x4E\x50\x4C" - "\x41\x32\x2C\x2B\x4B\x57\x57\x57\x57\x57\x57\x4F\x2D\x29\x27\x26\x26\x27\x29\x27\x28\x26\x25\x25\x25\x25\x25\x24\x25\x26\x27\x26" - "\x4F\x50\x51\x52\x53\x54\x54\x55\x55\x56\x56\x56\x57\x55\x40\x2C\x2B\x35\x48\x52\x56\x57\x57\x57\x54\x44\x31\x29\x2C\x2C\x2D\x2C" - "\x2C\x2E\x38\x4B\x57\x57\x57\x57\x57\x57\x57\x57\x33\x28\x28\x27\x23\x26\x27\x24\x27\x27\x26\x26\x25\x27\x27\x28\x26\x26\x26\x27" - "\x4F\x51\x52\x53\x53\x54\x54\x55\x55\x56\x56\x56\x57\x57\x4A\x30\x2A\x2A\x2E\x38\x48\x53\x57\x57\x57\x55\x4A\x3F\x37\x31\x31\x35" - "\x3A\x44\x50\x56\x57\x56\x56\x57\x56\x57\x56\x4F\x2F\x28\x27\x27\x25\x28\x27\x27\x29\x28\x27\x27\x28\x26\x25\x27\x26\x28\x27\x26" - "\x50\x51\x52\x53\x53\x54\x55\x55\x55\x56\x56\x56\x57\x57\x54\x41\x2D\x2B\x29\x27\x2F\x38\x48\x55\x57\x57\x56\x55\x52\x4F\x4E\x53" - "\x53\x55\x57\x57\x57\x56\x56\x57\x56\x52\x40\x32\x29\x29\x29\x27\x25\x26\x26\x26\x26\x28\x27\x29\x27\x28\x25\x26\x26\x27\x26\x27" - "\x50\x51\x52\x53\x54\x54\x55\x55\x55\x56\x56\x56\x57\x57\x56\x56\x52\x42\x36\x2F\x2B\x2B\x2C\x31\x41\x4C\x52\x55\x57\x57\x57\x57" - "\x56\x56\x56\x57\x56\x56\x54\x51\x3F\x2F\x2A\x26\x27\x26\x26\x26\x27\x27\x28\x28\x26\x26\x28\x26\x26\x27\x26\x28\x27\x27\x27\x28" - "\x50\x51\x52\x53\x54\x54\x55\x55\x55\x56\x56\x56\x57\x57\x57\x56\x57\x56\x50\x46\x38\x2D\x29\x29\x2A\x30\x38\x40\x49\x4E\x52\x56" - "\x57\x57\x56\x56\x4F\x48\x3F\x35\x2A\x2B\x2B\x2D\x28\x25\x26\x26\x27\x27\x27\x27\x26\x24\x28\x25\x25\x24\x27\x29\x26\x28\x28\x26" - "\x51\x52\x52\x53\x54\x54\x55\x55\x55\x56\x56\x56\x57\x57\x57\x56\x57\x57\x57\x56\x51\x49\x3D\x31\x2D\x2B\x2A\x29\x2F\x31\x35\x3A" - "\x3D\x3B\x39\x37\x33\x2E\x29\x2A\x2B\x37\x46\x47\x28\x25\x27\x27\x28\x26\x25\x26\x28\x26\x28\x25\x26\x24\x28\x29\x25\x28\x26\x25" - "\x51\x52\x53\x53\x54\x54\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x56\x56\x57\x57\x54\x4A\x3E\x35\x2E\x28\x29\x28\x29" - "\x29\x2A\x2C\x2B\x2B\x2F\x35\x3E\x4E\x56\x56\x45\x2B\x25\x27\x29\x25\x26\x27\x25\x25\x26\x26\x27\x26\x22\x25\x26\x26\x27\x25\x27" - "\x51\x52\x53\x54\x54\x55\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x50\x48\x41\x3E\x38\x34" - "\x31\x33\x38\x3B\x41\x48\x4F\x55\x57\x57\x55\x38\x2A\x28\x28\x27\x25\x26\x26\x22\x27\x27\x27\x26\x25\x25\x26\x26\x27\x27\x27\x28" - "\x52\x52\x53\x54\x54\x55\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x56\x54\x52\x51" - "\x4F\x4F\x52\x53\x55\x56\x57\x57\x57\x57\x49\x2F\x26\x26\x29\x26\x26\x26\x27\x27\x27\x25\x26\x28\x26\x27\x27\x27\x27\x27\x27\x27" - "\x52\x53\x53\x54\x54\x55\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x56" - "\x57\x56\x56\x56\x56\x56\x56\x57\x51\x43\x30\x2A\x24\x24\x25\x25\x27\x28\x25\x26\x26\x27\x28\x25\x25\x27\x27\x26\x27\x27\x29\x26" - "\x52\x53\x54\x54\x55\x55\x55\x56\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x56" - "\x57\x57\x56\x56\x56\x56\x52\x48\x38\x2C\x27\x27\x25\x25\x25\x25\x25\x27\x26\x26\x25\x26\x28\x27\x27\x26\x25\x26\x28\x27\x25\x26" - "\x53\x53\x54\x54\x55\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x56\x57\x57\x57\x57\x57\x57" - "\x58\x57\x57\x57\x52\x43\x35\x2E\x27\x28\x29\x27\x23\x25\x26\x27\x27\x27\x27\x28\x26\x25\x26\x24\x25\x25\x25\x25\x26\x28\x27\x27" - "\x53\x54\x54\x55\x55\x54\x54\x55\x56\x56\x56\x57\x56\x56\x56\x57\x56\x56\x57\x57\x56\x57\x57\x57\x56\x56\x56\x58\x56\x56\x56\x54" - "\x51\x4E\x46\x39\x2D\x2B\x29\x28\x27\x27\x28\x28\x26\x26\x26\x28\x2A\x28\x28\x28\x26\x26\x26\x26\x26\x28\x28\x28\x25\x28\x29\x25" - "\x53\x54\x53\x54\x55\x52\x4C\x4B\x48\x48\x4B\x4F\x51\x52\x55\x56\x56\x56\x57\x57\x56\x56\x57\x56\x57\x56\x54\x50\x4E\x49\x43\x3F" - "\x37\x30\x2A\x2A\x28\x27\x28\x28\x27\x25\x26\x27\x26\x27\x26\x27\x27\x25\x27\x28\x27\x26\x26\x27\x26\x27\x25\x26\x26\x27\x27\x26" - "\x54\x54\x54\x54\x44\x37\x32\x31\x2D\x2D\x2E\x32\x35\x34\x34\x38\x3C\x40\x43\x45\x44\x43\x43\x41\x3D\x38\x36\x33\x33\x2F\x2A\x2B" - "\x27\x29\x28\x26\x29\x27\x27\x27\x29\x27\x27\x28\x26\x25\x26\x28\x27\x25\x25\x27\x28\x26\x26\x25\x26\x26\x23\x25\x28\x26\x28\x27" - "\x53\x53\x53\x3E\x2B\x25\x23\x25\x24\x27\x28\x28\x27\x27\x2A\x2A\x27\x27\x27\x29\x29\x28\x29\x29\x28\x2A\x29\x28\x27\x26\x27\x29" - "\x26\x26\x26\x26\x27\x26\x26\x26\x28\x28\x29\x29\x27\x25\x25\x28\x27\x27\x29\x26\x29\x26\x27\x27\x27\x27\x26\x26\x25\x25\x26\x26" - "\x53\x54\x49\x30\x26\x24\x23\x25\x25\x28\x28\x26\x25\x27\x27\x25\x26\x28\x28\x26\x27\x28\x27\x26\x27\x26\x26\x27\x25\x24\x25\x27" - "\x25\x26\x27\x27\x29\x27\x26\x26\x27\x2A\x29\x27\x25\x24\x25\x28\x27\x26\x27\x28\x29\x26\x27\x26\x26\x28\x28\x26\x26\x26\x26\x26" - "\x55\x54\x40\x29\x26\x24\x24\x27\x25\x26\x27\x29\x26\x24\x26\x26\x27\x29\x29\x25\x26\x28\x28\x26\x28\x27\x28\x27\x25\x28\x27\x27" - "\x27\x27\x25\x25\x26\x27\x27\x26\x25\x28\x26\x24\x27\x25\x26\x27\x27\x27\x27\x28\x24\x27\x27\x28\x26\x26\x29\x26\x25\x26\x26\x26" - "\x54\x52\x3A\x29\x25\x24\x26\x26\x26\x25\x26\x26\x27\x27\x27\x28\x29\x2A\x28\x29\x27\x26\x27\x27\x27\x27\x28\x29\x28\x27\x27\x28" - "\x27\x28\x25\x23\x27\x26\x28\x26\x23\x25\x26\x26\x28\x26\x26\x25\x26\x27\x27\x27\x24\x24\x26\x27\x27\x27\x28\x28\x27\x27\x26\x27" - "\x55\x52\x38\x29\x24\x26\x28\x26\x25\x25\x27\x27\x26\x26\x27\x26\x29\x27\x27\x27\x27\x25\x25\x27\x27\x26\x27\x28\x28\x27\x28\x28" - "\x27\x27\x24\x25\x28\x27\x27\x27\x26\x27\x28\x27\x27\x25\x26\x26\x28\x27\x28\x27\x26\x25\x25\x26\x25\x26\x26\x26\x27\x28\x26\x24" - "\x55\x51\x38\x28\x24\x26\x25\x25\x26\x25\x25\x27\x29\x28\x27\x24\x27\x28\x28\x26\x23\x25\x27\x27\x25\x28\x27\x26\x29\x28\x27\x2A" - "\x28\x28\x26\x27\x26\x27\x27\x27\x28\x26\x26\x24\x23\x25\x25\x27\x27\x26\x27\x29\x27\x27\x27\x29\x25\x28\x26\x24\x26\x28\x28\x24" - "\x56\x53\x39\x28\x28\x28\x28\x27\x28\x27\x27\x27\x2A\x2A\x29\x29\x27\x27\x27\x26\x25\x26\x27\x28\x28\x26\x27\x28\x26\x27\x28\x27" - "\x26\x25\x26\x26\x24\x26\x26\x27\x25\x25\x23\x25\x27\x26\x28\x27\x27\x27\x26\x26\x29\x27\x27\x27\x28\x26\x26\x25\x26\x25\x26\x26" - "\x56\x55\x3B\x27\x26\x24\x26\x27\x24\x26\x27\x28\x25\x27\x27\x27\x29\x27\x26\x26\x27\x26\x27\x27\x28\x28\x28\x28\x25\x28\x27\x26" - "\x26\x25\x26\x27\x26\x25\x27\x28\x27\x25\x25\x26\x28\x26\x26\x28\x26\x26\x26\x27\x26\x26\x27\x26\x27\x26\x28\x27\x27\x27\x26\x25" - "\x56\x56\x43\x2C\x25\x25\x27\x29\x27\x27\x28\x28\x26\x25\x27\x23\x23\x27\x26\x28\x27\x26\x27\x27\x28\x26\x27\x28\x26\x2A\x29\x27" - "\x29\x29\x29\x27\x28\x28\x29\x27\x28\x27\x26\x26\x25\x27\x28\x28\x26\x27\x25\x25\x25\x27\x29\x26\x25\x28\x28\x25\x28\x27\x27\x26" - "\x55\x56\x4B\x2E\x25\x28\x29\x28\x25\x25\x27\x28\x25\x25\x27\x27\x23\x24\x25\x26\x26\x26\x26\x24\x25\x28\x28\x27\x25\x27\x27\x24" - "\x26\x29\x26\x23\x27\x28\x27\x28\x26\x26\x27\x27\x26\x26\x27\x25\x28\x27\x27\x26\x29\x28\x27\x24\x29\x28\x27\x27\x26\x28\x28\x25" - "\x55\x56\x51\x32\x27\x28\x27\x27\x26\x29\x26\x26\x26\x26\x28\x27\x26\x28\x28\x29\x25\x27\x29\x26\x26\x27\x29\x27\x26\x28\x27\x25" - "\x25\x25\x26\x27\x25\x27\x28\x26\x26\x26\x28\x2A\x29\x25\x24\x24\x26\x28\x28\x28\x26\x26\x26\x25\x26\x24\x26\x27\x26\x27\x28\x27" - "\x56\x56\x55\x39\x29\x29\x28\x29\x28\x26\x26\x27\x26\x26\x25\x27\x25\x25\x26\x25\x26\x27\x28\x26\x27\x26\x28\x27\x26\x27\x27\x26" - "\x26\x27\x27\x27\x27\x28\x28\x26\x29\x28\x26\x29\x29\x28\x27\x28\x27\x29\x27\x26\x25\x26\x25\x26\x24\x25\x26\x27\x26\x25\x26\x28" - "\x57\x57\x57\x4A\x29\x27\x27\x27\x27\x28\x29\x29\x27\x29\x25\x25\x25\x25\x27\x29\x26\x26\x27\x26\x28\x28\x27\x25\x29\x29\x27\x27" - "\x25\x26\x26\x24\x27\x27\x26\x26\x26\x28\x27\x27\x27\x26\x27\x27\x27\x28\x27\x26\x27\x26\x26\x2A\x28\x26\x26\x25\x28\x26\x27\x26" - "\x57\x57\x57\x55\x32\x28\x25\x24\x28\x28\x27\x27\x27\x27\x27\x26\x26\x27\x28\x26\x25\x27\x29\x27\x27\x28\x28\x24\x29\x27\x26\x26" - "\x25\x28\x26\x25\x29\x26\x26\x26\x26\x29\x28\x25\x25\x25\x27\x28\x26\x26\x26\x28\x28\x25\x27\x28\x28\x28\x28\x24\x26\x26\x25\x25" - "\x57\x57\x56\x56\x43\x2B\x29\x28\x2A\x29\x29\x2A\x28\x27\x28\x27\x27\x27\x27\x29\x26\x2A\x28\x24\x26\x28\x28\x25\x24\x26\x26\x26" - "\x26\x28\x28\x27\x28\x27\x25\x25\x26\x27\x27\x23\x24\x25\x25\x26\x28\x27\x27\x27\x26\x26\x28\x25\x27\x27\x28\x26\x27\x27\x26\x25" - "\x56\x57\x56\x56\x54\x49\x47\x44\x42\x40\x3F\x3D\x37\x39\x38\x36\x37\x32\x30\x2F\x2A\x2C\x2B\x29\x2B\x28\x28\x26\x26\x26\x27\x28" - "\x27\x25\x26\x26\x24\x25\x25\x26\x29\x27\x28\x27\x28\x26\x27\x26\x26\x28\x27\x27\x27\x26\x27\x25\x28\x26\x29\x27\x27\x26\x27\x28" - "\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x55\x54\x53\x4F\x4C\x48\x44\x41\x3D\x3B\x36\x30\x2C\x2B\x2B\x2A\x2A\x2A" - "\x28\x27\x26\x27\x28\x26\x26\x27\x28\x28\x28\x26\x25\x25\x27\x27\x27\x25\x26\x26\x28\x27\x28\x28\x28\x28\x27\x27\x27\x28\x29\x27" - "\x56\x56\x57\x57\x56\x57\x57\x57\x57\x57\x57\x57\x56\x57\x57\x57\x57\x57\x56\x57\x56\x56\x54\x53\x51\x50\x4D\x49\x43\x3D\x34\x2E" - "\x2D\x2A\x26\x25\x28\x27\x28\x26\x28\x29\x27\x25\x26\x27\x27\x27\x24\x26\x28\x26\x27\x26\x25\x29\x28\x29\x27\x26\x27\x27\x26\x26" - "\x56\x56\x57\x57\x56\x57\x57\x57\x57\x57\x57\x57\x56\x57\x57\x57\x57\x57\x56\x56\x57\x57\x57\x57\x57\x57\x56\x57\x58\x56\x57\x56" - "\x4B\x42\x3A\x36\x2F\x2C\x29\x28\x27\x27\x24\x23\x26\x27\x26\x28\x27\x27\x26\x25\x25\x24\x25\x27\x27\x27\x28\x28\x29\x25\x22\x26" - "\x57\x57\x57\x57\x56\x57\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x56\x57\x57\x57\x57\x57\x57\x56\x57\x57\x57\x57\x57" - "\x56\x57\x56\x52\x4C\x46\x41\x3C\x34\x2C\x28\x27\x27\x28\x26\x27\x28\x26\x27\x26\x25\x25\x26\x27\x28\x26\x25\x26\x25\x27\x28\x26" - "\x57\x57\x57\x57\x57\x57\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x56\x57\x57\x57\x57\x57\x57\x57\x56\x57\x57\x57\x57\x57\x57\x57" - "\x56\x57\x57\x56\x56\x57\x55\x53\x50\x4B\x41\x35\x2B\x29\x28\x26\x26\x27\x26\x26\x27\x28\x29\x29\x2B\x28\x27\x28\x29\x28\x28\x28" - "\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x56\x57\x57\x57\x57\x56\x56\x56\x57\x57\x57\x57\x57\x56\x57\x57\x56\x57\x57\x57\x57" - "\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x57\x52\x46\x38\x31\x2C\x2A\x27\x26\x25\x27\x27\x26\x25\x24\x27\x28\x23\x26\x28\x27" - "\x56\x55\x55\x56\x58\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57" - "\x57\x57\x57\x57\x57\x57\x57\x57\x56\x57\x57\x57\x57\x57\x55\x4F\x46\x3F\x34\x2B\x29\x2B\x28\x26\x25\x28\x28\x27\x24\x26\x28\x25" - "\x39\x38\x37\x37\x39\x3B\x3F\x40\x44\x47\x49\x4A\x4C\x50\x53\x56\x57\x57\x57\x58\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57" - "\x57\x57\x57\x57\x56\x56\x56\x56\x56\x56\x56\x58\x56\x57\x57\x57\x56\x54\x50\x4B\x3F\x31\x29\x27\x26\x26\x26\x27\x23\x29\x27\x27" - "\x2A\x29\x26\x2A\x28\x27\x26\x28\x27\x2A\x29\x29\x2D\x2D\x2C\x2F\x35\x3C\x41\x47\x4B\x4E\x50\x52\x54\x56\x57\x57\x57\x57\x57\x57" - "\x56\x57\x57\x57\x56\x56\x56\x56\x56\x56\x56\x56\x56\x56\x56\x56\x56\x57\x57\x56\x56\x54\x4A\x3D\x32\x2E\x27\x24\x28\x26\x26\x25" - "\x26\x25\x24\x24\x27\x26\x26\x25\x26\x24\x28\x2A\x26\x26\x26\x2A\x27\x29\x29\x2B\x2B\x31\x34\x38\x3C\x43\x4A\x4E\x54\x56\x57\x57" - "\x57\x57\x57\x57\x57\x57\x56\x56\x57\x56\x56\x56\x56\x56\x56\x56\x57\x56\x56\x56\x57\x57\x57\x56\x4C\x41\x35\x2D\x2B\x28\x27\x27" - "\x27\x26\x28\x28\x25\x25\x25\x26\x26\x25\x29\x2A\x28\x28\x27\x26\x26\x27\x25\x26\x27\x29\x28\x29\x2A\x2A\x2F\x34\x38\x3C\x46\x4D" - "\x53\x57\x56\x56\x57\x57\x57\x57\x57\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x55\x51\x48\x38\x2C\x28\x27" - "\x27\x25\x25\x27\x26\x26\x28\x26\x27\x26\x25\x25\x26\x27\x27\x25\x26\x25\x25\x26\x27\x27\x27\x27\x29\x27\x28\x2B\x29\x28\x29\x2B" - "\x2D\x34\x3F\x4A\x51\x55\x56\x57\x57\x57\x57\x57\x56\x56\x57\x57\x56\x57\x57\x56\x57\x57\x57\x57\x56\x56\x56\x56\x56\x4E\x3F\x33" - "\x25\x26\x27\x28\x27\x27\x27\x25\x27\x27\x25\x27\x25\x27\x27\x27\x27\x29\x28\x28\x25\x28\x28\x26\x27\x26\x28\x27\x26\x28\x27\x27" - "\x28\x28\x2A\x2C\x35\x3E\x46\x4E\x55\x57\x57\x57\x57\x57\x57\x57\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x57\x57\x57\x56\x51"; + "\x27\x23\x23\x24\x25\x25\x25\x25\x28\x37\x4A\x47\x41\x3D\x38\x33\x2E\x2A\x28\x27\x26\x27\x27" + "\x27\x25\x24\x26\x28\x26\x27\x28\x28" + "\x26\x28\x28\x2A\x26\x27\x27\x28\x27\x27\x25\x26\x24\x25\x27\x28\x27\x28\x27\x27\x25\x26\x27" + "\x27\x26\x27\x27\x27\x26\x25\x26\x23" + "\x32\x29\x29\x27\x26\x28\x27\x27\x29\x3C\x55\x56\x56\x54\x52\x50\x4D\x48\x40\x37\x2F\x2C\x2B" + "\x2A\x27\x27\x27\x27\x26\x26\x25\x26" + "\x27\x28\x28\x28\x27\x27\x27\x28\x25\x26\x25\x27\x26\x26\x29\x28\x26\x27\x25\x27\x25\x26\x25" + "\x27\x25\x27\x28\x27\x26\x27\x27\x27" + "\x4E\x4D\x45\x3D\x35\x30\x2D\x29\x2B\x3E\x56\x56\x57\x57\x57\x57\x56\x56\x56\x56\x56\x52\x49" + "\x3E\x36\x31\x2D\x29\x27\x27\x27\x28" + "\x27\x27\x24\x25\x28\x29\x27\x28\x26\x27\x29\x2A\x27\x25\x24\x26\x28\x27\x27\x25\x29\x27\x26" + "\x25\x26\x23\x26\x27\x25\x27\x29\x26" + "\x4F\x50\x50\x51\x52\x4A\x44\x3E\x36\x41\x55\x56\x57\x57\x57\x57\x57\x57\x57\x57\x56\x57\x57" + "\x57\x53\x4D\x47\x40\x39\x31\x2D\x27" + "\x25\x27\x26\x25\x28\x26\x25\x26\x25\x28\x29\x29\x25\x25\x26\x26\x2A\x29\x28\x26\x29\x29\x27" + "\x27\x26\x25\x25\x24\x28\x27\x27\x25" + "\x4F\x50\x50\x51\x53\x54\x55\x53\x50\x51\x56\x57\x57\x57\x57\x57\x57\x57\x57\x56\x57\x57\x57" + "\x57\x58\x57\x57\x55\x52\x4E\x47\x38" + "\x2D\x2C\x26\x27\x28\x27\x26\x28\x27\x26\x24\x26\x24\x24\x24\x27\x27\x25\x26\x28\x27\x27\x25" + "\x26\x26\x27\x26\x27\x27\x28\x27\x24" + "\x4F\x50\x51\x52\x52\x54\x55\x54\x55\x55\x56\x56\x57\x57\x57\x57\x57\x57\x57\x56\x57\x57\x57" + "\x57\x56\x56\x57\x57\x57\x57\x57\x56" + "\x52\x45\x38\x2F\x29\x27\x28\x25\x23\x25\x28\x26\x27\x27\x25\x27\x27\x26\x25\x28\x25\x26\x25" + "\x27\x27\x26\x2A\x2C\x27\x27\x28\x29" + "\x4F\x50\x51\x52\x53\x53\x54\x55\x55\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x56\x56\x56" + "\x57\x56\x56\x57\x57\x57\x57\x57\x57" + "\x57\x56\x52\x49\x3A\x2E\x29\x28\x27\x26\x26\x25\x25\x26\x27\x27\x27\x27\x27\x27\x25\x26\x27" + "\x25\x25\x28\x28\x28\x25\x25\x26\x27" + "\x4F\x50\x51\x52\x52\x53\x54\x55\x55\x55\x56\x56\x57\x57\x57\x57\x57\x57\x57\x58\x56\x56\x56" + "\x56\x57\x56\x56\x52\x4C\x45\x42\x47" + "\x51\x56\x57\x57\x53\x45\x30\x28\x27\x27\x27\x28\x27\x29\x28\x26\x25\x26\x28\x26\x25\x25\x29" + "\x26\x27\x29\x27\x26\x26\x26\x25\x26" + "\x4F\x50\x51\x52\x52\x54\x55\x55\x55\x55\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56" + "\x56\x56\x50\x42\x30\x2A\x2B\x2D\x2D" + "\x2E\x35\x48\x54\x57\x57\x4C\x34\x27\x27\x29\x2A\x28\x26\x29\x26\x25\x26\x28\x25\x27\x25\x25" + "\x25\x27\x25\x27\x25\x26\x25\x25\x26" + "\x4F\x50\x51\x52\x53\x54\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56" + "\x56\x4C\x37\x2D\x2E\x34\x3B\x3D\x3A" + "\x33\x2F\x2F\x3E\x54\x56\x56\x48\x2C\x29\x27\x25\x27\x26\x29\x25\x27\x26\x28\x28\x28\x26\x24" + "\x25\x25\x24\x29\x28\x25\x25\x25\x24" + "\x4F\x50\x51\x52\x53\x54\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56" + "\x53\x35\x2D\x32\x46\x51\x54\x55\x53" + "\x4E\x3F\x2D\x2D\x43\x56\x56\x56\x39\x2A\x28\x27\x2A\x28\x29\x26\x27\x28\x28\x29\x26\x26\x27" + "\x28\x27\x26\x25\x28\x26\x26\x27\x25" + "\x4F\x50\x51\x52\x53\x54\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x56\x57\x55" + "\x3B\x2E\x36\x4E\x57\x57\x56\x55\x54" + "\x56\x56\x43\x2E\x31\x4A\x56\x57\x4E\x2F\x28\x25\x27\x27\x28\x27\x26\x27\x27\x26\x26\x26\x26" + "\x26\x28\x25\x26\x26\x27\x27\x26\x27" + "\x4F\x50\x51\x52\x53\x54\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x56\x57\x4E" + "\x32\x2F\x45\x56\x57\x56\x4E\x42\x3D" + "\x44\x50\x53\x36\x2D\x3E\x54\x57\x54\x3D\x2A\x27\x27\x26\x27\x27\x27\x27\x27\x26\x27\x27\x27" + "\x23\x25\x27\x27\x29\x26\x26\x25\x26" + "\x4F\x50\x51\x52\x53\x54\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x49" + "\x2E\x33\x4F\x57\x57\x53\x3D\x2F\x2C" + "\x2F\x41\x55\x43\x2E\x39\x52\x56\x56\x48\x2E\x28\x28\x28\x26\x28\x28\x2A\x27\x25\x29\x29\x26" + "\x25\x27\x28\x27\x27\x27\x26\x26\x25" + "\x4F\x50\x51\x52\x53\x54\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x56\x56\x56\x56\x57\x41" + "\x2B\x33\x54\x56\x56\x55\x46\x34\x32" + "\x38\x49\x56\x4C\x2F\x36\x4E\x56\x57\x52\x39\x2A\x26\x26\x27\x28\x28\x28\x26\x27\x28\x28\x28" + "\x25\x25\x25\x24\x26\x25\x23\x26\x27" + "\x4F\x50\x51\x52\x53\x54\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x56\x56\x57\x56\x57\x44" + "\x2D\x33\x52\x57\x56\x56\x55\x50\x4D" + "\x52\x56\x57\x4A\x2E\x36\x4F\x57\x57\x56\x42\x2B\x28\x27\x28\x28\x24\x25\x27\x28\x26\x27\x27" + "\x28\x27\x26\x25\x26\x26\x25\x27\x28" + "\x4F\x50\x51\x52\x53\x54\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x56\x56\x49" + "\x31\x2F\x4B\x57\x57\x58\x57\x56\x56" + "\x57\x57\x57\x40\x2E\x38\x52\x57\x57\x57\x4D\x2F\x28\x27\x28\x29\x26\x27\x27\x27\x26\x27\x28" + "\x28\x27\x26\x28\x29\x26\x24\x27\x24" + "\x4F\x50\x51\x52\x53\x54\x55\x55\x56\x56\x56\x56\x56\x53\x57\x57\x57\x57\x57\x57\x56\x56\x51" + "\x37\x2D\x39\x52\x56\x57\x57\x57\x57" + "\x57\x57\x4C\x31\x2F\x41\x56\x57\x56\x56\x56\x39\x27\x26\x27\x24\x24\x26\x27\x27\x27\x26\x26" + "\x25\x25\x26\x28\x28\x27\x27\x26\x27" + "\x4F\x50\x51\x52\x53\x54\x54\x55\x55\x56\x56\x56\x55\x49\x43\x50\x57\x57\x56\x56\x56\x56\x56" + "\x48\x2C\x30\x3F\x51\x57\x57\x57\x57" + "\x56\x4C\x37\x2C\x36\x50\x57\x57\x57\x57\x57\x44\x29\x27\x27\x25\x23\x26\x27\x27\x26\x26\x27" + "\x26\x27\x26\x26\x25\x28\x27\x27\x26" + "\x4F\x50\x51\x52\x53\x54\x54\x55\x55\x56\x56\x56\x56\x4C\x35\x35\x46\x55\x56\x56\x57\x57\x57" + "\x55\x3B\x2C\x2E\x38\x46\x4E\x50\x4C" + "\x41\x32\x2C\x2B\x4B\x57\x57\x57\x57\x57\x57\x4F\x2D\x29\x27\x26\x26\x27\x29\x27\x28\x26\x25" + "\x25\x25\x25\x25\x24\x25\x26\x27\x26" + "\x4F\x50\x51\x52\x53\x54\x54\x55\x55\x56\x56\x56\x57\x55\x40\x2C\x2B\x35\x48\x52\x56\x57\x57" + "\x57\x54\x44\x31\x29\x2C\x2C\x2D\x2C" + "\x2C\x2E\x38\x4B\x57\x57\x57\x57\x57\x57\x57\x57\x33\x28\x28\x27\x23\x26\x27\x24\x27\x27\x26" + "\x26\x25\x27\x27\x28\x26\x26\x26\x27" + "\x4F\x51\x52\x53\x53\x54\x54\x55\x55\x56\x56\x56\x57\x57\x4A\x30\x2A\x2A\x2E\x38\x48\x53\x57" + "\x57\x57\x55\x4A\x3F\x37\x31\x31\x35" + "\x3A\x44\x50\x56\x57\x56\x56\x57\x56\x57\x56\x4F\x2F\x28\x27\x27\x25\x28\x27\x27\x29\x28\x27" + "\x27\x28\x26\x25\x27\x26\x28\x27\x26" + "\x50\x51\x52\x53\x53\x54\x55\x55\x55\x56\x56\x56\x57\x57\x54\x41\x2D\x2B\x29\x27\x2F\x38\x48" + "\x55\x57\x57\x56\x55\x52\x4F\x4E\x53" + "\x53\x55\x57\x57\x57\x56\x56\x57\x56\x52\x40\x32\x29\x29\x29\x27\x25\x26\x26\x26\x26\x28\x27" + "\x29\x27\x28\x25\x26\x26\x27\x26\x27" + "\x50\x51\x52\x53\x54\x54\x55\x55\x55\x56\x56\x56\x57\x57\x56\x56\x52\x42\x36\x2F\x2B\x2B\x2C" + "\x31\x41\x4C\x52\x55\x57\x57\x57\x57" + "\x56\x56\x56\x57\x56\x56\x54\x51\x3F\x2F\x2A\x26\x27\x26\x26\x26\x27\x27\x28\x28\x26\x26\x28" + "\x26\x26\x27\x26\x28\x27\x27\x27\x28" + "\x50\x51\x52\x53\x54\x54\x55\x55\x55\x56\x56\x56\x57\x57\x57\x56\x57\x56\x50\x46\x38\x2D\x29" + "\x29\x2A\x30\x38\x40\x49\x4E\x52\x56" + "\x57\x57\x56\x56\x4F\x48\x3F\x35\x2A\x2B\x2B\x2D\x28\x25\x26\x26\x27\x27\x27\x27\x26\x24\x28" + "\x25\x25\x24\x27\x29\x26\x28\x28\x26" + "\x51\x52\x52\x53\x54\x54\x55\x55\x55\x56\x56\x56\x57\x57\x57\x56\x57\x57\x57\x56\x51\x49\x3D" + "\x31\x2D\x2B\x2A\x29\x2F\x31\x35\x3A" + "\x3D\x3B\x39\x37\x33\x2E\x29\x2A\x2B\x37\x46\x47\x28\x25\x27\x27\x28\x26\x25\x26\x28\x26\x28" + "\x25\x26\x24\x28\x29\x25\x28\x26\x25" + "\x51\x52\x53\x53\x54\x54\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x56\x56\x57\x57" + "\x54\x4A\x3E\x35\x2E\x28\x29\x28\x29" + "\x29\x2A\x2C\x2B\x2B\x2F\x35\x3E\x4E\x56\x56\x45\x2B\x25\x27\x29\x25\x26\x27\x25\x25\x26\x26" + "\x27\x26\x22\x25\x26\x26\x27\x25\x27" + "\x51\x52\x53\x54\x54\x55\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57" + "\x57\x57\x56\x50\x48\x41\x3E\x38\x34" + "\x31\x33\x38\x3B\x41\x48\x4F\x55\x57\x57\x55\x38\x2A\x28\x28\x27\x25\x26\x26\x22\x27\x27\x27" + "\x26\x25\x25\x26\x26\x27\x27\x27\x28" + "\x52\x52\x53\x54\x54\x55\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57" + "\x57\x57\x57\x57\x56\x56\x54\x52\x51" + "\x4F\x4F\x52\x53\x55\x56\x57\x57\x57\x57\x49\x2F\x26\x26\x29\x26\x26\x26\x27\x27\x27\x25\x26" + "\x28\x26\x27\x27\x27\x27\x27\x27\x27" + "\x52\x53\x53\x54\x54\x55\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57" + "\x57\x57\x57\x57\x57\x57\x57\x56\x56" + "\x57\x56\x56\x56\x56\x56\x56\x57\x51\x43\x30\x2A\x24\x24\x25\x25\x27\x28\x25\x26\x26\x27\x28" + "\x25\x25\x27\x27\x26\x27\x27\x29\x26" + "\x52\x53\x54\x54\x55\x55\x55\x56\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57" + "\x57\x57\x57\x57\x57\x57\x57\x56\x56" + "\x57\x57\x56\x56\x56\x56\x52\x48\x38\x2C\x27\x27\x25\x25\x25\x25\x25\x27\x26\x26\x25\x26\x28" + "\x27\x27\x26\x25\x26\x28\x27\x25\x26" + "\x53\x53\x54\x54\x55\x55\x55\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57" + "\x57\x56\x56\x57\x57\x57\x57\x57\x57" + "\x58\x57\x57\x57\x52\x43\x35\x2E\x27\x28\x29\x27\x23\x25\x26\x27\x27\x27\x27\x28\x26\x25\x26" + "\x24\x25\x25\x25\x25\x26\x28\x27\x27" + "\x53\x54\x54\x55\x55\x54\x54\x55\x56\x56\x56\x57\x56\x56\x56\x57\x56\x56\x57\x57\x56\x57\x57" + "\x57\x56\x56\x56\x58\x56\x56\x56\x54" + "\x51\x4E\x46\x39\x2D\x2B\x29\x28\x27\x27\x28\x28\x26\x26\x26\x28\x2A\x28\x28\x28\x26\x26\x26" + "\x26\x26\x28\x28\x28\x25\x28\x29\x25" + "\x53\x54\x53\x54\x55\x52\x4C\x4B\x48\x48\x4B\x4F\x51\x52\x55\x56\x56\x56\x57\x57\x56\x56\x57" + "\x56\x57\x56\x54\x50\x4E\x49\x43\x3F" + "\x37\x30\x2A\x2A\x28\x27\x28\x28\x27\x25\x26\x27\x26\x27\x26\x27\x27\x25\x27\x28\x27\x26\x26" + "\x27\x26\x27\x25\x26\x26\x27\x27\x26" + "\x54\x54\x54\x54\x44\x37\x32\x31\x2D\x2D\x2E\x32\x35\x34\x34\x38\x3C\x40\x43\x45\x44\x43\x43" + "\x41\x3D\x38\x36\x33\x33\x2F\x2A\x2B" + "\x27\x29\x28\x26\x29\x27\x27\x27\x29\x27\x27\x28\x26\x25\x26\x28\x27\x25\x25\x27\x28\x26\x26" + "\x25\x26\x26\x23\x25\x28\x26\x28\x27" + "\x53\x53\x53\x3E\x2B\x25\x23\x25\x24\x27\x28\x28\x27\x27\x2A\x2A\x27\x27\x27\x29\x29\x28\x29" + "\x29\x28\x2A\x29\x28\x27\x26\x27\x29" + "\x26\x26\x26\x26\x27\x26\x26\x26\x28\x28\x29\x29\x27\x25\x25\x28\x27\x27\x29\x26\x29\x26\x27" + "\x27\x27\x27\x26\x26\x25\x25\x26\x26" + "\x53\x54\x49\x30\x26\x24\x23\x25\x25\x28\x28\x26\x25\x27\x27\x25\x26\x28\x28\x26\x27\x28\x27" + "\x26\x27\x26\x26\x27\x25\x24\x25\x27" + "\x25\x26\x27\x27\x29\x27\x26\x26\x27\x2A\x29\x27\x25\x24\x25\x28\x27\x26\x27\x28\x29\x26\x27" + "\x26\x26\x28\x28\x26\x26\x26\x26\x26" + "\x55\x54\x40\x29\x26\x24\x24\x27\x25\x26\x27\x29\x26\x24\x26\x26\x27\x29\x29\x25\x26\x28\x28" + "\x26\x28\x27\x28\x27\x25\x28\x27\x27" + "\x27\x27\x25\x25\x26\x27\x27\x26\x25\x28\x26\x24\x27\x25\x26\x27\x27\x27\x27\x28\x24\x27\x27" + "\x28\x26\x26\x29\x26\x25\x26\x26\x26" + "\x54\x52\x3A\x29\x25\x24\x26\x26\x26\x25\x26\x26\x27\x27\x27\x28\x29\x2A\x28\x29\x27\x26\x27" + "\x27\x27\x27\x28\x29\x28\x27\x27\x28" + "\x27\x28\x25\x23\x27\x26\x28\x26\x23\x25\x26\x26\x28\x26\x26\x25\x26\x27\x27\x27\x24\x24\x26" + "\x27\x27\x27\x28\x28\x27\x27\x26\x27" + "\x55\x52\x38\x29\x24\x26\x28\x26\x25\x25\x27\x27\x26\x26\x27\x26\x29\x27\x27\x27\x27\x25\x25" + "\x27\x27\x26\x27\x28\x28\x27\x28\x28" + "\x27\x27\x24\x25\x28\x27\x27\x27\x26\x27\x28\x27\x27\x25\x26\x26\x28\x27\x28\x27\x26\x25\x25" + "\x26\x25\x26\x26\x26\x27\x28\x26\x24" + "\x55\x51\x38\x28\x24\x26\x25\x25\x26\x25\x25\x27\x29\x28\x27\x24\x27\x28\x28\x26\x23\x25\x27" + "\x27\x25\x28\x27\x26\x29\x28\x27\x2A" + "\x28\x28\x26\x27\x26\x27\x27\x27\x28\x26\x26\x24\x23\x25\x25\x27\x27\x26\x27\x29\x27\x27\x27" + "\x29\x25\x28\x26\x24\x26\x28\x28\x24" + "\x56\x53\x39\x28\x28\x28\x28\x27\x28\x27\x27\x27\x2A\x2A\x29\x29\x27\x27\x27\x26\x25\x26\x27" + "\x28\x28\x26\x27\x28\x26\x27\x28\x27" + "\x26\x25\x26\x26\x24\x26\x26\x27\x25\x25\x23\x25\x27\x26\x28\x27\x27\x27\x26\x26\x29\x27\x27" + "\x27\x28\x26\x26\x25\x26\x25\x26\x26" + "\x56\x55\x3B\x27\x26\x24\x26\x27\x24\x26\x27\x28\x25\x27\x27\x27\x29\x27\x26\x26\x27\x26\x27" + "\x27\x28\x28\x28\x28\x25\x28\x27\x26" + "\x26\x25\x26\x27\x26\x25\x27\x28\x27\x25\x25\x26\x28\x26\x26\x28\x26\x26\x26\x27\x26\x26\x27" + "\x26\x27\x26\x28\x27\x27\x27\x26\x25" + "\x56\x56\x43\x2C\x25\x25\x27\x29\x27\x27\x28\x28\x26\x25\x27\x23\x23\x27\x26\x28\x27\x26\x27" + "\x27\x28\x26\x27\x28\x26\x2A\x29\x27" + "\x29\x29\x29\x27\x28\x28\x29\x27\x28\x27\x26\x26\x25\x27\x28\x28\x26\x27\x25\x25\x25\x27\x29" + "\x26\x25\x28\x28\x25\x28\x27\x27\x26" + "\x55\x56\x4B\x2E\x25\x28\x29\x28\x25\x25\x27\x28\x25\x25\x27\x27\x23\x24\x25\x26\x26\x26\x26" + "\x24\x25\x28\x28\x27\x25\x27\x27\x24" + "\x26\x29\x26\x23\x27\x28\x27\x28\x26\x26\x27\x27\x26\x26\x27\x25\x28\x27\x27\x26\x29\x28\x27" + "\x24\x29\x28\x27\x27\x26\x28\x28\x25" + "\x55\x56\x51\x32\x27\x28\x27\x27\x26\x29\x26\x26\x26\x26\x28\x27\x26\x28\x28\x29\x25\x27\x29" + "\x26\x26\x27\x29\x27\x26\x28\x27\x25" + "\x25\x25\x26\x27\x25\x27\x28\x26\x26\x26\x28\x2A\x29\x25\x24\x24\x26\x28\x28\x28\x26\x26\x26" + "\x25\x26\x24\x26\x27\x26\x27\x28\x27" + "\x56\x56\x55\x39\x29\x29\x28\x29\x28\x26\x26\x27\x26\x26\x25\x27\x25\x25\x26\x25\x26\x27\x28" + "\x26\x27\x26\x28\x27\x26\x27\x27\x26" + "\x26\x27\x27\x27\x27\x28\x28\x26\x29\x28\x26\x29\x29\x28\x27\x28\x27\x29\x27\x26\x25\x26\x25" + "\x26\x24\x25\x26\x27\x26\x25\x26\x28" + "\x57\x57\x57\x4A\x29\x27\x27\x27\x27\x28\x29\x29\x27\x29\x25\x25\x25\x25\x27\x29\x26\x26\x27" + "\x26\x28\x28\x27\x25\x29\x29\x27\x27" + "\x25\x26\x26\x24\x27\x27\x26\x26\x26\x28\x27\x27\x27\x26\x27\x27\x27\x28\x27\x26\x27\x26\x26" + "\x2A\x28\x26\x26\x25\x28\x26\x27\x26" + "\x57\x57\x57\x55\x32\x28\x25\x24\x28\x28\x27\x27\x27\x27\x27\x26\x26\x27\x28\x26\x25\x27\x29" + "\x27\x27\x28\x28\x24\x29\x27\x26\x26" + "\x25\x28\x26\x25\x29\x26\x26\x26\x26\x29\x28\x25\x25\x25\x27\x28\x26\x26\x26\x28\x28\x25\x27" + "\x28\x28\x28\x28\x24\x26\x26\x25\x25" + "\x57\x57\x56\x56\x43\x2B\x29\x28\x2A\x29\x29\x2A\x28\x27\x28\x27\x27\x27\x27\x29\x26\x2A\x28" + "\x24\x26\x28\x28\x25\x24\x26\x26\x26" + "\x26\x28\x28\x27\x28\x27\x25\x25\x26\x27\x27\x23\x24\x25\x25\x26\x28\x27\x27\x27\x26\x26\x28" + "\x25\x27\x27\x28\x26\x27\x27\x26\x25" + "\x56\x57\x56\x56\x54\x49\x47\x44\x42\x40\x3F\x3D\x37\x39\x38\x36\x37\x32\x30\x2F\x2A\x2C\x2B" + "\x29\x2B\x28\x28\x26\x26\x26\x27\x28" + "\x27\x25\x26\x26\x24\x25\x25\x26\x29\x27\x28\x27\x28\x26\x27\x26\x26\x28\x27\x27\x27\x26\x27" + "\x25\x28\x26\x29\x27\x27\x26\x27\x28" + "\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x55\x54\x53\x4F\x4C\x48\x44\x41\x3D" + "\x3B\x36\x30\x2C\x2B\x2B\x2A\x2A\x2A" + "\x28\x27\x26\x27\x28\x26\x26\x27\x28\x28\x28\x26\x25\x25\x27\x27\x27\x25\x26\x26\x28\x27\x28" + "\x28\x28\x28\x27\x27\x27\x28\x29\x27" + "\x56\x56\x57\x57\x56\x57\x57\x57\x57\x57\x57\x57\x56\x57\x57\x57\x57\x57\x56\x57\x56\x56\x54" + "\x53\x51\x50\x4D\x49\x43\x3D\x34\x2E" + "\x2D\x2A\x26\x25\x28\x27\x28\x26\x28\x29\x27\x25\x26\x27\x27\x27\x24\x26\x28\x26\x27\x26\x25" + "\x29\x28\x29\x27\x26\x27\x27\x26\x26" + "\x56\x56\x57\x57\x56\x57\x57\x57\x57\x57\x57\x57\x56\x57\x57\x57\x57\x57\x56\x56\x57\x57\x57" + "\x57\x57\x57\x56\x57\x58\x56\x57\x56" + "\x4B\x42\x3A\x36\x2F\x2C\x29\x28\x27\x27\x24\x23\x26\x27\x26\x28\x27\x27\x26\x25\x25\x24\x25" + "\x27\x27\x27\x28\x28\x29\x25\x22\x26" + "\x57\x57\x57\x57\x56\x57\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x56\x57\x57\x57" + "\x57\x57\x57\x56\x57\x57\x57\x57\x57" + "\x56\x57\x56\x52\x4C\x46\x41\x3C\x34\x2C\x28\x27\x27\x28\x26\x27\x28\x26\x27\x26\x25\x25\x26" + "\x27\x28\x26\x25\x26\x25\x27\x28\x26" + "\x57\x57\x57\x57\x57\x57\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x56\x57\x57\x57\x57\x57\x57" + "\x57\x56\x57\x57\x57\x57\x57\x57\x57" + "\x56\x57\x57\x56\x56\x57\x55\x53\x50\x4B\x41\x35\x2B\x29\x28\x26\x26\x27\x26\x26\x27\x28\x29" + "\x29\x2B\x28\x27\x28\x29\x28\x28\x28" + "\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x56\x57\x57\x57\x57\x56\x56\x56\x57\x57\x57\x57" + "\x57\x56\x57\x57\x56\x57\x57\x57\x57" + "\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x57\x52\x46\x38\x31\x2C\x2A\x27\x26\x25\x27\x27" + "\x26\x25\x24\x27\x28\x23\x26\x28\x27" + "\x56\x55\x55\x56\x58\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x56\x56\x57\x57\x57\x57" + "\x57\x57\x57\x57\x57\x57\x57\x57\x57" + "\x57\x57\x57\x57\x57\x57\x57\x57\x56\x57\x57\x57\x57\x57\x55\x4F\x46\x3F\x34\x2B\x29\x2B\x28" + "\x26\x25\x28\x28\x27\x24\x26\x28\x25" + "\x39\x38\x37\x37\x39\x3B\x3F\x40\x44\x47\x49\x4A\x4C\x50\x53\x56\x57\x57\x57\x58\x57\x57\x57" + "\x57\x57\x57\x57\x57\x57\x57\x57\x57" + "\x57\x57\x57\x57\x56\x56\x56\x56\x56\x56\x56\x58\x56\x57\x57\x57\x56\x54\x50\x4B\x3F\x31\x29" + "\x27\x26\x26\x26\x27\x23\x29\x27\x27" + "\x2A\x29\x26\x2A\x28\x27\x26\x28\x27\x2A\x29\x29\x2D\x2D\x2C\x2F\x35\x3C\x41\x47\x4B\x4E\x50" + "\x52\x54\x56\x57\x57\x57\x57\x57\x57" + "\x56\x57\x57\x57\x56\x56\x56\x56\x56\x56\x56\x56\x56\x56\x56\x56\x56\x57\x57\x56\x56\x54\x4A" + "\x3D\x32\x2E\x27\x24\x28\x26\x26\x25" + "\x26\x25\x24\x24\x27\x26\x26\x25\x26\x24\x28\x2A\x26\x26\x26\x2A\x27\x29\x29\x2B\x2B\x31\x34" + "\x38\x3C\x43\x4A\x4E\x54\x56\x57\x57" + "\x57\x57\x57\x57\x57\x57\x56\x56\x57\x56\x56\x56\x56\x56\x56\x56\x57\x56\x56\x56\x57\x57\x57" + "\x56\x4C\x41\x35\x2D\x2B\x28\x27\x27" + "\x27\x26\x28\x28\x25\x25\x25\x26\x26\x25\x29\x2A\x28\x28\x27\x26\x26\x27\x25\x26\x27\x29\x28" + "\x29\x2A\x2A\x2F\x34\x38\x3C\x46\x4D" + "\x53\x57\x56\x56\x57\x57\x57\x57\x57\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57" + "\x57\x56\x55\x51\x48\x38\x2C\x28\x27" + "\x27\x25\x25\x27\x26\x26\x28\x26\x27\x26\x25\x25\x26\x27\x27\x25\x26\x25\x25\x26\x27\x27\x27" + "\x27\x29\x27\x28\x2B\x29\x28\x29\x2B" + "\x2D\x34\x3F\x4A\x51\x55\x56\x57\x57\x57\x57\x57\x56\x56\x57\x57\x56\x57\x57\x56\x57\x57\x57" + "\x57\x56\x56\x56\x56\x56\x4E\x3F\x33" + "\x25\x26\x27\x28\x27\x27\x27\x25\x27\x27\x25\x27\x25\x27\x27\x27\x27\x29\x28\x28\x25\x28\x28" + "\x26\x27\x26\x28\x27\x26\x28\x27\x27" + "\x28\x28\x2A\x2C\x35\x3E\x46\x4E\x55\x57\x57\x57\x57\x57\x57\x57\x56\x57\x57\x57\x57\x57\x57" + "\x57\x57\x57\x56\x57\x57\x57\x56\x51"; BYTE TEST_64X64_BLUE_PLANE_RLE[3724] = - "\x53\x27\x23\x23\x24\x25\xF0\x28\x37\x4A\x47\x41\x3D\x38\x33\x2E\x2A\x28\x27\x26\x27\x27\xF0\x27\x25\x24\x26\x28\x26\x27\x28\x28" - "\x26\x28\x28\x2A\x26\x27\xF0\x27\x28\x27\x27\x25\x26\x24\x25\x27\x28\x27\x28\x27\x27\x25\xB0\x26\x27\x27\x26\x27\x27\x27\x26\x25" - "\x26\x23\xF0\x16\x0C\x0C\x06\x02\x06\x04\x04\x02\x0A\x16\x1E\x2A\x2E\x34\xF0\x3A\x3E\x3C\x30\x20\x12\x0A\x08\x06\x04\x06\x02\x01" - "\x00\x01\xF0\x05\x03\x02\x00\x00\x03\x02\x00\x00\x00\x03\x01\x00\x02\x04\xF0\x02\x04\x00\x01\x01\x03\x00\x00\x00\x03\x00\x01\x00" - "\x02\x00\x40\x00\x04\x02\x08\xF0\x38\x48\x38\x2C\x1E\x10\x0C\x04\x04\x04\x02\x00\x02\x06\x0A\xF0\x0E\x12\x1C\x2C\x3E\x4E\x4C\x3C" - "\x28\x1E\x14\x0C\x04\x02\x02\xF0\x04\x04\x00\x01\x07\x05\x02\x04\x00\x00\x02\x02\x08\x06\x02\xF0\x01\x09\x03\x04\x00\x04\x03\x08" - "\x02\x02\x03\x02\x07\x03\x00\x40\x01\x00\x04\x01\xC4\x02\x06\x16\x28\x3A\x34\x2E\x2A\x16\x06\x01\x00\x13\x02\xF0\x00\x0A\x1C\x32" - "\x3A\x38\x34\x2E\x24\x14\x0C\x01\x03\x00\x04\xF0\x00\x00\x05\x03\x03\x01\x02\x00\x01\x03\x00\x04\x00\x04\x04\xE0\x02\x02\x00\x04" - "\x02\x04\x00\x04\x01\x05\x06\x00\x03\x01\x04\x96\x02\x14\x22\x2A\x34\x20\x02\x02\x00\xF0\x01\x02\x00\x00\x00\x0A\x14\x20\x2A\x32" - "\x3A\x34\x22\x10\x0A\xF0\x00\x04\x00\x02\x02\x04\x04\x03\x09\x05\x01\x01\x03\x02\x05\xF0\x07\x03\x04\x03\x03\x03\x01\x00\x04\x02" - "\x06\x01\x02\x00\x01\xDB\x00\x00\x02\x02\x01\x00\x00\x02\x0A\x08\x00\x01\x00\xF0\x03\x01\x00\x04\x0A\x12\x20\x3C\x4A\x32\x24\x10" - "\x02\x00\x04\xF0\x05\x07\x01\x08\x00\x06\x06\x02\x00\x00\x02\x01\x00\x03\x01\xA0\x00\x02\x02\x01\x08\x0A\x00\x01\x02\x0A\x04\x78" - "\x02\x01\x01\x02\x00\x02\x00\x57\x02\x01\x01\x01\x00\xF0\x02\x0A\x22\x34\x34\x22\x0E\x02\x06\x08\x02\x03\x01\x03\x01\xF3\x04\x00" - "\x00\x02\x04\x01\x00\x00\x04\x03\x03\x04\x03\x07\x03\x04\x23\x01\x00\x28\x01\x00\xF0\x02\x00\x00\x00\x01\x02\x00\x01\x09\x15\x23" - "\x29\x1F\x0B\x00\xF0\x0A\x1C\x32\x2E\x0E\x00\x00\x02\x02\x06\x04\x06\x02\x01\x03\xF0\x01\x02\x01\x00\x01\x04\x02\x04\x02\x01\x03" - "\x02\x02\x01\x01\x05\x3B\x02\x02\x00\xF0\x01\x02\x02\x00\x00\x01\x0B\x27\x43\x43\x33\x29\x33\x45\x41\xE3\x1D\x05\x08\x24\x38\x18" - "\x00\x00\x04\x04\x02\x05\x02\x00\xD0\x01\x04\x00\x07\x01\x00\x07\x00\x01\x00\x01\x00\x00\x04\x7D\x02\x00\x00\x00\x02\x02\x00\xF0" - "\x13\x31\x29\x03\x14\x20\x20\x1A\x0A\x0B\x31\x2B\x05\x01\x14\xF0\x28\x0A\x04\x03\x09\x01\x00\x00\x01\x04\x00\x00\x06\x02\x02\xA0" - "\x01\x00\x03\x01\x04\x06\x01\x00\x00\x03\x71\xF0\x05\x2D\x13\x0A\x30\x3A\x32\x30\x32\x36\x20\x03\x21\x21\x00\xF0\x00\x1C\x1A\x02" - "\x02\x04\x06\x04\x00\x02\x00\x04\x00\x02\x03\xB0\x00\x06\x06\x04\x04\x07\x00\x02\x02\x04\x02\x41\xF0\x01\x00\x01\x2F\x0D\x12\x38" - "\x22\x0C\x04\x00\x02\x10\x2E\x2C\xF0\x02\x23\x17\x00\x02\x2A\x0A\x00\x03\x05\x01\x01\x02\x01\x01\xE0\x01\x05\x00\x00\x01\x03\x02" - "\x01\x02\x03\x02\x02\x01\x04\x61\xF0\x0D\x11\x02\x1E\x10\x00\x01\x0F\x25\x2D\x23\x0B\x20\x10\x07\xF0\x17\x03\x00\x0C\x1C\x04\x04" - "\x00\x01\x01\x00\x02\x00\x00\x00\x93\x02\x02\x02\x05\x05\x04\x02\x06\x01\x41\xF0\x02\x00\x09\x07\x08\x14\x02\x00\x05\x21\x25\x21" - "\x29\x1D\x04\xF0\x1A\x02\x09\x03\x01\x04\x16\x08\x02\x02\x04\x01\x02\x02\x06\xE0\x00\x01\x04\x04\x01\x04\x04\x02\x00\x03\x02\x00" - "\x02\x01\x11\x13\x01\xF0\x00\x0F\x05\x00\x0A\x01\x01\x04\x12\x0A\x0C\x12\x10\x02\x12\xF0\x02\x05\x07\x00\x02\x14\x16\x04\x03\x03" - "\x02\x00\x00\x03\x01\xD0\x04\x01\x01\x04\x00\x03\x05\x05\x01\x03\x05\x00\x04\x31\xF0\x02\x00\x00\x06\x04\x00\x03\x02\x00\x02\x1E" - "\x38\x36\x34\x1A\xF0\x02\x03\x01\x00\x02\x02\x00\x08\x12\x02\x04\x02\x02\x00\x07\xF0\x05\x02\x02\x03\x01\x01\x06\x04\x02\x02\x00" - "\x02\x04\x02\x02\x11\xF0\x02\x02\x00\x00\x01\x0A\x08\x07\x0D\x00\x02\x04\x04\x0C\x12\xF0\x0A\x02\x00\x13\x00\x04\x06\x00\x00\x02" - "\x16\x08\x00\x00\x00\xF0\x02\x04\x04\x00\x01\x00\x00\x02\x00\x00\x00\x06\x06\x00\x01\x20\x00\x07\x0C\x37\x01\x07\x00\xF0\x10\x0C" - "\x03\x23\x09\x01\x01\x00\x02\x02\x00\x00\x15\x1D\x02\xF0\x12\x08\x00\x01\x01\x12\x14\x01\x01\x01\x09\x03\x01\x00\x00\xC0\x02\x01" - "\x03\x05\x03\x00\x00\x01\x02\x06\x01\x06\x06\xF0\x01\x00\x01\x00\x00\x00\x01\x13\x27\x0D\x00\x00\x01\x01\x00\x83\x00\x0A\x22\x01" - "\x11\x25\x09\x00\xF0\x01\x15\x29\x09\x0E\x1E\x02\x00\x02\x02\x02\x16\x04\x02\x00\xF0\x02\x01\x00\x00\x00\x01\x00\x02\x02\x04\x00" - "\x03\x05\x02\x00\x20\x02\x01\x0C\xF0\x02\x06\x1B\x35\x21\x03\x00\x00\x02\x02\x02\x1A\x1E\x07\x21\xC4\x31\x21\x11\x0D\x15\x29\x33" - "\x15\x01\x2A\x0E\x00\xF0\x16\x08\x04\x00\x02\x06\x02\x04\x00\x04\x00\x03\x01\x03\x01\x60\x01\x01\x05\x01\x00\x00\x0C\xF0\x02\x12" - "\x16\x11\x35\x3F\x1B\x07\x01\x00\x00\x04\x32\x30\x06\xB5\x1D\x33\x43\x45\x3F\x29\x07\x18\x40\x18\x00\xF0\x10\x0C\x01\x02\x02\x05" - "\x01\x03\x05\x01\x02\x02\x02\x00\x04\x60\x04\x08\x02\x00\x01\x02\x58\x00\x02\x02\x02\x00\xF0\x04\x14\x08\x01\x15\x33\x33\x1B\x07" - "\x00\x00\x06\x22\x32\x2C\xF0\x16\x0A\x08\x12\x1C\x2C\x30\x16\x00\x01\x01\x00\x01\x00\x01\xF0\x0F\x07\x00\x01\x00\x04\x04\x00\x06" - "\x04\x02\x02\x02\x06\x01\x60\x03\x01\x00\x04\x02\x01\x24\x02\x00\x26\x02\x00\xF0\x14\x22\x06\x02\x09\x21\x31\x35\x1D\x03\x00\x04" - "\x18\x2C\x36\x84\x3C\x3A\x3C\x32\x22\x0E\x02\x00\xF0\x09\x2B\x39\x0B\x02\x04\x00\x00\x03\x01\x01\x05\x00\x00\x04\x80\x01\x04\x00" - "\x01\x00\x01\x01\x02\x04\x28\x02\x00\xF0\x04\x2A\x4A\x2E\x1A\x10\x07\x19\x37\x47\x2B\x15\x07\x00\x0A\xF0\x10\x12\x08\x06\x02\x01" - "\x00\x01\x00\x03\x0B\x2D\x45\x2B\x17\xF0\x03\x05\x05\x01\x04\x02\x04\x04\x00\x03\x02\x05\x01\x01\x02\x50\x04\x02\x00\x02\x02\x0E" - "\xF0\x02\x00\x0A\x28\x34\x2E\x1A\x04\x05\x0F\x2D\x37\x33\x29\x1B\xF0\x11\x09\x01\x02\x02\x00\x01\x0D\x1B\x29\x37\x29\x07\x02\x0E" - "\x33\x02\x01\x00\xE0\x01\x01\x00\x03\x00\x01\x01\x05\x02\x02\x01\x02\x02\x03\x3E\x02\x02\x00\xF0\x02\x0E\x20\x32\x38\x28\x10\x06" - "\x09\x1B\x2D\x33\x39\x39\x37\xF0\x33\x37\x39\x3D\x37\x33\x2B\x15\x02\x18\x36\x34\x00\x00\x02\xF0\x02\x02\x01\x03\x01\x04\x04\x00" - "\x00\x02\x00\x02\x00\x01\x00\x20\x03\x01\x44\x00\x00\x02\x00\x25\x02\x00\x23\x02\x00\xF0\x0A\x1C\x34\x46\x3A\x26\x16\x0A\x0D\x0F" - "\x19\x21\x27\x21\x19\xF0\x17\x0F\x02\x18\x28\x46\x3E\x20\x03\x06\x00\x00\x04\x05\x00\xE0\x04\x01\x05\x00\x03\x04\x00\x03\x05\x05" - "\x02\x01\x01\x04\x03\x4C\x02\x00\x02\x00\xF0\x02\x02\x00\x00\x06\x1A\x30\x36\x34\x32\x2A\x20\x16\x10\x12\xF0\x18\x20\x2C\x32\x34" - "\x2E\x12\x02\x01\x19\x01\x06\x02\x03\x00\xF0\x00\x01\x05\x04\x02\x02\x01\x01\x06\x02\x00\x02\x00\x04\x02\x2F\x02\x00\x08\xF0\x02" - "\x0E\x1C\x2A\x2C\x34\x3A\x3C\x38\x34\x30\x28\x1C\x10\x04\xF0\x00\x00\x17\x11\x07\x03\x02\x01\x02\x00\x02\x0A\x00\x03\x01\x90\x04" - "\x02\x04\x02\x02\x00\x00\x00\x01\x3F\x00\x02\x00\x09\xF0\x02\x02\x06\x08\x0A\x10\x0E\x08\x06\x02\x00\x01\x00\x0B\x27\xF0\x31\x09" - "\x03\x03\x07\x01\x02\x04\x03\x01\x01\x04\x04\x05\x01\x70\x00\x00\x01\x00\x00\x04\x01\x9F\x00\x00\x02\x00\x02\x00\x00\x02\x00\x09" - "\x23\x02\x00\xF0\x07\x1D\x31\x2D\x11\x05\x02\x02\x00\x00\x03\x01\x02\x00\x01\xB0\x01\x00\x04\x04\x01\x03\x00\x02\x00\x07\x00\x29" - "\x02\x00\x2B\x02\x00\x33\x01\x01\x00\xF0\x02\x02\x02\x00\x02\x02\x07\x25\x39\x33\x21\x07\x04\x00\x03\xF0\x00\x02\x04\x04\x00\x02" - "\x04\x02\x01\x03\x05\x03\x01\x00\x01\x40\x03\x02\x04\x02\x93\x00\x02\x00\x02\x00\x01\x01\x01\x00\xA4\x01\x01\x01\x00\x01\x01\x00" - "\x00\x01\x00\xF0\x01\x02\x01\x01\x01\x05\x0D\x11\x21\x3B\x49\x2F\x17\x0B\x00\xF0\x01\x01\x02\x06\x02\x00\x02\x06\x02\x02\x00\x00" - "\x02\x00\x04\x80\x02\x06\x06\x06\x01\x00\x04\x03\xF0\x00\x00\x01\x01\x00\x03\x0F\x13\x1B\x1B\x15\x0F\x09\x07\x01\x24\x01\x00\xF0" - "\x01\x00\x01\x02\x00\x03\x0F\x0F\x19\x25\x29\x33\x3B\x37\x1D\xF0\x09\x07\x01\x00\x00\x03\x03\x01\x00\x02\x00\x01\x05\x05\x01\xD0" - "\x00\x02\x00\x00\x02\x00\x01\x05\x03\x02\x01\x03\x02\xF0\x02\x00\x02\x00\x21\x35\x33\x33\x35\x35\x39\x39\x37\x3B\x41\xF0\x3B\x33" - "\x2B\x27\x23\x23\x25\x27\x29\x33\x3B\x3B\x39\x35\x33\xF0\x31\x27\x1F\x0D\x03\x07\x02\x00\x01\x01\x04\x04\x02\x02\x00\xF0\x03\x00" - "\x02\x00\x00\x03\x01\x02\x00\x00\x03\x00\x01\x03\x01\x40\x04\x01\x02\x02\xF0\x01\x01\x01\x2B\x31\x23\x1D\x17\x11\x0B\x0B\x13\x1B" - "\x19\x13\xF0\x1B\x29\x31\x37\x37\x35\x35\x33\x2F\x29\x1B\x19\x15\x17\x11\x83\x05\x03\x01\x05\x03\x00\x03\x01\xF0\x02\x04\x02\x02" - "\x00\x01\x00\x00\x04\x08\x01\x02\x00\x02\x04\x80\x02\x02\x06\x02\x05\x01\x03\x01\xF0\x00\x02\x13\x1B\x09\x01\x00\x00\x02\x02\x00" - "\x03\x03\x00\x05\xE3\x09\x01\x02\x02\x05\x03\x00\x03\x05\x01\x07\x05\x01\x03\xF0\x01\x00\x02\x02\x04\x02\x00\x00\x01\x04\x00\x03" - "\x03\x01\x00\xF0\x00\x00\x01\x03\x04\x00\x00\x00\x01\x01\x02\x04\x00\x02\x02\x20\x00\x00\xF0\x04\x00\x11\x0D\x00\x00\x02\x04\x00" - "\x03\x01\x06\x02\x05\x01\x13\x02\xF0\x01\x01\x00\x02\x00\x02\x02\x04\x00\x00\x08\x04\x00\x04\x02\xF0\x03\x03\x05\x00\x02\x00\x03" - "\x03\x05\x05\x04\x02\x02\x01\x00\xF0\x02\x00\x00\x09\x02\x00\x04\x00\x03\x02\x00\x01\x00\x00\x00\xF0\x01\x03\x0B\x00\x01\x00\x04" - "\x01\x02\x01\x01\x05\x02\x06\x02\xF0\x04\x04\x02\x01\x08\x02\x03\x01\x02\x01\x00\x00\x04\x06\x01\xF0\x00\x02\x00\x02\x00\x03\x02" - "\x01\x02\x00\x03\x05\x00\x04\x02\xF0\x02\x00\x03\x01\x00\x00\x01\x00\x05\x01\x01\x02\x02\x01\x04\x40\x04\x02\x00\x02\xF0\x02\x00" - "\x03\x00\x01\x04\x04\x00\x01\x00\x02\x02\x01\x01\x00\xF0\x03\x00\x05\x01\x03\x00\x01\x03\x00\x00\x01\x01\x01\x00\x00\xF0\x02\x00" - "\x00\x01\x01\x04\x02\x02\x01\x02\x06\x04\x04\x02\x01\xF0\x01\x00\x02\x04\x00\x02\x00\x04\x02\x01\x01\x03\x01\x03\x03\x40\x00\x02" - "\x00\x05\xF0\x00\x01\x00\x01\x00\x00\x05\x01\x02\x00\x03\x00\x06\x04\x00\xF0\x03\x03\x02\x02\x01\x07\x00\x04\x00\x03\x04\x00\x03" - "\x02\x02\xF0\x01\x04\x02\x02\x04\x04\x03\x00\x00\x00\x04\x01\x03\x05\x07\xF0\x00\x01\x02\x01\x01\x01\x04\x02\x04\x04\x06\x00\x04" - "\x00\x03\x40\x01\x00\x04\x00\x83\x02\x04\x02\x00\x08\x04\x06\x04\xF0\x00\x02\x04\x04\x0A\x00\x01\x01\x00\x04\x02\x00\x02\x06\x03" - "\xF0\x00\x04\x05\x01\x02\x05\x03\x05\x00\x01\x03\x01\x01\x00\x05\xF0\x01\x05\x02\x08\x02\x06\x00\x00\x02\x01\x05\x04\x00\x00\x03" - "\x80\x06\x03\x00\x02\x00\x05\x03\x04\xF0\x00\x04\x04\x01\x03\x07\x03\x00\x07\x01\x00\x02\x09\x05\x03\xF0\x03\x04\x00\x01\x00\x04" - "\x00\x00\x01\x00\x04\x02\x00\x01\x02\xF0\x01\x01\x00\x00\x00\x02\x04\x01\x02\x02\x04\x00\x04\x02\x02\xF0\x00\x03\x02\x01\x01\x00" - "\x02\x05\x01\x00\x01\x01\x00\x04\x04\x40\x02\x04\x00\x01\xF0\x00\x02\x10\x0A\x01\x02\x02\x04\x06\x02\x02\x00\x02\x03\x00\x64\x07" - "\x0B\x00\x00\x04\x00\xF0\x03\x01\x00\x02\x04\x04\x02\x06\x08\x06\x00\x04\x06\x04\x01\xF0\x02\x04\x02\x00\x05\x02\x04\x00\x00\x02" - "\x01\x03\x01\x02\x04\x90\x00\x03\x04\x00\x03\x02\x00\x02\x02\xF0\x01\x00\x10\x04\x00\x06\x04\x01\x03\x03\x01\x00\x01\x00\x00\xF0" - "\x08\x00\x05\x01\x03\x01\x00\x01\x05\x05\x04\x02\x01\x01\x05\xF0\x03\x05\x05\x00\x05\x07\x01\x00\x03\x02\x03\x01\x02\x02\x02\xF0" - "\x01\x01\x05\x04\x00\x04\x02\x08\x02\x03\x03\x08\x00\x01\x04\x40\x03\x02\x02\x01\xF0\x00\x00\x0C\x08\x04\x00\x03\x01\x02\x08\x01" - "\x03\x02\x02\x02\xF0\x00\x06\x08\x06\x06\x01\x02\x06\x04\x02\x01\x02\x00\x02\x02\xF0\x00\x02\x01\x07\x00\x08\x03\x01\x02\x03\x00" - "\x00\x02\x06\x06\xF0\x01\x05\x01\x03\x02\x02\x04\x05\x03\x01\x02\x05\x07\x01\x00\x40\x00\x01\x00\x04\xF0\x02\x00\x08\x0E\x04\x02" - "\x02\x04\x04\x05\x00\x02\x00\x00\x05\xF0\x00\x01\x05\x03\x07\x02\x00\x01\x00\x02\x01\x01\x00\x00\x01\xF0\x00\x02\x02\x04\x02\x00" - "\x04\x02\x00\x00\x06\x04\x03\x01\x00\xF0\x06\x06\x08\x02\x02\x01\x03\x01\x00\x01\x02\x03\x02\x00\x00\x40\x00\x03\x03\x02\xF0\x02" - "\x02\x04\x22\x00\x03\x01\x03\x01\x04\x06\x04\x02\x06\x00\xF0\x03\x00\x00\x02\x08\x00\x01\x01\x00\x02\x04\x01\x03\x06\x04\xF0\x00" - "\x02\x01\x01\x01\x05\x00\x01\x03\x00\x05\x00\x02\x03\x03\xF0\x03\x00\x01\x00\x01\x00\x00\x04\x00\x02\x08\x08\x02\x00\x03\x40\x04" - "\x02\x02\x03\x03\xF0\x16\x12\x02\x03\x05\x02\x00\x03\x03\x00\x03\x04\x02\x02\x04\xF0\x02\x05\x01\x02\x04\x02\x01\x00\x02\x01\x00" - "\x03\x01\x01\x00\xF0\x04\x00\x02\x04\x01\x00\x00\x00\x02\x02\x03\x03\x01\x00\x02\xF0\x01\x03\x01\x04\x02\x01\x02\x03\x00\x04\x04" - "\x01\x03\x00\x03\x10\x01\xF0\x00\x00\x01\x02\x22\x06\x08\x08\x04\x02\x04\x06\x02\x00\x02\xF0\x02\x02\x00\x01\x06\x02\x06\x01\x05" - "\x01\x00\x00\x02\x09\x01\xF0\x00\x00\x02\x00\x04\x04\x01\x02\x01\x01\x00\x03\x01\x03\x01\xF0\x00\x03\x03\x04\x02\x02\x01\x03\x02" - "\x02\x05\x01\x01\x00\x04\x40\x02\x02\x02\x00\xF0\x01\x00\x00\x00\x22\x3C\x3C\x38\x30\x2E\x2C\x26\x1E\x24\x20\xF0\x1E\x20\x16\x12" - "\x0C\x08\x04\x06\x0A\x0A\x00\x00\x02\x04\x00\xF0\x02\x04\x02\x05\x03\x01\x07\x03\x00\x02\x06\x00\x02\x08\x08\xF0\x02\x04\x00\x03" - "\x02\x00\x00\x02\x00\x01\x00\x02\x01\x02\x02\x40\x00\x01\x02\x06\xF0\x02\x00\x02\x02\x06\x1C\x20\x26\x2A\x2E\x30\x34\x40\x3A\x3A" - "\xF0\x3C\x38\x3A\x38\x32\x34\x2A\x24\x24\x16\x10\x08\x0A\x0A\x08\xF0\x06\x04\x02\x04\x00\x02\x08\x02\x02\x02\x01\x02\x00\x01\x05" - "\xF0\x01\x00\x02\x02\x05\x01\x01\x02\x02\x02\x06\x00\x04\x03\x00\x40\x00\x04\x04\x01\x66\x01\x01\x00\x00\x01\x00\xF0\x01\x02\x04" - "\x06\x08\x10\x14\x1E\x24\x2A\x2E\x30\x36\x40\x42\xF0\x3C\x30\x26\x14\x08\x0A\x06\x00\x03\x00\x02\x04\x01\x00\x02\xF0\x01\x01\x02" - "\x04\x00\x00\x05\x02\x04\x00\x01\x01\x05\x02\x00\x70\x02\x00\x01\x00\x01\x05\x01\x31\xF0\x01\x02\x02\x06\x08\x0C\x0E\x12\x1C\x2A" - "\x32\x46\x50\x3C\x30\xF0\x28\x22\x0E\x0A\x02\x04\x01\x03\x05\x03\x00\x00\x01\x02\x06\xF0\x02\x03\x01\x03\x03\x00\x03\x01\x03\x02" - "\x04\x04\x03\x07\x00\x33\x02\x02\x00\x33\x01\x01\x00\x2E\x02\x00\xF0\x01\x02\x00\x02\x16\x2A\x38\x38\x3A\x34\x30\x28\x1A\x0A\x08" - "\xF0\x08\x02\x02\x00\x01\x02\x01\x02\x02\x00\x02\x02\x00\x02\x01\x60\x05\x03\x07\x04\x0C\x00\x04\x2A\x02\x00\x53\x01\x00\x02\x02" - "\x00\x46\x01\x00\x02\x00\xF0\x02\x08\x14\x22\x28\x2E\x38\x3E\x32\x1C\x08\x02\x04\x01\x03\xF0\x02\x01\x00\x04\x06\x06\x04\x06\x04" - "\x04\x04\x08\x02\x00\x04\x06\x74\x02\x02\x00\x00\x01\x01\x00\x37\x01\x01\x00\x23\x01\x00\xF0\x02\x00\x00\x02\x02\x00\x04\x08\x0E" - "\x18\x2A\x44\x4E\x3A\x20\xF0\x16\x0C\x06\x02\x00\x03\x01\x03\x05\x0B\x07\x00\x00\x0B\x03\x20\x00\x01\x64\x01\x03\x03\x01\x02\x00" - "\x3B\x02\x02\x00\x5B\x02\x00\x00\x02\x00\xF0\x01\x00\x02\x00\x0A\x22\x3A\x3C\x34\x2A\x1A\x0A\x08\x08\x02\x90\x00\x00\x08\x02\x01" - "\x02\x00\x00\x03\xF0\x39\x39\x3B\x3D\x3D\x37\x2F\x2D\x25\x1F\x1B\x19\x15\x0D\x07\x23\x01\x02\x1F\x00\x13\x01\xF0\x00\x01\x01\x02" - "\x01\x00\x04\x10\x20\x2A\x38\x40\x2C\x0C\x02\x90\x02\x02\x03\x03\x00\x01\x06\x01\x04\xF0\x1D\x1D\x21\x19\x21\x27\x31\x2F\x39\x39" - "\x3F\x41\x3D\x45\x4D\xC5\x4D\x43\x35\x2B\x21\x17\x11\x0D\x09\x05\x01\x00\x29\x01\x00\xF0\x03\x00\x01\x01\x01\x00\x06\x0E\x16\x2E" - "\x46\x42\x2C\x18\x10\x60\x02\x05\x0A\x05\x01\x03\xF0\x07\x07\x03\x0B\x01\x01\x00\x05\x01\x0B\x01\x02\x0D\x0D\x0B\xF0\x09\x1B\x25" - "\x2F\x37\x3F\x39\x37\x33\x2F\x25\x19\x11\x05\x01\xC6\x00\x00\x02\x00\x00\x00\x02\x02\x00\x00\x02\x00\xF0\x02\x01\x01\x00\x02\x06" - "\x1A\x32\x34\x26\x1C\x12\x06\x04\x02\x10\x04\xF0\x02\x02\x08\x08\x03\x01\x01\x02\x00\x02\x02\x00\x04\x04\x02\xF0\x07\x01\x03\x07" - "\x09\x07\x0F\x17\x1D\x23\x31\x35\x33\x37\x33\xE4\x21\x13\x07\x00\x01\x01\x00\x00\x02\x02\x00\x00\x00\x02\xF0\x00\x02\x02\x02\x00" - "\x00\x00\x02\x14\x28\x38\x36\x1A\x08\x02\x10\x00\xF0\x00\x01\x05\x01\x02\x02\x06\x00\x02\x02\x07\x09\x03\x01\x00\xF0\x01\x00\x03" - "\x00\x00\x00\x03\x01\x03\x01\x05\x0D\x11\x1D\x27\xF0\x39\x43\x4B\x45\x2D\x17\x0B\x03\x01\x00\x00\x02\x02\x00\x01\x84\x01\x00\x00" - "\x01\x00\x00\x01\x00\x70\x02\x0A\x1C\x3C\x44\x2E\x18\xF0\x03\x02\x04\x02\x02\x02\x01\x01\x00\x02\x00\x04\x01\x00\x00\xF0\x04\x02" - "\x08\x06\x04\x03\x02\x02\x01\x03\x01\x00\x07\x05\x00\xF0\x03\x07\x09\x17\x29\x3B\x37\x2D\x1F\x11\x03\x00\x00\x00\x02\x24\x02\x00" + "\x53\x27\x23\x23\x24\x25\xF0\x28\x37\x4A\x47\x41\x3D\x38\x33\x2E\x2A\x28\x27\x26\x27\x27\xF0" + "\x27\x25\x24\x26\x28\x26\x27\x28\x28" + "\x26\x28\x28\x2A\x26\x27\xF0\x27\x28\x27\x27\x25\x26\x24\x25\x27\x28\x27\x28\x27\x27\x25\xB0" + "\x26\x27\x27\x26\x27\x27\x27\x26\x25" + "\x26\x23\xF0\x16\x0C\x0C\x06\x02\x06\x04\x04\x02\x0A\x16\x1E\x2A\x2E\x34\xF0\x3A\x3E\x3C\x30" + "\x20\x12\x0A\x08\x06\x04\x06\x02\x01" + "\x00\x01\xF0\x05\x03\x02\x00\x00\x03\x02\x00\x00\x00\x03\x01\x00\x02\x04\xF0\x02\x04\x00\x01" + "\x01\x03\x00\x00\x00\x03\x00\x01\x00" + "\x02\x00\x40\x00\x04\x02\x08\xF0\x38\x48\x38\x2C\x1E\x10\x0C\x04\x04\x04\x02\x00\x02\x06\x0A" + "\xF0\x0E\x12\x1C\x2C\x3E\x4E\x4C\x3C" + "\x28\x1E\x14\x0C\x04\x02\x02\xF0\x04\x04\x00\x01\x07\x05\x02\x04\x00\x00\x02\x02\x08\x06\x02" + "\xF0\x01\x09\x03\x04\x00\x04\x03\x08" + "\x02\x02\x03\x02\x07\x03\x00\x40\x01\x00\x04\x01\xC4\x02\x06\x16\x28\x3A\x34\x2E\x2A\x16\x06" + "\x01\x00\x13\x02\xF0\x00\x0A\x1C\x32" + "\x3A\x38\x34\x2E\x24\x14\x0C\x01\x03\x00\x04\xF0\x00\x00\x05\x03\x03\x01\x02\x00\x01\x03\x00" + "\x04\x00\x04\x04\xE0\x02\x02\x00\x04" + "\x02\x04\x00\x04\x01\x05\x06\x00\x03\x01\x04\x96\x02\x14\x22\x2A\x34\x20\x02\x02\x00\xF0\x01" + "\x02\x00\x00\x00\x0A\x14\x20\x2A\x32" + "\x3A\x34\x22\x10\x0A\xF0\x00\x04\x00\x02\x02\x04\x04\x03\x09\x05\x01\x01\x03\x02\x05\xF0\x07" + "\x03\x04\x03\x03\x03\x01\x00\x04\x02" + "\x06\x01\x02\x00\x01\xDB\x00\x00\x02\x02\x01\x00\x00\x02\x0A\x08\x00\x01\x00\xF0\x03\x01\x00" + "\x04\x0A\x12\x20\x3C\x4A\x32\x24\x10" + "\x02\x00\x04\xF0\x05\x07\x01\x08\x00\x06\x06\x02\x00\x00\x02\x01\x00\x03\x01\xA0\x00\x02\x02" + "\x01\x08\x0A\x00\x01\x02\x0A\x04\x78" + "\x02\x01\x01\x02\x00\x02\x00\x57\x02\x01\x01\x01\x00\xF0\x02\x0A\x22\x34\x34\x22\x0E\x02\x06" + "\x08\x02\x03\x01\x03\x01\xF3\x04\x00" + "\x00\x02\x04\x01\x00\x00\x04\x03\x03\x04\x03\x07\x03\x04\x23\x01\x00\x28\x01\x00\xF0\x02\x00" + "\x00\x00\x01\x02\x00\x01\x09\x15\x23" + "\x29\x1F\x0B\x00\xF0\x0A\x1C\x32\x2E\x0E\x00\x00\x02\x02\x06\x04\x06\x02\x01\x03\xF0\x01\x02" + "\x01\x00\x01\x04\x02\x04\x02\x01\x03" + "\x02\x02\x01\x01\x05\x3B\x02\x02\x00\xF0\x01\x02\x02\x00\x00\x01\x0B\x27\x43\x43\x33\x29\x33" + "\x45\x41\xE3\x1D\x05\x08\x24\x38\x18" + "\x00\x00\x04\x04\x02\x05\x02\x00\xD0\x01\x04\x00\x07\x01\x00\x07\x00\x01\x00\x01\x00\x00\x04" + "\x7D\x02\x00\x00\x00\x02\x02\x00\xF0" + "\x13\x31\x29\x03\x14\x20\x20\x1A\x0A\x0B\x31\x2B\x05\x01\x14\xF0\x28\x0A\x04\x03\x09\x01\x00" + "\x00\x01\x04\x00\x00\x06\x02\x02\xA0" + "\x01\x00\x03\x01\x04\x06\x01\x00\x00\x03\x71\xF0\x05\x2D\x13\x0A\x30\x3A\x32\x30\x32\x36\x20" + "\x03\x21\x21\x00\xF0\x00\x1C\x1A\x02" + "\x02\x04\x06\x04\x00\x02\x00\x04\x00\x02\x03\xB0\x00\x06\x06\x04\x04\x07\x00\x02\x02\x04\x02" + "\x41\xF0\x01\x00\x01\x2F\x0D\x12\x38" + "\x22\x0C\x04\x00\x02\x10\x2E\x2C\xF0\x02\x23\x17\x00\x02\x2A\x0A\x00\x03\x05\x01\x01\x02\x01" + "\x01\xE0\x01\x05\x00\x00\x01\x03\x02" + "\x01\x02\x03\x02\x02\x01\x04\x61\xF0\x0D\x11\x02\x1E\x10\x00\x01\x0F\x25\x2D\x23\x0B\x20\x10" + "\x07\xF0\x17\x03\x00\x0C\x1C\x04\x04" + "\x00\x01\x01\x00\x02\x00\x00\x00\x93\x02\x02\x02\x05\x05\x04\x02\x06\x01\x41\xF0\x02\x00\x09" + "\x07\x08\x14\x02\x00\x05\x21\x25\x21" + "\x29\x1D\x04\xF0\x1A\x02\x09\x03\x01\x04\x16\x08\x02\x02\x04\x01\x02\x02\x06\xE0\x00\x01\x04" + "\x04\x01\x04\x04\x02\x00\x03\x02\x00" + "\x02\x01\x11\x13\x01\xF0\x00\x0F\x05\x00\x0A\x01\x01\x04\x12\x0A\x0C\x12\x10\x02\x12\xF0\x02" + "\x05\x07\x00\x02\x14\x16\x04\x03\x03" + "\x02\x00\x00\x03\x01\xD0\x04\x01\x01\x04\x00\x03\x05\x05\x01\x03\x05\x00\x04\x31\xF0\x02\x00" + "\x00\x06\x04\x00\x03\x02\x00\x02\x1E" + "\x38\x36\x34\x1A\xF0\x02\x03\x01\x00\x02\x02\x00\x08\x12\x02\x04\x02\x02\x00\x07\xF0\x05\x02" + "\x02\x03\x01\x01\x06\x04\x02\x02\x00" + "\x02\x04\x02\x02\x11\xF0\x02\x02\x00\x00\x01\x0A\x08\x07\x0D\x00\x02\x04\x04\x0C\x12\xF0\x0A" + "\x02\x00\x13\x00\x04\x06\x00\x00\x02" + "\x16\x08\x00\x00\x00\xF0\x02\x04\x04\x00\x01\x00\x00\x02\x00\x00\x00\x06\x06\x00\x01\x20\x00" + "\x07\x0C\x37\x01\x07\x00\xF0\x10\x0C" + "\x03\x23\x09\x01\x01\x00\x02\x02\x00\x00\x15\x1D\x02\xF0\x12\x08\x00\x01\x01\x12\x14\x01\x01" + "\x01\x09\x03\x01\x00\x00\xC0\x02\x01" + "\x03\x05\x03\x00\x00\x01\x02\x06\x01\x06\x06\xF0\x01\x00\x01\x00\x00\x00\x01\x13\x27\x0D\x00" + "\x00\x01\x01\x00\x83\x00\x0A\x22\x01" + "\x11\x25\x09\x00\xF0\x01\x15\x29\x09\x0E\x1E\x02\x00\x02\x02\x02\x16\x04\x02\x00\xF0\x02\x01" + "\x00\x00\x00\x01\x00\x02\x02\x04\x00" + "\x03\x05\x02\x00\x20\x02\x01\x0C\xF0\x02\x06\x1B\x35\x21\x03\x00\x00\x02\x02\x02\x1A\x1E\x07" + "\x21\xC4\x31\x21\x11\x0D\x15\x29\x33" + "\x15\x01\x2A\x0E\x00\xF0\x16\x08\x04\x00\x02\x06\x02\x04\x00\x04\x00\x03\x01\x03\x01\x60\x01" + "\x01\x05\x01\x00\x00\x0C\xF0\x02\x12" + "\x16\x11\x35\x3F\x1B\x07\x01\x00\x00\x04\x32\x30\x06\xB5\x1D\x33\x43\x45\x3F\x29\x07\x18\x40" + "\x18\x00\xF0\x10\x0C\x01\x02\x02\x05" + "\x01\x03\x05\x01\x02\x02\x02\x00\x04\x60\x04\x08\x02\x00\x01\x02\x58\x00\x02\x02\x02\x00\xF0" + "\x04\x14\x08\x01\x15\x33\x33\x1B\x07" + "\x00\x00\x06\x22\x32\x2C\xF0\x16\x0A\x08\x12\x1C\x2C\x30\x16\x00\x01\x01\x00\x01\x00\x01\xF0" + "\x0F\x07\x00\x01\x00\x04\x04\x00\x06" + "\x04\x02\x02\x02\x06\x01\x60\x03\x01\x00\x04\x02\x01\x24\x02\x00\x26\x02\x00\xF0\x14\x22\x06" + "\x02\x09\x21\x31\x35\x1D\x03\x00\x04" + "\x18\x2C\x36\x84\x3C\x3A\x3C\x32\x22\x0E\x02\x00\xF0\x09\x2B\x39\x0B\x02\x04\x00\x00\x03\x01" + "\x01\x05\x00\x00\x04\x80\x01\x04\x00" + "\x01\x00\x01\x01\x02\x04\x28\x02\x00\xF0\x04\x2A\x4A\x2E\x1A\x10\x07\x19\x37\x47\x2B\x15\x07" + "\x00\x0A\xF0\x10\x12\x08\x06\x02\x01" + "\x00\x01\x00\x03\x0B\x2D\x45\x2B\x17\xF0\x03\x05\x05\x01\x04\x02\x04\x04\x00\x03\x02\x05\x01" + "\x01\x02\x50\x04\x02\x00\x02\x02\x0E" + "\xF0\x02\x00\x0A\x28\x34\x2E\x1A\x04\x05\x0F\x2D\x37\x33\x29\x1B\xF0\x11\x09\x01\x02\x02\x00" + "\x01\x0D\x1B\x29\x37\x29\x07\x02\x0E" + "\x33\x02\x01\x00\xE0\x01\x01\x00\x03\x00\x01\x01\x05\x02\x02\x01\x02\x02\x03\x3E\x02\x02\x00" + "\xF0\x02\x0E\x20\x32\x38\x28\x10\x06" + "\x09\x1B\x2D\x33\x39\x39\x37\xF0\x33\x37\x39\x3D\x37\x33\x2B\x15\x02\x18\x36\x34\x00\x00\x02" + "\xF0\x02\x02\x01\x03\x01\x04\x04\x00" + "\x00\x02\x00\x02\x00\x01\x00\x20\x03\x01\x44\x00\x00\x02\x00\x25\x02\x00\x23\x02\x00\xF0\x0A" + "\x1C\x34\x46\x3A\x26\x16\x0A\x0D\x0F" + "\x19\x21\x27\x21\x19\xF0\x17\x0F\x02\x18\x28\x46\x3E\x20\x03\x06\x00\x00\x04\x05\x00\xE0\x04" + "\x01\x05\x00\x03\x04\x00\x03\x05\x05" + "\x02\x01\x01\x04\x03\x4C\x02\x00\x02\x00\xF0\x02\x02\x00\x00\x06\x1A\x30\x36\x34\x32\x2A\x20" + "\x16\x10\x12\xF0\x18\x20\x2C\x32\x34" + "\x2E\x12\x02\x01\x19\x01\x06\x02\x03\x00\xF0\x00\x01\x05\x04\x02\x02\x01\x01\x06\x02\x00\x02" + "\x00\x04\x02\x2F\x02\x00\x08\xF0\x02" + "\x0E\x1C\x2A\x2C\x34\x3A\x3C\x38\x34\x30\x28\x1C\x10\x04\xF0\x00\x00\x17\x11\x07\x03\x02\x01" + "\x02\x00\x02\x0A\x00\x03\x01\x90\x04" + "\x02\x04\x02\x02\x00\x00\x00\x01\x3F\x00\x02\x00\x09\xF0\x02\x02\x06\x08\x0A\x10\x0E\x08\x06" + "\x02\x00\x01\x00\x0B\x27\xF0\x31\x09" + "\x03\x03\x07\x01\x02\x04\x03\x01\x01\x04\x04\x05\x01\x70\x00\x00\x01\x00\x00\x04\x01\x9F\x00" + "\x00\x02\x00\x02\x00\x00\x02\x00\x09" + "\x23\x02\x00\xF0\x07\x1D\x31\x2D\x11\x05\x02\x02\x00\x00\x03\x01\x02\x00\x01\xB0\x01\x00\x04" + "\x04\x01\x03\x00\x02\x00\x07\x00\x29" + "\x02\x00\x2B\x02\x00\x33\x01\x01\x00\xF0\x02\x02\x02\x00\x02\x02\x07\x25\x39\x33\x21\x07\x04" + "\x00\x03\xF0\x00\x02\x04\x04\x00\x02" + "\x04\x02\x01\x03\x05\x03\x01\x00\x01\x40\x03\x02\x04\x02\x93\x00\x02\x00\x02\x00\x01\x01\x01" + "\x00\xA4\x01\x01\x01\x00\x01\x01\x00" + "\x00\x01\x00\xF0\x01\x02\x01\x01\x01\x05\x0D\x11\x21\x3B\x49\x2F\x17\x0B\x00\xF0\x01\x01\x02" + "\x06\x02\x00\x02\x06\x02\x02\x00\x00" + "\x02\x00\x04\x80\x02\x06\x06\x06\x01\x00\x04\x03\xF0\x00\x00\x01\x01\x00\x03\x0F\x13\x1B\x1B" + "\x15\x0F\x09\x07\x01\x24\x01\x00\xF0" + "\x01\x00\x01\x02\x00\x03\x0F\x0F\x19\x25\x29\x33\x3B\x37\x1D\xF0\x09\x07\x01\x00\x00\x03\x03" + "\x01\x00\x02\x00\x01\x05\x05\x01\xD0" + "\x00\x02\x00\x00\x02\x00\x01\x05\x03\x02\x01\x03\x02\xF0\x02\x00\x02\x00\x21\x35\x33\x33\x35" + "\x35\x39\x39\x37\x3B\x41\xF0\x3B\x33" + "\x2B\x27\x23\x23\x25\x27\x29\x33\x3B\x3B\x39\x35\x33\xF0\x31\x27\x1F\x0D\x03\x07\x02\x00\x01" + "\x01\x04\x04\x02\x02\x00\xF0\x03\x00" + "\x02\x00\x00\x03\x01\x02\x00\x00\x03\x00\x01\x03\x01\x40\x04\x01\x02\x02\xF0\x01\x01\x01\x2B" + "\x31\x23\x1D\x17\x11\x0B\x0B\x13\x1B" + "\x19\x13\xF0\x1B\x29\x31\x37\x37\x35\x35\x33\x2F\x29\x1B\x19\x15\x17\x11\x83\x05\x03\x01\x05" + "\x03\x00\x03\x01\xF0\x02\x04\x02\x02" + "\x00\x01\x00\x00\x04\x08\x01\x02\x00\x02\x04\x80\x02\x02\x06\x02\x05\x01\x03\x01\xF0\x00\x02" + "\x13\x1B\x09\x01\x00\x00\x02\x02\x00" + "\x03\x03\x00\x05\xE3\x09\x01\x02\x02\x05\x03\x00\x03\x05\x01\x07\x05\x01\x03\xF0\x01\x00\x02" + "\x02\x04\x02\x00\x00\x01\x04\x00\x03" + "\x03\x01\x00\xF0\x00\x00\x01\x03\x04\x00\x00\x00\x01\x01\x02\x04\x00\x02\x02\x20\x00\x00\xF0" + "\x04\x00\x11\x0D\x00\x00\x02\x04\x00" + "\x03\x01\x06\x02\x05\x01\x13\x02\xF0\x01\x01\x00\x02\x00\x02\x02\x04\x00\x00\x08\x04\x00\x04" + "\x02\xF0\x03\x03\x05\x00\x02\x00\x03" + "\x03\x05\x05\x04\x02\x02\x01\x00\xF0\x02\x00\x00\x09\x02\x00\x04\x00\x03\x02\x00\x01\x00\x00" + "\x00\xF0\x01\x03\x0B\x00\x01\x00\x04" + "\x01\x02\x01\x01\x05\x02\x06\x02\xF0\x04\x04\x02\x01\x08\x02\x03\x01\x02\x01\x00\x00\x04\x06" + "\x01\xF0\x00\x02\x00\x02\x00\x03\x02" + "\x01\x02\x00\x03\x05\x00\x04\x02\xF0\x02\x00\x03\x01\x00\x00\x01\x00\x05\x01\x01\x02\x02\x01" + "\x04\x40\x04\x02\x00\x02\xF0\x02\x00" + "\x03\x00\x01\x04\x04\x00\x01\x00\x02\x02\x01\x01\x00\xF0\x03\x00\x05\x01\x03\x00\x01\x03\x00" + "\x00\x01\x01\x01\x00\x00\xF0\x02\x00" + "\x00\x01\x01\x04\x02\x02\x01\x02\x06\x04\x04\x02\x01\xF0\x01\x00\x02\x04\x00\x02\x00\x04\x02" + "\x01\x01\x03\x01\x03\x03\x40\x00\x02" + "\x00\x05\xF0\x00\x01\x00\x01\x00\x00\x05\x01\x02\x00\x03\x00\x06\x04\x00\xF0\x03\x03\x02\x02" + "\x01\x07\x00\x04\x00\x03\x04\x00\x03" + "\x02\x02\xF0\x01\x04\x02\x02\x04\x04\x03\x00\x00\x00\x04\x01\x03\x05\x07\xF0\x00\x01\x02\x01" + "\x01\x01\x04\x02\x04\x04\x06\x00\x04" + "\x00\x03\x40\x01\x00\x04\x00\x83\x02\x04\x02\x00\x08\x04\x06\x04\xF0\x00\x02\x04\x04\x0A\x00" + "\x01\x01\x00\x04\x02\x00\x02\x06\x03" + "\xF0\x00\x04\x05\x01\x02\x05\x03\x05\x00\x01\x03\x01\x01\x00\x05\xF0\x01\x05\x02\x08\x02\x06" + "\x00\x00\x02\x01\x05\x04\x00\x00\x03" + "\x80\x06\x03\x00\x02\x00\x05\x03\x04\xF0\x00\x04\x04\x01\x03\x07\x03\x00\x07\x01\x00\x02\x09" + "\x05\x03\xF0\x03\x04\x00\x01\x00\x04" + "\x00\x00\x01\x00\x04\x02\x00\x01\x02\xF0\x01\x01\x00\x00\x00\x02\x04\x01\x02\x02\x04\x00\x04" + "\x02\x02\xF0\x00\x03\x02\x01\x01\x00" + "\x02\x05\x01\x00\x01\x01\x00\x04\x04\x40\x02\x04\x00\x01\xF0\x00\x02\x10\x0A\x01\x02\x02\x04" + "\x06\x02\x02\x00\x02\x03\x00\x64\x07" + "\x0B\x00\x00\x04\x00\xF0\x03\x01\x00\x02\x04\x04\x02\x06\x08\x06\x00\x04\x06\x04\x01\xF0\x02" + "\x04\x02\x00\x05\x02\x04\x00\x00\x02" + "\x01\x03\x01\x02\x04\x90\x00\x03\x04\x00\x03\x02\x00\x02\x02\xF0\x01\x00\x10\x04\x00\x06\x04" + "\x01\x03\x03\x01\x00\x01\x00\x00\xF0" + "\x08\x00\x05\x01\x03\x01\x00\x01\x05\x05\x04\x02\x01\x01\x05\xF0\x03\x05\x05\x00\x05\x07\x01" + "\x00\x03\x02\x03\x01\x02\x02\x02\xF0" + "\x01\x01\x05\x04\x00\x04\x02\x08\x02\x03\x03\x08\x00\x01\x04\x40\x03\x02\x02\x01\xF0\x00\x00" + "\x0C\x08\x04\x00\x03\x01\x02\x08\x01" + "\x03\x02\x02\x02\xF0\x00\x06\x08\x06\x06\x01\x02\x06\x04\x02\x01\x02\x00\x02\x02\xF0\x00\x02" + "\x01\x07\x00\x08\x03\x01\x02\x03\x00" + "\x00\x02\x06\x06\xF0\x01\x05\x01\x03\x02\x02\x04\x05\x03\x01\x02\x05\x07\x01\x00\x40\x00\x01" + "\x00\x04\xF0\x02\x00\x08\x0E\x04\x02" + "\x02\x04\x04\x05\x00\x02\x00\x00\x05\xF0\x00\x01\x05\x03\x07\x02\x00\x01\x00\x02\x01\x01\x00" + "\x00\x01\xF0\x00\x02\x02\x04\x02\x00" + "\x04\x02\x00\x00\x06\x04\x03\x01\x00\xF0\x06\x06\x08\x02\x02\x01\x03\x01\x00\x01\x02\x03\x02" + "\x00\x00\x40\x00\x03\x03\x02\xF0\x02" + "\x02\x04\x22\x00\x03\x01\x03\x01\x04\x06\x04\x02\x06\x00\xF0\x03\x00\x00\x02\x08\x00\x01\x01" + "\x00\x02\x04\x01\x03\x06\x04\xF0\x00" + "\x02\x01\x01\x01\x05\x00\x01\x03\x00\x05\x00\x02\x03\x03\xF0\x03\x00\x01\x00\x01\x00\x00\x04" + "\x00\x02\x08\x08\x02\x00\x03\x40\x04" + "\x02\x02\x03\x03\xF0\x16\x12\x02\x03\x05\x02\x00\x03\x03\x00\x03\x04\x02\x02\x04\xF0\x02\x05" + "\x01\x02\x04\x02\x01\x00\x02\x01\x00" + "\x03\x01\x01\x00\xF0\x04\x00\x02\x04\x01\x00\x00\x00\x02\x02\x03\x03\x01\x00\x02\xF0\x01\x03" + "\x01\x04\x02\x01\x02\x03\x00\x04\x04" + "\x01\x03\x00\x03\x10\x01\xF0\x00\x00\x01\x02\x22\x06\x08\x08\x04\x02\x04\x06\x02\x00\x02\xF0" + "\x02\x02\x00\x01\x06\x02\x06\x01\x05" + "\x01\x00\x00\x02\x09\x01\xF0\x00\x00\x02\x00\x04\x04\x01\x02\x01\x01\x00\x03\x01\x03\x01\xF0" + "\x00\x03\x03\x04\x02\x02\x01\x03\x02" + "\x02\x05\x01\x01\x00\x04\x40\x02\x02\x02\x00\xF0\x01\x00\x00\x00\x22\x3C\x3C\x38\x30\x2E\x2C" + "\x26\x1E\x24\x20\xF0\x1E\x20\x16\x12" + "\x0C\x08\x04\x06\x0A\x0A\x00\x00\x02\x04\x00\xF0\x02\x04\x02\x05\x03\x01\x07\x03\x00\x02\x06" + "\x00\x02\x08\x08\xF0\x02\x04\x00\x03" + "\x02\x00\x00\x02\x00\x01\x00\x02\x01\x02\x02\x40\x00\x01\x02\x06\xF0\x02\x00\x02\x02\x06\x1C" + "\x20\x26\x2A\x2E\x30\x34\x40\x3A\x3A" + "\xF0\x3C\x38\x3A\x38\x32\x34\x2A\x24\x24\x16\x10\x08\x0A\x0A\x08\xF0\x06\x04\x02\x04\x00\x02" + "\x08\x02\x02\x02\x01\x02\x00\x01\x05" + "\xF0\x01\x00\x02\x02\x05\x01\x01\x02\x02\x02\x06\x00\x04\x03\x00\x40\x00\x04\x04\x01\x66\x01" + "\x01\x00\x00\x01\x00\xF0\x01\x02\x04" + "\x06\x08\x10\x14\x1E\x24\x2A\x2E\x30\x36\x40\x42\xF0\x3C\x30\x26\x14\x08\x0A\x06\x00\x03\x00" + "\x02\x04\x01\x00\x02\xF0\x01\x01\x02" + "\x04\x00\x00\x05\x02\x04\x00\x01\x01\x05\x02\x00\x70\x02\x00\x01\x00\x01\x05\x01\x31\xF0\x01" + "\x02\x02\x06\x08\x0C\x0E\x12\x1C\x2A" + "\x32\x46\x50\x3C\x30\xF0\x28\x22\x0E\x0A\x02\x04\x01\x03\x05\x03\x00\x00\x01\x02\x06\xF0\x02" + "\x03\x01\x03\x03\x00\x03\x01\x03\x02" + "\x04\x04\x03\x07\x00\x33\x02\x02\x00\x33\x01\x01\x00\x2E\x02\x00\xF0\x01\x02\x00\x02\x16\x2A" + "\x38\x38\x3A\x34\x30\x28\x1A\x0A\x08" + "\xF0\x08\x02\x02\x00\x01\x02\x01\x02\x02\x00\x02\x02\x00\x02\x01\x60\x05\x03\x07\x04\x0C\x00" + "\x04\x2A\x02\x00\x53\x01\x00\x02\x02" + "\x00\x46\x01\x00\x02\x00\xF0\x02\x08\x14\x22\x28\x2E\x38\x3E\x32\x1C\x08\x02\x04\x01\x03\xF0" + "\x02\x01\x00\x04\x06\x06\x04\x06\x04" + "\x04\x04\x08\x02\x00\x04\x06\x74\x02\x02\x00\x00\x01\x01\x00\x37\x01\x01\x00\x23\x01\x00\xF0" + "\x02\x00\x00\x02\x02\x00\x04\x08\x0E" + "\x18\x2A\x44\x4E\x3A\x20\xF0\x16\x0C\x06\x02\x00\x03\x01\x03\x05\x0B\x07\x00\x00\x0B\x03\x20" + "\x00\x01\x64\x01\x03\x03\x01\x02\x00" + "\x3B\x02\x02\x00\x5B\x02\x00\x00\x02\x00\xF0\x01\x00\x02\x00\x0A\x22\x3A\x3C\x34\x2A\x1A\x0A" + "\x08\x08\x02\x90\x00\x00\x08\x02\x01" + "\x02\x00\x00\x03\xF0\x39\x39\x3B\x3D\x3D\x37\x2F\x2D\x25\x1F\x1B\x19\x15\x0D\x07\x23\x01\x02" + "\x1F\x00\x13\x01\xF0\x00\x01\x01\x02" + "\x01\x00\x04\x10\x20\x2A\x38\x40\x2C\x0C\x02\x90\x02\x02\x03\x03\x00\x01\x06\x01\x04\xF0\x1D" + "\x1D\x21\x19\x21\x27\x31\x2F\x39\x39" + "\x3F\x41\x3D\x45\x4D\xC5\x4D\x43\x35\x2B\x21\x17\x11\x0D\x09\x05\x01\x00\x29\x01\x00\xF0\x03" + "\x00\x01\x01\x01\x00\x06\x0E\x16\x2E" + "\x46\x42\x2C\x18\x10\x60\x02\x05\x0A\x05\x01\x03\xF0\x07\x07\x03\x0B\x01\x01\x00\x05\x01\x0B" + "\x01\x02\x0D\x0D\x0B\xF0\x09\x1B\x25" + "\x2F\x37\x3F\x39\x37\x33\x2F\x25\x19\x11\x05\x01\xC6\x00\x00\x02\x00\x00\x00\x02\x02\x00\x00" + "\x02\x00\xF0\x02\x01\x01\x00\x02\x06" + "\x1A\x32\x34\x26\x1C\x12\x06\x04\x02\x10\x04\xF0\x02\x02\x08\x08\x03\x01\x01\x02\x00\x02\x02" + "\x00\x04\x04\x02\xF0\x07\x01\x03\x07" + "\x09\x07\x0F\x17\x1D\x23\x31\x35\x33\x37\x33\xE4\x21\x13\x07\x00\x01\x01\x00\x00\x02\x02\x00" + "\x00\x00\x02\xF0\x00\x02\x02\x02\x00" + "\x00\x00\x02\x14\x28\x38\x36\x1A\x08\x02\x10\x00\xF0\x00\x01\x05\x01\x02\x02\x06\x00\x02\x02" + "\x07\x09\x03\x01\x00\xF0\x01\x00\x03" + "\x00\x00\x00\x03\x01\x03\x01\x05\x0D\x11\x1D\x27\xF0\x39\x43\x4B\x45\x2D\x17\x0B\x03\x01\x00" + "\x00\x02\x02\x00\x01\x84\x01\x00\x00" + "\x01\x00\x00\x01\x00\x70\x02\x0A\x1C\x3C\x44\x2E\x18\xF0\x03\x02\x04\x02\x02\x02\x01\x01\x00" + "\x02\x00\x04\x01\x00\x00\xF0\x04\x02" + "\x08\x06\x04\x03\x02\x02\x01\x03\x01\x00\x07\x05\x00\xF0\x03\x07\x09\x17\x29\x3B\x37\x2D\x1F" + "\x11\x03\x00\x00\x00\x02\x24\x02\x00" "\x23\x02\x00\x80\x02\x02\x00\x02\x02\x12\x2E\x3C"; /** @@ -2795,27 +5411,16 @@ static const BYTE TEST_RLE_UNCOMPRESSED_BITMAP_16BPP[2048] = "\x08\x42\x08\x42\x08\x42\x08\x42\x08\x42\x08\x42\x08\x42\x08\x42" "\x08\x42\x08\x42\x08\x42\x08\x42\x08\x42\x08\x42\x08\x42\xFF\xFF"; -static const UINT32 colorFormatList[] = -{ - PIXEL_FORMAT_RGB15, - PIXEL_FORMAT_BGR15, - PIXEL_FORMAT_RGB16, - PIXEL_FORMAT_BGR16, - PIXEL_FORMAT_RGB24, - PIXEL_FORMAT_BGR24, - PIXEL_FORMAT_ARGB32, - PIXEL_FORMAT_ABGR32, - PIXEL_FORMAT_XRGB32, - PIXEL_FORMAT_XBGR32, - PIXEL_FORMAT_RGBX32, - PIXEL_FORMAT_BGRX32 +static const UINT32 colorFormatList[] = { + PIXEL_FORMAT_RGB15, PIXEL_FORMAT_BGR15, PIXEL_FORMAT_RGB16, PIXEL_FORMAT_BGR16, + PIXEL_FORMAT_RGB24, PIXEL_FORMAT_BGR24, PIXEL_FORMAT_ARGB32, PIXEL_FORMAT_ABGR32, + PIXEL_FORMAT_XRGB32, PIXEL_FORMAT_XBGR32, PIXEL_FORMAT_RGBX32, PIXEL_FORMAT_BGRX32 }; -static const UINT32 colorFormatCount = sizeof(colorFormatList) / sizeof( - colorFormatList[0]); +static const UINT32 colorFormatCount = sizeof(colorFormatList) / sizeof(colorFormatList[0]); -static BOOL CompareBitmap(const BYTE* srcA, UINT32 srcAFormat, const BYTE* srcB, - UINT32 srcBFormat, UINT32 width, UINT32 height) +static BOOL CompareBitmap(const BYTE* srcA, UINT32 srcAFormat, const BYTE* srcB, UINT32 srcBFormat, + UINT32 width, UINT32 height) { double maxDiff; const UINT32 srcABits = GetBitsPerPixel(srcAFormat); @@ -2889,16 +5494,16 @@ static BOOL CompareBitmap(const BYTE* srcA, UINT32 srcAFormat, const BYTE* srcB, } static BOOL RunTestPlanar(BITMAP_PLANAR_CONTEXT* planar, const BYTE* srcBitmap, - const UINT32 srcFormat, const UINT32 dstFormat, - const UINT32 width, const UINT32 height) + const UINT32 srcFormat, const UINT32 dstFormat, const UINT32 width, + const UINT32 height) { BOOL rc = FALSE; UINT32 dstSize; - BYTE* compressedBitmap = freerdp_bitmap_compress_planar(planar, - srcBitmap, srcFormat, width, height, 0, NULL, &dstSize); - BYTE* decompressedBitmap = (BYTE*) calloc(height, width * GetBytesPerPixel(dstFormat)); - printf("%s [%s] --> [%s]: ", __FUNCTION__, - FreeRDPGetColorFormatName(srcFormat), FreeRDPGetColorFormatName(dstFormat)); + BYTE* compressedBitmap = freerdp_bitmap_compress_planar(planar, srcBitmap, srcFormat, width, + height, 0, NULL, &dstSize); + BYTE* decompressedBitmap = (BYTE*)calloc(height, width * GetBytesPerPixel(dstFormat)); + printf("%s [%s] --> [%s]: ", __FUNCTION__, FreeRDPGetColorFormatName(srcFormat), + FreeRDPGetColorFormatName(dstFormat)); fflush(stdout); printf("TODO: Skipping unfinished test!"); rc = TRUE; @@ -2907,17 +5512,16 @@ static BOOL RunTestPlanar(BITMAP_PLANAR_CONTEXT* planar, const BYTE* srcBitmap, if (!compressedBitmap || !decompressedBitmap) goto fail; - if (!planar_decompress(planar, compressedBitmap, dstSize, width, height, - decompressedBitmap, + if (!planar_decompress(planar, compressedBitmap, dstSize, width, height, decompressedBitmap, dstFormat, 0, 0, 0, width, height, FALSE)) { - printf("failed to decompress experimental bitmap 01: width: %"PRIu32" height: %"PRIu32"\n", + printf("failed to decompress experimental bitmap 01: width: %" PRIu32 " height: %" PRIu32 + "\n", width, height); goto fail; } - if (!CompareBitmap(decompressedBitmap, dstFormat, srcBitmap, srcFormat, width, - height)) + if (!CompareBitmap(decompressedBitmap, dstFormat, srcBitmap, srcFormat, width, height)) { printf("FAIL"); goto fail; @@ -2933,8 +5537,8 @@ fail: return rc; } -static BOOL RunTestPlanarSingleColor(BITMAP_PLANAR_CONTEXT* planar, - const UINT32 srcFormat, const UINT32 dstFormat) +static BOOL RunTestPlanarSingleColor(BITMAP_PLANAR_CONTEXT* planar, const UINT32 srcFormat, + const UINT32 dstFormat) { UINT32 i, j, x, y; BOOL rc = FALSE; @@ -2948,8 +5552,8 @@ static BOOL RunTestPlanarSingleColor(BITMAP_PLANAR_CONTEXT* planar, { UINT32 compressedSize; const UINT32 fill = j; - const UINT32 color = FreeRDPGetColor(srcFormat, (fill >> 8) & 0xF, (fill >> 4) & 0xF, - (fill) & 0xF, 0xFF); + const UINT32 color = + FreeRDPGetColor(srcFormat, (fill >> 8) & 0xF, (fill >> 4) & 0xF, (fill)&0xF, 0xFF); const UINT32 width = i; const UINT32 height = i; BOOL failed = TRUE; @@ -2957,7 +5561,7 @@ static BOOL RunTestPlanarSingleColor(BITMAP_PLANAR_CONTEXT* planar, const UINT32 dstSize = width * height * GetBytesPerPixel(dstFormat); BYTE* compressedBitmap = NULL; BYTE* bmp = malloc(srcSize); - BYTE* decompressedBitmap = (BYTE*) malloc(dstSize); + BYTE* decompressedBitmap = (BYTE*)malloc(dstSize); if (!bmp || !decompressedBitmap) goto fail_loop; @@ -2973,19 +5577,17 @@ static BOOL RunTestPlanarSingleColor(BITMAP_PLANAR_CONTEXT* planar, } } - compressedBitmap = freerdp_bitmap_compress_planar(planar, bmp, srcFormat, - width, height, 0, NULL, &compressedSize); + compressedBitmap = freerdp_bitmap_compress_planar(planar, bmp, srcFormat, width, height, + 0, NULL, &compressedSize); if (!compressedBitmap) goto fail_loop; - if (!planar_decompress(planar, compressedBitmap, compressedSize, - width, height, decompressedBitmap, - dstFormat, 0, 0, 0, width, height, FALSE)) + if (!planar_decompress(planar, compressedBitmap, compressedSize, width, height, + decompressedBitmap, dstFormat, 0, 0, 0, width, height, FALSE)) goto fail_loop; - if (!CompareBitmap(decompressedBitmap, dstFormat, bmp, srcFormat, width, - height)) + if (!CompareBitmap(decompressedBitmap, dstFormat, bmp, srcFormat, width, height)) goto fail_loop; failed = FALSE; @@ -3015,26 +5617,25 @@ static BOOL TestPlanar(const UINT32 format) UINT32 x; BOOL rc = FALSE; const DWORD planarFlags = PLANAR_FORMAT_HEADER_NA | PLANAR_FORMAT_HEADER_RLE; - BITMAP_PLANAR_CONTEXT* planar = freerdp_bitmap_planar_context_new(planarFlags, - 64, 64); + BITMAP_PLANAR_CONTEXT* planar = freerdp_bitmap_planar_context_new(planarFlags, 64, 64); if (!planar) goto fail; - if (!RunTestPlanar(planar, TEST_RLE_BITMAP_EXPERIMENTAL_01, PIXEL_FORMAT_RGBX32, - format, 64, 64)) + if (!RunTestPlanar(planar, TEST_RLE_BITMAP_EXPERIMENTAL_01, PIXEL_FORMAT_RGBX32, format, 64, + 64)) goto fail; - if (!RunTestPlanar(planar, TEST_RLE_BITMAP_EXPERIMENTAL_02, PIXEL_FORMAT_RGBX32, - format, 64, 64)) + if (!RunTestPlanar(planar, TEST_RLE_BITMAP_EXPERIMENTAL_02, PIXEL_FORMAT_RGBX32, format, 64, + 64)) goto fail; - if (!RunTestPlanar(planar, TEST_RLE_BITMAP_EXPERIMENTAL_03, PIXEL_FORMAT_RGBX32, - format, 64, 64)) + if (!RunTestPlanar(planar, TEST_RLE_BITMAP_EXPERIMENTAL_03, PIXEL_FORMAT_RGBX32, format, 64, + 64)) goto fail; - if (!RunTestPlanar(planar, TEST_RLE_UNCOMPRESSED_BITMAP_16BPP, - PIXEL_FORMAT_RGB16, format, 32, 32)) + if (!RunTestPlanar(planar, TEST_RLE_UNCOMPRESSED_BITMAP_16BPP, PIXEL_FORMAT_RGB16, format, 32, + 32)) goto fail; for (x = 0; x < colorFormatCount; x++) diff --git a/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c b/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c index 76bdcc480..8bdd01422 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c @@ -157,7 +157,7 @@ static void test_fill_image_alpha_channel(BYTE* data, int width, int height, BYT { for (j = 0; j < width; j++) { - pixel = (UINT32*) &data[((i * width) + j) * 4]; + pixel = (UINT32*)&data[((i * width) + j) * 4]; *pixel = ((*pixel & 0x00FFFFFF) | (value << 24)); } } @@ -170,7 +170,7 @@ static void* test_image_memset32(UINT32* ptr, UINT32 fill, size_t length) *ptr++ = fill; } - return (void*) ptr; + return (void*)ptr; } static int test_image_fill(BYTE* pDstData, int nDstStep, int nXDst, int nYDst, int nWidth, @@ -184,7 +184,7 @@ static int test_image_fill(BYTE* pDstData, int nDstStep, int nXDst, int nYDst, i for (y = 0; y < nHeight; y++) { - pDstPixel = (UINT32*) &pDstData[((nYDst + y) * nDstStep) + (nXDst * 4)]; + pDstPixel = (UINT32*)&pDstData[((nYDst + y) * nDstStep) + (nXDst * 4)]; test_image_memset32(pDstPixel, color, nWidth); } @@ -235,7 +235,7 @@ static int test_image_fill_quarter(BYTE* pDstData, int nDstStep, int nWidth, int } static int test_image_fill_unused_quarters(BYTE* pDstData, int nDstStep, int nWidth, int nHeight, - UINT32 color, int quarter) + UINT32 color, int quarter) { return 1; @@ -286,7 +286,7 @@ static BYTE* test_progressive_load_file(char* path, char* file, size_t* size) _fseeki64(fp, 0, SEEK_END); *size = _ftelli64(fp); _fseeki64(fp, 0, SEEK_SET); - buffer = (BYTE*) malloc(*size); + buffer = (BYTE*)malloc(*size); if (!buffer) { @@ -311,162 +311,210 @@ static int test_progressive_load_files(char* ms_sample_path, EGFX_SAMPLE_FILE fi int quarterNo = 0; int passNo = 0; /* image 1 */ - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_0_0_025_sampleimage1.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_0_0_025_sampleimage1.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_0_0_050_sampleimage1.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_0_0_050_sampleimage1.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_0_0_075_sampleimage1.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_0_0_075_sampleimage1.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_0_0_100_sampleimage1.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_0_0_100_sampleimage1.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; quarterNo = (quarterNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_0_1_025_sampleimage1.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_0_1_025_sampleimage1.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_0_1_050_sampleimage1.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_0_1_050_sampleimage1.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_0_1_075_sampleimage1.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_0_1_075_sampleimage1.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_0_1_100_sampleimage1.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_0_1_100_sampleimage1.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; quarterNo = (quarterNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_0_2_025_sampleimage1.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_0_2_025_sampleimage1.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_0_2_050_sampleimage1.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_0_2_050_sampleimage1.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_0_2_075_sampleimage1.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_0_2_075_sampleimage1.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_0_2_100_sampleimage1.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_0_2_100_sampleimage1.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; quarterNo = (quarterNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_0_3_025_sampleimage1.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_0_3_025_sampleimage1.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_0_3_050_sampleimage1.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_0_3_050_sampleimage1.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_0_3_075_sampleimage1.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_0_3_075_sampleimage1.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_0_3_100_sampleimage1.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_0_3_100_sampleimage1.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; imageNo++; /* image 2 */ - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_1_0_025_sampleimage2.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_1_0_025_sampleimage2.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_1_0_050_sampleimage2.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_1_0_050_sampleimage2.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_1_0_075_sampleimage2.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_1_0_075_sampleimage2.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_1_0_100_sampleimage2.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_1_0_100_sampleimage2.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; quarterNo = (quarterNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_1_1_025_sampleimage2.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_1_1_025_sampleimage2.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_1_1_050_sampleimage2.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_1_1_050_sampleimage2.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_1_1_075_sampleimage2.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_1_1_075_sampleimage2.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_1_1_100_sampleimage2.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_1_1_100_sampleimage2.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; quarterNo = (quarterNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_1_2_025_sampleimage2.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_1_2_025_sampleimage2.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_1_2_050_sampleimage2.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_1_2_050_sampleimage2.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_1_2_075_sampleimage2.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_1_2_075_sampleimage2.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_1_2_100_sampleimage2.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_1_2_100_sampleimage2.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; quarterNo = (quarterNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_1_3_025_sampleimage2.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_1_3_025_sampleimage2.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_1_3_050_sampleimage2.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_1_3_050_sampleimage2.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_1_3_075_sampleimage2.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_1_3_075_sampleimage2.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_1_3_100_sampleimage2.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_1_3_100_sampleimage2.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; imageNo++; /* image 3 */ - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_2_0_025_sampleimage3.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_2_0_025_sampleimage3.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_2_0_050_sampleimage3.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_2_0_050_sampleimage3.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_2_0_075_sampleimage3.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_2_0_075_sampleimage3.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_2_0_100_sampleimage3.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_2_0_100_sampleimage3.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; quarterNo = (quarterNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_2_1_025_sampleimage3.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_2_1_025_sampleimage3.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_2_1_050_sampleimage3.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_2_1_050_sampleimage3.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_2_1_075_sampleimage3.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_2_1_075_sampleimage3.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_2_1_100_sampleimage3.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_2_1_100_sampleimage3.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; quarterNo = (quarterNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_2_2_025_sampleimage3.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_2_2_025_sampleimage3.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_2_2_050_sampleimage3.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_2_2_050_sampleimage3.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_2_2_075_sampleimage3.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_2_2_075_sampleimage3.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_2_2_100_sampleimage3.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_2_2_100_sampleimage3.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; quarterNo = (quarterNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_2_3_025_sampleimage3.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_2_3_025_sampleimage3.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_2_3_050_sampleimage3.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_2_3_050_sampleimage3.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_2_3_075_sampleimage3.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_2_3_075_sampleimage3.bin", + &(files[imageNo][quarterNo][passNo].size)); passNo = (passNo + 1) % 4; - files[imageNo][quarterNo][passNo].buffer = test_progressive_load_file(ms_sample_path, - "compress/enc_2_3_100_sampleimage3.bin", &(files[imageNo][quarterNo][passNo].size)); + files[imageNo][quarterNo][passNo].buffer = + test_progressive_load_file(ms_sample_path, "compress/enc_2_3_100_sampleimage3.bin", + &(files[imageNo][quarterNo][passNo].size)); /* check if all test data has been loaded */ @@ -509,8 +557,8 @@ static BYTE* test_progressive_load_bitmap(char* path, char* file, size_t* size, buffer = image->data; *size = image->height * image->scanline; test_fill_image_alpha_channel(image->data, image->width, image->height, 0xFF); - test_image_fill_unused_quarters(image->data, image->scanline, image->width, image->height, quarter, - 0xFF000000); + test_image_fill_unused_quarters(image->data, image->scanline, image->width, image->height, + quarter, 0xFF000000); winpr_image_free(image, FALSE); free(filename); return buffer; @@ -522,162 +570,210 @@ static int test_progressive_load_bitmaps(char* ms_sample_path, EGFX_SAMPLE_FILE int quarterNo = 0; int passNo = 0; /* image 1 */ - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_0_0_025_sampleimage1.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_0_0_025_sampleimage1.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_0_0_050_sampleimage1.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_0_0_050_sampleimage1.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_0_0_075_sampleimage1.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_0_0_075_sampleimage1.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_0_0_100_sampleimage1.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_0_0_100_sampleimage1.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; quarterNo = (quarterNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_0_1_025_sampleimage1.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_0_1_025_sampleimage1.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_0_1_050_sampleimage1.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_0_1_050_sampleimage1.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_0_1_075_sampleimage1.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_0_1_075_sampleimage1.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_0_1_100_sampleimage1.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_0_1_100_sampleimage1.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; quarterNo = (quarterNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_0_2_025_sampleimage1.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_0_2_025_sampleimage1.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_0_2_050_sampleimage1.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_0_2_050_sampleimage1.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_0_2_075_sampleimage1.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_0_2_075_sampleimage1.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_0_2_100_sampleimage1.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_0_2_100_sampleimage1.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; quarterNo = (quarterNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_0_3_025_sampleimage1.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_0_3_025_sampleimage1.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_0_3_050_sampleimage1.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_0_3_050_sampleimage1.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_0_3_075_sampleimage1.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_0_3_075_sampleimage1.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_0_3_100_sampleimage1.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_0_3_100_sampleimage1.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; imageNo++; /* image 2 */ - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_1_0_025_sampleimage2.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_1_0_025_sampleimage2.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_1_0_050_sampleimage2.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_1_0_050_sampleimage2.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_1_0_075_sampleimage2.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_1_0_075_sampleimage2.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_1_0_100_sampleimage2.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_1_0_100_sampleimage2.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; quarterNo = (quarterNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_1_1_025_sampleimage2.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_1_1_025_sampleimage2.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_1_1_050_sampleimage2.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_1_1_050_sampleimage2.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_1_1_075_sampleimage2.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_1_1_075_sampleimage2.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_1_1_100_sampleimage2.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_1_1_100_sampleimage2.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; quarterNo = (quarterNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_1_2_025_sampleimage2.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_1_2_025_sampleimage2.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_1_2_050_sampleimage2.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_1_2_050_sampleimage2.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_1_2_075_sampleimage2.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_1_2_075_sampleimage2.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_1_2_100_sampleimage2.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_1_2_100_sampleimage2.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; quarterNo = (quarterNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_1_3_025_sampleimage2.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_1_3_025_sampleimage2.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_1_3_050_sampleimage2.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_1_3_050_sampleimage2.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_1_3_075_sampleimage2.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_1_3_075_sampleimage2.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_1_3_100_sampleimage2.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_1_3_100_sampleimage2.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; imageNo++; /* image 3 */ - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_2_0_025_sampleimage3.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_2_0_025_sampleimage3.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_2_0_050_sampleimage3.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_2_0_050_sampleimage3.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_2_0_075_sampleimage3.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_2_0_075_sampleimage3.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_2_0_100_sampleimage3.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_2_0_100_sampleimage3.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; quarterNo = (quarterNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_2_1_025_sampleimage3.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_2_1_025_sampleimage3.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_2_1_050_sampleimage3.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_2_1_050_sampleimage3.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_2_1_075_sampleimage3.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_2_1_075_sampleimage3.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_2_1_100_sampleimage3.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_2_1_100_sampleimage3.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; quarterNo = (quarterNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_2_2_025_sampleimage3.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_2_2_025_sampleimage3.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_2_2_050_sampleimage3.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_2_2_050_sampleimage3.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_2_2_075_sampleimage3.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_2_2_075_sampleimage3.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_2_2_100_sampleimage3.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_2_2_100_sampleimage3.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; quarterNo = (quarterNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_2_3_025_sampleimage3.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_2_3_025_sampleimage3.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_2_3_050_sampleimage3.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_2_3_050_sampleimage3.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_2_3_075_sampleimage3.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_2_3_075_sampleimage3.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); passNo = (passNo + 1) % 4; - bitmaps[imageNo][quarterNo][passNo].buffer = test_progressive_load_bitmap(ms_sample_path, - "decompress/dec_2_3_100_sampleimage3.bmp", &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); + bitmaps[imageNo][quarterNo][passNo].buffer = + test_progressive_load_bitmap(ms_sample_path, "decompress/dec_2_3_100_sampleimage3.bmp", + &(bitmaps[imageNo][quarterNo][passNo].size), quarterNo); /* check if all test data has been loaded */ @@ -796,9 +892,9 @@ static int test_progressive_decode(PROGRESSIVE_CONTEXT* progressive, EGFX_SAMPLE nXSrc = nXDst - tile->x; nYSrc = nYDst - tile->y; - freerdp_image_copy(g_DstData, PIXEL_FORMAT_XRGB32, g_DstStep, - nXDst, nYDst, nWidth, nHeight, tile->data, - PIXEL_FORMAT_XRGB32, 64 * 4, nXSrc, nYSrc, NULL, FREERDP_FLIP_NONE); + freerdp_image_copy(g_DstData, PIXEL_FORMAT_XRGB32, g_DstStep, nXDst, nYDst, nWidth, + nHeight, tile->data, PIXEL_FORMAT_XRGB32, 64 * 4, nXSrc, nYSrc, NULL, + FREERDP_FLIP_NONE); } size = bitmaps[pass].size; @@ -806,12 +902,12 @@ static int test_progressive_decode(PROGRESSIVE_CONTEXT* progressive, EGFX_SAMPLE if (cnt) { - float rate = ((float) cnt) / ((float) size) * 100.0f; + float rate = ((float)cnt) / ((float)size) * 100.0f; printf("Progressive RemoteFX decompression failure\n"); printf("Actual, Expected (%d/%d = %.3f%%):\n", cnt, size, rate); } - //WLog_Image(progressive->log, WLOG_TRACE, g_DstData, g_Width, g_Height, 32); + // WLog_Image(progressive->log, WLOG_TRACE, g_DstData, g_Width, g_Height, 32); } return 1; @@ -930,9 +1026,10 @@ int TestFreeRDPCodecProgressive(int argc, char* argv[]) WINPR_UNUSED(argv); GetSystemTime(&systemTime); sprintf_s(name, sizeof(name), - "EGFX_PROGRESSIVE_MS_SAMPLE-%04"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%04"PRIu16, - systemTime.wYear, systemTime.wMonth, systemTime.wDay, systemTime.wHour, systemTime.wMinute, - systemTime.wSecond, systemTime.wMilliseconds); + "EGFX_PROGRESSIVE_MS_SAMPLE-%04" PRIu16 "%02" PRIu16 "%02" PRIu16 "%02" PRIu16 + "%02" PRIu16 "%02" PRIu16 "%04" PRIu16, + systemTime.wYear, systemTime.wMonth, systemTime.wDay, systemTime.wHour, + systemTime.wMinute, systemTime.wSecond, systemTime.wMilliseconds); ms_sample_path = GetKnownSubPath(KNOWN_PATH_TEMP, name); if (!ms_sample_path) diff --git a/libfreerdp/codec/test/TestFreeRDPCodecRemoteFX.c b/libfreerdp/codec/test/TestFreeRDPCodecRemoteFX.c index 0b639bfef..7c5f0b212 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecRemoteFX.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecRemoteFX.c @@ -4,7 +4,6 @@ #include #include - static BYTE encodeHeaderSample[] = { /* as in 4.2.2 */ 0xc0, 0xcc, 0x0c, 0x00, 0x00, 0x00, 0xca, 0xac, 0xcc, 0xca, 0x00, 0x01, 0xc3, 0xcc, 0x0d, 0x00, @@ -17,8 +16,8 @@ static BYTE encodeDataSample[] = { 0xc4, 0xcc, 0x0e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, /* REGION as in 4.2.3 */ - 0xc6, 0xcc, 0x17, 0x00, 0x00, 0x00, 0x01, 0x00, 0xcd, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, - 0x00, 0x40, 0x00, 0xc1, 0xca, 0x01, 0x00, + 0xc6, 0xcc, 0x17, 0x00, 0x00, 0x00, 0x01, 0x00, 0xcd, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, + 0x00, 0x40, 0x00, 0xc1, 0xca, 0x01, 0x00, /* TILESET as in 4.2.4.1 */ 0xc7, 0xcc, 0x3e, 0x0b, 0x00, 0x00, 0x01, 0x00, 0xc2, 0xca, 0x00, 0x00, 0x51, 0x50, 0x01, 0x40, @@ -203,524 +202,598 @@ static BYTE encodeDataSample[] = { 0x7d, 0x8f, 0x72, 0x42, 0x39, 0xb0, 0x1c, 0x65, 0x18, 0x23, 0x8b, 0x60, 0x30, 0x00, /* FRAME_END as in 4.2.3 */ - 0xc5, 0xcc, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00 -}; - -static UINT32 refImage[] = { /* 4.2.4.4 Inverse Color Conversion */ - 0x00229cdf, 0x00249de0, 0x00259fe2, 0x002ca5e8, 0x00229cdf, 0x00229ce0, 0x00239de0, 0x00229ce0, - 0x00229cdf, 0x00229cdf, 0x00239ce0, 0x00249ce0, 0x00249ce0, 0x00219ce3, 0x001e9ce6, 0x00209ae2, - 0x002299dd, 0x002199de, 0x00209adf, 0x00209ae0, 0x001f9be0, 0x001e9ae0, 0x001d99e0, 0x001c98e0, - 0x001b97df, 0x001e96dc, 0x002194d9, 0x001f93dd, 0x001d93e0, 0x001b94dc, 0x001895d8, 0x001c92db, - 0x00208fde, 0x001b91de, 0x001693df, 0x001793df, 0x001992df, 0x001891df, 0x00178fdf, 0x00178edf, - 0x00168dde, 0x00158cdd, 0x00148cdc, 0x00128cda, 0x00118cd9, 0x00118bd9, 0x00128ada, 0x001289da, - 0x001288db, 0x001187da, 0x001186da, 0x001085da, 0x000f85d9, 0x000f84d9, 0x000e83d9, 0x000d82d8, - 0x000d82d8, 0x000d81d8, 0x000d80d7, 0x000d7fd7, 0x000d7ed6, 0x000d7ed6, 0x000d7ed6, 0x000d7ed6, - 0x00259fe1, 0x0027a1e2, 0x0029a2e3, 0x002ba4e6, 0x00249fe1, 0x00249fe1, 0x00249fe1, 0x00249ee1, - 0x00239ee1, 0x00249ee1, 0x00249ee1, 0x00259de1, 0x00259de2, 0x00249de2, 0x00229de2, 0x00229ce1, - 0x00229bdf, 0x00219ce0, 0x00209ce1, 0x00209ce2, 0x00209ce2, 0x00209ae0, 0x002199de, 0x001f99df, - 0x001d98e0, 0x001e97e0, 0x001f97e0, 0x001d96df, 0x001c95de, 0x001c94e0, 0x001c94e1, 0x001d93e1, - 0x001d92e0, 0x001b93de, 0x001a94dc, 0x001a93de, 0x001a93e0, 0x001992e0, 0x001891df, 0x00188fdf, - 0x00178edf, 0x00168ede, 0x00158edd, 0x00148ddc, 0x00138ddb, 0x00138cdb, 0x00138bdb, 0x00128adb, - 0x001289db, 0x001288db, 0x001187db, 0x001186db, 0x001085db, 0x000f84da, 0x000e83d9, 0x000e83d9, - 0x000e83d9, 0x000e82d9, 0x000e81d8, 0x000e80d8, 0x000d7fd7, 0x000d7fd7, 0x000d7fd7, 0x000d7fd7, - 0x0027a3e3, 0x002aa4e3, 0x002ea6e3, 0x002aa4e3, 0x0026a2e3, 0x0026a1e3, 0x0025a1e3, 0x0025a0e3, - 0x0025a0e3, 0x0025a0e3, 0x00259fe3, 0x00269fe3, 0x00269ee4, 0x00279ee1, 0x00279edf, 0x00259ee0, - 0x00239ee1, 0x00219ee2, 0x00209ee4, 0x00209de4, 0x00219de3, 0x00229be0, 0x002499dc, 0x002299de, - 0x001f98e0, 0x001d99e4, 0x001b9ae7, 0x001c98e2, 0x001c96dc, 0x001e94e3, 0x002092ea, 0x001d94e6, - 0x001a96e2, 0x001c96de, 0x001d95da, 0x001c94de, 0x001b94e1, 0x001a93e0, 0x001a92e0, 0x001991e0, - 0x001890e0, 0x001790df, 0x00178fde, 0x00168fde, 0x00158edd, 0x00148ddd, 0x00138cdc, 0x00138bdc, - 0x00128adc, 0x001289dc, 0x001188dc, 0x001187dd, 0x001086dd, 0x000f85db, 0x000e83d9, 0x000e84da, - 0x000f84da, 0x000e83da, 0x000e82d9, 0x000e81d9, 0x000e80d8, 0x000e80d8, 0x000e80d8, 0x000e80d8, - 0x002aa7e5, 0x002da7e4, 0x0031a8e3, 0x002ca6e3, 0x0027a4e4, 0x0027a3e4, 0x0027a3e4, 0x0027a3e4, - 0x0026a2e4, 0x0026a2e4, 0x0027a1e5, 0x0027a0e5, 0x0027a0e6, 0x0026a0e5, 0x0025a0e4, 0x00259fe4, - 0x00259ee3, 0x00239ee5, 0x00229fe6, 0x00229fe5, 0x00229fe4, 0x0013a5e6, 0x001b9fe8, 0x0016a0e8, - 0x0011a0e7, 0x00129fef, 0x00139ef7, 0x001b99ec, 0x00179ae2, 0x00149ce4, 0x001d98e5, 0x001c97e6, - 0x001b96e7, 0x001c98dc, 0x001d97df, 0x001c96e1, 0x001c94e2, 0x001b94e1, 0x001b93e1, 0x001a93e0, - 0x001a92e0, 0x001991e0, 0x001890e0, 0x001790df, 0x00168fdf, 0x00158ede, 0x00158dde, 0x00148cdd, - 0x00138bdc, 0x00128add, 0x001289dd, 0x001188de, 0x001187de, 0x000f85dc, 0x000d83da, 0x000f85db, - 0x001086db, 0x000f84db, 0x000f83da, 0x000e82da, 0x000e81da, 0x000e81da, 0x000e81da, 0x000e81da, - 0x002caae7, 0x0030aae5, 0x0034abe3, 0x002ea8e4, 0x0029a6e5, 0x0028a6e5, 0x0028a5e5, 0x0028a5e5, - 0x0028a5e6, 0x0028a4e6, 0x0028a3e7, 0x0028a2e7, 0x0028a1e8, 0x0025a2e9, 0x0023a3ea, 0x0025a0e8, - 0x00279ee6, 0x00259fe7, 0x0023a0e9, 0x0018a4f5, 0x000ea7ff, 0x001ba6de, 0x00558ebb, 0x006f839c, - 0x0089797e, 0x008d797c, 0x00917979, 0x007f7b94, 0x005687af, 0x00229bd6, 0x0004a4fd, 0x00109df4, - 0x001c97eb, 0x001c9ada, 0x001c98e4, 0x001c97e3, 0x001d95e2, 0x001c95e2, 0x001c94e2, 0x001c94e1, - 0x001b94e1, 0x001a93e1, 0x001a92e1, 0x001991e1, 0x001890e1, 0x00178fe0, 0x00158edf, 0x00148dde, - 0x00138cdd, 0x00128bde, 0x00128adf, 0x001289df, 0x001188e0, 0x000f85dd, 0x000d83da, 0x000f85db, - 0x001187dd, 0x001086dc, 0x000f84dc, 0x000e83db, 0x000e81db, 0x000e81db, 0x000e81db, 0x000e81db, - 0x0030abe5, 0x0036afe8, 0x0034abe4, 0x002faae5, 0x002ba8e6, 0x0036aee8, 0x0026a6e8, 0x0029a7e7, - 0x002ca8e7, 0x002da7e6, 0x002fa5e5, 0x002ca5e7, 0x0029a4e9, 0x002ba5e5, 0x002ca5e2, 0x0010aaef, - 0x0013adf6, 0x0023a3f8, 0x006091a5, 0x00a6755d, 0x00ec5915, 0x00ff490c, 0x00fa5504, 0x00ff590f, - 0x00ff5d1b, 0x00ff6116, 0x00fa6412, 0x00ff550f, 0x00ff4b0d, 0x00fb4918, 0x00f54823, 0x008e737e, - 0x00269eda, 0x0006a2ff, 0x001d97e2, 0x001799ea, 0x001c97e4, 0x001a98e4, 0x001898e4, 0x001a96e3, - 0x001b95e3, 0x001a94e2, 0x001a93e0, 0x001992e1, 0x001891e2, 0x001790e1, 0x00168fe0, 0x00158fdf, - 0x00138ede, 0x00138ddf, 0x00138ce0, 0x00128be0, 0x001189e0, 0x001087de, 0x000f85db, 0x00138ae0, - 0x000f87dc, 0x000f86dc, 0x000f85dc, 0x000f84dc, 0x000e83db, 0x000e83db, 0x000e83db, 0x000e83db, - 0x0034abe2, 0x003cb4ec, 0x0034ace5, 0x0031abe6, 0x002daae8, 0x0044b6eb, 0x0024a7ea, 0x0029aaea, - 0x002face9, 0x0032a9e6, 0x0035a7e3, 0x0030a7e6, 0x002ba8ea, 0x0025aaf0, 0x0020adf6, 0x004d8ba7, - 0x00b8674c, 0x00ff5510, 0x00f7650c, 0x00f86313, 0x00fa611b, 0x00f0671f, 0x00fc6222, 0x00fb6926, - 0x00f96f29, 0x00f67122, 0x00f3721b, 0x00f26b20, 0x00f16424, 0x00ff5622, 0x00ff531f, 0x00ff4b17, - 0x00ff440e, 0x00b1615b, 0x001f95e0, 0x00129bf0, 0x001c9ae5, 0x00189ae6, 0x00159be7, 0x001898e6, - 0x001b95e5, 0x001b95e2, 0x001995e0, 0x001994e1, 0x001892e2, 0x001792e1, 0x001691e0, 0x001590df, - 0x00148fdf, 0x00148fe0, 0x00148fe1, 0x00128de1, 0x00108be0, 0x001189de, 0x001186dd, 0x00178fe4, - 0x000e87db, 0x000e87dc, 0x000f87dd, 0x000f85dc, 0x000e84dc, 0x000e84dc, 0x000e84dc, 0x000e84dc, - 0x0036b1eb, 0x0036b4f0, 0x002eafed, 0x002caeec, 0x002aadec, 0x0041b4ef, 0x0029abe9, 0x002cabe8, - 0x002fabe7, 0x0031abe6, 0x0032aae6, 0x002faae7, 0x002ca9e8, 0x0025a7eb, 0x00946a5f, 0x00ff3e06, - 0x00f95618, 0x00e27312, 0x00f87329, 0x00f77427, 0x00f77626, 0x00f27628, 0x00f8712b, 0x00f9772e, - 0x00f97e30, 0x00f77f2e, 0x00f5812b, 0x00f57b2c, 0x00f5752d, 0x00fd6a2b, 0x00fb652a, 0x00f65e2c, - 0x00f1572e, 0x00ff4810, 0x00ff460f, 0x00817680, 0x0002a7f1, 0x002496ea, 0x00199be4, 0x001b98e4, - 0x001d96e5, 0x001b96e2, 0x001a96e0, 0x001995e1, 0x001794e3, 0x001793e2, 0x001692e1, 0x001691e0, - 0x001590df, 0x001591e1, 0x001591e3, 0x00138fe1, 0x00108ce0, 0x00128be0, 0x00158ae0, 0x00168de2, - 0x000f89dd, 0x000f88dd, 0x000f88dd, 0x000f86dd, 0x000f85dc, 0x000f85dc, 0x000f85dc, 0x000f85dc, - 0x005fc1e7, 0x0057bee8, 0x004fbbe9, 0x004ebae6, 0x004ebae3, 0x0051b6ee, 0x002eaee8, 0x002eade6, - 0x002fabe5, 0x002face7, 0x002eade9, 0x002eace7, 0x002daae5, 0x0015b2ff, 0x00ec4310, 0x00f15016, - 0x00f75d1c, 0x00f87123, 0x00f9862a, 0x00f6882d, 0x00f48b31, 0x00f48532, 0x00f47f33, 0x00f78535, - 0x00fa8c37, 0x00f88e39, 0x00f7903a, 0x00f88b38, 0x00f98635, 0x00f87e35, 0x00f77635, 0x00f76d34, - 0x00f76532, 0x00f85e31, 0x00f95730, 0x00ff5125, 0x00f65237, 0x0003a5fd, 0x001e9be1, 0x001e98e3, - 0x001f96e5, 0x001c97e2, 0x001a97df, 0x001896e1, 0x001795e4, 0x001794e3, 0x001793e2, 0x001692e1, - 0x001692e0, 0x001693e2, 0x001794e4, 0x001391e2, 0x000f8ee0, 0x00148ee1, 0x00198ee3, 0x00148ce1, - 0x000f8bde, 0x000f8ade, 0x000f89de, 0x000f88dd, 0x000f86dd, 0x000f86dd, 0x000f86dd, 0x000f86dd, - 0x003cb6ee, 0x0036b4ef, 0x0030b2f0, 0x0030b1ee, 0x002fb1ec, 0x0038b0ef, 0x002eaee9, 0x002faee8, - 0x0031ade6, 0x002fafe8, 0x002eb1ea, 0x0031adec, 0x0029afee, 0x0030aac8, 0x00ff3d05, 0x00fa501a, - 0x00f96021, 0x00f87428, 0x00f7882f, 0x00fa9638, 0x00f59b38, 0x00f5973b, 0x00f6923e, 0x00f89440, - 0x00fa9742, 0x00fa9a44, 0x00fa9d46, 0x00f99845, 0x00f89444, 0x00f98d43, 0x00fa8641, 0x00f97d3f, - 0x00f9743d, 0x00f77039, 0x00f56d35, 0x00ff6122, 0x00bf6c63, 0x00129eef, 0x00229ae8, 0x001c99ed, - 0x00179ce4, 0x001498f0, 0x001b94e1, 0x001a96e2, 0x001998e3, 0x001897e4, 0x001896e5, 0x001895e4, - 0x001993e2, 0x001792e1, 0x001590df, 0x001692e2, 0x001793e5, 0x001490e4, 0x00128ee2, 0x00118de3, - 0x00108de3, 0x00118bde, 0x001289d9, 0x000f88e2, 0x000c89dd, 0x001085e0, 0x000987e4, 0x000987e4, - 0x0040b5e9, 0x003bb4e9, 0x0037b2ea, 0x0037b2e9, 0x0038b1e8, 0x0033b0ea, 0x002eaeeb, 0x0030afe9, - 0x0033afe8, 0x0030b2ea, 0x002eb5ec, 0x0034aff2, 0x0025b4f7, 0x008d7f86, 0x00f64f00, 0x00ed5c1e, - 0x00fa6326, 0x00f7762d, 0x00f58a35, 0x00fea242, 0x00f7ab3f, 0x00f7a843, 0x00f7a548, 0x00f9a34a, - 0x00faa24c, 0x00fba64f, 0x00fcaa52, 0x00f9a652, 0x00f7a252, 0x00fa9c50, 0x00fd974e, 0x00fc8d4b, - 0x00fb8348, 0x00f68341, 0x00f1823a, 0x00f5732c, 0x00718cac, 0x00179af0, 0x002599ef, 0x002697e9, - 0x00269bc6, 0x001696f1, 0x001d91e3, 0x001c96e3, 0x001b9be3, 0x001a99e6, 0x001998e9, 0x001b97e7, - 0x001c95e5, 0x001891df, 0x00138dda, 0x001992e2, 0x001e98ea, 0x001592e6, 0x000b8de2, 0x000e8ee5, - 0x00108fe9, 0x00128cdf, 0x001489d4, 0x000e88e6, 0x00088cdc, 0x001184e4, 0x000488ec, 0x000488ec, - 0x003eb6ea, 0x003bb5eb, 0x0038b4eb, 0x0038b4eb, 0x0038b3eb, 0x0035b2eb, 0x0033b1ec, 0x0034b1eb, - 0x0035b1ea, 0x0032b3e9, 0x0030b5e9, 0x0034b0f0, 0x0023b6f8, 0x00c56044, 0x00f9540c, 0x00f26322, - 0x00f77029, 0x00f77d2f, 0x00f78b35, 0x00fba142, 0x00f6b046, 0x00fbb44f, 0x00f7b051, 0x00f9af54, - 0x00fbad56, 0x00fcb25a, 0x00feb75d, 0x00fab35f, 0x00f6b061, 0x00faac5d, 0x00fda95a, 0x00fb9f55, - 0x00f99551, 0x00f7914b, 0x00f68d45, 0x00ff7e23, 0x001ba5f0, 0x00129ef4, 0x002896f1, 0x00239fb1, - 0x006c9600, 0x003c9c82, 0x00179ef8, 0x00169cf4, 0x00149de3, 0x00169ae5, 0x001897e7, 0x001995e6, - 0x001a93e5, 0x001993e3, 0x001793e0, 0x001c98e6, 0x001a95e5, 0x001692e5, 0x00138fe5, 0x00138ceb, - 0x00138be3, 0x000087e4, 0x00007cf5, 0x001a86d3, 0x000d8cf1, 0x00008fe2, 0x000d85ea, 0x000886f1, - 0x003cb7ec, 0x003bb7ed, 0x003ab6ed, 0x0039b6ed, 0x0038b5ed, 0x0037b5ed, 0x0037b4ed, 0x0037b3ed, - 0x0036b3ec, 0x0034b4e9, 0x0031b5e5, 0x0035b1ef, 0x0021b8fa, 0x00fd4203, 0x00fc581e, 0x00f86a26, - 0x00f47c2d, 0x00f78431, 0x00f98c36, 0x00f8a041, 0x00f6b54d, 0x00fec05b, 0x00f6bc5a, 0x00f8ba5d, - 0x00fbb861, 0x00fdbe65, 0x00ffc469, 0x00fbc16c, 0x00f5bd70, 0x00fabc6b, 0x00febb66, 0x00fab160, - 0x00f6a75a, 0x00f89f55, 0x00fa984f, 0x00df956f, 0x0008a6fc, 0x00259ddb, 0x00159ff3, 0x004aa172, - 0x0069a90d, 0x0062a406, 0x005a981b, 0x0034969b, 0x000e99ff, 0x001297f2, 0x001695e4, 0x001793e5, - 0x001892e5, 0x001995e6, 0x001a98e7, 0x00209deb, 0x001593df, 0x001892e4, 0x001a91e9, 0x002095eb, - 0x00259dd1, 0x00d0f772, 0x00c1f396, 0x000083f1, 0x001782a0, 0x003c7e2f, 0x001787cc, 0x000b8ada, - 0x003db9ed, 0x003cb8ed, 0x003bb8ed, 0x003ab7ed, 0x0039b7ed, 0x0039b7ed, 0x0039b6ed, 0x003ab6ed, - 0x003ab6ed, 0x0037b4ed, 0x0034b2ec, 0x0035abf3, 0x006e96b3, 0x00ff4601, 0x00f86520, 0x00f67329, - 0x00f58131, 0x00f78b37, 0x00f9953e, 0x00f8a649, 0x00f8b854, 0x00fcc260, 0x00f8c465, 0x00f9c36a, - 0x00fac26e, 0x00fac773, 0x00facb77, 0x00fbcb7b, 0x00fccb7e, 0x00fac87b, 0x00f8c578, 0x00f9bc72, - 0x00fbb46d, 0x00f6b069, 0x00feaa57, 0x0094a0a5, 0x0013a1f3, 0x00219df0, 0x00199eff, 0x0071c124, - 0x0079b826, 0x0072b21e, 0x006aaa24, 0x0067a125, 0x00649a19, 0x00419d72, 0x001f9fcb, 0x001994ff, - 0x001399f1, 0x00199cf4, 0x001ea0f8, 0x001b9cff, 0x001193f6, 0x001293f1, 0x001393ec, 0x000083ff, - 0x0072cca0, 0x00cbf982, 0x00d0ffac, 0x0079a046, 0x00337700, 0x003a7c03, 0x000d8de2, 0x000d8edb, - 0x003fbbee, 0x003ebaed, 0x003db9ed, 0x003cb9ed, 0x003bb8ed, 0x003bb8ed, 0x003cb9ee, 0x003cb9ee, - 0x003db9ef, 0x003ab4f1, 0x0037aff3, 0x0032b3fe, 0x00b48f7d, 0x00ff5907, 0x00f37122, 0x00f57c2b, - 0x00f68735, 0x00f7923d, 0x00f89d45, 0x00f9ac50, 0x00f9bb5a, 0x00f9c465, 0x00facd71, 0x00facd76, - 0x00facd7b, 0x00f7cf80, 0x00f4d286, 0x00fcd689, 0x00ffd98c, 0x00fbd48b, 0x00f3cf8a, 0x00f9c885, - 0x00ffc17f, 0x00f5c27d, 0x00ffbc5e, 0x0048abdc, 0x001e9deb, 0x001ea2e8, 0x001da8e5, 0x0099d31c, - 0x008acb22, 0x0082c427, 0x007abc2c, 0x0075b429, 0x0070ad25, 0x006dab17, 0x006ba908, 0x005ea912, - 0x00519f54, 0x00489b6d, 0x003e9887, 0x003b9592, 0x00389880, 0x00449663, 0x00509446, 0x0083b43c, - 0x004f851b, 0x00afe187, 0x009fcc83, 0x00368011, 0x0043821c, 0x0032853c, 0x000492f9, 0x001092dd, - 0x0040bcee, 0x003fbcee, 0x003ebbee, 0x003dbaed, 0x003cbaed, 0x003cb9ed, 0x003cb9ec, 0x003cb9ec, - 0x003cb8ec, 0x003fb4f0, 0x0043aff5, 0x000ebbe9, 0x00ffb897, 0x00f7814d, 0x00f57623, 0x00f6812e, - 0x00f88c39, 0x00f89943, 0x00f8a64d, 0x00f8b257, 0x00f9bd60, 0x00fac96d, 0x00fbd47b, 0x00fad681, - 0x00fad788, 0x00fbd98e, 0x00fbda93, 0x00fae5a1, 0x00fed692, 0x00fadea0, 0x00f9db98, 0x00fad694, - 0x00fbd090, 0x00ffd285, 0x00ffc778, 0x00009afd, 0x0026a8f2, 0x0020a4f8, 0x0053bea5, 0x00a4da31, - 0x009dd638, 0x0097d03a, 0x0091ca3d, 0x008bc539, 0x0085c035, 0x007dbe31, 0x0074bc2d, 0x0076b81c, - 0x0077b027, 0x0072ab25, 0x006da724, 0x006ba328, 0x0068a31f, 0x0058951a, 0x0078b745, 0x00bbf181, - 0x0073ad4c, 0x00417c15, 0x00508b1e, 0x0043861c, 0x00498614, 0x0017868b, 0x000b90f6, 0x00168ee8, - 0x0042beef, 0x0041bdee, 0x0040bcee, 0x003fbced, 0x003ebbed, 0x003dbaec, 0x003db9eb, 0x003cb8ea, - 0x003bb7e9, 0x0039b9f0, 0x0037bbf7, 0x0050b5dc, 0x00ff9744, 0x00fec49d, 0x00f87a24, 0x00f88530, - 0x00f9913d, 0x00f8a049, 0x00f7af55, 0x00f8b85d, 0x00f9c065, 0x00face75, 0x00fcdb85, 0x00fbde8d, - 0x00fae195, 0x00fee29b, 0x00ffe2a0, 0x00fbe9a4, 0x00ffbe6b, 0x00fdde9f, 0x00ffe8a6, 0x00fbe3a3, - 0x00f8dea0, 0x00fdd899, 0x00b6bdab, 0x00119ff1, 0x001ea4e9, 0x001a9fff, 0x0089d465, 0x00b0e245, - 0x00b0e04e, 0x00acdc4e, 0x00a7d94e, 0x00a1d649, 0x009ad345, 0x0097ce3d, 0x0094c935, 0x008dc534, - 0x0086c133, 0x007bbc32, 0x006fb731, 0x006db330, 0x006cae2e, 0x007eba3f, 0x0070a531, 0x007bb54f, - 0x00579a20, 0x005c9f2b, 0x00519425, 0x0080b965, 0x00609a1d, 0x000390e3, 0x00118ef2, 0x001c89f2, - 0x0044c0ef, 0x0043bfef, 0x0042beee, 0x0040bdee, 0x003fbcee, 0x003fbbed, 0x0040baeb, 0x003eb9ed, - 0x003cb9ee, 0x0037b9eb, 0x0027bcf7, 0x00949c8f, 0x00fb9637, 0x00f9bc7c, 0x00f9b585, 0x00f7994a, - 0x00f69b43, 0x00f6a64e, 0x00f7b259, 0x00f8bc66, 0x00fac672, 0x00fad380, 0x00fae08d, 0x00f9e698, - 0x00f9eba2, 0x00feeaa6, 0x00ffeaab, 0x00fcefa9, 0x00faba62, 0x00fbdc99, 0x00fff4b9, 0x00fbecb2, - 0x00f7e6ab, 0x00ffe5a3, 0x0064b1d1, 0x00199ff0, 0x00269fe9, 0x000499f2, 0x00e3f051, 0x00d5ef58, - 0x00c0e364, 0x00bde165, 0x00bae065, 0x00b5de5d, 0x00b0dc56, 0x00aad74e, 0x00a3d346, 0x009bd043, - 0x0093cd3f, 0x008cc93e, 0x0084c63c, 0x0081c139, 0x007dbc36, 0x008bc746, 0x0089c245, 0x0063a02c, - 0x0065aa2c, 0x005ea42d, 0x00509626, 0x00a4cf98, 0x00d9eadd, 0x00b9ddff, 0x00389ef4, 0x00008fd4, - 0x0046c1ef, 0x0044c0ef, 0x0043bfef, 0x0042beef, 0x0040bdef, 0x0042bced, 0x0043baec, 0x0040baf0, - 0x003dbaf4, 0x0035b8e7, 0x0017bdf7, 0x00d97f50, 0x00f79147, 0x00f7a554, 0x00ffdbba, 0x00f8a24d, - 0x00f3a549, 0x00f5ad53, 0x00f7b55e, 0x00f9c16f, 0x00fbcc7f, 0x00f9d88a, 0x00f8e595, 0x00f8eda2, - 0x00f8f5ae, 0x00fff3b2, 0x00fff2b6, 0x00fef5ae, 0x00f4b659, 0x00f9db93, 0x00feffcd, 0x00fbf6c1, - 0x00f7edb6, 0x00fff2ac, 0x0013a4f7, 0x0016a5f0, 0x0018a5e8, 0x0056b4cd, 0x00f1f271, 0x00d5ef84, - 0x00cfe67b, 0x00cde77c, 0x00cbe77c, 0x00c9e672, 0x00c7e567, 0x00bce15f, 0x00b1dd57, 0x00a9dc51, - 0x00a0da4b, 0x009dd749, 0x009ad447, 0x0094cf43, 0x008fcb3f, 0x0088c43c, 0x0082be39, 0x0072b430, - 0x0063a928, 0x0059a028, 0x004e9827, 0x00a0c479, 0x00fffbf7, 0x007fd3f5, 0x00038fe2, 0x000e89e2, - 0x0048c3ef, 0x0046c2ef, 0x0045c1f0, 0x0043c0f0, 0x0042bff0, 0x0042beee, 0x0043bdec, 0x0041bcef, - 0x003fbcf2, 0x002fc0fe, 0x0036bdfc, 0x00f54c00, 0x00ff8a52, 0x00faa65e, 0x00fdc48e, 0x00fbc185, - 0x00f5ae50, 0x00f7b65e, 0x00f9be6c, 0x00fac978, 0x00fbd485, 0x00fede98, 0x00ffe8aa, 0x00fdeeae, - 0x00f9f5b2, 0x00fcf6ba, 0x00fff7c2, 0x00fcf0b2, 0x00f7cc6e, 0x00fbde91, 0x00fdfcca, 0x00fffbd1, - 0x00fffdc8, 0x00cae4c8, 0x0016a1f2, 0x001da4ef, 0x0012a1f1, 0x009fd5b9, 0x00eaf28c, 0x00dcf095, - 0x00d9eb90, 0x00d9ec93, 0x00d9ec95, 0x00d6eb8c, 0x00d4ea83, 0x00c9e779, 0x00bfe36f, 0x00b8e368, - 0x00b1e262, 0x00afe05e, 0x00addf5a, 0x00a3d952, 0x0099d449, 0x008ecb41, 0x0084c33a, 0x0075b833, - 0x0066ac2c, 0x005da329, 0x00559927, 0x004b9421, 0x002499b9, 0x001593fe, 0x000993d8, 0x000f90d8, - 0x004ac5ef, 0x0048c4f0, 0x0046c2f0, 0x0045c1f1, 0x0043c0f1, 0x0043bfef, 0x0043bfed, 0x0042beee, - 0x0041bdf0, 0x0038bbf0, 0x0072a1b8, 0x00ff5d1e, 0x00f97931, 0x00f5a151, 0x00f9ad61, 0x00fee0bd, - 0x00f8b758, 0x00fabf69, 0x00fcc87a, 0x00fcd282, 0x00fcdc8b, 0x00fbde8f, 0x00fbe193, 0x00fbeba4, - 0x00fbf5b5, 0x00faf8c2, 0x00f9fcce, 0x00f9ecb7, 0x00fae183, 0x00fee290, 0x00fbfac8, 0x00fdf8d8, - 0x00fffccb, 0x008bcedc, 0x00189fee, 0x0025a3ee, 0x000b9dfb, 0x00e8f6a5, 0x00e4f1a6, 0x00e4f0a6, - 0x00e4efa6, 0x00e5f1aa, 0x00e6f2ad, 0x00e3f1a6, 0x00e0ef9e, 0x00d7ec93, 0x00cde987, 0x00c8ea80, - 0x00c2eb78, 0x00c1ea73, 0x00c0e96e, 0x00b1e360, 0x00a3dd53, 0x0094d247, 0x0086c83b, 0x0078bc35, - 0x0069b030, 0x0062a52b, 0x005b9b27, 0x0057920a, 0x000995fc, 0x000d96e5, 0x001091eb, 0x001091eb, - 0x004ac5f0, 0x0049c4f0, 0x0047c3f1, 0x0045c2f1, 0x0044c1f2, 0x0041c1f2, 0x003fc1f2, 0x003fbff1, - 0x003fbcf0, 0x0032c3fe, 0x00be7f6e, 0x00fe6526, 0x00f67b35, 0x00f59a4d, 0x00f8ab5c, 0x00fbd0a0, - 0x00f7c783, 0x00fec16b, 0x00fdd17f, 0x00fbdb87, 0x00f9e590, 0x00f8ed9a, 0x00f7f4a5, 0x00fbea9a, - 0x00ffdf8e, 0x00fce3a0, 0x00f7e6b1, 0x00fceecc, 0x00fffbcb, 0x00fff3c7, 0x00fcf1c3, 0x00fef5d2, - 0x00fffcd3, 0x004bb5e7, 0x0021a5ed, 0x001ca2ee, 0x003daae2, 0x00eef6ac, 0x00e6f2b1, 0x00e8f2b5, - 0x00e9f3b8, 0x00eaf4ba, 0x00ebf5bc, 0x00e8f3b6, 0x00e6f2af, 0x00e0f0a8, 0x00dbeea2, 0x00d6ef9a, - 0x00d1f092, 0x00c9ed82, 0x00c1eb73, 0x00b0e362, 0x00a1dc51, 0x0094d347, 0x0088ca3e, 0x007bbf38, - 0x006eb433, 0x0066a92e, 0x005da01b, 0x003d9448, 0x000a93f6, 0x000e94ec, 0x001193f0, 0x001193f0, - 0x004bc5f1, 0x004ac5f1, 0x0048c4f1, 0x0047c3f2, 0x0045c3f2, 0x0040c3f4, 0x003bc4f6, 0x003cbff3, - 0x003ebbf0, 0x002dcaff, 0x00ff5d25, 0x00fe6d2f, 0x00f37d39, 0x00f59348, 0x00f8a958, 0x00f7c083, - 0x00f7d7ae, 0x00ffc36d, 0x00ffda84, 0x00fbe48c, 0x00f7ee94, 0x00f8ed9e, 0x00faeca7, 0x00f9f1b4, - 0x00f8f6c1, 0x00fcf6c8, 0x00fff6d0, 0x00fef2d3, 0x00fcf4ba, 0x00fffee8, 0x00f7fdea, 0x00fdfde3, - 0x00fffcdc, 0x000b9df1, 0x002aaaed, 0x001baaf6, 0x0080c8da, 0x00fdffbb, 0x00e8f2bd, 0x00ebf4c4, - 0x00eff7cb, 0x00eff7cb, 0x00eff7cb, 0x00edf6c5, 0x00ebf5c0, 0x00eaf4be, 0x00e8f3bd, 0x00e4f4b4, - 0x00e0f6ab, 0x00d0f191, 0x00c1ec77, 0x00b0e463, 0x009edb4e, 0x0095d448, 0x008bcc42, 0x007fc23b, - 0x0073b935, 0x006aac31, 0x0060a510, 0x00229687, 0x000b91f1, 0x000e93f3, 0x001294f5, 0x001294f5, - 0x004cc6f1, 0x004bc5f2, 0x0049c5f2, 0x0047c4f2, 0x0046c4f2, 0x0043c4f1, 0x0040c4f0, 0x0042c0f3, - 0x0039c1f6, 0x005eacca, 0x00fb591e, 0x00f36e31, 0x00f88135, 0x00fb923f, 0x00fbaf5e, 0x00ffc373, - 0x00fde2ba, 0x00ffcd75, 0x00ffd372, 0x00ffe584, 0x00fff796, 0x00fef4a2, 0x00fdf1ae, 0x00fff8c2, - 0x00fcf8cd, 0x00fef8d2, 0x00fff9d6, 0x00fef6e1, 0x00fcf5dd, 0x00fffbee, 0x00fbfce8, 0x00fffce0, - 0x00b2e0e8, 0x0019a4f0, 0x0026abec, 0x0016a8f6, 0x00c2e4d8, 0x00f9fac5, 0x00eff6cb, 0x00f0f7ce, - 0x00f1f8d2, 0x00f1f8d1, 0x00f2f9d1, 0x00f1f9cd, 0x00f1f9ca, 0x00f2fbca, 0x00f4fdca, 0x00e7f8b6, - 0x00daf3a2, 0x00cbef8a, 0x00bcec71, 0x00b0e661, 0x00a5e151, 0x009ad949, 0x008fd240, 0x0083c73b, - 0x0077bc35, 0x006ab31d, 0x005ea905, 0x00138dea, 0x001193ef, 0x001093f0, 0x000f93f0, 0x000f93f0, - 0x004dc6f2, 0x004cc6f2, 0x004ac5f3, 0x0048c5f3, 0x0047c5f3, 0x0046c4ef, 0x0046c4eb, 0x0048c0f3, - 0x0034c7fb, 0x00989591, 0x00fc6428, 0x00f1773b, 0x00fc8432, 0x00ff9135, 0x00ffb564, 0x00ffbe5a, - 0x00f3ddb6, 0x00ccd097, 0x00b4cea5, 0x00b0d3b1, 0x00abd7bd, 0x00c3e1bf, 0x00daebc1, 0x00f5fdc7, - 0x00ffffbd, 0x00fffecd, 0x00fffcdc, 0x00fffce0, 0x00fbfce5, 0x00fdfbe6, 0x00fffae7, 0x00fffbdd, - 0x0061c4f4, 0x0026aaee, 0x0022abec, 0x0010a7f6, 0x00ffffd7, 0x00f5f5d0, 0x00f6fad9, 0x00f4f9d9, - 0x00f2f9da, 0x00f3fad8, 0x00f4fbd7, 0x00f5fcd5, 0x00f7fdd4, 0x00f3face, 0x00f0f7c8, 0x00e2f4b0, - 0x00d4f199, 0x00c5ee82, 0x00b7eb6b, 0x00b1e95f, 0x00abe754, 0x009fdf49, 0x0094d83f, 0x0087cc3a, - 0x007bc034, 0x006bb425, 0x005ba332, 0x000495f9, 0x001795ee, 0x001293ed, 0x000c91eb, 0x000c91eb, - 0x004fc8f3, 0x004dc8f3, 0x004cc8f4, 0x004bc8f4, 0x0049c8f4, 0x0047c5f2, 0x0045c2ef, 0x0042c2f8, - 0x0034c8ff, 0x00df6746, 0x00ff632a, 0x00ff701b, 0x00e18b53, 0x00a4a185, 0x0063c1cd, 0x0026c0ff, - 0x002ab8ff, 0x0025b5f1, 0x0027b7f9, 0x0026b5f6, 0x0023b3f2, 0x0024b5fa, 0x0025b7ff, 0x00189ddf, - 0x0043bbf4, 0x009edae8, 0x00f9f9dc, 0x00f3fbe6, 0x00ffffea, 0x00fdffe6, 0x00fafce2, 0x00ffffff, - 0x001ea8ef, 0x001ca8f1, 0x001ba8f2, 0x005bc4f1, 0x00ffffe7, 0x00fbf9e1, 0x00fbfce3, 0x00f8fbe0, - 0x00f5fadd, 0x00f5fbdb, 0x00f5fbda, 0x00f6fcd7, 0x00f6fdd3, 0x00f0f8c9, 0x00ebf4be, 0x00dff2a9, - 0x00d4f094, 0x00c7f47b, 0x00baf862, 0x00b0ef58, 0x00a6e64e, 0x00a3e248, 0x0098d73a, 0x008acd38, - 0x007bc435, 0x0070b821, 0x003b9c84, 0x000d93f4, 0x001394ed, 0x001193e9, 0x000f92e6, 0x000f92e6, - 0x0050c9f4, 0x004fcaf4, 0x004ecaf5, 0x004dcaf5, 0x004ccaf6, 0x0048c5f4, 0x0045c0f3, 0x0047c2ef, - 0x004ac4eb, 0x00ff521f, 0x00a79a92, 0x0051b7e6, 0x0028c7ff, 0x002cc4f9, 0x0031c1f1, 0x003fbbf0, - 0x0037c0ef, 0x0039b9f0, 0x003bb3f1, 0x0038b5f4, 0x0036b7f7, 0x0032b9f0, 0x002fbbe8, 0x002fb8eb, - 0x002fb5ed, 0x0020acf3, 0x0010a3fa, 0x0070c9f3, 0x00f5f9df, 0x00f6fbde, 0x00f6fdde, 0x00d8ebe4, - 0x0011a5ee, 0x002db2f5, 0x0014a5f8, 0x00a5e2ec, 0x00fffff8, 0x00fffef3, 0x00fffded, 0x00fcfde6, - 0x00f8fce0, 0x00f7fcde, 0x00f6fcdd, 0x00f6fcd8, 0x00f5fdd3, 0x00edf7c4, 0x00e5f1b4, 0x00e5f5b8, - 0x00e4f9bb, 0x00ecfed2, 0x00f3ffe9, 0x00edfedb, 0x00e8f9cd, 0x00caef89, 0x009cd636, 0x0084c72e, - 0x006bb826, 0x006cb315, 0x001a95d6, 0x001591ef, 0x001093eb, 0x001193e6, 0x001294e1, 0x001294e1, - 0x0052cbf4, 0x0050caf4, 0x004ecaf4, 0x004ccaf3, 0x004ac9f3, 0x0048c8f5, 0x0046c7f6, 0x0040bfed, - 0x0041bfeb, 0x0041d4f9, 0x0033c9fc, 0x002fc9ff, 0x0042c3ec, 0x0040c3f4, 0x003ec3fc, 0x0035bbf4, - 0x0033bbf3, 0x0049bdf7, 0x0039b7f9, 0x0037b7f6, 0x0035b7f2, 0x002eb5f4, 0x0028b3f5, 0x002fbbf8, - 0x002fbaf2, 0x0030b5f2, 0x0031b0f1, 0x001facf6, 0x000dabed, 0x007fd2ed, 0x00ffffe6, 0x0080d9d2, - 0x002faaf8, 0x001dafec, 0x0003aae6, 0x00fff8ff, 0x00fffffe, 0x00fffff9, 0x00fffdf4, 0x00fdfeeb, - 0x00fbfee3, 0x00f9fde1, 0x00f7fce0, 0x00f5fdd8, 0x00f4fdcf, 0x00f5fce2, 0x00f6fde8, 0x00f3fde8, - 0x00f1fde9, 0x00ebfdd3, 0x00e6fdbe, 0x00e0f8ba, 0x00daf2b7, 0x00eafcd2, 0x00f2fde6, 0x00b7de8d, - 0x0084c73d, 0x009ab848, 0x0014a1f9, 0x000494f3, 0x001094ef, 0x001095ec, 0x001095e9, 0x001095e9, - 0x0054ccf5, 0x0051cbf4, 0x004ecaf3, 0x004cc9f2, 0x0049c8f1, 0x0048cbf5, 0x0048cef9, 0x0040c4f3, - 0x0049cafc, 0x0040c2f1, 0x0047caf5, 0x0046c7f4, 0x0046c4f3, 0x0039b5ee, 0x002ca5e8, 0x002eb1e1, - 0x0056c1ea, 0x006dc9e9, 0x0037c2e5, 0x0051caeb, 0x006bd2f1, 0x0074d1f5, 0x007dcff9, 0x0056c7f8, - 0x001fafe8, 0x0025b1ee, 0x002cb3f4, 0x003eb5f9, 0x002bb3ee, 0x001baff5, 0x0032b5f0, 0x003fb2f9, - 0x0026a9f2, 0x001faeeb, 0x003fb8f4, 0x00fcfff3, 0x00ffffff, 0x00ffffff, 0x00fffefb, 0x00fefff1, - 0x00feffe6, 0x00fbffe5, 0x00f8fde3, 0x00f5fdd7, 0x00f3fecb, 0x00f5fbeb, 0x00f7feee, 0x00f2fdde, - 0x00edfccf, 0x00e3f9b0, 0x00d9f692, 0x00d2f48b, 0x00ccf184, 0x00ceee97, 0x00d0eaa9, 0x00daebc1, - 0x00f4fbe9, 0x007fc679, 0x005ac1ff, 0x001aa1eb, 0x001195f2, 0x000f96f2, 0x000e97f2, 0x000e97f2, - 0x0054cdf5, 0x0052ccf4, 0x004fcbf3, 0x004dc9f3, 0x004ac8f2, 0x0049c6f2, 0x0047c4f2, 0x0049d2f3, - 0x0046c8f3, 0x004dc5fc, 0x002c9add, 0x001883cd, 0x00046cbe, 0x000080c5, 0x000f96d4, 0x002eaddb, - 0x0060c6eb, 0x0076cdef, 0x0051caea, 0x0069d2f0, 0x0081daf5, 0x009ae4f7, 0x00b3eff9, 0x00cffaff, - 0x00e3feff, 0x009ae1ff, 0x0048bcf7, 0x0011b5dd, 0x0032aef0, 0x0028acfc, 0x0031b2f3, 0x0034b1f6, - 0x0025adf0, 0x0026acf6, 0x0098d1fc, 0x00fffdf8, 0x00ffffff, 0x00fffffb, 0x00fefff4, 0x00fdffee, - 0x00fcfde7, 0x00fbfee4, 0x00faffe0, 0x00f8fde7, 0x00f7fcef, 0x00f3fbeb, 0x00effdd9, 0x00e9fbc2, - 0x00e3f9ac, 0x00d9f49b, 0x00ceef8b, 0x00c1ea76, 0x00b4e562, 0x00abdd5a, 0x00a2d261, 0x00c1e98e, - 0x00dbe8b9, 0x0096d4ff, 0x008ed0fa, 0x0042aeee, 0x001095f1, 0x001096f1, 0x000f96f1, 0x000f96f1, - 0x0055cef5, 0x0053ccf4, 0x0050cbf4, 0x004ecaf4, 0x004cc8f4, 0x0051caf7, 0x0057cbfa, 0x0045c0ea, - 0x001a75c7, 0x000058ad, 0x00015bb4, 0x00066fc0, 0x000b84cd, 0x000093ce, 0x0011a7e0, 0x003eb9e6, - 0x006bcbeb, 0x007ed1f6, 0x006cd3f0, 0x0082dbf4, 0x0098e3f9, 0x00a5ecf7, 0x00b2f4f5, 0x00c7f7f9, - 0x00ddfafd, 0x00f2ffff, 0x00f8fff6, 0x00bcebfe, 0x0022b4f2, 0x0029afff, 0x002fb0f7, 0x0029b1f2, - 0x0023b1ee, 0x001aa7fa, 0x00cae6f4, 0x00f7f8f4, 0x00feffff, 0x00fefff7, 0x00feffed, 0x00fcffeb, - 0x00fbfae9, 0x00fbfee3, 0x00fbffdc, 0x00fbffe9, 0x00fbfff7, 0x00f1fedd, 0x00e7fbc3, 0x00e0f6b4, - 0x00d8f0a5, 0x00ceec94, 0x00c4e884, 0x00b8e678, 0x00ace36c, 0x00a0df53, 0x0094d455, 0x0080bd41, - 0x00d2e599, 0x002ca1f4, 0x0030a2f6, 0x00209cf3, 0x001096f1, 0x001096f1, 0x001096f1, 0x001096f1, - 0x0055cef4, 0x0053cdf4, 0x0051cbf5, 0x0050cbf5, 0x004ecaf6, 0x004dc9f4, 0x0054d0fa, 0x002b86ce, - 0x000752b1, 0x00045fb9, 0x000a74c9, 0x000882ce, 0x000691d4, 0x0002a0d5, 0x0024b5e7, 0x004cc4ea, - 0x0074d3ee, 0x0083d9f5, 0x007fddf4, 0x0093e4f6, 0x00a8ecf9, 0x00b6f2f9, 0x00c3f9f9, 0x00d3fafb, - 0x00e3fcfc, 0x00edfefb, 0x00f0f9f3, 0x00ffffff, 0x00fffdff, 0x007edcef, 0x0026adfd, 0x002aaff7, - 0x002db2f2, 0x0034b1e0, 0x0009a7f7, 0x008dd3f5, 0x00fdfbf9, 0x00fffff6, 0x00fdffeb, 0x00fcffe6, - 0x00fcfce0, 0x00f9fcde, 0x00f7fcdd, 0x00fcffef, 0x00f9fdec, 0x00e8f5d0, 0x00dff5bd, 0x00d9f1ad, - 0x00d2ed9d, 0x00c5e97e, 0x00b8e26d, 0x00abdd5e, 0x009fd74f, 0x0098c95f, 0x0092c735, 0x008bc942, - 0x0080b34d, 0x00009bf2, 0x001894f8, 0x001595f5, 0x001397f2, 0x001296f1, 0x001195f0, 0x001195f0, - 0x0056cff4, 0x0054cdf5, 0x0052ccf5, 0x0051cbf7, 0x0051cbf9, 0x0049c8f1, 0x0051d5fa, 0x001662c1, - 0x00005cbb, 0x000874cd, 0x00037cce, 0x00028dd4, 0x00019edb, 0x0009aedc, 0x0037c2ee, 0x005acfef, - 0x007edcf0, 0x0088e1f4, 0x0092e6f8, 0x00a5eef8, 0x00b9f5f9, 0x00c7f9fb, 0x00d5fdfe, 0x00dffdfc, - 0x00e9fdfa, 0x00f0fefe, 0x00f8ffff, 0x00fafffe, 0x00fdfffc, 0x00fdfbff, 0x001db0e8, 0x002ab1ee, - 0x0037b2f5, 0x0025b9f7, 0x0029b4f8, 0x0022aff5, 0x001baaf2, 0x009fd7f6, 0x00fdffea, 0x00fcfee0, - 0x00fcfdd7, 0x00f8fada, 0x00f4f7dd, 0x00fdfef5, 0x00f6fae1, 0x00dfecc3, 0x00d8efb6, 0x00d2eca6, - 0x00ccea95, 0x00bce567, 0x00abdb56, 0x009fd344, 0x0092cb33, 0x0085c824, 0x0079b46a, 0x003a9eaf, - 0x000c97ff, 0x001994f9, 0x000f9bee, 0x00139af0, 0x001699f3, 0x001497f1, 0x001295ef, 0x001295ef, - 0x0058d0f5, 0x0056cef5, 0x0053cdf4, 0x0053ccf6, 0x0052cbf8, 0x0053d6fb, 0x004fc8fc, 0x00004cad, - 0x00096fca, 0x000b80d4, 0x000588d5, 0x000598db, 0x0005a8e1, 0x0018b6e6, 0x003fc8f2, 0x0063d3f3, - 0x0086dff5, 0x0091e4f7, 0x009ce9fa, 0x00aef0f9, 0x00c0f7f9, 0x00cbfafb, 0x00d7fdfd, 0x00defdfc, - 0x00e6fefb, 0x00f0fffe, 0x00faffff, 0x00f2fefb, 0x00fefffd, 0x00c6e9fb, 0x001eb0ec, 0x0030b4f6, - 0x0030b7f8, 0x0019a8f7, 0x0026b0f0, 0x0022aef3, 0x001eabf5, 0x0027aafa, 0x001ca6f6, 0x007dcdea, - 0x00dff4dd, 0x00eaffb0, 0x00fdfeed, 0x00ffffef, 0x00fcf9d3, 0x00edeeb4, 0x00e6e9ac, 0x00d9e68a, - 0x00cbe367, 0x00b9e153, 0x00a6dd4d, 0x0075c57f, 0x0043adb0, 0x00229bf3, 0x000a9cff, 0x000998f6, - 0x00109cef, 0x00189aee, 0x00149ded, 0x00159bf0, 0x001599f2, 0x001397f0, 0x001195ee, 0x001195ee, - 0x005ad1f6, 0x0057cff5, 0x0054cef4, 0x0054cdf6, 0x0053cbf8, 0x004dd3f4, 0x002c9add, 0x00045ec1, - 0x000572c9, 0x000683d2, 0x000794dc, 0x0008a2e2, 0x0008b1e8, 0x0028bfef, 0x0048cef6, 0x006bd8f8, - 0x008fe3fa, 0x009be8fa, 0x00a6edfb, 0x00b7f3fb, 0x00c7f9fa, 0x00d0fbfc, 0x00d9fdfd, 0x00defefd, - 0x00e2fffc, 0x00effffe, 0x00fcffff, 0x00ebfef7, 0x00fffffe, 0x008fd7f8, 0x001eb0f1, 0x002eb0f6, - 0x0018abec, 0x00e0f7fd, 0x0024ade9, 0x0023acf1, 0x0021acf8, 0x0026aef7, 0x002cb0f6, 0x001aa9f5, - 0x0008a3f4, 0x0022a7f9, 0x004cc2f2, 0x006dcdef, 0x007ec9db, 0x007fcac2, 0x0081c6c6, 0x0061bccb, - 0x0041b3d0, 0x0024a7e9, 0x00089bff, 0x00119dff, 0x001a9fff, 0x000f99e9, 0x00149cf9, 0x00159cf7, - 0x00159cf5, 0x00179df1, 0x00199eed, 0x00179cef, 0x001599f1, 0x001397ef, 0x001195ed, 0x001195ed, - 0x005cd2f6, 0x0059d0f5, 0x0055cff3, 0x0054cdf5, 0x0053ccf8, 0x0051d5f6, 0x00167bcf, 0x000467c6, - 0x00067bcf, 0x00068bd7, 0x00059cdf, 0x0008a9e5, 0x000ab6eb, 0x002bc4f1, 0x004cd2f7, 0x006ddbf9, - 0x008ee5fa, 0x009deafb, 0x00aceffb, 0x00bdf5fb, 0x00cefbfa, 0x00d5fbfc, 0x00dcfcfd, 0x00dcfefd, - 0x00ddfffd, 0x00e4fffd, 0x00eafffd, 0x00fffffe, 0x00ffffff, 0x0027c0de, 0x0026b5f6, 0x001fb0f9, - 0x004dc6ff, 0x00fff9ef, 0x00fefffa, 0x008bd8f7, 0x0018a7f3, 0x001daaf4, 0x0023acf6, 0x0022acf3, - 0x0022abf0, 0x001aa3f2, 0x001aa6ee, 0x0018a8f5, 0x000ea2f3, 0x0011a4f2, 0x0014a4ff, 0x0015a3fc, - 0x0016a3fa, 0x0017a2f3, 0x0019a2ec, 0x000e99fe, 0x00169bed, 0x0000a1ff, 0x002b9de8, 0x0061b5b0, - 0x00109af7, 0x00149cf2, 0x00189eed, 0x00169cef, 0x00149af0, 0x001298ee, 0x001096ec, 0x001096ec, - 0x005fd3f7, 0x005bd2f5, 0x0056d0f3, 0x0055cef5, 0x0053cdf7, 0x0056d8f8, 0x00005cc0, 0x000370cb, - 0x000785d6, 0x000594dc, 0x0004a3e2, 0x0008afe8, 0x000cbcee, 0x002ec8f3, 0x0050d5f9, 0x006fdefa, - 0x008de7fb, 0x009fecfb, 0x00b1f2fb, 0x00c3f7fb, 0x00d4fcfa, 0x00d9fcfc, 0x00defcfd, 0x00dbfdfd, - 0x00d9fffd, 0x00d9fdfb, 0x00d9fcfa, 0x00e5fafa, 0x00a4eaf7, 0x002badfb, 0x002fb9fa, 0x001aaeed, - 0x0099dbf8, 0x00ffffff, 0x00fefdfc, 0x00fffefd, 0x00fffffd, 0x008cd4fa, 0x0019a9f6, 0x0018a9f7, - 0x0016aaf9, 0x001aa7f3, 0x001ea5ee, 0x001fa7f2, 0x0021a9f6, 0x001ea7f7, 0x001ba5f7, 0x0017a4f9, - 0x0012a2fb, 0x000b9dfd, 0x000399fe, 0x0026a2fa, 0x006fc0b0, 0x00cfca5e, 0x00ffe528, 0x0074b4b3, - 0x000b98fa, 0x00119af4, 0x00179dee, 0x00159cee, 0x00139aef, 0x001198ed, 0x000f96eb, 0x000f96eb, - 0x005dd1f6, 0x005bd2f5, 0x0058d2f4, 0x0053cef4, 0x0056d2fb, 0x0040b2e6, 0x000164c6, 0x000376cf, - 0x000487d7, 0x000296dd, 0x0001a4e4, 0x0004b1ea, 0x0007bdf1, 0x001bc8f2, 0x0043d5fc, 0x0064ddfb, - 0x0085e6fb, 0x0098ebfc, 0x00acf1fd, 0x00bef9ff, 0x00cfffff, 0x00cffdff, 0x00cff9fb, 0x00d2fefe, - 0x00d5ffff, 0x00c6f9ff, 0x00b8efff, 0x005ad7d9, 0x0040b9e9, 0x002fb9ff, 0x002bb2f0, 0x0028afeb, - 0x00def0f2, 0x00ffffff, 0x00feffff, 0x00fffefe, 0x00fffefa, 0x00fffffa, 0x00fffff9, 0x00c2e8f0, - 0x0084cde7, 0x0053bbe9, 0x0022a9eb, 0x0014a1ff, 0x00069ff8, 0x000fa0f8, 0x0019a3eb, 0x0043b1e1, - 0x006ec2c9, 0x00b0d79a, 0x00f2eb6b, 0x00ebee32, 0x00f8e647, 0x00ffe23a, 0x00fde142, 0x000098f4, - 0x0019a1fc, 0x00169ef7, 0x00129bf1, 0x00139af1, 0x00149af0, 0x001298ee, 0x001096ec, 0x001096ec, - 0x005ccff6, 0x005bd2f6, 0x005ad4f6, 0x0052cdf2, 0x005ad6fe, 0x00298cd5, 0x00026ccc, 0x00027bd2, - 0x000189d8, 0x000097df, 0x0000a6e6, 0x0000b2ed, 0x0002bef4, 0x0009c7f1, 0x0035d5ff, 0x0059ddfd, - 0x007ce5fb, 0x0091eafd, 0x00a6f0ff, 0x00b1f2ff, 0x00bbf5ff, 0x00bef5fc, 0x00c1f6f9, 0x00c1f7f7, - 0x00c1f9f4, 0x00c7fdfc, 0x00cdffff, 0x00c2f9f8, 0x005acdf4, 0x0039b1f3, 0x0038baf5, 0x002ab4f7, - 0x00fcfbf8, 0x00fdfeff, 0x00feffff, 0x00fffeff, 0x00fffcf6, 0x00fdfef2, 0x00f7ffee, 0x00fcffea, - 0x00ffffe5, 0x00ffffd8, 0x00ffffcb, 0x00fffbf1, 0x00ffffdf, 0x00fdfdc2, 0x00f7ff88, 0x00fbfe92, - 0x00ffff7f, 0x00fdfc6c, 0x00faf759, 0x00f8f059, 0x00f7e958, 0x00f7e359, 0x00d0d368, 0x000998ff, - 0x00189aef, 0x00129af2, 0x000c99f5, 0x001199f3, 0x001599f2, 0x001397f0, 0x001195ee, 0x001195ee, - 0x005fd2f9, 0x005cd3f8, 0x0059d4f6, 0x0058d3f8, 0x005edaff, 0x001971cd, 0x00026ecd, 0x00037bd3, - 0x000488d9, 0x000497e0, 0x0005a6e6, 0x0001ade7, 0x0000b5e8, 0x0007beea, 0x0023cbf5, 0x004cd7f8, - 0x0074e4fc, 0x0089e8fd, 0x009fecfe, 0x00a5edfe, 0x00abeffe, 0x00aeeffc, 0x00b0eff9, 0x00b3f3f9, - 0x00b6f6f8, 0x00b6f9fc, 0x00b5fcff, 0x00daf3ff, 0x001ab9f1, 0x0028b3f4, 0x002bb3f6, 0x0073cef4, - 0x00fdfdf5, 0x00fdfefa, 0x00fdfffe, 0x00fffef9, 0x00fffdf3, 0x00fdfeee, 0x00faffe9, 0x00fdffe4, - 0x00ffffde, 0x00ffffd0, 0x00ffffc2, 0x00fdfad7, 0x00fffcf3, 0x00ffffc0, 0x00fcfbc5, 0x00fcff84, - 0x00fcfb8b, 0x00fbf67a, 0x00f9f269, 0x00f7ed5e, 0x00f4e954, 0x00f7e948, 0x0087bda9, 0x00109afc, - 0x00179cf2, 0x00149bf1, 0x00119af1, 0x001399f2, 0x001698f3, 0x001496f1, 0x001294ef, 0x001294ef, - 0x0062d4fc, 0x005dd4f9, 0x0059d4f6, 0x0056d1f6, 0x0053cef5, 0x00014ebe, 0x00026fcd, 0x00057bd4, - 0x000787da, 0x000996e0, 0x000ca5e7, 0x000bb0e9, 0x0009bbeb, 0x0015c5f3, 0x0021d0fc, 0x0046dafc, - 0x006ce3fc, 0x0082e6fd, 0x0097e9fe, 0x0099e9fe, 0x009ce8fe, 0x009ee9fb, 0x00a0e9f9, 0x00a6eefa, - 0x00acf3fc, 0x00b0effc, 0x00b5ecfb, 0x0089ddf9, 0x0028b4f3, 0x003ebef7, 0x001eadf7, 0x00bde8f0, - 0x00fefff2, 0x00fefff3, 0x00fdfff4, 0x00fefef2, 0x00fefef0, 0x00fefeea, 0x00fefee4, 0x00fefede, - 0x00fefed8, 0x00fcffc9, 0x00fbffba, 0x00f6fea0, 0x00ffffce, 0x00fff9f6, 0x00ffffc9, 0x00fdf7be, - 0x00f8f87a, 0x00f9f66b, 0x00f9f35c, 0x00f5ee56, 0x00f1e84f, 0x00f8ee37, 0x003fa7ea, 0x00189df5, - 0x00179df4, 0x00169cf1, 0x00159bee, 0x00169af2, 0x001798f5, 0x001596f3, 0x001394f1, 0x001394f1, - 0x0066d7fc, 0x005fd1f5, 0x0060d4f6, 0x0059d8f9, 0x00399ddb, 0x000858be, 0x00096ccd, 0x000c7ad2, - 0x001087d7, 0x001296df, 0x0013a6e8, 0x0013b0eb, 0x001bc3f5, 0x000fc8f3, 0x0017d0f9, 0x0027d3f4, - 0x004bd7f7, 0x0061dbf8, 0x0077def9, 0x007fe0fa, 0x0088e1fa, 0x008de4fb, 0x0091e7fb, 0x0096eafc, - 0x009aedfd, 0x009feafb, 0x00a3e7fa, 0x005eccfb, 0x002db7f5, 0x0024b8f9, 0x0014b1f5, 0x00fffbff, - 0x00feffec, 0x00ffffed, 0x00ffffee, 0x00ffffec, 0x00fefdeb, 0x00fefde4, 0x00fefddd, 0x00fefed6, - 0x00fefece, 0x00fcfdc1, 0x00fcfcb5, 0x00f6fb8d, 0x00f8fc8a, 0x00f8facc, 0x00f8fef2, 0x00f9ffbe, - 0x00fbf9c2, 0x00fbf8ac, 0x00fcf796, 0x00faf491, 0x00f7f18d, 0x00ffe5a9, 0x000096f7, 0x00089af7, - 0x00159ef7, 0x00169df4, 0x00169cf0, 0x00169bf2, 0x001699f4, 0x001497f3, 0x001396f1, 0x001396f1, - 0x006bd9fb, 0x0061cef1, 0x0067d3f7, 0x005cdefd, 0x001f6cc0, 0x000f63bf, 0x000f6acd, 0x001478d1, - 0x001887d4, 0x001997df, 0x001aa6e9, 0x0014a9e4, 0x001dbbef, 0x000dbeeb, 0x0023c5f6, 0x0013c6ed, - 0x002acbf3, 0x0040cff4, 0x0056d4f4, 0x0065d7f6, 0x0074daf7, 0x007bdffb, 0x0083e5fe, 0x0086e6fe, - 0x0089e8fd, 0x008ee5fb, 0x0092e2fa, 0x0033bcfc, 0x0032b9f7, 0x0031bafd, 0x0057c5f7, 0x00f4ffde, - 0x00fdffe7, 0x00ffffe7, 0x00ffffe7, 0x00ffffe6, 0x00fdfce6, 0x00fdfddd, 0x00fdfdd5, 0x00fdfdcd, - 0x00fefdc5, 0x00fdfaba, 0x00fcf8af, 0x00fef99f, 0x00fffb8e, 0x00fafe77, 0x00f4fb7d, 0x00f9f8d2, - 0x00fdffee, 0x00fefedf, 0x00fffcd0, 0x00fefacd, 0x00fdf9ca, 0x00a6d3ce, 0x000399eb, 0x001ea1ec, - 0x00149ffa, 0x00159ef6, 0x00179ef2, 0x00169cf3, 0x00159af3, 0x001499f2, 0x001398f1, 0x001398f1, - 0x0055d4f4, 0x005bd1f1, 0x0069d6f6, 0x006ee2ff, 0x000c50a8, 0x001161be, 0x000f6acd, 0x001f83d6, - 0x001f89dc, 0x000f8cdd, 0x001a9be0, 0x0022b1f4, 0x001dabe1, 0x0014aedf, 0x0026bdee, 0x0015bae7, - 0x001fc1ef, 0x0025c7ef, 0x002bcdef, 0x003dcdf1, 0x004ecef3, 0x005bd6f9, 0x0068defe, 0x006eddfc, - 0x0073ddfb, 0x0076ddf5, 0x0070d3f7, 0x0031bafb, 0x0033b9f6, 0x0024b6ff, 0x00a4dee5, 0x00f9ffdc, - 0x00fdfedc, 0x00ffffdc, 0x00ffffdc, 0x00fefedb, 0x00fcfdda, 0x00fdfdd2, 0x00fdfdcb, 0x00fdfdc3, - 0x00fefdbc, 0x00fdfbaf, 0x00fcfaa2, 0x00fdfb93, 0x00fefb83, 0x00fcfd6b, 0x00f9fc60, 0x00fbf85d, - 0x00fdf74c, 0x00fef576, 0x00fff2a1, 0x00f6ec87, 0x00f8e360, 0x0051bbb4, 0x000d9afe, 0x001a9ef7, - 0x00159ef6, 0x00159df4, 0x00159df2, 0x00149bf2, 0x001299f2, 0x001299f2, 0x001299f2, 0x001299f2, - 0x0067d4fd, 0x0069d6f9, 0x006cd9f5, 0x004fb7dc, 0x001953af, 0x001c67c6, 0x00005abd, 0x001a7eca, - 0x00157bd4, 0x000581dc, 0x002aa1e7, 0x000189d3, 0x002dabe3, 0x0023a7dc, 0x0029b4e6, 0x0017ade1, - 0x0014b7ec, 0x0015b9ea, 0x0016bbe9, 0x001fbfec, 0x0028c2ef, 0x003bcdf7, 0x004ed8ff, 0x0056d5fb, - 0x005dd2f8, 0x005ed6f0, 0x004ec5f4, 0x002fb9fa, 0x0035b8f4, 0x0017b1ff, 0x00f0f7d2, 0x00feffda, - 0x00fdfcd2, 0x00fdfdd1, 0x00fdfed1, 0x00fdfecf, 0x00fcfecd, 0x00fcfdc7, 0x00fdfdc0, 0x00fdfdb9, - 0x00fdfdb2, 0x00fdfca4, 0x00fdfc95, 0x00fdfc87, 0x00fdfc79, 0x00fdfa6c, 0x00fef85f, 0x00f9f645, - 0x00f6ef47, 0x00f2e938, 0x00efe428, 0x00eee425, 0x00ffdd05, 0x000399ff, 0x0017a1f5, 0x00179ef4, - 0x00169cf3, 0x00159cf3, 0x00149cf3, 0x00129bf1, 0x001099f0, 0x00119af1, 0x00129bf2, 0x00129bf2, - 0x0066d5fb, 0x0070d5fc, 0x0078e2ff, 0x003b86c7, 0x00235fba, 0x001e6aba, 0x00227ad1, 0x002787d8, - 0x00248cd7, 0x001d8dd4, 0x002189d1, 0x002ca1ea, 0x002296d5, 0x0031aaef, 0x0020a1db, 0x0017a1dd, - 0x000ea1e0, 0x001aace3, 0x0013b1eb, 0x0010b8ed, 0x000dc0ef, 0x001cc1ef, 0x002cc3f0, 0x0036c4f2, - 0x0040c5f4, 0x0047c9f2, 0x0045c3f6, 0x0031bafa, 0x0031b7f7, 0x004cc2f4, 0x00f5fac0, 0x00fdffc6, - 0x00fdfcc5, 0x00fdfdc4, 0x00fdfdc4, 0x00fcfdc2, 0x00fbfdc1, 0x00f8f9b6, 0x00fdfdb3, 0x00fdfdab, - 0x00fdfca3, 0x00fcfc95, 0x00fcfb88, 0x00fcfb7b, 0x00fbfb6d, 0x00fcf962, 0x00fcf757, 0x00f8f245, - 0x00f4eb41, 0x00f0e532, 0x00ebe023, 0x00fbe01c, 0x00c5d244, 0x000aa2fe, 0x00169ff9, 0x00179ff6, - 0x00189ff3, 0x00179ef2, 0x00159df2, 0x00179ff5, 0x0018a1f8, 0x00159ef5, 0x00129bf2, 0x00129bf2, - 0x0065d7fa, 0x0064d1f7, 0x005de7ff, 0x0004439b, 0x000e4ca5, 0x00317bcd, 0x000455c1, 0x000053c9, - 0x000368c6, 0x002687ca, 0x002881ca, 0x002789d1, 0x002791d7, 0x000774c9, 0x00178dcf, 0x001f9ce1, - 0x00179be4, 0x001e9eda, 0x000097de, 0x0003a5e6, 0x0008b1ee, 0x0009b0e8, 0x000aafe2, 0x0017b4e9, - 0x0024b9ef, 0x0030bdf4, 0x003cc1f9, 0x0034bcf9, 0x002cb6f9, 0x0080d2e8, 0x00fafdaf, 0x00fcfdb3, - 0x00fdfcb7, 0x00fdfcb7, 0x00fdfdb7, 0x00fcfcb6, 0x00fbfcb5, 0x00f4f4a5, 0x00fdfda5, 0x00fcfc9d, - 0x00fcfc94, 0x00fbfb87, 0x00fbfb7b, 0x00fafa6e, 0x00fafa61, 0x00faf758, 0x00faf54e, 0x00f7ee44, - 0x00f3e73a, 0x00ede12c, 0x00e7db1e, 0x00ffd21a, 0x0078b090, 0x0009a0fd, 0x00159dfd, 0x0018a0f8, - 0x001aa2f2, 0x0018a0f2, 0x00169ef2, 0x00139bf2, 0x001099f1, 0x00119af2, 0x00129bf3, 0x00129bf3, - 0x0060d4f7, 0x0067dcfd, 0x004fc2f0, 0x00002c8a, 0x002e6bc0, 0x000547ad, 0x000044ba, 0x003685c4, - 0x00064ebc, 0x001462c3, 0x002d70cb, 0x000f5ab4, 0x002274cd, 0x001169c2, 0x001979c2, 0x001d80d0, - 0x001980d7, 0x001a86d3, 0x001090de, 0x00038dda, 0x000599e6, 0x00059ce1, 0x00049edd, 0x0005a6e1, - 0x0000a7de, 0x001fb6ee, 0x0039bdf7, 0x0038bcf6, 0x0024b5fc, 0x00bfe8b9, 0x00fafea2, 0x00fbfca5, - 0x00fcfaa8, 0x00fcfca7, 0x00fdfda6, 0x00fbfca3, 0x00f9fb9f, 0x00f6f795, 0x00fafb92, 0x00fbfb8b, - 0x00fbfb85, 0x00fafa79, 0x00fafa6d, 0x00f9f961, 0x00f8f956, 0x00f9f64c, 0x00f9f442, 0x00f5ec39, - 0x00f2e531, 0x00efde28, 0x00ecd620, 0x00eed900, 0x0032a6e5, 0x0019a4ff, 0x0029a4f4, 0x0020a2f4, - 0x0018a0f5, 0x00179ef4, 0x00159df4, 0x00139bf3, 0x001199f2, 0x00129af2, 0x00129af3, 0x00129af3, - 0x005bd1f5, 0x0063dffa, 0x00318dcc, 0x00062d91, 0x000e499a, 0x0000369f, 0x00003897, 0x00155fb6, - 0x0053aad9, 0x0031a6e2, 0x0045bcef, 0x006dddff, 0x0076defa, 0x006dd9f9, 0x0064d5f9, 0x0054c5f3, - 0x0045b5ed, 0x00238ed6, 0x001277ce, 0x00006cc6, 0x000282de, 0x000187db, 0x00008dd7, 0x00079be1, - 0x000099dc, 0x0022b1f0, 0x0036baf4, 0x003cbcf4, 0x001cb5ff, 0x00fffe89, 0x00fbff96, 0x00fbfc98, - 0x00fbf99a, 0x00fcfb98, 0x00fdfd96, 0x00fafb90, 0x00f6f98a, 0x00f7f984, 0x00f8fa7f, 0x00fafa7a, - 0x00fbfb75, 0x00fafa6a, 0x00f9f960, 0x00f8f855, 0x00f7f84a, 0x00f7f540, 0x00f8f336, 0x00f4eb2f, - 0x00f0e328, 0x00f0da24, 0x00f0d121, 0x00e9ca24, 0x00049bff, 0x0020a3f6, 0x0016a1f7, 0x0016a0f7, - 0x00169ef7, 0x00159df6, 0x00149cf5, 0x00139bf4, 0x00129af3, 0x00129af3, 0x00129af3, 0x00129af3, - 0x005ae3ff, 0x0064d8ff, 0x000d4798, 0x00002682, 0x001d6bb7, 0x003aa2de, 0x005fe5ff, 0x0052d8fd, - 0x004dd6f6, 0x0048ccf5, 0x005fd0f6, 0x0068d9ff, 0x0061d3f8, 0x005bd2f8, 0x0042cbff, 0x0053cefe, - 0x0051cff5, 0x0049caf6, 0x004acdff, 0x0040baff, 0x000e7edb, 0x000069c2, 0x000584da, 0x000184d5, - 0x00068cd8, 0x0038bef8, 0x003abef7, 0x0035beff, 0x0062c7e2, 0x00fbf379, 0x00f8fa83, 0x00f9f983, - 0x00faf884, 0x00f9f77f, 0x00f7f77b, 0x00f8f979, 0x00f9fa77, 0x00f8f972, 0x00f7f86c, 0x00fcfc6c, - 0x00f9f864, 0x00f8f85b, 0x00f8f752, 0x00f7f649, 0x00f6f53f, 0x00f5f237, 0x00f4ef2f, 0x00f1e628, - 0x00eede20, 0x00ead61f, 0x00f2cc11, 0x009db96c, 0x000c9ffe, 0x001ba3f9, 0x0017a2f9, 0x0017a0f9, - 0x00169ef8, 0x00169df7, 0x00159cf6, 0x00149bf5, 0x00139af5, 0x00139af5, 0x00139af5, 0x00139af5, - 0x0060d8f9, 0x005bd9f8, 0x004cadd7, 0x0069ddff, 0x0056ddf8, 0x0055d6fc, 0x0055d0ff, 0x005cd5ff, - 0x0053cbf2, 0x004bcaf6, 0x0043cafa, 0x0047c9f8, 0x004cc8f6, 0x005ccff1, 0x0046ccf8, 0x0055caff, - 0x003ec4fa, 0x0043c3fb, 0x0048c2fd, 0x003ebff4, 0x0044ccfb, 0x0037b3fc, 0x000b7bdd, 0x00006dc9, - 0x000d80d4, 0x004eccff, 0x003ec3fa, 0x002ec2ff, 0x00a7dea8, 0x00f8ec5b, 0x00f5f570, 0x00f7f66f, - 0x00faf76e, 0x00f5f467, 0x00f1f060, 0x00f6f663, 0x00fbfc65, 0x00f8f95f, 0x00f6f659, 0x00fefe5d, - 0x00f7f652, 0x00f7f54c, 0x00f7f545, 0x00f6f33d, 0x00f6f235, 0x00f3ef2f, 0x00f1eb29, 0x00efe221, - 0x00ecd818, 0x00e5d21a, 0x00f3c700, 0x0052a9b4, 0x0014a4fb, 0x0015a3fb, 0x0017a3fc, 0x0017a1fa, - 0x00179ff8, 0x00169df8, 0x00159cf7, 0x00159bf7, 0x001499f6, 0x001499f6, 0x001499f6, 0x001499f6, - 0x0058cff2, 0x0059ddfd, 0x0055d5f9, 0x005ddeff, 0x004dcef3, 0x004dcbf3, 0x004cc8f3, 0x0056d2fc, - 0x0059d3fd, 0x0050cefb, 0x0047cafa, 0x0048c9f9, 0x0049c7f9, 0x0051cbf6, 0x0045c9f9, 0x004bc8fd, - 0x003fc5f9, 0x0041c4fa, 0x0043c2fb, 0x003bbdf3, 0x003ac0f4, 0x003ec7fc, 0x003ac6fc, 0x0025a1e3, - 0x001f8dd9, 0x0037b9f7, 0x0026bbfa, 0x002abbf4, 0x00ced857, 0x00f9fa5b, 0x00d9db49, 0x00edec58, - 0x00faf560, 0x00f2ef4d, 0x00e9ea3b, 0x00eeef46, 0x00f2f451, 0x00f9f34f, 0x00edf145, 0x00fef84b, - 0x00f4f542, 0x00f5f43d, 0x00f6f337, 0x00f5f131, 0x00f5ef2b, 0x00f2eb27, 0x00f0e622, 0x00eedb1d, - 0x00ecd117, 0x00f1cc09, 0x00f5c509, 0x000fadff, 0x0017a1f9, 0x0018a1f9, 0x0018a1f8, 0x0018a0f9, - 0x00179ff9, 0x00169df9, 0x00169cf8, 0x00159bf8, 0x001599f8, 0x001599f8, 0x001599f8, 0x001599f8, - 0x0060d5fb, 0x005bd3fb, 0x0056d2fb, 0x0055d1fc, 0x0055d0fe, 0x0054d0fa, 0x0053d1f6, 0x0051cef7, - 0x004ecbf8, 0x004dcbf9, 0x004ccafb, 0x0049c8fb, 0x0047c6fc, 0x0045c6fb, 0x0043c6fa, 0x0041c6fa, - 0x0040c7f9, 0x003fc5f9, 0x003ec3f9, 0x003fc3fb, 0x0041c4fd, 0x0038baf2, 0x0040c1f8, 0x003dc3fb, - 0x003bc5fe, 0x0037c1f6, 0x0034beef, 0x002ebcf0, 0x00ded722, 0x00bfdc38, 0x00dee142, 0x00ecea4a, - 0x00eae442, 0x00eee942, 0x00f2ee42, 0x00eeed3f, 0x00eaec3d, 0x00fbee3f, 0x00e5ec31, 0x00fff239, - 0x00f2f531, 0x00f4f32e, 0x00f5f12a, 0x00f5ee25, 0x00f4ec21, 0x00f2e71e, 0x00f0e11c, 0x00eed519, - 0x00ecc917, 0x00dec40c, 0x00bbbe39, 0x000798f8, 0x001a9ff8, 0x001a9ff7, 0x001a9ff5, 0x00189ff7, - 0x00179ff9, 0x00179ef9, 0x00169cf9, 0x00169bf9, 0x001699f9, 0x001699f9, 0x001699f9, 0x001699f9, - 0x005cd4f9, 0x0058d4f9, 0x0055d3f9, 0x0056d2fa, 0x0058d0fb, 0x0056d0f8, 0x0054d0f6, 0x0051cef7, - 0x004dccf9, 0x004ccbfa, 0x004bcafb, 0x0049c8fb, 0x0047c7fb, 0x0045c7fb, 0x0043c6fa, 0x0041c6fa, - 0x0040c6f9, 0x003fc4f9, 0x003ec3f9, 0x003ec2fa, 0x003ec2fb, 0x003abef5, 0x003ec2f8, 0x003bc1f9, - 0x0037c0f9, 0x0036beff, 0x0035bbff, 0x0067bb84, 0x00b0d219, 0x00b4d31a, 0x00d3da39, 0x00e2dd3d, - 0x00d6d532, 0x00e1df38, 0x00ece93e, 0x00e1e636, 0x00e9e536, 0x00f1e634, 0x00e5e42b, 0x00f6e62e, - 0x00e9eb29, 0x00f0ee2a, 0x00f0e824, 0x00ece420, 0x00e9e01d, 0x00ebdb1c, 0x00edd71c, 0x00e9ce19, - 0x00e5c516, 0x00e7c004, 0x006cb292, 0x00109dfc, 0x0018a1f7, 0x001aa0f5, 0x001ca0f3, 0x0019a0f6, - 0x00179ff9, 0x00169ef9, 0x00169cf9, 0x00159bf8, 0x00159af8, 0x001499f8, 0x001499f7, 0x001499f7, - 0x0058d4f6, 0x0056d4f6, 0x0054d5f7, 0x0057d3f7, 0x005bd1f8, 0x0058d0f6, 0x0054cff5, 0x0050cef8, - 0x004dcdfa, 0x004bcbfb, 0x004acafb, 0x0048c9fb, 0x0046c7fb, 0x0045c7fa, 0x0043c7fa, 0x0042c6fa, - 0x0040c6f9, 0x003fc4f9, 0x003ec3f9, 0x003dc1f9, 0x003cc0f9, 0x003cc1f8, 0x003cc2f7, 0x0038bff6, - 0x0034bbf5, 0x0035bdfd, 0x0037beff, 0x0046bcfc, 0x0082c92c, 0x00a0be02, 0x00b8c420, 0x00d8cf31, - 0x00d2d632, 0x00d4d52e, 0x00d7d42a, 0x00cdd725, 0x00e9df2f, 0x00e6dd2a, 0x00e4dc25, 0x00edd922, - 0x00e0e220, 0x00ede927, 0x00eae01e, 0x00e4da1c, 0x00ded319, 0x00e5d01a, 0x00ebcd1b, 0x00e5c818, - 0x00dec214, 0x00f0bc00, 0x001da5eb, 0x0019a1ff, 0x0016a2f7, 0x0019a2f4, 0x001ea2f1, 0x001aa0f5, - 0x00169ff9, 0x00169ef8, 0x00159df8, 0x00159cf8, 0x00149bf8, 0x00139af7, 0x001299f6, 0x001299f6, - 0x005ed5f9, 0x0063d6fc, 0x0068d6ff, 0x005fd3fc, 0x0056d0f8, 0x0053cff8, 0x0051cef8, 0x004ecdf9, - 0x004bccfb, 0x004acbfb, 0x0048cafb, 0x0047c9fa, 0x0046c8fb, 0x0044c7fa, 0x0043c7fa, 0x0042c6fa, - 0x0040c5f9, 0x003fc4f9, 0x003ec3f9, 0x003dc1f9, 0x003cc0f9, 0x003bc1f9, 0x003bc1f8, 0x0038bff7, - 0x0036bdf7, 0x0035bdfa, 0x0034bdfe, 0x0022c3f6, 0x0027bbfc, 0x0053b0b2, 0x009bc606, 0x00c1d322, - 0x00d3dd36, 0x00b4ba12, 0x00c4c71f, 0x00c5cf22, 0x00d9d82d, 0x00dfdb30, 0x00dcd52b, 0x00e8d520, - 0x00d5d51c, 0x00e8e428, 0x00ece324, 0x00d1ce1f, 0x00d3c51d, 0x00dcc302, 0x00cfc312, 0x00e3c209, - 0x00e3be00, 0x0084bf6e, 0x000ca0f6, 0x00129ffd, 0x0018a2f6, 0x0019a1f5, 0x001ba1f4, 0x0018a0f6, - 0x00169ff8, 0x00159ef8, 0x00159df8, 0x00149cf7, 0x00139bf7, 0x00129af6, 0x001098f4, 0x001098f4, - 0x0065d7fb, 0x005dd4fa, 0x0056d2f8, 0x0053d0f9, 0x0050cff9, 0x004fcef9, 0x004dcdfa, 0x004bcdfa, - 0x004accfb, 0x0048cbfb, 0x0047cafb, 0x0046c9fa, 0x0045c8fa, 0x0044c7fa, 0x0043c7fa, 0x0042c6fa, - 0x0040c5fa, 0x003fc4f9, 0x003ec3f9, 0x003dc1f9, 0x003bc0f9, 0x003ac0f9, 0x0039c0f9, 0x0038bff9, - 0x0037bff9, 0x0034bef8, 0x0031bcf7, 0x0033bbf8, 0x0035bbfa, 0x002cbcff, 0x0061c2df, 0x0093cb85, - 0x00c5d52b, 0x00cbd82f, 0x00b0bb13, 0x00b5be17, 0x00b9c21b, 0x00c7c826, 0x00c5bf21, 0x00dbc817, - 0x00cac819, 0x00dbd722, 0x00ddd61a, 0x00b7bd0d, 0x00c8bd04, 0x00d0c000, 0x00adc951, 0x006cb8b1, - 0x0004a3ff, 0x0013a4fb, 0x0021a4f5, 0x001ea3f5, 0x001aa1f6, 0x0019a1f6, 0x0018a0f7, 0x0017a0f7, - 0x00169ff8, 0x00159ef7, 0x00149ef7, 0x00139df7, 0x00139cf6, 0x00119af4, 0x000f98f2, 0x000f98f2, - 0x005cd5f9, 0x0058d3f8, 0x0053d1f8, 0x0052d0f9, 0x0050cff9, 0x004ecefa, 0x004ccdfa, 0x004accfa, - 0x0048ccfa, 0x0047cbfa, 0x0046cafa, 0x0045c9fa, 0x0044c8fa, 0x0043c7fa, 0x0042c7fa, 0x0041c6fa, - 0x0040c5fa, 0x003fc4f9, 0x003ec2f9, 0x003cc1f9, 0x003bc0f9, 0x003ac0f9, 0x0038bff9, 0x0037bff9, - 0x0036bff9, 0x0035bdf6, 0x0034bbf3, 0x0035b9f7, 0x0035b8fb, 0x0022b5ff, 0x002fb5ff, 0x004dbae6, - 0x006bbfce, 0x0027b1c5, 0x006cbc7c, 0x008abd49, 0x00a7be15, 0x00b9bf09, 0x00ccc000, 0x00dac43d, - 0x00bbca20, 0x00aec73e, 0x0099bc54, 0x005aad8b, 0x0036abc4, 0x0004b3ff, 0x0015a7ff, 0x0021a4ff, - 0x0019a0fb, 0x001ba2fa, 0x001da4f9, 0x001ba3f8, 0x001aa1f7, 0x0019a1f7, 0x0018a0f7, 0x0017a0f7, - 0x00169ff8, 0x00159ef7, 0x00149ef7, 0x00139df7, 0x00129cf6, 0x00119af5, 0x000f99f3, 0x000f99f3, - 0x0053d2f6, 0x0052d1f7, 0x0051d1f8, 0x0050d0f9, 0x004fcffa, 0x004dcefa, 0x004bcdfa, 0x0049ccfa, - 0x0047cbfa, 0x0046caf9, 0x0045caf9, 0x0044c9f9, 0x0044c8fa, 0x0043c7fa, 0x0042c6f9, 0x0041c6f9, - 0x0040c5fa, 0x003fc4f9, 0x003dc2f9, 0x003cc1f9, 0x003ac0f9, 0x0039c0f9, 0x0038bff9, 0x0036bff9, - 0x0035bef8, 0x0036bcf4, 0x0038baf0, 0x0036b8f6, 0x0034b5fc, 0x002cb6f9, 0x0023b7f6, 0x0025b5fa, - 0x0028b4ff, 0x0028b6ff, 0x0029b7ff, 0x001fb5ff, 0x0015b2ff, 0x0020aef7, 0x003cb9ff, 0x005acbf0, - 0x0042befa, 0x002ab6fc, 0x0012adff, 0x0018acfc, 0x001eacfa, 0x001ea9fd, 0x001ea7ff, 0x001ba8fa, - 0x0018a8f4, 0x0018a6f8, 0x0018a4fd, 0x0019a3fa, 0x001aa1f7, 0x0019a1f7, 0x0018a0f8, 0x0017a0f8, - 0x00169ff8, 0x00159ef7, 0x00149df7, 0x00139cf6, 0x00129bf6, 0x00119af5, 0x001099f4, 0x001099f4, - 0x0054d1f8, 0x0052d1f8, 0x0051d0f9, 0x004fcff9, 0x004ecffa, 0x004ccefa, 0x004acdf9, 0x0048ccf9, - 0x0045cbf9, 0x0045caf9, 0x0044c9f9, 0x0043c8f9, 0x0043c8f9, 0x0042c7f9, 0x0042c6f9, 0x0041c5f9, - 0x0040c5fa, 0x003fc4f9, 0x003dc2f9, 0x003bc1f9, 0x003ac0fa, 0x0038bff9, 0x0037bff9, 0x0036bef9, - 0x0034bef8, 0x0035bcf6, 0x0035baf5, 0x0034b8f8, 0x0033b6fc, 0x002eb6f9, 0x0029b6f7, 0x0029b5f8, - 0x002ab4fa, 0x002ab5fb, 0x002ab5fc, 0x002ab2f6, 0x002aafef, 0x001ba9f6, 0x009bcfd9, 0x006dcfe9, - 0x0074c7e4, 0x0080c9dd, 0x0019adfb, 0x001cacf9, 0x001fabf8, 0x001fa9f9, 0x001ea7fb, 0x001ca7f9, - 0x001aa7f6, 0x001aa5f8, 0x001aa4fb, 0x001aa3fa, 0x001aa2f8, 0x0019a1f8, 0x0018a0f8, 0x0017a0f8, - 0x00169ff8, 0x00159ef7, 0x00149df7, 0x00139cf6, 0x00129bf6, 0x00119bf5, 0x00119af5, 0x00119af5, - 0x0055d0f9, 0x0053d0fa, 0x0051d0fa, 0x004fcffa, 0x004dcffa, 0x004bcefa, 0x0049cdf9, 0x0046ccf9, - 0x0044caf8, 0x0043caf8, 0x0043c9f8, 0x0043c8f9, 0x0042c8f9, 0x0042c7f9, 0x0041c6f9, 0x0041c6f9, - 0x0040c5fa, 0x003ec3f9, 0x003dc2fa, 0x003bc1fa, 0x0039c0fa, 0x0038bff9, 0x0036bff9, 0x0035bef9, - 0x0034bdf8, 0x0033bcf9, 0x0033bafa, 0x0032b9fb, 0x0032b8fc, 0x0030b7fa, 0x002eb6f8, 0x002db5f7, - 0x002bb4f5, 0x002bb4f6, 0x002bb3f7, 0x0029b2f9, 0x0028b2fc, 0x0030b2f7, 0x0012a8fe, 0x007fd4e1, - 0x0058bbe6, 0x0015aafb, 0x001fadf8, 0x0020acf7, 0x0020aaf5, 0x001fa9f6, 0x001ea8f7, 0x001da6f7, - 0x001ca5f8, 0x001ca4f8, 0x001ba3f9, 0x001ba3f9, 0x001ba2f9, 0x0019a1f9, 0x0018a0f8, 0x0017a0f8, - 0x00169ff8, 0x00159ef7, 0x00149df7, 0x00139cf6, 0x00129bf5, 0x00129bf5, 0x00129bf5, 0x00129bf5, - 0x0055d0f9, 0x0053d0fa, 0x0051d0fa, 0x004fcffa, 0x004dcffa, 0x004bcefa, 0x0049cdf9, 0x0046ccf9, - 0x0044caf8, 0x0043caf8, 0x0043c9f8, 0x0043c8f9, 0x0042c8f9, 0x0042c7f9, 0x0041c6f9, 0x0041c6f9, - 0x0040c5fa, 0x003ec3f9, 0x003dc2fa, 0x003bc1fa, 0x0039c0fa, 0x0038bff9, 0x0036bff9, 0x0035bef9, - 0x0034bdf8, 0x0033bcf9, 0x0033bafa, 0x0032b9fb, 0x0032b8fc, 0x0030b7fa, 0x002eb6f8, 0x002db5f7, - 0x002bb4f5, 0x002bb4f6, 0x002bb3f7, 0x002ab2f8, 0x0029b2fa, 0x002db6f5, 0x001db5f6, 0x00239bff, - 0x0020b6f3, 0x000cacfb, 0x001eacf7, 0x001fabf6, 0x0020aaf5, 0x001fa9f6, 0x001ea8f7, 0x001da6f7, - 0x001ca5f8, 0x001ca4f8, 0x001ba3f9, 0x001ba3f9, 0x001ba2f9, 0x0019a1f9, 0x0018a0f8, 0x0017a0f8, - 0x00169ff8, 0x00159ef7, 0x00149df7, 0x00139cf6, 0x00129bf5, 0x00129bf5, 0x00129bf5, 0x00129bf5, - 0x0055d0f9, 0x0053d0fa, 0x0051d0fa, 0x004fcffa, 0x004dcffa, 0x004bcefa, 0x0049cdf9, 0x0046ccf9, - 0x0044caf8, 0x0043caf8, 0x0043c9f8, 0x0043c8f9, 0x0042c8f9, 0x0042c7f9, 0x0041c6f9, 0x0041c6f9, - 0x0040c5fa, 0x003ec3f9, 0x003dc2fa, 0x003bc1fa, 0x0039c0fa, 0x0038bff9, 0x0036bff9, 0x0035bef9, - 0x0034bdf8, 0x0033bcf9, 0x0033bafa, 0x0032b9fb, 0x0032b8fc, 0x0030b7fa, 0x002eb6f8, 0x002db5f7, - 0x002bb4f5, 0x002bb4f6, 0x002bb3f7, 0x002bb2f8, 0x002bb1f8, 0x0022aff9, 0x0019acfa, 0x001eadf7, - 0x0024aef3, 0x0020adf5, 0x001dabf6, 0x001fabf6, 0x0020aaf5, 0x001fa9f6, 0x001ea8f7, 0x001da6f7, - 0x001ca5f8, 0x001ca4f8, 0x001ba3f9, 0x001ba3f9, 0x001ba2f9, 0x0019a1f9, 0x0018a0f8, 0x0017a0f8, - 0x00169ff8, 0x00159ef7, 0x00149df7, 0x00139cf6, 0x00129bf5, 0x00129bf5, 0x00129bf5, 0x00129bf5, - 0x0055d0f9, 0x0053d0fa, 0x0051d0fa, 0x004fcffa, 0x004dcffa, 0x004bcefa, 0x0049cdf9, 0x0046ccf9, - 0x0044caf8, 0x0043caf8, 0x0043c9f8, 0x0043c8f9, 0x0042c8f9, 0x0042c7f9, 0x0041c6f9, 0x0041c6f9, - 0x0040c5fa, 0x003ec3f9, 0x003dc2fa, 0x003bc1fa, 0x0039c0fa, 0x0038bff9, 0x0036bff9, 0x0035bef9, - 0x0034bdf8, 0x0033bcf9, 0x0033bafa, 0x0032b9fb, 0x0032b8fc, 0x0030b7fa, 0x002eb6f8, 0x002db5f7, - 0x002bb4f5, 0x002bb4f6, 0x002bb3f7, 0x002bb2f8, 0x002bb1f8, 0x0022aff9, 0x0019acfa, 0x001eadf7, - 0x0024aef3, 0x0020adf5, 0x001dabf6, 0x001fabf6, 0x0020aaf5, 0x001fa9f6, 0x001ea8f7, 0x001da6f7, - 0x001ca5f8, 0x001ca4f8, 0x001ba3f9, 0x001ba3f9, 0x001ba2f9, 0x0019a1f9, 0x0018a0f8, 0x0017a0f8, - 0x00169ff8, 0x00159ef7, 0x00149df7, 0x00139cf6, 0x00129bf5, 0x00129bf5, 0x00129bf5, 0x00129bf5 + 0xc5, 0xcc, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00 }; +static UINT32 refImage + [] = { /* 4.2.4.4 Inverse Color Conversion */ + 0x00229cdf, 0x00249de0, 0x00259fe2, 0x002ca5e8, 0x00229cdf, 0x00229ce0, 0x00239de0, + 0x00229ce0, 0x00229cdf, 0x00229cdf, 0x00239ce0, 0x00249ce0, 0x00249ce0, 0x00219ce3, + 0x001e9ce6, 0x00209ae2, 0x002299dd, 0x002199de, 0x00209adf, 0x00209ae0, 0x001f9be0, + 0x001e9ae0, 0x001d99e0, 0x001c98e0, 0x001b97df, 0x001e96dc, 0x002194d9, 0x001f93dd, + 0x001d93e0, 0x001b94dc, 0x001895d8, 0x001c92db, 0x00208fde, 0x001b91de, 0x001693df, + 0x001793df, 0x001992df, 0x001891df, 0x00178fdf, 0x00178edf, 0x00168dde, 0x00158cdd, + 0x00148cdc, 0x00128cda, 0x00118cd9, 0x00118bd9, 0x00128ada, 0x001289da, 0x001288db, + 0x001187da, 0x001186da, 0x001085da, 0x000f85d9, 0x000f84d9, 0x000e83d9, 0x000d82d8, + 0x000d82d8, 0x000d81d8, 0x000d80d7, 0x000d7fd7, 0x000d7ed6, 0x000d7ed6, 0x000d7ed6, + 0x000d7ed6, 0x00259fe1, 0x0027a1e2, 0x0029a2e3, 0x002ba4e6, 0x00249fe1, 0x00249fe1, + 0x00249fe1, 0x00249ee1, 0x00239ee1, 0x00249ee1, 0x00249ee1, 0x00259de1, 0x00259de2, + 0x00249de2, 0x00229de2, 0x00229ce1, 0x00229bdf, 0x00219ce0, 0x00209ce1, 0x00209ce2, + 0x00209ce2, 0x00209ae0, 0x002199de, 0x001f99df, 0x001d98e0, 0x001e97e0, 0x001f97e0, + 0x001d96df, 0x001c95de, 0x001c94e0, 0x001c94e1, 0x001d93e1, 0x001d92e0, 0x001b93de, + 0x001a94dc, 0x001a93de, 0x001a93e0, 0x001992e0, 0x001891df, 0x00188fdf, 0x00178edf, + 0x00168ede, 0x00158edd, 0x00148ddc, 0x00138ddb, 0x00138cdb, 0x00138bdb, 0x00128adb, + 0x001289db, 0x001288db, 0x001187db, 0x001186db, 0x001085db, 0x000f84da, 0x000e83d9, + 0x000e83d9, 0x000e83d9, 0x000e82d9, 0x000e81d8, 0x000e80d8, 0x000d7fd7, 0x000d7fd7, + 0x000d7fd7, 0x000d7fd7, 0x0027a3e3, 0x002aa4e3, 0x002ea6e3, 0x002aa4e3, 0x0026a2e3, + 0x0026a1e3, 0x0025a1e3, 0x0025a0e3, 0x0025a0e3, 0x0025a0e3, 0x00259fe3, 0x00269fe3, + 0x00269ee4, 0x00279ee1, 0x00279edf, 0x00259ee0, 0x00239ee1, 0x00219ee2, 0x00209ee4, + 0x00209de4, 0x00219de3, 0x00229be0, 0x002499dc, 0x002299de, 0x001f98e0, 0x001d99e4, + 0x001b9ae7, 0x001c98e2, 0x001c96dc, 0x001e94e3, 0x002092ea, 0x001d94e6, 0x001a96e2, + 0x001c96de, 0x001d95da, 0x001c94de, 0x001b94e1, 0x001a93e0, 0x001a92e0, 0x001991e0, + 0x001890e0, 0x001790df, 0x00178fde, 0x00168fde, 0x00158edd, 0x00148ddd, 0x00138cdc, + 0x00138bdc, 0x00128adc, 0x001289dc, 0x001188dc, 0x001187dd, 0x001086dd, 0x000f85db, + 0x000e83d9, 0x000e84da, 0x000f84da, 0x000e83da, 0x000e82d9, 0x000e81d9, 0x000e80d8, + 0x000e80d8, 0x000e80d8, 0x000e80d8, 0x002aa7e5, 0x002da7e4, 0x0031a8e3, 0x002ca6e3, + 0x0027a4e4, 0x0027a3e4, 0x0027a3e4, 0x0027a3e4, 0x0026a2e4, 0x0026a2e4, 0x0027a1e5, + 0x0027a0e5, 0x0027a0e6, 0x0026a0e5, 0x0025a0e4, 0x00259fe4, 0x00259ee3, 0x00239ee5, + 0x00229fe6, 0x00229fe5, 0x00229fe4, 0x0013a5e6, 0x001b9fe8, 0x0016a0e8, 0x0011a0e7, + 0x00129fef, 0x00139ef7, 0x001b99ec, 0x00179ae2, 0x00149ce4, 0x001d98e5, 0x001c97e6, + 0x001b96e7, 0x001c98dc, 0x001d97df, 0x001c96e1, 0x001c94e2, 0x001b94e1, 0x001b93e1, + 0x001a93e0, 0x001a92e0, 0x001991e0, 0x001890e0, 0x001790df, 0x00168fdf, 0x00158ede, + 0x00158dde, 0x00148cdd, 0x00138bdc, 0x00128add, 0x001289dd, 0x001188de, 0x001187de, + 0x000f85dc, 0x000d83da, 0x000f85db, 0x001086db, 0x000f84db, 0x000f83da, 0x000e82da, + 0x000e81da, 0x000e81da, 0x000e81da, 0x000e81da, 0x002caae7, 0x0030aae5, 0x0034abe3, + 0x002ea8e4, 0x0029a6e5, 0x0028a6e5, 0x0028a5e5, 0x0028a5e5, 0x0028a5e6, 0x0028a4e6, + 0x0028a3e7, 0x0028a2e7, 0x0028a1e8, 0x0025a2e9, 0x0023a3ea, 0x0025a0e8, 0x00279ee6, + 0x00259fe7, 0x0023a0e9, 0x0018a4f5, 0x000ea7ff, 0x001ba6de, 0x00558ebb, 0x006f839c, + 0x0089797e, 0x008d797c, 0x00917979, 0x007f7b94, 0x005687af, 0x00229bd6, 0x0004a4fd, + 0x00109df4, 0x001c97eb, 0x001c9ada, 0x001c98e4, 0x001c97e3, 0x001d95e2, 0x001c95e2, + 0x001c94e2, 0x001c94e1, 0x001b94e1, 0x001a93e1, 0x001a92e1, 0x001991e1, 0x001890e1, + 0x00178fe0, 0x00158edf, 0x00148dde, 0x00138cdd, 0x00128bde, 0x00128adf, 0x001289df, + 0x001188e0, 0x000f85dd, 0x000d83da, 0x000f85db, 0x001187dd, 0x001086dc, 0x000f84dc, + 0x000e83db, 0x000e81db, 0x000e81db, 0x000e81db, 0x000e81db, 0x0030abe5, 0x0036afe8, + 0x0034abe4, 0x002faae5, 0x002ba8e6, 0x0036aee8, 0x0026a6e8, 0x0029a7e7, 0x002ca8e7, + 0x002da7e6, 0x002fa5e5, 0x002ca5e7, 0x0029a4e9, 0x002ba5e5, 0x002ca5e2, 0x0010aaef, + 0x0013adf6, 0x0023a3f8, 0x006091a5, 0x00a6755d, 0x00ec5915, 0x00ff490c, 0x00fa5504, + 0x00ff590f, 0x00ff5d1b, 0x00ff6116, 0x00fa6412, 0x00ff550f, 0x00ff4b0d, 0x00fb4918, + 0x00f54823, 0x008e737e, 0x00269eda, 0x0006a2ff, 0x001d97e2, 0x001799ea, 0x001c97e4, + 0x001a98e4, 0x001898e4, 0x001a96e3, 0x001b95e3, 0x001a94e2, 0x001a93e0, 0x001992e1, + 0x001891e2, 0x001790e1, 0x00168fe0, 0x00158fdf, 0x00138ede, 0x00138ddf, 0x00138ce0, + 0x00128be0, 0x001189e0, 0x001087de, 0x000f85db, 0x00138ae0, 0x000f87dc, 0x000f86dc, + 0x000f85dc, 0x000f84dc, 0x000e83db, 0x000e83db, 0x000e83db, 0x000e83db, 0x0034abe2, + 0x003cb4ec, 0x0034ace5, 0x0031abe6, 0x002daae8, 0x0044b6eb, 0x0024a7ea, 0x0029aaea, + 0x002face9, 0x0032a9e6, 0x0035a7e3, 0x0030a7e6, 0x002ba8ea, 0x0025aaf0, 0x0020adf6, + 0x004d8ba7, 0x00b8674c, 0x00ff5510, 0x00f7650c, 0x00f86313, 0x00fa611b, 0x00f0671f, + 0x00fc6222, 0x00fb6926, 0x00f96f29, 0x00f67122, 0x00f3721b, 0x00f26b20, 0x00f16424, + 0x00ff5622, 0x00ff531f, 0x00ff4b17, 0x00ff440e, 0x00b1615b, 0x001f95e0, 0x00129bf0, + 0x001c9ae5, 0x00189ae6, 0x00159be7, 0x001898e6, 0x001b95e5, 0x001b95e2, 0x001995e0, + 0x001994e1, 0x001892e2, 0x001792e1, 0x001691e0, 0x001590df, 0x00148fdf, 0x00148fe0, + 0x00148fe1, 0x00128de1, 0x00108be0, 0x001189de, 0x001186dd, 0x00178fe4, 0x000e87db, + 0x000e87dc, 0x000f87dd, 0x000f85dc, 0x000e84dc, 0x000e84dc, 0x000e84dc, 0x000e84dc, + 0x0036b1eb, 0x0036b4f0, 0x002eafed, 0x002caeec, 0x002aadec, 0x0041b4ef, 0x0029abe9, + 0x002cabe8, 0x002fabe7, 0x0031abe6, 0x0032aae6, 0x002faae7, 0x002ca9e8, 0x0025a7eb, + 0x00946a5f, 0x00ff3e06, 0x00f95618, 0x00e27312, 0x00f87329, 0x00f77427, 0x00f77626, + 0x00f27628, 0x00f8712b, 0x00f9772e, 0x00f97e30, 0x00f77f2e, 0x00f5812b, 0x00f57b2c, + 0x00f5752d, 0x00fd6a2b, 0x00fb652a, 0x00f65e2c, 0x00f1572e, 0x00ff4810, 0x00ff460f, + 0x00817680, 0x0002a7f1, 0x002496ea, 0x00199be4, 0x001b98e4, 0x001d96e5, 0x001b96e2, + 0x001a96e0, 0x001995e1, 0x001794e3, 0x001793e2, 0x001692e1, 0x001691e0, 0x001590df, + 0x001591e1, 0x001591e3, 0x00138fe1, 0x00108ce0, 0x00128be0, 0x00158ae0, 0x00168de2, + 0x000f89dd, 0x000f88dd, 0x000f88dd, 0x000f86dd, 0x000f85dc, 0x000f85dc, 0x000f85dc, + 0x000f85dc, 0x005fc1e7, 0x0057bee8, 0x004fbbe9, 0x004ebae6, 0x004ebae3, 0x0051b6ee, + 0x002eaee8, 0x002eade6, 0x002fabe5, 0x002face7, 0x002eade9, 0x002eace7, 0x002daae5, + 0x0015b2ff, 0x00ec4310, 0x00f15016, 0x00f75d1c, 0x00f87123, 0x00f9862a, 0x00f6882d, + 0x00f48b31, 0x00f48532, 0x00f47f33, 0x00f78535, 0x00fa8c37, 0x00f88e39, 0x00f7903a, + 0x00f88b38, 0x00f98635, 0x00f87e35, 0x00f77635, 0x00f76d34, 0x00f76532, 0x00f85e31, + 0x00f95730, 0x00ff5125, 0x00f65237, 0x0003a5fd, 0x001e9be1, 0x001e98e3, 0x001f96e5, + 0x001c97e2, 0x001a97df, 0x001896e1, 0x001795e4, 0x001794e3, 0x001793e2, 0x001692e1, + 0x001692e0, 0x001693e2, 0x001794e4, 0x001391e2, 0x000f8ee0, 0x00148ee1, 0x00198ee3, + 0x00148ce1, 0x000f8bde, 0x000f8ade, 0x000f89de, 0x000f88dd, 0x000f86dd, 0x000f86dd, + 0x000f86dd, 0x000f86dd, 0x003cb6ee, 0x0036b4ef, 0x0030b2f0, 0x0030b1ee, 0x002fb1ec, + 0x0038b0ef, 0x002eaee9, 0x002faee8, 0x0031ade6, 0x002fafe8, 0x002eb1ea, 0x0031adec, + 0x0029afee, 0x0030aac8, 0x00ff3d05, 0x00fa501a, 0x00f96021, 0x00f87428, 0x00f7882f, + 0x00fa9638, 0x00f59b38, 0x00f5973b, 0x00f6923e, 0x00f89440, 0x00fa9742, 0x00fa9a44, + 0x00fa9d46, 0x00f99845, 0x00f89444, 0x00f98d43, 0x00fa8641, 0x00f97d3f, 0x00f9743d, + 0x00f77039, 0x00f56d35, 0x00ff6122, 0x00bf6c63, 0x00129eef, 0x00229ae8, 0x001c99ed, + 0x00179ce4, 0x001498f0, 0x001b94e1, 0x001a96e2, 0x001998e3, 0x001897e4, 0x001896e5, + 0x001895e4, 0x001993e2, 0x001792e1, 0x001590df, 0x001692e2, 0x001793e5, 0x001490e4, + 0x00128ee2, 0x00118de3, 0x00108de3, 0x00118bde, 0x001289d9, 0x000f88e2, 0x000c89dd, + 0x001085e0, 0x000987e4, 0x000987e4, 0x0040b5e9, 0x003bb4e9, 0x0037b2ea, 0x0037b2e9, + 0x0038b1e8, 0x0033b0ea, 0x002eaeeb, 0x0030afe9, 0x0033afe8, 0x0030b2ea, 0x002eb5ec, + 0x0034aff2, 0x0025b4f7, 0x008d7f86, 0x00f64f00, 0x00ed5c1e, 0x00fa6326, 0x00f7762d, + 0x00f58a35, 0x00fea242, 0x00f7ab3f, 0x00f7a843, 0x00f7a548, 0x00f9a34a, 0x00faa24c, + 0x00fba64f, 0x00fcaa52, 0x00f9a652, 0x00f7a252, 0x00fa9c50, 0x00fd974e, 0x00fc8d4b, + 0x00fb8348, 0x00f68341, 0x00f1823a, 0x00f5732c, 0x00718cac, 0x00179af0, 0x002599ef, + 0x002697e9, 0x00269bc6, 0x001696f1, 0x001d91e3, 0x001c96e3, 0x001b9be3, 0x001a99e6, + 0x001998e9, 0x001b97e7, 0x001c95e5, 0x001891df, 0x00138dda, 0x001992e2, 0x001e98ea, + 0x001592e6, 0x000b8de2, 0x000e8ee5, 0x00108fe9, 0x00128cdf, 0x001489d4, 0x000e88e6, + 0x00088cdc, 0x001184e4, 0x000488ec, 0x000488ec, 0x003eb6ea, 0x003bb5eb, 0x0038b4eb, + 0x0038b4eb, 0x0038b3eb, 0x0035b2eb, 0x0033b1ec, 0x0034b1eb, 0x0035b1ea, 0x0032b3e9, + 0x0030b5e9, 0x0034b0f0, 0x0023b6f8, 0x00c56044, 0x00f9540c, 0x00f26322, 0x00f77029, + 0x00f77d2f, 0x00f78b35, 0x00fba142, 0x00f6b046, 0x00fbb44f, 0x00f7b051, 0x00f9af54, + 0x00fbad56, 0x00fcb25a, 0x00feb75d, 0x00fab35f, 0x00f6b061, 0x00faac5d, 0x00fda95a, + 0x00fb9f55, 0x00f99551, 0x00f7914b, 0x00f68d45, 0x00ff7e23, 0x001ba5f0, 0x00129ef4, + 0x002896f1, 0x00239fb1, 0x006c9600, 0x003c9c82, 0x00179ef8, 0x00169cf4, 0x00149de3, + 0x00169ae5, 0x001897e7, 0x001995e6, 0x001a93e5, 0x001993e3, 0x001793e0, 0x001c98e6, + 0x001a95e5, 0x001692e5, 0x00138fe5, 0x00138ceb, 0x00138be3, 0x000087e4, 0x00007cf5, + 0x001a86d3, 0x000d8cf1, 0x00008fe2, 0x000d85ea, 0x000886f1, 0x003cb7ec, 0x003bb7ed, + 0x003ab6ed, 0x0039b6ed, 0x0038b5ed, 0x0037b5ed, 0x0037b4ed, 0x0037b3ed, 0x0036b3ec, + 0x0034b4e9, 0x0031b5e5, 0x0035b1ef, 0x0021b8fa, 0x00fd4203, 0x00fc581e, 0x00f86a26, + 0x00f47c2d, 0x00f78431, 0x00f98c36, 0x00f8a041, 0x00f6b54d, 0x00fec05b, 0x00f6bc5a, + 0x00f8ba5d, 0x00fbb861, 0x00fdbe65, 0x00ffc469, 0x00fbc16c, 0x00f5bd70, 0x00fabc6b, + 0x00febb66, 0x00fab160, 0x00f6a75a, 0x00f89f55, 0x00fa984f, 0x00df956f, 0x0008a6fc, + 0x00259ddb, 0x00159ff3, 0x004aa172, 0x0069a90d, 0x0062a406, 0x005a981b, 0x0034969b, + 0x000e99ff, 0x001297f2, 0x001695e4, 0x001793e5, 0x001892e5, 0x001995e6, 0x001a98e7, + 0x00209deb, 0x001593df, 0x001892e4, 0x001a91e9, 0x002095eb, 0x00259dd1, 0x00d0f772, + 0x00c1f396, 0x000083f1, 0x001782a0, 0x003c7e2f, 0x001787cc, 0x000b8ada, 0x003db9ed, + 0x003cb8ed, 0x003bb8ed, 0x003ab7ed, 0x0039b7ed, 0x0039b7ed, 0x0039b6ed, 0x003ab6ed, + 0x003ab6ed, 0x0037b4ed, 0x0034b2ec, 0x0035abf3, 0x006e96b3, 0x00ff4601, 0x00f86520, + 0x00f67329, 0x00f58131, 0x00f78b37, 0x00f9953e, 0x00f8a649, 0x00f8b854, 0x00fcc260, + 0x00f8c465, 0x00f9c36a, 0x00fac26e, 0x00fac773, 0x00facb77, 0x00fbcb7b, 0x00fccb7e, + 0x00fac87b, 0x00f8c578, 0x00f9bc72, 0x00fbb46d, 0x00f6b069, 0x00feaa57, 0x0094a0a5, + 0x0013a1f3, 0x00219df0, 0x00199eff, 0x0071c124, 0x0079b826, 0x0072b21e, 0x006aaa24, + 0x0067a125, 0x00649a19, 0x00419d72, 0x001f9fcb, 0x001994ff, 0x001399f1, 0x00199cf4, + 0x001ea0f8, 0x001b9cff, 0x001193f6, 0x001293f1, 0x001393ec, 0x000083ff, 0x0072cca0, + 0x00cbf982, 0x00d0ffac, 0x0079a046, 0x00337700, 0x003a7c03, 0x000d8de2, 0x000d8edb, + 0x003fbbee, 0x003ebaed, 0x003db9ed, 0x003cb9ed, 0x003bb8ed, 0x003bb8ed, 0x003cb9ee, + 0x003cb9ee, 0x003db9ef, 0x003ab4f1, 0x0037aff3, 0x0032b3fe, 0x00b48f7d, 0x00ff5907, + 0x00f37122, 0x00f57c2b, 0x00f68735, 0x00f7923d, 0x00f89d45, 0x00f9ac50, 0x00f9bb5a, + 0x00f9c465, 0x00facd71, 0x00facd76, 0x00facd7b, 0x00f7cf80, 0x00f4d286, 0x00fcd689, + 0x00ffd98c, 0x00fbd48b, 0x00f3cf8a, 0x00f9c885, 0x00ffc17f, 0x00f5c27d, 0x00ffbc5e, + 0x0048abdc, 0x001e9deb, 0x001ea2e8, 0x001da8e5, 0x0099d31c, 0x008acb22, 0x0082c427, + 0x007abc2c, 0x0075b429, 0x0070ad25, 0x006dab17, 0x006ba908, 0x005ea912, 0x00519f54, + 0x00489b6d, 0x003e9887, 0x003b9592, 0x00389880, 0x00449663, 0x00509446, 0x0083b43c, + 0x004f851b, 0x00afe187, 0x009fcc83, 0x00368011, 0x0043821c, 0x0032853c, 0x000492f9, + 0x001092dd, 0x0040bcee, 0x003fbcee, 0x003ebbee, 0x003dbaed, 0x003cbaed, 0x003cb9ed, + 0x003cb9ec, 0x003cb9ec, 0x003cb8ec, 0x003fb4f0, 0x0043aff5, 0x000ebbe9, 0x00ffb897, + 0x00f7814d, 0x00f57623, 0x00f6812e, 0x00f88c39, 0x00f89943, 0x00f8a64d, 0x00f8b257, + 0x00f9bd60, 0x00fac96d, 0x00fbd47b, 0x00fad681, 0x00fad788, 0x00fbd98e, 0x00fbda93, + 0x00fae5a1, 0x00fed692, 0x00fadea0, 0x00f9db98, 0x00fad694, 0x00fbd090, 0x00ffd285, + 0x00ffc778, 0x00009afd, 0x0026a8f2, 0x0020a4f8, 0x0053bea5, 0x00a4da31, 0x009dd638, + 0x0097d03a, 0x0091ca3d, 0x008bc539, 0x0085c035, 0x007dbe31, 0x0074bc2d, 0x0076b81c, + 0x0077b027, 0x0072ab25, 0x006da724, 0x006ba328, 0x0068a31f, 0x0058951a, 0x0078b745, + 0x00bbf181, 0x0073ad4c, 0x00417c15, 0x00508b1e, 0x0043861c, 0x00498614, 0x0017868b, + 0x000b90f6, 0x00168ee8, 0x0042beef, 0x0041bdee, 0x0040bcee, 0x003fbced, 0x003ebbed, + 0x003dbaec, 0x003db9eb, 0x003cb8ea, 0x003bb7e9, 0x0039b9f0, 0x0037bbf7, 0x0050b5dc, + 0x00ff9744, 0x00fec49d, 0x00f87a24, 0x00f88530, 0x00f9913d, 0x00f8a049, 0x00f7af55, + 0x00f8b85d, 0x00f9c065, 0x00face75, 0x00fcdb85, 0x00fbde8d, 0x00fae195, 0x00fee29b, + 0x00ffe2a0, 0x00fbe9a4, 0x00ffbe6b, 0x00fdde9f, 0x00ffe8a6, 0x00fbe3a3, 0x00f8dea0, + 0x00fdd899, 0x00b6bdab, 0x00119ff1, 0x001ea4e9, 0x001a9fff, 0x0089d465, 0x00b0e245, + 0x00b0e04e, 0x00acdc4e, 0x00a7d94e, 0x00a1d649, 0x009ad345, 0x0097ce3d, 0x0094c935, + 0x008dc534, 0x0086c133, 0x007bbc32, 0x006fb731, 0x006db330, 0x006cae2e, 0x007eba3f, + 0x0070a531, 0x007bb54f, 0x00579a20, 0x005c9f2b, 0x00519425, 0x0080b965, 0x00609a1d, + 0x000390e3, 0x00118ef2, 0x001c89f2, 0x0044c0ef, 0x0043bfef, 0x0042beee, 0x0040bdee, + 0x003fbcee, 0x003fbbed, 0x0040baeb, 0x003eb9ed, 0x003cb9ee, 0x0037b9eb, 0x0027bcf7, + 0x00949c8f, 0x00fb9637, 0x00f9bc7c, 0x00f9b585, 0x00f7994a, 0x00f69b43, 0x00f6a64e, + 0x00f7b259, 0x00f8bc66, 0x00fac672, 0x00fad380, 0x00fae08d, 0x00f9e698, 0x00f9eba2, + 0x00feeaa6, 0x00ffeaab, 0x00fcefa9, 0x00faba62, 0x00fbdc99, 0x00fff4b9, 0x00fbecb2, + 0x00f7e6ab, 0x00ffe5a3, 0x0064b1d1, 0x00199ff0, 0x00269fe9, 0x000499f2, 0x00e3f051, + 0x00d5ef58, 0x00c0e364, 0x00bde165, 0x00bae065, 0x00b5de5d, 0x00b0dc56, 0x00aad74e, + 0x00a3d346, 0x009bd043, 0x0093cd3f, 0x008cc93e, 0x0084c63c, 0x0081c139, 0x007dbc36, + 0x008bc746, 0x0089c245, 0x0063a02c, 0x0065aa2c, 0x005ea42d, 0x00509626, 0x00a4cf98, + 0x00d9eadd, 0x00b9ddff, 0x00389ef4, 0x00008fd4, 0x0046c1ef, 0x0044c0ef, 0x0043bfef, + 0x0042beef, 0x0040bdef, 0x0042bced, 0x0043baec, 0x0040baf0, 0x003dbaf4, 0x0035b8e7, + 0x0017bdf7, 0x00d97f50, 0x00f79147, 0x00f7a554, 0x00ffdbba, 0x00f8a24d, 0x00f3a549, + 0x00f5ad53, 0x00f7b55e, 0x00f9c16f, 0x00fbcc7f, 0x00f9d88a, 0x00f8e595, 0x00f8eda2, + 0x00f8f5ae, 0x00fff3b2, 0x00fff2b6, 0x00fef5ae, 0x00f4b659, 0x00f9db93, 0x00feffcd, + 0x00fbf6c1, 0x00f7edb6, 0x00fff2ac, 0x0013a4f7, 0x0016a5f0, 0x0018a5e8, 0x0056b4cd, + 0x00f1f271, 0x00d5ef84, 0x00cfe67b, 0x00cde77c, 0x00cbe77c, 0x00c9e672, 0x00c7e567, + 0x00bce15f, 0x00b1dd57, 0x00a9dc51, 0x00a0da4b, 0x009dd749, 0x009ad447, 0x0094cf43, + 0x008fcb3f, 0x0088c43c, 0x0082be39, 0x0072b430, 0x0063a928, 0x0059a028, 0x004e9827, + 0x00a0c479, 0x00fffbf7, 0x007fd3f5, 0x00038fe2, 0x000e89e2, 0x0048c3ef, 0x0046c2ef, + 0x0045c1f0, 0x0043c0f0, 0x0042bff0, 0x0042beee, 0x0043bdec, 0x0041bcef, 0x003fbcf2, + 0x002fc0fe, 0x0036bdfc, 0x00f54c00, 0x00ff8a52, 0x00faa65e, 0x00fdc48e, 0x00fbc185, + 0x00f5ae50, 0x00f7b65e, 0x00f9be6c, 0x00fac978, 0x00fbd485, 0x00fede98, 0x00ffe8aa, + 0x00fdeeae, 0x00f9f5b2, 0x00fcf6ba, 0x00fff7c2, 0x00fcf0b2, 0x00f7cc6e, 0x00fbde91, + 0x00fdfcca, 0x00fffbd1, 0x00fffdc8, 0x00cae4c8, 0x0016a1f2, 0x001da4ef, 0x0012a1f1, + 0x009fd5b9, 0x00eaf28c, 0x00dcf095, 0x00d9eb90, 0x00d9ec93, 0x00d9ec95, 0x00d6eb8c, + 0x00d4ea83, 0x00c9e779, 0x00bfe36f, 0x00b8e368, 0x00b1e262, 0x00afe05e, 0x00addf5a, + 0x00a3d952, 0x0099d449, 0x008ecb41, 0x0084c33a, 0x0075b833, 0x0066ac2c, 0x005da329, + 0x00559927, 0x004b9421, 0x002499b9, 0x001593fe, 0x000993d8, 0x000f90d8, 0x004ac5ef, + 0x0048c4f0, 0x0046c2f0, 0x0045c1f1, 0x0043c0f1, 0x0043bfef, 0x0043bfed, 0x0042beee, + 0x0041bdf0, 0x0038bbf0, 0x0072a1b8, 0x00ff5d1e, 0x00f97931, 0x00f5a151, 0x00f9ad61, + 0x00fee0bd, 0x00f8b758, 0x00fabf69, 0x00fcc87a, 0x00fcd282, 0x00fcdc8b, 0x00fbde8f, + 0x00fbe193, 0x00fbeba4, 0x00fbf5b5, 0x00faf8c2, 0x00f9fcce, 0x00f9ecb7, 0x00fae183, + 0x00fee290, 0x00fbfac8, 0x00fdf8d8, 0x00fffccb, 0x008bcedc, 0x00189fee, 0x0025a3ee, + 0x000b9dfb, 0x00e8f6a5, 0x00e4f1a6, 0x00e4f0a6, 0x00e4efa6, 0x00e5f1aa, 0x00e6f2ad, + 0x00e3f1a6, 0x00e0ef9e, 0x00d7ec93, 0x00cde987, 0x00c8ea80, 0x00c2eb78, 0x00c1ea73, + 0x00c0e96e, 0x00b1e360, 0x00a3dd53, 0x0094d247, 0x0086c83b, 0x0078bc35, 0x0069b030, + 0x0062a52b, 0x005b9b27, 0x0057920a, 0x000995fc, 0x000d96e5, 0x001091eb, 0x001091eb, + 0x004ac5f0, 0x0049c4f0, 0x0047c3f1, 0x0045c2f1, 0x0044c1f2, 0x0041c1f2, 0x003fc1f2, + 0x003fbff1, 0x003fbcf0, 0x0032c3fe, 0x00be7f6e, 0x00fe6526, 0x00f67b35, 0x00f59a4d, + 0x00f8ab5c, 0x00fbd0a0, 0x00f7c783, 0x00fec16b, 0x00fdd17f, 0x00fbdb87, 0x00f9e590, + 0x00f8ed9a, 0x00f7f4a5, 0x00fbea9a, 0x00ffdf8e, 0x00fce3a0, 0x00f7e6b1, 0x00fceecc, + 0x00fffbcb, 0x00fff3c7, 0x00fcf1c3, 0x00fef5d2, 0x00fffcd3, 0x004bb5e7, 0x0021a5ed, + 0x001ca2ee, 0x003daae2, 0x00eef6ac, 0x00e6f2b1, 0x00e8f2b5, 0x00e9f3b8, 0x00eaf4ba, + 0x00ebf5bc, 0x00e8f3b6, 0x00e6f2af, 0x00e0f0a8, 0x00dbeea2, 0x00d6ef9a, 0x00d1f092, + 0x00c9ed82, 0x00c1eb73, 0x00b0e362, 0x00a1dc51, 0x0094d347, 0x0088ca3e, 0x007bbf38, + 0x006eb433, 0x0066a92e, 0x005da01b, 0x003d9448, 0x000a93f6, 0x000e94ec, 0x001193f0, + 0x001193f0, 0x004bc5f1, 0x004ac5f1, 0x0048c4f1, 0x0047c3f2, 0x0045c3f2, 0x0040c3f4, + 0x003bc4f6, 0x003cbff3, 0x003ebbf0, 0x002dcaff, 0x00ff5d25, 0x00fe6d2f, 0x00f37d39, + 0x00f59348, 0x00f8a958, 0x00f7c083, 0x00f7d7ae, 0x00ffc36d, 0x00ffda84, 0x00fbe48c, + 0x00f7ee94, 0x00f8ed9e, 0x00faeca7, 0x00f9f1b4, 0x00f8f6c1, 0x00fcf6c8, 0x00fff6d0, + 0x00fef2d3, 0x00fcf4ba, 0x00fffee8, 0x00f7fdea, 0x00fdfde3, 0x00fffcdc, 0x000b9df1, + 0x002aaaed, 0x001baaf6, 0x0080c8da, 0x00fdffbb, 0x00e8f2bd, 0x00ebf4c4, 0x00eff7cb, + 0x00eff7cb, 0x00eff7cb, 0x00edf6c5, 0x00ebf5c0, 0x00eaf4be, 0x00e8f3bd, 0x00e4f4b4, + 0x00e0f6ab, 0x00d0f191, 0x00c1ec77, 0x00b0e463, 0x009edb4e, 0x0095d448, 0x008bcc42, + 0x007fc23b, 0x0073b935, 0x006aac31, 0x0060a510, 0x00229687, 0x000b91f1, 0x000e93f3, + 0x001294f5, 0x001294f5, 0x004cc6f1, 0x004bc5f2, 0x0049c5f2, 0x0047c4f2, 0x0046c4f2, + 0x0043c4f1, 0x0040c4f0, 0x0042c0f3, 0x0039c1f6, 0x005eacca, 0x00fb591e, 0x00f36e31, + 0x00f88135, 0x00fb923f, 0x00fbaf5e, 0x00ffc373, 0x00fde2ba, 0x00ffcd75, 0x00ffd372, + 0x00ffe584, 0x00fff796, 0x00fef4a2, 0x00fdf1ae, 0x00fff8c2, 0x00fcf8cd, 0x00fef8d2, + 0x00fff9d6, 0x00fef6e1, 0x00fcf5dd, 0x00fffbee, 0x00fbfce8, 0x00fffce0, 0x00b2e0e8, + 0x0019a4f0, 0x0026abec, 0x0016a8f6, 0x00c2e4d8, 0x00f9fac5, 0x00eff6cb, 0x00f0f7ce, + 0x00f1f8d2, 0x00f1f8d1, 0x00f2f9d1, 0x00f1f9cd, 0x00f1f9ca, 0x00f2fbca, 0x00f4fdca, + 0x00e7f8b6, 0x00daf3a2, 0x00cbef8a, 0x00bcec71, 0x00b0e661, 0x00a5e151, 0x009ad949, + 0x008fd240, 0x0083c73b, 0x0077bc35, 0x006ab31d, 0x005ea905, 0x00138dea, 0x001193ef, + 0x001093f0, 0x000f93f0, 0x000f93f0, 0x004dc6f2, 0x004cc6f2, 0x004ac5f3, 0x0048c5f3, + 0x0047c5f3, 0x0046c4ef, 0x0046c4eb, 0x0048c0f3, 0x0034c7fb, 0x00989591, 0x00fc6428, + 0x00f1773b, 0x00fc8432, 0x00ff9135, 0x00ffb564, 0x00ffbe5a, 0x00f3ddb6, 0x00ccd097, + 0x00b4cea5, 0x00b0d3b1, 0x00abd7bd, 0x00c3e1bf, 0x00daebc1, 0x00f5fdc7, 0x00ffffbd, + 0x00fffecd, 0x00fffcdc, 0x00fffce0, 0x00fbfce5, 0x00fdfbe6, 0x00fffae7, 0x00fffbdd, + 0x0061c4f4, 0x0026aaee, 0x0022abec, 0x0010a7f6, 0x00ffffd7, 0x00f5f5d0, 0x00f6fad9, + 0x00f4f9d9, 0x00f2f9da, 0x00f3fad8, 0x00f4fbd7, 0x00f5fcd5, 0x00f7fdd4, 0x00f3face, + 0x00f0f7c8, 0x00e2f4b0, 0x00d4f199, 0x00c5ee82, 0x00b7eb6b, 0x00b1e95f, 0x00abe754, + 0x009fdf49, 0x0094d83f, 0x0087cc3a, 0x007bc034, 0x006bb425, 0x005ba332, 0x000495f9, + 0x001795ee, 0x001293ed, 0x000c91eb, 0x000c91eb, 0x004fc8f3, 0x004dc8f3, 0x004cc8f4, + 0x004bc8f4, 0x0049c8f4, 0x0047c5f2, 0x0045c2ef, 0x0042c2f8, 0x0034c8ff, 0x00df6746, + 0x00ff632a, 0x00ff701b, 0x00e18b53, 0x00a4a185, 0x0063c1cd, 0x0026c0ff, 0x002ab8ff, + 0x0025b5f1, 0x0027b7f9, 0x0026b5f6, 0x0023b3f2, 0x0024b5fa, 0x0025b7ff, 0x00189ddf, + 0x0043bbf4, 0x009edae8, 0x00f9f9dc, 0x00f3fbe6, 0x00ffffea, 0x00fdffe6, 0x00fafce2, + 0x00ffffff, 0x001ea8ef, 0x001ca8f1, 0x001ba8f2, 0x005bc4f1, 0x00ffffe7, 0x00fbf9e1, + 0x00fbfce3, 0x00f8fbe0, 0x00f5fadd, 0x00f5fbdb, 0x00f5fbda, 0x00f6fcd7, 0x00f6fdd3, + 0x00f0f8c9, 0x00ebf4be, 0x00dff2a9, 0x00d4f094, 0x00c7f47b, 0x00baf862, 0x00b0ef58, + 0x00a6e64e, 0x00a3e248, 0x0098d73a, 0x008acd38, 0x007bc435, 0x0070b821, 0x003b9c84, + 0x000d93f4, 0x001394ed, 0x001193e9, 0x000f92e6, 0x000f92e6, 0x0050c9f4, 0x004fcaf4, + 0x004ecaf5, 0x004dcaf5, 0x004ccaf6, 0x0048c5f4, 0x0045c0f3, 0x0047c2ef, 0x004ac4eb, + 0x00ff521f, 0x00a79a92, 0x0051b7e6, 0x0028c7ff, 0x002cc4f9, 0x0031c1f1, 0x003fbbf0, + 0x0037c0ef, 0x0039b9f0, 0x003bb3f1, 0x0038b5f4, 0x0036b7f7, 0x0032b9f0, 0x002fbbe8, + 0x002fb8eb, 0x002fb5ed, 0x0020acf3, 0x0010a3fa, 0x0070c9f3, 0x00f5f9df, 0x00f6fbde, + 0x00f6fdde, 0x00d8ebe4, 0x0011a5ee, 0x002db2f5, 0x0014a5f8, 0x00a5e2ec, 0x00fffff8, + 0x00fffef3, 0x00fffded, 0x00fcfde6, 0x00f8fce0, 0x00f7fcde, 0x00f6fcdd, 0x00f6fcd8, + 0x00f5fdd3, 0x00edf7c4, 0x00e5f1b4, 0x00e5f5b8, 0x00e4f9bb, 0x00ecfed2, 0x00f3ffe9, + 0x00edfedb, 0x00e8f9cd, 0x00caef89, 0x009cd636, 0x0084c72e, 0x006bb826, 0x006cb315, + 0x001a95d6, 0x001591ef, 0x001093eb, 0x001193e6, 0x001294e1, 0x001294e1, 0x0052cbf4, + 0x0050caf4, 0x004ecaf4, 0x004ccaf3, 0x004ac9f3, 0x0048c8f5, 0x0046c7f6, 0x0040bfed, + 0x0041bfeb, 0x0041d4f9, 0x0033c9fc, 0x002fc9ff, 0x0042c3ec, 0x0040c3f4, 0x003ec3fc, + 0x0035bbf4, 0x0033bbf3, 0x0049bdf7, 0x0039b7f9, 0x0037b7f6, 0x0035b7f2, 0x002eb5f4, + 0x0028b3f5, 0x002fbbf8, 0x002fbaf2, 0x0030b5f2, 0x0031b0f1, 0x001facf6, 0x000dabed, + 0x007fd2ed, 0x00ffffe6, 0x0080d9d2, 0x002faaf8, 0x001dafec, 0x0003aae6, 0x00fff8ff, + 0x00fffffe, 0x00fffff9, 0x00fffdf4, 0x00fdfeeb, 0x00fbfee3, 0x00f9fde1, 0x00f7fce0, + 0x00f5fdd8, 0x00f4fdcf, 0x00f5fce2, 0x00f6fde8, 0x00f3fde8, 0x00f1fde9, 0x00ebfdd3, + 0x00e6fdbe, 0x00e0f8ba, 0x00daf2b7, 0x00eafcd2, 0x00f2fde6, 0x00b7de8d, 0x0084c73d, + 0x009ab848, 0x0014a1f9, 0x000494f3, 0x001094ef, 0x001095ec, 0x001095e9, 0x001095e9, + 0x0054ccf5, 0x0051cbf4, 0x004ecaf3, 0x004cc9f2, 0x0049c8f1, 0x0048cbf5, 0x0048cef9, + 0x0040c4f3, 0x0049cafc, 0x0040c2f1, 0x0047caf5, 0x0046c7f4, 0x0046c4f3, 0x0039b5ee, + 0x002ca5e8, 0x002eb1e1, 0x0056c1ea, 0x006dc9e9, 0x0037c2e5, 0x0051caeb, 0x006bd2f1, + 0x0074d1f5, 0x007dcff9, 0x0056c7f8, 0x001fafe8, 0x0025b1ee, 0x002cb3f4, 0x003eb5f9, + 0x002bb3ee, 0x001baff5, 0x0032b5f0, 0x003fb2f9, 0x0026a9f2, 0x001faeeb, 0x003fb8f4, + 0x00fcfff3, 0x00ffffff, 0x00ffffff, 0x00fffefb, 0x00fefff1, 0x00feffe6, 0x00fbffe5, + 0x00f8fde3, 0x00f5fdd7, 0x00f3fecb, 0x00f5fbeb, 0x00f7feee, 0x00f2fdde, 0x00edfccf, + 0x00e3f9b0, 0x00d9f692, 0x00d2f48b, 0x00ccf184, 0x00ceee97, 0x00d0eaa9, 0x00daebc1, + 0x00f4fbe9, 0x007fc679, 0x005ac1ff, 0x001aa1eb, 0x001195f2, 0x000f96f2, 0x000e97f2, + 0x000e97f2, 0x0054cdf5, 0x0052ccf4, 0x004fcbf3, 0x004dc9f3, 0x004ac8f2, 0x0049c6f2, + 0x0047c4f2, 0x0049d2f3, 0x0046c8f3, 0x004dc5fc, 0x002c9add, 0x001883cd, 0x00046cbe, + 0x000080c5, 0x000f96d4, 0x002eaddb, 0x0060c6eb, 0x0076cdef, 0x0051caea, 0x0069d2f0, + 0x0081daf5, 0x009ae4f7, 0x00b3eff9, 0x00cffaff, 0x00e3feff, 0x009ae1ff, 0x0048bcf7, + 0x0011b5dd, 0x0032aef0, 0x0028acfc, 0x0031b2f3, 0x0034b1f6, 0x0025adf0, 0x0026acf6, + 0x0098d1fc, 0x00fffdf8, 0x00ffffff, 0x00fffffb, 0x00fefff4, 0x00fdffee, 0x00fcfde7, + 0x00fbfee4, 0x00faffe0, 0x00f8fde7, 0x00f7fcef, 0x00f3fbeb, 0x00effdd9, 0x00e9fbc2, + 0x00e3f9ac, 0x00d9f49b, 0x00ceef8b, 0x00c1ea76, 0x00b4e562, 0x00abdd5a, 0x00a2d261, + 0x00c1e98e, 0x00dbe8b9, 0x0096d4ff, 0x008ed0fa, 0x0042aeee, 0x001095f1, 0x001096f1, + 0x000f96f1, 0x000f96f1, 0x0055cef5, 0x0053ccf4, 0x0050cbf4, 0x004ecaf4, 0x004cc8f4, + 0x0051caf7, 0x0057cbfa, 0x0045c0ea, 0x001a75c7, 0x000058ad, 0x00015bb4, 0x00066fc0, + 0x000b84cd, 0x000093ce, 0x0011a7e0, 0x003eb9e6, 0x006bcbeb, 0x007ed1f6, 0x006cd3f0, + 0x0082dbf4, 0x0098e3f9, 0x00a5ecf7, 0x00b2f4f5, 0x00c7f7f9, 0x00ddfafd, 0x00f2ffff, + 0x00f8fff6, 0x00bcebfe, 0x0022b4f2, 0x0029afff, 0x002fb0f7, 0x0029b1f2, 0x0023b1ee, + 0x001aa7fa, 0x00cae6f4, 0x00f7f8f4, 0x00feffff, 0x00fefff7, 0x00feffed, 0x00fcffeb, + 0x00fbfae9, 0x00fbfee3, 0x00fbffdc, 0x00fbffe9, 0x00fbfff7, 0x00f1fedd, 0x00e7fbc3, + 0x00e0f6b4, 0x00d8f0a5, 0x00ceec94, 0x00c4e884, 0x00b8e678, 0x00ace36c, 0x00a0df53, + 0x0094d455, 0x0080bd41, 0x00d2e599, 0x002ca1f4, 0x0030a2f6, 0x00209cf3, 0x001096f1, + 0x001096f1, 0x001096f1, 0x001096f1, 0x0055cef4, 0x0053cdf4, 0x0051cbf5, 0x0050cbf5, + 0x004ecaf6, 0x004dc9f4, 0x0054d0fa, 0x002b86ce, 0x000752b1, 0x00045fb9, 0x000a74c9, + 0x000882ce, 0x000691d4, 0x0002a0d5, 0x0024b5e7, 0x004cc4ea, 0x0074d3ee, 0x0083d9f5, + 0x007fddf4, 0x0093e4f6, 0x00a8ecf9, 0x00b6f2f9, 0x00c3f9f9, 0x00d3fafb, 0x00e3fcfc, + 0x00edfefb, 0x00f0f9f3, 0x00ffffff, 0x00fffdff, 0x007edcef, 0x0026adfd, 0x002aaff7, + 0x002db2f2, 0x0034b1e0, 0x0009a7f7, 0x008dd3f5, 0x00fdfbf9, 0x00fffff6, 0x00fdffeb, + 0x00fcffe6, 0x00fcfce0, 0x00f9fcde, 0x00f7fcdd, 0x00fcffef, 0x00f9fdec, 0x00e8f5d0, + 0x00dff5bd, 0x00d9f1ad, 0x00d2ed9d, 0x00c5e97e, 0x00b8e26d, 0x00abdd5e, 0x009fd74f, + 0x0098c95f, 0x0092c735, 0x008bc942, 0x0080b34d, 0x00009bf2, 0x001894f8, 0x001595f5, + 0x001397f2, 0x001296f1, 0x001195f0, 0x001195f0, 0x0056cff4, 0x0054cdf5, 0x0052ccf5, + 0x0051cbf7, 0x0051cbf9, 0x0049c8f1, 0x0051d5fa, 0x001662c1, 0x00005cbb, 0x000874cd, + 0x00037cce, 0x00028dd4, 0x00019edb, 0x0009aedc, 0x0037c2ee, 0x005acfef, 0x007edcf0, + 0x0088e1f4, 0x0092e6f8, 0x00a5eef8, 0x00b9f5f9, 0x00c7f9fb, 0x00d5fdfe, 0x00dffdfc, + 0x00e9fdfa, 0x00f0fefe, 0x00f8ffff, 0x00fafffe, 0x00fdfffc, 0x00fdfbff, 0x001db0e8, + 0x002ab1ee, 0x0037b2f5, 0x0025b9f7, 0x0029b4f8, 0x0022aff5, 0x001baaf2, 0x009fd7f6, + 0x00fdffea, 0x00fcfee0, 0x00fcfdd7, 0x00f8fada, 0x00f4f7dd, 0x00fdfef5, 0x00f6fae1, + 0x00dfecc3, 0x00d8efb6, 0x00d2eca6, 0x00ccea95, 0x00bce567, 0x00abdb56, 0x009fd344, + 0x0092cb33, 0x0085c824, 0x0079b46a, 0x003a9eaf, 0x000c97ff, 0x001994f9, 0x000f9bee, + 0x00139af0, 0x001699f3, 0x001497f1, 0x001295ef, 0x001295ef, 0x0058d0f5, 0x0056cef5, + 0x0053cdf4, 0x0053ccf6, 0x0052cbf8, 0x0053d6fb, 0x004fc8fc, 0x00004cad, 0x00096fca, + 0x000b80d4, 0x000588d5, 0x000598db, 0x0005a8e1, 0x0018b6e6, 0x003fc8f2, 0x0063d3f3, + 0x0086dff5, 0x0091e4f7, 0x009ce9fa, 0x00aef0f9, 0x00c0f7f9, 0x00cbfafb, 0x00d7fdfd, + 0x00defdfc, 0x00e6fefb, 0x00f0fffe, 0x00faffff, 0x00f2fefb, 0x00fefffd, 0x00c6e9fb, + 0x001eb0ec, 0x0030b4f6, 0x0030b7f8, 0x0019a8f7, 0x0026b0f0, 0x0022aef3, 0x001eabf5, + 0x0027aafa, 0x001ca6f6, 0x007dcdea, 0x00dff4dd, 0x00eaffb0, 0x00fdfeed, 0x00ffffef, + 0x00fcf9d3, 0x00edeeb4, 0x00e6e9ac, 0x00d9e68a, 0x00cbe367, 0x00b9e153, 0x00a6dd4d, + 0x0075c57f, 0x0043adb0, 0x00229bf3, 0x000a9cff, 0x000998f6, 0x00109cef, 0x00189aee, + 0x00149ded, 0x00159bf0, 0x001599f2, 0x001397f0, 0x001195ee, 0x001195ee, 0x005ad1f6, + 0x0057cff5, 0x0054cef4, 0x0054cdf6, 0x0053cbf8, 0x004dd3f4, 0x002c9add, 0x00045ec1, + 0x000572c9, 0x000683d2, 0x000794dc, 0x0008a2e2, 0x0008b1e8, 0x0028bfef, 0x0048cef6, + 0x006bd8f8, 0x008fe3fa, 0x009be8fa, 0x00a6edfb, 0x00b7f3fb, 0x00c7f9fa, 0x00d0fbfc, + 0x00d9fdfd, 0x00defefd, 0x00e2fffc, 0x00effffe, 0x00fcffff, 0x00ebfef7, 0x00fffffe, + 0x008fd7f8, 0x001eb0f1, 0x002eb0f6, 0x0018abec, 0x00e0f7fd, 0x0024ade9, 0x0023acf1, + 0x0021acf8, 0x0026aef7, 0x002cb0f6, 0x001aa9f5, 0x0008a3f4, 0x0022a7f9, 0x004cc2f2, + 0x006dcdef, 0x007ec9db, 0x007fcac2, 0x0081c6c6, 0x0061bccb, 0x0041b3d0, 0x0024a7e9, + 0x00089bff, 0x00119dff, 0x001a9fff, 0x000f99e9, 0x00149cf9, 0x00159cf7, 0x00159cf5, + 0x00179df1, 0x00199eed, 0x00179cef, 0x001599f1, 0x001397ef, 0x001195ed, 0x001195ed, + 0x005cd2f6, 0x0059d0f5, 0x0055cff3, 0x0054cdf5, 0x0053ccf8, 0x0051d5f6, 0x00167bcf, + 0x000467c6, 0x00067bcf, 0x00068bd7, 0x00059cdf, 0x0008a9e5, 0x000ab6eb, 0x002bc4f1, + 0x004cd2f7, 0x006ddbf9, 0x008ee5fa, 0x009deafb, 0x00aceffb, 0x00bdf5fb, 0x00cefbfa, + 0x00d5fbfc, 0x00dcfcfd, 0x00dcfefd, 0x00ddfffd, 0x00e4fffd, 0x00eafffd, 0x00fffffe, + 0x00ffffff, 0x0027c0de, 0x0026b5f6, 0x001fb0f9, 0x004dc6ff, 0x00fff9ef, 0x00fefffa, + 0x008bd8f7, 0x0018a7f3, 0x001daaf4, 0x0023acf6, 0x0022acf3, 0x0022abf0, 0x001aa3f2, + 0x001aa6ee, 0x0018a8f5, 0x000ea2f3, 0x0011a4f2, 0x0014a4ff, 0x0015a3fc, 0x0016a3fa, + 0x0017a2f3, 0x0019a2ec, 0x000e99fe, 0x00169bed, 0x0000a1ff, 0x002b9de8, 0x0061b5b0, + 0x00109af7, 0x00149cf2, 0x00189eed, 0x00169cef, 0x00149af0, 0x001298ee, 0x001096ec, + 0x001096ec, 0x005fd3f7, 0x005bd2f5, 0x0056d0f3, 0x0055cef5, 0x0053cdf7, 0x0056d8f8, + 0x00005cc0, 0x000370cb, 0x000785d6, 0x000594dc, 0x0004a3e2, 0x0008afe8, 0x000cbcee, + 0x002ec8f3, 0x0050d5f9, 0x006fdefa, 0x008de7fb, 0x009fecfb, 0x00b1f2fb, 0x00c3f7fb, + 0x00d4fcfa, 0x00d9fcfc, 0x00defcfd, 0x00dbfdfd, 0x00d9fffd, 0x00d9fdfb, 0x00d9fcfa, + 0x00e5fafa, 0x00a4eaf7, 0x002badfb, 0x002fb9fa, 0x001aaeed, 0x0099dbf8, 0x00ffffff, + 0x00fefdfc, 0x00fffefd, 0x00fffffd, 0x008cd4fa, 0x0019a9f6, 0x0018a9f7, 0x0016aaf9, + 0x001aa7f3, 0x001ea5ee, 0x001fa7f2, 0x0021a9f6, 0x001ea7f7, 0x001ba5f7, 0x0017a4f9, + 0x0012a2fb, 0x000b9dfd, 0x000399fe, 0x0026a2fa, 0x006fc0b0, 0x00cfca5e, 0x00ffe528, + 0x0074b4b3, 0x000b98fa, 0x00119af4, 0x00179dee, 0x00159cee, 0x00139aef, 0x001198ed, + 0x000f96eb, 0x000f96eb, 0x005dd1f6, 0x005bd2f5, 0x0058d2f4, 0x0053cef4, 0x0056d2fb, + 0x0040b2e6, 0x000164c6, 0x000376cf, 0x000487d7, 0x000296dd, 0x0001a4e4, 0x0004b1ea, + 0x0007bdf1, 0x001bc8f2, 0x0043d5fc, 0x0064ddfb, 0x0085e6fb, 0x0098ebfc, 0x00acf1fd, + 0x00bef9ff, 0x00cfffff, 0x00cffdff, 0x00cff9fb, 0x00d2fefe, 0x00d5ffff, 0x00c6f9ff, + 0x00b8efff, 0x005ad7d9, 0x0040b9e9, 0x002fb9ff, 0x002bb2f0, 0x0028afeb, 0x00def0f2, + 0x00ffffff, 0x00feffff, 0x00fffefe, 0x00fffefa, 0x00fffffa, 0x00fffff9, 0x00c2e8f0, + 0x0084cde7, 0x0053bbe9, 0x0022a9eb, 0x0014a1ff, 0x00069ff8, 0x000fa0f8, 0x0019a3eb, + 0x0043b1e1, 0x006ec2c9, 0x00b0d79a, 0x00f2eb6b, 0x00ebee32, 0x00f8e647, 0x00ffe23a, + 0x00fde142, 0x000098f4, 0x0019a1fc, 0x00169ef7, 0x00129bf1, 0x00139af1, 0x00149af0, + 0x001298ee, 0x001096ec, 0x001096ec, 0x005ccff6, 0x005bd2f6, 0x005ad4f6, 0x0052cdf2, + 0x005ad6fe, 0x00298cd5, 0x00026ccc, 0x00027bd2, 0x000189d8, 0x000097df, 0x0000a6e6, + 0x0000b2ed, 0x0002bef4, 0x0009c7f1, 0x0035d5ff, 0x0059ddfd, 0x007ce5fb, 0x0091eafd, + 0x00a6f0ff, 0x00b1f2ff, 0x00bbf5ff, 0x00bef5fc, 0x00c1f6f9, 0x00c1f7f7, 0x00c1f9f4, + 0x00c7fdfc, 0x00cdffff, 0x00c2f9f8, 0x005acdf4, 0x0039b1f3, 0x0038baf5, 0x002ab4f7, + 0x00fcfbf8, 0x00fdfeff, 0x00feffff, 0x00fffeff, 0x00fffcf6, 0x00fdfef2, 0x00f7ffee, + 0x00fcffea, 0x00ffffe5, 0x00ffffd8, 0x00ffffcb, 0x00fffbf1, 0x00ffffdf, 0x00fdfdc2, + 0x00f7ff88, 0x00fbfe92, 0x00ffff7f, 0x00fdfc6c, 0x00faf759, 0x00f8f059, 0x00f7e958, + 0x00f7e359, 0x00d0d368, 0x000998ff, 0x00189aef, 0x00129af2, 0x000c99f5, 0x001199f3, + 0x001599f2, 0x001397f0, 0x001195ee, 0x001195ee, 0x005fd2f9, 0x005cd3f8, 0x0059d4f6, + 0x0058d3f8, 0x005edaff, 0x001971cd, 0x00026ecd, 0x00037bd3, 0x000488d9, 0x000497e0, + 0x0005a6e6, 0x0001ade7, 0x0000b5e8, 0x0007beea, 0x0023cbf5, 0x004cd7f8, 0x0074e4fc, + 0x0089e8fd, 0x009fecfe, 0x00a5edfe, 0x00abeffe, 0x00aeeffc, 0x00b0eff9, 0x00b3f3f9, + 0x00b6f6f8, 0x00b6f9fc, 0x00b5fcff, 0x00daf3ff, 0x001ab9f1, 0x0028b3f4, 0x002bb3f6, + 0x0073cef4, 0x00fdfdf5, 0x00fdfefa, 0x00fdfffe, 0x00fffef9, 0x00fffdf3, 0x00fdfeee, + 0x00faffe9, 0x00fdffe4, 0x00ffffde, 0x00ffffd0, 0x00ffffc2, 0x00fdfad7, 0x00fffcf3, + 0x00ffffc0, 0x00fcfbc5, 0x00fcff84, 0x00fcfb8b, 0x00fbf67a, 0x00f9f269, 0x00f7ed5e, + 0x00f4e954, 0x00f7e948, 0x0087bda9, 0x00109afc, 0x00179cf2, 0x00149bf1, 0x00119af1, + 0x001399f2, 0x001698f3, 0x001496f1, 0x001294ef, 0x001294ef, 0x0062d4fc, 0x005dd4f9, + 0x0059d4f6, 0x0056d1f6, 0x0053cef5, 0x00014ebe, 0x00026fcd, 0x00057bd4, 0x000787da, + 0x000996e0, 0x000ca5e7, 0x000bb0e9, 0x0009bbeb, 0x0015c5f3, 0x0021d0fc, 0x0046dafc, + 0x006ce3fc, 0x0082e6fd, 0x0097e9fe, 0x0099e9fe, 0x009ce8fe, 0x009ee9fb, 0x00a0e9f9, + 0x00a6eefa, 0x00acf3fc, 0x00b0effc, 0x00b5ecfb, 0x0089ddf9, 0x0028b4f3, 0x003ebef7, + 0x001eadf7, 0x00bde8f0, 0x00fefff2, 0x00fefff3, 0x00fdfff4, 0x00fefef2, 0x00fefef0, + 0x00fefeea, 0x00fefee4, 0x00fefede, 0x00fefed8, 0x00fcffc9, 0x00fbffba, 0x00f6fea0, + 0x00ffffce, 0x00fff9f6, 0x00ffffc9, 0x00fdf7be, 0x00f8f87a, 0x00f9f66b, 0x00f9f35c, + 0x00f5ee56, 0x00f1e84f, 0x00f8ee37, 0x003fa7ea, 0x00189df5, 0x00179df4, 0x00169cf1, + 0x00159bee, 0x00169af2, 0x001798f5, 0x001596f3, 0x001394f1, 0x001394f1, 0x0066d7fc, + 0x005fd1f5, 0x0060d4f6, 0x0059d8f9, 0x00399ddb, 0x000858be, 0x00096ccd, 0x000c7ad2, + 0x001087d7, 0x001296df, 0x0013a6e8, 0x0013b0eb, 0x001bc3f5, 0x000fc8f3, 0x0017d0f9, + 0x0027d3f4, 0x004bd7f7, 0x0061dbf8, 0x0077def9, 0x007fe0fa, 0x0088e1fa, 0x008de4fb, + 0x0091e7fb, 0x0096eafc, 0x009aedfd, 0x009feafb, 0x00a3e7fa, 0x005eccfb, 0x002db7f5, + 0x0024b8f9, 0x0014b1f5, 0x00fffbff, 0x00feffec, 0x00ffffed, 0x00ffffee, 0x00ffffec, + 0x00fefdeb, 0x00fefde4, 0x00fefddd, 0x00fefed6, 0x00fefece, 0x00fcfdc1, 0x00fcfcb5, + 0x00f6fb8d, 0x00f8fc8a, 0x00f8facc, 0x00f8fef2, 0x00f9ffbe, 0x00fbf9c2, 0x00fbf8ac, + 0x00fcf796, 0x00faf491, 0x00f7f18d, 0x00ffe5a9, 0x000096f7, 0x00089af7, 0x00159ef7, + 0x00169df4, 0x00169cf0, 0x00169bf2, 0x001699f4, 0x001497f3, 0x001396f1, 0x001396f1, + 0x006bd9fb, 0x0061cef1, 0x0067d3f7, 0x005cdefd, 0x001f6cc0, 0x000f63bf, 0x000f6acd, + 0x001478d1, 0x001887d4, 0x001997df, 0x001aa6e9, 0x0014a9e4, 0x001dbbef, 0x000dbeeb, + 0x0023c5f6, 0x0013c6ed, 0x002acbf3, 0x0040cff4, 0x0056d4f4, 0x0065d7f6, 0x0074daf7, + 0x007bdffb, 0x0083e5fe, 0x0086e6fe, 0x0089e8fd, 0x008ee5fb, 0x0092e2fa, 0x0033bcfc, + 0x0032b9f7, 0x0031bafd, 0x0057c5f7, 0x00f4ffde, 0x00fdffe7, 0x00ffffe7, 0x00ffffe7, + 0x00ffffe6, 0x00fdfce6, 0x00fdfddd, 0x00fdfdd5, 0x00fdfdcd, 0x00fefdc5, 0x00fdfaba, + 0x00fcf8af, 0x00fef99f, 0x00fffb8e, 0x00fafe77, 0x00f4fb7d, 0x00f9f8d2, 0x00fdffee, + 0x00fefedf, 0x00fffcd0, 0x00fefacd, 0x00fdf9ca, 0x00a6d3ce, 0x000399eb, 0x001ea1ec, + 0x00149ffa, 0x00159ef6, 0x00179ef2, 0x00169cf3, 0x00159af3, 0x001499f2, 0x001398f1, + 0x001398f1, 0x0055d4f4, 0x005bd1f1, 0x0069d6f6, 0x006ee2ff, 0x000c50a8, 0x001161be, + 0x000f6acd, 0x001f83d6, 0x001f89dc, 0x000f8cdd, 0x001a9be0, 0x0022b1f4, 0x001dabe1, + 0x0014aedf, 0x0026bdee, 0x0015bae7, 0x001fc1ef, 0x0025c7ef, 0x002bcdef, 0x003dcdf1, + 0x004ecef3, 0x005bd6f9, 0x0068defe, 0x006eddfc, 0x0073ddfb, 0x0076ddf5, 0x0070d3f7, + 0x0031bafb, 0x0033b9f6, 0x0024b6ff, 0x00a4dee5, 0x00f9ffdc, 0x00fdfedc, 0x00ffffdc, + 0x00ffffdc, 0x00fefedb, 0x00fcfdda, 0x00fdfdd2, 0x00fdfdcb, 0x00fdfdc3, 0x00fefdbc, + 0x00fdfbaf, 0x00fcfaa2, 0x00fdfb93, 0x00fefb83, 0x00fcfd6b, 0x00f9fc60, 0x00fbf85d, + 0x00fdf74c, 0x00fef576, 0x00fff2a1, 0x00f6ec87, 0x00f8e360, 0x0051bbb4, 0x000d9afe, + 0x001a9ef7, 0x00159ef6, 0x00159df4, 0x00159df2, 0x00149bf2, 0x001299f2, 0x001299f2, + 0x001299f2, 0x001299f2, 0x0067d4fd, 0x0069d6f9, 0x006cd9f5, 0x004fb7dc, 0x001953af, + 0x001c67c6, 0x00005abd, 0x001a7eca, 0x00157bd4, 0x000581dc, 0x002aa1e7, 0x000189d3, + 0x002dabe3, 0x0023a7dc, 0x0029b4e6, 0x0017ade1, 0x0014b7ec, 0x0015b9ea, 0x0016bbe9, + 0x001fbfec, 0x0028c2ef, 0x003bcdf7, 0x004ed8ff, 0x0056d5fb, 0x005dd2f8, 0x005ed6f0, + 0x004ec5f4, 0x002fb9fa, 0x0035b8f4, 0x0017b1ff, 0x00f0f7d2, 0x00feffda, 0x00fdfcd2, + 0x00fdfdd1, 0x00fdfed1, 0x00fdfecf, 0x00fcfecd, 0x00fcfdc7, 0x00fdfdc0, 0x00fdfdb9, + 0x00fdfdb2, 0x00fdfca4, 0x00fdfc95, 0x00fdfc87, 0x00fdfc79, 0x00fdfa6c, 0x00fef85f, + 0x00f9f645, 0x00f6ef47, 0x00f2e938, 0x00efe428, 0x00eee425, 0x00ffdd05, 0x000399ff, + 0x0017a1f5, 0x00179ef4, 0x00169cf3, 0x00159cf3, 0x00149cf3, 0x00129bf1, 0x001099f0, + 0x00119af1, 0x00129bf2, 0x00129bf2, 0x0066d5fb, 0x0070d5fc, 0x0078e2ff, 0x003b86c7, + 0x00235fba, 0x001e6aba, 0x00227ad1, 0x002787d8, 0x00248cd7, 0x001d8dd4, 0x002189d1, + 0x002ca1ea, 0x002296d5, 0x0031aaef, 0x0020a1db, 0x0017a1dd, 0x000ea1e0, 0x001aace3, + 0x0013b1eb, 0x0010b8ed, 0x000dc0ef, 0x001cc1ef, 0x002cc3f0, 0x0036c4f2, 0x0040c5f4, + 0x0047c9f2, 0x0045c3f6, 0x0031bafa, 0x0031b7f7, 0x004cc2f4, 0x00f5fac0, 0x00fdffc6, + 0x00fdfcc5, 0x00fdfdc4, 0x00fdfdc4, 0x00fcfdc2, 0x00fbfdc1, 0x00f8f9b6, 0x00fdfdb3, + 0x00fdfdab, 0x00fdfca3, 0x00fcfc95, 0x00fcfb88, 0x00fcfb7b, 0x00fbfb6d, 0x00fcf962, + 0x00fcf757, 0x00f8f245, 0x00f4eb41, 0x00f0e532, 0x00ebe023, 0x00fbe01c, 0x00c5d244, + 0x000aa2fe, 0x00169ff9, 0x00179ff6, 0x00189ff3, 0x00179ef2, 0x00159df2, 0x00179ff5, + 0x0018a1f8, 0x00159ef5, 0x00129bf2, 0x00129bf2, 0x0065d7fa, 0x0064d1f7, 0x005de7ff, + 0x0004439b, 0x000e4ca5, 0x00317bcd, 0x000455c1, 0x000053c9, 0x000368c6, 0x002687ca, + 0x002881ca, 0x002789d1, 0x002791d7, 0x000774c9, 0x00178dcf, 0x001f9ce1, 0x00179be4, + 0x001e9eda, 0x000097de, 0x0003a5e6, 0x0008b1ee, 0x0009b0e8, 0x000aafe2, 0x0017b4e9, + 0x0024b9ef, 0x0030bdf4, 0x003cc1f9, 0x0034bcf9, 0x002cb6f9, 0x0080d2e8, 0x00fafdaf, + 0x00fcfdb3, 0x00fdfcb7, 0x00fdfcb7, 0x00fdfdb7, 0x00fcfcb6, 0x00fbfcb5, 0x00f4f4a5, + 0x00fdfda5, 0x00fcfc9d, 0x00fcfc94, 0x00fbfb87, 0x00fbfb7b, 0x00fafa6e, 0x00fafa61, + 0x00faf758, 0x00faf54e, 0x00f7ee44, 0x00f3e73a, 0x00ede12c, 0x00e7db1e, 0x00ffd21a, + 0x0078b090, 0x0009a0fd, 0x00159dfd, 0x0018a0f8, 0x001aa2f2, 0x0018a0f2, 0x00169ef2, + 0x00139bf2, 0x001099f1, 0x00119af2, 0x00129bf3, 0x00129bf3, 0x0060d4f7, 0x0067dcfd, + 0x004fc2f0, 0x00002c8a, 0x002e6bc0, 0x000547ad, 0x000044ba, 0x003685c4, 0x00064ebc, + 0x001462c3, 0x002d70cb, 0x000f5ab4, 0x002274cd, 0x001169c2, 0x001979c2, 0x001d80d0, + 0x001980d7, 0x001a86d3, 0x001090de, 0x00038dda, 0x000599e6, 0x00059ce1, 0x00049edd, + 0x0005a6e1, 0x0000a7de, 0x001fb6ee, 0x0039bdf7, 0x0038bcf6, 0x0024b5fc, 0x00bfe8b9, + 0x00fafea2, 0x00fbfca5, 0x00fcfaa8, 0x00fcfca7, 0x00fdfda6, 0x00fbfca3, 0x00f9fb9f, + 0x00f6f795, 0x00fafb92, 0x00fbfb8b, 0x00fbfb85, 0x00fafa79, 0x00fafa6d, 0x00f9f961, + 0x00f8f956, 0x00f9f64c, 0x00f9f442, 0x00f5ec39, 0x00f2e531, 0x00efde28, 0x00ecd620, + 0x00eed900, 0x0032a6e5, 0x0019a4ff, 0x0029a4f4, 0x0020a2f4, 0x0018a0f5, 0x00179ef4, + 0x00159df4, 0x00139bf3, 0x001199f2, 0x00129af2, 0x00129af3, 0x00129af3, 0x005bd1f5, + 0x0063dffa, 0x00318dcc, 0x00062d91, 0x000e499a, 0x0000369f, 0x00003897, 0x00155fb6, + 0x0053aad9, 0x0031a6e2, 0x0045bcef, 0x006dddff, 0x0076defa, 0x006dd9f9, 0x0064d5f9, + 0x0054c5f3, 0x0045b5ed, 0x00238ed6, 0x001277ce, 0x00006cc6, 0x000282de, 0x000187db, + 0x00008dd7, 0x00079be1, 0x000099dc, 0x0022b1f0, 0x0036baf4, 0x003cbcf4, 0x001cb5ff, + 0x00fffe89, 0x00fbff96, 0x00fbfc98, 0x00fbf99a, 0x00fcfb98, 0x00fdfd96, 0x00fafb90, + 0x00f6f98a, 0x00f7f984, 0x00f8fa7f, 0x00fafa7a, 0x00fbfb75, 0x00fafa6a, 0x00f9f960, + 0x00f8f855, 0x00f7f84a, 0x00f7f540, 0x00f8f336, 0x00f4eb2f, 0x00f0e328, 0x00f0da24, + 0x00f0d121, 0x00e9ca24, 0x00049bff, 0x0020a3f6, 0x0016a1f7, 0x0016a0f7, 0x00169ef7, + 0x00159df6, 0x00149cf5, 0x00139bf4, 0x00129af3, 0x00129af3, 0x00129af3, 0x00129af3, + 0x005ae3ff, 0x0064d8ff, 0x000d4798, 0x00002682, 0x001d6bb7, 0x003aa2de, 0x005fe5ff, + 0x0052d8fd, 0x004dd6f6, 0x0048ccf5, 0x005fd0f6, 0x0068d9ff, 0x0061d3f8, 0x005bd2f8, + 0x0042cbff, 0x0053cefe, 0x0051cff5, 0x0049caf6, 0x004acdff, 0x0040baff, 0x000e7edb, + 0x000069c2, 0x000584da, 0x000184d5, 0x00068cd8, 0x0038bef8, 0x003abef7, 0x0035beff, + 0x0062c7e2, 0x00fbf379, 0x00f8fa83, 0x00f9f983, 0x00faf884, 0x00f9f77f, 0x00f7f77b, + 0x00f8f979, 0x00f9fa77, 0x00f8f972, 0x00f7f86c, 0x00fcfc6c, 0x00f9f864, 0x00f8f85b, + 0x00f8f752, 0x00f7f649, 0x00f6f53f, 0x00f5f237, 0x00f4ef2f, 0x00f1e628, 0x00eede20, + 0x00ead61f, 0x00f2cc11, 0x009db96c, 0x000c9ffe, 0x001ba3f9, 0x0017a2f9, 0x0017a0f9, + 0x00169ef8, 0x00169df7, 0x00159cf6, 0x00149bf5, 0x00139af5, 0x00139af5, 0x00139af5, + 0x00139af5, 0x0060d8f9, 0x005bd9f8, 0x004cadd7, 0x0069ddff, 0x0056ddf8, 0x0055d6fc, + 0x0055d0ff, 0x005cd5ff, 0x0053cbf2, 0x004bcaf6, 0x0043cafa, 0x0047c9f8, 0x004cc8f6, + 0x005ccff1, 0x0046ccf8, 0x0055caff, 0x003ec4fa, 0x0043c3fb, 0x0048c2fd, 0x003ebff4, + 0x0044ccfb, 0x0037b3fc, 0x000b7bdd, 0x00006dc9, 0x000d80d4, 0x004eccff, 0x003ec3fa, + 0x002ec2ff, 0x00a7dea8, 0x00f8ec5b, 0x00f5f570, 0x00f7f66f, 0x00faf76e, 0x00f5f467, + 0x00f1f060, 0x00f6f663, 0x00fbfc65, 0x00f8f95f, 0x00f6f659, 0x00fefe5d, 0x00f7f652, + 0x00f7f54c, 0x00f7f545, 0x00f6f33d, 0x00f6f235, 0x00f3ef2f, 0x00f1eb29, 0x00efe221, + 0x00ecd818, 0x00e5d21a, 0x00f3c700, 0x0052a9b4, 0x0014a4fb, 0x0015a3fb, 0x0017a3fc, + 0x0017a1fa, 0x00179ff8, 0x00169df8, 0x00159cf7, 0x00159bf7, 0x001499f6, 0x001499f6, + 0x001499f6, 0x001499f6, 0x0058cff2, 0x0059ddfd, 0x0055d5f9, 0x005ddeff, 0x004dcef3, + 0x004dcbf3, 0x004cc8f3, 0x0056d2fc, 0x0059d3fd, 0x0050cefb, 0x0047cafa, 0x0048c9f9, + 0x0049c7f9, 0x0051cbf6, 0x0045c9f9, 0x004bc8fd, 0x003fc5f9, 0x0041c4fa, 0x0043c2fb, + 0x003bbdf3, 0x003ac0f4, 0x003ec7fc, 0x003ac6fc, 0x0025a1e3, 0x001f8dd9, 0x0037b9f7, + 0x0026bbfa, 0x002abbf4, 0x00ced857, 0x00f9fa5b, 0x00d9db49, 0x00edec58, 0x00faf560, + 0x00f2ef4d, 0x00e9ea3b, 0x00eeef46, 0x00f2f451, 0x00f9f34f, 0x00edf145, 0x00fef84b, + 0x00f4f542, 0x00f5f43d, 0x00f6f337, 0x00f5f131, 0x00f5ef2b, 0x00f2eb27, 0x00f0e622, + 0x00eedb1d, 0x00ecd117, 0x00f1cc09, 0x00f5c509, 0x000fadff, 0x0017a1f9, 0x0018a1f9, + 0x0018a1f8, 0x0018a0f9, 0x00179ff9, 0x00169df9, 0x00169cf8, 0x00159bf8, 0x001599f8, + 0x001599f8, 0x001599f8, 0x001599f8, 0x0060d5fb, 0x005bd3fb, 0x0056d2fb, 0x0055d1fc, + 0x0055d0fe, 0x0054d0fa, 0x0053d1f6, 0x0051cef7, 0x004ecbf8, 0x004dcbf9, 0x004ccafb, + 0x0049c8fb, 0x0047c6fc, 0x0045c6fb, 0x0043c6fa, 0x0041c6fa, 0x0040c7f9, 0x003fc5f9, + 0x003ec3f9, 0x003fc3fb, 0x0041c4fd, 0x0038baf2, 0x0040c1f8, 0x003dc3fb, 0x003bc5fe, + 0x0037c1f6, 0x0034beef, 0x002ebcf0, 0x00ded722, 0x00bfdc38, 0x00dee142, 0x00ecea4a, + 0x00eae442, 0x00eee942, 0x00f2ee42, 0x00eeed3f, 0x00eaec3d, 0x00fbee3f, 0x00e5ec31, + 0x00fff239, 0x00f2f531, 0x00f4f32e, 0x00f5f12a, 0x00f5ee25, 0x00f4ec21, 0x00f2e71e, + 0x00f0e11c, 0x00eed519, 0x00ecc917, 0x00dec40c, 0x00bbbe39, 0x000798f8, 0x001a9ff8, + 0x001a9ff7, 0x001a9ff5, 0x00189ff7, 0x00179ff9, 0x00179ef9, 0x00169cf9, 0x00169bf9, + 0x001699f9, 0x001699f9, 0x001699f9, 0x001699f9, 0x005cd4f9, 0x0058d4f9, 0x0055d3f9, + 0x0056d2fa, 0x0058d0fb, 0x0056d0f8, 0x0054d0f6, 0x0051cef7, 0x004dccf9, 0x004ccbfa, + 0x004bcafb, 0x0049c8fb, 0x0047c7fb, 0x0045c7fb, 0x0043c6fa, 0x0041c6fa, 0x0040c6f9, + 0x003fc4f9, 0x003ec3f9, 0x003ec2fa, 0x003ec2fb, 0x003abef5, 0x003ec2f8, 0x003bc1f9, + 0x0037c0f9, 0x0036beff, 0x0035bbff, 0x0067bb84, 0x00b0d219, 0x00b4d31a, 0x00d3da39, + 0x00e2dd3d, 0x00d6d532, 0x00e1df38, 0x00ece93e, 0x00e1e636, 0x00e9e536, 0x00f1e634, + 0x00e5e42b, 0x00f6e62e, 0x00e9eb29, 0x00f0ee2a, 0x00f0e824, 0x00ece420, 0x00e9e01d, + 0x00ebdb1c, 0x00edd71c, 0x00e9ce19, 0x00e5c516, 0x00e7c004, 0x006cb292, 0x00109dfc, + 0x0018a1f7, 0x001aa0f5, 0x001ca0f3, 0x0019a0f6, 0x00179ff9, 0x00169ef9, 0x00169cf9, + 0x00159bf8, 0x00159af8, 0x001499f8, 0x001499f7, 0x001499f7, 0x0058d4f6, 0x0056d4f6, + 0x0054d5f7, 0x0057d3f7, 0x005bd1f8, 0x0058d0f6, 0x0054cff5, 0x0050cef8, 0x004dcdfa, + 0x004bcbfb, 0x004acafb, 0x0048c9fb, 0x0046c7fb, 0x0045c7fa, 0x0043c7fa, 0x0042c6fa, + 0x0040c6f9, 0x003fc4f9, 0x003ec3f9, 0x003dc1f9, 0x003cc0f9, 0x003cc1f8, 0x003cc2f7, + 0x0038bff6, 0x0034bbf5, 0x0035bdfd, 0x0037beff, 0x0046bcfc, 0x0082c92c, 0x00a0be02, + 0x00b8c420, 0x00d8cf31, 0x00d2d632, 0x00d4d52e, 0x00d7d42a, 0x00cdd725, 0x00e9df2f, + 0x00e6dd2a, 0x00e4dc25, 0x00edd922, 0x00e0e220, 0x00ede927, 0x00eae01e, 0x00e4da1c, + 0x00ded319, 0x00e5d01a, 0x00ebcd1b, 0x00e5c818, 0x00dec214, 0x00f0bc00, 0x001da5eb, + 0x0019a1ff, 0x0016a2f7, 0x0019a2f4, 0x001ea2f1, 0x001aa0f5, 0x00169ff9, 0x00169ef8, + 0x00159df8, 0x00159cf8, 0x00149bf8, 0x00139af7, 0x001299f6, 0x001299f6, 0x005ed5f9, + 0x0063d6fc, 0x0068d6ff, 0x005fd3fc, 0x0056d0f8, 0x0053cff8, 0x0051cef8, 0x004ecdf9, + 0x004bccfb, 0x004acbfb, 0x0048cafb, 0x0047c9fa, 0x0046c8fb, 0x0044c7fa, 0x0043c7fa, + 0x0042c6fa, 0x0040c5f9, 0x003fc4f9, 0x003ec3f9, 0x003dc1f9, 0x003cc0f9, 0x003bc1f9, + 0x003bc1f8, 0x0038bff7, 0x0036bdf7, 0x0035bdfa, 0x0034bdfe, 0x0022c3f6, 0x0027bbfc, + 0x0053b0b2, 0x009bc606, 0x00c1d322, 0x00d3dd36, 0x00b4ba12, 0x00c4c71f, 0x00c5cf22, + 0x00d9d82d, 0x00dfdb30, 0x00dcd52b, 0x00e8d520, 0x00d5d51c, 0x00e8e428, 0x00ece324, + 0x00d1ce1f, 0x00d3c51d, 0x00dcc302, 0x00cfc312, 0x00e3c209, 0x00e3be00, 0x0084bf6e, + 0x000ca0f6, 0x00129ffd, 0x0018a2f6, 0x0019a1f5, 0x001ba1f4, 0x0018a0f6, 0x00169ff8, + 0x00159ef8, 0x00159df8, 0x00149cf7, 0x00139bf7, 0x00129af6, 0x001098f4, 0x001098f4, + 0x0065d7fb, 0x005dd4fa, 0x0056d2f8, 0x0053d0f9, 0x0050cff9, 0x004fcef9, 0x004dcdfa, + 0x004bcdfa, 0x004accfb, 0x0048cbfb, 0x0047cafb, 0x0046c9fa, 0x0045c8fa, 0x0044c7fa, + 0x0043c7fa, 0x0042c6fa, 0x0040c5fa, 0x003fc4f9, 0x003ec3f9, 0x003dc1f9, 0x003bc0f9, + 0x003ac0f9, 0x0039c0f9, 0x0038bff9, 0x0037bff9, 0x0034bef8, 0x0031bcf7, 0x0033bbf8, + 0x0035bbfa, 0x002cbcff, 0x0061c2df, 0x0093cb85, 0x00c5d52b, 0x00cbd82f, 0x00b0bb13, + 0x00b5be17, 0x00b9c21b, 0x00c7c826, 0x00c5bf21, 0x00dbc817, 0x00cac819, 0x00dbd722, + 0x00ddd61a, 0x00b7bd0d, 0x00c8bd04, 0x00d0c000, 0x00adc951, 0x006cb8b1, 0x0004a3ff, + 0x0013a4fb, 0x0021a4f5, 0x001ea3f5, 0x001aa1f6, 0x0019a1f6, 0x0018a0f7, 0x0017a0f7, + 0x00169ff8, 0x00159ef7, 0x00149ef7, 0x00139df7, 0x00139cf6, 0x00119af4, 0x000f98f2, + 0x000f98f2, 0x005cd5f9, 0x0058d3f8, 0x0053d1f8, 0x0052d0f9, 0x0050cff9, 0x004ecefa, + 0x004ccdfa, 0x004accfa, 0x0048ccfa, 0x0047cbfa, 0x0046cafa, 0x0045c9fa, 0x0044c8fa, + 0x0043c7fa, 0x0042c7fa, 0x0041c6fa, 0x0040c5fa, 0x003fc4f9, 0x003ec2f9, 0x003cc1f9, + 0x003bc0f9, 0x003ac0f9, 0x0038bff9, 0x0037bff9, 0x0036bff9, 0x0035bdf6, 0x0034bbf3, + 0x0035b9f7, 0x0035b8fb, 0x0022b5ff, 0x002fb5ff, 0x004dbae6, 0x006bbfce, 0x0027b1c5, + 0x006cbc7c, 0x008abd49, 0x00a7be15, 0x00b9bf09, 0x00ccc000, 0x00dac43d, 0x00bbca20, + 0x00aec73e, 0x0099bc54, 0x005aad8b, 0x0036abc4, 0x0004b3ff, 0x0015a7ff, 0x0021a4ff, + 0x0019a0fb, 0x001ba2fa, 0x001da4f9, 0x001ba3f8, 0x001aa1f7, 0x0019a1f7, 0x0018a0f7, + 0x0017a0f7, 0x00169ff8, 0x00159ef7, 0x00149ef7, 0x00139df7, 0x00129cf6, 0x00119af5, + 0x000f99f3, 0x000f99f3, 0x0053d2f6, 0x0052d1f7, 0x0051d1f8, 0x0050d0f9, 0x004fcffa, + 0x004dcefa, 0x004bcdfa, 0x0049ccfa, 0x0047cbfa, 0x0046caf9, 0x0045caf9, 0x0044c9f9, + 0x0044c8fa, 0x0043c7fa, 0x0042c6f9, 0x0041c6f9, 0x0040c5fa, 0x003fc4f9, 0x003dc2f9, + 0x003cc1f9, 0x003ac0f9, 0x0039c0f9, 0x0038bff9, 0x0036bff9, 0x0035bef8, 0x0036bcf4, + 0x0038baf0, 0x0036b8f6, 0x0034b5fc, 0x002cb6f9, 0x0023b7f6, 0x0025b5fa, 0x0028b4ff, + 0x0028b6ff, 0x0029b7ff, 0x001fb5ff, 0x0015b2ff, 0x0020aef7, 0x003cb9ff, 0x005acbf0, + 0x0042befa, 0x002ab6fc, 0x0012adff, 0x0018acfc, 0x001eacfa, 0x001ea9fd, 0x001ea7ff, + 0x001ba8fa, 0x0018a8f4, 0x0018a6f8, 0x0018a4fd, 0x0019a3fa, 0x001aa1f7, 0x0019a1f7, + 0x0018a0f8, 0x0017a0f8, 0x00169ff8, 0x00159ef7, 0x00149df7, 0x00139cf6, 0x00129bf6, + 0x00119af5, 0x001099f4, 0x001099f4, 0x0054d1f8, 0x0052d1f8, 0x0051d0f9, 0x004fcff9, + 0x004ecffa, 0x004ccefa, 0x004acdf9, 0x0048ccf9, 0x0045cbf9, 0x0045caf9, 0x0044c9f9, + 0x0043c8f9, 0x0043c8f9, 0x0042c7f9, 0x0042c6f9, 0x0041c5f9, 0x0040c5fa, 0x003fc4f9, + 0x003dc2f9, 0x003bc1f9, 0x003ac0fa, 0x0038bff9, 0x0037bff9, 0x0036bef9, 0x0034bef8, + 0x0035bcf6, 0x0035baf5, 0x0034b8f8, 0x0033b6fc, 0x002eb6f9, 0x0029b6f7, 0x0029b5f8, + 0x002ab4fa, 0x002ab5fb, 0x002ab5fc, 0x002ab2f6, 0x002aafef, 0x001ba9f6, 0x009bcfd9, + 0x006dcfe9, 0x0074c7e4, 0x0080c9dd, 0x0019adfb, 0x001cacf9, 0x001fabf8, 0x001fa9f9, + 0x001ea7fb, 0x001ca7f9, 0x001aa7f6, 0x001aa5f8, 0x001aa4fb, 0x001aa3fa, 0x001aa2f8, + 0x0019a1f8, 0x0018a0f8, 0x0017a0f8, 0x00169ff8, 0x00159ef7, 0x00149df7, 0x00139cf6, + 0x00129bf6, 0x00119bf5, 0x00119af5, 0x00119af5, 0x0055d0f9, 0x0053d0fa, 0x0051d0fa, + 0x004fcffa, 0x004dcffa, 0x004bcefa, 0x0049cdf9, 0x0046ccf9, 0x0044caf8, 0x0043caf8, + 0x0043c9f8, 0x0043c8f9, 0x0042c8f9, 0x0042c7f9, 0x0041c6f9, 0x0041c6f9, 0x0040c5fa, + 0x003ec3f9, 0x003dc2fa, 0x003bc1fa, 0x0039c0fa, 0x0038bff9, 0x0036bff9, 0x0035bef9, + 0x0034bdf8, 0x0033bcf9, 0x0033bafa, 0x0032b9fb, 0x0032b8fc, 0x0030b7fa, 0x002eb6f8, + 0x002db5f7, 0x002bb4f5, 0x002bb4f6, 0x002bb3f7, 0x0029b2f9, 0x0028b2fc, 0x0030b2f7, + 0x0012a8fe, 0x007fd4e1, 0x0058bbe6, 0x0015aafb, 0x001fadf8, 0x0020acf7, 0x0020aaf5, + 0x001fa9f6, 0x001ea8f7, 0x001da6f7, 0x001ca5f8, 0x001ca4f8, 0x001ba3f9, 0x001ba3f9, + 0x001ba2f9, 0x0019a1f9, 0x0018a0f8, 0x0017a0f8, 0x00169ff8, 0x00159ef7, 0x00149df7, + 0x00139cf6, 0x00129bf5, 0x00129bf5, 0x00129bf5, 0x00129bf5, 0x0055d0f9, 0x0053d0fa, + 0x0051d0fa, 0x004fcffa, 0x004dcffa, 0x004bcefa, 0x0049cdf9, 0x0046ccf9, 0x0044caf8, + 0x0043caf8, 0x0043c9f8, 0x0043c8f9, 0x0042c8f9, 0x0042c7f9, 0x0041c6f9, 0x0041c6f9, + 0x0040c5fa, 0x003ec3f9, 0x003dc2fa, 0x003bc1fa, 0x0039c0fa, 0x0038bff9, 0x0036bff9, + 0x0035bef9, 0x0034bdf8, 0x0033bcf9, 0x0033bafa, 0x0032b9fb, 0x0032b8fc, 0x0030b7fa, + 0x002eb6f8, 0x002db5f7, 0x002bb4f5, 0x002bb4f6, 0x002bb3f7, 0x002ab2f8, 0x0029b2fa, + 0x002db6f5, 0x001db5f6, 0x00239bff, 0x0020b6f3, 0x000cacfb, 0x001eacf7, 0x001fabf6, + 0x0020aaf5, 0x001fa9f6, 0x001ea8f7, 0x001da6f7, 0x001ca5f8, 0x001ca4f8, 0x001ba3f9, + 0x001ba3f9, 0x001ba2f9, 0x0019a1f9, 0x0018a0f8, 0x0017a0f8, 0x00169ff8, 0x00159ef7, + 0x00149df7, 0x00139cf6, 0x00129bf5, 0x00129bf5, 0x00129bf5, 0x00129bf5, 0x0055d0f9, + 0x0053d0fa, 0x0051d0fa, 0x004fcffa, 0x004dcffa, 0x004bcefa, 0x0049cdf9, 0x0046ccf9, + 0x0044caf8, 0x0043caf8, 0x0043c9f8, 0x0043c8f9, 0x0042c8f9, 0x0042c7f9, 0x0041c6f9, + 0x0041c6f9, 0x0040c5fa, 0x003ec3f9, 0x003dc2fa, 0x003bc1fa, 0x0039c0fa, 0x0038bff9, + 0x0036bff9, 0x0035bef9, 0x0034bdf8, 0x0033bcf9, 0x0033bafa, 0x0032b9fb, 0x0032b8fc, + 0x0030b7fa, 0x002eb6f8, 0x002db5f7, 0x002bb4f5, 0x002bb4f6, 0x002bb3f7, 0x002bb2f8, + 0x002bb1f8, 0x0022aff9, 0x0019acfa, 0x001eadf7, 0x0024aef3, 0x0020adf5, 0x001dabf6, + 0x001fabf6, 0x0020aaf5, 0x001fa9f6, 0x001ea8f7, 0x001da6f7, 0x001ca5f8, 0x001ca4f8, + 0x001ba3f9, 0x001ba3f9, 0x001ba2f9, 0x0019a1f9, 0x0018a0f8, 0x0017a0f8, 0x00169ff8, + 0x00159ef7, 0x00149df7, 0x00139cf6, 0x00129bf5, 0x00129bf5, 0x00129bf5, 0x00129bf5, + 0x0055d0f9, 0x0053d0fa, 0x0051d0fa, 0x004fcffa, 0x004dcffa, 0x004bcefa, 0x0049cdf9, + 0x0046ccf9, 0x0044caf8, 0x0043caf8, 0x0043c9f8, 0x0043c8f9, 0x0042c8f9, 0x0042c7f9, + 0x0041c6f9, 0x0041c6f9, 0x0040c5fa, 0x003ec3f9, 0x003dc2fa, 0x003bc1fa, 0x0039c0fa, + 0x0038bff9, 0x0036bff9, 0x0035bef9, 0x0034bdf8, 0x0033bcf9, 0x0033bafa, 0x0032b9fb, + 0x0032b8fc, 0x0030b7fa, 0x002eb6f8, 0x002db5f7, 0x002bb4f5, 0x002bb4f6, 0x002bb3f7, + 0x002bb2f8, 0x002bb1f8, 0x0022aff9, 0x0019acfa, 0x001eadf7, 0x0024aef3, 0x0020adf5, + 0x001dabf6, 0x001fabf6, 0x0020aaf5, 0x001fa9f6, 0x001ea8f7, 0x001da6f7, 0x001ca5f8, + 0x001ca4f8, 0x001ba3f9, 0x001ba3f9, 0x001ba2f9, 0x0019a1f9, 0x0018a0f8, 0x0017a0f8, + 0x00169ff8, 0x00159ef7, 0x00149df7, 0x00139cf6, 0x00129bf5, 0x00129bf5, 0x00129bf5, + 0x00129bf5 + }; #define IMG_WIDTH 64 #define IMG_HEIGHT 64 @@ -734,11 +807,12 @@ static INLINE size_t fuzzyCompare(BYTE b1, BYTE b2) return b2 - b1; } -static BOOL fuzzyCompareImage(const UINT32 *refImage, const BYTE *img, size_t npixels) { +static BOOL fuzzyCompareImage(const UINT32* refImage, const BYTE* img, size_t npixels) +{ size_t i; size_t totalDelta = 0; - for(i = 0; i < npixels; i++, refImage++) + for (i = 0; i < npixels; i++, refImage++) { BYTE A = *img++; BYTE R = *img++; @@ -774,7 +848,7 @@ int TestFreeRDPCodecRemoteFX(int argc, char* argv[]) int rc = -1; REGION16 region = { 0 }; RFX_CONTEXT* context = NULL; - BYTE *dest = NULL; + BYTE* dest = NULL; size_t stride = FORMAT_SIZE * IMG_WIDTH; context = rfx_context_new(FALSE); @@ -786,13 +860,13 @@ int TestFreeRDPCodecRemoteFX(int argc, char* argv[]) goto fail; region16_init(®ion); - if (!rfx_process_message(context, encodeHeaderSample, sizeof(encodeHeaderSample), 0, 0, dest, FORMAT, - stride, IMG_HEIGHT, ®ion)) + if (!rfx_process_message(context, encodeHeaderSample, sizeof(encodeHeaderSample), 0, 0, dest, + FORMAT, stride, IMG_HEIGHT, ®ion)) goto fail; region16_clear(®ion); - if(!rfx_process_message(context, encodeDataSample, sizeof(encodeDataSample), 0, 0, dest, FORMAT, - stride, IMG_HEIGHT, ®ion)) + if (!rfx_process_message(context, encodeDataSample, sizeof(encodeDataSample), 0, 0, dest, + FORMAT, stride, IMG_HEIGHT, ®ion)) goto fail; region16_print(®ion); diff --git a/libfreerdp/codec/test/TestFreeRDPCodecXCrush.c b/libfreerdp/codec/test/TestFreeRDPCodecXCrush.c index 33fa4b057..cfe085218 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecXCrush.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecXCrush.c @@ -11,16 +11,15 @@ static const BYTE TEST_BELLS_DATA_XCRUSH[] = "\x65\x6c\x6c\x2e\x74\x6f\x6c\x6c\x73\x2e\x66\x6f\x72\x2e\x74\x68" "\x65"; -static const BYTE TEST_ISLAND_DATA[] = - "No man is an island entire of itself; every man " - "is a piece of the continent, a part of the main; " - "if a clod be washed away by the sea, Europe " - "is the less, as well as if a promontory were, as" - "well as any manner of thy friends or of thine " - "own were; any man's death diminishes me, " - "because I am involved in mankind. " - "And therefore never send to know for whom " - "the bell tolls; it tolls for thee."; +static const BYTE TEST_ISLAND_DATA[] = "No man is an island entire of itself; every man " + "is a piece of the continent, a part of the main; " + "if a clod be washed away by the sea, Europe " + "is the less, as well as if a promontory were, as" + "well as any manner of thy friends or of thine " + "own were; any man's death diminishes me, " + "because I am involved in mankind. " + "And therefore never send to know for whom " + "the bell tolls; it tolls for thee."; static const BYTE TEST_ISLAND_DATA_XCRUSH[] = "\x12\x61\x4e\x6f\x20\x6d\x61\x6e\x20\x69\x73\x20\xf8\xd2\xd8\xc2" @@ -56,17 +55,18 @@ int test_XCrushCompressBells() XCRUSH_CONTEXT* xcrush; xcrush = xcrush_context_new(TRUE); SrcSize = sizeof(TEST_BELLS_DATA) - 1; - pSrcData = (BYTE*) TEST_BELLS_DATA; + pSrcData = (BYTE*)TEST_BELLS_DATA; expectedSize = sizeof(TEST_BELLS_DATA_XCRUSH) - 1; pDstData = OutputBuffer; DstSize = sizeof(OutputBuffer); ZeroMemory(OutputBuffer, sizeof(OutputBuffer)); status = xcrush_compress(xcrush, pSrcData, SrcSize, &pDstData, &DstSize, &Flags); - printf("status: %d Flags: 0x%08"PRIX32" DstSize: %"PRIu32"\n", status, Flags, DstSize); + printf("status: %d Flags: 0x%08" PRIX32 " DstSize: %" PRIu32 "\n", status, Flags, DstSize); if (DstSize != expectedSize) { - printf("XCrushCompressBells: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + printf("XCrushCompressBells: output size mismatch: Actual: %" PRIu32 ", Expected: %" PRIu32 + "\n", DstSize, expectedSize); printf("Actual\n"); BitDump(__FUNCTION__, WLOG_INFO, pDstData, DstSize * 8, 0); @@ -102,17 +102,18 @@ int test_XCrushCompressIsland() XCRUSH_CONTEXT* xcrush; xcrush = xcrush_context_new(TRUE); SrcSize = sizeof(TEST_ISLAND_DATA) - 1; - pSrcData = (BYTE*) TEST_ISLAND_DATA; + pSrcData = (BYTE*)TEST_ISLAND_DATA; expectedSize = sizeof(TEST_ISLAND_DATA_XCRUSH) - 1; pDstData = OutputBuffer; DstSize = sizeof(OutputBuffer); ZeroMemory(OutputBuffer, sizeof(OutputBuffer)); status = xcrush_compress(xcrush, pSrcData, SrcSize, &pDstData, &DstSize, &Flags); - printf("status: %d Flags: 0x%08"PRIX32" DstSize: %"PRIu32"\n", status, Flags, DstSize); + printf("status: %d Flags: 0x%08" PRIX32 " DstSize: %" PRIu32 "\n", status, Flags, DstSize); if (DstSize != expectedSize) { - printf("XCrushCompressIsland: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + printf("XCrushCompressIsland: output size mismatch: Actual: %" PRIu32 ", Expected: %" PRIu32 + "\n", DstSize, expectedSize); printf("Actual\n"); BitDump(__FUNCTION__, WLOG_INFO, pDstData, DstSize * 8, 0); @@ -140,11 +141,10 @@ int TestFreeRDPCodecXCrush(int argc, char* argv[]) WINPR_UNUSED(argc); WINPR_UNUSED(argv); - //if (test_XCrushCompressBells() < 0) + // if (test_XCrushCompressBells() < 0) // return -1; if (test_XCrushCompressIsland() < 0) return -1; return 0; } - diff --git a/libfreerdp/codec/test/TestFreeRDPCodecZGfx.c b/libfreerdp/codec/test/TestFreeRDPCodecZGfx.c index 7cdd91119..f26db255b 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecZGfx.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecZGfx.c @@ -7,10 +7,9 @@ #include /* Sample from [MS-RDPEGFX] */ -static const BYTE TEST_FOX_DATA[] = - "The quick brown " - "fox jumps over t" - "he lazy dog"; +static const BYTE TEST_FOX_DATA[] = "The quick brown " + "fox jumps over t" + "he lazy dog"; static const BYTE TEST_FOX_DATA_SINGLE[] = "\xE0\x04\x54\x68\x65\x20\x71\x75\x69\x63\x6B\x20\x62\x72\x6F\x77" @@ -41,7 +40,7 @@ static int test_ZGfxCompressFox(void) return -1; SrcSize = sizeof(TEST_FOX_DATA) - 1; - pSrcData = (BYTE*) TEST_FOX_DATA; + pSrcData = (BYTE*)TEST_FOX_DATA; Flags = 0; expectedSize = sizeof(TEST_FOX_DATA_SINGLE) - 1; status = zgfx_compress(zgfx, pSrcData, SrcSize, &pDstData, &DstSize, &Flags); @@ -49,11 +48,12 @@ static int test_ZGfxCompressFox(void) if (status < 0) goto fail; - printf("flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize); + printf("flags: 0x%08" PRIX32 " size: %" PRIu32 "\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("test_ZGfxCompressFox: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + printf("test_ZGfxCompressFox: output size mismatch: Actual: %" PRIu32 ", Expected: %" PRIu32 + "\n", DstSize, expectedSize); goto fail; } @@ -92,7 +92,7 @@ static int test_ZGfxDecompressFoxSingle(void) return -1; SrcSize = sizeof(TEST_FOX_DATA_SINGLE) - 1; - pSrcData = (BYTE*) TEST_FOX_DATA_SINGLE; + pSrcData = (BYTE*)TEST_FOX_DATA_SINGLE; Flags = 0; expectedSize = sizeof(TEST_FOX_DATA) - 1; status = zgfx_decompress(zgfx, pSrcData, SrcSize, &pDstData, &DstSize, Flags); @@ -100,11 +100,12 @@ static int test_ZGfxDecompressFoxSingle(void) if (status < 0) goto fail; - printf("flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize); + printf("flags: 0x%08" PRIX32 " size: %" PRIu32 "\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("test_ZGfxDecompressFoxSingle: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + printf("test_ZGfxDecompressFoxSingle: output size mismatch: Actual: %" PRIu32 + ", Expected: %" PRIu32 "\n", DstSize, expectedSize); goto fail; } @@ -143,7 +144,7 @@ static int test_ZGfxDecompressFoxMultipart(void) return -1; SrcSize = sizeof(TEST_FOX_DATA_MULTIPART) - 1; - pSrcData = (BYTE*) TEST_FOX_DATA_MULTIPART; + pSrcData = (BYTE*)TEST_FOX_DATA_MULTIPART; Flags = 0; expectedSize = sizeof(TEST_FOX_DATA) - 1; status = zgfx_decompress(zgfx, pSrcData, SrcSize, &pDstData, &DstSize, Flags); @@ -151,11 +152,12 @@ static int test_ZGfxDecompressFoxMultipart(void) if (status < 0) goto fail; - printf("flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize); + printf("flags: 0x%08" PRIX32 " size: %" PRIu32 "\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("test_ZGfxDecompressFoxSingle: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + printf("test_ZGfxDecompressFoxSingle: output size mismatch: Actual: %" PRIu32 + ", Expected: %" PRIu32 "\n", DstSize, expectedSize); goto fail; } @@ -200,25 +202,26 @@ static int test_ZGfxCompressConsistent(void) /* Compress */ expectedSize = SrcSize = sizeof(BigBuffer); - pSrcData = (BYTE*) BigBuffer; + pSrcData = (BYTE*)BigBuffer; Flags = 0; status = zgfx_compress(zgfx, pSrcData, SrcSize, &pDstData2, &DstSize2, &Flags); if (status < 0) goto fail; - printf("Compress: flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize2); + printf("Compress: flags: 0x%08" PRIX32 " size: %" PRIu32 "\n", Flags, DstSize2); /* Decompress */ status = zgfx_decompress(zgfx, pDstData2, DstSize2, &pDstData, &DstSize, Flags); if (status < 0) goto fail; - printf("Decompress: flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize); + printf("Decompress: flags: 0x%08" PRIX32 " size: %" PRIu32 "\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("test_ZGfxDecompressFoxSingle: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + printf("test_ZGfxDecompressFoxSingle: output size mismatch: Actual: %" PRIu32 + ", Expected: %" PRIu32 "\n", DstSize, expectedSize); goto fail; } @@ -268,4 +271,3 @@ int TestFreeRDPCodecZGfx(int argc, char* argv[]) return 0; } - diff --git a/libfreerdp/codec/test/TestFreeRDPRegion.c b/libfreerdp/codec/test/TestFreeRDPRegion.c index 35aad8ac6..6ac72d667 100644 --- a/libfreerdp/codec/test/TestFreeRDPRegion.c +++ b/libfreerdp/codec/test/TestFreeRDPRegion.c @@ -22,7 +22,6 @@ #include - static BOOL compareRectangles(const RECTANGLE_16* src1, const RECTANGLE_16* src2, int nb) { int i; @@ -32,10 +31,10 @@ static BOOL compareRectangles(const RECTANGLE_16* src1, const RECTANGLE_16* src2 if (memcmp(src1, src2, sizeof(RECTANGLE_16))) { fprintf(stderr, - "expecting rect %d (%"PRIu16",%"PRIu16"-%"PRIu16",%"PRIu16") and have (%"PRIu16",%"PRIu16"-%"PRIu16",%"PRIu16")\n", - i, src2->left, src2->top, src2->right, src2->bottom, - src1->left, src1->top, src1->right, src1->bottom - ); + "expecting rect %d (%" PRIu16 ",%" PRIu16 "-%" PRIu16 ",%" PRIu16 + ") and have (%" PRIu16 ",%" PRIu16 "-%" PRIu16 ",%" PRIu16 ")\n", + i, src2->left, src2->top, src2->right, src2->bottom, src1->left, src1->top, + src1->right, src1->bottom); return FALSE; } } @@ -43,7 +42,6 @@ static BOOL compareRectangles(const RECTANGLE_16* src1, const RECTANGLE_16* src2 return TRUE; } - static int test_basic(void) { REGION16 region; @@ -51,13 +49,9 @@ static int test_basic(void) const RECTANGLE_16* rects; UINT32 nbRects; /* R1 + R2 ==> disjointed rects */ - RECTANGLE_16 r1 = { 0, 101, 200, 201}; - RECTANGLE_16 r2 = {150, 301, 250, 401}; - RECTANGLE_16 r1_r2[] = - { - {0, 101, 200, 201}, - {150, 301, 250, 401} - }; + RECTANGLE_16 r1 = { 0, 101, 200, 201 }; + RECTANGLE_16 r2 = { 150, 301, 250, 401 }; + RECTANGLE_16 r1_r2[] = { { 0, 101, 200, 201 }, { 150, 301, 250, 401 } }; /* r1 */ region16_init(®ion); @@ -91,21 +85,15 @@ out: return retCode; } - static int test_r1_r3(void) { REGION16 region; int retCode = -1; const RECTANGLE_16* rects; UINT32 nbRects; - RECTANGLE_16 r1 = { 0, 101, 200, 201}; - RECTANGLE_16 r3 = {150, 151, 250, 251}; - RECTANGLE_16 r1_r3[] = - { - { 0, 101, 200, 151}, - { 0, 151, 250, 201}, - {150, 201, 250, 251} - }; + RECTANGLE_16 r1 = { 0, 101, 200, 201 }; + RECTANGLE_16 r3 = { 150, 151, 250, 251 }; + RECTANGLE_16 r1_r3[] = { { 0, 101, 200, 151 }, { 0, 151, 250, 201 }, { 150, 201, 250, 251 } }; region16_init(®ion); /* * +=============================================================== @@ -151,7 +139,6 @@ out: return retCode; } - static int test_r9_r10(void) { REGION16 region; @@ -171,13 +158,12 @@ static int test_r9_r10(void) * |+--| |-+ +--+---+-+ * | +---+ +---+ */ - RECTANGLE_16 r9 = { 0, 100, 400, 200}; - RECTANGLE_16 r10 = {200, 0, 300, 300}; - RECTANGLE_16 r9_r10[] = - { - {200, 0, 300, 100}, - { 0, 100, 400, 200}, - {200, 200, 300, 300}, + RECTANGLE_16 r9 = { 0, 100, 400, 200 }; + RECTANGLE_16 r10 = { 200, 0, 300, 300 }; + RECTANGLE_16 r9_r10[] = { + { 200, 0, 300, 100 }, + { 0, 100, 400, 200 }, + { 200, 200, 300, 300 }, }; region16_init(®ion); @@ -198,21 +184,15 @@ out: return retCode; } - static int test_r1_r5(void) { REGION16 region; int retCode = -1; const RECTANGLE_16* rects; UINT32 nbRects; - RECTANGLE_16 r1 = { 0, 101, 200, 201}; - RECTANGLE_16 r5 = {150, 121, 300, 131}; - RECTANGLE_16 r1_r5[] = - { - { 0, 101, 200, 121}, - { 0, 121, 300, 131}, - { 0, 131, 200, 201} - }; + RECTANGLE_16 r1 = { 0, 101, 200, 201 }; + RECTANGLE_16 r5 = { 150, 121, 300, 131 }; + RECTANGLE_16 r1_r5[] = { { 0, 101, 200, 121 }, { 0, 121, 300, 131 }, { 0, 131, 200, 201 } }; region16_init(®ion); /* @@ -251,8 +231,8 @@ static int test_r1_r6(void) int retCode = -1; const RECTANGLE_16* rects; UINT32 nbRects; - RECTANGLE_16 r1 = { 0, 101, 200, 201}; - RECTANGLE_16 r6 = {150, 121, 170, 131}; + RECTANGLE_16 r1 = { 0, 101, 200, 201 }; + RECTANGLE_16 r6 = { 150, 121, 170, 131 }; region16_init(®ion); /* * +=============================================================== @@ -285,21 +265,16 @@ out: return retCode; } - static int test_r1_r2_r4(void) { REGION16 region; int retCode = -1; const RECTANGLE_16* rects; UINT32 nbRects; - RECTANGLE_16 r1 = { 0, 101, 200, 201}; - RECTANGLE_16 r2 = {150, 301, 250, 401}; - RECTANGLE_16 r4 = {150, 251, 250, 301}; - RECTANGLE_16 r1_r2_r4[] = - { - { 0, 101, 200, 201}, - {150, 251, 250, 401} - }; + RECTANGLE_16 r1 = { 0, 101, 200, 201 }; + RECTANGLE_16 r2 = { 150, 301, 250, 401 }; + RECTANGLE_16 r4 = { 150, 251, 250, 301 }; + RECTANGLE_16 r1_r2_r4[] = { { 0, 101, 200, 201 }, { 150, 251, 250, 401 } }; /* * +=============================================================== * | @@ -339,23 +314,18 @@ out: return retCode; } - static int test_r1_r7_r8(void) { REGION16 region; int retCode = -1; const RECTANGLE_16* rects; UINT32 nbRects; - RECTANGLE_16 r1 = { 0, 101, 200, 201}; - RECTANGLE_16 r7 = {300, 101, 500, 201}; - RECTANGLE_16 r8 = {150, 121, 400, 131}; - RECTANGLE_16 r1_r7_r8[] = - { - { 0, 101, 200, 121}, - {300, 101, 500, 121}, - { 0, 121, 500, 131}, - { 0, 131, 200, 201}, - {300, 131, 500, 201}, + RECTANGLE_16 r1 = { 0, 101, 200, 201 }; + RECTANGLE_16 r7 = { 300, 101, 500, 201 }; + RECTANGLE_16 r8 = { 150, 121, 400, 131 }; + RECTANGLE_16 r1_r7_r8[] = { + { 0, 101, 200, 121 }, { 300, 101, 500, 121 }, { 0, 121, 500, 131 }, + { 0, 131, 200, 201 }, { 300, 131, 500, 201 }, }; /* * +=============================================================== @@ -423,30 +393,22 @@ out: return retCode; } - static int test_r1_r2_r3_r4(void) { REGION16 region; int retCode = -1; const RECTANGLE_16* rects; UINT32 nbRects; - RECTANGLE_16 r1 = { 0, 101, 200, 201}; - RECTANGLE_16 r2 = {150, 301, 250, 401}; - RECTANGLE_16 r3 = {150, 151, 250, 251}; - RECTANGLE_16 r4 = {150, 251, 250, 301}; - RECTANGLE_16 r1_r2_r3[] = - { - { 0, 101, 200, 151}, - { 0, 151, 250, 201}, - {150, 201, 250, 251}, - {150, 301, 250, 401} - }; - RECTANGLE_16 r1_r2_r3_r4[] = - { - { 0, 101, 200, 151}, - { 0, 151, 250, 201}, - {150, 201, 250, 401} + RECTANGLE_16 r1 = { 0, 101, 200, 201 }; + RECTANGLE_16 r2 = { 150, 301, 250, 401 }; + RECTANGLE_16 r3 = { 150, 151, 250, 251 }; + RECTANGLE_16 r4 = { 150, 251, 250, 301 }; + RECTANGLE_16 r1_r2_r3[] = { + { 0, 101, 200, 151 }, { 0, 151, 250, 201 }, { 150, 201, 250, 251 }, { 150, 301, 250, 401 } }; + RECTANGLE_16 r1_r2_r3_r4[] = { { 0, 101, 200, 151 }, + { 0, 151, 250, 201 }, + { 150, 201, 250, 401 } }; region16_init(®ion); /* @@ -508,7 +470,6 @@ out: return retCode; } - static int test_from_weston(void) { /* @@ -520,15 +481,10 @@ static int test_from_weston(void) int retCode = -1; const RECTANGLE_16* rects; UINT32 nbRects; - RECTANGLE_16 r1 = { 0, 0, 640, 32}; - RECTANGLE_16 r2 = {236, 169, 268, 201}; - RECTANGLE_16 r3 = {246, 258, 278, 290}; - RECTANGLE_16 r1_r2_r3[] = - { - { 0, 0, 640, 32}, - {236, 169, 268, 201}, - {246, 258, 278, 290} - }; + RECTANGLE_16 r1 = { 0, 0, 640, 32 }; + RECTANGLE_16 r2 = { 236, 169, 268, 201 }; + RECTANGLE_16 r3 = { 246, 258, 278, 290 }; + RECTANGLE_16 r1_r2_r3[] = { { 0, 0, 640, 32 }, { 236, 169, 268, 201 }, { 246, 258, 278, 290 } }; region16_init(®ion); /* @@ -572,11 +528,10 @@ static int test_r1_inter_r3(void) int retCode = -1; const RECTANGLE_16* rects; UINT32 nbRects; - RECTANGLE_16 r1 = { 0, 101, 200, 201}; - RECTANGLE_16 r3 = {150, 151, 250, 251}; - RECTANGLE_16 r1_inter_r3[] = - { - {150, 151, 200, 201}, + RECTANGLE_16 r1 = { 0, 101, 200, 201 }; + RECTANGLE_16 r3 = { 150, 151, 250, 251 }; + RECTANGLE_16 r1_inter_r3[] = { + { 150, 151, 200, 201 }, }; region16_init(®ion); region16_init(&intersection); @@ -619,12 +574,11 @@ static int test_r1_r3_inter_r11(void) int retCode = -1; const RECTANGLE_16* rects; UINT32 nbRects; - RECTANGLE_16 r1 = { 0, 101, 200, 201}; - RECTANGLE_16 r3 = {150, 151, 250, 251}; - RECTANGLE_16 r11 = {170, 151, 600, 301}; - RECTANGLE_16 r1_r3_inter_r11[] = - { - {170, 151, 250, 251}, + RECTANGLE_16 r1 = { 0, 101, 200, 201 }; + RECTANGLE_16 r3 = { 150, 151, 250, 251 }; + RECTANGLE_16 r11 = { 170, 151, 600, 301 }; + RECTANGLE_16 r1_r3_inter_r11[] = { + { 170, 151, 250, 251 }, }; region16_init(®ion); region16_init(&intersection); @@ -679,22 +633,13 @@ static int test_norbert_case(void) int retCode = -1; const RECTANGLE_16* rects; UINT32 nbRects, i; - RECTANGLE_16 inRectangles[5] = - { - {1680, 0, 1920, 242}, - { 294, 242, 971, 776}, - {1680, 242, 1920, 776}, - {1680, 776, 1920, 1036}, - { 2, 1040, 53, 1078} - }; - RECTANGLE_16 screenRect = - { - 0, 0, 1920, 1080 - }; - RECTANGLE_16 expected_inter_extents = - { - 2, 0, 1920, 1078 - }; + RECTANGLE_16 inRectangles[5] = { { 1680, 0, 1920, 242 }, + { 294, 242, 971, 776 }, + { 1680, 242, 1920, 776 }, + { 1680, 776, 1920, 1036 }, + { 2, 1040, 53, 1078 } }; + RECTANGLE_16 screenRect = { 0, 0, 1920, 1080 }; + RECTANGLE_16 expected_inter_extents = { 2, 0, 1920, 1078 }; region16_init(®ion); region16_init(&intersection); @@ -757,8 +702,8 @@ static int test_norbert2_case(void) int retCode = -1; const RECTANGLE_16* rects; UINT32 nbRects = 0; - RECTANGLE_16 rect1 = { 464, 696, 476, 709 }; - RECTANGLE_16 rect2 = { 0, 0, 1024, 32 }; + RECTANGLE_16 rect1 = { 464, 696, 476, 709 }; + RECTANGLE_16 rect2 = { 0, 0, 1024, 32 }; region16_init(®ion); if (!region16_union_rect(®ion, ®ion, &rect1)) @@ -775,7 +720,8 @@ static int test_norbert2_case(void) if (nbRects != 1) { - fprintf(stderr, "%s: Error 3 - expected nbRects == 1 but got %"PRIu32"\n", __FUNCTION__, nbRects); + fprintf(stderr, "%s: Error 3 - expected nbRects == 1 but got %" PRIu32 "\n", __FUNCTION__, + nbRects); goto out; } @@ -799,7 +745,8 @@ static int test_norbert2_case(void) if (nbRects != 2) { - fprintf(stderr, "%s: Error 7 - expected nbRects == 2 but got %"PRIu32"\n", __FUNCTION__, nbRects); + fprintf(stderr, "%s: Error 7 - expected nbRects == 2 but got %" PRIu32 "\n", __FUNCTION__, + nbRects); goto out; } @@ -826,24 +773,10 @@ static int test_empty_rectangle(void) REGION16 region, intersection; int retCode = -1; int i; - RECTANGLE_16 emptyRectangles[3] = - { - { 0, 0, 0, 0}, - { 10, 10, 10, 11}, - { 10, 10, 11, 10} - }; - RECTANGLE_16 firstRect = - { - 0, 0, 100, 100 - }; - RECTANGLE_16 anotherRect = - { - 100, 100, 200, 200 - }; - RECTANGLE_16 expected_inter_extents = - { - 0, 0, 0, 0 - }; + RECTANGLE_16 emptyRectangles[3] = { { 0, 0, 0, 0 }, { 10, 10, 10, 11 }, { 10, 10, 11, 10 } }; + RECTANGLE_16 firstRect = { 0, 0, 100, 100 }; + RECTANGLE_16 anotherRect = { 100, 100, 200, 200 }; + RECTANGLE_16 expected_inter_extents = { 0, 0, 0, 0 }; region16_init(®ion); region16_init(&intersection); @@ -888,25 +821,22 @@ struct UnitaryTest TestFunction func; }; -static struct UnitaryTest tests[] = -{ - {"Basic trivial tests", test_basic}, - {"R1+R3 and R3+R1", test_r1_r3}, - {"R1+R5", test_r1_r5}, - {"R1+R6", test_r1_r6}, - {"R9+R10", test_r9_r10}, - {"R1+R2+R4", test_r1_r2_r4}, - {"R1+R7+R8 in many orders", test_r1_r7_r8}, - {"R1+R2+R3+R4", test_r1_r2_r3_r4}, - {"data from weston", test_from_weston}, - {"R1 & R3", test_r1_inter_r3}, - {"(R1+R3)&R11 (band merge)", test_r1_r3_inter_r11}, - {"norbert's case", test_norbert_case}, - {"norbert's case 2", test_norbert2_case}, - {"empty rectangle case", test_empty_rectangle}, +static struct UnitaryTest tests[] = { { "Basic trivial tests", test_basic }, + { "R1+R3 and R3+R1", test_r1_r3 }, + { "R1+R5", test_r1_r5 }, + { "R1+R6", test_r1_r6 }, + { "R9+R10", test_r9_r10 }, + { "R1+R2+R4", test_r1_r2_r4 }, + { "R1+R7+R8 in many orders", test_r1_r7_r8 }, + { "R1+R2+R3+R4", test_r1_r2_r3_r4 }, + { "data from weston", test_from_weston }, + { "R1 & R3", test_r1_inter_r3 }, + { "(R1+R3)&R11 (band merge)", test_r1_r3_inter_r11 }, + { "norbert's case", test_norbert_case }, + { "norbert's case 2", test_norbert2_case }, + { "empty rectangle case", test_empty_rectangle }, - {NULL, NULL} -}; + { NULL, NULL } }; int TestFreeRDPRegion(int argc, char* argv[]) { diff --git a/libfreerdp/codec/xcrush.c b/libfreerdp/codec/xcrush.c index e98ff15bd..cadfcd820 100644 --- a/libfreerdp/codec/xcrush.c +++ b/libfreerdp/codec/xcrush.c @@ -91,7 +91,8 @@ static const char* xcrush_get_level_1_compression_flags_string(UINT32 flags) return "L1_PACKET_AT_FRONT | L1_NO_COMPRESSION | L1_INNER_COMPRESSION"; else if (flags == (L1_PACKET_AT_FRONT | L1_NO_COMPRESSION | L1_COMPRESSED)) return "L1_PACKET_AT_FRONT | L1_NO_COMPRESSION | L1_COMPRESSED"; - else if (flags == (L1_PACKET_AT_FRONT | L1_NO_COMPRESSION | L1_COMPRESSED | L1_INNER_COMPRESSION)) + else if (flags == + (L1_PACKET_AT_FRONT | L1_NO_COMPRESSION | L1_COMPRESSED | L1_INNER_COMPRESSION)) return "L1_PACKET_AT_FRONT | L1_NO_COMPRESSION | L1_COMPRESSED | L1_INNER_COMPRESSION"; return "L1_UNKNOWN"; @@ -117,7 +118,7 @@ static UINT32 xcrush_update_hash(BYTE* data, UINT32 size) data += 4; } - return (UINT16) seed; + return (UINT16)seed; } static int xcrush_append_chunk(XCRUSH_CONTEXT* xcrush, BYTE* data, UINT32* beg, UINT32 end) @@ -135,7 +136,7 @@ static int xcrush_append_chunk(XCRUSH_CONTEXT* xcrush, BYTE* data, UINT32* beg, if (size >= 15) { - seed = xcrush_update_hash(&data[*beg], (UINT16) size); + seed = xcrush_update_hash(&data[*beg], (UINT16)size); xcrush->Signatures[xcrush->SignatureIndex].size = size; xcrush->Signatures[xcrush->SignatureIndex].seed = seed; xcrush->SignatureIndex++; @@ -252,7 +253,7 @@ static void xcrush_clear_hash_table_range(XCRUSH_CONTEXT* xcrush, UINT32 beg, UI } static int xcrush_find_next_matching_chunk(XCRUSH_CONTEXT* xcrush, XCRUSH_CHUNK* chunk, - XCRUSH_CHUNK** pNextChunk) + XCRUSH_CHUNK** pNextChunk) { UINT32 index; XCRUSH_CHUNK* next = NULL; @@ -323,7 +324,8 @@ static int xcrush_insert_chunk(XCRUSH_CONTEXT* xcrush, XCRUSH_SIGNATURE* signatu } static int xcrush_find_match_length(XCRUSH_CONTEXT* xcrush, UINT32 MatchOffset, UINT32 ChunkOffset, - UINT32 HistoryOffset, UINT32 SrcSize, UINT32 MaxMatchLength, XCRUSH_MATCH_INFO* MatchInfo) + UINT32 HistoryOffset, UINT32 SrcSize, UINT32 MaxMatchLength, + XCRUSH_MATCH_INFO* MatchInfo) { UINT32 MatchSymbol; UINT32 ChunkSymbol; @@ -368,8 +370,8 @@ static int xcrush_find_match_length(XCRUSH_CONTEXT* xcrush, UINT32 MatchOffset, ForwardMatchPtr = &HistoryBuffer[MatchOffset]; ForwardChunkPtr = &HistoryBuffer[ChunkOffset]; - if ((&MatchBuffer[MaxMatchLength + 1] < HistoryBufferEnd) - && (MatchBuffer[MaxMatchLength + 1] != ChunkBuffer[MaxMatchLength + 1])) + if ((&MatchBuffer[MaxMatchLength + 1] < HistoryBufferEnd) && + (MatchBuffer[MaxMatchLength + 1] != ChunkBuffer[MaxMatchLength + 1])) { return 0; } @@ -391,9 +393,8 @@ static int xcrush_find_match_length(XCRUSH_CONTEXT* xcrush, UINT32 MatchOffset, ReverseMatchPtr = MatchBuffer - 1; ReverseChunkPtr = ChunkBuffer - 1; - while ((ReverseMatchPtr > &HistoryBuffer[HistoryOffset]) - && (ReverseChunkPtr > HistoryBuffer) - && (*ReverseMatchPtr == *ReverseChunkPtr)) + while ((ReverseMatchPtr > &HistoryBuffer[HistoryOffset]) && (ReverseChunkPtr > HistoryBuffer) && + (*ReverseMatchPtr == *ReverseChunkPtr)) { ReverseMatchLength++; ReverseMatchPtr--; @@ -412,7 +413,7 @@ static int xcrush_find_match_length(XCRUSH_CONTEXT* xcrush, UINT32 MatchOffset, MatchInfo->MatchOffset = MatchStartPtr - HistoryBuffer; MatchInfo->ChunkOffset = ChunkBuffer - ReverseMatchLength - HistoryBuffer; MatchInfo->MatchLength = TotalMatchLength; - return (int) TotalMatchLength; + return (int)TotalMatchLength; } static int xcrush_find_all_matches(XCRUSH_CONTEXT* xcrush, UINT32 SignatureIndex, @@ -453,16 +454,16 @@ static int xcrush_find_all_matches(XCRUSH_CONTEXT* xcrush, UINT32 SignatureIndex while (chunk) { - if ((chunk->offset < HistoryOffset) || (chunk->offset < offset) - || (chunk->offset > SrcSize + HistoryOffset)) + if ((chunk->offset < HistoryOffset) || (chunk->offset < offset) || + (chunk->offset > SrcSize + HistoryOffset)) { - status = xcrush_find_match_length(xcrush, offset, chunk->offset, - HistoryOffset, SrcSize, MaxMatchLength, &MatchInfo); + status = xcrush_find_match_length(xcrush, offset, chunk->offset, HistoryOffset, + SrcSize, MaxMatchLength, &MatchInfo); if (status < 0) return status; /* error */ - MatchLength = (UINT32) status; + MatchLength = (UINT32)status; if (MatchLength > MaxMatchLength) { @@ -496,7 +497,8 @@ static int xcrush_find_all_matches(XCRUSH_CONTEXT* xcrush, UINT32 SignatureIndex if (xcrush->OriginalMatches[j].MatchOffset < HistoryOffset) return -1002; /* error */ - PrevMatchEnd = xcrush->OriginalMatches[j].MatchLength + xcrush->OriginalMatches[j].MatchOffset; + PrevMatchEnd = + xcrush->OriginalMatches[j].MatchLength + xcrush->OriginalMatches[j].MatchOffset; j++; if (j >= 1000) @@ -513,7 +515,7 @@ static int xcrush_find_all_matches(XCRUSH_CONTEXT* xcrush, UINT32 SignatureIndex if (SrcOffset > SrcSize) return -1005; /* error */ - return (int) j; + return (int)j; } static int xcrush_optimize_matches(XCRUSH_CONTEXT* xcrush) @@ -539,8 +541,9 @@ static int xcrush_optimize_matches(XCRUSH_CONTEXT* xcrush) { if (OriginalMatches[i].MatchOffset <= PrevMatchEnd) { - if ((OriginalMatches[i].MatchOffset < PrevMatchEnd) - && (OriginalMatches[i].MatchLength + OriginalMatches[i].MatchOffset > PrevMatchEnd + 6)) + if ((OriginalMatches[i].MatchOffset < PrevMatchEnd) && + (OriginalMatches[i].MatchLength + OriginalMatches[i].MatchOffset > + PrevMatchEnd + 6)) { MatchDiff = PrevMatchEnd - OriginalMatches[i].MatchOffset; OriginalMatch = &OriginalMatches[i]; @@ -578,7 +581,7 @@ static int xcrush_optimize_matches(XCRUSH_CONTEXT* xcrush) OptimizedMatchCount = j; xcrush->OptimizedMatchCount = OptimizedMatchCount; - return (int) TotalMatchLength; + return (int)TotalMatchLength; } static int xcrush_generate_output(XCRUSH_CONTEXT* xcrush, BYTE* OutputBuffer, UINT32 OutputSize, @@ -600,19 +603,21 @@ static int xcrush_generate_output(XCRUSH_CONTEXT* xcrush, BYTE* OutputBuffer, UI if (&OutputBuffer[2] >= &OutputBuffer[OutputSize]) return -6001; /* error */ - *((UINT16*) OutputBuffer) = MatchCount; - MatchDetails = (RDP61_MATCH_DETAILS*) &OutputBuffer[2]; - Literals = (BYTE*) &MatchDetails[MatchCount]; + *((UINT16*)OutputBuffer) = MatchCount; + MatchDetails = (RDP61_MATCH_DETAILS*)&OutputBuffer[2]; + Literals = (BYTE*)&MatchDetails[MatchCount]; if (Literals > OutputEnd) return -6002; /* error */ for (MatchIndex = 0; MatchIndex < MatchCount; MatchIndex++) { - MatchDetails[MatchIndex].MatchLength = (UINT16)(xcrush->OptimizedMatches[MatchIndex].MatchLength); - MatchDetails[MatchIndex].MatchOutputOffset = (UINT16)( - xcrush->OptimizedMatches[MatchIndex].MatchOffset - HistoryOffset); - MatchDetails[MatchIndex].MatchHistoryOffset = xcrush->OptimizedMatches[MatchIndex].ChunkOffset; + MatchDetails[MatchIndex].MatchLength = + (UINT16)(xcrush->OptimizedMatches[MatchIndex].MatchLength); + MatchDetails[MatchIndex].MatchOutputOffset = + (UINT16)(xcrush->OptimizedMatches[MatchIndex].MatchOffset - HistoryOffset); + MatchDetails[MatchIndex].MatchHistoryOffset = + xcrush->OptimizedMatches[MatchIndex].ChunkOffset; } CurrentOffset = HistoryOffset; @@ -712,8 +717,8 @@ static int xcrush_decompress_l1(XCRUSH_CONTEXT* xcrush, BYTE* pSrcData, UINT32 S return -1003; Data_Read_UINT16(pSrcData, MatchCount); - MatchDetails = (RDP61_MATCH_DETAILS*) &pSrcData[2]; - Literals = (BYTE*) &MatchDetails[MatchCount]; + MatchDetails = (RDP61_MATCH_DETAILS*)&pSrcData[2]; + Literals = (BYTE*)&MatchDetails[MatchCount]; OutputOffset = 0; if (Literals > pSrcEnd) @@ -756,7 +761,8 @@ static int xcrush_decompress_l1(XCRUSH_CONTEXT* xcrush, BYTE* pSrcData, UINT32 S OutputPtr = &xcrush->HistoryBuffer[MatchHistoryOffset]; - if ((&HistoryPtr[MatchLength] >= HistoryBufferEnd) || (&OutputPtr[MatchLength] >= HistoryBufferEnd)) + if ((&HistoryPtr[MatchLength] >= HistoryBufferEnd) || + (&OutputPtr[MatchLength] >= HistoryBufferEnd)) return -1011; xcrush_copy_bytes(HistoryPtr, OutputPtr, MatchLength); @@ -809,11 +815,13 @@ int xcrush_decompress(XCRUSH_CONTEXT* xcrush, BYTE* pSrcData, UINT32 SrcSize, BY { pDstData = pSrcData; DstSize = SrcSize; - status = xcrush_decompress_l1(xcrush, pDstData, DstSize, ppDstData, pDstSize, Level1ComprFlags); + status = + xcrush_decompress_l1(xcrush, pDstData, DstSize, ppDstData, pDstSize, Level1ComprFlags); return status; } - status = mppc_decompress(xcrush->mppc, pSrcData, SrcSize, &pDstData, &DstSize, Level2ComprFlags); + status = + mppc_decompress(xcrush->mppc, pSrcData, SrcSize, &pDstData, &DstSize, Level2ComprFlags); if (status < 0) return status; @@ -850,13 +858,12 @@ static int xcrush_compress_l1(XCRUSH_CONTEXT* xcrush, BYTE* pSrcData, UINT32 Src if (SignatureIndex) { - status = xcrush_find_all_matches(xcrush, - SignatureIndex, HistoryOffset, 0, SrcSize); + status = xcrush_find_all_matches(xcrush, SignatureIndex, HistoryOffset, 0, SrcSize); if (status < 0) return status; - xcrush->OriginalMatchCount = (UINT32) status; + xcrush->OriginalMatchCount = (UINT32)status; xcrush->OptimizedMatchCount = 0; if (xcrush->OriginalMatchCount) @@ -869,7 +876,8 @@ static int xcrush_compress_l1(XCRUSH_CONTEXT* xcrush, BYTE* pSrcData, UINT32 Src if (xcrush->OptimizedMatchCount) { - status = xcrush_generate_output(xcrush, *ppDstData, SrcSize, HistoryOffset, pDstSize); + status = + xcrush_generate_output(xcrush, *ppDstData, SrcSize, HistoryOffset, pDstSize); if (status < 0) return status; @@ -940,8 +948,8 @@ int xcrush_compress(XCRUSH_CONTEXT* xcrush, BYTE* pSrcData, UINT32 SrcSize, BYTE if (CompressedDataSize > 50) { - status = mppc_compress(xcrush->mppc, CompressedData, CompressedDataSize, &pDstData, &DstSize, - &Level2ComprFlags); + status = mppc_compress(xcrush->mppc, CompressedData, CompressedDataSize, &pDstData, + &DstSize, &Level2ComprFlags); } if (status < 0) @@ -973,8 +981,8 @@ int xcrush_compress(XCRUSH_CONTEXT* xcrush, BYTE* pSrcData, UINT32 SrcSize, BYTE } Level1ComprFlags |= L1_INNER_COMPRESSION; - OriginalData[0] = (BYTE) Level1ComprFlags; - OriginalData[1] = (BYTE) Level2ComprFlags; + OriginalData[0] = (BYTE)Level1ComprFlags; + OriginalData[1] = (BYTE)Level2ComprFlags; #if DEBUG_XCRUSH WLog_DBG(TAG, "XCrushCompress: Level1ComprFlags: %s Level2ComprFlags: %s", xcrush_get_level_1_compression_flags_string(Level1ComprFlags), @@ -1012,7 +1020,7 @@ void xcrush_context_reset(XCRUSH_CONTEXT* xcrush, BOOL flush) XCRUSH_CONTEXT* xcrush_context_new(BOOL Compressor) { XCRUSH_CONTEXT* xcrush; - xcrush = (XCRUSH_CONTEXT*) calloc(1, sizeof(XCRUSH_CONTEXT)); + xcrush = (XCRUSH_CONTEXT*)calloc(1, sizeof(XCRUSH_CONTEXT)); if (xcrush) { @@ -1034,4 +1042,3 @@ void xcrush_context_free(XCRUSH_CONTEXT* xcrush) free(xcrush); } } - diff --git a/libfreerdp/codec/yuv.c b/libfreerdp/codec/yuv.c index 59a7e9186..a97091e4f 100644 --- a/libfreerdp/codec/yuv.c +++ b/libfreerdp/codec/yuv.c @@ -18,14 +18,13 @@ struct _YUV_CONTEXT TP_CALLBACK_ENVIRON ThreadPoolEnv; }; - struct _YUV_PROCESS_WORK_PARAM { YUV_CONTEXT* context; const BYTE* pYUVData[3]; UINT32 iStride[3]; DWORD DstFormat; - BYTE *dest; + BYTE* dest; UINT32 nDstStep; UINT32 y; UINT32 height; @@ -33,7 +32,7 @@ struct _YUV_PROCESS_WORK_PARAM typedef struct _YUV_PROCESS_WORK_PARAM YUV_PROCESS_WORK_PARAM; static void CALLBACK yuv_process_work_callback(PTP_CALLBACK_INSTANCE instance, void* context, - PTP_WORK work) + PTP_WORK work) { prim_size_t roi; YUV_PROCESS_WORK_PARAM* param = (YUV_PROCESS_WORK_PARAM*)context; @@ -41,14 +40,13 @@ static void CALLBACK yuv_process_work_callback(PTP_CALLBACK_INSTANCE instance, v roi.width = param->context->width; roi.height = param->height; - if( prims->YUV420ToRGB_8u_P3AC4R(param->pYUVData, param->iStride, param->dest, param->nDstStep, - param->DstFormat, &roi) != PRIMITIVES_SUCCESS) + if (prims->YUV420ToRGB_8u_P3AC4R(param->pYUVData, param->iStride, param->dest, param->nDstStep, + param->DstFormat, &roi) != PRIMITIVES_SUCCESS) { WLog_ERR(TAG, "error when decoding lines"); } } - void yuv_context_reset(YUV_CONTEXT* context, UINT32 width, UINT32 height) { context->width = width; @@ -56,7 +54,6 @@ void yuv_context_reset(YUV_CONTEXT* context, UINT32 width, UINT32 height) context->heightStep = (height / context->nthreads); } - YUV_CONTEXT* yuv_context_new(BOOL encoder) { SYSTEM_INFO sysInfos; @@ -93,7 +90,6 @@ error_threadpool: return NULL; } - void yuv_context_free(YUV_CONTEXT* context) { if (context->useThreads) @@ -104,13 +100,12 @@ void yuv_context_free(YUV_CONTEXT* context) free(context); } - BOOL yuv_context_decode(YUV_CONTEXT* context, const BYTE* pYUVData[3], UINT32 iStride[3], - DWORD DstFormat, BYTE *dest, UINT32 nDstStep) + DWORD DstFormat, BYTE* dest, UINT32 nDstStep) { UINT32 y, nobjects, i; - PTP_WORK *work_objects = NULL; - YUV_PROCESS_WORK_PARAM *params; + PTP_WORK* work_objects = NULL; + YUV_PROCESS_WORK_PARAM* params; UINT32 waitCount = 0; BOOL ret = TRUE; @@ -120,19 +115,19 @@ BOOL yuv_context_decode(YUV_CONTEXT* context, const BYTE* pYUVData[3], UINT32 iS prim_size_t roi; roi.width = context->width; roi.height = context->height; - return prims->YUV420ToRGB_8u_P3AC4R(pYUVData, iStride, dest, nDstStep, - DstFormat, &roi) == PRIMITIVES_SUCCESS; + return prims->YUV420ToRGB_8u_P3AC4R(pYUVData, iStride, dest, nDstStep, DstFormat, &roi) == + PRIMITIVES_SUCCESS; } /* case where we use threads */ nobjects = (context->height + context->heightStep - 1) / context->heightStep; - work_objects = (PTP_WORK *)calloc(nobjects, sizeof(PTP_WORK)); + work_objects = (PTP_WORK*)calloc(nobjects, sizeof(PTP_WORK)); if (!work_objects) { return FALSE; } - params = (YUV_PROCESS_WORK_PARAM *)calloc(nobjects, sizeof(*params)); + params = (YUV_PROCESS_WORK_PARAM*)calloc(nobjects, sizeof(*params)); if (!params) { free(work_objects); @@ -159,8 +154,8 @@ BOOL yuv_context_decode(YUV_CONTEXT* context, const BYTE* pYUVData[3], UINT32 iS else params[i].height = context->height % context->heightStep; - work_objects[i] = CreateThreadpoolWork(yuv_process_work_callback, - (void*) ¶ms[i], &context->ThreadPoolEnv); + work_objects[i] = CreateThreadpoolWork(yuv_process_work_callback, (void*)¶ms[i], + &context->ThreadPoolEnv); if (!work_objects[i]) { ret = FALSE; diff --git a/libfreerdp/codec/zgfx.c b/libfreerdp/codec/zgfx.c index 5ce552d16..1a2878bd9 100644 --- a/libfreerdp/codec/zgfx.c +++ b/libfreerdp/codec/zgfx.c @@ -72,49 +72,48 @@ struct _ZGFX_CONTEXT UINT32 HistoryBufferSize; }; -static const ZGFX_TOKEN ZGFX_TOKEN_TABLE[] = -{ +static const ZGFX_TOKEN ZGFX_TOKEN_TABLE[] = { // len code vbits type vbase - { 1, 0, 8, 0, 0 }, // 0 - { 5, 17, 5, 1, 0 }, // 10001 - { 5, 18, 7, 1, 32 }, // 10010 - { 5, 19, 9, 1, 160 }, // 10011 - { 5, 20, 10, 1, 672 }, // 10100 - { 5, 21, 12, 1, 1696 }, // 10101 - { 5, 24, 0, 0, 0x00 }, // 11000 - { 5, 25, 0, 0, 0x01 }, // 11001 - { 6, 44, 14, 1, 5792 }, // 101100 - { 6, 45, 15, 1, 22176 }, // 101101 - { 6, 52, 0, 0, 0x02 }, // 110100 - { 6, 53, 0, 0, 0x03 }, // 110101 - { 6, 54, 0, 0, 0xFF }, // 110110 - { 7, 92, 18, 1, 54944 }, // 1011100 - { 7, 93, 20, 1, 317088 }, // 1011101 - { 7, 110, 0, 0, 0x04 }, // 1101110 - { 7, 111, 0, 0, 0x05 }, // 1101111 - { 7, 112, 0, 0, 0x06 }, // 1110000 - { 7, 113, 0, 0, 0x07 }, // 1110001 - { 7, 114, 0, 0, 0x08 }, // 1110010 - { 7, 115, 0, 0, 0x09 }, // 1110011 - { 7, 116, 0, 0, 0x0A }, // 1110100 - { 7, 117, 0, 0, 0x0B }, // 1110101 - { 7, 118, 0, 0, 0x3A }, // 1110110 - { 7, 119, 0, 0, 0x3B }, // 1110111 - { 7, 120, 0, 0, 0x3C }, // 1111000 - { 7, 121, 0, 0, 0x3D }, // 1111001 - { 7, 122, 0, 0, 0x3E }, // 1111010 - { 7, 123, 0, 0, 0x3F }, // 1111011 - { 7, 124, 0, 0, 0x40 }, // 1111100 - { 7, 125, 0, 0, 0x80 }, // 1111101 - { 8, 188, 20, 1, 1365664 }, // 10111100 - { 8, 189, 21, 1, 2414240 }, // 10111101 - { 8, 252, 0, 0, 0x0C }, // 11111100 - { 8, 253, 0, 0, 0x38 }, // 11111101 - { 8, 254, 0, 0, 0x39 }, // 11111110 - { 8, 255, 0, 0, 0x66 }, // 11111111 - { 9, 380, 22, 1, 4511392 }, // 101111100 - { 9, 381, 23, 1, 8705696 }, // 101111101 - { 9, 382, 24, 1, 17094304 }, // 101111110 + { 1, 0, 8, 0, 0 }, // 0 + { 5, 17, 5, 1, 0 }, // 10001 + { 5, 18, 7, 1, 32 }, // 10010 + { 5, 19, 9, 1, 160 }, // 10011 + { 5, 20, 10, 1, 672 }, // 10100 + { 5, 21, 12, 1, 1696 }, // 10101 + { 5, 24, 0, 0, 0x00 }, // 11000 + { 5, 25, 0, 0, 0x01 }, // 11001 + { 6, 44, 14, 1, 5792 }, // 101100 + { 6, 45, 15, 1, 22176 }, // 101101 + { 6, 52, 0, 0, 0x02 }, // 110100 + { 6, 53, 0, 0, 0x03 }, // 110101 + { 6, 54, 0, 0, 0xFF }, // 110110 + { 7, 92, 18, 1, 54944 }, // 1011100 + { 7, 93, 20, 1, 317088 }, // 1011101 + { 7, 110, 0, 0, 0x04 }, // 1101110 + { 7, 111, 0, 0, 0x05 }, // 1101111 + { 7, 112, 0, 0, 0x06 }, // 1110000 + { 7, 113, 0, 0, 0x07 }, // 1110001 + { 7, 114, 0, 0, 0x08 }, // 1110010 + { 7, 115, 0, 0, 0x09 }, // 1110011 + { 7, 116, 0, 0, 0x0A }, // 1110100 + { 7, 117, 0, 0, 0x0B }, // 1110101 + { 7, 118, 0, 0, 0x3A }, // 1110110 + { 7, 119, 0, 0, 0x3B }, // 1110111 + { 7, 120, 0, 0, 0x3C }, // 1111000 + { 7, 121, 0, 0, 0x3D }, // 1111001 + { 7, 122, 0, 0, 0x3E }, // 1111010 + { 7, 123, 0, 0, 0x3F }, // 1111011 + { 7, 124, 0, 0, 0x40 }, // 1111100 + { 7, 125, 0, 0, 0x80 }, // 1111101 + { 8, 188, 20, 1, 1365664 }, // 10111100 + { 8, 189, 21, 1, 2414240 }, // 10111101 + { 8, 252, 0, 0, 0x0C }, // 11111100 + { 8, 253, 0, 0, 0x38 }, // 11111101 + { 8, 254, 0, 0, 0x39 }, // 11111110 + { 8, 255, 0, 0, 0x66 }, // 11111111 + { 9, 380, 22, 1, 4511392 }, // 101111100 + { 9, 381, 23, 1, 8705696 }, // 101111101 + { 9, 382, 24, 1, 17094304 }, // 101111110 { 0 } }; @@ -215,8 +214,7 @@ static void zgfx_history_buffer_ring_read(ZGFX_CONTEXT* zgfx, int offset, BYTE* CopyMemory(dptr, origDst, bytes); dptr += bytes; valid <<= 1; - } - while ((bytesLeft -= bytes) > 0); + } while ((bytesLeft -= bytes) > 0); } static BOOL zgfx_decompress_segment(ZGFX_CONTEXT* zgfx, wStream* stream, size_t segmentSize) @@ -330,8 +328,10 @@ static BOOL zgfx_decompress_segment(ZGFX_CONTEXT* zgfx, wStream* stream, size_t if (count > sizeof(zgfx->OutputBuffer) - zgfx->OutputCount) return FALSE; - zgfx_history_buffer_ring_read(zgfx, distance, &(zgfx->OutputBuffer[zgfx->OutputCount]), count); - zgfx_history_buffer_ring_write(zgfx, &(zgfx->OutputBuffer[zgfx->OutputCount]), count); + zgfx_history_buffer_ring_read( + zgfx, distance, &(zgfx->OutputBuffer[zgfx->OutputCount]), count); + zgfx_history_buffer_ring_write( + zgfx, &(zgfx->OutputBuffer[zgfx->OutputCount]), count); zgfx->OutputCount += count; } else @@ -346,7 +346,8 @@ static BOOL zgfx_decompress_segment(ZGFX_CONTEXT* zgfx, wStream* stream, size_t if (count > sizeof(zgfx->OutputBuffer) - zgfx->OutputCount) return FALSE; - CopyMemory(&(zgfx->OutputBuffer[zgfx->OutputCount]), zgfx->pbInputCurrent, count); + CopyMemory(&(zgfx->OutputBuffer[zgfx->OutputCount]), zgfx->pbInputCurrent, + count); zgfx_history_buffer_ring_write(zgfx, zgfx->pbInputCurrent, count); zgfx->pbInputCurrent += count; zgfx->cBitsRemaining -= (8 * count); @@ -385,7 +386,7 @@ int zgfx_decompress(ZGFX_CONTEXT* zgfx, const BYTE* pSrcData, UINT32 SrcSize, BY *ppDstData = NULL; if (zgfx->OutputCount > 0) - *ppDstData = (BYTE*) malloc(zgfx->OutputCount); + *ppDstData = (BYTE*)malloc(zgfx->OutputCount); if (!*ppDstData) goto fail; @@ -405,13 +406,13 @@ int zgfx_decompress(ZGFX_CONTEXT* zgfx, const BYTE* pSrcData, UINT32 SrcSize, BY if (Stream_GetRemainingLength(stream) < 6) goto fail; - Stream_Read_UINT16(stream, segmentCount); /* segmentCount (2 bytes) */ + Stream_Read_UINT16(stream, segmentCount); /* segmentCount (2 bytes) */ Stream_Read_UINT32(stream, uncompressedSize); /* uncompressedSize (4 bytes) */ if (Stream_GetRemainingLength(stream) < segmentCount * sizeof(UINT32)) goto fail; - pConcatenated = (BYTE*) malloc(uncompressedSize); + pConcatenated = (BYTE*)malloc(uncompressedSize); if (!pConcatenated) goto fail; @@ -462,7 +463,7 @@ static BOOL zgfx_compress_segment(ZGFX_CONTEXT* zgfx, wStream* s, const BYTE* pS } (*pFlags) |= ZGFX_PACKET_COMPR_TYPE_RDP8; /* RDP 8.0 compression format */ - Stream_Write_UINT8(s, (*pFlags)); /* header (1 byte) */ + Stream_Write_UINT8(s, (*pFlags)); /* header (1 byte) */ Stream_Write(s, pSrcData, SrcSize); return TRUE; } @@ -501,8 +502,8 @@ int zgfx_compress_to_stream(ZGFX_CONTEXT* zgfx, wStream* sDst, const BYTE* pUnco { /* First fragment */ /* descriptor (1 byte) */ - Stream_Write_UINT8(sDst, (totalLength == 0) ? - ZGFX_SEGMENTED_SINGLE : ZGFX_SEGMENTED_MULTIPART); + Stream_Write_UINT8(sDst, (totalLength == 0) ? ZGFX_SEGMENTED_SINGLE + : ZGFX_SEGMENTED_MULTIPART); if (totalLength > 0) { @@ -561,7 +562,6 @@ int zgfx_compress(ZGFX_CONTEXT* zgfx, const BYTE* pSrcData, UINT32 SrcSize, BYTE return status; } - void zgfx_context_reset(ZGFX_CONTEXT* zgfx, BOOL flush) { zgfx->HistoryIndex = 0; @@ -570,7 +570,7 @@ void zgfx_context_reset(ZGFX_CONTEXT* zgfx, BOOL flush) ZGFX_CONTEXT* zgfx_context_new(BOOL Compressor) { ZGFX_CONTEXT* zgfx; - zgfx = (ZGFX_CONTEXT*) calloc(1, sizeof(ZGFX_CONTEXT)); + zgfx = (ZGFX_CONTEXT*)calloc(1, sizeof(ZGFX_CONTEXT)); if (zgfx) { @@ -586,4 +586,3 @@ void zgfx_context_free(ZGFX_CONTEXT* zgfx) { free(zgfx); } - diff --git a/libfreerdp/common/addin.c b/libfreerdp/common/addin.c index 65cd71358..a5383f39a 100644 --- a/libfreerdp/common/addin.c +++ b/libfreerdp/common/addin.c @@ -65,7 +65,7 @@ LPSTR freerdp_get_library_install_path(void) if (!needInstallPath && !needLibPath) return NULL; - pszPath = (LPSTR) malloc(cchPath + 1); + pszPath = (LPSTR)malloc(cchPath + 1); if (!pszPath) return NULL; @@ -106,7 +106,7 @@ LPSTR freerdp_get_dynamic_addin_install_path(void) if (!needInstallPath && !needLibPath) return NULL; - pszPath = (LPSTR) calloc(cchPath + 1, sizeof(CHAR)); + pszPath = (LPSTR)calloc(cchPath + 1, sizeof(CHAR)); if (!pszPath) return NULL; @@ -129,8 +129,8 @@ LPSTR freerdp_get_dynamic_addin_install_path(void) return pszPath; } -PVIRTUALCHANNELENTRY freerdp_load_dynamic_addin(LPCSTR pszFileName, - LPCSTR pszPath, LPCSTR pszEntryName) +PVIRTUALCHANNELENTRY freerdp_load_dynamic_addin(LPCSTR pszFileName, LPCSTR pszPath, + LPCSTR pszEntryName) { LPSTR pszAddinInstallPath = freerdp_get_dynamic_addin_install_path(); PVIRTUALCHANNELENTRY entry = NULL; @@ -169,13 +169,13 @@ PVIRTUALCHANNELENTRY freerdp_load_dynamic_addin(LPCSTR pszFileName, else { cchAddinFile = cchFileName + cchExt + 2 + sizeof(FREERDP_SHARED_LIBRARY_PREFIX); - pszAddinFile = (LPSTR) malloc(cchAddinFile + 1); + pszAddinFile = (LPSTR)malloc(cchAddinFile + 1); if (!pszAddinFile) goto fail; - sprintf_s(pszAddinFile, cchAddinFile, FREERDP_SHARED_LIBRARY_PREFIX"%s%s", - pszFileName, pszExt); + sprintf_s(pszAddinFile, cchAddinFile, FREERDP_SHARED_LIBRARY_PREFIX "%s%s", pszFileName, + pszExt); } cchAddinFile = strlen(pszAddinFile); @@ -203,14 +203,14 @@ PVIRTUALCHANNELENTRY freerdp_load_dynamic_addin(LPCSTR pszFileName, { cchAddinInstallPath = strlen(pszAddinInstallPath); cchFilePath = cchAddinInstallPath + cchFileName + 32; - pszFilePath = (LPSTR) malloc(cchFilePath + 1); + pszFilePath = (LPSTR)malloc(cchFilePath + 1); if (!pszFilePath) goto fail; CopyMemory(pszFilePath, pszAddinInstallPath, cchAddinInstallPath); pszFilePath[cchAddinInstallPath] = '\0'; - NativePathCchAppendA((LPSTR) pszFilePath, cchFilePath + 1, pszRelativeFilePath); + NativePathCchAppendA((LPSTR)pszFilePath, cchFilePath + 1, pszRelativeFilePath); } else pszFilePath = _strdup(pszRelativeFilePath); @@ -233,8 +233,8 @@ fail: return entry; } -PVIRTUALCHANNELENTRY freerdp_load_dynamic_channel_addin_entry(LPCSTR pszName, - LPCSTR pszSubsystem, LPCSTR pszType, DWORD dwFlags) +PVIRTUALCHANNELENTRY freerdp_load_dynamic_channel_addin_entry(LPCSTR pszName, LPCSTR pszSubsystem, + LPCSTR pszType, DWORD dwFlags) { PVIRTUALCHANNELENTRY entry; LPSTR pszFileName; @@ -250,8 +250,9 @@ PVIRTUALCHANNELENTRY freerdp_load_dynamic_channel_addin_entry(LPCSTR pszName, if (pszName && pszSubsystem && pszType) { - const size_t cchFileName = cchBaseFileName + nameLen + subsystemLen + typeLen + extensionLen; - pszFileName = (LPSTR) malloc(cchFileName); + const size_t cchFileName = + cchBaseFileName + nameLen + subsystemLen + typeLen + extensionLen; + pszFileName = (LPSTR)malloc(cchFileName); if (!pszFileName) return NULL; @@ -262,24 +263,23 @@ PVIRTUALCHANNELENTRY freerdp_load_dynamic_channel_addin_entry(LPCSTR pszName, else if (pszName && pszSubsystem) { const size_t cchFileName = cchBaseFileName + nameLen + subsystemLen + extensionLen; - pszFileName = (LPSTR) malloc(cchFileName); + pszFileName = (LPSTR)malloc(cchFileName); if (!pszFileName) return NULL; - sprintf_s(pszFileName, cchFileName, "%s%s-client-%s.%s", pszPrefix, pszName, - pszSubsystem, pszExtension); + sprintf_s(pszFileName, cchFileName, "%s%s-client-%s.%s", pszPrefix, pszName, pszSubsystem, + pszExtension); } else if (pszName) { const size_t cchFileName = cchBaseFileName + nameLen + extensionLen; - pszFileName = (LPSTR) malloc(cchFileName); + pszFileName = (LPSTR)malloc(cchFileName); if (!pszFileName) return NULL; - sprintf_s(pszFileName, cchFileName, "%s%s-client.%s", pszPrefix, pszName, - pszExtension); + sprintf_s(pszFileName, cchFileName, "%s%s-client.%s", pszPrefix, pszName, pszExtension); } else { @@ -292,7 +292,7 @@ PVIRTUALCHANNELENTRY freerdp_load_dynamic_channel_addin_entry(LPCSTR pszName, size_t cchEntryName; /* subsystem add-in */ cchEntryName = 64 + nameLen; - pszEntryName = (LPSTR) malloc(cchEntryName + 1); + pszEntryName = (LPSTR)malloc(cchEntryName + 1); if (!pszEntryName) { @@ -300,8 +300,7 @@ PVIRTUALCHANNELENTRY freerdp_load_dynamic_channel_addin_entry(LPCSTR pszName, return NULL; } - sprintf_s(pszEntryName, cchEntryName + 1, "freerdp_%s_client_subsystem_entry", - pszName); + sprintf_s(pszEntryName, cchEntryName + 1, "freerdp_%s_client_subsystem_entry", pszName); entry = freerdp_load_dynamic_addin(pszFileName, NULL, pszEntryName); free(pszEntryName); free(pszFileName); @@ -328,18 +327,16 @@ PVIRTUALCHANNELENTRY freerdp_load_dynamic_channel_addin_entry(LPCSTR pszName, return entry; } -static FREERDP_LOAD_CHANNEL_ADDIN_ENTRY_FN -freerdp_load_static_channel_addin_entry = NULL; +static FREERDP_LOAD_CHANNEL_ADDIN_ENTRY_FN freerdp_load_static_channel_addin_entry = NULL; -int freerdp_register_addin_provider(FREERDP_LOAD_CHANNEL_ADDIN_ENTRY_FN - provider, DWORD dwFlags) +int freerdp_register_addin_provider(FREERDP_LOAD_CHANNEL_ADDIN_ENTRY_FN provider, DWORD dwFlags) { freerdp_load_static_channel_addin_entry = provider; return 0; } -PVIRTUALCHANNELENTRY freerdp_load_channel_addin_entry(LPCSTR pszName, - LPCSTR pszSubsystem, LPCSTR pszType, DWORD dwFlags) +PVIRTUALCHANNELENTRY freerdp_load_channel_addin_entry(LPCSTR pszName, LPCSTR pszSubsystem, + LPCSTR pszType, DWORD dwFlags) { PVIRTUALCHANNELENTRY entry = NULL; diff --git a/libfreerdp/common/assistance.c b/libfreerdp/common/assistance.c index d77382be3..4bde56ed5 100644 --- a/libfreerdp/common/assistance.c +++ b/libfreerdp/common/assistance.c @@ -38,7 +38,6 @@ #define TAG FREERDP_TAG("common") - struct rdp_assistance_file { UINT32 Type; @@ -109,7 +108,7 @@ struct rdp_assistance_file */ static BOOL freerdp_assistance_crypt_derive_key_sha1(BYTE* hash, size_t hashLength, BYTE* key, - size_t keyLength) + size_t keyLength) { BOOL rc = FALSE; size_t i; @@ -125,7 +124,7 @@ static BOOL freerdp_assistance_crypt_derive_key_sha1(BYTE* hash, size_t hashLeng pad2[i] ^= hash[i]; } - buffer = (BYTE*) calloc(hashLength, 2); + buffer = (BYTE*)calloc(hashLength, 2); if (!buffer) goto fail; @@ -145,7 +144,7 @@ fail: static BOOL reallocate(rdpAssistanceFile* file, const char* host, UINT32 port) { - void* tmp1, *tmp2; + void *tmp1, *tmp2; file->MachineCount++; tmp1 = realloc(file->MachinePorts, sizeof(UINT32) * file->MachineCount); tmp2 = realloc(file->MachineAddresses, sizeof(char*) * file->MachineCount); @@ -172,7 +171,8 @@ static BOOL append_address(rdpAssistanceFile* file, const char* host, const char if ((errno != 0) || (p == 0) || (p > UINT16_MAX)) { - WLog_ERR(TAG, "Failed to parse ASSISTANCE file: ConnectionString2 invalid port value %s", port); + WLog_ERR(TAG, "Failed to parse ASSISTANCE file: ConnectionString2 invalid port value %s", + port); return FALSE; } @@ -187,7 +187,7 @@ static BOOL freerdp_assistance_parse_address_list(rdpAssistanceFile* file, char* if (!file || !list) return FALSE; - p = list; + p = list; while ((p = strchr(p, ';')) != NULL) { @@ -293,13 +293,10 @@ error: * Decrypted Connection String 2: * * - * - * - * - * - * - * - * + * * * * @@ -359,13 +356,14 @@ static BOOL freerdp_assistance_parse_connection_string2(rdpAssistanceFile* file) if (!q) { - WLog_ERR(TAG, "Failed to parse ASSISTANCE file: ConnectionString2 invalid field KH=%s", q); + WLog_ERR(TAG, "Failed to parse ASSISTANCE file: ConnectionString2 invalid field KH=%s", + q); goto out_fail; } length = q - p; free(file->RASpecificParams); - file->RASpecificParams = (char*) malloc(length + 1); + file->RASpecificParams = (char*)malloc(length + 1); if (!file->RASpecificParams) goto out_fail; @@ -385,13 +383,14 @@ static BOOL freerdp_assistance_parse_connection_string2(rdpAssistanceFile* file) if (!q) { - WLog_ERR(TAG, "Failed to parse ASSISTANCE file: ConnectionString2 invalid field ID=%s", q); + WLog_ERR(TAG, "Failed to parse ASSISTANCE file: ConnectionString2 invalid field ID=%s", + q); goto out_fail; } length = q - p; free(file->RASessionId); - file->RASessionId = (char*) malloc(length + 1); + file->RASessionId = (char*)malloc(length + 1); if (!file->RASessionId) goto out_fail; @@ -414,7 +413,8 @@ static BOOL freerdp_assistance_parse_connection_string2(rdpAssistanceFile* file) if (!q) { - WLog_ERR(TAG, "Failed to parse ASSISTANCE file: ConnectionString2 invalid field EncryptedLHTicketLength; - pbIn = (BYTE*) file->EncryptedLHTicket; - pbOut = (BYTE*) calloc(1, cbIn + WINPR_AES_BLOCK_SIZE + 2); + pbIn = (BYTE*)file->EncryptedLHTicket; + pbOut = (BYTE*)calloc(1, cbIn + WINPR_AES_BLOCK_SIZE + 2); if (!pbOut) goto fail; @@ -661,20 +663,21 @@ static BOOL freerdp_assistance_decrypt2(rdpAssistanceFile* file, const char* pas if (!winpr_Cipher_Final(aesDec, pbOut + cbOut, &cbFinal)) { - WLog_ERR(TAG, "EVP_DecryptFinal_ex failure"); + WLog_ERR(TAG, "EVP_DecryptFinal_ex failure"); goto fail; } cbOut += cbFinal; cbFinal = 0; - pbOutW = (WCHAR*) pbOut; + pbOutW = (WCHAR*)pbOut; if (cbOut > INT_MAX / 2) goto fail; cchOutW = (int)cbOut / 2; file->ConnectionString2 = NULL; - status = ConvertFromUnicode(CP_UTF8, 0, pbOutW, cchOutW, &file->ConnectionString2, 0, NULL, NULL); + status = + ConvertFromUnicode(CP_UTF8, 0, pbOutW, cchOutW, &file->ConnectionString2, 0, NULL, NULL); if (status <= 0) { @@ -707,7 +710,7 @@ BYTE* freerdp_assistance_hex_string_to_bin(const void* raw, size_t* size) length /= 2; *size = length; - buffer = (BYTE*) malloc(length); + buffer = (BYTE*)malloc(length); if (!buffer) return NULL; @@ -748,7 +751,7 @@ char* freerdp_assistance_bin_to_hex_string(const void* raw, size_t size) int ln, hn; const char* data = (const char*)raw; char bin2hex[] = "0123456789ABCDEF"; - p = (char*) calloc((size + 1), 2); + p = (char*)calloc((size + 1), 2); if (!p) return NULL; @@ -766,7 +769,7 @@ char* freerdp_assistance_bin_to_hex_string(const void* raw, size_t size) } int freerdp_assistance_parse_file_buffer(rdpAssistanceFile* file, const char* buffer, size_t size, - const char* password) + const char* password) { char* p; char* q; @@ -808,7 +811,7 @@ int freerdp_assistance_parse_file_buffer(rdpAssistanceFile* file, const char* bu } length = q - p; - file->Username = (char*) malloc(length + 1); + file->Username = (char*)malloc(length + 1); if (!file->Username) return -1; @@ -832,7 +835,7 @@ int freerdp_assistance_parse_file_buffer(rdpAssistanceFile* file, const char* bu } length = q - p; - file->LHTicket = (char*) malloc(length + 1); + file->LHTicket = (char*)malloc(length + 1); if (!file->LHTicket) return -1; @@ -856,7 +859,7 @@ int freerdp_assistance_parse_file_buffer(rdpAssistanceFile* file, const char* bu } length = q - p; - file->RCTicket = (char*) malloc(length + 1); + file->RCTicket = (char*)malloc(length + 1); if (!file->RCTicket) return -1; @@ -900,7 +903,7 @@ int freerdp_assistance_parse_file_buffer(rdpAssistanceFile* file, const char* bu } length = q - p; - file->PassStub = (char*) malloc(length + 1); + file->PassStub = (char*)malloc(length + 1); if (!file->PassStub) return -1; @@ -924,7 +927,7 @@ int freerdp_assistance_parse_file_buffer(rdpAssistanceFile* file, const char* bu } length = q - p; - r = (char*) malloc(length + 1); + r = (char*)malloc(length + 1); if (!r) return -1; @@ -962,7 +965,7 @@ int freerdp_assistance_parse_file_buffer(rdpAssistanceFile* file, const char* bu } length = q - p; - r = (char*) malloc(length + 1); + r = (char*)malloc(length + 1); if (!r) return -1; @@ -1011,21 +1014,21 @@ int freerdp_assistance_parse_file_buffer(rdpAssistanceFile* file, const char* bu switch (file->Type) { case 2: - { - file->EncryptedLHTicket = freerdp_assistance_hex_string_to_bin(file->LHTicket, - &file->EncryptedLHTicketLength); + { + file->EncryptedLHTicket = freerdp_assistance_hex_string_to_bin( + file->LHTicket, &file->EncryptedLHTicketLength); - if (!freerdp_assistance_decrypt2(file, password)) - status = -1; - } - break; + if (!freerdp_assistance_decrypt2(file, password)) + status = -1; + } + break; case 1: - { - if (!freerdp_assistance_parse_connection_string1(file)) - status = -1; - } - break; + { + if (!freerdp_assistance_parse_connection_string1(file)) + status = -1; + } + break; default: return -1; @@ -1033,12 +1036,12 @@ int freerdp_assistance_parse_file_buffer(rdpAssistanceFile* file, const char* bu if (status < 0) { - WLog_ERR(TAG, "freerdp_assistance_parse_connection_string1 failure: %d", status); + WLog_ERR(TAG, "freerdp_assistance_parse_connection_string1 failure: %d", status); return -1; } - file->EncryptedPassStub = freerdp_assistance_encrypt_pass_stub(password, - file->PassStub, &file->EncryptedPassStubLength); + file->EncryptedPassStub = freerdp_assistance_encrypt_pass_stub( + password, file->PassStub, &file->EncryptedPassStubLength); if (!file->EncryptedPassStub) return -1; @@ -1060,7 +1063,7 @@ int freerdp_assistance_parse_file_buffer(rdpAssistanceFile* file, const char* bu q += sizeof("") - 1; length = q - p; - file->ConnectionString2 = (char*) malloc(length + 1); + file->ConnectionString2 = (char*)malloc(length + 1); if (!file->ConnectionString2) return -1; @@ -1115,7 +1118,7 @@ int freerdp_assistance_parse_file(rdpAssistanceFile* file, const char* name, con return -1; } - buffer = (BYTE*) malloc(fileSize + 2); + buffer = (BYTE*)malloc(fileSize + 2); if (!buffer) { @@ -1143,13 +1146,13 @@ int freerdp_assistance_parse_file(rdpAssistanceFile* file, const char* name, con buffer[fileSize] = '\0'; buffer[fileSize + 1] = '\0'; - status = freerdp_assistance_parse_file_buffer(file, (char*) buffer, fileSize, password); + status = freerdp_assistance_parse_file_buffer(file, (char*)buffer, fileSize, password); free(buffer); return status; } BOOL freerdp_assistance_populate_settings_from_assistance_file(rdpAssistanceFile* file, - rdpSettings* settings) + rdpSettings* settings) { UINT32 i; @@ -1159,12 +1162,14 @@ BOOL freerdp_assistance_populate_settings_from_assistance_file(rdpAssistanceFile if (!file->RASessionId || !file->MachineAddresses) return FALSE; - if (!freerdp_settings_set_string(settings, FreeRDP_RemoteAssistanceSessionId, file->RASessionId)) + if (!freerdp_settings_set_string(settings, FreeRDP_RemoteAssistanceSessionId, + file->RASessionId)) return FALSE; if (file->RCTicket) { - if (!freerdp_settings_set_string(settings, FreeRDP_RemoteAssistanceRCTicket, file->RCTicket)) + if (!freerdp_settings_set_string(settings, FreeRDP_RemoteAssistanceRCTicket, + file->RCTicket)) return FALSE; } else @@ -1176,7 +1181,8 @@ BOOL freerdp_assistance_populate_settings_from_assistance_file(rdpAssistanceFile if (file->PassStub) { - if (!freerdp_settings_set_string(settings, FreeRDP_RemoteAssistancePassStub, file->PassStub)) + if (!freerdp_settings_set_string(settings, FreeRDP_RemoteAssistancePassStub, + file->PassStub)) return FALSE; } @@ -1205,8 +1211,8 @@ BOOL freerdp_assistance_populate_settings_from_assistance_file(rdpAssistanceFile if (settings->TargetNetAddressCount) { - settings->TargetNetAddresses = (char**) calloc(file->MachineCount, sizeof(char*)); - settings->TargetNetPorts = (UINT32*) calloc(file->MachineCount, sizeof(UINT32)); + settings->TargetNetAddresses = (char**)calloc(file->MachineCount, sizeof(char*)); + settings->TargetNetPorts = (UINT32*)calloc(file->MachineCount, sizeof(UINT32)); if (!settings->TargetNetAddresses || !settings->TargetNetPorts) return FALSE; @@ -1227,7 +1233,7 @@ BOOL freerdp_assistance_populate_settings_from_assistance_file(rdpAssistanceFile rdpAssistanceFile* freerdp_assistance_file_new(void) { winpr_InitializeSSL(WINPR_SSL_INIT_DEFAULT); - return (rdpAssistanceFile*) calloc(1, sizeof(rdpAssistanceFile)); + return (rdpAssistanceFile*)calloc(1, sizeof(rdpAssistanceFile)); } void freerdp_assistance_file_free(rdpAssistanceFile* file) @@ -1266,23 +1272,23 @@ void freerdp_assistance_print_file(rdpAssistanceFile* file, wLog* log, DWORD lev WLog_Print(log, level, "Username: %s", file->Username); WLog_Print(log, level, "LHTicket: %s", file->LHTicket); WLog_Print(log, level, "RCTicket: %s", file->RCTicket); - WLog_Print(log, level, "RCTicketEncrypted: %"PRId32, file->RCTicketEncrypted); + WLog_Print(log, level, "RCTicketEncrypted: %" PRId32, file->RCTicketEncrypted); WLog_Print(log, level, "PassStub: %s", file->PassStub); - WLog_Print(log, level, "DtStart: %"PRIu32, file->DtStart); - WLog_Print(log, level, "DtLength: %"PRIu32, file->DtLength); - WLog_Print(log, level, "LowSpeed: %"PRId32, file->LowSpeed); + WLog_Print(log, level, "DtStart: %" PRIu32, file->DtStart); + WLog_Print(log, level, "DtLength: %" PRIu32, file->DtLength); + WLog_Print(log, level, "LowSpeed: %" PRId32, file->LowSpeed); WLog_Print(log, level, "RASessionId: %s", file->RASessionId); WLog_Print(log, level, "RASpecificParams: %s", file->RASpecificParams); for (x = 0; x < file->MachineCount; x++) { - WLog_Print(log, level, "MachineAddress [%"PRIdz": %s", x, file->MachineAddresses[x]); - WLog_Print(log, level, "MachinePort [%"PRIdz": %"PRIu32, x, file->MachinePorts[x]); + WLog_Print(log, level, "MachineAddress [%" PRIdz ": %s", x, file->MachineAddresses[x]); + WLog_Print(log, level, "MachinePort [%" PRIdz ": %" PRIu32, x, file->MachinePorts[x]); } } BOOL freerdp_assistance_get_encrypted_pass_stub(rdpAssistanceFile* file, const char** pwd, - size_t* size) + size_t* size) { if (!file || !pwd || !size) return FALSE; @@ -1293,7 +1299,7 @@ BOOL freerdp_assistance_get_encrypted_pass_stub(rdpAssistanceFile* file, const c } int freerdp_assistance_set_connection_string2(rdpAssistanceFile* file, const char* string, - const char* password) + const char* password) { if (!file || !string || !password) return -1; diff --git a/libfreerdp/common/settings.c b/libfreerdp/common/settings.c index 122ff0d38..32fb4d261 100644 --- a/libfreerdp/common/settings.c +++ b/libfreerdp/common/settings.c @@ -47,7 +47,7 @@ int freerdp_addin_set_argument(ADDIN_ARGV* args, char* argument) } } - new_argv = (char**) realloc(args->argv, sizeof(char*) * (args->argc + 1)); + new_argv = (char**)realloc(args->argv, sizeof(char*) * (args->argc + 1)); if (!new_argv) return -1; @@ -79,7 +79,7 @@ int freerdp_addin_replace_argument(ADDIN_ARGV* args, char* previous, char* argum } } - new_argv = (char**) realloc(args->argv, sizeof(char*) * (args->argc + 1)); + new_argv = (char**)realloc(args->argv, sizeof(char*) * (args->argc + 1)); if (!new_argv) return -1; @@ -101,7 +101,7 @@ int freerdp_addin_set_argument_value(ADDIN_ARGV* args, char* option, char* value size_t length; char** new_argv; length = strlen(option) + strlen(value) + 1; - str = (char*) malloc(length + 1); + str = (char*)malloc(length + 1); if (!str) return -1; @@ -123,7 +123,7 @@ int freerdp_addin_set_argument_value(ADDIN_ARGV* args, char* option, char* value } } - new_argv = (char**) realloc(args->argv, sizeof(char*) * (args->argc + 1)); + new_argv = (char**)realloc(args->argv, sizeof(char*) * (args->argc + 1)); if (!new_argv) { @@ -138,14 +138,14 @@ int freerdp_addin_set_argument_value(ADDIN_ARGV* args, char* option, char* value } int freerdp_addin_replace_argument_value(ADDIN_ARGV* args, char* previous, char* option, - char* value) + char* value) { int i; char* str; size_t length; char** new_argv; length = strlen(option) + strlen(value) + 1; - str = (char*) malloc(length + 1); + str = (char*)malloc(length + 1); if (!str) return -1; @@ -162,7 +162,7 @@ int freerdp_addin_replace_argument_value(ADDIN_ARGV* args, char* previous, char* } } - new_argv = (char**) realloc(args->argv, sizeof(char*) * (args->argc + 1)); + new_argv = (char**)realloc(args->argv, sizeof(char*) * (args->argc + 1)); if (!new_argv) { @@ -186,8 +186,8 @@ BOOL freerdp_device_collection_add(rdpSettings* settings, RDPDR_DEVICE* device) UINT32 new_size; RDPDR_DEVICE** new_array; new_size = settings->DeviceArraySize * 2; - new_array = (RDPDR_DEVICE**) - realloc(settings->DeviceArray, new_size * sizeof(RDPDR_DEVICE*)); + new_array = + (RDPDR_DEVICE**)realloc(settings->DeviceArray, new_size * sizeof(RDPDR_DEVICE*)); if (!new_array) return FALSE; @@ -207,7 +207,7 @@ RDPDR_DEVICE* freerdp_device_collection_find(rdpSettings* settings, const char* for (index = 0; index < settings->DeviceCount; index++) { - device = (RDPDR_DEVICE*) settings->DeviceArray[index]; + device = (RDPDR_DEVICE*)settings->DeviceArray[index]; if (!device->Name) continue; @@ -226,7 +226,7 @@ RDPDR_DEVICE* freerdp_device_collection_find_type(rdpSettings* settings, UINT32 for (index = 0; index < settings->DeviceCount; index++) { - device = (RDPDR_DEVICE*) settings->DeviceArray[index]; + device = (RDPDR_DEVICE*)settings->DeviceArray[index]; if (device->Type == type) return device; @@ -239,8 +239,8 @@ RDPDR_DEVICE* freerdp_device_clone(RDPDR_DEVICE* device) { if (device->Type == RDPDR_DTYP_FILESYSTEM) { - RDPDR_DRIVE* drive = (RDPDR_DRIVE*) device; - RDPDR_DRIVE* _drive = (RDPDR_DRIVE*) calloc(1, sizeof(RDPDR_DRIVE)); + RDPDR_DRIVE* drive = (RDPDR_DRIVE*)device; + RDPDR_DRIVE* _drive = (RDPDR_DRIVE*)calloc(1, sizeof(RDPDR_DRIVE)); if (!_drive) return NULL; @@ -257,7 +257,7 @@ RDPDR_DEVICE* freerdp_device_clone(RDPDR_DEVICE* device) if (!_drive->Path) goto out_fs_path_error; - return (RDPDR_DEVICE*) _drive; + return (RDPDR_DEVICE*)_drive; out_fs_path_error: free(_drive->Name); out_fs_name_error: @@ -267,8 +267,8 @@ RDPDR_DEVICE* freerdp_device_clone(RDPDR_DEVICE* device) if (device->Type == RDPDR_DTYP_PRINT) { - RDPDR_PRINTER* printer = (RDPDR_PRINTER*) device; - RDPDR_PRINTER* _printer = (RDPDR_PRINTER*) calloc(1, sizeof(RDPDR_PRINTER)); + RDPDR_PRINTER* printer = (RDPDR_PRINTER*)device; + RDPDR_PRINTER* _printer = (RDPDR_PRINTER*)calloc(1, sizeof(RDPDR_PRINTER)); if (!_printer) return NULL; @@ -292,7 +292,7 @@ RDPDR_DEVICE* freerdp_device_clone(RDPDR_DEVICE* device) goto out_print_path_error; } - return (RDPDR_DEVICE*) _printer; + return (RDPDR_DEVICE*)_printer; out_print_path_error: free(_printer->Name); out_print_name_error: @@ -302,8 +302,8 @@ RDPDR_DEVICE* freerdp_device_clone(RDPDR_DEVICE* device) if (device->Type == RDPDR_DTYP_SMARTCARD) { - RDPDR_SMARTCARD* smartcard = (RDPDR_SMARTCARD*) device; - RDPDR_SMARTCARD* _smartcard = (RDPDR_SMARTCARD*) calloc(1, sizeof(RDPDR_SMARTCARD)); + RDPDR_SMARTCARD* smartcard = (RDPDR_SMARTCARD*)device; + RDPDR_SMARTCARD* _smartcard = (RDPDR_SMARTCARD*)calloc(1, sizeof(RDPDR_SMARTCARD)); if (!_smartcard) return NULL; @@ -319,7 +319,7 @@ RDPDR_DEVICE* freerdp_device_clone(RDPDR_DEVICE* device) goto out_smartc_name_error; } - return (RDPDR_DEVICE*) _smartcard; + return (RDPDR_DEVICE*)_smartcard; out_smartc_name_error: free(_smartcard); return NULL; @@ -327,8 +327,8 @@ RDPDR_DEVICE* freerdp_device_clone(RDPDR_DEVICE* device) if (device->Type == RDPDR_DTYP_SERIAL) { - RDPDR_SERIAL* serial = (RDPDR_SERIAL*) device; - RDPDR_SERIAL* _serial = (RDPDR_SERIAL*) calloc(1, sizeof(RDPDR_SERIAL)); + RDPDR_SERIAL* serial = (RDPDR_SERIAL*)device; + RDPDR_SERIAL* _serial = (RDPDR_SERIAL*)calloc(1, sizeof(RDPDR_SERIAL)); if (!_serial) return NULL; @@ -360,7 +360,7 @@ RDPDR_DEVICE* freerdp_device_clone(RDPDR_DEVICE* device) goto out_serial_driver_error; } - return (RDPDR_DEVICE*) _serial; + return (RDPDR_DEVICE*)_serial; out_serial_driver_error: free(_serial->Path); out_serial_path_error: @@ -372,8 +372,8 @@ RDPDR_DEVICE* freerdp_device_clone(RDPDR_DEVICE* device) if (device->Type == RDPDR_DTYP_PARALLEL) { - RDPDR_PARALLEL* parallel = (RDPDR_PARALLEL*) device; - RDPDR_PARALLEL* _parallel = (RDPDR_PARALLEL*) calloc(1, sizeof(RDPDR_PARALLEL)); + RDPDR_PARALLEL* parallel = (RDPDR_PARALLEL*)device; + RDPDR_PARALLEL* _parallel = (RDPDR_PARALLEL*)calloc(1, sizeof(RDPDR_PARALLEL)); if (!_parallel) return NULL; @@ -397,7 +397,7 @@ RDPDR_DEVICE* freerdp_device_clone(RDPDR_DEVICE* device) goto out_parallel_path_error; } - return (RDPDR_DEVICE*) _parallel; + return (RDPDR_DEVICE*)_parallel; out_parallel_path_error: free(_parallel->Name); out_parallel_name_error: @@ -405,7 +405,7 @@ RDPDR_DEVICE* freerdp_device_clone(RDPDR_DEVICE* device) return NULL; } - WLog_ERR(TAG, "unknown device type %"PRIu32"", device->Type); + WLog_ERR(TAG, "unknown device type %" PRIu32 "", device->Type); return NULL; } @@ -416,7 +416,7 @@ void freerdp_device_collection_free(rdpSettings* settings) for (index = 0; index < settings->DeviceCount; index++) { - device = (RDPDR_DEVICE*) settings->DeviceArray[index]; + device = (RDPDR_DEVICE*)settings->DeviceArray[index]; if (!device) continue; @@ -425,7 +425,7 @@ void freerdp_device_collection_free(rdpSettings* settings) if (settings->DeviceArray[index]->Type == RDPDR_DTYP_FILESYSTEM) { - free(((RDPDR_DRIVE*) device)->Path); + free(((RDPDR_DRIVE*)device)->Path); } else if (settings->DeviceArray[index]->Type == RDPDR_DTYP_PRINT) { @@ -435,12 +435,12 @@ void freerdp_device_collection_free(rdpSettings* settings) } else if (settings->DeviceArray[index]->Type == RDPDR_DTYP_SERIAL) { - free(((RDPDR_SERIAL*) device)->Path); - free(((RDPDR_SERIAL*) device)->Driver); + free(((RDPDR_SERIAL*)device)->Path); + free(((RDPDR_SERIAL*)device)->Driver); } else if (settings->DeviceArray[index]->Type == RDPDR_DTYP_PARALLEL) { - free(((RDPDR_PARALLEL*) device)->Path); + free(((RDPDR_PARALLEL*)device)->Path); } free(device); @@ -462,8 +462,8 @@ BOOL freerdp_static_channel_collection_add(rdpSettings* settings, ADDIN_ARGV* ch UINT32 new_size; ADDIN_ARGV** new_array; new_size = settings->StaticChannelArraySize * 2; - new_array = (ADDIN_ARGV**) - realloc(settings->StaticChannelArray, new_size * sizeof(ADDIN_ARGV*)); + new_array = + (ADDIN_ARGV**)realloc(settings->StaticChannelArray, new_size * sizeof(ADDIN_ARGV*)); if (!new_array) return FALSE; @@ -496,13 +496,13 @@ ADDIN_ARGV* freerdp_static_channel_clone(ADDIN_ARGV* channel) { int index; ADDIN_ARGV* _channel = NULL; - _channel = (ADDIN_ARGV*) malloc(sizeof(ADDIN_ARGV)); + _channel = (ADDIN_ARGV*)malloc(sizeof(ADDIN_ARGV)); if (!_channel) return NULL; _channel->argc = channel->argc; - _channel->argv = (char**) calloc(channel->argc, sizeof(char*)); + _channel->argv = (char**)calloc(channel->argc, sizeof(char*)); if (!_channel->argv) goto out_free; @@ -591,13 +591,13 @@ ADDIN_ARGV* freerdp_dynamic_channel_clone(ADDIN_ARGV* channel) { int index; ADDIN_ARGV* _channel = NULL; - _channel = (ADDIN_ARGV*) malloc(sizeof(ADDIN_ARGV)); + _channel = (ADDIN_ARGV*)malloc(sizeof(ADDIN_ARGV)); if (!_channel) return NULL; _channel->argc = channel->argc; - _channel->argv = (char**) calloc(sizeof(char*), channel->argc); + _channel->argv = (char**)calloc(sizeof(char*), channel->argc); if (!_channel->argv) goto out_free; @@ -683,15 +683,16 @@ void freerdp_performance_flags_make(rdpSettings* settings) void freerdp_performance_flags_split(rdpSettings* settings) { - settings->AllowFontSmoothing = (settings->PerformanceFlags & PERF_ENABLE_FONT_SMOOTHING) ? TRUE : - FALSE; - settings->AllowDesktopComposition = (settings->PerformanceFlags & PERF_ENABLE_DESKTOP_COMPOSITION) ? - TRUE : FALSE; - settings->DisableWallpaper = (settings->PerformanceFlags & PERF_DISABLE_WALLPAPER) ? TRUE : FALSE; - settings->DisableFullWindowDrag = (settings->PerformanceFlags & PERF_DISABLE_FULLWINDOWDRAG) ? - TRUE : FALSE; - settings->DisableMenuAnims = (settings->PerformanceFlags & PERF_DISABLE_MENUANIMATIONS) ? TRUE : - FALSE; + settings->AllowFontSmoothing = + (settings->PerformanceFlags & PERF_ENABLE_FONT_SMOOTHING) ? TRUE : FALSE; + settings->AllowDesktopComposition = + (settings->PerformanceFlags & PERF_ENABLE_DESKTOP_COMPOSITION) ? TRUE : FALSE; + settings->DisableWallpaper = + (settings->PerformanceFlags & PERF_DISABLE_WALLPAPER) ? TRUE : FALSE; + settings->DisableFullWindowDrag = + (settings->PerformanceFlags & PERF_DISABLE_FULLWINDOWDRAG) ? TRUE : FALSE; + settings->DisableMenuAnims = + (settings->PerformanceFlags & PERF_DISABLE_MENUANIMATIONS) ? TRUE : FALSE; settings->DisableThemes = (settings->PerformanceFlags & PERF_DISABLE_THEMING) ? TRUE : FALSE; } @@ -740,7 +741,7 @@ BOOL freerdp_set_gateway_usage_method(rdpSettings* settings, UINT32 GatewayUsage } void freerdp_update_gateway_usage_method(rdpSettings* settings, UINT32 GatewayEnabled, - UINT32 GatewayBypassLocal) + UINT32 GatewayBypassLocal) { UINT32 GatewayUsageMethod = 0; diff --git a/libfreerdp/common/settings_getters.c b/libfreerdp/common/settings_getters.c index 55deb11de..d1e0d7444 100644 --- a/libfreerdp/common/settings_getters.c +++ b/libfreerdp/common/settings_getters.c @@ -496,7 +496,7 @@ BOOL freerdp_settings_get_bool(rdpSettings* settings, size_t id) return settings->SupportVideoOptimized; default: - WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id); + WLog_ERR(TAG, "[%s] Invalid key index %" PRIuz, __FUNCTION__, id); return FALSE; } } @@ -1153,7 +1153,7 @@ BOOL freerdp_settings_set_bool(rdpSettings* settings, size_t id, BOOL val) break; default: - WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id); + WLog_ERR(TAG, "[%s] Invalid key index %" PRIuz, __FUNCTION__, id); return FALSE; } return TRUE; @@ -1173,7 +1173,7 @@ UINT16 freerdp_settings_get_uint16(rdpSettings* settings, size_t id) return settings->ProxyPort; default: - WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id); + WLog_ERR(TAG, "[%s] Invalid key index %" PRIuz, __FUNCTION__, id); return FALSE; } } @@ -1194,7 +1194,7 @@ BOOL freerdp_settings_set_uint16(rdpSettings* settings, size_t id, UINT16 val) break; default: - WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id); + WLog_ERR(TAG, "[%s] Invalid key index %" PRIuz, __FUNCTION__, id); return FALSE; } return TRUE; @@ -1208,7 +1208,7 @@ INT16 freerdp_settings_get_int16(rdpSettings* settings, size_t id) switch (id) { default: - WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id); + WLog_ERR(TAG, "[%s] Invalid key index %" PRIuz, __FUNCTION__, id); return FALSE; } } @@ -1221,7 +1221,7 @@ BOOL freerdp_settings_set_int16(rdpSettings* settings, size_t id, INT16 val) switch (id) { default: - WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id); + WLog_ERR(TAG, "[%s] Invalid key index %" PRIuz, __FUNCTION__, id); return FALSE; } return TRUE; @@ -1553,7 +1553,7 @@ UINT32 freerdp_settings_get_uint32(rdpSettings* settings, size_t id) return settings->DynamicChannelArraySize; default: - WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id); + WLog_ERR(TAG, "[%s] Invalid key index %" PRIuz, __FUNCTION__, id); return FALSE; } } @@ -1990,7 +1990,7 @@ BOOL freerdp_settings_set_uint32(rdpSettings* settings, size_t id, UINT32 val) break; default: - WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id); + WLog_ERR(TAG, "[%s] Invalid key index %" PRIuz, __FUNCTION__, id); return FALSE; } return TRUE; @@ -2010,7 +2010,7 @@ INT32 freerdp_settings_get_int32(rdpSettings* settings, size_t id) return settings->YPan; default: - WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id); + WLog_ERR(TAG, "[%s] Invalid key index %" PRIuz, __FUNCTION__, id); return FALSE; } } @@ -2031,7 +2031,7 @@ BOOL freerdp_settings_set_int32(rdpSettings* settings, size_t id, INT32 val) break; default: - WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id); + WLog_ERR(TAG, "[%s] Invalid key index %" PRIuz, __FUNCTION__, id); return FALSE; } return TRUE; @@ -2048,7 +2048,7 @@ UINT64 freerdp_settings_get_uint64(rdpSettings* settings, size_t id) return settings->ParentWindowId; default: - WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id); + WLog_ERR(TAG, "[%s] Invalid key index %" PRIuz, __FUNCTION__, id); return FALSE; } } @@ -2065,7 +2065,7 @@ BOOL freerdp_settings_set_uint64(rdpSettings* settings, size_t id, UINT64 val) break; default: - WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id); + WLog_ERR(TAG, "[%s] Invalid key index %" PRIuz, __FUNCTION__, id); return FALSE; } return TRUE; @@ -2079,7 +2079,7 @@ INT64 freerdp_settings_get_int64(rdpSettings* settings, size_t id) switch (id) { default: - WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id); + WLog_ERR(TAG, "[%s] Invalid key index %" PRIuz, __FUNCTION__, id); return FALSE; } } @@ -2092,7 +2092,7 @@ BOOL freerdp_settings_set_int64(rdpSettings* settings, size_t id, INT64 val) switch (id) { default: - WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id); + WLog_ERR(TAG, "[%s] Invalid key index %" PRIuz, __FUNCTION__, id); return FALSE; } return TRUE; @@ -2301,7 +2301,7 @@ const char* freerdp_settings_get_string(rdpSettings* settings, size_t id) return settings->RDP2TCPArgs; default: - WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id); + WLog_ERR(TAG, "[%s] Invalid key index %" PRIuz, __FUNCTION__, id); return FALSE; } } @@ -2639,7 +2639,7 @@ BOOL freerdp_settings_set_string(rdpSettings* settings, size_t id, const char* v return (!val || settings->RDP2TCPArgs != NULL); default: - WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id); + WLog_ERR(TAG, "[%s] Invalid key index %" PRIuz, __FUNCTION__, id); return FALSE; } return TRUE; @@ -2731,9 +2731,7 @@ const void* freerdp_settings_get_pointer(rdpSettings* settings, size_t id) return settings->OrderSupport; default: - WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id); + WLog_ERR(TAG, "[%s] Invalid key index %" PRIuz, __FUNCTION__, id); return FALSE; } } - - diff --git a/libfreerdp/common/test/TestCommonAssistance.c b/libfreerdp/common/test/TestCommonAssistance.c index 24050fb2c..22f37fce1 100644 --- a/libfreerdp/common/test/TestCommonAssistance.c +++ b/libfreerdp/common/test/TestCommonAssistance.c @@ -68,13 +68,10 @@ static const char TEST_MSRC_INCIDENT_FILE_TYPE2[] = * Decrypted Connection String 2: * * - * - * - * - * - * - * - * + * * * * @@ -93,9 +90,9 @@ static BOOL test_msrsc_incident_file_type1(wLog* log) if (!file) return -1; - status = freerdp_assistance_parse_file_buffer(file, - TEST_MSRC_INCIDENT_FILE_TYPE1, sizeof(TEST_MSRC_INCIDENT_FILE_TYPE1), - TEST_MSRC_INCIDENT_PASSWORD_TYPE1); + status = freerdp_assistance_parse_file_buffer(file, TEST_MSRC_INCIDENT_FILE_TYPE1, + sizeof(TEST_MSRC_INCIDENT_FILE_TYPE1), + TEST_MSRC_INCIDENT_PASSWORD_TYPE1); WLog_Print(log, WLOG_INFO, "freerdp_assistance_parse_file_buffer: %d", status); if (status < 0) @@ -103,7 +100,8 @@ static BOOL test_msrsc_incident_file_type1(wLog* log) freerdp_assistance_print_file(file, WLog_Get("foo"), WLOG_INFO); - if (!freerdp_assistance_get_encrypted_pass_stub(file, &EncryptedPassStub, &EncryptedPassStubLength)) + if (!freerdp_assistance_get_encrypted_pass_stub(file, &EncryptedPassStub, + &EncryptedPassStubLength)) goto fail; pass = freerdp_assistance_bin_to_hex_string(EncryptedPassStub, EncryptedPassStubLength); @@ -111,7 +109,7 @@ static BOOL test_msrsc_incident_file_type1(wLog* log) if (!pass) goto fail; - WLog_Print(log, WLOG_INFO, "freerdp_assistance_decrypt: %d %s [%"PRIdz"]", status, pass, + WLog_Print(log, WLOG_INFO, "freerdp_assistance_decrypt: %d %s [%" PRIdz "]", status, pass, EncryptedPassStubLength); expertBlob = freerdp_assistance_construct_expert_blob("Edgar Olougouna", pass); WLog_Print(log, WLOG_INFO, "expertBlob='%s'", expertBlob); @@ -135,9 +133,9 @@ static BOOL test_msrsc_incident_file_type2(wLog* log) if (!file) return -1; - status = freerdp_assistance_parse_file_buffer(file, - TEST_MSRC_INCIDENT_FILE_TYPE2, sizeof(TEST_MSRC_INCIDENT_FILE_TYPE2), - TEST_MSRC_INCIDENT_PASSWORD_TYPE2); + status = freerdp_assistance_parse_file_buffer(file, TEST_MSRC_INCIDENT_FILE_TYPE2, + sizeof(TEST_MSRC_INCIDENT_FILE_TYPE2), + TEST_MSRC_INCIDENT_PASSWORD_TYPE2); printf("freerdp_assistance_parse_file_buffer: %d\n", status); if (status < 0) @@ -145,13 +143,13 @@ static BOOL test_msrsc_incident_file_type2(wLog* log) freerdp_assistance_print_file(file, log, WLOG_INFO); status = freerdp_assistance_get_encrypted_pass_stub(file, &EncryptedPassStub, - &EncryptedPassStubLength); + &EncryptedPassStubLength); pass = freerdp_assistance_bin_to_hex_string(EncryptedPassStub, EncryptedPassStubLength); if (!pass) goto fail; - WLog_Print(log, WLOG_INFO, "freerdp_assistance_decrypt: %d %s [%"PRIdz"]", status, pass, + WLog_Print(log, WLOG_INFO, "freerdp_assistance_decrypt: %d %s [%" PRIdz "]", status, pass, EncryptedPassStubLength); if (status < 0) @@ -188,4 +186,3 @@ int TestCommonAssistance(int argc, char* argv[]) return 0; } - diff --git a/libfreerdp/core/activation.c b/libfreerdp/core/activation.c index f23016baf..0697949cc 100644 --- a/libfreerdp/core/activation.c +++ b/libfreerdp/core/activation.c @@ -27,17 +27,17 @@ /* static const char* const CTRLACTION_STRINGS[] = { - "", - "CTRLACTION_REQUEST_CONTROL", - "CTRLACTION_GRANTED_CONTROL", - "CTRLACTION_DETACH", - "CTRLACTION_COOPERATE" + "", + "CTRLACTION_REQUEST_CONTROL", + "CTRLACTION_GRANTED_CONTROL", + "CTRLACTION_DETACH", + "CTRLACTION_COOPERATE" }; */ void rdp_write_synchronize_pdu(wStream* s, rdpSettings* settings) { - Stream_Write_UINT16(s, SYNCMSGTYPE_SYNC); /* messageType (2 bytes) */ + Stream_Write_UINT16(s, SYNCMSGTYPE_SYNC); /* messageType (2 bytes) */ Stream_Write_UINT16(s, settings->PduSource); /* targetUser (2 bytes) */ } @@ -93,16 +93,16 @@ BOOL rdp_recv_control_pdu(wStream* s, UINT16* action) return FALSE; Stream_Read_UINT16(s, *action); /* action (2 bytes) */ - Stream_Seek_UINT16(s); /* grantId (2 bytes) */ - Stream_Seek_UINT32(s); /* controlId (4 bytes) */ + Stream_Seek_UINT16(s); /* grantId (2 bytes) */ + Stream_Seek_UINT32(s); /* controlId (4 bytes) */ return TRUE; } void rdp_write_client_control_pdu(wStream* s, UINT16 action) { Stream_Write_UINT16(s, action); /* action (2 bytes) */ - Stream_Write_UINT16(s, 0); /* grantId (2 bytes) */ - Stream_Write_UINT32(s, 0); /* controlId (4 bytes) */ + Stream_Write_UINT16(s, 0); /* grantId (2 bytes) */ + Stream_Write_UINT32(s, 0); /* controlId (4 bytes) */ } BOOL rdp_recv_server_control_pdu(rdpRdp* rdp, wStream* s) @@ -131,8 +131,8 @@ BOOL rdp_send_server_control_cooperate_pdu(rdpRdp* rdp) { wStream* s = rdp_data_pdu_init(rdp); Stream_Write_UINT16(s, CTRLACTION_COOPERATE); /* action (2 bytes) */ - Stream_Write_UINT16(s, 0); /* grantId (2 bytes) */ - Stream_Write_UINT32(s, 0); /* controlId (4 bytes) */ + Stream_Write_UINT16(s, 0); /* grantId (2 bytes) */ + Stream_Write_UINT32(s, 0); /* controlId (4 bytes) */ return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_CONTROL, rdp->mcs->userId); } @@ -140,8 +140,8 @@ BOOL rdp_send_server_control_granted_pdu(rdpRdp* rdp) { wStream* s = rdp_data_pdu_init(rdp); Stream_Write_UINT16(s, CTRLACTION_GRANTED_CONTROL); /* action (2 bytes) */ - Stream_Write_UINT16(s, rdp->mcs->userId); /* grantId (2 bytes) */ - Stream_Write_UINT32(s, 0x03EA); /* controlId (4 bytes) */ + Stream_Write_UINT16(s, rdp->mcs->userId); /* grantId (2 bytes) */ + Stream_Write_UINT32(s, 0x03EA); /* controlId (4 bytes) */ return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_CONTROL, rdp->mcs->userId); } @@ -160,20 +160,20 @@ void rdp_write_persistent_list_entry(wStream* s, UINT32 key1, UINT32 key2) void rdp_write_client_persistent_key_list_pdu(wStream* s, rdpSettings* settings) { - Stream_Write_UINT16(s, 0); /* numEntriesCache0 (2 bytes) */ - Stream_Write_UINT16(s, 0); /* numEntriesCache1 (2 bytes) */ - Stream_Write_UINT16(s, 0); /* numEntriesCache2 (2 bytes) */ - Stream_Write_UINT16(s, 0); /* numEntriesCache3 (2 bytes) */ - Stream_Write_UINT16(s, 0); /* numEntriesCache4 (2 bytes) */ - Stream_Write_UINT16(s, 0); /* totalEntriesCache0 (2 bytes) */ - Stream_Write_UINT16(s, 0); /* totalEntriesCache1 (2 bytes) */ - Stream_Write_UINT16(s, 0); /* totalEntriesCache2 (2 bytes) */ - Stream_Write_UINT16(s, 0); /* totalEntriesCache3 (2 bytes) */ - Stream_Write_UINT16(s, 0); /* totalEntriesCache4 (2 bytes) */ + Stream_Write_UINT16(s, 0); /* numEntriesCache0 (2 bytes) */ + Stream_Write_UINT16(s, 0); /* numEntriesCache1 (2 bytes) */ + Stream_Write_UINT16(s, 0); /* numEntriesCache2 (2 bytes) */ + Stream_Write_UINT16(s, 0); /* numEntriesCache3 (2 bytes) */ + Stream_Write_UINT16(s, 0); /* numEntriesCache4 (2 bytes) */ + Stream_Write_UINT16(s, 0); /* totalEntriesCache0 (2 bytes) */ + Stream_Write_UINT16(s, 0); /* totalEntriesCache1 (2 bytes) */ + Stream_Write_UINT16(s, 0); /* totalEntriesCache2 (2 bytes) */ + Stream_Write_UINT16(s, 0); /* totalEntriesCache3 (2 bytes) */ + Stream_Write_UINT16(s, 0); /* totalEntriesCache4 (2 bytes) */ Stream_Write_UINT8(s, PERSIST_FIRST_PDU | PERSIST_LAST_PDU); /* bBitMask (1 byte) */ - Stream_Write_UINT8(s, 0); /* pad1 (1 byte) */ - Stream_Write_UINT16(s, 0); /* pad3 (2 bytes) */ - /* entries */ + Stream_Write_UINT8(s, 0); /* pad1 (1 byte) */ + Stream_Write_UINT16(s, 0); /* pad3 (2 bytes) */ + /* entries */ } BOOL rdp_send_client_persistent_key_list_pdu(rdpRdp* rdp) @@ -194,10 +194,10 @@ BOOL rdp_recv_client_font_list_pdu(wStream* s) void rdp_write_client_font_list_pdu(wStream* s, UINT16 flags) { - Stream_Write_UINT16(s, 0); /* numberFonts (2 bytes) */ - Stream_Write_UINT16(s, 0); /* totalNumFonts (2 bytes) */ + Stream_Write_UINT16(s, 0); /* numberFonts (2 bytes) */ + Stream_Write_UINT16(s, 0); /* totalNumFonts (2 bytes) */ Stream_Write_UINT16(s, flags); /* listFlags (2 bytes) */ - Stream_Write_UINT16(s, 50); /* entrySize (2 bytes) */ + Stream_Write_UINT16(s, 50); /* entrySize (2 bytes) */ } BOOL rdp_send_client_font_list_pdu(rdpRdp* rdp, UINT16 flags) @@ -240,10 +240,10 @@ BOOL rdp_send_server_font_map_pdu(rdpRdp* rdp) { wStream* s; s = rdp_data_pdu_init(rdp); - Stream_Write_UINT16(s, 0); /* numberEntries (2 bytes) */ - Stream_Write_UINT16(s, 0); /* totalNumEntries (2 bytes) */ + Stream_Write_UINT16(s, 0); /* numberEntries (2 bytes) */ + Stream_Write_UINT16(s, 0); /* totalNumEntries (2 bytes) */ Stream_Write_UINT16(s, FONTLIST_FIRST | FONTLIST_LAST); /* mapFlags (2 bytes) */ - Stream_Write_UINT16(s, 4); /* entrySize (2 bytes) */ + Stream_Write_UINT16(s, 4); /* entrySize (2 bytes) */ return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_FONT_MAP, rdp->mcs->userId); } @@ -278,8 +278,7 @@ BOOL rdp_recv_deactivate_all(rdpRdp* rdp, wStream* s) break; Stream_Seek(s, lengthSourceDescriptor); /* sourceDescriptor (should be 0x00) */ - } - while (0); + } while (0); } rdp_client_transition_to_state(rdp, CONNECTION_STATE_CAPABILITIES_EXCHANGE); @@ -307,8 +306,8 @@ BOOL rdp_send_deactivate_all(rdpRdp* rdp) return FALSE; Stream_Write_UINT32(s, rdp->settings->ShareId); /* shareId (4 bytes) */ - Stream_Write_UINT16(s, 1); /* lengthSourceDescriptor (2 bytes) */ - Stream_Write_UINT8(s, 0); /* sourceDescriptor (should be 0x00) */ + Stream_Write_UINT16(s, 1); /* lengthSourceDescriptor (2 bytes) */ + Stream_Write_UINT8(s, 0); /* sourceDescriptor (should be 0x00) */ status = rdp_send_pdu(rdp, s, PDU_TYPE_DEACTIVATE_ALL, rdp->mcs->userId); Stream_Release(s); return status; @@ -342,13 +341,13 @@ BOOL rdp_server_accept_client_font_list_pdu(rdpRdp* rdp, wStream* s) peer->AdjustMonitorsLayout(peer)) { /* client supports the monitorLayout PDU, let's send him the monitors if any */ - MONITOR_DEF* monitors = (MONITOR_DEF*) calloc(settings->MonitorCount, sizeof(MONITOR_DEF)); + MONITOR_DEF* monitors = (MONITOR_DEF*)calloc(settings->MonitorCount, sizeof(MONITOR_DEF)); if (!monitors) return FALSE; - if (!display_convert_rdp_monitor_to_monitor_def(settings->MonitorCount, settings->MonitorDefArray, - &monitors)) + if (!display_convert_rdp_monitor_to_monitor_def(settings->MonitorCount, + settings->MonitorDefArray, &monitors)) { free(monitors); return FALSE; @@ -371,4 +370,3 @@ BOOL rdp_server_accept_client_font_list_pdu(rdpRdp* rdp, wStream* s) return TRUE; } - diff --git a/libfreerdp/core/activation.h b/libfreerdp/core/activation.h index 31b72e851..8a9d95073 100644 --- a/libfreerdp/core/activation.h +++ b/libfreerdp/core/activation.h @@ -25,18 +25,18 @@ #include #include -#define SYNCMSGTYPE_SYNC 0x0001 +#define SYNCMSGTYPE_SYNC 0x0001 -#define CTRLACTION_REQUEST_CONTROL 0x0001 -#define CTRLACTION_GRANTED_CONTROL 0x0002 -#define CTRLACTION_DETACH 0x0003 -#define CTRLACTION_COOPERATE 0x0004 +#define CTRLACTION_REQUEST_CONTROL 0x0001 +#define CTRLACTION_GRANTED_CONTROL 0x0002 +#define CTRLACTION_DETACH 0x0003 +#define CTRLACTION_COOPERATE 0x0004 -#define PERSIST_FIRST_PDU 0x01 -#define PERSIST_LAST_PDU 0x02 +#define PERSIST_FIRST_PDU 0x01 +#define PERSIST_LAST_PDU 0x02 -#define FONTLIST_FIRST 0x0001 -#define FONTLIST_LAST 0x0002 +#define FONTLIST_FIRST 0x0001 +#define FONTLIST_LAST 0x0002 FREERDP_LOCAL BOOL rdp_recv_deactivate_all(rdpRdp* rdp, wStream* s); FREERDP_LOCAL BOOL rdp_send_deactivate_all(rdpRdp* rdp); @@ -59,9 +59,7 @@ FREERDP_LOCAL BOOL rdp_recv_server_font_map_pdu(rdpRdp* rdp, wStream* s); FREERDP_LOCAL BOOL rdp_recv_client_font_map_pdu(rdpRdp* rdp, wStream* s); FREERDP_LOCAL BOOL rdp_send_server_font_map_pdu(rdpRdp* rdp); -FREERDP_LOCAL BOOL rdp_server_accept_client_control_pdu(rdpRdp* rdp, - wStream* s); -FREERDP_LOCAL BOOL rdp_server_accept_client_font_list_pdu(rdpRdp* rdp, - wStream* s); +FREERDP_LOCAL BOOL rdp_server_accept_client_control_pdu(rdpRdp* rdp, wStream* s); +FREERDP_LOCAL BOOL rdp_server_accept_client_font_list_pdu(rdpRdp* rdp, wStream* s); #endif /* FREERDP_LIB_CORE_ACTIVATION_H */ diff --git a/libfreerdp/core/autodetect.c b/libfreerdp/core/autodetect.c index 11cf08578..52a6c5176 100644 --- a/libfreerdp/core/autodetect.c +++ b/libfreerdp/core/autodetect.c @@ -25,21 +25,21 @@ #include "autodetect.h" -#define RDP_RTT_REQUEST_TYPE_CONTINUOUS 0x0001 +#define RDP_RTT_REQUEST_TYPE_CONTINUOUS 0x0001 #define RDP_RTT_REQUEST_TYPE_CONNECTTIME 0x1001 #define RDP_RTT_RESPONSE_TYPE 0x0000 -#define RDP_BW_START_REQUEST_TYPE_CONTINUOUS 0x0014 -#define RDP_BW_START_REQUEST_TYPE_TUNNEL 0x0114 +#define RDP_BW_START_REQUEST_TYPE_CONTINUOUS 0x0014 +#define RDP_BW_START_REQUEST_TYPE_TUNNEL 0x0114 #define RDP_BW_START_REQUEST_TYPE_CONNECTTIME 0x1014 -#define RDP_BW_PAYLOAD_REQUEST_TYPE 0x0002 -#define RDP_BW_STOP_REQUEST_TYPE_CONNECTTIME 0x002B -#define RDP_BW_STOP_REQUEST_TYPE_CONTINUOUS 0x0429 -#define RDP_BW_STOP_REQUEST_TYPE_TUNNEL 0x0629 +#define RDP_BW_PAYLOAD_REQUEST_TYPE 0x0002 +#define RDP_BW_STOP_REQUEST_TYPE_CONNECTTIME 0x002B +#define RDP_BW_STOP_REQUEST_TYPE_CONTINUOUS 0x0429 +#define RDP_BW_STOP_REQUEST_TYPE_TUNNEL 0x0629 #define RDP_BW_RESULTS_RESPONSE_TYPE_CONNECTTIME 0x0003 -#define RDP_BW_RESULTS_RESPONSE_TYPE_CONTINUOUS 0x000B +#define RDP_BW_RESULTS_RESPONSE_TYPE_CONTINUOUS 0x000B #define RDP_NETCHAR_SYNC_RESPONSE_TYPE 0x0018 @@ -60,7 +60,7 @@ typedef struct } AUTODETECT_RSP_PDU; static BOOL autodetect_send_rtt_measure_request(rdpContext* context, UINT16 sequenceNumber, - UINT16 requestType) + UINT16 requestType) { wStream* s; s = rdp_message_channel_pdu_init(context->rdp); @@ -69,25 +69,25 @@ static BOOL autodetect_send_rtt_measure_request(rdpContext* context, UINT16 sequ return FALSE; WLog_VRB(AUTODETECT_TAG, "sending RTT Measure Request PDU"); - Stream_Write_UINT8(s, 0x06); /* headerLength (1 byte) */ + Stream_Write_UINT8(s, 0x06); /* headerLength (1 byte) */ Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_REQUEST); /* headerTypeId (1 byte) */ - Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */ - Stream_Write_UINT16(s, requestType); /* requestType (2 bytes) */ + Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */ + Stream_Write_UINT16(s, requestType); /* requestType (2 bytes) */ context->rdp->autodetect->rttMeasureStartTime = GetTickCount64(); return rdp_send_message_channel_pdu(context->rdp, s, SEC_AUTODETECT_REQ); } static BOOL autodetect_send_continuous_rtt_measure_request(rdpContext* context, - UINT16 sequenceNumber) + UINT16 sequenceNumber) { return autodetect_send_rtt_measure_request(context, sequenceNumber, - RDP_RTT_REQUEST_TYPE_CONTINUOUS); + RDP_RTT_REQUEST_TYPE_CONTINUOUS); } BOOL autodetect_send_connecttime_rtt_measure_request(rdpContext* context, UINT16 sequenceNumber) { return autodetect_send_rtt_measure_request(context, sequenceNumber, - RDP_RTT_REQUEST_TYPE_CONNECTTIME); + RDP_RTT_REQUEST_TYPE_CONNECTTIME); } static BOOL autodetect_send_rtt_measure_response(rdpRdp* rdp, UINT16 sequenceNumber) @@ -100,15 +100,15 @@ static BOOL autodetect_send_rtt_measure_response(rdpRdp* rdp, UINT16 sequenceNum return FALSE; WLog_VRB(AUTODETECT_TAG, "sending RTT Measure Response PDU"); - Stream_Write_UINT8(s, 0x06); /* headerLength (1 byte) */ + Stream_Write_UINT8(s, 0x06); /* headerLength (1 byte) */ Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_RESPONSE); /* headerTypeId (1 byte) */ - Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */ - Stream_Write_UINT16(s, RDP_RTT_RESPONSE_TYPE); /* responseType (1 byte) */ + Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */ + Stream_Write_UINT16(s, RDP_RTT_RESPONSE_TYPE); /* responseType (1 byte) */ return rdp_send_message_channel_pdu(rdp, s, SEC_AUTODETECT_RSP); } static BOOL autodetect_send_bandwidth_measure_start(rdpContext* context, UINT16 sequenceNumber, - UINT16 requestType) + UINT16 requestType) { wStream* s; s = rdp_message_channel_pdu_init(context->rdp); @@ -117,28 +117,28 @@ static BOOL autodetect_send_bandwidth_measure_start(rdpContext* context, UINT16 return FALSE; WLog_VRB(AUTODETECT_TAG, "sending Bandwidth Measure Start PDU"); - Stream_Write_UINT8(s, 0x06); /* headerLength (1 byte) */ + Stream_Write_UINT8(s, 0x06); /* headerLength (1 byte) */ Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_REQUEST); /* headerTypeId (1 byte) */ - Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */ - Stream_Write_UINT16(s, requestType); /* requestType (2 bytes) */ + Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */ + Stream_Write_UINT16(s, requestType); /* requestType (2 bytes) */ return rdp_send_message_channel_pdu(context->rdp, s, SEC_AUTODETECT_REQ); } static BOOL autodetect_send_continuous_bandwidth_measure_start(rdpContext* context, - UINT16 sequenceNumber) + UINT16 sequenceNumber) { return autodetect_send_bandwidth_measure_start(context, sequenceNumber, - RDP_BW_START_REQUEST_TYPE_CONTINUOUS); + RDP_BW_START_REQUEST_TYPE_CONTINUOUS); } BOOL autodetect_send_connecttime_bandwidth_measure_start(rdpContext* context, UINT16 sequenceNumber) { return autodetect_send_bandwidth_measure_start(context, sequenceNumber, - RDP_BW_START_REQUEST_TYPE_CONNECTTIME); + RDP_BW_START_REQUEST_TYPE_CONNECTTIME); } BOOL autodetect_send_bandwidth_measure_payload(rdpContext* context, UINT16 payloadLength, - UINT16 sequenceNumber) + UINT16 sequenceNumber) { wStream* s; UCHAR* buffer = NULL; @@ -148,7 +148,7 @@ BOOL autodetect_send_bandwidth_measure_payload(rdpContext* context, UINT16 paylo if (!s) return FALSE; - WLog_VRB(AUTODETECT_TAG, "sending Bandwidth Measure Payload PDU -> payloadLength=%"PRIu16"", + WLog_VRB(AUTODETECT_TAG, "sending Bandwidth Measure Payload PDU -> payloadLength=%" PRIu16 "", payloadLength); /* 4-bytes aligned */ payloadLength &= ~3; @@ -159,11 +159,11 @@ BOOL autodetect_send_bandwidth_measure_payload(rdpContext* context, UINT16 paylo return FALSE; } - Stream_Write_UINT8(s, 0x08); /* headerLength (1 byte) */ - Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_REQUEST); /* headerTypeId (1 byte) */ - Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */ + Stream_Write_UINT8(s, 0x08); /* headerLength (1 byte) */ + Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_REQUEST); /* headerTypeId (1 byte) */ + Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */ Stream_Write_UINT16(s, RDP_BW_PAYLOAD_REQUEST_TYPE); /* requestType (2 bytes) */ - Stream_Write_UINT16(s, payloadLength); /* payloadLength (2 bytes) */ + Stream_Write_UINT16(s, payloadLength); /* payloadLength (2 bytes) */ /* Random data (better measurement in case the line is compressed) */ buffer = (UCHAR*)malloc(payloadLength); @@ -181,7 +181,7 @@ BOOL autodetect_send_bandwidth_measure_payload(rdpContext* context, UINT16 paylo } static BOOL autodetect_send_bandwidth_measure_stop(rdpContext* context, UINT16 payloadLength, - UINT16 sequenceNumber, UINT16 requestType) + UINT16 sequenceNumber, UINT16 requestType) { wStream* s; UCHAR* buffer = NULL; @@ -191,15 +191,16 @@ static BOOL autodetect_send_bandwidth_measure_stop(rdpContext* context, UINT16 p if (!s) return FALSE; - WLog_VRB(AUTODETECT_TAG, "sending Bandwidth Measure Stop PDU -> payloadLength=%"PRIu16"", + WLog_VRB(AUTODETECT_TAG, "sending Bandwidth Measure Stop PDU -> payloadLength=%" PRIu16 "", payloadLength); /* 4-bytes aligned */ payloadLength &= ~3; - Stream_Write_UINT8(s, requestType == RDP_BW_STOP_REQUEST_TYPE_CONNECTTIME ? 0x08 : - 0x06); /* headerLength (1 byte) */ + Stream_Write_UINT8(s, requestType == RDP_BW_STOP_REQUEST_TYPE_CONNECTTIME + ? 0x08 + : 0x06); /* headerLength (1 byte) */ Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_REQUEST); /* headerTypeId (1 byte) */ - Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */ - Stream_Write_UINT16(s, requestType); /* requestType (2 bytes) */ + Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */ + Stream_Write_UINT16(s, requestType); /* requestType (2 bytes) */ if (requestType == RDP_BW_STOP_REQUEST_TYPE_CONNECTTIME) { @@ -233,21 +234,21 @@ static BOOL autodetect_send_bandwidth_measure_stop(rdpContext* context, UINT16 p } static BOOL autodetect_send_continuous_bandwidth_measure_stop(rdpContext* context, - UINT16 sequenceNumber) + UINT16 sequenceNumber) { return autodetect_send_bandwidth_measure_stop(context, 0, sequenceNumber, - RDP_BW_STOP_REQUEST_TYPE_CONTINUOUS); + RDP_BW_STOP_REQUEST_TYPE_CONTINUOUS); } BOOL autodetect_send_connecttime_bandwidth_measure_stop(rdpContext* context, UINT16 payloadLength, - UINT16 sequenceNumber) + UINT16 sequenceNumber) { return autodetect_send_bandwidth_measure_stop(context, payloadLength, sequenceNumber, - RDP_BW_STOP_REQUEST_TYPE_CONNECTTIME); + RDP_BW_STOP_REQUEST_TYPE_CONNECTTIME); } static BOOL autodetect_send_bandwidth_measure_results(rdpRdp* rdp, UINT16 responseType, - UINT16 sequenceNumber) + UINT16 sequenceNumber) { BOOL success = TRUE; wStream* s; @@ -261,16 +262,17 @@ static BOOL autodetect_send_bandwidth_measure_results(rdpRdp* rdp, UINT16 respon return FALSE; WLog_VRB(AUTODETECT_TAG, - "sending Bandwidth Measure Results PDU -> timeDelta=%"PRIu32", byteCount=%"PRIu32"", timeDelta, - rdp->autodetect->bandwidthMeasureByteCount); - Stream_Write_UINT8(s, 0x0E); /* headerLength (1 byte) */ + "sending Bandwidth Measure Results PDU -> timeDelta=%" PRIu32 ", byteCount=%" PRIu32 + "", + timeDelta, rdp->autodetect->bandwidthMeasureByteCount); + Stream_Write_UINT8(s, 0x0E); /* headerLength (1 byte) */ Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_RESPONSE); /* headerTypeId (1 byte) */ - Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */ - Stream_Write_UINT16(s, responseType); /* responseType (1 byte) */ - Stream_Write_UINT32(s, timeDelta); /* timeDelta (4 bytes) */ + Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */ + Stream_Write_UINT16(s, responseType); /* responseType (1 byte) */ + Stream_Write_UINT32(s, timeDelta); /* timeDelta (4 bytes) */ Stream_Write_UINT32(s, rdp->autodetect->bandwidthMeasureByteCount); /* byteCount (4 bytes) */ - IFCALLRET(rdp->autodetect->ClientBandwidthMeasureResult, success, - rdp->context, rdp->autodetect); + IFCALLRET(rdp->autodetect->ClientBandwidthMeasureResult, success, rdp->context, + rdp->autodetect); if (!success) return FALSE; @@ -290,22 +292,25 @@ static BOOL autodetect_send_netchar_result(rdpContext* context, UINT16 sequenceN if (context->rdp->autodetect->netCharBandwidth > 0) { - Stream_Write_UINT8(s, 0x12); /* headerLength (1 byte) */ + Stream_Write_UINT8(s, 0x12); /* headerLength (1 byte) */ Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_REQUEST); /* headerTypeId (1 byte) */ - Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */ - Stream_Write_UINT16(s, 0x08C0); /* requestType (2 bytes) */ + Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */ + Stream_Write_UINT16(s, 0x08C0); /* requestType (2 bytes) */ Stream_Write_UINT32(s, context->rdp->autodetect->netCharBaseRTT); /* baseRTT (4 bytes) */ - Stream_Write_UINT32(s, context->rdp->autodetect->netCharBandwidth); /* bandwidth (4 bytes) */ - Stream_Write_UINT32(s, context->rdp->autodetect->netCharAverageRTT); /* averageRTT (4 bytes) */ + Stream_Write_UINT32(s, + context->rdp->autodetect->netCharBandwidth); /* bandwidth (4 bytes) */ + Stream_Write_UINT32(s, + context->rdp->autodetect->netCharAverageRTT); /* averageRTT (4 bytes) */ } else { - Stream_Write_UINT8(s, 0x0E); /* headerLength (1 byte) */ + Stream_Write_UINT8(s, 0x0E); /* headerLength (1 byte) */ Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_REQUEST); /* headerTypeId (1 byte) */ - Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */ - Stream_Write_UINT16(s, 0x0840); /* requestType (2 bytes) */ + Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */ + Stream_Write_UINT16(s, 0x0840); /* requestType (2 bytes) */ Stream_Write_UINT32(s, context->rdp->autodetect->netCharBaseRTT); /* baseRTT (4 bytes) */ - Stream_Write_UINT32(s, context->rdp->autodetect->netCharAverageRTT); /* averageRTT (4 bytes) */ + Stream_Write_UINT32(s, + context->rdp->autodetect->netCharAverageRTT); /* averageRTT (4 bytes) */ } return rdp_send_message_channel_pdu(context->rdp, s, SEC_AUTODETECT_REQ); @@ -321,19 +326,19 @@ BOOL autodetect_send_netchar_sync(rdpRdp* rdp, UINT16 sequenceNumber) return FALSE; WLog_VRB(AUTODETECT_TAG, - "sending Network Characteristics Sync PDU -> bandwidth=%"PRIu32", rtt=%"PRIu32"", + "sending Network Characteristics Sync PDU -> bandwidth=%" PRIu32 ", rtt=%" PRIu32 "", rdp->autodetect->netCharBandwidth, rdp->autodetect->netCharAverageRTT); - Stream_Write_UINT8(s, 0x0E); /* headerLength (1 byte) */ - Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_RESPONSE); /* headerTypeId (1 byte) */ - Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */ - Stream_Write_UINT16(s, RDP_NETCHAR_SYNC_RESPONSE_TYPE); /* responseType (1 byte) */ - Stream_Write_UINT32(s, rdp->autodetect->netCharBandwidth); /* bandwidth (4 bytes) */ + Stream_Write_UINT8(s, 0x0E); /* headerLength (1 byte) */ + Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_RESPONSE); /* headerTypeId (1 byte) */ + Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */ + Stream_Write_UINT16(s, RDP_NETCHAR_SYNC_RESPONSE_TYPE); /* responseType (1 byte) */ + Stream_Write_UINT32(s, rdp->autodetect->netCharBandwidth); /* bandwidth (4 bytes) */ Stream_Write_UINT32(s, rdp->autodetect->netCharAverageRTT); /* rtt (4 bytes) */ return rdp_send_message_channel_pdu(rdp, s, SEC_AUTODETECT_RSP); } static BOOL autodetect_recv_rtt_measure_request(rdpRdp* rdp, wStream* s, - AUTODETECT_REQ_PDU* autodetectReqPdu) + AUTODETECT_REQ_PDU* autodetectReqPdu) { if (autodetectReqPdu->headerLength != 0x06) return FALSE; @@ -344,7 +349,7 @@ static BOOL autodetect_recv_rtt_measure_request(rdpRdp* rdp, wStream* s, } static BOOL autodetect_recv_rtt_measure_response(rdpRdp* rdp, wStream* s, - AUTODETECT_RSP_PDU* autodetectRspPdu) + AUTODETECT_RSP_PDU* autodetectRspPdu) { BOOL success = TRUE; @@ -364,13 +369,13 @@ static BOOL autodetect_recv_rtt_measure_response(rdpRdp* rdp, wStream* s, } static BOOL autodetect_recv_bandwidth_measure_start(rdpRdp* rdp, wStream* s, - AUTODETECT_REQ_PDU* autodetectReqPdu) + AUTODETECT_REQ_PDU* autodetectReqPdu) { if (autodetectReqPdu->headerLength != 0x06) return FALSE; - WLog_VRB(AUTODETECT_TAG, "received Bandwidth Measure Start PDU - time=%"PRIu64"", - GetTickCount64()); + WLog_VRB(AUTODETECT_TAG, "received Bandwidth Measure Start PDU - time=%" PRIu64 "", + GetTickCount64()); /* Initialize bandwidth measurement parameters */ rdp->autodetect->bandwidthMeasureStartTime = GetTickCount64(); rdp->autodetect->bandwidthMeasureByteCount = 0; @@ -385,7 +390,7 @@ static BOOL autodetect_recv_bandwidth_measure_start(rdpRdp* rdp, wStream* s, } static BOOL autodetect_recv_bandwidth_measure_payload(rdpRdp* rdp, wStream* s, - AUTODETECT_REQ_PDU* autodetectReqPdu) + AUTODETECT_REQ_PDU* autodetectReqPdu) { UINT16 payloadLength; @@ -396,7 +401,7 @@ static BOOL autodetect_recv_bandwidth_measure_payload(rdpRdp* rdp, wStream* s, return FALSE; Stream_Read_UINT16(s, payloadLength); /* payloadLength (2 bytes) */ - WLog_DBG(AUTODETECT_TAG, "received Bandwidth Measure Payload PDU -> payloadLength=%"PRIu16"", + WLog_DBG(AUTODETECT_TAG, "received Bandwidth Measure Payload PDU -> payloadLength=%" PRIu16 "", payloadLength); /* Add the payload length to the bandwidth measurement parameters */ rdp->autodetect->bandwidthMeasureByteCount += payloadLength; @@ -404,7 +409,7 @@ static BOOL autodetect_recv_bandwidth_measure_payload(rdpRdp* rdp, wStream* s, } static BOOL autodetect_recv_bandwidth_measure_stop(rdpRdp* rdp, wStream* s, - AUTODETECT_REQ_PDU* autodetectReqPdu) + AUTODETECT_REQ_PDU* autodetectReqPdu) { UINT16 payloadLength; UINT16 responseType; @@ -427,7 +432,7 @@ static BOOL autodetect_recv_bandwidth_measure_stop(rdpRdp* rdp, wStream* s, payloadLength = 0; } - WLog_VRB(AUTODETECT_TAG, "received Bandwidth Measure Stop PDU -> payloadLength=%"PRIu16"", + WLog_VRB(AUTODETECT_TAG, "received Bandwidth Measure Stop PDU -> payloadLength=%" PRIu16 "", payloadLength); /* Add the payload length to the bandwidth measurement parameters */ rdp->autodetect->bandwidthMeasureByteCount += payloadLength; @@ -439,14 +444,15 @@ static BOOL autodetect_recv_bandwidth_measure_stop(rdpRdp* rdp, wStream* s, } /* Send a response the server */ - responseType = autodetectReqPdu->requestType == RDP_BW_STOP_REQUEST_TYPE_CONNECTTIME ? - RDP_BW_RESULTS_RESPONSE_TYPE_CONNECTTIME : RDP_BW_RESULTS_RESPONSE_TYPE_CONTINUOUS; + responseType = autodetectReqPdu->requestType == RDP_BW_STOP_REQUEST_TYPE_CONNECTTIME + ? RDP_BW_RESULTS_RESPONSE_TYPE_CONNECTTIME + : RDP_BW_RESULTS_RESPONSE_TYPE_CONTINUOUS; return autodetect_send_bandwidth_measure_results(rdp, responseType, - autodetectReqPdu->sequenceNumber); + autodetectReqPdu->sequenceNumber); } static BOOL autodetect_recv_bandwidth_measure_results(rdpRdp* rdp, wStream* s, - AUTODETECT_RSP_PDU* autodetectRspPdu) + AUTODETECT_RSP_PDU* autodetectRspPdu) { BOOL success = TRUE; @@ -469,7 +475,7 @@ static BOOL autodetect_recv_bandwidth_measure_results(rdpRdp* rdp, wStream* s, } static BOOL autodetect_recv_netchar_result(rdpRdp* rdp, wStream* s, - AUTODETECT_REQ_PDU* autodetectReqPdu) + AUTODETECT_REQ_PDU* autodetectReqPdu) { BOOL success = TRUE; @@ -481,7 +487,7 @@ static BOOL autodetect_recv_netchar_result(rdpRdp* rdp, wStream* s, if ((autodetectReqPdu->headerLength != 0x0E) || (Stream_GetRemainingLength(s) < 8)) return FALSE; - Stream_Read_UINT32(s, rdp->autodetect->netCharBaseRTT); /* baseRTT (4 bytes) */ + Stream_Read_UINT32(s, rdp->autodetect->netCharBaseRTT); /* baseRTT (4 bytes) */ Stream_Read_UINT32(s, rdp->autodetect->netCharAverageRTT); /* averageRTT (4 bytes) */ break; @@ -491,7 +497,7 @@ static BOOL autodetect_recv_netchar_result(rdpRdp* rdp, wStream* s, if ((autodetectReqPdu->headerLength != 0x0E) || (Stream_GetRemainingLength(s) < 8)) return FALSE; - Stream_Read_UINT32(s, rdp->autodetect->netCharBandwidth); /* bandwidth (4 bytes) */ + Stream_Read_UINT32(s, rdp->autodetect->netCharBandwidth); /* bandwidth (4 bytes) */ Stream_Read_UINT32(s, rdp->autodetect->netCharAverageRTT); /* averageRTT (4 bytes) */ break; @@ -501,14 +507,15 @@ static BOOL autodetect_recv_netchar_result(rdpRdp* rdp, wStream* s, if ((autodetectReqPdu->headerLength != 0x12) || (Stream_GetRemainingLength(s) < 12)) return FALSE; - Stream_Read_UINT32(s, rdp->autodetect->netCharBaseRTT); /* baseRTT (4 bytes) */ - Stream_Read_UINT32(s, rdp->autodetect->netCharBandwidth); /* bandwidth (4 bytes) */ + Stream_Read_UINT32(s, rdp->autodetect->netCharBaseRTT); /* baseRTT (4 bytes) */ + Stream_Read_UINT32(s, rdp->autodetect->netCharBandwidth); /* bandwidth (4 bytes) */ Stream_Read_UINT32(s, rdp->autodetect->netCharAverageRTT); /* averageRTT (4 bytes) */ break; } WLog_VRB(AUTODETECT_TAG, - "received Network Characteristics Result PDU -> baseRTT=%"PRIu32", bandwidth=%"PRIu32", averageRTT=%"PRIu32"", + "received Network Characteristics Result PDU -> baseRTT=%" PRIu32 + ", bandwidth=%" PRIu32 ", averageRTT=%" PRIu32 "", rdp->autodetect->netCharBaseRTT, rdp->autodetect->netCharBandwidth, rdp->autodetect->netCharAverageRTT); IFCALLRET(rdp->autodetect->NetworkCharacteristicsResult, success, rdp->context, @@ -524,12 +531,13 @@ int rdp_recv_autodetect_request_packet(rdpRdp* rdp, wStream* s) if (Stream_GetRemainingLength(s) < 6) return -1; - Stream_Read_UINT8(s, autodetectReqPdu.headerLength); /* headerLength (1 byte) */ - Stream_Read_UINT8(s, autodetectReqPdu.headerTypeId); /* headerTypeId (1 byte) */ + Stream_Read_UINT8(s, autodetectReqPdu.headerLength); /* headerLength (1 byte) */ + Stream_Read_UINT8(s, autodetectReqPdu.headerTypeId); /* headerTypeId (1 byte) */ Stream_Read_UINT16(s, autodetectReqPdu.sequenceNumber); /* sequenceNumber (2 bytes) */ - Stream_Read_UINT16(s, autodetectReqPdu.requestType); /* requestType (2 bytes) */ + Stream_Read_UINT16(s, autodetectReqPdu.requestType); /* requestType (2 bytes) */ WLog_VRB(AUTODETECT_TAG, - "rdp_recv_autodetect_request_packet: headerLength=%"PRIu8", headerTypeId=%"PRIu8", sequenceNumber=%"PRIu16", requestType=%04"PRIx16"", + "rdp_recv_autodetect_request_packet: headerLength=%" PRIu8 ", headerTypeId=%" PRIu8 + ", sequenceNumber=%" PRIu16 ", requestType=%04" PRIx16 "", autodetectReqPdu.headerLength, autodetectReqPdu.headerTypeId, autodetectReqPdu.sequenceNumber, autodetectReqPdu.requestType); @@ -585,12 +593,13 @@ int rdp_recv_autodetect_response_packet(rdpRdp* rdp, wStream* s) if (Stream_GetRemainingLength(s) < 6) return -1; - Stream_Read_UINT8(s, autodetectRspPdu.headerLength); /* headerLength (1 byte) */ - Stream_Read_UINT8(s, autodetectRspPdu.headerTypeId); /* headerTypeId (1 byte) */ + Stream_Read_UINT8(s, autodetectRspPdu.headerLength); /* headerLength (1 byte) */ + Stream_Read_UINT8(s, autodetectRspPdu.headerTypeId); /* headerTypeId (1 byte) */ Stream_Read_UINT16(s, autodetectRspPdu.sequenceNumber); /* sequenceNumber (2 bytes) */ - Stream_Read_UINT16(s, autodetectRspPdu.responseType); /* responseType (2 bytes) */ + Stream_Read_UINT16(s, autodetectRspPdu.responseType); /* responseType (2 bytes) */ WLog_VRB(AUTODETECT_TAG, - "rdp_recv_autodetect_response_packet: headerLength=%"PRIu8", headerTypeId=%"PRIu8", sequenceNumber=%"PRIu16", requestType=%04"PRIx16"", + "rdp_recv_autodetect_response_packet: headerLength=%" PRIu8 ", headerTypeId=%" PRIu8 + ", sequenceNumber=%" PRIu16 ", requestType=%04" PRIx16 "", autodetectRspPdu.headerLength, autodetectRspPdu.headerTypeId, autodetectRspPdu.sequenceNumber, autodetectRspPdu.responseType); @@ -619,7 +628,7 @@ int rdp_recv_autodetect_response_packet(rdpRdp* rdp, wStream* s) rdpAutoDetect* autodetect_new(void) { - rdpAutoDetect* autoDetect = (rdpAutoDetect*) calloc(1, sizeof(rdpAutoDetect)); + rdpAutoDetect* autoDetect = (rdpAutoDetect*)calloc(1, sizeof(rdpAutoDetect)); if (autoDetect) { diff --git a/libfreerdp/core/autodetect.h b/libfreerdp/core/autodetect.h index cbe499e45..a2263f7b4 100644 --- a/libfreerdp/core/autodetect.h +++ b/libfreerdp/core/autodetect.h @@ -30,8 +30,8 @@ #include #include -#define TYPE_ID_AUTODETECT_REQUEST 0x00 -#define TYPE_ID_AUTODETECT_RESPONSE 0x01 +#define TYPE_ID_AUTODETECT_REQUEST 0x00 +#define TYPE_ID_AUTODETECT_RESPONSE 0x01 FREERDP_LOCAL int rdp_recv_autodetect_request_packet(rdpRdp* rdp, wStream* s); FREERDP_LOCAL int rdp_recv_autodetect_response_packet(rdpRdp* rdp, wStream* s); @@ -39,16 +39,17 @@ FREERDP_LOCAL int rdp_recv_autodetect_response_packet(rdpRdp* rdp, wStream* s); FREERDP_LOCAL rdpAutoDetect* autodetect_new(void); FREERDP_LOCAL void autodetect_free(rdpAutoDetect* autodetect); -FREERDP_LOCAL void autodetect_register_server_callbacks( - rdpAutoDetect* autodetect); -FREERDP_LOCAL BOOL autodetect_send_connecttime_rtt_measure_request( - rdpContext* context, UINT16 sequenceNumber); -FREERDP_LOCAL BOOL autodetect_send_connecttime_bandwidth_measure_start( - rdpContext* context, UINT16 sequenceNumber); -FREERDP_LOCAL BOOL autodetect_send_bandwidth_measure_payload( - rdpContext* context, UINT16 payloadLength, UINT16 sequenceNumber); -FREERDP_LOCAL BOOL autodetect_send_connecttime_bandwidth_measure_stop( - rdpContext* context, UINT16 payloadLength, UINT16 sequenceNumber); +FREERDP_LOCAL void autodetect_register_server_callbacks(rdpAutoDetect* autodetect); +FREERDP_LOCAL BOOL autodetect_send_connecttime_rtt_measure_request(rdpContext* context, + UINT16 sequenceNumber); +FREERDP_LOCAL BOOL autodetect_send_connecttime_bandwidth_measure_start(rdpContext* context, + UINT16 sequenceNumber); +FREERDP_LOCAL BOOL autodetect_send_bandwidth_measure_payload(rdpContext* context, + UINT16 payloadLength, + UINT16 sequenceNumber); +FREERDP_LOCAL BOOL autodetect_send_connecttime_bandwidth_measure_stop(rdpContext* context, + UINT16 payloadLength, + UINT16 sequenceNumber); #define AUTODETECT_TAG FREERDP_TAG("core.autodetect") diff --git a/libfreerdp/core/bulk.c b/libfreerdp/core/bulk.c index 980519b51..467a37521 100644 --- a/libfreerdp/core/bulk.c +++ b/libfreerdp/core/bulk.c @@ -54,8 +54,9 @@ static INLINE const char* bulk_get_compression_flags_string(UINT32 flags) UINT32 bulk_compression_level(rdpBulk* bulk) { rdpSettings* settings = bulk->context->settings; - bulk->CompressionLevel = (settings->CompressionLevel >= PACKET_COMPR_TYPE_RDP61) ? - PACKET_COMPR_TYPE_RDP61 : settings->CompressionLevel; + bulk->CompressionLevel = (settings->CompressionLevel >= PACKET_COMPR_TYPE_RDP61) + ? PACKET_COMPR_TYPE_RDP61 + : settings->CompressionLevel; return bulk->CompressionLevel; } @@ -66,8 +67,8 @@ UINT32 bulk_compression_max_size(rdpBulk* bulk) return bulk->CompressionMaxSize; } -static INLINE int bulk_compress_validate(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, - BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags) +static INLINE int bulk_compress_validate(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, + BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags) { int status; BYTE* _pSrcData = NULL; @@ -88,14 +89,17 @@ static INLINE int bulk_compress_validate(rdpBulk* bulk, BYTE* pSrcData, UINT32 if (_DstSize != SrcSize) { - WLog_DBG(TAG, "compression/decompression size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"", + WLog_DBG(TAG, + "compression/decompression size mismatch: Actual: %" PRIu32 ", Expected: %" PRIu32 + "", _DstSize, SrcSize); return -1; } if (memcmp(_pDstData, pSrcData, SrcSize) != 0) { - WLog_DBG(TAG, "compression/decompression input/output mismatch! flags: 0x%08"PRIX32"", _Flags); + WLog_DBG(TAG, "compression/decompression input/output mismatch! flags: 0x%08" PRIX32 "", + _Flags); #if 1 WLog_DBG(TAG, "Actual:"); winpr_HexDump(TAG, WLOG_DEBUG, _pDstData, SrcSize); @@ -127,20 +131,24 @@ int bulk_decompress(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstD { case PACKET_COMPR_TYPE_8K: mppc_set_compression_level(bulk->mppcRecv, 0); - status = mppc_decompress(bulk->mppcRecv, pSrcData, SrcSize, ppDstData, pDstSize, flags); + status = + mppc_decompress(bulk->mppcRecv, pSrcData, SrcSize, ppDstData, pDstSize, flags); break; case PACKET_COMPR_TYPE_64K: mppc_set_compression_level(bulk->mppcRecv, 1); - status = mppc_decompress(bulk->mppcRecv, pSrcData, SrcSize, ppDstData, pDstSize, flags); + status = + mppc_decompress(bulk->mppcRecv, pSrcData, SrcSize, ppDstData, pDstSize, flags); break; case PACKET_COMPR_TYPE_RDP6: - status = ncrush_decompress(bulk->ncrushRecv, pSrcData, SrcSize, ppDstData, pDstSize, flags); + status = ncrush_decompress(bulk->ncrushRecv, pSrcData, SrcSize, ppDstData, pDstSize, + flags); break; case PACKET_COMPR_TYPE_RDP61: - status = xcrush_decompress(bulk->xcrushRecv, pSrcData, SrcSize, ppDstData, pDstSize, flags); + status = xcrush_decompress(bulk->xcrushRecv, pSrcData, SrcSize, ppDstData, pDstSize, + flags); break; case PACKET_COMPR_TYPE_RDP8: @@ -163,11 +171,12 @@ int bulk_decompress(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstD #ifdef WITH_BULK_DEBUG { WLog_DBG(TAG, - "Decompress Type: %"PRIu32" Flags: %s (0x%08"PRIX32") Compression Ratio: %f (%"PRIu32" / %"PRIu32"), Total: %f (%"PRIu64" / %"PRIu64")", - type, bulk_get_compression_flags_string(flags), flags, - CompressionRatio, CompressedBytes, UncompressedBytes, - metrics->TotalCompressionRatio, metrics->TotalCompressedBytes, - metrics->TotalUncompressedBytes); + "Decompress Type: %" PRIu32 " Flags: %s (0x%08" PRIX32 + ") Compression Ratio: %f (%" PRIu32 " / %" PRIu32 "), Total: %f (%" PRIu64 + " / %" PRIu64 ")", + type, bulk_get_compression_flags_string(flags), flags, CompressionRatio, + CompressedBytes, UncompressedBytes, metrics->TotalCompressionRatio, + metrics->TotalCompressedBytes, metrics->TotalUncompressedBytes); } #else WINPR_UNUSED(CompressionRatio); @@ -230,7 +239,9 @@ int bulk_compress(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstDat #ifdef WITH_BULK_DEBUG { WLog_DBG(TAG, - "Compress Type: %"PRIu32" Flags: %s (0x%08"PRIX32") Compression Ratio: %f (%"PRIu32" / %"PRIu32"), Total: %f (%"PRIu64" / %"PRIu64")", + "Compress Type: %" PRIu32 " Flags: %s (0x%08" PRIX32 + ") Compression Ratio: %f (%" PRIu32 " / %" PRIu32 "), Total: %f (%" PRIu64 + " / %" PRIu64 ")", bulk->CompressionLevel, bulk_get_compression_flags_string(*pFlags), *pFlags, CompressionRatio, CompressedBytes, UncompressedBytes, metrics->TotalCompressionRatio, metrics->TotalCompressedBytes, @@ -263,7 +274,7 @@ void bulk_reset(rdpBulk* bulk) rdpBulk* bulk_new(rdpContext* context) { rdpBulk* bulk; - bulk = (rdpBulk*) calloc(1, sizeof(rdpBulk)); + bulk = (rdpBulk*)calloc(1, sizeof(rdpBulk)); if (bulk) { diff --git a/libfreerdp/core/bulk.h b/libfreerdp/core/bulk.h index 2151b1a0d..3b134d34a 100644 --- a/libfreerdp/core/bulk.h +++ b/libfreerdp/core/bulk.h @@ -43,16 +43,16 @@ struct rdp_bulk BYTE OutputBuffer[65536]; }; -#define BULK_COMPRESSION_FLAGS_MASK 0xE0 -#define BULK_COMPRESSION_TYPE_MASK 0x0F +#define BULK_COMPRESSION_FLAGS_MASK 0xE0 +#define BULK_COMPRESSION_TYPE_MASK 0x0F FREERDP_LOCAL UINT32 bulk_compression_level(rdpBulk* bulk); FREERDP_LOCAL UINT32 bulk_compression_max_size(rdpBulk* bulk); -FREERDP_LOCAL int bulk_decompress(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, - BYTE** ppDstData, UINT32* pDstSize, UINT32 flags); -FREERDP_LOCAL int bulk_compress(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, - BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags); +FREERDP_LOCAL int bulk_decompress(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, + UINT32* pDstSize, UINT32 flags); +FREERDP_LOCAL int bulk_compress(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, + UINT32* pDstSize, UINT32* pFlags); FREERDP_LOCAL void bulk_reset(rdpBulk* bulk); diff --git a/libfreerdp/core/capabilities.c b/libfreerdp/core/capabilities.c index 58151c835..0602f4bc9 100644 --- a/libfreerdp/core/capabilities.c +++ b/libfreerdp/core/capabilities.c @@ -31,40 +31,37 @@ #define TAG FREERDP_TAG("core.capabilities") -static const char* const CAPSET_TYPE_STRINGS[] = -{ - "Unknown", - "General", - "Bitmap", - "Order", - "Bitmap Cache", - "Control", - "Unknown", - "Window Activation", - "Pointer", - "Share", - "Color Cache", - "Unknown", - "Sound", - "Input", - "Font", - "Brush", - "Glyph Cache", - "Offscreen Bitmap Cache", - "Bitmap Cache Host Support", - "Bitmap Cache v2", - "Virtual Channel", - "DrawNineGrid Cache", - "Draw GDI+ Cache", - "Remote Programs", - "Window List", - "Desktop Composition", - "Multifragment Update", - "Large Pointer", - "Surface Commands", - "Bitmap Codecs", - "Frame Acknowledge" -}; +static const char* const CAPSET_TYPE_STRINGS[] = { "Unknown", + "General", + "Bitmap", + "Order", + "Bitmap Cache", + "Control", + "Unknown", + "Window Activation", + "Pointer", + "Share", + "Color Cache", + "Unknown", + "Sound", + "Input", + "Font", + "Brush", + "Glyph Cache", + "Offscreen Bitmap Cache", + "Bitmap Cache Host Support", + "Bitmap Cache v2", + "Virtual Channel", + "DrawNineGrid Cache", + "Draw GDI+ Cache", + "Remote Programs", + "Window List", + "Desktop Composition", + "Multifragment Update", + "Large Pointer", + "Surface Commands", + "Bitmap Codecs", + "Frame Acknowledge" }; static const char* get_capability_name(UINT16 type) { @@ -80,62 +77,45 @@ static BOOL rdp_print_capability_sets(wStream* s, UINT16 numberCapabilities, BOO /* CODEC_GUID_REMOTEFX: 0x76772F12BD724463AFB3B73C9C6F7886 */ -static const GUID CODEC_GUID_REMOTEFX = -{ - 0x76772F12, - 0xBD72, 0x4463, - { 0xAF, 0xB3, 0xB7, 0x3C, 0x9C, 0x6F, 0x78, 0x86 } +static const GUID CODEC_GUID_REMOTEFX = { + 0x76772F12, 0xBD72, 0x4463, { 0xAF, 0xB3, 0xB7, 0x3C, 0x9C, 0x6F, 0x78, 0x86 } }; /* CODEC_GUID_NSCODEC 0xCA8D1BB9000F154F589FAE2D1A87E2D6 */ -static const GUID CODEC_GUID_NSCODEC = -{ - 0xCA8D1BB9, - 0x000F, 0x154F, - { 0x58, 0x9F, 0xAE, 0x2D, 0x1A, 0x87, 0xE2, 0xD6 } +static const GUID CODEC_GUID_NSCODEC = { + 0xCA8D1BB9, 0x000F, 0x154F, { 0x58, 0x9F, 0xAE, 0x2D, 0x1A, 0x87, 0xE2, 0xD6 } }; /* CODEC_GUID_IGNORE 0x9C4351A6353542AE910CCDFCE5760B58 */ -static const GUID CODEC_GUID_IGNORE = -{ - 0x9C4351A6, - 0x3535, 0x42AE, - { 0x91, 0x0C, 0xCD, 0xFC, 0xE5, 0x76, 0x0B, 0x58 } +static const GUID CODEC_GUID_IGNORE = { + 0x9C4351A6, 0x3535, 0x42AE, { 0x91, 0x0C, 0xCD, 0xFC, 0xE5, 0x76, 0x0B, 0x58 } }; /* CODEC_GUID_IMAGE_REMOTEFX 0x2744CCD49D8A4E74803C0ECBEEA19C54 */ -static const GUID CODEC_GUID_IMAGE_REMOTEFX = -{ - 0x2744CCD4, - 0x9D8A, 0x4E74, - { 0x80, 0x3C, 0x0E, 0xCB, 0xEE, 0xA1, 0x9C, 0x54 } +static const GUID CODEC_GUID_IMAGE_REMOTEFX = { + 0x2744CCD4, 0x9D8A, 0x4E74, { 0x80, 0x3C, 0x0E, 0xCB, 0xEE, 0xA1, 0x9C, 0x54 } }; #if defined(WITH_JPEG) /* CODEC_GUID_JPEG 0x430C9EED1BAF4CE6869ACB8B37B66237 */ -static const GUID CODEC_GUID_JPEG = -{ - 0x430C9EED, - 0x1BAF, 0x4CE6, - { 0x86, 0x9A, 0xCB, 0x8B, 0x37, 0xB6, 0x62, 0x37 } +static const GUID CODEC_GUID_JPEG = { + 0x430C9EED, 0x1BAF, 0x4CE6, { 0x86, 0x9A, 0xCB, 0x8B, 0x37, 0xB6, 0x62, 0x37 } }; #endif -static void rdp_read_capability_set_header(wStream* s, UINT16* length, - UINT16* type) +static void rdp_read_capability_set_header(wStream* s, UINT16* length, UINT16* type) { - Stream_Read_UINT16(s, *type); /* capabilitySetType */ + Stream_Read_UINT16(s, *type); /* capabilitySetType */ Stream_Read_UINT16(s, *length); /* lengthCapability */ } -static void rdp_write_capability_set_header(wStream* s, UINT16 length, - UINT16 type) +static void rdp_write_capability_set_header(wStream* s, UINT16 length, UINT16 type) { - Stream_Write_UINT16(s, type); /* capabilitySetType */ + Stream_Write_UINT16(s, type); /* capabilitySetType */ Stream_Write_UINT16(s, length); /* lengthCapability */ } @@ -165,8 +145,7 @@ static void rdp_capability_set_finish(wStream* s, size_t header, UINT16 type) * @return if the operation completed successfully */ -static BOOL rdp_read_general_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) +static BOOL rdp_read_general_capability_set(wStream* s, UINT16 length, rdpSettings* settings) { UINT16 extraFlags; BYTE refreshRectSupport; @@ -186,14 +165,14 @@ static BOOL rdp_read_general_capability_set(wStream* s, UINT16 length, Stream_Seek_UINT16(s); /* osMinorType (2 bytes) */ } - Stream_Seek_UINT16(s); /* protocolVersion (2 bytes) */ - Stream_Seek_UINT16(s); /* pad2OctetsA (2 bytes) */ - Stream_Seek_UINT16(s); /* generalCompressionTypes (2 bytes) */ - Stream_Read_UINT16(s, extraFlags); /* extraFlags (2 bytes) */ - Stream_Seek_UINT16(s); /* updateCapabilityFlag (2 bytes) */ - Stream_Seek_UINT16(s); /* remoteUnshareFlag (2 bytes) */ - Stream_Seek_UINT16(s); /* generalCompressionLevel (2 bytes) */ - Stream_Read_UINT8(s, refreshRectSupport); /* refreshRectSupport (1 byte) */ + Stream_Seek_UINT16(s); /* protocolVersion (2 bytes) */ + Stream_Seek_UINT16(s); /* pad2OctetsA (2 bytes) */ + Stream_Seek_UINT16(s); /* generalCompressionTypes (2 bytes) */ + Stream_Read_UINT16(s, extraFlags); /* extraFlags (2 bytes) */ + Stream_Seek_UINT16(s); /* updateCapabilityFlag (2 bytes) */ + Stream_Seek_UINT16(s); /* remoteUnshareFlag (2 bytes) */ + Stream_Seek_UINT16(s); /* generalCompressionLevel (2 bytes) */ + Stream_Read_UINT8(s, refreshRectSupport); /* refreshRectSupport (1 byte) */ Stream_Read_UINT8(s, suppressOutputSupport); /* suppressOutputSupport (1 byte) */ settings->NoBitmapCompressionHeader = (extraFlags & NO_BITMAP_COMPRESSION_HDR) ? TRUE : FALSE; settings->LongCredentialsSupported = (extraFlags & LONG_CREDENTIALS_SUPPORTED) ? TRUE : FALSE; @@ -254,18 +233,17 @@ static BOOL rdp_write_general_capability_set(wStream* s, const rdpSettings* sett if (settings->SaltedChecksum) extraFlags |= ENC_SALTED_CHECKSUM; - Stream_Write_UINT16(s, settings->OsMajorType); /* osMajorType (2 bytes) */ - Stream_Write_UINT16(s, settings->OsMinorType); /* osMinorType (2 bytes) */ - Stream_Write_UINT16(s, CAPS_PROTOCOL_VERSION); /* protocolVersion (2 bytes) */ - Stream_Write_UINT16(s, 0); /* pad2OctetsA (2 bytes) */ - Stream_Write_UINT16(s, 0); /* generalCompressionTypes (2 bytes) */ - Stream_Write_UINT16(s, extraFlags); /* extraFlags (2 bytes) */ - Stream_Write_UINT16(s, 0); /* updateCapabilityFlag (2 bytes) */ - Stream_Write_UINT16(s, 0); /* remoteUnshareFlag (2 bytes) */ - Stream_Write_UINT16(s, 0); /* generalCompressionLevel (2 bytes) */ - Stream_Write_UINT8(s, settings->RefreshRect); /* refreshRectSupport (1 byte) */ - Stream_Write_UINT8(s, - settings->SuppressOutput); /* suppressOutputSupport (1 byte) */ + Stream_Write_UINT16(s, settings->OsMajorType); /* osMajorType (2 bytes) */ + Stream_Write_UINT16(s, settings->OsMinorType); /* osMinorType (2 bytes) */ + Stream_Write_UINT16(s, CAPS_PROTOCOL_VERSION); /* protocolVersion (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2OctetsA (2 bytes) */ + Stream_Write_UINT16(s, 0); /* generalCompressionTypes (2 bytes) */ + Stream_Write_UINT16(s, extraFlags); /* extraFlags (2 bytes) */ + Stream_Write_UINT16(s, 0); /* updateCapabilityFlag (2 bytes) */ + Stream_Write_UINT16(s, 0); /* remoteUnshareFlag (2 bytes) */ + Stream_Write_UINT16(s, 0); /* generalCompressionLevel (2 bytes) */ + Stream_Write_UINT8(s, settings->RefreshRect); /* refreshRectSupport (1 byte) */ + Stream_Write_UINT8(s, settings->SuppressOutput); /* suppressOutputSupport (1 byte) */ rdp_capability_set_finish(s, header, CAPSET_TYPE_GENERAL); return TRUE; } @@ -288,29 +266,29 @@ static BOOL rdp_print_general_capability_set(wStream* s, UINT16 length) if (length < 24) return FALSE; - WLog_INFO(TAG, "GeneralCapabilitySet (length %"PRIu16"):", length); - Stream_Read_UINT16(s, osMajorType); /* osMajorType (2 bytes) */ - Stream_Read_UINT16(s, osMinorType); /* osMinorType (2 bytes) */ - Stream_Read_UINT16(s, protocolVersion); /* protocolVersion (2 bytes) */ - Stream_Read_UINT16(s, pad2OctetsA); /* pad2OctetsA (2 bytes) */ + WLog_INFO(TAG, "GeneralCapabilitySet (length %" PRIu16 "):", length); + Stream_Read_UINT16(s, osMajorType); /* osMajorType (2 bytes) */ + Stream_Read_UINT16(s, osMinorType); /* osMinorType (2 bytes) */ + Stream_Read_UINT16(s, protocolVersion); /* protocolVersion (2 bytes) */ + Stream_Read_UINT16(s, pad2OctetsA); /* pad2OctetsA (2 bytes) */ Stream_Read_UINT16(s, generalCompressionTypes); /* generalCompressionTypes (2 bytes) */ - Stream_Read_UINT16(s, extraFlags); /* extraFlags (2 bytes) */ - Stream_Read_UINT16(s, updateCapabilityFlag); /* updateCapabilityFlag (2 bytes) */ - Stream_Read_UINT16(s, remoteUnshareFlag); /* remoteUnshareFlag (2 bytes) */ + Stream_Read_UINT16(s, extraFlags); /* extraFlags (2 bytes) */ + Stream_Read_UINT16(s, updateCapabilityFlag); /* updateCapabilityFlag (2 bytes) */ + Stream_Read_UINT16(s, remoteUnshareFlag); /* remoteUnshareFlag (2 bytes) */ Stream_Read_UINT16(s, generalCompressionLevel); /* generalCompressionLevel (2 bytes) */ - Stream_Read_UINT8(s, refreshRectSupport); /* refreshRectSupport (1 byte) */ - Stream_Read_UINT8(s, suppressOutputSupport); /* suppressOutputSupport (1 byte) */ - WLog_INFO(TAG, "\tosMajorType: 0x%04"PRIX16"", osMajorType); - WLog_INFO(TAG, "\tosMinorType: 0x%04"PRIX16"", osMinorType); - WLog_INFO(TAG, "\tprotocolVersion: 0x%04"PRIX16"", protocolVersion); - WLog_INFO(TAG, "\tpad2OctetsA: 0x%04"PRIX16"", pad2OctetsA); - WLog_INFO(TAG, "\tgeneralCompressionTypes: 0x%04"PRIX16"", generalCompressionTypes); - WLog_INFO(TAG, "\textraFlags: 0x%04"PRIX16"", extraFlags); - WLog_INFO(TAG, "\tupdateCapabilityFlag: 0x%04"PRIX16"", updateCapabilityFlag); - WLog_INFO(TAG, "\tremoteUnshareFlag: 0x%04"PRIX16"", remoteUnshareFlag); - WLog_INFO(TAG, "\tgeneralCompressionLevel: 0x%04"PRIX16"", generalCompressionLevel); - WLog_INFO(TAG, "\trefreshRectSupport: 0x%02"PRIX8"", refreshRectSupport); - WLog_INFO(TAG, "\tsuppressOutputSupport: 0x%02"PRIX8"", suppressOutputSupport); + Stream_Read_UINT8(s, refreshRectSupport); /* refreshRectSupport (1 byte) */ + Stream_Read_UINT8(s, suppressOutputSupport); /* suppressOutputSupport (1 byte) */ + WLog_INFO(TAG, "\tosMajorType: 0x%04" PRIX16 "", osMajorType); + WLog_INFO(TAG, "\tosMinorType: 0x%04" PRIX16 "", osMinorType); + WLog_INFO(TAG, "\tprotocolVersion: 0x%04" PRIX16 "", protocolVersion); + WLog_INFO(TAG, "\tpad2OctetsA: 0x%04" PRIX16 "", pad2OctetsA); + WLog_INFO(TAG, "\tgeneralCompressionTypes: 0x%04" PRIX16 "", generalCompressionTypes); + WLog_INFO(TAG, "\textraFlags: 0x%04" PRIX16 "", extraFlags); + WLog_INFO(TAG, "\tupdateCapabilityFlag: 0x%04" PRIX16 "", updateCapabilityFlag); + WLog_INFO(TAG, "\tremoteUnshareFlag: 0x%04" PRIX16 "", remoteUnshareFlag); + WLog_INFO(TAG, "\tgeneralCompressionLevel: 0x%04" PRIX16 "", generalCompressionLevel); + WLog_INFO(TAG, "\trefreshRectSupport: 0x%02" PRIX8 "", refreshRectSupport); + WLog_INFO(TAG, "\tsuppressOutputSupport: 0x%02" PRIX8 "", suppressOutputSupport); return TRUE; } #endif @@ -323,8 +301,7 @@ static BOOL rdp_print_general_capability_set(wStream* s, UINT16 length) * @return if the operation completed successfully */ -static BOOL rdp_read_bitmap_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) +static BOOL rdp_read_bitmap_capability_set(wStream* s, UINT16 length, rdpSettings* settings) { BYTE drawingFlags; UINT16 desktopWidth; @@ -336,18 +313,18 @@ static BOOL rdp_read_bitmap_capability_set(wStream* s, UINT16 length, return FALSE; Stream_Read_UINT16(s, preferredBitsPerPixel); /* preferredBitsPerPixel (2 bytes) */ - Stream_Seek_UINT16(s); /* receive1BitPerPixel (2 bytes) */ - Stream_Seek_UINT16(s); /* receive4BitsPerPixel (2 bytes) */ - Stream_Seek_UINT16(s); /* receive8BitsPerPixel (2 bytes) */ - Stream_Read_UINT16(s, desktopWidth); /* desktopWidth (2 bytes) */ - Stream_Read_UINT16(s, desktopHeight); /* desktopHeight (2 bytes) */ - Stream_Seek_UINT16(s); /* pad2Octets (2 bytes) */ - Stream_Read_UINT16(s, desktopResizeFlag); /* desktopResizeFlag (2 bytes) */ - Stream_Seek_UINT16(s); /* bitmapCompressionFlag (2 bytes) */ - Stream_Seek_UINT8(s); /* highColorFlags (1 byte) */ - Stream_Read_UINT8(s, drawingFlags); /* drawingFlags (1 byte) */ - Stream_Seek_UINT16(s); /* multipleRectangleSupport (2 bytes) */ - Stream_Seek_UINT16(s); /* pad2OctetsB (2 bytes) */ + Stream_Seek_UINT16(s); /* receive1BitPerPixel (2 bytes) */ + Stream_Seek_UINT16(s); /* receive4BitsPerPixel (2 bytes) */ + Stream_Seek_UINT16(s); /* receive8BitsPerPixel (2 bytes) */ + Stream_Read_UINT16(s, desktopWidth); /* desktopWidth (2 bytes) */ + Stream_Read_UINT16(s, desktopHeight); /* desktopHeight (2 bytes) */ + Stream_Seek_UINT16(s); /* pad2Octets (2 bytes) */ + Stream_Read_UINT16(s, desktopResizeFlag); /* desktopResizeFlag (2 bytes) */ + Stream_Seek_UINT16(s); /* bitmapCompressionFlag (2 bytes) */ + Stream_Seek_UINT8(s); /* highColorFlags (1 byte) */ + Stream_Read_UINT8(s, drawingFlags); /* drawingFlags (1 byte) */ + Stream_Seek_UINT16(s); /* multipleRectangleSupport (2 bytes) */ + Stream_Seek_UINT16(s); /* pad2OctetsB (2 bytes) */ if (!settings->ServerMode && (preferredBitsPerPixel != settings->ColorDepth)) { @@ -360,7 +337,8 @@ static BOOL rdp_read_bitmap_capability_set(wStream* s, UINT16 length, if (!settings->ServerMode && settings->DesktopResize) { - /* The server may request a different desktop size during Deactivation-Reactivation sequence */ + /* The server may request a different desktop size during Deactivation-Reactivation sequence + */ settings->DesktopWidth = desktopWidth; settings->DesktopHeight = desktopHeight; } @@ -369,11 +347,12 @@ static BOOL rdp_read_bitmap_capability_set(wStream* s, UINT16 length, settings->DrawAllowSkipAlpha = (drawingFlags & DRAW_ALLOW_SKIP_ALPHA) ? TRUE : FALSE; if (settings->DrawAllowDynamicColorFidelity) - settings->DrawAllowDynamicColorFidelity = (drawingFlags & DRAW_ALLOW_DYNAMIC_COLOR_FIDELITY) ? - TRUE : FALSE; + settings->DrawAllowDynamicColorFidelity = + (drawingFlags & DRAW_ALLOW_DYNAMIC_COLOR_FIDELITY) ? TRUE : FALSE; if (settings->DrawAllowColorSubsampling) - settings->DrawAllowColorSubsampling = (drawingFlags & DRAW_ALLOW_COLOR_SUBSAMPLING) ? TRUE : FALSE; + settings->DrawAllowColorSubsampling = + (drawingFlags & DRAW_ALLOW_COLOR_SUBSAMPLING) ? TRUE : FALSE; return TRUE; } @@ -419,19 +398,19 @@ static BOOL rdp_write_bitmap_capability_set(wStream* s, const rdpSettings* setti else preferredBitsPerPixel = 8; - Stream_Write_UINT16(s, preferredBitsPerPixel); /* preferredBitsPerPixel (2 bytes) */ - Stream_Write_UINT16(s, 1); /* receive1BitPerPixel (2 bytes) */ - Stream_Write_UINT16(s, 1); /* receive4BitsPerPixel (2 bytes) */ - Stream_Write_UINT16(s, 1); /* receive8BitsPerPixel (2 bytes) */ - Stream_Write_UINT16(s, settings->DesktopWidth); /* desktopWidth (2 bytes) */ + Stream_Write_UINT16(s, preferredBitsPerPixel); /* preferredBitsPerPixel (2 bytes) */ + Stream_Write_UINT16(s, 1); /* receive1BitPerPixel (2 bytes) */ + Stream_Write_UINT16(s, 1); /* receive4BitsPerPixel (2 bytes) */ + Stream_Write_UINT16(s, 1); /* receive8BitsPerPixel (2 bytes) */ + Stream_Write_UINT16(s, settings->DesktopWidth); /* desktopWidth (2 bytes) */ Stream_Write_UINT16(s, settings->DesktopHeight); /* desktopHeight (2 bytes) */ - Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ Stream_Write_UINT16(s, settings->DesktopResize); /* desktopResizeFlag (2 bytes) */ - Stream_Write_UINT16(s, 1); /* bitmapCompressionFlag (2 bytes) */ - Stream_Write_UINT8(s, 0); /* highColorFlags (1 byte) */ - Stream_Write_UINT8(s, drawingFlags); /* drawingFlags (1 byte) */ - Stream_Write_UINT16(s, 1); /* multipleRectangleSupport (2 bytes) */ - Stream_Write_UINT16(s, 0); /* pad2OctetsB (2 bytes) */ + Stream_Write_UINT16(s, 1); /* bitmapCompressionFlag (2 bytes) */ + Stream_Write_UINT8(s, 0); /* highColorFlags (1 byte) */ + Stream_Write_UINT8(s, drawingFlags); /* drawingFlags (1 byte) */ + Stream_Write_UINT16(s, 1); /* multipleRectangleSupport (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2OctetsB (2 bytes) */ rdp_capability_set_finish(s, header, CAPSET_TYPE_BITMAP); return TRUE; } @@ -452,37 +431,37 @@ static BOOL rdp_print_bitmap_capability_set(wStream* s, UINT16 length) BYTE drawingFlags; UINT16 multipleRectangleSupport; UINT16 pad2OctetsB; - WLog_INFO(TAG, "BitmapCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "BitmapCapabilitySet (length %" PRIu16 "):", length); if (length < 28) return FALSE; - Stream_Read_UINT16(s, preferredBitsPerPixel); /* preferredBitsPerPixel (2 bytes) */ - Stream_Read_UINT16(s, receive1BitPerPixel); /* receive1BitPerPixel (2 bytes) */ - Stream_Read_UINT16(s, receive4BitsPerPixel); /* receive4BitsPerPixel (2 bytes) */ - Stream_Read_UINT16(s, receive8BitsPerPixel); /* receive8BitsPerPixel (2 bytes) */ - Stream_Read_UINT16(s, desktopWidth); /* desktopWidth (2 bytes) */ - Stream_Read_UINT16(s, desktopHeight); /* desktopHeight (2 bytes) */ - Stream_Read_UINT16(s, pad2Octets); /* pad2Octets (2 bytes) */ - Stream_Read_UINT16(s, desktopResizeFlag); /* desktopResizeFlag (2 bytes) */ - Stream_Read_UINT16(s, bitmapCompressionFlag); /* bitmapCompressionFlag (2 bytes) */ - Stream_Read_UINT8(s, highColorFlags); /* highColorFlags (1 byte) */ - Stream_Read_UINT8(s, drawingFlags); /* drawingFlags (1 byte) */ + Stream_Read_UINT16(s, preferredBitsPerPixel); /* preferredBitsPerPixel (2 bytes) */ + Stream_Read_UINT16(s, receive1BitPerPixel); /* receive1BitPerPixel (2 bytes) */ + Stream_Read_UINT16(s, receive4BitsPerPixel); /* receive4BitsPerPixel (2 bytes) */ + Stream_Read_UINT16(s, receive8BitsPerPixel); /* receive8BitsPerPixel (2 bytes) */ + Stream_Read_UINT16(s, desktopWidth); /* desktopWidth (2 bytes) */ + Stream_Read_UINT16(s, desktopHeight); /* desktopHeight (2 bytes) */ + Stream_Read_UINT16(s, pad2Octets); /* pad2Octets (2 bytes) */ + Stream_Read_UINT16(s, desktopResizeFlag); /* desktopResizeFlag (2 bytes) */ + Stream_Read_UINT16(s, bitmapCompressionFlag); /* bitmapCompressionFlag (2 bytes) */ + Stream_Read_UINT8(s, highColorFlags); /* highColorFlags (1 byte) */ + Stream_Read_UINT8(s, drawingFlags); /* drawingFlags (1 byte) */ Stream_Read_UINT16(s, multipleRectangleSupport); /* multipleRectangleSupport (2 bytes) */ - Stream_Read_UINT16(s, pad2OctetsB); /* pad2OctetsB (2 bytes) */ - WLog_INFO(TAG, "\tpreferredBitsPerPixel: 0x%04"PRIX16"", preferredBitsPerPixel); - WLog_INFO(TAG, "\treceive1BitPerPixel: 0x%04"PRIX16"", receive1BitPerPixel); - WLog_INFO(TAG, "\treceive4BitsPerPixel: 0x%04"PRIX16"", receive4BitsPerPixel); - WLog_INFO(TAG, "\treceive8BitsPerPixel: 0x%04"PRIX16"", receive8BitsPerPixel); - WLog_INFO(TAG, "\tdesktopWidth: 0x%04"PRIX16"", desktopWidth); - WLog_INFO(TAG, "\tdesktopHeight: 0x%04"PRIX16"", desktopHeight); - WLog_INFO(TAG, "\tpad2Octets: 0x%04"PRIX16"", pad2Octets); - WLog_INFO(TAG, "\tdesktopResizeFlag: 0x%04"PRIX16"", desktopResizeFlag); - WLog_INFO(TAG, "\tbitmapCompressionFlag: 0x%04"PRIX16"", bitmapCompressionFlag); - WLog_INFO(TAG, "\thighColorFlags: 0x%02"PRIX8"", highColorFlags); - WLog_INFO(TAG, "\tdrawingFlags: 0x%02"PRIX8"", drawingFlags); - WLog_INFO(TAG, "\tmultipleRectangleSupport: 0x%04"PRIX16"", multipleRectangleSupport); - WLog_INFO(TAG, "\tpad2OctetsB: 0x%04"PRIX16"", pad2OctetsB); + Stream_Read_UINT16(s, pad2OctetsB); /* pad2OctetsB (2 bytes) */ + WLog_INFO(TAG, "\tpreferredBitsPerPixel: 0x%04" PRIX16 "", preferredBitsPerPixel); + WLog_INFO(TAG, "\treceive1BitPerPixel: 0x%04" PRIX16 "", receive1BitPerPixel); + WLog_INFO(TAG, "\treceive4BitsPerPixel: 0x%04" PRIX16 "", receive4BitsPerPixel); + WLog_INFO(TAG, "\treceive8BitsPerPixel: 0x%04" PRIX16 "", receive8BitsPerPixel); + WLog_INFO(TAG, "\tdesktopWidth: 0x%04" PRIX16 "", desktopWidth); + WLog_INFO(TAG, "\tdesktopHeight: 0x%04" PRIX16 "", desktopHeight); + WLog_INFO(TAG, "\tpad2Octets: 0x%04" PRIX16 "", pad2Octets); + WLog_INFO(TAG, "\tdesktopResizeFlag: 0x%04" PRIX16 "", desktopResizeFlag); + WLog_INFO(TAG, "\tbitmapCompressionFlag: 0x%04" PRIX16 "", bitmapCompressionFlag); + WLog_INFO(TAG, "\thighColorFlags: 0x%02" PRIX8 "", highColorFlags); + WLog_INFO(TAG, "\tdrawingFlags: 0x%02" PRIX8 "", drawingFlags); + WLog_INFO(TAG, "\tmultipleRectangleSupport: 0x%04" PRIX16 "", multipleRectangleSupport); + WLog_INFO(TAG, "\tpad2OctetsB: 0x%04" PRIX16 "", pad2OctetsB); return TRUE; } #endif @@ -495,8 +474,7 @@ static BOOL rdp_print_bitmap_capability_set(wStream* s, UINT16 length) * @return if the operation completed successfully */ -static BOOL rdp_read_order_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) +static BOOL rdp_read_order_capability_set(wStream* s, UINT16 length, rdpSettings* settings) { int i; UINT16 orderFlags; @@ -508,23 +486,23 @@ static BOOL rdp_read_order_capability_set(wStream* s, UINT16 length, if (length < 88) return FALSE; - Stream_Seek(s, 16); /* terminalDescriptor (16 bytes) */ - Stream_Seek_UINT32(s); /* pad4OctetsA (4 bytes) */ - Stream_Seek_UINT16(s); /* desktopSaveXGranularity (2 bytes) */ - Stream_Seek_UINT16(s); /* desktopSaveYGranularity (2 bytes) */ - Stream_Seek_UINT16(s); /* pad2OctetsA (2 bytes) */ - Stream_Seek_UINT16(s); /* maximumOrderLevel (2 bytes) */ - Stream_Seek_UINT16(s); /* numberFonts (2 bytes) */ - Stream_Read_UINT16(s, orderFlags); /* orderFlags (2 bytes) */ - Stream_Read(s, orderSupport, 32); /* orderSupport (32 bytes) */ - Stream_Seek_UINT16(s); /* textFlags (2 bytes) */ + Stream_Seek(s, 16); /* terminalDescriptor (16 bytes) */ + Stream_Seek_UINT32(s); /* pad4OctetsA (4 bytes) */ + Stream_Seek_UINT16(s); /* desktopSaveXGranularity (2 bytes) */ + Stream_Seek_UINT16(s); /* desktopSaveYGranularity (2 bytes) */ + Stream_Seek_UINT16(s); /* pad2OctetsA (2 bytes) */ + Stream_Seek_UINT16(s); /* maximumOrderLevel (2 bytes) */ + Stream_Seek_UINT16(s); /* numberFonts (2 bytes) */ + Stream_Read_UINT16(s, orderFlags); /* orderFlags (2 bytes) */ + Stream_Read(s, orderSupport, 32); /* orderSupport (32 bytes) */ + Stream_Seek_UINT16(s); /* textFlags (2 bytes) */ Stream_Read_UINT16(s, orderSupportExFlags); /* orderSupportExFlags (2 bytes) */ - Stream_Seek_UINT32(s); /* pad4OctetsB (4 bytes) */ - Stream_Seek_UINT32(s); /* desktopSaveSize (4 bytes) */ - Stream_Seek_UINT16(s); /* pad2OctetsC (2 bytes) */ - Stream_Seek_UINT16(s); /* pad2OctetsD (2 bytes) */ - Stream_Seek_UINT16(s); /* textANSICodePage (2 bytes) */ - Stream_Seek_UINT16(s); /* pad2OctetsE (2 bytes) */ + Stream_Seek_UINT32(s); /* pad4OctetsB (4 bytes) */ + Stream_Seek_UINT32(s); /* desktopSaveSize (4 bytes) */ + Stream_Seek_UINT16(s); /* pad2OctetsC (2 bytes) */ + Stream_Seek_UINT16(s); /* pad2OctetsD (2 bytes) */ + Stream_Seek_UINT16(s); /* textANSICodePage (2 bytes) */ + Stream_Seek_UINT16(s); /* pad2OctetsE (2 bytes) */ for (i = 0; i < 32; i++) { @@ -544,7 +522,7 @@ static BOOL rdp_read_order_capability_set(wStream* s, UINT16 length, if (settings->BitmapCacheV3Enabled && BitmapCacheV3Enabled) settings->BitmapCacheVersion = 3; else - settings ->BitmapCacheV3Enabled = FALSE; + settings->BitmapCacheV3Enabled = FALSE; if (settings->FrameMarkerCommandEnabled && !FrameMarkerCommandEnabled) settings->FrameMarkerCommandEnabled = FALSE; @@ -576,8 +554,7 @@ static BOOL rdp_write_order_capability_set(wStream* s, const rdpSettings* settin textANSICodePage = 65001; /* Unicode (UTF-8) */ orderSupportExFlags = 0; - orderFlags = NEGOTIATE_ORDER_SUPPORT | ZERO_BOUNDS_DELTA_SUPPORT | - COLOR_INDEX_SUPPORT; + orderFlags = NEGOTIATE_ORDER_SUPPORT | ZERO_BOUNDS_DELTA_SUPPORT | COLOR_INDEX_SUPPORT; if (settings->BitmapCacheV3Enabled) { @@ -591,23 +568,23 @@ static BOOL rdp_write_order_capability_set(wStream* s, const rdpSettings* settin orderFlags |= ORDER_FLAGS_EXTRA_SUPPORT; } - Stream_Zero(s, 16); /* terminalDescriptor (16 bytes) */ - Stream_Write_UINT32(s, 0); /* pad4OctetsA (4 bytes) */ - Stream_Write_UINT16(s, 1); /* desktopSaveXGranularity (2 bytes) */ - Stream_Write_UINT16(s, 20); /* desktopSaveYGranularity (2 bytes) */ - Stream_Write_UINT16(s, 0); /* pad2OctetsA (2 bytes) */ - Stream_Write_UINT16(s, 1); /* maximumOrderLevel (2 bytes) */ - Stream_Write_UINT16(s, 0); /* numberFonts (2 bytes) */ - Stream_Write_UINT16(s, orderFlags); /* orderFlags (2 bytes) */ + Stream_Zero(s, 16); /* terminalDescriptor (16 bytes) */ + Stream_Write_UINT32(s, 0); /* pad4OctetsA (4 bytes) */ + Stream_Write_UINT16(s, 1); /* desktopSaveXGranularity (2 bytes) */ + Stream_Write_UINT16(s, 20); /* desktopSaveYGranularity (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2OctetsA (2 bytes) */ + Stream_Write_UINT16(s, 1); /* maximumOrderLevel (2 bytes) */ + Stream_Write_UINT16(s, 0); /* numberFonts (2 bytes) */ + Stream_Write_UINT16(s, orderFlags); /* orderFlags (2 bytes) */ Stream_Write(s, settings->OrderSupport, 32); /* orderSupport (32 bytes) */ - Stream_Write_UINT16(s, 0); /* textFlags (2 bytes) */ + Stream_Write_UINT16(s, 0); /* textFlags (2 bytes) */ Stream_Write_UINT16(s, orderSupportExFlags); /* orderSupportExFlags (2 bytes) */ - Stream_Write_UINT32(s, 0); /* pad4OctetsB (4 bytes) */ - Stream_Write_UINT32(s, 230400); /* desktopSaveSize (4 bytes) */ - Stream_Write_UINT16(s, 0); /* pad2OctetsC (2 bytes) */ - Stream_Write_UINT16(s, 0); /* pad2OctetsD (2 bytes) */ - Stream_Write_UINT16(s, textANSICodePage); /* textANSICodePage (2 bytes) */ - Stream_Write_UINT16(s, 0); /* pad2OctetsE (2 bytes) */ + Stream_Write_UINT32(s, 0); /* pad4OctetsB (4 bytes) */ + Stream_Write_UINT32(s, 230400); /* desktopSaveSize (4 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2OctetsC (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2OctetsD (2 bytes) */ + Stream_Write_UINT16(s, textANSICodePage); /* textANSICodePage (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2OctetsE (2 bytes) */ rdp_capability_set_finish(s, header, CAPSET_TYPE_ORDER); return TRUE; } @@ -632,77 +609,79 @@ static BOOL rdp_print_order_capability_set(wStream* s, UINT16 length) UINT16 pad2OctetsD; UINT16 textANSICodePage; UINT16 pad2OctetsE; - WLog_INFO(TAG, "OrderCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "OrderCapabilitySet (length %" PRIu16 "):", length); if (length < 88) return FALSE; - Stream_Read(s, terminalDescriptor, 16); /* terminalDescriptor (16 bytes) */ - Stream_Read_UINT32(s, pad4OctetsA); /* pad4OctetsA (4 bytes) */ + Stream_Read(s, terminalDescriptor, 16); /* terminalDescriptor (16 bytes) */ + Stream_Read_UINT32(s, pad4OctetsA); /* pad4OctetsA (4 bytes) */ Stream_Read_UINT16(s, desktopSaveXGranularity); /* desktopSaveXGranularity (2 bytes) */ Stream_Read_UINT16(s, desktopSaveYGranularity); /* desktopSaveYGranularity (2 bytes) */ - Stream_Read_UINT16(s, pad2OctetsA); /* pad2OctetsA (2 bytes) */ - Stream_Read_UINT16(s, maximumOrderLevel); /* maximumOrderLevel (2 bytes) */ - Stream_Read_UINT16(s, numberFonts); /* numberFonts (2 bytes) */ - Stream_Read_UINT16(s, orderFlags); /* orderFlags (2 bytes) */ - Stream_Read(s, orderSupport, 32); /* orderSupport (32 bytes) */ - Stream_Read_UINT16(s, textFlags); /* textFlags (2 bytes) */ - Stream_Read_UINT16(s, orderSupportExFlags); /* orderSupportExFlags (2 bytes) */ - Stream_Read_UINT32(s, pad4OctetsB); /* pad4OctetsB (4 bytes) */ - Stream_Read_UINT32(s, desktopSaveSize); /* desktopSaveSize (4 bytes) */ - Stream_Read_UINT16(s, pad2OctetsC); /* pad2OctetsC (2 bytes) */ - Stream_Read_UINT16(s, pad2OctetsD); /* pad2OctetsD (2 bytes) */ - Stream_Read_UINT16(s, textANSICodePage); /* textANSICodePage (2 bytes) */ - Stream_Read_UINT16(s, pad2OctetsE); /* pad2OctetsE (2 bytes) */ - WLog_INFO(TAG, "\tpad4OctetsA: 0x%08"PRIX32"", pad4OctetsA); - WLog_INFO(TAG, "\tdesktopSaveXGranularity: 0x%04"PRIX16"", desktopSaveXGranularity); - WLog_INFO(TAG, "\tdesktopSaveYGranularity: 0x%04"PRIX16"", desktopSaveYGranularity); - WLog_INFO(TAG, "\tpad2OctetsA: 0x%04"PRIX16"", pad2OctetsA); - WLog_INFO(TAG, "\tmaximumOrderLevel: 0x%04"PRIX16"", maximumOrderLevel); - WLog_INFO(TAG, "\tnumberFonts: 0x%04"PRIX16"", numberFonts); - WLog_INFO(TAG, "\torderFlags: 0x%04"PRIX16"", orderFlags); - WLog_INFO(TAG, "\torderSupport:"); - WLog_INFO(TAG, "\t\tDSTBLT: %"PRIu8"", orderSupport[NEG_DSTBLT_INDEX]); - WLog_INFO(TAG, "\t\tPATBLT: %"PRIu8"", orderSupport[NEG_PATBLT_INDEX]); - WLog_INFO(TAG, "\t\tSCRBLT: %"PRIu8"", orderSupport[NEG_SCRBLT_INDEX]); - WLog_INFO(TAG, "\t\tMEMBLT: %"PRIu8"", orderSupport[NEG_MEMBLT_INDEX]); - WLog_INFO(TAG, "\t\tMEM3BLT: %"PRIu8"", orderSupport[NEG_MEM3BLT_INDEX]); - WLog_INFO(TAG, "\t\tATEXTOUT: %"PRIu8"", orderSupport[NEG_ATEXTOUT_INDEX]); - WLog_INFO(TAG, "\t\tAEXTTEXTOUT: %"PRIu8"", orderSupport[NEG_AEXTTEXTOUT_INDEX]); - WLog_INFO(TAG, "\t\tDRAWNINEGRID: %"PRIu8"", orderSupport[NEG_DRAWNINEGRID_INDEX]); - WLog_INFO(TAG, "\t\tLINETO: %"PRIu8"", orderSupport[NEG_LINETO_INDEX]); - WLog_INFO(TAG, "\t\tMULTI_DRAWNINEGRID: %"PRIu8"", orderSupport[NEG_MULTI_DRAWNINEGRID_INDEX]); - WLog_INFO(TAG, "\t\tOPAQUE_RECT: %"PRIu8"", orderSupport[NEG_OPAQUE_RECT_INDEX]); - WLog_INFO(TAG, "\t\tSAVEBITMAP: %"PRIu8"", orderSupport[NEG_SAVEBITMAP_INDEX]); - WLog_INFO(TAG, "\t\tWTEXTOUT: %"PRIu8"", orderSupport[NEG_WTEXTOUT_INDEX]); - WLog_INFO(TAG, "\t\tMEMBLT_V2: %"PRIu8"", orderSupport[NEG_MEMBLT_V2_INDEX]); - WLog_INFO(TAG, "\t\tMEM3BLT_V2: %"PRIu8"", orderSupport[NEG_MEM3BLT_V2_INDEX]); - WLog_INFO(TAG, "\t\tMULTIDSTBLT: %"PRIu8"", orderSupport[NEG_MULTIDSTBLT_INDEX]); - WLog_INFO(TAG, "\t\tMULTIPATBLT: %"PRIu8"", orderSupport[NEG_MULTIPATBLT_INDEX]); - WLog_INFO(TAG, "\t\tMULTISCRBLT: %"PRIu8"", orderSupport[NEG_MULTISCRBLT_INDEX]); - WLog_INFO(TAG, "\t\tMULTIOPAQUERECT: %"PRIu8"", orderSupport[NEG_MULTIOPAQUERECT_INDEX]); - WLog_INFO(TAG, "\t\tFAST_INDEX: %"PRIu8"", orderSupport[NEG_FAST_INDEX_INDEX]); - WLog_INFO(TAG, "\t\tPOLYGON_SC: %"PRIu8"", orderSupport[NEG_POLYGON_SC_INDEX]); - WLog_INFO(TAG, "\t\tPOLYGON_CB: %"PRIu8"", orderSupport[NEG_POLYGON_CB_INDEX]); - WLog_INFO(TAG, "\t\tPOLYLINE: %"PRIu8"", orderSupport[NEG_POLYLINE_INDEX]); - WLog_INFO(TAG, "\t\tUNUSED23: %"PRIu8"", orderSupport[NEG_UNUSED23_INDEX]); - WLog_INFO(TAG, "\t\tFAST_GLYPH: %"PRIu8"", orderSupport[NEG_FAST_GLYPH_INDEX]); - WLog_INFO(TAG, "\t\tELLIPSE_SC: %"PRIu8"", orderSupport[NEG_ELLIPSE_SC_INDEX]); - WLog_INFO(TAG, "\t\tELLIPSE_CB: %"PRIu8"", orderSupport[NEG_ELLIPSE_CB_INDEX]); - WLog_INFO(TAG, "\t\tGLYPH_INDEX: %"PRIu8"", orderSupport[NEG_GLYPH_INDEX_INDEX]); - WLog_INFO(TAG, "\t\tGLYPH_WEXTTEXTOUT: %"PRIu8"", orderSupport[NEG_GLYPH_WEXTTEXTOUT_INDEX]); - WLog_INFO(TAG, "\t\tGLYPH_WLONGTEXTOUT: %"PRIu8"", orderSupport[NEG_GLYPH_WLONGTEXTOUT_INDEX]); - WLog_INFO(TAG, "\t\tGLYPH_WLONGEXTTEXTOUT: %"PRIu8"", + Stream_Read_UINT16(s, pad2OctetsA); /* pad2OctetsA (2 bytes) */ + Stream_Read_UINT16(s, maximumOrderLevel); /* maximumOrderLevel (2 bytes) */ + Stream_Read_UINT16(s, numberFonts); /* numberFonts (2 bytes) */ + Stream_Read_UINT16(s, orderFlags); /* orderFlags (2 bytes) */ + Stream_Read(s, orderSupport, 32); /* orderSupport (32 bytes) */ + Stream_Read_UINT16(s, textFlags); /* textFlags (2 bytes) */ + Stream_Read_UINT16(s, orderSupportExFlags); /* orderSupportExFlags (2 bytes) */ + Stream_Read_UINT32(s, pad4OctetsB); /* pad4OctetsB (4 bytes) */ + Stream_Read_UINT32(s, desktopSaveSize); /* desktopSaveSize (4 bytes) */ + Stream_Read_UINT16(s, pad2OctetsC); /* pad2OctetsC (2 bytes) */ + Stream_Read_UINT16(s, pad2OctetsD); /* pad2OctetsD (2 bytes) */ + Stream_Read_UINT16(s, textANSICodePage); /* textANSICodePage (2 bytes) */ + Stream_Read_UINT16(s, pad2OctetsE); /* pad2OctetsE (2 bytes) */ + WLog_INFO(TAG, "\tpad4OctetsA: 0x%08" PRIX32 "", pad4OctetsA); + WLog_INFO(TAG, "\tdesktopSaveXGranularity: 0x%04" PRIX16 "", desktopSaveXGranularity); + WLog_INFO(TAG, "\tdesktopSaveYGranularity: 0x%04" PRIX16 "", desktopSaveYGranularity); + WLog_INFO(TAG, "\tpad2OctetsA: 0x%04" PRIX16 "", pad2OctetsA); + WLog_INFO(TAG, "\tmaximumOrderLevel: 0x%04" PRIX16 "", maximumOrderLevel); + WLog_INFO(TAG, "\tnumberFonts: 0x%04" PRIX16 "", numberFonts); + WLog_INFO(TAG, "\torderFlags: 0x%04" PRIX16 "", orderFlags); + WLog_INFO(TAG, "\torderSupport:"); + WLog_INFO(TAG, "\t\tDSTBLT: %" PRIu8 "", orderSupport[NEG_DSTBLT_INDEX]); + WLog_INFO(TAG, "\t\tPATBLT: %" PRIu8 "", orderSupport[NEG_PATBLT_INDEX]); + WLog_INFO(TAG, "\t\tSCRBLT: %" PRIu8 "", orderSupport[NEG_SCRBLT_INDEX]); + WLog_INFO(TAG, "\t\tMEMBLT: %" PRIu8 "", orderSupport[NEG_MEMBLT_INDEX]); + WLog_INFO(TAG, "\t\tMEM3BLT: %" PRIu8 "", orderSupport[NEG_MEM3BLT_INDEX]); + WLog_INFO(TAG, "\t\tATEXTOUT: %" PRIu8 "", orderSupport[NEG_ATEXTOUT_INDEX]); + WLog_INFO(TAG, "\t\tAEXTTEXTOUT: %" PRIu8 "", orderSupport[NEG_AEXTTEXTOUT_INDEX]); + WLog_INFO(TAG, "\t\tDRAWNINEGRID: %" PRIu8 "", orderSupport[NEG_DRAWNINEGRID_INDEX]); + WLog_INFO(TAG, "\t\tLINETO: %" PRIu8 "", orderSupport[NEG_LINETO_INDEX]); + WLog_INFO(TAG, "\t\tMULTI_DRAWNINEGRID: %" PRIu8 "", + orderSupport[NEG_MULTI_DRAWNINEGRID_INDEX]); + WLog_INFO(TAG, "\t\tOPAQUE_RECT: %" PRIu8 "", orderSupport[NEG_OPAQUE_RECT_INDEX]); + WLog_INFO(TAG, "\t\tSAVEBITMAP: %" PRIu8 "", orderSupport[NEG_SAVEBITMAP_INDEX]); + WLog_INFO(TAG, "\t\tWTEXTOUT: %" PRIu8 "", orderSupport[NEG_WTEXTOUT_INDEX]); + WLog_INFO(TAG, "\t\tMEMBLT_V2: %" PRIu8 "", orderSupport[NEG_MEMBLT_V2_INDEX]); + WLog_INFO(TAG, "\t\tMEM3BLT_V2: %" PRIu8 "", orderSupport[NEG_MEM3BLT_V2_INDEX]); + WLog_INFO(TAG, "\t\tMULTIDSTBLT: %" PRIu8 "", orderSupport[NEG_MULTIDSTBLT_INDEX]); + WLog_INFO(TAG, "\t\tMULTIPATBLT: %" PRIu8 "", orderSupport[NEG_MULTIPATBLT_INDEX]); + WLog_INFO(TAG, "\t\tMULTISCRBLT: %" PRIu8 "", orderSupport[NEG_MULTISCRBLT_INDEX]); + WLog_INFO(TAG, "\t\tMULTIOPAQUERECT: %" PRIu8 "", orderSupport[NEG_MULTIOPAQUERECT_INDEX]); + WLog_INFO(TAG, "\t\tFAST_INDEX: %" PRIu8 "", orderSupport[NEG_FAST_INDEX_INDEX]); + WLog_INFO(TAG, "\t\tPOLYGON_SC: %" PRIu8 "", orderSupport[NEG_POLYGON_SC_INDEX]); + WLog_INFO(TAG, "\t\tPOLYGON_CB: %" PRIu8 "", orderSupport[NEG_POLYGON_CB_INDEX]); + WLog_INFO(TAG, "\t\tPOLYLINE: %" PRIu8 "", orderSupport[NEG_POLYLINE_INDEX]); + WLog_INFO(TAG, "\t\tUNUSED23: %" PRIu8 "", orderSupport[NEG_UNUSED23_INDEX]); + WLog_INFO(TAG, "\t\tFAST_GLYPH: %" PRIu8 "", orderSupport[NEG_FAST_GLYPH_INDEX]); + WLog_INFO(TAG, "\t\tELLIPSE_SC: %" PRIu8 "", orderSupport[NEG_ELLIPSE_SC_INDEX]); + WLog_INFO(TAG, "\t\tELLIPSE_CB: %" PRIu8 "", orderSupport[NEG_ELLIPSE_CB_INDEX]); + WLog_INFO(TAG, "\t\tGLYPH_INDEX: %" PRIu8 "", orderSupport[NEG_GLYPH_INDEX_INDEX]); + WLog_INFO(TAG, "\t\tGLYPH_WEXTTEXTOUT: %" PRIu8 "", orderSupport[NEG_GLYPH_WEXTTEXTOUT_INDEX]); + WLog_INFO(TAG, "\t\tGLYPH_WLONGTEXTOUT: %" PRIu8 "", + orderSupport[NEG_GLYPH_WLONGTEXTOUT_INDEX]); + WLog_INFO(TAG, "\t\tGLYPH_WLONGEXTTEXTOUT: %" PRIu8 "", orderSupport[NEG_GLYPH_WLONGEXTTEXTOUT_INDEX]); - WLog_INFO(TAG, "\t\tUNUSED31: %"PRIu8"", orderSupport[NEG_UNUSED31_INDEX]); - WLog_INFO(TAG, "\ttextFlags: 0x%04"PRIX16"", textFlags); - WLog_INFO(TAG, "\torderSupportExFlags: 0x%04"PRIX16"", orderSupportExFlags); - WLog_INFO(TAG, "\tpad4OctetsB: 0x%08"PRIX32"", pad4OctetsB); - WLog_INFO(TAG, "\tdesktopSaveSize: 0x%08"PRIX32"", desktopSaveSize); - WLog_INFO(TAG, "\tpad2OctetsC: 0x%04"PRIX16"", pad2OctetsC); - WLog_INFO(TAG, "\tpad2OctetsD: 0x%04"PRIX16"", pad2OctetsD); - WLog_INFO(TAG, "\ttextANSICodePage: 0x%04"PRIX16"", textANSICodePage); - WLog_INFO(TAG, "\tpad2OctetsE: 0x%04"PRIX16"", pad2OctetsE); + WLog_INFO(TAG, "\t\tUNUSED31: %" PRIu8 "", orderSupport[NEG_UNUSED31_INDEX]); + WLog_INFO(TAG, "\ttextFlags: 0x%04" PRIX16 "", textFlags); + WLog_INFO(TAG, "\torderSupportExFlags: 0x%04" PRIX16 "", orderSupportExFlags); + WLog_INFO(TAG, "\tpad4OctetsB: 0x%08" PRIX32 "", pad4OctetsB); + WLog_INFO(TAG, "\tdesktopSaveSize: 0x%08" PRIX32 "", desktopSaveSize); + WLog_INFO(TAG, "\tpad2OctetsC: 0x%04" PRIX16 "", pad2OctetsC); + WLog_INFO(TAG, "\tpad2OctetsD: 0x%04" PRIX16 "", pad2OctetsD); + WLog_INFO(TAG, "\ttextANSICodePage: 0x%04" PRIX16 "", textANSICodePage); + WLog_INFO(TAG, "\tpad2OctetsE: 0x%04" PRIX16 "", pad2OctetsE); return TRUE; } #endif @@ -715,8 +694,7 @@ static BOOL rdp_print_order_capability_set(wStream* s, UINT16 length) * @return if the operation completed successfully */ -static BOOL rdp_read_bitmap_cache_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) +static BOOL rdp_read_bitmap_cache_capability_set(wStream* s, UINT16 length, rdpSettings* settings) { if (length < 40) return FALSE; @@ -743,8 +721,7 @@ static BOOL rdp_read_bitmap_cache_capability_set(wStream* s, UINT16 length, * @param settings settings */ -static BOOL rdp_write_bitmap_cache_capability_set(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_bitmap_cache_capability_set(wStream* s, const rdpSettings* settings) { UINT16 bpp; size_t header; @@ -762,10 +739,10 @@ static BOOL rdp_write_bitmap_cache_capability_set(wStream* s, Stream_Write_UINT32(s, 0); /* pad5 (4 bytes) */ Stream_Write_UINT32(s, 0); /* pad6 (4 bytes) */ size = bpp * 256; - Stream_Write_UINT16(s, 200); /* Cache0Entries (2 bytes) */ + Stream_Write_UINT16(s, 200); /* Cache0Entries (2 bytes) */ Stream_Write_UINT16(s, size); /* Cache0MaximumCellSize (2 bytes) */ size = bpp * 1024; - Stream_Write_UINT16(s, 600); /* Cache1Entries (2 bytes) */ + Stream_Write_UINT16(s, 600); /* Cache1Entries (2 bytes) */ Stream_Write_UINT16(s, size); /* Cache1MaximumCellSize (2 bytes) */ size = bpp * 4096; Stream_Write_UINT16(s, 1000); /* Cache2Entries (2 bytes) */ @@ -785,35 +762,35 @@ static BOOL rdp_print_bitmap_cache_capability_set(wStream* s, UINT16 length) UINT16 Cache1MaximumCellSize; UINT16 Cache2Entries; UINT16 Cache2MaximumCellSize; - WLog_INFO(TAG, "BitmapCacheCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "BitmapCacheCapabilitySet (length %" PRIu16 "):", length); if (length < 40) return FALSE; - Stream_Read_UINT32(s, pad1); /* pad1 (4 bytes) */ - Stream_Read_UINT32(s, pad2); /* pad2 (4 bytes) */ - Stream_Read_UINT32(s, pad3); /* pad3 (4 bytes) */ - Stream_Read_UINT32(s, pad4); /* pad4 (4 bytes) */ - Stream_Read_UINT32(s, pad5); /* pad5 (4 bytes) */ - Stream_Read_UINT32(s, pad6); /* pad6 (4 bytes) */ - Stream_Read_UINT16(s, Cache0Entries); /* Cache0Entries (2 bytes) */ + Stream_Read_UINT32(s, pad1); /* pad1 (4 bytes) */ + Stream_Read_UINT32(s, pad2); /* pad2 (4 bytes) */ + Stream_Read_UINT32(s, pad3); /* pad3 (4 bytes) */ + Stream_Read_UINT32(s, pad4); /* pad4 (4 bytes) */ + Stream_Read_UINT32(s, pad5); /* pad5 (4 bytes) */ + Stream_Read_UINT32(s, pad6); /* pad6 (4 bytes) */ + Stream_Read_UINT16(s, Cache0Entries); /* Cache0Entries (2 bytes) */ Stream_Read_UINT16(s, Cache0MaximumCellSize); /* Cache0MaximumCellSize (2 bytes) */ - Stream_Read_UINT16(s, Cache1Entries); /* Cache1Entries (2 bytes) */ + Stream_Read_UINT16(s, Cache1Entries); /* Cache1Entries (2 bytes) */ Stream_Read_UINT16(s, Cache1MaximumCellSize); /* Cache1MaximumCellSize (2 bytes) */ - Stream_Read_UINT16(s, Cache2Entries); /* Cache2Entries (2 bytes) */ + Stream_Read_UINT16(s, Cache2Entries); /* Cache2Entries (2 bytes) */ Stream_Read_UINT16(s, Cache2MaximumCellSize); /* Cache2MaximumCellSize (2 bytes) */ - WLog_INFO(TAG, "\tpad1: 0x%08"PRIX32"", pad1); - WLog_INFO(TAG, "\tpad2: 0x%08"PRIX32"", pad2); - WLog_INFO(TAG, "\tpad3: 0x%08"PRIX32"", pad3); - WLog_INFO(TAG, "\tpad4: 0x%08"PRIX32"", pad4); - WLog_INFO(TAG, "\tpad5: 0x%08"PRIX32"", pad5); - WLog_INFO(TAG, "\tpad6: 0x%08"PRIX32"", pad6); - WLog_INFO(TAG, "\tCache0Entries: 0x%04"PRIX16"", Cache0Entries); - WLog_INFO(TAG, "\tCache0MaximumCellSize: 0x%04"PRIX16"", Cache0MaximumCellSize); - WLog_INFO(TAG, "\tCache1Entries: 0x%04"PRIX16"", Cache1Entries); - WLog_INFO(TAG, "\tCache1MaximumCellSize: 0x%04"PRIX16"", Cache1MaximumCellSize); - WLog_INFO(TAG, "\tCache2Entries: 0x%04"PRIX16"", Cache2Entries); - WLog_INFO(TAG, "\tCache2MaximumCellSize: 0x%04"PRIX16"", Cache2MaximumCellSize); + WLog_INFO(TAG, "\tpad1: 0x%08" PRIX32 "", pad1); + WLog_INFO(TAG, "\tpad2: 0x%08" PRIX32 "", pad2); + WLog_INFO(TAG, "\tpad3: 0x%08" PRIX32 "", pad3); + WLog_INFO(TAG, "\tpad4: 0x%08" PRIX32 "", pad4); + WLog_INFO(TAG, "\tpad5: 0x%08" PRIX32 "", pad5); + WLog_INFO(TAG, "\tpad6: 0x%08" PRIX32 "", pad6); + WLog_INFO(TAG, "\tCache0Entries: 0x%04" PRIX16 "", Cache0Entries); + WLog_INFO(TAG, "\tCache0MaximumCellSize: 0x%04" PRIX16 "", Cache0MaximumCellSize); + WLog_INFO(TAG, "\tCache1Entries: 0x%04" PRIX16 "", Cache1Entries); + WLog_INFO(TAG, "\tCache1MaximumCellSize: 0x%04" PRIX16 "", Cache1MaximumCellSize); + WLog_INFO(TAG, "\tCache2Entries: 0x%04" PRIX16 "", Cache2Entries); + WLog_INFO(TAG, "\tCache2MaximumCellSize: 0x%04" PRIX16 "", Cache2MaximumCellSize); return TRUE; } #endif @@ -826,8 +803,7 @@ static BOOL rdp_print_bitmap_cache_capability_set(wStream* s, UINT16 length) * @return if the operation completed successfully */ -static BOOL rdp_read_control_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) +static BOOL rdp_read_control_capability_set(wStream* s, UINT16 length, rdpSettings* settings) { if (length < 12) return FALSE; @@ -869,19 +845,19 @@ static BOOL rdp_print_control_capability_set(wStream* s, UINT16 length) UINT16 remoteDetachFlag; UINT16 controlInterest; UINT16 detachInterest; - WLog_INFO(TAG, "ControlCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "ControlCapabilitySet (length %" PRIu16 "):", length); if (length < 12) return FALSE; - Stream_Read_UINT16(s, controlFlags); /* controlFlags (2 bytes) */ + Stream_Read_UINT16(s, controlFlags); /* controlFlags (2 bytes) */ Stream_Read_UINT16(s, remoteDetachFlag); /* remoteDetachFlag (2 bytes) */ - Stream_Read_UINT16(s, controlInterest); /* controlInterest (2 bytes) */ - Stream_Read_UINT16(s, detachInterest); /* detachInterest (2 bytes) */ - WLog_INFO(TAG, "\tcontrolFlags: 0x%04"PRIX16"", controlFlags); - WLog_INFO(TAG, "\tremoteDetachFlag: 0x%04"PRIX16"", remoteDetachFlag); - WLog_INFO(TAG, "\tcontrolInterest: 0x%04"PRIX16"", controlInterest); - WLog_INFO(TAG, "\tdetachInterest: 0x%04"PRIX16"", detachInterest); + Stream_Read_UINT16(s, controlInterest); /* controlInterest (2 bytes) */ + Stream_Read_UINT16(s, detachInterest); /* detachInterest (2 bytes) */ + WLog_INFO(TAG, "\tcontrolFlags: 0x%04" PRIX16 "", controlFlags); + WLog_INFO(TAG, "\tremoteDetachFlag: 0x%04" PRIX16 "", remoteDetachFlag); + WLog_INFO(TAG, "\tcontrolInterest: 0x%04" PRIX16 "", controlInterest); + WLog_INFO(TAG, "\tdetachInterest: 0x%04" PRIX16 "", detachInterest); return TRUE; } #endif @@ -895,7 +871,7 @@ static BOOL rdp_print_control_capability_set(wStream* s, UINT16 length) */ static BOOL rdp_read_window_activation_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) + rdpSettings* settings) { if (length < 12) return FALSE; @@ -914,8 +890,7 @@ static BOOL rdp_read_window_activation_capability_set(wStream* s, UINT16 length, * @param settings settings */ -static BOOL rdp_write_window_activation_capability_set(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_window_activation_capability_set(wStream* s, const rdpSettings* settings) { size_t header; @@ -932,26 +907,25 @@ static BOOL rdp_write_window_activation_capability_set(wStream* s, } #ifdef WITH_DEBUG_CAPABILITIES -static BOOL rdp_print_window_activation_capability_set(wStream* s, - UINT16 length) +static BOOL rdp_print_window_activation_capability_set(wStream* s, UINT16 length) { UINT16 helpKeyFlag; UINT16 helpKeyIndexFlag; UINT16 helpExtendedKeyFlag; UINT16 windowManagerKeyFlag; - WLog_INFO(TAG, "WindowActivationCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "WindowActivationCapabilitySet (length %" PRIu16 "):", length); if (length < 12) return FALSE; - Stream_Read_UINT16(s, helpKeyFlag); /* helpKeyFlag (2 bytes) */ - Stream_Read_UINT16(s, helpKeyIndexFlag); /* helpKeyIndexFlag (2 bytes) */ - Stream_Read_UINT16(s, helpExtendedKeyFlag); /* helpExtendedKeyFlag (2 bytes) */ + Stream_Read_UINT16(s, helpKeyFlag); /* helpKeyFlag (2 bytes) */ + Stream_Read_UINT16(s, helpKeyIndexFlag); /* helpKeyIndexFlag (2 bytes) */ + Stream_Read_UINT16(s, helpExtendedKeyFlag); /* helpExtendedKeyFlag (2 bytes) */ Stream_Read_UINT16(s, windowManagerKeyFlag); /* windowManagerKeyFlag (2 bytes) */ - WLog_INFO(TAG, "\thelpKeyFlag: 0x%04"PRIX16"", helpKeyFlag); - WLog_INFO(TAG, "\thelpKeyIndexFlag: 0x%04"PRIX16"", helpKeyIndexFlag); - WLog_INFO(TAG, "\thelpExtendedKeyFlag: 0x%04"PRIX16"", helpExtendedKeyFlag); - WLog_INFO(TAG, "\twindowManagerKeyFlag: 0x%04"PRIX16"", windowManagerKeyFlag); + WLog_INFO(TAG, "\thelpKeyFlag: 0x%04" PRIX16 "", helpKeyFlag); + WLog_INFO(TAG, "\thelpKeyIndexFlag: 0x%04" PRIX16 "", helpKeyIndexFlag); + WLog_INFO(TAG, "\thelpExtendedKeyFlag: 0x%04" PRIX16 "", helpExtendedKeyFlag); + WLog_INFO(TAG, "\twindowManagerKeyFlag: 0x%04" PRIX16 "", windowManagerKeyFlag); return TRUE; } #endif @@ -964,8 +938,7 @@ static BOOL rdp_print_window_activation_capability_set(wStream* s, * @return if the operation completed successfully */ -static BOOL rdp_read_pointer_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) +static BOOL rdp_read_pointer_capability_set(wStream* s, UINT16 length, rdpSettings* settings) { UINT16 colorPointerFlag; UINT16 colorPointerCacheSize; @@ -974,9 +947,8 @@ static BOOL rdp_read_pointer_capability_set(wStream* s, UINT16 length, if (length < 8) return FALSE; - Stream_Read_UINT16(s, colorPointerFlag); /* colorPointerFlag (2 bytes) */ - Stream_Read_UINT16(s, - colorPointerCacheSize); /* colorPointerCacheSize (2 bytes) */ + Stream_Read_UINT16(s, colorPointerFlag); /* colorPointerFlag (2 bytes) */ + Stream_Read_UINT16(s, colorPointerCacheSize); /* colorPointerCacheSize (2 bytes) */ /* pointerCacheSize is optional */ if (length >= 10) @@ -1012,7 +984,7 @@ static BOOL rdp_write_pointer_capability_set(wStream* s, const rdpSettings* sett header = rdp_capability_set_start(s); colorPointerFlag = (settings->ColorPointerFlag) ? 1 : 0; - Stream_Write_UINT16(s, colorPointerFlag); /* colorPointerFlag (2 bytes) */ + Stream_Write_UINT16(s, colorPointerFlag); /* colorPointerFlag (2 bytes) */ Stream_Write_UINT16(s, settings->PointerCacheSize); /* colorPointerCacheSize (2 bytes) */ if (settings->LargePointerFlag) @@ -1034,13 +1006,13 @@ static BOOL rdp_print_pointer_capability_set(wStream* s, UINT16 length) if (length < 10) return FALSE; - WLog_INFO(TAG, "PointerCapabilitySet (length %"PRIu16"):", length); - Stream_Read_UINT16(s, colorPointerFlag); /* colorPointerFlag (2 bytes) */ + WLog_INFO(TAG, "PointerCapabilitySet (length %" PRIu16 "):", length); + Stream_Read_UINT16(s, colorPointerFlag); /* colorPointerFlag (2 bytes) */ Stream_Read_UINT16(s, colorPointerCacheSize); /* colorPointerCacheSize (2 bytes) */ - Stream_Read_UINT16(s, pointerCacheSize); /* pointerCacheSize (2 bytes) */ - WLog_INFO(TAG, "\tcolorPointerFlag: 0x%04"PRIX16"", colorPointerFlag); - WLog_INFO(TAG, "\tcolorPointerCacheSize: 0x%04"PRIX16"", colorPointerCacheSize); - WLog_INFO(TAG, "\tpointerCacheSize: 0x%04"PRIX16"", pointerCacheSize); + Stream_Read_UINT16(s, pointerCacheSize); /* pointerCacheSize (2 bytes) */ + WLog_INFO(TAG, "\tcolorPointerFlag: 0x%04" PRIX16 "", colorPointerFlag); + WLog_INFO(TAG, "\tcolorPointerCacheSize: 0x%04" PRIX16 "", colorPointerCacheSize); + WLog_INFO(TAG, "\tpointerCacheSize: 0x%04" PRIX16 "", pointerCacheSize); return TRUE; } #endif @@ -1053,8 +1025,7 @@ static BOOL rdp_print_pointer_capability_set(wStream* s, UINT16 length) * @return if the operation completed successfully */ -static BOOL rdp_read_share_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) +static BOOL rdp_read_share_capability_set(wStream* s, UINT16 length, rdpSettings* settings) { if (length < 8) return FALSE; @@ -1082,7 +1053,7 @@ static BOOL rdp_write_share_capability_set(wStream* s, const rdpSettings* settin header = rdp_capability_set_start(s); nodeId = (settings->ServerMode) ? 0x03EA : 0; Stream_Write_UINT16(s, nodeId); /* nodeId (2 bytes) */ - Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ rdp_capability_set_finish(s, header, CAPSET_TYPE_SHARE); return TRUE; } @@ -1092,15 +1063,15 @@ static BOOL rdp_print_share_capability_set(wStream* s, UINT16 length) { UINT16 nodeId; UINT16 pad2Octets; - WLog_INFO(TAG, "ShareCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "ShareCapabilitySet (length %" PRIu16 "):", length); if (length < 8) return FALSE; - Stream_Read_UINT16(s, nodeId); /* nodeId (2 bytes) */ + Stream_Read_UINT16(s, nodeId); /* nodeId (2 bytes) */ Stream_Read_UINT16(s, pad2Octets); /* pad2Octets (2 bytes) */ - WLog_INFO(TAG, "\tnodeId: 0x%04"PRIX16"", nodeId); - WLog_INFO(TAG, "\tpad2Octets: 0x%04"PRIX16"", pad2Octets); + WLog_INFO(TAG, "\tnodeId: 0x%04" PRIX16 "", nodeId); + WLog_INFO(TAG, "\tpad2Octets: 0x%04" PRIX16 "", pad2Octets); return TRUE; } #endif @@ -1113,8 +1084,7 @@ static BOOL rdp_print_share_capability_set(wStream* s, UINT16 length) * @return if the operation completed successfully */ -static BOOL rdp_read_color_cache_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) +static BOOL rdp_read_color_cache_capability_set(wStream* s, UINT16 length, rdpSettings* settings) { if (length < 8) return FALSE; @@ -1131,8 +1101,7 @@ static BOOL rdp_read_color_cache_capability_set(wStream* s, UINT16 length, * @param settings settings */ -static BOOL rdp_write_color_cache_capability_set(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_color_cache_capability_set(wStream* s, const rdpSettings* settings) { size_t header; @@ -1151,15 +1120,15 @@ static BOOL rdp_print_color_cache_capability_set(wStream* s, UINT16 length) { UINT16 colorTableCacheSize; UINT16 pad2Octets; - WLog_INFO(TAG, "ColorCacheCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "ColorCacheCapabilitySet (length %" PRIu16 "):", length); if (length < 8) return FALSE; Stream_Read_UINT16(s, colorTableCacheSize); /* colorTableCacheSize (2 bytes) */ - Stream_Read_UINT16(s, pad2Octets); /* pad2Octets (2 bytes) */ - WLog_INFO(TAG, "\tcolorTableCacheSize: 0x%04"PRIX16"", colorTableCacheSize); - WLog_INFO(TAG, "\tpad2Octets: 0x%04"PRIX16"", pad2Octets); + Stream_Read_UINT16(s, pad2Octets); /* pad2Octets (2 bytes) */ + WLog_INFO(TAG, "\tcolorTableCacheSize: 0x%04" PRIX16 "", colorTableCacheSize); + WLog_INFO(TAG, "\tpad2Octets: 0x%04" PRIX16 "", pad2Octets); return TRUE; } #endif @@ -1172,8 +1141,7 @@ static BOOL rdp_print_color_cache_capability_set(wStream* s, UINT16 length) * @return if the operation completed successfully */ -static BOOL rdp_read_sound_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) +static BOOL rdp_read_sound_capability_set(wStream* s, UINT16 length, rdpSettings* settings) { UINT16 soundFlags; @@ -1181,7 +1149,7 @@ static BOOL rdp_read_sound_capability_set(wStream* s, UINT16 length, return FALSE; Stream_Read_UINT16(s, soundFlags); /* soundFlags (2 bytes) */ - Stream_Seek_UINT16(s); /* pad2OctetsA (2 bytes) */ + Stream_Seek_UINT16(s); /* pad2OctetsA (2 bytes) */ settings->SoundBeepsEnabled = (soundFlags & SOUND_BEEPS_FLAG) ? TRUE : FALSE; return TRUE; } @@ -1204,7 +1172,7 @@ static BOOL rdp_write_sound_capability_set(wStream* s, const rdpSettings* settin header = rdp_capability_set_start(s); soundFlags = (settings->SoundBeepsEnabled) ? SOUND_BEEPS_FLAG : 0; Stream_Write_UINT16(s, soundFlags); /* soundFlags (2 bytes) */ - Stream_Write_UINT16(s, 0); /* pad2OctetsA (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2OctetsA (2 bytes) */ rdp_capability_set_finish(s, header, CAPSET_TYPE_SOUND); return TRUE; } @@ -1214,15 +1182,15 @@ static BOOL rdp_print_sound_capability_set(wStream* s, UINT16 length) { UINT16 soundFlags; UINT16 pad2OctetsA; - WLog_INFO(TAG, "SoundCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "SoundCapabilitySet (length %" PRIu16 "):", length); if (length < 8) return FALSE; - Stream_Read_UINT16(s, soundFlags); /* soundFlags (2 bytes) */ + Stream_Read_UINT16(s, soundFlags); /* soundFlags (2 bytes) */ Stream_Read_UINT16(s, pad2OctetsA); /* pad2OctetsA (2 bytes) */ - WLog_INFO(TAG, "\tsoundFlags: 0x%04"PRIX16"", soundFlags); - WLog_INFO(TAG, "\tpad2OctetsA: 0x%04"PRIX16"", pad2OctetsA); + WLog_INFO(TAG, "\tsoundFlags: 0x%04" PRIX16 "", soundFlags); + WLog_INFO(TAG, "\tpad2OctetsA: 0x%04" PRIX16 "", pad2OctetsA); return TRUE; } #endif @@ -1235,8 +1203,7 @@ static BOOL rdp_print_sound_capability_set(wStream* s, UINT16 length) * @return if the operation completed successfully */ -static BOOL rdp_read_input_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) +static BOOL rdp_read_input_capability_set(wStream* s, UINT16 length, rdpSettings* settings) { UINT16 inputFlags; @@ -1244,13 +1211,13 @@ static BOOL rdp_read_input_capability_set(wStream* s, UINT16 length, return FALSE; Stream_Read_UINT16(s, inputFlags); /* inputFlags (2 bytes) */ - Stream_Seek_UINT16(s); /* pad2OctetsA (2 bytes) */ + Stream_Seek_UINT16(s); /* pad2OctetsA (2 bytes) */ if (settings->ServerMode) { - Stream_Read_UINT32(s, settings->KeyboardLayout); /* keyboardLayout (4 bytes) */ - Stream_Read_UINT32(s, settings->KeyboardType); /* keyboardType (4 bytes) */ - Stream_Read_UINT32(s, settings->KeyboardSubType); /* keyboardSubType (4 bytes) */ + Stream_Read_UINT32(s, settings->KeyboardLayout); /* keyboardLayout (4 bytes) */ + Stream_Read_UINT32(s, settings->KeyboardType); /* keyboardType (4 bytes) */ + Stream_Read_UINT32(s, settings->KeyboardSubType); /* keyboardSubType (4 bytes) */ Stream_Read_UINT32(s, settings->KeyboardFunctionKey); /* keyboardFunctionKeys (4 bytes) */ } else @@ -1325,13 +1292,13 @@ static BOOL rdp_write_input_capability_set(wStream* s, const rdpSettings* settin if (settings->HasExtendedMouseEvent) inputFlags |= INPUT_FLAG_MOUSEX; - Stream_Write_UINT16(s, inputFlags); /* inputFlags (2 bytes) */ - Stream_Write_UINT16(s, 0); /* pad2OctetsA (2 bytes) */ - Stream_Write_UINT32(s, settings->KeyboardLayout); /* keyboardLayout (4 bytes) */ - Stream_Write_UINT32(s, settings->KeyboardType); /* keyboardType (4 bytes) */ - Stream_Write_UINT32(s, settings->KeyboardSubType); /* keyboardSubType (4 bytes) */ + Stream_Write_UINT16(s, inputFlags); /* inputFlags (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2OctetsA (2 bytes) */ + Stream_Write_UINT32(s, settings->KeyboardLayout); /* keyboardLayout (4 bytes) */ + Stream_Write_UINT32(s, settings->KeyboardType); /* keyboardType (4 bytes) */ + Stream_Write_UINT32(s, settings->KeyboardSubType); /* keyboardSubType (4 bytes) */ Stream_Write_UINT32(s, settings->KeyboardFunctionKey); /* keyboardFunctionKeys (4 bytes) */ - Stream_Zero(s, 64); /* imeFileName (64 bytes) */ + Stream_Zero(s, 64); /* imeFileName (64 bytes) */ rdp_capability_set_finish(s, header, CAPSET_TYPE_INPUT); return TRUE; } @@ -1345,24 +1312,24 @@ static BOOL rdp_print_input_capability_set(wStream* s, UINT16 length) UINT32 keyboardType; UINT32 keyboardSubType; UINT32 keyboardFunctionKey; - WLog_INFO(TAG, "InputCapabilitySet (length %"PRIu16")", length); + WLog_INFO(TAG, "InputCapabilitySet (length %" PRIu16 ")", length); if (length < 88) return FALSE; - Stream_Read_UINT16(s, inputFlags); /* inputFlags (2 bytes) */ - Stream_Read_UINT16(s, pad2OctetsA); /* pad2OctetsA (2 bytes) */ - Stream_Read_UINT32(s, keyboardLayout); /* keyboardLayout (4 bytes) */ - Stream_Read_UINT32(s, keyboardType); /* keyboardType (4 bytes) */ - Stream_Read_UINT32(s, keyboardSubType); /* keyboardSubType (4 bytes) */ + Stream_Read_UINT16(s, inputFlags); /* inputFlags (2 bytes) */ + Stream_Read_UINT16(s, pad2OctetsA); /* pad2OctetsA (2 bytes) */ + Stream_Read_UINT32(s, keyboardLayout); /* keyboardLayout (4 bytes) */ + Stream_Read_UINT32(s, keyboardType); /* keyboardType (4 bytes) */ + Stream_Read_UINT32(s, keyboardSubType); /* keyboardSubType (4 bytes) */ Stream_Read_UINT32(s, keyboardFunctionKey); /* keyboardFunctionKeys (4 bytes) */ - Stream_Seek(s, 64); /* imeFileName (64 bytes) */ - WLog_INFO(TAG, "\tinputFlags: 0x%04"PRIX16"", inputFlags); - WLog_INFO(TAG, "\tpad2OctetsA: 0x%04"PRIX16"", pad2OctetsA); - WLog_INFO(TAG, "\tkeyboardLayout: 0x%08"PRIX32"", keyboardLayout); - WLog_INFO(TAG, "\tkeyboardType: 0x%08"PRIX32"", keyboardType); - WLog_INFO(TAG, "\tkeyboardSubType: 0x%08"PRIX32"", keyboardSubType); - WLog_INFO(TAG, "\tkeyboardFunctionKey: 0x%08"PRIX32"", keyboardFunctionKey); + Stream_Seek(s, 64); /* imeFileName (64 bytes) */ + WLog_INFO(TAG, "\tinputFlags: 0x%04" PRIX16 "", inputFlags); + WLog_INFO(TAG, "\tpad2OctetsA: 0x%04" PRIX16 "", pad2OctetsA); + WLog_INFO(TAG, "\tkeyboardLayout: 0x%08" PRIX32 "", keyboardLayout); + WLog_INFO(TAG, "\tkeyboardType: 0x%08" PRIX32 "", keyboardType); + WLog_INFO(TAG, "\tkeyboardSubType: 0x%08" PRIX32 "", keyboardSubType); + WLog_INFO(TAG, "\tkeyboardFunctionKey: 0x%08" PRIX32 "", keyboardFunctionKey); return TRUE; } #endif @@ -1375,8 +1342,7 @@ static BOOL rdp_print_input_capability_set(wStream* s, UINT16 length) * @return if the operation completed successfully */ -static BOOL rdp_read_font_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) +static BOOL rdp_read_font_capability_set(wStream* s, UINT16 length, rdpSettings* settings) { if (length > 4) Stream_Seek_UINT16(s); /* fontSupportFlags (2 bytes) */ @@ -1403,7 +1369,7 @@ static BOOL rdp_write_font_capability_set(wStream* s, const rdpSettings* setting header = rdp_capability_set_start(s); Stream_Write_UINT16(s, FONTSUPPORT_FONTLIST); /* fontSupportFlags (2 bytes) */ - Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ rdp_capability_set_finish(s, header, CAPSET_TYPE_FONT); return TRUE; } @@ -1413,7 +1379,7 @@ static BOOL rdp_print_font_capability_set(wStream* s, UINT16 length) { UINT16 fontSupportFlags = 0; UINT16 pad2Octets = 0; - WLog_INFO(TAG, "FontCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "FontCapabilitySet (length %" PRIu16 "):", length); if (length > 4) Stream_Read_UINT16(s, fontSupportFlags); /* fontSupportFlags (2 bytes) */ @@ -1421,8 +1387,8 @@ static BOOL rdp_print_font_capability_set(wStream* s, UINT16 length) if (length > 6) Stream_Read_UINT16(s, pad2Octets); /* pad2Octets (2 bytes) */ - WLog_INFO(TAG, "\tfontSupportFlags: 0x%04"PRIX16"", fontSupportFlags); - WLog_INFO(TAG, "\tpad2Octets: 0x%04"PRIX16"", pad2Octets); + WLog_INFO(TAG, "\tfontSupportFlags: 0x%04" PRIX16 "", fontSupportFlags); + WLog_INFO(TAG, "\tpad2Octets: 0x%04" PRIX16 "", pad2Octets); return TRUE; } #endif @@ -1435,8 +1401,7 @@ static BOOL rdp_print_font_capability_set(wStream* s, UINT16 length) * @return if the operation completed successfully */ -static BOOL rdp_read_brush_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) +static BOOL rdp_read_brush_capability_set(wStream* s, UINT16 length, rdpSettings* settings) { if (length < 8) return FALSE; @@ -1469,13 +1434,13 @@ static BOOL rdp_write_brush_capability_set(wStream* s, const rdpSettings* settin static BOOL rdp_print_brush_capability_set(wStream* s, UINT16 length) { UINT32 brushSupportLevel; - WLog_INFO(TAG, "BrushCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "BrushCapabilitySet (length %" PRIu16 "):", length); if (length < 8) return FALSE; Stream_Read_UINT32(s, brushSupportLevel); /* brushSupportLevel (4 bytes) */ - WLog_INFO(TAG, "\tbrushSupportLevel: 0x%08"PRIX32"", brushSupportLevel); + WLog_INFO(TAG, "\tbrushSupportLevel: 0x%08" PRIX32 "", brushSupportLevel); return TRUE; } #endif @@ -1485,11 +1450,11 @@ static BOOL rdp_print_brush_capability_set(wStream* s, UINT16 length) * @msdn{cc240566} * @param s stream */ -static void rdp_read_cache_definition(wStream* s, - GLYPH_CACHE_DEFINITION* cache_definition) +static void rdp_read_cache_definition(wStream* s, GLYPH_CACHE_DEFINITION* cache_definition) { Stream_Read_UINT16(s, cache_definition->cacheEntries); /* cacheEntries (2 bytes) */ - Stream_Read_UINT16(s, cache_definition->cacheMaximumCellSize); /* cacheMaximumCellSize (2 bytes) */ + Stream_Read_UINT16(s, + cache_definition->cacheMaximumCellSize); /* cacheMaximumCellSize (2 bytes) */ } /** @@ -1497,11 +1462,11 @@ static void rdp_read_cache_definition(wStream* s, * @msdn{cc240566} * @param s stream */ -static void rdp_write_cache_definition(wStream* s, - GLYPH_CACHE_DEFINITION* cache_definition) +static void rdp_write_cache_definition(wStream* s, GLYPH_CACHE_DEFINITION* cache_definition) { Stream_Write_UINT16(s, cache_definition->cacheEntries); /* cacheEntries (2 bytes) */ - Stream_Write_UINT16(s, cache_definition->cacheMaximumCellSize); /* cacheMaximumCellSize (2 bytes) */ + Stream_Write_UINT16( + s, cache_definition->cacheMaximumCellSize); /* cacheMaximumCellSize (2 bytes) */ } /** @@ -1512,8 +1477,7 @@ static void rdp_write_cache_definition(wStream* s, * @return if the operation completed successfully */ -static BOOL rdp_read_glyph_cache_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) +static BOOL rdp_read_glyph_cache_capability_set(wStream* s, UINT16 length, rdpSettings* settings) { if (length < 52) return FALSE; @@ -1529,9 +1493,9 @@ static BOOL rdp_read_glyph_cache_capability_set(wStream* s, UINT16 length, rdp_read_cache_definition(s, &(settings->GlyphCache[7])); /* glyphCache7 (4 bytes) */ rdp_read_cache_definition(s, &(settings->GlyphCache[8])); /* glyphCache8 (4 bytes) */ rdp_read_cache_definition(s, &(settings->GlyphCache[9])); /* glyphCache9 (4 bytes) */ - rdp_read_cache_definition(s, settings->FragCache); /* fragCache (4 bytes) */ - Stream_Read_UINT16(s, settings->GlyphSupportLevel); /* glyphSupportLevel (2 bytes) */ - Stream_Seek_UINT16(s); /* pad2Octets (2 bytes) */ + rdp_read_cache_definition(s, settings->FragCache); /* fragCache (4 bytes) */ + Stream_Read_UINT16(s, settings->GlyphSupportLevel); /* glyphSupportLevel (2 bytes) */ + Stream_Seek_UINT16(s); /* pad2Octets (2 bytes) */ return TRUE; } @@ -1542,8 +1506,7 @@ static BOOL rdp_read_glyph_cache_capability_set(wStream* s, UINT16 length, * @param settings settings */ -static BOOL rdp_write_glyph_cache_capability_set(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_glyph_cache_capability_set(wStream* s, const rdpSettings* settings) { size_t header; @@ -1562,9 +1525,9 @@ static BOOL rdp_write_glyph_cache_capability_set(wStream* s, rdp_write_cache_definition(s, &(settings->GlyphCache[7])); /* glyphCache7 (4 bytes) */ rdp_write_cache_definition(s, &(settings->GlyphCache[8])); /* glyphCache8 (4 bytes) */ rdp_write_cache_definition(s, &(settings->GlyphCache[9])); /* glyphCache9 (4 bytes) */ - rdp_write_cache_definition(s, settings->FragCache); /* fragCache (4 bytes) */ - Stream_Write_UINT16(s, settings->GlyphSupportLevel); /* glyphSupportLevel (2 bytes) */ - Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ + rdp_write_cache_definition(s, settings->FragCache); /* fragCache (4 bytes) */ + Stream_Write_UINT16(s, settings->GlyphSupportLevel); /* glyphSupportLevel (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ rdp_capability_set_finish(s, header, CAPSET_TYPE_GLYPH_CACHE); return TRUE; } @@ -1576,7 +1539,7 @@ static BOOL rdp_print_glyph_cache_capability_set(wStream* s, UINT16 length) GLYPH_CACHE_DEFINITION fragCache; UINT16 glyphSupportLevel; UINT16 pad2Octets; - WLog_INFO(TAG, "GlyphCacheCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "GlyphCacheCapabilitySet (length %" PRIu16 "):", length); if (length < 52) return FALSE; @@ -1592,33 +1555,33 @@ static BOOL rdp_print_glyph_cache_capability_set(wStream* s, UINT16 length) rdp_read_cache_definition(s, &glyphCache[7]); /* glyphCache7 (4 bytes) */ rdp_read_cache_definition(s, &glyphCache[8]); /* glyphCache8 (4 bytes) */ rdp_read_cache_definition(s, &glyphCache[9]); /* glyphCache9 (4 bytes) */ - rdp_read_cache_definition(s, &fragCache); /* fragCache (4 bytes) */ - Stream_Read_UINT16(s, glyphSupportLevel); /* glyphSupportLevel (2 bytes) */ - Stream_Read_UINT16(s, pad2Octets); /* pad2Octets (2 bytes) */ - WLog_INFO(TAG, "\tglyphCache0: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", + rdp_read_cache_definition(s, &fragCache); /* fragCache (4 bytes) */ + Stream_Read_UINT16(s, glyphSupportLevel); /* glyphSupportLevel (2 bytes) */ + Stream_Read_UINT16(s, pad2Octets); /* pad2Octets (2 bytes) */ + WLog_INFO(TAG, "\tglyphCache0: Entries: %" PRIu16 " MaximumCellSize: %" PRIu16 "", glyphCache[0].cacheEntries, glyphCache[0].cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphCache1: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", + WLog_INFO(TAG, "\tglyphCache1: Entries: %" PRIu16 " MaximumCellSize: %" PRIu16 "", glyphCache[1].cacheEntries, glyphCache[1].cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphCache2: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", + WLog_INFO(TAG, "\tglyphCache2: Entries: %" PRIu16 " MaximumCellSize: %" PRIu16 "", glyphCache[2].cacheEntries, glyphCache[2].cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphCache3: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", + WLog_INFO(TAG, "\tglyphCache3: Entries: %" PRIu16 " MaximumCellSize: %" PRIu16 "", glyphCache[3].cacheEntries, glyphCache[3].cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphCache4: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", + WLog_INFO(TAG, "\tglyphCache4: Entries: %" PRIu16 " MaximumCellSize: %" PRIu16 "", glyphCache[4].cacheEntries, glyphCache[4].cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphCache5: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", + WLog_INFO(TAG, "\tglyphCache5: Entries: %" PRIu16 " MaximumCellSize: %" PRIu16 "", glyphCache[5].cacheEntries, glyphCache[5].cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphCache6: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", + WLog_INFO(TAG, "\tglyphCache6: Entries: %" PRIu16 " MaximumCellSize: %" PRIu16 "", glyphCache[6].cacheEntries, glyphCache[6].cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphCache7: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", + WLog_INFO(TAG, "\tglyphCache7: Entries: %" PRIu16 " MaximumCellSize: %" PRIu16 "", glyphCache[7].cacheEntries, glyphCache[7].cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphCache8: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", + WLog_INFO(TAG, "\tglyphCache8: Entries: %" PRIu16 " MaximumCellSize: %" PRIu16 "", glyphCache[8].cacheEntries, glyphCache[8].cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphCache9: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", + WLog_INFO(TAG, "\tglyphCache9: Entries: %" PRIu16 " MaximumCellSize: %" PRIu16 "", glyphCache[9].cacheEntries, glyphCache[9].cacheMaximumCellSize); - WLog_INFO(TAG, "\tfragCache: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", + WLog_INFO(TAG, "\tfragCache: Entries: %" PRIu16 " MaximumCellSize: %" PRIu16 "", fragCache.cacheEntries, fragCache.cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphSupportLevel: 0x%04"PRIX16"", glyphSupportLevel); - WLog_INFO(TAG, "\tpad2Octets: 0x%04"PRIX16"", pad2Octets); + WLog_INFO(TAG, "\tglyphSupportLevel: 0x%04" PRIX16 "", glyphSupportLevel); + WLog_INFO(TAG, "\tpad2Octets: 0x%04" PRIX16 "", pad2Octets); return TRUE; } #endif @@ -1631,16 +1594,16 @@ static BOOL rdp_print_glyph_cache_capability_set(wStream* s, UINT16 length) * @return if the operation completed successfully */ -static BOOL rdp_read_offscreen_bitmap_cache_capability_set(wStream* s, - UINT16 length, rdpSettings* settings) +static BOOL rdp_read_offscreen_bitmap_cache_capability_set(wStream* s, UINT16 length, + rdpSettings* settings) { UINT32 offscreenSupportLevel; if (length < 12) return FALSE; - Stream_Read_UINT32(s, offscreenSupportLevel); /* offscreenSupportLevel (4 bytes) */ - Stream_Read_UINT16(s, settings->OffscreenCacheSize); /* offscreenCacheSize (2 bytes) */ + Stream_Read_UINT32(s, offscreenSupportLevel); /* offscreenSupportLevel (4 bytes) */ + Stream_Read_UINT16(s, settings->OffscreenCacheSize); /* offscreenCacheSize (2 bytes) */ Stream_Read_UINT16(s, settings->OffscreenCacheEntries); /* offscreenCacheEntries (2 bytes) */ if (offscreenSupportLevel & TRUE) @@ -1656,8 +1619,7 @@ static BOOL rdp_read_offscreen_bitmap_cache_capability_set(wStream* s, * @param settings settings */ -static BOOL rdp_write_offscreen_bitmap_cache_capability_set(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_offscreen_bitmap_cache_capability_set(wStream* s, const rdpSettings* settings) { size_t header; UINT32 offscreenSupportLevel = 0x00; @@ -1670,9 +1632,10 @@ static BOOL rdp_write_offscreen_bitmap_cache_capability_set(wStream* s, if (settings->OffscreenSupportLevel) { offscreenSupportLevel = 0x01; - Stream_Write_UINT32(s, offscreenSupportLevel); /* offscreenSupportLevel (4 bytes) */ + Stream_Write_UINT32(s, offscreenSupportLevel); /* offscreenSupportLevel (4 bytes) */ Stream_Write_UINT16(s, settings->OffscreenCacheSize); /* offscreenCacheSize (2 bytes) */ - Stream_Write_UINT16(s, settings->OffscreenCacheEntries); /* offscreenCacheEntries (2 bytes) */ + Stream_Write_UINT16(s, + settings->OffscreenCacheEntries); /* offscreenCacheEntries (2 bytes) */ } else Stream_Zero(s, 8); @@ -1682,23 +1645,22 @@ static BOOL rdp_write_offscreen_bitmap_cache_capability_set(wStream* s, } #ifdef WITH_DEBUG_CAPABILITIES -static BOOL rdp_print_offscreen_bitmap_cache_capability_set(wStream* s, - UINT16 length) +static BOOL rdp_print_offscreen_bitmap_cache_capability_set(wStream* s, UINT16 length) { UINT32 offscreenSupportLevel; UINT16 offscreenCacheSize; UINT16 offscreenCacheEntries; - WLog_INFO(TAG, "OffscreenBitmapCacheCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "OffscreenBitmapCacheCapabilitySet (length %" PRIu16 "):", length); if (length < 12) return FALSE; Stream_Read_UINT32(s, offscreenSupportLevel); /* offscreenSupportLevel (4 bytes) */ - Stream_Read_UINT16(s, offscreenCacheSize); /* offscreenCacheSize (2 bytes) */ + Stream_Read_UINT16(s, offscreenCacheSize); /* offscreenCacheSize (2 bytes) */ Stream_Read_UINT16(s, offscreenCacheEntries); /* offscreenCacheEntries (2 bytes) */ - WLog_INFO(TAG, "\toffscreenSupportLevel: 0x%08"PRIX32"", offscreenSupportLevel); - WLog_INFO(TAG, "\toffscreenCacheSize: 0x%04"PRIX16"", offscreenCacheSize); - WLog_INFO(TAG, "\toffscreenCacheEntries: 0x%04"PRIX16"", offscreenCacheEntries); + WLog_INFO(TAG, "\toffscreenSupportLevel: 0x%08" PRIX32 "", offscreenSupportLevel); + WLog_INFO(TAG, "\toffscreenCacheSize: 0x%04" PRIX16 "", offscreenCacheSize); + WLog_INFO(TAG, "\toffscreenCacheEntries: 0x%04" PRIX16 "", offscreenCacheEntries); return TRUE; } #endif @@ -1711,8 +1673,8 @@ static BOOL rdp_print_offscreen_bitmap_cache_capability_set(wStream* s, * @return if the operation completed successfully */ -static BOOL rdp_read_bitmap_cache_host_support_capability_set(wStream* s, - UINT16 length, rdpSettings* settings) +static BOOL rdp_read_bitmap_cache_host_support_capability_set(wStream* s, UINT16 length, + rdpSettings* settings) { BYTE cacheVersion; @@ -1720,8 +1682,8 @@ static BOOL rdp_read_bitmap_cache_host_support_capability_set(wStream* s, return FALSE; Stream_Read_UINT8(s, cacheVersion); /* cacheVersion (1 byte) */ - Stream_Seek_UINT8(s); /* pad1 (1 byte) */ - Stream_Seek_UINT16(s); /* pad2 (2 bytes) */ + Stream_Seek_UINT8(s); /* pad1 (1 byte) */ + Stream_Seek_UINT16(s); /* pad2 (2 bytes) */ if (cacheVersion & BITMAP_CACHE_V2) settings->BitmapCachePersistEnabled = TRUE; @@ -1737,7 +1699,7 @@ static BOOL rdp_read_bitmap_cache_host_support_capability_set(wStream* s, */ static BOOL rdp_write_bitmap_cache_host_support_capability_set(wStream* s, - const rdpSettings* settings) + const rdpSettings* settings) { size_t header; @@ -1746,30 +1708,29 @@ static BOOL rdp_write_bitmap_cache_host_support_capability_set(wStream* s, header = rdp_capability_set_start(s); Stream_Write_UINT8(s, BITMAP_CACHE_V2); /* cacheVersion (1 byte) */ - Stream_Write_UINT8(s, 0); /* pad1 (1 byte) */ - Stream_Write_UINT16(s, 0); /* pad2 (2 bytes) */ + Stream_Write_UINT8(s, 0); /* pad1 (1 byte) */ + Stream_Write_UINT16(s, 0); /* pad2 (2 bytes) */ rdp_capability_set_finish(s, header, CAPSET_TYPE_BITMAP_CACHE_HOST_SUPPORT); return TRUE; } #ifdef WITH_DEBUG_CAPABILITIES -static BOOL rdp_print_bitmap_cache_host_support_capability_set(wStream* s, - UINT16 length) +static BOOL rdp_print_bitmap_cache_host_support_capability_set(wStream* s, UINT16 length) { BYTE cacheVersion; BYTE pad1; UINT16 pad2; - WLog_INFO(TAG, "BitmapCacheHostSupportCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "BitmapCacheHostSupportCapabilitySet (length %" PRIu16 "):", length); if (length < 8) return FALSE; Stream_Read_UINT8(s, cacheVersion); /* cacheVersion (1 byte) */ - Stream_Read_UINT8(s, pad1); /* pad1 (1 byte) */ - Stream_Read_UINT16(s, pad2); /* pad2 (2 bytes) */ - WLog_INFO(TAG, "\tcacheVersion: 0x%02"PRIX8"", cacheVersion); - WLog_INFO(TAG, "\tpad1: 0x%02"PRIX8"", pad1); - WLog_INFO(TAG, "\tpad2: 0x%04"PRIX16"", pad2); + Stream_Read_UINT8(s, pad1); /* pad1 (1 byte) */ + Stream_Read_UINT16(s, pad2); /* pad2 (2 bytes) */ + WLog_INFO(TAG, "\tcacheVersion: 0x%02" PRIX8 "", cacheVersion); + WLog_INFO(TAG, "\tpad1: 0x%02" PRIX8 "", pad1); + WLog_INFO(TAG, "\tpad2: 0x%04" PRIX16 "", pad2); return TRUE; } @@ -1786,8 +1747,7 @@ static void rdp_read_bitmap_cache_cell_info(wStream* s, BITMAP_CACHE_V2_CELL_INF } #endif -static void rdp_write_bitmap_cache_cell_info(wStream* s, - BITMAP_CACHE_V2_CELL_INFO* cellInfo) +static void rdp_write_bitmap_cache_cell_info(wStream* s, BITMAP_CACHE_V2_CELL_INFO* cellInfo) { UINT32 info; /** @@ -1807,20 +1767,20 @@ static void rdp_write_bitmap_cache_cell_info(wStream* s, */ static BOOL rdp_read_bitmap_cache_v2_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) + rdpSettings* settings) { if (length < 40) return FALSE; Stream_Seek_UINT16(s); /* cacheFlags (2 bytes) */ - Stream_Seek_UINT8(s); /* pad2 (1 byte) */ - Stream_Seek_UINT8(s); /* numCellCaches (1 byte) */ - Stream_Seek(s, 4); /* bitmapCache0CellInfo (4 bytes) */ - Stream_Seek(s, 4); /* bitmapCache1CellInfo (4 bytes) */ - Stream_Seek(s, 4); /* bitmapCache2CellInfo (4 bytes) */ - Stream_Seek(s, 4); /* bitmapCache3CellInfo (4 bytes) */ - Stream_Seek(s, 4); /* bitmapCache4CellInfo (4 bytes) */ - Stream_Seek(s, 12); /* pad3 (12 bytes) */ + Stream_Seek_UINT8(s); /* pad2 (1 byte) */ + Stream_Seek_UINT8(s); /* numCellCaches (1 byte) */ + Stream_Seek(s, 4); /* bitmapCache0CellInfo (4 bytes) */ + Stream_Seek(s, 4); /* bitmapCache1CellInfo (4 bytes) */ + Stream_Seek(s, 4); /* bitmapCache2CellInfo (4 bytes) */ + Stream_Seek(s, 4); /* bitmapCache3CellInfo (4 bytes) */ + Stream_Seek(s, 4); /* bitmapCache4CellInfo (4 bytes) */ + Stream_Seek(s, 12); /* pad3 (12 bytes) */ return TRUE; } @@ -1831,8 +1791,7 @@ static BOOL rdp_read_bitmap_cache_v2_capability_set(wStream* s, UINT16 length, * @param settings settings */ -static BOOL rdp_write_bitmap_cache_v2_capability_set(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_bitmap_cache_v2_capability_set(wStream* s, const rdpSettings* settings) { size_t header; UINT16 cacheFlags; @@ -1846,21 +1805,20 @@ static BOOL rdp_write_bitmap_cache_v2_capability_set(wStream* s, if (settings->BitmapCachePersistEnabled) cacheFlags |= PERSISTENT_KEYS_EXPECTED_FLAG; - Stream_Write_UINT16(s, cacheFlags); /* cacheFlags (2 bytes) */ - Stream_Write_UINT8(s, 0); /* pad2 (1 byte) */ - Stream_Write_UINT8(s, - settings->BitmapCacheV2NumCells); /* numCellCaches (1 byte) */ - rdp_write_bitmap_cache_cell_info(s, - &settings->BitmapCacheV2CellInfo[0]); /* bitmapCache0CellInfo (4 bytes) */ - rdp_write_bitmap_cache_cell_info(s, - &settings->BitmapCacheV2CellInfo[1]); /* bitmapCache1CellInfo (4 bytes) */ - rdp_write_bitmap_cache_cell_info(s, - &settings->BitmapCacheV2CellInfo[2]); /* bitmapCache2CellInfo (4 bytes) */ - rdp_write_bitmap_cache_cell_info(s, - &settings->BitmapCacheV2CellInfo[3]); /* bitmapCache3CellInfo (4 bytes) */ - rdp_write_bitmap_cache_cell_info(s, - &settings->BitmapCacheV2CellInfo[4]); /* bitmapCache4CellInfo (4 bytes) */ - Stream_Zero(s, 12); /* pad3 (12 bytes) */ + Stream_Write_UINT16(s, cacheFlags); /* cacheFlags (2 bytes) */ + Stream_Write_UINT8(s, 0); /* pad2 (1 byte) */ + Stream_Write_UINT8(s, settings->BitmapCacheV2NumCells); /* numCellCaches (1 byte) */ + rdp_write_bitmap_cache_cell_info( + s, &settings->BitmapCacheV2CellInfo[0]); /* bitmapCache0CellInfo (4 bytes) */ + rdp_write_bitmap_cache_cell_info( + s, &settings->BitmapCacheV2CellInfo[1]); /* bitmapCache1CellInfo (4 bytes) */ + rdp_write_bitmap_cache_cell_info( + s, &settings->BitmapCacheV2CellInfo[2]); /* bitmapCache2CellInfo (4 bytes) */ + rdp_write_bitmap_cache_cell_info( + s, &settings->BitmapCacheV2CellInfo[3]); /* bitmapCache3CellInfo (4 bytes) */ + rdp_write_bitmap_cache_cell_info( + s, &settings->BitmapCacheV2CellInfo[4]); /* bitmapCache4CellInfo (4 bytes) */ + Stream_Zero(s, 12); /* pad3 (12 bytes) */ rdp_capability_set_finish(s, header, CAPSET_TYPE_BITMAP_CACHE_V2); return TRUE; } @@ -1872,32 +1830,37 @@ static BOOL rdp_print_bitmap_cache_v2_capability_set(wStream* s, UINT16 length) BYTE pad2; BYTE numCellCaches; BITMAP_CACHE_V2_CELL_INFO bitmapCacheV2CellInfo[5]; - WLog_INFO(TAG, "BitmapCacheV2CapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "BitmapCacheV2CapabilitySet (length %" PRIu16 "):", length); if (length < 40) return FALSE; - Stream_Read_UINT16(s, cacheFlags); /* cacheFlags (2 bytes) */ - Stream_Read_UINT8(s, pad2); /* pad2 (1 byte) */ + Stream_Read_UINT16(s, cacheFlags); /* cacheFlags (2 bytes) */ + Stream_Read_UINT8(s, pad2); /* pad2 (1 byte) */ Stream_Read_UINT8(s, numCellCaches); /* numCellCaches (1 byte) */ - rdp_read_bitmap_cache_cell_info(s, &bitmapCacheV2CellInfo[0]); /* bitmapCache0CellInfo (4 bytes) */ - rdp_read_bitmap_cache_cell_info(s, &bitmapCacheV2CellInfo[1]); /* bitmapCache1CellInfo (4 bytes) */ - rdp_read_bitmap_cache_cell_info(s, &bitmapCacheV2CellInfo[2]); /* bitmapCache2CellInfo (4 bytes) */ - rdp_read_bitmap_cache_cell_info(s, &bitmapCacheV2CellInfo[3]); /* bitmapCache3CellInfo (4 bytes) */ - rdp_read_bitmap_cache_cell_info(s, &bitmapCacheV2CellInfo[4]); /* bitmapCache4CellInfo (4 bytes) */ - Stream_Seek(s, 12); /* pad3 (12 bytes) */ - WLog_INFO(TAG, "\tcacheFlags: 0x%04"PRIX16"", cacheFlags); - WLog_INFO(TAG, "\tpad2: 0x%02"PRIX8"", pad2); - WLog_INFO(TAG, "\tnumCellCaches: 0x%02"PRIX8"", numCellCaches); - WLog_INFO(TAG, "\tbitmapCache0CellInfo: numEntries: %"PRIu32" persistent: %"PRId32"", + rdp_read_bitmap_cache_cell_info(s, + &bitmapCacheV2CellInfo[0]); /* bitmapCache0CellInfo (4 bytes) */ + rdp_read_bitmap_cache_cell_info(s, + &bitmapCacheV2CellInfo[1]); /* bitmapCache1CellInfo (4 bytes) */ + rdp_read_bitmap_cache_cell_info(s, + &bitmapCacheV2CellInfo[2]); /* bitmapCache2CellInfo (4 bytes) */ + rdp_read_bitmap_cache_cell_info(s, + &bitmapCacheV2CellInfo[3]); /* bitmapCache3CellInfo (4 bytes) */ + rdp_read_bitmap_cache_cell_info(s, + &bitmapCacheV2CellInfo[4]); /* bitmapCache4CellInfo (4 bytes) */ + Stream_Seek(s, 12); /* pad3 (12 bytes) */ + WLog_INFO(TAG, "\tcacheFlags: 0x%04" PRIX16 "", cacheFlags); + WLog_INFO(TAG, "\tpad2: 0x%02" PRIX8 "", pad2); + WLog_INFO(TAG, "\tnumCellCaches: 0x%02" PRIX8 "", numCellCaches); + WLog_INFO(TAG, "\tbitmapCache0CellInfo: numEntries: %" PRIu32 " persistent: %" PRId32 "", bitmapCacheV2CellInfo[0].numEntries, bitmapCacheV2CellInfo[0].persistent); - WLog_INFO(TAG, "\tbitmapCache1CellInfo: numEntries: %"PRIu32" persistent: %"PRId32"", + WLog_INFO(TAG, "\tbitmapCache1CellInfo: numEntries: %" PRIu32 " persistent: %" PRId32 "", bitmapCacheV2CellInfo[1].numEntries, bitmapCacheV2CellInfo[1].persistent); - WLog_INFO(TAG, "\tbitmapCache2CellInfo: numEntries: %"PRIu32" persistent: %"PRId32"", + WLog_INFO(TAG, "\tbitmapCache2CellInfo: numEntries: %" PRIu32 " persistent: %" PRId32 "", bitmapCacheV2CellInfo[2].numEntries, bitmapCacheV2CellInfo[2].persistent); - WLog_INFO(TAG, "\tbitmapCache3CellInfo: numEntries: %"PRIu32" persistent: %"PRId32"", + WLog_INFO(TAG, "\tbitmapCache3CellInfo: numEntries: %" PRIu32 " persistent: %" PRId32 "", bitmapCacheV2CellInfo[3].numEntries, bitmapCacheV2CellInfo[3].persistent); - WLog_INFO(TAG, "\tbitmapCache4CellInfo: numEntries: %"PRIu32" persistent: %"PRId32"", + WLog_INFO(TAG, "\tbitmapCache4CellInfo: numEntries: %" PRIu32 " persistent: %" PRId32 "", bitmapCacheV2CellInfo[4].numEntries, bitmapCacheV2CellInfo[4].persistent); return TRUE; } @@ -1912,7 +1875,7 @@ static BOOL rdp_print_bitmap_cache_v2_capability_set(wStream* s, UINT16 length) */ static BOOL rdp_read_virtual_channel_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) + rdpSettings* settings) { UINT32 flags; UINT32 VCChunkSize; @@ -1940,8 +1903,7 @@ static BOOL rdp_read_virtual_channel_capability_set(wStream* s, UINT16 length, * @param settings settings */ -static BOOL rdp_write_virtual_channel_capability_set(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_virtual_channel_capability_set(wStream* s, const rdpSettings* settings) { size_t header; UINT32 flags; @@ -1951,9 +1913,8 @@ static BOOL rdp_write_virtual_channel_capability_set(wStream* s, header = rdp_capability_set_start(s); flags = VCCAPS_NO_COMPR; - Stream_Write_UINT32(s, flags); /* flags (4 bytes) */ - Stream_Write_UINT32(s, - settings->VirtualChannelChunkSize); /* VCChunkSize (4 bytes) */ + Stream_Write_UINT32(s, flags); /* flags (4 bytes) */ + Stream_Write_UINT32(s, settings->VirtualChannelChunkSize); /* VCChunkSize (4 bytes) */ rdp_capability_set_finish(s, header, CAPSET_TYPE_VIRTUAL_CHANNEL); return TRUE; } @@ -1963,7 +1924,7 @@ static BOOL rdp_print_virtual_channel_capability_set(wStream* s, UINT16 length) { UINT32 flags; UINT32 VCChunkSize; - WLog_INFO(TAG, "VirtualChannelCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "VirtualChannelCapabilitySet (length %" PRIu16 "):", length); if (length < 8) return FALSE; @@ -1975,8 +1936,8 @@ static BOOL rdp_print_virtual_channel_capability_set(wStream* s, UINT16 length) else VCChunkSize = 1600; - WLog_INFO(TAG, "\tflags: 0x%08"PRIX32"", flags); - WLog_INFO(TAG, "\tVCChunkSize: 0x%08"PRIX32"", VCChunkSize); + WLog_INFO(TAG, "\tflags: 0x%08" PRIX32 "", flags); + WLog_INFO(TAG, "\tVCChunkSize: 0x%08" PRIX32 "", VCChunkSize); return TRUE; } #endif @@ -1989,17 +1950,18 @@ static BOOL rdp_print_virtual_channel_capability_set(wStream* s, UINT16 length) * @return if the operation completed successfully */ -static BOOL rdp_read_draw_nine_grid_cache_capability_set(wStream* s, - UINT16 length, rdpSettings* settings) +static BOOL rdp_read_draw_nine_grid_cache_capability_set(wStream* s, UINT16 length, + rdpSettings* settings) { UINT32 drawNineGridSupportLevel; if (length < 12) return FALSE; - Stream_Read_UINT32(s, drawNineGridSupportLevel); /* drawNineGridSupportLevel (4 bytes) */ + Stream_Read_UINT32(s, drawNineGridSupportLevel); /* drawNineGridSupportLevel (4 bytes) */ Stream_Read_UINT16(s, settings->DrawNineGridCacheSize); /* drawNineGridCacheSize (2 bytes) */ - Stream_Read_UINT16(s, settings->DrawNineGridCacheEntries); /* drawNineGridCacheEntries (2 bytes) */ + Stream_Read_UINT16(s, + settings->DrawNineGridCacheEntries); /* drawNineGridCacheEntries (2 bytes) */ if ((drawNineGridSupportLevel & DRAW_NINEGRID_SUPPORTED) || (drawNineGridSupportLevel & DRAW_NINEGRID_SUPPORTED_V2)) @@ -2015,8 +1977,7 @@ static BOOL rdp_read_draw_nine_grid_cache_capability_set(wStream* s, * @param settings settings */ -static BOOL rdp_write_draw_nine_grid_cache_capability_set(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_draw_nine_grid_cache_capability_set(wStream* s, const rdpSettings* settings) { size_t header; UINT32 drawNineGridSupportLevel; @@ -2025,17 +1986,18 @@ static BOOL rdp_write_draw_nine_grid_cache_capability_set(wStream* s, return FALSE; header = rdp_capability_set_start(s); - drawNineGridSupportLevel = (settings->DrawNineGridEnabled) ? - DRAW_NINEGRID_SUPPORTED_V2 : DRAW_NINEGRID_NO_SUPPORT; + drawNineGridSupportLevel = + (settings->DrawNineGridEnabled) ? DRAW_NINEGRID_SUPPORTED_V2 : DRAW_NINEGRID_NO_SUPPORT; Stream_Write_UINT32(s, drawNineGridSupportLevel); /* drawNineGridSupportLevel (4 bytes) */ Stream_Write_UINT16(s, settings->DrawNineGridCacheSize); /* drawNineGridCacheSize (2 bytes) */ - Stream_Write_UINT16(s, settings->DrawNineGridCacheEntries); /* drawNineGridCacheEntries (2 bytes) */ + Stream_Write_UINT16( + s, settings->DrawNineGridCacheEntries); /* drawNineGridCacheEntries (2 bytes) */ rdp_capability_set_finish(s, header, CAPSET_TYPE_DRAW_NINE_GRID_CACHE); return TRUE; } -static void rdp_write_gdiplus_cache_entries(wStream* s, UINT16 gce, UINT16 bce, - UINT16 pce, UINT16 ice, UINT16 ace) +static void rdp_write_gdiplus_cache_entries(wStream* s, UINT16 gce, UINT16 bce, UINT16 pce, + UINT16 ice, UINT16 ace) { Stream_Write_UINT16(s, gce); /* gdipGraphicsCacheEntries (2 bytes) */ Stream_Write_UINT16(s, bce); /* gdipBrushCacheEntries (2 bytes) */ @@ -2044,39 +2006,36 @@ static void rdp_write_gdiplus_cache_entries(wStream* s, UINT16 gce, UINT16 bce, Stream_Write_UINT16(s, ace); /* gdipImageAttributesCacheEntries (2 bytes) */ } -static void rdp_write_gdiplus_cache_chunk_size(wStream* s, UINT16 gccs, - UINT16 obccs, UINT16 opccs, UINT16 oiaccs) +static void rdp_write_gdiplus_cache_chunk_size(wStream* s, UINT16 gccs, UINT16 obccs, UINT16 opccs, + UINT16 oiaccs) { - Stream_Write_UINT16(s, gccs); /* gdipGraphicsCacheChunkSize (2 bytes) */ - Stream_Write_UINT16(s, obccs); /* gdipObjectBrushCacheChunkSize (2 bytes) */ - Stream_Write_UINT16(s, opccs); /* gdipObjectPenCacheChunkSize (2 bytes) */ - Stream_Write_UINT16(s, - oiaccs); /* gdipObjectImageAttributesCacheChunkSize (2 bytes) */ + Stream_Write_UINT16(s, gccs); /* gdipGraphicsCacheChunkSize (2 bytes) */ + Stream_Write_UINT16(s, obccs); /* gdipObjectBrushCacheChunkSize (2 bytes) */ + Stream_Write_UINT16(s, opccs); /* gdipObjectPenCacheChunkSize (2 bytes) */ + Stream_Write_UINT16(s, oiaccs); /* gdipObjectImageAttributesCacheChunkSize (2 bytes) */ } -static void rdp_write_gdiplus_image_cache_properties(wStream* s, UINT16 oiccs, - UINT16 oicts, UINT16 oicms) +static void rdp_write_gdiplus_image_cache_properties(wStream* s, UINT16 oiccs, UINT16 oicts, + UINT16 oicms) { Stream_Write_UINT16(s, oiccs); /* gdipObjectImageCacheChunkSize (2 bytes) */ Stream_Write_UINT16(s, oicts); /* gdipObjectImageCacheTotalSize (2 bytes) */ Stream_Write_UINT16(s, oicms); /* gdipObjectImageCacheMaxSize (2 bytes) */ } - #ifdef WITH_DEBUG_CAPABILITIES -static BOOL rdp_print_draw_nine_grid_cache_capability_set(wStream* s, - UINT16 length) +static BOOL rdp_print_draw_nine_grid_cache_capability_set(wStream* s, UINT16 length) { UINT32 drawNineGridSupportLevel; UINT16 DrawNineGridCacheSize; UINT16 DrawNineGridCacheEntries; - WLog_INFO(TAG, "DrawNineGridCacheCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "DrawNineGridCacheCapabilitySet (length %" PRIu16 "):", length); if (length < 12) return FALSE; Stream_Read_UINT32(s, drawNineGridSupportLevel); /* drawNineGridSupportLevel (4 bytes) */ - Stream_Read_UINT16(s, DrawNineGridCacheSize); /* drawNineGridCacheSize (2 bytes) */ + Stream_Read_UINT16(s, DrawNineGridCacheSize); /* drawNineGridCacheSize (2 bytes) */ Stream_Read_UINT16(s, DrawNineGridCacheEntries); /* drawNineGridCacheEntries (2 bytes) */ return TRUE; } @@ -2090,8 +2049,8 @@ static BOOL rdp_print_draw_nine_grid_cache_capability_set(wStream* s, * @return if the operation completed successfully */ -static BOOL rdp_read_draw_gdiplus_cache_capability_set(wStream* s, - UINT16 length, rdpSettings* settings) +static BOOL rdp_read_draw_gdiplus_cache_capability_set(wStream* s, UINT16 length, + rdpSettings* settings) { UINT32 drawGDIPlusSupportLevel; UINT32 drawGdiplusCacheLevel; @@ -2100,11 +2059,11 @@ static BOOL rdp_read_draw_gdiplus_cache_capability_set(wStream* s, return FALSE; Stream_Read_UINT32(s, drawGDIPlusSupportLevel); /* drawGDIPlusSupportLevel (4 bytes) */ - Stream_Seek_UINT32(s); /* GdipVersion (4 bytes) */ - Stream_Read_UINT32(s, drawGdiplusCacheLevel); /* drawGdiplusCacheLevel (4 bytes) */ - Stream_Seek(s, 10); /* GdipCacheEntries (10 bytes) */ - Stream_Seek(s, 8); /* GdipCacheChunkSize (8 bytes) */ - Stream_Seek(s, 6); /* GdipImageCacheProperties (6 bytes) */ + Stream_Seek_UINT32(s); /* GdipVersion (4 bytes) */ + Stream_Read_UINT32(s, drawGdiplusCacheLevel); /* drawGdiplusCacheLevel (4 bytes) */ + Stream_Seek(s, 10); /* GdipCacheEntries (10 bytes) */ + Stream_Seek(s, 8); /* GdipCacheChunkSize (8 bytes) */ + Stream_Seek(s, 6); /* GdipImageCacheProperties (6 bytes) */ if (drawGDIPlusSupportLevel & DRAW_GDIPLUS_SUPPORTED) settings->DrawGdiPlusEnabled = TRUE; @@ -2132,39 +2091,38 @@ static BOOL rdp_write_draw_gdiplus_cache_capability_set(wStream* s, const rdpSet return FALSE; header = rdp_capability_set_start(s); - drawGDIPlusSupportLevel = (settings->DrawGdiPlusEnabled) ? - DRAW_GDIPLUS_SUPPORTED : DRAW_GDIPLUS_DEFAULT; - drawGdiplusCacheLevel = (settings->DrawGdiPlusEnabled) ? - DRAW_GDIPLUS_CACHE_LEVEL_ONE : DRAW_GDIPLUS_CACHE_LEVEL_DEFAULT; - Stream_Write_UINT32(s, drawGDIPlusSupportLevel); /* drawGDIPlusSupportLevel (4 bytes) */ - Stream_Write_UINT32(s, 0); /* GdipVersion (4 bytes) */ - Stream_Write_UINT32(s, drawGdiplusCacheLevel); /* drawGdiplusCacheLevel (4 bytes) */ + drawGDIPlusSupportLevel = + (settings->DrawGdiPlusEnabled) ? DRAW_GDIPLUS_SUPPORTED : DRAW_GDIPLUS_DEFAULT; + drawGdiplusCacheLevel = (settings->DrawGdiPlusEnabled) ? DRAW_GDIPLUS_CACHE_LEVEL_ONE + : DRAW_GDIPLUS_CACHE_LEVEL_DEFAULT; + Stream_Write_UINT32(s, drawGDIPlusSupportLevel); /* drawGDIPlusSupportLevel (4 bytes) */ + Stream_Write_UINT32(s, 0); /* GdipVersion (4 bytes) */ + Stream_Write_UINT32(s, drawGdiplusCacheLevel); /* drawGdiplusCacheLevel (4 bytes) */ rdp_write_gdiplus_cache_entries(s, 10, 5, 5, 10, 2); /* GdipCacheEntries (10 bytes) */ rdp_write_gdiplus_cache_chunk_size(s, 512, 2048, 1024, 64); /* GdipCacheChunkSize (8 bytes) */ rdp_write_gdiplus_image_cache_properties(s, 4096, 256, - 128); /* GdipImageCacheProperties (6 bytes) */ + 128); /* GdipImageCacheProperties (6 bytes) */ rdp_capability_set_finish(s, header, CAPSET_TYPE_DRAW_GDI_PLUS); return TRUE; } #ifdef WITH_DEBUG_CAPABILITIES -static BOOL rdp_print_draw_gdiplus_cache_capability_set(wStream* s, - UINT16 length) +static BOOL rdp_print_draw_gdiplus_cache_capability_set(wStream* s, UINT16 length) { UINT32 drawGdiPlusSupportLevel; UINT32 GdipVersion; UINT32 drawGdiplusCacheLevel; - WLog_INFO(TAG, "DrawGdiPlusCacheCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "DrawGdiPlusCacheCapabilitySet (length %" PRIu16 "):", length); if (length < 40) return FALSE; Stream_Read_UINT32(s, drawGdiPlusSupportLevel); /* drawGdiPlusSupportLevel (4 bytes) */ - Stream_Read_UINT32(s, GdipVersion); /* GdipVersion (4 bytes) */ - Stream_Read_UINT32(s, drawGdiplusCacheLevel); /* drawGdiPlusCacheLevel (4 bytes) */ - Stream_Seek(s, 10); /* GdipCacheEntries (10 bytes) */ - Stream_Seek(s, 8); /* GdipCacheChunkSize (8 bytes) */ - Stream_Seek(s, 6); /* GdipImageCacheProperties (6 bytes) */ + Stream_Read_UINT32(s, GdipVersion); /* GdipVersion (4 bytes) */ + Stream_Read_UINT32(s, drawGdiplusCacheLevel); /* drawGdiPlusCacheLevel (4 bytes) */ + Stream_Seek(s, 10); /* GdipCacheEntries (10 bytes) */ + Stream_Seek(s, 8); /* GdipCacheChunkSize (8 bytes) */ + Stream_Seek(s, 6); /* GdipImageCacheProperties (6 bytes) */ return TRUE; } #endif @@ -2178,7 +2136,7 @@ static BOOL rdp_print_draw_gdiplus_cache_capability_set(wStream* s, */ static BOOL rdp_read_remote_programs_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) + rdpSettings* settings) { UINT32 railSupportLevel; @@ -2202,7 +2160,8 @@ static BOOL rdp_read_remote_programs_capability_set(wStream* s, UINT16 length, if (settings->RemoteApplicationMode) railSupportLevel |= RAIL_LEVEL_HANDSHAKE_EX_SUPPORTED; - settings->RemoteApplicationSupportLevel = railSupportLevel & settings->RemoteApplicationSupportMask; + settings->RemoteApplicationSupportLevel = + railSupportLevel & settings->RemoteApplicationSupportMask; return TRUE; } @@ -2213,8 +2172,7 @@ static BOOL rdp_read_remote_programs_capability_set(wStream* s, UINT16 length, * @param settings settings */ -static BOOL rdp_write_remote_programs_capability_set(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_remote_programs_capability_set(wStream* s, const rdpSettings* settings) { size_t header; UINT32 railSupportLevel; @@ -2248,13 +2206,13 @@ static BOOL rdp_write_remote_programs_capability_set(wStream* s, static BOOL rdp_print_remote_programs_capability_set(wStream* s, UINT16 length) { UINT32 railSupportLevel; - WLog_INFO(TAG, "RemoteProgramsCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "RemoteProgramsCapabilitySet (length %" PRIu16 "):", length); if (length < 8) return FALSE; Stream_Read_UINT32(s, railSupportLevel); /* railSupportLevel (4 bytes) */ - WLog_INFO(TAG, "\trailSupportLevel: 0x%08"PRIX32"", railSupportLevel); + WLog_INFO(TAG, "\trailSupportLevel: 0x%08" PRIX32 "", railSupportLevel); return TRUE; } #endif @@ -2267,15 +2225,15 @@ static BOOL rdp_print_remote_programs_capability_set(wStream* s, UINT16 length) * @return if the operation completed successfully */ -static BOOL rdp_read_window_list_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) +static BOOL rdp_read_window_list_capability_set(wStream* s, UINT16 length, rdpSettings* settings) { if (length < 11) return FALSE; Stream_Read_UINT32(s, settings->RemoteWndSupportLevel); /* wndSupportLevel (4 bytes) */ Stream_Read_UINT8(s, settings->RemoteAppNumIconCaches); /* numIconCaches (1 byte) */ - Stream_Read_UINT16(s, settings->RemoteAppNumIconCacheEntries); /* numIconCacheEntries (2 bytes) */ + Stream_Read_UINT16(s, + settings->RemoteAppNumIconCacheEntries); /* numIconCacheEntries (2 bytes) */ return TRUE; } @@ -2296,7 +2254,8 @@ static BOOL rdp_write_window_list_capability_set(wStream* s, const rdpSettings* header = rdp_capability_set_start(s); Stream_Write_UINT32(s, settings->RemoteWndSupportLevel); /* wndSupportLevel (4 bytes) */ Stream_Write_UINT8(s, settings->RemoteAppNumIconCaches); /* numIconCaches (1 byte) */ - Stream_Write_UINT16(s, settings->RemoteAppNumIconCacheEntries); /* numIconCacheEntries (2 bytes) */ + Stream_Write_UINT16(s, + settings->RemoteAppNumIconCacheEntries); /* numIconCacheEntries (2 bytes) */ rdp_capability_set_finish(s, header, CAPSET_TYPE_WINDOW); return TRUE; } @@ -2307,17 +2266,17 @@ static BOOL rdp_print_window_list_capability_set(wStream* s, UINT16 length) UINT32 wndSupportLevel; BYTE numIconCaches; UINT16 numIconCacheEntries; - WLog_INFO(TAG, "WindowListCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "WindowListCapabilitySet (length %" PRIu16 "):", length); if (length < 11) return FALSE; - Stream_Read_UINT32(s, wndSupportLevel); /* wndSupportLevel (4 bytes) */ - Stream_Read_UINT8(s, numIconCaches); /* numIconCaches (1 byte) */ + Stream_Read_UINT32(s, wndSupportLevel); /* wndSupportLevel (4 bytes) */ + Stream_Read_UINT8(s, numIconCaches); /* numIconCaches (1 byte) */ Stream_Read_UINT16(s, numIconCacheEntries); /* numIconCacheEntries (2 bytes) */ - WLog_INFO(TAG, "\twndSupportLevel: 0x%08"PRIX32"", wndSupportLevel); - WLog_INFO(TAG, "\tnumIconCaches: 0x%02"PRIX8"", numIconCaches); - WLog_INFO(TAG, "\tnumIconCacheEntries: 0x%04"PRIX16"", numIconCacheEntries); + WLog_INFO(TAG, "\twndSupportLevel: 0x%08" PRIX32 "", wndSupportLevel); + WLog_INFO(TAG, "\tnumIconCaches: 0x%02" PRIX8 "", numIconCaches); + WLog_INFO(TAG, "\tnumIconCacheEntries: 0x%04" PRIX16 "", numIconCacheEntries); return TRUE; } #endif @@ -2330,8 +2289,8 @@ static BOOL rdp_print_window_list_capability_set(wStream* s, UINT16 length) * @return if the operation completed successfully */ -static BOOL rdp_read_desktop_composition_capability_set(wStream* s, - UINT16 length, rdpSettings* settings) +static BOOL rdp_read_desktop_composition_capability_set(wStream* s, UINT16 length, + rdpSettings* settings) { if (length < 6) return FALSE; @@ -2347,8 +2306,7 @@ static BOOL rdp_read_desktop_composition_capability_set(wStream* s, * @param settings settings */ -static BOOL rdp_write_desktop_composition_capability_set(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_desktop_composition_capability_set(wStream* s, const rdpSettings* settings) { size_t header; UINT16 compDeskSupportLevel; @@ -2357,25 +2315,24 @@ static BOOL rdp_write_desktop_composition_capability_set(wStream* s, return FALSE; header = rdp_capability_set_start(s); - compDeskSupportLevel = (settings->AllowDesktopComposition) ? - COMPDESK_SUPPORTED : COMPDESK_NOT_SUPPORTED; + compDeskSupportLevel = + (settings->AllowDesktopComposition) ? COMPDESK_SUPPORTED : COMPDESK_NOT_SUPPORTED; Stream_Write_UINT16(s, compDeskSupportLevel); /* compDeskSupportLevel (2 bytes) */ rdp_capability_set_finish(s, header, CAPSET_TYPE_COMP_DESK); return TRUE; } #ifdef WITH_DEBUG_CAPABILITIES -static BOOL rdp_print_desktop_composition_capability_set(wStream* s, - UINT16 length) +static BOOL rdp_print_desktop_composition_capability_set(wStream* s, UINT16 length) { UINT16 compDeskSupportLevel; - WLog_INFO(TAG, "DesktopCompositionCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "DesktopCompositionCapabilitySet (length %" PRIu16 "):", length); if (length < 6) return FALSE; Stream_Read_UINT16(s, compDeskSupportLevel); /* compDeskSupportLevel (2 bytes) */ - WLog_INFO(TAG, "\tcompDeskSupportLevel: 0x%04"PRIX16"", compDeskSupportLevel); + WLog_INFO(TAG, "\tcompDeskSupportLevel: 0x%04" PRIX16 "", compDeskSupportLevel); return TRUE; } #endif @@ -2388,8 +2345,8 @@ static BOOL rdp_print_desktop_composition_capability_set(wStream* s, * @return if the operation completed successfully */ -static BOOL rdp_read_multifragment_update_capability_set(wStream* s, - UINT16 length, rdpSettings* settings) +static BOOL rdp_read_multifragment_update_capability_set(wStream* s, UINT16 length, + rdpSettings* settings) { UINT32 multifragMaxRequestSize; @@ -2401,10 +2358,10 @@ static BOOL rdp_read_multifragment_update_capability_set(wStream* s, if (settings->ServerMode) { /* - * Special case: The client announces multifragment update support but sets the maximum request size - * to something smaller than maximum size for *one* fast-path PDU. - * In this case behave like no multifragment updates were supported and make sure no - * fragmentation happens by setting FASTPATH_FRAGMENT_SAFE_SIZE. + * Special case: The client announces multifragment update support but sets the maximum + * request size to something smaller than maximum size for *one* fast-path PDU. In this case + * behave like no multifragment updates were supported and make sure no fragmentation + * happens by setting FASTPATH_FRAGMENT_SAFE_SIZE. * * This behaviour was observed with some windows ce rdp clients. */ @@ -2458,8 +2415,7 @@ static BOOL rdp_read_multifragment_update_capability_set(wStream* s, * @param settings settings */ -static BOOL rdp_write_multifragment_update_capability_set(wStream* s, - rdpSettings* settings) +static BOOL rdp_write_multifragment_update_capability_set(wStream* s, rdpSettings* settings) { size_t header; @@ -2493,17 +2449,16 @@ static BOOL rdp_write_multifragment_update_capability_set(wStream* s, } #ifdef WITH_DEBUG_CAPABILITIES -static BOOL rdp_print_multifragment_update_capability_set(wStream* s, - UINT16 length) +static BOOL rdp_print_multifragment_update_capability_set(wStream* s, UINT16 length) { UINT32 maxRequestSize; - WLog_INFO(TAG, "MultifragmentUpdateCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "MultifragmentUpdateCapabilitySet (length %" PRIu16 "):", length); if (length < 8) return FALSE; Stream_Read_UINT32(s, maxRequestSize); /* maxRequestSize (4 bytes) */ - WLog_INFO(TAG, "\tmaxRequestSize: 0x%08"PRIX32"", maxRequestSize); + WLog_INFO(TAG, "\tmaxRequestSize: 0x%08" PRIX32 "", maxRequestSize); return TRUE; } #endif @@ -2516,8 +2471,7 @@ static BOOL rdp_print_multifragment_update_capability_set(wStream* s, * @return if the operation completed successfully */ -static BOOL rdp_read_large_pointer_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) +static BOOL rdp_read_large_pointer_capability_set(wStream* s, UINT16 length, rdpSettings* settings) { UINT16 largePointerSupportFlags; @@ -2525,8 +2479,7 @@ static BOOL rdp_read_large_pointer_capability_set(wStream* s, UINT16 length, return FALSE; Stream_Read_UINT16(s, largePointerSupportFlags); /* largePointerSupportFlags (2 bytes) */ - settings->LargePointerFlag = (largePointerSupportFlags & - LARGE_POINTER_FLAG_96x96) ? 1 : 0; + settings->LargePointerFlag = (largePointerSupportFlags & LARGE_POINTER_FLAG_96x96) ? 1 : 0; return TRUE; } @@ -2556,13 +2509,13 @@ static BOOL rdp_write_large_pointer_capability_set(wStream* s, const rdpSettings static BOOL rdp_print_large_pointer_capability_set(wStream* s, UINT16 length) { UINT16 largePointerSupportFlags; - WLog_INFO(TAG, "LargePointerCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "LargePointerCapabilitySet (length %" PRIu16 "):", length); if (length < 6) return FALSE; Stream_Read_UINT16(s, largePointerSupportFlags); /* largePointerSupportFlags (2 bytes) */ - WLog_INFO(TAG, "\tlargePointerSupportFlags: 0x%04"PRIX16"", largePointerSupportFlags); + WLog_INFO(TAG, "\tlargePointerSupportFlags: 0x%04" PRIX16 "", largePointerSupportFlags); return TRUE; } #endif @@ -2576,7 +2529,7 @@ static BOOL rdp_print_large_pointer_capability_set(wStream* s, UINT16 length) */ static BOOL rdp_read_surface_commands_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) + rdpSettings* settings) { UINT32 cmdFlags; @@ -2584,10 +2537,9 @@ static BOOL rdp_read_surface_commands_capability_set(wStream* s, UINT16 length, return FALSE; Stream_Read_UINT32(s, cmdFlags); /* cmdFlags (4 bytes) */ - Stream_Seek_UINT32(s); /* reserved (4 bytes) */ + Stream_Seek_UINT32(s); /* reserved (4 bytes) */ settings->SurfaceCommandsEnabled = TRUE; - settings->SurfaceFrameMarkerEnabled = (cmdFlags & SURFCMDS_FRAME_MARKER) ? - TRUE : FALSE; + settings->SurfaceFrameMarkerEnabled = (cmdFlags & SURFCMDS_FRAME_MARKER) ? TRUE : FALSE; return TRUE; } @@ -2598,8 +2550,7 @@ static BOOL rdp_read_surface_commands_capability_set(wStream* s, UINT16 length, * @param settings settings */ -static BOOL rdp_write_surface_commands_capability_set(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_surface_commands_capability_set(wStream* s, const rdpSettings* settings) { size_t header; UINT32 cmdFlags; @@ -2614,7 +2565,7 @@ static BOOL rdp_write_surface_commands_capability_set(wStream* s, cmdFlags |= SURFCMDS_FRAME_MARKER; Stream_Write_UINT32(s, cmdFlags); /* cmdFlags (4 bytes) */ - Stream_Write_UINT32(s, 0); /* reserved (4 bytes) */ + Stream_Write_UINT32(s, 0); /* reserved (4 bytes) */ rdp_capability_set_finish(s, header, CAPSET_TYPE_SURFACE_COMMANDS); return TRUE; } @@ -2624,29 +2575,27 @@ static BOOL rdp_print_surface_commands_capability_set(wStream* s, UINT16 length) { UINT32 cmdFlags; UINT32 reserved; - WLog_INFO(TAG, "SurfaceCommandsCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "SurfaceCommandsCapabilitySet (length %" PRIu16 "):", length); if (length < 12) return FALSE; Stream_Read_UINT32(s, cmdFlags); /* cmdFlags (4 bytes) */ Stream_Read_UINT32(s, reserved); /* reserved (4 bytes) */ - WLog_INFO(TAG, "\tcmdFlags: 0x%08"PRIX32"", cmdFlags); - WLog_INFO(TAG, "\treserved: 0x%08"PRIX32"", reserved); + WLog_INFO(TAG, "\tcmdFlags: 0x%08" PRIX32 "", cmdFlags); + WLog_INFO(TAG, "\treserved: 0x%08" PRIX32 "", reserved); return TRUE; } - static void rdp_print_bitmap_codec_guid(const GUID* guid) { WLog_INFO(TAG, - "%08"PRIX32"%04"PRIX16"%04"PRIX16"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"", - guid->Data1, guid->Data2, guid->Data3, - guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], - guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]); + "%08" PRIX32 "%04" PRIX16 "%04" PRIX16 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "", + guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], guid->Data4[1], guid->Data4[2], + guid->Data4[3], guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]); } - static char* rdp_get_bitmap_codec_guid_name(const GUID* guid) { RPC_STATUS rpc_status; @@ -2716,8 +2665,7 @@ static void rdp_write_bitmap_codec_guid(wStream* s, const GUID* guid) * @return if the operation completed successfully */ -static BOOL rdp_read_bitmap_codecs_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) +static BOOL rdp_read_bitmap_codecs_capability_set(wStream* s, UINT16 length, rdpSettings* settings) { BYTE codecId; GUID codecGuid; @@ -2740,8 +2688,8 @@ static BOOL rdp_read_bitmap_codecs_capability_set(wStream* s, UINT16 length, if (remainingLength < 19) return FALSE; - rdp_read_bitmap_codec_guid(s, &codecGuid); /* codecGuid (16 bytes) */ - Stream_Read_UINT8(s, codecId); /* codecId (1 byte) */ + rdp_read_bitmap_codec_guid(s, &codecGuid); /* codecGuid (16 bytes) */ + Stream_Read_UINT8(s, codecId); /* codecId (1 byte) */ Stream_Read_UINT16(s, codecPropertiesLength); /* codecPropertiesLength (2 bytes) */ remainingLength -= 19; @@ -2752,7 +2700,7 @@ static BOOL rdp_read_bitmap_codecs_capability_set(wStream* s, UINT16 length, { UINT32 beg; UINT32 end; - beg = (UINT32) Stream_GetPosition(s); + beg = (UINT32)Stream_GetPosition(s); end = beg + codecPropertiesLength; if (UuidEqual(&codecGuid, &CODEC_GUID_REMOTEFX, &rpc_status)) @@ -2763,11 +2711,10 @@ static BOOL rdp_read_bitmap_codecs_capability_set(wStream* s, UINT16 length, guidRemoteFx = TRUE; settings->RemoteFxCodecId = codecId; Stream_Read_UINT32(s, rfxPropsLength); /* length (4 bytes) */ - Stream_Read_UINT32(s, captureFlags); /* captureFlags (4 bytes) */ - Stream_Read_UINT32(s, rfxCapsLength); /* capsLength (4 bytes) */ + Stream_Read_UINT32(s, captureFlags); /* captureFlags (4 bytes) */ + Stream_Read_UINT32(s, rfxCapsLength); /* capsLength (4 bytes) */ settings->RemoteFxCaptureFlags = captureFlags; - settings->RemoteFxOnly = (captureFlags & CARDP_CAPS_CAPTURE_NON_CAC) ? TRUE : - FALSE; + settings->RemoteFxOnly = (captureFlags & CARDP_CAPS_CAPTURE_NON_CAC) ? TRUE : FALSE; if (rfxCapsLength) { @@ -2779,8 +2726,8 @@ static BOOL rdp_read_bitmap_codecs_capability_set(wStream* s, UINT16 length, UINT16 numIcaps; UINT16 icapLen; /* TS_RFX_CAPS */ - Stream_Read_UINT16(s, blockType); /* blockType (2 bytes) */ - Stream_Read_UINT32(s, blockLen); /* blockLen (4 bytes) */ + Stream_Read_UINT16(s, blockType); /* blockType (2 bytes) */ + Stream_Read_UINT32(s, blockLen); /* blockLen (4 bytes) */ Stream_Read_UINT16(s, numCapsets); /* numCapsets (2 bytes) */ if (blockType != 0xCBC0) @@ -2793,12 +2740,12 @@ static BOOL rdp_read_bitmap_codecs_capability_set(wStream* s, UINT16 length, return FALSE; /* TS_RFX_CAPSET */ - Stream_Read_UINT16(s, blockType); /* blockType (2 bytes) */ - Stream_Read_UINT32(s, blockLen); /* blockLen (4 bytes) */ - Stream_Read_UINT8(s, rfxCodecId); /* codecId (1 byte) */ + Stream_Read_UINT16(s, blockType); /* blockType (2 bytes) */ + Stream_Read_UINT32(s, blockLen); /* blockLen (4 bytes) */ + Stream_Read_UINT8(s, rfxCodecId); /* codecId (1 byte) */ Stream_Read_UINT16(s, capsetType); /* capsetType (2 bytes) */ - Stream_Read_UINT16(s, numIcaps); /* numIcaps (2 bytes) */ - Stream_Read_UINT16(s, icapLen); /* icapLen (2 bytes) */ + Stream_Read_UINT16(s, numIcaps); /* numIcaps (2 bytes) */ + Stream_Read_UINT16(s, icapLen); /* icapLen (2 bytes) */ if (blockType != 0xCBC1) return FALSE; @@ -2818,12 +2765,12 @@ static BOOL rdp_read_bitmap_codecs_capability_set(wStream* s, UINT16 length, BYTE transformBits; BYTE entropyBits; /* TS_RFX_ICAP */ - Stream_Read_UINT16(s, version); /* version (2 bytes) */ - Stream_Read_UINT16(s, tileSize); /* tileSize (2 bytes) */ - Stream_Read_UINT8(s, codecFlags); /* flags (1 byte) */ - Stream_Read_UINT8(s, colConvBits); /* colConvBits (1 byte) */ + Stream_Read_UINT16(s, version); /* version (2 bytes) */ + Stream_Read_UINT16(s, tileSize); /* tileSize (2 bytes) */ + Stream_Read_UINT8(s, codecFlags); /* flags (1 byte) */ + Stream_Read_UINT8(s, colConvBits); /* colConvBits (1 byte) */ Stream_Read_UINT8(s, transformBits); /* transformBits (1 byte) */ - Stream_Read_UINT8(s, entropyBits); /* entropyBits (1 byte) */ + Stream_Read_UINT8(s, entropyBits); /* entropyBits (1 byte) */ if (version == 0x0009) { @@ -2862,8 +2809,8 @@ static BOOL rdp_read_bitmap_codecs_capability_set(wStream* s, UINT16 length, guidNSCodec = TRUE; settings->NSCodecId = codecId; Stream_Read_UINT8(s, fAllowDynamicFidelity); /* fAllowDynamicFidelity (1 byte) */ - Stream_Read_UINT8(s, fAllowSubsampling); /* fAllowSubsampling (1 byte) */ - Stream_Read_UINT8(s, colorLossLevel); /* colorLossLevel (1 byte) */ + Stream_Read_UINT8(s, fAllowSubsampling); /* fAllowSubsampling (1 byte) */ + Stream_Read_UINT8(s, colorLossLevel); /* colorLossLevel (1 byte) */ if (colorLossLevel < 1) colorLossLevel = 1; @@ -2887,7 +2834,8 @@ static BOOL rdp_read_bitmap_codecs_capability_set(wStream* s, UINT16 length, if (Stream_GetPosition(s) != end) { WLog_ERR(TAG, - "error while reading codec properties: actual offset: %"PRIuz" expected offset: %"PRIu32"", + "error while reading codec properties: actual offset: %" PRIuz + " expected offset: %" PRIu32 "", Stream_GetPosition(s), end); Stream_SetPosition(s, end); } @@ -2920,8 +2868,7 @@ static BOOL rdp_read_bitmap_codecs_capability_set(wStream* s, UINT16 length, * @param s stream * @param settings settings */ -static BOOL rdp_write_rfx_client_capability_container(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_rfx_client_capability_container(wStream* s, const rdpSettings* settings) { UINT32 captureFlags; BYTE codecMode; @@ -2933,34 +2880,34 @@ static BOOL rdp_write_rfx_client_capability_container(wStream* s, codecMode = settings->RemoteFxCodecMode; Stream_Write_UINT16(s, 49); /* codecPropertiesLength */ /* TS_RFX_CLNT_CAPS_CONTAINER */ - Stream_Write_UINT32(s, 49); /* length */ + Stream_Write_UINT32(s, 49); /* length */ Stream_Write_UINT32(s, captureFlags); /* captureFlags */ - Stream_Write_UINT32(s, 37); /* capsLength */ + Stream_Write_UINT32(s, 37); /* capsLength */ /* TS_RFX_CAPS */ Stream_Write_UINT16(s, CBY_CAPS); /* blockType */ - Stream_Write_UINT32(s, 8); /* blockLen */ - Stream_Write_UINT16(s, 1); /* numCapsets */ + Stream_Write_UINT32(s, 8); /* blockLen */ + Stream_Write_UINT16(s, 1); /* numCapsets */ /* TS_RFX_CAPSET */ Stream_Write_UINT16(s, CBY_CAPSET); /* blockType */ - Stream_Write_UINT32(s, 29); /* blockLen */ - Stream_Write_UINT8(s, 0x01); /* codecId (MUST be set to 0x01) */ + Stream_Write_UINT32(s, 29); /* blockLen */ + Stream_Write_UINT8(s, 0x01); /* codecId (MUST be set to 0x01) */ Stream_Write_UINT16(s, CLY_CAPSET); /* capsetType */ - Stream_Write_UINT16(s, 2); /* numIcaps */ - Stream_Write_UINT16(s, 8); /* icapLen */ + Stream_Write_UINT16(s, 2); /* numIcaps */ + Stream_Write_UINT16(s, 8); /* icapLen */ /* TS_RFX_ICAP (RLGR1) */ - Stream_Write_UINT16(s, CLW_VERSION_1_0); /* version */ - Stream_Write_UINT16(s, CT_TILE_64x64); /* tileSize */ - Stream_Write_UINT8(s, codecMode); /* flags */ - Stream_Write_UINT8(s, CLW_COL_CONV_ICT); /* colConvBits */ + Stream_Write_UINT16(s, CLW_VERSION_1_0); /* version */ + Stream_Write_UINT16(s, CT_TILE_64x64); /* tileSize */ + Stream_Write_UINT8(s, codecMode); /* flags */ + Stream_Write_UINT8(s, CLW_COL_CONV_ICT); /* colConvBits */ Stream_Write_UINT8(s, CLW_XFORM_DWT_53_A); /* transformBits */ - Stream_Write_UINT8(s, CLW_ENTROPY_RLGR1); /* entropyBits */ + Stream_Write_UINT8(s, CLW_ENTROPY_RLGR1); /* entropyBits */ /* TS_RFX_ICAP (RLGR3) */ - Stream_Write_UINT16(s, CLW_VERSION_1_0); /* version */ - Stream_Write_UINT16(s, CT_TILE_64x64); /* tileSize */ - Stream_Write_UINT8(s, codecMode); /* flags */ - Stream_Write_UINT8(s, CLW_COL_CONV_ICT); /* colConvBits */ + Stream_Write_UINT16(s, CLW_VERSION_1_0); /* version */ + Stream_Write_UINT16(s, CT_TILE_64x64); /* tileSize */ + Stream_Write_UINT8(s, codecMode); /* flags */ + Stream_Write_UINT8(s, CLW_COL_CONV_ICT); /* colConvBits */ Stream_Write_UINT8(s, CLW_XFORM_DWT_53_A); /* transformBits */ - Stream_Write_UINT8(s, CLW_ENTROPY_RLGR3); /* entropyBits */ + Stream_Write_UINT8(s, CLW_ENTROPY_RLGR3); /* entropyBits */ return TRUE; } @@ -2969,8 +2916,7 @@ static BOOL rdp_write_rfx_client_capability_container(wStream* s, * @param s stream * @param settings settings */ -static BOOL rdp_write_nsc_client_capability_container(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_nsc_client_capability_container(wStream* s, const rdpSettings* settings) { BYTE colorLossLevel; BYTE fAllowSubsampling; @@ -2990,16 +2936,14 @@ static BOOL rdp_write_nsc_client_capability_container(wStream* s, Stream_Write_UINT16(s, 3); /* codecPropertiesLength */ /* TS_NSCODEC_CAPABILITYSET */ - Stream_Write_UINT8(s, - fAllowDynamicFidelity); /* fAllowDynamicFidelity (1 byte) */ - Stream_Write_UINT8(s, fAllowSubsampling); /* fAllowSubsampling (1 byte) */ - Stream_Write_UINT8(s, colorLossLevel); /* colorLossLevel (1 byte) */ + Stream_Write_UINT8(s, fAllowDynamicFidelity); /* fAllowDynamicFidelity (1 byte) */ + Stream_Write_UINT8(s, fAllowSubsampling); /* fAllowSubsampling (1 byte) */ + Stream_Write_UINT8(s, colorLossLevel); /* colorLossLevel (1 byte) */ return TRUE; } #if defined(WITH_JPEG) -static BOOL rdp_write_jpeg_client_capability_container(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_jpeg_client_capability_container(wStream* s, const rdpSettings* settings) { if (!Stream_EnsureRemainingCapacity(s, 8)) return FALSE; @@ -3015,8 +2959,7 @@ static BOOL rdp_write_jpeg_client_capability_container(wStream* s, * @param s stream * @param settings settings */ -static BOOL rdp_write_rfx_server_capability_container(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_rfx_server_capability_container(wStream* s, const rdpSettings* settings) { if (!Stream_EnsureRemainingCapacity(s, 8)) return FALSE; @@ -3026,8 +2969,7 @@ static BOOL rdp_write_rfx_server_capability_container(wStream* s, return TRUE; } -static BOOL rdp_write_jpeg_server_capability_container(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_jpeg_server_capability_container(wStream* s, const rdpSettings* settings) { if (!Stream_EnsureRemainingCapacity(s, 8)) return FALSE; @@ -3042,8 +2984,7 @@ static BOOL rdp_write_jpeg_server_capability_container(wStream* s, * @param s stream * @param settings settings */ -static BOOL rdp_write_nsc_server_capability_container(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_nsc_server_capability_container(wStream* s, const rdpSettings* settings) { if (!Stream_EnsureRemainingCapacity(s, 8)) return FALSE; @@ -3060,8 +3001,7 @@ static BOOL rdp_write_nsc_server_capability_container(wStream* s, * @param settings settings */ -static BOOL rdp_write_bitmap_codecs_capability_set(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_bitmap_codecs_capability_set(wStream* s, const rdpSettings* settings) { size_t header; BYTE bitmapCodecCount; @@ -3186,14 +3126,14 @@ static BOOL rdp_print_bitmap_codecs_capability_set(wStream* s, UINT16 length) BYTE codecId; UINT16 codecPropertiesLength; UINT16 remainingLength; - WLog_INFO(TAG, "BitmapCodecsCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "BitmapCodecsCapabilitySet (length %" PRIu16 "):", length); if (length < 5) return FALSE; Stream_Read_UINT8(s, bitmapCodecCount); /* bitmapCodecCount (1 byte) */ remainingLength = length - 5; - WLog_INFO(TAG, "\tbitmapCodecCount: %"PRIu8"", bitmapCodecCount); + WLog_INFO(TAG, "\tbitmapCodecCount: %" PRIu8 "", bitmapCodecCount); while (bitmapCodecCount > 0) { @@ -3201,14 +3141,13 @@ static BOOL rdp_print_bitmap_codecs_capability_set(wStream* s, UINT16 length) return FALSE; rdp_read_bitmap_codec_guid(s, &codecGuid); /* codecGuid (16 bytes) */ - Stream_Read_UINT8(s, codecId); /* codecId (1 byte) */ - WLog_INFO(TAG, "\tcodecGuid: 0x"); + Stream_Read_UINT8(s, codecId); /* codecId (1 byte) */ + WLog_INFO(TAG, "\tcodecGuid: 0x"); rdp_print_bitmap_codec_guid(&codecGuid); - WLog_INFO(TAG, " (%s)", rdp_get_bitmap_codec_guid_name(&codecGuid)); - WLog_INFO(TAG, "\tcodecId: %"PRIu8"", codecId); - Stream_Read_UINT16(s, - codecPropertiesLength); /* codecPropertiesLength (2 bytes) */ - WLog_INFO(TAG, "\tcodecPropertiesLength: %"PRIu16"", codecPropertiesLength); + WLog_INFO(TAG, " (%s)", rdp_get_bitmap_codec_guid_name(&codecGuid)); + WLog_INFO(TAG, "\tcodecId: %" PRIu8 "", codecId); + Stream_Read_UINT16(s, codecPropertiesLength); /* codecPropertiesLength (2 bytes) */ + WLog_INFO(TAG, "\tcodecPropertiesLength: %" PRIu16 "", codecPropertiesLength); remainingLength -= 19; if (remainingLength < codecPropertiesLength) @@ -3231,7 +3170,7 @@ static BOOL rdp_print_bitmap_codecs_capability_set(wStream* s, UINT16 length) */ static BOOL rdp_read_frame_acknowledge_capability_set(wStream* s, UINT16 length, - rdpSettings* settings) + rdpSettings* settings) { if (length < 8) return FALSE; @@ -3254,8 +3193,7 @@ static BOOL rdp_read_frame_acknowledge_capability_set(wStream* s, UINT16 length, * @param settings settings */ -static BOOL rdp_write_frame_acknowledge_capability_set(wStream* s, - const rdpSettings* settings) +static BOOL rdp_write_frame_acknowledge_capability_set(wStream* s, const rdpSettings* settings) { size_t header; @@ -3269,23 +3207,22 @@ static BOOL rdp_write_frame_acknowledge_capability_set(wStream* s, } #ifdef WITH_DEBUG_CAPABILITIES -static BOOL rdp_print_frame_acknowledge_capability_set(wStream* s, - UINT16 length) +static BOOL rdp_print_frame_acknowledge_capability_set(wStream* s, UINT16 length) { UINT32 frameAcknowledge; - WLog_INFO(TAG, "FrameAcknowledgeCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "FrameAcknowledgeCapabilitySet (length %" PRIu16 "):", length); if (length < 8) return FALSE; Stream_Read_UINT32(s, frameAcknowledge); /* frameAcknowledge (4 bytes) */ - WLog_INFO(TAG, "\tframeAcknowledge: 0x%08"PRIX32"", frameAcknowledge); + WLog_INFO(TAG, "\tframeAcknowledge: 0x%08" PRIX32 "", frameAcknowledge); return TRUE; } #endif -static BOOL rdp_read_bitmap_cache_v3_codec_id_capability_set(wStream* s, - UINT16 length, rdpSettings* settings) +static BOOL rdp_read_bitmap_cache_v3_codec_id_capability_set(wStream* s, UINT16 length, + rdpSettings* settings) { BYTE bitmapCacheV3CodecId; @@ -3297,7 +3234,7 @@ static BOOL rdp_read_bitmap_cache_v3_codec_id_capability_set(wStream* s, } static BOOL rdp_write_bitmap_cache_v3_codec_id_capability_set(wStream* s, - const rdpSettings* settings) + const rdpSettings* settings) { size_t header; @@ -3311,37 +3248,35 @@ static BOOL rdp_write_bitmap_cache_v3_codec_id_capability_set(wStream* s, } #ifdef WITH_DEBUG_CAPABILITIES -static BOOL rdp_print_bitmap_cache_v3_codec_id_capability_set(wStream* s, - UINT16 length) +static BOOL rdp_print_bitmap_cache_v3_codec_id_capability_set(wStream* s, UINT16 length) { BYTE bitmapCacheV3CodecId; - WLog_INFO(TAG, "BitmapCacheV3CodecIdCapabilitySet (length %"PRIu16"):", length); + WLog_INFO(TAG, "BitmapCacheV3CodecIdCapabilitySet (length %" PRIu16 "):", length); if (length < 5) return FALSE; Stream_Read_UINT8(s, bitmapCacheV3CodecId); /* bitmapCacheV3CodecId (1 byte) */ - WLog_INFO(TAG, "\tbitmapCacheV3CodecId: 0x%02"PRIX8"", bitmapCacheV3CodecId); + WLog_INFO(TAG, "\tbitmapCacheV3CodecId: 0x%02" PRIX8 "", bitmapCacheV3CodecId); return TRUE; } -static BOOL rdp_print_capability_sets(wStream* s, UINT16 numberCapabilities, - BOOL receiving) +static BOOL rdp_print_capability_sets(wStream* s, UINT16 numberCapabilities, BOOL receiving) { UINT16 type; UINT16 length; - BYTE* bm, *em; + BYTE *bm, *em; while (numberCapabilities > 0) { Stream_GetPointer(s, bm); rdp_read_capability_set_header(s, &length, &type); - WLog_INFO(TAG, "%s ", receiving ? "Receiving" : "Sending"); + WLog_INFO(TAG, "%s ", receiving ? "Receiving" : "Sending"); em = bm + length; if (Stream_GetRemainingLength(s) < (size_t)(length - 4)) { - WLog_ERR(TAG, "error processing stream"); + WLog_ERR(TAG, "error processing stream"); return FALSE; } @@ -3522,13 +3457,14 @@ static BOOL rdp_print_capability_sets(wStream* s, UINT16 numberCapabilities, break; default: - WLog_ERR(TAG, "unknown capability type %"PRIu16"", type); + WLog_ERR(TAG, "unknown capability type %" PRIu16 "", type); break; } if (Stream_Pointer(s) != em) { - WLog_ERR(TAG, "incorrect offset, type:0x%04"PRIX16" actual:%"PRIuz" expected:%"PRIuz"", + WLog_ERR(TAG, + "incorrect offset, type:0x%04" PRIX16 " actual:%" PRIuz " expected:%" PRIuz "", type, Stream_Pointer(s) - bm, em - bm); } @@ -3540,14 +3476,13 @@ static BOOL rdp_print_capability_sets(wStream* s, UINT16 numberCapabilities, } #endif -static BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, - UINT16 numberCapabilities) +static BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, UINT16 numberCapabilities) { BYTE* mark; UINT16 count; UINT16 type; UINT16 length; - BYTE* bm, *em; + BYTE *bm, *em; BOOL treated; Stream_GetPointer(s, mark); count = numberCapabilities; @@ -3563,14 +3498,14 @@ static BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, } else { - WLog_WARN(TAG, "not handling capability type %"PRIu16" yet", type); + WLog_WARN(TAG, "not handling capability type %" PRIu16 " yet", type); } em = bm + length; - if (Stream_GetRemainingLength(s) < ((size_t) length - 4)) + if (Stream_GetRemainingLength(s) < ((size_t)length - 4)) { - WLog_ERR(TAG, "error processing stream"); + WLog_ERR(TAG, "error processing stream"); return FALSE; } @@ -3759,7 +3694,7 @@ static BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, break; default: - WLog_ERR(TAG, "capability %s(%"PRIu16") not expected from client", + WLog_ERR(TAG, "capability %s(%" PRIu16 ") not expected from client", get_capability_name(type), type); return FALSE; } @@ -3776,7 +3711,7 @@ static BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, break; default: - WLog_ERR(TAG, "capability %s(%"PRIu16") not expected from server", + WLog_ERR(TAG, "capability %s(%" PRIu16 ") not expected from server", get_capability_name(type), type); return FALSE; } @@ -3785,7 +3720,8 @@ static BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, if (Stream_Pointer(s) != em) { - WLog_ERR(TAG, "incorrect offset, type:0x%04"PRIX16" actual:%"PRIuz" expected:%"PRIuz"", + WLog_ERR(TAG, + "incorrect offset, type:0x%04" PRIX16 " actual:%" PRIuz " expected:%" PRIuz "", type, Stream_Pointer(s) - bm, em - bm); } @@ -3796,7 +3732,8 @@ static BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, if (numberCapabilities) { WLog_ERR(TAG, - "strange we haven't read the number of announced capacity sets, read=%d expected=%"PRIu16"", + "strange we haven't read the number of announced capacity sets, read=%d " + "expected=%" PRIu16 "", count - numberCapabilities, count); } @@ -3830,7 +3767,7 @@ BOOL rdp_recv_get_active_header(rdpRdp* rdp, wStream* s, UINT16* pChannelId) { if (!rdp_decrypt(rdp, s, length, securityFlags)) { - WLog_ERR(TAG, "rdp_decrypt failed"); + WLog_ERR(TAG, "rdp_decrypt failed"); return FALSE; } } @@ -3842,7 +3779,7 @@ BOOL rdp_recv_get_active_header(rdpRdp* rdp, wStream* s, UINT16* pChannelId) if ((mcsMessageChannelId == 0) || (*pChannelId != mcsMessageChannelId)) { - WLog_ERR(TAG, "unexpected MCS channel id %04"PRIx16" received", *pChannelId); + WLog_ERR(TAG, "unexpected MCS channel id %04" PRIx16 " received", *pChannelId); return FALSE; } } @@ -3868,7 +3805,7 @@ BOOL rdp_recv_demand_active(rdpRdp* rdp, wStream* s) if (!rdp_read_share_control_header(s, &pduLength, &pduType, &pduSource)) { - WLog_ERR(TAG, "rdp_read_share_control_header failed"); + WLog_ERR(TAG, "rdp_read_share_control_header failed"); return FALSE; } @@ -3887,7 +3824,7 @@ BOOL rdp_recv_demand_active(rdpRdp* rdp, wStream* s) if (pduType != PDU_TYPE_DEMAND_ACTIVE) { if (pduType != PDU_TYPE_SERVER_REDIRECTION) - WLog_ERR(TAG, "expected PDU_TYPE_DEMAND_ACTIVE %04x, got %04"PRIx16"", + WLog_ERR(TAG, "expected PDU_TYPE_DEMAND_ACTIVE %04x, got %04" PRIx16 "", PDU_TYPE_DEMAND_ACTIVE, pduType); return FALSE; @@ -3898,16 +3835,16 @@ BOOL rdp_recv_demand_active(rdpRdp* rdp, wStream* s) if (Stream_GetRemainingLength(s) < 8) return FALSE; - Stream_Read_UINT32(s, rdp->settings->ShareId); /* shareId (4 bytes) */ - Stream_Read_UINT16(s, lengthSourceDescriptor); /* lengthSourceDescriptor (2 bytes) */ + Stream_Read_UINT32(s, rdp->settings->ShareId); /* shareId (4 bytes) */ + Stream_Read_UINT16(s, lengthSourceDescriptor); /* lengthSourceDescriptor (2 bytes) */ Stream_Read_UINT16(s, lengthCombinedCapabilities); /* lengthCombinedCapabilities (2 bytes) */ - if (!Stream_SafeSeek(s, lengthSourceDescriptor) - || Stream_GetRemainingLength(s) < 4) /* sourceDescriptor */ + if (!Stream_SafeSeek(s, lengthSourceDescriptor) || + Stream_GetRemainingLength(s) < 4) /* sourceDescriptor */ return FALSE; Stream_Read_UINT16(s, numberCapabilities); /* numberCapabilities (2 bytes) */ - Stream_Seek(s, 2); /* pad2Octets (2 bytes) */ + Stream_Seek(s, 2); /* pad2Octets (2 bytes) */ /* capabilitySets */ if (!rdp_read_capability_sets(s, rdp->settings, numberCapabilities)) @@ -3930,12 +3867,12 @@ static BOOL rdp_write_demand_active(wStream* s, rdpSettings* settings) return FALSE; Stream_Write_UINT32(s, settings->ShareId); /* shareId (4 bytes) */ - Stream_Write_UINT16(s, 4); /* lengthSourceDescriptor (2 bytes) */ + Stream_Write_UINT16(s, 4); /* lengthSourceDescriptor (2 bytes) */ lm = Stream_GetPosition(s); - Stream_Seek_UINT16(s); /* lengthCombinedCapabilities (2 bytes) */ + Stream_Seek_UINT16(s); /* lengthCombinedCapabilities (2 bytes) */ Stream_Write(s, "RDP", 4); /* sourceDescriptor */ bm = Stream_GetPosition(s); - Stream_Seek_UINT16(s); /* numberCapabilities (2 bytes) */ + Stream_Seek_UINT16(s); /* numberCapabilities (2 bytes) */ Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ numberCapabilities = 14; @@ -3978,8 +3915,8 @@ static BOOL rdp_write_demand_active(wStream* s, rdpSettings* settings) Stream_SetPosition(s, lm); /* go back to lengthCombinedCapabilities */ lengthCombinedCapabilities = (em - bm); Stream_Write_UINT16(s, lengthCombinedCapabilities); /* lengthCombinedCapabilities (2 bytes) */ - Stream_SetPosition(s, bm); /* go back to numberCapabilities */ - Stream_Write_UINT16(s, numberCapabilities); /* numberCapabilities (2 bytes) */ + Stream_SetPosition(s, bm); /* go back to numberCapabilities */ + Stream_Write_UINT16(s, numberCapabilities); /* numberCapabilities (2 bytes) */ #ifdef WITH_DEBUG_CAPABILITIES Stream_Seek_UINT16(s); rdp_print_capability_sets(s, numberCapabilities, FALSE); @@ -4018,17 +3955,17 @@ BOOL rdp_recv_confirm_active(rdpRdp* rdp, wStream* s) if (Stream_GetRemainingLength(s) < 10) return FALSE; - Stream_Seek_UINT32(s); /* shareId (4 bytes) */ - Stream_Seek_UINT16(s); /* originatorId (2 bytes) */ - Stream_Read_UINT16(s, lengthSourceDescriptor); /* lengthSourceDescriptor (2 bytes) */ + Stream_Seek_UINT32(s); /* shareId (4 bytes) */ + Stream_Seek_UINT16(s); /* originatorId (2 bytes) */ + Stream_Read_UINT16(s, lengthSourceDescriptor); /* lengthSourceDescriptor (2 bytes) */ Stream_Read_UINT16(s, lengthCombinedCapabilities); /* lengthCombinedCapabilities (2 bytes) */ - if (((int) Stream_GetRemainingLength(s)) < lengthSourceDescriptor + 4) + if (((int)Stream_GetRemainingLength(s)) < lengthSourceDescriptor + 4) return FALSE; - Stream_Seek(s, lengthSourceDescriptor); /* sourceDescriptor */ + Stream_Seek(s, lengthSourceDescriptor); /* sourceDescriptor */ Stream_Read_UINT16(s, numberCapabilities); /* numberCapabilities (2 bytes) */ - Stream_Seek(s, 2); /* pad2Octets (2 bytes) */ + Stream_Seek(s, 2); /* pad2Octets (2 bytes) */ status = rdp_read_capability_sets(s, rdp->settings, numberCapabilities); if (!settings->ReceivedCapabilities[CAPSET_TYPE_SURFACE_COMMANDS]) @@ -4081,15 +4018,14 @@ BOOL rdp_write_confirm_active(wStream* s, rdpSettings* settings) UINT16 lengthCombinedCapabilities; BOOL ret; lengthSourceDescriptor = sizeof(SOURCE_DESCRIPTOR); - Stream_Write_UINT32(s, settings->ShareId); /* shareId (4 bytes) */ - Stream_Write_UINT16(s, 0x03EA); /* originatorId (2 bytes) */ - Stream_Write_UINT16(s, - lengthSourceDescriptor);/* lengthSourceDescriptor (2 bytes) */ + Stream_Write_UINT32(s, settings->ShareId); /* shareId (4 bytes) */ + Stream_Write_UINT16(s, 0x03EA); /* originatorId (2 bytes) */ + Stream_Write_UINT16(s, lengthSourceDescriptor); /* lengthSourceDescriptor (2 bytes) */ lm = Stream_GetPosition(s); Stream_Seek_UINT16(s); /* lengthCombinedCapabilities (2 bytes) */ Stream_Write(s, SOURCE_DESCRIPTOR, lengthSourceDescriptor); /* sourceDescriptor */ bm = Stream_GetPosition(s); - Stream_Seek_UINT16(s); /* numberCapabilities (2 bytes) */ + Stream_Seek_UINT16(s); /* numberCapabilities (2 bytes) */ Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ /* Capability Sets */ numberCapabilities = 15; @@ -4208,8 +4144,8 @@ BOOL rdp_write_confirm_active(wStream* s, rdpSettings* settings) Stream_SetPosition(s, lm); /* go back to lengthCombinedCapabilities */ lengthCombinedCapabilities = (em - bm); Stream_Write_UINT16(s, lengthCombinedCapabilities); /* lengthCombinedCapabilities (2 bytes) */ - Stream_SetPosition(s, bm); /* go back to numberCapabilities */ - Stream_Write_UINT16(s, numberCapabilities); /* numberCapabilities (2 bytes) */ + Stream_SetPosition(s, bm); /* go back to numberCapabilities */ + Stream_Write_UINT16(s, numberCapabilities); /* numberCapabilities (2 bytes) */ #ifdef WITH_DEBUG_CAPABILITIES Stream_Seek_UINT16(s); rdp_print_capability_sets(s, numberCapabilities, FALSE); diff --git a/libfreerdp/core/capabilities.h b/libfreerdp/core/capabilities.h index 1898c8efb..4174a8e90 100644 --- a/libfreerdp/core/capabilities.h +++ b/libfreerdp/core/capabilities.h @@ -30,142 +30,141 @@ #include /* Capability Set Types */ -#define CAPSET_TYPE_GENERAL 0x0001 -#define CAPSET_TYPE_BITMAP 0x0002 -#define CAPSET_TYPE_ORDER 0x0003 -#define CAPSET_TYPE_BITMAP_CACHE 0x0004 -#define CAPSET_TYPE_CONTROL 0x0005 -#define CAPSET_TYPE_BITMAP_CACHE_V3_CODEC_ID 0x0006 -#define CAPSET_TYPE_ACTIVATION 0x0007 -#define CAPSET_TYPE_POINTER 0x0008 -#define CAPSET_TYPE_SHARE 0x0009 -#define CAPSET_TYPE_COLOR_CACHE 0x000A -#define CAPSET_TYPE_SOUND 0x000C -#define CAPSET_TYPE_INPUT 0x000D -#define CAPSET_TYPE_FONT 0x000E -#define CAPSET_TYPE_BRUSH 0x000F -#define CAPSET_TYPE_GLYPH_CACHE 0x0010 -#define CAPSET_TYPE_OFFSCREEN_CACHE 0x0011 -#define CAPSET_TYPE_BITMAP_CACHE_HOST_SUPPORT 0x0012 -#define CAPSET_TYPE_BITMAP_CACHE_V2 0x0013 -#define CAPSET_TYPE_VIRTUAL_CHANNEL 0x0014 -#define CAPSET_TYPE_DRAW_NINE_GRID_CACHE 0x0015 -#define CAPSET_TYPE_DRAW_GDI_PLUS 0x0016 -#define CAPSET_TYPE_RAIL 0x0017 -#define CAPSET_TYPE_WINDOW 0x0018 -#define CAPSET_TYPE_COMP_DESK 0x0019 -#define CAPSET_TYPE_MULTI_FRAGMENT_UPDATE 0x001A -#define CAPSET_TYPE_LARGE_POINTER 0x001B -#define CAPSET_TYPE_SURFACE_COMMANDS 0x001C -#define CAPSET_TYPE_BITMAP_CODECS 0x001D -#define CAPSET_TYPE_FRAME_ACKNOWLEDGE 0x001E +#define CAPSET_TYPE_GENERAL 0x0001 +#define CAPSET_TYPE_BITMAP 0x0002 +#define CAPSET_TYPE_ORDER 0x0003 +#define CAPSET_TYPE_BITMAP_CACHE 0x0004 +#define CAPSET_TYPE_CONTROL 0x0005 +#define CAPSET_TYPE_BITMAP_CACHE_V3_CODEC_ID 0x0006 +#define CAPSET_TYPE_ACTIVATION 0x0007 +#define CAPSET_TYPE_POINTER 0x0008 +#define CAPSET_TYPE_SHARE 0x0009 +#define CAPSET_TYPE_COLOR_CACHE 0x000A +#define CAPSET_TYPE_SOUND 0x000C +#define CAPSET_TYPE_INPUT 0x000D +#define CAPSET_TYPE_FONT 0x000E +#define CAPSET_TYPE_BRUSH 0x000F +#define CAPSET_TYPE_GLYPH_CACHE 0x0010 +#define CAPSET_TYPE_OFFSCREEN_CACHE 0x0011 +#define CAPSET_TYPE_BITMAP_CACHE_HOST_SUPPORT 0x0012 +#define CAPSET_TYPE_BITMAP_CACHE_V2 0x0013 +#define CAPSET_TYPE_VIRTUAL_CHANNEL 0x0014 +#define CAPSET_TYPE_DRAW_NINE_GRID_CACHE 0x0015 +#define CAPSET_TYPE_DRAW_GDI_PLUS 0x0016 +#define CAPSET_TYPE_RAIL 0x0017 +#define CAPSET_TYPE_WINDOW 0x0018 +#define CAPSET_TYPE_COMP_DESK 0x0019 +#define CAPSET_TYPE_MULTI_FRAGMENT_UPDATE 0x001A +#define CAPSET_TYPE_LARGE_POINTER 0x001B +#define CAPSET_TYPE_SURFACE_COMMANDS 0x001C +#define CAPSET_TYPE_BITMAP_CODECS 0x001D +#define CAPSET_TYPE_FRAME_ACKNOWLEDGE 0x001E -#define CAPSET_HEADER_LENGTH 4 +#define CAPSET_HEADER_LENGTH 4 -#define SOURCE_DESCRIPTOR "FREERDP" +#define SOURCE_DESCRIPTOR "FREERDP" /* Capabilities Protocol Version */ -#define CAPS_PROTOCOL_VERSION 0x0200 +#define CAPS_PROTOCOL_VERSION 0x0200 /* General Capability Flags */ -#define FASTPATH_OUTPUT_SUPPORTED 0x0001 -#define NO_BITMAP_COMPRESSION_HDR 0x0400 -#define LONG_CREDENTIALS_SUPPORTED 0x0004 -#define AUTORECONNECT_SUPPORTED 0x0008 -#define ENC_SALTED_CHECKSUM 0x0010 +#define FASTPATH_OUTPUT_SUPPORTED 0x0001 +#define NO_BITMAP_COMPRESSION_HDR 0x0400 +#define LONG_CREDENTIALS_SUPPORTED 0x0004 +#define AUTORECONNECT_SUPPORTED 0x0008 +#define ENC_SALTED_CHECKSUM 0x0010 /* Drawing Flags */ -#define DRAW_ALLOW_DYNAMIC_COLOR_FIDELITY 0x02 -#define DRAW_ALLOW_COLOR_SUBSAMPLING 0x04 -#define DRAW_ALLOW_SKIP_ALPHA 0x08 +#define DRAW_ALLOW_DYNAMIC_COLOR_FIDELITY 0x02 +#define DRAW_ALLOW_COLOR_SUBSAMPLING 0x04 +#define DRAW_ALLOW_SKIP_ALPHA 0x08 /* Order Flags */ -#define NEGOTIATE_ORDER_SUPPORT 0x0002 -#define ZERO_BOUNDS_DELTA_SUPPORT 0x0008 -#define COLOR_INDEX_SUPPORT 0x0020 -#define SOLID_PATTERN_BRUSH_ONLY 0x0040 -#define ORDER_FLAGS_EXTRA_SUPPORT 0x0080 +#define NEGOTIATE_ORDER_SUPPORT 0x0002 +#define ZERO_BOUNDS_DELTA_SUPPORT 0x0008 +#define COLOR_INDEX_SUPPORT 0x0020 +#define SOLID_PATTERN_BRUSH_ONLY 0x0040 +#define ORDER_FLAGS_EXTRA_SUPPORT 0x0080 /* Extended Order Flags */ -#define CACHE_BITMAP_V3_SUPPORT 0x0002 -#define ALTSEC_FRAME_MARKER_SUPPORT 0x0004 +#define CACHE_BITMAP_V3_SUPPORT 0x0002 +#define ALTSEC_FRAME_MARKER_SUPPORT 0x0004 /* Sound Flags */ -#define SOUND_BEEPS_FLAG 0x0001 +#define SOUND_BEEPS_FLAG 0x0001 /* Input Flags */ -#define INPUT_FLAG_SCANCODES 0x0001 -#define INPUT_FLAG_MOUSEX 0x0004 -#define INPUT_FLAG_FASTPATH_INPUT 0x0008 -#define INPUT_FLAG_UNICODE 0x0010 -#define INPUT_FLAG_FASTPATH_INPUT2 0x0020 -#define TS_INPUT_FLAG_MOUSE_HWHEEL 0x0100 -#define TS_INPUT_FLAG_QOE_TIMESTAMPS 0x0200 +#define INPUT_FLAG_SCANCODES 0x0001 +#define INPUT_FLAG_MOUSEX 0x0004 +#define INPUT_FLAG_FASTPATH_INPUT 0x0008 +#define INPUT_FLAG_UNICODE 0x0010 +#define INPUT_FLAG_FASTPATH_INPUT2 0x0020 +#define TS_INPUT_FLAG_MOUSE_HWHEEL 0x0100 +#define TS_INPUT_FLAG_QOE_TIMESTAMPS 0x0200 /* Font Support Flags */ -#define FONTSUPPORT_FONTLIST 0x0001 +#define FONTSUPPORT_FONTLIST 0x0001 /* Brush Support Level */ -#define BRUSH_DEFAULT 0x00000000 -#define BRUSH_COLOR_8x8 0x00000001 -#define BRUSH_COLOR_FULL 0x00000002 +#define BRUSH_DEFAULT 0x00000000 +#define BRUSH_COLOR_8x8 0x00000001 +#define BRUSH_COLOR_FULL 0x00000002 /* Bitmap Cache Version */ -#define BITMAP_CACHE_V2 0x01 +#define BITMAP_CACHE_V2 0x01 /* Bitmap Cache V2 Flags */ -#define PERSISTENT_KEYS_EXPECTED_FLAG 0x0001 -#define ALLOW_CACHE_WAITING_LIST_FLAG 0x0002 +#define PERSISTENT_KEYS_EXPECTED_FLAG 0x0001 +#define ALLOW_CACHE_WAITING_LIST_FLAG 0x0002 /* Virtual Channel Flags */ -#define VCCAPS_NO_COMPR 0x00000000 -#define VCCAPS_COMPR_SC 0x00000001 -#define VCCAPS_COMPR_CS_8K 0x00000002 +#define VCCAPS_NO_COMPR 0x00000000 +#define VCCAPS_COMPR_SC 0x00000001 +#define VCCAPS_COMPR_CS_8K 0x00000002 /* Draw Nine Grid Support Level */ -#define DRAW_NINEGRID_NO_SUPPORT 0x00000000 -#define DRAW_NINEGRID_SUPPORTED 0x00000001 -#define DRAW_NINEGRID_SUPPORTED_V2 0x00000002 +#define DRAW_NINEGRID_NO_SUPPORT 0x00000000 +#define DRAW_NINEGRID_SUPPORTED 0x00000001 +#define DRAW_NINEGRID_SUPPORTED_V2 0x00000002 /* Draw GDI+ Support Level */ -#define DRAW_GDIPLUS_DEFAULT 0x00000000 -#define DRAW_GDIPLUS_SUPPORTED 0x00000001 +#define DRAW_GDIPLUS_DEFAULT 0x00000000 +#define DRAW_GDIPLUS_SUPPORTED 0x00000001 /* Draw GDI+ Cache Level */ -#define DRAW_GDIPLUS_CACHE_LEVEL_DEFAULT 0x00000000 -#define DRAW_GDIPLUS_CACHE_LEVEL_ONE 0x00000001 +#define DRAW_GDIPLUS_CACHE_LEVEL_DEFAULT 0x00000000 +#define DRAW_GDIPLUS_CACHE_LEVEL_ONE 0x00000001 /* Window Support Level */ -#define WINDOW_LEVEL_NOT_SUPPORTED 0x00000000 -#define WINDOW_LEVEL_SUPPORTED 0x00000001 -#define WINDOW_LEVEL_SUPPORTED_EX 0x00000002 +#define WINDOW_LEVEL_NOT_SUPPORTED 0x00000000 +#define WINDOW_LEVEL_SUPPORTED 0x00000001 +#define WINDOW_LEVEL_SUPPORTED_EX 0x00000002 /* Desktop Composition Support Level */ -#define COMPDESK_NOT_SUPPORTED 0x0000 -#define COMPDESK_SUPPORTED 0x0001 +#define COMPDESK_NOT_SUPPORTED 0x0000 +#define COMPDESK_SUPPORTED 0x0001 /* Large Pointer Support Flags */ -#define LARGE_POINTER_FLAG_96x96 0x00000001 +#define LARGE_POINTER_FLAG_96x96 0x00000001 /* Surface Commands Flags */ -#define SURFCMDS_SET_SURFACE_BITS 0x00000002 -#define SURFCMDS_FRAME_MARKER 0x00000010 -#define SURFCMDS_STREAM_SURFACE_BITS 0x00000040 +#define SURFCMDS_SET_SURFACE_BITS 0x00000002 +#define SURFCMDS_FRAME_MARKER 0x00000010 +#define SURFCMDS_STREAM_SURFACE_BITS 0x00000040 /* Bitmap Codec Constants */ -#define CARDP_CAPS_CAPTURE_NON_CAC 0x00000001 -#define CBY_CAPS 0xCBC0 -#define CBY_CAPSET 0xCBC1 -#define CLY_CAPSET 0xCFC0 -#define CLW_VERSION_1_0 0x0100 -#define CT_TILE_64x64 0x0040 -#define CLW_COL_CONV_ICT 0x1 -#define CLW_XFORM_DWT_53_A 0x1 -#define CLW_ENTROPY_RLGR1 0x01 -#define CLW_ENTROPY_RLGR3 0x04 +#define CARDP_CAPS_CAPTURE_NON_CAC 0x00000001 +#define CBY_CAPS 0xCBC0 +#define CBY_CAPSET 0xCBC1 +#define CLY_CAPSET 0xCFC0 +#define CLW_VERSION_1_0 0x0100 +#define CT_TILE_64x64 0x0040 +#define CLW_COL_CONV_ICT 0x1 +#define CLW_XFORM_DWT_53_A 0x1 +#define CLW_ENTROPY_RLGR1 0x01 +#define CLW_ENTROPY_RLGR3 0x04 -FREERDP_LOCAL BOOL rdp_recv_get_active_header(rdpRdp* rdp, wStream* s, - UINT16* pChannelId); +FREERDP_LOCAL BOOL rdp_recv_get_active_header(rdpRdp* rdp, wStream* s, UINT16* pChannelId); FREERDP_LOCAL BOOL rdp_recv_demand_active(rdpRdp* rdp, wStream* s); FREERDP_LOCAL BOOL rdp_send_demand_active(rdpRdp* rdp); FREERDP_LOCAL BOOL rdp_recv_confirm_active(rdpRdp* rdp, wStream* s); diff --git a/libfreerdp/core/certificate.c b/libfreerdp/core/certificate.c index 913985607..acbcb63ef 100644 --- a/libfreerdp/core/certificate.c +++ b/libfreerdp/core/certificate.c @@ -128,29 +128,25 @@ * */ -static const char* certificate_read_errors[] = -{ - "Certificate tag", - "TBSCertificate", - "Explicit Contextual Tag [0]", - "version", - "CertificateSerialNumber", - "AlgorithmIdentifier", - "Issuer Name", - "Validity", - "Subject Name", - "SubjectPublicKeyInfo Tag", - "subjectPublicKeyInfo::AlgorithmIdentifier", - "subjectPublicKeyInfo::subjectPublicKey", - "RSAPublicKey Tag", - "modulusLength", - "zero padding", - "modulusLength", - "modulus", - "publicExponent length", - "publicExponent" -}; - +static const char* certificate_read_errors[] = { "Certificate tag", + "TBSCertificate", + "Explicit Contextual Tag [0]", + "version", + "CertificateSerialNumber", + "AlgorithmIdentifier", + "Issuer Name", + "Validity", + "Subject Name", + "SubjectPublicKeyInfo Tag", + "subjectPublicKeyInfo::AlgorithmIdentifier", + "subjectPublicKeyInfo::subjectPublicKey", + "RSAPublicKey Tag", + "modulusLength", + "zero padding", + "modulusLength", + "modulus", + "publicExponent length", + "publicExponent" }; /** * Read X.509 Certificate @@ -189,7 +185,7 @@ static BOOL certificate_read_x509_certificate(rdpCertBlob* cert, rdpCertInfo* in error++; - if (!ber_read_contextual_tag(s, 0, &length, TRUE)) /* Explicit Contextual Tag [0] */ + if (!ber_read_contextual_tag(s, 0, &length, TRUE)) /* Explicit Contextual Tag [0] */ goto error1; error++; @@ -276,8 +272,7 @@ static BOOL certificate_read_x509_certificate(rdpCertBlob* cert, rdpCertInfo* in modulus_length--; } - } - while (padding == 0); + } while (padding == 0); error++; @@ -288,7 +283,7 @@ static BOOL certificate_read_x509_certificate(rdpCertBlob* cert, rdpCertInfo* in goto error1; info->ModulusLength = (UINT32)modulus_length; - info->Modulus = (BYTE*) malloc(info->ModulusLength); + info->Modulus = (BYTE*)malloc(info->ModulusLength); if (!info->Modulus) goto error1; @@ -328,13 +323,13 @@ error1: static rdpX509CertChain* certificate_new_x509_certificate_chain(UINT32 count) { rdpX509CertChain* x509_cert_chain; - x509_cert_chain = (rdpX509CertChain*) malloc(sizeof(rdpX509CertChain)); + x509_cert_chain = (rdpX509CertChain*)malloc(sizeof(rdpX509CertChain)); if (!x509_cert_chain) return NULL; x509_cert_chain->count = count; - x509_cert_chain->array = (rdpCertBlob*) calloc(count, sizeof(rdpCertBlob)); + x509_cert_chain->array = (rdpCertBlob*)calloc(count, sizeof(rdpCertBlob)); if (!x509_cert_chain->array) { @@ -367,7 +362,7 @@ static void certificate_free_x509_certificate_chain(rdpX509CertChain* x509_cert_ } static BOOL certificate_process_server_public_key(rdpCertificate* certificate, wStream* s, - UINT32 length) + UINT32 length) { BYTE magic[4]; UINT32 keylen; @@ -405,7 +400,8 @@ static BOOL certificate_process_server_public_key(rdpCertificate* certificate, w } static BOOL certificate_process_server_public_signature(rdpCertificate* certificate, - const BYTE* sigdata, size_t sigdatalen, wStream* s, UINT32 siglen) + const BYTE* sigdata, size_t sigdatalen, + wStream* s, UINT32 siglen) { #if defined(CERT_VALIDATE_PADDING) || defined(CERT_VALIDATE_RSA) size_t i, sum; @@ -422,10 +418,12 @@ static BOOL certificate_process_server_public_signature(rdpCertificate* certific (void)sigdatalen; #endif (void)certificate; - /* Do not bother with validation of server proprietary certificate. The use of MD5 here is not allowed under FIPS. - * Since the validation is not protecting against anything since the private/public keys are well known and documented in - * MS-RDPBCGR section 5.3.3.1, we are not gaining any security by using MD5 for signature comparison. Rather then use MD5 - * here we just dont do the validation to avoid its use. Historically, freerdp has been ignoring a failed validation anyways. */ + /* Do not bother with validation of server proprietary certificate. The use of MD5 here is not + * allowed under FIPS. Since the validation is not protecting against anything since the + * private/public keys are well known and documented in MS-RDPBCGR section 5.3.3.1, we are not + * gaining any security by using MD5 for signature comparison. Rather then use MD5 + * here we just dont do the validation to avoid its use. Historically, freerdp has been ignoring + * a failed validation anyways. */ #if defined(CERT_VALIDATE_MD5) if (!winpr_Digest(WINPR_MD_MD5, sigdata, sigdatalen, md5hash, sizeof(md5hash))) @@ -437,7 +435,7 @@ static BOOL certificate_process_server_public_signature(rdpCertificate* certific if (siglen < 8) return FALSE; - /* Last 8 bytes shall be all zero. */ + /* Last 8 bytes shall be all zero. */ #if defined(CERT_VALIDATE_PADDING) for (sum = 0, i = sizeof(encsig) - 8; i < sizeof(encsig); i++) @@ -517,7 +515,9 @@ static BOOL certificate_read_server_proprietary_certificate(rdpCertificate* cert if (!((dwSigAlgId == SIGNATURE_ALG_RSA) && (dwKeyAlgId == KEY_EXCHANGE_ALG_RSA))) { - WLog_ERR(TAG, "unsupported signature or key algorithm, dwSigAlgId=%"PRIu32" dwKeyAlgId=%"PRIu32"", + WLog_ERR(TAG, + "unsupported signature or key algorithm, dwSigAlgId=%" PRIu32 + " dwKeyAlgId=%" PRIu32 "", dwSigAlgId, dwKeyAlgId); return FALSE; } @@ -526,7 +526,7 @@ static BOOL certificate_read_server_proprietary_certificate(rdpCertificate* cert if (wPublicKeyBlobType != BB_RSA_KEY_BLOB) { - WLog_ERR(TAG, "unsupported public key blob type %"PRIu16"", wPublicKeyBlobType); + WLog_ERR(TAG, "unsupported public key blob type %" PRIu16 "", wPublicKeyBlobType); return FALSE; } @@ -534,7 +534,7 @@ static BOOL certificate_read_server_proprietary_certificate(rdpCertificate* cert if (Stream_GetRemainingLength(s) < wPublicKeyBlobLen) { - WLog_ERR(TAG, "not enough bytes for public key(len=%"PRIu16")", wPublicKeyBlobLen); + WLog_ERR(TAG, "not enough bytes for public key(len=%" PRIu16 ")", wPublicKeyBlobLen); return FALSE; } @@ -552,7 +552,7 @@ static BOOL certificate_read_server_proprietary_certificate(rdpCertificate* cert if (wSignatureBlobType != BB_RSA_SIGNATURE_BLOB) { - WLog_ERR(TAG, "unsupported blob signature %"PRIu16"", wSignatureBlobType); + WLog_ERR(TAG, "unsupported blob signature %" PRIu16 "", wSignatureBlobType); return FALSE; } @@ -560,18 +560,18 @@ static BOOL certificate_read_server_proprietary_certificate(rdpCertificate* cert if (Stream_GetRemainingLength(s) < wSignatureBlobLen) { - WLog_ERR(TAG, "not enough bytes for signature(len=%"PRIu16")", wSignatureBlobLen); + WLog_ERR(TAG, "not enough bytes for signature(len=%" PRIu16 ")", wSignatureBlobLen); return FALSE; } if (wSignatureBlobLen != 72) { - WLog_ERR(TAG, "invalid signature length (got %"PRIu16", expected 72)", wSignatureBlobLen); + WLog_ERR(TAG, "invalid signature length (got %" PRIu16 ", expected 72)", wSignatureBlobLen); return FALSE; } if (!certificate_process_server_public_signature(certificate, sigdata, sigdatalen, s, - wSignatureBlobLen)) + wSignatureBlobLen)) { WLog_ERR(TAG, "unable to parse server public signature"); return FALSE; @@ -613,8 +613,8 @@ static BOOL certificate_read_server_x509_certificate_chain(rdpCertificate* certi if (Stream_GetRemainingLength(s) < certLength) return FALSE; - DEBUG_CERTIFICATE("X.509 Certificate #%d, length:%"PRIu32"", i + 1, certLength); - certificate->x509_cert_chain->array[i].data = (BYTE*) malloc(certLength); + DEBUG_CERTIFICATE("X.509 Certificate #%d, length:%" PRIu32 "", i + 1, certLength); + certificate->x509_cert_chain->array[i].data = (BYTE*)malloc(certLength); if (!certificate->x509_cert_chain->array[i].data) return FALSE; @@ -626,8 +626,9 @@ static BOOL certificate_read_server_x509_certificate_chain(rdpCertificate* certi { rdpCertInfo cert_info = { 0 }; DEBUG_CERTIFICATE("License Server Certificate"); - ret = certificate_read_x509_certificate(&certificate->x509_cert_chain->array[i], &cert_info); - DEBUG_LICENSE("modulus length:%"PRIu32"", cert_info.ModulusLength); + ret = certificate_read_x509_certificate(&certificate->x509_cert_chain->array[i], + &cert_info); + DEBUG_LICENSE("modulus length:%" PRIu32 "", cert_info.ModulusLength); free(cert_info.Modulus); if (!ret) @@ -646,7 +647,7 @@ static BOOL certificate_read_server_x509_certificate_chain(rdpCertificate* certi &certificate->cert_info)) return FALSE; - DEBUG_CERTIFICATE("modulus length:%"PRIu32"", certificate->cert_info.ModulusLength); + DEBUG_CERTIFICATE("modulus length:%" PRIu32 "", certificate->cert_info.ModulusLength); } } @@ -661,13 +662,13 @@ static BOOL certificate_read_server_x509_certificate_chain(rdpCertificate* certi */ BOOL certificate_read_server_certificate(rdpCertificate* certificate, BYTE* server_cert, - size_t length) + size_t length) { BOOL ret; wStream* s; UINT32 dwVersion; - if (length < 4) /* NULL certificate is not an error see #1795 */ + if (length < 4) /* NULL certificate is not an error see #1795 */ return TRUE; s = Stream_New(server_cert, length); @@ -691,7 +692,8 @@ BOOL certificate_read_server_certificate(rdpCertificate* certificate, BYTE* serv break; default: - WLog_ERR(TAG, "invalid certificate chain version:%"PRIu32"", dwVersion & CERT_CHAIN_VERSION_MASK); + WLog_ERR(TAG, "invalid certificate chain version:%" PRIu32 "", + dwVersion & CERT_CHAIN_VERSION_MASK); ret = FALSE; break; } @@ -708,7 +710,7 @@ rdpRsaKey* key_new_from_content(const char* keycontent, const char* keyfile) const BIGNUM* rsa_e = NULL; const BIGNUM* rsa_n = NULL; const BIGNUM* rsa_d = NULL; - key = (rdpRsaKey*) calloc(1, sizeof(rdpRsaKey)); + key = (rdpRsaKey*)calloc(1, sizeof(rdpRsaKey)); if (!key) return NULL; @@ -738,7 +740,8 @@ rdpRsaKey* key_new_from_content(const char* keycontent, const char* keyfile) break; default: - WLog_ERR(TAG, "unexpected error when checking RSA key from %s: %s.", keyfile, strerror(errno)); + WLog_ERR(TAG, "unexpected error when checking RSA key from %s: %s.", keyfile, + strerror(errno)); goto out_free_rsa; } @@ -751,7 +754,7 @@ rdpRsaKey* key_new_from_content(const char* keycontent, const char* keyfile) } key->ModulusLength = BN_num_bytes(rsa_n); - key->Modulus = (BYTE*) malloc(key->ModulusLength); + key->Modulus = (BYTE*)malloc(key->ModulusLength); if (!key->Modulus) goto out_free_rsa; @@ -759,7 +762,7 @@ rdpRsaKey* key_new_from_content(const char* keycontent, const char* keyfile) BN_bn2bin(rsa_n, key->Modulus); crypto_reverse(key->Modulus, key->ModulusLength); key->PrivateExponentLength = BN_num_bytes(rsa_d); - key->PrivateExponent = (BYTE*) malloc(key->PrivateExponentLength); + key->PrivateExponent = (BYTE*)malloc(key->PrivateExponentLength); if (!key->PrivateExponent) goto out_free_modulus; @@ -780,7 +783,6 @@ out_free: return NULL; } - rdpRsaKey* key_new(const char* keyfile) { FILE* fp = NULL; @@ -809,7 +811,7 @@ rdpRsaKey* key_new(const char* keyfile) if (!buffer) goto out_free; - if (fread((void*) buffer, length, 1, fp) != 1) + if (fread((void*)buffer, length, 1, fp) != 1) goto out_free; fclose(fp); @@ -828,7 +830,7 @@ out_free: rdpRsaKey* key_clone(const rdpRsaKey* key) { - rdpRsaKey* _key = (rdpRsaKey*) calloc(1, sizeof(rdpRsaKey)); + rdpRsaKey* _key = (rdpRsaKey*)calloc(1, sizeof(rdpRsaKey)); if (!_key) return NULL; @@ -837,7 +839,7 @@ rdpRsaKey* key_clone(const rdpRsaKey* key) if (key->Modulus) { - _key->Modulus = (BYTE*) malloc(key->ModulusLength); + _key->Modulus = (BYTE*)malloc(key->ModulusLength); if (!_key->Modulus) goto out_fail; @@ -847,7 +849,7 @@ rdpRsaKey* key_clone(const rdpRsaKey* key) if (key->PrivateExponent) { - _key->PrivateExponent = (BYTE*) malloc(key->PrivateExponentLength); + _key->PrivateExponent = (BYTE*)malloc(key->PrivateExponentLength); if (!_key->PrivateExponent) goto out_fail; @@ -863,7 +865,6 @@ out_fail: return NULL; } - void key_free(rdpRsaKey* key) { if (!key) @@ -877,7 +878,7 @@ void key_free(rdpRsaKey* key) rdpCertificate* certificate_clone(rdpCertificate* certificate) { UINT32 index; - rdpCertificate* _certificate = (rdpCertificate*) calloc(1, sizeof(rdpCertificate)); + rdpCertificate* _certificate = (rdpCertificate*)calloc(1, sizeof(rdpCertificate)); if (!_certificate) return NULL; @@ -886,7 +887,7 @@ rdpCertificate* certificate_clone(rdpCertificate* certificate) if (certificate->cert_info.ModulusLength) { - _certificate->cert_info.Modulus = (BYTE*) malloc(certificate->cert_info.ModulusLength); + _certificate->cert_info.Modulus = (BYTE*)malloc(certificate->cert_info.ModulusLength); if (!_certificate->cert_info.Modulus) goto out_fail; @@ -898,17 +899,18 @@ rdpCertificate* certificate_clone(rdpCertificate* certificate) if (certificate->x509_cert_chain) { - _certificate->x509_cert_chain = (rdpX509CertChain*) malloc(sizeof(rdpX509CertChain)); + _certificate->x509_cert_chain = (rdpX509CertChain*)malloc(sizeof(rdpX509CertChain)); if (!_certificate->x509_cert_chain) goto out_fail; - CopyMemory(_certificate->x509_cert_chain, certificate->x509_cert_chain, sizeof(rdpX509CertChain)); + CopyMemory(_certificate->x509_cert_chain, certificate->x509_cert_chain, + sizeof(rdpX509CertChain)); if (certificate->x509_cert_chain->count) { - _certificate->x509_cert_chain->array = (rdpCertBlob*) calloc(certificate->x509_cert_chain->count, - sizeof(rdpCertBlob)); + _certificate->x509_cert_chain->array = + (rdpCertBlob*)calloc(certificate->x509_cert_chain->count, sizeof(rdpCertBlob)); if (!_certificate->x509_cert_chain->array) goto out_fail; @@ -920,15 +922,15 @@ rdpCertificate* certificate_clone(rdpCertificate* certificate) if (certificate->x509_cert_chain->array[index].length) { - _certificate->x509_cert_chain->array[index].data = (BYTE*) malloc( - certificate->x509_cert_chain->array[index].length); + _certificate->x509_cert_chain->array[index].data = + (BYTE*)malloc(certificate->x509_cert_chain->array[index].length); if (!_certificate->x509_cert_chain->array[index].data) { for (; index > 0; --index) { - if (certificate->x509_cert_chain->array[index-1].length) - free(_certificate->x509_cert_chain->array[index-1].data); + if (certificate->x509_cert_chain->array[index - 1].length) + free(_certificate->x509_cert_chain->array[index - 1].data); } goto out_fail; @@ -964,7 +966,7 @@ out_fail: rdpCertificate* certificate_new(void) { - return (rdpCertificate*) calloc(1, sizeof(rdpCertificate)); + return (rdpCertificate*)calloc(1, sizeof(rdpCertificate)); } /** diff --git a/libfreerdp/core/certificate.h b/libfreerdp/core/certificate.h index ece4fbe11..2a3eca1dd 100644 --- a/libfreerdp/core/certificate.h +++ b/libfreerdp/core/certificate.h @@ -33,20 +33,20 @@ #include /* Certificate Version */ -#define CERT_CHAIN_VERSION_1 0x00000001 -#define CERT_CHAIN_VERSION_2 0x00000002 -#define CERT_CHAIN_VERSION_MASK 0x7FFFFFFF -#define CERT_PERMANENTLY_ISSUED 0x00000000 -#define CERT_TEMPORARILY_ISSUED 0x80000000 +#define CERT_CHAIN_VERSION_1 0x00000001 +#define CERT_CHAIN_VERSION_2 0x00000002 +#define CERT_CHAIN_VERSION_MASK 0x7FFFFFFF +#define CERT_PERMANENTLY_ISSUED 0x00000000 +#define CERT_TEMPORARILY_ISSUED 0x80000000 -#define SIGNATURE_ALG_RSA 0x00000001 -#define KEY_EXCHANGE_ALG_RSA 0x00000001 +#define SIGNATURE_ALG_RSA 0x00000001 +#define KEY_EXCHANGE_ALG_RSA 0x00000001 -#define BB_RSA_KEY_BLOB 6 -#define BB_RSA_SIGNATURE_BLOB 8 +#define BB_RSA_KEY_BLOB 6 +#define BB_RSA_SIGNATURE_BLOB 8 -FREERDP_LOCAL BOOL certificate_read_server_certificate(rdpCertificate* - certificate, BYTE* server_cert, size_t length); +FREERDP_LOCAL BOOL certificate_read_server_certificate(rdpCertificate* certificate, + BYTE* server_cert, size_t length); FREERDP_LOCAL rdpCertificate* certificate_clone(rdpCertificate* certificate); @@ -54,8 +54,7 @@ FREERDP_LOCAL rdpCertificate* certificate_new(void); FREERDP_LOCAL void certificate_free(rdpCertificate* certificate); FREERDP_LOCAL rdpRsaKey* key_new(const char* keyfile); -FREERDP_LOCAL rdpRsaKey* key_new_from_content(const char* keycontent, - const char* keyfile); +FREERDP_LOCAL rdpRsaKey* key_new_from_content(const char* keycontent, const char* keyfile); FREERDP_LOCAL void key_free(rdpRsaKey* key); FREERDP_LOCAL rdpRsaKey* key_clone(const rdpRsaKey* key); @@ -63,7 +62,10 @@ FREERDP_LOCAL rdpRsaKey* key_clone(const rdpRsaKey* key); #ifdef WITH_DEBUG_CERTIFICATE #define DEBUG_CERTIFICATE(...) WLog_DBG(CERTIFICATE_TAG, __VA_ARGS__) #else -#define DEBUG_CERTIFICATE(...) do { } while (0) +#define DEBUG_CERTIFICATE(...) \ + do \ + { \ + } while (0) #endif #endif /* FREERDP_LIB_CORE_CERTIFICATE_H */ diff --git a/libfreerdp/core/channels.c b/libfreerdp/core/channels.c index da2d72ae3..e22ca8ddb 100644 --- a/libfreerdp/core/channels.c +++ b/libfreerdp/core/channels.c @@ -70,7 +70,7 @@ BOOL freerdp_channel_send(rdpRdp* rdp, UINT16 channelId, const BYTE* data, int s if (!channel) { - WLog_ERR(TAG, "freerdp_channel_send: unknown channelId %"PRIu16"", channelId); + WLog_ERR(TAG, "freerdp_channel_send: unknown channelId %" PRIu16 "", channelId); return FALSE; } @@ -84,7 +84,7 @@ BOOL freerdp_channel_send(rdpRdp* rdp, UINT16 channelId, const BYTE* data, int s if (!s) return FALSE; - if (left > (int) rdp->settings->VirtualChannelChunkSize) + if (left > (int)rdp->settings->VirtualChannelChunkSize) { chunkSize = rdp->settings->VirtualChannelChunkSize; } @@ -134,13 +134,12 @@ BOOL freerdp_channel_process(freerdp* instance, wStream* s, UINT16 channelId) Stream_Read_UINT32(s, length); Stream_Read_UINT32(s, flags); chunkLength = Stream_GetRemainingLength(s); - IFCALL(instance->ReceiveChannelData, instance, - channelId, Stream_Pointer(s), chunkLength, flags, length); + IFCALL(instance->ReceiveChannelData, instance, channelId, Stream_Pointer(s), chunkLength, flags, + length); return TRUE; } -BOOL freerdp_channel_peer_process(freerdp_peer* client, wStream* s, - UINT16 channelId) +BOOL freerdp_channel_peer_process(freerdp_peer* client, wStream* s, UINT16 channelId) { UINT32 length; UINT32 flags; @@ -168,7 +167,7 @@ BOOL freerdp_channel_peer_process(freerdp_peer* client, wStream* s, if (mcsChannel->ChannelId == channelId) { - hChannel = (HANDLE) mcsChannel->handle; + hChannel = (HANDLE)mcsChannel->handle; found = TRUE; break; } @@ -182,81 +181,80 @@ BOOL freerdp_channel_peer_process(freerdp_peer* client, wStream* s, } else if (client->ReceiveChannelData) { - client->ReceiveChannelData(client, channelId, Stream_Pointer(s), chunkLength, - flags, length); + client->ReceiveChannelData(client, channelId, Stream_Pointer(s), chunkLength, flags, + length); } return TRUE; } -static const WtsApiFunctionTable FreeRDP_WtsApiFunctionTable = -{ +static const WtsApiFunctionTable FreeRDP_WtsApiFunctionTable = { 0, /* dwVersion */ 0, /* dwFlags */ - FreeRDP_WTSStopRemoteControlSession, /* StopRemoteControlSession */ - FreeRDP_WTSStartRemoteControlSessionW, /* StartRemoteControlSessionW */ - FreeRDP_WTSStartRemoteControlSessionA, /* StartRemoteControlSessionA */ - FreeRDP_WTSConnectSessionW, /* ConnectSessionW */ - FreeRDP_WTSConnectSessionA, /* ConnectSessionA */ - FreeRDP_WTSEnumerateServersW, /* EnumerateServersW */ - FreeRDP_WTSEnumerateServersA, /* EnumerateServersA */ - FreeRDP_WTSOpenServerW, /* OpenServerW */ - FreeRDP_WTSOpenServerA, /* OpenServerA */ - FreeRDP_WTSOpenServerExW, /* OpenServerExW */ - FreeRDP_WTSOpenServerExA, /* OpenServerExA */ - FreeRDP_WTSCloseServer, /* CloseServer */ - FreeRDP_WTSEnumerateSessionsW, /* EnumerateSessionsW */ - FreeRDP_WTSEnumerateSessionsA, /* EnumerateSessionsA */ - FreeRDP_WTSEnumerateSessionsExW, /* EnumerateSessionsExW */ - FreeRDP_WTSEnumerateSessionsExA, /* EnumerateSessionsExA */ - FreeRDP_WTSEnumerateProcessesW, /* EnumerateProcessesW */ - FreeRDP_WTSEnumerateProcessesA, /* EnumerateProcessesA */ - FreeRDP_WTSTerminateProcess, /* TerminateProcess */ - FreeRDP_WTSQuerySessionInformationW, /* QuerySessionInformationW */ - FreeRDP_WTSQuerySessionInformationA, /* QuerySessionInformationA */ - FreeRDP_WTSQueryUserConfigW, /* QueryUserConfigW */ - FreeRDP_WTSQueryUserConfigA, /* QueryUserConfigA */ - FreeRDP_WTSSetUserConfigW, /* SetUserConfigW */ - FreeRDP_WTSSetUserConfigA, /* SetUserConfigA */ - FreeRDP_WTSSendMessageW, /* SendMessageW */ - FreeRDP_WTSSendMessageA, /* SendMessageA */ - FreeRDP_WTSDisconnectSession, /* DisconnectSession */ - FreeRDP_WTSLogoffSession, /* LogoffSession */ - FreeRDP_WTSShutdownSystem, /* ShutdownSystem */ - FreeRDP_WTSWaitSystemEvent, /* WaitSystemEvent */ - FreeRDP_WTSVirtualChannelOpen, /* VirtualChannelOpen */ - FreeRDP_WTSVirtualChannelOpenEx, /* VirtualChannelOpenEx */ - FreeRDP_WTSVirtualChannelClose, /* VirtualChannelClose */ - FreeRDP_WTSVirtualChannelRead, /* VirtualChannelRead */ - FreeRDP_WTSVirtualChannelWrite, /* VirtualChannelWrite */ - FreeRDP_WTSVirtualChannelPurgeInput, /* VirtualChannelPurgeInput */ - FreeRDP_WTSVirtualChannelPurgeOutput, /* VirtualChannelPurgeOutput */ - FreeRDP_WTSVirtualChannelQuery, /* VirtualChannelQuery */ - FreeRDP_WTSFreeMemory, /* FreeMemory */ - FreeRDP_WTSRegisterSessionNotification, /* RegisterSessionNotification */ - FreeRDP_WTSUnRegisterSessionNotification, /* UnRegisterSessionNotification */ - FreeRDP_WTSRegisterSessionNotificationEx, /* RegisterSessionNotificationEx */ + FreeRDP_WTSStopRemoteControlSession, /* StopRemoteControlSession */ + FreeRDP_WTSStartRemoteControlSessionW, /* StartRemoteControlSessionW */ + FreeRDP_WTSStartRemoteControlSessionA, /* StartRemoteControlSessionA */ + FreeRDP_WTSConnectSessionW, /* ConnectSessionW */ + FreeRDP_WTSConnectSessionA, /* ConnectSessionA */ + FreeRDP_WTSEnumerateServersW, /* EnumerateServersW */ + FreeRDP_WTSEnumerateServersA, /* EnumerateServersA */ + FreeRDP_WTSOpenServerW, /* OpenServerW */ + FreeRDP_WTSOpenServerA, /* OpenServerA */ + FreeRDP_WTSOpenServerExW, /* OpenServerExW */ + FreeRDP_WTSOpenServerExA, /* OpenServerExA */ + FreeRDP_WTSCloseServer, /* CloseServer */ + FreeRDP_WTSEnumerateSessionsW, /* EnumerateSessionsW */ + FreeRDP_WTSEnumerateSessionsA, /* EnumerateSessionsA */ + FreeRDP_WTSEnumerateSessionsExW, /* EnumerateSessionsExW */ + FreeRDP_WTSEnumerateSessionsExA, /* EnumerateSessionsExA */ + FreeRDP_WTSEnumerateProcessesW, /* EnumerateProcessesW */ + FreeRDP_WTSEnumerateProcessesA, /* EnumerateProcessesA */ + FreeRDP_WTSTerminateProcess, /* TerminateProcess */ + FreeRDP_WTSQuerySessionInformationW, /* QuerySessionInformationW */ + FreeRDP_WTSQuerySessionInformationA, /* QuerySessionInformationA */ + FreeRDP_WTSQueryUserConfigW, /* QueryUserConfigW */ + FreeRDP_WTSQueryUserConfigA, /* QueryUserConfigA */ + FreeRDP_WTSSetUserConfigW, /* SetUserConfigW */ + FreeRDP_WTSSetUserConfigA, /* SetUserConfigA */ + FreeRDP_WTSSendMessageW, /* SendMessageW */ + FreeRDP_WTSSendMessageA, /* SendMessageA */ + FreeRDP_WTSDisconnectSession, /* DisconnectSession */ + FreeRDP_WTSLogoffSession, /* LogoffSession */ + FreeRDP_WTSShutdownSystem, /* ShutdownSystem */ + FreeRDP_WTSWaitSystemEvent, /* WaitSystemEvent */ + FreeRDP_WTSVirtualChannelOpen, /* VirtualChannelOpen */ + FreeRDP_WTSVirtualChannelOpenEx, /* VirtualChannelOpenEx */ + FreeRDP_WTSVirtualChannelClose, /* VirtualChannelClose */ + FreeRDP_WTSVirtualChannelRead, /* VirtualChannelRead */ + FreeRDP_WTSVirtualChannelWrite, /* VirtualChannelWrite */ + FreeRDP_WTSVirtualChannelPurgeInput, /* VirtualChannelPurgeInput */ + FreeRDP_WTSVirtualChannelPurgeOutput, /* VirtualChannelPurgeOutput */ + FreeRDP_WTSVirtualChannelQuery, /* VirtualChannelQuery */ + FreeRDP_WTSFreeMemory, /* FreeMemory */ + FreeRDP_WTSRegisterSessionNotification, /* RegisterSessionNotification */ + FreeRDP_WTSUnRegisterSessionNotification, /* UnRegisterSessionNotification */ + FreeRDP_WTSRegisterSessionNotificationEx, /* RegisterSessionNotificationEx */ FreeRDP_WTSUnRegisterSessionNotificationEx, /* UnRegisterSessionNotificationEx */ - FreeRDP_WTSQueryUserToken, /* QueryUserToken */ - FreeRDP_WTSFreeMemoryExW, /* FreeMemoryExW */ - FreeRDP_WTSFreeMemoryExA, /* FreeMemoryExA */ - FreeRDP_WTSEnumerateProcessesExW, /* EnumerateProcessesExW */ - FreeRDP_WTSEnumerateProcessesExA, /* EnumerateProcessesExA */ - FreeRDP_WTSEnumerateListenersW, /* EnumerateListenersW */ - FreeRDP_WTSEnumerateListenersA, /* EnumerateListenersA */ - FreeRDP_WTSQueryListenerConfigW, /* QueryListenerConfigW */ - FreeRDP_WTSQueryListenerConfigA, /* QueryListenerConfigA */ - FreeRDP_WTSCreateListenerW, /* CreateListenerW */ - FreeRDP_WTSCreateListenerA, /* CreateListenerA */ - FreeRDP_WTSSetListenerSecurityW, /* SetListenerSecurityW */ - FreeRDP_WTSSetListenerSecurityA, /* SetListenerSecurityA */ - FreeRDP_WTSGetListenerSecurityW, /* GetListenerSecurityW */ - FreeRDP_WTSGetListenerSecurityA, /* GetListenerSecurityA */ - FreeRDP_WTSEnableChildSessions, /* EnableChildSessions */ - FreeRDP_WTSIsChildSessionsEnabled, /* IsChildSessionsEnabled */ - FreeRDP_WTSGetChildSessionId, /* GetChildSessionId */ - FreeRDP_WTSGetActiveConsoleSessionId, /* GetActiveConsoleSessionId */ + FreeRDP_WTSQueryUserToken, /* QueryUserToken */ + FreeRDP_WTSFreeMemoryExW, /* FreeMemoryExW */ + FreeRDP_WTSFreeMemoryExA, /* FreeMemoryExA */ + FreeRDP_WTSEnumerateProcessesExW, /* EnumerateProcessesExW */ + FreeRDP_WTSEnumerateProcessesExA, /* EnumerateProcessesExA */ + FreeRDP_WTSEnumerateListenersW, /* EnumerateListenersW */ + FreeRDP_WTSEnumerateListenersA, /* EnumerateListenersA */ + FreeRDP_WTSQueryListenerConfigW, /* QueryListenerConfigW */ + FreeRDP_WTSQueryListenerConfigA, /* QueryListenerConfigA */ + FreeRDP_WTSCreateListenerW, /* CreateListenerW */ + FreeRDP_WTSCreateListenerA, /* CreateListenerA */ + FreeRDP_WTSSetListenerSecurityW, /* SetListenerSecurityW */ + FreeRDP_WTSSetListenerSecurityA, /* SetListenerSecurityA */ + FreeRDP_WTSGetListenerSecurityW, /* GetListenerSecurityW */ + FreeRDP_WTSGetListenerSecurityA, /* GetListenerSecurityA */ + FreeRDP_WTSEnableChildSessions, /* EnableChildSessions */ + FreeRDP_WTSIsChildSessionsEnabled, /* IsChildSessionsEnabled */ + FreeRDP_WTSGetChildSessionId, /* GetChildSessionId */ + FreeRDP_WTSGetActiveConsoleSessionId, /* GetActiveConsoleSessionId */ FreeRDP_WTSLogonUser, FreeRDP_WTSLogoffUser, FreeRDP_WTSStartRemoteControlSessionExW, diff --git a/libfreerdp/core/channels.h b/libfreerdp/core/channels.h index 2500c8445..b44e7d5d1 100644 --- a/libfreerdp/core/channels.h +++ b/libfreerdp/core/channels.h @@ -23,11 +23,8 @@ #include #include "client.h" -FREERDP_LOCAL BOOL freerdp_channel_send(rdpRdp* rdp, UINT16 channelId, - const BYTE* data, int size); -FREERDP_LOCAL BOOL freerdp_channel_process(freerdp* instance, wStream* s, - UINT16 channelId); -FREERDP_LOCAL BOOL freerdp_channel_peer_process(freerdp_peer* client, - wStream* s, UINT16 channelId); +FREERDP_LOCAL BOOL freerdp_channel_send(rdpRdp* rdp, UINT16 channelId, const BYTE* data, int size); +FREERDP_LOCAL BOOL freerdp_channel_process(freerdp* instance, wStream* s, UINT16 channelId); +FREERDP_LOCAL BOOL freerdp_channel_peer_process(freerdp_peer* client, wStream* s, UINT16 channelId); #endif /* FREERDP_LIB_CORE_CHANNELS_H */ diff --git a/libfreerdp/core/client.c b/libfreerdp/core/client.c index 4e50552c0..3e338d625 100644 --- a/libfreerdp/core/client.c +++ b/libfreerdp/core/client.c @@ -40,8 +40,8 @@ static WINPR_TLS rdpChannelHandles g_ChannelHandles = { NULL, NULL }; static BOOL freerdp_channels_process_message_free(wMessage* message, DWORD type); -static CHANNEL_OPEN_DATA* freerdp_channels_find_channel_open_data_by_name( - rdpChannels* channels, const char* name) +static CHANNEL_OPEN_DATA* freerdp_channels_find_channel_open_data_by_name(rdpChannels* channels, + const char* name) { int index; CHANNEL_OPEN_DATA* pChannelOpenData; @@ -58,8 +58,7 @@ static CHANNEL_OPEN_DATA* freerdp_channels_find_channel_open_data_by_name( } /* returns rdpChannel for the channel name passed in */ -static rdpMcsChannel* freerdp_channels_find_channel_by_name(rdpRdp* rdp, - const char* name) +static rdpMcsChannel* freerdp_channels_find_channel_by_name(rdpRdp* rdp, const char* name) { UINT32 index; rdpMcsChannel* channel; @@ -99,7 +98,7 @@ static void channel_queue_free(void* obj) rdpChannels* freerdp_channels_new(freerdp* instance) { rdpChannels* channels; - channels = (rdpChannels*) calloc(1, sizeof(rdpChannels)); + channels = (rdpChannels*)calloc(1, sizeof(rdpChannels)); if (!channels) return NULL; @@ -149,12 +148,12 @@ void freerdp_channels_free(rdpChannels* channels) * * @return 0 on success, otherwise a Win32 error code */ -static UINT freerdp_drdynvc_on_channel_connected(DrdynvcClientContext* context, - const char* name, void* pInterface) +static UINT freerdp_drdynvc_on_channel_connected(DrdynvcClientContext* context, const char* name, + void* pInterface) { UINT status = CHANNEL_RC_OK; ChannelConnectedEventArgs e; - rdpChannels* channels = (rdpChannels*) context->custom; + rdpChannels* channels = (rdpChannels*)context->custom; freerdp* instance = channels->instance; EventArgsInit(&e, "freerdp"); e.name = name; @@ -168,13 +167,12 @@ static UINT freerdp_drdynvc_on_channel_connected(DrdynvcClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT freerdp_drdynvc_on_channel_disconnected(DrdynvcClientContext* - context, - const char* name, void* pInterface) +static UINT freerdp_drdynvc_on_channel_disconnected(DrdynvcClientContext* context, const char* name, + void* pInterface) { UINT status = CHANNEL_RC_OK; ChannelDisconnectedEventArgs e; - rdpChannels* channels = (rdpChannels*) context->custom; + rdpChannels* channels = (rdpChannels*)context->custom; freerdp* instance = channels->instance; EventArgsInit(&e, "freerdp"); e.name = name; @@ -183,13 +181,12 @@ static UINT freerdp_drdynvc_on_channel_disconnected(DrdynvcClientContext* return status; } -static UINT freerdp_drdynvc_on_channel_attached(DrdynvcClientContext* - context, - const char* name, void* pInterface) +static UINT freerdp_drdynvc_on_channel_attached(DrdynvcClientContext* context, const char* name, + void* pInterface) { UINT status = CHANNEL_RC_OK; ChannelAttachedEventArgs e; - rdpChannels* channels = (rdpChannels*) context->custom; + rdpChannels* channels = (rdpChannels*)context->custom; freerdp* instance = channels->instance; EventArgsInit(&e, "freerdp"); e.name = name; @@ -198,13 +195,12 @@ static UINT freerdp_drdynvc_on_channel_attached(DrdynvcClientContext* return status; } -static UINT freerdp_drdynvc_on_channel_detached(DrdynvcClientContext* - context, - const char* name, void* pInterface) +static UINT freerdp_drdynvc_on_channel_detached(DrdynvcClientContext* context, const char* name, + void* pInterface) { UINT status = CHANNEL_RC_OK; ChannelDetachedEventArgs e; - rdpChannels* channels = (rdpChannels*) context->custom; + rdpChannels* channels = (rdpChannels*)context->custom; freerdp* instance = channels->instance; EventArgsInit(&e, "freerdp"); e.name = name; @@ -229,13 +225,14 @@ UINT freerdp_channels_pre_connect(rdpChannels* channels, freerdp* instance) if (pChannelClientData->pChannelInitEventProc) { - pChannelClientData->pChannelInitEventProc( - pChannelClientData->pInitHandle, CHANNEL_EVENT_INITIALIZED, 0, 0); + pChannelClientData->pChannelInitEventProc(pChannelClientData->pInitHandle, + CHANNEL_EVENT_INITIALIZED, 0, 0); } else if (pChannelClientData->pChannelInitEventProcEx) { pChannelClientData->pChannelInitEventProcEx(pChannelClientData->lpUserParam, - pChannelClientData->pInitHandle, CHANNEL_EVENT_INITIALIZED, 0, 0); + pChannelClientData->pInitHandle, + CHANNEL_EVENT_INITIALIZED, 0, 0); } if (CHANNEL_RC_OK != getChannelError(instance->context)) @@ -270,8 +267,9 @@ UINT freerdp_channels_attach(freerdp* instance) } else if (pChannelClientData->pChannelInitEventProcEx) { - pChannelClientData->pChannelInitEventProcEx(pChannelClientData->lpUserParam, - pChannelClientData->pInitHandle, CHANNEL_EVENT_ATTACHED, hostname, hostnameLength); + pChannelClientData->pChannelInitEventProcEx( + pChannelClientData->lpUserParam, pChannelClientData->pInitHandle, + CHANNEL_EVENT_ATTACHED, hostname, hostnameLength); } if (getChannelError(instance->context) != CHANNEL_RC_OK) @@ -279,7 +277,7 @@ UINT freerdp_channels_attach(freerdp* instance) pChannelOpenData = &channels->openDataList[index]; EventArgsInit(&e, "freerdp"); - e.name = pChannelOpenData->name; + e.name = pChannelOpenData->name; e.pInterface = pChannelOpenData->pInterface; PubSub_OnChannelAttached(instance->context->pubSub, instance->context, &e); } @@ -313,8 +311,9 @@ UINT freerdp_channels_detach(freerdp* instance) } else if (pChannelClientData->pChannelInitEventProcEx) { - pChannelClientData->pChannelInitEventProcEx(pChannelClientData->lpUserParam, - pChannelClientData->pInitHandle, CHANNEL_EVENT_DETACHED, hostname, hostnameLength); + pChannelClientData->pChannelInitEventProcEx( + pChannelClientData->lpUserParam, pChannelClientData->pInitHandle, + CHANNEL_EVENT_DETACHED, hostname, hostnameLength); } if (getChannelError(instance->context) != CHANNEL_RC_OK) @@ -322,7 +321,7 @@ UINT freerdp_channels_detach(freerdp* instance) pChannelOpenData = &channels->openDataList[index]; EventArgsInit(&e, "freerdp"); - e.name = pChannelOpenData->name; + e.name = pChannelOpenData->name; e.pInterface = pChannelOpenData->pInterface; PubSub_OnChannelDetached(instance->context->pubSub, instance->context, &e); } @@ -360,8 +359,9 @@ UINT freerdp_channels_post_connect(rdpChannels* channels, freerdp* instance) } else if (pChannelClientData->pChannelInitEventProcEx) { - pChannelClientData->pChannelInitEventProcEx(pChannelClientData->lpUserParam, - pChannelClientData->pInitHandle, CHANNEL_EVENT_CONNECTED, hostname, hostnameLength); + pChannelClientData->pChannelInitEventProcEx( + pChannelClientData->lpUserParam, pChannelClientData->pInitHandle, + CHANNEL_EVENT_CONNECTED, hostname, hostnameLength); } if (getChannelError(instance->context) != CHANNEL_RC_OK) @@ -374,15 +374,14 @@ UINT freerdp_channels_post_connect(rdpChannels* channels, freerdp* instance) PubSub_OnChannelConnected(instance->context->pubSub, instance->context, &e); } - channels->drdynvc = (DrdynvcClientContext*) - freerdp_channels_get_static_channel_interface(channels, "drdynvc"); + channels->drdynvc = + (DrdynvcClientContext*)freerdp_channels_get_static_channel_interface(channels, "drdynvc"); if (channels->drdynvc) { - channels->drdynvc->custom = (void*) channels; + channels->drdynvc->custom = (void*)channels; channels->drdynvc->OnChannelConnected = freerdp_drdynvc_on_channel_connected; - channels->drdynvc->OnChannelDisconnected = - freerdp_drdynvc_on_channel_disconnected; + channels->drdynvc->OnChannelDisconnected = freerdp_drdynvc_on_channel_disconnected; channels->drdynvc->OnChannelAttached = freerdp_drdynvc_on_channel_attached; channels->drdynvc->OnChannelDetached = freerdp_drdynvc_on_channel_detached; } @@ -391,8 +390,8 @@ fail: return error; } -int freerdp_channels_data(freerdp* instance, UINT16 channelId, BYTE* data, - int dataSize, int flags, int totalSize) +int freerdp_channels_data(freerdp* instance, UINT16 channelId, BYTE* data, int dataSize, int flags, + int totalSize) { UINT32 index; rdpMcs* mcs; @@ -430,13 +429,15 @@ int freerdp_channels_data(freerdp* instance, UINT16 channelId, BYTE* data, if (pChannelOpenData->pChannelOpenEventProc) { - pChannelOpenData->pChannelOpenEventProc( - pChannelOpenData->OpenHandle, CHANNEL_EVENT_DATA_RECEIVED, data, dataSize, totalSize, flags); + pChannelOpenData->pChannelOpenEventProc(pChannelOpenData->OpenHandle, + CHANNEL_EVENT_DATA_RECEIVED, data, dataSize, + totalSize, flags); } else if (pChannelOpenData->pChannelOpenEventProcEx) { - pChannelOpenData->pChannelOpenEventProcEx(pChannelOpenData->lpUserParam, - pChannelOpenData->OpenHandle, CHANNEL_EVENT_DATA_RECEIVED, data, dataSize, totalSize, flags); + pChannelOpenData->pChannelOpenEventProcEx( + pChannelOpenData->lpUserParam, pChannelOpenData->OpenHandle, + CHANNEL_EVENT_DATA_RECEIVED, data, dataSize, totalSize, flags); } return 0; @@ -461,16 +462,15 @@ BOOL freerdp_channels_process_message_free(wMessage* message, DWORD type) if (pChannelOpenData->pChannelOpenEventProc) { - pChannelOpenData->pChannelOpenEventProc(pChannelOpenData->OpenHandle, - type, item->UserData, - item->DataLength, item->DataLength, 0); + pChannelOpenData->pChannelOpenEventProc(pChannelOpenData->OpenHandle, type, + item->UserData, item->DataLength, + item->DataLength, 0); } else if (pChannelOpenData->pChannelOpenEventProcEx) { - pChannelOpenData->pChannelOpenEventProcEx(pChannelOpenData->lpUserParam, - pChannelOpenData->OpenHandle, - type, item->UserData, - item->DataLength, item->DataLength, 0); + pChannelOpenData->pChannelOpenEventProcEx( + pChannelOpenData->lpUserParam, pChannelOpenData->OpenHandle, type, item->UserData, + item->DataLength, item->DataLength, 0); } } @@ -495,7 +495,7 @@ static BOOL freerdp_channels_process_message(freerdp* instance, wMessage* messag pChannelOpenData = item->pChannelOpenData; channel = - freerdp_channels_find_channel_by_name(instance->context->rdp, pChannelOpenData->name); + freerdp_channels_find_channel_by_name(instance->context->rdp, pChannelOpenData->name); if (channel) instance->SendChannelData(instance, channel->ChannelId, item->Data, item->DataLength); @@ -511,8 +511,7 @@ static BOOL freerdp_channels_process_message(freerdp* instance, wMessage* messag /** * called only from main thread */ -static int freerdp_channels_process_sync(rdpChannels* channels, - freerdp* instance) +static int freerdp_channels_process_sync(rdpChannels* channels, freerdp* instance) { int status = TRUE; wMessage message; @@ -528,8 +527,7 @@ static int freerdp_channels_process_sync(rdpChannels* channels, /** * called only from main thread */ -BOOL freerdp_channels_get_fds(rdpChannels* channels, freerdp* instance, - void** read_fds, +BOOL freerdp_channels_get_fds(rdpChannels* channels, freerdp* instance, void** read_fds, int* read_count, void** write_fds, int* write_count) { void* pfd; @@ -544,13 +542,11 @@ BOOL freerdp_channels_get_fds(rdpChannels* channels, freerdp* instance, return TRUE; } -void* freerdp_channels_get_static_channel_interface(rdpChannels* channels, - const char* name) +void* freerdp_channels_get_static_channel_interface(rdpChannels* channels, const char* name) { void* pInterface = NULL; CHANNEL_OPEN_DATA* pChannelOpenData; - pChannelOpenData = freerdp_channels_find_channel_open_data_by_name(channels, - name); + pChannelOpenData = freerdp_channels_find_channel_open_data_by_name(channels, name); if (pChannelOpenData) pInterface = pChannelOpenData->pInterface; @@ -572,8 +568,7 @@ int freerdp_channels_process_pending_messages(freerdp* instance) rdpChannels* channels; channels = instance->context->channels; - if (WaitForSingleObject(MessageQueue_Event(channels->queue), - 0) == WAIT_OBJECT_0) + if (WaitForSingleObject(MessageQueue_Event(channels->queue), 0) == WAIT_OBJECT_0) { return freerdp_channels_process_sync(channels, instance); } @@ -586,8 +581,7 @@ int freerdp_channels_process_pending_messages(freerdp* instance) */ BOOL freerdp_channels_check_fds(rdpChannels* channels, freerdp* instance) { - if (WaitForSingleObject(MessageQueue_Event(channels->queue), - 0) == WAIT_OBJECT_0) + if (WaitForSingleObject(MessageQueue_Event(channels->queue), 0) == WAIT_OBJECT_0) { freerdp_channels_process_sync(channels, instance); } @@ -615,13 +609,14 @@ UINT freerdp_channels_disconnect(rdpChannels* channels, freerdp* instance) if (pChannelClientData->pChannelInitEventProc) { - pChannelClientData->pChannelInitEventProc( - pChannelClientData->pInitHandle, CHANNEL_EVENT_DISCONNECTED, 0, 0); + pChannelClientData->pChannelInitEventProc(pChannelClientData->pInitHandle, + CHANNEL_EVENT_DISCONNECTED, 0, 0); } else if (pChannelClientData->pChannelInitEventProcEx) { pChannelClientData->pChannelInitEventProcEx(pChannelClientData->lpUserParam, - pChannelClientData->pInitHandle, CHANNEL_EVENT_DISCONNECTED, 0, 0); + pChannelClientData->pInitHandle, + CHANNEL_EVENT_DISCONNECTED, 0, 0); } if (getChannelError(instance->context) != CHANNEL_RC_OK) @@ -652,13 +647,14 @@ void freerdp_channels_close(rdpChannels* channels, freerdp* instance) if (pChannelClientData->pChannelInitEventProc) { - pChannelClientData->pChannelInitEventProc( - pChannelClientData->pInitHandle, CHANNEL_EVENT_TERMINATED, 0, 0); + pChannelClientData->pChannelInitEventProc(pChannelClientData->pInitHandle, + CHANNEL_EVENT_TERMINATED, 0, 0); } else if (pChannelClientData->pChannelInitEventProcEx) { pChannelClientData->pChannelInitEventProcEx(pChannelClientData->lpUserParam, - pChannelClientData->pInitHandle, CHANNEL_EVENT_TERMINATED, 0, 0); + pChannelClientData->pInitHandle, + CHANNEL_EVENT_TERMINATED, 0, 0); } } @@ -671,8 +667,7 @@ void freerdp_channels_close(rdpChannels* channels, freerdp* instance) freerdp_channel_remove_open_handle_data(&g_ChannelHandles, pChannelOpenData->OpenHandle); if (channels->openHandles) - HashTable_Remove(channels->openHandles, - (void*)(UINT_PTR)pChannelOpenData->OpenHandle); + HashTable_Remove(channels->openHandles, (void*)(UINT_PTR)pChannelOpenData->OpenHandle); } channels->openDataCount = 0; @@ -680,10 +675,9 @@ void freerdp_channels_close(rdpChannels* channels, freerdp* instance) instance->settings->ChannelCount = 0; } -static UINT VCAPITYPE FreeRDP_VirtualChannelInitEx(LPVOID lpUserParam, LPVOID clientContext, - LPVOID pInitHandle, - PCHANNEL_DEF pChannel, INT channelCount, ULONG versionRequested, - PCHANNEL_INIT_EVENT_EX_FN pChannelInitEventProcEx) +static UINT VCAPITYPE FreeRDP_VirtualChannelInitEx( + LPVOID lpUserParam, LPVOID clientContext, LPVOID pInitHandle, PCHANNEL_DEF pChannel, + INT channelCount, ULONG versionRequested, PCHANNEL_INIT_EVENT_EX_FN pChannelInitEventProcEx) { INT index; CHANNEL_DEF* channel; @@ -692,7 +686,7 @@ static UINT VCAPITYPE FreeRDP_VirtualChannelInitEx(LPVOID lpUserParam, LPVOID cl CHANNEL_INIT_DATA* pChannelInitData; CHANNEL_OPEN_DATA* pChannelOpenData; CHANNEL_CLIENT_DATA* pChannelClientData; - rdpChannels* channels = (rdpChannels*) pInitHandle; + rdpChannels* channels = (rdpChannels*)pInitHandle; if (!pInitHandle) return CHANNEL_RC_BAD_INIT_HANDLE; @@ -703,7 +697,7 @@ static UINT VCAPITYPE FreeRDP_VirtualChannelInitEx(LPVOID lpUserParam, LPVOID cl if ((channelCount <= 0) || !pChannelInitEventProcEx) return CHANNEL_RC_INITIALIZATION_ERROR; - pChannelInitData = (CHANNEL_INIT_DATA*) pInitHandle; + pChannelInitData = (CHANNEL_INIT_DATA*)pInitHandle; channels = pChannelInitData->channels; pChannelInitData->pInterface = clientContext; @@ -744,8 +738,8 @@ static UINT VCAPITYPE FreeRDP_VirtualChannelInitEx(LPVOID lpUserParam, LPVOID cl pChannelOpenData->OpenHandle = InterlockedIncrement(&g_OpenHandleSeq); pChannelOpenData->channels = channels; pChannelOpenData->lpUserParam = lpUserParam; - HashTable_Add(channels->openHandles, (void*)(UINT_PTR) pChannelOpenData->OpenHandle, - (void*) pChannelOpenData); + HashTable_Add(channels->openHandles, (void*)(UINT_PTR)pChannelOpenData->OpenHandle, + (void*)pChannelOpenData); pChannelOpenData->flags = 1; /* init */ strncpy(pChannelOpenData->name, pChannelDef->name, CHANNEL_NAME_LEN); pChannelOpenData->options = pChannelDef->options; @@ -764,10 +758,9 @@ static UINT VCAPITYPE FreeRDP_VirtualChannelInitEx(LPVOID lpUserParam, LPVOID cl return CHANNEL_RC_OK; } -static UINT VCAPITYPE FreeRDP_VirtualChannelInit(LPVOID* ppInitHandle, - PCHANNEL_DEF pChannel, - INT channelCount, ULONG versionRequested, - PCHANNEL_INIT_EVENT_FN pChannelInitEventProc) +static UINT VCAPITYPE FreeRDP_VirtualChannelInit(LPVOID* ppInitHandle, PCHANNEL_DEF pChannel, + INT channelCount, ULONG versionRequested, + PCHANNEL_INIT_EVENT_FN pChannelInitEventProc) { INT index; void* pInterface; @@ -812,8 +805,7 @@ static UINT VCAPITYPE FreeRDP_VirtualChannelInit(LPVOID* ppInitHandle, { pChannelDef = &pChannel[index]; - if (freerdp_channels_find_channel_open_data_by_name(channels, - pChannelDef->name) != 0) + if (freerdp_channels_find_channel_open_data_by_name(channels, pChannelDef->name) != 0) { return CHANNEL_RC_BAD_CHANNEL; } @@ -832,9 +824,9 @@ static UINT VCAPITYPE FreeRDP_VirtualChannelInit(LPVOID* ppInitHandle, pChannelOpenData->OpenHandle = InterlockedIncrement(&g_OpenHandleSeq); pChannelOpenData->channels = channels; freerdp_channel_add_open_handle_data(&g_ChannelHandles, pChannelOpenData->OpenHandle, - (void*) channels); - HashTable_Add(channels->openHandles, (void*)(UINT_PTR) pChannelOpenData->OpenHandle, - (void*) pChannelOpenData); + (void*)channels); + HashTable_Add(channels->openHandles, (void*)(UINT_PTR)pChannelOpenData->OpenHandle, + (void*)pChannelOpenData); pChannelOpenData->flags = 1; /* init */ strncpy(pChannelOpenData->name, pChannelDef->name, CHANNEL_NAME_LEN); pChannelOpenData->options = pChannelDef->options; @@ -853,14 +845,15 @@ static UINT VCAPITYPE FreeRDP_VirtualChannelInit(LPVOID* ppInitHandle, return CHANNEL_RC_OK; } -static UINT VCAPITYPE FreeRDP_VirtualChannelOpenEx(LPVOID pInitHandle, - LPDWORD pOpenHandle, PCHAR pChannelName, PCHANNEL_OPEN_EVENT_EX_FN pChannelOpenEventProcEx) +static UINT VCAPITYPE +FreeRDP_VirtualChannelOpenEx(LPVOID pInitHandle, LPDWORD pOpenHandle, PCHAR pChannelName, + PCHANNEL_OPEN_EVENT_EX_FN pChannelOpenEventProcEx) { void* pInterface; rdpChannels* channels; CHANNEL_INIT_DATA* pChannelInitData; CHANNEL_OPEN_DATA* pChannelOpenData; - pChannelInitData = (CHANNEL_INIT_DATA*) pInitHandle; + pChannelInitData = (CHANNEL_INIT_DATA*)pInitHandle; channels = pChannelInitData->channels; pInterface = pChannelInitData->pInterface; @@ -888,14 +881,15 @@ static UINT VCAPITYPE FreeRDP_VirtualChannelOpenEx(LPVOID pInitHandle, return CHANNEL_RC_OK; } -static UINT VCAPITYPE FreeRDP_VirtualChannelOpen(LPVOID pInitHandle, - LPDWORD pOpenHandle, PCHAR pChannelName, PCHANNEL_OPEN_EVENT_FN pChannelOpenEventProc) +static UINT VCAPITYPE FreeRDP_VirtualChannelOpen(LPVOID pInitHandle, LPDWORD pOpenHandle, + PCHAR pChannelName, + PCHANNEL_OPEN_EVENT_FN pChannelOpenEventProc) { void* pInterface; rdpChannels* channels; CHANNEL_INIT_DATA* pChannelInitData; CHANNEL_OPEN_DATA* pChannelOpenData; - pChannelInitData = (CHANNEL_INIT_DATA*) pInitHandle; + pChannelInitData = (CHANNEL_INIT_DATA*)pInitHandle; channels = pChannelInitData->channels; pInterface = pChannelInitData->pInterface; @@ -932,13 +926,13 @@ static UINT VCAPITYPE FreeRDP_VirtualChannelCloseEx(LPVOID pInitHandle, DWORD op if (!pInitHandle) return CHANNEL_RC_BAD_INIT_HANDLE; - pChannelInitData = (CHANNEL_INIT_DATA*) pInitHandle; + pChannelInitData = (CHANNEL_INIT_DATA*)pInitHandle; channels = pChannelInitData->channels; if (!channels) return CHANNEL_RC_BAD_CHANNEL_HANDLE; - pChannelOpenData = HashTable_GetItemValue(channels->openHandles, (void*)(UINT_PTR) openHandle); + pChannelOpenData = HashTable_GetItemValue(channels->openHandles, (void*)(UINT_PTR)openHandle); if (!pChannelOpenData) return CHANNEL_RC_BAD_CHANNEL_HANDLE; @@ -954,12 +948,12 @@ static UINT VCAPITYPE FreeRDP_VirtualChannelClose(DWORD openHandle) { rdpChannels* channels; CHANNEL_OPEN_DATA* pChannelOpenData; - channels = (rdpChannels*) freerdp_channel_get_open_handle_data(&g_ChannelHandles, openHandle); + channels = (rdpChannels*)freerdp_channel_get_open_handle_data(&g_ChannelHandles, openHandle); if (!channels) return CHANNEL_RC_BAD_CHANNEL_HANDLE; - pChannelOpenData = HashTable_GetItemValue(channels->openHandles, (void*)(UINT_PTR) openHandle); + pChannelOpenData = HashTable_GetItemValue(channels->openHandles, (void*)(UINT_PTR)openHandle); if (!pChannelOpenData) return CHANNEL_RC_BAD_CHANNEL_HANDLE; @@ -972,7 +966,8 @@ static UINT VCAPITYPE FreeRDP_VirtualChannelClose(DWORD openHandle) } static UINT VCAPITYPE FreeRDP_VirtualChannelWriteEx(LPVOID pInitHandle, DWORD openHandle, - LPVOID pData, ULONG dataLength, LPVOID pUserData) + LPVOID pData, ULONG dataLength, + LPVOID pUserData) { rdpChannels* channels = NULL; CHANNEL_INIT_DATA* pChannelInitData = NULL; @@ -983,13 +978,13 @@ static UINT VCAPITYPE FreeRDP_VirtualChannelWriteEx(LPVOID pInitHandle, DWORD op if (!pInitHandle) return CHANNEL_RC_BAD_INIT_HANDLE; - pChannelInitData = (CHANNEL_INIT_DATA*) pInitHandle; + pChannelInitData = (CHANNEL_INIT_DATA*)pInitHandle; channels = pChannelInitData->channels; if (!channels) return CHANNEL_RC_BAD_CHANNEL_HANDLE; - pChannelOpenData = HashTable_GetItemValue(channels->openHandles, (void*)(UINT_PTR) openHandle); + pChannelOpenData = HashTable_GetItemValue(channels->openHandles, (void*)(UINT_PTR)openHandle); if (!pChannelOpenData) return CHANNEL_RC_BAD_CHANNEL_HANDLE; @@ -1006,7 +1001,7 @@ static UINT VCAPITYPE FreeRDP_VirtualChannelWriteEx(LPVOID pInitHandle, DWORD op if (pChannelOpenData->flags != 2) return CHANNEL_RC_NOT_OPEN; - pChannelOpenEvent = (CHANNEL_OPEN_EVENT*) malloc(sizeof(CHANNEL_OPEN_EVENT)); + pChannelOpenEvent = (CHANNEL_OPEN_EVENT*)malloc(sizeof(CHANNEL_OPEN_EVENT)); if (!pChannelOpenEvent) return CHANNEL_RC_NO_MEMORY; @@ -1030,19 +1025,19 @@ static UINT VCAPITYPE FreeRDP_VirtualChannelWriteEx(LPVOID pInitHandle, DWORD op return CHANNEL_RC_OK; } -static UINT VCAPITYPE FreeRDP_VirtualChannelWrite(DWORD openHandle, - LPVOID pData, ULONG dataLength, LPVOID pUserData) +static UINT VCAPITYPE FreeRDP_VirtualChannelWrite(DWORD openHandle, LPVOID pData, ULONG dataLength, + LPVOID pUserData) { wMessage message; CHANNEL_OPEN_DATA* pChannelOpenData; CHANNEL_OPEN_EVENT* pChannelOpenEvent; - rdpChannels* channels = (rdpChannels*) freerdp_channel_get_open_handle_data(&g_ChannelHandles, - openHandle); + rdpChannels* channels = + (rdpChannels*)freerdp_channel_get_open_handle_data(&g_ChannelHandles, openHandle); if (!channels) return CHANNEL_RC_BAD_CHANNEL_HANDLE; - pChannelOpenData = HashTable_GetItemValue(channels->openHandles, (void*)(UINT_PTR) openHandle); + pChannelOpenData = HashTable_GetItemValue(channels->openHandles, (void*)(UINT_PTR)openHandle); if (!pChannelOpenData) return CHANNEL_RC_BAD_CHANNEL_HANDLE; @@ -1059,7 +1054,7 @@ static UINT VCAPITYPE FreeRDP_VirtualChannelWrite(DWORD openHandle, if (pChannelOpenData->flags != 2) return CHANNEL_RC_NOT_OPEN; - pChannelOpenEvent = (CHANNEL_OPEN_EVENT*) malloc(sizeof(CHANNEL_OPEN_EVENT)); + pChannelOpenEvent = (CHANNEL_OPEN_EVENT*)malloc(sizeof(CHANNEL_OPEN_EVENT)); if (!pChannelOpenEvent) return CHANNEL_RC_NO_MEMORY; @@ -1122,7 +1117,7 @@ int freerdp_channels_client_load(rdpChannels* channels, rdpSettings* settings, if (channels->clientDataCount + 1 > CHANNEL_MAX_COUNT) { - WLog_ERR(TAG, "error: too many channels"); + WLog_ERR(TAG, "error: too many channels"); return 1; } @@ -1150,14 +1145,14 @@ int freerdp_channels_client_load(rdpChannels* channels, rdpSettings* settings, EnterCriticalSection(&channels->channelsLock); g_pInterface = NULL; g_channels = channels; - status = pChannelClientData->entry((PCHANNEL_ENTRY_POINTS) &EntryPoints); + status = pChannelClientData->entry((PCHANNEL_ENTRY_POINTS)&EntryPoints); LeaveCriticalSection(&channels->channelsLock); /* disable MyVirtualChannelInit */ channels->can_call_init = FALSE; if (!status) { - WLog_ERR(TAG, "error: channel export function call failed"); + WLog_ERR(TAG, "error: channel export function call failed"); return 1; } @@ -1175,7 +1170,7 @@ int freerdp_channels_client_load_ex(rdpChannels* channels, rdpSettings* settings if (channels->clientDataCount + 1 > CHANNEL_MAX_COUNT) { - WLog_ERR(TAG, "error: too many channels"); + WLog_ERR(TAG, "error: too many channels"); return 1; } @@ -1199,11 +1194,11 @@ int freerdp_channels_client_load_ex(rdpChannels* channels, rdpSettings* settings EntryPointsEx.pVirtualChannelWriteEx = FreeRDP_VirtualChannelWriteEx; EntryPointsEx.MagicNumber = FREERDP_CHANNEL_MAGIC_NUMBER; EntryPointsEx.pExtendedData = data; - EntryPointsEx.context = ((freerdp*) settings->instance)->context; + EntryPointsEx.context = ((freerdp*)settings->instance)->context; /* enable VirtualChannelInit */ channels->can_call_init = TRUE; EnterCriticalSection(&channels->channelsLock); - status = pChannelClientData->entryEx((PCHANNEL_ENTRY_POINTS_EX) &EntryPointsEx, pInitHandle); + status = pChannelClientData->entryEx((PCHANNEL_ENTRY_POINTS_EX)&EntryPointsEx, pInitHandle); LeaveCriticalSection(&channels->channelsLock); /* disable MyVirtualChannelInit */ channels->can_call_init = FALSE; diff --git a/libfreerdp/core/client.h b/libfreerdp/core/client.h index 82b0e239c..f71a2b0d8 100644 --- a/libfreerdp/core/client.h +++ b/libfreerdp/core/client.h @@ -117,13 +117,9 @@ struct rdp_channels }; FREERDP_LOCAL rdpChannels* freerdp_channels_new(freerdp* instance); -FREERDP_LOCAL UINT freerdp_channels_disconnect(rdpChannels* channels, - freerdp* instance); -FREERDP_LOCAL void freerdp_channels_close(rdpChannels* channels, - freerdp* instance); +FREERDP_LOCAL UINT freerdp_channels_disconnect(rdpChannels* channels, freerdp* instance); +FREERDP_LOCAL void freerdp_channels_close(rdpChannels* channels, freerdp* instance); FREERDP_LOCAL void freerdp_channels_free(rdpChannels* channels); -FREERDP_LOCAL UINT freerdp_channels_pre_connect(rdpChannels* channels, - freerdp* instance); -FREERDP_LOCAL UINT freerdp_channels_post_connect(rdpChannels* channels, - freerdp* instance); +FREERDP_LOCAL UINT freerdp_channels_pre_connect(rdpChannels* channels, freerdp* instance); +FREERDP_LOCAL UINT freerdp_channels_post_connect(rdpChannels* channels, freerdp* instance); #endif /* FREERDP_LIB_CORE_CLIENT_H */ diff --git a/libfreerdp/core/codecs.c b/libfreerdp/core/codecs.c index fbfb6301d..6c89a81e5 100644 --- a/libfreerdp/core/codecs.c +++ b/libfreerdp/core/codecs.c @@ -27,8 +27,7 @@ #define TAG FREERDP_TAG("core.codecs") -BOOL freerdp_client_codecs_prepare(rdpCodecs* codecs, UINT32 flags, - UINT32 width, UINT32 height) +BOOL freerdp_client_codecs_prepare(rdpCodecs* codecs, UINT32 flags, UINT32 width, UINT32 height) { if ((flags & FREERDP_CODEC_INTERLEAVED) && !codecs->interleaved) { @@ -104,8 +103,7 @@ BOOL freerdp_client_codecs_prepare(rdpCodecs* codecs, UINT32 flags, return freerdp_client_codecs_reset(codecs, flags, width, height); } -BOOL freerdp_client_codecs_reset(rdpCodecs* codecs, UINT32 flags, UINT32 width, - UINT32 height) +BOOL freerdp_client_codecs_reset(rdpCodecs* codecs, UINT32 flags, UINT32 width, UINT32 height) { BOOL rc = TRUE; @@ -177,7 +175,7 @@ BOOL freerdp_client_codecs_reset(rdpCodecs* codecs, UINT32 flags, UINT32 width, rdpCodecs* codecs_new(rdpContext* context) { rdpCodecs* codecs; - codecs = (rdpCodecs*) calloc(1, sizeof(rdpCodecs)); + codecs = (rdpCodecs*)calloc(1, sizeof(rdpCodecs)); if (codecs) codecs->context = context; @@ -236,4 +234,3 @@ void codecs_free(rdpCodecs* codecs) free(codecs); } - diff --git a/libfreerdp/core/connection.c b/libfreerdp/core/connection.c index 0f15af36a..d0db2f89a 100644 --- a/libfreerdp/core/connection.c +++ b/libfreerdp/core/connection.c @@ -81,96 +81,111 @@ * data sent between client and server is wrapped in an X.224 Data Protocol Data Unit (PDU). * * 2. Basic Settings Exchange: Basic settings are exchanged between the client and server by - * using the MCS Connect Initial PDU (section 2.2.1.3) and MCS Connect Response PDU (section 2.2.1.4). - * The Connect Initial PDU contains a Generic Conference Control (GCC) Conference Create Request, - * while the Connect Response PDU contains a GCC Conference Create Response. These two GCC packets - * contain concatenated blocks of settings data (such as core data, security data, and network data) - * which are read by client and server. + * using the MCS Connect Initial PDU (section 2.2.1.3) and MCS Connect Response PDU + *(section 2.2.1.4). The Connect Initial PDU contains a Generic Conference Control (GCC) Conference + *Create Request, while the Connect Response PDU contains a GCC Conference Create Response. These + *two GCC packets contain concatenated blocks of settings data (such as core data, security data, + *and network data) which are read by client and server. * * 3. Channel Connection: The client sends an MCS Erect Domain Request PDU (section 2.2.1.5), * followed by an MCS Attach User Request PDU (section 2.2.1.6) to attach the primary user identity * to the MCS domain. The server responds with an MCS Attach User Confirm PDU (section 2.2.1.7) * containing the User Channel ID. The client then proceeds to join the user channel, the * input/output (I/O) channel, and all of the static virtual channels (the I/O and static virtual - * channel IDs are obtained from the data embedded in the GCC packets) by using multiple MCS Channel - * Join Request PDUs (section 2.2.1.8). The server confirms each channel with an MCS Channel Join - * Confirm PDU (section 2.2.1.9). (The client only sends a Channel Join Request after it has received - * the Channel Join Confirm for the previously sent request.) + * channel IDs are obtained from the data embedded in the GCC packets) by using multiple MCS + *Channel Join Request PDUs (section 2.2.1.8). The server confirms each channel with an MCS Channel + *Join Confirm PDU (section 2.2.1.9). (The client only sends a Channel Join Request after it has + *received the Channel Join Confirm for the previously sent request.) * - * From this point, all subsequent data sent from the client to the server is wrapped in an MCS Send - * Data Request PDU, while data sent from the server to the client is wrapped in an MCS Send Data - * Indication PDU. This is in addition to the data being wrapped by an X.224 Data PDU. + * From this point, all subsequent data sent from the client to the server is wrapped in an MCS + *Send Data Request PDU, while data sent from the server to the client is wrapped in an MCS Send + *Data Indication PDU. This is in addition to the data being wrapped by an X.224 Data PDU. * - * 4. RDP Security Commencement: If Standard RDP Security mechanisms (section 5.3) are being employed and - * encryption is in force (this is determined by examining the data embedded in the GCC Conference Create - * Response packet) then the client sends a Security Exchange PDU (section 2.2.1.10) containing an encrypted - * 32-byte random number to the server. This random number is encrypted with the public key of the server - * as described in section 5.3.4.1 (the server's public key, as well as a 32-byte server-generated random - * number, are both obtained from the data embedded in the GCC Conference Create Response packet). The client - * and server then utilize the two 32-byte random numbers to generate session keys which are used to encrypt - * and validate the integrity of subsequent RDP traffic. + * 4. RDP Security Commencement: If Standard RDP Security mechanisms (section 5.3) are being + *employed and encryption is in force (this is determined by examining the data embedded in the GCC + *Conference Create Response packet) then the client sends a Security Exchange PDU + *(section 2.2.1.10) containing an encrypted 32-byte random number to the server. This random number + *is encrypted with the public key of the server as described in section 5.3.4.1 (the server's + *public key, as well as a 32-byte server-generated random number, are both obtained from the data + *embedded in the GCC Conference Create Response packet). The client and server then utilize the two + *32-byte random numbers to generate session keys which are used to encrypt and validate the + *integrity of subsequent RDP traffic. * - * From this point, all subsequent RDP traffic can be encrypted and a security header is included with the - * data if encryption is in force. (The Client Info PDU (section 2.2.1.11) and licensing PDUs ([MS-RDPELE] - * section 2.2.2) are an exception in that they always have a security header). The Security Header follows - * the X.224 and MCS Headers and indicates whether the attached data is encrypted. Even if encryption is in - * force, server-to-client traffic may not always be encrypted, while client-to-server traffic must always be - * encrypted (encryption of licensing PDUs is optional, however). + * From this point, all subsequent RDP traffic can be encrypted and a security header is included + *with the data if encryption is in force. (The Client Info PDU (section 2.2.1.11) and licensing + *PDUs ([MS-RDPELE] section 2.2.2) are an exception in that they always have a security header). The + *Security Header follows the X.224 and MCS Headers and indicates whether the attached data is + *encrypted. Even if encryption is in force, server-to-client traffic may not always be encrypted, + *while client-to-server traffic must always be encrypted (encryption of licensing PDUs is optional, + *however). * - * 5. Secure Settings Exchange: Secure client data (such as the username, password, and auto-reconnect cookie) - * is sent to the server by using the Client Info PDU (section 2.2.1.11). + * 5. Secure Settings Exchange: Secure client data (such as the username, password, and + *auto-reconnect cookie) is sent to the server by using the Client Info PDU (section 2.2.1.11). * - * 6. Optional Connect-Time Auto-Detection: During the optional connect-time auto-detect phase the goal is to - * determine characteristics of the network, such as the round-trip latency time and the bandwidth of the link - * between the server and client. This is accomplished by exchanging a collection of PDUs (specified in section 2.2.1.4) - * over a predetermined period of time with enough data to ensure that the results are statistically relevant. + * 6. Optional Connect-Time Auto-Detection: During the optional connect-time auto-detect phase the + *goal is to determine characteristics of the network, such as the round-trip latency time and the + *bandwidth of the link between the server and client. This is accomplished by exchanging a + *collection of PDUs (specified in section 2.2.1.4) over a predetermined period of time with enough + *data to ensure that the results are statistically relevant. * - * 7. Licensing: The goal of the licensing exchange is to transfer a license from the server to the client. - * The client stores this license and on subsequent connections sends the license to the server for validation. - * However, in some situations the client may not be issued a license to store. In effect, the packets exchanged - * during this phase of the protocol depend on the licensing mechanisms employed by the server. Within the context - * of this document, it is assumed that the client will not be issued a license to store. For details regarding - * more advanced licensing scenarios that take place during the Licensing Phase, see [MS-RDPELE] section 1.3. + * 7. Licensing: The goal of the licensing exchange is to transfer a license from the server to + *the client. The client stores this license and on subsequent connections sends the license to the + *server for validation. However, in some situations the client may not be issued a license to + *store. In effect, the packets exchanged during this phase of the protocol depend on the licensing + *mechanisms employed by the server. Within the context of this document, it is assumed that the + *client will not be issued a license to store. For details regarding more advanced licensing + *scenarios that take place during the Licensing Phase, see [MS-RDPELE] section 1.3. * - * 8. Optional Multitransport Bootstrapping: After the connection has been secured and the Licensing Phase has run - * to completion, the server can choose to initiate multitransport connections ([MS-RDPEMT] section 1.3). - * The Initiate Multitransport Request PDU (section 2.2.15.1) is sent by the server to the client and results - * in the out-of-band creation of a multitransport connection using messages from the RDP-UDP, TLS, DTLS, and - * multitransport protocols ([MS-RDPEMT] section 1.3.1). + * 8. Optional Multitransport Bootstrapping: After the connection has been secured and the + *Licensing Phase has run to completion, the server can choose to initiate multitransport + *connections ([MS-RDPEMT] section 1.3). The Initiate Multitransport Request PDU (section 2.2.15.1) + *is sent by the server to the client and results in the out-of-band creation of a multitransport + *connection using messages from the RDP-UDP, TLS, DTLS, and multitransport protocols ([MS-RDPEMT] + *section 1.3.1). * - * 9. Capabilities Exchange: The server sends the set of capabilities it supports to the client in a Demand Active PDU - * (section 2.2.1.13.1). The client responds with its capabilities by sending a Confirm Active PDU (section 2.2.1.13.2). + * 9. Capabilities Exchange: The server sends the set of capabilities it supports to the client in + *a Demand Active PDU (section 2.2.1.13.1). The client responds with its capabilities by sending a + *Confirm Active PDU (section 2.2.1.13.2). * - * 10. Connection Finalization: The client and server exchange PDUs to finalize the connection details. The client-to-server - * PDUs sent during this phase have no dependencies on any of the server-to-client PDUs; they may be sent as a single batch, - * provided that sequencing is maintained. + * 10. Connection Finalization: The client and server exchange PDUs to finalize the connection + *details. The client-to-server PDUs sent during this phase have no dependencies on any of the + *server-to-client PDUs; they may be sent as a single batch, provided that sequencing is maintained. * - * - The Client Synchronize PDU (section 2.2.1.14) is sent after transmitting the Confirm Active PDU. - * - The Client Control (Cooperate) PDU (section 2.2.1.15) is sent after transmitting the Client Synchronize PDU. - * - The Client Control (Request Control) PDU (section 2.2.1.16) is sent after transmitting the Client Control (Cooperate) PDU. - * - The optional Persistent Key List PDUs (section 2.2.1.17) are sent after transmitting the Client Control (Request Control) PDU. - * - The Font List PDU (section 2.2.1.18) is sent after transmitting the Persistent Key List PDUs or, if the Persistent Key List - * PDUs were not sent, it is sent after transmitting the Client Control (Request Control) PDU (section 2.2.1.16). + * - The Client Synchronize PDU (section 2.2.1.14) is sent after transmitting the Confirm Active + *PDU. + * - The Client Control (Cooperate) PDU (section 2.2.1.15) is sent after transmitting the Client + *Synchronize PDU. + * - The Client Control (Request Control) PDU (section 2.2.1.16) is sent after transmitting the + *Client Control (Cooperate) PDU. + * - The optional Persistent Key List PDUs (section 2.2.1.17) are sent after transmitting the + *Client Control (Request Control) PDU. + * - The Font List PDU (section 2.2.1.18) is sent after transmitting the Persistent Key List PDUs + *or, if the Persistent Key List PDUs were not sent, it is sent after transmitting the Client + *Control (Request Control) PDU (section 2.2.1.16). * - * The server-to-client PDUs sent during the Connection Finalization Phase have dependencies on the client-to-server PDUs. + * The server-to-client PDUs sent during the Connection Finalization Phase have dependencies on the + *client-to-server PDUs. * - * - The optional Monitor Layout PDU (section 2.2.12.1) has no dependency on any client-to-server PDUs and is sent after the Demand Active PDU. + * - The optional Monitor Layout PDU (section 2.2.12.1) has no dependency on any client-to-server + *PDUs and is sent after the Demand Active PDU. * - The Server Synchronize PDU (section 2.2.1.19) is sent in response to the Confirm Active PDU. - * - The Server Control (Cooperate) PDU (section 2.2.1.20) is sent after transmitting the Server Synchronize PDU. - * - The Server Control (Granted Control) PDU (section 2.2.1.21) is sent in response to the Client Control (Request Control) PDU. + * - The Server Control (Cooperate) PDU (section 2.2.1.20) is sent after transmitting the Server + *Synchronize PDU. + * - The Server Control (Granted Control) PDU (section 2.2.1.21) is sent in response to the Client + *Control (Request Control) PDU. * - The Font Map PDU (section 2.2.1.22) is sent in response to the Font List PDU. * - * Once the client has sent the Confirm Active PDU, it can start sending mouse and keyboard input to the server, and upon receipt - * of the Font List PDU the server can start sending graphics output to the client. + * Once the client has sent the Confirm Active PDU, it can start sending mouse and keyboard input + *to the server, and upon receipt of the Font List PDU the server can start sending graphics output + *to the client. * - * Besides input and graphics data, other data that can be exchanged between client and server after the connection has been - * finalized includes connection management information and virtual channel messages (exchanged between client-side plug-ins - * and server-side applications). + * Besides input and graphics data, other data that can be exchanged between client and server + *after the connection has been finalized includes connection management information and virtual + *channel messages (exchanged between client-side plug-ins and server-side applications). */ static int rdp_client_connect_finalize(rdpRdp* rdp); - static BOOL rdp_client_reset_codecs(rdpContext* context) { rdpSettings* settings; @@ -184,8 +199,8 @@ static BOOL rdp_client_reset_codecs(rdpContext* context) if (!context->codecs) return FALSE; - if (!freerdp_client_codecs_prepare(context->codecs, FREERDP_CODEC_ALL, - settings->DesktopWidth, settings->DesktopHeight)) + if (!freerdp_client_codecs_prepare(context->codecs, FREERDP_CODEC_ALL, settings->DesktopWidth, + settings->DesktopHeight)) return FALSE; /* Runtime H264 detection. (only available if dynamic backend loading is defined) @@ -200,7 +215,6 @@ static BOOL rdp_client_reset_codecs(rdpContext* context) } #endif return TRUE; - } /** @@ -215,7 +229,8 @@ BOOL rdp_client_connect(rdpRdp* rdp) UINT32 SelectedProtocol; BOOL status; rdpSettings* settings = rdp->settings; - /* make sure SSL is initialize for earlier enough for crypto, by taking advantage of winpr SSL FIPS flag for openssl initialization */ + /* make sure SSL is initialize for earlier enough for crypto, by taking advantage of winpr SSL + * FIPS flag for openssl initialization */ DWORD flags = WINPR_SSL_INIT_DEFAULT; if (!rdp_client_reset_codecs(rdp->context)) @@ -228,7 +243,8 @@ BOOL rdp_client_connect(rdpRdp* rdp) /* FIPS Mode forces the following and overrides the following(by happening later */ /* in the command line processing): */ - /* 1. Disables NLA Security since NLA in freerdp uses NTLM(no Kerberos support yet) which uses algorithms */ + /* 1. Disables NLA Security since NLA in freerdp uses NTLM(no Kerberos support yet) which uses + * algorithms */ /* not allowed in FIPS for sensitive data. So, we disallow NLA when FIPS is required. */ /* 2. Forces the only supported RDP encryption method to be FIPS. */ if (settings->FIPSMode || winpr_FIPSMode()) @@ -262,7 +278,7 @@ BOOL rdp_client_connect(rdpRdp* rdp) domain_length = strlen(domain); cookie_length = domain_length + 1 + user_length; - cookie = (char*) malloc(cookie_length + 1); + cookie = (char*)malloc(cookie_length + 1); if (!cookie) return FALSE; @@ -305,7 +321,8 @@ BOOL rdp_client_connect(rdpRdp* rdp) if (settings->LoadBalanceInfo && (settings->LoadBalanceInfoLength > 0)) { - if (!nego_set_routing_token(rdp->nego, settings->LoadBalanceInfo, settings->LoadBalanceInfoLength)) + if (!nego_set_routing_token(rdp->nego, settings->LoadBalanceInfo, + settings->LoadBalanceInfoLength)) return FALSE; } @@ -326,8 +343,9 @@ BOOL rdp_client_connect(rdpRdp* rdp) if ((SelectedProtocol & PROTOCOL_SSL) || (SelectedProtocol == PROTOCOL_RDP)) { - if ((settings->Username != NULL) && ((settings->Password != NULL) || - (settings->RedirectionPassword != NULL && settings->RedirectionPasswordLength > 0))) + if ((settings->Username != NULL) && + ((settings->Password != NULL) || + (settings->RedirectionPassword != NULL && settings->RedirectionPasswordLength > 0))) settings->AutoLogonEnabled = TRUE; } @@ -420,7 +438,8 @@ static BOOL rdp_client_reconnect_channels(rdpRdp* rdp, BOOL redirect) } if (context->instance->ConnectionCallbackState == CLIENT_STATE_POSTCONNECT_PASSED) - status = (freerdp_channels_post_connect(context->channels, context->instance) == CHANNEL_RC_OK); + status = + (freerdp_channels_post_connect(context->channels, context->instance) == CHANNEL_RC_OK); return status; } @@ -440,7 +459,8 @@ static BOOL rdp_client_redirect_try_fqdn(rdpSettings* settings) { if (settings->RedirectionFlags & LB_TARGET_FQDN) { - if (settings->GatewayEnabled || rdp_client_redirect_resolvable(settings->RedirectionTargetFQDN)) + if (settings->GatewayEnabled || + rdp_client_redirect_resolvable(settings->RedirectionTargetFQDN)) { free(settings->ServerHostname); settings->ServerHostname = _strdup(settings->RedirectionTargetFQDN); @@ -475,7 +495,8 @@ static BOOL rdp_client_redirect_try_netbios(rdpSettings* settings) { if (settings->RedirectionFlags & LB_TARGET_NETBIOS_NAME) { - if (settings->GatewayEnabled || rdp_client_redirect_resolvable(settings->RedirectionTargetNetBiosName)) + if (settings->GatewayEnabled || + rdp_client_redirect_resolvable(settings->RedirectionTargetNetBiosName)) { free(settings->ServerHostname); settings->ServerHostname = _strdup(settings->RedirectionTargetNetBiosName); @@ -510,7 +531,8 @@ BOOL rdp_client_redirect(rdpRdp* rdp) { if (settings->LoadBalanceInfo && (settings->LoadBalanceInfoLength > 0)) { - if (!nego_set_routing_token(rdp->nego, settings->LoadBalanceInfo, settings->LoadBalanceInfoLength)) + if (!nego_set_routing_token(rdp->nego, settings->LoadBalanceInfo, + settings->LoadBalanceInfoLength)) return FALSE; } } @@ -535,8 +557,7 @@ BOOL rdp_client_redirect(rdpRdp* rdp) haveRedirectAddress = rdp_client_redirect_try_netbios(settings); redirectionMask >>= 3; - } - while (!haveRedirectAddress && (redirectionMask != 0)); + } while (!haveRedirectAddress && (redirectionMask != 0)); } if (settings->RedirectionFlags & LB_USERNAME) @@ -625,8 +646,8 @@ static BOOL rdp_client_establish_keys(rdpRdp* rdp) if (!crypt_client_random) return FALSE; - crypto_rsa_public_encrypt(settings->ClientRandom, settings->ClientRandomLength, key_len, mod, exp, - crypt_client_random); + crypto_rsa_public_encrypt(settings->ClientRandom, settings->ClientRandomLength, key_len, mod, + exp, crypt_client_random); /* send crypt client random to server */ length = RDP_PACKET_HEADER_MAX_LENGTH + RDP_SECURITY_HEADER_LENGTH + 4 + key_len + 8; s = Stream_New(NULL, length); @@ -662,10 +683,8 @@ static BOOL rdp_client_establish_keys(rdpRdp* rdp) if (settings->EncryptionMethods == ENCRYPTION_METHOD_FIPS) { - rdp->fips_encrypt = winpr_Cipher_New(WINPR_CIPHER_DES_EDE3_CBC, - WINPR_ENCRYPT, - rdp->fips_encrypt_key, - fips_ivec); + rdp->fips_encrypt = winpr_Cipher_New(WINPR_CIPHER_DES_EDE3_CBC, WINPR_ENCRYPT, + rdp->fips_encrypt_key, fips_ivec); if (!rdp->fips_encrypt) { @@ -673,10 +692,8 @@ static BOOL rdp_client_establish_keys(rdpRdp* rdp) goto end; } - rdp->fips_decrypt = winpr_Cipher_New(WINPR_CIPHER_DES_EDE3_CBC, - WINPR_DECRYPT, - rdp->fips_decrypt_key, - fips_ivec); + rdp->fips_decrypt = winpr_Cipher_New(WINPR_CIPHER_DES_EDE3_CBC, WINPR_DECRYPT, + rdp->fips_decrypt_key, fips_ivec); if (!rdp->fips_decrypt) { @@ -801,10 +818,8 @@ BOOL rdp_server_establish_keys(rdpRdp* rdp, wStream* s) if (rdp->settings->EncryptionMethods == ENCRYPTION_METHOD_FIPS) { - rdp->fips_encrypt = winpr_Cipher_New(WINPR_CIPHER_DES_EDE3_CBC, - WINPR_ENCRYPT, - rdp->fips_encrypt_key, - fips_ivec); + rdp->fips_encrypt = winpr_Cipher_New(WINPR_CIPHER_DES_EDE3_CBC, WINPR_ENCRYPT, + rdp->fips_encrypt_key, fips_ivec); if (!rdp->fips_encrypt) { @@ -812,10 +827,8 @@ BOOL rdp_server_establish_keys(rdpRdp* rdp, wStream* s) goto end; } - rdp->fips_decrypt = winpr_Cipher_New(WINPR_CIPHER_DES_EDE3_CBC, - WINPR_DECRYPT, - rdp->fips_decrypt_key, - fips_ivec); + rdp->fips_decrypt = winpr_Cipher_New(WINPR_CIPHER_DES_EDE3_CBC, WINPR_DECRYPT, + rdp->fips_decrypt_key, fips_ivec); if (!rdp->fips_decrypt) { @@ -1069,8 +1082,9 @@ int rdp_client_connect_finalize(rdpRdp* rdp) { /** * [MS-RDPBCGR] 1.3.1.1 - 8. - * The client-to-server PDUs sent during this phase have no dependencies on any of the server-to- - * client PDUs; they may be sent as a single batch, provided that sequencing is maintained. + * The client-to-server PDUs sent during this phase have no dependencies on any of the + * server-to- client PDUs; they may be sent as a single batch, provided that sequencing is + * maintained. */ if (!rdp_send_client_synchronize_pdu(rdp)) return -1; @@ -1192,9 +1206,8 @@ BOOL rdp_server_accept_nego(rdpRdp* rdp, wStream* s) WLog_INFO(TAG, "Client Security: NLA:%d TLS:%d RDP:%d", (RequestedProtocols & PROTOCOL_HYBRID) ? 1 : 0, (RequestedProtocols & PROTOCOL_SSL) ? 1 : 0, - (RequestedProtocols == PROTOCOL_RDP) ? 1 : 0 - ); - WLog_INFO(TAG, "Server Security: NLA:%"PRId32" TLS:%"PRId32" RDP:%"PRId32"", + (RequestedProtocols == PROTOCOL_RDP) ? 1 : 0); + WLog_INFO(TAG, "Server Security: NLA:%" PRId32 " TLS:%" PRId32 " RDP:%" PRId32 "", settings->NlaSecurity, settings->TlsSecurity, settings->RdpSecurity); if ((settings->NlaSecurity) && (RequestedProtocols & PROTOCOL_HYBRID)) @@ -1244,8 +1257,7 @@ BOOL rdp_server_accept_nego(rdpRdp* rdp, wStream* s) WLog_INFO(TAG, "Negotiated Security: NLA:%d TLS:%d RDP:%d", (SelectedProtocol & PROTOCOL_HYBRID) ? 1 : 0, (SelectedProtocol & PROTOCOL_SSL) ? 1 : 0, - (SelectedProtocol == PROTOCOL_RDP) ? 1 : 0 - ); + (SelectedProtocol == PROTOCOL_RDP) ? 1 : 0); } if (!nego_set_selected_protocol(nego, SelectedProtocol)) @@ -1345,8 +1357,8 @@ BOOL rdp_server_accept_mcs_channel_join_request(rdpRdp* rdp, wStream* s) allJoined = FALSE; } - if ((mcs->userChannelJoined) && (mcs->globalChannelJoined) && (mcs->messageChannelId == 0 || - mcs->messageChannelJoined) && allJoined) + if ((mcs->userChannelJoined) && (mcs->globalChannelJoined) && + (mcs->messageChannelId == 0 || mcs->messageChannelJoined) && allJoined) { rdp_server_transition_to_state(rdp, CONNECTION_STATE_RDP_SECURITY_COMMENCEMENT); } diff --git a/libfreerdp/core/connection.h b/libfreerdp/core/connection.h index f811c748d..1296f333b 100644 --- a/libfreerdp/core/connection.h +++ b/libfreerdp/core/connection.h @@ -61,22 +61,17 @@ FREERDP_LOCAL BOOL rdp_client_disconnect(rdpRdp* rdp); FREERDP_LOCAL BOOL rdp_client_disconnect_and_clear(rdpRdp* rdp); FREERDP_LOCAL BOOL rdp_client_reconnect(rdpRdp* rdp); FREERDP_LOCAL BOOL rdp_client_redirect(rdpRdp* rdp); -FREERDP_LOCAL BOOL rdp_client_connect_mcs_channel_join_confirm(rdpRdp* rdp, - wStream* s); +FREERDP_LOCAL BOOL rdp_client_connect_mcs_channel_join_confirm(rdpRdp* rdp, wStream* s); FREERDP_LOCAL BOOL rdp_client_connect_auto_detect(rdpRdp* rdp, wStream* s); FREERDP_LOCAL int rdp_client_connect_license(rdpRdp* rdp, wStream* s); FREERDP_LOCAL int rdp_client_connect_demand_active(rdpRdp* rdp, wStream* s); FREERDP_LOCAL int rdp_client_transition_to_state(rdpRdp* rdp, int state); FREERDP_LOCAL BOOL rdp_server_accept_nego(rdpRdp* rdp, wStream* s); -FREERDP_LOCAL BOOL rdp_server_accept_mcs_connect_initial(rdpRdp* rdp, - wStream* s); -FREERDP_LOCAL BOOL rdp_server_accept_mcs_erect_domain_request(rdpRdp* rdp, - wStream* s); -FREERDP_LOCAL BOOL rdp_server_accept_mcs_attach_user_request(rdpRdp* rdp, - wStream* s); -FREERDP_LOCAL BOOL rdp_server_accept_mcs_channel_join_request(rdpRdp* rdp, - wStream* s); +FREERDP_LOCAL BOOL rdp_server_accept_mcs_connect_initial(rdpRdp* rdp, wStream* s); +FREERDP_LOCAL BOOL rdp_server_accept_mcs_erect_domain_request(rdpRdp* rdp, wStream* s); +FREERDP_LOCAL BOOL rdp_server_accept_mcs_attach_user_request(rdpRdp* rdp, wStream* s); +FREERDP_LOCAL BOOL rdp_server_accept_mcs_channel_join_request(rdpRdp* rdp, wStream* s); FREERDP_LOCAL BOOL rdp_server_accept_confirm_active(rdpRdp* rdp, wStream* s); FREERDP_LOCAL BOOL rdp_server_establish_keys(rdpRdp* rdp, wStream* s); FREERDP_LOCAL BOOL rdp_server_reactivate(rdpRdp* rdp); diff --git a/libfreerdp/core/display.c b/libfreerdp/core/display.c index 4ceb0bbb0..58f1798b4 100644 --- a/libfreerdp/core/display.c +++ b/libfreerdp/core/display.c @@ -32,18 +32,19 @@ BOOL display_write_monitor_layout_pdu(wStream* s, UINT32 monitorCount, for (index = 0, monitor = monitorDefArray; index < monitorCount; index++, monitor++) { - Stream_Write_UINT32(s, monitor->left); /* left (4 bytes) */ - Stream_Write_UINT32(s, monitor->top); /* top (4 bytes) */ - Stream_Write_UINT32(s, monitor->right); /* right (4 bytes) */ + Stream_Write_UINT32(s, monitor->left); /* left (4 bytes) */ + Stream_Write_UINT32(s, monitor->top); /* top (4 bytes) */ + Stream_Write_UINT32(s, monitor->right); /* right (4 bytes) */ Stream_Write_UINT32(s, monitor->bottom); /* bottom (4 bytes) */ - Stream_Write_UINT32(s, monitor->flags); /* flags (4 bytes) */ + Stream_Write_UINT32(s, monitor->flags); /* flags (4 bytes) */ } return TRUE; } BOOL display_convert_rdp_monitor_to_monitor_def(UINT32 monitorCount, - const rdpMonitor* monitorDefArray, MONITOR_DEF** result) + const rdpMonitor* monitorDefArray, + MONITOR_DEF** result) { UINT32 index; const rdpMonitor* monitor; @@ -54,10 +55,10 @@ BOOL display_convert_rdp_monitor_to_monitor_def(UINT32 monitorCount, for (index = 0, monitor = monitorDefArray; index < monitorCount; index++, monitor++) { MONITOR_DEF* current = (*result + index); - current->left = monitor->x; /* left (4 bytes) */ - current->top = monitor->y; /* top (4 bytes) */ - current->right = monitor->x + monitor->width - 1; /* right (4 bytes) */ - current->bottom = monitor->y + monitor->height - 1; /* bottom (4 bytes) */ + current->left = monitor->x; /* left (4 bytes) */ + current->top = monitor->y; /* top (4 bytes) */ + current->right = monitor->x + monitor->width - 1; /* right (4 bytes) */ + current->bottom = monitor->y + monitor->height - 1; /* bottom (4 bytes) */ current->flags = monitor->is_primary ? MONITOR_PRIMARY : 0x0; /* flags (4 bytes) */ } @@ -65,7 +66,7 @@ BOOL display_convert_rdp_monitor_to_monitor_def(UINT32 monitorCount, } BOOL freerdp_display_send_monitor_layout(rdpContext* context, UINT32 monitorCount, - const MONITOR_DEF* monitorDefArray) + const MONITOR_DEF* monitorDefArray) { rdpRdp* rdp = context->rdp; wStream* st = rdp_data_pdu_init(rdp); diff --git a/libfreerdp/core/display.h b/libfreerdp/core/display.h index 25322020d..1e7e5cd01 100644 --- a/libfreerdp/core/display.h +++ b/libfreerdp/core/display.h @@ -24,6 +24,7 @@ #include "rdp.h" FREERDP_LOCAL BOOL display_convert_rdp_monitor_to_monitor_def(UINT32 monitorCount, - const rdpMonitor* monitorDefArray, MONITOR_DEF** result); + const rdpMonitor* monitorDefArray, + MONITOR_DEF** result); #endif /* FREERDP_LIB_CORE_DISPLAY_H */ diff --git a/libfreerdp/core/errbase.c b/libfreerdp/core/errbase.c index bac70762e..686d515b1 100644 --- a/libfreerdp/core/errbase.c +++ b/libfreerdp/core/errbase.c @@ -30,7 +30,10 @@ #define TAG FREERDP_TAG("core") -#define ERRBASE_DEFINE(_code) { ERRBASE_##_code , "ERRBASE_" #_code , ERRBASE_##_code##_STRING, "" } +#define ERRBASE_DEFINE(_code) \ + { \ + ERRBASE_##_code, "ERRBASE_" #_code, ERRBASE_##_code##_STRING, "" \ + } /* Protocol-independent codes */ @@ -38,12 +41,9 @@ #define ERRBASE_SUCCESS_STRING "Success." #define ERRBASE_NONE_STRING "" -static const ERRINFO ERRBASE_CODES[] = -{ - ERRBASE_DEFINE(SUCCESS), +static const ERRINFO ERRBASE_CODES[] = { ERRBASE_DEFINE(SUCCESS), - ERRBASE_DEFINE(NONE) -}; + ERRBASE_DEFINE(NONE) }; const char* freerdp_get_error_base_string(UINT32 code) { @@ -101,4 +101,3 @@ const char* freerdp_get_error_base_name(UINT32 code) return "ERRBASE_UNKNOWN"; } - diff --git a/libfreerdp/core/errconnect.c b/libfreerdp/core/errconnect.c index e29f45135..1196af386 100644 --- a/libfreerdp/core/errconnect.c +++ b/libfreerdp/core/errconnect.c @@ -30,97 +30,77 @@ #define TAG FREERDP_TAG("core") -#define ERRCONNECT_DEFINE(_code, category) { ERRCONNECT_##_code , "ERRCONNECT_" #_code , ERRCONNECT_##_code##_STRING, category } +#define ERRCONNECT_DEFINE(_code, category) \ + { \ + ERRCONNECT_##_code, "ERRCONNECT_" #_code, ERRCONNECT_##_code##_STRING, category \ + } /* Protocol-independent codes */ #define ERRCONNECT_PRE_CONNECT_FAILED_STRING \ "A configuration error prevented a connection to be established." -#define ERRCONNECT_CONNECT_UNDEFINED_STRING \ - "A undefined connection error occurred." +#define ERRCONNECT_CONNECT_UNDEFINED_STRING "A undefined connection error occurred." #define ERRCONNECT_POST_CONNECT_FAILED_STRING \ "The connection attempt was aborted due to post connect configuration errors." -#define ERRCONNECT_DNS_ERROR_STRING \ - "The DNS entry could not be resolved." +#define ERRCONNECT_DNS_ERROR_STRING "The DNS entry could not be resolved." -#define ERRCONNECT_DNS_NAME_NOT_FOUND_STRING \ - "The DNS host name was not found." +#define ERRCONNECT_DNS_NAME_NOT_FOUND_STRING "The DNS host name was not found." -#define ERRCONNECT_CONNECT_FAILED_STRING \ - "The connection failed." +#define ERRCONNECT_CONNECT_FAILED_STRING "The connection failed." -#define ERRCONNECT_MCS_CONNECT_INITIAL_ERROR_STRING \ - "The connection failed at initial MCS connect" +#define ERRCONNECT_MCS_CONNECT_INITIAL_ERROR_STRING "The connection failed at initial MCS connect" -#define ERRCONNECT_TLS_CONNECT_FAILED_STRING \ - "The connection failed at TLS connect." +#define ERRCONNECT_TLS_CONNECT_FAILED_STRING "The connection failed at TLS connect." -#define ERRCONNECT_AUTHENTICATION_FAILED_STRING \ - "An authentication failure aborted the connection." +#define ERRCONNECT_AUTHENTICATION_FAILED_STRING "An authentication failure aborted the connection." #define ERRCONNECT_INSUFFICIENT_PRIVILEGES_STRING \ "Insufficient privileges to establish a connection." -#define ERRCONNECT_CONNECT_CANCELLED_STRING \ - "The connection was cancelled." +#define ERRCONNECT_CONNECT_CANCELLED_STRING "The connection was cancelled." #define ERRCONNECT_SECURITY_NEGO_CONNECT_FAILED_STRING \ "The connection failed at negotiating security settings." -#define ERRCONNECT_CONNECT_TRANSPORT_FAILED_STRING \ - "The connection transport layer failed." +#define ERRCONNECT_CONNECT_TRANSPORT_FAILED_STRING "The connection transport layer failed." -#define ERRCONNECT_PASSWORD_EXPIRED_STRING \ - "The password has expired and must be changed." +#define ERRCONNECT_PASSWORD_EXPIRED_STRING "The password has expired and must be changed." #define ERRCONNECT_PASSWORD_CERTAINLY_EXPIRED_STRING \ "The password has certainly expired and must be changed." -#define ERRCONNECT_CLIENT_REVOKED_STRING \ - "The client has been revoked." +#define ERRCONNECT_CLIENT_REVOKED_STRING "The client has been revoked." -#define ERRCONNECT_KDC_UNREACHABLE_STRING \ - "The KDC is unreachable." +#define ERRCONNECT_KDC_UNREACHABLE_STRING "The KDC is unreachable." -#define ERRCONNECT_ACCOUNT_DISABLED_STRING \ - "The account is disabled." +#define ERRCONNECT_ACCOUNT_DISABLED_STRING "The account is disabled." -#define ERRCONNECT_PASSWORD_MUST_CHANGE_STRING \ - "The password must be changed." +#define ERRCONNECT_PASSWORD_MUST_CHANGE_STRING "The password must be changed." -#define ERRCONNECT_LOGON_FAILURE_STRING \ - "Logon failed." +#define ERRCONNECT_LOGON_FAILURE_STRING "Logon failed." -#define ERRCONNECT_WRONG_PASSWORD_STRING \ - "Wrong password supplied." +#define ERRCONNECT_WRONG_PASSWORD_STRING "Wrong password supplied." -#define ERRCONNECT_ACCESS_DENIED_STRING \ - "Access denied." +#define ERRCONNECT_ACCESS_DENIED_STRING "Access denied." -#define ERRCONNECT_ACCOUNT_RESTRICTION_STRING \ - "Account restriction." +#define ERRCONNECT_ACCOUNT_RESTRICTION_STRING "Account restriction." -#define ERRCONNECT_ACCOUNT_LOCKED_OUT_STRING \ - "Account locked out." +#define ERRCONNECT_ACCOUNT_LOCKED_OUT_STRING "Account locked out." -#define ERRCONNECT_ACCOUNT_EXPIRED_STRING \ - "Account expired." +#define ERRCONNECT_ACCOUNT_EXPIRED_STRING "Account expired." -#define ERRCONNECT_LOGON_TYPE_NOT_GRANTED_STRING \ - "Logon type not granted." +#define ERRCONNECT_LOGON_TYPE_NOT_GRANTED_STRING "Logon type not granted." -#define ERRCONNECT_NO_OR_MISSING_CREDENTIALS_STRING \ - "Credentials invalid or missing." +#define ERRCONNECT_NO_OR_MISSING_CREDENTIALS_STRING "Credentials invalid or missing." /* Special codes */ #define ERRCONNECT_SUCCESS_STRING "Success." #define ERRCONNECT_NONE_STRING "" -static const ERRINFO ERRCONNECT_CODES[] = -{ +static const ERRINFO ERRCONNECT_CODES[] = { ERRCONNECT_DEFINE(SUCCESS, CAT_NONE), ERRCONNECT_DEFINE(PRE_CONNECT_FAILED, CAT_CONFIG), @@ -207,4 +187,3 @@ const char* freerdp_get_error_connect_name(UINT32 code) return "ERRCONNECT_UNKNOWN"; } - diff --git a/libfreerdp/core/errinfo.c b/libfreerdp/core/errinfo.c index bb3582505..e635847dc 100644 --- a/libfreerdp/core/errinfo.c +++ b/libfreerdp/core/errinfo.c @@ -29,7 +29,10 @@ #define TAG FREERDP_TAG("core") -#define ERRINFO_DEFINE(_code, category) { ERRINFO_##_code , "ERRINFO_" #_code , ERRINFO_##_code##_STRING, category } +#define ERRINFO_DEFINE(_code, category) \ + { \ + ERRINFO_##_code, "ERRINFO_" #_code, ERRINFO_##_code##_STRING, category \ + } int connectErrorCode; @@ -38,47 +41,49 @@ int connectErrorCode; #define ERRINFO_RPC_INITIATED_DISCONNECT_STRING \ "The disconnection was initiated by an administrative tool on the server in another session." -#define ERRINFO_RPC_INITIATED_LOGOFF_STRING \ - "The disconnection was due to a forced logoff initiated by an administrative tool on the server in another session." +#define ERRINFO_RPC_INITIATED_LOGOFF_STRING \ + "The disconnection was due to a forced logoff initiated by an administrative tool on the " \ + "server in another session." -#define ERRINFO_IDLE_TIMEOUT_STRING \ - "The idle session limit timer on the server has elapsed." +#define ERRINFO_IDLE_TIMEOUT_STRING "The idle session limit timer on the server has elapsed." -#define ERRINFO_LOGON_TIMEOUT_STRING \ - "The active session limit timer on the server has elapsed." +#define ERRINFO_LOGON_TIMEOUT_STRING "The active session limit timer on the server has elapsed." #define ERRINFO_DISCONNECTED_BY_OTHER_CONNECTION_STRING \ "Another user connected to the server, forcing the disconnection of the current connection." -#define ERRINFO_OUT_OF_MEMORY_STRING \ - "The server ran out of available memory resources." +#define ERRINFO_OUT_OF_MEMORY_STRING "The server ran out of available memory resources." -#define ERRINFO_SERVER_DENIED_CONNECTION_STRING \ - "The server denied the connection." +#define ERRINFO_SERVER_DENIED_CONNECTION_STRING "The server denied the connection." #define ERRINFO_SERVER_INSUFFICIENT_PRIVILEGES_STRING \ "The user cannot connect to the server due to insufficient access privileges." -#define ERRINFO_SERVER_FRESH_CREDENTIALS_REQUIRED_STRING \ - "The server does not accept saved user credentials and requires that the user enter their credentials for each connection." +#define ERRINFO_SERVER_FRESH_CREDENTIALS_REQUIRED_STRING \ + "The server does not accept saved user credentials and requires that the user enter their " \ + "credentials for each connection." -#define ERRINFO_RPC_INITIATED_DISCONNECT_BY_USER_STRING \ - "The disconnection was initiated by an administrative tool on the server running in the user's session." +#define ERRINFO_RPC_INITIATED_DISCONNECT_BY_USER_STRING \ + "The disconnection was initiated by an administrative tool on the server running in the " \ + "user's session." #define ERRINFO_LOGOFF_BY_USER_STRING \ "The disconnection was initiated by the user logging off their session on the server." -#define ERRINFO_CLOSE_STACK_ON_DRIVER_NOT_READY_STRING \ - "The display driver in the remote session did not report any status within the time allotted for startup." +#define ERRINFO_CLOSE_STACK_ON_DRIVER_NOT_READY_STRING \ + "The display driver in the remote session did not report any status within the time allotted " \ + "for startup." #define ERRINFO_SERVER_DWM_CRASH_STRING \ "The DWM process running in the remote session terminated unexpectedly." -#define ERRINFO_CLOSE_STACK_ON_DRIVER_FAILURE_STRING \ - "The display driver in the remote session was unable to complete all the tasks required for startup." +#define ERRINFO_CLOSE_STACK_ON_DRIVER_FAILURE_STRING \ + "The display driver in the remote session was unable to complete all the tasks required for " \ + "startup." -#define ERRINFO_CLOSE_STACK_ON_DRIVER_IFACE_FAILURE_STRING \ - "The display driver in the remote session started up successfully, but due to internal failures was not usable by the remoting stack." +#define ERRINFO_CLOSE_STACK_ON_DRIVER_IFACE_FAILURE_STRING \ + "The display driver in the remote session started up successfully, but due to internal " \ + "failures was not usable by the remoting stack." #define ERRINFO_SERVER_WINLOGON_CRASH_STRING \ "The Winlogon process running in the remote session terminated unexpectedly." @@ -86,52 +91,54 @@ int connectErrorCode; #define ERRINFO_SERVER_CSRSS_CRASH_STRING \ "The CSRSS process running in the remote session terminated unexpectedly." - /* Protocol-independent codes generated by the Connection Broker */ -#define ERRINFO_CB_DESTINATION_NOT_FOUND_STRING \ - "The target endpoint could not be found." +#define ERRINFO_CB_DESTINATION_NOT_FOUND_STRING "The target endpoint could not be found." -#define ERRINFO_CB_LOADING_DESTINATION_STRING \ - "The target endpoint to which the client is being redirected is disconnecting from the Connection Broker." +#define ERRINFO_CB_LOADING_DESTINATION_STRING \ + "The target endpoint to which the client is being redirected is disconnecting from the " \ + "Connection Broker." -#define ERRINFO_CB_REDIRECTING_TO_DESTINATION_STRING \ +#define ERRINFO_CB_REDIRECTING_TO_DESTINATION_STRING \ "An error occurred while the connection was being redirected to the target endpoint." -#define ERRINFO_CB_SESSION_ONLINE_VM_WAKE_STRING \ +#define ERRINFO_CB_SESSION_ONLINE_VM_WAKE_STRING \ "An error occurred while the target endpoint (a virtual machine) was being awakened." -#define ERRINFO_CB_SESSION_ONLINE_VM_BOOT_STRING \ +#define ERRINFO_CB_SESSION_ONLINE_VM_BOOT_STRING \ "An error occurred while the target endpoint (a virtual machine) was being started." -#define ERRINFO_CB_SESSION_ONLINE_VM_NO_DNS_STRING \ +#define ERRINFO_CB_SESSION_ONLINE_VM_NO_DNS_STRING \ "The IP address of the target endpoint (a virtual machine) cannot be determined." -#define ERRINFO_CB_DESTINATION_POOL_NOT_FREE_STRING \ +#define ERRINFO_CB_DESTINATION_POOL_NOT_FREE_STRING \ "There are no available endpoints in the pool managed by the Connection Broker." -#define ERRINFO_CB_CONNECTION_CANCELLED_STRING \ - "Processing of the connection has been cancelled." +#define ERRINFO_CB_CONNECTION_CANCELLED_STRING "Processing of the connection has been cancelled." -#define ERRINFO_CB_CONNECTION_ERROR_INVALID_SETTINGS_STRING \ - "The settings contained in the routingToken field of the X.224 Connection Request PDU (section 2.2.1.1) cannot be validated." +#define ERRINFO_CB_CONNECTION_ERROR_INVALID_SETTINGS_STRING \ + "The settings contained in the routingToken field of the X.224 Connection Request PDU " \ + "(section 2.2.1.1) cannot be validated." -#define ERRINFO_CB_SESSION_ONLINE_VM_BOOT_TIMEOUT_STRING \ +#define ERRINFO_CB_SESSION_ONLINE_VM_BOOT_TIMEOUT_STRING \ "A time-out occurred while the target endpoint (a virtual machine) was being started." -#define ERRINFO_CB_SESSION_ONLINE_VM_SESSMON_FAILED_STRING \ - "A session monitoring error occurred while the target endpoint (a virtual machine) was being started." +#define ERRINFO_CB_SESSION_ONLINE_VM_SESSMON_FAILED_STRING \ + "A session monitoring error occurred while the target endpoint (a virtual machine) was being " \ + "started." /* Protocol-independent licensing codes */ #define ERRINFO_LICENSE_INTERNAL_STRING \ "An internal error has occurred in the Terminal Services licensing component." -#define ERRINFO_LICENSE_NO_LICENSE_SERVER_STRING \ - "A Remote Desktop License Server ([MS-RDPELE] section 1.1) could not be found to provide a license." +#define ERRINFO_LICENSE_NO_LICENSE_SERVER_STRING \ + "A Remote Desktop License Server ([MS-RDPELE] section 1.1) could not be found to provide a " \ + "license." -#define ERRINFO_LICENSE_NO_LICENSE_STRING \ - "There are no Client Access Licenses ([MS-RDPELE] section 1.1) available for the target remote computer." +#define ERRINFO_LICENSE_NO_LICENSE_STRING \ + "There are no Client Access Licenses ([MS-RDPELE] section 1.1) available for the target " \ + "remote computer." #define ERRINFO_LICENSE_BAD_CLIENT_MSG_STRING \ "The remote computer received an invalid licensing message from the client." @@ -139,11 +146,13 @@ int connectErrorCode; #define ERRINFO_LICENSE_HWID_DOESNT_MATCH_LICENSE_STRING \ "The Client Access License ([MS-RDPELE] section 1.1) stored by the client has been modified." -#define ERRINFO_LICENSE_BAD_CLIENT_LICENSE_STRING \ - "The Client Access License ([MS-RDPELE] section 1.1) stored by the client is in an invalid format." +#define ERRINFO_LICENSE_BAD_CLIENT_LICENSE_STRING \ + "The Client Access License ([MS-RDPELE] section 1.1) stored by the client is in an invalid " \ + "format." -#define ERRINFO_LICENSE_CANT_FINISH_PROTOCOL_STRING \ - "Network problems have caused the licensing protocol ([MS-RDPELE] section 1.3.3) to be terminated." +#define ERRINFO_LICENSE_CANT_FINISH_PROTOCOL_STRING \ + "Network problems have caused the licensing protocol ([MS-RDPELE] section 1.3.3) to be " \ + "terminated." #define ERRINFO_LICENSE_CLIENT_ENDED_PROTOCOL_STRING \ "The client prematurely ended the licensing protocol ([MS-RDPELE] section 1.3.3)." @@ -151,8 +160,9 @@ int connectErrorCode; #define ERRINFO_LICENSE_BAD_CLIENT_ENCRYPTION_STRING \ "A licensing message ([MS-RDPELE] sections 2.2 and 5.1) was incorrectly encrypted." -#define ERRINFO_LICENSE_CANT_UPGRADE_LICENSE_STRING \ - "The Client Access License ([MS-RDPELE] section 1.1) stored by the client could not be upgraded or renewed." +#define ERRINFO_LICENSE_CANT_UPGRADE_LICENSE_STRING \ + "The Client Access License ([MS-RDPELE] section 1.1) stored by the client could not be " \ + "upgraded or renewed." #define ERRINFO_LICENSE_NO_REMOTE_CONNECTIONS_STRING \ "The remote computer is not licensed to accept remote connections." @@ -171,124 +181,157 @@ int connectErrorCode; #define ERRINFO_CONTROL_PDU_SEQUENCE_STRING \ "An out-of-sequence Slow-Path Non-Data PDU (section 2.2.8.1.1.1.1) has been received." -#define ERRINFO_INVALID_CONTROL_PDU_ACTION_STRING \ - "A Control PDU (sections 2.2.1.15 and 2.2.1.16) has been received with an invalid action field." +#define ERRINFO_INVALID_CONTROL_PDU_ACTION_STRING \ + "A Control PDU (sections 2.2.1.15 and 2.2.1.16) has been received with an invalid action " \ + "field." -#define ERRINFO_INVALID_INPUT_PDU_TYPE_STRING \ - "(a) A Slow-Path Input Event (section 2.2.8.1.1.3.1.1) has been received with an invalid messageType field.\n" \ - "(b) A Fast-Path Input Event (section 2.2.8.1.2.2) has been received with an invalid eventCode field." +#define ERRINFO_INVALID_INPUT_PDU_TYPE_STRING \ + "(a) A Slow-Path Input Event (section 2.2.8.1.1.3.1.1) has been received with an invalid " \ + "messageType field.\n" \ + "(b) A Fast-Path Input Event (section 2.2.8.1.2.2) has been received with an invalid " \ + "eventCode field." -#define ERRINFO_INVALID_INPUT_PDU_MOUSE_STRING \ - "(a) A Slow-Path Mouse Event (section 2.2.8.1.1.3.1.1.3) or Extended Mouse Event " \ - "(section 2.2.8.1.1.3.1.1.4) has been received with an invalid pointerFlags field.\n" \ +#define ERRINFO_INVALID_INPUT_PDU_MOUSE_STRING \ + "(a) A Slow-Path Mouse Event (section 2.2.8.1.1.3.1.1.3) or Extended Mouse Event " \ + "(section 2.2.8.1.1.3.1.1.4) has been received with an invalid pointerFlags field.\n" \ "(b) A Fast-Path Mouse Event (section 2.2.8.1.2.2.3) or Fast-Path Extended Mouse Event " \ "(section 2.2.8.1.2.2.4) has been received with an invalid pointerFlags field." #define ERRINFO_INVALID_REFRESH_RECT_PDU_STRING \ "An invalid Refresh Rect PDU (section 2.2.11.2) has been received." -#define ERRINFO_CREATE_USER_DATA_FAILED_STRING \ - "The server failed to construct the GCC Conference Create Response user data (section 2.2.1.4)." +#define ERRINFO_CREATE_USER_DATA_FAILED_STRING \ + "The server failed to construct the GCC Conference Create Response user data (section " \ + "2.2.1.4)." -#define ERRINFO_CONNECT_FAILED_STRING \ +#define ERRINFO_CONNECT_FAILED_STRING \ "Processing during the Channel Connection phase of the RDP Connection Sequence " \ "(see section 1.3.1.1 for an overview of the RDP Connection Sequence phases) has failed." -#define ERRINFO_CONFIRM_ACTIVE_HAS_WRONG_SHAREID_STRING \ - "A Confirm Active PDU (section 2.2.1.13.2) was received from the client with an invalid shareId field." +#define ERRINFO_CONFIRM_ACTIVE_HAS_WRONG_SHAREID_STRING \ + "A Confirm Active PDU (section 2.2.1.13.2) was received from the client with an invalid " \ + "shareId field." -#define ERRINFO_CONFIRM_ACTIVE_HAS_WRONG_ORIGINATOR_STRING \ - "A Confirm Active PDU (section 2.2.1.13.2) was received from the client with an invalid originatorId field." +#define ERRINFO_CONFIRM_ACTIVE_HAS_WRONG_ORIGINATOR_STRING \ + "A Confirm Active PDU (section 2.2.1.13.2) was received from the client with an invalid " \ + "originatorId field." #define ERRINFO_PERSISTENT_KEY_PDU_BAD_LENGTH_STRING \ "There is not enough data to process a Persistent Key List PDU (section 2.2.1.17)." -#define ERRINFO_PERSISTENT_KEY_PDU_ILLEGAL_FIRST_STRING \ - "A Persistent Key List PDU (section 2.2.1.17) marked as PERSIST_PDU_FIRST (0x01) was received after the reception " \ +#define ERRINFO_PERSISTENT_KEY_PDU_ILLEGAL_FIRST_STRING \ + "A Persistent Key List PDU (section 2.2.1.17) marked as PERSIST_PDU_FIRST (0x01) was " \ + "received after the reception " \ "of a prior Persistent Key List PDU also marked as PERSIST_PDU_FIRST." -#define ERRINFO_PERSISTENT_KEY_PDU_TOO_MANY_TOTAL_KEYS_STRING \ - "A Persistent Key List PDU (section 2.2.1.17) was received which specified a total number of bitmap cache entries larger than 262144." +#define ERRINFO_PERSISTENT_KEY_PDU_TOO_MANY_TOTAL_KEYS_STRING \ + "A Persistent Key List PDU (section 2.2.1.17) was received which specified a total number of " \ + "bitmap cache entries larger than 262144." -#define ERRINFO_PERSISTENT_KEY_PDU_TOO_MANY_CACHE_KEYS_STRING \ - "A Persistent Key List PDU (section 2.2.1.17) was received which specified an invalid total number of keys for a bitmap cache " \ - "(the number of entries that can be stored within each bitmap cache is specified in the Revision 1 or 2 Bitmap Cache Capability Set " \ +#define ERRINFO_PERSISTENT_KEY_PDU_TOO_MANY_CACHE_KEYS_STRING \ + "A Persistent Key List PDU (section 2.2.1.17) was received which specified an invalid total " \ + "number of keys for a bitmap cache " \ + "(the number of entries that can be stored within each bitmap cache is specified in the " \ + "Revision 1 or 2 Bitmap Cache Capability Set " \ "(section 2.2.7.1.4) that is sent from client to server)." -#define ERRINFO_INPUT_PDU_BAD_LENGTH_STRING \ - "There is not enough data to process Input Event PDU Data (section 2.2.8.1.1.3.1) or a Fast-Path Input Event PDU (section 2.2.8.1.2)." \ +#define ERRINFO_INPUT_PDU_BAD_LENGTH_STRING \ + "There is not enough data to process Input Event PDU Data (section 2.2.8.1.1.3.1) or a " \ + "Fast-Path Input Event PDU (section 2.2.8.1.2)." -#define ERRINFO_BITMAP_CACHE_ERROR_PDU_BAD_LENGTH_STRING \ +#define ERRINFO_BITMAP_CACHE_ERROR_PDU_BAD_LENGTH_STRING \ "There is not enough data to process the shareDataHeader, NumInfoBlocks, " \ "Pad1, and Pad2 fields of the Bitmap Cache Error PDU Data ([MS-RDPEGDI] section 2.2.2.3.1.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT_STRING \ - "(a) The dataSignature field of the Fast-Path Input Event PDU (section 2.2.8.1.2) does not contain enough data.\n" \ - "(b) The fipsInformation and dataSignature fields of the Fast-Path Input Event PDU (section 2.2.8.1.2) do not contain enough data." +#define ERRINFO_SECURITY_DATA_TOO_SHORT_STRING \ + "(a) The dataSignature field of the Fast-Path Input Event PDU (section 2.2.8.1.2) does not " \ + "contain enough data.\n" \ + "(b) The fipsInformation and dataSignature fields of the Fast-Path Input Event PDU (section " \ + "2.2.8.1.2) do not contain enough data." -#define ERRINFO_VCHANNEL_DATA_TOO_SHORT_STRING \ - "(a) There is not enough data in the Client Network Data (section 2.2.1.3.4) to read the virtual channel configuration data.\n" \ +#define ERRINFO_VCHANNEL_DATA_TOO_SHORT_STRING \ + "(a) There is not enough data in the Client Network Data (section 2.2.1.3.4) to read the " \ + "virtual channel configuration data.\n" \ "(b) There is not enough data to read a complete Channel PDU Header (section 2.2.6.1.1)." -#define ERRINFO_SHARE_DATA_TOO_SHORT_STRING \ - "(a) There is not enough data to process Control PDU Data (section 2.2.1.15.1).\n" \ - "(b) There is not enough data to read a complete Share Control Header (section 2.2.8.1.1.1.1).\n" \ - "(c) There is not enough data to read a complete Share Data Header (section 2.2.8.1.1.1.2) of a Slow-Path Data PDU (section 2.2.8.1.1.1.1).\n" \ +#define ERRINFO_SHARE_DATA_TOO_SHORT_STRING \ + "(a) There is not enough data to process Control PDU Data (section 2.2.1.15.1).\n" \ + "(b) There is not enough data to read a complete Share Control Header (section " \ + "2.2.8.1.1.1.1).\n" \ + "(c) There is not enough data to read a complete Share Data Header (section 2.2.8.1.1.1.2) " \ + "of a Slow-Path Data PDU (section 2.2.8.1.1.1.1).\n" \ "(d) There is not enough data to process Font List PDU Data (section 2.2.1.18.1)." -#define ERRINFO_BAD_SUPPRESS_OUTPUT_PDU_STRING \ - "(a) There is not enough data to process Suppress Output PDU Data (section 2.2.11.3.1).\n" \ - "(b) The allowDisplayUpdates field of the Suppress Output PDU Data (section 2.2.11.3.1) is invalid." +#define ERRINFO_BAD_SUPPRESS_OUTPUT_PDU_STRING \ + "(a) There is not enough data to process Suppress Output PDU Data (section 2.2.11.3.1).\n" \ + "(b) The allowDisplayUpdates field of the Suppress Output PDU Data (section 2.2.11.3.1) is " \ + "invalid." -#define ERRINFO_CONFIRM_ACTIVE_PDU_TOO_SHORT_STRING \ - "(a) There is not enough data to read the shareControlHeader, shareId, originatorId, lengthSourceDescriptor, " \ - "and lengthCombinedCapabilities fields of the Confirm Active PDU Data (section 2.2.1.13.2.1).\n" \ - "(b) There is not enough data to read the sourceDescriptor, numberCapabilities, pad2Octets, and capabilitySets " \ +#define ERRINFO_CONFIRM_ACTIVE_PDU_TOO_SHORT_STRING \ + "(a) There is not enough data to read the shareControlHeader, shareId, originatorId, " \ + "lengthSourceDescriptor, " \ + "and lengthCombinedCapabilities fields of the Confirm Active PDU Data (section " \ + "2.2.1.13.2.1).\n" \ + "(b) There is not enough data to read the sourceDescriptor, numberCapabilities, pad2Octets, " \ + "and capabilitySets " \ "fields of the Confirm Active PDU Data (section 2.2.1.13.2.1)." -#define ERRINFO_CAPABILITY_SET_TOO_SMALL_STRING \ - "There is not enough data to read the capabilitySetType and the lengthCapability fields in a received Capability Set (section 2.2.1.13.1.1.1)." +#define ERRINFO_CAPABILITY_SET_TOO_SMALL_STRING \ + "There is not enough data to read the capabilitySetType and the lengthCapability fields in a " \ + "received Capability Set (section 2.2.1.13.1.1.1)." -#define ERRINFO_CAPABILITY_SET_TOO_LARGE_STRING \ +#define ERRINFO_CAPABILITY_SET_TOO_LARGE_STRING \ "A Capability Set (section 2.2.1.13.1.1.1) has been received with a lengthCapability " \ "field that contains a value greater than the total length of the data received." -#define ERRINFO_NO_CURSOR_CACHE_STRING \ - "(a) Both the colorPointerCacheSize and pointerCacheSize fields in the Pointer Capability Set (section 2.2.7.1.5) are set to zero.\n" \ - "(b) The pointerCacheSize field in the Pointer Capability Set (section 2.2.7.1.5) is not present, and the colorPointerCacheSize field is set to zero." +#define ERRINFO_NO_CURSOR_CACHE_STRING \ + "(a) Both the colorPointerCacheSize and pointerCacheSize fields in the Pointer Capability " \ + "Set (section 2.2.7.1.5) are set to zero.\n" \ + "(b) The pointerCacheSize field in the Pointer Capability Set (section 2.2.7.1.5) is not " \ + "present, and the colorPointerCacheSize field is set to zero." -#define ERRINFO_BAD_CAPABILITIES_STRING \ - "The capabilities received from the client in the Confirm Active PDU (section 2.2.1.13.2) were not accepted by the server." +#define ERRINFO_BAD_CAPABILITIES_STRING \ + "The capabilities received from the client in the Confirm Active PDU (section 2.2.1.13.2) " \ + "were not accepted by the server." -#define ERRINFO_VIRTUAL_CHANNEL_DECOMPRESSION_STRING \ - "An error occurred while using the bulk compressor (section 3.1.8 and [MS-RDPEGDI] section 3.1.8) to decompress a Virtual Channel PDU (section 2.2.6.1)" +#define ERRINFO_VIRTUAL_CHANNEL_DECOMPRESSION_STRING \ + "An error occurred while using the bulk compressor (section 3.1.8 and [MS-RDPEGDI] section " \ + "3.1.8) to decompress a Virtual Channel PDU (section 2.2.6.1)" -#define ERRINFO_INVALID_VC_COMPRESSION_TYPE_STRING \ - "An invalid bulk compression package was specified in the flags field of the Channel PDU Header (section 2.2.6.1.1)." +#define ERRINFO_INVALID_VC_COMPRESSION_TYPE_STRING \ + "An invalid bulk compression package was specified in the flags field of the Channel PDU " \ + "Header (section 2.2.6.1.1)." -#define ERRINFO_INVALID_CHANNEL_ID_STRING \ - "An invalid MCS channel ID was specified in the mcsPdu field of the Virtual Channel PDU (section 2.2.6.1)." +#define ERRINFO_INVALID_CHANNEL_ID_STRING \ + "An invalid MCS channel ID was specified in the mcsPdu field of the Virtual Channel PDU " \ + "(section 2.2.6.1)." -#define ERRINFO_VCHANNELS_TOO_MANY_STRING \ - "The client requested more than the maximum allowed 31 static virtual channels in the Client Network Data (section 2.2.1.3.4)." +#define ERRINFO_VCHANNELS_TOO_MANY_STRING \ + "The client requested more than the maximum allowed 31 static virtual channels in the Client " \ + "Network Data (section 2.2.1.3.4)." -#define ERRINFO_REMOTEAPP_NOT_ENABLED_STRING \ - "The INFO_RAIL flag (0x00008000) MUST be set in the flags field of the Info Packet (section 2.2.1.11.1.1) " \ +#define ERRINFO_REMOTEAPP_NOT_ENABLED_STRING \ + "The INFO_RAIL flag (0x00008000) MUST be set in the flags field of the Info Packet (section " \ + "2.2.1.11.1.1) " \ "as the session on the remote server can only host remote applications." -#define ERRINFO_CACHE_CAP_NOT_SET_STRING \ - "The client sent a Persistent Key List PDU (section 2.2.1.17) without including the prerequisite Revision 2 Bitmap Cache " \ +#define ERRINFO_CACHE_CAP_NOT_SET_STRING \ + "The client sent a Persistent Key List PDU (section 2.2.1.17) without including the " \ + "prerequisite Revision 2 Bitmap Cache " \ "Capability Set (section 2.2.7.1.4.2) in the Confirm Active PDU (section 2.2.1.13.2)." -#define ERRINFO_BITMAP_CACHE_ERROR_PDU_BAD_LENGTH2_STRING \ - "The NumInfoBlocks field in the Bitmap Cache Error PDU Data is inconsistent with the amount of data in the " \ +#define ERRINFO_BITMAP_CACHE_ERROR_PDU_BAD_LENGTH2_STRING \ + "The NumInfoBlocks field in the Bitmap Cache Error PDU Data is inconsistent with the amount " \ + "of data in the " \ "Info field ([MS-RDPEGDI] section 2.2.2.3.1.1)." -#define ERRINFO_OFFSCREEN_CACHE_ERROR_PDU_BAD_LENGTH_STRING \ - "There is not enough data to process an Offscreen Bitmap Cache Error PDU ([MS-RDPEGDI] section 2.2.2.3.2)." +#define ERRINFO_OFFSCREEN_CACHE_ERROR_PDU_BAD_LENGTH_STRING \ + "There is not enough data to process an Offscreen Bitmap Cache Error PDU ([MS-RDPEGDI] " \ + "section 2.2.2.3.2)." -#define ERRINFO_DRAWNINEGRID_CACHE_ERROR_PDU_BAD_LENGTH_STRING \ - "There is not enough data to process a DrawNineGrid Cache Error PDU ([MS-RDPEGDI] section 2.2.2.3.3)." +#define ERRINFO_DRAWNINEGRID_CACHE_ERROR_PDU_BAD_LENGTH_STRING \ + "There is not enough data to process a DrawNineGrid Cache Error PDU ([MS-RDPEGDI] section " \ + "2.2.2.3.3)." #define ERRINFO_GDIPLUS_PDU_BAD_LENGTH_STRING \ "There is not enough data to process a GDI+ Error PDU ([MS-RDPEGDI] section 2.2.2.3.4)." @@ -296,68 +339,89 @@ int connectErrorCode; #define ERRINFO_SECURITY_DATA_TOO_SHORT2_STRING \ "There is not enough data to read a Basic Security Header (section 2.2.8.1.1.2.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT3_STRING \ - "There is not enough data to read a Non-FIPS Security Header (section 2.2.8.1.1.2.2) or FIPS Security Header (section 2.2.8.1.1.2.3)." +#define ERRINFO_SECURITY_DATA_TOO_SHORT3_STRING \ + "There is not enough data to read a Non-FIPS Security Header (section 2.2.8.1.1.2.2) or FIPS " \ + "Security Header (section 2.2.8.1.1.2.3)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT4_STRING \ - "There is not enough data to read the basicSecurityHeader and length fields of the Security Exchange PDU Data (section 2.2.1.10.1)." +#define ERRINFO_SECURITY_DATA_TOO_SHORT4_STRING \ + "There is not enough data to read the basicSecurityHeader and length fields of the Security " \ + "Exchange PDU Data (section 2.2.1.10.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT5_STRING \ - "There is not enough data to read the CodePage, flags, cbDomain, cbUserName, cbPassword, cbAlternateShell, " \ - "cbWorkingDir, Domain, UserName, Password, AlternateShell, and WorkingDir fields in the Info Packet (section 2.2.1.11.1.1)." +#define ERRINFO_SECURITY_DATA_TOO_SHORT5_STRING \ + "There is not enough data to read the CodePage, flags, cbDomain, cbUserName, cbPassword, " \ + "cbAlternateShell, " \ + "cbWorkingDir, Domain, UserName, Password, AlternateShell, and WorkingDir fields in the Info " \ + "Packet (section 2.2.1.11.1.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT6_STRING \ - "There is not enough data to read the CodePage, flags, cbDomain, cbUserName, cbPassword, cbAlternateShell, " \ +#define ERRINFO_SECURITY_DATA_TOO_SHORT6_STRING \ + "There is not enough data to read the CodePage, flags, cbDomain, cbUserName, cbPassword, " \ + "cbAlternateShell, " \ "and cbWorkingDir fields in the Info Packet (section 2.2.1.11.1.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT7_STRING \ - "There is not enough data to read the clientAddressFamily and cbClientAddress fields in the Extended Info Packet (section 2.2.1.11.1.1.1)." +#define ERRINFO_SECURITY_DATA_TOO_SHORT7_STRING \ + "There is not enough data to read the clientAddressFamily and cbClientAddress fields in the " \ + "Extended Info Packet (section 2.2.1.11.1.1.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT8_STRING \ - "There is not enough data to read the clientAddress field in the Extended Info Packet (section 2.2.1.11.1.1.1)." +#define ERRINFO_SECURITY_DATA_TOO_SHORT8_STRING \ + "There is not enough data to read the clientAddress field in the Extended Info Packet " \ + "(section 2.2.1.11.1.1.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT9_STRING \ - "There is not enough data to read the cbClientDir field in the Extended Info Packet (section 2.2.1.11.1.1.1)." +#define ERRINFO_SECURITY_DATA_TOO_SHORT9_STRING \ + "There is not enough data to read the cbClientDir field in the Extended Info Packet (section " \ + "2.2.1.11.1.1.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT10_STRING \ - "There is not enough data to read the clientDir field in the Extended Info Packet (section 2.2.1.11.1.1.1)." +#define ERRINFO_SECURITY_DATA_TOO_SHORT10_STRING \ + "There is not enough data to read the clientDir field in the Extended Info Packet (section " \ + "2.2.1.11.1.1.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT11_STRING \ - "There is not enough data to read the clientTimeZone field in the Extended Info Packet (section 2.2.1.11.1.1.1)." +#define ERRINFO_SECURITY_DATA_TOO_SHORT11_STRING \ + "There is not enough data to read the clientTimeZone field in the Extended Info Packet " \ + "(section 2.2.1.11.1.1.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT12_STRING \ - "There is not enough data to read the clientSessionId field in the Extended Info Packet (section 2.2.1.11.1.1.1)." +#define ERRINFO_SECURITY_DATA_TOO_SHORT12_STRING \ + "There is not enough data to read the clientSessionId field in the Extended Info Packet " \ + "(section 2.2.1.11.1.1.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT13_STRING \ - "There is not enough data to read the performanceFlags field in the Extended Info Packet (section 2.2.1.11.1.1.1)." +#define ERRINFO_SECURITY_DATA_TOO_SHORT13_STRING \ + "There is not enough data to read the performanceFlags field in the Extended Info Packet " \ + "(section 2.2.1.11.1.1.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT14_STRING \ - "There is not enough data to read the cbAutoReconnectLen field in the Extended Info Packet (section 2.2.1.11.1.1.1)." +#define ERRINFO_SECURITY_DATA_TOO_SHORT14_STRING \ + "There is not enough data to read the cbAutoReconnectLen field in the Extended Info Packet " \ + "(section 2.2.1.11.1.1.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT15_STRING \ - "There is not enough data to read the autoReconnectCookie field in the Extended Info Packet (section 2.2.1.11.1.1.1)." +#define ERRINFO_SECURITY_DATA_TOO_SHORT15_STRING \ + "There is not enough data to read the autoReconnectCookie field in the Extended Info Packet " \ + "(section 2.2.1.11.1.1.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT16_STRING \ - "The cbAutoReconnectLen field in the Extended Info Packet (section 2.2.1.11.1.1.1) contains a value " \ +#define ERRINFO_SECURITY_DATA_TOO_SHORT16_STRING \ + "The cbAutoReconnectLen field in the Extended Info Packet (section 2.2.1.11.1.1.1) contains " \ + "a value " \ "which is larger than the maximum allowed length of 128 bytes." -#define ERRINFO_SECURITY_DATA_TOO_SHORT17_STRING \ - "There is not enough data to read the clientAddressFamily and cbClientAddress fields in the Extended Info Packet (section 2.2.1.11.1.1.1)." +#define ERRINFO_SECURITY_DATA_TOO_SHORT17_STRING \ + "There is not enough data to read the clientAddressFamily and cbClientAddress fields in the " \ + "Extended Info Packet (section 2.2.1.11.1.1.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT18_STRING \ - "There is not enough data to read the clientAddress field in the Extended Info Packet (section 2.2.1.11.1.1.1)." +#define ERRINFO_SECURITY_DATA_TOO_SHORT18_STRING \ + "There is not enough data to read the clientAddress field in the Extended Info Packet " \ + "(section 2.2.1.11.1.1.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT19_STRING \ - "There is not enough data to read the cbClientDir field in the Extended Info Packet (section 2.2.1.11.1.1.1)." +#define ERRINFO_SECURITY_DATA_TOO_SHORT19_STRING \ + "There is not enough data to read the cbClientDir field in the Extended Info Packet (section " \ + "2.2.1.11.1.1.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT20_STRING \ - "There is not enough data to read the clientDir field in the Extended Info Packet (section 2.2.1.11.1.1.1)." +#define ERRINFO_SECURITY_DATA_TOO_SHORT20_STRING \ + "There is not enough data to read the clientDir field in the Extended Info Packet (section " \ + "2.2.1.11.1.1.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT21_STRING \ - "There is not enough data to read the clientTimeZone field in the Extended Info Packet (section 2.2.1.11.1.1.1)." +#define ERRINFO_SECURITY_DATA_TOO_SHORT21_STRING \ + "There is not enough data to read the clientTimeZone field in the Extended Info Packet " \ + "(section 2.2.1.11.1.1.1)." -#define ERRINFO_SECURITY_DATA_TOO_SHORT22_STRING \ - "There is not enough data to read the clientSessionId field in the Extended Info Packet (section 2.2.1.11.1.1.1)." +#define ERRINFO_SECURITY_DATA_TOO_SHORT22_STRING \ + "There is not enough data to read the clientSessionId field in the Extended Info Packet " \ + "(section 2.2.1.11.1.1.1)." #define ERRINFO_SECURITY_DATA_TOO_SHORT23_STRING \ "There is not enough data to read the Client Info PDU Data (section 2.2.1.11.1)." @@ -365,12 +429,14 @@ int connectErrorCode; #define ERRINFO_BAD_MONITOR_DATA_STRING \ "The monitorCount field in the Client Monitor Data (section 2.2.1.3.6) is invalid." -#define ERRINFO_VC_DECOMPRESSED_REASSEMBLE_FAILED_STRING \ - "The server-side decompression buffer is invalid, or the size of the decompressed VC data exceeds " \ +#define ERRINFO_VC_DECOMPRESSED_REASSEMBLE_FAILED_STRING \ + "The server-side decompression buffer is invalid, or the size of the decompressed VC data " \ + "exceeds " \ "the chunking size specified in the Virtual Channel Capability Set (section 2.2.7.1.10)." -#define ERRINFO_VC_DATA_TOO_LONG_STRING \ - "The size of a received Virtual Channel PDU (section 2.2.6.1) exceeds the chunking size specified " \ +#define ERRINFO_VC_DATA_TOO_LONG_STRING \ + "The size of a received Virtual Channel PDU (section 2.2.6.1) exceeds the chunking size " \ + "specified " \ "in the Virtual Channel Capability Set (section 2.2.7.1.10)." #define ERRINFO_BAD_FRAME_ACK_DATA_STRING \ @@ -382,23 +448,28 @@ int connectErrorCode; #define ERRINFO_GRAPHICS_SUBSYSTEM_RESET_FAILED_STRING \ "The server-side graphics subsystem failed to reset." -#define ERRINFO_GRAPHICS_SUBSYSTEM_FAILED_STRING \ - "The server-side graphics subsystem is in an error state and unable to continue graphics encoding." +#define ERRINFO_GRAPHICS_SUBSYSTEM_FAILED_STRING \ + "The server-side graphics subsystem is in an error state and unable to continue graphics " \ + "encoding." -#define ERRINFO_TIMEZONE_KEY_NAME_LENGTH_TOO_SHORT_STRING \ - "There is not enough data to read the cbDynamicDSTTimeZoneKeyName field in the Extended Info Packet (section 2.2.1.11.1.1.1)." +#define ERRINFO_TIMEZONE_KEY_NAME_LENGTH_TOO_SHORT_STRING \ + "There is not enough data to read the cbDynamicDSTTimeZoneKeyName field in the Extended Info " \ + "Packet (section 2.2.1.11.1.1.1)." -#define ERRINFO_TIMEZONE_KEY_NAME_LENGTH_TOO_LONG_STRING \ - "The length reported in the cbDynamicDSTTimeZoneKeyName field of the Extended Info Packet (section 2.2.1.11.1.1.1) is too long." +#define ERRINFO_TIMEZONE_KEY_NAME_LENGTH_TOO_LONG_STRING \ + "The length reported in the cbDynamicDSTTimeZoneKeyName field of the Extended Info Packet " \ + "(section 2.2.1.11.1.1.1) is too long." -#define ERRINFO_DYNAMIC_DST_DISABLED_FIELD_MISSING_STRING \ - "The dynamicDaylightTimeDisabled field is not present in the Extended Info Packet (section 2.2.1.11.1.1.1)." +#define ERRINFO_DYNAMIC_DST_DISABLED_FIELD_MISSING_STRING \ + "The dynamicDaylightTimeDisabled field is not present in the Extended Info Packet (section " \ + "2.2.1.11.1.1.1)." #define ERRINFO_VC_DECODING_ERROR_STRING \ "An error occurred when processing dynamic virtual channel data ([MS-RDPEDYC] section 3.3.5)." -#define ERRINFO_VIRTUALDESKTOPTOOLARGE_STRING \ - "The width or height of the virtual desktop defined by the monitor layout in the Client Monitor Data " \ +#define ERRINFO_VIRTUALDESKTOPTOOLARGE_STRING \ + "The width or height of the virtual desktop defined by the monitor layout in the Client " \ + "Monitor Data " \ "(section 2.2.1.3.6) is larger than the maximum allowed value of 32,766." #define ERRINFO_MONITORGEOMETRYVALIDATIONFAILED_STRING \ @@ -407,41 +478,40 @@ int connectErrorCode; #define ERRINFO_INVALIDMONITORCOUNT_STRING \ "The monitorCount field in the Client Monitor Data(section 2.2.1.3.6) is too large." -#define ERRINFO_UPDATE_SESSION_KEY_FAILED_STRING \ - "An attempt to update the session keys while using Standard RDP Security mechanisms (section 5.3.7) failed." +#define ERRINFO_UPDATE_SESSION_KEY_FAILED_STRING \ + "An attempt to update the session keys while using Standard RDP Security mechanisms (section " \ + "5.3.7) failed." -#define ERRINFO_DECRYPT_FAILED_STRING \ +#define ERRINFO_DECRYPT_FAILED_STRING \ "(a) Decryption using Standard RDP Security mechanisms (section 5.3.6) failed.\n" \ "(b) Session key creation using Standard RDP Security mechanisms (section 5.3.5) failed." #define ERRINFO_ENCRYPT_FAILED_STRING \ "Encryption using Standard RDP Security mechanisms (section 5.3.6) failed." -#define ERRINFO_ENCRYPTION_PACKAGE_MISMATCH_STRING \ - "Failed to find a usable Encryption Method (section 5.3.2) in the encryptionMethods field of the Client Security Data (section 2.2.1.4.3)." +#define ERRINFO_ENCRYPTION_PACKAGE_MISMATCH_STRING \ + "Failed to find a usable Encryption Method (section 5.3.2) in the encryptionMethods field of " \ + "the Client Security Data (section 2.2.1.4.3)." -#define ERRINFO_DECRYPT_FAILED2_STRING \ - "Unencrypted data was encountered in a protocol stream which is meant to be encrypted with Standard RDP Security mechanisms (section 5.3.6)." +#define ERRINFO_DECRYPT_FAILED2_STRING \ + "Unencrypted data was encountered in a protocol stream which is meant to be encrypted with " \ + "Standard RDP Security mechanisms (section 5.3.6)." -#define ERRINFO_PEER_DISCONNECTED_STRING \ - "The peer connection was lost." +#define ERRINFO_PEER_DISCONNECTED_STRING "The peer connection was lost." /* Special codes */ #define ERRINFO_SUCCESS_STRING "Success." #define ERRINFO_NONE_STRING "" -static const ERRINFO ERRINFO_CODES[] = -{ +static const ERRINFO ERRINFO_CODES[] = { ERRINFO_DEFINE(SUCCESS, CAT_NONE), /* Protocol-independent codes */ ERRINFO_DEFINE(RPC_INITIATED_DISCONNECT, CAT_ADMIN), - ERRINFO_DEFINE(RPC_INITIATED_LOGOFF, CAT_ADMIN), - ERRINFO_DEFINE(IDLE_TIMEOUT, CAT_ADMIN), + ERRINFO_DEFINE(RPC_INITIATED_LOGOFF, CAT_ADMIN), ERRINFO_DEFINE(IDLE_TIMEOUT, CAT_ADMIN), ERRINFO_DEFINE(LOGON_TIMEOUT, CAT_ADMIN), ERRINFO_DEFINE(DISCONNECTED_BY_OTHER_CONNECTION, CAT_USE), - ERRINFO_DEFINE(OUT_OF_MEMORY, CAT_ADMIN), - ERRINFO_DEFINE(SERVER_DENIED_CONNECTION, CAT_ADMIN), + ERRINFO_DEFINE(OUT_OF_MEMORY, CAT_ADMIN), ERRINFO_DEFINE(SERVER_DENIED_CONNECTION, CAT_ADMIN), ERRINFO_DEFINE(SERVER_INSUFFICIENT_PRIVILEGES, CAT_ADMIN), ERRINFO_DEFINE(SERVER_FRESH_CREDENTIALS_REQUIRED, CAT_ADMIN), ERRINFO_DEFINE(RPC_INITIATED_DISCONNECT_BY_USER, CAT_ADMIN), @@ -481,15 +551,13 @@ static const ERRINFO ERRINFO_CODES[] = /* RDP specific codes */ ERRINFO_DEFINE(UNKNOWN_DATA_PDU_TYPE, CAT_PROTOCOL), - ERRINFO_DEFINE(UNKNOWN_PDU_TYPE, CAT_PROTOCOL), - ERRINFO_DEFINE(DATA_PDU_SEQUENCE, CAT_PROTOCOL), + ERRINFO_DEFINE(UNKNOWN_PDU_TYPE, CAT_PROTOCOL), ERRINFO_DEFINE(DATA_PDU_SEQUENCE, CAT_PROTOCOL), ERRINFO_DEFINE(CONTROL_PDU_SEQUENCE, CAT_PROTOCOL), ERRINFO_DEFINE(INVALID_CONTROL_PDU_ACTION, CAT_PROTOCOL), ERRINFO_DEFINE(INVALID_INPUT_PDU_TYPE, CAT_PROTOCOL), ERRINFO_DEFINE(INVALID_INPUT_PDU_MOUSE, CAT_PROTOCOL), ERRINFO_DEFINE(INVALID_REFRESH_RECT_PDU, CAT_PROTOCOL), - ERRINFO_DEFINE(CREATE_USER_DATA_FAILED, CAT_PROTOCOL), - ERRINFO_DEFINE(CONNECT_FAILED, CAT_USE), + ERRINFO_DEFINE(CREATE_USER_DATA_FAILED, CAT_PROTOCOL), ERRINFO_DEFINE(CONNECT_FAILED, CAT_USE), ERRINFO_DEFINE(CONFIRM_ACTIVE_HAS_WRONG_SHAREID, CAT_PROTOCOL), ERRINFO_DEFINE(CONFIRM_ACTIVE_HAS_WRONG_ORIGINATOR, CAT_PROTOCOL), ERRINFO_DEFINE(PERSISTENT_KEY_PDU_BAD_LENGTH, CAT_PROTOCOL), @@ -505,8 +573,7 @@ static const ERRINFO ERRINFO_CODES[] = ERRINFO_DEFINE(CONFIRM_ACTIVE_PDU_TOO_SHORT, CAT_PROTOCOL), ERRINFO_DEFINE(CAPABILITY_SET_TOO_SMALL, CAT_PROTOCOL), ERRINFO_DEFINE(CAPABILITY_SET_TOO_LARGE, CAT_PROTOCOL), - ERRINFO_DEFINE(NO_CURSOR_CACHE, CAT_PROTOCOL), - ERRINFO_DEFINE(BAD_CAPABILITIES, CAT_PROTOCOL), + ERRINFO_DEFINE(NO_CURSOR_CACHE, CAT_PROTOCOL), ERRINFO_DEFINE(BAD_CAPABILITIES, CAT_PROTOCOL), ERRINFO_DEFINE(VIRTUAL_CHANNEL_DECOMPRESSION, CAT_PROTOCOL), ERRINFO_DEFINE(INVALID_VC_COMPRESSION_TYPE, CAT_PROTOCOL), ERRINFO_DEFINE(INVALID_CHANNEL_ID, CAT_PROTOCOL), @@ -554,11 +621,9 @@ static const ERRINFO ERRINFO_CODES[] = ERRINFO_DEFINE(MONITORGEOMETRYVALIDATIONFAILED, CAT_PROTOCOL), ERRINFO_DEFINE(INVALIDMONITORCOUNT, CAT_PROTOCOL), ERRINFO_DEFINE(UPDATE_SESSION_KEY_FAILED, CAT_PROTOCOL), - ERRINFO_DEFINE(DECRYPT_FAILED, CAT_PROTOCOL), - ERRINFO_DEFINE(ENCRYPT_FAILED, CAT_PROTOCOL), + ERRINFO_DEFINE(DECRYPT_FAILED, CAT_PROTOCOL), ERRINFO_DEFINE(ENCRYPT_FAILED, CAT_PROTOCOL), ERRINFO_DEFINE(ENCRYPTION_PACKAGE_MISMATCH, CAT_PROTOCOL), - ERRINFO_DEFINE(DECRYPT_FAILED2, CAT_PROTOCOL), - ERRINFO_DEFINE(PEER_DISCONNECTED, CAT_USE), + ERRINFO_DEFINE(DECRYPT_FAILED2, CAT_PROTOCOL), ERRINFO_DEFINE(PEER_DISCONNECTED, CAT_USE), ERRINFO_DEFINE(NONE, CAT_NONE) }; @@ -626,12 +691,12 @@ void rdp_print_errinfo(UINT32 code) { if (code == errInfo->code) { - WLog_INFO(TAG, "%s (0x%08"PRIX32"):%s", errInfo->name, code, errInfo->info); + WLog_INFO(TAG, "%s (0x%08" PRIX32 "):%s", errInfo->name, code, errInfo->info); return; } errInfo++; } - WLog_ERR(TAG, "ERRINFO_UNKNOWN 0x%08"PRIX32": Unknown error.", code); + WLog_ERR(TAG, "ERRINFO_UNKNOWN 0x%08" PRIX32 ": Unknown error.", code); } diff --git a/libfreerdp/core/fastpath.c b/libfreerdp/core/fastpath.c index 3d2ee348d..a4506d096 100644 --- a/libfreerdp/core/fastpath.c +++ b/libfreerdp/core/fastpath.c @@ -57,20 +57,19 @@ * two less significant bits of the first byte. */ -static const char* const FASTPATH_UPDATETYPE_STRINGS[] = -{ - "Orders", /* 0x0 */ - "Bitmap", /* 0x1 */ - "Palette", /* 0x2 */ - "Synchronize", /* 0x3 */ - "Surface Commands", /* 0x4 */ - "System Pointer Hidden", /* 0x5 */ - "System Pointer Default", /* 0x6 */ - "???", /* 0x7 */ - "Pointer Position", /* 0x8 */ - "Color Pointer", /* 0x9 */ - "Cached Pointer", /* 0xA */ - "New Pointer", /* 0xB */ +static const char* const FASTPATH_UPDATETYPE_STRINGS[] = { + "Orders", /* 0x0 */ + "Bitmap", /* 0x1 */ + "Palette", /* 0x2 */ + "Synchronize", /* 0x3 */ + "Surface Commands", /* 0x4 */ + "System Pointer Hidden", /* 0x5 */ + "System Pointer Default", /* 0x6 */ + "???", /* 0x7 */ + "Pointer Position", /* 0x8 */ + "Color Pointer", /* 0x9 */ + "Cached Pointer", /* 0xA */ + "New Pointer", /* 0xB */ }; static const char* fastpath_update_to_string(UINT8 update) @@ -180,8 +179,8 @@ static UINT32 fastpath_get_update_header_size(FASTPATH_UPDATE_HEADER* fpUpdateHe } static BOOL fastpath_write_update_pdu_header(wStream* s, - FASTPATH_UPDATE_PDU_HEADER* fpUpdatePduHeader, - rdpRdp* rdp) + FASTPATH_UPDATE_PDU_HEADER* fpUpdatePduHeader, + rdpRdp* rdp) { if (!s || !fpUpdatePduHeader || !rdp) return FALSE; @@ -192,9 +191,9 @@ static BOOL fastpath_write_update_pdu_header(wStream* s, fpUpdatePduHeader->fpOutputHeader = 0; fpUpdatePduHeader->fpOutputHeader |= (fpUpdatePduHeader->action & 0x03); fpUpdatePduHeader->fpOutputHeader |= (fpUpdatePduHeader->secFlags & 0x03) << 6; - Stream_Write_UINT8(s, fpUpdatePduHeader->fpOutputHeader); /* fpOutputHeader (1 byte) */ + Stream_Write_UINT8(s, fpUpdatePduHeader->fpOutputHeader); /* fpOutputHeader (1 byte) */ Stream_Write_UINT8(s, 0x80 | (fpUpdatePduHeader->length >> 8)); /* length1 */ - Stream_Write_UINT8(s, fpUpdatePduHeader->length & 0xFF); /* length2 */ + Stream_Write_UINT8(s, fpUpdatePduHeader->length & 0xFF); /* length2 */ if (fpUpdatePduHeader->secFlags) { @@ -216,7 +215,7 @@ static BOOL fastpath_write_update_pdu_header(wStream* s, } static UINT32 fastpath_get_update_pdu_header_size(FASTPATH_UPDATE_PDU_HEADER* fpUpdatePduHeader, - rdpRdp* rdp) + rdpRdp* rdp) { UINT32 size = 3; /* fpUpdatePduHeader + length1 + length2 */ @@ -322,28 +321,28 @@ static BOOL fastpath_recv_update_common(rdpFastPath* fastpath, wStream* s) switch (updateType) { case UPDATE_TYPE_BITMAP: - { - BITMAP_UPDATE* bitmap_update = update_read_bitmap_update(update, s); + { + BITMAP_UPDATE* bitmap_update = update_read_bitmap_update(update, s); - if (!bitmap_update) - return FALSE; + if (!bitmap_update) + return FALSE; - rc = IFCALLRESULT(FALSE, update->BitmapUpdate, context, bitmap_update); - free_bitmap_update(context, bitmap_update); - } - break; + rc = IFCALLRESULT(FALSE, update->BitmapUpdate, context, bitmap_update); + free_bitmap_update(context, bitmap_update); + } + break; case UPDATE_TYPE_PALETTE: - { - PALETTE_UPDATE* palette_update = update_read_palette(update, s); + { + PALETTE_UPDATE* palette_update = update_read_palette(update, s); - if (!palette_update) - return FALSE; + if (!palette_update) + return FALSE; - rc = IFCALLRESULT(FALSE, update->Palette, context, palette_update); - free_palette_update(context, palette_update); - } - break; + rc = IFCALLRESULT(FALSE, update->Palette, context, palette_update); + free_palette_update(context, palette_update); + } + break; default: break; @@ -379,7 +378,7 @@ static int fastpath_recv_update(rdpFastPath* fastpath, BYTE updateCode, wStream* context = update->context; pointer = update->pointer; #ifdef WITH_DEBUG_RDP - DEBUG_RDP("recv Fast-Path %s Update (0x%02"PRIX8"), length:%"PRIuz"", + DEBUG_RDP("recv Fast-Path %s Update (0x%02" PRIX8 "), length:%" PRIuz "", fastpath_update_to_string(updateCode), updateCode, Stream_GetRemainingLength(s)); #endif @@ -396,7 +395,7 @@ static int fastpath_recv_update(rdpFastPath* fastpath, BYTE updateCode, wStream* case FASTPATH_UPDATETYPE_SYNCHRONIZE: if (!fastpath_recv_update_synchronize(fastpath, s)) - WLog_ERR(TAG, "fastpath_recv_update_synchronize failure but we continue"); + WLog_ERR(TAG, "fastpath_recv_update_synchronize failure but we continue"); else rc = IFCALLRESULT(TRUE, update->Synchronize, context); @@ -408,68 +407,68 @@ static int fastpath_recv_update(rdpFastPath* fastpath, BYTE updateCode, wStream* break; case FASTPATH_UPDATETYPE_PTR_NULL: - { - POINTER_SYSTEM_UPDATE pointer_system; - pointer_system.type = SYSPTR_NULL; - rc = IFCALLRESULT(FALSE, pointer->PointerSystem, context, &pointer_system); - } - break; + { + POINTER_SYSTEM_UPDATE pointer_system; + pointer_system.type = SYSPTR_NULL; + rc = IFCALLRESULT(FALSE, pointer->PointerSystem, context, &pointer_system); + } + break; case FASTPATH_UPDATETYPE_PTR_DEFAULT: - { - POINTER_SYSTEM_UPDATE pointer_system; - pointer_system.type = SYSPTR_DEFAULT; - rc = IFCALLRESULT(FALSE, pointer->PointerSystem, context, &pointer_system); - } - break; + { + POINTER_SYSTEM_UPDATE pointer_system; + pointer_system.type = SYSPTR_DEFAULT; + rc = IFCALLRESULT(FALSE, pointer->PointerSystem, context, &pointer_system); + } + break; case FASTPATH_UPDATETYPE_PTR_POSITION: - { - POINTER_POSITION_UPDATE* pointer_position = update_read_pointer_position(update, s); + { + POINTER_POSITION_UPDATE* pointer_position = update_read_pointer_position(update, s); - if (pointer_position) - { - rc = IFCALLRESULT(FALSE, pointer->PointerPosition, context, pointer_position); - free_pointer_position_update(context, pointer_position); - } + if (pointer_position) + { + rc = IFCALLRESULT(FALSE, pointer->PointerPosition, context, pointer_position); + free_pointer_position_update(context, pointer_position); } - break; + } + break; case FASTPATH_UPDATETYPE_COLOR: - { - POINTER_COLOR_UPDATE* pointer_color = update_read_pointer_color(update, s, 24); + { + POINTER_COLOR_UPDATE* pointer_color = update_read_pointer_color(update, s, 24); - if (pointer_color) - { - rc = IFCALLRESULT(FALSE, pointer->PointerColor, context, pointer_color); - free_pointer_color_update(context, pointer_color); - } + if (pointer_color) + { + rc = IFCALLRESULT(FALSE, pointer->PointerColor, context, pointer_color); + free_pointer_color_update(context, pointer_color); } - break; + } + break; case FASTPATH_UPDATETYPE_CACHED: - { - POINTER_CACHED_UPDATE* pointer_cached = update_read_pointer_cached(update, s); + { + POINTER_CACHED_UPDATE* pointer_cached = update_read_pointer_cached(update, s); - if (pointer_cached) - { - rc = IFCALLRESULT(FALSE, pointer->PointerCached, context, pointer_cached); - free_pointer_cached_update(context, pointer_cached); - } + if (pointer_cached) + { + rc = IFCALLRESULT(FALSE, pointer->PointerCached, context, pointer_cached); + free_pointer_cached_update(context, pointer_cached); } - break; + } + break; case FASTPATH_UPDATETYPE_POINTER: - { - POINTER_NEW_UPDATE* pointer_new = update_read_pointer_new(update, s); + { + POINTER_NEW_UPDATE* pointer_new = update_read_pointer_new(update, s); - if (pointer_new) - { - rc = IFCALLRESULT(FALSE, pointer->PointerNew, context, pointer_new); - free_pointer_new_update(context, pointer_new); - } + if (pointer_new) + { + rc = IFCALLRESULT(FALSE, pointer->PointerNew, context, pointer_new); + free_pointer_new_update(context, pointer_new); } - break; + } + break; default: break; @@ -477,7 +476,7 @@ static int fastpath_recv_update(rdpFastPath* fastpath, BYTE updateCode, wStream* if (!rc) { - WLog_ERR(TAG, "Fastpath update %s [%"PRIx8"] failed, status %d", + WLog_ERR(TAG, "Fastpath update %s [%" PRIx8 "] failed, status %d", fastpath_update_to_string(updateCode), updateCode, status); return -1; } @@ -537,8 +536,8 @@ static int fastpath_recv_update_data(rdpFastPath* fastpath, wStream* s) return -1; } - bulkStatus = bulk_decompress(rdp->bulk, Stream_Pointer(s), size, &pDstData, &DstSize, - compressionFlags); + bulkStatus = + bulk_decompress(rdp->bulk, Stream_Pointer(s), size, &pDstData, &DstSize, compressionFlags); Stream_Seek(s, size); if (bulkStatus < 0) @@ -577,7 +576,7 @@ static int fastpath_recv_update_data(rdpFastPath* fastpath, wStream* s) if (totalSize > transport->settings->MultifragMaxRequestSize) { - WLog_ERR(TAG, "Total size (%"PRIuz") exceeds MultifragMaxRequestSize (%"PRIu32")", + WLog_ERR(TAG, "Total size (%" PRIuz ") exceeds MultifragMaxRequestSize (%" PRIu32 ")", totalSize, transport->settings->MultifragMaxRequestSize); goto out_fail; } @@ -726,8 +725,8 @@ static BOOL fastpath_recv_input_event_mouse(rdpFastPath* fastpath, wStream* s, B return FALSE; Stream_Read_UINT16(s, pointerFlags); /* pointerFlags (2 bytes) */ - Stream_Read_UINT16(s, xPos); /* xPos (2 bytes) */ - Stream_Read_UINT16(s, yPos); /* yPos (2 bytes) */ + Stream_Read_UINT16(s, xPos); /* xPos (2 bytes) */ + Stream_Read_UINT16(s, yPos); /* yPos (2 bytes) */ return IFCALLRESULT(TRUE, input->MouseEvent, input, pointerFlags, xPos, yPos); } @@ -747,8 +746,8 @@ static BOOL fastpath_recv_input_event_mousex(rdpFastPath* fastpath, wStream* s, return FALSE; Stream_Read_UINT16(s, pointerFlags); /* pointerFlags (2 bytes) */ - Stream_Read_UINT16(s, xPos); /* xPos (2 bytes) */ - Stream_Read_UINT16(s, yPos); /* yPos (2 bytes) */ + Stream_Read_UINT16(s, xPos); /* xPos (2 bytes) */ + Stream_Read_UINT16(s, yPos); /* yPos (2 bytes) */ return IFCALLRESULT(TRUE, input->ExtendedMouseEvent, input, pointerFlags, xPos, yPos); } @@ -782,8 +781,8 @@ static BOOL fastpath_recv_input_event_unicode(rdpFastPath* fastpath, wStream* s, else flags |= KBD_FLAGS_DOWN; - return IFCALLRESULT(FALSE, fastpath->rdp->input->UnicodeKeyboardEvent, fastpath->rdp->input, flags, - unicodeCode); + return IFCALLRESULT(FALSE, fastpath->rdp->input->UnicodeKeyboardEvent, fastpath->rdp->input, + flags, unicodeCode); } static BOOL fastpath_recv_input_event(rdpFastPath* fastpath, wStream* s) @@ -830,7 +829,7 @@ static BOOL fastpath_recv_input_event(rdpFastPath* fastpath, wStream* s) break; default: - WLog_ERR(TAG, "Unknown eventCode %"PRIu8"", eventCode); + WLog_ERR(TAG, "Unknown eventCode %" PRIu8 "", eventCode); break; } @@ -982,10 +981,11 @@ BOOL fastpath_send_multiple_input_pdu(rdpFastPath* fastpath, wStream* s, int iNu pad = 0; Stream_Write_UINT16(s, 0x10); /* length */ - Stream_Write_UINT8(s, 0x1); /* TSFIPS_VERSION 1*/ - Stream_Write_UINT8(s, pad); /* padding */ + Stream_Write_UINT8(s, 0x1); /* TSFIPS_VERSION 1*/ + Stream_Write_UINT8(s, pad); /* padding */ - if (!security_hmac_signature(fpInputEvents, fpInputEvents_length, Stream_Pointer(s), rdp)) + if (!security_hmac_signature(fpInputEvents, fpInputEvents_length, Stream_Pointer(s), + rdp)) goto fail; if (pad) @@ -1001,10 +1001,11 @@ BOOL fastpath_send_multiple_input_pdu(rdpFastPath* fastpath, wStream* s, int iNu BOOL status; if (rdp->sec_flags & SEC_SECURE_CHECKSUM) - status = security_salted_mac_signature(rdp, fpInputEvents, fpInputEvents_length, TRUE, - Stream_Pointer(s)); + status = security_salted_mac_signature(rdp, fpInputEvents, fpInputEvents_length, + TRUE, Stream_Pointer(s)); else - status = security_mac_signature(rdp, fpInputEvents, fpInputEvents_length, Stream_Pointer(s)); + status = security_mac_signature(rdp, fpInputEvents, fpInputEvents_length, + Stream_Pointer(s)); if (!status || !security_encrypt(fpInputEvents, fpInputEvents_length, rdp)) goto fail; @@ -1099,7 +1100,8 @@ BOOL fastpath_send_update_pdu(rdpFastPath* fastpath, BYTE updateCode, wStream* s if (totalLength > settings->MultifragMaxRequestSize) { WLog_ERR(TAG, - "fast path update size (%"PRIu32") exceeds the client's maximum request size (%"PRIu32")", + "fast path update size (%" PRIu32 + ") exceeds the client's maximum request size (%" PRIu32 ")", totalLength, settings->MultifragMaxRequestSize); return FALSE; } @@ -1138,7 +1140,8 @@ BOOL fastpath_send_update_pdu(rdpFastPath* fastpath, BYTE updateCode, wStream* s if (settings->CompressionEnabled && !skipCompression) { - if (bulk_compress(rdp->bulk, pSrcData, SrcSize, &pDstData, &DstSize, &compressionFlags) >= 0) + if (bulk_compress(rdp->bulk, pSrcData, SrcSize, &pDstData, &DstSize, + &compressionFlags) >= 0) { if (compressionFlags) { @@ -1158,9 +1161,11 @@ BOOL fastpath_send_update_pdu(rdpFastPath* fastpath, BYTE updateCode, wStream* s totalLength -= SrcSize; if (totalLength == 0) - fpUpdateHeader.fragmentation = (fragment == 0) ? FASTPATH_FRAGMENT_SINGLE : FASTPATH_FRAGMENT_LAST; + fpUpdateHeader.fragmentation = + (fragment == 0) ? FASTPATH_FRAGMENT_SINGLE : FASTPATH_FRAGMENT_LAST; else - fpUpdateHeader.fragmentation = (fragment == 0) ? FASTPATH_FRAGMENT_FIRST : FASTPATH_FRAGMENT_NEXT; + fpUpdateHeader.fragmentation = + (fragment == 0) ? FASTPATH_FRAGMENT_FIRST : FASTPATH_FRAGMENT_NEXT; fpUpdateHeaderSize = fastpath_get_update_header_size(&fpUpdateHeader); fpUpdatePduHeaderSize = fastpath_get_update_pdu_header_size(&fpUpdatePduHeader, rdp); @@ -1235,7 +1240,7 @@ BOOL fastpath_send_update_pdu(rdpFastPath* fastpath, BYTE updateCode, wStream* s rdpFastPath* fastpath_new(rdpRdp* rdp) { rdpFastPath* fastpath; - fastpath = (rdpFastPath*) calloc(1, sizeof(rdpFastPath)); + fastpath = (rdpFastPath*)calloc(1, sizeof(rdpFastPath)); if (!fastpath) return NULL; diff --git a/libfreerdp/core/fastpath.h b/libfreerdp/core/fastpath.h index 970699415..ce2811ad4 100644 --- a/libfreerdp/core/fastpath.h +++ b/libfreerdp/core/fastpath.h @@ -110,7 +110,7 @@ enum FASTPATH_INPUT_KBDFLAGS { FASTPATH_INPUT_KBDFLAGS_RELEASE = 0x01, FASTPATH_INPUT_KBDFLAGS_EXTENDED = 0x02, - FASTPATH_INPUT_KBDFLAGS_PREFIX_E1 = 0x04 /* for pause sequence */ + FASTPATH_INPUT_KBDFLAGS_PREFIX_E1 = 0x04 /* for pause sequence */ }; struct _FASTPATH_UPDATE_PDU_HEADER @@ -151,25 +151,24 @@ struct rdp_fastpath FREERDP_LOCAL UINT16 fastpath_header_length(wStream* s); FREERDP_LOCAL UINT16 fastpath_read_header(rdpFastPath* fastpath, wStream* s); -FREERDP_LOCAL BOOL fastpath_read_header_rdp(rdpFastPath* fastpath, wStream* s, - UINT16* length); +FREERDP_LOCAL BOOL fastpath_read_header_rdp(rdpFastPath* fastpath, wStream* s, UINT16* length); FREERDP_LOCAL int fastpath_recv_updates(rdpFastPath* fastpath, wStream* s); FREERDP_LOCAL int fastpath_recv_inputs(rdpFastPath* fastpath, wStream* s); FREERDP_LOCAL wStream* fastpath_input_pdu_init_header(rdpFastPath* fastpath); -FREERDP_LOCAL wStream* fastpath_input_pdu_init(rdpFastPath* fastpath, - BYTE eventFlags, BYTE eventCode); -FREERDP_LOCAL BOOL fastpath_send_multiple_input_pdu(rdpFastPath* fastpath, - wStream* s, int iEventCount); +FREERDP_LOCAL wStream* fastpath_input_pdu_init(rdpFastPath* fastpath, BYTE eventFlags, + BYTE eventCode); +FREERDP_LOCAL BOOL fastpath_send_multiple_input_pdu(rdpFastPath* fastpath, wStream* s, + int iEventCount); FREERDP_LOCAL BOOL fastpath_send_input_pdu(rdpFastPath* fastpath, wStream* s); FREERDP_LOCAL wStream* fastpath_update_pdu_init(rdpFastPath* fastpath); FREERDP_LOCAL wStream* fastpath_update_pdu_init_new(rdpFastPath* fastpath); -FREERDP_LOCAL BOOL fastpath_send_update_pdu(rdpFastPath* fastpath, - BYTE updateCode, wStream* s, BOOL skipCompression); +FREERDP_LOCAL BOOL fastpath_send_update_pdu(rdpFastPath* fastpath, BYTE updateCode, wStream* s, + BOOL skipCompression); -FREERDP_LOCAL BOOL fastpath_send_surfcmd_frame_marker(rdpFastPath* fastpath, - UINT16 frameAction, UINT32 frameId); +FREERDP_LOCAL BOOL fastpath_send_surfcmd_frame_marker(rdpFastPath* fastpath, UINT16 frameAction, + UINT32 frameId); FREERDP_LOCAL rdpFastPath* fastpath_new(rdpRdp* rdp); FREERDP_LOCAL void fastpath_free(rdpFastPath* fastpath); diff --git a/libfreerdp/core/freerdp.c b/libfreerdp/core/freerdp.c index cf162e4ba..3e53be148 100644 --- a/libfreerdp/core/freerdp.c +++ b/libfreerdp/core/freerdp.c @@ -58,7 +58,7 @@ /* connectErrorCode is 'extern' in error.h. See comment there.*/ UINT freerdp_channel_add_init_handle_data(rdpChannelHandles* handles, void* pInitHandle, - void* pUserData) + void* pUserData) { if (!handles->init) handles->init = ListDictionary_New(TRUE); @@ -97,9 +97,9 @@ void freerdp_channel_remove_init_handle_data(rdpChannelHandles* handles, void* p } UINT freerdp_channel_add_open_handle_data(rdpChannelHandles* handles, DWORD openHandle, - void* pUserData) + void* pUserData) { - void* pOpenHandle = (void*)(size_t) openHandle; + void* pOpenHandle = (void*)(size_t)openHandle; if (!handles->open) handles->open = ListDictionary_New(TRUE); @@ -122,14 +122,14 @@ UINT freerdp_channel_add_open_handle_data(rdpChannelHandles* handles, DWORD open void* freerdp_channel_get_open_handle_data(rdpChannelHandles* handles, DWORD openHandle) { void* pUserData = NULL; - void* pOpenHandle = (void*)(size_t) openHandle; + void* pOpenHandle = (void*)(size_t)openHandle; pUserData = ListDictionary_GetItemValue(handles->open, pOpenHandle); return pUserData; } void freerdp_channel_remove_open_handle_data(rdpChannelHandles* handles, DWORD openHandle) { - void* pOpenHandle = (void*)(size_t) openHandle; + void* pOpenHandle = (void*)(size_t)openHandle; ListDictionary_Remove(handles->open, pOpenHandle); if (ListDictionary_Count(handles->open) < 1) @@ -144,8 +144,8 @@ void freerdp_channel_remove_open_handle_data(rdpChannelHandles* handles, DWORD o * that the caller requires. * @see struct rdp_freerdp in freerdp.h * - * @param instance - pointer to a rdp_freerdp structure that contains base information to establish the connection. - * On return, this function will be initialized with the new connection's settings. + * @param instance - pointer to a rdp_freerdp structure that contains base information to establish + * the connection. On return, this function will be initialized with the new connection's settings. * * @return TRUE if successful. FALSE otherwise. * @@ -177,8 +177,7 @@ BOOL freerdp_connect(freerdp* instance) instance->ConnectionCallbackState = CLIENT_STATE_PRECONNECT_PASSED; if (status) - status2 = freerdp_channels_pre_connect(instance->context->channels, - instance); + status2 = freerdp_channels_pre_connect(instance->context->channels, instance); if (settings->KeyboardLayout == KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002) { @@ -201,14 +200,13 @@ BOOL freerdp_connect(freerdp* instance) /* --authonly tests the connection without a UI */ if (instance->settings->AuthenticationOnly) { - WLog_ERR(TAG, "Authentication only, exit status %"PRId32"", !status); + WLog_ERR(TAG, "Authentication only, exit status %" PRId32 "", !status); goto freerdp_connect_finally; } if (instance->settings->DumpRemoteFx) { - instance->update->pcap_rfx = pcap_open(instance->settings->DumpRemoteFxFile, - TRUE); + instance->update->pcap_rfx = pcap_open(instance->settings->DumpRemoteFxFile, TRUE); if (instance->update->pcap_rfx) instance->update->dump_rfx = TRUE; @@ -231,8 +229,7 @@ BOOL freerdp_connect(freerdp* instance) goto freerdp_connect_finally; } - if (!status || (status2 != CHANNEL_RC_OK) - || !update_post_connect(instance->update)) + if (!status || (status2 != CHANNEL_RC_OK) || !update_post_connect(instance->update)) { WLog_ERR(TAG, "freerdp_post_connect failed"); @@ -291,8 +288,7 @@ BOOL freerdp_connect(freerdp* instance) } if (rdp->errorInfo == ERRINFO_SERVER_INSUFFICIENT_PRIVILEGES) - freerdp_set_last_error(instance->context, - FREERDP_ERROR_INSUFFICIENT_PRIVILEGES); + freerdp_set_last_error(instance->context, FREERDP_ERROR_INSUFFICIENT_PRIVILEGES); SetEvent(rdp->transport->connectedEvent); freerdp_connect_finally: @@ -314,8 +310,7 @@ BOOL freerdp_abort_connect(freerdp* instance) return SetEvent(instance->context->abortEvent); } -BOOL freerdp_get_fds(freerdp* instance, void** rfds, int* rcount, void** wfds, - int* wcount) +BOOL freerdp_get_fds(freerdp* instance, void** rfds, int* rcount, void** wfds, int* wcount) { rdpRdp* rdp = instance->context->rdp; transport_get_fds(rdp->transport, rfds, rcount); @@ -353,8 +348,7 @@ BOOL freerdp_check_fds(freerdp* instance) return TRUE; } -DWORD freerdp_get_event_handles(rdpContext* context, HANDLE* events, - DWORD count) +DWORD freerdp_get_event_handles(rdpContext* context, HANDLE* events, DWORD count) { DWORD nCount = 0; nCount += transport_get_event_handles(context->rdp->transport, events, count); @@ -376,8 +370,8 @@ DWORD freerdp_get_event_handles(rdpContext* context, HANDLE* events, if (nCount >= count) return 0; - events[nCount++] = freerdp_get_message_queue_event_handle( - context->instance, FREERDP_INPUT_MESSAGE_QUEUE); + events[nCount++] = + freerdp_get_message_queue_event_handle(context->instance, FREERDP_INPUT_MESSAGE_QUEUE); } return nCount; @@ -391,7 +385,7 @@ BOOL freerdp_check_event_handles(rdpContext* context) if (!status) { if (freerdp_get_last_error(context) == FREERDP_ERROR_SUCCESS) - WLog_ERR(TAG, "freerdp_check_fds() failed - %"PRIi32"", status); + WLog_ERR(TAG, "freerdp_check_fds() failed - %" PRIi32 "", status); return FALSE; } @@ -401,7 +395,7 @@ BOOL freerdp_check_event_handles(rdpContext* context) if (!status) { if (freerdp_get_last_error(context) == FREERDP_ERROR_SUCCESS) - WLog_ERR(TAG, "freerdp_channels_check_fds() failed - %"PRIi32"", status); + WLog_ERR(TAG, "freerdp_channels_check_fds() failed - %" PRIi32 "", status); return FALSE; } @@ -411,15 +405,15 @@ BOOL freerdp_check_event_handles(rdpContext* context) if (!status) { if (freerdp_get_last_error(context) == FREERDP_ERROR_SUCCESS) - WLog_ERR(TAG, "checkChannelErrorEvent() failed - %"PRIi32"", status); + WLog_ERR(TAG, "checkChannelErrorEvent() failed - %" PRIi32 "", status); return FALSE; } if (context->settings->AsyncInput) { - int rc = freerdp_message_queue_process_pending_messages( - context->instance, FREERDP_INPUT_MESSAGE_QUEUE); + int rc = freerdp_message_queue_process_pending_messages(context->instance, + FREERDP_INPUT_MESSAGE_QUEUE); if (rc < 0) return FALSE; @@ -460,8 +454,7 @@ HANDLE freerdp_get_message_queue_event_handle(freerdp* instance, DWORD id) return event; } -int freerdp_message_queue_process_message(freerdp* instance, DWORD id, - wMessage* message) +int freerdp_message_queue_process_message(freerdp* instance, DWORD id, wMessage* message) { int status = -1; @@ -497,8 +490,7 @@ int freerdp_message_queue_process_pending_messages(freerdp* instance, DWORD id) return status; } -static int freerdp_send_channel_data(freerdp* instance, UINT16 channelId, - BYTE* data, int size) +static int freerdp_send_channel_data(freerdp* instance, UINT16 channelId, BYTE* data, int size) { return rdp_send_channel_data(instance->context->rdp, channelId, data, size); } @@ -520,8 +512,8 @@ BOOL freerdp_disconnect(freerdp* instance) if (instance->settings->AsyncInput) { - wMessageQueue* inputQueue = freerdp_get_message_queue(instance, - FREERDP_INPUT_MESSAGE_QUEUE); + wMessageQueue* inputQueue = + freerdp_get_message_queue(instance, FREERDP_INPUT_MESSAGE_QUEUE); MessageQueue_PostQuit(inputQueue, 0); } @@ -625,39 +617,33 @@ const char* freerdp_get_build_revision(void) return GIT_REVISION; } -static wEventType FreeRDP_Events[] = -{ - DEFINE_EVENT_ENTRY(WindowStateChange) - DEFINE_EVENT_ENTRY(ResizeWindow) - DEFINE_EVENT_ENTRY(LocalResizeWindow) - DEFINE_EVENT_ENTRY(EmbedWindow) - DEFINE_EVENT_ENTRY(PanningChange) - DEFINE_EVENT_ENTRY(ZoomingChange) - DEFINE_EVENT_ENTRY(ErrorInfo) - DEFINE_EVENT_ENTRY(Terminate) - DEFINE_EVENT_ENTRY(ConnectionResult) - DEFINE_EVENT_ENTRY(ChannelConnected) - DEFINE_EVENT_ENTRY(ChannelDisconnected) - DEFINE_EVENT_ENTRY(MouseEvent) - DEFINE_EVENT_ENTRY(Activated) - DEFINE_EVENT_ENTRY(Timer) - DEFINE_EVENT_ENTRY(GraphicsReset) +static wEventType FreeRDP_Events[] = { + DEFINE_EVENT_ENTRY(WindowStateChange) DEFINE_EVENT_ENTRY(ResizeWindow) + DEFINE_EVENT_ENTRY(LocalResizeWindow) DEFINE_EVENT_ENTRY(EmbedWindow) + DEFINE_EVENT_ENTRY(PanningChange) DEFINE_EVENT_ENTRY(ZoomingChange) + DEFINE_EVENT_ENTRY(ErrorInfo) DEFINE_EVENT_ENTRY(Terminate) + DEFINE_EVENT_ENTRY(ConnectionResult) DEFINE_EVENT_ENTRY(ChannelConnected) + DEFINE_EVENT_ENTRY(ChannelDisconnected) DEFINE_EVENT_ENTRY(MouseEvent) + DEFINE_EVENT_ENTRY(Activated) DEFINE_EVENT_ENTRY(Timer) + DEFINE_EVENT_ENTRY(GraphicsReset) }; /** Allocator function for a rdp context. * The function will allocate a rdpRdp structure using rdp_new(), then copy * its contents to the appropriate fields in the rdp_freerdp structure given in parameters. * It will also initialize the 'context' field in the rdp_freerdp structure as needed. - * If the caller has set the ContextNew callback in the 'instance' parameter, it will be called at the end of the function. + * If the caller has set the ContextNew callback in the 'instance' parameter, it will be called at + * the end of the function. * - * @param instance - Pointer to the rdp_freerdp structure that will be initialized with the new context. + * @param instance - Pointer to the rdp_freerdp structure that will be initialized with the new + * context. */ BOOL freerdp_context_new(freerdp* instance) { rdpRdp* rdp; rdpContext* context; BOOL ret = TRUE; - instance->context = (rdpContext*) calloc(1, instance->ContextSize); + instance->context = (rdpContext*)calloc(1, instance->ContextSize); if (!instance->context) return FALSE; @@ -672,8 +658,7 @@ BOOL freerdp_context_new(freerdp* instance) if (!context->pubSub) goto fail; - PubSub_AddEventTypes(context->pubSub, FreeRDP_Events, - ARRAYSIZE(FreeRDP_Events)); + PubSub_AddEventTypes(context->pubSub, FreeRDP_Events, ARRAYSIZE(FreeRDP_Events)); context->metrics = metrics_new(context); if (!context->metrics) @@ -738,12 +723,12 @@ fail: } /** Deallocator function for a rdp context. - * The function will deallocate the resources from the 'instance' parameter that were allocated from a call - * to freerdp_context_new(). - * If the ContextFree callback is set in the 'instance' parameter, it will be called before deallocation occurs. + * The function will deallocate the resources from the 'instance' parameter that were allocated + * from a call to freerdp_context_new(). If the ContextFree callback is set in the 'instance' + * parameter, it will be called before deallocation occurs. * - * @param instance - Pointer to the rdp_freerdp structure that was initialized by a call to freerdp_context_new(). - * On return, the fields associated to the context are invalid. + * @param instance - Pointer to the rdp_freerdp structure that was initialized by a call to + * freerdp_context_new(). On return, the fields associated to the context are invalid. */ void freerdp_context_free(freerdp* instance) { @@ -864,21 +849,21 @@ const char* freerdp_get_last_error_category(UINT32 code) switch (cls) { - case FREERDP_ERROR_ERRBASE_CLASS: - string = freerdp_get_error_base_category(type); - break; + case FREERDP_ERROR_ERRBASE_CLASS: + string = freerdp_get_error_base_category(type); + break; - case FREERDP_ERROR_ERRINFO_CLASS: - string = freerdp_get_error_info_category(type); - break; + case FREERDP_ERROR_ERRINFO_CLASS: + string = freerdp_get_error_info_category(type); + break; - case FREERDP_ERROR_CONNECT_CLASS: - string = freerdp_get_error_connect_category(type); - break; + case FREERDP_ERROR_CONNECT_CLASS: + string = freerdp_get_error_connect_category(type); + break; - default: - string = rpc_error_to_category(code); - break; + default: + string = rpc_error_to_category(code); + break; } return string; @@ -887,7 +872,7 @@ const char* freerdp_get_last_error_category(UINT32 code) void freerdp_set_last_error(rdpContext* context, UINT32 lastError) { if (lastError) - WLog_ERR(TAG, "%s %s [0x%08"PRIX32"]", __FUNCTION__, + WLog_ERR(TAG, "%s %s [0x%08" PRIX32 "]", __FUNCTION__, freerdp_get_last_error_name(lastError), lastError); if (lastError == FREERDP_ERROR_SUCCESS) @@ -1013,7 +998,7 @@ const char* freerdp_get_logon_error_info_data(UINT32 data) freerdp* freerdp_new() { freerdp* instance; - instance = (freerdp*) calloc(1, sizeof(freerdp)); + instance = (freerdp*)calloc(1, sizeof(freerdp)); if (!instance) return NULL; @@ -1086,7 +1071,7 @@ BOOL checkChannelErrorEvent(rdpContext* context) { if (WaitForSingleObject(context->channelErrorEvent, 0) == WAIT_OBJECT_0) { - WLog_ERR(TAG, "%s. Error was %"PRIu32"", context->errorDescription, + WLog_ERR(TAG, "%s. Error was %" PRIu32 "", context->errorDescription, context->channelErrorNum); return FALSE; } diff --git a/libfreerdp/core/gateway/http.c b/libfreerdp/core/gateway/http.c index 8e00bbc37..8d13e8907 100644 --- a/libfreerdp/core/gateway/http.c +++ b/libfreerdp/core/gateway/http.c @@ -99,13 +99,11 @@ static char* string_strnstr(char* str1, const char* str2, size_t slen) { if (slen-- < 1 || (sc = *str1++) == '\0') return NULL; - } - while (sc != c); + } while (sc != c); if (len > slen) return NULL; - } - while (strncmp(str1, str2, len) != 0); + } while (strncmp(str1, str2, len) != 0); str1--; } @@ -123,7 +121,7 @@ static BOOL strings_equals_nocase(const void* obj1, const void* obj2) HttpContext* http_context_new(void) { - return (HttpContext*) calloc(1, sizeof(HttpContext)); + return (HttpContext*)calloc(1, sizeof(HttpContext)); } BOOL http_context_set_method(HttpContext* context, const char* Method) @@ -397,7 +395,7 @@ static BOOL http_encode_body_line(wStream* s, const char* param, const char* val static BOOL http_encode_content_length_line(wStream* s, size_t ContentLength) { - return http_encode_print(s, "Content-Length: %"PRIdz"\r\n", ContentLength); + return http_encode_print(s, "Content-Length: %" PRIdz "\r\n", ContentLength); } static BOOL http_encode_header_line(wStream* s, const char* Method, const char* URI) @@ -409,7 +407,7 @@ static BOOL http_encode_header_line(wStream* s, const char* Method, const char* } static BOOL http_encode_authorization_line(wStream* s, const char* AuthScheme, - const char* AuthParam) + const char* AuthParam) { if (!s || !AuthScheme || !AuthParam) return FALSE; @@ -482,7 +480,7 @@ fail: HttpRequest* http_request_new(void) { - return (HttpRequest*) calloc(1, sizeof(HttpRequest)); + return (HttpRequest*)calloc(1, sizeof(HttpRequest)); } void http_request_free(HttpRequest* request) @@ -549,7 +547,7 @@ fail: } static BOOL http_response_parse_header_field(HttpResponse* response, const char* name, - const char* value) + const char* value) { BOOL status = TRUE; @@ -748,7 +746,6 @@ static int print_bio_error(const char* str, size_t len, void* bp) return len; } - HttpResponse* http_response_recv(rdpTls* tls, BOOL readContentLength) { size_t size; @@ -799,7 +796,7 @@ HttpResponse* http_response_recv(rdpTls* tls, BOOL readContentLength) continue; else if (position > RESPONSE_SIZE_LIMIT) { - WLog_ERR(TAG, "Request header too large! (%"PRIdz" bytes) Aborting!", bodyLength); + WLog_ERR(TAG, "Request header too large! (%" PRIdz " bytes) Aborting!", bodyLength); goto out_error; } @@ -816,7 +813,7 @@ HttpResponse* http_response_recv(rdpTls* tls, BOOL readContentLength) { size_t count = 0; char* buffer = (char*)Stream_Buffer(response->data); - char* line = (char*) Stream_Buffer(response->data); + char* line = (char*)Stream_Buffer(response->data); while ((line = string_strnstr(line, "\r\n", payloadOffset - (line - buffer) - 2UL))) { @@ -828,7 +825,7 @@ HttpResponse* http_response_recv(rdpTls* tls, BOOL readContentLength) if (count) { - response->lines = (char**) calloc(response->count, sizeof(char*)); + response->lines = (char**)calloc(response->count, sizeof(char*)); if (!response->lines) goto out_error; @@ -872,7 +869,8 @@ HttpResponse* http_response_recv(rdpTls* tls, BOOL readContentLength) if (bodyLength > RESPONSE_SIZE_LIMIT) { - WLog_ERR(TAG, "Expected request body too large! (%"PRIdz" bytes) Aborting!", bodyLength); + WLog_ERR(TAG, "Expected request body too large! (%" PRIdz " bytes) Aborting!", + bodyLength); goto out_error; } @@ -884,7 +882,8 @@ HttpResponse* http_response_recv(rdpTls* tls, BOOL readContentLength) if (!Stream_EnsureRemainingCapacity(response->data, bodyLength - response->BodyLength)) goto out_error; - status = BIO_read(tls->bio, Stream_Pointer(response->data), bodyLength - response->BodyLength); + status = BIO_read(tls->bio, Stream_Pointer(response->data), + bodyLength - response->BodyLength); if (status <= 0) { @@ -904,7 +903,8 @@ HttpResponse* http_response_recv(rdpTls* tls, BOOL readContentLength) if (response->BodyLength > RESPONSE_SIZE_LIMIT) { - WLog_ERR(TAG, "Request body too large! (%"PRIdz" bytes) Aborting!", response->BodyLength); + WLog_ERR(TAG, "Request body too large! (%" PRIdz " bytes) Aborting!", + response->BodyLength); goto out_error; } } @@ -914,8 +914,8 @@ HttpResponse* http_response_recv(rdpTls* tls, BOOL readContentLength) if (bodyLength != response->BodyLength) { - WLog_WARN(TAG, "%s: %s unexpected body length: actual: %d, expected: %d", - __FUNCTION__, response->ContentType, response->BodyLength, bodyLength); + WLog_WARN(TAG, "%s: %s unexpected body length: actual: %d, expected: %d", __FUNCTION__, + response->ContentType, response->BodyLength, bodyLength); if (bodyLength > 0) response->BodyLength = MIN(bodyLength, response->BodyLength); @@ -930,7 +930,7 @@ out_error: HttpResponse* http_response_new(void) { - HttpResponse* response = (HttpResponse*) calloc(1, sizeof(HttpResponse)); + HttpResponse* response = (HttpResponse*)calloc(1, sizeof(HttpResponse)); if (!response) return NULL; diff --git a/libfreerdp/core/gateway/http.h b/libfreerdp/core/gateway/http.h index dc5371da1..6c5756b8a 100644 --- a/libfreerdp/core/gateway/http.h +++ b/libfreerdp/core/gateway/http.h @@ -32,26 +32,19 @@ typedef struct _http_context HttpContext; FREERDP_LOCAL HttpContext* http_context_new(void); FREERDP_LOCAL void http_context_free(HttpContext* context); -FREERDP_LOCAL BOOL http_context_set_method(HttpContext* context, - const char* Method); +FREERDP_LOCAL BOOL http_context_set_method(HttpContext* context, const char* Method); FREERDP_LOCAL const char* http_context_get_uri(HttpContext* context); FREERDP_LOCAL BOOL http_context_set_uri(HttpContext* context, const char* URI); -FREERDP_LOCAL BOOL http_context_set_user_agent(HttpContext* context, - const char* UserAgent); -FREERDP_LOCAL BOOL http_context_set_host(HttpContext* context, - const char* Host); -FREERDP_LOCAL BOOL http_context_set_accept(HttpContext* context, - const char* Accept); -FREERDP_LOCAL BOOL http_context_set_cache_control(HttpContext* context, - const char* CacheControl); -FREERDP_LOCAL BOOL http_context_set_connection(HttpContext* context, - const char* Connection); -FREERDP_LOCAL BOOL http_context_set_pragma(HttpContext* context, - const char* Pragma); +FREERDP_LOCAL BOOL http_context_set_user_agent(HttpContext* context, const char* UserAgent); +FREERDP_LOCAL BOOL http_context_set_host(HttpContext* context, const char* Host); +FREERDP_LOCAL BOOL http_context_set_accept(HttpContext* context, const char* Accept); +FREERDP_LOCAL BOOL http_context_set_cache_control(HttpContext* context, const char* CacheControl); +FREERDP_LOCAL BOOL http_context_set_connection(HttpContext* context, const char* Connection); +FREERDP_LOCAL BOOL http_context_set_pragma(HttpContext* context, const char* Pragma); FREERDP_LOCAL BOOL http_context_set_rdg_connection_id(HttpContext* context, - const char* RdgConnectionId); + const char* RdgConnectionId); FREERDP_LOCAL BOOL http_context_set_rdg_auth_scheme(HttpContext* context, - const char* RdgAuthScheme); + const char* RdgAuthScheme); /* HTTP request */ typedef struct _http_request HttpRequest; @@ -59,22 +52,18 @@ typedef struct _http_request HttpRequest; FREERDP_LOCAL HttpRequest* http_request_new(void); FREERDP_LOCAL void http_request_free(HttpRequest* request); -FREERDP_LOCAL BOOL http_request_set_method(HttpRequest* request, - const char* Method); +FREERDP_LOCAL BOOL http_request_set_method(HttpRequest* request, const char* Method); FREERDP_LOCAL SSIZE_T http_request_get_content_length(HttpRequest* request); FREERDP_LOCAL BOOL http_request_set_content_length(HttpRequest* request, size_t length); FREERDP_LOCAL const char* http_request_get_uri(HttpRequest* request); FREERDP_LOCAL BOOL http_request_set_uri(HttpRequest* request, const char* URI); -FREERDP_LOCAL BOOL http_request_set_auth_scheme(HttpRequest* request, - const char* AuthScheme); -FREERDP_LOCAL BOOL http_request_set_auth_param(HttpRequest* request, - const char* AuthParam); +FREERDP_LOCAL BOOL http_request_set_auth_scheme(HttpRequest* request, const char* AuthScheme); +FREERDP_LOCAL BOOL http_request_set_auth_param(HttpRequest* request, const char* AuthParam); FREERDP_LOCAL BOOL http_request_set_transfer_encoding(HttpRequest* request, - const char* TransferEncoding); + const char* TransferEncoding); -FREERDP_LOCAL wStream* http_request_write(HttpContext* context, - HttpRequest* request); +FREERDP_LOCAL wStream* http_request_write(HttpContext* context, HttpRequest* request); /* HTTP response */ typedef struct _http_response HttpResponse; diff --git a/libfreerdp/core/gateway/ncacn_http.c b/libfreerdp/core/gateway/ncacn_http.c index b479d60d7..369264d9d 100644 --- a/libfreerdp/core/gateway/ncacn_http.c +++ b/libfreerdp/core/gateway/ncacn_http.c @@ -31,8 +31,8 @@ #define TAG FREERDP_TAG("core.gateway.ntlm") -static wStream* rpc_ntlm_http_request(HttpContext* http, const char* method, - int contentLength, const SecBuffer* ntlmToken) +static wStream* rpc_ntlm_http_request(HttpContext* http, const char* method, int contentLength, + const SecBuffer* ntlmToken) { wStream* s = NULL; HttpRequest* request = NULL; @@ -102,8 +102,7 @@ BOOL rpc_ncacn_http_send_in_channel_request(RpcChannel* inChannel) return (status > 0) ? 1 : -1; } -BOOL rpc_ncacn_http_recv_in_channel_response(RpcChannel* inChannel, - HttpResponse* response) +BOOL rpc_ncacn_http_recv_in_channel_response(RpcChannel* inChannel, HttpResponse* response) { const char* token64 = NULL; int ntlmTokenLength = 0; @@ -153,8 +152,9 @@ BOOL rpc_ncacn_http_ntlm_init(rdpContext* context, RpcChannel* channel) } else { - BOOL proceed = instance->GatewayAuthenticate(instance, &settings->GatewayUsername, - &settings->GatewayPassword, &settings->GatewayDomain); + BOOL proceed = + instance->GatewayAuthenticate(instance, &settings->GatewayUsername, + &settings->GatewayPassword, &settings->GatewayDomain); if (!proceed) { @@ -191,8 +191,8 @@ BOOL rpc_ncacn_http_ntlm_init(rdpContext* context, RpcChannel* channel) } } - if (!ntlm_client_init(ntlm, TRUE, settings->GatewayUsername, - settings->GatewayDomain, settings->GatewayPassword, tls->Bindings)) + if (!ntlm_client_init(ntlm, TRUE, settings->GatewayUsername, settings->GatewayDomain, + settings->GatewayPassword, tls->Bindings)) { return TRUE; } @@ -214,8 +214,7 @@ void rpc_ncacn_http_ntlm_uninit(RpcChannel* channel) channel->ntlm = NULL; } -BOOL rpc_ncacn_http_send_out_channel_request(RpcChannel* outChannel, - BOOL replacement) +BOOL rpc_ncacn_http_send_out_channel_request(RpcChannel* outChannel, BOOL replacement) { BOOL rc = TRUE; wStream* s; @@ -252,8 +251,7 @@ BOOL rpc_ncacn_http_send_out_channel_request(RpcChannel* outChannel, return rc; } -BOOL rpc_ncacn_http_recv_out_channel_response(RpcChannel* outChannel, - HttpResponse* response) +BOOL rpc_ncacn_http_recv_out_channel_response(RpcChannel* outChannel, HttpResponse* response) { const char* token64 = NULL; int ntlmTokenLength = 0; diff --git a/libfreerdp/core/gateway/ncacn_http.h b/libfreerdp/core/gateway/ncacn_http.h index 9736d5983..fcc306664 100644 --- a/libfreerdp/core/gateway/ncacn_http.h +++ b/libfreerdp/core/gateway/ncacn_http.h @@ -30,11 +30,11 @@ FREERDP_LOCAL void rpc_ncacn_http_ntlm_uninit(RpcChannel* channel); FREERDP_LOCAL BOOL rpc_ncacn_http_send_in_channel_request(RpcChannel* inChannel); FREERDP_LOCAL BOOL rpc_ncacn_http_recv_in_channel_response(RpcChannel* inChannel, - HttpResponse* response); + HttpResponse* response); FREERDP_LOCAL BOOL rpc_ncacn_http_send_out_channel_request(RpcChannel* outChannel, - BOOL replacement); + BOOL replacement); FREERDP_LOCAL BOOL rpc_ncacn_http_recv_out_channel_response(RpcChannel* outChannel, - HttpResponse* response); + HttpResponse* response); #endif /* FREERDP_LIB_CORE_GATEWAY_NCACN_HTTP_H */ diff --git a/libfreerdp/core/gateway/ntlm.c b/libfreerdp/core/gateway/ntlm.c index 0a8152ab4..084e55096 100644 --- a/libfreerdp/core/gateway/ntlm.c +++ b/libfreerdp/core/gateway/ntlm.c @@ -64,12 +64,12 @@ static ULONG cast_from_size_(size_t size, const char* fkt, const char* file, int { if (size > ULONG_MAX) { - WLog_ERR(TAG, "[%s %s:%d] Size %"PRIdz" is larger than INT_MAX %lu", fkt, file, line, size, - ULONG_MAX); + WLog_ERR(TAG, "[%s %s:%d] Size %" PRIdz " is larger than INT_MAX %lu", fkt, file, line, + size, ULONG_MAX); return 0; } - return (ULONG) size; + return (ULONG)size; } #define cast_from_size(size) cast_from_size_(size, __FUNCTION__, __FILE__, __LINE__) @@ -90,19 +90,19 @@ BOOL ntlm_client_init(rdpNtlm* ntlm, BOOL http, LPCTSTR user, LPCTSTR domain, LP if (status != SEC_E_OK) { - WLog_ERR(TAG, "QuerySecurityPackageInfo status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "QuerySecurityPackageInfo status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); return FALSE; } ntlm->cbMaxToken = ntlm->pPackageInfo->cbMaxToken; - status = ntlm->table->AcquireCredentialsHandle(NULL, NTLM_SSP_NAME, - SECPKG_CRED_OUTBOUND, NULL, &ntlm->identity, NULL, NULL, - &ntlm->credentials, &ntlm->expiration); + status = ntlm->table->AcquireCredentialsHandle(NULL, NTLM_SSP_NAME, SECPKG_CRED_OUTBOUND, NULL, + &ntlm->identity, NULL, NULL, &ntlm->credentials, + &ntlm->expiration); if (status != SEC_E_OK) { - WLog_ERR(TAG, "AcquireCredentialsHandle status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "AcquireCredentialsHandle status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); return FALSE; } @@ -122,11 +122,11 @@ BOOL ntlm_client_init(rdpNtlm* ntlm, BOOL http, LPCTSTR user, LPCTSTR domain, LP else { /** - * flags for RPC authentication: - * RPC_C_AUTHN_LEVEL_PKT_INTEGRITY: - * ISC_REQ_USE_DCE_STYLE | ISC_REQ_DELEGATE | ISC_REQ_MUTUAL_AUTH | - * ISC_REQ_REPLAY_DETECT | ISC_REQ_SEQUENCE_DETECT - */ + * flags for RPC authentication: + * RPC_C_AUTHN_LEVEL_PKT_INTEGRITY: + * ISC_REQ_USE_DCE_STYLE | ISC_REQ_DELEGATE | ISC_REQ_MUTUAL_AUTH | + * ISC_REQ_REPLAY_DETECT | ISC_REQ_SEQUENCE_DETECT + */ ntlm->fContextReq |= ISC_REQ_USE_DCE_STYLE; ntlm->fContextReq |= ISC_REQ_DELEGATE | ISC_REQ_MUTUAL_AUTH; ntlm->fContextReq |= ISC_REQ_REPLAY_DETECT | ISC_REQ_SEQUENCE_DETECT; @@ -141,7 +141,7 @@ BOOL ntlm_client_make_spn(rdpNtlm* ntlm, LPCTSTR ServiceClass, LPCTSTR hostname) DWORD SpnLength = 0; LPTSTR hostnameX = NULL; #ifdef UNICODE - ConvertToUnicode(CP_UTF8, 0, hostname, -1, (LPWSTR*) &hostnameX, 0); + ConvertToUnicode(CP_UTF8, 0, hostname, -1, (LPWSTR*)&hostnameX, 0); #else hostnameX = _strdup(hostname); #endif @@ -151,7 +151,7 @@ BOOL ntlm_client_make_spn(rdpNtlm* ntlm, LPCTSTR ServiceClass, LPCTSTR hostname) if (!ServiceClass) { - ntlm->ServicePrincipalName = (LPTSTR) _tcsdup(hostnameX); + ntlm->ServicePrincipalName = (LPTSTR)_tcsdup(hostnameX); free(hostnameX); if (!ntlm->ServicePrincipalName) @@ -160,16 +160,17 @@ BOOL ntlm_client_make_spn(rdpNtlm* ntlm, LPCTSTR ServiceClass, LPCTSTR hostname) return TRUE; } - if (DsMakeSpn(ServiceClass, hostnameX, NULL, 0, NULL, &SpnLength, NULL) != ERROR_BUFFER_OVERFLOW) + if (DsMakeSpn(ServiceClass, hostnameX, NULL, 0, NULL, &SpnLength, NULL) != + ERROR_BUFFER_OVERFLOW) goto error; - ntlm->ServicePrincipalName = (LPTSTR) calloc(SpnLength, sizeof(TCHAR)); + ntlm->ServicePrincipalName = (LPTSTR)calloc(SpnLength, sizeof(TCHAR)); if (!ntlm->ServicePrincipalName) goto error; - if (DsMakeSpn(ServiceClass, hostnameX, NULL, 0, NULL, &SpnLength, - ntlm->ServicePrincipalName) != ERROR_SUCCESS) + if (DsMakeSpn(ServiceClass, hostnameX, NULL, 0, NULL, &SpnLength, ntlm->ServicePrincipalName) != + ERROR_SUCCESS) goto error; status = TRUE; @@ -254,18 +255,16 @@ BOOL ntlm_authenticate(rdpNtlm* ntlm, BOOL* pbContinueNeeded) ntlm->inputBufferDesc.cBuffers++; ntlm->inputBuffer[1].BufferType = SECBUFFER_CHANNEL_BINDINGS; ntlm->inputBuffer[1].cbBuffer = ntlm->Bindings->BindingsLength; - ntlm->inputBuffer[1].pvBuffer = (void*) ntlm->Bindings->Bindings; + ntlm->inputBuffer[1].pvBuffer = (void*)ntlm->Bindings->Bindings; } } - status = ntlm->table->InitializeSecurityContext(&ntlm->credentials, - (ntlm->haveContext) ? &ntlm->context : NULL, - (ntlm->ServicePrincipalName) ? ntlm->ServicePrincipalName : NULL, - ntlm->fContextReq, 0, SECURITY_NATIVE_DREP, - (ntlm->haveInputBuffer) ? &ntlm->inputBufferDesc : NULL, - 0, &ntlm->context, &ntlm->outputBufferDesc, - &ntlm->pfContextAttr, &ntlm->expiration); - WLog_VRB(TAG, "InitializeSecurityContext status %s [0x%08"PRIX32"]", + status = ntlm->table->InitializeSecurityContext( + &ntlm->credentials, (ntlm->haveContext) ? &ntlm->context : NULL, + (ntlm->ServicePrincipalName) ? ntlm->ServicePrincipalName : NULL, ntlm->fContextReq, 0, + SECURITY_NATIVE_DREP, (ntlm->haveInputBuffer) ? &ntlm->inputBufferDesc : NULL, 0, + &ntlm->context, &ntlm->outputBufferDesc, &ntlm->pfContextAttr, &ntlm->expiration); + WLog_VRB(TAG, "InitializeSecurityContext status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); if ((status == SEC_I_COMPLETE_AND_CONTINUE) || (status == SEC_I_COMPLETE_NEEDED) || @@ -278,18 +277,18 @@ BOOL ntlm_authenticate(rdpNtlm* ntlm, BOOL* pbContinueNeeded) if (cStatus != SEC_E_OK) { - WLog_WARN(TAG, "CompleteAuthToken status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "CompleteAuthToken status %s [0x%08" PRIX32 "]", GetSecurityStatusString(cStatus), cStatus); return FALSE; } } status = ntlm->table->QueryContextAttributes(&ntlm->context, SECPKG_ATTR_SIZES, - &ntlm->ContextSizes); + &ntlm->ContextSizes); if (status != SEC_E_OK) { - WLog_ERR(TAG, "QueryContextAttributes SECPKG_ATTR_SIZES failure %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "QueryContextAttributes SECPKG_ATTR_SIZES failure %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); return FALSE; } @@ -333,7 +332,7 @@ static void ntlm_client_uninit(rdpNtlm* ntlm) if (status != SEC_E_OK) { - WLog_WARN(TAG, "FreeCredentialsHandle status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "FreeCredentialsHandle status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -341,7 +340,7 @@ static void ntlm_client_uninit(rdpNtlm* ntlm) if (status != SEC_E_OK) { - WLog_WARN(TAG, "FreeContextBuffer status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "FreeContextBuffer status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -349,7 +348,7 @@ static void ntlm_client_uninit(rdpNtlm* ntlm) if (status != SEC_E_OK) { - WLog_WARN(TAG, "DeleteSecurityContext status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "DeleteSecurityContext status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -360,7 +359,7 @@ static void ntlm_client_uninit(rdpNtlm* ntlm) rdpNtlm* ntlm_new(void) { rdpNtlm* ntlm; - ntlm = (rdpNtlm*) calloc(1, sizeof(rdpNtlm)); + ntlm = (rdpNtlm*)calloc(1, sizeof(rdpNtlm)); return ntlm; } @@ -386,7 +385,8 @@ SSIZE_T ntlm_client_get_context_max_size(rdpNtlm* ntlm) if (ntlm->ContextSizes.cbMaxSignature > UINT16_MAX) { - WLog_ERR(TAG, "QueryContextAttributes SECPKG_ATTR_SIZES ContextSizes.cbMaxSignature > 0xFFFF"); + WLog_ERR(TAG, + "QueryContextAttributes SECPKG_ATTR_SIZES ContextSizes.cbMaxSignature > 0xFFFF"); return -1; } @@ -400,12 +400,12 @@ SSIZE_T ntlm_client_query_auth_size(rdpNtlm* ntlm) if (!ntlm || !ntlm->table || !ntlm->table->QueryContextAttributes) return -1; - status = ntlm->table->QueryContextAttributes(&ntlm->context, SECPKG_ATTR_SIZES, - &ntlm->ContextSizes); + status = + ntlm->table->QueryContextAttributes(&ntlm->context, SECPKG_ATTR_SIZES, &ntlm->ContextSizes); if (status != SEC_E_OK) { - WLog_ERR(TAG, "QueryContextAttributes SECPKG_ATTR_SIZES failure %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "QueryContextAttributes SECPKG_ATTR_SIZES failure %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); return -1; } @@ -425,7 +425,7 @@ BOOL ntlm_client_encrypt(rdpNtlm* ntlm, ULONG fQOP, SecBufferDesc* Message, size if (encrypt_status != SEC_E_OK) { - WLog_ERR(TAG, "EncryptMessage status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "EncryptMessage status %s [0x%08" PRIX32 "]", GetSecurityStatusString(encrypt_status), encrypt_status); return FALSE; } diff --git a/libfreerdp/core/gateway/ntlm.h b/libfreerdp/core/gateway/ntlm.h index 3d9d1230e..0f7eaab26 100644 --- a/libfreerdp/core/gateway/ntlm.h +++ b/libfreerdp/core/gateway/ntlm.h @@ -33,12 +33,11 @@ FREERDP_LOCAL void ntlm_free(rdpNtlm* ntlm); FREERDP_LOCAL BOOL ntlm_authenticate(rdpNtlm* ntlm, BOOL* pbContinueNeeded); -FREERDP_LOCAL BOOL ntlm_client_init(rdpNtlm* ntlm, BOOL confidentiality, - LPCTSTR user, LPCTSTR domain, - LPCTSTR password, SecPkgContext_Bindings* Bindings); +FREERDP_LOCAL BOOL ntlm_client_init(rdpNtlm* ntlm, BOOL confidentiality, LPCTSTR user, + LPCTSTR domain, LPCTSTR password, + SecPkgContext_Bindings* Bindings); -FREERDP_LOCAL BOOL ntlm_client_make_spn(rdpNtlm* ntlm, LPCTSTR ServiceClass, - LPCTSTR hostname); +FREERDP_LOCAL BOOL ntlm_client_make_spn(rdpNtlm* ntlm, LPCTSTR ServiceClass, LPCTSTR hostname); FREERDP_LOCAL SSIZE_T ntlm_client_query_auth_size(rdpNtlm* ntlm); FREERDP_LOCAL SSIZE_T ntlm_client_get_context_max_size(rdpNtlm* ntlm); @@ -47,7 +46,7 @@ FREERDP_LOCAL BOOL ntlm_client_encrypt(rdpNtlm* ntlm, ULONG fQOP, SecBufferDesc* size_t sequence); FREERDP_LOCAL BOOL ntlm_client_set_input_buffer(rdpNtlm* ntlm, BOOL copy, const void* data, - size_t size); + size_t size); FREERDP_LOCAL const SecBuffer* ntlm_client_get_output_buffer(rdpNtlm* ntlm); #endif /* FREERDP_LIB_CORE_GATEWAY_NTLM_H */ diff --git a/libfreerdp/core/gateway/rdg.c b/libfreerdp/core/gateway/rdg.c index b79810c5e..a7e73ceb4 100644 --- a/libfreerdp/core/gateway/rdg.c +++ b/libfreerdp/core/gateway/rdg.c @@ -1,21 +1,21 @@ /** -* FreeRDP: A Remote Desktop Protocol Implementation -* Remote Desktop Gateway (RDG) -* -* Copyright 2015 Denis Vincent -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * FreeRDP: A Remote Desktop Protocol Implementation + * Remote Desktop Gateway (RDG) + * + * Copyright 2015 Denis Vincent + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -41,7 +41,6 @@ #define TAG FREERDP_TAG("core.gateway.rdg") - /* HTTP channel response fields present flags. */ #define HTTP_CHANNEL_RESPONSE_FIELD_CHANNELID 0x1 #define HTTP_CHANNEL_RESPONSE_OPTIONAL 0x2 @@ -49,9 +48,9 @@ /* HTTP extended auth. */ #define HTTP_EXTENDED_AUTH_NONE 0x0 -#define HTTP_EXTENDED_AUTH_SC 0x1 /* Smart card authentication. */ -#define HTTP_EXTENDED_AUTH_PAA 0x02 /* Pluggable authentication. */ -#define HTTP_EXTENDED_AUTH_SSPI_NTLM 0x04 /* NTLM extended authentication. */ +#define HTTP_EXTENDED_AUTH_SC 0x1 /* Smart card authentication. */ +#define HTTP_EXTENDED_AUTH_PAA 0x02 /* Pluggable authentication. */ +#define HTTP_EXTENDED_AUTH_SSPI_NTLM 0x04 /* NTLM extended authentication. */ /* HTTP packet types. */ #define PKT_TYPE_HANDSHAKE_REQUEST 0x1 @@ -154,38 +153,36 @@ typedef struct const char* name; } t_err_mapping; -static const t_err_mapping tunnel_response_fields_present[] = -{ - {HTTP_TUNNEL_RESPONSE_FIELD_TUNNEL_ID, "HTTP_TUNNEL_RESPONSE_FIELD_TUNNEL_ID"}, - {HTTP_TUNNEL_RESPONSE_FIELD_CAPS, "HTTP_TUNNEL_RESPONSE_FIELD_CAPS"}, - {HTTP_TUNNEL_RESPONSE_FIELD_SOH_REQ, "HTTP_TUNNEL_RESPONSE_FIELD_SOH_REQ"}, - {HTTP_TUNNEL_RESPONSE_FIELD_CONSENT_MSG, "HTTP_TUNNEL_RESPONSE_FIELD_CONSENT_MSG"} +static const t_err_mapping tunnel_response_fields_present[] = { + { HTTP_TUNNEL_RESPONSE_FIELD_TUNNEL_ID, "HTTP_TUNNEL_RESPONSE_FIELD_TUNNEL_ID" }, + { HTTP_TUNNEL_RESPONSE_FIELD_CAPS, "HTTP_TUNNEL_RESPONSE_FIELD_CAPS" }, + { HTTP_TUNNEL_RESPONSE_FIELD_SOH_REQ, "HTTP_TUNNEL_RESPONSE_FIELD_SOH_REQ" }, + { HTTP_TUNNEL_RESPONSE_FIELD_CONSENT_MSG, "HTTP_TUNNEL_RESPONSE_FIELD_CONSENT_MSG" } }; -static const t_err_mapping channel_response_fields_present[] = -{ - {HTTP_CHANNEL_RESPONSE_FIELD_CHANNELID, "HTTP_CHANNEL_RESPONSE_FIELD_CHANNELID"}, - {HTTP_CHANNEL_RESPONSE_OPTIONAL, "HTTP_CHANNEL_RESPONSE_OPTIONAL"}, - {HTTP_CHANNEL_RESPONSE_FIELD_UDPPORT, "HTTP_CHANNEL_RESPONSE_FIELD_UDPPORT"} +static const t_err_mapping channel_response_fields_present[] = { + { HTTP_CHANNEL_RESPONSE_FIELD_CHANNELID, "HTTP_CHANNEL_RESPONSE_FIELD_CHANNELID" }, + { HTTP_CHANNEL_RESPONSE_OPTIONAL, "HTTP_CHANNEL_RESPONSE_OPTIONAL" }, + { HTTP_CHANNEL_RESPONSE_FIELD_UDPPORT, "HTTP_CHANNEL_RESPONSE_FIELD_UDPPORT" } }; -static const t_err_mapping tunnel_authorization_response_fields_present[] = -{ - {HTTP_TUNNEL_AUTH_RESPONSE_FIELD_REDIR_FLAGS, "HTTP_TUNNEL_AUTH_RESPONSE_FIELD_REDIR_FLAGS"}, - {HTTP_TUNNEL_AUTH_RESPONSE_FIELD_IDLE_TIMEOUT, "HTTP_TUNNEL_AUTH_RESPONSE_FIELD_IDLE_TIMEOUT"}, - {HTTP_TUNNEL_AUTH_RESPONSE_FIELD_SOH_RESPONSE, "HTTP_TUNNEL_AUTH_RESPONSE_FIELD_SOH_RESPONSE"} +static const t_err_mapping tunnel_authorization_response_fields_present[] = { + { HTTP_TUNNEL_AUTH_RESPONSE_FIELD_REDIR_FLAGS, "HTTP_TUNNEL_AUTH_RESPONSE_FIELD_REDIR_FLAGS" }, + { HTTP_TUNNEL_AUTH_RESPONSE_FIELD_IDLE_TIMEOUT, + "HTTP_TUNNEL_AUTH_RESPONSE_FIELD_IDLE_TIMEOUT" }, + { HTTP_TUNNEL_AUTH_RESPONSE_FIELD_SOH_RESPONSE, + "HTTP_TUNNEL_AUTH_RESPONSE_FIELD_SOH_RESPONSE" } }; -static const t_err_mapping extended_auth[] = -{ - {HTTP_EXTENDED_AUTH_NONE, "HTTP_EXTENDED_AUTH_NONE"}, - {HTTP_EXTENDED_AUTH_SC, "HTTP_EXTENDED_AUTH_SC"}, - {HTTP_EXTENDED_AUTH_PAA, "HTTP_EXTENDED_AUTH_PAA"}, - {HTTP_EXTENDED_AUTH_SSPI_NTLM, "HTTP_EXTENDED_AUTH_SSPI_NTLM"} +static const t_err_mapping extended_auth[] = { + { HTTP_EXTENDED_AUTH_NONE, "HTTP_EXTENDED_AUTH_NONE" }, + { HTTP_EXTENDED_AUTH_SC, "HTTP_EXTENDED_AUTH_SC" }, + { HTTP_EXTENDED_AUTH_PAA, "HTTP_EXTENDED_AUTH_PAA" }, + { HTTP_EXTENDED_AUTH_SSPI_NTLM, "HTTP_EXTENDED_AUTH_SSPI_NTLM" } }; static const char* fields_present_to_string(UINT16 fieldsPresent, const t_err_mapping* map, - size_t elements) + size_t elements) { size_t x = 0; static char buffer[1024] = { 0 }; @@ -201,7 +198,7 @@ static const char* fields_present_to_string(UINT16 fieldsPresent, const t_err_ma strcat(buffer, map[x].name); } - sprintf_s(fields, ARRAYSIZE(fields), " [%04"PRIx16"]", fieldsPresent); + sprintf_s(fields, ARRAYSIZE(fields), " [%04" PRIx16 "]", fieldsPresent); strcat(buffer, fields); return buffer; } @@ -238,7 +235,7 @@ static BOOL rdg_write_packet(rdpRdg* rdg, wStream* sPacket) int status; wStream* sChunk; char chunkSize[11]; - sprintf_s(chunkSize, sizeof(chunkSize), "%"PRIXz"\r\n", Stream_Length(sPacket)); + sprintf_s(chunkSize, sizeof(chunkSize), "%" PRIXz "\r\n", Stream_Length(sPacket)); sChunk = Stream_New(NULL, strnlen(chunkSize, sizeof(chunkSize)) + Stream_Length(sPacket) + 2); if (!sChunk) @@ -313,8 +310,7 @@ static wStream* rdg_receive_packet(rdpRdg* rdg) return NULL; } - if (!rdg_read_all(rdg->tlsOut, Stream_Buffer(s) + header, - (int)packetLength - (int)header)) + if (!rdg_read_all(rdg->tlsOut, Stream_Buffer(s) + header, (int)packetLength - (int)header)) { Stream_Free(s, TRUE); return NULL; @@ -334,12 +330,12 @@ static BOOL rdg_send_handshake(rdpRdg* rdg) return FALSE; Stream_Write_UINT16(s, PKT_TYPE_HANDSHAKE_REQUEST); /* Type (2 bytes) */ - Stream_Write_UINT16(s, 0); /* Reserved (2 bytes) */ - Stream_Write_UINT32(s, 14); /* PacketLength (4 bytes) */ - Stream_Write_UINT8(s, 1); /* VersionMajor (1 byte) */ - Stream_Write_UINT8(s, 0); /* VersionMinor (1 byte) */ - Stream_Write_UINT16(s, 0); /* ClientVersion (2 bytes), must be 0 */ - Stream_Write_UINT16(s, rdg->extAuth); /* ExtendedAuthentication (2 bytes) */ + Stream_Write_UINT16(s, 0); /* Reserved (2 bytes) */ + Stream_Write_UINT32(s, 14); /* PacketLength (4 bytes) */ + Stream_Write_UINT8(s, 1); /* VersionMajor (1 byte) */ + Stream_Write_UINT8(s, 0); /* VersionMinor (1 byte) */ + Stream_Write_UINT16(s, 0); /* ClientVersion (2 bytes), must be 0 */ + Stream_Write_UINT16(s, rdg->extAuth); /* ExtendedAuthentication (2 bytes) */ Stream_SealLength(s); status = rdg_write_packet(rdg, s); Stream_Free(s, TRUE); @@ -363,7 +359,8 @@ static BOOL rdg_send_tunnel_request(rdpRdg* rdg) if (rdg->extAuth == HTTP_EXTENDED_AUTH_PAA) { - PAACookieLen = ConvertToUnicode(CP_UTF8, 0, rdg->settings->GatewayAccessToken, -1, &PAACookie, 0); + PAACookieLen = + ConvertToUnicode(CP_UTF8, 0, rdg->settings->GatewayAccessToken, -1, &PAACookie, 0); if (!PAACookie || (PAACookieLen < 0) || (PAACookieLen > UINT16_MAX / 2)) { @@ -383,12 +380,12 @@ static BOOL rdg_send_tunnel_request(rdpRdg* rdg) return FALSE; } - Stream_Write_UINT16(s, PKT_TYPE_TUNNEL_CREATE); /* Type (2 bytes) */ - Stream_Write_UINT16(s, 0); /* Reserved (2 bytes) */ - Stream_Write_UINT32(s, packetSize); /* PacketLength (4 bytes) */ + Stream_Write_UINT16(s, PKT_TYPE_TUNNEL_CREATE); /* Type (2 bytes) */ + Stream_Write_UINT16(s, 0); /* Reserved (2 bytes) */ + Stream_Write_UINT32(s, packetSize); /* PacketLength (4 bytes) */ Stream_Write_UINT32(s, HTTP_CAPABILITY_TYPE_QUAR_SOH); /* CapabilityFlags (4 bytes) */ - Stream_Write_UINT16(s, fieldsPresent); /* FieldsPresent (2 bytes) */ - Stream_Write_UINT16(s, 0); /* Reserved (2 bytes), must be 0 */ + Stream_Write_UINT16(s, fieldsPresent); /* FieldsPresent (2 bytes) */ + Stream_Write_UINT16(s, 0); /* Reserved (2 bytes), must be 0 */ if (PAACookie) { @@ -415,7 +412,8 @@ static BOOL rdg_send_tunnel_authorization(rdpRdg* rdg) BOOL status; WCHAR* clientName = NULL; UINT32 packetSize; - int clientNameLen = ConvertToUnicode(CP_UTF8, 0, rdg->settings->ClientHostname, -1, &clientName, 0); + int clientNameLen = + ConvertToUnicode(CP_UTF8, 0, rdg->settings->ClientHostname, -1, &clientName, 0); if (!clientName || (clientNameLen < 0) || (clientNameLen > UINT16_MAX / 2)) { @@ -432,10 +430,10 @@ static BOOL rdg_send_tunnel_authorization(rdpRdg* rdg) return FALSE; } - Stream_Write_UINT16(s, PKT_TYPE_TUNNEL_AUTH); /* Type (2 bytes) */ - Stream_Write_UINT16(s, 0); /* Reserved (2 bytes) */ - Stream_Write_UINT32(s, packetSize); /* PacketLength (4 bytes) */ - Stream_Write_UINT16(s, 0); /* FieldsPresent (2 bytes) */ + Stream_Write_UINT16(s, PKT_TYPE_TUNNEL_AUTH); /* Type (2 bytes) */ + Stream_Write_UINT16(s, 0); /* Reserved (2 bytes) */ + Stream_Write_UINT32(s, packetSize); /* PacketLength (4 bytes) */ + Stream_Write_UINT16(s, 0); /* FieldsPresent (2 bytes) */ Stream_Write_UINT16(s, (UINT16)clientNameLen * 2); /* Client name string length */ Stream_Write_UTF16_String(s, clientName, (size_t)clientNameLen); Stream_SealLength(s); @@ -456,7 +454,8 @@ static BOOL rdg_send_channel_create(rdpRdg* rdg) wStream* s = NULL; BOOL status = FALSE; WCHAR* serverName = NULL; - int serverNameLen = ConvertToUnicode(CP_UTF8, 0, rdg->settings->ServerHostname, -1, &serverName, 0); + int serverNameLen = + ConvertToUnicode(CP_UTF8, 0, rdg->settings->ServerHostname, -1, &serverName, 0); UINT32 packetSize = 16 + ((UINT32)serverNameLen) * 2; if ((serverNameLen < 0) || (serverNameLen > UINT16_MAX / 2)) @@ -468,12 +467,12 @@ static BOOL rdg_send_channel_create(rdpRdg* rdg) goto fail; Stream_Write_UINT16(s, PKT_TYPE_CHANNEL_CREATE); /* Type (2 bytes) */ - Stream_Write_UINT16(s, 0); /* Reserved (2 bytes) */ - Stream_Write_UINT32(s, packetSize); /* PacketLength (4 bytes) */ - Stream_Write_UINT8(s, 1); /* Number of resources. (1 byte) */ - Stream_Write_UINT8(s, 0); /* Number of alternative resources (1 byte) */ + Stream_Write_UINT16(s, 0); /* Reserved (2 bytes) */ + Stream_Write_UINT32(s, packetSize); /* PacketLength (4 bytes) */ + Stream_Write_UINT8(s, 1); /* Number of resources. (1 byte) */ + Stream_Write_UINT8(s, 0); /* Number of alternative resources (1 byte) */ Stream_Write_UINT16(s, (UINT16)rdg->settings->ServerPort); /* Resource port (2 bytes) */ - Stream_Write_UINT16(s, 3); /* Protocol number (2 bytes) */ + Stream_Write_UINT16(s, 3); /* Protocol number (2 bytes) */ Stream_Write_UINT16(s, (UINT16)serverNameLen * 2); Stream_Write_UTF16_String(s, serverName, (size_t)serverNameLen); Stream_SealLength(s); @@ -530,8 +529,7 @@ static wStream* rdg_build_http_request(rdpRdg* rdg, const char* method, if (!request) return NULL; - if (!http_request_set_method(request, method) || - !http_request_set_uri(request, uri)) + if (!http_request_set_method(request, method) || !http_request_set_uri(request, uri)) goto out; if (rdg->ntlm) @@ -571,8 +569,7 @@ static BOOL rdg_handle_ntlm_challenge(rdpNtlm* ntlm, HttpResponse* response) if (StatusCode != HTTP_STATUS_DENIED) { - WLog_DBG(TAG, "Unexpected NTLM challenge HTTP status: %ld", - StatusCode); + WLog_DBG(TAG, "Unexpected NTLM challenge HTTP status: %ld", StatusCode); return FALSE; } @@ -621,8 +618,7 @@ static BOOL rdg_skip_seed_payload(rdpTls* tls, SSIZE_T lastResponseLength) */ if (lastResponseLength < (SSIZE_T)size) { - if (!rdg_read_all(tls, seed_payload, - size - lastResponseLength)) + if (!rdg_read_all(tls, seed_payload, size - lastResponseLength)) { return FALSE; } @@ -646,8 +642,8 @@ static BOOL rdg_process_handshake_response(rdpRdg* rdg, wStream* s) if (Stream_GetRemainingLength(s) < 10) { - WLog_ERR(TAG, "[%s] Short packet %"PRIuz", expected 10", - __FUNCTION__, Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "[%s] Short packet %" PRIuz ", expected 10", __FUNCTION__, + Stream_GetRemainingLength(s)); return FALSE; } @@ -658,7 +654,8 @@ static BOOL rdg_process_handshake_response(rdpRdg* rdg, wStream* s) Stream_Read_UINT16(s, extendedAuth); error = rpc_error_to_string(errorCode); WLog_DBG(TAG, - "errorCode=%s, verMajor=%"PRId8", verMinor=%"PRId8", serverVersion=%"PRId16", extendedAuth=%s", + "errorCode=%s, verMajor=%" PRId8 ", verMinor=%" PRId8 ", serverVersion=%" PRId16 + ", extendedAuth=%s", error, verMajor, verMinor, serverVersion, extended_auth_to_string(extendedAuth)); if (FAILED(errorCode)) @@ -685,8 +682,8 @@ static BOOL rdg_process_tunnel_response(rdpRdg* rdg, wStream* s) if (Stream_GetRemainingLength(s) < 10) { - WLog_ERR(TAG, "[%s] Short packet %"PRIuz", expected 10", - __FUNCTION__, Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "[%s] Short packet %" PRIuz ", expected 10", __FUNCTION__, + Stream_GetRemainingLength(s)); return FALSE; } @@ -695,8 +692,8 @@ static BOOL rdg_process_tunnel_response(rdpRdg* rdg, wStream* s) Stream_Read_UINT16(s, fieldsPresent); Stream_Seek_UINT16(s); /* reserved */ error = rpc_error_to_string(errorCode); - WLog_DBG(TAG, "serverVersion=%"PRId16", errorCode=%s, fieldsPresent=%s", - serverVersion, error, tunnel_response_fields_present_to_string(fieldsPresent)); + WLog_DBG(TAG, "serverVersion=%" PRId16 ", errorCode=%s, fieldsPresent=%s", serverVersion, error, + tunnel_response_fields_present_to_string(fieldsPresent)); if (FAILED(errorCode)) { @@ -722,8 +719,8 @@ static BOOL rdg_process_tunnel_authorization_response(rdpRdg* rdg, wStream* s) if (Stream_GetRemainingLength(s) < 8) { - WLog_ERR(TAG, "[%s] Short packet %"PRIuz", expected 8", - __FUNCTION__, Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "[%s] Short packet %" PRIuz ", expected 8", __FUNCTION__, + Stream_GetRemainingLength(s)); return FALSE; } @@ -731,8 +728,8 @@ static BOOL rdg_process_tunnel_authorization_response(rdpRdg* rdg, wStream* s) Stream_Read_UINT16(s, fieldsPresent); Stream_Seek_UINT16(s); /* reserved */ error = rpc_error_to_string(errorCode); - WLog_DBG(TAG, "errorCode=%s, fieldsPresent=%s", - error, tunnel_authorization_response_fields_present_to_string(fieldsPresent)); + WLog_DBG(TAG, "errorCode=%s, fieldsPresent=%s", error, + tunnel_authorization_response_fields_present_to_string(fieldsPresent)); if (FAILED(errorCode)) { @@ -758,8 +755,8 @@ static BOOL rdg_process_channel_response(rdpRdg* rdg, wStream* s) if (Stream_GetRemainingLength(s) < 8) { - WLog_ERR(TAG, "[%s] Short packet %"PRIuz", expected 8", - __FUNCTION__, Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "[%s] Short packet %" PRIuz ", expected 8", __FUNCTION__, + Stream_GetRemainingLength(s)); return FALSE; } @@ -767,13 +764,13 @@ static BOOL rdg_process_channel_response(rdpRdg* rdg, wStream* s) Stream_Read_UINT16(s, fieldsPresent); Stream_Seek_UINT16(s); /* reserved */ error = rpc_error_to_string(errorCode); - WLog_DBG(TAG, "channel response errorCode=%s, fieldsPresent=%s", - error, channel_response_fields_present_to_string(fieldsPresent)); + WLog_DBG(TAG, "channel response errorCode=%s, fieldsPresent=%s", error, + channel_response_fields_present_to_string(fieldsPresent)); if (FAILED(errorCode)) { - WLog_ERR(TAG, "channel response errorCode=%s, fieldsPresent=%s", - error, channel_response_fields_present_to_string(fieldsPresent)); + WLog_ERR(TAG, "channel response errorCode=%s, fieldsPresent=%s", error, + channel_response_fields_present_to_string(fieldsPresent)); freerdp_set_last_error(rdg->context, errorCode); return FALSE; } @@ -791,8 +788,8 @@ static BOOL rdg_process_packet(rdpRdg* rdg, wStream* s) if (Stream_GetRemainingLength(s) < 8) { - WLog_ERR(TAG, "[%s] Short packet %"PRIuz", expected 8", - __FUNCTION__, Stream_GetRemainingLength(s)); + WLog_ERR(TAG, "[%s] Short packet %" PRIuz ", expected 8", __FUNCTION__, + Stream_GetRemainingLength(s)); return FALSE; } @@ -802,8 +799,8 @@ static BOOL rdg_process_packet(rdpRdg* rdg, wStream* s) if (Stream_Length(s) < packetLength) { - WLog_ERR(TAG, "[%s] Short packet %"PRIuz", expected %"PRIuz, - __FUNCTION__, Stream_Length(s), packetLength); + WLog_ERR(TAG, "[%s] Short packet %" PRIuz ", expected %" PRIuz, __FUNCTION__, + Stream_Length(s), packetLength); return FALSE; } @@ -878,8 +875,9 @@ static BOOL rdg_get_gateway_credentials(rdpContext* context) } else { - BOOL proceed = instance->GatewayAuthenticate(instance, &settings->GatewayUsername, - &settings->GatewayPassword, &settings->GatewayDomain); + BOOL proceed = + instance->GatewayAuthenticate(instance, &settings->GatewayUsername, + &settings->GatewayPassword, &settings->GatewayDomain); if (!proceed) { @@ -974,15 +972,14 @@ static BOOL rdg_tls_connect(rdpRdg* rdg, rdpTls* tls, const char* peerAddress, i rdpSettings* settings = rdg->settings; const char* peerHostname = settings->GatewayHostname; UINT16 peerPort = (UINT16)settings->GatewayPort; - const char* proxyUsername, *proxyPassword; - BOOL isProxyConnection = proxy_prepare(settings, &peerHostname, &peerPort, &proxyUsername, - &proxyPassword); + const char *proxyUsername, *proxyPassword; + BOOL isProxyConnection = + proxy_prepare(settings, &peerHostname, &peerPort, &proxyUsername, &proxyPassword); if (settings->GatewayPort > UINT16_MAX) return FALSE; - sockfd = freerdp_tcp_connect(rdg->context, settings, - peerAddress ? peerAddress : peerHostname, + sockfd = freerdp_tcp_connect(rdg->context, settings, peerAddress ? peerAddress : peerHostname, peerPort, timeout); if (sockfd < 0) @@ -1012,8 +1009,8 @@ static BOOL rdg_tls_connect(rdpRdg* rdg, rdpTls* tls, const char* peerAddress, i if (isProxyConnection) { - if (!proxy_connect(settings, bufferedBio, proxyUsername, proxyPassword, settings->GatewayHostname, - (UINT16)settings->GatewayPort)) + if (!proxy_connect(settings, bufferedBio, proxyUsername, proxyPassword, + settings->GatewayHostname, (UINT16)settings->GatewayPort)) { BIO_free_all(bufferedBio); return FALSE; @@ -1049,8 +1046,8 @@ static BOOL rdg_tls_connect(rdpRdg* rdg, rdpTls* tls, const char* peerAddress, i return (status >= 1); } -static BOOL rdg_establish_data_connection(rdpRdg* rdg, rdpTls* tls, - const char* method, const char* peerAddress, int timeout, BOOL* rpcFallback) +static BOOL rdg_establish_data_connection(rdpRdg* rdg, rdpTls* tls, const char* method, + const char* peerAddress, int timeout, BOOL* rpcFallback) { HttpResponse* response = NULL; long statusCode; @@ -1075,13 +1072,14 @@ static BOOL rdg_establish_data_connection(rdpRdg* rdg, rdpTls* tls, StatusCode = http_response_get_status_code(response); - switch(StatusCode) + switch (StatusCode) { case HTTP_STATUS_NOT_FOUND: { WLog_INFO(TAG, "RD Gateway does not support HTTP transport."); - if (rpcFallback) *rpcFallback = TRUE; + if (rpcFallback) + *rpcFallback = TRUE; http_response_free(response); return FALSE; @@ -1114,7 +1112,7 @@ static BOOL rdg_establish_data_connection(rdpRdg* rdg, rdpTls* tls, http_response_free(response); WLog_DBG(TAG, "%s authorization result: %d", method, statusCode); - switch(statusCode) + switch (statusCode) { case HTTP_STATUS_OK: break; @@ -1172,8 +1170,8 @@ BOOL rdg_connect(rdpRdg* rdg, int timeout, BOOL* rpcFallback) SOCKET outConnSocket = 0; char* peerAddress = NULL; assert(rdg != NULL); - status = rdg_establish_data_connection( - rdg, rdg->tlsOut, "RDG_OUT_DATA", NULL, timeout, rpcFallback); + status = + rdg_establish_data_connection(rdg, rdg->tlsOut, "RDG_OUT_DATA", NULL, timeout, rpcFallback); if (status) { @@ -1182,8 +1180,8 @@ BOOL rdg_connect(rdpRdg* rdg, int timeout, BOOL* rpcFallback) */ BIO_get_socket(rdg->tlsOut->underlying, &outConnSocket); peerAddress = freerdp_tcp_get_peer_address(outConnSocket); - status = rdg_establish_data_connection( - rdg, rdg->tlsIn, "RDG_IN_DATA", peerAddress, timeout, NULL); + status = rdg_establish_data_connection(rdg, rdg->tlsIn, "RDG_IN_DATA", peerAddress, timeout, + NULL); free(peerAddress); } @@ -1216,18 +1214,18 @@ static int rdg_write_data_packet(rdpRdg* rdg, const BYTE* buf, int isize) if (size < 1) return 0; - sprintf_s(chunkSize, sizeof(chunkSize), "%"PRIxz"\r\n", packetSize); + sprintf_s(chunkSize, sizeof(chunkSize), "%" PRIxz "\r\n", packetSize); sChunk = Stream_New(NULL, strnlen(chunkSize, sizeof(chunkSize)) + packetSize + 2); if (!sChunk) return -1; Stream_Write(sChunk, chunkSize, strnlen(chunkSize, sizeof(chunkSize))); - Stream_Write_UINT16(sChunk, PKT_TYPE_DATA); /* Type */ - Stream_Write_UINT16(sChunk, 0); /* Reserved */ - Stream_Write_UINT32(sChunk, (UINT32)packetSize); /* Packet length */ - Stream_Write_UINT16(sChunk, (UINT16)size); /* Data size */ - Stream_Write(sChunk, buf, size); /* Data */ + Stream_Write_UINT16(sChunk, PKT_TYPE_DATA); /* Type */ + Stream_Write_UINT16(sChunk, 0); /* Reserved */ + Stream_Write_UINT32(sChunk, (UINT32)packetSize); /* Packet length */ + Stream_Write_UINT16(sChunk, (UINT16)size); /* Data size */ + Stream_Write(sChunk, buf, size); /* Data */ Stream_Write(sChunk, "\r\n", 2); Stream_SealLength(sChunk); s = Stream_Length(sChunk); @@ -1251,7 +1249,7 @@ static BOOL rdg_process_close_packet(rdpRdg* rdg) wStream* sChunk; UINT32 packetSize = 12; char chunkSize[11]; - int chunkLen = sprintf_s(chunkSize, sizeof(chunkSize), "%"PRIx32"\r\n", packetSize); + int chunkLen = sprintf_s(chunkSize, sizeof(chunkSize), "%" PRIx32 "\r\n", packetSize); if (chunkLen < 0) return FALSE; @@ -1262,10 +1260,10 @@ static BOOL rdg_process_close_packet(rdpRdg* rdg) return FALSE; Stream_Write(sChunk, chunkSize, (size_t)chunkLen); - Stream_Write_UINT16(sChunk, PKT_TYPE_CLOSE_CHANNEL_RESPONSE); /* Type */ - Stream_Write_UINT16(sChunk, 0); /* Reserved */ - Stream_Write_UINT32(sChunk, packetSize); /* Packet length */ - Stream_Write_UINT32(sChunk, 0); /* Status code */ + Stream_Write_UINT16(sChunk, PKT_TYPE_CLOSE_CHANNEL_RESPONSE); /* Type */ + Stream_Write_UINT16(sChunk, 0); /* Reserved */ + Stream_Write_UINT32(sChunk, packetSize); /* Packet length */ + Stream_Write_UINT32(sChunk, 0); /* Status code */ Stream_Write(sChunk, "\r\n", 2); Stream_SealLength(sChunk); s = Stream_Length(sChunk); @@ -1284,7 +1282,7 @@ static BOOL rdg_process_keep_alive_packet(rdpRdg* rdg) wStream* sChunk; size_t packetSize = 8; char chunkSize[11]; - int chunkLen = sprintf_s(chunkSize, sizeof(chunkSize), "%"PRIxz"\r\n", packetSize); + int chunkLen = sprintf_s(chunkSize, sizeof(chunkSize), "%" PRIxz "\r\n", packetSize); if ((chunkLen < 0) || (packetSize > UINT32_MAX)) return FALSE; @@ -1295,9 +1293,9 @@ static BOOL rdg_process_keep_alive_packet(rdpRdg* rdg) return FALSE; Stream_Write(sChunk, chunkSize, (size_t)chunkLen); - Stream_Write_UINT16(sChunk, PKT_TYPE_KEEPALIVE); /* Type */ - Stream_Write_UINT16(sChunk, 0); /* Reserved */ - Stream_Write_UINT32(sChunk, (UINT32)packetSize); /* Packet length */ + Stream_Write_UINT16(sChunk, PKT_TYPE_KEEPALIVE); /* Type */ + Stream_Write_UINT16(sChunk, 0); /* Reserved */ + Stream_Write_UINT32(sChunk, (UINT32)packetSize); /* Packet length */ Stream_Write(sChunk, "\r\n", 2); Stream_SealLength(sChunk); s = Stream_Length(sChunk); @@ -1338,8 +1336,8 @@ static BOOL rdg_process_control_packet(rdpRdg* rdg, int type, size_t packetLengt while (readCount < payloadSize) { - status = BIO_read(rdg->tlsOut->bio, Stream_Pointer(s), - (int)payloadSize - (int)readCount); + status = + BIO_read(rdg->tlsOut->bio, Stream_Pointer(s), (int)payloadSize - (int)readCount); if (status <= 0) { @@ -1470,10 +1468,10 @@ static int rdg_read_data_packet(rdpRdg* rdg, BYTE* buffer, int size) static int rdg_bio_write(BIO* bio, const char* buf, int num) { int status; - rdpRdg* rdg = (rdpRdg*) BIO_get_data(bio); + rdpRdg* rdg = (rdpRdg*)BIO_get_data(bio); BIO_clear_flags(bio, BIO_FLAGS_WRITE); EnterCriticalSection(&rdg->writeSection); - status = rdg_write_data_packet(rdg, (const BYTE*) buf, num); + status = rdg_write_data_packet(rdg, (const BYTE*)buf, num); LeaveCriticalSection(&rdg->writeSection); if (status < 0) @@ -1497,8 +1495,8 @@ static int rdg_bio_write(BIO* bio, const char* buf, int num) static int rdg_bio_read(BIO* bio, char* buf, int size) { int status; - rdpRdg* rdg = (rdpRdg*) BIO_get_data(bio); - status = rdg_read_data_packet(rdg, (BYTE*) buf, size); + rdpRdg* rdg = (rdpRdg*)BIO_get_data(bio); + status = rdg_read_data_packet(rdg, (BYTE*)buf, size); if (status < 0) { @@ -1537,7 +1535,7 @@ static int rdg_bio_gets(BIO* bio, char* str, int size) static long rdg_bio_ctrl(BIO* bio, int cmd, long arg1, void* arg2) { long status = -1; - rdpRdg* rdg = (rdpRdg*) BIO_get_data(bio); + rdpRdg* rdg = (rdpRdg*)BIO_get_data(bio); rdpTls* tlsOut = rdg->tlsOut; rdpTls* tlsIn = rdg->tlsIn; @@ -1563,7 +1561,7 @@ static long rdg_bio_ctrl(BIO* bio, int cmd, long arg1, void* arg2) } else if (cmd == BIO_C_WAIT_READ) { - int timeout = (int) arg1; + int timeout = (int)arg1; BIO* bio = tlsOut->bio; if (BIO_read_blocked(bio)) @@ -1575,7 +1573,7 @@ static long rdg_bio_ctrl(BIO* bio, int cmd, long arg1, void* arg2) } else if (cmd == BIO_C_WAIT_WRITE) { - int timeout = (int) arg1; + int timeout = (int)arg1; BIO* bio = tlsIn->bio; if (BIO_write_blocked(bio)) @@ -1645,7 +1643,7 @@ rdpRdg* rdg_new(rdpContext* context) if (!context) return NULL; - rdg = (rdpRdg*) calloc(1, sizeof(rdpRdg)); + rdg = (rdpRdg*)calloc(1, sizeof(rdpRdg)); if (rdg) { @@ -1703,7 +1701,8 @@ rdpRdg* rdg_new(rdpContext* context) break; default: - WLog_DBG(TAG, "RDG extended authentication method %d not supported", rdg->extAuth); + WLog_DBG(TAG, "RDG extended authentication method %d not supported", + rdg->extAuth); } } diff --git a/libfreerdp/core/gateway/rdg.h b/libfreerdp/core/gateway/rdg.h old mode 100755 new mode 100644 index 0b69a87c8..829d0a250 --- a/libfreerdp/core/gateway/rdg.h +++ b/libfreerdp/core/gateway/rdg.h @@ -20,7 +20,6 @@ #ifndef FREERDP_LIB_CORE_GATEWAY_RDG_H #define FREERDP_LIB_CORE_GATEWAY_RDG_H - #include #include #include @@ -46,8 +45,6 @@ FREERDP_LOCAL void rdg_free(rdpRdg* rdg); FREERDP_LOCAL BIO* rdg_get_front_bio_and_take_ownership(rdpRdg* rdg); FREERDP_LOCAL BOOL rdg_connect(rdpRdg* rdg, int timeout, BOOL* rpcFallback); -FREERDP_LOCAL DWORD rdg_get_event_handles(rdpRdg* rdg, HANDLE* events, - DWORD count); - +FREERDP_LOCAL DWORD rdg_get_event_handles(rdpRdg* rdg, HANDLE* events, DWORD count); #endif /* FREERDP_LIB_CORE_GATEWAY_RDG_H */ diff --git a/libfreerdp/core/gateway/rpc.c b/libfreerdp/core/gateway/rpc.c index 1cea31a3f..f54fe147f 100644 --- a/libfreerdp/core/gateway/rpc.c +++ b/libfreerdp/core/gateway/rpc.c @@ -49,31 +49,17 @@ #define TAG FREERDP_TAG("core.gateway.rpc") -static const char* PTYPE_STRINGS[] = -{ - "PTYPE_REQUEST", - "PTYPE_PING", - "PTYPE_RESPONSE", - "PTYPE_FAULT", - "PTYPE_WORKING", - "PTYPE_NOCALL", - "PTYPE_REJECT", - "PTYPE_ACK", - "PTYPE_CL_CANCEL", - "PTYPE_FACK", - "PTYPE_CANCEL_ACK", - "PTYPE_BIND", - "PTYPE_BIND_ACK", - "PTYPE_BIND_NAK", - "PTYPE_ALTER_CONTEXT", - "PTYPE_ALTER_CONTEXT_RESP", - "PTYPE_RPC_AUTH_3", - "PTYPE_SHUTDOWN", - "PTYPE_CO_CANCEL", - "PTYPE_ORPHANED", - "PTYPE_RTS", - "" -}; +static const char* PTYPE_STRINGS[] = { "PTYPE_REQUEST", "PTYPE_PING", + "PTYPE_RESPONSE", "PTYPE_FAULT", + "PTYPE_WORKING", "PTYPE_NOCALL", + "PTYPE_REJECT", "PTYPE_ACK", + "PTYPE_CL_CANCEL", "PTYPE_FACK", + "PTYPE_CANCEL_ACK", "PTYPE_BIND", + "PTYPE_BIND_ACK", "PTYPE_BIND_NAK", + "PTYPE_ALTER_CONTEXT", "PTYPE_ALTER_CONTEXT_RESP", + "PTYPE_RPC_AUTH_3", "PTYPE_SHUTDOWN", + "PTYPE_CO_CANCEL", "PTYPE_ORPHANED", + "PTYPE_RTS", "" }; /** * [MS-RPCH]: Remote Procedure Call over HTTP Protocol Specification: @@ -104,51 +90,52 @@ static const char* PTYPE_STRINGS[] = void rpc_pdu_header_print(rpcconn_hdr_t* header) { - WLog_INFO(TAG, "rpc_vers: %"PRIu8"", header->common.rpc_vers); - WLog_INFO(TAG, "rpc_vers_minor: %"PRIu8"", header->common.rpc_vers_minor); + WLog_INFO(TAG, "rpc_vers: %" PRIu8 "", header->common.rpc_vers); + WLog_INFO(TAG, "rpc_vers_minor: %" PRIu8 "", header->common.rpc_vers_minor); if (header->common.ptype > PTYPE_RTS) - WLog_INFO(TAG, "ptype: %s (%"PRIu8")", "PTYPE_UNKNOWN", header->common.ptype); + WLog_INFO(TAG, "ptype: %s (%" PRIu8 ")", "PTYPE_UNKNOWN", header->common.ptype); else - WLog_INFO(TAG, "ptype: %s (%"PRIu8")", PTYPE_STRINGS[header->common.ptype], header->common.ptype); + WLog_INFO(TAG, "ptype: %s (%" PRIu8 ")", PTYPE_STRINGS[header->common.ptype], + header->common.ptype); - WLog_INFO(TAG, "pfc_flags (0x%02"PRIX8") = {", header->common.pfc_flags); + WLog_INFO(TAG, "pfc_flags (0x%02" PRIX8 ") = {", header->common.pfc_flags); if (header->common.pfc_flags & PFC_FIRST_FRAG) - WLog_INFO(TAG, " PFC_FIRST_FRAG"); + WLog_INFO(TAG, " PFC_FIRST_FRAG"); if (header->common.pfc_flags & PFC_LAST_FRAG) - WLog_INFO(TAG, " PFC_LAST_FRAG"); + WLog_INFO(TAG, " PFC_LAST_FRAG"); if (header->common.pfc_flags & PFC_PENDING_CANCEL) - WLog_INFO(TAG, " PFC_PENDING_CANCEL"); + WLog_INFO(TAG, " PFC_PENDING_CANCEL"); if (header->common.pfc_flags & PFC_RESERVED_1) - WLog_INFO(TAG, " PFC_RESERVED_1"); + WLog_INFO(TAG, " PFC_RESERVED_1"); if (header->common.pfc_flags & PFC_CONC_MPX) - WLog_INFO(TAG, " PFC_CONC_MPX"); + WLog_INFO(TAG, " PFC_CONC_MPX"); if (header->common.pfc_flags & PFC_DID_NOT_EXECUTE) - WLog_INFO(TAG, " PFC_DID_NOT_EXECUTE"); + WLog_INFO(TAG, " PFC_DID_NOT_EXECUTE"); if (header->common.pfc_flags & PFC_OBJECT_UUID) - WLog_INFO(TAG, " PFC_OBJECT_UUID"); + WLog_INFO(TAG, " PFC_OBJECT_UUID"); - WLog_INFO(TAG, " }"); - WLog_INFO(TAG, "packed_drep[4]: %02"PRIX8" %02"PRIX8" %02"PRIX8" %02"PRIX8"", + WLog_INFO(TAG, " }"); + WLog_INFO(TAG, "packed_drep[4]: %02" PRIX8 " %02" PRIX8 " %02" PRIX8 " %02" PRIX8 "", header->common.packed_drep[0], header->common.packed_drep[1], header->common.packed_drep[2], header->common.packed_drep[3]); - WLog_INFO(TAG, "frag_length: %"PRIu16"", header->common.frag_length); - WLog_INFO(TAG, "auth_length: %"PRIu16"", header->common.auth_length); - WLog_INFO(TAG, "call_id: %"PRIu32"", header->common.call_id); + WLog_INFO(TAG, "frag_length: %" PRIu16 "", header->common.frag_length); + WLog_INFO(TAG, "auth_length: %" PRIu16 "", header->common.auth_length); + WLog_INFO(TAG, "call_id: %" PRIu32 "", header->common.call_id); if (header->common.ptype == PTYPE_RESPONSE) { - WLog_INFO(TAG, "alloc_hint: %"PRIu32"", header->response.alloc_hint); - WLog_INFO(TAG, "p_cont_id: %"PRIu16"", header->response.p_cont_id); - WLog_INFO(TAG, "cancel_count: %"PRIu8"", header->response.cancel_count); - WLog_INFO(TAG, "reserved: %"PRIu8"", header->response.reserved); + WLog_INFO(TAG, "alloc_hint: %" PRIu32 "", header->response.alloc_hint); + WLog_INFO(TAG, "p_cont_id: %" PRIu16 "", header->response.p_cont_id); + WLog_INFO(TAG, "cancel_count: %" PRIu8 "", header->response.cancel_count); + WLog_INFO(TAG, "reserved: %" PRIu8 "", header->response.reserved); } } @@ -262,7 +249,7 @@ BOOL rpc_get_stub_data_info(rdpRpc* rpc, BYTE* buffer, UINT32* offset, UINT32* l UINT32 sec_trailer_offset; rpc_sec_trailer* sec_trailer; *offset = RPC_COMMON_FIELDS_LENGTH; - header = ((rpcconn_hdr_t*) buffer); + header = ((rpcconn_hdr_t*)buffer); switch (header->common.ptype) { @@ -283,7 +270,7 @@ BOOL rpc_get_stub_data_info(rdpRpc* rpc, BYTE* buffer, UINT32* offset, UINT32* l break; default: - WLog_ERR(TAG, "Unknown PTYPE: 0x%02"PRIX8"", header->common.ptype); + WLog_ERR(TAG, "Unknown PTYPE: 0x%02" PRIX8 "", header->common.ptype); return FALSE; } @@ -301,7 +288,7 @@ BOOL rpc_get_stub_data_info(rdpRpc* rpc, BYTE* buffer, UINT32* offset, UINT32* l frag_length = header->common.frag_length; auth_length = header->common.auth_length; sec_trailer_offset = frag_length - auth_length - 8; - sec_trailer = (rpc_sec_trailer*) &buffer[sec_trailer_offset]; + sec_trailer = (rpc_sec_trailer*)&buffer[sec_trailer_offset]; auth_pad_length = sec_trailer->auth_pad_length; #if 0 WLog_DBG(TAG, @@ -319,8 +306,8 @@ BOOL rpc_get_stub_data_info(rdpRpc* rpc, BYTE* buffer, UINT32* offset, UINT32* l if ((frag_length - (sec_trailer_offset + 8)) != auth_length) { - WLog_ERR(TAG, "invalid auth_length: actual: %"PRIu32", expected: %"PRIu32"", auth_length, - (frag_length - (sec_trailer_offset + 8))); + WLog_ERR(TAG, "invalid auth_length: actual: %" PRIu32 ", expected: %" PRIu32 "", + auth_length, (frag_length - (sec_trailer_offset + 8))); } *length = frag_length - auth_length - 24 - 8 - auth_pad_length; @@ -413,7 +400,7 @@ static int rpc_channel_rpch_init(RpcClient* client, RpcChannel* channel, const c settings = client->context->settings; channel->ntlm = ntlm_new(); - rts_generate_cookie((BYTE*) &channel->Cookie); + rts_generate_cookie((BYTE*)&channel->Cookie); channel->client = client; if (!channel->ntlm) @@ -430,11 +417,11 @@ static int rpc_channel_rpch_init(RpcClient* client, RpcChannel* channel, const c !http_context_set_uri(http, "/rpc/rpcproxy.dll?localhost:3388") || !http_context_set_accept(http, "application/rpc") || !http_context_set_cache_control(http, "no-cache") || - !http_context_set_connection(http, "Keep-Alive") || !http_context_set_user_agent(http, "MSRPC") || + !http_context_set_connection(http, "Keep-Alive") || + !http_context_set_user_agent(http, "MSRPC") || !http_context_set_host(http, settings->GatewayHostname) || - !http_context_set_pragma(http, - "ResourceTypeUuid=44e265dd-7daf-42cd-8560-3cdb6e7a2729, " - "SessionId=fbd9c34f-397d-471d-a109-1b08cc554624")) + !http_context_set_pragma(http, "ResourceTypeUuid=44e265dd-7daf-42cd-8560-3cdb6e7a2729, " + "SessionId=fbd9c34f-397d-471d-a109-1b08cc554624")) return -1; return 1; @@ -457,7 +444,7 @@ static int rpc_in_channel_init(rdpRpc* rpc, RpcInChannel* inChannel) static RpcInChannel* rpc_in_channel_new(rdpRpc* rpc) { RpcInChannel* inChannel = NULL; - inChannel = (RpcInChannel*) calloc(1, sizeof(RpcInChannel)); + inChannel = (RpcInChannel*)calloc(1, sizeof(RpcInChannel)); if (inChannel) { @@ -551,7 +538,7 @@ static int rpc_out_channel_init(rdpRpc* rpc, RpcOutChannel* outChannel) RpcOutChannel* rpc_out_channel_new(rdpRpc* rpc) { RpcOutChannel* outChannel = NULL; - outChannel = (RpcOutChannel*) calloc(1, sizeof(RpcOutChannel)); + outChannel = (RpcOutChannel*)calloc(1, sizeof(RpcOutChannel)); if (outChannel) { @@ -561,8 +548,8 @@ RpcOutChannel* rpc_out_channel_new(rdpRpc* rpc) return outChannel; } -BOOL rpc_virtual_connection_transition_to_state(rdpRpc* rpc, - RpcVirtualConnection* connection, VIRTUAL_CONNECTION_STATE state) +BOOL rpc_virtual_connection_transition_to_state(rdpRpc* rpc, RpcVirtualConnection* connection, + VIRTUAL_CONNECTION_STATE state) { const char* str = "VIRTUAL_CONNECTION_STATE_UNKNOWN"; @@ -604,13 +591,13 @@ BOOL rpc_virtual_connection_transition_to_state(rdpRpc* rpc, static RpcVirtualConnection* rpc_virtual_connection_new(rdpRpc* rpc) { RpcVirtualConnection* connection; - connection = (RpcVirtualConnection*) calloc(1, sizeof(RpcVirtualConnection)); + connection = (RpcVirtualConnection*)calloc(1, sizeof(RpcVirtualConnection)); if (!connection) return NULL; - rts_generate_cookie((BYTE*) & (connection->Cookie)); - rts_generate_cookie((BYTE*) & (connection->AssociationGroupId)); + rts_generate_cookie((BYTE*)&(connection->Cookie)); + rts_generate_cookie((BYTE*)&(connection->AssociationGroupId)); connection->State = VIRTUAL_CONNECTION_STATE_INITIAL; connection->DefaultInChannel = rpc_in_channel_new(rpc); @@ -696,8 +683,8 @@ static BOOL rpc_channel_tls_connect(RpcChannel* channel, int timeout) if (channel->client->isProxy) { - if (!proxy_connect(settings, bufferedBio, proxyUsername, proxyPassword, settings->GatewayHostname, - settings->GatewayPort)) + if (!proxy_connect(settings, bufferedBio, proxyUsername, proxyPassword, + settings->GatewayHostname, settings->GatewayPort)) { BIO_free_all(bufferedBio); return FALSE; @@ -814,7 +801,7 @@ int rpc_out_channel_replacement_connect(RpcOutChannel* outChannel, int timeout) rpc_out_channel_transition_to_state(outChannel, CLIENT_OUT_CHANNEL_STATE_CONNECTED); - if (!rpc_ncacn_http_ntlm_init(context, (RpcChannel*) outChannel)) + if (!rpc_ncacn_http_ntlm_init(context, (RpcChannel*)outChannel)) return FALSE; /* Send OUT Channel Request */ @@ -855,7 +842,7 @@ BOOL rpc_connect(rdpRpc* rpc, int timeout) rdpRpc* rpc_new(rdpTransport* transport) { - rdpRpc* rpc = (rdpRpc*) calloc(1, sizeof(rdpRpc)); + rdpRpc* rpc = (rdpRpc*)calloc(1, sizeof(rdpRpc)); if (!rpc) return NULL; diff --git a/libfreerdp/core/gateway/rpc.h b/libfreerdp/core/gateway/rpc.h index e3f671e3c..5c315d90d 100644 --- a/libfreerdp/core/gateway/rpc.h +++ b/libfreerdp/core/gateway/rpc.h @@ -35,16 +35,16 @@ typedef struct rdp_rpc rdpRpc; #pragma pack(push, 1) #define DEFINE_RPC_COMMON_FIELDS() \ - BYTE rpc_vers; \ - BYTE rpc_vers_minor; \ - BYTE ptype; \ - BYTE pfc_flags; \ - BYTE packed_drep[4]; \ - UINT16 frag_length; \ - UINT16 auth_length; \ + BYTE rpc_vers; \ + BYTE rpc_vers_minor; \ + BYTE ptype; \ + BYTE pfc_flags; \ + BYTE packed_drep[4]; \ + UINT16 frag_length; \ + UINT16 auth_length; \ UINT32 call_id -#define RPC_COMMON_FIELDS_LENGTH 16 +#define RPC_COMMON_FIELDS_LENGTH 16 typedef struct { @@ -54,9 +54,9 @@ typedef struct UINT16 NumberOfCommands; } rpcconn_rts_hdr_t; -#define RTS_PDU_HEADER_LENGTH 20 +#define RTS_PDU_HEADER_LENGTH 20 -#define RPC_PDU_FLAG_STUB 0x00000001 +#define RPC_PDU_FLAG_STUB 0x00000001 typedef struct _RPC_PDU { @@ -95,41 +95,41 @@ typedef struct _RPC_PDU * http://pubs.opengroup.org/onlinepubs/9629399/ */ -#define PTYPE_REQUEST 0x00 -#define PTYPE_PING 0x01 -#define PTYPE_RESPONSE 0x02 -#define PTYPE_FAULT 0x03 -#define PTYPE_WORKING 0x04 -#define PTYPE_NOCALL 0x05 -#define PTYPE_REJECT 0x06 -#define PTYPE_ACK 0x07 -#define PTYPE_CL_CANCEL 0x08 -#define PTYPE_FACK 0x09 -#define PTYPE_CANCEL_ACK 0x0A -#define PTYPE_BIND 0x0B -#define PTYPE_BIND_ACK 0x0C -#define PTYPE_BIND_NAK 0x0D -#define PTYPE_ALTER_CONTEXT 0x0E -#define PTYPE_ALTER_CONTEXT_RESP 0x0F -#define PTYPE_RPC_AUTH_3 0x10 -#define PTYPE_SHUTDOWN 0x11 -#define PTYPE_CO_CANCEL 0x12 -#define PTYPE_ORPHANED 0x13 -#define PTYPE_RTS 0x14 +#define PTYPE_REQUEST 0x00 +#define PTYPE_PING 0x01 +#define PTYPE_RESPONSE 0x02 +#define PTYPE_FAULT 0x03 +#define PTYPE_WORKING 0x04 +#define PTYPE_NOCALL 0x05 +#define PTYPE_REJECT 0x06 +#define PTYPE_ACK 0x07 +#define PTYPE_CL_CANCEL 0x08 +#define PTYPE_FACK 0x09 +#define PTYPE_CANCEL_ACK 0x0A +#define PTYPE_BIND 0x0B +#define PTYPE_BIND_ACK 0x0C +#define PTYPE_BIND_NAK 0x0D +#define PTYPE_ALTER_CONTEXT 0x0E +#define PTYPE_ALTER_CONTEXT_RESP 0x0F +#define PTYPE_RPC_AUTH_3 0x10 +#define PTYPE_SHUTDOWN 0x11 +#define PTYPE_CO_CANCEL 0x12 +#define PTYPE_ORPHANED 0x13 +#define PTYPE_RTS 0x14 -#define PFC_FIRST_FRAG 0x01 -#define PFC_LAST_FRAG 0x02 -#define PFC_PENDING_CANCEL 0x04 -#define PFC_SUPPORT_HEADER_SIGN 0x04 -#define PFC_RESERVED_1 0x08 -#define PFC_CONC_MPX 0x10 -#define PFC_DID_NOT_EXECUTE 0x20 -#define PFC_MAYBE 0x40 -#define PFC_OBJECT_UUID 0x80 +#define PFC_FIRST_FRAG 0x01 +#define PFC_LAST_FRAG 0x02 +#define PFC_PENDING_CANCEL 0x04 +#define PFC_SUPPORT_HEADER_SIGN 0x04 +#define PFC_RESERVED_1 0x08 +#define PFC_CONC_MPX 0x10 +#define PFC_DID_NOT_EXECUTE 0x20 +#define PFC_MAYBE 0x40 +#define PFC_OBJECT_UUID 0x80 /* Minimum fragment sizes */ -#define RPC_CO_MUST_RECV_FRAG_SIZE 1432 -#define RPC_CL_MUST_RECV_FRAG_SIZE 1464 +#define RPC_CO_MUST_RECV_FRAG_SIZE 1432 +#define RPC_CL_MUST_RECV_FRAG_SIZE 1464 /** * The PDU maximum header length is enough @@ -137,7 +137,7 @@ typedef struct _RPC_PDU * or all fields up to the stub data in PDUs * that use it (request, response, fault) */ -#define RPC_PDU_HEADER_MAX_LENGTH 32 +#define RPC_PDU_HEADER_MAX_LENGTH 32 #pragma pack(push, 1) @@ -159,14 +159,14 @@ typedef struct BYTE node[6]; } p_uuid_t; -#define ndr_c_int_big_endian 0 -#define ndr_c_int_little_endian 1 -#define ndr_c_float_ieee 0 -#define ndr_c_float_vax 1 -#define ndr_c_float_cray 2 -#define ndr_c_float_ibm 3 -#define ndr_c_char_ascii 0 -#define ndr_c_char_ebcdic 1 +#define ndr_c_int_big_endian 0 +#define ndr_c_int_little_endian 1 +#define ndr_c_float_ieee 0 +#define ndr_c_float_vax 1 +#define ndr_c_float_cray 2 +#define ndr_c_float_ibm 3 +#define ndr_c_char_ascii 0 +#define ndr_c_char_ebcdic 1 typedef struct { @@ -191,17 +191,17 @@ typedef struct typedef struct { p_context_id_t p_cont_id; - BYTE n_transfer_syn; /* number of items */ - BYTE reserved; /* alignment pad, m.b.z. */ - p_syntax_id_t abstract_syntax; /* transfer syntax list */ + BYTE n_transfer_syn; /* number of items */ + BYTE reserved; /* alignment pad, m.b.z. */ + p_syntax_id_t abstract_syntax; /* transfer syntax list */ p_syntax_id_t* transfer_syntaxes; /* size_is(n_transfer_syn) */ } p_cont_elem_t; typedef struct { - BYTE n_context_elem; /* number of items */ - BYTE reserved; /* alignment pad, m.b.z. */ - UINT16 reserved2; /* alignment pad, m.b.z. */ + BYTE n_context_elem; /* number of items */ + BYTE reserved; /* alignment pad, m.b.z. */ + UINT16 reserved2; /* alignment pad, m.b.z. */ p_cont_elem_t* p_cont_elem; /* size_is(n_cont_elem) */ } p_cont_list_t; @@ -231,9 +231,9 @@ typedef struct typedef struct { - BYTE n_results; /* count */ - BYTE reserved; /* alignment pad, m.b.z. */ - UINT16 reserved2; /* alignment pad, m.b.z. */ + BYTE n_results; /* count */ + BYTE reserved; /* alignment pad, m.b.z. */ + UINT16 reserved2; /* alignment pad, m.b.z. */ p_result_t* p_results; /* size_is(n_results) */ } p_result_list_t; @@ -246,8 +246,8 @@ typedef version_t p_rt_version_t; typedef struct { - BYTE n_protocols; /* count */ - p_rt_version_t* p_protocols; /* size_is(n_protocols) */ + BYTE n_protocols; /* count */ + p_rt_version_t* p_protocols; /* size_is(n_protocols) */ } p_rt_versions_supported_t; typedef struct @@ -256,14 +256,14 @@ typedef struct char* port_spec; /* port string spec; size_is(length) */ } port_any_t; -#define REASON_NOT_SPECIFIED 0 -#define TEMPORARY_CONGESTION 1 -#define LOCAL_LIMIT_EXCEEDED 2 -#define CALLED_PADDR_UNKNOWN 3 -#define PROTOCOL_VERSION_NOT_SUPPORTED 4 -#define DEFAULT_CONTEXT_NOT_SUPPORTED 5 -#define USER_DATA_NOT_READABLE 6 -#define NO_PSAP_AVAILABLE 7 +#define REASON_NOT_SPECIFIED 0 +#define TEMPORARY_CONGESTION 1 +#define LOCAL_LIMIT_EXCEEDED 2 +#define CALLED_PADDR_UNKNOWN 3 +#define PROTOCOL_VERSION_NOT_SUPPORTED 4 +#define DEFAULT_CONTEXT_NOT_SUPPORTED 5 +#define USER_DATA_NOT_READABLE 6 +#define NO_PSAP_AVAILABLE 7 typedef UINT16 rpcrt_reason_code_t; @@ -337,7 +337,7 @@ typedef struct /* restore 4-octet alignment */ - p_result_list_t p_result_list; + p_result_list_t p_result_list; auth_verifier_co_t auth_verifier; } rpcconn_alter_context_response_hdr_t; @@ -412,51 +412,51 @@ typedef struct _RPC_FAULT_CODE RPC_FAULT_CODE; #define DEFINE_RPC_FAULT_CODE(_code, cat) { _code, #_code, cat }, -#define nca_s_comm_failure 0x1C010001 -#define nca_s_op_rng_error 0x1C010002 -#define nca_s_unk_if 0x1C010003 -#define nca_s_wrong_boot_time 0x1C010006 -#define nca_s_you_crashed 0x1C010009 -#define nca_s_proto_error 0x1C01000B -#define nca_s_out_args_too_big 0x1C010013 -#define nca_s_server_too_busy 0x1C010014 -#define nca_s_fault_string_too_long 0x1C010015 -#define nca_s_unsupported_type 0x1C010017 -#define nca_s_fault_int_div_by_zero 0x1C000001 -#define nca_s_fault_addr_error 0x1C000002 -#define nca_s_fault_fp_div_zero 0x1C000003 -#define nca_s_fault_fp_underflow 0x1C000004 -#define nca_s_fault_fp_overflow 0x1C000005 -#define nca_s_fault_invalid_tag 0x1C000006 -#define nca_s_fault_invalid_bound 0x1C000007 -#define nca_s_rpc_version_mismatch 0x1C000008 -#define nca_s_unspec_reject 0x1C000009 -#define nca_s_bad_actid 0x1C00000A -#define nca_s_who_are_you_failed 0x1C00000B -#define nca_s_manager_not_entered 0x1C00000C -#define nca_s_fault_cancel 0x1C00000D -#define nca_s_fault_ill_inst 0x1C00000E -#define nca_s_fault_fp_error 0x1C00000F -#define nca_s_fault_int_overflow 0x1C000010 -#define nca_s_fault_unspec 0x1C000012 -#define nca_s_fault_remote_comm_failure 0x1C000013 -#define nca_s_fault_pipe_empty 0x1C000014 -#define nca_s_fault_pipe_closed 0x1C000015 -#define nca_s_fault_pipe_order 0x1C000016 -#define nca_s_fault_pipe_discipline 0x1C000017 -#define nca_s_fault_pipe_comm_error 0x1C000018 -#define nca_s_fault_pipe_memory 0x1C000019 -#define nca_s_fault_context_mismatch 0x1C00001A -#define nca_s_fault_remote_no_memory 0x1C00001B -#define nca_s_invalid_pres_context_id 0x1C00001C -#define nca_s_unsupported_authn_level 0x1C00001D -#define nca_s_invalid_checksum 0x1C00001F -#define nca_s_invalid_crc 0x1C000020 -#define nca_s_fault_user_defined 0x1C000021 -#define nca_s_fault_tx_open_failed 0x1C000022 -#define nca_s_fault_codeset_conv_error 0x1C000023 -#define nca_s_fault_object_not_found 0x1C000024 -#define nca_s_fault_no_client_stub 0x1C000025 +#define nca_s_comm_failure 0x1C010001 +#define nca_s_op_rng_error 0x1C010002 +#define nca_s_unk_if 0x1C010003 +#define nca_s_wrong_boot_time 0x1C010006 +#define nca_s_you_crashed 0x1C010009 +#define nca_s_proto_error 0x1C01000B +#define nca_s_out_args_too_big 0x1C010013 +#define nca_s_server_too_busy 0x1C010014 +#define nca_s_fault_string_too_long 0x1C010015 +#define nca_s_unsupported_type 0x1C010017 +#define nca_s_fault_int_div_by_zero 0x1C000001 +#define nca_s_fault_addr_error 0x1C000002 +#define nca_s_fault_fp_div_zero 0x1C000003 +#define nca_s_fault_fp_underflow 0x1C000004 +#define nca_s_fault_fp_overflow 0x1C000005 +#define nca_s_fault_invalid_tag 0x1C000006 +#define nca_s_fault_invalid_bound 0x1C000007 +#define nca_s_rpc_version_mismatch 0x1C000008 +#define nca_s_unspec_reject 0x1C000009 +#define nca_s_bad_actid 0x1C00000A +#define nca_s_who_are_you_failed 0x1C00000B +#define nca_s_manager_not_entered 0x1C00000C +#define nca_s_fault_cancel 0x1C00000D +#define nca_s_fault_ill_inst 0x1C00000E +#define nca_s_fault_fp_error 0x1C00000F +#define nca_s_fault_int_overflow 0x1C000010 +#define nca_s_fault_unspec 0x1C000012 +#define nca_s_fault_remote_comm_failure 0x1C000013 +#define nca_s_fault_pipe_empty 0x1C000014 +#define nca_s_fault_pipe_closed 0x1C000015 +#define nca_s_fault_pipe_order 0x1C000016 +#define nca_s_fault_pipe_discipline 0x1C000017 +#define nca_s_fault_pipe_comm_error 0x1C000018 +#define nca_s_fault_pipe_memory 0x1C000019 +#define nca_s_fault_context_mismatch 0x1C00001A +#define nca_s_fault_remote_no_memory 0x1C00001B +#define nca_s_invalid_pres_context_id 0x1C00001C +#define nca_s_unsupported_authn_level 0x1C00001D +#define nca_s_invalid_checksum 0x1C00001F +#define nca_s_invalid_crc 0x1C000020 +#define nca_s_fault_user_defined 0x1C000021 +#define nca_s_fault_tx_open_failed 0x1C000022 +#define nca_s_fault_codeset_conv_error 0x1C000023 +#define nca_s_fault_object_not_found 0x1C000024 +#define nca_s_fault_no_client_stub 0x1C000025 typedef struct { @@ -525,8 +525,7 @@ typedef struct DEFINE_RPC_COMMON_FIELDS(); } rpcconn_shutdown_hdr_t; -typedef union -{ +typedef union { rpcconn_common_hdr_t common; rpcconn_alter_context_hdr_t alter_context; rpcconn_alter_context_response_hdr_t alter_context_response; @@ -716,10 +715,12 @@ typedef struct rpc_virtual_connection RpcVirtualConnection; /* Virtual Connection Cookie Table */ -#define RPC_UUID_FORMAT_STRING "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x" -#define RPC_UUID_FORMAT_ARGUMENTS(_rpc_uuid) \ - _rpc_uuid[0], _rpc_uuid[1], _rpc_uuid[2], _rpc_uuid[3], _rpc_uuid[4], _rpc_uuid[5], _rpc_uuid[6], _rpc_uuid[7], \ - _rpc_uuid[8], _rpc_uuid[9], _rpc_uuid[10], _rpc_uuid[11], _rpc_uuid[12], _rpc_uuid[13], _rpc_uuid[14], _rpc_uuid[15] +#define RPC_UUID_FORMAT_STRING \ + "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x" +#define RPC_UUID_FORMAT_ARGUMENTS(_rpc_uuid) \ + _rpc_uuid[0], _rpc_uuid[1], _rpc_uuid[2], _rpc_uuid[3], _rpc_uuid[4], _rpc_uuid[5], \ + _rpc_uuid[6], _rpc_uuid[7], _rpc_uuid[8], _rpc_uuid[9], _rpc_uuid[10], _rpc_uuid[11], \ + _rpc_uuid[12], _rpc_uuid[13], _rpc_uuid[14], _rpc_uuid[15] struct rpc_virtual_connection_cookie_entry { @@ -727,8 +728,7 @@ struct rpc_virtual_connection_cookie_entry UINT32 ReferenceCount; RpcVirtualConnection* Reference; }; -typedef struct rpc_virtual_connection_cookie_entry - RpcVirtualConnectionCookieEntry; +typedef struct rpc_virtual_connection_cookie_entry RpcVirtualConnectionCookieEntry; struct rdp_rpc { @@ -773,28 +773,26 @@ FREERDP_LOCAL void rpc_pdu_header_init(rdpRpc* rpc, rpcconn_hdr_t* header); FREERDP_LOCAL UINT32 rpc_offset_align(UINT32* offset, UINT32 alignment); FREERDP_LOCAL UINT32 rpc_offset_pad(UINT32* offset, UINT32 pad); -FREERDP_LOCAL BOOL rpc_get_stub_data_info(rdpRpc* rpc, BYTE* header, - UINT32* offset, UINT32* length); +FREERDP_LOCAL BOOL rpc_get_stub_data_info(rdpRpc* rpc, BYTE* header, UINT32* offset, + UINT32* length); -FREERDP_LOCAL SSIZE_T rpc_channel_write(RpcChannel* channel, - const BYTE* data, size_t length); +FREERDP_LOCAL SSIZE_T rpc_channel_write(RpcChannel* channel, const BYTE* data, size_t length); -FREERDP_LOCAL SSIZE_T rpc_channel_read(RpcChannel* channel, wStream* s, - size_t length); +FREERDP_LOCAL SSIZE_T rpc_channel_read(RpcChannel* channel, wStream* s, size_t length); FREERDP_LOCAL void rpc_channel_free(RpcChannel* channel); FREERDP_LOCAL RpcOutChannel* rpc_out_channel_new(rdpRpc* rpc); -FREERDP_LOCAL int rpc_out_channel_replacement_connect(RpcOutChannel* outChannel, - int timeout); +FREERDP_LOCAL int rpc_out_channel_replacement_connect(RpcOutChannel* outChannel, int timeout); FREERDP_LOCAL BOOL rpc_in_channel_transition_to_state(RpcInChannel* inChannel, - CLIENT_IN_CHANNEL_STATE state); + CLIENT_IN_CHANNEL_STATE state); FREERDP_LOCAL BOOL rpc_out_channel_transition_to_state(RpcOutChannel* outChannel, - CLIENT_OUT_CHANNEL_STATE state); + CLIENT_OUT_CHANNEL_STATE state); FREERDP_LOCAL BOOL rpc_virtual_connection_transition_to_state(rdpRpc* rpc, - RpcVirtualConnection* connection, VIRTUAL_CONNECTION_STATE state); + RpcVirtualConnection* connection, + VIRTUAL_CONNECTION_STATE state); FREERDP_LOCAL BOOL rpc_connect(rdpRpc* rpc, int timeout); diff --git a/libfreerdp/core/gateway/rpc_bind.c b/libfreerdp/core/gateway/rpc_bind.c index 39dba7ffe..fa267ff3e 100644 --- a/libfreerdp/core/gateway/rpc_bind.c +++ b/libfreerdp/core/gateway/rpc_bind.c @@ -38,33 +38,30 @@ /* Syntax UUIDs */ -const p_uuid_t TSGU_UUID = -{ - 0x44E265DD, /* time_low */ - 0x7DAF, /* time_mid */ - 0x42CD, /* time_hi_and_version */ - 0x85, /* clock_seq_hi_and_reserved */ - 0x60, /* clock_seq_low */ +const p_uuid_t TSGU_UUID = { + 0x44E265DD, /* time_low */ + 0x7DAF, /* time_mid */ + 0x42CD, /* time_hi_and_version */ + 0x85, /* clock_seq_hi_and_reserved */ + 0x60, /* clock_seq_low */ { 0x3C, 0xDB, 0x6E, 0x7A, 0x27, 0x29 } /* node[6] */ }; -const p_uuid_t NDR_UUID = -{ - 0x8A885D04, /* time_low */ - 0x1CEB, /* time_mid */ - 0x11C9, /* time_hi_and_version */ - 0x9F, /* clock_seq_hi_and_reserved */ - 0xE8, /* clock_seq_low */ +const p_uuid_t NDR_UUID = { + 0x8A885D04, /* time_low */ + 0x1CEB, /* time_mid */ + 0x11C9, /* time_hi_and_version */ + 0x9F, /* clock_seq_hi_and_reserved */ + 0xE8, /* clock_seq_low */ { 0x08, 0x00, 0x2B, 0x10, 0x48, 0x60 } /* node[6] */ }; -const p_uuid_t BTFN_UUID = -{ - 0x6CB71C2C, /* time_low */ - 0x9812, /* time_mid */ - 0x4540, /* time_hi_and_version */ - 0x03, /* clock_seq_hi_and_reserved */ - 0x00, /* clock_seq_low */ +const p_uuid_t BTFN_UUID = { + 0x6CB71C2C, /* time_low */ + 0x9812, /* time_mid */ + 0x4540, /* time_hi_and_version */ + 0x03, /* clock_seq_hi_and_reserved */ + 0x00, /* clock_seq_low */ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } /* node[6] */ }; @@ -117,7 +114,7 @@ int rpc_send_bind_pdu(rdpRpc* rpc) rpcconn_bind_hdr_t* bind_pdu = NULL; BOOL promptPassword = FALSE; rdpSettings* settings = rpc->settings; - freerdp* instance = (freerdp*) settings->instance; + freerdp* instance = (freerdp*)settings->instance; RpcVirtualConnection* connection = rpc->VirtualConnection; RpcInChannel* inChannel = connection->DefaultInChannel; const SecBuffer* sbuffer = NULL; @@ -128,8 +125,8 @@ int rpc_send_bind_pdu(rdpRpc* rpc) if (!rpc->ntlm) goto fail; - if ((!settings->GatewayPassword) || (!settings->GatewayUsername) - || (!strlen(settings->GatewayPassword)) || (!strlen(settings->GatewayUsername))) + if ((!settings->GatewayPassword) || (!settings->GatewayUsername) || + (!strlen(settings->GatewayPassword)) || (!strlen(settings->GatewayUsername))) { promptPassword = TRUE; } @@ -138,17 +135,20 @@ int rpc_send_bind_pdu(rdpRpc* rpc) { if (!instance->GatewayAuthenticate) { - freerdp_set_last_error(instance->context, FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS); + freerdp_set_last_error(instance->context, + FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS); return 0; } else { - BOOL proceed = instance->GatewayAuthenticate(instance, - &settings->GatewayUsername, &settings->GatewayPassword, &settings->GatewayDomain); + BOOL proceed = + instance->GatewayAuthenticate(instance, &settings->GatewayUsername, + &settings->GatewayPassword, &settings->GatewayDomain); if (!proceed) { - freerdp_set_last_error(instance->context, FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS); + freerdp_set_last_error(instance->context, + FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS); return 0; } @@ -177,7 +177,7 @@ int rpc_send_bind_pdu(rdpRpc* rpc) if (!continueNeeded) goto fail; - bind_pdu = (rpcconn_bind_hdr_t*) calloc(1, sizeof(rpcconn_bind_hdr_t)); + bind_pdu = (rpcconn_bind_hdr_t*)calloc(1, sizeof(rpcconn_bind_hdr_t)); if (!bind_pdu) goto fail; @@ -187,8 +187,8 @@ int rpc_send_bind_pdu(rdpRpc* rpc) if (!sbuffer) goto fail; - rpc_pdu_header_init(rpc, (rpcconn_hdr_t*) bind_pdu); - bind_pdu->auth_length = (UINT16) sbuffer->cbBuffer; + rpc_pdu_header_init(rpc, (rpcconn_hdr_t*)bind_pdu); + bind_pdu->auth_length = (UINT16)sbuffer->cbBuffer; bind_pdu->auth_verifier.auth_value = sbuffer->pvBuffer; bind_pdu->ptype = PTYPE_BIND; bind_pdu->pfc_flags = PFC_FIRST_FRAG | PFC_LAST_FRAG | PFC_SUPPORT_HEADER_SIGN | PFC_CONC_MPX; @@ -199,8 +199,8 @@ int rpc_send_bind_pdu(rdpRpc* rpc) bind_pdu->p_context_elem.n_context_elem = 2; bind_pdu->p_context_elem.reserved = 0; bind_pdu->p_context_elem.reserved2 = 0; - bind_pdu->p_context_elem.p_cont_elem = calloc(bind_pdu->p_context_elem.n_context_elem, - sizeof(p_cont_elem_t)); + bind_pdu->p_context_elem.p_cont_elem = + calloc(bind_pdu->p_context_elem.n_context_elem, sizeof(p_cont_elem_t)); if (!bind_pdu->p_context_elem.p_cont_elem) goto fail; @@ -239,7 +239,7 @@ int rpc_send_bind_pdu(rdpRpc* rpc) bind_pdu->auth_verifier.auth_context_id = 0x00000000; offset += (8 + bind_pdu->auth_length); bind_pdu->frag_length = offset; - buffer = (BYTE*) malloc(bind_pdu->frag_length); + buffer = (BYTE*)malloc(bind_pdu->frag_length); if (!buffer) goto fail; @@ -289,16 +289,18 @@ fail: /** * Maximum Transmit/Receive Fragment Size Negotiation * - * The client determines, and then sends in the bind PDU, its desired maximum size for transmitting fragments, - * and its desired maximum receive fragment size. Similarly, the server determines its desired maximum sizes - * for transmitting and receiving fragments. Transmit and receive sizes may be different to help preserve buffering. - * When the server receives the client’s values, it sets its operational transmit size to the minimum of the client’s - * receive size (from the bind PDU) and its own desired transmit size. Then it sets its actual receive size to the - * minimum of the client’s transmit size (from the bind) and its own desired receive size. The server then returns its - * operational values in the bind_ack PDU. The client then sets its operational values from the received bind_ack PDU. - * The received transmit size becomes the client’s receive size, and the received receive size becomes the client’s - * transmit size. Either party may use receive buffers larger than negotiated — although this will not provide any - * advantage — but may not transmit larger fragments than negotiated. + * The client determines, and then sends in the bind PDU, its desired maximum size for transmitting + * fragments, and its desired maximum receive fragment size. Similarly, the server determines its + * desired maximum sizes for transmitting and receiving fragments. Transmit and receive sizes may be + * different to help preserve buffering. When the server receives the client’s values, it sets its + * operational transmit size to the minimum of the client’s receive size (from the bind PDU) and its + * own desired transmit size. Then it sets its actual receive size to the minimum of the client’s + * transmit size (from the bind) and its own desired receive size. The server then returns its + * operational values in the bind_ack PDU. The client then sets its operational values from the + * received bind_ack PDU. The received transmit size becomes the client’s receive size, and the + * received receive size becomes the client’s transmit size. Either party may use receive buffers + * larger than negotiated — although this will not provide any advantage — but may not transmit + * larger fragments than negotiated. */ /** @@ -306,7 +308,8 @@ fail: * SECURE_BIND_ACK: RPC bind_ack PDU with sec_trailer and auth_token. The PFC_SUPPORT_HEADER_SIGN * flag in the PDU header is also set in this example. Auth_token is generated by the server in the * previous step. Upon receiving that PDU, the client calls the implementation equivalent of the - * abstract GSS_Init_sec_context call, which returns an auth_token and continue status in this example. + * abstract GSS_Init_sec_context call, which returns an auth_token and continue status in this + * example. */ int rpc_recv_bind_ack_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length) @@ -314,7 +317,7 @@ int rpc_recv_bind_ack_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length) BOOL continueNeeded = FALSE; BYTE* auth_data; rpcconn_hdr_t* header; - header = (rpcconn_hdr_t*) buffer; + header = (rpcconn_hdr_t*)buffer; WLog_DBG(TAG, "Receiving BindAck PDU"); if (!rpc || !rpc->ntlm) @@ -333,7 +336,7 @@ int rpc_recv_bind_ack_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length) if (continueNeeded) return -1; - return (int) length; + return (int)length; } /** @@ -355,7 +358,7 @@ int rpc_send_rpc_auth_3_pdu(rdpRpc* rpc) RpcVirtualConnection* connection = rpc->VirtualConnection; RpcInChannel* inChannel = connection->DefaultInChannel; WLog_DBG(TAG, "Sending RpcAuth3 PDU"); - auth_3_pdu = (rpcconn_rpc_auth_3_hdr_t*) calloc(1, sizeof(rpcconn_rpc_auth_3_hdr_t)); + auth_3_pdu = (rpcconn_rpc_auth_3_hdr_t*)calloc(1, sizeof(rpcconn_rpc_auth_3_hdr_t)); if (!auth_3_pdu) return -1; @@ -368,8 +371,8 @@ int rpc_send_rpc_auth_3_pdu(rdpRpc* rpc) return -1; } - rpc_pdu_header_init(rpc, (rpcconn_hdr_t*) auth_3_pdu); - auth_3_pdu->auth_length = (UINT16) sbuffer->cbBuffer; + rpc_pdu_header_init(rpc, (rpcconn_hdr_t*)auth_3_pdu); + auth_3_pdu->auth_length = (UINT16)sbuffer->cbBuffer; auth_3_pdu->auth_verifier.auth_value = sbuffer->pvBuffer; auth_3_pdu->ptype = PTYPE_RPC_AUTH_3; auth_3_pdu->pfc_flags = PFC_FIRST_FRAG | PFC_LAST_FRAG | PFC_CONC_MPX; @@ -384,7 +387,7 @@ int rpc_send_rpc_auth_3_pdu(rdpRpc* rpc) auth_3_pdu->auth_verifier.auth_context_id = 0x00000000; offset += (8 + auth_3_pdu->auth_length); auth_3_pdu->frag_length = offset; - buffer = (BYTE*) malloc(auth_3_pdu->frag_length); + buffer = (BYTE*)malloc(auth_3_pdu->frag_length); if (!buffer) { diff --git a/libfreerdp/core/gateway/rpc_bind.h b/libfreerdp/core/gateway/rpc_bind.h index 5b37ff512..759555f07 100644 --- a/libfreerdp/core/gateway/rpc_bind.h +++ b/libfreerdp/core/gateway/rpc_bind.h @@ -26,17 +26,16 @@ #include FREERDP_LOCAL extern const p_uuid_t TSGU_UUID; -#define TSGU_SYNTAX_IF_VERSION 0x00030001 +#define TSGU_SYNTAX_IF_VERSION 0x00030001 FREERDP_LOCAL extern const p_uuid_t NDR_UUID; -#define NDR_SYNTAX_IF_VERSION 0x00000002 +#define NDR_SYNTAX_IF_VERSION 0x00000002 FREERDP_LOCAL extern const p_uuid_t BTFN_UUID; -#define BTFN_SYNTAX_IF_VERSION 0x00000001 +#define BTFN_SYNTAX_IF_VERSION 0x00000001 FREERDP_LOCAL int rpc_send_bind_pdu(rdpRpc* rpc); -FREERDP_LOCAL int rpc_recv_bind_ack_pdu(rdpRpc* rpc, BYTE* buffer, - UINT32 length); +FREERDP_LOCAL int rpc_recv_bind_ack_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length); FREERDP_LOCAL int rpc_send_rpc_auth_3_pdu(rdpRpc* rpc); #endif /* FREERDP_LIB_CORE_GATEWAY_RPC_BIND_H */ diff --git a/libfreerdp/core/gateway/rpc_client.c b/libfreerdp/core/gateway/rpc_client.c index ad4bc4f5a..75f31d4da 100644 --- a/libfreerdp/core/gateway/rpc_client.c +++ b/libfreerdp/core/gateway/rpc_client.c @@ -51,7 +51,7 @@ static void rpc_pdu_reset(RPC_PDU* pdu) static RPC_PDU* rpc_pdu_new(void) { RPC_PDU* pdu; - pdu = (RPC_PDU*) malloc(sizeof(RPC_PDU)); + pdu = (RPC_PDU*)malloc(sizeof(RPC_PDU)); if (!pdu) return NULL; @@ -87,7 +87,7 @@ static int rpc_client_receive_pipe_write(RpcClient* client, const BYTE* buffer, EnterCriticalSection(&(client->PipeLock)); if (ringbuffer_write(&(client->ReceivePipe), buffer, length)) - status += (int) length; + status += (int)length; if (ringbuffer_used(&(client->ReceivePipe)) > 0) SetEvent(client->PipeEvent); @@ -187,7 +187,7 @@ static int rpc_client_recv_pdu(rdpRpc* rpc, RPC_PDU* pdu) break; case VIRTUAL_CONNECTION_STATE_WAIT_A3W: - rts = (rpcconn_rts_hdr_t*) Stream_Buffer(pdu->s); + rts = (rpcconn_rts_hdr_t*)Stream_Buffer(pdu->s); if (!rts_match_pdu_signature(&RTS_PDU_CONN_A3_SIGNATURE, rts)) { @@ -203,13 +203,13 @@ static int rpc_client_recv_pdu(rdpRpc* rpc, RPC_PDU* pdu) return -1; } - rpc_virtual_connection_transition_to_state(rpc, - rpc->VirtualConnection, VIRTUAL_CONNECTION_STATE_WAIT_C2); + rpc_virtual_connection_transition_to_state(rpc, rpc->VirtualConnection, + VIRTUAL_CONNECTION_STATE_WAIT_C2); status = 1; break; case VIRTUAL_CONNECTION_STATE_WAIT_C2: - rts = (rpcconn_rts_hdr_t*) Stream_Buffer(pdu->s); + rts = (rpcconn_rts_hdr_t*)Stream_Buffer(pdu->s); if (!rts_match_pdu_signature(&RTS_PDU_CONN_C2_SIGNATURE, rts)) { @@ -225,8 +225,8 @@ static int rpc_client_recv_pdu(rdpRpc* rpc, RPC_PDU* pdu) return -1; } - rpc_virtual_connection_transition_to_state(rpc, - rpc->VirtualConnection, VIRTUAL_CONNECTION_STATE_OPENED); + rpc_virtual_connection_transition_to_state(rpc, rpc->VirtualConnection, + VIRTUAL_CONNECTION_STATE_OPENED); rpc_client_transition_to_state(rpc, RPC_CLIENT_STATE_ESTABLISHED); if (rpc_send_bind_pdu(rpc) < 0) @@ -260,7 +260,9 @@ static int rpc_client_recv_pdu(rdpRpc* rpc, RPC_PDU* pdu) } else { - WLog_ERR(TAG, "RPC_CLIENT_STATE_WAIT_SECURE_BIND_ACK unexpected pdu type: 0x%08"PRIX32"", + WLog_ERR(TAG, + "RPC_CLIENT_STATE_WAIT_SECURE_BIND_ACK unexpected pdu type: 0x%08" PRIX32 + "", pdu->Type); return -1; } @@ -306,15 +308,17 @@ static int rpc_client_recv_fragment(rdpRpc* rpc, wStream* fragment) RpcClientCall* call; rpcconn_hdr_t* header; pdu = rpc->client->pdu; - buffer = (BYTE*) Stream_Buffer(fragment); - header = (rpcconn_hdr_t*) Stream_Buffer(fragment); + buffer = (BYTE*)Stream_Buffer(fragment); + header = (rpcconn_hdr_t*)Stream_Buffer(fragment); if (header->common.ptype == PTYPE_RESPONSE) { rpc->VirtualConnection->DefaultOutChannel->BytesReceived += header->common.frag_length; - rpc->VirtualConnection->DefaultOutChannel->ReceiverAvailableWindow -= header->common.frag_length; + rpc->VirtualConnection->DefaultOutChannel->ReceiverAvailableWindow -= + header->common.frag_length; - if (rpc->VirtualConnection->DefaultOutChannel->ReceiverAvailableWindow < (rpc->ReceiveWindow / 2)) + if (rpc->VirtualConnection->DefaultOutChannel->ReceiverAvailableWindow < + (rpc->ReceiveWindow / 2)) { if (rts_send_flow_control_ack_pdu(rpc) < 0) return -1; @@ -328,11 +332,12 @@ static int rpc_client_recv_fragment(rdpRpc* rpc, wStream* fragment) if (StubLength == 4) { - if ((header->common.call_id == rpc->PipeCallId) && (header->common.pfc_flags & PFC_LAST_FRAG)) + if ((header->common.call_id == rpc->PipeCallId) && + (header->common.pfc_flags & PFC_LAST_FRAG)) { /* End of TsProxySetupReceivePipe */ TerminateEventArgs e; - rpc->result = *((UINT32*) &buffer[StubOffset]); + rpc->result = *((UINT32*)&buffer[StubOffset]); freerdp_abort_connect(rpc->context->instance); tsg_set_state(rpc->transport->tsg, TSG_STATE_TUNNEL_CLOSE_PENDING); EventArgsInit(&e, "freerdp"); @@ -353,7 +358,9 @@ static int rpc_client_recv_fragment(rdpRpc* rpc, wStream* fragment) if (rpc->StubCallId != header->common.call_id) { - WLog_ERR(TAG, "invalid call_id: actual: %"PRIu32", expected: %"PRIu32", frag_count: %"PRIu32"", + WLog_ERR(TAG, + "invalid call_id: actual: %" PRIu32 ", expected: %" PRIu32 + ", frag_count: %" PRIu32 "", rpc->StubCallId, header->common.call_id, rpc->StubFragCount); } @@ -384,7 +391,7 @@ static int rpc_client_recv_fragment(rdpRpc* rpc, wStream* fragment) } else { - rpc_client_receive_pipe_write(rpc->client, &buffer[StubOffset], (size_t) StubLength); + rpc_client_receive_pipe_write(rpc->client, &buffer[StubOffset], (size_t)StubLength); rpc->StubFragCount++; if (header->response.alloc_hint == StubLength) @@ -448,7 +455,7 @@ static int rpc_client_recv_fragment(rdpRpc* rpc, wStream* fragment) } else { - WLog_ERR(TAG, "unexpected RPC PDU type 0x%02"PRIX8"", header->common.ptype); + WLog_ERR(TAG, "unexpected RPC PDU type 0x%02" PRIX8 "", header->common.ptype); return -1; } @@ -498,8 +505,7 @@ static int rpc_client_default_out_channel_recv(rdpRpc* rpc) } rpc_ncacn_http_ntlm_uninit(&outChannel->common); - rpc_out_channel_transition_to_state(outChannel, - CLIENT_OUT_CHANNEL_STATE_NEGOTIATED); + rpc_out_channel_transition_to_state(outChannel, CLIENT_OUT_CHANNEL_STATE_NEGOTIATED); /* Send CONN/A1 PDU over OUT channel */ @@ -510,13 +516,12 @@ static int rpc_client_default_out_channel_recv(rdpRpc* rpc) return -1; } - rpc_out_channel_transition_to_state(outChannel, - CLIENT_OUT_CHANNEL_STATE_OPENED); + rpc_out_channel_transition_to_state(outChannel, CLIENT_OUT_CHANNEL_STATE_OPENED); if (inChannel->State == CLIENT_IN_CHANNEL_STATE_OPENED) { - rpc_virtual_connection_transition_to_state(rpc, - connection, VIRTUAL_CONNECTION_STATE_OUT_CHANNEL_WAIT); + rpc_virtual_connection_transition_to_state( + rpc, connection, VIRTUAL_CONNECTION_STATE_OUT_CHANNEL_WAIT); } status = 1; @@ -539,7 +544,7 @@ static int rpc_client_default_out_channel_recv(rdpRpc* rpc) if (statusCode != HTTP_STATUS_OK) { - WLog_ERR(TAG, "error! Status Code: %"PRIu32"", statusCode); + WLog_ERR(TAG, "error! Status Code: %" PRIu32 "", statusCode); http_response_print(response); if (statusCode == HTTP_STATUS_DENIED) @@ -553,8 +558,8 @@ static int rpc_client_default_out_channel_recv(rdpRpc* rpc) } http_response_free(response); - rpc_virtual_connection_transition_to_state(rpc, - rpc->VirtualConnection, VIRTUAL_CONNECTION_STATE_WAIT_A3W); + rpc_virtual_connection_transition_to_state(rpc, rpc->VirtualConnection, + VIRTUAL_CONNECTION_STATE_WAIT_A3W); status = 1; } else @@ -581,9 +586,11 @@ static int rpc_client_default_out_channel_recv(rdpRpc* rpc) if (header->frag_length > rpc->max_recv_frag) { - WLog_ERR(TAG, "rpc_client_recv: invalid fragment size: %"PRIu16" (max: %"PRIu16")", + WLog_ERR(TAG, + "rpc_client_recv: invalid fragment size: %" PRIu16 " (max: %" PRIu16 ")", header->frag_length, rpc->max_recv_frag); - winpr_HexDump(TAG, WLOG_ERROR, Stream_Buffer(fragment), Stream_GetPosition(fragment)); + winpr_HexDump(TAG, WLOG_ERROR, Stream_Buffer(fragment), + Stream_GetPosition(fragment)); return -1; } @@ -612,14 +619,16 @@ static int rpc_client_default_out_channel_recv(rdpRpc* rpc) return status; /* channel recycling may update channel pointers */ - if (outChannel->State == CLIENT_OUT_CHANNEL_STATE_RECYCLED && connection->NonDefaultOutChannel) + if (outChannel->State == CLIENT_OUT_CHANNEL_STATE_RECYCLED && + connection->NonDefaultOutChannel) { rpc_channel_free(&connection->DefaultOutChannel->common); connection->DefaultOutChannel = connection->NonDefaultOutChannel; connection->NonDefaultOutChannel = NULL; - rpc_out_channel_transition_to_state(connection->DefaultOutChannel, CLIENT_OUT_CHANNEL_STATE_OPENED); - rpc_virtual_connection_transition_to_state(rpc, connection, - VIRTUAL_CONNECTION_STATE_OUT_CHANNEL_WAIT); + rpc_out_channel_transition_to_state(connection->DefaultOutChannel, + CLIENT_OUT_CHANNEL_STATE_OPENED); + rpc_virtual_connection_transition_to_state( + rpc, connection, VIRTUAL_CONNECTION_STATE_OUT_CHANNEL_WAIT); return 0; } @@ -649,7 +658,7 @@ static int rpc_client_nondefault_out_channel_recv(rdpRpc* rpc) { switch (nextOutChannel->State) { - case CLIENT_OUT_CHANNEL_STATE_SECURITY: + case CLIENT_OUT_CHANNEL_STATE_SECURITY: if (rpc_ncacn_http_recv_out_channel_response(&nextOutChannel->common, response)) { if (rpc_ncacn_http_send_out_channel_request(&nextOutChannel->common, TRUE)) @@ -659,7 +668,8 @@ static int rpc_client_nondefault_out_channel_recv(rdpRpc* rpc) if (status >= 0) { - rpc_out_channel_transition_to_state(nextOutChannel, CLIENT_OUT_CHANNEL_STATE_OPENED_A6W); + rpc_out_channel_transition_to_state( + nextOutChannel, CLIENT_OUT_CHANNEL_STATE_OPENED_A6W); } else { @@ -679,7 +689,8 @@ static int rpc_client_nondefault_out_channel_recv(rdpRpc* rpc) break; default: - WLog_ERR(TAG, "rpc_client_nondefault_out_channel_recv: Unexpected message %08"PRIx32, + WLog_ERR(TAG, + "rpc_client_nondefault_out_channel_recv: Unexpected message %08" PRIx32, nextOutChannel->State); return -1; } @@ -755,8 +766,7 @@ int rpc_client_in_channel_recv(rdpRpc* rpc) } rpc_ncacn_http_ntlm_uninit(&inChannel->common); - rpc_in_channel_transition_to_state(inChannel, - CLIENT_IN_CHANNEL_STATE_NEGOTIATED); + rpc_in_channel_transition_to_state(inChannel, CLIENT_IN_CHANNEL_STATE_NEGOTIATED); /* Send CONN/B1 PDU over IN channel */ @@ -767,13 +777,12 @@ int rpc_client_in_channel_recv(rdpRpc* rpc) return -1; } - rpc_in_channel_transition_to_state(inChannel, - CLIENT_IN_CHANNEL_STATE_OPENED); + rpc_in_channel_transition_to_state(inChannel, CLIENT_IN_CHANNEL_STATE_OPENED); if (outChannel->State == CLIENT_OUT_CHANNEL_STATE_OPENED) { - rpc_virtual_connection_transition_to_state(rpc, - connection, VIRTUAL_CONNECTION_STATE_OUT_CHANNEL_WAIT); + rpc_virtual_connection_transition_to_state( + rpc, connection, VIRTUAL_CONNECTION_STATE_OUT_CHANNEL_WAIT); } status = 1; @@ -814,7 +823,7 @@ RpcClientCall* rpc_client_call_find_by_id(RpcClient* client, UINT32 CallId) for (index = 0; index < count; index++) { - clientCall = (RpcClientCall*) ArrayList_GetItem(client->ClientCallList, index); + clientCall = (RpcClientCall*)ArrayList_GetItem(client->ClientCallList, index); if (clientCall->CallId == CallId) break; @@ -827,7 +836,7 @@ RpcClientCall* rpc_client_call_find_by_id(RpcClient* client, UINT32 CallId) RpcClientCall* rpc_client_call_new(UINT32 CallId, UINT32 OpNum) { RpcClientCall* clientCall; - clientCall = (RpcClientCall*) calloc(1, sizeof(RpcClientCall)); + clientCall = (RpcClientCall*)calloc(1, sizeof(RpcClientCall)); if (!clientCall) return NULL; @@ -858,15 +867,15 @@ int rpc_in_channel_send_pdu(RpcInChannel* inChannel, BYTE* buffer, UINT32 length if (status <= 0) return -1; - header = (rpcconn_common_hdr_t*) buffer; + header = (rpcconn_common_hdr_t*)buffer; clientCall = rpc_client_call_find_by_id(inChannel->common.client, header->call_id); clientCall->State = RPC_CLIENT_CALL_STATE_DISPATCHED; /* * This protocol specifies that only RPC PDUs are subject to the flow control abstract - * data model. RTS PDUs and the HTTP request and response headers are not subject to flow control. - * Implementations of this protocol MUST NOT include them when computing any of the variables - * specified by this abstract data model. + * data model. RTS PDUs and the HTTP request and response headers are not subject to flow + * control. Implementations of this protocol MUST NOT include them when computing any of the + * variables specified by this abstract data model. */ if (header->ptype == PTYPE_REQUEST) @@ -923,7 +932,7 @@ BOOL rpc_client_write_call(rdpRpc* rpc, wStream* s, UINT16 opnum) if (ntlm_client_query_auth_size(ntlm) < 0) goto fail; - request_pdu = (rpcconn_request_hdr_t*) calloc(1, sizeof(rpcconn_request_hdr_t)); + request_pdu = (rpcconn_request_hdr_t*)calloc(1, sizeof(rpcconn_request_hdr_t)); if (!request_pdu) goto fail; @@ -933,10 +942,10 @@ BOOL rpc_client_write_call(rdpRpc* rpc, wStream* s, UINT16 opnum) if (size < 0) goto fail; - rpc_pdu_header_init(rpc, (rpcconn_hdr_t*) request_pdu); + rpc_pdu_header_init(rpc, (rpcconn_hdr_t*)request_pdu); request_pdu->ptype = PTYPE_REQUEST; request_pdu->pfc_flags = PFC_FIRST_FRAG | PFC_LAST_FRAG; - request_pdu->auth_length = (UINT16) size; + request_pdu->auth_length = (UINT16)size; request_pdu->call_id = rpc->CallId++; request_pdu->alloc_hint = length; request_pdu->p_cont_id = 0x0000; @@ -966,7 +975,7 @@ BOOL rpc_client_write_call(rdpRpc* rpc, wStream* s, UINT16 opnum) request_pdu->auth_verifier.auth_context_id = 0x00000000; offset += (8 + request_pdu->auth_length); request_pdu->frag_length = offset; - buffer = (BYTE*) calloc(1, request_pdu->frag_length); + buffer = (BYTE*)calloc(1, request_pdu->frag_length); if (!buffer) goto fail; @@ -979,7 +988,7 @@ BOOL rpc_client_write_call(rdpRpc* rpc, wStream* s, UINT16 opnum) rpc_offset_pad(&offset, request_pdu->auth_verifier.auth_pad_length); CopyMemory(&buffer[offset], &request_pdu->auth_verifier.auth_type, 8); offset += 8; - Buffers[0].BufferType = SECBUFFER_DATA; /* auth_data */ + Buffers[0].BufferType = SECBUFFER_DATA; /* auth_data */ Buffers[1].BufferType = SECBUFFER_TOKEN; /* signature */ Buffers[0].pvBuffer = buffer; Buffers[0].cbBuffer = offset; @@ -991,7 +1000,7 @@ BOOL rpc_client_write_call(rdpRpc* rpc, wStream* s, UINT16 opnum) Message.cBuffers = 2; Message.ulVersion = SECBUFFER_VERSION; - Message.pBuffers = (PSecBuffer) &Buffers; + Message.pBuffers = (PSecBuffer)&Buffers; if (!ntlm_client_encrypt(ntlm, 0, &Message, rpc->SendSeqNum++)) goto fail; @@ -1030,7 +1039,8 @@ static BOOL rpc_client_resolve_gateway(rdpSettings* settings, char** host, UINT1 if (!result) return FALSE; - *host = freerdp_tcp_address_to_string((const struct sockaddr_storage*)result->ai_addr, NULL); + *host = + freerdp_tcp_address_to_string((const struct sockaddr_storage*)result->ai_addr, NULL); freeaddrinfo(result); return TRUE; } @@ -1038,12 +1048,13 @@ static BOOL rpc_client_resolve_gateway(rdpSettings* settings, char** host, UINT1 RpcClient* rpc_client_new(rdpContext* context, UINT32 max_recv_frag) { - RpcClient* client = (RpcClient*) calloc(1, sizeof(RpcClient)); + RpcClient* client = (RpcClient*)calloc(1, sizeof(RpcClient)); if (!client) return NULL; - if (!rpc_client_resolve_gateway(context->settings, &client->host, &client->port, &client->isProxy)) + if (!rpc_client_resolve_gateway(context->settings, &client->host, &client->port, + &client->isProxy)) goto fail; client->context = context; diff --git a/libfreerdp/core/gateway/rpc_client.h b/libfreerdp/core/gateway/rpc_client.h index 3055d34f0..af0b8ce13 100644 --- a/libfreerdp/core/gateway/rpc_client.h +++ b/libfreerdp/core/gateway/rpc_client.h @@ -26,20 +26,17 @@ #include "rpc.h" -FREERDP_LOCAL RpcClientCall* rpc_client_call_find_by_id(RpcClient* client, - UINT32 CallId); +FREERDP_LOCAL RpcClientCall* rpc_client_call_find_by_id(RpcClient* client, UINT32 CallId); FREERDP_LOCAL RpcClientCall* rpc_client_call_new(UINT32 CallId, UINT32 OpNum); FREERDP_LOCAL void rpc_client_call_free(RpcClientCall* client_call); -FREERDP_LOCAL int rpc_in_channel_send_pdu(RpcInChannel* inChannel, BYTE* buffer, - UINT32 length); +FREERDP_LOCAL int rpc_in_channel_send_pdu(RpcInChannel* inChannel, BYTE* buffer, UINT32 length); FREERDP_LOCAL int rpc_client_in_channel_recv(rdpRpc* rpc); FREERDP_LOCAL int rpc_client_out_channel_recv(rdpRpc* rpc); -FREERDP_LOCAL int rpc_client_receive_pipe_read(RpcClient* client, BYTE* buffer, - size_t length); +FREERDP_LOCAL int rpc_client_receive_pipe_read(RpcClient* client, BYTE* buffer, size_t length); FREERDP_LOCAL BOOL rpc_client_write_call(rdpRpc* rpc, wStream* s, UINT16 opnum); diff --git a/libfreerdp/core/gateway/rpc_fault.c b/libfreerdp/core/gateway/rpc_fault.c index eb1725404..7259f04b2 100644 --- a/libfreerdp/core/gateway/rpc_fault.c +++ b/libfreerdp/core/gateway/rpc_fault.c @@ -29,191 +29,202 @@ #define TAG FREERDP_TAG("core.gateway.rpc") -static const RPC_FAULT_CODE RPC_FAULT_CODES[] = -{ - DEFINE_RPC_FAULT_CODE(nca_s_fault_object_not_found, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_cancel, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_addr_error, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_context_mismatch, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_fp_div_zero, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_fp_error, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_fp_overflow, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_fp_underflow, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_ill_inst, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_int_div_by_zero, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_int_overflow, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_invalid_bound, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_invalid_tag, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_closed, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_comm_error, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_discipline, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_empty, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_memory, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_order, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_remote_no_memory, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_user_defined, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_tx_open_failed, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_codeset_conv_error, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(nca_s_fault_no_client_stub, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_STRING_BINDING, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_WRONG_KIND_OF_BINDING, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_BINDING, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_PROTSEQ_NOT_SUPPORTED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_RPC_PROTSEQ, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_STRING_UUID, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_ENDPOINT_FORMAT, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_NET_ADDR, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_ENDPOINT_FOUND, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_TIMEOUT, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_OBJECT_NOT_FOUND, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_ALREADY_REGISTERED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_TYPE_ALREADY_REGISTERED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_ALREADY_LISTENING, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_PROTSEQS_REGISTERED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_NOT_LISTENING, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_MGR_TYPE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_IF, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_BINDINGS, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_PROTSEQS, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_CANT_CREATE_ENDPOINT, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_OUT_OF_RESOURCES, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_SERVER_UNAVAILABLE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_SERVER_TOO_BUSY, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_NETWORK_OPTIONS, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_CALL_ACTIVE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_CALL_FAILED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_CALL_FAILED_DNE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_PROTOCOL_ERROR, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_PROXY_ACCESS_DENIED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_UNSUPPORTED_TRANS_SYN, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_UNSUPPORTED_TYPE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_TAG, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_BOUND, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_ENTRY_NAME, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_NAME_SYNTAX, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_UNSUPPORTED_NAME_SYNTAX, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_UUID_NO_ADDRESS, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_DUPLICATE_ENDPOINT, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_AUTHN_TYPE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_MAX_CALLS_TOO_SMALL, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_STRING_TOO_LONG, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_PROTSEQ_NOT_FOUND, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_PROCNUM_OUT_OF_RANGE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_BINDING_HAS_NO_AUTH, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_AUTHN_SERVICE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_AUTHN_LEVEL, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_AUTH_IDENTITY, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_AUTHZ_SERVICE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(EPT_S_INVALID_ENTRY, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(EPT_S_CANT_PERFORM_OP, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(EPT_S_NOT_REGISTERED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_NOTHING_TO_EXPORT, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INCOMPLETE_NAME, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_VERS_OPTION, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_MORE_MEMBERS, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_NOT_ALL_OBJS_UNEXPORTED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INTERFACE_NOT_FOUND, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_ENTRY_ALREADY_EXISTS, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_ENTRY_NOT_FOUND, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_NAME_SERVICE_UNAVAILABLE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_NAF_ID, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_CANNOT_SUPPORT, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_CONTEXT_AVAILABLE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INTERNAL_ERROR, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_ZERO_DIVIDE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_ADDRESS_ERROR, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_FP_DIV_ZERO, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_FP_UNDERFLOW, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_FP_OVERFLOW, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_NO_MORE_ENTRIES, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_SS_CHAR_TRANS_OPEN_FAIL, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_SS_CHAR_TRANS_SHORT_FILE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_SS_IN_NULL_CONTEXT, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_SS_CONTEXT_DAMAGED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_SS_HANDLES_MISMATCH, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_SS_CANNOT_GET_CALL_HANDLE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_NULL_REF_POINTER, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_ENUM_VALUE_OUT_OF_RANGE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_BYTE_COUNT_TOO_SMALL, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_BAD_STUB_DATA, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_INTERFACES, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_CALL_CANCELLED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_BINDING_INCOMPLETE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_COMM_FAILURE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_UNSUPPORTED_AUTHN_LEVEL, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_PRINC_NAME, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_NOT_RPC_ERROR, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_UUID_LOCAL_ONLY, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_SEC_PKG_ERROR, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_NOT_CANCELLED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_ES_ACTION, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_WRONG_ES_VERSION, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_WRONG_STUB_VERSION, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_PIPE_OBJECT, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_WRONG_PIPE_ORDER, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_WRONG_PIPE_VERSION, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_COOKIE_AUTH_FAILED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_GROUP_MEMBER_NOT_FOUND, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(EPT_S_CANT_CREATE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_OBJECT, CAT_GATEWAY) - { - 0, NULL, NULL - } +static const RPC_FAULT_CODE RPC_FAULT_CODES[] = { + DEFINE_RPC_FAULT_CODE(nca_s_fault_object_not_found, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + nca_s_fault_cancel, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(nca_s_fault_addr_error, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_context_mismatch, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + nca_s_fault_fp_div_zero, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(nca_s_fault_fp_error, + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_fp_overflow, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + nca_s_fault_fp_underflow, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_ill_inst, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + nca_s_fault_int_div_by_zero, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(nca_s_fault_int_overflow, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + nca_s_fault_invalid_bound, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(nca_s_fault_invalid_tag, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_closed, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_comm_error, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_discipline, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_empty, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_memory, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_order, + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_remote_no_memory, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(nca_s_fault_user_defined, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(nca_s_fault_tx_open_failed, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(nca_s_fault_codeset_conv_error, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(nca_s_fault_no_client_stub, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_STRING_BINDING, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_WRONG_KIND_OF_BINDING, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_BINDING, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_PROTSEQ_NOT_SUPPORTED, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_RPC_PROTSEQ, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_STRING_UUID, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_ENDPOINT_FORMAT, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_NET_ADDR, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_NO_ENDPOINT_FOUND, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_TIMEOUT, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_OBJECT_NOT_FOUND, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_ALREADY_REGISTERED, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_TYPE_ALREADY_REGISTERED, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_ALREADY_LISTENING, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_NO_PROTSEQS_REGISTERED, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_NOT_LISTENING, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_MGR_TYPE, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_IF, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_NO_BINDINGS, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_NO_PROTSEQS, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_CANT_CREATE_ENDPOINT, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_OUT_OF_RESOURCES, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_SERVER_UNAVAILABLE, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_SERVER_TOO_BUSY, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_NETWORK_OPTIONS, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_NO_CALL_ACTIVE, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_CALL_FAILED, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_CALL_FAILED_DNE, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_PROTOCOL_ERROR, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_PROXY_ACCESS_DENIED, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_UNSUPPORTED_TRANS_SYN, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_UNSUPPORTED_TYPE, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_TAG, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_BOUND, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_NO_ENTRY_NAME, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_NAME_SYNTAX, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_UNSUPPORTED_NAME_SYNTAX, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_UUID_NO_ADDRESS, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_DUPLICATE_ENDPOINT, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_AUTHN_TYPE, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_MAX_CALLS_TOO_SMALL, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_STRING_TOO_LONG, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_PROTSEQ_NOT_FOUND, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_PROCNUM_OUT_OF_RANGE, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_BINDING_HAS_NO_AUTH, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_AUTHN_SERVICE, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_AUTHN_LEVEL, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_AUTH_IDENTITY, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_AUTHZ_SERVICE, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(EPT_S_INVALID_ENTRY, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(EPT_S_CANT_PERFORM_OP, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(EPT_S_NOT_REGISTERED, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_NOTHING_TO_EXPORT, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_INCOMPLETE_NAME, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_VERS_OPTION, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_NO_MORE_MEMBERS, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_NOT_ALL_OBJS_UNEXPORTED, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_INTERFACE_NOT_FOUND, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_ENTRY_ALREADY_EXISTS, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_ENTRY_NOT_FOUND, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_NAME_SERVICE_UNAVAILABLE, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_NAF_ID, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_CANNOT_SUPPORT, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_NO_CONTEXT_AVAILABLE, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_INTERNAL_ERROR, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_ZERO_DIVIDE, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_ADDRESS_ERROR, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_FP_DIV_ZERO, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_FP_UNDERFLOW, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_FP_OVERFLOW, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_X_NO_MORE_ENTRIES, + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_SS_CHAR_TRANS_OPEN_FAIL, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_X_SS_CHAR_TRANS_SHORT_FILE, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + RPC_X_SS_IN_NULL_CONTEXT, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_X_SS_CONTEXT_DAMAGED, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_X_SS_HANDLES_MISMATCH, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_SS_CANNOT_GET_CALL_HANDLE, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_X_NULL_REF_POINTER, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + RPC_X_ENUM_VALUE_OUT_OF_RANGE, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_X_BYTE_COUNT_TOO_SMALL, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_X_BAD_STUB_DATA, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + RPC_S_NO_INTERFACES, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_CALL_CANCELLED, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_BINDING_INCOMPLETE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_COMM_FAILURE, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + RPC_S_UNSUPPORTED_AUTHN_LEVEL, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_NO_PRINC_NAME, + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_NOT_RPC_ERROR, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + RPC_S_UUID_LOCAL_ONLY, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_SEC_PKG_ERROR, + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + RPC_S_NOT_CANCELLED, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_ES_ACTION, + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + RPC_X_WRONG_ES_VERSION, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_X_WRONG_STUB_VERSION, + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + RPC_X_INVALID_PIPE_OBJECT, + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + RPC_X_WRONG_PIPE_ORDER, + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + RPC_X_WRONG_PIPE_VERSION, + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + RPC_S_COOKIE_AUTH_FAILED, + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + RPC_S_GROUP_MEMBER_NOT_FOUND, + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + EPT_S_CANT_CREATE, + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + RPC_S_INVALID_OBJECT, + CAT_GATEWAY){ + 0, + NULL, + NULL } }; -static const RPC_FAULT_CODE RPC_TSG_FAULT_CODES[] = -{ - DEFINE_RPC_FAULT_CODE(RPC_S_OK, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_ARG, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_OUT_OF_MEMORY, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_OUT_OF_THREADS, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_LEVEL, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_BUFFER_TOO_SMALL, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_SECURITY_DESC, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_ACCESS_DENIED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_SERVER_OUT_OF_MEMORY, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_ASYNC_CALL_PENDING, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_PRINCIPAL, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_S_TIMEOUT, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_NO_MEMORY, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_BOUND, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_TAG, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_ENUM_VALUE_TOO_LARGE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_SS_CONTEXT_MISMATCH, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_BUFFER, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_PIPE_APP_MEMORY, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_PIPE_OPERATION, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(ERROR_ONLY_IF_CONNECTED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(ERROR_GRACEFUL_DISCONNECT, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(ERROR_OPERATION_ABORTED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(ERROR_BAD_ARGUMENTS, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(E_PROXY_INTERNALERROR, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(E_PROXY_RAP_ACCESSDENIED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(E_PROXY_NAP_ACCESSDENIED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(E_PROXY_TS_CONNECTFAILED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(E_PROXY_ALREADYDISCONNECTED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(E_PROXY_QUARANTINE_ACCESSDENIED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(E_PROXY_NOCERTAVAILABLE, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(E_PROXY_COOKIE_BADPACKET, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(E_PROXY_COOKIE_AUTHENTICATION_ACCESS_DENIED, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(E_PROXY_UNSUPPORTED_AUTHENTICATION_METHOD, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(E_PROXY_CAPABILITYMISMATCH, CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_NOTSUPPORTED), CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_TS_CONNECTFAILED), CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_MAXCONNECTIONSREACHED), CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_INTERNALERROR), CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_SESSIONTIMEOUT), CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_REAUTH_AUTHN_FAILED), CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_REAUTH_CAP_FAILED), CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_REAUTH_RAP_FAILED), CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_SDR_NOT_SUPPORTED_BY_TS), CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_REAUTH_NAP_FAILED), CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_CONNECTIONABORTED), CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_NOCERTAVAILABLE), CAT_GATEWAY) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(RPC_S_CALL_CANCELLED), CAT_GATEWAY) - { - 0, NULL, NULL - } +static const RPC_FAULT_CODE RPC_TSG_FAULT_CODES[] = { + DEFINE_RPC_FAULT_CODE(RPC_S_OK, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + RPC_S_INVALID_ARG, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_OUT_OF_MEMORY, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_OUT_OF_THREADS, + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_LEVEL, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + RPC_S_BUFFER_TOO_SMALL, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_SECURITY_DESC, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_ACCESS_DENIED, + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_SERVER_OUT_OF_MEMORY, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + RPC_S_ASYNC_CALL_PENDING, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_PRINCIPAL, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_S_TIMEOUT, + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_NO_MEMORY, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + RPC_X_INVALID_BOUND, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_TAG, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_X_ENUM_VALUE_TOO_LARGE, + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_SS_CONTEXT_MISMATCH, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + RPC_X_INVALID_BUFFER, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(RPC_X_PIPE_APP_MEMORY, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_PIPE_OPERATION, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + ERROR_ONLY_IF_CONNECTED, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(ERROR_GRACEFUL_DISCONNECT, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(ERROR_OPERATION_ABORTED, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + ERROR_BAD_ARGUMENTS, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(E_PROXY_INTERNALERROR, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(E_PROXY_RAP_ACCESSDENIED, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + E_PROXY_NAP_ACCESSDENIED, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(E_PROXY_TS_CONNECTFAILED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(E_PROXY_ALREADYDISCONNECTED, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + E_PROXY_QUARANTINE_ACCESSDENIED, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(E_PROXY_NOCERTAVAILABLE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(E_PROXY_COOKIE_BADPACKET, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + E_PROXY_COOKIE_AUTHENTICATION_ACCESS_DENIED, + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(E_PROXY_UNSUPPORTED_AUTHENTICATION_METHOD, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(E_PROXY_CAPABILITYMISMATCH, CAT_GATEWAY) DEFINE_RPC_FAULT_CODE( + HRESULT_CODE(E_PROXY_NOTSUPPORTED), + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + HRESULT_CODE(E_PROXY_TS_CONNECTFAILED), + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + HRESULT_CODE(E_PROXY_MAXCONNECTIONSREACHED), + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + HRESULT_CODE(E_PROXY_INTERNALERROR), + CAT_GATEWAY) DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_SESSIONTIMEOUT), + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + HRESULT_CODE( + E_PROXY_REAUTH_AUTHN_FAILED), + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + HRESULT_CODE( + E_PROXY_REAUTH_CAP_FAILED), + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + HRESULT_CODE( + E_PROXY_REAUTH_RAP_FAILED), + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + HRESULT_CODE( + E_PROXY_SDR_NOT_SUPPORTED_BY_TS), + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + HRESULT_CODE( + E_PROXY_REAUTH_NAP_FAILED), + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + HRESULT_CODE( + E_PROXY_CONNECTIONABORTED), + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + HRESULT_CODE( + E_PROXY_NOCERTAVAILABLE), + CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE( + HRESULT_CODE( + RPC_S_CALL_CANCELLED), + CAT_GATEWAY){ + 0, NULL, + NULL } }; /** @@ -370,7 +381,8 @@ const char* rpc_error_to_string(UINT32 code) { if (RPC_FAULT_CODES[index].code == code) { - sprintf_s(buffer, ARRAYSIZE(buffer), "%s [0x%08"PRIX32"]", RPC_FAULT_CODES[index].name, code); + sprintf_s(buffer, ARRAYSIZE(buffer), "%s [0x%08" PRIX32 "]", + RPC_FAULT_CODES[index].name, code); goto out; } } @@ -379,12 +391,13 @@ const char* rpc_error_to_string(UINT32 code) { if (RPC_TSG_FAULT_CODES[index].code == code) { - sprintf_s(buffer, ARRAYSIZE(buffer), "%s [0x%08"PRIX32"]", RPC_TSG_FAULT_CODES[index].name, code); + sprintf_s(buffer, ARRAYSIZE(buffer), "%s [0x%08" PRIX32 "]", + RPC_TSG_FAULT_CODES[index].name, code); goto out; } } - sprintf_s(buffer, ARRAYSIZE(buffer), "%s [0x%08"PRIX32"]", "UNKNOWN", code); + sprintf_s(buffer, ARRAYSIZE(buffer), "%s [0x%08" PRIX32 "]", "UNKNOWN", code); out: return buffer; } @@ -411,6 +424,6 @@ const char* rpc_error_to_category(UINT32 code) int rpc_recv_fault_pdu(UINT32 status) { UINT32 code = rpc_map_status_code_to_win32_error_code(status); - WLog_ERR(TAG, "RPC Fault PDU: status=%s", rpc_error_to_string(code)); + WLog_ERR(TAG, "RPC Fault PDU: status=%s", rpc_error_to_string(code)); return 0; } diff --git a/libfreerdp/core/gateway/rts.c b/libfreerdp/core/gateway/rts.c index 5e7ecfae4..6218f8157 100644 --- a/libfreerdp/core/gateway/rts.c +++ b/libfreerdp/core/gateway/rts.c @@ -51,15 +51,17 @@ * The rpc_vers and rpc_vers_minor fields MUST contain version information as described in * [MS-RPCE] section 1.7. * - * PTYPE MUST be set to a value of 20 (0x14). This field differentiates RTS packets from other RPC packets. + * PTYPE MUST be set to a value of 20 (0x14). This field differentiates RTS packets from other RPC + * packets. * - * The packed_drep MUST indicate little-endian integer and floating-pointer byte order, IEEE float-point - * format representation, and ASCII character format as specified in [C706] section 12.6. + * The packed_drep MUST indicate little-endian integer and floating-pointer byte order, IEEE + * float-point format representation, and ASCII character format as specified in [C706] + * section 12.6. * * The auth_length MUST be set to 0. * - * The frag_length field MUST reflect the size of the header plus the size of all commands, including - * the variable portion of variable-sized commands. + * The frag_length field MUST reflect the size of the header plus the size of all commands, + * including the variable portion of variable-sized commands. * * The call_id MUST be set to 0 by senders and MUST be 0 on receipt. * @@ -81,10 +83,10 @@ static void rts_pdu_header_init(rpcconn_rts_hdr_t* header) } static int rts_receive_window_size_command_read(rdpRpc* rpc, BYTE* buffer, UINT32 length, - UINT32* ReceiveWindowSize) + UINT32* ReceiveWindowSize) { if (ReceiveWindowSize) - *ReceiveWindowSize = *((UINT32*) &buffer[0]); /* ReceiveWindowSize (4 bytes) */ + *ReceiveWindowSize = *((UINT32*)&buffer[0]); /* ReceiveWindowSize (4 bytes) */ return 4; } @@ -93,22 +95,23 @@ static int rts_receive_window_size_command_write(BYTE* buffer, UINT32 ReceiveWin { if (buffer) { - *((UINT32*) &buffer[0]) = RTS_CMD_RECEIVE_WINDOW_SIZE; /* CommandType (4 bytes) */ - *((UINT32*) &buffer[4]) = ReceiveWindowSize; /* ReceiveWindowSize (4 bytes) */ + *((UINT32*)&buffer[0]) = RTS_CMD_RECEIVE_WINDOW_SIZE; /* CommandType (4 bytes) */ + *((UINT32*)&buffer[4]) = ReceiveWindowSize; /* ReceiveWindowSize (4 bytes) */ } return 8; } static int rts_flow_control_ack_command_read(rdpRpc* rpc, BYTE* buffer, UINT32 length, - UINT32* BytesReceived, UINT32* AvailableWindow, BYTE* ChannelCookie) + UINT32* BytesReceived, UINT32* AvailableWindow, + BYTE* ChannelCookie) { /* Ack (24 bytes) */ if (BytesReceived) - *BytesReceived = *((UINT32*) &buffer[0]); /* BytesReceived (4 bytes) */ + *BytesReceived = *((UINT32*)&buffer[0]); /* BytesReceived (4 bytes) */ if (AvailableWindow) - *AvailableWindow = *((UINT32*) &buffer[4]); /* AvailableWindow (4 bytes) */ + *AvailableWindow = *((UINT32*)&buffer[4]); /* AvailableWindow (4 bytes) */ if (ChannelCookie) CopyMemory(ChannelCookie, &buffer[8], 16); /* ChannelCookie (16 bytes) */ @@ -117,15 +120,14 @@ static int rts_flow_control_ack_command_read(rdpRpc* rpc, BYTE* buffer, UINT32 l } static int rts_flow_control_ack_command_write(BYTE* buffer, UINT32 BytesReceived, - UINT32 AvailableWindow, - BYTE* ChannelCookie) + UINT32 AvailableWindow, BYTE* ChannelCookie) { if (buffer) { - *((UINT32*) &buffer[0]) = RTS_CMD_FLOW_CONTROL_ACK; /* CommandType (4 bytes) */ + *((UINT32*)&buffer[0]) = RTS_CMD_FLOW_CONTROL_ACK; /* CommandType (4 bytes) */ /* Ack (24 bytes) */ - *((UINT32*) &buffer[4]) = BytesReceived; /* BytesReceived (4 bytes) */ - *((UINT32*) &buffer[8]) = AvailableWindow; /* AvailableWindow (4 bytes) */ + *((UINT32*)&buffer[4]) = BytesReceived; /* BytesReceived (4 bytes) */ + *((UINT32*)&buffer[8]) = AvailableWindow; /* AvailableWindow (4 bytes) */ CopyMemory(&buffer[12], ChannelCookie, 16); /* ChannelCookie (16 bytes) */ } @@ -133,10 +135,10 @@ static int rts_flow_control_ack_command_write(BYTE* buffer, UINT32 BytesReceived } static int rts_connection_timeout_command_read(rdpRpc* rpc, BYTE* buffer, UINT32 length, - UINT32* ConnectionTimeout) + UINT32* ConnectionTimeout) { if (ConnectionTimeout) - *ConnectionTimeout = *((UINT32*) &buffer[0]); /* ConnectionTimeout (4 bytes) */ + *ConnectionTimeout = *((UINT32*)&buffer[0]); /* ConnectionTimeout (4 bytes) */ return 4; } @@ -145,8 +147,8 @@ static int rts_connection_timeout_command_write(BYTE* buffer, UINT32 ConnectionT { if (buffer) { - *((UINT32*) &buffer[0]) = RTS_CMD_CONNECTION_TIMEOUT; /* CommandType (4 bytes) */ - *((UINT32*) &buffer[4]) = ConnectionTimeout; /* ConnectionTimeout (4 bytes) */ + *((UINT32*)&buffer[0]) = RTS_CMD_CONNECTION_TIMEOUT; /* CommandType (4 bytes) */ + *((UINT32*)&buffer[4]) = ConnectionTimeout; /* ConnectionTimeout (4 bytes) */ } return 8; @@ -162,8 +164,8 @@ static int rts_cookie_command_write(BYTE* buffer, BYTE* Cookie) { if (buffer) { - *((UINT32*) &buffer[0]) = RTS_CMD_COOKIE; /* CommandType (4 bytes) */ - CopyMemory(&buffer[4], Cookie, 16); /* Cookie (16 bytes) */ + *((UINT32*)&buffer[0]) = RTS_CMD_COOKIE; /* CommandType (4 bytes) */ + CopyMemory(&buffer[4], Cookie, 16); /* Cookie (16 bytes) */ } return 20; @@ -179,8 +181,8 @@ static int rts_channel_lifetime_command_write(BYTE* buffer, UINT32 ChannelLifeti { if (buffer) { - *((UINT32*) &buffer[0]) = RTS_CMD_CHANNEL_LIFETIME; /* CommandType (4 bytes) */ - *((UINT32*) &buffer[4]) = ChannelLifetime; /* ChannelLifetime (4 bytes) */ + *((UINT32*)&buffer[0]) = RTS_CMD_CHANNEL_LIFETIME; /* CommandType (4 bytes) */ + *((UINT32*)&buffer[4]) = ChannelLifetime; /* ChannelLifetime (4 bytes) */ } return 8; @@ -201,8 +203,8 @@ static int rts_client_keepalive_command_write(BYTE* buffer, UINT32 ClientKeepali */ if (buffer) { - *((UINT32*) &buffer[0]) = RTS_CMD_CLIENT_KEEPALIVE; /* CommandType (4 bytes) */ - *((UINT32*) &buffer[4]) = ClientKeepalive; /* ClientKeepalive (4 bytes) */ + *((UINT32*)&buffer[0]) = RTS_CMD_CLIENT_KEEPALIVE; /* CommandType (4 bytes) */ + *((UINT32*)&buffer[4]) = ClientKeepalive; /* ClientKeepalive (4 bytes) */ } return 8; @@ -218,8 +220,8 @@ static int rts_version_command_write(BYTE* buffer) { if (buffer) { - *((UINT32*) &buffer[0]) = RTS_CMD_VERSION; /* CommandType (4 bytes) */ - *((UINT32*) &buffer[4]) = 1; /* Version (4 bytes) */ + *((UINT32*)&buffer[0]) = RTS_CMD_VERSION; /* CommandType (4 bytes) */ + *((UINT32*)&buffer[4]) = 1; /* Version (4 bytes) */ } return 8; @@ -234,7 +236,7 @@ static int rts_empty_command_write(BYTE* buffer) { if (buffer) { - *((UINT32*) &buffer[0]) = RTS_CMD_EMPTY; /* CommandType (4 bytes) */ + *((UINT32*)&buffer[0]) = RTS_CMD_EMPTY; /* CommandType (4 bytes) */ } return 4; @@ -243,7 +245,7 @@ static int rts_empty_command_write(BYTE* buffer) static SSIZE_T rts_padding_command_read(const BYTE* buffer, size_t length) { UINT32 ConformanceCount; - ConformanceCount = *((UINT32*) &buffer[0]); /* ConformanceCount (4 bytes) */ + ConformanceCount = *((UINT32*)&buffer[0]); /* ConformanceCount (4 bytes) */ /* Padding (variable) */ return ConformanceCount + 4; } @@ -252,9 +254,9 @@ static int rts_padding_command_write(BYTE* buffer, UINT32 ConformanceCount) { if (buffer) { - *((UINT32*) &buffer[0]) = RTS_CMD_PADDING; /* CommandType (4 bytes) */ - *((UINT32*) &buffer[4]) = ConformanceCount; /* ConformanceCount (4 bytes) */ - ZeroMemory(&buffer[8], ConformanceCount); /* Padding (variable) */ + *((UINT32*)&buffer[0]) = RTS_CMD_PADDING; /* CommandType (4 bytes) */ + *((UINT32*)&buffer[4]) = ConformanceCount; /* ConformanceCount (4 bytes) */ + ZeroMemory(&buffer[8], ConformanceCount); /* Padding (variable) */ } return 8 + ConformanceCount; @@ -269,7 +271,7 @@ static int rts_negative_ance_command_write(BYTE* buffer) { if (buffer) { - *((UINT32*) &buffer[0]) = RTS_CMD_NEGATIVE_ANCE; /* CommandType (4 bytes) */ + *((UINT32*)&buffer[0]) = RTS_CMD_NEGATIVE_ANCE; /* CommandType (4 bytes) */ } return 4; @@ -284,7 +286,7 @@ static int rts_ance_command_write(BYTE* buffer) { if (buffer) { - *((UINT32*) &buffer[0]) = RTS_CMD_ANCE; /* CommandType (4 bytes) */ + *((UINT32*)&buffer[0]) = RTS_CMD_ANCE; /* CommandType (4 bytes) */ } return 4; @@ -293,7 +295,7 @@ static int rts_ance_command_write(BYTE* buffer) static SSIZE_T rts_client_address_command_read(const BYTE* buffer, size_t length) { UINT32 AddressType; - AddressType = *((UINT32*) &buffer[0]); /* AddressType (4 bytes) */ + AddressType = *((UINT32*)&buffer[0]); /* AddressType (4 bytes) */ if (AddressType == 0) { @@ -313,8 +315,8 @@ static int rts_client_address_command_write(BYTE* buffer, UINT32 AddressType, BY { if (buffer) { - *((UINT32*) &buffer[0]) = RTS_CMD_CLIENT_ADDRESS; /* CommandType (4 bytes) */ - *((UINT32*) &buffer[4]) = AddressType; /* AddressType (4 bytes) */ + *((UINT32*)&buffer[0]) = RTS_CMD_CLIENT_ADDRESS; /* CommandType (4 bytes) */ + *((UINT32*)&buffer[4]) = AddressType; /* AddressType (4 bytes) */ } if (AddressType == 0) @@ -322,7 +324,7 @@ static int rts_client_address_command_write(BYTE* buffer, UINT32 AddressType, BY if (buffer) { CopyMemory(&buffer[8], ClientAddress, 4); /* ClientAddress (4 bytes) */ - ZeroMemory(&buffer[12], 12); /* padding (12 bytes) */ + ZeroMemory(&buffer[12], 12); /* padding (12 bytes) */ } return 24; @@ -332,7 +334,7 @@ static int rts_client_address_command_write(BYTE* buffer, UINT32 AddressType, BY if (buffer) { CopyMemory(&buffer[8], ClientAddress, 16); /* ClientAddress (16 bytes) */ - ZeroMemory(&buffer[24], 12); /* padding (12 bytes) */ + ZeroMemory(&buffer[24], 12); /* padding (12 bytes) */ } return 36; @@ -349,8 +351,8 @@ static int rts_association_group_id_command_write(BYTE* buffer, BYTE* Associatio { if (buffer) { - *((UINT32*) &buffer[0]) = RTS_CMD_ASSOCIATION_GROUP_ID; /* CommandType (4 bytes) */ - CopyMemory(&buffer[4], AssociationGroupId, 16); /* AssociationGroupId (16 bytes) */ + *((UINT32*)&buffer[0]) = RTS_CMD_ASSOCIATION_GROUP_ID; /* CommandType (4 bytes) */ + CopyMemory(&buffer[4], AssociationGroupId, 16); /* AssociationGroupId (16 bytes) */ } return 20; @@ -360,7 +362,7 @@ static int rts_destination_command_read(rdpRpc* rpc, BYTE* buffer, UINT32 length UINT32* Destination) { if (Destination) - *Destination = *((UINT32*) &buffer[0]); /* Destination (4 bytes) */ + *Destination = *((UINT32*)&buffer[0]); /* Destination (4 bytes) */ return 4; } @@ -369,8 +371,8 @@ static int rts_destination_command_write(BYTE* buffer, UINT32 Destination) { if (buffer) { - *((UINT32*) &buffer[0]) = RTS_CMD_DESTINATION; /* CommandType (4 bytes) */ - *((UINT32*) &buffer[4]) = Destination; /* Destination (4 bytes) */ + *((UINT32*)&buffer[0]) = RTS_CMD_DESTINATION; /* CommandType (4 bytes) */ + *((UINT32*)&buffer[4]) = Destination; /* Destination (4 bytes) */ } return 8; @@ -386,8 +388,8 @@ static int rts_ping_traffic_sent_notify_command_write(BYTE* buffer, UINT32 PingT { if (buffer) { - *((UINT32*) &buffer[0]) = RTS_CMD_PING_TRAFFIC_SENT_NOTIFY; /* CommandType (4 bytes) */ - *((UINT32*) &buffer[4]) = PingTrafficSent; /* PingTrafficSent (4 bytes) */ + *((UINT32*)&buffer[0]) = RTS_CMD_PING_TRAFFIC_SENT_NOTIFY; /* CommandType (4 bytes) */ + *((UINT32*)&buffer[4]) = PingTrafficSent; /* PingTrafficSent (4 bytes) */ } return 8; @@ -415,16 +417,16 @@ int rts_send_CONN_A1_pdu(rdpRpc* rpc) header.Flags = RTS_FLAG_NONE; header.NumberOfCommands = 4; WLog_DBG(TAG, "Sending CONN/A1 RTS PDU"); - VirtualConnectionCookie = (BYTE*) & (connection->Cookie); - OUTChannelCookie = (BYTE*) & (outChannel->common.Cookie); + VirtualConnectionCookie = (BYTE*)&(connection->Cookie); + OUTChannelCookie = (BYTE*)&(outChannel->common.Cookie); ReceiveWindowSize = outChannel->ReceiveWindow; - buffer = (BYTE*) malloc(header.frag_length); + buffer = (BYTE*)malloc(header.frag_length); if (!buffer) return -1; - CopyMemory(buffer, ((BYTE*) &header), 20); /* RTS Header (20 bytes) */ - rts_version_command_write(&buffer[20]); /* Version (8 bytes) */ + CopyMemory(buffer, ((BYTE*)&header), 20); /* RTS Header (20 bytes) */ + rts_version_command_write(&buffer[20]); /* Version (8 bytes) */ rts_cookie_command_write(&buffer[28], VirtualConnectionCookie); /* VirtualConnectionCookie (20 bytes) */ rts_cookie_command_write(&buffer[48], OUTChannelCookie); /* OUTChannelCookie (20 bytes) */ @@ -439,7 +441,7 @@ int rts_recv_CONN_A3_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length) { UINT32 ConnectionTimeout; rts_connection_timeout_command_read(rpc, &buffer[24], length - 24, &ConnectionTimeout); - WLog_DBG(TAG, "Receiving CONN/A3 RTS PDU: ConnectionTimeout: %"PRIu32"", ConnectionTimeout); + WLog_DBG(TAG, "Receiving CONN/A3 RTS PDU: ConnectionTimeout: %" PRIu32 "", ConnectionTimeout); rpc->VirtualConnection->DefaultInChannel->PingOriginator.ConnectionTimeout = ConnectionTimeout; return 1; } @@ -462,18 +464,18 @@ int rts_send_CONN_B1_pdu(rdpRpc* rpc) header.Flags = RTS_FLAG_NONE; header.NumberOfCommands = 6; WLog_DBG(TAG, "Sending CONN/B1 RTS PDU"); - VirtualConnectionCookie = (BYTE*) & (connection->Cookie); - INChannelCookie = (BYTE*) & (inChannel->common.Cookie); - AssociationGroupId = (BYTE*) & (connection->AssociationGroupId); - buffer = (BYTE*) malloc(header.frag_length); + VirtualConnectionCookie = (BYTE*)&(connection->Cookie); + INChannelCookie = (BYTE*)&(inChannel->common.Cookie); + AssociationGroupId = (BYTE*)&(connection->AssociationGroupId); + buffer = (BYTE*)malloc(header.frag_length); if (!buffer) return -1; - CopyMemory(buffer, ((BYTE*) &header), 20); /* RTS Header (20 bytes) */ - rts_version_command_write(&buffer[20]); /* Version (8 bytes) */ + CopyMemory(buffer, ((BYTE*)&header), 20); /* RTS Header (20 bytes) */ + rts_version_command_write(&buffer[20]); /* Version (8 bytes) */ rts_cookie_command_write(&buffer[28], - VirtualConnectionCookie); /* VirtualConnectionCookie (20 bytes) */ + VirtualConnectionCookie); /* VirtualConnectionCookie (20 bytes) */ rts_cookie_command_write(&buffer[48], INChannelCookie); /* INChannelCookie (20 bytes) */ rts_channel_lifetime_command_write(&buffer[68], rpc->ChannelLifetime); /* ChannelLifetime (8 bytes) */ @@ -497,11 +499,14 @@ int rts_recv_CONN_C2_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length) offset = 24; offset += rts_version_command_read(rpc, &buffer[offset], length - offset) + 4; offset += rts_receive_window_size_command_read(rpc, &buffer[offset], length - offset, - &ReceiveWindowSize) + 4; + &ReceiveWindowSize) + + 4; offset += rts_connection_timeout_command_read(rpc, &buffer[offset], length - offset, - &ConnectionTimeout) + 4; + &ConnectionTimeout) + + 4; WLog_DBG(TAG, - "Receiving CONN/C2 RTS PDU: ConnectionTimeout: %"PRIu32" ReceiveWindowSize: %"PRIu32"", + "Receiving CONN/C2 RTS PDU: ConnectionTimeout: %" PRIu32 " ReceiveWindowSize: %" PRIu32 + "", ConnectionTimeout, ReceiveWindowSize); rpc->VirtualConnection->DefaultInChannel->PingOriginator.ConnectionTimeout = ConnectionTimeout; rpc->VirtualConnection->DefaultInChannel->PeerReceiveWindow = ReceiveWindowSize; @@ -522,14 +527,14 @@ static int rts_send_keep_alive_pdu(rdpRpc* rpc) header.Flags = RTS_FLAG_OTHER_CMD; header.NumberOfCommands = 1; WLog_DBG(TAG, "Sending Keep-Alive RTS PDU"); - buffer = (BYTE*) malloc(header.frag_length); + buffer = (BYTE*)malloc(header.frag_length); if (!buffer) return -1; - CopyMemory(buffer, ((BYTE*) &header), 20); /* RTS Header (20 bytes) */ - rts_client_keepalive_command_write(&buffer[20], - rpc->CurrentKeepAliveInterval); /* ClientKeepAlive (8 bytes) */ + CopyMemory(buffer, ((BYTE*)&header), 20); /* RTS Header (20 bytes) */ + rts_client_keepalive_command_write( + &buffer[20], rpc->CurrentKeepAliveInterval); /* ClientKeepAlive (8 bytes) */ length = header.frag_length; status = rpc_channel_write(&inChannel->common, buffer, length); free(buffer); @@ -555,14 +560,14 @@ int rts_send_flow_control_ack_pdu(rdpRpc* rpc) WLog_DBG(TAG, "Sending FlowControlAck RTS PDU"); BytesReceived = outChannel->BytesReceived; AvailableWindow = outChannel->AvailableWindowAdvertised; - ChannelCookie = (BYTE*) & (outChannel->common.Cookie); + ChannelCookie = (BYTE*)&(outChannel->common.Cookie); outChannel->ReceiverAvailableWindow = outChannel->AvailableWindowAdvertised; - buffer = (BYTE*) malloc(header.frag_length); + buffer = (BYTE*)malloc(header.frag_length); if (!buffer) return -1; - CopyMemory(buffer, ((BYTE*) &header), 20); /* RTS Header (20 bytes) */ + CopyMemory(buffer, ((BYTE*)&header), 20); /* RTS Header (20 bytes) */ rts_destination_command_write(&buffer[20], FDOutProxy); /* Destination Command (8 bytes) */ /* FlowControlAck Command (28 bytes) */ rts_flow_control_ack_command_write(&buffer[28], BytesReceived, AvailableWindow, ChannelCookie); @@ -579,10 +584,13 @@ static int rts_recv_flow_control_ack_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 lengt UINT32 AvailableWindow; BYTE ChannelCookie[16]; offset = 24; - offset += rts_flow_control_ack_command_read(rpc, &buffer[offset], length - offset, - &BytesReceived, &AvailableWindow, (BYTE*) &ChannelCookie) + 4; + offset += + rts_flow_control_ack_command_read(rpc, &buffer[offset], length - offset, &BytesReceived, + &AvailableWindow, (BYTE*)&ChannelCookie) + + 4; WLog_ERR(TAG, - "Receiving FlowControlAck RTS PDU: BytesReceived: %"PRIu32" AvailableWindow: %"PRIu32"", + "Receiving FlowControlAck RTS PDU: BytesReceived: %" PRIu32 + " AvailableWindow: %" PRIu32 "", BytesReceived, AvailableWindow); rpc->VirtualConnection->DefaultInChannel->SenderAvailableWindow = AvailableWindow - (rpc->VirtualConnection->DefaultInChannel->BytesSent - BytesReceived); @@ -600,23 +608,27 @@ static int rts_recv_flow_control_ack_with_destination_pdu(rdpRpc* rpc, BYTE* buf * When the sender receives a FlowControlAck RTS PDU, it MUST use the following formula to * recalculate its Sender AvailableWindow variable: * - * Sender AvailableWindow = Receiver AvailableWindow_from_ack - (BytesSent - BytesReceived_from_ack) + * Sender AvailableWindow = Receiver AvailableWindow_from_ack - (BytesSent - + * BytesReceived_from_ack) * * Where: * * Receiver AvailableWindow_from_ack is the Available Window field in the Flow Control * Acknowledgement Structure (section 2.2.3.4) in the PDU received. * - * BytesReceived_from_ack is the Bytes Received field in the Flow Control Acknowledgement structure - * in the PDU received. + * BytesReceived_from_ack is the Bytes Received field in the Flow Control Acknowledgement + * structure in the PDU received. * */ offset = 24; offset += rts_destination_command_read(rpc, &buffer[offset], length - offset, &Destination) + 4; - offset += rts_flow_control_ack_command_read(rpc, &buffer[offset], length - offset, - &BytesReceived, &AvailableWindow, (BYTE*) &ChannelCookie) + 4; + offset += + rts_flow_control_ack_command_read(rpc, &buffer[offset], length - offset, &BytesReceived, + &AvailableWindow, (BYTE*)&ChannelCookie) + + 4; WLog_DBG(TAG, - "Receiving FlowControlAckWithDestination RTS PDU: BytesReceived: %"PRIu32" AvailableWindow: %"PRIu32"", + "Receiving FlowControlAckWithDestination RTS PDU: BytesReceived: %" PRIu32 + " AvailableWindow: %" PRIu32 "", BytesReceived, AvailableWindow); rpc->VirtualConnection->DefaultInChannel->SenderAvailableWindow = AvailableWindow - (rpc->VirtualConnection->DefaultInChannel->BytesSent - BytesReceived); @@ -635,12 +647,12 @@ static int rts_send_ping_pdu(rdpRpc* rpc) header.Flags = RTS_FLAG_PING; header.NumberOfCommands = 0; WLog_DBG(TAG, "Sending Ping RTS PDU"); - buffer = (BYTE*) malloc(header.frag_length); + buffer = (BYTE*)malloc(header.frag_length); if (!buffer) return -1; - CopyMemory(buffer, ((BYTE*) &header), 20); /* RTS Header (20 bytes) */ + CopyMemory(buffer, ((BYTE*)&header), 20); /* RTS Header (20 bytes) */ length = header.frag_length; status = rpc_channel_write(&inChannel->common, buffer, length); free(buffer); @@ -674,7 +686,7 @@ SSIZE_T rts_command_length(UINT32 CommandType, const BYTE* buffer, size_t length break; case RTS_CMD_CLIENT_KEEPALIVE: - CommandLength = RTS_CMD_CLIENT_KEEPALIVE_LENGTH; + CommandLength = RTS_CMD_CLIENT_KEEPALIVE_LENGTH; break; case RTS_CMD_VERSION: @@ -714,7 +726,7 @@ SSIZE_T rts_command_length(UINT32 CommandType, const BYTE* buffer, size_t length break; default: - WLog_ERR(TAG, "Error: Unknown RTS Command Type: 0x%"PRIx32"", CommandType); + WLog_ERR(TAG, "Error: Unknown RTS Command Type: 0x%" PRIx32 "", CommandType); return -1; } @@ -734,17 +746,17 @@ static int rts_send_OUT_R2_A7_pdu(rdpRpc* rpc) header.Flags = RTS_FLAG_OUT_CHANNEL; header.NumberOfCommands = 3; WLog_DBG(TAG, "Sending OUT_R2/A7 RTS PDU"); - SuccessorChannelCookie = (BYTE*) & (nextOutChannel->common.Cookie); - buffer = (BYTE*) malloc(header.frag_length); + SuccessorChannelCookie = (BYTE*)&(nextOutChannel->common.Cookie); + buffer = (BYTE*)malloc(header.frag_length); if (!buffer) return -1; - CopyMemory(buffer, ((BYTE*)&header), 20); /* RTS Header (20 bytes) */ + CopyMemory(buffer, ((BYTE*)&header), 20); /* RTS Header (20 bytes) */ rts_destination_command_write(&buffer[20], FDServer); /* Destination (8 bytes)*/ rts_cookie_command_write(&buffer[28], SuccessorChannelCookie); /* SuccessorChannelCookie (20 bytes) */ - rts_version_command_write(&buffer[48]); /* Version (8 bytes) */ + rts_version_command_write(&buffer[48]); /* Version (8 bytes) */ status = rpc_channel_write(&inChannel->common, buffer, header.frag_length); free(buffer); return (status > 0) ? 1 : -1; @@ -761,13 +773,13 @@ static int rts_send_OUT_R2_C1_pdu(rdpRpc* rpc) header.Flags = RTS_FLAG_PING; header.NumberOfCommands = 1; WLog_DBG(TAG, "Sending OUT_R2/C1 RTS PDU"); - buffer = (BYTE*) malloc(header.frag_length); + buffer = (BYTE*)malloc(header.frag_length); if (!buffer) return -1; - CopyMemory(buffer, ((BYTE*) &header), 20); /* RTS Header (20 bytes) */ - rts_empty_command_write(&buffer[20]); /* Empty command (4 bytes) */ + CopyMemory(buffer, ((BYTE*)&header), 20); /* RTS Header (20 bytes) */ + rts_empty_command_write(&buffer[20]); /* Empty command (4 bytes) */ status = rpc_channel_write(&nextOutChannel->common, buffer, header.frag_length); free(buffer); return (status > 0) ? 1 : -1; @@ -790,17 +802,17 @@ int rts_send_OUT_R1_A3_pdu(rdpRpc* rpc) header.Flags = RTS_FLAG_RECYCLE_CHANNEL; header.NumberOfCommands = 5; WLog_DBG(TAG, "Sending OUT_R1/A3 RTS PDU"); - VirtualConnectionCookie = (BYTE*) & (connection->Cookie); - PredecessorChannelCookie = (BYTE*) & (outChannel->common.Cookie); - SuccessorChannelCookie = (BYTE*) & (nextOutChannel->common.Cookie); + VirtualConnectionCookie = (BYTE*)&(connection->Cookie); + PredecessorChannelCookie = (BYTE*)&(outChannel->common.Cookie); + SuccessorChannelCookie = (BYTE*)&(nextOutChannel->common.Cookie); ReceiveWindowSize = outChannel->ReceiveWindow; - buffer = (BYTE*) malloc(header.frag_length); + buffer = (BYTE*)malloc(header.frag_length); if (!buffer) return -1; - CopyMemory(buffer, ((BYTE*) &header), 20); /* RTS Header (20 bytes) */ - rts_version_command_write(&buffer[20]); /* Version (8 bytes) */ + CopyMemory(buffer, ((BYTE*)&header), 20); /* RTS Header (20 bytes) */ + rts_version_command_write(&buffer[20]); /* Version (8 bytes) */ rts_cookie_command_write(&buffer[28], VirtualConnectionCookie); /* VirtualConnectionCookie (20 bytes) */ rts_cookie_command_write(&buffer[48], @@ -898,7 +910,7 @@ int rts_recv_out_of_sequence_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length) if (!connection) return -1; - rts = (rpcconn_rts_hdr_t*) buffer; + rts = (rpcconn_rts_hdr_t*)buffer; if (!rts_extract_pdu_signature(&signature, rts)) return -1; @@ -944,7 +956,7 @@ int rts_recv_out_of_sequence_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length) if (status < 0) { - WLog_ERR(TAG, "error parsing RTS PDU with signature id: 0x%08"PRIX32"", SignatureId); + WLog_ERR(TAG, "error parsing RTS PDU with signature id: 0x%08" PRIX32 "", SignatureId); rts_print_pdu_signature(&signature); } diff --git a/libfreerdp/core/gateway/rts.h b/libfreerdp/core/gateway/rts.h index 67ebf7f8f..ccc4cfd18 100644 --- a/libfreerdp/core/gateway/rts.h +++ b/libfreerdp/core/gateway/rts.h @@ -30,72 +30,69 @@ #include #include -#define RTS_FLAG_NONE 0x0000 -#define RTS_FLAG_PING 0x0001 -#define RTS_FLAG_OTHER_CMD 0x0002 -#define RTS_FLAG_RECYCLE_CHANNEL 0x0004 -#define RTS_FLAG_IN_CHANNEL 0x0008 -#define RTS_FLAG_OUT_CHANNEL 0x0010 -#define RTS_FLAG_EOF 0x0020 -#define RTS_FLAG_ECHO 0x0040 +#define RTS_FLAG_NONE 0x0000 +#define RTS_FLAG_PING 0x0001 +#define RTS_FLAG_OTHER_CMD 0x0002 +#define RTS_FLAG_RECYCLE_CHANNEL 0x0004 +#define RTS_FLAG_IN_CHANNEL 0x0008 +#define RTS_FLAG_OUT_CHANNEL 0x0010 +#define RTS_FLAG_EOF 0x0020 +#define RTS_FLAG_ECHO 0x0040 -#define RTS_CMD_RECEIVE_WINDOW_SIZE 0x00000000 -#define RTS_CMD_FLOW_CONTROL_ACK 0x00000001 -#define RTS_CMD_CONNECTION_TIMEOUT 0x00000002 -#define RTS_CMD_COOKIE 0x00000003 -#define RTS_CMD_CHANNEL_LIFETIME 0x00000004 -#define RTS_CMD_CLIENT_KEEPALIVE 0x00000005 -#define RTS_CMD_VERSION 0x00000006 -#define RTS_CMD_EMPTY 0x00000007 -#define RTS_CMD_PADDING 0x00000008 -#define RTS_CMD_NEGATIVE_ANCE 0x00000009 -#define RTS_CMD_ANCE 0x0000000A -#define RTS_CMD_CLIENT_ADDRESS 0x0000000B -#define RTS_CMD_ASSOCIATION_GROUP_ID 0x0000000C -#define RTS_CMD_DESTINATION 0x0000000D -#define RTS_CMD_PING_TRAFFIC_SENT_NOTIFY 0x0000000E -#define RTS_CMD_LAST_ID 0x0000000F +#define RTS_CMD_RECEIVE_WINDOW_SIZE 0x00000000 +#define RTS_CMD_FLOW_CONTROL_ACK 0x00000001 +#define RTS_CMD_CONNECTION_TIMEOUT 0x00000002 +#define RTS_CMD_COOKIE 0x00000003 +#define RTS_CMD_CHANNEL_LIFETIME 0x00000004 +#define RTS_CMD_CLIENT_KEEPALIVE 0x00000005 +#define RTS_CMD_VERSION 0x00000006 +#define RTS_CMD_EMPTY 0x00000007 +#define RTS_CMD_PADDING 0x00000008 +#define RTS_CMD_NEGATIVE_ANCE 0x00000009 +#define RTS_CMD_ANCE 0x0000000A +#define RTS_CMD_CLIENT_ADDRESS 0x0000000B +#define RTS_CMD_ASSOCIATION_GROUP_ID 0x0000000C +#define RTS_CMD_DESTINATION 0x0000000D +#define RTS_CMD_PING_TRAFFIC_SENT_NOTIFY 0x0000000E +#define RTS_CMD_LAST_ID 0x0000000F -#define RTS_CMD_RECEIVE_WINDOW_SIZE_LENGTH 0x00000004 -#define RTS_CMD_FLOW_CONTROL_ACK_LENGTH 0x00000018 -#define RTS_CMD_CONNECTION_TIMEOUT_LENGTH 0x00000004 -#define RTS_CMD_COOKIE_LENGTH 0x00000010 -#define RTS_CMD_CHANNEL_LIFETIME_LENGTH 0x00000004 -#define RTS_CMD_CLIENT_KEEPALIVE_LENGTH 0x00000004 -#define RTS_CMD_VERSION_LENGTH 0x00000004 -#define RTS_CMD_EMPTY_LENGTH 0x00000000 -#define RTS_CMD_PADDING_LENGTH 0x00000000 /* variable-size */ -#define RTS_CMD_NEGATIVE_ANCE_LENGTH 0x00000000 -#define RTS_CMD_ANCE_LENGTH 0x00000000 -#define RTS_CMD_CLIENT_ADDRESS_LENGTH 0x00000000 /* variable-size */ -#define RTS_CMD_ASSOCIATION_GROUP_ID_LENGTH 0x00000010 -#define RTS_CMD_DESTINATION_LENGTH 0x00000004 -#define RTS_CMD_PING_TRAFFIC_SENT_NOTIFY_LENGTH 0x00000004 +#define RTS_CMD_RECEIVE_WINDOW_SIZE_LENGTH 0x00000004 +#define RTS_CMD_FLOW_CONTROL_ACK_LENGTH 0x00000018 +#define RTS_CMD_CONNECTION_TIMEOUT_LENGTH 0x00000004 +#define RTS_CMD_COOKIE_LENGTH 0x00000010 +#define RTS_CMD_CHANNEL_LIFETIME_LENGTH 0x00000004 +#define RTS_CMD_CLIENT_KEEPALIVE_LENGTH 0x00000004 +#define RTS_CMD_VERSION_LENGTH 0x00000004 +#define RTS_CMD_EMPTY_LENGTH 0x00000000 +#define RTS_CMD_PADDING_LENGTH 0x00000000 /* variable-size */ +#define RTS_CMD_NEGATIVE_ANCE_LENGTH 0x00000000 +#define RTS_CMD_ANCE_LENGTH 0x00000000 +#define RTS_CMD_CLIENT_ADDRESS_LENGTH 0x00000000 /* variable-size */ +#define RTS_CMD_ASSOCIATION_GROUP_ID_LENGTH 0x00000010 +#define RTS_CMD_DESTINATION_LENGTH 0x00000004 +#define RTS_CMD_PING_TRAFFIC_SENT_NOTIFY_LENGTH 0x00000004 -#define FDClient 0x00000000 -#define FDInProxy 0x00000001 -#define FDServer 0x00000002 -#define FDOutProxy 0x00000003 +#define FDClient 0x00000000 +#define FDInProxy 0x00000001 +#define FDServer 0x00000002 +#define FDOutProxy 0x00000003 FREERDP_LOCAL void rts_generate_cookie(BYTE* cookie); FREERDP_LOCAL SSIZE_T rts_command_length(UINT32 CommandType, const BYTE* buffer, size_t length); FREERDP_LOCAL int rts_send_CONN_A1_pdu(rdpRpc* rpc); -FREERDP_LOCAL int rts_recv_CONN_A3_pdu(rdpRpc* rpc, BYTE* buffer, - UINT32 length); +FREERDP_LOCAL int rts_recv_CONN_A3_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length); FREERDP_LOCAL int rts_send_CONN_B1_pdu(rdpRpc* rpc); -FREERDP_LOCAL int rts_recv_CONN_C2_pdu(rdpRpc* rpc, BYTE* buffer, - UINT32 length); +FREERDP_LOCAL int rts_recv_CONN_C2_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length); FREERDP_LOCAL int rts_send_OUT_R1_A3_pdu(rdpRpc* rpc); FREERDP_LOCAL int rts_send_flow_control_ack_pdu(rdpRpc* rpc); -FREERDP_LOCAL int rts_recv_out_of_sequence_pdu(rdpRpc* rpc, BYTE* buffer, - UINT32 length); +FREERDP_LOCAL int rts_recv_out_of_sequence_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length); #include "rts_signature.h" diff --git a/libfreerdp/core/gateway/rts_signature.c b/libfreerdp/core/gateway/rts_signature.c index 365e8844f..d3b376d2d 100644 --- a/libfreerdp/core/gateway/rts_signature.c +++ b/libfreerdp/core/gateway/rts_signature.c @@ -23,196 +23,198 @@ #define TAG FREERDP_TAG("core.gateway.rts") -const RtsPduSignature RTS_PDU_CONN_A1_SIGNATURE = { RTS_FLAG_NONE, 4, +const RtsPduSignature RTS_PDU_CONN_A1_SIGNATURE = { + RTS_FLAG_NONE, + 4, { RTS_CMD_VERSION, RTS_CMD_COOKIE, RTS_CMD_COOKIE, RTS_CMD_RECEIVE_WINDOW_SIZE, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_CONN_A2_SIGNATURE = { RTS_FLAG_OUT_CHANNEL, 5, - { - RTS_CMD_VERSION, RTS_CMD_COOKIE, RTS_CMD_COOKIE, RTS_CMD_CHANNEL_LIFETIME, - RTS_CMD_RECEIVE_WINDOW_SIZE, 0, 0, 0 - } -}; -const RtsPduSignature RTS_PDU_CONN_A3_SIGNATURE = { RTS_FLAG_NONE, 1, - { RTS_CMD_CONNECTION_TIMEOUT, 0, 0, 0, 0, 0, 0, 0 } +const RtsPduSignature RTS_PDU_CONN_A2_SIGNATURE = { RTS_FLAG_OUT_CHANNEL, + 5, + { RTS_CMD_VERSION, RTS_CMD_COOKIE, + RTS_CMD_COOKIE, RTS_CMD_CHANNEL_LIFETIME, + RTS_CMD_RECEIVE_WINDOW_SIZE, 0, 0, 0 } }; +const RtsPduSignature RTS_PDU_CONN_A3_SIGNATURE = { + RTS_FLAG_NONE, 1, { RTS_CMD_CONNECTION_TIMEOUT, 0, 0, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_CONN_B1_SIGNATURE = { RTS_FLAG_NONE, 6, - { - RTS_CMD_VERSION, RTS_CMD_COOKIE, RTS_CMD_COOKIE, RTS_CMD_CHANNEL_LIFETIME, - RTS_CMD_CLIENT_KEEPALIVE, RTS_CMD_ASSOCIATION_GROUP_ID, 0, 0 - } +const RtsPduSignature RTS_PDU_CONN_B1_SIGNATURE = { + RTS_FLAG_NONE, + 6, + { RTS_CMD_VERSION, RTS_CMD_COOKIE, RTS_CMD_COOKIE, RTS_CMD_CHANNEL_LIFETIME, + RTS_CMD_CLIENT_KEEPALIVE, RTS_CMD_ASSOCIATION_GROUP_ID, 0, 0 } }; -const RtsPduSignature RTS_PDU_CONN_B2_SIGNATURE = { RTS_FLAG_IN_CHANNEL, 7, - { - RTS_CMD_VERSION, RTS_CMD_COOKIE, RTS_CMD_COOKIE, RTS_CMD_RECEIVE_WINDOW_SIZE, - RTS_CMD_CONNECTION_TIMEOUT, RTS_CMD_ASSOCIATION_GROUP_ID, RTS_CMD_CLIENT_ADDRESS, 0 - } +const RtsPduSignature RTS_PDU_CONN_B2_SIGNATURE = { + RTS_FLAG_IN_CHANNEL, + 7, + { RTS_CMD_VERSION, RTS_CMD_COOKIE, RTS_CMD_COOKIE, RTS_CMD_RECEIVE_WINDOW_SIZE, + RTS_CMD_CONNECTION_TIMEOUT, RTS_CMD_ASSOCIATION_GROUP_ID, RTS_CMD_CLIENT_ADDRESS, 0 } }; -const RtsPduSignature RTS_PDU_CONN_B3_SIGNATURE = { RTS_FLAG_NONE, 2, - { RTS_CMD_RECEIVE_WINDOW_SIZE, RTS_CMD_VERSION, 0, 0, 0, 0, 0, 0 } +const RtsPduSignature RTS_PDU_CONN_B3_SIGNATURE = { + RTS_FLAG_NONE, 2, { RTS_CMD_RECEIVE_WINDOW_SIZE, RTS_CMD_VERSION, 0, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_CONN_C1_SIGNATURE = { RTS_FLAG_NONE, 3, - { RTS_CMD_VERSION, RTS_CMD_RECEIVE_WINDOW_SIZE, RTS_CMD_CONNECTION_TIMEOUT, 0, 0, 0, 0, 0 } -}; -const RtsPduSignature RTS_PDU_CONN_C2_SIGNATURE = { RTS_FLAG_NONE, 3, - { RTS_CMD_VERSION, RTS_CMD_RECEIVE_WINDOW_SIZE, RTS_CMD_CONNECTION_TIMEOUT, 0, 0, 0, 0, 0 } -}; +const RtsPduSignature RTS_PDU_CONN_C1_SIGNATURE = { RTS_FLAG_NONE, + 3, + { RTS_CMD_VERSION, RTS_CMD_RECEIVE_WINDOW_SIZE, + RTS_CMD_CONNECTION_TIMEOUT, 0, 0, 0, 0, 0 } }; +const RtsPduSignature RTS_PDU_CONN_C2_SIGNATURE = { RTS_FLAG_NONE, + 3, + { RTS_CMD_VERSION, RTS_CMD_RECEIVE_WINDOW_SIZE, + RTS_CMD_CONNECTION_TIMEOUT, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_IN_R1_A1_SIGNATURE = { RTS_FLAG_RECYCLE_CHANNEL, 4, +const RtsPduSignature RTS_PDU_IN_R1_A1_SIGNATURE = { + RTS_FLAG_RECYCLE_CHANNEL, + 4, { RTS_CMD_VERSION, RTS_CMD_COOKIE, RTS_CMD_COOKIE, RTS_CMD_COOKIE, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_IN_R1_A2_SIGNATURE = { RTS_FLAG_NONE, 4, - { - RTS_CMD_VERSION, RTS_CMD_COOKIE, RTS_CMD_COOKIE, RTS_CMD_COOKIE, - RTS_CMD_RECEIVE_WINDOW_SIZE, RTS_CMD_CONNECTION_TIMEOUT, 0, 0 - } +const RtsPduSignature RTS_PDU_IN_R1_A2_SIGNATURE = { + RTS_FLAG_NONE, + 4, + { RTS_CMD_VERSION, RTS_CMD_COOKIE, RTS_CMD_COOKIE, RTS_CMD_COOKIE, RTS_CMD_RECEIVE_WINDOW_SIZE, + RTS_CMD_CONNECTION_TIMEOUT, 0, 0 } }; -const RtsPduSignature RTS_PDU_IN_R1_A3_SIGNATURE = { RTS_FLAG_NONE, 4, - { - RTS_CMD_DESTINATION, RTS_CMD_VERSION, RTS_CMD_RECEIVE_WINDOW_SIZE, - RTS_CMD_CONNECTION_TIMEOUT, 0, 0, 0, 0 - } -}; -const RtsPduSignature RTS_PDU_IN_R1_A4_SIGNATURE = { RTS_FLAG_NONE, 4, - { - RTS_CMD_DESTINATION, RTS_CMD_VERSION, RTS_CMD_RECEIVE_WINDOW_SIZE, - RTS_CMD_CONNECTION_TIMEOUT, 0, 0, 0, 0 - } -}; -const RtsPduSignature RTS_PDU_IN_R1_A5_SIGNATURE = { RTS_FLAG_NONE, 1, - { RTS_CMD_COOKIE, 0, 0, 0, 0, 0, 0, 0 } -}; -const RtsPduSignature RTS_PDU_IN_R1_A6_SIGNATURE = { RTS_FLAG_NONE, 1, - { RTS_CMD_COOKIE, 0, 0, 0, 0, 0, 0, 0 } +const RtsPduSignature RTS_PDU_IN_R1_A3_SIGNATURE = { RTS_FLAG_NONE, + 4, + { RTS_CMD_DESTINATION, RTS_CMD_VERSION, + RTS_CMD_RECEIVE_WINDOW_SIZE, + RTS_CMD_CONNECTION_TIMEOUT, 0, 0, 0, 0 } }; +const RtsPduSignature RTS_PDU_IN_R1_A4_SIGNATURE = { RTS_FLAG_NONE, + 4, + { RTS_CMD_DESTINATION, RTS_CMD_VERSION, + RTS_CMD_RECEIVE_WINDOW_SIZE, + RTS_CMD_CONNECTION_TIMEOUT, 0, 0, 0, 0 } }; +const RtsPduSignature RTS_PDU_IN_R1_A5_SIGNATURE = { RTS_FLAG_NONE, + 1, + { RTS_CMD_COOKIE, 0, 0, 0, 0, 0, 0, 0 } }; +const RtsPduSignature RTS_PDU_IN_R1_A6_SIGNATURE = { RTS_FLAG_NONE, + 1, + { RTS_CMD_COOKIE, 0, 0, 0, 0, 0, 0, 0 } }; + +const RtsPduSignature RTS_PDU_IN_R1_B1_SIGNATURE = { RTS_FLAG_NONE, + 1, + { RTS_CMD_EMPTY, 0, 0, 0, 0, 0, 0, 0 } }; +const RtsPduSignature RTS_PDU_IN_R1_B2_SIGNATURE = { + RTS_FLAG_NONE, 1, { RTS_CMD_RECEIVE_WINDOW_SIZE, 0, 0, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_IN_R1_B1_SIGNATURE = { RTS_FLAG_NONE, 1, - { RTS_CMD_EMPTY, 0, 0, 0, 0, 0, 0, 0 } -}; -const RtsPduSignature RTS_PDU_IN_R1_B2_SIGNATURE = { RTS_FLAG_NONE, 1, - { RTS_CMD_RECEIVE_WINDOW_SIZE, 0, 0, 0, 0, 0, 0, 0 } -}; - -const RtsPduSignature RTS_PDU_IN_R2_A1_SIGNATURE = { RTS_FLAG_RECYCLE_CHANNEL, 4, +const RtsPduSignature RTS_PDU_IN_R2_A1_SIGNATURE = { + RTS_FLAG_RECYCLE_CHANNEL, + 4, { RTS_CMD_VERSION, RTS_CMD_COOKIE, RTS_CMD_COOKIE, RTS_CMD_COOKIE, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_IN_R2_A2_SIGNATURE = { RTS_FLAG_NONE, 1, - { RTS_CMD_COOKIE, 0, 0, 0, 0, 0, 0, 0 } -}; -const RtsPduSignature RTS_PDU_IN_R2_A3_SIGNATURE = { RTS_FLAG_NONE, 1, - { RTS_CMD_DESTINATION, 0, 0, 0, 0, 0, 0, 0 } -}; -const RtsPduSignature RTS_PDU_IN_R2_A4_SIGNATURE = { RTS_FLAG_NONE, 1, - { RTS_CMD_DESTINATION, 0, 0, 0, 0, 0, 0, 0 } -}; -const RtsPduSignature RTS_PDU_IN_R2_A5_SIGNATURE = { RTS_FLAG_NONE, 1, - { RTS_CMD_COOKIE, 0, 0, 0, 0, 0, 0, 0 } -}; +const RtsPduSignature RTS_PDU_IN_R2_A2_SIGNATURE = { RTS_FLAG_NONE, + 1, + { RTS_CMD_COOKIE, 0, 0, 0, 0, 0, 0, 0 } }; +const RtsPduSignature RTS_PDU_IN_R2_A3_SIGNATURE = { RTS_FLAG_NONE, + 1, + { RTS_CMD_DESTINATION, 0, 0, 0, 0, 0, 0, 0 } }; +const RtsPduSignature RTS_PDU_IN_R2_A4_SIGNATURE = { RTS_FLAG_NONE, + 1, + { RTS_CMD_DESTINATION, 0, 0, 0, 0, 0, 0, 0 } }; +const RtsPduSignature RTS_PDU_IN_R2_A5_SIGNATURE = { RTS_FLAG_NONE, + 1, + { RTS_CMD_COOKIE, 0, 0, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_OUT_R1_A1_SIGNATURE = { RTS_FLAG_RECYCLE_CHANNEL, 1, - { RTS_CMD_DESTINATION, 0, 0, 0, 0, 0, 0, 0 } +const RtsPduSignature RTS_PDU_OUT_R1_A1_SIGNATURE = { + RTS_FLAG_RECYCLE_CHANNEL, 1, { RTS_CMD_DESTINATION, 0, 0, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_OUT_R1_A2_SIGNATURE = { RTS_FLAG_RECYCLE_CHANNEL, 1, - { RTS_CMD_DESTINATION, 0, 0, 0, 0, 0, 0, 0 } +const RtsPduSignature RTS_PDU_OUT_R1_A2_SIGNATURE = { + RTS_FLAG_RECYCLE_CHANNEL, 1, { RTS_CMD_DESTINATION, 0, 0, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_OUT_R1_A3_SIGNATURE = { RTS_FLAG_RECYCLE_CHANNEL, 5, - { - RTS_CMD_VERSION, RTS_CMD_COOKIE, RTS_CMD_COOKIE, RTS_CMD_COOKIE, - RTS_CMD_RECEIVE_WINDOW_SIZE, 0, 0, 0 - } +const RtsPduSignature RTS_PDU_OUT_R1_A3_SIGNATURE = { RTS_FLAG_RECYCLE_CHANNEL, + 5, + { RTS_CMD_VERSION, RTS_CMD_COOKIE, + RTS_CMD_COOKIE, RTS_CMD_COOKIE, + RTS_CMD_RECEIVE_WINDOW_SIZE, 0, 0, 0 } }; +const RtsPduSignature RTS_PDU_OUT_R1_A4_SIGNATURE = { + RTS_FLAG_RECYCLE_CHANNEL | RTS_FLAG_OUT_CHANNEL, + 7, + { RTS_CMD_VERSION, RTS_CMD_COOKIE, RTS_CMD_COOKIE, RTS_CMD_COOKIE, RTS_CMD_CHANNEL_LIFETIME, + RTS_CMD_RECEIVE_WINDOW_SIZE, RTS_CMD_CONNECTION_TIMEOUT, 0 } }; -const RtsPduSignature RTS_PDU_OUT_R1_A4_SIGNATURE = { RTS_FLAG_RECYCLE_CHANNEL | RTS_FLAG_OUT_CHANNEL, 7, - { - RTS_CMD_VERSION, RTS_CMD_COOKIE, RTS_CMD_COOKIE, RTS_CMD_COOKIE, RTS_CMD_CHANNEL_LIFETIME, - RTS_CMD_RECEIVE_WINDOW_SIZE, RTS_CMD_CONNECTION_TIMEOUT, 0 - } -}; -const RtsPduSignature RTS_PDU_OUT_R1_A5_SIGNATURE = { RTS_FLAG_OUT_CHANNEL, 3, +const RtsPduSignature RTS_PDU_OUT_R1_A5_SIGNATURE = { + RTS_FLAG_OUT_CHANNEL, + 3, { RTS_CMD_DESTINATION, RTS_CMD_VERSION, RTS_CMD_CONNECTION_TIMEOUT, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_OUT_R1_A6_SIGNATURE = { RTS_FLAG_OUT_CHANNEL, 3, +const RtsPduSignature RTS_PDU_OUT_R1_A6_SIGNATURE = { + RTS_FLAG_OUT_CHANNEL, + 3, { RTS_CMD_DESTINATION, RTS_CMD_VERSION, RTS_CMD_CONNECTION_TIMEOUT, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_OUT_R1_A7_SIGNATURE = { RTS_FLAG_OUT_CHANNEL, 2, - { RTS_CMD_DESTINATION, RTS_CMD_COOKIE, 0, 0, 0, 0, 0, 0 } +const RtsPduSignature RTS_PDU_OUT_R1_A7_SIGNATURE = { + RTS_FLAG_OUT_CHANNEL, 2, { RTS_CMD_DESTINATION, RTS_CMD_COOKIE, 0, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_OUT_R1_A8_SIGNATURE = { RTS_FLAG_OUT_CHANNEL, 2, - { RTS_CMD_DESTINATION, RTS_CMD_COOKIE, 0, 0, 0, 0, 0, 0 } +const RtsPduSignature RTS_PDU_OUT_R1_A8_SIGNATURE = { + RTS_FLAG_OUT_CHANNEL, 2, { RTS_CMD_DESTINATION, RTS_CMD_COOKIE, 0, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_OUT_R1_A9_SIGNATURE = { RTS_FLAG_NONE, 1, - { RTS_CMD_ANCE, 0, 0, 0, 0, 0, 0, 0 } +const RtsPduSignature RTS_PDU_OUT_R1_A9_SIGNATURE = { RTS_FLAG_NONE, + 1, + { RTS_CMD_ANCE, 0, 0, 0, 0, 0, 0, 0 } }; +const RtsPduSignature RTS_PDU_OUT_R1_A10_SIGNATURE = { RTS_FLAG_NONE, + 1, + { RTS_CMD_ANCE, 0, 0, 0, 0, 0, 0, 0 } }; +const RtsPduSignature RTS_PDU_OUT_R1_A11_SIGNATURE = { RTS_FLAG_NONE, + 1, + { RTS_CMD_ANCE, 0, 0, 0, 0, 0, 0, 0 } }; + +const RtsPduSignature RTS_PDU_OUT_R2_A1_SIGNATURE = { + RTS_FLAG_RECYCLE_CHANNEL, 1, { RTS_CMD_DESTINATION, 0, 0, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_OUT_R1_A10_SIGNATURE = { RTS_FLAG_NONE, 1, - { RTS_CMD_ANCE, 0, 0, 0, 0, 0, 0, 0 } +const RtsPduSignature RTS_PDU_OUT_R2_A2_SIGNATURE = { + RTS_FLAG_RECYCLE_CHANNEL, 1, { RTS_CMD_DESTINATION, 0, 0, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_OUT_R1_A11_SIGNATURE = { RTS_FLAG_NONE, 1, - { RTS_CMD_ANCE, 0, 0, 0, 0, 0, 0, 0 } +const RtsPduSignature RTS_PDU_OUT_R2_A3_SIGNATURE = { RTS_FLAG_RECYCLE_CHANNEL, + 5, + { RTS_CMD_VERSION, RTS_CMD_COOKIE, + RTS_CMD_COOKIE, RTS_CMD_COOKIE, + RTS_CMD_RECEIVE_WINDOW_SIZE, 0, 0, 0 } }; +const RtsPduSignature RTS_PDU_OUT_R2_A4_SIGNATURE = { RTS_FLAG_NONE, + 1, + { RTS_CMD_COOKIE, 0, 0, 0, 0, 0, 0, 0 } }; +const RtsPduSignature RTS_PDU_OUT_R2_A5_SIGNATURE = { + RTS_FLAG_NONE, 2, { RTS_CMD_DESTINATION, RTS_CMD_ANCE, 0, 0, 0, 0, 0, 0 } +}; +const RtsPduSignature RTS_PDU_OUT_R2_A6_SIGNATURE = { + RTS_FLAG_NONE, 2, { RTS_CMD_DESTINATION, RTS_CMD_ANCE, 0, 0, 0, 0, 0, 0 } +}; +const RtsPduSignature RTS_PDU_OUT_R2_A7_SIGNATURE = { + RTS_FLAG_NONE, 3, { RTS_CMD_DESTINATION, RTS_CMD_COOKIE, RTS_CMD_VERSION, 0, 0, 0, 0, 0 } +}; +const RtsPduSignature RTS_PDU_OUT_R2_A8_SIGNATURE = { + RTS_FLAG_OUT_CHANNEL, 2, { RTS_CMD_DESTINATION, RTS_CMD_COOKIE, 0, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_OUT_R2_A1_SIGNATURE = { RTS_FLAG_RECYCLE_CHANNEL, 1, - { RTS_CMD_DESTINATION, 0, 0, 0, 0, 0, 0, 0 } +const RtsPduSignature RTS_PDU_OUT_R2_B1_SIGNATURE = { RTS_FLAG_NONE, + 1, + { RTS_CMD_ANCE, 0, 0, 0, 0, 0, 0, 0 } }; +const RtsPduSignature RTS_PDU_OUT_R2_B2_SIGNATURE = { + RTS_FLAG_NONE, 1, { RTS_CMD_NEGATIVE_ANCE, 0, 0, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_OUT_R2_A2_SIGNATURE = { RTS_FLAG_RECYCLE_CHANNEL, 1, - { RTS_CMD_DESTINATION, 0, 0, 0, 0, 0, 0, 0 } +const RtsPduSignature RTS_PDU_OUT_R2_B3_SIGNATURE = { RTS_FLAG_EOF, + 1, + { RTS_CMD_ANCE, 0, 0, 0, 0, 0, 0, 0 } }; + +const RtsPduSignature RTS_PDU_OUT_R2_C1_SIGNATURE = { RTS_FLAG_PING, + 1, + { 0, 0, 0, 0, 0, 0, 0, 0 } }; + +const RtsPduSignature RTS_PDU_KEEP_ALIVE_SIGNATURE = { + RTS_FLAG_OTHER_CMD, 1, { RTS_CMD_CLIENT_KEEPALIVE, 0, 0, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_OUT_R2_A3_SIGNATURE = { RTS_FLAG_RECYCLE_CHANNEL, 5, - { - RTS_CMD_VERSION, RTS_CMD_COOKIE, RTS_CMD_COOKIE, RTS_CMD_COOKIE, - RTS_CMD_RECEIVE_WINDOW_SIZE, 0, 0, 0 - } +const RtsPduSignature RTS_PDU_PING_TRAFFIC_SENT_NOTIFY_SIGNATURE = { + RTS_FLAG_OTHER_CMD, 1, { RTS_CMD_PING_TRAFFIC_SENT_NOTIFY, 0, 0, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_OUT_R2_A4_SIGNATURE = { RTS_FLAG_NONE, 1, - { RTS_CMD_COOKIE, 0, 0, 0, 0, 0, 0, 0 } +const RtsPduSignature RTS_PDU_ECHO_SIGNATURE = { RTS_FLAG_ECHO, 0, { 0, 0, 0, 0, 0, 0, 0, 0 } }; +const RtsPduSignature RTS_PDU_PING_SIGNATURE = { RTS_FLAG_PING, 0, { 0, 0, 0, 0, 0, 0, 0, 0 } }; +const RtsPduSignature RTS_PDU_FLOW_CONTROL_ACK_SIGNATURE = { + RTS_FLAG_OTHER_CMD, 1, { RTS_CMD_FLOW_CONTROL_ACK, 0, 0, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_OUT_R2_A5_SIGNATURE = { RTS_FLAG_NONE, 2, - { RTS_CMD_DESTINATION, RTS_CMD_ANCE, 0, 0, 0, 0, 0, 0 } -}; -const RtsPduSignature RTS_PDU_OUT_R2_A6_SIGNATURE = { RTS_FLAG_NONE, 2, - { RTS_CMD_DESTINATION, RTS_CMD_ANCE, 0, 0, 0, 0, 0, 0 } -}; -const RtsPduSignature RTS_PDU_OUT_R2_A7_SIGNATURE = { RTS_FLAG_NONE, 3, - { RTS_CMD_DESTINATION, RTS_CMD_COOKIE, RTS_CMD_VERSION, 0, 0, 0, 0, 0 } -}; -const RtsPduSignature RTS_PDU_OUT_R2_A8_SIGNATURE = { RTS_FLAG_OUT_CHANNEL, 2, - { RTS_CMD_DESTINATION, RTS_CMD_COOKIE, 0, 0, 0, 0, 0, 0 } +const RtsPduSignature RTS_PDU_FLOW_CONTROL_ACK_WITH_DESTINATION_SIGNATURE = { + RTS_FLAG_OTHER_CMD, 2, { RTS_CMD_DESTINATION, RTS_CMD_FLOW_CONTROL_ACK, 0, 0, 0, 0, 0, 0 } }; -const RtsPduSignature RTS_PDU_OUT_R2_B1_SIGNATURE = { RTS_FLAG_NONE, 1, - { RTS_CMD_ANCE, 0, 0, 0, 0, 0, 0, 0 } -}; -const RtsPduSignature RTS_PDU_OUT_R2_B2_SIGNATURE = { RTS_FLAG_NONE, 1, - { RTS_CMD_NEGATIVE_ANCE, 0, 0, 0, 0, 0, 0, 0 } -}; -const RtsPduSignature RTS_PDU_OUT_R2_B3_SIGNATURE = { RTS_FLAG_EOF, 1, - { RTS_CMD_ANCE, 0, 0, 0, 0, 0, 0, 0 } -}; - -const RtsPduSignature RTS_PDU_OUT_R2_C1_SIGNATURE = { RTS_FLAG_PING, 1, - { 0, 0, 0, 0, 0, 0, 0, 0 } -}; - -const RtsPduSignature RTS_PDU_KEEP_ALIVE_SIGNATURE = { RTS_FLAG_OTHER_CMD, 1, - { RTS_CMD_CLIENT_KEEPALIVE, 0, 0, 0, 0, 0, 0, 0 } -}; -const RtsPduSignature RTS_PDU_PING_TRAFFIC_SENT_NOTIFY_SIGNATURE = { RTS_FLAG_OTHER_CMD, 1, - { RTS_CMD_PING_TRAFFIC_SENT_NOTIFY, 0, 0, 0, 0, 0, 0, 0 } -}; -const RtsPduSignature RTS_PDU_ECHO_SIGNATURE = { RTS_FLAG_ECHO, 0, - { 0, 0, 0, 0, 0, 0, 0, 0 } -}; -const RtsPduSignature RTS_PDU_PING_SIGNATURE = { RTS_FLAG_PING, 0, - { 0, 0, 0, 0, 0, 0, 0, 0 } -}; -const RtsPduSignature RTS_PDU_FLOW_CONTROL_ACK_SIGNATURE = { RTS_FLAG_OTHER_CMD, 1, - { RTS_CMD_FLOW_CONTROL_ACK, 0, 0, 0, 0, 0, 0, 0 } -}; -const RtsPduSignature RTS_PDU_FLOW_CONTROL_ACK_WITH_DESTINATION_SIGNATURE = { RTS_FLAG_OTHER_CMD, 2, - { RTS_CMD_DESTINATION, RTS_CMD_FLOW_CONTROL_ACK, 0, 0, 0, 0, 0, 0 } -}; - -static const RTS_PDU_SIGNATURE_ENTRY RTS_PDU_SIGNATURE_TABLE[] = -{ +static const RTS_PDU_SIGNATURE_ENTRY RTS_PDU_SIGNATURE_TABLE[] = { { RTS_PDU_CONN_A1, FALSE, &RTS_PDU_CONN_A1_SIGNATURE, "CONN/A1" }, { RTS_PDU_CONN_A2, FALSE, &RTS_PDU_CONN_A2_SIGNATURE, "CONN/A2" }, { RTS_PDU_CONN_A3, TRUE, &RTS_PDU_CONN_A3_SIGNATURE, "CONN/A3" }, @@ -268,17 +270,18 @@ static const RTS_PDU_SIGNATURE_ENTRY RTS_PDU_SIGNATURE_TABLE[] = { RTS_PDU_OUT_R2_C1, FALSE, &RTS_PDU_OUT_R2_C1_SIGNATURE, "OUT_R2/C1" }, { RTS_PDU_KEEP_ALIVE, TRUE, &RTS_PDU_KEEP_ALIVE_SIGNATURE, "Keep-Alive" }, - { RTS_PDU_PING_TRAFFIC_SENT_NOTIFY, TRUE, &RTS_PDU_PING_TRAFFIC_SENT_NOTIFY_SIGNATURE, "Ping Traffic Sent Notify" }, + { RTS_PDU_PING_TRAFFIC_SENT_NOTIFY, TRUE, &RTS_PDU_PING_TRAFFIC_SENT_NOTIFY_SIGNATURE, + "Ping Traffic Sent Notify" }, { RTS_PDU_ECHO, TRUE, &RTS_PDU_ECHO_SIGNATURE, "Echo" }, { RTS_PDU_PING, TRUE, &RTS_PDU_PING_SIGNATURE, "Ping" }, { RTS_PDU_FLOW_CONTROL_ACK, TRUE, &RTS_PDU_FLOW_CONTROL_ACK_SIGNATURE, "FlowControlAck" }, - { RTS_PDU_FLOW_CONTROL_ACK_WITH_DESTINATION, TRUE, &RTS_PDU_FLOW_CONTROL_ACK_WITH_DESTINATION_SIGNATURE, "FlowControlAckWithDestination" }, + { RTS_PDU_FLOW_CONTROL_ACK_WITH_DESTINATION, TRUE, + &RTS_PDU_FLOW_CONTROL_ACK_WITH_DESTINATION_SIGNATURE, "FlowControlAckWithDestination" }, { 0, FALSE, NULL, NULL } }; -BOOL rts_match_pdu_signature(const RtsPduSignature* signature, - const rpcconn_rts_hdr_t* rts) +BOOL rts_match_pdu_signature(const RtsPduSignature* signature, const rpcconn_rts_hdr_t* rts) { UINT16 i; int status; @@ -297,13 +300,13 @@ BOOL rts_match_pdu_signature(const RtsPduSignature* signature, if (rts->NumberOfCommands != signature->NumberOfCommands) return FALSE; - buffer = (const BYTE*) rts; + buffer = (const BYTE*)rts; offset = RTS_PDU_HEADER_LENGTH; length = rts->frag_length - offset; for (i = 0; i < rts->NumberOfCommands; i++) { - CommandType = *((UINT32*) &buffer[offset]); /* CommandType (4 bytes) */ + CommandType = *((UINT32*)&buffer[offset]); /* CommandType (4 bytes) */ offset += 4; if (CommandType != signature->CommandTypes[i]) @@ -314,7 +317,7 @@ BOOL rts_match_pdu_signature(const RtsPduSignature* signature, if (status < 0) return FALSE; - CommandLength = (UINT32) status; + CommandLength = (UINT32)status; offset += CommandLength; length = rts->frag_length - offset; } @@ -337,13 +340,13 @@ BOOL rts_extract_pdu_signature(RtsPduSignature* signature, const rpcconn_rts_hdr signature->Flags = rts->Flags; signature->NumberOfCommands = rts->NumberOfCommands; - buffer = (BYTE*) rts; + buffer = (BYTE*)rts; offset = RTS_PDU_HEADER_LENGTH; length = rts->frag_length - offset; for (i = 0; i < rts->NumberOfCommands; i++) { - CommandType = *((UINT32*) &buffer[offset]); /* CommandType (4 bytes) */ + CommandType = *((UINT32*)&buffer[offset]); /* CommandType (4 bytes) */ offset += 4; signature->CommandTypes[i] = CommandType; status = rts_command_length(CommandType, &buffer[offset], length); @@ -351,7 +354,7 @@ BOOL rts_extract_pdu_signature(RtsPduSignature* signature, const rpcconn_rts_hdr if (status < 0) return FALSE; - CommandLength = (UINT32) status; + CommandLength = (UINT32)status; offset += CommandLength; length = rts->frag_length - offset; } @@ -400,12 +403,12 @@ BOOL rts_print_pdu_signature(const RtsPduSignature* signature) if (!signature) return FALSE; - WLog_INFO(TAG, "RTS PDU Signature: Flags: 0x%04"PRIX16" NumberOfCommands: %"PRIu16"", + WLog_INFO(TAG, "RTS PDU Signature: Flags: 0x%04" PRIX16 " NumberOfCommands: %" PRIu16 "", signature->Flags, signature->NumberOfCommands); SignatureId = rts_identify_pdu_signature(signature, &entry); if (SignatureId) - WLog_ERR(TAG, "Identified %s RTS PDU", entry->PduName); + WLog_ERR(TAG, "Identified %s RTS PDU", entry->PduName); return TRUE; } diff --git a/libfreerdp/core/gateway/rts_signature.h b/libfreerdp/core/gateway/rts_signature.h index 5318a4491..2c43cdc1b 100644 --- a/libfreerdp/core/gateway/rts_signature.h +++ b/libfreerdp/core/gateway/rts_signature.h @@ -45,77 +45,77 @@ struct _RTS_PDU_SIGNATURE_ENTRY /* RTS PDU Signature IDs */ -#define RTS_PDU_CONN_A 0x10000000 -#define RTS_PDU_CONN_A1 (RTS_PDU_CONN_A | 0x00000001) -#define RTS_PDU_CONN_A2 (RTS_PDU_CONN_A | 0x00000002) -#define RTS_PDU_CONN_A3 (RTS_PDU_CONN_A | 0x00000003) +#define RTS_PDU_CONN_A 0x10000000 +#define RTS_PDU_CONN_A1 (RTS_PDU_CONN_A | 0x00000001) +#define RTS_PDU_CONN_A2 (RTS_PDU_CONN_A | 0x00000002) +#define RTS_PDU_CONN_A3 (RTS_PDU_CONN_A | 0x00000003) -#define RTS_PDU_CONN_B 0x20000000 -#define RTS_PDU_CONN_B1 (RTS_PDU_CONN_B | 0x00000001) -#define RTS_PDU_CONN_B2 (RTS_PDU_CONN_B | 0x00000002) -#define RTS_PDU_CONN_B3 (RTS_PDU_CONN_B | 0x00000003) +#define RTS_PDU_CONN_B 0x20000000 +#define RTS_PDU_CONN_B1 (RTS_PDU_CONN_B | 0x00000001) +#define RTS_PDU_CONN_B2 (RTS_PDU_CONN_B | 0x00000002) +#define RTS_PDU_CONN_B3 (RTS_PDU_CONN_B | 0x00000003) -#define RTS_PDU_CONN_C 0x40000000 -#define RTS_PDU_CONN_C1 (RTS_PDU_CONN_C | 0x00000001) -#define RTS_PDU_CONN_C2 (RTS_PDU_CONN_C | 0x00000002) +#define RTS_PDU_CONN_C 0x40000000 +#define RTS_PDU_CONN_C1 (RTS_PDU_CONN_C | 0x00000001) +#define RTS_PDU_CONN_C2 (RTS_PDU_CONN_C | 0x00000002) -#define RTS_PDU_IN_R1_A 0x01000000 -#define RTS_PDU_IN_R1_A1 (RTS_PDU_IN_R1_A | 0x00000001) -#define RTS_PDU_IN_R1_A2 (RTS_PDU_IN_R1_A | 0x00000002) -#define RTS_PDU_IN_R1_A3 (RTS_PDU_IN_R1_A | 0x00000003) -#define RTS_PDU_IN_R1_A4 (RTS_PDU_IN_R1_A | 0x00000004) -#define RTS_PDU_IN_R1_A5 (RTS_PDU_IN_R1_A | 0x00000005) -#define RTS_PDU_IN_R1_A6 (RTS_PDU_IN_R1_A | 0x00000006) +#define RTS_PDU_IN_R1_A 0x01000000 +#define RTS_PDU_IN_R1_A1 (RTS_PDU_IN_R1_A | 0x00000001) +#define RTS_PDU_IN_R1_A2 (RTS_PDU_IN_R1_A | 0x00000002) +#define RTS_PDU_IN_R1_A3 (RTS_PDU_IN_R1_A | 0x00000003) +#define RTS_PDU_IN_R1_A4 (RTS_PDU_IN_R1_A | 0x00000004) +#define RTS_PDU_IN_R1_A5 (RTS_PDU_IN_R1_A | 0x00000005) +#define RTS_PDU_IN_R1_A6 (RTS_PDU_IN_R1_A | 0x00000006) -#define RTS_PDU_IN_R1_B 0x02000000 -#define RTS_PDU_IN_R1_B1 (RTS_PDU_IN_R1_B | 0x00000001) -#define RTS_PDU_IN_R1_B2 (RTS_PDU_IN_R1_B | 0x00000002) +#define RTS_PDU_IN_R1_B 0x02000000 +#define RTS_PDU_IN_R1_B1 (RTS_PDU_IN_R1_B | 0x00000001) +#define RTS_PDU_IN_R1_B2 (RTS_PDU_IN_R1_B | 0x00000002) -#define RTS_PDU_IN_R2_A 0x04000000 -#define RTS_PDU_IN_R2_A1 (RTS_PDU_IN_R2_A | 0x00000001) -#define RTS_PDU_IN_R2_A2 (RTS_PDU_IN_R2_A | 0x00000002) -#define RTS_PDU_IN_R2_A3 (RTS_PDU_IN_R2_A | 0x00000003) -#define RTS_PDU_IN_R2_A4 (RTS_PDU_IN_R2_A | 0x00000004) -#define RTS_PDU_IN_R2_A5 (RTS_PDU_IN_R2_A | 0x00000005) +#define RTS_PDU_IN_R2_A 0x04000000 +#define RTS_PDU_IN_R2_A1 (RTS_PDU_IN_R2_A | 0x00000001) +#define RTS_PDU_IN_R2_A2 (RTS_PDU_IN_R2_A | 0x00000002) +#define RTS_PDU_IN_R2_A3 (RTS_PDU_IN_R2_A | 0x00000003) +#define RTS_PDU_IN_R2_A4 (RTS_PDU_IN_R2_A | 0x00000004) +#define RTS_PDU_IN_R2_A5 (RTS_PDU_IN_R2_A | 0x00000005) -#define RTS_PDU_OUT_R1_A 0x00100000 -#define RTS_PDU_OUT_R1_A1 (RTS_PDU_OUT_R1_A | 0x00000001) -#define RTS_PDU_OUT_R1_A2 (RTS_PDU_OUT_R1_A | 0x00000002) -#define RTS_PDU_OUT_R1_A3 (RTS_PDU_OUT_R1_A | 0x00000003) -#define RTS_PDU_OUT_R1_A4 (RTS_PDU_OUT_R1_A | 0x00000004) -#define RTS_PDU_OUT_R1_A5 (RTS_PDU_OUT_R1_A | 0x00000005) -#define RTS_PDU_OUT_R1_A6 (RTS_PDU_OUT_R1_A | 0x00000006) -#define RTS_PDU_OUT_R1_A7 (RTS_PDU_OUT_R1_A | 0x00000007) -#define RTS_PDU_OUT_R1_A8 (RTS_PDU_OUT_R1_A | 0x00000008) -#define RTS_PDU_OUT_R1_A9 (RTS_PDU_OUT_R1_A | 0x00000009) -#define RTS_PDU_OUT_R1_A10 (RTS_PDU_OUT_R1_A | 0x0000000A) -#define RTS_PDU_OUT_R1_A11 (RTS_PDU_OUT_R1_A | 0x0000000B) +#define RTS_PDU_OUT_R1_A 0x00100000 +#define RTS_PDU_OUT_R1_A1 (RTS_PDU_OUT_R1_A | 0x00000001) +#define RTS_PDU_OUT_R1_A2 (RTS_PDU_OUT_R1_A | 0x00000002) +#define RTS_PDU_OUT_R1_A3 (RTS_PDU_OUT_R1_A | 0x00000003) +#define RTS_PDU_OUT_R1_A4 (RTS_PDU_OUT_R1_A | 0x00000004) +#define RTS_PDU_OUT_R1_A5 (RTS_PDU_OUT_R1_A | 0x00000005) +#define RTS_PDU_OUT_R1_A6 (RTS_PDU_OUT_R1_A | 0x00000006) +#define RTS_PDU_OUT_R1_A7 (RTS_PDU_OUT_R1_A | 0x00000007) +#define RTS_PDU_OUT_R1_A8 (RTS_PDU_OUT_R1_A | 0x00000008) +#define RTS_PDU_OUT_R1_A9 (RTS_PDU_OUT_R1_A | 0x00000009) +#define RTS_PDU_OUT_R1_A10 (RTS_PDU_OUT_R1_A | 0x0000000A) +#define RTS_PDU_OUT_R1_A11 (RTS_PDU_OUT_R1_A | 0x0000000B) -#define RTS_PDU_OUT_R2_A 0x00200000 -#define RTS_PDU_OUT_R2_A1 (RTS_PDU_OUT_R2_A | 0x00000001) -#define RTS_PDU_OUT_R2_A2 (RTS_PDU_OUT_R2_A | 0x00000002) -#define RTS_PDU_OUT_R2_A3 (RTS_PDU_OUT_R2_A | 0x00000003) -#define RTS_PDU_OUT_R2_A4 (RTS_PDU_OUT_R2_A | 0x00000004) -#define RTS_PDU_OUT_R2_A5 (RTS_PDU_OUT_R2_A | 0x00000005) -#define RTS_PDU_OUT_R2_A6 (RTS_PDU_OUT_R2_A | 0x00000006) -#define RTS_PDU_OUT_R2_A7 (RTS_PDU_OUT_R2_A | 0x00000007) -#define RTS_PDU_OUT_R2_A8 (RTS_PDU_OUT_R2_A | 0x00000008) +#define RTS_PDU_OUT_R2_A 0x00200000 +#define RTS_PDU_OUT_R2_A1 (RTS_PDU_OUT_R2_A | 0x00000001) +#define RTS_PDU_OUT_R2_A2 (RTS_PDU_OUT_R2_A | 0x00000002) +#define RTS_PDU_OUT_R2_A3 (RTS_PDU_OUT_R2_A | 0x00000003) +#define RTS_PDU_OUT_R2_A4 (RTS_PDU_OUT_R2_A | 0x00000004) +#define RTS_PDU_OUT_R2_A5 (RTS_PDU_OUT_R2_A | 0x00000005) +#define RTS_PDU_OUT_R2_A6 (RTS_PDU_OUT_R2_A | 0x00000006) +#define RTS_PDU_OUT_R2_A7 (RTS_PDU_OUT_R2_A | 0x00000007) +#define RTS_PDU_OUT_R2_A8 (RTS_PDU_OUT_R2_A | 0x00000008) -#define RTS_PDU_OUT_R2_B 0x00400000 -#define RTS_PDU_OUT_R2_B1 (RTS_PDU_OUT_R2_B | 0x00000001) -#define RTS_PDU_OUT_R2_B2 (RTS_PDU_OUT_R2_B | 0x00000002) -#define RTS_PDU_OUT_R2_B3 (RTS_PDU_OUT_R2_B | 0x00000003) +#define RTS_PDU_OUT_R2_B 0x00400000 +#define RTS_PDU_OUT_R2_B1 (RTS_PDU_OUT_R2_B | 0x00000001) +#define RTS_PDU_OUT_R2_B2 (RTS_PDU_OUT_R2_B | 0x00000002) +#define RTS_PDU_OUT_R2_B3 (RTS_PDU_OUT_R2_B | 0x00000003) -#define RTS_PDU_OUT_R2_C 0x00800000 -#define RTS_PDU_OUT_R2_C1 (RTS_PDU_OUT_R2_C | 0x00000001) +#define RTS_PDU_OUT_R2_C 0x00800000 +#define RTS_PDU_OUT_R2_C1 (RTS_PDU_OUT_R2_C | 0x00000001) -#define RTS_PDU_OUT_OF_SEQUENCE 0x00010000 -#define RTS_PDU_KEEP_ALIVE (RTS_PDU_OUT_OF_SEQUENCE | 0x00000001) -#define RTS_PDU_PING_TRAFFIC_SENT_NOTIFY (RTS_PDU_OUT_OF_SEQUENCE | 0x00000002) -#define RTS_PDU_ECHO (RTS_PDU_OUT_OF_SEQUENCE | 0x00000003) -#define RTS_PDU_PING (RTS_PDU_OUT_OF_SEQUENCE | 0x00000004) -#define RTS_PDU_FLOW_CONTROL_ACK (RTS_PDU_OUT_OF_SEQUENCE | 0x00000005) -#define RTS_PDU_FLOW_CONTROL_ACK_WITH_DESTINATION (RTS_PDU_OUT_OF_SEQUENCE | 0x00000006) +#define RTS_PDU_OUT_OF_SEQUENCE 0x00010000 +#define RTS_PDU_KEEP_ALIVE (RTS_PDU_OUT_OF_SEQUENCE | 0x00000001) +#define RTS_PDU_PING_TRAFFIC_SENT_NOTIFY (RTS_PDU_OUT_OF_SEQUENCE | 0x00000002) +#define RTS_PDU_ECHO (RTS_PDU_OUT_OF_SEQUENCE | 0x00000003) +#define RTS_PDU_PING (RTS_PDU_OUT_OF_SEQUENCE | 0x00000004) +#define RTS_PDU_FLOW_CONTROL_ACK (RTS_PDU_OUT_OF_SEQUENCE | 0x00000005) +#define RTS_PDU_FLOW_CONTROL_ACK_WITH_DESTINATION (RTS_PDU_OUT_OF_SEQUENCE | 0x00000006) FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_CONN_A1_SIGNATURE; FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_CONN_A2_SIGNATURE; @@ -176,15 +176,14 @@ FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_PING_TRAFFIC_SENT_NOTIFY_SIGN FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_ECHO_SIGNATURE; FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_PING_SIGNATURE; FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_FLOW_CONTROL_ACK_SIGNATURE; -FREERDP_LOCAL extern const RtsPduSignature -RTS_PDU_FLOW_CONTROL_ACK_WITH_DESTINATION_SIGNATURE; +FREERDP_LOCAL extern const RtsPduSignature RTS_PDU_FLOW_CONTROL_ACK_WITH_DESTINATION_SIGNATURE; FREERDP_LOCAL BOOL rts_match_pdu_signature(const RtsPduSignature* signature, - const rpcconn_rts_hdr_t* rts); + const rpcconn_rts_hdr_t* rts); FREERDP_LOCAL BOOL rts_extract_pdu_signature(RtsPduSignature* signature, - const rpcconn_rts_hdr_t* rts); + const rpcconn_rts_hdr_t* rts); FREERDP_LOCAL UINT32 rts_identify_pdu_signature(const RtsPduSignature* signature, - const RTS_PDU_SIGNATURE_ENTRY** entry); + const RTS_PDU_SIGNATURE_ENTRY** entry); FREERDP_LOCAL BOOL rts_print_pdu_signature(const RtsPduSignature* signature); #endif /* FREERDP_LIB_CORE_GATEWAY_RTS_SIGNATURE_H */ diff --git a/libfreerdp/core/gateway/tsg.c b/libfreerdp/core/gateway/tsg.c index 106450e5f..91f851f15 100644 --- a/libfreerdp/core/gateway/tsg.c +++ b/libfreerdp/core/gateway/tsg.c @@ -61,8 +61,7 @@ typedef struct _TSG_CAPABILITY_NAP UINT32 capabilities; } TSG_CAPABILITY_NAP, *PTSG_CAPABILITY_NAP; -typedef union -{ +typedef union { TSG_CAPABILITY_NAP tsgCapNap; } TSG_CAPABILITIES_UNION, *PTSG_CAPABILITIES_UNION; @@ -115,7 +114,7 @@ typedef struct _TSG_PACKET_RESPONSE BYTE* responseData; UINT32 responseDataLen; TSG_REDIRECTION_FLAGS redirectionFlags; -} TSG_PACKET_RESPONSE, *PTSG_PACKET_RESPONSE; +} TSG_PACKET_RESPONSE, *PTSG_PACKET_RESPONSE; typedef struct _TSG_PACKET_QUARENC_RESPONSE { @@ -164,8 +163,7 @@ typedef struct _TSG_PACKET_AUTH BYTE* cookie; } TSG_PACKET_AUTH, *PTSG_PACKET_AUTH; -typedef union -{ +typedef union { PTSG_PACKET_VERSIONCAPS packetVersionCaps; PTSG_PACKET_AUTH packetAuth; } TSG_INITIAL_PACKET_TYPE_UNION, *PTSG_INITIAL_PACKET_TYPE_UNION; @@ -177,8 +175,7 @@ typedef struct TSG_PACKET_REAUTH TSG_INITIAL_PACKET_TYPE_UNION tsgInitialPacket; } TSG_PACKET_REAUTH, *PTSG_PACKET_REAUTH; -typedef union -{ +typedef union { PTSG_PACKET_HEADER packetHeader; PTSG_PACKET_VERSIONCAPS packetVersionCaps; PTSG_PACKET_QUARCONFIGREQUEST packetQuarConfigRequest; @@ -288,7 +285,7 @@ static int TsProxySendToServer(handle_t IDL_handle, const byte pRpcMessage[], UI UINT32 buffer3Length; UINT32 numBuffers = 0; UINT32 totalDataBytes = 0; - tsg = (rdpTsg*) IDL_handle; + tsg = (rdpTsg*)IDL_handle; buffer1Length = buffer2Length = buffer3Length = 0; if (count > 0) @@ -327,8 +324,8 @@ static int TsProxySendToServer(handle_t IDL_handle, const byte pRpcMessage[], UI /* PCHANNEL_CONTEXT_HANDLE_NOSERIALIZE_NR (20 bytes) */ Stream_Write(s, &tsg->ChannelContext.ContextType, 4); /* ContextType (4 bytes) */ Stream_Write(s, tsg->ChannelContext.ContextUuid, 16); /* ContextUuid (16 bytes) */ - Stream_Write_UINT32_BE(s, totalDataBytes); /* totalDataBytes (4 bytes) */ - Stream_Write_UINT32_BE(s, numBuffers); /* numBuffers (4 bytes) */ + Stream_Write_UINT32_BE(s, totalDataBytes); /* totalDataBytes (4 bytes) */ + Stream_Write_UINT32_BE(s, numBuffers); /* numBuffers (4 bytes) */ if (buffer1Length > 0) Stream_Write_UINT32_BE(s, buffer1Length); /* buffer1Length (4 bytes) */ @@ -386,88 +383,99 @@ static BOOL TsProxyCreateTunnelWriteRequest(rdpTsg* tsg, PTSG_PACKET tsgPacket) switch (tsgPacket->packetId) { case TSG_PACKET_TYPE_VERSIONCAPS: - { - PTSG_PACKET_VERSIONCAPS packetVersionCaps = tsgPacket->tsgPacket.packetVersionCaps; - PTSG_CAPABILITY_NAP tsgCapNap = &packetVersionCaps->tsgCaps->tsgPacket.tsgCapNap; - Stream_Write_UINT32(s, tsgPacket->packetId); /* PacketId (4 bytes) */ - Stream_Write_UINT32(s, tsgPacket->packetId); /* SwitchValue (4 bytes) */ - Stream_Write_UINT32(s, 0x00020000); /* PacketVersionCapsPtr (4 bytes) */ - Stream_Write_UINT16(s, packetVersionCaps->tsgHeader.ComponentId); /* ComponentId (2 bytes) */ - Stream_Write_UINT16(s, packetVersionCaps->tsgHeader.PacketId); /* PacketId (2 bytes) */ - Stream_Write_UINT32(s, 0x00020004); /* TsgCapsPtr (4 bytes) */ - Stream_Write_UINT32(s, packetVersionCaps->numCapabilities); /* NumCapabilities (4 bytes) */ - Stream_Write_UINT16(s, packetVersionCaps->majorVersion); /* MajorVersion (2 bytes) */ - Stream_Write_UINT16(s, packetVersionCaps->minorVersion); /* MinorVersion (2 bytes) */ - Stream_Write_UINT16(s, - packetVersionCaps->quarantineCapabilities); /* QuarantineCapabilities (2 bytes) */ - /* 4-byte alignment (30 + 2) */ - Stream_Write_UINT16(s, 0x0000); /* pad (2 bytes) */ - Stream_Write_UINT32(s, packetVersionCaps->numCapabilities); /* MaxCount (4 bytes) */ - Stream_Write_UINT32(s, packetVersionCaps->tsgCaps->capabilityType); /* CapabilityType (4 bytes) */ - Stream_Write_UINT32(s, packetVersionCaps->tsgCaps->capabilityType); /* SwitchValue (4 bytes) */ - Stream_Write_UINT32(s, tsgCapNap->capabilities); /* capabilities (4 bytes) */ - /** - * The following 60-byte structure is apparently undocumented, - * but parts of it can be matched to known C706 data structures. - */ - /* - * 8-byte constant (8A E3 13 71 02 F4 36 71) also observed here: - * http://lists.samba.org/archive/cifs-protocol/2010-July/001543.html - */ - Stream_Write_UINT8(s, 0x8A); - Stream_Write_UINT8(s, 0xE3); - Stream_Write_UINT8(s, 0x13); - Stream_Write_UINT8(s, 0x71); - Stream_Write_UINT8(s, 0x02); - Stream_Write_UINT8(s, 0xF4); - Stream_Write_UINT8(s, 0x36); - Stream_Write_UINT8(s, 0x71); - Stream_Write_UINT32(s, 0x00040001); /* 1.4 (version?) */ - Stream_Write_UINT32(s, 0x00000001); /* 1 (element count?) */ - /* p_cont_list_t */ - Stream_Write_UINT8(s, 2); /* ncontext_elem */ - Stream_Write_UINT8(s, 0x40); /* reserved1 */ - Stream_Write_UINT16(s, 0x0028); /* reserved2 */ - /* p_syntax_id_t */ - Stream_Write(s, &TSGU_UUID, sizeof(p_uuid_t)); - Stream_Write_UINT32(s, TSGU_SYNTAX_IF_VERSION); - /* p_syntax_id_t */ - Stream_Write(s, &NDR_UUID, sizeof(p_uuid_t)); - Stream_Write_UINT32(s, NDR_SYNTAX_IF_VERSION); - opnum = TsProxyCreateTunnelOpnum; - } - break; + { + PTSG_PACKET_VERSIONCAPS packetVersionCaps = tsgPacket->tsgPacket.packetVersionCaps; + PTSG_CAPABILITY_NAP tsgCapNap = &packetVersionCaps->tsgCaps->tsgPacket.tsgCapNap; + Stream_Write_UINT32(s, tsgPacket->packetId); /* PacketId (4 bytes) */ + Stream_Write_UINT32(s, tsgPacket->packetId); /* SwitchValue (4 bytes) */ + Stream_Write_UINT32(s, 0x00020000); /* PacketVersionCapsPtr (4 bytes) */ + Stream_Write_UINT16( + s, packetVersionCaps->tsgHeader.ComponentId); /* ComponentId (2 bytes) */ + Stream_Write_UINT16(s, packetVersionCaps->tsgHeader.PacketId); /* PacketId (2 bytes) */ + Stream_Write_UINT32(s, 0x00020004); /* TsgCapsPtr (4 bytes) */ + Stream_Write_UINT32(s, + packetVersionCaps->numCapabilities); /* NumCapabilities (4 bytes) */ + Stream_Write_UINT16(s, packetVersionCaps->majorVersion); /* MajorVersion (2 bytes) */ + Stream_Write_UINT16(s, packetVersionCaps->minorVersion); /* MinorVersion (2 bytes) */ + Stream_Write_UINT16( + s, + packetVersionCaps->quarantineCapabilities); /* QuarantineCapabilities (2 bytes) */ + /* 4-byte alignment (30 + 2) */ + Stream_Write_UINT16(s, 0x0000); /* pad (2 bytes) */ + Stream_Write_UINT32(s, packetVersionCaps->numCapabilities); /* MaxCount (4 bytes) */ + Stream_Write_UINT32( + s, packetVersionCaps->tsgCaps->capabilityType); /* CapabilityType (4 bytes) */ + Stream_Write_UINT32( + s, packetVersionCaps->tsgCaps->capabilityType); /* SwitchValue (4 bytes) */ + Stream_Write_UINT32(s, tsgCapNap->capabilities); /* capabilities (4 bytes) */ + /** + * The following 60-byte structure is apparently undocumented, + * but parts of it can be matched to known C706 data structures. + */ + /* + * 8-byte constant (8A E3 13 71 02 F4 36 71) also observed here: + * http://lists.samba.org/archive/cifs-protocol/2010-July/001543.html + */ + Stream_Write_UINT8(s, 0x8A); + Stream_Write_UINT8(s, 0xE3); + Stream_Write_UINT8(s, 0x13); + Stream_Write_UINT8(s, 0x71); + Stream_Write_UINT8(s, 0x02); + Stream_Write_UINT8(s, 0xF4); + Stream_Write_UINT8(s, 0x36); + Stream_Write_UINT8(s, 0x71); + Stream_Write_UINT32(s, 0x00040001); /* 1.4 (version?) */ + Stream_Write_UINT32(s, 0x00000001); /* 1 (element count?) */ + /* p_cont_list_t */ + Stream_Write_UINT8(s, 2); /* ncontext_elem */ + Stream_Write_UINT8(s, 0x40); /* reserved1 */ + Stream_Write_UINT16(s, 0x0028); /* reserved2 */ + /* p_syntax_id_t */ + Stream_Write(s, &TSGU_UUID, sizeof(p_uuid_t)); + Stream_Write_UINT32(s, TSGU_SYNTAX_IF_VERSION); + /* p_syntax_id_t */ + Stream_Write(s, &NDR_UUID, sizeof(p_uuid_t)); + Stream_Write_UINT32(s, NDR_SYNTAX_IF_VERSION); + opnum = TsProxyCreateTunnelOpnum; + } + break; case TSG_PACKET_TYPE_REAUTH: - { - PTSG_PACKET_REAUTH packetReauth = tsgPacket->tsgPacket.packetReauth; - PTSG_PACKET_VERSIONCAPS packetVersionCaps = packetReauth->tsgInitialPacket.packetVersionCaps; - PTSG_CAPABILITY_NAP tsgCapNap = &packetVersionCaps->tsgCaps->tsgPacket.tsgCapNap; - Stream_Write_UINT32(s, tsgPacket->packetId); /* PacketId (4 bytes) */ - Stream_Write_UINT32(s, tsgPacket->packetId); /* SwitchValue (4 bytes) */ - Stream_Write_UINT32(s, 0x00020000); /* PacketReauthPtr (4 bytes) */ - Stream_Write_UINT32(s, 0); /* ??? (4 bytes) */ - Stream_Write_UINT64(s, packetReauth->tunnelContext); /* TunnelContext (8 bytes) */ - Stream_Write_UINT32(s, TSG_PACKET_TYPE_VERSIONCAPS); /* PacketId (4 bytes) */ - Stream_Write_UINT32(s, TSG_PACKET_TYPE_VERSIONCAPS); /* SwitchValue (4 bytes) */ - Stream_Write_UINT32(s, 0x00020004); /* PacketVersionCapsPtr (4 bytes) */ - Stream_Write_UINT16(s, packetVersionCaps->tsgHeader.ComponentId); /* ComponentId (2 bytes) */ - Stream_Write_UINT16(s, packetVersionCaps->tsgHeader.PacketId); /* PacketId (2 bytes) */ - Stream_Write_UINT32(s, 0x00020008); /* TsgCapsPtr (4 bytes) */ - Stream_Write_UINT32(s, packetVersionCaps->numCapabilities); /* NumCapabilities (4 bytes) */ - Stream_Write_UINT16(s, packetVersionCaps->majorVersion); /* MajorVersion (2 bytes) */ - Stream_Write_UINT16(s, packetVersionCaps->minorVersion); /* MinorVersion (2 bytes) */ - Stream_Write_UINT16(s, - packetVersionCaps->quarantineCapabilities); /* QuarantineCapabilities (2 bytes) */ - /* 4-byte alignment (30 + 2) */ - Stream_Write_UINT16(s, 0x0000); /* pad (2 bytes) */ - Stream_Write_UINT32(s, packetVersionCaps->numCapabilities); /* MaxCount (4 bytes) */ - Stream_Write_UINT32(s, packetVersionCaps->tsgCaps->capabilityType); /* CapabilityType (4 bytes) */ - Stream_Write_UINT32(s, packetVersionCaps->tsgCaps->capabilityType); /* SwitchValue (4 bytes) */ - Stream_Write_UINT32(s, tsgCapNap->capabilities); /* capabilities (4 bytes) */ - opnum = TsProxyCreateTunnelOpnum; - } - break; + { + PTSG_PACKET_REAUTH packetReauth = tsgPacket->tsgPacket.packetReauth; + PTSG_PACKET_VERSIONCAPS packetVersionCaps = + packetReauth->tsgInitialPacket.packetVersionCaps; + PTSG_CAPABILITY_NAP tsgCapNap = &packetVersionCaps->tsgCaps->tsgPacket.tsgCapNap; + Stream_Write_UINT32(s, tsgPacket->packetId); /* PacketId (4 bytes) */ + Stream_Write_UINT32(s, tsgPacket->packetId); /* SwitchValue (4 bytes) */ + Stream_Write_UINT32(s, 0x00020000); /* PacketReauthPtr (4 bytes) */ + Stream_Write_UINT32(s, 0); /* ??? (4 bytes) */ + Stream_Write_UINT64(s, packetReauth->tunnelContext); /* TunnelContext (8 bytes) */ + Stream_Write_UINT32(s, TSG_PACKET_TYPE_VERSIONCAPS); /* PacketId (4 bytes) */ + Stream_Write_UINT32(s, TSG_PACKET_TYPE_VERSIONCAPS); /* SwitchValue (4 bytes) */ + Stream_Write_UINT32(s, 0x00020004); /* PacketVersionCapsPtr (4 bytes) */ + Stream_Write_UINT16( + s, packetVersionCaps->tsgHeader.ComponentId); /* ComponentId (2 bytes) */ + Stream_Write_UINT16(s, packetVersionCaps->tsgHeader.PacketId); /* PacketId (2 bytes) */ + Stream_Write_UINT32(s, 0x00020008); /* TsgCapsPtr (4 bytes) */ + Stream_Write_UINT32(s, + packetVersionCaps->numCapabilities); /* NumCapabilities (4 bytes) */ + Stream_Write_UINT16(s, packetVersionCaps->majorVersion); /* MajorVersion (2 bytes) */ + Stream_Write_UINT16(s, packetVersionCaps->minorVersion); /* MinorVersion (2 bytes) */ + Stream_Write_UINT16( + s, + packetVersionCaps->quarantineCapabilities); /* QuarantineCapabilities (2 bytes) */ + /* 4-byte alignment (30 + 2) */ + Stream_Write_UINT16(s, 0x0000); /* pad (2 bytes) */ + Stream_Write_UINT32(s, packetVersionCaps->numCapabilities); /* MaxCount (4 bytes) */ + Stream_Write_UINT32( + s, packetVersionCaps->tsgCaps->capabilityType); /* CapabilityType (4 bytes) */ + Stream_Write_UINT32( + s, packetVersionCaps->tsgCaps->capabilityType); /* SwitchValue (4 bytes) */ + Stream_Write_UINT32(s, tsgCapNap->capabilities); /* capabilities (4 bytes) */ + opnum = TsProxyCreateTunnelOpnum; + } + break; default: write = FALSE; @@ -484,8 +492,7 @@ static BOOL TsProxyCreateTunnelWriteRequest(rdpTsg* tsg, PTSG_PACKET tsgPacket) } static BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, - CONTEXT_HANDLE* tunnelContext, - UINT32* tunnelId) + CONTEXT_HANDLE* tunnelContext, UINT32* tunnelId) { BOOL rc = FALSE; UINT32 count; @@ -504,7 +511,7 @@ static BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, if (!pdu) return FALSE; - packet = (PTSG_PACKET) calloc(1, sizeof(TSG_PACKET)); + packet = (PTSG_PACKET)calloc(1, sizeof(TSG_PACKET)); if (!packet) return FALSE; @@ -512,14 +519,14 @@ static BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, if (Stream_GetRemainingLength(pdu->s) < 12) goto fail; - Stream_Seek_UINT32(pdu->s); /* PacketPtr (4 bytes) */ + Stream_Seek_UINT32(pdu->s); /* PacketPtr (4 bytes) */ Stream_Read_UINT32(pdu->s, packet->packetId); /* PacketId (4 bytes) */ - Stream_Read_UINT32(pdu->s, SwitchValue); /* SwitchValue (4 bytes) */ + Stream_Read_UINT32(pdu->s, SwitchValue); /* SwitchValue (4 bytes) */ if ((packet->packetId == TSG_PACKET_TYPE_CAPS_RESPONSE) && (SwitchValue == TSG_PACKET_TYPE_CAPS_RESPONSE)) { - packetCapsResponse = (PTSG_PACKET_CAPS_RESPONSE) calloc(1, sizeof(TSG_PACKET_CAPS_RESPONSE)); + packetCapsResponse = (PTSG_PACKET_CAPS_RESPONSE)calloc(1, sizeof(TSG_PACKET_CAPS_RESPONSE)); if (!packetCapsResponse) goto fail; @@ -530,11 +537,14 @@ static BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, goto fail; Stream_Seek_UINT32(pdu->s); /* PacketQuarResponsePtr (4 bytes) */ - Stream_Read_UINT32(pdu->s, packetCapsResponse->pktQuarEncResponse.flags); /* Flags (4 bytes) */ Stream_Read_UINT32(pdu->s, - packetCapsResponse->pktQuarEncResponse.certChainLen); /* CertChainLength (4 bytes) */ - Stream_Seek_UINT32(pdu->s); /* CertChainDataPtr (4 bytes) */ - Stream_Read(pdu->s, &packetCapsResponse->pktQuarEncResponse.nonce, 16); /* Nonce (16 bytes) */ + packetCapsResponse->pktQuarEncResponse.flags); /* Flags (4 bytes) */ + Stream_Read_UINT32( + pdu->s, + packetCapsResponse->pktQuarEncResponse.certChainLen); /* CertChainLength (4 bytes) */ + Stream_Seek_UINT32(pdu->s); /* CertChainDataPtr (4 bytes) */ + Stream_Read(pdu->s, &packetCapsResponse->pktQuarEncResponse.nonce, + 16); /* Nonce (16 bytes) */ Stream_Read_UINT32(pdu->s, Pointer); /* VersionCapsPtr (4 bytes) */ if ((Pointer == 0x0002000C) || (Pointer == 0x00020008)) @@ -542,9 +552,9 @@ static BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, if (Stream_GetRemainingLength(pdu->s) < 16) goto fail; - Stream_Seek_UINT32(pdu->s); /* MsgId (4 bytes) */ - Stream_Seek_UINT32(pdu->s); /* MsgType (4 bytes) */ - Stream_Read_UINT32(pdu->s, IsMessagePresent); /* IsMessagePresent (4 bytes) */ + Stream_Seek_UINT32(pdu->s); /* MsgId (4 bytes) */ + Stream_Seek_UINT32(pdu->s); /* MsgType (4 bytes) */ + Stream_Read_UINT32(pdu->s, IsMessagePresent); /* IsMessagePresent (4 bytes) */ Stream_Read_UINT32(pdu->s, MessageSwitchValue); /* MessageSwitchValue (4 bytes) */ } @@ -554,9 +564,9 @@ static BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, goto fail; Stream_Read_UINT32(pdu->s, Pointer); /* MsgPtr (4 bytes): 0x00020014 */ - Stream_Seek_UINT32(pdu->s); /* MaxCount (4 bytes) */ - Stream_Seek_UINT32(pdu->s); /* Offset (4 bytes) */ - Stream_Read_UINT32(pdu->s, count); /* ActualCount (4 bytes) */ + Stream_Seek_UINT32(pdu->s); /* MaxCount (4 bytes) */ + Stream_Seek_UINT32(pdu->s); /* Offset (4 bytes) */ + Stream_Read_UINT32(pdu->s, count); /* ActualCount (4 bytes) */ /* * CertChainData is a wide character string, and the count is @@ -578,7 +588,7 @@ static BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, Stream_Read_UINT32(pdu->s, Pointer); /* Ptr (4 bytes) */ } - versionCaps = (PTSG_PACKET_VERSIONCAPS) calloc(1, sizeof(TSG_PACKET_VERSIONCAPS)); + versionCaps = (PTSG_PACKET_VERSIONCAPS)calloc(1, sizeof(TSG_PACKET_VERSIONCAPS)); if (!versionCaps) goto fail; @@ -589,27 +599,27 @@ static BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, goto fail; Stream_Read_UINT16(pdu->s, versionCaps->tsgHeader.ComponentId); /* ComponentId (2 bytes) */ - Stream_Read_UINT16(pdu->s, versionCaps->tsgHeader.PacketId); /* PacketId (2 bytes) */ + Stream_Read_UINT16(pdu->s, versionCaps->tsgHeader.PacketId); /* PacketId (2 bytes) */ if (versionCaps->tsgHeader.ComponentId != TS_GATEWAY_TRANSPORT) { - WLog_ERR(TAG, "Unexpected ComponentId: 0x%04"PRIX16", Expected TS_GATEWAY_TRANSPORT", + WLog_ERR(TAG, "Unexpected ComponentId: 0x%04" PRIX16 ", Expected TS_GATEWAY_TRANSPORT", versionCaps->tsgHeader.ComponentId); goto fail; } - Stream_Read_UINT32(pdu->s, Pointer); /* TsgCapsPtr (4 bytes) */ + Stream_Read_UINT32(pdu->s, Pointer); /* TsgCapsPtr (4 bytes) */ Stream_Read_UINT32(pdu->s, versionCaps->numCapabilities); /* NumCapabilities (4 bytes) */ - Stream_Read_UINT16(pdu->s, versionCaps->majorVersion); /* MajorVersion (2 bytes) */ - Stream_Read_UINT16(pdu->s, versionCaps->minorVersion); /* MinorVersion (2 bytes) */ - Stream_Read_UINT16(pdu->s, - versionCaps->quarantineCapabilities); /* QuarantineCapabilities (2 bytes) */ + Stream_Read_UINT16(pdu->s, versionCaps->majorVersion); /* MajorVersion (2 bytes) */ + Stream_Read_UINT16(pdu->s, versionCaps->minorVersion); /* MinorVersion (2 bytes) */ + Stream_Read_UINT16( + pdu->s, versionCaps->quarantineCapabilities); /* QuarantineCapabilities (2 bytes) */ /* 4-byte alignment */ if (!tsg_stream_align(pdu->s, 4)) goto fail; - tsgCaps = (PTSG_PACKET_CAPABILITIES) calloc(1, sizeof(TSG_PACKET_CAPABILITIES)); + tsgCaps = (PTSG_PACKET_CAPABILITIES)calloc(1, sizeof(TSG_PACKET_CAPABILITIES)); if (!tsgCaps) goto fail; @@ -619,19 +629,21 @@ static BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, if (Stream_GetRemainingLength(pdu->s) < 16) goto fail; - Stream_Seek_UINT32(pdu->s); /* MaxCount (4 bytes) */ + Stream_Seek_UINT32(pdu->s); /* MaxCount (4 bytes) */ Stream_Read_UINT32(pdu->s, tsgCaps->capabilityType); /* CapabilityType (4 bytes) */ - Stream_Read_UINT32(pdu->s, SwitchValue); /* SwitchValue (4 bytes) */ + Stream_Read_UINT32(pdu->s, SwitchValue); /* SwitchValue (4 bytes) */ if ((SwitchValue != TSG_CAPABILITY_TYPE_NAP) || (tsgCaps->capabilityType != TSG_CAPABILITY_TYPE_NAP)) { - WLog_ERR(TAG, "Unexpected CapabilityType: 0x%08"PRIX32", Expected TSG_CAPABILITY_TYPE_NAP", + WLog_ERR(TAG, + "Unexpected CapabilityType: 0x%08" PRIX32 ", Expected TSG_CAPABILITY_TYPE_NAP", tsgCaps->capabilityType); goto fail; } - Stream_Read_UINT32(pdu->s, tsgCaps->tsgPacket.tsgCapNap.capabilities); /* Capabilities (4 bytes) */ + Stream_Read_UINT32(pdu->s, + tsgCaps->tsgPacket.tsgCapNap.capabilities); /* Capabilities (4 bytes) */ switch (MessageSwitchValue) { @@ -657,7 +669,7 @@ static BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, if (MsgBytes > TSG_MESSAGING_MAX_MESSAGE_LENGTH) { - WLog_ERR(TAG, "Out of Spec Message Length %"PRIu32"", MsgBytes); + WLog_ERR(TAG, "Out of Spec Message Length %" PRIu32 "", MsgBytes); goto fail; } @@ -667,19 +679,19 @@ static BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, break; case TSG_ASYNC_MESSAGE_REAUTH: - { - if (!tsg_stream_align(pdu->s, 8)) - goto fail; + { + if (!tsg_stream_align(pdu->s, 8)) + goto fail; - if (Stream_GetRemainingLength(pdu->s) < 8) - goto fail; + if (Stream_GetRemainingLength(pdu->s) < 8) + goto fail; - Stream_Seek_UINT64(pdu->s); /* TunnelContext (8 bytes) */ - } - break; + Stream_Seek_UINT64(pdu->s); /* TunnelContext (8 bytes) */ + } + break; default: - WLog_ERR(TAG, "Unexpected Message Type: 0x%"PRIX32"", MessageSwitchValue); + WLog_ERR(TAG, "Unexpected Message Type: 0x%" PRIX32 "", MessageSwitchValue); goto fail; } @@ -691,15 +703,15 @@ static BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, goto fail; Stream_Read_UINT32(pdu->s, tunnelContext->ContextType); /* ContextType (4 bytes) */ - Stream_Read(pdu->s, tunnelContext->ContextUuid, 16); /* ContextUuid (16 bytes) */ - Stream_Read_UINT32(pdu->s, *tunnelId); /* TunnelId (4 bytes) */ - /* ReturnValue (4 bytes) */ + Stream_Read(pdu->s, tunnelContext->ContextUuid, 16); /* ContextUuid (16 bytes) */ + Stream_Read_UINT32(pdu->s, *tunnelId); /* TunnelId (4 bytes) */ + /* ReturnValue (4 bytes) */ } else if ((packet->packetId == TSG_PACKET_TYPE_QUARENC_RESPONSE) && (SwitchValue == TSG_PACKET_TYPE_QUARENC_RESPONSE)) { - packetQuarEncResponse = (PTSG_PACKET_QUARENC_RESPONSE) calloc(1, - sizeof(TSG_PACKET_QUARENC_RESPONSE)); + packetQuarEncResponse = + (PTSG_PACKET_QUARENC_RESPONSE)calloc(1, sizeof(TSG_PACKET_QUARENC_RESPONSE)); if (!packetQuarEncResponse) goto fail; @@ -711,9 +723,10 @@ static BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, Stream_Seek_UINT32(pdu->s); /* PacketQuarResponsePtr (4 bytes) */ Stream_Read_UINT32(pdu->s, packetQuarEncResponse->flags); /* Flags (4 bytes) */ - Stream_Read_UINT32(pdu->s, packetQuarEncResponse->certChainLen); /* CertChainLength (4 bytes) */ - Stream_Seek_UINT32(pdu->s); /* CertChainDataPtr (4 bytes) */ - Stream_Read(pdu->s, &packetQuarEncResponse->nonce, 16); /* Nonce (16 bytes) */ + Stream_Read_UINT32(pdu->s, + packetQuarEncResponse->certChainLen); /* CertChainLength (4 bytes) */ + Stream_Seek_UINT32(pdu->s); /* CertChainDataPtr (4 bytes) */ + Stream_Read(pdu->s, &packetQuarEncResponse->nonce, 16); /* Nonce (16 bytes) */ if (packetQuarEncResponse->certChainLen > 0) { @@ -721,9 +734,9 @@ static BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, goto fail; Stream_Read_UINT32(pdu->s, Pointer); /* Ptr (4 bytes): 0x0002000C */ - Stream_Seek_UINT32(pdu->s); /* MaxCount (4 bytes) */ - Stream_Seek_UINT32(pdu->s); /* Offset (4 bytes) */ - Stream_Read_UINT32(pdu->s, count); /* ActualCount (4 bytes) */ + Stream_Seek_UINT32(pdu->s); /* MaxCount (4 bytes) */ + Stream_Seek_UINT32(pdu->s); /* Offset (4 bytes) */ + Stream_Read_UINT32(pdu->s, count); /* ActualCount (4 bytes) */ /* * CertChainData is a wide character string, and the count is @@ -745,7 +758,7 @@ static BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, Stream_Read_UINT32(pdu->s, Pointer); /* Ptr (4 bytes): 0x00020008 */ } - versionCaps = (PTSG_PACKET_VERSIONCAPS) calloc(1, sizeof(TSG_PACKET_VERSIONCAPS)); + versionCaps = (PTSG_PACKET_VERSIONCAPS)calloc(1, sizeof(TSG_PACKET_VERSIONCAPS)); if (!versionCaps) goto fail; @@ -756,21 +769,21 @@ static BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, goto fail; Stream_Read_UINT16(pdu->s, versionCaps->tsgHeader.ComponentId); /* ComponentId (2 bytes) */ - Stream_Read_UINT16(pdu->s, versionCaps->tsgHeader.PacketId); /* PacketId (2 bytes) */ + Stream_Read_UINT16(pdu->s, versionCaps->tsgHeader.PacketId); /* PacketId (2 bytes) */ if (versionCaps->tsgHeader.ComponentId != TS_GATEWAY_TRANSPORT) { - WLog_ERR(TAG, "Unexpected ComponentId: 0x%04"PRIX16", Expected TS_GATEWAY_TRANSPORT", + WLog_ERR(TAG, "Unexpected ComponentId: 0x%04" PRIX16 ", Expected TS_GATEWAY_TRANSPORT", versionCaps->tsgHeader.ComponentId); goto fail; } - Stream_Read_UINT32(pdu->s, Pointer); /* TsgCapsPtr (4 bytes) */ + Stream_Read_UINT32(pdu->s, Pointer); /* TsgCapsPtr (4 bytes) */ Stream_Read_UINT32(pdu->s, versionCaps->numCapabilities); /* NumCapabilities (4 bytes) */ - Stream_Read_UINT16(pdu->s, versionCaps->majorVersion); /* MajorVersion (2 bytes) */ - Stream_Read_UINT16(pdu->s, versionCaps->majorVersion); /* MinorVersion (2 bytes) */ - Stream_Read_UINT16(pdu->s, - versionCaps->quarantineCapabilities); /* QuarantineCapabilities (2 bytes) */ + Stream_Read_UINT16(pdu->s, versionCaps->majorVersion); /* MajorVersion (2 bytes) */ + Stream_Read_UINT16(pdu->s, versionCaps->majorVersion); /* MinorVersion (2 bytes) */ + Stream_Read_UINT16( + pdu->s, versionCaps->quarantineCapabilities); /* QuarantineCapabilities (2 bytes) */ /* 4-byte alignment */ if (!tsg_stream_align(pdu->s, 4)) @@ -786,12 +799,14 @@ static BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, Stream_Seek_UINT32(pdu->s); /* 0x00000002 (4 bytes) */ /* TunnelContext (20 bytes) */ Stream_Read_UINT32(pdu->s, tunnelContext->ContextType); /* ContextType (4 bytes) */ - Stream_Read(pdu->s, tunnelContext->ContextUuid, 16); /* ContextUuid (16 bytes) */ + Stream_Read(pdu->s, tunnelContext->ContextUuid, 16); /* ContextUuid (16 bytes) */ } else { - WLog_ERR(TAG, "Unexpected PacketId: 0x%08"PRIX32", Expected TSG_PACKET_TYPE_CAPS_RESPONSE " - "or TSG_PACKET_TYPE_QUARENC_RESPONSE", packet->packetId); + WLog_ERR(TAG, + "Unexpected PacketId: 0x%08" PRIX32 ", Expected TSG_PACKET_TYPE_CAPS_RESPONSE " + "or TSG_PACKET_TYPE_QUARENC_RESPONSE", + packet->packetId); goto fail; } @@ -837,20 +852,20 @@ static BOOL TsProxyAuthorizeTunnelWriteRequest(rdpTsg* tsg, CONTEXT_HANDLE* tunn /* TunnelContext (20 bytes) */ Stream_Write_UINT32(s, tunnelContext->ContextType); /* ContextType (4 bytes) */ - Stream_Write(s, &tunnelContext->ContextUuid, 16); /* ContextUuid (16 bytes) */ + Stream_Write(s, &tunnelContext->ContextUuid, 16); /* ContextUuid (16 bytes) */ /* 4-byte alignment */ Stream_Write_UINT32(s, TSG_PACKET_TYPE_QUARREQUEST); /* PacketId (4 bytes) */ Stream_Write_UINT32(s, TSG_PACKET_TYPE_QUARREQUEST); /* SwitchValue (4 bytes) */ - Stream_Write_UINT32(s, 0x00020000); /* PacketQuarRequestPtr (4 bytes) */ - Stream_Write_UINT32(s, 0x00000000); /* Flags (4 bytes) */ - Stream_Write_UINT32(s, 0x00020004); /* MachineNamePtr (4 bytes) */ - Stream_Write_UINT32(s, count); /* NameLength (4 bytes) */ - Stream_Write_UINT32(s, 0x00020008); /* DataPtr (4 bytes) */ - Stream_Write_UINT32(s, 0); /* DataLength (4 bytes) */ + Stream_Write_UINT32(s, 0x00020000); /* PacketQuarRequestPtr (4 bytes) */ + Stream_Write_UINT32(s, 0x00000000); /* Flags (4 bytes) */ + Stream_Write_UINT32(s, 0x00020004); /* MachineNamePtr (4 bytes) */ + Stream_Write_UINT32(s, count); /* NameLength (4 bytes) */ + Stream_Write_UINT32(s, 0x00020008); /* DataPtr (4 bytes) */ + Stream_Write_UINT32(s, 0); /* DataLength (4 bytes) */ /* MachineName */ - Stream_Write_UINT32(s, count); /* MaxCount (4 bytes) */ - Stream_Write_UINT32(s, 0); /* Offset (4 bytes) */ - Stream_Write_UINT32(s, count); /* ActualCount (4 bytes) */ + Stream_Write_UINT32(s, count); /* MaxCount (4 bytes) */ + Stream_Write_UINT32(s, 0); /* Offset (4 bytes) */ + Stream_Write_UINT32(s, count); /* ActualCount (4 bytes) */ Stream_Write_UTF16_String(s, tsg->MachineName, count); /* Array */ /* 4-byte alignment */ offset = Stream_GetPosition(s); @@ -875,7 +890,7 @@ static BOOL TsProxyAuthorizeTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu) if (!pdu) return FALSE; - packet = (PTSG_PACKET) calloc(1, sizeof(TSG_PACKET)); + packet = (PTSG_PACKET)calloc(1, sizeof(TSG_PACKET)); if (!packet) return FALSE; @@ -883,9 +898,9 @@ static BOOL TsProxyAuthorizeTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu) if (Stream_GetRemainingLength(pdu->s) < 68) goto fail; - Stream_Seek_UINT32(pdu->s); /* PacketPtr (4 bytes) */ + Stream_Seek_UINT32(pdu->s); /* PacketPtr (4 bytes) */ Stream_Read_UINT32(pdu->s, packet->packetId); /* PacketId (4 bytes) */ - Stream_Read_UINT32(pdu->s, SwitchValue); /* SwitchValue (4 bytes) */ + Stream_Read_UINT32(pdu->s, SwitchValue); /* SwitchValue (4 bytes) */ if (packet->packetId == E_PROXY_NAP_ACCESSDENIED) { @@ -896,52 +911,57 @@ static BOOL TsProxyAuthorizeTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu) if ((packet->packetId != TSG_PACKET_TYPE_RESPONSE) || (SwitchValue != TSG_PACKET_TYPE_RESPONSE)) { - WLog_ERR(TAG, "Unexpected PacketId: 0x%08"PRIX32", Expected TSG_PACKET_TYPE_RESPONSE", + WLog_ERR(TAG, "Unexpected PacketId: 0x%08" PRIX32 ", Expected TSG_PACKET_TYPE_RESPONSE", packet->packetId); goto fail; } - packetResponse = (PTSG_PACKET_RESPONSE) calloc(1, sizeof(TSG_PACKET_RESPONSE)); + packetResponse = (PTSG_PACKET_RESPONSE)calloc(1, sizeof(TSG_PACKET_RESPONSE)); if (!packetResponse) goto fail; packet->tsgPacket.packetResponse = packetResponse; - Stream_Read_UINT32(pdu->s, Pointer); /* PacketResponsePtr (4 bytes) */ + Stream_Read_UINT32(pdu->s, Pointer); /* PacketResponsePtr (4 bytes) */ Stream_Read_UINT32(pdu->s, packetResponse->flags); /* Flags (4 bytes) */ if (packetResponse->flags != TSG_PACKET_TYPE_QUARREQUEST) { WLog_ERR(TAG, - "Unexpected Packet Response Flags: 0x%08"PRIX32", Expected TSG_PACKET_TYPE_QUARREQUEST", + "Unexpected Packet Response Flags: 0x%08" PRIX32 + ", Expected TSG_PACKET_TYPE_QUARREQUEST", packetResponse->flags); goto fail; } - Stream_Seek_UINT32(pdu->s); /* Reserved (4 bytes) */ - Stream_Read_UINT32(pdu->s, Pointer); /* ResponseDataPtr (4 bytes) */ + Stream_Seek_UINT32(pdu->s); /* Reserved (4 bytes) */ + Stream_Read_UINT32(pdu->s, Pointer); /* ResponseDataPtr (4 bytes) */ Stream_Read_UINT32(pdu->s, packetResponse->responseDataLen); /* ResponseDataLength (4 bytes) */ + Stream_Read_UINT32(pdu->s, packetResponse->redirectionFlags + .enableAllRedirections); /* EnableAllRedirections (4 bytes) */ + Stream_Read_UINT32(pdu->s, packetResponse->redirectionFlags + .disableAllRedirections); /* DisableAllRedirections (4 bytes) */ Stream_Read_UINT32(pdu->s, - packetResponse->redirectionFlags.enableAllRedirections); /* EnableAllRedirections (4 bytes) */ + packetResponse->redirectionFlags + .driveRedirectionDisabled); /* DriveRedirectionDisabled (4 bytes) */ Stream_Read_UINT32(pdu->s, - packetResponse->redirectionFlags.disableAllRedirections); /* DisableAllRedirections (4 bytes) */ + packetResponse->redirectionFlags + .printerRedirectionDisabled); /* PrinterRedirectionDisabled (4 bytes) */ Stream_Read_UINT32(pdu->s, - packetResponse->redirectionFlags.driveRedirectionDisabled); /* DriveRedirectionDisabled (4 bytes) */ - Stream_Read_UINT32(pdu->s, - packetResponse->redirectionFlags.printerRedirectionDisabled); /* PrinterRedirectionDisabled (4 bytes) */ - Stream_Read_UINT32(pdu->s, - packetResponse->redirectionFlags.portRedirectionDisabled); /* PortRedirectionDisabled (4 bytes) */ + packetResponse->redirectionFlags + .portRedirectionDisabled); /* PortRedirectionDisabled (4 bytes) */ Stream_Read_UINT32(pdu->s, packetResponse->redirectionFlags.reserved); /* Reserved (4 bytes) */ - Stream_Read_UINT32(pdu->s, - packetResponse->redirectionFlags.clipboardRedirectionDisabled); /* ClipboardRedirectionDisabled (4 bytes) */ - Stream_Read_UINT32(pdu->s, - packetResponse->redirectionFlags.pnpRedirectionDisabled); /* PnpRedirectionDisabled (4 bytes) */ - Stream_Read_UINT32(pdu->s, SizeValue); /* (4 bytes) */ + Stream_Read_UINT32( + pdu->s, packetResponse->redirectionFlags + .clipboardRedirectionDisabled); /* ClipboardRedirectionDisabled (4 bytes) */ + Stream_Read_UINT32(pdu->s, packetResponse->redirectionFlags + .pnpRedirectionDisabled); /* PnpRedirectionDisabled (4 bytes) */ + Stream_Read_UINT32(pdu->s, SizeValue); /* (4 bytes) */ if (SizeValue != packetResponse->responseDataLen) { - WLog_ERR(TAG, "Unexpected size value: %"PRIu32", expected: %"PRIu32"", - SizeValue, packetResponse->responseDataLen); + WLog_ERR(TAG, "Unexpected size value: %" PRIu32 ", expected: %" PRIu32 "", SizeValue, + packetResponse->responseDataLen); goto fail; } @@ -972,7 +992,7 @@ fail: */ static BOOL TsProxyMakeTunnelCallWriteRequest(rdpTsg* tsg, CONTEXT_HANDLE* tunnelContext, - UINT32 procId) + UINT32 procId) { wStream* s; rdpRpc* rpc; @@ -989,13 +1009,13 @@ static BOOL TsProxyMakeTunnelCallWriteRequest(rdpTsg* tsg, CONTEXT_HANDLE* tunne /* TunnelContext (20 bytes) */ Stream_Write_UINT32(s, tunnelContext->ContextType); /* ContextType (4 bytes) */ - Stream_Write(s, tunnelContext->ContextUuid, 16); /* ContextUuid (16 bytes) */ - Stream_Write_UINT32(s, procId); /* ProcId (4 bytes) */ + Stream_Write(s, tunnelContext->ContextUuid, 16); /* ContextUuid (16 bytes) */ + Stream_Write_UINT32(s, procId); /* ProcId (4 bytes) */ /* 4-byte alignment */ Stream_Write_UINT32(s, TSG_PACKET_TYPE_MSGREQUEST_PACKET); /* PacketId (4 bytes) */ Stream_Write_UINT32(s, TSG_PACKET_TYPE_MSGREQUEST_PACKET); /* SwitchValue (4 bytes) */ - Stream_Write_UINT32(s, 0x00020000); /* PacketMsgRequestPtr (4 bytes) */ - Stream_Write_UINT32(s, 0x00000001); /* MaxMessagesPerBatch (4 bytes) */ + Stream_Write_UINT32(s, 0x00020000); /* PacketMsgRequestPtr (4 bytes) */ + Stream_Write_UINT32(s, 0x00000001); /* MaxMessagesPerBatch (4 bytes) */ return rpc_client_write_call(rpc, s, TsProxyMakeTunnelCallOpnum); } @@ -1008,14 +1028,14 @@ static BOOL TsProxyReadPacketSTringMessage(rdpTsg* tsg, wStream* s, TSG_PACKET_S if (Stream_GetRemainingLength(s) < 32) return FALSE; - Stream_Read_UINT32(s, Pointer); /* ConsentMessagePtr (4 bytes) */ + Stream_Read_UINT32(s, Pointer); /* ConsentMessagePtr (4 bytes) */ Stream_Read_INT32(s, msg->isDisplayMandatory); /* IsDisplayMandatory (4 bytes) */ Stream_Read_INT32(s, msg->isConsentMandatory); /* IsConsentMandatory (4 bytes) */ - Stream_Read_UINT32(s, msg->msgBytes); /* MsgBytes (4 bytes) */ - Stream_Read_UINT32(s, Pointer); /* MsgPtr (4 bytes) */ - Stream_Read_UINT32(s, MaxCount); /* MaxCount (4 bytes) */ - Stream_Seek_UINT32(s); /* Offset (4 bytes) */ - Stream_Read_UINT32(s, ActualCount); /* ActualCount (4 bytes) */ + Stream_Read_UINT32(s, msg->msgBytes); /* MsgBytes (4 bytes) */ + Stream_Read_UINT32(s, Pointer); /* MsgPtr (4 bytes) */ + Stream_Read_UINT32(s, MaxCount); /* MaxCount (4 bytes) */ + Stream_Seek_UINT32(s); /* Offset (4 bytes) */ + Stream_Read_UINT32(s, ActualCount); /* ActualCount (4 bytes) */ if (msg->msgBytes < ActualCount * 2) return FALSE; @@ -1049,21 +1069,22 @@ static BOOL TsProxyMakeTunnelCallReadResponse(rdpTsg* tsg, RPC_PDU* pdu) if (Stream_GetRemainingLength(pdu->s) < 28) goto fail; - Stream_Seek_UINT32(pdu->s); /* PacketPtr (4 bytes) */ + Stream_Seek_UINT32(pdu->s); /* PacketPtr (4 bytes) */ Stream_Read_UINT32(pdu->s, packet.packetId); /* PacketId (4 bytes) */ - Stream_Read_UINT32(pdu->s, SwitchValue); /* SwitchValue (4 bytes) */ + Stream_Read_UINT32(pdu->s, SwitchValue); /* SwitchValue (4 bytes) */ if ((packet.packetId != TSG_PACKET_TYPE_MESSAGE_PACKET) || (SwitchValue != TSG_PACKET_TYPE_MESSAGE_PACKET)) { - WLog_ERR(TAG, "Unexpected PacketId: 0x%08"PRIX32", Expected TSG_PACKET_TYPE_MESSAGE_PACKET", + WLog_ERR(TAG, + "Unexpected PacketId: 0x%08" PRIX32 ", Expected TSG_PACKET_TYPE_MESSAGE_PACKET", packet.packetId); goto fail; } - Stream_Read_UINT32(pdu->s, Pointer); /* PacketMsgResponsePtr (4 bytes) */ - Stream_Read_UINT32(pdu->s, packetMsgResponse.msgID); /* MsgId (4 bytes) */ - Stream_Read_UINT32(pdu->s, packetMsgResponse.msgType); /* MsgType (4 bytes) */ + Stream_Read_UINT32(pdu->s, Pointer); /* PacketMsgResponsePtr (4 bytes) */ + Stream_Read_UINT32(pdu->s, packetMsgResponse.msgID); /* MsgId (4 bytes) */ + Stream_Read_UINT32(pdu->s, packetMsgResponse.msgType); /* MsgType (4 bytes) */ Stream_Read_INT32(pdu->s, packetMsgResponse.isMsgPresent); /* IsMsgPresent (4 bytes) */ /* 2.2.9.2.1.9 TSG_PACKET_MSG_RESPONSE: Ignore empty message body. */ @@ -1081,8 +1102,8 @@ static BOOL TsProxyMakeTunnelCallReadResponse(rdpTsg* tsg, RPC_PDU* pdu) if (!TsProxyReadPacketSTringMessage(tsg, pdu->s, &packetStringMessage)) goto fail; - ConvertFromUnicode(CP_UTF8, 0, packetStringMessage.msgBuffer, packetStringMessage.msgBytes/2, &messageText, 0, NULL, - NULL); + ConvertFromUnicode(CP_UTF8, 0, packetStringMessage.msgBuffer, + packetStringMessage.msgBytes / 2, &messageText, 0, NULL, NULL); WLog_INFO(TAG, "Consent Message: %s", messageText); free(messageText); @@ -1093,8 +1114,7 @@ static BOOL TsProxyMakeTunnelCallReadResponse(rdpTsg* tsg, RPC_PDU* pdu) tsg->rpc->context->instance, SwitchValue, packetStringMessage.isDisplayMandatory != 0, packetStringMessage.isConsentMandatory != 0, - packetStringMessage.msgBytes, - packetStringMessage.msgBuffer); + packetStringMessage.msgBytes, packetStringMessage.msgBuffer); } break; @@ -1103,8 +1123,8 @@ static BOOL TsProxyMakeTunnelCallReadResponse(rdpTsg* tsg, RPC_PDU* pdu) if (!TsProxyReadPacketSTringMessage(tsg, pdu->s, &packetStringMessage)) goto fail; - ConvertFromUnicode(CP_UTF8, 0, packetStringMessage.msgBuffer, packetStringMessage.msgBytes/2, &messageText, 0, NULL, - NULL); + ConvertFromUnicode(CP_UTF8, 0, packetStringMessage.msgBuffer, + packetStringMessage.msgBytes / 2, &messageText, 0, NULL, NULL); WLog_INFO(TAG, "Service Message: %s", messageText); free(messageText); @@ -1115,8 +1135,7 @@ static BOOL TsProxyMakeTunnelCallReadResponse(rdpTsg* tsg, RPC_PDU* pdu) tsg->rpc->context->instance, SwitchValue, packetStringMessage.isDisplayMandatory != 0, packetStringMessage.isConsentMandatory != 0, - packetStringMessage.msgBytes, - packetStringMessage.msgBuffer); + packetStringMessage.msgBytes, packetStringMessage.msgBuffer); } break; @@ -1125,14 +1144,15 @@ static BOOL TsProxyMakeTunnelCallReadResponse(rdpTsg* tsg, RPC_PDU* pdu) goto fail; Stream_Read_UINT32(pdu->s, Pointer); /* ReauthMessagePtr (4 bytes) */ - Stream_Seek_UINT32(pdu->s); /* alignment pad (4 bytes) */ - Stream_Read_UINT64(pdu->s, packetReauthMessage.tunnelContext); /* TunnelContext (8 bytes) */ - Stream_Seek_UINT32(pdu->s); /* ReturnValue (4 bytes) */ + Stream_Seek_UINT32(pdu->s); /* alignment pad (4 bytes) */ + Stream_Read_UINT64(pdu->s, + packetReauthMessage.tunnelContext); /* TunnelContext (8 bytes) */ + Stream_Seek_UINT32(pdu->s); /* ReturnValue (4 bytes) */ tsg->ReauthTunnelContext = packetReauthMessage.tunnelContext; break; default: - WLog_ERR(TAG, "unexpected message type: %"PRIu32"", SwitchValue); + WLog_ERR(TAG, "unexpected message type: %" PRIu32 "", SwitchValue); goto fail; } @@ -1171,28 +1191,27 @@ static BOOL TsProxyCreateChannelWriteRequest(rdpTsg* tsg, CONTEXT_HANDLE* tunnel /* TunnelContext (20 bytes) */ Stream_Write_UINT32(s, tunnelContext->ContextType); /* ContextType (4 bytes) */ - Stream_Write(s, tunnelContext->ContextUuid, 16); /* ContextUuid (16 bytes) */ + Stream_Write(s, tunnelContext->ContextUuid, 16); /* ContextUuid (16 bytes) */ /* TSENDPOINTINFO */ Stream_Write_UINT32(s, 0x00020000); /* ResourceNamePtr (4 bytes) */ Stream_Write_UINT32(s, 0x00000001); /* NumResourceNames (4 bytes) */ Stream_Write_UINT32(s, 0x00000000); /* AlternateResourceNamesPtr (4 bytes) */ - Stream_Write_UINT16(s, 0x0000); /* NumAlternateResourceNames (2 bytes) */ - Stream_Write_UINT16(s, 0x0000); /* Pad (2 bytes) */ + Stream_Write_UINT16(s, 0x0000); /* NumAlternateResourceNames (2 bytes) */ + Stream_Write_UINT16(s, 0x0000); /* Pad (2 bytes) */ /* Port (4 bytes) */ - Stream_Write_UINT16(s, 0x0003); /* ProtocolId (RDP = 3) (2 bytes) */ - Stream_Write_UINT16(s, tsg->Port); /* PortNumber (0xD3D = 3389) (2 bytes) */ - Stream_Write_UINT32(s, 0x00000001); /* NumResourceNames (4 bytes) */ - Stream_Write_UINT32(s, 0x00020004); /* ResourceNamePtr (4 bytes) */ - Stream_Write_UINT32(s, count); /* MaxCount (4 bytes) */ - Stream_Write_UINT32(s, 0); /* Offset (4 bytes) */ - Stream_Write_UINT32(s, count); /* ActualCount (4 bytes) */ + Stream_Write_UINT16(s, 0x0003); /* ProtocolId (RDP = 3) (2 bytes) */ + Stream_Write_UINT16(s, tsg->Port); /* PortNumber (0xD3D = 3389) (2 bytes) */ + Stream_Write_UINT32(s, 0x00000001); /* NumResourceNames (4 bytes) */ + Stream_Write_UINT32(s, 0x00020004); /* ResourceNamePtr (4 bytes) */ + Stream_Write_UINT32(s, count); /* MaxCount (4 bytes) */ + Stream_Write_UINT32(s, 0); /* Offset (4 bytes) */ + Stream_Write_UINT32(s, count); /* ActualCount (4 bytes) */ Stream_Write_UTF16_String(s, tsg->Hostname, count); /* Array */ return rpc_client_write_call(rpc, s, TsProxyCreateChannelOpnum); } static BOOL TsProxyCreateChannelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, - CONTEXT_HANDLE* channelContext, - UINT32* channelId) + CONTEXT_HANDLE* channelContext, UINT32* channelId) { BOOL rc = FALSE; WLog_DBG(TAG, "TsProxyCreateChannelReadResponse"); @@ -1205,9 +1224,9 @@ static BOOL TsProxyCreateChannelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, /* ChannelContext (20 bytes) */ Stream_Read_UINT32(pdu->s, channelContext->ContextType); /* ContextType (4 bytes) */ - Stream_Read(pdu->s, channelContext->ContextUuid, 16); /* ContextUuid (16 bytes) */ - Stream_Read_UINT32(pdu->s, *channelId); /* ChannelId (4 bytes) */ - Stream_Seek_UINT32(pdu->s); /* ReturnValue (4 bytes) */ + Stream_Read(pdu->s, channelContext->ContextUuid, 16); /* ContextUuid (16 bytes) */ + Stream_Read_UINT32(pdu->s, *channelId); /* ChannelId (4 bytes) */ + Stream_Seek_UINT32(pdu->s); /* ReturnValue (4 bytes) */ rc = TRUE; fail: return rc; @@ -1236,7 +1255,7 @@ static BOOL TsProxyCloseChannelWriteRequest(rdpTsg* tsg, CONTEXT_HANDLE* context /* ChannelContext (20 bytes) */ Stream_Write_UINT32(s, context->ContextType); /* ContextType (4 bytes) */ - Stream_Write(s, context->ContextUuid, 16); /* ContextUuid (16 bytes) */ + Stream_Write(s, context->ContextUuid, 16); /* ContextUuid (16 bytes) */ return rpc_client_write_call(rpc, s, TsProxyCloseChannelOpnum); } @@ -1253,8 +1272,8 @@ static BOOL TsProxyCloseChannelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, CONTEXT_H /* ChannelContext (20 bytes) */ Stream_Read_UINT32(pdu->s, context->ContextType); /* ContextType (4 bytes) */ - Stream_Read(pdu->s, context->ContextUuid, 16); /* ContextUuid (16 bytes) */ - Stream_Seek_UINT32(pdu->s); /* ReturnValue (4 bytes) */ + Stream_Read(pdu->s, context->ContextUuid, 16); /* ContextUuid (16 bytes) */ + Stream_Seek_UINT32(pdu->s); /* ReturnValue (4 bytes) */ rc = TRUE; fail: return rc; @@ -1283,7 +1302,7 @@ static BOOL TsProxyCloseTunnelWriteRequest(rdpTsg* tsg, CONTEXT_HANDLE* context) /* TunnelContext (20 bytes) */ Stream_Write_UINT32(s, context->ContextType); /* ContextType (4 bytes) */ - Stream_Write(s, context->ContextUuid, 16); /* ContextUuid (16 bytes) */ + Stream_Write(s, context->ContextUuid, 16); /* ContextUuid (16 bytes) */ return rpc_client_write_call(rpc, s, TsProxyCloseTunnelOpnum); } @@ -1300,8 +1319,8 @@ static BOOL TsProxyCloseTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, CONTEXT_HA /* TunnelContext (20 bytes) */ Stream_Read_UINT32(pdu->s, context->ContextType); /* ContextType (4 bytes) */ - Stream_Read(pdu->s, context->ContextUuid, 16); /* ContextUuid (16 bytes) */ - Stream_Seek_UINT32(pdu->s); /* ReturnValue (4 bytes) */ + Stream_Read(pdu->s, context->ContextUuid, 16); /* ContextUuid (16 bytes) */ + Stream_Seek_UINT32(pdu->s); /* ReturnValue (4 bytes) */ rc = TRUE; fail: return rc; @@ -1332,11 +1351,10 @@ static BOOL TsProxySetupReceivePipeWriteRequest(rdpTsg* tsg, CONTEXT_HANDLE* cha /* ChannelContext (20 bytes) */ Stream_Write_UINT32(s, channelContext->ContextType); /* ContextType (4 bytes) */ - Stream_Write(s, channelContext->ContextUuid, 16); /* ContextUuid (16 bytes) */ + Stream_Write(s, channelContext->ContextUuid, 16); /* ContextUuid (16 bytes) */ return rpc_client_write_call(rpc, s, TsProxySetupReceivePipeOpnum); } - static BOOL tsg_transition_to_state(rdpTsg* tsg, TSG_STATE state) { const char* str = "TSG_STATE_UNKNOWN"; @@ -1406,14 +1424,12 @@ BOOL tsg_proxy_begin(rdpTsg* tsg) * TSG_PACKET_TYPE_QUARENC_RESPONSE instead of TSG_PACKET_TYPE_CAPS_RESPONSE * * However, reduced capabilities may break connectivity with servers enforcing features, such as - * "Only allow connections from Remote Desktop Services clients that support RD Gateway messaging" + * "Only allow connections from Remote Desktop Services clients that support RD Gateway + * messaging" */ - tsgCapNap->capabilities = - TSG_NAP_CAPABILITY_QUAR_SOH | - TSG_NAP_CAPABILITY_IDLE_TIMEOUT | - TSG_MESSAGING_CAP_CONSENT_SIGN | - TSG_MESSAGING_CAP_SERVICE_MSG | - TSG_MESSAGING_CAP_REAUTH; + tsgCapNap->capabilities = TSG_NAP_CAPABILITY_QUAR_SOH | TSG_NAP_CAPABILITY_IDLE_TIMEOUT | + TSG_MESSAGING_CAP_CONSENT_SIGN | TSG_MESSAGING_CAP_SERVICE_MSG | + TSG_MESSAGING_CAP_REAUTH; if (!TsProxyCreateTunnelWriteRequest(tsg, &tsgPacket)) { @@ -1454,7 +1470,8 @@ static BOOL tsg_proxy_reauth(rdpTsg* tsg) return FALSE; } - if (!TsProxyMakeTunnelCallWriteRequest(tsg, &tsg->TunnelContext, TSG_TUNNEL_CALL_ASYNC_MSG_REQUEST)) + if (!TsProxyMakeTunnelCallWriteRequest(tsg, &tsg->TunnelContext, + TSG_TUNNEL_CALL_ASYNC_MSG_REQUEST)) { WLog_ERR(TAG, "TsProxyMakeTunnelCall failure"); tsg_transition_to_state(tsg, TSG_STATE_FINAL); @@ -1486,61 +1503,62 @@ BOOL tsg_recv_pdu(rdpTsg* tsg, RPC_PDU* pdu) switch (tsg->state) { case TSG_STATE_INITIAL: + { + CONTEXT_HANDLE* TunnelContext; + TunnelContext = (tsg->reauthSequence) ? &tsg->NewTunnelContext : &tsg->TunnelContext; + + if (!TsProxyCreateTunnelReadResponse(tsg, pdu, TunnelContext, &tsg->TunnelId)) { - CONTEXT_HANDLE* TunnelContext; - TunnelContext = (tsg->reauthSequence) ? &tsg->NewTunnelContext : &tsg->TunnelContext; - - if (!TsProxyCreateTunnelReadResponse(tsg, pdu, TunnelContext, &tsg->TunnelId)) - { - WLog_ERR(TAG, "TsProxyCreateTunnelReadResponse failure"); - return FALSE; - } - - if (!tsg_transition_to_state(tsg, TSG_STATE_CONNECTED)) - return FALSE; - - if (!TsProxyAuthorizeTunnelWriteRequest(tsg, TunnelContext)) - { - WLog_ERR(TAG, "TsProxyAuthorizeTunnel failure"); - return FALSE; - } - - rc = TRUE; + WLog_ERR(TAG, "TsProxyCreateTunnelReadResponse failure"); + return FALSE; } - break; + + if (!tsg_transition_to_state(tsg, TSG_STATE_CONNECTED)) + return FALSE; + + if (!TsProxyAuthorizeTunnelWriteRequest(tsg, TunnelContext)) + { + WLog_ERR(TAG, "TsProxyAuthorizeTunnel failure"); + return FALSE; + } + + rc = TRUE; + } + break; case TSG_STATE_CONNECTED: + { + CONTEXT_HANDLE* TunnelContext; + TunnelContext = (tsg->reauthSequence) ? &tsg->NewTunnelContext : &tsg->TunnelContext; + + if (!TsProxyAuthorizeTunnelReadResponse(tsg, pdu)) { - CONTEXT_HANDLE* TunnelContext; - TunnelContext = (tsg->reauthSequence) ? &tsg->NewTunnelContext : &tsg->TunnelContext; - - if (!TsProxyAuthorizeTunnelReadResponse(tsg, pdu)) - { - WLog_ERR(TAG, "TsProxyAuthorizeTunnelReadResponse failure"); - return FALSE; - } - - if (!tsg_transition_to_state(tsg, TSG_STATE_AUTHORIZED)) - return FALSE; - - if (!tsg->reauthSequence) - { - if (!TsProxyMakeTunnelCallWriteRequest(tsg, TunnelContext, TSG_TUNNEL_CALL_ASYNC_MSG_REQUEST)) - { - WLog_ERR(TAG, "TsProxyMakeTunnelCall failure"); - return FALSE; - } - } - - if (!TsProxyCreateChannelWriteRequest(tsg, TunnelContext)) - { - WLog_ERR(TAG, "TsProxyCreateChannel failure"); - return FALSE; - } - - rc = TRUE; + WLog_ERR(TAG, "TsProxyAuthorizeTunnelReadResponse failure"); + return FALSE; } - break; + + if (!tsg_transition_to_state(tsg, TSG_STATE_AUTHORIZED)) + return FALSE; + + if (!tsg->reauthSequence) + { + if (!TsProxyMakeTunnelCallWriteRequest(tsg, TunnelContext, + TSG_TUNNEL_CALL_ASYNC_MSG_REQUEST)) + { + WLog_ERR(TAG, "TsProxyMakeTunnelCall failure"); + return FALSE; + } + } + + if (!TsProxyCreateChannelWriteRequest(tsg, TunnelContext)) + { + WLog_ERR(TAG, "TsProxyCreateChannel failure"); + return FALSE; + } + + rc = TRUE; + } + break; case TSG_STATE_AUTHORIZED: call = rpc_client_call_find_by_id(rpc->client, pdu->CallId); @@ -1604,7 +1622,7 @@ BOOL tsg_recv_pdu(rdpTsg* tsg, RPC_PDU* pdu) } else { - WLog_ERR(TAG, "TSG_STATE_AUTHORIZED unexpected OpNum: %"PRIu32"\n", call->OpNum); + WLog_ERR(TAG, "TSG_STATE_AUTHORIZED unexpected OpNum: %" PRIu32 "\n", call->OpNum); } break; @@ -1659,48 +1677,48 @@ BOOL tsg_recv_pdu(rdpTsg* tsg, RPC_PDU* pdu) break; case TSG_STATE_TUNNEL_CLOSE_PENDING: + { + CONTEXT_HANDLE ChannelContext; + + if (!TsProxyCloseChannelReadResponse(tsg, pdu, &ChannelContext)) { - CONTEXT_HANDLE ChannelContext; - - if (!TsProxyCloseChannelReadResponse(tsg, pdu, &ChannelContext)) - { - WLog_ERR(TAG, "TsProxyCloseChannelReadResponse failure"); - return FALSE; - } - - if (!tsg_transition_to_state(tsg, TSG_STATE_CHANNEL_CLOSE_PENDING)) - return FALSE; - - if (!TsProxyCloseChannelWriteRequest(tsg, NULL)) - { - WLog_ERR(TAG, "TsProxyCloseChannelWriteRequest failure"); - return FALSE; - } - - if (!TsProxyMakeTunnelCallWriteRequest(tsg, &tsg->TunnelContext, - TSG_TUNNEL_CANCEL_ASYNC_MSG_REQUEST)) - { - WLog_ERR(TAG, "TsProxyMakeTunnelCall failure"); - return FALSE; - } - - rc = TRUE; + WLog_ERR(TAG, "TsProxyCloseChannelReadResponse failure"); + return FALSE; } - break; + + if (!tsg_transition_to_state(tsg, TSG_STATE_CHANNEL_CLOSE_PENDING)) + return FALSE; + + if (!TsProxyCloseChannelWriteRequest(tsg, NULL)) + { + WLog_ERR(TAG, "TsProxyCloseChannelWriteRequest failure"); + return FALSE; + } + + if (!TsProxyMakeTunnelCallWriteRequest(tsg, &tsg->TunnelContext, + TSG_TUNNEL_CANCEL_ASYNC_MSG_REQUEST)) + { + WLog_ERR(TAG, "TsProxyMakeTunnelCall failure"); + return FALSE; + } + + rc = TRUE; + } + break; case TSG_STATE_CHANNEL_CLOSE_PENDING: + { + CONTEXT_HANDLE TunnelContext; + + if (!TsProxyCloseTunnelReadResponse(tsg, pdu, &TunnelContext)) { - CONTEXT_HANDLE TunnelContext; - - if (!TsProxyCloseTunnelReadResponse(tsg, pdu, &TunnelContext)) - { - WLog_ERR(TAG, "TsProxyCloseTunnelReadResponse failure"); - return FALSE; - } - - rc = tsg_transition_to_state(tsg, TSG_STATE_FINAL); + WLog_ERR(TAG, "TsProxyCloseTunnelReadResponse failure"); + return FALSE; } - break; + + rc = tsg_transition_to_state(tsg, TSG_STATE_FINAL); + } + break; case TSG_STATE_FINAL: break; @@ -1845,7 +1863,7 @@ BOOL tsg_connect(rdpTsg* tsg, const char* hostname, UINT16 port, int timeout) if (!tsg->bio) return FALSE; - BIO_set_data(tsg->bio, (void*) tsg); + BIO_set_data(tsg->bio, (void*)tsg); return TRUE; } @@ -1911,7 +1929,7 @@ static int tsg_read(rdpTsg* tsg, BYTE* data, UINT32 length) do { - status = rpc_client_receive_pipe_read(rpc->client, data, (size_t) length); + status = rpc_client_receive_pipe_read(rpc->client, data, (size_t)length); if (status < 0) return -1; @@ -1938,8 +1956,7 @@ static int tsg_read(rdpTsg* tsg, BYTE* data, UINT32 length) WaitForSingleObject(rpc->client->PipeEvent, 100); } } - } - while (rpc->transport->blocking); + } while (rpc->transport->blocking); return status; } @@ -1957,7 +1974,7 @@ static int tsg_write(rdpTsg* tsg, const BYTE* data, UINT32 length) return -1; } - status = TsProxySendToServer((handle_t) tsg, data, 1, &length); + status = TsProxySendToServer((handle_t)tsg, data, 1, &length); if (status < 0) return -1; @@ -1968,7 +1985,7 @@ static int tsg_write(rdpTsg* tsg, const BYTE* data, UINT32 length) rdpTsg* tsg_new(rdpTransport* transport) { rdpTsg* tsg; - tsg = (rdpTsg*) calloc(1, sizeof(rdpTsg)); + tsg = (rdpTsg*)calloc(1, sizeof(rdpTsg)); if (!tsg) return NULL; @@ -2000,9 +2017,9 @@ void tsg_free(rdpTsg* tsg) static int transport_bio_tsg_write(BIO* bio, const char* buf, int num) { int status; - rdpTsg* tsg = (rdpTsg*) BIO_get_data(bio); + rdpTsg* tsg = (rdpTsg*)BIO_get_data(bio); BIO_clear_flags(bio, BIO_FLAGS_WRITE); - status = tsg_write(tsg, (BYTE*) buf, num); + status = tsg_write(tsg, (BYTE*)buf, num); if (status < 0) { @@ -2025,7 +2042,7 @@ static int transport_bio_tsg_write(BIO* bio, const char* buf, int num) static int transport_bio_tsg_read(BIO* bio, char* buf, int size) { int status; - rdpTsg* tsg = (rdpTsg*) BIO_get_data(bio); + rdpTsg* tsg = (rdpTsg*)BIO_get_data(bio); if (!tsg || (size < 0)) { @@ -2034,7 +2051,7 @@ static int transport_bio_tsg_read(BIO* bio, char* buf, int size) } BIO_clear_flags(bio, BIO_FLAGS_READ); - status = tsg_read(tsg, (BYTE*) buf, size); + status = tsg_read(tsg, (BYTE*)buf, size); if (status < 0) { @@ -2067,7 +2084,7 @@ static int transport_bio_tsg_gets(BIO* bio, char* str, int size) static long transport_bio_tsg_ctrl(BIO* bio, int cmd, long arg1, void* arg2) { int status = -1; - rdpTsg* tsg = (rdpTsg*) BIO_get_data(bio); + rdpTsg* tsg = (rdpTsg*)BIO_get_data(bio); RpcVirtualConnection* connection = tsg->rpc->VirtualConnection; RpcInChannel* inChannel = connection->DefaultInChannel; RpcOutChannel* outChannel = connection->DefaultOutChannel; @@ -2083,7 +2100,7 @@ static long transport_bio_tsg_ctrl(BIO* bio, int cmd, long arg1, void* arg2) case BIO_C_GET_EVENT: if (arg2) { - *((HANDLE*) arg2) = tsg->rpc->client->PipeEvent; + *((HANDLE*)arg2) = tsg->rpc->client->PipeEvent; status = 1; } @@ -2094,46 +2111,46 @@ static long transport_bio_tsg_ctrl(BIO* bio, int cmd, long arg1, void* arg2) break; case BIO_C_READ_BLOCKED: - { - BIO* bio = outChannel->common.bio; - status = BIO_read_blocked(bio); - } - break; + { + BIO* bio = outChannel->common.bio; + status = BIO_read_blocked(bio); + } + break; case BIO_C_WRITE_BLOCKED: - { - BIO* bio = inChannel->common.bio; - status = BIO_write_blocked(bio); - } - break; + { + BIO* bio = inChannel->common.bio; + status = BIO_write_blocked(bio); + } + break; case BIO_C_WAIT_READ: - { - int timeout = (int) arg1; - BIO* bio = outChannel->common.bio; + { + int timeout = (int)arg1; + BIO* bio = outChannel->common.bio; - if (BIO_read_blocked(bio)) - return BIO_wait_read(bio, timeout); - else if (BIO_write_blocked(bio)) - return BIO_wait_write(bio, timeout); - else - status = 1; - } - break; + if (BIO_read_blocked(bio)) + return BIO_wait_read(bio, timeout); + else if (BIO_write_blocked(bio)) + return BIO_wait_write(bio, timeout); + else + status = 1; + } + break; case BIO_C_WAIT_WRITE: - { - int timeout = (int) arg1; - BIO* bio = inChannel->common.bio; + { + int timeout = (int)arg1; + BIO* bio = inChannel->common.bio; - if (BIO_write_blocked(bio)) - status = BIO_wait_write(bio, timeout); - else if (BIO_read_blocked(bio)) - status = BIO_wait_read(bio, timeout); - else - status = 1; - } - break; + if (BIO_write_blocked(bio)) + status = BIO_wait_write(bio, timeout); + else if (BIO_read_blocked(bio)) + status = BIO_wait_read(bio, timeout); + else + status = 1; + } + break; default: break; diff --git a/libfreerdp/core/gateway/tsg.h b/libfreerdp/core/gateway/tsg.h index cef0df98a..af9f88671 100644 --- a/libfreerdp/core/gateway/tsg.h +++ b/libfreerdp/core/gateway/tsg.h @@ -48,85 +48,83 @@ enum _TSG_STATE }; typedef enum _TSG_STATE TSG_STATE; -#define TsProxyCreateTunnelOpnum 1 -#define TsProxyAuthorizeTunnelOpnum 2 -#define TsProxyMakeTunnelCallOpnum 3 -#define TsProxyCreateChannelOpnum 4 -#define TsProxyUnused5Opnum 5 -#define TsProxyCloseChannelOpnum 6 -#define TsProxyCloseTunnelOpnum 7 -#define TsProxySetupReceivePipeOpnum 8 -#define TsProxySendToServerOpnum 9 +#define TsProxyCreateTunnelOpnum 1 +#define TsProxyAuthorizeTunnelOpnum 2 +#define TsProxyMakeTunnelCallOpnum 3 +#define TsProxyCreateChannelOpnum 4 +#define TsProxyUnused5Opnum 5 +#define TsProxyCloseChannelOpnum 6 +#define TsProxyCloseTunnelOpnum 7 +#define TsProxySetupReceivePipeOpnum 8 +#define TsProxySendToServerOpnum 9 -#define MAX_RESOURCE_NAMES 50 +#define MAX_RESOURCE_NAMES 50 -#define TS_GATEWAY_TRANSPORT 0x5452 +#define TS_GATEWAY_TRANSPORT 0x5452 -#define TSG_PACKET_TYPE_HEADER 0x00004844 -#define TSG_PACKET_TYPE_VERSIONCAPS 0x00005643 -#define TSG_PACKET_TYPE_QUARCONFIGREQUEST 0x00005143 -#define TSG_PACKET_TYPE_QUARREQUEST 0x00005152 -#define TSG_PACKET_TYPE_RESPONSE 0x00005052 -#define TSG_PACKET_TYPE_QUARENC_RESPONSE 0x00004552 -#define TSG_CAPABILITY_TYPE_NAP 0x00000001 -#define TSG_PACKET_TYPE_CAPS_RESPONSE 0x00004350 -#define TSG_PACKET_TYPE_MSGREQUEST_PACKET 0x00004752 -#define TSG_PACKET_TYPE_MESSAGE_PACKET 0x00004750 -#define TSG_PACKET_TYPE_AUTH 0x00004054 -#define TSG_PACKET_TYPE_REAUTH 0x00005250 +#define TSG_PACKET_TYPE_HEADER 0x00004844 +#define TSG_PACKET_TYPE_VERSIONCAPS 0x00005643 +#define TSG_PACKET_TYPE_QUARCONFIGREQUEST 0x00005143 +#define TSG_PACKET_TYPE_QUARREQUEST 0x00005152 +#define TSG_PACKET_TYPE_RESPONSE 0x00005052 +#define TSG_PACKET_TYPE_QUARENC_RESPONSE 0x00004552 +#define TSG_CAPABILITY_TYPE_NAP 0x00000001 +#define TSG_PACKET_TYPE_CAPS_RESPONSE 0x00004350 +#define TSG_PACKET_TYPE_MSGREQUEST_PACKET 0x00004752 +#define TSG_PACKET_TYPE_MESSAGE_PACKET 0x00004750 +#define TSG_PACKET_TYPE_AUTH 0x00004054 +#define TSG_PACKET_TYPE_REAUTH 0x00005250 -#define TSG_ASYNC_MESSAGE_CONSENT_MESSAGE 0x00000001 -#define TSG_ASYNC_MESSAGE_SERVICE_MESSAGE 0x00000002 -#define TSG_ASYNC_MESSAGE_REAUTH 0x00000003 +#define TSG_ASYNC_MESSAGE_CONSENT_MESSAGE 0x00000001 +#define TSG_ASYNC_MESSAGE_SERVICE_MESSAGE 0x00000002 +#define TSG_ASYNC_MESSAGE_REAUTH 0x00000003 -#define TSG_TUNNEL_CALL_ASYNC_MSG_REQUEST 0x00000001 -#define TSG_TUNNEL_CANCEL_ASYNC_MSG_REQUEST 0x00000002 +#define TSG_TUNNEL_CALL_ASYNC_MSG_REQUEST 0x00000001 +#define TSG_TUNNEL_CANCEL_ASYNC_MSG_REQUEST 0x00000002 -#define TSG_NAP_CAPABILITY_QUAR_SOH 0x00000001 -#define TSG_NAP_CAPABILITY_IDLE_TIMEOUT 0x00000002 -#define TSG_MESSAGING_CAP_CONSENT_SIGN 0x00000004 -#define TSG_MESSAGING_CAP_SERVICE_MSG 0x00000008 -#define TSG_MESSAGING_CAP_REAUTH 0x00000010 -#define TSG_MESSAGING_MAX_MESSAGE_LENGTH 65536 +#define TSG_NAP_CAPABILITY_QUAR_SOH 0x00000001 +#define TSG_NAP_CAPABILITY_IDLE_TIMEOUT 0x00000002 +#define TSG_MESSAGING_CAP_CONSENT_SIGN 0x00000004 +#define TSG_MESSAGING_CAP_SERVICE_MSG 0x00000008 +#define TSG_MESSAGING_CAP_REAUTH 0x00000010 +#define TSG_MESSAGING_MAX_MESSAGE_LENGTH 65536 /* Error Codes */ -#define E_PROXY_INTERNALERROR 0x800759D8 -#define E_PROXY_RAP_ACCESSDENIED 0x800759DA -#define E_PROXY_NAP_ACCESSDENIED 0x800759DB -#define E_PROXY_TS_CONNECTFAILED 0x800759DD -#define E_PROXY_ALREADYDISCONNECTED 0x800759DF -#define E_PROXY_QUARANTINE_ACCESSDENIED 0x800759ED -#define E_PROXY_NOCERTAVAILABLE 0x800759EE -#define E_PROXY_COOKIE_BADPACKET 0x800759F7 -#define E_PROXY_COOKIE_AUTHENTICATION_ACCESS_DENIED 0x800759F8 -#define E_PROXY_UNSUPPORTED_AUTHENTICATION_METHOD 0x800759F9 -#define E_PROXY_CAPABILITYMISMATCH 0x800759E9 +#define E_PROXY_INTERNALERROR 0x800759D8 +#define E_PROXY_RAP_ACCESSDENIED 0x800759DA +#define E_PROXY_NAP_ACCESSDENIED 0x800759DB +#define E_PROXY_TS_CONNECTFAILED 0x800759DD +#define E_PROXY_ALREADYDISCONNECTED 0x800759DF +#define E_PROXY_QUARANTINE_ACCESSDENIED 0x800759ED +#define E_PROXY_NOCERTAVAILABLE 0x800759EE +#define E_PROXY_COOKIE_BADPACKET 0x800759F7 +#define E_PROXY_COOKIE_AUTHENTICATION_ACCESS_DENIED 0x800759F8 +#define E_PROXY_UNSUPPORTED_AUTHENTICATION_METHOD 0x800759F9 +#define E_PROXY_CAPABILITYMISMATCH 0x800759E9 -#define E_PROXY_NOTSUPPORTED 0x000059E8 -#define E_PROXY_MAXCONNECTIONSREACHED 0x000059E6 -#define E_PROXY_SESSIONTIMEOUT 0x000059F6 -#define E_PROXY_REAUTH_AUTHN_FAILED 0x000059FA -#define E_PROXY_REAUTH_CAP_FAILED 0x000059FB -#define E_PROXY_REAUTH_RAP_FAILED 0x000059FC -#define E_PROXY_SDR_NOT_SUPPORTED_BY_TS 0x000059FD -#define E_PROXY_REAUTH_NAP_FAILED 0x00005A00 -#define E_PROXY_CONNECTIONABORTED 0x000004D4 +#define E_PROXY_NOTSUPPORTED 0x000059E8 +#define E_PROXY_MAXCONNECTIONSREACHED 0x000059E6 +#define E_PROXY_SESSIONTIMEOUT 0x000059F6 +#define E_PROXY_REAUTH_AUTHN_FAILED 0x000059FA +#define E_PROXY_REAUTH_CAP_FAILED 0x000059FB +#define E_PROXY_REAUTH_RAP_FAILED 0x000059FC +#define E_PROXY_SDR_NOT_SUPPORTED_BY_TS 0x000059FD +#define E_PROXY_REAUTH_NAP_FAILED 0x00005A00 +#define E_PROXY_CONNECTIONABORTED 0x000004D4 FREERDP_LOCAL rdpTsg* tsg_new(rdpTransport* transport); FREERDP_LOCAL void tsg_free(rdpTsg* tsg); FREERDP_LOCAL BOOL tsg_proxy_begin(rdpTsg* tsg); -FREERDP_LOCAL BOOL tsg_connect(rdpTsg* tsg, const char* hostname, UINT16 port, - int timeout); +FREERDP_LOCAL BOOL tsg_connect(rdpTsg* tsg, const char* hostname, UINT16 port, int timeout); FREERDP_LOCAL BOOL tsg_disconnect(rdpTsg* tsg); FREERDP_LOCAL BOOL tsg_recv_pdu(rdpTsg* tsg, RPC_PDU* pdu); FREERDP_LOCAL BOOL tsg_check_event_handles(rdpTsg* tsg); -FREERDP_LOCAL DWORD tsg_get_event_handles(rdpTsg* tsg, HANDLE* events, - DWORD count); +FREERDP_LOCAL DWORD tsg_get_event_handles(rdpTsg* tsg, HANDLE* events, DWORD count); FREERDP_LOCAL TSG_STATE tsg_get_state(rdpTsg* tsg); FREERDP_LOCAL BOOL tsg_set_state(rdpTsg* tsg, TSG_STATE state); diff --git a/libfreerdp/core/gcc.c b/libfreerdp/core/gcc.c index 347f5ce7b..4026c604b 100644 --- a/libfreerdp/core/gcc.c +++ b/libfreerdp/core/gcc.c @@ -51,7 +51,7 @@ static DWORD rdp_version_common(DWORD serverVersion, DWORD clientVersion) return version; default: - WLog_ERR(TAG, "Invalid client [%"PRId32"] and server [%"PRId32"] versions", + WLog_ERR(TAG, "Invalid client [%" PRId32 "] and server [%" PRId32 "] versions", serverVersion, clientVersion); return version; } @@ -201,12 +201,11 @@ BOOL gcc_read_conference_create_request(wStream* s, rdpMcs* mcs) return FALSE; /* UserData (SET OF SEQUENCE) */ - if (!per_read_number_of_sets(s, &number) - || number != 1) /* one set of UserData */ + if (!per_read_number_of_sets(s, &number) || number != 1) /* one set of UserData */ return FALSE; - if (!per_read_choice(s, &choice) - || choice != 0xC0) /* UserData::value present + select h221NonStandard (1) */ + if (!per_read_choice(s, &choice) || + choice != 0xC0) /* UserData::value present + select h221NonStandard (1) */ return FALSE; /* h221NonStandard */ @@ -237,24 +236,20 @@ BOOL gcc_read_conference_create_request(wStream* s, rdpMcs* mcs) void gcc_write_conference_create_request(wStream* s, wStream* userData) { /* ConnectData */ - per_write_choice(s, - 0); /* From Key select object (0) of type OBJECT_IDENTIFIER */ - per_write_object_identifier(s, - t124_02_98_oid); /* ITU-T T.124 (02/98) OBJECT_IDENTIFIER */ + per_write_choice(s, 0); /* From Key select object (0) of type OBJECT_IDENTIFIER */ + per_write_object_identifier(s, t124_02_98_oid); /* ITU-T T.124 (02/98) OBJECT_IDENTIFIER */ /* ConnectData::connectPDU (OCTET_STRING) */ per_write_length(s, Stream_GetPosition(userData) + 14); /* connectPDU length */ /* ConnectGCCPDU */ - per_write_choice(s, - 0); /* From ConnectGCCPDU select conferenceCreateRequest (0) of type ConferenceCreateRequest */ - per_write_selection(s, - 0x08); /* select optional userData from ConferenceCreateRequest */ + per_write_choice(s, 0); /* From ConnectGCCPDU select conferenceCreateRequest (0) of type + ConferenceCreateRequest */ + per_write_selection(s, 0x08); /* select optional userData from ConferenceCreateRequest */ /* ConferenceCreateRequest::conferenceName */ per_write_numeric_string(s, (BYTE*)"1", 1, 1); /* ConferenceName::numeric */ - per_write_padding(s, 1); /* padding */ + per_write_padding(s, 1); /* padding */ /* UserData (SET OF SEQUENCE) */ per_write_number_of_sets(s, 1); /* one set of UserData */ - per_write_choice(s, - 0xC0); /* UserData::value present + select h221NonStandard (1) */ + per_write_choice(s, 0xC0); /* UserData::value present + select h221NonStandard (1) */ /* h221NonStandard */ per_write_octet_string(s, h221_cs_key, 4, 4); /* h221NonStandard, client-to-server H.221 key, "Duca" */ @@ -273,8 +268,7 @@ BOOL gcc_read_conference_create_response(wStream* s, rdpMcs* mcs) BYTE number; /* ConnectData */ - if (!per_read_choice(s, &choice) || - !per_read_object_identifier(s, t124_02_98_oid)) + if (!per_read_choice(s, &choice) || !per_read_object_identifier(s, t124_02_98_oid)) return FALSE; /* ConnectData::connectPDU (OCTET_STRING) */ @@ -316,8 +310,7 @@ BOOL gcc_read_conference_create_response(wStream* s, rdpMcs* mcs) if (!gcc_read_server_data_blocks(s, mcs, length)) { - WLog_ERR(TAG, - "gcc_read_conference_create_response: gcc_read_server_data_blocks failed"); + WLog_ERR(TAG, "gcc_read_conference_create_response: gcc_read_server_data_blocks failed"); return FALSE; } @@ -420,7 +413,7 @@ BOOL gcc_read_client_data_blocks(wStream* s, rdpMcs* mcs, int length) break; default: - WLog_ERR(TAG, "Unknown GCC client data block: 0x%04"PRIX16"", type); + WLog_ERR(TAG, "Unknown GCC client data block: 0x%04" PRIX16 "", type); Stream_Seek(s, blockLength - 4); break; } @@ -430,7 +423,8 @@ BOOL gcc_read_client_data_blocks(wStream* s, rdpMcs* mcs, int length) if (endPos != (begPos + blockLength)) { WLog_ERR(TAG, - "Error parsing GCC client data block 0x%04"PRIX16": Actual Offset: %d Expected Offset: %d", + "Error parsing GCC client data block 0x%04" PRIX16 + ": Actual Offset: %d Expected Offset: %d", type, endPos, begPos + blockLength); } @@ -466,20 +460,17 @@ void gcc_write_client_data_blocks(wStream* s, rdpMcs* mcs) { if (settings->UseMultimon && !settings->SpanMonitors) { - WLog_ERR(TAG, - "WARNING: true multi monitor support was not advertised by server!"); + WLog_ERR(TAG, "WARNING: true multi monitor support was not advertised by server!"); if (settings->ForceMultimon) { - WLog_ERR(TAG, - "Sending multi monitor information anyway (may break connectivity!)"); + WLog_ERR(TAG, "Sending multi monitor information anyway (may break connectivity!)"); gcc_write_client_monitor_data(s, mcs); gcc_write_client_monitor_extended_data(s, mcs); } else { - WLog_ERR(TAG, - "Use /multimon:force to force sending multi monitor information"); + WLog_ERR(TAG, "Use /multimon:force to force sending multi monitor information"); } } } @@ -498,7 +489,7 @@ BOOL gcc_read_server_data_blocks(wStream* s, rdpMcs* mcs, int length) if (!gcc_read_user_data_header(s, &type, &blockLength)) { - WLog_ERR(TAG, "gcc_read_server_data_blocks: gcc_read_user_data_header failed"); + WLog_ERR(TAG, "gcc_read_server_data_blocks: gcc_read_user_data_header failed"); return FALSE; } @@ -507,7 +498,7 @@ BOOL gcc_read_server_data_blocks(wStream* s, rdpMcs* mcs, int length) case SC_CORE: if (!gcc_read_server_core_data(s, mcs)) { - WLog_ERR(TAG, "gcc_read_server_data_blocks: gcc_read_server_core_data failed"); + WLog_ERR(TAG, "gcc_read_server_data_blocks: gcc_read_server_core_data failed"); return FALSE; } @@ -536,8 +527,9 @@ BOOL gcc_read_server_data_blocks(wStream* s, rdpMcs* mcs, int length) case SC_MCS_MSGCHANNEL: if (!gcc_read_server_message_channel_data(s, mcs)) { - WLog_ERR(TAG, - "gcc_read_server_data_blocks: gcc_read_server_message_channel_data failed"); + WLog_ERR( + TAG, + "gcc_read_server_data_blocks: gcc_read_server_message_channel_data failed"); return FALSE; } @@ -546,15 +538,15 @@ BOOL gcc_read_server_data_blocks(wStream* s, rdpMcs* mcs, int length) case SC_MULTITRANSPORT: if (!gcc_read_server_multitransport_channel_data(s, mcs)) { - WLog_ERR(TAG, - "gcc_read_server_data_blocks: gcc_read_server_multitransport_channel_data failed"); + WLog_ERR(TAG, "gcc_read_server_data_blocks: " + "gcc_read_server_multitransport_channel_data failed"); return FALSE; } break; default: - WLog_ERR(TAG, "gcc_read_server_data_blocks: ignoring type=%"PRIu16"", type); + WLog_ERR(TAG, "gcc_read_server_data_blocks: ignoring type=%" PRIu16 "", type); break; } @@ -567,12 +559,13 @@ BOOL gcc_read_server_data_blocks(wStream* s, rdpMcs* mcs, int length) BOOL gcc_write_server_data_blocks(wStream* s, rdpMcs* mcs) { - return gcc_write_server_core_data(s, mcs) && /* serverCoreData */ - gcc_write_server_network_data(s, mcs) && /* serverNetworkData */ - gcc_write_server_security_data(s, mcs) && /* serverSecurityData */ + return gcc_write_server_core_data(s, mcs) && /* serverCoreData */ + gcc_write_server_network_data(s, mcs) && /* serverNetworkData */ + gcc_write_server_security_data(s, mcs) && /* serverSecurityData */ gcc_write_server_message_channel_data(s, mcs); /* serverMessageChannelData */ /* TODO: Send these GCC data blocks only when the client sent them */ - //gcc_write_server_multitransport_channel_data(s, settings); /* serverMultitransportChannelData */ + // gcc_write_server_multitransport_channel_data(s, settings); /* serverMultitransportChannelData + // */ } BOOL gcc_read_user_data_header(wStream* s, UINT16* type, UINT16* length) @@ -580,7 +573,7 @@ BOOL gcc_read_user_data_header(wStream* s, UINT16* type, UINT16* length) if (Stream_GetRemainingLength(s) < 4) return FALSE; - Stream_Read_UINT16(s, *type); /* type */ + Stream_Read_UINT16(s, *type); /* type */ Stream_Read_UINT16(s, *length); /* length */ if (Stream_GetRemainingLength(s) < (size_t)(*length - 4)) @@ -599,7 +592,7 @@ BOOL gcc_read_user_data_header(wStream* s, UINT16* type, UINT16* length) void gcc_write_user_data_header(wStream* s, UINT16 type, UINT16 length) { - Stream_Write_UINT16(s, type); /* type */ + Stream_Write_UINT16(s, type); /* type */ Stream_Write_UINT16(s, length); /* length */ } @@ -630,16 +623,15 @@ BOOL gcc_read_client_core_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) Stream_Read_UINT32(s, version); /* version (4 bytes) */ settings->RdpVersion = rdp_version_common(version, settings->RdpVersion); - Stream_Read_UINT16(s, settings->DesktopWidth); /* DesktopWidth (2 bytes) */ + Stream_Read_UINT16(s, settings->DesktopWidth); /* DesktopWidth (2 bytes) */ Stream_Read_UINT16(s, settings->DesktopHeight); /* DesktopHeight (2 bytes) */ - Stream_Read_UINT16(s, colorDepth); /* ColorDepth (2 bytes) */ + Stream_Read_UINT16(s, colorDepth); /* ColorDepth (2 bytes) */ Stream_Seek_UINT16(s); /* SASSequence (Secure Access Sequence) (2 bytes) */ Stream_Read_UINT32(s, settings->KeyboardLayout); /* KeyboardLayout (4 bytes) */ - Stream_Read_UINT32(s, settings->ClientBuild); /* ClientBuild (4 bytes) */ + Stream_Read_UINT32(s, settings->ClientBuild); /* ClientBuild (4 bytes) */ /* clientName (32 bytes, null-terminated unicode, truncated to 15 characters) */ - if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) Stream_Pointer(s), 32 / 2, - &str, 0, NULL, NULL) < 1) + if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)Stream_Pointer(s), 32 / 2, &str, 0, NULL, NULL) < 1) { WLog_ERR(TAG, "failed to convert client host name"); return FALSE; @@ -649,12 +641,10 @@ BOOL gcc_read_client_core_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) free(settings->ClientHostname); settings->ClientHostname = str; str = NULL; - Stream_Read_UINT32(s, settings->KeyboardType); /* KeyboardType (4 bytes) */ - Stream_Read_UINT32(s, - settings->KeyboardSubType); /* KeyboardSubType (4 bytes) */ - Stream_Read_UINT32(s, - settings->KeyboardFunctionKey); /* KeyboardFunctionKey (4 bytes) */ - Stream_Seek(s, 64); /* imeFileName (64 bytes) */ + Stream_Read_UINT32(s, settings->KeyboardType); /* KeyboardType (4 bytes) */ + Stream_Read_UINT32(s, settings->KeyboardSubType); /* KeyboardSubType (4 bytes) */ + Stream_Read_UINT32(s, settings->KeyboardFunctionKey); /* KeyboardFunctionKey (4 bytes) */ + Stream_Seek(s, 64); /* imeFileName (64 bytes) */ blockLength -= 128; /** @@ -693,16 +683,14 @@ BOOL gcc_read_client_core_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) if (blockLength < 2) break; - Stream_Read_UINT16(s, - supportedColorDepths); /* supportedColorDepths (2 bytes) */ + Stream_Read_UINT16(s, supportedColorDepths); /* supportedColorDepths (2 bytes) */ blockLength -= 2; if (blockLength < 2) break; - Stream_Read_UINT16(s, - earlyCapabilityFlags); /* earlyCapabilityFlags (2 bytes) */ - settings->EarlyCapabilityFlags = (UINT32) earlyCapabilityFlags; + Stream_Read_UINT16(s, earlyCapabilityFlags); /* earlyCapabilityFlags (2 bytes) */ + settings->EarlyCapabilityFlags = (UINT32)earlyCapabilityFlags; blockLength -= 2; /* clientDigProductId (64 bytes): Contains a value that uniquely identifies the client */ @@ -710,8 +698,8 @@ BOOL gcc_read_client_core_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) if (blockLength < 64) break; - if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) Stream_Pointer(s), 64 / 2, - &str, 0, NULL, NULL) < 1) + if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)Stream_Pointer(s), 64 / 2, &str, 0, NULL, NULL) < + 1) { WLog_ERR(TAG, "failed to convert the client product identifier"); return FALSE; @@ -737,15 +725,13 @@ BOOL gcc_read_client_core_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) if (blockLength < 4) break; - Stream_Read_UINT32(s, - serverSelectedProtocol); /* serverSelectedProtocol (4 bytes) */ + Stream_Read_UINT32(s, serverSelectedProtocol); /* serverSelectedProtocol (4 bytes) */ blockLength -= 4; if (blockLength < 4) break; - Stream_Read_UINT32(s, - settings->DesktopPhysicalWidth); /* desktopPhysicalWidth (4 bytes) */ + Stream_Read_UINT32(s, settings->DesktopPhysicalWidth); /* desktopPhysicalWidth (4 bytes) */ blockLength -= 4; if (blockLength < 4) @@ -758,27 +744,23 @@ BOOL gcc_read_client_core_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) if (blockLength < 2) break; - Stream_Read_UINT16(s, - settings->DesktopOrientation); /* desktopOrientation (2 bytes) */ + Stream_Read_UINT16(s, settings->DesktopOrientation); /* desktopOrientation (2 bytes) */ blockLength -= 2; if (blockLength < 4) break; - Stream_Read_UINT32(s, - settings->DesktopScaleFactor); /* desktopScaleFactor (4 bytes) */ + Stream_Read_UINT32(s, settings->DesktopScaleFactor); /* desktopScaleFactor (4 bytes) */ blockLength -= 4; if (blockLength < 4) break; - Stream_Read_UINT32(s, - settings->DeviceScaleFactor); /* deviceScaleFactor (4 bytes) */ + Stream_Read_UINT32(s, settings->DeviceScaleFactor); /* deviceScaleFactor (4 bytes) */ if (settings->SelectedProtocol != serverSelectedProtocol) return FALSE; - } - while (0); + } while (0); if (highColorDepth > 0) { @@ -840,28 +822,28 @@ BOOL gcc_read_client_core_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) settings->ColorDepth = clientColorDepth; if (settings->NetworkAutoDetect) - settings->NetworkAutoDetect = (earlyCapabilityFlags & - RNS_UD_CS_SUPPORT_NETWORK_AUTODETECT) ? TRUE : FALSE; + settings->NetworkAutoDetect = + (earlyCapabilityFlags & RNS_UD_CS_SUPPORT_NETWORK_AUTODETECT) ? TRUE : FALSE; if (settings->SupportHeartbeatPdu) - settings->SupportHeartbeatPdu = (earlyCapabilityFlags & - RNS_UD_CS_SUPPORT_HEARTBEAT_PDU) ? TRUE : FALSE; + settings->SupportHeartbeatPdu = + (earlyCapabilityFlags & RNS_UD_CS_SUPPORT_HEARTBEAT_PDU) ? TRUE : FALSE; if (settings->SupportGraphicsPipeline) - settings->SupportGraphicsPipeline = (earlyCapabilityFlags & - RNS_UD_CS_SUPPORT_DYNVC_GFX_PROTOCOL) ? TRUE : FALSE; + settings->SupportGraphicsPipeline = + (earlyCapabilityFlags & RNS_UD_CS_SUPPORT_DYNVC_GFX_PROTOCOL) ? TRUE : FALSE; if (settings->SupportDynamicTimeZone) - settings->SupportDynamicTimeZone = (earlyCapabilityFlags & - RNS_UD_CS_SUPPORT_DYNAMIC_TIME_ZONE) ? TRUE : FALSE; + settings->SupportDynamicTimeZone = + (earlyCapabilityFlags & RNS_UD_CS_SUPPORT_DYNAMIC_TIME_ZONE) ? TRUE : FALSE; if (settings->SupportMonitorLayoutPdu) - settings->SupportMonitorLayoutPdu = (earlyCapabilityFlags & - RNS_UD_CS_SUPPORT_MONITOR_LAYOUT_PDU) ? TRUE : FALSE; + settings->SupportMonitorLayoutPdu = + (earlyCapabilityFlags & RNS_UD_CS_SUPPORT_MONITOR_LAYOUT_PDU) ? TRUE : FALSE; if (settings->SupportStatusInfoPdu) - settings->SupportStatusInfoPdu = (earlyCapabilityFlags & - RNS_UD_CS_SUPPORT_STATUSINFO_PDU) ? TRUE : FALSE; + settings->SupportStatusInfoPdu = + (earlyCapabilityFlags & RNS_UD_CS_SUPPORT_STATUSINFO_PDU) ? TRUE : FALSE; if (!(earlyCapabilityFlags & RNS_UD_CS_VALID_CONNECTION_TYPE)) connectionType = 0; @@ -890,19 +872,17 @@ void gcc_write_client_core_data(wStream* s, rdpMcs* mcs) int clientDigProductIdLength; rdpSettings* settings = mcs->settings; gcc_write_user_data_header(s, CS_CORE, 234); - clientNameLength = ConvertToUnicode(CP_UTF8, 0, settings->ClientHostname, -1, - &clientName, 0); - clientDigProductIdLength = ConvertToUnicode(CP_UTF8, 0, - settings->ClientProductId, -1, &clientDigProductId, 0); - Stream_Write_UINT32(s, settings->RdpVersion); /* Version */ - Stream_Write_UINT16(s, settings->DesktopWidth); /* DesktopWidth */ + clientNameLength = ConvertToUnicode(CP_UTF8, 0, settings->ClientHostname, -1, &clientName, 0); + clientDigProductIdLength = + ConvertToUnicode(CP_UTF8, 0, settings->ClientProductId, -1, &clientDigProductId, 0); + Stream_Write_UINT32(s, settings->RdpVersion); /* Version */ + Stream_Write_UINT16(s, settings->DesktopWidth); /* DesktopWidth */ Stream_Write_UINT16(s, settings->DesktopHeight); /* DesktopHeight */ Stream_Write_UINT16(s, RNS_UD_COLOR_8BPP); /* ColorDepth, ignored because of postBeta2ColorDepth */ - Stream_Write_UINT16(s, - RNS_UD_SAS_DEL); /* SASSequence (Secure Access Sequence) */ + Stream_Write_UINT16(s, RNS_UD_SAS_DEL); /* SASSequence (Secure Access Sequence) */ Stream_Write_UINT32(s, settings->KeyboardLayout); /* KeyboardLayout */ - Stream_Write_UINT32(s, settings->ClientBuild); /* ClientBuild */ + Stream_Write_UINT32(s, settings->ClientBuild); /* ClientBuild */ /* clientName (32 bytes, null-terminated unicode, truncated to 15 characters) */ @@ -915,18 +895,15 @@ void gcc_write_client_core_data(wStream* s, rdpMcs* mcs) Stream_Write(s, clientName, (clientNameLength * 2)); Stream_Zero(s, 32 - (clientNameLength * 2)); free(clientName); - Stream_Write_UINT32(s, settings->KeyboardType); /* KeyboardType */ - Stream_Write_UINT32(s, settings->KeyboardSubType); /* KeyboardSubType */ + Stream_Write_UINT32(s, settings->KeyboardType); /* KeyboardType */ + Stream_Write_UINT32(s, settings->KeyboardSubType); /* KeyboardSubType */ Stream_Write_UINT32(s, settings->KeyboardFunctionKey); /* KeyboardFunctionKey */ - Stream_Zero(s, 64); /* imeFileName */ - Stream_Write_UINT16(s, RNS_UD_COLOR_8BPP); /* postBeta2ColorDepth */ - Stream_Write_UINT16(s, 1); /* clientProductID */ + Stream_Zero(s, 64); /* imeFileName */ + Stream_Write_UINT16(s, RNS_UD_COLOR_8BPP); /* postBeta2ColorDepth */ + Stream_Write_UINT16(s, 1); /* clientProductID */ Stream_Write_UINT32(s, 0); /* serialNumber (should be initialized to 0) */ highColorDepth = MIN(settings->ColorDepth, 24); - supportedColorDepths = - RNS_UD_24BPP_SUPPORT | - RNS_UD_16BPP_SUPPORT | - RNS_UD_15BPP_SUPPORT; + supportedColorDepths = RNS_UD_24BPP_SUPPORT | RNS_UD_16BPP_SUPPORT | RNS_UD_15BPP_SUPPORT; earlyCapabilityFlags = RNS_UD_CS_SUPPORT_ERRINFO_PDU; if (settings->NetworkAutoDetect) @@ -964,7 +941,7 @@ void gcc_write_client_core_data(wStream* s, rdpMcs* mcs) if (settings->SupportStatusInfoPdu) earlyCapabilityFlags |= RNS_UD_CS_SUPPORT_STATUSINFO_PDU; - Stream_Write_UINT16(s, highColorDepth); /* highColorDepth */ + Stream_Write_UINT16(s, highColorDepth); /* highColorDepth */ Stream_Write_UINT16(s, supportedColorDepths); /* supportedColorDepths */ Stream_Write_UINT16(s, earlyCapabilityFlags); /* earlyCapabilityFlags */ @@ -978,16 +955,14 @@ void gcc_write_client_core_data(wStream* s, rdpMcs* mcs) Stream_Write(s, clientDigProductId, (clientDigProductIdLength * 2)); Stream_Zero(s, 64 - (clientDigProductIdLength * 2)); free(clientDigProductId); - Stream_Write_UINT8(s, connectionType); /* connectionType */ - Stream_Write_UINT8(s, 0); /* pad1octet */ - Stream_Write_UINT32(s, settings->SelectedProtocol); /* serverSelectedProtocol */ - Stream_Write_UINT32(s, - settings->DesktopPhysicalWidth); /* desktopPhysicalWidth */ - Stream_Write_UINT32(s, - settings->DesktopPhysicalHeight); /* desktopPhysicalHeight */ - Stream_Write_UINT16(s, settings->DesktopOrientation); /* desktopOrientation */ - Stream_Write_UINT32(s, settings->DesktopScaleFactor); /* desktopScaleFactor */ - Stream_Write_UINT32(s, settings->DeviceScaleFactor); /* deviceScaleFactor */ + Stream_Write_UINT8(s, connectionType); /* connectionType */ + Stream_Write_UINT8(s, 0); /* pad1octet */ + Stream_Write_UINT32(s, settings->SelectedProtocol); /* serverSelectedProtocol */ + Stream_Write_UINT32(s, settings->DesktopPhysicalWidth); /* desktopPhysicalWidth */ + Stream_Write_UINT32(s, settings->DesktopPhysicalHeight); /* desktopPhysicalHeight */ + Stream_Write_UINT16(s, settings->DesktopOrientation); /* desktopOrientation */ + Stream_Write_UINT32(s, settings->DesktopScaleFactor); /* desktopScaleFactor */ + Stream_Write_UINT32(s, settings->DeviceScaleFactor); /* deviceScaleFactor */ } BOOL gcc_read_server_core_data(wStream* s, rdpMcs* mcs) @@ -1029,11 +1004,9 @@ BOOL gcc_write_server_core_data(wStream* s, rdpMcs* mcs) if (settings->SupportDynamicTimeZone) earlyCapabilityFlags |= RNS_UD_SC_DYNAMIC_DST_SUPPORTED; - Stream_Write_UINT32(s, settings->RdpVersion); /* version (4 bytes) */ - Stream_Write_UINT32(s, - settings->RequestedProtocols); /* clientRequestedProtocols (4 bytes) */ - Stream_Write_UINT32(s, - earlyCapabilityFlags); /* earlyCapabilityFlags (4 bytes) */ + Stream_Write_UINT32(s, settings->RdpVersion); /* version (4 bytes) */ + Stream_Write_UINT32(s, settings->RequestedProtocols); /* clientRequestedProtocols (4 bytes) */ + Stream_Write_UINT32(s, earlyCapabilityFlags); /* earlyCapabilityFlags (4 bytes) */ return TRUE; } @@ -1083,12 +1056,12 @@ void gcc_write_client_security_data(wStream* s, rdpMcs* mcs) if (settings->UseRdpSecurityLayer) { Stream_Write_UINT32(s, settings->EncryptionMethods); /* encryptionMethods */ - Stream_Write_UINT32(s, 0); /* extEncryptionMethods */ + Stream_Write_UINT32(s, 0); /* extEncryptionMethods */ } else { /* French locale, disable encryption */ - Stream_Write_UINT32(s, 0); /* encryptionMethods */ + Stream_Write_UINT32(s, 0); /* encryptionMethods */ Stream_Write_UINT32(s, settings->EncryptionMethods); /* extEncryptionMethods */ } } @@ -1104,7 +1077,7 @@ BOOL gcc_read_server_security_data(wStream* s, rdpMcs* mcs) if (Stream_GetRemainingLength(s) < 8) return FALSE; - Stream_Read_UINT32(s, serverEncryptionMethod); /* encryptionMethod */ + Stream_Read_UINT32(s, serverEncryptionMethod); /* encryptionMethod */ Stream_Read_UINT32(s, settings->EncryptionLevel); /* encryptionLevel */ /* Only accept valid/known encryption methods */ @@ -1131,15 +1104,14 @@ BOOL gcc_read_server_security_data(wStream* s, rdpMcs* mcs) break; default: - WLog_ERR(TAG, "Received unknown encryption method %08"PRIX32"", + WLog_ERR(TAG, "Received unknown encryption method %08" PRIX32 "", serverEncryptionMethod); return FALSE; } - if (settings->UseRdpSecurityLayer - && !(settings->EncryptionMethods & serverEncryptionMethod)) + if (settings->UseRdpSecurityLayer && !(settings->EncryptionMethods & serverEncryptionMethod)) { - WLog_WARN(TAG, "Server uses non-advertised encryption method 0x%08"PRIX32"", + WLog_WARN(TAG, "Server uses non-advertised encryption method 0x%08" PRIX32 "", serverEncryptionMethod); /* FIXME: Should we return FALSE; in this case ?? */ } @@ -1179,14 +1151,15 @@ BOOL gcc_read_server_security_data(wStream* s, rdpMcs* mcs) break; default: - WLog_ERR(TAG, "Received unknown encryption level 0x%08"PRIX32"", + WLog_ERR(TAG, "Received unknown encryption level 0x%08" PRIX32 "", settings->EncryptionLevel); } if (!validCryptoConfig) { WLog_ERR(TAG, - "Received invalid cryptographic configuration (level=0x%08"PRIX32" method=0x%08"PRIX32")", + "Received invalid cryptographic configuration (level=0x%08" PRIX32 + " method=0x%08" PRIX32 ")", settings->EncryptionLevel, settings->EncryptionMethods); return FALSE; } @@ -1201,7 +1174,7 @@ BOOL gcc_read_server_security_data(wStream* s, rdpMcs* mcs) if (Stream_GetRemainingLength(s) < 8) return FALSE; - Stream_Read_UINT32(s, settings->ServerRandomLength); /* serverRandomLen */ + Stream_Read_UINT32(s, settings->ServerRandomLength); /* serverRandomLen */ Stream_Read_UINT32(s, settings->ServerCertificateLength); /* serverCertLen */ if ((settings->ServerRandomLength == 0) || (settings->ServerCertificateLength == 0)) @@ -1211,7 +1184,7 @@ BOOL gcc_read_server_security_data(wStream* s, rdpMcs* mcs) return FALSE; /* serverRandom */ - settings->ServerRandom = (BYTE*) malloc(settings->ServerRandomLength); + settings->ServerRandom = (BYTE*)malloc(settings->ServerRandomLength); if (!settings->ServerRandom) goto fail; @@ -1222,7 +1195,7 @@ BOOL gcc_read_server_security_data(wStream* s, rdpMcs* mcs) goto fail; /* serverCertificate */ - settings->ServerCertificate = (BYTE*) malloc(settings->ServerCertificateLength); + settings->ServerCertificate = (BYTE*)malloc(settings->ServerCertificateLength); if (!settings->ServerCertificate) goto fail; @@ -1237,8 +1210,7 @@ BOOL gcc_read_server_security_data(wStream* s, rdpMcs* mcs) data = settings->ServerCertificate; length = settings->ServerCertificateLength; - if (!certificate_read_server_certificate(settings->RdpServerCertificate, data, - length)) + if (!certificate_read_server_certificate(settings->RdpServerCertificate, data, length)) goto fail; return TRUE; @@ -1250,16 +1222,11 @@ fail: return FALSE; } -static const BYTE initial_signature[] = -{ - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 +static const BYTE initial_signature[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 }; /* @@ -1267,34 +1234,21 @@ static const BYTE initial_signature[] = * Yes, Terminal Services Private Key is publicly available. */ -const BYTE tssk_modulus[] = -{ - 0x3d, 0x3a, 0x5e, 0xbd, 0x72, 0x43, 0x3e, 0xc9, - 0x4d, 0xbb, 0xc1, 0x1e, 0x4a, 0xba, 0x5f, 0xcb, - 0x3e, 0x88, 0x20, 0x87, 0xef, 0xf5, 0xc1, 0xe2, - 0xd7, 0xb7, 0x6b, 0x9a, 0xf2, 0x52, 0x45, 0x95, - 0xce, 0x63, 0x65, 0x6b, 0x58, 0x3a, 0xfe, 0xef, - 0x7c, 0xe7, 0xbf, 0xfe, 0x3d, 0xf6, 0x5c, 0x7d, - 0x6c, 0x5e, 0x06, 0x09, 0x1a, 0xf5, 0x61, 0xbb, - 0x20, 0x93, 0x09, 0x5f, 0x05, 0x6d, 0xea, 0x87 +const BYTE tssk_modulus[] = { 0x3d, 0x3a, 0x5e, 0xbd, 0x72, 0x43, 0x3e, 0xc9, 0x4d, 0xbb, 0xc1, + 0x1e, 0x4a, 0xba, 0x5f, 0xcb, 0x3e, 0x88, 0x20, 0x87, 0xef, 0xf5, + 0xc1, 0xe2, 0xd7, 0xb7, 0x6b, 0x9a, 0xf2, 0x52, 0x45, 0x95, 0xce, + 0x63, 0x65, 0x6b, 0x58, 0x3a, 0xfe, 0xef, 0x7c, 0xe7, 0xbf, 0xfe, + 0x3d, 0xf6, 0x5c, 0x7d, 0x6c, 0x5e, 0x06, 0x09, 0x1a, 0xf5, 0x61, + 0xbb, 0x20, 0x93, 0x09, 0x5f, 0x05, 0x6d, 0xea, 0x87 }; + +const BYTE tssk_privateExponent[] = { + 0x87, 0xa7, 0x19, 0x32, 0xda, 0x11, 0x87, 0x55, 0x58, 0x00, 0x16, 0x16, 0x25, 0x65, 0x68, 0xf8, + 0x24, 0x3e, 0xe6, 0xfa, 0xe9, 0x67, 0x49, 0x94, 0xcf, 0x92, 0xcc, 0x33, 0x99, 0xe8, 0x08, 0x60, + 0x17, 0x9a, 0x12, 0x9f, 0x24, 0xdd, 0xb1, 0x24, 0x99, 0xc7, 0x3a, 0xb8, 0x0a, 0x7b, 0x0d, 0xdd, + 0x35, 0x07, 0x79, 0x17, 0x0b, 0x51, 0x9b, 0xb3, 0xc7, 0x10, 0x01, 0x13, 0xe7, 0x3f, 0xf3, 0x5f }; -const BYTE tssk_privateExponent[] = -{ - 0x87, 0xa7, 0x19, 0x32, 0xda, 0x11, 0x87, 0x55, - 0x58, 0x00, 0x16, 0x16, 0x25, 0x65, 0x68, 0xf8, - 0x24, 0x3e, 0xe6, 0xfa, 0xe9, 0x67, 0x49, 0x94, - 0xcf, 0x92, 0xcc, 0x33, 0x99, 0xe8, 0x08, 0x60, - 0x17, 0x9a, 0x12, 0x9f, 0x24, 0xdd, 0xb1, 0x24, - 0x99, 0xc7, 0x3a, 0xb8, 0x0a, 0x7b, 0x0d, 0xdd, - 0x35, 0x07, 0x79, 0x17, 0x0b, 0x51, 0x9b, 0xb3, - 0xc7, 0x10, 0x01, 0x13, 0xe7, 0x3f, 0xf3, 0x5f -}; - -const BYTE tssk_exponent[] = -{ - 0x5b, 0x7b, 0x88, 0xc0 -}; +const BYTE tssk_exponent[] = { 0x5b, 0x7b, 0x88, 0xc0 }; BOOL gcc_write_server_security_data(wStream* s, rdpMcs* mcs) { @@ -1345,7 +1299,7 @@ BOOL gcc_write_server_security_data(wStream* s, rdpMcs* mcs) break; default: - WLog_ERR(TAG, "Invalid server encryption level 0x%08"PRIX32"", + WLog_ERR(TAG, "Invalid server encryption level 0x%08" PRIX32 "", settings->EncryptionLevel); WLog_ERR(TAG, "Switching to encryption level CLIENT-COMPATIBLE"); settings->EncryptionLevel = ENCRYPTION_LEVEL_CLIENT_COMPATIBLE; @@ -1364,8 +1318,7 @@ BOOL gcc_write_server_security_data(wStream* s, rdpMcs* mcs) /* The only valid method is FIPS in this case */ if (!(settings->EncryptionMethods & ENCRYPTION_METHOD_FIPS)) { - WLog_WARN(TAG, - "client does not support FIPS as required by server configuration"); + WLog_WARN(TAG, "client does not support FIPS as required by server configuration"); } settings->EncryptionMethods = ENCRYPTION_METHOD_FIPS; @@ -1376,8 +1329,8 @@ BOOL gcc_write_server_security_data(wStream* s, rdpMcs* mcs) /* Maximum key strength supported by the server must be used (128 bit)*/ if (!(settings->EncryptionMethods & ENCRYPTION_METHOD_128BIT)) { - WLog_WARN(TAG, - "client does not support 128 bit encryption method as required by server configuration"); + WLog_WARN(TAG, "client does not support 128 bit encryption method as required by " + "server configuration"); } settings->EncryptionMethods = ENCRYPTION_METHOD_128BIT; @@ -1447,23 +1400,23 @@ BOOL gcc_write_server_security_data(wStream* s, rdpMcs* mcs) serverRandomLen = 32; keyLen = settings->RdpServerRsaKey->ModulusLength; expLen = sizeof(settings->RdpServerRsaKey->exponent); - wPublicKeyBlobLen = 4; /* magic (RSA1) */ + wPublicKeyBlobLen = 4; /* magic (RSA1) */ wPublicKeyBlobLen += 4; /* keylen */ wPublicKeyBlobLen += 4; /* bitlen */ wPublicKeyBlobLen += 4; /* datalen */ wPublicKeyBlobLen += expLen; wPublicKeyBlobLen += keyLen; wPublicKeyBlobLen += 8; /* 8 bytes of zero padding */ - serverCertLen = 4; /* dwVersion */ - serverCertLen += 4; /* dwSigAlgId */ - serverCertLen += 4; /* dwKeyAlgId */ - serverCertLen += 2; /* wPublicKeyBlobType */ - serverCertLen += 2; /* wPublicKeyBlobLen */ + serverCertLen = 4; /* dwVersion */ + serverCertLen += 4; /* dwSigAlgId */ + serverCertLen += 4; /* dwKeyAlgId */ + serverCertLen += 2; /* wPublicKeyBlobType */ + serverCertLen += 2; /* wPublicKeyBlobLen */ serverCertLen += wPublicKeyBlobLen; - serverCertLen += 2; /* wSignatureBlobType */ - serverCertLen += 2; /* wSignatureBlobLen */ + serverCertLen += 2; /* wSignatureBlobType */ + serverCertLen += 2; /* wSignatureBlobLen */ serverCertLen += sizeof(encryptedSignature); /* SignatureBlob */ - serverCertLen += 8; /* 8 bytes of zero padding */ + serverCertLen += 8; /* 8 bytes of zero padding */ headerLen += sizeof(serverRandomLen); headerLen += sizeof(serverCertLen); headerLen += serverRandomLen; @@ -1475,7 +1428,7 @@ BOOL gcc_write_server_security_data(wStream* s, rdpMcs* mcs) gcc_write_user_data_header(s, SC_SECURITY, headerLen); Stream_Write_UINT32(s, settings->EncryptionMethods); /* encryptionMethod */ - Stream_Write_UINT32(s, settings->EncryptionLevel); /* encryptionLevel */ + Stream_Write_UINT32(s, settings->EncryptionLevel); /* encryptionLevel */ if (settings->EncryptionMethods == ENCRYPTION_METHOD_NONE) { @@ -1483,9 +1436,9 @@ BOOL gcc_write_server_security_data(wStream* s, rdpMcs* mcs) } Stream_Write_UINT32(s, serverRandomLen); /* serverRandomLen */ - Stream_Write_UINT32(s, serverCertLen); /* serverCertLen */ + Stream_Write_UINT32(s, serverCertLen); /* serverCertLen */ settings->ServerRandomLength = serverRandomLen; - settings->ServerRandom = (BYTE*) malloc(serverRandomLen); + settings->ServerRandom = (BYTE*)malloc(serverRandomLen); if (!settings->ServerRandom) { @@ -1496,27 +1449,27 @@ BOOL gcc_write_server_security_data(wStream* s, rdpMcs* mcs) Stream_Write(s, settings->ServerRandom, serverRandomLen); sigData = Stream_Pointer(s); Stream_Write_UINT32(s, CERT_CHAIN_VERSION_1); /* dwVersion (4 bytes) */ - Stream_Write_UINT32(s, SIGNATURE_ALG_RSA); /* dwSigAlgId */ + Stream_Write_UINT32(s, SIGNATURE_ALG_RSA); /* dwSigAlgId */ Stream_Write_UINT32(s, KEY_EXCHANGE_ALG_RSA); /* dwKeyAlgId */ - Stream_Write_UINT16(s, BB_RSA_KEY_BLOB); /* wPublicKeyBlobType */ - Stream_Write_UINT16(s, wPublicKeyBlobLen); /* wPublicKeyBlobLen */ - Stream_Write(s, "RSA1", 4); /* magic */ - Stream_Write_UINT32(s, keyLen + 8); /* keylen */ - Stream_Write_UINT32(s, keyLen * 8); /* bitlen */ - Stream_Write_UINT32(s, keyLen - 1); /* datalen */ + Stream_Write_UINT16(s, BB_RSA_KEY_BLOB); /* wPublicKeyBlobType */ + Stream_Write_UINT16(s, wPublicKeyBlobLen); /* wPublicKeyBlobLen */ + Stream_Write(s, "RSA1", 4); /* magic */ + Stream_Write_UINT32(s, keyLen + 8); /* keylen */ + Stream_Write_UINT32(s, keyLen * 8); /* bitlen */ + Stream_Write_UINT32(s, keyLen - 1); /* datalen */ Stream_Write(s, settings->RdpServerRsaKey->exponent, expLen); Stream_Write(s, settings->RdpServerRsaKey->Modulus, keyLen); Stream_Zero(s, 8); sigDataLen = Stream_Pointer(s) - sigData; - Stream_Write_UINT16(s, BB_RSA_SIGNATURE_BLOB); /* wSignatureBlobType */ + Stream_Write_UINT16(s, BB_RSA_SIGNATURE_BLOB); /* wSignatureBlobType */ Stream_Write_UINT16(s, sizeof(encryptedSignature) + 8); /* wSignatureBlobLen */ memcpy(signature, initial_signature, sizeof(initial_signature)); if (!winpr_Digest(WINPR_MD_MD5, sigData, sigDataLen, signature, sizeof(signature))) return FALSE; - crypto_rsa_private_encrypt(signature, sizeof(signature), TSSK_KEY_LENGTH, - tssk_modulus, tssk_privateExponent, encryptedSignature); + crypto_rsa_private_encrypt(signature, sizeof(signature), TSSK_KEY_LENGTH, tssk_modulus, + tssk_privateExponent, encryptedSignature); Stream_Write(s, encryptedSignature, sizeof(encryptedSignature)); Stream_Zero(s, 8); return TRUE; @@ -1557,8 +1510,9 @@ BOOL gcc_read_client_network_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) if (!memchr(mcs->channels[i].Name, 0, 8)) { - WLog_ERR(TAG, - "protocol violation: received a static channel name with missing null-termination"); + WLog_ERR( + TAG, + "protocol violation: received a static channel name with missing null-termination"); return FALSE; } @@ -1591,7 +1545,7 @@ void gcc_write_client_network_data(wStream* s, rdpMcs* mcs) for (i = 0; i < mcs->channelCount; i++) { /* CHANNEL_DEF */ - Stream_Write(s, mcs->channels[i].Name, 8); /* name (8 bytes) */ + Stream_Write(s, mcs->channels[i].Name, 8); /* name (8 bytes) */ Stream_Write_UINT32(s, mcs->channels[i].options); /* options (4 bytes) */ } } @@ -1614,8 +1568,8 @@ BOOL gcc_read_server_network_data(wStream* s, rdpMcs* mcs) if (channelCount != mcs->channelCount) { - WLog_ERR(TAG, "requested %"PRIu32" channels, got %"PRIu16" instead", - mcs->channelCount, channelCount); + WLog_ERR(TAG, "requested %" PRIu32 " channels, got %" PRIu16 " instead", mcs->channelCount, + channelCount); /* we ensure that the response is not bigger than the request */ @@ -1623,7 +1577,7 @@ BOOL gcc_read_server_network_data(wStream* s, rdpMcs* mcs) parsedChannelCount = mcs->channelCount; } - if (Stream_GetRemainingLength(s) < (size_t) channelCount * 2) + if (Stream_GetRemainingLength(s) < (size_t)channelCount * 2) return FALSE; for (i = 0; i < parsedChannelCount; i++) @@ -1641,15 +1595,14 @@ BOOL gcc_read_server_network_data(wStream* s, rdpMcs* mcs) BOOL gcc_write_server_network_data(wStream* s, rdpMcs* mcs) { UINT32 i; - int payloadLen = 8 + mcs->channelCount * 2 + (mcs->channelCount % 2 == 1 ? 2 : - 0); + int payloadLen = 8 + mcs->channelCount * 2 + (mcs->channelCount % 2 == 1 ? 2 : 0); if (!Stream_EnsureRemainingCapacity(s, payloadLen + 4)) return FALSE; gcc_write_user_data_header(s, SC_NET, payloadLen); Stream_Write_UINT16(s, MCS_GLOBAL_CHANNEL_ID); /* MCSChannelId */ - Stream_Write_UINT16(s, mcs->channelCount); /* channelCount */ + Stream_Write_UINT16(s, mcs->channelCount); /* channelCount */ for (i = 0; i < mcs->channelCount; i++) { @@ -1678,7 +1631,7 @@ BOOL gcc_read_client_cluster_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) if (blockLength < 8) return FALSE; - Stream_Read_UINT32(s, flags); /* flags */ + Stream_Read_UINT32(s, flags); /* flags */ Stream_Read_UINT32(s, redirectedSessionId); /* redirectedSessionId */ if (flags & REDIRECTED_SESSIONID_FIELD_VALID) @@ -1713,7 +1666,7 @@ void gcc_write_client_cluster_data(wStream* s, rdpMcs* mcs) if (settings->ConsoleSession || settings->RedirectedSessionId) flags |= REDIRECTED_SESSIONID_FIELD_VALID; - Stream_Write_UINT32(s, flags); /* flags */ + Stream_Write_UINT32(s, flags); /* flags */ Stream_Write_UINT32(s, settings->RedirectedSessionId); /* redirectedSessionID */ } @@ -1735,7 +1688,7 @@ BOOL gcc_read_client_monitor_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) if (blockLength < 8) return FALSE; - Stream_Read_UINT32(s, flags); /* flags */ + Stream_Read_UINT32(s, flags); /* flags */ Stream_Read_UINT32(s, monitorCount); /* monitorCount */ /* 2.2.1.3.6 Client Monitor Data - @@ -1744,29 +1697,29 @@ BOOL gcc_read_client_monitor_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) */ if (monitorCount > 16) { - WLog_ERR(TAG, "announced monitors(%"PRIu32") exceed the 16 limit", monitorCount); + WLog_ERR(TAG, "announced monitors(%" PRIu32 ") exceed the 16 limit", monitorCount); return FALSE; } if (monitorCount > settings->MonitorDefArraySize) { - WLog_ERR(TAG, "too many announced monitors(%"PRIu32"), clamping to %"PRIu32"", monitorCount, - settings->MonitorDefArraySize); + WLog_ERR(TAG, "too many announced monitors(%" PRIu32 "), clamping to %" PRIu32 "", + monitorCount, settings->MonitorDefArraySize); monitorCount = settings->MonitorDefArraySize; } - if ((UINT32)((blockLength - 8) / 20) < monitorCount) + if ((UINT32)((blockLength - 8) / 20) < monitorCount) return FALSE; settings->MonitorCount = monitorCount; for (index = 0; index < monitorCount; index++) { - Stream_Read_UINT32(s, left); /* left */ - Stream_Read_UINT32(s, top); /* top */ - Stream_Read_UINT32(s, right); /* right */ + Stream_Read_UINT32(s, left); /* left */ + Stream_Read_UINT32(s, top); /* top */ + Stream_Read_UINT32(s, right); /* right */ Stream_Read_UINT32(s, bottom); /* bottom */ - Stream_Read_UINT32(s, flags); /* flags */ + Stream_Read_UINT32(s, flags); /* flags */ settings->MonitorDefArray[index].x = left; settings->MonitorDefArray[index].y = top; settings->MonitorDefArray[index].width = right - left + 1; @@ -1796,7 +1749,7 @@ void gcc_write_client_monitor_data(wStream* s, rdpMcs* mcs) { length = (20 * settings->MonitorCount) + 12; gcc_write_user_data_header(s, CS_MONITOR, length); - Stream_Write_UINT32(s, 0); /* flags */ + Stream_Write_UINT32(s, 0); /* flags */ Stream_Write_UINT32(s, settings->MonitorCount); /* monitorCount */ /* first pass to get the primary monitor coordinates (it is supposed to be @@ -1818,17 +1771,16 @@ void gcc_write_client_monitor_data(wStream* s, rdpMcs* mcs) right = left + settings->MonitorDefArray[i].width - 1; bottom = top + settings->MonitorDefArray[i].height - 1; flags = settings->MonitorDefArray[i].is_primary ? MONITOR_PRIMARY : 0; - Stream_Write_UINT32(s, left); /* left */ - Stream_Write_UINT32(s, top); /* top */ - Stream_Write_UINT32(s, right); /* right */ + Stream_Write_UINT32(s, left); /* left */ + Stream_Write_UINT32(s, top); /* top */ + Stream_Write_UINT32(s, right); /* right */ Stream_Write_UINT32(s, bottom); /* bottom */ - Stream_Write_UINT32(s, flags); /* flags */ + Stream_Write_UINT32(s, flags); /* flags */ } } } -BOOL gcc_read_client_monitor_extended_data(wStream* s, rdpMcs* mcs, - UINT16 blockLength) +BOOL gcc_read_client_monitor_extended_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) { UINT32 index; UINT32 flags; @@ -1839,9 +1791,9 @@ BOOL gcc_read_client_monitor_extended_data(wStream* s, rdpMcs* mcs, if (blockLength < 12) return FALSE; - Stream_Read_UINT32(s, flags); /* flags */ + Stream_Read_UINT32(s, flags); /* flags */ Stream_Read_UINT32(s, monitorAttributeSize); /* monitorAttributeSize */ - Stream_Read_UINT32(s, monitorCount); /* monitorCount */ + Stream_Read_UINT32(s, monitorCount); /* monitorCount */ if (monitorAttributeSize != 20) return FALSE; @@ -1856,16 +1808,17 @@ BOOL gcc_read_client_monitor_extended_data(wStream* s, rdpMcs* mcs, for (index = 0; index < monitorCount; index++) { - Stream_Read_UINT32(s, - settings->MonitorDefArray[index].attributes.physicalWidth); /* physicalWidth */ - Stream_Read_UINT32(s, - settings->MonitorDefArray[index].attributes.physicalHeight); /* physicalHeight */ - Stream_Read_UINT32(s, - settings->MonitorDefArray[index].attributes.orientation); /* orientation */ - Stream_Read_UINT32(s, - settings->MonitorDefArray[index].attributes.desktopScaleFactor); /* desktopScaleFactor */ - Stream_Read_UINT32(s, - settings->MonitorDefArray[index].attributes.deviceScaleFactor); /* deviceScaleFactor */ + Stream_Read_UINT32( + s, settings->MonitorDefArray[index].attributes.physicalWidth); /* physicalWidth */ + Stream_Read_UINT32( + s, settings->MonitorDefArray[index].attributes.physicalHeight); /* physicalHeight */ + Stream_Read_UINT32( + s, settings->MonitorDefArray[index].attributes.orientation); /* orientation */ + Stream_Read_UINT32(s, settings->MonitorDefArray[index] + .attributes.desktopScaleFactor); /* desktopScaleFactor */ + Stream_Read_UINT32( + s, + settings->MonitorDefArray[index].attributes.deviceScaleFactor); /* deviceScaleFactor */ } return TRUE; @@ -1881,22 +1834,23 @@ void gcc_write_client_monitor_extended_data(wStream* s, rdpMcs* mcs) { length = (20 * settings->MonitorCount) + 16; gcc_write_user_data_header(s, CS_MONITOR_EX, length); - Stream_Write_UINT32(s, 0); /* flags */ - Stream_Write_UINT32(s, 20); /* monitorAttributeSize */ + Stream_Write_UINT32(s, 0); /* flags */ + Stream_Write_UINT32(s, 20); /* monitorAttributeSize */ Stream_Write_UINT32(s, settings->MonitorCount); /* monitorCount */ for (i = 0; i < settings->MonitorCount; i++) { - Stream_Write_UINT32(s, - settings->MonitorDefArray[i].attributes.physicalWidth); /* physicalWidth */ - Stream_Write_UINT32(s, - settings->MonitorDefArray[i].attributes.physicalHeight); /* physicalHeight */ - Stream_Write_UINT32(s, - settings->MonitorDefArray[i].attributes.orientation); /* orientation */ - Stream_Write_UINT32(s, - settings->MonitorDefArray[i].attributes.desktopScaleFactor); /* desktopScaleFactor */ - Stream_Write_UINT32(s, - settings->MonitorDefArray[i].attributes.deviceScaleFactor); /* deviceScaleFactor */ + Stream_Write_UINT32( + s, settings->MonitorDefArray[i].attributes.physicalWidth); /* physicalWidth */ + Stream_Write_UINT32( + s, settings->MonitorDefArray[i].attributes.physicalHeight); /* physicalHeight */ + Stream_Write_UINT32( + s, settings->MonitorDefArray[i].attributes.orientation); /* orientation */ + Stream_Write_UINT32(s, settings->MonitorDefArray[i] + .attributes.desktopScaleFactor); /* desktopScaleFactor */ + Stream_Write_UINT32( + s, + settings->MonitorDefArray[i].attributes.deviceScaleFactor); /* deviceScaleFactor */ } } } @@ -1908,8 +1862,7 @@ void gcc_write_client_monitor_extended_data(wStream* s, rdpMcs* mcs) * @param settings rdp settings */ -BOOL gcc_read_client_message_channel_data(wStream* s, rdpMcs* mcs, - UINT16 blockLength) +BOOL gcc_read_client_message_channel_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) { UINT32 flags; @@ -1932,8 +1885,7 @@ void gcc_write_client_message_channel_data(wStream* s, rdpMcs* mcs) { rdpSettings* settings = mcs->settings; - if (settings->NetworkAutoDetect || - settings->SupportHeartbeatPdu || + if (settings->NetworkAutoDetect || settings->SupportHeartbeatPdu || settings->SupportMultitransport) { gcc_write_user_data_header(s, CS_MCS_MSGCHANNEL, 8); @@ -1974,8 +1926,7 @@ BOOL gcc_write_server_message_channel_data(wStream* s, rdpMcs* mcs) * @param settings rdp settings */ -BOOL gcc_read_client_multitransport_channel_data(wStream* s, rdpMcs* mcs, - UINT16 blockLength) +BOOL gcc_read_client_multitransport_channel_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) { UINT32 flags; diff --git a/libfreerdp/core/gcc.h b/libfreerdp/core/gcc.h index ca5350b4a..02560d353 100644 --- a/libfreerdp/core/gcc.h +++ b/libfreerdp/core/gcc.h @@ -31,61 +31,43 @@ #include FREERDP_LOCAL BOOL gcc_read_conference_create_request(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL void gcc_write_conference_create_request(wStream* s, - wStream* userData); +FREERDP_LOCAL void gcc_write_conference_create_request(wStream* s, wStream* userData); FREERDP_LOCAL BOOL gcc_read_conference_create_response(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL void gcc_write_conference_create_response(wStream* s, - wStream* userData); -FREERDP_LOCAL BOOL gcc_read_client_data_blocks(wStream* s, rdpMcs* mcs, - int length); +FREERDP_LOCAL void gcc_write_conference_create_response(wStream* s, wStream* userData); +FREERDP_LOCAL BOOL gcc_read_client_data_blocks(wStream* s, rdpMcs* mcs, int length); FREERDP_LOCAL void gcc_write_client_data_blocks(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_server_data_blocks(wStream* s, rdpMcs* mcs, - int length); +FREERDP_LOCAL BOOL gcc_read_server_data_blocks(wStream* s, rdpMcs* mcs, int length); FREERDP_LOCAL BOOL gcc_write_server_data_blocks(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_user_data_header(wStream* s, UINT16* type, - UINT16* length); -FREERDP_LOCAL void gcc_write_user_data_header(wStream* s, UINT16 type, - UINT16 length); -FREERDP_LOCAL BOOL gcc_read_client_core_data(wStream* s, rdpMcs* mcs, - UINT16 blockLength); +FREERDP_LOCAL BOOL gcc_read_user_data_header(wStream* s, UINT16* type, UINT16* length); +FREERDP_LOCAL void gcc_write_user_data_header(wStream* s, UINT16 type, UINT16 length); +FREERDP_LOCAL BOOL gcc_read_client_core_data(wStream* s, rdpMcs* mcs, UINT16 blockLength); FREERDP_LOCAL void gcc_write_client_core_data(wStream* s, rdpMcs* mcs); FREERDP_LOCAL BOOL gcc_read_server_core_data(wStream* s, rdpMcs* mcs); FREERDP_LOCAL BOOL gcc_write_server_core_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_client_security_data(wStream* s, rdpMcs* mcs, - UINT16 blockLength); +FREERDP_LOCAL BOOL gcc_read_client_security_data(wStream* s, rdpMcs* mcs, UINT16 blockLength); FREERDP_LOCAL void gcc_write_client_security_data(wStream* s, rdpMcs* mcs); FREERDP_LOCAL BOOL gcc_read_server_security_data(wStream* s, rdpMcs* mcs); FREERDP_LOCAL BOOL gcc_write_server_security_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_client_network_data(wStream* s, rdpMcs* mcs, - UINT16 blockLength); +FREERDP_LOCAL BOOL gcc_read_client_network_data(wStream* s, rdpMcs* mcs, UINT16 blockLength); FREERDP_LOCAL void gcc_write_client_network_data(wStream* s, rdpMcs* mcs); FREERDP_LOCAL BOOL gcc_read_server_network_data(wStream* s, rdpMcs* mcs); FREERDP_LOCAL BOOL gcc_write_server_network_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_client_cluster_data(wStream* s, rdpMcs* mcs, - UINT16 blockLength); +FREERDP_LOCAL BOOL gcc_read_client_cluster_data(wStream* s, rdpMcs* mcs, UINT16 blockLength); FREERDP_LOCAL void gcc_write_client_cluster_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_client_monitor_data(wStream* s, rdpMcs* mcs, - UINT16 blockLength); +FREERDP_LOCAL BOOL gcc_read_client_monitor_data(wStream* s, rdpMcs* mcs, UINT16 blockLength); FREERDP_LOCAL void gcc_write_client_monitor_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_client_monitor_extended_data(wStream* s, - rdpMcs* mcs, UINT16 blockLength); -FREERDP_LOCAL void gcc_write_client_monitor_extended_data(wStream* s, - rdpMcs* mcs); +FREERDP_LOCAL BOOL gcc_read_client_monitor_extended_data(wStream* s, rdpMcs* mcs, + UINT16 blockLength); +FREERDP_LOCAL void gcc_write_client_monitor_extended_data(wStream* s, rdpMcs* mcs); FREERDP_LOCAL BOOL gcc_read_client_message_channel_data(wStream* s, rdpMcs* mcs, - UINT16 blockLength); -FREERDP_LOCAL void gcc_write_client_message_channel_data(wStream* s, - rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_server_message_channel_data(wStream* s, - rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_write_server_message_channel_data(wStream* s, - rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_client_multitransport_channel_data(wStream* s, - rdpMcs* mcs, UINT16 blockLength); -FREERDP_LOCAL void gcc_write_client_multitransport_channel_data(wStream* s, - rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_server_multitransport_channel_data(wStream* s, - rdpMcs* mcs); -FREERDP_LOCAL void gcc_write_server_multitransport_channel_data(wStream* s, - rdpMcs* mcs); + UINT16 blockLength); +FREERDP_LOCAL void gcc_write_client_message_channel_data(wStream* s, rdpMcs* mcs); +FREERDP_LOCAL BOOL gcc_read_server_message_channel_data(wStream* s, rdpMcs* mcs); +FREERDP_LOCAL BOOL gcc_write_server_message_channel_data(wStream* s, rdpMcs* mcs); +FREERDP_LOCAL BOOL gcc_read_client_multitransport_channel_data(wStream* s, rdpMcs* mcs, + UINT16 blockLength); +FREERDP_LOCAL void gcc_write_client_multitransport_channel_data(wStream* s, rdpMcs* mcs); +FREERDP_LOCAL BOOL gcc_read_server_multitransport_channel_data(wStream* s, rdpMcs* mcs); +FREERDP_LOCAL void gcc_write_server_multitransport_channel_data(wStream* s, rdpMcs* mcs); #endif /* FREERDP_LIB_CORE_GCC_H */ diff --git a/libfreerdp/core/graphics.c b/libfreerdp/core/graphics.c index 423416b74..b25ac9232 100644 --- a/libfreerdp/core/graphics.c +++ b/libfreerdp/core/graphics.c @@ -34,7 +34,7 @@ rdpBitmap* Bitmap_Alloc(rdpContext* context) rdpBitmap* bitmap; rdpGraphics* graphics; graphics = context->graphics; - bitmap = (rdpBitmap*) calloc(1, graphics->Bitmap_Prototype->size); + bitmap = (rdpBitmap*)calloc(1, graphics->Bitmap_Prototype->size); if (bitmap) { @@ -60,9 +60,7 @@ void Bitmap_Free(rdpContext* context, rdpBitmap* bitmap) bitmap->Free(context, bitmap); } -BOOL Bitmap_SetRectangle(rdpBitmap* bitmap, - UINT16 left, - UINT16 top, UINT16 right, UINT16 bottom) +BOOL Bitmap_SetRectangle(rdpBitmap* bitmap, UINT16 left, UINT16 top, UINT16 right, UINT16 bottom) { if (!bitmap) return FALSE; @@ -74,9 +72,7 @@ BOOL Bitmap_SetRectangle(rdpBitmap* bitmap, return TRUE; } -BOOL Bitmap_SetDimensions(rdpBitmap* bitmap, - UINT16 width, - UINT16 height) +BOOL Bitmap_SetDimensions(rdpBitmap* bitmap, UINT16 width, UINT16 height) { if (!bitmap) return FALSE; @@ -99,7 +95,7 @@ rdpPointer* Pointer_Alloc(rdpContext* context) rdpPointer* pointer; rdpGraphics* graphics; graphics = context->graphics; - pointer = (rdpPointer*) calloc(1, graphics->Pointer_Prototype->size); + pointer = (rdpPointer*)calloc(1, graphics->Pointer_Prototype->size); if (pointer) { @@ -129,8 +125,8 @@ void graphics_register_pointer(rdpGraphics* graphics, rdpPointer* pointer) /* Glyph Class */ -rdpGlyph* Glyph_Alloc(rdpContext* context, INT32 x, INT32 y, - UINT32 cx, UINT32 cy, UINT32 cb, const BYTE* aj) +rdpGlyph* Glyph_Alloc(rdpContext* context, INT32 x, INT32 y, UINT32 cx, UINT32 cy, UINT32 cb, + const BYTE* aj) { rdpGlyph* glyph; rdpGraphics* graphics; @@ -143,7 +139,7 @@ rdpGlyph* Glyph_Alloc(rdpContext* context, INT32 x, INT32 y, if (!graphics->Glyph_Prototype) return NULL; - glyph = (rdpGlyph*) calloc(1, graphics->Glyph_Prototype->size); + glyph = (rdpGlyph*)calloc(1, graphics->Glyph_Prototype->size); if (!glyph) return NULL; @@ -184,12 +180,12 @@ void graphics_register_glyph(rdpGraphics* graphics, rdpGlyph* glyph) rdpGraphics* graphics_new(rdpContext* context) { rdpGraphics* graphics; - graphics = (rdpGraphics*) calloc(1, sizeof(rdpGraphics)); + graphics = (rdpGraphics*)calloc(1, sizeof(rdpGraphics)); if (graphics) { graphics->context = context; - graphics->Bitmap_Prototype = (rdpBitmap*) calloc(1, sizeof(rdpBitmap)); + graphics->Bitmap_Prototype = (rdpBitmap*)calloc(1, sizeof(rdpBitmap)); if (!graphics->Bitmap_Prototype) { @@ -200,7 +196,7 @@ rdpGraphics* graphics_new(rdpContext* context) graphics->Bitmap_Prototype->size = sizeof(rdpBitmap); graphics->Bitmap_Prototype->New = Bitmap_New; graphics->Bitmap_Prototype->Free = NULL; - graphics->Pointer_Prototype = (rdpPointer*) calloc(1, sizeof(rdpPointer)); + graphics->Pointer_Prototype = (rdpPointer*)calloc(1, sizeof(rdpPointer)); if (!graphics->Pointer_Prototype) { @@ -212,7 +208,7 @@ rdpGraphics* graphics_new(rdpContext* context) graphics->Pointer_Prototype->size = sizeof(rdpPointer); graphics->Pointer_Prototype->New = Pointer_New; graphics->Pointer_Prototype->Free = NULL; - graphics->Glyph_Prototype = (rdpGlyph*) calloc(1, sizeof(rdpGlyph)); + graphics->Glyph_Prototype = (rdpGlyph*)calloc(1, sizeof(rdpGlyph)); if (!graphics->Glyph_Prototype) { diff --git a/libfreerdp/core/heartbeat.c b/libfreerdp/core/heartbeat.c index 6003dde6b..31af05fe3 100644 --- a/libfreerdp/core/heartbeat.c +++ b/libfreerdp/core/heartbeat.c @@ -36,24 +36,25 @@ int rdp_recv_heartbeat_packet(rdpRdp* rdp, wStream* s) return -1; Stream_Read_UINT8(s, reserved); /* reserved (1 byte) */ - Stream_Read_UINT8(s, period); /* period (1 byte) */ - Stream_Read_UINT8(s, count1); /* count1 (1 byte) */ - Stream_Read_UINT8(s, count2); /* count2 (1 byte) */ + Stream_Read_UINT8(s, period); /* period (1 byte) */ + Stream_Read_UINT8(s, count1); /* count1 (1 byte) */ + Stream_Read_UINT8(s, count2); /* count2 (1 byte) */ - WLog_DBG(HEARTBEAT_TAG, "received Heartbeat PDU -> period=%"PRIu8", count1=%"PRIu8", count2=%"PRIu8"", period, count1, count2); + WLog_DBG(HEARTBEAT_TAG, + "received Heartbeat PDU -> period=%" PRIu8 ", count1=%" PRIu8 ", count2=%" PRIu8 "", + period, count1, count2); return 0; } rdpHeartbeat* heartbeat_new(void) { - rdpHeartbeat* heartbeat = (rdpHeartbeat*) calloc(1, sizeof(rdpHeartbeat)); + rdpHeartbeat* heartbeat = (rdpHeartbeat*)calloc(1, sizeof(rdpHeartbeat)); if (heartbeat) { - } - + return heartbeat; } diff --git a/libfreerdp/core/info.c b/libfreerdp/core/info.c index c2e5b8aeb..cbcc14536 100644 --- a/libfreerdp/core/info.c +++ b/libfreerdp/core/info.c @@ -35,41 +35,36 @@ #define TAG FREERDP_TAG("core.info") -static const char* const INFO_TYPE_LOGON_STRINGS[4] = -{ - "Logon Info V1", - "Logon Info V2", - "Logon Plain Notify", - "Logon Extended Info" -}; +static const char* const INFO_TYPE_LOGON_STRINGS[4] = { "Logon Info V1", "Logon Info V2", + "Logon Plain Notify", + "Logon Extended Info" }; /* This define limits the length of the strings in the label field. */ #define MAX_LABEL_LENGTH 40 static struct { - UINT32 flag; + UINT32 flag; const char* label; -} const info_flags[] = -{ - {INFO_MOUSE, "INFO_MOUSE"}, - {INFO_DISABLECTRLALTDEL, "INFO_DISABLECTRLALTDEL"}, - {INFO_AUTOLOGON, "INFO_AUTOLOGON"}, - {INFO_UNICODE, "INFO_UNICODE"}, - {INFO_MAXIMIZESHELL, "INFO_MAXIMIZESHELL"}, - {INFO_LOGONNOTIFY, "INFO_LOGONNOTIFY"}, - {INFO_COMPRESSION, "INFO_COMPRESSION"}, - {INFO_ENABLEWINDOWSKEY, "INFO_ENABLEWINDOWSKEY"}, - {INFO_REMOTECONSOLEAUDIO, "INFO_REMOTECONSOLEAUDIO"}, - {INFO_FORCE_ENCRYPTED_CS_PDU, "INFO_FORCE_ENCRYPTED_CS_PDU"}, - {INFO_RAIL, "INFO_RAIL"}, - {INFO_LOGONERRORS, "INFO_LOGONERRORS"}, - {INFO_MOUSE_HAS_WHEEL, "INFO_MOUSE_HAS_WHEEL"}, - {INFO_PASSWORD_IS_SC_PIN, "INFO_PASSWORD_IS_SC_PIN"}, - {INFO_NOAUDIOPLAYBACK, "INFO_NOAUDIOPLAYBACK"}, - {INFO_USING_SAVED_CREDS, "INFO_USING_SAVED_CREDS"}, - {INFO_AUDIOCAPTURE, "INFO_AUDIOCAPTURE"}, - {INFO_VIDEO_DISABLE, "INFO_VIDEO_DISABLE"}, - {INFO_HIDEF_RAIL_SUPPORTED, "INFO_HIDEF_RAIL_SUPPORTED"}, +} const info_flags[] = { + { INFO_MOUSE, "INFO_MOUSE" }, + { INFO_DISABLECTRLALTDEL, "INFO_DISABLECTRLALTDEL" }, + { INFO_AUTOLOGON, "INFO_AUTOLOGON" }, + { INFO_UNICODE, "INFO_UNICODE" }, + { INFO_MAXIMIZESHELL, "INFO_MAXIMIZESHELL" }, + { INFO_LOGONNOTIFY, "INFO_LOGONNOTIFY" }, + { INFO_COMPRESSION, "INFO_COMPRESSION" }, + { INFO_ENABLEWINDOWSKEY, "INFO_ENABLEWINDOWSKEY" }, + { INFO_REMOTECONSOLEAUDIO, "INFO_REMOTECONSOLEAUDIO" }, + { INFO_FORCE_ENCRYPTED_CS_PDU, "INFO_FORCE_ENCRYPTED_CS_PDU" }, + { INFO_RAIL, "INFO_RAIL" }, + { INFO_LOGONERRORS, "INFO_LOGONERRORS" }, + { INFO_MOUSE_HAS_WHEEL, "INFO_MOUSE_HAS_WHEEL" }, + { INFO_PASSWORD_IS_SC_PIN, "INFO_PASSWORD_IS_SC_PIN" }, + { INFO_NOAUDIOPLAYBACK, "INFO_NOAUDIOPLAYBACK" }, + { INFO_USING_SAVED_CREDS, "INFO_USING_SAVED_CREDS" }, + { INFO_AUDIOCAPTURE, "INFO_AUDIOCAPTURE" }, + { INFO_VIDEO_DISABLE, "INFO_VIDEO_DISABLE" }, + { INFO_HIDEF_RAIL_SUPPORTED, "INFO_HIDEF_RAIL_SUPPORTED" }, }; FREERDP_LOCAL char* rdp_info_package_flags_description(UINT32 flags) @@ -79,7 +74,7 @@ FREERDP_LOCAL char* rdp_info_package_flags_description(UINT32 flags) size_t i; size_t size; - for (i = 0; i < ARRAYSIZE(info_flags); i ++) + for (i = 0; i < ARRAYSIZE(info_flags); i++) maximum_size += strnlen(info_flags[i].label, MAX_LABEL_LENGTH) + 1; result = calloc(maximum_size, sizeof(char)); @@ -87,7 +82,7 @@ FREERDP_LOCAL char* rdp_info_package_flags_description(UINT32 flags) if (!result) return 0; - for (i = 0; i < ARRAYSIZE(info_flags); i ++) + for (i = 0; i < ARRAYSIZE(info_flags); i++) { if (info_flags[i].flag & flags) { @@ -104,7 +99,6 @@ FREERDP_LOCAL char* rdp_info_package_flags_description(UINT32 flags) return result; } - static BOOL rdp_compute_client_auto_reconnect_cookie(rdpRdp* rdp) { BYTE ClientRandom[32]; @@ -159,23 +153,26 @@ static BOOL rdp_read_server_auto_reconnect_cookie(rdpRdp* rdp, wStream* s, logon return FALSE; } - Stream_Read_UINT32(s, autoReconnectCookie->version); /* Version (4 bytes) */ - Stream_Read_UINT32(s, autoReconnectCookie->logonId); /* LogonId (4 bytes) */ + Stream_Read_UINT32(s, autoReconnectCookie->version); /* Version (4 bytes) */ + Stream_Read_UINT32(s, autoReconnectCookie->logonId); /* LogonId (4 bytes) */ Stream_Read(s, autoReconnectCookie->arcRandomBits, 16); /* ArcRandomBits (16 bytes) */ p = autoReconnectCookie->arcRandomBits; - WLog_DBG(TAG, "ServerAutoReconnectCookie: Version: %"PRIu32" LogonId: %"PRIu32" SecurityVerifier: " - "%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"" - "%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"", - autoReconnectCookie->version, autoReconnectCookie->logonId, - p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], - p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15]); + WLog_DBG(TAG, + "ServerAutoReconnectCookie: Version: %" PRIu32 " LogonId: %" PRIu32 + " SecurityVerifier: " + "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "" + "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "", + autoReconnectCookie->version, autoReconnectCookie->logonId, p[0], p[1], p[2], p[3], + p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15]); info->LogonId = autoReconnectCookie->logonId; CopyMemory(info->ArcRandomBits, p, 16); if ((settings->PrintReconnectCookie)) { char* base64; - base64 = crypto_base64_encode((BYTE*) autoReconnectCookie, sizeof(ARC_SC_PRIVATE_PACKET)); + base64 = crypto_base64_encode((BYTE*)autoReconnectCookie, sizeof(ARC_SC_PRIVATE_PACKET)); WLog_INFO(TAG, "Reconnect-cookie: %s", base64); free(base64); } @@ -199,9 +196,9 @@ static BOOL rdp_read_client_auto_reconnect_cookie(rdpRdp* rdp, wStream* s) if (Stream_GetRemainingLength(s) < 28) return FALSE; - Stream_Read_UINT32(s, autoReconnectCookie->cbLen); /* cbLen (4 bytes) */ - Stream_Read_UINT32(s, autoReconnectCookie->version); /* version (4 bytes) */ - Stream_Read_UINT32(s, autoReconnectCookie->logonId); /* LogonId (4 bytes) */ + Stream_Read_UINT32(s, autoReconnectCookie->cbLen); /* cbLen (4 bytes) */ + Stream_Read_UINT32(s, autoReconnectCookie->version); /* version (4 bytes) */ + Stream_Read_UINT32(s, autoReconnectCookie->logonId); /* LogonId (4 bytes) */ Stream_Read(s, autoReconnectCookie->securityVerifier, 16); /* SecurityVerifier */ return TRUE; } @@ -220,15 +217,17 @@ static void rdp_write_client_auto_reconnect_cookie(rdpRdp* rdp, wStream* s) rdpSettings* settings = rdp->settings; autoReconnectCookie = settings->ClientAutoReconnectCookie; p = autoReconnectCookie->securityVerifier; - WLog_DBG(TAG, "ClientAutoReconnectCookie: Version: %"PRIu32" LogonId: %"PRIu32" ArcRandomBits: " - "%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"" - "%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"", - autoReconnectCookie->version, autoReconnectCookie->logonId, - p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], - p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15]); - Stream_Write_UINT32(s, autoReconnectCookie->cbLen); /* cbLen (4 bytes) */ - Stream_Write_UINT32(s, autoReconnectCookie->version); /* version (4 bytes) */ - Stream_Write_UINT32(s, autoReconnectCookie->logonId); /* LogonId (4 bytes) */ + WLog_DBG(TAG, + "ClientAutoReconnectCookie: Version: %" PRIu32 " LogonId: %" PRIu32 " ArcRandomBits: " + "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "" + "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "%02" PRIX8 + "%02" PRIX8 "", + autoReconnectCookie->version, autoReconnectCookie->logonId, p[0], p[1], p[2], p[3], + p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15]); + Stream_Write_UINT32(s, autoReconnectCookie->cbLen); /* cbLen (4 bytes) */ + Stream_Write_UINT32(s, autoReconnectCookie->version); /* version (4 bytes) */ + Stream_Write_UINT32(s, autoReconnectCookie->logonId); /* LogonId (4 bytes) */ Stream_Write(s, autoReconnectCookie->securityVerifier, 16); /* SecurityVerifier (16 bytes) */ } @@ -252,7 +251,7 @@ static BOOL rdp_read_extended_info_packet(rdpRdp* rdp, wStream* s) return FALSE; Stream_Read_UINT16(s, clientAddressFamily); /* clientAddressFamily (2 bytes) */ - Stream_Read_UINT16(s, cbClientAddress); /* cbClientAddress (2 bytes) */ + Stream_Read_UINT16(s, cbClientAddress); /* cbClientAddress (2 bytes) */ /* cbClientAddress is the size in bytes of the character data in the clientAddress field. * This size includes the length of the mandatory null terminator. @@ -263,7 +262,8 @@ static BOOL rdp_read_extended_info_packet(rdpRdp* rdp, wStream* s) if ((cbClientAddress % 2) || cbClientAddress > 80) { - WLog_ERR(TAG, "protocol error: invalid cbClientAddress value: %"PRIu16"", cbClientAddress); + WLog_ERR(TAG, "protocol error: invalid cbClientAddress value: %" PRIu16 "", + cbClientAddress); return FALSE; } @@ -280,7 +280,7 @@ static BOOL rdp_read_extended_info_packet(rdpRdp* rdp, wStream* s) if (cbClientAddress) { - wstr = (WCHAR*) Stream_Pointer(s); + wstr = (WCHAR*)Stream_Pointer(s); if (wstr[cbClientAddress / 2 - 1]) { @@ -313,7 +313,7 @@ static BOOL rdp_read_extended_info_packet(rdpRdp* rdp, wStream* s) if ((cbClientDir % 2) || cbClientDir > 512) { - WLog_ERR(TAG, "protocol error: invalid cbClientDir value: %"PRIu16"", cbClientDir); + WLog_ERR(TAG, "protocol error: invalid cbClientDir value: %" PRIu16 "", cbClientDir); return FALSE; } @@ -328,7 +328,7 @@ static BOOL rdp_read_extended_info_packet(rdpRdp* rdp, wStream* s) if (cbClientDir) { - wstr = (WCHAR*) Stream_Pointer(s); + wstr = (WCHAR*)Stream_Pointer(s); if (wstr[cbClientDir / 2 - 1]) { @@ -336,8 +336,8 @@ static BOOL rdp_read_extended_info_packet(rdpRdp* rdp, wStream* s) return FALSE; } - if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) Stream_Pointer(s), -1, &settings->ClientDir, 0, NULL, - NULL) < 1) + if (ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)Stream_Pointer(s), -1, &settings->ClientDir, 0, + NULL, NULL) < 1) { WLog_ERR(TAG, "failed to convert client directory"); return FALSE; @@ -418,9 +418,10 @@ static void rdp_write_extended_info_packet(rdpRdp* rdp, wStream* s) int cbAutoReconnectCookie; rdpSettings* settings = rdp->settings; clientAddressFamily = settings->IPv6Enabled ? ADDRESS_FAMILY_INET6 : ADDRESS_FAMILY_INET; - cbClientAddress = ConvertToUnicode(CP_UTF8, 0, settings->ClientAddress, -1, &clientAddress, 0) * 2; + cbClientAddress = + ConvertToUnicode(CP_UTF8, 0, settings->ClientAddress, -1, &clientAddress, 0) * 2; cbClientDir = ConvertToUnicode(CP_UTF8, 0, settings->ClientDir, -1, &clientDir, 0) * 2; - cbAutoReconnectCookie = (int) settings->ServerAutoReconnectCookie->cbLen; + cbAutoReconnectCookie = (int)settings->ServerAutoReconnectCookie->cbLen; Stream_Write_UINT16(s, clientAddressFamily); /* clientAddressFamily (2 bytes) */ Stream_Write_UINT16(s, cbClientAddress + 2); /* cbClientAddress (2 bytes) */ @@ -435,17 +436,17 @@ static void rdp_write_extended_info_packet(rdpRdp* rdp, wStream* s) Stream_Write_UINT16(s, 0); rdp_write_client_time_zone(s, settings); /* clientTimeZone (172 bytes) */ - Stream_Write_UINT32(s, 0); /* clientSessionId (4 bytes), should be set to 0 */ + Stream_Write_UINT32(s, 0); /* clientSessionId (4 bytes), should be set to 0 */ freerdp_performance_flags_make(settings); Stream_Write_UINT32(s, settings->PerformanceFlags); /* performanceFlags (4 bytes) */ - Stream_Write_UINT16(s, cbAutoReconnectCookie); /* cbAutoReconnectCookie (2 bytes) */ + Stream_Write_UINT16(s, cbAutoReconnectCookie); /* cbAutoReconnectCookie (2 bytes) */ if (cbAutoReconnectCookie > 0) { rdp_compute_client_auto_reconnect_cookie(rdp); rdp_write_client_auto_reconnect_cookie(rdp, s); /* autoReconnectCookie */ - Stream_Write_UINT16(s, 0); /* reserved1 (2 bytes) */ - Stream_Write_UINT16(s, 0); /* reserved2 (2 bytes) */ + Stream_Write_UINT16(s, 0); /* reserved1 (2 bytes) */ + Stream_Write_UINT16(s, 0); /* reserved2 (2 bytes) */ } free(clientAddress); @@ -474,7 +475,7 @@ static BOOL rdp_read_info_packet(rdpRdp* rdp, wStream* s) if (Stream_GetRemainingLength(s) < 18) return FALSE; - Stream_Seek_UINT32(s); /* CodePage (4 bytes ) */ + Stream_Seek_UINT32(s); /* CodePage (4 bytes ) */ Stream_Read_UINT32(s, flags); /* flags (4 bytes) */ settings->AudioCapture = ((flags & INFO_AUDIOCAPTURE) ? TRUE : FALSE); settings->AudioPlayback = ((flags & INFO_NOAUDIOPLAYBACK) ? FALSE : TRUE); @@ -500,11 +501,11 @@ static BOOL rdp_read_info_packet(rdpRdp* rdp, wStream* s) return FALSE; } - Stream_Read_UINT16(s, cbDomain); /* cbDomain (2 bytes) */ - Stream_Read_UINT16(s, cbUserName); /* cbUserName (2 bytes) */ - Stream_Read_UINT16(s, cbPassword); /* cbPassword (2 bytes) */ + Stream_Read_UINT16(s, cbDomain); /* cbDomain (2 bytes) */ + Stream_Read_UINT16(s, cbUserName); /* cbUserName (2 bytes) */ + Stream_Read_UINT16(s, cbPassword); /* cbPassword (2 bytes) */ Stream_Read_UINT16(s, cbAlternateShell); /* cbAlternateShell (2 bytes) */ - Stream_Read_UINT16(s, cbWorkingDir); /* cbWorkingDir (2 bytes) */ + Stream_Read_UINT16(s, cbWorkingDir); /* cbWorkingDir (2 bytes) */ if (Stream_GetRemainingLength(s) < (size_t)(cbDomain + 2)) return FALSE; @@ -517,11 +518,11 @@ static BOOL rdp_read_info_packet(rdpRdp* rdp, wStream* s) */ if ((cbDomain % 2) || cbDomain > 512) { - WLog_ERR(TAG, "protocol error: invalid cbDomain value: %"PRIu16"", cbDomain); + WLog_ERR(TAG, "protocol error: invalid cbDomain value: %" PRIu16 "", cbDomain); return FALSE; } - wstr = (WCHAR*) Stream_Pointer(s); + wstr = (WCHAR*)Stream_Pointer(s); if (wstr[cbDomain / 2]) { @@ -551,11 +552,11 @@ static BOOL rdp_read_info_packet(rdpRdp* rdp, wStream* s) */ if ((cbUserName % 2) || cbUserName > 512) { - WLog_ERR(TAG, "protocol error: invalid cbUserName value: %"PRIu16"", cbUserName); + WLog_ERR(TAG, "protocol error: invalid cbUserName value: %" PRIu16 "", cbUserName); return FALSE; } - wstr = (WCHAR*) Stream_Pointer(s); + wstr = (WCHAR*)Stream_Pointer(s); if (wstr[cbUserName / 2]) { @@ -585,11 +586,11 @@ static BOOL rdp_read_info_packet(rdpRdp* rdp, wStream* s) */ if ((cbPassword % 2) || cbPassword > LB_PASSWORD_MAX_LENGTH) { - WLog_ERR(TAG, "protocol error: invalid cbPassword value: %"PRIu16"", cbPassword); + WLog_ERR(TAG, "protocol error: invalid cbPassword value: %" PRIu16 "", cbPassword); return FALSE; } - wstr = (WCHAR*) Stream_Pointer(s); + wstr = (WCHAR*)Stream_Pointer(s); if (wstr[cbPassword / 2]) { @@ -619,11 +620,12 @@ static BOOL rdp_read_info_packet(rdpRdp* rdp, wStream* s) */ if ((cbAlternateShell % 2) || cbAlternateShell > 512) { - WLog_ERR(TAG, "protocol error: invalid cbAlternateShell value: %"PRIu16"", cbAlternateShell); + WLog_ERR(TAG, "protocol error: invalid cbAlternateShell value: %" PRIu16 "", + cbAlternateShell); return FALSE; } - wstr = (WCHAR*) Stream_Pointer(s); + wstr = (WCHAR*)Stream_Pointer(s); if (wstr[cbAlternateShell / 2]) { @@ -653,11 +655,11 @@ static BOOL rdp_read_info_packet(rdpRdp* rdp, wStream* s) */ if ((cbWorkingDir % 2) || cbWorkingDir > 512) { - WLog_ERR(TAG, "protocol error: invalid cbWorkingDir value: %"PRIu16"", cbWorkingDir); + WLog_ERR(TAG, "protocol error: invalid cbWorkingDir value: %" PRIu16 "", cbWorkingDir); return FALSE; } - wstr = (WCHAR*) Stream_Pointer(s); + wstr = (WCHAR*)Stream_Pointer(s); if (wstr[cbWorkingDir / 2]) { @@ -665,7 +667,8 @@ static BOOL rdp_read_info_packet(rdpRdp* rdp, wStream* s) return FALSE; } - if (ConvertFromUnicode(CP_UTF8, 0, wstr, -1, &settings->ShellWorkingDirectory, 0, NULL, NULL) < 1) + if (ConvertFromUnicode(CP_UTF8, 0, wstr, -1, &settings->ShellWorkingDirectory, 0, NULL, + NULL) < 1) { WLog_ERR(TAG, "failed to convert AlternateShell string"); return FALSE; @@ -704,13 +707,8 @@ static void rdp_write_info_packet(rdpRdp* rdp, wStream* s) int cbWorkingDir = 0; BOOL usedPasswordCookie = FALSE; rdpSettings* settings = rdp->settings; - flags = INFO_MOUSE | - INFO_UNICODE | - INFO_LOGONERRORS | - INFO_MAXIMIZESHELL | - INFO_ENABLEWINDOWSKEY | - INFO_DISABLECTRLALTDEL | - INFO_MOUSE_HAS_WHEEL | + flags = INFO_MOUSE | INFO_UNICODE | INFO_LOGONERRORS | INFO_MAXIMIZESHELL | + INFO_ENABLEWINDOWSKEY | INFO_DISABLECTRLALTDEL | INFO_MOUSE_HAS_WHEEL | INFO_FORCE_ENCRYPTED_CS_PDU; if (settings->SmartcardLogon) @@ -788,7 +786,7 @@ static void rdp_write_info_packet(rdpRdp* rdp, wStream* s) if (settings->RedirectionPassword && settings->RedirectionPasswordLength > 0) { usedPasswordCookie = TRUE; - passwordW = (WCHAR*) settings->RedirectionPassword; + passwordW = (WCHAR*)settings->RedirectionPassword; cbPassword = settings->RedirectionPasswordLength; } else @@ -807,8 +805,8 @@ static void rdp_write_info_packet(rdpRdp* rdp, wStream* s) if (!settings->RemoteAssistanceMode) { - cbAlternateShell = ConvertToUnicode(CP_UTF8, 0, settings->AlternateShell, -1, &alternateShellW, - 0) * 2; + cbAlternateShell = + ConvertToUnicode(CP_UTF8, 0, settings->AlternateShell, -1, &alternateShellW, 0) * 2; } else { @@ -821,7 +819,8 @@ static void rdp_write_info_packet(rdpRdp* rdp, wStream* s) { /* This field must contain the remote assistance password */ cbAlternateShell = ConvertToUnicode(CP_UTF8, 0, settings->RemoteAssistancePassword, -1, - &alternateShellW, 0) * 2; + &alternateShellW, 0) * + 2; } } @@ -830,25 +829,26 @@ static void rdp_write_info_packet(rdpRdp* rdp, wStream* s) if (!settings->RemoteAssistanceMode) { - cbWorkingDir = ConvertToUnicode(CP_UTF8, 0, settings->ShellWorkingDirectory, -1, &workingDirW, - 0) * 2; + cbWorkingDir = + ConvertToUnicode(CP_UTF8, 0, settings->ShellWorkingDirectory, -1, &workingDirW, 0) * 2; } else { /* Remote Assistance Session Id */ - cbWorkingDir = ConvertToUnicode(CP_UTF8, 0, settings->RemoteAssistanceSessionId, -1, &workingDirW, - 0) * 2; + cbWorkingDir = + ConvertToUnicode(CP_UTF8, 0, settings->RemoteAssistanceSessionId, -1, &workingDirW, 0) * + 2; } /* excludes (!) the length of the mandatory null terminator */ cbWorkingDir = cbWorkingDir >= 2 ? cbWorkingDir - 2 : cbWorkingDir; - Stream_Write_UINT32(s, 0); /* CodePage (4 bytes) */ - Stream_Write_UINT32(s, flags); /* flags (4 bytes) */ - Stream_Write_UINT16(s, cbDomain); /* cbDomain (2 bytes) */ - Stream_Write_UINT16(s, cbUserName); /* cbUserName (2 bytes) */ - Stream_Write_UINT16(s, cbPassword); /* cbPassword (2 bytes) */ + Stream_Write_UINT32(s, 0); /* CodePage (4 bytes) */ + Stream_Write_UINT32(s, flags); /* flags (4 bytes) */ + Stream_Write_UINT16(s, cbDomain); /* cbDomain (2 bytes) */ + Stream_Write_UINT16(s, cbUserName); /* cbUserName (2 bytes) */ + Stream_Write_UINT16(s, cbPassword); /* cbPassword (2 bytes) */ Stream_Write_UINT16(s, cbAlternateShell); /* cbAlternateShell (2 bytes) */ - Stream_Write_UINT16(s, cbWorkingDir); /* cbWorkingDir (2 bytes) */ + Stream_Write_UINT16(s, cbWorkingDir); /* cbWorkingDir (2 bytes) */ if (cbDomain > 0) Stream_Write(s, domainW, cbDomain); @@ -975,11 +975,11 @@ static BOOL rdp_recv_logon_info_v1(rdpRdp* rdp, wStream* s, logon_info* info) { if ((cbDomain % 2) || cbDomain > 52) { - WLog_ERR(TAG, "protocol error: invalid cbDomain value: %"PRIu32"", cbDomain); + WLog_ERR(TAG, "protocol error: invalid cbDomain value: %" PRIu32 "", cbDomain); goto fail; } - wstr = (WCHAR*) Stream_Pointer(s); + wstr = (WCHAR*)Stream_Pointer(s); if (wstr[cbDomain / 2 - 1]) { @@ -994,7 +994,7 @@ static BOOL rdp_recv_logon_info_v1(rdpRdp* rdp, wStream* s, logon_info* info) } } - Stream_Seek(s, 52); /* domain (52 bytes) */ + Stream_Seek(s, 52); /* domain (52 bytes) */ Stream_Read_UINT32(s, cbUserName); /* cbUserName (4 bytes) */ /* cbUserName is the size of the Unicode character data (including the mandatory @@ -1004,11 +1004,11 @@ static BOOL rdp_recv_logon_info_v1(rdpRdp* rdp, wStream* s, logon_info* info) { if ((cbUserName % 2) || cbUserName > 512) { - WLog_ERR(TAG, "protocol error: invalid cbUserName value: %"PRIu32"", cbUserName); + WLog_ERR(TAG, "protocol error: invalid cbUserName value: %" PRIu32 "", cbUserName); goto fail; } - wstr = (WCHAR*) Stream_Pointer(s); + wstr = (WCHAR*)Stream_Pointer(s); if (wstr[cbUserName / 2 - 1]) { @@ -1023,9 +1023,9 @@ static BOOL rdp_recv_logon_info_v1(rdpRdp* rdp, wStream* s, logon_info* info) } } - Stream_Seek(s, 512); /* userName (512 bytes) */ + Stream_Seek(s, 512); /* userName (512 bytes) */ Stream_Read_UINT32(s, info->sessionId); /* SessionId (4 bytes) */ - WLog_DBG(TAG, "LogonInfoV1: SessionId: 0x%08"PRIX32" UserName: [%s] Domain: [%s]", + WLog_DBG(TAG, "LogonInfoV1: SessionId: 0x%08" PRIX32 " UserName: [%s] Domain: [%s]", info->sessionId, info->username, info->domain); return TRUE; fail: @@ -1048,12 +1048,12 @@ static BOOL rdp_recv_logon_info_v2(rdpRdp* rdp, wStream* s, logon_info* info) if (Stream_GetRemainingLength(s) < 576) return FALSE; - Stream_Read_UINT16(s, Version); /* Version (2 bytes) */ - Stream_Read_UINT32(s, Size); /* Size (4 bytes) */ + Stream_Read_UINT16(s, Version); /* Version (2 bytes) */ + Stream_Read_UINT32(s, Size); /* Size (4 bytes) */ Stream_Read_UINT32(s, info->sessionId); /* SessionId (4 bytes) */ - Stream_Read_UINT32(s, cbDomain); /* cbDomain (4 bytes) */ - Stream_Read_UINT32(s, cbUserName); /* cbUserName (4 bytes) */ - Stream_Seek(s, 558); /* pad (558 bytes) */ + Stream_Read_UINT32(s, cbDomain); /* cbDomain (4 bytes) */ + Stream_Read_UINT32(s, cbUserName); /* cbUserName (4 bytes) */ + Stream_Seek(s, 558); /* pad (558 bytes) */ /* cbDomain is the size in bytes of the Unicode character data in the Domain field. * The size of the mandatory null terminator is include in this value. @@ -1065,17 +1065,17 @@ static BOOL rdp_recv_logon_info_v2(rdpRdp* rdp, wStream* s, logon_info* info) { if ((cbDomain % 2) || cbDomain > 52) { - WLog_ERR(TAG, "protocol error: invalid cbDomain value: %"PRIu32"", cbDomain); + WLog_ERR(TAG, "protocol error: invalid cbDomain value: %" PRIu32 "", cbDomain); goto fail; } - if (Stream_GetRemainingLength(s) < (size_t) cbDomain) + if (Stream_GetRemainingLength(s) < (size_t)cbDomain) { WLog_ERR(TAG, "insufficient remaining stream length"); goto fail; } - wstr = (WCHAR*) Stream_Pointer(s); + wstr = (WCHAR*)Stream_Pointer(s); if (wstr[cbDomain / 2 - 1]) { @@ -1102,17 +1102,17 @@ static BOOL rdp_recv_logon_info_v2(rdpRdp* rdp, wStream* s, logon_info* info) { if ((cbUserName % 2) || cbUserName < 2 || cbUserName > 512) { - WLog_ERR(TAG, "protocol error: invalid cbUserName value: %"PRIu32"", cbUserName); + WLog_ERR(TAG, "protocol error: invalid cbUserName value: %" PRIu32 "", cbUserName); goto fail; } - if (Stream_GetRemainingLength(s) < (size_t) cbUserName) + if (Stream_GetRemainingLength(s) < (size_t)cbUserName) { WLog_ERR(TAG, "insufficient remaining stream length"); goto fail; } - wstr = (WCHAR*) Stream_Pointer(s); + wstr = (WCHAR*)Stream_Pointer(s); if (wstr[cbUserName / 2 - 1]) { @@ -1128,7 +1128,7 @@ static BOOL rdp_recv_logon_info_v2(rdpRdp* rdp, wStream* s, logon_info* info) } Stream_Seek(s, cbUserName); /* userName */ - WLog_DBG(TAG, "LogonInfoV2: SessionId: 0x%08"PRIX32" UserName: [%s] Domain: [%s]", + WLog_DBG(TAG, "LogonInfoV2: SessionId: 0x%08" PRIX32 " UserName: [%s] Domain: [%s]", info->sessionId, info->username, info->domain); return TRUE; fail: @@ -1159,9 +1159,10 @@ static BOOL rdp_recv_logon_error_info(rdpRdp* rdp, wStream* s, logon_info_ex* in Stream_Read_UINT32(s, errorNotificationType); /* errorNotificationType (4 bytes) */ Stream_Read_UINT32(s, errorNotificationData); /* errorNotificationData (4 bytes) */ - WLog_DBG(TAG, "LogonErrorInfo: Data: 0x%08"PRIX32" Type: 0x%08"PRIX32"", + WLog_DBG(TAG, "LogonErrorInfo: Data: 0x%08" PRIX32 " Type: 0x%08" PRIX32 "", errorNotificationData, errorNotificationType); - IFCALL(rdp->instance->LogonErrorInfo, rdp->instance, errorNotificationData, errorNotificationType); + IFCALL(rdp->instance->LogonErrorInfo, rdp->instance, errorNotificationData, + errorNotificationType); info->ErrorNotificationType = errorNotificationType; info->ErrorNotificationData = errorNotificationData; return TRUE; @@ -1176,13 +1177,13 @@ static BOOL rdp_recv_logon_info_extended(rdpRdp* rdp, wStream* s, logon_info_ex* if (Stream_GetRemainingLength(s) < 6) return FALSE; - Stream_Read_UINT16(s, Length); /* Length (2 bytes) */ + Stream_Read_UINT16(s, Length); /* Length (2 bytes) */ Stream_Read_UINT32(s, fieldsPresent); /* fieldsPresent (4 bytes) */ if ((Length < 6) || (Stream_GetRemainingLength(s) < (Length - 6U))) return FALSE; - WLog_DBG(TAG, "LogonInfoExtended: fieldsPresent: 0x%08"PRIX32"", fieldsPresent); + WLog_DBG(TAG, "LogonInfoExtended: fieldsPresent: 0x%08" PRIX32 "", fieldsPresent); /* logonFields */ @@ -1280,14 +1281,14 @@ BOOL rdp_recv_save_session_info(rdpRdp* rdp, wStream* s) break; default: - WLog_ERR(TAG, "Unhandled saveSessionInfo type 0x%"PRIx32"", infoType); + WLog_ERR(TAG, "Unhandled saveSessionInfo type 0x%" PRIx32 "", infoType); status = TRUE; break; } if (!status) { - WLog_DBG(TAG, "SaveSessionInfo error: infoType: %s (%"PRIu32")", + WLog_DBG(TAG, "SaveSessionInfo error: infoType: %s (%" PRIu32 ")", infoType < 4 ? INFO_TYPE_LOGON_STRINGS[infoType % 4] : "Unknown", infoType); } @@ -1414,16 +1415,16 @@ static BOOL rdp_write_logon_info_ex(wStream* s, logon_info_ex* info) if (info->haveCookie) { - Stream_Write_UINT32(s, 28); /* cbFieldData (4 bytes) */ - Stream_Write_UINT32(s, 28); /* cbLen (4 bytes) */ - Stream_Write_UINT32(s, AUTO_RECONNECT_VERSION_1); /* Version (4 bytes) */ - Stream_Write_UINT32(s, info->LogonId); /* LogonId (4 bytes) */ - Stream_Write(s, info->ArcRandomBits, 16); /* ArcRandomBits (16 bytes) */ + Stream_Write_UINT32(s, 28); /* cbFieldData (4 bytes) */ + Stream_Write_UINT32(s, 28); /* cbLen (4 bytes) */ + Stream_Write_UINT32(s, AUTO_RECONNECT_VERSION_1); /* Version (4 bytes) */ + Stream_Write_UINT32(s, info->LogonId); /* LogonId (4 bytes) */ + Stream_Write(s, info->ArcRandomBits, 16); /* ArcRandomBits (16 bytes) */ } if (info->haveErrorInfo) { - Stream_Write_UINT32(s, 8); /* cbFieldData (4 bytes) */ + Stream_Write_UINT32(s, 8); /* cbFieldData (4 bytes) */ Stream_Write_UINT32(s, info->ErrorNotificationType); /* ErrorNotificationType (4 bytes) */ Stream_Write_UINT32(s, info->ErrorNotificationData); /* ErrorNotificationData (4 bytes) */ } @@ -1463,7 +1464,7 @@ BOOL rdp_send_save_session_info(rdpContext* context, UINT32 type, void* data) break; default: - WLog_ERR(TAG, "saveSessionInfo type 0x%"PRIx32" not handled", type); + WLog_ERR(TAG, "saveSessionInfo type 0x%" PRIx32 " not handled", type); status = FALSE; break; } @@ -1486,5 +1487,6 @@ BOOL rdp_send_server_status_info(rdpContext* context, UINT32 status) return FALSE; Stream_Write_UINT32(s, status); - return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_STATUS_INFO, rdp->mcs->userId);; + return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_STATUS_INFO, rdp->mcs->userId); + ; } diff --git a/libfreerdp/core/info.h b/libfreerdp/core/info.h index dd6458ca5..13d688563 100644 --- a/libfreerdp/core/info.h +++ b/libfreerdp/core/info.h @@ -28,33 +28,33 @@ #include /* Client Address Family */ -#define ADDRESS_FAMILY_INET 0x0002 -#define ADDRESS_FAMILY_INET6 0x0017 +#define ADDRESS_FAMILY_INET 0x0002 +#define ADDRESS_FAMILY_INET6 0x0017 /* Client Info Packet Flags */ -#define INFO_MOUSE 0x00000001 -#define INFO_DISABLECTRLALTDEL 0x00000002 -#define INFO_AUTOLOGON 0x00000008 -#define INFO_UNICODE 0x00000010 -#define INFO_MAXIMIZESHELL 0x00000020 -#define INFO_LOGONNOTIFY 0x00000040 -#define INFO_COMPRESSION 0x00000080 -#define INFO_ENABLEWINDOWSKEY 0x00000100 -#define INFO_REMOTECONSOLEAUDIO 0x00002000 -#define INFO_FORCE_ENCRYPTED_CS_PDU 0x00004000 -#define INFO_RAIL 0x00008000 -#define INFO_LOGONERRORS 0x00010000 -#define INFO_MOUSE_HAS_WHEEL 0x00020000 -#define INFO_PASSWORD_IS_SC_PIN 0x00040000 -#define INFO_NOAUDIOPLAYBACK 0x00080000 -#define INFO_USING_SAVED_CREDS 0x00100000 -#define INFO_AUDIOCAPTURE 0x00200000 -#define INFO_VIDEO_DISABLE 0x00400000 -#define INFO_HIDEF_RAIL_SUPPORTED 0x02000000 +#define INFO_MOUSE 0x00000001 +#define INFO_DISABLECTRLALTDEL 0x00000002 +#define INFO_AUTOLOGON 0x00000008 +#define INFO_UNICODE 0x00000010 +#define INFO_MAXIMIZESHELL 0x00000020 +#define INFO_LOGONNOTIFY 0x00000040 +#define INFO_COMPRESSION 0x00000080 +#define INFO_ENABLEWINDOWSKEY 0x00000100 +#define INFO_REMOTECONSOLEAUDIO 0x00002000 +#define INFO_FORCE_ENCRYPTED_CS_PDU 0x00004000 +#define INFO_RAIL 0x00008000 +#define INFO_LOGONERRORS 0x00010000 +#define INFO_MOUSE_HAS_WHEEL 0x00020000 +#define INFO_PASSWORD_IS_SC_PIN 0x00040000 +#define INFO_NOAUDIOPLAYBACK 0x00080000 +#define INFO_USING_SAVED_CREDS 0x00100000 +#define INFO_AUDIOCAPTURE 0x00200000 +#define INFO_VIDEO_DISABLE 0x00400000 +#define INFO_HIDEF_RAIL_SUPPORTED 0x02000000 /* Extended Logon Info */ -#define LOGON_EX_AUTORECONNECTCOOKIE 0x00000001 -#define LOGON_EX_LOGONERRORS 0x00000002 +#define LOGON_EX_AUTORECONNECTCOOKIE 0x00000001 +#define LOGON_EX_LOGONERRORS 0x00000002 #define SAVE_SESSION_PDU_VERSION_ONE 0x0001 diff --git a/libfreerdp/core/input.c b/libfreerdp/core/input.c index b871133f8..3f6336961 100644 --- a/libfreerdp/core/input.c +++ b/libfreerdp/core/input.c @@ -33,13 +33,13 @@ #define TAG FREERDP_TAG("core") /* Input Events */ -#define INPUT_EVENT_SYNC 0x0000 -#define INPUT_EVENT_SCANCODE 0x0004 -#define INPUT_EVENT_UNICODE 0x0005 -#define INPUT_EVENT_MOUSE 0x8001 -#define INPUT_EVENT_MOUSEX 0x8002 +#define INPUT_EVENT_SYNC 0x0000 +#define INPUT_EVENT_SCANCODE 0x0004 +#define INPUT_EVENT_UNICODE 0x0005 +#define INPUT_EVENT_MOUSE 0x8001 +#define INPUT_EVENT_MOUSEX 0x8002 -#define RDP_CLIENT_INPUT_PDU_HEADER_LENGTH 4 +#define RDP_CLIENT_INPUT_PDU_HEADER_LENGTH 4 static void rdp_write_client_input_pdu_header(wStream* s, UINT16 number) { @@ -73,7 +73,7 @@ static BOOL rdp_send_client_input_pdu(rdpRdp* rdp, wStream* s) static void input_write_synchronize_event(wStream* s, UINT32 flags) { - Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ Stream_Write_UINT32(s, flags); /* toggleFlags (4 bytes) */ } @@ -98,8 +98,8 @@ static BOOL input_send_synchronize_event(rdpInput* input, UINT32 flags) static void input_write_keyboard_event(wStream* s, UINT16 flags, UINT16 code) { Stream_Write_UINT16(s, flags); /* keyboardFlags (2 bytes) */ - Stream_Write_UINT16(s, code); /* keyCode (2 bytes) */ - Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ + Stream_Write_UINT16(s, code); /* keyCode (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ } static BOOL input_send_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) @@ -123,8 +123,8 @@ static BOOL input_send_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code static void input_write_unicode_keyboard_event(wStream* s, UINT16 flags, UINT16 code) { Stream_Write_UINT16(s, flags); /* keyboardFlags (2 bytes) */ - Stream_Write_UINT16(s, code); /* unicodeCode (2 bytes) */ - Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ + Stream_Write_UINT16(s, code); /* unicodeCode (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ } static BOOL input_send_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) @@ -154,8 +154,8 @@ static BOOL input_send_unicode_keyboard_event(rdpInput* input, UINT16 flags, UIN static void input_write_mouse_event(wStream* s, UINT16 flags, UINT16 x, UINT16 y) { Stream_Write_UINT16(s, flags); /* pointerFlags (2 bytes) */ - Stream_Write_UINT16(s, x); /* xPos (2 bytes) */ - Stream_Write_UINT16(s, y); /* yPos (2 bytes) */ + Stream_Write_UINT16(s, x); /* xPos (2 bytes) */ + Stream_Write_UINT16(s, y); /* yPos (2 bytes) */ } static BOOL input_send_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) @@ -173,7 +173,8 @@ static BOOL input_send_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT if (flags & PTR_FLAGS_HWHEEL) { WLog_WARN(TAG, - "skip mouse event %"PRIu16"x%"PRIu16" flags=0x%04"PRIX16", no horizontal mouse wheel supported", + "skip mouse event %" PRIu16 "x%" PRIu16 " flags=0x%04" PRIX16 + ", no horizontal mouse wheel supported", x, y, flags); return TRUE; } @@ -191,12 +192,11 @@ static BOOL input_send_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT static void input_write_extended_mouse_event(wStream* s, UINT16 flags, UINT16 x, UINT16 y) { Stream_Write_UINT16(s, flags); /* pointerFlags (2 bytes) */ - Stream_Write_UINT16(s, x); /* xPos (2 bytes) */ - Stream_Write_UINT16(s, y); /* yPos (2 bytes) */ + Stream_Write_UINT16(s, x); /* xPos (2 bytes) */ + Stream_Write_UINT16(s, y); /* yPos (2 bytes) */ } -static BOOL input_send_extended_mouse_event(rdpInput* input, UINT16 flags, - UINT16 x, UINT16 y) +static BOOL input_send_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) { wStream* s; rdpRdp* rdp; @@ -207,7 +207,8 @@ static BOOL input_send_extended_mouse_event(rdpInput* input, UINT16 flags, if (!input->context->settings->HasExtendedMouseEvent) { WLog_WARN(TAG, - "skip extended mouse event %"PRIu16"x%"PRIu16" flags=0x%04"PRIX16", no extended mouse events supported", + "skip extended mouse event %" PRIu16 "x%" PRIu16 " flags=0x%04" PRIX16 + ", no extended mouse events supported", x, y, flags); return TRUE; } @@ -249,8 +250,7 @@ static BOOL input_send_keyboard_pause_event(rdpInput* input) return FALSE; /* Numlock down (0x45) */ - if (!input_send_keyboard_event(input, 0, - RDP_SCANCODE_CODE(RDP_SCANCODE_NUMLOCK))) + if (!input_send_keyboard_event(input, 0, RDP_SCANCODE_CODE(RDP_SCANCODE_NUMLOCK))) return FALSE; /* Control up (0x1D) */ @@ -273,7 +273,7 @@ static BOOL input_send_fastpath_synchronize_event(rdpInput* input, UINT32 flags) rdp = input->context->rdp; /* The FastPath Synchronization eventFlags has identical values as SlowPath */ - s = fastpath_input_pdu_init(rdp->fastpath, (BYTE) flags, FASTPATH_INPUT_EVENT_SYNC); + s = fastpath_input_pdu_init(rdp->fastpath, (BYTE)flags, FASTPATH_INPUT_EVENT_SYNC); if (!s) return FALSE; @@ -329,8 +329,7 @@ static BOOL input_send_fastpath_unicode_keyboard_event(rdpInput* input, UINT16 f return fastpath_send_input_pdu(rdp->fastpath, s); } -static BOOL input_send_fastpath_mouse_event(rdpInput* input, UINT16 flags, - UINT16 x, UINT16 y) +static BOOL input_send_fastpath_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) { wStream* s; rdpRdp* rdp; @@ -345,7 +344,8 @@ static BOOL input_send_fastpath_mouse_event(rdpInput* input, UINT16 flags, if (flags & PTR_FLAGS_HWHEEL) { WLog_WARN(TAG, - "skip mouse event %"PRIu16"x%"PRIu16" flags=0x%04"PRIX16", no horizontal mouse wheel supported", + "skip mouse event %" PRIu16 "x%" PRIu16 " flags=0x%04" PRIX16 + ", no horizontal mouse wheel supported", x, y, flags); return TRUE; } @@ -360,8 +360,8 @@ static BOOL input_send_fastpath_mouse_event(rdpInput* input, UINT16 flags, return fastpath_send_input_pdu(rdp->fastpath, s); } -static BOOL input_send_fastpath_extended_mouse_event(rdpInput* input, UINT16 flags, - UINT16 x, UINT16 y) +static BOOL input_send_fastpath_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, + UINT16 y) { wStream* s; rdpRdp* rdp; @@ -372,7 +372,8 @@ static BOOL input_send_fastpath_extended_mouse_event(rdpInput* input, UINT16 fla if (!input->context->settings->HasExtendedMouseEvent) { WLog_WARN(TAG, - "skip extended mouse event %"PRIu16"x%"PRIu16" flags=0x%04"PRIX16", no extended mouse events supported", + "skip extended mouse event %" PRIu16 "x%" PRIu16 " flags=0x%04" PRIX16 + ", no extended mouse events supported", x, y, flags); return TRUE; } @@ -405,14 +406,14 @@ static BOOL input_send_fastpath_focus_in_event(rdpInput* input, UINT16 toggleSta /* send a tab up like mstsc.exe */ eventFlags = FASTPATH_INPUT_KBDFLAGS_RELEASE | FASTPATH_INPUT_EVENT_SCANCODE << 5; Stream_Write_UINT8(s, eventFlags); /* Key Release event (1 byte) */ - Stream_Write_UINT8(s, 0x0f); /* keyCode (1 byte) */ + Stream_Write_UINT8(s, 0x0f); /* keyCode (1 byte) */ /* send the toggle key states */ eventFlags = (toggleStates & 0x1F) | FASTPATH_INPUT_EVENT_SYNC << 5; Stream_Write_UINT8(s, eventFlags); /* toggle state (1 byte) */ /* send another tab up like mstsc.exe */ eventFlags = FASTPATH_INPUT_KBDFLAGS_RELEASE | FASTPATH_INPUT_EVENT_SCANCODE << 5; Stream_Write_UINT8(s, eventFlags); /* Key Release event (1 byte) */ - Stream_Write_UINT8(s, 0x0f); /* keyCode (1 byte) */ + Stream_Write_UINT8(s, 0x0f); /* keyCode (1 byte) */ return fastpath_send_multiple_input_pdu(rdp->fastpath, s, 3); } @@ -424,8 +425,7 @@ static BOOL input_send_fastpath_keyboard_pause_event(rdpInput* input) */ wStream* s; const BYTE keyDownEvent = FASTPATH_INPUT_EVENT_SCANCODE << 5; - const BYTE keyUpEvent = (FASTPATH_INPUT_EVENT_SCANCODE << 5) - | FASTPATH_INPUT_KBDFLAGS_RELEASE; + const BYTE keyUpEvent = (FASTPATH_INPUT_EVENT_SCANCODE << 5) | FASTPATH_INPUT_KBDFLAGS_RELEASE; rdpRdp* rdp; if (!input || !input->context) @@ -459,7 +459,7 @@ static BOOL input_recv_sync_event(rdpInput* input, wStream* s) if (Stream_GetRemainingLength(s) < 6) return FALSE; - Stream_Seek(s, 2); /* pad2Octets (2 bytes) */ + Stream_Seek(s, 2); /* pad2Octets (2 bytes) */ Stream_Read_UINT32(s, toggleFlags); /* toggleFlags (4 bytes) */ return IFCALLRESULT(TRUE, input->SynchronizeEvent, input, toggleFlags); } @@ -472,8 +472,8 @@ static BOOL input_recv_keyboard_event(rdpInput* input, wStream* s) return FALSE; Stream_Read_UINT16(s, keyboardFlags); /* keyboardFlags (2 bytes) */ - Stream_Read_UINT16(s, keyCode); /* keyCode (2 bytes) */ - Stream_Seek(s, 2); /* pad2Octets (2 bytes) */ + Stream_Read_UINT16(s, keyCode); /* keyCode (2 bytes) */ + Stream_Seek(s, 2); /* pad2Octets (2 bytes) */ /** * Note: A lot of code in FreeRDP and in dependent projects checks the @@ -505,8 +505,8 @@ static BOOL input_recv_unicode_keyboard_event(rdpInput* input, wStream* s) return FALSE; Stream_Read_UINT16(s, keyboardFlags); /* keyboardFlags (2 bytes) */ - Stream_Read_UINT16(s, unicodeCode); /* unicodeCode (2 bytes) */ - Stream_Seek(s, 2); /* pad2Octets (2 bytes) */ + Stream_Read_UINT16(s, unicodeCode); /* unicodeCode (2 bytes) */ + Stream_Seek(s, 2); /* pad2Octets (2 bytes) */ /* "fix" keyboardFlags - see comment in input_recv_keyboard_event() */ @@ -526,8 +526,8 @@ static BOOL input_recv_mouse_event(rdpInput* input, wStream* s) return FALSE; Stream_Read_UINT16(s, pointerFlags); /* pointerFlags (2 bytes) */ - Stream_Read_UINT16(s, xPos); /* xPos (2 bytes) */ - Stream_Read_UINT16(s, yPos); /* yPos (2 bytes) */ + Stream_Read_UINT16(s, xPos); /* xPos (2 bytes) */ + Stream_Read_UINT16(s, yPos); /* yPos (2 bytes) */ return IFCALLRESULT(TRUE, input->MouseEvent, input, pointerFlags, xPos, yPos); } @@ -539,8 +539,8 @@ static BOOL input_recv_extended_mouse_event(rdpInput* input, wStream* s) return FALSE; Stream_Read_UINT16(s, pointerFlags); /* pointerFlags (2 bytes) */ - Stream_Read_UINT16(s, xPos); /* xPos (2 bytes) */ - Stream_Read_UINT16(s, yPos); /* yPos (2 bytes) */ + Stream_Read_UINT16(s, xPos); /* xPos (2 bytes) */ + Stream_Read_UINT16(s, yPos); /* yPos (2 bytes) */ return IFCALLRESULT(TRUE, input->ExtendedMouseEvent, input, pointerFlags, xPos, yPos); } @@ -551,7 +551,7 @@ static BOOL input_recv_event(rdpInput* input, wStream* s) if (Stream_GetRemainingLength(s) < 6) return FALSE; - Stream_Seek(s, 4); /* eventTime (4 bytes), ignored by the server */ + Stream_Seek(s, 4); /* eventTime (4 bytes), ignored by the server */ Stream_Read_UINT16(s, messageType); /* messageType (2 bytes) */ switch (messageType) @@ -587,7 +587,7 @@ static BOOL input_recv_event(rdpInput* input, wStream* s) break; default: - WLog_ERR(TAG, "Unknown messageType %"PRIu16"", messageType); + WLog_ERR(TAG, "Unknown messageType %" PRIu16 "", messageType); /* Each input event uses 6 bytes. */ Stream_Seek(s, 6); break; @@ -607,7 +607,7 @@ BOOL input_recv(rdpInput* input, wStream* s) return FALSE; Stream_Read_UINT16(s, numberEvents); /* numberEvents (2 bytes) */ - Stream_Seek(s, 2); /* pad2Octets (2 bytes) */ + Stream_Seek(s, 2); /* pad2Octets (2 bytes) */ /* Each input event uses 6 exactly bytes. */ if (Stream_GetRemainingLength(s) < (size_t)(6 * numberEvents)) @@ -686,10 +686,11 @@ BOOL freerdp_input_send_keyboard_event(rdpInput* input, UINT16 flags, UINT16 cod BOOL freerdp_input_send_keyboard_event_ex(rdpInput* input, BOOL down, UINT32 rdp_scancode) { - return freerdp_input_send_keyboard_event(input, - (RDP_SCANCODE_EXTENDED(rdp_scancode) ? KBD_FLAGS_EXTENDED : 0) | + return freerdp_input_send_keyboard_event( + input, + (RDP_SCANCODE_EXTENDED(rdp_scancode) ? KBD_FLAGS_EXTENDED : 0) | ((down) ? KBD_FLAGS_DOWN : KBD_FLAGS_RELEASE), - RDP_SCANCODE_CODE(rdp_scancode)); + RDP_SCANCODE_CODE(rdp_scancode)); } BOOL freerdp_input_send_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) @@ -750,7 +751,7 @@ rdpInput* input_new(rdpRdp* rdp) { const wObject cb = { NULL, NULL, NULL, input_free_queued_message, NULL }; rdpInput* input; - input = (rdpInput*) calloc(1, sizeof(rdpInput)); + input = (rdpInput*)calloc(1, sizeof(rdpInput)); if (!input) return NULL; diff --git a/libfreerdp/core/license.c b/libfreerdp/core/license.c index 3bc0acbce..d40363a6b 100644 --- a/libfreerdp/core/license.c +++ b/libfreerdp/core/license.c @@ -38,8 +38,8 @@ #define TAG FREERDP_TAG("core.license") #if 0 -#define LICENSE_NULL_CLIENT_RANDOM 1 -#define LICENSE_NULL_PREMASTER_SECRET 1 +#define LICENSE_NULL_CLIENT_RANDOM 1 +#define LICENSE_NULL_PREMASTER_SECRET 1 #endif static wStream* license_send_stream_init(rdpLicense* license); @@ -71,68 +71,76 @@ static BOOL license_write_new_license_request_packet(rdpLicense* license, wStrea static BOOL license_answer_license_request(rdpLicense* license); static BOOL license_write_platform_challenge_response_packet(rdpLicense* license, wStream* s, - const BYTE* mac_data); + const BYTE* mac_data); static BOOL license_send_platform_challenge_response_packet(rdpLicense* license); -static BOOL license_send_client_info(rdpLicense* license, const LICENSE_BLOB *calBlob, BYTE* signature); +static BOOL license_send_client_info(rdpLicense* license, const LICENSE_BLOB* calBlob, + BYTE* signature); #define PLATFORMID (CLIENT_OS_ID_WINNT_POST_52 | CLIENT_IMAGE_ID_MICROSOFT) #ifdef WITH_DEBUG_LICENSE -static const char* const LICENSE_MESSAGE_STRINGS[] = -{ - "", - "License Request", - "Platform Challenge", - "New License", - "Upgrade License", - "", "", "", "", "", "", - "", "", "", "", "", "", - "", - "License Info", - "New License Request", - "", - "Platform Challenge Response", - "", "", "", "", "", "", "", "", "", - "Error Alert" -}; +static const char* const LICENSE_MESSAGE_STRINGS[] = { "", + "License Request", + "Platform Challenge", + "New License", + "Upgrade License", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "License Info", + "New License Request", + "", + "Platform Challenge Response", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "Error Alert" }; -static const char* const error_codes[] = -{ - "ERR_UNKNOWN", - "ERR_INVALID_SERVER_CERTIFICATE", - "ERR_NO_LICENSE", - "ERR_INVALID_MAC", - "ERR_INVALID_SCOPE", - "ERR_UNKNOWN", - "ERR_NO_LICENSE_SERVER", - "STATUS_VALID_CLIENT", - "ERR_INVALID_CLIENT", - "ERR_UNKNOWN", - "ERR_UNKNOWN", - "ERR_INVALID_PRODUCT_ID", - "ERR_INVALID_MESSAGE_LENGTH" -}; +static const char* const error_codes[] = { "ERR_UNKNOWN", + "ERR_INVALID_SERVER_CERTIFICATE", + "ERR_NO_LICENSE", + "ERR_INVALID_MAC", + "ERR_INVALID_SCOPE", + "ERR_UNKNOWN", + "ERR_NO_LICENSE_SERVER", + "STATUS_VALID_CLIENT", + "ERR_INVALID_CLIENT", + "ERR_UNKNOWN", + "ERR_UNKNOWN", + "ERR_INVALID_PRODUCT_ID", + "ERR_INVALID_MESSAGE_LENGTH" }; -static const char* const state_transitions[] = -{ - "ST_UNKNOWN", - "ST_TOTAL_ABORT", - "ST_NO_TRANSITION", - "ST_RESET_PHASE_TO_START", - "ST_RESEND_LAST_MESSAGE" -}; +static const char* const state_transitions[] = { "ST_UNKNOWN", "ST_TOTAL_ABORT", "ST_NO_TRANSITION", + "ST_RESET_PHASE_TO_START", + "ST_RESEND_LAST_MESSAGE" }; static void license_print_product_info(const LICENSE_PRODUCT_INFO* productInfo) { char* CompanyName = NULL; char* ProductId = NULL; - ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) productInfo->pbCompanyName, - productInfo->cbCompanyName / 2, &CompanyName, 0, NULL, NULL); - ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) productInfo->pbProductId, - productInfo->cbProductId / 2, &ProductId, 0, NULL, NULL); + ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)productInfo->pbCompanyName, + productInfo->cbCompanyName / 2, &CompanyName, 0, NULL, NULL); + ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)productInfo->pbProductId, productInfo->cbProductId / 2, + &ProductId, 0, NULL, NULL); WLog_INFO(TAG, "ProductInfo:"); - WLog_INFO(TAG, "\tdwVersion: 0x%08"PRIX32"", productInfo->dwVersion); + WLog_INFO(TAG, "\tdwVersion: 0x%08" PRIX32 "", productInfo->dwVersion); WLog_INFO(TAG, "\tCompanyName: %s", CompanyName); WLog_INFO(TAG, "\tProductId: %s", ProductId); free(CompanyName); @@ -143,20 +151,19 @@ static void license_print_scope_list(const SCOPE_LIST* scopeList) { UINT32 index; const LICENSE_BLOB* scope; - WLog_INFO(TAG, "ScopeList (%"PRIu32"):", scopeList->count); + WLog_INFO(TAG, "ScopeList (%" PRIu32 "):", scopeList->count); for (index = 0; index < scopeList->count; index++) { scope = &scopeList->array[index]; - WLog_INFO(TAG, "\t%s", (const char*) scope->data); + WLog_INFO(TAG, "\t%s", (const char*)scope->data); } } #endif - static const char licenseStore[] = "licenses"; -static BOOL computeCalHash(const char *hostname, char *hashStr) +static BOOL computeCalHash(const char* hostname, char* hashStr) { WINPR_DIGEST_CTX* sha1 = NULL; BOOL ret = FALSE; @@ -167,7 +174,7 @@ static BOOL computeCalHash(const char *hostname, char *hashStr) goto out; if (!winpr_Digest_Init(sha1, WINPR_MD_SHA1)) goto out; - if (!winpr_Digest_Update(sha1, (const BYTE *)hostname, strlen(hostname))) + if (!winpr_Digest_Update(sha1, (const BYTE*)hostname, strlen(hostname))) goto out; if (!winpr_Digest_Final(sha1, hash, sizeof(hash))) goto out; @@ -175,17 +182,17 @@ static BOOL computeCalHash(const char *hostname, char *hashStr) for (i = 0; i < sizeof(hash); i++, hashStr += 2) sprintf_s(hashStr, 3, "%.2x", hash[i]); - ret = TRUE; + ret = TRUE; out: winpr_Digest_Free(sha1); return ret; } -static BOOL saveCal(rdpSettings *settings, const BYTE *data, int length, char *hostname) +static BOOL saveCal(rdpSettings* settings, const BYTE* data, int length, char* hostname) { char hash[41]; - FILE *fp; - char *licenseStorePath = NULL; + FILE* fp; + char* licenseStorePath = NULL; char filename[MAX_PATH], filenameNew[MAX_PATH]; char *filepath = NULL, *filepathNew = NULL; size_t written; @@ -216,8 +223,8 @@ static BOOL saveCal(rdpSettings *settings, const BYTE *data, int length, char *h if (!computeCalHash(hostname, hash)) goto out; - sprintf_s(filename, sizeof(filename)-1, "%s.cal", hash); - sprintf_s(filenameNew, sizeof(filenameNew)-1, "%s.cal.new", hash); + sprintf_s(filename, sizeof(filename) - 1, "%s.cal", hash); + sprintf_s(filenameNew, sizeof(filenameNew) - 1, "%s.cal.new", hash); if (!(filepath = GetCombinedPath(licenseStorePath, filename))) goto out; @@ -247,14 +254,14 @@ out: return ret; } -static BYTE *loadCalFile(rdpSettings *settings, const char* hostname, int *dataLen) +static BYTE* loadCalFile(rdpSettings* settings, const char* hostname, int* dataLen) { char *licenseStorePath = NULL, *calPath = NULL; char calFilename[MAX_PATH]; char hash[41]; int length, status; - FILE *fp; - BYTE *ret = NULL; + FILE* fp; + BYTE* ret = NULL; if (!computeCalHash(hostname, hash)) { @@ -262,7 +269,7 @@ static BYTE *loadCalFile(rdpSettings *settings, const char* hostname, int *dataL return NULL; } - sprintf_s(calFilename, sizeof(calFilename)-1, "%s.cal", hash); + sprintf_s(calFilename, sizeof(calFilename) - 1, "%s.cal", hash); if (!(licenseStorePath = GetCombinedPath(settings->ConfigPath, licenseStore))) return NULL; @@ -278,7 +285,7 @@ static BYTE *loadCalFile(rdpSettings *settings, const char* hostname, int *dataL length = _ftelli64(fp); _fseeki64(fp, 0, SEEK_SET); - ret = (BYTE *)malloc(length); + ret = (BYTE*)malloc(length); if (!ret) goto error_malloc; @@ -304,7 +311,6 @@ error_path: return NULL; } - /** * Read a licensing preamble.\n * @msdn{cc240480} @@ -321,8 +327,8 @@ BOOL license_read_preamble(wStream* s, BYTE* bMsgType, BYTE* flags, UINT16* wMsg if (Stream_GetRemainingLength(s) < 4) return FALSE; - Stream_Read_UINT8(s, *bMsgType); /* bMsgType (1 byte) */ - Stream_Read_UINT8(s, *flags); /* flags (1 byte) */ + Stream_Read_UINT8(s, *bMsgType); /* bMsgType (1 byte) */ + Stream_Read_UINT8(s, *flags); /* flags (1 byte) */ Stream_Read_UINT16(s, *wMsgSize); /* wMsgSize (2 bytes) */ return TRUE; } @@ -342,8 +348,8 @@ static BOOL license_write_preamble(wStream* s, BYTE bMsgType, BYTE flags, UINT16 return FALSE; /* preamble (4 bytes) */ - Stream_Write_UINT8(s, bMsgType); /* bMsgType (1 byte) */ - Stream_Write_UINT8(s, flags); /* flags (1 byte) */ + Stream_Write_UINT8(s, bMsgType); /* bMsgType (1 byte) */ + Stream_Write_UINT8(s, flags); /* flags (1 byte) */ Stream_Write_UINT16(s, wMsgSize); /* wMsgSize (2 bytes) */ return TRUE; } @@ -379,7 +385,6 @@ wStream* license_send_stream_init(rdpLicense* license) if (!s) return NULL; - license->rdp->do_crypt = do_crypt; license->PacketHeaderLength = Stream_GetPosition(s); if (!Stream_SafeSeek(s, LICENSE_PREAMBLE_LENGTH)) @@ -420,11 +425,12 @@ static BOOL license_send(rdpLicense* license, wStream* s, BYTE type) if (!rdp->settings->ServerMode) flags |= EXTENDED_ERROR_MSG_SUPPORTED; - if(!license_write_preamble(s, type, flags, wMsgSize)) + if (!license_write_preamble(s, type, flags, wMsgSize)) return FALSE; #ifdef WITH_DEBUG_LICENSE - WLog_DBG(TAG, "Sending %s Packet, length %"PRIu16"", LICENSE_MESSAGE_STRINGS[type & 0x1F], wMsgSize); + WLog_DBG(TAG, "Sending %s Packet, length %" PRIu16 "", LICENSE_MESSAGE_STRINGS[type & 0x1F], + wMsgSize); winpr_HexDump(TAG, WLOG_DEBUG, Stream_Pointer(s) - LICENSE_PREAMBLE_LENGTH, wMsgSize); #endif Stream_SetPosition(s, length); @@ -520,7 +526,7 @@ int license_recv(rdpLicense* license, wStream* s) break; default: - WLog_ERR(TAG, "invalid bMsgType:%"PRIu8"", bMsgType); + WLog_ERR(TAG, "invalid bMsgType:%" PRIu8 "", bMsgType); return -1; } @@ -532,7 +538,7 @@ void license_generate_randoms(rdpLicense* license) #ifdef LICENSE_NULL_CLIENT_RANDOM ZeroMemory(license->ClientRandom, CLIENT_RANDOM_LENGTH); /* ClientRandom */ #else - winpr_RAND(license->ClientRandom, CLIENT_RANDOM_LENGTH); /* ClientRandom */ + winpr_RAND(license->ClientRandom, CLIENT_RANDOM_LENGTH); /* ClientRandom */ #endif #ifdef LICENSE_NULL_PREMASTER_SECRET @@ -552,19 +558,20 @@ static BOOL license_generate_keys(rdpLicense* license) BOOL ret; if ( - /* MasterSecret */ - !security_master_secret(license->PremasterSecret, license->ClientRandom, - license->ServerRandom, license->MasterSecret) || - /* SessionKeyBlob */ - !security_session_key_blob(license->MasterSecret, license->ClientRandom, - license->ServerRandom, license->SessionKeyBlob)) + /* MasterSecret */ + !security_master_secret(license->PremasterSecret, license->ClientRandom, + license->ServerRandom, license->MasterSecret) || + /* SessionKeyBlob */ + !security_session_key_blob(license->MasterSecret, license->ClientRandom, + license->ServerRandom, license->SessionKeyBlob)) { return FALSE; } - security_mac_salt_key(license->SessionKeyBlob, license->ClientRandom, - license->ServerRandom, license->MacSaltKey); /* MacSaltKey */ - ret = security_licensing_encryption_key(license->SessionKeyBlob, license->ClientRandom, - license->ServerRandom, license->LicensingEncryptionKey); /* LicensingEncryptionKey */ + security_mac_salt_key(license->SessionKeyBlob, license->ClientRandom, license->ServerRandom, + license->MacSaltKey); /* MacSaltKey */ + ret = security_licensing_encryption_key( + license->SessionKeyBlob, license->ClientRandom, license->ServerRandom, + license->LicensingEncryptionKey); /* LicensingEncryptionKey */ #ifdef WITH_DEBUG_LICENSE WLog_DBG(TAG, "ClientRandom:"); winpr_HexDump(TAG, WLOG_DEBUG, license->ClientRandom, CLIENT_RANDOM_LENGTH); @@ -579,7 +586,8 @@ static BOOL license_generate_keys(rdpLicense* license) WLog_DBG(TAG, "MacSaltKey:"); winpr_HexDump(TAG, WLOG_DEBUG, license->MacSaltKey, MAC_SALT_KEY_LENGTH); WLog_DBG(TAG, "LicensingEncryptionKey:"); - winpr_HexDump(TAG, WLOG_DEBUG, license->LicensingEncryptionKey, LICENSING_ENCRYPTION_KEY_LENGTH); + winpr_HexDump(TAG, WLOG_DEBUG, license->LicensingEncryptionKey, + LICENSING_ENCRYPTION_KEY_LENGTH); #endif return ret; } @@ -591,7 +599,7 @@ static BOOL license_generate_keys(rdpLicense* license) BOOL license_generate_hwid(rdpLicense* license) { - const BYTE *hashTarget; + const BYTE* hashTarget; size_t targetLen; BYTE macAddress[6]; @@ -606,20 +614,24 @@ BOOL license_generate_hwid(rdpLicense* license) else { wStream s; - const char *hostname = license->rdp->settings->ClientHostname; + const char* hostname = license->rdp->settings->ClientHostname; Stream_StaticInit(&s, license->HardwareId, 4); Stream_Write_UINT32(&s, PLATFORMID); Stream_Free(&s, TRUE); - hashTarget = (const BYTE *)hostname; + hashTarget = (const BYTE*)hostname; targetLen = strlen(hostname); } - /* Allow FIPS override for use of MD5 here, really this does not have to be MD5 as we are just taking a MD5 hash of the 6 bytes of 0's(macAddress) */ - /* and filling in the Data1-Data4 fields of the CLIENT_HARDWARE_ID structure(from MS-RDPELE section 2.2.2.3.1). This is for RDP licensing packets */ - /* which will already be encrypted under FIPS, so the use of MD5 here is not for sensitive data protection. */ + /* Allow FIPS override for use of MD5 here, really this does not have to be MD5 as we are just + * taking a MD5 hash of the 6 bytes of 0's(macAddress) */ + /* and filling in the Data1-Data4 fields of the CLIENT_HARDWARE_ID structure(from MS-RDPELE + * section 2.2.2.3.1). This is for RDP licensing packets */ + /* which will already be encrypted under FIPS, so the use of MD5 here is not for sensitive data + * protection. */ return winpr_Digest_Allow_FIPS(WINPR_MD_MD5, hashTarget, targetLen, - &license->HardwareId[HWID_PLATFORM_ID_LENGTH], WINPR_MD5_DIGEST_LENGTH); + &license->HardwareId[HWID_PLATFORM_ID_LENGTH], + WINPR_MD5_DIGEST_LENGTH); } BOOL license_get_server_rsa_public_key(rdpLicense* license) @@ -631,9 +643,9 @@ BOOL license_get_server_rsa_public_key(rdpLicense* license) if (license->ServerCertificate->length < 1) { - if (!certificate_read_server_certificate(license->certificate, - settings->ServerCertificate, settings->ServerCertificateLength)) - return FALSE; + if (!certificate_read_server_certificate(license->certificate, settings->ServerCertificate, + settings->ServerCertificateLength)) + return FALSE; } Exponent = license->certificate->cert_info.exponent; @@ -641,7 +653,7 @@ BOOL license_get_server_rsa_public_key(rdpLicense* license) ModulusLength = license->certificate->cert_info.ModulusLength; CopyMemory(license->Exponent, Exponent, 4); license->ModulusLength = ModulusLength; - license->Modulus = (BYTE*) malloc(ModulusLength); + license->Modulus = (BYTE*)malloc(ModulusLength); if (!license->Modulus) return FALSE; CopyMemory(license->Modulus, Modulus, ModulusLength); @@ -656,37 +668,39 @@ BOOL license_encrypt_premaster_secret(rdpLicense* license) return FALSE; #ifdef WITH_DEBUG_LICENSE - WLog_DBG(TAG, "Modulus (%"PRIu32" bits):", license->ModulusLength * 8); + WLog_DBG(TAG, "Modulus (%" PRIu32 " bits):", license->ModulusLength * 8); winpr_HexDump(TAG, WLOG_DEBUG, license->Modulus, license->ModulusLength); WLog_DBG(TAG, "Exponent:"); winpr_HexDump(TAG, WLOG_DEBUG, license->Exponent, 4); #endif - EncryptedPremasterSecret = (BYTE*) calloc(1, license->ModulusLength); + EncryptedPremasterSecret = (BYTE*)calloc(1, license->ModulusLength); if (!EncryptedPremasterSecret) return FALSE; license->EncryptedPremasterSecret->type = BB_RANDOM_BLOB; license->EncryptedPremasterSecret->length = PREMASTER_SECRET_LENGTH; #ifndef LICENSE_NULL_PREMASTER_SECRET - license->EncryptedPremasterSecret->length = - crypto_rsa_public_encrypt(license->PremasterSecret, PREMASTER_SECRET_LENGTH, - license->ModulusLength, license->Modulus, license->Exponent, EncryptedPremasterSecret); + license->EncryptedPremasterSecret->length = crypto_rsa_public_encrypt( + license->PremasterSecret, PREMASTER_SECRET_LENGTH, license->ModulusLength, license->Modulus, + license->Exponent, EncryptedPremasterSecret); #endif license->EncryptedPremasterSecret->data = EncryptedPremasterSecret; return TRUE; } -static BOOL license_rc4_with_licenseKey(const rdpLicense* license, const BYTE *input, size_t len, LICENSE_BLOB *target) +static BOOL license_rc4_with_licenseKey(const rdpLicense* license, const BYTE* input, size_t len, + LICENSE_BLOB* target) { WINPR_RC4_CTX* rc4; - BYTE *buffer = NULL; + BYTE* buffer = NULL; - rc4 = winpr_RC4_New_Allow_FIPS(license->LicensingEncryptionKey, LICENSING_ENCRYPTION_KEY_LENGTH); + rc4 = + winpr_RC4_New_Allow_FIPS(license->LicensingEncryptionKey, LICENSING_ENCRYPTION_KEY_LENGTH); if (!rc4) return FALSE; - buffer = (BYTE*) realloc(target->data, len); + buffer = (BYTE*)realloc(target->data, len); if (!buffer) goto error_buffer; @@ -714,10 +728,11 @@ error_buffer: * @param mac the signature buffer (16 bytes) * @return if the operation completed successfully */ -static BOOL license_encrypt_and_MAC(rdpLicense* license, const BYTE *input, size_t len, LICENSE_BLOB *target, BYTE *mac) +static BOOL license_encrypt_and_MAC(rdpLicense* license, const BYTE* input, size_t len, + LICENSE_BLOB* target, BYTE* mac) { return license_rc4_with_licenseKey(license, input, len, target) && - security_mac_data(license->MacSaltKey, input, len, mac); + security_mac_data(license->MacSaltKey, input, len, mac); } /** @@ -730,16 +745,16 @@ static BOOL license_encrypt_and_MAC(rdpLicense* license, const BYTE *input, size * @param mac the signature buffer (16 bytes) * @return if the operation completed successfully */ -static BOOL license_decrypt_and_check_MAC(rdpLicense* license, const BYTE *input, size_t len, LICENSE_BLOB *target, const BYTE *packetMac) +static BOOL license_decrypt_and_check_MAC(rdpLicense* license, const BYTE* input, size_t len, + LICENSE_BLOB* target, const BYTE* packetMac) { BYTE macData[16]; return license_rc4_with_licenseKey(license, input, len, target) && - security_mac_data(license->MacSaltKey, target->data, len, macData) && - (memcmp(packetMac, macData, sizeof(macData)) == 0); + security_mac_data(license->MacSaltKey, target->data, len, macData) && + (memcmp(packetMac, macData, sizeof(macData)) == 0); } - /** * Read Product Information (PRODUCT_INFO).\n * @msdn{cc241915} @@ -752,7 +767,7 @@ BOOL license_read_product_info(wStream* s, LICENSE_PRODUCT_INFO* productInfo) if (Stream_GetRemainingLength(s) < 8) return FALSE; - Stream_Read_UINT32(s, productInfo->dwVersion); /* dwVersion (4 bytes) */ + Stream_Read_UINT32(s, productInfo->dwVersion); /* dwVersion (4 bytes) */ Stream_Read_UINT32(s, productInfo->cbCompanyName); /* cbCompanyName (4 bytes) */ /* Name must be >0, but there is no upper limit defined, use UINT32_MAX */ @@ -763,7 +778,7 @@ BOOL license_read_product_info(wStream* s, LICENSE_PRODUCT_INFO* productInfo) return FALSE; productInfo->pbProductId = NULL; - productInfo->pbCompanyName = (BYTE*) malloc(productInfo->cbCompanyName); + productInfo->pbCompanyName = (BYTE*)malloc(productInfo->cbCompanyName); if (!productInfo->pbCompanyName) return FALSE; Stream_Read(s, productInfo->pbCompanyName, productInfo->cbCompanyName); @@ -779,7 +794,7 @@ BOOL license_read_product_info(wStream* s, LICENSE_PRODUCT_INFO* productInfo) if (Stream_GetRemainingLength(s) < productInfo->cbProductId) goto out_fail; - productInfo->pbProductId = (BYTE*) malloc(productInfo->cbProductId); + productInfo->pbProductId = (BYTE*)malloc(productInfo->cbProductId); if (!productInfo->pbProductId) goto out_fail; Stream_Read(s, productInfo->pbProductId, productInfo->cbProductId); @@ -802,7 +817,7 @@ out_fail: LICENSE_PRODUCT_INFO* license_new_product_info() { LICENSE_PRODUCT_INFO* productInfo; - productInfo = (LICENSE_PRODUCT_INFO*) malloc(sizeof(LICENSE_PRODUCT_INFO)); + productInfo = (LICENSE_PRODUCT_INFO*)malloc(sizeof(LICENSE_PRODUCT_INFO)); if (!productInfo) return NULL; productInfo->dwVersion = 0; @@ -843,7 +858,7 @@ BOOL license_read_binary_blob(wStream* s, LICENSE_BLOB* blob) if (Stream_GetRemainingLength(s) < 4) return FALSE; - Stream_Read_UINT16(s, wBlobType); /* wBlobType (2 bytes) */ + Stream_Read_UINT16(s, wBlobType); /* wBlobType (2 bytes) */ Stream_Read_UINT16(s, blob->length); /* wBlobLen (2 bytes) */ if (Stream_GetRemainingLength(s) < blob->length) @@ -858,12 +873,14 @@ BOOL license_read_binary_blob(wStream* s, LICENSE_BLOB* blob) if ((blob->type != wBlobType) && (blob->type != BB_ANY_BLOB)) { - WLog_ERR(TAG, "license binary blob type (0x%"PRIx16") does not match expected type (0x%"PRIx16").", - wBlobType, blob->type); + WLog_ERR(TAG, + "license binary blob type (0x%" PRIx16 ") does not match expected type (0x%" PRIx16 + ").", + wBlobType, blob->type); } blob->type = wBlobType; - blob->data = (BYTE*) malloc(blob->length); + blob->data = (BYTE*)malloc(blob->length); if (!blob->data) return FALSE; Stream_Read(s, blob->data, blob->length); /* blobData */ @@ -879,10 +896,10 @@ BOOL license_read_binary_blob(wStream* s, LICENSE_BLOB* blob) BOOL license_write_binary_blob(wStream* s, const LICENSE_BLOB* blob) { - if (!Stream_EnsureRemainingCapacity(s, blob->length + 4)) + if (!Stream_EnsureRemainingCapacity(s, blob->length + 4)) return FALSE; - Stream_Write_UINT16(s, blob->type); /* wBlobType (2 bytes) */ + Stream_Write_UINT16(s, blob->type); /* wBlobType (2 bytes) */ Stream_Write_UINT16(s, blob->length); /* wBlobLen (2 bytes) */ if (blob->length > 0) @@ -890,7 +907,8 @@ BOOL license_write_binary_blob(wStream* s, const LICENSE_BLOB* blob) return TRUE; } -BOOL license_write_encrypted_premaster_secret_blob(wStream* s, const LICENSE_BLOB* blob, UINT32 ModulusLength) +BOOL license_write_encrypted_premaster_secret_blob(wStream* s, const LICENSE_BLOB* blob, + UINT32 ModulusLength) { UINT32 length; length = ModulusLength + 8; @@ -904,7 +922,7 @@ BOOL license_write_encrypted_premaster_secret_blob(wStream* s, const LICENSE_BLO if (!Stream_EnsureRemainingCapacity(s, length + 4)) return FALSE; Stream_Write_UINT16(s, blob->type); /* wBlobType (2 bytes) */ - Stream_Write_UINT16(s, length); /* wBlobLen (2 bytes) */ + Stream_Write_UINT16(s, length); /* wBlobLen (2 bytes) */ if (blob->length > 0) Stream_Write(s, blob->data, blob->length); /* blobData */ @@ -922,7 +940,7 @@ BOOL license_write_encrypted_premaster_secret_blob(wStream* s, const LICENSE_BLO LICENSE_BLOB* license_new_binary_blob(UINT16 type) { LICENSE_BLOB* blob; - blob = (LICENSE_BLOB*) calloc(1, sizeof(LICENSE_BLOB)); + blob = (LICENSE_BLOB*)calloc(1, sizeof(LICENSE_BLOB)); if (blob) blob->type = type; return blob; @@ -960,11 +978,11 @@ BOOL license_read_scope_list(wStream* s, SCOPE_LIST* scopeList) Stream_Read_UINT32(s, scopeCount); /* ScopeCount (4 bytes) */ - if (scopeCount > Stream_GetRemainingLength(s) / 4) /* every blob is at least 4 bytes */ + if (scopeCount > Stream_GetRemainingLength(s) / 4) /* every blob is at least 4 bytes */ return FALSE; scopeList->count = scopeCount; - scopeList->array = (LICENSE_BLOB*) calloc(scopeCount, sizeof(LICENSE_BLOB)); + scopeList->array = (LICENSE_BLOB*)calloc(scopeCount, sizeof(LICENSE_BLOB)); if (!scopeList->array) return FALSE; @@ -988,7 +1006,7 @@ BOOL license_read_scope_list(wStream* s, SCOPE_LIST* scopeList) SCOPE_LIST* license_new_scope_list() { - return (SCOPE_LIST*) calloc(1, sizeof(SCOPE_LIST)); + return (SCOPE_LIST*)calloc(1, sizeof(SCOPE_LIST)); } /** @@ -1020,9 +1038,9 @@ void license_free_scope_list(SCOPE_LIST* scopeList) free(scopeList); } -BOOL license_send_client_info(rdpLicense *license, const LICENSE_BLOB *calBlob, BYTE *signature) +BOOL license_send_client_info(rdpLicense* license, const LICENSE_BLOB* calBlob, BYTE* signature) { - wStream *s; + wStream* s; /* Client License Information: */ UINT32 PlatformId = PLATFORMID; @@ -1033,13 +1051,14 @@ BOOL license_send_client_info(rdpLicense *license, const LICENSE_BLOB *calBlob, return FALSE; Stream_Write_UINT32(s, PreferredKeyExchangeAlg); /* PreferredKeyExchangeAlg (4 bytes) */ - Stream_Write_UINT32(s, PlatformId); /* PlatformId (4 bytes) */ + Stream_Write_UINT32(s, PlatformId); /* PlatformId (4 bytes) */ /* ClientRandom (32 bytes) */ Stream_Write(s, license->ClientRandom, CLIENT_RANDOM_LENGTH); /* Licensing Binary Blob with EncryptedPreMasterSecret: */ - if (!license_write_encrypted_premaster_secret_blob(s, license->EncryptedPremasterSecret, license->ModulusLength)) + if (!license_write_encrypted_premaster_secret_blob(s, license->EncryptedPremasterSecret, + license->ModulusLength)) goto error; /* Licensing Binary Blob with LicenseInfo: */ @@ -1092,12 +1111,12 @@ BOOL license_read_license_request_packet(rdpLicense* license, wStream* s) return FALSE; /* Parse Server Certificate */ - if (!certificate_read_server_certificate(license->certificate, - license->ServerCertificate->data, license->ServerCertificate->length)) + if (!certificate_read_server_certificate(license->certificate, license->ServerCertificate->data, + license->ServerCertificate->length)) return FALSE; if (!license_generate_keys(license) || !license_generate_hwid(license) || - !license_encrypt_premaster_secret(license)) + !license_encrypt_premaster_secret(license)) return FALSE; #ifdef WITH_DEBUG_LICENSE @@ -1140,29 +1159,28 @@ BOOL license_read_platform_challenge_packet(rdpLicense* license, wStream* s) Stream_Read(s, macData, 16); if (!license_decrypt_and_check_MAC(license, license->EncryptedPlatformChallenge->data, - license->EncryptedPlatformChallenge->length, - license->PlatformChallenge, macData)) + license->EncryptedPlatformChallenge->length, + license->PlatformChallenge, macData)) return FALSE; #ifdef WITH_DEBUG_LICENSE - WLog_DBG(TAG, "ConnectFlags: 0x%08"PRIX32"", ConnectFlags); + WLog_DBG(TAG, "ConnectFlags: 0x%08" PRIX32 "", ConnectFlags); WLog_DBG(TAG, "EncryptedPlatformChallenge:"); winpr_HexDump(TAG, WLOG_DEBUG, license->EncryptedPlatformChallenge->data, - license->EncryptedPlatformChallenge->length); + license->EncryptedPlatformChallenge->length); WLog_DBG(TAG, "PlatformChallenge:"); winpr_HexDump(TAG, WLOG_DEBUG, license->PlatformChallenge->data, - license->PlatformChallenge->length); + license->PlatformChallenge->length); WLog_DBG(TAG, "MacData:"); winpr_HexDump(TAG, WLOG_DEBUG, macData, 16); #endif return TRUE; } - -static BOOL license_read_encrypted_blob(const rdpLicense *license, wStream *s, LICENSE_BLOB *target) +static BOOL license_read_encrypted_blob(const rdpLicense* license, wStream* s, LICENSE_BLOB* target) { UINT16 wBlobType, wBlobLen; - BYTE *encryptedData; + BYTE* encryptedData; if (Stream_GetRemainingLength(s) < 4) return FALSE; @@ -1170,7 +1188,9 @@ static BOOL license_read_encrypted_blob(const rdpLicense *license, wStream *s, L Stream_Read_UINT16(s, wBlobType); if (wBlobType != BB_ENCRYPTED_DATA_BLOB) { - WLog_DBG(TAG, "expecting BB_ENCRYPTED_DATA_BLOB blob, probably a windows 2003 server, continuing..."); + WLog_DBG( + TAG, + "expecting BB_ENCRYPTED_DATA_BLOB blob, probably a windows 2003 server, continuing..."); } Stream_Read_UINT16(s, wBlobLen); @@ -1183,7 +1203,6 @@ static BOOL license_read_encrypted_blob(const rdpLicense *license, wStream *s, L return license_rc4_with_licenseKey(license, encryptedData, wBlobLen, target); } - /** * Read a NEW_LICENSE packet.\n * @msdn{cc241926} @@ -1196,10 +1215,10 @@ BOOL license_read_new_or_upgrade_license_packet(rdpLicense* license, wStream* s) UINT32 os_major; UINT32 os_minor; UINT32 cbScope, cbCompanyName, cbProductId, cbLicenseInfo; - wStream *licenseStream = NULL; + wStream* licenseStream = NULL; BOOL ret = FALSE; BYTE computedMac[16]; - LICENSE_BLOB *calBlob; + LICENSE_BLOB* calBlob; DEBUG_LICENSE("Receiving Server New/Upgrade License Packet"); @@ -1267,10 +1286,11 @@ BOOL license_read_new_or_upgrade_license_packet(rdpLicense* license, wStream* s) goto out_free_stream; license->state = LICENSE_STATE_COMPLETED; - + ret = TRUE; if (!license->rdp->settings->OldLicenseBehaviour) - ret = saveCal(license->rdp->settings, Stream_Pointer(licenseStream), cbLicenseInfo, license->rdp->settings->ClientHostname); + ret = saveCal(license->rdp->settings, Stream_Pointer(licenseStream), cbLicenseInfo, + license->rdp->settings->ClientHostname); out_free_stream: Stream_Free(licenseStream, FALSE); @@ -1279,7 +1299,6 @@ out_free_blob: return ret; } - /** * Read an ERROR_ALERT packet.\n * @msdn{cc240482} @@ -1295,15 +1314,15 @@ BOOL license_read_error_alert_packet(rdpLicense* license, wStream* s) if (Stream_GetRemainingLength(s) < 8) return FALSE; - Stream_Read_UINT32(s, dwErrorCode); /* dwErrorCode (4 bytes) */ + Stream_Read_UINT32(s, dwErrorCode); /* dwErrorCode (4 bytes) */ Stream_Read_UINT32(s, dwStateTransition); /* dwStateTransition (4 bytes) */ if (!license_read_binary_blob(s, license->ErrorInfo)) /* bbErrorInfo */ return FALSE; #ifdef WITH_DEBUG_LICENSE - WLog_DBG(TAG, "dwErrorCode: %s, dwStateTransition: %s", - error_codes[dwErrorCode], state_transitions[dwStateTransition]); + WLog_DBG(TAG, "dwErrorCode: %s, dwStateTransition: %s", error_codes[dwErrorCode], + state_transitions[dwStateTransition]); #endif if (dwErrorCode == STATUS_VALID_CLIENT) @@ -1345,36 +1364,35 @@ BOOL license_write_new_license_request_packet(rdpLicense* license, wStream* s) UINT32 PreferredKeyExchangeAlg = KEY_EXCHANGE_ALG_RSA; Stream_Write_UINT32(s, PreferredKeyExchangeAlg); /* PreferredKeyExchangeAlg (4 bytes) */ - Stream_Write_UINT32(s, PlatformId); /* PlatformId (4 bytes) */ - Stream_Write(s, license->ClientRandom, 32); /* ClientRandom (32 bytes) */ - + Stream_Write_UINT32(s, PlatformId); /* PlatformId (4 bytes) */ + Stream_Write(s, license->ClientRandom, 32); /* ClientRandom (32 bytes) */ if (/* EncryptedPremasterSecret */ - !license_write_encrypted_premaster_secret_blob(s, license->EncryptedPremasterSecret, license->ModulusLength) || - /* ClientUserName */ - !license_write_binary_blob(s, license->ClientUserName) || - /* ClientMachineName */ - !license_write_binary_blob(s, license->ClientMachineName)) + !license_write_encrypted_premaster_secret_blob(s, license->EncryptedPremasterSecret, + license->ModulusLength) || + /* ClientUserName */ + !license_write_binary_blob(s, license->ClientUserName) || + /* ClientMachineName */ + !license_write_binary_blob(s, license->ClientMachineName)) { return FALSE; } #ifdef WITH_DEBUG_LICENSE - WLog_DBG(TAG, "PreferredKeyExchangeAlg: 0x%08"PRIX32"", PreferredKeyExchangeAlg); + WLog_DBG(TAG, "PreferredKeyExchangeAlg: 0x%08" PRIX32 "", PreferredKeyExchangeAlg); WLog_DBG(TAG, "ClientRandom:"); winpr_HexDump(TAG, WLOG_DEBUG, license->ClientRandom, 32); WLog_DBG(TAG, "EncryptedPremasterSecret"); winpr_HexDump(TAG, WLOG_DEBUG, license->EncryptedPremasterSecret->data, - license->EncryptedPremasterSecret->length); - WLog_DBG(TAG, "ClientUserName (%"PRIu16"): %s", license->ClientUserName->length, - (char*) license->ClientUserName->data); - WLog_DBG(TAG, "ClientMachineName (%"PRIu16"): %s", license->ClientMachineName->length, - (char*) license->ClientMachineName->data); + license->EncryptedPremasterSecret->length); + WLog_DBG(TAG, "ClientUserName (%" PRIu16 "): %s", license->ClientUserName->length, + (char*)license->ClientUserName->data); + WLog_DBG(TAG, "ClientMachineName (%" PRIu16 "): %s", license->ClientMachineName->length, + (char*)license->ClientMachineName->data); #endif return TRUE; } - /** * Send a NEW_LICENSE_REQUEST packet.\n * @msdn{cc241918} @@ -1384,23 +1402,25 @@ BOOL license_write_new_license_request_packet(rdpLicense* license, wStream* s) BOOL license_answer_license_request(rdpLicense* license) { wStream* s; - BYTE *license_data = NULL; + BYTE* license_data = NULL; int license_size = 0; BOOL status; char* username; if (!license->rdp->settings->OldLicenseBehaviour) - license_data = loadCalFile(license->rdp->settings, license->rdp->settings->ClientHostname, &license_size); + license_data = loadCalFile(license->rdp->settings, license->rdp->settings->ClientHostname, + &license_size); - if(license_data) + if (license_data) { - LICENSE_BLOB *calBlob = NULL; + LICENSE_BLOB* calBlob = NULL; BYTE signature[LICENSING_ENCRYPTION_KEY_LENGTH]; DEBUG_LICENSE("Sending Saved License Packet"); license->EncryptedHardwareId->type = BB_ENCRYPTED_DATA_BLOB; - if (!license_encrypt_and_MAC(license, license->HardwareId, HWID_LENGTH, license->EncryptedHardwareId, signature)) + if (!license_encrypt_and_MAC(license, license->HardwareId, HWID_LENGTH, + license->EncryptedHardwareId, signature)) { free(license_data); return FALSE; @@ -1431,9 +1451,9 @@ BOOL license_answer_license_request(rdpLicense* license) else username = "username"; - license->ClientUserName->data = (BYTE*) username; + license->ClientUserName->data = (BYTE*)username; license->ClientUserName->length = strlen(username) + 1; - license->ClientMachineName->data = (BYTE*) license->rdp->settings->ClientHostname; + license->ClientMachineName->data = (BYTE*)license->rdp->settings->ClientHostname; license->ClientMachineName->length = strlen(license->rdp->settings->ClientHostname) + 1; status = license_write_new_license_request_packet(license, s); @@ -1460,11 +1480,14 @@ BOOL license_answer_license_request(rdpLicense* license) * @param mac_data signature */ -BOOL license_write_platform_challenge_response_packet(rdpLicense* license, wStream* s, const BYTE* macData) +BOOL license_write_platform_challenge_response_packet(rdpLicense* license, wStream* s, + const BYTE* macData) { - if (!license_write_binary_blob(s, license->EncryptedPlatformChallengeResponse) || /* EncryptedPlatformChallengeResponse */ - !license_write_binary_blob(s, license->EncryptedHardwareId) || /* EncryptedHWID */ - !Stream_EnsureRemainingCapacity(s, 16)) + if (!license_write_binary_blob( + s, + license->EncryptedPlatformChallengeResponse) || /* EncryptedPlatformChallengeResponse */ + !license_write_binary_blob(s, license->EncryptedHardwareId) || /* EncryptedHWID */ + !Stream_EnsureRemainingCapacity(s, 16)) { return FALSE; } @@ -1473,7 +1496,6 @@ BOOL license_write_platform_challenge_response_packet(rdpLicense* license, wStre return TRUE; } - /** * Send Client Challenge Response Packet.\n * @msdn{cc241922} @@ -1483,7 +1505,7 @@ BOOL license_write_platform_challenge_response_packet(rdpLicense* license, wStre BOOL license_send_platform_challenge_response_packet(rdpLicense* license) { wStream* s; - wStream *challengeRespData; + wStream* challengeRespData; int length; BYTE* buffer; BYTE mac_data[16]; @@ -1497,16 +1519,17 @@ BOOL license_send_platform_challenge_response_packet(rdpLicense* license) challengeRespData = Stream_New(NULL, 8 + license->PlatformChallenge->length); if (!challengeRespData) return FALSE; - Stream_Write_UINT16(challengeRespData, 0x0100); /* wVersion */ + Stream_Write_UINT16(challengeRespData, 0x0100); /* wVersion */ Stream_Write_UINT16(challengeRespData, OTHER_PLATFORM_CHALLENGE_TYPE); /* wClientType */ - Stream_Write_UINT16(challengeRespData, LICENSE_DETAIL_DETAIL); /* wLicenseDetailLevel */ + Stream_Write_UINT16(challengeRespData, LICENSE_DETAIL_DETAIL); /* wLicenseDetailLevel */ Stream_Write_UINT16(challengeRespData, license->PlatformChallenge->length); /* cbChallenge */ - Stream_Write(challengeRespData, license->PlatformChallenge->data, license->PlatformChallenge->length); /* pbChallenge */ + Stream_Write(challengeRespData, license->PlatformChallenge->data, + license->PlatformChallenge->length); /* pbChallenge */ Stream_SealLength(challengeRespData); /* compute MAC of PLATFORM_CHALLENGE_RESPONSE_DATA + HWID */ length = Stream_Length(challengeRespData) + HWID_LENGTH; - buffer = (BYTE*) malloc(length); + buffer = (BYTE*)malloc(length); if (!buffer) { Stream_Free(challengeRespData, TRUE); @@ -1525,15 +1548,16 @@ BOOL license_send_platform_challenge_response_packet(rdpLicense* license) } license->EncryptedHardwareId->type = BB_ENCRYPTED_DATA_BLOB; - if (!license_rc4_with_licenseKey(license, license->HardwareId, HWID_LENGTH, license->EncryptedHardwareId)) + if (!license_rc4_with_licenseKey(license, license->HardwareId, HWID_LENGTH, + license->EncryptedHardwareId)) { Stream_Free(challengeRespData, TRUE); return FALSE; } status = license_rc4_with_licenseKey(license, Stream_Buffer(challengeRespData), - Stream_Length(challengeRespData), - license->EncryptedPlatformChallengeResponse); + Stream_Length(challengeRespData), + license->EncryptedPlatformChallengeResponse); Stream_Free(challengeRespData, TRUE); if (!status) return FALSE; @@ -1561,14 +1585,14 @@ BOOL license_send_platform_challenge_response_packet(rdpLicense* license) BOOL license_send_valid_client_error_packet(rdpRdp* rdp) { - rdpLicense *license = rdp->license; + rdpLicense* license = rdp->license; wStream* s = license_send_stream_init(license); if (!s) return FALSE; DEBUG_LICENSE("Sending Error Alert Packet"); Stream_Write_UINT32(s, STATUS_VALID_CLIENT); /* dwErrorCode */ - Stream_Write_UINT32(s, ST_NO_TRANSITION); /* dwStateTransition */ + Stream_Write_UINT32(s, ST_NO_TRANSITION); /* dwStateTransition */ if (license_write_binary_blob(s, license->ErrorInfo)) return license_send(license, s, ERROR_ALERT); @@ -1586,7 +1610,7 @@ BOOL license_send_valid_client_error_packet(rdpRdp* rdp) rdpLicense* license_new(rdpRdp* rdp) { rdpLicense* license; - license = (rdpLicense*) calloc(1, sizeof(rdpLicense)); + license = (rdpLicense*)calloc(1, sizeof(rdpLicense)); if (!license) return NULL; @@ -1610,7 +1634,8 @@ rdpLicense* license_new(rdpRdp* rdp) goto out_error; if (!(license->EncryptedPlatformChallenge = license_new_binary_blob(BB_ANY_BLOB))) goto out_error; - if (!(license->EncryptedPlatformChallengeResponse = license_new_binary_blob(BB_ENCRYPTED_DATA_BLOB))) + if (!(license->EncryptedPlatformChallengeResponse = + license_new_binary_blob(BB_ENCRYPTED_DATA_BLOB))) goto out_error; if (!(license->EncryptedPremasterSecret = license_new_binary_blob(BB_ANY_BLOB))) goto out_error; diff --git a/libfreerdp/core/license.h b/libfreerdp/core/license.h index 1826315bf..6c5393e95 100644 --- a/libfreerdp/core/license.h +++ b/libfreerdp/core/license.h @@ -33,7 +33,6 @@ #include - typedef struct { UINT32 dwVersion; @@ -89,7 +88,7 @@ struct rdp_license LICENSE_BLOB* PlatformChallenge; LICENSE_BLOB* EncryptedPremasterSecret; LICENSE_BLOB* EncryptedPlatformChallenge; - LICENSE_BLOB *EncryptedPlatformChallengeResponse; + LICENSE_BLOB* EncryptedPlatformChallengeResponse; LICENSE_BLOB* EncryptedHardwareId; SCOPE_LIST* ScopeList; UINT32 PacketHeaderLength; @@ -97,7 +96,6 @@ struct rdp_license FREERDP_LOCAL int license_recv(rdpLicense* license, wStream* s); - FREERDP_LOCAL rdpLicense* license_new(rdpRdp* rdp); FREERDP_LOCAL void license_free(rdpLicense* license); @@ -105,7 +103,10 @@ FREERDP_LOCAL void license_free(rdpLicense* license); #ifdef WITH_DEBUG_LICENSE #define DEBUG_LICENSE(...) WLog_DBG(LICENSE_TAG, __VA_ARGS__) #else -#define DEBUG_LICENSE(...) do { } while (0) +#define DEBUG_LICENSE(...) \ + do \ + { \ + } while (0) #endif #endif /* FREERDP_LIB_CORE_LICENSE_H */ diff --git a/libfreerdp/core/listener.c b/libfreerdp/core/listener.c index c143f6360..db9182eb0 100644 --- a/libfreerdp/core/listener.c +++ b/libfreerdp/core/listener.c @@ -46,7 +46,6 @@ #include "listener.h" - #define TAG FREERDP_TAG("core.listener") static BOOL freerdp_listener_open(freerdp_listener* instance, const char* bind_address, UINT16 port) @@ -59,7 +58,7 @@ static BOOL freerdp_listener_open(freerdp_listener* instance, const char* bind_a int option_value; struct addrinfo* ai; struct addrinfo* res; - rdpListener* listener = (rdpListener*) instance->listener; + rdpListener* listener = (rdpListener*)instance->listener; #ifdef _WIN32 u_long arg; #endif @@ -92,14 +91,15 @@ static BOOL freerdp_listener_open(freerdp_listener* instance, const char* bind_a } if (ai->ai_family == AF_INET) - sin_addr = &(((struct sockaddr_in*) ai->ai_addr)->sin_addr); + sin_addr = &(((struct sockaddr_in*)ai->ai_addr)->sin_addr); else - sin_addr = &(((struct sockaddr_in6*) ai->ai_addr)->sin6_addr); + sin_addr = &(((struct sockaddr_in6*)ai->ai_addr)->sin6_addr); inet_ntop(ai->ai_family, sin_addr, addr, sizeof(addr)); option_value = 1; - if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (void*) &option_value, sizeof(option_value)) == -1) + if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (void*)&option_value, + sizeof(option_value)) == -1) WLog_ERR(TAG, "setsockopt"); #ifndef _WIN32 @@ -108,20 +108,20 @@ static BOOL freerdp_listener_open(freerdp_listener* instance, const char* bind_a arg = 1; ioctlsocket(sockfd, FIONBIO, &arg); #endif - status = _bind((SOCKET) sockfd, ai->ai_addr, ai->ai_addrlen); + status = _bind((SOCKET)sockfd, ai->ai_addr, ai->ai_addrlen); if (status != 0) { - closesocket((SOCKET) sockfd); + closesocket((SOCKET)sockfd); continue; } - status = _listen((SOCKET) sockfd, 10); + status = _listen((SOCKET)sockfd, 10); if (status != 0) { WLog_ERR(TAG, "listen"); - closesocket((SOCKET) sockfd); + closesocket((SOCKET)sockfd); continue; } @@ -135,7 +135,8 @@ static BOOL freerdp_listener_open(freerdp_listener* instance, const char* bind_a break; } - WSAEventSelect(sockfd, listener->events[listener->num_sockfds], FD_READ | FD_ACCEPT | FD_CLOSE); + WSAEventSelect(sockfd, listener->events[listener->num_sockfds], + FD_READ | FD_ACCEPT | FD_CLOSE); listener->num_sockfds++; WLog_INFO(TAG, "Listening on %s:%d", addr, port); } @@ -150,7 +151,7 @@ static BOOL freerdp_listener_open_local(freerdp_listener* instance, const char* int status; int sockfd; struct sockaddr_un addr = { 0 }; - rdpListener* listener = (rdpListener*) instance->listener; + rdpListener* listener = (rdpListener*)instance->listener; HANDLE hevent; if (listener->num_sockfds == MAX_LISTENER_HANDLES) @@ -171,12 +172,12 @@ static BOOL freerdp_listener_open_local(freerdp_listener* instance, const char* addr.sun_family = AF_UNIX; strncpy(addr.sun_path, path, sizeof(addr.sun_path) - 1); unlink(path); - status = _bind(sockfd, (struct sockaddr*) &addr, sizeof(addr)); + status = _bind(sockfd, (struct sockaddr*)&addr, sizeof(addr)); if (status != 0) { WLog_ERR(TAG, "bind"); - closesocket((SOCKET) sockfd); + closesocket((SOCKET)sockfd); return FALSE; } @@ -185,7 +186,7 @@ static BOOL freerdp_listener_open_local(freerdp_listener* instance, const char* if (status != 0) { WLog_ERR(TAG, "listen"); - closesocket((SOCKET) sockfd); + closesocket((SOCKET)sockfd); return FALSE; } @@ -194,7 +195,7 @@ static BOOL freerdp_listener_open_local(freerdp_listener* instance, const char* if (!hevent) { WLog_ERR(TAG, "failed to create sockfd event"); - closesocket((SOCKET) sockfd); + closesocket((SOCKET)sockfd); return FALSE; } @@ -211,7 +212,7 @@ static BOOL freerdp_listener_open_local(freerdp_listener* instance, const char* static BOOL freerdp_listener_open_from_socket(freerdp_listener* instance, int fd) { #ifndef _WIN32 - rdpListener* listener = (rdpListener*) instance->listener; + rdpListener* listener = (rdpListener*)instance->listener; if (listener->num_sockfds == MAX_LISTENER_HANDLES) { @@ -240,11 +241,11 @@ static BOOL freerdp_listener_open_from_socket(freerdp_listener* instance, int fd static void freerdp_listener_close(freerdp_listener* instance) { int i; - rdpListener* listener = (rdpListener*) instance->listener; + rdpListener* listener = (rdpListener*)instance->listener; for (i = 0; i < listener->num_sockfds; i++) { - closesocket((SOCKET) listener->sockfds[i]); + closesocket((SOCKET)listener->sockfds[i]); CloseHandle(listener->events[i]); } @@ -254,7 +255,7 @@ static void freerdp_listener_close(freerdp_listener* instance) static BOOL freerdp_listener_get_fds(freerdp_listener* instance, void** rfds, int* rcount) { int index; - rdpListener* listener = (rdpListener*) instance->listener; + rdpListener* listener = (rdpListener*)instance->listener; if (listener->num_sockfds < 1) return FALSE; @@ -271,7 +272,7 @@ static BOOL freerdp_listener_get_fds(freerdp_listener* instance, void** rfds, in DWORD freerdp_listener_get_event_handles(freerdp_listener* instance, HANDLE* events, DWORD nCount) { int index; - rdpListener* listener = (rdpListener*) instance->listener; + rdpListener* listener = (rdpListener*)instance->listener; if (listener->num_sockfds < 1) return 0; @@ -295,7 +296,7 @@ static BOOL freerdp_listener_check_fds(freerdp_listener* instance) freerdp_peer* client = NULL; int peer_addr_size; struct sockaddr_storage peer_addr; - rdpListener* listener = (rdpListener*) instance->listener; + rdpListener* listener = (rdpListener*)instance->listener; static const BYTE localhost6_bytes[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }; BOOL peer_accepted; @@ -306,7 +307,7 @@ static BOOL freerdp_listener_check_fds(freerdp_listener* instance) { WSAResetEvent(listener->events[i]); peer_addr_size = sizeof(peer_addr); - peer_sockfd = _accept(listener->sockfds[i], (struct sockaddr*) &peer_addr, &peer_addr_size); + peer_sockfd = _accept(listener->sockfds[i], (struct sockaddr*)&peer_addr, &peer_addr_size); peer_accepted = FALSE; if (peer_sockfd == -1) @@ -333,7 +334,7 @@ static BOOL freerdp_listener_check_fds(freerdp_listener* instance) if (!client) { - closesocket((SOCKET) peer_sockfd); + closesocket((SOCKET)peer_sockfd); return FALSE; } @@ -341,14 +342,14 @@ static BOOL freerdp_listener_check_fds(freerdp_listener* instance) if (peer_addr.ss_family == AF_INET) { - sin_addr = &(((struct sockaddr_in*) &peer_addr)->sin_addr); + sin_addr = &(((struct sockaddr_in*)&peer_addr)->sin_addr); - if ((*(UINT32*) sin_addr) == 0x0100007f) + if ((*(UINT32*)sin_addr) == 0x0100007f) client->local = TRUE; } else if (peer_addr.ss_family == AF_INET6) { - sin_addr = &(((struct sockaddr_in6*) &peer_addr)->sin6_addr); + sin_addr = &(((struct sockaddr_in6*)&peer_addr)->sin6_addr); if (memcmp(sin_addr, localhost6_bytes, 16) == 0) client->local = TRUE; @@ -368,7 +369,7 @@ static BOOL freerdp_listener_check_fds(freerdp_listener* instance) if (!peer_accepted) { WLog_ERR(TAG, "PeerAccepted callback failed"); - closesocket((SOCKET) peer_sockfd); + closesocket((SOCKET)peer_sockfd); freerdp_peer_free(client); } } @@ -380,7 +381,7 @@ freerdp_listener* freerdp_listener_new(void) { freerdp_listener* instance; rdpListener* listener; - instance = (freerdp_listener*) calloc(1, sizeof(freerdp_listener)); + instance = (freerdp_listener*)calloc(1, sizeof(freerdp_listener)); if (!instance) return NULL; @@ -392,7 +393,7 @@ freerdp_listener* freerdp_listener_new(void) instance->GetEventHandles = freerdp_listener_get_event_handles; instance->CheckFileDescriptor = freerdp_listener_check_fds; instance->Close = freerdp_listener_close; - listener = (rdpListener*) calloc(1, sizeof(rdpListener)); + listener = (rdpListener*)calloc(1, sizeof(rdpListener)); if (!listener) { @@ -401,7 +402,7 @@ freerdp_listener* freerdp_listener_new(void) } listener->instance = instance; - instance->listener = (void*) listener; + instance->listener = (void*)listener; return instance; } @@ -413,4 +414,3 @@ void freerdp_listener_free(freerdp_listener* instance) free(instance); } } - diff --git a/libfreerdp/core/listener.h b/libfreerdp/core/listener.h index 720d11877..e5156bb80 100644 --- a/libfreerdp/core/listener.h +++ b/libfreerdp/core/listener.h @@ -29,16 +29,15 @@ typedef struct rdp_listener rdpListener; #include -#define MAX_LISTENER_HANDLES 5 +#define MAX_LISTENER_HANDLES 5 struct rdp_listener { freerdp_listener* instance; int num_sockfds; - int sockfds[MAX_LISTENER_HANDLES]; - HANDLE events[MAX_LISTENER_HANDLES]; + int sockfds[MAX_LISTENER_HANDLES]; + HANDLE events[MAX_LISTENER_HANDLES]; }; #endif /* FREERDP_LIB_CORE_LISTENER_H */ - diff --git a/libfreerdp/core/mcs.c b/libfreerdp/core/mcs.c index 91e2849ca..9caa2dddb 100644 --- a/libfreerdp/core/mcs.c +++ b/libfreerdp/core/mcs.c @@ -173,22 +173,22 @@ static const BYTE calledDomainSelector[1] = "\x01"; /* static const char* const mcs_result_enumerated[] = { - "rt-successful", - "rt-domain-merging", - "rt-domain-not-hierarchical", - "rt-no-such-channel", - "rt-no-such-domain", - "rt-no-such-user", - "rt-not-admitted", - "rt-other-user-id", - "rt-parameters-unacceptable", - "rt-token-not-available", - "rt-token-not-possessed", - "rt-too-many-channels", - "rt-too-many-tokens", - "rt-too-many-users", - "rt-unspecified-failure", - "rt-user-rejected" + "rt-successful", + "rt-domain-merging", + "rt-domain-not-hierarchical", + "rt-no-such-channel", + "rt-no-such-domain", + "rt-no-such-user", + "rt-not-admitted", + "rt-other-user-id", + "rt-parameters-unacceptable", + "rt-token-not-available", + "rt-token-not-possessed", + "rt-too-many-channels", + "rt-too-many-tokens", + "rt-too-many-users", + "rt-unspecified-failure", + "rt-user-rejected" }; */ @@ -275,8 +275,8 @@ void mcs_write_domain_mcspdu_header(wStream* s, enum DomainMCSPDU domainMCSPDU, * @param maxMCSPDUsize max MCS PDU size */ -static BOOL mcs_init_domain_parameters(DomainParameters* domainParameters, - UINT32 maxChannelIds, UINT32 maxUserIds, UINT32 maxTokenIds, UINT32 maxMCSPDUsize) +static BOOL mcs_init_domain_parameters(DomainParameters* domainParameters, UINT32 maxChannelIds, + UINT32 maxUserIds, UINT32 maxTokenIds, UINT32 maxMCSPDUsize) { if (!domainParameters) return FALSE; @@ -305,16 +305,15 @@ static BOOL mcs_read_domain_parameters(wStream* s, DomainParameters* domainParam if (!s || !domainParameters) return FALSE; - return - ber_read_sequence_tag(s, &length) && - ber_read_integer(s, &(domainParameters->maxChannelIds)) && - ber_read_integer(s, &(domainParameters->maxUserIds)) && - ber_read_integer(s, &(domainParameters->maxTokenIds)) && - ber_read_integer(s, &(domainParameters->numPriorities)) && - ber_read_integer(s, &(domainParameters->minThroughput)) && - ber_read_integer(s, &(domainParameters->maxHeight)) && - ber_read_integer(s, &(domainParameters->maxMCSPDUsize)) && - ber_read_integer(s, &(domainParameters->protocolVersion)); + return ber_read_sequence_tag(s, &length) && + ber_read_integer(s, &(domainParameters->maxChannelIds)) && + ber_read_integer(s, &(domainParameters->maxUserIds)) && + ber_read_integer(s, &(domainParameters->maxTokenIds)) && + ber_read_integer(s, &(domainParameters->numPriorities)) && + ber_read_integer(s, &(domainParameters->minThroughput)) && + ber_read_integer(s, &(domainParameters->maxHeight)) && + ber_read_integer(s, &(domainParameters->maxMCSPDUsize)) && + ber_read_integer(s, &(domainParameters->protocolVersion)); } /** @@ -362,23 +361,23 @@ static BOOL mcs_write_domain_parameters(wStream* s, DomainParameters* domainPara static void mcs_print_domain_parameters(DomainParameters* domainParameters) { - WLog_INFO(TAG, "DomainParameters {"); + WLog_INFO(TAG, "DomainParameters {"); if (domainParameters) { - WLog_INFO(TAG, "\tmaxChannelIds:%"PRIu32"", domainParameters->maxChannelIds); - WLog_INFO(TAG, "\tmaxUserIds:%"PRIu32"", domainParameters->maxUserIds); - WLog_INFO(TAG, "\tmaxTokenIds:%"PRIu32"", domainParameters->maxTokenIds); - WLog_INFO(TAG, "\tnumPriorities:%"PRIu32"", domainParameters->numPriorities); - WLog_INFO(TAG, "\tminThroughput:%"PRIu32"", domainParameters->minThroughput); - WLog_INFO(TAG, "\tmaxHeight:%"PRIu32"", domainParameters->maxHeight); - WLog_INFO(TAG, "\tmaxMCSPDUsize:%"PRIu32"", domainParameters->maxMCSPDUsize); - WLog_INFO(TAG, "\tprotocolVersion:%"PRIu32"", domainParameters->protocolVersion); + WLog_INFO(TAG, "\tmaxChannelIds:%" PRIu32 "", domainParameters->maxChannelIds); + WLog_INFO(TAG, "\tmaxUserIds:%" PRIu32 "", domainParameters->maxUserIds); + WLog_INFO(TAG, "\tmaxTokenIds:%" PRIu32 "", domainParameters->maxTokenIds); + WLog_INFO(TAG, "\tnumPriorities:%" PRIu32 "", domainParameters->numPriorities); + WLog_INFO(TAG, "\tminThroughput:%" PRIu32 "", domainParameters->minThroughput); + WLog_INFO(TAG, "\tmaxHeight:%" PRIu32 "", domainParameters->maxHeight); + WLog_INFO(TAG, "\tmaxMCSPDUsize:%" PRIu32 "", domainParameters->maxMCSPDUsize); + WLog_INFO(TAG, "\tprotocolVersion:%" PRIu32 "", domainParameters->protocolVersion); } else - WLog_INFO(TAG, "\tdomainParameters=%p", domainParameters); + WLog_INFO(TAG, "\tdomainParameters=%p", domainParameters); - WLog_INFO(TAG, "}"); + WLog_INFO(TAG, "}"); } #endif @@ -392,7 +391,8 @@ static void mcs_print_domain_parameters(DomainParameters* domainParameters) BOOL mcs_merge_domain_parameters(DomainParameters* targetParameters, DomainParameters* minimumParameters, - DomainParameters* maximumParameters, DomainParameters* pOutParameters) + DomainParameters* maximumParameters, + DomainParameters* pOutParameters) { /* maxChannelIds */ if (!targetParameters || !minimumParameters || !maximumParameters || !pOutParameters) @@ -462,7 +462,8 @@ BOOL mcs_merge_domain_parameters(DomainParameters* targetParameters, { pOutParameters->maxMCSPDUsize = targetParameters->maxMCSPDUsize; } - else if ((minimumParameters->maxMCSPDUsize >= 124) && (minimumParameters->maxMCSPDUsize <= 65528)) + else if ((minimumParameters->maxMCSPDUsize >= 124) && + (minimumParameters->maxMCSPDUsize <= 65528)) { pOutParameters->maxMCSPDUsize = 65528; } @@ -767,7 +768,7 @@ BOOL mcs_recv_connect_response(rdpMcs* mcs, wStream* s) if (!gcc_read_conference_create_response(s, mcs)) { - WLog_ERR(TAG, "gcc_read_conference_create_response failed"); + WLog_ERR(TAG, "gcc_read_conference_create_response failed"); return FALSE; } @@ -978,7 +979,7 @@ BOOL mcs_recv_attach_user_confirm(rdpMcs* mcs, wStream* s) MCSPDU = DomainMCSPDU_AttachUserConfirm; status = mcs_read_domain_mcspdu_header(s, &MCSPDU, &length) && - per_read_enumerated(s, &result, MCS_Result_enum_length) && /* result */ + per_read_enumerated(s, &result, MCS_Result_enum_length) && /* result */ per_read_integer16(s, &(mcs->userId), MCS_BASE_CHANNEL_ID); /* initiator (UserId) */ return status; } @@ -1008,7 +1009,7 @@ BOOL mcs_send_attach_user_confirm(rdpMcs* mcs) mcs->userId = mcs->baseChannelId++; mcs_write_domain_mcspdu_header(s, DomainMCSPDU_AttachUserConfirm, length, 2); - per_write_enumerated(s, 0, MCS_Result_enum_length); /* result */ + per_write_enumerated(s, 0, MCS_Result_enum_length); /* result */ per_write_integer16(s, mcs->userId, MCS_BASE_CHANNEL_ID); /* initiator (UserId) */ Stream_SealLength(s); status = transport_write(mcs->transport, s); @@ -1033,11 +1034,9 @@ BOOL mcs_recv_channel_join_request(rdpMcs* mcs, wStream* s, UINT16* channelId) return FALSE; MCSPDU = DomainMCSPDU_ChannelJoinRequest; - return - mcs_read_domain_mcspdu_header(s, &MCSPDU, &length) && - per_read_integer16(s, &userId, MCS_BASE_CHANNEL_ID) && - (userId == mcs->userId) && - per_read_integer16(s, channelId, 0); + return mcs_read_domain_mcspdu_header(s, &MCSPDU, &length) && + per_read_integer16(s, &userId, MCS_BASE_CHANNEL_ID) && (userId == mcs->userId) && + per_read_integer16(s, channelId, 0); } /** @@ -1095,9 +1094,9 @@ BOOL mcs_recv_channel_join_confirm(rdpMcs* mcs, wStream* s, UINT16* channelId) MCSPDU = DomainMCSPDU_ChannelJoinConfirm; status &= mcs_read_domain_mcspdu_header(s, &MCSPDU, &length); status &= per_read_enumerated(s, &result, MCS_Result_enum_length); /* result */ - status &= per_read_integer16(s, &initiator, MCS_BASE_CHANNEL_ID); /* initiator (UserId) */ - status &= per_read_integer16(s, &requested, 0); /* requested (ChannelId) */ - status &= per_read_integer16(s, channelId, 0); /* channelId */ + status &= per_read_integer16(s, &initiator, MCS_BASE_CHANNEL_ID); /* initiator (UserId) */ + status &= per_read_integer16(s, &requested, 0); /* requested (ChannelId) */ + status &= per_read_integer16(s, channelId, 0); /* channelId */ return status; } @@ -1125,10 +1124,10 @@ BOOL mcs_send_channel_join_confirm(rdpMcs* mcs, UINT16 channelId) } mcs_write_domain_mcspdu_header(s, DomainMCSPDU_ChannelJoinConfirm, length, 2); - per_write_enumerated(s, 0, MCS_Result_enum_length); /* result */ + per_write_enumerated(s, 0, MCS_Result_enum_length); /* result */ per_write_integer16(s, mcs->userId, MCS_BASE_CHANNEL_ID); /* initiator (UserId) */ - per_write_integer16(s, channelId, 0); /* requested (ChannelId) */ - per_write_integer16(s, channelId, 0); /* channelId */ + per_write_integer16(s, channelId, 0); /* requested (ChannelId) */ + per_write_integer16(s, channelId, 0); /* channelId */ Stream_SealLength(s); status = transport_write(mcs->transport, s); Stream_Free(s, TRUE); @@ -1251,7 +1250,7 @@ rdpMcs* mcs_new(rdpTransport* transport) if (!transport) return NULL; - mcs = (rdpMcs*) calloc(1, sizeof(rdpMcs)); + mcs = (rdpMcs*)calloc(1, sizeof(rdpMcs)); if (!mcs) return NULL; @@ -1265,7 +1264,7 @@ rdpMcs* mcs_new(rdpTransport* transport) mcs->channelCount = 0; mcs->channelMaxCount = CHANNEL_MAX_COUNT; mcs->baseChannelId = MCS_GLOBAL_CHANNEL_ID + 1; - mcs->channels = (rdpMcsChannel*) calloc(mcs->channelMaxCount, sizeof(rdpMcsChannel)); + mcs->channels = (rdpMcsChannel*)calloc(mcs->channelMaxCount, sizeof(rdpMcsChannel)); if (!mcs->channels) goto out_free; diff --git a/libfreerdp/core/message.c b/libfreerdp/core/message.c index 7a1a0ab64..7b88d7db7 100644 --- a/libfreerdp/core/message.c +++ b/libfreerdp/core/message.c @@ -52,7 +52,7 @@ static BOOL update_message_BeginPaint(rdpContext* context) if (!context || !context->update) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, + return MessageQueue_Post(context->update->queue, (void*)context, MakeMessageId(Update, BeginPaint), NULL, NULL); } @@ -61,12 +61,11 @@ static BOOL update_message_EndPaint(rdpContext* context) if (!context || !context->update) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, + return MessageQueue_Post(context->update->queue, (void*)context, MakeMessageId(Update, EndPaint), NULL, NULL); } -static BOOL update_message_SetBounds(rdpContext* context, - const rdpBounds* bounds) +static BOOL update_message_SetBounds(rdpContext* context, const rdpBounds* bounds) { rdpBounds* wParam = NULL; @@ -75,7 +74,7 @@ static BOOL update_message_SetBounds(rdpContext* context, if (bounds) { - wParam = (rdpBounds*) malloc(sizeof(rdpBounds)); + wParam = (rdpBounds*)malloc(sizeof(rdpBounds)); if (!wParam) return FALSE; @@ -83,8 +82,8 @@ static BOOL update_message_SetBounds(rdpContext* context, CopyMemory(wParam, bounds, sizeof(rdpBounds)); } - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(Update, SetBounds), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(Update, SetBounds), (void*)wParam, NULL); } static BOOL update_message_Synchronize(rdpContext* context) @@ -92,7 +91,7 @@ static BOOL update_message_Synchronize(rdpContext* context) if (!context || !context->update) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, + return MessageQueue_Post(context->update->queue, (void*)context, MakeMessageId(Update, Synchronize), NULL, NULL); } @@ -101,12 +100,11 @@ static BOOL update_message_DesktopResize(rdpContext* context) if (!context || !context->update) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, + return MessageQueue_Post(context->update->queue, (void*)context, MakeMessageId(Update, DesktopResize), NULL, NULL); } -static BOOL update_message_BitmapUpdate(rdpContext* context, - const BITMAP_UPDATE* bitmap) +static BOOL update_message_BitmapUpdate(rdpContext* context, const BITMAP_UPDATE* bitmap) { BITMAP_UPDATE* wParam; @@ -118,12 +116,11 @@ static BOOL update_message_BitmapUpdate(rdpContext* context, if (!wParam) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(Update, BitmapUpdate), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(Update, BitmapUpdate), (void*)wParam, NULL); } -static BOOL update_message_Palette(rdpContext* context, - const PALETTE_UPDATE* palette) +static BOOL update_message_Palette(rdpContext* context, const PALETTE_UPDATE* palette) { PALETTE_UPDATE* wParam; @@ -135,26 +132,25 @@ static BOOL update_message_Palette(rdpContext* context, if (!wParam) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(Update, Palette), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, MakeMessageId(Update, Palette), + (void*)wParam, NULL); } -static BOOL update_message_PlaySound(rdpContext* context, - const PLAY_SOUND_UPDATE* playSound) +static BOOL update_message_PlaySound(rdpContext* context, const PLAY_SOUND_UPDATE* playSound) { PLAY_SOUND_UPDATE* wParam; if (!context || !context->update || !playSound) return FALSE; - wParam = (PLAY_SOUND_UPDATE*) malloc(sizeof(PLAY_SOUND_UPDATE)); + wParam = (PLAY_SOUND_UPDATE*)malloc(sizeof(PLAY_SOUND_UPDATE)); if (!wParam) return FALSE; CopyMemory(wParam, playSound, sizeof(PLAY_SOUND_UPDATE)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(Update, PlaySound), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(Update, PlaySound), (void*)wParam, NULL); } static BOOL update_message_SetKeyboardIndicators(rdpContext* context, UINT16 led_flags) @@ -162,41 +158,41 @@ static BOOL update_message_SetKeyboardIndicators(rdpContext* context, UINT16 led if (!context || !context->update) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(Update, SetKeyboardIndicators), (void*)(size_t)led_flags, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(Update, SetKeyboardIndicators), (void*)(size_t)led_flags, + NULL); } static BOOL update_message_SetKeyboardImeStatus(rdpContext* context, UINT16 imeId, UINT32 imeState, - UINT32 imeConvMode) + UINT32 imeConvMode) { if (!context || !context->update) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(Update, SetKeyboardImeStatus), (void*)(size_t)((imeId << 16UL) | imeState), - (void*)(size_t) imeConvMode); + return MessageQueue_Post( + context->update->queue, (void*)context, MakeMessageId(Update, SetKeyboardImeStatus), + (void*)(size_t)((imeId << 16UL) | imeState), (void*)(size_t)imeConvMode); } -static BOOL update_message_RefreshRect(rdpContext* context, BYTE count, - const RECTANGLE_16* areas) +static BOOL update_message_RefreshRect(rdpContext* context, BYTE count, const RECTANGLE_16* areas) { RECTANGLE_16* lParam; if (!context || !context->update || !areas) return FALSE; - lParam = (RECTANGLE_16*) calloc(count, sizeof(RECTANGLE_16)); + lParam = (RECTANGLE_16*)calloc(count, sizeof(RECTANGLE_16)); if (!lParam) return FALSE; CopyMemory(lParam, areas, sizeof(RECTANGLE_16) * count); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(Update, RefreshRect), (void*)(size_t) count, (void*) lParam); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(Update, RefreshRect), (void*)(size_t)count, + (void*)lParam); } -static BOOL update_message_SuppressOutput(rdpContext* context, BYTE allow, - const RECTANGLE_16* area) +static BOOL update_message_SuppressOutput(rdpContext* context, BYTE allow, const RECTANGLE_16* area) { RECTANGLE_16* lParam = NULL; @@ -205,7 +201,7 @@ static BOOL update_message_SuppressOutput(rdpContext* context, BYTE allow, if (area) { - lParam = (RECTANGLE_16*) malloc(sizeof(RECTANGLE_16)); + lParam = (RECTANGLE_16*)malloc(sizeof(RECTANGLE_16)); if (!lParam) return FALSE; @@ -213,8 +209,9 @@ static BOOL update_message_SuppressOutput(rdpContext* context, BYTE allow, CopyMemory(lParam, area, sizeof(RECTANGLE_16)); } - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(Update, SuppressOutput), (void*)(size_t) allow, (void*) lParam); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(Update, SuppressOutput), (void*)(size_t)allow, + (void*)lParam); } static BOOL update_message_SurfaceCommand(rdpContext* context, wStream* s) @@ -231,8 +228,8 @@ static BOOL update_message_SurfaceCommand(rdpContext* context, wStream* s) Stream_Copy(s, wParam, Stream_GetRemainingLength(s)); Stream_SetPosition(wParam, 0); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(Update, SurfaceCommand), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(Update, SurfaceCommand), (void*)wParam, NULL); } static BOOL update_message_SurfaceBits(rdpContext* context, @@ -248,26 +245,26 @@ static BOOL update_message_SurfaceBits(rdpContext* context, if (!wParam) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(Update, SurfaceBits), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(Update, SurfaceBits), (void*)wParam, NULL); } static BOOL update_message_SurfaceFrameMarker(rdpContext* context, - const SURFACE_FRAME_MARKER* surfaceFrameMarker) + const SURFACE_FRAME_MARKER* surfaceFrameMarker) { SURFACE_FRAME_MARKER* wParam; if (!context || !context->update || !surfaceFrameMarker) return FALSE; - wParam = (SURFACE_FRAME_MARKER*) malloc(sizeof(SURFACE_FRAME_MARKER)); + wParam = (SURFACE_FRAME_MARKER*)malloc(sizeof(SURFACE_FRAME_MARKER)); if (!wParam) return FALSE; CopyMemory(wParam, surfaceFrameMarker, sizeof(SURFACE_FRAME_MARKER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(Update, SurfaceFrameMarker), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(Update, SurfaceFrameMarker), (void*)wParam, NULL); } static BOOL update_message_SurfaceFrameAcknowledge(rdpContext* context, UINT32 frameId) @@ -275,8 +272,9 @@ static BOOL update_message_SurfaceFrameAcknowledge(rdpContext* context, UINT32 f if (!context || !context->update) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(Update, SurfaceFrameAcknowledge), (void*)(size_t) frameId, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(Update, SurfaceFrameAcknowledge), (void*)(size_t)frameId, + NULL); } /* Primary Update */ @@ -288,14 +286,14 @@ static BOOL update_message_DstBlt(rdpContext* context, const DSTBLT_ORDER* dstBl if (!context || !context->update || !dstBlt) return FALSE; - wParam = (DSTBLT_ORDER*) malloc(sizeof(DSTBLT_ORDER)); + wParam = (DSTBLT_ORDER*)malloc(sizeof(DSTBLT_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, dstBlt, sizeof(DSTBLT_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, DstBlt), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, DstBlt), (void*)wParam, NULL); } static BOOL update_message_PatBlt(rdpContext* context, PATBLT_ORDER* patBlt) @@ -305,199 +303,189 @@ static BOOL update_message_PatBlt(rdpContext* context, PATBLT_ORDER* patBlt) if (!context || !context->update || !patBlt) return FALSE; - wParam = (PATBLT_ORDER*) malloc(sizeof(PATBLT_ORDER)); + wParam = (PATBLT_ORDER*)malloc(sizeof(PATBLT_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, patBlt, sizeof(PATBLT_ORDER)); - wParam->brush.data = (BYTE*) wParam->brush.p8x8; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, PatBlt), (void*) wParam, NULL); + wParam->brush.data = (BYTE*)wParam->brush.p8x8; + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, PatBlt), (void*)wParam, NULL); } -static BOOL update_message_ScrBlt(rdpContext* context, - const SCRBLT_ORDER* scrBlt) +static BOOL update_message_ScrBlt(rdpContext* context, const SCRBLT_ORDER* scrBlt) { SCRBLT_ORDER* wParam; if (!context || !context->update || !scrBlt) return FALSE; - wParam = (SCRBLT_ORDER*) malloc(sizeof(SCRBLT_ORDER)); + wParam = (SCRBLT_ORDER*)malloc(sizeof(SCRBLT_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, scrBlt, sizeof(SCRBLT_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, ScrBlt), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, ScrBlt), (void*)wParam, NULL); } -static BOOL update_message_OpaqueRect( - rdpContext* context, - const OPAQUE_RECT_ORDER* opaqueRect) +static BOOL update_message_OpaqueRect(rdpContext* context, const OPAQUE_RECT_ORDER* opaqueRect) { OPAQUE_RECT_ORDER* wParam; if (!context || !context->update || !opaqueRect) return FALSE; - wParam = (OPAQUE_RECT_ORDER*) malloc(sizeof(OPAQUE_RECT_ORDER)); + wParam = (OPAQUE_RECT_ORDER*)malloc(sizeof(OPAQUE_RECT_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, opaqueRect, sizeof(OPAQUE_RECT_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, OpaqueRect), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, OpaqueRect), (void*)wParam, NULL); } -static BOOL update_message_DrawNineGrid( - rdpContext* context, - const DRAW_NINE_GRID_ORDER* drawNineGrid) +static BOOL update_message_DrawNineGrid(rdpContext* context, + const DRAW_NINE_GRID_ORDER* drawNineGrid) { DRAW_NINE_GRID_ORDER* wParam; if (!context || !context->update || !drawNineGrid) return FALSE; - wParam = (DRAW_NINE_GRID_ORDER*) malloc(sizeof(DRAW_NINE_GRID_ORDER)); + wParam = (DRAW_NINE_GRID_ORDER*)malloc(sizeof(DRAW_NINE_GRID_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, drawNineGrid, sizeof(DRAW_NINE_GRID_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, DrawNineGrid), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, DrawNineGrid), (void*)wParam, NULL); } -static BOOL update_message_MultiDstBlt(rdpContext* context, - const MULTI_DSTBLT_ORDER* multiDstBlt) +static BOOL update_message_MultiDstBlt(rdpContext* context, const MULTI_DSTBLT_ORDER* multiDstBlt) { MULTI_DSTBLT_ORDER* wParam; if (!context || !context->update || !multiDstBlt) return FALSE; - wParam = (MULTI_DSTBLT_ORDER*) malloc(sizeof(MULTI_DSTBLT_ORDER)); + wParam = (MULTI_DSTBLT_ORDER*)malloc(sizeof(MULTI_DSTBLT_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, multiDstBlt, sizeof(MULTI_DSTBLT_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, MultiDstBlt), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, MultiDstBlt), (void*)wParam, NULL); } -static BOOL update_message_MultiPatBlt(rdpContext* context, - const MULTI_PATBLT_ORDER* multiPatBlt) +static BOOL update_message_MultiPatBlt(rdpContext* context, const MULTI_PATBLT_ORDER* multiPatBlt) { MULTI_PATBLT_ORDER* wParam; if (!context || !context->update || !multiPatBlt) return FALSE; - wParam = (MULTI_PATBLT_ORDER*) malloc(sizeof(MULTI_PATBLT_ORDER)); + wParam = (MULTI_PATBLT_ORDER*)malloc(sizeof(MULTI_PATBLT_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, multiPatBlt, sizeof(MULTI_PATBLT_ORDER)); - wParam->brush.data = (BYTE*) wParam->brush.p8x8; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, MultiPatBlt), (void*) wParam, NULL); + wParam->brush.data = (BYTE*)wParam->brush.p8x8; + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, MultiPatBlt), (void*)wParam, NULL); } -static BOOL update_message_MultiScrBlt(rdpContext* context, - const MULTI_SCRBLT_ORDER* multiScrBlt) +static BOOL update_message_MultiScrBlt(rdpContext* context, const MULTI_SCRBLT_ORDER* multiScrBlt) { MULTI_SCRBLT_ORDER* wParam; if (!context || !context->update || !multiScrBlt) return FALSE; - wParam = (MULTI_SCRBLT_ORDER*) malloc(sizeof(MULTI_SCRBLT_ORDER)); + wParam = (MULTI_SCRBLT_ORDER*)malloc(sizeof(MULTI_SCRBLT_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, multiScrBlt, sizeof(MULTI_SCRBLT_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, MultiScrBlt), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, MultiScrBlt), (void*)wParam, NULL); } -static BOOL update_message_MultiOpaqueRect( - rdpContext* context, - const MULTI_OPAQUE_RECT_ORDER* multiOpaqueRect) +static BOOL update_message_MultiOpaqueRect(rdpContext* context, + const MULTI_OPAQUE_RECT_ORDER* multiOpaqueRect) { MULTI_OPAQUE_RECT_ORDER* wParam; if (!context || !context->update || !multiOpaqueRect) return FALSE; - wParam = (MULTI_OPAQUE_RECT_ORDER*) malloc(sizeof(MULTI_OPAQUE_RECT_ORDER)); + wParam = (MULTI_OPAQUE_RECT_ORDER*)malloc(sizeof(MULTI_OPAQUE_RECT_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, multiOpaqueRect, sizeof(MULTI_OPAQUE_RECT_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, MultiOpaqueRect), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, MultiOpaqueRect), (void*)wParam, NULL); } static BOOL update_message_MultiDrawNineGrid(rdpContext* context, - const MULTI_DRAW_NINE_GRID_ORDER* multiDrawNineGrid) + const MULTI_DRAW_NINE_GRID_ORDER* multiDrawNineGrid) { MULTI_DRAW_NINE_GRID_ORDER* wParam; if (!context || !context->update || !multiDrawNineGrid) return FALSE; - wParam = (MULTI_DRAW_NINE_GRID_ORDER*) malloc(sizeof(MULTI_DRAW_NINE_GRID_ORDER)); + wParam = (MULTI_DRAW_NINE_GRID_ORDER*)malloc(sizeof(MULTI_DRAW_NINE_GRID_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, multiDrawNineGrid, sizeof(MULTI_DRAW_NINE_GRID_ORDER)); /* TODO: complete copy */ - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, MultiDrawNineGrid), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, MultiDrawNineGrid), (void*)wParam, NULL); } -static BOOL update_message_LineTo(rdpContext* context, - const LINE_TO_ORDER* lineTo) +static BOOL update_message_LineTo(rdpContext* context, const LINE_TO_ORDER* lineTo) { LINE_TO_ORDER* wParam; if (!context || !context->update || !lineTo) return FALSE; - wParam = (LINE_TO_ORDER*) malloc(sizeof(LINE_TO_ORDER)); + wParam = (LINE_TO_ORDER*)malloc(sizeof(LINE_TO_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, lineTo, sizeof(LINE_TO_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, LineTo), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, LineTo), (void*)wParam, NULL); } -static BOOL update_message_Polyline(rdpContext* context, - const POLYLINE_ORDER* polyline) +static BOOL update_message_Polyline(rdpContext* context, const POLYLINE_ORDER* polyline) { POLYLINE_ORDER* wParam; if (!context || !context->update || !polyline) return FALSE; - wParam = (POLYLINE_ORDER*) malloc(sizeof(POLYLINE_ORDER)); + wParam = (POLYLINE_ORDER*)malloc(sizeof(POLYLINE_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, polyline, sizeof(POLYLINE_ORDER)); - wParam->points = (DELTA_POINT*) calloc(wParam->numDeltaEntries, sizeof(DELTA_POINT)); + wParam->points = (DELTA_POINT*)calloc(wParam->numDeltaEntries, sizeof(DELTA_POINT)); if (!wParam->points) { @@ -506,8 +494,8 @@ static BOOL update_message_Polyline(rdpContext* context, } CopyMemory(wParam->points, polyline->points, sizeof(DELTA_POINT) * wParam->numDeltaEntries); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, Polyline), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, Polyline), (void*)wParam, NULL); } static BOOL update_message_MemBlt(rdpContext* context, MEMBLT_ORDER* memBlt) @@ -517,14 +505,14 @@ static BOOL update_message_MemBlt(rdpContext* context, MEMBLT_ORDER* memBlt) if (!context || !context->update || !memBlt) return FALSE; - wParam = (MEMBLT_ORDER*) malloc(sizeof(MEMBLT_ORDER)); + wParam = (MEMBLT_ORDER*)malloc(sizeof(MEMBLT_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, memBlt, sizeof(MEMBLT_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, MemBlt), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, MemBlt), (void*)wParam, NULL); } static BOOL update_message_Mem3Blt(rdpContext* context, MEM3BLT_ORDER* mem3Blt) @@ -534,81 +522,77 @@ static BOOL update_message_Mem3Blt(rdpContext* context, MEM3BLT_ORDER* mem3Blt) if (!context || !context->update || !mem3Blt) return FALSE; - wParam = (MEM3BLT_ORDER*) malloc(sizeof(MEM3BLT_ORDER)); + wParam = (MEM3BLT_ORDER*)malloc(sizeof(MEM3BLT_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, mem3Blt, sizeof(MEM3BLT_ORDER)); - wParam->brush.data = (BYTE*) wParam->brush.p8x8; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, Mem3Blt), (void*) wParam, NULL); + wParam->brush.data = (BYTE*)wParam->brush.p8x8; + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, Mem3Blt), (void*)wParam, NULL); } -static BOOL update_message_SaveBitmap(rdpContext* context, - const SAVE_BITMAP_ORDER* saveBitmap) +static BOOL update_message_SaveBitmap(rdpContext* context, const SAVE_BITMAP_ORDER* saveBitmap) { SAVE_BITMAP_ORDER* wParam; if (!context || !context->update || !saveBitmap) return FALSE; - wParam = (SAVE_BITMAP_ORDER*) malloc(sizeof(SAVE_BITMAP_ORDER)); + wParam = (SAVE_BITMAP_ORDER*)malloc(sizeof(SAVE_BITMAP_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, saveBitmap, sizeof(SAVE_BITMAP_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, SaveBitmap), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, SaveBitmap), (void*)wParam, NULL); } -static BOOL update_message_GlyphIndex(rdpContext* context, - GLYPH_INDEX_ORDER* glyphIndex) +static BOOL update_message_GlyphIndex(rdpContext* context, GLYPH_INDEX_ORDER* glyphIndex) { GLYPH_INDEX_ORDER* wParam; if (!context || !context->update || !glyphIndex) return FALSE; - wParam = (GLYPH_INDEX_ORDER*) malloc(sizeof(GLYPH_INDEX_ORDER)); + wParam = (GLYPH_INDEX_ORDER*)malloc(sizeof(GLYPH_INDEX_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, glyphIndex, sizeof(GLYPH_INDEX_ORDER)); - wParam->brush.data = (BYTE*) wParam->brush.p8x8; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, GlyphIndex), (void*) wParam, NULL); + wParam->brush.data = (BYTE*)wParam->brush.p8x8; + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, GlyphIndex), (void*)wParam, NULL); } -static BOOL update_message_FastIndex(rdpContext* context, - const FAST_INDEX_ORDER* fastIndex) +static BOOL update_message_FastIndex(rdpContext* context, const FAST_INDEX_ORDER* fastIndex) { FAST_INDEX_ORDER* wParam; if (!context || !context->update || !fastIndex) return FALSE; - wParam = (FAST_INDEX_ORDER*) malloc(sizeof(FAST_INDEX_ORDER)); + wParam = (FAST_INDEX_ORDER*)malloc(sizeof(FAST_INDEX_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, fastIndex, sizeof(FAST_INDEX_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, FastIndex), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, FastIndex), (void*)wParam, NULL); } -static BOOL update_message_FastGlyph(rdpContext* context, - const FAST_GLYPH_ORDER* fastGlyph) +static BOOL update_message_FastGlyph(rdpContext* context, const FAST_GLYPH_ORDER* fastGlyph) { FAST_GLYPH_ORDER* wParam; if (!context || !context->update || !fastGlyph) return FALSE; - wParam = (FAST_GLYPH_ORDER*) malloc(sizeof(FAST_GLYPH_ORDER)); + wParam = (FAST_GLYPH_ORDER*)malloc(sizeof(FAST_GLYPH_ORDER)); if (!wParam) return FALSE; @@ -617,7 +601,7 @@ static BOOL update_message_FastGlyph(rdpContext* context, if (wParam->cbData > 1) { - wParam->glyphData.aj = (BYTE*) malloc(fastGlyph->glyphData.cb); + wParam->glyphData.aj = (BYTE*)malloc(fastGlyph->glyphData.cb); if (!wParam->glyphData.aj) { @@ -632,25 +616,24 @@ static BOOL update_message_FastGlyph(rdpContext* context, wParam->glyphData.aj = NULL; } - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, FastGlyph), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, FastGlyph), (void*)wParam, NULL); } -static BOOL update_message_PolygonSC(rdpContext* context, - const POLYGON_SC_ORDER* polygonSC) +static BOOL update_message_PolygonSC(rdpContext* context, const POLYGON_SC_ORDER* polygonSC) { POLYGON_SC_ORDER* wParam; if (!context || !context->update || !polygonSC) return FALSE; - wParam = (POLYGON_SC_ORDER*) malloc(sizeof(POLYGON_SC_ORDER)); + wParam = (POLYGON_SC_ORDER*)malloc(sizeof(POLYGON_SC_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, polygonSC, sizeof(POLYGON_SC_ORDER)); - wParam->points = (DELTA_POINT*) calloc(wParam->numPoints, sizeof(DELTA_POINT)); + wParam->points = (DELTA_POINT*)calloc(wParam->numPoints, sizeof(DELTA_POINT)); if (!wParam->points) { @@ -659,8 +642,8 @@ static BOOL update_message_PolygonSC(rdpContext* context, } CopyMemory(wParam->points, polygonSC, sizeof(DELTA_POINT) * wParam->numPoints); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, PolygonSC), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, PolygonSC), (void*)wParam, NULL); } static BOOL update_message_PolygonCB(rdpContext* context, POLYGON_CB_ORDER* polygonCB) @@ -670,13 +653,13 @@ static BOOL update_message_PolygonCB(rdpContext* context, POLYGON_CB_ORDER* poly if (!context || !context->update || !polygonCB) return FALSE; - wParam = (POLYGON_CB_ORDER*) malloc(sizeof(POLYGON_CB_ORDER)); + wParam = (POLYGON_CB_ORDER*)malloc(sizeof(POLYGON_CB_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, polygonCB, sizeof(POLYGON_CB_ORDER)); - wParam->points = (DELTA_POINT*) calloc(wParam->numPoints, sizeof(DELTA_POINT)); + wParam->points = (DELTA_POINT*)calloc(wParam->numPoints, sizeof(DELTA_POINT)); if (!wParam->points) { @@ -685,46 +668,44 @@ static BOOL update_message_PolygonCB(rdpContext* context, POLYGON_CB_ORDER* poly } CopyMemory(wParam->points, polygonCB, sizeof(DELTA_POINT) * wParam->numPoints); - wParam->brush.data = (BYTE*) wParam->brush.p8x8; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, PolygonCB), (void*) wParam, NULL); + wParam->brush.data = (BYTE*)wParam->brush.p8x8; + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, PolygonCB), (void*)wParam, NULL); } -static BOOL update_message_EllipseSC(rdpContext* context, - const ELLIPSE_SC_ORDER* ellipseSC) +static BOOL update_message_EllipseSC(rdpContext* context, const ELLIPSE_SC_ORDER* ellipseSC) { ELLIPSE_SC_ORDER* wParam; if (!context || !context->update || !ellipseSC) return FALSE; - wParam = (ELLIPSE_SC_ORDER*) malloc(sizeof(ELLIPSE_SC_ORDER)); + wParam = (ELLIPSE_SC_ORDER*)malloc(sizeof(ELLIPSE_SC_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, ellipseSC, sizeof(ELLIPSE_SC_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, EllipseSC), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, EllipseSC), (void*)wParam, NULL); } -static BOOL update_message_EllipseCB(rdpContext* context, - const ELLIPSE_CB_ORDER* ellipseCB) +static BOOL update_message_EllipseCB(rdpContext* context, const ELLIPSE_CB_ORDER* ellipseCB) { ELLIPSE_CB_ORDER* wParam; if (!context || !context->update || !ellipseCB) return FALSE; - wParam = (ELLIPSE_CB_ORDER*) malloc(sizeof(ELLIPSE_CB_ORDER)); + wParam = (ELLIPSE_CB_ORDER*)malloc(sizeof(ELLIPSE_CB_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, ellipseCB, sizeof(ELLIPSE_CB_ORDER)); - wParam->brush.data = (BYTE*) wParam->brush.p8x8; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PrimaryUpdate, EllipseCB), (void*) wParam, NULL); + wParam->brush.data = (BYTE*)wParam->brush.p8x8; + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PrimaryUpdate, EllipseCB), (void*)wParam, NULL); } /* Secondary Update */ @@ -742,12 +723,12 @@ static BOOL update_message_CacheBitmap(rdpContext* context, if (!wParam) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(SecondaryUpdate, CacheBitmap), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(SecondaryUpdate, CacheBitmap), (void*)wParam, NULL); } static BOOL update_message_CacheBitmapV2(rdpContext* context, - CACHE_BITMAP_V2_ORDER* cacheBitmapV2Order) + CACHE_BITMAP_V2_ORDER* cacheBitmapV2Order) { CACHE_BITMAP_V2_ORDER* wParam; @@ -759,12 +740,12 @@ static BOOL update_message_CacheBitmapV2(rdpContext* context, if (!wParam) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(SecondaryUpdate, CacheBitmapV2), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(SecondaryUpdate, CacheBitmapV2), (void*)wParam, NULL); } static BOOL update_message_CacheBitmapV3(rdpContext* context, - CACHE_BITMAP_V3_ORDER* cacheBitmapV3Order) + CACHE_BITMAP_V3_ORDER* cacheBitmapV3Order) { CACHE_BITMAP_V3_ORDER* wParam; @@ -776,13 +757,12 @@ static BOOL update_message_CacheBitmapV3(rdpContext* context, if (!wParam) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(SecondaryUpdate, CacheBitmapV3), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(SecondaryUpdate, CacheBitmapV3), (void*)wParam, NULL); } -static BOOL update_message_CacheColorTable( - rdpContext* context, - const CACHE_COLOR_TABLE_ORDER* cacheColorTableOrder) +static BOOL update_message_CacheColorTable(rdpContext* context, + const CACHE_COLOR_TABLE_ORDER* cacheColorTableOrder) { CACHE_COLOR_TABLE_ORDER* wParam; @@ -794,13 +774,11 @@ static BOOL update_message_CacheColorTable( if (!wParam) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(SecondaryUpdate, CacheColorTable), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(SecondaryUpdate, CacheColorTable), (void*)wParam, NULL); } -static BOOL update_message_CacheGlyph( - rdpContext* context, - const CACHE_GLYPH_ORDER* cacheGlyphOrder) +static BOOL update_message_CacheGlyph(rdpContext* context, const CACHE_GLYPH_ORDER* cacheGlyphOrder) { CACHE_GLYPH_ORDER* wParam; @@ -812,13 +790,12 @@ static BOOL update_message_CacheGlyph( if (!wParam) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(SecondaryUpdate, CacheGlyph), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(SecondaryUpdate, CacheGlyph), (void*)wParam, NULL); } -static BOOL update_message_CacheGlyphV2( - rdpContext* context, - const CACHE_GLYPH_V2_ORDER* cacheGlyphV2Order) +static BOOL update_message_CacheGlyphV2(rdpContext* context, + const CACHE_GLYPH_V2_ORDER* cacheGlyphV2Order) { CACHE_GLYPH_V2_ORDER* wParam; @@ -830,13 +807,11 @@ static BOOL update_message_CacheGlyphV2( if (!wParam) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(SecondaryUpdate, CacheGlyphV2), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(SecondaryUpdate, CacheGlyphV2), (void*)wParam, NULL); } -static BOOL update_message_CacheBrush( - rdpContext* context, - const CACHE_BRUSH_ORDER* cacheBrushOrder) +static BOOL update_message_CacheBrush(rdpContext* context, const CACHE_BRUSH_ORDER* cacheBrushOrder) { CACHE_BRUSH_ORDER* wParam; @@ -848,22 +823,22 @@ static BOOL update_message_CacheBrush( if (!wParam) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(SecondaryUpdate, CacheBrush), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(SecondaryUpdate, CacheBrush), (void*)wParam, NULL); } /* Alternate Secondary Update */ -static BOOL update_message_CreateOffscreenBitmap( - rdpContext* context, - const CREATE_OFFSCREEN_BITMAP_ORDER* createOffscreenBitmap) +static BOOL +update_message_CreateOffscreenBitmap(rdpContext* context, + const CREATE_OFFSCREEN_BITMAP_ORDER* createOffscreenBitmap) { CREATE_OFFSCREEN_BITMAP_ORDER* wParam; if (!context || !context->update || !createOffscreenBitmap) return FALSE; - wParam = (CREATE_OFFSCREEN_BITMAP_ORDER*) malloc(sizeof(CREATE_OFFSCREEN_BITMAP_ORDER)); + wParam = (CREATE_OFFSCREEN_BITMAP_ORDER*)malloc(sizeof(CREATE_OFFSCREEN_BITMAP_ORDER)); if (!wParam) return FALSE; @@ -871,7 +846,7 @@ static BOOL update_message_CreateOffscreenBitmap( CopyMemory(wParam, createOffscreenBitmap, sizeof(CREATE_OFFSCREEN_BITMAP_ORDER)); wParam->deleteList.cIndices = createOffscreenBitmap->deleteList.cIndices; wParam->deleteList.sIndices = wParam->deleteList.cIndices; - wParam->deleteList.indices = (UINT16*) calloc(wParam->deleteList.cIndices, sizeof(UINT16)); + wParam->deleteList.indices = (UINT16*)calloc(wParam->deleteList.cIndices, sizeof(UINT16)); if (!wParam->deleteList.indices) { @@ -881,225 +856,221 @@ static BOOL update_message_CreateOffscreenBitmap( CopyMemory(wParam->deleteList.indices, createOffscreenBitmap->deleteList.indices, wParam->deleteList.cIndices); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(AltSecUpdate, CreateOffscreenBitmap), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(AltSecUpdate, CreateOffscreenBitmap), (void*)wParam, + NULL); } -static BOOL update_message_SwitchSurface( - rdpContext* context, - const SWITCH_SURFACE_ORDER* switchSurface) +static BOOL update_message_SwitchSurface(rdpContext* context, + const SWITCH_SURFACE_ORDER* switchSurface) { SWITCH_SURFACE_ORDER* wParam; if (!context || !context->update || !switchSurface) return FALSE; - wParam = (SWITCH_SURFACE_ORDER*) malloc(sizeof(SWITCH_SURFACE_ORDER)); + wParam = (SWITCH_SURFACE_ORDER*)malloc(sizeof(SWITCH_SURFACE_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, switchSurface, sizeof(SWITCH_SURFACE_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(AltSecUpdate, SwitchSurface), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(AltSecUpdate, SwitchSurface), (void*)wParam, NULL); } -static BOOL update_message_CreateNineGridBitmap( - rdpContext* context, - const CREATE_NINE_GRID_BITMAP_ORDER* createNineGridBitmap) +static BOOL +update_message_CreateNineGridBitmap(rdpContext* context, + const CREATE_NINE_GRID_BITMAP_ORDER* createNineGridBitmap) { CREATE_NINE_GRID_BITMAP_ORDER* wParam; if (!context || !context->update || !createNineGridBitmap) return FALSE; - wParam = (CREATE_NINE_GRID_BITMAP_ORDER*) malloc(sizeof(CREATE_NINE_GRID_BITMAP_ORDER)); + wParam = (CREATE_NINE_GRID_BITMAP_ORDER*)malloc(sizeof(CREATE_NINE_GRID_BITMAP_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, createNineGridBitmap, sizeof(CREATE_NINE_GRID_BITMAP_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(AltSecUpdate, CreateNineGridBitmap), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(AltSecUpdate, CreateNineGridBitmap), (void*)wParam, + NULL); } -static BOOL update_message_FrameMarker( - rdpContext* context, - const FRAME_MARKER_ORDER* frameMarker) +static BOOL update_message_FrameMarker(rdpContext* context, const FRAME_MARKER_ORDER* frameMarker) { FRAME_MARKER_ORDER* wParam; if (!context || !context->update || !frameMarker) return FALSE; - wParam = (FRAME_MARKER_ORDER*) malloc(sizeof(FRAME_MARKER_ORDER)); + wParam = (FRAME_MARKER_ORDER*)malloc(sizeof(FRAME_MARKER_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, frameMarker, sizeof(FRAME_MARKER_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(AltSecUpdate, FrameMarker), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(AltSecUpdate, FrameMarker), (void*)wParam, NULL); } -static BOOL update_message_StreamBitmapFirst( - rdpContext* context, - const STREAM_BITMAP_FIRST_ORDER* streamBitmapFirst) +static BOOL update_message_StreamBitmapFirst(rdpContext* context, + const STREAM_BITMAP_FIRST_ORDER* streamBitmapFirst) { STREAM_BITMAP_FIRST_ORDER* wParam; if (!context || !context->update || !streamBitmapFirst) return FALSE; - wParam = (STREAM_BITMAP_FIRST_ORDER*) malloc(sizeof(STREAM_BITMAP_FIRST_ORDER)); + wParam = (STREAM_BITMAP_FIRST_ORDER*)malloc(sizeof(STREAM_BITMAP_FIRST_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, streamBitmapFirst, sizeof(STREAM_BITMAP_FIRST_ORDER)); /* TODO: complete copy */ - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(AltSecUpdate, StreamBitmapFirst), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(AltSecUpdate, StreamBitmapFirst), (void*)wParam, NULL); } -static BOOL update_message_StreamBitmapNext( - rdpContext* context, - const STREAM_BITMAP_NEXT_ORDER* streamBitmapNext) +static BOOL update_message_StreamBitmapNext(rdpContext* context, + const STREAM_BITMAP_NEXT_ORDER* streamBitmapNext) { STREAM_BITMAP_NEXT_ORDER* wParam; if (!context || !context->update || !streamBitmapNext) return FALSE; - wParam = (STREAM_BITMAP_NEXT_ORDER*) malloc(sizeof(STREAM_BITMAP_NEXT_ORDER)); + wParam = (STREAM_BITMAP_NEXT_ORDER*)malloc(sizeof(STREAM_BITMAP_NEXT_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, streamBitmapNext, sizeof(STREAM_BITMAP_NEXT_ORDER)); /* TODO: complete copy */ - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(AltSecUpdate, StreamBitmapNext), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(AltSecUpdate, StreamBitmapNext), (void*)wParam, NULL); } -static BOOL update_message_DrawGdiPlusFirst( - rdpContext* context, - const DRAW_GDIPLUS_FIRST_ORDER* drawGdiPlusFirst) +static BOOL update_message_DrawGdiPlusFirst(rdpContext* context, + const DRAW_GDIPLUS_FIRST_ORDER* drawGdiPlusFirst) { DRAW_GDIPLUS_FIRST_ORDER* wParam; if (!context || !context->update || !drawGdiPlusFirst) return FALSE; - wParam = (DRAW_GDIPLUS_FIRST_ORDER*) malloc(sizeof(DRAW_GDIPLUS_FIRST_ORDER)); + wParam = (DRAW_GDIPLUS_FIRST_ORDER*)malloc(sizeof(DRAW_GDIPLUS_FIRST_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, drawGdiPlusFirst, sizeof(DRAW_GDIPLUS_FIRST_ORDER)); /* TODO: complete copy */ - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(AltSecUpdate, DrawGdiPlusFirst), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(AltSecUpdate, DrawGdiPlusFirst), (void*)wParam, NULL); } -static BOOL update_message_DrawGdiPlusNext( - rdpContext* context, - const DRAW_GDIPLUS_NEXT_ORDER* drawGdiPlusNext) +static BOOL update_message_DrawGdiPlusNext(rdpContext* context, + const DRAW_GDIPLUS_NEXT_ORDER* drawGdiPlusNext) { DRAW_GDIPLUS_NEXT_ORDER* wParam; if (!context || !context->update || !drawGdiPlusNext) return FALSE; - wParam = (DRAW_GDIPLUS_NEXT_ORDER*) malloc(sizeof(DRAW_GDIPLUS_NEXT_ORDER)); + wParam = (DRAW_GDIPLUS_NEXT_ORDER*)malloc(sizeof(DRAW_GDIPLUS_NEXT_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, drawGdiPlusNext, sizeof(DRAW_GDIPLUS_NEXT_ORDER)); /* TODO: complete copy */ - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(AltSecUpdate, DrawGdiPlusNext), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(AltSecUpdate, DrawGdiPlusNext), (void*)wParam, NULL); } -static BOOL update_message_DrawGdiPlusEnd( - rdpContext* context, - const DRAW_GDIPLUS_END_ORDER* drawGdiPlusEnd) +static BOOL update_message_DrawGdiPlusEnd(rdpContext* context, + const DRAW_GDIPLUS_END_ORDER* drawGdiPlusEnd) { DRAW_GDIPLUS_END_ORDER* wParam; if (!context || !context->update || !drawGdiPlusEnd) return FALSE; - wParam = (DRAW_GDIPLUS_END_ORDER*) malloc(sizeof(DRAW_GDIPLUS_END_ORDER)); + wParam = (DRAW_GDIPLUS_END_ORDER*)malloc(sizeof(DRAW_GDIPLUS_END_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, drawGdiPlusEnd, sizeof(DRAW_GDIPLUS_END_ORDER)); /* TODO: complete copy */ - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(AltSecUpdate, DrawGdiPlusEnd), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(AltSecUpdate, DrawGdiPlusEnd), (void*)wParam, NULL); } -static BOOL update_message_DrawGdiPlusCacheFirst( - rdpContext* context, - const DRAW_GDIPLUS_CACHE_FIRST_ORDER* drawGdiPlusCacheFirst) +static BOOL +update_message_DrawGdiPlusCacheFirst(rdpContext* context, + const DRAW_GDIPLUS_CACHE_FIRST_ORDER* drawGdiPlusCacheFirst) { DRAW_GDIPLUS_CACHE_FIRST_ORDER* wParam; if (!context || !context->update || !drawGdiPlusCacheFirst) return FALSE; - wParam = (DRAW_GDIPLUS_CACHE_FIRST_ORDER*) malloc(sizeof(DRAW_GDIPLUS_CACHE_FIRST_ORDER)); + wParam = (DRAW_GDIPLUS_CACHE_FIRST_ORDER*)malloc(sizeof(DRAW_GDIPLUS_CACHE_FIRST_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, drawGdiPlusCacheFirst, sizeof(DRAW_GDIPLUS_CACHE_FIRST_ORDER)); /* TODO: complete copy */ - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(AltSecUpdate, DrawGdiPlusCacheFirst), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(AltSecUpdate, DrawGdiPlusCacheFirst), (void*)wParam, + NULL); } -static BOOL update_message_DrawGdiPlusCacheNext( - rdpContext* context, - const DRAW_GDIPLUS_CACHE_NEXT_ORDER* drawGdiPlusCacheNext) +static BOOL +update_message_DrawGdiPlusCacheNext(rdpContext* context, + const DRAW_GDIPLUS_CACHE_NEXT_ORDER* drawGdiPlusCacheNext) { DRAW_GDIPLUS_CACHE_NEXT_ORDER* wParam; if (!context || !context->update || !drawGdiPlusCacheNext) return FALSE; - wParam = (DRAW_GDIPLUS_CACHE_NEXT_ORDER*) malloc(sizeof(DRAW_GDIPLUS_CACHE_NEXT_ORDER)); + wParam = (DRAW_GDIPLUS_CACHE_NEXT_ORDER*)malloc(sizeof(DRAW_GDIPLUS_CACHE_NEXT_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, drawGdiPlusCacheNext, sizeof(DRAW_GDIPLUS_CACHE_NEXT_ORDER)); /* TODO: complete copy */ - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(AltSecUpdate, DrawGdiPlusCacheNext), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(AltSecUpdate, DrawGdiPlusCacheNext), (void*)wParam, + NULL); } -static BOOL update_message_DrawGdiPlusCacheEnd( - rdpContext* context, - const DRAW_GDIPLUS_CACHE_END_ORDER* drawGdiPlusCacheEnd) +static BOOL +update_message_DrawGdiPlusCacheEnd(rdpContext* context, + const DRAW_GDIPLUS_CACHE_END_ORDER* drawGdiPlusCacheEnd) { DRAW_GDIPLUS_CACHE_END_ORDER* wParam; if (!context || !context->update || !drawGdiPlusCacheEnd) return FALSE; - wParam = (DRAW_GDIPLUS_CACHE_END_ORDER*) malloc(sizeof(DRAW_GDIPLUS_CACHE_END_ORDER)); + wParam = (DRAW_GDIPLUS_CACHE_END_ORDER*)malloc(sizeof(DRAW_GDIPLUS_CACHE_END_ORDER)); if (!wParam) return FALSE; CopyMemory(wParam, drawGdiPlusCacheEnd, sizeof(DRAW_GDIPLUS_CACHE_END_ORDER)); /* TODO: complete copy */ - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(AltSecUpdate, DrawGdiPlusCacheEnd), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(AltSecUpdate, DrawGdiPlusCacheEnd), (void*)wParam, NULL); } /* Window Update */ @@ -1113,13 +1084,13 @@ static BOOL update_message_WindowCreate(rdpContext* context, const WINDOW_ORDER_ if (!context || !context->update || !orderInfo || !windowState) return FALSE; - wParam = (WINDOW_ORDER_INFO*) malloc(sizeof(WINDOW_ORDER_INFO)); + wParam = (WINDOW_ORDER_INFO*)malloc(sizeof(WINDOW_ORDER_INFO)); if (!wParam) return FALSE; CopyMemory(wParam, orderInfo, sizeof(WINDOW_ORDER_INFO)); - lParam = (WINDOW_STATE_ORDER*) malloc(sizeof(WINDOW_STATE_ORDER)); + lParam = (WINDOW_STATE_ORDER*)malloc(sizeof(WINDOW_STATE_ORDER)); if (!lParam) { @@ -1128,11 +1099,12 @@ static BOOL update_message_WindowCreate(rdpContext* context, const WINDOW_ORDER_ } CopyMemory(lParam, windowState, sizeof(WINDOW_STATE_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(WindowUpdate, WindowCreate), (void*) wParam, (void*) lParam); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(WindowUpdate, WindowCreate), (void*)wParam, + (void*)lParam); } -static BOOL update_message_WindowUpdate(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, +static BOOL update_message_WindowUpdate(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, const WINDOW_STATE_ORDER* windowState) { WINDOW_ORDER_INFO* wParam; @@ -1141,13 +1113,13 @@ static BOOL update_message_WindowUpdate(rdpContext* context, const WINDOW_ORDER_ if (!context || !context->update || !orderInfo || !windowState) return FALSE; - wParam = (WINDOW_ORDER_INFO*) malloc(sizeof(WINDOW_ORDER_INFO)); + wParam = (WINDOW_ORDER_INFO*)malloc(sizeof(WINDOW_ORDER_INFO)); if (!wParam) return FALSE; CopyMemory(wParam, orderInfo, sizeof(WINDOW_ORDER_INFO)); - lParam = (WINDOW_STATE_ORDER*) malloc(sizeof(WINDOW_STATE_ORDER)); + lParam = (WINDOW_STATE_ORDER*)malloc(sizeof(WINDOW_STATE_ORDER)); if (!lParam) { @@ -1156,8 +1128,9 @@ static BOOL update_message_WindowUpdate(rdpContext* context, const WINDOW_ORDER_ } CopyMemory(lParam, windowState, sizeof(WINDOW_STATE_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(WindowUpdate, WindowUpdate), (void*) wParam, (void*) lParam); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(WindowUpdate, WindowUpdate), (void*)wParam, + (void*)lParam); } static BOOL update_message_WindowIcon(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, @@ -1169,13 +1142,13 @@ static BOOL update_message_WindowIcon(rdpContext* context, const WINDOW_ORDER_IN if (!context || !context->update || !orderInfo || !windowIcon) return FALSE; - wParam = (WINDOW_ORDER_INFO*) malloc(sizeof(WINDOW_ORDER_INFO)); + wParam = (WINDOW_ORDER_INFO*)malloc(sizeof(WINDOW_ORDER_INFO)); if (!wParam) return FALSE; CopyMemory(wParam, orderInfo, sizeof(WINDOW_ORDER_INFO)); - lParam = (WINDOW_ICON_ORDER*) calloc(1, sizeof(WINDOW_ICON_ORDER)); + lParam = (WINDOW_ICON_ORDER*)calloc(1, sizeof(WINDOW_ICON_ORDER)); if (!lParam) goto out_fail; @@ -1186,11 +1159,11 @@ static BOOL update_message_WindowIcon(rdpContext* context, const WINDOW_ORDER_IN goto out_fail; CopyMemory(lParam, windowIcon, sizeof(WINDOW_ICON_ORDER)); - WLog_VRB(TAG, "update_message_WindowIcon"); + WLog_VRB(TAG, "update_message_WindowIcon"); if (windowIcon->iconInfo->cbBitsColor > 0) { - lParam->iconInfo->bitsColor = (BYTE*) malloc(windowIcon->iconInfo->cbBitsColor); + lParam->iconInfo->bitsColor = (BYTE*)malloc(windowIcon->iconInfo->cbBitsColor); if (!lParam->iconInfo->bitsColor) goto out_fail; @@ -1201,7 +1174,7 @@ static BOOL update_message_WindowIcon(rdpContext* context, const WINDOW_ORDER_IN if (windowIcon->iconInfo->cbBitsMask > 0) { - lParam->iconInfo->bitsMask = (BYTE*) malloc(windowIcon->iconInfo->cbBitsMask); + lParam->iconInfo->bitsMask = (BYTE*)malloc(windowIcon->iconInfo->cbBitsMask); if (!lParam->iconInfo->bitsMask) goto out_fail; @@ -1212,7 +1185,7 @@ static BOOL update_message_WindowIcon(rdpContext* context, const WINDOW_ORDER_IN if (windowIcon->iconInfo->cbColorTable > 0) { - lParam->iconInfo->colorTable = (BYTE*) malloc(windowIcon->iconInfo->cbColorTable); + lParam->iconInfo->colorTable = (BYTE*)malloc(windowIcon->iconInfo->cbColorTable); if (!lParam->iconInfo->colorTable) goto out_fail; @@ -1221,8 +1194,8 @@ static BOOL update_message_WindowIcon(rdpContext* context, const WINDOW_ORDER_IN windowIcon->iconInfo->cbColorTable); } - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(WindowUpdate, WindowIcon), (void*) wParam, (void*) lParam); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(WindowUpdate, WindowIcon), (void*)wParam, (void*)lParam); out_fail: if (lParam && lParam->iconInfo) @@ -1239,7 +1212,7 @@ out_fail: } static BOOL update_message_WindowCachedIcon(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, - const WINDOW_CACHED_ICON_ORDER* windowCachedIcon) + const WINDOW_CACHED_ICON_ORDER* windowCachedIcon) { WINDOW_ORDER_INFO* wParam; WINDOW_CACHED_ICON_ORDER* lParam; @@ -1247,13 +1220,13 @@ static BOOL update_message_WindowCachedIcon(rdpContext* context, const WINDOW_OR if (!context || !context->update || !orderInfo || !windowCachedIcon) return FALSE; - wParam = (WINDOW_ORDER_INFO*) malloc(sizeof(WINDOW_ORDER_INFO)); + wParam = (WINDOW_ORDER_INFO*)malloc(sizeof(WINDOW_ORDER_INFO)); if (!wParam) return FALSE; CopyMemory(wParam, orderInfo, sizeof(WINDOW_ORDER_INFO)); - lParam = (WINDOW_CACHED_ICON_ORDER*) malloc(sizeof(WINDOW_CACHED_ICON_ORDER)); + lParam = (WINDOW_CACHED_ICON_ORDER*)malloc(sizeof(WINDOW_CACHED_ICON_ORDER)); if (!lParam) { @@ -1262,8 +1235,9 @@ static BOOL update_message_WindowCachedIcon(rdpContext* context, const WINDOW_OR } CopyMemory(lParam, windowCachedIcon, sizeof(WINDOW_CACHED_ICON_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(WindowUpdate, WindowCachedIcon), (void*) wParam, (void*) lParam); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(WindowUpdate, WindowCachedIcon), (void*)wParam, + (void*)lParam); } static BOOL update_message_WindowDelete(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo) @@ -1273,18 +1247,18 @@ static BOOL update_message_WindowDelete(rdpContext* context, const WINDOW_ORDER_ if (!context || !context->update || !orderInfo) return FALSE; - wParam = (WINDOW_ORDER_INFO*) malloc(sizeof(WINDOW_ORDER_INFO)); + wParam = (WINDOW_ORDER_INFO*)malloc(sizeof(WINDOW_ORDER_INFO)); if (!wParam) return FALSE; CopyMemory(wParam, orderInfo, sizeof(WINDOW_ORDER_INFO)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(WindowUpdate, WindowDelete), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(WindowUpdate, WindowDelete), (void*)wParam, NULL); } static BOOL update_message_NotifyIconCreate(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, - const NOTIFY_ICON_STATE_ORDER* notifyIconState) + const NOTIFY_ICON_STATE_ORDER* notifyIconState) { WINDOW_ORDER_INFO* wParam; NOTIFY_ICON_STATE_ORDER* lParam; @@ -1292,13 +1266,13 @@ static BOOL update_message_NotifyIconCreate(rdpContext* context, const WINDOW_OR if (!context || !context->update || !orderInfo || !notifyIconState) return FALSE; - wParam = (WINDOW_ORDER_INFO*) malloc(sizeof(WINDOW_ORDER_INFO)); + wParam = (WINDOW_ORDER_INFO*)malloc(sizeof(WINDOW_ORDER_INFO)); if (!wParam) return FALSE; CopyMemory(wParam, orderInfo, sizeof(WINDOW_ORDER_INFO)); - lParam = (NOTIFY_ICON_STATE_ORDER*) malloc(sizeof(NOTIFY_ICON_STATE_ORDER)); + lParam = (NOTIFY_ICON_STATE_ORDER*)malloc(sizeof(NOTIFY_ICON_STATE_ORDER)); if (!lParam) { @@ -1307,12 +1281,13 @@ static BOOL update_message_NotifyIconCreate(rdpContext* context, const WINDOW_OR } CopyMemory(lParam, notifyIconState, sizeof(NOTIFY_ICON_STATE_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(WindowUpdate, NotifyIconCreate), (void*) wParam, (void*) lParam); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(WindowUpdate, NotifyIconCreate), (void*)wParam, + (void*)lParam); } static BOOL update_message_NotifyIconUpdate(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, - const NOTIFY_ICON_STATE_ORDER* notifyIconState) + const NOTIFY_ICON_STATE_ORDER* notifyIconState) { WINDOW_ORDER_INFO* wParam; NOTIFY_ICON_STATE_ORDER* lParam; @@ -1320,13 +1295,13 @@ static BOOL update_message_NotifyIconUpdate(rdpContext* context, const WINDOW_OR if (!context || !context->update || !orderInfo || !notifyIconState) return FALSE; - wParam = (WINDOW_ORDER_INFO*) malloc(sizeof(WINDOW_ORDER_INFO)); + wParam = (WINDOW_ORDER_INFO*)malloc(sizeof(WINDOW_ORDER_INFO)); if (!wParam) return FALSE; CopyMemory(wParam, orderInfo, sizeof(WINDOW_ORDER_INFO)); - lParam = (NOTIFY_ICON_STATE_ORDER*) malloc(sizeof(NOTIFY_ICON_STATE_ORDER)); + lParam = (NOTIFY_ICON_STATE_ORDER*)malloc(sizeof(NOTIFY_ICON_STATE_ORDER)); if (!lParam) { @@ -1335,8 +1310,9 @@ static BOOL update_message_NotifyIconUpdate(rdpContext* context, const WINDOW_OR } CopyMemory(lParam, notifyIconState, sizeof(NOTIFY_ICON_STATE_ORDER)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(WindowUpdate, NotifyIconUpdate), (void*) wParam, (void*) lParam); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(WindowUpdate, NotifyIconUpdate), (void*)wParam, + (void*)lParam); } static BOOL update_message_NotifyIconDelete(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo) @@ -1346,18 +1322,18 @@ static BOOL update_message_NotifyIconDelete(rdpContext* context, const WINDOW_OR if (!context || !context->update || !orderInfo) return FALSE; - wParam = (WINDOW_ORDER_INFO*) malloc(sizeof(WINDOW_ORDER_INFO)); + wParam = (WINDOW_ORDER_INFO*)malloc(sizeof(WINDOW_ORDER_INFO)); if (!wParam) return FALSE; CopyMemory(wParam, orderInfo, sizeof(WINDOW_ORDER_INFO)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(WindowUpdate, NotifyIconDelete), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(WindowUpdate, NotifyIconDelete), (void*)wParam, NULL); } static BOOL update_message_MonitoredDesktop(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, - const MONITORED_DESKTOP_ORDER* monitoredDesktop) + const MONITORED_DESKTOP_ORDER* monitoredDesktop) { WINDOW_ORDER_INFO* wParam; MONITORED_DESKTOP_ORDER* lParam; @@ -1365,13 +1341,13 @@ static BOOL update_message_MonitoredDesktop(rdpContext* context, const WINDOW_OR if (!context || !context->update || !orderInfo || !monitoredDesktop) return FALSE; - wParam = (WINDOW_ORDER_INFO*) malloc(sizeof(WINDOW_ORDER_INFO)); + wParam = (WINDOW_ORDER_INFO*)malloc(sizeof(WINDOW_ORDER_INFO)); if (!wParam) return FALSE; CopyMemory(wParam, orderInfo, sizeof(WINDOW_ORDER_INFO)); - lParam = (MONITORED_DESKTOP_ORDER*) malloc(sizeof(MONITORED_DESKTOP_ORDER)); + lParam = (MONITORED_DESKTOP_ORDER*)malloc(sizeof(MONITORED_DESKTOP_ORDER)); if (!lParam) { @@ -1384,36 +1360,37 @@ static BOOL update_message_MonitoredDesktop(rdpContext* context, const WINDOW_OR if (lParam->numWindowIds) { - lParam->windowIds = (UINT32*) calloc(lParam->numWindowIds, sizeof(UINT32)); + lParam->windowIds = (UINT32*)calloc(lParam->numWindowIds, sizeof(UINT32)); CopyMemory(lParam->windowIds, monitoredDesktop->windowIds, lParam->numWindowIds); } - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(WindowUpdate, MonitoredDesktop), (void*) wParam, (void*) lParam); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(WindowUpdate, MonitoredDesktop), (void*)wParam, + (void*)lParam); } static BOOL update_message_NonMonitoredDesktop(rdpContext* context, - const WINDOW_ORDER_INFO* orderInfo) + const WINDOW_ORDER_INFO* orderInfo) { WINDOW_ORDER_INFO* wParam; if (!context || !context->update || !orderInfo) return FALSE; - wParam = (WINDOW_ORDER_INFO*) malloc(sizeof(WINDOW_ORDER_INFO)); + wParam = (WINDOW_ORDER_INFO*)malloc(sizeof(WINDOW_ORDER_INFO)); if (!wParam) return FALSE; CopyMemory(wParam, orderInfo, sizeof(WINDOW_ORDER_INFO)); - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(WindowUpdate, NonMonitoredDesktop), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(WindowUpdate, NonMonitoredDesktop), (void*)wParam, NULL); } /* Pointer Update */ static BOOL update_message_PointerPosition(rdpContext* context, - const POINTER_POSITION_UPDATE* pointerPosition) + const POINTER_POSITION_UPDATE* pointerPosition) { POINTER_POSITION_UPDATE* wParam; @@ -1425,12 +1402,12 @@ static BOOL update_message_PointerPosition(rdpContext* context, if (!wParam) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PointerUpdate, PointerPosition), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PointerUpdate, PointerPosition), (void*)wParam, NULL); } static BOOL update_message_PointerSystem(rdpContext* context, - const POINTER_SYSTEM_UPDATE* pointerSystem) + const POINTER_SYSTEM_UPDATE* pointerSystem) { POINTER_SYSTEM_UPDATE* wParam; @@ -1442,8 +1419,8 @@ static BOOL update_message_PointerSystem(rdpContext* context, if (!wParam) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PointerUpdate, PointerSystem), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PointerUpdate, PointerSystem), (void*)wParam, NULL); } static BOOL update_message_PointerColor(rdpContext* context, @@ -1459,12 +1436,11 @@ static BOOL update_message_PointerColor(rdpContext* context, if (!wParam) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PointerUpdate, PointerColor), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PointerUpdate, PointerColor), (void*)wParam, NULL); } -static BOOL update_message_PointerNew(rdpContext* context, - const POINTER_NEW_UPDATE* pointerNew) +static BOOL update_message_PointerNew(rdpContext* context, const POINTER_NEW_UPDATE* pointerNew) { POINTER_NEW_UPDATE* wParam; @@ -1476,12 +1452,12 @@ static BOOL update_message_PointerNew(rdpContext* context, if (!wParam) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PointerUpdate, PointerNew), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PointerUpdate, PointerNew), (void*)wParam, NULL); } static BOOL update_message_PointerCached(rdpContext* context, - const POINTER_CACHED_UPDATE* pointerCached) + const POINTER_CACHED_UPDATE* pointerCached) { POINTER_CACHED_UPDATE* wParam; @@ -1493,8 +1469,8 @@ static BOOL update_message_PointerCached(rdpContext* context, if (!wParam) return FALSE; - return MessageQueue_Post(context->update->queue, (void*) context, - MakeMessageId(PointerUpdate, PointerCached), (void*) wParam, NULL); + return MessageQueue_Post(context->update->queue, (void*)context, + MakeMessageId(PointerUpdate, PointerCached), (void*)wParam, NULL); } /* Message Queue */ @@ -1505,7 +1481,7 @@ static BOOL update_message_free_update_class(wMessage* msg, int type) if (!msg) return FALSE; - context = (rdpContext*) msg->context; + context = (rdpContext*)msg->context; switch (type) { @@ -1526,18 +1502,18 @@ static BOOL update_message_free_update_class(wMessage* msg, int type) break; case Update_BitmapUpdate: - { - BITMAP_UPDATE* wParam = (BITMAP_UPDATE*) msg->wParam; - free_bitmap_update(context, wParam); - } - break; + { + BITMAP_UPDATE* wParam = (BITMAP_UPDATE*)msg->wParam; + free_bitmap_update(context, wParam); + } + break; case Update_Palette: - { - PALETTE_UPDATE* palette = (PALETTE_UPDATE*)msg->wParam; - free_palette_update(context, palette); - } - break; + { + PALETTE_UPDATE* palette = (PALETTE_UPDATE*)msg->wParam; + free_palette_update(context, palette); + } + break; case Update_PlaySound: free(msg->wParam); @@ -1552,18 +1528,18 @@ static BOOL update_message_free_update_class(wMessage* msg, int type) break; case Update_SurfaceCommand: - { - wStream* s = (wStream*) msg->wParam; - Stream_Free(s, TRUE); - } - break; + { + wStream* s = (wStream*)msg->wParam; + Stream_Free(s, TRUE); + } + break; case Update_SurfaceBits: - { - SURFACE_BITS_COMMAND* wParam = (SURFACE_BITS_COMMAND*) msg->wParam; - free_surface_bits_command(context, wParam); - } - break; + { + SURFACE_BITS_COMMAND* wParam = (SURFACE_BITS_COMMAND*)msg->wParam; + free_surface_bits_command(context, wParam); + } + break; case Update_SurfaceFrameMarker: free(msg->wParam); @@ -1581,7 +1557,6 @@ static BOOL update_message_free_update_class(wMessage* msg, int type) return TRUE; } - static BOOL update_message_process_update_class(rdpUpdateProxy* proxy, wMessage* msg, int type) { BOOL rc = FALSE; @@ -1600,7 +1575,7 @@ static BOOL update_message_process_update_class(rdpUpdateProxy* proxy, wMessage* break; case Update_SetBounds: - rc = IFCALLRESULT(FALSE, proxy->SetBounds, msg->context, (rdpBounds*) msg->wParam); + rc = IFCALLRESULT(FALSE, proxy->SetBounds, msg->context, (rdpBounds*)msg->wParam); break; case Update_Synchronize: @@ -1612,57 +1587,62 @@ static BOOL update_message_process_update_class(rdpUpdateProxy* proxy, wMessage* break; case Update_BitmapUpdate: - rc = IFCALLRESULT(FALSE, proxy->BitmapUpdate, msg->context, (BITMAP_UPDATE*) msg->wParam); + rc = + IFCALLRESULT(FALSE, proxy->BitmapUpdate, msg->context, (BITMAP_UPDATE*)msg->wParam); break; case Update_Palette: - rc = IFCALLRESULT(FALSE, proxy->Palette, msg->context, (PALETTE_UPDATE*) msg->wParam); + rc = IFCALLRESULT(FALSE, proxy->Palette, msg->context, (PALETTE_UPDATE*)msg->wParam); break; case Update_PlaySound: - rc = IFCALLRESULT(FALSE, proxy->PlaySound, msg->context, (PLAY_SOUND_UPDATE*) msg->wParam); + rc = IFCALLRESULT(FALSE, proxy->PlaySound, msg->context, + (PLAY_SOUND_UPDATE*)msg->wParam); break; case Update_RefreshRect: - rc = IFCALLRESULT(FALSE, proxy->RefreshRect, msg->context, - (BYTE)(size_t) msg->wParam, (RECTANGLE_16*) msg->lParam); + rc = IFCALLRESULT(FALSE, proxy->RefreshRect, msg->context, (BYTE)(size_t)msg->wParam, + (RECTANGLE_16*)msg->lParam); break; case Update_SuppressOutput: - rc = IFCALLRESULT(FALSE, proxy->SuppressOutput, msg->context, - (BYTE)(size_t) msg->wParam, (RECTANGLE_16*) msg->lParam); + rc = IFCALLRESULT(FALSE, proxy->SuppressOutput, msg->context, (BYTE)(size_t)msg->wParam, + (RECTANGLE_16*)msg->lParam); break; case Update_SurfaceCommand: - rc = IFCALLRESULT(FALSE, proxy->SurfaceCommand, msg->context, (wStream*) msg->wParam); + rc = IFCALLRESULT(FALSE, proxy->SurfaceCommand, msg->context, (wStream*)msg->wParam); break; case Update_SurfaceBits: - rc = IFCALLRESULT(FALSE, proxy->SurfaceBits, msg->context, (SURFACE_BITS_COMMAND*) msg->wParam); + rc = IFCALLRESULT(FALSE, proxy->SurfaceBits, msg->context, + (SURFACE_BITS_COMMAND*)msg->wParam); break; case Update_SurfaceFrameMarker: rc = IFCALLRESULT(FALSE, proxy->SurfaceFrameMarker, msg->context, - (SURFACE_FRAME_MARKER*) msg->wParam); + (SURFACE_FRAME_MARKER*)msg->wParam); break; case Update_SurfaceFrameAcknowledge: rc = IFCALLRESULT(FALSE, proxy->SurfaceFrameAcknowledge, msg->context, - (UINT32)(size_t) msg->wParam); + (UINT32)(size_t)msg->wParam); break; case Update_SetKeyboardIndicators: - rc = IFCALLRESULT(FALSE, proxy->SetKeyboardIndicators, msg->context, (UINT16)(size_t) msg->wParam); + rc = IFCALLRESULT(FALSE, proxy->SetKeyboardIndicators, msg->context, + (UINT16)(size_t)msg->wParam); break; case Update_SetKeyboardImeStatus: - { - const UINT16 imeId = ((size_t)msg->wParam) >> 16 & 0xFFFF; - const UINT32 imeState = ((size_t)msg->wParam) & 0xFFFF; - const UINT32 imeConvMode = ((size_t)msg->lParam); - rc = IFCALLRESULT(FALSE, proxy->SetKeyboardImeStatus, msg->context, imeId, imeState, imeConvMode); - } - break; + { + const UINT16 imeId = ((size_t)msg->wParam) >> 16 & 0xFFFF; + const UINT32 imeState = ((size_t)msg->wParam) & 0xFFFF; + const UINT32 imeConvMode = ((size_t)msg->lParam); + rc = IFCALLRESULT(FALSE, proxy->SetKeyboardImeStatus, msg->context, imeId, imeState, + imeConvMode); + } + break; default: break; @@ -1723,12 +1703,12 @@ static BOOL update_message_free_primary_update_class(wMessage* msg, int type) break; case PrimaryUpdate_Polyline: - { - POLYLINE_ORDER* wParam = (POLYLINE_ORDER*) msg->wParam; - free(wParam->points); - free(wParam); - } - break; + { + POLYLINE_ORDER* wParam = (POLYLINE_ORDER*)msg->wParam; + free(wParam->points); + free(wParam); + } + break; case PrimaryUpdate_MemBlt: free(msg->wParam); @@ -1751,28 +1731,28 @@ static BOOL update_message_free_primary_update_class(wMessage* msg, int type) break; case PrimaryUpdate_FastGlyph: - { - FAST_GLYPH_ORDER* wParam = (FAST_GLYPH_ORDER*) msg->wParam; - free(wParam->glyphData.aj); - free(wParam); - } - break; + { + FAST_GLYPH_ORDER* wParam = (FAST_GLYPH_ORDER*)msg->wParam; + free(wParam->glyphData.aj); + free(wParam); + } + break; case PrimaryUpdate_PolygonSC: - { - POLYGON_SC_ORDER* wParam = (POLYGON_SC_ORDER*) msg->wParam; - free(wParam->points); - free(wParam); - } - break; + { + POLYGON_SC_ORDER* wParam = (POLYGON_SC_ORDER*)msg->wParam; + free(wParam->points); + free(wParam); + } + break; case PrimaryUpdate_PolygonCB: - { - POLYGON_CB_ORDER* wParam = (POLYGON_CB_ORDER*) msg->wParam; - free(wParam->points); - free(wParam); - } - break; + { + POLYGON_CB_ORDER* wParam = (POLYGON_CB_ORDER*)msg->wParam; + free(wParam->points); + free(wParam); + } + break; case PrimaryUpdate_EllipseSC: free(msg->wParam); @@ -1789,9 +1769,8 @@ static BOOL update_message_free_primary_update_class(wMessage* msg, int type) return TRUE; } - static BOOL update_message_process_primary_update_class(rdpUpdateProxy* proxy, wMessage* msg, - int type) + int type) { if (!proxy || !msg) return FALSE; @@ -1799,72 +1778,85 @@ static BOOL update_message_process_primary_update_class(rdpUpdateProxy* proxy, w switch (type) { case PrimaryUpdate_DstBlt: - return IFCALLRESULT(FALSE, proxy->DstBlt, msg->context, (DSTBLT_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->DstBlt, msg->context, (DSTBLT_ORDER*)msg->wParam); case PrimaryUpdate_PatBlt: - return IFCALLRESULT(FALSE, proxy->PatBlt, msg->context, (PATBLT_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->PatBlt, msg->context, (PATBLT_ORDER*)msg->wParam); case PrimaryUpdate_ScrBlt: - return IFCALLRESULT(FALSE, proxy->ScrBlt, msg->context, (SCRBLT_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->ScrBlt, msg->context, (SCRBLT_ORDER*)msg->wParam); case PrimaryUpdate_OpaqueRect: - return IFCALLRESULT(FALSE, proxy->OpaqueRect, msg->context, (OPAQUE_RECT_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->OpaqueRect, msg->context, + (OPAQUE_RECT_ORDER*)msg->wParam); case PrimaryUpdate_DrawNineGrid: - return IFCALLRESULT(FALSE, proxy->DrawNineGrid, msg->context, (DRAW_NINE_GRID_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->DrawNineGrid, msg->context, + (DRAW_NINE_GRID_ORDER*)msg->wParam); case PrimaryUpdate_MultiDstBlt: - return IFCALLRESULT(FALSE, proxy->MultiDstBlt, msg->context, (MULTI_DSTBLT_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->MultiDstBlt, msg->context, + (MULTI_DSTBLT_ORDER*)msg->wParam); case PrimaryUpdate_MultiPatBlt: - return IFCALLRESULT(FALSE, proxy->MultiPatBlt, msg->context, (MULTI_PATBLT_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->MultiPatBlt, msg->context, + (MULTI_PATBLT_ORDER*)msg->wParam); case PrimaryUpdate_MultiScrBlt: - return IFCALLRESULT(FALSE, proxy->MultiScrBlt, msg->context, (MULTI_SCRBLT_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->MultiScrBlt, msg->context, + (MULTI_SCRBLT_ORDER*)msg->wParam); case PrimaryUpdate_MultiOpaqueRect: return IFCALLRESULT(FALSE, proxy->MultiOpaqueRect, msg->context, - (MULTI_OPAQUE_RECT_ORDER*) msg->wParam); + (MULTI_OPAQUE_RECT_ORDER*)msg->wParam); case PrimaryUpdate_MultiDrawNineGrid: return IFCALLRESULT(FALSE, proxy->MultiDrawNineGrid, msg->context, - (MULTI_DRAW_NINE_GRID_ORDER*) msg->wParam); + (MULTI_DRAW_NINE_GRID_ORDER*)msg->wParam); case PrimaryUpdate_LineTo: - return IFCALLRESULT(FALSE, proxy->LineTo, msg->context, (LINE_TO_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->LineTo, msg->context, (LINE_TO_ORDER*)msg->wParam); case PrimaryUpdate_Polyline: - return IFCALLRESULT(FALSE, proxy->Polyline, msg->context, (POLYLINE_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->Polyline, msg->context, (POLYLINE_ORDER*)msg->wParam); case PrimaryUpdate_MemBlt: - return IFCALLRESULT(FALSE, proxy->MemBlt, msg->context, (MEMBLT_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->MemBlt, msg->context, (MEMBLT_ORDER*)msg->wParam); case PrimaryUpdate_Mem3Blt: - return IFCALLRESULT(FALSE, proxy->Mem3Blt, msg->context, (MEM3BLT_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->Mem3Blt, msg->context, (MEM3BLT_ORDER*)msg->wParam); case PrimaryUpdate_SaveBitmap: - return IFCALLRESULT(FALSE, proxy->SaveBitmap, msg->context, (SAVE_BITMAP_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->SaveBitmap, msg->context, + (SAVE_BITMAP_ORDER*)msg->wParam); case PrimaryUpdate_GlyphIndex: - return IFCALLRESULT(FALSE, proxy->GlyphIndex, msg->context, (GLYPH_INDEX_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->GlyphIndex, msg->context, + (GLYPH_INDEX_ORDER*)msg->wParam); case PrimaryUpdate_FastIndex: - return IFCALLRESULT(FALSE, proxy->FastIndex, msg->context, (FAST_INDEX_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->FastIndex, msg->context, + (FAST_INDEX_ORDER*)msg->wParam); case PrimaryUpdate_FastGlyph: - return IFCALLRESULT(FALSE, proxy->FastGlyph, msg->context, (FAST_GLYPH_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->FastGlyph, msg->context, + (FAST_GLYPH_ORDER*)msg->wParam); case PrimaryUpdate_PolygonSC: - return IFCALLRESULT(FALSE, proxy->PolygonSC, msg->context, (POLYGON_SC_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->PolygonSC, msg->context, + (POLYGON_SC_ORDER*)msg->wParam); case PrimaryUpdate_PolygonCB: - return IFCALLRESULT(FALSE, proxy->PolygonCB, msg->context, (POLYGON_CB_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->PolygonCB, msg->context, + (POLYGON_CB_ORDER*)msg->wParam); case PrimaryUpdate_EllipseSC: - return IFCALLRESULT(FALSE, proxy->EllipseSC, msg->context, (ELLIPSE_SC_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->EllipseSC, msg->context, + (ELLIPSE_SC_ORDER*)msg->wParam); case PrimaryUpdate_EllipseCB: - return IFCALLRESULT(FALSE, proxy->EllipseCB, msg->context, (ELLIPSE_CB_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->EllipseCB, msg->context, + (ELLIPSE_CB_ORDER*)msg->wParam); default: return FALSE; @@ -1883,53 +1875,53 @@ static BOOL update_message_free_secondary_update_class(wMessage* msg, int type) switch (type) { case SecondaryUpdate_CacheBitmap: - { - CACHE_BITMAP_ORDER* wParam = (CACHE_BITMAP_ORDER*) msg->wParam; - free_cache_bitmap_order(context, wParam); - } - break; + { + CACHE_BITMAP_ORDER* wParam = (CACHE_BITMAP_ORDER*)msg->wParam; + free_cache_bitmap_order(context, wParam); + } + break; case SecondaryUpdate_CacheBitmapV2: - { - CACHE_BITMAP_V2_ORDER* wParam = (CACHE_BITMAP_V2_ORDER*) msg->wParam; - free_cache_bitmap_v2_order(context, wParam); - } - break; + { + CACHE_BITMAP_V2_ORDER* wParam = (CACHE_BITMAP_V2_ORDER*)msg->wParam; + free_cache_bitmap_v2_order(context, wParam); + } + break; case SecondaryUpdate_CacheBitmapV3: - { - CACHE_BITMAP_V3_ORDER* wParam = (CACHE_BITMAP_V3_ORDER*) msg->wParam; - free_cache_bitmap_v3_order(context, wParam); - } - break; + { + CACHE_BITMAP_V3_ORDER* wParam = (CACHE_BITMAP_V3_ORDER*)msg->wParam; + free_cache_bitmap_v3_order(context, wParam); + } + break; case SecondaryUpdate_CacheColorTable: - { - CACHE_COLOR_TABLE_ORDER* wParam = (CACHE_COLOR_TABLE_ORDER*) msg->wParam; - free_cache_color_table_order(context, wParam); - } - break; + { + CACHE_COLOR_TABLE_ORDER* wParam = (CACHE_COLOR_TABLE_ORDER*)msg->wParam; + free_cache_color_table_order(context, wParam); + } + break; case SecondaryUpdate_CacheGlyph: - { - CACHE_GLYPH_ORDER* wParam = (CACHE_GLYPH_ORDER*) msg->wParam; - free_cache_glyph_order(context, wParam); - } - break; + { + CACHE_GLYPH_ORDER* wParam = (CACHE_GLYPH_ORDER*)msg->wParam; + free_cache_glyph_order(context, wParam); + } + break; case SecondaryUpdate_CacheGlyphV2: - { - CACHE_GLYPH_V2_ORDER* wParam = (CACHE_GLYPH_V2_ORDER*) msg->wParam; - free_cache_glyph_v2_order(context, wParam); - } - break; + { + CACHE_GLYPH_V2_ORDER* wParam = (CACHE_GLYPH_V2_ORDER*)msg->wParam; + free_cache_glyph_v2_order(context, wParam); + } + break; case SecondaryUpdate_CacheBrush: - { - CACHE_BRUSH_ORDER* wParam = (CACHE_BRUSH_ORDER*) msg->wParam; - free_cache_brush_order(context, wParam); - } - break; + { + CACHE_BRUSH_ORDER* wParam = (CACHE_BRUSH_ORDER*)msg->wParam; + free_cache_brush_order(context, wParam); + } + break; default: return FALSE; @@ -1938,9 +1930,8 @@ static BOOL update_message_free_secondary_update_class(wMessage* msg, int type) return TRUE; } - static BOOL update_message_process_secondary_update_class(rdpUpdateProxy* proxy, wMessage* msg, - int type) + int type) { if (!proxy || !msg) return FALSE; @@ -1948,28 +1939,32 @@ static BOOL update_message_process_secondary_update_class(rdpUpdateProxy* proxy, switch (type) { case SecondaryUpdate_CacheBitmap: - return IFCALLRESULT(FALSE, proxy->CacheBitmap, msg->context, (CACHE_BITMAP_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->CacheBitmap, msg->context, + (CACHE_BITMAP_ORDER*)msg->wParam); case SecondaryUpdate_CacheBitmapV2: return IFCALLRESULT(FALSE, proxy->CacheBitmapV2, msg->context, - (CACHE_BITMAP_V2_ORDER*) msg->wParam); + (CACHE_BITMAP_V2_ORDER*)msg->wParam); case SecondaryUpdate_CacheBitmapV3: return IFCALLRESULT(FALSE, proxy->CacheBitmapV3, msg->context, - (CACHE_BITMAP_V3_ORDER*) msg->wParam); + (CACHE_BITMAP_V3_ORDER*)msg->wParam); case SecondaryUpdate_CacheColorTable: return IFCALLRESULT(FALSE, proxy->CacheColorTable, msg->context, - (CACHE_COLOR_TABLE_ORDER*) msg->wParam); + (CACHE_COLOR_TABLE_ORDER*)msg->wParam); case SecondaryUpdate_CacheGlyph: - return IFCALLRESULT(FALSE, proxy->CacheGlyph, msg->context, (CACHE_GLYPH_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->CacheGlyph, msg->context, + (CACHE_GLYPH_ORDER*)msg->wParam); case SecondaryUpdate_CacheGlyphV2: - return IFCALLRESULT(FALSE, proxy->CacheGlyphV2, msg->context, (CACHE_GLYPH_V2_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->CacheGlyphV2, msg->context, + (CACHE_GLYPH_V2_ORDER*)msg->wParam); case SecondaryUpdate_CacheBrush: - return IFCALLRESULT(FALSE, proxy->CacheBrush, msg->context, (CACHE_BRUSH_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->CacheBrush, msg->context, + (CACHE_BRUSH_ORDER*)msg->wParam); default: return FALSE; @@ -1984,12 +1979,12 @@ static BOOL update_message_free_altsec_update_class(wMessage* msg, int type) switch (type) { case AltSecUpdate_CreateOffscreenBitmap: - { - CREATE_OFFSCREEN_BITMAP_ORDER* wParam = (CREATE_OFFSCREEN_BITMAP_ORDER*) msg->wParam; - free(wParam->deleteList.indices); - free(wParam); - } - break; + { + CREATE_OFFSCREEN_BITMAP_ORDER* wParam = (CREATE_OFFSCREEN_BITMAP_ORDER*)msg->wParam; + free(wParam->deleteList.indices); + free(wParam); + } + break; case AltSecUpdate_SwitchSurface: free(msg->wParam); @@ -2042,9 +2037,8 @@ static BOOL update_message_free_altsec_update_class(wMessage* msg, int type) return TRUE; } - static BOOL update_message_process_altsec_update_class(rdpUpdateProxy* proxy, wMessage* msg, - int type) + int type) { if (!proxy || !msg) return FALSE; @@ -2053,49 +2047,51 @@ static BOOL update_message_process_altsec_update_class(rdpUpdateProxy* proxy, wM { case AltSecUpdate_CreateOffscreenBitmap: return IFCALLRESULT(FALSE, proxy->CreateOffscreenBitmap, msg->context, - (CREATE_OFFSCREEN_BITMAP_ORDER*) msg->wParam); + (CREATE_OFFSCREEN_BITMAP_ORDER*)msg->wParam); case AltSecUpdate_SwitchSurface: - return IFCALLRESULT(FALSE, proxy->SwitchSurface, msg->context, (SWITCH_SURFACE_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->SwitchSurface, msg->context, + (SWITCH_SURFACE_ORDER*)msg->wParam); case AltSecUpdate_CreateNineGridBitmap: return IFCALLRESULT(FALSE, proxy->CreateNineGridBitmap, msg->context, - (CREATE_NINE_GRID_BITMAP_ORDER*) msg->wParam); + (CREATE_NINE_GRID_BITMAP_ORDER*)msg->wParam); case AltSecUpdate_FrameMarker: - return IFCALLRESULT(FALSE, proxy->FrameMarker, msg->context, (FRAME_MARKER_ORDER*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->FrameMarker, msg->context, + (FRAME_MARKER_ORDER*)msg->wParam); case AltSecUpdate_StreamBitmapFirst: return IFCALLRESULT(FALSE, proxy->StreamBitmapFirst, msg->context, - (STREAM_BITMAP_FIRST_ORDER*) msg->wParam); + (STREAM_BITMAP_FIRST_ORDER*)msg->wParam); case AltSecUpdate_StreamBitmapNext: return IFCALLRESULT(FALSE, proxy->StreamBitmapNext, msg->context, - (STREAM_BITMAP_NEXT_ORDER*) msg->wParam); + (STREAM_BITMAP_NEXT_ORDER*)msg->wParam); case AltSecUpdate_DrawGdiPlusFirst: return IFCALLRESULT(FALSE, proxy->DrawGdiPlusFirst, msg->context, - (DRAW_GDIPLUS_FIRST_ORDER*) msg->wParam); + (DRAW_GDIPLUS_FIRST_ORDER*)msg->wParam); case AltSecUpdate_DrawGdiPlusNext: return IFCALLRESULT(FALSE, proxy->DrawGdiPlusNext, msg->context, - (DRAW_GDIPLUS_NEXT_ORDER*) msg->wParam); + (DRAW_GDIPLUS_NEXT_ORDER*)msg->wParam); case AltSecUpdate_DrawGdiPlusEnd: return IFCALLRESULT(FALSE, proxy->DrawGdiPlusEnd, msg->context, - (DRAW_GDIPLUS_END_ORDER*) msg->wParam); + (DRAW_GDIPLUS_END_ORDER*)msg->wParam); case AltSecUpdate_DrawGdiPlusCacheFirst: return IFCALLRESULT(FALSE, proxy->DrawGdiPlusCacheFirst, msg->context, - (DRAW_GDIPLUS_CACHE_FIRST_ORDER*) msg->wParam); + (DRAW_GDIPLUS_CACHE_FIRST_ORDER*)msg->wParam); case AltSecUpdate_DrawGdiPlusCacheNext: return IFCALLRESULT(FALSE, proxy->DrawGdiPlusCacheNext, msg->context, - (DRAW_GDIPLUS_CACHE_NEXT_ORDER*) msg->wParam); + (DRAW_GDIPLUS_CACHE_NEXT_ORDER*)msg->wParam); case AltSecUpdate_DrawGdiPlusCacheEnd: return IFCALLRESULT(FALSE, proxy->DrawGdiPlusCacheEnd, msg->context, - (DRAW_GDIPLUS_CACHE_END_ORDER*) msg->wParam); + (DRAW_GDIPLUS_CACHE_END_ORDER*)msg->wParam); default: return FALSE; @@ -2120,30 +2116,30 @@ static BOOL update_message_free_window_update_class(wMessage* msg, int type) break; case WindowUpdate_WindowIcon: + { + WINDOW_ORDER_INFO* orderInfo = (WINDOW_ORDER_INFO*)msg->wParam; + WINDOW_ICON_ORDER* windowIcon = (WINDOW_ICON_ORDER*)msg->lParam; + + if (windowIcon->iconInfo->cbBitsColor > 0) { - WINDOW_ORDER_INFO* orderInfo = (WINDOW_ORDER_INFO*) msg->wParam; - WINDOW_ICON_ORDER* windowIcon = (WINDOW_ICON_ORDER*) msg->lParam; - - if (windowIcon->iconInfo->cbBitsColor > 0) - { - free(windowIcon->iconInfo->bitsColor); - } - - if (windowIcon->iconInfo->cbBitsMask > 0) - { - free(windowIcon->iconInfo->bitsMask); - } - - if (windowIcon->iconInfo->cbColorTable > 0) - { - free(windowIcon->iconInfo->colorTable); - } - - free(orderInfo); - free(windowIcon->iconInfo); - free(windowIcon); + free(windowIcon->iconInfo->bitsColor); } - break; + + if (windowIcon->iconInfo->cbBitsMask > 0) + { + free(windowIcon->iconInfo->bitsMask); + } + + if (windowIcon->iconInfo->cbColorTable > 0) + { + free(windowIcon->iconInfo->colorTable); + } + + free(orderInfo); + free(windowIcon->iconInfo); + free(windowIcon); + } + break; case WindowUpdate_WindowCachedIcon: free(msg->wParam); @@ -2169,13 +2165,13 @@ static BOOL update_message_free_window_update_class(wMessage* msg, int type) break; case WindowUpdate_MonitoredDesktop: - { - MONITORED_DESKTOP_ORDER* lParam = (MONITORED_DESKTOP_ORDER*) msg->lParam; - free(msg->wParam); - free(lParam->windowIds); - free(lParam); - } - break; + { + MONITORED_DESKTOP_ORDER* lParam = (MONITORED_DESKTOP_ORDER*)msg->lParam; + free(msg->wParam); + free(lParam->windowIds); + free(lParam); + } + break; case WindowUpdate_NonMonitoredDesktop: free(msg->wParam); @@ -2188,9 +2184,8 @@ static BOOL update_message_free_window_update_class(wMessage* msg, int type) return TRUE; } - static BOOL update_message_process_window_update_class(rdpUpdateProxy* proxy, wMessage* msg, - int type) + int type) { if (!proxy || !msg) return FALSE; @@ -2198,45 +2193,51 @@ static BOOL update_message_process_window_update_class(rdpUpdateProxy* proxy, wM switch (type) { case WindowUpdate_WindowCreate: - return IFCALLRESULT(FALSE, proxy->WindowCreate, msg->context, (WINDOW_ORDER_INFO*) msg->wParam, - (WINDOW_STATE_ORDER*) msg->lParam); + return IFCALLRESULT(FALSE, proxy->WindowCreate, msg->context, + (WINDOW_ORDER_INFO*)msg->wParam, (WINDOW_STATE_ORDER*)msg->lParam); case WindowUpdate_WindowUpdate: - return IFCALLRESULT(FALSE, proxy->WindowCreate, msg->context, (WINDOW_ORDER_INFO*) msg->wParam, - (WINDOW_STATE_ORDER*) msg->lParam); + return IFCALLRESULT(FALSE, proxy->WindowCreate, msg->context, + (WINDOW_ORDER_INFO*)msg->wParam, (WINDOW_STATE_ORDER*)msg->lParam); case WindowUpdate_WindowIcon: - { - WINDOW_ORDER_INFO* orderInfo = (WINDOW_ORDER_INFO*) msg->wParam; - WINDOW_ICON_ORDER* windowIcon = (WINDOW_ICON_ORDER*) msg->lParam; - return IFCALLRESULT(FALSE, proxy->WindowIcon, msg->context, orderInfo, windowIcon); - } + { + WINDOW_ORDER_INFO* orderInfo = (WINDOW_ORDER_INFO*)msg->wParam; + WINDOW_ICON_ORDER* windowIcon = (WINDOW_ICON_ORDER*)msg->lParam; + return IFCALLRESULT(FALSE, proxy->WindowIcon, msg->context, orderInfo, windowIcon); + } case WindowUpdate_WindowCachedIcon: - return IFCALLRESULT(FALSE, proxy->WindowCachedIcon, msg->context, (WINDOW_ORDER_INFO*) msg->wParam, - (WINDOW_CACHED_ICON_ORDER*) msg->lParam); + return IFCALLRESULT(FALSE, proxy->WindowCachedIcon, msg->context, + (WINDOW_ORDER_INFO*)msg->wParam, + (WINDOW_CACHED_ICON_ORDER*)msg->lParam); case WindowUpdate_WindowDelete: - return IFCALLRESULT(FALSE, proxy->WindowDelete, msg->context, (WINDOW_ORDER_INFO*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->WindowDelete, msg->context, + (WINDOW_ORDER_INFO*)msg->wParam); case WindowUpdate_NotifyIconCreate: - return IFCALLRESULT(FALSE, proxy->NotifyIconCreate, msg->context, (WINDOW_ORDER_INFO*) msg->wParam, - (NOTIFY_ICON_STATE_ORDER*) msg->lParam); + return IFCALLRESULT(FALSE, proxy->NotifyIconCreate, msg->context, + (WINDOW_ORDER_INFO*)msg->wParam, + (NOTIFY_ICON_STATE_ORDER*)msg->lParam); case WindowUpdate_NotifyIconUpdate: - return IFCALLRESULT(FALSE, proxy->NotifyIconUpdate, msg->context, (WINDOW_ORDER_INFO*) msg->wParam, - (NOTIFY_ICON_STATE_ORDER*) msg->lParam); + return IFCALLRESULT(FALSE, proxy->NotifyIconUpdate, msg->context, + (WINDOW_ORDER_INFO*)msg->wParam, + (NOTIFY_ICON_STATE_ORDER*)msg->lParam); case WindowUpdate_NotifyIconDelete: - return IFCALLRESULT(FALSE, proxy->NotifyIconDelete, msg->context, (WINDOW_ORDER_INFO*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->NotifyIconDelete, msg->context, + (WINDOW_ORDER_INFO*)msg->wParam); case WindowUpdate_MonitoredDesktop: - return IFCALLRESULT(FALSE, proxy->MonitoredDesktop, msg->context, (WINDOW_ORDER_INFO*) msg->wParam, - (MONITORED_DESKTOP_ORDER*) msg->lParam); + return IFCALLRESULT(FALSE, proxy->MonitoredDesktop, msg->context, + (WINDOW_ORDER_INFO*)msg->wParam, + (MONITORED_DESKTOP_ORDER*)msg->lParam); case WindowUpdate_NonMonitoredDesktop: return IFCALLRESULT(FALSE, proxy->NonMonitoredDesktop, msg->context, - (WINDOW_ORDER_INFO*) msg->wParam); + (WINDOW_ORDER_INFO*)msg->wParam); default: return FALSE; @@ -2255,39 +2256,39 @@ static BOOL update_message_free_pointer_update_class(wMessage* msg, int type) switch (type) { case PointerUpdate_PointerPosition: - { - POINTER_POSITION_UPDATE* wParam = (POINTER_POSITION_UPDATE*)msg->wParam; - free_pointer_position_update(context, wParam); - } - break; + { + POINTER_POSITION_UPDATE* wParam = (POINTER_POSITION_UPDATE*)msg->wParam; + free_pointer_position_update(context, wParam); + } + break; case PointerUpdate_PointerSystem: - { - POINTER_SYSTEM_UPDATE* wParam = (POINTER_SYSTEM_UPDATE*)msg->wParam; - free_pointer_system_update(context, wParam); - } - break; + { + POINTER_SYSTEM_UPDATE* wParam = (POINTER_SYSTEM_UPDATE*)msg->wParam; + free_pointer_system_update(context, wParam); + } + break; case PointerUpdate_PointerCached: - { - POINTER_CACHED_UPDATE* wParam = (POINTER_CACHED_UPDATE*) msg->wParam; - free_pointer_cached_update(context, wParam); - } - break; + { + POINTER_CACHED_UPDATE* wParam = (POINTER_CACHED_UPDATE*)msg->wParam; + free_pointer_cached_update(context, wParam); + } + break; case PointerUpdate_PointerColor: - { - POINTER_COLOR_UPDATE* wParam = (POINTER_COLOR_UPDATE*) msg->wParam; - free_pointer_color_update(context, wParam); - } - break; + { + POINTER_COLOR_UPDATE* wParam = (POINTER_COLOR_UPDATE*)msg->wParam; + free_pointer_color_update(context, wParam); + } + break; case PointerUpdate_PointerNew: - { - POINTER_NEW_UPDATE* wParam = (POINTER_NEW_UPDATE*) msg->wParam; - free_pointer_new_update(context, wParam); - } - break; + { + POINTER_NEW_UPDATE* wParam = (POINTER_NEW_UPDATE*)msg->wParam; + free_pointer_new_update(context, wParam); + } + break; default: return FALSE; @@ -2297,7 +2298,7 @@ static BOOL update_message_free_pointer_update_class(wMessage* msg, int type) } static BOOL update_message_process_pointer_update_class(rdpUpdateProxy* proxy, wMessage* msg, - int type) + int type) { if (!proxy || !msg) return FALSE; @@ -2306,21 +2307,23 @@ static BOOL update_message_process_pointer_update_class(rdpUpdateProxy* proxy, w { case PointerUpdate_PointerPosition: return IFCALLRESULT(FALSE, proxy->PointerPosition, msg->context, - (POINTER_POSITION_UPDATE*) msg->wParam); + (POINTER_POSITION_UPDATE*)msg->wParam); case PointerUpdate_PointerSystem: return IFCALLRESULT(FALSE, proxy->PointerSystem, msg->context, - (POINTER_SYSTEM_UPDATE*) msg->wParam); + (POINTER_SYSTEM_UPDATE*)msg->wParam); case PointerUpdate_PointerColor: - return IFCALLRESULT(FALSE, proxy->PointerColor, msg->context, (POINTER_COLOR_UPDATE*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->PointerColor, msg->context, + (POINTER_COLOR_UPDATE*)msg->wParam); case PointerUpdate_PointerNew: - return IFCALLRESULT(FALSE, proxy->PointerNew, msg->context, (POINTER_NEW_UPDATE*) msg->wParam); + return IFCALLRESULT(FALSE, proxy->PointerNew, msg->context, + (POINTER_NEW_UPDATE*)msg->wParam); case PointerUpdate_PointerCached: return IFCALLRESULT(FALSE, proxy->PointerCached, msg->context, - (POINTER_CACHED_UPDATE*) msg->wParam); + (POINTER_CACHED_UPDATE*)msg->wParam); default: return FALSE; @@ -2362,7 +2365,7 @@ static BOOL update_message_free_class(wMessage* msg, int msgClass, int msgType) } if (!status) - WLog_ERR(TAG, "Unknown message: class: %d type: %d", msgClass, msgType); + WLog_ERR(TAG, "Unknown message: class: %d type: %d", msgClass, msgType); return status; } @@ -2405,7 +2408,7 @@ static int update_message_process_class(rdpUpdateProxy* proxy, wMessage* msg, in if (!status) { - WLog_ERR(TAG, "message: class: %d type: %d failed", msgClass, msgType); + WLog_ERR(TAG, "message: class: %d type: %d failed", msgClass, msgType); return -1; } @@ -2654,7 +2657,7 @@ static DWORD WINAPI update_message_proxy_thread(LPVOID arg) if (!update || !update->queue) { - WLog_ERR(TAG, "update=%p, update->queue=%p", (void*) update, + WLog_ERR(TAG, "update=%p, update->queue=%p", (void*)update, (void*)(update ? update->queue : NULL)); ExitThread(1); return 1; @@ -2682,14 +2685,13 @@ rdpUpdateProxy* update_message_proxy_new(rdpUpdate* update) if (!update) return NULL; - if (!(message = (rdpUpdateProxy*) calloc(1, sizeof(rdpUpdateProxy)))) + if (!(message = (rdpUpdateProxy*)calloc(1, sizeof(rdpUpdateProxy)))) return NULL; message->update = update; update_message_register_interface(message, update); - if (!(message->thread = CreateThread(NULL, 0, update_message_proxy_thread, - update, 0, NULL))) + if (!(message->thread = CreateThread(NULL, 0, update_message_proxy_thread, update, 0, NULL))) { WLog_ERR(TAG, "Failed to create proxy thread"); free(message); @@ -2718,8 +2720,8 @@ static BOOL input_message_SynchronizeEvent(rdpInput* input, UINT32 flags) if (!input) return FALSE; - return MessageQueue_Post(input->queue, (void*) input, - MakeMessageId(Input, SynchronizeEvent), (void*)(size_t) flags, NULL); + return MessageQueue_Post(input->queue, (void*)input, MakeMessageId(Input, SynchronizeEvent), + (void*)(size_t)flags, NULL); } static BOOL input_message_KeyboardEvent(rdpInput* input, UINT16 flags, UINT16 code) @@ -2727,8 +2729,8 @@ static BOOL input_message_KeyboardEvent(rdpInput* input, UINT16 flags, UINT16 co if (!input) return FALSE; - return MessageQueue_Post(input->queue, (void*) input, - MakeMessageId(Input, KeyboardEvent), (void*)(size_t) flags, (void*)(size_t) code); + return MessageQueue_Post(input->queue, (void*)input, MakeMessageId(Input, KeyboardEvent), + (void*)(size_t)flags, (void*)(size_t)code); } static BOOL input_message_UnicodeKeyboardEvent(rdpInput* input, UINT16 flags, UINT16 code) @@ -2736,8 +2738,8 @@ static BOOL input_message_UnicodeKeyboardEvent(rdpInput* input, UINT16 flags, UI if (!input) return FALSE; - return MessageQueue_Post(input->queue, (void*) input, - MakeMessageId(Input, UnicodeKeyboardEvent), (void*)(size_t) flags, (void*)(size_t) code); + return MessageQueue_Post(input->queue, (void*)input, MakeMessageId(Input, UnicodeKeyboardEvent), + (void*)(size_t)flags, (void*)(size_t)code); } static BOOL input_message_MouseEvent(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) @@ -2747,8 +2749,8 @@ static BOOL input_message_MouseEvent(rdpInput* input, UINT16 flags, UINT16 x, UI if (!input) return FALSE; - return MessageQueue_Post(input->queue, (void*) input, - MakeMessageId(Input, MouseEvent), (void*)(size_t) flags, (void*)(size_t) pos); + return MessageQueue_Post(input->queue, (void*)input, MakeMessageId(Input, MouseEvent), + (void*)(size_t)flags, (void*)(size_t)pos); } static BOOL input_message_ExtendedMouseEvent(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) @@ -2758,8 +2760,8 @@ static BOOL input_message_ExtendedMouseEvent(rdpInput* input, UINT16 flags, UINT if (!input) return FALSE; - return MessageQueue_Post(input->queue, (void*) input, - MakeMessageId(Input, ExtendedMouseEvent), (void*)(size_t) flags, (void*)(size_t) pos); + return MessageQueue_Post(input->queue, (void*)input, MakeMessageId(Input, ExtendedMouseEvent), + (void*)(size_t)flags, (void*)(size_t)pos); } static BOOL input_message_FocusInEvent(rdpInput* input, UINT16 toggleStates) @@ -2767,8 +2769,8 @@ static BOOL input_message_FocusInEvent(rdpInput* input, UINT16 toggleStates) if (!input) return FALSE; - return MessageQueue_Post(input->queue, (void*) input, - MakeMessageId(Input, FocusInEvent), (void*)(size_t) toggleStates, NULL); + return MessageQueue_Post(input->queue, (void*)input, MakeMessageId(Input, FocusInEvent), + (void*)(size_t)toggleStates, NULL); } static BOOL input_message_KeyboardPauseEvent(rdpInput* input) @@ -2776,8 +2778,8 @@ static BOOL input_message_KeyboardPauseEvent(rdpInput* input) if (!input) return FALSE; - return MessageQueue_Post(input->queue, (void*) input, - MakeMessageId(Input, KeyboardPauseEvent), NULL, NULL); + return MessageQueue_Post(input->queue, (void*)input, MakeMessageId(Input, KeyboardPauseEvent), + NULL, NULL); } /* Event Queue */ @@ -2826,43 +2828,43 @@ static int input_message_process_input_class(rdpInputProxy* proxy, wMessage* msg switch (type) { case Input_SynchronizeEvent: - IFCALL(proxy->SynchronizeEvent, msg->context, (UINT32)(size_t) msg->wParam); + IFCALL(proxy->SynchronizeEvent, msg->context, (UINT32)(size_t)msg->wParam); break; case Input_KeyboardEvent: - IFCALL(proxy->KeyboardEvent, msg->context, (UINT16)(size_t) msg->wParam, - (UINT16)(size_t) msg->lParam); + IFCALL(proxy->KeyboardEvent, msg->context, (UINT16)(size_t)msg->wParam, + (UINT16)(size_t)msg->lParam); break; case Input_UnicodeKeyboardEvent: - IFCALL(proxy->UnicodeKeyboardEvent, msg->context, (UINT16)(size_t) msg->wParam, - (UINT16)(size_t) msg->lParam); + IFCALL(proxy->UnicodeKeyboardEvent, msg->context, (UINT16)(size_t)msg->wParam, + (UINT16)(size_t)msg->lParam); break; case Input_MouseEvent: - { - UINT32 pos; - UINT16 x, y; - pos = (UINT32)(size_t) msg->lParam; - x = ((pos & 0xFFFF0000) >> 16); - y = (pos & 0x0000FFFF); - IFCALL(proxy->MouseEvent, msg->context, (UINT16)(size_t) msg->wParam, x, y); - } - break; + { + UINT32 pos; + UINT16 x, y; + pos = (UINT32)(size_t)msg->lParam; + x = ((pos & 0xFFFF0000) >> 16); + y = (pos & 0x0000FFFF); + IFCALL(proxy->MouseEvent, msg->context, (UINT16)(size_t)msg->wParam, x, y); + } + break; case Input_ExtendedMouseEvent: - { - UINT32 pos; - UINT16 x, y; - pos = (UINT32)(size_t) msg->lParam; - x = ((pos & 0xFFFF0000) >> 16); - y = (pos & 0x0000FFFF); - IFCALL(proxy->ExtendedMouseEvent, msg->context, (UINT16)(size_t) msg->wParam, x, y); - } - break; + { + UINT32 pos; + UINT16 x, y; + pos = (UINT32)(size_t)msg->lParam; + x = ((pos & 0xFFFF0000) >> 16); + y = (pos & 0x0000FFFF); + IFCALL(proxy->ExtendedMouseEvent, msg->context, (UINT16)(size_t)msg->wParam, x, y); + } + break; case Input_FocusInEvent: - IFCALL(proxy->FocusInEvent, msg->context, (UINT16)(size_t) msg->wParam); + IFCALL(proxy->FocusInEvent, msg->context, (UINT16)(size_t)msg->wParam); break; case Input_KeyboardPauseEvent: @@ -2893,7 +2895,7 @@ static int input_message_free_class(wMessage* msg, int msgClass, int msgType) } if (status < 0) - WLog_ERR(TAG, "Unknown event: class: %d type: %d", msgClass, msgType); + WLog_ERR(TAG, "Unknown event: class: %d type: %d", msgClass, msgType); return status; } @@ -2915,7 +2917,7 @@ static int input_message_process_class(rdpInputProxy* proxy, wMessage* msg, int } if (status < 0) - WLog_ERR(TAG, "Unknown event: class: %d type: %d", msgClass, msgType); + WLog_ERR(TAG, "Unknown event: class: %d type: %d", msgClass, msgType); return status; } @@ -3018,7 +3020,7 @@ static BOOL input_message_proxy_register(rdpInputProxy* proxy, rdpInput* input) rdpInputProxy* input_message_proxy_new(rdpInput* input) { rdpInputProxy* proxy; - proxy = (rdpInputProxy*) calloc(1, sizeof(rdpInputProxy)); + proxy = (rdpInputProxy*)calloc(1, sizeof(rdpInputProxy)); if (!proxy) return NULL; diff --git a/libfreerdp/core/message.h b/libfreerdp/core/message.h index 26f78ad09..4de086236 100644 --- a/libfreerdp/core/message.h +++ b/libfreerdp/core/message.h @@ -127,12 +127,10 @@ struct rdp_update_proxy HANDLE thread; }; -FREERDP_LOCAL int update_message_queue_process_message(rdpUpdate* update, - wMessage* message); +FREERDP_LOCAL int update_message_queue_process_message(rdpUpdate* update, wMessage* message); FREERDP_LOCAL int update_message_queue_free_message(wMessage* message); -FREERDP_LOCAL int update_message_queue_process_pending_messages( - rdpUpdate* update); +FREERDP_LOCAL int update_message_queue_process_pending_messages(rdpUpdate* update); FREERDP_LOCAL rdpUpdateProxy* update_message_proxy_new(rdpUpdate* update); FREERDP_LOCAL void update_message_proxy_free(rdpUpdateProxy* message); @@ -158,8 +156,7 @@ struct rdp_input_proxy pKeyboardPauseEvent KeyboardPauseEvent; }; -FREERDP_LOCAL int input_message_queue_process_message(rdpInput* input, - wMessage* message); +FREERDP_LOCAL int input_message_queue_process_message(rdpInput* input, wMessage* message); FREERDP_LOCAL int input_message_queue_free_message(wMessage* message); FREERDP_LOCAL int input_message_queue_process_pending_messages(rdpInput* input); diff --git a/libfreerdp/core/metrics.c b/libfreerdp/core/metrics.c index 1515b6083..8e0279d56 100644 --- a/libfreerdp/core/metrics.c +++ b/libfreerdp/core/metrics.c @@ -31,9 +31,10 @@ double metrics_write_bytes(rdpMetrics* metrics, UINT32 UncompressedBytes, UINT32 metrics->TotalCompressedBytes += CompressedBytes; if (UncompressedBytes != 0) - CompressionRatio = ((double) CompressedBytes) / ((double) UncompressedBytes); + CompressionRatio = ((double)CompressedBytes) / ((double)UncompressedBytes); if (metrics->TotalUncompressedBytes != 0) - metrics->TotalCompressionRatio = ((double) metrics->TotalCompressedBytes) / ((double) metrics->TotalUncompressedBytes); + metrics->TotalCompressionRatio = + ((double)metrics->TotalCompressedBytes) / ((double)metrics->TotalUncompressedBytes); return CompressionRatio; } @@ -42,7 +43,7 @@ rdpMetrics* metrics_new(rdpContext* context) { rdpMetrics* metrics; - metrics = (rdpMetrics*) calloc(1, sizeof(rdpMetrics)); + metrics = (rdpMetrics*)calloc(1, sizeof(rdpMetrics)); if (metrics) { diff --git a/libfreerdp/core/multitransport.c b/libfreerdp/core/multitransport.c index 59d3d06bb..bc08f39eb 100644 --- a/libfreerdp/core/multitransport.c +++ b/libfreerdp/core/multitransport.c @@ -33,10 +33,10 @@ int rdp_recv_multitransport_packet(rdpRdp* rdp, wStream* s) if (Stream_GetRemainingLength(s) < 24) return -1; - Stream_Read_UINT32(s, requestId); /* requestId (4 bytes) */ + Stream_Read_UINT32(s, requestId); /* requestId (4 bytes) */ Stream_Read_UINT16(s, requestedProtocol); /* requestedProtocol (2 bytes) */ - Stream_Read_UINT16(s, reserved); /* reserved (2 bytes) */ - Stream_Read(s, securityCookie, 16); /* securityCookie (16 bytes) */ + Stream_Read_UINT16(s, reserved); /* reserved (2 bytes) */ + Stream_Read(s, securityCookie, 16); /* securityCookie (16 bytes) */ return 0; } diff --git a/libfreerdp/core/nego.c b/libfreerdp/core/nego.c index 205c0f679..4f8c05e4a 100644 --- a/libfreerdp/core/nego.c +++ b/libfreerdp/core/nego.c @@ -67,17 +67,10 @@ struct rdp_nego static const char* nego_state_string(NEGO_STATE state) { - static const char* const NEGO_STATE_STRINGS[] = - { - "NEGO_STATE_INITIAL", - "NEGO_STATE_EXT", - "NEGO_STATE_NLA", - "NEGO_STATE_TLS", - "NEGO_STATE_RDP", - "NEGO_STATE_FAIL", - "NEGO_STATE_FINAL", - "NEGO_STATE_INVALID" - }; + static const char* const NEGO_STATE_STRINGS[] = { "NEGO_STATE_INITIAL", "NEGO_STATE_EXT", + "NEGO_STATE_NLA", "NEGO_STATE_TLS", + "NEGO_STATE_RDP", "NEGO_STATE_FAIL", + "NEGO_STATE_FINAL", "NEGO_STATE_INVALID" }; if (state >= ARRAYSIZE(NEGO_STATE_STRINGS)) return NEGO_STATE_STRINGS[ARRAYSIZE(NEGO_STATE_STRINGS) - 1]; return NEGO_STATE_STRINGS[state]; @@ -85,19 +78,8 @@ static const char* nego_state_string(NEGO_STATE state) static const char* protocol_security_string(UINT32 security) { - static const char* PROTOCOL_SECURITY_STRINGS[] = - { - "RDP", - "TLS", - "NLA", - "UNK", - "UNK", - "UNK", - "UNK", - "UNK", - "EXT", - "UNK" - }; + static const char* PROTOCOL_SECURITY_STRINGS[] = { "RDP", "TLS", "NLA", "UNK", "UNK", + "UNK", "UNK", "UNK", "EXT", "UNK" }; if (security >= ARRAYSIZE(PROTOCOL_SECURITY_STRINGS)) return PROTOCOL_SECURITY_STRINGS[ARRAYSIZE(PROTOCOL_SECURITY_STRINGS) - 1]; return PROTOCOL_SECURITY_STRINGS[security]; @@ -210,8 +192,7 @@ BOOL nego_connect(rdpNego* nego) nego->state = NEGO_STATE_FINAL; return FALSE; } - } - while (nego->state != NEGO_STATE_FINAL); + } while (nego->state != NEGO_STATE_FINAL); } WLog_DBG(TAG, "Negotiated %s security", protocol_security_string(nego->SelectedProtocol)); @@ -278,7 +259,8 @@ BOOL nego_security_connect(rdpNego* nego) } else { - WLog_ERR(TAG, "cannot connect security layer because no protocol has been selected yet."); + WLog_ERR(TAG, + "cannot connect security layer because no protocol has been selected yet."); } } @@ -300,16 +282,19 @@ static BOOL nego_tcp_connect(rdpNego* nego) if (nego->GatewayBypassLocal) { /* Attempt a direct connection first, and then fallback to using the gateway */ - WLog_INFO(TAG, "Detecting if host can be reached locally. - This might take some time."); + WLog_INFO(TAG, + "Detecting if host can be reached locally. - This might take some time."); WLog_INFO(TAG, "To disable auto detection use /gateway-usage-method:direct"); transport_set_gateway_enabled(nego->transport, FALSE); - nego->TcpConnected = transport_connect(nego->transport, nego->hostname, nego->port, 1); + nego->TcpConnected = + transport_connect(nego->transport, nego->hostname, nego->port, 1); } if (!nego->TcpConnected) { transport_set_gateway_enabled(nego->transport, TRUE); - nego->TcpConnected = transport_connect(nego->transport, nego->hostname, nego->port, 15); + nego->TcpConnected = + transport_connect(nego->transport, nego->hostname, nego->port, 15); } } else @@ -376,7 +361,7 @@ BOOL nego_send_preconnection_pdu(rdpNego* nego) if (nego->PreconnectionBlob) { - cchPCB = (UINT16) ConvertToUnicode(CP_UTF8, 0, nego->PreconnectionBlob, -1, &wszPCB, 0); + cchPCB = (UINT16)ConvertToUnicode(CP_UTF8, 0, nego->PreconnectionBlob, -1, &wszPCB, 0); cchPCB += 1; /* zero-termination */ cbSize += cchPCB * 2; } @@ -390,11 +375,11 @@ BOOL nego_send_preconnection_pdu(rdpNego* nego) return FALSE; } - Stream_Write_UINT32(s, cbSize); /* cbSize */ - Stream_Write_UINT32(s, 0); /* Flags */ - Stream_Write_UINT32(s, PRECONNECTION_PDU_V2); /* Version */ + Stream_Write_UINT32(s, cbSize); /* cbSize */ + Stream_Write_UINT32(s, 0); /* Flags */ + Stream_Write_UINT32(s, PRECONNECTION_PDU_V2); /* Version */ Stream_Write_UINT32(s, nego->PreconnectionId); /* Id */ - Stream_Write_UINT16(s, cchPCB); /* cchPCB */ + Stream_Write_UINT16(s, cchPCB); /* cchPCB */ if (wszPCB) { @@ -617,7 +602,7 @@ int nego_recv(rdpTransport* transport, wStream* s, void* extra) BYTE li; BYTE type; UINT16 length; - rdpNego* nego = (rdpNego*) extra; + rdpNego* nego = (rdpNego*)extra; if (!tpkt_read_header(s, &length)) return -1; @@ -637,7 +622,7 @@ int nego_recv(rdpTransport* transport, wStream* s, void* extra) { case TYPE_RDP_NEG_RSP: nego_process_negotiation_response(nego, s); - WLog_DBG(TAG, "selected_protocol: %"PRIu32"", nego->SelectedProtocol); + WLog_DBG(TAG, "selected_protocol: %" PRIu32 "", nego->SelectedProtocol); /* enhanced security selected ? */ @@ -685,7 +670,6 @@ int nego_recv(rdpTransport* transport, wStream* s, void* extra) return 0; } - /** * Read optional routing token or cookie of X.224 Connection Request PDU. * @msdn{cc240470} @@ -761,13 +745,11 @@ static BOOL nego_read_request_token_or_cookie(rdpNego* nego, wStream* s) if (!result) { Stream_SetPosition(s, pos); - WLog_ERR(TAG, "invalid %s received", - isToken ? "routing token" : "cookie"); + WLog_ERR(TAG, "invalid %s received", isToken ? "routing token" : "cookie"); } else { - WLog_DBG(TAG, "received %s [%s]", - isToken ? "routing token" : "cookie", str); + WLog_DBG(TAG, "received %s [%s]", isToken ? "routing token" : "cookie", str); } return result; @@ -810,7 +792,7 @@ BOOL nego_read_request(rdpNego* nego, wStream* s) if (type != TYPE_RDP_NEG_REQ) { - WLog_ERR(TAG, "Incorrect negotiation request type %"PRIu8"", type); + WLog_ERR(TAG, "Incorrect negotiation request type %" PRIu8 "", type); return FALSE; } @@ -895,13 +877,13 @@ BOOL nego_send_negotiation_request(rdpNego* nego) cookie_length = nego->CookieMaxLength; Stream_Write(s, "Cookie: mstshash=", 17); - Stream_Write(s, (BYTE*) nego->cookie, cookie_length); + Stream_Write(s, (BYTE*)nego->cookie, cookie_length); Stream_Write_UINT8(s, 0x0D); /* CR */ Stream_Write_UINT8(s, 0x0A); /* LF */ length += cookie_length + 19; } - WLog_DBG(TAG, "RequestedProtocols: %"PRIu32"", nego->RequestedProtocols); + WLog_DBG(TAG, "RequestedProtocols: %" PRIu32 "", nego->RequestedProtocols); if ((nego->RequestedProtocols > PROTOCOL_RDP) || (nego->sendNegoData)) { @@ -911,7 +893,7 @@ BOOL nego_send_negotiation_request(rdpNego* nego) Stream_Write_UINT8(s, TYPE_RDP_NEG_REQ); Stream_Write_UINT8(s, flags); - Stream_Write_UINT16(s, 8); /* RDP_NEG_DATA length (8) */ + Stream_Write_UINT16(s, 8); /* RDP_NEG_DATA length (8) */ Stream_Write_UINT32(s, nego->RequestedProtocols); /* requestedProtocols */ length += 8; } @@ -944,7 +926,7 @@ void nego_process_negotiation_request(rdpNego* nego, wStream* s) Stream_Read_UINT8(s, flags); Stream_Read_UINT16(s, length); Stream_Read_UINT32(s, nego->RequestedProtocols); - WLog_DBG(TAG, "RDP_NEG_REQ: RequestedProtocol: 0x%08"PRIX32"", nego->RequestedProtocols); + WLog_DBG(TAG, "RDP_NEG_REQ: RequestedProtocol: 0x%08" PRIX32 "", nego->RequestedProtocols); nego->state = NEGO_STATE_FINAL; } @@ -1013,7 +995,7 @@ void nego_process_negotiation_failure(rdpNego* nego, wStream* s) break; default: - WLog_ERR(TAG, "Error: Unknown protocol security error %"PRIu32"", failureCode); + WLog_ERR(TAG, "Error: Unknown protocol security error %" PRIu32 "", failureCode); break; } @@ -1053,7 +1035,7 @@ BOOL nego_send_negotiation_response(rdpNego* nego) flags = 0; Stream_Write_UINT8(s, TYPE_RDP_NEG_FAILURE); Stream_Write_UINT8(s, flags); /* flags */ - Stream_Write_UINT16(s, 8); /* RDP_NEG_DATA length (8) */ + Stream_Write_UINT16(s, 8); /* RDP_NEG_DATA length (8) */ Stream_Write_UINT32(s, errorCode); length += 8; status = FALSE; @@ -1067,8 +1049,8 @@ BOOL nego_send_negotiation_response(rdpNego* nego) /* RDP_NEG_DATA must be present for TLS, NLA, and RDP */ Stream_Write_UINT8(s, TYPE_RDP_NEG_RSP); - Stream_Write_UINT8(s, flags); /* flags */ - Stream_Write_UINT16(s, 8); /* RDP_NEG_DATA length (8) */ + Stream_Write_UINT8(s, flags); /* flags */ + Stream_Write_UINT16(s, 8); /* RDP_NEG_DATA length (8) */ Stream_Write_UINT32(s, nego->SelectedProtocol); /* selectedProtocol */ length += 8; } @@ -1172,7 +1154,7 @@ void nego_init(rdpNego* nego) rdpNego* nego_new(rdpTransport* transport) { - rdpNego* nego = (rdpNego*) calloc(1, sizeof(rdpNego)); + rdpNego* nego = (rdpNego*)calloc(1, sizeof(rdpNego)); if (!nego) return NULL; @@ -1217,24 +1199,28 @@ BOOL nego_set_target(rdpNego* nego, const char* hostname, UINT16 port) /** * Enable security layer negotiation. * @param nego pointer to the negotiation structure - * @param enable_rdp whether to enable security layer negotiation (TRUE for enabled, FALSE for disabled) + * @param enable_rdp whether to enable security layer negotiation (TRUE for enabled, FALSE for + * disabled) */ void nego_set_negotiation_enabled(rdpNego* nego, BOOL NegotiateSecurityLayer) { - WLog_DBG(TAG, "Enabling security layer negotiation: %s", NegotiateSecurityLayer ? "TRUE" : "FALSE"); + WLog_DBG(TAG, "Enabling security layer negotiation: %s", + NegotiateSecurityLayer ? "TRUE" : "FALSE"); nego->NegotiateSecurityLayer = NegotiateSecurityLayer; } /** * Enable restricted admin mode. * @param nego pointer to the negotiation structure - * @param enable_restricted whether to enable security layer negotiation (TRUE for enabled, FALSE for disabled) + * @param enable_restricted whether to enable security layer negotiation (TRUE for enabled, FALSE + * for disabled) */ void nego_set_restricted_admin_mode_required(rdpNego* nego, BOOL RestrictedAdminModeRequired) { - WLog_DBG(TAG, "Enabling restricted admin mode: %s", RestrictedAdminModeRequired ? "TRUE" : "FALSE"); + WLog_DBG(TAG, "Enabling restricted admin mode: %s", + RestrictedAdminModeRequired ? "TRUE" : "FALSE"); nego->RestrictedAdminModeRequired = RestrictedAdminModeRequired; } @@ -1275,7 +1261,8 @@ void nego_enable_tls(rdpNego* nego, BOOL enable_tls) /** * Enable NLA security protocol. * @param nego pointer to the negotiation structure - * @param enable_nla whether to enable network level authentication protocol (TRUE for enabled, FALSE for disabled) + * @param enable_nla whether to enable network level authentication protocol (TRUE for enabled, + * FALSE for disabled) */ void nego_enable_nla(rdpNego* nego, BOOL enable_nla) @@ -1287,7 +1274,8 @@ void nego_enable_nla(rdpNego* nego, BOOL enable_nla) /** * Enable NLA extended security protocol. * @param nego pointer to the negotiation structure - * @param enable_ext whether to enable network level authentication extended protocol (TRUE for enabled, FALSE for disabled) + * @param enable_ext whether to enable network level authentication extended protocol (TRUE for + * enabled, FALSE for disabled) */ void nego_enable_ext(rdpNego* nego, BOOL enable_ext) @@ -1310,7 +1298,7 @@ BOOL nego_set_routing_token(rdpNego* nego, BYTE* RoutingToken, DWORD RoutingToke free(nego->RoutingToken); nego->RoutingTokenLength = RoutingTokenLength; - nego->RoutingToken = (BYTE*) malloc(nego->RoutingTokenLength); + nego->RoutingToken = (BYTE*)malloc(nego->RoutingTokenLength); if (!nego->RoutingToken) return FALSE; @@ -1413,7 +1401,6 @@ UINT32 nego_get_requested_protocols(rdpNego* nego) return nego->RequestedProtocols; } - BOOL nego_set_requested_protocols(rdpNego* nego, UINT32 RequestedProtocols) { if (!nego) diff --git a/libfreerdp/core/nego.h b/libfreerdp/core/nego.h index 22f9d71d1..f67e4fa95 100644 --- a/libfreerdp/core/nego.h +++ b/libfreerdp/core/nego.h @@ -32,13 +32,13 @@ /* Protocol Security Negotiation Protocols * [MS-RDPBCGR] 2.2.1.1.1 RDP Negotiation Request (RDP_NEG_REQ) */ -#define PROTOCOL_RDP 0x00000000 -#define PROTOCOL_SSL 0x00000001 -#define PROTOCOL_HYBRID 0x00000002 -#define PROTOCOL_RDSTLS 0x00000004 +#define PROTOCOL_RDP 0x00000000 +#define PROTOCOL_SSL 0x00000001 +#define PROTOCOL_HYBRID 0x00000002 +#define PROTOCOL_RDSTLS 0x00000004 #define PROTOCOL_HYBRID_EX 0x00000008 -#define PROTOCOL_FAILED_NEGO 0x80000000 /* only used internally, not on the wire */ +#define PROTOCOL_FAILED_NEGO 0x80000000 /* only used internally, not on the wire */ /* Protocol Security Negotiation Failure Codes */ enum RDP_NEG_FAILURE_FAILURECODES @@ -52,16 +52,16 @@ enum RDP_NEG_FAILURE_FAILURECODES }; /* Authorization Result */ -#define AUTHZ_SUCCESS 0x00000000 -#define AUTHZ_ACCESS_DENIED 0x0000052E +#define AUTHZ_SUCCESS 0x00000000 +#define AUTHZ_ACCESS_DENIED 0x0000052E enum _NEGO_STATE { NEGO_STATE_INITIAL, - NEGO_STATE_EXT, /* Extended NLA (NLA + TLS implicit) */ - NEGO_STATE_NLA, /* Network Level Authentication (TLS implicit) */ - NEGO_STATE_TLS, /* TLS Encryption without NLA */ - NEGO_STATE_RDP, /* Standard Legacy RDP Encryption */ + NEGO_STATE_EXT, /* Extended NLA (NLA + TLS implicit) */ + NEGO_STATE_NLA, /* Network Level Authentication (TLS implicit) */ + NEGO_STATE_TLS, /* TLS Encryption without NLA */ + NEGO_STATE_RDP, /* Standard Legacy RDP Encryption */ NEGO_STATE_FAIL, /* Negotiation failure */ NEGO_STATE_FINAL }; @@ -77,20 +77,20 @@ enum RDP_NEG_MSG TYPE_RDP_NEG_FAILURE = 0x3 }; -#define EXTENDED_CLIENT_DATA_SUPPORTED 0x01 -#define DYNVC_GFX_PROTOCOL_SUPPORTED 0x02 -#define RDP_NEGRSP_RESERVED 0x04 -#define RESTRICTED_ADMIN_MODE_SUPPORTED 0x08 +#define EXTENDED_CLIENT_DATA_SUPPORTED 0x01 +#define DYNVC_GFX_PROTOCOL_SUPPORTED 0x02 +#define RDP_NEGRSP_RESERVED 0x04 +#define RESTRICTED_ADMIN_MODE_SUPPORTED 0x08 -#define PRECONNECTION_PDU_V1_SIZE 16 -#define PRECONNECTION_PDU_V2_MIN_SIZE (PRECONNECTION_PDU_V1_SIZE + 2) +#define PRECONNECTION_PDU_V1_SIZE 16 +#define PRECONNECTION_PDU_V2_MIN_SIZE (PRECONNECTION_PDU_V1_SIZE + 2) -#define PRECONNECTION_PDU_V1 1 -#define PRECONNECTION_PDU_V2 2 +#define PRECONNECTION_PDU_V1 1 +#define PRECONNECTION_PDU_V2 2 -#define RESTRICTED_ADMIN_MODE_REQUIRED 0x01 -#define REDIRECTED_AUTHENTICATION_MODE_REQUIRED 0x02 -#define CORRELATION_INFO_PRESENT 0x08 +#define RESTRICTED_ADMIN_MODE_REQUIRED 0x01 +#define REDIRECTED_AUTHENTICATION_MODE_REQUIRED 0x02 +#define CORRELATION_INFO_PRESENT 0x08 typedef struct rdp_nego rdpNego; @@ -108,29 +108,23 @@ FREERDP_LOCAL void nego_free(rdpNego* nego); FREERDP_LOCAL void nego_init(rdpNego* nego); FREERDP_LOCAL BOOL nego_set_target(rdpNego* nego, const char* hostname, UINT16 port); -FREERDP_LOCAL void nego_set_negotiation_enabled(rdpNego* nego, - BOOL NegotiateSecurityLayer); +FREERDP_LOCAL void nego_set_negotiation_enabled(rdpNego* nego, BOOL NegotiateSecurityLayer); FREERDP_LOCAL void nego_set_restricted_admin_mode_required(rdpNego* nego, - BOOL RestrictedAdminModeRequired); + BOOL RestrictedAdminModeRequired); FREERDP_LOCAL void nego_set_gateway_enabled(rdpNego* nego, BOOL GatewayEnabled); -FREERDP_LOCAL void nego_set_gateway_bypass_local(rdpNego* nego, - BOOL GatewayBypassLocal); +FREERDP_LOCAL void nego_set_gateway_bypass_local(rdpNego* nego, BOOL GatewayBypassLocal); FREERDP_LOCAL void nego_enable_rdp(rdpNego* nego, BOOL enable_rdp); FREERDP_LOCAL void nego_enable_tls(rdpNego* nego, BOOL enable_tls); FREERDP_LOCAL void nego_enable_nla(rdpNego* nego, BOOL enable_nla); FREERDP_LOCAL void nego_enable_ext(rdpNego* nego, BOOL enable_ext); FREERDP_LOCAL const BYTE* nego_get_routing_token(rdpNego* nego, DWORD* RoutingTokenLength); FREERDP_LOCAL BOOL nego_set_routing_token(rdpNego* nego, BYTE* RoutingToken, - DWORD RoutingTokenLength); + DWORD RoutingTokenLength); FREERDP_LOCAL BOOL nego_set_cookie(rdpNego* nego, char* cookie); -FREERDP_LOCAL void nego_set_cookie_max_length(rdpNego* nego, - UINT32 CookieMaxLength); -FREERDP_LOCAL void nego_set_send_preconnection_pdu(rdpNego* nego, - BOOL SendPreconnectionPdu); -FREERDP_LOCAL void nego_set_preconnection_id(rdpNego* nego, - UINT32 PreconnectionId); -FREERDP_LOCAL void nego_set_preconnection_blob(rdpNego* nego, - char* PreconnectionBlob); +FREERDP_LOCAL void nego_set_cookie_max_length(rdpNego* nego, UINT32 CookieMaxLength); +FREERDP_LOCAL void nego_set_send_preconnection_pdu(rdpNego* nego, BOOL SendPreconnectionPdu); +FREERDP_LOCAL void nego_set_preconnection_id(rdpNego* nego, UINT32 PreconnectionId); +FREERDP_LOCAL void nego_set_preconnection_blob(rdpNego* nego, char* PreconnectionBlob); FREERDP_LOCAL UINT32 nego_get_selected_protocol(rdpNego* nego); FREERDP_LOCAL BOOL nego_set_selected_protocol(rdpNego* nego, UINT32 SelectedProtocol); diff --git a/libfreerdp/core/nla.c b/libfreerdp/core/nla.c index 02c9d966e..c1182d2a1 100644 --- a/libfreerdp/core/nla.c +++ b/libfreerdp/core/nla.c @@ -49,8 +49,7 @@ #define TAG FREERDP_TAG("core.nla") -#define SERVER_KEY "Software\\"FREERDP_VENDOR_STRING"\\" \ - FREERDP_PRODUCT_STRING"\\Server" +#define SERVER_KEY "Software\\" FREERDP_VENDOR_STRING "\\" FREERDP_PRODUCT_STRING "\\Server" /** * TSRequest ::= SEQUENCE { @@ -95,10 +94,9 @@ * */ -#define NLA_PKG_NAME NEGO_SSP_NAME - -#define TERMSRV_SPN_PREFIX "TERMSRV/" +#define NLA_PKG_NAME NEGO_SSP_NAME +#define TERMSRV_SPN_PREFIX "TERMSRV/" struct rdp_nla { @@ -159,28 +157,25 @@ static SECURITY_STATUS nla_decrypt_ts_credentials(rdpNla* nla); static BOOL nla_read_ts_password_creds(rdpNla* nla, wStream* s); static void nla_identity_free(SEC_WINNT_AUTH_IDENTITY* identity); -#define ber_sizeof_sequence_octet_string(length) ber_sizeof_contextual_tag(ber_sizeof_octet_string(length)) + ber_sizeof_octet_string(length) -#define ber_write_sequence_octet_string(stream, context, value, length) ber_write_contextual_tag(stream, context, ber_sizeof_octet_string(length), TRUE) + ber_write_octet_string(stream, value, length) +#define ber_sizeof_sequence_octet_string(length) \ + ber_sizeof_contextual_tag(ber_sizeof_octet_string(length)) + ber_sizeof_octet_string(length) +#define ber_write_sequence_octet_string(stream, context, value, length) \ + ber_write_contextual_tag(stream, context, ber_sizeof_octet_string(length), TRUE) + \ + ber_write_octet_string(stream, value, length) /* CredSSP Client-To-Server Binding Hash\0 */ -static const BYTE ClientServerHashMagic[] = -{ - 0x43, 0x72, 0x65, 0x64, 0x53, 0x53, 0x50, 0x20, - 0x43, 0x6C, 0x69, 0x65, 0x6E, 0x74, 0x2D, 0x54, - 0x6F, 0x2D, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x20, 0x42, 0x69, 0x6E, 0x64, 0x69, 0x6E, 0x67, - 0x20, 0x48, 0x61, 0x73, 0x68, 0x00 -}; +static const BYTE ClientServerHashMagic[] = { 0x43, 0x72, 0x65, 0x64, 0x53, 0x53, 0x50, 0x20, + 0x43, 0x6C, 0x69, 0x65, 0x6E, 0x74, 0x2D, 0x54, + 0x6F, 0x2D, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x20, 0x42, 0x69, 0x6E, 0x64, 0x69, 0x6E, 0x67, + 0x20, 0x48, 0x61, 0x73, 0x68, 0x00 }; /* CredSSP Server-To-Client Binding Hash\0 */ -static const BYTE ServerClientHashMagic[] = -{ - 0x43, 0x72, 0x65, 0x64, 0x53, 0x53, 0x50, 0x20, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2D, 0x54, - 0x6F, 0x2D, 0x43, 0x6C, 0x69, 0x65, 0x6E, 0x74, - 0x20, 0x42, 0x69, 0x6E, 0x64, 0x69, 0x6E, 0x67, - 0x20, 0x48, 0x61, 0x73, 0x68, 0x00 -}; +static const BYTE ServerClientHashMagic[] = { 0x43, 0x72, 0x65, 0x64, 0x53, 0x53, 0x50, 0x20, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2D, 0x54, + 0x6F, 0x2D, 0x43, 0x6C, 0x69, 0x65, 0x6E, 0x74, + 0x20, 0x42, 0x69, 0x6E, 0x64, 0x69, 0x6E, 0x67, + 0x20, 0x48, 0x61, 0x73, 0x68, 0x00 }; static const UINT32 NonceLength = 32; @@ -236,8 +231,8 @@ static int nla_client_init(rdpNla* nla) if (settings->RestrictedAdminModeRequired) settings->DisableCredentialsDelegation = TRUE; - if ((!settings->Username) || (!strlen(settings->Username)) - || ((!settings->Password) && (!settings->RedirectionPassword))) + if ((!settings->Username) || (!strlen(settings->Username)) || + ((!settings->Password) && (!settings->RedirectionPassword))) { PromptPassword = TRUE; } @@ -281,17 +276,19 @@ static int nla_client_init(rdpNla* nla) { if (!instance->Authenticate) { - freerdp_set_last_error(instance->context, FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS); + freerdp_set_last_error(instance->context, + FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS); return 0; } else { - BOOL proceed = instance->Authenticate(instance, - &settings->Username, &settings->Password, &settings->Domain); + BOOL proceed = instance->Authenticate(instance, &settings->Username, + &settings->Password, &settings->Domain); if (!proceed) { - freerdp_set_last_error(instance->context, FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS); + freerdp_set_last_error(instance->context, + FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS); return 0; } } @@ -306,8 +303,9 @@ static int nla_client_init(rdpNla* nla) { if (settings->RedirectionPassword && settings->RedirectionPasswordLength > 0) { - if (sspi_SetAuthIdentityWithUnicodePassword(nla->identity, settings->Username, settings->Domain, - (UINT16*) settings->RedirectionPassword, + if (sspi_SetAuthIdentityWithUnicodePassword( + nla->identity, settings->Username, settings->Domain, + (UINT16*)settings->RedirectionPassword, settings->RedirectionPasswordLength / sizeof(WCHAR) - 1) < 0) return -1; } @@ -321,13 +319,14 @@ static int nla_client_init(rdpNla* nla) { if (strlen(settings->PasswordHash) == 32) { - if (sspi_SetAuthIdentity(nla->identity, settings->Username, settings->Domain, - settings->PasswordHash) < 0) + if (sspi_SetAuthIdentity(nla->identity, settings->Username, + settings->Domain, settings->PasswordHash) < 0) return -1; /** - * Increase password hash length by LB_PASSWORD_MAX_LENGTH to obtain a length exceeding - * the maximum (LB_PASSWORD_MAX_LENGTH) and use it this for hash identification in WinPR. + * Increase password hash length by LB_PASSWORD_MAX_LENGTH to obtain a + * length exceeding the maximum (LB_PASSWORD_MAX_LENGTH) and use it this for + * hash identification in WinPR. */ nla->identity->PasswordLength += LB_PASSWORD_MAX_LENGTH; usePassword = FALSE; @@ -360,7 +359,7 @@ static int nla_client_init(rdpNla* nla) CopyMemory(nla->PublicKey.pvBuffer, tls->PublicKey, tls->PublicKeyLength); length = sizeof(TERMSRV_SPN_PREFIX) + strlen(settings->ServerHostname); - spn = (SEC_CHAR*) malloc(length + 1); + spn = (SEC_CHAR*)malloc(length + 1); if (!spn) return -1; @@ -379,7 +378,7 @@ static int nla_client_init(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "QuerySecurityPackageInfo status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "QuerySecurityPackageInfo status %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -389,7 +388,7 @@ static int nla_client_init(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "QuerySecurityPackageInfo status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "QuerySecurityPackageInfo status %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -397,15 +396,15 @@ static int nla_client_init(rdpNla* nla) #endif nla->cbMaxToken = nla->pPackageInfo->cbMaxToken; nla->packageName = nla->pPackageInfo->Name; - WLog_DBG(TAG, "%s %"PRIu32" : packageName=%ls ; cbMaxToken=%d", __FUNCTION__, __LINE__, + WLog_DBG(TAG, "%s %" PRIu32 " : packageName=%ls ; cbMaxToken=%d", __FUNCTION__, __LINE__, nla->packageName, nla->cbMaxToken); - nla->status = nla->table->AcquireCredentialsHandle(NULL, NLA_PKG_NAME, - SECPKG_CRED_OUTBOUND, NULL, nla->identity, NULL, NULL, &nla->credentials, - &nla->expiration); + nla->status = nla->table->AcquireCredentialsHandle(NULL, NLA_PKG_NAME, SECPKG_CRED_OUTBOUND, + NULL, nla->identity, NULL, NULL, + &nla->credentials, &nla->expiration); if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "AcquireCredentialsHandle status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "AcquireCredentialsHandle status %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -445,31 +444,32 @@ int nla_client_begin(rdpNla* nla) if (!nla->outputBuffer.pvBuffer) return -1; - nla->status = nla->table->InitializeSecurityContext(&nla->credentials, - NULL, nla->ServicePrincipalName, nla->fContextReq, 0, - SECURITY_NATIVE_DREP, NULL, 0, &nla->context, - &nla->outputBufferDesc, &nla->pfContextAttr, &nla->expiration); - WLog_VRB(TAG, " InitializeSecurityContext status %s [0x%08"PRIX32"]", + nla->status = nla->table->InitializeSecurityContext( + &nla->credentials, NULL, nla->ServicePrincipalName, nla->fContextReq, 0, + SECURITY_NATIVE_DREP, NULL, 0, &nla->context, &nla->outputBufferDesc, &nla->pfContextAttr, + &nla->expiration); + WLog_VRB(TAG, " InitializeSecurityContext status %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); /* Handle kerberos context initialization failure. * After kerberos failed initialize NTLM context */ if (nla->status == SEC_E_NO_CREDENTIALS) { - nla->status = nla->table->InitializeSecurityContext(&nla->credentials, - NULL, nla->ServicePrincipalName, nla->fContextReq, 0, - SECURITY_NATIVE_DREP, NULL, 0, &nla->context, - &nla->outputBufferDesc, &nla->pfContextAttr, &nla->expiration); - WLog_VRB(TAG, " InitializeSecurityContext status %s [0x%08"PRIX32"]", + nla->status = nla->table->InitializeSecurityContext( + &nla->credentials, NULL, nla->ServicePrincipalName, nla->fContextReq, 0, + SECURITY_NATIVE_DREP, NULL, 0, &nla->context, &nla->outputBufferDesc, + &nla->pfContextAttr, &nla->expiration); + WLog_VRB(TAG, " InitializeSecurityContext status %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); if (nla->status) { - SECURITY_STATUS status = nla->table->QuerySecurityPackageInfo(NTLM_SSP_NAME, &nla->pPackageInfo); + SECURITY_STATUS status = + nla->table->QuerySecurityPackageInfo(NTLM_SSP_NAME, &nla->pPackageInfo); if (status != SEC_E_OK) { - WLog_ERR(TAG, "QuerySecurityPackageInfo status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "QuerySecurityPackageInfo status %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), status); return -1; } @@ -488,7 +488,7 @@ int nla_client_begin(rdpNla* nla) if (status != SEC_E_OK) { - WLog_WARN(TAG, "CompleteAuthToken status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "CompleteAuthToken status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); return -1; } @@ -509,7 +509,7 @@ int nla_client_begin(rdpNla* nla) nla->negoToken.pvBuffer = nla->outputBuffer.pvBuffer; nla->negoToken.cbBuffer = nla->outputBuffer.cbBuffer; WLog_DBG(TAG, "Sending Authentication Token"); -#if defined (WITH_DEBUG_NLA) +#if defined(WITH_DEBUG_NLA) winpr_HexDump(TAG, WLOG_DEBUG, nla->negoToken.pvBuffer, nla->negoToken.cbBuffer); #endif @@ -546,11 +546,11 @@ static int nla_client_recv(rdpNla* nla) if (!nla->outputBuffer.pvBuffer) return -1; - nla->status = nla->table->InitializeSecurityContext(&nla->credentials, - &nla->context, nla->ServicePrincipalName, nla->fContextReq, 0, - SECURITY_NATIVE_DREP, &nla->inputBufferDesc, - 0, &nla->context, &nla->outputBufferDesc, &nla->pfContextAttr, &nla->expiration); - WLog_VRB(TAG, "InitializeSecurityContext %s [0x%08"PRIX32"]", + nla->status = nla->table->InitializeSecurityContext( + &nla->credentials, &nla->context, nla->ServicePrincipalName, nla->fContextReq, 0, + SECURITY_NATIVE_DREP, &nla->inputBufferDesc, 0, &nla->context, &nla->outputBufferDesc, + &nla->pfContextAttr, &nla->expiration); + WLog_VRB(TAG, "InitializeSecurityContext %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); free(nla->inputBuffer.pvBuffer); nla->inputBuffer.pvBuffer = NULL; @@ -564,7 +564,7 @@ static int nla_client_recv(rdpNla* nla) if (status != SEC_E_OK) { - WLog_WARN(TAG, "CompleteAuthToken status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "CompleteAuthToken status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); return -1; } @@ -580,11 +580,12 @@ static int nla_client_recv(rdpNla* nla) { nla->havePubKeyAuth = TRUE; nla->status = nla->table->QueryContextAttributes(&nla->context, SECPKG_ATTR_SIZES, - &nla->ContextSizes); + &nla->ContextSizes); if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "QueryContextAttributes SECPKG_ATTR_SIZES failure %s [0x%08"PRIX32"]", + WLog_ERR(TAG, + "QueryContextAttributes SECPKG_ATTR_SIZES failure %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -601,7 +602,7 @@ static int nla_client_recv(rdpNla* nla) nla->negoToken.pvBuffer = nla->outputBuffer.pvBuffer; nla->negoToken.cbBuffer = nla->outputBuffer.cbBuffer; WLog_DBG(TAG, "Sending Authentication Token"); -#if defined (WITH_DEBUG_NLA) +#if defined(WITH_DEBUG_NLA) winpr_HexDump(TAG, WLOG_DEBUG, nla->negoToken.pvBuffer, nla->negoToken.cbBuffer); #endif @@ -630,7 +631,7 @@ static int nla_client_recv(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "Could not verify public key echo %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "Could not verify public key echo %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -640,7 +641,7 @@ static int nla_client_recv(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "nla_encrypt_ts_credentials status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "nla_encrypt_ts_credentials status %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -661,7 +662,7 @@ static int nla_client_recv(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "FreeCredentialsHandle status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "FreeCredentialsHandle status %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); } @@ -669,7 +670,7 @@ static int nla_client_recv(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "FreeContextBuffer status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "FreeContextBuffer status %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); } @@ -756,9 +757,11 @@ static int nla_server_init(rdpNla* nla) } #ifdef UNICODE - pInitSecurityInterface = (INIT_SECURITY_INTERFACE) GetProcAddress(hSSPI, "InitSecurityInterfaceW"); + pInitSecurityInterface = + (INIT_SECURITY_INTERFACE)GetProcAddress(hSSPI, "InitSecurityInterfaceW"); #else - pInitSecurityInterface = (INIT_SECURITY_INTERFACE) GetProcAddress(hSSPI, "InitSecurityInterfaceA"); + pInitSecurityInterface = + (INIT_SECURITY_INTERFACE)GetProcAddress(hSSPI, "InitSecurityInterfaceA"); #endif nla->table = pInitSecurityInterface(); } @@ -771,19 +774,20 @@ static int nla_server_init(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "QuerySecurityPackageInfo status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "QuerySecurityPackageInfo status %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); return -1; } nla->cbMaxToken = nla->pPackageInfo->cbMaxToken; nla->packageName = nla->pPackageInfo->Name; - nla->status = nla->table->AcquireCredentialsHandle(NULL, NLA_PKG_NAME, - SECPKG_CRED_INBOUND, NULL, NULL, NULL, NULL, &nla->credentials, &nla->expiration); + nla->status = + nla->table->AcquireCredentialsHandle(NULL, NLA_PKG_NAME, SECPKG_CRED_INBOUND, NULL, NULL, + NULL, NULL, &nla->credentials, &nla->expiration); if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "AcquireCredentialsHandle status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "AcquireCredentialsHandle status %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -856,11 +860,11 @@ static int nla_server_authenticate(rdpNla* nla) if (!nla->outputBuffer.pvBuffer) return -1; - nla->status = nla->table->AcceptSecurityContext(&nla->credentials, - nla->haveContext ? &nla->context : NULL, - &nla->inputBufferDesc, nla->fContextReq, SECURITY_NATIVE_DREP, &nla->context, - &nla->outputBufferDesc, &nla->pfContextAttr, &nla->expiration); - WLog_VRB(TAG, "AcceptSecurityContext status %s [0x%08"PRIX32"]", + nla->status = nla->table->AcceptSecurityContext( + &nla->credentials, nla->haveContext ? &nla->context : NULL, &nla->inputBufferDesc, + nla->fContextReq, SECURITY_NATIVE_DREP, &nla->context, &nla->outputBufferDesc, + &nla->pfContextAttr, &nla->expiration); + WLog_VRB(TAG, "AcceptSecurityContext status %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); nla->negoToken.pvBuffer = nla->outputBuffer.pvBuffer; nla->negoToken.cbBuffer = nla->outputBuffer.cbBuffer; @@ -872,28 +876,28 @@ static int nla_server_authenticate(rdpNla* nla) if (peer->ComputeNtlmHash) { SECURITY_STATUS status; - status = nla->table->SetContextAttributes(&nla->context, SECPKG_ATTR_AUTH_NTLM_HASH_CB, - peer->ComputeNtlmHash, 0); + status = nla->table->SetContextAttributes( + &nla->context, SECPKG_ATTR_AUTH_NTLM_HASH_CB, peer->ComputeNtlmHash, 0); if (status != SEC_E_OK) { - WLog_ERR(TAG, "SetContextAttributesA(hash cb) status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "SetContextAttributesA(hash cb) status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } - status = nla->table->SetContextAttributes(&nla->context, SECPKG_ATTR_AUTH_NTLM_HASH_CB_DATA, peer, - 0); + status = nla->table->SetContextAttributes( + &nla->context, SECPKG_ATTR_AUTH_NTLM_HASH_CB_DATA, peer, 0); if (status != SEC_E_OK) { - WLog_ERR(TAG, "SetContextAttributesA(hash cb data) status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "SetContextAttributesA(hash cb data) status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } } else if (nla->SamFile) { - nla->table->SetContextAttributes(&nla->context, SECPKG_ATTR_AUTH_NTLM_SAM_FILE, nla->SamFile, - strlen(nla->SamFile) + 1); + nla->table->SetContextAttributes(&nla->context, SECPKG_ATTR_AUTH_NTLM_SAM_FILE, + nla->SamFile, strlen(nla->SamFile) + 1); } if (nla->table->CompleteAuthToken) @@ -903,7 +907,7 @@ static int nla_server_authenticate(rdpNla* nla) if (status != SEC_E_OK) { - WLog_WARN(TAG, "CompleteAuthToken status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "CompleteAuthToken status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); return -1; } @@ -934,11 +938,12 @@ static int nla_server_authenticate(rdpNla* nla) nla->havePubKeyAuth = TRUE; nla->status = nla->table->QueryContextAttributes(&nla->context, SECPKG_ATTR_SIZES, - &nla->ContextSizes); + &nla->ContextSizes); if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "QueryContextAttributes SECPKG_ATTR_SIZES failure %s [0x%08"PRIX32"]", + WLog_ERR(TAG, + "QueryContextAttributes SECPKG_ATTR_SIZES failure %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -950,7 +955,8 @@ static int nla_server_authenticate(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "Error: could not verify client's public key echo %s [0x%08"PRIX32"]", + WLog_ERR(TAG, + "Error: could not verify client's public key echo %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -992,7 +998,7 @@ static int nla_server_authenticate(rdpNla* nla) break; } - WLog_ERR(TAG, "AcceptSecurityContext status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "AcceptSecurityContext status %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); nla_send(nla); return -1; /* Access Denied */ @@ -1025,7 +1031,7 @@ static int nla_server_authenticate(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "Could not decrypt TSCredentials status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "Could not decrypt TSCredentials status %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -1034,7 +1040,7 @@ static int nla_server_authenticate(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "ImpersonateSecurityContext status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "ImpersonateSecurityContext status %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -1044,7 +1050,7 @@ static int nla_server_authenticate(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "RevertSecurityContext status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "RevertSecurityContext status %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -1054,7 +1060,7 @@ static int nla_server_authenticate(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "DeleteSecurityContext status %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "DeleteSecurityContext status %s [0x%08" PRIX32 "]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -1120,12 +1126,14 @@ SECURITY_STATUS nla_encrypt_public_key_echo(rdpNla* nla) SecBufferDesc Message; SECURITY_STATUS status; ULONG public_key_length; - const BOOL krb = (_tcsncmp(nla->packageName, KERBEROS_SSP_NAME, ARRAYSIZE(KERBEROS_SSP_NAME)) == 0); + const BOOL krb = + (_tcsncmp(nla->packageName, KERBEROS_SSP_NAME, ARRAYSIZE(KERBEROS_SSP_NAME)) == 0); const BOOL nego = (_tcsncmp(nla->packageName, NEGO_SSP_NAME, ARRAYSIZE(NEGO_SSP_NAME)) == 0); - const BOOL ntlm = (_tcsncmp(nla->packageName, NTLM_SSP_NAME, ARRAYSIZE(NTLM_SSP_NAME)) == 0); + const BOOL ntlm = (_tcsncmp(nla->packageName, NTLM_SSP_NAME, ARRAYSIZE(NTLM_SSP_NAME)) == 0); public_key_length = nla->PublicKey.cbBuffer; - if (!sspi_SecBufferAlloc(&nla->pubKeyAuth, public_key_length + nla->ContextSizes.cbSecurityTrailer)) + if (!sspi_SecBufferAlloc(&nla->pubKeyAuth, + public_key_length + nla->ContextSizes.cbSecurityTrailer)) return SEC_E_INSUFFICIENT_MEMORY; if (krb) @@ -1144,30 +1152,32 @@ SECURITY_STATUS nla_encrypt_public_key_echo(rdpNla* nla) Buffers[0].pvBuffer = nla->pubKeyAuth.pvBuffer; Buffers[1].BufferType = SECBUFFER_DATA; /* TLS Public Key */ Buffers[1].cbBuffer = public_key_length; - Buffers[1].pvBuffer = ((BYTE*) nla->pubKeyAuth.pvBuffer) + nla->ContextSizes.cbSecurityTrailer; + Buffers[1].pvBuffer = + ((BYTE*)nla->pubKeyAuth.pvBuffer) + nla->ContextSizes.cbSecurityTrailer; CopyMemory(Buffers[1].pvBuffer, nla->PublicKey.pvBuffer, Buffers[1].cbBuffer); } if (!krb && nla->server) { /* server echos the public key +1 */ - ap_integer_increment_le((BYTE*) Buffers[1].pvBuffer, Buffers[1].cbBuffer); + ap_integer_increment_le((BYTE*)Buffers[1].pvBuffer, Buffers[1].cbBuffer); } Message.ulVersion = SECBUFFER_VERSION; - Message.pBuffers = (PSecBuffer) &Buffers; + Message.pBuffers = (PSecBuffer)&Buffers; status = nla->table->EncryptMessage(&nla->context, 0, &Message, nla->sendSeqNum++); if (status != SEC_E_OK) { - WLog_ERR(TAG, "EncryptMessage status %s [0x%08"PRIX32"]", - GetSecurityStatusString(status), status); + WLog_ERR(TAG, "EncryptMessage status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), + status); return status; } if (Message.cBuffers == 2 && Buffers[0].cbBuffer < nla->ContextSizes.cbSecurityTrailer) { - /* IMPORTANT: EncryptMessage may not use all the signature space, so we need to shrink the excess between the buffers */ + /* IMPORTANT: EncryptMessage may not use all the signature space, so we need to shrink the + * excess between the buffers */ MoveMemory(((BYTE*)Buffers[0].pvBuffer) + Buffers[0].cbBuffer, Buffers[1].pvBuffer, Buffers[1].cbBuffer); nla->pubKeyAuth.cbBuffer = Buffers[0].cbBuffer + Buffers[1].cbBuffer; @@ -1182,10 +1192,13 @@ SECURITY_STATUS nla_encrypt_public_key_hash(rdpNla* nla) SecBufferDesc Message; SECURITY_STATUS status = SEC_E_INTERNAL_ERROR; WINPR_DIGEST_CTX* sha256 = NULL; - const BOOL krb = (_tcsncmp(nla->packageName, KERBEROS_SSP_NAME, ARRAYSIZE(KERBEROS_SSP_NAME)) == 0); - const ULONG auth_data_length = (nla->ContextSizes.cbSecurityTrailer + WINPR_SHA256_DIGEST_LENGTH); + const BOOL krb = + (_tcsncmp(nla->packageName, KERBEROS_SSP_NAME, ARRAYSIZE(KERBEROS_SSP_NAME)) == 0); + const ULONG auth_data_length = + (nla->ContextSizes.cbSecurityTrailer + WINPR_SHA256_DIGEST_LENGTH); const BYTE* hashMagic = nla->server ? ServerClientHashMagic : ClientServerHashMagic; - const size_t hashSize = nla->server ? sizeof(ServerClientHashMagic) : sizeof(ClientServerHashMagic); + const size_t hashSize = + nla->server ? sizeof(ServerClientHashMagic) : sizeof(ClientServerHashMagic); if (!sspi_SecBufferAlloc(&nla->pubKeyAuth, auth_data_length)) { @@ -1229,26 +1242,28 @@ SECURITY_STATUS nla_encrypt_public_key_hash(rdpNla* nla) Buffers[0].pvBuffer = nla->pubKeyAuth.pvBuffer; Buffers[1].BufferType = SECBUFFER_DATA; /* SHA256 hash */ Buffers[1].cbBuffer = WINPR_SHA256_DIGEST_LENGTH; - Buffers[1].pvBuffer = ((BYTE*)nla->pubKeyAuth.pvBuffer) + nla->ContextSizes.cbSecurityTrailer; + Buffers[1].pvBuffer = + ((BYTE*)nla->pubKeyAuth.pvBuffer) + nla->ContextSizes.cbSecurityTrailer; if (!winpr_Digest_Final(sha256, Buffers[1].pvBuffer, Buffers[1].cbBuffer)) goto out; } - Message.pBuffers = (PSecBuffer) &Buffers; + Message.pBuffers = (PSecBuffer)&Buffers; Message.ulVersion = SECBUFFER_VERSION; status = nla->table->EncryptMessage(&nla->context, 0, &Message, nla->sendSeqNum++); if (status != SEC_E_OK) { - WLog_ERR(TAG, "EncryptMessage status %s [0x%08"PRIX32"]", - GetSecurityStatusString(status), status); + WLog_ERR(TAG, "EncryptMessage status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), + status); goto out; } if (Message.cBuffers == 2 && Buffers[0].cbBuffer < nla->ContextSizes.cbSecurityTrailer) { - /* IMPORTANT: EncryptMessage may not use all the signature space, so we need to shrink the excess between the buffers */ + /* IMPORTANT: EncryptMessage may not use all the signature space, so we need to shrink the + * excess between the buffers */ MoveMemory(((BYTE*)Buffers[0].pvBuffer) + Buffers[0].cbBuffer, Buffers[1].pvBuffer, Buffers[1].cbBuffer); nla->pubKeyAuth.cbBuffer = Buffers[0].cbBuffer + Buffers[1].cbBuffer; @@ -1278,17 +1293,17 @@ SECURITY_STATUS nla_decrypt_public_key_echo(rdpNla* nla) krb = (_tcsncmp(nla->packageName, KERBEROS_SSP_NAME, ARRAYSIZE(KERBEROS_SSP_NAME)) == 0); nego = (_tcsncmp(nla->packageName, NEGO_SSP_NAME, ARRAYSIZE(NEGO_SSP_NAME)) == 0); - ntlm = (_tcsncmp(nla->packageName, NTLM_SSP_NAME, ARRAYSIZE(NTLM_SSP_NAME)) == 0); + ntlm = (_tcsncmp(nla->packageName, NTLM_SSP_NAME, ARRAYSIZE(NTLM_SSP_NAME)) == 0); signature_length = nla->pubKeyAuth.cbBuffer - nla->PublicKey.cbBuffer; if ((signature_length < 0) || ((UINT32)signature_length > nla->ContextSizes.cbSecurityTrailer)) { - WLog_ERR(TAG, "unexpected pubKeyAuth buffer size: %"PRIu32"", nla->pubKeyAuth.cbBuffer); + WLog_ERR(TAG, "unexpected pubKeyAuth buffer size: %" PRIu32 "", nla->pubKeyAuth.cbBuffer); goto fail; } length = nla->pubKeyAuth.cbBuffer; - buffer = (BYTE*) malloc(length); + buffer = (BYTE*)malloc(length); if (!buffer) { @@ -1323,20 +1338,20 @@ SECURITY_STATUS nla_decrypt_public_key_echo(rdpNla* nla) if (status != SEC_E_OK) { - WLog_ERR(TAG, "DecryptMessage failure %s [%08"PRIX32"]", - GetSecurityStatusString(status), status); + WLog_ERR(TAG, "DecryptMessage failure %s [%08" PRIX32 "]", GetSecurityStatusString(status), + status); goto fail; } if (krb) { - public_key1 = public_key2 = (BYTE*) nla->pubKeyAuth.pvBuffer ; + public_key1 = public_key2 = (BYTE*)nla->pubKeyAuth.pvBuffer; public_key_length = length; } else if (ntlm || nego) { - public_key1 = (BYTE*) nla->PublicKey.pvBuffer; - public_key2 = (BYTE*) Buffers[1].pvBuffer; + public_key1 = (BYTE*)nla->PublicKey.pvBuffer; + public_key2 = (BYTE*)Buffers[1].pvBuffer; } if (!nla->server) @@ -1348,7 +1363,7 @@ SECURITY_STATUS nla_decrypt_public_key_echo(rdpNla* nla) if (!public_key1 || !public_key2 || memcmp(public_key1, public_key2, public_key_length) != 0) { WLog_ERR(TAG, "Could not verify server's public key echo"); -#if defined (WITH_DEBUG_NLA) +#if defined(WITH_DEBUG_NLA) WLog_ERR(TAG, "Expected (length = %d):", public_key_length); winpr_HexDump(TAG, WLOG_ERROR, public_key1, public_key_length); WLog_ERR(TAG, "Actual (length = %d):", public_key_length); @@ -1375,14 +1390,16 @@ SECURITY_STATUS nla_decrypt_public_key_hash(rdpNla* nla) WINPR_DIGEST_CTX* sha256 = NULL; BYTE serverClientHash[WINPR_SHA256_DIGEST_LENGTH]; SECURITY_STATUS status = SEC_E_INVALID_TOKEN; - const BOOL krb = (_tcsncmp(nla->packageName, KERBEROS_SSP_NAME, ARRAYSIZE(KERBEROS_SSP_NAME)) == 0); + const BOOL krb = + (_tcsncmp(nla->packageName, KERBEROS_SSP_NAME, ARRAYSIZE(KERBEROS_SSP_NAME)) == 0); const BYTE* hashMagic = nla->server ? ClientServerHashMagic : ServerClientHashMagic; - const size_t hashSize = nla->server ? sizeof(ClientServerHashMagic) : sizeof(ServerClientHashMagic); + const size_t hashSize = + nla->server ? sizeof(ClientServerHashMagic) : sizeof(ServerClientHashMagic); signature_length = nla->pubKeyAuth.cbBuffer - WINPR_SHA256_DIGEST_LENGTH; if ((signature_length < 0) || (signature_length > (int)nla->ContextSizes.cbSecurityTrailer)) { - WLog_ERR(TAG, "unexpected pubKeyAuth buffer size: %"PRIu32"", nla->pubKeyAuth.cbBuffer); + WLog_ERR(TAG, "unexpected pubKeyAuth buffer size: %" PRIu32 "", nla->pubKeyAuth.cbBuffer); goto fail; } @@ -1416,13 +1433,13 @@ SECURITY_STATUS nla_decrypt_public_key_hash(rdpNla* nla) } Message.ulVersion = SECBUFFER_VERSION; - Message.pBuffers = (PSecBuffer) &Buffers; + Message.pBuffers = (PSecBuffer)&Buffers; status = nla->table->DecryptMessage(&nla->context, &Message, nla->recvSeqNum++, &pfQOP); if (status != SEC_E_OK) { - WLog_ERR(TAG, "DecryptMessage failure %s [%08"PRIX32"]", - GetSecurityStatusString(status), status); + WLog_ERR(TAG, "DecryptMessage failure %s [%08" PRIX32 "]", GetSecurityStatusString(status), + status); goto fail; } @@ -1481,7 +1498,8 @@ static size_t nla_sizeof_ts_credentials(rdpNla* nla) size_t size = 0; size += ber_sizeof_integer(1); size += ber_sizeof_contextual_tag(ber_sizeof_integer(1)); - size += ber_sizeof_sequence_octet_string(ber_sizeof_sequence(nla_sizeof_ts_password_creds(nla))); + size += + ber_sizeof_sequence_octet_string(ber_sizeof_sequence(nla_sizeof_ts_password_creds(nla))); return size; } @@ -1498,12 +1516,12 @@ BOOL nla_read_ts_password_creds(rdpNla* nla, wStream* s) /* TSPasswordCreds (SEQUENCE) * Initialise to default values. */ nla->identity->Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE; - nla->identity->UserLength = (UINT32) 0; + nla->identity->UserLength = (UINT32)0; nla->identity->User = NULL; - nla->identity->DomainLength = (UINT32) 0; + nla->identity->DomainLength = (UINT32)0; nla->identity->Domain = NULL; nla->identity->Password = NULL; - nla->identity->PasswordLength = (UINT32) 0; + nla->identity->PasswordLength = (UINT32)0; if (!ber_read_sequence_tag(s, &length)) return FALSE; @@ -1514,17 +1532,16 @@ BOOL nla_read_ts_password_creds(rdpNla* nla, wStream* s) return TRUE; /* [0] domainName (OCTET STRING) */ - if (!ber_read_contextual_tag(s, 0, &length, TRUE) || - !ber_read_octet_string_tag(s, &length)) + if (!ber_read_contextual_tag(s, 0, &length, TRUE) || !ber_read_octet_string_tag(s, &length)) { return FALSE; } - nla->identity->DomainLength = (UINT32) length; + nla->identity->DomainLength = (UINT32)length; if (nla->identity->DomainLength > 0) { - nla->identity->Domain = (UINT16*) malloc(length); + nla->identity->Domain = (UINT16*)malloc(length); if (!nla->identity->Domain) return FALSE; @@ -1535,17 +1552,16 @@ BOOL nla_read_ts_password_creds(rdpNla* nla, wStream* s) } /* [1] userName (OCTET STRING) */ - if (!ber_read_contextual_tag(s, 1, &length, TRUE) || - !ber_read_octet_string_tag(s, &length)) + if (!ber_read_contextual_tag(s, 1, &length, TRUE) || !ber_read_octet_string_tag(s, &length)) { return FALSE; } - nla->identity->UserLength = (UINT32) length; + nla->identity->UserLength = (UINT32)length; if (nla->identity->UserLength > 0) { - nla->identity->User = (UINT16*) malloc(length); + nla->identity->User = (UINT16*)malloc(length); if (!nla->identity->User) return FALSE; @@ -1556,17 +1572,16 @@ BOOL nla_read_ts_password_creds(rdpNla* nla, wStream* s) } /* [2] password (OCTET STRING) */ - if (!ber_read_contextual_tag(s, 2, &length, TRUE) || - !ber_read_octet_string_tag(s, &length)) + if (!ber_read_contextual_tag(s, 2, &length, TRUE) || !ber_read_octet_string_tag(s, &length)) { return FALSE; } - nla->identity->PasswordLength = (UINT32) length; + nla->identity->PasswordLength = (UINT32)length; if (nla->identity->PasswordLength > 0) { - nla->identity->Password = (UINT16*) malloc(length); + nla->identity->Password = (UINT16*)malloc(length); if (!nla->identity->Password) return FALSE; @@ -1589,17 +1604,14 @@ static size_t nla_write_ts_password_creds(rdpNla* nla, wStream* s) if (nla->identity) { /* [0] domainName (OCTET STRING) */ - size += ber_write_sequence_octet_string( - s, 0, (BYTE*) nla->identity->Domain, - nla->identity->DomainLength * 2); + size += ber_write_sequence_octet_string(s, 0, (BYTE*)nla->identity->Domain, + nla->identity->DomainLength * 2); /* [1] userName (OCTET STRING) */ - size += ber_write_sequence_octet_string( - s, 1, (BYTE*) nla->identity->User, - nla->identity->UserLength * 2); + size += ber_write_sequence_octet_string(s, 1, (BYTE*)nla->identity->User, + nla->identity->UserLength * 2); /* [2] password (OCTET STRING) */ - size += ber_write_sequence_octet_string( - s, 2, (BYTE*) nla->identity->Password, - nla->identity->PasswordLength * 2); + size += ber_write_sequence_octet_string(s, 2, (BYTE*)nla->identity->Password, + nla->identity->PasswordLength * 2); } return size; @@ -1626,8 +1638,7 @@ static BOOL nla_read_ts_credentials(rdpNla* nla, PSecBuffer ts_credentials) /* TSCredentials (SEQUENCE) */ ret = ber_read_sequence_tag(s, &length) && /* [0] credType (INTEGER) */ - ber_read_contextual_tag(s, 0, &length, TRUE) && - ber_read_integer(s, NULL) && + ber_read_contextual_tag(s, 0, &length, TRUE) && ber_read_integer(s, NULL) && /* [1] credentials (OCTET STRING) */ ber_read_contextual_tag(s, 1, &length, TRUE) && ber_read_octet_string_tag(s, &ts_password_creds_length) && @@ -1691,7 +1702,7 @@ static BOOL nla_encode_ts_credentials(rdpNla* nla) return FALSE; } - s = Stream_New((BYTE*) nla->tsCredentials.pvBuffer, length); + s = Stream_New((BYTE*)nla->tsCredentials.pvBuffer, length); if (!s) { @@ -1719,9 +1730,10 @@ static SECURITY_STATUS nla_encrypt_ts_credentials(rdpNla* nla) SecBuffer Buffers[2] = { { 0 } }; SecBufferDesc Message; SECURITY_STATUS status; - const BOOL krb = (_tcsncmp(nla->packageName, KERBEROS_SSP_NAME, ARRAYSIZE(KERBEROS_SSP_NAME)) == 0); + const BOOL krb = + (_tcsncmp(nla->packageName, KERBEROS_SSP_NAME, ARRAYSIZE(KERBEROS_SSP_NAME)) == 0); const BOOL nego = (_tcsncmp(nla->packageName, NEGO_SSP_NAME, ARRAYSIZE(NEGO_SSP_NAME)) == 0); - const BOOL ntlm = (_tcsncmp(nla->packageName, NTLM_SSP_NAME, ARRAYSIZE(NTLM_SSP_NAME)) == 0); + const BOOL ntlm = (_tcsncmp(nla->packageName, NTLM_SSP_NAME, ARRAYSIZE(NTLM_SSP_NAME)) == 0); if (!nla_encode_ts_credentials(nla)) return SEC_E_INSUFFICIENT_MEMORY; @@ -1746,25 +1758,26 @@ static SECURITY_STATUS nla_encrypt_ts_credentials(rdpNla* nla) MoveMemory(Buffers[0].pvBuffer, nla->authInfo.pvBuffer, Buffers[0].cbBuffer); Buffers[1].BufferType = SECBUFFER_DATA; /* TSCredentials */ Buffers[1].cbBuffer = nla->tsCredentials.cbBuffer; - Buffers[1].pvBuffer = &((BYTE*) nla->authInfo.pvBuffer)[Buffers[0].cbBuffer]; + Buffers[1].pvBuffer = &((BYTE*)nla->authInfo.pvBuffer)[Buffers[0].cbBuffer]; CopyMemory(Buffers[1].pvBuffer, nla->tsCredentials.pvBuffer, Buffers[1].cbBuffer); Message.cBuffers = 2; } Message.ulVersion = SECBUFFER_VERSION; - Message.pBuffers = (PSecBuffer) &Buffers; + Message.pBuffers = (PSecBuffer)&Buffers; status = nla->table->EncryptMessage(&nla->context, 0, &Message, nla->sendSeqNum++); if (status != SEC_E_OK) { - WLog_ERR(TAG, "EncryptMessage failure %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "EncryptMessage failure %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); return status; } if (Message.cBuffers == 2 && Buffers[0].cbBuffer < nla->ContextSizes.cbSecurityTrailer) { - /* IMPORTANT: EncryptMessage may not use all the signature space, so we need to shrink the excess between the buffers */ + /* IMPORTANT: EncryptMessage may not use all the signature space, so we need to shrink the + * excess between the buffers */ MoveMemory(((BYTE*)Buffers[0].pvBuffer) + Buffers[0].cbBuffer, Buffers[1].pvBuffer, Buffers[1].cbBuffer); nla->authInfo.cbBuffer = Buffers[0].cbBuffer + Buffers[1].cbBuffer; @@ -1781,9 +1794,10 @@ static SECURITY_STATUS nla_decrypt_ts_credentials(rdpNla* nla) SecBuffer Buffers[2] = { { 0 } }; SecBufferDesc Message; SECURITY_STATUS status; - const BOOL krb = (_tcsncmp(nla->packageName, KERBEROS_SSP_NAME, ARRAYSIZE(KERBEROS_SSP_NAME)) == 0); + const BOOL krb = + (_tcsncmp(nla->packageName, KERBEROS_SSP_NAME, ARRAYSIZE(KERBEROS_SSP_NAME)) == 0); const BOOL nego = (_tcsncmp(nla->packageName, NEGO_SSP_NAME, ARRAYSIZE(NEGO_SSP_NAME)) == 0); - const BOOL ntlm = (_tcsncmp(nla->packageName, NTLM_SSP_NAME, ARRAYSIZE(NTLM_SSP_NAME)) == 0); + const BOOL ntlm = (_tcsncmp(nla->packageName, NTLM_SSP_NAME, ARRAYSIZE(NTLM_SSP_NAME)) == 0); if (nla->authInfo.cbBuffer < 1) { @@ -1792,7 +1806,7 @@ static SECURITY_STATUS nla_decrypt_ts_credentials(rdpNla* nla) } length = nla->authInfo.cbBuffer; - buffer = (BYTE*) malloc(length); + buffer = (BYTE*)malloc(length); if (!buffer) return SEC_E_INSUFFICIENT_MEMORY; @@ -1813,17 +1827,17 @@ static SECURITY_STATUS nla_decrypt_ts_credentials(rdpNla* nla) Buffers[0].pvBuffer = buffer; Buffers[1].BufferType = SECBUFFER_DATA; /* TSCredentials */ Buffers[1].cbBuffer = length - nla->ContextSizes.cbSecurityTrailer; - Buffers[1].pvBuffer = &buffer[ Buffers[0].cbBuffer ]; + Buffers[1].pvBuffer = &buffer[Buffers[0].cbBuffer]; Message.cBuffers = 2; } Message.ulVersion = SECBUFFER_VERSION; - Message.pBuffers = (PSecBuffer) &Buffers; + Message.pBuffers = (PSecBuffer)&Buffers; status = nla->table->DecryptMessage(&nla->context, &Message, nla->recvSeqNum++, &pfQOP); if (status != SEC_E_OK) { - WLog_ERR(TAG, "DecryptMessage failure %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "DecryptMessage failure %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); free(buffer); return status; @@ -1900,13 +1914,14 @@ BOOL nla_send(rdpNla* nla) size_t error_code_context_length = 0; size_t error_code_length = 0; size_t client_nonce_length = 0; - nego_tokens_length = (nla->negoToken.cbBuffer > 0) ? nla_sizeof_nego_tokens( - nla->negoToken.cbBuffer) : 0; - pub_key_auth_length = (nla->pubKeyAuth.cbBuffer > 0) ? nla_sizeof_pub_key_auth( - nla->pubKeyAuth.cbBuffer) : 0; - auth_info_length = (nla->authInfo.cbBuffer > 0) ? nla_sizeof_auth_info(nla->authInfo.cbBuffer) : 0; - client_nonce_length = (nla->ClientNonce.cbBuffer > 0) ? nla_sizeof_client_nonce( - nla->ClientNonce.cbBuffer) : 0; + nego_tokens_length = + (nla->negoToken.cbBuffer > 0) ? nla_sizeof_nego_tokens(nla->negoToken.cbBuffer) : 0; + pub_key_auth_length = + (nla->pubKeyAuth.cbBuffer > 0) ? nla_sizeof_pub_key_auth(nla->pubKeyAuth.cbBuffer) : 0; + auth_info_length = + (nla->authInfo.cbBuffer > 0) ? nla_sizeof_auth_info(nla->authInfo.cbBuffer) : 0; + client_nonce_length = + (nla->ClientNonce.cbBuffer > 0) ? nla_sizeof_client_nonce(nla->ClientNonce.cbBuffer) : 0; if (nla->peerVersion >= 3 && nla->peerVersion != 5 && nla->errorCode != 0) { @@ -1914,8 +1929,8 @@ BOOL nla_send(rdpNla* nla) error_code_context_length = ber_sizeof_contextual_tag(error_code_length); } - length = nego_tokens_length + pub_key_auth_length + auth_info_length + error_code_context_length + - error_code_length + client_nonce_length; + length = nego_tokens_length + pub_key_auth_length + auth_info_length + + error_code_context_length + error_code_length + client_nonce_length; ts_request_length = nla_sizeof_ts_request(length); s = Stream_New(NULL, ber_sizeof_sequence(ts_request_length)); @@ -1934,16 +1949,18 @@ BOOL nla_send(rdpNla* nla) /* [1] negoTokens (NegoData) */ if (nego_tokens_length > 0) { - length = ber_write_contextual_tag(s, 1, - ber_sizeof_sequence(ber_sizeof_sequence(ber_sizeof_sequence_octet_string(nla->negoToken.cbBuffer))), - TRUE); /* NegoData */ - length += ber_write_sequence_tag(s, - ber_sizeof_sequence(ber_sizeof_sequence_octet_string( - nla->negoToken.cbBuffer))); /* SEQUENCE OF NegoDataItem */ - length += ber_write_sequence_tag(s, - ber_sizeof_sequence_octet_string(nla->negoToken.cbBuffer)); /* NegoDataItem */ - length += ber_write_sequence_octet_string(s, 0, (BYTE*) nla->negoToken.pvBuffer, - nla->negoToken.cbBuffer); /* OCTET STRING */ + length = ber_write_contextual_tag( + s, 1, + ber_sizeof_sequence( + ber_sizeof_sequence(ber_sizeof_sequence_octet_string(nla->negoToken.cbBuffer))), + TRUE); /* NegoData */ + length += + ber_write_sequence_tag(s, ber_sizeof_sequence(ber_sizeof_sequence_octet_string( + nla->negoToken.cbBuffer))); /* SEQUENCE OF NegoDataItem */ + length += ber_write_sequence_tag( + s, ber_sizeof_sequence_octet_string(nla->negoToken.cbBuffer)); /* NegoDataItem */ + length += ber_write_sequence_octet_string(s, 0, (BYTE*)nla->negoToken.pvBuffer, + nla->negoToken.cbBuffer); /* OCTET STRING */ if (length != nego_tokens_length) { @@ -1955,8 +1972,8 @@ BOOL nla_send(rdpNla* nla) /* [2] authInfo (OCTET STRING) */ if (auth_info_length > 0) { - if (ber_write_sequence_octet_string(s, 2, nla->authInfo.pvBuffer, - nla->authInfo.cbBuffer) != auth_info_length) + if (ber_write_sequence_octet_string(s, 2, nla->authInfo.pvBuffer, nla->authInfo.cbBuffer) != + auth_info_length) { Stream_Free(s, TRUE); return FALSE; @@ -2007,8 +2024,7 @@ static int nla_decode_ts_request(rdpNla* nla, wStream* s) UINT32 version = 0; /* TSRequest */ - if (!ber_read_sequence_tag(s, &length) || - !ber_read_contextual_tag(s, 0, &length, TRUE) || + if (!ber_read_sequence_tag(s, &length) || !ber_read_contextual_tag(s, 0, &length, TRUE) || !ber_read_integer(s, &version)) { return -1; @@ -2016,15 +2032,15 @@ static int nla_decode_ts_request(rdpNla* nla, wStream* s) if (nla->peerVersion == 0) { - WLog_DBG(TAG, "CredSSP protocol support %"PRIu32", peer supports %"PRIu32, - nla->version, version); + WLog_DBG(TAG, "CredSSP protocol support %" PRIu32 ", peer supports %" PRIu32, nla->version, + version); nla->peerVersion = version; } /* if the peer suddenly changed its version - kick it */ if (nla->peerVersion != version) { - WLog_ERR(TAG, "CredSSP peer changed protocol version from %"PRIu32" to %"PRIu32, + WLog_ERR(TAG, "CredSSP peer changed protocol version from %" PRIu32 " to %" PRIu32, nla->peerVersion, version); return -1; } @@ -2032,10 +2048,10 @@ static int nla_decode_ts_request(rdpNla* nla, wStream* s) /* [1] negoTokens (NegoData) */ if (ber_read_contextual_tag(s, 1, &length, TRUE) != FALSE) { - if (!ber_read_sequence_tag(s, &length) || /* SEQUENCE OF NegoDataItem */ - !ber_read_sequence_tag(s, &length) || /* NegoDataItem */ + if (!ber_read_sequence_tag(s, &length) || /* SEQUENCE OF NegoDataItem */ + !ber_read_sequence_tag(s, &length) || /* NegoDataItem */ !ber_read_contextual_tag(s, 0, &length, TRUE) || /* [0] negoToken */ - !ber_read_octet_string_tag(s, &length) || /* OCTET STRING */ + !ber_read_octet_string_tag(s, &length) || /* OCTET STRING */ Stream_GetRemainingLength(s) < length) { return -1; @@ -2157,7 +2173,7 @@ int nla_recv_pdu(rdpNla* nla, wStream* s) break; default: - WLog_ERR(TAG, "SPNEGO failed with NTSTATUS: 0x%08"PRIX32"", nla->errorCode); + WLog_ERR(TAG, "SPNEGO failed with NTSTATUS: 0x%08" PRIX32 "", nla->errorCode); code = FREERDP_ERROR_AUTHENTICATION_FAILED; break; } @@ -2207,24 +2223,24 @@ void nla_buffer_print(rdpNla* nla) { if (nla->negoToken.cbBuffer > 0) { - WLog_DBG(TAG, "NLA.negoToken (length = %"PRIu32"):", nla->negoToken.cbBuffer); -#if defined (WITH_DEBUG_NLA) + WLog_DBG(TAG, "NLA.negoToken (length = %" PRIu32 "):", nla->negoToken.cbBuffer); +#if defined(WITH_DEBUG_NLA) winpr_HexDump(TAG, WLOG_DEBUG, nla->negoToken.pvBuffer, nla->negoToken.cbBuffer); #endif } if (nla->pubKeyAuth.cbBuffer > 0) { - WLog_DBG(TAG, "NLA.pubKeyAuth (length = %"PRIu32"):", nla->pubKeyAuth.cbBuffer); -#if defined (WITH_DEBUG_NLA) + WLog_DBG(TAG, "NLA.pubKeyAuth (length = %" PRIu32 "):", nla->pubKeyAuth.cbBuffer); +#if defined(WITH_DEBUG_NLA) winpr_HexDump(TAG, WLOG_DEBUG, nla->pubKeyAuth.pvBuffer, nla->pubKeyAuth.cbBuffer); #endif } if (nla->authInfo.cbBuffer > 0) { - WLog_DBG(TAG, "NLA.authInfo (length = %"PRIu32"):", nla->authInfo.cbBuffer); -#if defined (WITH_DEBUG_NLA) + WLog_DBG(TAG, "NLA.authInfo (length = %" PRIu32 "):", nla->authInfo.cbBuffer); +#if defined(WITH_DEBUG_NLA) winpr_HexDump(TAG, WLOG_DEBUG, nla->authInfo.pvBuffer, nla->authInfo.cbBuffer); #endif } @@ -2261,7 +2277,7 @@ LPTSTR nla_make_spn(const char* ServiceClass, const char* hostname) if (!ServiceClass) { - ServicePrincipalName = (LPTSTR) _tcsdup(hostnameX); + ServicePrincipalName = (LPTSTR)_tcsdup(hostnameX); free(ServiceClassX); free(hostnameX); return ServicePrincipalName; @@ -2277,7 +2293,7 @@ LPTSTR nla_make_spn(const char* ServiceClass, const char* hostname) return NULL; } - ServicePrincipalName = (LPTSTR) calloc(SpnLength, sizeof(TCHAR)); + ServicePrincipalName = (LPTSTR)calloc(SpnLength, sizeof(TCHAR)); if (!ServicePrincipalName) { @@ -2309,7 +2325,7 @@ LPTSTR nla_make_spn(const char* ServiceClass, const char* hostname) rdpNla* nla_new(freerdp* instance, rdpTransport* transport, rdpSettings* settings) { - rdpNla* nla = (rdpNla*) calloc(1, sizeof(rdpNla)); + rdpNla* nla = (rdpNla*)calloc(1, sizeof(rdpNla)); if (!nla) return NULL; @@ -2357,8 +2373,8 @@ rdpNla* nla_new(freerdp* instance, rdpTransport* transport, rdpSettings* setting HKEY hKey; DWORD dwType; DWORD dwSize; - status = RegOpenKeyExA(HKEY_LOCAL_MACHINE, SERVER_KEY, - 0, KEY_READ | KEY_WOW64_64KEY, &hKey); + status = + RegOpenKeyExA(HKEY_LOCAL_MACHINE, SERVER_KEY, 0, KEY_READ | KEY_WOW64_64KEY, &hKey); if (status != ERROR_SUCCESS) return nla; @@ -2371,7 +2387,7 @@ rdpNla* nla_new(freerdp* instance, rdpTransport* transport, rdpSettings* setting return nla; } - nla->SspiModule = (LPTSTR) malloc(dwSize + sizeof(TCHAR)); + nla->SspiModule = (LPTSTR)malloc(dwSize + sizeof(TCHAR)); if (!nla->SspiModule) { @@ -2379,8 +2395,8 @@ rdpNla* nla_new(freerdp* instance, rdpTransport* transport, rdpSettings* setting goto cleanup; } - status = RegQueryValueEx(hKey, _T("SspiModule"), NULL, &dwType, - (BYTE*) nla->SspiModule, &dwSize); + status = + RegQueryValueEx(hKey, _T("SspiModule"), NULL, &dwType, (BYTE*)nla->SspiModule, &dwSize); if (status == ERROR_SUCCESS) WLog_INFO(TAG, "Using SSPI Module: %s", nla->SspiModule); @@ -2414,7 +2430,7 @@ void nla_free(rdpNla* nla) if (status != SEC_E_OK) { - WLog_WARN(TAG, "FreeCredentialsHandle status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "FreeCredentialsHandle status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -2425,7 +2441,7 @@ void nla_free(rdpNla* nla) if (status != SEC_E_OK) { - WLog_WARN(TAG, "DeleteSecurityContext status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "DeleteSecurityContext status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } } diff --git a/libfreerdp/core/nla.h b/libfreerdp/core/nla.h index 9f6d44051..3980ef181 100644 --- a/libfreerdp/core/nla.h +++ b/libfreerdp/core/nla.h @@ -48,8 +48,7 @@ enum _NLA_STATE typedef enum _NLA_STATE NLA_STATE; FREERDP_LOCAL int nla_authenticate(rdpNla* nla); -FREERDP_LOCAL LPTSTR nla_make_spn(const char* ServiceClass, - const char* hostname); +FREERDP_LOCAL LPTSTR nla_make_spn(const char* ServiceClass, const char* hostname); FREERDP_LOCAL int nla_client_begin(rdpNla* nla); FREERDP_LOCAL int nla_recv_pdu(rdpNla* nla, wStream* s); @@ -64,8 +63,7 @@ FREERDP_LOCAL BOOL nla_set_service_principal(rdpNla* nla, LPSTR principal); FREERDP_LOCAL BOOL nla_impersonate(rdpNla* nla); FREERDP_LOCAL BOOL nla_revert_to_self(rdpNla* nla); -FREERDP_LOCAL rdpNla* nla_new(freerdp* instance, rdpTransport* transport, - rdpSettings* settings); +FREERDP_LOCAL rdpNla* nla_new(freerdp* instance, rdpTransport* transport, rdpSettings* settings); FREERDP_LOCAL void nla_free(rdpNla* nla); #endif /* FREERDP_LIB_CORE_NLA_H */ diff --git a/libfreerdp/core/orders.c b/libfreerdp/core/orders.c index e1bcd1e3e..3d338eb29 100644 --- a/libfreerdp/core/orders.c +++ b/libfreerdp/core/orders.c @@ -43,78 +43,51 @@ #define TAG FREERDP_TAG("core.orders") -const BYTE PRIMARY_DRAWING_ORDER_FIELD_BYTES[] = -{ - DSTBLT_ORDER_FIELD_BYTES, - PATBLT_ORDER_FIELD_BYTES, - SCRBLT_ORDER_FIELD_BYTES, - 0, 0, 0, 0, - DRAW_NINE_GRID_ORDER_FIELD_BYTES, - MULTI_DRAW_NINE_GRID_ORDER_FIELD_BYTES, - LINE_TO_ORDER_FIELD_BYTES, - OPAQUE_RECT_ORDER_FIELD_BYTES, - SAVE_BITMAP_ORDER_FIELD_BYTES, - 0, - MEMBLT_ORDER_FIELD_BYTES, - MEM3BLT_ORDER_FIELD_BYTES, - MULTI_DSTBLT_ORDER_FIELD_BYTES, - MULTI_PATBLT_ORDER_FIELD_BYTES, - MULTI_SCRBLT_ORDER_FIELD_BYTES, - MULTI_OPAQUE_RECT_ORDER_FIELD_BYTES, - FAST_INDEX_ORDER_FIELD_BYTES, - POLYGON_SC_ORDER_FIELD_BYTES, - POLYGON_CB_ORDER_FIELD_BYTES, - POLYLINE_ORDER_FIELD_BYTES, - 0, - FAST_GLYPH_ORDER_FIELD_BYTES, - ELLIPSE_SC_ORDER_FIELD_BYTES, - ELLIPSE_CB_ORDER_FIELD_BYTES, - GLYPH_INDEX_ORDER_FIELD_BYTES -}; +const BYTE PRIMARY_DRAWING_ORDER_FIELD_BYTES[] = { DSTBLT_ORDER_FIELD_BYTES, + PATBLT_ORDER_FIELD_BYTES, + SCRBLT_ORDER_FIELD_BYTES, + 0, + 0, + 0, + 0, + DRAW_NINE_GRID_ORDER_FIELD_BYTES, + MULTI_DRAW_NINE_GRID_ORDER_FIELD_BYTES, + LINE_TO_ORDER_FIELD_BYTES, + OPAQUE_RECT_ORDER_FIELD_BYTES, + SAVE_BITMAP_ORDER_FIELD_BYTES, + 0, + MEMBLT_ORDER_FIELD_BYTES, + MEM3BLT_ORDER_FIELD_BYTES, + MULTI_DSTBLT_ORDER_FIELD_BYTES, + MULTI_PATBLT_ORDER_FIELD_BYTES, + MULTI_SCRBLT_ORDER_FIELD_BYTES, + MULTI_OPAQUE_RECT_ORDER_FIELD_BYTES, + FAST_INDEX_ORDER_FIELD_BYTES, + POLYGON_SC_ORDER_FIELD_BYTES, + POLYGON_CB_ORDER_FIELD_BYTES, + POLYLINE_ORDER_FIELD_BYTES, + 0, + FAST_GLYPH_ORDER_FIELD_BYTES, + ELLIPSE_SC_ORDER_FIELD_BYTES, + ELLIPSE_CB_ORDER_FIELD_BYTES, + GLYPH_INDEX_ORDER_FIELD_BYTES }; -#define PRIMARY_DRAWING_ORDER_COUNT (ARRAYSIZE(PRIMARY_DRAWING_ORDER_FIELD_BYTES)) +#define PRIMARY_DRAWING_ORDER_COUNT (ARRAYSIZE(PRIMARY_DRAWING_ORDER_FIELD_BYTES)) -static const BYTE CBR2_BPP[] = -{ - 0, 0, 0, 8, 16, 24, 32 -}; +static const BYTE CBR2_BPP[] = { 0, 0, 0, 8, 16, 24, 32 }; -static const BYTE BPP_CBR2[] = -{ - 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 4, 0, 0, 0, 0, 0, 0, 0, - 5, 0, 0, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 0, 0 -}; +static const BYTE BPP_CBR2[] = { 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0 }; -static const BYTE CBR23_BPP[] = -{ - 0, 0, 0, 8, 16, 24, 32 -}; +static const BYTE CBR23_BPP[] = { 0, 0, 0, 8, 16, 24, 32 }; -static const BYTE BPP_CBR23[] = -{ - 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 4, 0, 0, 0, 0, 0, 0, 0, - 5, 0, 0, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 0, 0 -}; +static const BYTE BPP_CBR23[] = { 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0 }; -static const BYTE BMF_BPP[] = -{ - 0, 1, 0, 8, 16, 24, 32, 0 -}; +static const BYTE BMF_BPP[] = { 0, 1, 0, 8, 16, 24, 32, 0 }; -static const BYTE BPP_BMF[] = -{ - 0, 1, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 4, 0, 0, 0, 0, 0, 0, 0, - 5, 0, 0, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 0, 0 -}; +static const BYTE BPP_BMF[] = { 0, 1, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0 }; static BOOL check_order_activated(wLog* log, rdpSettings* settings, const char* orderName, BOOL condition) @@ -124,13 +97,15 @@ static BOOL check_order_activated(wLog* log, rdpSettings* settings, const char* if (settings->AllowUnanouncedOrdersFromServer) { WLog_Print(log, WLOG_WARN, - "%s - SERVER BUG: The support for this feature was not announced!", orderName); + "%s - SERVER BUG: The support for this feature was not announced!", + orderName); return TRUE; } else { WLog_Print(log, WLOG_ERROR, - "%s - SERVER BUG: The support for this feature was not announced! Use /relax-order-checks to ignore", + "%s - SERVER BUG: The support for this feature was not announced! Use " + "/relax-order-checks to ignore", orderName); return FALSE; } @@ -156,7 +131,7 @@ static BOOL check_alt_order_supported(wLog* log, rdpSettings* settings, BYTE ord break; case ORDER_TYPE_FRAME_MARKER: - condition = settings->FrameMarkerCommandEnabled; + condition = settings->FrameMarkerCommandEnabled; break; case ORDER_TYPE_GDIPLUS_FIRST: @@ -165,7 +140,7 @@ static BOOL check_alt_order_supported(wLog* log, rdpSettings* settings, BYTE ord case ORDER_TYPE_GDIPLUS_CACHE_FIRST: case ORDER_TYPE_GDIPLUS_CACHE_NEXT: case ORDER_TYPE_GDIPLUS_CACHE_END: - condition = settings->DrawGdiPlusCacheEnabled; + condition = settings->DrawGdiPlusCacheEnabled; break; case ORDER_TYPE_WINDOW: @@ -179,8 +154,7 @@ static BOOL check_alt_order_supported(wLog* log, rdpSettings* settings, BYTE ord break; default: - WLog_Print(log, WLOG_WARN, - "%s - Alternate Secondary Drawing Order UNKNOWN", orderName); + WLog_Print(log, WLOG_WARN, "%s - Alternate Secondary Drawing Order UNKNOWN", orderName); condition = FALSE; break; } @@ -189,7 +163,7 @@ static BOOL check_alt_order_supported(wLog* log, rdpSettings* settings, BYTE ord } static BOOL check_secondary_order_supported(wLog* log, rdpSettings* settings, BYTE orderType, - const char* orderName) + const char* orderName) { BOOL condition = FALSE; @@ -210,26 +184,27 @@ static BOOL check_secondary_order_supported(wLog* log, rdpSettings* settings, BY break; case ORDER_TYPE_CACHE_COLOR_TABLE: - condition = (settings->OrderSupport[NEG_MEMBLT_INDEX] || settings->OrderSupport[NEG_MEM3BLT_INDEX]); + condition = (settings->OrderSupport[NEG_MEMBLT_INDEX] || + settings->OrderSupport[NEG_MEM3BLT_INDEX]); break; case ORDER_TYPE_CACHE_GLYPH: + { + switch (settings->GlyphSupportLevel) { - switch (settings->GlyphSupportLevel) - { - case GLYPH_SUPPORT_PARTIAL: - case GLYPH_SUPPORT_FULL: - case GLYPH_SUPPORT_ENCODE: - condition = TRUE; - break; + case GLYPH_SUPPORT_PARTIAL: + case GLYPH_SUPPORT_FULL: + case GLYPH_SUPPORT_ENCODE: + condition = TRUE; + break; - case GLYPH_SUPPORT_NONE: - default: - condition = FALSE; - break; - } + case GLYPH_SUPPORT_NONE: + default: + condition = FALSE; + break; } - break; + } + break; case ORDER_TYPE_CACHE_BRUSH: condition = TRUE; @@ -244,7 +219,7 @@ static BOOL check_secondary_order_supported(wLog* log, rdpSettings* settings, BY } static BOOL check_primary_order_supported(wLog* log, rdpSettings* settings, UINT32 orderType, - const char* orderName) + const char* orderName) { BOOL condition = FALSE; @@ -339,7 +314,7 @@ static BOOL check_primary_order_supported(wLog* log, rdpSettings* settings, UINT break; default: - WLog_Print(log, WLOG_WARN, "%s Primary Drawing Order not supported", orderName); + WLog_Print(log, WLOG_WARN, "%s Primary Drawing Order not supported", orderName); break; } @@ -348,39 +323,36 @@ static BOOL check_primary_order_supported(wLog* log, rdpSettings* settings, UINT static const char* primary_order_string(UINT32 orderType) { - const char* orders[] = - { - "[0x%02"PRIx8"] DstBlt", - "[0x%02"PRIx8"] PatBlt", - "[0x%02"PRIx8"] ScrBlt", - "[0x%02"PRIx8"] UNUSED", - "[0x%02"PRIx8"] UNUSED", - "[0x%02"PRIx8"] UNUSED", - "[0x%02"PRIx8"] UNUSED", - "[0x%02"PRIx8"] DrawNineGrid", - "[0x%02"PRIx8"] MultiDrawNineGrid", - "[0x%02"PRIx8"] LineTo", - "[0x%02"PRIx8"] OpaqueRect", - "[0x%02"PRIx8"] SaveBitmap", - "[0x%02"PRIx8"] UNUSED", - "[0x%02"PRIx8"] MemBlt", - "[0x%02"PRIx8"] Mem3Blt", - "[0x%02"PRIx8"] MultiDstBlt", - "[0x%02"PRIx8"] MultiPatBlt", - "[0x%02"PRIx8"] MultiScrBlt", - "[0x%02"PRIx8"] MultiOpaqueRect", - "[0x%02"PRIx8"] FastIndex", - "[0x%02"PRIx8"] PolygonSC", - "[0x%02"PRIx8"] PolygonCB", - "[0x%02"PRIx8"] Polyline", - "[0x%02"PRIx8"] UNUSED", - "[0x%02"PRIx8"] FastGlyph", - "[0x%02"PRIx8"] EllipseSC", - "[0x%02"PRIx8"] EllipseCB", - "[0x%02"PRIx8"] GlyphIndex" - }; - const char* fmt = "[0x%02"PRIx8"] UNKNOWN"; - static char buffer[64] = {0}; + const char* orders[] = { "[0x%02" PRIx8 "] DstBlt", + "[0x%02" PRIx8 "] PatBlt", + "[0x%02" PRIx8 "] ScrBlt", + "[0x%02" PRIx8 "] UNUSED", + "[0x%02" PRIx8 "] UNUSED", + "[0x%02" PRIx8 "] UNUSED", + "[0x%02" PRIx8 "] UNUSED", + "[0x%02" PRIx8 "] DrawNineGrid", + "[0x%02" PRIx8 "] MultiDrawNineGrid", + "[0x%02" PRIx8 "] LineTo", + "[0x%02" PRIx8 "] OpaqueRect", + "[0x%02" PRIx8 "] SaveBitmap", + "[0x%02" PRIx8 "] UNUSED", + "[0x%02" PRIx8 "] MemBlt", + "[0x%02" PRIx8 "] Mem3Blt", + "[0x%02" PRIx8 "] MultiDstBlt", + "[0x%02" PRIx8 "] MultiPatBlt", + "[0x%02" PRIx8 "] MultiScrBlt", + "[0x%02" PRIx8 "] MultiOpaqueRect", + "[0x%02" PRIx8 "] FastIndex", + "[0x%02" PRIx8 "] PolygonSC", + "[0x%02" PRIx8 "] PolygonCB", + "[0x%02" PRIx8 "] Polyline", + "[0x%02" PRIx8 "] UNUSED", + "[0x%02" PRIx8 "] FastGlyph", + "[0x%02" PRIx8 "] EllipseSC", + "[0x%02" PRIx8 "] EllipseCB", + "[0x%02" PRIx8 "] GlyphIndex" }; + const char* fmt = "[0x%02" PRIx8 "] UNKNOWN"; + static char buffer[64] = { 0 }; if (orderType < ARRAYSIZE(orders)) fmt = orders[orderType]; @@ -390,20 +362,17 @@ static const char* primary_order_string(UINT32 orderType) } static const char* secondary_order_string(UINT32 orderType) { - const char* orders[] = - { - "[0x%02"PRIx8"] Cache Bitmap", - "[0x%02"PRIx8"] Cache Color Table", - "[0x%02"PRIx8"] Cache Bitmap (Compressed)", - "[0x%02"PRIx8"] Cache Glyph", - "[0x%02"PRIx8"] Cache Bitmap V2", - "[0x%02"PRIx8"] Cache Bitmap V2 (Compressed)", - "[0x%02"PRIx8"] UNUSED", - "[0x%02"PRIx8"] Cache Brush", - "[0x%02"PRIx8"] Cache Bitmap V3" - }; - const char* fmt = "[0x%02"PRIx8"] UNKNOWN"; - static char buffer[64] = {0}; + const char* orders[] = { "[0x%02" PRIx8 "] Cache Bitmap", + "[0x%02" PRIx8 "] Cache Color Table", + "[0x%02" PRIx8 "] Cache Bitmap (Compressed)", + "[0x%02" PRIx8 "] Cache Glyph", + "[0x%02" PRIx8 "] Cache Bitmap V2", + "[0x%02" PRIx8 "] Cache Bitmap V2 (Compressed)", + "[0x%02" PRIx8 "] UNUSED", + "[0x%02" PRIx8 "] Cache Brush", + "[0x%02" PRIx8 "] Cache Bitmap V3" }; + const char* fmt = "[0x%02" PRIx8 "] UNKNOWN"; + static char buffer[64] = { 0 }; if (orderType < ARRAYSIZE(orders)) fmt = orders[orderType]; @@ -413,25 +382,17 @@ static const char* secondary_order_string(UINT32 orderType) } static const char* altsec_order_string(BYTE orderType) { - const char* orders[] = - { - "[0x%02"PRIx8"] Switch Surface", - "[0x%02"PRIx8"] Create Offscreen Bitmap", - "[0x%02"PRIx8"] Stream Bitmap First", - "[0x%02"PRIx8"] Stream Bitmap Next", - "[0x%02"PRIx8"] Create NineGrid Bitmap", - "[0x%02"PRIx8"] Draw GDI+ First", - "[0x%02"PRIx8"] Draw GDI+ Next", - "[0x%02"PRIx8"] Draw GDI+ End", - "[0x%02"PRIx8"] Draw GDI+ Cache First", - "[0x%02"PRIx8"] Draw GDI+ Cache Next", - "[0x%02"PRIx8"] Draw GDI+ Cache End", - "[0x%02"PRIx8"] Windowing", - "[0x%02"PRIx8"] Desktop Composition", - "[0x%02"PRIx8"] Frame Marker" + const char* orders[] = { + "[0x%02" PRIx8 "] Switch Surface", "[0x%02" PRIx8 "] Create Offscreen Bitmap", + "[0x%02" PRIx8 "] Stream Bitmap First", "[0x%02" PRIx8 "] Stream Bitmap Next", + "[0x%02" PRIx8 "] Create NineGrid Bitmap", "[0x%02" PRIx8 "] Draw GDI+ First", + "[0x%02" PRIx8 "] Draw GDI+ Next", "[0x%02" PRIx8 "] Draw GDI+ End", + "[0x%02" PRIx8 "] Draw GDI+ Cache First", "[0x%02" PRIx8 "] Draw GDI+ Cache Next", + "[0x%02" PRIx8 "] Draw GDI+ Cache End", "[0x%02" PRIx8 "] Windowing", + "[0x%02" PRIx8 "] Desktop Composition", "[0x%02" PRIx8 "] Frame Marker" }; - const char* fmt = "[0x%02"PRIx8"] UNKNOWN"; - static char buffer[64] = {0}; + const char* fmt = "[0x%02" PRIx8 "] UNKNOWN"; + static char buffer[64] = { 0 }; if (orderType < ARRAYSIZE(orders)) fmt = orders[orderType]; @@ -478,11 +439,11 @@ static INLINE BOOL update_read_color(wStream* s, UINT32* color) *color = 0; Stream_Read_UINT8(s, byte); - *color = (UINT32) byte; + *color = (UINT32)byte; Stream_Read_UINT8(s, byte); - *color |= ((UINT32) byte << 8) & 0xFF00; + *color |= ((UINT32)byte << 8) & 0xFF00; Stream_Read_UINT8(s, byte); - *color |= ((UINT32) byte << 16) & 0xFF0000; + *color |= ((UINT32)byte << 16) & 0xFF0000; return TRUE; } static INLINE BOOL update_write_color(wStream* s, UINT32 color) @@ -778,8 +739,7 @@ static INLINE void update_seek_glyph_delta(wStream* s) Stream_Seek_UINT8(s); } #endif -static INLINE BOOL update_read_brush(wStream* s, rdpBrush* brush, - BYTE fieldFlags) +static INLINE BOOL update_read_brush(wStream* s, rdpBrush* brush, BYTE fieldFlags) { if (fieldFlags & ORDER_FIELD_01) { @@ -827,7 +787,7 @@ static INLINE BOOL update_read_brush(wStream* s, rdpBrush* brush, if (Stream_GetRemainingLength(s) < 7) return FALSE; - brush->data = (BYTE*) brush->p8x8; + brush->data = (BYTE*)brush->p8x8; Stream_Read_UINT8(s, brush->data[7]); Stream_Read_UINT8(s, brush->data[6]); Stream_Read_UINT8(s, brush->data[5]); @@ -840,8 +800,7 @@ static INLINE BOOL update_read_brush(wStream* s, rdpBrush* brush, return TRUE; } -static INLINE BOOL update_write_brush(wStream* s, rdpBrush* brush, - BYTE fieldFlags) +static INLINE BOOL update_write_brush(wStream* s, rdpBrush* brush, BYTE fieldFlags) { if (fieldFlags & ORDER_FIELD_01) { @@ -874,7 +833,7 @@ static INLINE BOOL update_write_brush(wStream* s, rdpBrush* brush, if (fieldFlags & ORDER_FIELD_05) { - brush->data = (BYTE*) brush->p8x8; + brush->data = (BYTE*)brush->p8x8; Stream_Write_UINT8(s, brush->data[7]); Stream_Write_UINT8(s, brush->data[6]); Stream_Write_UINT8(s, brush->data[5]); @@ -887,8 +846,7 @@ static INLINE BOOL update_write_brush(wStream* s, rdpBrush* brush, return TRUE; } -static INLINE BOOL update_read_delta_rects(wStream* s, DELTA_RECT* rectangles, - UINT32 number) +static INLINE BOOL update_read_delta_rects(wStream* s, DELTA_RECT* rectangles, UINT32 number) { UINT32 i; BYTE flags = 0; @@ -949,8 +907,8 @@ static INLINE BOOL update_read_delta_rects(wStream* s, DELTA_RECT* rectangles, return TRUE; } -static INLINE BOOL update_read_delta_points(wStream* s, DELTA_POINT* points, - int number, INT16 x, INT16 y) +static INLINE BOOL update_read_delta_points(wStream* s, DELTA_POINT* points, int number, INT16 x, + INT16 y) { int i; BYTE flags = 0; @@ -960,7 +918,7 @@ static INLINE BOOL update_read_delta_points(wStream* s, DELTA_POINT* points, if (Stream_GetRemainingLength(s) < zeroBitsSize) { - WLog_ERR(TAG, "Stream_GetRemainingLength(s) < %"PRIu32"", zeroBitsSize); + WLog_ERR(TAG, "Stream_GetRemainingLength(s) < %" PRIu32 "", zeroBitsSize); return FALSE; } @@ -990,60 +948,71 @@ static INLINE BOOL update_read_delta_points(wStream* s, DELTA_POINT* points, return TRUE; } -#define ORDER_FIELD_BYTE(NO, TARGET) \ - do {\ - if (orderInfo->fieldFlags & (1 << (NO-1))) \ - { \ - if (Stream_GetRemainingLength(s) < 1) {\ +#define ORDER_FIELD_BYTE(NO, TARGET) \ + do \ + { \ + if (orderInfo->fieldFlags & (1 << (NO - 1))) \ + { \ + if (Stream_GetRemainingLength(s) < 1) \ + { \ WLog_ERR(TAG, "error reading %s", #TARGET); \ - return FALSE; \ - } \ - Stream_Read_UINT8(s, TARGET); \ - } \ - } while(0) -#define ORDER_FIELD_2BYTE(NO, TARGET1, TARGET2) \ - do {\ - if (orderInfo->fieldFlags & (1 << (NO-1))) \ - { \ - if (Stream_GetRemainingLength(s) < 2) { \ + return FALSE; \ + } \ + Stream_Read_UINT8(s, TARGET); \ + } \ + } while (0) +#define ORDER_FIELD_2BYTE(NO, TARGET1, TARGET2) \ + do \ + { \ + if (orderInfo->fieldFlags & (1 << (NO - 1))) \ + { \ + if (Stream_GetRemainingLength(s) < 2) \ + { \ WLog_ERR(TAG, "error reading %s or %s", #TARGET1, #TARGET2); \ - return FALSE; \ - } \ - Stream_Read_UINT8(s, TARGET1); \ - Stream_Read_UINT8(s, TARGET2); \ - } \ - } while(0) -#define ORDER_FIELD_UINT16(NO, TARGET) \ - do {\ - if (orderInfo->fieldFlags & (1 << (NO-1))) \ - { \ - if (Stream_GetRemainingLength(s) < 2) { \ + return FALSE; \ + } \ + Stream_Read_UINT8(s, TARGET1); \ + Stream_Read_UINT8(s, TARGET2); \ + } \ + } while (0) +#define ORDER_FIELD_UINT16(NO, TARGET) \ + do \ + { \ + if (orderInfo->fieldFlags & (1 << (NO - 1))) \ + { \ + if (Stream_GetRemainingLength(s) < 2) \ + { \ WLog_ERR(TAG, "error reading %s", #TARGET); \ - return FALSE; \ - } \ - Stream_Read_UINT16(s, TARGET); \ - } \ - } while(0) -#define ORDER_FIELD_UINT32(NO, TARGET) \ - do {\ - if (orderInfo->fieldFlags & (1 << (NO-1))) \ - { \ - if (Stream_GetRemainingLength(s) < 4) { \ + return FALSE; \ + } \ + Stream_Read_UINT16(s, TARGET); \ + } \ + } while (0) +#define ORDER_FIELD_UINT32(NO, TARGET) \ + do \ + { \ + if (orderInfo->fieldFlags & (1 << (NO - 1))) \ + { \ + if (Stream_GetRemainingLength(s) < 4) \ + { \ WLog_ERR(TAG, "error reading %s", #TARGET); \ - return FALSE; \ - } \ - Stream_Read_UINT32(s, TARGET); \ - } \ - } while(0) -#define ORDER_FIELD_COORD(NO, TARGET) \ - do { \ - if ((orderInfo->fieldFlags & (1 << (NO-1))) && !update_read_coord(s, &TARGET, orderInfo->deltaCoordinates)) { \ - WLog_ERR(TAG, "error reading %s", #TARGET); \ - return FALSE; \ - } \ - } while(0) -static INLINE BOOL ORDER_FIELD_COLOR(const ORDER_INFO* orderInfo, wStream* s, - UINT32 NO, UINT32* TARGET) + return FALSE; \ + } \ + Stream_Read_UINT32(s, TARGET); \ + } \ + } while (0) +#define ORDER_FIELD_COORD(NO, TARGET) \ + do \ + { \ + if ((orderInfo->fieldFlags & (1 << (NO - 1))) && \ + !update_read_coord(s, &TARGET, orderInfo->deltaCoordinates)) \ + { \ + WLog_ERR(TAG, "error reading %s", #TARGET); \ + return FALSE; \ + } \ + } while (0) +static INLINE BOOL ORDER_FIELD_COLOR(const ORDER_INFO* orderInfo, wStream* s, UINT32 NO, + UINT32* TARGET) { if (!TARGET || !orderInfo) return FALSE; @@ -1062,15 +1031,14 @@ static INLINE BOOL FIELD_SKIP_BUFFER16(wStream* s, UINT32 TARGET_LEN) if (!Stream_SafeSeek(s, TARGET_LEN)) { - WLog_ERR(TAG, "error skipping %"PRIu32" bytes", TARGET_LEN); + WLog_ERR(TAG, "error skipping %" PRIu32 " bytes", TARGET_LEN); return FALSE; } return TRUE; } /* Primary Drawing Orders */ -static BOOL update_read_dstblt_order(wStream* s, const ORDER_INFO* orderInfo, - DSTBLT_ORDER* dstblt) +static BOOL update_read_dstblt_order(wStream* s, const ORDER_INFO* orderInfo, DSTBLT_ORDER* dstblt) { ORDER_FIELD_COORD(1, dstblt->nLeftRect); ORDER_FIELD_COORD(2, dstblt->nTopRect); @@ -1079,16 +1047,13 @@ static BOOL update_read_dstblt_order(wStream* s, const ORDER_INFO* orderInfo, ORDER_FIELD_BYTE(5, dstblt->bRop); return TRUE; } -int update_approximate_dstblt_order(ORDER_INFO* orderInfo, - const DSTBLT_ORDER* dstblt) +int update_approximate_dstblt_order(ORDER_INFO* orderInfo, const DSTBLT_ORDER* dstblt) { return 32; } -BOOL update_write_dstblt_order(wStream* s, ORDER_INFO* orderInfo, - const DSTBLT_ORDER* dstblt) +BOOL update_write_dstblt_order(wStream* s, ORDER_INFO* orderInfo, const DSTBLT_ORDER* dstblt) { - if (!Stream_EnsureRemainingCapacity(s, - update_approximate_dstblt_order(orderInfo, dstblt))) + if (!Stream_EnsureRemainingCapacity(s, update_approximate_dstblt_order(orderInfo, dstblt))) return FALSE; orderInfo->fieldFlags = 0; @@ -1104,8 +1069,7 @@ BOOL update_write_dstblt_order(wStream* s, ORDER_INFO* orderInfo, Stream_Write_UINT8(s, dstblt->bRop); return TRUE; } -static BOOL update_read_patblt_order(wStream* s, const ORDER_INFO* orderInfo, - PATBLT_ORDER* patblt) +static BOOL update_read_patblt_order(wStream* s, const ORDER_INFO* orderInfo, PATBLT_ORDER* patblt) { ORDER_FIELD_COORD(1, patblt->nLeftRect); ORDER_FIELD_COORD(2, patblt->nTopRect); @@ -1116,16 +1080,13 @@ static BOOL update_read_patblt_order(wStream* s, const ORDER_INFO* orderInfo, ORDER_FIELD_COLOR(orderInfo, s, 7, &patblt->foreColor); return update_read_brush(s, &patblt->brush, orderInfo->fieldFlags >> 7); } -int update_approximate_patblt_order(ORDER_INFO* orderInfo, - PATBLT_ORDER* patblt) +int update_approximate_patblt_order(ORDER_INFO* orderInfo, PATBLT_ORDER* patblt) { return 32; } -BOOL update_write_patblt_order(wStream* s, ORDER_INFO* orderInfo, - PATBLT_ORDER* patblt) +BOOL update_write_patblt_order(wStream* s, ORDER_INFO* orderInfo, PATBLT_ORDER* patblt) { - if (!Stream_EnsureRemainingCapacity(s, - update_approximate_patblt_order(orderInfo, patblt))) + if (!Stream_EnsureRemainingCapacity(s, update_approximate_patblt_order(orderInfo, patblt))) return FALSE; orderInfo->fieldFlags = 0; @@ -1151,8 +1112,7 @@ BOOL update_write_patblt_order(wStream* s, ORDER_INFO* orderInfo, update_write_brush(s, &patblt->brush, orderInfo->fieldFlags >> 7); return TRUE; } -static BOOL update_read_scrblt_order(wStream* s, const ORDER_INFO* orderInfo, - SCRBLT_ORDER* scrblt) +static BOOL update_read_scrblt_order(wStream* s, const ORDER_INFO* orderInfo, SCRBLT_ORDER* scrblt) { ORDER_FIELD_COORD(1, scrblt->nLeftRect); ORDER_FIELD_COORD(2, scrblt->nTopRect); @@ -1163,16 +1123,13 @@ static BOOL update_read_scrblt_order(wStream* s, const ORDER_INFO* orderInfo, ORDER_FIELD_COORD(7, scrblt->nYSrc); return TRUE; } -int update_approximate_scrblt_order(ORDER_INFO* orderInfo, - const SCRBLT_ORDER* scrblt) +int update_approximate_scrblt_order(ORDER_INFO* orderInfo, const SCRBLT_ORDER* scrblt) { return 32; } -BOOL update_write_scrblt_order(wStream* s, ORDER_INFO* orderInfo, - const SCRBLT_ORDER* scrblt) +BOOL update_write_scrblt_order(wStream* s, ORDER_INFO* orderInfo, const SCRBLT_ORDER* scrblt) { - if (!Stream_EnsureRemainingCapacity(s, - update_approximate_scrblt_order(orderInfo, scrblt))) + if (!Stream_EnsureRemainingCapacity(s, update_approximate_scrblt_order(orderInfo, scrblt))) return FALSE; orderInfo->fieldFlags = 0; @@ -1193,7 +1150,7 @@ BOOL update_write_scrblt_order(wStream* s, ORDER_INFO* orderInfo, return TRUE; } static BOOL update_read_opaque_rect_order(wStream* s, const ORDER_INFO* orderInfo, - OPAQUE_RECT_ORDER* opaque_rect) + OPAQUE_RECT_ORDER* opaque_rect) { BYTE byte; ORDER_FIELD_COORD(1, opaque_rect->nLeftRect); @@ -1207,7 +1164,7 @@ static BOOL update_read_opaque_rect_order(wStream* s, const ORDER_INFO* orderInf return FALSE; Stream_Read_UINT8(s, byte); - opaque_rect->color = (opaque_rect->color & 0x00FFFF00) | ((UINT32) byte); + opaque_rect->color = (opaque_rect->color & 0x00FFFF00) | ((UINT32)byte); } if (orderInfo->fieldFlags & ORDER_FIELD_06) @@ -1216,7 +1173,7 @@ static BOOL update_read_opaque_rect_order(wStream* s, const ORDER_INFO* orderInf return FALSE; Stream_Read_UINT8(s, byte); - opaque_rect->color = (opaque_rect->color & 0x00FF00FF) | ((UINT32) byte << 8); + opaque_rect->color = (opaque_rect->color & 0x00FF00FF) | ((UINT32)byte << 8); } if (orderInfo->fieldFlags & ORDER_FIELD_07) @@ -1225,13 +1182,13 @@ static BOOL update_read_opaque_rect_order(wStream* s, const ORDER_INFO* orderInf return FALSE; Stream_Read_UINT8(s, byte); - opaque_rect->color = (opaque_rect->color & 0x0000FFFF) | ((UINT32) byte << 16); + opaque_rect->color = (opaque_rect->color & 0x0000FFFF) | ((UINT32)byte << 16); } return TRUE; } int update_approximate_opaque_rect_order(ORDER_INFO* orderInfo, - const OPAQUE_RECT_ORDER* opaque_rect) + const OPAQUE_RECT_ORDER* opaque_rect) { return 32; } @@ -1265,9 +1222,8 @@ BOOL update_write_opaque_rect_order(wStream* s, ORDER_INFO* orderInfo, Stream_Write_UINT8(s, byte); return TRUE; } -static BOOL update_read_draw_nine_grid_order(wStream* s, - const ORDER_INFO* orderInfo, - DRAW_NINE_GRID_ORDER* draw_nine_grid) +static BOOL update_read_draw_nine_grid_order(wStream* s, const ORDER_INFO* orderInfo, + DRAW_NINE_GRID_ORDER* draw_nine_grid) { ORDER_FIELD_COORD(1, draw_nine_grid->srcLeft); ORDER_FIELD_COORD(2, draw_nine_grid->srcTop); @@ -1277,7 +1233,7 @@ static BOOL update_read_draw_nine_grid_order(wStream* s, return TRUE; } static BOOL update_read_multi_dstblt_order(wStream* s, const ORDER_INFO* orderInfo, - MULTI_DSTBLT_ORDER* multi_dstblt) + MULTI_DSTBLT_ORDER* multi_dstblt) { ORDER_FIELD_COORD(1, multi_dstblt->nLeftRect); ORDER_FIELD_COORD(2, multi_dstblt->nTopRect); @@ -1292,14 +1248,13 @@ static BOOL update_read_multi_dstblt_order(wStream* s, const ORDER_INFO* orderIn return FALSE; Stream_Read_UINT16(s, multi_dstblt->cbData); - return update_read_delta_rects(s, multi_dstblt->rectangles, - multi_dstblt->numRectangles); + return update_read_delta_rects(s, multi_dstblt->rectangles, multi_dstblt->numRectangles); } return TRUE; } static BOOL update_read_multi_patblt_order(wStream* s, const ORDER_INFO* orderInfo, - MULTI_PATBLT_ORDER* multi_patblt) + MULTI_PATBLT_ORDER* multi_patblt) { ORDER_FIELD_COORD(1, multi_patblt->nLeftRect); ORDER_FIELD_COORD(2, multi_patblt->nTopRect); @@ -1321,15 +1276,14 @@ static BOOL update_read_multi_patblt_order(wStream* s, const ORDER_INFO* orderIn Stream_Read_UINT16(s, multi_patblt->cbData); - if (!update_read_delta_rects(s, multi_patblt->rectangles, - multi_patblt->numRectangles)) + if (!update_read_delta_rects(s, multi_patblt->rectangles, multi_patblt->numRectangles)) return FALSE; } return TRUE; } static BOOL update_read_multi_scrblt_order(wStream* s, const ORDER_INFO* orderInfo, - MULTI_SCRBLT_ORDER* multi_scrblt) + MULTI_SCRBLT_ORDER* multi_scrblt) { ORDER_FIELD_COORD(1, multi_scrblt->nLeftRect); ORDER_FIELD_COORD(2, multi_scrblt->nTopRect); @@ -1346,15 +1300,13 @@ static BOOL update_read_multi_scrblt_order(wStream* s, const ORDER_INFO* orderIn return FALSE; Stream_Read_UINT16(s, multi_scrblt->cbData); - return update_read_delta_rects(s, multi_scrblt->rectangles, - multi_scrblt->numRectangles); + return update_read_delta_rects(s, multi_scrblt->rectangles, multi_scrblt->numRectangles); } return TRUE; } -static BOOL update_read_multi_opaque_rect_order(wStream* s, - const ORDER_INFO* orderInfo, - MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect) +static BOOL update_read_multi_opaque_rect_order(wStream* s, const ORDER_INFO* orderInfo, + MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect) { BYTE byte; ORDER_FIELD_COORD(1, multi_opaque_rect->nLeftRect); @@ -1368,8 +1320,7 @@ static BOOL update_read_multi_opaque_rect_order(wStream* s, return FALSE; Stream_Read_UINT8(s, byte); - multi_opaque_rect->color = (multi_opaque_rect->color & 0x00FFFF00) | (( - UINT32) byte); + multi_opaque_rect->color = (multi_opaque_rect->color & 0x00FFFF00) | ((UINT32)byte); } if (orderInfo->fieldFlags & ORDER_FIELD_06) @@ -1378,8 +1329,7 @@ static BOOL update_read_multi_opaque_rect_order(wStream* s, return FALSE; Stream_Read_UINT8(s, byte); - multi_opaque_rect->color = (multi_opaque_rect->color & 0x00FF00FF) | (( - UINT32) byte << 8); + multi_opaque_rect->color = (multi_opaque_rect->color & 0x00FF00FF) | ((UINT32)byte << 8); } if (orderInfo->fieldFlags & ORDER_FIELD_07) @@ -1388,8 +1338,7 @@ static BOOL update_read_multi_opaque_rect_order(wStream* s, return FALSE; Stream_Read_UINT8(s, byte); - multi_opaque_rect->color = (multi_opaque_rect->color & 0x0000FFFF) | - ((UINT32) byte << 16); + multi_opaque_rect->color = (multi_opaque_rect->color & 0x0000FFFF) | ((UINT32)byte << 16); } ORDER_FIELD_BYTE(8, multi_opaque_rect->numRectangles); @@ -1406,9 +1355,8 @@ static BOOL update_read_multi_opaque_rect_order(wStream* s, return TRUE; } -static BOOL update_read_multi_draw_nine_grid_order(wStream* s, - const ORDER_INFO* orderInfo, - MULTI_DRAW_NINE_GRID_ORDER* multi_draw_nine_grid) +static BOOL update_read_multi_draw_nine_grid_order(wStream* s, const ORDER_INFO* orderInfo, + MULTI_DRAW_NINE_GRID_ORDER* multi_draw_nine_grid) { ORDER_FIELD_COORD(1, multi_draw_nine_grid->srcLeft); ORDER_FIELD_COORD(2, multi_draw_nine_grid->srcTop); @@ -1444,16 +1392,13 @@ static BOOL update_read_line_to_order(wStream* s, const ORDER_INFO* orderInfo, ORDER_FIELD_COLOR(orderInfo, s, 10, &line_to->penColor); return TRUE; } -int update_approximate_line_to_order(ORDER_INFO* orderInfo, - const LINE_TO_ORDER* line_to) +int update_approximate_line_to_order(ORDER_INFO* orderInfo, const LINE_TO_ORDER* line_to) { return 32; } -BOOL update_write_line_to_order(wStream* s, ORDER_INFO* orderInfo, - const LINE_TO_ORDER* line_to) +BOOL update_write_line_to_order(wStream* s, ORDER_INFO* orderInfo, const LINE_TO_ORDER* line_to) { - if (!Stream_EnsureRemainingCapacity(s, - update_approximate_line_to_order(orderInfo, line_to))) + if (!Stream_EnsureRemainingCapacity(s, update_approximate_line_to_order(orderInfo, line_to))) return FALSE; orderInfo->fieldFlags = 0; @@ -1502,12 +1447,11 @@ static BOOL update_read_polyline_order(wStream* s, const ORDER_INFO* orderInfo, } Stream_Read_UINT8(s, polyline->cbData); - new_points = (DELTA_POINT*) realloc(polyline->points, - sizeof(DELTA_POINT) * new_num); + new_points = (DELTA_POINT*)realloc(polyline->points, sizeof(DELTA_POINT) * new_num); if (!new_points) { - WLog_ERR(TAG, "realloc(%"PRIu32") failed", new_num); + WLog_ERR(TAG, "realloc(%" PRIu32 ") failed", new_num); return FALSE; } @@ -1519,8 +1463,7 @@ static BOOL update_read_polyline_order(wStream* s, const ORDER_INFO* orderInfo, return TRUE; } -static BOOL update_read_memblt_order(wStream* s, const ORDER_INFO* orderInfo, - MEMBLT_ORDER* memblt) +static BOOL update_read_memblt_order(wStream* s, const ORDER_INFO* orderInfo, MEMBLT_ORDER* memblt) { if (!s || !orderInfo || !memblt) return FALSE; @@ -1539,18 +1482,15 @@ static BOOL update_read_memblt_order(wStream* s, const ORDER_INFO* orderInfo, memblt->bitmap = NULL; return TRUE; } -int update_approximate_memblt_order(ORDER_INFO* orderInfo, - const MEMBLT_ORDER* memblt) +int update_approximate_memblt_order(ORDER_INFO* orderInfo, const MEMBLT_ORDER* memblt) { return 64; } -BOOL update_write_memblt_order(wStream* s, ORDER_INFO* orderInfo, - const MEMBLT_ORDER* memblt) +BOOL update_write_memblt_order(wStream* s, ORDER_INFO* orderInfo, const MEMBLT_ORDER* memblt) { UINT16 cacheId; - if (!Stream_EnsureRemainingCapacity(s, - update_approximate_memblt_order(orderInfo, memblt))) + if (!Stream_EnsureRemainingCapacity(s, update_approximate_memblt_order(orderInfo, memblt))) return FALSE; cacheId = (memblt->cacheId & 0xFF) | ((memblt->colorIndex & 0xFF) << 8); @@ -1598,7 +1538,7 @@ static BOOL update_read_mem3blt_order(wStream* s, const ORDER_INFO* orderInfo, return TRUE; } static BOOL update_read_save_bitmap_order(wStream* s, const ORDER_INFO* orderInfo, - SAVE_BITMAP_ORDER* save_bitmap) + SAVE_BITMAP_ORDER* save_bitmap) { ORDER_FIELD_UINT32(1, save_bitmap->savedBitmapPosition); ORDER_FIELD_COORD(2, save_bitmap->nLeftRect); @@ -1609,7 +1549,7 @@ static BOOL update_read_save_bitmap_order(wStream* s, const ORDER_INFO* orderInf return TRUE; } static BOOL update_read_glyph_index_order(wStream* s, const ORDER_INFO* orderInfo, - GLYPH_INDEX_ORDER* glyph_index) + GLYPH_INDEX_ORDER* glyph_index) { ORDER_FIELD_BYTE(1, glyph_index->cacheId); ORDER_FIELD_BYTE(2, glyph_index->flAccel); @@ -1649,7 +1589,7 @@ static BOOL update_read_glyph_index_order(wStream* s, const ORDER_INFO* orderInf return TRUE; } int update_approximate_glyph_index_order(ORDER_INFO* orderInfo, - const GLYPH_INDEX_ORDER* glyph_index) + const GLYPH_INDEX_ORDER* glyph_index) { return 64; } @@ -1706,7 +1646,7 @@ BOOL update_write_glyph_index_order(wStream* s, ORDER_INFO* orderInfo, return TRUE; } static BOOL update_read_fast_index_order(wStream* s, const ORDER_INFO* orderInfo, - FAST_INDEX_ORDER* fast_index) + FAST_INDEX_ORDER* fast_index) { ORDER_FIELD_BYTE(1, fast_index->cacheId); ORDER_FIELD_2BYTE(2, fast_index->ulCharInc, fast_index->flAccel); @@ -1740,7 +1680,7 @@ static BOOL update_read_fast_index_order(wStream* s, const ORDER_INFO* orderInfo return TRUE; } static BOOL update_read_fast_glyph_order(wStream* s, const ORDER_INFO* orderInfo, - FAST_GLYPH_ORDER* fastGlyph) + FAST_GLYPH_ORDER* fastGlyph) { BYTE* phold; GLYPH_DATA_V2* glyph = &fastGlyph->glyphData; @@ -1798,7 +1738,7 @@ static BOOL update_read_fast_glyph_order(wStream* s, const ORDER_INFO* orderInfo if (new_cb) { BYTE* new_aj; - new_aj = (BYTE*) realloc(glyph->aj, new_cb); + new_aj = (BYTE*)realloc(glyph->aj, new_cb); if (!new_aj) return FALSE; @@ -1815,7 +1755,7 @@ static BOOL update_read_fast_glyph_order(wStream* s, const ORDER_INFO* orderInfo return TRUE; } static BOOL update_read_polygon_sc_order(wStream* s, const ORDER_INFO* orderInfo, - POLYGON_SC_ORDER* polygon_sc) + POLYGON_SC_ORDER* polygon_sc) { UINT32 num = polygon_sc->numPoints; ORDER_FIELD_COORD(1, polygon_sc->xStart); @@ -1833,8 +1773,7 @@ static BOOL update_read_polygon_sc_order(wStream* s, const ORDER_INFO* orderInfo return FALSE; Stream_Read_UINT8(s, polygon_sc->cbData); - newpoints = (DELTA_POINT*) realloc(polygon_sc->points, - sizeof(DELTA_POINT) * num); + newpoints = (DELTA_POINT*)realloc(polygon_sc->points, sizeof(DELTA_POINT) * num); if (!newpoints) return FALSE; @@ -1848,7 +1787,7 @@ static BOOL update_read_polygon_sc_order(wStream* s, const ORDER_INFO* orderInfo return TRUE; } static BOOL update_read_polygon_cb_order(wStream* s, const ORDER_INFO* orderInfo, - POLYGON_CB_ORDER* polygon_cb) + POLYGON_CB_ORDER* polygon_cb) { UINT32 num = polygon_cb->numPoints; ORDER_FIELD_COORD(1, polygon_cb->xStart); @@ -1871,8 +1810,7 @@ static BOOL update_read_polygon_cb_order(wStream* s, const ORDER_INFO* orderInfo return FALSE; Stream_Read_UINT8(s, polygon_cb->cbData); - newpoints = (DELTA_POINT*) realloc(polygon_cb->points, - sizeof(DELTA_POINT) * num); + newpoints = (DELTA_POINT*)realloc(polygon_cb->points, sizeof(DELTA_POINT) * num); if (!newpoints) return FALSE; @@ -1885,13 +1823,12 @@ static BOOL update_read_polygon_cb_order(wStream* s, const ORDER_INFO* orderInfo return FALSE; } - polygon_cb->backMode = (polygon_cb->bRop2 & 0x80) ? BACKMODE_TRANSPARENT : - BACKMODE_OPAQUE; + polygon_cb->backMode = (polygon_cb->bRop2 & 0x80) ? BACKMODE_TRANSPARENT : BACKMODE_OPAQUE; polygon_cb->bRop2 = (polygon_cb->bRop2 & 0x1F); return TRUE; } static BOOL update_read_ellipse_sc_order(wStream* s, const ORDER_INFO* orderInfo, - ELLIPSE_SC_ORDER* ellipse_sc) + ELLIPSE_SC_ORDER* ellipse_sc) { ORDER_FIELD_COORD(1, ellipse_sc->leftRect); ORDER_FIELD_COORD(2, ellipse_sc->topRect); @@ -1903,7 +1840,7 @@ static BOOL update_read_ellipse_sc_order(wStream* s, const ORDER_INFO* orderInfo return TRUE; } static BOOL update_read_ellipse_cb_order(wStream* s, const ORDER_INFO* orderInfo, - ELLIPSE_CB_ORDER* ellipse_cb) + ELLIPSE_CB_ORDER* ellipse_cb) { ORDER_FIELD_COORD(1, ellipse_cb->leftRect); ORDER_FIELD_COORD(2, ellipse_cb->topRect); @@ -1917,7 +1854,7 @@ static BOOL update_read_ellipse_cb_order(wStream* s, const ORDER_INFO* orderInfo } /* Secondary Drawing Orders */ static CACHE_BITMAP_ORDER* update_read_cache_bitmap_order(rdpUpdate* update, wStream* s, - BOOL compressed, UINT16 flags) + BOOL compressed, UINT16 flags) { CACHE_BITMAP_ORDER* cache_bitmap; @@ -1932,26 +1869,27 @@ static CACHE_BITMAP_ORDER* update_read_cache_bitmap_order(rdpUpdate* update, wSt if (Stream_GetRemainingLength(s) < 9) goto fail; - Stream_Read_UINT8(s, cache_bitmap->cacheId); /* cacheId (1 byte) */ - Stream_Seek_UINT8(s); /* pad1Octet (1 byte) */ - Stream_Read_UINT8(s, cache_bitmap->bitmapWidth); /* bitmapWidth (1 byte) */ + Stream_Read_UINT8(s, cache_bitmap->cacheId); /* cacheId (1 byte) */ + Stream_Seek_UINT8(s); /* pad1Octet (1 byte) */ + Stream_Read_UINT8(s, cache_bitmap->bitmapWidth); /* bitmapWidth (1 byte) */ Stream_Read_UINT8(s, cache_bitmap->bitmapHeight); /* bitmapHeight (1 byte) */ - Stream_Read_UINT8(s, cache_bitmap->bitmapBpp); /* bitmapBpp (1 byte) */ + Stream_Read_UINT8(s, cache_bitmap->bitmapBpp); /* bitmapBpp (1 byte) */ if ((cache_bitmap->bitmapBpp < 1) || (cache_bitmap->bitmapBpp > 32)) { - WLog_Print(update->log, WLOG_ERROR, "invalid bitmap bpp %"PRIu32"", cache_bitmap->bitmapBpp); + WLog_Print(update->log, WLOG_ERROR, "invalid bitmap bpp %" PRIu32 "", + cache_bitmap->bitmapBpp); goto fail; } Stream_Read_UINT16(s, cache_bitmap->bitmapLength); /* bitmapLength (2 bytes) */ - Stream_Read_UINT16(s, cache_bitmap->cacheIndex); /* cacheIndex (2 bytes) */ + Stream_Read_UINT16(s, cache_bitmap->cacheIndex); /* cacheIndex (2 bytes) */ if (compressed) { if ((flags & NO_BITMAP_COMPRESSION_HDR) == 0) { - BYTE* bitmapComprHdr = (BYTE*) & (cache_bitmap->bitmapComprHdr); + BYTE* bitmapComprHdr = (BYTE*)&(cache_bitmap->bitmapComprHdr); if (Stream_GetRemainingLength(s) < 8) goto fail; @@ -1976,19 +1914,16 @@ fail: free_cache_bitmap_order(update->context, cache_bitmap); return NULL; } -int update_approximate_cache_bitmap_order(const CACHE_BITMAP_ORDER* - cache_bitmap, - BOOL compressed, UINT16* flags) +int update_approximate_cache_bitmap_order(const CACHE_BITMAP_ORDER* cache_bitmap, BOOL compressed, + UINT16* flags) { return 64 + cache_bitmap->bitmapLength; } -BOOL update_write_cache_bitmap_order(wStream* s, - const CACHE_BITMAP_ORDER* cache_bitmap, +BOOL update_write_cache_bitmap_order(wStream* s, const CACHE_BITMAP_ORDER* cache_bitmap, BOOL compressed, UINT16* flags) { UINT32 bitmapLength = cache_bitmap->bitmapLength; - int inf = update_approximate_cache_bitmap_order(cache_bitmap, compressed, - flags); + int inf = update_approximate_cache_bitmap_order(cache_bitmap, compressed, flags); if (!Stream_EnsureRemainingCapacity(s, inf)) return FALSE; @@ -1998,19 +1933,19 @@ BOOL update_write_cache_bitmap_order(wStream* s, if ((*flags & NO_BITMAP_COMPRESSION_HDR) == 0) bitmapLength += 8; - Stream_Write_UINT8(s, cache_bitmap->cacheId); /* cacheId (1 byte) */ - Stream_Write_UINT8(s, 0); /* pad1Octet (1 byte) */ - Stream_Write_UINT8(s, cache_bitmap->bitmapWidth); /* bitmapWidth (1 byte) */ + Stream_Write_UINT8(s, cache_bitmap->cacheId); /* cacheId (1 byte) */ + Stream_Write_UINT8(s, 0); /* pad1Octet (1 byte) */ + Stream_Write_UINT8(s, cache_bitmap->bitmapWidth); /* bitmapWidth (1 byte) */ Stream_Write_UINT8(s, cache_bitmap->bitmapHeight); /* bitmapHeight (1 byte) */ - Stream_Write_UINT8(s, cache_bitmap->bitmapBpp); /* bitmapBpp (1 byte) */ - Stream_Write_UINT16(s, bitmapLength); /* bitmapLength (2 bytes) */ - Stream_Write_UINT16(s, cache_bitmap->cacheIndex); /* cacheIndex (2 bytes) */ + Stream_Write_UINT8(s, cache_bitmap->bitmapBpp); /* bitmapBpp (1 byte) */ + Stream_Write_UINT16(s, bitmapLength); /* bitmapLength (2 bytes) */ + Stream_Write_UINT16(s, cache_bitmap->cacheIndex); /* cacheIndex (2 bytes) */ if (compressed) { if ((*flags & NO_BITMAP_COMPRESSION_HDR) == 0) { - BYTE* bitmapComprHdr = (BYTE*) & (cache_bitmap->bitmapComprHdr); + BYTE* bitmapComprHdr = (BYTE*)&(cache_bitmap->bitmapComprHdr); Stream_Write(s, bitmapComprHdr, 8); /* bitmapComprHdr (8 bytes) */ bitmapLength -= 8; } @@ -2025,7 +1960,7 @@ BOOL update_write_cache_bitmap_order(wStream* s, return TRUE; } static CACHE_BITMAP_V2_ORDER* update_read_cache_bitmap_v2_order(rdpUpdate* update, wStream* s, - BOOL compressed, UINT16 flags) + BOOL compressed, UINT16 flags) { BYTE bitsPerPixelId; CACHE_BITMAP_V2_ORDER* cache_bitmap_v2; @@ -2054,24 +1989,20 @@ static CACHE_BITMAP_V2_ORDER* update_read_cache_bitmap_v2_order(rdpUpdate* updat if (cache_bitmap_v2->flags & CBR2_HEIGHT_SAME_AS_WIDTH) { - if (!update_read_2byte_unsigned(s, - &cache_bitmap_v2->bitmapWidth)) /* bitmapWidth */ + if (!update_read_2byte_unsigned(s, &cache_bitmap_v2->bitmapWidth)) /* bitmapWidth */ goto fail; cache_bitmap_v2->bitmapHeight = cache_bitmap_v2->bitmapWidth; } else { - if (!update_read_2byte_unsigned(s, &cache_bitmap_v2->bitmapWidth) - || /* bitmapWidth */ - !update_read_2byte_unsigned(s, - &cache_bitmap_v2->bitmapHeight)) /* bitmapHeight */ + if (!update_read_2byte_unsigned(s, &cache_bitmap_v2->bitmapWidth) || /* bitmapWidth */ + !update_read_2byte_unsigned(s, &cache_bitmap_v2->bitmapHeight)) /* bitmapHeight */ goto fail; } - if (!update_read_4byte_unsigned(s, &cache_bitmap_v2->bitmapLength) - || /* bitmapLength */ - !update_read_2byte_unsigned(s, &cache_bitmap_v2->cacheIndex)) /* cacheIndex */ + if (!update_read_4byte_unsigned(s, &cache_bitmap_v2->bitmapLength) || /* bitmapLength */ + !update_read_2byte_unsigned(s, &cache_bitmap_v2->cacheIndex)) /* cacheIndex */ goto fail; if (cache_bitmap_v2->flags & CBR2_DO_NOT_CACHE) @@ -2084,13 +2015,13 @@ static CACHE_BITMAP_V2_ORDER* update_read_cache_bitmap_v2_order(rdpUpdate* updat if (Stream_GetRemainingLength(s) < 8) goto fail; - Stream_Read_UINT16(s, - cache_bitmap_v2->cbCompFirstRowSize); /* cbCompFirstRowSize (2 bytes) */ - Stream_Read_UINT16(s, - cache_bitmap_v2->cbCompMainBodySize); /* cbCompMainBodySize (2 bytes) */ + Stream_Read_UINT16( + s, cache_bitmap_v2->cbCompFirstRowSize); /* cbCompFirstRowSize (2 bytes) */ + Stream_Read_UINT16( + s, cache_bitmap_v2->cbCompMainBodySize); /* cbCompMainBodySize (2 bytes) */ Stream_Read_UINT16(s, cache_bitmap_v2->cbScanWidth); /* cbScanWidth (2 bytes) */ - Stream_Read_UINT16(s, - cache_bitmap_v2->cbUncompressedSize); /* cbUncompressedSize (2 bytes) */ + Stream_Read_UINT16( + s, cache_bitmap_v2->cbUncompressedSize); /* cbUncompressedSize (2 bytes) */ cache_bitmap_v2->bitmapLength = cache_bitmap_v2->cbCompMainBodySize; } } @@ -2113,23 +2044,23 @@ fail: free_cache_bitmap_v2_order(update->context, cache_bitmap_v2); return NULL; } -int update_approximate_cache_bitmap_v2_order(CACHE_BITMAP_V2_ORDER* - cache_bitmap_v2, BOOL compressed, UINT16* flags) +int update_approximate_cache_bitmap_v2_order(CACHE_BITMAP_V2_ORDER* cache_bitmap_v2, + BOOL compressed, UINT16* flags) { return 64 + cache_bitmap_v2->bitmapLength; } -BOOL update_write_cache_bitmap_v2_order(wStream* s, - CACHE_BITMAP_V2_ORDER* cache_bitmap_v2, BOOL compressed, UINT16* flags) +BOOL update_write_cache_bitmap_v2_order(wStream* s, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2, + BOOL compressed, UINT16* flags) { BYTE bitsPerPixelId; - if (!Stream_EnsureRemainingCapacity(s, - update_approximate_cache_bitmap_v2_order(cache_bitmap_v2, compressed, flags))) + if (!Stream_EnsureRemainingCapacity( + s, update_approximate_cache_bitmap_v2_order(cache_bitmap_v2, compressed, flags))) return FALSE; bitsPerPixelId = BPP_CBR2[cache_bitmap_v2->bitmapBpp]; - *flags = (cache_bitmap_v2->cacheId & 0x0003) | - (bitsPerPixelId << 3) | ((cache_bitmap_v2->flags << 7) & 0xFF80); + *flags = (cache_bitmap_v2->cacheId & 0x0003) | (bitsPerPixelId << 3) | + ((cache_bitmap_v2->flags << 7) & 0xFF80); if (cache_bitmap_v2->flags & CBR2_PERSISTENT_KEY_PRESENT) { @@ -2139,62 +2070,55 @@ BOOL update_write_cache_bitmap_v2_order(wStream* s, if (cache_bitmap_v2->flags & CBR2_HEIGHT_SAME_AS_WIDTH) { - if (!update_write_2byte_unsigned(s, - cache_bitmap_v2->bitmapWidth)) /* bitmapWidth */ + if (!update_write_2byte_unsigned(s, cache_bitmap_v2->bitmapWidth)) /* bitmapWidth */ return FALSE; } else { - if (!update_write_2byte_unsigned(s, cache_bitmap_v2->bitmapWidth) - || /* bitmapWidth */ - !update_write_2byte_unsigned(s, - cache_bitmap_v2->bitmapHeight)) /* bitmapHeight */ + if (!update_write_2byte_unsigned(s, cache_bitmap_v2->bitmapWidth) || /* bitmapWidth */ + !update_write_2byte_unsigned(s, cache_bitmap_v2->bitmapHeight)) /* bitmapHeight */ return FALSE; } if (cache_bitmap_v2->flags & CBR2_DO_NOT_CACHE) cache_bitmap_v2->cacheIndex = BITMAP_CACHE_WAITING_LIST_INDEX; - if (!update_write_4byte_unsigned(s, cache_bitmap_v2->bitmapLength) - || /* bitmapLength */ - !update_write_2byte_unsigned(s, cache_bitmap_v2->cacheIndex)) /* cacheIndex */ + if (!update_write_4byte_unsigned(s, cache_bitmap_v2->bitmapLength) || /* bitmapLength */ + !update_write_2byte_unsigned(s, cache_bitmap_v2->cacheIndex)) /* cacheIndex */ return FALSE; if (compressed) { if (!(cache_bitmap_v2->flags & CBR2_NO_BITMAP_COMPRESSION_HDR)) { - Stream_Write_UINT16(s, - cache_bitmap_v2->cbCompFirstRowSize); /* cbCompFirstRowSize (2 bytes) */ - Stream_Write_UINT16(s, - cache_bitmap_v2->cbCompMainBodySize); /* cbCompMainBodySize (2 bytes) */ - Stream_Write_UINT16(s, - cache_bitmap_v2->cbScanWidth); /* cbScanWidth (2 bytes) */ - Stream_Write_UINT16(s, - cache_bitmap_v2->cbUncompressedSize); /* cbUncompressedSize (2 bytes) */ + Stream_Write_UINT16( + s, cache_bitmap_v2->cbCompFirstRowSize); /* cbCompFirstRowSize (2 bytes) */ + Stream_Write_UINT16( + s, cache_bitmap_v2->cbCompMainBodySize); /* cbCompMainBodySize (2 bytes) */ + Stream_Write_UINT16(s, cache_bitmap_v2->cbScanWidth); /* cbScanWidth (2 bytes) */ + Stream_Write_UINT16( + s, cache_bitmap_v2->cbUncompressedSize); /* cbUncompressedSize (2 bytes) */ cache_bitmap_v2->bitmapLength = cache_bitmap_v2->cbCompMainBodySize; } if (!Stream_EnsureRemainingCapacity(s, cache_bitmap_v2->bitmapLength)) return FALSE; - Stream_Write(s, cache_bitmap_v2->bitmapDataStream, - cache_bitmap_v2->bitmapLength); + Stream_Write(s, cache_bitmap_v2->bitmapDataStream, cache_bitmap_v2->bitmapLength); } else { if (!Stream_EnsureRemainingCapacity(s, cache_bitmap_v2->bitmapLength)) return FALSE; - Stream_Write(s, cache_bitmap_v2->bitmapDataStream, - cache_bitmap_v2->bitmapLength); + Stream_Write(s, cache_bitmap_v2->bitmapDataStream, cache_bitmap_v2->bitmapLength); } cache_bitmap_v2->compressed = compressed; return TRUE; } static CACHE_BITMAP_V3_ORDER* update_read_cache_bitmap_v3_order(rdpUpdate* update, wStream* s, - UINT16 flags) + UINT16 flags) { BYTE bitsPerPixelId; BITMAP_DATA_EX* bitmapData; @@ -2219,28 +2143,28 @@ static CACHE_BITMAP_V3_ORDER* update_read_cache_bitmap_v3_order(rdpUpdate* updat goto fail; Stream_Read_UINT16(s, cache_bitmap_v3->cacheIndex); /* cacheIndex (2 bytes) */ - Stream_Read_UINT32(s, cache_bitmap_v3->key1); /* key1 (4 bytes) */ - Stream_Read_UINT32(s, cache_bitmap_v3->key2); /* key2 (4 bytes) */ + Stream_Read_UINT32(s, cache_bitmap_v3->key1); /* key1 (4 bytes) */ + Stream_Read_UINT32(s, cache_bitmap_v3->key2); /* key2 (4 bytes) */ bitmapData = &cache_bitmap_v3->bitmapData; Stream_Read_UINT8(s, bitmapData->bpp); if ((bitmapData->bpp < 1) || (bitmapData->bpp > 32)) { - WLog_Print(update->log, WLOG_ERROR, "invalid bpp value %"PRIu32"", bitmapData->bpp); + WLog_Print(update->log, WLOG_ERROR, "invalid bpp value %" PRIu32 "", bitmapData->bpp); goto fail; } - Stream_Seek_UINT8(s); /* reserved1 (1 byte) */ - Stream_Seek_UINT8(s); /* reserved2 (1 byte) */ + Stream_Seek_UINT8(s); /* reserved1 (1 byte) */ + Stream_Seek_UINT8(s); /* reserved2 (1 byte) */ Stream_Read_UINT8(s, bitmapData->codecID); /* codecID (1 byte) */ - Stream_Read_UINT16(s, bitmapData->width); /* width (2 bytes) */ + Stream_Read_UINT16(s, bitmapData->width); /* width (2 bytes) */ Stream_Read_UINT16(s, bitmapData->height); /* height (2 bytes) */ - Stream_Read_UINT32(s, new_len); /* length (4 bytes) */ + Stream_Read_UINT32(s, new_len); /* length (4 bytes) */ if (Stream_GetRemainingLength(s) < new_len) goto fail; - new_data = (BYTE*) realloc(bitmapData->data, new_len); + new_data = (BYTE*)realloc(bitmapData->data, new_len); if (!new_data) goto fail; @@ -2253,42 +2177,40 @@ fail: free_cache_bitmap_v3_order(update->context, cache_bitmap_v3); return NULL; } -int update_approximate_cache_bitmap_v3_order(CACHE_BITMAP_V3_ORDER* - cache_bitmap_v3, UINT16* flags) +int update_approximate_cache_bitmap_v3_order(CACHE_BITMAP_V3_ORDER* cache_bitmap_v3, UINT16* flags) { BITMAP_DATA_EX* bitmapData = &cache_bitmap_v3->bitmapData; return 64 + bitmapData->length; } -BOOL update_write_cache_bitmap_v3_order(wStream* s, - CACHE_BITMAP_V3_ORDER* cache_bitmap_v3, UINT16* flags) +BOOL update_write_cache_bitmap_v3_order(wStream* s, CACHE_BITMAP_V3_ORDER* cache_bitmap_v3, + UINT16* flags) { BYTE bitsPerPixelId; BITMAP_DATA_EX* bitmapData; - if (!Stream_EnsureRemainingCapacity(s, - update_approximate_cache_bitmap_v3_order(cache_bitmap_v3, flags))) + if (!Stream_EnsureRemainingCapacity( + s, update_approximate_cache_bitmap_v3_order(cache_bitmap_v3, flags))) return FALSE; bitmapData = &cache_bitmap_v3->bitmapData; bitsPerPixelId = BPP_CBR23[cache_bitmap_v3->bpp]; *flags = (cache_bitmap_v3->cacheId & 0x00000003) | - ((cache_bitmap_v3->flags << 7) & 0x0000FF80) | - ((bitsPerPixelId << 3) & 0x00000078); + ((cache_bitmap_v3->flags << 7) & 0x0000FF80) | ((bitsPerPixelId << 3) & 0x00000078); Stream_Write_UINT16(s, cache_bitmap_v3->cacheIndex); /* cacheIndex (2 bytes) */ - Stream_Write_UINT32(s, cache_bitmap_v3->key1); /* key1 (4 bytes) */ - Stream_Write_UINT32(s, cache_bitmap_v3->key2); /* key2 (4 bytes) */ + Stream_Write_UINT32(s, cache_bitmap_v3->key1); /* key1 (4 bytes) */ + Stream_Write_UINT32(s, cache_bitmap_v3->key2); /* key2 (4 bytes) */ Stream_Write_UINT8(s, bitmapData->bpp); - Stream_Write_UINT8(s, 0); /* reserved1 (1 byte) */ - Stream_Write_UINT8(s, 0); /* reserved2 (1 byte) */ + Stream_Write_UINT8(s, 0); /* reserved1 (1 byte) */ + Stream_Write_UINT8(s, 0); /* reserved2 (1 byte) */ Stream_Write_UINT8(s, bitmapData->codecID); /* codecID (1 byte) */ - Stream_Write_UINT16(s, bitmapData->width); /* width (2 bytes) */ + Stream_Write_UINT16(s, bitmapData->width); /* width (2 bytes) */ Stream_Write_UINT16(s, bitmapData->height); /* height (2 bytes) */ Stream_Write_UINT32(s, bitmapData->length); /* length (4 bytes) */ Stream_Write(s, bitmapData->data, bitmapData->length); return TRUE; } static CACHE_COLOR_TABLE_ORDER* update_read_cache_color_table_order(rdpUpdate* update, wStream* s, - UINT16 flags) + UINT16 flags) { int i; UINT32* colorTable; @@ -2300,9 +2222,8 @@ static CACHE_COLOR_TABLE_ORDER* update_read_cache_color_table_order(rdpUpdate* u if (Stream_GetRemainingLength(s) < 3) goto fail; - Stream_Read_UINT8(s, cache_color_table->cacheIndex); /* cacheIndex (1 byte) */ - Stream_Read_UINT16(s, - cache_color_table->numberColors); /* numberColors (2 bytes) */ + Stream_Read_UINT8(s, cache_color_table->cacheIndex); /* cacheIndex (1 byte) */ + Stream_Read_UINT16(s, cache_color_table->numberColors); /* numberColors (2 bytes) */ if (cache_color_table->numberColors != 256) { @@ -2313,9 +2234,9 @@ static CACHE_COLOR_TABLE_ORDER* update_read_cache_color_table_order(rdpUpdate* u if (Stream_GetRemainingLength(s) < cache_color_table->numberColors * 4) goto fail; - colorTable = (UINT32*) &cache_color_table->colorTable; + colorTable = (UINT32*)&cache_color_table->colorTable; - for (i = 0; i < (int) cache_color_table->numberColors; i++) + for (i = 0; i < (int)cache_color_table->numberColors; i++) update_read_color_quad(s, &colorTable[i]); return cache_color_table; @@ -2323,14 +2244,14 @@ fail: free_cache_color_table_order(update->context, cache_color_table); return NULL; } -int update_approximate_cache_color_table_order( - const CACHE_COLOR_TABLE_ORDER* cache_color_table, UINT16* flags) +int update_approximate_cache_color_table_order(const CACHE_COLOR_TABLE_ORDER* cache_color_table, + UINT16* flags) { return 16 + (256 * 4); } BOOL update_write_cache_color_table_order(wStream* s, - const CACHE_COLOR_TABLE_ORDER* cache_color_table, - UINT16* flags) + const CACHE_COLOR_TABLE_ORDER* cache_color_table, + UINT16* flags) { int i, inf; UINT32* colorTable; @@ -2343,20 +2264,18 @@ BOOL update_write_cache_color_table_order(wStream* s, if (!Stream_EnsureRemainingCapacity(s, inf)) return FALSE; - Stream_Write_UINT8(s, cache_color_table->cacheIndex); /* cacheIndex (1 byte) */ - Stream_Write_UINT16(s, - cache_color_table->numberColors); /* numberColors (2 bytes) */ - colorTable = (UINT32*) &cache_color_table->colorTable; + Stream_Write_UINT8(s, cache_color_table->cacheIndex); /* cacheIndex (1 byte) */ + Stream_Write_UINT16(s, cache_color_table->numberColors); /* numberColors (2 bytes) */ + colorTable = (UINT32*)&cache_color_table->colorTable; - for (i = 0; i < (int) cache_color_table->numberColors; i++) + for (i = 0; i < (int)cache_color_table->numberColors; i++) { update_write_color_quad(s, colorTable[i]); } return TRUE; } -static CACHE_GLYPH_ORDER* update_read_cache_glyph_order(rdpUpdate* update, wStream* s, - UINT16 flags) +static CACHE_GLYPH_ORDER* update_read_cache_glyph_order(rdpUpdate* update, wStream* s, UINT16 flags) { UINT32 i; CACHE_GLYPH_ORDER* cache_glyph_order = calloc(1, sizeof(CACHE_GLYPH_ORDER)); @@ -2388,7 +2307,7 @@ static CACHE_GLYPH_ORDER* update_read_cache_glyph_order(rdpUpdate* update, wStre if (Stream_GetRemainingLength(s) < glyph->cb) goto fail; - glyph->aj = (BYTE*) malloc(glyph->cb); + glyph->aj = (BYTE*)malloc(glyph->cb); if (!glyph->aj) goto fail; @@ -2406,7 +2325,8 @@ static CACHE_GLYPH_ORDER* update_read_cache_glyph_order(rdpUpdate* update, wStre if (Stream_GetRemainingLength(s) < sizeof(WCHAR) * cache_glyph_order->cGlyphs) goto fail; - Stream_Read_UTF16_String(s, cache_glyph_order->unicodeCharacters, cache_glyph_order->cGlyphs); + Stream_Read_UTF16_String(s, cache_glyph_order->unicodeCharacters, + cache_glyph_order->cGlyphs); } return cache_glyph_order; @@ -2414,14 +2334,11 @@ fail: free_cache_glyph_order(update->context, cache_glyph_order); return NULL; } -int update_approximate_cache_glyph_order( - const CACHE_GLYPH_ORDER* cache_glyph, UINT16* flags) +int update_approximate_cache_glyph_order(const CACHE_GLYPH_ORDER* cache_glyph, UINT16* flags) { return 2 + cache_glyph->cGlyphs * 32; } -BOOL update_write_cache_glyph_order(wStream* s, - const CACHE_GLYPH_ORDER* cache_glyph, - UINT16* flags) +BOOL update_write_cache_glyph_order(wStream* s, const CACHE_GLYPH_ORDER* cache_glyph, UINT16* flags) { int i, inf; INT16 lsi16; @@ -2434,7 +2351,7 @@ BOOL update_write_cache_glyph_order(wStream* s, Stream_Write_UINT8(s, cache_glyph->cacheId); /* cacheId (1 byte) */ Stream_Write_UINT8(s, cache_glyph->cGlyphs); /* cGlyphs (1 byte) */ - for (i = 0; i < (int) cache_glyph->cGlyphs; i++) + for (i = 0; i < (int)cache_glyph->cGlyphs; i++) { UINT32 cb; glyph = &cache_glyph->glyphData[i]; @@ -2442,7 +2359,7 @@ BOOL update_write_cache_glyph_order(wStream* s, lsi16 = glyph->x; Stream_Write_UINT16(s, lsi16); /* x (2 bytes) */ lsi16 = glyph->y; - Stream_Write_UINT16(s, lsi16); /* y (2 bytes) */ + Stream_Write_UINT16(s, lsi16); /* y (2 bytes) */ Stream_Write_UINT16(s, glyph->cx); /* cx (2 bytes) */ Stream_Write_UINT16(s, glyph->cy); /* cy (2 bytes) */ cb = ((glyph->cx + 7) / 8) * glyph->cy; @@ -2458,7 +2375,7 @@ BOOL update_write_cache_glyph_order(wStream* s, return TRUE; } static CACHE_GLYPH_V2_ORDER* update_read_cache_glyph_v2_order(rdpUpdate* update, wStream* s, - UINT16 flags) + UINT16 flags) { UINT32 i; CACHE_GLYPH_V2_ORDER* cache_glyph_v2 = calloc(1, sizeof(CACHE_GLYPH_V2_ORDER)); @@ -2479,8 +2396,7 @@ static CACHE_GLYPH_V2_ORDER* update_read_cache_glyph_v2_order(rdpUpdate* update, Stream_Read_UINT8(s, glyph->cacheIndex); - if (!update_read_2byte_signed(s, &glyph->x) || - !update_read_2byte_signed(s, &glyph->y) || + if (!update_read_2byte_signed(s, &glyph->x) || !update_read_2byte_signed(s, &glyph->y) || !update_read_2byte_unsigned(s, &glyph->cx) || !update_read_2byte_unsigned(s, &glyph->cy)) { @@ -2493,7 +2409,7 @@ static CACHE_GLYPH_V2_ORDER* update_read_cache_glyph_v2_order(rdpUpdate* update, if (Stream_GetRemainingLength(s) < glyph->cb) goto fail; - glyph->aj = (BYTE*) malloc(glyph->cb); + glyph->aj = (BYTE*)malloc(glyph->cb); if (!glyph->aj) goto fail; @@ -2519,13 +2435,12 @@ fail: free_cache_glyph_v2_order(update->context, cache_glyph_v2); return NULL; } -int update_approximate_cache_glyph_v2_order( - const CACHE_GLYPH_V2_ORDER* cache_glyph_v2, UINT16* flags) +int update_approximate_cache_glyph_v2_order(const CACHE_GLYPH_V2_ORDER* cache_glyph_v2, + UINT16* flags) { return 8 + cache_glyph_v2->cGlyphs * 32; } -BOOL update_write_cache_glyph_v2_order(wStream* s, - const CACHE_GLYPH_V2_ORDER* cache_glyph_v2, +BOOL update_write_cache_glyph_v2_order(wStream* s, const CACHE_GLYPH_V2_ORDER* cache_glyph_v2, UINT16* flags) { UINT32 i, inf; @@ -2534,8 +2449,7 @@ BOOL update_write_cache_glyph_v2_order(wStream* s, if (!Stream_EnsureRemainingCapacity(s, inf)) return FALSE; - *flags = (cache_glyph_v2->cacheId & 0x000F) | - ((cache_glyph_v2->flags & 0x000F) << 4) | + *flags = (cache_glyph_v2->cacheId & 0x000F) | ((cache_glyph_v2->flags & 0x000F) << 4) | ((cache_glyph_v2->cGlyphs & 0x00FF) << 8); for (i = 0; i < cache_glyph_v2->cGlyphs; i++) @@ -2544,8 +2458,7 @@ BOOL update_write_cache_glyph_v2_order(wStream* s, const GLYPH_DATA_V2* glyph = &cache_glyph_v2->glyphData[i]; Stream_Write_UINT8(s, glyph->cacheIndex); - if (!update_write_2byte_signed(s, glyph->x) || - !update_write_2byte_signed(s, glyph->y) || + if (!update_write_2byte_signed(s, glyph->x) || !update_write_2byte_signed(s, glyph->y) || !update_write_2byte_unsigned(s, glyph->cx) || !update_write_2byte_unsigned(s, glyph->cy)) { @@ -2588,8 +2501,7 @@ static BOOL update_decompress_brush(wStream* s, BYTE* output, BYTE bpp) for (k = 0; k < bytesPerPixel; k++) { - output[((y * 8 + x) * bytesPerPixel) + k] = palette[(index * bytesPerPixel) + - k]; + output[((y * 8 + x) * bytesPerPixel) + k] = palette[(index * bytesPerPixel) + k]; } } } @@ -2600,8 +2512,7 @@ static BOOL update_compress_brush(wStream* s, const BYTE* input, BYTE bpp) { return FALSE; } -static CACHE_BRUSH_ORDER* update_read_cache_brush_order(rdpUpdate* update, wStream* s, - UINT16 flags) +static CACHE_BRUSH_ORDER* update_read_cache_brush_order(rdpUpdate* update, wStream* s, UINT16 flags) { int i; BYTE iBitmapFormat; @@ -2615,15 +2526,15 @@ static CACHE_BRUSH_ORDER* update_read_cache_brush_order(rdpUpdate* update, wStre goto fail; Stream_Read_UINT8(s, cache_brush->index); /* cacheEntry (1 byte) */ - Stream_Read_UINT8(s, iBitmapFormat); /* iBitmapFormat (1 byte) */ + Stream_Read_UINT8(s, iBitmapFormat); /* iBitmapFormat (1 byte) */ if (iBitmapFormat > ARRAYSIZE(BMF_BPP)) goto fail; cache_brush->bpp = BMF_BPP[iBitmapFormat]; - Stream_Read_UINT8(s, cache_brush->cx); /* cx (1 byte) */ - Stream_Read_UINT8(s, cache_brush->cy); /* cy (1 byte) */ - Stream_Read_UINT8(s, cache_brush->style); /* style (1 byte) */ + Stream_Read_UINT8(s, cache_brush->cx); /* cx (1 byte) */ + Stream_Read_UINT8(s, cache_brush->cy); /* cy (1 byte) */ + Stream_Read_UINT8(s, cache_brush->style); /* style (1 byte) */ Stream_Read_UINT8(s, cache_brush->length); /* iBytes (1 byte) */ if ((cache_brush->cx == 8) && (cache_brush->cy == 8)) @@ -2632,7 +2543,7 @@ static CACHE_BRUSH_ORDER* update_read_cache_brush_order(rdpUpdate* update, wStre { if (cache_brush->length != 8) { - WLog_Print(update->log, WLOG_ERROR, "incompatible 1bpp brush of length:%"PRIu32"", + WLog_Print(update->log, WLOG_ERROR, "incompatible 1bpp brush of length:%" PRIu32 "", cache_brush->length); goto fail; } @@ -2682,14 +2593,11 @@ fail: free_cache_brush_order(update->context, cache_brush); return NULL; } -int update_approximate_cache_brush_order( - const CACHE_BRUSH_ORDER* cache_brush, UINT16* flags) +int update_approximate_cache_brush_order(const CACHE_BRUSH_ORDER* cache_brush, UINT16* flags) { return 64; } -BOOL update_write_cache_brush_order(wStream* s, - const CACHE_BRUSH_ORDER* cache_brush, - UINT16* flags) +BOOL update_write_cache_brush_order(wStream* s, const CACHE_BRUSH_ORDER* cache_brush, UINT16* flags) { int i; BYTE iBitmapFormat; @@ -2700,11 +2608,11 @@ BOOL update_write_cache_brush_order(wStream* s, return FALSE; iBitmapFormat = BPP_BMF[cache_brush->bpp]; - Stream_Write_UINT8(s, cache_brush->index); /* cacheEntry (1 byte) */ - Stream_Write_UINT8(s, iBitmapFormat); /* iBitmapFormat (1 byte) */ - Stream_Write_UINT8(s, cache_brush->cx); /* cx (1 byte) */ - Stream_Write_UINT8(s, cache_brush->cy); /* cy (1 byte) */ - Stream_Write_UINT8(s, cache_brush->style); /* style (1 byte) */ + Stream_Write_UINT8(s, cache_brush->index); /* cacheEntry (1 byte) */ + Stream_Write_UINT8(s, iBitmapFormat); /* iBitmapFormat (1 byte) */ + Stream_Write_UINT8(s, cache_brush->cx); /* cx (1 byte) */ + Stream_Write_UINT8(s, cache_brush->cy); /* cy (1 byte) */ + Stream_Write_UINT8(s, cache_brush->style); /* style (1 byte) */ Stream_Write_UINT8(s, cache_brush->length); /* iBytes (1 byte) */ if ((cache_brush->cx == 8) && (cache_brush->cy == 8)) @@ -2713,7 +2621,7 @@ BOOL update_write_cache_brush_order(wStream* s, { if (cache_brush->length != 8) { - WLog_ERR(TAG, "incompatible 1bpp brush of length:%"PRIu32"", cache_brush->length); + WLog_ERR(TAG, "incompatible 1bpp brush of length:%" PRIu32 "", cache_brush->length); return FALSE; } @@ -2753,8 +2661,9 @@ BOOL update_write_cache_brush_order(wStream* s, return TRUE; } /* Alternate Secondary Drawing Orders */ -static BOOL update_read_create_offscreen_bitmap_order(wStream* s, - CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap) +static BOOL +update_read_create_offscreen_bitmap_order(wStream* s, + CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap) { UINT16 flags; BOOL deleteListPresent; @@ -2809,20 +2718,18 @@ static BOOL update_read_create_offscreen_bitmap_order(wStream* s, int update_approximate_create_offscreen_bitmap_order( const CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap) { - const OFFSCREEN_DELETE_LIST* deleteList = & - (create_offscreen_bitmap->deleteList); + const OFFSCREEN_DELETE_LIST* deleteList = &(create_offscreen_bitmap->deleteList); return 32 + deleteList->cIndices * 2; } BOOL update_write_create_offscreen_bitmap_order( - wStream* s, - const CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap) + wStream* s, const CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap) { UINT16 flags; BOOL deleteListPresent; const OFFSCREEN_DELETE_LIST* deleteList; - if (!Stream_EnsureRemainingCapacity(s, - update_approximate_create_offscreen_bitmap_order(create_offscreen_bitmap))) + if (!Stream_EnsureRemainingCapacity( + s, update_approximate_create_offscreen_bitmap_order(create_offscreen_bitmap))) return FALSE; deleteList = &(create_offscreen_bitmap->deleteList); @@ -2832,7 +2739,7 @@ BOOL update_write_create_offscreen_bitmap_order( if (deleteListPresent) flags |= 0x8000; - Stream_Write_UINT16(s, flags); /* flags (2 bytes) */ + Stream_Write_UINT16(s, flags); /* flags (2 bytes) */ Stream_Write_UINT16(s, create_offscreen_bitmap->cx); /* cx (2 bytes) */ Stream_Write_UINT16(s, create_offscreen_bitmap->cy); /* cy (2 bytes) */ @@ -2841,7 +2748,7 @@ BOOL update_write_create_offscreen_bitmap_order( int i; Stream_Write_UINT16(s, deleteList->cIndices); - for (i = 0; i < (int) deleteList->cIndices; i++) + for (i = 0; i < (int)deleteList->cIndices; i++) { Stream_Write_UINT16(s, deleteList->indices[i]); } @@ -2849,8 +2756,7 @@ BOOL update_write_create_offscreen_bitmap_order( return TRUE; } -static BOOL update_read_switch_surface_order(wStream* s, - SWITCH_SURFACE_ORDER* switch_surface) +static BOOL update_read_switch_surface_order(wStream* s, SWITCH_SURFACE_ORDER* switch_surface) { if (Stream_GetRemainingLength(s) < 2) return FALSE; @@ -2858,15 +2764,13 @@ static BOOL update_read_switch_surface_order(wStream* s, Stream_Read_UINT16(s, switch_surface->bitmapId); /* bitmapId (2 bytes) */ return TRUE; } -int update_approximate_switch_surface_order( - const SWITCH_SURFACE_ORDER* switch_surface) +int update_approximate_switch_surface_order(const SWITCH_SURFACE_ORDER* switch_surface) { return 2; } -BOOL update_write_switch_surface_order( - wStream* s, const SWITCH_SURFACE_ORDER* switch_surface) +BOOL update_write_switch_surface_order(wStream* s, const SWITCH_SURFACE_ORDER* switch_surface) { - int inf = update_approximate_switch_surface_order(switch_surface); + int inf = update_approximate_switch_surface_order(switch_surface); if (!Stream_EnsureRemainingCapacity(s, inf)) return FALSE; @@ -2874,40 +2778,34 @@ BOOL update_write_switch_surface_order( Stream_Write_UINT16(s, switch_surface->bitmapId); /* bitmapId (2 bytes) */ return TRUE; } -static BOOL update_read_create_nine_grid_bitmap_order( - wStream* s, - CREATE_NINE_GRID_BITMAP_ORDER* create_nine_grid_bitmap) +static BOOL +update_read_create_nine_grid_bitmap_order(wStream* s, + CREATE_NINE_GRID_BITMAP_ORDER* create_nine_grid_bitmap) { NINE_GRID_BITMAP_INFO* nineGridInfo; if (Stream_GetRemainingLength(s) < 19) return FALSE; - Stream_Read_UINT8(s, - create_nine_grid_bitmap->bitmapBpp); /* bitmapBpp (1 byte) */ + Stream_Read_UINT8(s, create_nine_grid_bitmap->bitmapBpp); /* bitmapBpp (1 byte) */ - if ((create_nine_grid_bitmap->bitmapBpp < 1) - || (create_nine_grid_bitmap->bitmapBpp > 32)) + if ((create_nine_grid_bitmap->bitmapBpp < 1) || (create_nine_grid_bitmap->bitmapBpp > 32)) { - WLog_ERR(TAG, "invalid bpp value %"PRIu32"", create_nine_grid_bitmap->bitmapBpp); + WLog_ERR(TAG, "invalid bpp value %" PRIu32 "", create_nine_grid_bitmap->bitmapBpp); return FALSE; } - Stream_Read_UINT16(s, - create_nine_grid_bitmap->bitmapId); /* bitmapId (2 bytes) */ + Stream_Read_UINT16(s, create_nine_grid_bitmap->bitmapId); /* bitmapId (2 bytes) */ nineGridInfo = &(create_nine_grid_bitmap->nineGridInfo); - Stream_Read_UINT32(s, nineGridInfo->flFlags); /* flFlags (4 bytes) */ - Stream_Read_UINT16(s, nineGridInfo->ulLeftWidth); /* ulLeftWidth (2 bytes) */ - Stream_Read_UINT16(s, nineGridInfo->ulRightWidth); /* ulRightWidth (2 bytes) */ - Stream_Read_UINT16(s, nineGridInfo->ulTopHeight); /* ulTopHeight (2 bytes) */ - Stream_Read_UINT16(s, - nineGridInfo->ulBottomHeight); /* ulBottomHeight (2 bytes) */ - update_read_colorref(s, - &nineGridInfo->crTransparent); /* crTransparent (4 bytes) */ + Stream_Read_UINT32(s, nineGridInfo->flFlags); /* flFlags (4 bytes) */ + Stream_Read_UINT16(s, nineGridInfo->ulLeftWidth); /* ulLeftWidth (2 bytes) */ + Stream_Read_UINT16(s, nineGridInfo->ulRightWidth); /* ulRightWidth (2 bytes) */ + Stream_Read_UINT16(s, nineGridInfo->ulTopHeight); /* ulTopHeight (2 bytes) */ + Stream_Read_UINT16(s, nineGridInfo->ulBottomHeight); /* ulBottomHeight (2 bytes) */ + update_read_colorref(s, &nineGridInfo->crTransparent); /* crTransparent (4 bytes) */ return TRUE; } -static BOOL update_read_frame_marker_order(wStream* s, - FRAME_MARKER_ORDER* frame_marker) +static BOOL update_read_frame_marker_order(wStream* s, FRAME_MARKER_ORDER* frame_marker) { if (Stream_GetRemainingLength(s) < 4) return FALSE; @@ -2915,154 +2813,131 @@ static BOOL update_read_frame_marker_order(wStream* s, Stream_Read_UINT32(s, frame_marker->action); /* action (4 bytes) */ return TRUE; } -static BOOL update_read_stream_bitmap_first_order( - wStream* s, STREAM_BITMAP_FIRST_ORDER* stream_bitmap_first) +static BOOL update_read_stream_bitmap_first_order(wStream* s, + STREAM_BITMAP_FIRST_ORDER* stream_bitmap_first) { - if (Stream_GetRemainingLength(s) < 10) // 8 + 2 at least + if (Stream_GetRemainingLength(s) < 10) // 8 + 2 at least return FALSE; - Stream_Read_UINT8(s, - stream_bitmap_first->bitmapFlags); /* bitmapFlags (1 byte) */ - Stream_Read_UINT8(s, stream_bitmap_first->bitmapBpp); /* bitmapBpp (1 byte) */ + Stream_Read_UINT8(s, stream_bitmap_first->bitmapFlags); /* bitmapFlags (1 byte) */ + Stream_Read_UINT8(s, stream_bitmap_first->bitmapBpp); /* bitmapBpp (1 byte) */ - if ((stream_bitmap_first->bitmapBpp < 1) - || (stream_bitmap_first->bitmapBpp > 32)) + if ((stream_bitmap_first->bitmapBpp < 1) || (stream_bitmap_first->bitmapBpp > 32)) { - WLog_ERR(TAG, "invalid bpp value %"PRIu32"", stream_bitmap_first->bitmapBpp); + WLog_ERR(TAG, "invalid bpp value %" PRIu32 "", stream_bitmap_first->bitmapBpp); return FALSE; } - Stream_Read_UINT16(s, - stream_bitmap_first->bitmapType); /* bitmapType (2 bytes) */ - Stream_Read_UINT16(s, - stream_bitmap_first->bitmapWidth); /* bitmapWidth (2 bytes) */ - Stream_Read_UINT16(s, - stream_bitmap_first->bitmapHeight); /* bitmapHeigth (2 bytes) */ + Stream_Read_UINT16(s, stream_bitmap_first->bitmapType); /* bitmapType (2 bytes) */ + Stream_Read_UINT16(s, stream_bitmap_first->bitmapWidth); /* bitmapWidth (2 bytes) */ + Stream_Read_UINT16(s, stream_bitmap_first->bitmapHeight); /* bitmapHeigth (2 bytes) */ if (stream_bitmap_first->bitmapFlags & STREAM_BITMAP_V2) { if (Stream_GetRemainingLength(s) < 4) return FALSE; - Stream_Read_UINT32(s, - stream_bitmap_first->bitmapSize); /* bitmapSize (4 bytes) */ + Stream_Read_UINT32(s, stream_bitmap_first->bitmapSize); /* bitmapSize (4 bytes) */ } else { if (Stream_GetRemainingLength(s) < 2) return FALSE; - Stream_Read_UINT16(s, - stream_bitmap_first->bitmapSize); /* bitmapSize (2 bytes) */ + Stream_Read_UINT16(s, stream_bitmap_first->bitmapSize); /* bitmapSize (2 bytes) */ } - FIELD_SKIP_BUFFER16(s, - stream_bitmap_first->bitmapBlockSize); /* bitmapBlockSize(2 bytes) + bitmapBlock */ + FIELD_SKIP_BUFFER16( + s, stream_bitmap_first->bitmapBlockSize); /* bitmapBlockSize(2 bytes) + bitmapBlock */ return TRUE; } -static BOOL update_read_stream_bitmap_next_order( - wStream* s, STREAM_BITMAP_NEXT_ORDER* stream_bitmap_next) +static BOOL update_read_stream_bitmap_next_order(wStream* s, + STREAM_BITMAP_NEXT_ORDER* stream_bitmap_next) { if (Stream_GetRemainingLength(s) < 5) return FALSE; - Stream_Read_UINT8(s, - stream_bitmap_next->bitmapFlags); /* bitmapFlags (1 byte) */ - Stream_Read_UINT16(s, - stream_bitmap_next->bitmapType); /* bitmapType (2 bytes) */ - FIELD_SKIP_BUFFER16(s, - stream_bitmap_next->bitmapBlockSize); /* bitmapBlockSize(2 bytes) + bitmapBlock */ + Stream_Read_UINT8(s, stream_bitmap_next->bitmapFlags); /* bitmapFlags (1 byte) */ + Stream_Read_UINT16(s, stream_bitmap_next->bitmapType); /* bitmapType (2 bytes) */ + FIELD_SKIP_BUFFER16( + s, stream_bitmap_next->bitmapBlockSize); /* bitmapBlockSize(2 bytes) + bitmapBlock */ return TRUE; } -static BOOL update_read_draw_gdiplus_first_order( - wStream* s, DRAW_GDIPLUS_FIRST_ORDER* draw_gdiplus_first) +static BOOL update_read_draw_gdiplus_first_order(wStream* s, + DRAW_GDIPLUS_FIRST_ORDER* draw_gdiplus_first) { if (Stream_GetRemainingLength(s) < 11) return FALSE; - Stream_Seek_UINT8(s); /* pad1Octet (1 byte) */ - Stream_Read_UINT16(s, draw_gdiplus_first->cbSize); /* cbSize (2 bytes) */ - Stream_Read_UINT32(s, - draw_gdiplus_first->cbTotalSize); /* cbTotalSize (4 bytes) */ - Stream_Read_UINT32(s, - draw_gdiplus_first->cbTotalEmfSize); /* cbTotalEmfSize (4 bytes) */ - return Stream_SafeSeek(s, draw_gdiplus_first->cbSize); /* emfRecords */ + Stream_Seek_UINT8(s); /* pad1Octet (1 byte) */ + Stream_Read_UINT16(s, draw_gdiplus_first->cbSize); /* cbSize (2 bytes) */ + Stream_Read_UINT32(s, draw_gdiplus_first->cbTotalSize); /* cbTotalSize (4 bytes) */ + Stream_Read_UINT32(s, draw_gdiplus_first->cbTotalEmfSize); /* cbTotalEmfSize (4 bytes) */ + return Stream_SafeSeek(s, draw_gdiplus_first->cbSize); /* emfRecords */ } -static BOOL update_read_draw_gdiplus_next_order( - wStream* s, DRAW_GDIPLUS_NEXT_ORDER* draw_gdiplus_next) +static BOOL update_read_draw_gdiplus_next_order(wStream* s, + DRAW_GDIPLUS_NEXT_ORDER* draw_gdiplus_next) { if (Stream_GetRemainingLength(s) < 3) return FALSE; - Stream_Seek_UINT8(s); /* pad1Octet (1 byte) */ - FIELD_SKIP_BUFFER16(s, - draw_gdiplus_next->cbSize); /* cbSize(2 bytes) + emfRecords */ + Stream_Seek_UINT8(s); /* pad1Octet (1 byte) */ + FIELD_SKIP_BUFFER16(s, draw_gdiplus_next->cbSize); /* cbSize(2 bytes) + emfRecords */ return TRUE; } -static BOOL update_read_draw_gdiplus_end_order( - wStream* s, DRAW_GDIPLUS_END_ORDER* draw_gdiplus_end) +static BOOL update_read_draw_gdiplus_end_order(wStream* s, DRAW_GDIPLUS_END_ORDER* draw_gdiplus_end) { if (Stream_GetRemainingLength(s) < 11) return FALSE; - Stream_Seek_UINT8(s); /* pad1Octet (1 byte) */ - Stream_Read_UINT16(s, draw_gdiplus_end->cbSize); /* cbSize (2 bytes) */ - Stream_Read_UINT32(s, - draw_gdiplus_end->cbTotalSize); /* cbTotalSize (4 bytes) */ - Stream_Read_UINT32(s, - draw_gdiplus_end->cbTotalEmfSize); /* cbTotalEmfSize (4 bytes) */ - return Stream_SafeSeek(s, draw_gdiplus_end->cbSize); /* emfRecords */ + Stream_Seek_UINT8(s); /* pad1Octet (1 byte) */ + Stream_Read_UINT16(s, draw_gdiplus_end->cbSize); /* cbSize (2 bytes) */ + Stream_Read_UINT32(s, draw_gdiplus_end->cbTotalSize); /* cbTotalSize (4 bytes) */ + Stream_Read_UINT32(s, draw_gdiplus_end->cbTotalEmfSize); /* cbTotalEmfSize (4 bytes) */ + return Stream_SafeSeek(s, draw_gdiplus_end->cbSize); /* emfRecords */ } -static BOOL update_read_draw_gdiplus_cache_first_order( - wStream* s, DRAW_GDIPLUS_CACHE_FIRST_ORDER* draw_gdiplus_cache_first) +static BOOL +update_read_draw_gdiplus_cache_first_order(wStream* s, + DRAW_GDIPLUS_CACHE_FIRST_ORDER* draw_gdiplus_cache_first) { if (Stream_GetRemainingLength(s) < 11) return FALSE; - Stream_Read_UINT8(s, draw_gdiplus_cache_first->flags); /* flags (1 byte) */ - Stream_Read_UINT16(s, - draw_gdiplus_cache_first->cacheType); /* cacheType (2 bytes) */ - Stream_Read_UINT16(s, - draw_gdiplus_cache_first->cacheIndex); /* cacheIndex (2 bytes) */ - Stream_Read_UINT16(s, draw_gdiplus_cache_first->cbSize); /* cbSize (2 bytes) */ - Stream_Read_UINT32(s, - draw_gdiplus_cache_first->cbTotalSize); /* cbTotalSize (4 bytes) */ - return Stream_SafeSeek(s, draw_gdiplus_cache_first->cbSize); /* emfRecords */ + Stream_Read_UINT8(s, draw_gdiplus_cache_first->flags); /* flags (1 byte) */ + Stream_Read_UINT16(s, draw_gdiplus_cache_first->cacheType); /* cacheType (2 bytes) */ + Stream_Read_UINT16(s, draw_gdiplus_cache_first->cacheIndex); /* cacheIndex (2 bytes) */ + Stream_Read_UINT16(s, draw_gdiplus_cache_first->cbSize); /* cbSize (2 bytes) */ + Stream_Read_UINT32(s, draw_gdiplus_cache_first->cbTotalSize); /* cbTotalSize (4 bytes) */ + return Stream_SafeSeek(s, draw_gdiplus_cache_first->cbSize); /* emfRecords */ } -static BOOL update_read_draw_gdiplus_cache_next_order( - wStream* s, DRAW_GDIPLUS_CACHE_NEXT_ORDER* draw_gdiplus_cache_next) +static BOOL +update_read_draw_gdiplus_cache_next_order(wStream* s, + DRAW_GDIPLUS_CACHE_NEXT_ORDER* draw_gdiplus_cache_next) { if (Stream_GetRemainingLength(s) < 7) return FALSE; - Stream_Read_UINT8(s, draw_gdiplus_cache_next->flags); /* flags (1 byte) */ - Stream_Read_UINT16(s, - draw_gdiplus_cache_next->cacheType); /* cacheType (2 bytes) */ - Stream_Read_UINT16(s, - draw_gdiplus_cache_next->cacheIndex); /* cacheIndex (2 bytes) */ - FIELD_SKIP_BUFFER16(s, - draw_gdiplus_cache_next->cbSize); /* cbSize(2 bytes) + emfRecords */ + Stream_Read_UINT8(s, draw_gdiplus_cache_next->flags); /* flags (1 byte) */ + Stream_Read_UINT16(s, draw_gdiplus_cache_next->cacheType); /* cacheType (2 bytes) */ + Stream_Read_UINT16(s, draw_gdiplus_cache_next->cacheIndex); /* cacheIndex (2 bytes) */ + FIELD_SKIP_BUFFER16(s, draw_gdiplus_cache_next->cbSize); /* cbSize(2 bytes) + emfRecords */ return TRUE; } -static BOOL update_read_draw_gdiplus_cache_end_order( - wStream* s, DRAW_GDIPLUS_CACHE_END_ORDER* draw_gdiplus_cache_end) +static BOOL +update_read_draw_gdiplus_cache_end_order(wStream* s, + DRAW_GDIPLUS_CACHE_END_ORDER* draw_gdiplus_cache_end) { if (Stream_GetRemainingLength(s) < 11) return FALSE; - Stream_Read_UINT8(s, draw_gdiplus_cache_end->flags); /* flags (1 byte) */ - Stream_Read_UINT16(s, - draw_gdiplus_cache_end->cacheType); /* cacheType (2 bytes) */ - Stream_Read_UINT16(s, - draw_gdiplus_cache_end->cacheIndex); /* cacheIndex (2 bytes) */ - Stream_Read_UINT16(s, draw_gdiplus_cache_end->cbSize); /* cbSize (2 bytes) */ - Stream_Read_UINT32(s, - draw_gdiplus_cache_end->cbTotalSize); /* cbTotalSize (4 bytes) */ - return Stream_SafeSeek(s, draw_gdiplus_cache_end->cbSize); /* emfRecords */ + Stream_Read_UINT8(s, draw_gdiplus_cache_end->flags); /* flags (1 byte) */ + Stream_Read_UINT16(s, draw_gdiplus_cache_end->cacheType); /* cacheType (2 bytes) */ + Stream_Read_UINT16(s, draw_gdiplus_cache_end->cacheIndex); /* cacheIndex (2 bytes) */ + Stream_Read_UINT16(s, draw_gdiplus_cache_end->cbSize); /* cbSize (2 bytes) */ + Stream_Read_UINT32(s, draw_gdiplus_cache_end->cbTotalSize); /* cbTotalSize (4 bytes) */ + return Stream_SafeSeek(s, draw_gdiplus_cache_end->cbSize); /* emfRecords */ } -static BOOL update_read_field_flags(wStream* s, UINT32* fieldFlags, - BYTE flags, - BYTE fieldBytes) +static BOOL update_read_field_flags(wStream* s, UINT32* fieldFlags, BYTE flags, BYTE fieldBytes) { int i; BYTE byte; @@ -3091,8 +2966,7 @@ static BOOL update_read_field_flags(wStream* s, UINT32* fieldFlags, return TRUE; } -BOOL update_write_field_flags(wStream* s, UINT32 fieldFlags, BYTE flags, - BYTE fieldBytes) +BOOL update_write_field_flags(wStream* s, UINT32 fieldFlags, BYTE flags, BYTE fieldBytes) { BYTE byte; @@ -3271,13 +3145,12 @@ static BOOL read_primary_order(wLog* log, const char* orderName, wStream* s, break; case ORDER_TYPE_MULTI_OPAQUE_RECT: - rc = update_read_multi_opaque_rect_order(s, orderInfo, - &(primary->multi_opaque_rect)); + rc = update_read_multi_opaque_rect_order(s, orderInfo, &(primary->multi_opaque_rect)); break; case ORDER_TYPE_MULTI_DRAW_NINE_GRID: rc = update_read_multi_draw_nine_grid_order(s, orderInfo, - &(primary->multi_draw_nine_grid)); + &(primary->multi_draw_nine_grid)); break; case ORDER_TYPE_LINE_TO: @@ -3329,7 +3202,8 @@ static BOOL read_primary_order(wLog* log, const char* orderName, wStream* s, break; default: - WLog_Print(log, WLOG_WARN, "Primary Drawing Order %s not supported, ignoring", orderName); + WLog_Print(log, WLOG_WARN, "Primary Drawing Order %s not supported, ignoring", + orderName); rc = TRUE; break; } @@ -3400,185 +3274,185 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags) switch (orderInfo->orderType) { case ORDER_TYPE_DSTBLT: - { - WLog_Print(update->log, WLOG_DEBUG, - "Primary Drawing Order %s rop=%s [0x%08"PRIx32"]", - orderName, - gdi_rop3_code_string(primary->dstblt.bRop), gdi_rop3_code(primary->dstblt.bRop)); - rc = IFCALLRESULT(FALSE, primary->DstBlt, context, &primary->dstblt); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s rop=%s [0x%08" PRIx32 "]", + orderName, gdi_rop3_code_string(primary->dstblt.bRop), + gdi_rop3_code(primary->dstblt.bRop)); + rc = IFCALLRESULT(FALSE, primary->DstBlt, context, &primary->dstblt); + } + break; case ORDER_TYPE_PATBLT: - { - WLog_Print(update->log, WLOG_DEBUG, - "Primary Drawing Order %s rop=%s [0x%08"PRIx32"]", orderName, - gdi_rop3_code_string(primary->patblt.bRop), gdi_rop3_code(primary->patblt.bRop)); - rc = IFCALLRESULT(FALSE, primary->PatBlt, context, &primary->patblt); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s rop=%s [0x%08" PRIx32 "]", + orderName, gdi_rop3_code_string(primary->patblt.bRop), + gdi_rop3_code(primary->patblt.bRop)); + rc = IFCALLRESULT(FALSE, primary->PatBlt, context, &primary->patblt); + } + break; case ORDER_TYPE_SCRBLT: - { - WLog_Print(update->log, WLOG_DEBUG, - "Primary Drawing Order %s rop=%s [0x%08"PRIx32"]", orderName, - gdi_rop3_code_string(primary->scrblt.bRop), gdi_rop3_code(primary->scrblt.bRop)); - rc = IFCALLRESULT(FALSE, primary->ScrBlt, context, &primary->scrblt); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s rop=%s [0x%08" PRIx32 "]", + orderName, gdi_rop3_code_string(primary->scrblt.bRop), + gdi_rop3_code(primary->scrblt.bRop)); + rc = IFCALLRESULT(FALSE, primary->ScrBlt, context, &primary->scrblt); + } + break; case ORDER_TYPE_OPAQUE_RECT: - { - WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); - rc = IFCALLRESULT(FALSE, primary->OpaqueRect, context, &primary->opaque_rect); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); + rc = IFCALLRESULT(FALSE, primary->OpaqueRect, context, &primary->opaque_rect); + } + break; case ORDER_TYPE_DRAW_NINE_GRID: - { - WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); - rc = IFCALLRESULT(FALSE, primary->DrawNineGrid, context, &primary->draw_nine_grid); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); + rc = IFCALLRESULT(FALSE, primary->DrawNineGrid, context, &primary->draw_nine_grid); + } + break; case ORDER_TYPE_MULTI_DSTBLT: - { - WLog_Print(update->log, WLOG_DEBUG, - "Primary Drawing Order %s rop=%s [0x%08"PRIx32"]", orderName, - gdi_rop3_code_string(primary->multi_dstblt.bRop), gdi_rop3_code(primary->multi_dstblt.bRop)); - rc = IFCALLRESULT(FALSE, primary->MultiDstBlt, context, &primary->multi_dstblt); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s rop=%s [0x%08" PRIx32 "]", + orderName, gdi_rop3_code_string(primary->multi_dstblt.bRop), + gdi_rop3_code(primary->multi_dstblt.bRop)); + rc = IFCALLRESULT(FALSE, primary->MultiDstBlt, context, &primary->multi_dstblt); + } + break; case ORDER_TYPE_MULTI_PATBLT: - { - WLog_Print(update->log, WLOG_DEBUG, - "Primary Drawing Order %s rop=%s [0x%08"PRIx32"]", orderName, - gdi_rop3_code_string(primary->multi_patblt.bRop), gdi_rop3_code(primary->multi_patblt.bRop)); - rc = IFCALLRESULT(FALSE, primary->MultiPatBlt, context, &primary->multi_patblt); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s rop=%s [0x%08" PRIx32 "]", + orderName, gdi_rop3_code_string(primary->multi_patblt.bRop), + gdi_rop3_code(primary->multi_patblt.bRop)); + rc = IFCALLRESULT(FALSE, primary->MultiPatBlt, context, &primary->multi_patblt); + } + break; case ORDER_TYPE_MULTI_SCRBLT: - { - WLog_Print(update->log, WLOG_DEBUG, - "Primary Drawing Order %s rop=%s [0x%08"PRIx32"]", orderName, - gdi_rop3_code_string(primary->multi_scrblt.bRop), gdi_rop3_code(primary->multi_scrblt.bRop)); - rc = IFCALLRESULT(FALSE, primary->MultiScrBlt, context, &primary->multi_scrblt); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s rop=%s [0x%08" PRIx32 "]", + orderName, gdi_rop3_code_string(primary->multi_scrblt.bRop), + gdi_rop3_code(primary->multi_scrblt.bRop)); + rc = IFCALLRESULT(FALSE, primary->MultiScrBlt, context, &primary->multi_scrblt); + } + break; case ORDER_TYPE_MULTI_OPAQUE_RECT: - { - WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); - rc = IFCALLRESULT(FALSE, primary->MultiOpaqueRect, context, &primary->multi_opaque_rect); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); + rc = + IFCALLRESULT(FALSE, primary->MultiOpaqueRect, context, &primary->multi_opaque_rect); + } + break; case ORDER_TYPE_MULTI_DRAW_NINE_GRID: - { - WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); - rc = IFCALLRESULT(FALSE, primary->MultiDrawNineGrid, context, &primary->multi_draw_nine_grid); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); + rc = IFCALLRESULT(FALSE, primary->MultiDrawNineGrid, context, + &primary->multi_draw_nine_grid); + } + break; case ORDER_TYPE_LINE_TO: - { - WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); - rc = IFCALLRESULT(FALSE, primary->LineTo, context, &primary->line_to); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); + rc = IFCALLRESULT(FALSE, primary->LineTo, context, &primary->line_to); + } + break; case ORDER_TYPE_POLYLINE: - { - WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); - rc = IFCALLRESULT(FALSE, primary->Polyline, context, &primary->polyline); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); + rc = IFCALLRESULT(FALSE, primary->Polyline, context, &primary->polyline); + } + break; case ORDER_TYPE_MEMBLT: - { - WLog_Print(update->log, WLOG_DEBUG, - "Primary Drawing Order %s rop=%s [0x%08"PRIx32"]", orderName, - gdi_rop3_code_string(primary->memblt.bRop), gdi_rop3_code(primary->memblt.bRop)); - rc = IFCALLRESULT(FALSE, primary->MemBlt, context, &primary->memblt); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s rop=%s [0x%08" PRIx32 "]", + orderName, gdi_rop3_code_string(primary->memblt.bRop), + gdi_rop3_code(primary->memblt.bRop)); + rc = IFCALLRESULT(FALSE, primary->MemBlt, context, &primary->memblt); + } + break; case ORDER_TYPE_MEM3BLT: - { - WLog_Print(update->log, WLOG_DEBUG, - "Primary Drawing Order %s rop=%s [0x%08"PRIx32"]", orderName, - gdi_rop3_code_string(primary->mem3blt.bRop), gdi_rop3_code(primary->mem3blt.bRop)); - rc = IFCALLRESULT(FALSE, primary->Mem3Blt, context, &primary->mem3blt); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s rop=%s [0x%08" PRIx32 "]", + orderName, gdi_rop3_code_string(primary->mem3blt.bRop), + gdi_rop3_code(primary->mem3blt.bRop)); + rc = IFCALLRESULT(FALSE, primary->Mem3Blt, context, &primary->mem3blt); + } + break; case ORDER_TYPE_SAVE_BITMAP: - { - WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); - rc = IFCALLRESULT(FALSE, primary->SaveBitmap, context, &primary->save_bitmap); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); + rc = IFCALLRESULT(FALSE, primary->SaveBitmap, context, &primary->save_bitmap); + } + break; case ORDER_TYPE_GLYPH_INDEX: - { - WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); - rc = IFCALLRESULT(FALSE, primary->GlyphIndex, context, &primary->glyph_index); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); + rc = IFCALLRESULT(FALSE, primary->GlyphIndex, context, &primary->glyph_index); + } + break; case ORDER_TYPE_FAST_INDEX: - { - WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); - rc = IFCALLRESULT(FALSE, primary->FastIndex, context, &primary->fast_index); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); + rc = IFCALLRESULT(FALSE, primary->FastIndex, context, &primary->fast_index); + } + break; case ORDER_TYPE_FAST_GLYPH: - { - WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); - rc = IFCALLRESULT(FALSE, primary->FastGlyph, context, &primary->fast_glyph); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); + rc = IFCALLRESULT(FALSE, primary->FastGlyph, context, &primary->fast_glyph); + } + break; case ORDER_TYPE_POLYGON_SC: - { - WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); - rc = IFCALLRESULT(FALSE, primary->PolygonSC, context, &primary->polygon_sc); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); + rc = IFCALLRESULT(FALSE, primary->PolygonSC, context, &primary->polygon_sc); + } + break; case ORDER_TYPE_POLYGON_CB: - { - WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); - rc = IFCALLRESULT(FALSE, primary->PolygonCB, context, &primary->polygon_cb); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); + rc = IFCALLRESULT(FALSE, primary->PolygonCB, context, &primary->polygon_cb); + } + break; case ORDER_TYPE_ELLIPSE_SC: - { - WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); - rc = IFCALLRESULT(FALSE, primary->EllipseSC, context, &primary->ellipse_sc); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); + rc = IFCALLRESULT(FALSE, primary->EllipseSC, context, &primary->ellipse_sc); + } + break; case ORDER_TYPE_ELLIPSE_CB: - { - WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); - rc = IFCALLRESULT(FALSE, primary->EllipseCB, context, &primary->ellipse_cb); - } - break; + { + WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName); + rc = IFCALLRESULT(FALSE, primary->EllipseCB, context, &primary->ellipse_cb); + } + break; default: - WLog_Print(update->log, WLOG_WARN, "Primary Drawing Order %s not supported", orderName); + WLog_Print(update->log, WLOG_WARN, "Primary Drawing Order %s not supported", orderName); break; } if (!rc) { - WLog_Print(update->log, WLOG_WARN, - "Primary Drawing Order %s failed", orderName); + WLog_Print(update->log, WLOG_WARN, "Primary Drawing Order %s failed", orderName); return FALSE; } @@ -3590,8 +3464,7 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags) return rc; } -static BOOL update_recv_secondary_order(rdpUpdate* update, wStream* s, - BYTE flags) +static BOOL update_recv_secondary_order(rdpUpdate* update, wStream* s, BYTE flags) { BOOL rc = FALSE; BYTE* next; @@ -3610,11 +3483,11 @@ static BOOL update_recv_secondary_order(rdpUpdate* update, wStream* s, } Stream_Read_UINT16(s, orderLength); /* orderLength (2 bytes) */ - Stream_Read_UINT16(s, extraFlags); /* extraFlags (2 bytes) */ - Stream_Read_UINT8(s, orderType); /* orderType (1 byte) */ - next = Stream_Pointer(s) + ((INT16) orderLength) + 7; + Stream_Read_UINT16(s, extraFlags); /* extraFlags (2 bytes) */ + Stream_Read_UINT8(s, orderType); /* orderType (1 byte) */ + next = Stream_Pointer(s) + ((INT16)orderLength) + 7; name = secondary_order_string(orderType); - WLog_Print(update->log, WLOG_DEBUG, "Secondary Drawing Order %s", name); + WLog_Print(update->log, WLOG_DEBUG, "Secondary Drawing Order %s", name); if (!check_secondary_order_supported(update->log, settings, orderType, name)) return FALSE; @@ -3623,91 +3496,95 @@ static BOOL update_recv_secondary_order(rdpUpdate* update, wStream* s, { case ORDER_TYPE_BITMAP_UNCOMPRESSED: case ORDER_TYPE_CACHE_BITMAP_COMPRESSED: - { - const BOOL compressed = (orderType == ORDER_TYPE_CACHE_BITMAP_COMPRESSED); - CACHE_BITMAP_ORDER* order = update_read_cache_bitmap_order(update, s, compressed, extraFlags); + { + const BOOL compressed = (orderType == ORDER_TYPE_CACHE_BITMAP_COMPRESSED); + CACHE_BITMAP_ORDER* order = + update_read_cache_bitmap_order(update, s, compressed, extraFlags); - if (order) - { - rc = IFCALLRESULT(FALSE, secondary->CacheBitmap, context, order); - free_cache_bitmap_order(context, order); - } + if (order) + { + rc = IFCALLRESULT(FALSE, secondary->CacheBitmap, context, order); + free_cache_bitmap_order(context, order); } - break; + } + break; case ORDER_TYPE_BITMAP_UNCOMPRESSED_V2: case ORDER_TYPE_BITMAP_COMPRESSED_V2: - { - const BOOL compressed = (orderType == ORDER_TYPE_BITMAP_COMPRESSED_V2); - CACHE_BITMAP_V2_ORDER* order = update_read_cache_bitmap_v2_order(update, s, compressed, extraFlags); + { + const BOOL compressed = (orderType == ORDER_TYPE_BITMAP_COMPRESSED_V2); + CACHE_BITMAP_V2_ORDER* order = + update_read_cache_bitmap_v2_order(update, s, compressed, extraFlags); - if (order) - { - rc = IFCALLRESULT(FALSE, secondary->CacheBitmapV2, context, order); - free_cache_bitmap_v2_order(context, order); - } + if (order) + { + rc = IFCALLRESULT(FALSE, secondary->CacheBitmapV2, context, order); + free_cache_bitmap_v2_order(context, order); } - break; + } + break; case ORDER_TYPE_BITMAP_COMPRESSED_V3: - { - CACHE_BITMAP_V3_ORDER* order = update_read_cache_bitmap_v3_order(update, s, extraFlags); + { + CACHE_BITMAP_V3_ORDER* order = update_read_cache_bitmap_v3_order(update, s, extraFlags); - if (order) - { - rc = IFCALLRESULT(FALSE, secondary->CacheBitmapV3, context, order); - free_cache_bitmap_v3_order(context, order); - } + if (order) + { + rc = IFCALLRESULT(FALSE, secondary->CacheBitmapV3, context, order); + free_cache_bitmap_v3_order(context, order); } - break; + } + break; case ORDER_TYPE_CACHE_COLOR_TABLE: - { - CACHE_COLOR_TABLE_ORDER* order = update_read_cache_color_table_order(update, s, extraFlags); + { + CACHE_COLOR_TABLE_ORDER* order = + update_read_cache_color_table_order(update, s, extraFlags); - if (order) - { - rc = IFCALLRESULT(FALSE, secondary->CacheColorTable, context, order); - free_cache_color_table_order(context, order); - } + if (order) + { + rc = IFCALLRESULT(FALSE, secondary->CacheColorTable, context, order); + free_cache_color_table_order(context, order); } - break; + } + break; case ORDER_TYPE_CACHE_GLYPH: + { + switch (settings->GlyphSupportLevel) { - switch (settings->GlyphSupportLevel) + case GLYPH_SUPPORT_PARTIAL: + case GLYPH_SUPPORT_FULL: { - case GLYPH_SUPPORT_PARTIAL: - case GLYPH_SUPPORT_FULL: - { - CACHE_GLYPH_ORDER* order = update_read_cache_glyph_order(update, s, extraFlags); + CACHE_GLYPH_ORDER* order = update_read_cache_glyph_order(update, s, extraFlags); - if (order) - { - rc = IFCALLRESULT(FALSE, secondary->CacheGlyph, context, order); - free_cache_glyph_order(context, order); - } - } - break; - - case GLYPH_SUPPORT_ENCODE: - { - CACHE_GLYPH_V2_ORDER* order = update_read_cache_glyph_v2_order(update, s, extraFlags); - - if (order) - { - rc = IFCALLRESULT(FALSE, secondary->CacheGlyphV2, context, order); - free_cache_glyph_v2_order(context, order); - } - } - break; - - case GLYPH_SUPPORT_NONE: - default: - break; + if (order) + { + rc = IFCALLRESULT(FALSE, secondary->CacheGlyph, context, order); + free_cache_glyph_order(context, order); + } } + break; + + case GLYPH_SUPPORT_ENCODE: + { + CACHE_GLYPH_V2_ORDER* order = + update_read_cache_glyph_v2_order(update, s, extraFlags); + + if (order) + { + rc = IFCALLRESULT(FALSE, secondary->CacheGlyphV2, context, order); + free_cache_glyph_v2_order(context, order); + } + } + break; + + case GLYPH_SUPPORT_NONE: + default: + break; } - break; + } + break; case ORDER_TYPE_CACHE_BRUSH: /* [MS-RDPEGDI] 2.2.2.2.1.2.7 Cache Brush (CACHE_BRUSH_ORDER) */ @@ -3743,8 +3620,7 @@ static BOOL read_altsec_order(wStream* s, BYTE orderType, rdpAltSecUpdate* altse switch (orderType) { case ORDER_TYPE_CREATE_OFFSCREEN_BITMAP: - rc = update_read_create_offscreen_bitmap_order(s, - &(altsec->create_offscreen_bitmap)); + rc = update_read_create_offscreen_bitmap_order(s, &(altsec->create_offscreen_bitmap)); break; case ORDER_TYPE_SWITCH_SURFACE: @@ -3752,8 +3628,7 @@ static BOOL read_altsec_order(wStream* s, BYTE orderType, rdpAltSecUpdate* altse break; case ORDER_TYPE_CREATE_NINE_GRID_BITMAP: - rc = update_read_create_nine_grid_bitmap_order(s, - &(altsec->create_nine_grid_bitmap)); + rc = update_read_create_nine_grid_bitmap_order(s, &(altsec->create_nine_grid_bitmap)); break; case ORDER_TYPE_FRAME_MARKER: @@ -3781,18 +3656,15 @@ static BOOL read_altsec_order(wStream* s, BYTE orderType, rdpAltSecUpdate* altse break; case ORDER_TYPE_GDIPLUS_CACHE_FIRST: - rc = update_read_draw_gdiplus_cache_first_order(s, - &(altsec->draw_gdiplus_cache_first)); + rc = update_read_draw_gdiplus_cache_first_order(s, &(altsec->draw_gdiplus_cache_first)); break; case ORDER_TYPE_GDIPLUS_CACHE_NEXT: - rc = update_read_draw_gdiplus_cache_next_order(s, - &(altsec->draw_gdiplus_cache_next)); + rc = update_read_draw_gdiplus_cache_next_order(s, &(altsec->draw_gdiplus_cache_next)); break; case ORDER_TYPE_GDIPLUS_CACHE_END: - rc = update_read_draw_gdiplus_cache_end_order(s, - &(altsec->draw_gdiplus_cache_end)); + rc = update_read_draw_gdiplus_cache_end_order(s, &(altsec->draw_gdiplus_cache_end)); break; case ORDER_TYPE_WINDOW: @@ -3811,8 +3683,7 @@ static BOOL read_altsec_order(wStream* s, BYTE orderType, rdpAltSecUpdate* altse return rc; } -static BOOL update_recv_altsec_order(rdpUpdate* update, wStream* s, - BYTE flags) +static BOOL update_recv_altsec_order(rdpUpdate* update, wStream* s, BYTE flags) { BYTE orderType = flags >>= 2; /* orderType is in higher 6 bits of flags field */ BOOL rc = FALSE; @@ -3820,8 +3691,7 @@ static BOOL update_recv_altsec_order(rdpUpdate* update, wStream* s, rdpSettings* settings = context->settings; rdpAltSecUpdate* altsec = update->altsec; const char* orderName = altsec_order_string(orderType); - WLog_Print(update->log, WLOG_DEBUG, - "Alternate Secondary Drawing Order %s", orderName); + WLog_Print(update->log, WLOG_DEBUG, "Alternate Secondary Drawing Order %s", orderName); if (!check_alt_order_supported(update->log, settings, orderType, orderName)) return FALSE; @@ -3897,8 +3767,8 @@ static BOOL update_recv_altsec_order(rdpUpdate* update, wStream* s, if (!rc) { - WLog_Print(update->log, WLOG_WARN, - "Alternate Secondary Drawing Order %s failed", orderName); + WLog_Print(update->log, WLOG_WARN, "Alternate Secondary Drawing Order %s failed", + orderName); } return rc; @@ -3924,7 +3794,7 @@ BOOL update_recv_order(rdpUpdate* update, wStream* s) rc = update_recv_primary_order(update, s, controlFlags); if (!rc) - WLog_Print(update->log, WLOG_ERROR, "order flags %02"PRIx8" failed", controlFlags); + WLog_Print(update->log, WLOG_ERROR, "order flags %02" PRIx8 " failed", controlFlags); return rc; } diff --git a/libfreerdp/core/orders.h b/libfreerdp/core/orders.h index 6692b7c75..76e3d3fe3 100644 --- a/libfreerdp/core/orders.h +++ b/libfreerdp/core/orders.h @@ -31,272 +31,257 @@ #include /* Order Control Flags */ -#define ORDER_STANDARD 0x01 -#define ORDER_SECONDARY 0x02 -#define ORDER_BOUNDS 0x04 -#define ORDER_TYPE_CHANGE 0x08 -#define ORDER_DELTA_COORDINATES 0x10 -#define ORDER_ZERO_BOUNDS_DELTAS 0x20 -#define ORDER_ZERO_FIELD_BYTE_BIT0 0x40 -#define ORDER_ZERO_FIELD_BYTE_BIT1 0x80 +#define ORDER_STANDARD 0x01 +#define ORDER_SECONDARY 0x02 +#define ORDER_BOUNDS 0x04 +#define ORDER_TYPE_CHANGE 0x08 +#define ORDER_DELTA_COORDINATES 0x10 +#define ORDER_ZERO_BOUNDS_DELTAS 0x20 +#define ORDER_ZERO_FIELD_BYTE_BIT0 0x40 +#define ORDER_ZERO_FIELD_BYTE_BIT1 0x80 /* Bound Field Flags */ -#define BOUND_LEFT 0x01 -#define BOUND_TOP 0x02 -#define BOUND_RIGHT 0x04 -#define BOUND_BOTTOM 0x08 -#define BOUND_DELTA_LEFT 0x10 -#define BOUND_DELTA_TOP 0x20 -#define BOUND_DELTA_RIGHT 0x40 -#define BOUND_DELTA_BOTTOM 0x80 +#define BOUND_LEFT 0x01 +#define BOUND_TOP 0x02 +#define BOUND_RIGHT 0x04 +#define BOUND_BOTTOM 0x08 +#define BOUND_DELTA_LEFT 0x10 +#define BOUND_DELTA_TOP 0x20 +#define BOUND_DELTA_RIGHT 0x40 +#define BOUND_DELTA_BOTTOM 0x80 /* Field Presence Flags */ -#define ORDER_FIELD_01 0x000001 -#define ORDER_FIELD_02 0x000002 -#define ORDER_FIELD_03 0x000004 -#define ORDER_FIELD_04 0x000008 -#define ORDER_FIELD_05 0x000010 -#define ORDER_FIELD_06 0x000020 -#define ORDER_FIELD_07 0x000040 -#define ORDER_FIELD_08 0x000080 -#define ORDER_FIELD_09 0x000100 -#define ORDER_FIELD_10 0x000200 -#define ORDER_FIELD_11 0x000400 -#define ORDER_FIELD_12 0x000800 -#define ORDER_FIELD_13 0x001000 -#define ORDER_FIELD_14 0x002000 -#define ORDER_FIELD_15 0x004000 -#define ORDER_FIELD_16 0x008000 -#define ORDER_FIELD_17 0x010000 -#define ORDER_FIELD_18 0x020000 -#define ORDER_FIELD_19 0x040000 -#define ORDER_FIELD_20 0x080000 -#define ORDER_FIELD_21 0x100000 -#define ORDER_FIELD_22 0x200000 -#define ORDER_FIELD_23 0x400000 +#define ORDER_FIELD_01 0x000001 +#define ORDER_FIELD_02 0x000002 +#define ORDER_FIELD_03 0x000004 +#define ORDER_FIELD_04 0x000008 +#define ORDER_FIELD_05 0x000010 +#define ORDER_FIELD_06 0x000020 +#define ORDER_FIELD_07 0x000040 +#define ORDER_FIELD_08 0x000080 +#define ORDER_FIELD_09 0x000100 +#define ORDER_FIELD_10 0x000200 +#define ORDER_FIELD_11 0x000400 +#define ORDER_FIELD_12 0x000800 +#define ORDER_FIELD_13 0x001000 +#define ORDER_FIELD_14 0x002000 +#define ORDER_FIELD_15 0x004000 +#define ORDER_FIELD_16 0x008000 +#define ORDER_FIELD_17 0x010000 +#define ORDER_FIELD_18 0x020000 +#define ORDER_FIELD_19 0x040000 +#define ORDER_FIELD_20 0x080000 +#define ORDER_FIELD_21 0x100000 +#define ORDER_FIELD_22 0x200000 +#define ORDER_FIELD_23 0x400000 /* Bitmap Cache Flags */ -#define CBR2_8BPP 0x3 -#define CBR2_16BPP 0x4 -#define CBR2_24BPP 0x5 -#define CBR2_32BPP 0x6 +#define CBR2_8BPP 0x3 +#define CBR2_16BPP 0x4 +#define CBR2_24BPP 0x5 +#define CBR2_32BPP 0x6 -#define CBR23_8BPP 0x3 -#define CBR23_16BPP 0x4 -#define CBR23_24BPP 0x5 -#define CBR23_32BPP 0x6 +#define CBR23_8BPP 0x3 +#define CBR23_16BPP 0x4 +#define CBR23_24BPP 0x5 +#define CBR23_32BPP 0x6 -#define CBR3_IGNORABLE_FLAG 0x08 -#define CBR3_DO_NOT_CACHE 0x10 +#define CBR3_IGNORABLE_FLAG 0x08 +#define CBR3_DO_NOT_CACHE 0x10 /* Primary Drawing Orders */ -#define ORDER_TYPE_DSTBLT 0x00 -#define ORDER_TYPE_PATBLT 0x01 -#define ORDER_TYPE_SCRBLT 0x02 -#define ORDER_TYPE_DRAW_NINE_GRID 0x07 -#define ORDER_TYPE_MULTI_DRAW_NINE_GRID 0x08 -#define ORDER_TYPE_LINE_TO 0x09 -#define ORDER_TYPE_OPAQUE_RECT 0x0A -#define ORDER_TYPE_SAVE_BITMAP 0x0B -#define ORDER_TYPE_MEMBLT 0x0D -#define ORDER_TYPE_MEM3BLT 0x0E -#define ORDER_TYPE_MULTI_DSTBLT 0x0F -#define ORDER_TYPE_MULTI_PATBLT 0x10 -#define ORDER_TYPE_MULTI_SCRBLT 0x11 -#define ORDER_TYPE_MULTI_OPAQUE_RECT 0x12 -#define ORDER_TYPE_FAST_INDEX 0x13 -#define ORDER_TYPE_POLYGON_SC 0x14 -#define ORDER_TYPE_POLYGON_CB 0x15 -#define ORDER_TYPE_POLYLINE 0x16 -#define ORDER_TYPE_FAST_GLYPH 0x18 -#define ORDER_TYPE_ELLIPSE_SC 0x19 -#define ORDER_TYPE_ELLIPSE_CB 0x1A -#define ORDER_TYPE_GLYPH_INDEX 0x1B +#define ORDER_TYPE_DSTBLT 0x00 +#define ORDER_TYPE_PATBLT 0x01 +#define ORDER_TYPE_SCRBLT 0x02 +#define ORDER_TYPE_DRAW_NINE_GRID 0x07 +#define ORDER_TYPE_MULTI_DRAW_NINE_GRID 0x08 +#define ORDER_TYPE_LINE_TO 0x09 +#define ORDER_TYPE_OPAQUE_RECT 0x0A +#define ORDER_TYPE_SAVE_BITMAP 0x0B +#define ORDER_TYPE_MEMBLT 0x0D +#define ORDER_TYPE_MEM3BLT 0x0E +#define ORDER_TYPE_MULTI_DSTBLT 0x0F +#define ORDER_TYPE_MULTI_PATBLT 0x10 +#define ORDER_TYPE_MULTI_SCRBLT 0x11 +#define ORDER_TYPE_MULTI_OPAQUE_RECT 0x12 +#define ORDER_TYPE_FAST_INDEX 0x13 +#define ORDER_TYPE_POLYGON_SC 0x14 +#define ORDER_TYPE_POLYGON_CB 0x15 +#define ORDER_TYPE_POLYLINE 0x16 +#define ORDER_TYPE_FAST_GLYPH 0x18 +#define ORDER_TYPE_ELLIPSE_SC 0x19 +#define ORDER_TYPE_ELLIPSE_CB 0x1A +#define ORDER_TYPE_GLYPH_INDEX 0x1B /* Primary Drawing Orders Fields */ -#define DSTBLT_ORDER_FIELDS 5 -#define PATBLT_ORDER_FIELDS 12 -#define SCRBLT_ORDER_FIELDS 7 -#define DRAW_NINE_GRID_ORDER_FIELDS 5 -#define MULTI_DRAW_NINE_GRID_ORDER_FIELDS 7 -#define LINE_TO_ORDER_FIELDS 10 -#define OPAQUE_RECT_ORDER_FIELDS 7 -#define SAVE_BITMAP_ORDER_FIELDS 6 -#define MEMBLT_ORDER_FIELDS 9 -#define MEM3BLT_ORDER_FIELDS 16 -#define MULTI_DSTBLT_ORDER_FIELDS 7 -#define MULTI_PATBLT_ORDER_FIELDS 14 -#define MULTI_SCRBLT_ORDER_FIELDS 9 -#define MULTI_OPAQUE_RECT_ORDER_FIELDS 9 -#define FAST_INDEX_ORDER_FIELDS 15 -#define POLYGON_SC_ORDER_FIELDS 7 -#define POLYGON_CB_ORDER_FIELDS 13 -#define POLYLINE_ORDER_FIELDS 7 -#define FAST_GLYPH_ORDER_FIELDS 15 -#define ELLIPSE_SC_ORDER_FIELDS 7 -#define ELLIPSE_CB_ORDER_FIELDS 13 -#define GLYPH_INDEX_ORDER_FIELDS 22 +#define DSTBLT_ORDER_FIELDS 5 +#define PATBLT_ORDER_FIELDS 12 +#define SCRBLT_ORDER_FIELDS 7 +#define DRAW_NINE_GRID_ORDER_FIELDS 5 +#define MULTI_DRAW_NINE_GRID_ORDER_FIELDS 7 +#define LINE_TO_ORDER_FIELDS 10 +#define OPAQUE_RECT_ORDER_FIELDS 7 +#define SAVE_BITMAP_ORDER_FIELDS 6 +#define MEMBLT_ORDER_FIELDS 9 +#define MEM3BLT_ORDER_FIELDS 16 +#define MULTI_DSTBLT_ORDER_FIELDS 7 +#define MULTI_PATBLT_ORDER_FIELDS 14 +#define MULTI_SCRBLT_ORDER_FIELDS 9 +#define MULTI_OPAQUE_RECT_ORDER_FIELDS 9 +#define FAST_INDEX_ORDER_FIELDS 15 +#define POLYGON_SC_ORDER_FIELDS 7 +#define POLYGON_CB_ORDER_FIELDS 13 +#define POLYLINE_ORDER_FIELDS 7 +#define FAST_GLYPH_ORDER_FIELDS 15 +#define ELLIPSE_SC_ORDER_FIELDS 7 +#define ELLIPSE_CB_ORDER_FIELDS 13 +#define GLYPH_INDEX_ORDER_FIELDS 22 /* Primary Drawing Orders Field Bytes */ -#define DSTBLT_ORDER_FIELD_BYTES 1 -#define PATBLT_ORDER_FIELD_BYTES 2 -#define SCRBLT_ORDER_FIELD_BYTES 1 -#define DRAW_NINE_GRID_ORDER_FIELD_BYTES 1 -#define MULTI_DRAW_NINE_GRID_ORDER_FIELD_BYTES 1 -#define LINE_TO_ORDER_FIELD_BYTES 2 -#define OPAQUE_RECT_ORDER_FIELD_BYTES 1 -#define SAVE_BITMAP_ORDER_FIELD_BYTES 1 -#define MEMBLT_ORDER_FIELD_BYTES 2 -#define MEM3BLT_ORDER_FIELD_BYTES 3 -#define MULTI_DSTBLT_ORDER_FIELD_BYTES 1 -#define MULTI_PATBLT_ORDER_FIELD_BYTES 2 -#define MULTI_SCRBLT_ORDER_FIELD_BYTES 2 -#define MULTI_OPAQUE_RECT_ORDER_FIELD_BYTES 2 -#define FAST_INDEX_ORDER_FIELD_BYTES 2 -#define POLYGON_SC_ORDER_FIELD_BYTES 1 -#define POLYGON_CB_ORDER_FIELD_BYTES 2 -#define POLYLINE_ORDER_FIELD_BYTES 1 -#define FAST_GLYPH_ORDER_FIELD_BYTES 2 -#define ELLIPSE_SC_ORDER_FIELD_BYTES 1 -#define ELLIPSE_CB_ORDER_FIELD_BYTES 2 -#define GLYPH_INDEX_ORDER_FIELD_BYTES 3 +#define DSTBLT_ORDER_FIELD_BYTES 1 +#define PATBLT_ORDER_FIELD_BYTES 2 +#define SCRBLT_ORDER_FIELD_BYTES 1 +#define DRAW_NINE_GRID_ORDER_FIELD_BYTES 1 +#define MULTI_DRAW_NINE_GRID_ORDER_FIELD_BYTES 1 +#define LINE_TO_ORDER_FIELD_BYTES 2 +#define OPAQUE_RECT_ORDER_FIELD_BYTES 1 +#define SAVE_BITMAP_ORDER_FIELD_BYTES 1 +#define MEMBLT_ORDER_FIELD_BYTES 2 +#define MEM3BLT_ORDER_FIELD_BYTES 3 +#define MULTI_DSTBLT_ORDER_FIELD_BYTES 1 +#define MULTI_PATBLT_ORDER_FIELD_BYTES 2 +#define MULTI_SCRBLT_ORDER_FIELD_BYTES 2 +#define MULTI_OPAQUE_RECT_ORDER_FIELD_BYTES 2 +#define FAST_INDEX_ORDER_FIELD_BYTES 2 +#define POLYGON_SC_ORDER_FIELD_BYTES 1 +#define POLYGON_CB_ORDER_FIELD_BYTES 2 +#define POLYLINE_ORDER_FIELD_BYTES 1 +#define FAST_GLYPH_ORDER_FIELD_BYTES 2 +#define ELLIPSE_SC_ORDER_FIELD_BYTES 1 +#define ELLIPSE_CB_ORDER_FIELD_BYTES 2 +#define GLYPH_INDEX_ORDER_FIELD_BYTES 3 /* Secondary Drawing Orders */ -#define ORDER_TYPE_BITMAP_UNCOMPRESSED 0x00 -#define ORDER_TYPE_CACHE_COLOR_TABLE 0x01 -#define ORDER_TYPE_CACHE_BITMAP_COMPRESSED 0x02 -#define ORDER_TYPE_CACHE_GLYPH 0x03 -#define ORDER_TYPE_BITMAP_UNCOMPRESSED_V2 0x04 -#define ORDER_TYPE_BITMAP_COMPRESSED_V2 0x05 -#define ORDER_TYPE_CACHE_BRUSH 0x07 -#define ORDER_TYPE_BITMAP_COMPRESSED_V3 0x08 +#define ORDER_TYPE_BITMAP_UNCOMPRESSED 0x00 +#define ORDER_TYPE_CACHE_COLOR_TABLE 0x01 +#define ORDER_TYPE_CACHE_BITMAP_COMPRESSED 0x02 +#define ORDER_TYPE_CACHE_GLYPH 0x03 +#define ORDER_TYPE_BITMAP_UNCOMPRESSED_V2 0x04 +#define ORDER_TYPE_BITMAP_COMPRESSED_V2 0x05 +#define ORDER_TYPE_CACHE_BRUSH 0x07 +#define ORDER_TYPE_BITMAP_COMPRESSED_V3 0x08 /* Alternate Secondary Drawing Orders */ -#define ORDER_TYPE_SWITCH_SURFACE 0x00 -#define ORDER_TYPE_CREATE_OFFSCREEN_BITMAP 0x01 -#define ORDER_TYPE_STREAM_BITMAP_FIRST 0x02 -#define ORDER_TYPE_STREAM_BITMAP_NEXT 0x03 -#define ORDER_TYPE_CREATE_NINE_GRID_BITMAP 0x04 -#define ORDER_TYPE_GDIPLUS_FIRST 0x05 -#define ORDER_TYPE_GDIPLUS_NEXT 0x06 -#define ORDER_TYPE_GDIPLUS_END 0x07 -#define ORDER_TYPE_GDIPLUS_CACHE_FIRST 0x08 -#define ORDER_TYPE_GDIPLUS_CACHE_NEXT 0x09 -#define ORDER_TYPE_GDIPLUS_CACHE_END 0x0A -#define ORDER_TYPE_WINDOW 0x0B -#define ORDER_TYPE_COMPDESK_FIRST 0x0C -#define ORDER_TYPE_FRAME_MARKER 0x0D +#define ORDER_TYPE_SWITCH_SURFACE 0x00 +#define ORDER_TYPE_CREATE_OFFSCREEN_BITMAP 0x01 +#define ORDER_TYPE_STREAM_BITMAP_FIRST 0x02 +#define ORDER_TYPE_STREAM_BITMAP_NEXT 0x03 +#define ORDER_TYPE_CREATE_NINE_GRID_BITMAP 0x04 +#define ORDER_TYPE_GDIPLUS_FIRST 0x05 +#define ORDER_TYPE_GDIPLUS_NEXT 0x06 +#define ORDER_TYPE_GDIPLUS_END 0x07 +#define ORDER_TYPE_GDIPLUS_CACHE_FIRST 0x08 +#define ORDER_TYPE_GDIPLUS_CACHE_NEXT 0x09 +#define ORDER_TYPE_GDIPLUS_CACHE_END 0x0A +#define ORDER_TYPE_WINDOW 0x0B +#define ORDER_TYPE_COMPDESK_FIRST 0x0C +#define ORDER_TYPE_FRAME_MARKER 0x0D -#define CG_GLYPH_UNICODE_PRESENT 0x0010 +#define CG_GLYPH_UNICODE_PRESENT 0x0010 FREERDP_LOCAL extern const BYTE PRIMARY_DRAWING_ORDER_FIELD_BYTES[]; FREERDP_LOCAL BOOL update_recv_order(rdpUpdate* update, wStream* s); -FREERDP_LOCAL BOOL update_write_field_flags(wStream* s, UINT32 fieldFlags, - BYTE flags, - BYTE fieldBytes); +FREERDP_LOCAL BOOL update_write_field_flags(wStream* s, UINT32 fieldFlags, BYTE flags, + BYTE fieldBytes); FREERDP_LOCAL BOOL update_write_bounds(wStream* s, ORDER_INFO* orderInfo); FREERDP_LOCAL int update_approximate_dstblt_order(ORDER_INFO* orderInfo, - const DSTBLT_ORDER* dstblt); + const DSTBLT_ORDER* dstblt); FREERDP_LOCAL BOOL update_write_dstblt_order(wStream* s, ORDER_INFO* orderInfo, - const DSTBLT_ORDER* dstblt); + const DSTBLT_ORDER* dstblt); -FREERDP_LOCAL int update_approximate_patblt_order(ORDER_INFO* orderInfo, - PATBLT_ORDER* patblt); +FREERDP_LOCAL int update_approximate_patblt_order(ORDER_INFO* orderInfo, PATBLT_ORDER* patblt); FREERDP_LOCAL BOOL update_write_patblt_order(wStream* s, ORDER_INFO* orderInfo, - PATBLT_ORDER* patblt); + PATBLT_ORDER* patblt); FREERDP_LOCAL int update_approximate_scrblt_order(ORDER_INFO* orderInfo, - const SCRBLT_ORDER* scrblt); + const SCRBLT_ORDER* scrblt); FREERDP_LOCAL BOOL update_write_scrblt_order(wStream* s, ORDER_INFO* orderInfo, - const SCRBLT_ORDER* scrblt); + const SCRBLT_ORDER* scrblt); FREERDP_LOCAL int update_approximate_opaque_rect_order(ORDER_INFO* orderInfo, - const OPAQUE_RECT_ORDER* opaque_rect); -FREERDP_LOCAL BOOL update_write_opaque_rect_order(wStream* s, - ORDER_INFO* orderInfo, - const OPAQUE_RECT_ORDER* opaque_rect); + const OPAQUE_RECT_ORDER* opaque_rect); +FREERDP_LOCAL BOOL update_write_opaque_rect_order(wStream* s, ORDER_INFO* orderInfo, + const OPAQUE_RECT_ORDER* opaque_rect); FREERDP_LOCAL int update_approximate_line_to_order(ORDER_INFO* orderInfo, - const LINE_TO_ORDER* line_to); + const LINE_TO_ORDER* line_to); FREERDP_LOCAL BOOL update_write_line_to_order(wStream* s, ORDER_INFO* orderInfo, - const LINE_TO_ORDER* line_to); + const LINE_TO_ORDER* line_to); FREERDP_LOCAL int update_approximate_memblt_order(ORDER_INFO* orderInfo, - const MEMBLT_ORDER* memblt); + const MEMBLT_ORDER* memblt); FREERDP_LOCAL BOOL update_write_memblt_order(wStream* s, ORDER_INFO* orderInfo, - const MEMBLT_ORDER* memblt); + const MEMBLT_ORDER* memblt); FREERDP_LOCAL int update_approximate_glyph_index_order(ORDER_INFO* orderInfo, - const GLYPH_INDEX_ORDER* glyph_index); -FREERDP_LOCAL BOOL update_write_glyph_index_order(wStream* s, - ORDER_INFO* orderInfo, - GLYPH_INDEX_ORDER* glyph_index); + const GLYPH_INDEX_ORDER* glyph_index); +FREERDP_LOCAL BOOL update_write_glyph_index_order(wStream* s, ORDER_INFO* orderInfo, + GLYPH_INDEX_ORDER* glyph_index); -FREERDP_LOCAL int update_approximate_cache_bitmap_order( - const CACHE_BITMAP_ORDER* cache_bitmap, - BOOL compressed, UINT16* flags); +FREERDP_LOCAL int update_approximate_cache_bitmap_order(const CACHE_BITMAP_ORDER* cache_bitmap, + BOOL compressed, UINT16* flags); FREERDP_LOCAL BOOL update_write_cache_bitmap_order(wStream* s, - const CACHE_BITMAP_ORDER* cache_bitmap_order, - BOOL compressed, UINT16* flags); + const CACHE_BITMAP_ORDER* cache_bitmap_order, + BOOL compressed, UINT16* flags); -FREERDP_LOCAL int update_approximate_cache_bitmap_v2_order( - CACHE_BITMAP_V2_ORDER* cache_bitmap_v2, - BOOL compressed, UINT16* flags); +FREERDP_LOCAL int update_approximate_cache_bitmap_v2_order(CACHE_BITMAP_V2_ORDER* cache_bitmap_v2, + BOOL compressed, UINT16* flags); FREERDP_LOCAL BOOL update_write_cache_bitmap_v2_order(wStream* s, - CACHE_BITMAP_V2_ORDER* cache_bitmap_v2_order, - BOOL compressed, UINT16* flags); + CACHE_BITMAP_V2_ORDER* cache_bitmap_v2_order, + BOOL compressed, UINT16* flags); -FREERDP_LOCAL int update_approximate_cache_bitmap_v3_order( - CACHE_BITMAP_V3_ORDER* cache_bitmap_v3, - UINT16* flags); +FREERDP_LOCAL int update_approximate_cache_bitmap_v3_order(CACHE_BITMAP_V3_ORDER* cache_bitmap_v3, + UINT16* flags); FREERDP_LOCAL BOOL update_write_cache_bitmap_v3_order(wStream* s, - CACHE_BITMAP_V3_ORDER* cache_bitmap_v3_order, - UINT16* flags); + CACHE_BITMAP_V3_ORDER* cache_bitmap_v3_order, + UINT16* flags); -FREERDP_LOCAL int update_approximate_cache_color_table_order( - const CACHE_COLOR_TABLE_ORDER* cache_color_table, - UINT16* flags); -FREERDP_LOCAL BOOL update_write_cache_color_table_order(wStream* s, - const CACHE_COLOR_TABLE_ORDER* cache_color_table_order, - UINT16* flags); +FREERDP_LOCAL int +update_approximate_cache_color_table_order(const CACHE_COLOR_TABLE_ORDER* cache_color_table, + UINT16* flags); +FREERDP_LOCAL BOOL update_write_cache_color_table_order( + wStream* s, const CACHE_COLOR_TABLE_ORDER* cache_color_table_order, UINT16* flags); -FREERDP_LOCAL int update_approximate_cache_glyph_order(const CACHE_GLYPH_ORDER* - cache_glyph, - UINT16* flags); +FREERDP_LOCAL int update_approximate_cache_glyph_order(const CACHE_GLYPH_ORDER* cache_glyph, + UINT16* flags); FREERDP_LOCAL BOOL update_write_cache_glyph_order(wStream* s, - const CACHE_GLYPH_ORDER* cache_glyph_order, - UINT16* flags); + const CACHE_GLYPH_ORDER* cache_glyph_order, + UINT16* flags); -FREERDP_LOCAL int update_approximate_cache_glyph_v2_order( - const CACHE_GLYPH_V2_ORDER* cache_glyph_v2, - UINT16* flags); -FREERDP_LOCAL BOOL update_write_cache_glyph_v2_order( - wStream* s, - const CACHE_GLYPH_V2_ORDER* cache_glyph_v2, - UINT16* flags); +FREERDP_LOCAL int +update_approximate_cache_glyph_v2_order(const CACHE_GLYPH_V2_ORDER* cache_glyph_v2, UINT16* flags); +FREERDP_LOCAL BOOL update_write_cache_glyph_v2_order(wStream* s, + const CACHE_GLYPH_V2_ORDER* cache_glyph_v2, + UINT16* flags); -FREERDP_LOCAL int update_approximate_cache_brush_order( - const CACHE_BRUSH_ORDER* cache_brush, - UINT16* flags); -FREERDP_LOCAL BOOL update_write_cache_brush_order( - wStream* s, - const CACHE_BRUSH_ORDER* cache_brush_order, - UINT16* flags); +FREERDP_LOCAL int update_approximate_cache_brush_order(const CACHE_BRUSH_ORDER* cache_brush, + UINT16* flags); +FREERDP_LOCAL BOOL update_write_cache_brush_order(wStream* s, + const CACHE_BRUSH_ORDER* cache_brush_order, + UINT16* flags); FREERDP_LOCAL int update_approximate_create_offscreen_bitmap_order( const CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap); FREERDP_LOCAL BOOL update_write_create_offscreen_bitmap_order( - wStream* s, - const CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap); + wStream* s, const CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap); -FREERDP_LOCAL int update_approximate_switch_surface_order( - const SWITCH_SURFACE_ORDER* switch_surface); -FREERDP_LOCAL BOOL update_write_switch_surface_order( - wStream* s, - const SWITCH_SURFACE_ORDER* switch_surface); +FREERDP_LOCAL int +update_approximate_switch_surface_order(const SWITCH_SURFACE_ORDER* switch_surface); +FREERDP_LOCAL BOOL update_write_switch_surface_order(wStream* s, + const SWITCH_SURFACE_ORDER* switch_surface); #endif /* FREERDP_LIB_CORE_ORDERS_H */ diff --git a/libfreerdp/core/peer.c b/libfreerdp/core/peer.c index 03874fba7..f4807c523 100644 --- a/libfreerdp/core/peer.c +++ b/libfreerdp/core/peer.c @@ -36,7 +36,7 @@ #define TAG FREERDP_TAG("core.peer") static HANDLE freerdp_peer_virtual_channel_open(freerdp_peer* client, const char* name, - UINT32 flags) + UINT32 flags) { int length; UINT32 index; @@ -70,15 +70,15 @@ static HANDLE freerdp_peer_virtual_channel_open(freerdp_peer* client, const char if (!joined) return NULL; /* channel is not joined */ - peerChannel = (rdpPeerChannel*) mcsChannel->handle; + peerChannel = (rdpPeerChannel*)mcsChannel->handle; if (peerChannel) { /* channel is already open */ - return (HANDLE) peerChannel; + return (HANDLE)peerChannel; } - peerChannel = (rdpPeerChannel*) calloc(1, sizeof(rdpPeerChannel)); + peerChannel = (rdpPeerChannel*)calloc(1, sizeof(rdpPeerChannel)); if (peerChannel) { @@ -87,10 +87,10 @@ static HANDLE freerdp_peer_virtual_channel_open(freerdp_peer* client, const char peerChannel->channelFlags = flags; peerChannel->channelId = mcsChannel->ChannelId; peerChannel->mcsChannel = mcsChannel; - mcsChannel->handle = (void*) peerChannel; + mcsChannel->handle = (void*)peerChannel; } - return (HANDLE) peerChannel; + return (HANDLE)peerChannel; } static BOOL freerdp_peer_virtual_channel_close(freerdp_peer* client, HANDLE hChannel) @@ -101,7 +101,7 @@ static BOOL freerdp_peer_virtual_channel_close(freerdp_peer* client, HANDLE hCha if (!hChannel) return FALSE; - peerChannel = (rdpPeerChannel*) hChannel; + peerChannel = (rdpPeerChannel*)hChannel; mcsChannel = peerChannel->mcsChannel; mcsChannel->handle = NULL; free(peerChannel); @@ -115,7 +115,7 @@ int freerdp_peer_virtual_channel_read(freerdp_peer* client, HANDLE hChannel, BYT } static int freerdp_peer_virtual_channel_write(freerdp_peer* client, HANDLE hChannel, BYTE* buffer, - UINT32 length) + UINT32 length) { wStream* s; UINT32 flags; @@ -129,7 +129,7 @@ static int freerdp_peer_virtual_channel_write(freerdp_peer* client, HANDLE hChan if (!hChannel) return -1; - peerChannel = (rdpPeerChannel*) hChannel; + peerChannel = (rdpPeerChannel*)hChannel; mcsChannel = peerChannel->mcsChannel; if (peerChannel->channelFlags & WTS_CHANNEL_OPTION_DYNAMIC) @@ -183,7 +183,7 @@ static int freerdp_peer_virtual_channel_write(freerdp_peer* client, HANDLE hChan void* freerdp_peer_virtual_channel_get_data(freerdp_peer* client, HANDLE hChannel) { - rdpPeerChannel* peerChannel = (rdpPeerChannel*) hChannel; + rdpPeerChannel* peerChannel = (rdpPeerChannel*)hChannel; if (!hChannel) return NULL; @@ -193,7 +193,7 @@ void* freerdp_peer_virtual_channel_get_data(freerdp_peer* client, HANDLE hChanne int freerdp_peer_virtual_channel_set_data(freerdp_peer* client, HANDLE hChannel, void* data) { - rdpPeerChannel* peerChannel = (rdpPeerChannel*) hChannel; + rdpPeerChannel* peerChannel = (rdpPeerChannel*)hChannel; if (!hChannel) return -1; @@ -276,12 +276,14 @@ static BOOL peer_recv_data_pdu(freerdp_peer* client, wStream* s) BYTE compressed_type; UINT16 compressed_len; - if (!rdp_read_share_data_header(s, &length, &type, &share_id, &compressed_type, &compressed_len)) + if (!rdp_read_share_data_header(s, &length, &type, &share_id, &compressed_type, + &compressed_len)) return FALSE; #ifdef WITH_DEBUG_RDP - WLog_DBG(TAG, "recv %s Data PDU (0x%02"PRIX8"), length: %"PRIu16"", - type < ARRAYSIZE(DATA_PDU_TYPE_STRINGS) ? DATA_PDU_TYPE_STRINGS[type] : "???", type, length); + WLog_DBG(TAG, "recv %s Data PDU (0x%02" PRIX8 "), length: %" PRIu16 "", + type < ARRAYSIZE(DATA_PDU_TYPE_STRINGS) ? DATA_PDU_TYPE_STRINGS[type] : "???", type, + length); #endif switch (type) @@ -323,7 +325,8 @@ static BOOL peer_recv_data_pdu(freerdp_peer* client, wStream* s) return FALSE; Stream_Read_UINT32(s, client->ack_frame_id); - IFCALL(client->update->SurfaceFrameAcknowledge, client->update->context, client->ack_frame_id); + IFCALL(client->update->SurfaceFrameAcknowledge, client->update->context, + client->ack_frame_id); break; case DATA_PDU_TYPE_REFRESH_RECT: @@ -339,7 +342,7 @@ static BOOL peer_recv_data_pdu(freerdp_peer* client, wStream* s) break; default: - WLog_ERR(TAG, "Data PDU type %"PRIu8"", type); + WLog_ERR(TAG, "Data PDU type %" PRIu8 "", type); break; } @@ -409,7 +412,7 @@ static int peer_recv_tpkt_pdu(freerdp_peer* client, wStream* s) break; default: - WLog_ERR(TAG, "Client sent pduType %"PRIu16"", pduType); + WLog_ERR(TAG, "Client sent pduType %" PRIu16 "", pduType); return -1; } } @@ -441,14 +444,16 @@ static int peer_recv_fastpath_pdu(freerdp_peer* client, wStream* s) if ((length == 0) || (length > Stream_GetRemainingLength(s))) { - WLog_ERR(TAG, "incorrect FastPath PDU header length %"PRIu16"", length); + WLog_ERR(TAG, "incorrect FastPath PDU header length %" PRIu16 "", length); return -1; } if (fastpath->encryptionFlags & FASTPATH_OUTPUT_ENCRYPTED) { if (!rdp_decrypt(rdp, s, length, - (fastpath->encryptionFlags & FASTPATH_OUTPUT_SECURE_CHECKSUM) ? SEC_SECURE_CHECKSUM : 0)) + (fastpath->encryptionFlags & FASTPATH_OUTPUT_SECURE_CHECKSUM) + ? SEC_SECURE_CHECKSUM + : 0)) return -1; } @@ -468,7 +473,7 @@ static int peer_recv_pdu(freerdp_peer* client, wStream* s) static int peer_recv_callback(rdpTransport* transport, wStream* s, void* extra) { UINT32 SelectedProtocol; - freerdp_peer* client = (freerdp_peer*) extra; + freerdp_peer* client = (freerdp_peer*)extra; rdpRdp* rdp = client->context->rdp; switch (rdp->state) @@ -476,7 +481,9 @@ static int peer_recv_callback(rdpTransport* transport, wStream* s, void* extra) case CONNECTION_STATE_INITIAL: if (!rdp_server_accept_nego(rdp, s)) { - WLog_ERR(TAG, "peer_recv_callback: CONNECTION_STATE_INITIAL - rdp_server_accept_nego() fail"); + WLog_ERR( + TAG, + "peer_recv_callback: CONNECTION_STATE_INITIAL - rdp_server_accept_nego() fail"); return -1; } @@ -502,8 +509,8 @@ static int peer_recv_callback(rdpTransport* transport, wStream* s, void* extra) case CONNECTION_STATE_NEGO: if (!rdp_server_accept_mcs_connect_initial(rdp, s)) { - WLog_ERR(TAG, - "peer_recv_callback: CONNECTION_STATE_NEGO - rdp_server_accept_mcs_connect_initial() fail"); + WLog_ERR(TAG, "peer_recv_callback: CONNECTION_STATE_NEGO - " + "rdp_server_accept_mcs_connect_initial() fail"); return -1; } @@ -512,8 +519,8 @@ static int peer_recv_callback(rdpTransport* transport, wStream* s, void* extra) case CONNECTION_STATE_MCS_CONNECT: if (!rdp_server_accept_mcs_erect_domain_request(rdp, s)) { - WLog_ERR(TAG, - "peer_recv_callback: CONNECTION_STATE_MCS_CONNECT - rdp_server_accept_mcs_erect_domain_request() fail"); + WLog_ERR(TAG, "peer_recv_callback: CONNECTION_STATE_MCS_CONNECT - " + "rdp_server_accept_mcs_erect_domain_request() fail"); return -1; } @@ -522,8 +529,8 @@ static int peer_recv_callback(rdpTransport* transport, wStream* s, void* extra) case CONNECTION_STATE_MCS_ERECT_DOMAIN: if (!rdp_server_accept_mcs_attach_user_request(rdp, s)) { - WLog_ERR(TAG, - "peer_recv_callback: CONNECTION_STATE_MCS_ERECT_DOMAIN - rdp_server_accept_mcs_attach_user_request() fail"); + WLog_ERR(TAG, "peer_recv_callback: CONNECTION_STATE_MCS_ERECT_DOMAIN - " + "rdp_server_accept_mcs_attach_user_request() fail"); return -1; } @@ -532,8 +539,8 @@ static int peer_recv_callback(rdpTransport* transport, wStream* s, void* extra) case CONNECTION_STATE_MCS_ATTACH_USER: if (!rdp_server_accept_mcs_channel_join_request(rdp, s)) { - WLog_ERR(TAG, - "peer_recv_callback: CONNECTION_STATE_MCS_ATTACH_USER - rdp_server_accept_mcs_channel_join_request() fail"); + WLog_ERR(TAG, "peer_recv_callback: CONNECTION_STATE_MCS_ATTACH_USER - " + "rdp_server_accept_mcs_channel_join_request() fail"); return -1; } @@ -545,7 +552,8 @@ static int peer_recv_callback(rdpTransport* transport, wStream* s, void* extra) if (!rdp_server_establish_keys(rdp, s)) { WLog_ERR(TAG, - "peer_recv_callback: CONNECTION_STATE_RDP_SECURITY_COMMENCEMENT - rdp_server_establish_keys() fail"); + "peer_recv_callback: CONNECTION_STATE_RDP_SECURITY_COMMENCEMENT - " + "rdp_server_establish_keys() fail"); return -1; } } @@ -560,8 +568,8 @@ static int peer_recv_callback(rdpTransport* transport, wStream* s, void* extra) case CONNECTION_STATE_SECURE_SETTINGS_EXCHANGE: if (!rdp_recv_client_info(rdp, s)) { - WLog_ERR(TAG, - "peer_recv_callback: CONNECTION_STATE_SECURE_SETTINGS_EXCHANGE - rdp_recv_client_info() fail"); + WLog_ERR(TAG, "peer_recv_callback: CONNECTION_STATE_SECURE_SETTINGS_EXCHANGE - " + "rdp_recv_client_info() fail"); return -1; } @@ -570,42 +578,47 @@ static int peer_recv_callback(rdpTransport* transport, wStream* s, void* extra) break; case CONNECTION_STATE_LICENSING: + { + LicenseCallbackResult res; + + if (!client->LicenseCallback) { - LicenseCallbackResult res; - - if (!client->LicenseCallback) - { - WLog_ERR(TAG, - "peer_recv_callback: LicenseCallback has been removed, assuming licensing is ok (please fix your app)"); - res = LICENSE_CB_COMPLETED; - } - else - res = client->LicenseCallback(client, s); - - switch (res) - { - case LICENSE_CB_INTERNAL_ERROR: - WLog_ERR(TAG, "peer_recv_callback: CONNECTION_STATE_LICENSING - callback internal error, aborting"); - return -1; - - case LICENSE_CB_ABORT: - return -1; - - case LICENSE_CB_IN_PROGRESS: - break; - - case LICENSE_CB_COMPLETED: - rdp_server_transition_to_state(rdp, CONNECTION_STATE_CAPABILITIES_EXCHANGE); - return peer_recv_callback(transport, NULL, extra); - - default: - WLog_ERR(TAG, "peer_recv_callback: CONNECTION_STATE_LICENSING - unknown license callback result %d", - (int)res); - break; - } - - break; + WLog_ERR(TAG, "peer_recv_callback: LicenseCallback has been removed, assuming " + "licensing is ok (please fix your app)"); + res = LICENSE_CB_COMPLETED; } + else + res = client->LicenseCallback(client, s); + + switch (res) + { + case LICENSE_CB_INTERNAL_ERROR: + WLog_ERR(TAG, + "peer_recv_callback: CONNECTION_STATE_LICENSING - callback internal " + "error, aborting"); + return -1; + + case LICENSE_CB_ABORT: + return -1; + + case LICENSE_CB_IN_PROGRESS: + break; + + case LICENSE_CB_COMPLETED: + rdp_server_transition_to_state(rdp, CONNECTION_STATE_CAPABILITIES_EXCHANGE); + return peer_recv_callback(transport, NULL, extra); + + default: + WLog_ERR( + TAG, + "peer_recv_callback: CONNECTION_STATE_LICENSING - unknown license callback " + "result %d", + (int)res); + break; + } + + break; + } case CONNECTION_STATE_CAPABILITIES_EXCHANGE: if (!rdp->AwaitCapabilities) @@ -615,8 +628,8 @@ static int peer_recv_callback(rdpTransport* transport, wStream* s, void* extra) if (!rdp_send_demand_active(rdp)) { - WLog_ERR(TAG, - "peer_recv_callback: CONNECTION_STATE_CAPABILITIES_EXCHANGE - rdp_send_demand_active() fail"); + WLog_ERR(TAG, "peer_recv_callback: CONNECTION_STATE_CAPABILITIES_EXCHANGE - " + "rdp_send_demand_active() fail"); return -1; } @@ -626,7 +639,9 @@ static int peer_recv_callback(rdpTransport* transport, wStream* s, void* extra) { if (peer_recv_pdu(client, s) < 0) { - WLog_ERR(TAG, "peer_recv_callback: CONNECTION_STATE_CAPABILITIES_EXCHANGE - peer_recv_pdu() fail"); + WLog_ERR(TAG, + "peer_recv_callback: CONNECTION_STATE_CAPABILITIES_EXCHANGE - " + "peer_recv_pdu() fail"); return -1; } } @@ -639,7 +654,8 @@ static int peer_recv_callback(rdpTransport* transport, wStream* s, void* extra) */ if (peer_recv_pdu(client, s) < 0) { - WLog_ERR(TAG, "peer_recv_callback: CONNECTION_STATE_CAPABILITIES_EXCHANGE - peer_recv_pdu() fail"); + WLog_ERR(TAG, "peer_recv_callback: CONNECTION_STATE_CAPABILITIES_EXCHANGE - " + "peer_recv_pdu() fail"); return -1; } } @@ -649,7 +665,9 @@ static int peer_recv_callback(rdpTransport* transport, wStream* s, void* extra) case CONNECTION_STATE_FINALIZATION: if (peer_recv_pdu(client, s) < 0) { - WLog_ERR(TAG, "peer_recv_callback: CONNECTION_STATE_FINALIZATION - peer_recv_pdu() fail"); + WLog_ERR( + TAG, + "peer_recv_callback: CONNECTION_STATE_FINALIZATION - peer_recv_pdu() fail"); return -1; } @@ -706,7 +724,7 @@ static void freerdp_peer_disconnect(freerdp_peer* client) } static int freerdp_peer_send_channel_data(freerdp_peer* client, UINT16 channelId, const BYTE* data, - int size) + int size) { return rdp_send_channel_data(client->context->rdp, channelId, data, size); } @@ -750,7 +768,7 @@ BOOL freerdp_peer_context_new(freerdp_peer* client) if (!client) return FALSE; - if (!(context = (rdpContext*) calloc(1, client->ContextSize))) + if (!(context = (rdpContext*)calloc(1, client->ContextSize))) goto fail_context; client->context = context; @@ -837,14 +855,14 @@ freerdp_peer* freerdp_peer_new(int sockfd) UINT32 option_value; socklen_t option_len; freerdp_peer* client; - client = (freerdp_peer*) calloc(1, sizeof(freerdp_peer)); + client = (freerdp_peer*)calloc(1, sizeof(freerdp_peer)); if (!client) return NULL; option_value = TRUE; option_len = sizeof(option_value); - setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (void*) &option_value, option_len); + setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (void*)&option_value, option_len); if (client) { diff --git a/libfreerdp/core/peer.h b/libfreerdp/core/peer.h index d9c3bc402..65c8538b7 100644 --- a/libfreerdp/core/peer.h +++ b/libfreerdp/core/peer.h @@ -27,4 +27,3 @@ #include #endif /* FREERDP_LIB_CORE_PEER_H */ - diff --git a/libfreerdp/core/proxy.c b/libfreerdp/core/proxy.c index 4ef8d8567..d2b14eb01 100644 --- a/libfreerdp/core/proxy.c +++ b/libfreerdp/core/proxy.c @@ -24,7 +24,7 @@ #include "freerdp/settings.h" #include "tcp.h" -#include "winpr/environment.h" /* For GetEnvironmentVariableA */ +#include "winpr/environment.h" /* For GetEnvironmentVariableA */ #define CRLF "\r\n" #define TAG FREERDP_TAG("core.proxy") @@ -52,20 +52,15 @@ enum }; /* CONN REQ replies in enum. order */ -static const char* rplstat[] = -{ - "succeeded", - "general SOCKS server failure", - "connection not allowed by ruleset", - "Network unreachable", - "Host unreachable", - "Connection refused", - "TTL expired", - "Command not supported", - "Address type not supported" -}; - - +static const char* rplstat[] = { "succeeded", + "general SOCKS server failure", + "connection not allowed by ruleset", + "Network unreachable", + "Host unreachable", + "Connection refused", + "TTL expired", + "Command not supported", + "Address type not supported" }; static BOOL http_proxy_connect(BIO* bufferedBio, const char* hostname, UINT16 port); static BOOL socks_proxy_connect(BIO* bufferedBio, const char* proxyUsername, @@ -176,7 +171,7 @@ static BOOL check_no_proxy(rdpSettings* settings, const char* no_proxy) if (currentlen > 0) { - WLog_DBG(TAG, "%s => %s (%"PRIdz")", settings->ServerHostname, current, currentlen); + WLog_DBG(TAG, "%s => %s (%" PRIdz ")", settings->ServerHostname, current, currentlen); /* detect left and right "*" wildcard */ if (current[0] == '*') @@ -195,7 +190,8 @@ static BOOL check_no_proxy(rdpSettings* settings, const char* no_proxy) if (strncmp(current, settings->ServerHostname, currentlen - 1) == 0) result = TRUE; } - else if (current[0] == '.') /* Only compare if the no_proxy variable contains a whole domain. */ + else if (current[0] == + '.') /* Only compare if the no_proxy variable contains a whole domain. */ { if (host_len > currentlen) { @@ -276,7 +272,8 @@ void proxy_read_environment(rdpSettings* settings, char* envname) { if (check_no_proxy(settings, env)) { - WLog_INFO(TAG, "deactivating proxy: %s [%s=%s]", settings->ServerHostname, envname, env); + WLog_INFO(TAG, "deactivating proxy: %s [%s=%s]", settings->ServerHostname, envname, + env); settings->ProxyType = PROXY_TYPE_NONE; } } @@ -291,7 +288,7 @@ void proxy_read_environment(rdpSettings* settings, char* envname) BOOL proxy_parse_uri(rdpSettings* settings, const char* uri) { - const char* hostname, *pport; + const char *hostname, *pport; const char* protocol; const char* p; UINT16 port; @@ -370,8 +367,7 @@ BOOL proxy_parse_uri(rdpSettings* settings, const char* uri) } BOOL proxy_connect(rdpSettings* settings, BIO* bufferedBio, const char* proxyUsername, - const char* proxyPassword, - const char* hostname, UINT16 port) + const char* proxyPassword, const char* hostname, UINT16 port) { switch (settings->ProxyType) { @@ -406,7 +402,7 @@ static BOOL http_proxy_connect(BIO* bufferedBio, const char* hostname, UINT16 po Stream_Write(s, " HTTP/1.1" CRLF "Host: ", 17); Stream_Write(s, hostname, strlen(hostname)); Stream_Write_UINT8(s, ':'); - Stream_Write(s, port_str, strnlen(port_str, sizeof (port_str))); + Stream_Write(s, port_str, strnlen(port_str, sizeof(port_str))); Stream_Write(s, CRLF CRLF, 4); status = BIO_write(bufferedBio, Stream_Buffer(s), Stream_GetPosition(s)); @@ -432,7 +428,8 @@ static BOOL http_proxy_connect(BIO* bufferedBio, const char* hostname, UINT16 po return FALSE; } - status = BIO_read(bufferedBio, (BYTE*)recv_buf + resultsize, sizeof(recv_buf) - resultsize - 1); + status = + BIO_read(bufferedBio, (BYTE*)recv_buf + resultsize, sizeof(recv_buf) - resultsize - 1); if (status < 0) { @@ -508,7 +505,8 @@ static int recv_socks_reply(BIO* bufferedBio, BYTE* buf, int len, char* reason, else // if (status == 0) { /* Error? */ - WLog_ERR(TAG, "Failed reading %s reply from SOCKS proxy (BIO_read returned zero)", reason); + WLog_ERR(TAG, "Failed reading %s reply from SOCKS proxy (BIO_read returned zero)", + reason); return -1; } } @@ -529,8 +527,7 @@ static int recv_socks_reply(BIO* bufferedBio, BYTE* buf, int len, char* reason, } static BOOL socks_proxy_connect(BIO* bufferedBio, const char* proxyUsername, - const char* proxyPassword, - const char* hostname, UINT16 port) + const char* proxyPassword, const char* hostname, UINT16 port) { int status; int nauthMethods = 1, writeLen = 3; @@ -544,7 +541,7 @@ static BOOL socks_proxy_connect(BIO* bufferedBio, const char* proxyUsername, } /* select auth. method */ - buf[0] = 5; /* SOCKS version */ + buf[0] = 5; /* SOCKS version */ buf[1] = nauthMethods; /* #of methods offered */ buf[2] = AUTH_M_NO_AUTH; @@ -622,11 +619,11 @@ static BOOL socks_proxy_connect(BIO* bufferedBio, const char* proxyUsername, } /* CONN request */ - buf[0] = 5; /* SOCKS version */ + buf[0] = 5; /* SOCKS version */ buf[1] = SOCKS_CMD_CONNECT; /* command */ - buf[2] = 0; /* 3rd octet is reserved x00 */ - buf[3] = SOCKS_ADDR_FQDN; /* addr.type */ - buf[4] = hostnlen; /* DST.ADDR */ + buf[2] = 0; /* 3rd octet is reserved x00 */ + buf[3] = SOCKS_ADDR_FQDN; /* addr.type */ + buf[4] = hostnlen; /* DST.ADDR */ memcpy(buf + 5, hostname, hostnlen); /* follows DST.PORT in netw. format */ buf[hostnlen + 5] = (port >> 8) & 0xff; diff --git a/libfreerdp/core/proxy.h b/libfreerdp/core/proxy.h index daf211387..96f85d43f 100644 --- a/libfreerdp/core/proxy.h +++ b/libfreerdp/core/proxy.h @@ -24,9 +24,9 @@ #include BOOL proxy_prepare(rdpSettings* settings, const char** lpPeerHostname, UINT16* lpPeerPort, - const char **lpProxyUsername, const char **lpProxyPassword); + const char** lpProxyUsername, const char** lpProxyPassword); BOOL proxy_parse_uri(rdpSettings* settings, const char* uri); -BOOL proxy_connect(rdpSettings* settings, BIO* bio, const char *proxyUsername, const char *proxyPassword, - const char* hostname, UINT16 port); +BOOL proxy_connect(rdpSettings* settings, BIO* bio, const char* proxyUsername, + const char* proxyPassword, const char* hostname, UINT16 port); #endif /* FREERDP_LIB_CORE_HTTP_PROXY_H */ diff --git a/libfreerdp/core/rdp.c b/libfreerdp/core/rdp.c index 7b5521f9f..53d6bfb0d 100644 --- a/libfreerdp/core/rdp.c +++ b/libfreerdp/core/rdp.c @@ -34,42 +34,72 @@ #define TAG FREERDP_TAG("core.rdp") -const char* DATA_PDU_TYPE_STRINGS[80] = -{ - "?", "?", /* 0x00 - 0x01 */ +const char* DATA_PDU_TYPE_STRINGS[80] = { + "?", + "?", /* 0x00 - 0x01 */ "Update", /* 0x02 */ - "?", "?", "?", "?", "?", "?", "?", "?", /* 0x03 - 0x0A */ - "?", "?", "?", "?", "?", "?", "?", "?", "?", /* 0x0B - 0x13 */ + "?", + "?", + "?", + "?", + "?", + "?", + "?", + "?", /* 0x03 - 0x0A */ + "?", + "?", + "?", + "?", + "?", + "?", + "?", + "?", + "?", /* 0x0B - 0x13 */ "Control", /* 0x14 */ - "?", "?", "?", "?", "?", "?", /* 0x15 - 0x1A */ + "?", + "?", + "?", + "?", + "?", + "?", /* 0x15 - 0x1A */ "Pointer", /* 0x1B */ - "Input", /* 0x1C */ - "?", "?", /* 0x1D - 0x1E */ - "Synchronize", /* 0x1F */ - "?", /* 0x20 */ - "Refresh Rect", /* 0x21 */ - "Play Sound", /* 0x22 */ - "Suppress Output", /* 0x23 */ - "Shutdown Request", /* 0x24 */ - "Shutdown Denied", /* 0x25 */ - "Save Session Info", /* 0x26 */ - "Font List", /* 0x27 */ - "Font Map", /* 0x28 */ - "Set Keyboard Indicators", /* 0x29 */ - "?", /* 0x2A */ + "Input", /* 0x1C */ + "?", + "?", /* 0x1D - 0x1E */ + "Synchronize", /* 0x1F */ + "?", /* 0x20 */ + "Refresh Rect", /* 0x21 */ + "Play Sound", /* 0x22 */ + "Suppress Output", /* 0x23 */ + "Shutdown Request", /* 0x24 */ + "Shutdown Denied", /* 0x25 */ + "Save Session Info", /* 0x26 */ + "Font List", /* 0x27 */ + "Font Map", /* 0x28 */ + "Set Keyboard Indicators", /* 0x29 */ + "?", /* 0x2A */ "Bitmap Cache Persistent List", /* 0x2B */ - "Bitmap Cache Error", /* 0x2C */ - "Set Keyboard IME Status", /* 0x2D */ - "Offscreen Cache Error", /* 0x2E */ - "Set Error Info", /* 0x2F */ - "Draw Nine Grid Error", /* 0x30 */ - "Draw GDI+ Error", /* 0x31 */ - "ARC Status", /* 0x32 */ - "?", "?", "?", /* 0x33 - 0x35 */ - "Status Info", /* 0x36 */ + "Bitmap Cache Error", /* 0x2C */ + "Set Keyboard IME Status", /* 0x2D */ + "Offscreen Cache Error", /* 0x2E */ + "Set Error Info", /* 0x2F */ + "Draw Nine Grid Error", /* 0x30 */ + "Draw GDI+ Error", /* 0x31 */ + "ARC Status", /* 0x32 */ + "?", + "?", + "?", /* 0x33 - 0x35 */ + "Status Info", /* 0x36 */ "Monitor Layout", /* 0x37 */ - "FrameAcknowledge", "?", "?", /* 0x38 - 0x40 */ - "?", "?", "?", "?", "?", "?" /* 0x41 - 0x46 */ + "FrameAcknowledge", + "?", + "?", /* 0x38 - 0x40 */ + "?", + "?", + "?", + "?", + "?", + "?" /* 0x41 - 0x46 */ }; /** @@ -86,7 +116,7 @@ BOOL rdp_read_security_header(wStream* s, UINT16* flags, UINT16* length) return FALSE; Stream_Read_UINT16(s, *flags); /* flags */ - Stream_Seek(s, 2); /* flagsHi (unused) */ + Stream_Seek(s, 2); /* flagsHi (unused) */ if (length) *length -= 4; @@ -105,7 +135,7 @@ void rdp_write_security_header(wStream* s, UINT16 flags) { /* Basic Security Header */ Stream_Write_UINT16(s, flags); /* flags */ - Stream_Write_UINT16(s, 0); /* flagsHi (unused) */ + Stream_Write_UINT16(s, 0); /* flagsHi (unused) */ } BOOL rdp_read_share_control_header(wStream* s, UINT16* length, UINT16* type, UINT16* channel_id) @@ -122,15 +152,15 @@ BOOL rdp_read_share_control_header(wStream* s, UINT16* length, UINT16* type, UIN { rdp_read_flow_control_pdu(s, type); *channel_id = 0; - *length = 8; /* Flow control PDU is 8 bytes */ + *length = 8; /* Flow control PDU is 8 bytes */ return TRUE; } - if (((size_t) *length - 2) > Stream_GetRemainingLength(s)) + if (((size_t)*length - 2) > Stream_GetRemainingLength(s)) return FALSE; Stream_Read_UINT16(s, *type); /* pduType */ - *type &= 0x0F; /* type is in the 4 least significant bits */ + *type &= 0x0F; /* type is in the 4 least significant bits */ if (*length > 4) Stream_Read_UINT16(s, *channel_id); /* pduSource */ @@ -144,9 +174,9 @@ void rdp_write_share_control_header(wStream* s, UINT16 length, UINT16 type, UINT { length -= RDP_PACKET_HEADER_MAX_LENGTH; /* Share Control Header */ - Stream_Write_UINT16(s, length); /* totalLength */ + Stream_Write_UINT16(s, length); /* totalLength */ Stream_Write_UINT16(s, type | 0x10); /* pduType */ - Stream_Write_UINT16(s, channel_id); /* pduSource */ + Stream_Write_UINT16(s, channel_id); /* pduSource */ } BOOL rdp_read_share_data_header(wStream* s, UINT16* length, BYTE* type, UINT32* shareId, @@ -156,12 +186,12 @@ BOOL rdp_read_share_data_header(wStream* s, UINT16* length, BYTE* type, UINT32* return FALSE; /* Share Data Header */ - Stream_Read_UINT32(s, *shareId); /* shareId (4 bytes) */ - Stream_Seek_UINT8(s); /* pad1 (1 byte) */ - Stream_Seek_UINT8(s); /* streamId (1 byte) */ - Stream_Read_UINT16(s, *length); /* uncompressedLength (2 bytes) */ - Stream_Read_UINT8(s, *type); /* pduType2, Data PDU Type (1 byte) */ - Stream_Read_UINT8(s, *compressedType); /* compressedType (1 byte) */ + Stream_Read_UINT32(s, *shareId); /* shareId (4 bytes) */ + Stream_Seek_UINT8(s); /* pad1 (1 byte) */ + Stream_Seek_UINT8(s); /* streamId (1 byte) */ + Stream_Read_UINT16(s, *length); /* uncompressedLength (2 bytes) */ + Stream_Read_UINT8(s, *type); /* pduType2, Data PDU Type (1 byte) */ + Stream_Read_UINT8(s, *compressedType); /* compressedType (1 byte) */ Stream_Read_UINT16(s, *compressedLength); /* compressedLength (2 bytes) */ return TRUE; } @@ -172,13 +202,13 @@ void rdp_write_share_data_header(wStream* s, UINT16 length, BYTE type, UINT32 sh length -= RDP_SHARE_CONTROL_HEADER_LENGTH; length -= RDP_SHARE_DATA_HEADER_LENGTH; /* Share Data Header */ - Stream_Write_UINT32(s, share_id); /* shareId (4 bytes) */ - Stream_Write_UINT8(s, 0); /* pad1 (1 byte) */ + Stream_Write_UINT32(s, share_id); /* shareId (4 bytes) */ + Stream_Write_UINT8(s, 0); /* pad1 (1 byte) */ Stream_Write_UINT8(s, STREAM_LOW); /* streamId (1 byte) */ - Stream_Write_UINT16(s, length); /* uncompressedLength (2 bytes) */ - Stream_Write_UINT8(s, type); /* pduType2, Data PDU Type (1 byte) */ - Stream_Write_UINT8(s, 0); /* compressedType (1 byte) */ - Stream_Write_UINT16(s, 0); /* compressedLength (2 bytes) */ + Stream_Write_UINT16(s, length); /* uncompressedLength (2 bytes) */ + Stream_Write_UINT8(s, type); /* pduType2, Data PDU Type (1 byte) */ + Stream_Write_UINT8(s, 0); /* compressedType (1 byte) */ + Stream_Write_UINT16(s, 0); /* compressedLength (2 bytes) */ } static BOOL rdp_security_stream_init(rdpRdp* rdp, wStream* s, BOOL sec_header) @@ -328,8 +358,8 @@ BOOL rdp_read_header(rdpRdp* rdp, wStream* s, UINT16* length, UINT16* channelId) UINT16 initiator; enum DomainMCSPDU MCSPDU; enum DomainMCSPDU domainMCSPDU; - MCSPDU = (rdp->settings->ServerMode) ? DomainMCSPDU_SendDataRequest : - DomainMCSPDU_SendDataIndication; + MCSPDU = (rdp->settings->ServerMode) ? DomainMCSPDU_SendDataRequest + : DomainMCSPDU_SendDataIndication; if (!tpkt_read_header(s, length)) return FALSE; @@ -437,10 +467,11 @@ void rdp_write_header(rdpRdp* rdp, wStream* s, UINT16 length, UINT16 channelId) { int body_length; enum DomainMCSPDU MCSPDU; - MCSPDU = (rdp->settings->ServerMode) ? DomainMCSPDU_SendDataIndication : - DomainMCSPDU_SendDataRequest; + MCSPDU = (rdp->settings->ServerMode) ? DomainMCSPDU_SendDataIndication + : DomainMCSPDU_SendDataRequest; - if ((rdp->sec_flags & SEC_ENCRYPT) && (rdp->settings->EncryptionMethods == ENCRYPTION_METHOD_FIPS)) + if ((rdp->sec_flags & SEC_ENCRYPT) && + (rdp->settings->EncryptionMethods == ENCRYPTION_METHOD_FIPS)) { int pad; body_length = length - RDP_PACKET_HEADER_MAX_LENGTH - 16; @@ -452,8 +483,8 @@ void rdp_write_header(rdpRdp* rdp, wStream* s, UINT16 length, UINT16 channelId) mcs_write_domain_mcspdu_header(s, MCSPDU, length, 0); per_write_integer16(s, rdp->mcs->userId, MCS_BASE_CHANNEL_ID); /* initiator */ - per_write_integer16(s, channelId, 0); /* channelId */ - Stream_Write_UINT8(s, 0x70); /* dataPriority + segmentation */ + per_write_integer16(s, channelId, 0); /* channelId */ + Stream_Write_UINT8(s, 0x70); /* dataPriority + segmentation */ /* * We always encode length in two bytes, even though we could use * only one byte if length <= 0x7F. It is just easier that way, @@ -483,7 +514,7 @@ static BOOL rdp_security_stream_out(rdpRdp* rdp, wStream* s, int length, UINT32 data = Stream_Pointer(s) + 12; length = length - (data - Stream_Buffer(s)); Stream_Write_UINT16(s, 0x10); /* length */ - Stream_Write_UINT8(s, 0x1); /* TSFIPS_VERSION 1*/ + Stream_Write_UINT8(s, 0x1); /* TSFIPS_VERSION 1*/ /* handle padding */ *pad = 8 - (length % 8); @@ -507,7 +538,8 @@ static BOOL rdp_security_stream_out(rdpRdp* rdp, wStream* s, int length, UINT32 length = length - (data - Stream_Buffer(s)); if (sec_flags & SEC_SECURE_CHECKSUM) - status = security_salted_mac_signature(rdp, data, length, TRUE, Stream_Pointer(s)); + status = + security_salted_mac_signature(rdp, data, length, TRUE, Stream_Pointer(s)); else status = security_mac_signature(rdp, data, length, Stream_Pointer(s)); @@ -651,8 +683,8 @@ BOOL rdp_send_data_pdu(rdpRdp* rdp, wStream* s, BYTE type, UINT16 channel_id) length += pad; Stream_SetPosition(s, length); Stream_SealLength(s); - WLog_DBG(TAG, "%s: sending data (type=0x%x size=%"PRIuz" channelId=%"PRIu16")", __FUNCTION__, - type, Stream_Length(s), channel_id); + WLog_DBG(TAG, "%s: sending data (type=0x%x size=%" PRIuz " channelId=%" PRIu16 ")", + __FUNCTION__, type, Stream_Length(s), channel_id); rdp->outPackets++; if (transport_write(rdp->transport, s) < 0) @@ -710,7 +742,7 @@ static BOOL rdp_recv_server_set_keyboard_indicators_pdu(rdpRdp* rdp, wStream* s) if (Stream_GetRemainingLength(s) < 4) return FALSE; - Stream_Read_UINT16(s, unitId); /* unitId (2 bytes) */ + Stream_Read_UINT16(s, unitId); /* unitId (2 bytes) */ Stream_Read_UINT16(s, ledFlags); /* ledFlags (2 bytes) */ IFCALL(context->update->SetKeyboardIndicators, context, ledFlags); return TRUE; @@ -728,8 +760,8 @@ static BOOL rdp_recv_server_set_keyboard_ime_status_pdu(rdpRdp* rdp, wStream* s) if (Stream_GetRemainingLength(s) < 10) return FALSE; - Stream_Read_UINT16(s, unitId); /* unitId (2 bytes) */ - Stream_Read_UINT32(s, imeState); /* imeState (4 bytes) */ + Stream_Read_UINT16(s, unitId); /* unitId (2 bytes) */ + Stream_Read_UINT32(s, imeState); /* imeState (4 bytes) */ Stream_Read_UINT32(s, imeConvMode); /* imeConvMode (4 bytes) */ IFCALL(rdp->update->SetKeyboardImeStatus, rdp->context, unitId, imeState, imeConvMode); return TRUE; @@ -754,7 +786,7 @@ static BOOL rdp_recv_server_auto_reconnect_status_pdu(rdpRdp* rdp, wStream* s) return FALSE; Stream_Read_UINT32(s, arcStatus); /* arcStatus (4 bytes) */ - WLog_WARN(TAG, "AutoReconnectStatus: 0x%08"PRIX32"", arcStatus); + WLog_WARN(TAG, "AutoReconnectStatus: 0x%08" PRIX32 "", arcStatus); return TRUE; } @@ -789,18 +821,18 @@ static BOOL rdp_recv_monitor_layout_pdu(rdpRdp* rdp, wStream* s) if ((Stream_GetRemainingLength(s) / 20) < monitorCount) return FALSE; - monitorDefArray = (MONITOR_DEF*) calloc(monitorCount, sizeof(MONITOR_DEF)); + monitorDefArray = (MONITOR_DEF*)calloc(monitorCount, sizeof(MONITOR_DEF)); if (!monitorDefArray) return FALSE; for (monitor = monitorDefArray, index = 0; index < monitorCount; index++, monitor++) { - Stream_Read_UINT32(s, monitor->left); /* left (4 bytes) */ - Stream_Read_UINT32(s, monitor->top); /* top (4 bytes) */ - Stream_Read_UINT32(s, monitor->right); /* right (4 bytes) */ + Stream_Read_UINT32(s, monitor->left); /* left (4 bytes) */ + Stream_Read_UINT32(s, monitor->top); /* top (4 bytes) */ + Stream_Read_UINT32(s, monitor->right); /* right (4 bytes) */ Stream_Read_UINT32(s, monitor->bottom); /* bottom (4 bytes) */ - Stream_Read_UINT32(s, monitor->flags); /* flags (4 bytes) */ + Stream_Read_UINT32(s, monitor->flags); /* flags (4 bytes) */ } IFCALLRET(rdp->update->RemoteMonitors, ret, rdp->context, monitorCount, monitorDefArray); @@ -817,7 +849,8 @@ int rdp_recv_data_pdu(rdpRdp* rdp, wStream* s) BYTE compressedType; UINT16 compressedLength; - if (!rdp_read_share_data_header(s, &length, &type, &shareId, &compressedType, &compressedLength)) + if (!rdp_read_share_data_header(s, &length, &type, &shareId, &compressedType, + &compressedLength)) { WLog_ERR(TAG, "rdp_read_share_data_header() failed"); return -1; @@ -831,13 +864,15 @@ int rdp_recv_data_pdu(rdpRdp* rdp, wStream* s) BYTE* pDstData = NULL; UINT32 SrcSize = compressedLength - 18; - if (Stream_GetRemainingLength(s) < (size_t) SrcSize) + if (Stream_GetRemainingLength(s) < (size_t)SrcSize) { - WLog_ERR(TAG, "bulk_decompress: not enough bytes for compressedLength %"PRIu16"", compressedLength); + WLog_ERR(TAG, "bulk_decompress: not enough bytes for compressedLength %" PRIu16 "", + compressedLength); return -1; } - if (bulk_decompress(rdp->bulk, Stream_Pointer(s), SrcSize, &pDstData, &DstSize, compressedType)) + if (bulk_decompress(rdp->bulk, Stream_Pointer(s), SrcSize, &pDstData, &DstSize, + compressedType)) { if (!(cs = StreamPool_Take(rdp->transport->ReceivePool, DstSize))) { @@ -859,8 +894,9 @@ int rdp_recv_data_pdu(rdpRdp* rdp, wStream* s) Stream_Seek(s, SrcSize); } - WLog_DBG(TAG, "recv %s Data PDU (0x%02"PRIX8"), length: %"PRIu16"", - type < ARRAYSIZE(DATA_PDU_TYPE_STRINGS) ? DATA_PDU_TYPE_STRINGS[type] : "???", type, length); + WLog_DBG(TAG, "recv %s Data PDU (0x%02" PRIX8 "), length: %" PRIu16 "", + type < ARRAYSIZE(DATA_PDU_TYPE_STRINGS) ? DATA_PDU_TYPE_STRINGS[type] : "???", type, + length); switch (type) { @@ -912,7 +948,9 @@ int rdp_recv_data_pdu(rdpRdp* rdp, wStream* s) case DATA_PDU_TYPE_SHUTDOWN_DENIED: if (!rdp_recv_server_shutdown_denied_pdu(rdp, cs)) { - WLog_ERR(TAG, "DATA_PDU_TYPE_SHUTDOWN_DENIED - rdp_recv_server_shutdown_denied_pdu() failed"); + WLog_ERR( + TAG, + "DATA_PDU_TYPE_SHUTDOWN_DENIED - rdp_recv_server_shutdown_denied_pdu() failed"); goto out_fail; } @@ -921,7 +959,8 @@ int rdp_recv_data_pdu(rdpRdp* rdp, wStream* s) case DATA_PDU_TYPE_SAVE_SESSION_INFO: if (!rdp_recv_save_session_info(rdp, cs)) { - WLog_ERR(TAG, "DATA_PDU_TYPE_SAVE_SESSION_INFO - rdp_recv_save_session_info() failed"); + WLog_ERR(TAG, + "DATA_PDU_TYPE_SAVE_SESSION_INFO - rdp_recv_save_session_info() failed"); goto out_fail; } @@ -939,8 +978,8 @@ int rdp_recv_data_pdu(rdpRdp* rdp, wStream* s) case DATA_PDU_TYPE_SET_KEYBOARD_INDICATORS: if (!rdp_recv_server_set_keyboard_indicators_pdu(rdp, cs)) { - WLog_ERR(TAG, - "DATA_PDU_TYPE_SET_KEYBOARD_INDICATORS - rdp_recv_server_set_keyboard_indicators_pdu() failed"); + WLog_ERR(TAG, "DATA_PDU_TYPE_SET_KEYBOARD_INDICATORS - " + "rdp_recv_server_set_keyboard_indicators_pdu() failed"); goto out_fail; } @@ -949,8 +988,8 @@ int rdp_recv_data_pdu(rdpRdp* rdp, wStream* s) case DATA_PDU_TYPE_SET_KEYBOARD_IME_STATUS: if (!rdp_recv_server_set_keyboard_ime_status_pdu(rdp, cs)) { - WLog_ERR(TAG, - "DATA_PDU_TYPE_SET_KEYBOARD_IME_STATUS - rdp_recv_server_set_keyboard_ime_status_pdu() failed"); + WLog_ERR(TAG, "DATA_PDU_TYPE_SET_KEYBOARD_IME_STATUS - " + "rdp_recv_server_set_keyboard_ime_status_pdu() failed"); goto out_fail; } @@ -959,7 +998,9 @@ int rdp_recv_data_pdu(rdpRdp* rdp, wStream* s) case DATA_PDU_TYPE_SET_ERROR_INFO: if (!rdp_recv_set_error_info_data_pdu(rdp, cs)) { - WLog_ERR(TAG, "DATA_PDU_TYPE_SET_ERROR_INFO - rdp_recv_set_error_info_data_pdu() failed"); + WLog_ERR( + TAG, + "DATA_PDU_TYPE_SET_ERROR_INFO - rdp_recv_set_error_info_data_pdu() failed"); goto out_fail; } @@ -968,7 +1009,8 @@ int rdp_recv_data_pdu(rdpRdp* rdp, wStream* s) case DATA_PDU_TYPE_ARC_STATUS: if (!rdp_recv_server_auto_reconnect_status_pdu(rdp, cs)) { - WLog_ERR(TAG, "DATA_PDU_TYPE_ARC_STATUS - rdp_recv_server_auto_reconnect_status_pdu() failed"); + WLog_ERR(TAG, "DATA_PDU_TYPE_ARC_STATUS - " + "rdp_recv_server_auto_reconnect_status_pdu() failed"); goto out_fail; } @@ -977,7 +1019,8 @@ int rdp_recv_data_pdu(rdpRdp* rdp, wStream* s) case DATA_PDU_TYPE_STATUS_INFO: if (!rdp_recv_server_status_info_pdu(rdp, cs)) { - WLog_ERR(TAG, "DATA_PDU_TYPE_STATUS_INFO - rdp_recv_server_status_info_pdu() failed"); + WLog_ERR(TAG, + "DATA_PDU_TYPE_STATUS_INFO - rdp_recv_server_status_info_pdu() failed"); goto out_fail; } @@ -986,7 +1029,8 @@ int rdp_recv_data_pdu(rdpRdp* rdp, wStream* s) case DATA_PDU_TYPE_MONITOR_LAYOUT: if (!rdp_recv_monitor_layout_pdu(rdp, cs)) { - WLog_ERR(TAG, "DATA_PDU_TYPE_MONITOR_LAYOUT - rdp_recv_monitor_layout_pdu() failed"); + WLog_ERR(TAG, + "DATA_PDU_TYPE_MONITOR_LAYOUT - rdp_recv_monitor_layout_pdu() failed"); goto out_fail; } @@ -1054,8 +1098,7 @@ int rdp_recv_out_of_sequence_pdu(rdpRdp* rdp, wStream* s) { return rdp_recv_enhanced_security_redirection_packet(rdp, s); } - else if (type == PDU_TYPE_FLOW_RESPONSE || - type == PDU_TYPE_FLOW_STOP || + else if (type == PDU_TYPE_FLOW_RESPONSE || type == PDU_TYPE_FLOW_STOP || type == PDU_TYPE_FLOW_TEST) { return 0; @@ -1076,12 +1119,12 @@ void rdp_read_flow_control_pdu(wStream* s, UINT16* type) * Switched the order of these two fields to match this observation. */ UINT8 pduType; - Stream_Read_UINT8(s, pduType); /* pduTypeFlow */ + Stream_Read_UINT8(s, pduType); /* pduTypeFlow */ *type = pduType; - Stream_Seek_UINT8(s); /* pad8bits */ - Stream_Seek_UINT8(s); /* flowIdentifier */ - Stream_Seek_UINT8(s); /* flowNumber */ - Stream_Seek_UINT16(s); /* pduSource */ + Stream_Seek_UINT8(s); /* pad8bits */ + Stream_Seek_UINT8(s); /* flowIdentifier */ + Stream_Seek_UINT8(s); /* flowNumber */ + Stream_Seek_UINT16(s); /* pduSource */ } /** @@ -1110,11 +1153,11 @@ BOOL rdp_decrypt(rdpRdp* rdp, wStream* s, INT32 length, UINT16 securityFlags) if (Stream_GetRemainingLength(s) < 12) return FALSE; - Stream_Read_UINT16(s, len); /* 0x10 */ + Stream_Read_UINT16(s, len); /* 0x10 */ Stream_Read_UINT8(s, version); /* 0x1 */ Stream_Read_UINT8(s, pad); sig = Stream_Pointer(s); - Stream_Seek(s, 8); /* signature */ + Stream_Seek(s, 8); /* signature */ length -= 12; padLength = length - pad; @@ -1167,7 +1210,7 @@ BOOL rdp_decrypt(rdpRdp* rdp, wStream* s, INT32 length, UINT16 securityFlags) * us to work with broken RDP clients and servers that * generate invalid signatures. */ - //return FALSE; + // return FALSE; } return TRUE; @@ -1275,11 +1318,11 @@ static int rdp_recv_tpkt_pdu(rdpRdp* rdp, wStream* s) case PDU_TYPE_FLOW_RESPONSE: case PDU_TYPE_FLOW_STOP: case PDU_TYPE_FLOW_TEST: - WLog_DBG(TAG, "flow message 0x%04"PRIX16"", pduType); + WLog_DBG(TAG, "flow message 0x%04" PRIX16 "", pduType); break; default: - WLog_ERR(TAG, "incorrect PDU type: 0x%04"PRIX16"", pduType); + WLog_ERR(TAG, "incorrect PDU type: 0x%04" PRIX16 "", pduType); break; } @@ -1322,7 +1365,7 @@ static int rdp_recv_fastpath_pdu(rdpRdp* rdp, wStream* s) if ((length == 0) || (length > Stream_GetRemainingLength(s))) { - WLog_ERR(TAG, "incorrect FastPath PDU header length %"PRIu16"", length); + WLog_ERR(TAG, "incorrect FastPath PDU header length %" PRIu16 "", length); return -1; } @@ -1333,8 +1376,8 @@ static int rdp_recv_fastpath_pdu(rdpRdp* rdp, wStream* s) if (fastpath->encryptionFlags & FASTPATH_OUTPUT_ENCRYPTED) { - UINT16 flags = (fastpath->encryptionFlags & FASTPATH_OUTPUT_SECURE_CHECKSUM) ? SEC_SECURE_CHECKSUM : - 0; + UINT16 flags = + (fastpath->encryptionFlags & FASTPATH_OUTPUT_SECURE_CHECKSUM) ? SEC_SECURE_CHECKSUM : 0; if (!rdp_decrypt(rdp, s, length, flags)) { @@ -1357,7 +1400,7 @@ static int rdp_recv_pdu(rdpRdp* rdp, wStream* s) int rdp_recv_callback(rdpTransport* transport, wStream* s, void* extra) { int status = 0; - rdpRdp* rdp = (rdpRdp*) extra; + rdpRdp* rdp = (rdpRdp*)extra; /* * At any point in the connection sequence between when all @@ -1384,7 +1427,7 @@ int rdp_recv_callback(rdpTransport* transport, wStream* s, void* extra) } else if (nla_get_state(rdp->nla) == NLA_STATE_POST_NEGO) { - nego_recv(rdp->transport, s, (void*) rdp->nego); + nego_recv(rdp->transport, s, (void*)rdp->nego); if (nego_get_state(rdp->nego) != NEGO_STATE_FINAL) { @@ -1427,7 +1470,8 @@ int rdp_recv_callback(rdpTransport* transport, wStream* s, void* extra) if (!mcs_client_begin(rdp->mcs)) { - WLog_ERR(TAG, "rdp_recv_callback: CONNECTION_STATE_NLA - mcs_client_begin() fail"); + WLog_ERR(TAG, + "rdp_recv_callback: CONNECTION_STATE_NLA - mcs_client_begin() fail"); return -1; } } @@ -1475,8 +1519,8 @@ int rdp_recv_callback(rdpTransport* transport, wStream* s, void* extra) case CONNECTION_STATE_MCS_CHANNEL_JOIN: if (!rdp_client_connect_mcs_channel_join_confirm(rdp, s)) { - WLog_ERR(TAG, - "rdp_recv_callback: CONNECTION_STATE_MCS_CHANNEL_JOIN - rdp_client_connect_mcs_channel_join_confirm() fail"); + WLog_ERR(TAG, "rdp_recv_callback: CONNECTION_STATE_MCS_CHANNEL_JOIN - " + "rdp_client_connect_mcs_channel_join_confirm() fail"); status = -1; } @@ -1486,7 +1530,8 @@ int rdp_recv_callback(rdpTransport* transport, wStream* s, void* extra) status = rdp_client_connect_license(rdp, s); if (status < 0) - WLog_DBG(TAG, "CONNECTION_STATE_LICENSING - rdp_client_connect_license() - %i", status); + WLog_DBG(TAG, "CONNECTION_STATE_LICENSING - rdp_client_connect_license() - %i", + status); break; @@ -1494,7 +1539,9 @@ int rdp_recv_callback(rdpTransport* transport, wStream* s, void* extra) status = rdp_client_connect_demand_active(rdp, s); if (status < 0) - WLog_DBG(TAG, "CONNECTION_STATE_CAPABILITIES_EXCHANGE - rdp_client_connect_demand_active() - %i", + WLog_DBG(TAG, + "CONNECTION_STATE_CAPABILITIES_EXCHANGE - " + "rdp_client_connect_demand_active() - %i", status); break; @@ -1591,7 +1638,8 @@ int rdp_check_fds(rdpRdp* rdp) return status; } -BOOL freerdp_get_stats(rdpRdp* rdp, UINT64 *inBytes, UINT64 *outBytes, UINT64 *inPackets, UINT64 *outPackets) +BOOL freerdp_get_stats(rdpRdp* rdp, UINT64* inBytes, UINT64* outBytes, UINT64* inPackets, + UINT64* outPackets) { if (!rdp) return FALSE; @@ -1618,7 +1666,7 @@ rdpRdp* rdp_new(rdpContext* context) rdpRdp* rdp; DWORD flags; BOOL newSettings = FALSE; - rdp = (rdpRdp*) calloc(1, sizeof(rdpRdp)); + rdp = (rdpRdp*)calloc(1, sizeof(rdpRdp)); if (!rdp) return NULL; @@ -1843,4 +1891,3 @@ void rdp_free(rdpRdp* rdp) free(rdp); } } - diff --git a/libfreerdp/core/rdp.h b/libfreerdp/core/rdp.h index 88103f033..5c194a64b 100644 --- a/libfreerdp/core/rdp.h +++ b/libfreerdp/core/rdp.h @@ -55,80 +55,80 @@ #include /* Security Header Flags */ -#define SEC_EXCHANGE_PKT 0x0001 -#define SEC_TRANSPORT_REQ 0x0002 -#define SEC_TRANSPORT_RSP 0x0004 -#define SEC_ENCRYPT 0x0008 -#define SEC_RESET_SEQNO 0x0010 -#define SEC_IGNORE_SEQNO 0x0020 -#define SEC_INFO_PKT 0x0040 -#define SEC_LICENSE_PKT 0x0080 -#define SEC_LICENSE_ENCRYPT_CS 0x0200 -#define SEC_LICENSE_ENCRYPT_SC 0x0200 -#define SEC_REDIRECTION_PKT 0x0400 -#define SEC_SECURE_CHECKSUM 0x0800 -#define SEC_AUTODETECT_REQ 0x1000 -#define SEC_AUTODETECT_RSP 0x2000 -#define SEC_HEARTBEAT 0x4000 -#define SEC_FLAGSHI_VALID 0x8000 +#define SEC_EXCHANGE_PKT 0x0001 +#define SEC_TRANSPORT_REQ 0x0002 +#define SEC_TRANSPORT_RSP 0x0004 +#define SEC_ENCRYPT 0x0008 +#define SEC_RESET_SEQNO 0x0010 +#define SEC_IGNORE_SEQNO 0x0020 +#define SEC_INFO_PKT 0x0040 +#define SEC_LICENSE_PKT 0x0080 +#define SEC_LICENSE_ENCRYPT_CS 0x0200 +#define SEC_LICENSE_ENCRYPT_SC 0x0200 +#define SEC_REDIRECTION_PKT 0x0400 +#define SEC_SECURE_CHECKSUM 0x0800 +#define SEC_AUTODETECT_REQ 0x1000 +#define SEC_AUTODETECT_RSP 0x2000 +#define SEC_HEARTBEAT 0x4000 +#define SEC_FLAGSHI_VALID 0x8000 -#define SEC_PKT_CS_MASK (SEC_EXCHANGE_PKT | SEC_INFO_PKT) -#define SEC_PKT_SC_MASK (SEC_LICENSE_PKT | SEC_REDIRECTION_PKT) -#define SEC_PKT_MASK (SEC_PKT_CS_MASK | SEC_PKT_SC_MASK) +#define SEC_PKT_CS_MASK (SEC_EXCHANGE_PKT | SEC_INFO_PKT) +#define SEC_PKT_SC_MASK (SEC_LICENSE_PKT | SEC_REDIRECTION_PKT) +#define SEC_PKT_MASK (SEC_PKT_CS_MASK | SEC_PKT_SC_MASK) -#define RDP_SECURITY_HEADER_LENGTH 4 -#define RDP_SHARE_CONTROL_HEADER_LENGTH 6 -#define RDP_SHARE_DATA_HEADER_LENGTH 12 -#define RDP_PACKET_HEADER_MAX_LENGTH (TPDU_DATA_LENGTH + MCS_SEND_DATA_HEADER_MAX_LENGTH) +#define RDP_SECURITY_HEADER_LENGTH 4 +#define RDP_SHARE_CONTROL_HEADER_LENGTH 6 +#define RDP_SHARE_DATA_HEADER_LENGTH 12 +#define RDP_PACKET_HEADER_MAX_LENGTH (TPDU_DATA_LENGTH + MCS_SEND_DATA_HEADER_MAX_LENGTH) -#define PDU_TYPE_DEMAND_ACTIVE 0x1 -#define PDU_TYPE_CONFIRM_ACTIVE 0x3 -#define PDU_TYPE_DEACTIVATE_ALL 0x6 -#define PDU_TYPE_DATA 0x7 -#define PDU_TYPE_SERVER_REDIRECTION 0xA +#define PDU_TYPE_DEMAND_ACTIVE 0x1 +#define PDU_TYPE_CONFIRM_ACTIVE 0x3 +#define PDU_TYPE_DEACTIVATE_ALL 0x6 +#define PDU_TYPE_DATA 0x7 +#define PDU_TYPE_SERVER_REDIRECTION 0xA -#define PDU_TYPE_FLOW_TEST 0x41 -#define PDU_TYPE_FLOW_RESPONSE 0x42 -#define PDU_TYPE_FLOW_STOP 0x43 +#define PDU_TYPE_FLOW_TEST 0x41 +#define PDU_TYPE_FLOW_RESPONSE 0x42 +#define PDU_TYPE_FLOW_STOP 0x43 -#define FINALIZE_SC_SYNCHRONIZE_PDU 0x01 -#define FINALIZE_SC_CONTROL_COOPERATE_PDU 0x02 -#define FINALIZE_SC_CONTROL_GRANTED_PDU 0x04 -#define FINALIZE_SC_FONT_MAP_PDU 0x08 -#define FINALIZE_SC_COMPLETE 0x0F +#define FINALIZE_SC_SYNCHRONIZE_PDU 0x01 +#define FINALIZE_SC_CONTROL_COOPERATE_PDU 0x02 +#define FINALIZE_SC_CONTROL_GRANTED_PDU 0x04 +#define FINALIZE_SC_FONT_MAP_PDU 0x08 +#define FINALIZE_SC_COMPLETE 0x0F /* Data PDU Types */ -#define DATA_PDU_TYPE_UPDATE 0x02 -#define DATA_PDU_TYPE_CONTROL 0x14 -#define DATA_PDU_TYPE_POINTER 0x1B -#define DATA_PDU_TYPE_INPUT 0x1C -#define DATA_PDU_TYPE_SYNCHRONIZE 0x1F -#define DATA_PDU_TYPE_REFRESH_RECT 0x21 -#define DATA_PDU_TYPE_PLAY_SOUND 0x22 -#define DATA_PDU_TYPE_SUPPRESS_OUTPUT 0x23 -#define DATA_PDU_TYPE_SHUTDOWN_REQUEST 0x24 -#define DATA_PDU_TYPE_SHUTDOWN_DENIED 0x25 -#define DATA_PDU_TYPE_SAVE_SESSION_INFO 0x26 -#define DATA_PDU_TYPE_FONT_LIST 0x27 -#define DATA_PDU_TYPE_FONT_MAP 0x28 -#define DATA_PDU_TYPE_SET_KEYBOARD_INDICATORS 0x29 -#define DATA_PDU_TYPE_BITMAP_CACHE_PERSISTENT_LIST 0x2B -#define DATA_PDU_TYPE_BITMAP_CACHE_ERROR 0x2C -#define DATA_PDU_TYPE_SET_KEYBOARD_IME_STATUS 0x2D -#define DATA_PDU_TYPE_OFFSCREEN_CACHE_ERROR 0x2E -#define DATA_PDU_TYPE_SET_ERROR_INFO 0x2F -#define DATA_PDU_TYPE_DRAW_NINEGRID_ERROR 0x30 -#define DATA_PDU_TYPE_DRAW_GDIPLUS_ERROR 0x31 -#define DATA_PDU_TYPE_ARC_STATUS 0x32 -#define DATA_PDU_TYPE_STATUS_INFO 0x36 -#define DATA_PDU_TYPE_MONITOR_LAYOUT 0x37 -#define DATA_PDU_TYPE_FRAME_ACKNOWLEDGE 0x38 +#define DATA_PDU_TYPE_UPDATE 0x02 +#define DATA_PDU_TYPE_CONTROL 0x14 +#define DATA_PDU_TYPE_POINTER 0x1B +#define DATA_PDU_TYPE_INPUT 0x1C +#define DATA_PDU_TYPE_SYNCHRONIZE 0x1F +#define DATA_PDU_TYPE_REFRESH_RECT 0x21 +#define DATA_PDU_TYPE_PLAY_SOUND 0x22 +#define DATA_PDU_TYPE_SUPPRESS_OUTPUT 0x23 +#define DATA_PDU_TYPE_SHUTDOWN_REQUEST 0x24 +#define DATA_PDU_TYPE_SHUTDOWN_DENIED 0x25 +#define DATA_PDU_TYPE_SAVE_SESSION_INFO 0x26 +#define DATA_PDU_TYPE_FONT_LIST 0x27 +#define DATA_PDU_TYPE_FONT_MAP 0x28 +#define DATA_PDU_TYPE_SET_KEYBOARD_INDICATORS 0x29 +#define DATA_PDU_TYPE_BITMAP_CACHE_PERSISTENT_LIST 0x2B +#define DATA_PDU_TYPE_BITMAP_CACHE_ERROR 0x2C +#define DATA_PDU_TYPE_SET_KEYBOARD_IME_STATUS 0x2D +#define DATA_PDU_TYPE_OFFSCREEN_CACHE_ERROR 0x2E +#define DATA_PDU_TYPE_SET_ERROR_INFO 0x2F +#define DATA_PDU_TYPE_DRAW_NINEGRID_ERROR 0x30 +#define DATA_PDU_TYPE_DRAW_GDIPLUS_ERROR 0x31 +#define DATA_PDU_TYPE_ARC_STATUS 0x32 +#define DATA_PDU_TYPE_STATUS_INFO 0x36 +#define DATA_PDU_TYPE_MONITOR_LAYOUT 0x37 +#define DATA_PDU_TYPE_FRAME_ACKNOWLEDGE 0x38 /* Stream Identifiers */ -#define STREAM_UNDEFINED 0x00 -#define STREAM_LOW 0x01 -#define STREAM_MED 0x02 -#define STREAM_HI 0x04 +#define STREAM_UNDEFINED 0x00 +#define STREAM_LOW 0x01 +#define STREAM_MED 0x02 +#define STREAM_HI 0x04 struct rdp_rdp { @@ -184,51 +184,43 @@ struct rdp_rdp FREERDP_LOCAL BOOL rdp_read_security_header(wStream* s, UINT16* flags, UINT16* length); FREERDP_LOCAL void rdp_write_security_header(wStream* s, UINT16 flags); -FREERDP_LOCAL BOOL rdp_read_share_control_header(wStream* s, UINT16* length, - UINT16* type, UINT16* channel_id); -FREERDP_LOCAL void rdp_write_share_control_header(wStream* s, UINT16 length, - UINT16 type, UINT16 channel_id); +FREERDP_LOCAL BOOL rdp_read_share_control_header(wStream* s, UINT16* length, UINT16* type, + UINT16* channel_id); +FREERDP_LOCAL void rdp_write_share_control_header(wStream* s, UINT16 length, UINT16 type, + UINT16 channel_id); -FREERDP_LOCAL BOOL rdp_read_share_data_header(wStream* s, UINT16* length, - BYTE* type, UINT32* share_id, - BYTE* compressed_type, UINT16* compressed_len); +FREERDP_LOCAL BOOL rdp_read_share_data_header(wStream* s, UINT16* length, BYTE* type, + UINT32* share_id, BYTE* compressed_type, + UINT16* compressed_len); -FREERDP_LOCAL void rdp_write_share_data_header(wStream* s, UINT16 length, - BYTE type, UINT32 share_id); +FREERDP_LOCAL void rdp_write_share_data_header(wStream* s, UINT16 length, BYTE type, + UINT32 share_id); FREERDP_LOCAL wStream* rdp_send_stream_init(rdpRdp* rdp); FREERDP_LOCAL wStream* rdp_send_stream_pdu_init(rdpRdp* rdp); -FREERDP_LOCAL BOOL rdp_read_header(rdpRdp* rdp, wStream* s, UINT16* length, - UINT16* channel_id); -FREERDP_LOCAL void rdp_write_header(rdpRdp* rdp, wStream* s, UINT16 length, - UINT16 channel_id); +FREERDP_LOCAL BOOL rdp_read_header(rdpRdp* rdp, wStream* s, UINT16* length, UINT16* channel_id); +FREERDP_LOCAL void rdp_write_header(rdpRdp* rdp, wStream* s, UINT16 length, UINT16 channel_id); -FREERDP_LOCAL BOOL rdp_send_pdu(rdpRdp* rdp, wStream* s, UINT16 type, - UINT16 channel_id); +FREERDP_LOCAL BOOL rdp_send_pdu(rdpRdp* rdp, wStream* s, UINT16 type, UINT16 channel_id); FREERDP_LOCAL wStream* rdp_data_pdu_init(rdpRdp* rdp); -FREERDP_LOCAL BOOL rdp_send_data_pdu(rdpRdp* rdp, wStream* s, BYTE type, - UINT16 channel_id); +FREERDP_LOCAL BOOL rdp_send_data_pdu(rdpRdp* rdp, wStream* s, BYTE type, UINT16 channel_id); FREERDP_LOCAL int rdp_recv_data_pdu(rdpRdp* rdp, wStream* s); FREERDP_LOCAL BOOL rdp_send(rdpRdp* rdp, wStream* s, UINT16 channelId); -FREERDP_LOCAL int rdp_send_channel_data(rdpRdp* rdp, UINT16 channelId, - const BYTE* data, int size); +FREERDP_LOCAL int rdp_send_channel_data(rdpRdp* rdp, UINT16 channelId, const BYTE* data, int size); FREERDP_LOCAL wStream* rdp_message_channel_pdu_init(rdpRdp* rdp); -FREERDP_LOCAL BOOL rdp_send_message_channel_pdu(rdpRdp* rdp, wStream* s, - UINT16 sec_flags); -FREERDP_LOCAL int rdp_recv_message_channel_pdu(rdpRdp* rdp, wStream* s, - UINT16 securityFlags); +FREERDP_LOCAL BOOL rdp_send_message_channel_pdu(rdpRdp* rdp, wStream* s, UINT16 sec_flags); +FREERDP_LOCAL int rdp_recv_message_channel_pdu(rdpRdp* rdp, wStream* s, UINT16 securityFlags); FREERDP_LOCAL int rdp_recv_out_of_sequence_pdu(rdpRdp* rdp, wStream* s); FREERDP_LOCAL void rdp_read_flow_control_pdu(wStream* s, UINT16* type); -FREERDP_LOCAL int rdp_recv_callback(rdpTransport* transport, wStream* s, - void* extra); +FREERDP_LOCAL int rdp_recv_callback(rdpTransport* transport, wStream* s, void* extra); FREERDP_LOCAL int rdp_check_fds(rdpRdp* rdp); @@ -241,7 +233,10 @@ FREERDP_LOCAL void rdp_free(rdpRdp* rdp); #define DEBUG_RDP(...) WLog_DBG(RDP_TAG, __VA_ARGS__) extern const char* DATA_PDU_TYPE_STRINGS[80]; #else -#define DEBUG_RDP(...) do { } while (0) +#define DEBUG_RDP(...) \ + do \ + { \ + } while (0) #endif BOOL rdp_decrypt(rdpRdp* rdp, wStream* s, INT32 length, UINT16 securityFlags); diff --git a/libfreerdp/core/redirection.c b/libfreerdp/core/redirection.c index 1ce2ac538..9f94583b8 100644 --- a/libfreerdp/core/redirection.c +++ b/libfreerdp/core/redirection.c @@ -102,7 +102,7 @@ static BOOL rdp_redirection_read_unicode_string(wStream* s, char** str, size_t m if (Stream_GetRemainingLength(s) < 4) { - WLog_ERR(TAG, "rdp_redirection_read_string failure: cannot read length"); + WLog_ERR(TAG, "rdp_redirection_read_string failure: cannot read length"); return FALSE; } @@ -110,7 +110,8 @@ static BOOL rdp_redirection_read_unicode_string(wStream* s, char** str, size_t m if ((length % 2) || length < 2 || length > maxLength) { - WLog_ERR(TAG, "rdp_redirection_read_string failure: invalid unicode string length: %"PRIu32"", + WLog_ERR(TAG, + "rdp_redirection_read_string failure: invalid unicode string length: %" PRIu32 "", length); return FALSE; } @@ -118,22 +119,23 @@ static BOOL rdp_redirection_read_unicode_string(wStream* s, char** str, size_t m if (Stream_GetRemainingLength(s) < length) { WLog_ERR(TAG, - "rdp_redirection_read_string failure: insufficient stream length (%"PRIu32" bytes required)", + "rdp_redirection_read_string failure: insufficient stream length (%" PRIu32 + " bytes required)", length); return FALSE; } - wstr = (WCHAR*) Stream_Pointer(s); + wstr = (WCHAR*)Stream_Pointer(s); if (wstr[length / 2 - 1]) { - WLog_ERR(TAG, "rdp_redirection_read_string failure: unterminated unicode string"); + WLog_ERR(TAG, "rdp_redirection_read_string failure: unterminated unicode string"); return FALSE; } if (ConvertFromUnicode(CP_UTF8, 0, wstr, -1, str, 0, NULL, NULL) < 1) { - WLog_ERR(TAG, "rdp_redirection_read_string failure: string conversion failed"); + WLog_ERR(TAG, "rdp_redirection_read_string failure: string conversion failed"); return FALSE; } @@ -153,7 +155,7 @@ int rdp_redirection_apply_settings(rdpRdp* rdp) /* LoadBalanceInfo may not contain a null terminator */ free(settings->LoadBalanceInfo); settings->LoadBalanceInfoLength = redirection->LoadBalanceInfoLength; - settings->LoadBalanceInfo = (BYTE*) malloc(settings->LoadBalanceInfoLength); + settings->LoadBalanceInfo = (BYTE*)malloc(settings->LoadBalanceInfoLength); if (!settings->LoadBalanceInfo) return -1; @@ -225,8 +227,8 @@ int rdp_redirection_apply_settings(rdpRdp* rdp) /* For security reasons we'll allocate an additional zero WCHAR at the * end of the buffer that is not included in RedirectionPasswordLength */ - settings->RedirectionPassword = (BYTE*) calloc(1, - settings->RedirectionPasswordLength + sizeof(WCHAR)); + settings->RedirectionPassword = + (BYTE*)calloc(1, settings->RedirectionPasswordLength + sizeof(WCHAR)); if (!settings->RedirectionPassword) return -1; @@ -240,12 +242,13 @@ int rdp_redirection_apply_settings(rdpRdp* rdp) /* TsvUrl may not contain a null terminator */ free(settings->RedirectionTsvUrl); settings->RedirectionTsvUrlLength = redirection->TsvUrlLength; - settings->RedirectionTsvUrl = (BYTE*) malloc(settings->RedirectionTsvUrlLength); + settings->RedirectionTsvUrl = (BYTE*)malloc(settings->RedirectionTsvUrlLength); if (!settings->RedirectionTsvUrl) return -1; - CopyMemory(settings->RedirectionTsvUrl, redirection->TsvUrl, settings->RedirectionTsvUrlLength); + CopyMemory(settings->RedirectionTsvUrl, redirection->TsvUrl, + settings->RedirectionTsvUrlLength); } if (settings->RedirectionFlags & LB_TARGET_NET_ADDRESSES) @@ -253,7 +256,8 @@ int rdp_redirection_apply_settings(rdpRdp* rdp) UINT32 i; freerdp_target_net_addresses_free(settings); settings->TargetNetAddressCount = redirection->TargetNetAddressesCount; - settings->TargetNetAddresses = (char**) calloc(settings->TargetNetAddressCount, sizeof(char*)); + settings->TargetNetAddresses = + (char**)calloc(settings->TargetNetAddressCount, sizeof(char*)); if (!settings->TargetNetAddresses) { @@ -289,12 +293,13 @@ static BOOL rdp_recv_server_redirection_pdu(rdpRdp* rdp, wStream* s) if (Stream_GetRemainingLength(s) < 12) return -1; - Stream_Read_UINT16(s, flags); /* flags (2 bytes) */ - Stream_Read_UINT16(s, length); /* length (2 bytes) */ + Stream_Read_UINT16(s, flags); /* flags (2 bytes) */ + Stream_Read_UINT16(s, length); /* length (2 bytes) */ Stream_Read_UINT32(s, redirection->sessionID); /* sessionID (4 bytes) */ - Stream_Read_UINT32(s, redirection->flags); /* redirFlags (4 bytes) */ + Stream_Read_UINT32(s, redirection->flags); /* redirFlags (4 bytes) */ WLog_DBG(TAG, - "flags: 0x%04"PRIX16", redirFlags: 0x%08"PRIX32" length: %"PRIu16", sessionID: 0x%08"PRIX32"", + "flags: 0x%04" PRIX16 ", redirFlags: 0x%08" PRIX32 " length: %" PRIu16 + ", sessionID: 0x%08" PRIX32 "", flags, redirection->flags, length, redirection->sessionID); rdp_print_redirection_flags(redirection->flags); @@ -322,7 +327,7 @@ static BOOL rdp_recv_server_redirection_pdu(rdpRdp* rdp, wStream* s) * load balance info example data: * 0000 43 6f 6f 6b 69 65 3a 20 6d 73 74 73 3d 32 31 33 Cookie: msts=213 * 0010 34 30 32 36 34 33 32 2e 31 35 36 32 39 2e 30 30 4026432.15629.00 - * 0020 30 30 0d 0a 00.. + * 0020 30 30 0d 0a 00.. */ if (Stream_GetRemainingLength(s) < 4) return -1; @@ -332,14 +337,15 @@ static BOOL rdp_recv_server_redirection_pdu(rdpRdp* rdp, wStream* s) if (Stream_GetRemainingLength(s) < redirection->LoadBalanceInfoLength) return -1; - redirection->LoadBalanceInfo = (BYTE*) malloc(redirection->LoadBalanceInfoLength); + redirection->LoadBalanceInfo = (BYTE*)malloc(redirection->LoadBalanceInfoLength); if (!redirection->LoadBalanceInfo) return -1; Stream_Read(s, redirection->LoadBalanceInfo, redirection->LoadBalanceInfoLength); WLog_DBG(TAG, "loadBalanceInfo:"); - winpr_HexDump(TAG, WLOG_DEBUG, redirection->LoadBalanceInfo, redirection->LoadBalanceInfoLength); + winpr_HexDump(TAG, WLOG_DEBUG, redirection->LoadBalanceInfo, + redirection->LoadBalanceInfoLength); } if (redirection->flags & LB_USERNAME) @@ -397,7 +403,7 @@ static BOOL rdp_recv_server_redirection_pdu(rdpRdp* rdp, wStream* s) if (redirection->PasswordLength > LB_PASSWORD_MAX_LENGTH) return -1; - redirection->Password = (BYTE*) calloc(1, redirection->PasswordLength + sizeof(WCHAR)); + redirection->Password = (BYTE*)calloc(1, redirection->PasswordLength + sizeof(WCHAR)); if (!redirection->Password) return -1; @@ -435,7 +441,7 @@ static BOOL rdp_recv_server_redirection_pdu(rdpRdp* rdp, wStream* s) if (Stream_GetRemainingLength(s) < redirection->TsvUrlLength) return -1; - redirection->TsvUrl = (BYTE*) malloc(redirection->TsvUrlLength); + redirection->TsvUrl = (BYTE*)malloc(redirection->TsvUrlLength); if (!redirection->TsvUrl) return -1; @@ -457,14 +463,14 @@ static BOOL rdp_recv_server_redirection_pdu(rdpRdp* rdp, wStream* s) Stream_Read_UINT32(s, targetNetAddressesLength); Stream_Read_UINT32(s, redirection->TargetNetAddressesCount); count = redirection->TargetNetAddressesCount; - redirection->TargetNetAddresses = (char**) calloc(count, sizeof(char*)); + redirection->TargetNetAddresses = (char**)calloc(count, sizeof(char*)); if (!redirection->TargetNetAddresses) return FALSE; - WLog_DBG(TAG, "TargetNetAddressesCount: %"PRIu32"", redirection->TargetNetAddressesCount); + WLog_DBG(TAG, "TargetNetAddressesCount: %" PRIu32 "", redirection->TargetNetAddressesCount); - for (i = 0; i < (int) count; i++) + for (i = 0; i < (int)count; i++) { if (!rdp_redirection_read_unicode_string(s, &(redirection->TargetNetAddresses[i]), 80)) return FALSE; @@ -509,7 +515,7 @@ int rdp_recv_enhanced_security_redirection_packet(rdpRdp* rdp, wStream* s) rdpRedirection* redirection_new() { rdpRedirection* redirection; - redirection = (rdpRedirection*) calloc(1, sizeof(rdpRedirection)); + redirection = (rdpRedirection*)calloc(1, sizeof(rdpRedirection)); if (redirection) { @@ -535,7 +541,7 @@ void redirection_free(rdpRedirection* redirection) { int i; - for (i = 0; i < (int) redirection->TargetNetAddressesCount; i++) + for (i = 0; i < (int)redirection->TargetNetAddressesCount; i++) { free(redirection->TargetNetAddresses[i]); } @@ -546,4 +552,3 @@ void redirection_free(rdpRedirection* redirection) free(redirection); } } - diff --git a/libfreerdp/core/redirection.h b/libfreerdp/core/redirection.h index 588fe4bcd..660a4e08a 100644 --- a/libfreerdp/core/redirection.h +++ b/libfreerdp/core/redirection.h @@ -31,8 +31,7 @@ typedef struct rdp_redirection rdpRedirection; #include #include -FREERDP_LOCAL int rdp_recv_enhanced_security_redirection_packet(rdpRdp* rdp, - wStream* s); +FREERDP_LOCAL int rdp_recv_enhanced_security_redirection_packet(rdpRdp* rdp, wStream* s); FREERDP_LOCAL int rdp_redirection_apply_settings(rdpRdp* rdp); @@ -43,7 +42,10 @@ FREERDP_LOCAL void redirection_free(rdpRedirection* redirection); #ifdef WITH_DEBUG_REDIR #define DEBUG_REDIR(...) WLog_DBG(REDIR_TAG, __VA_ARGS__) #else -#define DEBUG_REDIR(...) do { } while (0) +#define DEBUG_REDIR(...) \ + do \ + { \ + } while (0) #endif #endif /* FREERDP_LIB_CORE_REDIRECTION_H */ diff --git a/libfreerdp/core/security.c b/libfreerdp/core/security.c index a6d8bd3dd..4cca6d02c 100644 --- a/libfreerdp/core/security.c +++ b/libfreerdp/core/security.c @@ -30,102 +30,60 @@ #define TAG FREERDP_TAG("core") /* 0x36 repeated 40 times */ -static const BYTE pad1[40] = -{ - "\x36\x36\x36\x36\x36\x36\x36\x36" - "\x36\x36\x36\x36\x36\x36\x36\x36" - "\x36\x36\x36\x36\x36\x36\x36\x36" - "\x36\x36\x36\x36\x36\x36\x36\x36" - "\x36\x36\x36\x36\x36\x36\x36\x36" -}; +static const BYTE pad1[40] = { "\x36\x36\x36\x36\x36\x36\x36\x36" + "\x36\x36\x36\x36\x36\x36\x36\x36" + "\x36\x36\x36\x36\x36\x36\x36\x36" + "\x36\x36\x36\x36\x36\x36\x36\x36" + "\x36\x36\x36\x36\x36\x36\x36\x36" }; /* 0x5C repeated 48 times */ -static const BYTE pad2[48] = -{ - "\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C" - "\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C" - "\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C" - "\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C" - "\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C" - "\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C" +static const BYTE pad2[48] = { "\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C" + "\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C" + "\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C" + "\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C" + "\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C" + "\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C" }; + +static const BYTE fips_reverse_table[256] = { + 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, + 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, + 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, + 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, + 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, + 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, + 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, + 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, + 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, + 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, + 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, + 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, + 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, + 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, + 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, + 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff }; -static const BYTE -fips_reverse_table[256] = -{ - 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, - 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, - 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, - 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, - 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, - 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, - 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, - 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, - 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, - 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, - 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, - 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, - 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, - 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, - 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, - 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, - 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, - 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, - 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, - 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, - 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, - 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, - 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, - 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, - 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, - 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, - 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, - 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, - 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, - 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, - 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, - 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff +static const BYTE fips_oddparity_table[256] = { + 0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x07, 0x07, 0x08, 0x08, 0x0b, 0x0b, 0x0d, 0x0d, 0x0e, 0x0e, + 0x10, 0x10, 0x13, 0x13, 0x15, 0x15, 0x16, 0x16, 0x19, 0x19, 0x1a, 0x1a, 0x1c, 0x1c, 0x1f, 0x1f, + 0x20, 0x20, 0x23, 0x23, 0x25, 0x25, 0x26, 0x26, 0x29, 0x29, 0x2a, 0x2a, 0x2c, 0x2c, 0x2f, 0x2f, + 0x31, 0x31, 0x32, 0x32, 0x34, 0x34, 0x37, 0x37, 0x38, 0x38, 0x3b, 0x3b, 0x3d, 0x3d, 0x3e, 0x3e, + 0x40, 0x40, 0x43, 0x43, 0x45, 0x45, 0x46, 0x46, 0x49, 0x49, 0x4a, 0x4a, 0x4c, 0x4c, 0x4f, 0x4f, + 0x51, 0x51, 0x52, 0x52, 0x54, 0x54, 0x57, 0x57, 0x58, 0x58, 0x5b, 0x5b, 0x5d, 0x5d, 0x5e, 0x5e, + 0x61, 0x61, 0x62, 0x62, 0x64, 0x64, 0x67, 0x67, 0x68, 0x68, 0x6b, 0x6b, 0x6d, 0x6d, 0x6e, 0x6e, + 0x70, 0x70, 0x73, 0x73, 0x75, 0x75, 0x76, 0x76, 0x79, 0x79, 0x7a, 0x7a, 0x7c, 0x7c, 0x7f, 0x7f, + 0x80, 0x80, 0x83, 0x83, 0x85, 0x85, 0x86, 0x86, 0x89, 0x89, 0x8a, 0x8a, 0x8c, 0x8c, 0x8f, 0x8f, + 0x91, 0x91, 0x92, 0x92, 0x94, 0x94, 0x97, 0x97, 0x98, 0x98, 0x9b, 0x9b, 0x9d, 0x9d, 0x9e, 0x9e, + 0xa1, 0xa1, 0xa2, 0xa2, 0xa4, 0xa4, 0xa7, 0xa7, 0xa8, 0xa8, 0xab, 0xab, 0xad, 0xad, 0xae, 0xae, + 0xb0, 0xb0, 0xb3, 0xb3, 0xb5, 0xb5, 0xb6, 0xb6, 0xb9, 0xb9, 0xba, 0xba, 0xbc, 0xbc, 0xbf, 0xbf, + 0xc1, 0xc1, 0xc2, 0xc2, 0xc4, 0xc4, 0xc7, 0xc7, 0xc8, 0xc8, 0xcb, 0xcb, 0xcd, 0xcd, 0xce, 0xce, + 0xd0, 0xd0, 0xd3, 0xd3, 0xd5, 0xd5, 0xd6, 0xd6, 0xd9, 0xd9, 0xda, 0xda, 0xdc, 0xdc, 0xdf, 0xdf, + 0xe0, 0xe0, 0xe3, 0xe3, 0xe5, 0xe5, 0xe6, 0xe6, 0xe9, 0xe9, 0xea, 0xea, 0xec, 0xec, 0xef, 0xef, + 0xf1, 0xf1, 0xf2, 0xf2, 0xf4, 0xf4, 0xf7, 0xf7, 0xf8, 0xf8, 0xfb, 0xfb, 0xfd, 0xfd, 0xfe, 0xfe }; -static const BYTE -fips_oddparity_table[256] = -{ - 0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x07, 0x07, - 0x08, 0x08, 0x0b, 0x0b, 0x0d, 0x0d, 0x0e, 0x0e, - 0x10, 0x10, 0x13, 0x13, 0x15, 0x15, 0x16, 0x16, - 0x19, 0x19, 0x1a, 0x1a, 0x1c, 0x1c, 0x1f, 0x1f, - 0x20, 0x20, 0x23, 0x23, 0x25, 0x25, 0x26, 0x26, - 0x29, 0x29, 0x2a, 0x2a, 0x2c, 0x2c, 0x2f, 0x2f, - 0x31, 0x31, 0x32, 0x32, 0x34, 0x34, 0x37, 0x37, - 0x38, 0x38, 0x3b, 0x3b, 0x3d, 0x3d, 0x3e, 0x3e, - 0x40, 0x40, 0x43, 0x43, 0x45, 0x45, 0x46, 0x46, - 0x49, 0x49, 0x4a, 0x4a, 0x4c, 0x4c, 0x4f, 0x4f, - 0x51, 0x51, 0x52, 0x52, 0x54, 0x54, 0x57, 0x57, - 0x58, 0x58, 0x5b, 0x5b, 0x5d, 0x5d, 0x5e, 0x5e, - 0x61, 0x61, 0x62, 0x62, 0x64, 0x64, 0x67, 0x67, - 0x68, 0x68, 0x6b, 0x6b, 0x6d, 0x6d, 0x6e, 0x6e, - 0x70, 0x70, 0x73, 0x73, 0x75, 0x75, 0x76, 0x76, - 0x79, 0x79, 0x7a, 0x7a, 0x7c, 0x7c, 0x7f, 0x7f, - 0x80, 0x80, 0x83, 0x83, 0x85, 0x85, 0x86, 0x86, - 0x89, 0x89, 0x8a, 0x8a, 0x8c, 0x8c, 0x8f, 0x8f, - 0x91, 0x91, 0x92, 0x92, 0x94, 0x94, 0x97, 0x97, - 0x98, 0x98, 0x9b, 0x9b, 0x9d, 0x9d, 0x9e, 0x9e, - 0xa1, 0xa1, 0xa2, 0xa2, 0xa4, 0xa4, 0xa7, 0xa7, - 0xa8, 0xa8, 0xab, 0xab, 0xad, 0xad, 0xae, 0xae, - 0xb0, 0xb0, 0xb3, 0xb3, 0xb5, 0xb5, 0xb6, 0xb6, - 0xb9, 0xb9, 0xba, 0xba, 0xbc, 0xbc, 0xbf, 0xbf, - 0xc1, 0xc1, 0xc2, 0xc2, 0xc4, 0xc4, 0xc7, 0xc7, - 0xc8, 0xc8, 0xcb, 0xcb, 0xcd, 0xcd, 0xce, 0xce, - 0xd0, 0xd0, 0xd3, 0xd3, 0xd5, 0xd5, 0xd6, 0xd6, - 0xd9, 0xd9, 0xda, 0xda, 0xdc, 0xdc, 0xdf, 0xdf, - 0xe0, 0xe0, 0xe3, 0xe3, 0xe5, 0xe5, 0xe6, 0xe6, - 0xe9, 0xe9, 0xea, 0xea, 0xec, 0xec, 0xef, 0xef, - 0xf1, 0xf1, 0xf2, 0xf2, 0xf4, 0xf4, 0xf7, 0xf7, - 0xf8, 0xf8, 0xfb, 0xfb, 0xfd, 0xfd, 0xfe, 0xfe -}; - -static BOOL security_salted_hash(const BYTE* salt, const BYTE* input, int length, - const BYTE* salt1, const BYTE* salt2, BYTE* output) +static BOOL security_salted_hash(const BYTE* salt, const BYTE* input, int length, const BYTE* salt1, + const BYTE* salt2, BYTE* output) { WINPR_DIGEST_CTX* sha1 = NULL; WINPR_DIGEST_CTX* md5 = NULL; @@ -160,9 +118,11 @@ static BOOL security_salted_hash(const BYTE* salt, const BYTE* input, int length if (!(md5 = winpr_Digest_New())) goto out; - /* Allow FIPS override for use of MD5 here, this is used for creating hashes of the premaster_secret and master_secret */ + /* Allow FIPS override for use of MD5 here, this is used for creating hashes of the + * premaster_secret and master_secret */ /* used for RDP licensing as described in MS-RDPELE. This is for RDP licensing packets */ - /* which will already be encrypted under FIPS, so the use of MD5 here is not for sensitive data protection. */ + /* which will already be encrypted under FIPS, so the use of MD5 here is not for sensitive data + * protection. */ if (!winpr_Digest_Init_Allow_FIPS(md5, WINPR_MD_MD5)) goto out; @@ -183,39 +143,46 @@ out: } static BOOL security_premaster_hash(const char* input, int length, const BYTE* premaster_secret, - const BYTE* client_random, const BYTE* server_random, BYTE* output) + const BYTE* client_random, const BYTE* server_random, + BYTE* output) { /* PremasterHash(Input) = SaltedHash(PremasterSecret, Input, ClientRandom, ServerRandom) */ - return security_salted_hash(premaster_secret, (BYTE*)input, length, client_random, server_random, output); + return security_salted_hash(premaster_secret, (BYTE*)input, length, client_random, + server_random, output); } BOOL security_master_secret(const BYTE* premaster_secret, const BYTE* client_random, - const BYTE* server_random, BYTE* output) + const BYTE* server_random, BYTE* output) { /* MasterSecret = PremasterHash('A') + PremasterHash('BB') + PremasterHash('CCC') */ - return security_premaster_hash("A", 1, premaster_secret, client_random, server_random, &output[0]) && - security_premaster_hash("BB", 2, premaster_secret, client_random, server_random, &output[16]) && - security_premaster_hash("CCC", 3, premaster_secret, client_random, server_random, &output[32]); + return security_premaster_hash("A", 1, premaster_secret, client_random, server_random, + &output[0]) && + security_premaster_hash("BB", 2, premaster_secret, client_random, server_random, + &output[16]) && + security_premaster_hash("CCC", 3, premaster_secret, client_random, server_random, + &output[32]); } static BOOL security_master_hash(const char* input, int length, const BYTE* master_secret, - const BYTE* client_random, const BYTE* server_random, BYTE* output) + const BYTE* client_random, const BYTE* server_random, BYTE* output) { /* MasterHash(Input) = SaltedHash(MasterSecret, Input, ServerRandom, ClientRandom) */ - return security_salted_hash(master_secret, (const BYTE*)input, length, server_random, client_random, output); + return security_salted_hash(master_secret, (const BYTE*)input, length, server_random, + client_random, output); } BOOL security_session_key_blob(const BYTE* master_secret, const BYTE* client_random, - const BYTE* server_random, BYTE* output) + const BYTE* server_random, BYTE* output) { /* MasterHash = MasterHash('A') + MasterHash('BB') + MasterHash('CCC') */ return security_master_hash("A", 1, master_secret, client_random, server_random, &output[0]) && - security_master_hash("BB", 2, master_secret, client_random, server_random, &output[16]) && - security_master_hash("CCC", 3, master_secret, client_random, server_random, &output[32]); + security_master_hash("BB", 2, master_secret, client_random, server_random, + &output[16]) && + security_master_hash("CCC", 3, master_secret, client_random, server_random, &output[32]); } void security_mac_salt_key(const BYTE* session_key_blob, const BYTE* client_random, - const BYTE* server_random, BYTE* output) + const BYTE* server_random, BYTE* output) { /* MacSaltKey = First128Bits(SessionKeyBlob) */ memcpy(output, session_key_blob, 16); @@ -250,7 +217,8 @@ out: return result; } -BOOL security_md5_16_32_32_Allow_FIPS(const BYTE* in0, const BYTE* in1, const BYTE* in2, BYTE* output) +BOOL security_md5_16_32_32_Allow_FIPS(const BYTE* in0, const BYTE* in1, const BYTE* in2, + BYTE* output) { WINPR_DIGEST_CTX* md5 = NULL; BOOL result = FALSE; @@ -278,23 +246,22 @@ BOOL security_licensing_encryption_key(const BYTE* session_key_blob, const BYTE* const BYTE* server_random, BYTE* output) { /* LicensingEncryptionKey = MD5(Second128Bits(SessionKeyBlob) + ClientRandom + ServerRandom)) - * Allow FIPS use of MD5 here, this is just used for creating the licensing encryption key as described in MS-RDPELE. - * This is for RDP licensing packets which will already be encrypted under FIPS, so the use of MD5 here is not for - * sensitive data protection. */ + * Allow FIPS use of MD5 here, this is just used for creating the licensing encryption key as + * described in MS-RDPELE. This is for RDP licensing packets which will already be encrypted + * under FIPS, so the use of MD5 here is not for sensitive data protection. */ return security_md5_16_32_32_Allow_FIPS(&session_key_blob[16], client_random, server_random, output); } void security_UINT32_le(BYTE* output, UINT32 value) { - output[0] = (value) & 0xFF; + output[0] = (value)&0xFF; output[1] = (value >> 8) & 0xFF; output[2] = (value >> 16) & 0xFF; output[3] = (value >> 24) & 0xFF; } -BOOL security_mac_data(const BYTE* mac_salt_key, const BYTE* data, UINT32 length, - BYTE* output) +BOOL security_mac_data(const BYTE* mac_salt_key, const BYTE* data, UINT32 length, BYTE* output) { WINPR_DIGEST_CTX* sha1 = NULL; WINPR_DIGEST_CTX* md5 = NULL; @@ -330,9 +297,12 @@ BOOL security_mac_data(const BYTE* mac_salt_key, const BYTE* data, UINT32 length if (!(md5 = winpr_Digest_New())) goto out; - /* Allow FIPS override for use of MD5 here, this is only used for creating the MACData field of the */ - /* Client Platform Challenge Response packet (from MS-RDPELE section 2.2.2.5). This is for RDP licensing packets */ - /* which will already be encrypted under FIPS, so the use of MD5 here is not for sensitive data protection. */ + /* Allow FIPS override for use of MD5 here, this is only used for creating the MACData field of + * the */ + /* Client Platform Challenge Response packet (from MS-RDPELE section 2.2.2.5). This is for RDP + * licensing packets */ + /* which will already be encrypted under FIPS, so the use of MD5 here is not for sensitive data + * protection. */ if (!winpr_Digest_Init_Allow_FIPS(md5, WINPR_MD_MD5)) goto out; @@ -355,7 +325,7 @@ out: return result; } -BOOL security_mac_signature(rdpRdp *rdp, const BYTE* data, UINT32 length, BYTE* output) +BOOL security_mac_signature(rdpRdp* rdp, const BYTE* data, UINT32 length, BYTE* output) { WINPR_DIGEST_CTX* sha1 = NULL; WINPR_DIGEST_CTX* md5 = NULL; @@ -414,8 +384,8 @@ out: return result; } -BOOL security_salted_mac_signature(rdpRdp *rdp, const BYTE* data, UINT32 length, - BOOL encryption, BYTE* output) +BOOL security_salted_mac_signature(rdpRdp* rdp, const BYTE* data, UINT32 length, BOOL encryption, + BYTE* output) { WINPR_DIGEST_CTX* sha1 = NULL; WINPR_DIGEST_CTX* md5 = NULL; @@ -492,21 +462,25 @@ out: } static BOOL security_A(BYTE* master_secret, const BYTE* client_random, BYTE* server_random, - BYTE* output) + BYTE* output) { - return - security_premaster_hash("A", 1, master_secret, client_random, server_random, &output[0]) && - security_premaster_hash("BB", 2, master_secret, client_random, server_random, &output[16]) && - security_premaster_hash("CCC", 3, master_secret, client_random, server_random, &output[32]); + return security_premaster_hash("A", 1, master_secret, client_random, server_random, + &output[0]) && + security_premaster_hash("BB", 2, master_secret, client_random, server_random, + &output[16]) && + security_premaster_hash("CCC", 3, master_secret, client_random, server_random, + &output[32]); } static BOOL security_X(BYTE* master_secret, const BYTE* client_random, BYTE* server_random, - BYTE* output) + BYTE* output) { - return - security_premaster_hash("X", 1, master_secret, client_random, server_random, &output[0]) && - security_premaster_hash("YY", 2, master_secret, client_random, server_random, &output[16]) && - security_premaster_hash("ZZZ", 3, master_secret, client_random, server_random, &output[32]); + return security_premaster_hash("X", 1, master_secret, client_random, server_random, + &output[0]) && + security_premaster_hash("YY", 2, master_secret, client_random, server_random, + &output[16]) && + security_premaster_hash("ZZZ", 3, master_secret, client_random, server_random, + &output[32]); } static void fips_expand_key_bits(BYTE* in, BYTE* out) @@ -613,7 +587,7 @@ BOOL security_establish_keys(const BYTE* client_random, rdpRdp* rdp) memcpy(pre_master_secret + 24, server_random, 24); if (!security_A(pre_master_secret, client_random, server_random, master_secret) || - !security_X(master_secret, client_random, server_random, session_key_blob)) + !security_X(master_secret, client_random, server_random, session_key_blob)) { return FALSE; } @@ -622,16 +596,22 @@ BOOL security_establish_keys(const BYTE* client_random, rdpRdp* rdp) if (rdp->settings->ServerMode) { - status = security_md5_16_32_32(&session_key_blob[16], client_random, server_random, rdp->encrypt_key); - status &= security_md5_16_32_32(&session_key_blob[32], client_random, server_random, rdp->decrypt_key); + status = security_md5_16_32_32(&session_key_blob[16], client_random, server_random, + rdp->encrypt_key); + status &= security_md5_16_32_32(&session_key_blob[32], client_random, server_random, + rdp->decrypt_key); } else { - /* Allow FIPS use of MD5 here, this is just used for generation of the SessionKeyBlob as described in MS-RDPELE. */ - /* This is for RDP licensing packets which will already be encrypted under FIPS, so the use of MD5 here is not */ + /* Allow FIPS use of MD5 here, this is just used for generation of the SessionKeyBlob as + * described in MS-RDPELE. */ + /* This is for RDP licensing packets which will already be encrypted under FIPS, so the use + * of MD5 here is not */ /* for sensitive data protection. */ - status = security_md5_16_32_32_Allow_FIPS(&session_key_blob[16], client_random, server_random, rdp->decrypt_key); - status &= security_md5_16_32_32_Allow_FIPS(&session_key_blob[32], client_random, server_random, rdp->encrypt_key); + status = security_md5_16_32_32_Allow_FIPS(&session_key_blob[16], client_random, + server_random, rdp->decrypt_key); + status &= security_md5_16_32_32_Allow_FIPS(&session_key_blob[32], client_random, + server_random, rdp->encrypt_key); } if (!status) @@ -660,8 +640,8 @@ BOOL security_establish_keys(const BYTE* client_random, rdpRdp* rdp) memcpy(rdp->encrypt_update_key, rdp->encrypt_key, 16); rdp->decrypt_use_count = 0; rdp->decrypt_checksum_use_count = 0; - rdp->encrypt_use_count =0; - rdp->encrypt_checksum_use_count =0; + rdp->encrypt_use_count = 0; + rdp->encrypt_checksum_use_count = 0; return TRUE; } @@ -765,8 +745,7 @@ BOOL security_decrypt(BYTE* data, size_t length, rdpRdp* rdp) return FALSE; winpr_RC4_Free(rdp->rc4_decrypt_key); - rdp->rc4_decrypt_key = winpr_RC4_New(rdp->decrypt_key, - rdp->rc4_key_len); + rdp->rc4_decrypt_key = winpr_RC4_New(rdp->decrypt_key, rdp->rc4_key_len); if (!rdp->rc4_decrypt_key) return FALSE; diff --git a/libfreerdp/core/security.h b/libfreerdp/core/security.h index 1617bc57d..5077fc94d 100644 --- a/libfreerdp/core/security.h +++ b/libfreerdp/core/security.h @@ -28,30 +28,29 @@ #include -FREERDP_LOCAL BOOL security_master_secret(const BYTE* premaster_secret, - const BYTE* client_random, const BYTE* server_random, BYTE* output); -FREERDP_LOCAL BOOL security_session_key_blob(const BYTE* master_secret, - const BYTE* client_random, const BYTE* server_random, BYTE* output); -FREERDP_LOCAL void security_mac_salt_key(const BYTE* session_key_blob, - const BYTE* client_random, const BYTE* server_random, BYTE* output); -FREERDP_LOCAL BOOL security_licensing_encryption_key(const BYTE* - session_key_blob, const BYTE* client_random, const BYTE* server_random, - BYTE* output); -FREERDP_LOCAL BOOL security_mac_data(const BYTE* mac_salt_key, const BYTE* data, - UINT32 length, BYTE* output); -FREERDP_LOCAL BOOL security_mac_signature(rdpRdp* rdp, const BYTE* data, - UINT32 length, BYTE* output); -FREERDP_LOCAL BOOL security_salted_mac_signature(rdpRdp* rdp, const BYTE* data, - UINT32 length, BOOL encryption, BYTE* output); -FREERDP_LOCAL BOOL security_establish_keys(const BYTE* client_random, - rdpRdp* rdp); +FREERDP_LOCAL BOOL security_master_secret(const BYTE* premaster_secret, const BYTE* client_random, + const BYTE* server_random, BYTE* output); +FREERDP_LOCAL BOOL security_session_key_blob(const BYTE* master_secret, const BYTE* client_random, + const BYTE* server_random, BYTE* output); +FREERDP_LOCAL void security_mac_salt_key(const BYTE* session_key_blob, const BYTE* client_random, + const BYTE* server_random, BYTE* output); +FREERDP_LOCAL BOOL security_licensing_encryption_key(const BYTE* session_key_blob, + const BYTE* client_random, + const BYTE* server_random, BYTE* output); +FREERDP_LOCAL BOOL security_mac_data(const BYTE* mac_salt_key, const BYTE* data, UINT32 length, + BYTE* output); +FREERDP_LOCAL BOOL security_mac_signature(rdpRdp* rdp, const BYTE* data, UINT32 length, + BYTE* output); +FREERDP_LOCAL BOOL security_salted_mac_signature(rdpRdp* rdp, const BYTE* data, UINT32 length, + BOOL encryption, BYTE* output); +FREERDP_LOCAL BOOL security_establish_keys(const BYTE* client_random, rdpRdp* rdp); FREERDP_LOCAL BOOL security_encrypt(BYTE* data, size_t length, rdpRdp* rdp); FREERDP_LOCAL BOOL security_decrypt(BYTE* data, size_t length, rdpRdp* rdp); -FREERDP_LOCAL BOOL security_hmac_signature(const BYTE* data, size_t length, - BYTE* output, rdpRdp* rdp); +FREERDP_LOCAL BOOL security_hmac_signature(const BYTE* data, size_t length, BYTE* output, + rdpRdp* rdp); FREERDP_LOCAL BOOL security_fips_encrypt(BYTE* data, size_t length, rdpRdp* rdp); FREERDP_LOCAL BOOL security_fips_decrypt(BYTE* data, size_t length, rdpRdp* rdp); -FREERDP_LOCAL BOOL security_fips_check_signature(const BYTE* data, size_t length, - const BYTE* sig, rdpRdp* rdp); +FREERDP_LOCAL BOOL security_fips_check_signature(const BYTE* data, size_t length, const BYTE* sig, + rdpRdp* rdp); #endif /* FREERDP_LIB_CORE_SECURITY_H */ diff --git a/libfreerdp/core/server.c b/libfreerdp/core/server.c index de49c426a..55dc9b8cc 100644 --- a/libfreerdp/core/server.c +++ b/libfreerdp/core/server.c @@ -43,7 +43,10 @@ #ifdef WITH_DEBUG_DVC #define DEBUG_DVC(...) WLog_DBG(TAG, __VA_ARGS__) #else -#define DEBUG_DVC(...) do { } while (0) +#define DEBUG_DVC(...) \ + do \ + { \ + } while (0) #endif struct _wtsChannelMessage @@ -58,8 +61,7 @@ typedef struct _wtsChannelMessage wtsChannelMessage; static DWORD g_SessionId = 1; static wHashTable* g_ServerHandles = NULL; -static rdpPeerChannel* wts_get_dvc_channel_by_id(WTSVirtualChannelManager* vcm, - UINT32 ChannelId) +static rdpPeerChannel* wts_get_dvc_channel_by_id(WTSVirtualChannelManager* vcm, UINT32 ChannelId) { int index; int count; @@ -70,8 +72,7 @@ static rdpPeerChannel* wts_get_dvc_channel_by_id(WTSVirtualChannelManager* vcm, for (index = 0; index < count; index++) { - channel = (rdpPeerChannel*) ArrayList_GetItem(vcm->dynamicVirtualChannels, - index); + channel = (rdpPeerChannel*)ArrayList_GetItem(vcm->dynamicVirtualChannels, index); if (channel->channelId == ChannelId) { @@ -84,12 +85,11 @@ static rdpPeerChannel* wts_get_dvc_channel_by_id(WTSVirtualChannelManager* vcm, return found ? channel : NULL; } -static BOOL wts_queue_receive_data(rdpPeerChannel* channel, const BYTE* Buffer, - UINT32 Length) +static BOOL wts_queue_receive_data(rdpPeerChannel* channel, const BYTE* Buffer, UINT32 Length) { BYTE* buffer; wtsChannelMessage* messageCtx; - messageCtx = (wtsChannelMessage*) malloc(sizeof(wtsChannelMessage) + Length); + messageCtx = (wtsChannelMessage*)malloc(sizeof(wtsChannelMessage) + Length); if (!messageCtx) return FALSE; @@ -102,8 +102,7 @@ static BOOL wts_queue_receive_data(rdpPeerChannel* channel, const BYTE* Buffer, return MessageQueue_Post(channel->queue, messageCtx, 0, NULL, NULL); } -static BOOL wts_queue_send_item(rdpPeerChannel* channel, BYTE* Buffer, - UINT32 Length) +static BOOL wts_queue_send_item(rdpPeerChannel* channel, BYTE* Buffer, UINT32 Length) { BYTE* buffer; UINT32 length; @@ -111,8 +110,8 @@ static BOOL wts_queue_send_item(rdpPeerChannel* channel, BYTE* Buffer, buffer = Buffer; length = Length; channelId = channel->channelId; - return MessageQueue_Post(channel->vcm->queue, (void*)(UINT_PTR) channelId, 0, - (void*) buffer, (void*)(UINT_PTR) length); + return MessageQueue_Post(channel->vcm->queue, (void*)(UINT_PTR)channelId, 0, (void*)buffer, + (void*)(UINT_PTR)length); } static int wts_read_variable_uint(wStream* s, int cbLen, UINT32* val) @@ -142,8 +141,7 @@ static int wts_read_variable_uint(wStream* s, int cbLen, UINT32* val) } } -static BOOL wts_read_drdynvc_capabilities_response(rdpPeerChannel* channel, - UINT32 length) +static BOOL wts_read_drdynvc_capabilities_response(rdpPeerChannel* channel, UINT32 length) { UINT16 Version; @@ -152,13 +150,12 @@ static BOOL wts_read_drdynvc_capabilities_response(rdpPeerChannel* channel, Stream_Seek_UINT8(channel->receiveData); /* Pad (1 byte) */ Stream_Read_UINT16(channel->receiveData, Version); - DEBUG_DVC("Version: %"PRIu16"", Version); + DEBUG_DVC("Version: %" PRIu16 "", Version); channel->vcm->drdynvc_state = DRDYNVC_STATE_READY; return TRUE; } -static BOOL wts_read_drdynvc_create_response(rdpPeerChannel* channel, - wStream* s, UINT32 length) +static BOOL wts_read_drdynvc_create_response(rdpPeerChannel* channel, wStream* s, UINT32 length) { UINT32 CreationStatus; @@ -167,23 +164,23 @@ static BOOL wts_read_drdynvc_create_response(rdpPeerChannel* channel, Stream_Read_UINT32(s, CreationStatus); - if ((INT32) CreationStatus < 0) + if ((INT32)CreationStatus < 0) { - DEBUG_DVC("ChannelId %"PRIu32" creation failed (%"PRId32")", channel->channelId, - (INT32) CreationStatus); + DEBUG_DVC("ChannelId %" PRIu32 " creation failed (%" PRId32 ")", channel->channelId, + (INT32)CreationStatus); channel->dvc_open_state = DVC_OPEN_STATE_FAILED; } else { - DEBUG_DVC("ChannelId %"PRIu32" creation succeeded", channel->channelId); + DEBUG_DVC("ChannelId %" PRIu32 " creation succeeded", channel->channelId); channel->dvc_open_state = DVC_OPEN_STATE_SUCCEEDED; } return TRUE; } -static BOOL wts_read_drdynvc_data_first(rdpPeerChannel* channel, wStream* s, - int cbLen, UINT32 length) +static BOOL wts_read_drdynvc_data_first(rdpPeerChannel* channel, wStream* s, int cbLen, + UINT32 length) { int value; value = wts_read_variable_uint(s, cbLen, &channel->dvc_total_length); @@ -198,23 +195,20 @@ static BOOL wts_read_drdynvc_data_first(rdpPeerChannel* channel, wStream* s, Stream_SetPosition(channel->receiveData, 0); - if (!Stream_EnsureRemainingCapacity(channel->receiveData, - (int) channel->dvc_total_length)) + if (!Stream_EnsureRemainingCapacity(channel->receiveData, (int)channel->dvc_total_length)) return FALSE; Stream_Write(channel->receiveData, Stream_Pointer(s), length); return TRUE; } -static BOOL wts_read_drdynvc_data(rdpPeerChannel* channel, wStream* s, - UINT32 length) +static BOOL wts_read_drdynvc_data(rdpPeerChannel* channel, wStream* s, UINT32 length) { BOOL ret = FALSE; if (channel->dvc_total_length > 0) { - if (Stream_GetPosition(channel->receiveData) + length > - channel->dvc_total_length) + if (Stream_GetPosition(channel->receiveData) + length > channel->dvc_total_length) { channel->dvc_total_length = 0; WLog_ERR(TAG, "incorrect fragment data, discarded."); @@ -240,7 +234,7 @@ static BOOL wts_read_drdynvc_data(rdpPeerChannel* channel, wStream* s, static void wts_read_drdynvc_close_response(rdpPeerChannel* channel) { - DEBUG_DVC("ChannelId %"PRIu32" close response", channel->channelId); + DEBUG_DVC("ChannelId %" PRIu32 " close response", channel->channelId); channel->dvc_open_state = DVC_OPEN_STATE_CLOSED; MessageQueue_PostQuit(channel->queue, 0); } @@ -278,7 +272,7 @@ static BOOL wts_read_drdynvc_pdu(rdpPeerChannel* channel) return FALSE; length -= value; - DEBUG_DVC("Cmd %d ChannelId %"PRIu32" length %"PRIu32"", Cmd, ChannelId, length); + DEBUG_DVC("Cmd %d ChannelId %" PRIu32 " length %" PRIu32 "", Cmd, ChannelId, length); dvc = wts_get_dvc_channel_by_id(channel->vcm, ChannelId); if (dvc) @@ -299,18 +293,18 @@ static BOOL wts_read_drdynvc_pdu(rdpPeerChannel* channel) break; default: - WLog_ERR(TAG, "Cmd %d not recognized.", Cmd); + WLog_ERR(TAG, "Cmd %d not recognized.", Cmd); break; } } else { - DEBUG_DVC("ChannelId %"PRIu32" not exists.", ChannelId); + DEBUG_DVC("ChannelId %" PRIu32 " not exists.", ChannelId); } } else { - WLog_ERR(TAG, "received Cmd %d but channel is not ready.", Cmd); + WLog_ERR(TAG, "received Cmd %d but channel is not ready.", Cmd); } return TRUE; @@ -349,8 +343,7 @@ static void wts_write_drdynvc_header(wStream* s, BYTE Cmd, UINT32 ChannelId) *bm = ((Cmd & 0x0F) << 4) | cbChId; } -static BOOL wts_write_drdynvc_create_request(wStream* s, UINT32 ChannelId, - const char* ChannelName) +static BOOL wts_write_drdynvc_create_request(wStream* s, UINT32 ChannelId, const char* ChannelName) { size_t len; wts_write_drdynvc_header(s, CREATE_REQUEST_PDU, ChannelId); @@ -363,8 +356,8 @@ static BOOL wts_write_drdynvc_create_request(wStream* s, UINT32 ChannelId, return TRUE; } -static BOOL WTSProcessChannelData(rdpPeerChannel* channel, UINT16 channelId, - const BYTE* data, int s, int flags, int t) +static BOOL WTSProcessChannelData(rdpPeerChannel* channel, UINT16 channelId, const BYTE* data, + int s, int flags, int t) { BOOL ret = TRUE; const size_t size = (size_t)s; @@ -405,8 +398,8 @@ static BOOL WTSProcessChannelData(rdpPeerChannel* channel, UINT16 channelId, return ret; } -static int WTSReceiveChannelData(freerdp_peer* client, UINT16 channelId, - const BYTE* data, int size, int flags, int totalSize) +static int WTSReceiveChannelData(freerdp_peer* client, UINT16 channelId, const BYTE* data, int size, + int flags, int totalSize) { UINT32 i; BOOL status = FALSE; @@ -421,7 +414,7 @@ static int WTSReceiveChannelData(freerdp_peer* client, UINT16 channelId, if (i < mcs->channelCount) { - channel = (rdpPeerChannel*) mcs->channels[i].handle; + channel = (rdpPeerChannel*)mcs->channels[i].handle; if (channel) { @@ -433,11 +426,10 @@ static int WTSReceiveChannelData(freerdp_peer* client, UINT16 channelId, return status; } -void WTSVirtualChannelManagerGetFileDescriptor(HANDLE hServer, void** fds, - int* fds_count) +void WTSVirtualChannelManagerGetFileDescriptor(HANDLE hServer, void** fds, int* fds_count) { void* fd; - WTSVirtualChannelManager* vcm = (WTSVirtualChannelManager*) hServer; + WTSVirtualChannelManager* vcm = (WTSVirtualChannelManager*)hServer; fd = GetEventWaitObject(MessageQueue_Event(vcm->queue)); if (fd) @@ -468,14 +460,14 @@ BOOL WTSVirtualChannelManagerCheckFileDescriptor(HANDLE hServer) BOOL status = TRUE; rdpPeerChannel* channel; UINT32 dynvc_caps; - WTSVirtualChannelManager* vcm = (WTSVirtualChannelManager*) hServer; + WTSVirtualChannelManager* vcm = (WTSVirtualChannelManager*)hServer; if ((vcm->drdynvc_state == DRDYNVC_STATE_NONE) && vcm->client->activated) { /* Initialize drdynvc channel once and only once. */ vcm->drdynvc_state = DRDYNVC_STATE_INITIALIZED; - channel = (rdpPeerChannel*) WTSVirtualChannelOpen((HANDLE) vcm, - WTS_CURRENT_SESSION, "drdynvc"); + channel = + (rdpPeerChannel*)WTSVirtualChannelOpen((HANDLE)vcm, WTS_CURRENT_SESSION, "drdynvc"); if (channel) { @@ -483,8 +475,7 @@ BOOL WTSVirtualChannelManagerCheckFileDescriptor(HANDLE hServer) vcm->drdynvc_channel = channel; dynvc_caps = 0x00010050; /* DYNVC_CAPS_VERSION1 (4 bytes) */ - if (!WTSVirtualChannelWrite(channel, (PCHAR) &dynvc_caps, sizeof(dynvc_caps), - &written)) + if (!WTSVirtualChannelWrite(channel, (PCHAR)&dynvc_caps, sizeof(dynvc_caps), &written)) return FALSE; } } @@ -494,12 +485,11 @@ BOOL WTSVirtualChannelManagerCheckFileDescriptor(HANDLE hServer) BYTE* buffer; UINT32 length; UINT16 channelId; - channelId = (UINT16)(UINT_PTR) message.context; - buffer = (BYTE*) message.wParam; - length = (UINT32)(UINT_PTR) message.lParam; + channelId = (UINT16)(UINT_PTR)message.context; + buffer = (BYTE*)message.wParam; + length = (UINT32)(UINT_PTR)message.lParam; - if (vcm->client->SendChannelData(vcm->client, channelId, buffer, - length) == FALSE) + if (vcm->client->SendChannelData(vcm->client, channelId, buffer, length) == FALSE) { status = FALSE; } @@ -515,12 +505,11 @@ BOOL WTSVirtualChannelManagerCheckFileDescriptor(HANDLE hServer) HANDLE WTSVirtualChannelManagerGetEventHandle(HANDLE hServer) { - WTSVirtualChannelManager* vcm = (WTSVirtualChannelManager*) hServer; + WTSVirtualChannelManager* vcm = (WTSVirtualChannelManager*)hServer; return MessageQueue_Event(vcm->queue); } -static rdpMcsChannel* wts_get_joined_channel_by_name(rdpMcs* mcs, - const char* channel_name) +static rdpMcsChannel* wts_get_joined_channel_by_name(rdpMcs* mcs, const char* channel_name) { UINT32 index; @@ -532,7 +521,7 @@ static rdpMcsChannel* wts_get_joined_channel_by_name(rdpMcs* mcs, if (mcs->channels[index].joined) { if (_strnicmp(mcs->channels[index].Name, channel_name, - strnlen(channel_name, CHANNEL_NAME_LEN)) == 0) + strnlen(channel_name, CHANNEL_NAME_LEN)) == 0) return &mcs->channels[index]; } } @@ -540,8 +529,7 @@ static rdpMcsChannel* wts_get_joined_channel_by_name(rdpMcs* mcs, return NULL; } -static rdpMcsChannel* wts_get_joined_channel_by_id(rdpMcs* mcs, - const UINT16 channel_id) +static rdpMcsChannel* wts_get_joined_channel_by_id(rdpMcs* mcs, const UINT16 channel_id) { UINT32 index; @@ -565,8 +553,8 @@ BOOL WTSIsChannelJoinedByName(freerdp_peer* client, const char* channel_name) if (!client || !client->context || !client->context->rdp) return FALSE; - return wts_get_joined_channel_by_name(client->context->rdp->mcs, - channel_name) == NULL ? FALSE : TRUE; + return wts_get_joined_channel_by_name(client->context->rdp->mcs, channel_name) == NULL ? FALSE + : TRUE; } BOOL WTSIsChannelJoinedById(freerdp_peer* client, const UINT16 channel_id) @@ -574,24 +562,23 @@ BOOL WTSIsChannelJoinedById(freerdp_peer* client, const UINT16 channel_id) if (!client || !client->context || !client->context->rdp) return FALSE; - return wts_get_joined_channel_by_id(client->context->rdp->mcs, - channel_id) == NULL ? FALSE : TRUE; + return wts_get_joined_channel_by_id(client->context->rdp->mcs, channel_id) == NULL ? FALSE + : TRUE; } BOOL WTSVirtualChannelManagerIsChannelJoined(HANDLE hServer, const char* name) { - WTSVirtualChannelManager* vcm = (WTSVirtualChannelManager*) hServer; + WTSVirtualChannelManager* vcm = (WTSVirtualChannelManager*)hServer; if (!vcm || !vcm->rdp) return FALSE; - return wts_get_joined_channel_by_name(vcm->rdp->mcs, - name) == NULL ? FALSE : TRUE; + return wts_get_joined_channel_by_name(vcm->rdp->mcs, name) == NULL ? FALSE : TRUE; } BYTE WTSVirtualChannelManagerGetDrdynvcState(HANDLE hServer) { - WTSVirtualChannelManager* vcm = (WTSVirtualChannelManager*) hServer; + WTSVirtualChannelManager* vcm = (WTSVirtualChannelManager*)hServer; return vcm->drdynvc_state; } @@ -602,8 +589,7 @@ UINT16 WTSChannelGetId(freerdp_peer* client, const char* channel_name) if (!client || !client->context || !client->context->rdp) return 0; - channel = wts_get_joined_channel_by_name(client->context->rdp->mcs, - channel_name); + channel = wts_get_joined_channel_by_name(client->context->rdp->mcs, channel_name); if (!channel) return 0; @@ -611,16 +597,14 @@ UINT16 WTSChannelGetId(freerdp_peer* client, const char* channel_name) return channel->ChannelId; } -BOOL WTSChannelSetHandleByName(freerdp_peer* client, const char* channel_name, - void* handle) +BOOL WTSChannelSetHandleByName(freerdp_peer* client, const char* channel_name, void* handle) { rdpMcsChannel* channel; if (!client || !client->context || !client->context->rdp) return FALSE; - channel = wts_get_joined_channel_by_name(client->context->rdp->mcs, - channel_name); + channel = wts_get_joined_channel_by_name(client->context->rdp->mcs, channel_name); if (!channel) return FALSE; @@ -629,8 +613,7 @@ BOOL WTSChannelSetHandleByName(freerdp_peer* client, const char* channel_name, return TRUE; } -BOOL WTSChannelSetHandleById(freerdp_peer* client, const UINT16 channel_id, - void* handle) +BOOL WTSChannelSetHandleById(freerdp_peer* client, const UINT16 channel_id, void* handle) { rdpMcsChannel* channel; @@ -653,8 +636,7 @@ void* WTSChannelGetHandleByName(freerdp_peer* client, const char* channel_name) if (!client || !client->context || !client->context->rdp) return NULL; - channel = wts_get_joined_channel_by_name(client->context->rdp->mcs, - channel_name); + channel = wts_get_joined_channel_by_name(client->context->rdp->mcs, channel_name); if (!channel) return NULL; @@ -677,26 +659,28 @@ void* WTSChannelGetHandleById(freerdp_peer* client, const UINT16 channel_id) return channel->handle; } -BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, - ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers) +BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, + BYTE HotkeyVk, USHORT HotkeyModifiers) { return FALSE; } -BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionA(LPSTR pTargetServerName, - ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers) +BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, + BYTE HotkeyVk, USHORT HotkeyModifiers) { return FALSE; } -BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionExW(LPWSTR pTargetServerName, - ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers, DWORD flags) +BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionExW(LPWSTR pTargetServerName, ULONG TargetLogonId, + BYTE HotkeyVk, USHORT HotkeyModifiers, + DWORD flags) { return FALSE; } -BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionExA(LPSTR pTargetServerName, - ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers, DWORD flags) +BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionExA(LPSTR pTargetServerName, ULONG TargetLogonId, + BYTE HotkeyVk, USHORT HotkeyModifiers, + DWORD flags) { return FALSE; } @@ -706,26 +690,26 @@ BOOL WINAPI FreeRDP_WTSStopRemoteControlSession(ULONG LogonId) return FALSE; } -BOOL WINAPI FreeRDP_WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, - PWSTR pPassword, BOOL bWait) +BOOL WINAPI FreeRDP_WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, + BOOL bWait) { return FALSE; } -BOOL WINAPI FreeRDP_WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, - PSTR pPassword, BOOL bWait) +BOOL WINAPI FreeRDP_WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, + BOOL bWait) { return FALSE; } -BOOL WINAPI FreeRDP_WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, - DWORD Version, PWTS_SERVER_INFOW* ppServerInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, + PWTS_SERVER_INFOW* ppServerInfo, DWORD* pCount) { return FALSE; } -BOOL WINAPI FreeRDP_WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, - DWORD Version, PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, + PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount) { return FALSE; } @@ -741,7 +725,7 @@ HANDLE WINAPI FreeRDP_WTSOpenServerA(LPSTR pServerName) freerdp_peer* client; WTSVirtualChannelManager* vcm; HANDLE hServer = INVALID_HANDLE_VALUE; - context = (rdpContext*) pServerName; + context = (rdpContext*)pServerName; if (!context) return INVALID_HANDLE_VALUE; @@ -754,7 +738,7 @@ HANDLE WINAPI FreeRDP_WTSOpenServerA(LPSTR pServerName) return INVALID_HANDLE_VALUE; } - vcm = (WTSVirtualChannelManager*) calloc(1, sizeof(WTSVirtualChannelManager)); + vcm = (WTSVirtualChannelManager*)calloc(1, sizeof(WTSVirtualChannelManager)); if (!vcm) goto error_vcm_alloc; @@ -771,8 +755,7 @@ HANDLE WINAPI FreeRDP_WTSOpenServerA(LPSTR pServerName) goto error_free; } - if (HashTable_Add(g_ServerHandles, (void*)(UINT_PTR) vcm->SessionId, - (void*) vcm) < 0) + if (HashTable_Add(g_ServerHandles, (void*)(UINT_PTR)vcm->SessionId, (void*)vcm) < 0) goto error_free; vcm->queue = MessageQueue_New(NULL); @@ -787,12 +770,12 @@ HANDLE WINAPI FreeRDP_WTSOpenServerA(LPSTR pServerName) goto error_dynamicVirtualChannels; client->ReceiveChannelData = WTSReceiveChannelData; - hServer = (HANDLE) vcm; + hServer = (HANDLE)vcm; return hServer; error_dynamicVirtualChannels: MessageQueue_Free(vcm->queue); error_queue: - HashTable_Remove(g_ServerHandles, (void*)(UINT_PTR) vcm->SessionId); + HashTable_Remove(g_ServerHandles, (void*)(UINT_PTR)vcm->SessionId); error_free: free(vcm); error_vcm_alloc: @@ -816,18 +799,17 @@ VOID WINAPI FreeRDP_WTSCloseServer(HANDLE hServer) int count; rdpPeerChannel* channel; WTSVirtualChannelManager* vcm; - vcm = (WTSVirtualChannelManager*) hServer; + vcm = (WTSVirtualChannelManager*)hServer; if (vcm) { - HashTable_Remove(g_ServerHandles, (void*)(UINT_PTR) vcm->SessionId); + HashTable_Remove(g_ServerHandles, (void*)(UINT_PTR)vcm->SessionId); ArrayList_Lock(vcm->dynamicVirtualChannels); count = ArrayList_Count(vcm->dynamicVirtualChannels); for (index = 0; index < count; index++) { - channel = (rdpPeerChannel*) ArrayList_GetItem(vcm->dynamicVirtualChannels, - index); + channel = (rdpPeerChannel*)ArrayList_GetItem(vcm->dynamicVirtualChannels, index); WTSVirtualChannelClose(channel); } @@ -845,60 +827,61 @@ VOID WINAPI FreeRDP_WTSCloseServer(HANDLE hServer) } } -BOOL WINAPI FreeRDP_WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, - DWORD Version, PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version, + PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount) { return FALSE; } -BOOL WINAPI FreeRDP_WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, - DWORD Version, PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version, + PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount) { return FALSE; } -BOOL WINAPI FreeRDP_WTSEnumerateSessionsExW(HANDLE hServer, DWORD* pLevel, - DWORD Filter, PWTS_SESSION_INFO_1W* ppSessionInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateSessionsExW(HANDLE hServer, DWORD* pLevel, DWORD Filter, + PWTS_SESSION_INFO_1W* ppSessionInfo, DWORD* pCount) { return FALSE; } -BOOL WINAPI FreeRDP_WTSEnumerateSessionsExA(HANDLE hServer, DWORD* pLevel, - DWORD Filter, PWTS_SESSION_INFO_1A* ppSessionInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateSessionsExA(HANDLE hServer, DWORD* pLevel, DWORD Filter, + PWTS_SESSION_INFO_1A* ppSessionInfo, DWORD* pCount) { return FALSE; } -BOOL WINAPI FreeRDP_WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, - DWORD Version, PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version, + PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount) { return FALSE; } -BOOL WINAPI FreeRDP_WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, - DWORD Version, PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version, + PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount) { return FALSE; } -BOOL WINAPI FreeRDP_WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, - DWORD ExitCode) +BOOL WINAPI FreeRDP_WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode) { return FALSE; } BOOL WINAPI FreeRDP_WTSQuerySessionInformationW(HANDLE hServer, DWORD SessionId, - WTS_INFO_CLASS WTSInfoClass, LPWSTR* ppBuffer, DWORD* pBytesReturned) + WTS_INFO_CLASS WTSInfoClass, LPWSTR* ppBuffer, + DWORD* pBytesReturned) { return FALSE; } BOOL WINAPI FreeRDP_WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, - WTS_INFO_CLASS WTSInfoClass, LPSTR* ppBuffer, DWORD* pBytesReturned) + WTS_INFO_CLASS WTSInfoClass, LPSTR* ppBuffer, + DWORD* pBytesReturned) { DWORD BytesReturned; WTSVirtualChannelManager* vcm; - vcm = (WTSVirtualChannelManager*) hServer; + vcm = (WTSVirtualChannelManager*)hServer; if (!vcm) return FALSE; @@ -907,7 +890,7 @@ BOOL WINAPI FreeRDP_WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, { ULONG* pBuffer; BytesReturned = sizeof(ULONG); - pBuffer = (ULONG*) malloc(sizeof(BytesReturned)); + pBuffer = (ULONG*)malloc(sizeof(BytesReturned)); if (!pBuffer) { @@ -916,7 +899,7 @@ BOOL WINAPI FreeRDP_WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, } *pBuffer = vcm->SessionId; - *ppBuffer = (LPSTR) pBuffer; + *ppBuffer = (LPSTR)pBuffer; *pBytesReturned = BytesReturned; return TRUE; } @@ -925,53 +908,53 @@ BOOL WINAPI FreeRDP_WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, } BOOL WINAPI FreeRDP_WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, - WTS_CONFIG_CLASS WTSConfigClass, LPWSTR* ppBuffer, DWORD* pBytesReturned) + WTS_CONFIG_CLASS WTSConfigClass, LPWSTR* ppBuffer, + DWORD* pBytesReturned) { return FALSE; } BOOL WINAPI FreeRDP_WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, - WTS_CONFIG_CLASS WTSConfigClass, LPSTR* ppBuffer, DWORD* pBytesReturned) + WTS_CONFIG_CLASS WTSConfigClass, LPSTR* ppBuffer, + DWORD* pBytesReturned) { return FALSE; } BOOL WINAPI FreeRDP_WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, - WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, DWORD DataLength) + WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, + DWORD DataLength) { return FALSE; } BOOL WINAPI FreeRDP_WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, - WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength) + WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, + DWORD DataLength) { return FALSE; } -BOOL WINAPI FreeRDP_WTSSendMessageW(HANDLE hServer, DWORD SessionId, - LPWSTR pTitle, DWORD TitleLength, - LPWSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, - DWORD* pResponse, BOOL bWait) +BOOL WINAPI FreeRDP_WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, + DWORD TitleLength, LPWSTR pMessage, DWORD MessageLength, + DWORD Style, DWORD Timeout, DWORD* pResponse, BOOL bWait) { return FALSE; } -BOOL WINAPI FreeRDP_WTSSendMessageA(HANDLE hServer, DWORD SessionId, - LPSTR pTitle, DWORD TitleLength, - LPSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, - DWORD* pResponse, BOOL bWait) +BOOL WINAPI FreeRDP_WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, + DWORD TitleLength, LPSTR pMessage, DWORD MessageLength, + DWORD Style, DWORD Timeout, DWORD* pResponse, BOOL bWait) { return FALSE; } -BOOL WINAPI FreeRDP_WTSDisconnectSession(HANDLE hServer, DWORD SessionId, - BOOL bWait) +BOOL WINAPI FreeRDP_WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait) { return FALSE; } -BOOL WINAPI FreeRDP_WTSLogoffSession(HANDLE hServer, DWORD SessionId, - BOOL bWait) +BOOL WINAPI FreeRDP_WTSLogoffSession(HANDLE hServer, DWORD SessionId, BOOL bWait) { return FALSE; } @@ -981,14 +964,12 @@ BOOL WINAPI FreeRDP_WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag) return FALSE; } -BOOL WINAPI FreeRDP_WTSWaitSystemEvent(HANDLE hServer, DWORD EventMask, - DWORD* pEventFlags) +BOOL WINAPI FreeRDP_WTSWaitSystemEvent(HANDLE hServer, DWORD EventMask, DWORD* pEventFlags) { return FALSE; } -HANDLE WINAPI FreeRDP_WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, - LPSTR pVirtualName) +HANDLE WINAPI FreeRDP_WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName) { size_t length; UINT32 index; @@ -998,7 +979,7 @@ HANDLE WINAPI FreeRDP_WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, rdpPeerChannel* channel; WTSVirtualChannelManager* vcm; HANDLE hChannelHandle = NULL; - vcm = (WTSVirtualChannelManager*) hServer; + vcm = (WTSVirtualChannelManager*)hServer; if (!vcm) { @@ -1018,8 +999,8 @@ HANDLE WINAPI FreeRDP_WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, for (index = 0; index < mcs->channelCount; index++) { - if (mcs->channels[index].joined - && (strncmp(mcs->channels[index].Name, pVirtualName, length) == 0)) + if (mcs->channels[index].joined && + (strncmp(mcs->channels[index].Name, pVirtualName, length) == 0)) { joined = TRUE; break; @@ -1032,11 +1013,11 @@ HANDLE WINAPI FreeRDP_WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, return NULL; } - channel = (rdpPeerChannel*) mcs->channels[index].handle; + channel = (rdpPeerChannel*)mcs->channels[index].handle; if (!channel) { - channel = (rdpPeerChannel*) calloc(1, sizeof(rdpPeerChannel)); + channel = (rdpPeerChannel*)calloc(1, sizeof(rdpPeerChannel)); if (!channel) goto error_channel_alloc; @@ -1046,8 +1027,7 @@ HANDLE WINAPI FreeRDP_WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, channel->channelId = mcs->channels[index].ChannelId; channel->index = index; channel->channelType = RDP_PEER_CHANNEL_TYPE_SVC; - channel->receiveData = Stream_New(NULL, - client->settings->VirtualChannelChunkSize); + channel->receiveData = Stream_New(NULL, client->settings->VirtualChannelChunkSize); if (!channel->receiveData) { @@ -1063,7 +1043,7 @@ HANDLE WINAPI FreeRDP_WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, mcs->channels[index].handle = channel; } - hChannelHandle = (HANDLE) channel; + hChannelHandle = (HANDLE)channel; return hChannelHandle; error_queue: Stream_Free(channel->receiveData, TRUE); @@ -1074,8 +1054,7 @@ error_channel_alloc: return NULL; } -HANDLE WINAPI FreeRDP_WTSVirtualChannelOpenEx(DWORD SessionId, - LPSTR pVirtualName, DWORD flags) +HANDLE WINAPI FreeRDP_WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWORD flags) { UINT32 index; wStream* s; @@ -1089,15 +1068,15 @@ HANDLE WINAPI FreeRDP_WTSVirtualChannelOpenEx(DWORD SessionId, if (SessionId == WTS_CURRENT_SESSION) return NULL; - vcm = (WTSVirtualChannelManager*) HashTable_GetItemValue(g_ServerHandles, - (void*)(UINT_PTR) SessionId); + vcm = (WTSVirtualChannelManager*)HashTable_GetItemValue(g_ServerHandles, + (void*)(UINT_PTR)SessionId); if (!vcm) return NULL; if (!(flags & WTS_CHANNEL_OPTION_DYNAMIC)) { - return FreeRDP_WTSVirtualChannelOpen((HANDLE) vcm, SessionId, pVirtualName); + return FreeRDP_WTSVirtualChannelOpen((HANDLE)vcm, SessionId, pVirtualName); } client = vcm->client; @@ -1105,8 +1084,7 @@ HANDLE WINAPI FreeRDP_WTSVirtualChannelOpenEx(DWORD SessionId, for (index = 0; index < mcs->channelCount; index++) { - if (mcs->channels[index].joined - && (strncmp(mcs->channels[index].Name, "drdynvc", 7) == 0)) + if (mcs->channels[index].joined && (strncmp(mcs->channels[index].Name, "drdynvc", 7) == 0)) { joined = TRUE; break; @@ -1125,7 +1103,7 @@ HANDLE WINAPI FreeRDP_WTSVirtualChannelOpenEx(DWORD SessionId, return NULL; } - channel = (rdpPeerChannel*) calloc(1, sizeof(rdpPeerChannel)); + channel = (rdpPeerChannel*)calloc(1, sizeof(rdpPeerChannel)); if (!channel) { @@ -1136,8 +1114,7 @@ HANDLE WINAPI FreeRDP_WTSVirtualChannelOpenEx(DWORD SessionId, channel->vcm = vcm; channel->client = client; channel->channelType = RDP_PEER_CHANNEL_TYPE_DVC; - channel->receiveData = Stream_New(NULL, - client->settings->VirtualChannelChunkSize); + channel->receiveData = Stream_New(NULL, client->settings->VirtualChannelChunkSize); if (!channel->receiveData) { @@ -1163,7 +1140,7 @@ HANDLE WINAPI FreeRDP_WTSVirtualChannelOpenEx(DWORD SessionId, if (!wts_write_drdynvc_create_request(s, channel->channelId, pVirtualName)) goto error_create; - if (!WTSVirtualChannelWrite(vcm->drdynvc_channel, (PCHAR) Stream_Buffer(s), + if (!WTSVirtualChannelWrite(vcm->drdynvc_channel, (PCHAR)Stream_Buffer(s), Stream_GetPosition(s), &written)) goto error_create; @@ -1188,7 +1165,7 @@ BOOL WINAPI FreeRDP_WTSVirtualChannelClose(HANDLE hChannelHandle) wStream* s; rdpMcs* mcs; WTSVirtualChannelManager* vcm; - rdpPeerChannel* channel = (rdpPeerChannel*) hChannelHandle; + rdpPeerChannel* channel = (rdpPeerChannel*)hChannelHandle; BOOL ret = TRUE; if (channel) @@ -1218,7 +1195,7 @@ BOOL WINAPI FreeRDP_WTSVirtualChannelClose(HANDLE hChannelHandle) else { wts_write_drdynvc_header(s, CLOSE_REQUEST_PDU, channel->channelId); - ret = WTSVirtualChannelWrite(vcm->drdynvc_channel, (PCHAR) Stream_Buffer(s), + ret = WTSVirtualChannelWrite(vcm->drdynvc_channel, (PCHAR)Stream_Buffer(s), Stream_GetPosition(s), &written); Stream_Free(s, TRUE); } @@ -1240,13 +1217,13 @@ BOOL WINAPI FreeRDP_WTSVirtualChannelClose(HANDLE hChannelHandle) return ret; } -BOOL WINAPI FreeRDP_WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, - PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead) +BOOL WINAPI FreeRDP_WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, + ULONG BufferSize, PULONG pBytesRead) { BYTE* buffer; wMessage message; wtsChannelMessage* messageCtx; - rdpPeerChannel* channel = (rdpPeerChannel*) hChannelHandle; + rdpPeerChannel* channel = (rdpPeerChannel*)hChannelHandle; if (!MessageQueue_Peek(channel->queue, &message, FALSE)) { @@ -1255,7 +1232,7 @@ BOOL WINAPI FreeRDP_WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, return FALSE; } - messageCtx = (wtsChannelMessage*)(UINT_PTR) message.context; + messageCtx = (wtsChannelMessage*)(UINT_PTR)message.context; buffer = (BYTE*)(messageCtx + 1); *pBytesRead = messageCtx->length - messageCtx->offset; @@ -1279,8 +1256,8 @@ BOOL WINAPI FreeRDP_WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, return TRUE; } -BOOL WINAPI FreeRDP_WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, - ULONG Length, PULONG pBytesWritten) +BOOL WINAPI FreeRDP_WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, + PULONG pBytesWritten) { wStream* s; int cbLen; @@ -1290,7 +1267,7 @@ BOOL WINAPI FreeRDP_WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, UINT32 length; UINT32 written; UINT32 totalWritten = 0; - rdpPeerChannel* channel = (rdpPeerChannel*) hChannelHandle; + rdpPeerChannel* channel = (rdpPeerChannel*)hChannelHandle; BOOL ret = TRUE; if (!channel) @@ -1311,8 +1288,7 @@ BOOL WINAPI FreeRDP_WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, totalWritten = Length; ret = wts_queue_send_item(channel, buffer, length); } - else if (!channel->vcm->drdynvc_channel - || (channel->vcm->drdynvc_state != DRDYNVC_STATE_READY)) + else if (!channel->vcm->drdynvc_channel || (channel->vcm->drdynvc_state != DRDYNVC_STATE_READY)) { DEBUG_DVC("drdynvc not ready"); return FALSE; @@ -1336,7 +1312,7 @@ BOOL WINAPI FreeRDP_WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, Stream_Seek_UINT8(s); cbChId = wts_write_variable_uint(s, channel->channelId); - if (first && (Length > (UINT32) Stream_GetRemainingLength(s))) + if (first && (Length > (UINT32)Stream_GetRemainingLength(s))) { cbLen = wts_write_variable_uint(s, Length); buffer[0] = (DATA_FIRST_PDU << 4) | (cbLen << 2) | cbChId; @@ -1378,8 +1354,8 @@ BOOL WINAPI FreeRDP_WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle) return TRUE; } -BOOL WINAPI FreeRDP_WTSVirtualChannelQuery(HANDLE hChannelHandle, - WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned) +BOOL WINAPI FreeRDP_WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, + PVOID* ppBuffer, DWORD* pBytesReturned) { void* pfd; BOOL bval; @@ -1387,11 +1363,11 @@ BOOL WINAPI FreeRDP_WTSVirtualChannelQuery(HANDLE hChannelHandle, HANDLE hEvent; int fds_count = 0; BOOL status = FALSE; - rdpPeerChannel* channel = (rdpPeerChannel*) hChannelHandle; + rdpPeerChannel* channel = (rdpPeerChannel*)hChannelHandle; ZeroMemory(fds, sizeof(fds)); hEvent = MessageQueue_Event(channel->queue); - switch ((UINT32) WtsVirtualClass) + switch ((UINT32)WtsVirtualClass) { case WTSVirtualFileHandle: pfd = GetEventWaitObject(hEvent); @@ -1509,14 +1485,12 @@ BOOL WINAPI FreeRDP_WTSUnRegisterSessionNotification(HWND hWnd) return FALSE; } -BOOL WINAPI FreeRDP_WTSRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd, - DWORD dwFlags) +BOOL WINAPI FreeRDP_WTSRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd, DWORD dwFlags) { return FALSE; } -BOOL WINAPI FreeRDP_WTSUnRegisterSessionNotificationEx(HANDLE hServer, - HWND hWnd) +BOOL WINAPI FreeRDP_WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd) { return FALSE; } @@ -1526,86 +1500,85 @@ BOOL WINAPI FreeRDP_WTSQueryUserToken(ULONG SessionId, PHANDLE phToken) return FALSE; } -BOOL WINAPI FreeRDP_WTSEnumerateProcessesExW(HANDLE hServer, DWORD* pLevel, - DWORD SessionId, LPWSTR* ppProcessInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateProcessesExW(HANDLE hServer, DWORD* pLevel, DWORD SessionId, + LPWSTR* ppProcessInfo, DWORD* pCount) { return FALSE; } -BOOL WINAPI FreeRDP_WTSEnumerateProcessesExA(HANDLE hServer, DWORD* pLevel, - DWORD SessionId, LPSTR* ppProcessInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateProcessesExA(HANDLE hServer, DWORD* pLevel, DWORD SessionId, + LPSTR* ppProcessInfo, DWORD* pCount) { return FALSE; } -BOOL WINAPI FreeRDP_WTSEnumerateListenersW(HANDLE hServer, PVOID pReserved, - DWORD Reserved, PWTSLISTENERNAMEW pListeners, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateListenersW(HANDLE hServer, PVOID pReserved, DWORD Reserved, + PWTSLISTENERNAMEW pListeners, DWORD* pCount) { return FALSE; } -BOOL WINAPI FreeRDP_WTSEnumerateListenersA(HANDLE hServer, PVOID pReserved, - DWORD Reserved, PWTSLISTENERNAMEA pListeners, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateListenersA(HANDLE hServer, PVOID pReserved, DWORD Reserved, + PWTSLISTENERNAMEA pListeners, DWORD* pCount) { return FALSE; } -BOOL WINAPI FreeRDP_WTSQueryListenerConfigW(HANDLE hServer, PVOID pReserved, - DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer) +BOOL WINAPI FreeRDP_WTSQueryListenerConfigW(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer) { return FALSE; } -BOOL WINAPI FreeRDP_WTSQueryListenerConfigA(HANDLE hServer, PVOID pReserved, - DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer) +BOOL WINAPI FreeRDP_WTSQueryListenerConfigA(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer) { return FALSE; } -BOOL WINAPI FreeRDP_WTSCreateListenerW(HANDLE hServer, PVOID pReserved, - DWORD Reserved, - LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer, DWORD flag) +BOOL WINAPI FreeRDP_WTSCreateListenerW(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer, + DWORD flag) { return FALSE; } -BOOL WINAPI FreeRDP_WTSCreateListenerA(HANDLE hServer, PVOID pReserved, - DWORD Reserved, +BOOL WINAPI FreeRDP_WTSCreateListenerA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer, DWORD flag) { return FALSE; } -BOOL WINAPI FreeRDP_WTSSetListenerSecurityW(HANDLE hServer, PVOID pReserved, - DWORD Reserved, - LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor) +BOOL WINAPI FreeRDP_WTSSetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPWSTR pListenerName, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor) { return FALSE; } -BOOL WINAPI FreeRDP_WTSSetListenerSecurityA(HANDLE hServer, PVOID pReserved, - DWORD Reserved, - LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor) +BOOL WINAPI FreeRDP_WTSSetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPSTR pListenerName, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor) { return FALSE; } -BOOL WINAPI FreeRDP_WTSGetListenerSecurityW(HANDLE hServer, PVOID pReserved, - DWORD Reserved, - LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, - LPDWORD lpnLengthNeeded) +BOOL WINAPI FreeRDP_WTSGetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPWSTR pListenerName, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, + LPDWORD lpnLengthNeeded) { return FALSE; } -BOOL WINAPI FreeRDP_WTSGetListenerSecurityA(HANDLE hServer, PVOID pReserved, - DWORD Reserved, - LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, - LPDWORD lpnLengthNeeded) +BOOL WINAPI FreeRDP_WTSGetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPSTR pListenerName, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, + LPDWORD lpnLengthNeeded) { return FALSE; } @@ -1634,8 +1607,7 @@ BOOL WINAPI FreeRDP_WTSLogoffUser(HANDLE hServer) return FALSE; } -BOOL WINAPI FreeRDP_WTSLogonUser(HANDLE hServer, LPCSTR username, - LPCSTR password, LPCSTR domain) +BOOL WINAPI FreeRDP_WTSLogonUser(HANDLE hServer, LPCSTR username, LPCSTR password, LPCSTR domain) { return FALSE; } diff --git a/libfreerdp/core/server.h b/libfreerdp/core/server.h index f543606ec..3e2552ee3 100644 --- a/libfreerdp/core/server.h +++ b/libfreerdp/core/server.h @@ -35,11 +35,11 @@ typedef struct WTSVirtualChannelManager WTSVirtualChannelManager; #include "rdp.h" #include "mcs.h" -#define CREATE_REQUEST_PDU 0x01 -#define DATA_FIRST_PDU 0x02 -#define DATA_PDU 0x03 -#define CLOSE_REQUEST_PDU 0x04 -#define CAPABILITY_REQUEST_PDU 0x05 +#define CREATE_REQUEST_PDU 0x01 +#define DATA_FIRST_PDU 0x02 +#define DATA_PDU 0x03 +#define CLOSE_REQUEST_PDU 0x04 +#define CAPABILITY_REQUEST_PDU 0x05 enum { @@ -89,153 +89,169 @@ struct WTSVirtualChannelManager wArrayList* dynamicVirtualChannels; }; -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionW( - LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, - USHORT HotkeyModifiers); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionA( - LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, - USHORT HotkeyModifiers); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionExW( - LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, - USHORT HotkeyModifiers, DWORD flags); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionExA( - LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, - USHORT HotkeyModifiers, DWORD flags); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, + ULONG TargetLogonId, BYTE HotkeyVk, + USHORT HotkeyModifiers); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionA(LPSTR pTargetServerName, + ULONG TargetLogonId, BYTE HotkeyVk, + USHORT HotkeyModifiers); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionExW(LPWSTR pTargetServerName, + ULONG TargetLogonId, + BYTE HotkeyVk, + USHORT HotkeyModifiers, + DWORD flags); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionExA(LPSTR pTargetServerName, + ULONG TargetLogonId, + BYTE HotkeyVk, + USHORT HotkeyModifiers, + DWORD flags); FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSStopRemoteControlSession(ULONG LogonId); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSConnectSessionW(ULONG LogonId, - ULONG TargetLogonId, PWSTR pPassword, BOOL bWait); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSConnectSessionA(ULONG LogonId, - ULONG TargetLogonId, PSTR pPassword, BOOL bWait); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateServersW(LPWSTR pDomainName, - DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW* ppServerInfo, DWORD* pCount); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateServersA(LPSTR pDomainName, - DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, + PWSTR pPassword, BOOL bWait); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, + PSTR pPassword, BOOL bWait); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, + DWORD Version, + PWTS_SERVER_INFOW* ppServerInfo, + DWORD* pCount); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, + DWORD Version, + PWTS_SERVER_INFOA* ppServerInfo, + DWORD* pCount); FREERDP_LOCAL HANDLE WINAPI FreeRDP_WTSOpenServerW(LPWSTR pServerName); FREERDP_LOCAL HANDLE WINAPI FreeRDP_WTSOpenServerA(LPSTR pServerName); FREERDP_LOCAL HANDLE WINAPI FreeRDP_WTSOpenServerExW(LPWSTR pServerName); FREERDP_LOCAL HANDLE WINAPI FreeRDP_WTSOpenServerExA(LPSTR pServerName); FREERDP_LOCAL VOID WINAPI FreeRDP_WTSCloseServer(HANDLE hServer); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateSessionsW(HANDLE hServer, - DWORD Reserved, DWORD Version, PWTS_SESSION_INFOW* ppSessionInfo, - DWORD* pCount); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateSessionsA(HANDLE hServer, - DWORD Reserved, DWORD Version, PWTS_SESSION_INFOA* ppSessionInfo, - DWORD* pCount); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateSessionsExW(HANDLE hServer, - DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1W* ppSessionInfo, - DWORD* pCount); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateSessionsExA(HANDLE hServer, - DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1A* ppSessionInfo, - DWORD* pCount); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateProcessesW(HANDLE hServer, - DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOW* ppProcessInfo, - DWORD* pCount); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateProcessesA(HANDLE hServer, - DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOA* ppProcessInfo, - DWORD* pCount); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSTerminateProcess(HANDLE hServer, - DWORD ProcessId, DWORD ExitCode); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSQuerySessionInformationW(HANDLE hServer, - DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPWSTR* ppBuffer, - DWORD* pBytesReturned); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSQuerySessionInformationA(HANDLE hServer, - DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPSTR* ppBuffer, - DWORD* pBytesReturned); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSQueryUserConfigW(LPWSTR pServerName, - LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR* ppBuffer, - DWORD* pBytesReturned); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSQueryUserConfigA(LPSTR pServerName, - LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR* ppBuffer, - DWORD* pBytesReturned); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSSetUserConfigW(LPWSTR pServerName, - LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, - DWORD DataLength); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSSetUserConfigA(LPSTR pServerName, - LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, - DWORD DataLength); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSSendMessageW(HANDLE hServer, - DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, - LPWSTR pMessage, DWORD MessageLength, DWORD Style, - DWORD Timeout, DWORD* pResponse, BOOL bWait); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSSendMessageA(HANDLE hServer, - DWORD SessionId, LPSTR pTitle, DWORD TitleLength, - LPSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, - DWORD* pResponse, BOOL bWait); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSDisconnectSession(HANDLE hServer, - DWORD SessionId, BOOL bWait); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSLogoffSession(HANDLE hServer, - DWORD SessionId, BOOL bWait); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSShutdownSystem(HANDLE hServer, - DWORD ShutdownFlag); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSWaitSystemEvent(HANDLE hServer, - DWORD EventMask, DWORD* pEventFlags); -FREERDP_LOCAL HANDLE WINAPI FreeRDP_WTSVirtualChannelOpen(HANDLE hServer, - DWORD SessionId, LPSTR pVirtualName); -FREERDP_LOCAL HANDLE WINAPI FreeRDP_WTSVirtualChannelOpenEx(DWORD SessionId, - LPSTR pVirtualName, DWORD flags); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, + DWORD Version, + PWTS_SESSION_INFOW* ppSessionInfo, + DWORD* pCount); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, + DWORD Version, + PWTS_SESSION_INFOA* ppSessionInfo, + DWORD* pCount); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateSessionsExW(HANDLE hServer, DWORD* pLevel, + DWORD Filter, + PWTS_SESSION_INFO_1W* ppSessionInfo, + DWORD* pCount); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateSessionsExA(HANDLE hServer, DWORD* pLevel, + DWORD Filter, + PWTS_SESSION_INFO_1A* ppSessionInfo, + DWORD* pCount); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, + DWORD Version, + PWTS_PROCESS_INFOW* ppProcessInfo, + DWORD* pCount); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, + DWORD Version, + PWTS_PROCESS_INFOA* ppProcessInfo, + DWORD* pCount); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, + DWORD ExitCode); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSQuerySessionInformationW(HANDLE hServer, DWORD SessionId, + WTS_INFO_CLASS WTSInfoClass, + LPWSTR* ppBuffer, + DWORD* pBytesReturned); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, + WTS_INFO_CLASS WTSInfoClass, + LPSTR* ppBuffer, + DWORD* pBytesReturned); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, + WTS_CONFIG_CLASS WTSConfigClass, + LPWSTR* ppBuffer, DWORD* pBytesReturned); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, + WTS_CONFIG_CLASS WTSConfigClass, + LPSTR* ppBuffer, DWORD* pBytesReturned); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, + WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, + DWORD DataLength); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, + WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, + DWORD DataLength); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, + DWORD TitleLength, LPWSTR pMessage, + DWORD MessageLength, DWORD Style, DWORD Timeout, + DWORD* pResponse, BOOL bWait); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, + DWORD TitleLength, LPSTR pMessage, + DWORD MessageLength, DWORD Style, DWORD Timeout, + DWORD* pResponse, BOOL bWait); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSLogoffSession(HANDLE hServer, DWORD SessionId, BOOL bWait); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSWaitSystemEvent(HANDLE hServer, DWORD EventMask, + DWORD* pEventFlags); +FREERDP_LOCAL HANDLE WINAPI FreeRDP_WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, + LPSTR pVirtualName); +FREERDP_LOCAL HANDLE WINAPI FreeRDP_WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, + DWORD flags); FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSVirtualChannelClose(HANDLE hChannelHandle); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSVirtualChannelRead(HANDLE hChannelHandle, - ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSVirtualChannelWrite(HANDLE hChannelHandle, - PCHAR Buffer, ULONG Length, PULONG pBytesWritten); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSVirtualChannelPurgeInput( - HANDLE hChannelHandle); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSVirtualChannelPurgeOutput( - HANDLE hChannelHandle); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, + PCHAR Buffer, ULONG BufferSize, + PULONG pBytesRead); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, + ULONG Length, PULONG pBytesWritten); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSVirtualChannelPurgeInput(HANDLE hChannelHandle); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle); FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSVirtualChannelQuery(HANDLE hChannelHandle, - WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned); + WTS_VIRTUAL_CLASS WtsVirtualClass, + PVOID* ppBuffer, DWORD* pBytesReturned); FREERDP_LOCAL VOID WINAPI FreeRDP_WTSFreeMemory(PVOID pMemory); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSFreeMemoryExW(WTS_TYPE_CLASS WTSTypeClass, - PVOID pMemory, ULONG NumberOfEntries); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSFreeMemoryExA(WTS_TYPE_CLASS WTSTypeClass, - PVOID pMemory, ULONG NumberOfEntries); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSRegisterSessionNotification(HWND hWnd, - DWORD dwFlags); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSFreeMemoryExW(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, + ULONG NumberOfEntries); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSFreeMemoryExA(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, + ULONG NumberOfEntries); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags); FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSUnRegisterSessionNotification(HWND hWnd); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSRegisterSessionNotificationEx( - HANDLE hServer, HWND hWnd, DWORD dwFlags); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSUnRegisterSessionNotificationEx( - HANDLE hServer, HWND hWnd); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSQueryUserToken(ULONG SessionId, - PHANDLE phToken); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateProcessesExW(HANDLE hServer, - DWORD* pLevel, DWORD SessionId, LPWSTR* ppProcessInfo, DWORD* pCount); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateProcessesExA(HANDLE hServer, - DWORD* pLevel, DWORD SessionId, LPSTR* ppProcessInfo, DWORD* pCount); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateListenersW(HANDLE hServer, - PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEW pListeners, DWORD* pCount); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateListenersA(HANDLE hServer, - PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEA pListeners, DWORD* pCount); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSQueryListenerConfigW(HANDLE hServer, - PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, - PWTSLISTENERCONFIGW pBuffer); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSQueryListenerConfigA(HANDLE hServer, - PVOID pReserved, DWORD Reserved, LPSTR pListenerName, - PWTSLISTENERCONFIGA pBuffer); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSCreateListenerW(HANDLE hServer, - PVOID pReserved, DWORD Reserved, - LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer, DWORD flag); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSCreateListenerA(HANDLE hServer, - PVOID pReserved, DWORD Reserved, - LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer, DWORD flag); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSSetListenerSecurityW(HANDLE hServer, - PVOID pReserved, DWORD Reserved, - LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSSetListenerSecurityA(HANDLE hServer, - PVOID pReserved, DWORD Reserved, - LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSGetListenerSecurityW(HANDLE hServer, - PVOID pReserved, DWORD Reserved, - LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, - LPDWORD lpnLengthNeeded); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSGetListenerSecurityA(HANDLE hServer, - PVOID pReserved, DWORD Reserved, - LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, - LPDWORD lpnLengthNeeded); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd, + DWORD dwFlags); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSQueryUserToken(ULONG SessionId, PHANDLE phToken); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateProcessesExW(HANDLE hServer, DWORD* pLevel, + DWORD SessionId, LPWSTR* ppProcessInfo, + DWORD* pCount); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateProcessesExA(HANDLE hServer, DWORD* pLevel, + DWORD SessionId, LPSTR* ppProcessInfo, + DWORD* pCount); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateListenersW(HANDLE hServer, PVOID pReserved, + DWORD Reserved, + PWTSLISTENERNAMEW pListeners, + DWORD* pCount); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSEnumerateListenersA(HANDLE hServer, PVOID pReserved, + DWORD Reserved, + PWTSLISTENERNAMEA pListeners, + DWORD* pCount); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSQueryListenerConfigW(HANDLE hServer, PVOID pReserved, + DWORD Reserved, LPWSTR pListenerName, + PWTSLISTENERCONFIGW pBuffer); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSQueryListenerConfigA(HANDLE hServer, PVOID pReserved, + DWORD Reserved, LPSTR pListenerName, + PWTSLISTENERCONFIGA pBuffer); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSCreateListenerW(HANDLE hServer, PVOID pReserved, + DWORD Reserved, LPWSTR pListenerName, + PWTSLISTENERCONFIGW pBuffer, DWORD flag); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSCreateListenerA(HANDLE hServer, PVOID pReserved, + DWORD Reserved, LPSTR pListenerName, + PWTSLISTENERCONFIGA pBuffer, DWORD flag); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSSetListenerSecurityW(HANDLE hServer, PVOID pReserved, + DWORD Reserved, LPWSTR pListenerName, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSSetListenerSecurityA(HANDLE hServer, PVOID pReserved, + DWORD Reserved, LPSTR pListenerName, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSGetListenerSecurityW(HANDLE hServer, PVOID pReserved, + DWORD Reserved, LPWSTR pListenerName, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor, + DWORD nLength, LPDWORD lpnLengthNeeded); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSGetListenerSecurityA(HANDLE hServer, PVOID pReserved, + DWORD Reserved, LPSTR pListenerName, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor, + DWORD nLength, LPDWORD lpnLengthNeeded); FREERDP_LOCAL BOOL CDECL FreeRDP_WTSEnableChildSessions(BOOL bEnable); FREERDP_LOCAL BOOL CDECL FreeRDP_WTSIsChildSessionsEnabled(PBOOL pbEnabled); @@ -244,7 +260,7 @@ FREERDP_LOCAL BOOL CDECL FreeRDP_WTSGetChildSessionId(PULONG pSessionId); FREERDP_LOCAL DWORD WINAPI FreeRDP_WTSGetActiveConsoleSessionId(void); FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSLogoffUser(HANDLE hServer); -FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSLogonUser(HANDLE hServer, LPCSTR username, - LPCSTR password, LPCSTR domain); +FREERDP_LOCAL BOOL WINAPI FreeRDP_WTSLogonUser(HANDLE hServer, LPCSTR username, LPCSTR password, + LPCSTR domain); #endif /* FREERDP_LIB_CORE_SERVER_H */ diff --git a/libfreerdp/core/settings.c b/libfreerdp/core/settings.c index 55fb9ff9c..0efa7192b 100644 --- a/libfreerdp/core/settings.c +++ b/libfreerdp/core/settings.c @@ -40,28 +40,25 @@ #include #include - #ifdef _WIN32 #pragma warning(push) -#pragma warning(disable: 4244) +#pragma warning(disable : 4244) #endif static const char client_dll[] = "C:\\Windows\\System32\\mstscax.dll"; -#define REG_QUERY_DWORD_VALUE(_key, _subkey, _type, _value, _size, _result) \ - _size = sizeof(DWORD); \ - if (RegQueryValueEx(_key, _subkey, NULL, &_type, (BYTE*) &_value, &_size) == ERROR_SUCCESS) \ - _result = _value +#define REG_QUERY_DWORD_VALUE(_key, _subkey, _type, _value, _size, _result) \ + _size = sizeof(DWORD); \ + if (RegQueryValueEx(_key, _subkey, NULL, &_type, (BYTE*)&_value, &_size) == ERROR_SUCCESS) \ + _result = _value -#define REG_QUERY_BOOL_VALUE(_key, _subkey, _type, _value, _size, _result) \ - _size = sizeof(DWORD); \ - if (RegQueryValueEx(_key, _subkey, NULL, &_type, (BYTE*) &_value, &_size) == ERROR_SUCCESS) \ - _result = _value ? TRUE : FALSE +#define REG_QUERY_BOOL_VALUE(_key, _subkey, _type, _value, _size, _result) \ + _size = sizeof(DWORD); \ + if (RegQueryValueEx(_key, _subkey, NULL, &_type, (BYTE*)&_value, &_size) == ERROR_SUCCESS) \ + _result = _value ? TRUE : FALSE -#define SERVER_KEY "Software\\" FREERDP_VENDOR_STRING "\\" \ - FREERDP_PRODUCT_STRING "\\Server" -#define CLIENT_KEY "Software\\" FREERDP_VENDOR_STRING "\\" \ - FREERDP_PRODUCT_STRING "\\Client" +#define SERVER_KEY "Software\\" FREERDP_VENDOR_STRING "\\" FREERDP_PRODUCT_STRING "\\Server" +#define CLIENT_KEY "Software\\" FREERDP_VENDOR_STRING "\\" FREERDP_PRODUCT_STRING "\\Client" #define BITMAP_CACHE_KEY CLIENT_KEY "\\BitmapCacheV2" #define GLYPH_CACHE_KEY CLIENT_KEY "\\GlyphCache" #define POINTER_CACHE_KEY CLIENT_KEY "\\PointerCache" @@ -73,8 +70,7 @@ static void settings_client_load_hkey_local_machine(rdpSettings* settings) DWORD dwType; DWORD dwSize; DWORD dwValue; - status = RegOpenKeyExA(HKEY_LOCAL_MACHINE, CLIENT_KEY, 0, - KEY_READ | KEY_WOW64_64KEY, &hKey); + status = RegOpenKeyExA(HKEY_LOCAL_MACHINE, CLIENT_KEY, 0, KEY_READ | KEY_WOW64_64KEY, &hKey); if (status == ERROR_SUCCESS) { @@ -82,8 +78,7 @@ static void settings_client_load_hkey_local_machine(rdpSettings* settings) settings->DesktopWidth); REG_QUERY_DWORD_VALUE(hKey, _T("DesktopHeight"), dwType, dwValue, dwSize, settings->DesktopHeight); - REG_QUERY_BOOL_VALUE(hKey, _T("Fullscreen"), dwType, dwValue, dwSize, - settings->Fullscreen); + REG_QUERY_BOOL_VALUE(hKey, _T("Fullscreen"), dwType, dwValue, dwSize, settings->Fullscreen); REG_QUERY_DWORD_VALUE(hKey, _T("ColorDepth"), dwType, dwValue, dwSize, settings->ColorDepth); REG_QUERY_DWORD_VALUE(hKey, _T("KeyboardType"), dwType, dwValue, dwSize, @@ -110,15 +105,15 @@ static void settings_client_load_hkey_local_machine(rdpSettings* settings) settings->BitmapCacheEnabled); REG_QUERY_BOOL_VALUE(hKey, _T("OffscreenBitmapCache"), dwType, dwValue, dwSize, settings->OffscreenSupportLevel); - REG_QUERY_DWORD_VALUE(hKey, _T("OffscreenBitmapCacheSize"), dwType, dwValue, - dwSize, settings->OffscreenCacheSize); - REG_QUERY_DWORD_VALUE(hKey, _T("OffscreenBitmapCacheEntries"), dwType, dwValue, - dwSize, settings->OffscreenCacheEntries); + REG_QUERY_DWORD_VALUE(hKey, _T("OffscreenBitmapCacheSize"), dwType, dwValue, dwSize, + settings->OffscreenCacheSize); + REG_QUERY_DWORD_VALUE(hKey, _T("OffscreenBitmapCacheEntries"), dwType, dwValue, dwSize, + settings->OffscreenCacheEntries); RegCloseKey(hKey); } - status = RegOpenKeyExA(HKEY_LOCAL_MACHINE, BITMAP_CACHE_KEY, 0, - KEY_READ | KEY_WOW64_64KEY, &hKey); + status = + RegOpenKeyExA(HKEY_LOCAL_MACHINE, BITMAP_CACHE_KEY, 0, KEY_READ | KEY_WOW64_64KEY, &hKey); if (status == ERROR_SUCCESS) { @@ -149,8 +144,8 @@ static void settings_client_load_hkey_local_machine(rdpSettings* settings) RegCloseKey(hKey); } - status = RegOpenKeyExA(HKEY_LOCAL_MACHINE, GLYPH_CACHE_KEY, - 0, KEY_READ | KEY_WOW64_64KEY, &hKey); + status = + RegOpenKeyExA(HKEY_LOCAL_MACHINE, GLYPH_CACHE_KEY, 0, KEY_READ | KEY_WOW64_64KEY, &hKey); if (status == ERROR_SUCCESS) { @@ -203,8 +198,8 @@ static void settings_client_load_hkey_local_machine(rdpSettings* settings) RegCloseKey(hKey); } - status = RegOpenKeyExA(HKEY_LOCAL_MACHINE, POINTER_CACHE_KEY, - 0, KEY_READ | KEY_WOW64_64KEY, &hKey); + status = + RegOpenKeyExA(HKEY_LOCAL_MACHINE, POINTER_CACHE_KEY, 0, KEY_READ | KEY_WOW64_64KEY, &hKey); if (status == ERROR_SUCCESS) { @@ -225,20 +220,15 @@ static void settings_server_load_hkey_local_machine(rdpSettings* settings) DWORD dwType; DWORD dwSize; DWORD dwValue; - status = RegOpenKeyExA(HKEY_LOCAL_MACHINE, SERVER_KEY, - 0, KEY_READ | KEY_WOW64_64KEY, &hKey); + status = RegOpenKeyExA(HKEY_LOCAL_MACHINE, SERVER_KEY, 0, KEY_READ | KEY_WOW64_64KEY, &hKey); if (status != ERROR_SUCCESS) return; - REG_QUERY_BOOL_VALUE(hKey, _T("ExtSecurity"), dwType, dwValue, dwSize, - settings->ExtSecurity); - REG_QUERY_BOOL_VALUE(hKey, _T("NlaSecurity"), dwType, dwValue, dwSize, - settings->NlaSecurity); - REG_QUERY_BOOL_VALUE(hKey, _T("TlsSecurity"), dwType, dwValue, dwSize, - settings->TlsSecurity); - REG_QUERY_BOOL_VALUE(hKey, _T("RdpSecurity"), dwType, dwValue, dwSize, - settings->RdpSecurity); + REG_QUERY_BOOL_VALUE(hKey, _T("ExtSecurity"), dwType, dwValue, dwSize, settings->ExtSecurity); + REG_QUERY_BOOL_VALUE(hKey, _T("NlaSecurity"), dwType, dwValue, dwSize, settings->NlaSecurity); + REG_QUERY_BOOL_VALUE(hKey, _T("TlsSecurity"), dwType, dwValue, dwSize, settings->TlsSecurity); + REG_QUERY_BOOL_VALUE(hKey, _T("RdpSecurity"), dwType, dwValue, dwSize, settings->RdpSecurity); RegCloseKey(hKey); } @@ -303,9 +293,12 @@ BOOL freerdp_settings_set_default_order_support(rdpSettings* settings) settings->OrderSupport[NEG_MEMBLT_V2_INDEX] = settings->BitmapCacheEnabled; settings->OrderSupport[NEG_MEM3BLT_V2_INDEX] = settings->BitmapCacheEnabled; settings->OrderSupport[NEG_SAVEBITMAP_INDEX] = FALSE; - settings->OrderSupport[NEG_GLYPH_INDEX_INDEX] = settings->GlyphSupportLevel != GLYPH_SUPPORT_NONE; - settings->OrderSupport[NEG_FAST_INDEX_INDEX] = settings->GlyphSupportLevel != GLYPH_SUPPORT_NONE; - settings->OrderSupport[NEG_FAST_GLYPH_INDEX] = settings->GlyphSupportLevel != GLYPH_SUPPORT_NONE; + settings->OrderSupport[NEG_GLYPH_INDEX_INDEX] = + settings->GlyphSupportLevel != GLYPH_SUPPORT_NONE; + settings->OrderSupport[NEG_FAST_INDEX_INDEX] = + settings->GlyphSupportLevel != GLYPH_SUPPORT_NONE; + settings->OrderSupport[NEG_FAST_GLYPH_INDEX] = + settings->GlyphSupportLevel != GLYPH_SUPPORT_NONE; settings->OrderSupport[NEG_POLYGON_SC_INDEX] = FALSE; settings->OrderSupport[NEG_POLYGON_CB_INDEX] = FALSE; settings->OrderSupport[NEG_ELLIPSE_SC_INDEX] = FALSE; @@ -317,20 +310,17 @@ rdpSettings* freerdp_settings_new(DWORD flags) { char* base; rdpSettings* settings; - settings = (rdpSettings*) calloc(1, sizeof(rdpSettings)); + settings = (rdpSettings*)calloc(1, sizeof(rdpSettings)); if (!settings) return NULL; settings->HiDefRemoteApp = FALSE; - settings->RemoteApplicationSupportMask = RAIL_LEVEL_SUPPORTED | - RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED | - RAIL_LEVEL_SHELL_INTEGRATION_SUPPORTED | - RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED | - RAIL_LEVEL_SERVER_TO_CLIENT_IME_SYNC_SUPPORTED | - RAIL_LEVEL_HIDE_MINIMIZED_APPS_SUPPORTED | - RAIL_LEVEL_WINDOW_CLOAKING_SUPPORTED | - RAIL_LEVEL_HANDSHAKE_EX_SUPPORTED; + settings->RemoteApplicationSupportMask = + RAIL_LEVEL_SUPPORTED | RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED | + RAIL_LEVEL_SHELL_INTEGRATION_SUPPORTED | RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED | + RAIL_LEVEL_SERVER_TO_CLIENT_IME_SYNC_SUPPORTED | RAIL_LEVEL_HIDE_MINIMIZED_APPS_SUPPORTED | + RAIL_LEVEL_WINDOW_CLOAKING_SUPPORTED | RAIL_LEVEL_HANDSHAKE_EX_SUPPORTED; settings->SupportHeartbeatPdu = TRUE; settings->ServerMode = (flags & FREERDP_SETTINGS_SERVER_MODE) ? TRUE : FALSE; settings->WaitForOutputBufferFlush = TRUE; @@ -388,8 +378,8 @@ rdpSettings* freerdp_settings_new(DWORD flags) settings->AuthenticationLevel = 2; settings->ChannelCount = 0; settings->ChannelDefArraySize = 32; - settings->ChannelDefArray = (CHANNEL_DEF*) calloc(settings->ChannelDefArraySize, - sizeof(CHANNEL_DEF)); + settings->ChannelDefArray = + (CHANNEL_DEF*)calloc(settings->ChannelDefArraySize, sizeof(CHANNEL_DEF)); if (!settings->ChannelDefArray) goto out_fail; @@ -397,15 +387,15 @@ rdpSettings* freerdp_settings_new(DWORD flags) settings->SupportMonitorLayoutPdu = FALSE; settings->MonitorCount = 0; settings->MonitorDefArraySize = 32; - settings->MonitorDefArray = (rdpMonitor*) calloc(settings->MonitorDefArraySize, - sizeof(rdpMonitor)); + settings->MonitorDefArray = + (rdpMonitor*)calloc(settings->MonitorDefArraySize, sizeof(rdpMonitor)); if (!settings->MonitorDefArray) goto out_fail; settings->MonitorLocalShiftX = 0; settings->MonitorLocalShiftY = 0; - settings->MonitorIds = (UINT32*) calloc(16, sizeof(UINT32)); + settings->MonitorIds = (UINT32*)calloc(16, sizeof(UINT32)); if (!settings->MonitorIds) goto out_fail; @@ -442,8 +432,8 @@ rdpSettings* freerdp_settings_new(DWORD flags) settings->SurfaceFrameMarkerEnabled = TRUE; settings->AllowCacheWaitingList = TRUE; settings->BitmapCacheV2NumCells = 5; - settings->BitmapCacheV2CellInfo = (BITMAP_CACHE_V2_CELL_INFO*) malloc(sizeof( - BITMAP_CACHE_V2_CELL_INFO) * 6); + settings->BitmapCacheV2CellInfo = + (BITMAP_CACHE_V2_CELL_INFO*)malloc(sizeof(BITMAP_CACHE_V2_CELL_INFO) * 6); if (!settings->BitmapCacheV2CellInfo) goto out_fail; @@ -508,8 +498,7 @@ rdpSettings* freerdp_settings_new(DWORD flags) settings->RemoteAppNumIconCaches = 3; settings->RemoteAppNumIconCacheEntries = 12; settings->VirtualChannelChunkSize = CHANNEL_CHUNK_LENGTH; - settings->MultifragMaxRequestSize = (flags & FREERDP_SETTINGS_SERVER_MODE) ? - 0 : 0xFFFF; + settings->MultifragMaxRequestSize = (flags & FREERDP_SETTINGS_SERVER_MODE) ? 0 : 0xFFFF; settings->GatewayUseSameCredentials = FALSE; settings->GatewayBypassLocal = FALSE; settings->GatewayRpcTransport = TRUE; @@ -532,41 +521,40 @@ rdpSettings* freerdp_settings_new(DWORD flags) settings->GfxH264 = FALSE; settings->GfxAVC444 = FALSE; settings->GfxSendQoeAck = FALSE; - settings->ClientAutoReconnectCookie = (ARC_CS_PRIVATE_PACKET*) calloc(1, - sizeof(ARC_CS_PRIVATE_PACKET)); + settings->ClientAutoReconnectCookie = + (ARC_CS_PRIVATE_PACKET*)calloc(1, sizeof(ARC_CS_PRIVATE_PACKET)); if (!settings->ClientAutoReconnectCookie) goto out_fail; - settings->ServerAutoReconnectCookie = (ARC_SC_PRIVATE_PACKET*) calloc(1, - sizeof(ARC_SC_PRIVATE_PACKET)); + settings->ServerAutoReconnectCookie = + (ARC_SC_PRIVATE_PACKET*)calloc(1, sizeof(ARC_SC_PRIVATE_PACKET)); if (!settings->ServerAutoReconnectCookie) goto out_fail; - settings->ClientTimeZone = (LPTIME_ZONE_INFORMATION) calloc(1, - sizeof(TIME_ZONE_INFORMATION)); + settings->ClientTimeZone = (LPTIME_ZONE_INFORMATION)calloc(1, sizeof(TIME_ZONE_INFORMATION)); if (!settings->ClientTimeZone) goto out_fail; settings->DeviceArraySize = 16; - settings->DeviceArray = (RDPDR_DEVICE**) calloc(1, - sizeof(RDPDR_DEVICE*) * settings->DeviceArraySize); + settings->DeviceArray = + (RDPDR_DEVICE**)calloc(1, sizeof(RDPDR_DEVICE*) * settings->DeviceArraySize); if (!settings->DeviceArray) goto out_fail; settings->StaticChannelArraySize = 16; - settings->StaticChannelArray = (ADDIN_ARGV**) - calloc(1, sizeof(ADDIN_ARGV*) * settings->StaticChannelArraySize); + settings->StaticChannelArray = + (ADDIN_ARGV**)calloc(1, sizeof(ADDIN_ARGV*) * settings->StaticChannelArraySize); if (!settings->StaticChannelArray) goto out_fail; settings->DynamicChannelArraySize = 16; - settings->DynamicChannelArray = (ADDIN_ARGV**) - calloc(1, sizeof(ADDIN_ARGV*) * settings->DynamicChannelArraySize); + settings->DynamicChannelArray = + (ADDIN_ARGV**)calloc(1, sizeof(ADDIN_ARGV*) * settings->DynamicChannelArraySize); if (!settings->DynamicChannelArray) goto out_fail; @@ -585,14 +573,11 @@ rdpSettings* freerdp_settings_new(DWORD flags) * Custom builds use / as config folder. */ if (_stricmp(FREERDP_VENDOR_STRING, FREERDP_PRODUCT_STRING)) { - base = GetKnownSubPath(KNOWN_PATH_XDG_CONFIG_HOME, - FREERDP_VENDOR_STRING); + base = GetKnownSubPath(KNOWN_PATH_XDG_CONFIG_HOME, FREERDP_VENDOR_STRING); if (base) { - settings->ConfigPath = GetCombinedPath( - base, - FREERDP_PRODUCT_STRING); + settings->ConfigPath = GetCombinedPath(base, FREERDP_PRODUCT_STRING); } free(base); @@ -606,9 +591,7 @@ rdpSettings* freerdp_settings_new(DWORD flags) for (i = 0; i < sizeof(product); i++) product[i] = tolower(FREERDP_PRODUCT_STRING[i]); - settings->ConfigPath = GetKnownSubPath( - KNOWN_PATH_XDG_CONFIG_HOME, - product); + settings->ConfigPath = GetKnownSubPath(KNOWN_PATH_XDG_CONFIG_HOME, product); } if (!settings->ConfigPath) @@ -616,7 +599,7 @@ rdpSettings* freerdp_settings_new(DWORD flags) } settings_load_hkey_local_machine(settings); - settings->SettingsModified = (BYTE*) calloc(1, sizeof(rdpSettings) / 8); + settings->SettingsModified = (BYTE*)calloc(1, sizeof(rdpSettings) / 8); if (!settings->SettingsModified) goto out_fail; @@ -658,7 +641,6 @@ out_fail: return NULL; } - static void freerdp_settings_free_internal(rdpSettings* settings) { free(settings->ServerHostname); @@ -768,109 +750,107 @@ BOOL freerdp_settings_copy(rdpSettings* _settings, const rdpSettings* settings) *_settings = *settings; /* char* values */ -#define CHECKED_STRDUP(name) if (settings->name && !(_settings->name = _strdup(settings->name))) goto out_fail - CHECKED_STRDUP(ServerHostname); /* 20 */ - CHECKED_STRDUP(Username); /* 21 */ - CHECKED_STRDUP(Password); /* 22 */ - CHECKED_STRDUP(Domain); /* 23 */ - CHECKED_STRDUP(PasswordHash); /* 24 */ - CHECKED_STRDUP(AcceptedCert); /* 27 */ - CHECKED_STRDUP(AlternateShell); /* 640 */ - CHECKED_STRDUP(ShellWorkingDirectory); /* 641 */ - CHECKED_STRDUP(ClientAddress); /* 769 */ - CHECKED_STRDUP(ClientDir); /* 770 */ - CHECKED_STRDUP(DynamicDSTTimeZoneKeyName); /* 897 */ - CHECKED_STRDUP(RemoteAssistanceSessionId); /* 1025 */ - CHECKED_STRDUP(RemoteAssistancePassStub); /* 1026 */ - CHECKED_STRDUP(RemoteAssistancePassword); /* 1027 */ - CHECKED_STRDUP(RemoteAssistanceRCTicket); /* 1028 */ - CHECKED_STRDUP(AuthenticationServiceClass); /* 1098 */ - CHECKED_STRDUP(AllowedTlsCiphers); /* 1101 */ - CHECKED_STRDUP(NtlmSamFile); /* 1103 */ - CHECKED_STRDUP(PreconnectionBlob); /* 1155 */ - CHECKED_STRDUP(TargetNetAddress); /* 1217 */ - CHECKED_STRDUP(RedirectionUsername); /* 1220 */ - CHECKED_STRDUP(RedirectionDomain); /* 1221 */ - CHECKED_STRDUP(RedirectionTargetFQDN); /* 1224 */ +#define CHECKED_STRDUP(name) \ + if (settings->name && !(_settings->name = _strdup(settings->name))) \ + goto out_fail + CHECKED_STRDUP(ServerHostname); /* 20 */ + CHECKED_STRDUP(Username); /* 21 */ + CHECKED_STRDUP(Password); /* 22 */ + CHECKED_STRDUP(Domain); /* 23 */ + CHECKED_STRDUP(PasswordHash); /* 24 */ + CHECKED_STRDUP(AcceptedCert); /* 27 */ + CHECKED_STRDUP(AlternateShell); /* 640 */ + CHECKED_STRDUP(ShellWorkingDirectory); /* 641 */ + CHECKED_STRDUP(ClientAddress); /* 769 */ + CHECKED_STRDUP(ClientDir); /* 770 */ + CHECKED_STRDUP(DynamicDSTTimeZoneKeyName); /* 897 */ + CHECKED_STRDUP(RemoteAssistanceSessionId); /* 1025 */ + CHECKED_STRDUP(RemoteAssistancePassStub); /* 1026 */ + CHECKED_STRDUP(RemoteAssistancePassword); /* 1027 */ + CHECKED_STRDUP(RemoteAssistanceRCTicket); /* 1028 */ + CHECKED_STRDUP(AuthenticationServiceClass); /* 1098 */ + CHECKED_STRDUP(AllowedTlsCiphers); /* 1101 */ + CHECKED_STRDUP(NtlmSamFile); /* 1103 */ + CHECKED_STRDUP(PreconnectionBlob); /* 1155 */ + CHECKED_STRDUP(TargetNetAddress); /* 1217 */ + CHECKED_STRDUP(RedirectionUsername); /* 1220 */ + CHECKED_STRDUP(RedirectionDomain); /* 1221 */ + CHECKED_STRDUP(RedirectionTargetFQDN); /* 1224 */ CHECKED_STRDUP(RedirectionTargetNetBiosName); /* 1225 */ - CHECKED_STRDUP(RedirectionAcceptedCert); /* 1231 */ - CHECKED_STRDUP(KerberosKdc); /* 1344 */ - CHECKED_STRDUP(KerberosRealm); /* 1345 */ - CHECKED_STRDUP(CertificateName); /* 1409 */ - CHECKED_STRDUP(CertificateFile); /* 1410 */ - CHECKED_STRDUP(PrivateKeyFile); /* 1411 */ - CHECKED_STRDUP(RdpKeyFile); /* 1412 */ - CHECKED_STRDUP(CertificateContent); /* 1416 */ - CHECKED_STRDUP(PrivateKeyContent); /* 1417 */ - CHECKED_STRDUP(RdpKeyContent); /* 1418 */ - CHECKED_STRDUP(WindowTitle); /* 1542 */ - CHECKED_STRDUP(WmClass); /* 1549 */ - CHECKED_STRDUP(ComputerName); /* 1664 */ - CHECKED_STRDUP(ConnectionFile); /* 1728 */ - CHECKED_STRDUP(AssistanceFile); /* 1729 */ - CHECKED_STRDUP(HomePath); /* 1792 */ - CHECKED_STRDUP(ConfigPath); /* 1793 */ - CHECKED_STRDUP(CurrentPath); /* 1794 */ - CHECKED_STRDUP(DumpRemoteFxFile); /* 1858 */ - CHECKED_STRDUP(PlayRemoteFxFile); /* 1859 */ - CHECKED_STRDUP(GatewayHostname); /* 1986 */ - CHECKED_STRDUP(GatewayUsername); /* 1987 */ - CHECKED_STRDUP(GatewayPassword); /* 1988 */ - CHECKED_STRDUP(GatewayDomain); /* 1989 */ - CHECKED_STRDUP(GatewayAccessToken); /* 1997 */ - CHECKED_STRDUP(GatewayAcceptedCert); /* 1998 */ - CHECKED_STRDUP(ProxyHostname); /* 2016 */ - CHECKED_STRDUP(RemoteApplicationName); /* 2113 */ - CHECKED_STRDUP(RemoteApplicationIcon); /* 2114 */ - CHECKED_STRDUP(RemoteApplicationProgram); /* 2115 */ - CHECKED_STRDUP(RemoteApplicationFile); /* 2116 */ - CHECKED_STRDUP(RemoteApplicationGuid); /* 2117 */ - CHECKED_STRDUP(RemoteApplicationCmdLine); /* 2118 */ - CHECKED_STRDUP(ImeFileName); /* 2628 */ - CHECKED_STRDUP(DrivesToRedirect); /* 4290 */ + CHECKED_STRDUP(RedirectionAcceptedCert); /* 1231 */ + CHECKED_STRDUP(KerberosKdc); /* 1344 */ + CHECKED_STRDUP(KerberosRealm); /* 1345 */ + CHECKED_STRDUP(CertificateName); /* 1409 */ + CHECKED_STRDUP(CertificateFile); /* 1410 */ + CHECKED_STRDUP(PrivateKeyFile); /* 1411 */ + CHECKED_STRDUP(RdpKeyFile); /* 1412 */ + CHECKED_STRDUP(CertificateContent); /* 1416 */ + CHECKED_STRDUP(PrivateKeyContent); /* 1417 */ + CHECKED_STRDUP(RdpKeyContent); /* 1418 */ + CHECKED_STRDUP(WindowTitle); /* 1542 */ + CHECKED_STRDUP(WmClass); /* 1549 */ + CHECKED_STRDUP(ComputerName); /* 1664 */ + CHECKED_STRDUP(ConnectionFile); /* 1728 */ + CHECKED_STRDUP(AssistanceFile); /* 1729 */ + CHECKED_STRDUP(HomePath); /* 1792 */ + CHECKED_STRDUP(ConfigPath); /* 1793 */ + CHECKED_STRDUP(CurrentPath); /* 1794 */ + CHECKED_STRDUP(DumpRemoteFxFile); /* 1858 */ + CHECKED_STRDUP(PlayRemoteFxFile); /* 1859 */ + CHECKED_STRDUP(GatewayHostname); /* 1986 */ + CHECKED_STRDUP(GatewayUsername); /* 1987 */ + CHECKED_STRDUP(GatewayPassword); /* 1988 */ + CHECKED_STRDUP(GatewayDomain); /* 1989 */ + CHECKED_STRDUP(GatewayAccessToken); /* 1997 */ + CHECKED_STRDUP(GatewayAcceptedCert); /* 1998 */ + CHECKED_STRDUP(ProxyHostname); /* 2016 */ + CHECKED_STRDUP(RemoteApplicationName); /* 2113 */ + CHECKED_STRDUP(RemoteApplicationIcon); /* 2114 */ + CHECKED_STRDUP(RemoteApplicationProgram); /* 2115 */ + CHECKED_STRDUP(RemoteApplicationFile); /* 2116 */ + CHECKED_STRDUP(RemoteApplicationGuid); /* 2117 */ + CHECKED_STRDUP(RemoteApplicationCmdLine); /* 2118 */ + CHECKED_STRDUP(ImeFileName); /* 2628 */ + CHECKED_STRDUP(DrivesToRedirect); /* 4290 */ CHECKED_STRDUP(ActionScript); if (settings->LoadBalanceInfo && settings->LoadBalanceInfoLength) { - _settings->LoadBalanceInfo = (BYTE*) calloc(1, - settings->LoadBalanceInfoLength + 2); + _settings->LoadBalanceInfo = (BYTE*)calloc(1, settings->LoadBalanceInfoLength + 2); if (!_settings->LoadBalanceInfo) goto out_fail; CopyMemory(_settings->LoadBalanceInfo, settings->LoadBalanceInfo, - settings->LoadBalanceInfoLength); + settings->LoadBalanceInfoLength); _settings->LoadBalanceInfoLength = settings->LoadBalanceInfoLength; } if (_settings->ServerRandomLength) { - _settings->ServerRandom = (BYTE*) malloc(_settings->ServerRandomLength); + _settings->ServerRandom = (BYTE*)malloc(_settings->ServerRandomLength); if (!_settings->ServerRandom) goto out_fail; - CopyMemory(_settings->ServerRandom, settings->ServerRandom, - _settings->ServerRandomLength); + CopyMemory(_settings->ServerRandom, settings->ServerRandom, _settings->ServerRandomLength); _settings->ServerRandomLength = settings->ServerRandomLength; } if (_settings->ClientRandomLength) { - _settings->ClientRandom = (BYTE*) malloc(_settings->ClientRandomLength); + _settings->ClientRandom = (BYTE*)malloc(_settings->ClientRandomLength); if (!_settings->ClientRandom) goto out_fail; - CopyMemory(_settings->ClientRandom, settings->ClientRandom, - _settings->ClientRandomLength); + CopyMemory(_settings->ClientRandom, settings->ClientRandom, _settings->ClientRandomLength); _settings->ClientRandomLength = settings->ClientRandomLength; } if (settings->RdpServerCertificate) { - _settings->RdpServerCertificate = certificate_clone( - settings->RdpServerCertificate); + _settings->RdpServerCertificate = certificate_clone(settings->RdpServerCertificate); if (!_settings->RdpServerCertificate) goto out_fail; @@ -889,14 +869,14 @@ BOOL freerdp_settings_copy(rdpSettings* _settings, const rdpSettings* settings) if (_settings->ChannelDefArraySize > 0) { - _settings->ChannelDefArray = (CHANNEL_DEF*) calloc(settings->ChannelDefArraySize, - sizeof(CHANNEL_DEF)); + _settings->ChannelDefArray = + (CHANNEL_DEF*)calloc(settings->ChannelDefArraySize, sizeof(CHANNEL_DEF)); if (!_settings->ChannelDefArray) goto out_fail; CopyMemory(_settings->ChannelDefArray, settings->ChannelDefArray, - sizeof(CHANNEL_DEF) * settings->ChannelDefArraySize); + sizeof(CHANNEL_DEF) * settings->ChannelDefArraySize); } else _settings->ChannelDefArray = NULL; @@ -906,19 +886,19 @@ BOOL freerdp_settings_copy(rdpSettings* _settings, const rdpSettings* settings) if (_settings->MonitorDefArraySize > 0) { - _settings->MonitorDefArray = (rdpMonitor*) calloc(settings->MonitorDefArraySize, - sizeof(rdpMonitor)); + _settings->MonitorDefArray = + (rdpMonitor*)calloc(settings->MonitorDefArraySize, sizeof(rdpMonitor)); if (!_settings->MonitorDefArray) goto out_fail; CopyMemory(_settings->MonitorDefArray, settings->MonitorDefArray, - sizeof(rdpMonitor) * settings->MonitorDefArraySize); + sizeof(rdpMonitor) * settings->MonitorDefArraySize); } else _settings->MonitorDefArray = NULL; - _settings->MonitorIds = (UINT32*) calloc(16, sizeof(UINT32)); + _settings->MonitorIds = (UINT32*)calloc(16, sizeof(UINT32)); if (!_settings->MonitorIds) goto out_fail; @@ -949,14 +929,14 @@ BOOL freerdp_settings_copy(rdpSettings* _settings, const rdpSettings* settings) if (!_settings->ClientProductId) goto out_fail; - _settings->BitmapCacheV2CellInfo = (BITMAP_CACHE_V2_CELL_INFO*) malloc(sizeof( - BITMAP_CACHE_V2_CELL_INFO) * 6); + _settings->BitmapCacheV2CellInfo = + (BITMAP_CACHE_V2_CELL_INFO*)malloc(sizeof(BITMAP_CACHE_V2_CELL_INFO) * 6); if (!_settings->BitmapCacheV2CellInfo) goto out_fail; CopyMemory(_settings->BitmapCacheV2CellInfo, settings->BitmapCacheV2CellInfo, - sizeof(BITMAP_CACHE_V2_CELL_INFO) * 6); + sizeof(BITMAP_CACHE_V2_CELL_INFO) * 6); _settings->GlyphCache = malloc(sizeof(GLYPH_CACHE_DEFINITION) * 10); if (!_settings->GlyphCache) @@ -967,34 +947,30 @@ BOOL freerdp_settings_copy(rdpSettings* _settings, const rdpSettings* settings) if (!_settings->FragCache) goto out_fail; - CopyMemory(_settings->GlyphCache, settings->GlyphCache, - sizeof(GLYPH_CACHE_DEFINITION) * 10); - CopyMemory(_settings->FragCache, settings->FragCache, - sizeof(GLYPH_CACHE_DEFINITION)); - _settings->ClientAutoReconnectCookie = (ARC_CS_PRIVATE_PACKET*) malloc(sizeof( - ARC_CS_PRIVATE_PACKET)); + CopyMemory(_settings->GlyphCache, settings->GlyphCache, sizeof(GLYPH_CACHE_DEFINITION) * 10); + CopyMemory(_settings->FragCache, settings->FragCache, sizeof(GLYPH_CACHE_DEFINITION)); + _settings->ClientAutoReconnectCookie = + (ARC_CS_PRIVATE_PACKET*)malloc(sizeof(ARC_CS_PRIVATE_PACKET)); if (!_settings->ClientAutoReconnectCookie) goto out_fail; - _settings->ServerAutoReconnectCookie = (ARC_SC_PRIVATE_PACKET*) malloc(sizeof( - ARC_SC_PRIVATE_PACKET)); + _settings->ServerAutoReconnectCookie = + (ARC_SC_PRIVATE_PACKET*)malloc(sizeof(ARC_SC_PRIVATE_PACKET)); if (!_settings->ServerAutoReconnectCookie) goto out_fail; - CopyMemory(_settings->ClientAutoReconnectCookie, - settings->ClientAutoReconnectCookie, sizeof(ARC_CS_PRIVATE_PACKET)); - CopyMemory(_settings->ServerAutoReconnectCookie, - settings->ServerAutoReconnectCookie, sizeof(ARC_SC_PRIVATE_PACKET)); - _settings->ClientTimeZone = (LPTIME_ZONE_INFORMATION) malloc(sizeof( - TIME_ZONE_INFORMATION)); + CopyMemory(_settings->ClientAutoReconnectCookie, settings->ClientAutoReconnectCookie, + sizeof(ARC_CS_PRIVATE_PACKET)); + CopyMemory(_settings->ServerAutoReconnectCookie, settings->ServerAutoReconnectCookie, + sizeof(ARC_SC_PRIVATE_PACKET)); + _settings->ClientTimeZone = (LPTIME_ZONE_INFORMATION)malloc(sizeof(TIME_ZONE_INFORMATION)); if (!_settings->ClientTimeZone) goto out_fail; - CopyMemory(_settings->ClientTimeZone, settings->ClientTimeZone, - sizeof(TIME_ZONE_INFORMATION)); + CopyMemory(_settings->ClientTimeZone, settings->ClientTimeZone, sizeof(TIME_ZONE_INFORMATION)); _settings->RedirectionPasswordLength = settings->RedirectionPasswordLength; if (settings->RedirectionPasswordLength > 0) @@ -1006,7 +982,8 @@ BOOL freerdp_settings_copy(rdpSettings* _settings, const rdpSettings* settings) goto out_fail; } - CopyMemory(_settings->RedirectionPassword, settings->RedirectionPassword, _settings->RedirectionPasswordLength); + CopyMemory(_settings->RedirectionPassword, settings->RedirectionPassword, + _settings->RedirectionPasswordLength); } _settings->RedirectionTsvUrlLength = settings->RedirectionTsvUrlLength; @@ -1019,15 +996,16 @@ BOOL freerdp_settings_copy(rdpSettings* _settings, const rdpSettings* settings) goto out_fail; } - CopyMemory(_settings->RedirectionTsvUrl, settings->RedirectionTsvUrl, _settings->RedirectionTsvUrlLength); + CopyMemory(_settings->RedirectionTsvUrl, settings->RedirectionTsvUrl, + _settings->RedirectionTsvUrlLength); } _settings->TargetNetAddressCount = settings->TargetNetAddressCount; if (settings->TargetNetAddressCount > 0) { - _settings->TargetNetAddresses = (char**) calloc(settings->TargetNetAddressCount, - sizeof(char*)); + _settings->TargetNetAddresses = + (char**)calloc(settings->TargetNetAddressCount, sizeof(char*)); if (!_settings->TargetNetAddresses) { @@ -1037,8 +1015,7 @@ BOOL freerdp_settings_copy(rdpSettings* _settings, const rdpSettings* settings) for (index = 0; index < settings->TargetNetAddressCount; index++) { - _settings->TargetNetAddresses[index] = _strdup( - settings->TargetNetAddresses[index]); + _settings->TargetNetAddresses[index] = _strdup(settings->TargetNetAddresses[index]); if (!_settings->TargetNetAddresses[index]) { @@ -1054,8 +1031,8 @@ BOOL freerdp_settings_copy(rdpSettings* _settings, const rdpSettings* settings) if (settings->TargetNetPorts) { - _settings->TargetNetPorts = (UINT32*) calloc(settings->TargetNetAddressCount, - sizeof(UINT32)); + _settings->TargetNetPorts = + (UINT32*)calloc(settings->TargetNetAddressCount, sizeof(UINT32)); if (!_settings->TargetNetPorts) goto out_fail; @@ -1067,8 +1044,8 @@ BOOL freerdp_settings_copy(rdpSettings* _settings, const rdpSettings* settings) _settings->DeviceCount = settings->DeviceCount; _settings->DeviceArraySize = settings->DeviceArraySize; - _settings->DeviceArray = (RDPDR_DEVICE**) calloc(_settings->DeviceArraySize, - sizeof(RDPDR_DEVICE*)); + _settings->DeviceArray = + (RDPDR_DEVICE**)calloc(_settings->DeviceArraySize, sizeof(RDPDR_DEVICE*)); if (!_settings->DeviceArray && _settings->DeviceArraySize) { @@ -1086,8 +1063,7 @@ BOOL freerdp_settings_copy(rdpSettings* _settings, const rdpSettings* settings) for (index = 0; index < _settings->DeviceCount; index++) { - _settings->DeviceArray[index] = freerdp_device_clone( - settings->DeviceArray[index]); + _settings->DeviceArray[index] = freerdp_device_clone(settings->DeviceArray[index]); if (!_settings->DeviceArray[index]) goto out_fail; @@ -1095,27 +1071,27 @@ BOOL freerdp_settings_copy(rdpSettings* _settings, const rdpSettings* settings) _settings->StaticChannelCount = settings->StaticChannelCount; _settings->StaticChannelArraySize = settings->StaticChannelArraySize; - _settings->StaticChannelArray = (ADDIN_ARGV**) calloc( - _settings->StaticChannelArraySize, sizeof(ADDIN_ARGV*)); + _settings->StaticChannelArray = + (ADDIN_ARGV**)calloc(_settings->StaticChannelArraySize, sizeof(ADDIN_ARGV*)); if (!_settings->StaticChannelArray && _settings->StaticChannelArraySize) { - _settings->StaticChannelArraySize = 0; + _settings->StaticChannelArraySize = 0; _settings->ChannelCount = 0; goto out_fail; } if (_settings->StaticChannelArraySize < _settings->StaticChannelCount) { - _settings->StaticChannelArraySize = 0; + _settings->StaticChannelArraySize = 0; _settings->ChannelCount = 0; goto out_fail; } for (index = 0; index < _settings->StaticChannelCount; index++) { - _settings->StaticChannelArray[index] = freerdp_static_channel_clone( - settings->StaticChannelArray[index]); + _settings->StaticChannelArray[index] = + freerdp_static_channel_clone(settings->StaticChannelArray[index]); if (!_settings->StaticChannelArray[index]) goto out_fail; @@ -1123,8 +1099,8 @@ BOOL freerdp_settings_copy(rdpSettings* _settings, const rdpSettings* settings) _settings->DynamicChannelCount = settings->DynamicChannelCount; _settings->DynamicChannelArraySize = settings->DynamicChannelArraySize; - _settings->DynamicChannelArray = (ADDIN_ARGV**) calloc( - _settings->DynamicChannelArraySize, sizeof(ADDIN_ARGV*)); + _settings->DynamicChannelArray = + (ADDIN_ARGV**)calloc(_settings->DynamicChannelArraySize, sizeof(ADDIN_ARGV*)); if (!_settings->DynamicChannelArray && _settings->DynamicChannelArraySize) { @@ -1142,14 +1118,14 @@ BOOL freerdp_settings_copy(rdpSettings* _settings, const rdpSettings* settings) for (index = 0; index < _settings->DynamicChannelCount; index++) { - _settings->DynamicChannelArray[index] = freerdp_dynamic_channel_clone( - settings->DynamicChannelArray[index]); + _settings->DynamicChannelArray[index] = + freerdp_dynamic_channel_clone(settings->DynamicChannelArray[index]); if (!_settings->DynamicChannelArray[index]) goto out_fail; } - _settings->SettingsModified = (BYTE*) calloc(1, sizeof(rdpSettings) / 8); + _settings->SettingsModified = (BYTE*)calloc(1, sizeof(rdpSettings) / 8); if (!_settings->SettingsModified) goto out_fail; @@ -1162,7 +1138,7 @@ out_fail: rdpSettings* freerdp_settings_clone(const rdpSettings* settings) { - rdpSettings* _settings = (rdpSettings*) calloc(1, sizeof(rdpSettings)); + rdpSettings* _settings = (rdpSettings*)calloc(1, sizeof(rdpSettings)); if (!freerdp_settings_copy(_settings, settings)) goto out_fail; @@ -1181,4 +1157,3 @@ out_fail: #ifdef _WIN32 #pragma warning(pop) #endif - diff --git a/libfreerdp/core/surface.c b/libfreerdp/core/surface.c index 9ad4e0620..db51e6812 100644 --- a/libfreerdp/core/surface.c +++ b/libfreerdp/core/surface.c @@ -64,7 +64,7 @@ static BOOL update_recv_surfcmd_bitmap_ex(wStream* s, TS_BITMAP_DATA_EX* bmp) if ((bmp->bpp < 1) || (bmp->bpp > 32)) { - WLog_ERR(TAG, "invalid bpp value %"PRIu32"", bmp->bpp); + WLog_ERR(TAG, "invalid bpp value %" PRIu32 "", bmp->bpp); return FALSE; } @@ -87,7 +87,7 @@ static BOOL update_recv_surfcmd_bitmap_ex(wStream* s, TS_BITMAP_DATA_EX* bmp) static BOOL update_recv_surfcmd_surface_bits(rdpUpdate* update, wStream* s) { - SURFACE_BITS_COMMAND cmd = {0}; + SURFACE_BITS_COMMAND cmd = { 0 }; if (Stream_GetRemainingLength(s) < 8) goto fail; @@ -120,9 +120,9 @@ static BOOL update_recv_surfcmd_frame_marker(rdpUpdate* update, wStream* s) Stream_Read_UINT16(s, marker.frameAction); Stream_Read_UINT32(s, marker.frameId); - WLog_Print(update->log, WLOG_DEBUG, "SurfaceFrameMarker: action: %s (%"PRIu32") id: %"PRIu32"", - (!marker.frameAction) ? "Begin" : "End", - marker.frameAction, marker.frameId); + WLog_Print(update->log, WLOG_DEBUG, + "SurfaceFrameMarker: action: %s (%" PRIu32 ") id: %" PRIu32 "", + (!marker.frameAction) ? "Begin" : "End", marker.frameAction, marker.frameId); if (!update->SurfaceFrameMarker) { @@ -160,7 +160,7 @@ int update_recv_surfcmds(rdpUpdate* update, wStream* s) break; default: - WLog_ERR(TAG, "unknown cmdType 0x%04"PRIX16"", cmdType); + WLog_ERR(TAG, "unknown cmdType 0x%04" PRIX16 "", cmdType); return -1; } @@ -177,7 +177,7 @@ int update_recv_surfcmds(rdpUpdate* update, wStream* s) } static BOOL update_write_surfcmd_bitmap_header_ex(wStream* s, - const TS_COMPRESSED_BITMAP_HEADER_EX* header) + const TS_COMPRESSED_BITMAP_HEADER_EX* header) { if (!s || !header) return FALSE; diff --git a/libfreerdp/core/surface.h b/libfreerdp/core/surface.h index 65bf018b9..aa4819a50 100644 --- a/libfreerdp/core/surface.h +++ b/libfreerdp/core/surface.h @@ -37,10 +37,8 @@ enum SURFCMD_CMDTYPE FREERDP_LOCAL int update_recv_surfcmds(rdpUpdate* update, wStream* s); -FREERDP_LOCAL BOOL update_write_surfcmd_surface_bits(wStream* s, - const SURFACE_BITS_COMMAND* cmd); -FREERDP_LOCAL BOOL update_write_surfcmd_frame_marker(wStream* s, - UINT16 frameAction, UINT32 frameId); +FREERDP_LOCAL BOOL update_write_surfcmd_surface_bits(wStream* s, const SURFACE_BITS_COMMAND* cmd); +FREERDP_LOCAL BOOL update_write_surfcmd_frame_marker(wStream* s, UINT16 frameAction, + UINT32 frameId); #endif /* FREERDP_LIB_CORE_SURFACE_H */ - diff --git a/libfreerdp/core/tcp.c b/libfreerdp/core/tcp.c index 6bdb307b2..1932fcd31 100644 --- a/libfreerdp/core/tcp.c +++ b/libfreerdp/core/tcp.c @@ -55,13 +55,13 @@ #if defined(__FreeBSD__) || defined(__OpenBSD__) #ifndef SOL_TCP -#define SOL_TCP IPPROTO_TCP +#define SOL_TCP IPPROTO_TCP #endif #endif #ifdef __APPLE__ #ifndef SOL_TCP -#define SOL_TCP IPPROTO_TCP +#define SOL_TCP IPPROTO_TCP #endif #ifndef TCP_KEEPIDLE #define TCP_KEEPIDLE TCP_KEEPALIVE @@ -110,7 +110,7 @@ static int transport_bio_simple_write(BIO* bio, const char* buf, int size) { int error; int status = 0; - WINPR_BIO_SIMPLE_SOCKET* ptr = (WINPR_BIO_SIMPLE_SOCKET*) BIO_get_data(bio); + WINPR_BIO_SIMPLE_SOCKET* ptr = (WINPR_BIO_SIMPLE_SOCKET*)BIO_get_data(bio); if (!buf) return 0; @@ -122,8 +122,8 @@ static int transport_bio_simple_write(BIO* bio, const char* buf, int size) { error = WSAGetLastError(); - if ((error == WSAEWOULDBLOCK) || (error == WSAEINTR) || - (error == WSAEINPROGRESS) || (error == WSAEALREADY)) + if ((error == WSAEWOULDBLOCK) || (error == WSAEINTR) || (error == WSAEINPROGRESS) || + (error == WSAEALREADY)) { BIO_set_flags(bio, (BIO_FLAGS_WRITE | BIO_FLAGS_SHOULD_RETRY)); } @@ -140,7 +140,7 @@ static int transport_bio_simple_read(BIO* bio, char* buf, int size) { int error; int status = 0; - WINPR_BIO_SIMPLE_SOCKET* ptr = (WINPR_BIO_SIMPLE_SOCKET*) BIO_get_data(bio); + WINPR_BIO_SIMPLE_SOCKET* ptr = (WINPR_BIO_SIMPLE_SOCKET*)BIO_get_data(bio); if (!buf) return 0; @@ -162,8 +162,8 @@ static int transport_bio_simple_read(BIO* bio, char* buf, int size) error = WSAGetLastError(); - if ((error == WSAEWOULDBLOCK) || (error == WSAEINTR) || - (error == WSAEINPROGRESS) || (error == WSAEALREADY)) + if ((error == WSAEWOULDBLOCK) || (error == WSAEINTR) || (error == WSAEINPROGRESS) || + (error == WSAEALREADY)) { BIO_set_flags(bio, (BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY)); } @@ -188,12 +188,12 @@ static int transport_bio_simple_gets(BIO* bio, char* str, int size) static long transport_bio_simple_ctrl(BIO* bio, int cmd, long arg1, void* arg2) { int status = -1; - WINPR_BIO_SIMPLE_SOCKET* ptr = (WINPR_BIO_SIMPLE_SOCKET*) BIO_get_data(bio); + WINPR_BIO_SIMPLE_SOCKET* ptr = (WINPR_BIO_SIMPLE_SOCKET*)BIO_get_data(bio); if (cmd == BIO_C_SET_SOCKET) { transport_bio_simple_uninit(bio); - transport_bio_simple_init(bio, (SOCKET) arg2, (int) arg1); + transport_bio_simple_init(bio, (SOCKET)arg2, (int)arg1); return 1; } else if (cmd == BIO_C_GET_SOCKET) @@ -201,7 +201,7 @@ static long transport_bio_simple_ctrl(BIO* bio, int cmd, long arg1, void* arg2) if (!BIO_get_init(bio) || !arg2) return 0; - *((SOCKET*) arg2) = ptr->socket; + *((SOCKET*)arg2) = ptr->socket; return 1; } else if (cmd == BIO_C_GET_EVENT) @@ -209,22 +209,22 @@ static long transport_bio_simple_ctrl(BIO* bio, int cmd, long arg1, void* arg2) if (!BIO_get_init(bio) || !arg2) return 0; - *((HANDLE*) arg2) = ptr->hEvent; + *((HANDLE*)arg2) = ptr->hEvent; return 1; } else if (cmd == BIO_C_SET_NONBLOCK) { #ifndef _WIN32 int flags; - flags = fcntl((int) ptr->socket, F_GETFL); + flags = fcntl((int)ptr->socket, F_GETFL); if (flags == -1) return 0; if (arg1) - fcntl((int) ptr->socket, F_SETFL, flags | O_NONBLOCK); + fcntl((int)ptr->socket, F_SETFL, flags | O_NONBLOCK); else - fcntl((int) ptr->socket, F_SETFL, flags & ~(O_NONBLOCK)); + fcntl((int)ptr->socket, F_SETFL, flags & ~(O_NONBLOCK)); #else /* the internal socket is always non-blocking */ @@ -233,8 +233,8 @@ static long transport_bio_simple_ctrl(BIO* bio, int cmd, long arg1, void* arg2) } else if (cmd == BIO_C_WAIT_READ) { - int timeout = (int) arg1; - int sockfd = (int) ptr->socket; + int timeout = (int)arg1; + int sockfd = (int)ptr->socket; #ifdef HAVE_POLL_H struct pollfd pollset; pollset.fd = sockfd; @@ -244,8 +244,7 @@ static long transport_bio_simple_ctrl(BIO* bio, int cmd, long arg1, void* arg2) do { status = poll(&pollset, 1, timeout); - } - while ((status < 0) && (errno == EINTR)); + } while ((status < 0) && (errno == EINTR)); #else fd_set rset; @@ -262,15 +261,14 @@ static long transport_bio_simple_ctrl(BIO* bio, int cmd, long arg1, void* arg2) do { status = select(sockfd + 1, &rset, NULL, NULL, timeout ? &tv : NULL); - } - while ((status < 0) && (errno == EINTR)); + } while ((status < 0) && (errno == EINTR)); #endif } else if (cmd == BIO_C_WAIT_WRITE) { - int timeout = (int) arg1; - int sockfd = (int) ptr->socket; + int timeout = (int)arg1; + int sockfd = (int)ptr->socket; #ifdef HAVE_POLL_H struct pollfd pollset; pollset.fd = sockfd; @@ -280,8 +278,7 @@ static long transport_bio_simple_ctrl(BIO* bio, int cmd, long arg1, void* arg2) do { status = poll(&pollset, 1, timeout); - } - while ((status < 0) && (errno == EINTR)); + } while ((status < 0) && (errno == EINTR)); #else fd_set rset; @@ -298,8 +295,7 @@ static long transport_bio_simple_ctrl(BIO* bio, int cmd, long arg1, void* arg2) do { status = select(sockfd + 1, NULL, &rset, NULL, timeout ? &tv : NULL); - } - while ((status < 0) && (errno == EINTR)); + } while ((status < 0) && (errno == EINTR)); #endif } @@ -310,7 +306,7 @@ static long transport_bio_simple_ctrl(BIO* bio, int cmd, long arg1, void* arg2) if (arg2) { transport_bio_simple_uninit(bio); - transport_bio_simple_init(bio, (SOCKET) * ((int*) arg2), (int) arg1); + transport_bio_simple_init(bio, (SOCKET) * ((int*)arg2), (int)arg1); status = 1; } @@ -320,9 +316,9 @@ static long transport_bio_simple_ctrl(BIO* bio, int cmd, long arg1, void* arg2) if (BIO_get_init(bio)) { if (arg2) - *((int*) arg2) = (int) ptr->socket; + *((int*)arg2) = (int)ptr->socket; - status = (int) ptr->socket; + status = (int)ptr->socket; } break; @@ -332,7 +328,7 @@ static long transport_bio_simple_ctrl(BIO* bio, int cmd, long arg1, void* arg2) break; case BIO_CTRL_SET_CLOSE: - BIO_set_shutdown(bio, (int) arg1); + BIO_set_shutdown(bio, (int)arg1); status = 1; break; @@ -354,7 +350,7 @@ static long transport_bio_simple_ctrl(BIO* bio, int cmd, long arg1, void* arg2) static int transport_bio_simple_init(BIO* bio, SOCKET socket, int shutdown) { - WINPR_BIO_SIMPLE_SOCKET* ptr = (WINPR_BIO_SIMPLE_SOCKET*) BIO_get_data(bio); + WINPR_BIO_SIMPLE_SOCKET* ptr = (WINPR_BIO_SIMPLE_SOCKET*)BIO_get_data(bio); ptr->socket = socket; BIO_set_shutdown(bio, shutdown); BIO_set_flags(bio, BIO_FLAGS_SHOULD_RETRY); @@ -376,7 +372,7 @@ static int transport_bio_simple_init(BIO* bio, SOCKET socket, int shutdown) static int transport_bio_simple_uninit(BIO* bio) { - WINPR_BIO_SIMPLE_SOCKET* ptr = (WINPR_BIO_SIMPLE_SOCKET*) BIO_get_data(bio); + WINPR_BIO_SIMPLE_SOCKET* ptr = (WINPR_BIO_SIMPLE_SOCKET*)BIO_get_data(bio); if (BIO_get_shutdown(bio)) { @@ -403,7 +399,7 @@ static int transport_bio_simple_new(BIO* bio) { WINPR_BIO_SIMPLE_SOCKET* ptr; BIO_set_flags(bio, BIO_FLAGS_SHOULD_RETRY); - ptr = (WINPR_BIO_SIMPLE_SOCKET*) calloc(1, sizeof(WINPR_BIO_SIMPLE_SOCKET)); + ptr = (WINPR_BIO_SIMPLE_SOCKET*)calloc(1, sizeof(WINPR_BIO_SIMPLE_SOCKET)); if (!ptr) return 0; @@ -420,7 +416,7 @@ static int transport_bio_simple_free(BIO* bio) return 0; transport_bio_simple_uninit(bio); - ptr = (WINPR_BIO_SIMPLE_SOCKET*) BIO_get_data(bio); + ptr = (WINPR_BIO_SIMPLE_SOCKET*)BIO_get_data(bio); if (ptr) { @@ -476,7 +472,7 @@ static int transport_bio_buffered_write(BIO* bio, const char* buf, int num) int nchunks; int committedBytes; DataChunk chunks[2]; - WINPR_BIO_BUFFERED_SOCKET* ptr = (WINPR_BIO_BUFFERED_SOCKET*) BIO_get_data(bio); + WINPR_BIO_BUFFERED_SOCKET* ptr = (WINPR_BIO_BUFFERED_SOCKET*)BIO_get_data(bio); BIO* next_bio = NULL; ret = num; ptr->writeBlocked = FALSE; @@ -485,7 +481,7 @@ static int transport_bio_buffered_write(BIO* bio, const char* buf, int num) /* we directly append extra bytes in the xmit buffer, this could be prevented * but for now it makes the code more simple. */ - if (buf && num && !ringbuffer_write(&ptr->xmitBuffer, (const BYTE*) buf, num)) + if (buf && num && !ringbuffer_write(&ptr->xmitBuffer, (const BYTE*)buf, num)) { WLog_ERR(TAG, "an error occurred when writing (num: %d)", num); return -1; @@ -532,7 +528,7 @@ out: static int transport_bio_buffered_read(BIO* bio, char* buf, int size) { int status; - WINPR_BIO_BUFFERED_SOCKET* ptr = (WINPR_BIO_BUFFERED_SOCKET*) BIO_get_data(bio); + WINPR_BIO_BUFFERED_SOCKET* ptr = (WINPR_BIO_BUFFERED_SOCKET*)BIO_get_data(bio); BIO* next_bio = BIO_next(bio); ptr->readBlocked = FALSE; BIO_clear_flags(bio, BIO_FLAGS_READ); @@ -573,7 +569,7 @@ static int transport_bio_buffered_gets(BIO* bio, char* str, int size) static long transport_bio_buffered_ctrl(BIO* bio, int cmd, long arg1, void* arg2) { int status = -1; - WINPR_BIO_BUFFERED_SOCKET* ptr = (WINPR_BIO_BUFFERED_SOCKET*) BIO_get_data(bio); + WINPR_BIO_BUFFERED_SOCKET* ptr = (WINPR_BIO_BUFFERED_SOCKET*)BIO_get_data(bio); switch (cmd) { @@ -594,11 +590,11 @@ static long transport_bio_buffered_ctrl(BIO* bio, int cmd, long arg1, void* arg2 break; case BIO_C_READ_BLOCKED: - status = (int) ptr->readBlocked; + status = (int)ptr->readBlocked; break; case BIO_C_WRITE_BLOCKED: - status = (int) ptr->writeBlocked; + status = (int)ptr->writeBlocked; break; default: @@ -614,12 +610,12 @@ static int transport_bio_buffered_new(BIO* bio) WINPR_BIO_BUFFERED_SOCKET* ptr; BIO_set_init(bio, 1); BIO_set_flags(bio, BIO_FLAGS_SHOULD_RETRY); - ptr = (WINPR_BIO_BUFFERED_SOCKET*) calloc(1, sizeof(WINPR_BIO_BUFFERED_SOCKET)); + ptr = (WINPR_BIO_BUFFERED_SOCKET*)calloc(1, sizeof(WINPR_BIO_BUFFERED_SOCKET)); if (!ptr) return -1; - BIO_set_data(bio, (void*) ptr); + BIO_set_data(bio, (void*)ptr); if (!ringbuffer_init(&ptr->xmitBuffer, 0x10000)) return -1; @@ -632,7 +628,7 @@ static int transport_bio_buffered_new(BIO* bio) * let BIO_free_all handle that. */ static int transport_bio_buffered_free(BIO* bio) { - WINPR_BIO_BUFFERED_SOCKET* ptr = (WINPR_BIO_BUFFERED_SOCKET*) BIO_get_data(bio); + WINPR_BIO_BUFFERED_SOCKET* ptr = (WINPR_BIO_BUFFERED_SOCKET*)BIO_get_data(bio); if (!ptr) return 0; @@ -677,13 +673,15 @@ char* freerdp_tcp_address_to_string(const struct sockaddr_storage* addr, BOOL* p switch (sockaddr_ipv4->sin_family) { case AF_INET: - if (!inet_ntop(sockaddr_ipv4->sin_family, &sockaddr_ipv4->sin_addr, ipAddress, sizeof(ipAddress))) + if (!inet_ntop(sockaddr_ipv4->sin_family, &sockaddr_ipv4->sin_addr, ipAddress, + sizeof(ipAddress))) return NULL; break; case AF_INET6: - if (!inet_ntop(sockaddr_ipv6->sin6_family, &sockaddr_ipv6->sin6_addr, ipAddress, sizeof(ipAddress))) + if (!inet_ntop(sockaddr_ipv6->sin6_family, &sockaddr_ipv6->sin6_addr, ipAddress, + sizeof(ipAddress))) return NULL; break; @@ -746,7 +744,7 @@ static int freerdp_uds_connect(const char* path) addr.sun_family = AF_UNIX; strncpy(addr.sun_path, path, sizeof(addr.sun_path) - 1); - status = connect(sockfd, (struct sockaddr*) &addr, sizeof(addr)); + status = connect(sockfd, (struct sockaddr*)&addr, sizeof(addr)); if (status < 0) { @@ -806,8 +804,7 @@ static BOOL freerdp_tcp_is_hostname_resolvable(rdpContext* context, const char* return TRUE; } -static BOOL freerdp_tcp_connect_timeout(rdpContext* context, int sockfd, - struct sockaddr* addr, +static BOOL freerdp_tcp_connect_timeout(rdpContext* context, int sockfd, struct sockaddr* addr, socklen_t addrlen, int timeout) { BOOL rc = FALSE; @@ -900,9 +897,8 @@ static void peer_free(t_peer* peer) peer->s = INVALID_SOCKET; } -static int freerdp_tcp_connect_multi(rdpContext* context, char** hostnames, - UINT32* ports, UINT32 count, int port, - int timeout) +static int freerdp_tcp_connect_multi(rdpContext* context, char** hostnames, UINT32* ports, + UINT32 count, int port, int timeout) { UINT32 index; UINT32 sindex = count; @@ -912,7 +908,7 @@ static int freerdp_tcp_connect_multi(rdpContext* context, char** hostnames, struct addrinfo* addr; struct addrinfo* result; t_peer* peers; - events = (HANDLE*) calloc(count + 1, sizeof(HANDLE)); + events = (HANDLE*)calloc(count + 1, sizeof(HANDLE)); peers = (t_peer*)calloc(count, sizeof(t_peer)); if (!peers || !events || (count < 1)) @@ -1003,7 +999,7 @@ BOOL freerdp_tcp_set_keep_alive_mode(int sockfd) optval = 1; optlen = sizeof(optval); - if (setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, (void*) &optval, optlen) < 0) + if (setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, (void*)&optval, optlen) < 0) { WLog_WARN(TAG, "setsockopt() SOL_SOCKET, SO_KEEPALIVE"); } @@ -1012,7 +1008,7 @@ BOOL freerdp_tcp_set_keep_alive_mode(int sockfd) optval = 5; optlen = sizeof(optval); - if (setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE, (void*) &optval, optlen) < 0) + if (setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE, (void*)&optval, optlen) < 0) { WLog_WARN(TAG, "setsockopt() IPPROTO_TCP, TCP_KEEPIDLE"); } @@ -1026,7 +1022,7 @@ BOOL freerdp_tcp_set_keep_alive_mode(int sockfd) optval = 3; optlen = sizeof(optval); - if (setsockopt(sockfd, SOL_TCP, TCP_KEEPCNT, (void*) &optval, optlen) < 0) + if (setsockopt(sockfd, SOL_TCP, TCP_KEEPCNT, (void*)&optval, optlen) < 0) { WLog_WARN(TAG, "setsockopt() SOL_TCP, TCP_KEEPCNT"); } @@ -1036,7 +1032,7 @@ BOOL freerdp_tcp_set_keep_alive_mode(int sockfd) optval = 2; optlen = sizeof(optval); - if (setsockopt(sockfd, SOL_TCP, TCP_KEEPINTVL, (void*) &optval, optlen) < 0) + if (setsockopt(sockfd, SOL_TCP, TCP_KEEPINTVL, (void*)&optval, optlen) < 0) { WLog_WARN(TAG, "setsockopt() SOL_TCP, TCP_KEEPINTVL"); } @@ -1047,7 +1043,7 @@ BOOL freerdp_tcp_set_keep_alive_mode(int sockfd) optval = 1; optlen = sizeof(optval); - if (setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, (void*) &optval, optlen) < 0) + if (setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, (void*)&optval, optlen) < 0) { WLog_WARN(TAG, "setsockopt() SOL_SOCKET, SO_NOSIGPIPE"); } @@ -1057,7 +1053,7 @@ BOOL freerdp_tcp_set_keep_alive_mode(int sockfd) optval = 9000; optlen = sizeof(optval); - if (setsockopt(sockfd, SOL_TCP, TCP_USER_TIMEOUT, (void*) &optval, optlen) < 0) + if (setsockopt(sockfd, SOL_TCP, TCP_USER_TIMEOUT, (void*)&optval, optlen) < 0) { WLog_WARN(TAG, "setsockopt() SOL_TCP, TCP_USER_TIMEOUT"); } @@ -1066,8 +1062,8 @@ BOOL freerdp_tcp_set_keep_alive_mode(int sockfd) return TRUE; } -int freerdp_tcp_connect(rdpContext* context, rdpSettings* settings, - const char* hostname, int port, int timeout) +int freerdp_tcp_connect(rdpContext* context, rdpSettings* settings, const char* hostname, int port, + int timeout) { int sockfd; UINT32 optval; @@ -1109,16 +1105,14 @@ int freerdp_tcp_connect(rdpContext* context, rdpSettings* settings, if (!settings->GatewayEnabled) { - if (!freerdp_tcp_is_hostname_resolvable(context, hostname) || settings->RemoteAssistanceMode) + if (!freerdp_tcp_is_hostname_resolvable(context, hostname) || + settings->RemoteAssistanceMode) { if (settings->TargetNetAddressCount > 0) { sockfd = freerdp_tcp_connect_multi( - context, - settings->TargetNetAddresses, - settings->TargetNetPorts, - settings->TargetNetAddressCount, - port, timeout); + context, settings->TargetNetAddresses, settings->TargetNetPorts, + settings->TargetNetAddressCount, port, timeout); } } } @@ -1142,7 +1136,8 @@ int freerdp_tcp_connect(rdpContext* context, rdpSettings* settings, addr = result; - if ((addr->ai_family == AF_INET6) && (addr->ai_next != 0) && !settings->PreferIPv6OverIPv4) + if ((addr->ai_family == AF_INET6) && (addr->ai_next != 0) && + !settings->PreferIPv6OverIPv4) { while ((addr = addr->ai_next)) { @@ -1165,15 +1160,15 @@ int freerdp_tcp_connect(rdpContext* context, rdpSettings* settings, return -1; } - if ((peerAddress = freerdp_tcp_address_to_string((const struct sockaddr_storage*)addr->ai_addr, - NULL)) != NULL) + if ((peerAddress = freerdp_tcp_address_to_string( + (const struct sockaddr_storage*)addr->ai_addr, NULL)) != NULL) { WLog_DBG(TAG, "connecting to peer %s", peerAddress); free(peerAddress); } - if (!freerdp_tcp_connect_timeout(context, sockfd, addr->ai_addr, - addr->ai_addrlen, timeout)) + if (!freerdp_tcp_connect_timeout(context, sockfd, addr->ai_addr, addr->ai_addrlen, + timeout)) { freeaddrinfo(result); close(sockfd); @@ -1209,19 +1204,19 @@ int freerdp_tcp_connect(rdpContext* context, rdpSettings* settings, if (!ipcSocket && !useExternalDefinedSocket) { - if (setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (void*) &optval, optlen) < 0) + if (setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (void*)&optval, optlen) < 0) WLog_ERR(TAG, "unable to set TCP_NODELAY"); } /* receive buffer must be a least 32 K */ - if (getsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, (void*) &optval, &optlen) == 0) + if (getsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, (void*)&optval, &optlen) == 0) { if (optval < (1024 * 32)) { optval = 1024 * 32; optlen = sizeof(optval); - if (setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, (void*) &optval, optlen) < 0) + if (setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, (void*)&optval, optlen) < 0) { close(sockfd); diff --git a/libfreerdp/core/tcp.h b/libfreerdp/core/tcp.h index 7a3416650..abb664403 100644 --- a/libfreerdp/core/tcp.h +++ b/libfreerdp/core/tcp.h @@ -38,39 +38,38 @@ #include -#define BIO_TYPE_TSG 65 -#define BIO_TYPE_SIMPLE 66 -#define BIO_TYPE_BUFFERED 67 +#define BIO_TYPE_TSG 65 +#define BIO_TYPE_SIMPLE 66 +#define BIO_TYPE_BUFFERED 67 -#define BIO_C_SET_SOCKET 1101 -#define BIO_C_GET_SOCKET 1102 -#define BIO_C_GET_EVENT 1103 -#define BIO_C_SET_NONBLOCK 1104 -#define BIO_C_READ_BLOCKED 1105 -#define BIO_C_WRITE_BLOCKED 1106 -#define BIO_C_WAIT_READ 1107 -#define BIO_C_WAIT_WRITE 1108 +#define BIO_C_SET_SOCKET 1101 +#define BIO_C_GET_SOCKET 1102 +#define BIO_C_GET_EVENT 1103 +#define BIO_C_SET_NONBLOCK 1104 +#define BIO_C_READ_BLOCKED 1105 +#define BIO_C_WRITE_BLOCKED 1106 +#define BIO_C_WAIT_READ 1107 +#define BIO_C_WAIT_WRITE 1108 -#define BIO_set_socket(b, s, c) BIO_ctrl(b, BIO_C_SET_SOCKET, c, s); -#define BIO_get_socket(b, c) BIO_ctrl(b, BIO_C_GET_SOCKET, 0, (char*) c) -#define BIO_get_event(b, c) BIO_ctrl(b, BIO_C_GET_EVENT, 0, (char*) c) -#define BIO_set_nonblock(b, c) BIO_ctrl(b, BIO_C_SET_NONBLOCK, c, NULL) -#define BIO_read_blocked(b) BIO_ctrl(b, BIO_C_READ_BLOCKED, 0, NULL) -#define BIO_write_blocked(b) BIO_ctrl(b, BIO_C_WRITE_BLOCKED, 0, NULL) -#define BIO_wait_read(b, c) BIO_ctrl(b, BIO_C_WAIT_READ, c, NULL) -#define BIO_wait_write(b, c) BIO_ctrl(b, BIO_C_WAIT_WRITE, c, NULL) +#define BIO_set_socket(b, s, c) BIO_ctrl(b, BIO_C_SET_SOCKET, c, s); +#define BIO_get_socket(b, c) BIO_ctrl(b, BIO_C_GET_SOCKET, 0, (char*)c) +#define BIO_get_event(b, c) BIO_ctrl(b, BIO_C_GET_EVENT, 0, (char*)c) +#define BIO_set_nonblock(b, c) BIO_ctrl(b, BIO_C_SET_NONBLOCK, c, NULL) +#define BIO_read_blocked(b) BIO_ctrl(b, BIO_C_READ_BLOCKED, 0, NULL) +#define BIO_write_blocked(b) BIO_ctrl(b, BIO_C_WRITE_BLOCKED, 0, NULL) +#define BIO_wait_read(b, c) BIO_ctrl(b, BIO_C_WAIT_READ, c, NULL) +#define BIO_wait_write(b, c) BIO_ctrl(b, BIO_C_WAIT_WRITE, c, NULL) FREERDP_LOCAL BIO_METHOD* BIO_s_simple_socket(void); FREERDP_LOCAL BIO_METHOD* BIO_s_buffered_socket(void); -FREERDP_LOCAL int freerdp_tcp_connect(rdpContext* context, - rdpSettings* settings, +FREERDP_LOCAL int freerdp_tcp_connect(rdpContext* context, rdpSettings* settings, const char* hostname, int port, int timeout); FREERDP_LOCAL char* freerdp_tcp_get_peer_address(SOCKET sockfd); FREERDP_LOCAL struct addrinfo* freerdp_tcp_resolve_host(const char* hostname, int port, - int ai_flags); + int ai_flags); FREERDP_LOCAL char* freerdp_tcp_address_to_string(const struct sockaddr_storage* addr, BOOL* pIPv6); #endif /* FREERDP_LIB_CORE_TCP_H */ diff --git a/libfreerdp/core/test/TestConnect.c b/libfreerdp/core/test/TestConnect.c index 890888e89..3f79fa03e 100644 --- a/libfreerdp/core/test/TestConnect.c +++ b/libfreerdp/core/test/TestConnect.c @@ -54,12 +54,7 @@ static int testTimeout(int port) { DWORD start, end, diff; char arg1[] = "/v:192.0.2.1:XXXXX"; - char* argv[] = - { - "test", - "/v:192.0.2.1:XXXXX", - NULL - }; + char* argv[] = { "test", "/v:192.0.2.1:XXXXX", NULL }; int rc; _snprintf(arg1, 18, "/v:192.0.2.1:%d", port); argv[1] = arg1; @@ -91,12 +86,7 @@ struct testThreadArgs static DWORD WINAPI testThread(LPVOID arg) { char arg1[] = "/v:192.0.2.1:XXXXX"; - char* argv[] = - { - "test", - "/v:192.0.2.1:XXXXX", - NULL - }; + char* argv[] = { "test", "/v:192.0.2.1:XXXXX", NULL }; int rc; struct testThreadArgs* args = arg; _snprintf(arg1, 18, "/v:192.0.2.1:%d", args->port); @@ -125,8 +115,7 @@ static int testAbort(int port) args.port = port; args.arg = &instance; start = GetTickCount(); - thread = CreateThread(NULL, 0, testThread, - &args, 0, NULL); + thread = CreateThread(NULL, 0, testThread, &args, 0, NULL); if (!thread) { @@ -157,7 +146,7 @@ static int testAbort(int port) if (diff > 5000) { - printf("%s required %"PRIu32"ms for the test\n", __FUNCTION__, diff); + printf("%s required %" PRIu32 "ms for the test\n", __FUNCTION__, diff); return -1; } @@ -175,14 +164,7 @@ static int testSuccess(int port) STARTUPINFOA si; PROCESS_INFORMATION process; char arg1[] = "/v:127.0.0.1:XXXXX"; - char* clientArgs[] = - { - "test", - "/v:127.0.0.1:XXXXX", - "/cert-ignore", - "/rfx", - NULL - }; + char* clientArgs[] = { "test", "/v:127.0.0.1:XXXXX", "/cert-ignore", "/rfx", NULL }; char* commandLine = NULL; size_t commandLineLen; int argc = 4; @@ -224,8 +206,7 @@ static int testSuccess(int port) memset(&si, 0, sizeof(si)); si.cb = sizeof(si); - if (!CreateProcessA(exe, commandLine, NULL, NULL, FALSE, 0, NULL, - wpath, &si, &process)) + if (!CreateProcessA(exe, commandLine, NULL, NULL, FALSE, 0, NULL, wpath, &si, &process)) goto fail; Sleep(1 * 1000); /* let the server start */ @@ -277,4 +258,3 @@ int TestConnect(int argc, char* argv[]) return 0; } - diff --git a/libfreerdp/core/test/TestSettings.c b/libfreerdp/core/test/TestSettings.c index 923cf11e6..6ae9219a3 100644 --- a/libfreerdp/core/test/TestSettings.c +++ b/libfreerdp/core/test/TestSettings.c @@ -145,4 +145,3 @@ fail: freerdp_settings_free(settings); return rc; } - diff --git a/libfreerdp/core/test/TestVersion.c b/libfreerdp/core/test/TestVersion.c index 8882e3540..2df2baabe 100644 --- a/libfreerdp/core/test/TestVersion.c +++ b/libfreerdp/core/test/TestVersion.c @@ -45,4 +45,3 @@ int TestVersion(int argc, char* argv[]) return 0; } - diff --git a/libfreerdp/core/test/settings_property_lists.h b/libfreerdp/core/test/settings_property_lists.h index 9bfd866d7..f76292794 100644 --- a/libfreerdp/core/test/settings_property_lists.h +++ b/libfreerdp/core/test/settings_property_lists.h @@ -2,8 +2,7 @@ #define TEST_SETTINGS_PROPERTY_LISTS #define have_bool_list_indices -static const size_t bool_list_indices[] = -{ +static const size_t bool_list_indices[] = { FreeRDP_ServerMode, FreeRDP_WaitForOutputBufferFlush, FreeRDP_NetworkAutoDetect, @@ -168,15 +167,13 @@ static const size_t bool_list_indices[] = }; #define have_uint16_list_indices -static const size_t uint16_list_indices[] = -{ +static const size_t uint16_list_indices[] = { FreeRDP_DesktopOrientation, FreeRDP_ProxyPort, }; #define have_uint32_list_indices -static const size_t uint32_list_indices[] = -{ +static const size_t uint32_list_indices[] = { FreeRDP_ShareId, FreeRDP_PduSource, FreeRDP_ServerPort, @@ -286,21 +283,18 @@ static const size_t uint32_list_indices[] = }; #define have_int32_list_indices -static const size_t int32_list_indices[] = -{ +static const size_t int32_list_indices[] = { FreeRDP_XPan, FreeRDP_YPan, }; #define have_uint64_list_indices -static const size_t uint64_list_indices[] = -{ +static const size_t uint64_list_indices[] = { FreeRDP_ParentWindowId, }; #define have_string_list_indices -static const size_t string_list_indices[] = -{ +static const size_t string_list_indices[] = { FreeRDP_ServerHostname, FreeRDP_Username, FreeRDP_Password, @@ -369,8 +363,7 @@ static const size_t string_list_indices[] = }; #define have_pointer_list_indices -static const size_t pointer_list_indices[] = -{ +static const size_t pointer_list_indices[] = { FreeRDP_StaticChannelArray, FreeRDP_DynamicChannelArray, FreeRDP_instance, @@ -400,4 +393,3 @@ static const size_t pointer_list_indices[] = }; #endif /* TEST_SETTINGS_PROPERTY_LISTS */ - diff --git a/libfreerdp/core/timezone.c b/libfreerdp/core/timezone.c index 982c5772f..9de268719 100644 --- a/libfreerdp/core/timezone.c +++ b/libfreerdp/core/timezone.c @@ -38,13 +38,13 @@ static void rdp_write_system_time(wStream* s, SYSTEMTIME* system_time); void rdp_read_system_time(wStream* s, SYSTEMTIME* system_time) { - Stream_Read_UINT16(s, system_time->wYear); /* wYear, must be set to 0 */ - Stream_Read_UINT16(s, system_time->wMonth); /* wMonth */ - Stream_Read_UINT16(s, system_time->wDayOfWeek); /* wDayOfWeek */ - Stream_Read_UINT16(s, system_time->wDay); /* wDay */ - Stream_Read_UINT16(s, system_time->wHour); /* wHour */ - Stream_Read_UINT16(s, system_time->wMinute); /* wMinute */ - Stream_Read_UINT16(s, system_time->wSecond); /* wSecond */ + Stream_Read_UINT16(s, system_time->wYear); /* wYear, must be set to 0 */ + Stream_Read_UINT16(s, system_time->wMonth); /* wMonth */ + Stream_Read_UINT16(s, system_time->wDayOfWeek); /* wDayOfWeek */ + Stream_Read_UINT16(s, system_time->wDay); /* wDay */ + Stream_Read_UINT16(s, system_time->wHour); /* wHour */ + Stream_Read_UINT16(s, system_time->wMinute); /* wMinute */ + Stream_Read_UINT16(s, system_time->wSecond); /* wSecond */ Stream_Read_UINT16(s, system_time->wMilliseconds); /* wMilliseconds */ } @@ -57,15 +57,16 @@ void rdp_read_system_time(wStream* s, SYSTEMTIME* system_time) void rdp_write_system_time(wStream* s, SYSTEMTIME* system_time) { - Stream_Write_UINT16(s, system_time->wYear); /* wYear, must be set to 0 */ - Stream_Write_UINT16(s, system_time->wMonth); /* wMonth */ - Stream_Write_UINT16(s, system_time->wDayOfWeek); /* wDayOfWeek */ - Stream_Write_UINT16(s, system_time->wDay); /* wDay */ - Stream_Write_UINT16(s, system_time->wHour); /* wHour */ - Stream_Write_UINT16(s, system_time->wMinute); /* wMinute */ - Stream_Write_UINT16(s, system_time->wSecond); /* wSecond */ + Stream_Write_UINT16(s, system_time->wYear); /* wYear, must be set to 0 */ + Stream_Write_UINT16(s, system_time->wMonth); /* wMonth */ + Stream_Write_UINT16(s, system_time->wDayOfWeek); /* wDayOfWeek */ + Stream_Write_UINT16(s, system_time->wDay); /* wDay */ + Stream_Write_UINT16(s, system_time->wHour); /* wHour */ + Stream_Write_UINT16(s, system_time->wMinute); /* wMinute */ + Stream_Write_UINT16(s, system_time->wSecond); /* wSecond */ Stream_Write_UINT16(s, system_time->wMilliseconds); /* wMilliseconds */ - DEBUG_TIMEZONE("Time: y=%"PRIu16",m=%"PRIu16",dow=%"PRIu16",d=%"PRIu16", %02"PRIu16":%02"PRIu16":%02"PRIu16".%03"PRIu16"", + DEBUG_TIMEZONE("Time: y=%" PRIu16 ",m=%" PRIu16 ",dow=%" PRIu16 ",d=%" PRIu16 ", %02" PRIu16 + ":%02" PRIu16 ":%02" PRIu16 ".%03" PRIu16 "", system_time->wYear, system_time->wMonth, system_time->wDayOfWeek, system_time->wDay, system_time->wHour, system_time->wMinute, system_time->wSecond, system_time->wMilliseconds); @@ -97,11 +98,11 @@ BOOL rdp_read_client_time_zone(wStream* s, rdpSettings* settings) /* standardName (64 bytes) */ Stream_Read(s, tz->StandardName, sizeof(tz->StandardName)); rdp_read_system_time(s, &tz->StandardDate); /* StandardDate */ - Stream_Read_UINT32(s, tz->StandardBias); /* StandardBias */ + Stream_Read_UINT32(s, tz->StandardBias); /* StandardBias */ /* daylightName (64 bytes) */ Stream_Read(s, tz->DaylightName, sizeof(tz->DaylightName)); rdp_read_system_time(s, &tz->DaylightDate); /* DaylightDate */ - Stream_Read_UINT32(s, tz->DaylightBias); /* DaylightBias */ + Stream_Read_UINT32(s, tz->DaylightBias); /* DaylightBias */ return TRUE; } @@ -128,16 +129,18 @@ BOOL rdp_write_client_time_zone(wStream* s, rdpSettings* settings) /* StandardDate */ rdp_write_system_time(s, &tz->StandardDate); #ifdef WITH_DEBUG_TIMEZONE - WLog_DBG(TIMEZONE_TAG, "bias=%"PRId32"", tz->Bias); + WLog_DBG(TIMEZONE_TAG, "bias=%" PRId32 "", tz->Bias); WLog_DBG(TIMEZONE_TAG, "StandardName:"); - winpr_HexDump(TIMEZONE_TAG, WLOG_DEBUG, (const BYTE*) tz->StandardName, sizeof(tz->StandardName)); + winpr_HexDump(TIMEZONE_TAG, WLOG_DEBUG, (const BYTE*)tz->StandardName, + sizeof(tz->StandardName)); WLog_DBG(TIMEZONE_TAG, "DaylightName:"); - winpr_HexDump(TIMEZONE_TAG, WLOG_DEBUG, (const BYTE*) tz->DaylightName, sizeof(tz->DaylightName)); + winpr_HexDump(TIMEZONE_TAG, WLOG_DEBUG, (const BYTE*)tz->DaylightName, + sizeof(tz->DaylightName)); #endif /* Note that StandardBias is ignored if no valid standardDate is provided. */ /* StandardBias */ Stream_Write_UINT32(s, tz->StandardBias); - DEBUG_TIMEZONE("StandardBias=%"PRId32"", tz->StandardBias); + DEBUG_TIMEZONE("StandardBias=%" PRId32 "", tz->StandardBias); /* daylightName (64 bytes) */ Stream_Write(s, tz->DaylightName, sizeof(tz->DaylightName)); /* DaylightDate */ @@ -145,7 +148,6 @@ BOOL rdp_write_client_time_zone(wStream* s, rdpSettings* settings) /* Note that DaylightBias is ignored if no valid daylightDate is provided. */ /* DaylightBias */ Stream_Write_UINT32(s, tz->DaylightBias); - DEBUG_TIMEZONE("DaylightBias=%"PRId32"", tz->DaylightBias); + DEBUG_TIMEZONE("DaylightBias=%" PRId32 "", tz->DaylightBias); return TRUE; } - diff --git a/libfreerdp/core/timezone.h b/libfreerdp/core/timezone.h index 6e721d2e6..a4496bfe9 100644 --- a/libfreerdp/core/timezone.h +++ b/libfreerdp/core/timezone.h @@ -33,14 +33,16 @@ #include FREERDP_LOCAL BOOL rdp_read_client_time_zone(wStream* s, rdpSettings* settings); -FREERDP_LOCAL BOOL rdp_write_client_time_zone(wStream* s, - rdpSettings* settings); +FREERDP_LOCAL BOOL rdp_write_client_time_zone(wStream* s, rdpSettings* settings); #define TIMEZONE_TAG FREERDP_TAG("core.timezone") #ifdef WITH_DEBUG_TIMEZONE #define DEBUG_TIMEZONE(...) WLog_DBG(TIMEZONE_TAG, __VA_ARGS__) #else -#define DEBUG_TIMEZONE(...) do { } while (0) +#define DEBUG_TIMEZONE(...) \ + do \ + { \ + } while (0) #endif #endif /* FREERDP_LIB_CORE_TIMEZONE_H */ diff --git a/libfreerdp/core/tpdu.c b/libfreerdp/core/tpdu.c index 9c94d89a7..3c879b895 100644 --- a/libfreerdp/core/tpdu.c +++ b/libfreerdp/core/tpdu.c @@ -34,7 +34,8 @@ * TPDUs are defined in: * * http://www.itu.int/rec/T-REC-X.224-199511-I/ - * X.224: Information technology - Open Systems Interconnection - Protocol for providing the connection-mode transport service + * X.224: Information technology - Open Systems Interconnection - Protocol for providing the + * connection-mode transport service * * RDP uses only TPDUs of class 0, the "simple class" defined in section 8 of X.224 * @@ -76,7 +77,7 @@ BOOL tpdu_read_header(wStream* s, BYTE* code, BYTE* li) if (Stream_GetRemainingLength(s) < 3) return FALSE; - Stream_Read_UINT8(s, *li); /* LI */ + Stream_Read_UINT8(s, *li); /* LI */ Stream_Read_UINT8(s, *code); /* Code */ if (*code == X224_TPDU_DATA) @@ -105,7 +106,7 @@ BOOL tpdu_read_header(wStream* s, BYTE* code, BYTE* li) void tpdu_write_header(wStream* s, UINT16 length, BYTE code) { Stream_Write_UINT8(s, length); /* LI */ - Stream_Write_UINT8(s, code); /* code */ + Stream_Write_UINT8(s, code); /* code */ if (code == X224_TPDU_DATA) { @@ -115,7 +116,7 @@ void tpdu_write_header(wStream* s, UINT16 length, BYTE code) { Stream_Write_UINT16(s, 0); /* DST-REF */ Stream_Write_UINT16(s, 0); /* SRC-REF */ - Stream_Write_UINT8(s, 0); /* Class 0 */ + Stream_Write_UINT8(s, 0); /* Class 0 */ } } @@ -134,7 +135,7 @@ BOOL tpdu_read_connection_request(wStream* s, BYTE* li) if (code != X224_TPDU_CONNECTION_REQUEST) { - WLog_ERR(TAG, "Error: expected X224_TPDU_CONNECTION_REQUEST"); + WLog_ERR(TAG, "Error: expected X224_TPDU_CONNECTION_REQUEST"); return FALSE; } @@ -172,7 +173,7 @@ BOOL tpdu_read_connection_confirm(wStream* s, BYTE* li) if (code != X224_TPDU_CONNECTION_CONFIRM) { - WLog_ERR(TAG, "Error: expected X224_TPDU_CONNECTION_CONFIRM"); + WLog_ERR(TAG, "Error: expected X224_TPDU_CONNECTION_CONFIRM"); return FALSE; } /* @@ -184,7 +185,7 @@ BOOL tpdu_read_connection_confirm(wStream* s, BYTE* li) */ bytes_read = (Stream_GetPosition(s) - position) - 1; - return (Stream_GetRemainingLength(s) >= (size_t) (*li - bytes_read)); + return (Stream_GetRemainingLength(s) >= (size_t)(*li - bytes_read)); } /** diff --git a/libfreerdp/core/tpdu.h b/libfreerdp/core/tpdu.h index fc28c3bf2..ee6e61ec8 100644 --- a/libfreerdp/core/tpdu.h +++ b/libfreerdp/core/tpdu.h @@ -32,15 +32,15 @@ enum X224_TPDU_TYPE X224_TPDU_ERROR = 0x70 }; -#define TPDU_DATA_HEADER_LENGTH 3 -#define TPDU_CONNECTION_REQUEST_HEADER_LENGTH 7 -#define TPDU_CONNECTION_CONFIRM_HEADER_LENGTH 7 -#define TPDU_DISCONNECT_REQUEST_HEADER_LENGTH 7 +#define TPDU_DATA_HEADER_LENGTH 3 +#define TPDU_CONNECTION_REQUEST_HEADER_LENGTH 7 +#define TPDU_CONNECTION_CONFIRM_HEADER_LENGTH 7 +#define TPDU_DISCONNECT_REQUEST_HEADER_LENGTH 7 -#define TPDU_DATA_LENGTH (TPKT_HEADER_LENGTH + TPDU_DATA_HEADER_LENGTH) -#define TPDU_CONNECTION_REQUEST_LENGTH (TPKT_HEADER_LENGTH + TPDU_CONNECTION_REQUEST_HEADER_LENGTH) -#define TPDU_CONNECTION_CONFIRM_LENGTH (TPKT_HEADER_LENGTH + TPDU_CONNECTION_CONFIRM_HEADER_LENGTH) -#define TPDU_DISCONNECT_REQUEST_LENGTH (TPKT_HEADER_LENGTH + TPDU_DISCONNECT_REQUEST_HEADER_LENGTH) +#define TPDU_DATA_LENGTH (TPKT_HEADER_LENGTH + TPDU_DATA_HEADER_LENGTH) +#define TPDU_CONNECTION_REQUEST_LENGTH (TPKT_HEADER_LENGTH + TPDU_CONNECTION_REQUEST_HEADER_LENGTH) +#define TPDU_CONNECTION_CONFIRM_LENGTH (TPKT_HEADER_LENGTH + TPDU_CONNECTION_CONFIRM_HEADER_LENGTH) +#define TPDU_DISCONNECT_REQUEST_LENGTH (TPKT_HEADER_LENGTH + TPDU_DISCONNECT_REQUEST_HEADER_LENGTH) FREERDP_LOCAL BOOL tpdu_read_header(wStream* s, BYTE* code, BYTE* li); FREERDP_LOCAL void tpdu_write_header(wStream* s, UINT16 length, BYTE code); diff --git a/libfreerdp/core/tpkt.c b/libfreerdp/core/tpkt.c index eed79d731..0470ce700 100644 --- a/libfreerdp/core/tpkt.c +++ b/libfreerdp/core/tpkt.c @@ -121,7 +121,7 @@ BOOL tpkt_read_header(wStream* s, UINT16* length) void tpkt_write_header(wStream* s, UINT16 length) { - Stream_Write_UINT8(s, 3); /* version */ - Stream_Write_UINT8(s, 0); /* reserved */ + Stream_Write_UINT8(s, 3); /* version */ + Stream_Write_UINT8(s, 0); /* reserved */ Stream_Write_UINT16_BE(s, length); /* length */ } diff --git a/libfreerdp/core/tpkt.h b/libfreerdp/core/tpkt.h index cb264d4a3..a2b13b7af 100644 --- a/libfreerdp/core/tpkt.h +++ b/libfreerdp/core/tpkt.h @@ -26,7 +26,7 @@ #include #include -#define TPKT_HEADER_LENGTH 4 +#define TPKT_HEADER_LENGTH 4 FREERDP_LOCAL BOOL tpkt_verify_header(wStream* s); FREERDP_LOCAL BOOL tpkt_read_header(wStream* s, UINT16* length); diff --git a/libfreerdp/core/transport.c b/libfreerdp/core/transport.c index 2be5b59ec..239045c1c 100644 --- a/libfreerdp/core/transport.c +++ b/libfreerdp/core/transport.c @@ -63,7 +63,7 @@ #include #include static UINT32 transport_krb5_check_account(rdpTransport* transport, char* username, char* domain, - char* passwd) + char* passwd) { krb5_error_code ret; krb5_context context = NULL; @@ -77,13 +77,14 @@ static UINT32 transport_krb5_check_account(rdpTransport* transport, char* userna if ((ret = krb5_init_context(&context)) != 0) WLog_Print(transport->log, WLOG_ERROR, "krb5_init_context failed with error %d", (int)ret); else if ((ret = krb5_parse_name_flags(context, address, 0, &principal)) != 0) - WLog_Print(transport->log, WLOG_ERROR, "krb5_parse_name_flags failed with error %d", (int)ret); + WLog_Print(transport->log, WLOG_ERROR, "krb5_parse_name_flags failed with error %d", + (int)ret); /* Find a credential cache with a specified client principal */ else if ((ret = krb5_cc_cache_match(context, principal, &ccache)) != 0) { if ((ret = krb5_cc_default(context, &ccache)) != 0) - WLog_Print(transport->log, WLOG_ERROR, "krb5 failed to resolve credentials cache with error %d", - (int)ret); + WLog_Print(transport->log, WLOG_ERROR, + "krb5 failed to resolve credentials cache with error %d", (int)ret); } if (ret != KRB5KDC_ERR_NONE) @@ -97,7 +98,8 @@ static UINT32 transport_krb5_check_account(rdpTransport* transport, char* userna /* Set a password for acquiring initial credentials */ else if ((ret = krb5_init_creds_set_password(context, ctx, passwd)) != 0) { - WLog_Print(transport->log, WLOG_WARN, "krb5_init_creds_set_password returned error %d", ret); + WLog_Print(transport->log, WLOG_WARN, "krb5_init_creds_set_password returned error %d", + ret); goto out; } @@ -155,52 +157,53 @@ static void transport_ssl_cb(SSL* ssl, int where, int ret) { if (where & SSL_CB_ALERT) { - rdpTransport* transport = (rdpTransport*) SSL_get_app_data(ssl); + rdpTransport* transport = (rdpTransport*)SSL_get_app_data(ssl); switch (ret) { case (SSL3_AL_FATAL << 8) | SSL_AD_ACCESS_DENIED: + { + if (!freerdp_get_last_error(transport->context)) { - if (!freerdp_get_last_error(transport->context)) - { - WLog_Print(transport->log, WLOG_ERROR, "%s: ACCESS DENIED", __FUNCTION__); - freerdp_set_last_error(transport->context, FREERDP_ERROR_AUTHENTICATION_FAILED); - } + WLog_Print(transport->log, WLOG_ERROR, "%s: ACCESS DENIED", __FUNCTION__); + freerdp_set_last_error(transport->context, FREERDP_ERROR_AUTHENTICATION_FAILED); } - break; + } + break; case (SSL3_AL_FATAL << 8) | SSL_AD_INTERNAL_ERROR: + { + if (transport->NlaMode) { - if (transport->NlaMode) - { - UINT32 kret = 0; + UINT32 kret = 0; #ifdef WITH_GSSAPI - if ((strlen(transport->settings->Domain) != 0) && - (strncmp(transport->settings->Domain, ".", 1) != 0)) - { - kret = transport_krb5_check_account(transport, transport->settings->Username, - transport->settings->Domain, - transport->settings->Password); - } - else -#endif /* WITH_GSSAPI */ - kret = FREERDP_ERROR_CONNECT_PASSWORD_CERTAINLY_EXPIRED; - - if (!freerdp_get_last_error(transport->context)) - freerdp_set_last_error(transport->context, kret); + if ((strlen(transport->settings->Domain) != 0) && + (strncmp(transport->settings->Domain, ".", 1) != 0)) + { + kret = transport_krb5_check_account( + transport, transport->settings->Username, transport->settings->Domain, + transport->settings->Password); } + else +#endif /* WITH_GSSAPI */ + kret = FREERDP_ERROR_CONNECT_PASSWORD_CERTAINLY_EXPIRED; - break; + if (!freerdp_get_last_error(transport->context)) + freerdp_set_last_error(transport->context, kret); + } + + break; case (SSL3_AL_WARNING << 8) | SSL3_AD_CLOSE_NOTIFY: break; default: - WLog_Print(transport->log, WLOG_WARN, "Unhandled SSL error (where=%d, ret=%d [%s, %s])", where, ret, + WLog_Print(transport->log, WLOG_WARN, + "Unhandled SSL error (where=%d, ret=%d [%s, %s])", where, ret, SSL_alert_type_string_long(ret), SSL_alert_desc_string_long(ret)); break; - } + } } } } @@ -299,8 +302,7 @@ BOOL transport_connect_tls(rdpTransport* transport) } transport->frontBio = tls->bio; - BIO_callback_ctrl(tls->bio, BIO_CTRL_SET_CALLBACK, - (bio_info_cb*)(void*) transport_ssl_cb); + BIO_callback_ctrl(tls->bio, BIO_CTRL_SET_CALLBACK, (bio_info_cb*)(void*)transport_ssl_cb); SSL_set_app_data(tls->ssl, transport); if (!transport->frontBio) @@ -335,7 +337,7 @@ BOOL transport_connect_nla(rdpTransport* transport) if (settings->AuthenticationServiceClass) { if (!nla_set_service_principal(rdp->nla, nla_make_spn(settings->AuthenticationServiceClass, - settings->ServerHostname))) + settings->ServerHostname))) return FALSE; } @@ -354,8 +356,7 @@ BOOL transport_connect_nla(rdpTransport* transport) return TRUE; } -BOOL transport_connect(rdpTransport* transport, const char* hostname, - UINT16 port, int timeout) +BOOL transport_connect(rdpTransport* transport, const char* hostname, UINT16 port, int timeout) { int sockfd; BOOL status = FALSE; @@ -415,9 +416,9 @@ BOOL transport_connect(rdpTransport* transport, const char* hostname, else { UINT16 peerPort; - const char* proxyHostname, *proxyUsername, *proxyPassword; - BOOL isProxyConnection = proxy_prepare(settings, &proxyHostname, &peerPort, - &proxyUsername, &proxyPassword); + const char *proxyHostname, *proxyUsername, *proxyPassword; + BOOL isProxyConnection = + proxy_prepare(settings, &proxyHostname, &peerPort, &proxyUsername, &proxyPassword); if (isProxyConnection) sockfd = freerdp_tcp_connect(context, settings, proxyHostname, peerPort, timeout); @@ -432,7 +433,8 @@ BOOL transport_connect(rdpTransport* transport, const char* hostname, if (isProxyConnection) { - if (!proxy_connect(settings, transport->frontBio, proxyUsername, proxyPassword, hostname, port)) + if (!proxy_connect(settings, transport->frontBio, proxyUsername, proxyPassword, + hostname, port)) return FALSE; } @@ -467,7 +469,7 @@ BOOL transport_accept_tls(rdpTransport* transport) BOOL transport_accept_nla(rdpTransport* transport) { rdpSettings* settings = transport->settings; - freerdp* instance = (freerdp*) settings->instance; + freerdp* instance = (freerdp*)settings->instance; if (!transport->tls) transport->tls = tls_new(transport->settings); @@ -510,8 +512,8 @@ BOOL transport_accept_nla(rdpTransport* transport) #define WLog_ERR_BIO(transport, biofunc, bio) \ transport_bio_error_log(transport, biofunc, bio, __FILE__, __FUNCTION__, __LINE__) -static void transport_bio_error_log(rdpTransport* transport, LPCSTR biofunc, BIO* bio, - LPCSTR file, LPCSTR func, DWORD line) +static void transport_bio_error_log(rdpTransport* transport, LPCSTR biofunc, BIO* bio, LPCSTR file, + LPCSTR func, DWORD line) { unsigned long sslerr; char* buf; @@ -540,8 +542,8 @@ static void transport_bio_error_log(rdpTransport* transport, LPCSTR biofunc, BIO while ((sslerr = ERR_get_error())) { ERR_error_string_n(sslerr, buf, 120); - WLog_PrintMessage(transport->log, WLOG_MESSAGE_TEXT, level, line, file, func, fmt, biofunc, - buf); + WLog_PrintMessage(transport->log, WLOG_MESSAGE_TEXT, level, line, file, func, fmt, + biofunc, buf); } free(buf); @@ -551,7 +553,7 @@ static void transport_bio_error_log(rdpTransport* transport, LPCSTR biofunc, BIO SSIZE_T transport_read_layer(rdpTransport* transport, BYTE* data, size_t bytes) { SSIZE_T read = 0; - rdpRdp *rdp = transport->context->rdp; + rdpRdp* rdp = transport->context->rdp; if (!transport->frontBio || (bytes > SSIZE_MAX)) { @@ -585,7 +587,8 @@ SSIZE_T transport_read_layer(rdpTransport* transport, BYTE* data, size_t bytes) if (!transport->blocking) return read; - /* blocking means that we can't continue until we have read the number of requested bytes */ + /* blocking means that we can't continue until we have read the number of requested + * bytes */ if (BIO_wait_read(transport->frontBio, 100) < 0) { WLog_ERR_BIO(transport, "BIO_wait_read", transport->frontBio); @@ -605,13 +608,12 @@ SSIZE_T transport_read_layer(rdpTransport* transport, BYTE* data, size_t bytes) return read; } - /** * @brief Tries to read toRead bytes from the specified transport * * Try to read toRead bytes from the transport to the stream. - * In case it was not possible to read toRead bytes 0 is returned. The stream is always advanced by the - * number of bytes read. + * In case it was not possible to read toRead bytes 0 is returned. The stream is always advanced by + * the number of bytes read. * * The function assumes that the stream has enough capacity to hold the data. * @@ -620,8 +622,7 @@ SSIZE_T transport_read_layer(rdpTransport* transport, BYTE* data, size_t bytes) * @param[in] toRead number of bytes to read * @return < 0 on error; 0 if not enough data is available (non blocking mode); 1 toRead bytes read */ -static SSIZE_T transport_read_layer_bytes(rdpTransport* transport, wStream* s, - size_t toRead) +static SSIZE_T transport_read_layer_bytes(rdpTransport* transport, wStream* s, size_t toRead) { SSIZE_T status; if (toRead > SSIZE_MAX) @@ -669,8 +670,7 @@ int transport_read_pdu(rdpTransport* transport, wStream* s) return -1; /* Make sure at least two bytes are read for further processing */ - if (position < 2 - && (status = transport_read_layer_bytes(transport, s, 2 - position)) != 1) + if (position < 2 && (status = transport_read_layer_bytes(transport, s, 2 - position)) != 1) { /* No data available at the moment */ return status; @@ -696,8 +696,8 @@ int transport_read_pdu(rdpTransport* transport, wStream* s) if ((header[1] & ~(0x80)) == 1) { /* check for header bytes already was readed in previous calls */ - if (position < 3 - && (status = transport_read_layer_bytes(transport, s, 3 - position)) != 1) + if (position < 3 && + (status = transport_read_layer_bytes(transport, s, 3 - position)) != 1) return status; pduLength = header[2]; @@ -706,8 +706,8 @@ int transport_read_pdu(rdpTransport* transport, wStream* s) else if ((header[1] & ~(0x80)) == 2) { /* check for header bytes already was readed in previous calls */ - if (position < 4 - && (status = transport_read_layer_bytes(transport, s, 4 - position)) != 1) + if (position < 4 && + (status = transport_read_layer_bytes(transport, s, 4 - position)) != 1) return status; pduLength = (header[2] << 8) | header[3]; @@ -732,8 +732,8 @@ int transport_read_pdu(rdpTransport* transport, wStream* s) { /* TPKT header */ /* check for header bytes already was readed in previous calls */ - if (position < 4 - && (status = transport_read_layer_bytes(transport, s, 4 - position)) != 1) + if (position < 4 && + (status = transport_read_layer_bytes(transport, s, 4 - position)) != 1) return status; pduLength = (header[2] << 8) | header[3]; @@ -741,7 +741,8 @@ int transport_read_pdu(rdpTransport* transport, wStream* s) /* min and max values according to ITU-T Rec. T.123 (01/2007) section 8 */ if (pduLength < 7 || pduLength > 0xFFFF) { - WLog_Print(transport->log, WLOG_ERROR, "tpkt - invalid pduLength: %"PRIdz, pduLength); + WLog_Print(transport->log, WLOG_ERROR, "tpkt - invalid pduLength: %" PRIdz, + pduLength); return -1; } } @@ -751,8 +752,8 @@ int transport_read_pdu(rdpTransport* transport, wStream* s) if (header[1] & 0x80) { /* check for header bytes already was readed in previous calls */ - if (position < 3 - && (status = transport_read_layer_bytes(transport, s, 3 - position)) != 1) + if (position < 3 && + (status = transport_read_layer_bytes(transport, s, 3 - position)) != 1) return status; pduLength = ((header[1] & 0x7F) << 8) | header[2]; @@ -767,7 +768,8 @@ int transport_read_pdu(rdpTransport* transport, wStream* s) */ if (pduLength < 3 || pduLength > 0x8000) { - WLog_Print(transport->log, WLOG_ERROR, "fast path - invalid pduLength: %"PRIdz, pduLength); + WLog_Print(transport->log, WLOG_ERROR, "fast path - invalid pduLength: %" PRIdz, + pduLength); return -1; } } @@ -782,8 +784,7 @@ int transport_read_pdu(rdpTransport* transport, wStream* s) return status; if (Stream_GetPosition(s) >= pduLength) - WLog_Packet(transport->log, WLOG_TRACE, Stream_Buffer(s), pduLength, - WLOG_PACKET_INBOUND); + WLog_Packet(transport->log, WLOG_TRACE, Stream_Buffer(s), pduLength, WLOG_PACKET_INBOUND); Stream_SealLength(s); Stream_SetPosition(s, 0); @@ -795,7 +796,7 @@ int transport_write(rdpTransport* transport, wStream* s) size_t length; int status = -1; int writtenlength = 0; - rdpRdp *rdp = transport->context->rdp; + rdpRdp* rdp = transport->context->rdp; if (!s) return -1; @@ -817,8 +818,7 @@ int transport_write(rdpTransport* transport, wStream* s) if (length > 0) { rdp->outBytes += length; - WLog_Packet(transport->log, WLOG_TRACE, Stream_Buffer(s), length, - WLOG_PACKET_OUTBOUND); + WLog_Packet(transport->log, WLOG_TRACE, Stream_Buffer(s), length, WLOG_PACKET_OUTBOUND); } while (length > 0) @@ -893,8 +893,7 @@ fail: return status; } -DWORD transport_get_event_handles(rdpTransport* transport, HANDLE* events, - DWORD count) +DWORD transport_get_event_handles(rdpTransport* transport, HANDLE* events, DWORD count) { DWORD nCount = 1; /* always the reread Event */ DWORD tmp; @@ -903,7 +902,8 @@ DWORD transport_get_event_handles(rdpTransport* transport, HANDLE* events, { if (count < 1) { - WLog_Print(transport->log, WLOG_ERROR, "%s: provided handles array is too small", __FUNCTION__); + WLog_Print(transport->log, WLOG_ERROR, "%s: provided handles array is too small", + __FUNCTION__); return 0; } @@ -919,14 +919,16 @@ DWORD transport_get_event_handles(rdpTransport* transport, HANDLE* events, if (nCount > count) { WLog_Print(transport->log, WLOG_ERROR, - "%s: provided handles array is too small (count=%"PRIu32" nCount=%"PRIu32")", + "%s: provided handles array is too small (count=%" PRIu32 + " nCount=%" PRIu32 ")", __FUNCTION__, count, nCount); return 0; } if (BIO_get_event(transport->frontBio, &events[1]) != 1) { - WLog_Print(transport->log, WLOG_ERROR, "%s: error getting the frontBio handle", __FUNCTION__); + WLog_Print(transport->log, WLOG_ERROR, "%s: error getting the frontBio handle", + __FUNCTION__); return 0; } } @@ -1030,7 +1032,8 @@ int transport_check_fds(rdpTransport* transport) if ((status = transport_read_pdu(transport, transport->ReceiveBuffer)) <= 0) { if (status < 0) - WLog_Print(transport->log, WLOG_DEBUG, "transport_check_fds: transport_read_pdu() - %i", status); + WLog_Print(transport->log, WLOG_DEBUG, + "transport_check_fds: transport_read_pdu() - %i", status); return status; } @@ -1057,8 +1060,8 @@ int transport_check_fds(rdpTransport* transport) if (recv_status < 0) { - WLog_Print(transport->log, WLOG_ERROR, "transport_check_fds: transport->ReceiveCallback() - %i", - recv_status); + WLog_Print(transport->log, WLOG_ERROR, + "transport_check_fds: transport->ReceiveCallback() - %i", recv_status); return -1; } @@ -1132,7 +1135,7 @@ BOOL transport_disconnect(rdpTransport* transport) rdpTransport* transport_new(rdpContext* context) { rdpTransport* transport; - transport = (rdpTransport*) calloc(1, sizeof(rdpTransport)); + transport = (rdpTransport*)calloc(1, sizeof(rdpTransport)); if (!transport) return NULL; @@ -1157,8 +1160,7 @@ rdpTransport* transport_new(rdpContext* context) transport->connectedEvent = CreateEvent(NULL, TRUE, FALSE, NULL); - if (!transport->connectedEvent - || transport->connectedEvent == INVALID_HANDLE_VALUE) + if (!transport->connectedEvent || transport->connectedEvent == INVALID_HANDLE_VALUE) goto out_free_receivebuffer; transport->rereadEvent = CreateEvent(NULL, TRUE, FALSE, NULL); diff --git a/libfreerdp/core/transport.h b/libfreerdp/core/transport.h index 9084e1b6e..c6509fe57 100644 --- a/libfreerdp/core/transport.h +++ b/libfreerdp/core/transport.h @@ -51,9 +51,7 @@ typedef struct rdp_transport rdpTransport; #include #include - -typedef int (*TransportRecv)(rdpTransport* transport, wStream* stream, - void* extra); +typedef int (*TransportRecv)(rdpTransport* transport, wStream* stream, void* extra); struct rdp_transport { @@ -81,10 +79,9 @@ struct rdp_transport wLog* log; }; -FREERDP_LOCAL wStream* transport_send_stream_init(rdpTransport* transport, - int size); -FREERDP_LOCAL BOOL transport_connect(rdpTransport* transport, - const char* hostname, UINT16 port, int timeout); +FREERDP_LOCAL wStream* transport_send_stream_init(rdpTransport* transport, int size); +FREERDP_LOCAL BOOL transport_connect(rdpTransport* transport, const char* hostname, UINT16 port, + int timeout); FREERDP_LOCAL BOOL transport_attach(rdpTransport* transport, int sockfd); FREERDP_LOCAL BOOL transport_disconnect(rdpTransport* transport); FREERDP_LOCAL BOOL transport_connect_rdp(rdpTransport* transport); @@ -97,25 +94,20 @@ FREERDP_LOCAL BOOL transport_accept_nla(rdpTransport* transport); FREERDP_LOCAL int transport_read_pdu(rdpTransport* transport, wStream* s); FREERDP_LOCAL int transport_write(rdpTransport* transport, wStream* s); -FREERDP_LOCAL void transport_get_fds(rdpTransport* transport, void** rfds, - int* rcount); +FREERDP_LOCAL void transport_get_fds(rdpTransport* transport, void** rfds, int* rcount); FREERDP_LOCAL int transport_check_fds(rdpTransport* transport); -FREERDP_LOCAL DWORD transport_get_event_handles(rdpTransport* transport, - HANDLE* events, DWORD nCount); +FREERDP_LOCAL DWORD transport_get_event_handles(rdpTransport* transport, HANDLE* events, + DWORD nCount); -FREERDP_LOCAL BOOL transport_set_blocking_mode(rdpTransport* transport, - BOOL blocking); -FREERDP_LOCAL void transport_set_gateway_enabled(rdpTransport* transport, - BOOL GatewayEnabled); -FREERDP_LOCAL void transport_set_nla_mode(rdpTransport* transport, - BOOL NlaMode); +FREERDP_LOCAL BOOL transport_set_blocking_mode(rdpTransport* transport, BOOL blocking); +FREERDP_LOCAL void transport_set_gateway_enabled(rdpTransport* transport, BOOL GatewayEnabled); +FREERDP_LOCAL void transport_set_nla_mode(rdpTransport* transport, BOOL NlaMode); FREERDP_LOCAL BOOL transport_is_write_blocked(rdpTransport* transport); FREERDP_LOCAL int transport_drain_output_buffer(rdpTransport* transport); FREERDP_LOCAL wStream* transport_receive_pool_take(rdpTransport* transport); -FREERDP_LOCAL int transport_receive_pool_return(rdpTransport* transport, - wStream* pdu); +FREERDP_LOCAL int transport_receive_pool_return(rdpTransport* transport, wStream* pdu); FREERDP_LOCAL rdpTransport* transport_new(rdpContext* context); FREERDP_LOCAL void transport_free(rdpTransport* transport); diff --git a/libfreerdp/core/update.c b/libfreerdp/core/update.c index a21fcfeb4..44571e87c 100644 --- a/libfreerdp/core/update.c +++ b/libfreerdp/core/update.c @@ -45,13 +45,7 @@ #define TAG FREERDP_TAG("core.update") -static const char* const UPDATE_TYPE_STRINGS[] = -{ - "Orders", - "Bitmap", - "Palette", - "Synchronize" -}; +static const char* const UPDATE_TYPE_STRINGS[] = { "Orders", "Bitmap", "Palette", "Synchronize" }; static const char* update_type_to_string(UINT16 updateType) { @@ -71,9 +65,9 @@ static BOOL update_recv_orders(rdpUpdate* update, wStream* s) return FALSE; } - Stream_Seek_UINT16(s); /* pad2OctetsA (2 bytes) */ + Stream_Seek_UINT16(s); /* pad2OctetsA (2 bytes) */ Stream_Read_UINT16(s, numberOrders); /* numberOrders (2 bytes) */ - Stream_Seek_UINT16(s); /* pad2OctetsB (2 bytes) */ + Stream_Seek_UINT16(s); /* pad2OctetsB (2 bytes) */ while (numberOrders > 0) { @@ -89,8 +83,7 @@ static BOOL update_recv_orders(rdpUpdate* update, wStream* s) return TRUE; } -static BOOL update_read_bitmap_data(rdpUpdate* update, wStream* s, - BITMAP_DATA* bitmapData) +static BOOL update_read_bitmap_data(rdpUpdate* update, wStream* s, BITMAP_DATA* bitmapData) { WINPR_UNUSED(update); if (Stream_GetRemainingLength(s) < 18) @@ -114,7 +107,7 @@ static BOOL update_read_bitmap_data(rdpUpdate* update, wStream* s, bitmapData->cbCompFirstRowSize); /* cbCompFirstRowSize (2 bytes) */ Stream_Read_UINT16(s, bitmapData->cbCompMainBodySize); /* cbCompMainBodySize (2 bytes) */ - Stream_Read_UINT16(s, bitmapData->cbScanWidth); /* cbScanWidth (2 bytes) */ + Stream_Read_UINT16(s, bitmapData->cbScanWidth); /* cbScanWidth (2 bytes) */ Stream_Read_UINT16(s, bitmapData->cbUncompressedSize); /* cbUncompressedSize (2 bytes) */ bitmapData->bitmapLength = bitmapData->cbCompMainBodySize; @@ -142,8 +135,7 @@ static BOOL update_read_bitmap_data(rdpUpdate* update, wStream* s, return TRUE; } -static BOOL update_write_bitmap_data(rdpUpdate* update, wStream* s, - BITMAP_DATA* bitmapData) +static BOOL update_write_bitmap_data(rdpUpdate* update, wStream* s, BITMAP_DATA* bitmapData) { if (!Stream_EnsureRemainingCapacity(s, 64 + bitmapData->bitmapLength)) return FALSE; @@ -177,10 +169,13 @@ static BOOL update_write_bitmap_data(rdpUpdate* update, wStream* s, { if (!(bitmapData->flags & NO_BITMAP_COMPRESSION_HDR)) { - Stream_Write_UINT16(s, bitmapData->cbCompFirstRowSize); /* cbCompFirstRowSize (2 bytes) */ - Stream_Write_UINT16(s, bitmapData->cbCompMainBodySize); /* cbCompMainBodySize (2 bytes) */ - Stream_Write_UINT16(s, bitmapData->cbScanWidth); /* cbScanWidth (2 bytes) */ - Stream_Write_UINT16(s, bitmapData->cbUncompressedSize); /* cbUncompressedSize (2 bytes) */ + Stream_Write_UINT16(s, + bitmapData->cbCompFirstRowSize); /* cbCompFirstRowSize (2 bytes) */ + Stream_Write_UINT16(s, + bitmapData->cbCompMainBodySize); /* cbCompMainBodySize (2 bytes) */ + Stream_Write_UINT16(s, bitmapData->cbScanWidth); /* cbScanWidth (2 bytes) */ + Stream_Write_UINT16(s, + bitmapData->cbUncompressedSize); /* cbUncompressedSize (2 bytes) */ } Stream_Write(s, bitmapData->bitmapDataStream, bitmapData->bitmapLength); @@ -205,13 +200,13 @@ BITMAP_UPDATE* update_read_bitmap_update(rdpUpdate* update, wStream* s) goto fail; Stream_Read_UINT16(s, bitmapUpdate->number); /* numberRectangles (2 bytes) */ - WLog_Print(update->log, WLOG_TRACE, "BitmapUpdate: %"PRIu32"", bitmapUpdate->number); + WLog_Print(update->log, WLOG_TRACE, "BitmapUpdate: %" PRIu32 "", bitmapUpdate->number); if (bitmapUpdate->number > bitmapUpdate->count) { UINT32 count = bitmapUpdate->number * 2; - BITMAP_DATA* newdata = (BITMAP_DATA*) realloc(bitmapUpdate->rectangles, - sizeof(BITMAP_DATA) * count); + BITMAP_DATA* newdata = + (BITMAP_DATA*)realloc(bitmapUpdate->rectangles, sizeof(BITMAP_DATA) * count); if (!newdata) goto fail; @@ -243,11 +238,11 @@ static BOOL update_write_bitmap_update(rdpUpdate* update, wStream* s, if (!Stream_EnsureRemainingCapacity(s, 32)) return FALSE; - Stream_Write_UINT16(s, UPDATE_TYPE_BITMAP); /* updateType */ + Stream_Write_UINT16(s, UPDATE_TYPE_BITMAP); /* updateType */ Stream_Write_UINT16(s, bitmapUpdate->number); /* numberRectangles (2 bytes) */ /* rectangles */ - for (i = 0; i < (int) bitmapUpdate->number; i++) + for (i = 0; i < (int)bitmapUpdate->number; i++) { if (!update_write_bitmap_data(update, s, &bitmapUpdate->rectangles[i])) return FALSE; @@ -268,9 +263,8 @@ PALETTE_UPDATE* update_read_palette(rdpUpdate* update, wStream* s) if (Stream_GetRemainingLength(s) < 6) goto fail; - Stream_Seek_UINT16(s); /* pad2Octets (2 bytes) */ - Stream_Read_UINT32(s, - palette_update->number); /* numberColors (4 bytes), must be set to 256 */ + Stream_Seek_UINT16(s); /* pad2Octets (2 bytes) */ + Stream_Read_UINT32(s, palette_update->number); /* numberColors (4 bytes), must be set to 256 */ if (palette_update->number > 256) palette_update->number = 256; @@ -279,7 +273,7 @@ PALETTE_UPDATE* update_read_palette(rdpUpdate* update, wStream* s) goto fail; /* paletteEntries */ - for (i = 0; i < (int) palette_update->number; i++) + for (i = 0; i < (int)palette_update->number; i++) { entry = &palette_update->entries[i]; Stream_Read_UINT8(s, entry->red); @@ -297,10 +291,10 @@ static void update_read_synchronize(rdpUpdate* update, wStream* s) { WINPR_UNUSED(update); Stream_Seek_UINT16(s); /* pad2Octets (2 bytes) */ - /** - * The Synchronize Update is an artifact from the - * T.128 protocol and should be ignored. - */ + /** + * The Synchronize Update is an artifact from the + * T.128 protocol and should be ignored. + */ } static BOOL update_read_play_sound(wStream* s, PLAY_SOUND_UPDATE* play_sound) @@ -308,7 +302,7 @@ static BOOL update_read_play_sound(wStream* s, PLAY_SOUND_UPDATE* play_sound) if (Stream_GetRemainingLength(s) < 8) return FALSE; - Stream_Read_UINT32(s, play_sound->duration); /* duration (4 bytes) */ + Stream_Read_UINT32(s, play_sound->duration); /* duration (4 bytes) */ Stream_Read_UINT32(s, play_sound->frequency); /* frequency (4 bytes) */ return TRUE; } @@ -370,8 +364,8 @@ static BOOL _update_read_pointer_color(wStream* s, POINTER_COLOR_UPDATE* pointer goto fail; Stream_Read_UINT16(s, pointer_color->cacheIndex); /* cacheIndex (2 bytes) */ - Stream_Read_UINT16(s, pointer_color->xPos); /* xPos (2 bytes) */ - Stream_Read_UINT16(s, pointer_color->yPos); /* yPos (2 bytes) */ + Stream_Read_UINT16(s, pointer_color->xPos); /* xPos (2 bytes) */ + Stream_Read_UINT16(s, pointer_color->yPos); /* yPos (2 bytes) */ /** * As stated in 2.2.9.1.1.4.4 Color Pointer Update: * The maximum allowed pointer width/height is 96 pixels if the client indicated support @@ -381,7 +375,7 @@ static BOOL _update_read_pointer_color(wStream* s, POINTER_COLOR_UPDATE* pointer * * So we check for a maximum of 96 for CVE-2014-0250. */ - Stream_Read_UINT16(s, pointer_color->width); /* width (2 bytes) */ + Stream_Read_UINT16(s, pointer_color->width); /* width (2 bytes) */ Stream_Read_UINT16(s, pointer_color->height); /* height (2 bytes) */ if ((pointer_color->width > 96) || (pointer_color->height > 96)) @@ -409,9 +403,9 @@ static BOOL _update_read_pointer_color(wStream* s, POINTER_COLOR_UPDATE* pointer * * xorMaskData (variable): A variable-length array of bytes. Contains the 24-bpp, bottom-up * XOR mask scan-line data. The XOR mask is padded to a 2-byte boundary for each encoded - * scan-line. For example, if a 3x3 pixel cursor is being sent, then each scan-line will consume 10 - * bytes (3 pixels per scan-line multiplied by 3 bytes per pixel, rounded up to the next even - * number of bytes). + * scan-line. For example, if a 3x3 pixel cursor is being sent, then each scan-line will + * consume 10 bytes (3 pixels per scan-line multiplied by 3 bytes per pixel, rounded up to + * the next even number of bytes). * * In fact instead of 24-bpp, the bpp parameter is given by the containing packet. */ @@ -424,9 +418,10 @@ static BOOL _update_read_pointer_color(wStream* s, POINTER_COLOR_UPDATE* pointer if (scanlineSize * pointer_color->height != pointer_color->lengthXorMask) { WLog_ERR(TAG, - "invalid lengthXorMask: width=%"PRIu32" height=%"PRIu32", %"PRIu32" instead of %"PRIu32"", - pointer_color->width, pointer_color->height, - pointer_color->lengthXorMask, scanlineSize * pointer_color->height); + "invalid lengthXorMask: width=%" PRIu32 " height=%" PRIu32 ", %" PRIu32 + " instead of %" PRIu32 "", + pointer_color->width, pointer_color->height, pointer_color->lengthXorMask, + scanlineSize * pointer_color->height); goto fail; } @@ -444,9 +439,9 @@ static BOOL _update_read_pointer_color(wStream* s, POINTER_COLOR_UPDATE* pointer /** * andMaskData (variable): A variable-length array of bytes. Contains the 1-bpp, bottom-up * AND mask scan-line data. The AND mask is padded to a 2-byte boundary for each encoded - * scan-line. For example, if a 7x7 pixel cursor is being sent, then each scan-line will consume 2 - * bytes (7 pixels per scan-line multiplied by 1 bpp, rounded up to the next even number of - * bytes). + * scan-line. For example, if a 7x7 pixel cursor is being sent, then each scan-line will + * consume 2 bytes (7 pixels per scan-line multiplied by 1 bpp, rounded up to the next even + * number of bytes). */ if (Stream_GetRemainingLength(s) < pointer_color->lengthAndMask) goto fail; @@ -456,7 +451,7 @@ static BOOL _update_read_pointer_color(wStream* s, POINTER_COLOR_UPDATE* pointer if (scanlineSize * pointer_color->height != pointer_color->lengthAndMask) { - WLog_ERR(TAG, "invalid lengthAndMask: %"PRIu32" instead of %"PRIu32"", + WLog_ERR(TAG, "invalid lengthAndMask: %" PRIu32 " instead of %" PRIu32 "", pointer_color->lengthAndMask, scanlineSize * pointer_color->height); goto fail; } @@ -508,7 +503,7 @@ POINTER_NEW_UPDATE* update_read_pointer_new(rdpUpdate* update, wStream* s) if ((pointer_new->xorBpp < 1) || (pointer_new->xorBpp > 32)) { - WLog_ERR(TAG, "invalid xorBpp %"PRIu32"", pointer_new->xorBpp); + WLog_ERR(TAG, "invalid xorBpp %" PRIu32 "", pointer_new->xorBpp); goto fail; } @@ -550,69 +545,69 @@ BOOL update_recv_pointer(rdpUpdate* update, wStream* s) return FALSE; Stream_Read_UINT16(s, messageType); /* messageType (2 bytes) */ - Stream_Seek_UINT16(s); /* pad2Octets (2 bytes) */ + Stream_Seek_UINT16(s); /* pad2Octets (2 bytes) */ switch (messageType) { case PTR_MSG_TYPE_POSITION: - { - POINTER_POSITION_UPDATE* pointer_position = update_read_pointer_position(update, s); + { + POINTER_POSITION_UPDATE* pointer_position = update_read_pointer_position(update, s); - if (pointer_position) - { - rc = IFCALLRESULT(FALSE, pointer->PointerPosition, context, pointer_position); - free_pointer_position_update(context, pointer_position); - } + if (pointer_position) + { + rc = IFCALLRESULT(FALSE, pointer->PointerPosition, context, pointer_position); + free_pointer_position_update(context, pointer_position); } - break; + } + break; case PTR_MSG_TYPE_SYSTEM: - { - POINTER_SYSTEM_UPDATE* pointer_system = update_read_pointer_system(update, s); + { + POINTER_SYSTEM_UPDATE* pointer_system = update_read_pointer_system(update, s); - if (pointer_system) - { - rc = IFCALLRESULT(FALSE, pointer->PointerSystem, context, pointer_system); - free_pointer_system_update(context, pointer_system); - } + if (pointer_system) + { + rc = IFCALLRESULT(FALSE, pointer->PointerSystem, context, pointer_system); + free_pointer_system_update(context, pointer_system); } - break; + } + break; case PTR_MSG_TYPE_COLOR: - { - POINTER_COLOR_UPDATE* pointer_color = update_read_pointer_color(update, s, 24); + { + POINTER_COLOR_UPDATE* pointer_color = update_read_pointer_color(update, s, 24); - if (pointer_color) - { - rc = IFCALLRESULT(FALSE, pointer->PointerColor, context, pointer_color); - free_pointer_color_update(context, pointer_color); - } + if (pointer_color) + { + rc = IFCALLRESULT(FALSE, pointer->PointerColor, context, pointer_color); + free_pointer_color_update(context, pointer_color); } - break; + } + break; case PTR_MSG_TYPE_POINTER: - { - POINTER_NEW_UPDATE* pointer_new = update_read_pointer_new(update, s); + { + POINTER_NEW_UPDATE* pointer_new = update_read_pointer_new(update, s); - if (pointer_new) - { - rc = IFCALLRESULT(FALSE, pointer->PointerNew, context, pointer_new); - free_pointer_new_update(context, pointer_new); - } + if (pointer_new) + { + rc = IFCALLRESULT(FALSE, pointer->PointerNew, context, pointer_new); + free_pointer_new_update(context, pointer_new); } - break; + } + break; case PTR_MSG_TYPE_CACHED: - { - POINTER_CACHED_UPDATE* pointer_cached = update_read_pointer_cached(update, s); + { + POINTER_CACHED_UPDATE* pointer_cached = update_read_pointer_cached(update, s); - if (pointer_cached) - { - rc = IFCALLRESULT(FALSE, pointer->PointerCached, context, pointer_cached); - free_pointer_cached_update(context, pointer_cached); - } + if (pointer_cached) + { + rc = IFCALLRESULT(FALSE, pointer->PointerCached, context, pointer_cached); + free_pointer_cached_update(context, pointer_cached); } - break; + } + break; default: break; @@ -646,34 +641,34 @@ BOOL update_recv(rdpUpdate* update, wStream* s) break; case UPDATE_TYPE_BITMAP: + { + BITMAP_UPDATE* bitmap_update = update_read_bitmap_update(update, s); + + if (!bitmap_update) { - BITMAP_UPDATE* bitmap_update = update_read_bitmap_update(update, s); - - if (!bitmap_update) - { - WLog_ERR(TAG, "UPDATE_TYPE_BITMAP - update_read_bitmap_update() failed"); - goto fail; - } - - rc = IFCALLRESULT(FALSE, update->BitmapUpdate, context, bitmap_update); - free_bitmap_update(update->context, bitmap_update); + WLog_ERR(TAG, "UPDATE_TYPE_BITMAP - update_read_bitmap_update() failed"); + goto fail; } - break; + + rc = IFCALLRESULT(FALSE, update->BitmapUpdate, context, bitmap_update); + free_bitmap_update(update->context, bitmap_update); + } + break; case UPDATE_TYPE_PALETTE: + { + PALETTE_UPDATE* palette_update = update_read_palette(update, s); + + if (!palette_update) { - PALETTE_UPDATE* palette_update = update_read_palette(update, s); - - if (!palette_update) - { - WLog_ERR(TAG, "UPDATE_TYPE_PALETTE - update_read_palette() failed"); - goto fail; - } - - rc = IFCALLRESULT(FALSE, update->Palette, context, palette_update); - free_palette_update(context, palette_update); + WLog_ERR(TAG, "UPDATE_TYPE_PALETTE - update_read_palette() failed"); + goto fail; } - break; + + rc = IFCALLRESULT(FALSE, update->Palette, context, palette_update); + free_palette_update(context, palette_update); + } + break; case UPDATE_TYPE_SYNCHRONIZE: update_read_synchronize(update, s); @@ -691,7 +686,8 @@ fail: if (!rc) { - WLog_ERR(TAG, "UPDATE_TYPE %s [%"PRIu16"] failed", update_type_to_string(updateType), updateType); + WLog_ERR(TAG, "UPDATE_TYPE %s [%" PRIu16 "] failed", update_type_to_string(updateType), + updateType); return FALSE; } @@ -750,8 +746,7 @@ BOOL update_post_connect(rdpUpdate* update) return FALSE; update->altsec->switch_surface.bitmapId = SCREEN_BITMAP_SURFACE; - IFCALL(update->altsec->SwitchSurface, update->context, - &(update->altsec->switch_surface)); + IFCALL(update->altsec->SwitchSurface, update->context, &(update->altsec->switch_surface)); update->initialState = FALSE; return TRUE; } @@ -808,7 +803,7 @@ static BOOL _update_end_paint(rdpContext* context) if (update->numberOrders > 0) { - WLog_DBG(TAG, "sending %"PRIu16" orders", update->numberOrders); + WLog_DBG(TAG, "sending %" PRIu16 " orders", update->numberOrders); fastpath_send_update_pdu(context->rdp->fastpath, FASTPATH_UPDATETYPE_ORDERS, s, FALSE); } @@ -856,8 +851,7 @@ static BOOL update_check_flush(rdpContext* context, int size) return FALSE; } -static BOOL update_set_bounds(rdpContext* context, - const rdpBounds* bounds) +static BOOL update_set_bounds(rdpContext* context, const rdpBounds* bounds) { rdpUpdate* update = context->update; CopyMemory(&update->previousBounds, &update->currentBounds, sizeof(rdpBounds)); @@ -872,8 +866,7 @@ static BOOL update_set_bounds(rdpContext* context, BOOL update_bounds_is_null(rdpBounds* bounds) { - if ((bounds->left == 0) && (bounds->top == 0) && - (bounds->right == 0) && (bounds->bottom == 0)) + if ((bounds->left == 0) && (bounds->top == 0) && (bounds->right == 0) && (bounds->bottom == 0)) return TRUE; return FALSE; @@ -940,8 +933,7 @@ int update_prepare_bounds(rdpContext* context, ORDER_INFO* orderInfo) return length; } -static int update_prepare_order_info(rdpContext* context, - ORDER_INFO* orderInfo, UINT32 orderType) +static int update_prepare_order_info(rdpContext* context, ORDER_INFO* orderInfo, UINT32 orderType) { int length = 1; orderInfo->fieldFlags = 0; @@ -954,8 +946,7 @@ static int update_prepare_order_info(rdpContext* context, return length; } -int update_write_order_info(rdpContext* context, wStream* s, - ORDER_INFO* orderInfo, size_t offset) +int update_write_order_info(rdpContext* context, wStream* s, ORDER_INFO* orderInfo, size_t offset) { size_t position; WINPR_UNUSED(context); @@ -973,24 +964,22 @@ int update_write_order_info(rdpContext* context, wStream* s, return 0; } -static void update_write_refresh_rect(wStream* s, BYTE count, - const RECTANGLE_16* areas) +static void update_write_refresh_rect(wStream* s, BYTE count, const RECTANGLE_16* areas) { int i; Stream_Write_UINT8(s, count); /* numberOfAreas (1 byte) */ - Stream_Seek(s, 3); /* pad3Octets (3 bytes) */ + Stream_Seek(s, 3); /* pad3Octets (3 bytes) */ for (i = 0; i < count; i++) { - Stream_Write_UINT16(s, areas[i].left); /* left (2 bytes) */ - Stream_Write_UINT16(s, areas[i].top); /* top (2 bytes) */ - Stream_Write_UINT16(s, areas[i].right); /* right (2 bytes) */ + Stream_Write_UINT16(s, areas[i].left); /* left (2 bytes) */ + Stream_Write_UINT16(s, areas[i].top); /* top (2 bytes) */ + Stream_Write_UINT16(s, areas[i].right); /* right (2 bytes) */ Stream_Write_UINT16(s, areas[i].bottom); /* bottom (2 bytes) */ } } -static BOOL update_send_refresh_rect(rdpContext* context, BYTE count, - const RECTANGLE_16* areas) +static BOOL update_send_refresh_rect(rdpContext* context, BYTE count, const RECTANGLE_16* areas) { rdpRdp* rdp = context->rdp; @@ -1016,15 +1005,14 @@ static void update_write_suppress_output(wStream* s, BYTE allow, const RECTANGLE if (allow > 0) { - Stream_Write_UINT16(s, area->left); /* left (2 bytes) */ - Stream_Write_UINT16(s, area->top); /* top (2 bytes) */ - Stream_Write_UINT16(s, area->right); /* right (2 bytes) */ + Stream_Write_UINT16(s, area->left); /* left (2 bytes) */ + Stream_Write_UINT16(s, area->top); /* top (2 bytes) */ + Stream_Write_UINT16(s, area->right); /* right (2 bytes) */ Stream_Write_UINT16(s, area->bottom); /* bottom (2 bytes) */ } } -static BOOL update_send_suppress_output(rdpContext* context, BYTE allow, - const RECTANGLE_16* area) +static BOOL update_send_suppress_output(rdpContext* context, BYTE allow, const RECTANGLE_16* area) { rdpRdp* rdp = context->rdp; @@ -1036,8 +1024,7 @@ static BOOL update_send_suppress_output(rdpContext* context, BYTE allow, return FALSE; update_write_suppress_output(s, allow, area); - return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_SUPPRESS_OUTPUT, - rdp->mcs->userId); + return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_SUPPRESS_OUTPUT, rdp->mcs->userId); } return TRUE; @@ -1060,8 +1047,7 @@ static BOOL update_send_surface_command(rdpContext* context, wStream* s) } Stream_Write(update, Stream_Buffer(s), Stream_GetPosition(s)); - ret = fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_SURFCMDS, - update, FALSE); + ret = fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_SURFCMDS, update, FALSE); out: Stream_Release(update); return ret; @@ -1094,7 +1080,7 @@ out_fail: } static BOOL update_send_surface_frame_marker(rdpContext* context, - const SURFACE_FRAME_MARKER* surfaceFrameMarker) + const SURFACE_FRAME_MARKER* surfaceFrameMarker) { wStream* s; rdpRdp* rdp = context->rdp; @@ -1107,8 +1093,7 @@ static BOOL update_send_surface_frame_marker(rdpContext* context, if (!update_write_surfcmd_frame_marker(s, surfaceFrameMarker->frameAction, surfaceFrameMarker->frameId) || - !fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_SURFCMDS, s, - FALSE)) + !fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_SURFCMDS, s, FALSE)) goto out_fail; update_force_flush(context); @@ -1118,9 +1103,8 @@ out_fail: return ret; } -static BOOL update_send_surface_frame_bits(rdpContext* context, - const SURFACE_BITS_COMMAND* cmd, - BOOL first, BOOL last, UINT32 frameId) +static BOOL update_send_surface_frame_bits(rdpContext* context, const SURFACE_BITS_COMMAND* cmd, + BOOL first, BOOL last, UINT32 frameId) { wStream* s; rdpRdp* rdp = context->rdp; @@ -1133,8 +1117,7 @@ static BOOL update_send_surface_frame_bits(rdpContext* context, if (first) { - if (!update_write_surfcmd_frame_marker(s, SURFACECMD_FRAMEACTION_BEGIN, - frameId)) + if (!update_write_surfcmd_frame_marker(s, SURFACECMD_FRAMEACTION_BEGIN, frameId)) goto out_fail; } @@ -1167,8 +1150,7 @@ static BOOL update_send_frame_acknowledge(rdpContext* context, UINT32 frameId) return FALSE; Stream_Write_UINT32(s, frameId); - return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_FRAME_ACKNOWLEDGE, - rdp->mcs->userId); + return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_FRAME_ACKNOWLEDGE, rdp->mcs->userId); } return TRUE; @@ -1185,8 +1167,7 @@ static BOOL update_send_synchronize(rdpContext* context) return FALSE; Stream_Zero(s, 2); /* pad2Octets (2 bytes) */ - ret = fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_SYNCHRONIZE, - s, FALSE); + ret = fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_SYNCHRONIZE, s, FALSE); Stream_Release(s); return ret; } @@ -1196,8 +1177,7 @@ static BOOL update_send_desktop_resize(rdpContext* context) return rdp_server_reactivate(context->rdp); } -static BOOL update_send_bitmap_update(rdpContext* context, - const BITMAP_UPDATE* bitmapUpdate) +static BOOL update_send_bitmap_update(rdpContext* context, const BITMAP_UPDATE* bitmapUpdate) { wStream* s; rdpRdp* rdp = context->rdp; @@ -1223,8 +1203,7 @@ out_fail: return ret; } -static BOOL update_send_play_sound(rdpContext* context, - const PLAY_SOUND_UPDATE* play_sound) +static BOOL update_send_play_sound(rdpContext* context, const PLAY_SOUND_UPDATE* play_sound) { wStream* s; rdpRdp* rdp = context->rdp; @@ -1248,8 +1227,7 @@ static BOOL update_send_play_sound(rdpContext* context, * Primary Drawing Orders */ -static BOOL update_send_dstblt(rdpContext* context, - const DSTBLT_ORDER* dstblt) +static BOOL update_send_dstblt(rdpContext* context, const DSTBLT_ORDER* dstblt) { wStream* s; UINT32 offset; @@ -1287,10 +1265,8 @@ static BOOL update_send_patblt(rdpContext* context, PATBLT_ORDER* patblt) int headerLength; ORDER_INFO orderInfo; rdpUpdate* update = context->update; - headerLength = update_prepare_order_info(context, &orderInfo, - ORDER_TYPE_PATBLT); - update_check_flush(context, - headerLength + update_approximate_patblt_order(&orderInfo, patblt)); + headerLength = update_prepare_order_info(context, &orderInfo, ORDER_TYPE_PATBLT); + update_check_flush(context, headerLength + update_approximate_patblt_order(&orderInfo, patblt)); s = update->us; if (!s) @@ -1316,8 +1292,7 @@ static BOOL update_send_scrblt(rdpContext* context, const SCRBLT_ORDER* scrblt) ORDER_INFO orderInfo; int inf; rdpUpdate* update = context->update; - headerLength = update_prepare_order_info(context, &orderInfo, - ORDER_TYPE_SCRBLT); + headerLength = update_prepare_order_info(context, &orderInfo, ORDER_TYPE_SCRBLT); inf = update_approximate_scrblt_order(&orderInfo, scrblt); update_check_flush(context, headerLength + inf); s = update->us; @@ -1337,18 +1312,16 @@ static BOOL update_send_scrblt(rdpContext* context, const SCRBLT_ORDER* scrblt) return TRUE; } -static BOOL update_send_opaque_rect(rdpContext* context, - const OPAQUE_RECT_ORDER* opaque_rect) +static BOOL update_send_opaque_rect(rdpContext* context, const OPAQUE_RECT_ORDER* opaque_rect) { wStream* s; size_t offset; int headerLength; ORDER_INFO orderInfo; rdpUpdate* update = context->update; - headerLength = update_prepare_order_info(context, &orderInfo, - ORDER_TYPE_OPAQUE_RECT); - update_check_flush(context, - headerLength + update_approximate_opaque_rect_order(&orderInfo, opaque_rect)); + headerLength = update_prepare_order_info(context, &orderInfo, ORDER_TYPE_OPAQUE_RECT); + update_check_flush(context, headerLength + + update_approximate_opaque_rect_order(&orderInfo, opaque_rect)); s = update->us; if (!s) @@ -1366,8 +1339,7 @@ static BOOL update_send_opaque_rect(rdpContext* context, return TRUE; } -static BOOL update_send_line_to(rdpContext* context, - const LINE_TO_ORDER* line_to) +static BOOL update_send_line_to(rdpContext* context, const LINE_TO_ORDER* line_to) { wStream* s; int offset; @@ -1375,8 +1347,7 @@ static BOOL update_send_line_to(rdpContext* context, ORDER_INFO orderInfo; int inf; rdpUpdate* update = context->update; - headerLength = update_prepare_order_info(context, &orderInfo, - ORDER_TYPE_LINE_TO); + headerLength = update_prepare_order_info(context, &orderInfo, ORDER_TYPE_LINE_TO); inf = update_approximate_line_to_order(&orderInfo, line_to); update_check_flush(context, headerLength + inf); s = update->us; @@ -1403,10 +1374,8 @@ static BOOL update_send_memblt(rdpContext* context, MEMBLT_ORDER* memblt) int headerLength; ORDER_INFO orderInfo; rdpUpdate* update = context->update; - headerLength = update_prepare_order_info(context, &orderInfo, - ORDER_TYPE_MEMBLT); - update_check_flush(context, - headerLength + update_approximate_memblt_order(&orderInfo, memblt)); + headerLength = update_prepare_order_info(context, &orderInfo, ORDER_TYPE_MEMBLT); + update_check_flush(context, headerLength + update_approximate_memblt_order(&orderInfo, memblt)); s = update->us; if (!s) @@ -1424,8 +1393,7 @@ static BOOL update_send_memblt(rdpContext* context, MEMBLT_ORDER* memblt) return TRUE; } -static BOOL update_send_glyph_index(rdpContext* context, - GLYPH_INDEX_ORDER* glyph_index) +static BOOL update_send_glyph_index(rdpContext* context, GLYPH_INDEX_ORDER* glyph_index) { wStream* s; size_t offset; @@ -1433,8 +1401,7 @@ static BOOL update_send_glyph_index(rdpContext* context, int inf; ORDER_INFO orderInfo; rdpUpdate* update = context->update; - headerLength = update_prepare_order_info(context, &orderInfo, - ORDER_TYPE_GLYPH_INDEX); + headerLength = update_prepare_order_info(context, &orderInfo, ORDER_TYPE_GLYPH_INDEX); inf = update_approximate_glyph_index_order(&orderInfo, glyph_index); update_check_flush(context, headerLength + inf); s = update->us; @@ -1458,8 +1425,7 @@ static BOOL update_send_glyph_index(rdpContext* context, * Secondary Drawing Orders */ -static BOOL update_send_cache_bitmap(rdpContext* context, - const CACHE_BITMAP_ORDER* cache_bitmap) +static BOOL update_send_cache_bitmap(rdpContext* context, const CACHE_BITMAP_ORDER* cache_bitmap) { wStream* s; size_t bm, em; @@ -1471,11 +1437,10 @@ static BOOL update_send_cache_bitmap(rdpContext* context, rdpUpdate* update = context->update; extraFlags = 0; headerLength = 6; - orderType = cache_bitmap->compressed ? - ORDER_TYPE_CACHE_BITMAP_COMPRESSED : ORDER_TYPE_BITMAP_UNCOMPRESSED; - inf = update_approximate_cache_bitmap_order(cache_bitmap, - cache_bitmap->compressed, - &extraFlags); + orderType = cache_bitmap->compressed ? ORDER_TYPE_CACHE_BITMAP_COMPRESSED + : ORDER_TYPE_BITMAP_UNCOMPRESSED; + inf = + update_approximate_cache_bitmap_order(cache_bitmap, cache_bitmap->compressed, &extraFlags); update_check_flush(context, headerLength + inf); s = update->us; @@ -1489,24 +1454,22 @@ static BOOL update_send_cache_bitmap(rdpContext* context, Stream_Seek(s, headerLength); - if (!update_write_cache_bitmap_order(s, cache_bitmap, cache_bitmap->compressed, - &extraFlags)) + if (!update_write_cache_bitmap_order(s, cache_bitmap, cache_bitmap->compressed, &extraFlags)) return FALSE; em = Stream_GetPosition(s); orderLength = (em - bm) - 13; Stream_SetPosition(s, bm); Stream_Write_UINT8(s, ORDER_STANDARD | ORDER_SECONDARY); /* controlFlags (1 byte) */ - Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */ - Stream_Write_UINT16(s, extraFlags); /* extraFlags (2 bytes) */ - Stream_Write_UINT8(s, orderType); /* orderType (1 byte) */ + Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */ + Stream_Write_UINT16(s, extraFlags); /* extraFlags (2 bytes) */ + Stream_Write_UINT8(s, orderType); /* orderType (1 byte) */ Stream_SetPosition(s, em); update->numberOrders++; return TRUE; } -static BOOL update_send_cache_bitmap_v2(rdpContext* context, - CACHE_BITMAP_V2_ORDER* cache_bitmap_v2) +static BOOL update_send_cache_bitmap_v2(rdpContext* context, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2) { wStream* s; size_t bm, em; @@ -1517,15 +1480,15 @@ static BOOL update_send_cache_bitmap_v2(rdpContext* context, rdpUpdate* update = context->update; extraFlags = 0; headerLength = 6; - orderType = cache_bitmap_v2->compressed ? - ORDER_TYPE_BITMAP_COMPRESSED_V2 : ORDER_TYPE_BITMAP_UNCOMPRESSED_V2; + orderType = cache_bitmap_v2->compressed ? ORDER_TYPE_BITMAP_COMPRESSED_V2 + : ORDER_TYPE_BITMAP_UNCOMPRESSED_V2; if (context->settings->NoBitmapCompressionHeader) cache_bitmap_v2->flags |= CBR2_NO_BITMAP_COMPRESSION_HDR; - update_check_flush(context, - headerLength + update_approximate_cache_bitmap_v2_order(cache_bitmap_v2, - cache_bitmap_v2->compressed, &extraFlags)); + update_check_flush(context, headerLength + + update_approximate_cache_bitmap_v2_order( + cache_bitmap_v2, cache_bitmap_v2->compressed, &extraFlags)); s = update->us; if (!s) @@ -1538,25 +1501,23 @@ static BOOL update_send_cache_bitmap_v2(rdpContext* context, Stream_Seek(s, headerLength); - if (!update_write_cache_bitmap_v2_order(s, cache_bitmap_v2, - cache_bitmap_v2->compressed, &extraFlags)) + if (!update_write_cache_bitmap_v2_order(s, cache_bitmap_v2, cache_bitmap_v2->compressed, + &extraFlags)) return FALSE; em = Stream_GetPosition(s); orderLength = (em - bm) - 13; Stream_SetPosition(s, bm); - Stream_Write_UINT8(s, ORDER_STANDARD | - ORDER_SECONDARY); /* controlFlags (1 byte) */ - Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */ - Stream_Write_UINT16(s, extraFlags); /* extraFlags (2 bytes) */ - Stream_Write_UINT8(s, orderType); /* orderType (1 byte) */ + Stream_Write_UINT8(s, ORDER_STANDARD | ORDER_SECONDARY); /* controlFlags (1 byte) */ + Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */ + Stream_Write_UINT16(s, extraFlags); /* extraFlags (2 bytes) */ + Stream_Write_UINT8(s, orderType); /* orderType (1 byte) */ Stream_SetPosition(s, em); update->numberOrders++; return TRUE; } -static BOOL update_send_cache_bitmap_v3(rdpContext* context, - CACHE_BITMAP_V3_ORDER* cache_bitmap_v3) +static BOOL update_send_cache_bitmap_v3(rdpContext* context, CACHE_BITMAP_V3_ORDER* cache_bitmap_v3) { wStream* s; size_t bm, em; @@ -1568,9 +1529,8 @@ static BOOL update_send_cache_bitmap_v3(rdpContext* context, extraFlags = 0; headerLength = 6; orderType = ORDER_TYPE_BITMAP_COMPRESSED_V3; - update_check_flush(context, - headerLength + update_approximate_cache_bitmap_v3_order(cache_bitmap_v3, - &extraFlags)); + update_check_flush(context, headerLength + update_approximate_cache_bitmap_v3_order( + cache_bitmap_v3, &extraFlags)); s = update->us; if (!s) @@ -1589,18 +1549,17 @@ static BOOL update_send_cache_bitmap_v3(rdpContext* context, em = Stream_GetPosition(s); orderLength = (em - bm) - 13; Stream_SetPosition(s, bm); - Stream_Write_UINT8(s, ORDER_STANDARD | - ORDER_SECONDARY); /* controlFlags (1 byte) */ - Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */ - Stream_Write_UINT16(s, extraFlags); /* extraFlags (2 bytes) */ - Stream_Write_UINT8(s, orderType); /* orderType (1 byte) */ + Stream_Write_UINT8(s, ORDER_STANDARD | ORDER_SECONDARY); /* controlFlags (1 byte) */ + Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */ + Stream_Write_UINT16(s, extraFlags); /* extraFlags (2 bytes) */ + Stream_Write_UINT8(s, orderType); /* orderType (1 byte) */ Stream_SetPosition(s, em); update->numberOrders++; return TRUE; } static BOOL update_send_cache_color_table(rdpContext* context, - const CACHE_COLOR_TABLE_ORDER* cache_color_table) + const CACHE_COLOR_TABLE_ORDER* cache_color_table) { wStream* s; UINT16 flags; @@ -1630,18 +1589,16 @@ static BOOL update_send_cache_color_table(rdpContext* context, em = Stream_GetPosition(s); orderLength = (em - bm) - 13; Stream_SetPosition(s, bm); - Stream_Write_UINT8(s, ORDER_STANDARD | - ORDER_SECONDARY); /* controlFlags (1 byte) */ - Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */ - Stream_Write_UINT16(s, flags); /* extraFlags (2 bytes) */ - Stream_Write_UINT8(s, ORDER_TYPE_CACHE_COLOR_TABLE); /* orderType (1 byte) */ + Stream_Write_UINT8(s, ORDER_STANDARD | ORDER_SECONDARY); /* controlFlags (1 byte) */ + Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */ + Stream_Write_UINT16(s, flags); /* extraFlags (2 bytes) */ + Stream_Write_UINT8(s, ORDER_TYPE_CACHE_COLOR_TABLE); /* orderType (1 byte) */ Stream_SetPosition(s, em); update->numberOrders++; return TRUE; } -static BOOL update_send_cache_glyph(rdpContext* context, - const CACHE_GLYPH_ORDER* cache_glyph) +static BOOL update_send_cache_glyph(rdpContext* context, const CACHE_GLYPH_ORDER* cache_glyph) { wStream* s; UINT16 flags; @@ -1671,11 +1628,10 @@ static BOOL update_send_cache_glyph(rdpContext* context, em = Stream_GetPosition(s); orderLength = (em - bm) - 13; Stream_SetPosition(s, bm); - Stream_Write_UINT8(s, ORDER_STANDARD | - ORDER_SECONDARY); /* controlFlags (1 byte) */ - Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */ - Stream_Write_UINT16(s, flags); /* extraFlags (2 bytes) */ - Stream_Write_UINT8(s, ORDER_TYPE_CACHE_GLYPH); /* orderType (1 byte) */ + Stream_Write_UINT8(s, ORDER_STANDARD | ORDER_SECONDARY); /* controlFlags (1 byte) */ + Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */ + Stream_Write_UINT16(s, flags); /* extraFlags (2 bytes) */ + Stream_Write_UINT8(s, ORDER_TYPE_CACHE_GLYPH); /* orderType (1 byte) */ Stream_SetPosition(s, em); update->numberOrders++; return TRUE; @@ -1692,7 +1648,7 @@ static BOOL update_send_cache_glyph_v2(rdpContext* context, rdpUpdate* update = context->update; flags = 0; headerLength = 6; - inf = update_approximate_cache_glyph_v2_order(cache_glyph_v2, &flags); + inf = update_approximate_cache_glyph_v2_order(cache_glyph_v2, &flags); update_check_flush(context, headerLength + inf); s = update->us; @@ -1713,16 +1669,15 @@ static BOOL update_send_cache_glyph_v2(rdpContext* context, orderLength = (em - bm) - 13; Stream_SetPosition(s, bm); Stream_Write_UINT8(s, ORDER_STANDARD | ORDER_SECONDARY); /* controlFlags (1 byte) */ - Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */ - Stream_Write_UINT16(s, flags); /* extraFlags (2 bytes) */ - Stream_Write_UINT8(s, ORDER_TYPE_CACHE_GLYPH); /* orderType (1 byte) */ + Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */ + Stream_Write_UINT16(s, flags); /* extraFlags (2 bytes) */ + Stream_Write_UINT8(s, ORDER_TYPE_CACHE_GLYPH); /* orderType (1 byte) */ Stream_SetPosition(s, em); update->numberOrders++; return TRUE; } -static BOOL update_send_cache_brush(rdpContext* context, - const CACHE_BRUSH_ORDER* cache_brush) +static BOOL update_send_cache_brush(rdpContext* context, const CACHE_BRUSH_ORDER* cache_brush) { wStream* s; UINT16 flags; @@ -1752,11 +1707,10 @@ static BOOL update_send_cache_brush(rdpContext* context, em = Stream_GetPosition(s); orderLength = (em - bm) - 13; Stream_SetPosition(s, bm); - Stream_Write_UINT8(s, ORDER_STANDARD | - ORDER_SECONDARY); /* controlFlags (1 byte) */ - Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */ - Stream_Write_UINT16(s, flags); /* extraFlags (2 bytes) */ - Stream_Write_UINT8(s, ORDER_TYPE_CACHE_BRUSH); /* orderType (1 byte) */ + Stream_Write_UINT8(s, ORDER_STANDARD | ORDER_SECONDARY); /* controlFlags (1 byte) */ + Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */ + Stream_Write_UINT16(s, flags); /* extraFlags (2 bytes) */ + Stream_Write_UINT8(s, ORDER_TYPE_CACHE_BRUSH); /* orderType (1 byte) */ Stream_SetPosition(s, em); update->numberOrders++; return TRUE; @@ -1767,8 +1721,7 @@ static BOOL update_send_cache_brush(rdpContext* context, */ static BOOL update_send_create_offscreen_bitmap_order( - rdpContext* context, - const CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap) + rdpContext* context, const CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap) { wStream* s; size_t bm, em, inf; @@ -1779,8 +1732,7 @@ static BOOL update_send_create_offscreen_bitmap_order( headerLength = 1; orderType = ORDER_TYPE_CREATE_OFFSCREEN_BITMAP; controlFlags = ORDER_SECONDARY | (orderType << 2); - inf = update_approximate_create_offscreen_bitmap_order( - create_offscreen_bitmap); + inf = update_approximate_create_offscreen_bitmap_order(create_offscreen_bitmap); update_check_flush(context, headerLength + inf); s = update->us; @@ -1805,9 +1757,8 @@ static BOOL update_send_create_offscreen_bitmap_order( return TRUE; } -static BOOL update_send_switch_surface_order( - rdpContext* context, - const SWITCH_SURFACE_ORDER* switch_surface) +static BOOL update_send_switch_surface_order(rdpContext* context, + const SWITCH_SURFACE_ORDER* switch_surface) { wStream* s; size_t bm, em, inf; @@ -1823,7 +1774,7 @@ static BOOL update_send_switch_surface_order( headerLength = 1; orderType = ORDER_TYPE_SWITCH_SURFACE; controlFlags = ORDER_SECONDARY | (orderType << 2); - inf = update_approximate_switch_surface_order(switch_surface); + inf = update_approximate_switch_surface_order(switch_surface); update_check_flush(context, headerLength + inf); s = update->us; @@ -1871,7 +1822,7 @@ static BOOL update_send_pointer_system(rdpContext* context, } static BOOL update_send_pointer_position(rdpContext* context, - const POINTER_POSITION_UPDATE* pointerPosition) + const POINTER_POSITION_UPDATE* pointerPosition) { wStream* s; rdpRdp* rdp = context->rdp; @@ -1886,18 +1837,16 @@ static BOOL update_send_pointer_position(rdpContext* context, Stream_Write_UINT16(s, pointerPosition->xPos); /* xPos (2 bytes) */ Stream_Write_UINT16(s, pointerPosition->yPos); /* yPos (2 bytes) */ - ret = fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_PTR_POSITION, - s, FALSE); + ret = fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_PTR_POSITION, s, FALSE); out_fail: Stream_Release(s); return ret; } -static BOOL update_write_pointer_color(wStream* s, - const POINTER_COLOR_UPDATE* pointer_color) +static BOOL update_write_pointer_color(wStream* s, const POINTER_COLOR_UPDATE* pointer_color) { - if (!Stream_EnsureRemainingCapacity(s, - 32 + pointer_color->lengthAndMask + pointer_color->lengthXorMask)) + if (!Stream_EnsureRemainingCapacity(s, 32 + pointer_color->lengthAndMask + + pointer_color->lengthXorMask)) return FALSE; Stream_Write_UINT16(s, pointer_color->cacheIndex); @@ -1932,15 +1881,13 @@ static BOOL update_send_pointer_color(rdpContext* context, if (!update_write_pointer_color(s, pointer_color)) goto out_fail; - ret = fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_COLOR, s, - FALSE); + ret = fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_COLOR, s, FALSE); out_fail: Stream_Release(s); return ret; } -static BOOL update_send_pointer_new(rdpContext* context, - const POINTER_NEW_UPDATE* pointer_new) +static BOOL update_send_pointer_new(rdpContext* context, const POINTER_NEW_UPDATE* pointer_new) { wStream* s; rdpRdp* rdp = context->rdp; @@ -1955,8 +1902,7 @@ static BOOL update_send_pointer_new(rdpContext* context, Stream_Write_UINT16(s, pointer_new->xorBpp); /* xorBpp (2 bytes) */ update_write_pointer_color(s, &pointer_new->colorPtrAttr); - ret = fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_POINTER, s, - FALSE); + ret = fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_POINTER, s, FALSE); out_fail: Stream_Release(s); return ret; @@ -1974,8 +1920,7 @@ static BOOL update_send_pointer_cached(rdpContext* context, return FALSE; Stream_Write_UINT16(s, pointer_cached->cacheIndex); /* cacheIndex (2 bytes) */ - ret = fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_CACHED, s, - FALSE); + ret = fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_CACHED, s, FALSE); Stream_Release(s); return ret; } @@ -1992,10 +1937,10 @@ BOOL update_read_refresh_rect(rdpUpdate* update, wStream* s) Stream_Read_UINT8(s, numberOfAreas); Stream_Seek(s, 3); /* pad3Octects */ - if (Stream_GetRemainingLength(s) < ((size_t) numberOfAreas * 4 * 2)) + if (Stream_GetRemainingLength(s) < ((size_t)numberOfAreas * 4 * 2)) return FALSE; - areas = (RECTANGLE_16*) calloc(numberOfAreas, sizeof(RECTANGLE_16)); + areas = (RECTANGLE_16*)calloc(numberOfAreas, sizeof(RECTANGLE_16)); if (!areas) return FALSE; @@ -2032,16 +1977,14 @@ BOOL update_read_suppress_output(rdpUpdate* update, wStream* s) if (update->context->settings->SuppressOutput) IFCALL(update->SuppressOutput, update->context, allowDisplayUpdates, - allowDisplayUpdates > 0 ? (RECTANGLE_16*) Stream_Pointer(s) : NULL); + allowDisplayUpdates > 0 ? (RECTANGLE_16*)Stream_Pointer(s) : NULL); else - WLog_Print(update->log, WLOG_WARN, - "ignoring suppress output request from client"); + WLog_Print(update->log, WLOG_WARN, "ignoring suppress output request from client"); return TRUE; } -static BOOL update_send_set_keyboard_indicators(rdpContext* context, - UINT16 led_flags) +static BOOL update_send_set_keyboard_indicators(rdpContext* context, UINT16 led_flags) { wStream* s; rdpRdp* rdp = context->rdp; @@ -2050,15 +1993,13 @@ static BOOL update_send_set_keyboard_indicators(rdpContext* context, if (!s) return FALSE; - Stream_Write_UINT16(s, - 0); /* unitId should be 0 according to MS-RDPBCGR 2.2.8.2.1.1 */ + Stream_Write_UINT16(s, 0); /* unitId should be 0 according to MS-RDPBCGR 2.2.8.2.1.1 */ Stream_Write_UINT16(s, led_flags); /* ledFlags (2 bytes) */ - return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_SET_KEYBOARD_INDICATORS, - rdp->mcs->userId); + return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_SET_KEYBOARD_INDICATORS, rdp->mcs->userId); } -static BOOL update_send_set_keyboard_ime_status(rdpContext* context, - UINT16 imeId, UINT32 imeState, UINT32 imeConvMode) +static BOOL update_send_set_keyboard_ime_status(rdpContext* context, UINT16 imeId, UINT32 imeState, + UINT32 imeConvMode) { wStream* s; rdpRdp* rdp = context->rdp; @@ -2071,8 +2012,7 @@ static BOOL update_send_set_keyboard_ime_status(rdpContext* context, Stream_Write_UINT16(s, imeId); Stream_Write_UINT32(s, imeState); Stream_Write_UINT32(s, imeConvMode); - return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_SET_KEYBOARD_IME_STATUS, - rdp->mcs->userId); + return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_SET_KEYBOARD_IME_STATUS, rdp->mcs->userId); } void update_register_server_callbacks(rdpUpdate* update) @@ -2147,38 +2087,38 @@ void update_free_window_state(WINDOW_STATE_ORDER* window_state) rdpUpdate* update_new(rdpRdp* rdp) { - const wObject cb = { NULL, NULL, NULL, update_free_queued_message, NULL }; + const wObject cb = { NULL, NULL, NULL, update_free_queued_message, NULL }; rdpUpdate* update; OFFSCREEN_DELETE_LIST* deleteList; WINPR_UNUSED(rdp); - update = (rdpUpdate*) calloc(1, sizeof(rdpUpdate)); + update = (rdpUpdate*)calloc(1, sizeof(rdpUpdate)); if (!update) return NULL; update->log = WLog_Get("com.freerdp.core.update"); InitializeCriticalSection(&(update->mux)); - update->pointer = (rdpPointerUpdate*) calloc(1, sizeof(rdpPointerUpdate)); + update->pointer = (rdpPointerUpdate*)calloc(1, sizeof(rdpPointerUpdate)); if (!update->pointer) goto fail; - update->primary = (rdpPrimaryUpdate*) calloc(1, sizeof(rdpPrimaryUpdate)); + update->primary = (rdpPrimaryUpdate*)calloc(1, sizeof(rdpPrimaryUpdate)); if (!update->primary) goto fail; - update->secondary = (rdpSecondaryUpdate*) calloc(1, sizeof(rdpSecondaryUpdate)); + update->secondary = (rdpSecondaryUpdate*)calloc(1, sizeof(rdpSecondaryUpdate)); if (!update->secondary) goto fail; - update->altsec = (rdpAltSecUpdate*) calloc(1, sizeof(rdpAltSecUpdate)); + update->altsec = (rdpAltSecUpdate*)calloc(1, sizeof(rdpAltSecUpdate)); if (!update->altsec) goto fail; - update->window = (rdpWindowUpdate*) calloc(1, sizeof(rdpWindowUpdate)); + update->window = (rdpWindowUpdate*)calloc(1, sizeof(rdpWindowUpdate)); if (!update->window) goto fail; @@ -2238,7 +2178,6 @@ void update_free(rdpUpdate* update) } } - BOOL update_begin_paint(rdpUpdate* update) { if (!update) diff --git a/libfreerdp/core/update.h b/libfreerdp/core/update.h index 9cc24de21..057411c79 100644 --- a/libfreerdp/core/update.h +++ b/libfreerdp/core/update.h @@ -30,13 +30,13 @@ #include -#define UPDATE_TYPE_ORDERS 0x0000 -#define UPDATE_TYPE_BITMAP 0x0001 -#define UPDATE_TYPE_PALETTE 0x0002 -#define UPDATE_TYPE_SYNCHRONIZE 0x0003 +#define UPDATE_TYPE_ORDERS 0x0000 +#define UPDATE_TYPE_BITMAP 0x0001 +#define UPDATE_TYPE_PALETTE 0x0002 +#define UPDATE_TYPE_SYNCHRONIZE 0x0003 -#define BITMAP_COMPRESSION 0x0001 -#define NO_BITMAP_COMPRESSION_HDR 0x0400 +#define BITMAP_COMPRESSION 0x0001 +#define NO_BITMAP_COMPRESSION_HDR 0x0400 FREERDP_LOCAL rdpUpdate* update_new(rdpRdp* rdp); FREERDP_LOCAL void update_free(rdpUpdate* update); @@ -54,7 +54,7 @@ FREERDP_LOCAL PALETTE_UPDATE* update_read_palette(rdpUpdate* update, wStream* s) FREERDP_LOCAL POINTER_SYSTEM_UPDATE* update_read_pointer_system(rdpUpdate* update, wStream* s); FREERDP_LOCAL POINTER_POSITION_UPDATE* update_read_pointer_position(rdpUpdate* update, wStream* s); FREERDP_LOCAL POINTER_COLOR_UPDATE* update_read_pointer_color(rdpUpdate* update, wStream* s, - BYTE xorBpp); + BYTE xorBpp); FREERDP_LOCAL POINTER_NEW_UPDATE* update_read_pointer_new(rdpUpdate* update, wStream* s); FREERDP_LOCAL POINTER_CACHED_UPDATE* update_read_pointer_cached(rdpUpdate* update, wStream* s); diff --git a/libfreerdp/core/window.c b/libfreerdp/core/window.c index 18e6ed4ba..5ed9e7d76 100644 --- a/libfreerdp/core/window.c +++ b/libfreerdp/core/window.c @@ -53,7 +53,7 @@ BOOL rail_read_unicode_string(wStream* s, RAIL_UNICODE_STRING* unicode_string) return TRUE; } - new_str = (BYTE*) realloc(unicode_string->string, new_len); + new_str = (BYTE*)realloc(unicode_string->string, new_len); if (!new_str) { @@ -77,16 +77,16 @@ static BOOL update_read_icon_info(wStream* s, ICON_INFO* iconInfo) return FALSE; Stream_Read_UINT16(s, iconInfo->cacheEntry); /* cacheEntry (2 bytes) */ - Stream_Read_UINT8(s, iconInfo->cacheId); /* cacheId (1 byte) */ - Stream_Read_UINT8(s, iconInfo->bpp); /* bpp (1 byte) */ + Stream_Read_UINT8(s, iconInfo->cacheId); /* cacheId (1 byte) */ + Stream_Read_UINT8(s, iconInfo->bpp); /* bpp (1 byte) */ if ((iconInfo->bpp < 1) || (iconInfo->bpp > 32)) { - WLog_ERR(TAG, "invalid bpp value %"PRIu32"", iconInfo->bpp); + WLog_ERR(TAG, "invalid bpp value %" PRIu32 "", iconInfo->bpp); return FALSE; } - Stream_Read_UINT16(s, iconInfo->width); /* width (2 bytes) */ + Stream_Read_UINT16(s, iconInfo->width); /* width (2 bytes) */ Stream_Read_UINT16(s, iconInfo->height); /* height (2 bytes) */ /* cbColorTable is only present when bpp is 1, 4 or 8 */ @@ -109,14 +109,14 @@ static BOOL update_read_icon_info(wStream* s, ICON_INFO* iconInfo) if (Stream_GetRemainingLength(s) < 4) return FALSE; - Stream_Read_UINT16(s, iconInfo->cbBitsMask); /* cbBitsMask (2 bytes) */ + Stream_Read_UINT16(s, iconInfo->cbBitsMask); /* cbBitsMask (2 bytes) */ Stream_Read_UINT16(s, iconInfo->cbBitsColor); /* cbBitsColor (2 bytes) */ if (Stream_GetRemainingLength(s) < iconInfo->cbBitsMask + iconInfo->cbBitsColor) return FALSE; /* bitsMask */ - newBitMask = (BYTE*) realloc(iconInfo->bitsMask, iconInfo->cbBitsMask); + newBitMask = (BYTE*)realloc(iconInfo->bitsMask, iconInfo->cbBitsMask); if (!newBitMask) { @@ -133,7 +133,7 @@ static BOOL update_read_icon_info(wStream* s, ICON_INFO* iconInfo) { if (iconInfo->cbColorTable) { - iconInfo->colorTable = (BYTE*) malloc(iconInfo->cbColorTable); + iconInfo->colorTable = (BYTE*)malloc(iconInfo->cbColorTable); if (!iconInfo->colorTable) return FALSE; @@ -142,7 +142,7 @@ static BOOL update_read_icon_info(wStream* s, ICON_INFO* iconInfo) else if (iconInfo->cbColorTable) { BYTE* new_tab; - new_tab = (BYTE*) realloc(iconInfo->colorTable, iconInfo->cbColorTable); + new_tab = (BYTE*)realloc(iconInfo->colorTable, iconInfo->cbColorTable); if (!new_tab) { @@ -183,7 +183,7 @@ static BOOL update_read_cached_icon_info(wStream* s, CACHED_ICON_INFO* cachedIco return FALSE; Stream_Read_UINT16(s, cachedIconInfo->cacheEntry); /* cacheEntry (2 bytes) */ - Stream_Read_UINT8(s, cachedIconInfo->cacheId); /* cacheId (1 byte) */ + Stream_Read_UINT8(s, cachedIconInfo->cacheId); /* cacheId (1 byte) */ return TRUE; } @@ -192,14 +192,14 @@ static BOOL update_read_notify_icon_infotip(wStream* s, NOTIFY_ICON_INFOTIP* not if (Stream_GetRemainingLength(s) < 8) return FALSE; - Stream_Read_UINT32(s, notifyIconInfoTip->timeout); /* timeout (4 bytes) */ - Stream_Read_UINT32(s, notifyIconInfoTip->flags); /* infoFlags (4 bytes) */ + Stream_Read_UINT32(s, notifyIconInfoTip->timeout); /* timeout (4 bytes) */ + Stream_Read_UINT32(s, notifyIconInfoTip->flags); /* infoFlags (4 bytes) */ return rail_read_unicode_string(s, ¬ifyIconInfoTip->text) && /* infoTipText */ - rail_read_unicode_string(s, ¬ifyIconInfoTip->title); /* title */ + rail_read_unicode_string(s, ¬ifyIconInfoTip->title); /* title */ } static BOOL update_read_window_state_order(wStream* s, WINDOW_ORDER_INFO* orderInfo, - WINDOW_STATE_ORDER* windowState) + WINDOW_STATE_ORDER* windowState) { UINT32 i; size_t size; @@ -218,7 +218,7 @@ static BOOL update_read_window_state_order(wStream* s, WINDOW_ORDER_INFO* orderI if (Stream_GetRemainingLength(s) < 8) return FALSE; - Stream_Read_UINT32(s, windowState->style); /* style (4 bytes) */ + Stream_Read_UINT32(s, windowState->style); /* style (4 bytes) */ Stream_Read_UINT32(s, windowState->extendedStyle); /* extendedStyle (4 bytes) */ } @@ -250,7 +250,7 @@ static BOOL update_read_window_state_order(wStream* s, WINDOW_ORDER_INFO* orderI if (Stream_GetRemainingLength(s) < 8) return FALSE; - Stream_Read_UINT32(s, windowState->clientAreaWidth); /* clientAreaWidth (4 bytes) */ + Stream_Read_UINT32(s, windowState->clientAreaWidth); /* clientAreaWidth (4 bytes) */ Stream_Read_UINT32(s, windowState->clientAreaHeight); /* clientAreaHeight (4 bytes) */ } @@ -285,7 +285,7 @@ static BOOL update_read_window_state_order(wStream* s, WINDOW_ORDER_INFO* orderI if (Stream_GetRemainingLength(s) < 4) return FALSE; - Stream_Read_UINT32(s, windowState->rootParentHandle);/* rootParentHandle (4 bytes) */ + Stream_Read_UINT32(s, windowState->rootParentHandle); /* rootParentHandle (4 bytes) */ } if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_OFFSET) @@ -311,7 +311,7 @@ static BOOL update_read_window_state_order(wStream* s, WINDOW_ORDER_INFO* orderI if (Stream_GetRemainingLength(s) < 8) return FALSE; - Stream_Read_UINT32(s, windowState->windowWidth); /* windowWidth (4 bytes) */ + Stream_Read_UINT32(s, windowState->windowWidth); /* windowWidth (4 bytes) */ Stream_Read_UINT32(s, windowState->windowHeight); /* windowHeight (4 bytes) */ } @@ -345,9 +345,9 @@ static BOOL update_read_window_state_order(wStream* s, WINDOW_ORDER_INFO* orderI /* windowRects */ for (i = 0; i < windowState->numWindowRects; i++) { - Stream_Read_UINT16(s, windowState->windowRects[i].left); /* left (2 bytes) */ - Stream_Read_UINT16(s, windowState->windowRects[i].top); /* top (2 bytes) */ - Stream_Read_UINT16(s, windowState->windowRects[i].right); /* right (2 bytes) */ + Stream_Read_UINT16(s, windowState->windowRects[i].left); /* left (2 bytes) */ + Stream_Read_UINT16(s, windowState->windowRects[i].top); /* top (2 bytes) */ + Stream_Read_UINT16(s, windowState->windowRects[i].right); /* right (2 bytes) */ Stream_Read_UINT16(s, windowState->windowRects[i].bottom); /* bottom (2 bytes) */ } } @@ -388,10 +388,11 @@ static BOOL update_read_window_state_order(wStream* s, WINDOW_ORDER_INFO* orderI /* visibilityRects */ for (i = 0; i < windowState->numVisibilityRects; i++) { - Stream_Read_UINT16(s, windowState->visibilityRects[i].left); /* left (2 bytes) */ - Stream_Read_UINT16(s, windowState->visibilityRects[i].top); /* top (2 bytes) */ + Stream_Read_UINT16(s, windowState->visibilityRects[i].left); /* left (2 bytes) */ + Stream_Read_UINT16(s, windowState->visibilityRects[i].top); /* top (2 bytes) */ Stream_Read_UINT16(s, windowState->visibilityRects[i].right); /* right (2 bytes) */ - Stream_Read_UINT16(s, windowState->visibilityRects[i].bottom); /* bottom (2 bytes) */ + Stream_Read_UINT16(s, + windowState->visibilityRects[i].bottom); /* bottom (2 bytes) */ } } } @@ -443,10 +444,10 @@ static BOOL update_read_window_state_order(wStream* s, WINDOW_ORDER_INFO* orderI } static BOOL update_read_window_icon_order(wStream* s, WINDOW_ORDER_INFO* orderInfo, - WINDOW_ICON_ORDER* window_icon) + WINDOW_ICON_ORDER* window_icon) { WINPR_UNUSED(orderInfo); - window_icon->iconInfo = (ICON_INFO*) calloc(1, sizeof(ICON_INFO)); + window_icon->iconInfo = (ICON_INFO*)calloc(1, sizeof(ICON_INFO)); if (!window_icon->iconInfo) return FALSE; @@ -455,10 +456,11 @@ static BOOL update_read_window_icon_order(wStream* s, WINDOW_ORDER_INFO* orderIn } static BOOL update_read_window_cached_icon_order(wStream* s, WINDOW_ORDER_INFO* orderInfo, - WINDOW_CACHED_ICON_ORDER* window_cached_icon) + WINDOW_CACHED_ICON_ORDER* window_cached_icon) { WINPR_UNUSED(orderInfo); - return update_read_cached_icon_info(s, &window_cached_icon->cachedIcon); /* cachedIcon (CACHED_ICON_INFO) */ + return update_read_cached_icon_info( + s, &window_cached_icon->cachedIcon); /* cachedIcon (CACHED_ICON_INFO) */ } static void update_read_window_delete_order(wStream* s, WINDOW_ORDER_INFO* orderInfo) @@ -494,26 +496,29 @@ static BOOL window_order_supported(const rdpSettings* settings, UINT32 fieldFlag } } -#define DUMP_APPEND(buffer, size, ...) \ - do { \ - char* b = (buffer); \ - size_t s = (size); \ - size_t pos = strnlen(b, s); \ +#define DUMP_APPEND(buffer, size, ...) \ + do \ + { \ + char* b = (buffer); \ + size_t s = (size); \ + size_t pos = strnlen(b, s); \ _snprintf(&b[pos], s - pos, __VA_ARGS__); \ - } while(0) + } while (0) -static void dump_window_state_order(wLog *log, const char *msg, const WINDOW_ORDER_INFO* order, const WINDOW_STATE_ORDER *state) +static void dump_window_state_order(wLog* log, const char* msg, const WINDOW_ORDER_INFO* order, + const WINDOW_STATE_ORDER* state) { char buffer[3000] = { 0 }; const size_t bufferSize = sizeof(buffer) - 1; - _snprintf(buffer, bufferSize, "%s windowId=0x%"PRIu32"", msg, order->windowId); + _snprintf(buffer, bufferSize, "%s windowId=0x%" PRIu32 "", msg, order->windowId); if (order->fieldFlags & WINDOW_ORDER_FIELD_OWNER) - DUMP_APPEND(buffer, bufferSize, " owner=0x%"PRIx32"", state->ownerWindowId); + DUMP_APPEND(buffer, bufferSize, " owner=0x%" PRIx32 "", state->ownerWindowId); if (order->fieldFlags & WINDOW_ORDER_FIELD_STYLE) { - DUMP_APPEND(buffer, bufferSize, " [ex]style=<0x%"PRIx32", 0x%"PRIx32"", state->style, state->extendedStyle); + DUMP_APPEND(buffer, bufferSize, " [ex]style=<0x%" PRIx32 ", 0x%" PRIx32 "", state->style, + state->extendedStyle); if (state->style & WS_POPUP) DUMP_APPEND(buffer, bufferSize, " popup"); if (state->style & WS_VISIBLE) @@ -537,14 +542,24 @@ static void dump_window_state_order(wLog *log, const char *msg, const WINDOW_ORD if (order->fieldFlags & WINDOW_ORDER_FIELD_SHOW) { - const char *showStr; - switch(state->showState) + const char* showStr; + switch (state->showState) { - case 0: showStr = "hidden"; break; - case 2: showStr = "minimized"; break; - case 3: showStr = "maximized"; break; - case 5: showStr = "current"; break; - default: showStr = ""; break; + case 0: + showStr = "hidden"; + break; + case 2: + showStr = "minimized"; + break; + case 3: + showStr = "maximized"; + break; + case 5: + showStr = "current"; + break; + default: + showStr = ""; + break; } DUMP_APPEND(buffer, bufferSize, " show=%s", showStr); } @@ -552,54 +567,60 @@ static void dump_window_state_order(wLog *log, const char *msg, const WINDOW_ORD if (order->fieldFlags & WINDOW_ORDER_FIELD_TITLE) DUMP_APPEND(buffer, bufferSize, " title"); if (order->fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET) - DUMP_APPEND(buffer, bufferSize, " clientOffsetX=%"PRId32" clientOffsetY=%"PRId32"", - state->clientOffsetX, state->clientOffsetY); + DUMP_APPEND(buffer, bufferSize, " clientOffsetX=%" PRId32 " clientOffsetY=%" PRId32 "", + state->clientOffsetX, state->clientOffsetY); if (order->fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE) - DUMP_APPEND(buffer, bufferSize, " clientAreaWidth=%"PRIu32" clientAreaHeight=%"PRIu32"", - state->clientAreaWidth, state->clientAreaHeight); + DUMP_APPEND(buffer, bufferSize, " clientAreaWidth=%" PRIu32 " clientAreaHeight=%" PRIu32 "", + state->clientAreaWidth, state->clientAreaHeight); if (order->fieldFlags & WINDOW_ORDER_FIELD_RESIZE_MARGIN_X) - DUMP_APPEND(buffer, bufferSize, " resizeMarginLeft=%"PRIu32" resizeMarginRight=%"PRIu32"", - state->resizeMarginLeft, state->resizeMarginRight); + DUMP_APPEND(buffer, bufferSize, + " resizeMarginLeft=%" PRIu32 " resizeMarginRight=%" PRIu32 "", + state->resizeMarginLeft, state->resizeMarginRight); if (order->fieldFlags & WINDOW_ORDER_FIELD_RESIZE_MARGIN_Y) - DUMP_APPEND(buffer, bufferSize, " resizeMarginTop=%"PRIu32" resizeMarginBottom=%"PRIu32"", - state->resizeMarginTop, state->resizeMarginBottom); + DUMP_APPEND(buffer, bufferSize, + " resizeMarginTop=%" PRIu32 " resizeMarginBottom=%" PRIu32 "", + state->resizeMarginTop, state->resizeMarginBottom); if (order->fieldFlags & WINDOW_ORDER_FIELD_RP_CONTENT) - DUMP_APPEND(buffer, bufferSize, " rpContent=0x%"PRIx32"", state->RPContent); + DUMP_APPEND(buffer, bufferSize, " rpContent=0x%" PRIx32 "", state->RPContent); if (order->fieldFlags & WINDOW_ORDER_FIELD_ROOT_PARENT) - DUMP_APPEND(buffer, bufferSize, " rootParent=0x%"PRIx32"", state->rootParentHandle); + DUMP_APPEND(buffer, bufferSize, " rootParent=0x%" PRIx32 "", state->rootParentHandle); if (order->fieldFlags & WINDOW_ORDER_FIELD_WND_OFFSET) - DUMP_APPEND(buffer, bufferSize, " windowOffsetX=%"PRId32" windowOffsetY=%"PRId32"", state->windowOffsetX, state->windowOffsetY); + DUMP_APPEND(buffer, bufferSize, " windowOffsetX=%" PRId32 " windowOffsetY=%" PRId32 "", + state->windowOffsetX, state->windowOffsetY); if (order->fieldFlags & WINDOW_ORDER_FIELD_WND_CLIENT_DELTA) - DUMP_APPEND(buffer, bufferSize, " windowClientDeltaX=%"PRId32" windowClientDeltaY=%"PRId32"", - state->windowClientDeltaX, state->windowClientDeltaY); + DUMP_APPEND(buffer, bufferSize, + " windowClientDeltaX=%" PRId32 " windowClientDeltaY=%" PRId32 "", + state->windowClientDeltaX, state->windowClientDeltaY); if (order->fieldFlags & WINDOW_ORDER_FIELD_WND_SIZE) - DUMP_APPEND(buffer, bufferSize, " windowWidth=%"PRIu32" windowHeight=%"PRIu32"", state->windowWidth, state->windowHeight); + DUMP_APPEND(buffer, bufferSize, " windowWidth=%" PRIu32 " windowHeight=%" PRIu32 "", + state->windowWidth, state->windowHeight); if (order->fieldFlags & WINDOW_ORDER_FIELD_WND_RECTS) { UINT32 i; DUMP_APPEND(buffer, bufferSize, " windowRects=("); - for(i = 0; i < state->numWindowRects; i++) + for (i = 0; i < state->numWindowRects; i++) { - DUMP_APPEND(buffer, bufferSize, "(%"PRIu16",%"PRIu16",%"PRIu16",%"PRIu16")", - state->windowRects[i].left, state->windowRects[i].top, - state->windowRects[i].right, state->windowRects[i].bottom); + DUMP_APPEND(buffer, bufferSize, "(%" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16 ")", + state->windowRects[i].left, state->windowRects[i].top, + state->windowRects[i].right, state->windowRects[i].bottom); } DUMP_APPEND(buffer, bufferSize, ")"); } if (order->fieldFlags & WINDOW_ORDER_FIELD_VIS_OFFSET) - DUMP_APPEND(buffer, bufferSize, " visibleOffsetX=%"PRId32" visibleOffsetY=%"PRId32"", state->visibleOffsetX, state->visibleOffsetY); + DUMP_APPEND(buffer, bufferSize, " visibleOffsetX=%" PRId32 " visibleOffsetY=%" PRId32 "", + state->visibleOffsetX, state->visibleOffsetY); if (order->fieldFlags & WINDOW_ORDER_FIELD_VISIBILITY) { UINT32 i; DUMP_APPEND(buffer, bufferSize, " visibilityRects=("); - for(i = 0; i < state->numVisibilityRects; i++) + for (i = 0; i < state->numVisibilityRects; i++) { - DUMP_APPEND(buffer, bufferSize, "(%"PRIu16",%"PRIu16",%"PRIu16",%"PRIu16")", - state->visibilityRects[i].left, state->visibilityRects[i].top, - state->visibilityRects[i].right, state->visibilityRects[i].bottom); + DUMP_APPEND(buffer, bufferSize, "(%" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16 ")", + state->visibilityRects[i].left, state->visibilityRects[i].top, + state->visibilityRects[i].right, state->visibilityRects[i].bottom); } DUMP_APPEND(buffer, bufferSize, ")"); } @@ -611,22 +632,33 @@ static void dump_window_state_order(wLog *log, const char *msg, const WINDOW_ORD DUMP_APPEND(buffer, bufferSize, " iconOverlayNull"); if (order->fieldFlags & WINDOW_ORDER_FIELD_TASKBAR_BUTTON) - DUMP_APPEND(buffer, bufferSize, " taskBarButton=0x%"PRIx8"", state->TaskbarButton); + DUMP_APPEND(buffer, bufferSize, " taskBarButton=0x%" PRIx8 "", state->TaskbarButton); if (order->fieldFlags & WINDOW_ORDER_FIELD_ENFORCE_SERVER_ZORDER) - DUMP_APPEND(buffer, bufferSize, " enforceServerZOrder=0x%"PRIx8"", state->EnforceServerZOrder); + DUMP_APPEND(buffer, bufferSize, " enforceServerZOrder=0x%" PRIx8 "", + state->EnforceServerZOrder); if (order->fieldFlags & WINDOW_ORDER_FIELD_APPBAR_STATE) - DUMP_APPEND(buffer, bufferSize, " appBarState=0x%"PRIx8"", state->AppBarState); + DUMP_APPEND(buffer, bufferSize, " appBarState=0x%" PRIx8 "", state->AppBarState); if (order->fieldFlags & WINDOW_ORDER_FIELD_APPBAR_EDGE) { - const char *appBarEdgeStr; + const char* appBarEdgeStr; switch (state->AppBarEdge) { - case 0: appBarEdgeStr = "left"; break; - case 1: appBarEdgeStr = "top"; break; - case 2: appBarEdgeStr = "right"; break; - case 3: appBarEdgeStr = "bottom"; break; - default: appBarEdgeStr = ""; break; + case 0: + appBarEdgeStr = "left"; + break; + case 1: + appBarEdgeStr = "top"; + break; + case 2: + appBarEdgeStr = "right"; + break; + case 3: + appBarEdgeStr = "bottom"; + break; + default: + appBarEdgeStr = ""; + break; } DUMP_APPEND(buffer, bufferSize, " appBarEdge=%s", appBarEdgeStr); } @@ -635,7 +667,7 @@ static void dump_window_state_order(wLog *log, const char *msg, const WINDOW_ORD } static BOOL update_recv_window_info_order(rdpUpdate* update, wStream* s, - WINDOW_ORDER_INFO* orderInfo) + WINDOW_ORDER_INFO* orderInfo) { rdpContext* context = update->context; rdpWindowUpdate* window = update->window; @@ -653,7 +685,8 @@ static BOOL update_recv_window_info_order(rdpUpdate* update, wStream* s, if (result) { - WLog_Print(update->log, WLOG_DEBUG, "WindowIcon windowId=0x%"PRIx32"", orderInfo->windowId); + WLog_Print(update->log, WLOG_DEBUG, "WindowIcon windowId=0x%" PRIx32 "", + orderInfo->windowId); IFCALLRET(window->WindowIcon, result, context, orderInfo, &window_icon); } @@ -667,14 +700,16 @@ static BOOL update_recv_window_info_order(rdpUpdate* update, wStream* s, if (result) { - WLog_Print(update->log, WLOG_DEBUG, "WindowCachedIcon windowId=0x%"PRIx32"", orderInfo->windowId); + WLog_Print(update->log, WLOG_DEBUG, "WindowCachedIcon windowId=0x%" PRIx32 "", + orderInfo->windowId); IFCALLRET(window->WindowCachedIcon, result, context, orderInfo, &window_cached_icon); } } else if (orderInfo->fieldFlags & WINDOW_ORDER_STATE_DELETED) { update_read_window_delete_order(s, orderInfo); - WLog_Print(update->log, WLOG_DEBUG, "WindowDelete windowId=0x%"PRIx32"", orderInfo->windowId); + WLog_Print(update->log, WLOG_DEBUG, "WindowDelete windowId=0x%" PRIx32 "", + orderInfo->windowId); IFCALLRET(window->WindowDelete, result, context, orderInfo); } else @@ -712,7 +747,7 @@ static void update_notify_icon_state_order_free(NOTIFY_ICON_STATE_ORDER* notify) } static BOOL update_read_notification_icon_state_order(wStream* s, WINDOW_ORDER_INFO* orderInfo, - NOTIFY_ICON_STATE_ORDER* notify_icon_state) + NOTIFY_ICON_STATE_ORDER* notify_icon_state) { if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_NOTIFY_VERSION) { @@ -724,13 +759,15 @@ static BOOL update_read_notification_icon_state_order(wStream* s, WINDOW_ORDER_I if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_NOTIFY_TIP) { - if (!rail_read_unicode_string(s, ¬ify_icon_state->toolTip)) /* toolTip (UNICODE_STRING) */ + if (!rail_read_unicode_string(s, + ¬ify_icon_state->toolTip)) /* toolTip (UNICODE_STRING) */ return FALSE; } if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP) { - if (!update_read_notify_icon_infotip(s, ¬ify_icon_state->infoTip)) /* infoTip (NOTIFY_ICON_INFOTIP) */ + if (!update_read_notify_icon_infotip( + s, ¬ify_icon_state->infoTip)) /* infoTip (NOTIFY_ICON_INFOTIP) */ return FALSE; } @@ -750,7 +787,8 @@ static BOOL update_read_notification_icon_state_order(wStream* s, WINDOW_ORDER_I if (orderInfo->fieldFlags & WINDOW_ORDER_CACHED_ICON) { - if (!update_read_cached_icon_info(s, ¬ify_icon_state->cachedIcon)) /* cachedIcon (CACHED_ICON_INFO) */ + if (!update_read_cached_icon_info( + s, ¬ify_icon_state->cachedIcon)) /* cachedIcon (CACHED_ICON_INFO) */ return FALSE; } @@ -763,7 +801,7 @@ static void update_read_notification_icon_delete_order(wStream* s, WINDOW_ORDER_ } static BOOL update_recv_notification_icon_info_order(rdpUpdate* update, wStream* s, - WINDOW_ORDER_INFO* orderInfo) + WINDOW_ORDER_INFO* orderInfo) { rdpContext* context = update->context; rdpWindowUpdate* window = update->window; @@ -772,7 +810,7 @@ static BOOL update_recv_notification_icon_info_order(rdpUpdate* update, wStream* if (Stream_GetRemainingLength(s) < 8) return FALSE; - Stream_Read_UINT32(s, orderInfo->windowId); /* windowId (4 bytes) */ + Stream_Read_UINT32(s, orderInfo->windowId); /* windowId (4 bytes) */ Stream_Read_UINT32(s, orderInfo->notifyIconId); /* notifyIconId (4 bytes) */ if (orderInfo->fieldFlags & WINDOW_ORDER_STATE_DELETED) @@ -799,15 +837,15 @@ static BOOL update_recv_notification_icon_info_order(rdpUpdate* update, wStream* WLog_Print(update->log, WLOG_DEBUG, "NotifyIconUpdate"); IFCALLRET(window->NotifyIconUpdate, result, context, orderInfo, ¬ify_icon_state); } - fail: - update_notify_icon_state_order_free(¬ify_icon_state); + fail: + update_notify_icon_state_order_free(¬ify_icon_state); } return result; } static BOOL update_read_desktop_actively_monitored_order(wStream* s, WINDOW_ORDER_INFO* orderInfo, - MONITORED_DESKTOP_ORDER* monitored_desktop) + MONITORED_DESKTOP_ORDER* monitored_desktop) { int i; int size; @@ -862,8 +900,8 @@ static void update_read_desktop_non_monitored_order(wStream* s, WINDOW_ORDER_INF /* non-monitored desktop notification event */ } -static void dump_monitored_desktop(wLog *log, const char *msg, const WINDOW_ORDER_INFO* orderInfo, - const MONITORED_DESKTOP_ORDER *monitored) +static void dump_monitored_desktop(wLog* log, const char* msg, const WINDOW_ORDER_INFO* orderInfo, + const MONITORED_DESKTOP_ORDER* monitored) { char buffer[1000] = { 0 }; const size_t bufferSize = sizeof(buffer) - 1; @@ -871,7 +909,7 @@ static void dump_monitored_desktop(wLog *log, const char *msg, const WINDOW_ORDE DUMP_APPEND(buffer, bufferSize, "%s", msg); if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND) - DUMP_APPEND(buffer, bufferSize, " activeWindowId=0x%"PRIx32"", monitored->activeWindowId); + DUMP_APPEND(buffer, bufferSize, " activeWindowId=0x%" PRIx32 "", monitored->activeWindowId); if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_DESKTOP_ZORDER) { @@ -880,7 +918,7 @@ static void dump_monitored_desktop(wLog *log, const char *msg, const WINDOW_ORDE DUMP_APPEND(buffer, bufferSize, " windows=("); for (i = 0; i < monitored->numWindowIds; i++) { - DUMP_APPEND(buffer, bufferSize, "0x%"PRIx32",", monitored->windowIds[i]); + DUMP_APPEND(buffer, bufferSize, "0x%" PRIx32 ",", monitored->windowIds[i]); } DUMP_APPEND(buffer, bufferSize, ")"); } @@ -888,7 +926,7 @@ static void dump_monitored_desktop(wLog *log, const char *msg, const WINDOW_ORDE } static BOOL update_recv_desktop_info_order(rdpUpdate* update, wStream* s, - WINDOW_ORDER_INFO* orderInfo) + WINDOW_ORDER_INFO* orderInfo) { rdpContext* context = update->context; rdpWindowUpdate* window = update->window; @@ -897,7 +935,8 @@ static BOOL update_recv_desktop_info_order(rdpUpdate* update, wStream* s, if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_DESKTOP_NONE) { update_read_desktop_non_monitored_order(s, orderInfo); - WLog_Print(update->log, WLOG_DEBUG, "NonMonitoredDesktop, windowId=0x%"PRIx32"", orderInfo->windowId); + WLog_Print(update->log, WLOG_DEBUG, "NonMonitoredDesktop, windowId=0x%" PRIx32 "", + orderInfo->windowId); IFCALLRET(window->NonMonitoredDesktop, result, context, orderInfo); } else @@ -907,7 +946,8 @@ static BOOL update_recv_desktop_info_order(rdpUpdate* update, wStream* s, if (result) { - dump_monitored_desktop(update->log, "ActivelyMonitoredDesktop", orderInfo, &monitored_desktop); + dump_monitored_desktop(update->log, "ActivelyMonitoredDesktop", orderInfo, + &monitored_desktop); IFCALLRET(window->MonitoredDesktop, result, context, orderInfo, &monitored_desktop); } @@ -944,7 +984,7 @@ BOOL update_recv_altsec_window_order(rdpUpdate* update, wStream* s) return FALSE; } - Stream_Read_UINT16(s, orderSize); /* orderSize (2 bytes) */ + Stream_Read_UINT16(s, orderSize); /* orderSize (2 bytes) */ Stream_Read_UINT32(s, orderInfo.fieldFlags); /* FieldsPresentFlags (4 bytes) */ if (remaining + 1 < orderSize) @@ -964,9 +1004,8 @@ BOOL update_recv_altsec_window_order(rdpUpdate* update, wStream* s) rc = update_recv_desktop_info_order(update, s, &orderInfo); if (!rc) - WLog_Print(update->log, WLOG_ERROR, "windoworder flags %08"PRIx32" failed", + WLog_Print(update->log, WLOG_ERROR, "windoworder flags %08" PRIx32 " failed", orderInfo.fieldFlags); return rc; } - diff --git a/libfreerdp/core/window.h b/libfreerdp/core/window.h index 4a0c241be..39be23bca 100644 --- a/libfreerdp/core/window.h +++ b/libfreerdp/core/window.h @@ -27,15 +27,17 @@ #include #include -FREERDP_LOCAL BOOL update_recv_altsec_window_order(rdpUpdate* update, - wStream* s); +FREERDP_LOCAL BOOL update_recv_altsec_window_order(rdpUpdate* update, wStream* s); FREERDP_LOCAL void update_free_window_state(WINDOW_STATE_ORDER* window_state); #define WND_TAG FREERDP_TAG("core.wnd") #ifdef WITH_DEBUG_WND #define DEBUG_WND(...) WLog_DBG(WND_TAG, __VA_ARGS__) #else -#define DEBUG_WND(...) do { } while (0) +#define DEBUG_WND(...) \ + do \ + { \ + } while (0) #endif #endif /* FREERDP_LIB_CORE_WINDOW_H */ diff --git a/libfreerdp/crypto/base64.c b/libfreerdp/crypto/base64.c index 9528ff48e..5a5da89a4 100644 --- a/libfreerdp/crypto/base64.c +++ b/libfreerdp/crypto/base64.c @@ -37,7 +37,7 @@ char* crypto_base64_encode(const BYTE* data, int length) int blocks; q = data; - p = ret = (char*) malloc((length + 3) * 4 / 3 + 1); + p = ret = (char*)malloc((length + 3) * 4 / 3 + 1); if (!p) return NULL; @@ -68,22 +68,22 @@ char* crypto_base64_encode(const BYTE* data, int length) /* then remainder */ switch (length % 3) { - case 0: - break; - case 1: - c = (q[0] << 16); - *p++ = base64[(c & 0x00FC0000) >> 18]; - *p++ = base64[(c & 0x0003F000) >> 12]; - *p++ = '='; - *p++ = '='; - break; - case 2: - c = (q[0] << 16) + (q[1] << 8); - *p++ = base64[(c & 0x00FC0000) >> 18]; - *p++ = base64[(c & 0x0003F000) >> 12]; - *p++ = base64[(c & 0x00000FC0) >> 6]; - *p++ = '='; - break; + case 0: + break; + case 1: + c = (q[0] << 16); + *p++ = base64[(c & 0x00FC0000) >> 18]; + *p++ = base64[(c & 0x0003F000) >> 12]; + *p++ = '='; + *p++ = '='; + break; + case 2: + c = (q[0] << 16) + (q[1] << 8); + *p++ = base64[(c & 0x00FC0000) >> 18]; + *p++ = base64[(c & 0x0003F000) >> 12]; + *p++ = base64[(c & 0x00000FC0) >> 6]; + *p++ = '='; + break; } *p = 0; @@ -124,7 +124,7 @@ static void* base64_decode(const char* s, int length, int* data_len) if (length % 4) return NULL; - q = data = (BYTE*) malloc(length / 4 * 3 + 1); + q = data = (BYTE*)malloc(length / 4 * 3 + 1); if (!q) return NULL; @@ -132,7 +132,7 @@ static void* base64_decode(const char* s, int length, int* data_len) nBlocks = (length / 4); outputLen = 0; - for (i = 0; i < nBlocks-1; i++, q += 3) + for (i = 0; i < nBlocks - 1; i++, q += 3) { n[0] = base64_decode_char(*s++); n[1] = base64_decode_char(*s++); diff --git a/libfreerdp/crypto/ber.c b/libfreerdp/crypto/ber.c index e7bce2e9f..33813f907 100644 --- a/libfreerdp/crypto/ber.c +++ b/libfreerdp/crypto/ber.c @@ -271,8 +271,7 @@ BOOL ber_read_enumerated(wStream* s, BYTE* enumerated, BYTE count) { size_t length; - if (!ber_read_universal_tag(s, BER_TAG_ENUMERATED, FALSE) || - !ber_read_length(s, &length)) + if (!ber_read_universal_tag(s, BER_TAG_ENUMERATED, FALSE) || !ber_read_length(s, &length)) return FALSE; if (length != 1 || Stream_GetRemainingLength(s) < 1) @@ -296,8 +295,7 @@ void ber_write_enumerated(wStream* s, BYTE enumerated, BYTE count) BOOL ber_read_bit_string(wStream* s, size_t* length, BYTE* padding) { - if (!ber_read_universal_tag(s, BER_TAG_BIT_STRING, FALSE) || - !ber_read_length(s, length)) + if (!ber_read_universal_tag(s, BER_TAG_BIT_STRING, FALSE) || !ber_read_length(s, length)) return FALSE; if (Stream_GetRemainingLength(s) < 1) @@ -326,9 +324,7 @@ size_t ber_write_octet_string(wStream* s, const BYTE* oct_str, size_t length) BOOL ber_read_octet_string_tag(wStream* s, size_t* length) { - return - ber_read_universal_tag(s, BER_TAG_OCTET_STRING, FALSE) && - ber_read_length(s, length); + return ber_read_universal_tag(s, BER_TAG_OCTET_STRING, FALSE) && ber_read_length(s, length); } size_t ber_write_octet_string_tag(wStream* s, size_t length) @@ -354,8 +350,7 @@ BOOL ber_read_BOOL(wStream* s, BOOL* value) size_t length; BYTE v; - if (!ber_read_universal_tag(s, BER_TAG_BOOLEAN, FALSE) || - !ber_read_length(s, &length)) + if (!ber_read_universal_tag(s, BER_TAG_BOOLEAN, FALSE) || !ber_read_length(s, &length)) return FALSE; if (length != 1 || Stream_GetRemainingLength(s) < 1) @@ -383,8 +378,7 @@ BOOL ber_read_integer(wStream* s, UINT32* value) { size_t length; - if (!ber_read_universal_tag(s, BER_TAG_INTEGER, FALSE) || - !ber_read_length(s, &length) || + if (!ber_read_universal_tag(s, BER_TAG_INTEGER, FALSE) || !ber_read_length(s, &length) || (Stream_GetRemainingLength(s) < length)) return FALSE; @@ -415,12 +409,12 @@ BOOL ber_read_integer(wStream* s, UINT32* value) } else if (length == 8) { - WLog_ERR(TAG, "should implement reading an 8 bytes integer"); + WLog_ERR(TAG, "should implement reading an 8 bytes integer"); return FALSE; } else { - WLog_ERR(TAG, "should implement reading an integer with length=%d", length); + WLog_ERR(TAG, "should implement reading an integer with length=%d", length); return FALSE; } @@ -435,21 +429,21 @@ BOOL ber_read_integer(wStream* s, UINT32* value) size_t ber_write_integer(wStream* s, UINT32 value) { - if (value < 0x80) + if (value < 0x80) { ber_write_universal_tag(s, BER_TAG_INTEGER, FALSE); ber_write_length(s, 1); Stream_Write_UINT8(s, value); return 3; } - else if (value < 0x8000) + else if (value < 0x8000) { ber_write_universal_tag(s, BER_TAG_INTEGER, FALSE); ber_write_length(s, 2); Stream_Write_UINT16_BE(s, value); return 4; } - else if (value < 0x800000) + else if (value < 0x800000) { ber_write_universal_tag(s, BER_TAG_INTEGER, FALSE); ber_write_length(s, 3); @@ -457,7 +451,7 @@ size_t ber_write_integer(wStream* s, UINT32 value) Stream_Write_UINT16_BE(s, (value & 0xFFFF)); return 5; } - else if (value < 0x80000000) + else if (value < 0x80000000) { ber_write_universal_tag(s, BER_TAG_INTEGER, FALSE); ber_write_length(s, 4); @@ -505,7 +499,5 @@ size_t ber_sizeof_integer(UINT32 value) BOOL ber_read_integer_length(wStream* s, size_t* length) { - return - ber_read_universal_tag(s, BER_TAG_INTEGER, FALSE) && - ber_read_length(s, length); + return ber_read_universal_tag(s, BER_TAG_INTEGER, FALSE) && ber_read_length(s, length); } diff --git a/libfreerdp/crypto/certificate.c b/libfreerdp/crypto/certificate.c index 32cdefc46..016455764 100644 --- a/libfreerdp/crypto/certificate.c +++ b/libfreerdp/crypto/certificate.c @@ -45,9 +45,8 @@ static const char certificate_legacy_hosts_file[] = "known_hosts"; #define TAG FREERDP_TAG("crypto") -static BOOL certificate_split_line(char* line, char** host, UINT16* port, - char** subject, char** issuer, - char** fingerprint); +static BOOL certificate_split_line(char* line, char** host, UINT16* port, char** subject, + char** issuer, char** fingerprint); static BOOL certificate_line_is_comment(const char* line, size_t length) { while (length > 0) @@ -88,8 +87,8 @@ BOOL certificate_store_init(rdpCertificateStore* certificate_store) WLog_INFO(TAG, "creating directory %s", settings->ConfigPath); } - if (!(certificate_store->path = GetCombinedPath(settings->ConfigPath, - (char*) certificate_store_dir))) + if (!(certificate_store->path = + GetCombinedPath(settings->ConfigPath, (char*)certificate_store_dir))) goto fail; if (!PathFileExistsA(certificate_store->path)) @@ -103,7 +102,7 @@ BOOL certificate_store_init(rdpCertificateStore* certificate_store) WLog_INFO(TAG, "creating directory [%s]", certificate_store->path); } - if (!(server_path = GetCombinedPath(settings->ConfigPath, (char*) certificate_server_dir))) + if (!(server_path = GetCombinedPath(settings->ConfigPath, (char*)certificate_server_dir))) goto fail; if (!PathFileExistsA(server_path)) @@ -117,12 +116,12 @@ BOOL certificate_store_init(rdpCertificateStore* certificate_store) WLog_INFO(TAG, "created directory [%s]", server_path); } - if (!(certificate_store->file = GetCombinedPath(settings->ConfigPath, - (char*) certificate_known_hosts_file))) + if (!(certificate_store->file = + GetCombinedPath(settings->ConfigPath, (char*)certificate_known_hosts_file))) goto fail; - if (!(certificate_store->legacy_file = GetCombinedPath(settings->ConfigPath, - (char*) certificate_legacy_hosts_file))) + if (!(certificate_store->legacy_file = + GetCombinedPath(settings->ConfigPath, (char*)certificate_legacy_hosts_file))) goto fail; free(server_path); @@ -138,7 +137,7 @@ fail: } static int certificate_data_match_legacy(rdpCertificateStore* certificate_store, - rdpCertificateData* certificate_data) + rdpCertificateData* certificate_data) { HANDLE fp; int match = 1; @@ -153,15 +152,15 @@ static int certificate_data_match_legacy(rdpCertificateStore* certificate_store, /* Assure POSIX style paths, CreateFile expects either '/' or '\\' */ PathCchConvertStyleA(certificate_store->legacy_file, strlen(certificate_store->legacy_file), PATH_STYLE_UNIX); - fp = CreateFileA(certificate_store->legacy_file, GENERIC_READ, FILE_SHARE_READ, - NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + fp = CreateFileA(certificate_store->legacy_file, GENERIC_READ, FILE_SHARE_READ, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (fp == INVALID_HANDLE_VALUE) return match; if ((lowSize = GetFileSize(fp, &highSize)) == INVALID_FILE_SIZE) { - WLog_ERR(TAG, "GetFileSize(%s) returned %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "GetFileSize(%s) returned %s [0x%08" PRIX32 "]", certificate_store->legacy_file, strerror(errno), GetLastError()); CloseHandle(fp); return match; @@ -175,7 +174,7 @@ static int certificate_data_match_legacy(rdpCertificateStore* certificate_store, return match; } - mdata = (char*) malloc(size + 2); + mdata = (char*)malloc(size + 2); if (!mdata) { @@ -206,8 +205,8 @@ static int certificate_data_match_legacy(rdpCertificateStore* certificate_store, hostname = StrSep(&pline, " \t"); if (!hostname || !pline) - WLog_WARN(TAG, "Invalid %s entry %s %s!", certificate_legacy_hosts_file, - hostname, pline); + WLog_WARN(TAG, "Invalid %s entry %s %s!", certificate_legacy_hosts_file, hostname, + pline); else if (strcmp(hostname, certificate_data->hostname) == 0) { const int diff = strcmp(pline, certificate_data->fingerprint); @@ -223,11 +222,8 @@ static int certificate_data_match_legacy(rdpCertificateStore* certificate_store, * copy to new file in new format. */ if (0 == match) { - rdpCertificateData* data = certificate_data_new( - hostname, - certificate_data->port, - NULL, NULL, - certificate_data->fingerprint); + rdpCertificateData* data = certificate_data_new(hostname, certificate_data->port, NULL, + NULL, certificate_data->fingerprint); if (data) { @@ -264,9 +260,8 @@ static int certificate_data_match_legacy(rdpCertificateStore* certificate_store, } static int certificate_data_match_raw(rdpCertificateStore* certificate_store, - rdpCertificateData* certificate_data, - char** psubject, char** pissuer, - char** fprint) + rdpCertificateData* certificate_data, char** psubject, + char** pissuer, char** fprint) { BOOL found = FALSE; HANDLE fp; @@ -285,15 +280,15 @@ static int certificate_data_match_raw(rdpCertificateStore* certificate_store, DWORD read; /* Assure POSIX style paths, CreateFile expects either '/' or '\\' */ PathCchConvertStyleA(certificate_store->file, strlen(certificate_store->file), PATH_STYLE_UNIX); - fp = CreateFileA(certificate_store->file, GENERIC_READ, FILE_SHARE_READ, - NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_NORMAL, NULL); + fp = CreateFileA(certificate_store->file, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_ALWAYS, + FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_NORMAL, NULL); if (fp == INVALID_HANDLE_VALUE) return match; if ((lowSize = GetFileSize(fp, &highSize)) == INVALID_FILE_SIZE) { - WLog_ERR(TAG, "GetFileSize(%s) returned %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "GetFileSize(%s) returned %s [0x%08" PRIX32 "]", certificate_store->legacy_file, strerror(errno), GetLastError()); CloseHandle(fp); return match; @@ -307,7 +302,7 @@ static int certificate_data_match_raw(rdpCertificateStore* certificate_store, return match; } - mdata = (char*) malloc(size + 2); + mdata = (char*)malloc(size + 2); if (!mdata) { @@ -338,10 +333,9 @@ static int certificate_data_match_raw(rdpCertificateStore* certificate_store, if (certificate_line_is_comment(pline, length)) { } - else if (!certificate_split_line(pline, &hostname, &port, - &subject, &issuer, &fingerprint)) - WLog_WARN(TAG, "Invalid %s entry %s!", - certificate_known_hosts_file, pline); + else if (!certificate_split_line(pline, &hostname, &port, &subject, &issuer, + &fingerprint)) + WLog_WARN(TAG, "Invalid %s entry %s!", certificate_known_hosts_file, pline); else if (strcmp(pline, certificate_data->hostname) == 0) { int outLen; @@ -381,12 +375,11 @@ static int certificate_data_match_raw(rdpCertificateStore* certificate_store, } BOOL certificate_get_stored_data(rdpCertificateStore* certificate_store, - rdpCertificateData* certificate_data, - char** subject, char** issuer, - char** fingerprint) + rdpCertificateData* certificate_data, char** subject, + char** issuer, char** fingerprint) { - int rc = certificate_data_match_raw(certificate_store, certificate_data, - subject, issuer, fingerprint); + int rc = certificate_data_match_raw(certificate_store, certificate_data, subject, issuer, + fingerprint); if ((rc == 0) || (rc == -1)) return TRUE; @@ -397,8 +390,7 @@ BOOL certificate_get_stored_data(rdpCertificateStore* certificate_store, int certificate_data_match(rdpCertificateStore* certificate_store, rdpCertificateData* certificate_data) { - return certificate_data_match_raw(certificate_store, certificate_data, - NULL, NULL, NULL); + return certificate_data_match_raw(certificate_store, certificate_data, NULL, NULL, NULL); } BOOL certificate_data_replace(rdpCertificateStore* certificate_store, @@ -415,15 +407,15 @@ BOOL certificate_data_replace(rdpCertificateStore* certificate_store, DWORD lowSize, highSize; /* Assure POSIX style paths, CreateFile expects either '/' or '\\' */ PathCchConvertStyleA(certificate_store->file, strlen(certificate_store->file), PATH_STYLE_UNIX); - fp = CreateFileA(certificate_store->file, GENERIC_READ | GENERIC_WRITE, 0, - NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + fp = CreateFileA(certificate_store->file, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, NULL); if (fp == INVALID_HANDLE_VALUE) return FALSE; if ((lowSize = GetFileSize(fp, &highSize)) == INVALID_FILE_SIZE) { - WLog_ERR(TAG, "GetFileSize(%s) returned %s [0x%08"PRIX32"]", + WLog_ERR(TAG, "GetFileSize(%s) returned %s [0x%08" PRIX32 "]", certificate_store->legacy_file, strerror(errno), GetLastError()); CloseHandle(fp); return FALSE; @@ -437,7 +429,7 @@ BOOL certificate_data_replace(rdpCertificateStore* certificate_store, return FALSE; } - data = (char*) malloc(size + 2); + data = (char*)malloc(size + 2); if (!data) { @@ -454,8 +446,8 @@ BOOL certificate_data_replace(rdpCertificateStore* certificate_store, if (SetFilePointer(fp, 0, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER) { - WLog_ERR(TAG, "SetFilePointer(%s) returned %s [0x%08"PRIX32"]", - certificate_store->file, strerror(errno), GetLastError()); + WLog_ERR(TAG, "SetFilePointer(%s) returned %s [0x%08" PRIX32 "]", certificate_store->file, + strerror(errno), GetLastError()); free(data); CloseHandle(fp); return FALSE; @@ -463,8 +455,8 @@ BOOL certificate_data_replace(rdpCertificateStore* certificate_store, if (!SetEndOfFile(fp)) { - WLog_ERR(TAG, "SetEndOfFile(%s) returned %s [0x%08"PRIX32"]", - certificate_store->file, strerror(errno), GetLastError()); + WLog_ERR(TAG, "SetEndOfFile(%s) returned %s [0x%08" PRIX32 "]", certificate_store->file, + strerror(errno), GetLastError()); free(data); CloseHandle(fp); return FALSE; @@ -492,9 +484,10 @@ BOOL certificate_data_replace(rdpCertificateStore* certificate_store, if (certificate_line_is_comment(pline, length)) { } - else if (!certificate_split_line(pline, &hostname, &port, &subject, &issuer, &fingerprint)) - WLog_WARN(TAG, "Skipping invalid %s entry %s!", - certificate_known_hosts_file, pline); + else if (!certificate_split_line(pline, &hostname, &port, &subject, &issuer, + &fingerprint)) + WLog_WARN(TAG, "Skipping invalid %s entry %s!", certificate_known_hosts_file, + pline); else { int res; @@ -507,7 +500,8 @@ BOOL certificate_data_replace(rdpCertificateStore* certificate_store, rc = TRUE; } - res = _snprintf(NULL, 0, "%s %"PRIu16" %s %s %s\n", hostname, port, fingerprint, subject, issuer); + res = _snprintf(NULL, 0, "%s %" PRIu16 " %s %s %s\n", hostname, port, fingerprint, + subject, issuer); if (res < 0) { free(data); @@ -520,15 +514,15 @@ BOOL certificate_data_replace(rdpCertificateStore* certificate_store, if (!tdata) { - WLog_ERR(TAG, "malloc(%s) returned %s [0x%08X]", - certificate_store->file, strerror(errno), errno); + WLog_ERR(TAG, "malloc(%s) returned %s [0x%08X]", certificate_store->file, + strerror(errno), errno); free(data); CloseHandle(fp); return FALSE; } - res = _snprintf(tdata, size + 1, "%s %"PRIu16" %s %s %s\n", hostname, port, fingerprint, subject, - issuer); + res = _snprintf(tdata, size + 1, "%s %" PRIu16 " %s %s %s\n", hostname, port, + fingerprint, subject, issuer); if (res < 0) { free(tdata); @@ -539,8 +533,8 @@ BOOL certificate_data_replace(rdpCertificateStore* certificate_store, if ((size_t)res != size) { - WLog_ERR(TAG, "_snprintf(%s) returned %s [0x%08X]", - certificate_store->file, strerror(errno), errno); + WLog_ERR(TAG, "_snprintf(%s) returned %s [0x%08X]", certificate_store->file, + strerror(errno), errno); free(tdata); free(data); CloseHandle(fp); @@ -549,8 +543,8 @@ BOOL certificate_data_replace(rdpCertificateStore* certificate_store, if (!WriteFile(fp, tdata, size, &written, NULL) || (written != size)) { - WLog_ERR(TAG, "WriteFile(%s) returned %s [0x%08X]", - certificate_store->file, strerror(errno), errno); + WLog_ERR(TAG, "WriteFile(%s) returned %s [0x%08X]", certificate_store->file, + strerror(errno), errno); free(tdata); free(data); CloseHandle(fp); @@ -569,8 +563,8 @@ BOOL certificate_data_replace(rdpCertificateStore* certificate_store, return rc; } -BOOL certificate_split_line(char* line, char** host, UINT16* port, char** subject, - char** issuer, char** fingerprint) +BOOL certificate_split_line(char* line, char** host, UINT16* port, char** subject, char** issuer, + char** fingerprint) { char* cur; size_t length = strlen(line); @@ -624,24 +618,23 @@ BOOL certificate_data_print(rdpCertificateStore* certificate_store, /* reopen in append mode */ /* Assure POSIX style paths, CreateFile expects either '/' or '\\' */ PathCchConvertStyleA(certificate_store->file, strlen(certificate_store->file), PATH_STYLE_UNIX); - fp = CreateFileA(certificate_store->file, GENERIC_WRITE, 0, - NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + fp = CreateFileA(certificate_store->file, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, NULL); if (fp == INVALID_HANDLE_VALUE) return FALSE; if (SetFilePointer(fp, 0, NULL, FILE_END) == INVALID_SET_FILE_POINTER) { - WLog_ERR(TAG, "SetFilePointer(%s) returned %s [0x%08"PRIX32"]", - certificate_store->file, strerror(errno), GetLastError()); + WLog_ERR(TAG, "SetFilePointer(%s) returned %s [0x%08" PRIX32 "]", certificate_store->file, + strerror(errno), GetLastError()); CloseHandle(fp); return FALSE; } - rc = _snprintf(NULL, 0, "%s %"PRIu16" %s %s %s\n", certificate_data->hostname, - certificate_data->port, - certificate_data->fingerprint, certificate_data->subject, - certificate_data->issuer); + rc = _snprintf(NULL, 0, "%s %" PRIu16 " %s %s %s\n", certificate_data->hostname, + certificate_data->port, certificate_data->fingerprint, certificate_data->subject, + certificate_data->issuer); if (rc < 0) return FALSE; size = (size_t)rc; @@ -650,21 +643,20 @@ BOOL certificate_data_print(rdpCertificateStore* certificate_store, if (!tdata) { - WLog_ERR(TAG, "malloc(%s) returned %s [0x%08X]", - certificate_store->file, strerror(errno), errno); + WLog_ERR(TAG, "malloc(%s) returned %s [0x%08X]", certificate_store->file, strerror(errno), + errno); CloseHandle(fp); return FALSE; } - rc = _snprintf(tdata, size + 1, "%s %"PRIu16" %s %s %s\n", certificate_data->hostname, - certificate_data->port, - certificate_data->fingerprint, certificate_data->subject, - certificate_data->issuer); + rc = _snprintf(tdata, size + 1, "%s %" PRIu16 " %s %s %s\n", certificate_data->hostname, + certificate_data->port, certificate_data->fingerprint, certificate_data->subject, + certificate_data->issuer); if ((rc < 0) || ((size_t)rc != size)) { - WLog_ERR(TAG, "_snprintf(%s) returned %s [0x%08X]", - certificate_store->file, strerror(errno), errno); + WLog_ERR(TAG, "_snprintf(%s) returned %s [0x%08X]", certificate_store->file, + strerror(errno), errno); free(tdata); CloseHandle(fp); return FALSE; @@ -672,8 +664,8 @@ BOOL certificate_data_print(rdpCertificateStore* certificate_store, if (!WriteFile(fp, tdata, size, &written, NULL) || (written != size)) { - WLog_ERR(TAG, "WriteFile(%s) returned %s [0x%08X]", - certificate_store->file, strerror(errno), errno); + WLog_ERR(TAG, "WriteFile(%s) returned %s [0x%08X]", certificate_store->file, + strerror(errno), errno); free(tdata); CloseHandle(fp); return FALSE; @@ -685,7 +677,7 @@ BOOL certificate_data_print(rdpCertificateStore* certificate_store, } rdpCertificateData* certificate_data_new(const char* hostname, UINT16 port, const char* subject, - const char* issuer, const char* fingerprint) + const char* issuer, const char* fingerprint) { size_t i; rdpCertificateData* certdata; @@ -716,8 +708,7 @@ rdpCertificateData* certificate_data_new(const char* hostname, UINT16 port, cons certdata->fingerprint = _strdup(fingerprint); - if (!certdata->hostname || !certdata->subject || - !certdata->issuer || !certdata->fingerprint) + if (!certdata->hostname || !certdata->subject || !certdata->issuer || !certdata->fingerprint) goto fail; for (i = 0; i < strlen(hostname); i++) @@ -748,7 +739,7 @@ void certificate_data_free(rdpCertificateData* certificate_data) rdpCertificateStore* certificate_store_new(rdpSettings* settings) { rdpCertificateStore* certificate_store; - certificate_store = (rdpCertificateStore*) calloc(1, sizeof(rdpCertificateStore)); + certificate_store = (rdpCertificateStore*)calloc(1, sizeof(rdpCertificateStore)); if (!certificate_store) return NULL; diff --git a/libfreerdp/crypto/crypto.c b/libfreerdp/crypto/crypto.c index a044e4bc8..41e8cccd4 100644 --- a/libfreerdp/crypto/crypto.c +++ b/libfreerdp/crypto/crypto.c @@ -37,7 +37,7 @@ CryptoCert crypto_cert_read(BYTE* data, UINT32 length) return NULL; /* this will move the data pointer but we don't care, we don't use it again */ - cert->px509 = d2i_X509(NULL, (D2I_X509_CONST BYTE**) &data, length); + cert->px509 = d2i_X509(NULL, (D2I_X509_CONST BYTE**)&data, length); return cert; } @@ -60,7 +60,7 @@ BOOL crypto_cert_get_public_key(CryptoCert cert, BYTE** PublicKey, DWORD* Public if (!pkey) { - WLog_ERR(TAG, "X509_get_pubkey() failed"); + WLog_ERR(TAG, "X509_get_pubkey() failed"); status = FALSE; goto exit; } @@ -69,13 +69,13 @@ BOOL crypto_cert_get_public_key(CryptoCert cert, BYTE** PublicKey, DWORD* Public if (length < 1) { - WLog_ERR(TAG, "i2d_PublicKey() failed"); + WLog_ERR(TAG, "i2d_PublicKey() failed"); status = FALSE; goto exit; } - *PublicKeyLength = (DWORD) length; - *PublicKey = (BYTE*) malloc(length); + *PublicKeyLength = (DWORD)length; + *PublicKey = (BYTE*)malloc(length); ptr = (BYTE*)(*PublicKey); if (!ptr) @@ -101,8 +101,8 @@ static int crypto_rsa_common(const BYTE* input, int length, UINT32 key_length, c BYTE* input_reverse; BYTE* modulus_reverse; BYTE* exponent_reverse; - BIGNUM* mod, *exp, *x, *y; - input_reverse = (BYTE*) malloc(2 * key_length + exponent_size); + BIGNUM *mod, *exp, *x, *y; + input_reverse = (BYTE*)malloc(2 * key_length + exponent_size); if (!input_reverse) return -1; @@ -138,7 +138,7 @@ static int crypto_rsa_common(const BYTE* input, int length, UINT32 key_length, c output_length = BN_bn2bin(y, output); crypto_reverse(output, output_length); - if (output_length < (int) key_length) + if (output_length < (int)key_length) memset(output + output_length, 0, key_length - output_length); BN_free(y); @@ -158,13 +158,15 @@ fail_bn_ctx: static int crypto_rsa_public(const BYTE* input, int length, UINT32 key_length, const BYTE* modulus, const BYTE* exponent, BYTE* output) { - return crypto_rsa_common(input, length, key_length, modulus, exponent, EXPONENT_MAX_SIZE, output); + return crypto_rsa_common(input, length, key_length, modulus, exponent, EXPONENT_MAX_SIZE, + output); } static int crypto_rsa_private(const BYTE* input, int length, UINT32 key_length, const BYTE* modulus, const BYTE* private_exponent, BYTE* output) { - return crypto_rsa_common(input, length, key_length, modulus, private_exponent, key_length, output); + return crypto_rsa_common(input, length, key_length, modulus, private_exponent, key_length, + output); } int crypto_rsa_public_encrypt(const BYTE* input, int length, UINT32 key_length, const BYTE* modulus, @@ -194,7 +196,8 @@ int crypto_rsa_private_decrypt(const BYTE* input, int length, UINT32 key_length, int crypto_rsa_decrypt(const BYTE* input, int length, UINT32 key_length, const BYTE* modulus, const BYTE* private_exponent, BYTE* output) { - return crypto_rsa_common(input, length, key_length, modulus, private_exponent, key_length, output); + return crypto_rsa_common(input, length, key_length, modulus, private_exponent, key_length, + output); } void crypto_reverse(BYTE* data, int length) @@ -218,7 +221,7 @@ char* crypto_cert_fingerprint(X509* xcert) UINT32 fp_len; BYTE fp[EVP_MAX_MD_SIZE]; X509_digest(xcert, EVP_sha1(), fp, &fp_len); - fp_buffer = (char*) calloc(fp_len + 1, 3); + fp_buffer = (char*)calloc(fp_len + 1, 3); if (!fp_buffer) return NULL; @@ -227,11 +230,11 @@ char* crypto_cert_fingerprint(X509* xcert) for (i = 0; i < (fp_len - 1); i++) { - sprintf_s(p, (fp_len - i) * 3, "%02"PRIx8":", fp[i]); + sprintf_s(p, (fp_len - i) * 3, "%02" PRIx8 ":", fp[i]); p = &fp_buffer[(i + 1) * 3]; } - sprintf_s(p, (fp_len - i) * 3, "%02"PRIx8"", fp[i]); + sprintf_s(p, (fp_len - i) * 3, "%02" PRIx8 "", fp[i]); return fp_buffer; } @@ -295,27 +298,19 @@ char* crypto_cert_subject_common_name(X509* xcert, int* length) common_name = _strdup((char*)common_name_raw); OPENSSL_free(common_name_raw); - return (char*) common_name; + return (char*)common_name; } - /* GENERAL_NAME type labels */ -static const char* general_name_type_labels[] = { "OTHERNAME", - "EMAIL ", - "DNS ", - "X400 ", - "DIRNAME ", - "EDIPARTY ", - "URI ", - "IPADD ", - "RID " - }; +static const char* general_name_type_labels[] = { "OTHERNAME", "EMAIL ", "DNS ", + "X400 ", "DIRNAME ", "EDIPARTY ", + "URI ", "IPADD ", "RID " }; static const char* general_name_type_label(int general_name_type) { - if ((0 <= general_name_type) - && ((size_t)general_name_type < ARRAYSIZE(general_name_type_labels))) + if ((0 <= general_name_type) && + ((size_t)general_name_type < ARRAYSIZE(general_name_type_labels))) { return general_name_type_labels[general_name_type]; } @@ -327,7 +322,6 @@ static const char* general_name_type_label(int general_name_type) } } - /* map_subject_alt_name(x509, general_name_type, mapper, data) @@ -380,7 +374,7 @@ static void map_subject_alt_name(X509* x509, int general_name_type, general_name { int i; int num; - STACK_OF(GENERAL_NAME) *gens; + STACK_OF(GENERAL_NAME) * gens; gens = X509_get_ext_d2i(x509, NID_subject_alt_name, NULL, NULL); if (!gens) @@ -409,7 +403,6 @@ static void map_subject_alt_name(X509* x509, int general_name_type, general_name sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free); } - /* extract_string -- string extractor @@ -431,10 +424,10 @@ that must be freed with OPENSSL_free. typedef struct string_list { - char** strings; - int allocated; - int count; - int maximum; + char** strings; + int allocated; + int count; + int maximum; } string_list; static void string_list_initialize(string_list* list) @@ -465,9 +458,9 @@ static void string_list_free(string_list* list) static int extract_string(GENERAL_NAME* name, void* data, int index, int count) { - string_list* list = data; + string_list* list = data; unsigned char* cstring = 0; - ASN1_STRING* str; + ASN1_STRING* str; switch (name->type) { @@ -490,8 +483,7 @@ static int extract_string(GENERAL_NAME* name, void* data, int index, int count) if ((ASN1_STRING_to_UTF8(&cstring, str)) < 0) { WLog_ERR(TAG, "ASN1_STRING_to_UTF8() failed for %s: %s", - general_name_type_label(name->type), - ERR_error_string(ERR_get_error(), NULL)); + general_name_type_label(name->type), ERR_error_string(ERR_get_error(), NULL)); return 1; } @@ -504,7 +496,7 @@ static int extract_string(GENERAL_NAME* name, void* data, int index, int count) } list->strings[list->count] = (char*)cstring; - list->count ++ ; + list->count++; if (list->count >= list->maximum) { @@ -535,10 +527,10 @@ pointers directly obtained from the GENERAL_NAME. typedef struct object_list { ASN1_OBJECT* type_id; - char** strings; - int allocated; - int count; - int maximum; + char** strings; + int allocated; + int count; + int maximum; } object_list; static void object_list_initialize(object_list* list) @@ -566,7 +558,7 @@ static char* object_string(ASN1_TYPE* object) unsigned char* utf8String; int length; /* TODO: check that object.type is a string type. */ - length = ASN1_STRING_to_UTF8(& utf8String, object->value.asn1_string); + length = ASN1_STRING_to_UTF8(&utf8String, object->value.asn1_string); if (length < 0) { @@ -585,7 +577,7 @@ static void object_list_free(object_list* list) static int extract_othername_object_as_string(GENERAL_NAME* name, void* data, int index, int count) { - object_list* list = data; + object_list* list = data; if (name->type != GEN_OTHERNAME) { @@ -608,7 +600,7 @@ static int extract_othername_object_as_string(GENERAL_NAME* name, void* data, in if (list->strings[list->count]) { - list->count ++ ; + list->count++; } if (list->count >= list->maximum) @@ -644,7 +636,6 @@ char* crypto_cert_get_email(X509* x509) return result; } - /* crypto_cert_get_upn returns a dynamically allocated copy of the first UPN otherNames in the subjectAltNames (use free to free it). @@ -652,8 +643,6 @@ Note: if this first UPN otherName is not a string, then 0 is returned, instead of searching for another UPN that would be a string. */ - - char* crypto_cert_get_upn(X509* x509) { char* result = 0; @@ -674,15 +663,13 @@ char* crypto_cert_get_upn(X509* x509) return result; } - /* Deprecated name.*/ void crypto_cert_subject_alt_name_free(int count, int* lengths, char** alt_names) { crypto_cert_dns_names_free(count, lengths, alt_names); } -void crypto_cert_dns_names_free(int count, int* lengths, - char** dns_names) +void crypto_cert_dns_names_free(int count, int* lengths, char** dns_names) { free(lengths); @@ -738,7 +725,7 @@ char** crypto_cert_get_dns_names(X509* x509, int* count, int** lengths) return NULL; } - for (i = 0; i < list.count; i ++) + for (i = 0; i < list.count; i++) { result[i] = list.strings[i]; (*lengths)[i] = strlen(result[i]); @@ -748,13 +735,12 @@ char** crypto_cert_get_dns_names(X509* x509, int* count, int** lengths) return result; } - char* crypto_cert_issuer(X509* xcert) { return crypto_print_name(X509_get_issuer_name(xcert)); } -static int verify_cb (int ok, X509_STORE_CTX *csc) +static int verify_cb(int ok, X509_STORE_CTX* csc) { if (ok != 1) { @@ -764,7 +750,8 @@ static int verify_cb (int ok, X509_STORE_CTX *csc) const char* what = X509_verify_cert_error_string(err); char* name = crypto_cert_subject(where); - WLog_WARN(TAG, "Certificate verification failure '%s (%d)' at stack position %d", what, err, derr); + WLog_WARN(TAG, "Certificate verification failure '%s (%d)' at stack position %d", what, err, + derr); WLog_WARN(TAG, "%s", name); free(name); @@ -786,9 +773,9 @@ BOOL x509_verify_certificate(CryptoCert cert, const char* certificate_store_path #if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) OpenSSL_add_all_algorithms(); #else - OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \ - | OPENSSL_INIT_ADD_ALL_DIGESTS \ - | OPENSSL_INIT_LOAD_CONFIG, NULL); + OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS | OPENSSL_INIT_ADD_ALL_DIGESTS | + OPENSSL_INIT_LOAD_CONFIG, + NULL); #endif lookup = X509_STORE_add_lookup(cert_ctx, X509_LOOKUP_file()); @@ -861,14 +848,14 @@ void crypto_cert_print_info(X509* xcert) if (!fp) { - WLog_ERR(TAG, "error computing fingerprint"); + WLog_ERR(TAG, "error computing fingerprint"); goto out_free_issuer; } - WLog_INFO(TAG, "Certificate details:"); - WLog_INFO(TAG, "\tSubject: %s", subject); - WLog_INFO(TAG, "\tIssuer: %s", issuer); - WLog_INFO(TAG, "\tThumbprint: %s", fp); + WLog_INFO(TAG, "Certificate details:"); + WLog_INFO(TAG, "\tSubject: %s", subject); + WLog_INFO(TAG, "\tIssuer: %s", issuer); + WLog_INFO(TAG, "\tThumbprint: %s", fp); WLog_INFO(TAG, "The above X.509 certificate could not be verified, possibly because you do not have " "the CA certificate in your certificate store, or the certificate has expired. " diff --git a/libfreerdp/crypto/der.c b/libfreerdp/crypto/der.c index 2f69fa6a0..205d9027b 100644 --- a/libfreerdp/crypto/der.c +++ b/libfreerdp/crypto/der.c @@ -104,4 +104,3 @@ int der_write_sequence_tag(wStream* s, int length) Stream_Write_UINT8(s, (ER_CLASS_UNIV | ER_CONSTRUCT) | (ER_TAG_MASK & ER_TAG_SEQUENCE)); return der_write_length(s, length) + 1; } - diff --git a/libfreerdp/crypto/er.c b/libfreerdp/crypto/er.c index e5a5f72f9..fddf0bfa7 100644 --- a/libfreerdp/crypto/er.c +++ b/libfreerdp/crypto/er.c @@ -36,11 +36,11 @@ void er_read_length(wStream* s, int* length) if (!length) return; - + *length = 0; if (!s) return; - + if (byte & 0x80) { byte &= ~(0x80); @@ -286,7 +286,7 @@ BOOL er_write_bit_string_tag(wStream* s, UINT32 length, BYTE padding, BOOL flag) BOOL er_read_octet_string(wStream* s, int* length) { - if(!er_read_universal_tag(s, ER_TAG_OCTET_STRING, FALSE)) + if (!er_read_universal_tag(s, ER_TAG_OCTET_STRING, FALSE)) return FALSE; er_read_length(s, length); diff --git a/libfreerdp/crypto/opensslcompat.h b/libfreerdp/crypto/opensslcompat.h index 911a90080..169e8e4c2 100644 --- a/libfreerdp/crypto/opensslcompat.h +++ b/libfreerdp/crypto/opensslcompat.h @@ -36,25 +36,25 @@ #include #include -#define BIO_get_data(b) (b)->ptr -#define BIO_set_data(b,v) (b)->ptr = v -#define BIO_get_init(b) (b)->init -#define BIO_set_init(b,v) (b)->init = v -#define BIO_get_next(b,v) (b)->next_bio -#define BIO_set_next(b,v) (b)->next_bio = v -#define BIO_get_shutdown(b) (b)->shutdown -#define BIO_set_shutdown(b,v) (b)->shutdown = v -#define BIO_get_retry_reason(b) (b)->retry_reason -#define BIO_set_retry_reason(b,v) (b)->retry_reason = v +#define BIO_get_data(b) (b)->ptr +#define BIO_set_data(b, v) (b)->ptr = v +#define BIO_get_init(b) (b)->init +#define BIO_set_init(b, v) (b)->init = v +#define BIO_get_next(b, v) (b)->next_bio +#define BIO_set_next(b, v) (b)->next_bio = v +#define BIO_get_shutdown(b) (b)->shutdown +#define BIO_set_shutdown(b, v) (b)->shutdown = v +#define BIO_get_retry_reason(b) (b)->retry_reason +#define BIO_set_retry_reason(b, v) (b)->retry_reason = v -#define BIO_meth_set_write(b,f) (b)->bwrite = (f) -#define BIO_meth_set_read(b,f) (b)->bread = (f) -#define BIO_meth_set_puts(b,f) (b)->bputs = (f) -#define BIO_meth_set_gets(b,f) (b)->bgets = (f) -#define BIO_meth_set_ctrl(b,f) (b)->ctrl = (f) -#define BIO_meth_set_create(b,f) (b)->create = (f) -#define BIO_meth_set_destroy(b,f) (b)->destroy = (f) -#define BIO_meth_set_callback_ctrl(b,f) (b)->callback_ctrl = (f) +#define BIO_meth_set_write(b, f) (b)->bwrite = (f) +#define BIO_meth_set_read(b, f) (b)->bread = (f) +#define BIO_meth_set_puts(b, f) (b)->bputs = (f) +#define BIO_meth_set_gets(b, f) (b)->bgets = (f) +#define BIO_meth_set_ctrl(b, f) (b)->ctrl = (f) +#define BIO_meth_set_create(b, f) (b)->create = (f) +#define BIO_meth_set_destroy(b, f) (b)->destroy = (f) +#define BIO_meth_set_callback_ctrl(b, f) (b)->callback_ctrl = (f) BIO_METHOD* BIO_meth_new(int type, const char* name); void RSA_get0_key(const RSA* r, const BIGNUM** n, const BIGNUM** e, const BIGNUM** d); diff --git a/libfreerdp/crypto/per.c b/libfreerdp/crypto/per.c index 41f0ea822..1024e851c 100644 --- a/libfreerdp/crypto/per.c +++ b/libfreerdp/crypto/per.c @@ -160,7 +160,7 @@ void per_write_number_of_sets(wStream* s, BYTE number) BOOL per_read_padding(wStream* s, int length) { - if (((int) Stream_GetRemainingLength(s)) < length) + if (((int)Stream_GetRemainingLength(s)) < length) return FALSE; Stream_Seek(s, length); @@ -337,9 +337,8 @@ BOOL per_read_object_identifier(wStream* s, BYTE oid[6]) Stream_Read_UINT8(s, a_oid[4]); /* tuple 5 */ Stream_Read_UINT8(s, a_oid[5]); /* tuple 6 */ - if ((a_oid[0] == oid[0]) && (a_oid[1] == oid[1]) && - (a_oid[2] == oid[2]) && (a_oid[3] == oid[3]) && - (a_oid[4] == oid[4]) && (a_oid[5] == oid[5])) + if ((a_oid[0] == oid[0]) && (a_oid[1] == oid[1]) && (a_oid[2] == oid[2]) && + (a_oid[3] == oid[3]) && (a_oid[4] == oid[4]) && (a_oid[5] == oid[5])) { return TRUE; } @@ -359,8 +358,8 @@ BOOL per_read_object_identifier(wStream* s, BYTE oid[6]) void per_write_object_identifier(wStream* s, BYTE oid[6]) { BYTE t12 = oid[0] * 40 + oid[1]; - Stream_Write_UINT8(s, 5); /* length */ - Stream_Write_UINT8(s, t12); /* first two tuples */ + Stream_Write_UINT8(s, 5); /* length */ + Stream_Write_UINT8(s, t12); /* first two tuples */ Stream_Write_UINT8(s, oid[2]); /* tuple 3 */ Stream_Write_UINT8(s, oid[3]); /* tuple 4 */ Stream_Write_UINT8(s, oid[4]); /* tuple 5 */ @@ -403,7 +402,7 @@ BOOL per_read_octet_string(wStream* s, BYTE* oct_str, int length, int min) if (mlength + min != length) return FALSE; - if (((int) Stream_GetRemainingLength(s)) < length) + if (((int)Stream_GetRemainingLength(s)) < length) return FALSE; a_oct_str = Stream_Pointer(s); @@ -457,7 +456,7 @@ BOOL per_read_numeric_string(wStream* s, int min) length = (mlength + min + 1) / 2; - if (((int) Stream_GetRemainingLength(s)) < length) + if (((int)Stream_GetRemainingLength(s)) < length) return FALSE; Stream_Seek(s, length); diff --git a/libfreerdp/crypto/test/TestBase64.c b/libfreerdp/crypto/test/TestBase64.c index 2f14c7398..c4309868f 100644 --- a/libfreerdp/crypto/test/TestBase64.c +++ b/libfreerdp/crypto/test/TestBase64.c @@ -26,17 +26,16 @@ struct Encode64test const char* output; }; -static const struct Encode64test encodeTests[] = -{ - {"\x00", 1, "AA=="}, - {"\x00\x00", 2, "AAA="}, - {"\x00\x00\x00", 3, "AAAA"}, - {"0123456", 7, "MDEyMzQ1Ng=="}, - {"90123456", 8, "OTAxMjM0NTY="}, - {"890123456", 9, "ODkwMTIzNDU2"}, - {"7890123456", 10, "Nzg5MDEyMzQ1Ng=="}, +static const struct Encode64test encodeTests[] = { + { "\x00", 1, "AA==" }, + { "\x00\x00", 2, "AAA=" }, + { "\x00\x00\x00", 3, "AAAA" }, + { "0123456", 7, "MDEyMzQ1Ng==" }, + { "90123456", 8, "OTAxMjM0NTY=" }, + { "890123456", 9, "ODkwMTIzNDU2" }, + { "7890123456", 10, "Nzg5MDEyMzQ1Ng==" }, - {NULL, -1, NULL}, /* /!\ last one /!\ */ + { NULL, -1, NULL }, /* /!\ last one /!\ */ }; int TestBase64(int argc, char* argv[]) @@ -68,9 +67,11 @@ int TestBase64(int argc, char* argv[]) for (i = 0; encodeTests[i].input; i++) { - crypto_base64_decode(encodeTests[i].output, strlen(encodeTests[i].output), &decoded, &outLen); + crypto_base64_decode(encodeTests[i].output, strlen(encodeTests[i].output), &decoded, + &outLen); - if (!decoded || (outLen != encodeTests[i].len) || memcmp(encodeTests[i].input, decoded, outLen)) + if (!decoded || (outLen != encodeTests[i].len) || + memcmp(encodeTests[i].input, decoded, outLen)) { fprintf(stderr, "ko, error for string %d\n", i); return -1; diff --git a/libfreerdp/crypto/test/TestKnownHosts.c b/libfreerdp/crypto/test/TestKnownHosts.c index 94fab115d..68c5c0e59 100644 --- a/libfreerdp/crypto/test/TestKnownHosts.c +++ b/libfreerdp/crypto/test/TestKnownHosts.c @@ -25,19 +25,12 @@ static int prepare(const char* currentFileV2, const char* legacyFileV2, const char* legacyFile) { - const char* legacy[] = - { - "someurl ff:11:22:dd\r\n", - "otherurl aa:bb:cc:dd\r", - "legacyurl aa:bb:cc:dd\n" - }; - const char* hosts[] = - { - "#somecomment\r\n" - "someurl 3389 ff:11:22:dd subject issuer\r\n" - " \t#anothercomment\r\n" - "otherurl\t3389\taa:bb:cc:dd\tsubject2\tissuer2\r" - }; + const char* legacy[] = { "someurl ff:11:22:dd\r\n", "otherurl aa:bb:cc:dd\r", + "legacyurl aa:bb:cc:dd\n" }; + const char* hosts[] = { "#somecomment\r\n" + "someurl 3389 ff:11:22:dd subject issuer\r\n" + " \t#anothercomment\r\n" + "otherurl\t3389\taa:bb:cc:dd\tsubject2\tissuer2\r" }; FILE* fl = NULL; FILE* fc = NULL; size_t i; @@ -106,13 +99,15 @@ int TestKnownHosts(int argc, char* argv[]) WINPR_UNUSED(argv); GetSystemTime(&systemTime); sprintf_s(sname, sizeof(sname), - "TestKnownHostsCurrent-%04"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%04"PRIu16, - systemTime.wYear, systemTime.wMonth, systemTime.wDay, systemTime.wHour, systemTime.wMinute, - systemTime.wSecond, systemTime.wMilliseconds); + "TestKnownHostsCurrent-%04" PRIu16 "%02" PRIu16 "%02" PRIu16 "%02" PRIu16 "%02" PRIu16 + "%02" PRIu16 "%04" PRIu16, + systemTime.wYear, systemTime.wMonth, systemTime.wDay, systemTime.wHour, + systemTime.wMinute, systemTime.wSecond, systemTime.wMilliseconds); sprintf_s(dname, sizeof(dname), - "TestKnownHostsLegacy-%04"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%04"PRIu16, - systemTime.wYear, systemTime.wMonth, systemTime.wDay, systemTime.wHour, systemTime.wMinute, - systemTime.wSecond, systemTime.wMilliseconds); + "TestKnownHostsLegacy-%04" PRIu16 "%02" PRIu16 "%02" PRIu16 "%02" PRIu16 "%02" PRIu16 + "%02" PRIu16 "%04" PRIu16, + systemTime.wYear, systemTime.wMonth, systemTime.wDay, systemTime.wHour, + systemTime.wMinute, systemTime.wSecond, systemTime.wMilliseconds); current.ConfigPath = GetKnownSubPath(KNOWN_PATH_TEMP, sname); legacy.ConfigPath = GetKnownSubPath(KNOWN_PATH_TEMP, dname); @@ -341,10 +336,10 @@ finish: certificate_data_free(data); DeleteFileA(currentFileV2); - //RemoveDirectoryA(current.ConfigPath); + // RemoveDirectoryA(current.ConfigPath); DeleteFileA(legacyFileV2); DeleteFileA(legacyFile); - //RemoveDirectoryA(legacy.ConfigPath); + // RemoveDirectoryA(legacy.ConfigPath); free(currentFileV2); free(legacyFileV2); free(legacyFile); diff --git a/libfreerdp/crypto/test/Test_x509_cert_info.c b/libfreerdp/crypto/test/Test_x509_cert_info.c index 4076dfed5..4a7d6a5b6 100644 --- a/libfreerdp/crypto/test/Test_x509_cert_info.c +++ b/libfreerdp/crypto/test/Test_x509_cert_info.c @@ -1,30 +1,31 @@ #include - -typedef char* (*get_field_pr)(X509*); +typedef char* (*get_field_pr)(X509*); typedef struct { enum { - DISABLED, ENABLED, + DISABLED, + ENABLED, } status; const char* field_description; get_field_pr get_field; const char* expected_result; } certificate_test_t; -static char* crypto_cert_subject_common_name_wo_length(X509* xcert) +static char* crypto_cert_subject_common_name_wo_length(X509* xcert) { int length; - return crypto_cert_subject_common_name(xcert, & length); + return crypto_cert_subject_common_name(xcert, &length); } static char* certificate_path(void) { /* Assume the .pem file is in the same directory as this source file. - Assume that __FILE__ will be a valid path to this file, even from the current working directory where the tests are run. - (ie. no chdir occurs between compilation and test running, or __FILE__ is an absolute path). + Assume that __FILE__ will be a valid path to this file, even from the current working directory + where the tests are run. (ie. no chdir occurs between compilation and test running, or __FILE__ + is an absolute path). */ #if defined(_WIN32) static const char dirsep = '\\'; @@ -53,60 +54,34 @@ static char* certificate_path(void) } } -static const certificate_test_t certificate_tests[] = -{ +static const certificate_test_t certificate_tests[] = { - { - ENABLED, - "Certificate Common Name", - crypto_cert_subject_common_name_wo_length, - "TESTJEAN TESTMARTIN 9999999" - }, + { ENABLED, "Certificate Common Name", crypto_cert_subject_common_name_wo_length, + "TESTJEAN TESTMARTIN 9999999" }, - { - ENABLED, - "Certificate subject", - crypto_cert_subject, - "CN = TESTJEAN TESTMARTIN 9999999, C = FR, O = MINISTERE DES TESTS, OU = 0002 110014016, OU = PERSONNES, UID = 9999999, GN = TESTJEAN, SN = TESTMARTIN" - }, + { ENABLED, "Certificate subject", crypto_cert_subject, + "CN = TESTJEAN TESTMARTIN 9999999, C = FR, O = MINISTERE DES TESTS, OU = 0002 110014016, OU " + "= PERSONNES, UID = 9999999, GN = TESTJEAN, SN = TESTMARTIN" }, - { - DISABLED, - "Kerberos principal name", - 0, - "testjean.testmartin@kpn.test.example.com" - }, + { DISABLED, "Kerberos principal name", 0, "testjean.testmartin@kpn.test.example.com" }, - { - ENABLED, - "Certificate e-mail", - crypto_cert_get_email, - "testjean.testmartin@test.example.com" + { ENABLED, "Certificate e-mail", crypto_cert_get_email, "testjean.testmartin@test.example.com" }, - { - ENABLED, - "Microsoft's Universal Principal Name", - crypto_cert_get_upn, - "testjean.testmartin.9999999@upn.test.example.com" - }, + { ENABLED, "Microsoft's Universal Principal Name", crypto_cert_get_upn, + "testjean.testmartin.9999999@upn.test.example.com" }, - { - ENABLED, - "Certificate issuer", - crypto_cert_issuer, - "CN = ADMINISTRATION CENTRALE DES TESTS, C = FR, O = MINISTERE DES TESTS, OU = 0002 110014016" - }, + { ENABLED, "Certificate issuer", crypto_cert_issuer, + "CN = ADMINISTRATION CENTRALE DES TESTS, C = FR, O = MINISTERE DES TESTS, OU = 0002 " + "110014016" }, }; - - -static int TestCertificateFile(const char* certificate_path, const certificate_test_t* certificate_tests, - int count) +static int TestCertificateFile(const char* certificate_path, + const certificate_test_t* certificate_tests, int count) { - X509* certificate; - FILE* certificate_file = fopen(certificate_path, "r"); + X509* certificate; + FILE* certificate_file = fopen(certificate_path, "r"); int success = 0; int i; @@ -126,7 +101,7 @@ static int TestCertificateFile(const char* certificate_path, const certificate_t goto fail; } - for (i = 0; i < count; i ++) + for (i = 0; i < count; i++) { char* result; @@ -135,22 +110,17 @@ static int TestCertificateFile(const char* certificate_path, const certificate_t continue; } - result = (certificate_tests[i].get_field - ? certificate_tests[i].get_field(certificate) - : 0); + result = (certificate_tests[i].get_field ? certificate_tests[i].get_field(certificate) : 0); if (result) { printf("%s: crypto got %-40s -> \"%s\"\n", __FUNCTION__, - certificate_tests[i].field_description, - result); + certificate_tests[i].field_description, result); if (0 != strcmp(result, certificate_tests[i].expected_result)) { - printf("%s: failure: for %s, actual: \"%s\", expected \"%s\"\n", - __FUNCTION__, - certificate_tests[i].field_description, - result, + printf("%s: failure: for %s, actual: \"%s\", expected \"%s\"\n", __FUNCTION__, + certificate_tests[i].field_description, result, certificate_tests[i].expected_result); success = -1; } @@ -169,7 +139,6 @@ fail: return success; } - int Test_x509_cert_info(int argc, char* argv[]) { char* cert_path = certificate_path(); @@ -180,4 +149,3 @@ int Test_x509_cert_info(int argc, char* argv[]) free(cert_path); return ret; } - diff --git a/libfreerdp/crypto/tls.c b/libfreerdp/crypto/tls.c index 7f4ac8e10..dfc824924 100644 --- a/libfreerdp/crypto/tls.c +++ b/libfreerdp/crypto/tls.c @@ -48,8 +48,6 @@ #define TAG FREERDP_TAG("crypto") - - /** * Earlier Microsoft iOS RDP clients have sent a null or even double null * terminated hostname in the SNI TLS extension. @@ -81,8 +79,8 @@ typedef struct _BIO_RDP_TLS BIO_RDP_TLS; static int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, UINT16 port); static void tls_print_certificate_name_mismatch_error(const char* hostname, UINT16 port, - const char* common_name, char** alt_names, - int alt_names_count); + const char* common_name, char** alt_names, + int alt_names_count); static void tls_print_certificate_error(const char* hostname, UINT16 port, const char* fingerprint, const char* hosts_file); @@ -90,7 +88,7 @@ static int bio_rdp_tls_write(BIO* bio, const char* buf, int size) { int error; int status; - BIO_RDP_TLS* tls = (BIO_RDP_TLS*) BIO_get_data(bio); + BIO_RDP_TLS* tls = (BIO_RDP_TLS*)BIO_get_data(bio); if (!buf || !tls) return 0; @@ -144,7 +142,7 @@ static int bio_rdp_tls_read(BIO* bio, char* buf, int size) { int error; int status; - BIO_RDP_TLS* tls = (BIO_RDP_TLS*) BIO_get_data(bio); + BIO_RDP_TLS* tls = (BIO_RDP_TLS*)BIO_get_data(bio); if (!buf || !tls) return 0; @@ -235,7 +233,7 @@ static long bio_rdp_tls_ctrl(BIO* bio, int cmd, long num, void* ptr) BIO* ssl_wbio; BIO* next_bio; int status = -1; - BIO_RDP_TLS* tls = (BIO_RDP_TLS*) BIO_get_data(bio); + BIO_RDP_TLS* tls = (BIO_RDP_TLS*)BIO_get_data(bio); if (!tls) return 0; @@ -281,7 +279,7 @@ static long bio_rdp_tls_ctrl(BIO* bio, int cmd, long num, void* ptr) break; case BIO_CTRL_GET_CALLBACK: - *((ULONG_PTR*) ptr) = (ULONG_PTR) SSL_get_info_callback(tls->ssl); + *((ULONG_PTR*)ptr) = (ULONG_PTR)SSL_get_info_callback(tls->ssl); status = 1; break; @@ -299,7 +297,7 @@ static long bio_rdp_tls_ctrl(BIO* bio, int cmd, long num, void* ptr) break; case BIO_CTRL_SET_CLOSE: - BIO_set_shutdown(bio, (int) num); + BIO_set_shutdown(bio, (int)num); status = 1; break; @@ -367,18 +365,18 @@ static long bio_rdp_tls_ctrl(BIO* bio, int cmd, long num, void* ptr) case BIO_C_GET_SSL: if (ptr) { - *((SSL**) ptr) = tls->ssl; + *((SSL**)ptr) = tls->ssl; status = 1; } break; case BIO_C_SET_SSL: - BIO_set_shutdown(bio, (int) num); + BIO_set_shutdown(bio, (int)num); if (ptr) { - tls->ssl = (SSL*) ptr; + tls->ssl = (SSL*)ptr; ssl_rbio = SSL_get_rbio(tls->ssl); ssl_wbio = SSL_get_wbio(tls->ssl); } @@ -447,7 +445,7 @@ static int bio_rdp_tls_new(BIO* bio) return 0; InitializeCriticalSectionAndSpinCount(&tls->lock, 4000); - BIO_set_data(bio, (void*) tls); + BIO_set_data(bio, (void*)tls); return 1; } @@ -458,7 +456,7 @@ static int bio_rdp_tls_free(BIO* bio) if (!bio) return 0; - tls = (BIO_RDP_TLS*) BIO_get_data(bio); + tls = (BIO_RDP_TLS*)BIO_get_data(bio); if (!tls) return 0; @@ -488,7 +486,7 @@ static long bio_rdp_tls_callback_ctrl(BIO* bio, int cmd, bio_info_cb* fp) if (!bio) return 0; - tls = (BIO_RDP_TLS*) BIO_get_data(bio); + tls = (BIO_RDP_TLS*)BIO_get_data(bio); if (!tls) return 0; @@ -496,16 +494,16 @@ static long bio_rdp_tls_callback_ctrl(BIO* bio, int cmd, bio_info_cb* fp) switch (cmd) { case BIO_CTRL_SET_CALLBACK: - { - typedef void (*fkt_t)(const SSL*, int, int); - /* Documented since https://www.openssl.org/docs/man1.1.1/man3/BIO_set_callback.html - * the argument is not really of type bio_info_cb* and must be cast - * to the required type */ - fkt_t fkt = (fkt_t)(void*)fp; - SSL_set_info_callback(tls->ssl, fkt); - status = 1; - } - break; + { + typedef void (*fkt_t)(const SSL*, int, int); + /* Documented since https://www.openssl.org/docs/man1.1.1/man3/BIO_set_callback.html + * the argument is not really of type bio_info_cb* and must be cast + * to the required type */ + fkt_t fkt = (fkt_t)(void*)fp; + SSL_set_info_callback(tls->ssl, fkt); + status = 1; + } + break; default: status = BIO_callback_ctrl(SSL_get_rbio(tls->ssl), cmd, fp); @@ -515,7 +513,7 @@ static long bio_rdp_tls_callback_ctrl(BIO* bio, int cmd, bio_info_cb* fp) return status; } -#define BIO_TYPE_RDP_TLS 68 +#define BIO_TYPE_RDP_TLS 68 static BIO_METHOD* BIO_s_rdp_tls(void) { @@ -569,7 +567,7 @@ static CryptoCert tls_get_certificate(rdpTls* tls, BOOL peer) { CryptoCert cert; X509* remote_cert; - STACK_OF(X509) *chain; + STACK_OF(X509) * chain; if (peer) remote_cert = SSL_get_peer_certificate(tls->ssl); @@ -603,7 +601,7 @@ static void tls_free_certificate(CryptoCert cert) free(cert); } -#define TLS_SERVER_END_POINT "tls-server-end-point:" +#define TLS_SERVER_END_POINT "tls-server-end-point:" static SecPkgContext_Bindings* tls_get_channel_bindings(X509* cert) { @@ -616,16 +614,13 @@ static SecPkgContext_Bindings* tls_get_channel_bindings(X509* cert) BYTE CertificateHash[32] = { 0 }; X509_digest(cert, EVP_sha256(), CertificateHash, &CertificateHashLength); ChannelBindingTokenLength = PrefixLength + CertificateHashLength; - ContextBindings = (SecPkgContext_Bindings*) calloc(1, - sizeof(SecPkgContext_Bindings)); + ContextBindings = (SecPkgContext_Bindings*)calloc(1, sizeof(SecPkgContext_Bindings)); if (!ContextBindings) return NULL; - ContextBindings->BindingsLength = sizeof(SEC_CHANNEL_BINDINGS) + - ChannelBindingTokenLength; - ChannelBindings = (SEC_CHANNEL_BINDINGS*) calloc(1, - ContextBindings->BindingsLength); + ContextBindings->BindingsLength = sizeof(SEC_CHANNEL_BINDINGS) + ChannelBindingTokenLength; + ChannelBindings = (SEC_CHANNEL_BINDINGS*)calloc(1, ContextBindings->BindingsLength); if (!ChannelBindings) goto out_free; @@ -633,8 +628,7 @@ static SecPkgContext_Bindings* tls_get_channel_bindings(X509* cert) ContextBindings->Bindings = ChannelBindings; ChannelBindings->cbApplicationDataLength = ChannelBindingTokenLength; ChannelBindings->dwApplicationDataOffset = sizeof(SEC_CHANNEL_BINDINGS); - ChannelBindingToken = &((BYTE*) - ChannelBindings)[ChannelBindings->dwApplicationDataOffset]; + ChannelBindingToken = &((BYTE*)ChannelBindings)[ChannelBindings->dwApplicationDataOffset]; memcpy(ChannelBindingToken, TLS_SERVER_END_POINT, PrefixLength); memcpy(ChannelBindingToken + PrefixLength, CertificateHash, CertificateHashLength); return ContextBindings; @@ -644,11 +638,11 @@ out_free: } #if OPENSSL_VERSION_NUMBER >= 0x010000000L -static BOOL tls_prepare(rdpTls* tls, BIO* underlying, const SSL_METHOD* method, - int options, BOOL clientMode) +static BOOL tls_prepare(rdpTls* tls, BIO* underlying, const SSL_METHOD* method, int options, + BOOL clientMode) #else -static BOOL tls_prepare(rdpTls* tls, BIO* underlying, SSL_METHOD* method, - int options, BOOL clientMode) +static BOOL tls_prepare(rdpTls* tls, BIO* underlying, SSL_METHOD* method, int options, + BOOL clientMode) #endif { rdpSettings* settings = tls->settings; @@ -660,8 +654,7 @@ static BOOL tls_prepare(rdpTls* tls, BIO* underlying, SSL_METHOD* method, return FALSE; } - SSL_CTX_set_mode(tls->ctx, - SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER | SSL_MODE_ENABLE_PARTIAL_WRITE); + SSL_CTX_set_mode(tls->ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER | SSL_MODE_ENABLE_PARTIAL_WRITE); SSL_CTX_set_options(tls->ctx, options); SSL_CTX_set_read_ahead(tls->ctx, 1); #if OPENSSL_VERSION_NUMBER >= 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) @@ -751,8 +744,7 @@ static int tls_do_handshake(rdpTls* tls, BOOL clientMode) do { status = poll(&pollfds, 1, 10); - } - while ((status < 0) && (errno == EINTR)); + } while ((status < 0) && (errno == EINTR)); #elif !defined(_WIN32) FD_ZERO(&rset); @@ -775,13 +767,12 @@ static int tls_do_handshake(rdpTls* tls, BOOL clientMode) if ((status != WAIT_OBJECT_0) && (status != WAIT_TIMEOUT)) { - WLog_ERR(TAG, "error during WaitForSingleObject(): 0x%08"PRIX32"", status); + WLog_ERR(TAG, "error during WaitForSingleObject(): 0x%08" PRIX32 "", status); return -1; } #endif - } - while (TRUE); + } while (TRUE); cert = tls_get_certificate(tls, clientMode); @@ -802,8 +793,7 @@ static int tls_do_handshake(rdpTls* tls, BOOL clientMode) if (!crypto_cert_get_public_key(cert, &tls->PublicKey, &tls->PublicKeyLength)) { - WLog_ERR(TAG, - "crypto_cert_get_public_key failed to return the server public key."); + WLog_ERR(TAG, "crypto_cert_get_public_key failed to return the server public key."); verify_status = -1; goto out; } @@ -875,9 +865,10 @@ int tls_connect(rdpTls* tls, BIO* underlying) return tls_do_handshake(tls, TRUE); } -#if defined(MICROSOFT_IOS_SNI_BUG) && !defined(OPENSSL_NO_TLSEXT) && !defined(LIBRESSL_VERSION_NUMBER) -static void tls_openssl_tlsext_debug_callback(SSL* s, int client_server, - int type, unsigned char* data, int len, void* arg) +#if defined(MICROSOFT_IOS_SNI_BUG) && !defined(OPENSSL_NO_TLSEXT) && \ + !defined(LIBRESSL_VERSION_NUMBER) +static void tls_openssl_tlsext_debug_callback(SSL* s, int client_server, int type, + unsigned char* data, int len, void* arg) { if (type == TLSEXT_TYPE_server_name) { @@ -936,15 +927,13 @@ BOOL tls_accept(rdpTls* tls, BIO* underlying, rdpSettings* settings) if (!bio) { - WLog_ERR(TAG, "BIO_new_file failed for private key %s", - settings->PrivateKeyFile); + WLog_ERR(TAG, "BIO_new_file failed for private key %s", settings->PrivateKeyFile); return FALSE; } } else if (settings->PrivateKeyContent) { - bio = BIO_new_mem_buf(settings->PrivateKeyContent, - strlen(settings->PrivateKeyContent)); + bio = BIO_new_mem_buf(settings->PrivateKeyContent, strlen(settings->PrivateKeyContent)); if (!bio) { @@ -980,15 +969,13 @@ BOOL tls_accept(rdpTls* tls, BIO* underlying, rdpSettings* settings) if (!bio) { - WLog_ERR(TAG, "BIO_new_file failed for certificate %s", - settings->CertificateFile); + WLog_ERR(TAG, "BIO_new_file failed for certificate %s", settings->CertificateFile); return FALSE; } } else if (settings->CertificateContent) { - bio = BIO_new_mem_buf(settings->CertificateContent, - strlen(settings->CertificateContent)); + bio = BIO_new_mem_buf(settings->CertificateContent, strlen(settings->CertificateContent)); if (!bio) { @@ -1018,7 +1005,8 @@ BOOL tls_accept(rdpTls* tls, BIO* underlying, rdpSettings* settings) return FALSE; } -#if defined(MICROSOFT_IOS_SNI_BUG) && !defined(OPENSSL_NO_TLSEXT) && !defined(LIBRESSL_VERSION_NUMBER) +#if defined(MICROSOFT_IOS_SNI_BUG) && !defined(OPENSSL_NO_TLSEXT) && \ + !defined(LIBRESSL_VERSION_NUMBER) SSL_set_tlsext_debug_callback(tls->ssl, tls_openssl_tlsext_debug_callback); #endif return tls_do_handshake(tls, FALSE) > 0; @@ -1032,12 +1020,12 @@ BOOL tls_send_alert(rdpTls* tls) if (!tls->ssl) return TRUE; - /** - * FIXME: The following code does not work on OpenSSL > 1.1.0 because the - * SSL struct is opaqe now - */ + /** + * FIXME: The following code does not work on OpenSSL > 1.1.0 because the + * SSL struct is opaqe now + */ #if (!defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER < 0x10100000L)) || \ - (defined(LIBRESSL_VERSION_NUMBER) && (LIBRESSL_VERSION_NUMBER <= 0x2080300fL)) + (defined(LIBRESSL_VERSION_NUMBER) && (LIBRESSL_VERSION_NUMBER <= 0x2080300fL)) if (tls->alertDescription != TLS_ALERT_DESCRIPTION_CLOSE_NOTIFY) { @@ -1119,8 +1107,8 @@ static BOOL tls_match_hostname(const char* pattern, const size_t pattern_length, return TRUE; } - if ((pattern_length > 2) && (pattern[0] == '*') && (pattern[1] == '.') - && ((strlen(hostname)) >= pattern_length)) + if ((pattern_length > 2) && (pattern[0] == '*') && (pattern[1] == '.') && + ((strlen(hostname)) >= pattern_length)) { const char* check_hostname = &hostname[strlen(hostname) - pattern_length + 1]; @@ -1199,7 +1187,7 @@ static BOOL is_accepted(rdpTls* tls, const BYTE* pem, size_t length) static BOOL accept_cert(rdpTls* tls, const BYTE* pem, UINT32 length) { rdpSettings* settings = tls->settings; - char* dupPem = _strdup((const char*) pem); + char* dupPem = _strdup((const char*)pem); if (!dupPem) return FALSE; @@ -1238,7 +1226,8 @@ static BOOL tls_extract_pem(CryptoCert cert, BYTE** PublicKey, DWORD* PublicKeyL *PublicKey = NULL; *PublicKeyLength = 0; /** - * Don't manage certificates internally, leave it up entirely to the external client implementation + * Don't manage certificates internally, leave it up entirely to the external client + * implementation */ bio = BIO_new(BIO_s_mem()); @@ -1259,7 +1248,7 @@ static BOOL tls_extract_pem(CryptoCert cert, BYTE** PublicKey, DWORD* PublicKeyL if (cert->px509chain) { count = sk_X509_num(cert->px509chain); - for (x=0; xpx509chain, x); status = PEM_write_bio_X509(bio, c); @@ -1273,7 +1262,7 @@ static BOOL tls_extract_pem(CryptoCert cert, BYTE** PublicKey, DWORD* PublicKeyL offset = 0; length = 2048; - pemCert = (BYTE*) malloc(length + 1); + pemCert = (BYTE*)malloc(length + 1); if (!pemCert) { @@ -1296,7 +1285,7 @@ static BOOL tls_extract_pem(CryptoCert cert, BYTE** PublicKey, DWORD* PublicKeyL int new_len; BYTE* new_cert; new_len = length * 2; - new_cert = (BYTE*) realloc(pemCert, new_len + 1); + new_cert = (BYTE*)realloc(pemCert, new_len + 1); if (!new_cert) goto fail; @@ -1331,8 +1320,7 @@ fail: return rc; } -int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, - UINT16 port) +int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, UINT16 port) { int match; int index; @@ -1346,7 +1334,7 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, int verification_status = -1; BOOL hostname_match = FALSE; rdpCertificateData* certificate_data = NULL; - freerdp* instance = (freerdp*) tls->settings->instance; + freerdp* instance = (freerdp*)tls->settings->instance; BYTE* pemCert = NULL; DWORD flags = VERIFY_CERT_FLAG_NONE; @@ -1373,8 +1361,8 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, if (tls->settings->ExternalCertificateManagement) { if (instance->VerifyX509Certificate) - verification_status = instance->VerifyX509Certificate(instance, pemCert, length, hostname, - port, flags); + verification_status = + instance->VerifyX509Certificate(instance, pemCert, length, hostname, port, flags); else WLog_ERR(TAG, "No VerifyX509Certificate callback registered!"); @@ -1382,8 +1370,8 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, accept_cert(tls, pemCert, length); else if (verification_status < 0) { - WLog_ERR(TAG, "VerifyX509Certificate failed: (length = %d) status: [%d] %s", - length, verification_status, pemCert); + WLog_ERR(TAG, "VerifyX509Certificate failed: (length = %d) status: [%d] %s", length, + verification_status, pemCert); goto end; } } @@ -1399,14 +1387,12 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, hostname = tls->settings->CertificateName; /* attempt verification using OpenSSL and the ~/.freerdp/certs certificate store */ - certificate_status = x509_verify_certificate(cert, - tls->certificate_store->path); + certificate_status = x509_verify_certificate(cert, tls->certificate_store->path); /* verify certificate name match */ certificate_data = crypto_get_certificate_data(cert->px509, hostname, port); /* extra common name and alternative names */ common_name = crypto_cert_subject_common_name(cert->px509, &common_name_length); - dns_names = crypto_cert_get_dns_names(cert->px509, &dns_names_count, - &dns_names_lengths); + dns_names = crypto_cert_get_dns_names(cert->px509, &dns_names_count, &dns_names_lengths); /* compare against common name */ @@ -1437,7 +1423,8 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, if (!hostname_match) flags |= VERIFY_CERT_FLAG_MISMATCH; - /* verification could not succeed with OpenSSL, use known_hosts file and prompt user for manual verification */ + /* verification could not succeed with OpenSSL, use known_hosts file and prompt user for + * manual verification */ if (!certificate_status || !hostname_match) { char* issuer; @@ -1454,10 +1441,8 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, { /* no entry was found in known_hosts file, prompt user for manual verification */ if (!hostname_match) - tls_print_certificate_name_mismatch_error( - hostname, port, - common_name, dns_names, - dns_names_count); + tls_print_certificate_name_mismatch_error(hostname, port, common_name, + dns_names, dns_names_count); /* Automatically accept certificate on first use */ if (tls->settings->AutoAcceptCertificate) @@ -1473,7 +1458,7 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, else if (instance->VerifyX509Certificate) { int rc = instance->VerifyX509Certificate(instance, pemCert, length, hostname, - port, flags); + port, flags); if (rc == 1) accept_certificate = 1; @@ -1485,18 +1470,14 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, else if (instance->VerifyCertificateEx) { accept_certificate = instance->VerifyCertificateEx( - instance, hostname, port, common_name, - subject, issuer, - fingerprint, flags); + instance, hostname, port, common_name, subject, issuer, fingerprint, flags); } else if (instance->VerifyCertificate) { - WLog_WARN(TAG, - "The VerifyCertificate callback is deprecated, migrate your application to VerifyCertificateEx"); + WLog_WARN(TAG, "The VerifyCertificate callback is deprecated, migrate your " + "application to VerifyCertificateEx"); accept_certificate = instance->VerifyCertificate( - instance, common_name, - subject, issuer, - fingerprint, !hostname_match); + instance, common_name, subject, issuer, fingerprint, !hostname_match); } } else if (match == -1) @@ -1504,15 +1485,14 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, char* old_subject = NULL; char* old_issuer = NULL; char* old_fingerprint = NULL; - /* entry was found in known_hosts file, but fingerprint does not match. ask user to use it */ + /* entry was found in known_hosts file, but fingerprint does not match. ask user to + * use it */ tls_print_certificate_error(hostname, port, fingerprint, tls->certificate_store->file); - if (!certificate_get_stored_data(tls->certificate_store, - certificate_data, &old_subject, - &old_issuer, &old_fingerprint)) - WLog_WARN(TAG, "Failed to get certificate entry for %s:%d", - hostname, port); + if (!certificate_get_stored_data(tls->certificate_store, certificate_data, + &old_subject, &old_issuer, &old_fingerprint)) + WLog_WARN(TAG, "Failed to get certificate entry for %s:%d", hostname, port); if (tls->settings->AutoDenyCertificate) { @@ -1521,8 +1501,9 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, } else if (instance->VerifyX509Certificate) { - const int rc = instance->VerifyX509Certificate(instance, pemCert, length, hostname, - port, flags | VERIFY_CERT_FLAG_CHANGED); + const int rc = + instance->VerifyX509Certificate(instance, pemCert, length, hostname, port, + flags | VERIFY_CERT_FLAG_CHANGED); if (rc == 1) accept_certificate = 1; @@ -1534,18 +1515,16 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, else if (instance->VerifyChangedCertificateEx) { accept_certificate = instance->VerifyChangedCertificateEx( - instance, hostname, port, common_name, subject, issuer, - fingerprint, old_subject, old_issuer, - old_fingerprint, flags | VERIFY_CERT_FLAG_CHANGED); + instance, hostname, port, common_name, subject, issuer, fingerprint, + old_subject, old_issuer, old_fingerprint, flags | VERIFY_CERT_FLAG_CHANGED); } else if (instance->VerifyChangedCertificate) { - WLog_WARN(TAG, - "The VerifyChangedCertificate callback is deprecated, migrate your application to VerifyChangedCertificateEx"); + WLog_WARN(TAG, "The VerifyChangedCertificate callback is deprecated, migrate " + "your application to VerifyChangedCertificateEx"); accept_certificate = instance->VerifyChangedCertificate( - instance, common_name, subject, issuer, - fingerprint, old_subject, old_issuer, - old_fingerprint); + instance, common_name, subject, issuer, fingerprint, old_subject, + old_issuer, old_fingerprint); } free(old_subject); @@ -1562,11 +1541,13 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, /* user accepted certificate, add entry in known_hosts file */ if (match < 0) - verification_status = certificate_data_replace(tls->certificate_store, - certificate_data) ? 1 : -1; + verification_status = + certificate_data_replace(tls->certificate_store, certificate_data) ? 1 + : -1; else - verification_status = certificate_data_print(tls->certificate_store, - certificate_data) ? 1 : -1; + verification_status = + certificate_data_print(tls->certificate_store, certificate_data) ? 1 + : -1; break; @@ -1595,8 +1576,7 @@ end: free(common_name); if (dns_names) - crypto_cert_dns_names_free(dns_names_count, dns_names_lengths, - dns_names); + crypto_cert_dns_names_free(dns_names_count, dns_names_lengths, dns_names); free(pemCert); return verification_status; @@ -1605,36 +1585,30 @@ end: void tls_print_certificate_error(const char* hostname, UINT16 port, const char* fingerprint, const char* hosts_file) { - WLog_ERR(TAG, "The host key for %s:%"PRIu16" has changed", hostname, port); + WLog_ERR(TAG, "The host key for %s:%" PRIu16 " has changed", hostname, port); WLog_ERR(TAG, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); WLog_ERR(TAG, "@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @"); WLog_ERR(TAG, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); WLog_ERR(TAG, "IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!"); - WLog_ERR(TAG, - "Someone could be eavesdropping on you right now (man-in-the-middle attack)!"); + WLog_ERR(TAG, "Someone could be eavesdropping on you right now (man-in-the-middle attack)!"); WLog_ERR(TAG, "It is also possible that a host key has just been changed."); - WLog_ERR(TAG, "The fingerprint for the host key sent by the remote host is %s", - fingerprint); + WLog_ERR(TAG, "The fingerprint for the host key sent by the remote host is %s", fingerprint); WLog_ERR(TAG, "Please contact your system administrator."); - WLog_ERR(TAG, "Add correct host key in %s to get rid of this message.", - hosts_file); - WLog_ERR(TAG, - "Host key for %s has changed and you have requested strict checking.", - hostname); + WLog_ERR(TAG, "Add correct host key in %s to get rid of this message.", hosts_file); + WLog_ERR(TAG, "Host key for %s has changed and you have requested strict checking.", hostname); WLog_ERR(TAG, "Host key verification failed."); } void tls_print_certificate_name_mismatch_error(const char* hostname, UINT16 port, - const char* common_name, char** alt_names, - int alt_names_count) + const char* common_name, char** alt_names, + int alt_names_count) { int index; assert(NULL != hostname); WLog_ERR(TAG, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); WLog_ERR(TAG, "@ WARNING: CERTIFICATE NAME MISMATCH! @"); WLog_ERR(TAG, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); - WLog_ERR(TAG, "The hostname used for this connection (%s:%"PRIu16") ", - hostname, port); + WLog_ERR(TAG, "The hostname used for this connection (%s:%" PRIu16 ") ", hostname, port); WLog_ERR(TAG, "does not match %s given in the certificate:", alt_names_count < 1 ? "the name" : "any of the names"); WLog_ERR(TAG, "Common Name (CN):"); @@ -1658,7 +1632,7 @@ void tls_print_certificate_name_mismatch_error(const char* hostname, UINT16 port rdpTls* tls_new(rdpSettings* settings) { rdpTls* tls; - tls = (rdpTls*) calloc(1, sizeof(rdpTls)); + tls = (rdpTls*)calloc(1, sizeof(rdpTls)); if (!tls) return NULL; diff --git a/libfreerdp/gdi/bitmap.c b/libfreerdp/gdi/bitmap.c index 582500597..902cb50a0 100644 --- a/libfreerdp/gdi/bitmap.c +++ b/libfreerdp/gdi/bitmap.c @@ -54,9 +54,8 @@ INLINE UINT32 gdi_GetPixel(HGDI_DC hdc, UINT32 nXPos, UINT32 nYPos) { - HGDI_BITMAP hBmp = (HGDI_BITMAP) hdc->selectedObject; - BYTE* data = &(hBmp->data[(nYPos * hBmp->scanline) + nXPos * GetBytesPerPixel( - hBmp->format)]); + HGDI_BITMAP hBmp = (HGDI_BITMAP)hdc->selectedObject; + BYTE* data = &(hBmp->data[(nYPos * hBmp->scanline) + nXPos * GetBytesPerPixel(hBmp->format)]); return ReadColor(data, hBmp->format); } @@ -76,18 +75,16 @@ INLINE BYTE* gdi_GetPointer(HGDI_BITMAP hBmp, UINT32 X, UINT32 Y) * @return */ -static INLINE UINT32 gdi_SetPixelBmp(HGDI_BITMAP hBmp, UINT32 X, UINT32 Y, - UINT32 crColor) +static INLINE UINT32 gdi_SetPixelBmp(HGDI_BITMAP hBmp, UINT32 X, UINT32 Y, UINT32 crColor) { - BYTE* p = &hBmp->data[(Y * hBmp->scanline) + X * GetBytesPerPixel( - hBmp->format)]; + BYTE* p = &hBmp->data[(Y * hBmp->scanline) + X * GetBytesPerPixel(hBmp->format)]; WriteColor(p, hBmp->format, crColor); return crColor; } INLINE UINT32 gdi_SetPixel(HGDI_DC hdc, UINT32 X, UINT32 Y, UINT32 crColor) { - HGDI_BITMAP hBmp = (HGDI_BITMAP) hdc->selectedObject; + HGDI_BITMAP hBmp = (HGDI_BITMAP)hdc->selectedObject; return gdi_SetPixelBmp(hBmp, X, Y, crColor); } @@ -102,16 +99,15 @@ INLINE UINT32 gdi_SetPixel(HGDI_DC hdc, UINT32 X, UINT32 Y, UINT32 crColor) * @return new bitmap */ -HGDI_BITMAP gdi_CreateBitmap(UINT32 nWidth, UINT32 nHeight, UINT32 format, - BYTE* data) +HGDI_BITMAP gdi_CreateBitmap(UINT32 nWidth, UINT32 nHeight, UINT32 format, BYTE* data) { return gdi_CreateBitmapEx(nWidth, nHeight, format, 0, data, _aligned_free); } -HGDI_BITMAP gdi_CreateBitmapEx(UINT32 nWidth, UINT32 nHeight, UINT32 format, - UINT32 stride, BYTE* data, void (*fkt_free)(void*)) +HGDI_BITMAP gdi_CreateBitmapEx(UINT32 nWidth, UINT32 nHeight, UINT32 format, UINT32 stride, + BYTE* data, void (*fkt_free)(void*)) { - HGDI_BITMAP hBitmap = (HGDI_BITMAP) calloc(1, sizeof(GDI_BITMAP)); + HGDI_BITMAP hBitmap = (HGDI_BITMAP)calloc(1, sizeof(GDI_BITMAP)); if (!hBitmap) return NULL; @@ -140,10 +136,9 @@ HGDI_BITMAP gdi_CreateBitmapEx(UINT32 nWidth, UINT32 nHeight, UINT32 format, * @return new bitmap */ -HGDI_BITMAP gdi_CreateCompatibleBitmap(HGDI_DC hdc, UINT32 nWidth, - UINT32 nHeight) +HGDI_BITMAP gdi_CreateCompatibleBitmap(HGDI_DC hdc, UINT32 nWidth, UINT32 nHeight) { - HGDI_BITMAP hBitmap = (HGDI_BITMAP) calloc(1, sizeof(GDI_BITMAP)); + HGDI_BITMAP hBitmap = (HGDI_BITMAP)calloc(1, sizeof(GDI_BITMAP)); if (!hBitmap) return NULL; @@ -152,8 +147,7 @@ HGDI_BITMAP gdi_CreateCompatibleBitmap(HGDI_DC hdc, UINT32 nWidth, hBitmap->format = hdc->format; hBitmap->width = nWidth; hBitmap->height = nHeight; - hBitmap->data = _aligned_malloc(nWidth * nHeight * GetBytesPerPixel( - hBitmap->format), 16); + hBitmap->data = _aligned_malloc(nWidth * nHeight * GetBytesPerPixel(hBitmap->format), 16); hBitmap->free = _aligned_free; if (!hBitmap->data) @@ -217,8 +211,7 @@ static BOOL op_xor(UINT32* stack, UINT32* stackp) return TRUE; } -static UINT32 process_rop(UINT32 src, UINT32 dst, UINT32 pat, const char* rop, - UINT32 format) +static UINT32 process_rop(UINT32 src, UINT32 dst, UINT32 pat, const char* rop, UINT32 format) { DWORD stack[10] = { 0 }; DWORD stackp = 0; @@ -273,10 +266,10 @@ static UINT32 process_rop(UINT32 src, UINT32 dst, UINT32 pat, const char* rop, return stack[0]; } -static INLINE BOOL BitBlt_write(HGDI_DC hdcDest, HGDI_DC hdcSrc, INT32 nXDest, - INT32 nYDest, INT32 nXSrc, INT32 nYSrc, INT32 x, INT32 y, - BOOL useSrc, BOOL usePat, UINT32 style, - const char* rop, const gdiPalette* palette) +static INLINE BOOL BitBlt_write(HGDI_DC hdcDest, HGDI_DC hdcSrc, INT32 nXDest, INT32 nYDest, + INT32 nXSrc, INT32 nYSrc, INT32 x, INT32 y, BOOL useSrc, + BOOL usePat, UINT32 style, const char* rop, + const gdiPalette* palette) { UINT32 dstColor; UINT32 colorA; @@ -288,7 +281,7 @@ static INLINE BOOL BitBlt_write(HGDI_DC hdcDest, HGDI_DC hdcSrc, INT32 nXDest, if (!dstp) { - WLog_ERR(TAG, "dstp=%p", (void*) dstp); + WLog_ERR(TAG, "dstp=%p", (void*)dstp); return FALSE; } @@ -300,7 +293,7 @@ static INLINE BOOL BitBlt_write(HGDI_DC hdcDest, HGDI_DC hdcSrc, INT32 nXDest, if (!srcp) { - WLog_ERR(TAG, "srcp=%p", (void*) srcp); + WLog_ERR(TAG, "srcp=%p", (void*)srcp); return FALSE; } @@ -318,18 +311,18 @@ static INLINE BOOL BitBlt_write(HGDI_DC hdcDest, HGDI_DC hdcSrc, INT32 nXDest, case GDI_BS_HATCHED: case GDI_BS_PATTERN: + { + const BYTE* patp = gdi_get_brush_pointer(hdcDest, nXDest + x, nYDest + y); + + if (!patp) { - const BYTE* patp = gdi_get_brush_pointer(hdcDest, nXDest + x, nYDest + y); - - if (!patp) - { - WLog_ERR(TAG, "patp=%p", (void*) patp); - return FALSE; - } - - colorB = ReadColor(patp, hdcDest->format); + WLog_ERR(TAG, "patp=%p", (void*)patp); + return FALSE; } - break; + + colorB = ReadColor(patp, hdcDest->format); + } + break; default: break; @@ -340,8 +333,8 @@ static INLINE BOOL BitBlt_write(HGDI_DC hdcDest, HGDI_DC hdcSrc, INT32 nXDest, return WriteColor(dstp, hdcDest->format, dstColor); } -static BOOL adjust_src_coordinates(HGDI_DC hdcSrc, INT32 nWidth, INT32 nHeight, - INT32* px, INT32* py) +static BOOL adjust_src_coordinates(HGDI_DC hdcSrc, INT32 nWidth, INT32 nHeight, INT32* px, + INT32* py) { HGDI_BITMAP hSrcBmp; INT32 nXSrc, nYSrc; @@ -349,7 +342,7 @@ static BOOL adjust_src_coordinates(HGDI_DC hdcSrc, INT32 nWidth, INT32 nHeight, if (!hdcSrc || (nWidth < 0) || (nHeight < 0) || !px || !py) return FALSE; - hSrcBmp = (HGDI_BITMAP) hdcSrc->selectedObject; + hSrcBmp = (HGDI_BITMAP)hdcSrc->selectedObject; nXSrc = *px; nYSrc = *py; @@ -382,8 +375,8 @@ static BOOL adjust_src_coordinates(HGDI_DC hdcSrc, INT32 nWidth, INT32 nHeight, return TRUE; } -static BOOL adjust_src_dst_coordinates(HGDI_DC hdcDest, INT32* pnXSrc, INT32* pnYSrc, - INT32* pnXDst, INT32* pnYDst, INT32* pnWidth, INT32* pnHeight) +static BOOL adjust_src_dst_coordinates(HGDI_DC hdcDest, INT32* pnXSrc, INT32* pnYSrc, INT32* pnXDst, + INT32* pnYDst, INT32* pnWidth, INT32* pnHeight) { HGDI_BITMAP hDstBmp; volatile INT32 diffX, diffY; @@ -393,7 +386,7 @@ static BOOL adjust_src_dst_coordinates(HGDI_DC hdcDest, INT32* pnXSrc, INT32* pn if (!hdcDest || !pnXSrc || !pnYSrc || !pnXDst || !pnYDst || !pnWidth || !pnHeight) return FALSE; - hDstBmp = (HGDI_BITMAP) hdcDest->selectedObject; + hDstBmp = (HGDI_BITMAP)hdcDest->selectedObject; nXSrc = *pnXSrc; nYSrc = *pnYSrc; nXDst = *pnXDst; @@ -445,9 +438,9 @@ static BOOL adjust_src_dst_coordinates(HGDI_DC hdcDest, INT32* pnXSrc, INT32* pn return TRUE; } -static BOOL BitBlt_process(HGDI_DC hdcDest, INT32 nXDest, INT32 nYDest, - INT32 nWidth, INT32 nHeight, HGDI_DC hdcSrc, - INT32 nXSrc, INT32 nYSrc, const char* rop, const gdiPalette* palette) +static BOOL BitBlt_process(HGDI_DC hdcDest, INT32 nXDest, INT32 nYDest, INT32 nWidth, INT32 nHeight, + HGDI_DC hdcSrc, INT32 nXSrc, INT32 nYSrc, const char* rop, + const gdiPalette* palette) { INT32 x, y; UINT32 style = 0; @@ -510,8 +503,7 @@ static BOOL BitBlt_process(HGDI_DC hdcDest, INT32 nXDest, INT32 nYDest, { for (x = nWidth - 1; x >= 0; x--) { - if (!BitBlt_write(hdcDest, hdcSrc, nXDest, nYDest, - nXSrc, nYSrc, x, y, useSrc, + if (!BitBlt_write(hdcDest, hdcSrc, nXDest, nYDest, nXSrc, nYSrc, x, y, useSrc, usePat, style, rop, palette)) return FALSE; } @@ -523,8 +515,7 @@ static BOOL BitBlt_process(HGDI_DC hdcDest, INT32 nXDest, INT32 nYDest, { for (x = nWidth - 1; x >= 0; x--) { - if (!BitBlt_write(hdcDest, hdcSrc, nXDest, nYDest, - nXSrc, nYSrc, x, y, useSrc, + if (!BitBlt_write(hdcDest, hdcSrc, nXDest, nYDest, nXSrc, nYSrc, x, y, useSrc, usePat, style, rop, palette)) return FALSE; } @@ -536,8 +527,7 @@ static BOOL BitBlt_process(HGDI_DC hdcDest, INT32 nXDest, INT32 nYDest, { for (x = 0; x < nWidth; x++) { - if (!BitBlt_write(hdcDest, hdcSrc, nXDest, nYDest, - nXSrc, nYSrc, x, y, useSrc, + if (!BitBlt_write(hdcDest, hdcSrc, nXDest, nYDest, nXSrc, nYSrc, x, y, useSrc, usePat, style, rop, palette)) return FALSE; } @@ -549,8 +539,7 @@ static BOOL BitBlt_process(HGDI_DC hdcDest, INT32 nXDest, INT32 nYDest, { for (x = 0; x < nWidth; x++) { - if (!BitBlt_write(hdcDest, hdcSrc, nXDest, nYDest, - nXSrc, nYSrc, x, y, useSrc, + if (!BitBlt_write(hdcDest, hdcSrc, nXDest, nYDest, nXSrc, nYSrc, x, y, useSrc, usePat, style, rop, palette)) return FALSE; } @@ -574,17 +563,15 @@ static BOOL BitBlt_process(HGDI_DC hdcDest, INT32 nXDest, INT32 nYDest, * @param rop raster operation code * @return 0 on failure, non-zero otherwise */ -BOOL gdi_BitBlt(HGDI_DC hdcDest, INT32 nXDest, INT32 nYDest, - INT32 nWidth, INT32 nHeight, HGDI_DC hdcSrc, - INT32 nXSrc, INT32 nYSrc, DWORD rop, const gdiPalette* palette) +BOOL gdi_BitBlt(HGDI_DC hdcDest, INT32 nXDest, INT32 nYDest, INT32 nWidth, INT32 nHeight, + HGDI_DC hdcSrc, INT32 nXSrc, INT32 nYSrc, DWORD rop, const gdiPalette* palette) { HGDI_BITMAP hSrcBmp, hDstBmp; if (!hdcDest) return FALSE; - if (!gdi_ClipCoords(hdcDest, &nXDest, &nYDest, &nWidth, &nHeight, &nXSrc, - &nYSrc)) + if (!gdi_ClipCoords(hdcDest, &nXDest, &nYDest, &nWidth, &nHeight, &nXSrc, &nYSrc)) return TRUE; /* Check which ROP should be performed. @@ -599,30 +586,32 @@ BOOL gdi_BitBlt(HGDI_DC hdcDest, INT32 nXDest, INT32 nYDest, if (!hdcSrc) return FALSE; - if (!adjust_src_dst_coordinates(hdcDest, &nXSrc, &nYSrc, &nXDest, &nYDest, &nWidth, &nHeight)) + if (!adjust_src_dst_coordinates(hdcDest, &nXSrc, &nYSrc, &nXDest, &nYDest, &nWidth, + &nHeight)) return FALSE; if (!adjust_src_coordinates(hdcSrc, nWidth, nHeight, &nXSrc, &nYSrc)) return FALSE; - hSrcBmp = (HGDI_BITMAP) hdcSrc->selectedObject; - hDstBmp = (HGDI_BITMAP) hdcDest->selectedObject; + hSrcBmp = (HGDI_BITMAP)hdcSrc->selectedObject; + hDstBmp = (HGDI_BITMAP)hdcDest->selectedObject; if (!hSrcBmp || !hDstBmp) return FALSE; - if (!freerdp_image_copy(hDstBmp->data, hDstBmp->format, hDstBmp->scanline, - nXDest, nYDest, nWidth, nHeight, - hSrcBmp->data, hSrcBmp->format, hSrcBmp->scanline, nXSrc, nYSrc, palette, FREERDP_FLIP_NONE)) + if (!freerdp_image_copy(hDstBmp->data, hDstBmp->format, hDstBmp->scanline, nXDest, + nYDest, nWidth, nHeight, hSrcBmp->data, hSrcBmp->format, + hSrcBmp->scanline, nXSrc, nYSrc, palette, FREERDP_FLIP_NONE)) return FALSE; break; case GDI_DSTCOPY: - hSrcBmp = (HGDI_BITMAP) hdcDest->selectedObject; - hDstBmp = (HGDI_BITMAP) hdcDest->selectedObject; + hSrcBmp = (HGDI_BITMAP)hdcDest->selectedObject; + hDstBmp = (HGDI_BITMAP)hdcDest->selectedObject; - if (!adjust_src_dst_coordinates(hdcDest, &nXSrc, &nYSrc, &nXDest, &nYDest, &nWidth, &nHeight)) + if (!adjust_src_dst_coordinates(hdcDest, &nXSrc, &nYSrc, &nXDest, &nYDest, &nWidth, + &nHeight)) return FALSE; if (!adjust_src_coordinates(hdcDest, nWidth, nHeight, &nXSrc, &nYSrc)) @@ -631,17 +620,16 @@ BOOL gdi_BitBlt(HGDI_DC hdcDest, INT32 nXDest, INT32 nYDest, if (!hSrcBmp || !hDstBmp) return FALSE; - if (!freerdp_image_copy(hDstBmp->data, hDstBmp->format, hDstBmp->scanline, - nXDest, nYDest, nWidth, nHeight, - hSrcBmp->data, hSrcBmp->format, hSrcBmp->scanline, nXSrc, nYSrc, palette, FREERDP_FLIP_NONE)) + if (!freerdp_image_copy(hDstBmp->data, hDstBmp->format, hDstBmp->scanline, nXDest, + nYDest, nWidth, nHeight, hSrcBmp->data, hSrcBmp->format, + hSrcBmp->scanline, nXSrc, nYSrc, palette, FREERDP_FLIP_NONE)) return FALSE; break; default: - if (!BitBlt_process(hdcDest, nXDest, nYDest, - nWidth, nHeight, hdcSrc, - nXSrc, nYSrc, gdi_rop_to_string(rop), palette)) + if (!BitBlt_process(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, + gdi_rop_to_string(rop), palette)) return FALSE; break; diff --git a/libfreerdp/gdi/brush.c b/libfreerdp/gdi/brush.c index db904954b..aa27cea3c 100644 --- a/libfreerdp/gdi/brush.c +++ b/libfreerdp/gdi/brush.c @@ -819,14 +819,14 @@ const char* gdi_rop_to_string(UINT32 code) } /** -* Create a new solid brush.\n -* @msdn{dd183518} -* @param crColor brush color -* @return new brush -*/ + * Create a new solid brush.\n + * @msdn{dd183518} + * @param crColor brush color + * @return new brush + */ HGDI_BRUSH gdi_CreateSolidBrush(UINT32 crColor) { - HGDI_BRUSH hBrush = (HGDI_BRUSH) calloc(1, sizeof(GDI_BRUSH)); + HGDI_BRUSH hBrush = (HGDI_BRUSH)calloc(1, sizeof(GDI_BRUSH)); if (!hBrush) return NULL; @@ -837,14 +837,14 @@ HGDI_BRUSH gdi_CreateSolidBrush(UINT32 crColor) return hBrush; } /** -* Create a new pattern brush.\n -* @msdn{dd183508} -* @param hbmp pattern bitmap -* @return new brush -*/ + * Create a new pattern brush.\n + * @msdn{dd183508} + * @param hbmp pattern bitmap + * @return new brush + */ HGDI_BRUSH gdi_CreatePatternBrush(HGDI_BITMAP hbmp) { - HGDI_BRUSH hBrush = (HGDI_BRUSH) calloc(1, sizeof(GDI_BRUSH)); + HGDI_BRUSH hBrush = (HGDI_BRUSH)calloc(1, sizeof(GDI_BRUSH)); if (!hBrush) return NULL; @@ -856,7 +856,7 @@ HGDI_BRUSH gdi_CreatePatternBrush(HGDI_BITMAP hbmp) } HGDI_BRUSH gdi_CreateHatchBrush(HGDI_BITMAP hbmp) { - HGDI_BRUSH hBrush = (HGDI_BRUSH) calloc(1, sizeof(GDI_BRUSH)); + HGDI_BRUSH hBrush = (HGDI_BRUSH)calloc(1, sizeof(GDI_BRUSH)); if (!hBrush) return NULL; @@ -866,4 +866,3 @@ HGDI_BRUSH gdi_CreateHatchBrush(HGDI_BITMAP hbmp) hBrush->pattern = hbmp; return hBrush; } - diff --git a/libfreerdp/gdi/brush.h b/libfreerdp/gdi/brush.h index 0be63660f..b7e86c2fc 100644 --- a/libfreerdp/gdi/brush.h +++ b/libfreerdp/gdi/brush.h @@ -26,22 +26,23 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_LOCAL const char* gdi_rop_to_string(UINT32 code); + FREERDP_LOCAL const char* gdi_rop_to_string(UINT32 code); -FREERDP_LOCAL HGDI_BRUSH gdi_CreateSolidBrush(UINT32 crColor); -FREERDP_LOCAL HGDI_BRUSH gdi_CreatePatternBrush(HGDI_BITMAP hbmp); -FREERDP_LOCAL HGDI_BRUSH gdi_CreateHatchBrush(HGDI_BITMAP hbmp); + FREERDP_LOCAL HGDI_BRUSH gdi_CreateSolidBrush(UINT32 crColor); + FREERDP_LOCAL HGDI_BRUSH gdi_CreatePatternBrush(HGDI_BITMAP hbmp); + FREERDP_LOCAL HGDI_BRUSH gdi_CreateHatchBrush(HGDI_BITMAP hbmp); -static INLINE UINT32 gdi_GetBrushStyle(HGDI_DC hdc) -{ - if (!hdc || !hdc->brush) - return GDI_BS_NULL; + static INLINE UINT32 gdi_GetBrushStyle(HGDI_DC hdc) + { + if (!hdc || !hdc->brush) + return GDI_BS_NULL; - return hdc->brush->style; -} + return hdc->brush->style; + } #ifdef __cplusplus } diff --git a/libfreerdp/gdi/clipping.c b/libfreerdp/gdi/clipping.c index a4ceb90d7..584224970 100644 --- a/libfreerdp/gdi/clipping.c +++ b/libfreerdp/gdi/clipping.c @@ -34,8 +34,7 @@ #include "clipping.h" -BOOL gdi_SetClipRgn(HGDI_DC hdc, INT32 nXLeft, INT32 nYLeft, INT32 nWidth, - INT32 nHeight) +BOOL gdi_SetClipRgn(HGDI_DC hdc, INT32 nXLeft, INT32 nYLeft, INT32 nWidth, INT32 nHeight) { return gdi_SetRgn(hdc->clip, nXLeft, nYLeft, nWidth, nHeight); } @@ -77,8 +76,7 @@ BOOL gdi_SetNullClipRgn(HGDI_DC hdc) * @return nonzero if there is something to draw, 0 otherwise */ -BOOL gdi_ClipCoords(HGDI_DC hdc, INT32* x, INT32* y, INT32* w, INT32* h, - INT32* srcx, INT32* srcy) +BOOL gdi_ClipCoords(HGDI_DC hdc, INT32* x, INT32* y, INT32* w, INT32* h, INT32* srcx, INT32* srcy) { GDI_RECT bmp; GDI_RECT clip; @@ -91,7 +89,7 @@ BOOL gdi_ClipCoords(HGDI_DC hdc, INT32* x, INT32* y, INT32* w, INT32* h, if (hdc == NULL) return FALSE; - hBmp = (HGDI_BITMAP) hdc->selectedObject; + hBmp = (HGDI_BITMAP)hdc->selectedObject; if (hBmp != NULL) { @@ -124,8 +122,8 @@ BOOL gdi_ClipCoords(HGDI_DC hdc, INT32* x, INT32* y, INT32* w, INT32* h, gdi_CRgnToRect(*x, *y, *w, *h, &coords); - if (coords.right >= clip.left && coords.left <= clip.right && - coords.bottom >= clip.top && coords.top <= clip.bottom) + if (coords.right >= clip.left && coords.left <= clip.right && coords.bottom >= clip.top && + coords.top <= clip.bottom) { /* coordinates overlap with clipping region */ if (coords.left < clip.left) diff --git a/libfreerdp/gdi/clipping.h b/libfreerdp/gdi/clipping.h index 1ba36a32a..d4546fb64 100644 --- a/libfreerdp/gdi/clipping.h +++ b/libfreerdp/gdi/clipping.h @@ -26,15 +26,16 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_LOCAL BOOL gdi_SetClipRgn(HGDI_DC hdc, INT32 nXLeft, INT32 nYLeft, - INT32 nWidth, INT32 nHeight); -FREERDP_LOCAL HGDI_RGN gdi_GetClipRgn(HGDI_DC hdc); -FREERDP_LOCAL BOOL gdi_SetNullClipRgn(HGDI_DC hdc); -FREERDP_LOCAL BOOL gdi_ClipCoords(HGDI_DC hdc, INT32* x, INT32* y, - INT32* w, INT32* h, INT32* srcx, INT32* srcy); + FREERDP_LOCAL BOOL gdi_SetClipRgn(HGDI_DC hdc, INT32 nXLeft, INT32 nYLeft, INT32 nWidth, + INT32 nHeight); + FREERDP_LOCAL HGDI_RGN gdi_GetClipRgn(HGDI_DC hdc); + FREERDP_LOCAL BOOL gdi_SetNullClipRgn(HGDI_DC hdc); + FREERDP_LOCAL BOOL gdi_ClipCoords(HGDI_DC hdc, INT32* x, INT32* y, INT32* w, INT32* h, + INT32* srcx, INT32* srcy); #ifdef __cplusplus } diff --git a/libfreerdp/gdi/dc.c b/libfreerdp/gdi/dc.c index a2dd5ba20..7beef155d 100644 --- a/libfreerdp/gdi/dc.c +++ b/libfreerdp/gdi/dc.c @@ -43,7 +43,7 @@ HGDI_DC gdi_GetDC(void) { - HGDI_DC hDC = (HGDI_DC) calloc(1, sizeof(GDI_DC)); + HGDI_DC hDC = (HGDI_DC)calloc(1, sizeof(GDI_DC)); if (!hDC) return NULL; @@ -73,7 +73,7 @@ HGDI_DC gdi_CreateDC(UINT32 format) { HGDI_DC hDC; - if (!(hDC = (HGDI_DC) calloc(1, sizeof(GDI_DC)))) + if (!(hDC = (HGDI_DC)calloc(1, sizeof(GDI_DC)))) return NULL; hDC->drawMode = GDI_R2_BLACK; @@ -85,7 +85,7 @@ HGDI_DC gdi_CreateDC(UINT32 format) hDC->hwnd = NULL; hDC->format = format; - if (!(hDC->hwnd = (HGDI_WND) calloc(1, sizeof(GDI_WND)))) + if (!(hDC->hwnd = (HGDI_WND)calloc(1, sizeof(GDI_WND)))) goto fail; if (!(hDC->hwnd->invalid = gdi_CreateRectRgn(0, 0, 0, 0))) @@ -94,8 +94,7 @@ HGDI_DC gdi_CreateDC(UINT32 format) hDC->hwnd->invalid->null = TRUE; hDC->hwnd->count = 32; - if (!(hDC->hwnd->cinvalid = (HGDI_RGN) calloc(hDC->hwnd->count, - sizeof(GDI_RGN)))) + if (!(hDC->hwnd->cinvalid = (HGDI_RGN)calloc(hDC->hwnd->count, sizeof(GDI_RGN)))) goto fail; hDC->hwnd->ninvalid = 0; @@ -114,7 +113,7 @@ fail: HGDI_DC gdi_CreateCompatibleDC(HGDI_DC hdc) { - HGDI_DC hDC = (HGDI_DC) calloc(1, sizeof(GDI_DC)); + HGDI_DC hDC = (HGDI_DC)calloc(1, sizeof(GDI_DC)); if (!hDC) return NULL; @@ -153,23 +152,23 @@ HGDIOBJECT gdi_SelectObject(HGDI_DC hdc, HGDIOBJECT hgdiobject) } else if (hgdiobject->objectType == GDIOBJECT_PEN) { - previousSelectedObject = (HGDIOBJECT) hdc->pen; - hdc->pen = (HGDI_PEN) hgdiobject; + previousSelectedObject = (HGDIOBJECT)hdc->pen; + hdc->pen = (HGDI_PEN)hgdiobject; } else if (hgdiobject->objectType == GDIOBJECT_BRUSH) { - previousSelectedObject = (HGDIOBJECT) hdc->brush; - hdc->brush = (HGDI_BRUSH) hgdiobject; + previousSelectedObject = (HGDIOBJECT)hdc->brush; + hdc->brush = (HGDI_BRUSH)hgdiobject; } else if (hgdiobject->objectType == GDIOBJECT_REGION) { hdc->selectedObject = hgdiobject; - previousSelectedObject = (HGDIOBJECT) COMPLEXREGION; + previousSelectedObject = (HGDIOBJECT)COMPLEXREGION; } else if (hgdiobject->objectType == GDIOBJECT_RECT) { hdc->selectedObject = hgdiobject; - previousSelectedObject = (HGDIOBJECT) SIMPLEREGION; + previousSelectedObject = (HGDIOBJECT)SIMPLEREGION; } else { @@ -194,7 +193,7 @@ BOOL gdi_DeleteObject(HGDIOBJECT hgdiobject) if (hgdiobject->objectType == GDIOBJECT_BITMAP) { - HGDI_BITMAP hBitmap = (HGDI_BITMAP) hgdiobject; + HGDI_BITMAP hBitmap = (HGDI_BITMAP)hgdiobject; if (hBitmap->data && hBitmap->free) { @@ -206,12 +205,12 @@ BOOL gdi_DeleteObject(HGDIOBJECT hgdiobject) } else if (hgdiobject->objectType == GDIOBJECT_PEN) { - HGDI_PEN hPen = (HGDI_PEN) hgdiobject; + HGDI_PEN hPen = (HGDI_PEN)hgdiobject; free(hPen); } else if (hgdiobject->objectType == GDIOBJECT_BRUSH) { - HGDI_BRUSH hBrush = (HGDI_BRUSH) hgdiobject; + HGDI_BRUSH hBrush = (HGDI_BRUSH)hgdiobject; free(hBrush); } else if (hgdiobject->objectType == GDIOBJECT_REGION) @@ -232,7 +231,6 @@ BOOL gdi_DeleteObject(HGDIOBJECT hgdiobject) return TRUE; } - /** * Delete device context.\n * @msdn{dd183533} diff --git a/libfreerdp/gdi/drawing.c b/libfreerdp/gdi/drawing.c index dbbeb7a1c..c379cf7f5 100644 --- a/libfreerdp/gdi/drawing.c +++ b/libfreerdp/gdi/drawing.c @@ -112,7 +112,6 @@ UINT32 gdi_GetBkMode(HGDI_DC hdc) * @return previous background mode on success, 0 on failure */ - INT32 gdi_SetBkMode(HGDI_DC hdc, INT32 iBkMode) { if (iBkMode == GDI_OPAQUE || iBkMode == GDI_TRANSPARENT) diff --git a/libfreerdp/gdi/drawing.h b/libfreerdp/gdi/drawing.h index bc3c1cecb..96bdf65a4 100644 --- a/libfreerdp/gdi/drawing.h +++ b/libfreerdp/gdi/drawing.h @@ -26,16 +26,17 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_LOCAL INT32 gdi_GetROP2(HGDI_DC hdc); -FREERDP_LOCAL INT32 gdi_SetROP2(HGDI_DC hdc, INT32 fnDrawMode); -FREERDP_LOCAL UINT32 gdi_GetBkColor(HGDI_DC hdc); -FREERDP_LOCAL UINT32 gdi_SetBkColor(HGDI_DC hdc, UINT32 crColor); -FREERDP_LOCAL UINT32 gdi_GetBkMode(HGDI_DC hdc); -FREERDP_LOCAL INT32 gdi_SetBkMode(HGDI_DC hdc, INT32 iBkMode); -FREERDP_LOCAL UINT32 gdi_SetTextColor(HGDI_DC hdc, UINT32 crColor); + FREERDP_LOCAL INT32 gdi_GetROP2(HGDI_DC hdc); + FREERDP_LOCAL INT32 gdi_SetROP2(HGDI_DC hdc, INT32 fnDrawMode); + FREERDP_LOCAL UINT32 gdi_GetBkColor(HGDI_DC hdc); + FREERDP_LOCAL UINT32 gdi_SetBkColor(HGDI_DC hdc, UINT32 crColor); + FREERDP_LOCAL UINT32 gdi_GetBkMode(HGDI_DC hdc); + FREERDP_LOCAL INT32 gdi_SetBkMode(HGDI_DC hdc, INT32 iBkMode); + FREERDP_LOCAL UINT32 gdi_SetTextColor(HGDI_DC hdc, UINT32 crColor); #ifdef __cplusplus } diff --git a/libfreerdp/gdi/gdi.c b/libfreerdp/gdi/gdi.c index 22cae564d..bcb2eee08 100644 --- a/libfreerdp/gdi/gdi.c +++ b/libfreerdp/gdi/gdi.c @@ -55,279 +55,274 @@ typedef struct const char* name; } rop_table_entry; -static const rop_table_entry rop3_code_table[] = -{ - { GDI_BLACKNESS, "0" }, - { GDI_DPSoon, "DPSoon" }, - { GDI_DPSona, "DPSona" }, - { GDI_PSon, "PSon" }, - { GDI_SDPona, "SDPona" }, - { GDI_DPon, "DPon" }, - { GDI_PDSxnon, "PDSxnon" }, - { GDI_PDSaon, "PDSaon" }, - { GDI_SDPnaa, "SDPnaa" }, - { GDI_PDSxon, "PDSxon" }, - { GDI_DPna, "DPna" }, - { GDI_PSDnaon, "PSDnaon" }, - { GDI_SPna, "SPna" }, - { GDI_PDSnaon, "PDSnaon" }, - { GDI_PDSonon, "PDSonon" }, - { GDI_Pn , "Pn" }, - { GDI_PDSona, "PDSona" }, - { GDI_NOTSRCERASE, "DSon" }, - { GDI_SDPxnon, "SDPxnon" }, - { GDI_SDPaon, "SDPaon" }, - { GDI_DPSxnon, "DPSxnon" }, - { GDI_DPSaon, "DPSaon" }, - { GDI_PSDPSanaxx, "PSDPSanaxx" }, - { GDI_SSPxDSxaxn, "SSPxDSxaxn" }, - { GDI_SPxPDxa, "SPxPDxa" }, - { GDI_SDPSanaxn, "SDPSanaxn" }, - { GDI_PDSPaox, "PDSPaox" }, - { GDI_SDPSxaxn, "SDPSxaxn" }, - { GDI_PSDPaox, "PSDPaox" }, - { GDI_DSPDxaxn, "DSPDxaxn" }, - { GDI_PDSox, "PDSox" }, - { GDI_PDSoan, "PDSoan" }, - { GDI_DPSnaa, "DPSnaa" }, - { GDI_SDPxon, "SDPxon" }, - { GDI_DSna, "DSna" }, - { GDI_SPDnaon, "SPDnaon" }, - { GDI_SPxDSxa, "SPxDSxa" }, - { GDI_PDSPanaxn, "PDSPanaxn" }, - { GDI_SDPSaox, "SDPSaox" }, - { GDI_SDPSxnox, "SDPSxnox" }, - { GDI_DPSxa, "DPSxa" }, - { GDI_PSDPSaoxxn, "PSDPSaoxxn" }, - { GDI_DPSana, "DPSana" }, - { GDI_SSPxPDxaxn, "SSPxPDxaxn" }, - { GDI_SPDSoax, "SPDSoax" }, - { GDI_PSDnox, "PSDnox" }, - { GDI_PSDPxox, "PSDPxox" }, - { GDI_PSDnoan, "PSDnoan" }, - { GDI_PSna, "PSna" }, - { GDI_SDPnaon, "SDPnaon" }, - { GDI_SDPSoox, "SDPSoox" }, - { GDI_NOTSRCCOPY, "Sn" }, - { GDI_SPDSaox, "SPDSaox" }, - { GDI_SPDSxnox, "SPDSxnox" }, - { GDI_SDPox, "SDPox" }, - { GDI_SDPoan, "SDPoan" }, - { GDI_PSDPoax, "PSDPoax" }, - { GDI_SPDnox, "SPDnox" }, - { GDI_SPDSxox, "SPDSxox" }, - { GDI_SPDnoan, "SPDnoan" }, - { GDI_PSx , "PSx" }, - { GDI_SPDSonox, "SPDSonox" }, - { GDI_SPDSnaox, "SPDSnaox" }, - { GDI_PSan, "PSan" }, - { GDI_PSDnaa, "PSDnaa" }, - { GDI_DPSxon, "DPSxon" }, - { GDI_SDxPDxa, "SDxPDxa" }, - { GDI_SPDSanaxn, "SPDSanaxn" }, - { GDI_SRCERASE, "SDna" }, - { GDI_DPSnaon, "DPSnaon" }, - { GDI_DSPDaox, "DSPDaox" }, - { GDI_PSDPxaxn, "PSDPxaxn" }, - { GDI_SDPxa, "SDPxa" }, - { GDI_PDSPDaoxxn, "PDSPDaoxxn" }, - { GDI_DPSDoax, "DPSDoax" }, - { GDI_PDSnox, "PDSnox" }, - { GDI_SDPana, "SDPana" }, - { GDI_SSPxDSxoxn, "SSPxDSxoxn" }, - { GDI_PDSPxox, "PDSPxox" }, - { GDI_PDSnoan, "PDSnoan" }, - { GDI_PDna, "PDna" }, - { GDI_DSPnaon, "DSPnaon" }, - { GDI_DPSDaox, "DPSDaox" }, - { GDI_SPDSxaxn, "SPDSxaxn" }, - { GDI_DPSonon, "DPSonon" }, - { GDI_DSTINVERT, "Dn" }, - { GDI_DPSox, "DPSox" }, - { GDI_DPSoan, "DPSoan" }, - { GDI_PDSPoax, "PDSPoax" }, - { GDI_DPSnox, "DPSnox" }, - { GDI_PATINVERT, "DPx" }, - { GDI_DPSDonox, "DPSDonox" }, - { GDI_DPSDxox, "DPSDxox" }, - { GDI_DPSnoan, "DPSnoan" }, - { GDI_DPSDnaox, "DPSDnaox" }, - { GDI_DPan, "DPan" }, - { GDI_PDSxa, "PDSxa" }, - { GDI_DSPDSaoxxn, "DSPDSaoxxn" }, - { GDI_DSPDoax, "DSPDoax" }, - { GDI_SDPnox, "SDPnox" }, - { GDI_SDPSoax, "SDPSoax" }, - { GDI_DSPnox, "DSPnox" }, - { GDI_SRCINVERT, "DSx" }, - { GDI_SDPSonox, "SDPSonox" }, - { GDI_DSPDSonoxxn, "DSPDSonoxxn" }, - { GDI_PDSxxn, "PDSxxn" }, - { GDI_DPSax, "DPSax" }, - { GDI_PSDPSoaxxn, "PSDPSoaxxn" }, - { GDI_SDPax, "SDPax" }, - { GDI_PDSPDoaxxn, "PDSPDoaxxn" }, - { GDI_SDPSnoax, "SDPSnoax" }, - { GDI_PDSxnan, "PDSxnan" }, - { GDI_PDSana, "PDSana" }, - { GDI_SSDxPDxaxn, "SSDxPDxaxn" }, - { GDI_SDPSxox, "SDPSxox" }, - { GDI_SDPnoan, "SDPnoan" }, - { GDI_DSPDxox, "DSPDxox" }, - { GDI_DSPnoan, "DSPnoan" }, - { GDI_SDPSnaox, "SDPSnaox" }, - { GDI_DSan, "DSan" }, - { GDI_PDSax, "PDSax" }, - { GDI_DSPDSoaxxn, "DSPDSoaxxn" }, - { GDI_DPSDnoax, "DPSDnoax" }, - { GDI_SDPxnan, "SDPxnan" }, - { GDI_SPDSnoax, "SPDSnoax" }, - { GDI_DPSxnan, "DPSxnan" }, - { GDI_SPxDSxo, "SPxDSxo" }, - { GDI_DPSaan, "DPSaan" }, - { GDI_DPSaa, "DPSaa" }, - { GDI_SPxDSxon, "SPxDSxon" }, - { GDI_DPSxna, "DPSxna" }, - { GDI_SPDSnoaxn, "SPDSnoaxn" }, - { GDI_SDPxna, "SDPxna" }, - { GDI_PDSPnoaxn, "PDSPnoaxn" }, - { GDI_DSPDSoaxx, "DSPDSoaxx" }, - { GDI_PDSaxn, "PDSaxn" }, - { GDI_SRCAND, "DSa" }, - { GDI_SDPSnaoxn, "SDPSnaoxn" }, - { GDI_DSPnoa, "DSPnoa" }, - { GDI_DSPDxoxn, "DSPDxoxn" }, - { GDI_SDPnoa, "SDPnoa" }, - { GDI_SDPSxoxn, "SDPSxoxn" }, - { GDI_SSDxPDxax, "SSDxPDxax" }, - { GDI_PDSanan, "PDSanan" }, - { GDI_PDSxna, "PDSxna" }, - { GDI_SDPSnoaxn, "SDPSnoaxn" }, - { GDI_DPSDPoaxx, "DPSDPoaxx" }, - { GDI_SPDaxn, "SPDaxn" }, - { GDI_PSDPSoaxx, "PSDPSoaxx" }, - { GDI_DPSaxn, "DPSaxn" }, - { GDI_DPSxx, "DPSxx" }, - { GDI_PSDPSonoxx, "PSDPSonoxx" }, - { GDI_SDPSonoxn, "SDPSonoxn" }, - { GDI_DSxn, "DSxn" }, - { GDI_DPSnax, "DPSnax" }, - { GDI_SDPSoaxn, "SDPSoaxn" }, - { GDI_SPDnax, "SPDnax" }, - { GDI_DSPDoaxn, "DSPDoaxn" }, - { GDI_DSPDSaoxx, "DSPDSaoxx" }, - { GDI_PDSxan, "PDSxan" }, - { GDI_DPa , "DPa" }, - { GDI_PDSPnaoxn, "PDSPnaoxn" }, - { GDI_DPSnoa, "DPSnoa" }, - { GDI_DPSDxoxn, "DPSDxoxn" }, - { GDI_PDSPonoxn, "PDSPonoxn" }, - { GDI_PDxn, "PDxn" }, - { GDI_DSPnax, "DSPnax" }, - { GDI_PDSPoaxn, "PDSPoaxn" }, - { GDI_DPSoa, "DPSoa" }, - { GDI_DPSoxn, "DPSoxn" }, - { GDI_DSTCOPY, "D" }, - { GDI_DPSono, "DPSono" }, - { GDI_SPDSxax, "SPDSxax" }, - { GDI_DPSDaoxn, "DPSDaoxn" }, - { GDI_DSPnao, "DSPnao" }, - { GDI_DPno, "DPno" }, - { GDI_PDSnoa, "PDSnoa" }, - { GDI_PDSPxoxn, "PDSPxoxn" }, - { GDI_SSPxDSxox, "SSPxDSxox" }, - { GDI_SDPanan, "SDPanan" }, - { GDI_PSDnax, "PSDnax" }, - { GDI_DPSDoaxn, "DPSDoaxn" }, - { GDI_DPSDPaoxx, "DPSDPaoxx" }, - { GDI_SDPxan, "SDPxan" }, - { GDI_PSDPxax, "PSDPxax" }, - { GDI_DSPDaoxn, "DSPDaoxn" }, - { GDI_DPSnao, "DPSnao" }, - { GDI_MERGEPAINT, "DSno" }, - { GDI_SPDSanax, "SPDSanax" }, - { GDI_SDxPDxan, "SDxPDxan" }, - { GDI_DPSxo, "DPSxo" }, - { GDI_DPSano, "DPSano" }, - { GDI_MERGECOPY, "PSa" }, - { GDI_SPDSnaoxn, "SPDSnaoxn" }, - { GDI_SPDSonoxn, "SPDSonoxn" }, - { GDI_PSxn, "PSxn" }, - { GDI_SPDnoa, "SPDnoa" }, - { GDI_SPDSxoxn, "SPDSxoxn" }, - { GDI_SDPnax, "SDPnax" }, - { GDI_PSDPoaxn, "PSDPoaxn" }, - { GDI_SDPoa, "SDPoa" }, - { GDI_SPDoxn, "SPDoxn" }, - { GDI_DPSDxax, "DPSDxax" }, - { GDI_SPDSaoxn, "SPDSaoxn" }, - { GDI_SRCCOPY, "S" }, - { GDI_SDPono, "SDPono" }, - { GDI_SDPnao, "SDPnao" }, - { GDI_SPno, "SPno" }, - { GDI_PSDnoa, "PSDnoa" }, - { GDI_PSDPxoxn, "PSDPxoxn" }, - { GDI_PDSnax, "PDSnax" }, - { GDI_SPDSoaxn, "SPDSoaxn" }, - { GDI_SSPxPDxax, "SSPxPDxax" }, - { GDI_DPSanan, "DPSanan" }, - { GDI_PSDPSaoxx, "PSDPSaoxx" }, - { GDI_DPSxan, "DPSxan" }, - { GDI_PDSPxax, "PDSPxax" }, - { GDI_SDPSaoxn, "SDPSaoxn" }, - { GDI_DPSDanax, "DPSDanax" }, - { GDI_SPxDSxan, "SPxDSxan" }, - { GDI_SPDnao, "SPDnao" }, - { GDI_SDno, "SDno" }, - { GDI_SDPxo, "SDPxo" }, - { GDI_SDPano, "SDPano" }, - { GDI_PDSoa, "PDSoa" }, - { GDI_PDSoxn, "PDSoxn" }, - { GDI_DSPDxax, "DSPDxax" }, - { GDI_PSDPaoxn, "PSDPaoxn" }, - { GDI_SDPSxax, "SDPSxax" }, - { GDI_PDSPaoxn, "PDSPaoxn" }, - { GDI_SDPSanax, "SDPSanax" }, - { GDI_SPxPDxan, "SPxPDxan" }, - { GDI_SSPxDSxax, "SSPxDSxax" }, - { GDI_DSPDSanaxxn, "DSPDSanaxxn" }, - { GDI_DPSao, "DPSao" }, - { GDI_DPSxno, "DPSxno" }, - { GDI_SDPao, "SDPao" }, - { GDI_SDPxno, "SDPxno" }, - { GDI_SRCPAINT, "DSo" }, - { GDI_SDPnoo, "SDPnoo" }, - { GDI_PATCOPY, "P" }, - { GDI_PDSono, "PDSono" }, - { GDI_PDSnao, "PDSnao" }, - { GDI_PSno, "PSno" }, - { GDI_PSDnao, "PSDnao" }, - { GDI_PDno, "PDno" }, - { GDI_PDSxo, "PDSxo" }, - { GDI_PDSano, "PDSano" }, - { GDI_PDSao, "PDSao" }, - { GDI_PDSxno, "PDSxno" }, - { GDI_DPo , "DPo" }, - { GDI_PATPAINT, "DPSnoo" }, - { GDI_PSo , "PSo" }, - { GDI_PSDnoo, "PSDnoo" }, - { GDI_DPSoo, "DPSoo" }, - { GDI_WHITENESS, "1" } -}; +static const rop_table_entry rop3_code_table[] = { { GDI_BLACKNESS, "0" }, + { GDI_DPSoon, "DPSoon" }, + { GDI_DPSona, "DPSona" }, + { GDI_PSon, "PSon" }, + { GDI_SDPona, "SDPona" }, + { GDI_DPon, "DPon" }, + { GDI_PDSxnon, "PDSxnon" }, + { GDI_PDSaon, "PDSaon" }, + { GDI_SDPnaa, "SDPnaa" }, + { GDI_PDSxon, "PDSxon" }, + { GDI_DPna, "DPna" }, + { GDI_PSDnaon, "PSDnaon" }, + { GDI_SPna, "SPna" }, + { GDI_PDSnaon, "PDSnaon" }, + { GDI_PDSonon, "PDSonon" }, + { GDI_Pn, "Pn" }, + { GDI_PDSona, "PDSona" }, + { GDI_NOTSRCERASE, "DSon" }, + { GDI_SDPxnon, "SDPxnon" }, + { GDI_SDPaon, "SDPaon" }, + { GDI_DPSxnon, "DPSxnon" }, + { GDI_DPSaon, "DPSaon" }, + { GDI_PSDPSanaxx, "PSDPSanaxx" }, + { GDI_SSPxDSxaxn, "SSPxDSxaxn" }, + { GDI_SPxPDxa, "SPxPDxa" }, + { GDI_SDPSanaxn, "SDPSanaxn" }, + { GDI_PDSPaox, "PDSPaox" }, + { GDI_SDPSxaxn, "SDPSxaxn" }, + { GDI_PSDPaox, "PSDPaox" }, + { GDI_DSPDxaxn, "DSPDxaxn" }, + { GDI_PDSox, "PDSox" }, + { GDI_PDSoan, "PDSoan" }, + { GDI_DPSnaa, "DPSnaa" }, + { GDI_SDPxon, "SDPxon" }, + { GDI_DSna, "DSna" }, + { GDI_SPDnaon, "SPDnaon" }, + { GDI_SPxDSxa, "SPxDSxa" }, + { GDI_PDSPanaxn, "PDSPanaxn" }, + { GDI_SDPSaox, "SDPSaox" }, + { GDI_SDPSxnox, "SDPSxnox" }, + { GDI_DPSxa, "DPSxa" }, + { GDI_PSDPSaoxxn, "PSDPSaoxxn" }, + { GDI_DPSana, "DPSana" }, + { GDI_SSPxPDxaxn, "SSPxPDxaxn" }, + { GDI_SPDSoax, "SPDSoax" }, + { GDI_PSDnox, "PSDnox" }, + { GDI_PSDPxox, "PSDPxox" }, + { GDI_PSDnoan, "PSDnoan" }, + { GDI_PSna, "PSna" }, + { GDI_SDPnaon, "SDPnaon" }, + { GDI_SDPSoox, "SDPSoox" }, + { GDI_NOTSRCCOPY, "Sn" }, + { GDI_SPDSaox, "SPDSaox" }, + { GDI_SPDSxnox, "SPDSxnox" }, + { GDI_SDPox, "SDPox" }, + { GDI_SDPoan, "SDPoan" }, + { GDI_PSDPoax, "PSDPoax" }, + { GDI_SPDnox, "SPDnox" }, + { GDI_SPDSxox, "SPDSxox" }, + { GDI_SPDnoan, "SPDnoan" }, + { GDI_PSx, "PSx" }, + { GDI_SPDSonox, "SPDSonox" }, + { GDI_SPDSnaox, "SPDSnaox" }, + { GDI_PSan, "PSan" }, + { GDI_PSDnaa, "PSDnaa" }, + { GDI_DPSxon, "DPSxon" }, + { GDI_SDxPDxa, "SDxPDxa" }, + { GDI_SPDSanaxn, "SPDSanaxn" }, + { GDI_SRCERASE, "SDna" }, + { GDI_DPSnaon, "DPSnaon" }, + { GDI_DSPDaox, "DSPDaox" }, + { GDI_PSDPxaxn, "PSDPxaxn" }, + { GDI_SDPxa, "SDPxa" }, + { GDI_PDSPDaoxxn, "PDSPDaoxxn" }, + { GDI_DPSDoax, "DPSDoax" }, + { GDI_PDSnox, "PDSnox" }, + { GDI_SDPana, "SDPana" }, + { GDI_SSPxDSxoxn, "SSPxDSxoxn" }, + { GDI_PDSPxox, "PDSPxox" }, + { GDI_PDSnoan, "PDSnoan" }, + { GDI_PDna, "PDna" }, + { GDI_DSPnaon, "DSPnaon" }, + { GDI_DPSDaox, "DPSDaox" }, + { GDI_SPDSxaxn, "SPDSxaxn" }, + { GDI_DPSonon, "DPSonon" }, + { GDI_DSTINVERT, "Dn" }, + { GDI_DPSox, "DPSox" }, + { GDI_DPSoan, "DPSoan" }, + { GDI_PDSPoax, "PDSPoax" }, + { GDI_DPSnox, "DPSnox" }, + { GDI_PATINVERT, "DPx" }, + { GDI_DPSDonox, "DPSDonox" }, + { GDI_DPSDxox, "DPSDxox" }, + { GDI_DPSnoan, "DPSnoan" }, + { GDI_DPSDnaox, "DPSDnaox" }, + { GDI_DPan, "DPan" }, + { GDI_PDSxa, "PDSxa" }, + { GDI_DSPDSaoxxn, "DSPDSaoxxn" }, + { GDI_DSPDoax, "DSPDoax" }, + { GDI_SDPnox, "SDPnox" }, + { GDI_SDPSoax, "SDPSoax" }, + { GDI_DSPnox, "DSPnox" }, + { GDI_SRCINVERT, "DSx" }, + { GDI_SDPSonox, "SDPSonox" }, + { GDI_DSPDSonoxxn, "DSPDSonoxxn" }, + { GDI_PDSxxn, "PDSxxn" }, + { GDI_DPSax, "DPSax" }, + { GDI_PSDPSoaxxn, "PSDPSoaxxn" }, + { GDI_SDPax, "SDPax" }, + { GDI_PDSPDoaxxn, "PDSPDoaxxn" }, + { GDI_SDPSnoax, "SDPSnoax" }, + { GDI_PDSxnan, "PDSxnan" }, + { GDI_PDSana, "PDSana" }, + { GDI_SSDxPDxaxn, "SSDxPDxaxn" }, + { GDI_SDPSxox, "SDPSxox" }, + { GDI_SDPnoan, "SDPnoan" }, + { GDI_DSPDxox, "DSPDxox" }, + { GDI_DSPnoan, "DSPnoan" }, + { GDI_SDPSnaox, "SDPSnaox" }, + { GDI_DSan, "DSan" }, + { GDI_PDSax, "PDSax" }, + { GDI_DSPDSoaxxn, "DSPDSoaxxn" }, + { GDI_DPSDnoax, "DPSDnoax" }, + { GDI_SDPxnan, "SDPxnan" }, + { GDI_SPDSnoax, "SPDSnoax" }, + { GDI_DPSxnan, "DPSxnan" }, + { GDI_SPxDSxo, "SPxDSxo" }, + { GDI_DPSaan, "DPSaan" }, + { GDI_DPSaa, "DPSaa" }, + { GDI_SPxDSxon, "SPxDSxon" }, + { GDI_DPSxna, "DPSxna" }, + { GDI_SPDSnoaxn, "SPDSnoaxn" }, + { GDI_SDPxna, "SDPxna" }, + { GDI_PDSPnoaxn, "PDSPnoaxn" }, + { GDI_DSPDSoaxx, "DSPDSoaxx" }, + { GDI_PDSaxn, "PDSaxn" }, + { GDI_SRCAND, "DSa" }, + { GDI_SDPSnaoxn, "SDPSnaoxn" }, + { GDI_DSPnoa, "DSPnoa" }, + { GDI_DSPDxoxn, "DSPDxoxn" }, + { GDI_SDPnoa, "SDPnoa" }, + { GDI_SDPSxoxn, "SDPSxoxn" }, + { GDI_SSDxPDxax, "SSDxPDxax" }, + { GDI_PDSanan, "PDSanan" }, + { GDI_PDSxna, "PDSxna" }, + { GDI_SDPSnoaxn, "SDPSnoaxn" }, + { GDI_DPSDPoaxx, "DPSDPoaxx" }, + { GDI_SPDaxn, "SPDaxn" }, + { GDI_PSDPSoaxx, "PSDPSoaxx" }, + { GDI_DPSaxn, "DPSaxn" }, + { GDI_DPSxx, "DPSxx" }, + { GDI_PSDPSonoxx, "PSDPSonoxx" }, + { GDI_SDPSonoxn, "SDPSonoxn" }, + { GDI_DSxn, "DSxn" }, + { GDI_DPSnax, "DPSnax" }, + { GDI_SDPSoaxn, "SDPSoaxn" }, + { GDI_SPDnax, "SPDnax" }, + { GDI_DSPDoaxn, "DSPDoaxn" }, + { GDI_DSPDSaoxx, "DSPDSaoxx" }, + { GDI_PDSxan, "PDSxan" }, + { GDI_DPa, "DPa" }, + { GDI_PDSPnaoxn, "PDSPnaoxn" }, + { GDI_DPSnoa, "DPSnoa" }, + { GDI_DPSDxoxn, "DPSDxoxn" }, + { GDI_PDSPonoxn, "PDSPonoxn" }, + { GDI_PDxn, "PDxn" }, + { GDI_DSPnax, "DSPnax" }, + { GDI_PDSPoaxn, "PDSPoaxn" }, + { GDI_DPSoa, "DPSoa" }, + { GDI_DPSoxn, "DPSoxn" }, + { GDI_DSTCOPY, "D" }, + { GDI_DPSono, "DPSono" }, + { GDI_SPDSxax, "SPDSxax" }, + { GDI_DPSDaoxn, "DPSDaoxn" }, + { GDI_DSPnao, "DSPnao" }, + { GDI_DPno, "DPno" }, + { GDI_PDSnoa, "PDSnoa" }, + { GDI_PDSPxoxn, "PDSPxoxn" }, + { GDI_SSPxDSxox, "SSPxDSxox" }, + { GDI_SDPanan, "SDPanan" }, + { GDI_PSDnax, "PSDnax" }, + { GDI_DPSDoaxn, "DPSDoaxn" }, + { GDI_DPSDPaoxx, "DPSDPaoxx" }, + { GDI_SDPxan, "SDPxan" }, + { GDI_PSDPxax, "PSDPxax" }, + { GDI_DSPDaoxn, "DSPDaoxn" }, + { GDI_DPSnao, "DPSnao" }, + { GDI_MERGEPAINT, "DSno" }, + { GDI_SPDSanax, "SPDSanax" }, + { GDI_SDxPDxan, "SDxPDxan" }, + { GDI_DPSxo, "DPSxo" }, + { GDI_DPSano, "DPSano" }, + { GDI_MERGECOPY, "PSa" }, + { GDI_SPDSnaoxn, "SPDSnaoxn" }, + { GDI_SPDSonoxn, "SPDSonoxn" }, + { GDI_PSxn, "PSxn" }, + { GDI_SPDnoa, "SPDnoa" }, + { GDI_SPDSxoxn, "SPDSxoxn" }, + { GDI_SDPnax, "SDPnax" }, + { GDI_PSDPoaxn, "PSDPoaxn" }, + { GDI_SDPoa, "SDPoa" }, + { GDI_SPDoxn, "SPDoxn" }, + { GDI_DPSDxax, "DPSDxax" }, + { GDI_SPDSaoxn, "SPDSaoxn" }, + { GDI_SRCCOPY, "S" }, + { GDI_SDPono, "SDPono" }, + { GDI_SDPnao, "SDPnao" }, + { GDI_SPno, "SPno" }, + { GDI_PSDnoa, "PSDnoa" }, + { GDI_PSDPxoxn, "PSDPxoxn" }, + { GDI_PDSnax, "PDSnax" }, + { GDI_SPDSoaxn, "SPDSoaxn" }, + { GDI_SSPxPDxax, "SSPxPDxax" }, + { GDI_DPSanan, "DPSanan" }, + { GDI_PSDPSaoxx, "PSDPSaoxx" }, + { GDI_DPSxan, "DPSxan" }, + { GDI_PDSPxax, "PDSPxax" }, + { GDI_SDPSaoxn, "SDPSaoxn" }, + { GDI_DPSDanax, "DPSDanax" }, + { GDI_SPxDSxan, "SPxDSxan" }, + { GDI_SPDnao, "SPDnao" }, + { GDI_SDno, "SDno" }, + { GDI_SDPxo, "SDPxo" }, + { GDI_SDPano, "SDPano" }, + { GDI_PDSoa, "PDSoa" }, + { GDI_PDSoxn, "PDSoxn" }, + { GDI_DSPDxax, "DSPDxax" }, + { GDI_PSDPaoxn, "PSDPaoxn" }, + { GDI_SDPSxax, "SDPSxax" }, + { GDI_PDSPaoxn, "PDSPaoxn" }, + { GDI_SDPSanax, "SDPSanax" }, + { GDI_SPxPDxan, "SPxPDxan" }, + { GDI_SSPxDSxax, "SSPxDSxax" }, + { GDI_DSPDSanaxxn, "DSPDSanaxxn" }, + { GDI_DPSao, "DPSao" }, + { GDI_DPSxno, "DPSxno" }, + { GDI_SDPao, "SDPao" }, + { GDI_SDPxno, "SDPxno" }, + { GDI_SRCPAINT, "DSo" }, + { GDI_SDPnoo, "SDPnoo" }, + { GDI_PATCOPY, "P" }, + { GDI_PDSono, "PDSono" }, + { GDI_PDSnao, "PDSnao" }, + { GDI_PSno, "PSno" }, + { GDI_PSDnao, "PSDnao" }, + { GDI_PDno, "PDno" }, + { GDI_PDSxo, "PDSxo" }, + { GDI_PDSano, "PDSano" }, + { GDI_PDSao, "PDSao" }, + { GDI_PDSxno, "PDSxno" }, + { GDI_DPo, "DPo" }, + { GDI_PATPAINT, "DPSnoo" }, + { GDI_PSo, "PSo" }, + { GDI_PSDnoo, "PSDnoo" }, + { GDI_DPSoo, "DPSoo" }, + { GDI_WHITENESS, "1" } }; /* Hatch Patterns as monochrome data */ -static const BYTE GDI_BS_HATCHED_PATTERNS[] = -{ +static const BYTE GDI_BS_HATCHED_PATTERNS[] = { 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, /* HS_HORIZONTAL */ 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, /* HS_VERTICAL */ 0xFE, 0xFD, 0xFB, 0xF7, 0xEF, 0xDF, 0xBF, 0x7F, /* HS_FDIAGONAL */ 0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE, /* HS_BDIAGONAL */ 0xF7, 0xF7, 0xF7, 0x00, 0xF7, 0xF7, 0xF7, 0xF7, /* HS_CROSS */ - 0x7E, 0xBD, 0xDB, 0xE7, 0xE7, 0xDB, 0xBD, 0x7E /* HS_DIACROSS */ + 0x7E, 0xBD, 0xDB, 0xE7, 0xE7, 0xDB, 0xBD, 0x7E /* HS_DIACROSS */ }; -INLINE BOOL gdi_decode_color(rdpGdi* gdi, const UINT32 srcColor, - UINT32* color, UINT32* format) +INLINE BOOL gdi_decode_color(rdpGdi* gdi, const UINT32 srcColor, UINT32* color, UINT32* format) { UINT32 SrcFormat; UINT32 ColorDepth; @@ -419,7 +414,7 @@ UINT32 gdi_get_pixel_format(UINT32 bitsPerPixel) break; default: - WLog_ERR(TAG, "Unsupported color depth %"PRIu32, bitsPerPixel); + WLog_ERR(TAG, "Unsupported color depth %" PRIu32, bitsPerPixel); format = 0; break; } @@ -427,11 +422,10 @@ UINT32 gdi_get_pixel_format(UINT32 bitsPerPixel) return format; } -gdiBitmap* gdi_bitmap_new_ex(rdpGdi* gdi, int width, int height, int bpp, - BYTE* data) +gdiBitmap* gdi_bitmap_new_ex(rdpGdi* gdi, int width, int height, int bpp, BYTE* data) { gdiBitmap* bitmap; - bitmap = (gdiBitmap*) calloc(1, sizeof(gdiBitmap)); + bitmap = (gdiBitmap*)calloc(1, sizeof(gdiBitmap)); if (!bitmap) goto fail_bitmap; @@ -439,8 +433,8 @@ gdiBitmap* gdi_bitmap_new_ex(rdpGdi* gdi, int width, int height, int bpp, if (!(bitmap->hdc = gdi_CreateCompatibleDC(gdi->hdc))) goto fail_hdc; - WLog_Print(gdi->log, WLOG_DEBUG, "gdi_bitmap_new: width:%d height:%d bpp:%d", - width, height, bpp); + WLog_Print(gdi->log, WLOG_DEBUG, "gdi_bitmap_new: width:%d height:%d bpp:%d", width, height, + bpp); if (!data) bitmap->bitmap = gdi_CreateCompatibleBitmap(gdi->hdc, width, height); @@ -450,7 +444,7 @@ gdiBitmap* gdi_bitmap_new_ex(rdpGdi* gdi, int width, int height, int bpp, if (!bitmap->bitmap) goto fail_bitmap_bitmap; - gdi_SelectObject(bitmap->hdc, (HGDIOBJECT) bitmap->bitmap); + gdi_SelectObject(bitmap->hdc, (HGDIOBJECT)bitmap->bitmap); bitmap->org_bitmap = NULL; return bitmap; fail_bitmap_bitmap: @@ -465,15 +459,14 @@ void gdi_bitmap_free_ex(gdiBitmap* bitmap) { if (bitmap) { - gdi_SelectObject(bitmap->hdc, (HGDIOBJECT) bitmap->org_bitmap); - gdi_DeleteObject((HGDIOBJECT) bitmap->bitmap); + gdi_SelectObject(bitmap->hdc, (HGDIOBJECT)bitmap->org_bitmap); + gdi_DeleteObject((HGDIOBJECT)bitmap->bitmap); gdi_DeleteDC(bitmap->hdc); free(bitmap); } } -BOOL gdi_bitmap_update(rdpContext* context, - const BITMAP_UPDATE* bitmapUpdate) +BOOL gdi_bitmap_update(rdpContext* context, const BITMAP_UPDATE* bitmapUpdate) { UINT32 index; @@ -492,9 +485,8 @@ BOOL gdi_bitmap_update(rdpContext* context, Bitmap_SetRectangle(bmp, bitmap->destLeft, bitmap->destTop, bitmap->destRight, bitmap->destBottom); - if (!bmp->Decompress(context, bmp, bitmap->bitmapDataStream, - bitmap->width, bitmap->height, bitmap->bitsPerPixel, - bitmap->bitmapLength, bitmap->compressed, + if (!bmp->Decompress(context, bmp, bitmap->bitmapDataStream, bitmap->width, bitmap->height, + bitmap->bitsPerPixel, bitmap->bitmapLength, bitmap->compressed, RDP_CODEC_ID_NONE)) { Bitmap_Free(context, bmp); @@ -519,8 +511,7 @@ BOOL gdi_bitmap_update(rdpContext* context, return TRUE; } -static BOOL gdi_palette_update(rdpContext* context, - const PALETTE_UPDATE* palette) +static BOOL gdi_palette_update(rdpContext* context, const PALETTE_UPDATE* palette) { UINT32 index; rdpGdi* gdi; @@ -569,9 +560,8 @@ static BOOL gdi_dstblt(rdpContext* context, const DSTBLT_ORDER* dstblt) return FALSE; gdi = context->gdi; - return gdi_BitBlt(gdi->drawing->hdc, dstblt->nLeftRect, dstblt->nTopRect, - dstblt->nWidth, dstblt->nHeight, NULL, 0, 0, - gdi_rop3_code(dstblt->bRop), &gdi->palette); + return gdi_BitBlt(gdi->drawing->hdc, dstblt->nLeftRect, dstblt->nTopRect, dstblt->nWidth, + dstblt->nHeight, NULL, 0, 0, gdi_rop3_code(dstblt->bRop), &gdi->palette); } static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt) @@ -605,61 +595,59 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt) break; case GDI_BS_HATCHED: - { - const BYTE* hatched; - hatched = GDI_BS_HATCHED_PATTERNS + (8 * brush->hatch); + { + const BYTE* hatched; + hatched = GDI_BS_HATCHED_PATTERNS + (8 * brush->hatch); - if (!freerdp_image_copy_from_monochrome(data, gdi->drawing->hdc->format, 0, 0, - 0, 8, 8, - hatched, backColor, foreColor, &gdi->palette)) - goto out_error; + if (!freerdp_image_copy_from_monochrome(data, gdi->drawing->hdc->format, 0, 0, 0, 8, 8, + hatched, backColor, foreColor, &gdi->palette)) + goto out_error; - hBmp = gdi_CreateBitmapEx(8, 8, gdi->drawing->hdc->format, 0, data, NULL); + hBmp = gdi_CreateBitmapEx(8, 8, gdi->drawing->hdc->format, 0, data, NULL); - if (!hBmp) - goto out_error; + if (!hBmp) + goto out_error; - hbrush = gdi_CreateHatchBrush(hBmp); - } - break; + hbrush = gdi_CreateHatchBrush(hBmp); + } + break; case GDI_BS_PATTERN: + { + UINT32 brushFormat; + + if (brush->bpp > 1) { - UINT32 brushFormat; + UINT32 bpp = brush->bpp; - if (brush->bpp > 1) - { - UINT32 bpp = brush->bpp; + if ((bpp == 16) && (context->settings->ColorDepth == 15)) + bpp = 15; - if ((bpp == 16) && (context->settings->ColorDepth == 15)) - bpp = 15; + brushFormat = gdi_get_pixel_format(bpp); - brushFormat = gdi_get_pixel_format(bpp); - - if (!freerdp_image_copy(data, gdi->drawing->hdc->format, 0, 0, 0, - 8, 8, brush->data, brushFormat, 0, 0, 0, - &gdi->palette, FREERDP_FLIP_NONE)) - goto out_error; - } - else - { - if (!freerdp_image_copy_from_monochrome(data, gdi->drawing->hdc->format, 0, 0, - 0, 8, 8, - brush->data, backColor, foreColor, &gdi->palette)) - goto out_error; - } - - hBmp = gdi_CreateBitmapEx(8, 8, gdi->drawing->hdc->format, 0, data, NULL); - - if (!hBmp) + if (!freerdp_image_copy(data, gdi->drawing->hdc->format, 0, 0, 0, 8, 8, brush->data, + brushFormat, 0, 0, 0, &gdi->palette, FREERDP_FLIP_NONE)) goto out_error; - - hbrush = gdi_CreatePatternBrush(hBmp); } - break; + else + { + if (!freerdp_image_copy_from_monochrome(data, gdi->drawing->hdc->format, 0, 0, 0, 8, + 8, brush->data, backColor, foreColor, + &gdi->palette)) + goto out_error; + } + + hBmp = gdi_CreateBitmapEx(8, 8, gdi->drawing->hdc->format, 0, data, NULL); + + if (!hBmp) + goto out_error; + + hbrush = gdi_CreatePatternBrush(hBmp); + } + break; default: - WLog_ERR(TAG, "unimplemented brush style:%"PRIu32"", brush->style); + WLog_ERR(TAG, "unimplemented brush style:%" PRIu32 "", brush->style); break; } @@ -668,14 +656,13 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt) hbrush->nXOrg = brush->x; hbrush->nYOrg = brush->y; gdi->drawing->hdc->brush = hbrush; - ret = gdi_BitBlt(gdi->drawing->hdc, patblt->nLeftRect, patblt->nTopRect, - patblt->nWidth, patblt->nHeight, - gdi->primary->hdc, nXSrc, nYSrc, rop, &gdi->palette); + ret = gdi_BitBlt(gdi->drawing->hdc, patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, + patblt->nHeight, gdi->primary->hdc, nXSrc, nYSrc, rop, &gdi->palette); } out_error: - gdi_DeleteObject((HGDIOBJECT) hBmp); - gdi_DeleteObject((HGDIOBJECT) hbrush); + gdi_DeleteObject((HGDIOBJECT)hBmp); + gdi_DeleteObject((HGDIOBJECT)hbrush); gdi->drawing->hdc->brush = originalBrush; gdi_SetTextColor(gdi->drawing->hdc, originalColor); return ret; @@ -689,14 +676,12 @@ static BOOL gdi_scrblt(rdpContext* context, const SCRBLT_ORDER* scrblt) return FALSE; gdi = context->gdi; - return gdi_BitBlt(gdi->drawing->hdc, scrblt->nLeftRect, scrblt->nTopRect, - scrblt->nWidth, scrblt->nHeight, gdi->primary->hdc, - scrblt->nXSrc, scrblt->nYSrc, gdi_rop3_code(scrblt->bRop), - &gdi->palette); + return gdi_BitBlt(gdi->drawing->hdc, scrblt->nLeftRect, scrblt->nTopRect, scrblt->nWidth, + scrblt->nHeight, gdi->primary->hdc, scrblt->nXSrc, scrblt->nYSrc, + gdi_rop3_code(scrblt->bRop), &gdi->palette); } -static BOOL gdi_opaque_rect(rdpContext* context, - const OPAQUE_RECT_ORDER* opaque_rect) +static BOOL gdi_opaque_rect(rdpContext* context, const OPAQUE_RECT_ORDER* opaque_rect) { GDI_RECT rect; HGDI_BRUSH hBrush; @@ -717,7 +702,7 @@ static BOOL gdi_opaque_rect(rdpContext* context, return FALSE; ret = gdi_FillRect(gdi->drawing->hdc, &rect, hBrush); - gdi_DeleteObject((HGDIOBJECT) hBrush); + gdi_DeleteObject((HGDIOBJECT)hBrush); return ret; } @@ -754,7 +739,7 @@ static BOOL gdi_multi_opaque_rect(rdpContext* context, break; } - gdi_DeleteObject((HGDIOBJECT) hBrush); + gdi_DeleteObject((HGDIOBJECT)hBrush); return ret; } @@ -775,15 +760,15 @@ static BOOL gdi_line_to(rdpContext* context, const LINE_TO_ORDER* lineTo) if (!gdi_decode_color(gdi, lineTo->penColor, &color, NULL)) return FALSE; - if (!(hPen = gdi_CreatePen(lineTo->penStyle, lineTo->penWidth, color, - gdi->drawing->hdc->format, &gdi->palette))) + if (!(hPen = gdi_CreatePen(lineTo->penStyle, lineTo->penWidth, color, gdi->drawing->hdc->format, + &gdi->palette))) return FALSE; - gdi_SelectObject(gdi->drawing->hdc, (HGDIOBJECT) hPen); + gdi_SelectObject(gdi->drawing->hdc, (HGDIOBJECT)hPen); gdi_SetROP2(gdi->drawing->hdc, lineTo->bRop2); gdi_MoveToEx(gdi->drawing->hdc, lineTo->nXStart, lineTo->nYStart, NULL); gdi_LineTo(gdi->drawing->hdc, lineTo->nXEnd, lineTo->nYEnd); - gdi_DeleteObject((HGDIOBJECT) hPen); + gdi_DeleteObject((HGDIOBJECT)hPen); return TRUE; } @@ -801,11 +786,10 @@ static BOOL gdi_polyline(rdpContext* context, const POLYLINE_ORDER* polyline) if (!gdi_decode_color(gdi, polyline->penColor, &color, NULL)) return FALSE; - if (!(hPen = gdi_CreatePen(GDI_PS_SOLID, 1, color, gdi->drawing->hdc->format, - &gdi->palette))) + if (!(hPen = gdi_CreatePen(GDI_PS_SOLID, 1, color, gdi->drawing->hdc->format, &gdi->palette))) return FALSE; - gdi_SelectObject(gdi->drawing->hdc, (HGDIOBJECT) hPen); + gdi_SelectObject(gdi->drawing->hdc, (HGDIOBJECT)hPen); gdi_SetROP2(gdi->drawing->hdc, polyline->bRop2); x = polyline->xStart; y = polyline->yStart; @@ -822,7 +806,7 @@ static BOOL gdi_polyline(rdpContext* context, const POLYLINE_ORDER* polyline) gdi_MoveToEx(gdi->drawing->hdc, x, y, NULL); } - gdi_DeleteObject((HGDIOBJECT) hPen); + gdi_DeleteObject((HGDIOBJECT)hPen); return TRUE; } @@ -834,12 +818,11 @@ static BOOL gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt) if (!context || !memblt || !context->gdi || !memblt->bitmap) return FALSE; - bitmap = (gdiBitmap*) memblt->bitmap; + bitmap = (gdiBitmap*)memblt->bitmap; gdi = context->gdi; - return gdi_BitBlt(gdi->drawing->hdc, memblt->nLeftRect, memblt->nTopRect, - memblt->nWidth, memblt->nHeight, bitmap->hdc, - memblt->nXSrc, memblt->nYSrc, gdi_rop3_code(memblt->bRop), - &gdi->palette); + return gdi_BitBlt(gdi->drawing->hdc, memblt->nLeftRect, memblt->nTopRect, memblt->nWidth, + memblt->nHeight, bitmap->hdc, memblt->nXSrc, memblt->nYSrc, + gdi_rop3_code(memblt->bRop), &gdi->palette); } static BOOL gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt) @@ -848,7 +831,7 @@ static BOOL gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt) rdpGdi* gdi = context->gdi; BOOL ret = TRUE; const rdpBrush* brush = &mem3blt->brush; - gdiBitmap* bitmap = (gdiBitmap*) mem3blt->bitmap; + gdiBitmap* bitmap = (gdiBitmap*)mem3blt->bitmap; UINT32 foreColor; UINT32 backColor; UINT32 originalColor; @@ -874,90 +857,85 @@ static BOOL gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt) } ret = gdi_BitBlt(gdi->drawing->hdc, mem3blt->nLeftRect, mem3blt->nTopRect, - mem3blt->nWidth, mem3blt->nHeight, bitmap->hdc, - mem3blt->nXSrc, mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop), - &gdi->palette); - gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush); + mem3blt->nWidth, mem3blt->nHeight, bitmap->hdc, mem3blt->nXSrc, + mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop), &gdi->palette); + gdi_DeleteObject((HGDIOBJECT)gdi->drawing->hdc->brush); gdi->drawing->hdc->brush = originalBrush; break; case GDI_BS_PATTERN: + { + HGDI_BITMAP hBmp; + UINT32 brushFormat; + BYTE* data = + (BYTE*)_aligned_malloc(8 * 8 * GetBytesPerPixel(gdi->drawing->hdc->format), 16); + + if (!data) { - HGDI_BITMAP hBmp; - UINT32 brushFormat; - BYTE* data = (BYTE*) _aligned_malloc(8 * 8 * GetBytesPerPixel( - gdi->drawing->hdc->format), - 16); + ret = FALSE; + goto out_fail; + } - if (!data) - { - ret = FALSE; - goto out_fail; - } + if (brush->bpp > 1) + { + UINT32 bpp = brush->bpp; - if (brush->bpp > 1) - { - UINT32 bpp = brush->bpp; + if ((bpp == 16) && (context->settings->ColorDepth == 15)) + bpp = 15; - if ((bpp == 16) && (context->settings->ColorDepth == 15)) - bpp = 15; + brushFormat = gdi_get_pixel_format(bpp); - brushFormat = gdi_get_pixel_format(bpp); - - if (!freerdp_image_copy(data, gdi->drawing->hdc->format, 0, 0, 0, - 8, 8, brush->data, brushFormat, - 0, 0, 0, &gdi->palette, FREERDP_FLIP_NONE)) - { - ret = FALSE; - _aligned_free(data); - goto out_fail; - } - } - else - { - if (!freerdp_image_copy_from_monochrome(data, gdi->drawing->hdc->format, 0, 0, - 0, 8, 8, - brush->data, backColor, foreColor, - &gdi->palette)) - { - ret = FALSE; - _aligned_free(data); - goto out_fail; - } - } - - hBmp = gdi_CreateBitmap(8, 8, gdi->drawing->hdc->format, data); - - if (!hBmp) + if (!freerdp_image_copy(data, gdi->drawing->hdc->format, 0, 0, 0, 8, 8, brush->data, + brushFormat, 0, 0, 0, &gdi->palette, FREERDP_FLIP_NONE)) { ret = FALSE; _aligned_free(data); goto out_fail; } - - originalBrush = gdi->drawing->hdc->brush; - gdi->drawing->hdc->brush = gdi_CreatePatternBrush(hBmp); - - if (!gdi->drawing->hdc->brush) + } + else + { + if (!freerdp_image_copy_from_monochrome(data, gdi->drawing->hdc->format, 0, 0, 0, 8, + 8, brush->data, backColor, foreColor, + &gdi->palette)) { - gdi_DeleteObject((HGDIOBJECT) hBmp); + ret = FALSE; + _aligned_free(data); goto out_fail; } - - gdi->drawing->hdc->brush->nXOrg = brush->x; - gdi->drawing->hdc->brush->nYOrg = brush->y; - ret = gdi_BitBlt(gdi->drawing->hdc, mem3blt->nLeftRect, mem3blt->nTopRect, - mem3blt->nWidth, mem3blt->nHeight, bitmap->hdc, - mem3blt->nXSrc, mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop), - &gdi->palette); - gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush); - gdi_DeleteObject((HGDIOBJECT) hBmp); - gdi->drawing->hdc->brush = originalBrush; } - break; + + hBmp = gdi_CreateBitmap(8, 8, gdi->drawing->hdc->format, data); + + if (!hBmp) + { + ret = FALSE; + _aligned_free(data); + goto out_fail; + } + + originalBrush = gdi->drawing->hdc->brush; + gdi->drawing->hdc->brush = gdi_CreatePatternBrush(hBmp); + + if (!gdi->drawing->hdc->brush) + { + gdi_DeleteObject((HGDIOBJECT)hBmp); + goto out_fail; + } + + gdi->drawing->hdc->brush->nXOrg = brush->x; + gdi->drawing->hdc->brush->nYOrg = brush->y; + ret = gdi_BitBlt(gdi->drawing->hdc, mem3blt->nLeftRect, mem3blt->nTopRect, + mem3blt->nWidth, mem3blt->nHeight, bitmap->hdc, mem3blt->nXSrc, + mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop), &gdi->palette); + gdi_DeleteObject((HGDIOBJECT)gdi->drawing->hdc->brush); + gdi_DeleteObject((HGDIOBJECT)hBmp); + gdi->drawing->hdc->brush = originalBrush; + } + break; default: - WLog_ERR(TAG, "Mem3Blt unimplemented brush style:%"PRIu32"", brush->style); + WLog_ERR(TAG, "Mem3Blt unimplemented brush style:%" PRIu32 "", brush->style); break; } @@ -966,8 +944,7 @@ out_fail: return ret; } -static BOOL gdi_polygon_sc(rdpContext* context, - const POLYGON_SC_ORDER* polygon_sc) +static BOOL gdi_polygon_sc(rdpContext* context, const POLYGON_SC_ORDER* polygon_sc) { WLog_WARN(TAG, "%s: not implemented", __FUNCTION__); return FALSE; @@ -979,32 +956,27 @@ static BOOL gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb) return FALSE; } -static BOOL gdi_ellipse_sc(rdpContext* context, - const ELLIPSE_SC_ORDER* ellipse_sc) +static BOOL gdi_ellipse_sc(rdpContext* context, const ELLIPSE_SC_ORDER* ellipse_sc) { WLog_WARN(TAG, "%s: not implemented", __FUNCTION__); return FALSE; } -static BOOL gdi_ellipse_cb(rdpContext* context, - const ELLIPSE_CB_ORDER* ellipse_cb) +static BOOL gdi_ellipse_cb(rdpContext* context, const ELLIPSE_CB_ORDER* ellipse_cb) { WLog_WARN(TAG, "%s: not implemented", __FUNCTION__); return FALSE; } -static BOOL gdi_frame_marker(rdpContext* context, - const FRAME_MARKER_ORDER* frameMarker) +static BOOL gdi_frame_marker(rdpContext* context, const FRAME_MARKER_ORDER* frameMarker) { return TRUE; } -BOOL gdi_surface_frame_marker(rdpContext* context, - const SURFACE_FRAME_MARKER* surfaceFrameMarker) +BOOL gdi_surface_frame_marker(rdpContext* context, const SURFACE_FRAME_MARKER* surfaceFrameMarker) { - WLog_Print(context->gdi->log, WLOG_DEBUG, "frameId %"PRIu32" frameAction %"PRIu32"", - surfaceFrameMarker->frameId, - surfaceFrameMarker->frameAction); + WLog_Print(context->gdi->log, WLOG_DEBUG, "frameId %" PRIu32 " frameAction %" PRIu32 "", + surfaceFrameMarker->frameId, surfaceFrameMarker->frameAction); switch (surfaceFrameMarker->frameAction) { @@ -1024,8 +996,7 @@ BOOL gdi_surface_frame_marker(rdpContext* context, return TRUE; } -static BOOL gdi_surface_bits(rdpContext* context, - const SURFACE_BITS_COMMAND* cmd) +static BOOL gdi_surface_bits(rdpContext* context, const SURFACE_BITS_COMMAND* cmd) { BOOL result = FALSE; DWORD format; @@ -1039,12 +1010,13 @@ static BOOL gdi_surface_bits(rdpContext* context, return FALSE; gdi = context->gdi; - WLog_Print(gdi->log, WLOG_DEBUG, - "destLeft %"PRIu32" destTop %"PRIu32" destRight %"PRIu32" destBottom %"PRIu32" " - "bpp %"PRIu8" flags %"PRIx8" codecID %"PRIu16" width %"PRIu16" height %"PRIu16" length %"PRIu32"", - cmd->destLeft, cmd->destTop, cmd->destRight, cmd->destBottom, - cmd->bmp.bpp, cmd->bmp.flags, cmd->bmp.codecID, cmd->bmp.width, cmd->bmp.height, - cmd->bmp.bitmapDataLength); + WLog_Print( + gdi->log, WLOG_DEBUG, + "destLeft %" PRIu32 " destTop %" PRIu32 " destRight %" PRIu32 " destBottom %" PRIu32 " " + "bpp %" PRIu8 " flags %" PRIx8 " codecID %" PRIu16 " width %" PRIu16 " height %" PRIu16 + " length %" PRIu32 "", + cmd->destLeft, cmd->destTop, cmd->destRight, cmd->destBottom, cmd->bmp.bpp, cmd->bmp.flags, + cmd->bmp.codecID, cmd->bmp.width, cmd->bmp.height, cmd->bmp.bitmapDataLength); region16_init(®ion); cmdRect.left = cmd->destLeft; cmdRect.top = cmd->destTop; @@ -1055,10 +1027,9 @@ static BOOL gdi_surface_bits(rdpContext* context, { case RDP_CODEC_ID_REMOTEFX: if (!rfx_process_message(context->codecs->rfx, cmd->bmp.bitmapData, - cmd->bmp.bitmapDataLength, - cmd->destLeft, cmd->destTop, - gdi->primary_buffer, gdi->dstFormat, - gdi->stride, gdi->height, ®ion)) + cmd->bmp.bitmapDataLength, cmd->destLeft, cmd->destTop, + gdi->primary_buffer, gdi->dstFormat, gdi->stride, gdi->height, + ®ion)) { WLog_ERR(TAG, "Failed to process RemoteFX message"); goto out; @@ -1071,9 +1042,9 @@ static BOOL gdi_surface_bits(rdpContext* context, if (!nsc_process_message(context->codecs->nsc, cmd->bmp.bpp, cmd->bmp.width, cmd->bmp.height, cmd->bmp.bitmapData, - cmd->bmp.bitmapDataLength, gdi->primary_buffer, - format, gdi->stride, cmd->destLeft, cmd->destTop, - cmd->bmp.width, cmd->bmp.height, FREERDP_FLIP_VERTICAL)) + cmd->bmp.bitmapDataLength, gdi->primary_buffer, format, + gdi->stride, cmd->destLeft, cmd->destTop, cmd->bmp.width, + cmd->bmp.height, FREERDP_FLIP_VERTICAL)) { WLog_ERR(TAG, "Failed to process NSCodec message"); goto out; @@ -1085,10 +1056,10 @@ static BOOL gdi_surface_bits(rdpContext* context, case RDP_CODEC_ID_NONE: format = gdi_get_pixel_format(cmd->bmp.bpp); - if (!freerdp_image_copy(gdi->primary_buffer, gdi->dstFormat, gdi->stride, - cmd->destLeft, cmd->destTop, cmd->bmp.width, cmd->bmp.height, - cmd->bmp.bitmapData, format, 0, 0, 0, - &gdi->palette, FREERDP_FLIP_VERTICAL)) + if (!freerdp_image_copy(gdi->primary_buffer, gdi->dstFormat, gdi->stride, cmd->destLeft, + cmd->destTop, cmd->bmp.width, cmd->bmp.height, + cmd->bmp.bitmapData, format, 0, 0, 0, &gdi->palette, + FREERDP_FLIP_VERTICAL)) { WLog_ERR(TAG, "Failed to process nocodec message"); goto out; @@ -1098,7 +1069,7 @@ static BOOL gdi_surface_bits(rdpContext* context, break; default: - WLog_ERR(TAG, "Unsupported codecID %"PRIu32"", cmd->bmp.codecID); + WLog_ERR(TAG, "Unsupported codecID %" PRIu32 "", cmd->bmp.codecID); break; } @@ -1163,10 +1134,10 @@ static void gdi_register_update_callbacks(rdpUpdate* update) update->altsec->FrameMarker = gdi_frame_marker; } -static BOOL gdi_init_primary(rdpGdi* gdi, UINT32 stride, UINT32 format, - BYTE* buffer, void (*pfree)(void*)) +static BOOL gdi_init_primary(rdpGdi* gdi, UINT32 stride, UINT32 format, BYTE* buffer, + void (*pfree)(void*)) { - gdi->primary = (gdiBitmap*) calloc(1, sizeof(gdiBitmap)); + gdi->primary = (gdiBitmap*)calloc(1, sizeof(gdiBitmap)); if (format > 0) gdi->dstFormat = format; @@ -1184,26 +1155,23 @@ static BOOL gdi_init_primary(rdpGdi* gdi, UINT32 stride, UINT32 format, if (!buffer) { - gdi->primary->bitmap = gdi_CreateCompatibleBitmap( - gdi->hdc, gdi->width, gdi->height); + gdi->primary->bitmap = gdi_CreateCompatibleBitmap(gdi->hdc, gdi->width, gdi->height); } else { - gdi->primary->bitmap = gdi_CreateBitmapEx(gdi->width, gdi->height, - gdi->dstFormat, - gdi->stride, - buffer, pfree); + gdi->primary->bitmap = + gdi_CreateBitmapEx(gdi->width, gdi->height, gdi->dstFormat, gdi->stride, buffer, pfree); } if (!gdi->primary->bitmap) goto fail_bitmap; gdi->stride = gdi->primary->bitmap->scanline; - gdi_SelectObject(gdi->primary->hdc, (HGDIOBJECT) gdi->primary->bitmap); + gdi_SelectObject(gdi->primary->hdc, (HGDIOBJECT)gdi->primary->bitmap); gdi->primary->org_bitmap = NULL; gdi->primary_buffer = gdi->primary->bitmap->data; - if (!(gdi->primary->hdc->hwnd = (HGDI_WND) calloc(1, sizeof(GDI_WND)))) + if (!(gdi->primary->hdc->hwnd = (HGDI_WND)calloc(1, sizeof(GDI_WND)))) goto fail_hwnd; if (!(gdi->primary->hdc->hwnd->invalid = gdi_CreateRectRgn(0, 0, 0, 0))) @@ -1212,8 +1180,8 @@ static BOOL gdi_init_primary(rdpGdi* gdi, UINT32 stride, UINT32 format, gdi->primary->hdc->hwnd->invalid->null = TRUE; gdi->primary->hdc->hwnd->count = 32; - if (!(gdi->primary->hdc->hwnd->cinvalid = (HGDI_RGN) calloc( - gdi->primary->hdc->hwnd->count, sizeof(GDI_RGN)))) + if (!(gdi->primary->hdc->hwnd->cinvalid = + (HGDI_RGN)calloc(gdi->primary->hdc->hwnd->count, sizeof(GDI_RGN)))) goto fail_hwnd; gdi->primary->hdc->hwnd->ninvalid = 0; @@ -1223,7 +1191,7 @@ static BOOL gdi_init_primary(rdpGdi* gdi, UINT32 stride, UINT32 format, return TRUE; fail_hwnd: - gdi_DeleteObject((HGDIOBJECT) gdi->primary->bitmap); + gdi_DeleteObject((HGDIOBJECT)gdi->primary->bitmap); fail_bitmap: gdi_DeleteDC(gdi->primary->hdc); fail_hdc: @@ -1238,9 +1206,8 @@ BOOL gdi_resize(rdpGdi* gdi, UINT32 width, UINT32 height) return gdi_resize_ex(gdi, width, height, 0, 0, NULL, NULL); } -BOOL gdi_resize_ex(rdpGdi* gdi, UINT32 width, UINT32 height, - UINT32 stride, UINT32 format, BYTE* buffer, - void (*pfree)(void*)) +BOOL gdi_resize_ex(rdpGdi* gdi, UINT32 width, UINT32 height, UINT32 stride, UINT32 format, + BYTE* buffer, void (*pfree)(void*)) { if (!gdi || !gdi->primary) return FALSE; @@ -1277,7 +1244,7 @@ BOOL gdi_init_ex(freerdp* instance, UINT32 format, UINT32 stride, BYTE* buffer, void (*pfree)(void*)) { UINT32 SrcFormat = gdi_get_pixel_format(instance->settings->ColorDepth); - rdpGdi* gdi = (rdpGdi*) calloc(1, sizeof(rdpGdi)); + rdpGdi* gdi = (rdpGdi*)calloc(1, sizeof(rdpGdi)); rdpContext* context = instance->context; if (!gdi) @@ -1323,7 +1290,7 @@ BOOL gdi_init_ex(freerdp* instance, UINT32 format, UINT32 stride, BYTE* buffer, return TRUE; fail: gdi_free(instance); - WLog_ERR(TAG, "failed to initialize gdi"); + WLog_ERR(TAG, "failed to initialize gdi"); return FALSE; } @@ -1347,7 +1314,7 @@ void gdi_free(freerdp* instance) context = instance->context; cache_free(context->cache); context->cache = NULL; - instance->context->gdi = (rdpGdi*) NULL; + instance->context->gdi = (rdpGdi*)NULL; } BOOL gdi_send_suppress_output(rdpGdi* gdi, BOOL suppress) @@ -1371,4 +1338,3 @@ BOOL gdi_send_suppress_output(rdpGdi* gdi, BOOL suppress) rect.bottom = settings->DesktopHeight; return update->SuppressOutput(gdi->context, !suppress, &rect); } - diff --git a/libfreerdp/gdi/gdi.h b/libfreerdp/gdi/gdi.h index d2b5bc021..8ca2f3518 100644 --- a/libfreerdp/gdi/gdi.h +++ b/libfreerdp/gdi/gdi.h @@ -25,18 +25,15 @@ #include -FREERDP_LOCAL BOOL gdi_bitmap_update(rdpContext* context, - const BITMAP_UPDATE* bitmapUpdate); +FREERDP_LOCAL BOOL gdi_bitmap_update(rdpContext* context, const BITMAP_UPDATE* bitmapUpdate); -FREERDP_LOCAL gdiBitmap* gdi_bitmap_new_ex(rdpGdi* gdi, int width, int height, - int bpp, - BYTE* data); +FREERDP_LOCAL gdiBitmap* gdi_bitmap_new_ex(rdpGdi* gdi, int width, int height, int bpp, BYTE* data); FREERDP_LOCAL void gdi_bitmap_free_ex(gdiBitmap* gdi_bmp); static INLINE BYTE* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, INT32 x, INT32 y) { BYTE* p; - HGDI_BITMAP hBmp = (HGDI_BITMAP) hdcBmp->selectedObject; + HGDI_BITMAP hBmp = (HGDI_BITMAP)hdcBmp->selectedObject; if ((x >= 0) && (y >= 0) && (x < hBmp->width) && (y < hBmp->height)) { @@ -46,7 +43,8 @@ static INLINE BYTE* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, INT32 x, INT32 y) else { WLog_ERR(FREERDP_TAG("gdi"), - "gdi_get_bitmap_pointer: requesting invalid pointer: (%"PRIu32",%"PRIu32") in %"PRIu32"x%"PRIu32"", + "gdi_get_bitmap_pointer: requesting invalid pointer: (%" PRIu32 ",%" PRIu32 + ") in %" PRIu32 "x%" PRIu32 "", x, y, hBmp->width, hBmp->height); return 0; } @@ -68,27 +66,27 @@ static INLINE BYTE* gdi_get_brush_pointer(HGDI_DC hdcBrush, UINT32 x, UINT32 y) { case GDI_BS_PATTERN: case GDI_BS_HATCHED: - { - HGDI_BITMAP hBmpBrush = hdcBrush->brush->pattern; - /* According to @msdn{dd183396}, the system always positions a brush bitmap - * at the brush origin and copy across the client area. - * Calculate the offset of the mapped pixel in the brush bitmap according to - * brush origin and dest coordinates */ - x = (x + hBmpBrush->width - (hdcBrush->brush->nXOrg % hBmpBrush->width)) % - hBmpBrush->width; - y = (y + hBmpBrush->height - (hdcBrush->brush->nYOrg % hBmpBrush->height)) % - hBmpBrush->height; - p = hBmpBrush->data + (y * hBmpBrush->scanline) + (x * GetBytesPerPixel( - hBmpBrush->format)); - return p; - } - break; + { + HGDI_BITMAP hBmpBrush = hdcBrush->brush->pattern; + /* According to @msdn{dd183396}, the system always positions a brush bitmap + * at the brush origin and copy across the client area. + * Calculate the offset of the mapped pixel in the brush bitmap according to + * brush origin and dest coordinates */ + x = (x + hBmpBrush->width - (hdcBrush->brush->nXOrg % hBmpBrush->width)) % + hBmpBrush->width; + y = (y + hBmpBrush->height - (hdcBrush->brush->nYOrg % hBmpBrush->height)) % + hBmpBrush->height; + p = hBmpBrush->data + (y * hBmpBrush->scanline) + + (x * GetBytesPerPixel(hBmpBrush->format)); + return p; + } + break; default: break; } - p = (BYTE*) & (hdcBrush->textColor); + p = (BYTE*)&(hdcBrush->textColor); return p; } diff --git a/libfreerdp/gdi/gfx.c b/libfreerdp/gdi/gfx.c index 09bba3f2e..ee259f353 100644 --- a/libfreerdp/gdi/gfx.c +++ b/libfreerdp/gdi/gfx.c @@ -58,7 +58,7 @@ static UINT gdi_ResetGraphics(RdpgfxClientContext* context, UINT32 DesktopHeight; gdiGfxSurface* surface; UINT16* pSurfaceIds = NULL; - rdpGdi* gdi = (rdpGdi*) context->custom; + rdpGdi* gdi = (rdpGdi*)context->custom; rdpUpdate* update = gdi->context->update; rdpSettings* settings = gdi->context->settings; EnterCriticalSection(&context->mux); @@ -78,7 +78,7 @@ static UINT gdi_ResetGraphics(RdpgfxClientContext* context, for (index = 0; index < count; index++) { - surface = (gdiGfxSurface*) context->GetSurfaceData(context, pSurfaceIds[index]); + surface = (gdiGfxSurface*)context->GetSurfaceData(context, pSurfaceIds[index]); if (!surface || !surface->outputMapped) continue; @@ -88,8 +88,8 @@ static UINT gdi_ResetGraphics(RdpgfxClientContext* context, free(pSurfaceIds); - if (!freerdp_client_codecs_reset(gdi->context->codecs, FREERDP_CODEC_ALL, - gdi->width, gdi->height)) + if (!freerdp_client_codecs_reset(gdi->context->codecs, FREERDP_CODEC_ALL, gdi->width, + gdi->height)) goto fail; gdi->graphicsReset = TRUE; @@ -118,8 +118,7 @@ static UINT gdi_OutputUpdate(rdpGdi* gdi, gdiGfxSurface* surface) surfaceRect.top = 0; surfaceRect.right = surface->mappedWidth; surfaceRect.bottom = surface->mappedHeight; - region16_intersect_rect(&(surface->invalidRegion), - &(surface->invalidRegion), &surfaceRect); + region16_intersect_rect(&(surface->invalidRegion), &(surface->invalidRegion), &surfaceRect); sx = surface->outputTargetWidth / (double)surface->mappedWidth; sy = surface->outputTargetHeight / (double)surface->mappedHeight; @@ -140,13 +139,13 @@ static UINT gdi_OutputUpdate(rdpGdi* gdi, gdiGfxSurface* surface) const UINT32 dwidth = MIN((UINT32)(swidth * sx), (UINT32)gdi->width - nXDst); const UINT32 dheight = MIN((UINT32)(sheight * sy), (UINT32)gdi->height - nYDst); - if (!freerdp_image_scale(gdi->primary_buffer, gdi->dstFormat, - gdi->stride, nXDst, nYDst, dwidth, dheight, - surface->data, surface->format, - surface->scanline, nXSrc, nYSrc, swidth, sheight)) + if (!freerdp_image_scale(gdi->primary_buffer, gdi->dstFormat, gdi->stride, nXDst, nYDst, + dwidth, dheight, surface->data, surface->format, surface->scanline, + nXSrc, nYSrc, swidth, sheight)) return CHANNEL_RC_NULL_DATA; - gdi_InvalidateRegion(gdi->primary->hdc, (INT32)nXDst, (INT32)nYDst, (INT32)dwidth, (INT32)dheight); + gdi_InvalidateRegion(gdi->primary->hdc, (INT32)nXDst, (INT32)nYDst, (INT32)dwidth, + (INT32)dheight); } rc = CHANNEL_RC_OK; @@ -177,7 +176,7 @@ static UINT gdi_UpdateSurfaces(RdpgfxClientContext* context) for (index = 0; index < count; index++) { - surface = (gdiGfxSurface*) context->GetSurfaceData(context, pSurfaceIds[index]); + surface = (gdiGfxSurface*)context->GetSurfaceData(context, pSurfaceIds[index]); if (!surface) continue; @@ -208,10 +207,9 @@ static UINT gdi_UpdateSurfaces(RdpgfxClientContext* context) * * @return 0 on success, otherwise a Win32 error code */ -static UINT gdi_StartFrame(RdpgfxClientContext* context, - const RDPGFX_START_FRAME_PDU* startFrame) +static UINT gdi_StartFrame(RdpgfxClientContext* context, const RDPGFX_START_FRAME_PDU* startFrame) { - rdpGdi* gdi = (rdpGdi*) context->custom; + rdpGdi* gdi = (rdpGdi*)context->custom; gdi->inGfxFrame = TRUE; return CHANNEL_RC_OK; } @@ -221,11 +219,10 @@ static UINT gdi_StartFrame(RdpgfxClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT gdi_EndFrame(RdpgfxClientContext* context, - const RDPGFX_END_FRAME_PDU* endFrame) +static UINT gdi_EndFrame(RdpgfxClientContext* context, const RDPGFX_END_FRAME_PDU* endFrame) { UINT status = CHANNEL_RC_NOT_INITIALIZED; - rdpGdi* gdi = (rdpGdi*) context->custom; + rdpGdi* gdi = (rdpGdi*)context->custom; IFCALLRET(context->UpdateSurfaces, status, context); gdi->inGfxFrame = FALSE; return status; @@ -236,33 +233,31 @@ static UINT gdi_EndFrame(RdpgfxClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT gdi_SurfaceCommand_Uncompressed(rdpGdi* gdi, - RdpgfxClientContext* context, - const RDPGFX_SURFACE_COMMAND* cmd) +static UINT gdi_SurfaceCommand_Uncompressed(rdpGdi* gdi, RdpgfxClientContext* context, + const RDPGFX_SURFACE_COMMAND* cmd) { UINT status = CHANNEL_RC_OK; gdiGfxSurface* surface; RECTANGLE_16 invalidRect; - surface = (gdiGfxSurface*) context->GetSurfaceData(context, cmd->surfaceId); + surface = (gdiGfxSurface*)context->GetSurfaceData(context, cmd->surfaceId); if (!surface) { - WLog_ERR(TAG, "%s: unable to retrieve surfaceData for surfaceId=%"PRIu32"", __FUNCTION__, + WLog_ERR(TAG, "%s: unable to retrieve surfaceData for surfaceId=%" PRIu32 "", __FUNCTION__, cmd->surfaceId); return ERROR_NOT_FOUND; } - if (!freerdp_image_copy(surface->data, surface->format, surface->scanline, - cmd->left, cmd->top, cmd->width, cmd->height, - cmd->data, cmd->format, 0, 0, 0, NULL, FREERDP_FLIP_NONE)) + if (!freerdp_image_copy(surface->data, surface->format, surface->scanline, cmd->left, cmd->top, + cmd->width, cmd->height, cmd->data, cmd->format, 0, 0, 0, NULL, + FREERDP_FLIP_NONE)) return ERROR_INTERNAL_ERROR; invalidRect.left = cmd->left; invalidRect.top = cmd->top; invalidRect.right = cmd->right; invalidRect.bottom = cmd->bottom; - region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), - &invalidRect); + region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect); status = IFCALLRESULT(CHANNEL_RC_OK, context->UpdateSurfaceArea, context, surface->surfaceId, 1, &invalidRect); @@ -284,8 +279,7 @@ fail: * * @return 0 on success, otherwise a Win32 error code */ -static UINT gdi_SurfaceCommand_RemoteFX(rdpGdi* gdi, - RdpgfxClientContext* context, +static UINT gdi_SurfaceCommand_RemoteFX(rdpGdi* gdi, RdpgfxClientContext* context, const RDPGFX_SURFACE_COMMAND* cmd) { UINT status = ERROR_INTERNAL_ERROR; @@ -293,11 +287,11 @@ static UINT gdi_SurfaceCommand_RemoteFX(rdpGdi* gdi, REGION16 invalidRegion; const RECTANGLE_16* rects; UINT32 nrRects, x; - surface = (gdiGfxSurface*) context->GetSurfaceData(context, cmd->surfaceId); + surface = (gdiGfxSurface*)context->GetSurfaceData(context, cmd->surfaceId); if (!surface) { - WLog_ERR(TAG, "%s: unable to retrieve surfaceData for surfaceId=%"PRIu32"", __FUNCTION__, + WLog_ERR(TAG, "%s: unable to retrieve surfaceData for surfaceId=%" PRIu32 "", __FUNCTION__, cmd->surfaceId); return ERROR_NOT_FOUND; } @@ -305,10 +299,9 @@ static UINT gdi_SurfaceCommand_RemoteFX(rdpGdi* gdi, rfx_context_set_pixel_format(surface->codecs->rfx, cmd->format); region16_init(&invalidRegion); - if (!rfx_process_message(surface->codecs->rfx, cmd->data, cmd->length, - cmd->left, cmd->top, - surface->data, surface->format, surface->scanline, - surface->height, &invalidRegion)) + if (!rfx_process_message(surface->codecs->rfx, cmd->data, cmd->length, cmd->left, cmd->top, + surface->data, surface->format, surface->scanline, surface->height, + &invalidRegion)) { WLog_ERR(TAG, "Failed to process RemoteFX message"); goto fail; @@ -340,32 +333,29 @@ fail: * * @return 0 on success, otherwise a Win32 error code */ -static UINT gdi_SurfaceCommand_ClearCodec(rdpGdi* gdi, - RdpgfxClientContext* context, - const RDPGFX_SURFACE_COMMAND* cmd) +static UINT gdi_SurfaceCommand_ClearCodec(rdpGdi* gdi, RdpgfxClientContext* context, + const RDPGFX_SURFACE_COMMAND* cmd) { INT32 rc; UINT status = CHANNEL_RC_OK; gdiGfxSurface* surface; RECTANGLE_16 invalidRect; - surface = (gdiGfxSurface*) context->GetSurfaceData(context, cmd->surfaceId); + surface = (gdiGfxSurface*)context->GetSurfaceData(context, cmd->surfaceId); if (!surface) { - WLog_ERR(TAG, "%s: unable to retrieve surfaceData for surfaceId=%"PRIu32"", __FUNCTION__, + WLog_ERR(TAG, "%s: unable to retrieve surfaceData for surfaceId=%" PRIu32 "", __FUNCTION__, cmd->surfaceId); return ERROR_NOT_FOUND; } - rc = clear_decompress(surface->codecs->clear, cmd->data, cmd->length, - cmd->width, cmd->height, - surface->data, surface->format, - surface->scanline, cmd->left, cmd->top, + rc = clear_decompress(surface->codecs->clear, cmd->data, cmd->length, cmd->width, cmd->height, + surface->data, surface->format, surface->scanline, cmd->left, cmd->top, surface->width, surface->height, &gdi->palette); if (rc < 0) { - WLog_ERR(TAG, "clear_decompress failure: %"PRId32"", rc); + WLog_ERR(TAG, "clear_decompress failure: %" PRId32 "", rc); return ERROR_INTERNAL_ERROR; } @@ -373,8 +363,7 @@ static UINT gdi_SurfaceCommand_ClearCodec(rdpGdi* gdi, invalidRect.top = cmd->top; invalidRect.right = cmd->right; invalidRect.bottom = cmd->bottom; - region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), - &invalidRect); + region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect); status = IFCALLRESULT(CHANNEL_RC_OK, context->UpdateSurfaceArea, context, surface->surfaceId, 1, &invalidRect); @@ -403,21 +392,19 @@ static UINT gdi_SurfaceCommand_Planar(rdpGdi* gdi, RdpgfxClientContext* context, BYTE* DstData = NULL; gdiGfxSurface* surface; RECTANGLE_16 invalidRect; - surface = (gdiGfxSurface*) context->GetSurfaceData(context, cmd->surfaceId); + surface = (gdiGfxSurface*)context->GetSurfaceData(context, cmd->surfaceId); if (!surface) { - WLog_ERR(TAG, "%s: unable to retrieve surfaceData for surfaceId=%"PRIu32"", __FUNCTION__, + WLog_ERR(TAG, "%s: unable to retrieve surfaceData for surfaceId=%" PRIu32 "", __FUNCTION__, cmd->surfaceId); return ERROR_NOT_FOUND; } DstData = surface->data; - if (!planar_decompress(surface->codecs->planar, cmd->data, cmd->length, - cmd->width, cmd->height, - DstData, surface->format, - surface->scanline, cmd->left, cmd->top, + if (!planar_decompress(surface->codecs->planar, cmd->data, cmd->length, cmd->width, cmd->height, + DstData, surface->format, surface->scanline, cmd->left, cmd->top, cmd->width, cmd->height, FALSE)) return ERROR_INTERNAL_ERROR; @@ -425,8 +412,7 @@ static UINT gdi_SurfaceCommand_Planar(rdpGdi* gdi, RdpgfxClientContext* context, invalidRect.top = cmd->top; invalidRect.right = cmd->right; invalidRect.bottom = cmd->bottom; - region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), - &invalidRect); + region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect); status = IFCALLRESULT(CHANNEL_RC_OK, context->UpdateSurfaceArea, context, surface->surfaceId, 1, &invalidRect); @@ -448,8 +434,7 @@ fail: * * @return 0 on success, otherwise a Win32 error code */ -static UINT gdi_SurfaceCommand_AVC420(rdpGdi* gdi, - RdpgfxClientContext* context, +static UINT gdi_SurfaceCommand_AVC420(rdpGdi* gdi, RdpgfxClientContext* context, const RDPGFX_SURFACE_COMMAND* cmd) { #ifdef WITH_GFX_H264 @@ -460,11 +445,11 @@ static UINT gdi_SurfaceCommand_AVC420(rdpGdi* gdi, RDPGFX_H264_METABLOCK* meta; RDPGFX_AVC420_BITMAP_STREAM* bs; - surface = (gdiGfxSurface*) context->GetSurfaceData(context, cmd->surfaceId); + surface = (gdiGfxSurface*)context->GetSurfaceData(context, cmd->surfaceId); if (!surface) { - WLog_ERR(TAG, "%s: unable to retrieve surfaceData for surfaceId=%"PRIu32"", __FUNCTION__, + WLog_ERR(TAG, "%s: unable to retrieve surfaceData for surfaceId=%" PRIu32 "", __FUNCTION__, cmd->surfaceId); return ERROR_NOT_FOUND; } @@ -486,27 +471,26 @@ static UINT gdi_SurfaceCommand_AVC420(rdpGdi* gdi, if (!surface->h264) return ERROR_NOT_SUPPORTED; - bs = (RDPGFX_AVC420_BITMAP_STREAM*) cmd->extra; + bs = (RDPGFX_AVC420_BITMAP_STREAM*)cmd->extra; if (!bs) return ERROR_INTERNAL_ERROR; meta = &(bs->meta); rc = avc420_decompress(surface->h264, bs->data, bs->length, surface->data, surface->format, - surface->scanline, surface->width, - surface->height, meta->regionRects, + surface->scanline, surface->width, surface->height, meta->regionRects, meta->numRegionRects); if (rc < 0) { - WLog_WARN(TAG, "avc420_decompress failure: %"PRId32", ignoring update.", rc); + WLog_WARN(TAG, "avc420_decompress failure: %" PRId32 ", ignoring update.", rc); return CHANNEL_RC_OK; } for (i = 0; i < meta->numRegionRects; i++) { region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), - (RECTANGLE_16*) & (meta->regionRects[i])); + (RECTANGLE_16*)&(meta->regionRects[i])); } status = IFCALLRESULT(CHANNEL_RC_OK, context->UpdateSurfaceArea, context, surface->surfaceId, @@ -546,11 +530,11 @@ static UINT gdi_SurfaceCommand_AVC444(rdpGdi* gdi, RdpgfxClientContext* context, RDPGFX_H264_METABLOCK* meta1; RDPGFX_AVC420_BITMAP_STREAM* avc2; RDPGFX_H264_METABLOCK* meta2; - surface = (gdiGfxSurface*) context->GetSurfaceData(context, cmd->surfaceId); + surface = (gdiGfxSurface*)context->GetSurfaceData(context, cmd->surfaceId); if (!surface) { - WLog_ERR(TAG, "%s: unable to retrieve surfaceData for surfaceId=%"PRIu32"", __FUNCTION__, + WLog_ERR(TAG, "%s: unable to retrieve surfaceData for surfaceId=%" PRIu32 "", __FUNCTION__, cmd->surfaceId); return ERROR_NOT_FOUND; } @@ -572,7 +556,7 @@ static UINT gdi_SurfaceCommand_AVC444(rdpGdi* gdi, RdpgfxClientContext* context, if (!surface->h264) return ERROR_NOT_SUPPORTED; - bs = (RDPGFX_AVC444_BITMAP_STREAM*) cmd->extra; + bs = (RDPGFX_AVC444_BITMAP_STREAM*)cmd->extra; if (!bs) return ERROR_INTERNAL_ERROR; @@ -581,24 +565,21 @@ static UINT gdi_SurfaceCommand_AVC444(rdpGdi* gdi, RdpgfxClientContext* context, avc2 = &bs->bitstream[1]; meta1 = &avc1->meta; meta2 = &avc2->meta; - rc = avc444_decompress(surface->h264, bs->LC, - meta1->regionRects, meta1->numRegionRects, - avc1->data, avc1->length, - meta2->regionRects, meta2->numRegionRects, - avc2->data, avc2->length, - surface->data, surface->format, - surface->scanline, surface->width, - surface->height, cmd->codecId); + rc = avc444_decompress(surface->h264, bs->LC, meta1->regionRects, meta1->numRegionRects, + avc1->data, avc1->length, meta2->regionRects, meta2->numRegionRects, + avc2->data, avc2->length, surface->data, surface->format, + surface->scanline, surface->width, surface->height, cmd->codecId); if (rc < 0) { - WLog_WARN(TAG, "avc444_decompress failure: %"PRIu32", ignoring update.", status); + WLog_WARN(TAG, "avc444_decompress failure: %" PRIu32 ", ignoring update.", status); return CHANNEL_RC_OK; } for (i = 0; i < meta1->numRegionRects; i++) { - region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &(meta1->regionRects[i])); + region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), + &(meta1->regionRects[i])); } status = IFCALLRESULT(CHANNEL_RC_OK, context->UpdateSurfaceArea, context, surface->surfaceId, @@ -609,7 +590,8 @@ static UINT gdi_SurfaceCommand_AVC444(rdpGdi* gdi, RdpgfxClientContext* context, for (i = 0; i < meta2->numRegionRects; i++) { - region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &(meta2->regionRects[i])); + region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), + &(meta2->regionRects[i])); } status = IFCALLRESULT(CHANNEL_RC_OK, context->UpdateSurfaceArea, context, surface->surfaceId, @@ -631,8 +613,8 @@ fail: #endif } -static BOOL gdi_apply_alpha(BYTE* data, UINT32 format, UINT32 stride, - RECTANGLE_16* rect, UINT32 startOffsetX, UINT32 count, BYTE a) +static BOOL gdi_apply_alpha(BYTE* data, UINT32 format, UINT32 stride, RECTANGLE_16* rect, + UINT32 startOffsetX, UINT32 count, BYTE a) { UINT32 y; UINT32 written = 0; @@ -658,7 +640,7 @@ static BOOL gdi_apply_alpha(BYTE* data, UINT32 format, UINT32 stride, SplitColor(color, format, &r, &g, &b, NULL, NULL); color = FreeRDPGetColor(format, r, g, b, a); WriteColor(src, format, color); - written ++; + written++; } first = FALSE; @@ -684,11 +666,11 @@ static UINT gdi_SurfaceCommand_Alpha(rdpGdi* gdi, RdpgfxClientContext* context, if (Stream_GetRemainingLength(&s) < 4) return ERROR_INVALID_DATA; - surface = (gdiGfxSurface*) context->GetSurfaceData(context, cmd->surfaceId); + surface = (gdiGfxSurface*)context->GetSurfaceData(context, cmd->surfaceId); if (!surface) { - WLog_ERR(TAG, "%s: unable to retrieve surfaceData for surfaceId=%"PRIu32"", __FUNCTION__, + WLog_ERR(TAG, "%s: unable to retrieve surfaceData for surfaceId=%" PRIu32 "", __FUNCTION__, cmd->surfaceId); return ERROR_NOT_FOUND; } @@ -759,8 +741,8 @@ static UINT gdi_SurfaceCommand_Alpha(rdpGdi* gdi, RdpgfxClientContext* context, } } - if (!gdi_apply_alpha(surface->data, surface->format, surface->scanline, &rect, startOffsetX, count, - a)) + if (!gdi_apply_alpha(surface->data, surface->format, surface->scanline, &rect, + startOffsetX, count, a)) return ERROR_INTERNAL_ERROR; startOffsetX += count; @@ -777,8 +759,7 @@ static UINT gdi_SurfaceCommand_Alpha(rdpGdi* gdi, RdpgfxClientContext* context, invalidRect.top = cmd->top; invalidRect.right = cmd->right; invalidRect.bottom = cmd->bottom; - region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), - &invalidRect); + region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect); status = IFCALLRESULT(CHANNEL_RC_OK, context->UpdateSurfaceArea, context, surface->surfaceId, 1, &invalidRect); @@ -800,9 +781,8 @@ fail: * * @return 0 on success, otherwise a Win32 error code */ -static UINT gdi_SurfaceCommand_Progressive(rdpGdi* gdi, - RdpgfxClientContext* context, - const RDPGFX_SURFACE_COMMAND* cmd) +static UINT gdi_SurfaceCommand_Progressive(rdpGdi* gdi, RdpgfxClientContext* context, + const RDPGFX_SURFACE_COMMAND* cmd) { INT32 rc; UINT status = CHANNEL_RC_OK; @@ -815,34 +795,32 @@ static UINT gdi_SurfaceCommand_Progressive(rdpGdi* gdi, * cmd's top/left/right/bottom/width/height members are always zero! * The update region is determined during decompression. */ - surface = (gdiGfxSurface*) context->GetSurfaceData(context, cmd->surfaceId); + surface = (gdiGfxSurface*)context->GetSurfaceData(context, cmd->surfaceId); if (!surface) { - WLog_ERR(TAG, "%s: unable to retrieve surfaceData for surfaceId=%"PRIu32"", __FUNCTION__, + WLog_ERR(TAG, "%s: unable to retrieve surfaceData for surfaceId=%" PRIu32 "", __FUNCTION__, cmd->surfaceId); return ERROR_NOT_FOUND; } - rc = progressive_create_surface_context(surface->codecs->progressive, - cmd->surfaceId, + rc = progressive_create_surface_context(surface->codecs->progressive, cmd->surfaceId, surface->width, surface->height); if (rc < 0) { - WLog_ERR(TAG, "progressive_create_surface_context failure: %"PRId32"", rc); + WLog_ERR(TAG, "progressive_create_surface_context failure: %" PRId32 "", rc); return ERROR_INTERNAL_ERROR; } region16_init(&invalidRegion); - rc = progressive_decompress(surface->codecs->progressive, cmd->data, - cmd->length, surface->data, surface->format, - surface->scanline, cmd->left, cmd->top, + rc = progressive_decompress(surface->codecs->progressive, cmd->data, cmd->length, surface->data, + surface->format, surface->scanline, cmd->left, cmd->top, &invalidRegion, cmd->surfaceId); if (rc < 0) { - WLog_ERR(TAG, "progressive_decompress failure: %"PRId32"", rc); + WLog_ERR(TAG, "progressive_decompress failure: %" PRId32 "", rc); region16_uninit(&invalidRegion); return ERROR_INTERNAL_ERROR; } @@ -874,8 +852,7 @@ fail: * * @return 0 on success, otherwise a Win32 error code */ -static UINT gdi_SurfaceCommand(RdpgfxClientContext* context, - const RDPGFX_SURFACE_COMMAND* cmd) +static UINT gdi_SurfaceCommand(RdpgfxClientContext* context, const RDPGFX_SURFACE_COMMAND* cmd) { UINT status = CHANNEL_RC_OK; rdpGdi* gdi; @@ -883,16 +860,17 @@ static UINT gdi_SurfaceCommand(RdpgfxClientContext* context, if (!context || !cmd) return ERROR_INVALID_PARAMETER; - gdi = (rdpGdi*) context->custom; + gdi = (rdpGdi*)context->custom; EnterCriticalSection(&context->mux); WLog_Print(gdi->log, WLOG_TRACE, - "surfaceId=%"PRIu32", codec=%"PRIu32", contextId=%"PRIu32", format=%s, " - "left=%"PRIu32", top=%"PRIu32", right=%"PRIu32", bottom=%"PRIu32", width=%"PRIu32", height=%"PRIu32" " - "length=%"PRIu32", data=%p, extra=%p", - cmd->surfaceId, cmd->codecId, cmd->contextId, - FreeRDPGetColorFormatName(cmd->format), cmd->left, cmd->top, cmd->right, - cmd->bottom, cmd->width, cmd->height, cmd->length, (void*) cmd->data, (void*) cmd->extra); + "surfaceId=%" PRIu32 ", codec=%" PRIu32 ", contextId=%" PRIu32 ", format=%s, " + "left=%" PRIu32 ", top=%" PRIu32 ", right=%" PRIu32 ", bottom=%" PRIu32 + ", width=%" PRIu32 ", height=%" PRIu32 " " + "length=%" PRIu32 ", data=%p, extra=%p", + cmd->surfaceId, cmd->codecId, cmd->contextId, FreeRDPGetColorFormatName(cmd->format), + cmd->left, cmd->top, cmd->right, cmd->bottom, cmd->width, cmd->height, cmd->length, + (void*)cmd->data, (void*)cmd->extra); switch (cmd->codecId) { @@ -930,11 +908,11 @@ static UINT gdi_SurfaceCommand(RdpgfxClientContext* context, break; case RDPGFX_CODECID_CAPROGRESSIVE_V2: - WLog_WARN(TAG, "SurfaceCommand 0x%08"PRIX32" not implemented", cmd->codecId); + WLog_WARN(TAG, "SurfaceCommand 0x%08" PRIX32 " not implemented", cmd->codecId); break; default: - WLog_WARN(TAG, "Invalid SurfaceCommand 0x%08"PRIX32"", cmd->codecId); + WLog_WARN(TAG, "Invalid SurfaceCommand 0x%08" PRIX32 "", cmd->codecId); break; } @@ -947,8 +925,9 @@ static UINT gdi_SurfaceCommand(RdpgfxClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT gdi_DeleteEncodingContext(RdpgfxClientContext* context, - const RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext) +static UINT +gdi_DeleteEncodingContext(RdpgfxClientContext* context, + const RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext) { return CHANNEL_RC_OK; } @@ -963,9 +942,9 @@ static UINT gdi_CreateSurface(RdpgfxClientContext* context, { UINT rc = ERROR_INTERNAL_ERROR; gdiGfxSurface* surface; - rdpGdi* gdi = (rdpGdi*) context->custom; + rdpGdi* gdi = (rdpGdi*)context->custom; EnterCriticalSection(&context->mux); - surface = (gdiGfxSurface*) calloc(1, sizeof(gdiGfxSurface)); + surface = (gdiGfxSurface*)calloc(1, sizeof(gdiGfxSurface)); if (!surface) goto fail; @@ -1002,7 +981,7 @@ static UINT gdi_CreateSurface(RdpgfxClientContext* context, } surface->scanline = gfx_align_scanline(surface->width * 4, 16); - surface->data = (BYTE*) _aligned_malloc(surface->scanline * surface->height, 16); + surface->data = (BYTE*)_aligned_malloc(surface->scanline * surface->height, 16); if (!surface->data) { @@ -1012,7 +991,7 @@ static UINT gdi_CreateSurface(RdpgfxClientContext* context, surface->outputMapped = FALSE; region16_init(&surface->invalidRegion); - rc = context->SetSurfaceData(context, surface->surfaceId, (void*) surface); + rc = context->SetSurfaceData(context, surface->surfaceId, (void*)surface); fail: LeaveCriticalSection(&context->mux); return rc; @@ -1030,12 +1009,13 @@ static UINT gdi_DeleteSurface(RdpgfxClientContext* context, rdpCodecs* codecs = NULL; gdiGfxSurface* surface = NULL; EnterCriticalSection(&context->mux); - surface = (gdiGfxSurface*) context->GetSurfaceData(context, deleteSurface->surfaceId); + surface = (gdiGfxSurface*)context->GetSurfaceData(context, deleteSurface->surfaceId); if (surface) { if (surface->windowId != 0) - rc = IFCALLRESULT(CHANNEL_RC_OK, context->UnmapWindowForSurface, context, surface->windowId); + rc = IFCALLRESULT(CHANNEL_RC_OK, context->UnmapWindowForSurface, context, + surface->windowId); #ifdef WITH_GFX_H264 h264_context_free(surface->h264); @@ -1060,8 +1040,7 @@ static UINT gdi_DeleteSurface(RdpgfxClientContext* context, * * @return 0 on success, otherwise a Win32 error code */ -static UINT gdi_SolidFill(RdpgfxClientContext* context, - const RDPGFX_SOLID_FILL_PDU* solidFill) +static UINT gdi_SolidFill(RdpgfxClientContext* context, const RDPGFX_SOLID_FILL_PDU* solidFill) { UINT status = ERROR_INTERNAL_ERROR; UINT16 index; @@ -1071,10 +1050,9 @@ static UINT gdi_SolidFill(RdpgfxClientContext* context, RECTANGLE_16* rect; gdiGfxSurface* surface; RECTANGLE_16 invalidRect; - rdpGdi* gdi = (rdpGdi*) context->custom; + rdpGdi* gdi = (rdpGdi*)context->custom; EnterCriticalSection(&context->mux); - surface = (gdiGfxSurface*) context->GetSurfaceData(context, - solidFill->surfaceId); + surface = (gdiGfxSurface*)context->GetSurfaceData(context, solidFill->surfaceId); if (!surface) goto fail; @@ -1097,12 +1075,11 @@ static UINT gdi_SolidFill(RdpgfxClientContext* context, invalidRect.right = rect->right; invalidRect.bottom = rect->bottom; - if (!freerdp_image_fill(surface->data, surface->format, surface->scanline, - rect->left, rect->top, nWidth, nHeight, color)) + if (!freerdp_image_fill(surface->data, surface->format, surface->scanline, rect->left, + rect->top, nWidth, nHeight, color)) goto fail; - region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), - &invalidRect); + region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect); } status = IFCALLRESULT(CHANNEL_RC_OK, context->UpdateSurfaceArea, context, surface->surfaceId, @@ -1142,17 +1119,16 @@ static UINT gdi_SurfaceToSurface(RdpgfxClientContext* context, RECTANGLE_16 invalidRect; gdiGfxSurface* surfaceSrc; gdiGfxSurface* surfaceDst; - rdpGdi* gdi = (rdpGdi*) context->custom; + rdpGdi* gdi = (rdpGdi*)context->custom; EnterCriticalSection(&context->mux); rectSrc = &(surfaceToSurface->rectSrc); - surfaceSrc = (gdiGfxSurface*) context->GetSurfaceData(context, - surfaceToSurface->surfaceIdSrc); - sameSurface = (surfaceToSurface->surfaceIdSrc == - surfaceToSurface->surfaceIdDest) ? TRUE : FALSE; + surfaceSrc = (gdiGfxSurface*)context->GetSurfaceData(context, surfaceToSurface->surfaceIdSrc); + sameSurface = + (surfaceToSurface->surfaceIdSrc == surfaceToSurface->surfaceIdDest) ? TRUE : FALSE; if (!sameSurface) - surfaceDst = (gdiGfxSurface*) context->GetSurfaceData(context, - surfaceToSurface->surfaceIdDest); + surfaceDst = + (gdiGfxSurface*)context->GetSurfaceData(context, surfaceToSurface->surfaceIdDest); else surfaceDst = surfaceSrc; @@ -1166,22 +1142,19 @@ static UINT gdi_SurfaceToSurface(RdpgfxClientContext* context, { destPt = &surfaceToSurface->destPts[index]; - if (!freerdp_image_copy(surfaceDst->data, surfaceDst->format, - surfaceDst->scanline, - destPt->x, destPt->y, nWidth, nHeight, - surfaceSrc->data, surfaceSrc->format, - surfaceSrc->scanline, - rectSrc->left, rectSrc->top, NULL, FREERDP_FLIP_NONE)) + if (!freerdp_image_copy(surfaceDst->data, surfaceDst->format, surfaceDst->scanline, + destPt->x, destPt->y, nWidth, nHeight, surfaceSrc->data, + surfaceSrc->format, surfaceSrc->scanline, rectSrc->left, + rectSrc->top, NULL, FREERDP_FLIP_NONE)) goto fail; invalidRect.left = destPt->x; invalidRect.top = destPt->y; invalidRect.right = destPt->x + rectSrc->right; invalidRect.bottom = destPt->y + rectSrc->bottom; - region16_union_rect(&surfaceDst->invalidRegion, &surfaceDst->invalidRegion, - &invalidRect); - status = IFCALLRESULT(CHANNEL_RC_OK, context->UpdateSurfaceArea, context, surfaceDst->surfaceId, 1, - &invalidRect); + region16_union_rect(&surfaceDst->invalidRegion, &surfaceDst->invalidRegion, &invalidRect); + status = IFCALLRESULT(CHANNEL_RC_OK, context->UpdateSurfaceArea, context, + surfaceDst->surfaceId, 1, &invalidRect); if (status != CHANNEL_RC_OK) goto fail; @@ -1215,12 +1188,12 @@ static UINT gdi_SurfaceToCache(RdpgfxClientContext* context, UINT rc = ERROR_INTERNAL_ERROR; EnterCriticalSection(&context->mux); rect = &(surfaceToCache->rectSrc); - surface = (gdiGfxSurface*) context->GetSurfaceData(context, surfaceToCache->surfaceId); + surface = (gdiGfxSurface*)context->GetSurfaceData(context, surfaceToCache->surfaceId); if (!surface) goto fail; - cacheEntry = (gdiGfxCacheEntry*) calloc(1, sizeof(gdiGfxCacheEntry)); + cacheEntry = (gdiGfxCacheEntry*)calloc(1, sizeof(gdiGfxCacheEntry)); if (!cacheEntry) goto fail; @@ -1229,7 +1202,7 @@ static UINT gdi_SurfaceToCache(RdpgfxClientContext* context, cacheEntry->height = (UINT32)(rect->bottom - rect->top); cacheEntry->format = surface->format; cacheEntry->scanline = gfx_align_scanline(cacheEntry->width * 4, 16); - cacheEntry->data = (BYTE*) calloc(cacheEntry->height, cacheEntry->scanline); + cacheEntry->data = (BYTE*)calloc(cacheEntry->height, cacheEntry->scanline); if (!cacheEntry->data) { @@ -1237,15 +1210,15 @@ static UINT gdi_SurfaceToCache(RdpgfxClientContext* context, goto fail; } - if (!freerdp_image_copy(cacheEntry->data, cacheEntry->format, cacheEntry->scanline, - 0, 0, cacheEntry->width, cacheEntry->height, surface->data, - surface->format, surface->scanline, rect->left, rect->top, NULL, FREERDP_FLIP_NONE)) + if (!freerdp_image_copy(cacheEntry->data, cacheEntry->format, cacheEntry->scanline, 0, 0, + cacheEntry->width, cacheEntry->height, surface->data, surface->format, + surface->scanline, rect->left, rect->top, NULL, FREERDP_FLIP_NONE)) { free(cacheEntry); goto fail; } - rc = context->SetCacheSlotData(context, surfaceToCache->cacheSlot, (void*) cacheEntry); + rc = context->SetCacheSlotData(context, surfaceToCache->cacheSlot, (void*)cacheEntry); fail: LeaveCriticalSection(&context->mux); return rc; @@ -1265,10 +1238,10 @@ static UINT gdi_CacheToSurface(RdpgfxClientContext* context, gdiGfxSurface* surface; gdiGfxCacheEntry* cacheEntry; RECTANGLE_16 invalidRect; - rdpGdi* gdi = (rdpGdi*) context->custom; + rdpGdi* gdi = (rdpGdi*)context->custom; EnterCriticalSection(&context->mux); - surface = (gdiGfxSurface*) context->GetSurfaceData(context, cacheToSurface->surfaceId); - cacheEntry = (gdiGfxCacheEntry*) context->GetCacheSlotData(context, cacheToSurface->cacheSlot); + surface = (gdiGfxSurface*)context->GetSurfaceData(context, cacheToSurface->surfaceId); + cacheEntry = (gdiGfxCacheEntry*)context->GetCacheSlotData(context, cacheToSurface->cacheSlot); if (!surface || !cacheEntry) goto fail; @@ -1277,20 +1250,19 @@ static UINT gdi_CacheToSurface(RdpgfxClientContext* context, { destPt = &cacheToSurface->destPts[index]; - if (!freerdp_image_copy(surface->data, surface->format, surface->scanline, - destPt->x, destPt->y, cacheEntry->width, cacheEntry->height, - cacheEntry->data, cacheEntry->format, cacheEntry->scanline, - 0, 0, NULL, FREERDP_FLIP_NONE)) + if (!freerdp_image_copy(surface->data, surface->format, surface->scanline, destPt->x, + destPt->y, cacheEntry->width, cacheEntry->height, cacheEntry->data, + cacheEntry->format, cacheEntry->scanline, 0, 0, NULL, + FREERDP_FLIP_NONE)) goto fail; invalidRect.left = destPt->x; invalidRect.top = destPt->y; invalidRect.right = destPt->x + cacheEntry->width; invalidRect.bottom = destPt->y + cacheEntry->height; - region16_union_rect(&surface->invalidRegion, &surface->invalidRegion, - &invalidRect); - status = IFCALLRESULT(CHANNEL_RC_OK, context->UpdateSurfaceArea, context, surface->surfaceId, 1, - &invalidRect); + region16_union_rect(&surface->invalidRegion, &surface->invalidRegion, &invalidRect); + status = IFCALLRESULT(CHANNEL_RC_OK, context->UpdateSurfaceArea, context, + surface->surfaceId, 1, &invalidRect); if (status != CHANNEL_RC_OK) goto fail; @@ -1334,8 +1306,7 @@ static UINT gdi_EvictCacheEntry(RdpgfxClientContext* context, gdiGfxCacheEntry* cacheEntry; UINT rc = ERROR_INTERNAL_ERROR; EnterCriticalSection(&context->mux); - cacheEntry = (gdiGfxCacheEntry*) context->GetCacheSlotData(context, - evictCacheEntry->cacheSlot); + cacheEntry = (gdiGfxCacheEntry*)context->GetCacheSlotData(context, evictCacheEntry->cacheSlot); if (cacheEntry) { @@ -1359,8 +1330,7 @@ static UINT gdi_MapSurfaceToOutput(RdpgfxClientContext* context, UINT rc = ERROR_INTERNAL_ERROR; gdiGfxSurface* surface; EnterCriticalSection(&context->mux); - surface = (gdiGfxSurface*) context->GetSurfaceData(context, - surfaceToOutput->surfaceId); + surface = (gdiGfxSurface*)context->GetSurfaceData(context, surfaceToOutput->surfaceId); if (!surface) goto fail; @@ -1377,14 +1347,14 @@ fail: return rc; } -static UINT gdi_MapSurfaceToScaledOutput(RdpgfxClientContext* context, - const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* surfaceToOutput) +static UINT +gdi_MapSurfaceToScaledOutput(RdpgfxClientContext* context, + const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* surfaceToOutput) { UINT rc = ERROR_INTERNAL_ERROR; gdiGfxSurface* surface; EnterCriticalSection(&context->mux); - surface = (gdiGfxSurface*) context->GetSurfaceData(context, - surfaceToOutput->surfaceId); + surface = (gdiGfxSurface*)context->GetSurfaceData(context, surfaceToOutput->surfaceId); if (!surface) goto fail; @@ -1412,8 +1382,7 @@ static UINT gdi_MapSurfaceToWindow(RdpgfxClientContext* context, UINT rc = ERROR_INTERNAL_ERROR; gdiGfxSurface* surface; EnterCriticalSection(&context->mux); - surface = (gdiGfxSurface*) context->GetSurfaceData(context, - surfaceToWindow->surfaceId); + surface = (gdiGfxSurface*)context->GetSurfaceData(context, surfaceToWindow->surfaceId); if (!surface) goto fail; @@ -1430,21 +1399,20 @@ static UINT gdi_MapSurfaceToWindow(RdpgfxClientContext* context, surface->outputTargetWidth = surfaceToWindow->mappedWidth; surface->outputTargetHeight = surfaceToWindow->mappedHeight; rc = IFCALLRESULT(CHANNEL_RC_OK, context->MapWindowForSurface, context, - surfaceToWindow->surfaceId, - surfaceToWindow->windowId); + surfaceToWindow->surfaceId, surfaceToWindow->windowId); fail: LeaveCriticalSection(&context->mux); return rc; } -static UINT gdi_MapSurfaceToScaledWindow(RdpgfxClientContext* context, - const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* surfaceToWindow) +static UINT +gdi_MapSurfaceToScaledWindow(RdpgfxClientContext* context, + const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* surfaceToWindow) { UINT rc = ERROR_INTERNAL_ERROR; gdiGfxSurface* surface; EnterCriticalSection(&context->mux); - surface = (gdiGfxSurface*) context->GetSurfaceData(context, - surfaceToWindow->surfaceId); + surface = (gdiGfxSurface*)context->GetSurfaceData(context, surfaceToWindow->surfaceId); if (!surface) goto fail; @@ -1461,8 +1429,7 @@ static UINT gdi_MapSurfaceToScaledWindow(RdpgfxClientContext* context, surface->outputTargetWidth = surfaceToWindow->targetWidth; surface->outputTargetHeight = surfaceToWindow->targetHeight; rc = IFCALLRESULT(CHANNEL_RC_OK, context->MapWindowForSurface, context, - surfaceToWindow->surfaceId, - surfaceToWindow->windowId); + surfaceToWindow->surfaceId, surfaceToWindow->windowId); fail: LeaveCriticalSection(&context->mux); return rc; @@ -1482,7 +1449,7 @@ BOOL gdi_graphics_pipeline_init_ex(rdpGdi* gdi, RdpgfxClientContext* gfx, return FALSE; gdi->gfx = gfx; - gfx->custom = (void*) gdi; + gfx->custom = (void*)gdi; gfx->ResetGraphics = gdi_ResetGraphics; gfx->StartFrame = gdi_StartFrame; gfx->EndFrame = gdi_EndFrame; @@ -1524,4 +1491,3 @@ void gdi_graphics_pipeline_uninit(rdpGdi* gdi, RdpgfxClientContext* gfx) PROFILER_PRINT_FOOTER PROFILER_FREE(gfx->SurfaceProfiler) } - diff --git a/libfreerdp/gdi/graphics.c b/libfreerdp/gdi/graphics.c index 159198756..f63df3983 100644 --- a/libfreerdp/gdi/graphics.c +++ b/libfreerdp/gdi/graphics.c @@ -39,8 +39,8 @@ #define TAG FREERDP_TAG("gdi") /* Bitmap Class */ -HGDI_BITMAP gdi_create_bitmap(rdpGdi* gdi, UINT32 nWidth, UINT32 nHeight, - UINT32 SrcFormat, BYTE* data) +HGDI_BITMAP gdi_create_bitmap(rdpGdi* gdi, UINT32 nWidth, UINT32 nHeight, UINT32 SrcFormat, + BYTE* data) { UINT32 nSrcStep; UINT32 nDstStep; @@ -60,9 +60,8 @@ HGDI_BITMAP gdi_create_bitmap(rdpGdi* gdi, UINT32 nWidth, UINT32 nHeight, pSrcData = data; nSrcStep = nWidth * GetBytesPerPixel(SrcFormat); - if (!freerdp_image_copy(pDstData, gdi->dstFormat, nDstStep, 0, 0, - nWidth, nHeight, pSrcData, SrcFormat, nSrcStep, 0, 0, - &gdi->palette, FREERDP_FLIP_NONE)) + if (!freerdp_image_copy(pDstData, gdi->dstFormat, nDstStep, 0, 0, nWidth, nHeight, pSrcData, + SrcFormat, nSrcStep, 0, 0, &gdi->palette, FREERDP_FLIP_NONE)) { _aligned_free(pDstData); return NULL; @@ -76,22 +75,19 @@ static BOOL gdi_Bitmap_New(rdpContext* context, rdpBitmap* bitmap) { gdiBitmap* gdi_bitmap; rdpGdi* gdi = context->gdi; - gdi_bitmap = (gdiBitmap*) bitmap; + gdi_bitmap = (gdiBitmap*)bitmap; gdi_bitmap->hdc = gdi_CreateCompatibleDC(gdi->hdc); if (!gdi_bitmap->hdc) return FALSE; if (!bitmap->data) - gdi_bitmap->bitmap = gdi_CreateCompatibleBitmap( - gdi->hdc, bitmap->width, - bitmap->height); + gdi_bitmap->bitmap = gdi_CreateCompatibleBitmap(gdi->hdc, bitmap->width, bitmap->height); else { UINT32 format = bitmap->format; - gdi_bitmap->bitmap = gdi_create_bitmap(gdi, bitmap->width, - bitmap->height, - format, bitmap->data); + gdi_bitmap->bitmap = + gdi_create_bitmap(gdi, bitmap->width, bitmap->height, format, bitmap->data); } if (!gdi_bitmap->bitmap) @@ -101,21 +97,21 @@ static BOOL gdi_Bitmap_New(rdpContext* context, rdpBitmap* bitmap) } gdi_bitmap->hdc->format = gdi_bitmap->bitmap->format; - gdi_SelectObject(gdi_bitmap->hdc, (HGDIOBJECT) gdi_bitmap->bitmap); + gdi_SelectObject(gdi_bitmap->hdc, (HGDIOBJECT)gdi_bitmap->bitmap); gdi_bitmap->org_bitmap = NULL; return TRUE; } static void gdi_Bitmap_Free(rdpContext* context, rdpBitmap* bitmap) { - gdiBitmap* gdi_bitmap = (gdiBitmap*) bitmap; + gdiBitmap* gdi_bitmap = (gdiBitmap*)bitmap; if (gdi_bitmap) { if (gdi_bitmap->hdc) - gdi_SelectObject(gdi_bitmap->hdc, (HGDIOBJECT) gdi_bitmap->org_bitmap); + gdi_SelectObject(gdi_bitmap->hdc, (HGDIOBJECT)gdi_bitmap->org_bitmap); - gdi_DeleteObject((HGDIOBJECT) gdi_bitmap->bitmap); + gdi_DeleteObject((HGDIOBJECT)gdi_bitmap->bitmap); gdi_DeleteDC(gdi_bitmap->hdc); _aligned_free(bitmap->data); } @@ -125,19 +121,16 @@ static void gdi_Bitmap_Free(rdpContext* context, rdpBitmap* bitmap) static BOOL gdi_Bitmap_Paint(rdpContext* context, rdpBitmap* bitmap) { - gdiBitmap* gdi_bitmap = (gdiBitmap*) bitmap; + gdiBitmap* gdi_bitmap = (gdiBitmap*)bitmap; UINT32 width = bitmap->right - bitmap->left + 1; UINT32 height = bitmap->bottom - bitmap->top + 1; - return gdi_BitBlt(context->gdi->primary->hdc, - bitmap->left, bitmap->top, - width, height, gdi_bitmap->hdc, - 0, 0, GDI_SRCCOPY, &context->gdi->palette); + return gdi_BitBlt(context->gdi->primary->hdc, bitmap->left, bitmap->top, width, height, + gdi_bitmap->hdc, 0, 0, GDI_SRCCOPY, &context->gdi->palette); } -static BOOL gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap, - const BYTE* pSrcData, UINT32 DstWidth, UINT32 DstHeight, - UINT32 bpp, UINT32 length, BOOL compressed, - UINT32 codecId) +static BOOL gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap, const BYTE* pSrcData, + UINT32 DstWidth, UINT32 DstHeight, UINT32 bpp, UINT32 length, + BOOL compressed, UINT32 codecId) { UINT32 SrcSize = length; rdpGdi* gdi = context->gdi; @@ -145,14 +138,14 @@ static BOOL gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap, bitmap->compressed = FALSE; bitmap->format = gdi->dstFormat; - if ((GetBytesPerPixel(bitmap->format) == 0) || - (DstWidth == 0) || (DstHeight == 0) || (DstWidth > UINT32_MAX / DstHeight) || + if ((GetBytesPerPixel(bitmap->format) == 0) || (DstWidth == 0) || (DstHeight == 0) || + (DstWidth > UINT32_MAX / DstHeight) || (size > (UINT32_MAX / GetBytesPerPixel(bitmap->format)))) return FALSE; size *= GetBytesPerPixel(bitmap->format); bitmap->length = size; - bitmap->data = (BYTE*) _aligned_malloc(bitmap->length, 16); + bitmap->data = (BYTE*)_aligned_malloc(bitmap->length, 16); if (!bitmap->data) return FALSE; @@ -161,21 +154,16 @@ static BOOL gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap, { if (bpp < 32) { - if (!interleaved_decompress(context->codecs->interleaved, - pSrcData, SrcSize, - DstWidth, DstHeight, - bpp, - bitmap->data, bitmap->format, - 0, 0, 0, DstWidth, DstHeight, - &gdi->palette)) + if (!interleaved_decompress(context->codecs->interleaved, pSrcData, SrcSize, DstWidth, + DstHeight, bpp, bitmap->data, bitmap->format, 0, 0, 0, + DstWidth, DstHeight, &gdi->palette)) return FALSE; } else { - if (!planar_decompress(context->codecs->planar, pSrcData, SrcSize, - DstWidth, DstHeight, - bitmap->data, bitmap->format, 0, 0, 0, - DstWidth, DstHeight, TRUE)) + if (!planar_decompress(context->codecs->planar, pSrcData, SrcSize, DstWidth, DstHeight, + bitmap->data, bitmap->format, 0, 0, 0, DstWidth, DstHeight, + TRUE)) return FALSE; } } @@ -191,21 +179,19 @@ static BOOL gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap, { const size_t dstSize = SrcSize * dbpp / sbpp; - if (dstSize < bitmap->length) + if (dstSize < bitmap->length) return FALSE; } - if (!freerdp_image_copy(bitmap->data, bitmap->format, 0, 0, 0, - DstWidth, DstHeight, pSrcData, SrcFormat, - 0, 0, 0, &gdi->palette, FREERDP_FLIP_VERTICAL)) + if (!freerdp_image_copy(bitmap->data, bitmap->format, 0, 0, 0, DstWidth, DstHeight, + pSrcData, SrcFormat, 0, 0, 0, &gdi->palette, FREERDP_FLIP_VERTICAL)) return FALSE; } return TRUE; } -static BOOL gdi_Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, - BOOL primary) +static BOOL gdi_Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, BOOL primary) { rdpGdi* gdi; @@ -220,7 +206,7 @@ static BOOL gdi_Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, if (primary) gdi->drawing = gdi->primary; else - gdi->drawing = (gdiBitmap*) bitmap; + gdi->drawing = (gdiBitmap*)bitmap; return TRUE; } @@ -234,7 +220,7 @@ static BOOL gdi_Glyph_New(rdpContext* context, const rdpGlyph* glyph) if (!context || !glyph) return FALSE; - gdi_glyph = (gdiGlyph*) glyph; + gdi_glyph = (gdiGlyph*)glyph; gdi_glyph->hdc = gdi_GetDC(); if (!gdi_glyph->hdc) @@ -249,8 +235,7 @@ static BOOL gdi_Glyph_New(rdpContext* context, const rdpGlyph* glyph) return FALSE; } - gdi_glyph->bitmap = gdi_CreateBitmap(glyph->cx, glyph->cy, PIXEL_FORMAT_MONO, - data); + gdi_glyph->bitmap = gdi_CreateBitmap(glyph->cx, glyph->cy, PIXEL_FORMAT_MONO, data); if (!gdi_glyph->bitmap) { @@ -259,7 +244,7 @@ static BOOL gdi_Glyph_New(rdpContext* context, const rdpGlyph* glyph) return FALSE; } - gdi_SelectObject(gdi_glyph->hdc, (HGDIOBJECT) gdi_glyph->bitmap); + gdi_SelectObject(gdi_glyph->hdc, (HGDIOBJECT)gdi_glyph->bitmap); gdi_glyph->org_bitmap = NULL; return TRUE; } @@ -267,20 +252,20 @@ static BOOL gdi_Glyph_New(rdpContext* context, const rdpGlyph* glyph) static void gdi_Glyph_Free(rdpContext* context, rdpGlyph* glyph) { gdiGlyph* gdi_glyph; - gdi_glyph = (gdiGlyph*) glyph; + gdi_glyph = (gdiGlyph*)glyph; if (gdi_glyph) { - gdi_SelectObject(gdi_glyph->hdc, (HGDIOBJECT) gdi_glyph->org_bitmap); - gdi_DeleteObject((HGDIOBJECT) gdi_glyph->bitmap); + gdi_SelectObject(gdi_glyph->hdc, (HGDIOBJECT)gdi_glyph->org_bitmap); + gdi_DeleteObject((HGDIOBJECT)gdi_glyph->bitmap); gdi_DeleteDC(gdi_glyph->hdc); free(glyph->aj); free(glyph); } } -static BOOL gdi_Glyph_Draw(rdpContext* context, const rdpGlyph* glyph, INT32 x, - INT32 y, INT32 w, INT32 h, INT32 sx, INT32 sy, BOOL fOpRedundant) +static BOOL gdi_Glyph_Draw(rdpContext* context, const rdpGlyph* glyph, INT32 x, INT32 y, INT32 w, + INT32 h, INT32 sx, INT32 sy, BOOL fOpRedundant) { gdiGlyph* gdi_glyph; rdpGdi* gdi; @@ -291,7 +276,7 @@ static BOOL gdi_Glyph_Draw(rdpContext* context, const rdpGlyph* glyph, INT32 x, return FALSE; gdi = context->gdi; - gdi_glyph = (gdiGlyph*) glyph; + gdi_glyph = (gdiGlyph*)glyph; if (!fOpRedundant && 0) { @@ -327,8 +312,8 @@ static BOOL gdi_Glyph_Draw(rdpContext* context, const rdpGlyph* glyph, INT32 x, return FALSE; gdi_SelectObject(gdi->drawing->hdc, (HGDIOBJECT)brush); - rc = gdi_BitBlt(gdi->drawing->hdc, x, y, w, h, gdi_glyph->hdc, sx, sy, - GDI_GLYPH_ORDER, &context->gdi->palette); + rc = gdi_BitBlt(gdi->drawing->hdc, x, y, w, h, gdi_glyph->hdc, sx, sy, GDI_GLYPH_ORDER, + &context->gdi->palette); gdi_DeleteObject((HGDIOBJECT)brush); return rc; } @@ -348,9 +333,8 @@ static BOOL gdi_Glyph_SetBounds(rdpContext* context, INT32 x, INT32 y, INT32 wid return gdi_SetClipRgn(gdi->drawing->hdc, x, y, width, height); } -static BOOL gdi_Glyph_BeginDraw(rdpContext* context, INT32 x, INT32 y, - INT32 width, INT32 height, UINT32 bgcolor, - UINT32 fgcolor, BOOL fOpRedundant) +static BOOL gdi_Glyph_BeginDraw(rdpContext* context, INT32 x, INT32 y, INT32 width, INT32 height, + UINT32 bgcolor, UINT32 fgcolor, BOOL fOpRedundant) { rdpGdi* gdi; @@ -403,8 +387,8 @@ static BOOL gdi_Glyph_BeginDraw(rdpContext* context, INT32 x, INT32 y, return TRUE; } -static BOOL gdi_Glyph_EndDraw(rdpContext* context, INT32 x, INT32 y, - INT32 width, INT32 height, UINT32 bgcolor, UINT32 fgcolor) +static BOOL gdi_Glyph_EndDraw(rdpContext* context, INT32 x, INT32 y, INT32 width, INT32 height, + UINT32 bgcolor, UINT32 fgcolor) { rdpGdi* gdi; diff --git a/libfreerdp/gdi/graphics.h b/libfreerdp/gdi/graphics.h index 1c6e166d6..4a73707b4 100644 --- a/libfreerdp/gdi/graphics.h +++ b/libfreerdp/gdi/graphics.h @@ -26,9 +26,8 @@ #include #include -FREERDP_LOCAL HGDI_BITMAP gdi_create_bitmap(rdpGdi* gdi, UINT32 width, - UINT32 height, - UINT32 format, BYTE* data); +FREERDP_LOCAL HGDI_BITMAP gdi_create_bitmap(rdpGdi* gdi, UINT32 width, UINT32 height, UINT32 format, + BYTE* data); FREERDP_LOCAL BOOL gdi_register_graphics(rdpGraphics* graphics); diff --git a/libfreerdp/gdi/line.c b/libfreerdp/gdi/line.c index cc022e50c..f1b370954 100644 --- a/libfreerdp/gdi/line.c +++ b/libfreerdp/gdi/line.c @@ -147,7 +147,7 @@ BOOL gdi_LineTo(HGDI_DC hdc, UINT32 nXEnd, UINT32 nYEnd) e = dx - dy; x = x1; y = y1; - bmp = (HGDI_BITMAP) hdc->selectedObject; + bmp = (HGDI_BITMAP)hdc->selectedObject; if (hdc->clip->null) { @@ -271,8 +271,7 @@ BOOL gdi_Polyline(HGDI_DC hdc, GDI_POINT* lppt, UINT32 cPoints) * @param cCount count of entries in lpdwPolyPoints * @return nonzero on success, 0 otherwise */ -BOOL gdi_PolyPolyline(HGDI_DC hdc, GDI_POINT* lppt, UINT32* lpdwPolyPoints, - DWORD cCount) +BOOL gdi_PolyPolyline(HGDI_DC hdc, GDI_POINT* lppt, UINT32* lpdwPolyPoints, DWORD cCount) { UINT32 cPoints; DWORD i, j = 0; diff --git a/libfreerdp/gdi/line.h b/libfreerdp/gdi/line.h index f583ca61c..d4f826717 100644 --- a/libfreerdp/gdi/line.h +++ b/libfreerdp/gdi/line.h @@ -26,16 +26,16 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -FREERDP_LOCAL BOOL gdi_LineTo(HGDI_DC hdc, UINT32 nXEnd, UINT32 nYEnd); -FREERDP_LOCAL BOOL gdi_PolylineTo(HGDI_DC hdc, GDI_POINT* lppt, DWORD cCount); -FREERDP_LOCAL BOOL gdi_Polyline(HGDI_DC hdc, GDI_POINT* lppt, UINT32 cPoints); -FREERDP_LOCAL BOOL gdi_PolyPolyline(HGDI_DC hdc, GDI_POINT* lppt, - UINT32* lpdwPolyPoints, DWORD cCount); -FREERDP_LOCAL BOOL gdi_MoveToEx(HGDI_DC hdc, UINT32 X, UINT32 Y, - HGDI_POINT lpPoint); + FREERDP_LOCAL BOOL gdi_LineTo(HGDI_DC hdc, UINT32 nXEnd, UINT32 nYEnd); + FREERDP_LOCAL BOOL gdi_PolylineTo(HGDI_DC hdc, GDI_POINT* lppt, DWORD cCount); + FREERDP_LOCAL BOOL gdi_Polyline(HGDI_DC hdc, GDI_POINT* lppt, UINT32 cPoints); + FREERDP_LOCAL BOOL gdi_PolyPolyline(HGDI_DC hdc, GDI_POINT* lppt, UINT32* lpdwPolyPoints, + DWORD cCount); + FREERDP_LOCAL BOOL gdi_MoveToEx(HGDI_DC hdc, UINT32 X, UINT32 Y, HGDI_POINT lpPoint); #ifdef __cplusplus } diff --git a/libfreerdp/gdi/pen.c b/libfreerdp/gdi/pen.c index 872127ed4..406a35b88 100644 --- a/libfreerdp/gdi/pen.c +++ b/libfreerdp/gdi/pen.c @@ -41,10 +41,10 @@ * @return new pen */ -HGDI_PEN gdi_CreatePen(UINT32 fnPenStyle, UINT32 nWidth, UINT32 crColor, - UINT32 format, const gdiPalette* palette) +HGDI_PEN gdi_CreatePen(UINT32 fnPenStyle, UINT32 nWidth, UINT32 crColor, UINT32 format, + const gdiPalette* palette) { - HGDI_PEN hPen = (HGDI_PEN) calloc(1, sizeof(GDI_PEN)); + HGDI_PEN hPen = (HGDI_PEN)calloc(1, sizeof(GDI_PEN)); if (!hPen) return NULL; hPen->objectType = GDIOBJECT_PEN; diff --git a/libfreerdp/gdi/region.c b/libfreerdp/gdi/region.c index bd10978be..072cb4e76 100644 --- a/libfreerdp/gdi/region.c +++ b/libfreerdp/gdi/region.c @@ -47,10 +47,9 @@ * @return new region */ -HGDI_RGN gdi_CreateRectRgn(INT32 nLeftRect, INT32 nTopRect, - INT32 nRightRect, INT32 nBottomRect) +HGDI_RGN gdi_CreateRectRgn(INT32 nLeftRect, INT32 nTopRect, INT32 nRightRect, INT32 nBottomRect) { - HGDI_RGN hRgn = (HGDI_RGN) calloc(1, sizeof(GDI_RGN)); + HGDI_RGN hRgn = (HGDI_RGN)calloc(1, sizeof(GDI_RGN)); if (!hRgn) return NULL; @@ -73,10 +72,9 @@ HGDI_RGN gdi_CreateRectRgn(INT32 nLeftRect, INT32 nTopRect, * @return new rectangle */ -HGDI_RECT gdi_CreateRect(INT32 xLeft, INT32 yTop, - INT32 xRight, INT32 yBottom) +HGDI_RECT gdi_CreateRect(INT32 xLeft, INT32 yTop, INT32 xRight, INT32 yBottom) { - HGDI_RECT hRect = (HGDI_RECT) calloc(1, sizeof(GDI_RECT)); + HGDI_RECT hRect = (HGDI_RECT)calloc(1, sizeof(GDI_RECT)); if (!hRect) return NULL; @@ -112,8 +110,7 @@ INLINE void gdi_RectToRgn(HGDI_RECT rect, HGDI_RGN rgn) * @param rgn destination region */ -INLINE void gdi_CRectToRgn(INT32 left, INT32 top, - INT32 right, INT32 bottom, HGDI_RGN rgn) +INLINE void gdi_CRectToRgn(INT32 left, INT32 top, INT32 right, INT32 bottom, HGDI_RGN rgn) { rgn->x = left; rgn->y = top; @@ -130,9 +127,7 @@ INLINE void gdi_CRectToRgn(INT32 left, INT32 top, * @param h height */ -INLINE void gdi_RectToCRgn(const HGDI_RECT rect, - INT32* x, INT32* y, - INT32* w, INT32* h) +INLINE void gdi_RectToCRgn(const HGDI_RECT rect, INT32* x, INT32* y, INT32* w, INT32* h) { *x = rect->left; *y = rect->top; @@ -152,9 +147,8 @@ INLINE void gdi_RectToCRgn(const HGDI_RECT rect, * @param h height */ -INLINE void gdi_CRectToCRgn(INT32 left, INT32 top, INT32 right, - INT32 bottom, - INT32* x, INT32* y, INT32* w, INT32* h) +INLINE void gdi_CRectToCRgn(INT32 left, INT32 top, INT32 right, INT32 bottom, INT32* x, INT32* y, + INT32* w, INT32* h) { *x = left; *y = top; @@ -185,8 +179,7 @@ INLINE void gdi_RgnToRect(HGDI_RGN rgn, HGDI_RECT rect) * @param rect destination rectangle */ -INLINE void gdi_CRgnToRect(INT64 x, INT64 y, INT32 w, INT32 h, - HGDI_RECT rect) +INLINE void gdi_CRgnToRect(INT64 x, INT64 y, INT32 w, INT32 h, HGDI_RECT rect) { BOOL invalid = FALSE; const INT64 r = x + w - 1; @@ -208,8 +201,8 @@ INLINE void gdi_CRgnToRect(INT64 x, INT64 y, INT32 w, INT32 h, if (invalid) { - WLog_DBG(TAG, "Invisible rectangle %"PRId64"x%"PRId64"-%"PRId64"x%"PRId64, - x, y, r, b); + WLog_DBG(TAG, "Invisible rectangle %" PRId64 "x%" PRId64 "-%" PRId64 "x%" PRId64, x, y, r, + b); } } @@ -222,8 +215,7 @@ INLINE void gdi_CRgnToRect(INT64 x, INT64 y, INT32 w, INT32 h, * @param bottom y2 */ -INLINE void gdi_RgnToCRect(HGDI_RGN rgn, INT32* left, INT32* top, - INT32* right, INT32* bottom) +INLINE void gdi_RgnToCRect(HGDI_RGN rgn, INT32* left, INT32* top, INT32* right, INT32* bottom) { *left = rgn->x; *top = rgn->y; @@ -243,8 +235,8 @@ INLINE void gdi_RgnToCRect(HGDI_RGN rgn, INT32* left, INT32* top, * @param bottom y2 */ -INLINE void gdi_CRgnToCRect(INT32 x, INT32 y, INT32 w, INT32 h, - INT32* left, INT32* top, INT32* right, INT32* bottom) +INLINE void gdi_CRgnToCRect(INT32 x, INT32 y, INT32 w, INT32 h, INT32* left, INT32* top, + INT32* right, INT32* bottom) { *left = x; *top = y; @@ -274,15 +266,16 @@ INLINE void gdi_CRgnToCRect(INT32 x, INT32 y, INT32 w, INT32 h, * @return nonzero if there is an overlap, 0 otherwise */ -INLINE BOOL gdi_CopyOverlap(INT32 x, INT32 y, INT32 width, INT32 height, - INT32 srcx, INT32 srcy) +INLINE BOOL gdi_CopyOverlap(INT32 x, INT32 y, INT32 width, INT32 height, INT32 srcx, INT32 srcy) { GDI_RECT dst; GDI_RECT src; gdi_CRgnToRect(x, y, width, height, &dst); gdi_CRgnToRect(srcx, srcy, width, height, &src); - return (dst.right >= src.left && dst.left <= src.right && - dst.bottom >= src.top && dst.top <= src.bottom) ? TRUE : FALSE; + return (dst.right >= src.left && dst.left <= src.right && dst.bottom >= src.top && + dst.top <= src.bottom) + ? TRUE + : FALSE; } /** @@ -296,8 +289,7 @@ INLINE BOOL gdi_CopyOverlap(INT32 x, INT32 y, INT32 width, INT32 height, * @return nonzero if successful, 0 otherwise */ -INLINE BOOL gdi_SetRect(HGDI_RECT rc, INT32 xLeft, INT32 yTop, - INT32 xRight, INT32 yBottom) +INLINE BOOL gdi_SetRect(HGDI_RECT rc, INT32 xLeft, INT32 yTop, INT32 xRight, INT32 yBottom) { rc->left = xLeft; rc->top = yTop; @@ -316,8 +308,7 @@ INLINE BOOL gdi_SetRect(HGDI_RECT rc, INT32 xLeft, INT32 yTop, * @return nonzero if successful, 0 otherwise */ -INLINE BOOL gdi_SetRgn(HGDI_RGN hRgn, INT32 nXLeft, INT32 nYLeft, - INT32 nWidth, INT32 nHeight) +INLINE BOOL gdi_SetRgn(HGDI_RGN hRgn, INT32 nXLeft, INT32 nYLeft, INT32 nWidth, INT32 nHeight) { hRgn->x = nXLeft; hRgn->y = nYLeft; @@ -337,8 +328,8 @@ INLINE BOOL gdi_SetRgn(HGDI_RGN hRgn, INT32 nXLeft, INT32 nYLeft, * @return nonzero if successful, 0 otherwise */ -INLINE BOOL gdi_SetRectRgn(HGDI_RGN hRgn, INT32 nLeftRect, INT32 nTopRect, - INT32 nRightRect, INT32 nBottomRect) +INLINE BOOL gdi_SetRectRgn(HGDI_RGN hRgn, INT32 nLeftRect, INT32 nTopRect, INT32 nRightRect, + INT32 nBottomRect) { gdi_CRectToRgn(nLeftRect, nTopRect, nRightRect, nBottomRect, hRgn); hRgn->null = FALSE; @@ -355,10 +346,8 @@ INLINE BOOL gdi_SetRectRgn(HGDI_RGN hRgn, INT32 nLeftRect, INT32 nTopRect, INLINE BOOL gdi_EqualRgn(HGDI_RGN hSrcRgn1, HGDI_RGN hSrcRgn2) { - if ((hSrcRgn1->x == hSrcRgn2->x) && - (hSrcRgn1->y == hSrcRgn2->y) && - (hSrcRgn1->w == hSrcRgn2->w) && - (hSrcRgn1->h == hSrcRgn2->h)) + if ((hSrcRgn1->x == hSrcRgn2->x) && (hSrcRgn1->y == hSrcRgn2->y) && + (hSrcRgn1->w == hSrcRgn2->w) && (hSrcRgn1->h == hSrcRgn2->h)) { return TRUE; } @@ -420,8 +409,7 @@ INLINE BOOL gdi_PtInRect(HGDI_RECT rc, INT32 x, INT32 y) * @return nonzero on success, 0 otherwise */ -INLINE BOOL gdi_InvalidateRegion(HGDI_DC hdc, INT32 x, INT32 y, INT32 w, - INT32 h) +INLINE BOOL gdi_InvalidateRegion(HGDI_DC hdc, INT32 x, INT32 y, INT32 w, INT32 h) { GDI_RECT inv; GDI_RECT rgn; @@ -444,7 +432,7 @@ INLINE BOOL gdi_InvalidateRegion(HGDI_DC hdc, INT32 x, INT32 y, INT32 w, int new_cnt; HGDI_RGN new_rgn; new_cnt = hdc->hwnd->count * 2; - new_rgn = (HGDI_RGN) realloc(cinvalid, sizeof(GDI_RGN) * new_cnt); + new_rgn = (HGDI_RGN)realloc(cinvalid, sizeof(GDI_RGN) * new_cnt); if (!new_rgn) return FALSE; diff --git a/libfreerdp/gdi/shape.c b/libfreerdp/gdi/shape.c index 63eb032b0..9d9ae4d80 100644 --- a/libfreerdp/gdi/shape.c +++ b/libfreerdp/gdi/shape.c @@ -88,8 +88,7 @@ static void Ellipse_Bresenham(HGDI_DC hdc, int x1, int y1, int x2, int y2) y2--; e += dy += a; } - } - while (x1 <= x2); + } while (x1 <= x2); while (y1 - y2 < b) { @@ -108,8 +107,7 @@ static void Ellipse_Bresenham(HGDI_DC hdc, int x1, int y1, int x2, int y2) * @param nBottomRect y2 * @return nonzero if successful, 0 otherwise */ -BOOL gdi_Ellipse(HGDI_DC hdc, int nLeftRect, int nTopRect, int nRightRect, - int nBottomRect) +BOOL gdi_Ellipse(HGDI_DC hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect) { Ellipse_Bresenham(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); return TRUE; @@ -148,8 +146,7 @@ BOOL gdi_FillRect(HGDI_DC hdc, const HGDI_RECT rect, HGDI_BRUSH hbr) for (x = 0; x < nWidth; x++) { - BYTE* dstp = gdi_get_bitmap_pointer(hdc, nXDest + x, - nYDest); + BYTE* dstp = gdi_get_bitmap_pointer(hdc, nXDest + x, nYDest); if (dstp) WriteColor(dstp, hdc->format, color); @@ -175,12 +172,11 @@ BOOL gdi_FillRect(HGDI_DC hdc, const HGDI_RECT rect, HGDI_BRUSH hbr) { for (x = 0; x < nWidth; x++) { - const UINT32 yOffset = ((nYDest + y) * hbr->pattern->width % - hbr->pattern->height) * formatSize; + const UINT32 yOffset = + ((nYDest + y) * hbr->pattern->width % hbr->pattern->height) * formatSize; const UINT32 xOffset = ((nXDest + x) % hbr->pattern->width) * formatSize; const BYTE* patp = &hbr->pattern->data[yOffset + xOffset]; - BYTE* dstp = gdi_get_bitmap_pointer(hdc, nXDest + x, - nYDest + y); + BYTE* dstp = gdi_get_bitmap_pointer(hdc, nXDest + x, nYDest + y); if (!patp) return FALSE; @@ -195,7 +191,8 @@ BOOL gdi_FillRect(HGDI_DC hdc, const HGDI_RECT rect, HGDI_BRUSH hbr) else { dstColor = ReadColor(patp, hbr->pattern->format); - dstColor = FreeRDPConvertColor(dstColor, hbr->pattern->format, hdc->format, NULL); + dstColor = + FreeRDPConvertColor(dstColor, hbr->pattern->format, hdc->format, NULL); } if (dstp) @@ -215,7 +212,6 @@ BOOL gdi_FillRect(HGDI_DC hdc, const HGDI_RECT rect, HGDI_BRUSH hbr) return TRUE; } - /** * Draw a polygon * @msdn{dd162814} @@ -239,15 +235,13 @@ BOOL gdi_Polygon(HGDI_DC hdc, GDI_POINT* lpPoints, int nCount) * @param nCount count of number of points in lpPolyCounts * @return nonzero if successful, 0 otherwise */ -BOOL gdi_PolyPolygon(HGDI_DC hdc, GDI_POINT* lpPoints, int* lpPolyCounts, - int nCount) +BOOL gdi_PolyPolygon(HGDI_DC hdc, GDI_POINT* lpPoints, int* lpPolyCounts, int nCount) { WLog_ERR(TAG, "Not implemented!"); return FALSE; } -BOOL gdi_Rectangle(HGDI_DC hdc, INT32 nXDst, INT32 nYDst, INT32 nWidth, - INT32 nHeight) +BOOL gdi_Rectangle(HGDI_DC hdc, INT32 nXDst, INT32 nYDst, INT32 nWidth, INT32 nHeight) { INT32 x, y; UINT32 color; @@ -259,10 +253,8 @@ BOOL gdi_Rectangle(HGDI_DC hdc, INT32 nXDst, INT32 nYDst, INT32 nWidth, for (y = 0; y < nHeight; y++) { - BYTE* dstLeft = gdi_get_bitmap_pointer(hdc, nXDst, - nYDst + y); - BYTE* dstRight = gdi_get_bitmap_pointer(hdc, nXDst + nWidth - 1, - nYDst + y); + BYTE* dstLeft = gdi_get_bitmap_pointer(hdc, nXDst, nYDst + y); + BYTE* dstRight = gdi_get_bitmap_pointer(hdc, nXDst + nWidth - 1, nYDst + y); if (dstLeft) WriteColor(dstLeft, hdc->format, color); @@ -273,10 +265,8 @@ BOOL gdi_Rectangle(HGDI_DC hdc, INT32 nXDst, INT32 nYDst, INT32 nWidth, for (x = 0; x < nWidth; x++) { - BYTE* dstTop = gdi_get_bitmap_pointer(hdc, nXDst + x, - nYDst); - BYTE* dstBottom = gdi_get_bitmap_pointer(hdc, nXDst + x, - nYDst + nHeight - 1); + BYTE* dstTop = gdi_get_bitmap_pointer(hdc, nXDst + x, nYDst); + BYTE* dstBottom = gdi_get_bitmap_pointer(hdc, nXDst + x, nYDst + nHeight - 1); if (dstTop) WriteColor(dstTop, hdc->format, color); diff --git a/libfreerdp/gdi/test/TestGdiBitBlt.c b/libfreerdp/gdi/test/TestGdiBitBlt.c index b07f02afa..94a27c30b 100644 --- a/libfreerdp/gdi/test/TestGdiBitBlt.c +++ b/libfreerdp/gdi/test/TestGdiBitBlt.c @@ -15,8 +15,7 @@ /* BitBlt() Test Data */ /* source bitmap (16x16) */ -static const BYTE bmp_SRC[256] = -{ +static const BYTE bmp_SRC[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF" @@ -36,8 +35,7 @@ static const BYTE bmp_SRC[256] = }; /* destination bitmap (16x16) */ -static const BYTE bmp_DST[256] = -{ +static const BYTE bmp_DST[256] = { "\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -57,8 +55,7 @@ static const BYTE bmp_DST[256] = }; /* SRCCOPY (0x00CC0020) */ -static const BYTE bmp_SRCCOPY[256] = -{ +static const BYTE bmp_SRCCOPY[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF" @@ -78,8 +75,7 @@ static const BYTE bmp_SRCCOPY[256] = }; /* BLACKNESS (0x00000042) */ -static const BYTE bmp_BLACKNESS[256] = -{ +static const BYTE bmp_BLACKNESS[256] = { "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" @@ -99,8 +95,7 @@ static const BYTE bmp_BLACKNESS[256] = }; /* WHITENESS (0x00FF0062) */ -static const BYTE bmp_WHITENESS[256] = -{ +static const BYTE bmp_WHITENESS[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -120,8 +115,7 @@ static const BYTE bmp_WHITENESS[256] = }; /* SRCAND (0x008800C6) */ -static const BYTE bmp_SRCAND[256] = -{ +static const BYTE bmp_SRCAND[256] = { "\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF" @@ -141,8 +135,7 @@ static const BYTE bmp_SRCAND[256] = }; /* SRCPAINT (0x00EE0086) */ -static const BYTE bmp_SRCPAINT[256] = -{ +static const BYTE bmp_SRCPAINT[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -162,8 +155,7 @@ static const BYTE bmp_SRCPAINT[256] = }; /* SRCINVERT (0x00660046) */ -static const BYTE bmp_SRCINVERT[256] = -{ +static const BYTE bmp_SRCINVERT[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x00\x00\x00\x00" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x00\x00\x00\x00" "\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\xFF\xFF\x00\x00\x00\x00\x00\x00" @@ -183,8 +175,7 @@ static const BYTE bmp_SRCINVERT[256] = }; /* SRCERASE (0x00440328) */ -static const BYTE bmp_SRCERASE[256] = -{ +static const BYTE bmp_SRCERASE[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x00\x00\x00\x00" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x00\x00\x00\x00" "\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" @@ -204,8 +195,7 @@ static const BYTE bmp_SRCERASE[256] = }; /* NOTSRCCOPY (0x00330008) */ -static const BYTE bmp_NOTSRCCOPY[256] = -{ +static const BYTE bmp_NOTSRCCOPY[256] = { "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x00\x00" @@ -225,8 +215,7 @@ static const BYTE bmp_NOTSRCCOPY[256] = }; /* NOTSRCERASE (0x001100A6) */ -static const BYTE bmp_NOTSRCERASE[256] = -{ +static const BYTE bmp_NOTSRCERASE[256] = { "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\xFF\xFF\x00\x00\x00\x00\x00\x00\x00\x00" @@ -246,8 +235,7 @@ static const BYTE bmp_NOTSRCERASE[256] = }; /* DSTINVERT (0x00550009) */ -static const BYTE bmp_DSTINVERT[256] = -{ +static const BYTE bmp_DSTINVERT[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x00\x00\x00\x00" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x00\x00\x00\x00" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x00\x00\x00\x00" @@ -267,8 +255,7 @@ static const BYTE bmp_DSTINVERT[256] = }; /* SPna (0x000C0324) */ -static const BYTE bmp_SPna[256] = -{ +static const BYTE bmp_SPna[256] = { "\x00\x00\xFF\xFF\x00\x00\xFF\xFF\x00\x00\xFF\xFF\x00\x00\xFF\xFF" "\x00\x00\xFF\xFF\x00\x00\xFF\xFF\x00\x00\xFF\xFF\x00\x00\xFF\xFF" "\xFF\xFF\x00\x00\xFF\xFF\x00\x00\x00\x00\x00\x00\xFF\xFF\x00\x00" @@ -288,8 +275,7 @@ static const BYTE bmp_SPna[256] = }; /* MERGEPAINT (0x00BB0226) */ -static const BYTE bmp_MERGEPAINT[256] = -{ +static const BYTE bmp_MERGEPAINT[256] = { "\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -309,8 +295,7 @@ static const BYTE bmp_MERGEPAINT[256] = }; /* MERGECOPY (0x00C000CA) */ -static const BYTE bmp_MERGECOPY[256] = -{ +static const BYTE bmp_MERGECOPY[256] = { "\xFF\xFF\x00\x00\xFF\xFF\x00\x00\xFF\xFF\x00\x00\xFF\xFF\x00\x00" "\xFF\xFF\x00\x00\xFF\xFF\x00\x00\xFF\xFF\x00\x00\xFF\xFF\x00\x00" "\x00\x00\xFF\xFF\x00\x00\x00\x00\x00\x00\xFF\xFF\x00\x00\xFF\xFF" @@ -330,8 +315,7 @@ static const BYTE bmp_MERGECOPY[256] = }; /* PATPAINT (0x00FB0A09) */ -static const BYTE bmp_PATPAINT[256] = -{ +static const BYTE bmp_PATPAINT[256] = { "\xFF\xFF\x00\x00\xFF\xFF\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\x00\x00\xFF\xFF\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\x00\x00\xFF\xFF\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -351,8 +335,7 @@ static const BYTE bmp_PATPAINT[256] = }; /* PATCOPY (0x00F00021) */ -static const BYTE bmp_PATCOPY[256] = -{ +static const BYTE bmp_PATCOPY[256] = { "\xFF\xFF\x00\x00\xFF\xFF\x00\x00\xFF\xFF\x00\x00\xFF\xFF\x00\x00" "\xFF\xFF\x00\x00\xFF\xFF\x00\x00\xFF\xFF\x00\x00\xFF\xFF\x00\x00" "\x00\x00\xFF\xFF\x00\x00\xFF\xFF\x00\x00\xFF\xFF\x00\x00\xFF\xFF" @@ -372,8 +355,7 @@ static const BYTE bmp_PATCOPY[256] = }; /* PATINVERT (0x005A0049) */ -static const BYTE bmp_PATINVERT[256] = -{ +static const BYTE bmp_PATINVERT[256] = { "\xFF\xFF\x00\x00\xFF\xFF\x00\x00\x00\x00\xFF\xFF\x00\x00\xFF\xFF" "\xFF\xFF\x00\x00\xFF\xFF\x00\x00\x00\x00\xFF\xFF\x00\x00\xFF\xFF" "\x00\x00\xFF\xFF\x00\x00\xFF\xFF\xFF\xFF\x00\x00\xFF\xFF\x00\x00" @@ -399,8 +381,7 @@ struct test_bitblt HGDI_BITMAP bmp; }; -static BOOL test_rop(HGDI_DC hdcDst, HGDI_DC hdcSrc, HGDI_BITMAP hBmpSrc, - HGDI_BITMAP hBmpDst, +static BOOL test_rop(HGDI_DC hdcDst, HGDI_DC hdcSrc, HGDI_BITMAP hBmpSrc, HGDI_BITMAP hBmpDst, HGDI_BITMAP hBmpDstOriginal, UINT32 rop, HGDI_BITMAP expected, const gdiPalette* hPalette) { @@ -411,15 +392,14 @@ static BOOL test_rop(HGDI_DC hdcDst, HGDI_DC hdcSrc, HGDI_BITMAP hBmpSrc, if (!gdi_BitBlt(hdcDst, 0, 0, 16, 16, hdcSrc, 0, 0, GDI_SRCCOPY, hPalette)) return FALSE; - if (!test_assert_bitmaps_equal(hBmpDst, hBmpDstOriginal, - gdi_rop_to_string(GDI_SRCCOPY), hPalette)) - gdi_SelectObject(hdcSrc, (HGDIOBJECT) hBmpSrc); + if (!test_assert_bitmaps_equal(hBmpDst, hBmpDstOriginal, gdi_rop_to_string(GDI_SRCCOPY), + hPalette)) + gdi_SelectObject(hdcSrc, (HGDIOBJECT)hBmpSrc); if (!gdi_BitBlt(hdcDst, 0, 0, 16, 16, hdcSrc, 0, 0, rop, hPalette)) return FALSE; - if (!test_assert_bitmaps_equal(hBmpDst, expected, - gdi_rop_to_string(rop), hPalette)) + if (!test_assert_bitmaps_equal(hBmpDst, expected, gdi_rop_to_string(rop), hPalette)) return FALSE; return TRUE; @@ -433,50 +413,47 @@ static BOOL test_gdi_BitBlt(UINT32 SrcFormat, UINT32 DstFormat) HGDI_DC hdcSrc = NULL; HGDI_DC hdcDst = NULL; const UINT32 RawFormat = PIXEL_FORMAT_RGB8; - struct test_bitblt tests[] = - { - {GDI_SRCCOPY, bmp_SRCCOPY, NULL}, - {GDI_SPna, bmp_SPna, NULL}, - {GDI_BLACKNESS, bmp_BLACKNESS, NULL}, - {GDI_WHITENESS, bmp_WHITENESS, NULL}, - {GDI_SRCAND, bmp_SRCAND, NULL}, - {GDI_SRCPAINT, bmp_SRCPAINT, NULL}, - {GDI_SRCINVERT, bmp_SRCINVERT, NULL}, - {GDI_SRCERASE, bmp_SRCERASE, NULL}, - {GDI_NOTSRCCOPY, bmp_NOTSRCCOPY, NULL}, - {GDI_NOTSRCERASE, bmp_NOTSRCERASE, NULL}, - {GDI_DSTINVERT, bmp_DSTINVERT, NULL}, - {GDI_MERGECOPY, bmp_MERGECOPY, NULL}, - {GDI_MERGEPAINT, bmp_MERGEPAINT, NULL}, - {GDI_PATCOPY, bmp_PATCOPY, NULL}, - {GDI_PATPAINT, bmp_PATPAINT, NULL}, - {GDI_PATINVERT, bmp_PATINVERT, NULL}, - {GDI_DSTINVERT, bmp_SRC, NULL}, - {GDI_DSPDxax, bmp_SRC, NULL}, - {GDI_PSDPxax, bmp_SRC, NULL}, - {GDI_DSna, bmp_SRC, NULL}, - {GDI_DPa, bmp_SRC, NULL}, - {GDI_PDxn, bmp_SRC, NULL}, - {GDI_DSxn, bmp_SRC, NULL}, - {GDI_PSDnox, bmp_SRC, NULL}, - {GDI_PDSona, bmp_SRC, NULL}, - {GDI_DSPDxox, bmp_SRC, NULL}, - {GDI_DPSDonox, bmp_SRC, NULL}, - {GDI_SPDSxax, bmp_SRC, NULL}, - {GDI_DPon, bmp_SRC, NULL}, - {GDI_DPna, bmp_SRC, NULL}, - {GDI_Pn, bmp_SRC, NULL}, - {GDI_PDna, bmp_SRC, NULL}, - {GDI_DPan, bmp_SRC, NULL}, - {GDI_DSan, bmp_SRC, NULL}, - {GDI_DSxn, bmp_SRC, NULL}, - {GDI_DPa, bmp_SRC, NULL}, - {GDI_DSTCOPY, bmp_SRC, NULL}, - {GDI_DPno, bmp_SRC, NULL}, - {GDI_SDno, bmp_SRC, NULL}, - {GDI_PDno, bmp_SRC, NULL}, - {GDI_DPo, bmp_SRC, NULL} - }; + struct test_bitblt tests[] = { { GDI_SRCCOPY, bmp_SRCCOPY, NULL }, + { GDI_SPna, bmp_SPna, NULL }, + { GDI_BLACKNESS, bmp_BLACKNESS, NULL }, + { GDI_WHITENESS, bmp_WHITENESS, NULL }, + { GDI_SRCAND, bmp_SRCAND, NULL }, + { GDI_SRCPAINT, bmp_SRCPAINT, NULL }, + { GDI_SRCINVERT, bmp_SRCINVERT, NULL }, + { GDI_SRCERASE, bmp_SRCERASE, NULL }, + { GDI_NOTSRCCOPY, bmp_NOTSRCCOPY, NULL }, + { GDI_NOTSRCERASE, bmp_NOTSRCERASE, NULL }, + { GDI_DSTINVERT, bmp_DSTINVERT, NULL }, + { GDI_MERGECOPY, bmp_MERGECOPY, NULL }, + { GDI_MERGEPAINT, bmp_MERGEPAINT, NULL }, + { GDI_PATCOPY, bmp_PATCOPY, NULL }, + { GDI_PATPAINT, bmp_PATPAINT, NULL }, + { GDI_PATINVERT, bmp_PATINVERT, NULL }, + { GDI_DSTINVERT, bmp_SRC, NULL }, + { GDI_DSPDxax, bmp_SRC, NULL }, + { GDI_PSDPxax, bmp_SRC, NULL }, + { GDI_DSna, bmp_SRC, NULL }, + { GDI_DPa, bmp_SRC, NULL }, + { GDI_PDxn, bmp_SRC, NULL }, + { GDI_DSxn, bmp_SRC, NULL }, + { GDI_PSDnox, bmp_SRC, NULL }, + { GDI_PDSona, bmp_SRC, NULL }, + { GDI_DSPDxox, bmp_SRC, NULL }, + { GDI_DPSDonox, bmp_SRC, NULL }, + { GDI_SPDSxax, bmp_SRC, NULL }, + { GDI_DPon, bmp_SRC, NULL }, + { GDI_DPna, bmp_SRC, NULL }, + { GDI_Pn, bmp_SRC, NULL }, + { GDI_PDna, bmp_SRC, NULL }, + { GDI_DPan, bmp_SRC, NULL }, + { GDI_DSan, bmp_SRC, NULL }, + { GDI_DSxn, bmp_SRC, NULL }, + { GDI_DPa, bmp_SRC, NULL }, + { GDI_DSTCOPY, bmp_SRC, NULL }, + { GDI_DPno, bmp_SRC, NULL }, + { GDI_SDno, bmp_SRC, NULL }, + { GDI_PDno, bmp_SRC, NULL }, + { GDI_DPo, bmp_SRC, NULL } }; const UINT32 number_tests = sizeof(tests) / sizeof(tests[0]); HGDI_BITMAP hBmpSrc = NULL; HGDI_BITMAP hBmpDst = NULL; @@ -504,28 +481,28 @@ static BOOL test_gdi_BitBlt(UINT32 SrcFormat, UINT32 DstFormat) } hdcDst->format = DstFormat; - hBmpSrc = test_convert_to_bitmap(bmp_SRC, RawFormat, 0, 0, 0, - SrcFormat, 0, 0, 0, 16, 16, hPalette); + hBmpSrc = + test_convert_to_bitmap(bmp_SRC, RawFormat, 0, 0, 0, SrcFormat, 0, 0, 0, 16, 16, hPalette); if (!hBmpSrc) goto fail; - hBmpDst = test_convert_to_bitmap(bmp_DST, RawFormat, 0, 0, 0, - DstFormat, 0, 0, 0, 16, 16, hPalette); + hBmpDst = + test_convert_to_bitmap(bmp_DST, RawFormat, 0, 0, 0, DstFormat, 0, 0, 0, 16, 16, hPalette); if (!hBmpDst) goto fail; - hBmpDstOriginal = test_convert_to_bitmap(bmp_DST, RawFormat, 0, 0, 0, - SrcFormat, 0, 0, 0, 16, 16, hPalette); + hBmpDstOriginal = + test_convert_to_bitmap(bmp_DST, RawFormat, 0, 0, 0, SrcFormat, 0, 0, 0, 16, 16, hPalette); if (!hBmpDstOriginal) goto fail; for (x = 0; x < number_tests; x++) { - tests[x].bmp = test_convert_to_bitmap(tests[x].src, RawFormat, 0, 0, 0, - SrcFormat, 0, 0, 0, 16, 16, hPalette); + tests[x].bmp = test_convert_to_bitmap(tests[x].src, RawFormat, 0, 0, 0, SrcFormat, 0, 0, 0, + 16, 16, hPalette); if (!tests[x].bmp) goto fail; @@ -536,8 +513,8 @@ static BOOL test_gdi_BitBlt(UINT32 SrcFormat, UINT32 DstFormat) for (x = 0; x < number_tests; x++) { - if (!test_rop(hdcDst, hdcSrc, hBmpSrc, hBmpDst, hBmpDstOriginal, tests[x].rop, - tests[x].bmp, hPalette)) + if (!test_rop(hdcDst, hdcSrc, hBmpSrc, hBmpDst, hBmpDstOriginal, tests[x].rop, tests[x].bmp, + hPalette)) failed = TRUE; } @@ -555,33 +532,19 @@ fail: gdi_DeleteDC(hdcSrc); gdi_DeleteDC(hdcDst); fprintf(stderr, "%s: TODO Test not implemented!!!\n", __FUNCTION__); - return TRUE; //rc; + return TRUE; // rc; } int TestGdiBitBlt(int argc, char* argv[]) { int rc = 0; UINT32 x, y; - const UINT32 formatList[] = - { - PIXEL_FORMAT_RGB8, - PIXEL_FORMAT_RGB15, - PIXEL_FORMAT_ARGB15, - PIXEL_FORMAT_RGB16, - PIXEL_FORMAT_RGB24, - PIXEL_FORMAT_RGBA32, - PIXEL_FORMAT_RGBX32, - PIXEL_FORMAT_ARGB32, - PIXEL_FORMAT_XRGB32, - PIXEL_FORMAT_BGR15, - PIXEL_FORMAT_ABGR15, - PIXEL_FORMAT_BGR16, - PIXEL_FORMAT_BGR24, - PIXEL_FORMAT_BGRA32, - PIXEL_FORMAT_BGRX32, - PIXEL_FORMAT_ABGR32, - PIXEL_FORMAT_XBGR32 - }; + const UINT32 formatList[] = { PIXEL_FORMAT_RGB8, PIXEL_FORMAT_RGB15, PIXEL_FORMAT_ARGB15, + PIXEL_FORMAT_RGB16, PIXEL_FORMAT_RGB24, PIXEL_FORMAT_RGBA32, + PIXEL_FORMAT_RGBX32, PIXEL_FORMAT_ARGB32, PIXEL_FORMAT_XRGB32, + PIXEL_FORMAT_BGR15, PIXEL_FORMAT_ABGR15, PIXEL_FORMAT_BGR16, + PIXEL_FORMAT_BGR24, PIXEL_FORMAT_BGRA32, PIXEL_FORMAT_BGRX32, + PIXEL_FORMAT_ABGR32, PIXEL_FORMAT_XBGR32 }; const UINT32 listSize = sizeof(formatList) / sizeof(formatList[0]); WINPR_UNUSED(argc); WINPR_UNUSED(argv); diff --git a/libfreerdp/gdi/test/TestGdiClip.c b/libfreerdp/gdi/test/TestGdiClip.c index ac27836e5..9f3ca2a46 100644 --- a/libfreerdp/gdi/test/TestGdiClip.c +++ b/libfreerdp/gdi/test/TestGdiClip.c @@ -30,7 +30,7 @@ static int test_gdi_ClipCoords(void) hdc->format = format; bmp = gdi_CreateBitmapEx(1024, 768, PIXEL_FORMAT_XRGB32, 0, NULL, NULL); - gdi_SelectObject(hdc, (HGDIOBJECT) bmp); + gdi_SelectObject(hdc, (HGDIOBJECT)bmp); gdi_SetNullClipRgn(hdc); rgn1 = gdi_CreateRectRgn(0, 0, 0, 0); rgn2 = gdi_CreateRectRgn(0, 0, 0, 0); @@ -58,8 +58,7 @@ static int test_gdi_ClipCoords(void) gdi_SetClipRgn(hdc, 300, 300, 100, 100); gdi_SetRgn(rgn1, 20, 20, 100, 100); gdi_SetRgn(rgn2, 0, 0, 0, 0); - draw = gdi_ClipCoords(hdc, &(rgn1->x), &(rgn1->y), &(rgn1->w), &(rgn1->h), NULL, - NULL); + draw = gdi_ClipCoords(hdc, &(rgn1->x), &(rgn1->y), &(rgn1->w), &(rgn1->h), NULL, NULL); if (draw) goto fail; @@ -68,8 +67,7 @@ static int test_gdi_ClipCoords(void) gdi_SetClipRgn(hdc, 300, 300, 100, 100); gdi_SetRgn(rgn1, 420, 420, 100, 100); gdi_SetRgn(rgn2, 0, 0, 0, 0); - draw = gdi_ClipCoords(hdc, &(rgn1->x), &(rgn1->y), &(rgn1->w), &(rgn1->h), NULL, - NULL); + draw = gdi_ClipCoords(hdc, &(rgn1->x), &(rgn1->y), &(rgn1->w), &(rgn1->h), NULL, NULL); if (draw) goto fail; @@ -78,8 +76,7 @@ static int test_gdi_ClipCoords(void) gdi_SetClipRgn(hdc, 300, 300, 100, 100); gdi_SetRgn(rgn1, 300, 20, 100, 100); gdi_SetRgn(rgn2, 0, 0, 0, 0); - draw = gdi_ClipCoords(hdc, &(rgn1->x), &(rgn1->y), &(rgn1->w), &(rgn1->h), NULL, - NULL); + draw = gdi_ClipCoords(hdc, &(rgn1->x), &(rgn1->y), &(rgn1->w), &(rgn1->h), NULL, NULL); if (draw) goto fail; @@ -88,8 +85,7 @@ static int test_gdi_ClipCoords(void) gdi_SetClipRgn(hdc, 300, 300, 100, 100); gdi_SetRgn(rgn1, 300, 420, 100, 100); gdi_SetRgn(rgn2, 0, 0, 0, 0); - draw = gdi_ClipCoords(hdc, &(rgn1->x), &(rgn1->y), &(rgn1->w), &(rgn1->h), NULL, - NULL); + draw = gdi_ClipCoords(hdc, &(rgn1->x), &(rgn1->y), &(rgn1->w), &(rgn1->h), NULL, NULL); if (draw) goto fail; @@ -184,14 +180,14 @@ static int test_gdi_InvalidateRegion(void) hdc->format = format; bmp = gdi_CreateBitmapEx(1024, 768, PIXEL_FORMAT_XRGB32, 0, NULL, NULL); - gdi_SelectObject(hdc, (HGDIOBJECT) bmp); + gdi_SelectObject(hdc, (HGDIOBJECT)bmp); gdi_SetNullClipRgn(hdc); - hdc->hwnd = (HGDI_WND) calloc(1, sizeof(GDI_WND)); + hdc->hwnd = (HGDI_WND)calloc(1, sizeof(GDI_WND)); hdc->hwnd->invalid = gdi_CreateRectRgn(0, 0, 0, 0); hdc->hwnd->invalid->null = TRUE; invalid = hdc->hwnd->invalid; hdc->hwnd->count = 16; - hdc->hwnd->cinvalid = (HGDI_RGN) calloc(hdc->hwnd->count, sizeof(GDI_RGN)); + hdc->hwnd->cinvalid = (HGDI_RGN)calloc(hdc->hwnd->count, sizeof(GDI_RGN)); rgn1 = gdi_CreateRectRgn(0, 0, 0, 0); rgn2 = gdi_CreateRectRgn(0, 0, 0, 0); rgn1->null = TRUE; @@ -347,4 +343,3 @@ int TestGdiClip(int argc, char* argv[]) return 0; } - diff --git a/libfreerdp/gdi/test/TestGdiCreate.c b/libfreerdp/gdi/test/TestGdiCreate.c index 14e2b93eb..eab83877c 100644 --- a/libfreerdp/gdi/test/TestGdiCreate.c +++ b/libfreerdp/gdi/test/TestGdiCreate.c @@ -13,24 +13,13 @@ #include "brush.h" #include "drawing.h" -static const UINT32 colorFormatList[] = -{ - PIXEL_FORMAT_RGB15, - PIXEL_FORMAT_BGR15, - PIXEL_FORMAT_RGB16, - PIXEL_FORMAT_BGR16, - PIXEL_FORMAT_RGB24, - PIXEL_FORMAT_BGR24, - PIXEL_FORMAT_ARGB32, - PIXEL_FORMAT_ABGR32, - PIXEL_FORMAT_XRGB32, - PIXEL_FORMAT_XBGR32, - PIXEL_FORMAT_RGBX32, - PIXEL_FORMAT_BGRX32 +static const UINT32 colorFormatList[] = { + PIXEL_FORMAT_RGB15, PIXEL_FORMAT_BGR15, PIXEL_FORMAT_RGB16, PIXEL_FORMAT_BGR16, + PIXEL_FORMAT_RGB24, PIXEL_FORMAT_BGR24, PIXEL_FORMAT_ARGB32, PIXEL_FORMAT_ABGR32, + PIXEL_FORMAT_XRGB32, PIXEL_FORMAT_XBGR32, PIXEL_FORMAT_RGBX32, PIXEL_FORMAT_BGRX32 }; -static const UINT32 colorFormatCount = sizeof(colorFormatList) / sizeof( - colorFormatList[0]); +static const UINT32 colorFormatCount = sizeof(colorFormatList) / sizeof(colorFormatList[0]); static int test_gdi_GetDC(void) { @@ -103,7 +92,7 @@ static int test_gdi_CreateBitmap(void) width = 32; height = 16; - if (!(data = (BYTE*) _aligned_malloc(width * height * 4, 16))) + if (!(data = (BYTE*)_aligned_malloc(width * height * 4, 16))) { printf("failed to allocate aligned bitmap data memory\n"); return -1; @@ -134,7 +123,7 @@ static int test_gdi_CreateBitmap(void) fail: if (hBitmap) - gdi_DeleteObject((HGDIOBJECT) hBitmap); + gdi_DeleteObject((HGDIOBJECT)hBitmap); else free(data); @@ -179,7 +168,7 @@ static int test_gdi_CreateCompatibleBitmap(void) fail: if (hBitmap) - gdi_DeleteObject((HGDIOBJECT) hBitmap); + gdi_DeleteObject((HGDIOBJECT)hBitmap); gdi_DeleteDC(hdc); return rc; @@ -189,8 +178,7 @@ static int test_gdi_CreatePen(void) { int rc = -1; const UINT32 format = PIXEL_FORMAT_RGBA32; - HGDI_PEN hPen = gdi_CreatePen(GDI_PS_SOLID, 8, 0xAABBCCDD, - format, NULL); + HGDI_PEN hPen = gdi_CreatePen(GDI_PS_SOLID, 8, 0xAABBCCDD, format, NULL); if (!hPen) { @@ -209,7 +197,7 @@ static int test_gdi_CreatePen(void) rc = 0; fail: - gdi_DeleteObject((HGDIOBJECT) hPen); + gdi_DeleteObject((HGDIOBJECT)hPen); return rc; } @@ -229,7 +217,7 @@ static int test_gdi_CreateSolidBrush(void) rc = 0; fail: - gdi_DeleteObject((HGDIOBJECT) hBrush); + gdi_DeleteObject((HGDIOBJECT)hBrush); return rc; } @@ -257,10 +245,10 @@ static int test_gdi_CreatePatternBrush(void) fail: if (hBitmap) - gdi_DeleteObject((HGDIOBJECT) hBitmap); + gdi_DeleteObject((HGDIOBJECT)hBitmap); if (hBrush) - gdi_DeleteObject((HGDIOBJECT) hBrush); + gdi_DeleteObject((HGDIOBJECT)hBrush); return rc; } @@ -297,7 +285,7 @@ static int test_gdi_CreateRectRgn(void) rc = 0; fail: - gdi_DeleteObject((HGDIOBJECT) hRegion); + gdi_DeleteObject((HGDIOBJECT)hRegion); return rc; } @@ -333,7 +321,7 @@ static int test_gdi_CreateRect(void) rc = 0; fail: - gdi_DeleteObject((HGDIOBJECT) hRect); + gdi_DeleteObject((HGDIOBJECT)hRect); return rc; } @@ -366,7 +354,7 @@ static BOOL test_gdi_GetPixel(void) return -1; } - gdi_SelectObject(hdc, (HGDIOBJECT) hBitmap); + gdi_SelectObject(hdc, (HGDIOBJECT)hBitmap); bpp = GetBytesPerPixel(hBitmap->format); for (i = 0; i < height; i++) @@ -374,9 +362,9 @@ static BOOL test_gdi_GetPixel(void) for (j = 0; j < width; j++) { UINT32 pixel; - const UINT32 color = FreeRDPGetColor(hBitmap->format, rand(), rand(), rand(), rand()); - WriteColor(&hBitmap->data[i * hBitmap->scanline + j * bpp], hBitmap->format, - color); + const UINT32 color = + FreeRDPGetColor(hBitmap->format, rand(), rand(), rand(), rand()); + WriteColor(&hBitmap->data[i * hBitmap->scanline + j * bpp], hBitmap->format, color); pixel = gdi_GetPixel(hdc, j, i); if (pixel != color) @@ -390,7 +378,7 @@ static BOOL test_gdi_GetPixel(void) break; } - gdi_DeleteObject((HGDIOBJECT) hBitmap); + gdi_DeleteObject((HGDIOBJECT)hBitmap); gdi_DeleteDC(hdc); } @@ -418,7 +406,7 @@ static BOOL test_gdi_SetPixel(void) hdc->format = colorFormatList[x]; hBitmap = gdi_CreateCompatibleBitmap(hdc, width, height); - gdi_SelectObject(hdc, (HGDIOBJECT) hBitmap); + gdi_SelectObject(hdc, (HGDIOBJECT)hBitmap); bpp = GetBytesPerPixel(hBitmap->format); for (i = 0; i < height; i++) @@ -426,10 +414,10 @@ static BOOL test_gdi_SetPixel(void) for (j = 0; j < width; j++) { UINT32 pixel; - const UINT32 color = FreeRDPGetColor(hBitmap->format, rand(), rand(), rand(), rand()); + const UINT32 color = + FreeRDPGetColor(hBitmap->format, rand(), rand(), rand(), rand()); gdi_SetPixel(hdc, j, i, color); - pixel = ReadColor(&hBitmap->data[i * hBitmap->scanline + j * bpp], - hBitmap->format); + pixel = ReadColor(&hBitmap->data[i * hBitmap->scanline + j * bpp], hBitmap->format); if (pixel != color) { @@ -442,7 +430,7 @@ static BOOL test_gdi_SetPixel(void) break; } - gdi_DeleteObject((HGDIOBJECT) hBitmap); + gdi_DeleteObject((HGDIOBJECT)hBitmap); gdi_DeleteDC(hdc); } @@ -492,7 +480,7 @@ static int test_gdi_MoveToEx(void) goto fail; } - gdi_SelectObject(hdc, (HGDIOBJECT) hPen); + gdi_SelectObject(hdc, (HGDIOBJECT)hPen); gdi_MoveToEx(hdc, 128, 256, NULL); if (hdc->pen->posX != 128) @@ -501,7 +489,7 @@ static int test_gdi_MoveToEx(void) if (hdc->pen->posY != 256) goto fail; - prevPoint = (HGDI_POINT) malloc(sizeof(GDI_POINT)); + prevPoint = (HGDI_POINT)malloc(sizeof(GDI_POINT)); ZeroMemory(prevPoint, sizeof(GDI_POINT)); gdi_MoveToEx(hdc, 64, 128, prevPoint); @@ -599,4 +587,3 @@ int TestGdiCreate(int argc, char* argv[]) return 0; } - diff --git a/libfreerdp/gdi/test/TestGdiEllipse.c b/libfreerdp/gdi/test/TestGdiEllipse.c index 7a674e7b8..50e5136f4 100644 --- a/libfreerdp/gdi/test/TestGdiEllipse.c +++ b/libfreerdp/gdi/test/TestGdiEllipse.c @@ -17,8 +17,7 @@ /* Ellipse() Test Data */ -static const BYTE ellipse_case_1[256] = -{ +static const BYTE ellipse_case_1[256] = { "\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF" "\xFF\xFF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF" @@ -37,8 +36,7 @@ static const BYTE ellipse_case_1[256] = "\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF" }; -static const BYTE ellipse_case_2[256] = -{ +static const BYTE ellipse_case_2[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF" @@ -57,8 +55,7 @@ static const BYTE ellipse_case_2[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF" }; -static const BYTE ellipse_case_3[256] = -{ +static const BYTE ellipse_case_3[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -82,25 +79,12 @@ int TestGdiEllipse(int argc, char* argv[]) int rc = -1; UINT32 i, j; const UINT32 RawFormat = PIXEL_FORMAT_RGB8; - const UINT32 colorFormats[] = - { - PIXEL_FORMAT_RGB15, - PIXEL_FORMAT_ARGB15, - PIXEL_FORMAT_RGB16, - PIXEL_FORMAT_RGB24, - PIXEL_FORMAT_ARGB32, - PIXEL_FORMAT_XRGB32, - PIXEL_FORMAT_RGBA32, - PIXEL_FORMAT_RGBX32, - PIXEL_FORMAT_BGR15, - PIXEL_FORMAT_ABGR15, - PIXEL_FORMAT_BGR16, - PIXEL_FORMAT_BGR24, - PIXEL_FORMAT_ABGR32, - PIXEL_FORMAT_XBGR32, - PIXEL_FORMAT_BGRA32, - PIXEL_FORMAT_BGRX32 - }; + const UINT32 colorFormats[] = { PIXEL_FORMAT_RGB15, PIXEL_FORMAT_ARGB15, PIXEL_FORMAT_RGB16, + PIXEL_FORMAT_RGB24, PIXEL_FORMAT_ARGB32, PIXEL_FORMAT_XRGB32, + PIXEL_FORMAT_RGBA32, PIXEL_FORMAT_RGBX32, PIXEL_FORMAT_BGR15, + PIXEL_FORMAT_ABGR15, PIXEL_FORMAT_BGR16, PIXEL_FORMAT_BGR24, + PIXEL_FORMAT_ABGR32, PIXEL_FORMAT_XBGR32, PIXEL_FORMAT_BGRA32, + PIXEL_FORMAT_BGRX32 }; const UINT32 number_formats = sizeof(colorFormats) / sizeof(colorFormats[0]); gdiPalette g; WINPR_UNUSED(argc); @@ -138,23 +122,23 @@ int TestGdiEllipse(int argc, char* argv[]) goto fail; } - gdi_SelectObject(hdc, (HGDIOBJECT) pen); + gdi_SelectObject(hdc, (HGDIOBJECT)pen); hBmp = gdi_CreateCompatibleBitmap(hdc, 16, 16); - gdi_SelectObject(hdc, (HGDIOBJECT) hBmp); - hBmp_Ellipse_1 = test_convert_to_bitmap(ellipse_case_1, RawFormat, 0, 0, 0, - format, 0, 0, 0, 16, 16, hPalette); + gdi_SelectObject(hdc, (HGDIOBJECT)hBmp); + hBmp_Ellipse_1 = test_convert_to_bitmap(ellipse_case_1, RawFormat, 0, 0, 0, format, 0, 0, 0, + 16, 16, hPalette); if (!hBmp_Ellipse_1) goto fail; - hBmp_Ellipse_2 = test_convert_to_bitmap(ellipse_case_2, RawFormat, 0, 0, 0, - format, 0, 0, 0, 16, 16, hPalette); + hBmp_Ellipse_2 = test_convert_to_bitmap(ellipse_case_2, RawFormat, 0, 0, 0, format, 0, 0, 0, + 16, 16, hPalette); if (!hBmp_Ellipse_2) goto fail; - hBmp_Ellipse_3 = test_convert_to_bitmap(ellipse_case_3, RawFormat, 0, 0, 0, - format, 0, 0, 0, 16, 16, hPalette); + hBmp_Ellipse_3 = test_convert_to_bitmap(ellipse_case_3, RawFormat, 0, 0, 0, format, 0, 0, 0, + 16, 16, hPalette); if (!hBmp_Ellipse_3) goto fail; @@ -171,11 +155,11 @@ int TestGdiEllipse(int argc, char* argv[]) rc = 0; fail: - gdi_DeleteObject((HGDIOBJECT) hBmp_Ellipse_1); - gdi_DeleteObject((HGDIOBJECT) hBmp_Ellipse_2); - gdi_DeleteObject((HGDIOBJECT) hBmp_Ellipse_3); - gdi_DeleteObject((HGDIOBJECT) hBmp); - gdi_DeleteObject((HGDIOBJECT) pen); + gdi_DeleteObject((HGDIOBJECT)hBmp_Ellipse_1); + gdi_DeleteObject((HGDIOBJECT)hBmp_Ellipse_2); + gdi_DeleteObject((HGDIOBJECT)hBmp_Ellipse_3); + gdi_DeleteObject((HGDIOBJECT)hBmp); + gdi_DeleteObject((HGDIOBJECT)pen); gdi_DeleteDC(hdc); if (rc != 0) @@ -184,4 +168,3 @@ int TestGdiEllipse(int argc, char* argv[]) return rc; } - diff --git a/libfreerdp/gdi/test/TestGdiLine.c b/libfreerdp/gdi/test/TestGdiLine.c index 92185ceab..86242e959 100644 --- a/libfreerdp/gdi/test/TestGdiLine.c +++ b/libfreerdp/gdi/test/TestGdiLine.c @@ -17,8 +17,7 @@ #include "helpers.h" /* LineTo() Test Data */ -static const BYTE line_to_case_1[256] = -{ +static const BYTE line_to_case_1[256] = { "\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -37,8 +36,7 @@ static const BYTE line_to_case_1[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" }; -static const BYTE line_to_case_2[256] = -{ +static const BYTE line_to_case_2[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -57,8 +55,7 @@ static const BYTE line_to_case_2[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00" }; -static const BYTE line_to_case_3[256] = -{ +static const BYTE line_to_case_3[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\xFF\xFF" @@ -77,8 +74,7 @@ static const BYTE line_to_case_3[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" }; -static const BYTE line_to_case_4[256] = -{ +static const BYTE line_to_case_4[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\xFF\xFF" @@ -97,8 +93,7 @@ static const BYTE line_to_case_4[256] = "\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" }; -static const BYTE line_to_case_5[256] = -{ +static const BYTE line_to_case_5[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -117,8 +112,7 @@ static const BYTE line_to_case_5[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" }; -static const BYTE line_to_case_6[256] = -{ +static const BYTE line_to_case_6[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -137,8 +131,7 @@ static const BYTE line_to_case_6[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" }; -static const BYTE line_to_case_7[256] = -{ +static const BYTE line_to_case_7[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -157,8 +150,7 @@ static const BYTE line_to_case_7[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" }; -static const BYTE line_to_case_8[256] = -{ +static const BYTE line_to_case_8[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -177,8 +169,7 @@ static const BYTE line_to_case_8[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF" }; -static const BYTE line_to_case_9[256] = -{ +static const BYTE line_to_case_9[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -197,8 +188,7 @@ static const BYTE line_to_case_9[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" }; -static const BYTE line_to_case_10[256] = -{ +static const BYTE line_to_case_10[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -217,8 +207,7 @@ static const BYTE line_to_case_10[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" }; -static const BYTE line_to_case_11[256] = -{ +static const BYTE line_to_case_11[256] = { "\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -237,23 +226,12 @@ static const BYTE line_to_case_11[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00" }; -static const BYTE* line_to_case[] = -{ - line_to_case_1, - line_to_case_2, - line_to_case_3, - line_to_case_4, - line_to_case_5, - line_to_case_6, - line_to_case_7, - line_to_case_8, - line_to_case_9, - line_to_case_10, - line_to_case_11 -}; +static const BYTE* line_to_case[] = { line_to_case_1, line_to_case_2, line_to_case_3, + line_to_case_4, line_to_case_5, line_to_case_6, + line_to_case_7, line_to_case_8, line_to_case_9, + line_to_case_10, line_to_case_11 }; -static const BYTE line_to_R2_BLACK[256] = -{ +static const BYTE line_to_R2_BLACK[256] = { "\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -272,8 +250,7 @@ static const BYTE line_to_R2_BLACK[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00" }; -static const BYTE line_to_R2_NOTMERGEPEN[256] = -{ +static const BYTE line_to_R2_NOTMERGEPEN[256] = { "\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -292,8 +269,7 @@ static const BYTE line_to_R2_NOTMERGEPEN[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00" }; -static const BYTE line_to_R2_MASKNOTPEN[256] = -{ +static const BYTE line_to_R2_MASKNOTPEN[256] = { "\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -312,8 +288,7 @@ static const BYTE line_to_R2_MASKNOTPEN[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00" }; -static const BYTE line_to_R2_NOTCOPYPEN[256] = -{ +static const BYTE line_to_R2_NOTCOPYPEN[256] = { "\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -332,8 +307,7 @@ static const BYTE line_to_R2_NOTCOPYPEN[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00" }; -static const BYTE line_to_R2_MASKPENNOT[256] = -{ +static const BYTE line_to_R2_MASKPENNOT[256] = { "\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -352,8 +326,7 @@ static const BYTE line_to_R2_MASKPENNOT[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00" }; -static const BYTE line_to_R2_NOT[256] = -{ +static const BYTE line_to_R2_NOT[256] = { "\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -372,8 +345,7 @@ static const BYTE line_to_R2_NOT[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00" }; -static const BYTE line_to_R2_XORPEN[256] = -{ +static const BYTE line_to_R2_XORPEN[256] = { "\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -392,8 +364,7 @@ static const BYTE line_to_R2_XORPEN[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00" }; -static const BYTE line_to_R2_NOTMASKPEN[256] = -{ +static const BYTE line_to_R2_NOTMASKPEN[256] = { "\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -412,8 +383,7 @@ static const BYTE line_to_R2_NOTMASKPEN[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00" }; -static const BYTE line_to_R2_MASKPEN[256] = -{ +static const BYTE line_to_R2_MASKPEN[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -432,8 +402,7 @@ static const BYTE line_to_R2_MASKPEN[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" }; -static const BYTE line_to_R2_NOTXORPEN[256] = -{ +static const BYTE line_to_R2_NOTXORPEN[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -452,8 +421,7 @@ static const BYTE line_to_R2_NOTXORPEN[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" }; -static const BYTE line_to_R2_NOP[256] = -{ +static const BYTE line_to_R2_NOP[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -472,8 +440,7 @@ static const BYTE line_to_R2_NOP[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" }; -static const BYTE line_to_R2_MERGENOTPEN[256] = -{ +static const BYTE line_to_R2_MERGENOTPEN[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -492,8 +459,7 @@ static const BYTE line_to_R2_MERGENOTPEN[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" }; -static const BYTE line_to_R2_COPYPEN[256] = -{ +static const BYTE line_to_R2_COPYPEN[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -512,8 +478,7 @@ static const BYTE line_to_R2_COPYPEN[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" }; -static const BYTE line_to_R2_MERGEPENNOT[256] = -{ +static const BYTE line_to_R2_MERGEPENNOT[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -532,8 +497,7 @@ static const BYTE line_to_R2_MERGEPENNOT[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" }; -static const BYTE line_to_R2_MERGEPEN[256] = -{ +static const BYTE line_to_R2_MERGEPEN[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -552,8 +516,7 @@ static const BYTE line_to_R2_MERGEPEN[256] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" }; -static const BYTE line_to_R2_WHITE[256] = -{ +static const BYTE line_to_R2_WHITE[256] = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" @@ -580,9 +543,9 @@ struct ropMap const BYTE* src; }; -static BOOL test_line(HGDI_DC hdc, const gdiPalette* hPalette, UINT32 mX, - UINT32 mY, UINT32 lX, UINT32 lY, HGDI_BITMAP hBmp, - HGDI_BITMAP hOrgBmp, UINT32 cX, UINT32 cY, UINT32 cW, UINT32 cH) +static BOOL test_line(HGDI_DC hdc, const gdiPalette* hPalette, UINT32 mX, UINT32 mY, UINT32 lX, + UINT32 lY, HGDI_BITMAP hBmp, HGDI_BITMAP hOrgBmp, UINT32 cX, UINT32 cY, + UINT32 cW, UINT32 cH) { if (!gdi_BitBlt(hdc, 0, 0, 16, 16, hdc, 0, 0, GDI_WHITENESS, hPalette)) return FALSE; @@ -605,25 +568,12 @@ int TestGdiLine(int argc, char* argv[]) UINT32 x, i; gdiPalette g; const UINT32 RawFormat = PIXEL_FORMAT_RGB8; - const UINT32 colorFormats[] = - { - PIXEL_FORMAT_RGB15, - PIXEL_FORMAT_ARGB15, - PIXEL_FORMAT_RGB16, - PIXEL_FORMAT_RGB24, - PIXEL_FORMAT_ARGB32, - PIXEL_FORMAT_XRGB32, - PIXEL_FORMAT_RGBA32, - PIXEL_FORMAT_RGBX32, - PIXEL_FORMAT_BGR15, - PIXEL_FORMAT_ABGR15, - PIXEL_FORMAT_BGR16, - PIXEL_FORMAT_BGR24, - PIXEL_FORMAT_ABGR32, - PIXEL_FORMAT_XBGR32, - PIXEL_FORMAT_BGRA32, - PIXEL_FORMAT_BGRX32 - }; + const UINT32 colorFormats[] = { PIXEL_FORMAT_RGB15, PIXEL_FORMAT_ARGB15, PIXEL_FORMAT_RGB16, + PIXEL_FORMAT_RGB24, PIXEL_FORMAT_ARGB32, PIXEL_FORMAT_XRGB32, + PIXEL_FORMAT_RGBA32, PIXEL_FORMAT_RGBX32, PIXEL_FORMAT_BGR15, + PIXEL_FORMAT_ABGR15, PIXEL_FORMAT_BGR16, PIXEL_FORMAT_BGR24, + PIXEL_FORMAT_ABGR32, PIXEL_FORMAT_XBGR32, PIXEL_FORMAT_BGRA32, + PIXEL_FORMAT_BGRX32 }; const UINT32 number_formats = sizeof(colorFormats) / sizeof(colorFormats[0]); WINPR_UNUSED(argc); WINPR_UNUSED(argv); @@ -633,27 +583,24 @@ int TestGdiLine(int argc, char* argv[]) HGDI_DC hdc = NULL; HGDI_PEN pen = NULL; HGDI_BITMAP hBmp = NULL; - struct ropMap rop_map[] = - { - {GDI_R2_BLACK, NULL, line_to_R2_BLACK}, - {GDI_R2_NOTMERGEPEN, NULL, line_to_R2_NOTMERGEPEN}, - {GDI_R2_MASKNOTPEN, NULL, line_to_R2_MASKNOTPEN}, - {GDI_R2_NOTCOPYPEN, NULL, line_to_R2_NOTCOPYPEN}, - {GDI_R2_MASKPENNOT, NULL, line_to_R2_MASKPENNOT}, - {GDI_R2_NOT, NULL, line_to_R2_NOT}, - {GDI_R2_XORPEN, NULL, line_to_R2_XORPEN}, - {GDI_R2_NOTMASKPEN, NULL, line_to_R2_NOTMASKPEN}, - {GDI_R2_MASKPEN, NULL, line_to_R2_MASKPEN}, - {GDI_R2_NOTXORPEN, NULL, line_to_R2_NOTXORPEN}, - {GDI_R2_NOP, NULL, line_to_R2_NOP}, - {GDI_R2_MERGENOTPEN, NULL, line_to_R2_MERGENOTPEN}, - {GDI_R2_COPYPEN, NULL, line_to_R2_COPYPEN}, - {GDI_R2_MERGEPENNOT, NULL, line_to_R2_MERGEPENNOT}, - {GDI_R2_MERGEPEN, NULL, line_to_R2_MERGEPEN}, - {GDI_R2_WHITE, NULL, line_to_R2_WHITE} - }; + struct ropMap rop_map[] = { { GDI_R2_BLACK, NULL, line_to_R2_BLACK }, + { GDI_R2_NOTMERGEPEN, NULL, line_to_R2_NOTMERGEPEN }, + { GDI_R2_MASKNOTPEN, NULL, line_to_R2_MASKNOTPEN }, + { GDI_R2_NOTCOPYPEN, NULL, line_to_R2_NOTCOPYPEN }, + { GDI_R2_MASKPENNOT, NULL, line_to_R2_MASKPENNOT }, + { GDI_R2_NOT, NULL, line_to_R2_NOT }, + { GDI_R2_XORPEN, NULL, line_to_R2_XORPEN }, + { GDI_R2_NOTMASKPEN, NULL, line_to_R2_NOTMASKPEN }, + { GDI_R2_MASKPEN, NULL, line_to_R2_MASKPEN }, + { GDI_R2_NOTXORPEN, NULL, line_to_R2_NOTXORPEN }, + { GDI_R2_NOP, NULL, line_to_R2_NOP }, + { GDI_R2_MERGENOTPEN, NULL, line_to_R2_MERGENOTPEN }, + { GDI_R2_COPYPEN, NULL, line_to_R2_COPYPEN }, + { GDI_R2_MERGEPENNOT, NULL, line_to_R2_MERGEPENNOT }, + { GDI_R2_MERGEPEN, NULL, line_to_R2_MERGEPEN }, + { GDI_R2_WHITE, NULL, line_to_R2_WHITE } }; const UINT32 map_size = sizeof(rop_map) / sizeof(rop_map[0]); - HGDI_BITMAP hBmp_LineTo[LINTETO_NUMBER] = {NULL}; + HGDI_BITMAP hBmp_LineTo[LINTETO_NUMBER] = { NULL }; gdiPalette* hPalette = &g; UINT32 penColor; const UINT32 format = colorFormats[i]; @@ -680,14 +627,14 @@ int TestGdiLine(int argc, char* argv[]) goto fail; } - gdi_SelectObject(hdc, (HGDIOBJECT) pen); + gdi_SelectObject(hdc, (HGDIOBJECT)pen); hBmp = gdi_CreateCompatibleBitmap(hdc, 16, 16); - gdi_SelectObject(hdc, (HGDIOBJECT) hBmp); + gdi_SelectObject(hdc, (HGDIOBJECT)hBmp); for (x = 0; x < LINTETO_NUMBER; x++) { - hBmp_LineTo[x] = test_convert_to_bitmap(line_to_case[x], RawFormat, 0, 0, 0, - format, 0, 0, 0, 16, 16, hPalette); + hBmp_LineTo[x] = test_convert_to_bitmap(line_to_case[x], RawFormat, 0, 0, 0, format, 0, + 0, 0, 16, 16, hPalette); if (!hBmp_LineTo[x]) goto fail; @@ -695,8 +642,8 @@ int TestGdiLine(int argc, char* argv[]) for (x = 0; x < map_size; x++) { - rop_map[x].bmp = test_convert_to_bitmap(rop_map[x].src, RawFormat, 0, 0, 0, - format, 0, 0, 0, 16, 16, hPalette); + rop_map[x].bmp = test_convert_to_bitmap(rop_map[x].src, RawFormat, 0, 0, 0, format, 0, + 0, 0, 16, 16, hPalette); if (!rop_map[x].bmp) goto fail; @@ -732,8 +679,7 @@ int TestGdiLine(int argc, char* argv[]) if (!test_line(hdc, hPalette, 0, 0, 16, 16, hBmp, hBmp_LineTo[9], 5, 5, 8, 8)) goto fail; - if (!test_line(hdc, hPalette, 0, 0, 26, 26, hBmp, hBmp_LineTo[10], 0, 0, 16, - 16)) + if (!test_line(hdc, hPalette, 0, 0, 26, 26, hBmp, hBmp_LineTo[10], 0, 0, 16, 16)) goto fail; for (x = 0; x < map_size; x++) @@ -754,9 +700,7 @@ int TestGdiLine(int argc, char* argv[]) gdi_SetROP2(hdc, rop_map[x].rop); gdi_LineTo(hdc, 16, 16); - if (!test_assert_bitmaps_equal(hBmp, rop_map[x].bmp, - name, - hPalette)) + if (!test_assert_bitmaps_equal(hBmp, rop_map[x].bmp, name, hPalette)) goto fail; } @@ -764,13 +708,13 @@ int TestGdiLine(int argc, char* argv[]) fail: for (x = 0; x < LINTETO_NUMBER; x++) - gdi_DeleteObject((HGDIOBJECT) hBmp_LineTo[x]); + gdi_DeleteObject((HGDIOBJECT)hBmp_LineTo[x]); for (x = 0; x < map_size; x++) - gdi_DeleteObject((HGDIOBJECT) rop_map[x].bmp); + gdi_DeleteObject((HGDIOBJECT)rop_map[x].bmp); gdi_DeleteObject((HGDIOBJECT)hBmp); - gdi_DeleteObject((HGDIOBJECT) pen); + gdi_DeleteObject((HGDIOBJECT)pen); gdi_DeleteDC(hdc); if (rc != 0) diff --git a/libfreerdp/gdi/test/TestGdiRect.c b/libfreerdp/gdi/test/TestGdiRect.c index 8f0d04ace..240b02e2b 100644 --- a/libfreerdp/gdi/test/TestGdiRect.c +++ b/libfreerdp/gdi/test/TestGdiRect.c @@ -98,7 +98,7 @@ int test_gdi_FillRect(void) hBitmap = gdi_CreateCompatibleBitmap(hdc, width, height); ZeroMemory(hBitmap->data, width * height * GetBytesPerPixel(hdc->format)); - gdi_SelectObject(hdc, (HGDIOBJECT) hBitmap); + gdi_SelectObject(hdc, (HGDIOBJECT)hBitmap); color = FreeRDPGetColor(PIXEL_FORMAT_ARGB32, 0xAA, 0xBB, 0xCC, 0xFF); hBrush = gdi_CreateSolidBrush(color); gdi_FillRect(hdc, hRect, hBrush); @@ -120,7 +120,8 @@ int test_gdi_FillRect(void) } else { - printf("actual:%08"PRIX32" expected:%08"PRIX32"\n", gdi_GetPixel(hdc, x, y), color); + printf("actual:%08" PRIX32 " expected:%08" PRIX32 "\n", gdi_GetPixel(hdc, x, y), + color); badPixels++; } } @@ -146,8 +147,8 @@ int test_gdi_FillRect(void) rc = 0; fail: - gdi_DeleteObject((HGDIOBJECT) hBrush); - gdi_DeleteObject((HGDIOBJECT) hBitmap); + gdi_DeleteObject((HGDIOBJECT)hBrush); + gdi_DeleteObject((HGDIOBJECT)hBitmap); gdi_DeleteObject((HGDIOBJECT)hRect); gdi_DeleteDC(hdc); return rc; @@ -166,4 +167,3 @@ int TestGdiRect(int argc, char* argv[]) return 0; } - diff --git a/libfreerdp/gdi/test/TestGdiRop3.c b/libfreerdp/gdi/test/TestGdiRop3.c index c5691d5f8..3940350e7 100644 --- a/libfreerdp/gdi/test/TestGdiRop3.c +++ b/libfreerdp/gdi/test/TestGdiRop3.c @@ -5,7 +5,8 @@ /** * Ternary Raster Operations: - * See "Windows Graphics Programming: Win32 GDI and DirectDraw", chapter 11. Advanced Bitmap Graphics + * See "Windows Graphics Programming: Win32 GDI and DirectDraw", chapter 11. Advanced Bitmap + * Graphics * * Operators: * @@ -100,7 +101,7 @@ static char* gdi_convert_postfix_to_infix(const char* postfix) BOOL unary; wStack* stack; size_t al, bl, cl, dl; - char* a, *b, *c, *d; + char *a, *b, *c, *d; bl = cl = dl = 0; stack = Stack_New(FALSE); length = strlen(postfix); @@ -113,7 +114,7 @@ static char* gdi_convert_postfix_to_infix(const char* postfix) a = malloc(2); a[0] = postfix[i]; a[1] = '\0'; - //printf("Operand: %s\n", a); + // printf("Operand: %s\n", a); Stack_Push(stack, a); } else @@ -146,13 +147,13 @@ static char* gdi_convert_postfix_to_infix(const char* postfix) printf("invalid operator: %c\n", c[0]); } - //printf("Operator: %s\n", c); - a = (char*) Stack_Pop(stack); + // printf("Operator: %s\n", c); + a = (char*)Stack_Pop(stack); if (unary) b = NULL; else - b = (char*) Stack_Pop(stack); + b = (char*)Stack_Pop(stack); al = strlen(a); @@ -170,39 +171,16 @@ static char* gdi_convert_postfix_to_infix(const char* postfix) } } - d = (char*) Stack_Pop(stack); + d = (char*)Stack_Pop(stack); Stack_Free(stack); return d; } -static const char* test_ROP3[] = -{ - "DSPDxax", - "PSDPxax", - "SPna", - "DSna", - "DPa", - "PDxn", - "DSxn", - "PSDnox", - "PDSona", - "DSPDxox", - "DPSDonox", - "SPDSxax", - "DPon", - "DPna", - "Pn", - "PDna", - "DPan", - "DSan", - "DSxn", - "DPa", - "D", - "DPno", - "SDno", - "PDno", - "DPo" -}; +static const char* test_ROP3[] = { "DSPDxax", "PSDPxax", "SPna", "DSna", "DPa", + "PDxn", "DSxn", "PSDnox", "PDSona", "DSPDxox", + "DPSDonox", "SPDSxax", "DPon", "DPna", "Pn", + "PDna", "DPan", "DSan", "DSxn", "DPa", + "D", "DPno", "SDno", "PDno", "DPo" }; int TestGdiRop3(int argc, char* argv[]) { diff --git a/libfreerdp/gdi/test/helpers.c b/libfreerdp/gdi/test/helpers.c index 6fe2ca022..9452a2cdb 100644 --- a/libfreerdp/gdi/test/helpers.c +++ b/libfreerdp/gdi/test/helpers.c @@ -19,10 +19,9 @@ */ #include "helpers.h" -HGDI_BITMAP test_convert_to_bitmap(const BYTE* src, UINT32 SrcFormat, - UINT32 SrcStride, - UINT32 xSrc, UINT32 ySrc, UINT32 DstFormat, UINT32 DstStride, - UINT32 xDst, UINT32 yDst, UINT32 nWidth, UINT32 nHeight, +HGDI_BITMAP test_convert_to_bitmap(const BYTE* src, UINT32 SrcFormat, UINT32 SrcStride, UINT32 xSrc, + UINT32 ySrc, UINT32 DstFormat, UINT32 DstStride, UINT32 xDst, + UINT32 yDst, UINT32 nWidth, UINT32 nHeight, const gdiPalette* hPalette) { HGDI_BITMAP bmp; @@ -36,8 +35,8 @@ HGDI_BITMAP test_convert_to_bitmap(const BYTE* src, UINT32 SrcFormat, if (!data) return NULL; - if (!freerdp_image_copy(data, DstFormat, DstStride, xDst, yDst, nWidth, nHeight, - src, SrcFormat, SrcStride, xSrc, ySrc, hPalette, FREERDP_FLIP_NONE)) + if (!freerdp_image_copy(data, DstFormat, DstStride, xDst, yDst, nWidth, nHeight, src, SrcFormat, + SrcStride, xSrc, ySrc, hPalette, FREERDP_FLIP_NONE)) { _aligned_free(data); return NULL; @@ -54,9 +53,7 @@ HGDI_BITMAP test_convert_to_bitmap(const BYTE* src, UINT32 SrcFormat, return bmp; } - -static void test_dump_data(unsigned char* p, int len, int width, - const char* name) +static void test_dump_data(unsigned char* p, int len, int width, const char* name) { unsigned char* line = p; int i, thisline, offset = 0; @@ -91,8 +88,7 @@ void test_dump_bitmap(HGDI_BITMAP hBmp, const char* name) test_dump_data(hBmp->data, hBmp->height * stride, stride, name); } -static BOOL CompareBitmaps(HGDI_BITMAP hBmp1, HGDI_BITMAP hBmp2, - const gdiPalette* palette) +static BOOL CompareBitmaps(HGDI_BITMAP hBmp1, HGDI_BITMAP hBmp2, const gdiPalette* palette) { UINT32 x, y; const BYTE* p1 = hBmp1->data; @@ -121,17 +117,14 @@ static BOOL CompareBitmaps(HGDI_BITMAP hBmp1, HGDI_BITMAP hBmp2, return TRUE; } -BOOL test_assert_bitmaps_equal(HGDI_BITMAP hBmpActual, - HGDI_BITMAP hBmpExpected, - const char* name, +BOOL test_assert_bitmaps_equal(HGDI_BITMAP hBmpActual, HGDI_BITMAP hBmpExpected, const char* name, const gdiPalette* palette) { BOOL bitmapsEqual = CompareBitmaps(hBmpActual, hBmpExpected, palette); if (!bitmapsEqual) { - printf("Testing ROP %s [%s|%s]\n", name, - FreeRDPGetColorFormatName(hBmpActual->format), + printf("Testing ROP %s [%s|%s]\n", name, FreeRDPGetColorFormatName(hBmpActual->format), FreeRDPGetColorFormatName(hBmpExpected->format)); test_dump_bitmap(hBmpActual, "Actual"); test_dump_bitmap(hBmpExpected, "Expected"); diff --git a/libfreerdp/gdi/test/helpers.h b/libfreerdp/gdi/test/helpers.h index e161522b9..d8be19c3d 100644 --- a/libfreerdp/gdi/test/helpers.h +++ b/libfreerdp/gdi/test/helpers.h @@ -24,16 +24,14 @@ #include #include -HGDI_BITMAP test_convert_to_bitmap(const BYTE* src, UINT32 SrcFormat, - UINT32 SrcStride, - UINT32 xSrc, UINT32 ySrc, UINT32 DstFormat, UINT32 DstStride, - UINT32 xDst, UINT32 yDst, UINT32 nWidth, UINT32 nHeight, +HGDI_BITMAP test_convert_to_bitmap(const BYTE* src, UINT32 SrcFormat, UINT32 SrcStride, UINT32 xSrc, + UINT32 ySrc, UINT32 DstFormat, UINT32 DstStride, UINT32 xDst, + UINT32 yDst, UINT32 nWidth, UINT32 nHeight, const gdiPalette* hPalette); void test_dump_bitmap(HGDI_BITMAP hBmp, const char* name); -BOOL test_assert_bitmaps_equal(HGDI_BITMAP hBmpActual, - HGDI_BITMAP hBmpExpected, const char* name, +BOOL test_assert_bitmaps_equal(HGDI_BITMAP hBmpActual, HGDI_BITMAP hBmpExpected, const char* name, const gdiPalette* palette); #endif /* __GDI_CORE_H */ diff --git a/libfreerdp/gdi/video.c b/libfreerdp/gdi/video.c index 895693e0b..a543cbecb 100644 --- a/libfreerdp/gdi/video.c +++ b/libfreerdp/gdi/video.c @@ -34,7 +34,6 @@ typedef struct BYTE* image; } gdiVideoSurface; - void gdi_video_geometry_init(rdpGdi* gdi, GeometryClientContext* geom) { gdi->geometry = geom; @@ -51,8 +50,7 @@ void gdi_video_geometry_uninit(rdpGdi* gdi, GeometryClientContext* geom) } static VideoSurface* gdiVideoCreateSurface(VideoClientContext* video, BYTE* data, UINT32 x, - UINT32 y, - UINT32 width, UINT32 height) + UINT32 y, UINT32 width, UINT32 height) { rdpGdi* gdi = (rdpGdi*)video->custom; gdiVideoSurface* ret = calloc(1, sizeof(*ret)); @@ -80,7 +78,6 @@ static VideoSurface* gdiVideoCreateSurface(VideoClientContext* video, BYTE* data return &ret->base; } - static BOOL gdiVideoShowSurface(VideoClientContext* video, VideoSurface* surface) { BOOL rc = FALSE; @@ -104,23 +101,24 @@ static BOOL gdiVideoShowSurface(VideoClientContext* video, VideoSurface* surface const UINT32 nYSrc = surface->y; const UINT32 nXDst = nXSrc; const UINT32 nYDst = nYSrc; - const UINT32 width = (surface->w + surface->x < (UINT32)gdi->width) ? surface->w : - (UINT32)gdi->width - surface->x; - const UINT32 height = (surface->h + surface->y < (UINT32)gdi->height) ? surface->h : - (UINT32)gdi->height - - surface->y; + const UINT32 width = (surface->w + surface->x < (UINT32)gdi->width) + ? surface->w + : (UINT32)gdi->width - surface->x; + const UINT32 height = (surface->h + surface->y < (UINT32)gdi->height) + ? surface->h + : (UINT32)gdi->height - surface->y; - if (!freerdp_image_copy(gdi->primary_buffer, gdi->primary->hdc->format, - gdi->stride, - nXDst, nYDst, width, height, - surface->data, gdi->primary->hdc->format, + if (!freerdp_image_copy(gdi->primary_buffer, gdi->primary->hdc->format, gdi->stride, nXDst, + nYDst, width, height, surface->data, gdi->primary->hdc->format, gdiSurface->scanline, 0, 0, NULL, FREERDP_FLIP_NONE)) goto fail; - if ((nXDst > INT32_MAX) || (nYDst > INT32_MAX) || (width > INT32_MAX) || (height > INT32_MAX)) + if ((nXDst > INT32_MAX) || (nYDst > INT32_MAX) || (width > INT32_MAX) || + (height > INT32_MAX)) goto fail; - gdi_InvalidateRegion(gdi->primary->hdc, (INT32)nXDst, (INT32)nYDst, (INT32)width, (INT32)height); + gdi_InvalidateRegion(gdi->primary->hdc, (INT32)nXDst, (INT32)nYDst, (INT32)width, + (INT32)height); } rc = TRUE; @@ -152,7 +150,6 @@ void gdi_video_control_init(rdpGdi* gdi, VideoClientContext* video) video->setGeometry(video, gdi->geometry); } - void gdi_video_control_uninit(rdpGdi* gdi, VideoClientContext* video) { gdi->video = NULL; diff --git a/libfreerdp/locale/keyboard.c b/libfreerdp/locale/keyboard.c index bd467e638..3c86a8843 100644 --- a/libfreerdp/locale/keyboard.c +++ b/libfreerdp/locale/keyboard.c @@ -71,7 +71,8 @@ int freerdp_keyboard_init_apple(DWORD* keyboardLayoutId, DWORD x11_keycode_to_rd for (keycode = 0; keycode < 256; keycode++) { - vkcode = keycode_to_vkcode[keycode] = GetVirtualKeyCodeFromKeycode(keycode, KEYCODE_TYPE_APPLE); + vkcode = keycode_to_vkcode[keycode] = + GetVirtualKeyCodeFromKeycode(keycode, KEYCODE_TYPE_APPLE); x11_keycode_to_rdp_scancode[keycode] = GetVirtualScanCodeFromVirtualKeyCode(vkcode, 4); } @@ -88,7 +89,8 @@ int freerdp_keyboard_init_x11_evdev(DWORD* keyboardLayoutId, DWORD x11_keycode_t for (keycode = 0; keycode < 256; keycode++) { - vkcode = keycode_to_vkcode[keycode] = GetVirtualKeyCodeFromKeycode(keycode, KEYCODE_TYPE_EVDEV); + vkcode = keycode_to_vkcode[keycode] = + GetVirtualKeyCodeFromKeycode(keycode, KEYCODE_TYPE_EVDEV); x11_keycode_to_rdp_scancode[keycode] = GetVirtualScanCodeFromVirtualKeyCode(vkcode, 4); } @@ -115,7 +117,8 @@ DWORD freerdp_keyboard_init(DWORD keyboardLayoutId) #endif if (status < 0) - status = freerdp_keyboard_init_x11_evdev(&keyboardLayoutId, X11_KEYCODE_TO_VIRTUAL_SCANCODE); + status = + freerdp_keyboard_init_x11_evdev(&keyboardLayoutId, X11_KEYCODE_TO_VIRTUAL_SCANCODE); #endif @@ -126,8 +129,8 @@ DWORD freerdp_keyboard_init(DWORD keyboardLayoutId) for (keycode = 0; keycode < ARRAYSIZE(VIRTUAL_SCANCODE_TO_X11_KEYCODE); keycode++) { VIRTUAL_SCANCODE_TO_X11_KEYCODE - [RDP_SCANCODE_CODE(X11_KEYCODE_TO_VIRTUAL_SCANCODE[keycode])] - [RDP_SCANCODE_EXTENDED(X11_KEYCODE_TO_VIRTUAL_SCANCODE[keycode]) ? 1 : 0] = keycode; + [RDP_SCANCODE_CODE(X11_KEYCODE_TO_VIRTUAL_SCANCODE[keycode])] + [RDP_SCANCODE_EXTENDED(X11_KEYCODE_TO_VIRTUAL_SCANCODE[keycode]) ? 1 : 0] = keycode; } return keyboardLayoutId; @@ -135,9 +138,9 @@ DWORD freerdp_keyboard_init(DWORD keyboardLayoutId) DWORD freerdp_keyboard_get_rdp_scancode_from_x11_keycode(DWORD keycode) { - DEBUG_KBD("x11 keycode: %02"PRIX32" -> rdp code: %02"PRIX8"%s", keycode, - RDP_SCANCODE_CODE(X11_KEYCODE_TO_VIRTUAL_SCANCODE[keycode]), - RDP_SCANCODE_EXTENDED(X11_KEYCODE_TO_VIRTUAL_SCANCODE[keycode]) ? " extended" : ""); + DEBUG_KBD("x11 keycode: %02" PRIX32 " -> rdp code: %02" PRIX8 "%s", keycode, + RDP_SCANCODE_CODE(X11_KEYCODE_TO_VIRTUAL_SCANCODE[keycode]), + RDP_SCANCODE_EXTENDED(X11_KEYCODE_TO_VIRTUAL_SCANCODE[keycode]) ? " extended" : ""); return X11_KEYCODE_TO_VIRTUAL_SCANCODE[keycode]; } diff --git a/libfreerdp/locale/keyboard_layout.c b/libfreerdp/locale/keyboard_layout.c index 12188ed6c..9c1f96289 100644 --- a/libfreerdp/locale/keyboard_layout.c +++ b/libfreerdp/locale/keyboard_layout.c @@ -38,156 +38,154 @@ * HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet001/Control/Keyboard Layouts/ */ -static const RDP_KEYBOARD_LAYOUT RDP_KEYBOARD_LAYOUT_TABLE[] = -{ - { KBD_ARABIC_101, "Arabic (101)" }, - { KBD_BULGARIAN, "Bulgarian" }, - { KBD_CHINESE_TRADITIONAL_US, "Chinese (Traditional) - US Keyboard" }, - { KBD_CZECH, "Czech" }, - { KBD_DANISH, "Danish" }, - { KBD_GERMAN, "German" }, - { KBD_GREEK, "Greek" }, - { KBD_US, "US" }, - { KBD_SPANISH, "Spanish" }, - { KBD_FINNISH, "Finnish" }, - { KBD_FRENCH, "French" }, - { KBD_HEBREW, "Hebrew" }, - { KBD_HUNGARIAN, "Hungarian" }, - { KBD_ICELANDIC, "Icelandic" }, - { KBD_ITALIAN, "Italian" }, - { KBD_JAPANESE, "Japanese" }, - { KBD_KOREAN, "Korean" }, - { KBD_DUTCH, "Dutch" }, - { KBD_NORWEGIAN, "Norwegian" }, - { KBD_POLISH_PROGRAMMERS, "Polish (Programmers)" }, +static const RDP_KEYBOARD_LAYOUT RDP_KEYBOARD_LAYOUT_TABLE[] = { + { KBD_ARABIC_101, "Arabic (101)" }, + { KBD_BULGARIAN, "Bulgarian" }, + { KBD_CHINESE_TRADITIONAL_US, "Chinese (Traditional) - US Keyboard" }, + { KBD_CZECH, "Czech" }, + { KBD_DANISH, "Danish" }, + { KBD_GERMAN, "German" }, + { KBD_GREEK, "Greek" }, + { KBD_US, "US" }, + { KBD_SPANISH, "Spanish" }, + { KBD_FINNISH, "Finnish" }, + { KBD_FRENCH, "French" }, + { KBD_HEBREW, "Hebrew" }, + { KBD_HUNGARIAN, "Hungarian" }, + { KBD_ICELANDIC, "Icelandic" }, + { KBD_ITALIAN, "Italian" }, + { KBD_JAPANESE, "Japanese" }, + { KBD_KOREAN, "Korean" }, + { KBD_DUTCH, "Dutch" }, + { KBD_NORWEGIAN, "Norwegian" }, + { KBD_POLISH_PROGRAMMERS, "Polish (Programmers)" }, { KBD_PORTUGUESE_BRAZILIAN_ABNT, "Portuguese (Brazilian ABNT)" }, - { KBD_ROMANIAN, "Romanian" }, - { KBD_RUSSIAN, "Russian" }, - { KBD_CROATIAN, "Croatian" }, - { KBD_SLOVAK, "Slovak" }, - { KBD_ALBANIAN, "Albanian" }, - { KBD_SWEDISH, "Swedish" }, - { KBD_THAI_KEDMANEE, "Thai Kedmanee" }, - { KBD_TURKISH_Q, "Turkish Q" }, - { KBD_URDU, "Urdu" }, - { KBD_UKRAINIAN, "Ukrainian" }, - { KBD_BELARUSIAN, "Belarusian" }, - { KBD_SLOVENIAN, "Slovenian" }, - { KBD_ESTONIAN, "Estonian" }, - { KBD_LATVIAN, "Latvian" }, - { KBD_LITHUANIAN_IBM, "Lithuanian IBM" }, - { KBD_FARSI, "Farsi" }, - { KBD_VIETNAMESE, "Vietnamese" }, - { KBD_ARMENIAN_EASTERN, "Armenian Eastern" }, - { KBD_AZERI_LATIN, "Azeri Latin" }, - { KBD_FYRO_MACEDONIAN, "FYRO Macedonian" }, - { KBD_GEORGIAN, "Georgian" }, - { KBD_FAEROESE, "Faeroese" }, - { KBD_DEVANAGARI_INSCRIPT, "Devanagari - INSCRIPT" }, - { KBD_MALTESE_47_KEY, "Maltese 47-key" }, - { KBD_NORWEGIAN_WITH_SAMI, "Norwegian with Sami" }, - { KBD_KAZAKH, "Kazakh" }, - { KBD_KYRGYZ_CYRILLIC, "Kyrgyz Cyrillic" }, - { KBD_TATAR, "Tatar" }, - { KBD_BENGALI, "Bengali" }, - { KBD_PUNJABI, "Punjabi" }, - { KBD_GUJARATI, "Gujarati" }, - { KBD_TAMIL, "Tamil" }, - { KBD_TELUGU, "Telugu" }, - { KBD_KANNADA, "Kannada" }, - { KBD_MALAYALAM, "Malayalam" }, - { KBD_MARATHI, "Marathi" }, - { KBD_MONGOLIAN_CYRILLIC, "Mongolian Cyrillic" }, - { KBD_UNITED_KINGDOM_EXTENDED, "United Kingdom Extended" }, - { KBD_SYRIAC, "Syriac" }, - { KBD_NEPALI, "Nepali" }, - { KBD_PASHTO, "Pashto" }, - { KBD_DIVEHI_PHONETIC, "Divehi Phonetic" }, - { KBD_LUXEMBOURGISH, "Luxembourgish" }, - { KBD_MAORI, "Maori" }, - { KBD_CHINESE_SIMPLIFIED_US, "Chinese (Simplified) - US Keyboard" }, - { KBD_SWISS_GERMAN, "Swiss German" }, - { KBD_UNITED_KINGDOM, "United Kingdom" }, - { KBD_LATIN_AMERICAN, "Latin American" }, - { KBD_BELGIAN_FRENCH, "Belgian French" }, - { KBD_BELGIAN_PERIOD, "Belgian (Period)" }, - { KBD_PORTUGUESE, "Portuguese" }, - { KBD_SERBIAN_LATIN, "Serbian (Latin)" }, - { KBD_AZERI_CYRILLIC, "Azeri Cyrillic" }, - { KBD_SWEDISH_WITH_SAMI, "Swedish with Sami" }, - { KBD_UZBEK_CYRILLIC, "Uzbek Cyrillic" }, - { KBD_INUKTITUT_LATIN, "Inuktitut Latin" }, - { KBD_CANADIAN_FRENCH_LEGACY, "Canadian French (legacy)" }, - { KBD_SERBIAN_CYRILLIC, "Serbian (Cyrillic)" }, - { KBD_CANADIAN_FRENCH, "Canadian French" }, - { KBD_SWISS_FRENCH, "Swiss French" }, - { KBD_BOSNIAN, "Bosnian" }, - { KBD_IRISH, "Irish" }, - { KBD_BOSNIAN_CYRILLIC, "Bosnian Cyrillic" } + { KBD_ROMANIAN, "Romanian" }, + { KBD_RUSSIAN, "Russian" }, + { KBD_CROATIAN, "Croatian" }, + { KBD_SLOVAK, "Slovak" }, + { KBD_ALBANIAN, "Albanian" }, + { KBD_SWEDISH, "Swedish" }, + { KBD_THAI_KEDMANEE, "Thai Kedmanee" }, + { KBD_TURKISH_Q, "Turkish Q" }, + { KBD_URDU, "Urdu" }, + { KBD_UKRAINIAN, "Ukrainian" }, + { KBD_BELARUSIAN, "Belarusian" }, + { KBD_SLOVENIAN, "Slovenian" }, + { KBD_ESTONIAN, "Estonian" }, + { KBD_LATVIAN, "Latvian" }, + { KBD_LITHUANIAN_IBM, "Lithuanian IBM" }, + { KBD_FARSI, "Farsi" }, + { KBD_VIETNAMESE, "Vietnamese" }, + { KBD_ARMENIAN_EASTERN, "Armenian Eastern" }, + { KBD_AZERI_LATIN, "Azeri Latin" }, + { KBD_FYRO_MACEDONIAN, "FYRO Macedonian" }, + { KBD_GEORGIAN, "Georgian" }, + { KBD_FAEROESE, "Faeroese" }, + { KBD_DEVANAGARI_INSCRIPT, "Devanagari - INSCRIPT" }, + { KBD_MALTESE_47_KEY, "Maltese 47-key" }, + { KBD_NORWEGIAN_WITH_SAMI, "Norwegian with Sami" }, + { KBD_KAZAKH, "Kazakh" }, + { KBD_KYRGYZ_CYRILLIC, "Kyrgyz Cyrillic" }, + { KBD_TATAR, "Tatar" }, + { KBD_BENGALI, "Bengali" }, + { KBD_PUNJABI, "Punjabi" }, + { KBD_GUJARATI, "Gujarati" }, + { KBD_TAMIL, "Tamil" }, + { KBD_TELUGU, "Telugu" }, + { KBD_KANNADA, "Kannada" }, + { KBD_MALAYALAM, "Malayalam" }, + { KBD_MARATHI, "Marathi" }, + { KBD_MONGOLIAN_CYRILLIC, "Mongolian Cyrillic" }, + { KBD_UNITED_KINGDOM_EXTENDED, "United Kingdom Extended" }, + { KBD_SYRIAC, "Syriac" }, + { KBD_NEPALI, "Nepali" }, + { KBD_PASHTO, "Pashto" }, + { KBD_DIVEHI_PHONETIC, "Divehi Phonetic" }, + { KBD_LUXEMBOURGISH, "Luxembourgish" }, + { KBD_MAORI, "Maori" }, + { KBD_CHINESE_SIMPLIFIED_US, "Chinese (Simplified) - US Keyboard" }, + { KBD_SWISS_GERMAN, "Swiss German" }, + { KBD_UNITED_KINGDOM, "United Kingdom" }, + { KBD_LATIN_AMERICAN, "Latin American" }, + { KBD_BELGIAN_FRENCH, "Belgian French" }, + { KBD_BELGIAN_PERIOD, "Belgian (Period)" }, + { KBD_PORTUGUESE, "Portuguese" }, + { KBD_SERBIAN_LATIN, "Serbian (Latin)" }, + { KBD_AZERI_CYRILLIC, "Azeri Cyrillic" }, + { KBD_SWEDISH_WITH_SAMI, "Swedish with Sami" }, + { KBD_UZBEK_CYRILLIC, "Uzbek Cyrillic" }, + { KBD_INUKTITUT_LATIN, "Inuktitut Latin" }, + { KBD_CANADIAN_FRENCH_LEGACY, "Canadian French (legacy)" }, + { KBD_SERBIAN_CYRILLIC, "Serbian (Cyrillic)" }, + { KBD_CANADIAN_FRENCH, "Canadian French" }, + { KBD_SWISS_FRENCH, "Swiss French" }, + { KBD_BOSNIAN, "Bosnian" }, + { KBD_IRISH, "Irish" }, + { KBD_BOSNIAN_CYRILLIC, "Bosnian Cyrillic" } }; struct _RDP_KEYBOARD_LAYOUT_VARIANT { - DWORD code; /* Keyboard layout code */ - DWORD id; /* Keyboard variant ID */ + DWORD code; /* Keyboard layout code */ + DWORD id; /* Keyboard variant ID */ const char* name; /* Keyboard layout variant name */ }; typedef struct _RDP_KEYBOARD_LAYOUT_VARIANT RDP_KEYBOARD_LAYOUT_VARIANT; -static const RDP_KEYBOARD_LAYOUT_VARIANT RDP_KEYBOARD_LAYOUT_VARIANT_TABLE[] = -{ - { KBD_ARABIC_102, 0x0028, "Arabic (102)" }, - { KBD_BULGARIAN_LATIN, 0x0004, "Bulgarian (Latin)" }, - { KBD_CZECH_QWERTY, 0x0005, "Czech (QWERTY)" }, - { KBD_GERMAN_IBM, 0x0012, "German (IBM)" }, - { KBD_GREEK_220, 0x0016, "Greek (220)" }, - { KBD_UNITED_STATES_DVORAK, 0x0002, "United States-Dvorak" }, - { KBD_SPANISH_VARIATION, 0x0086, "Spanish Variation" }, - { KBD_HUNGARIAN_101_KEY, 0x0006, "Hungarian 101-key" }, - { KBD_ITALIAN_142, 0x0003, "Italian (142)" }, - { KBD_POLISH_214, 0x0007, "Polish (214)" }, - { KBD_PORTUGUESE_BRAZILIAN_ABNT2, 0x001D, "Portuguese (Brazilian ABNT2)" }, - { KBD_RUSSIAN_TYPEWRITER, 0x0008, "Russian (Typewriter)" }, - { KBD_SLOVAK_QWERTY, 0x0013, "Slovak (QWERTY)" }, - { KBD_THAI_PATTACHOTE, 0x0021, "Thai Pattachote" }, - { KBD_TURKISH_F, 0x0014, "Turkish F" }, - { KBD_LATVIAN_QWERTY, 0x0015, "Latvian (QWERTY)" }, - { KBD_LITHUANIAN, 0x0027, "Lithuanian" }, - { KBD_ARMENIAN_WESTERN, 0x0025, "Armenian Western" }, - { KBD_HINDI_TRADITIONAL, 0x000C, "Hindi Traditional" }, - { KBD_MALTESE_48_KEY, 0x002B, "Maltese 48-key" }, - { KBD_SAMI_EXTENDED_NORWAY, 0x002C, "Sami Extended Norway" }, - { KBD_BENGALI_INSCRIPT, 0x002A, "Bengali (Inscript)" }, - { KBD_SYRIAC_PHONETIC, 0x000E, "Syriac Phonetic" }, - { KBD_DIVEHI_TYPEWRITER, 0x000D, "Divehi Typewriter" }, - { KBD_BELGIAN_COMMA, 0x001E, "Belgian (Comma)" }, - { KBD_FINNISH_WITH_SAMI, 0x002D, "Finnish with Sami" }, - { KBD_CANADIAN_MULTILINGUAL_STANDARD, 0x0020, "Canadian Multilingual Standard" }, - { KBD_GAELIC, 0x0026, "Gaelic" }, - { KBD_ARABIC_102_AZERTY, 0x0029, "Arabic (102) AZERTY" }, - { KBD_CZECH_PROGRAMMERS, 0x000A, "Czech Programmers" }, - { KBD_GREEK_319, 0x0018, "Greek (319)" }, - { KBD_UNITED_STATES_INTERNATIONAL, 0x0001, "United States-International" }, - { KBD_THAI_KEDMANEE_NON_SHIFTLOCK, 0x0022, "Thai Kedmanee (non-ShiftLock)" }, - { KBD_SAMI_EXTENDED_FINLAND_SWEDEN, 0x002E, "Sami Extended Finland-Sweden" }, - { KBD_GREEK_220_LATIN, 0x0017, "Greek (220) Latin" }, - { KBD_UNITED_STATES_DVORAK_FOR_LEFT_HAND, 0x001A, "United States-Dvorak for left hand" }, - { KBD_THAI_PATTACHOTE_NON_SHIFTLOCK, 0x0023, "Thai Pattachote (non-ShiftLock)" }, - { KBD_GREEK_319_LATIN, 0x0011, "Greek (319) Latin" }, - { KBD_UNITED_STATES_DVORAK_FOR_RIGHT_HAND, 0x001B, "United States-Dvorak for right hand" }, - { KBD_UNITED_STATES_DVORAK_PROGRAMMER, 0x001C, "United States-Programmer Dvorak" }, - { KBD_GREEK_LATIN, 0x0019, "Greek Latin" }, - { KBD_US_ENGLISH_TABLE_FOR_IBM_ARABIC_238_L, 0x000B, "US English Table for IBM Arabic 238_L" }, - { KBD_GREEK_POLYTONIC, 0x001F, "Greek Polytonic" }, - { KBD_FRENCH_BEPO, 0x00C0, "French Bépo" }, - { KBD_GERMAN_NEO, 0x00C0, "German Neo" } +static const RDP_KEYBOARD_LAYOUT_VARIANT RDP_KEYBOARD_LAYOUT_VARIANT_TABLE[] = { + { KBD_ARABIC_102, 0x0028, "Arabic (102)" }, + { KBD_BULGARIAN_LATIN, 0x0004, "Bulgarian (Latin)" }, + { KBD_CZECH_QWERTY, 0x0005, "Czech (QWERTY)" }, + { KBD_GERMAN_IBM, 0x0012, "German (IBM)" }, + { KBD_GREEK_220, 0x0016, "Greek (220)" }, + { KBD_UNITED_STATES_DVORAK, 0x0002, "United States-Dvorak" }, + { KBD_SPANISH_VARIATION, 0x0086, "Spanish Variation" }, + { KBD_HUNGARIAN_101_KEY, 0x0006, "Hungarian 101-key" }, + { KBD_ITALIAN_142, 0x0003, "Italian (142)" }, + { KBD_POLISH_214, 0x0007, "Polish (214)" }, + { KBD_PORTUGUESE_BRAZILIAN_ABNT2, 0x001D, "Portuguese (Brazilian ABNT2)" }, + { KBD_RUSSIAN_TYPEWRITER, 0x0008, "Russian (Typewriter)" }, + { KBD_SLOVAK_QWERTY, 0x0013, "Slovak (QWERTY)" }, + { KBD_THAI_PATTACHOTE, 0x0021, "Thai Pattachote" }, + { KBD_TURKISH_F, 0x0014, "Turkish F" }, + { KBD_LATVIAN_QWERTY, 0x0015, "Latvian (QWERTY)" }, + { KBD_LITHUANIAN, 0x0027, "Lithuanian" }, + { KBD_ARMENIAN_WESTERN, 0x0025, "Armenian Western" }, + { KBD_HINDI_TRADITIONAL, 0x000C, "Hindi Traditional" }, + { KBD_MALTESE_48_KEY, 0x002B, "Maltese 48-key" }, + { KBD_SAMI_EXTENDED_NORWAY, 0x002C, "Sami Extended Norway" }, + { KBD_BENGALI_INSCRIPT, 0x002A, "Bengali (Inscript)" }, + { KBD_SYRIAC_PHONETIC, 0x000E, "Syriac Phonetic" }, + { KBD_DIVEHI_TYPEWRITER, 0x000D, "Divehi Typewriter" }, + { KBD_BELGIAN_COMMA, 0x001E, "Belgian (Comma)" }, + { KBD_FINNISH_WITH_SAMI, 0x002D, "Finnish with Sami" }, + { KBD_CANADIAN_MULTILINGUAL_STANDARD, 0x0020, "Canadian Multilingual Standard" }, + { KBD_GAELIC, 0x0026, "Gaelic" }, + { KBD_ARABIC_102_AZERTY, 0x0029, "Arabic (102) AZERTY" }, + { KBD_CZECH_PROGRAMMERS, 0x000A, "Czech Programmers" }, + { KBD_GREEK_319, 0x0018, "Greek (319)" }, + { KBD_UNITED_STATES_INTERNATIONAL, 0x0001, "United States-International" }, + { KBD_THAI_KEDMANEE_NON_SHIFTLOCK, 0x0022, "Thai Kedmanee (non-ShiftLock)" }, + { KBD_SAMI_EXTENDED_FINLAND_SWEDEN, 0x002E, "Sami Extended Finland-Sweden" }, + { KBD_GREEK_220_LATIN, 0x0017, "Greek (220) Latin" }, + { KBD_UNITED_STATES_DVORAK_FOR_LEFT_HAND, 0x001A, "United States-Dvorak for left hand" }, + { KBD_THAI_PATTACHOTE_NON_SHIFTLOCK, 0x0023, "Thai Pattachote (non-ShiftLock)" }, + { KBD_GREEK_319_LATIN, 0x0011, "Greek (319) Latin" }, + { KBD_UNITED_STATES_DVORAK_FOR_RIGHT_HAND, 0x001B, "United States-Dvorak for right hand" }, + { KBD_UNITED_STATES_DVORAK_PROGRAMMER, 0x001C, "United States-Programmer Dvorak" }, + { KBD_GREEK_LATIN, 0x0019, "Greek Latin" }, + { KBD_US_ENGLISH_TABLE_FOR_IBM_ARABIC_238_L, 0x000B, "US English Table for IBM Arabic 238_L" }, + { KBD_GREEK_POLYTONIC, 0x001F, "Greek Polytonic" }, + { KBD_FRENCH_BEPO, 0x00C0, "French Bépo" }, + { KBD_GERMAN_NEO, 0x00C0, "German Neo" } }; /* Input Method Editor (IME) */ struct _RDP_KEYBOARD_IME { - DWORD code; /* Keyboard layout code */ + DWORD code; /* Keyboard layout code */ const char* file; /* IME file */ const char* name; /* Keyboard layout name */ }; @@ -195,25 +193,27 @@ typedef struct _RDP_KEYBOARD_IME RDP_KEYBOARD_IME; /* Global Input Method Editors (IME) */ -static const RDP_KEYBOARD_IME RDP_KEYBOARD_IME_TABLE[] = -{ - { KBD_CHINESE_TRADITIONAL_PHONETIC, "phon.ime", "Chinese (Traditional) - Phonetic" }, - { KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002, "imjp81.ime", "Japanese Input System (MS-IME2002)" }, - { KBD_KOREAN_INPUT_SYSTEM_IME_2000, "imekr61.ime", "Korean Input System (IME 2000)" }, - { KBD_CHINESE_SIMPLIFIED_QUANPIN, "winpy.ime", "Chinese (Simplified) - QuanPin" }, - { KBD_CHINESE_TRADITIONAL_CHANGJIE, "chajei.ime", "Chinese (Traditional) - ChangJie" }, - { KBD_CHINESE_SIMPLIFIED_SHUANGPIN, "winsp.ime", "Chinese (Simplified) - ShuangPin" }, - { KBD_CHINESE_TRADITIONAL_QUICK, "quick.ime", "Chinese (Traditional) - Quick" }, - { KBD_CHINESE_SIMPLIFIED_ZHENGMA, "winzm.ime", "Chinese (Simplified) - ZhengMa" }, - { KBD_CHINESE_TRADITIONAL_BIG5_CODE, "winime.ime", "Chinese (Traditional) - Big5 Code" }, - { KBD_CHINESE_TRADITIONAL_ARRAY, "winar30.ime", "Chinese (Traditional) - Array" }, - { KBD_CHINESE_SIMPLIFIED_NEIMA, "wingb.ime", "Chinese (Simplified) - NeiMa" }, - { KBD_CHINESE_TRADITIONAL_DAYI, "dayi.ime", "Chinese (Traditional) - DaYi" }, - { KBD_CHINESE_TRADITIONAL_UNICODE, "unicdime.ime", "Chinese (Traditional) - Unicode" }, - { KBD_CHINESE_TRADITIONAL_NEW_PHONETIC, "TINTLGNT.IME", "Chinese (Traditional) - New Phonetic" }, - { KBD_CHINESE_TRADITIONAL_NEW_CHANGJIE, "CINTLGNT.IME", "Chinese (Traditional) - New ChangJie" }, - { KBD_CHINESE_TRADITIONAL_MICROSOFT_PINYIN_IME_3, "pintlgnt.ime", "Chinese (Traditional) - Microsoft Pinyin IME 3.0" }, - { KBD_CHINESE_TRADITIONAL_ALPHANUMERIC, "romanime.ime", "Chinese (Traditional) - Alphanumeric" } +static const RDP_KEYBOARD_IME RDP_KEYBOARD_IME_TABLE[] = { + { KBD_CHINESE_TRADITIONAL_PHONETIC, "phon.ime", "Chinese (Traditional) - Phonetic" }, + { KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002, "imjp81.ime", "Japanese Input System (MS-IME2002)" }, + { KBD_KOREAN_INPUT_SYSTEM_IME_2000, "imekr61.ime", "Korean Input System (IME 2000)" }, + { KBD_CHINESE_SIMPLIFIED_QUANPIN, "winpy.ime", "Chinese (Simplified) - QuanPin" }, + { KBD_CHINESE_TRADITIONAL_CHANGJIE, "chajei.ime", "Chinese (Traditional) - ChangJie" }, + { KBD_CHINESE_SIMPLIFIED_SHUANGPIN, "winsp.ime", "Chinese (Simplified) - ShuangPin" }, + { KBD_CHINESE_TRADITIONAL_QUICK, "quick.ime", "Chinese (Traditional) - Quick" }, + { KBD_CHINESE_SIMPLIFIED_ZHENGMA, "winzm.ime", "Chinese (Simplified) - ZhengMa" }, + { KBD_CHINESE_TRADITIONAL_BIG5_CODE, "winime.ime", "Chinese (Traditional) - Big5 Code" }, + { KBD_CHINESE_TRADITIONAL_ARRAY, "winar30.ime", "Chinese (Traditional) - Array" }, + { KBD_CHINESE_SIMPLIFIED_NEIMA, "wingb.ime", "Chinese (Simplified) - NeiMa" }, + { KBD_CHINESE_TRADITIONAL_DAYI, "dayi.ime", "Chinese (Traditional) - DaYi" }, + { KBD_CHINESE_TRADITIONAL_UNICODE, "unicdime.ime", "Chinese (Traditional) - Unicode" }, + { KBD_CHINESE_TRADITIONAL_NEW_PHONETIC, "TINTLGNT.IME", + "Chinese (Traditional) - New Phonetic" }, + { KBD_CHINESE_TRADITIONAL_NEW_CHANGJIE, "CINTLGNT.IME", + "Chinese (Traditional) - New ChangJie" }, + { KBD_CHINESE_TRADITIONAL_MICROSOFT_PINYIN_IME_3, "pintlgnt.ime", + "Chinese (Traditional) - Microsoft Pinyin IME 3.0" }, + { KBD_CHINESE_TRADITIONAL_ALPHANUMERIC, "romanime.ime", "Chinese (Traditional) - Alphanumeric" } }; void freerdp_keyboard_layouts_free(RDP_KEYBOARD_LAYOUT* layouts) @@ -226,7 +226,7 @@ void freerdp_keyboard_layouts_free(RDP_KEYBOARD_LAYOUT* layouts) while ((current->code != 0) && (current->name != NULL)) { free(current->name); - current ++; + current++; } free(layouts); @@ -238,7 +238,7 @@ RDP_KEYBOARD_LAYOUT* freerdp_keyboard_get_layouts(DWORD types) RDP_KEYBOARD_LAYOUT* layouts; RDP_KEYBOARD_LAYOUT* new; num = 0; - layouts = (RDP_KEYBOARD_LAYOUT*) calloc((num + 1), sizeof(RDP_KEYBOARD_LAYOUT)); + layouts = (RDP_KEYBOARD_LAYOUT*)calloc((num + 1), sizeof(RDP_KEYBOARD_LAYOUT)); if (!layouts) return NULL; @@ -246,7 +246,8 @@ RDP_KEYBOARD_LAYOUT* freerdp_keyboard_get_layouts(DWORD types) if ((types & RDP_KEYBOARD_LAYOUT_TYPE_STANDARD) != 0) { length = ARRAYSIZE(RDP_KEYBOARD_LAYOUT_TABLE); - new = (RDP_KEYBOARD_LAYOUT*) realloc(layouts, (num + length + 1) * sizeof(RDP_KEYBOARD_LAYOUT)); + new = (RDP_KEYBOARD_LAYOUT*)realloc(layouts, + (num + length + 1) * sizeof(RDP_KEYBOARD_LAYOUT)); if (!new) goto fail; @@ -266,7 +267,8 @@ RDP_KEYBOARD_LAYOUT* freerdp_keyboard_get_layouts(DWORD types) if ((types & RDP_KEYBOARD_LAYOUT_TYPE_VARIANT) != 0) { length = ARRAYSIZE(RDP_KEYBOARD_LAYOUT_VARIANT_TABLE); - new = (RDP_KEYBOARD_LAYOUT*) realloc(layouts, (num + length + 1) * sizeof(RDP_KEYBOARD_LAYOUT)); + new = (RDP_KEYBOARD_LAYOUT*)realloc(layouts, + (num + length + 1) * sizeof(RDP_KEYBOARD_LAYOUT)); if (!new) goto fail; @@ -286,7 +288,8 @@ RDP_KEYBOARD_LAYOUT* freerdp_keyboard_get_layouts(DWORD types) if ((types & RDP_KEYBOARD_LAYOUT_TYPE_IME) != 0) { length = ARRAYSIZE(RDP_KEYBOARD_IME_TABLE); - new = (RDP_KEYBOARD_LAYOUT*) realloc(layouts, (num + length + 1) * sizeof(RDP_KEYBOARD_LAYOUT)); + new = (RDP_KEYBOARD_LAYOUT*)realloc(layouts, + (num + length + 1) * sizeof(RDP_KEYBOARD_LAYOUT)); if (!new) goto fail; diff --git a/libfreerdp/locale/keyboard_sun.c b/libfreerdp/locale/keyboard_sun.c index 57fa9dccf..6b25d50d0 100644 --- a/libfreerdp/locale/keyboard_sun.c +++ b/libfreerdp/locale/keyboard_sun.c @@ -57,152 +57,151 @@ struct _SOLARIS_KEYBOARD { - UINT32 type; /* Solaris keyboard type */ - UINT32 layout; /* Layout */ - char* xkbType; /* XKB keyboard */ + UINT32 type; /* Solaris keyboard type */ + UINT32 layout; /* Layout */ + char* xkbType; /* XKB keyboard */ UINT32 keyboardLayoutId; /* XKB keyboard layout */ }; typedef struct _SOLARIS_KEYBOARD SOLARIS_KEYBOARD; -static const SOLARIS_KEYBOARD SOLARIS_KEYBOARD_TABLE[] = -{ - { 4, 0, "sun(type4)", KBD_US }, /* US4 */ - { 4, 1, "sun(type4)", KBD_US }, /* US4 */ - { 4, 2, "sun(type4tuv)", KBD_FRENCH }, /* FranceBelg4 */ - { 4, 3, "sun(type4_ca)", KBD_US }, /* Canada4 */ - { 4, 4, "sun(type4tuv)", KBD_DANISH }, /* Denmark4 */ - { 4, 5, "sun(type4tuv)", KBD_GERMAN }, /* Germany4 */ - { 4, 6, "sun(type4tuv)", KBD_ITALIAN }, /* Italy4 */ - { 4, 7, "sun(type4tuv)", KBD_DUTCH }, /* Netherland4 */ - { 4, 8, "sun(type4tuv)", KBD_NORWEGIAN }, /* Norway4 */ - { 4, 9, "sun(type4tuv)", KBD_PORTUGUESE }, /* Portugal4 */ - { 4, 10, "sun(type4tuv)", KBD_SPANISH }, /* SpainLatAm4 */ - { 4, 11, "sun(type4tuv)", KBD_SWEDISH }, /* SwedenFin4 */ - { 4, 12, "sun(type4tuv)", KBD_SWISS_FRENCH }, /* Switzer_Fr4 */ - { 4, 13, "sun(type4tuv)", KBD_SWISS_GERMAN }, /* Switzer_Ge4 */ - { 4, 14, "sun(type4tuv)", KBD_UNITED_KINGDOM }, /* UK4 */ - { 4, 16, "sun(type4)", KBD_KOREAN_INPUT_SYSTEM_IME_2000 }, /* Korea4 */ - { 4, 17, "sun(type4)", KBD_CHINESE_TRADITIONAL_PHONETIC }, /* Taiwan4 */ - { 4, 32, "sun(type4jp)", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 }, /* Japan4 */ - { 4, 19, "sun(type5)", KBD_US }, /* US101A_PC */ - { 4, 33, "sun(type5)", KBD_US }, /* US5 */ - { 4, 34, "sun(type5unix)", KBD_US }, /* US_UNIX5 */ - { 4, 35, "sun(type5tuv)", KBD_FRENCH }, /* France5 */ - { 4, 36, "sun(type5tuv)", KBD_DANISH }, /* Denmark5 */ - { 4, 37, "sun(type5tuv)", KBD_GERMAN }, /* Germany5 */ - { 4, 38, "sun(type5tuv)", KBD_ITALIAN }, /* Italy5 */ - { 4, 39, "sun(type5tuv)", KBD_DUTCH }, /* Netherland5 */ - { 4, 40, "sun(type5tuv)", KBD_NORWEGIAN }, /* Norway5 */ - { 4, 41, "sun(type5tuv)", KBD_PORTUGUESE }, /* Portugal5 */ - { 4, 42, "sun(type5tuv)", KBD_SPANISH }, /* Spain5 */ - { 4, 43, "sun(type5tuv)", KBD_SWEDISH }, /* Sweden5 */ - { 4, 44, "sun(type5tuv)", KBD_SWISS_FRENCH }, /* Switzer_Fr5 */ - { 4, 45, "sun(type5tuv)", KBD_SWISS_GERMAN }, /* Switzer_Ge5 */ - { 4, 46, "sun(type5tuv)", KBD_UNITED_KINGDOM }, /* UK5 */ - { 4, 47, "sun(type5)", KBD_KOREAN_INPUT_SYSTEM_IME_2000 }, /* Korea5 */ - { 4, 48, "sun(type5)", KBD_CHINESE_TRADITIONAL_PHONETIC }, /* Taiwan5 */ - { 4, 49, "sun(type5jp)", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 }, /* Japan5 */ - { 4, 50, "sun(type5tuv)", KBD_CANADIAN_FRENCH }, /* Canada_Fr5 */ - { 4, 51, "sun(type5tuv)", KBD_HUNGARIAN }, /* Hungary5 */ - { 4, 52, "sun(type5tuv)", KBD_POLISH_214 }, /* Poland5 */ - { 4, 53, "sun(type5tuv)", KBD_CZECH }, /* Czech5 */ - { 4, 54, "sun(type5tuv)", KBD_RUSSIAN }, /* Russia5 */ - { 4, 55, "sun(type5tuv)", KBD_LATVIAN }, /* Latvia5 */ - { 4, 57, "sun(type5tuv)", KBD_GREEK }, /* Greece5 */ - { 4, 59, "sun(type5tuv)", KBD_LITHUANIAN }, /* Lithuania5 */ - { 4, 63, "sun(type5tuv)", KBD_CANADIAN_FRENCH }, /* Canada_Fr5_TBITS5 */ - { 4, 56, "sun(type5tuv)", KBD_TURKISH_Q }, /* TurkeyQ5 */ - { 4, 58, "sun(type5tuv)", KBD_ARABIC_101 }, /* Arabic5 */ - { 4, 60, "sun(type5tuv)", KBD_BELGIAN_FRENCH }, /* Belgian5 */ - { 4, 62, "sun(type5tuv)", KBD_TURKISH_F }, /* TurkeyF5 */ - { 4, 80, "sun(type5hobo)", KBD_US }, /* US5_Hobo */ - { 4, 81, "sun(type5hobo)", KBD_US }, /* US_UNIX5_Hobo */ - { 4, 82, "sun(type5tuvhobo)", KBD_FRENCH }, /* France5_Hobo */ - { 4, 83, "sun(type5tuvhobo)", KBD_DANISH }, /* Denmark5_Hobo */ - { 4, 84, "sun(type5tuvhobo)", KBD_GERMAN }, /* Germany5_Hobo */ - { 4, 85, "sun(type5tuvhobo)", KBD_ITALIAN }, /* Italy5_Hobo */ - { 4, 86, "sun(type5tuvhobo)", KBD_DUTCH }, /* Netherland5_Hobo */ - { 4, 87, "sun(type5tuvhobo)", KBD_NORWEGIAN }, /* Norway5_Hobo */ - { 4, 88, "sun(type5tuvhobo)", KBD_PORTUGUESE }, /* Portugal5_Hobo */ - { 4, 89, "sun(type5tuvhobo)", KBD_SPANISH }, /* Spain5_Hobo */ - { 4, 90, "sun(type5tuvhobo)", KBD_SWEDISH }, /* Sweden5_Hobo */ - { 4, 91, "sun(type5tuvhobo)", KBD_SWISS_FRENCH }, /* Switzer_Fr5_Hobo */ - { 4, 92, "sun(type5tuvhobo)", KBD_SWISS_GERMAN }, /* Switzer_Ge5_Hobo */ - { 4, 93, "sun(type5tuvhobo)", KBD_UNITED_KINGDOM }, /* UK5_Hobo */ - { 4, 94, "sun(type5hobo)", KBD_KOREAN_INPUT_SYSTEM_IME_2000 }, /* Korea5_Hobo */ - { 4, 95, "sun(type5hobo)", KBD_CHINESE_TRADITIONAL_PHONETIC }, /* Taiwan5_Hobo */ - { 4, 96, "sun(type5jphobo)", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 }, /* Japan5_Hobo */ - { 4, 97, "sun(type5tuvhobo)", KBD_CANADIAN_FRENCH }, /* Canada_Fr5_Hobo */ - { 101, 1, "digital_vndr/pc(pc104)", KBD_US }, /* US101A_x86 */ - { 101, 34, "digital_vndr/pc(pc104)", KBD_US }, /* J3100_x86 */ - { 101, 35, "digital_vndr/pc(pc104)", KBD_FRENCH }, /* France_x86 */ - { 101, 36, "digital_vndr/pc(pc104)", KBD_DANISH }, /* Denmark_x86 */ - { 101, 37, "digital_vndr/pc(pc104)", KBD_GERMAN }, /* Germany_x86 */ - { 101, 38, "digital_vndr/pc(pc104)", KBD_ITALIAN }, /* Italy_x86 */ - { 101, 39, "digital_vndr/pc(pc104)", KBD_DUTCH }, /* Netherland_x86 */ - { 101, 40, "digital_vndr/pc(pc104)", KBD_NORWEGIAN }, /* Norway_x86 */ - { 101, 41, "digital_vndr/pc(pc104)", KBD_PORTUGUESE }, /* Portugal_x86 */ - { 101, 42, "digital_vndr/pc(pc104)", KBD_SPANISH }, /* Spain_x86 */ - { 101, 43, "digital_vndr/pc(pc104)", KBD_SWEDISH }, /* Sweden_x86 */ - { 101, 44, "digital_vndr/pc(pc104)", KBD_SWISS_FRENCH }, /* Switzer_Fr_x86 */ - { 101, 45, "digital_vndr/pc(pc104)", KBD_SWISS_GERMAN }, /* Switzer_Ge_x86 */ - { 101, 46, "digital_vndr/pc(pc104)", KBD_UNITED_KINGDOM }, /* UK_x86 */ - { 101, 47, "digital_vndr/pc(pc104)", KBD_KOREAN_INPUT_SYSTEM_IME_2000 }, /* Korea_x86 */ - { 101, 48, "digital_vndr/pc(pc104)", KBD_CHINESE_TRADITIONAL_PHONETIC }, /* Taiwan_x86 */ - { 101, 49, "digital_vndr/pc(lk411jj)", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 }, /* Japan_x86 */ - { 101, 50, "digital_vndr/pc(pc104)", KBD_CANADIAN_FRENCH }, /* Canada_Fr2_x86 */ - { 101, 51, "digital_vndr/pc(pc104)", KBD_HUNGARIAN }, /* Hungary_x86 */ - { 101, 52, "digital_vndr/pc(pc104)", KBD_POLISH_214 }, /* Poland_x86 */ - { 101, 53, "digital_vndr/pc(pc104)", KBD_CZECH }, /* Czech_x86 */ - { 101, 54, "digital_vndr/pc(pc104)", KBD_RUSSIAN }, /* Russia_x86 */ - { 101, 55, "digital_vndr/pc(pc104)", KBD_LATVIAN }, /* Latvia_x86 */ - { 101, 56, "digital_vndr/pc(pc104)", KBD_TURKISH_Q }, /* Turkey_x86 */ - { 101, 57, "digital_vndr/pc(pc104)", KBD_GREEK }, /* Greece_x86 */ - { 101, 59, "digital_vndr/pc(pc104)", KBD_LITHUANIAN }, /* Lithuania_x86 */ - { 101, 1001, "digital_vndr/pc(pc104)", KBD_US }, /* MS_US101A_x86 */ - { 6, 6, "sun(type6tuv)", KBD_DANISH }, /* Denmark6_usb */ - { 6, 7, "sun(type6tuv)", KBD_FINNISH }, /* Finnish6_usb */ - { 6, 8, "sun(type6tuv)", KBD_FRENCH }, /* France6_usb */ - { 6, 9, "sun(type6tuv)", KBD_GERMAN }, /* Germany6_usb */ - { 6, 14, "sun(type6tuv)", KBD_ITALIAN }, /* Italy6_usb */ - { 6, 15, "sun(type6jp)", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 }, /* Japan7_usb */ - { 6, 16, "sun(type6)", KBD_KOREAN_INPUT_SYSTEM_IME_2000 }, /* Korea6_usb */ - { 6, 18, "sun(type6tuv)", KBD_DUTCH }, /* Netherland6_usb */ - { 6, 19, "sun(type6tuv)", KBD_NORWEGIAN }, /* Norway6_usb */ - { 6, 22, "sun(type6tuv)", KBD_PORTUGUESE }, /* Portugal6_usb */ - { 6, 23, "sun(type6tuv)", KBD_RUSSIAN }, /* Russia6_usb */ - { 6, 25, "sun(type6tuv)", KBD_SPANISH }, /* Spain6_usb */ - { 6, 26, "sun(type6tuv)", KBD_SWEDISH }, /* Sweden6_usb */ - { 6, 27, "sun(type6tuv)", KBD_SWISS_FRENCH }, /* Switzer_Fr6_usb */ - { 6, 28, "sun(type6tuv)", KBD_SWISS_GERMAN }, /* Switzer_Ge6_usb */ - { 6, 30, "sun(type6)", KBD_CHINESE_TRADITIONAL_PHONETIC }, /* Taiwan6_usb */ - { 6, 32, "sun(type6tuv)", KBD_UNITED_KINGDOM }, /* UK6_usb */ - { 6, 33, "sun(type6)", KBD_US }, /* US6_usb */ - { 6, 1, "sun(type6tuv)", KBD_ARABIC_101 }, /* Arabic6_usb */ - { 6, 2, "sun(type6tuv)", KBD_BELGIAN_FRENCH }, /* Belgian6_usb */ - { 6, 31, "sun(type6tuv)", KBD_TURKISH_Q }, /* TurkeyQ6_usb */ - { 6, 35, "sun(type6tuv)", KBD_TURKISH_F }, /* TurkeyF6_usb */ - { 6, 271, "sun(type6jp)", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 }, /* Japan6_usb */ - { 6, 264, "sun(type6tuv)", KBD_ALBANIAN }, /* Albanian6_usb */ - { 6, 261, "sun(type6tuv)", KBD_BELARUSIAN }, /* Belarusian6_usb */ - { 6, 260, "sun(type6tuv)", KBD_BULGARIAN }, /* Bulgarian6_usb */ - { 6, 259, "sun(type6tuv)", KBD_CROATIAN }, /* Croatian6_usb */ - { 6, 5, "sun(type6tuv)", KBD_CZECH }, /* Czech6_usb */ - { 6, 4, "sun(type6tuv)", KBD_CANADIAN_FRENCH }, /* French-Canadian6_usb */ - { 6, 12, "sun(type6tuv)", KBD_HUNGARIAN }, /* Hungarian6_usb */ - { 6, 10, "sun(type6tuv)", KBD_GREEK }, /* Greek6_usb */ - { 6, 17, "sun(type6)", KBD_LATIN_AMERICAN }, /* Latin-American6_usb */ - { 6, 265, "sun(type6tuv)", KBD_LITHUANIAN }, /* Lithuanian6_usb */ - { 6, 266, "sun(type6tuv)", KBD_LATVIAN }, /* Latvian6_usb */ - { 6, 267, "sun(type6tuv)", KBD_FYRO_MACEDONIAN }, /* Macedonian6_usb */ - { 6, 263, "sun(type6tuv)", KBD_MALTESE_47_KEY }, /* Malta_UK6_usb */ - { 6, 262, "sun(type6tuv)", KBD_MALTESE_48_KEY }, /* Malta_US6_usb */ - { 6, 21, "sun(type6tuv)", KBD_POLISH_214 }, /* Polish6_usb */ - { 6, 257, "sun(type6tuv)", KBD_SERBIAN_LATIN }, /* Serbia-And-Montenegro6_usb */ - { 6, 256, "sun(type6tuv)", KBD_SLOVENIAN }, /* Slovenian6_usb */ - { 6, 24, "sun(type6tuv)", KBD_SLOVAK }, /* Slovakian6_usb */ - { 6, 3, "sun(type6)", KBD_CANADIAN_MULTILINGUAL_STANDARD }, /* Canada_Bi6_usb */ - { 6, 272, "sun(type6)", KBD_PORTUGUESE_BRAZILIAN_ABNT } /* Brazil6_usb */ +static const SOLARIS_KEYBOARD SOLARIS_KEYBOARD_TABLE[] = { + { 4, 0, "sun(type4)", KBD_US }, /* US4 */ + { 4, 1, "sun(type4)", KBD_US }, /* US4 */ + { 4, 2, "sun(type4tuv)", KBD_FRENCH }, /* FranceBelg4 */ + { 4, 3, "sun(type4_ca)", KBD_US }, /* Canada4 */ + { 4, 4, "sun(type4tuv)", KBD_DANISH }, /* Denmark4 */ + { 4, 5, "sun(type4tuv)", KBD_GERMAN }, /* Germany4 */ + { 4, 6, "sun(type4tuv)", KBD_ITALIAN }, /* Italy4 */ + { 4, 7, "sun(type4tuv)", KBD_DUTCH }, /* Netherland4 */ + { 4, 8, "sun(type4tuv)", KBD_NORWEGIAN }, /* Norway4 */ + { 4, 9, "sun(type4tuv)", KBD_PORTUGUESE }, /* Portugal4 */ + { 4, 10, "sun(type4tuv)", KBD_SPANISH }, /* SpainLatAm4 */ + { 4, 11, "sun(type4tuv)", KBD_SWEDISH }, /* SwedenFin4 */ + { 4, 12, "sun(type4tuv)", KBD_SWISS_FRENCH }, /* Switzer_Fr4 */ + { 4, 13, "sun(type4tuv)", KBD_SWISS_GERMAN }, /* Switzer_Ge4 */ + { 4, 14, "sun(type4tuv)", KBD_UNITED_KINGDOM }, /* UK4 */ + { 4, 16, "sun(type4)", KBD_KOREAN_INPUT_SYSTEM_IME_2000 }, /* Korea4 */ + { 4, 17, "sun(type4)", KBD_CHINESE_TRADITIONAL_PHONETIC }, /* Taiwan4 */ + { 4, 32, "sun(type4jp)", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 }, /* Japan4 */ + { 4, 19, "sun(type5)", KBD_US }, /* US101A_PC */ + { 4, 33, "sun(type5)", KBD_US }, /* US5 */ + { 4, 34, "sun(type5unix)", KBD_US }, /* US_UNIX5 */ + { 4, 35, "sun(type5tuv)", KBD_FRENCH }, /* France5 */ + { 4, 36, "sun(type5tuv)", KBD_DANISH }, /* Denmark5 */ + { 4, 37, "sun(type5tuv)", KBD_GERMAN }, /* Germany5 */ + { 4, 38, "sun(type5tuv)", KBD_ITALIAN }, /* Italy5 */ + { 4, 39, "sun(type5tuv)", KBD_DUTCH }, /* Netherland5 */ + { 4, 40, "sun(type5tuv)", KBD_NORWEGIAN }, /* Norway5 */ + { 4, 41, "sun(type5tuv)", KBD_PORTUGUESE }, /* Portugal5 */ + { 4, 42, "sun(type5tuv)", KBD_SPANISH }, /* Spain5 */ + { 4, 43, "sun(type5tuv)", KBD_SWEDISH }, /* Sweden5 */ + { 4, 44, "sun(type5tuv)", KBD_SWISS_FRENCH }, /* Switzer_Fr5 */ + { 4, 45, "sun(type5tuv)", KBD_SWISS_GERMAN }, /* Switzer_Ge5 */ + { 4, 46, "sun(type5tuv)", KBD_UNITED_KINGDOM }, /* UK5 */ + { 4, 47, "sun(type5)", KBD_KOREAN_INPUT_SYSTEM_IME_2000 }, /* Korea5 */ + { 4, 48, "sun(type5)", KBD_CHINESE_TRADITIONAL_PHONETIC }, /* Taiwan5 */ + { 4, 49, "sun(type5jp)", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 }, /* Japan5 */ + { 4, 50, "sun(type5tuv)", KBD_CANADIAN_FRENCH }, /* Canada_Fr5 */ + { 4, 51, "sun(type5tuv)", KBD_HUNGARIAN }, /* Hungary5 */ + { 4, 52, "sun(type5tuv)", KBD_POLISH_214 }, /* Poland5 */ + { 4, 53, "sun(type5tuv)", KBD_CZECH }, /* Czech5 */ + { 4, 54, "sun(type5tuv)", KBD_RUSSIAN }, /* Russia5 */ + { 4, 55, "sun(type5tuv)", KBD_LATVIAN }, /* Latvia5 */ + { 4, 57, "sun(type5tuv)", KBD_GREEK }, /* Greece5 */ + { 4, 59, "sun(type5tuv)", KBD_LITHUANIAN }, /* Lithuania5 */ + { 4, 63, "sun(type5tuv)", KBD_CANADIAN_FRENCH }, /* Canada_Fr5_TBITS5 */ + { 4, 56, "sun(type5tuv)", KBD_TURKISH_Q }, /* TurkeyQ5 */ + { 4, 58, "sun(type5tuv)", KBD_ARABIC_101 }, /* Arabic5 */ + { 4, 60, "sun(type5tuv)", KBD_BELGIAN_FRENCH }, /* Belgian5 */ + { 4, 62, "sun(type5tuv)", KBD_TURKISH_F }, /* TurkeyF5 */ + { 4, 80, "sun(type5hobo)", KBD_US }, /* US5_Hobo */ + { 4, 81, "sun(type5hobo)", KBD_US }, /* US_UNIX5_Hobo */ + { 4, 82, "sun(type5tuvhobo)", KBD_FRENCH }, /* France5_Hobo */ + { 4, 83, "sun(type5tuvhobo)", KBD_DANISH }, /* Denmark5_Hobo */ + { 4, 84, "sun(type5tuvhobo)", KBD_GERMAN }, /* Germany5_Hobo */ + { 4, 85, "sun(type5tuvhobo)", KBD_ITALIAN }, /* Italy5_Hobo */ + { 4, 86, "sun(type5tuvhobo)", KBD_DUTCH }, /* Netherland5_Hobo */ + { 4, 87, "sun(type5tuvhobo)", KBD_NORWEGIAN }, /* Norway5_Hobo */ + { 4, 88, "sun(type5tuvhobo)", KBD_PORTUGUESE }, /* Portugal5_Hobo */ + { 4, 89, "sun(type5tuvhobo)", KBD_SPANISH }, /* Spain5_Hobo */ + { 4, 90, "sun(type5tuvhobo)", KBD_SWEDISH }, /* Sweden5_Hobo */ + { 4, 91, "sun(type5tuvhobo)", KBD_SWISS_FRENCH }, /* Switzer_Fr5_Hobo */ + { 4, 92, "sun(type5tuvhobo)", KBD_SWISS_GERMAN }, /* Switzer_Ge5_Hobo */ + { 4, 93, "sun(type5tuvhobo)", KBD_UNITED_KINGDOM }, /* UK5_Hobo */ + { 4, 94, "sun(type5hobo)", KBD_KOREAN_INPUT_SYSTEM_IME_2000 }, /* Korea5_Hobo */ + { 4, 95, "sun(type5hobo)", KBD_CHINESE_TRADITIONAL_PHONETIC }, /* Taiwan5_Hobo */ + { 4, 96, "sun(type5jphobo)", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 }, /* Japan5_Hobo */ + { 4, 97, "sun(type5tuvhobo)", KBD_CANADIAN_FRENCH }, /* Canada_Fr5_Hobo */ + { 101, 1, "digital_vndr/pc(pc104)", KBD_US }, /* US101A_x86 */ + { 101, 34, "digital_vndr/pc(pc104)", KBD_US }, /* J3100_x86 */ + { 101, 35, "digital_vndr/pc(pc104)", KBD_FRENCH }, /* France_x86 */ + { 101, 36, "digital_vndr/pc(pc104)", KBD_DANISH }, /* Denmark_x86 */ + { 101, 37, "digital_vndr/pc(pc104)", KBD_GERMAN }, /* Germany_x86 */ + { 101, 38, "digital_vndr/pc(pc104)", KBD_ITALIAN }, /* Italy_x86 */ + { 101, 39, "digital_vndr/pc(pc104)", KBD_DUTCH }, /* Netherland_x86 */ + { 101, 40, "digital_vndr/pc(pc104)", KBD_NORWEGIAN }, /* Norway_x86 */ + { 101, 41, "digital_vndr/pc(pc104)", KBD_PORTUGUESE }, /* Portugal_x86 */ + { 101, 42, "digital_vndr/pc(pc104)", KBD_SPANISH }, /* Spain_x86 */ + { 101, 43, "digital_vndr/pc(pc104)", KBD_SWEDISH }, /* Sweden_x86 */ + { 101, 44, "digital_vndr/pc(pc104)", KBD_SWISS_FRENCH }, /* Switzer_Fr_x86 */ + { 101, 45, "digital_vndr/pc(pc104)", KBD_SWISS_GERMAN }, /* Switzer_Ge_x86 */ + { 101, 46, "digital_vndr/pc(pc104)", KBD_UNITED_KINGDOM }, /* UK_x86 */ + { 101, 47, "digital_vndr/pc(pc104)", KBD_KOREAN_INPUT_SYSTEM_IME_2000 }, /* Korea_x86 */ + { 101, 48, "digital_vndr/pc(pc104)", KBD_CHINESE_TRADITIONAL_PHONETIC }, /* Taiwan_x86 */ + { 101, 49, "digital_vndr/pc(lk411jj)", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 }, /* Japan_x86 */ + { 101, 50, "digital_vndr/pc(pc104)", KBD_CANADIAN_FRENCH }, /* Canada_Fr2_x86 */ + { 101, 51, "digital_vndr/pc(pc104)", KBD_HUNGARIAN }, /* Hungary_x86 */ + { 101, 52, "digital_vndr/pc(pc104)", KBD_POLISH_214 }, /* Poland_x86 */ + { 101, 53, "digital_vndr/pc(pc104)", KBD_CZECH }, /* Czech_x86 */ + { 101, 54, "digital_vndr/pc(pc104)", KBD_RUSSIAN }, /* Russia_x86 */ + { 101, 55, "digital_vndr/pc(pc104)", KBD_LATVIAN }, /* Latvia_x86 */ + { 101, 56, "digital_vndr/pc(pc104)", KBD_TURKISH_Q }, /* Turkey_x86 */ + { 101, 57, "digital_vndr/pc(pc104)", KBD_GREEK }, /* Greece_x86 */ + { 101, 59, "digital_vndr/pc(pc104)", KBD_LITHUANIAN }, /* Lithuania_x86 */ + { 101, 1001, "digital_vndr/pc(pc104)", KBD_US }, /* MS_US101A_x86 */ + { 6, 6, "sun(type6tuv)", KBD_DANISH }, /* Denmark6_usb */ + { 6, 7, "sun(type6tuv)", KBD_FINNISH }, /* Finnish6_usb */ + { 6, 8, "sun(type6tuv)", KBD_FRENCH }, /* France6_usb */ + { 6, 9, "sun(type6tuv)", KBD_GERMAN }, /* Germany6_usb */ + { 6, 14, "sun(type6tuv)", KBD_ITALIAN }, /* Italy6_usb */ + { 6, 15, "sun(type6jp)", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 }, /* Japan7_usb */ + { 6, 16, "sun(type6)", KBD_KOREAN_INPUT_SYSTEM_IME_2000 }, /* Korea6_usb */ + { 6, 18, "sun(type6tuv)", KBD_DUTCH }, /* Netherland6_usb */ + { 6, 19, "sun(type6tuv)", KBD_NORWEGIAN }, /* Norway6_usb */ + { 6, 22, "sun(type6tuv)", KBD_PORTUGUESE }, /* Portugal6_usb */ + { 6, 23, "sun(type6tuv)", KBD_RUSSIAN }, /* Russia6_usb */ + { 6, 25, "sun(type6tuv)", KBD_SPANISH }, /* Spain6_usb */ + { 6, 26, "sun(type6tuv)", KBD_SWEDISH }, /* Sweden6_usb */ + { 6, 27, "sun(type6tuv)", KBD_SWISS_FRENCH }, /* Switzer_Fr6_usb */ + { 6, 28, "sun(type6tuv)", KBD_SWISS_GERMAN }, /* Switzer_Ge6_usb */ + { 6, 30, "sun(type6)", KBD_CHINESE_TRADITIONAL_PHONETIC }, /* Taiwan6_usb */ + { 6, 32, "sun(type6tuv)", KBD_UNITED_KINGDOM }, /* UK6_usb */ + { 6, 33, "sun(type6)", KBD_US }, /* US6_usb */ + { 6, 1, "sun(type6tuv)", KBD_ARABIC_101 }, /* Arabic6_usb */ + { 6, 2, "sun(type6tuv)", KBD_BELGIAN_FRENCH }, /* Belgian6_usb */ + { 6, 31, "sun(type6tuv)", KBD_TURKISH_Q }, /* TurkeyQ6_usb */ + { 6, 35, "sun(type6tuv)", KBD_TURKISH_F }, /* TurkeyF6_usb */ + { 6, 271, "sun(type6jp)", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 }, /* Japan6_usb */ + { 6, 264, "sun(type6tuv)", KBD_ALBANIAN }, /* Albanian6_usb */ + { 6, 261, "sun(type6tuv)", KBD_BELARUSIAN }, /* Belarusian6_usb */ + { 6, 260, "sun(type6tuv)", KBD_BULGARIAN }, /* Bulgarian6_usb */ + { 6, 259, "sun(type6tuv)", KBD_CROATIAN }, /* Croatian6_usb */ + { 6, 5, "sun(type6tuv)", KBD_CZECH }, /* Czech6_usb */ + { 6, 4, "sun(type6tuv)", KBD_CANADIAN_FRENCH }, /* French-Canadian6_usb */ + { 6, 12, "sun(type6tuv)", KBD_HUNGARIAN }, /* Hungarian6_usb */ + { 6, 10, "sun(type6tuv)", KBD_GREEK }, /* Greek6_usb */ + { 6, 17, "sun(type6)", KBD_LATIN_AMERICAN }, /* Latin-American6_usb */ + { 6, 265, "sun(type6tuv)", KBD_LITHUANIAN }, /* Lithuanian6_usb */ + { 6, 266, "sun(type6tuv)", KBD_LATVIAN }, /* Latvian6_usb */ + { 6, 267, "sun(type6tuv)", KBD_FYRO_MACEDONIAN }, /* Macedonian6_usb */ + { 6, 263, "sun(type6tuv)", KBD_MALTESE_47_KEY }, /* Malta_UK6_usb */ + { 6, 262, "sun(type6tuv)", KBD_MALTESE_48_KEY }, /* Malta_US6_usb */ + { 6, 21, "sun(type6tuv)", KBD_POLISH_214 }, /* Polish6_usb */ + { 6, 257, "sun(type6tuv)", KBD_SERBIAN_LATIN }, /* Serbia-And-Montenegro6_usb */ + { 6, 256, "sun(type6tuv)", KBD_SLOVENIAN }, /* Slovenian6_usb */ + { 6, 24, "sun(type6tuv)", KBD_SLOVAK }, /* Slovakian6_usb */ + { 6, 3, "sun(type6)", KBD_CANADIAN_MULTILINGUAL_STANDARD }, /* Canada_Bi6_usb */ + { 6, 272, "sun(type6)", KBD_PORTUGUESE_BRAZILIAN_ABNT } /* Brazil6_usb */ }; int freerdp_get_solaris_keyboard_layout_and_type(int* type, int* layout) @@ -214,13 +213,13 @@ int freerdp_get_solaris_keyboard_layout_and_type(int* type, int* layout) int rc = -1; char buffer[1024]; /* - Sample output for "kbd -t -l" : + Sample output for "kbd -t -l" : - USB keyboard - type=6 - layout=3 (0x03) - delay(ms)=500 - rate(ms)=40 + USB keyboard + type=6 + layout=3 (0x03) + delay(ms)=500 + rate(ms)=40 */ *type = 0; *layout = 0; diff --git a/libfreerdp/locale/keyboard_x11.c b/libfreerdp/locale/keyboard_x11.c index e9ca41f2a..58b4bce66 100644 --- a/libfreerdp/locale/keyboard_x11.c +++ b/libfreerdp/locale/keyboard_x11.c @@ -48,7 +48,7 @@ int freerdp_detect_keyboard_layout_from_xkb(DWORD* keyboardLayoutId) /* We start by looking for _XKB_RULES_NAMES_BACKUP which appears to be used by libxklavier */ - if (!(xprop = popen("xprop -root _XKB_RULES_NAMES_BACKUP", "r"))) + if (!(xprop = popen("xprop -root _XKB_RULES_NAMES_BACKUP", "r"))) return 0; /* Sample output for "Canadian Multilingual Standard" @@ -186,8 +186,9 @@ char* freerdp_detect_keymap_from_xkb() *end = '\0'; length = (end - beg); - keymap = (char*) malloc(length + 1); - if (keymap) { + keymap = (char*)malloc(length + 1); + if (keymap) + { strncpy(keymap, beg, length); keymap[length] = '\0'; } diff --git a/libfreerdp/locale/keyboard_x11.h b/libfreerdp/locale/keyboard_x11.h index 0d7678f06..0d6123d2f 100644 --- a/libfreerdp/locale/keyboard_x11.h +++ b/libfreerdp/locale/keyboard_x11.h @@ -22,7 +22,6 @@ #include -FREERDP_LOCAL int freerdp_detect_keyboard_layout_from_xkb( - DWORD* keyboardLayoutId); +FREERDP_LOCAL int freerdp_detect_keyboard_layout_from_xkb(DWORD* keyboardLayoutId); #endif /* FREERDP_LOCALE_KEYBOARD_X11_H */ diff --git a/libfreerdp/locale/keyboard_xkbfile.c b/libfreerdp/locale/keyboard_xkbfile.c index fd84e7f29..9fb59d490 100644 --- a/libfreerdp/locale/keyboard_xkbfile.c +++ b/libfreerdp/locale/keyboard_xkbfile.c @@ -48,116 +48,115 @@ struct _XKB_KEY_NAME_SCANCODE }; typedef struct _XKB_KEY_NAME_SCANCODE XKB_KEY_NAME_SCANCODE; -XKB_KEY_NAME_SCANCODE XKB_KEY_NAME_SCANCODE_TABLE[] = -{ +XKB_KEY_NAME_SCANCODE XKB_KEY_NAME_SCANCODE_TABLE[] = { { "AB00", RDP_SCANCODE_LSHIFT }, - { "AB01", RDP_SCANCODE_KEY_Z }, // evdev 52 - { "AB02", RDP_SCANCODE_KEY_X }, // evdev 53 - { "AB03", RDP_SCANCODE_KEY_C }, // evdev 54 - { "AB04", RDP_SCANCODE_KEY_V }, // evdev 55 - { "AB05", RDP_SCANCODE_KEY_B }, // evdev 56 - { "AB06", RDP_SCANCODE_KEY_N }, // evdev 57 - { "AB07", RDP_SCANCODE_KEY_M }, // evdev 58 - { "AB08", RDP_SCANCODE_OEM_COMMA }, // evdev 59 - { "AB09", RDP_SCANCODE_OEM_PERIOD }, // evdev 60 - { "AB10", RDP_SCANCODE_OEM_2 }, // evdev 61. Not KP, not RDP_SCANCODE_DIVIDE - { "AB11", RDP_SCANCODE_ABNT_C1 }, // evdev 97. Brazil backslash/underscore. - { "AC01", RDP_SCANCODE_KEY_A }, // evdev 38 - { "AC02", RDP_SCANCODE_KEY_S }, // evdev 39 - { "AC03", RDP_SCANCODE_KEY_D }, // evdev 40 - { "AC04", RDP_SCANCODE_KEY_F }, // evdev 41 - { "AC05", RDP_SCANCODE_KEY_G }, // evdev 42 - { "AC06", RDP_SCANCODE_KEY_H }, // evdev 43 - { "AC07", RDP_SCANCODE_KEY_J }, // evdev 44 - { "AC08", RDP_SCANCODE_KEY_K }, // evdev 45 - { "AC09", RDP_SCANCODE_KEY_L }, // evdev 46 - { "AC10", RDP_SCANCODE_OEM_1 }, // evdev 47 - { "AC11", RDP_SCANCODE_OEM_7 }, // evdev 48 - { "AC12", RDP_SCANCODE_OEM_5 }, // alias of evdev 51 backslash - { "AD01", RDP_SCANCODE_KEY_Q }, // evdev 24 - { "AD02", RDP_SCANCODE_KEY_W }, // evdev 25 - { "AD03", RDP_SCANCODE_KEY_E }, // evdev 26 - { "AD04", RDP_SCANCODE_KEY_R }, // evdev 27 - { "AD05", RDP_SCANCODE_KEY_T }, // evdev 28 - { "AD06", RDP_SCANCODE_KEY_Y }, // evdev 29 - { "AD07", RDP_SCANCODE_KEY_U }, // evdev 30 - { "AD08", RDP_SCANCODE_KEY_I }, // evdev 31 - { "AD09", RDP_SCANCODE_KEY_O }, // evdev 32 - { "AD10", RDP_SCANCODE_KEY_P }, // evdev 33 - { "AD11", RDP_SCANCODE_OEM_4 }, // evdev 34 - { "AD12", RDP_SCANCODE_OEM_6 }, // evdev 35 + { "AB01", RDP_SCANCODE_KEY_Z }, // evdev 52 + { "AB02", RDP_SCANCODE_KEY_X }, // evdev 53 + { "AB03", RDP_SCANCODE_KEY_C }, // evdev 54 + { "AB04", RDP_SCANCODE_KEY_V }, // evdev 55 + { "AB05", RDP_SCANCODE_KEY_B }, // evdev 56 + { "AB06", RDP_SCANCODE_KEY_N }, // evdev 57 + { "AB07", RDP_SCANCODE_KEY_M }, // evdev 58 + { "AB08", RDP_SCANCODE_OEM_COMMA }, // evdev 59 + { "AB09", RDP_SCANCODE_OEM_PERIOD }, // evdev 60 + { "AB10", RDP_SCANCODE_OEM_2 }, // evdev 61. Not KP, not RDP_SCANCODE_DIVIDE + { "AB11", RDP_SCANCODE_ABNT_C1 }, // evdev 97. Brazil backslash/underscore. + { "AC01", RDP_SCANCODE_KEY_A }, // evdev 38 + { "AC02", RDP_SCANCODE_KEY_S }, // evdev 39 + { "AC03", RDP_SCANCODE_KEY_D }, // evdev 40 + { "AC04", RDP_SCANCODE_KEY_F }, // evdev 41 + { "AC05", RDP_SCANCODE_KEY_G }, // evdev 42 + { "AC06", RDP_SCANCODE_KEY_H }, // evdev 43 + { "AC07", RDP_SCANCODE_KEY_J }, // evdev 44 + { "AC08", RDP_SCANCODE_KEY_K }, // evdev 45 + { "AC09", RDP_SCANCODE_KEY_L }, // evdev 46 + { "AC10", RDP_SCANCODE_OEM_1 }, // evdev 47 + { "AC11", RDP_SCANCODE_OEM_7 }, // evdev 48 + { "AC12", RDP_SCANCODE_OEM_5 }, // alias of evdev 51 backslash + { "AD01", RDP_SCANCODE_KEY_Q }, // evdev 24 + { "AD02", RDP_SCANCODE_KEY_W }, // evdev 25 + { "AD03", RDP_SCANCODE_KEY_E }, // evdev 26 + { "AD04", RDP_SCANCODE_KEY_R }, // evdev 27 + { "AD05", RDP_SCANCODE_KEY_T }, // evdev 28 + { "AD06", RDP_SCANCODE_KEY_Y }, // evdev 29 + { "AD07", RDP_SCANCODE_KEY_U }, // evdev 30 + { "AD08", RDP_SCANCODE_KEY_I }, // evdev 31 + { "AD09", RDP_SCANCODE_KEY_O }, // evdev 32 + { "AD10", RDP_SCANCODE_KEY_P }, // evdev 33 + { "AD11", RDP_SCANCODE_OEM_4 }, // evdev 34 + { "AD12", RDP_SCANCODE_OEM_6 }, // evdev 35 { "AE00", RDP_SCANCODE_OEM_3 }, - { "AE01", RDP_SCANCODE_KEY_1 }, // evdev 10 - { "AE02", RDP_SCANCODE_KEY_2 }, // evdev 11 - { "AE03", RDP_SCANCODE_KEY_3 }, // evdev 12 - { "AE04", RDP_SCANCODE_KEY_4 }, // evdev 13 - { "AE05", RDP_SCANCODE_KEY_5 }, // evdev 14 - { "AE06", RDP_SCANCODE_KEY_6 }, // evdev 15 - { "AE07", RDP_SCANCODE_KEY_7 }, // evdev 16 - { "AE08", RDP_SCANCODE_KEY_8 }, // evdev 17 - { "AE09", RDP_SCANCODE_KEY_9 }, // evdev 18 - { "AE10", RDP_SCANCODE_KEY_0 }, // evdev 19 - { "AE11", RDP_SCANCODE_OEM_MINUS }, // evdev 20 - { "AE12", RDP_SCANCODE_OEM_PLUS }, // evdev 21 + { "AE01", RDP_SCANCODE_KEY_1 }, // evdev 10 + { "AE02", RDP_SCANCODE_KEY_2 }, // evdev 11 + { "AE03", RDP_SCANCODE_KEY_3 }, // evdev 12 + { "AE04", RDP_SCANCODE_KEY_4 }, // evdev 13 + { "AE05", RDP_SCANCODE_KEY_5 }, // evdev 14 + { "AE06", RDP_SCANCODE_KEY_6 }, // evdev 15 + { "AE07", RDP_SCANCODE_KEY_7 }, // evdev 16 + { "AE08", RDP_SCANCODE_KEY_8 }, // evdev 17 + { "AE09", RDP_SCANCODE_KEY_9 }, // evdev 18 + { "AE10", RDP_SCANCODE_KEY_0 }, // evdev 19 + { "AE11", RDP_SCANCODE_OEM_MINUS }, // evdev 20 + { "AE12", RDP_SCANCODE_OEM_PLUS }, // evdev 21 { "AE13", RDP_SCANCODE_BACKSLASH_JP }, // JP 132 Yen next to backspace // { "AGAI", RDP_SCANCODE_ }, // evdev 137 - { "ALGR", RDP_SCANCODE_RMENU }, // alias of evdev 108 RALT - { "ALT", RDP_SCANCODE_LMENU }, // evdev 204, fake keycode for virtual key - { "BKSL", RDP_SCANCODE_OEM_5 }, // evdev 51 - { "BKSP", RDP_SCANCODE_BACKSPACE }, // evdev 22 + { "ALGR", RDP_SCANCODE_RMENU }, // alias of evdev 108 RALT + { "ALT", RDP_SCANCODE_LMENU }, // evdev 204, fake keycode for virtual key + { "BKSL", RDP_SCANCODE_OEM_5 }, // evdev 51 + { "BKSP", RDP_SCANCODE_BACKSPACE }, // evdev 22 // { "BRK", RDP_SCANCODE_ }, // evdev 419 - { "CAPS", RDP_SCANCODE_CAPSLOCK }, // evdev 66 - { "COMP", RDP_SCANCODE_APPS }, // evdev 135 + { "CAPS", RDP_SCANCODE_CAPSLOCK }, // evdev 66 + { "COMP", RDP_SCANCODE_APPS }, // evdev 135 // { "COPY", RDP_SCANCODE_ }, // evdev 141 // { "CUT", RDP_SCANCODE_ }, // evdev 145 - { "DELE", RDP_SCANCODE_DELETE }, // evdev 119 - { "DOWN", RDP_SCANCODE_DOWN }, // evdev 116 - { "END", RDP_SCANCODE_END }, // evdev 115 - { "ESC", RDP_SCANCODE_ESCAPE }, // evdev 9 + { "DELE", RDP_SCANCODE_DELETE }, // evdev 119 + { "DOWN", RDP_SCANCODE_DOWN }, // evdev 116 + { "END", RDP_SCANCODE_END }, // evdev 115 + { "ESC", RDP_SCANCODE_ESCAPE }, // evdev 9 // { "FIND", RDP_SCANCODE_ }, // evdev 144 - { "FK01", RDP_SCANCODE_F1 }, // evdev 67 - { "FK02", RDP_SCANCODE_F2 }, // evdev 68 - { "FK03", RDP_SCANCODE_F3 }, // evdev 69 - { "FK04", RDP_SCANCODE_F4 }, // evdev 70 - { "FK05", RDP_SCANCODE_F5 }, // evdev 71 - { "FK06", RDP_SCANCODE_F6 }, // evdev 72 - { "FK07", RDP_SCANCODE_F7 }, // evdev 73 - { "FK08", RDP_SCANCODE_F8 }, // evdev 74 - { "FK09", RDP_SCANCODE_F9 }, // evdev 75 - { "FK10", RDP_SCANCODE_F10 }, // evdev 76 - { "FK11", RDP_SCANCODE_F11 }, // evdev 95 - { "FK12", RDP_SCANCODE_F12 }, // evdev 96 - { "FK13", RDP_SCANCODE_F13 }, // evdev 191 - { "FK14", RDP_SCANCODE_F14 }, // evdev 192 - { "FK15", RDP_SCANCODE_F15 }, // evdev 193 - { "FK16", RDP_SCANCODE_F16 }, // evdev 194 - { "FK17", RDP_SCANCODE_F17 }, // evdev 195 - { "FK18", RDP_SCANCODE_F18 }, // evdev 196 - { "FK19", RDP_SCANCODE_F19 }, // evdev 197 - { "FK20", RDP_SCANCODE_F20 }, // evdev 198 - { "FK21", RDP_SCANCODE_F21 }, // evdev 199 - { "FK22", RDP_SCANCODE_F22 }, // evdev 200 - { "FK23", RDP_SCANCODE_F23 }, // evdev 201 - { "FK24", RDP_SCANCODE_F24 }, // evdev 202 + { "FK01", RDP_SCANCODE_F1 }, // evdev 67 + { "FK02", RDP_SCANCODE_F2 }, // evdev 68 + { "FK03", RDP_SCANCODE_F3 }, // evdev 69 + { "FK04", RDP_SCANCODE_F4 }, // evdev 70 + { "FK05", RDP_SCANCODE_F5 }, // evdev 71 + { "FK06", RDP_SCANCODE_F6 }, // evdev 72 + { "FK07", RDP_SCANCODE_F7 }, // evdev 73 + { "FK08", RDP_SCANCODE_F8 }, // evdev 74 + { "FK09", RDP_SCANCODE_F9 }, // evdev 75 + { "FK10", RDP_SCANCODE_F10 }, // evdev 76 + { "FK11", RDP_SCANCODE_F11 }, // evdev 95 + { "FK12", RDP_SCANCODE_F12 }, // evdev 96 + { "FK13", RDP_SCANCODE_F13 }, // evdev 191 + { "FK14", RDP_SCANCODE_F14 }, // evdev 192 + { "FK15", RDP_SCANCODE_F15 }, // evdev 193 + { "FK16", RDP_SCANCODE_F16 }, // evdev 194 + { "FK17", RDP_SCANCODE_F17 }, // evdev 195 + { "FK18", RDP_SCANCODE_F18 }, // evdev 196 + { "FK19", RDP_SCANCODE_F19 }, // evdev 197 + { "FK20", RDP_SCANCODE_F20 }, // evdev 198 + { "FK21", RDP_SCANCODE_F21 }, // evdev 199 + { "FK22", RDP_SCANCODE_F22 }, // evdev 200 + { "FK23", RDP_SCANCODE_F23 }, // evdev 201 + { "FK24", RDP_SCANCODE_F24 }, // evdev 202 // { "FRNT", RDP_SCANCODE_ }, // evdev 140 { "HANJ", RDP_SCANCODE_HANJA }, - { "HELP", RDP_SCANCODE_HELP }, // evdev 146 + { "HELP", RDP_SCANCODE_HELP }, // evdev 146 { "HENK", RDP_SCANCODE_CONVERT_JP }, // JP evdev 100 Henkan - { "HIRA", RDP_SCANCODE_HIRAGANA }, // JP evdev 99 Hiragana - { "HJCV", RDP_SCANCODE_HANJA }, // KR evdev 131 Hangul->Hanja - { "HKTG", RDP_SCANCODE_HIRAGANA }, // JP evdev 101 Hiragana/Katakana toggle - { "HNGL", RDP_SCANCODE_HANGUL }, // KR evdev 130 Hangul/Latin toggle - { "HOME", RDP_SCANCODE_HOME }, // evdev 110 - { "HYPR", RDP_SCANCODE_LWIN }, // evdev 207, fake keycode for virtual key - { "HZTG", RDP_SCANCODE_OEM_3 }, // JP alias of evdev 49 + { "HIRA", RDP_SCANCODE_HIRAGANA }, // JP evdev 99 Hiragana + { "HJCV", RDP_SCANCODE_HANJA }, // KR evdev 131 Hangul->Hanja + { "HKTG", RDP_SCANCODE_HIRAGANA }, // JP evdev 101 Hiragana/Katakana toggle + { "HNGL", RDP_SCANCODE_HANGUL }, // KR evdev 130 Hangul/Latin toggle + { "HOME", RDP_SCANCODE_HOME }, // evdev 110 + { "HYPR", RDP_SCANCODE_LWIN }, // evdev 207, fake keycode for virtual key + { "HZTG", RDP_SCANCODE_OEM_3 }, // JP alias of evdev 49 // { "I120", RDP_SCANCODE_ }, // evdev 120 KEY_MACRO // { "I126", RDP_SCANCODE_ }, // evdev 126 KEY_KPPLUSMINUS // { "I128", RDP_SCANCODE_ }, // evdev 128 KEY_SCALE - { "I129", RDP_SCANCODE_ABNT_C2 }, // evdev 129 KEY_KPCOMMA Brazil + { "I129", RDP_SCANCODE_ABNT_C2 }, // evdev 129 KEY_KPCOMMA Brazil // { "I147", RDP_SCANCODE_ }, // evdev 147 KEY_MENU // { "I148", RDP_SCANCODE_ }, // evdev 148 KEY_CALC // { "I149", RDP_SCANCODE_ }, // evdev 149 KEY_SETUP - { "I150", RDP_SCANCODE_SLEEP }, // evdev 150 KEY_SLEEP + { "I150", RDP_SCANCODE_SLEEP }, // evdev 150 KEY_SLEEP // { "I151", RDP_SCANCODE_ }, // evdev 151 KEY_WAKEUP // { "I152", RDP_SCANCODE_ }, // evdev 152 KEY_FILE // { "I153", RDP_SCANCODE_ }, // evdev 153 KEY_SENDFILE @@ -170,25 +169,25 @@ XKB_KEY_NAME_SCANCODE XKB_KEY_NAME_SCANCODE_TABLE[] = // { "I160", RDP_SCANCODE_ }, // evdev 160 KEY_COFFEE // { "I161", RDP_SCANCODE_ }, // evdev 161 KEY_DIRECTION // { "I162", RDP_SCANCODE_ }, // evdev 162 KEY_CYCLEWINDOWS - { "I163", RDP_SCANCODE_LAUNCH_MAIL }, // evdev 163 KEY_MAIL - { "I164", RDP_SCANCODE_BROWSER_FAVORITES }, // evdev 164 KEY_BOOKMARKS + { "I163", RDP_SCANCODE_LAUNCH_MAIL }, // evdev 163 KEY_MAIL + { "I164", RDP_SCANCODE_BROWSER_FAVORITES }, // evdev 164 KEY_BOOKMARKS // { "I165", RDP_SCANCODE_ }, // evdev 165 KEY_COMPUTER - { "I166", RDP_SCANCODE_BROWSER_BACK }, // evdev 166 KEY_BACK - { "I167", RDP_SCANCODE_BROWSER_FORWARD }, // evdev 167 KEY_FORWARD + { "I166", RDP_SCANCODE_BROWSER_BACK }, // evdev 166 KEY_BACK + { "I167", RDP_SCANCODE_BROWSER_FORWARD }, // evdev 167 KEY_FORWARD // { "I168", RDP_SCANCODE_ }, // evdev 168 KEY_CLOSECD // { "I169", RDP_SCANCODE_ }, // evdev 169 KEY_EJECTCD // { "I170", RDP_SCANCODE_ }, // evdev 170 KEY_EJECTCLOSECD - { "I171", RDP_SCANCODE_MEDIA_NEXT_TRACK }, // evdev 171 KEY_NEXTSONG - { "I172", RDP_SCANCODE_MEDIA_PLAY_PAUSE }, // evdev 172 KEY_PLAYPAUSE - { "I173", RDP_SCANCODE_MEDIA_PREV_TRACK }, // evdev 173 KEY_PREVIOUSSONG - { "I174", RDP_SCANCODE_MEDIA_STOP }, // evdev 174 KEY_STOPCD + { "I171", RDP_SCANCODE_MEDIA_NEXT_TRACK }, // evdev 171 KEY_NEXTSONG + { "I172", RDP_SCANCODE_MEDIA_PLAY_PAUSE }, // evdev 172 KEY_PLAYPAUSE + { "I173", RDP_SCANCODE_MEDIA_PREV_TRACK }, // evdev 173 KEY_PREVIOUSSONG + { "I174", RDP_SCANCODE_MEDIA_STOP }, // evdev 174 KEY_STOPCD // { "I175", RDP_SCANCODE_ }, // evdev 175 KEY_RECORD 167 // { "I176", RDP_SCANCODE_ }, // evdev 176 KEY_REWIND // { "I177", RDP_SCANCODE_ }, // evdev 177 KEY_PHONE // { "I178", RDP_SCANCODE_ }, // evdev 178 KEY_ISO // { "I179", RDP_SCANCODE_ }, // evdev 179 KEY_CONFIG - { "I180", RDP_SCANCODE_BROWSER_HOME }, // evdev 180 KEY_HOMEPAGE - { "I181", RDP_SCANCODE_BROWSER_REFRESH }, // evdev 181 KEY_REFRESH + { "I180", RDP_SCANCODE_BROWSER_HOME }, // evdev 180 KEY_HOMEPAGE + { "I181", RDP_SCANCODE_BROWSER_REFRESH }, // evdev 181 KEY_REFRESH // { "I182", RDP_SCANCODE_ }, // evdev 182 KEY_EXIT // { "I183", RDP_SCANCODE_ }, // evdev 183 KEY_MOVE // { "I184", RDP_SCANCODE_ }, // evdev 184 KEY_EDIT @@ -215,7 +214,7 @@ XKB_KEY_NAME_SCANCODE XKB_KEY_NAME_SCANCODE_TABLE[] = // { "I222", RDP_SCANCODE_ }, // evdev 222 KEY_QUESTION // { "I223", RDP_SCANCODE_ }, // evdev 223 KEY_EMAIL // { "I224", RDP_SCANCODE_ }, // evdev 224 KEY_CHAT - { "I225", RDP_SCANCODE_BROWSER_SEARCH }, // evdev 225 KEY_SEARCH + { "I225", RDP_SCANCODE_BROWSER_SEARCH }, // evdev 225 KEY_SEARCH // { "I226", RDP_SCANCODE_ }, // evdev 226 KEY_CONNECT // { "I227", RDP_SCANCODE_ }, // evdev 227 KEY_FINANCE // { "I228", RDP_SCANCODE_ }, // evdev 228 KEY_SPORT @@ -244,71 +243,71 @@ XKB_KEY_NAME_SCANCODE XKB_KEY_NAME_SCANCODE_TABLE[] = // { "I251", RDP_SCANCODE_ }, // evdev 251 KEY_BRIGHTNESS_CYCLE // { "I252", RDP_SCANCODE_ }, // evdev 252 KEY_BRIGHTNESS_ZERO // { "I253", RDP_SCANCODE_ }, // evdev 253 KEY_DISPLAY_OFF - { "INS", RDP_SCANCODE_INSERT }, // evdev 118 + { "INS", RDP_SCANCODE_INSERT }, // evdev 118 // { "JPCM", RDP_SCANCODE_ }, // evdev 103 KPJPComma // { "KATA", RDP_SCANCODE_ }, // evdev 98 Katakana VK_DBE_KATAKANA - { "KP0", RDP_SCANCODE_NUMPAD0 }, // evdev 90 - { "KP1", RDP_SCANCODE_NUMPAD1 }, // evdev 87 - { "KP2", RDP_SCANCODE_NUMPAD2 }, // evdev 88 - { "KP3", RDP_SCANCODE_NUMPAD3 }, // evdev 89 - { "KP4", RDP_SCANCODE_NUMPAD4 }, // evdev 83 - { "KP5", RDP_SCANCODE_NUMPAD5 }, // evdev 84 - { "KP6", RDP_SCANCODE_NUMPAD6 }, // evdev 85 - { "KP7", RDP_SCANCODE_NUMPAD7 }, // evdev 79 - { "KP8", RDP_SCANCODE_NUMPAD8 }, // evdev 80 - { "KP9", RDP_SCANCODE_NUMPAD9 }, // evdev 81 - { "KPAD", RDP_SCANCODE_ADD }, // evdev 86 - { "KPDL", RDP_SCANCODE_DECIMAL }, // evdev 91 - { "KPDV", RDP_SCANCODE_DIVIDE }, // evdev 106 - { "KPEN", RDP_SCANCODE_RETURN_KP }, // evdev 104 KP! + { "KP0", RDP_SCANCODE_NUMPAD0 }, // evdev 90 + { "KP1", RDP_SCANCODE_NUMPAD1 }, // evdev 87 + { "KP2", RDP_SCANCODE_NUMPAD2 }, // evdev 88 + { "KP3", RDP_SCANCODE_NUMPAD3 }, // evdev 89 + { "KP4", RDP_SCANCODE_NUMPAD4 }, // evdev 83 + { "KP5", RDP_SCANCODE_NUMPAD5 }, // evdev 84 + { "KP6", RDP_SCANCODE_NUMPAD6 }, // evdev 85 + { "KP7", RDP_SCANCODE_NUMPAD7 }, // evdev 79 + { "KP8", RDP_SCANCODE_NUMPAD8 }, // evdev 80 + { "KP9", RDP_SCANCODE_NUMPAD9 }, // evdev 81 + { "KPAD", RDP_SCANCODE_ADD }, // evdev 86 + { "KPDL", RDP_SCANCODE_DECIMAL }, // evdev 91 + { "KPDV", RDP_SCANCODE_DIVIDE }, // evdev 106 + { "KPEN", RDP_SCANCODE_RETURN_KP }, // evdev 104 KP! // { "KPEQ", RDP_SCANCODE_ }, // evdev 125 - { "KPMU", RDP_SCANCODE_MULTIPLY }, // evdev 63 - { "KPPT", RDP_SCANCODE_ABNT_C2 }, // BR alias of evdev 129 - { "KPSU", RDP_SCANCODE_SUBTRACT }, // evdev 82 - { "LALT", RDP_SCANCODE_LMENU }, // evdev 64 - { "LCTL", RDP_SCANCODE_LCONTROL }, // evdev 37 - { "LEFT", RDP_SCANCODE_LEFT }, // evdev 113 - { "LFSH", RDP_SCANCODE_LSHIFT }, // evdev 50 - { "LMTA", RDP_SCANCODE_LWIN }, // alias of evdev 133 LWIN + { "KPMU", RDP_SCANCODE_MULTIPLY }, // evdev 63 + { "KPPT", RDP_SCANCODE_ABNT_C2 }, // BR alias of evdev 129 + { "KPSU", RDP_SCANCODE_SUBTRACT }, // evdev 82 + { "LALT", RDP_SCANCODE_LMENU }, // evdev 64 + { "LCTL", RDP_SCANCODE_LCONTROL }, // evdev 37 + { "LEFT", RDP_SCANCODE_LEFT }, // evdev 113 + { "LFSH", RDP_SCANCODE_LSHIFT }, // evdev 50 + { "LMTA", RDP_SCANCODE_LWIN }, // alias of evdev 133 LWIN // { "LNFD", RDP_SCANCODE_ }, // evdev 109 KEY_LINEFEED - { "LSGT", RDP_SCANCODE_OEM_102 }, // evdev 94 - { "LVL3", RDP_SCANCODE_RMENU }, // evdev 92, fake keycode for virtual key - { "LWIN", RDP_SCANCODE_LWIN }, // evdev 133 - { "MDSW", RDP_SCANCODE_RMENU }, // evdev 203, fake keycode for virtual key - { "MENU", RDP_SCANCODE_APPS }, // alias of evdev 135 COMP - { "META", RDP_SCANCODE_LMENU }, // evdev 205, fake keycode for virtual key - { "MUHE", RDP_SCANCODE_NONCONVERT_JP }, // JP evdev 102 Muhenkan - { "MUTE", RDP_SCANCODE_VOLUME_MUTE }, // evdev 121 + { "LSGT", RDP_SCANCODE_OEM_102 }, // evdev 94 + { "LVL3", RDP_SCANCODE_RMENU }, // evdev 92, fake keycode for virtual key + { "LWIN", RDP_SCANCODE_LWIN }, // evdev 133 + { "MDSW", RDP_SCANCODE_RMENU }, // evdev 203, fake keycode for virtual key + { "MENU", RDP_SCANCODE_APPS }, // alias of evdev 135 COMP + { "META", RDP_SCANCODE_LMENU }, // evdev 205, fake keycode for virtual key + { "MUHE", RDP_SCANCODE_NONCONVERT_JP }, // JP evdev 102 Muhenkan + { "MUTE", RDP_SCANCODE_VOLUME_MUTE }, // evdev 121 { "NFER", RDP_SCANCODE_NONCONVERT_JP }, // JP alias of evdev 102 Muhenkan - { "NMLK", RDP_SCANCODE_NUMLOCK }, // evdev 77 + { "NMLK", RDP_SCANCODE_NUMLOCK }, // evdev 77 // { "OPEN", RDP_SCANCODE_ }, // evdev 142 // { "PAST", RDP_SCANCODE_ }, // evdev 143 - { "PAUS", RDP_SCANCODE_PAUSE }, // evdev 127 - { "PGDN", RDP_SCANCODE_NEXT }, // evdev 117 - { "PGUP", RDP_SCANCODE_PRIOR }, // evdev 112 + { "PAUS", RDP_SCANCODE_PAUSE }, // evdev 127 + { "PGDN", RDP_SCANCODE_NEXT }, // evdev 117 + { "PGUP", RDP_SCANCODE_PRIOR }, // evdev 112 // { "POWR", RDP_SCANCODE_ }, // evdev 124 // { "PROP", RDP_SCANCODE_ }, // evdev 138 - { "PRSC", RDP_SCANCODE_PRINTSCREEN }, // evdev 107 - { "RALT", RDP_SCANCODE_RMENU }, // evdev 108 RALT - { "RCTL", RDP_SCANCODE_RCONTROL }, // evdev 105 - { "RGHT", RDP_SCANCODE_RIGHT }, // evdev 114 - { "RMTA", RDP_SCANCODE_RWIN }, // alias of evdev 134 RWIN + { "PRSC", RDP_SCANCODE_PRINTSCREEN }, // evdev 107 + { "RALT", RDP_SCANCODE_RMENU }, // evdev 108 RALT + { "RCTL", RDP_SCANCODE_RCONTROL }, // evdev 105 + { "RGHT", RDP_SCANCODE_RIGHT }, // evdev 114 + { "RMTA", RDP_SCANCODE_RWIN }, // alias of evdev 134 RWIN // { "RO", RDP_SCANCODE_ }, // JP evdev 97 Romaji - { "RTRN", RDP_SCANCODE_RETURN }, // not KP, evdev 36 - { "RTSH", RDP_SCANCODE_RSHIFT }, // evdev 62 - { "RWIN", RDP_SCANCODE_RWIN }, // evdev 134 - { "SCLK", RDP_SCANCODE_SCROLLLOCK }, // evdev 78 - { "SPCE", RDP_SCANCODE_SPACE }, // evdev 65 - { "STOP", RDP_SCANCODE_BROWSER_STOP }, // evdev 136 - { "SUPR", RDP_SCANCODE_LWIN }, // evdev 206, fake keycode for virtual key - { "SYRQ", RDP_SCANCODE_SYSREQ }, // evdev 107 - { "TAB", RDP_SCANCODE_TAB }, // evdev 23 - { "TLDE", RDP_SCANCODE_OEM_3 }, // evdev 49 + { "RTRN", RDP_SCANCODE_RETURN }, // not KP, evdev 36 + { "RTSH", RDP_SCANCODE_RSHIFT }, // evdev 62 + { "RWIN", RDP_SCANCODE_RWIN }, // evdev 134 + { "SCLK", RDP_SCANCODE_SCROLLLOCK }, // evdev 78 + { "SPCE", RDP_SCANCODE_SPACE }, // evdev 65 + { "STOP", RDP_SCANCODE_BROWSER_STOP }, // evdev 136 + { "SUPR", RDP_SCANCODE_LWIN }, // evdev 206, fake keycode for virtual key + { "SYRQ", RDP_SCANCODE_SYSREQ }, // evdev 107 + { "TAB", RDP_SCANCODE_TAB }, // evdev 23 + { "TLDE", RDP_SCANCODE_OEM_3 }, // evdev 49 // { "UNDO", RDP_SCANCODE_ }, // evdev 139 - { "UP", RDP_SCANCODE_UP }, // evdev 111 - { "VOL-", RDP_SCANCODE_VOLUME_DOWN }, // evdev 122 - { "VOL+", RDP_SCANCODE_VOLUME_UP }, // evdev 123 - { "XFER", RDP_SCANCODE_CONVERT_JP }, // JP alias of evdev 100 Henkan + { "UP", RDP_SCANCODE_UP }, // evdev 111 + { "VOL-", RDP_SCANCODE_VOLUME_DOWN }, // evdev 122 + { "VOL+", RDP_SCANCODE_VOLUME_UP }, // evdev 123 + { "XFER", RDP_SCANCODE_CONVERT_JP }, // JP alias of evdev 100 Henkan }; void* freerdp_keyboard_xkb_init() @@ -325,7 +324,7 @@ void* freerdp_keyboard_xkb_init() if (!status) return NULL; - return (void*) display; + return (void*)display; } int freerdp_keyboard_init_xkbfile(DWORD* keyboardLayoutId, DWORD x11_keycode_to_rdp_scancode[256]) @@ -345,7 +344,8 @@ int freerdp_keyboard_init_xkbfile(DWORD* keyboardLayoutId, DWORD x11_keycode_to_ if (*keyboardLayoutId == 0) { detect_keyboard_layout_from_xkbfile(display, keyboardLayoutId); - DEBUG_KBD("detect_keyboard_layout_from_xkb: %"PRIu32" (0x%08X"PRIX32")", *keyboardLayoutId, *keyboardLayoutId); + DEBUG_KBD("detect_keyboard_layout_from_xkb: %" PRIu32 " (0x%08X" PRIX32 ")", + *keyboardLayoutId, *keyboardLayoutId); } freerdp_keyboard_load_map_from_xkbfile(display, x11_keycode_to_rdp_scancode); @@ -442,15 +442,16 @@ int freerdp_keyboard_load_map_from_xkbfile(void* display, DWORD x11_keycode_to_r { if (!strcmp(xkb_keyname, XKB_KEY_NAME_SCANCODE_TABLE[j].xkb_keyname)) { - DEBUG_KBD("%4s: keycode: 0x%02X -> rdp scancode: 0x%08"PRIX32"", - xkb_keyname, i, XKB_KEY_NAME_SCANCODE_TABLE[j].rdp_scancode); + DEBUG_KBD("%4s: keycode: 0x%02X -> rdp scancode: 0x%08" PRIX32 "", + xkb_keyname, i, XKB_KEY_NAME_SCANCODE_TABLE[j].rdp_scancode); if (found) { DEBUG_KBD("Internal error! duplicate key %s!", xkb_keyname); } - x11_keycode_to_rdp_scancode[i] = XKB_KEY_NAME_SCANCODE_TABLE[j].rdp_scancode; + x11_keycode_to_rdp_scancode[i] = + XKB_KEY_NAME_SCANCODE_TABLE[j].rdp_scancode; found = TRUE; } } diff --git a/libfreerdp/locale/keyboard_xkbfile.h b/libfreerdp/locale/keyboard_xkbfile.h index 72fd6089e..e59bd8016 100644 --- a/libfreerdp/locale/keyboard_xkbfile.h +++ b/libfreerdp/locale/keyboard_xkbfile.h @@ -25,11 +25,10 @@ #include FREERDP_LOCAL int freerdp_keyboard_init_xkbfile(DWORD* keyboardLayoutId, - DWORD x11_keycode_to_rdp_scancode[256]); + DWORD x11_keycode_to_rdp_scancode[256]); -FREERDP_LOCAL int detect_keyboard_layout_from_xkbfile(void* display, - DWORD* keyboardLayoutId); +FREERDP_LOCAL int detect_keyboard_layout_from_xkbfile(void* display, DWORD* keyboardLayoutId); FREERDP_LOCAL int freerdp_keyboard_load_map_from_xkbfile(void* display, - DWORD x11_keycode_to_rdp_scancode[256]); + DWORD x11_keycode_to_rdp_scancode[256]); #endif /* FREERDP_LIB_LOCALE_KEYBOARD_XKB_H */ diff --git a/libfreerdp/locale/liblocale.h b/libfreerdp/locale/liblocale.h index b9310fa96..4faee9148 100644 --- a/libfreerdp/locale/liblocale.h +++ b/libfreerdp/locale/liblocale.h @@ -30,14 +30,20 @@ #ifdef WITH_DEBUG_KBD #define DEBUG_KBD(...) WLog_DBG(KBD_TAG, __VA_ARGS__) #else -#define DEBUG_KBD(...) do { } while (0) +#define DEBUG_KBD(...) \ + do \ + { \ + } while (0) #endif #define TIMEZONE_TAG FREERDP_TAG("timezone") #ifdef WITH_DEBUG_TIMEZONE #define DEBUG_TIMEZONE(...) WLog_DBG(TIMEZONE_TAG, __VA_ARGS__) #else -#define DEBUG_TIMEZONE(...) do { } while (0) +#define DEBUG_TIMEZONE(...) \ + do \ + { \ + } while (0) #endif #endif /* FREERDP_LIB_LOCALE_LIB_H */ diff --git a/libfreerdp/locale/locale.c b/libfreerdp/locale/locale.c index 0ae7e5563..97ae9e469 100644 --- a/libfreerdp/locale/locale.c +++ b/libfreerdp/locale/locale.c @@ -36,7 +36,7 @@ struct _SYSTEM_LOCALE { char language[4]; /* Two or three letter language code */ char country[10]; /* Two or three letter country code (Sometimes with Cyrl_ prefix) */ - DWORD code; /* 32-bit unsigned integer corresponding to the locale */ + DWORD code; /* 32-bit unsigned integer corresponding to the locale */ }; typedef struct _SYSTEM_LOCALE SYSTEM_LOCALE; @@ -45,207 +45,221 @@ typedef struct _SYSTEM_LOCALE SYSTEM_LOCALE; * http://msdn.microsoft.com/en-us/library/ms776260.aspx */ -static const SYSTEM_LOCALE SYSTEM_LOCALE_TABLE[] = -{ - { "af", "ZA", AFRIKAANS }, /* Afrikaans (South Africa) */ - { "sq", "AL", ALBANIAN }, /* Albanian (Albania) */ - { "gsw", "FR", ALSATIAN }, /* Windows Vista and later: Alsatian (France) */ - { "am", "ET", AMHARIC }, /* Windows Vista and later: Amharic (Ethiopia) */ - { "ar", "DZ", ARABIC_ALGERIA }, /* Arabic (Algeria) */ - { "ar", "BH", ARABIC_BAHRAIN }, /* Arabic (Bahrain) */ - { "ar", "EG", ARABIC_EGYPT }, /* Arabic (Egypt) */ - { "ar", "IQ", ARABIC_IRAQ }, /* Arabic (Iraq) */ - { "ar", "JO", ARABIC_JORDAN }, /* Arabic (Jordan) */ - { "ar", "KW", ARABIC_KUWAIT }, /* Arabic (Kuwait) */ - { "ar", "LB", ARABIC_LEBANON }, /* Arabic (Lebanon) */ - { "ar", "LY", ARABIC_LIBYA }, /* Arabic (Libya) */ - { "ar", "MA", ARABIC_MOROCCO }, /* Arabic (Morocco) */ - { "ar", "OM", ARABIC_OMAN }, /* Arabic (Oman) */ - { "ar", "QA", ARABIC_QATAR }, /* Arabic (Qatar) */ - { "ar", "SA", ARABIC_SAUDI_ARABIA }, /* Arabic (Saudi Arabia) */ - { "ar", "SY", ARABIC_SYRIA }, /* Arabic (Syria) */ - { "ar", "TN", ARABIC_TUNISIA }, /* Arabic (Tunisia) */ - { "ar", "AE", ARABIC_UAE }, /* Arabic (U.A.E.) */ - { "ar", "YE", ARABIC_YEMEN }, /* Arabic (Yemen) */ - { "az", "AZ", AZERI_LATIN }, /* Azeri (Latin) */ - { "az", "Cyrl_AZ", AZERI_CYRILLIC }, /* Azeri (Cyrillic) */ - { "hy", "AM", ARMENIAN }, /* Windows 2000 and later: Armenian (Armenia) */ - { "as", "IN", ASSAMESE }, /* Windows Vista and later: Assamese (India) */ - { "ba", "RU", BASHKIR }, /* Windows Vista and later: Bashkir (Russia) */ - { "eu", "ES", BASQUE }, /* Basque (Basque) */ - { "be", "BY", BELARUSIAN }, /* Belarusian (Belarus) */ - { "bn", "IN", BENGALI_INDIA }, /* Windows XP SP2 and later: Bengali (India) */ - { "br", "FR", BRETON }, /* Breton (France) */ - { "bs", "BA", BOSNIAN_LATIN }, /* Bosnian (Latin) */ - { "bg", "BG", BULGARIAN }, /* Bulgarian (Bulgaria) */ - { "ca", "ES", CATALAN }, /* Catalan (Catalan) */ - { "zh", "HK", CHINESE_HONG_KONG }, /* Chinese (Hong Kong SAR, PRC) */ - { "zh", "MO", CHINESE_MACAU }, /* Windows 98/Me, Windows XP and later: Chinese (Macao SAR) */ - { "zh", "CN", CHINESE_PRC }, /* Chinese (PRC) */ - { "zh", "SG", CHINESE_SINGAPORE }, /* Chinese (Singapore) */ - { "zh", "TW", CHINESE_TAIWAN }, /* Chinese (Taiwan) */ - { "hr", "BA", CROATIAN_BOSNIA_HERZEGOVINA }, /* Windows XP SP2 and later: Croatian (Bosnia and Herzegovina, Latin) */ - { "hr", "HR", CROATIAN }, /* Croatian (Croatia) */ - { "cs", "CZ", CZECH }, /* Czech (Czech Republic) */ - { "da", "DK", DANISH }, /* Danish (Denmark) */ - { "prs", "AF", DARI }, /* Windows XP and later: Dari (Afghanistan) */ - { "dv", "MV", DIVEHI }, /* Windows XP and later: Divehi (Maldives) */ - { "nl", "BE", DUTCH_BELGIAN }, /* Dutch (Belgium) */ - { "nl", "NL", DUTCH_STANDARD }, /* Dutch (Netherlands) */ - { "en", "AU", ENGLISH_AUSTRALIAN }, /* English (Australia) */ - { "en", "BZ", ENGLISH_BELIZE }, /* English (Belize) */ - { "en", "CA", ENGLISH_CANADIAN }, /* English (Canada) */ - { "en", "CB", ENGLISH_CARIBBEAN }, /* English (Carribean) */ - { "en", "IN", ENGLISH_INDIA }, /* Windows Vista and later: English (India) */ - { "en", "IE", ENGLISH_IRELAND }, /* English (Ireland) */ - { "en", "JM", ENGLISH_JAMAICA }, /* English (Jamaica) */ - { "en", "MY", ENGLISH_MALAYSIA }, /* Windows Vista and later: English (Malaysia) */ - { "en", "NZ", ENGLISH_NEW_ZEALAND }, /* English (New Zealand) */ - { "en", "PH", ENGLISH_PHILIPPINES }, /* Windows 98/Me, Windows 2000 and later: English (Philippines) */ - { "en", "SG", ENGLISH_SINGAPORE }, /* Windows Vista and later: English (Singapore) */ - { "en", "ZA", ENGLISH_SOUTH_AFRICA }, /* English (South Africa) */ - { "en", "TT", ENGLISH_TRINIDAD }, /* English (Trinidad and Tobago) */ - { "en", "GB", ENGLISH_UNITED_KINGDOM }, /* English (United Kingdom) */ - { "en", "US", ENGLISH_UNITED_STATES }, /* English (United States) */ - { "en", "ZW", ENGLISH_ZIMBABWE }, /* Windows 98/Me, Windows 2000 and later: English (Zimbabwe) */ - { "et", "EE", ESTONIAN }, /* Estonian (Estonia) */ - { "fo", "FO", FAEROESE }, /* Faroese (Faroe Islands) */ - { "fil", "PH", FILIPINO }, /* Windows XP SP2 and later (downloadable); Windows Vista and later: Filipino (Philippines) */ - { "fi", "FI", FINNISH }, /* Finnish (Finland) */ - { "fr", "BE", FRENCH_BELGIAN }, /* French (Belgium) */ - { "fr", "CA", FRENCH_CANADIAN }, /* French (Canada) */ - { "fr", "FR", FRENCH_STANDARD }, /* French (France) */ - { "fr", "LU", FRENCH_LUXEMBOURG }, /* French (Luxembourg) */ - { "fr", "MC", FRENCH_MONACO }, /* French (Monaco) */ - { "fr", "CH", FRENCH_SWISS }, /* French (Switzerland) */ - { "fy", "NL", FRISIAN }, /* Windows XP SP2 and later (downloadable); Windows Vista and later: Frisian (Netherlands) */ - { "gl", "ES", GALICIAN }, /* Windows XP and later: Galician (Spain) */ - { "ka", "GE", GEORGIAN }, /* Windows 2000 and later: Georgian (Georgia) */ - { "de", "AT", GERMAN_AUSTRIAN }, /* German (Austria) */ - { "de", "DE", GERMAN_STANDARD }, /* German (Germany) */ - { "de", "LI", GERMAN_LIECHTENSTEIN }, /* German (Liechtenstein) */ - { "de", "LU", GERMAN_LUXEMBOURG }, /* German (Luxembourg) */ - { "de", "CH", GERMAN_SWISS }, /* German (Switzerland) */ - { "el", "GR", GREEK }, /* Greek (Greece) */ - { "kl", "GL", GREENLANDIC }, /* Windows Vista and later: Greenlandic (Greenland) */ - { "gu", "IN", GUJARATI }, /* Windows XP and later: Gujarati (India) */ - { "he", "IL", HEBREW }, /* Hebrew (Israel) */ - { "hi", "IN", HINDI }, /* Windows 2000 and later: Hindi (India) */ - { "hu", "HU", HUNGARIAN }, /* Hungarian (Hungary) */ - { "is", "IS", ICELANDIC }, /* Icelandic (Iceland) */ - { "ig", "NG", IGBO }, /* Igbo (Nigeria) */ - { "id", "ID", INDONESIAN }, /* Indonesian (Indonesia) */ - { "ga", "IE", IRISH }, /* Windows XP SP2 and later (downloadable); Windows Vista and later: Irish (Ireland) */ - { "it", "IT", ITALIAN_STANDARD }, /* Italian (Italy) */ - { "it", "CH", ITALIAN_SWISS }, /* Italian (Switzerland) */ - { "ja", "JP", JAPANESE }, /* Japanese (Japan) */ - { "kn", "IN", KANNADA }, /* Windows XP and later: Kannada (India) */ - { "kk", "KZ", KAZAKH }, /* Windows 2000 and later: Kazakh (Kazakhstan) */ - { "kh", "KH", KHMER }, /* Windows Vista and later: Khmer (Cambodia) */ - { "qut", "GT", KICHE }, /* Windows Vista and later: K'iche (Guatemala) */ - { "rw", "RW", KINYARWANDA }, /* Windows Vista and later: Kinyarwanda (Rwanda) */ - { "kok", "IN", KONKANI }, /* Windows 2000 and later: Konkani (India) */ - { "ko", "KR", KOREAN }, /* Korean (Korea) */ - { "ky", "KG", KYRGYZ }, /* Windows XP and later: Kyrgyz (Kyrgyzstan) */ - { "lo", "LA", LAO }, /* Windows Vista and later: Lao (Lao PDR) */ - { "lv", "LV", LATVIAN }, /* Latvian (Latvia) */ - { "lt", "LT", LITHUANIAN }, /* Lithuanian (Lithuania) */ - { "dsb", "DE", LOWER_SORBIAN }, /* Windows Vista and later: Lower Sorbian (Germany) */ - { "lb", "LU", LUXEMBOURGISH }, /* Windows XP SP2 and later (downloadable); Windows Vista and later: Luxembourgish (Luxembourg) */ - { "mk", "MK", MACEDONIAN }, /* Windows 2000 and later: Macedonian (Macedonia, FYROM) */ - { "ms", "BN", MALAY_BRUNEI_DARUSSALAM }, /* Windows 2000 and later: Malay (Brunei Darussalam) */ - { "ms", "MY", MALAY_MALAYSIA }, /* Windows 2000 and later: Malay (Malaysia) */ - { "ml", "IN", MALAYALAM }, /* Windows XP SP2 and later: Malayalam (India) */ - { "mt", "MT", MALTESE }, /* Windows XP SP2 and later: Maltese (Malta) */ - { "mi", "NZ", MAORI }, /* Windows XP SP2 and later: Maori (New Zealand) */ - { "arn", "CL", MAPUDUNGUN }, /* Windows XP SP2 and later (downloadable); Windows Vista and later: Mapudungun (Chile) */ - { "mr", "IN", MARATHI }, /* Windows 2000 and later: Marathi (India) */ - { "moh", "CA", MOHAWK }, /* Windows XP SP2 and later (downloadable); Windows Vista and later: Mohawk (Canada) */ - { "mn", "MN", MONGOLIAN }, /* Mongolian */ - { "ne", "NP", NEPALI }, /* Windows XP SP2 and later (downloadable); Windows Vista and later: Nepali (Nepal) */ - { "nb", "NO", NORWEGIAN_BOKMAL }, /* Norwegian (Bokmal, Norway) */ - { "nn", "NO", NORWEGIAN_NYNORSK }, /* Norwegian (Nynorsk, Norway) */ - { "oc", "FR", OCCITAN }, /* Occitan (France) */ - { "or", "IN", ORIYA }, /* Oriya (India) */ - { "ps", "AF", PASHTO }, /* Windows XP SP2 and later (downloadable); Windows Vista and later: Pashto (Afghanistan) */ - { "fa", "IR", FARSI }, /* Persian (Iran) */ - { "pl", "PL", POLISH }, /* Polish (Poland) */ - { "pt", "BR", PORTUGUESE_BRAZILIAN }, /* Portuguese (Brazil) */ - { "pt", "PT", PORTUGUESE_STANDARD }, /* Portuguese (Portugal) */ - { "pa", "IN", PUNJABI }, /* Windows XP and later: Punjabi (India) */ - { "quz", "BO", QUECHUA_BOLIVIA }, /* Windows XP SP2 and later: Quechua (Bolivia) */ - { "quz", "EC", QUECHUA_ECUADOR }, /* Windows XP SP2 and later: Quechua (Ecuador) */ - { "quz", "PE", QUECHUA_PERU }, /* Windows XP SP2 and later: Quechua (Peru) */ - { "ro", "RO", ROMANIAN }, /* Romanian (Romania) */ - { "rm", "CH", ROMANSH }, /* Windows XP SP2 and later (downloadable); Windows Vista and later: Romansh (Switzerland) */ - { "ru", "RU", RUSSIAN }, /* Russian (Russia) */ - { "smn", "FI", SAMI_INARI }, /* Windows XP SP2 and later: Sami (Inari, Finland) */ - { "smj", "NO", SAMI_LULE_NORWAY }, /* Windows XP SP2 and later: Sami (Lule, Norway) */ - { "smj", "SE", SAMI_LULE_SWEDEN }, /* Windows XP SP2 and later: Sami (Lule, Sweden) */ - { "se", "FI", SAMI_NORTHERN_FINLAND }, /* Windows XP SP2 and later: Sami (Northern, Finland) */ - { "se", "NO", SAMI_NORTHERN_NORWAY }, /* Windows XP SP2 and later: Sami (Northern, Norway) */ - { "se", "SE", SAMI_NORTHERN_SWEDEN }, /* Windows XP SP2 and later: Sami (Northern, Sweden) */ - { "sms", "FI", SAMI_SKOLT }, /* Windows XP SP2 and later: Sami (Skolt, Finland) */ +static const SYSTEM_LOCALE SYSTEM_LOCALE_TABLE[] = { + { "af", "ZA", AFRIKAANS }, /* Afrikaans (South Africa) */ + { "sq", "AL", ALBANIAN }, /* Albanian (Albania) */ + { "gsw", "FR", ALSATIAN }, /* Windows Vista and later: Alsatian (France) */ + { "am", "ET", AMHARIC }, /* Windows Vista and later: Amharic (Ethiopia) */ + { "ar", "DZ", ARABIC_ALGERIA }, /* Arabic (Algeria) */ + { "ar", "BH", ARABIC_BAHRAIN }, /* Arabic (Bahrain) */ + { "ar", "EG", ARABIC_EGYPT }, /* Arabic (Egypt) */ + { "ar", "IQ", ARABIC_IRAQ }, /* Arabic (Iraq) */ + { "ar", "JO", ARABIC_JORDAN }, /* Arabic (Jordan) */ + { "ar", "KW", ARABIC_KUWAIT }, /* Arabic (Kuwait) */ + { "ar", "LB", ARABIC_LEBANON }, /* Arabic (Lebanon) */ + { "ar", "LY", ARABIC_LIBYA }, /* Arabic (Libya) */ + { "ar", "MA", ARABIC_MOROCCO }, /* Arabic (Morocco) */ + { "ar", "OM", ARABIC_OMAN }, /* Arabic (Oman) */ + { "ar", "QA", ARABIC_QATAR }, /* Arabic (Qatar) */ + { "ar", "SA", ARABIC_SAUDI_ARABIA }, /* Arabic (Saudi Arabia) */ + { "ar", "SY", ARABIC_SYRIA }, /* Arabic (Syria) */ + { "ar", "TN", ARABIC_TUNISIA }, /* Arabic (Tunisia) */ + { "ar", "AE", ARABIC_UAE }, /* Arabic (U.A.E.) */ + { "ar", "YE", ARABIC_YEMEN }, /* Arabic (Yemen) */ + { "az", "AZ", AZERI_LATIN }, /* Azeri (Latin) */ + { "az", "Cyrl_AZ", AZERI_CYRILLIC }, /* Azeri (Cyrillic) */ + { "hy", "AM", ARMENIAN }, /* Windows 2000 and later: Armenian (Armenia) */ + { "as", "IN", ASSAMESE }, /* Windows Vista and later: Assamese (India) */ + { "ba", "RU", BASHKIR }, /* Windows Vista and later: Bashkir (Russia) */ + { "eu", "ES", BASQUE }, /* Basque (Basque) */ + { "be", "BY", BELARUSIAN }, /* Belarusian (Belarus) */ + { "bn", "IN", BENGALI_INDIA }, /* Windows XP SP2 and later: Bengali (India) */ + { "br", "FR", BRETON }, /* Breton (France) */ + { "bs", "BA", BOSNIAN_LATIN }, /* Bosnian (Latin) */ + { "bg", "BG", BULGARIAN }, /* Bulgarian (Bulgaria) */ + { "ca", "ES", CATALAN }, /* Catalan (Catalan) */ + { "zh", "HK", CHINESE_HONG_KONG }, /* Chinese (Hong Kong SAR, PRC) */ + { "zh", "MO", CHINESE_MACAU }, /* Windows 98/Me, Windows XP and later: Chinese (Macao SAR) */ + { "zh", "CN", CHINESE_PRC }, /* Chinese (PRC) */ + { "zh", "SG", CHINESE_SINGAPORE }, /* Chinese (Singapore) */ + { "zh", "TW", CHINESE_TAIWAN }, /* Chinese (Taiwan) */ + { "hr", "BA", CROATIAN_BOSNIA_HERZEGOVINA }, /* Windows XP SP2 and later: Croatian (Bosnia and + Herzegovina, Latin) */ + { "hr", "HR", CROATIAN }, /* Croatian (Croatia) */ + { "cs", "CZ", CZECH }, /* Czech (Czech Republic) */ + { "da", "DK", DANISH }, /* Danish (Denmark) */ + { "prs", "AF", DARI }, /* Windows XP and later: Dari (Afghanistan) */ + { "dv", "MV", DIVEHI }, /* Windows XP and later: Divehi (Maldives) */ + { "nl", "BE", DUTCH_BELGIAN }, /* Dutch (Belgium) */ + { "nl", "NL", DUTCH_STANDARD }, /* Dutch (Netherlands) */ + { "en", "AU", ENGLISH_AUSTRALIAN }, /* English (Australia) */ + { "en", "BZ", ENGLISH_BELIZE }, /* English (Belize) */ + { "en", "CA", ENGLISH_CANADIAN }, /* English (Canada) */ + { "en", "CB", ENGLISH_CARIBBEAN }, /* English (Carribean) */ + { "en", "IN", ENGLISH_INDIA }, /* Windows Vista and later: English (India) */ + { "en", "IE", ENGLISH_IRELAND }, /* English (Ireland) */ + { "en", "JM", ENGLISH_JAMAICA }, /* English (Jamaica) */ + { "en", "MY", ENGLISH_MALAYSIA }, /* Windows Vista and later: English (Malaysia) */ + { "en", "NZ", ENGLISH_NEW_ZEALAND }, /* English (New Zealand) */ + { "en", "PH", + ENGLISH_PHILIPPINES }, /* Windows 98/Me, Windows 2000 and later: English (Philippines) */ + { "en", "SG", ENGLISH_SINGAPORE }, /* Windows Vista and later: English (Singapore) */ + { "en", "ZA", ENGLISH_SOUTH_AFRICA }, /* English (South Africa) */ + { "en", "TT", ENGLISH_TRINIDAD }, /* English (Trinidad and Tobago) */ + { "en", "GB", ENGLISH_UNITED_KINGDOM }, /* English (United Kingdom) */ + { "en", "US", ENGLISH_UNITED_STATES }, /* English (United States) */ + { "en", "ZW", + ENGLISH_ZIMBABWE }, /* Windows 98/Me, Windows 2000 and later: English (Zimbabwe) */ + { "et", "EE", ESTONIAN }, /* Estonian (Estonia) */ + { "fo", "FO", FAEROESE }, /* Faroese (Faroe Islands) */ + { "fil", "PH", FILIPINO }, /* Windows XP SP2 and later (downloadable); Windows Vista and later: + Filipino (Philippines) */ + { "fi", "FI", FINNISH }, /* Finnish (Finland) */ + { "fr", "BE", FRENCH_BELGIAN }, /* French (Belgium) */ + { "fr", "CA", FRENCH_CANADIAN }, /* French (Canada) */ + { "fr", "FR", FRENCH_STANDARD }, /* French (France) */ + { "fr", "LU", FRENCH_LUXEMBOURG }, /* French (Luxembourg) */ + { "fr", "MC", FRENCH_MONACO }, /* French (Monaco) */ + { "fr", "CH", FRENCH_SWISS }, /* French (Switzerland) */ + { "fy", "NL", FRISIAN }, /* Windows XP SP2 and later (downloadable); Windows Vista and later: + Frisian (Netherlands) */ + { "gl", "ES", GALICIAN }, /* Windows XP and later: Galician (Spain) */ + { "ka", "GE", GEORGIAN }, /* Windows 2000 and later: Georgian (Georgia) */ + { "de", "AT", GERMAN_AUSTRIAN }, /* German (Austria) */ + { "de", "DE", GERMAN_STANDARD }, /* German (Germany) */ + { "de", "LI", GERMAN_LIECHTENSTEIN }, /* German (Liechtenstein) */ + { "de", "LU", GERMAN_LUXEMBOURG }, /* German (Luxembourg) */ + { "de", "CH", GERMAN_SWISS }, /* German (Switzerland) */ + { "el", "GR", GREEK }, /* Greek (Greece) */ + { "kl", "GL", GREENLANDIC }, /* Windows Vista and later: Greenlandic (Greenland) */ + { "gu", "IN", GUJARATI }, /* Windows XP and later: Gujarati (India) */ + { "he", "IL", HEBREW }, /* Hebrew (Israel) */ + { "hi", "IN", HINDI }, /* Windows 2000 and later: Hindi (India) */ + { "hu", "HU", HUNGARIAN }, /* Hungarian (Hungary) */ + { "is", "IS", ICELANDIC }, /* Icelandic (Iceland) */ + { "ig", "NG", IGBO }, /* Igbo (Nigeria) */ + { "id", "ID", INDONESIAN }, /* Indonesian (Indonesia) */ + { "ga", "IE", IRISH }, /* Windows XP SP2 and later (downloadable); Windows Vista and later: + Irish (Ireland) */ + { "it", "IT", ITALIAN_STANDARD }, /* Italian (Italy) */ + { "it", "CH", ITALIAN_SWISS }, /* Italian (Switzerland) */ + { "ja", "JP", JAPANESE }, /* Japanese (Japan) */ + { "kn", "IN", KANNADA }, /* Windows XP and later: Kannada (India) */ + { "kk", "KZ", KAZAKH }, /* Windows 2000 and later: Kazakh (Kazakhstan) */ + { "kh", "KH", KHMER }, /* Windows Vista and later: Khmer (Cambodia) */ + { "qut", "GT", KICHE }, /* Windows Vista and later: K'iche (Guatemala) */ + { "rw", "RW", KINYARWANDA }, /* Windows Vista and later: Kinyarwanda (Rwanda) */ + { "kok", "IN", KONKANI }, /* Windows 2000 and later: Konkani (India) */ + { "ko", "KR", KOREAN }, /* Korean (Korea) */ + { "ky", "KG", KYRGYZ }, /* Windows XP and later: Kyrgyz (Kyrgyzstan) */ + { "lo", "LA", LAO }, /* Windows Vista and later: Lao (Lao PDR) */ + { "lv", "LV", LATVIAN }, /* Latvian (Latvia) */ + { "lt", "LT", LITHUANIAN }, /* Lithuanian (Lithuania) */ + { "dsb", "DE", LOWER_SORBIAN }, /* Windows Vista and later: Lower Sorbian (Germany) */ + { "lb", "LU", LUXEMBOURGISH }, /* Windows XP SP2 and later (downloadable); Windows Vista and + later: Luxembourgish (Luxembourg) */ + { "mk", "MK", MACEDONIAN }, /* Windows 2000 and later: Macedonian (Macedonia, FYROM) */ + { "ms", "BN", MALAY_BRUNEI_DARUSSALAM }, /* Windows 2000 and later: Malay (Brunei Darussalam) */ + { "ms", "MY", MALAY_MALAYSIA }, /* Windows 2000 and later: Malay (Malaysia) */ + { "ml", "IN", MALAYALAM }, /* Windows XP SP2 and later: Malayalam (India) */ + { "mt", "MT", MALTESE }, /* Windows XP SP2 and later: Maltese (Malta) */ + { "mi", "NZ", MAORI }, /* Windows XP SP2 and later: Maori (New Zealand) */ + { "arn", "CL", MAPUDUNGUN }, /* Windows XP SP2 and later (downloadable); Windows Vista and + later: Mapudungun (Chile) */ + { "mr", "IN", MARATHI }, /* Windows 2000 and later: Marathi (India) */ + { "moh", "CA", MOHAWK }, /* Windows XP SP2 and later (downloadable); Windows Vista and later: + Mohawk (Canada) */ + { "mn", "MN", MONGOLIAN }, /* Mongolian */ + { "ne", "NP", NEPALI }, /* Windows XP SP2 and later (downloadable); Windows Vista and later: + Nepali (Nepal) */ + { "nb", "NO", NORWEGIAN_BOKMAL }, /* Norwegian (Bokmal, Norway) */ + { "nn", "NO", NORWEGIAN_NYNORSK }, /* Norwegian (Nynorsk, Norway) */ + { "oc", "FR", OCCITAN }, /* Occitan (France) */ + { "or", "IN", ORIYA }, /* Oriya (India) */ + { "ps", "AF", PASHTO }, /* Windows XP SP2 and later (downloadable); Windows Vista and later: + Pashto (Afghanistan) */ + { "fa", "IR", FARSI }, /* Persian (Iran) */ + { "pl", "PL", POLISH }, /* Polish (Poland) */ + { "pt", "BR", PORTUGUESE_BRAZILIAN }, /* Portuguese (Brazil) */ + { "pt", "PT", PORTUGUESE_STANDARD }, /* Portuguese (Portugal) */ + { "pa", "IN", PUNJABI }, /* Windows XP and later: Punjabi (India) */ + { "quz", "BO", QUECHUA_BOLIVIA }, /* Windows XP SP2 and later: Quechua (Bolivia) */ + { "quz", "EC", QUECHUA_ECUADOR }, /* Windows XP SP2 and later: Quechua (Ecuador) */ + { "quz", "PE", QUECHUA_PERU }, /* Windows XP SP2 and later: Quechua (Peru) */ + { "ro", "RO", ROMANIAN }, /* Romanian (Romania) */ + { "rm", "CH", ROMANSH }, /* Windows XP SP2 and later (downloadable); Windows Vista and later: + Romansh (Switzerland) */ + { "ru", "RU", RUSSIAN }, /* Russian (Russia) */ + { "smn", "FI", SAMI_INARI }, /* Windows XP SP2 and later: Sami (Inari, Finland) */ + { "smj", "NO", SAMI_LULE_NORWAY }, /* Windows XP SP2 and later: Sami (Lule, Norway) */ + { "smj", "SE", SAMI_LULE_SWEDEN }, /* Windows XP SP2 and later: Sami (Lule, Sweden) */ + { "se", "FI", SAMI_NORTHERN_FINLAND }, /* Windows XP SP2 and later: Sami (Northern, Finland) */ + { "se", "NO", SAMI_NORTHERN_NORWAY }, /* Windows XP SP2 and later: Sami (Northern, Norway) */ + { "se", "SE", SAMI_NORTHERN_SWEDEN }, /* Windows XP SP2 and later: Sami (Northern, Sweden) */ + { "sms", "FI", SAMI_SKOLT }, /* Windows XP SP2 and later: Sami (Skolt, Finland) */ { "sma", "NO", SAMI_SOUTHERN_NORWAY }, /* Windows XP SP2 and later: Sami (Southern, Norway) */ { "sma", "SE", SAMI_SOUTHERN_SWEDEN }, /* Windows XP SP2 and later: Sami (Southern, Sweden) */ - { "sa", "IN", SANSKRIT }, /* Windows 2000 and later: Sanskrit (India) */ - { "sr", "SP", SERBIAN_LATIN }, /* Serbian (Latin) */ - { "sr", "SIH", SERBIAN_LATIN_BOSNIA_HERZEGOVINA }, /* Serbian (Latin) (Bosnia and Herzegovina) */ - { "sr", "Cyrl_SP", SERBIAN_CYRILLIC }, /* Serbian (Cyrillic) */ - { "sr", "Cyrl_SIH", SERBIAN_CYRILLIC_BOSNIA_HERZEGOVINA }, /* Serbian (Cyrillic) (Bosnia and Herzegovina) */ - { "ns", "ZA", SESOTHO_SA_LEBOA }, /* Windows XP SP2 and later: Sesotho sa Leboa/Northern Sotho (South Africa) */ - { "tn", "ZA", TSWANA }, /* Windows XP SP2 and later: Setswana/Tswana (South Africa) */ - { "si", "LK", SINHALA }, /* Windows Vista and later: Sinhala (Sri Lanka) */ - { "sk", "SK", SLOVAK }, /* Slovak (Slovakia) */ - { "sl", "SI", SLOVENIAN }, /* Slovenian (Slovenia) */ - { "es", "AR", SPANISH_ARGENTINA }, /* Spanish (Argentina) */ - { "es", "BO", SPANISH_BOLIVIA }, /* Spanish (Bolivia) */ - { "es", "CL", SPANISH_CHILE }, /* Spanish (Chile) */ - { "es", "CO", SPANISH_COLOMBIA }, /* Spanish (Colombia) */ - { "es", "CR", SPANISH_COSTA_RICA }, /* Spanish (Costa Rica) */ - { "es", "DO", SPANISH_DOMINICAN_REPUBLIC }, /* Spanish (Dominican Republic) */ - { "es", "EC", SPANISH_ECUADOR }, /* Spanish (Ecuador) */ - { "es", "SV", SPANISH_EL_SALVADOR }, /* Spanish (El Salvador) */ - { "es", "GT", SPANISH_GUATEMALA }, /* Spanish (Guatemala) */ - { "es", "HN", SPANISH_HONDURAS }, /* Spanish (Honduras) */ - { "es", "MX", SPANISH_MEXICAN }, /* Spanish (Mexico) */ - { "es", "NI", SPANISH_NICARAGUA }, /* Spanish (Nicaragua) */ - { "es", "PA", SPANISH_PANAMA }, /* Spanish (Panama) */ - { "es", "PY", SPANISH_PARAGUAY }, /* Spanish (Paraguay) */ - { "es", "PE", SPANISH_PERU }, /* Spanish (Peru) */ - { "es", "PR", SPANISH_PUERTO_RICO }, /* Spanish (Puerto Rico) */ - { "es", "ES", SPANISH_MODERN_SORT }, /* Spanish (Spain) */ - { "es", "ES", SPANISH_TRADITIONAL_SORT }, /* Spanish (Spain, Traditional Sort) */ - { "es", "US", SPANISH_UNITED_STATES }, /* Windows Vista and later: Spanish (United States) */ - { "es", "UY", SPANISH_URUGUAY }, /* Spanish (Uruguay) */ - { "es", "VE", SPANISH_VENEZUELA }, /* Spanish (Venezuela) */ - { "sw", "KE", SWAHILI }, /* Windows 2000 and later: Swahili (Kenya) */ - { "sv", "FI", SWEDISH_FINLAND }, /* Swedish (Finland) */ - { "sv", "SE", SWEDISH }, /* Swedish (Sweden) */ - { "syr", "SY", SYRIAC }, /* Windows XP and later: Syriac (Syria) */ - { "ta", "IN", TAMIL }, /* Windows 2000 and later: Tamil (India) */ - { "tt", "RU", TATAR }, /* Windows XP and later: Tatar (Russia) */ - { "te", "IN", TELUGU }, /* Windows XP and later: Telugu (India) */ - { "th", "TH", THAI }, /* Thai (Thailand) */ - { "bo", "BT", TIBETAN_BHUTAN }, /* Windows Vista and later: Tibetan (Bhutan) */ - { "bo", "CN", TIBETAN_PRC }, /* Windows Vista and later: Tibetan (PRC) */ - { "tr", "TR", TURKISH }, /* Turkish (Turkey) */ - { "tk", "TM", TURKMEN }, /* Windows Vista and later: Turkmen (Turkmenistan) */ - { "ug", "CN", UIGHUR }, /* Windows Vista and later: Uighur (PRC) */ - { "uk", "UA", UKRAINIAN }, /* Ukrainian (Ukraine) */ - { "wen", "DE", UPPER_SORBIAN }, /* Windows Vista and later: Upper Sorbian (Germany) */ - { "tr", "IN", URDU_INDIA }, /* Urdu (India) */ - { "ur", "PK", URDU }, /* Windows 98/Me, Windows 2000 and later: Urdu (Pakistan) */ - { "uz", "UZ", UZBEK_LATIN }, /* Uzbek (Latin) */ - { "uz", "Cyrl_UZ", UZBEK_CYRILLIC }, /* Uzbek (Cyrillic) */ - { "vi", "VN", VIETNAMESE }, /* Windows 98/Me, Windows NT 4.0 and later: Vietnamese (Vietnam) */ - { "cy", "GB", WELSH }, /* Windows XP SP2 and later: Welsh (United Kingdom) */ - { "wo", "SN", WOLOF }, /* Windows Vista and later: Wolof (Senegal) */ - { "xh", "ZA", XHOSA }, /* Windows XP SP2 and later: Xhosa/isiXhosa (South Africa) */ - { "sah", "RU", YAKUT }, /* Windows Vista and later: Yakut (Russia) */ - { "ii", "CN", YI }, /* Windows Vista and later: Yi (PRC) */ - { "yo", "NG", YORUBA }, /* Windows Vista and later: Yoruba (Nigeria) */ - { "zu", "ZA", ZULU } /* Windows XP SP2 and later: Zulu/isiZulu (South Africa) */ + { "sa", "IN", SANSKRIT }, /* Windows 2000 and later: Sanskrit (India) */ + { "sr", "SP", SERBIAN_LATIN }, /* Serbian (Latin) */ + { "sr", "SIH", + SERBIAN_LATIN_BOSNIA_HERZEGOVINA }, /* Serbian (Latin) (Bosnia and Herzegovina) */ + { "sr", "Cyrl_SP", SERBIAN_CYRILLIC }, /* Serbian (Cyrillic) */ + { "sr", "Cyrl_SIH", + SERBIAN_CYRILLIC_BOSNIA_HERZEGOVINA }, /* Serbian (Cyrillic) (Bosnia and Herzegovina) */ + { "ns", "ZA", SESOTHO_SA_LEBOA }, /* Windows XP SP2 and later: Sesotho sa Leboa/Northern Sotho + (South Africa) */ + { "tn", "ZA", TSWANA }, /* Windows XP SP2 and later: Setswana/Tswana (South Africa) */ + { "si", "LK", SINHALA }, /* Windows Vista and later: Sinhala (Sri Lanka) */ + { "sk", "SK", SLOVAK }, /* Slovak (Slovakia) */ + { "sl", "SI", SLOVENIAN }, /* Slovenian (Slovenia) */ + { "es", "AR", SPANISH_ARGENTINA }, /* Spanish (Argentina) */ + { "es", "BO", SPANISH_BOLIVIA }, /* Spanish (Bolivia) */ + { "es", "CL", SPANISH_CHILE }, /* Spanish (Chile) */ + { "es", "CO", SPANISH_COLOMBIA }, /* Spanish (Colombia) */ + { "es", "CR", SPANISH_COSTA_RICA }, /* Spanish (Costa Rica) */ + { "es", "DO", SPANISH_DOMINICAN_REPUBLIC }, /* Spanish (Dominican Republic) */ + { "es", "EC", SPANISH_ECUADOR }, /* Spanish (Ecuador) */ + { "es", "SV", SPANISH_EL_SALVADOR }, /* Spanish (El Salvador) */ + { "es", "GT", SPANISH_GUATEMALA }, /* Spanish (Guatemala) */ + { "es", "HN", SPANISH_HONDURAS }, /* Spanish (Honduras) */ + { "es", "MX", SPANISH_MEXICAN }, /* Spanish (Mexico) */ + { "es", "NI", SPANISH_NICARAGUA }, /* Spanish (Nicaragua) */ + { "es", "PA", SPANISH_PANAMA }, /* Spanish (Panama) */ + { "es", "PY", SPANISH_PARAGUAY }, /* Spanish (Paraguay) */ + { "es", "PE", SPANISH_PERU }, /* Spanish (Peru) */ + { "es", "PR", SPANISH_PUERTO_RICO }, /* Spanish (Puerto Rico) */ + { "es", "ES", SPANISH_MODERN_SORT }, /* Spanish (Spain) */ + { "es", "ES", SPANISH_TRADITIONAL_SORT }, /* Spanish (Spain, Traditional Sort) */ + { "es", "US", SPANISH_UNITED_STATES }, /* Windows Vista and later: Spanish (United States) */ + { "es", "UY", SPANISH_URUGUAY }, /* Spanish (Uruguay) */ + { "es", "VE", SPANISH_VENEZUELA }, /* Spanish (Venezuela) */ + { "sw", "KE", SWAHILI }, /* Windows 2000 and later: Swahili (Kenya) */ + { "sv", "FI", SWEDISH_FINLAND }, /* Swedish (Finland) */ + { "sv", "SE", SWEDISH }, /* Swedish (Sweden) */ + { "syr", "SY", SYRIAC }, /* Windows XP and later: Syriac (Syria) */ + { "ta", "IN", TAMIL }, /* Windows 2000 and later: Tamil (India) */ + { "tt", "RU", TATAR }, /* Windows XP and later: Tatar (Russia) */ + { "te", "IN", TELUGU }, /* Windows XP and later: Telugu (India) */ + { "th", "TH", THAI }, /* Thai (Thailand) */ + { "bo", "BT", TIBETAN_BHUTAN }, /* Windows Vista and later: Tibetan (Bhutan) */ + { "bo", "CN", TIBETAN_PRC }, /* Windows Vista and later: Tibetan (PRC) */ + { "tr", "TR", TURKISH }, /* Turkish (Turkey) */ + { "tk", "TM", TURKMEN }, /* Windows Vista and later: Turkmen (Turkmenistan) */ + { "ug", "CN", UIGHUR }, /* Windows Vista and later: Uighur (PRC) */ + { "uk", "UA", UKRAINIAN }, /* Ukrainian (Ukraine) */ + { "wen", "DE", UPPER_SORBIAN }, /* Windows Vista and later: Upper Sorbian (Germany) */ + { "tr", "IN", URDU_INDIA }, /* Urdu (India) */ + { "ur", "PK", URDU }, /* Windows 98/Me, Windows 2000 and later: Urdu (Pakistan) */ + { "uz", "UZ", UZBEK_LATIN }, /* Uzbek (Latin) */ + { "uz", "Cyrl_UZ", UZBEK_CYRILLIC }, /* Uzbek (Cyrillic) */ + { "vi", "VN", VIETNAMESE }, /* Windows 98/Me, Windows NT 4.0 and later: Vietnamese (Vietnam) */ + { "cy", "GB", WELSH }, /* Windows XP SP2 and later: Welsh (United Kingdom) */ + { "wo", "SN", WOLOF }, /* Windows Vista and later: Wolof (Senegal) */ + { "xh", "ZA", XHOSA }, /* Windows XP SP2 and later: Xhosa/isiXhosa (South Africa) */ + { "sah", "RU", YAKUT }, /* Windows Vista and later: Yakut (Russia) */ + { "ii", "CN", YI }, /* Windows Vista and later: Yi (PRC) */ + { "yo", "NG", YORUBA }, /* Windows Vista and later: Yoruba (Nigeria) */ + { "zu", "ZA", ZULU } /* Windows XP SP2 and later: Zulu/isiZulu (South Africa) */ }; struct _LOCALE_NAME @@ -255,8 +269,7 @@ struct _LOCALE_NAME }; typedef struct _LOCALE_NAME LOCALE_NAME; -static const LOCALE_NAME LOCALE_NAME_TABLE[] = -{ +static const LOCALE_NAME LOCALE_NAME_TABLE[] = { { AFRIKAANS, "AFRIKAANS" }, { ALBANIAN, "ALBANIAN" }, { ALSATIAN, "ALSATIAN" }, @@ -460,175 +473,173 @@ static const LOCALE_NAME LOCALE_NAME_TABLE[] = struct _LOCALE_KEYBOARD_LAYOUTS { - DWORD locale; /* Locale ID */ + DWORD locale; /* Locale ID */ DWORD keyboardLayouts[5]; /* array of associated keyboard layouts */ - }; typedef struct _LOCALE_KEYBOARD_LAYOUTS LOCALE_KEYBOARD_LAYOUTS; /* TODO: Use KBD_* defines instead of hardcoded values */ -static const LOCALE_KEYBOARD_LAYOUTS LOCALE_KEYBOARD_LAYOUTS_TABLE[] = -{ - { AFRIKAANS, { 0x00000409, 0x00000409, 0x0, 0x0, 0x0 } }, - { ALBANIAN, { 0x0000041c, 0x00000409, 0x0, 0x0, 0x0 } }, - { ARABIC_SAUDI_ARABIA, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, - { ARABIC_IRAQ, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, - { ARABIC_EGYPT, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, - { ARABIC_LIBYA, { 0x0000040c, 0x00020401, 0x0, 0x0, 0x0 } }, - { ARABIC_ALGERIA, { 0x0000040c, 0x00020401, 0x0, 0x0, 0x0 } }, - { ARABIC_MOROCCO, { 0x0000040c, 0x00020401, 0x0, 0x0, 0x0 } }, - { ARABIC_TUNISIA, { 0x0000040c, 0x00020401, 0x0, 0x0, 0x0 } }, - { ARABIC_OMAN, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, - { ARABIC_YEMEN, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, - { ARABIC_SYRIA, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, - { ARABIC_JORDAN, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, - { ARABIC_LEBANON, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, - { ARABIC_KUWAIT, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, - { ARABIC_UAE, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, - { ARABIC_BAHRAIN, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, - { ARABIC_QATAR, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, - { ARMENIAN, { 0x0000042b, 0x00000409, 0x00000419, 0x0, 0x0 } }, - { AZERI_LATIN, { 0x0000042c, 0x0000082c, 0x00000419, 0x0, 0x0 } }, - { AZERI_CYRILLIC, { 0x0000082c, 0x0000042c, 0x00000419, 0x0, 0x0 } }, - { BASQUE, { 0x0000040a, 0x00000409, 0x0, 0x0, 0x0 } }, - { BELARUSIAN, { 0x00000423, 0x00000409, 0x00000419, 0x0, 0x0 } }, - { BENGALI_INDIA, { 0x00000445, 0x00000409, 0x0, 0x0, 0x0 } }, - { BOSNIAN_LATIN, { 0x0000141A, 0x00000409, 0x0, 0x0, 0x0 } }, - { BULGARIAN, { 0x00000402, 0x00000409, 0x0, 0x0, 0x0 } }, - { CATALAN, { 0x0000040a, 0x00000409, 0x0, 0x0, 0x0 } }, - { CHINESE_TAIWAN, { 0x00000404, 0xe0080404, 0xE0010404, 0x0, 0x0 } }, - { CHINESE_PRC, { 0x00000804, 0xe00e0804, 0xe0010804, 0xe0030804, 0xe0040804 } }, - { CHINESE_HONG_KONG, { 0x00000409, 0xe0080404, 0x0, 0x0, 0x0 } }, - { CHINESE_SINGAPORE, { 0x00000409, 0xe00e0804, 0xe0010804, 0xe0030804, 0xe0040804 } }, - { CHINESE_MACAU, { 0x00000409, 0xe00e0804, 0xe0020404, 0xe0080404 } }, - { CROATIAN, { 0x0000041a, 0x00000409, 0x0, 0x0, 0x0 } }, - { CROATIAN_BOSNIA_HERZEGOVINA, { 0x0000041a, 0x00000409, 0x0, 0x0, 0x0 } }, - { CZECH, { 0x00000405, 0x00000409, 0x0, 0x0, 0x0 } }, - { DANISH, { 0x00000406, 0x00000409, 0x0, 0x0, 0x0 } }, - { DIVEHI, { 0x00000409, 0x00000465, 0x0, 0x0, 0x0 } }, - { DUTCH_STANDARD, { 0x00020409, 0x00000413, 0x00000409, 0x0, 0x0 } }, - { DUTCH_BELGIAN, { 0x00000813, 0x00000409, 0x0, 0x0, 0x0 } }, - { ENGLISH_UNITED_STATES, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, - { ENGLISH_UNITED_KINGDOM, { 0x00000809, 0x0, 0x0, 0x0, 0x0 } }, - { ENGLISH_AUSTRALIAN, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, - { ENGLISH_CANADIAN, { 0x00000409, 0x00011009, 0x00001009, 0x0, 0x0 } }, - { ENGLISH_NEW_ZEALAND, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, - { ENGLISH_IRELAND, { 0x00001809, 0x00011809, 0x0, 0x0, 0x0 } }, - { ENGLISH_SOUTH_AFRICA, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, - { ENGLISH_JAMAICA, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, - { ENGLISH_CARIBBEAN, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, - { ENGLISH_BELIZE, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, - { ENGLISH_TRINIDAD, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, - { ENGLISH_ZIMBABWE, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, - { ENGLISH_PHILIPPINES, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, - { ESTONIAN, { 0x00000425, 0x0, 0x0, 0x0, 0x0 } }, - { FAEROESE, { 0x00000406, 0x00000409, 0x0, 0x0, 0x0 } }, - { FARSI, { 0x00000409, 0x00000429, 0x00000401, 0x0, 0x0 } }, - { FINNISH, { 0x0000040b, 0x00000409, 0x0, 0x0, 0x0 } }, - { FRENCH_STANDARD, { 0x0000040c, 0x00000409, 0x0, 0x0, 0x0 } }, - { FRENCH_BELGIAN, { 0x0000080c, 0x00000409, 0x0, 0x0, 0x0 } }, - { FRENCH_CANADIAN, { 0x00000C0C, 0x00011009, 0x00000409, 0x0, 0x0 } }, - { FRENCH_SWISS, { 0x0000100c, 0x00000409, 0x0, 0x0, 0x0 } }, - { FRENCH_LUXEMBOURG, { 0x0000040c, 0x00000409, 0x0, 0x0, 0x0 } }, - { FRENCH_MONACO, { 0x0000040c, 0x00000409, 0x0, 0x0, 0x0 } }, - { GEORGIAN, { 0x00000437, 0x00000409, 0x00000419, 0x0, 0x0 } }, - { GALICIAN, { 0x0000040a, 0x00000409, 0x0, 0x0, 0x0 } }, - { GERMAN_STANDARD, { 0x00000407, 0x00000409, 0x0, 0x0, 0x0 } }, - { GERMAN_SWISS, { 0x00000807, 0x00000409, 0x0, 0x0, 0x0 } }, - { GERMAN_AUSTRIAN, { 0x00000407, 0x00000409, 0x0, 0x0, 0x0 } }, - { GERMAN_LUXEMBOURG, { 0x00000407, 0x00000409, 0x0, 0x0, 0x0 } }, - { GERMAN_LIECHTENSTEIN, { 0x00000407, 0x00000409, 0x0, 0x0, 0x0 } }, - { GREEK, { 0x00000408, 0x00000409, 0x0, 0x0, 0x0 } }, - { GUJARATI, { 0x00000409, 0x00000447, 0x00010439, 0x0, 0x0 } }, - { HEBREW, { 0x00000409, 0x0000040d, 0x0, 0x0, 0x0 } }, - { HINDI, { 0x00000409, 0x00010439, 0x00000439, 0x0, 0x0 } }, - { HUNGARIAN, { 0x0000040e, 0x00000409, 0x0, 0x0, 0x0 } }, - { ICELANDIC, { 0x0000040f, 0x00000409, 0x0, 0x0, 0x0 } }, - { INDONESIAN, { 0x00000409, 0x00000409, 0x0, 0x0, 0x0 } }, - { ITALIAN_STANDARD, { 0x00000410, 0x00000409, 0x0, 0x0, 0x0 } }, - { ITALIAN_SWISS, { 0x00000410, 0x00000409, 0x0, 0x0, 0x0 } }, - { JAPANESE, { 0xe0010411, 0x0, 0x0, 0x0, 0x0 } }, - { KANNADA, { 0x00000409, 0x0000044b, 0x00010439, 0x0, 0x0 } }, - { KAZAKH, { 0x0000043f, 0x00000409, 0x00000419, 0x0, 0x0 } }, - { KONKANI, { 0x00000409, 0x00000439, 0x0, 0x0, 0x0 } }, - { KOREAN, { 0xE0010412, 0x0, 0x0, 0x0, 0x0 } }, - { KYRGYZ, { 0x00000440, 0x00000409, 0x0, 0x0, 0x0 } }, - { LATVIAN, { 0x00010426, 0x0, 0x0, 0x0, 0x0 } }, - { LITHUANIAN, { 0x00010427, 0x0, 0x0, 0x0, 0x0 } }, - { MACEDONIAN, { 0x0000042f, 0x00000409, 0x0, 0x0, 0x0 } }, - { MALAY_MALAYSIA, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, - { MALAY_BRUNEI_DARUSSALAM, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, - { MALAYALAM, { 0x00000409, 0x0000044c, 0x0, 0x0, 0x0 } }, - { MALTESE, { 0x00000409, 0x0000043a, 0x0, 0x0, 0x0 } }, - { MAORI, { 0x00000409, 0x00000481, 0x0, 0x0, 0x0 } }, - { MARATHI, { 0x00000409, 0x0000044e, 0x00000439, 0x0, 0x0 } }, - { MONGOLIAN, { 0x00000450, 0x00000409, 0x0, 0x0, 0x0 } }, - { NORWEGIAN_BOKMAL, { 0x00000414, 0x00000409, 0x0, 0x0, 0x0 } }, - { NORWEGIAN_NYNORSK, { 0x00000414, 0x00000409, 0x0, 0x0, 0x0 } }, - { POLISH, { 0x00010415, 0x00000415, 0x00000409, 0x0, 0x0 } }, - { PORTUGUESE_BRAZILIAN, { 0x00000416, 0x00000409, 0x0, 0x0, 0x0 } }, - { PORTUGUESE_STANDARD, { 0x00000816, 0x00000409, 0x0, 0x0, 0x0 } }, - { PUNJABI, { 0x00000409, 0x00000446, 0x00010439, 0x0, 0x0 } }, - { QUECHUA_BOLIVIA, { 0x00000409, 0x0000080A, 0x0, 0x0, 0x0 } }, - { QUECHUA_ECUADOR, { 0x00000409, 0x0000080A, 0x0, 0x0, 0x0 } }, - { QUECHUA_PERU, { 0x00000409, 0x0000080A, 0x0, 0x0, 0x0 } }, - { ROMANIAN, { 0x00000418, 0x00000409, 0x0, 0x0, 0x0 } }, - { RUSSIAN, { 0x00000419, 0x00000409, 0x0, 0x0, 0x0 } }, - { SAMI_INARI, { 0x0001083b, 0x00000409, 0x0, 0x0, 0x0 } }, - { SAMI_LULE_NORWAY, { 0x0000043b, 0x00000409, 0x0, 0x0, 0x0 } }, - { SAMI_LULE_SWEDEN, { 0x0000083b, 0x00000409, 0x0, 0x0, 0x0 } }, - { SAMI_NORTHERN_FINLAND, { 0x0001083b, 0x00000409, 0x0, 0x0, 0x0 } }, - { SAMI_NORTHERN_NORWAY, { 0x0000043b, 0x00000409, 0x0, 0x0, 0x0 } }, - { SAMI_NORTHERN_SWEDEN, { 0x0000083b, 0x00000409, 0x0, 0x0, 0x0 } }, - { SAMI_SKOLT, { 0x0001083b, 0x00000409, 0x0, 0x0, 0x0 } }, - { SAMI_SOUTHERN_NORWAY, { 0x0000043b, 0x00000409, 0x0, 0x0, 0x0 } }, - { SAMI_SOUTHERN_SWEDEN, { 0x0000083b, 0x00000409, 0x0, 0x0, 0x0 } }, - { SANSKRIT, { 0x00000409, 0x00000439, 0x0, 0x0, 0x0 } }, - { SERBIAN_LATIN, { 0x0000081a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SERBIAN_LATIN_BOSNIA_HERZEGOVINA, { 0x0000081a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SERBIAN_CYRILLIC, { 0x00000c1a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SERBIAN_CYRILLIC_BOSNIA_HERZEGOVINA, { 0x00000c1a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SLOVAK, { 0x0000041b, 0x00000409, 0x0, 0x0, 0x0 } }, - { SLOVENIAN, { 0x00000424, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_TRADITIONAL_SORT, { 0x0000040a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_MEXICAN, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_MODERN_SORT, { 0x0000040a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_GUATEMALA, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_COSTA_RICA, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_PANAMA, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_DOMINICAN_REPUBLIC, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_VENEZUELA, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_COLOMBIA, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_PERU, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_ARGENTINA, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_ECUADOR, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_CHILE, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_URUGUAY, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_PARAGUAY, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_BOLIVIA, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_EL_SALVADOR, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_HONDURAS, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_NICARAGUA, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SPANISH_PUERTO_RICO, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, - { SWAHILI, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, - { SWEDISH, { 0x0000041d, 0x00000409, 0x0, 0x0, 0x0 } }, - { SWEDISH_FINLAND, { 0x0000041d, 0x00000409, 0x0, 0x0, 0x0 } }, - { SYRIAC, { 0x00000409, 0x0000045a, 0x0, 0x0, 0x0 } }, - { TAMIL, { 0x00000409, 0x00000449, 0x0, 0x0, 0x0 } }, - { TATAR, { 0x00000444, 0x00000409, 0x00000419, 0x0, 0x0 } }, - { TELUGU, { 0x00000409, 0x0000044a, 0x00010439, 0x0, 0x0 } }, - { THAI, { 0x00000409, 0x0000041e, 0x0, 0x0, 0x0 } }, - { TSWANA, { 0x00000409, 0x0000041f, 0x0, 0x0, 0x0 } }, - { UKRAINIAN, { 0x00000422, 0x00000409, 0x0, 0x0, 0x0 } }, - { TURKISH, { 0x0000041f, 0x0000041f, 0x0, 0x0, 0x0 } }, - { UKRAINIAN, { 0x00000422, 0x00000409, 0x0, 0x0, 0x0 } }, - { URDU, { 0x00000401, 0x00000409, 0x0, 0x0, 0x0 } }, - { UZBEK_LATIN, { 0x00000409, 0x00000843, 0x00000419, 0x0, 0x0 } }, - { UZBEK_CYRILLIC, { 0x00000843, 0x00000409, 0x00000419, 0x0, 0x0 } }, - { VIETNAMESE, { 0x00000409, 0x0000042a, 0x0, 0x0, 0x0 } }, - { WELSH, { 0x00000452, 0x00000809, 0x0, 0x0, 0x0 } }, - { XHOSA, { 0x00000409, 0x00000409, 0x0, 0x0, 0x0 } }, +static const LOCALE_KEYBOARD_LAYOUTS LOCALE_KEYBOARD_LAYOUTS_TABLE[] = { + { AFRIKAANS, { 0x00000409, 0x00000409, 0x0, 0x0, 0x0 } }, + { ALBANIAN, { 0x0000041c, 0x00000409, 0x0, 0x0, 0x0 } }, + { ARABIC_SAUDI_ARABIA, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, + { ARABIC_IRAQ, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, + { ARABIC_EGYPT, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, + { ARABIC_LIBYA, { 0x0000040c, 0x00020401, 0x0, 0x0, 0x0 } }, + { ARABIC_ALGERIA, { 0x0000040c, 0x00020401, 0x0, 0x0, 0x0 } }, + { ARABIC_MOROCCO, { 0x0000040c, 0x00020401, 0x0, 0x0, 0x0 } }, + { ARABIC_TUNISIA, { 0x0000040c, 0x00020401, 0x0, 0x0, 0x0 } }, + { ARABIC_OMAN, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, + { ARABIC_YEMEN, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, + { ARABIC_SYRIA, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, + { ARABIC_JORDAN, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, + { ARABIC_LEBANON, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, + { ARABIC_KUWAIT, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, + { ARABIC_UAE, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, + { ARABIC_BAHRAIN, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, + { ARABIC_QATAR, { 0x00000409, 0x00000401, 0x0, 0x0, 0x0 } }, + { ARMENIAN, { 0x0000042b, 0x00000409, 0x00000419, 0x0, 0x0 } }, + { AZERI_LATIN, { 0x0000042c, 0x0000082c, 0x00000419, 0x0, 0x0 } }, + { AZERI_CYRILLIC, { 0x0000082c, 0x0000042c, 0x00000419, 0x0, 0x0 } }, + { BASQUE, { 0x0000040a, 0x00000409, 0x0, 0x0, 0x0 } }, + { BELARUSIAN, { 0x00000423, 0x00000409, 0x00000419, 0x0, 0x0 } }, + { BENGALI_INDIA, { 0x00000445, 0x00000409, 0x0, 0x0, 0x0 } }, + { BOSNIAN_LATIN, { 0x0000141A, 0x00000409, 0x0, 0x0, 0x0 } }, + { BULGARIAN, { 0x00000402, 0x00000409, 0x0, 0x0, 0x0 } }, + { CATALAN, { 0x0000040a, 0x00000409, 0x0, 0x0, 0x0 } }, + { CHINESE_TAIWAN, { 0x00000404, 0xe0080404, 0xE0010404, 0x0, 0x0 } }, + { CHINESE_PRC, { 0x00000804, 0xe00e0804, 0xe0010804, 0xe0030804, 0xe0040804 } }, + { CHINESE_HONG_KONG, { 0x00000409, 0xe0080404, 0x0, 0x0, 0x0 } }, + { CHINESE_SINGAPORE, { 0x00000409, 0xe00e0804, 0xe0010804, 0xe0030804, 0xe0040804 } }, + { CHINESE_MACAU, { 0x00000409, 0xe00e0804, 0xe0020404, 0xe0080404 } }, + { CROATIAN, { 0x0000041a, 0x00000409, 0x0, 0x0, 0x0 } }, + { CROATIAN_BOSNIA_HERZEGOVINA, { 0x0000041a, 0x00000409, 0x0, 0x0, 0x0 } }, + { CZECH, { 0x00000405, 0x00000409, 0x0, 0x0, 0x0 } }, + { DANISH, { 0x00000406, 0x00000409, 0x0, 0x0, 0x0 } }, + { DIVEHI, { 0x00000409, 0x00000465, 0x0, 0x0, 0x0 } }, + { DUTCH_STANDARD, { 0x00020409, 0x00000413, 0x00000409, 0x0, 0x0 } }, + { DUTCH_BELGIAN, { 0x00000813, 0x00000409, 0x0, 0x0, 0x0 } }, + { ENGLISH_UNITED_STATES, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, + { ENGLISH_UNITED_KINGDOM, { 0x00000809, 0x0, 0x0, 0x0, 0x0 } }, + { ENGLISH_AUSTRALIAN, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, + { ENGLISH_CANADIAN, { 0x00000409, 0x00011009, 0x00001009, 0x0, 0x0 } }, + { ENGLISH_NEW_ZEALAND, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, + { ENGLISH_IRELAND, { 0x00001809, 0x00011809, 0x0, 0x0, 0x0 } }, + { ENGLISH_SOUTH_AFRICA, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, + { ENGLISH_JAMAICA, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, + { ENGLISH_CARIBBEAN, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, + { ENGLISH_BELIZE, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, + { ENGLISH_TRINIDAD, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, + { ENGLISH_ZIMBABWE, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, + { ENGLISH_PHILIPPINES, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, + { ESTONIAN, { 0x00000425, 0x0, 0x0, 0x0, 0x0 } }, + { FAEROESE, { 0x00000406, 0x00000409, 0x0, 0x0, 0x0 } }, + { FARSI, { 0x00000409, 0x00000429, 0x00000401, 0x0, 0x0 } }, + { FINNISH, { 0x0000040b, 0x00000409, 0x0, 0x0, 0x0 } }, + { FRENCH_STANDARD, { 0x0000040c, 0x00000409, 0x0, 0x0, 0x0 } }, + { FRENCH_BELGIAN, { 0x0000080c, 0x00000409, 0x0, 0x0, 0x0 } }, + { FRENCH_CANADIAN, { 0x00000C0C, 0x00011009, 0x00000409, 0x0, 0x0 } }, + { FRENCH_SWISS, { 0x0000100c, 0x00000409, 0x0, 0x0, 0x0 } }, + { FRENCH_LUXEMBOURG, { 0x0000040c, 0x00000409, 0x0, 0x0, 0x0 } }, + { FRENCH_MONACO, { 0x0000040c, 0x00000409, 0x0, 0x0, 0x0 } }, + { GEORGIAN, { 0x00000437, 0x00000409, 0x00000419, 0x0, 0x0 } }, + { GALICIAN, { 0x0000040a, 0x00000409, 0x0, 0x0, 0x0 } }, + { GERMAN_STANDARD, { 0x00000407, 0x00000409, 0x0, 0x0, 0x0 } }, + { GERMAN_SWISS, { 0x00000807, 0x00000409, 0x0, 0x0, 0x0 } }, + { GERMAN_AUSTRIAN, { 0x00000407, 0x00000409, 0x0, 0x0, 0x0 } }, + { GERMAN_LUXEMBOURG, { 0x00000407, 0x00000409, 0x0, 0x0, 0x0 } }, + { GERMAN_LIECHTENSTEIN, { 0x00000407, 0x00000409, 0x0, 0x0, 0x0 } }, + { GREEK, { 0x00000408, 0x00000409, 0x0, 0x0, 0x0 } }, + { GUJARATI, { 0x00000409, 0x00000447, 0x00010439, 0x0, 0x0 } }, + { HEBREW, { 0x00000409, 0x0000040d, 0x0, 0x0, 0x0 } }, + { HINDI, { 0x00000409, 0x00010439, 0x00000439, 0x0, 0x0 } }, + { HUNGARIAN, { 0x0000040e, 0x00000409, 0x0, 0x0, 0x0 } }, + { ICELANDIC, { 0x0000040f, 0x00000409, 0x0, 0x0, 0x0 } }, + { INDONESIAN, { 0x00000409, 0x00000409, 0x0, 0x0, 0x0 } }, + { ITALIAN_STANDARD, { 0x00000410, 0x00000409, 0x0, 0x0, 0x0 } }, + { ITALIAN_SWISS, { 0x00000410, 0x00000409, 0x0, 0x0, 0x0 } }, + { JAPANESE, { 0xe0010411, 0x0, 0x0, 0x0, 0x0 } }, + { KANNADA, { 0x00000409, 0x0000044b, 0x00010439, 0x0, 0x0 } }, + { KAZAKH, { 0x0000043f, 0x00000409, 0x00000419, 0x0, 0x0 } }, + { KONKANI, { 0x00000409, 0x00000439, 0x0, 0x0, 0x0 } }, + { KOREAN, { 0xE0010412, 0x0, 0x0, 0x0, 0x0 } }, + { KYRGYZ, { 0x00000440, 0x00000409, 0x0, 0x0, 0x0 } }, + { LATVIAN, { 0x00010426, 0x0, 0x0, 0x0, 0x0 } }, + { LITHUANIAN, { 0x00010427, 0x0, 0x0, 0x0, 0x0 } }, + { MACEDONIAN, { 0x0000042f, 0x00000409, 0x0, 0x0, 0x0 } }, + { MALAY_MALAYSIA, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, + { MALAY_BRUNEI_DARUSSALAM, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, + { MALAYALAM, { 0x00000409, 0x0000044c, 0x0, 0x0, 0x0 } }, + { MALTESE, { 0x00000409, 0x0000043a, 0x0, 0x0, 0x0 } }, + { MAORI, { 0x00000409, 0x00000481, 0x0, 0x0, 0x0 } }, + { MARATHI, { 0x00000409, 0x0000044e, 0x00000439, 0x0, 0x0 } }, + { MONGOLIAN, { 0x00000450, 0x00000409, 0x0, 0x0, 0x0 } }, + { NORWEGIAN_BOKMAL, { 0x00000414, 0x00000409, 0x0, 0x0, 0x0 } }, + { NORWEGIAN_NYNORSK, { 0x00000414, 0x00000409, 0x0, 0x0, 0x0 } }, + { POLISH, { 0x00010415, 0x00000415, 0x00000409, 0x0, 0x0 } }, + { PORTUGUESE_BRAZILIAN, { 0x00000416, 0x00000409, 0x0, 0x0, 0x0 } }, + { PORTUGUESE_STANDARD, { 0x00000816, 0x00000409, 0x0, 0x0, 0x0 } }, + { PUNJABI, { 0x00000409, 0x00000446, 0x00010439, 0x0, 0x0 } }, + { QUECHUA_BOLIVIA, { 0x00000409, 0x0000080A, 0x0, 0x0, 0x0 } }, + { QUECHUA_ECUADOR, { 0x00000409, 0x0000080A, 0x0, 0x0, 0x0 } }, + { QUECHUA_PERU, { 0x00000409, 0x0000080A, 0x0, 0x0, 0x0 } }, + { ROMANIAN, { 0x00000418, 0x00000409, 0x0, 0x0, 0x0 } }, + { RUSSIAN, { 0x00000419, 0x00000409, 0x0, 0x0, 0x0 } }, + { SAMI_INARI, { 0x0001083b, 0x00000409, 0x0, 0x0, 0x0 } }, + { SAMI_LULE_NORWAY, { 0x0000043b, 0x00000409, 0x0, 0x0, 0x0 } }, + { SAMI_LULE_SWEDEN, { 0x0000083b, 0x00000409, 0x0, 0x0, 0x0 } }, + { SAMI_NORTHERN_FINLAND, { 0x0001083b, 0x00000409, 0x0, 0x0, 0x0 } }, + { SAMI_NORTHERN_NORWAY, { 0x0000043b, 0x00000409, 0x0, 0x0, 0x0 } }, + { SAMI_NORTHERN_SWEDEN, { 0x0000083b, 0x00000409, 0x0, 0x0, 0x0 } }, + { SAMI_SKOLT, { 0x0001083b, 0x00000409, 0x0, 0x0, 0x0 } }, + { SAMI_SOUTHERN_NORWAY, { 0x0000043b, 0x00000409, 0x0, 0x0, 0x0 } }, + { SAMI_SOUTHERN_SWEDEN, { 0x0000083b, 0x00000409, 0x0, 0x0, 0x0 } }, + { SANSKRIT, { 0x00000409, 0x00000439, 0x0, 0x0, 0x0 } }, + { SERBIAN_LATIN, { 0x0000081a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SERBIAN_LATIN_BOSNIA_HERZEGOVINA, { 0x0000081a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SERBIAN_CYRILLIC, { 0x00000c1a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SERBIAN_CYRILLIC_BOSNIA_HERZEGOVINA, { 0x00000c1a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SLOVAK, { 0x0000041b, 0x00000409, 0x0, 0x0, 0x0 } }, + { SLOVENIAN, { 0x00000424, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_TRADITIONAL_SORT, { 0x0000040a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_MEXICAN, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_MODERN_SORT, { 0x0000040a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_GUATEMALA, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_COSTA_RICA, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_PANAMA, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_DOMINICAN_REPUBLIC, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_VENEZUELA, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_COLOMBIA, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_PERU, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_ARGENTINA, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_ECUADOR, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_CHILE, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_URUGUAY, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_PARAGUAY, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_BOLIVIA, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_EL_SALVADOR, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_HONDURAS, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_NICARAGUA, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SPANISH_PUERTO_RICO, { 0x0000080a, 0x00000409, 0x0, 0x0, 0x0 } }, + { SWAHILI, { 0x00000409, 0x0, 0x0, 0x0, 0x0 } }, + { SWEDISH, { 0x0000041d, 0x00000409, 0x0, 0x0, 0x0 } }, + { SWEDISH_FINLAND, { 0x0000041d, 0x00000409, 0x0, 0x0, 0x0 } }, + { SYRIAC, { 0x00000409, 0x0000045a, 0x0, 0x0, 0x0 } }, + { TAMIL, { 0x00000409, 0x00000449, 0x0, 0x0, 0x0 } }, + { TATAR, { 0x00000444, 0x00000409, 0x00000419, 0x0, 0x0 } }, + { TELUGU, { 0x00000409, 0x0000044a, 0x00010439, 0x0, 0x0 } }, + { THAI, { 0x00000409, 0x0000041e, 0x0, 0x0, 0x0 } }, + { TSWANA, { 0x00000409, 0x0000041f, 0x0, 0x0, 0x0 } }, + { UKRAINIAN, { 0x00000422, 0x00000409, 0x0, 0x0, 0x0 } }, + { TURKISH, { 0x0000041f, 0x0000041f, 0x0, 0x0, 0x0 } }, + { UKRAINIAN, { 0x00000422, 0x00000409, 0x0, 0x0, 0x0 } }, + { URDU, { 0x00000401, 0x00000409, 0x0, 0x0, 0x0 } }, + { UZBEK_LATIN, { 0x00000409, 0x00000843, 0x00000419, 0x0, 0x0 } }, + { UZBEK_CYRILLIC, { 0x00000843, 0x00000409, 0x00000419, 0x0, 0x0 } }, + { VIETNAMESE, { 0x00000409, 0x0000042a, 0x0, 0x0, 0x0 } }, + { WELSH, { 0x00000452, 0x00000809, 0x0, 0x0, 0x0 } }, + { XHOSA, { 0x00000409, 0x00000409, 0x0, 0x0, 0x0 } }, }; static BOOL freerdp_get_system_language_and_country_codes(char* language, char* country) @@ -644,13 +655,13 @@ static BOOL freerdp_get_system_language_and_country_codes(char* language, char* if (!nSize) return FALSE; /* LANG environment variable was not set */ - env_lang = (char*) malloc(nSize); + env_lang = (char*)malloc(nSize); if (!env_lang) return FALSE; - if (GetEnvironmentVariableA(lang, env_lang, - nSize) != nSize - 1) /* Get locale from environment variable LANG */ + if (GetEnvironmentVariableA(lang, env_lang, nSize) != + nSize - 1) /* Get locale from environment variable LANG */ { free(env_lang); return FALSE; @@ -701,7 +712,7 @@ static SYSTEM_LOCALE* freerdp_detect_system_locale(void) if ((strcmp(language, SYSTEM_LOCALE_TABLE[i].language) == 0) && (strcmp(country, SYSTEM_LOCALE_TABLE[i].country) == 0)) { - locale = (SYSTEM_LOCALE*) &SYSTEM_LOCALE_TABLE[i]; + locale = (SYSTEM_LOCALE*)&SYSTEM_LOCALE_TABLE[i]; break; } } diff --git a/libfreerdp/locale/xkb_layout_ids.c b/libfreerdp/locale/xkb_layout_ids.c index 76b795403..ce0810b1c 100644 --- a/libfreerdp/locale/xkb_layout_ids.c +++ b/libfreerdp/locale/xkb_layout_ids.c @@ -33,14 +33,14 @@ struct _XKB_VARIANT { - const char* variant; /* XKB Keyboard layout variant */ + const char* variant; /* XKB Keyboard layout variant */ UINT32 keyboardLayoutID; /* Keyboard Layout ID */ }; typedef struct _XKB_VARIANT XKB_VARIANT; struct _XKB_LAYOUT { - const char* layout; /* XKB Keyboard layout */ + const char* layout; /* XKB Keyboard layout */ UINT32 keyboardLayoutID; /* Keyboard Layout ID */ const XKB_VARIANT* variants; }; @@ -49,851 +49,784 @@ typedef struct _XKB_LAYOUT XKB_LAYOUT; /* Those have been generated automatically and are waiting to be filled by hand */ /* USA */ -static const XKB_VARIANT us_variants[] = -{ - { "chr", 0 }, /* Cherokee */ - { "euro", 0 }, /* With EuroSign on 5 */ - { "intl", KBD_UNITED_STATES_INTERNATIONAL }, /* International (with dead keys) */ - { "alt-intl", KBD_UNITED_STATES_INTERNATIONAL }, /* Alternative international (former us_intl) */ - { "colemak", 0 }, /* Colemak */ - { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ - { "dvorak-intl", KBD_UNITED_STATES_DVORAK }, /* Dvorak international */ - { "dvorak-l", KBD_UNITED_STATES_DVORAK_FOR_LEFT_HAND }, /* Left handed Dvorak */ - { "dvorak-r", KBD_UNITED_STATES_DVORAK_FOR_RIGHT_HAND }, /* Right handed Dvorak */ - { "dvorak-classic", KBD_UNITED_STATES_DVORAK }, /* Classic Dvorak */ - { "dvp", KBD_UNITED_STATES_DVORAK_PROGRAMMER }, /* Programmer Dvorak */ - { "rus", 0 }, /* Russian phonetic */ - { "mac", KBD_US }, /* Macintosh */ - { "altgr-intl", KBD_UNITED_STATES_INTERNATIONAL }, /* International (AltGr dead keys) */ - { "olpc2", KBD_US }, /* Group toggle on multiply/divide key */ - { "", 0 }, +static const XKB_VARIANT us_variants[] = { + { "chr", 0 }, /* Cherokee */ + { "euro", 0 }, /* With EuroSign on 5 */ + { "intl", KBD_UNITED_STATES_INTERNATIONAL }, /* International (with dead keys) */ + { "alt-intl", + KBD_UNITED_STATES_INTERNATIONAL }, /* Alternative international (former us_intl) */ + { "colemak", 0 }, /* Colemak */ + { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ + { "dvorak-intl", KBD_UNITED_STATES_DVORAK }, /* Dvorak international */ + { "dvorak-l", KBD_UNITED_STATES_DVORAK_FOR_LEFT_HAND }, /* Left handed Dvorak */ + { "dvorak-r", KBD_UNITED_STATES_DVORAK_FOR_RIGHT_HAND }, /* Right handed Dvorak */ + { "dvorak-classic", KBD_UNITED_STATES_DVORAK }, /* Classic Dvorak */ + { "dvp", KBD_UNITED_STATES_DVORAK_PROGRAMMER }, /* Programmer Dvorak */ + { "rus", 0 }, /* Russian phonetic */ + { "mac", KBD_US }, /* Macintosh */ + { "altgr-intl", KBD_UNITED_STATES_INTERNATIONAL }, /* International (AltGr dead keys) */ + { "olpc2", KBD_US }, /* Group toggle on multiply/divide key */ + { "", 0 }, }; /* Afghanistan */ -static const XKB_VARIANT af_variants[] = -{ - { "ps", KBD_PASHTO }, /* Pashto */ - { "uz", KBD_UZBEK_CYRILLIC }, /* Southern Uzbek */ - { "olpc-ps", KBD_PASHTO }, /* OLPC Pashto */ - { "olpc-fa", 0 }, /* OLPC Dari */ - { "olpc-uz", KBD_UZBEK_CYRILLIC }, /* OLPC Southern Uzbek */ - { "", 0 }, +static const XKB_VARIANT af_variants[] = { + { "ps", KBD_PASHTO }, /* Pashto */ + { "uz", KBD_UZBEK_CYRILLIC }, /* Southern Uzbek */ + { "olpc-ps", KBD_PASHTO }, /* OLPC Pashto */ + { "olpc-fa", 0 }, /* OLPC Dari */ + { "olpc-uz", KBD_UZBEK_CYRILLIC }, /* OLPC Southern Uzbek */ + { "", 0 }, }; /* Arabic */ -static const XKB_VARIANT ara_variants[] = -{ - { "azerty", KBD_ARABIC_102_AZERTY }, /* azerty */ - { "azerty_digits", KBD_ARABIC_102_AZERTY }, /* azerty/digits */ - { "digits", KBD_ARABIC_102_AZERTY }, /* digits */ - { "qwerty", KBD_ARABIC_101 }, /* qwerty */ - { "qwerty_digits", KBD_ARABIC_101 }, /* qwerty/digits */ - { "buckwalter", KBD_US_ENGLISH_TABLE_FOR_IBM_ARABIC_238_L }, /* Buckwalter */ - { "", 0 }, +static const XKB_VARIANT ara_variants[] = { + { "azerty", KBD_ARABIC_102_AZERTY }, /* azerty */ + { "azerty_digits", KBD_ARABIC_102_AZERTY }, /* azerty/digits */ + { "digits", KBD_ARABIC_102_AZERTY }, /* digits */ + { "qwerty", KBD_ARABIC_101 }, /* qwerty */ + { "qwerty_digits", KBD_ARABIC_101 }, /* qwerty/digits */ + { "buckwalter", KBD_US_ENGLISH_TABLE_FOR_IBM_ARABIC_238_L }, /* Buckwalter */ + { "", 0 }, }; /* Armenia */ -static const XKB_VARIANT am_variants[] = -{ - { "phonetic", 0 }, /* Phonetic */ - { "phonetic-alt", 0 }, /* Alternative Phonetic */ - { "eastern", KBD_ARMENIAN_EASTERN }, /* Eastern */ - { "western", KBD_ARMENIAN_WESTERN }, /* Western */ - { "eastern-alt", KBD_ARMENIAN_EASTERN }, /* Alternative Eastern */ - { "", 0 }, +static const XKB_VARIANT am_variants[] = { + { "phonetic", 0 }, /* Phonetic */ + { "phonetic-alt", 0 }, /* Alternative Phonetic */ + { "eastern", KBD_ARMENIAN_EASTERN }, /* Eastern */ + { "western", KBD_ARMENIAN_WESTERN }, /* Western */ + { "eastern-alt", KBD_ARMENIAN_EASTERN }, /* Alternative Eastern */ + { "", 0 }, }; /* Azerbaijan */ -static const XKB_VARIANT az_variants[] = -{ - { "cyrillic", KBD_AZERI_CYRILLIC }, /* Cyrillic */ - { "", 0 }, +static const XKB_VARIANT az_variants[] = { + { "cyrillic", KBD_AZERI_CYRILLIC }, /* Cyrillic */ + { "", 0 }, }; /* Belarus */ -static const XKB_VARIANT by_variants[] = -{ - { "winkeys", KBD_BELARUSIAN }, /* Winkeys */ - { "latin", KBD_BELARUSIAN }, /* Latin */ - { "", 0 }, +static const XKB_VARIANT by_variants[] = { + { "winkeys", KBD_BELARUSIAN }, /* Winkeys */ + { "latin", KBD_BELARUSIAN }, /* Latin */ + { "", 0 }, }; /* Belgium */ -static const XKB_VARIANT be_variants[] = -{ - { "oss", KBD_BELGIAN_FRENCH }, /* Alternative */ - { "oss_latin9", KBD_BELGIAN_FRENCH }, /* Alternative, latin-9 only */ - { "oss_sundeadkeys", KBD_BELGIAN_PERIOD }, /* Alternative, Sun dead keys */ - { "iso-alternate", KBD_BELGIAN_COMMA }, /* ISO Alternate */ - { "nodeadkeys", KBD_BELGIAN_COMMA }, /* Eliminate dead keys */ - { "sundeadkeys", KBD_BELGIAN_PERIOD }, /* Sun dead keys */ - { "wang", KBD_BELGIAN_FRENCH }, /* Wang model 724 azerty */ - { "", 0 }, +static const XKB_VARIANT be_variants[] = { + { "oss", KBD_BELGIAN_FRENCH }, /* Alternative */ + { "oss_latin9", KBD_BELGIAN_FRENCH }, /* Alternative, latin-9 only */ + { "oss_sundeadkeys", KBD_BELGIAN_PERIOD }, /* Alternative, Sun dead keys */ + { "iso-alternate", KBD_BELGIAN_COMMA }, /* ISO Alternate */ + { "nodeadkeys", KBD_BELGIAN_COMMA }, /* Eliminate dead keys */ + { "sundeadkeys", KBD_BELGIAN_PERIOD }, /* Sun dead keys */ + { "wang", KBD_BELGIAN_FRENCH }, /* Wang model 724 azerty */ + { "", 0 }, }; /* Bangladesh */ -static const XKB_VARIANT bd_variants[] = -{ - { "probhat", KBD_BENGALI_INSCRIPT }, /* Probhat */ - { "", 0 }, +static const XKB_VARIANT bd_variants[] = { + { "probhat", KBD_BENGALI_INSCRIPT }, /* Probhat */ + { "", 0 }, }; /* India */ -static const XKB_VARIANT in_variants[] = -{ - { "ben", KBD_BENGALI }, /* Bengali */ - { "ben_probhat", KBD_BENGALI_INSCRIPT }, /* Bengali Probhat */ - { "guj", KBD_GUJARATI }, /* Gujarati */ - { "guru", 0 }, /* Gurmukhi */ - { "jhelum", 0 }, /* Gurmukhi Jhelum */ - { "kan", KBD_KANNADA }, /* Kannada */ - { "mal", KBD_MALAYALAM }, /* Malayalam */ - { "mal_lalitha", KBD_MALAYALAM }, /* Malayalam Lalitha */ - { "ori", 0 }, /* Oriya */ - { "tam_unicode", KBD_TAMIL }, /* Tamil Unicode */ - { "tam_TAB", KBD_TAMIL }, /* Tamil TAB Typewriter */ - { "tam_TSCII", KBD_TAMIL }, /* Tamil TSCII Typewriter */ - { "tam", KBD_TAMIL }, /* Tamil */ - { "tel", KBD_TELUGU }, /* Telugu */ - { "urd-phonetic", KBD_URDU }, /* Urdu, Phonetic */ - { "urd-phonetic3", KBD_URDU }, /* Urdu, Alternative phonetic */ - { "urd-winkeys", KBD_URDU }, /* Urdu, Winkeys */ - { "bolnagri", KBD_HINDI_TRADITIONAL }, /* Hindi Bolnagri */ - { "hin-wx", KBD_HINDI_TRADITIONAL }, /* Hindi Wx */ - { "", 0 }, +static const XKB_VARIANT in_variants[] = { + { "ben", KBD_BENGALI }, /* Bengali */ + { "ben_probhat", KBD_BENGALI_INSCRIPT }, /* Bengali Probhat */ + { "guj", KBD_GUJARATI }, /* Gujarati */ + { "guru", 0 }, /* Gurmukhi */ + { "jhelum", 0 }, /* Gurmukhi Jhelum */ + { "kan", KBD_KANNADA }, /* Kannada */ + { "mal", KBD_MALAYALAM }, /* Malayalam */ + { "mal_lalitha", KBD_MALAYALAM }, /* Malayalam Lalitha */ + { "ori", 0 }, /* Oriya */ + { "tam_unicode", KBD_TAMIL }, /* Tamil Unicode */ + { "tam_TAB", KBD_TAMIL }, /* Tamil TAB Typewriter */ + { "tam_TSCII", KBD_TAMIL }, /* Tamil TSCII Typewriter */ + { "tam", KBD_TAMIL }, /* Tamil */ + { "tel", KBD_TELUGU }, /* Telugu */ + { "urd-phonetic", KBD_URDU }, /* Urdu, Phonetic */ + { "urd-phonetic3", KBD_URDU }, /* Urdu, Alternative phonetic */ + { "urd-winkeys", KBD_URDU }, /* Urdu, Winkeys */ + { "bolnagri", KBD_HINDI_TRADITIONAL }, /* Hindi Bolnagri */ + { "hin-wx", KBD_HINDI_TRADITIONAL }, /* Hindi Wx */ + { "", 0 }, }; /* Bosnia and Herzegovina */ -static const XKB_VARIANT ba_variants[] = -{ - { "alternatequotes", KBD_BOSNIAN }, /* Use guillemets for quotes */ - { "unicode", KBD_BOSNIAN }, /* Use Bosnian digraphs */ - { "unicodeus", KBD_BOSNIAN }, /* US keyboard with Bosnian digraphs */ - { "us", KBD_BOSNIAN_CYRILLIC }, /* US keyboard with Bosnian letters */ - { "", 0 }, +static const XKB_VARIANT ba_variants[] = { + { "alternatequotes", KBD_BOSNIAN }, /* Use guillemets for quotes */ + { "unicode", KBD_BOSNIAN }, /* Use Bosnian digraphs */ + { "unicodeus", KBD_BOSNIAN }, /* US keyboard with Bosnian digraphs */ + { "us", KBD_BOSNIAN_CYRILLIC }, /* US keyboard with Bosnian letters */ + { "", 0 }, }; /* Brazil */ -static const XKB_VARIANT br_variants[] = -{ - { "nodeadkeys", KBD_PORTUGUESE_BRAZILIAN_ABNT2 }, /* Eliminate dead keys */ - { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ - { "nativo", KBD_PORTUGUESE_BRAZILIAN_ABNT2 }, /* Nativo */ - { "nativo-us", KBD_PORTUGUESE_BRAZILIAN_ABNT2 }, /* Nativo for USA keyboards */ - { "nativo-epo", KBD_PORTUGUESE_BRAZILIAN_ABNT2 }, /* Nativo for Esperanto */ - { "", 0 }, +static const XKB_VARIANT br_variants[] = { + { "nodeadkeys", KBD_PORTUGUESE_BRAZILIAN_ABNT2 }, /* Eliminate dead keys */ + { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ + { "nativo", KBD_PORTUGUESE_BRAZILIAN_ABNT2 }, /* Nativo */ + { "nativo-us", KBD_PORTUGUESE_BRAZILIAN_ABNT2 }, /* Nativo for USA keyboards */ + { "nativo-epo", KBD_PORTUGUESE_BRAZILIAN_ABNT2 }, /* Nativo for Esperanto */ + { "", 0 }, }; /* Bulgaria */ -static const XKB_VARIANT bg_variants[] = -{ - { "phonetic", KBD_BULGARIAN_LATIN }, /* Traditional Phonetic */ - { "bas_phonetic", KBD_BULGARIAN_LATIN }, /* Standard Phonetic */ - { "", 0 }, +static const XKB_VARIANT bg_variants[] = { + { "phonetic", KBD_BULGARIAN_LATIN }, /* Traditional Phonetic */ + { "bas_phonetic", KBD_BULGARIAN_LATIN }, /* Standard Phonetic */ + { "", 0 }, }; /* Morocco */ -static const XKB_VARIANT ma_variants[] = -{ - { "french", KBD_FRENCH }, /* French */ - { "tifinagh", 0 }, /* Tifinagh */ - { "tifinagh-alt", 0 }, /* Tifinagh Alternative */ - { "tifinagh-alt-phonetic", 0 }, /* Tifinagh Alternative Phonetic */ - { "tifinagh-extended", 0 }, /* Tifinagh Extended */ - { "tifinagh-phonetic", 0 }, /* Tifinagh Phonetic */ - { "tifinagh-extended-phonetic", 0 }, /* Tifinagh Extended Phonetic */ - { "", 0 }, +static const XKB_VARIANT ma_variants[] = { + { "french", KBD_FRENCH }, /* French */ + { "tifinagh", 0 }, /* Tifinagh */ + { "tifinagh-alt", 0 }, /* Tifinagh Alternative */ + { "tifinagh-alt-phonetic", 0 }, /* Tifinagh Alternative Phonetic */ + { "tifinagh-extended", 0 }, /* Tifinagh Extended */ + { "tifinagh-phonetic", 0 }, /* Tifinagh Phonetic */ + { "tifinagh-extended-phonetic", 0 }, /* Tifinagh Extended Phonetic */ + { "", 0 }, }; /* Canada */ -static const XKB_VARIANT ca_variants[] = -{ - { "fr", KBD_CANADIAN_FRENCH }, /* French Dvorak */ - { "fr-dvorak", KBD_UNITED_STATES_DVORAK }, /* French Dvorak */ - { "fr-legacy", KBD_CANADIAN_FRENCH_LEGACY }, /* French (legacy) */ - { "multix", KBD_CANADIAN_MULTILINGUAL_STANDARD }, /* Multilingual */ - { "multi", KBD_CANADIAN_MULTILINGUAL_STANDARD }, /* Multilingual, first part */ - { "multi-2gr", KBD_CANADIAN_MULTILINGUAL_STANDARD }, /* Multilingual, second part */ - { "ike", KBD_INUKTITUT_LATIN }, /* Inuktitut */ - { "shs", 0 }, /* Secwepemctsin */ - { "kut", 0 }, /* Ktunaxa */ - { "", 0 }, +static const XKB_VARIANT ca_variants[] = { + { "fr", KBD_CANADIAN_FRENCH }, /* French Dvorak */ + { "fr-dvorak", KBD_UNITED_STATES_DVORAK }, /* French Dvorak */ + { "fr-legacy", KBD_CANADIAN_FRENCH_LEGACY }, /* French (legacy) */ + { "multix", KBD_CANADIAN_MULTILINGUAL_STANDARD }, /* Multilingual */ + { "multi", KBD_CANADIAN_MULTILINGUAL_STANDARD }, /* Multilingual, first part */ + { "multi-2gr", KBD_CANADIAN_MULTILINGUAL_STANDARD }, /* Multilingual, second part */ + { "ike", KBD_INUKTITUT_LATIN }, /* Inuktitut */ + { "shs", 0 }, /* Secwepemctsin */ + { "kut", 0 }, /* Ktunaxa */ + { "", 0 }, }; /* China */ -static const XKB_VARIANT cn_variants[] = -{ - { "tib", 0 }, /* Tibetan */ - { "tib_asciinum", 0 }, /* Tibetan (with ASCII numerals) */ - { "", 0 }, +static const XKB_VARIANT cn_variants[] = { + { "tib", 0 }, /* Tibetan */ + { "tib_asciinum", 0 }, /* Tibetan (with ASCII numerals) */ + { "", 0 }, }; /* Croatia */ -static const XKB_VARIANT hr_variants[] = -{ - { "alternatequotes", KBD_CROATIAN }, /* Use guillemets for quotes */ - { "unicode", KBD_CROATIAN }, /* Use Croatian digraphs */ - { "unicodeus", KBD_CROATIAN }, /* US keyboard with Croatian digraphs */ - { "us", KBD_CROATIAN }, /* US keyboard with Croatian letters */ - { "", 0 }, +static const XKB_VARIANT hr_variants[] = { + { "alternatequotes", KBD_CROATIAN }, /* Use guillemets for quotes */ + { "unicode", KBD_CROATIAN }, /* Use Croatian digraphs */ + { "unicodeus", KBD_CROATIAN }, /* US keyboard with Croatian digraphs */ + { "us", KBD_CROATIAN }, /* US keyboard with Croatian letters */ + { "", 0 }, }; /* Czechia */ -static const XKB_VARIANT cz_variants[] = -{ - { "bksl", KBD_CZECH_PROGRAMMERS }, /* With <\|> key */ - { "qwerty", KBD_CZECH_QWERTY }, /* qwerty */ - { "qwerty_bksl", KBD_CZECH_QWERTY }, /* qwerty, extended Backslash */ - { "ucw", KBD_CZECH }, /* UCW layout (accented letters only) */ - { "", 0 }, +static const XKB_VARIANT cz_variants[] = { + { "bksl", KBD_CZECH_PROGRAMMERS }, /* With <\|> key */ + { "qwerty", KBD_CZECH_QWERTY }, /* qwerty */ + { "qwerty_bksl", KBD_CZECH_QWERTY }, /* qwerty, extended Backslash */ + { "ucw", KBD_CZECH }, /* UCW layout (accented letters only) */ + { "", 0 }, }; /* Denmark */ -static const XKB_VARIANT dk_variants[] = -{ - { "nodeadkeys", KBD_DANISH }, /* Eliminate dead keys */ - { "mac", KBD_DANISH }, /* Macintosh */ - { "mac_nodeadkeys", KBD_DANISH }, /* Macintosh, eliminate dead keys */ - { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ - { "", 0 }, +static const XKB_VARIANT dk_variants[] = { + { "nodeadkeys", KBD_DANISH }, /* Eliminate dead keys */ + { "mac", KBD_DANISH }, /* Macintosh */ + { "mac_nodeadkeys", KBD_DANISH }, /* Macintosh, eliminate dead keys */ + { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ + { "", 0 }, }; /* Netherlands */ -static const XKB_VARIANT nl_variants[] = -{ - { "sundeadkeys", KBD_SWISS_FRENCH }, /* Sun dead keys */ - { "mac", KBD_SWISS_FRENCH }, /* Macintosh */ - { "std", KBD_SWISS_FRENCH }, /* Standard */ - { "", 0 }, +static const XKB_VARIANT nl_variants[] = { + { "sundeadkeys", KBD_SWISS_FRENCH }, /* Sun dead keys */ + { "mac", KBD_SWISS_FRENCH }, /* Macintosh */ + { "std", KBD_SWISS_FRENCH }, /* Standard */ + { "", 0 }, }; /* Estonia */ -static const XKB_VARIANT ee_variants[] = -{ - { "nodeadkeys", KBD_US }, /* Eliminate dead keys */ - { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ - { "us", KBD_UNITED_STATES_INTERNATIONAL }, /* US keyboard with Estonian letters */ - { "", 0 }, +static const XKB_VARIANT ee_variants[] = { + { "nodeadkeys", KBD_US }, /* Eliminate dead keys */ + { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ + { "us", KBD_UNITED_STATES_INTERNATIONAL }, /* US keyboard with Estonian letters */ + { "", 0 }, }; /* Iran */ -static const XKB_VARIANT ir_variants[] = -{ - { "pro", 0 }, /* Pro */ - { "keypad", 0 }, /* Keypad */ - { "pro_keypad", 0 }, /* Pro Keypad */ - { "ku", 0 }, /* Kurdish, Latin Q */ - { "ku_f", 0 }, /* Kurdish, (F) */ - { "ku_alt", 0 }, /* Kurdish, Latin Alt-Q */ - { "ku_ara", 0 }, /* Kurdish, Arabic-Latin */ - { "", 0 }, +static const XKB_VARIANT ir_variants[] = { + { "pro", 0 }, /* Pro */ + { "keypad", 0 }, /* Keypad */ + { "pro_keypad", 0 }, /* Pro Keypad */ + { "ku", 0 }, /* Kurdish, Latin Q */ + { "ku_f", 0 }, /* Kurdish, (F) */ + { "ku_alt", 0 }, /* Kurdish, Latin Alt-Q */ + { "ku_ara", 0 }, /* Kurdish, Arabic-Latin */ + { "", 0 }, }; /* Iraq */ -static const XKB_VARIANT iq_variants[] = -{ - { "ku", 0 }, /* Kurdish, Latin Q */ - { "ku_f", 0 }, /* Kurdish, (F) */ - { "ku_alt", 0 }, /* Kurdish, Latin Alt-Q */ - { "ku_ara", 0 }, /* Kurdish, Arabic-Latin */ - { "", 0 }, +static const XKB_VARIANT iq_variants[] = { + { "ku", 0 }, /* Kurdish, Latin Q */ + { "ku_f", 0 }, /* Kurdish, (F) */ + { "ku_alt", 0 }, /* Kurdish, Latin Alt-Q */ + { "ku_ara", 0 }, /* Kurdish, Arabic-Latin */ + { "", 0 }, }; /* Faroe Islands */ -static const XKB_VARIANT fo_variants[] = -{ - { "nodeadkeys", 0 }, /* Eliminate dead keys */ - { "", 0 }, +static const XKB_VARIANT fo_variants[] = { + { "nodeadkeys", 0 }, /* Eliminate dead keys */ + { "", 0 }, }; /* Finland */ -static const XKB_VARIANT fi_variants[] = -{ - { "nodeadkeys", 0 }, /* Eliminate dead keys */ - { "smi", 0 }, /* Northern Saami */ - { "classic", 0 }, /* Classic */ - { "mac", 0 }, /* Macintosh */ - { "", 0 }, +static const XKB_VARIANT fi_variants[] = { + { "nodeadkeys", 0 }, /* Eliminate dead keys */ + { "smi", 0 }, /* Northern Saami */ + { "classic", 0 }, /* Classic */ + { "mac", 0 }, /* Macintosh */ + { "", 0 }, }; /* France */ -static const XKB_VARIANT fr_variants[] = -{ - { "nodeadkeys", 0 }, /* Eliminate dead keys */ - { "sundeadkeys", 0 }, /* Sun dead keys */ - { "oss", 0 }, /* Alternative */ - { "oss_latin9", 0 }, /* Alternative, latin-9 only */ - { "oss_nodeadkeys", 0 }, /* Alternative, eliminate dead keys */ - { "oss_sundeadkeys", 0 }, /* Alternative, Sun dead keys */ - { "latin9", 0 }, /* (Legacy) Alternative */ - { "latin9_nodeadkeys", 0 }, /* (Legacy) Alternative, eliminate dead keys */ - { "latin9_sundeadkeys", 0 }, /* (Legacy) Alternative, Sun dead keys */ - { "bepo", KBD_FRENCH_BEPO }, /* Bepo, ergonomic, Dvorak way */ - { "bepo_latin9", 0 }, /* Bepo, ergonomic, Dvorak way, latin-9 only */ - { "dvorak", 0 }, /* Dvorak */ - { "mac", 0 }, /* Macintosh */ - { "bre", 0 }, /* Breton */ - { "oci", 0 }, /* Occitan */ - { "geo", 0 }, /* Georgian AZERTY Tskapo */ - { "", 0 }, +static const XKB_VARIANT fr_variants[] = { + { "nodeadkeys", 0 }, /* Eliminate dead keys */ + { "sundeadkeys", 0 }, /* Sun dead keys */ + { "oss", 0 }, /* Alternative */ + { "oss_latin9", 0 }, /* Alternative, latin-9 only */ + { "oss_nodeadkeys", 0 }, /* Alternative, eliminate dead keys */ + { "oss_sundeadkeys", 0 }, /* Alternative, Sun dead keys */ + { "latin9", 0 }, /* (Legacy) Alternative */ + { "latin9_nodeadkeys", 0 }, /* (Legacy) Alternative, eliminate dead keys */ + { "latin9_sundeadkeys", 0 }, /* (Legacy) Alternative, Sun dead keys */ + { "bepo", KBD_FRENCH_BEPO }, /* Bepo, ergonomic, Dvorak way */ + { "bepo_latin9", 0 }, /* Bepo, ergonomic, Dvorak way, latin-9 only */ + { "dvorak", 0 }, /* Dvorak */ + { "mac", 0 }, /* Macintosh */ + { "bre", 0 }, /* Breton */ + { "oci", 0 }, /* Occitan */ + { "geo", 0 }, /* Georgian AZERTY Tskapo */ + { "", 0 }, }; /* Ghana */ -static const XKB_VARIANT gh_variants[] = -{ - { "generic", 0 }, /* Multilingual */ - { "akan", 0 }, /* Akan */ - { "ewe", 0 }, /* Ewe */ - { "fula", 0 }, /* Fula */ - { "ga", 0 }, /* Ga */ - { "hausa", 0 }, /* Hausa */ - { "", 0 }, +static const XKB_VARIANT gh_variants[] = { + { "generic", 0 }, /* Multilingual */ + { "akan", 0 }, /* Akan */ + { "ewe", 0 }, /* Ewe */ + { "fula", 0 }, /* Fula */ + { "ga", 0 }, /* Ga */ + { "hausa", 0 }, /* Hausa */ + { "", 0 }, }; /* Georgia */ -static const XKB_VARIANT ge_variants[] = -{ - { "ergonomic", 0 }, /* Ergonomic */ - { "mess", 0 }, /* MESS */ - { "ru", 0 }, /* Russian */ - { "os", 0 }, /* Ossetian */ - { "", 0 }, +static const XKB_VARIANT ge_variants[] = { + { "ergonomic", 0 }, /* Ergonomic */ + { "mess", 0 }, /* MESS */ + { "ru", 0 }, /* Russian */ + { "os", 0 }, /* Ossetian */ + { "", 0 }, }; /* Germany */ -static const XKB_VARIANT de_variants[] = -{ - { "deadacute", KBD_GERMAN }, /* Dead acute */ - { "deadgraveacute", KBD_GERMAN }, /* Dead grave acute */ - { "nodeadkeys", KBD_GERMAN }, /* Eliminate dead keys */ - { "ro", KBD_GERMAN }, /* Romanian keyboard with German letters */ - { "ro_nodeadkeys", KBD_GERMAN }, /* Romanian keyboard with German letters, eliminate dead keys */ - { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ - { "sundeadkeys", KBD_GERMAN }, /* Sun dead keys */ - { "neo", KBD_GERMAN_NEO }, /* Neo 2 */ - { "mac", KBD_GERMAN }, /* Macintosh */ - { "mac_nodeadkeys", KBD_GERMAN }, /* Macintosh, eliminate dead keys */ - { "dsb", KBD_GERMAN }, /* Lower Sorbian */ - { "dsb_qwertz", KBD_GERMAN }, /* Lower Sorbian (qwertz) */ - { "qwerty", KBD_GERMAN_IBM }, /* qwerty */ - { "", 0 }, +static const XKB_VARIANT de_variants[] = { + { "deadacute", KBD_GERMAN }, /* Dead acute */ + { "deadgraveacute", KBD_GERMAN }, /* Dead grave acute */ + { "nodeadkeys", KBD_GERMAN }, /* Eliminate dead keys */ + { "ro", KBD_GERMAN }, /* Romanian keyboard with German letters */ + { "ro_nodeadkeys", + KBD_GERMAN }, /* Romanian keyboard with German letters, eliminate dead keys */ + { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ + { "sundeadkeys", KBD_GERMAN }, /* Sun dead keys */ + { "neo", KBD_GERMAN_NEO }, /* Neo 2 */ + { "mac", KBD_GERMAN }, /* Macintosh */ + { "mac_nodeadkeys", KBD_GERMAN }, /* Macintosh, eliminate dead keys */ + { "dsb", KBD_GERMAN }, /* Lower Sorbian */ + { "dsb_qwertz", KBD_GERMAN }, /* Lower Sorbian (qwertz) */ + { "qwerty", KBD_GERMAN_IBM }, /* qwerty */ + { "", 0 }, }; /* Greece */ -static const XKB_VARIANT gr_variants[] = -{ - { "simple", KBD_GREEK_220 }, /* Simple */ - { "extended", KBD_GREEK_319 }, /* Extended */ - { "nodeadkeys", KBD_GREEK_319}, /* Eliminate dead keys */ - { "polytonic", KBD_GREEK_POLYTONIC }, /* Polytonic */ - { "", 0 }, +static const XKB_VARIANT gr_variants[] = { + { "simple", KBD_GREEK_220 }, /* Simple */ + { "extended", KBD_GREEK_319 }, /* Extended */ + { "nodeadkeys", KBD_GREEK_319 }, /* Eliminate dead keys */ + { "polytonic", KBD_GREEK_POLYTONIC }, /* Polytonic */ + { "", 0 }, }; /* Hungary */ -static const XKB_VARIANT hu_variants[] = -{ - { "standard", KBD_HUNGARIAN_101_KEY }, /* Standard */ - { "nodeadkeys", KBD_HUNGARIAN_101_KEY }, /* Eliminate dead keys */ - { "qwerty", KBD_HUNGARIAN_101_KEY }, /* qwerty */ - { "101_qwertz_comma_dead", KBD_HUNGARIAN_101_KEY }, /* 101/qwertz/comma/Dead keys */ - { "101_qwertz_comma_nodead", KBD_HUNGARIAN_101_KEY }, /* 101/qwertz/comma/Eliminate dead keys */ - { "101_qwertz_dot_dead", KBD_HUNGARIAN_101_KEY }, /* 101/qwertz/dot/Dead keys */ - { "101_qwertz_dot_nodead", KBD_HUNGARIAN_101_KEY }, /* 101/qwertz/dot/Eliminate dead keys */ - { "101_qwerty_comma_dead", KBD_HUNGARIAN_101_KEY }, /* 101/qwerty/comma/Dead keys */ - { "101_qwerty_comma_nodead", KBD_HUNGARIAN_101_KEY }, /* 101/qwerty/comma/Eliminate dead keys */ - { "101_qwerty_dot_dead", KBD_HUNGARIAN_101_KEY }, /* 101/qwerty/dot/Dead keys */ - { "101_qwerty_dot_nodead", KBD_HUNGARIAN_101_KEY }, /* 101/qwerty/dot/Eliminate dead keys */ - { "102_qwertz_comma_dead", KBD_HUNGARIAN_101_KEY }, /* 102/qwertz/comma/Dead keys */ - { "102_qwertz_comma_nodead", KBD_HUNGARIAN_101_KEY }, /* 102/qwertz/comma/Eliminate dead keys */ - { "102_qwertz_dot_dead", KBD_HUNGARIAN_101_KEY }, /* 102/qwertz/dot/Dead keys */ - { "102_qwertz_dot_nodead", KBD_HUNGARIAN_101_KEY }, /* 102/qwertz/dot/Eliminate dead keys */ - { "102_qwerty_comma_dead", KBD_HUNGARIAN_101_KEY }, /* 102/qwerty/comma/Dead keys */ - { "102_qwerty_comma_nodead", KBD_HUNGARIAN_101_KEY }, /* 102/qwerty/comma/Eliminate dead keys */ - { "102_qwerty_dot_dead", KBD_HUNGARIAN_101_KEY }, /* 102/qwerty/dot/Dead keys */ - { "102_qwerty_dot_nodead", KBD_HUNGARIAN_101_KEY }, /* 102/qwerty/dot/Eliminate dead keys */ - { "", 0 }, +static const XKB_VARIANT hu_variants[] = { + { "standard", KBD_HUNGARIAN_101_KEY }, /* Standard */ + { "nodeadkeys", KBD_HUNGARIAN_101_KEY }, /* Eliminate dead keys */ + { "qwerty", KBD_HUNGARIAN_101_KEY }, /* qwerty */ + { "101_qwertz_comma_dead", KBD_HUNGARIAN_101_KEY }, /* 101/qwertz/comma/Dead keys */ + { "101_qwertz_comma_nodead", KBD_HUNGARIAN_101_KEY }, /* 101/qwertz/comma/Eliminate dead keys */ + { "101_qwertz_dot_dead", KBD_HUNGARIAN_101_KEY }, /* 101/qwertz/dot/Dead keys */ + { "101_qwertz_dot_nodead", KBD_HUNGARIAN_101_KEY }, /* 101/qwertz/dot/Eliminate dead keys */ + { "101_qwerty_comma_dead", KBD_HUNGARIAN_101_KEY }, /* 101/qwerty/comma/Dead keys */ + { "101_qwerty_comma_nodead", KBD_HUNGARIAN_101_KEY }, /* 101/qwerty/comma/Eliminate dead keys */ + { "101_qwerty_dot_dead", KBD_HUNGARIAN_101_KEY }, /* 101/qwerty/dot/Dead keys */ + { "101_qwerty_dot_nodead", KBD_HUNGARIAN_101_KEY }, /* 101/qwerty/dot/Eliminate dead keys */ + { "102_qwertz_comma_dead", KBD_HUNGARIAN_101_KEY }, /* 102/qwertz/comma/Dead keys */ + { "102_qwertz_comma_nodead", KBD_HUNGARIAN_101_KEY }, /* 102/qwertz/comma/Eliminate dead keys */ + { "102_qwertz_dot_dead", KBD_HUNGARIAN_101_KEY }, /* 102/qwertz/dot/Dead keys */ + { "102_qwertz_dot_nodead", KBD_HUNGARIAN_101_KEY }, /* 102/qwertz/dot/Eliminate dead keys */ + { "102_qwerty_comma_dead", KBD_HUNGARIAN_101_KEY }, /* 102/qwerty/comma/Dead keys */ + { "102_qwerty_comma_nodead", KBD_HUNGARIAN_101_KEY }, /* 102/qwerty/comma/Eliminate dead keys */ + { "102_qwerty_dot_dead", KBD_HUNGARIAN_101_KEY }, /* 102/qwerty/dot/Dead keys */ + { "102_qwerty_dot_nodead", KBD_HUNGARIAN_101_KEY }, /* 102/qwerty/dot/Eliminate dead keys */ + { "", 0 }, }; /* Iceland */ -static const XKB_VARIANT is_variants[] = -{ - { "Sundeadkeys", KBD_ICELANDIC }, /* Sun dead keys */ - { "nodeadkeys", KBD_ICELANDIC }, /* Eliminate dead keys */ - { "mac", KBD_ICELANDIC }, /* Macintosh */ - { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ - { "", 0 }, +static const XKB_VARIANT is_variants[] = { + { "Sundeadkeys", KBD_ICELANDIC }, /* Sun dead keys */ + { "nodeadkeys", KBD_ICELANDIC }, /* Eliminate dead keys */ + { "mac", KBD_ICELANDIC }, /* Macintosh */ + { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ + { "", 0 }, }; /* Israel */ -static const XKB_VARIANT il_variants[] = -{ - { "lyx", KBD_HEBREW }, /* lyx */ - { "phonetic", KBD_HEBREW }, /* Phonetic */ - { "biblical", KBD_HEBREW }, /* Biblical Hebrew (Tiro) */ - { "", 0 }, +static const XKB_VARIANT il_variants[] = { + { "lyx", KBD_HEBREW }, /* lyx */ + { "phonetic", KBD_HEBREW }, /* Phonetic */ + { "biblical", KBD_HEBREW }, /* Biblical Hebrew (Tiro) */ + { "", 0 }, }; /* Italy */ -static const XKB_VARIANT it_variants[] = -{ - { "nodeadkeys", KBD_ITALIAN_142 }, /* Eliminate dead keys */ - { "mac", KBD_ITALIAN }, /* Macintosh */ - { "geo", KBD_GEORGIAN }, /* Georgian */ - { "", 0 }, +static const XKB_VARIANT it_variants[] = { + { "nodeadkeys", KBD_ITALIAN_142 }, /* Eliminate dead keys */ + { "mac", KBD_ITALIAN }, /* Macintosh */ + { "geo", KBD_GEORGIAN }, /* Georgian */ + { "", 0 }, }; /* Japan */ -static const XKB_VARIANT jp_variants[] = -{ - { "kana", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 }, /* Kana */ - { "OADG109A", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 }, /* OADG 109A */ - { "", 0 }, +static const XKB_VARIANT jp_variants[] = { + { "kana", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 }, /* Kana */ + { "OADG109A", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 }, /* OADG 109A */ + { "", 0 }, }; /* Kyrgyzstan */ -static const XKB_VARIANT kg_variants[] = -{ - { "phonetic", KBD_KYRGYZ_CYRILLIC }, /* Phonetic */ - { "", 0 }, +static const XKB_VARIANT kg_variants[] = { + { "phonetic", KBD_KYRGYZ_CYRILLIC }, /* Phonetic */ + { "", 0 }, }; /* Kazakhstan */ -static const XKB_VARIANT kz_variants[] = -{ - { "ruskaz", KBD_KAZAKH }, /* Russian with Kazakh */ - { "kazrus", KBD_KAZAKH }, /* Kazakh with Russian */ - { "", 0 }, +static const XKB_VARIANT kz_variants[] = { + { "ruskaz", KBD_KAZAKH }, /* Russian with Kazakh */ + { "kazrus", KBD_KAZAKH }, /* Kazakh with Russian */ + { "", 0 }, }; /* Latin America */ -static const XKB_VARIANT latam_variants[] = -{ - { "nodeadkeys", KBD_LATIN_AMERICAN }, /* Eliminate dead keys */ - { "deadtilde", KBD_LATIN_AMERICAN }, /* Include dead tilde */ - { "sundeadkeys", KBD_LATIN_AMERICAN }, /* Sun dead keys */ - { "", 0 }, +static const XKB_VARIANT latam_variants[] = { + { "nodeadkeys", KBD_LATIN_AMERICAN }, /* Eliminate dead keys */ + { "deadtilde", KBD_LATIN_AMERICAN }, /* Include dead tilde */ + { "sundeadkeys", KBD_LATIN_AMERICAN }, /* Sun dead keys */ + { "", 0 }, }; /* Lithuania */ -static const XKB_VARIANT lt_variants[] = -{ - { "std", KBD_LITHUANIAN }, /* Standard */ - { "us", KBD_LITHUANIAN_IBM }, /* US keyboard with Lithuanian letters */ - { "ibm", KBD_LITHUANIAN_IBM }, /* IBM (LST 1205-92) */ - { "lekp", KBD_LITHUANIAN }, /* LEKP */ - { "lekpa", KBD_LITHUANIAN }, /* LEKPa */ - { "balticplus", KBD_LITHUANIAN }, /* Baltic+ */ - { "", 0 }, +static const XKB_VARIANT lt_variants[] = { + { "std", KBD_LITHUANIAN }, /* Standard */ + { "us", KBD_LITHUANIAN_IBM }, /* US keyboard with Lithuanian letters */ + { "ibm", KBD_LITHUANIAN_IBM }, /* IBM (LST 1205-92) */ + { "lekp", KBD_LITHUANIAN }, /* LEKP */ + { "lekpa", KBD_LITHUANIAN }, /* LEKPa */ + { "balticplus", KBD_LITHUANIAN }, /* Baltic+ */ + { "", 0 }, }; /* Latvia */ -static const XKB_VARIANT lv_variants[] = -{ - { "apostrophe", KBD_LATVIAN }, /* Apostrophe (') variant */ - { "tilde", KBD_LATVIAN }, /* Tilde (~) variant */ - { "fkey", KBD_LATVIAN }, /* F-letter (F) variant */ - { "", 0 }, +static const XKB_VARIANT lv_variants[] = { + { "apostrophe", KBD_LATVIAN }, /* Apostrophe (') variant */ + { "tilde", KBD_LATVIAN }, /* Tilde (~) variant */ + { "fkey", KBD_LATVIAN }, /* F-letter (F) variant */ + { "", 0 }, }; /* Montenegro */ -static const XKB_VARIANT me_variants[] = -{ - { "cyrillic", 0 }, /* Cyrillic */ - { "cyrillicyz", 0 }, /* Cyrillic, Z and ZHE swapped */ - { "latinunicode", 0 }, /* Latin unicode */ - { "latinyz", 0 }, /* Latin qwerty */ - { "latinunicodeyz", 0 }, /* Latin unicode qwerty */ - { "cyrillicalternatequotes", 0 }, /* Cyrillic with guillemets */ - { "latinalternatequotes", 0 }, /* Latin with guillemets */ - { "", 0 }, +static const XKB_VARIANT me_variants[] = { + { "cyrillic", 0 }, /* Cyrillic */ + { "cyrillicyz", 0 }, /* Cyrillic, Z and ZHE swapped */ + { "latinunicode", 0 }, /* Latin unicode */ + { "latinyz", 0 }, /* Latin qwerty */ + { "latinunicodeyz", 0 }, /* Latin unicode qwerty */ + { "cyrillicalternatequotes", 0 }, /* Cyrillic with guillemets */ + { "latinalternatequotes", 0 }, /* Latin with guillemets */ + { "", 0 }, }; /* Macedonia */ -static const XKB_VARIANT mk_variants[] = -{ - { "nodeadkeys", KBD_FYRO_MACEDONIAN }, /* Eliminate dead keys */ - { "", 0 }, +static const XKB_VARIANT mk_variants[] = { + { "nodeadkeys", KBD_FYRO_MACEDONIAN }, /* Eliminate dead keys */ + { "", 0 }, }; /* Malta */ -static const XKB_VARIANT mt_variants[] = -{ - { "us", KBD_MALTESE_48_KEY }, /* Maltese keyboard with US layout */ - { "", 0 }, +static const XKB_VARIANT mt_variants[] = { + { "us", KBD_MALTESE_48_KEY }, /* Maltese keyboard with US layout */ + { "", 0 }, }; /* Norway */ -static const XKB_VARIANT no_variants[] = -{ - { "nodeadkeys", KBD_NORWEGIAN }, /* Eliminate dead keys */ - { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ - { "smi", KBD_NORWEGIAN_WITH_SAMI }, /* Northern Saami */ - { "smi_nodeadkeys", KBD_SAMI_EXTENDED_NORWAY }, /* Northern Saami, eliminate dead keys */ - { "mac", KBD_NORWEGIAN }, /* Macintosh */ - { "mac_nodeadkeys", KBD_SAMI_EXTENDED_NORWAY }, /* Macintosh, eliminate dead keys */ - { "", 0 }, +static const XKB_VARIANT no_variants[] = { + { "nodeadkeys", KBD_NORWEGIAN }, /* Eliminate dead keys */ + { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ + { "smi", KBD_NORWEGIAN_WITH_SAMI }, /* Northern Saami */ + { "smi_nodeadkeys", KBD_SAMI_EXTENDED_NORWAY }, /* Northern Saami, eliminate dead keys */ + { "mac", KBD_NORWEGIAN }, /* Macintosh */ + { "mac_nodeadkeys", KBD_SAMI_EXTENDED_NORWAY }, /* Macintosh, eliminate dead keys */ + { "", 0 }, }; /* Poland */ -static const XKB_VARIANT pl_variants[] = -{ - { "qwertz", KBD_POLISH_214 }, /* qwertz */ - { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ - { "dvorak_quotes", KBD_UNITED_STATES_DVORAK }, /* Dvorak, Polish quotes on quotemark key */ - { "dvorak_altquotes", KBD_UNITED_STATES_DVORAK }, /* Dvorak, Polish quotes on key 1 */ - { "csb", 0 }, /* Kashubian */ - { "ru_phonetic_dvorak", KBD_UNITED_STATES_DVORAK }, /* Russian phonetic Dvorak */ - { "", 0 }, +static const XKB_VARIANT pl_variants[] = { + { "qwertz", KBD_POLISH_214 }, /* qwertz */ + { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ + { "dvorak_quotes", KBD_UNITED_STATES_DVORAK }, /* Dvorak, Polish quotes on quotemark key */ + { "dvorak_altquotes", KBD_UNITED_STATES_DVORAK }, /* Dvorak, Polish quotes on key 1 */ + { "csb", 0 }, /* Kashubian */ + { "ru_phonetic_dvorak", KBD_UNITED_STATES_DVORAK }, /* Russian phonetic Dvorak */ + { "", 0 }, }; /* Portugal */ -static const XKB_VARIANT pt_variants[] = -{ - { "nodeadkeys", KBD_PORTUGUESE }, /* Eliminate dead keys */ - { "sundeadkeys", KBD_PORTUGUESE }, /* Sun dead keys */ - { "mac", KBD_PORTUGUESE }, /* Macintosh */ - { "mac_nodeadkeys", KBD_PORTUGUESE }, /* Macintosh, eliminate dead keys */ - { "mac_sundeadkeys", KBD_PORTUGUESE }, /* Macintosh, Sun dead keys */ - { "nativo", KBD_PORTUGUESE }, /* Nativo */ - { "nativo-us", KBD_PORTUGUESE }, /* Nativo for USA keyboards */ - { "nativo-epo", KBD_PORTUGUESE }, /* Nativo for Esperanto */ - { "", 0 }, +static const XKB_VARIANT pt_variants[] = { + { "nodeadkeys", KBD_PORTUGUESE }, /* Eliminate dead keys */ + { "sundeadkeys", KBD_PORTUGUESE }, /* Sun dead keys */ + { "mac", KBD_PORTUGUESE }, /* Macintosh */ + { "mac_nodeadkeys", KBD_PORTUGUESE }, /* Macintosh, eliminate dead keys */ + { "mac_sundeadkeys", KBD_PORTUGUESE }, /* Macintosh, Sun dead keys */ + { "nativo", KBD_PORTUGUESE }, /* Nativo */ + { "nativo-us", KBD_PORTUGUESE }, /* Nativo for USA keyboards */ + { "nativo-epo", KBD_PORTUGUESE }, /* Nativo for Esperanto */ + { "", 0 }, }; /* Romania */ -static const XKB_VARIANT ro_variants[] = -{ - { "cedilla", KBD_ROMANIAN }, /* Cedilla */ - { "std", KBD_ROMANIAN }, /* Standard */ - { "std_cedilla", KBD_ROMANIAN }, /* Standard (Cedilla) */ - { "winkeys", KBD_ROMANIAN }, /* Winkeys */ - { "crh_f", KBD_TURKISH_F }, /* Crimean Tatar (Turkish F) */ - { "crh_alt", KBD_TURKISH_Q }, /* Crimean Tatar (Turkish Alt-Q) */ - { "crh_dobruca1", KBD_TATAR }, /* Crimean Tatar (Dobruca-1 Q) */ - { "crh_dobruca2", KBD_TATAR }, /* Crimean Tatar (Dobruca-2 Q) */ - { "", 0 }, +static const XKB_VARIANT ro_variants[] = { + { "cedilla", KBD_ROMANIAN }, /* Cedilla */ + { "std", KBD_ROMANIAN }, /* Standard */ + { "std_cedilla", KBD_ROMANIAN }, /* Standard (Cedilla) */ + { "winkeys", KBD_ROMANIAN }, /* Winkeys */ + { "crh_f", KBD_TURKISH_F }, /* Crimean Tatar (Turkish F) */ + { "crh_alt", KBD_TURKISH_Q }, /* Crimean Tatar (Turkish Alt-Q) */ + { "crh_dobruca1", KBD_TATAR }, /* Crimean Tatar (Dobruca-1 Q) */ + { "crh_dobruca2", KBD_TATAR }, /* Crimean Tatar (Dobruca-2 Q) */ + { "", 0 }, }; /* Russia */ -static const XKB_VARIANT ru_variants[] = -{ - { "phonetic", KBD_RUSSIAN }, /* Phonetic */ - { "phonetic_winkeys", KBD_RUSSIAN }, /* Phonetic Winkeys */ - { "typewriter", KBD_RUSSIAN_TYPEWRITER }, /* Typewriter */ - { "legacy", KBD_RUSSIAN }, /* Legacy */ - { "tt", KBD_TATAR }, /* Tatar */ - { "os_legacy", 0 }, /* Ossetian, legacy */ - { "os_winkeys", 0 }, /* Ossetian, Winkeys */ - { "cv", 0 }, /* Chuvash */ - { "cv_latin", 0 }, /* Chuvash Latin */ - { "udm", 0 }, /* Udmurt */ - { "kom", 0 }, /* Komi */ - { "sah", 0 }, /* Yakut */ - { "xal", 0 }, /* Kalmyk */ - { "dos", 0 }, /* DOS */ - { "", 0 }, +static const XKB_VARIANT ru_variants[] = { + { "phonetic", KBD_RUSSIAN }, /* Phonetic */ + { "phonetic_winkeys", KBD_RUSSIAN }, /* Phonetic Winkeys */ + { "typewriter", KBD_RUSSIAN_TYPEWRITER }, /* Typewriter */ + { "legacy", KBD_RUSSIAN }, /* Legacy */ + { "tt", KBD_TATAR }, /* Tatar */ + { "os_legacy", 0 }, /* Ossetian, legacy */ + { "os_winkeys", 0 }, /* Ossetian, Winkeys */ + { "cv", 0 }, /* Chuvash */ + { "cv_latin", 0 }, /* Chuvash Latin */ + { "udm", 0 }, /* Udmurt */ + { "kom", 0 }, /* Komi */ + { "sah", 0 }, /* Yakut */ + { "xal", 0 }, /* Kalmyk */ + { "dos", 0 }, /* DOS */ + { "", 0 }, }; /* Serbia */ -static const XKB_VARIANT rs_variants[] = -{ - { "yz", KBD_SERBIAN_CYRILLIC }, /* Z and ZHE swapped */ - { "latin", KBD_SERBIAN_LATIN }, /* Latin */ - { "latinunicode", KBD_SERBIAN_LATIN }, /* Latin Unicode */ - { "latinyz", KBD_SERBIAN_LATIN }, /* Latin qwerty */ - { "latinunicodeyz", KBD_SERBIAN_LATIN }, /* Latin Unicode qwerty */ - { "alternatequotes", KBD_SERBIAN_CYRILLIC }, /* With guillemets */ - { "latinalternatequotes", KBD_SERBIAN_LATIN }, /* Latin with guillemets */ - { "", 0 }, +static const XKB_VARIANT rs_variants[] = { + { "yz", KBD_SERBIAN_CYRILLIC }, /* Z and ZHE swapped */ + { "latin", KBD_SERBIAN_LATIN }, /* Latin */ + { "latinunicode", KBD_SERBIAN_LATIN }, /* Latin Unicode */ + { "latinyz", KBD_SERBIAN_LATIN }, /* Latin qwerty */ + { "latinunicodeyz", KBD_SERBIAN_LATIN }, /* Latin Unicode qwerty */ + { "alternatequotes", KBD_SERBIAN_CYRILLIC }, /* With guillemets */ + { "latinalternatequotes", KBD_SERBIAN_LATIN }, /* Latin with guillemets */ + { "", 0 }, }; /* Slovenia */ -static const XKB_VARIANT si_variants[] = -{ - { "alternatequotes", KBD_SLOVENIAN }, /* Use guillemets for quotes */ - { "us", KBD_UNITED_STATES_INTERNATIONAL }, /* US keyboard with Slovenian letters */ - { "", 0 }, +static const XKB_VARIANT si_variants[] = { + { "alternatequotes", KBD_SLOVENIAN }, /* Use guillemets for quotes */ + { "us", KBD_UNITED_STATES_INTERNATIONAL }, /* US keyboard with Slovenian letters */ + { "", 0 }, }; /* Slovakia */ -static const XKB_VARIANT sk_variants[] = -{ - { "bksl", KBD_SLOVAK }, /* Extended Backslash */ - { "qwerty", KBD_SLOVAK_QWERTY }, /* qwerty */ - { "qwerty_bksl", KBD_SLOVAK_QWERTY }, /* qwerty, extended Backslash */ - { "", 0 }, +static const XKB_VARIANT sk_variants[] = { + { "bksl", KBD_SLOVAK }, /* Extended Backslash */ + { "qwerty", KBD_SLOVAK_QWERTY }, /* qwerty */ + { "qwerty_bksl", KBD_SLOVAK_QWERTY }, /* qwerty, extended Backslash */ + { "", 0 }, }; /* Spain */ -static const XKB_VARIANT es_variants[] = -{ - { "nodeadkeys", KBD_SPANISH_VARIATION }, /* Eliminate dead keys */ - { "deadtilde", KBD_SPANISH_VARIATION }, /* Include dead tilde */ - { "sundeadkeys", KBD_SPANISH }, /* Sun dead keys */ - { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ - { "ast", KBD_SPANISH_VARIATION }, /* Asturian variant with bottom-dot H and bottom-dot L */ - { "cat", KBD_SPANISH_VARIATION }, /* Catalan variant with middle-dot L */ - { "mac", KBD_SPANISH }, /* Macintosh */ - { "", 0 }, +static const XKB_VARIANT es_variants[] = { + { "nodeadkeys", KBD_SPANISH_VARIATION }, /* Eliminate dead keys */ + { "deadtilde", KBD_SPANISH_VARIATION }, /* Include dead tilde */ + { "sundeadkeys", KBD_SPANISH }, /* Sun dead keys */ + { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ + { "ast", KBD_SPANISH_VARIATION }, /* Asturian variant with bottom-dot H and bottom-dot L */ + { "cat", KBD_SPANISH_VARIATION }, /* Catalan variant with middle-dot L */ + { "mac", KBD_SPANISH }, /* Macintosh */ + { "", 0 }, }; /* Sweden */ -static const XKB_VARIANT se_variants[] = -{ - { "nodeadkeys", KBD_SWEDISH }, /* Eliminate dead keys */ - { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ - { "rus", KBD_RUSSIAN }, /* Russian phonetic */ - { "rus_nodeadkeys", KBD_RUSSIAN }, /* Russian phonetic, eliminate dead keys */ - { "smi", KBD_SWEDISH_WITH_SAMI }, /* Northern Saami */ - { "mac", KBD_SWEDISH }, /* Macintosh */ - { "svdvorak", KBD_UNITED_STATES_DVORAK }, /* Svdvorak */ - { "", 0 }, +static const XKB_VARIANT se_variants[] = { + { "nodeadkeys", KBD_SWEDISH }, /* Eliminate dead keys */ + { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ + { "rus", KBD_RUSSIAN }, /* Russian phonetic */ + { "rus_nodeadkeys", KBD_RUSSIAN }, /* Russian phonetic, eliminate dead keys */ + { "smi", KBD_SWEDISH_WITH_SAMI }, /* Northern Saami */ + { "mac", KBD_SWEDISH }, /* Macintosh */ + { "svdvorak", KBD_UNITED_STATES_DVORAK }, /* Svdvorak */ + { "", 0 }, }; /* Switzerland */ -static const XKB_VARIANT ch_variants[] = -{ - { "de_nodeadkeys", KBD_SWISS_GERMAN }, /* German, eliminate dead keys */ - { "de_sundeadkeys", KBD_SWISS_GERMAN }, /* German, Sun dead keys */ - { "fr", KBD_SWISS_FRENCH }, /* French */ - { "fr_nodeadkeys", KBD_SWISS_FRENCH }, /* French, eliminate dead keys */ - { "fr_sundeadkeys", KBD_SWISS_FRENCH }, /* French, Sun dead keys */ - { "fr_mac", KBD_SWISS_FRENCH }, /* French (Macintosh) */ - { "de_mac", KBD_SWISS_GERMAN }, /* German (Macintosh) */ - { "", 0 }, +static const XKB_VARIANT ch_variants[] = { + { "de_nodeadkeys", KBD_SWISS_GERMAN }, /* German, eliminate dead keys */ + { "de_sundeadkeys", KBD_SWISS_GERMAN }, /* German, Sun dead keys */ + { "fr", KBD_SWISS_FRENCH }, /* French */ + { "fr_nodeadkeys", KBD_SWISS_FRENCH }, /* French, eliminate dead keys */ + { "fr_sundeadkeys", KBD_SWISS_FRENCH }, /* French, Sun dead keys */ + { "fr_mac", KBD_SWISS_FRENCH }, /* French (Macintosh) */ + { "de_mac", KBD_SWISS_GERMAN }, /* German (Macintosh) */ + { "", 0 }, }; /* Syria */ -static const XKB_VARIANT sy_variants[] = -{ - { "syc", KBD_SYRIAC }, /* Syriac */ - { "syc_phonetic", KBD_SYRIAC_PHONETIC }, /* Syriac phonetic */ - { "ku", 0 }, /* Kurdish, Latin Q */ - { "ku_f", 0 }, /* Kurdish, (F) */ - { "ku_alt", 0 }, /* Kurdish, Latin Alt-Q */ - { "", 0 }, +static const XKB_VARIANT sy_variants[] = { + { "syc", KBD_SYRIAC }, /* Syriac */ + { "syc_phonetic", KBD_SYRIAC_PHONETIC }, /* Syriac phonetic */ + { "ku", 0 }, /* Kurdish, Latin Q */ + { "ku_f", 0 }, /* Kurdish, (F) */ + { "ku_alt", 0 }, /* Kurdish, Latin Alt-Q */ + { "", 0 }, }; /* Tajikistan */ -static const XKB_VARIANT tj_variants[] = -{ - { "legacy", 0 }, /* Legacy */ - { "", 0 }, +static const XKB_VARIANT tj_variants[] = { + { "legacy", 0 }, /* Legacy */ + { "", 0 }, }; /* Sri Lanka */ -static const XKB_VARIANT lk_variants[] = -{ - { "tam_unicode", KBD_TAMIL }, /* Tamil Unicode */ - { "tam_TAB", KBD_TAMIL }, /* Tamil TAB Typewriter */ - { "", 0 }, +static const XKB_VARIANT lk_variants[] = { + { "tam_unicode", KBD_TAMIL }, /* Tamil Unicode */ + { "tam_TAB", KBD_TAMIL }, /* Tamil TAB Typewriter */ + { "", 0 }, }; /* Thailand */ -static const XKB_VARIANT th_variants[] = -{ - { "tis", KBD_THAI_KEDMANEE_NON_SHIFTLOCK }, /* TIS-820.2538 */ - { "pat", KBD_THAI_PATTACHOTE }, /* Pattachote */ - { "", 0 }, +static const XKB_VARIANT th_variants[] = { + { "tis", KBD_THAI_KEDMANEE_NON_SHIFTLOCK }, /* TIS-820.2538 */ + { "pat", KBD_THAI_PATTACHOTE }, /* Pattachote */ + { "", 0 }, }; /* Turkey */ -static const XKB_VARIANT tr_variants[] = -{ - { "f", KBD_TURKISH_F }, /* (F) */ - { "alt", KBD_TURKISH_Q }, /* Alt-Q */ - { "sundeadkeys", KBD_TURKISH_F }, /* Sun dead keys */ - { "ku", 0 }, /* Kurdish, Latin Q */ - { "ku_f", 0 }, /* Kurdish, (F) */ - { "ku_alt", 0 }, /* Kurdish, Latin Alt-Q */ - { "intl", KBD_TURKISH_F }, /* International (with dead keys) */ - { "crh", KBD_TATAR }, /* Crimean Tatar (Turkish Q) */ - { "crh_f", KBD_TURKISH_F }, /* Crimean Tatar (Turkish F) */ - { "crh_alt", KBD_TURKISH_Q }, /* Crimean Tatar (Turkish Alt-Q) */ - { "", 0 }, +static const XKB_VARIANT tr_variants[] = { + { "f", KBD_TURKISH_F }, /* (F) */ + { "alt", KBD_TURKISH_Q }, /* Alt-Q */ + { "sundeadkeys", KBD_TURKISH_F }, /* Sun dead keys */ + { "ku", 0 }, /* Kurdish, Latin Q */ + { "ku_f", 0 }, /* Kurdish, (F) */ + { "ku_alt", 0 }, /* Kurdish, Latin Alt-Q */ + { "intl", KBD_TURKISH_F }, /* International (with dead keys) */ + { "crh", KBD_TATAR }, /* Crimean Tatar (Turkish Q) */ + { "crh_f", KBD_TURKISH_F }, /* Crimean Tatar (Turkish F) */ + { "crh_alt", KBD_TURKISH_Q }, /* Crimean Tatar (Turkish Alt-Q) */ + { "", 0 }, }; /* Ukraine */ -static const XKB_VARIANT ua_variants[] = -{ - { "phonetic", KBD_UKRAINIAN }, /* Phonetic */ - { "typewriter", KBD_UKRAINIAN }, /* Typewriter */ - { "winkeys", KBD_UKRAINIAN }, /* Winkeys */ - { "legacy", KBD_UKRAINIAN }, /* Legacy */ - { "rstu", KBD_UKRAINIAN }, /* Standard RSTU */ - { "rstu_ru", KBD_UKRAINIAN }, /* Standard RSTU on Russian layout */ - { "homophonic", KBD_UKRAINIAN }, /* Homophonic */ - { "crh", KBD_TATAR }, /* Crimean Tatar (Turkish Q) */ - { "crh_f", KBD_TURKISH_F }, /* Crimean Tatar (Turkish F) */ - { "crh_alt", KBD_TURKISH_Q }, /* Crimean Tatar (Turkish Alt-Q) */ - { "", 0 }, +static const XKB_VARIANT ua_variants[] = { + { "phonetic", KBD_UKRAINIAN }, /* Phonetic */ + { "typewriter", KBD_UKRAINIAN }, /* Typewriter */ + { "winkeys", KBD_UKRAINIAN }, /* Winkeys */ + { "legacy", KBD_UKRAINIAN }, /* Legacy */ + { "rstu", KBD_UKRAINIAN }, /* Standard RSTU */ + { "rstu_ru", KBD_UKRAINIAN }, /* Standard RSTU on Russian layout */ + { "homophonic", KBD_UKRAINIAN }, /* Homophonic */ + { "crh", KBD_TATAR }, /* Crimean Tatar (Turkish Q) */ + { "crh_f", KBD_TURKISH_F }, /* Crimean Tatar (Turkish F) */ + { "crh_alt", KBD_TURKISH_Q }, /* Crimean Tatar (Turkish Alt-Q) */ + { "", 0 }, }; /* United Kingdom */ -static const XKB_VARIANT gb_variants[] = -{ - { "extd", KBD_UNITED_KINGDOM_EXTENDED }, /* Extended - Winkeys */ - { "intl", KBD_UNITED_KINGDOM_EXTENDED }, /* International (with dead keys) */ - { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ - { "dvorakukp", KBD_UNITED_STATES_DVORAK }, /* Dvorak (UK Punctuation) */ - { "mac", KBD_UNITED_KINGDOM }, /* Macintosh */ - { "colemak", 0 }, /* Colemak */ - { "", 0 }, +static const XKB_VARIANT gb_variants[] = { + { "extd", KBD_UNITED_KINGDOM_EXTENDED }, /* Extended - Winkeys */ + { "intl", KBD_UNITED_KINGDOM_EXTENDED }, /* International (with dead keys) */ + { "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */ + { "dvorakukp", KBD_UNITED_STATES_DVORAK }, /* Dvorak (UK Punctuation) */ + { "mac", KBD_UNITED_KINGDOM }, /* Macintosh */ + { "colemak", 0 }, /* Colemak */ + { "", 0 }, }; /* Uzbekistan */ -static const XKB_VARIANT uz_variants[] = -{ - { "latin", 0 }, /* Latin */ - { "crh", KBD_TATAR }, /* Crimean Tatar (Turkish Q) */ - { "crh_f", KBD_TURKISH_F }, /* Crimean Tatar (Turkish F) */ - { "crh_alt", KBD_TURKISH_Q }, /* Crimean Tatar (Turkish Alt-Q) */ - { "", 0 }, +static const XKB_VARIANT uz_variants[] = { + { "latin", 0 }, /* Latin */ + { "crh", KBD_TATAR }, /* Crimean Tatar (Turkish Q) */ + { "crh_f", KBD_TURKISH_F }, /* Crimean Tatar (Turkish F) */ + { "crh_alt", KBD_TURKISH_Q }, /* Crimean Tatar (Turkish Alt-Q) */ + { "", 0 }, }; /* Korea, Republic of */ -static const XKB_VARIANT kr_variants[] = -{ - { "kr104", KBD_KOREAN_INPUT_SYSTEM_IME_2000 }, /* 101/104 key Compatible */ - { "", 0 }, +static const XKB_VARIANT kr_variants[] = { + { "kr104", KBD_KOREAN_INPUT_SYSTEM_IME_2000 }, /* 101/104 key Compatible */ + { "", 0 }, }; /* Ireland */ -static const XKB_VARIANT ie_variants[] = -{ - { "CloGaelach", KBD_GAELIC }, /* CloGaelach */ - { "UnicodeExpert", KBD_GAELIC }, /* UnicodeExpert */ - { "ogam", KBD_GAELIC }, /* Ogham */ - { "ogam_is434", KBD_GAELIC }, /* Ogham IS434 */ - { "", 0 }, +static const XKB_VARIANT ie_variants[] = { + { "CloGaelach", KBD_GAELIC }, /* CloGaelach */ + { "UnicodeExpert", KBD_GAELIC }, /* UnicodeExpert */ + { "ogam", KBD_GAELIC }, /* Ogham */ + { "ogam_is434", KBD_GAELIC }, /* Ogham IS434 */ + { "", 0 }, }; /* Pakistan */ -static const XKB_VARIANT pk_variants[] = -{ - { "urd-crulp", 0 }, /* CRULP */ - { "urd-nla", 0 }, /* NLA */ - { "ara", KBD_ARABIC_101 }, /* Arabic */ - { "", 0 }, +static const XKB_VARIANT pk_variants[] = { + { "urd-crulp", 0 }, /* CRULP */ + { "urd-nla", 0 }, /* NLA */ + { "ara", KBD_ARABIC_101 }, /* Arabic */ + { "", 0 }, }; /* Esperanto */ -static const XKB_VARIANT epo_variants[] = -{ - { "legacy", 0 }, /* displaced semicolon and quote (obsolete) */ - { "", 0 }, +static const XKB_VARIANT epo_variants[] = { + { "legacy", 0 }, /* displaced semicolon and quote (obsolete) */ + { "", 0 }, }; /* Nigeria */ -static const XKB_VARIANT ng_variants[] = -{ - { "igbo", 0 }, /* Igbo */ - { "yoruba", 0 }, /* Yoruba */ - { "hausa", 0 }, /* Hausa */ - { "", 0 }, +static const XKB_VARIANT ng_variants[] = { + { "igbo", 0 }, /* Igbo */ + { "yoruba", 0 }, /* Yoruba */ + { "hausa", 0 }, /* Hausa */ + { "", 0 }, }; /* Braille */ -static const XKB_VARIANT brai_variants[] = -{ - { "left_hand", 0 }, /* Left hand */ - { "right_hand", 0 }, /* Right hand */ - { "", 0 }, +static const XKB_VARIANT brai_variants[] = { + { "left_hand", 0 }, /* Left hand */ + { "right_hand", 0 }, /* Right hand */ + { "", 0 }, }; /* Turkmenistan */ -static const XKB_VARIANT tm_variants[] = -{ - { "alt", KBD_TURKISH_Q }, /* Alt-Q */ - { "", 0 }, +static const XKB_VARIANT tm_variants[] = { + { "alt", KBD_TURKISH_Q }, /* Alt-Q */ + { "", 0 }, }; -static const XKB_LAYOUT xkbLayouts[] = -{ - { "us", KBD_US, us_variants }, /* USA */ - { "ad", 0, NULL }, /* Andorra */ - { "af", KBD_FARSI, af_variants }, /* Afghanistan */ - { "ara", KBD_ARABIC_101, ara_variants }, /* Arabic */ - { "al", 0, NULL }, /* Albania */ - { "am", KBD_ARMENIAN_EASTERN, am_variants }, /* Armenia */ - { "az", KBD_AZERI_CYRILLIC, az_variants }, /* Azerbaijan */ - { "by", KBD_BELARUSIAN, by_variants }, /* Belarus */ - { "be", KBD_BELGIAN_FRENCH, be_variants }, /* Belgium */ - { "bd", KBD_BENGALI, bd_variants }, /* Bangladesh */ - { "in", KBD_HINDI_TRADITIONAL, in_variants }, /* India */ - { "ba", KBD_CROATIAN, ba_variants }, /* Bosnia and Herzegovina */ - { "br", KBD_PORTUGUESE_BRAZILIAN_ABNT, br_variants }, /* Brazil */ - { "bg", KBD_BULGARIAN_LATIN, bg_variants }, /* Bulgaria */ - { "ma", KBD_FRENCH, ma_variants }, /* Morocco */ - { "mm", 0, NULL }, /* Myanmar */ - { "ca", KBD_US, ca_variants }, /* Canada */ - { "cd", 0, NULL }, /* Congo, Democratic Republic of the */ - { "cn", KBD_CHINESE_TRADITIONAL_PHONETIC, cn_variants }, /* China */ - { "hr", KBD_CROATIAN, hr_variants }, /* Croatia */ - { "cz", KBD_CZECH, cz_variants }, /* Czechia */ - { "dk", KBD_DANISH, dk_variants }, /* Denmark */ - { "nl", KBD_DUTCH, nl_variants }, /* Netherlands */ - { "bt", 0, NULL }, /* Bhutan */ - { "ee", KBD_ESTONIAN, ee_variants }, /* Estonia */ - { "ir", 0, ir_variants }, /* Iran */ - { "iq", 0, iq_variants }, /* Iraq */ - { "fo", 0, fo_variants }, /* Faroe Islands */ - { "fi", KBD_FINNISH, fi_variants }, /* Finland */ - { "fr", KBD_FRENCH, fr_variants }, /* France */ - { "gh", 0, gh_variants }, /* Ghana */ - { "gn", 0, NULL }, /* Guinea */ - { "ge", KBD_GEORGIAN, ge_variants }, /* Georgia */ - { "de", KBD_GERMAN, de_variants }, /* Germany */ - { "gr", KBD_GREEK, gr_variants }, /* Greece */ - { "hu", KBD_HUNGARIAN, hu_variants }, /* Hungary */ - { "is", KBD_ICELANDIC, is_variants }, /* Iceland */ - { "il", KBD_HEBREW, il_variants }, /* Israel */ - { "it", KBD_ITALIAN, it_variants }, /* Italy */ - { "jp", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002, jp_variants }, /* Japan */ - { "kg", 0, kg_variants }, /* Kyrgyzstan */ - { "kh", 0, NULL }, /* Cambodia */ - { "kz", KBD_KAZAKH, kz_variants }, /* Kazakhstan */ - { "la", 0, NULL }, /* Laos */ - { "latam", KBD_LATIN_AMERICAN, latam_variants }, /* Latin America */ - { "lt", KBD_LITHUANIAN, lt_variants }, /* Lithuania */ - { "lv", KBD_LATVIAN, lv_variants }, /* Latvia */ - { "mao", KBD_MAORI, NULL }, /* Maori */ - { "me", KBD_SERBIAN_LATIN, me_variants }, /* Montenegro */ - { "mk", KBD_FYRO_MACEDONIAN, mk_variants }, /* Macedonia */ - { "mt", KBD_MALTESE_48_KEY, mt_variants }, /* Malta */ - { "mn", KBD_MONGOLIAN_CYRILLIC, NULL }, /* Mongolia */ - { "no", KBD_NORWEGIAN, no_variants }, /* Norway */ - { "pl", KBD_POLISH_214, pl_variants }, /* Poland */ - { "pt", KBD_PORTUGUESE, pt_variants }, /* Portugal */ - { "ro", KBD_ROMANIAN, ro_variants }, /* Romania */ - { "ru", KBD_RUSSIAN, ru_variants }, /* Russia */ - { "rs", KBD_SERBIAN_LATIN, rs_variants }, /* Serbia */ - { "si", KBD_SLOVENIAN, si_variants }, /* Slovenia */ - { "sk", KBD_SLOVAK, sk_variants }, /* Slovakia */ - { "es", KBD_SPANISH, es_variants }, /* Spain */ - { "se", KBD_SWEDISH, se_variants }, /* Sweden */ - { "ch", KBD_SWISS_FRENCH, ch_variants }, /* Switzerland */ - { "sy", KBD_SYRIAC, sy_variants }, /* Syria */ - { "tj", 0, tj_variants }, /* Tajikistan */ - { "lk", 0, lk_variants }, /* Sri Lanka */ - { "th", KBD_THAI_KEDMANEE, th_variants }, /* Thailand */ - { "tr", KBD_TURKISH_Q, tr_variants }, /* Turkey */ - { "ua", KBD_UKRAINIAN, ua_variants }, /* Ukraine */ - { "gb", KBD_UNITED_KINGDOM, gb_variants }, /* United Kingdom */ - { "uz", KBD_UZBEK_CYRILLIC, uz_variants }, /* Uzbekistan */ - { "vn", KBD_VIETNAMESE, NULL }, /* Vietnam */ - { "kr", KBD_KOREAN_INPUT_SYSTEM_IME_2000, kr_variants }, /* Korea, Republic of */ - { "ie", KBD_UNITED_KINGDOM, ie_variants }, /* Ireland */ - { "pk", 0, pk_variants }, /* Pakistan */ - { "mv", 0, NULL }, /* Maldives */ - { "za", KBD_US, NULL }, /* South Africa */ - { "epo", 0, epo_variants }, /* Esperanto */ - { "np", KBD_NEPALI, NULL }, /* Nepal */ - { "ng", 0, ng_variants }, /* Nigeria */ - { "et", 0, NULL }, /* Ethiopia */ - { "sn", 0, NULL }, /* Senegal */ - { "brai", 0, brai_variants }, /* Braille */ - { "tm", KBD_TURKISH_Q, tm_variants }, /* Turkmenistan */ +static const XKB_LAYOUT xkbLayouts[] = { + { "us", KBD_US, us_variants }, /* USA */ + { "ad", 0, NULL }, /* Andorra */ + { "af", KBD_FARSI, af_variants }, /* Afghanistan */ + { "ara", KBD_ARABIC_101, ara_variants }, /* Arabic */ + { "al", 0, NULL }, /* Albania */ + { "am", KBD_ARMENIAN_EASTERN, am_variants }, /* Armenia */ + { "az", KBD_AZERI_CYRILLIC, az_variants }, /* Azerbaijan */ + { "by", KBD_BELARUSIAN, by_variants }, /* Belarus */ + { "be", KBD_BELGIAN_FRENCH, be_variants }, /* Belgium */ + { "bd", KBD_BENGALI, bd_variants }, /* Bangladesh */ + { "in", KBD_HINDI_TRADITIONAL, in_variants }, /* India */ + { "ba", KBD_CROATIAN, ba_variants }, /* Bosnia and Herzegovina */ + { "br", KBD_PORTUGUESE_BRAZILIAN_ABNT, br_variants }, /* Brazil */ + { "bg", KBD_BULGARIAN_LATIN, bg_variants }, /* Bulgaria */ + { "ma", KBD_FRENCH, ma_variants }, /* Morocco */ + { "mm", 0, NULL }, /* Myanmar */ + { "ca", KBD_US, ca_variants }, /* Canada */ + { "cd", 0, NULL }, /* Congo, Democratic Republic of the */ + { "cn", KBD_CHINESE_TRADITIONAL_PHONETIC, cn_variants }, /* China */ + { "hr", KBD_CROATIAN, hr_variants }, /* Croatia */ + { "cz", KBD_CZECH, cz_variants }, /* Czechia */ + { "dk", KBD_DANISH, dk_variants }, /* Denmark */ + { "nl", KBD_DUTCH, nl_variants }, /* Netherlands */ + { "bt", 0, NULL }, /* Bhutan */ + { "ee", KBD_ESTONIAN, ee_variants }, /* Estonia */ + { "ir", 0, ir_variants }, /* Iran */ + { "iq", 0, iq_variants }, /* Iraq */ + { "fo", 0, fo_variants }, /* Faroe Islands */ + { "fi", KBD_FINNISH, fi_variants }, /* Finland */ + { "fr", KBD_FRENCH, fr_variants }, /* France */ + { "gh", 0, gh_variants }, /* Ghana */ + { "gn", 0, NULL }, /* Guinea */ + { "ge", KBD_GEORGIAN, ge_variants }, /* Georgia */ + { "de", KBD_GERMAN, de_variants }, /* Germany */ + { "gr", KBD_GREEK, gr_variants }, /* Greece */ + { "hu", KBD_HUNGARIAN, hu_variants }, /* Hungary */ + { "is", KBD_ICELANDIC, is_variants }, /* Iceland */ + { "il", KBD_HEBREW, il_variants }, /* Israel */ + { "it", KBD_ITALIAN, it_variants }, /* Italy */ + { "jp", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002, jp_variants }, /* Japan */ + { "kg", 0, kg_variants }, /* Kyrgyzstan */ + { "kh", 0, NULL }, /* Cambodia */ + { "kz", KBD_KAZAKH, kz_variants }, /* Kazakhstan */ + { "la", 0, NULL }, /* Laos */ + { "latam", KBD_LATIN_AMERICAN, latam_variants }, /* Latin America */ + { "lt", KBD_LITHUANIAN, lt_variants }, /* Lithuania */ + { "lv", KBD_LATVIAN, lv_variants }, /* Latvia */ + { "mao", KBD_MAORI, NULL }, /* Maori */ + { "me", KBD_SERBIAN_LATIN, me_variants }, /* Montenegro */ + { "mk", KBD_FYRO_MACEDONIAN, mk_variants }, /* Macedonia */ + { "mt", KBD_MALTESE_48_KEY, mt_variants }, /* Malta */ + { "mn", KBD_MONGOLIAN_CYRILLIC, NULL }, /* Mongolia */ + { "no", KBD_NORWEGIAN, no_variants }, /* Norway */ + { "pl", KBD_POLISH_214, pl_variants }, /* Poland */ + { "pt", KBD_PORTUGUESE, pt_variants }, /* Portugal */ + { "ro", KBD_ROMANIAN, ro_variants }, /* Romania */ + { "ru", KBD_RUSSIAN, ru_variants }, /* Russia */ + { "rs", KBD_SERBIAN_LATIN, rs_variants }, /* Serbia */ + { "si", KBD_SLOVENIAN, si_variants }, /* Slovenia */ + { "sk", KBD_SLOVAK, sk_variants }, /* Slovakia */ + { "es", KBD_SPANISH, es_variants }, /* Spain */ + { "se", KBD_SWEDISH, se_variants }, /* Sweden */ + { "ch", KBD_SWISS_FRENCH, ch_variants }, /* Switzerland */ + { "sy", KBD_SYRIAC, sy_variants }, /* Syria */ + { "tj", 0, tj_variants }, /* Tajikistan */ + { "lk", 0, lk_variants }, /* Sri Lanka */ + { "th", KBD_THAI_KEDMANEE, th_variants }, /* Thailand */ + { "tr", KBD_TURKISH_Q, tr_variants }, /* Turkey */ + { "ua", KBD_UKRAINIAN, ua_variants }, /* Ukraine */ + { "gb", KBD_UNITED_KINGDOM, gb_variants }, /* United Kingdom */ + { "uz", KBD_UZBEK_CYRILLIC, uz_variants }, /* Uzbekistan */ + { "vn", KBD_VIETNAMESE, NULL }, /* Vietnam */ + { "kr", KBD_KOREAN_INPUT_SYSTEM_IME_2000, kr_variants }, /* Korea, Republic of */ + { "ie", KBD_UNITED_KINGDOM, ie_variants }, /* Ireland */ + { "pk", 0, pk_variants }, /* Pakistan */ + { "mv", 0, NULL }, /* Maldives */ + { "za", KBD_US, NULL }, /* South Africa */ + { "epo", 0, epo_variants }, /* Esperanto */ + { "np", KBD_NEPALI, NULL }, /* Nepal */ + { "ng", 0, ng_variants }, /* Nigeria */ + { "et", 0, NULL }, /* Ethiopia */ + { "sn", 0, NULL }, /* Senegal */ + { "brai", 0, brai_variants }, /* Braille */ + { "tm", KBD_TURKISH_Q, tm_variants }, /* Turkmenistan */ }; UINT32 find_keyboard_layout_in_xorg_rules(char* layout, char* variant) @@ -909,7 +842,7 @@ UINT32 find_keyboard_layout_in_xorg_rules(char* layout, char* variant) { if (strcmp(xkbLayouts[i].layout, layout) == 0) { - const XKB_VARIANT *variants = xkbLayouts[i].variants; + const XKB_VARIANT* variants = xkbLayouts[i].variants; if (variants) { for (j = 0; variants[j].variant != NULL && strlen(variants[j].variant) > 0; j++) diff --git a/libfreerdp/locale/xkb_layout_ids.h b/libfreerdp/locale/xkb_layout_ids.h index 1816f0878..70cc23d09 100644 --- a/libfreerdp/locale/xkb_layout_ids.h +++ b/libfreerdp/locale/xkb_layout_ids.h @@ -23,7 +23,6 @@ #include #include -FREERDP_LOCAL UINT32 find_keyboard_layout_in_xorg_rules(char* layout, - char* variant); +FREERDP_LOCAL UINT32 find_keyboard_layout_in_xorg_rules(char* layout, char* variant); #endif /* FREERDP_LIB_LOCALE_XKB_LAYOUT_IDS_H */ diff --git a/libfreerdp/primitives/prim_YCoCg.c b/libfreerdp/primitives/prim_YCoCg.c index 5f5c3b7c5..762efcd62 100644 --- a/libfreerdp/primitives/prim_YCoCg.c +++ b/libfreerdp/primitives/prim_YCoCg.c @@ -27,12 +27,9 @@ #include "prim_internal.h" /* ------------------------------------------------------------------------- */ -static pstatus_t general_YCoCgToRGB_8u_AC4R( - const BYTE* pSrc, INT32 srcStep, - BYTE* pDst, UINT32 DstFormat, INT32 dstStep, - UINT32 width, UINT32 height, - UINT8 shift, - BOOL withAlpha) +static pstatus_t general_YCoCgToRGB_8u_AC4R(const BYTE* pSrc, INT32 srcStep, BYTE* pDst, + UINT32 DstFormat, INT32 dstStep, UINT32 width, + UINT32 height, UINT8 shift, BOOL withAlpha) { BYTE A; UINT32 x, y; @@ -41,7 +38,7 @@ static pstatus_t general_YCoCgToRGB_8u_AC4R( INT16 Cg, Co, Y, T, R, G, B; const DWORD formatSize = GetBytesPerPixel(DstFormat); fkt_writePixel writePixel = getPixelWriteFunction(DstFormat); - int cll = shift - 1; /* -1 builds in the /2's */ + int cll = shift - 1; /* -1 builds in the /2's */ UINT32 srcPad = srcStep - (width * 4); UINT32 dstPad = dstStep - (width * formatSize); @@ -52,18 +49,17 @@ static pstatus_t general_YCoCgToRGB_8u_AC4R( /* Note: shifts must be done before sign-conversion. */ Cg = (INT16)((INT8)((*sptr++) << cll)); Co = (INT16)((INT8)((*sptr++) << cll)); - Y = (INT16)(*sptr++); /* UINT8->INT16 */ + Y = (INT16)(*sptr++); /* UINT8->INT16 */ A = *sptr++; if (!withAlpha) A = 0xFFU; - T = Y - Cg; - R = T + Co; - G = Y + Cg; - B = T - Co; - dptr = (*writePixel)(dptr, formatSize, DstFormat, CLIP(R), - CLIP(G), CLIP(B), A); + T = Y - Cg; + R = T + Co; + G = Y + Cg; + B = T - Co; + dptr = (*writePixel)(dptr, formatSize, DstFormat, CLIP(R), CLIP(G), CLIP(B), A); } sptr += srcPad; diff --git a/libfreerdp/primitives/prim_YCoCg_opt.c b/libfreerdp/primitives/prim_YCoCg_opt.c index eb93a7ba3..4c9afba6e 100644 --- a/libfreerdp/primitives/prim_YCoCg_opt.c +++ b/libfreerdp/primitives/prim_YCoCg_opt.c @@ -39,15 +39,12 @@ static primitives_t* generic = NULL; #ifdef WITH_SSE2 /* ------------------------------------------------------------------------- */ -static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_invert( - const BYTE* pSrc, UINT32 srcStep, - BYTE* pDst, UINT32 DstFormat, UINT32 dstStep, - UINT32 width, UINT32 height, - UINT8 shift, - BOOL withAlpha) +static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_invert(const BYTE* pSrc, UINT32 srcStep, BYTE* pDst, + UINT32 DstFormat, UINT32 dstStep, UINT32 width, + UINT32 height, UINT8 shift, BOOL withAlpha) { const BYTE* sptr = pSrc; - BYTE* dptr = (BYTE*) pDst; + BYTE* dptr = (BYTE*)pDst; int sRowBump = srcStep - width * sizeof(UINT32); int dRowBump = dstStep - width * sizeof(UINT32); UINT32 h; @@ -66,12 +63,11 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_invert( * where Y is 8-bit unsigned and o & g are 8-bit signed. */ - if ((width < 8) || (ULONG_PTR) dptr & 0x03) + if ((width < 8) || (ULONG_PTR)dptr & 0x03) { /* Too small, or we'll never hit a 16-byte boundary. Punt. */ - return generic->YCoCgToRGB_8u_AC4R( - pSrc, srcStep, pDst, DstFormat, dstStep, - width, height, shift, withAlpha); + return generic->YCoCgToRGB_8u_AC4R(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, + shift, withAlpha); } for (h = 0; h < height; h++) @@ -80,16 +76,16 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_invert( BOOL onStride; /* Get to a 16-byte destination boundary. */ - if ((ULONG_PTR) dptr & 0x0f) + if ((ULONG_PTR)dptr & 0x0f) { pstatus_t status; - UINT32 startup = (16 - ((ULONG_PTR) dptr & 0x0f)) / 4; + UINT32 startup = (16 - ((ULONG_PTR)dptr & 0x0f)) / 4; - if (startup > width) startup = width; + if (startup > width) + startup = width; - status = generic->YCoCgToRGB_8u_AC4R( - sptr, srcStep, dptr, DstFormat, dstStep, - startup, 1, shift, withAlpha); + status = generic->YCoCgToRGB_8u_AC4R(sptr, srcStep, dptr, DstFormat, dstStep, startup, + 1, shift, withAlpha); if (status != PRIMITIVES_SUCCESS) return status; @@ -100,7 +96,7 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_invert( } /* Each loop handles eight pixels at a time. */ - onStride = (((ULONG_PTR) sptr & 0x0f) == 0) ? TRUE : FALSE; + onStride = (((ULONG_PTR)sptr & 0x0f) == 0) ? TRUE : FALSE; while (w >= 8) { @@ -109,17 +105,17 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_invert( if (onStride) { /* The faster path, 16-byte aligned load. */ - R0 = _mm_load_si128((__m128i*) sptr); + R0 = _mm_load_si128((__m128i*)sptr); sptr += (128 / 8); - R1 = _mm_load_si128((__m128i*) sptr); + R1 = _mm_load_si128((__m128i*)sptr); sptr += (128 / 8); } else { /* Off-stride, slower LDDQU load. */ - R0 = _mm_lddqu_si128((__m128i*) sptr); + R0 = _mm_lddqu_si128((__m128i*)sptr); sptr += (128 / 8); - R1 = _mm_lddqu_si128((__m128i*) sptr); + R1 = _mm_lddqu_si128((__m128i*)sptr); sptr += (128 / 8); } @@ -137,8 +133,10 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_invert( /* R5 = a7a6a5a4 a3a2a1a0 y7y6y5y4 y3y2y1y0 */ /* R6 = o7o6o5o4 o3o2o1o0 g7g6g5g4 g3g2g1g0 */ /* Save alphas aside */ - if (withAlpha) R7 = _mm_unpackhi_epi64(R5, R5); - else R7 = _mm_set1_epi32(0xFFFFFFFFU); + if (withAlpha) + R7 = _mm_unpackhi_epi64(R5, R5); + else + R7 = _mm_set1_epi32(0xFFFFFFFFU); /* R7 = a7a6a5a4 a3a2a1a0 a7a6a5a4 a3a2a1a0 */ /* Expand Y's from 8-bit unsigned to 16-bit signed. */ @@ -191,9 +189,9 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_invert( /* R4 = A3R3G3B3 A2R2G2B2 A1R1G1B1 A0R0G0B0 */ R5 = _mm_unpackhi_epi16(R2, R3); /* R5 = A7R7G7B7 A6R6G6B6 A5R6G5B5 A4R4G4B4 */ - _mm_store_si128((__m128i*) dptr, R4); + _mm_store_si128((__m128i*)dptr, R4); dptr += (128 / 8); - _mm_store_si128((__m128i*) dptr, R5); + _mm_store_si128((__m128i*)dptr, R5); dptr += (128 / 8); w -= 8; } @@ -202,9 +200,8 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_invert( if (w > 0) { pstatus_t status; - status = generic->YCoCgToRGB_8u_AC4R( - sptr, srcStep, dptr, DstFormat, dstStep, - w, 1, shift, withAlpha); + status = generic->YCoCgToRGB_8u_AC4R(sptr, srcStep, dptr, DstFormat, dstStep, w, 1, + shift, withAlpha); if (status != PRIMITIVES_SUCCESS) return status; @@ -221,15 +218,12 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_invert( } /* ------------------------------------------------------------------------- */ -static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_no_invert( - const BYTE* pSrc, UINT32 srcStep, - BYTE* pDst, UINT32 DstFormat, UINT32 dstStep, - UINT32 width, UINT32 height, - UINT8 shift, - BOOL withAlpha) +static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_no_invert(const BYTE* pSrc, UINT32 srcStep, BYTE* pDst, + UINT32 DstFormat, UINT32 dstStep, UINT32 width, + UINT32 height, UINT8 shift, BOOL withAlpha) { const BYTE* sptr = pSrc; - BYTE* dptr = (BYTE*) pDst; + BYTE* dptr = (BYTE*)pDst; int sRowBump = srcStep - width * sizeof(UINT32); int dRowBump = dstStep - width * sizeof(UINT32); UINT32 h; @@ -248,12 +242,11 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_no_invert( * where Y is 8-bit unsigned and o & g are 8-bit signed. */ - if ((width < 8) || (ULONG_PTR) dptr & 0x03) + if ((width < 8) || (ULONG_PTR)dptr & 0x03) { /* Too small, or we'll never hit a 16-byte boundary. Punt. */ - return generic->YCoCgToRGB_8u_AC4R( - pSrc, srcStep, pDst, DstFormat, dstStep, - width, height, shift, withAlpha); + return generic->YCoCgToRGB_8u_AC4R(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, + shift, withAlpha); } for (h = 0; h < height; h++) @@ -262,16 +255,16 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_no_invert( BOOL onStride; /* Get to a 16-byte destination boundary. */ - if ((ULONG_PTR) dptr & 0x0f) + if ((ULONG_PTR)dptr & 0x0f) { pstatus_t status; - UINT32 startup = (16 - ((ULONG_PTR) dptr & 0x0f)) / 4; + UINT32 startup = (16 - ((ULONG_PTR)dptr & 0x0f)) / 4; - if (startup > width) startup = width; + if (startup > width) + startup = width; - status = generic->YCoCgToRGB_8u_AC4R( - sptr, srcStep, dptr, DstFormat, - dstStep, startup, 1, shift, withAlpha); + status = generic->YCoCgToRGB_8u_AC4R(sptr, srcStep, dptr, DstFormat, dstStep, startup, + 1, shift, withAlpha); if (status != PRIMITIVES_SUCCESS) return status; @@ -282,7 +275,7 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_no_invert( } /* Each loop handles eight pixels at a time. */ - onStride = (((ULONG_PTR) sptr & 0x0f) == 0) ? TRUE : FALSE; + onStride = (((ULONG_PTR)sptr & 0x0f) == 0) ? TRUE : FALSE; while (w >= 8) { @@ -291,17 +284,17 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_no_invert( if (onStride) { /* The faster path, 16-byte aligned load. */ - R0 = _mm_load_si128((__m128i*) sptr); + R0 = _mm_load_si128((__m128i*)sptr); sptr += (128 / 8); - R1 = _mm_load_si128((__m128i*) sptr); + R1 = _mm_load_si128((__m128i*)sptr); sptr += (128 / 8); } else { /* Off-stride, slower LDDQU load. */ - R0 = _mm_lddqu_si128((__m128i*) sptr); + R0 = _mm_lddqu_si128((__m128i*)sptr); sptr += (128 / 8); - R1 = _mm_lddqu_si128((__m128i*) sptr); + R1 = _mm_lddqu_si128((__m128i*)sptr); sptr += (128 / 8); } @@ -319,8 +312,10 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_no_invert( /* R5 = a7a6a5a4 a3a2a1a0 y7y6y5y4 y3y2y1y0 */ /* R6 = o7o6o5o4 o3o2o1o0 g7g6g5g4 g3g2g1g0 */ /* Save alphas aside */ - if (withAlpha) R7 = _mm_unpackhi_epi64(R5, R5); - else R7 = _mm_set1_epi32(0xFFFFFFFFU); + if (withAlpha) + R7 = _mm_unpackhi_epi64(R5, R5); + else + R7 = _mm_set1_epi32(0xFFFFFFFFU); /* R7 = a7a6a5a4 a3a2a1a0 a7a6a5a4 a3a2a1a0 */ /* Expand Y's from 8-bit unsigned to 16-bit signed. */ @@ -377,9 +372,9 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_no_invert( /* R4 = A3R3G3B3 A2R2G2B2 A1R1G1B1 A0R0G0B0 */ R5 = _mm_unpackhi_epi16(R2, R3); /* R5 = A7R7G7B7 A6R6G6B6 A5R6G5B5 A4R4G4B4 */ - _mm_store_si128((__m128i*) dptr, R4); + _mm_store_si128((__m128i*)dptr, R4); dptr += (128 / 8); - _mm_store_si128((__m128i*) dptr, R5); + _mm_store_si128((__m128i*)dptr, R5); dptr += (128 / 8); w -= 8; } @@ -388,9 +383,8 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_no_invert( if (w > 0) { pstatus_t status; - status = generic->YCoCgToRGB_8u_AC4R( - sptr, srcStep, dptr, DstFormat, dstStep, - w, 1, shift, withAlpha); + status = generic->YCoCgToRGB_8u_AC4R(sptr, srcStep, dptr, DstFormat, dstStep, w, 1, + shift, withAlpha); if (status != PRIMITIVES_SUCCESS) return status; @@ -409,45 +403,38 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_no_invert( #ifdef WITH_SSE2 /* ------------------------------------------------------------------------- */ -static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R( - const BYTE* pSrc, INT32 srcStep, - BYTE* pDst, UINT32 DstFormat, INT32 dstStep, - UINT32 width, UINT32 height, - UINT8 shift, - BOOL withAlpha) +static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R(const BYTE* pSrc, INT32 srcStep, BYTE* pDst, + UINT32 DstFormat, INT32 dstStep, UINT32 width, + UINT32 height, UINT8 shift, BOOL withAlpha) { switch (DstFormat) { case PIXEL_FORMAT_BGRX32: case PIXEL_FORMAT_BGRA32: - return ssse3_YCoCgRToRGB_8u_AC4R_no_invert( - pSrc, srcStep, pDst, DstFormat, dstStep, - width, height, shift, withAlpha); + return ssse3_YCoCgRToRGB_8u_AC4R_no_invert(pSrc, srcStep, pDst, DstFormat, dstStep, + width, height, shift, withAlpha); case PIXEL_FORMAT_RGBX32: case PIXEL_FORMAT_RGBA32: - return ssse3_YCoCgRToRGB_8u_AC4R_invert( - pSrc, srcStep, pDst, DstFormat, dstStep, - width, height, shift, withAlpha); + return ssse3_YCoCgRToRGB_8u_AC4R_invert(pSrc, srcStep, pDst, DstFormat, dstStep, width, + height, shift, withAlpha); default: - return generic->YCoCgToRGB_8u_AC4R(pSrc, srcStep, pDst, DstFormat, - dstStep, width, height, shift, withAlpha); + return generic->YCoCgToRGB_8u_AC4R(pSrc, srcStep, pDst, DstFormat, dstStep, width, + height, shift, withAlpha); } } #elif defined(WITH_NEON) -static pstatus_t neon_YCoCgToRGB_8u_X( - const BYTE* pSrc, INT32 srcStep, - BYTE* pDst, UINT32 DstFormat, INT32 dstStep, - UINT32 width, UINT32 height, - UINT8 shift, BYTE rPos, BYTE gPos, BYTE bPos, BYTE aPos, BOOL alpha) +static pstatus_t neon_YCoCgToRGB_8u_X(const BYTE* pSrc, INT32 srcStep, BYTE* pDst, UINT32 DstFormat, + INT32 dstStep, UINT32 width, UINT32 height, UINT8 shift, + BYTE rPos, BYTE gPos, BYTE bPos, BYTE aPos, BOOL alpha) { UINT32 y; BYTE* dptr = pDst; const BYTE* sptr = pSrc; const DWORD formatSize = GetBytesPerPixel(DstFormat); - const int8_t cll = shift - 1; /* -1 builds in the /2's */ + const int8_t cll = shift - 1; /* -1 builds in the /2's */ const UINT32 srcPad = srcStep - (width * 4); const UINT32 dstPad = dstStep - (width * formatSize); const UINT32 pad = width % 8; @@ -466,11 +453,11 @@ static pstatus_t neon_YCoCgToRGB_8u_X( const int8x8_t CoRaw = vreinterpret_s8_u8(vshl_u8(raw.val[1], cllv)); const int16x8_t Cg = vmovl_s8(CgRaw); const int16x8_t Co = vmovl_s8(CoRaw); - const int16x8_t Y = vreinterpretq_s16_u16(vmovl_u8(raw.val[2])); /* UINT8 -> INT16 */ - const int16x8_t T = vsubq_s16(Y, Cg); - const int16x8_t R = vaddq_s16(T, Co); - const int16x8_t G = vaddq_s16(Y, Cg); - const int16x8_t B = vsubq_s16(T, Co); + const int16x8_t Y = vreinterpretq_s16_u16(vmovl_u8(raw.val[2])); /* UINT8 -> INT16 */ + const int16x8_t T = vsubq_s16(Y, Cg); + const int16x8_t R = vaddq_s16(T, Co); + const int16x8_t G = vaddq_s16(Y, Cg); + const int16x8_t B = vsubq_s16(T, Co); uint8x8x4_t bgrx; bgrx.val[bPos] = vqmovun_s16(B); bgrx.val[gPos] = vqmovun_s16(G); @@ -491,11 +478,11 @@ static pstatus_t neon_YCoCgToRGB_8u_X( /* Note: shifts must be done before sign-conversion. */ const INT16 Cg = (INT16)((INT8)((*sptr++) << cll)); const INT16 Co = (INT16)((INT8)((*sptr++) << cll)); - const INT16 Y = (INT16)(*sptr++); /* UINT8->INT16 */ - const INT16 T = Y - Cg; - const INT16 R = T + Co; - const INT16 G = Y + Cg; - const INT16 B = T - Co; + const INT16 Y = (INT16)(*sptr++); /* UINT8->INT16 */ + const INT16 T = Y - Cg; + const INT16 R = T + Co; + const INT16 G = Y + Cg; + const INT16 B = T - Co; BYTE bgra[4]; bgra[bPos] = CLIP(B); bgra[gPos] = CLIP(G); @@ -517,50 +504,47 @@ static pstatus_t neon_YCoCgToRGB_8u_X( return PRIMITIVES_SUCCESS; } -static pstatus_t neon_YCoCgToRGB_8u_AC4R( - const BYTE* pSrc, INT32 srcStep, - BYTE* pDst, UINT32 DstFormat, INT32 dstStep, - UINT32 width, UINT32 height, - UINT8 shift, - BOOL withAlpha) +static pstatus_t neon_YCoCgToRGB_8u_AC4R(const BYTE* pSrc, INT32 srcStep, BYTE* pDst, + UINT32 DstFormat, INT32 dstStep, UINT32 width, + UINT32 height, UINT8 shift, BOOL withAlpha) { switch (DstFormat) { case PIXEL_FORMAT_BGRA32: - return neon_YCoCgToRGB_8u_X(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, shift, 2, 1, 0, - 3, withAlpha); + return neon_YCoCgToRGB_8u_X(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, + shift, 2, 1, 0, 3, withAlpha); case PIXEL_FORMAT_BGRX32: - return neon_YCoCgToRGB_8u_X(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, shift, 2, 1, 0, - 3, withAlpha); + return neon_YCoCgToRGB_8u_X(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, + shift, 2, 1, 0, 3, withAlpha); case PIXEL_FORMAT_RGBA32: - return neon_YCoCgToRGB_8u_X(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, shift, 0, 1, 2, - 3, withAlpha); + return neon_YCoCgToRGB_8u_X(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, + shift, 0, 1, 2, 3, withAlpha); case PIXEL_FORMAT_RGBX32: - return neon_YCoCgToRGB_8u_X(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, shift, 0, 1, 2, - 3, withAlpha); + return neon_YCoCgToRGB_8u_X(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, + shift, 0, 1, 2, 3, withAlpha); case PIXEL_FORMAT_ARGB32: - return neon_YCoCgToRGB_8u_X(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, shift, 1, 2, 3, - 0, withAlpha); + return neon_YCoCgToRGB_8u_X(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, + shift, 1, 2, 3, 0, withAlpha); case PIXEL_FORMAT_XRGB32: - return neon_YCoCgToRGB_8u_X(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, shift, 1, 2, 3, - 0, withAlpha); + return neon_YCoCgToRGB_8u_X(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, + shift, 1, 2, 3, 0, withAlpha); case PIXEL_FORMAT_ABGR32: - return neon_YCoCgToRGB_8u_X(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, shift, 3, 2, 1, - 0, withAlpha); + return neon_YCoCgToRGB_8u_X(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, + shift, 3, 2, 1, 0, withAlpha); case PIXEL_FORMAT_XBGR32: - return neon_YCoCgToRGB_8u_X(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, shift, 3, 2, 1, - 0, withAlpha); + return neon_YCoCgToRGB_8u_X(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, + shift, 3, 2, 1, 0, withAlpha); default: - return generic->YCoCgToRGB_8u_AC4R(pSrc, srcStep, pDst, DstFormat, dstStep, width, height, shift, - withAlpha); + return generic->YCoCgToRGB_8u_AC4R(pSrc, srcStep, pDst, DstFormat, dstStep, width, + height, shift, withAlpha); } } #endif /* WITH_SSE2 */ @@ -576,8 +560,8 @@ void primitives_init_YCoCg_opt(primitives_t* prims) */ #if defined(WITH_SSE2) - if (IsProcessorFeaturePresentEx(PF_EX_SSSE3) - && IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE)) + if (IsProcessorFeaturePresentEx(PF_EX_SSSE3) && + IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE)) { prims->YCoCgToRGB_8u_AC4R = ssse3_YCoCgRToRGB_8u_AC4R; } diff --git a/libfreerdp/primitives/prim_YUV.c b/libfreerdp/primitives/prim_YUV.c index 1579ce7bd..9ffb6b6e4 100644 --- a/libfreerdp/primitives/prim_YUV.c +++ b/libfreerdp/primitives/prim_YUV.c @@ -43,18 +43,12 @@ static pstatus_t general_LumaToYUV444(const BYTE* pSrcRaw[3], const UINT32 srcSt const UINT32 evenY = 0; const UINT32 oddX = 1; const UINT32 evenX = 0; - const BYTE* pSrc[3] = - { - pSrcRaw[0] + roi->top* srcStep[0] + roi->left, - pSrcRaw[1] + roi->top / 2 * srcStep[1] + roi->left / 2, - pSrcRaw[2] + roi->top / 2 * srcStep[2] + roi->left / 2 - }; - BYTE* pDst[3] = - { - pDstRaw[0] + roi->top* dstStep[0] + roi->left, - pDstRaw[1] + roi->top* dstStep[1] + roi->left, - pDstRaw[2] + roi->top* dstStep[2] + roi->left - }; + const BYTE* pSrc[3] = { pSrcRaw[0] + roi->top * srcStep[0] + roi->left, + pSrcRaw[1] + roi->top / 2 * srcStep[1] + roi->left / 2, + pSrcRaw[2] + roi->top / 2 * srcStep[2] + roi->left / 2 }; + BYTE* pDst[3] = { pDstRaw[0] + roi->top * dstStep[0] + roi->left, + pDstRaw[1] + roi->top * dstStep[1] + roi->left, + pDstRaw[2] + roi->top * dstStep[2] + roi->left }; /* Y data is already here... */ /* B1 */ @@ -143,8 +137,8 @@ static pstatus_t general_ChromaFilter(BYTE* pDst[3], const UINT32 dstStep[3], } static pstatus_t general_ChromaV1ToYUV444(const BYTE* pSrcRaw[3], const UINT32 srcStep[3], - BYTE* pDstRaw[3], const UINT32 dstStep[3], - const RECTANGLE_16* roi) + BYTE* pDstRaw[3], const UINT32 dstStep[3], + const RECTANGLE_16* roi) { const UINT32 mod = 16; UINT32 uY = 0; @@ -160,18 +154,12 @@ static pstatus_t general_ChromaV1ToYUV444(const BYTE* pSrcRaw[3], const UINT32 s /* The auxilary frame is aligned to multiples of 16x16. * We need the padded height for B4 and B5 conversion. */ const UINT32 padHeigth = nHeight + 16 - nHeight % 16; - const BYTE* pSrc[3] = - { - pSrcRaw[0] + roi->top* srcStep[0] + roi->left, - pSrcRaw[1] + roi->top / 2 * srcStep[1] + roi->left / 2, - pSrcRaw[2] + roi->top / 2 * srcStep[2] + roi->left / 2 - }; - BYTE* pDst[3] = - { - pDstRaw[0] + roi->top* dstStep[0] + roi->left, - pDstRaw[1] + roi->top* dstStep[1] + roi->left, - pDstRaw[2] + roi->top* dstStep[2] + roi->left - }; + const BYTE* pSrc[3] = { pSrcRaw[0] + roi->top * srcStep[0] + roi->left, + pSrcRaw[1] + roi->top / 2 * srcStep[1] + roi->left / 2, + pSrcRaw[2] + roi->top / 2 * srcStep[2] + roi->left / 2 }; + BYTE* pDst[3] = { pDstRaw[0] + roi->top * dstStep[0] + roi->left, + pDstRaw[1] + roi->top * dstStep[1] + roi->left, + pDstRaw[2] + roi->top * dstStep[2] + roi->left }; /* The second half of U and V is a bit more tricky... */ /* B4 and B5 */ @@ -224,9 +212,8 @@ static pstatus_t general_ChromaV1ToYUV444(const BYTE* pSrcRaw[3], const UINT32 s } static pstatus_t general_ChromaV2ToYUV444(const BYTE* pSrc[3], const UINT32 srcStep[3], - UINT32 nTotalWidth, UINT32 nTotalHeight, - BYTE* pDst[3], const UINT32 dstStep[3], - const RECTANGLE_16* roi) + UINT32 nTotalWidth, UINT32 nTotalHeight, BYTE* pDst[3], + const UINT32 dstStep[3], const RECTANGLE_16* roi) { UINT32 x, y; const UINT32 nWidth = roi->right - roi->left; @@ -274,12 +261,10 @@ static pstatus_t general_ChromaV2ToYUV444(const BYTE* pSrc[3], const UINT32 srcS return general_ChromaFilter(pDst, dstStep, roi); } -static pstatus_t general_YUV420CombineToYUV444( - avc444_frame_type type, - const BYTE* pSrc[3], const UINT32 srcStep[3], - UINT32 nWidth, UINT32 nHeight, - BYTE* pDst[3], const UINT32 dstStep[3], - const RECTANGLE_16* roi) +static pstatus_t general_YUV420CombineToYUV444(avc444_frame_type type, const BYTE* pSrc[3], + const UINT32 srcStep[3], UINT32 nWidth, + UINT32 nHeight, BYTE* pDst[3], + const UINT32 dstStep[3], const RECTANGLE_16* roi) { if (!pSrc || !pSrc[0] || !pSrc[1] || !pSrc[2]) return -1; @@ -306,11 +291,10 @@ static pstatus_t general_YUV420CombineToYUV444( } } -static pstatus_t general_YUV444SplitToYUV420( - const BYTE* pSrc[3], const UINT32 srcStep[3], - BYTE* pMainDst[3], const UINT32 dstMainStep[3], - BYTE* pAuxDst[3], const UINT32 dstAuxStep[3], - const prim_size_t* roi) +static pstatus_t general_YUV444SplitToYUV420(const BYTE* pSrc[3], const UINT32 srcStep[3], + BYTE* pMainDst[3], const UINT32 dstMainStep[3], + BYTE* pAuxDst[3], const UINT32 dstAuxStep[3], + const prim_size_t* roi) { UINT32 x, y, uY = 0, vY = 0; UINT32 halfWidth, halfHeight; @@ -341,10 +325,8 @@ static pstatus_t general_YUV444SplitToYUV420( for (x = 0; x < halfWidth; x++) { /* Filter */ - const INT32 u = pSrcU[2 * x] + pSrcU[2 * x + 1] + pSrcU1[2 * x] - + pSrcU1[2 * x + 1]; - const INT32 v = pSrcV[2 * x] + pSrcV[2 * x + 1] + pSrcV1[2 * x] - + pSrcV1[2 * x + 1]; + const INT32 u = pSrcU[2 * x] + pSrcU[2 * x + 1] + pSrcU1[2 * x] + pSrcU1[2 * x + 1]; + const INT32 v = pSrcV[2 * x] + pSrcV[2 * x + 1] + pSrcV1[2 * x] + pSrcV1[2 * x + 1]; pU[x] = CLIP(u / 4L); pV[x] = CLIP(v / 4L); } @@ -395,10 +377,9 @@ static pstatus_t general_YUV444SplitToYUV420( return PRIMITIVES_SUCCESS; } -static pstatus_t general_YUV444ToRGB_8u_P3AC4R_general( - const BYTE* pSrc[3], const UINT32 srcStep[3], - BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, - const prim_size_t* roi) +static pstatus_t general_YUV444ToRGB_8u_P3AC4R_general(const BYTE* pSrc[3], const UINT32 srcStep[3], + BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, + const prim_size_t* roi) { UINT32 x, y; UINT32 nWidth, nHeight; @@ -429,10 +410,9 @@ static pstatus_t general_YUV444ToRGB_8u_P3AC4R_general( return PRIMITIVES_SUCCESS; } -static pstatus_t general_YUV444ToRGB_8u_P3AC4R_BGRX( - const BYTE* pSrc[3], const UINT32 srcStep[3], - BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, - const prim_size_t* roi) +static pstatus_t general_YUV444ToRGB_8u_P3AC4R_BGRX(const BYTE* pSrc[3], const UINT32 srcStep[3], + BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, + const prim_size_t* roi) { UINT32 x, y; UINT32 nWidth, nHeight; @@ -462,10 +442,9 @@ static pstatus_t general_YUV444ToRGB_8u_P3AC4R_BGRX( return PRIMITIVES_SUCCESS; } -static pstatus_t general_YUV444ToRGB_8u_P3AC4R( - const BYTE* pSrc[3], const UINT32 srcStep[3], - BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, - const prim_size_t* roi) +static pstatus_t general_YUV444ToRGB_8u_P3AC4R(const BYTE* pSrc[3], const UINT32 srcStep[3], + BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, + const prim_size_t* roi) { switch (DstFormat) { @@ -474,7 +453,8 @@ static pstatus_t general_YUV444ToRGB_8u_P3AC4R( return general_YUV444ToRGB_8u_P3AC4R_BGRX(pSrc, srcStep, pDst, dstStep, DstFormat, roi); default: - return general_YUV444ToRGB_8u_P3AC4R_general(pSrc, srcStep, pDst, dstStep, DstFormat, roi); + return general_YUV444ToRGB_8u_P3AC4R_general(pSrc, srcStep, pDst, dstStep, DstFormat, + roi); } } /** @@ -482,10 +462,9 @@ static pstatus_t general_YUV444ToRGB_8u_P3AC4R( * | G | = ( | 256 -48 -120 | | U - 128 | ) >> 8 * | B | ( | 256 475 0 | | V - 128 | ) */ -static pstatus_t general_YUV420ToRGB_8u_P3AC4R( - const BYTE* pSrc[3], const UINT32 srcStep[3], - BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, - const prim_size_t* roi) +static pstatus_t general_YUV420ToRGB_8u_P3AC4R(const BYTE* pSrc[3], const UINT32 srcStep[3], + BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, + const prim_size_t* roi) { UINT32 x, y; UINT32 dstPad; @@ -627,9 +606,9 @@ static INLINE BYTE RGB2V(INT32 R, INT32 G, INT32 B) return ((128L * R - 116 * G - 12 * B) >> 8) + 128; } -static pstatus_t general_RGBToYUV444_8u_P3AC4R( - const BYTE* pSrc, UINT32 SrcFormat, const UINT32 srcStep, - BYTE* pDst[3], UINT32 dstStep[3], const prim_size_t* roi) +static pstatus_t general_RGBToYUV444_8u_P3AC4R(const BYTE* pSrc, UINT32 SrcFormat, + const UINT32 srcStep, BYTE* pDst[3], + UINT32 dstStep[3], const prim_size_t* roi) { const UINT32 bpp = GetBytesPerPixel(SrcFormat); UINT32 x, y; @@ -658,10 +637,8 @@ static pstatus_t general_RGBToYUV444_8u_P3AC4R( return PRIMITIVES_SUCCESS; } - -static INLINE pstatus_t general_RGBToYUV420_BGRX( - const BYTE* pSrc, UINT32 srcStep, - BYTE* pDst[3], UINT32 dstStep[3], const prim_size_t* roi) +static INLINE pstatus_t general_RGBToYUV420_BGRX(const BYTE* pSrc, UINT32 srcStep, BYTE* pDst[3], + UINT32 dstStep[3], const prim_size_t* roi) { UINT32 x, y, i; size_t x1 = 0, x2 = 4, x3 = srcStep, x4 = srcStep + 4; @@ -726,9 +703,8 @@ static INLINE pstatus_t general_RGBToYUV420_BGRX( return PRIMITIVES_SUCCESS; } -static INLINE pstatus_t general_RGBToYUV420_RGBX( - const BYTE* pSrc, UINT32 srcStep, - BYTE* pDst[3], UINT32 dstStep[3], const prim_size_t* roi) +static INLINE pstatus_t general_RGBToYUV420_RGBX(const BYTE* pSrc, UINT32 srcStep, BYTE* pDst[3], + UINT32 dstStep[3], const prim_size_t* roi) { UINT32 x, y, i; size_t x1 = 0, x2 = 4, x3 = srcStep, x4 = srcStep + 4; @@ -793,9 +769,9 @@ static INLINE pstatus_t general_RGBToYUV420_RGBX( return PRIMITIVES_SUCCESS; } -static INLINE pstatus_t general_RGBToYUV420_ANY( - const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, - BYTE* pDst[3], UINT32 dstStep[3], const prim_size_t* roi) +static INLINE pstatus_t general_RGBToYUV420_ANY(const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, + BYTE* pDst[3], UINT32 dstStep[3], + const prim_size_t* roi) { const UINT32 bpp = GetBytesPerPixel(srcFormat); UINT32 x, y, i; @@ -870,9 +846,9 @@ static INLINE pstatus_t general_RGBToYUV420_ANY( return PRIMITIVES_SUCCESS; } -static pstatus_t general_RGBToYUV420_8u_P3AC4R( - const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, - BYTE* pDst[3], UINT32 dstStep[3], const prim_size_t* roi) +static pstatus_t general_RGBToYUV420_8u_P3AC4R(const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, + BYTE* pDst[3], UINT32 dstStep[3], + const prim_size_t* roi) { switch (srcFormat) { @@ -889,9 +865,10 @@ static pstatus_t general_RGBToYUV420_8u_P3AC4R( } } -static INLINE void general_RGBToAVC444YUV_BGRX_DOUBLE_ROW( - const BYTE* srcEven, const BYTE* srcOdd, BYTE* b1Even, BYTE* b1Odd, BYTE* b2, - BYTE* b3, BYTE* b4, BYTE* b5, BYTE* b6, BYTE* b7, UINT32 width) +static INLINE void general_RGBToAVC444YUV_BGRX_DOUBLE_ROW(const BYTE* srcEven, const BYTE* srcOdd, + BYTE* b1Even, BYTE* b1Odd, BYTE* b2, + BYTE* b3, BYTE* b4, BYTE* b5, BYTE* b6, + BYTE* b7, UINT32 width) { UINT32 x; @@ -985,11 +962,10 @@ static INLINE void general_RGBToAVC444YUV_BGRX_DOUBLE_ROW( } } -static INLINE pstatus_t general_RGBToAVC444YUV_BGRX( - const BYTE* pSrc, UINT32 srcStep, - BYTE* pDst1[3], const UINT32 dst1Step[3], - BYTE* pDst2[3], const UINT32 dst2Step[3], - const prim_size_t* roi) +static INLINE pstatus_t general_RGBToAVC444YUV_BGRX(const BYTE* pSrc, UINT32 srcStep, + BYTE* pDst1[3], const UINT32 dst1Step[3], + BYTE* pDst2[3], const UINT32 dst2Step[3], + const prim_size_t* roi) { /** * Note: @@ -1013,16 +989,17 @@ static INLINE pstatus_t general_RGBToAVC444YUV_BGRX( BYTE* b5 = b4 + 8 * dst2Step[0]; BYTE* b6 = pDst2[1] + (y / 2) * dst2Step[1]; BYTE* b7 = pDst2[2] + (y / 2) * dst2Step[2]; - general_RGBToAVC444YUV_BGRX_DOUBLE_ROW(srcEven, srcOdd, b1Even, b1Odd, b2, b3, b4, b5, b6, b7, - roi->width); + general_RGBToAVC444YUV_BGRX_DOUBLE_ROW(srcEven, srcOdd, b1Even, b1Odd, b2, b3, b4, b5, b6, + b7, roi->width); } return PRIMITIVES_SUCCESS; } -static INLINE void general_RGBToAVC444YUV_RGBX_DOUBLE_ROW( - const BYTE* srcEven, const BYTE* srcOdd, BYTE* b1Even, BYTE* b1Odd, BYTE* b2, - BYTE* b3, BYTE* b4, BYTE* b5, BYTE* b6, BYTE* b7, UINT32 width) +static INLINE void general_RGBToAVC444YUV_RGBX_DOUBLE_ROW(const BYTE* srcEven, const BYTE* srcOdd, + BYTE* b1Even, BYTE* b1Odd, BYTE* b2, + BYTE* b3, BYTE* b4, BYTE* b5, BYTE* b6, + BYTE* b7, UINT32 width) { UINT32 x; @@ -1116,11 +1093,10 @@ static INLINE void general_RGBToAVC444YUV_RGBX_DOUBLE_ROW( } } -static INLINE pstatus_t general_RGBToAVC444YUV_RGBX( - const BYTE* pSrc, UINT32 srcStep, - BYTE* pDst1[3], const UINT32 dst1Step[3], - BYTE* pDst2[3], const UINT32 dst2Step[3], - const prim_size_t* roi) +static INLINE pstatus_t general_RGBToAVC444YUV_RGBX(const BYTE* pSrc, UINT32 srcStep, + BYTE* pDst1[3], const UINT32 dst1Step[3], + BYTE* pDst2[3], const UINT32 dst2Step[3], + const prim_size_t* roi) { /** * Note: @@ -1144,17 +1120,17 @@ static INLINE pstatus_t general_RGBToAVC444YUV_RGBX( BYTE* b5 = b4 + 8 * dst2Step[0]; BYTE* b6 = pDst2[1] + (y / 2) * dst2Step[1]; BYTE* b7 = pDst2[2] + (y / 2) * dst2Step[2]; - general_RGBToAVC444YUV_RGBX_DOUBLE_ROW(srcEven, srcOdd, b1Even, b1Odd, b2, b3, b4, b5, b6, b7, - roi->width); + general_RGBToAVC444YUV_RGBX_DOUBLE_ROW(srcEven, srcOdd, b1Even, b1Odd, b2, b3, b4, b5, b6, + b7, roi->width); } return PRIMITIVES_SUCCESS; } -static INLINE void general_RGBToAVC444YUV_ANY_DOUBLE_ROW( - const BYTE* srcEven, const BYTE* srcOdd, UINT32 srcFormat, - BYTE* b1Even, BYTE* b1Odd, BYTE* b2, - BYTE* b3, BYTE* b4, BYTE* b5, BYTE* b6, BYTE* b7, UINT32 width) +static INLINE void general_RGBToAVC444YUV_ANY_DOUBLE_ROW(const BYTE* srcEven, const BYTE* srcOdd, + UINT32 srcFormat, BYTE* b1Even, + BYTE* b1Odd, BYTE* b2, BYTE* b3, BYTE* b4, + BYTE* b5, BYTE* b6, BYTE* b7, UINT32 width) { const UINT32 bpp = GetBytesPerPixel(srcFormat); UINT32 x; @@ -1249,11 +1225,10 @@ static INLINE void general_RGBToAVC444YUV_ANY_DOUBLE_ROW( } } -static INLINE pstatus_t general_RGBToAVC444YUV_ANY( - const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, - BYTE* pDst1[3], const UINT32 dst1Step[3], - BYTE* pDst2[3], const UINT32 dst2Step[3], - const prim_size_t* roi) +static INLINE pstatus_t general_RGBToAVC444YUV_ANY(const BYTE* pSrc, UINT32 srcFormat, + UINT32 srcStep, BYTE* pDst1[3], + const UINT32 dst1Step[3], BYTE* pDst2[3], + const UINT32 dst2Step[3], const prim_size_t* roi) { /** * Note: According to [MS-RDPEGFX 2.2.4.4 RFX_AVC420_BITMAP_STREAM] the @@ -1276,7 +1251,8 @@ static INLINE pstatus_t general_RGBToAVC444YUV_ANY( * B6: From U444 all pixels in even rows with odd columns * B7: From V444 all pixels in even rows with odd columns * - * Microsoft's horrible unclear description in MS-RDPEGFX translated to pseudo code looks like this: + * Microsoft's horrible unclear description in MS-RDPEGFX translated to pseudo code looks like + * this: * * for (y = 0; y < fullHeight; y++) * { @@ -1329,19 +1305,17 @@ static INLINE pstatus_t general_RGBToAVC444YUV_ANY( BYTE* b5 = b4 + 8 * dst2Step[0]; BYTE* b6 = pDst2[1] + (y / 2) * dst2Step[1]; BYTE* b7 = pDst2[2] + (y / 2) * dst2Step[2]; - general_RGBToAVC444YUV_ANY_DOUBLE_ROW(srcEven, srcOdd, srcFormat, - b1Even, b1Odd, b2, b3, b4, b5, b6, b7, - roi->width); + general_RGBToAVC444YUV_ANY_DOUBLE_ROW(srcEven, srcOdd, srcFormat, b1Even, b1Odd, b2, b3, b4, + b5, b6, b7, roi->width); } return PRIMITIVES_SUCCESS; } -static INLINE pstatus_t general_RGBToAVC444YUV( - const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, - BYTE* pDst1[3], const UINT32 dst1Step[3], - BYTE* pDst2[3], const UINT32 dst2Step[3], - const prim_size_t* roi) +static INLINE pstatus_t general_RGBToAVC444YUV(const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, + BYTE* pDst1[3], const UINT32 dst1Step[3], + BYTE* pDst2[3], const UINT32 dst2Step[3], + const prim_size_t* roi) { if (!pSrc || !pDst1 || !dst1Step || !pDst2 || !dst2Step) return -1; @@ -1362,28 +1336,27 @@ static INLINE pstatus_t general_RGBToAVC444YUV( { case PIXEL_FORMAT_BGRA32: case PIXEL_FORMAT_BGRX32: - return general_RGBToAVC444YUV_BGRX(pSrc, srcStep, pDst1, dst1Step, pDst2, dst2Step, roi); + return general_RGBToAVC444YUV_BGRX(pSrc, srcStep, pDst1, dst1Step, pDst2, dst2Step, + roi); case PIXEL_FORMAT_RGBA32: case PIXEL_FORMAT_RGBX32: - return general_RGBToAVC444YUV_RGBX(pSrc, srcStep, pDst1, dst1Step, pDst2, dst2Step, roi); + return general_RGBToAVC444YUV_RGBX(pSrc, srcStep, pDst1, dst1Step, pDst2, dst2Step, + roi); default: - return general_RGBToAVC444YUV_ANY(pSrc, srcFormat, srcStep, pDst1, dst1Step, pDst2, dst2Step, roi); + return general_RGBToAVC444YUV_ANY(pSrc, srcFormat, srcStep, pDst1, dst1Step, pDst2, + dst2Step, roi); } return !PRIMITIVES_SUCCESS; } static INLINE void general_RGBToAVC444YUVv2_ANY_DOUBLE_ROW( - const BYTE* srcEven, const BYTE* srcOdd, UINT32 srcFormat, - BYTE* yLumaDstEven, BYTE* yLumaDstOdd, - BYTE* uLumaDst, BYTE* vLumaDst, - BYTE* yEvenChromaDst1, BYTE* yEvenChromaDst2, - BYTE* yOddChromaDst1, BYTE* yOddChromaDst2, - BYTE* uChromaDst1, BYTE* uChromaDst2, - BYTE* vChromaDst1, BYTE* vChromaDst2, - UINT32 width) + const BYTE* srcEven, const BYTE* srcOdd, UINT32 srcFormat, BYTE* yLumaDstEven, + BYTE* yLumaDstOdd, BYTE* uLumaDst, BYTE* vLumaDst, BYTE* yEvenChromaDst1, BYTE* yEvenChromaDst2, + BYTE* yOddChromaDst1, BYTE* yOddChromaDst2, BYTE* uChromaDst1, BYTE* uChromaDst2, + BYTE* vChromaDst1, BYTE* vChromaDst2, UINT32 width) { UINT32 x; const UINT32 bpp = GetBytesPerPixel(srcFormat); @@ -1503,11 +1476,11 @@ static INLINE void general_RGBToAVC444YUVv2_ANY_DOUBLE_ROW( } } -static INLINE pstatus_t general_RGBToAVC444YUVv2_ANY( - const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, - BYTE* pDst1[3], const UINT32 dst1Step[3], - BYTE* pDst2[3], const UINT32 dst2Step[3], - const prim_size_t* roi) +static INLINE pstatus_t general_RGBToAVC444YUVv2_ANY(const BYTE* pSrc, UINT32 srcFormat, + UINT32 srcStep, BYTE* pDst1[3], + const UINT32 dst1Step[3], BYTE* pDst2[3], + const UINT32 dst2Step[3], + const prim_size_t* roi) { /** * Note: According to [MS-RDPEGFX 2.2.4.4 RFX_AVC420_BITMAP_STREAM] the @@ -1517,7 +1490,8 @@ static INLINE pstatus_t general_RGBToAVC444YUVv2_ANY( * allocated accordingly !! */ /** - * [MS-RDPEGFX 3.3.8.3.3 YUV420p Stream Combination for YUV444v2 mode] defines the following "Bx areas": + * [MS-RDPEGFX 3.3.8.3.3 YUV420p Stream Combination for YUV444v2 mode] defines the following "Bx + * areas": * * YUV420 frame (main view): * B1: From Y444 all pixels @@ -1579,27 +1553,20 @@ static INLINE pstatus_t general_RGBToAVC444YUVv2_ANY( BYTE* dstChromaV1 = (pDst2[2] + (y / 2) * dst2Step[2]); BYTE* dstChromaU2 = dstChromaU1 + roi->width / 4; BYTE* dstChromaV2 = dstChromaV1 + roi->width / 4; - general_RGBToAVC444YUVv2_ANY_DOUBLE_ROW(srcEven, srcOdd, srcFormat, dstLumaYEven, - dstLumaYOdd, dstLumaU, dstLumaV, - dstEvenChromaY1, dstEvenChromaY2, - dstOddChromaY1, dstOddChromaY2, - dstChromaU1, dstChromaU2, - dstChromaV1, dstChromaV2, - roi->width); + general_RGBToAVC444YUVv2_ANY_DOUBLE_ROW( + srcEven, srcOdd, srcFormat, dstLumaYEven, dstLumaYOdd, dstLumaU, dstLumaV, + dstEvenChromaY1, dstEvenChromaY2, dstOddChromaY1, dstOddChromaY2, dstChromaU1, + dstChromaU2, dstChromaV1, dstChromaV2, roi->width); } return PRIMITIVES_SUCCESS; } static INLINE void general_RGBToAVC444YUVv2_BGRX_DOUBLE_ROW( - const BYTE* srcEven, const BYTE* srcOdd, - BYTE* yLumaDstEven, BYTE* yLumaDstOdd, - BYTE* uLumaDst, BYTE* vLumaDst, - BYTE* yEvenChromaDst1, BYTE* yEvenChromaDst2, - BYTE* yOddChromaDst1, BYTE* yOddChromaDst2, - BYTE* uChromaDst1, BYTE* uChromaDst2, - BYTE* vChromaDst1, BYTE* vChromaDst2, - UINT32 width) + const BYTE* srcEven, const BYTE* srcOdd, BYTE* yLumaDstEven, BYTE* yLumaDstOdd, BYTE* uLumaDst, + BYTE* vLumaDst, BYTE* yEvenChromaDst1, BYTE* yEvenChromaDst2, BYTE* yOddChromaDst1, + BYTE* yOddChromaDst2, BYTE* uChromaDst1, BYTE* uChromaDst2, BYTE* vChromaDst1, + BYTE* vChromaDst2, UINT32 width) { UINT32 x; @@ -1718,11 +1685,10 @@ static INLINE void general_RGBToAVC444YUVv2_BGRX_DOUBLE_ROW( } } -static INLINE pstatus_t general_RGBToAVC444YUVv2_BGRX( - const BYTE* pSrc, UINT32 srcStep, - BYTE* pDst1[3], const UINT32 dst1Step[3], - BYTE* pDst2[3], const UINT32 dst2Step[3], - const prim_size_t* roi) +static INLINE pstatus_t general_RGBToAVC444YUVv2_BGRX(const BYTE* pSrc, UINT32 srcStep, + BYTE* pDst1[3], const UINT32 dst1Step[3], + BYTE* pDst2[3], const UINT32 dst2Step[3], + const prim_size_t* roi) { UINT32 y; @@ -1745,33 +1711,30 @@ static INLINE pstatus_t general_RGBToAVC444YUVv2_BGRX( BYTE* dstChromaV1 = (pDst2[2] + (y / 2) * dst2Step[2]); BYTE* dstChromaU2 = dstChromaU1 + roi->width / 4; BYTE* dstChromaV2 = dstChromaV1 + roi->width / 4; - general_RGBToAVC444YUVv2_BGRX_DOUBLE_ROW(srcEven, srcOdd, dstLumaYEven, - dstLumaYOdd, dstLumaU, dstLumaV, - dstEvenChromaY1, dstEvenChromaY2, - dstOddChromaY1, dstOddChromaY2, - dstChromaU1, dstChromaU2, - dstChromaV1, dstChromaV2, - roi->width); + general_RGBToAVC444YUVv2_BGRX_DOUBLE_ROW( + srcEven, srcOdd, dstLumaYEven, dstLumaYOdd, dstLumaU, dstLumaV, dstEvenChromaY1, + dstEvenChromaY2, dstOddChromaY1, dstOddChromaY2, dstChromaU1, dstChromaU2, dstChromaV1, + dstChromaV2, roi->width); } return PRIMITIVES_SUCCESS; } -static INLINE pstatus_t general_RGBToAVC444YUVv2( - const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, - BYTE* pDst1[3], const UINT32 dst1Step[3], - BYTE* pDst2[3], const UINT32 dst2Step[3], - const prim_size_t* roi) +static INLINE pstatus_t general_RGBToAVC444YUVv2(const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, + BYTE* pDst1[3], const UINT32 dst1Step[3], + BYTE* pDst2[3], const UINT32 dst2Step[3], + const prim_size_t* roi) { switch (srcFormat) { case PIXEL_FORMAT_BGRA32: case PIXEL_FORMAT_BGRX32: - return general_RGBToAVC444YUVv2_BGRX(pSrc, srcStep, pDst1, dst1Step, pDst2, dst2Step, roi); + return general_RGBToAVC444YUVv2_BGRX(pSrc, srcStep, pDst1, dst1Step, pDst2, dst2Step, + roi); default: - return general_RGBToAVC444YUVv2_ANY(pSrc, srcFormat, srcStep, pDst1, dst1Step, pDst2, dst2Step, - roi); + return general_RGBToAVC444YUVv2_ANY(pSrc, srcFormat, srcStep, pDst1, dst1Step, pDst2, + dst2Step, roi); } return !PRIMITIVES_SUCCESS; @@ -1788,4 +1751,3 @@ void primitives_init_YUV(primitives_t* prims) prims->RGBToAVC444YUV = general_RGBToAVC444YUV; prims->RGBToAVC444YUVv2 = general_RGBToAVC444YUVv2; } - diff --git a/libfreerdp/primitives/prim_YUV_neon.c b/libfreerdp/primitives/prim_YUV_neon.c index 885b8561c..57c4f48e8 100644 --- a/libfreerdp/primitives/prim_YUV_neon.c +++ b/libfreerdp/primitives/prim_YUV_neon.c @@ -39,8 +39,7 @@ static primitives_t* generic = NULL; -static INLINE uint8x8_t neon_YUV2R(int32x4_t Ch, int32x4_t Cl, - int16x4_t Dh, int16x4_t Dl, +static INLINE uint8x8_t neon_YUV2R(int32x4_t Ch, int32x4_t Cl, int16x4_t Dh, int16x4_t Dl, int16x4_t Eh, int16x4_t El) { /* R = (256 * Y + 403 * (V - 128)) >> 8 */ @@ -53,8 +52,7 @@ static INLINE uint8x8_t neon_YUV2R(int32x4_t Ch, int32x4_t Cl, return vqmovun_s16(R); } -static INLINE uint8x8_t neon_YUV2G(int32x4_t Ch, int32x4_t Cl, - int16x4_t Dh, int16x4_t Dl, +static INLINE uint8x8_t neon_YUV2G(int32x4_t Ch, int32x4_t Cl, int16x4_t Dh, int16x4_t Dl, int16x4_t Eh, int16x4_t El) { /* G = (256L * Y - 48 * (U - 128) - 120 * (V - 128)) >> 8 */ @@ -70,8 +68,7 @@ static INLINE uint8x8_t neon_YUV2G(int32x4_t Ch, int32x4_t Cl, return vqmovun_s16(G); } -static INLINE uint8x8_t neon_YUV2B(int32x4_t Ch, int32x4_t Cl, - int16x4_t Dh, int16x4_t Dl, +static INLINE uint8x8_t neon_YUV2B(int32x4_t Ch, int32x4_t Cl, int16x4_t Dh, int16x4_t Dl, int16x4_t Eh, int16x4_t El) { /* B = (256L * Y + 475 * (U - 128)) >> 8*/ @@ -85,10 +82,11 @@ static INLINE uint8x8_t neon_YUV2B(int32x4_t Ch, int32x4_t Cl, } static INLINE BYTE* neon_YuvToRgbPixel(BYTE* pRGB, int16x8_t Y, int16x8_t D, int16x8_t E, - const uint8_t rPos, const uint8_t gPos, const uint8_t bPos, const uint8_t aPos) + const uint8_t rPos, const uint8_t gPos, const uint8_t bPos, + const uint8_t aPos) { uint8x8x4_t bgrx; - const int32x4_t Ch = vmulq_n_s32(vmovl_s16(vget_high_s16(Y)), 256); /* Y * 256 */ + const int32x4_t Ch = vmulq_n_s32(vmovl_s16(vget_high_s16(Y)), 256); /* Y * 256 */ const int32x4_t Cl = vmulq_n_s32(vmovl_s16(vget_low_s16(Y)), 256); /* Y * 256 */ const int16x4_t Dh = vget_high_s16(D); const int16x4_t Dl = vget_low_s16(D); @@ -136,11 +134,9 @@ static INLINE BYTE* neon_YuvToRgbPixel(BYTE* pRGB, int16x8_t Y, int16x8_t D, int return pRGB; } -static INLINE pstatus_t neon_YUV420ToX( - const BYTE* pSrc[3], const UINT32 srcStep[3], - BYTE* pDst, UINT32 dstStep, - const prim_size_t* roi, const uint8_t rPos, const uint8_t gPos, - const uint8_t bPos, const uint8_t aPos) +static INLINE pstatus_t neon_YUV420ToX(const BYTE* pSrc[3], const UINT32 srcStep[3], BYTE* pDst, + UINT32 dstStep, const prim_size_t* roi, const uint8_t rPos, + const uint8_t gPos, const uint8_t bPos, const uint8_t aPos) { UINT32 y; const UINT32 nWidth = roi->width; @@ -259,10 +255,9 @@ static INLINE pstatus_t neon_YUV420ToX( return PRIMITIVES_SUCCESS; } -static pstatus_t neon_YUV420ToRGB_8u_P3AC4R( - const BYTE* pSrc[3], const UINT32 srcStep[3], - BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, - const prim_size_t* roi) +static pstatus_t neon_YUV420ToRGB_8u_P3AC4R(const BYTE* pSrc[3], const UINT32 srcStep[3], + BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, + const prim_size_t* roi) { switch (DstFormat) { @@ -287,11 +282,9 @@ static pstatus_t neon_YUV420ToRGB_8u_P3AC4R( } } -static INLINE pstatus_t neon_YUV444ToX( - const BYTE* pSrc[3], const UINT32 srcStep[3], - BYTE* pDst, UINT32 dstStep, - const prim_size_t* roi, const uint8_t rPos, const uint8_t gPos, - const uint8_t bPos, const uint8_t aPos) +static INLINE pstatus_t neon_YUV444ToX(const BYTE* pSrc[3], const UINT32 srcStep[3], BYTE* pDst, + UINT32 dstStep, const prim_size_t* roi, const uint8_t rPos, + const uint8_t gPos, const uint8_t bPos, const uint8_t aPos) { UINT32 y; const UINT32 nWidth = roi->width; @@ -353,10 +346,9 @@ static INLINE pstatus_t neon_YUV444ToX( return PRIMITIVES_SUCCESS; } -static pstatus_t neon_YUV444ToRGB_8u_P3AC4R( - const BYTE* pSrc[3], const UINT32 srcStep[3], - BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, - const prim_size_t* roi) +static pstatus_t neon_YUV444ToRGB_8u_P3AC4R(const BYTE* pSrc[3], const UINT32 srcStep[3], + BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, + const prim_size_t* roi) { switch (DstFormat) { @@ -391,18 +383,12 @@ static pstatus_t neon_LumaToYUV444(const BYTE* pSrcRaw[3], const UINT32 srcStep[ const UINT32 halfWidth = (nWidth + 1) / 2; const UINT32 halfHeight = (nHeight + 1) / 2; const UINT32 evenY = 0; - const BYTE* pSrc[3] = - { - pSrcRaw[0] + roi->top* srcStep[0] + roi->left, - pSrcRaw[1] + roi->top / 2 * srcStep[1] + roi->left / 2, - pSrcRaw[2] + roi->top / 2 * srcStep[2] + roi->left / 2 - }; - BYTE* pDst[3] = - { - pDstRaw[0] + roi->top* dstStep[0] + roi->left, - pDstRaw[1] + roi->top* dstStep[1] + roi->left, - pDstRaw[2] + roi->top* dstStep[2] + roi->left - }; + const BYTE* pSrc[3] = { pSrcRaw[0] + roi->top * srcStep[0] + roi->left, + pSrcRaw[1] + roi->top / 2 * srcStep[1] + roi->left / 2, + pSrcRaw[2] + roi->top / 2 * srcStep[2] + roi->left / 2 }; + BYTE* pDst[3] = { pDstRaw[0] + roi->top * dstStep[0] + roi->left, + pDstRaw[1] + roi->top * dstStep[1] + roi->left, + pDstRaw[2] + roi->top * dstStep[2] + roi->left }; /* Y data is already here... */ /* B1 */ @@ -469,8 +455,7 @@ static pstatus_t neon_LumaToYUV444(const BYTE* pSrcRaw[3], const UINT32 srcStep[ return PRIMITIVES_SUCCESS; } -static pstatus_t neon_ChromaFilter(BYTE* pDst[3], const UINT32 dstStep[3], - const RECTANGLE_16* roi) +static pstatus_t neon_ChromaFilter(BYTE* pDst[3], const UINT32 dstStep[3], const RECTANGLE_16* roi) { const UINT32 oddY = 1; const UINT32 evenY = 0; @@ -499,11 +484,12 @@ static pstatus_t neon_ChromaFilter(BYTE* pDst[3], const UINT32 dstStep[3], { /* U = (U2x,2y << 2) - U2x1,2y - U2x,2y1 - U2x1,2y1 */ uint8x8x2_t u = vld2_u8(&pU[2 * x]); - const int16x8_t up = vreinterpretq_s16_u16(vshll_n_u8(u.val[0], 2)); /* Ux2,2y << 2 */ + const int16x8_t up = + vreinterpretq_s16_u16(vshll_n_u8(u.val[0], 2)); /* Ux2,2y << 2 */ const uint8x8x2_t u1 = vld2_u8(&pU1[2 * x]); const uint16x8_t usub = vaddl_u8(u1.val[1], u1.val[0]); /* U2x,2y1 + U2x1,2y1 */ - const int16x8_t us = vreinterpretq_s16_u16(vaddw_u8(usub, - u.val[1])); /* U2x1,2y + U2x,2y1 + U2x1,2y1 */ + const int16x8_t us = vreinterpretq_s16_u16( + vaddw_u8(usub, u.val[1])); /* U2x1,2y + U2x,2y1 + U2x1,2y1 */ const int16x8_t un = vsubq_s16(up, us); const uint8x8_t u8 = vqmovun_s16(un); /* CLIP(un) */ u.val[0] = u8; @@ -512,11 +498,12 @@ static pstatus_t neon_ChromaFilter(BYTE* pDst[3], const UINT32 dstStep[3], { /* V = (V2x,2y << 2) - V2x1,2y - V2x,2y1 - V2x1,2y1 */ uint8x8x2_t v = vld2_u8(&pV[2 * x]); - const int16x8_t vp = vreinterpretq_s16_u16(vshll_n_u8(v.val[0], 2)); /* Vx2,2y << 2 */ + const int16x8_t vp = + vreinterpretq_s16_u16(vshll_n_u8(v.val[0], 2)); /* Vx2,2y << 2 */ const uint8x8x2_t v1 = vld2_u8(&pV1[2 * x]); const uint16x8_t vsub = vaddl_u8(v1.val[1], v1.val[0]); /* V2x,2y1 + V2x1,2y1 */ - const int16x8_t vs = vreinterpretq_s16_u16(vaddw_u8(vsub, - v.val[1])); /* V2x1,2y + V2x,2y1 + V2x1,2y1 */ + const int16x8_t vs = vreinterpretq_s16_u16( + vaddw_u8(vsub, v.val[1])); /* V2x1,2y + V2x,2y1 + V2x1,2y1 */ const int16x8_t vn = vsubq_s16(vp, vs); const uint8x8_t v8 = vqmovun_s16(vn); /* CLIP(vn) */ v.val[0] = v8; @@ -565,18 +552,12 @@ static pstatus_t neon_ChromaV1ToYUV444(const BYTE* pSrcRaw[3], const UINT32 srcS * We need the padded height for B4 and B5 conversion. */ const UINT32 padHeigth = nHeight + 16 - nHeight % 16; const UINT32 halfPad = halfWidth % 16; - const BYTE* pSrc[3] = - { - pSrcRaw[0] + roi->top* srcStep[0] + roi->left, - pSrcRaw[1] + roi->top / 2 * srcStep[1] + roi->left / 2, - pSrcRaw[2] + roi->top / 2 * srcStep[2] + roi->left / 2 - }; - BYTE* pDst[3] = - { - pDstRaw[0] + roi->top* dstStep[0] + roi->left, - pDstRaw[1] + roi->top* dstStep[1] + roi->left, - pDstRaw[2] + roi->top* dstStep[2] + roi->left - }; + const BYTE* pSrc[3] = { pSrcRaw[0] + roi->top * srcStep[0] + roi->left, + pSrcRaw[1] + roi->top / 2 * srcStep[1] + roi->left / 2, + pSrcRaw[2] + roi->top / 2 * srcStep[2] + roi->left / 2 }; + BYTE* pDst[3] = { pDstRaw[0] + roi->top * dstStep[0] + roi->left, + pDstRaw[1] + roi->top * dstStep[1] + roi->left, + pDstRaw[2] + roi->top * dstStep[2] + roi->left }; /* The second half of U and V is a bit more tricky... */ /* B4 and B5 */ @@ -643,9 +624,8 @@ static pstatus_t neon_ChromaV1ToYUV444(const BYTE* pSrcRaw[3], const UINT32 srcS } static pstatus_t neon_ChromaV2ToYUV444(const BYTE* pSrc[3], const UINT32 srcStep[3], - UINT32 nTotalWidth, UINT32 nTotalHeight, - BYTE* pDst[3], const UINT32 dstStep[3], - const RECTANGLE_16* roi) + UINT32 nTotalWidth, UINT32 nTotalHeight, BYTE* pDst[3], + const UINT32 dstStep[3], const RECTANGLE_16* roi) { UINT32 x, y; const UINT32 nWidth = roi->right - roi->left; @@ -725,12 +705,10 @@ static pstatus_t neon_ChromaV2ToYUV444(const BYTE* pSrc[3], const UINT32 srcStep return neon_ChromaFilter(pDst, dstStep, roi); } -static pstatus_t neon_YUV420CombineToYUV444( - avc444_frame_type type, - const BYTE* pSrc[3], const UINT32 srcStep[3], - UINT32 nWidth, UINT32 nHeight, - BYTE* pDst[3], const UINT32 dstStep[3], - const RECTANGLE_16* roi) +static pstatus_t neon_YUV420CombineToYUV444(avc444_frame_type type, const BYTE* pSrc[3], + const UINT32 srcStep[3], UINT32 nWidth, UINT32 nHeight, + BYTE* pDst[3], const UINT32 dstStep[3], + const RECTANGLE_16* roi) { if (!pSrc || !pSrc[0] || !pSrc[1] || !pSrc[2]) return -1; diff --git a/libfreerdp/primitives/prim_YUV_ssse3.c b/libfreerdp/primitives/prim_YUV_ssse3.c index 504954508..01d8c8caf 100644 --- a/libfreerdp/primitives/prim_YUV_ssse3.c +++ b/libfreerdp/primitives/prim_YUV_ssse3.c @@ -48,49 +48,43 @@ static __m128i* ssse3_YUV444Pixel(__m128i* dst, __m128i Yraw, __m128i Uraw, __m1 /* Visual Studio 2010 doesn't like _mm_set_epi32 in array initializer list */ /* Note: This also applies to Visual Studio 2013 before Update 4 */ #if !defined(_MSC_VER) || (_MSC_VER > 1600) - const __m128i mapY[] = - { - _mm_set_epi32(0x80800380, 0x80800280, 0x80800180, 0x80800080), - _mm_set_epi32(0x80800780, 0x80800680, 0x80800580, 0x80800480), - _mm_set_epi32(0x80800B80, 0x80800A80, 0x80800980, 0x80800880), - _mm_set_epi32(0x80800F80, 0x80800E80, 0x80800D80, 0x80800C80) - }; - const __m128i mapUV[] = - { - _mm_set_epi32(0x80038002, 0x80018000, 0x80808080, 0x80808080), - _mm_set_epi32(0x80078006, 0x80058004, 0x80808080, 0x80808080), - _mm_set_epi32(0x800B800A, 0x80098008, 0x80808080, 0x80808080), - _mm_set_epi32(0x800F800E, 0x800D800C, 0x80808080, 0x80808080) - }; - const __m128i mask[] = - { - _mm_set_epi32(0x80038080, 0x80028080, 0x80018080, 0x80008080), - _mm_set_epi32(0x80800380, 0x80800280, 0x80800180, 0x80800080), - _mm_set_epi32(0x80808003, 0x80808002, 0x80808001, 0x80808000) - }; + const __m128i mapY[] = { _mm_set_epi32(0x80800380, 0x80800280, 0x80800180, 0x80800080), + _mm_set_epi32(0x80800780, 0x80800680, 0x80800580, 0x80800480), + _mm_set_epi32(0x80800B80, 0x80800A80, 0x80800980, 0x80800880), + _mm_set_epi32(0x80800F80, 0x80800E80, 0x80800D80, 0x80800C80) }; + const __m128i mapUV[] = { _mm_set_epi32(0x80038002, 0x80018000, 0x80808080, 0x80808080), + _mm_set_epi32(0x80078006, 0x80058004, 0x80808080, 0x80808080), + _mm_set_epi32(0x800B800A, 0x80098008, 0x80808080, 0x80808080), + _mm_set_epi32(0x800F800E, 0x800D800C, 0x80808080, 0x80808080) }; + const __m128i mask[] = { _mm_set_epi32(0x80038080, 0x80028080, 0x80018080, 0x80008080), + _mm_set_epi32(0x80800380, 0x80800280, 0x80800180, 0x80800080), + _mm_set_epi32(0x80808003, 0x80808002, 0x80808001, 0x80808000) }; #else /* Note: must be in little-endian format ! */ - const __m128i mapY[] = - { - { 0x80, 0x00, 0x80, 0x80, 0x80, 0x01, 0x80, 0x80, 0x80, 0x02, 0x80, 0x80, 0x80, 0x03, 0x80, 0x80 }, - { 0x80, 0x04, 0x80, 0x80, 0x80, 0x05, 0x80, 0x80, 0x80, 0x06, 0x80, 0x80, 0x80, 0x07, 0x80, 0x80 }, - { 0x80, 0x08, 0x80, 0x80, 0x80, 0x09, 0x80, 0x80, 0x80, 0x0a, 0x80, 0x80, 0x80, 0x0b, 0x80, 0x80 }, - { 0x80, 0x0c, 0x80, 0x80, 0x80, 0x0d, 0x80, 0x80, 0x80, 0x0e, 0x80, 0x80, 0x80, 0x0f, 0x80, 0x80 } + const __m128i mapY[] = { { 0x80, 0x00, 0x80, 0x80, 0x80, 0x01, 0x80, 0x80, 0x80, 0x02, 0x80, + 0x80, 0x80, 0x03, 0x80, 0x80 }, + { 0x80, 0x04, 0x80, 0x80, 0x80, 0x05, 0x80, 0x80, 0x80, 0x06, 0x80, + 0x80, 0x80, 0x07, 0x80, 0x80 }, + { 0x80, 0x08, 0x80, 0x80, 0x80, 0x09, 0x80, 0x80, 0x80, 0x0a, 0x80, + 0x80, 0x80, 0x0b, 0x80, 0x80 }, + { 0x80, 0x0c, 0x80, 0x80, 0x80, 0x0d, 0x80, 0x80, 0x80, 0x0e, 0x80, + 0x80, 0x80, 0x0f, 0x80, 0x80 } }; - const __m128i mapUV[] = - { - { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x01, 0x80, 0x02, 0x80, 0x03, 0x80 }, - { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x04, 0x80, 0x05, 0x80, 0x06, 0x80, 0x07, 0x80 }, - { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x08, 0x80, 0x09, 0x80, 0x0a, 0x80, 0x0b, 0x80 }, - { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x0c, 0x80, 0x0d, 0x80, 0x0e, 0x80, 0x0f, 0x80 } - }; - const __m128i mask[] = - { - { 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x01, 0x80, 0x80, 0x80, 0x02, 0x80, 0x80, 0x80, 0x03, 0x80 }, - { 0x80, 0x00, 0x80, 0x80, 0x80, 0x01, 0x80, 0x80, 0x80, 0x02, 0x80, 0x80, 0x80, 0x03, 0x80, 0x80 }, - { 0x00, 0x80, 0x80, 0x80, 0x01, 0x80, 0x80, 0x80, 0x02, 0x80, 0x80, 0x80, 0x03, 0x80, 0x80, 0x80 } - }; + const __m128i mapUV[] = { { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x01, + 0x80, 0x02, 0x80, 0x03, 0x80 }, + { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x04, 0x80, 0x05, + 0x80, 0x06, 0x80, 0x07, 0x80 }, + { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x08, 0x80, 0x09, + 0x80, 0x0a, 0x80, 0x0b, 0x80 }, + { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x0c, 0x80, 0x0d, + 0x80, 0x0e, 0x80, 0x0f, 0x80 } }; + const __m128i mask[] = { { 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x01, 0x80, 0x80, 0x80, 0x02, + 0x80, 0x80, 0x80, 0x03, 0x80 }, + { 0x80, 0x00, 0x80, 0x80, 0x80, 0x01, 0x80, 0x80, 0x80, 0x02, 0x80, + 0x80, 0x80, 0x03, 0x80, 0x80 }, + { 0x00, 0x80, 0x80, 0x80, 0x01, 0x80, 0x80, 0x80, 0x02, 0x80, 0x80, + 0x80, 0x03, 0x80, 0x80, 0x80 } }; #endif const __m128i c128 = _mm_set1_epi16(128); __m128i BGRX = _mm_set_epi32(0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000); @@ -103,17 +97,18 @@ static __m128i* ssse3_YUV444Pixel(__m128i* dst, __m128i Yraw, __m128i Uraw, __m1 /* Load U values and expand to 32 bit */ { const __m128i U = _mm_shuffle_epi8(Uraw, mapUV[pos]); /* Reorder dcba */ - D = _mm_sub_epi16(U, c128); /* D = U - 128 */ + D = _mm_sub_epi16(U, c128); /* D = U - 128 */ } /* Load V values and expand to 32 bit */ { const __m128i V = _mm_shuffle_epi8(Vraw, mapUV[pos]); /* Reorder dcba */ - E = _mm_sub_epi16(V, c128); /* E = V - 128 */ + E = _mm_sub_epi16(V, c128); /* E = V - 128 */ } /* Get the R value */ { const __m128i c403 = _mm_set1_epi16(403); - const __m128i e403 = _mm_unpackhi_epi16(_mm_mullo_epi16(E, c403), _mm_mulhi_epi16(E, c403)); + const __m128i e403 = + _mm_unpackhi_epi16(_mm_mullo_epi16(E, c403), _mm_mulhi_epi16(E, c403)); const __m128i Rs = _mm_add_epi32(C, e403); const __m128i R32 = _mm_srai_epi32(Rs, 8); const __m128i R16 = _mm_packs_epi32(R32, _mm_setzero_si128()); @@ -124,9 +119,11 @@ static __m128i* ssse3_YUV444Pixel(__m128i* dst, __m128i Yraw, __m128i Uraw, __m1 /* Get the G value */ { const __m128i c48 = _mm_set1_epi16(48); - const __m128i d48 = _mm_unpackhi_epi16(_mm_mullo_epi16(D, c48), _mm_mulhi_epi16(D, c48)); + const __m128i d48 = + _mm_unpackhi_epi16(_mm_mullo_epi16(D, c48), _mm_mulhi_epi16(D, c48)); const __m128i c120 = _mm_set1_epi16(120); - const __m128i e120 = _mm_unpackhi_epi16(_mm_mullo_epi16(E, c120), _mm_mulhi_epi16(E, c120)); + const __m128i e120 = + _mm_unpackhi_epi16(_mm_mullo_epi16(E, c120), _mm_mulhi_epi16(E, c120)); const __m128i de = _mm_add_epi32(d48, e120); const __m128i Gs = _mm_sub_epi32(C, de); const __m128i G32 = _mm_srai_epi32(Gs, 8); @@ -138,7 +135,8 @@ static __m128i* ssse3_YUV444Pixel(__m128i* dst, __m128i Yraw, __m128i Uraw, __m1 /* Get the B value */ { const __m128i c475 = _mm_set1_epi16(475); - const __m128i d475 = _mm_unpackhi_epi16(_mm_mullo_epi16(D, c475), _mm_mulhi_epi16(D, c475)); + const __m128i d475 = + _mm_unpackhi_epi16(_mm_mullo_epi16(D, c475), _mm_mulhi_epi16(D, c475)); const __m128i Bs = _mm_add_epi32(C, d475); const __m128i B32 = _mm_srai_epi32(Bs, 8); const __m128i B16 = _mm_packs_epi32(B32, _mm_setzero_si128()); @@ -151,10 +149,8 @@ static __m128i* ssse3_YUV444Pixel(__m128i* dst, __m128i Yraw, __m128i Uraw, __m1 return dst; } -static pstatus_t ssse3_YUV420ToRGB_BGRX( - const BYTE** pSrc, const UINT32* srcStep, - BYTE* pDst, UINT32 dstStep, - const prim_size_t* roi) +static pstatus_t ssse3_YUV420ToRGB_BGRX(const BYTE** pSrc, const UINT32* srcStep, BYTE* pDst, + UINT32 dstStep, const prim_size_t* roi) { const UINT32 nWidth = roi->width; const UINT32 nHeight = roi->height; @@ -207,10 +203,8 @@ static pstatus_t ssse3_YUV420ToRGB_BGRX( return PRIMITIVES_SUCCESS; } -static pstatus_t ssse3_YUV420ToRGB( - const BYTE** pSrc, const UINT32* srcStep, - BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, - const prim_size_t* roi) +static pstatus_t ssse3_YUV420ToRGB(const BYTE** pSrc, const UINT32* srcStep, BYTE* pDst, + UINT32 dstStep, UINT32 DstFormat, const prim_size_t* roi) { switch (DstFormat) { @@ -223,10 +217,9 @@ static pstatus_t ssse3_YUV420ToRGB( } } -static pstatus_t ssse3_YUV444ToRGB_8u_P3AC4R_BGRX( - const BYTE** pSrc, const UINT32* srcStep, - BYTE* pDst, UINT32 dstStep, - const prim_size_t* roi) +static pstatus_t ssse3_YUV444ToRGB_8u_P3AC4R_BGRX(const BYTE** pSrc, const UINT32* srcStep, + BYTE* pDst, UINT32 dstStep, + const prim_size_t* roi) { const UINT32 nWidth = roi->width; const UINT32 nHeight = roi->height; @@ -270,9 +263,9 @@ static pstatus_t ssse3_YUV444ToRGB_8u_P3AC4R_BGRX( return PRIMITIVES_SUCCESS; } -static pstatus_t ssse3_YUV444ToRGB_8u_P3AC4R(const BYTE** pSrc, const UINT32* srcStep, - BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, - const prim_size_t* roi) +static pstatus_t ssse3_YUV444ToRGB_8u_P3AC4R(const BYTE** pSrc, const UINT32* srcStep, BYTE* pDst, + UINT32 dstStep, UINT32 DstFormat, + const prim_size_t* roi) { if ((unsigned long)pSrc[0] % 16 || (unsigned long)pSrc[1] % 16 || (unsigned long)pSrc[2] % 16 || srcStep[0] % 16 || srcStep[1] % 16 || srcStep[2] % 16) @@ -293,7 +286,6 @@ static pstatus_t ssse3_YUV444ToRGB_8u_P3AC4R(const BYTE** pSrc, const UINT32* sr /* SSSE3 RGB -> YUV420 conversion **/ /****************************************************************************/ - /** * Note (nfedera): * The used forward transformation factors from RGB to YUV are based on the @@ -316,8 +308,10 @@ static pstatus_t ssse3_YUV444ToRGB_8u_P3AC4R(const BYTE** pSrc, const UINT32* sr */ #define BGRX_Y_FACTORS _mm_set_epi8(0, 27, 92, 9, 0, 27, 92, 9, 0, 27, 92, 9, 0, 27, 92, 9) -#define BGRX_U_FACTORS _mm_set_epi8(0, -29, -99, 127, 0, -29, -99, 127, 0, -29, -99, 127, 0, -29, -99, 127) -#define BGRX_V_FACTORS _mm_set_epi8(0, 127, -116, -12, 0, 127, -116, -12, 0, 127, -116, -12, 0, 127, -116, -12) +#define BGRX_U_FACTORS \ + _mm_set_epi8(0, -29, -99, 127, 0, -29, -99, 127, 0, -29, -99, 127, 0, -29, -99, 127) +#define BGRX_V_FACTORS \ + _mm_set_epi8(0, 127, -116, -12, 0, 127, -116, -12, 0, 127, -116, -12, 0, 127, -116, -12) #define CONST128_FACTORS _mm_set1_epi8(-128) #define Y_SHIFT 7 @@ -341,17 +335,15 @@ PRIM_ALIGN_128 static const BYTE rgbx_v_factors[] = { }; */ - /* compute the luma (Y) component from a single rgb source line */ -static INLINE void ssse3_RGBToYUV420_BGRX_Y( - const BYTE* src, BYTE* dst, UINT32 width) +static INLINE void ssse3_RGBToYUV420_BGRX_Y(const BYTE* src, BYTE* dst, UINT32 width) { UINT32 x; __m128i x0, x1, x2, x3; const __m128i y_factors = BGRX_Y_FACTORS; - const __m128i* argb = (const __m128i*) src; - __m128i* ydst = (__m128i*) dst; + const __m128i* argb = (const __m128i*)src; + __m128i* ydst = (__m128i*)dst; for (x = 0; x < width; x += 16) { @@ -380,9 +372,8 @@ static INLINE void ssse3_RGBToYUV420_BGRX_Y( /* compute the chrominance (UV) components from two rgb source lines */ -static INLINE void ssse3_RGBToYUV420_BGRX_UV( - const BYTE* src1, const BYTE* src2, - BYTE* dst1, BYTE* dst2, UINT32 width) +static INLINE void ssse3_RGBToYUV420_BGRX_UV(const BYTE* src1, const BYTE* src2, BYTE* dst1, + BYTE* dst2, UINT32 width) { UINT32 x; const __m128i u_factors = BGRX_U_FACTORS; @@ -443,10 +434,8 @@ static INLINE void ssse3_RGBToYUV420_BGRX_UV( } } -static pstatus_t ssse3_RGBToYUV420_BGRX( - const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, - BYTE* pDst[3], UINT32 dstStep[3], - const prim_size_t* roi) +static pstatus_t ssse3_RGBToYUV420_BGRX(const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, + BYTE* pDst[3], UINT32 dstStep[3], const prim_size_t* roi) { UINT32 y; const BYTE* argb = pSrc; @@ -487,10 +476,8 @@ static pstatus_t ssse3_RGBToYUV420_BGRX( return PRIMITIVES_SUCCESS; } -static pstatus_t ssse3_RGBToYUV420( - const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, - BYTE* pDst[3], UINT32 dstStep[3], - const prim_size_t* roi) +static pstatus_t ssse3_RGBToYUV420(const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, + BYTE* pDst[3], UINT32 dstStep[3], const prim_size_t* roi) { switch (srcFormat) { @@ -503,18 +490,18 @@ static pstatus_t ssse3_RGBToYUV420( } } - /****************************************************************************/ /* SSSE3 RGB -> AVC444-YUV conversion **/ /****************************************************************************/ -static INLINE void ssse3_RGBToAVC444YUV_BGRX_DOUBLE_ROW( - const BYTE* srcEven, const BYTE* srcOdd, BYTE* b1Even, BYTE* b1Odd, BYTE* b2, - BYTE* b3, BYTE* b4, BYTE* b5, BYTE* b6, BYTE* b7, UINT32 width) +static INLINE void ssse3_RGBToAVC444YUV_BGRX_DOUBLE_ROW(const BYTE* srcEven, const BYTE* srcOdd, + BYTE* b1Even, BYTE* b1Odd, BYTE* b2, + BYTE* b3, BYTE* b4, BYTE* b5, BYTE* b6, + BYTE* b7, UINT32 width) { UINT32 x; - const __m128i* argbEven = (const __m128i*) srcEven; - const __m128i* argbOdd = (const __m128i*) srcOdd; + const __m128i* argbEven = (const __m128i*)srcEven; + const __m128i* argbOdd = (const __m128i*)srcOdd; const __m128i y_factors = BGRX_Y_FACTORS; const __m128i u_factors = BGRX_U_FACTORS; const __m128i v_factors = BGRX_V_FACTORS; @@ -527,21 +514,25 @@ static INLINE void ssse3_RGBToAVC444YUV_BGRX_DOUBLE_ROW( const __m128i xe2 = _mm_load_si128(argbEven++); // 2nd 4 pixels const __m128i xe3 = _mm_load_si128(argbEven++); // 3rd 4 pixels const __m128i xe4 = _mm_load_si128(argbEven++); // 4th 4 pixels - const __m128i xo1 = _mm_load_si128(argbOdd++); // 1st 4 pixels - const __m128i xo2 = _mm_load_si128(argbOdd++); // 2nd 4 pixels - const __m128i xo3 = _mm_load_si128(argbOdd++); // 3rd 4 pixels - const __m128i xo4 = _mm_load_si128(argbOdd++); // 4th 4 pixels + const __m128i xo1 = _mm_load_si128(argbOdd++); // 1st 4 pixels + const __m128i xo2 = _mm_load_si128(argbOdd++); // 2nd 4 pixels + const __m128i xo3 = _mm_load_si128(argbOdd++); // 3rd 4 pixels + const __m128i xo4 = _mm_load_si128(argbOdd++); // 4th 4 pixels { /* Y: multiplications with subtotals and horizontal sums */ const __m128i ye1 = _mm_srli_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe1, y_factors), - _mm_maddubs_epi16(xe2, y_factors)), Y_SHIFT); + _mm_maddubs_epi16(xe2, y_factors)), + Y_SHIFT); const __m128i ye2 = _mm_srli_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe3, y_factors), - _mm_maddubs_epi16(xe4, y_factors)), Y_SHIFT); + _mm_maddubs_epi16(xe4, y_factors)), + Y_SHIFT); const __m128i ye = _mm_packus_epi16(ye1, ye2); const __m128i yo1 = _mm_srli_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo1, y_factors), - _mm_maddubs_epi16(xo2, y_factors)), Y_SHIFT); + _mm_maddubs_epi16(xo2, y_factors)), + Y_SHIFT); const __m128i yo2 = _mm_srli_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo3, y_factors), - _mm_maddubs_epi16(xo4, y_factors)), Y_SHIFT); + _mm_maddubs_epi16(xo4, y_factors)), + Y_SHIFT); const __m128i yo = _mm_packus_epi16(yo1, yo2); /* store y [b1] */ _mm_storeu_si128((__m128i*)b1Even, ye); @@ -555,26 +546,34 @@ static INLINE void ssse3_RGBToAVC444YUV_BGRX_DOUBLE_ROW( } { /* We have now - * 16 even U values in ue - * 16 odd U values in uo - * - * We need to split these according to - * 3.3.8.3.2 YUV420p Stream Combination for YUV444 mode */ + * 16 even U values in ue + * 16 odd U values in uo + * + * We need to split these according to + * 3.3.8.3.2 YUV420p Stream Combination for YUV444 mode */ __m128i ue, uo; { - const __m128i ue1 = _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe1, u_factors), - _mm_maddubs_epi16(xe2, u_factors)), U_SHIFT); - const __m128i ue2 = _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe3, u_factors), - _mm_maddubs_epi16(xe4, u_factors)), U_SHIFT); + const __m128i ue1 = + _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe1, u_factors), + _mm_maddubs_epi16(xe2, u_factors)), + U_SHIFT); + const __m128i ue2 = + _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe3, u_factors), + _mm_maddubs_epi16(xe4, u_factors)), + U_SHIFT); ue = _mm_sub_epi8(_mm_packs_epi16(ue1, ue2), vector128); } if (b1Odd) { - const __m128i uo1 = _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo1, u_factors), - _mm_maddubs_epi16(xo2, u_factors)), U_SHIFT); - const __m128i uo2 = _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo3, u_factors), - _mm_maddubs_epi16(xo4, u_factors)), U_SHIFT); + const __m128i uo1 = + _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo1, u_factors), + _mm_maddubs_epi16(xo2, u_factors)), + U_SHIFT); + const __m128i uo2 = + _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo3, u_factors), + _mm_maddubs_epi16(xo4, u_factors)), + U_SHIFT); uo = _mm_sub_epi8(_mm_packs_epi16(uo1, uo2), vector128); } @@ -622,26 +621,34 @@ static INLINE void ssse3_RGBToAVC444YUV_BGRX_DOUBLE_ROW( } { /* We have now - * 16 even V values in ue - * 16 odd V values in uo - * - * We need to split these according to - * 3.3.8.3.2 YUV420p Stream Combination for YUV444 mode */ + * 16 even V values in ue + * 16 odd V values in uo + * + * We need to split these according to + * 3.3.8.3.2 YUV420p Stream Combination for YUV444 mode */ __m128i ve, vo; { - const __m128i ve1 = _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe1, v_factors), - _mm_maddubs_epi16(xe2, v_factors)), V_SHIFT); - const __m128i ve2 = _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe3, v_factors), - _mm_maddubs_epi16(xe4, v_factors)), V_SHIFT); + const __m128i ve1 = + _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe1, v_factors), + _mm_maddubs_epi16(xe2, v_factors)), + V_SHIFT); + const __m128i ve2 = + _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe3, v_factors), + _mm_maddubs_epi16(xe4, v_factors)), + V_SHIFT); ve = _mm_sub_epi8(_mm_packs_epi16(ve1, ve2), vector128); } if (b1Odd) { - const __m128i vo1 = _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo1, v_factors), - _mm_maddubs_epi16(xo2, v_factors)), V_SHIFT); - const __m128i vo2 = _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo3, v_factors), - _mm_maddubs_epi16(xo4, v_factors)), V_SHIFT); + const __m128i vo1 = + _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo1, v_factors), + _mm_maddubs_epi16(xo2, v_factors)), + V_SHIFT); + const __m128i vo2 = + _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo3, v_factors), + _mm_maddubs_epi16(xo4, v_factors)), + V_SHIFT); vo = _mm_sub_epi8(_mm_packs_epi16(vo1, vo2), vector128); } @@ -690,12 +697,9 @@ static INLINE void ssse3_RGBToAVC444YUV_BGRX_DOUBLE_ROW( } } - -static pstatus_t ssse3_RGBToAVC444YUV_BGRX( - const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, - BYTE* pDst1[3], const UINT32 dst1Step[3], - BYTE* pDst2[3], const UINT32 dst2Step[3], - const prim_size_t* roi) +static pstatus_t ssse3_RGBToAVC444YUV_BGRX(const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, + BYTE* pDst1[3], const UINT32 dst1Step[3], BYTE* pDst2[3], + const UINT32 dst2Step[3], const prim_size_t* roi) { UINT32 y; const BYTE* pMaxSrc = pSrc + (roi->height - 1) * srcStep; @@ -704,7 +708,8 @@ static pstatus_t ssse3_RGBToAVC444YUV_BGRX( return !PRIMITIVES_SUCCESS; if (roi->width % 16 || (unsigned long)pSrc % 16 || srcStep % 16) - return generic->RGBToAVC444YUV(pSrc, srcFormat, srcStep, pDst1, dst1Step, pDst2, dst2Step, roi); + return generic->RGBToAVC444YUV(pSrc, srcFormat, srcStep, pDst1, dst1Step, pDst2, dst2Step, + roi); for (y = 0; y < roi->height; y += 2) { @@ -728,20 +733,20 @@ static pstatus_t ssse3_RGBToAVC444YUV_BGRX( return PRIMITIVES_SUCCESS; } -static pstatus_t ssse3_RGBToAVC444YUV( - const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, - BYTE* pDst1[3], const UINT32 dst1Step[3], - BYTE* pDst2[3], const UINT32 dst2Step[3], - const prim_size_t* roi) +static pstatus_t ssse3_RGBToAVC444YUV(const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, + BYTE* pDst1[3], const UINT32 dst1Step[3], BYTE* pDst2[3], + const UINT32 dst2Step[3], const prim_size_t* roi) { switch (srcFormat) { case PIXEL_FORMAT_BGRX32: case PIXEL_FORMAT_BGRA32: - return ssse3_RGBToAVC444YUV_BGRX(pSrc, srcFormat, srcStep, pDst1, dst1Step, pDst2, dst2Step, roi); + return ssse3_RGBToAVC444YUV_BGRX(pSrc, srcFormat, srcStep, pDst1, dst1Step, pDst2, + dst2Step, roi); default: - return generic->RGBToAVC444YUV(pSrc, srcFormat, srcStep, pDst1, dst1Step, pDst2, dst2Step, roi); + return generic->RGBToAVC444YUV(pSrc, srcFormat, srcStep, pDst1, dst1Step, pDst2, + dst2Step, roi); } } @@ -759,19 +764,15 @@ static pstatus_t ssse3_RGBToAVC444YUV( * b9 -> vChromaDst2 */ static INLINE void ssse3_RGBToAVC444YUVv2_BGRX_DOUBLE_ROW( - const BYTE* srcEven, const BYTE* srcOdd, - BYTE* yLumaDstEven, BYTE* yLumaDstOdd, - BYTE* uLumaDst, BYTE* vLumaDst, - BYTE* yEvenChromaDst1, BYTE* yEvenChromaDst2, - BYTE* yOddChromaDst1, BYTE* yOddChromaDst2, - BYTE* uChromaDst1, BYTE* uChromaDst2, - BYTE* vChromaDst1, BYTE* vChromaDst2, - UINT32 width) + const BYTE* srcEven, const BYTE* srcOdd, BYTE* yLumaDstEven, BYTE* yLumaDstOdd, BYTE* uLumaDst, + BYTE* vLumaDst, BYTE* yEvenChromaDst1, BYTE* yEvenChromaDst2, BYTE* yOddChromaDst1, + BYTE* yOddChromaDst2, BYTE* uChromaDst1, BYTE* uChromaDst2, BYTE* vChromaDst1, + BYTE* vChromaDst2, UINT32 width) { UINT32 x; const __m128i vector128 = CONST128_FACTORS; - const __m128i* argbEven = (const __m128i*) srcEven; - const __m128i* argbOdd = (const __m128i*) srcOdd; + const __m128i* argbEven = (const __m128i*)srcEven; + const __m128i* argbOdd = (const __m128i*)srcOdd; for (x = 0; x < width; x += 16) { @@ -782,17 +783,19 @@ static INLINE void ssse3_RGBToAVC444YUVv2_BGRX_DOUBLE_ROW( const __m128i xe2 = _mm_load_si128(argbEven++); /* 2nd 4 pixels */ const __m128i xe3 = _mm_load_si128(argbEven++); /* 3rd 4 pixels */ const __m128i xe4 = _mm_load_si128(argbEven++); /* 4th 4 pixels */ - const __m128i xo1 = _mm_load_si128(argbOdd++); /* 1st 4 pixels */ - const __m128i xo2 = _mm_load_si128(argbOdd++); /* 2nd 4 pixels */ - const __m128i xo3 = _mm_load_si128(argbOdd++); /* 3rd 4 pixels */ - const __m128i xo4 = _mm_load_si128(argbOdd++); /* 4th 4 pixels */ + const __m128i xo1 = _mm_load_si128(argbOdd++); /* 1st 4 pixels */ + const __m128i xo2 = _mm_load_si128(argbOdd++); /* 2nd 4 pixels */ + const __m128i xo3 = _mm_load_si128(argbOdd++); /* 3rd 4 pixels */ + const __m128i xo4 = _mm_load_si128(argbOdd++); /* 4th 4 pixels */ { /* Y: multiplications with subtotals and horizontal sums */ const __m128i y_factors = BGRX_Y_FACTORS; const __m128i ye1 = _mm_srli_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe1, y_factors), - _mm_maddubs_epi16(xe2, y_factors)), Y_SHIFT); + _mm_maddubs_epi16(xe2, y_factors)), + Y_SHIFT); const __m128i ye2 = _mm_srli_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe3, y_factors), - _mm_maddubs_epi16(xe4, y_factors)), Y_SHIFT); + _mm_maddubs_epi16(xe4, y_factors)), + Y_SHIFT); const __m128i ye = _mm_packus_epi16(ye1, ye2); /* store y [b1] */ _mm_storeu_si128((__m128i*)yLumaDstEven, ye); @@ -803,9 +806,11 @@ static INLINE void ssse3_RGBToAVC444YUVv2_BGRX_DOUBLE_ROW( { const __m128i y_factors = BGRX_Y_FACTORS; const __m128i yo1 = _mm_srli_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo1, y_factors), - _mm_maddubs_epi16(xo2, y_factors)), Y_SHIFT); + _mm_maddubs_epi16(xo2, y_factors)), + Y_SHIFT); const __m128i yo2 = _mm_srli_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo3, y_factors), - _mm_maddubs_epi16(xo4, y_factors)), Y_SHIFT); + _mm_maddubs_epi16(xo4, y_factors)), + Y_SHIFT); const __m128i yo = _mm_packus_epi16(yo1, yo2); _mm_storeu_si128((__m128i*)yLumaDstOdd, yo); yLumaDstOdd += 16; @@ -813,29 +818,37 @@ static INLINE void ssse3_RGBToAVC444YUVv2_BGRX_DOUBLE_ROW( { /* We have now - * 16 even U values in ue - * 16 odd U values in uo - * - * We need to split these according to - * 3.3.8.3.3 YUV420p Stream Combination for YUV444v2 mode */ + * 16 even U values in ue + * 16 odd U values in uo + * + * We need to split these according to + * 3.3.8.3.3 YUV420p Stream Combination for YUV444v2 mode */ /* U: multiplications with subtotals and horizontal sums */ __m128i ue, uo, uavg; { const __m128i u_factors = BGRX_U_FACTORS; - const __m128i ue1 = _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe1, u_factors), - _mm_maddubs_epi16(xe2, u_factors)), U_SHIFT); - const __m128i ue2 = _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe3, u_factors), - _mm_maddubs_epi16(xe4, u_factors)), U_SHIFT); + const __m128i ue1 = + _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe1, u_factors), + _mm_maddubs_epi16(xe2, u_factors)), + U_SHIFT); + const __m128i ue2 = + _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe3, u_factors), + _mm_maddubs_epi16(xe4, u_factors)), + U_SHIFT); const __m128i ueavg = _mm_hadd_epi16(ue1, ue2); ue = _mm_sub_epi8(_mm_packs_epi16(ue1, ue2), vector128); uavg = ueavg; } { const __m128i u_factors = BGRX_U_FACTORS; - const __m128i uo1 = _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo1, u_factors), - _mm_maddubs_epi16(xo2, u_factors)), U_SHIFT); - const __m128i uo2 = _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo3, u_factors), - _mm_maddubs_epi16(xo4, u_factors)), U_SHIFT); + const __m128i uo1 = + _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo1, u_factors), + _mm_maddubs_epi16(xo2, u_factors)), + U_SHIFT); + const __m128i uo2 = + _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo3, u_factors), + _mm_maddubs_epi16(xo4, u_factors)), + U_SHIFT); const __m128i uoavg = _mm_hadd_epi16(uo1, uo2); uo = _mm_sub_epi8(_mm_packs_epi16(uo1, uo2), vector128); uavg = _mm_add_epi16(uavg, uoavg); @@ -899,20 +912,28 @@ static INLINE void ssse3_RGBToAVC444YUVv2_BGRX_DOUBLE_ROW( __m128i ve, vo, vavg; { const __m128i v_factors = BGRX_V_FACTORS; - const __m128i ve1 = _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe1, v_factors), - _mm_maddubs_epi16(xe2, v_factors)), V_SHIFT); - const __m128i ve2 = _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe3, v_factors), - _mm_maddubs_epi16(xe4, v_factors)), V_SHIFT); + const __m128i ve1 = + _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe1, v_factors), + _mm_maddubs_epi16(xe2, v_factors)), + V_SHIFT); + const __m128i ve2 = + _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe3, v_factors), + _mm_maddubs_epi16(xe4, v_factors)), + V_SHIFT); const __m128i veavg = _mm_hadd_epi16(ve1, ve2); ve = _mm_sub_epi8(_mm_packs_epi16(ve1, ve2), vector128); vavg = veavg; } { const __m128i v_factors = BGRX_V_FACTORS; - const __m128i vo1 = _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo1, v_factors), - _mm_maddubs_epi16(xo2, v_factors)), V_SHIFT); - const __m128i vo2 = _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo3, v_factors), - _mm_maddubs_epi16(xo4, v_factors)), V_SHIFT); + const __m128i vo1 = + _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo1, v_factors), + _mm_maddubs_epi16(xo2, v_factors)), + V_SHIFT); + const __m128i vo2 = + _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xo3, v_factors), + _mm_maddubs_epi16(xo4, v_factors)), + V_SHIFT); const __m128i voavg = _mm_hadd_epi16(vo1, vo2); vo = _mm_sub_epi8(_mm_packs_epi16(vo1, vo2), vector128); vavg = _mm_add_epi16(vavg, voavg); @@ -973,11 +994,10 @@ static INLINE void ssse3_RGBToAVC444YUVv2_BGRX_DOUBLE_ROW( } } -static pstatus_t ssse3_RGBToAVC444YUVv2_BGRX( - const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, - BYTE* pDst1[3], const UINT32 dst1Step[3], - BYTE* pDst2[3], const UINT32 dst2Step[3], - const prim_size_t* roi) +static pstatus_t ssse3_RGBToAVC444YUVv2_BGRX(const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, + BYTE* pDst1[3], const UINT32 dst1Step[3], + BYTE* pDst2[3], const UINT32 dst2Step[3], + const prim_size_t* roi) { UINT32 y; @@ -985,7 +1005,8 @@ static pstatus_t ssse3_RGBToAVC444YUVv2_BGRX( return !PRIMITIVES_SUCCESS; if (roi->width % 16 || (unsigned long)pSrc % 16 || srcStep % 16) - return generic->RGBToAVC444YUVv2(pSrc, srcFormat, srcStep, pDst1, dst1Step, pDst2, dst2Step, roi); + return generic->RGBToAVC444YUVv2(pSrc, srcFormat, srcStep, pDst1, dst1Step, pDst2, dst2Step, + roi); for (y = 0; y < roi->height; y += 2) { @@ -1003,32 +1024,29 @@ static pstatus_t ssse3_RGBToAVC444YUVv2_BGRX( BYTE* dstChromaV1 = (pDst2[2] + (y / 2) * dst2Step[2]); BYTE* dstChromaU2 = dstChromaU1 + roi->width / 4; BYTE* dstChromaV2 = dstChromaV1 + roi->width / 4; - ssse3_RGBToAVC444YUVv2_BGRX_DOUBLE_ROW(srcEven, srcOdd, dstLumaYEven, - dstLumaYOdd, dstLumaU, dstLumaV, - dstEvenChromaY1, dstEvenChromaY2, - dstOddChromaY1, dstOddChromaY2, - dstChromaU1, dstChromaU2, - dstChromaV1, dstChromaV2, - roi->width); + ssse3_RGBToAVC444YUVv2_BGRX_DOUBLE_ROW(srcEven, srcOdd, dstLumaYEven, dstLumaYOdd, dstLumaU, + dstLumaV, dstEvenChromaY1, dstEvenChromaY2, + dstOddChromaY1, dstOddChromaY2, dstChromaU1, + dstChromaU2, dstChromaV1, dstChromaV2, roi->width); } return PRIMITIVES_SUCCESS; } -static pstatus_t ssse3_RGBToAVC444YUVv2( - const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, - BYTE* pDst1[3], const UINT32 dst1Step[3], - BYTE* pDst2[3], const UINT32 dst2Step[3], - const prim_size_t* roi) +static pstatus_t ssse3_RGBToAVC444YUVv2(const BYTE* pSrc, UINT32 srcFormat, UINT32 srcStep, + BYTE* pDst1[3], const UINT32 dst1Step[3], BYTE* pDst2[3], + const UINT32 dst2Step[3], const prim_size_t* roi) { switch (srcFormat) { case PIXEL_FORMAT_BGRX32: case PIXEL_FORMAT_BGRA32: - return ssse3_RGBToAVC444YUVv2_BGRX(pSrc, srcFormat, srcStep, pDst1, dst1Step, pDst2, dst2Step, roi); + return ssse3_RGBToAVC444YUVv2_BGRX(pSrc, srcFormat, srcStep, pDst1, dst1Step, pDst2, + dst2Step, roi); default: - return generic->RGBToAVC444YUVv2(pSrc, srcFormat, srcStep, pDst1, dst1Step, pDst2, dst2Step, roi); + return generic->RGBToAVC444YUVv2(pSrc, srcFormat, srcStep, pDst1, dst1Step, pDst2, + dst2Step, roi); } } @@ -1046,18 +1064,12 @@ static pstatus_t ssse3_LumaToYUV444(const BYTE* pSrcRaw[3], const UINT32 srcStep const UINT32 evenY = 0; const UINT32 oddX = 1; const UINT32 evenX = 0; - const BYTE* pSrc[3] = - { - pSrcRaw[0] + roi->top* srcStep[0] + roi->left, - pSrcRaw[1] + roi->top / 2 * srcStep[1] + roi->left / 2, - pSrcRaw[2] + roi->top / 2 * srcStep[2] + roi->left / 2 - }; - BYTE* pDst[3] = - { - pDstRaw[0] + roi->top* dstStep[0] + roi->left, - pDstRaw[1] + roi->top* dstStep[1] + roi->left, - pDstRaw[2] + roi->top* dstStep[2] + roi->left - }; + const BYTE* pSrc[3] = { pSrcRaw[0] + roi->top * srcStep[0] + roi->left, + pSrcRaw[1] + roi->top / 2 * srcStep[1] + roi->left / 2, + pSrcRaw[2] + roi->top / 2 * srcStep[2] + roi->left / 2 }; + BYTE* pDst[3] = { pDstRaw[0] + roi->top * dstStep[0] + roi->left, + pDstRaw[1] + roi->top * dstStep[1] + roi->left, + pDstRaw[2] + roi->top * dstStep[2] + roi->left }; /* Y data is already here... */ /* B1 */ @@ -1084,7 +1096,8 @@ static pstatus_t ssse3_LumaToYUV444(const BYTE* pSrcRaw[3], const UINT32 srcStep for (x = 0; x < halfWidth - halfPad; x += 16) { const __m128i unpackHigh = _mm_set_epi8(7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 0); - const __m128i unpackLow = _mm_set_epi8(15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8, 8); + const __m128i unpackLow = + _mm_set_epi8(15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8, 8); { const __m128i u = _mm_loadu_si128((__m128i*)&Um[x]); const __m128i uHigh = _mm_shuffle_epi8(u, unpackHigh); @@ -1125,10 +1138,10 @@ static pstatus_t ssse3_LumaToYUV444(const BYTE* pSrcRaw[3], const UINT32 srcStep static INLINE void ssse3_filter(BYTE* pSrcDst, const BYTE* pSrc2) { - const __m128i even = _mm_set_epi8(0x80, 14, 0x80, 12, 0x80, 10, 0x80, 8, 0x80, 6, 0x80, 4, 0x80, 2, - 0x80, 0); - const __m128i odd = _mm_set_epi8(0x80, 15, 0x80, 13, 0x80, 11, 0x80, 9, 0x80, 7, 0x80, 5, 0x80, 3, - 0x80, 1); + const __m128i even = + _mm_set_epi8(0x80, 14, 0x80, 12, 0x80, 10, 0x80, 8, 0x80, 6, 0x80, 4, 0x80, 2, 0x80, 0); + const __m128i odd = + _mm_set_epi8(0x80, 15, 0x80, 13, 0x80, 11, 0x80, 9, 0x80, 7, 0x80, 5, 0x80, 3, 0x80, 1); const __m128i interleave = _mm_set_epi8(15, 7, 14, 6, 13, 5, 12, 4, 11, 3, 10, 2, 9, 1, 8, 0); const __m128i u = _mm_loadu_si128((__m128i*)pSrcDst); const __m128i u1 = _mm_loadu_si128((__m128i*)pSrc2); @@ -1145,8 +1158,7 @@ static INLINE void ssse3_filter(BYTE* pSrcDst, const BYTE* pSrc2) _mm_storeu_si128((__m128i*)pSrcDst, interleaved); } -static pstatus_t ssse3_ChromaFilter(BYTE* pDst[3], const UINT32 dstStep[3], - const RECTANGLE_16* roi) +static pstatus_t ssse3_ChromaFilter(BYTE* pDst[3], const UINT32 dstStep[3], const RECTANGLE_16* roi) { const UINT32 oddY = 1; const UINT32 evenY = 0; @@ -1217,21 +1229,15 @@ static pstatus_t ssse3_ChromaV1ToYUV444(const BYTE* pSrcRaw[3], const UINT32 src /* The auxilary frame is aligned to multiples of 16x16. * We need the padded height for B4 and B5 conversion. */ const UINT32 padHeigth = nHeight + 16 - nHeight % 16; - const BYTE* pSrc[3] = - { - pSrcRaw[0] + roi->top* srcStep[0] + roi->left, - pSrcRaw[1] + roi->top / 2 * srcStep[1] + roi->left / 2, - pSrcRaw[2] + roi->top / 2 * srcStep[2] + roi->left / 2 - }; - BYTE* pDst[3] = - { - pDstRaw[0] + roi->top* dstStep[0] + roi->left, - pDstRaw[1] + roi->top* dstStep[1] + roi->left, - pDstRaw[2] + roi->top* dstStep[2] + roi->left - }; + const BYTE* pSrc[3] = { pSrcRaw[0] + roi->top * srcStep[0] + roi->left, + pSrcRaw[1] + roi->top / 2 * srcStep[1] + roi->left / 2, + pSrcRaw[2] + roi->top / 2 * srcStep[2] + roi->left / 2 }; + BYTE* pDst[3] = { pDstRaw[0] + roi->top * dstStep[0] + roi->left, + pDstRaw[1] + roi->top * dstStep[1] + roi->left, + pDstRaw[2] + roi->top * dstStep[2] + roi->left }; const __m128i zero = _mm_setzero_si128(); - const __m128i mask = _mm_set_epi8(0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, - 0x80); + const __m128i mask = + _mm_set_epi8(0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80); /* The second half of U and V is a bit more tricky... */ /* B4 and B5 */ @@ -1302,9 +1308,8 @@ static pstatus_t ssse3_ChromaV1ToYUV444(const BYTE* pSrcRaw[3], const UINT32 src } static pstatus_t ssse3_ChromaV2ToYUV444(const BYTE* pSrc[3], const UINT32 srcStep[3], - UINT32 nTotalWidth, UINT32 nTotalHeight, - BYTE* pDst[3], const UINT32 dstStep[3], - const RECTANGLE_16* roi) + UINT32 nTotalWidth, UINT32 nTotalHeight, BYTE* pDst[3], + const UINT32 dstStep[3], const RECTANGLE_16* roi) { UINT32 x, y; const UINT32 nWidth = roi->right - roi->left; @@ -1315,14 +1320,14 @@ static pstatus_t ssse3_ChromaV2ToYUV444(const BYTE* pSrc[3], const UINT32 srcSte const UINT32 quaterWidth = (nWidth + 3) / 4; const UINT32 quaterPad = quaterWidth % 16; const __m128i zero = _mm_setzero_si128(); - const __m128i mask = _mm_set_epi8(0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, - 0x80, 0); - const __m128i mask2 = _mm_set_epi8(0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, - 0x80); - const __m128i shuffle1 = _mm_set_epi8(0x80, 15, 0x80, 14, 0x80, 13, 0x80, 12, 0x80, 11, 0x80, 10, - 0x80, 9, 0x80, 8); - const __m128i shuffle2 = _mm_set_epi8(0x80, 7, 0x80, 6, 0x80, 5, 0x80, 4, 0x80, 3, 0x80, 2, 0x80, 1, - 0x80, 0); + const __m128i mask = + _mm_set_epi8(0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0); + const __m128i mask2 = + _mm_set_epi8(0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80); + const __m128i shuffle1 = + _mm_set_epi8(0x80, 15, 0x80, 14, 0x80, 13, 0x80, 12, 0x80, 11, 0x80, 10, 0x80, 9, 0x80, 8); + const __m128i shuffle2 = + _mm_set_epi8(0x80, 7, 0x80, 6, 0x80, 5, 0x80, 4, 0x80, 3, 0x80, 2, 0x80, 1, 0x80, 0); /* B4 and B5: odd UV values for width/2, height */ for (y = 0; y < nHeight; y++) @@ -1413,12 +1418,10 @@ static pstatus_t ssse3_ChromaV2ToYUV444(const BYTE* pSrc[3], const UINT32 srcSte return ssse3_ChromaFilter(pDst, dstStep, roi); } -static pstatus_t ssse3_YUV420CombineToYUV444( - avc444_frame_type type, - const BYTE* pSrc[3], const UINT32 srcStep[3], - UINT32 nWidth, UINT32 nHeight, - BYTE* pDst[3], const UINT32 dstStep[3], - const RECTANGLE_16* roi) +static pstatus_t ssse3_YUV420CombineToYUV444(avc444_frame_type type, const BYTE* pSrc[3], + const UINT32 srcStep[3], UINT32 nWidth, UINT32 nHeight, + BYTE* pDst[3], const UINT32 dstStep[3], + const RECTANGLE_16* roi) { if (!pSrc || !pSrc[0] || !pSrc[1] || !pSrc[2]) return -1; @@ -1450,8 +1453,8 @@ void primitives_init_YUV_opt(primitives_t* prims) generic = primitives_get_generic(); primitives_init_YUV(prims); - if (IsProcessorFeaturePresentEx(PF_EX_SSSE3) - && IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE)) + if (IsProcessorFeaturePresentEx(PF_EX_SSSE3) && + IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE)) { prims->RGBToYUV420_8u_P3AC4R = ssse3_RGBToYUV420; prims->RGBToAVC444YUV = ssse3_RGBToAVC444YUV; diff --git a/libfreerdp/primitives/prim_add.c b/libfreerdp/primitives/prim_add.c index cc632681f..2adbd95a9 100644 --- a/libfreerdp/primitives/prim_add.c +++ b/libfreerdp/primitives/prim_add.c @@ -26,27 +26,25 @@ /* ---------------------------------------------------------------------------- * 16-bit signed add with saturation (under and over). */ -static pstatus_t general_add_16s( - const INT16* pSrc1, - const INT16* pSrc2, - INT16* pDst, - UINT32 len) +static pstatus_t general_add_16s(const INT16* pSrc1, const INT16* pSrc2, INT16* pDst, UINT32 len) { while (len--) { INT32 k = (INT32)(*pSrc1++) + (INT32)(*pSrc2++); - if (k > 32767) *pDst++ = ((INT16) 32767); - else if (k < -32768) *pDst++ = ((INT16) - 32768); - else *pDst++ = (INT16) k; + if (k > 32767) + *pDst++ = ((INT16)32767); + else if (k < -32768) + *pDst++ = ((INT16)-32768); + else + *pDst++ = (INT16)k; } return PRIMITIVES_SUCCESS; } /* ------------------------------------------------------------------------- */ -void primitives_init_add( - primitives_t* prims) +void primitives_init_add(primitives_t* prims) { prims->add_16s = general_add_16s; } diff --git a/libfreerdp/primitives/prim_add_opt.c b/libfreerdp/primitives/prim_add_opt.c index c6c750424..bfdcf4d12 100644 --- a/libfreerdp/primitives/prim_add_opt.c +++ b/libfreerdp/primitives/prim_add_opt.c @@ -37,25 +37,24 @@ static primitives_t* generic = NULL; #ifdef WITH_SSE2 -# if !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) +#if !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) /* ------------------------------------------------------------------------- */ -SSE3_SSD_ROUTINE(sse3_add_16s, INT16, generic->add_16s, - _mm_adds_epi16, generic->add_16s(sptr1++, sptr2++, dptr++, 1)) -# endif /* !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) */ +SSE3_SSD_ROUTINE(sse3_add_16s, INT16, generic->add_16s, _mm_adds_epi16, + generic->add_16s(sptr1++, sptr2++, dptr++, 1)) +#endif /* !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) */ #endif /* ------------------------------------------------------------------------- */ -void primitives_init_add_opt( - primitives_t* prims) +void primitives_init_add_opt(primitives_t* prims) { generic = primitives_get_generic(); primitives_init_add(prims); #ifdef WITH_IPP - prims->add_16s = (__add_16s_t) ippsAdd_16s; + prims->add_16s = (__add_16s_t)ippsAdd_16s; #elif defined(WITH_SSE2) - if (IsProcessorFeaturePresent(PF_SSE2_INSTRUCTIONS_AVAILABLE) - && IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE)) /* for LDDQU */ + if (IsProcessorFeaturePresent(PF_SSE2_INSTRUCTIONS_AVAILABLE) && + IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE)) /* for LDDQU */ { prims->add_16s = sse3_add_16s; } diff --git a/libfreerdp/primitives/prim_alphaComp.c b/libfreerdp/primitives/prim_alphaComp.c index cc2f75e75..89a931959 100644 --- a/libfreerdp/primitives/prim_alphaComp.c +++ b/libfreerdp/primitives/prim_alphaComp.c @@ -29,25 +29,23 @@ #include "prim_internal.h" -#define ALPHA(_k_) (((_k_) & 0xFF000000U) >> 24) -#define RED(_k_) (((_k_) & 0x00FF0000U) >> 16) -#define GRN(_k_) (((_k_) & 0x0000FF00U) >> 8) -#define BLU(_k_) (((_k_) & 0x000000FFU)) +#define ALPHA(_k_) (((_k_)&0xFF000000U) >> 24) +#define RED(_k_) (((_k_)&0x00FF0000U) >> 16) +#define GRN(_k_) (((_k_)&0x0000FF00U) >> 8) +#define BLU(_k_) (((_k_)&0x000000FFU)) /* ------------------------------------------------------------------------- */ -static pstatus_t general_alphaComp_argb( - const BYTE* pSrc1, UINT32 src1Step, - const BYTE* pSrc2, UINT32 src2Step, - BYTE* pDst, UINT32 dstStep, - UINT32 width, UINT32 height) +static pstatus_t general_alphaComp_argb(const BYTE* pSrc1, UINT32 src1Step, const BYTE* pSrc2, + UINT32 src2Step, BYTE* pDst, UINT32 dstStep, UINT32 width, + UINT32 height) { UINT32 y; for (y = 0; y < height; y++) { - const UINT32* sptr1 = (const UINT32*) (pSrc1 + y * src1Step); - const UINT32* sptr2 = (const UINT32*) (pSrc2 + y * src2Step); - UINT32* dptr = (UINT32*) (pDst + y * dstStep); + const UINT32* sptr1 = (const UINT32*)(pSrc1 + y * src1Step); + const UINT32* sptr2 = (const UINT32*)(pSrc2 + y * src2Step); + UINT32* dptr = (UINT32*)(pDst + y * dstStep); UINT32 x; for (x = 0; x < width; x++) @@ -83,8 +81,8 @@ static pstatus_t general_alphaComp_argb( UINT32 dag = s1ag - s2ag; drb *= alpha; dag *= alpha; - rb = ((drb >> 8) + s2rb) & 0x00FF00FFU; - ag = (((dag >> 8) + s2ag) << 8) & 0xFF00FF00U; + rb = ((drb >> 8) + s2rb) & 0x00FF00FFU; + ag = (((dag >> 8) + s2ag) << 8) & 0xFF00FF00U; *dptr++ = rb | ag; } } @@ -98,4 +96,3 @@ void primitives_init_alphaComp(primitives_t* prims) { prims->alphaComp_argb = general_alphaComp_argb; } - diff --git a/libfreerdp/primitives/prim_alphaComp_opt.c b/libfreerdp/primitives/prim_alphaComp_opt.c index 5e1ca0ede..aa615e60c 100644 --- a/libfreerdp/primitives/prim_alphaComp_opt.c +++ b/libfreerdp/primitives/prim_alphaComp_opt.c @@ -45,32 +45,31 @@ static primitives_t* generic = NULL; #ifdef WITH_SSE2 #if !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) -pstatus_t sse2_alphaComp_argb( - const BYTE* pSrc1, UINT32 src1Step, - const BYTE* pSrc2, UINT32 src2Step, - BYTE* pDst, UINT32 dstStep, - UINT32 width, UINT32 height) +pstatus_t sse2_alphaComp_argb(const BYTE* pSrc1, UINT32 src1Step, const BYTE* pSrc2, + UINT32 src2Step, BYTE* pDst, UINT32 dstStep, UINT32 width, + UINT32 height) { - const UINT32* sptr1 = (const UINT32*) pSrc1; - const UINT32* sptr2 = (const UINT32*) pSrc2; + const UINT32* sptr1 = (const UINT32*)pSrc1; + const UINT32* sptr2 = (const UINT32*)pSrc2; UINT32* dptr; int linebytes, src1Jump, src2Jump, dstJump; UINT32 y; __m128i xmm0, xmm1; - if ((width <= 0) || (height <= 0)) return PRIMITIVES_SUCCESS; + if ((width <= 0) || (height <= 0)) + return PRIMITIVES_SUCCESS; - if (width < 4) /* pointless if too small */ + if (width < 4) /* pointless if too small */ { - return generic->alphaComp_argb(pSrc1, src1Step, pSrc2, src2Step, - pDst, dstStep, width, height); + return generic->alphaComp_argb(pSrc1, src1Step, pSrc2, src2Step, pDst, dstStep, width, + height); } - dptr = (UINT32*) pDst; + dptr = (UINT32*)pDst; linebytes = width * sizeof(UINT32); src1Jump = (src1Step - linebytes) / sizeof(UINT32); src2Jump = (src2Step - linebytes) / sizeof(UINT32); - dstJump = (dstStep - linebytes) / sizeof(UINT32); + dstJump = (dstStep - linebytes) / sizeof(UINT32); xmm0 = _mm_set1_epi32(0); xmm1 = _mm_set1_epi16(1); @@ -81,7 +80,7 @@ pstatus_t sse2_alphaComp_argb( /* Get to the 16-byte boundary now. */ int leadIn = 0; - switch ((ULONG_PTR) dptr & 0x0f) + switch ((ULONG_PTR)dptr & 0x0f) { case 0: leadIn = 0; @@ -110,15 +109,14 @@ pstatus_t sse2_alphaComp_argb( if (leadIn) { pstatus_t status; - status = generic->alphaComp_argb((const BYTE*) sptr1, - src1Step, (const BYTE*) sptr2, src2Step, - (BYTE*) dptr, dstStep, leadIn, 1); + status = generic->alphaComp_argb((const BYTE*)sptr1, src1Step, (const BYTE*)sptr2, + src2Step, (BYTE*)dptr, dstStep, leadIn, 1); if (status != PRIMITIVES_SUCCESS) return status; sptr1 += leadIn; sptr2 += leadIn; - dptr += leadIn; + dptr += leadIn; pixels -= leadIn; } @@ -179,7 +177,7 @@ pstatus_t sse2_alphaComp_argb( xmm5 = _mm_and_si128(xmm5, xmm3); /* BlGlRlAlBkGkRkAkBjGjRjAjBiGiRiAi */ xmm5 = _mm_packus_epi16(xmm5, xmm4); - _mm_store_si128((__m128i*) dptr, xmm5); + _mm_store_si128((__m128i*)dptr, xmm5); dptr += 4; } @@ -187,21 +185,20 @@ pstatus_t sse2_alphaComp_argb( if (pixels) { pstatus_t status; - status = generic->alphaComp_argb((const BYTE*) sptr1, src1Step, - (const BYTE*) sptr2, src2Step, - (BYTE*) dptr, dstStep, pixels, 1); + status = generic->alphaComp_argb((const BYTE*)sptr1, src1Step, (const BYTE*)sptr2, + src2Step, (BYTE*)dptr, dstStep, pixels, 1); if (status != PRIMITIVES_SUCCESS) return status; sptr1 += pixels; sptr2 += pixels; - dptr += pixels; + dptr += pixels; } /* Jump to next row. */ sptr1 += src1Jump; sptr2 += src2Jump; - dptr += dstJump; + dptr += dstJump; } return PRIMITIVES_SUCCESS; @@ -211,17 +208,14 @@ pstatus_t sse2_alphaComp_argb( #ifdef WITH_IPP /* ------------------------------------------------------------------------- */ -static pstatus_t ipp_alphaComp_argb( - const BYTE* pSrc1, INT32 src1Step, - const BYTE* pSrc2, INT32 src2Step, - BYTE* pDst, INT32 dstStep, - INT32 width, INT32 height) +static pstatus_t ipp_alphaComp_argb(const BYTE* pSrc1, INT32 src1Step, const BYTE* pSrc2, + INT32 src2Step, BYTE* pDst, INT32 dstStep, INT32 width, + INT32 height) { IppiSize sz; - sz.width = width; + sz.width = width; sz.height = height; - return ippiAlphaComp_8u_AC4R(pSrc1, src1Step, pSrc2, src2Step, - pDst, dstStep, sz, ippAlphaOver); + return ippiAlphaComp_8u_AC4R(pSrc1, src1Step, pSrc2, src2Step, pDst, dstStep, sz, ippAlphaOver); } #endif @@ -234,12 +228,11 @@ void primitives_init_alphaComp_opt(primitives_t* prims) prims->alphaComp_argb = ipp_alphaComp_argb; #elif defined(WITH_SSE2) - if (IsProcessorFeaturePresent(PF_SSE2_INSTRUCTIONS_AVAILABLE) - && IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE)) /* for LDDQU */ + if (IsProcessorFeaturePresent(PF_SSE2_INSTRUCTIONS_AVAILABLE) && + IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE)) /* for LDDQU */ { prims->alphaComp_argb = sse2_alphaComp_argb; } #endif } - diff --git a/libfreerdp/primitives/prim_andor.c b/libfreerdp/primitives/prim_andor.c index 25aee8ea5..c8525c528 100644 --- a/libfreerdp/primitives/prim_andor.c +++ b/libfreerdp/primitives/prim_andor.c @@ -25,11 +25,7 @@ /* ---------------------------------------------------------------------------- * 32-bit AND with a constant. */ -static pstatus_t general_andC_32u( - const UINT32* pSrc, - UINT32 val, - UINT32* pDst, - INT32 len) +static pstatus_t general_andC_32u(const UINT32* pSrc, UINT32 val, UINT32* pDst, INT32 len) { if (val == 0) return PRIMITIVES_SUCCESS; @@ -43,11 +39,7 @@ static pstatus_t general_andC_32u( /* ---------------------------------------------------------------------------- * 32-bit OR with a constant. */ -static pstatus_t general_orC_32u( - const UINT32* pSrc, - UINT32 val, - UINT32* pDst, - INT32 len) +static pstatus_t general_orC_32u(const UINT32* pSrc, UINT32 val, UINT32* pDst, INT32 len) { if (val == 0) return PRIMITIVES_SUCCESS; @@ -59,10 +51,9 @@ static pstatus_t general_orC_32u( } /* ------------------------------------------------------------------------- */ -void primitives_init_andor( - primitives_t* prims) +void primitives_init_andor(primitives_t* prims) { /* Start with the default. */ prims->andC_32u = general_andC_32u; - prims->orC_32u = general_orC_32u; + prims->orC_32u = general_orC_32u; } diff --git a/libfreerdp/primitives/prim_andor_opt.c b/libfreerdp/primitives/prim_andor_opt.c index 0ed52731d..b92ff7807 100644 --- a/libfreerdp/primitives/prim_andor_opt.c +++ b/libfreerdp/primitives/prim_andor_opt.c @@ -36,33 +36,30 @@ static primitives_t* generic = NULL; #ifdef WITH_SSE2 -# if !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) +#if !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) /* ------------------------------------------------------------------------- */ -SSE3_SCD_PRE_ROUTINE(sse3_andC_32u, UINT32, generic->andC_32u, - _mm_and_si128, *dptr++ = *sptr++ & val) -SSE3_SCD_PRE_ROUTINE(sse3_orC_32u, UINT32, generic->orC_32u, - _mm_or_si128, *dptr++ = *sptr++ | val) -# endif /* !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) */ +SSE3_SCD_PRE_ROUTINE(sse3_andC_32u, UINT32, generic->andC_32u, _mm_and_si128, + *dptr++ = *sptr++ & val) +SSE3_SCD_PRE_ROUTINE(sse3_orC_32u, UINT32, generic->orC_32u, _mm_or_si128, *dptr++ = *sptr++ | val) +#endif /* !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) */ #endif - /* ------------------------------------------------------------------------- */ void primitives_init_andor_opt(primitives_t* prims) { generic = primitives_get_generic(); primitives_init_andor(prims); #if defined(WITH_IPP) - prims->andC_32u = (__andC_32u_t) ippsAndC_32u; - prims->orC_32u = (__orC_32u_t) ippsOrC_32u; + prims->andC_32u = (__andC_32u_t)ippsAndC_32u; + prims->orC_32u = (__orC_32u_t)ippsOrC_32u; #elif defined(WITH_SSE2) - if (IsProcessorFeaturePresent(PF_SSE2_INSTRUCTIONS_AVAILABLE) - && IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE)) + if (IsProcessorFeaturePresent(PF_SSE2_INSTRUCTIONS_AVAILABLE) && + IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE)) { prims->andC_32u = sse3_andC_32u; - prims->orC_32u = sse3_orC_32u; + prims->orC_32u = sse3_orC_32u; } #endif } - diff --git a/libfreerdp/primitives/prim_colors.c b/libfreerdp/primitives/prim_colors.c index 77c1850ca..3f20cd804 100644 --- a/libfreerdp/primitives/prim_colors.c +++ b/libfreerdp/primitives/prim_colors.c @@ -28,18 +28,16 @@ #include "prim_internal.h" #ifndef MINMAX -#define MINMAX(_v_, _l_, _h_) \ - ((_v_) < (_l_) ? (_l_) : ((_v_) > (_h_) ? (_h_) : (_v_))) +#define MINMAX(_v_, _l_, _h_) ((_v_) < (_l_) ? (_l_) : ((_v_) > (_h_) ? (_h_) : (_v_))) #endif /* !MINMAX */ /* ------------------------------------------------------------------------- */ -static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_BGRX( - const INT16* pSrc[3], UINT32 srcStep, - BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, - const prim_size_t* roi) +static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* pSrc[3], UINT32 srcStep, + BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, + const prim_size_t* roi) { UINT32 x, y; BYTE* pRGB = pDst; - const INT16* pY = pSrc[0]; + const INT16* pY = pSrc[0]; const INT16* pCb = pSrc[1]; const INT16* pCr = pSrc[2]; const size_t srcPad = (srcStep - (roi->width * 2)) / 2; @@ -62,8 +60,7 @@ static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_BGRX( R = ((INT16)((CrR + Y) >> divisor) >> 5); G = ((INT16)((Y - CbG - CrG) >> divisor) >> 5); B = ((INT16)((CbB + Y) >> divisor) >> 5); - pRGB = writePixelBGRX(pRGB, formatSize, DstFormat, CLIP(R), CLIP(G), - CLIP(B), 0xFF); + pRGB = writePixelBGRX(pRGB, formatSize, DstFormat, CLIP(R), CLIP(G), CLIP(B), 0xFF); } pY += srcPad; @@ -75,14 +72,13 @@ static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_BGRX( return PRIMITIVES_SUCCESS; } -static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_general( - const INT16* pSrc[3], UINT32 srcStep, - BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, - const prim_size_t* roi) +static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_general(const INT16* pSrc[3], UINT32 srcStep, + BYTE* pDst, UINT32 dstStep, + UINT32 DstFormat, const prim_size_t* roi) { UINT32 x, y; BYTE* pRGB = pDst; - const INT16* pY = pSrc[0]; + const INT16* pY = pSrc[0]; const INT16* pCb = pSrc[1]; const INT16* pCr = pSrc[2]; const size_t srcPad = (srcStep - (roi->width * 2)) / 2; @@ -106,8 +102,7 @@ static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_general( R = ((INT16)((CrR + Y) >> divisor) >> 5); G = ((INT16)((Y - CbG - CrG) >> divisor) >> 5); B = ((INT16)((CbB + Y) >> divisor) >> 5); - pRGB = (*writePixel)(pRGB, formatSize, DstFormat, CLIP(R), CLIP(G), - CLIP(B), 0xFF); + pRGB = (*writePixel)(pRGB, formatSize, DstFormat, CLIP(R), CLIP(G), CLIP(B), 0xFF); } pY += srcPad; @@ -119,28 +114,28 @@ static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_general( return PRIMITIVES_SUCCESS; } -static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R( - const INT16* pSrc[3], UINT32 srcStep, - BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, - const prim_size_t* roi) +static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R(const INT16* pSrc[3], UINT32 srcStep, BYTE* pDst, + UINT32 dstStep, UINT32 DstFormat, + const prim_size_t* roi) { switch (DstFormat) { case PIXEL_FORMAT_BGRA32: case PIXEL_FORMAT_BGRX32: - return general_yCbCrToRGB_16s8u_P3AC4R_BGRX(pSrc, srcStep, pDst, dstStep, DstFormat, roi); + return general_yCbCrToRGB_16s8u_P3AC4R_BGRX(pSrc, srcStep, pDst, dstStep, DstFormat, + roi); default: - return general_yCbCrToRGB_16s8u_P3AC4R_general(pSrc, srcStep, pDst, dstStep, DstFormat, roi); + return general_yCbCrToRGB_16s8u_P3AC4R_general(pSrc, srcStep, pDst, dstStep, DstFormat, + roi); } } /* ------------------------------------------------------------------------- */ -static pstatus_t general_yCbCrToRGB_16s16s_P3P3( - const INT16* pSrc[3], INT32 srcStep, - INT16* pDst[3], INT32 dstStep, - const prim_size_t* roi) /* region of interest */ +static pstatus_t general_yCbCrToRGB_16s16s_P3P3(const INT16* pSrc[3], INT32 srcStep, INT16* pDst[3], + INT32 dstStep, + const prim_size_t* roi) /* region of interest */ { /** * The decoded YCbCr coeffectients are represented as 11.5 fixed-point @@ -153,7 +148,7 @@ static pstatus_t general_yCbCrToRGB_16s16s_P3P3( * by << 5 when interpreted as INT16. * It was scaled in the quantization phase, so we must scale it back here. */ - const INT16* yptr = pSrc[0]; + const INT16* yptr = pSrc[0]; const INT16* cbptr = pSrc[1]; const INT16* crptr = pSrc[2]; INT16* rptr = pDst[0]; @@ -172,7 +167,7 @@ static pstatus_t general_yCbCrToRGB_16s16s_P3P3( /* INT32 is used intentionally because we calculate * with shifted factors! */ - INT32 y = (INT32)(*yptr++); + INT32 y = (INT32)(*yptr++); INT32 cb = (INT32)(*cbptr++); INT32 cr = (INT32)(*crptr++); INT32 r, g, b; @@ -205,7 +200,7 @@ static pstatus_t general_yCbCrToRGB_16s16s_P3P3( *bptr++ = CLIP(b >> 21); } - yptr += srcbump; + yptr += srcbump; cbptr += srcbump; crptr += srcbump; rptr += dstbump; @@ -217,10 +212,9 @@ static pstatus_t general_yCbCrToRGB_16s16s_P3P3( } /* ------------------------------------------------------------------------- */ -static pstatus_t general_RGBToYCbCr_16s16s_P3P3( - const INT16* pSrc[3], INT32 srcStep, - INT16* pDst[3], INT32 dstStep, - const prim_size_t* roi) /* region of interest */ +static pstatus_t general_RGBToYCbCr_16s16s_P3P3(const INT16* pSrc[3], INT32 srcStep, INT16* pDst[3], + INT32 dstStep, + const prim_size_t* roi) /* region of interest */ { /* The encoded YCbCr coefficients are represented as 11.5 fixed-point * numbers: @@ -235,7 +229,7 @@ static pstatus_t general_RGBToYCbCr_16s16s_P3P3( const INT16* rptr = pSrc[0]; const INT16* gptr = pSrc[1]; const INT16* bptr = pSrc[2]; - INT16* yptr = pDst[0]; + INT16* yptr = pDst[0]; INT16* cbptr = pDst[1]; INT16* crptr = pDst[2]; UINT32 srcbump = (srcStep - (roi->width * sizeof(UINT16))) / sizeof(UINT16); @@ -266,15 +260,15 @@ static pstatus_t general_RGBToYCbCr_16s16s_P3P3( * Cr: 0.499813 << 15 = 16377, 0.418531 << 15 = 13714, * 0.081282 << 15 = 2663 */ - INT32 y = (r * 9798 + g * 19235 + b * 3735) >> 10; + INT32 y = (r * 9798 + g * 19235 + b * 3735) >> 10; INT32 cb = (r * -5535 + g * -10868 + b * 16403) >> 10; INT32 cr = (r * 16377 + g * -13714 + b * -2663) >> 10; - *yptr++ = (INT16) MINMAX(y - 4096, -4096, 4095); - *cbptr++ = (INT16) MINMAX(cb, -4096, 4095); - *crptr++ = (INT16) MINMAX(cr, -4096, 4095); + *yptr++ = (INT16)MINMAX(y - 4096, -4096, 4095); + *cbptr++ = (INT16)MINMAX(cb, -4096, 4095); + *crptr++ = (INT16)MINMAX(cr, -4096, 4095); } - yptr += srcbump; + yptr += srcbump; cbptr += srcbump; crptr += srcbump; rptr += dstbump; @@ -295,8 +289,8 @@ static INLINE void writeScanlineGeneric(BYTE* dst, DWORD formatSize, UINT32 DstF dst = (*writePixel)(dst, formatSize, DstFormat, *r++, *g++, *b++, 0xFF); } -static INLINE void writeScanlineRGB(BYTE* dst, DWORD formatSize, UINT32 DstFormat, - const INT16* r, const INT16* g, const INT16* b, DWORD width) +static INLINE void writeScanlineRGB(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, + const INT16* g, const INT16* b, DWORD width) { DWORD x; WINPR_UNUSED(formatSize); @@ -313,8 +307,8 @@ static INLINE void writeScanlineRGB(BYTE* dst, DWORD formatSize, UINT32 DstForma } } -static INLINE void writeScanlineBGR(BYTE* dst, DWORD formatSize, UINT32 DstFormat, - const INT16* r, const INT16* g, const INT16* b, DWORD width) +static INLINE void writeScanlineBGR(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, + const INT16* g, const INT16* b, DWORD width) { DWORD x; WINPR_UNUSED(formatSize); @@ -331,8 +325,8 @@ static INLINE void writeScanlineBGR(BYTE* dst, DWORD formatSize, UINT32 DstForma } } -static INLINE void writeScanlineBGRX(BYTE* dst, DWORD formatSize, UINT32 DstFormat, - const INT16* r, const INT16* g, const INT16* b, DWORD width) +static INLINE void writeScanlineBGRX(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, + const INT16* g, const INT16* b, DWORD width) { DWORD x; WINPR_UNUSED(formatSize); @@ -350,8 +344,8 @@ static INLINE void writeScanlineBGRX(BYTE* dst, DWORD formatSize, UINT32 DstForm } } -static INLINE void writeScanlineRGBX(BYTE* dst, DWORD formatSize, UINT32 DstFormat, - const INT16* r, const INT16* g, const INT16* b, DWORD width) +static INLINE void writeScanlineRGBX(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, + const INT16* g, const INT16* b, DWORD width) { DWORD x; WINPR_UNUSED(formatSize); @@ -369,8 +363,8 @@ static INLINE void writeScanlineRGBX(BYTE* dst, DWORD formatSize, UINT32 DstForm } } -static INLINE void writeScanlineXBGR(BYTE* dst, DWORD formatSize, UINT32 DstFormat, - const INT16* r, const INT16* g, const INT16* b, DWORD width) +static INLINE void writeScanlineXBGR(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, + const INT16* g, const INT16* b, DWORD width) { DWORD x; WINPR_UNUSED(formatSize); @@ -388,8 +382,8 @@ static INLINE void writeScanlineXBGR(BYTE* dst, DWORD formatSize, UINT32 DstForm } } -static INLINE void writeScanlineXRGB(BYTE* dst, DWORD formatSize, UINT32 DstFormat, - const INT16* r, const INT16* g, const INT16* b, DWORD width) +static INLINE void writeScanlineXRGB(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, + const INT16* g, const INT16* b, DWORD width) { DWORD x; WINPR_UNUSED(formatSize); @@ -407,8 +401,8 @@ static INLINE void writeScanlineXRGB(BYTE* dst, DWORD formatSize, UINT32 DstForm } } -typedef void (*fkt_writeScanline)(BYTE*, DWORD, UINT32, const INT16*, - const INT16*, const INT16*, DWORD); +typedef void (*fkt_writeScanline)(BYTE*, DWORD, UINT32, const INT16*, const INT16*, const INT16*, + DWORD); static INLINE fkt_writeScanline getScanlineWriteFunction(DWORD format) { @@ -442,17 +436,17 @@ static INLINE fkt_writeScanline getScanlineWriteFunction(DWORD format) } /* ------------------------------------------------------------------------- */ -static pstatus_t general_RGBToRGB_16s8u_P3AC4R_general( - const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ - UINT32 srcStep, /* bytes between rows in source data */ - BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ - UINT32 dstStep, /* bytes between rows in dest data */ - UINT32 DstFormat, - const prim_size_t* roi) /* region of interest */ +static pstatus_t +general_RGBToRGB_16s8u_P3AC4R_general(const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ + UINT32 srcStep, /* bytes between rows in source data */ + BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ + UINT32 dstStep, /* bytes between rows in dest data */ + UINT32 DstFormat, + const prim_size_t* roi) /* region of interest */ { - const INT16* r = pSrc[0]; - const INT16* g = pSrc[1]; - const INT16* b = pSrc[2]; + const INT16* r = pSrc[0]; + const INT16* g = pSrc[1]; + const INT16* b = pSrc[2]; UINT32 y; const DWORD srcAdd = srcStep / sizeof(INT16); fkt_writeScanline writeScanline = getScanlineWriteFunction(DstFormat); @@ -470,17 +464,17 @@ static pstatus_t general_RGBToRGB_16s8u_P3AC4R_general( return PRIMITIVES_SUCCESS; } -static pstatus_t general_RGBToRGB_16s8u_P3AC4R_BGRX( - const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ - UINT32 srcStep, /* bytes between rows in source data */ - BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ - UINT32 dstStep, /* bytes between rows in dest data */ - UINT32 DstFormat, - const prim_size_t* roi) /* region of interest */ +static pstatus_t +general_RGBToRGB_16s8u_P3AC4R_BGRX(const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ + UINT32 srcStep, /* bytes between rows in source data */ + BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ + UINT32 dstStep, /* bytes between rows in dest data */ + UINT32 DstFormat, + const prim_size_t* roi) /* region of interest */ { - const INT16* r = pSrc[0]; - const INT16* g = pSrc[1]; - const INT16* b = pSrc[2]; + const INT16* r = pSrc[0]; + const INT16* g = pSrc[1]; + const INT16* b = pSrc[2]; UINT32 y; const DWORD srcAdd = srcStep / sizeof(INT16); const DWORD formatSize = GetBytesPerPixel(DstFormat); @@ -497,13 +491,12 @@ static pstatus_t general_RGBToRGB_16s8u_P3AC4R_BGRX( return PRIMITIVES_SUCCESS; } -static pstatus_t general_RGBToRGB_16s8u_P3AC4R( - const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ - UINT32 srcStep, /* bytes between rows in source data */ - BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ - UINT32 dstStep, /* bytes between rows in dest data */ - UINT32 DstFormat, - const prim_size_t* roi) /* region of interest */ +static pstatus_t +general_RGBToRGB_16s8u_P3AC4R(const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ + UINT32 srcStep, /* bytes between rows in source data */ + BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ + UINT32 dstStep, /* bytes between rows in dest data */ + UINT32 DstFormat, const prim_size_t* roi) /* region of interest */ { switch (DstFormat) { @@ -512,7 +505,8 @@ static pstatus_t general_RGBToRGB_16s8u_P3AC4R( return general_RGBToRGB_16s8u_P3AC4R_BGRX(pSrc, srcStep, pDst, dstStep, DstFormat, roi); default: - return general_RGBToRGB_16s8u_P3AC4R_general(pSrc, srcStep, pDst, dstStep, DstFormat, roi); + return general_RGBToRGB_16s8u_P3AC4R_general(pSrc, srcStep, pDst, dstStep, DstFormat, + roi); } } /* ------------------------------------------------------------------------- */ @@ -521,5 +515,5 @@ void primitives_init_colors(primitives_t* prims) prims->yCbCrToRGB_16s8u_P3AC4R = general_yCbCrToRGB_16s8u_P3AC4R; prims->yCbCrToRGB_16s16s_P3P3 = general_yCbCrToRGB_16s16s_P3P3; prims->RGBToYCbCr_16s16s_P3P3 = general_RGBToYCbCr_16s16s_P3P3; - prims->RGBToRGB_16s8u_P3AC4R = general_RGBToRGB_16s8u_P3AC4R; + prims->RGBToRGB_16s8u_P3AC4R = general_RGBToRGB_16s8u_P3AC4R; } diff --git a/libfreerdp/primitives/prim_colors_opt.c b/libfreerdp/primitives/prim_colors_opt.c index c1d9fc2e2..f8749c87d 100644 --- a/libfreerdp/primitives/prim_colors_opt.c +++ b/libfreerdp/primitives/prim_colors_opt.c @@ -39,28 +39,27 @@ static primitives_t* generic = NULL; #ifdef WITH_SSE2 #ifdef __GNUC__ -# define GNU_INLINE \ - __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +#define GNU_INLINE __attribute__((__gnu_inline__, __always_inline__, __artificial__)) #else -# define GNU_INLINE +#define GNU_INLINE #endif -#define CACHE_LINE_BYTES 64 +#define CACHE_LINE_BYTES 64 -#define _mm_between_epi16(_val, _min, _max) \ - do { _val = _mm_min_epi16(_max, _mm_max_epi16(_val, _min)); } while (0) +#define _mm_between_epi16(_val, _min, _max) \ + do \ + { \ + _val = _mm_min_epi16(_max, _mm_max_epi16(_val, _min)); \ + } while (0) #ifdef DO_PREFETCH /*---------------------------------------------------------------------------*/ -static inline void GNU_INLINE _mm_prefetch_buffer( - char* buffer, - int num_bytes) +static inline void GNU_INLINE _mm_prefetch_buffer(char* buffer, int num_bytes) { - __m128i* buf = (__m128i*) buffer; + __m128i* buf = (__m128i*)buffer; unsigned int i; - for (i = 0; i < (num_bytes / sizeof(__m128i)); - i += (CACHE_LINE_BYTES / sizeof(__m128i))) + for (i = 0; i < (num_bytes / sizeof(__m128i)); i += (CACHE_LINE_BYTES / sizeof(__m128i))) { _mm_prefetch((char*)(&buf[i]), _MM_HINT_NTA); } @@ -68,45 +67,36 @@ static inline void GNU_INLINE _mm_prefetch_buffer( #endif /* DO_PREFETCH */ /*---------------------------------------------------------------------------*/ -static pstatus_t sse2_yCbCrToRGB_16s16s_P3P3( - const INT16* pSrc[3], - int srcStep, - INT16* pDst[3], - int dstStep, - const prim_size_t* roi) /* region of interest */ +static pstatus_t sse2_yCbCrToRGB_16s16s_P3P3(const INT16* pSrc[3], int srcStep, INT16* pDst[3], + int dstStep, + const prim_size_t* roi) /* region of interest */ { __m128i zero, max, r_cr, g_cb, g_cr, b_cb, c4096; - __m128i* y_buf, *cb_buf, *cr_buf, *r_buf, *g_buf, *b_buf; + __m128i *y_buf, *cb_buf, *cr_buf, *r_buf, *g_buf, *b_buf; UINT32 yp; int srcbump, dstbump, imax; - if (((ULONG_PTR)(pSrc[0]) & 0x0f) - || ((ULONG_PTR)(pSrc[1]) & 0x0f) - || ((ULONG_PTR)(pSrc[2]) & 0x0f) - || ((ULONG_PTR)(pDst[0]) & 0x0f) - || ((ULONG_PTR)(pDst[1]) & 0x0f) - || ((ULONG_PTR)(pDst[2]) & 0x0f) - || (roi->width & 0x07) - || (srcStep & 127) - || (dstStep & 127)) + if (((ULONG_PTR)(pSrc[0]) & 0x0f) || ((ULONG_PTR)(pSrc[1]) & 0x0f) || + ((ULONG_PTR)(pSrc[2]) & 0x0f) || ((ULONG_PTR)(pDst[0]) & 0x0f) || + ((ULONG_PTR)(pDst[1]) & 0x0f) || ((ULONG_PTR)(pDst[2]) & 0x0f) || (roi->width & 0x07) || + (srcStep & 127) || (dstStep & 127)) { /* We can't maintain 16-byte alignment. */ - return generic->yCbCrToRGB_16s16s_P3P3(pSrc, srcStep, - pDst, dstStep, roi); + return generic->yCbCrToRGB_16s16s_P3P3(pSrc, srcStep, pDst, dstStep, roi); } zero = _mm_setzero_si128(); max = _mm_set1_epi16(255); - y_buf = (__m128i*)(pSrc[0]); + y_buf = (__m128i*)(pSrc[0]); cb_buf = (__m128i*)(pSrc[1]); cr_buf = (__m128i*)(pSrc[2]); - r_buf = (__m128i*)(pDst[0]); - g_buf = (__m128i*)(pDst[1]); - b_buf = (__m128i*)(pDst[2]); - r_cr = _mm_set1_epi16(22986); /* 1.403 << 14 */ - g_cb = _mm_set1_epi16(-5636); /* -0.344 << 14 */ - g_cr = _mm_set1_epi16(-11698); /* -0.714 << 14 */ - b_cb = _mm_set1_epi16(28999); /* 1.770 << 14 */ + r_buf = (__m128i*)(pDst[0]); + g_buf = (__m128i*)(pDst[1]); + b_buf = (__m128i*)(pDst[2]); + r_cr = _mm_set1_epi16(22986); /* 1.403 << 14 */ + g_cb = _mm_set1_epi16(-5636); /* -0.344 << 14 */ + g_cr = _mm_set1_epi16(-11698); /* -0.714 << 14 */ + b_cb = _mm_set1_epi16(28999); /* 1.770 << 14 */ c4096 = _mm_set1_epi16(4096); srcbump = srcStep / sizeof(__m128i); dstbump = dstStep / sizeof(__m128i); @@ -120,17 +110,17 @@ static pstatus_t sse2_yCbCrToRGB_16s16s_P3P3( for (i = 0; i < roi->width * sizeof(INT16) / sizeof(__m128i); i += (CACHE_LINE_BYTES / sizeof(__m128i))) { - _mm_prefetch((char*)(&y_buf[i]), _MM_HINT_NTA); + _mm_prefetch((char*)(&y_buf[i]), _MM_HINT_NTA); _mm_prefetch((char*)(&cb_buf[i]), _MM_HINT_NTA); _mm_prefetch((char*)(&cr_buf[i]), _MM_HINT_NTA); } - y_buf += srcbump; + y_buf += srcbump; cb_buf += srcbump; cr_buf += srcbump; } - y_buf = (__m128i*)(pSrc[0]); + y_buf = (__m128i*)(pSrc[0]); cb_buf = (__m128i*)(pSrc[1]); cr_buf = (__m128i*)(pSrc[2]); #endif /* DO_PREFETCH */ @@ -191,7 +181,7 @@ static pstatus_t sse2_yCbCrToRGB_16s16s_P3P3( _mm_store_si128(b_buf + i, b); } - y_buf += srcbump; + y_buf += srcbump; cb_buf += srcbump; cr_buf += srcbump; r_buf += dstbump; @@ -203,17 +193,16 @@ static pstatus_t sse2_yCbCrToRGB_16s16s_P3P3( } /*---------------------------------------------------------------------------*/ -static pstatus_t sse2_yCbCrToRGB_16s8u_P3AC4R_BGRX( - const INT16* pSrc[3], UINT32 srcStep, - BYTE* pDst, UINT32 dstStep, - const prim_size_t* roi) /* region of interest */ +static pstatus_t sse2_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* pSrc[3], UINT32 srcStep, BYTE* pDst, + UINT32 dstStep, + const prim_size_t* roi) /* region of interest */ { const __m128i zero = _mm_setzero_si128(); const __m128i max = _mm_set1_epi16(255); - const __m128i r_cr = _mm_set1_epi16(22986); /* 1.403 << 14 */ - const __m128i g_cb = _mm_set1_epi16(-5636); /* -0.344 << 14 */ - const __m128i g_cr = _mm_set1_epi16(-11698); /* -0.714 << 14 */ - const __m128i b_cb = _mm_set1_epi16(28999); /* 1.770 << 14 */ + const __m128i r_cr = _mm_set1_epi16(22986); /* 1.403 << 14 */ + const __m128i g_cb = _mm_set1_epi16(-5636); /* -0.344 << 14 */ + const __m128i g_cr = _mm_set1_epi16(-11698); /* -0.714 << 14 */ + const __m128i b_cb = _mm_set1_epi16(28999); /* 1.770 << 14 */ const __m128i c4096 = _mm_set1_epi16(4096); const INT16* y_buf = (INT16*)pSrc[0]; const INT16* cb_buf = (INT16*)pSrc[1]; @@ -231,20 +220,19 @@ static pstatus_t sse2_yCbCrToRGB_16s8u_P3AC4R_BGRX( { int i; - for (i = 0; i < imax; - i += (CACHE_LINE_BYTES / sizeof(__m128i))) + for (i = 0; i < imax; i += (CACHE_LINE_BYTES / sizeof(__m128i))) { - _mm_prefetch((char*)(&((__m128i*)y_buf)[i]), _MM_HINT_NTA); + _mm_prefetch((char*)(&((__m128i*)y_buf)[i]), _MM_HINT_NTA); _mm_prefetch((char*)(&((__m128i*)cb_buf)[i]), _MM_HINT_NTA); _mm_prefetch((char*)(&((__m128i*)cr_buf)[i]), _MM_HINT_NTA); } - y_buf += srcStep / sizeof(INT16); + y_buf += srcStep / sizeof(INT16); cb_buf += srcStep / sizeof(INT16); cr_buf += srcStep / sizeof(INT16); } - y_buf = (INT16*)pSrc[0]; + y_buf = (INT16*)pSrc[0]; cb_buf = (INT16*)pSrc[1]; cr_buf = (INT16*)pSrc[2]; #endif /* DO_PREFETCH */ @@ -333,28 +321,28 @@ static pstatus_t sse2_yCbCrToRGB_16s8u_P3AC4R_BGRX( /* The comments below pretend these are 8-byte registers * rather than 16-byte, for readability. */ - R0 = b1; /* R0 = 00B300B200B100B0 */ - R1 = b2; /* R1 = 00B700B600B500B4 */ - R0 = _mm_packus_epi16(R0, R1); /* R0 = B7B6B5B4B3B2B1B0 */ - R1 = g1; /* R1 = 00G300G200G100G0 */ - R2 = g2; /* R2 = 00G700G600G500G4 */ - R1 = _mm_packus_epi16(R1, R2); /* R1 = G7G6G5G4G3G2G1G0 */ - R2 = R1; /* R2 = G7G6G5G4G3G2G1G0 */ - R2 = _mm_unpacklo_epi8(R0, R2); /* R2 = B3G3B2G2B1G1B0G0 */ - R1 = _mm_unpackhi_epi8(R0, R1); /* R1 = B7G7B6G6B5G5B4G4 */ - R0 = r1; /* R0 = 00R300R200R100R0 */ - R3 = r2; /* R3 = 00R700R600R500R4 */ - R0 = _mm_packus_epi16(R0, R3); /* R0 = R7R6R5R4R3R2R1R0 */ - R3 = _mm_set1_epi32(0xFFFFFFFFU); /* R3 = FFFFFFFFFFFFFFFF */ - R4 = R3; /* R4 = FFFFFFFFFFFFFFFF */ - R4 = _mm_unpacklo_epi8(R0, R4); /* R4 = R3FFR2FFR1FFR0FF */ - R3 = _mm_unpackhi_epi8(R0, R3); /* R3 = R7FFR6FFR5FFR4FF */ - R0 = R4; /* R0 = R4 */ - R0 = _mm_unpacklo_epi16(R2, R0); /* R0 = B1G1R1FFB0G0R0FF */ - R4 = _mm_unpackhi_epi16(R2, R4); /* R4 = B3G3R3FFB2G2R2FF */ - R2 = R3; /* R2 = R3 */ - R2 = _mm_unpacklo_epi16(R1, R2); /* R2 = B5G5R5FFB4G4R4FF */ - R3 = _mm_unpackhi_epi16(R1, R3); /* R3 = B7G7R7FFB6G6R6FF */ + R0 = b1; /* R0 = 00B300B200B100B0 */ + R1 = b2; /* R1 = 00B700B600B500B4 */ + R0 = _mm_packus_epi16(R0, R1); /* R0 = B7B6B5B4B3B2B1B0 */ + R1 = g1; /* R1 = 00G300G200G100G0 */ + R2 = g2; /* R2 = 00G700G600G500G4 */ + R1 = _mm_packus_epi16(R1, R2); /* R1 = G7G6G5G4G3G2G1G0 */ + R2 = R1; /* R2 = G7G6G5G4G3G2G1G0 */ + R2 = _mm_unpacklo_epi8(R0, R2); /* R2 = B3G3B2G2B1G1B0G0 */ + R1 = _mm_unpackhi_epi8(R0, R1); /* R1 = B7G7B6G6B5G5B4G4 */ + R0 = r1; /* R0 = 00R300R200R100R0 */ + R3 = r2; /* R3 = 00R700R600R500R4 */ + R0 = _mm_packus_epi16(R0, R3); /* R0 = R7R6R5R4R3R2R1R0 */ + R3 = _mm_set1_epi32(0xFFFFFFFFU); /* R3 = FFFFFFFFFFFFFFFF */ + R4 = R3; /* R4 = FFFFFFFFFFFFFFFF */ + R4 = _mm_unpacklo_epi8(R0, R4); /* R4 = R3FFR2FFR1FFR0FF */ + R3 = _mm_unpackhi_epi8(R0, R3); /* R3 = R7FFR6FFR5FFR4FF */ + R0 = R4; /* R0 = R4 */ + R0 = _mm_unpacklo_epi16(R2, R0); /* R0 = B1G1R1FFB0G0R0FF */ + R4 = _mm_unpackhi_epi16(R2, R4); /* R4 = B3G3R3FFB2G2R2FF */ + R2 = R3; /* R2 = R3 */ + R2 = _mm_unpacklo_epi16(R1, R2); /* R2 = B5G5R5FFB4G4R4FF */ + R3 = _mm_unpackhi_epi16(R1, R3); /* R3 = B7G7R7FFB6G6R6FF */ _mm_store_si128((__m128i*)d_buf, R0); /* B1G1R1FFB0G0R0FF */ d_buf += sizeof(__m128i); _mm_store_si128((__m128i*)d_buf, R4); /* B3G3R3FFB2G2R2FF */ @@ -392,17 +380,16 @@ static pstatus_t sse2_yCbCrToRGB_16s8u_P3AC4R_BGRX( } /*---------------------------------------------------------------------------*/ -static pstatus_t sse2_yCbCrToRGB_16s8u_P3AC4R_RGBX( - const INT16* pSrc[3], UINT32 srcStep, - BYTE* pDst, UINT32 dstStep, - const prim_size_t* roi) /* region of interest */ +static pstatus_t sse2_yCbCrToRGB_16s8u_P3AC4R_RGBX(const INT16* pSrc[3], UINT32 srcStep, BYTE* pDst, + UINT32 dstStep, + const prim_size_t* roi) /* region of interest */ { const __m128i zero = _mm_setzero_si128(); const __m128i max = _mm_set1_epi16(255); - const __m128i r_cr = _mm_set1_epi16(22986); /* 1.403 << 14 */ - const __m128i g_cb = _mm_set1_epi16(-5636); /* -0.344 << 14 */ - const __m128i g_cr = _mm_set1_epi16(-11698); /* -0.714 << 14 */ - const __m128i b_cb = _mm_set1_epi16(28999); /* 1.770 << 14 */ + const __m128i r_cr = _mm_set1_epi16(22986); /* 1.403 << 14 */ + const __m128i g_cb = _mm_set1_epi16(-5636); /* -0.344 << 14 */ + const __m128i g_cr = _mm_set1_epi16(-11698); /* -0.714 << 14 */ + const __m128i b_cb = _mm_set1_epi16(28999); /* 1.770 << 14 */ const __m128i c4096 = _mm_set1_epi16(4096); const INT16* y_buf = (INT16*)pSrc[0]; const INT16* cb_buf = (INT16*)pSrc[1]; @@ -420,20 +407,19 @@ static pstatus_t sse2_yCbCrToRGB_16s8u_P3AC4R_RGBX( { int i; - for (i = 0; i < imax; - i += (CACHE_LINE_BYTES / sizeof(__m128i))) + for (i = 0; i < imax; i += (CACHE_LINE_BYTES / sizeof(__m128i))) { - _mm_prefetch((char*)(&((__m128i*)y_buf)[i]), _MM_HINT_NTA); + _mm_prefetch((char*)(&((__m128i*)y_buf)[i]), _MM_HINT_NTA); _mm_prefetch((char*)(&((__m128i*)cb_buf)[i]), _MM_HINT_NTA); _mm_prefetch((char*)(&((__m128i*)cr_buf)[i]), _MM_HINT_NTA); } - y_buf += srcStep / sizeof(INT16); + y_buf += srcStep / sizeof(INT16); cb_buf += srcStep / sizeof(INT16); cr_buf += srcStep / sizeof(INT16); } - y_buf = (INT16*)(pSrc[0]); + y_buf = (INT16*)(pSrc[0]); cb_buf = (INT16*)(pSrc[1]); cr_buf = (INT16*)(pSrc[2]); #endif /* DO_PREFETCH */ @@ -522,28 +508,28 @@ static pstatus_t sse2_yCbCrToRGB_16s8u_P3AC4R_RGBX( /* The comments below pretend these are 8-byte registers * rather than 16-byte, for readability. */ - R0 = r1; /* R0 = 00R300R200R100R0 */ - R1 = r2; /* R1 = 00R700R600R500R4 */ - R0 = _mm_packus_epi16(R0, R1); /* R0 = R7R6R5R4R3R2R1R0 */ - R1 = g1; /* R1 = 00G300G200G100G0 */ - R2 = g2; /* R2 = 00G700G600G500G4 */ - R1 = _mm_packus_epi16(R1, R2); /* R1 = G7G6G5G4G3G2G1G0 */ - R2 = R1; /* R2 = G7G6G5G4G3G2G1G0 */ - R2 = _mm_unpacklo_epi8(R0, R2); /* R2 = R3G3R2G2R1G1R0G0 */ - R1 = _mm_unpackhi_epi8(R0, R1); /* R1 = R7G7R6G6R5G5R4G4 */ - R0 = b1; /* R0 = 00B300B200B100B0 */ - R3 = b2; /* R3 = 00B700B600B500B4 */ - R0 = _mm_packus_epi16(R0, R3); /* R0 = B7B6B5B4B3B2B1B0 */ - R3 = _mm_set1_epi32(0xFFFFFFFFU); /* R3 = FFFFFFFFFFFFFFFF */ - R4 = R3; /* R4 = FFFFFFFFFFFFFFFF */ - R4 = _mm_unpacklo_epi8(R0, R4); /* R4 = B3FFB2FFB1FFB0FF */ - R3 = _mm_unpackhi_epi8(R0, R3); /* R3 = B7FFB6FFB5FFB4FF */ - R0 = R4; /* R0 = R4 */ - R0 = _mm_unpacklo_epi16(R2, R0); /* R0 = R1G1B1FFR0G0B0FF */ - R4 = _mm_unpackhi_epi16(R2, R4); /* R4 = R3G3B3FFR2G2B2FF */ - R2 = R3; /* R2 = R3 */ - R2 = _mm_unpacklo_epi16(R1, R2); /* R2 = R5G5B5FFR4G4B4FF */ - R3 = _mm_unpackhi_epi16(R1, R3); /* R3 = R7G7B7FFR6G6B6FF */ + R0 = r1; /* R0 = 00R300R200R100R0 */ + R1 = r2; /* R1 = 00R700R600R500R4 */ + R0 = _mm_packus_epi16(R0, R1); /* R0 = R7R6R5R4R3R2R1R0 */ + R1 = g1; /* R1 = 00G300G200G100G0 */ + R2 = g2; /* R2 = 00G700G600G500G4 */ + R1 = _mm_packus_epi16(R1, R2); /* R1 = G7G6G5G4G3G2G1G0 */ + R2 = R1; /* R2 = G7G6G5G4G3G2G1G0 */ + R2 = _mm_unpacklo_epi8(R0, R2); /* R2 = R3G3R2G2R1G1R0G0 */ + R1 = _mm_unpackhi_epi8(R0, R1); /* R1 = R7G7R6G6R5G5R4G4 */ + R0 = b1; /* R0 = 00B300B200B100B0 */ + R3 = b2; /* R3 = 00B700B600B500B4 */ + R0 = _mm_packus_epi16(R0, R3); /* R0 = B7B6B5B4B3B2B1B0 */ + R3 = _mm_set1_epi32(0xFFFFFFFFU); /* R3 = FFFFFFFFFFFFFFFF */ + R4 = R3; /* R4 = FFFFFFFFFFFFFFFF */ + R4 = _mm_unpacklo_epi8(R0, R4); /* R4 = B3FFB2FFB1FFB0FF */ + R3 = _mm_unpackhi_epi8(R0, R3); /* R3 = B7FFB6FFB5FFB4FF */ + R0 = R4; /* R0 = R4 */ + R0 = _mm_unpacklo_epi16(R2, R0); /* R0 = R1G1B1FFR0G0B0FF */ + R4 = _mm_unpackhi_epi16(R2, R4); /* R4 = R3G3B3FFR2G2B2FF */ + R2 = R3; /* R2 = R3 */ + R2 = _mm_unpacklo_epi16(R1, R2); /* R2 = R5G5B5FFR4G4B4FF */ + R3 = _mm_unpackhi_epi16(R1, R3); /* R3 = R7G7B7FFR6G6B6FF */ _mm_store_si128((__m128i*)d_buf, R0); /* R1G1B1FFR0G0B0FF */ d_buf += sizeof(__m128i); _mm_store_si128((__m128i*)d_buf, R4); /* R3G3B3FFR2G2B2FF */ @@ -580,21 +566,16 @@ static pstatus_t sse2_yCbCrToRGB_16s8u_P3AC4R_RGBX( return PRIMITIVES_SUCCESS; } -static pstatus_t sse2_yCbCrToRGB_16s8u_P3AC4R( - const INT16* pSrc[3], UINT32 srcStep, - BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, - const prim_size_t* roi) /* region of interest */ +static pstatus_t sse2_yCbCrToRGB_16s8u_P3AC4R(const INT16* pSrc[3], UINT32 srcStep, BYTE* pDst, + UINT32 dstStep, UINT32 DstFormat, + const prim_size_t* roi) /* region of interest */ { - if (((ULONG_PTR)(pSrc[0]) & 0x0f) - || ((ULONG_PTR)(pSrc[1]) & 0x0f) - || ((ULONG_PTR)(pSrc[2]) & 0x0f) - || ((ULONG_PTR)(pDst) & 0x0f) - || (srcStep & 0x0f) - || (dstStep & 0x0f)) + if (((ULONG_PTR)(pSrc[0]) & 0x0f) || ((ULONG_PTR)(pSrc[1]) & 0x0f) || + ((ULONG_PTR)(pSrc[2]) & 0x0f) || ((ULONG_PTR)(pDst)&0x0f) || (srcStep & 0x0f) || + (dstStep & 0x0f)) { /* We can't maintain 16-byte alignment. */ - return generic->yCbCrToRGB_16s8u_P3AC4R(pSrc, srcStep, - pDst, dstStep, DstFormat, roi); + return generic->yCbCrToRGB_16s8u_P3AC4R(pSrc, srcStep, pDst, dstStep, DstFormat, roi); } switch (DstFormat) @@ -614,44 +595,35 @@ static pstatus_t sse2_yCbCrToRGB_16s8u_P3AC4R( /* The encodec YCbCr coeffectients are represented as 11.5 fixed-point * numbers. See the general code above. */ -static pstatus_t sse2_RGBToYCbCr_16s16s_P3P3( - const INT16* pSrc[3], - int srcStep, - INT16* pDst[3], - int dstStep, - const prim_size_t* roi) /* region of interest */ +static pstatus_t sse2_RGBToYCbCr_16s16s_P3P3(const INT16* pSrc[3], int srcStep, INT16* pDst[3], + int dstStep, + const prim_size_t* roi) /* region of interest */ { __m128i min, max, y_r, y_g, y_b, cb_r, cb_g, cb_b, cr_r, cr_g, cr_b; - __m128i* r_buf, *g_buf, *b_buf, *y_buf, *cb_buf, *cr_buf; + __m128i *r_buf, *g_buf, *b_buf, *y_buf, *cb_buf, *cr_buf; UINT32 yp; int srcbump, dstbump, imax; - if (((ULONG_PTR)(pSrc[0]) & 0x0f) - || ((ULONG_PTR)(pSrc[1]) & 0x0f) - || ((ULONG_PTR)(pSrc[2]) & 0x0f) - || ((ULONG_PTR)(pDst[0]) & 0x0f) - || ((ULONG_PTR)(pDst[1]) & 0x0f) - || ((ULONG_PTR)(pDst[2]) & 0x0f) - || (roi->width & 0x07) - || (srcStep & 127) - || (dstStep & 127)) + if (((ULONG_PTR)(pSrc[0]) & 0x0f) || ((ULONG_PTR)(pSrc[1]) & 0x0f) || + ((ULONG_PTR)(pSrc[2]) & 0x0f) || ((ULONG_PTR)(pDst[0]) & 0x0f) || + ((ULONG_PTR)(pDst[1]) & 0x0f) || ((ULONG_PTR)(pDst[2]) & 0x0f) || (roi->width & 0x07) || + (srcStep & 127) || (dstStep & 127)) { /* We can't maintain 16-byte alignment. */ - return generic->RGBToYCbCr_16s16s_P3P3(pSrc, srcStep, - pDst, dstStep, roi); + return generic->RGBToYCbCr_16s16s_P3P3(pSrc, srcStep, pDst, dstStep, roi); } min = _mm_set1_epi16(-128 * 32); max = _mm_set1_epi16(127 * 32); - r_buf = (__m128i*)(pSrc[0]); - g_buf = (__m128i*)(pSrc[1]); - b_buf = (__m128i*)(pSrc[2]); - y_buf = (__m128i*)(pDst[0]); + r_buf = (__m128i*)(pSrc[0]); + g_buf = (__m128i*)(pSrc[1]); + b_buf = (__m128i*)(pSrc[2]); + y_buf = (__m128i*)(pDst[0]); cb_buf = (__m128i*)(pDst[1]); cr_buf = (__m128i*)(pDst[2]); - y_r = _mm_set1_epi16(9798); /* 0.299000 << 15 */ - y_g = _mm_set1_epi16(19235); /* 0.587000 << 15 */ - y_b = _mm_set1_epi16(3735); /* 0.114000 << 15 */ + y_r = _mm_set1_epi16(9798); /* 0.299000 << 15 */ + y_g = _mm_set1_epi16(19235); /* 0.587000 << 15 */ + y_b = _mm_set1_epi16(3735); /* 0.114000 << 15 */ cb_r = _mm_set1_epi16(-5535); /* -0.168935 << 15 */ cb_g = _mm_set1_epi16(-10868); /* -0.331665 << 15 */ cb_b = _mm_set1_epi16(16403); /* 0.500590 << 15 */ @@ -735,7 +707,7 @@ static pstatus_t sse2_RGBToYCbCr_16s16s_P3P3( _mm_store_si128(cr_buf + i, cr); } - y_buf += srcbump; + y_buf += srcbump; cb_buf += srcbump; cr_buf += srcbump; r_buf += dstbump; @@ -747,12 +719,12 @@ static pstatus_t sse2_RGBToYCbCr_16s16s_P3P3( } /*---------------------------------------------------------------------------*/ -static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_BGRX( - const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ - UINT32 srcStep, /* bytes between rows in source data */ - BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ - UINT32 dstStep, /* bytes between rows in dest data */ - const prim_size_t* roi) /* region of interest */ +static pstatus_t +sse2_RGBToRGB_16s8u_P3AC4R_BGRX(const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ + UINT32 srcStep, /* bytes between rows in source data */ + BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ + UINT32 dstStep, /* bytes between rows in dest data */ + const prim_size_t* roi) /* region of interest */ { const UINT16* pr = (const UINT16*)(pSrc[0]); const UINT16* pg = (const UINT16*)(pSrc[1]); @@ -761,7 +733,7 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_BGRX( const __m128i a = _mm_set1_epi32(0xFFFFFFFFU); BYTE* out; UINT32 srcbump, dstbump, y; - out = (BYTE*) pDst; + out = (BYTE*)pDst; srcbump = (srcStep - (roi->width * sizeof(UINT16))) / sizeof(UINT16); dstbump = (dstStep - (roi->width * sizeof(UINT32))); @@ -778,54 +750,54 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_BGRX( { __m128i R0, R1; R0 = _mm_load_si128((__m128i*)pb); - pb += 8; /* R0 = 00B300B200B100B0 */ + pb += 8; /* R0 = 00B300B200B100B0 */ R1 = _mm_load_si128((__m128i*)pb); - pb += 8; /* R1 = 00B700B600B500B4 */ - b = _mm_packus_epi16(R0, R1); /* b = B7B6B5B4B3B2B1B0 */ + pb += 8; /* R1 = 00B700B600B500B4 */ + b = _mm_packus_epi16(R0, R1); /* b = B7B6B5B4B3B2B1B0 */ } { __m128i R0, R1; R0 = _mm_load_si128((__m128i*)pg); - pg += 8; /* R1 = 00G300G200G100G0 */ + pg += 8; /* R1 = 00G300G200G100G0 */ R1 = _mm_load_si128((__m128i*)pg); - pg += 8; /* R2 = 00G700G600G500G4 */ - g = _mm_packus_epi16(R0, R1); /* g = G7G6G5G4G3G2G1G0 */ + pg += 8; /* R2 = 00G700G600G500G4 */ + g = _mm_packus_epi16(R0, R1); /* g = G7G6G5G4G3G2G1G0 */ } { __m128i R0, R1; R0 = _mm_load_si128((__m128i*)pr); - pr += 8; /* R0 = 00R300R200R100R0 */ + pr += 8; /* R0 = 00R300R200R100R0 */ R1 = _mm_load_si128((__m128i*)pr); - pr += 8; /* R3 = 00R700R600R500R4 */ - r = _mm_packus_epi16(R0, R1); /* r = R7R6R5R4R3R2R1R0 */ + pr += 8; /* R3 = 00R700R600R500R4 */ + r = _mm_packus_epi16(R0, R1); /* r = R7R6R5R4R3R2R1R0 */ } { __m128i gbHi, gbLo, arHi, arLo; { - gbLo = _mm_unpacklo_epi8(b, g); /* R0 = G7G6G5G4G3G2G1G0 */ - gbHi = _mm_unpackhi_epi8(b, g); /* R1 = G7B7G6B7G5B5G4B4 */ - arLo = _mm_unpacklo_epi8(r, a); /* R4 = FFR3FFR2FFR1FFR0 */ - arHi = _mm_unpackhi_epi8(r, a); /* R3 = FFR7FFR6FFR5FFR4 */ + gbLo = _mm_unpacklo_epi8(b, g); /* R0 = G7G6G5G4G3G2G1G0 */ + gbHi = _mm_unpackhi_epi8(b, g); /* R1 = G7B7G6B7G5B5G4B4 */ + arLo = _mm_unpacklo_epi8(r, a); /* R4 = FFR3FFR2FFR1FFR0 */ + arHi = _mm_unpackhi_epi8(r, a); /* R3 = FFR7FFR6FFR5FFR4 */ } { const __m128i bgrx = _mm_unpacklo_epi16(gbLo, arLo); _mm_store_si128((__m128i*)out, bgrx); - out += 16; /* FFR1G1B1FFR0G0B0 */ + out += 16; /* FFR1G1B1FFR0G0B0 */ } { const __m128i bgrx = _mm_unpackhi_epi16(gbLo, arLo); _mm_store_si128((__m128i*)out, bgrx); - out += 16; /* FFR3G3B3FFR2G2B2 */ + out += 16; /* FFR3G3B3FFR2G2B2 */ } { const __m128i bgrx = _mm_unpacklo_epi16(gbHi, arHi); _mm_store_si128((__m128i*)out, bgrx); - out += 16; /* FFR5G5B5FFR4G4B4 */ + out += 16; /* FFR5G5B5FFR4G4B4 */ } { const __m128i bgrx = _mm_unpackhi_epi16(gbHi, arHi); _mm_store_si128((__m128i*)out, bgrx); - out += 16; /* FFR7G7B7FFR6G6B6 */ + out += 16; /* FFR7G7B7FFR6G6B6 */ } } } @@ -851,12 +823,12 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_BGRX( return PRIMITIVES_SUCCESS; } -static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_RGBX( - const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ - UINT32 srcStep, /* bytes between rows in source data */ - BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ - UINT32 dstStep, /* bytes between rows in dest data */ - const prim_size_t* roi) /* region of interest */ +static pstatus_t +sse2_RGBToRGB_16s8u_P3AC4R_RGBX(const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ + UINT32 srcStep, /* bytes between rows in source data */ + BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ + UINT32 dstStep, /* bytes between rows in dest data */ + const prim_size_t* roi) /* region of interest */ { const UINT16* pr = (const UINT16*)(pSrc[0]); const UINT16* pg = (const UINT16*)(pSrc[1]); @@ -865,7 +837,7 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_RGBX( const __m128i a = _mm_set1_epi32(0xFFFFFFFFU); BYTE* out; UINT32 srcbump, dstbump, y; - out = (BYTE*) pDst; + out = (BYTE*)pDst; srcbump = (srcStep - (roi->width * sizeof(UINT16))) / sizeof(UINT16); dstbump = (dstStep - (roi->width * sizeof(UINT32))); @@ -882,54 +854,54 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_RGBX( { __m128i R0, R1; R0 = _mm_load_si128((__m128i*)pb); - pb += 8; /* R0 = 00B300B200B100B0 */ + pb += 8; /* R0 = 00B300B200B100B0 */ R1 = _mm_load_si128((__m128i*)pb); - pb += 8; /* R1 = 00B700B600B500B4 */ - b = _mm_packus_epi16(R0, R1); /* b = B7B6B5B4B3B2B1B0 */ + pb += 8; /* R1 = 00B700B600B500B4 */ + b = _mm_packus_epi16(R0, R1); /* b = B7B6B5B4B3B2B1B0 */ } { __m128i R0, R1; R0 = _mm_load_si128((__m128i*)pg); - pg += 8; /* R1 = 00G300G200G100G0 */ + pg += 8; /* R1 = 00G300G200G100G0 */ R1 = _mm_load_si128((__m128i*)pg); - pg += 8; /* R2 = 00G700G600G500G4 */ - g = _mm_packus_epi16(R0, R1); /* g = G7G6G5G4G3G2G1G0 */ + pg += 8; /* R2 = 00G700G600G500G4 */ + g = _mm_packus_epi16(R0, R1); /* g = G7G6G5G4G3G2G1G0 */ } { __m128i R0, R1; R0 = _mm_load_si128((__m128i*)pr); - pr += 8; /* R0 = 00R300R200R100R0 */ + pr += 8; /* R0 = 00R300R200R100R0 */ R1 = _mm_load_si128((__m128i*)pr); - pr += 8; /* R3 = 00R700R600R500R4 */ - r = _mm_packus_epi16(R0, R1); /* r = R7R6R5R4R3R2R1R0 */ + pr += 8; /* R3 = 00R700R600R500R4 */ + r = _mm_packus_epi16(R0, R1); /* r = R7R6R5R4R3R2R1R0 */ } { __m128i gbHi, gbLo, arHi, arLo; { - gbLo = _mm_unpacklo_epi8(r, g); /* R0 = G7G6G5G4G3G2G1G0 */ - gbHi = _mm_unpackhi_epi8(r, g); /* R1 = G7B7G6B7G5B5G4B4 */ - arLo = _mm_unpacklo_epi8(b, a); /* R4 = FFR3FFR2FFR1FFR0 */ - arHi = _mm_unpackhi_epi8(b, a); /* R3 = FFR7FFR6FFR5FFR4 */ + gbLo = _mm_unpacklo_epi8(r, g); /* R0 = G7G6G5G4G3G2G1G0 */ + gbHi = _mm_unpackhi_epi8(r, g); /* R1 = G7B7G6B7G5B5G4B4 */ + arLo = _mm_unpacklo_epi8(b, a); /* R4 = FFR3FFR2FFR1FFR0 */ + arHi = _mm_unpackhi_epi8(b, a); /* R3 = FFR7FFR6FFR5FFR4 */ } { const __m128i bgrx = _mm_unpacklo_epi16(gbLo, arLo); _mm_store_si128((__m128i*)out, bgrx); - out += 16; /* FFR1G1B1FFR0G0B0 */ + out += 16; /* FFR1G1B1FFR0G0B0 */ } { const __m128i bgrx = _mm_unpackhi_epi16(gbLo, arLo); _mm_store_si128((__m128i*)out, bgrx); - out += 16; /* FFR3G3B3FFR2G2B2 */ + out += 16; /* FFR3G3B3FFR2G2B2 */ } { const __m128i bgrx = _mm_unpacklo_epi16(gbHi, arHi); _mm_store_si128((__m128i*)out, bgrx); - out += 16; /* FFR5G5B5FFR4G4B4 */ + out += 16; /* FFR5G5B5FFR4G4B4 */ } { const __m128i bgrx = _mm_unpackhi_epi16(gbHi, arHi); _mm_store_si128((__m128i*)out, bgrx); - out += 16; /* FFR7G7B7FFR6G6B6 */ + out += 16; /* FFR7G7B7FFR6G6B6 */ } } } @@ -955,12 +927,12 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_RGBX( return PRIMITIVES_SUCCESS; } -static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XBGR( - const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ - UINT32 srcStep, /* bytes between rows in source data */ - BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ - UINT32 dstStep, /* bytes between rows in dest data */ - const prim_size_t* roi) /* region of interest */ +static pstatus_t +sse2_RGBToRGB_16s8u_P3AC4R_XBGR(const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ + UINT32 srcStep, /* bytes between rows in source data */ + BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ + UINT32 dstStep, /* bytes between rows in dest data */ + const prim_size_t* roi) /* region of interest */ { const UINT16* pr = (const UINT16*)(pSrc[0]); const UINT16* pg = (const UINT16*)(pSrc[1]); @@ -969,7 +941,7 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XBGR( const __m128i a = _mm_set1_epi32(0xFFFFFFFFU); BYTE* out; UINT32 srcbump, dstbump, y; - out = (BYTE*) pDst; + out = (BYTE*)pDst; srcbump = (srcStep - (roi->width * sizeof(UINT16))) / sizeof(UINT16); dstbump = (dstStep - (roi->width * sizeof(UINT32))); @@ -986,54 +958,54 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XBGR( { __m128i R0, R1; R0 = _mm_load_si128((__m128i*)pb); - pb += 8; /* R0 = 00B300B200B100B0 */ + pb += 8; /* R0 = 00B300B200B100B0 */ R1 = _mm_load_si128((__m128i*)pb); - pb += 8; /* R1 = 00B700B600B500B4 */ - b = _mm_packus_epi16(R0, R1); /* b = B7B6B5B4B3B2B1B0 */ + pb += 8; /* R1 = 00B700B600B500B4 */ + b = _mm_packus_epi16(R0, R1); /* b = B7B6B5B4B3B2B1B0 */ } { __m128i R0, R1; R0 = _mm_load_si128((__m128i*)pg); - pg += 8; /* R1 = 00G300G200G100G0 */ + pg += 8; /* R1 = 00G300G200G100G0 */ R1 = _mm_load_si128((__m128i*)pg); - pg += 8; /* R2 = 00G700G600G500G4 */ - g = _mm_packus_epi16(R0, R1); /* g = G7G6G5G4G3G2G1G0 */ + pg += 8; /* R2 = 00G700G600G500G4 */ + g = _mm_packus_epi16(R0, R1); /* g = G7G6G5G4G3G2G1G0 */ } { __m128i R0, R1; R0 = _mm_load_si128((__m128i*)pr); - pr += 8; /* R0 = 00R300R200R100R0 */ + pr += 8; /* R0 = 00R300R200R100R0 */ R1 = _mm_load_si128((__m128i*)pr); - pr += 8; /* R3 = 00R700R600R500R4 */ - r = _mm_packus_epi16(R0, R1); /* r = R7R6R5R4R3R2R1R0 */ + pr += 8; /* R3 = 00R700R600R500R4 */ + r = _mm_packus_epi16(R0, R1); /* r = R7R6R5R4R3R2R1R0 */ } { __m128i gbHi, gbLo, arHi, arLo; { - gbLo = _mm_unpacklo_epi8(a, b); /* R0 = G7G6G5G4G3G2G1G0 */ - gbHi = _mm_unpackhi_epi8(a, b); /* R1 = G7B7G6B7G5B5G4B4 */ - arLo = _mm_unpacklo_epi8(g, r); /* R4 = FFR3FFR2FFR1FFR0 */ - arHi = _mm_unpackhi_epi8(g, r); /* R3 = FFR7FFR6FFR5FFR4 */ + gbLo = _mm_unpacklo_epi8(a, b); /* R0 = G7G6G5G4G3G2G1G0 */ + gbHi = _mm_unpackhi_epi8(a, b); /* R1 = G7B7G6B7G5B5G4B4 */ + arLo = _mm_unpacklo_epi8(g, r); /* R4 = FFR3FFR2FFR1FFR0 */ + arHi = _mm_unpackhi_epi8(g, r); /* R3 = FFR7FFR6FFR5FFR4 */ } { const __m128i bgrx = _mm_unpacklo_epi16(gbLo, arLo); _mm_store_si128((__m128i*)out, bgrx); - out += 16; /* FFR1G1B1FFR0G0B0 */ + out += 16; /* FFR1G1B1FFR0G0B0 */ } { const __m128i bgrx = _mm_unpackhi_epi16(gbLo, arLo); _mm_store_si128((__m128i*)out, bgrx); - out += 16; /* FFR3G3B3FFR2G2B2 */ + out += 16; /* FFR3G3B3FFR2G2B2 */ } { const __m128i bgrx = _mm_unpacklo_epi16(gbHi, arHi); _mm_store_si128((__m128i*)out, bgrx); - out += 16; /* FFR5G5B5FFR4G4B4 */ + out += 16; /* FFR5G5B5FFR4G4B4 */ } { const __m128i bgrx = _mm_unpackhi_epi16(gbHi, arHi); _mm_store_si128((__m128i*)out, bgrx); - out += 16; /* FFR7G7B7FFR6G6B6 */ + out += 16; /* FFR7G7B7FFR6G6B6 */ } } } @@ -1059,12 +1031,12 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XBGR( return PRIMITIVES_SUCCESS; } -static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XRGB( - const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ - UINT32 srcStep, /* bytes between rows in source data */ - BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ - UINT32 dstStep, /* bytes between rows in dest data */ - const prim_size_t* roi) /* region of interest */ +static pstatus_t +sse2_RGBToRGB_16s8u_P3AC4R_XRGB(const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ + UINT32 srcStep, /* bytes between rows in source data */ + BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ + UINT32 dstStep, /* bytes between rows in dest data */ + const prim_size_t* roi) /* region of interest */ { const UINT16* pr = (const UINT16*)(pSrc[0]); const UINT16* pg = (const UINT16*)(pSrc[1]); @@ -1073,7 +1045,7 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XRGB( const UINT32 pad = roi->width % 16; BYTE* out; UINT32 srcbump, dstbump, y; - out = (BYTE*) pDst; + out = (BYTE*)pDst; srcbump = (srcStep - (roi->width * sizeof(UINT16))) / sizeof(UINT16); dstbump = (dstStep - (roi->width * sizeof(UINT32))); @@ -1090,54 +1062,54 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XRGB( { __m128i R0, R1; R0 = _mm_load_si128((__m128i*)pb); - pb += 8; /* R0 = 00B300B200B100B0 */ + pb += 8; /* R0 = 00B300B200B100B0 */ R1 = _mm_load_si128((__m128i*)pb); - pb += 8; /* R1 = 00B700B600B500B4 */ - b = _mm_packus_epi16(R0, R1); /* b = B7B6B5B4B3B2B1B0 */ + pb += 8; /* R1 = 00B700B600B500B4 */ + b = _mm_packus_epi16(R0, R1); /* b = B7B6B5B4B3B2B1B0 */ } { __m128i R0, R1; R0 = _mm_load_si128((__m128i*)pg); - pg += 8; /* R1 = 00G300G200G100G0 */ + pg += 8; /* R1 = 00G300G200G100G0 */ R1 = _mm_load_si128((__m128i*)pg); - pg += 8; /* R2 = 00G700G600G500G4 */ - g = _mm_packus_epi16(R0, R1); /* g = G7G6G5G4G3G2G1G0 */ + pg += 8; /* R2 = 00G700G600G500G4 */ + g = _mm_packus_epi16(R0, R1); /* g = G7G6G5G4G3G2G1G0 */ } { __m128i R0, R1; R0 = _mm_load_si128((__m128i*)pr); - pr += 8; /* R0 = 00R300R200R100R0 */ + pr += 8; /* R0 = 00R300R200R100R0 */ R1 = _mm_load_si128((__m128i*)pr); - pr += 8; /* R3 = 00R700R600R500R4 */ - r = _mm_packus_epi16(R0, R1); /* r = R7R6R5R4R3R2R1R0 */ + pr += 8; /* R3 = 00R700R600R500R4 */ + r = _mm_packus_epi16(R0, R1); /* r = R7R6R5R4R3R2R1R0 */ } { __m128i gbHi, gbLo, arHi, arLo; { - gbLo = _mm_unpacklo_epi8(a, r); /* R0 = G7G6G5G4G3G2G1G0 */ - gbHi = _mm_unpackhi_epi8(a, r); /* R1 = G7B7G6B7G5B5G4B4 */ - arLo = _mm_unpacklo_epi8(g, b); /* R4 = FFR3FFR2FFR1FFR0 */ - arHi = _mm_unpackhi_epi8(g, b); /* R3 = FFR7FFR6FFR5FFR4 */ + gbLo = _mm_unpacklo_epi8(a, r); /* R0 = G7G6G5G4G3G2G1G0 */ + gbHi = _mm_unpackhi_epi8(a, r); /* R1 = G7B7G6B7G5B5G4B4 */ + arLo = _mm_unpacklo_epi8(g, b); /* R4 = FFR3FFR2FFR1FFR0 */ + arHi = _mm_unpackhi_epi8(g, b); /* R3 = FFR7FFR6FFR5FFR4 */ } { const __m128i bgrx = _mm_unpacklo_epi16(gbLo, arLo); _mm_store_si128((__m128i*)out, bgrx); - out += 16; /* FFR1G1B1FFR0G0B0 */ + out += 16; /* FFR1G1B1FFR0G0B0 */ } { const __m128i bgrx = _mm_unpackhi_epi16(gbLo, arLo); _mm_store_si128((__m128i*)out, bgrx); - out += 16; /* FFR3G3B3FFR2G2B2 */ + out += 16; /* FFR3G3B3FFR2G2B2 */ } { const __m128i bgrx = _mm_unpacklo_epi16(gbHi, arHi); _mm_store_si128((__m128i*)out, bgrx); - out += 16; /* FFR5G5B5FFR4G4B4 */ + out += 16; /* FFR5G5B5FFR4G4B4 */ } { const __m128i bgrx = _mm_unpackhi_epi16(gbHi, arHi); _mm_store_si128((__m128i*)out, bgrx); - out += 16; /* FFR7G7B7FFR6G6B6 */ + out += 16; /* FFR7G7B7FFR6G6B6 */ } } } @@ -1163,13 +1135,12 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XRGB( return PRIMITIVES_SUCCESS; } -static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R( - const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ - UINT32 srcStep, /* bytes between rows in source data */ - BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ - UINT32 dstStep, /* bytes between rows in dest data */ - UINT32 DstFormat, - const prim_size_t* roi) +static pstatus_t +sse2_RGBToRGB_16s8u_P3AC4R(const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ + UINT32 srcStep, /* bytes between rows in source data */ + BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ + UINT32 dstStep, /* bytes between rows in dest data */ + UINT32 DstFormat, const prim_size_t* roi) { if (((ULONG_PTR)pSrc[0] & 0x0f) || ((ULONG_PTR)pSrc[1] & 0x0f) || ((ULONG_PTR)pSrc[2] & 0x0f) || (srcStep & 0x0f) || ((ULONG_PTR)pDst & 0x0f) || (dstStep & 0x0f)) @@ -1201,25 +1172,24 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R( /*---------------------------------------------------------------------------*/ #ifdef WITH_NEON -static pstatus_t neon_yCbCrToRGB_16s16s_P3P3( - const INT16* pSrc[3], INT32 srcStep, - INT16* pDst[3], INT32 dstStep, - const prim_size_t* roi) /* region of interest */ +static pstatus_t neon_yCbCrToRGB_16s16s_P3P3(const INT16* pSrc[3], INT32 srcStep, INT16* pDst[3], + INT32 dstStep, + const prim_size_t* roi) /* region of interest */ { /* TODO: If necessary, check alignments and call the general version. */ int16x8_t zero = vdupq_n_s16(0); int16x8_t max = vdupq_n_s16(255); - int16x8_t r_cr = vdupq_n_s16(22986); // 1.403 << 14 - int16x8_t g_cb = vdupq_n_s16(-5636); // -0.344 << 14 - int16x8_t g_cr = vdupq_n_s16(-11698); // -0.714 << 14 - int16x8_t b_cb = vdupq_n_s16(28999); // 1.770 << 14 + int16x8_t r_cr = vdupq_n_s16(22986); // 1.403 << 14 + int16x8_t g_cb = vdupq_n_s16(-5636); // -0.344 << 14 + int16x8_t g_cr = vdupq_n_s16(-11698); // -0.714 << 14 + int16x8_t b_cb = vdupq_n_s16(28999); // 1.770 << 14 int16x8_t c4096 = vdupq_n_s16(4096); - int16x8_t* y_buf = (int16x8_t*) pSrc[0]; - int16x8_t* cb_buf = (int16x8_t*) pSrc[1]; - int16x8_t* cr_buf = (int16x8_t*) pSrc[2]; - int16x8_t* r_buf = (int16x8_t*) pDst[0]; - int16x8_t* g_buf = (int16x8_t*) pDst[1]; - int16x8_t* b_buf = (int16x8_t*) pDst[2]; + int16x8_t* y_buf = (int16x8_t*)pSrc[0]; + int16x8_t* cb_buf = (int16x8_t*)pSrc[1]; + int16x8_t* cr_buf = (int16x8_t*)pSrc[2]; + int16x8_t* r_buf = (int16x8_t*)pDst[0]; + int16x8_t* g_buf = (int16x8_t*)pDst[1]; + int16x8_t* b_buf = (int16x8_t*)pDst[2]; int srcbump = srcStep / sizeof(int16x8_t); int dstbump = dstStep / sizeof(int16x8_t); int yp; @@ -1232,30 +1202,30 @@ static pstatus_t neon_yCbCrToRGB_16s16s_P3P3( for (i = 0; i < imax; i++) { /* - In order to use NEON signed 16-bit integer multiplication we need to convert - the floating point factors to signed int without loosing information. - The result of this multiplication is 32 bit and we have a NEON instruction - that returns the hi word of the saturated double. - Thus we will multiply the factors by the highest possible 2^n, take the - upper 16 bits of the signed 32-bit result (vqdmulhq_s16 followed by a right - shift by 1 to reverse the doubling) and correct this result by multiplying it - by 2^(16-n). - For the given factors in the conversion matrix the best possible n is 14. + In order to use NEON signed 16-bit integer multiplication we need to convert + the floating point factors to signed int without loosing information. + The result of this multiplication is 32 bit and we have a NEON instruction + that returns the hi word of the saturated double. + Thus we will multiply the factors by the highest possible 2^n, take the + upper 16 bits of the signed 32-bit result (vqdmulhq_s16 followed by a right + shift by 1 to reverse the doubling) and correct this result by multiplying it + by 2^(16-n). + For the given factors in the conversion matrix the best possible n is 14. - Example for calculating r: - r = (y>>5) + 128 + (cr*1.403)>>5 // our base formula - r = (y>>5) + 128 + (HIWORD(cr*(1.403<<14)<<2))>>5 // see above - r = (y+4096)>>5 + (HIWORD(cr*22986)<<2)>>5 // simplification - r = ((y+4096)>>2 + HIWORD(cr*22986)) >> 3 + Example for calculating r: + r = (y>>5) + 128 + (cr*1.403)>>5 // our base formula + r = (y>>5) + 128 + (HIWORD(cr*(1.403<<14)<<2))>>5 // see above + r = (y+4096)>>5 + (HIWORD(cr*22986)<<2)>>5 // simplification + r = ((y+4096)>>2 + HIWORD(cr*22986)) >> 3 */ /* y = (y_buf[i] + 4096) >> 2 */ - int16x8_t y = vld1q_s16((INT16*) &y_buf[i]); + int16x8_t y = vld1q_s16((INT16*)&y_buf[i]); y = vaddq_s16(y, c4096); y = vshrq_n_s16(y, 2); /* cb = cb_buf[i]; */ int16x8_t cb = vld1q_s16((INT16*)&cb_buf[i]); /* cr = cr_buf[i]; */ - int16x8_t cr = vld1q_s16((INT16*) &cr_buf[i]); + int16x8_t cr = vld1q_s16((INT16*)&cr_buf[i]); /* (y + HIWORD(cr*22986)) >> 3 */ int16x8_t r = vaddq_s16(y, vshrq_n_s16(vqdmulhq_s16(cr, r_cr), 1)); r = vshrq_n_s16(r, 3); @@ -1277,7 +1247,7 @@ static pstatus_t neon_yCbCrToRGB_16s16s_P3P3( vst1q_s16((INT16*)&b_buf[i], b); } - y_buf += srcbump; + y_buf += srcbump; cb_buf += srcbump; cr_buf += srcbump; r_buf += dstbump; @@ -1288,18 +1258,14 @@ static pstatus_t neon_yCbCrToRGB_16s16s_P3P3( return PRIMITIVES_SUCCESS; } -static pstatus_t neon_yCbCrToRGB_16s8u_P3AC4R_X( - const INT16* pSrc[3], UINT32 srcStep, - BYTE* pDst, UINT32 dstStep, - const prim_size_t* roi, - uint8_t rPos, - uint8_t gPos, - uint8_t bPos, - uint8_t aPos) +static pstatus_t neon_yCbCrToRGB_16s8u_P3AC4R_X(const INT16* pSrc[3], UINT32 srcStep, BYTE* pDst, + UINT32 dstStep, const prim_size_t* roi, + uint8_t rPos, uint8_t gPos, uint8_t bPos, + uint8_t aPos) { UINT32 x, y; BYTE* pRGB = pDst; - const INT16* pY = pSrc[0]; + const INT16* pY = pSrc[0]; const INT16* pCb = pSrc[1]; const INT16* pCr = pSrc[2]; const size_t srcPad = (srcStep - (roi->width * sizeof(INT16))) / sizeof(INT16); @@ -1338,8 +1304,8 @@ static pstatus_t neon_yCbCrToRGB_16s8u_P3AC4R_X( } { /* G */ - const int32x4_t CbGh = vmull_n_s16(Cbh, 22527); /* 0.343730 * 2^16 */ - const int32x4_t CbGl = vmull_n_s16(Cbl, 22527); /* 0.343730 * 2^16 */ + const int32x4_t CbGh = vmull_n_s16(Cbh, 22527); /* 0.343730 * 2^16 */ + const int32x4_t CbGl = vmull_n_s16(Cbl, 22527); /* 0.343730 * 2^16 */ const int32x4_t CrGh = vmulq_n_s32(vmovl_s16(Crh), 46819); /* 0.714401 * 2^16 */ const int32x4_t CrGl = vmulq_n_s32(vmovl_s16(Crl), 46819); /* 0.714401 * 2^16 */ const int32x4_t CbCrGh = vaddq_s32(CbGh, CrGh); @@ -1408,10 +1374,9 @@ static pstatus_t neon_yCbCrToRGB_16s8u_P3AC4R_X( return PRIMITIVES_SUCCESS; } -static pstatus_t neon_yCbCrToRGB_16s8u_P3AC4R( - const INT16* pSrc[3], UINT32 srcStep, - BYTE* pDst, UINT32 dstStep, UINT32 DstFormat, - const prim_size_t* roi) +static pstatus_t neon_yCbCrToRGB_16s8u_P3AC4R(const INT16* pSrc[3], UINT32 srcStep, BYTE* pDst, + UINT32 dstStep, UINT32 DstFormat, + const prim_size_t* roi) { switch (DstFormat) { @@ -1436,16 +1401,13 @@ static pstatus_t neon_yCbCrToRGB_16s8u_P3AC4R( } } -static pstatus_t neon_RGBToRGB_16s8u_P3AC4R_X( - const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ - UINT32 srcStep, /* bytes between rows in source data */ - BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ - UINT32 dstStep, /* bytes between rows in dest data */ - const prim_size_t* roi, /* region of interest */ - uint8_t rPos, - uint8_t gPos, - uint8_t bPos, - uint8_t aPos) +static pstatus_t +neon_RGBToRGB_16s8u_P3AC4R_X(const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ + UINT32 srcStep, /* bytes between rows in source data */ + BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ + UINT32 dstStep, /* bytes between rows in dest data */ + const prim_size_t* roi, /* region of interest */ + uint8_t rPos, uint8_t gPos, uint8_t bPos, uint8_t aPos) { UINT32 x, y; UINT32 pad = roi->width % 8; @@ -1474,7 +1436,7 @@ static pstatus_t neon_RGBToRGB_16s8u_P3AC4R_X( dst += 32; } - for (x = 0; x < pad; x ++) + for (x = 0; x < pad; x++) { BYTE bgrx[4]; bgrx[bPos] = *pb++; @@ -1491,13 +1453,12 @@ static pstatus_t neon_RGBToRGB_16s8u_P3AC4R_X( return PRIMITIVES_SUCCESS; } -static pstatus_t neon_RGBToRGB_16s8u_P3AC4R( - const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ - UINT32 srcStep, /* bytes between rows in source data */ - BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ - UINT32 dstStep, /* bytes between rows in dest data */ - UINT32 DstFormat, - const prim_size_t* roi) /* region of interest */ +static pstatus_t +neon_RGBToRGB_16s8u_P3AC4R(const INT16* const pSrc[3], /* 16-bit R,G, and B arrays */ + UINT32 srcStep, /* bytes between rows in source data */ + BYTE* pDst, /* 32-bit interleaved ARGB (ABGR?) data */ + UINT32 dstStep, /* bytes between rows in dest data */ + UINT32 DstFormat, const prim_size_t* roi) /* region of interest */ { switch (DstFormat) { @@ -1536,7 +1497,7 @@ void primitives_init_colors_opt(primitives_t* prims) if (IsProcessorFeaturePresent(PF_SSE2_INSTRUCTIONS_AVAILABLE)) { - prims->RGBToRGB_16s8u_P3AC4R = sse2_RGBToRGB_16s8u_P3AC4R; + prims->RGBToRGB_16s8u_P3AC4R = sse2_RGBToRGB_16s8u_P3AC4R; prims->yCbCrToRGB_16s16s_P3P3 = sse2_yCbCrToRGB_16s16s_P3P3; prims->yCbCrToRGB_16s8u_P3AC4R = sse2_yCbCrToRGB_16s8u_P3AC4R; prims->RGBToYCbCr_16s16s_P3P3 = sse2_RGBToYCbCr_16s16s_P3P3; @@ -1546,11 +1507,10 @@ void primitives_init_colors_opt(primitives_t* prims) if (IsProcessorFeaturePresent(PF_ARM_NEON_INSTRUCTIONS_AVAILABLE)) { - prims->RGBToRGB_16s8u_P3AC4R = neon_RGBToRGB_16s8u_P3AC4R; + prims->RGBToRGB_16s8u_P3AC4R = neon_RGBToRGB_16s8u_P3AC4R; prims->yCbCrToRGB_16s8u_P3AC4R = neon_yCbCrToRGB_16s8u_P3AC4R; prims->yCbCrToRGB_16s16s_P3P3 = neon_yCbCrToRGB_16s16s_P3P3; } #endif /* WITH_SSE2 */ } - diff --git a/libfreerdp/primitives/prim_copy.c b/libfreerdp/primitives/prim_copy.c index cdccf4b38..03f1d7c8c 100644 --- a/libfreerdp/primitives/prim_copy.c +++ b/libfreerdp/primitives/prim_copy.c @@ -21,8 +21,8 @@ #include #include #ifdef WITH_IPP -# include -# include +#include +#include #endif /* WITH_IPP */ #include "prim_internal.h" @@ -30,21 +30,20 @@ static primitives_t* generic = NULL; /* ------------------------------------------------------------------------- */ /*static inline BOOL memory_regions_overlap_1d(*/ -static BOOL memory_regions_overlap_1d( - const BYTE* p1, - const BYTE* p2, - size_t bytes) +static BOOL memory_regions_overlap_1d(const BYTE* p1, const BYTE* p2, size_t bytes) { - const ULONG_PTR p1m = (const ULONG_PTR) p1; - const ULONG_PTR p2m = (const ULONG_PTR) p2; + const ULONG_PTR p1m = (const ULONG_PTR)p1; + const ULONG_PTR p2m = (const ULONG_PTR)p2; if (p1m <= p2m) { - if (p1m + bytes > p2m) return TRUE; + if (p1m + bytes > p2m) + return TRUE; } else { - if (p2m + bytes > p1m) return TRUE; + if (p2m + bytes > p1m) + return TRUE; } /* else */ @@ -53,25 +52,25 @@ static BOOL memory_regions_overlap_1d( /* ------------------------------------------------------------------------- */ /*static inline BOOL memory_regions_overlap_2d( */ -static BOOL memory_regions_overlap_2d( - const BYTE* p1, int p1Step, int p1Size, - const BYTE* p2, int p2Step, int p2Size, - int width, int height) +static BOOL memory_regions_overlap_2d(const BYTE* p1, int p1Step, int p1Size, const BYTE* p2, + int p2Step, int p2Size, int width, int height) { - ULONG_PTR p1m = (ULONG_PTR) p1; - ULONG_PTR p2m = (ULONG_PTR) p2; + ULONG_PTR p1m = (ULONG_PTR)p1; + ULONG_PTR p2m = (ULONG_PTR)p2; if (p1m <= p2m) { ULONG_PTR p1mEnd = p1m + (height - 1) * p1Step + width * p1Size; - if (p1mEnd > p2m) return TRUE; + if (p1mEnd > p2m) + return TRUE; } else { ULONG_PTR p2mEnd = p2m + (height - 1) * p2Step + width * p2Size; - if (p2mEnd > p1m) return TRUE; + if (p2mEnd > p1m) + return TRUE; } /* else */ @@ -79,18 +78,15 @@ static BOOL memory_regions_overlap_2d( } /* ------------------------------------------------------------------------- */ -static pstatus_t general_copy_8u( - const BYTE* pSrc, - BYTE* pDst, - INT32 len) +static pstatus_t general_copy_8u(const BYTE* pSrc, BYTE* pDst, INT32 len) { - if (memory_regions_overlap_1d(pSrc, pDst, (size_t) len)) + if (memory_regions_overlap_1d(pSrc, pDst, (size_t)len)) { - memmove((void*) pDst, (const void*) pSrc, (size_t) len); + memmove((void*)pDst, (const void*)pSrc, (size_t)len); } else { - memcpy((void*) pDst, (const void*) pSrc, (size_t) len); + memcpy((void*)pDst, (const void*)pSrc, (size_t)len); } return PRIMITIVES_SUCCESS; @@ -101,27 +97,25 @@ static pstatus_t general_copy_8u( * The addresses are assumed to have been already offset to the upper-left * corners of the source and destination region of interest. */ -static pstatus_t general_copy_8u_AC4r( - const BYTE* pSrc, INT32 srcStep, - BYTE* pDst, INT32 dstStep, - INT32 width, INT32 height) +static pstatus_t general_copy_8u_AC4r(const BYTE* pSrc, INT32 srcStep, BYTE* pDst, INT32 dstStep, + INT32 width, INT32 height) { - const BYTE* src = (const BYTE*) pSrc; - BYTE* dst = (BYTE*) pDst; + const BYTE* src = (const BYTE*)pSrc; + BYTE* dst = (BYTE*)pDst; int rowbytes = width * sizeof(UINT32); - if ((width == 0) || (height == 0)) return PRIMITIVES_SUCCESS; + if ((width == 0) || (height == 0)) + return PRIMITIVES_SUCCESS; - if (memory_regions_overlap_2d(pSrc, srcStep, sizeof(UINT32), - pDst, dstStep, sizeof(UINT32), width, height)) + if (memory_regions_overlap_2d(pSrc, srcStep, sizeof(UINT32), pDst, dstStep, sizeof(UINT32), + width, height)) { do { generic->copy(src, dst, rowbytes); src += srcStep; dst += dstStep; - } - while (--height); + } while (--height); } else { @@ -134,8 +128,7 @@ static pstatus_t general_copy_8u_AC4r( memcpy(dst, src, rowbytes); src += srcStep; dst += dstStep; - } - while (--height); + } while (--height); } return PRIMITIVES_SUCCESS; @@ -144,38 +137,34 @@ static pstatus_t general_copy_8u_AC4r( #ifdef WITH_IPP /* ------------------------------------------------------------------------- */ /* This is just ippiCopy_8u_AC4R without the IppiSize structure parameter. */ -static pstatus_t ippiCopy_8u_AC4r( - const BYTE* pSrc, INT32 srcStep, - BYTE* pDst, INT32 dstStep, - INT32 width, INT32 height) +static pstatus_t ippiCopy_8u_AC4r(const BYTE* pSrc, INT32 srcStep, BYTE* pDst, INT32 dstStep, + INT32 width, INT32 height) { IppiSize roi; - roi.width = width; + roi.width = width; roi.height = height; - return (pstatus_t) ippiCopy_8u_AC4R(pSrc, srcStep, pDst, dstStep, roi); + return (pstatus_t)ippiCopy_8u_AC4R(pSrc, srcStep, pDst, dstStep, roi); } #endif /* WITH_IPP */ /* ------------------------------------------------------------------------- */ -void primitives_init_copy( - primitives_t* prims) +void primitives_init_copy(primitives_t* prims) { /* Start with the default. */ prims->copy_8u = general_copy_8u; prims->copy_8u_AC4r = general_copy_8u_AC4r; /* This is just an alias with void* parameters */ - prims->copy = (__copy_t)(prims->copy_8u); + prims->copy = (__copy_t)(prims->copy_8u); } -void primitives_init_copy_opt( - primitives_t* prims) +void primitives_init_copy_opt(primitives_t* prims) { generic = primitives_get_generic(); primitives_init_copy(prims); /* Pick tuned versions if possible. */ #ifdef WITH_IPP - prims->copy_8u = (__copy_8u_t) ippsCopy_8u; - prims->copy_8u_AC4r = (__copy_8u_AC4r_t) ippiCopy_8u_AC4r; + prims->copy_8u = (__copy_8u_t)ippsCopy_8u; + prims->copy_8u_AC4r = (__copy_8u_AC4r_t)ippiCopy_8u_AC4r; #endif /* Performance with an SSE2 version with no prefetch seemed to be * all over the map vs. memcpy. @@ -185,5 +174,5 @@ void primitives_init_copy_opt( * is consistently faster than memcpy. */ /* This is just an alias with void* parameters */ - prims->copy = (__copy_t)(prims->copy_8u); + prims->copy = (__copy_t)(prims->copy_8u); } diff --git a/libfreerdp/primitives/prim_internal.h b/libfreerdp/primitives/prim_internal.h index b9795716c..ce1e8d197 100644 --- a/libfreerdp/primitives/prim_internal.h +++ b/libfreerdp/primitives/prim_internal.h @@ -24,7 +24,6 @@ #include #include - #ifdef __GNUC__ #define PRIM_ALIGN_128 __attribute__((aligned(16))) #else @@ -39,14 +38,13 @@ #if defined(WITH_SSE2) /* Use lddqu for unaligned; load for 16-byte aligned. */ -#define LOAD_SI128(_ptr_) \ - (((ULONG_PTR) (_ptr_) & 0x0f) \ - ? _mm_lddqu_si128((__m128i *) (_ptr_)) \ - : _mm_load_si128((__m128i *) (_ptr_))) +#define LOAD_SI128(_ptr_) \ + (((ULONG_PTR)(_ptr_)&0x0f) ? _mm_lddqu_si128((__m128i*)(_ptr_)) \ + : _mm_load_si128((__m128i*)(_ptr_))) #endif -static INLINE BYTE* writePixelBGRX(BYTE* dst, DWORD formatSize, UINT32 format, - BYTE R, BYTE G, BYTE B, BYTE A) +static INLINE BYTE* writePixelBGRX(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, + BYTE B, BYTE A) { WINPR_UNUSED(formatSize); WINPR_UNUSED(format); @@ -57,8 +55,8 @@ static INLINE BYTE* writePixelBGRX(BYTE* dst, DWORD formatSize, UINT32 format, return dst; } -static INLINE BYTE* writePixelRGBX(BYTE* dst, DWORD formatSize, UINT32 format, - BYTE R, BYTE G, BYTE B, BYTE A) +static INLINE BYTE* writePixelRGBX(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, + BYTE B, BYTE A) { WINPR_UNUSED(formatSize); WINPR_UNUSED(format); @@ -69,8 +67,8 @@ static INLINE BYTE* writePixelRGBX(BYTE* dst, DWORD formatSize, UINT32 format, return dst; } -static INLINE BYTE* writePixelXBGR(BYTE* dst, DWORD formatSize, UINT32 format, - BYTE R, BYTE G, BYTE B, BYTE A) +static INLINE BYTE* writePixelXBGR(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, + BYTE B, BYTE A) { WINPR_UNUSED(formatSize); WINPR_UNUSED(format); @@ -81,8 +79,8 @@ static INLINE BYTE* writePixelXBGR(BYTE* dst, DWORD formatSize, UINT32 format, return dst; } -static INLINE BYTE* writePixelXRGB(BYTE* dst, DWORD formatSize, UINT32 format, - BYTE R, BYTE G, BYTE B, BYTE A) +static INLINE BYTE* writePixelXRGB(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, + BYTE B, BYTE A) { WINPR_UNUSED(formatSize); WINPR_UNUSED(format); @@ -93,8 +91,8 @@ static INLINE BYTE* writePixelXRGB(BYTE* dst, DWORD formatSize, UINT32 format, return dst; } -static INLINE BYTE* writePixelGeneric(BYTE* dst, DWORD formatSize, UINT32 format, - BYTE R, BYTE G, BYTE B, BYTE A) +static INLINE BYTE* writePixelGeneric(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, + BYTE B, BYTE A) { UINT32 color = FreeRDPGetColor(format, R, G, B, A); WriteColor(dst, format, color); @@ -146,36 +144,36 @@ static INLINE BYTE CLIP(INT32 X) */ static INLINE INT32 C(INT32 Y) { - return (Y) - 0L; + return (Y)-0L; } static INLINE INT32 D(INT32 U) { - return (U) - 128L; + return (U)-128L; } static INLINE INT32 E(INT32 V) { - return (V) - 128L; + return (V)-128L; } static INLINE BYTE YUV2R(INT32 Y, INT32 U, INT32 V) { - const INT32 r = (256L * C(Y) + 0L * D(U) + 403L * E(V)); + const INT32 r = (256L * C(Y) + 0L * D(U) + 403L * E(V)); const INT32 r8 = r >> 8L; return CLIP(r8); } static INLINE BYTE YUV2G(INT32 Y, INT32 U, INT32 V) { - const INT32 g = (256L * C(Y) - 48L * D(U) - 120L * E(V)); + const INT32 g = (256L * C(Y) - 48L * D(U) - 120L * E(V)); const INT32 g8 = g >> 8L; return CLIP(g8); } static INLINE BYTE YUV2B(INT32 Y, INT32 U, INT32 V) { - const INT32 b = (256L * C(Y) + 475L * D(U) + 0L * E(V)); + const INT32 b = (256L * C(Y) + 475L * D(U) + 0L * E(V)); const INT32 b8 = b >> 8L; return CLIP(b8); } diff --git a/libfreerdp/primitives/prim_set.c b/libfreerdp/primitives/prim_set.c index b9e9e0efc..013eceaf5 100644 --- a/libfreerdp/primitives/prim_set.c +++ b/libfreerdp/primitives/prim_set.c @@ -26,37 +26,30 @@ #include "prim_internal.h" /* ========================================================================= */ -static pstatus_t general_set_8u( - BYTE val, - BYTE* pDst, - UINT32 len) +static pstatus_t general_set_8u(BYTE val, BYTE* pDst, UINT32 len) { - memset((void*) pDst, (int) val, (size_t) len); + memset((void*)pDst, (int)val, (size_t)len); return PRIMITIVES_SUCCESS; } /* ------------------------------------------------------------------------- */ -static pstatus_t general_zero( - void* pDst, - size_t len) +static pstatus_t general_zero(void* pDst, size_t len) { memset(pDst, 0, len); return PRIMITIVES_SUCCESS; } /* ========================================================================= */ -static pstatus_t general_set_32s( - INT32 val, - INT32* pDst, - UINT32 len) +static pstatus_t general_set_32s(INT32 val, INT32* pDst, UINT32 len) { - INT32* dptr = (INT32*) pDst; + INT32* dptr = (INT32*)pDst; size_t span, remaining; primitives_t* prims; if (len < 256) { - while (len--) *dptr++ = val; + while (len--) + *dptr++ = val; return PRIMITIVES_SUCCESS; } @@ -71,9 +64,10 @@ static pstatus_t general_set_32s( { size_t thiswidth = span; - if (thiswidth > remaining) thiswidth = remaining; + if (thiswidth > remaining) + thiswidth = remaining; - prims->copy_8u((BYTE*) dptr, (BYTE*)(dptr + span), thiswidth << 2); + prims->copy_8u((BYTE*)dptr, (BYTE*)(dptr + span), thiswidth << 2); remaining -= thiswidth; span <<= 1; } @@ -82,18 +76,16 @@ static pstatus_t general_set_32s( } /* ------------------------------------------------------------------------- */ -static pstatus_t general_set_32u( - UINT32 val, - UINT32* pDst, - UINT32 len) +static pstatus_t general_set_32u(UINT32 val, UINT32* pDst, UINT32 len) { - UINT32* dptr = (UINT32*) pDst; + UINT32* dptr = (UINT32*)pDst; size_t span, remaining; primitives_t* prims; if (len < 256) { - while (len--) *dptr++ = val; + while (len--) + *dptr++ = val; return PRIMITIVES_SUCCESS; } @@ -108,9 +100,10 @@ static pstatus_t general_set_32u( { size_t thiswidth = span; - if (thiswidth > remaining) thiswidth = remaining; + if (thiswidth > remaining) + thiswidth = remaining; - prims->copy_8u((BYTE*) dptr, (BYTE*)(dptr + span), thiswidth << 2); + prims->copy_8u((BYTE*)dptr, (BYTE*)(dptr + span), thiswidth << 2); remaining -= thiswidth; span <<= 1; } @@ -119,13 +112,11 @@ static pstatus_t general_set_32u( } /* ------------------------------------------------------------------------- */ -void primitives_init_set( - primitives_t* prims) +void primitives_init_set(primitives_t* prims) { /* Start with the default. */ - prims->set_8u = general_set_8u; + prims->set_8u = general_set_8u; prims->set_32s = general_set_32s; prims->set_32u = general_set_32u; prims->zero = general_zero; } - diff --git a/libfreerdp/primitives/prim_set_opt.c b/libfreerdp/primitives/prim_set_opt.c index 97b49bceb..cbe074551 100644 --- a/libfreerdp/primitives/prim_set_opt.c +++ b/libfreerdp/primitives/prim_set_opt.c @@ -24,10 +24,10 @@ #include #ifdef WITH_SSE2 -# include +#include #endif /* WITH_SSE2 */ #ifdef WITH_IPP -# include +#include #endif /* WITH_IPP */ #include "prim_internal.h" @@ -36,27 +36,26 @@ static primitives_t* generic = NULL; /* ========================================================================= */ #ifdef WITH_SSE2 -# if !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) -static pstatus_t sse2_set_8u( - BYTE val, - BYTE* pDst, - UINT32 len) +#if !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) +static pstatus_t sse2_set_8u(BYTE val, BYTE* pDst, UINT32 len) { BYTE byte, *dptr; __m128i xmm0; size_t count; - if (len < 16) return generic->set_8u(val, pDst, len); + if (len < 16) + return generic->set_8u(val, pDst, len); - byte = val; - dptr = (BYTE*) pDst; + byte = val; + dptr = (BYTE*)pDst; /* Seek 16-byte alignment. */ - while ((ULONG_PTR) dptr & 0x0f) + while ((ULONG_PTR)dptr & 0x0f) { *dptr++ = byte; - if (--len == 0) return PRIMITIVES_SUCCESS; + if (--len == 0) + return PRIMITIVES_SUCCESS; } xmm0 = _mm_set1_epi8(byte); @@ -67,37 +66,37 @@ static pstatus_t sse2_set_8u( /* Do 256-byte chunks using one XMM register. */ while (count--) { - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 16; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 16; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 16; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 16; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 16; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 16; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 16; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 16; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 16; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 16; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 16; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 16; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 16; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 16; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 16; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 16; } @@ -108,51 +107,51 @@ static pstatus_t sse2_set_8u( /* Do 16-byte chunks using one XMM register. */ while (count--) { - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 16; } /* Do leftover bytes. */ - while (len--) *dptr++ = byte; + while (len--) + *dptr++ = byte; return PRIMITIVES_SUCCESS; } -# endif /* !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) */ +#endif /* !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) */ #endif /* WITH_SSE2 */ /* ------------------------------------------------------------------------- */ #ifdef WITH_SSE2 -# if !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) -static pstatus_t sse2_set_32u( - UINT32 val, - UINT32* pDst, - UINT32 len) +#if !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) +static pstatus_t sse2_set_32u(UINT32 val, UINT32* pDst, UINT32 len) { const primitives_t* prim = primitives_get_generic(); - UINT32* dptr = (UINT32*) pDst; + UINT32* dptr = (UINT32*)pDst; __m128i xmm0; size_t count; /* If really short, just do it here. */ if (len < 32) { - while (len--) *dptr++ = val; + while (len--) + *dptr++ = val; return PRIMITIVES_SUCCESS; } /* Assure we can reach 16-byte alignment. */ - if (((ULONG_PTR) dptr & 0x03) != 0) + if (((ULONG_PTR)dptr & 0x03) != 0) { return prim->set_32u(val, pDst, len); } /* Seek 16-byte alignment. */ - while ((ULONG_PTR) dptr & 0x0f) + while ((ULONG_PTR)dptr & 0x0f) { *dptr++ = val; - if (--len == 0) return PRIMITIVES_SUCCESS; + if (--len == 0) + return PRIMITIVES_SUCCESS; } xmm0 = _mm_set1_epi32(val); @@ -163,37 +162,37 @@ static pstatus_t sse2_set_32u( /* Do 256-byte chunks using one XMM register. */ while (count--) { - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 4; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 4; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 4; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 4; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 4; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 4; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 4; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 4; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 4; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 4; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 4; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 4; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 4; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 4; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 4; - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 4; } @@ -204,38 +203,33 @@ static pstatus_t sse2_set_32u( /* Do 16-byte chunks using one XMM register. */ while (count--) { - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 4; } /* Do leftover bytes. */ - while (len--) *dptr++ = val; + while (len--) + *dptr++ = val; return PRIMITIVES_SUCCESS; } /* ------------------------------------------------------------------------- */ -static pstatus_t sse2_set_32s( - INT32 val, - INT32* pDst, - UINT32 len) +static pstatus_t sse2_set_32s(INT32 val, INT32* pDst, UINT32 len) { - UINT32 uval = *((UINT32*) &val); - return sse2_set_32u(uval, (UINT32*) pDst, len); + UINT32 uval = *((UINT32*)&val); + return sse2_set_32u(uval, (UINT32*)pDst, len); } -# endif /* !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) */ +#endif /* !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) */ #endif /* WITH_SSE2 */ #ifdef WITH_IPP /* ------------------------------------------------------------------------- */ -static pstatus_t ipp_wrapper_set_32u( - UINT32 val, - UINT32* pDst, - INT32 len) +static pstatus_t ipp_wrapper_set_32u(UINT32 val, UINT32* pDst, INT32 len) { /* A little type conversion, then use the signed version. */ - INT32 sval = *((INT32*) &val); - return ippsSet_32s(sval, (INT32*) pDst, len); + INT32 sval = *((INT32*)&val); + return ippsSet_32s(sval, (INT32*)pDst, len); } #endif @@ -246,19 +240,18 @@ void primitives_init_set_opt(primitives_t* prims) primitives_init_set(prims); /* Pick tuned versions if possible. */ #ifdef WITH_IPP - prims->set_8u = (__set_8u_t) ippsSet_8u; - prims->set_32s = (__set_32s_t) ippsSet_32s; - prims->set_32u = (__set_32u_t) ipp_wrapper_set_32u; - prims->zero = (__zero_t) ippsZero_8u; + prims->set_8u = (__set_8u_t)ippsSet_8u; + prims->set_32s = (__set_32s_t)ippsSet_32s; + prims->set_32u = (__set_32u_t)ipp_wrapper_set_32u; + prims->zero = (__zero_t)ippsZero_8u; #elif defined(WITH_SSE2) if (IsProcessorFeaturePresent(PF_SSE2_INSTRUCTIONS_AVAILABLE)) { - prims->set_8u = sse2_set_8u; + prims->set_8u = sse2_set_8u; prims->set_32s = sse2_set_32s; prims->set_32u = sse2_set_32u; } #endif } - diff --git a/libfreerdp/primitives/prim_shift.c b/libfreerdp/primitives/prim_shift.c index f8d5cb852..3fabfe26e 100644 --- a/libfreerdp/primitives/prim_shift.c +++ b/libfreerdp/primitives/prim_shift.c @@ -22,90 +22,81 @@ #include "prim_internal.h" /* ------------------------------------------------------------------------- */ -static INLINE pstatus_t general_lShiftC_16s( - const INT16* pSrc, - UINT32 val, - INT16* pDst, - UINT32 len) +static INLINE pstatus_t general_lShiftC_16s(const INT16* pSrc, UINT32 val, INT16* pDst, UINT32 len) { - if (val == 0) return PRIMITIVES_SUCCESS; + if (val == 0) + return PRIMITIVES_SUCCESS; - while (len--) *pDst++ = *pSrc++ << val; + while (len--) + *pDst++ = *pSrc++ << val; return PRIMITIVES_SUCCESS; } /* ------------------------------------------------------------------------- */ -static INLINE pstatus_t general_rShiftC_16s( - const INT16* pSrc, - UINT32 val, - INT16* pDst, - UINT32 len) +static INLINE pstatus_t general_rShiftC_16s(const INT16* pSrc, UINT32 val, INT16* pDst, UINT32 len) { - if (val == 0) return PRIMITIVES_SUCCESS; + if (val == 0) + return PRIMITIVES_SUCCESS; - while (len--) *pDst++ = *pSrc++ >> val; + while (len--) + *pDst++ = *pSrc++ >> val; return PRIMITIVES_SUCCESS; } /* ------------------------------------------------------------------------- */ -static INLINE pstatus_t general_lShiftC_16u( - const UINT16* pSrc, - UINT32 val, - UINT16* pDst, - UINT32 len) +static INLINE pstatus_t general_lShiftC_16u(const UINT16* pSrc, UINT32 val, UINT16* pDst, + UINT32 len) { - if (val == 0) return PRIMITIVES_SUCCESS; + if (val == 0) + return PRIMITIVES_SUCCESS; - while (len--) *pDst++ = *pSrc++ << val; + while (len--) + *pDst++ = *pSrc++ << val; return PRIMITIVES_SUCCESS; } /* ------------------------------------------------------------------------- */ -static INLINE pstatus_t general_rShiftC_16u( - const UINT16* pSrc, - UINT32 val, - UINT16* pDst, - UINT32 len) +static INLINE pstatus_t general_rShiftC_16u(const UINT16* pSrc, UINT32 val, UINT16* pDst, + UINT32 len) { - if (val == 0) return PRIMITIVES_SUCCESS; + if (val == 0) + return PRIMITIVES_SUCCESS; - while (len--) *pDst++ = *pSrc++ >> val; + while (len--) + *pDst++ = *pSrc++ >> val; return PRIMITIVES_SUCCESS; } /* ------------------------------------------------------------------------- */ -static INLINE pstatus_t general_shiftC_16s( - const INT16* pSrc, - INT32 val, - INT16* pDst, - UINT32 len) +static INLINE pstatus_t general_shiftC_16s(const INT16* pSrc, INT32 val, INT16* pDst, UINT32 len) { - if (val == 0) return PRIMITIVES_SUCCESS; + if (val == 0) + return PRIMITIVES_SUCCESS; - if (val < 0) return general_rShiftC_16s(pSrc, -val, pDst, len); - else return general_lShiftC_16s(pSrc, val, pDst, len); + if (val < 0) + return general_rShiftC_16s(pSrc, -val, pDst, len); + else + return general_lShiftC_16s(pSrc, val, pDst, len); } /* ------------------------------------------------------------------------- */ -static INLINE pstatus_t general_shiftC_16u( - const UINT16* pSrc, - INT32 val, - UINT16* pDst, - UINT32 len) +static INLINE pstatus_t general_shiftC_16u(const UINT16* pSrc, INT32 val, UINT16* pDst, UINT32 len) { - if (val == 0) return PRIMITIVES_SUCCESS; + if (val == 0) + return PRIMITIVES_SUCCESS; - if (val < 0) return general_rShiftC_16u(pSrc, -val, pDst, len); - else return general_lShiftC_16u(pSrc, val, pDst, len); + if (val < 0) + return general_rShiftC_16u(pSrc, -val, pDst, len); + else + return general_lShiftC_16u(pSrc, val, pDst, len); } /* ------------------------------------------------------------------------- */ -void primitives_init_shift( - primitives_t* prims) +void primitives_init_shift(primitives_t* prims) { /* Start with the default. */ prims->lShiftC_16s = general_lShiftC_16s; @@ -113,6 +104,6 @@ void primitives_init_shift( prims->lShiftC_16u = general_lShiftC_16u; prims->rShiftC_16u = general_rShiftC_16u; /* Wrappers */ - prims->shiftC_16s = general_shiftC_16s; - prims->shiftC_16u = general_shiftC_16u; + prims->shiftC_16s = general_shiftC_16s; + prims->shiftC_16u = general_shiftC_16u; } diff --git a/libfreerdp/primitives/prim_shift_opt.c b/libfreerdp/primitives/prim_shift_opt.c index 617330f71..481363a1b 100644 --- a/libfreerdp/primitives/prim_shift_opt.c +++ b/libfreerdp/primitives/prim_shift_opt.c @@ -36,23 +36,22 @@ static primitives_t* generic = NULL; #ifdef WITH_SSE2 -# if !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) +#if !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) /* ------------------------------------------------------------------------- */ -SSE3_SCD_ROUTINE(sse2_lShiftC_16s, INT16, generic->lShiftC_16s, - _mm_slli_epi16, *dptr++ = *sptr++ << val) +SSE3_SCD_ROUTINE(sse2_lShiftC_16s, INT16, generic->lShiftC_16s, _mm_slli_epi16, + *dptr++ = *sptr++ << val) /* ------------------------------------------------------------------------- */ -SSE3_SCD_ROUTINE(sse2_rShiftC_16s, INT16, generic->rShiftC_16s, - _mm_srai_epi16, *dptr++ = *sptr++ >> val) +SSE3_SCD_ROUTINE(sse2_rShiftC_16s, INT16, generic->rShiftC_16s, _mm_srai_epi16, + *dptr++ = *sptr++ >> val) /* ------------------------------------------------------------------------- */ -SSE3_SCD_ROUTINE(sse2_lShiftC_16u, UINT16, generic->lShiftC_16u, - _mm_slli_epi16, *dptr++ = *sptr++ << val) +SSE3_SCD_ROUTINE(sse2_lShiftC_16u, UINT16, generic->lShiftC_16u, _mm_slli_epi16, + *dptr++ = *sptr++ << val) /* ------------------------------------------------------------------------- */ -SSE3_SCD_ROUTINE(sse2_rShiftC_16u, UINT16, generic->rShiftC_16u, - _mm_srli_epi16, *dptr++ = *sptr++ >> val) -# endif /* !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) */ +SSE3_SCD_ROUTINE(sse2_rShiftC_16u, UINT16, generic->rShiftC_16u, _mm_srli_epi16, + *dptr++ = *sptr++ >> val) +#endif /* !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) */ #endif - /* Note: the IPP version will have to call ippLShiftC_16s or ippRShiftC_16s * depending on the sign of val. To avoid using the deprecated inplace * routines, a wrapper can use the src for the dest. @@ -64,14 +63,14 @@ void primitives_init_shift_opt(primitives_t* prims) generic = primitives_get_generic(); primitives_init_shift(prims); #if defined(WITH_IPP) - prims->lShiftC_16s = (__lShiftC_16s_t) ippsLShiftC_16s; - prims->rShiftC_16s = (__rShiftC_16s_t) ippsRShiftC_16s; - prims->lShiftC_16u = (__lShiftC_16u_t) ippsLShiftC_16u; - prims->rShiftC_16u = (__rShiftC_16u_t) ippsRShiftC_16u; + prims->lShiftC_16s = (__lShiftC_16s_t)ippsLShiftC_16s; + prims->rShiftC_16s = (__rShiftC_16s_t)ippsRShiftC_16s; + prims->lShiftC_16u = (__lShiftC_16u_t)ippsLShiftC_16u; + prims->rShiftC_16u = (__rShiftC_16u_t)ippsRShiftC_16u; #elif defined(WITH_SSE2) - if (IsProcessorFeaturePresent(PF_SSE2_INSTRUCTIONS_AVAILABLE) - && IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE)) + if (IsProcessorFeaturePresent(PF_SSE2_INSTRUCTIONS_AVAILABLE) && + IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE)) { prims->lShiftC_16s = sse2_lShiftC_16s; prims->rShiftC_16s = sse2_rShiftC_16s; @@ -81,4 +80,3 @@ void primitives_init_shift_opt(primitives_t* prims) #endif } - diff --git a/libfreerdp/primitives/prim_sign.c b/libfreerdp/primitives/prim_sign.c index 26cf7c2b1..84d72db88 100644 --- a/libfreerdp/primitives/prim_sign.c +++ b/libfreerdp/primitives/prim_sign.c @@ -25,10 +25,7 @@ /* ---------------------------------------------------------------------------- * Set pDst to the sign-value of the 16-bit values in pSrc (-1, 0, or 1). */ -static pstatus_t general_sign_16s( - const INT16* pSrc, - INT16* pDst, - UINT32 len) +static pstatus_t general_sign_16s(const INT16* pSrc, INT16* pDst, UINT32 len) { while (len--) { @@ -40,8 +37,7 @@ static pstatus_t general_sign_16s( } /* ------------------------------------------------------------------------- */ -void primitives_init_sign( - primitives_t* prims) +void primitives_init_sign(primitives_t* prims) { /* Start with the default. */ prims->sign_16s = general_sign_16s; diff --git a/libfreerdp/primitives/prim_sign_opt.c b/libfreerdp/primitives/prim_sign_opt.c index 4f01e97f9..47dad9b51 100644 --- a/libfreerdp/primitives/prim_sign_opt.c +++ b/libfreerdp/primitives/prim_sign_opt.c @@ -32,13 +32,10 @@ static primitives_t* generic = NULL; #ifdef WITH_SSE2 /* ------------------------------------------------------------------------- */ -static pstatus_t ssse3_sign_16s( - const INT16* pSrc, - INT16* pDst, - UINT32 len) +static pstatus_t ssse3_sign_16s(const INT16* pSrc, INT16* pDst, UINT32 len) { - const INT16* sptr = (const INT16*) pSrc; - INT16* dptr = (INT16*) pDst; + const INT16* sptr = (const INT16*)pSrc; + INT16* dptr = (INT16*)pDst; size_t count; if (len < 16) @@ -47,25 +44,26 @@ static pstatus_t ssse3_sign_16s( } /* Check for 16-byte alignment (eventually). */ - if ((ULONG_PTR) pDst & 0x01) + if ((ULONG_PTR)pDst & 0x01) { return generic->sign_16s(pSrc, pDst, len); } /* Seek 16-byte alignment. */ - while ((ULONG_PTR) dptr & 0x0f) + while ((ULONG_PTR)dptr & 0x0f) { INT16 src = *sptr++; *dptr++ = (src < 0) ? (-1) : ((src > 0) ? 1 : 0); - if (--len == 0) return PRIMITIVES_SUCCESS; + if (--len == 0) + return PRIMITIVES_SUCCESS; } /* Do 32-short chunks using 8 XMM registers. */ - count = len >> 5; /* / 32 */ - len -= count << 5; /* * 32 */ + count = len >> 5; /* / 32 */ + len -= count << 5; /* * 32 */ - if ((ULONG_PTR) sptr & 0x0f) + if ((ULONG_PTR)sptr & 0x0f) { /* Unaligned */ while (count--) @@ -75,25 +73,25 @@ static pstatus_t ssse3_sign_16s( xmm1 = _mm_set1_epi16(0x0001U); xmm2 = _mm_set1_epi16(0x0001U); xmm3 = _mm_set1_epi16(0x0001U); - xmm4 = _mm_lddqu_si128((__m128i*) sptr); + xmm4 = _mm_lddqu_si128((__m128i*)sptr); sptr += 8; - xmm5 = _mm_lddqu_si128((__m128i*) sptr); + xmm5 = _mm_lddqu_si128((__m128i*)sptr); sptr += 8; - xmm6 = _mm_lddqu_si128((__m128i*) sptr); + xmm6 = _mm_lddqu_si128((__m128i*)sptr); sptr += 8; - xmm7 = _mm_lddqu_si128((__m128i*) sptr); + xmm7 = _mm_lddqu_si128((__m128i*)sptr); sptr += 8; xmm0 = _mm_sign_epi16(xmm0, xmm4); xmm1 = _mm_sign_epi16(xmm1, xmm5); xmm2 = _mm_sign_epi16(xmm2, xmm6); xmm3 = _mm_sign_epi16(xmm3, xmm7); - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 8; - _mm_store_si128((__m128i*) dptr, xmm1); + _mm_store_si128((__m128i*)dptr, xmm1); dptr += 8; - _mm_store_si128((__m128i*) dptr, xmm2); + _mm_store_si128((__m128i*)dptr, xmm2); dptr += 8; - _mm_store_si128((__m128i*) dptr, xmm3); + _mm_store_si128((__m128i*)dptr, xmm3); dptr += 8; } } @@ -107,25 +105,25 @@ static pstatus_t ssse3_sign_16s( xmm1 = _mm_set1_epi16(0x0001U); xmm2 = _mm_set1_epi16(0x0001U); xmm3 = _mm_set1_epi16(0x0001U); - xmm4 = _mm_load_si128((__m128i*) sptr); + xmm4 = _mm_load_si128((__m128i*)sptr); sptr += 8; - xmm5 = _mm_load_si128((__m128i*) sptr); + xmm5 = _mm_load_si128((__m128i*)sptr); sptr += 8; - xmm6 = _mm_load_si128((__m128i*) sptr); + xmm6 = _mm_load_si128((__m128i*)sptr); sptr += 8; - xmm7 = _mm_load_si128((__m128i*) sptr); + xmm7 = _mm_load_si128((__m128i*)sptr); sptr += 8; xmm0 = _mm_sign_epi16(xmm0, xmm4); xmm1 = _mm_sign_epi16(xmm1, xmm5); xmm2 = _mm_sign_epi16(xmm2, xmm6); xmm3 = _mm_sign_epi16(xmm3, xmm7); - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 8; - _mm_store_si128((__m128i*) dptr, xmm1); + _mm_store_si128((__m128i*)dptr, xmm1); dptr += 8; - _mm_store_si128((__m128i*) dptr, xmm2); + _mm_store_si128((__m128i*)dptr, xmm2); dptr += 8; - _mm_store_si128((__m128i*) dptr, xmm3); + _mm_store_si128((__m128i*)dptr, xmm3); dptr += 8; } } @@ -140,7 +138,7 @@ static pstatus_t ssse3_sign_16s( __m128i xmm1 = LOAD_SI128(sptr); sptr += 8; xmm0 = _mm_sign_epi16(xmm0, xmm1); - _mm_store_si128((__m128i*) dptr, xmm0); + _mm_store_si128((__m128i*)dptr, xmm0); dptr += 8; } @@ -164,12 +162,11 @@ void primitives_init_sign_opt(primitives_t* prims) /* I didn't spot an IPP version of this. */ #if defined(WITH_SSE2) - if (IsProcessorFeaturePresentEx(PF_EX_SSSE3) - && IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE)) + if (IsProcessorFeaturePresentEx(PF_EX_SSSE3) && + IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE)) { - prims->sign_16s = ssse3_sign_16s; + prims->sign_16s = ssse3_sign_16s; } #endif } - diff --git a/libfreerdp/primitives/prim_templates.h b/libfreerdp/primitives/prim_templates.h index b68c67049..4333a1e78 100644 --- a/libfreerdp/primitives/prim_templates.h +++ b/libfreerdp/primitives/prim_templates.h @@ -14,7 +14,7 @@ */ #ifdef __GNUC__ -# pragma once +#pragma once #endif #ifndef FREERDP_LIB_PRIM_TEMPLATES_H @@ -43,376 +43,405 @@ /* ---------------------------------------------------------------------------- * SCD = Source, Constant, Destination */ -#define SSE3_SCD_ROUTINE(_name_, _type_, _fallback_, _op_, _slowWay_) \ - static pstatus_t _name_(const _type_ *pSrc, UINT32 val, _type_ *pDst, UINT32 len) \ - { \ - INT32 shifts = 0; \ - UINT32 offBeatMask; \ - const _type_ *sptr = pSrc; \ - _type_ *dptr = pDst; \ - size_t count; \ - if (len < 16) /* pointless if too small */ \ - { \ - return _fallback_(pSrc, val, pDst, len); \ - } \ - if (sizeof(_type_) == 1) shifts = 1; \ - else if (sizeof(_type_) == 2) shifts = 2; \ - else if (sizeof(_type_) == 4) shifts = 3; \ - else if (sizeof(_type_) == 8) shifts = 4; \ - offBeatMask = (1 << (shifts - 1)) - 1; \ - if ((ULONG_PTR) pDst & offBeatMask) \ - { \ - /* Incrementing the pointer skips over 16-byte boundary. */ \ - return _fallback_(pSrc, val, pDst, len); \ - } \ - /* Get to the 16-byte boundary now. */ \ - while ((ULONG_PTR) dptr & 0x0f) \ - { \ - _slowWay_; \ - if (--len == 0) return PRIMITIVES_SUCCESS; \ - } \ - /* Use 8 128-bit SSE registers. */ \ - count = len >> (8-shifts); \ - len -= count << (8-shifts); \ - if ((ULONG_PTR) sptr & 0x0f) \ - { \ - while (count--) \ - { \ - __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; \ - xmm0 = _mm_lddqu_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm1 = _mm_lddqu_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm2 = _mm_lddqu_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm3 = _mm_lddqu_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm4 = _mm_lddqu_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm5 = _mm_lddqu_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm6 = _mm_lddqu_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm7 = _mm_lddqu_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm0 = _op_(xmm0, val); \ - xmm1 = _op_(xmm1, val); \ - xmm2 = _op_(xmm2, val); \ - xmm3 = _op_(xmm3, val); \ - xmm4 = _op_(xmm4, val); \ - xmm5 = _op_(xmm5, val); \ - xmm6 = _op_(xmm6, val); \ - xmm7 = _op_(xmm7, val); \ - _mm_store_si128((__m128i *) dptr, xmm0); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm1); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm2); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm3); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm4); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm5); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm6); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm7); \ - dptr += (16/sizeof(_type_)); \ - } \ - } \ - else \ - { \ - while (count--) \ - { \ - __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; \ - xmm0 = _mm_load_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm1 = _mm_load_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm2 = _mm_load_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm3 = _mm_load_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm4 = _mm_load_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm5 = _mm_load_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm6 = _mm_load_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm7 = _mm_load_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm0 = _op_(xmm0, val); \ - xmm1 = _op_(xmm1, val); \ - xmm2 = _op_(xmm2, val); \ - xmm3 = _op_(xmm3, val); \ - xmm4 = _op_(xmm4, val); \ - xmm5 = _op_(xmm5, val); \ - xmm6 = _op_(xmm6, val); \ - xmm7 = _op_(xmm7, val); \ - _mm_store_si128((__m128i *) dptr, xmm0); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm1); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm2); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm3); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm4); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm5); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm6); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm7); \ - dptr += (16/sizeof(_type_)); \ - } \ - } \ - /* Use a single 128-bit SSE register. */ \ - count = len >> (5-shifts); \ - len -= count << (5-shifts); \ - while (count--) \ - { \ - __m128i xmm0 = LOAD_SI128(sptr); sptr += (16/sizeof(_type_)); \ - xmm0 = _op_(xmm0, val); \ - _mm_store_si128((__m128i *) dptr, xmm0); \ - dptr += (16/sizeof(_type_)); \ - } \ - /* Finish off the remainder. */ \ - while (len--) { _slowWay_; } \ - return PRIMITIVES_SUCCESS; \ +#define SSE3_SCD_ROUTINE(_name_, _type_, _fallback_, _op_, _slowWay_) \ + static pstatus_t _name_(const _type_* pSrc, UINT32 val, _type_* pDst, UINT32 len) \ + { \ + INT32 shifts = 0; \ + UINT32 offBeatMask; \ + const _type_* sptr = pSrc; \ + _type_* dptr = pDst; \ + size_t count; \ + if (len < 16) /* pointless if too small */ \ + { \ + return _fallback_(pSrc, val, pDst, len); \ + } \ + if (sizeof(_type_) == 1) \ + shifts = 1; \ + else if (sizeof(_type_) == 2) \ + shifts = 2; \ + else if (sizeof(_type_) == 4) \ + shifts = 3; \ + else if (sizeof(_type_) == 8) \ + shifts = 4; \ + offBeatMask = (1 << (shifts - 1)) - 1; \ + if ((ULONG_PTR)pDst & offBeatMask) \ + { \ + /* Incrementing the pointer skips over 16-byte boundary. */ \ + return _fallback_(pSrc, val, pDst, len); \ + } \ + /* Get to the 16-byte boundary now. */ \ + while ((ULONG_PTR)dptr & 0x0f) \ + { \ + _slowWay_; \ + if (--len == 0) \ + return PRIMITIVES_SUCCESS; \ + } \ + /* Use 8 128-bit SSE registers. */ \ + count = len >> (8 - shifts); \ + len -= count << (8 - shifts); \ + if ((ULONG_PTR)sptr & 0x0f) \ + { \ + while (count--) \ + { \ + __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; \ + xmm0 = _mm_lddqu_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm1 = _mm_lddqu_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm2 = _mm_lddqu_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm3 = _mm_lddqu_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm4 = _mm_lddqu_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm5 = _mm_lddqu_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm6 = _mm_lddqu_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm7 = _mm_lddqu_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm0 = _op_(xmm0, val); \ + xmm1 = _op_(xmm1, val); \ + xmm2 = _op_(xmm2, val); \ + xmm3 = _op_(xmm3, val); \ + xmm4 = _op_(xmm4, val); \ + xmm5 = _op_(xmm5, val); \ + xmm6 = _op_(xmm6, val); \ + xmm7 = _op_(xmm7, val); \ + _mm_store_si128((__m128i*)dptr, xmm0); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm1); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm2); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm3); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm4); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm5); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm6); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm7); \ + dptr += (16 / sizeof(_type_)); \ + } \ + } \ + else \ + { \ + while (count--) \ + { \ + __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; \ + xmm0 = _mm_load_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm1 = _mm_load_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm2 = _mm_load_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm3 = _mm_load_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm4 = _mm_load_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm5 = _mm_load_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm6 = _mm_load_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm7 = _mm_load_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm0 = _op_(xmm0, val); \ + xmm1 = _op_(xmm1, val); \ + xmm2 = _op_(xmm2, val); \ + xmm3 = _op_(xmm3, val); \ + xmm4 = _op_(xmm4, val); \ + xmm5 = _op_(xmm5, val); \ + xmm6 = _op_(xmm6, val); \ + xmm7 = _op_(xmm7, val); \ + _mm_store_si128((__m128i*)dptr, xmm0); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm1); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm2); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm3); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm4); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm5); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm6); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm7); \ + dptr += (16 / sizeof(_type_)); \ + } \ + } \ + /* Use a single 128-bit SSE register. */ \ + count = len >> (5 - shifts); \ + len -= count << (5 - shifts); \ + while (count--) \ + { \ + __m128i xmm0 = LOAD_SI128(sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm0 = _op_(xmm0, val); \ + _mm_store_si128((__m128i*)dptr, xmm0); \ + dptr += (16 / sizeof(_type_)); \ + } \ + /* Finish off the remainder. */ \ + while (len--) \ + { \ + _slowWay_; \ + } \ + return PRIMITIVES_SUCCESS; \ } /* ---------------------------------------------------------------------------- * SCD = Source, Constant, Destination * PRE = preload xmm0 with the constant. */ -#define SSE3_SCD_PRE_ROUTINE(_name_, _type_, _fallback_, _op_, _slowWay_) \ - pstatus_t _name_(const _type_ *pSrc, _type_ val, _type_ *pDst, INT32 len) \ - { \ - int shifts = 0; \ - UINT32 offBeatMask; \ - const _type_ *sptr = pSrc; \ - _type_ *dptr = pDst; \ - size_t count; \ - __m128i xmm0; \ - if (len < 16) /* pointless if too small */ \ - { \ - return _fallback_(pSrc, val, pDst, len); \ - } \ - if (sizeof(_type_) == 1) shifts = 1; \ - else if (sizeof(_type_) == 2) shifts = 2; \ - else if (sizeof(_type_) == 4) shifts = 3; \ - else if (sizeof(_type_) == 8) shifts = 4; \ - offBeatMask = (1 << (shifts - 1)) - 1; \ - if ((ULONG_PTR) pDst & offBeatMask) \ - { \ - /* Incrementing the pointer skips over 16-byte boundary. */ \ - return _fallback_(pSrc, val, pDst, len); \ - } \ - /* Get to the 16-byte boundary now. */ \ - while ((ULONG_PTR) dptr & 0x0f) \ - { \ - _slowWay_; \ - if (--len == 0) return PRIMITIVES_SUCCESS; \ - } \ - /* Use 4 128-bit SSE registers. */ \ - count = len >> (7-shifts); \ - len -= count << (7-shifts); \ - xmm0 = _mm_set1_epi32(val); \ - if ((ULONG_PTR) sptr & 0x0f) \ - { \ - while (count--) \ - { \ - __m128i xmm1, xmm2, xmm3, xmm4; \ - xmm1 = _mm_lddqu_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm2 = _mm_lddqu_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm3 = _mm_lddqu_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm4 = _mm_lddqu_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm1 = _op_(xmm1, xmm0); \ - xmm2 = _op_(xmm2, xmm0); \ - xmm3 = _op_(xmm3, xmm0); \ - xmm4 = _op_(xmm4, xmm0); \ - _mm_store_si128((__m128i *) dptr, xmm1); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm2); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm3); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm4); \ - dptr += (16/sizeof(_type_)); \ - } \ - } \ - else \ - { \ - while (count--) \ - { \ - __m128i xmm1, xmm2, xmm3, xmm4; \ - xmm1 = _mm_load_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm2 = _mm_load_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm3 = _mm_load_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm4 = _mm_load_si128((__m128i *) sptr); \ - sptr += (16/sizeof(_type_)); \ - xmm1 = _op_(xmm1, xmm0); \ - xmm2 = _op_(xmm2, xmm0); \ - xmm3 = _op_(xmm3, xmm0); \ - xmm4 = _op_(xmm4, xmm0); \ - _mm_store_si128((__m128i *) dptr, xmm1); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm2); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm3); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm4); \ - dptr += (16/sizeof(_type_)); \ - } \ - } \ - /* Use a single 128-bit SSE register. */ \ - count = len >> (5-shifts); \ - len -= count << (5-shifts); \ - while (count--) \ - { \ - __m128i xmm1 = LOAD_SI128(sptr); sptr += (16/sizeof(_type_)); \ - xmm1 = _op_(xmm1, xmm0); \ - _mm_store_si128((__m128i *) dptr, xmm1); \ - dptr += (16/sizeof(_type_)); \ - } \ - /* Finish off the remainder. */ \ - while (len--) { _slowWay_; } \ - return PRIMITIVES_SUCCESS; \ +#define SSE3_SCD_PRE_ROUTINE(_name_, _type_, _fallback_, _op_, _slowWay_) \ + pstatus_t _name_(const _type_* pSrc, _type_ val, _type_* pDst, INT32 len) \ + { \ + int shifts = 0; \ + UINT32 offBeatMask; \ + const _type_* sptr = pSrc; \ + _type_* dptr = pDst; \ + size_t count; \ + __m128i xmm0; \ + if (len < 16) /* pointless if too small */ \ + { \ + return _fallback_(pSrc, val, pDst, len); \ + } \ + if (sizeof(_type_) == 1) \ + shifts = 1; \ + else if (sizeof(_type_) == 2) \ + shifts = 2; \ + else if (sizeof(_type_) == 4) \ + shifts = 3; \ + else if (sizeof(_type_) == 8) \ + shifts = 4; \ + offBeatMask = (1 << (shifts - 1)) - 1; \ + if ((ULONG_PTR)pDst & offBeatMask) \ + { \ + /* Incrementing the pointer skips over 16-byte boundary. */ \ + return _fallback_(pSrc, val, pDst, len); \ + } \ + /* Get to the 16-byte boundary now. */ \ + while ((ULONG_PTR)dptr & 0x0f) \ + { \ + _slowWay_; \ + if (--len == 0) \ + return PRIMITIVES_SUCCESS; \ + } \ + /* Use 4 128-bit SSE registers. */ \ + count = len >> (7 - shifts); \ + len -= count << (7 - shifts); \ + xmm0 = _mm_set1_epi32(val); \ + if ((ULONG_PTR)sptr & 0x0f) \ + { \ + while (count--) \ + { \ + __m128i xmm1, xmm2, xmm3, xmm4; \ + xmm1 = _mm_lddqu_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm2 = _mm_lddqu_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm3 = _mm_lddqu_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm4 = _mm_lddqu_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm1 = _op_(xmm1, xmm0); \ + xmm2 = _op_(xmm2, xmm0); \ + xmm3 = _op_(xmm3, xmm0); \ + xmm4 = _op_(xmm4, xmm0); \ + _mm_store_si128((__m128i*)dptr, xmm1); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm2); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm3); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm4); \ + dptr += (16 / sizeof(_type_)); \ + } \ + } \ + else \ + { \ + while (count--) \ + { \ + __m128i xmm1, xmm2, xmm3, xmm4; \ + xmm1 = _mm_load_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm2 = _mm_load_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm3 = _mm_load_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm4 = _mm_load_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm1 = _op_(xmm1, xmm0); \ + xmm2 = _op_(xmm2, xmm0); \ + xmm3 = _op_(xmm3, xmm0); \ + xmm4 = _op_(xmm4, xmm0); \ + _mm_store_si128((__m128i*)dptr, xmm1); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm2); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm3); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm4); \ + dptr += (16 / sizeof(_type_)); \ + } \ + } \ + /* Use a single 128-bit SSE register. */ \ + count = len >> (5 - shifts); \ + len -= count << (5 - shifts); \ + while (count--) \ + { \ + __m128i xmm1 = LOAD_SI128(sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm1 = _op_(xmm1, xmm0); \ + _mm_store_si128((__m128i*)dptr, xmm1); \ + dptr += (16 / sizeof(_type_)); \ + } \ + /* Finish off the remainder. */ \ + while (len--) \ + { \ + _slowWay_; \ + } \ + return PRIMITIVES_SUCCESS; \ } /* ---------------------------------------------------------------------------- * SSD = Source1, Source2, Destination */ -#define SSE3_SSD_ROUTINE(_name_, _type_, _fallback_, _op_, _slowWay_) \ - pstatus_t _name_(const _type_ *pSrc1, const _type_ *pSrc2, _type_ *pDst, UINT32 len) \ - { \ - int shifts = 0; \ - UINT32 offBeatMask; \ - const _type_ *sptr1 = pSrc1; \ - const _type_ *sptr2 = pSrc2; \ - _type_ *dptr = pDst; \ - size_t count; \ - if (len < 16) /* pointless if too small */ \ - { \ - return _fallback_(pSrc1, pSrc2, pDst, len); \ - } \ - if (sizeof(_type_) == 1) shifts = 1; \ - else if (sizeof(_type_) == 2) shifts = 2; \ - else if (sizeof(_type_) == 4) shifts = 3; \ - else if (sizeof(_type_) == 8) shifts = 4; \ - offBeatMask = (1 << (shifts - 1)) - 1; \ - if ((ULONG_PTR) pDst & offBeatMask) \ - { \ - /* Incrementing the pointer skips over 16-byte boundary. */ \ - return _fallback_(pSrc1, pSrc2, pDst, len); \ - } \ - /* Get to the 16-byte boundary now. */ \ - while ((ULONG_PTR) dptr & 0x0f) \ - { \ - pstatus_t status; \ - status = _slowWay_; \ - if (status != PRIMITIVES_SUCCESS) return status; \ - if (--len == 0) return PRIMITIVES_SUCCESS; \ - } \ - /* Use 4 128-bit SSE registers. */ \ - count = len >> (7-shifts); \ - len -= count << (7-shifts); \ - if (((ULONG_PTR) sptr1 & 0x0f) || ((ULONG_PTR) sptr2 & 0x0f)) \ - { \ - /* Unaligned loads */ \ - while (count--) \ - { \ - __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; \ - xmm0 = _mm_lddqu_si128((__m128i *) sptr1); \ - sptr1 += (16/sizeof(_type_)); \ - xmm1 = _mm_lddqu_si128((__m128i *) sptr1); \ - sptr1 += (16/sizeof(_type_)); \ - xmm2 = _mm_lddqu_si128((__m128i *) sptr1); \ - sptr1 += (16/sizeof(_type_)); \ - xmm3 = _mm_lddqu_si128((__m128i *) sptr1); \ - sptr1 += (16/sizeof(_type_)); \ - xmm4 = _mm_lddqu_si128((__m128i *) sptr2); \ - sptr2 += (16/sizeof(_type_)); \ - xmm5 = _mm_lddqu_si128((__m128i *) sptr2); \ - sptr2 += (16/sizeof(_type_)); \ - xmm6 = _mm_lddqu_si128((__m128i *) sptr2); \ - sptr2 += (16/sizeof(_type_)); \ - xmm7 = _mm_lddqu_si128((__m128i *) sptr2); \ - sptr2 += (16/sizeof(_type_)); \ - xmm0 = _op_(xmm0, xmm4); \ - xmm1 = _op_(xmm1, xmm5); \ - xmm2 = _op_(xmm2, xmm6); \ - xmm3 = _op_(xmm3, xmm7); \ - _mm_store_si128((__m128i *) dptr, xmm0); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm1); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm2); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm3); \ - dptr += (16/sizeof(_type_)); \ - } \ - } \ - else \ - { \ - /* Aligned loads */ \ - while (count--) \ - { \ - __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; \ - xmm0 = _mm_load_si128((__m128i *) sptr1); \ - sptr1 += (16/sizeof(_type_)); \ - xmm1 = _mm_load_si128((__m128i *) sptr1); \ - sptr1 += (16/sizeof(_type_)); \ - xmm2 = _mm_load_si128((__m128i *) sptr1); \ - sptr1 += (16/sizeof(_type_)); \ - xmm3 = _mm_load_si128((__m128i *) sptr1); \ - sptr1 += (16/sizeof(_type_)); \ - xmm4 = _mm_load_si128((__m128i *) sptr2); \ - sptr2 += (16/sizeof(_type_)); \ - xmm5 = _mm_load_si128((__m128i *) sptr2); \ - sptr2 += (16/sizeof(_type_)); \ - xmm6 = _mm_load_si128((__m128i *) sptr2); \ - sptr2 += (16/sizeof(_type_)); \ - xmm7 = _mm_load_si128((__m128i *) sptr2); \ - sptr2 += (16/sizeof(_type_)); \ - xmm0 = _op_(xmm0, xmm4); \ - xmm1 = _op_(xmm1, xmm5); \ - xmm2 = _op_(xmm2, xmm6); \ - xmm3 = _op_(xmm3, xmm7); \ - _mm_store_si128((__m128i *) dptr, xmm0); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm1); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm2); \ - dptr += (16/sizeof(_type_)); \ - _mm_store_si128((__m128i *) dptr, xmm3); \ - dptr += (16/sizeof(_type_)); \ - } \ - } \ - /* Use a single 128-bit SSE register. */ \ - count = len >> (5-shifts); \ - len -= count << (5-shifts); \ - while (count--) \ - { \ - __m128i xmm0, xmm1; \ - xmm0 = LOAD_SI128(sptr1); sptr1 += (16/sizeof(_type_)); \ - xmm1 = LOAD_SI128(sptr2); sptr2 += (16/sizeof(_type_)); \ - xmm0 = _op_(xmm0, xmm1); \ - _mm_store_si128((__m128i *) dptr, xmm0); \ - dptr += (16/sizeof(_type_)); \ - } \ - /* Finish off the remainder. */ \ - while (len--) { _slowWay_; } \ - return PRIMITIVES_SUCCESS; \ +#define SSE3_SSD_ROUTINE(_name_, _type_, _fallback_, _op_, _slowWay_) \ + pstatus_t _name_(const _type_* pSrc1, const _type_* pSrc2, _type_* pDst, UINT32 len) \ + { \ + int shifts = 0; \ + UINT32 offBeatMask; \ + const _type_* sptr1 = pSrc1; \ + const _type_* sptr2 = pSrc2; \ + _type_* dptr = pDst; \ + size_t count; \ + if (len < 16) /* pointless if too small */ \ + { \ + return _fallback_(pSrc1, pSrc2, pDst, len); \ + } \ + if (sizeof(_type_) == 1) \ + shifts = 1; \ + else if (sizeof(_type_) == 2) \ + shifts = 2; \ + else if (sizeof(_type_) == 4) \ + shifts = 3; \ + else if (sizeof(_type_) == 8) \ + shifts = 4; \ + offBeatMask = (1 << (shifts - 1)) - 1; \ + if ((ULONG_PTR)pDst & offBeatMask) \ + { \ + /* Incrementing the pointer skips over 16-byte boundary. */ \ + return _fallback_(pSrc1, pSrc2, pDst, len); \ + } \ + /* Get to the 16-byte boundary now. */ \ + while ((ULONG_PTR)dptr & 0x0f) \ + { \ + pstatus_t status; \ + status = _slowWay_; \ + if (status != PRIMITIVES_SUCCESS) \ + return status; \ + if (--len == 0) \ + return PRIMITIVES_SUCCESS; \ + } \ + /* Use 4 128-bit SSE registers. */ \ + count = len >> (7 - shifts); \ + len -= count << (7 - shifts); \ + if (((ULONG_PTR)sptr1 & 0x0f) || ((ULONG_PTR)sptr2 & 0x0f)) \ + { \ + /* Unaligned loads */ \ + while (count--) \ + { \ + __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; \ + xmm0 = _mm_lddqu_si128((__m128i*)sptr1); \ + sptr1 += (16 / sizeof(_type_)); \ + xmm1 = _mm_lddqu_si128((__m128i*)sptr1); \ + sptr1 += (16 / sizeof(_type_)); \ + xmm2 = _mm_lddqu_si128((__m128i*)sptr1); \ + sptr1 += (16 / sizeof(_type_)); \ + xmm3 = _mm_lddqu_si128((__m128i*)sptr1); \ + sptr1 += (16 / sizeof(_type_)); \ + xmm4 = _mm_lddqu_si128((__m128i*)sptr2); \ + sptr2 += (16 / sizeof(_type_)); \ + xmm5 = _mm_lddqu_si128((__m128i*)sptr2); \ + sptr2 += (16 / sizeof(_type_)); \ + xmm6 = _mm_lddqu_si128((__m128i*)sptr2); \ + sptr2 += (16 / sizeof(_type_)); \ + xmm7 = _mm_lddqu_si128((__m128i*)sptr2); \ + sptr2 += (16 / sizeof(_type_)); \ + xmm0 = _op_(xmm0, xmm4); \ + xmm1 = _op_(xmm1, xmm5); \ + xmm2 = _op_(xmm2, xmm6); \ + xmm3 = _op_(xmm3, xmm7); \ + _mm_store_si128((__m128i*)dptr, xmm0); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm1); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm2); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm3); \ + dptr += (16 / sizeof(_type_)); \ + } \ + } \ + else \ + { \ + /* Aligned loads */ \ + while (count--) \ + { \ + __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; \ + xmm0 = _mm_load_si128((__m128i*)sptr1); \ + sptr1 += (16 / sizeof(_type_)); \ + xmm1 = _mm_load_si128((__m128i*)sptr1); \ + sptr1 += (16 / sizeof(_type_)); \ + xmm2 = _mm_load_si128((__m128i*)sptr1); \ + sptr1 += (16 / sizeof(_type_)); \ + xmm3 = _mm_load_si128((__m128i*)sptr1); \ + sptr1 += (16 / sizeof(_type_)); \ + xmm4 = _mm_load_si128((__m128i*)sptr2); \ + sptr2 += (16 / sizeof(_type_)); \ + xmm5 = _mm_load_si128((__m128i*)sptr2); \ + sptr2 += (16 / sizeof(_type_)); \ + xmm6 = _mm_load_si128((__m128i*)sptr2); \ + sptr2 += (16 / sizeof(_type_)); \ + xmm7 = _mm_load_si128((__m128i*)sptr2); \ + sptr2 += (16 / sizeof(_type_)); \ + xmm0 = _op_(xmm0, xmm4); \ + xmm1 = _op_(xmm1, xmm5); \ + xmm2 = _op_(xmm2, xmm6); \ + xmm3 = _op_(xmm3, xmm7); \ + _mm_store_si128((__m128i*)dptr, xmm0); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm1); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm2); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm3); \ + dptr += (16 / sizeof(_type_)); \ + } \ + } \ + /* Use a single 128-bit SSE register. */ \ + count = len >> (5 - shifts); \ + len -= count << (5 - shifts); \ + while (count--) \ + { \ + __m128i xmm0, xmm1; \ + xmm0 = LOAD_SI128(sptr1); \ + sptr1 += (16 / sizeof(_type_)); \ + xmm1 = LOAD_SI128(sptr2); \ + sptr2 += (16 / sizeof(_type_)); \ + xmm0 = _op_(xmm0, xmm1); \ + _mm_store_si128((__m128i*)dptr, xmm0); \ + dptr += (16 / sizeof(_type_)); \ + } \ + /* Finish off the remainder. */ \ + while (len--) \ + { \ + _slowWay_; \ + } \ + return PRIMITIVES_SUCCESS; \ } #endif /* FREERDP_LIB_PRIM_TEMPLATES_H */ diff --git a/libfreerdp/primitives/primitives.c b/libfreerdp/primitives/primitives.c index 6051659d7..1bc959a1f 100644 --- a/libfreerdp/primitives/primitives.c +++ b/libfreerdp/primitives/primitives.c @@ -35,7 +35,6 @@ static primitives_t pPrimitives = { 0 }; static INIT_ONCE primitives_InitOnce = INIT_ONCE_STATIC_INIT; #endif - /* ------------------------------------------------------------------------- */ static BOOL CALLBACK primitives_init_generic(PINIT_ONCE once, PVOID param, PVOID* context) { @@ -93,4 +92,3 @@ primitives_t* primitives_get_generic(void) InitOnceExecuteOnce(&generic_primitives_InitOnce, primitives_init_generic, NULL, NULL); return &pPrimitivesGeneric; } - diff --git a/libfreerdp/primitives/test/TestPrimitivesAdd.c b/libfreerdp/primitives/test/TestPrimitivesAdd.c index 125752b86..d155b9c2e 100644 --- a/libfreerdp/primitives/test/TestPrimitivesAdd.c +++ b/libfreerdp/primitives/test/TestPrimitivesAdd.c @@ -19,14 +19,14 @@ #include #include "prim_test.h" -#define FUNC_TEST_SIZE 65536 +#define FUNC_TEST_SIZE 65536 /* ========================================================================= */ static BOOL test_add16s_func(void) { pstatus_t status; INT16 ALIGN(src1[FUNC_TEST_SIZE + 3]), ALIGN(src2[FUNC_TEST_SIZE + 3]), - ALIGN(d1[FUNC_TEST_SIZE + 3]), ALIGN(d2[FUNC_TEST_SIZE + 3]); + ALIGN(d1[FUNC_TEST_SIZE + 3]), ALIGN(d2[FUNC_TEST_SIZE + 3]); char testStr[256]; testStr[0] = '\0'; @@ -50,7 +50,7 @@ static BOOL test_add16s_func(void) static BOOL test_add16s_speed(void) { BYTE ALIGN(src1[MAX_TEST_SIZE + 3]), ALIGN(src2[MAX_TEST_SIZE + 3]), - ALIGN(dst[MAX_TEST_SIZE + 3]); + ALIGN(dst[MAX_TEST_SIZE + 3]); if (!g_TestPrimitivesPerformance) return TRUE; @@ -58,10 +58,8 @@ static BOOL test_add16s_speed(void) winpr_RAND(src1, sizeof(src1)); winpr_RAND(src2, sizeof(src2)); - if (!speed_test("add16s", "aligned", g_Iterations, - (speed_test_fkt)generic->add_16s, - (speed_test_fkt)optimized->add_16s, - src1, src2, dst, FUNC_TEST_SIZE)) + if (!speed_test("add16s", "aligned", g_Iterations, (speed_test_fkt)generic->add_16s, + (speed_test_fkt)optimized->add_16s, src1, src2, dst, FUNC_TEST_SIZE)) return FALSE; return TRUE; diff --git a/libfreerdp/primitives/test/TestPrimitivesAlphaComp.c b/libfreerdp/primitives/test/TestPrimitivesAlphaComp.c index 16a72f3b0..ea89a4e9f 100644 --- a/libfreerdp/primitives/test/TestPrimitivesAlphaComp.c +++ b/libfreerdp/primitives/test/TestPrimitivesAlphaComp.c @@ -20,13 +20,13 @@ #include "prim_test.h" #define MAX_BLOCK_SIZE 256 -#define SIZE_SQUARED (MAX_BLOCK_SIZE*MAX_BLOCK_SIZE) +#define SIZE_SQUARED (MAX_BLOCK_SIZE * MAX_BLOCK_SIZE) /* ========================================================================= */ -#define ALF(_c_) (((_c_) & 0xFF000000U) >> 24) -#define RED(_c_) (((_c_) & 0x00FF0000U) >> 16) -#define GRN(_c_) (((_c_) & 0x0000FF00U) >> 8) -#define BLU(_c_) ((_c_) & 0x000000FFU) +#define ALF(_c_) (((_c_)&0xFF000000U) >> 24) +#define RED(_c_) (((_c_)&0x00FF0000U) >> 16) +#define GRN(_c_) (((_c_)&0x0000FF00U) >> 8) +#define BLU(_c_) ((_c_)&0x000000FFU) #define TOLERANCE 1 static inline const UINT32* PIXEL(const BYTE* _addr_, UINT32 _bytes_, UINT32 _x_, UINT32 _y_) { @@ -44,9 +44,7 @@ static inline const UINT32* PIXEL(const BYTE* _addr_, UINT32 _bytes_, UINT32 _x_ #define TEST_HEIGHT 5 /* ------------------------------------------------------------------------- */ -static UINT32 alpha_add( - UINT32 c1, - UINT32 c2) +static UINT32 alpha_add(UINT32 c1, UINT32 c2) { UINT32 a1 = ALF(c1); UINT32 r1 = RED(c1); @@ -64,35 +62,35 @@ static UINT32 alpha_add( } /* ------------------------------------------------------------------------- */ -static UINT32 colordist( - UINT32 c1, - UINT32 c2) +static UINT32 colordist(UINT32 c1, UINT32 c2) { int d, maxd = 0; d = ABS((INT32)(ALF(c1) - ALF(c2))); - if (d > maxd) maxd = d; + if (d > maxd) + maxd = d; d = ABS((INT32)(RED(c1) - RED(c2))); - if (d > maxd) maxd = d; + if (d > maxd) + maxd = d; d = ABS((INT32)(GRN(c1) - GRN(c2))); - if (d > maxd) maxd = d; + if (d > maxd) + maxd = d; d = ABS((INT32)(BLU(c1) - BLU(c2))); - if (d > maxd) maxd = d; + if (d > maxd) + maxd = d; return maxd; } /* ------------------------------------------------------------------------- */ -static BOOL check(const BYTE* pSrc1, UINT32 src1Step, - const BYTE* pSrc2, UINT32 src2Step, - BYTE* pDst, UINT32 dstStep, - UINT32 width, UINT32 height) +static BOOL check(const BYTE* pSrc1, UINT32 src1Step, const BYTE* pSrc2, UINT32 src2Step, + BYTE* pDst, UINT32 dstStep, UINT32 width, UINT32 height) { UINT32 x, y; @@ -107,7 +105,8 @@ static BOOL check(const BYTE* pSrc1, UINT32 src1Step, if (colordist(c0, c1) > TOLERANCE) { - printf("alphaComp-general: [%"PRIu32",%"PRIu32"] 0x%08"PRIx32"+0x%08"PRIx32"=0x%08"PRIx32", got 0x%08"PRIx32"\n", + printf("alphaComp-general: [%" PRIu32 ",%" PRIu32 "] 0x%08" PRIx32 "+0x%08" PRIx32 + "=0x%08" PRIx32 ", got 0x%08" PRIx32 "\n", x, y, s1, s2, c0, c1); return FALSE; } @@ -133,31 +132,29 @@ static BOOL test_alphaComp_func(void) /* Set the second operand to fully-opaque. */ ptr = (UINT32*)src2; - for (i = 0; i < sizeof(src2) / 4; ++i) *ptr++ |= 0xFF000000U; + for (i = 0; i < sizeof(src2) / 4; ++i) + *ptr++ |= 0xFF000000U; memset(dst1, 0, sizeof(dst1)); - status = generic->alphaComp_argb(src1, 4 * SRC1_WIDTH, - src2, 4 * SRC2_WIDTH, - dst1, 4 * DST_WIDTH, TEST_WIDTH, TEST_HEIGHT); + status = generic->alphaComp_argb(src1, 4 * SRC1_WIDTH, src2, 4 * SRC2_WIDTH, dst1, + 4 * DST_WIDTH, TEST_WIDTH, TEST_HEIGHT); if (status != PRIMITIVES_SUCCESS) return FALSE; - if (!check(src1, 4 * SRC1_WIDTH, - src2, 4 * SRC2_WIDTH, - dst1, 4 * DST_WIDTH, TEST_WIDTH, TEST_HEIGHT)) + if (!check(src1, 4 * SRC1_WIDTH, src2, 4 * SRC2_WIDTH, dst1, 4 * DST_WIDTH, TEST_WIDTH, + TEST_HEIGHT)) return FALSE; - status = optimized->alphaComp_argb((const BYTE*) src1, 4 * SRC1_WIDTH, - (const BYTE*) src2, 4 * SRC2_WIDTH, - (BYTE*) dst1, 4 * DST_WIDTH, TEST_WIDTH, TEST_HEIGHT); + status = optimized->alphaComp_argb((const BYTE*)src1, 4 * SRC1_WIDTH, (const BYTE*)src2, + 4 * SRC2_WIDTH, (BYTE*)dst1, 4 * DST_WIDTH, TEST_WIDTH, + TEST_HEIGHT); if (status != PRIMITIVES_SUCCESS) return FALSE; - if (!check(src1, 4 * SRC1_WIDTH, - src2, 4 * SRC2_WIDTH, - dst1, 4 * DST_WIDTH, TEST_WIDTH, TEST_HEIGHT)) + if (!check(src1, 4 * SRC1_WIDTH, src2, 4 * SRC2_WIDTH, dst1, 4 * DST_WIDTH, TEST_WIDTH, + TEST_HEIGHT)) return FALSE; return TRUE; @@ -180,16 +177,14 @@ static int test_alphaComp_speed(void) /* Set the second operand to fully-opaque. */ ptr = (UINT32*)src2; - for (i = 0; i < sizeof(src2) / 4; ++i) *ptr++ |= 0xFF000000U; + for (i = 0; i < sizeof(src2) / 4; ++i) + *ptr++ |= 0xFF000000U; memset(dst1, 0, sizeof(dst1)); - if (!speed_test("add16s", "aligned", g_Iterations, - (speed_test_fkt)generic->alphaComp_argb, - (speed_test_fkt)optimized->alphaComp_argb, - src1, 4 * SRC1_WIDTH, - src2, 4 * SRC2_WIDTH, - dst1, 4 * DST_WIDTH, TEST_WIDTH, TEST_HEIGHT)) + if (!speed_test("add16s", "aligned", g_Iterations, (speed_test_fkt)generic->alphaComp_argb, + (speed_test_fkt)optimized->alphaComp_argb, src1, 4 * SRC1_WIDTH, src2, + 4 * SRC2_WIDTH, dst1, 4 * DST_WIDTH, TEST_WIDTH, TEST_HEIGHT)) return FALSE; return TRUE; diff --git a/libfreerdp/primitives/test/TestPrimitivesAndOr.c b/libfreerdp/primitives/test/TestPrimitivesAndOr.c index 4e97802e5..e03cc7166 100644 --- a/libfreerdp/primitives/test/TestPrimitivesAndOr.c +++ b/libfreerdp/primitives/test/TestPrimitivesAndOr.c @@ -19,14 +19,13 @@ #include "prim_test.h" -#define FUNC_TEST_SIZE 65536 +#define FUNC_TEST_SIZE 65536 #define VALUE (0xA5A5A5A5U) /* ========================================================================= */ -static BOOL test_and_32u_impl(const char* name, __andC_32u_t fkt, - const UINT32* src, const UINT32 val, - UINT32* dst, size_t size) +static BOOL test_and_32u_impl(const char* name, __andC_32u_t fkt, const UINT32* src, + const UINT32 val, UINT32* dst, size_t size) { size_t i; pstatus_t status = fkt(src, val, dst, size); @@ -38,8 +37,9 @@ static BOOL test_and_32u_impl(const char* name, __andC_32u_t fkt, if (dst[i] != (src[i] & val)) { - printf("AND %s FAIL[%"PRIuz"] 0x%08"PRIx32"&0x%08"PRIx32"=0x%08"PRIx32", got 0x%08"PRIx32"\n", - name, i, src[i], val, (src[i] & val), dst[i]); + printf("AND %s FAIL[%" PRIuz "] 0x%08" PRIx32 "&0x%08" PRIx32 "=0x%08" PRIx32 + ", got 0x%08" PRIx32 "\n", + name, i, src[i], val, (src[i] & val), dst[i]); return FALSE; } @@ -54,17 +54,17 @@ static BOOL test_and_32u_func(void) winpr_RAND((BYTE*)src, sizeof(src)); - if (!test_and_32u_impl("generic->andC_32u aligned", generic->andC_32u, - src + 1, VALUE, dst + 1, FUNC_TEST_SIZE)) + if (!test_and_32u_impl("generic->andC_32u aligned", generic->andC_32u, src + 1, VALUE, dst + 1, + FUNC_TEST_SIZE)) return FALSE; - if (!test_and_32u_impl("generic->andC_32u unaligned", generic->andC_32u, - src + 1, VALUE, dst + 2, FUNC_TEST_SIZE)) + if (!test_and_32u_impl("generic->andC_32u unaligned", generic->andC_32u, src + 1, VALUE, + dst + 2, FUNC_TEST_SIZE)) return FALSE; - if (!test_and_32u_impl("optimized->andC_32u aligned", optimized->andC_32u, - src + 1, VALUE, dst + 1, FUNC_TEST_SIZE)) + if (!test_and_32u_impl("optimized->andC_32u aligned", optimized->andC_32u, src + 1, VALUE, + dst + 1, FUNC_TEST_SIZE)) return FALSE; - if (!test_and_32u_impl("optimized->andC_32u unaligned", optimized->andC_32u, - src + 1, VALUE, dst + 2, FUNC_TEST_SIZE)) + if (!test_and_32u_impl("optimized->andC_32u unaligned", optimized->andC_32u, src + 1, VALUE, + dst + 2, FUNC_TEST_SIZE)) return FALSE; return TRUE; @@ -77,15 +77,11 @@ static BOOL test_and_32u_speed(void) winpr_RAND((BYTE*)src, sizeof(src)); - if (!speed_test("andC_32u", "aligned", g_Iterations, - (speed_test_fkt)generic->andC_32u, - (speed_test_fkt)optimized->andC_32u, - src + 1, VALUE, dst + 1, MAX_TEST_SIZE)) + if (!speed_test("andC_32u", "aligned", g_Iterations, (speed_test_fkt)generic->andC_32u, + (speed_test_fkt)optimized->andC_32u, src + 1, VALUE, dst + 1, MAX_TEST_SIZE)) return FALSE; - if (!speed_test("andC_32u", "unaligned", g_Iterations, - (speed_test_fkt)generic->andC_32u, - (speed_test_fkt)optimized->andC_32u, - src + 1, VALUE, dst + 2, MAX_TEST_SIZE)) + if (!speed_test("andC_32u", "unaligned", g_Iterations, (speed_test_fkt)generic->andC_32u, + (speed_test_fkt)optimized->andC_32u, src + 1, VALUE, dst + 2, MAX_TEST_SIZE)) return FALSE; return TRUE; @@ -100,7 +96,8 @@ static BOOL check(const UINT32* src, const UINT32* dst, UINT32 size, UINT32 valu { if (dst[i] != (src[i] | value)) { - printf("OR-general general FAIL[%"PRIu32"] 0x%08"PRIx32"&0x%08"PRIx32"=0x%08"PRIx32", got 0x%08"PRIx32"\n", + printf("OR-general general FAIL[%" PRIu32 "] 0x%08" PRIx32 "&0x%08" PRIx32 + "=0x%08" PRIx32 ", got 0x%08" PRIx32 "\n", i, src[i], value, src[i] | value, dst[i]); return FALSE; } @@ -141,10 +138,8 @@ static BOOL test_or_32u_speed(void) testStr[0] = '\0'; winpr_RAND((BYTE*)src, sizeof(src)); - if (!speed_test("add16s", "aligned", g_Iterations, - (speed_test_fkt)generic->orC_32u, - (speed_test_fkt)optimized->orC_32u, - src + 1, VALUE, dst + 1, FUNC_TEST_SIZE)) + if (!speed_test("add16s", "aligned", g_Iterations, (speed_test_fkt)generic->orC_32u, + (speed_test_fkt)optimized->orC_32u, src + 1, VALUE, dst + 1, FUNC_TEST_SIZE)) return FALSE; return TRUE; diff --git a/libfreerdp/primitives/test/TestPrimitivesColors.c b/libfreerdp/primitives/test/TestPrimitivesColors.c index 2775422e4..5fe2dcaf4 100644 --- a/libfreerdp/primitives/test/TestPrimitivesColors.c +++ b/libfreerdp/primitives/test/TestPrimitivesColors.c @@ -71,17 +71,15 @@ static BOOL test_RGBToRGB_16s8u_P3AC4R_func(prim_size_t roi, DWORD DstFormat) ptrs[2] = b; PROFILER_ENTER(genericProf) - if (generic->RGBToRGB_16s8u_P3AC4R(ptrs, rgbStride, - out1, dstStride, DstFormat, - &roi) != PRIMITIVES_SUCCESS) + if (generic->RGBToRGB_16s8u_P3AC4R(ptrs, rgbStride, out1, dstStride, DstFormat, &roi) != + PRIMITIVES_SUCCESS) goto fail; PROFILER_EXIT(genericProf) PROFILER_ENTER(optProf) - if (optimized->RGBToRGB_16s8u_P3AC4R(ptrs, rgbStride, - out2, dstStride, DstFormat, - &roi) != PRIMITIVES_SUCCESS) + if (optimized->RGBToRGB_16s8u_P3AC4R(ptrs, rgbStride, out2, dstStride, DstFormat, &roi) != + PRIMITIVES_SUCCESS) goto fail; PROFILER_EXIT(optProf) @@ -95,14 +93,15 @@ static BOOL test_RGBToRGB_16s8u_P3AC4R_func(prim_size_t roi, DWORD DstFormat) if (o1 != o2) { - printf("RGBToRGB_16s8u_P3AC4R FAIL: out1[%d]=0x%08"PRIx32" out2[%d]=0x%08"PRIx32"\n", + printf("RGBToRGB_16s8u_P3AC4R FAIL: out1[%d]=0x%08" PRIx32 " out2[%d]=0x%08" PRIx32 + "\n", i, out1[i], i, out2[i]); failed = TRUE; } } } - printf("Results for %"PRIu32"x%"PRIu32" [%s]", roi.width, roi.height, + printf("Results for %" PRIu32 "x%" PRIu32 " [%s]", roi.width, roi.height, FreeRDPGetColorFormatName(DstFormat)); PROFILER_PRINT_HEADER PROFILER_PRINT(genericProf) @@ -145,14 +144,14 @@ static BOOL test_RGBToRGB_16s8u_P3AC4R_speed(void) if (!speed_test("RGBToRGB_16s8u_P3AC4R", "aligned", g_Iterations, (speed_test_fkt)generic->RGBToRGB_16s8u_P3AC4R, - (speed_test_fkt)optimized->RGBToRGB_16s8u_P3AC4R, - (const INT16**) ptrs, 64 * 2, (BYTE*) dst, 64 * 4, &roi64x64)) + (speed_test_fkt)optimized->RGBToRGB_16s8u_P3AC4R, (const INT16**)ptrs, 64 * 2, + (BYTE*)dst, 64 * 4, &roi64x64)) return FALSE; if (!speed_test("RGBToRGB_16s8u_P3AC4R", "unaligned", g_Iterations, (speed_test_fkt)generic->RGBToRGB_16s8u_P3AC4R, - (speed_test_fkt)optimized->RGBToRGB_16s8u_P3AC4R, - (const INT16**) ptrs, 64 * 2, ((BYTE*) dst) + 1, 64 * 4, &roi64x64)) + (speed_test_fkt)optimized->RGBToRGB_16s8u_P3AC4R, (const INT16**)ptrs, 64 * 2, + ((BYTE*)dst) + 1, 64 * 4, &roi64x64)) return FALSE; return TRUE; @@ -177,7 +176,7 @@ static BOOL test_yCbCrToRGB_16s16s_P3P3_func(void) /* Normalize to 11.5 fixed radix */ for (i = 0; i < 4096; ++i) { - y[i] &= 0x1FE0U; + y[i] &= 0x1FE0U; cb[i] &= 0x1FE0U; cr[i] &= 0x1FE0U; } @@ -209,13 +208,11 @@ static BOOL test_yCbCrToRGB_16s16s_P3P3_func(void) for (i = 0; i < 4096; ++i) { - if ((ABS(r1[i] - r2[i]) > 1) - || (ABS(g1[i] - g2[i]) > 1) - || (ABS(b1[i] - b2[i]) > 1)) + if ((ABS(r1[i] - r2[i]) > 1) || (ABS(g1[i] - g2[i]) > 1) || (ABS(b1[i] - b2[i]) > 1)) { - printf("YCbCrToRGB-SSE FAIL[%d]: %"PRId16",%"PRId16",%"PRId16" vs %"PRId16",%"PRId16",%"PRId16"\n", - i, - r1[i], g1[i], b1[i], r2[i], g2[i], b2[i]); + printf("YCbCrToRGB-SSE FAIL[%d]: %" PRId16 ",%" PRId16 ",%" PRId16 " vs %" PRId16 + ",%" PRId16 ",%" PRId16 "\n", + i, r1[i], g1[i], b1[i], r2[i], g2[i], b2[i]); return FALSE; } } @@ -239,7 +236,7 @@ static int test_yCbCrToRGB_16s16s_P3P3_speed(void) /* Normalize to 11.5 fixed radix */ for (i = 0; i < 4096; ++i) { - y[i] &= 0x1FE0U; + y[i] &= 0x1FE0U; cb[i] &= 0x1FE0U; cr[i] &= 0x1FE0U; } @@ -253,8 +250,8 @@ static int test_yCbCrToRGB_16s16s_P3P3_speed(void) if (!speed_test("yCbCrToRGB_16s16s_P3P3", "aligned", g_Iterations, (speed_test_fkt)generic->yCbCrToRGB_16s16s_P3P3, - (speed_test_fkt)optimized->yCbCrToRGB_16s16s_P3P3, - input, 64 * 2, output, 64 * 2, &roi)) + (speed_test_fkt)optimized->yCbCrToRGB_16s16s_P3P3, input, 64 * 2, output, + 64 * 2, &roi)) return FALSE; return TRUE; @@ -262,19 +259,11 @@ static int test_yCbCrToRGB_16s16s_P3P3_speed(void) int TestPrimitivesColors(int argc, char* argv[]) { - const DWORD formats[] = - { - PIXEL_FORMAT_ARGB32, - PIXEL_FORMAT_XRGB32, - PIXEL_FORMAT_ABGR32, - PIXEL_FORMAT_XBGR32, - PIXEL_FORMAT_RGBA32, - PIXEL_FORMAT_RGBX32, - PIXEL_FORMAT_BGRA32, - PIXEL_FORMAT_BGRX32 - }; + const DWORD formats[] = { PIXEL_FORMAT_ARGB32, PIXEL_FORMAT_XRGB32, PIXEL_FORMAT_ABGR32, + PIXEL_FORMAT_XBGR32, PIXEL_FORMAT_RGBA32, PIXEL_FORMAT_RGBX32, + PIXEL_FORMAT_BGRA32, PIXEL_FORMAT_BGRX32 }; DWORD x; - prim_size_t roi = { 1920, 1080}; + prim_size_t roi = { 1920, 1080 }; WINPR_UNUSED(argc); WINPR_UNUSED(argv); prim_test_setup(FALSE); diff --git a/libfreerdp/primitives/test/TestPrimitivesCopy.c b/libfreerdp/primitives/test/TestPrimitivesCopy.c index 151ec03c8..7c93985c8 100644 --- a/libfreerdp/primitives/test/TestPrimitivesCopy.c +++ b/libfreerdp/primitives/test/TestPrimitivesCopy.c @@ -19,7 +19,7 @@ #include #include "prim_test.h" -#define COPY_TESTSIZE (256*2+16*2+15+15) +#define COPY_TESTSIZE (256 * 2 + 16 * 2 + 15 + 15) /* ------------------------------------------------------------------------- */ static BOOL test_copy8u_func(void) @@ -49,10 +49,9 @@ static BOOL test_copy8u_func(void) { if (dest[i + doff] != data[i + soff]) { - printf("COPY8U FAIL: off=%d len=%d, dest[%d]=0x%02"PRIx8"" - "data[%d]=0x%02"PRIx8"\n", - doff, length, i + doff, dest[i + doff], - i + soff, data[i + soff]); + printf("COPY8U FAIL: off=%d len=%d, dest[%d]=0x%02" PRIx8 "" + "data[%d]=0x%02" PRIx8 "\n", + doff, length, i + doff, dest[i + doff], i + soff, data[i + soff]); return FALSE; } } @@ -69,16 +68,12 @@ static BOOL test_copy8u_speed(void) BYTE ALIGN(src[MAX_TEST_SIZE + 4]); BYTE ALIGN(dst[MAX_TEST_SIZE + 4]); - if (!speed_test("copy_8u", "aligned", g_Iterations, - (speed_test_fkt)generic->copy_8u, - (speed_test_fkt)optimized->copy_8u, - src, dst, MAX_TEST_SIZE)) + if (!speed_test("copy_8u", "aligned", g_Iterations, (speed_test_fkt)generic->copy_8u, + (speed_test_fkt)optimized->copy_8u, src, dst, MAX_TEST_SIZE)) return FALSE; - if (!speed_test("copy_8u", "unaligned", g_Iterations, - (speed_test_fkt)generic->copy_8u, - (speed_test_fkt)optimized->copy_8u, - src + 1, dst + 1, MAX_TEST_SIZE)) + if (!speed_test("copy_8u", "unaligned", g_Iterations, (speed_test_fkt)generic->copy_8u, + (speed_test_fkt)optimized->copy_8u, src + 1, dst + 1, MAX_TEST_SIZE)) return FALSE; return TRUE; diff --git a/libfreerdp/primitives/test/TestPrimitivesSet.c b/libfreerdp/primitives/test/TestPrimitivesSet.c index 852cf9a73..f67aa460f 100644 --- a/libfreerdp/primitives/test/TestPrimitivesSet.c +++ b/libfreerdp/primitives/test/TestPrimitivesSet.c @@ -28,7 +28,8 @@ static BOOL check8(const BYTE* src, UINT32 length, UINT32 offset, BYTE value) { if (src[offset + i] != value) { - printf("SET8U FAILED: off=%"PRIu32" len=%"PRIu32" dest[%"PRIu32"]=0x%02"PRIx8"\n", + printf("SET8U FAILED: off=%" PRIu32 " len=%" PRIu32 " dest[%" PRIu32 "]=0x%02" PRIx8 + "\n", offset, length, i + offset, src[i + offset]); return FALSE; } @@ -91,10 +92,8 @@ static BOOL test_set8u_speed(void) { winpr_RAND(&value, sizeof(value)); - if (!speed_test("set_8u", "", g_Iterations, - (speed_test_fkt)generic->set_8u, - (speed_test_fkt)optimized->set_8u, - value, dest + x, x)) + if (!speed_test("set_8u", "", g_Iterations, (speed_test_fkt)generic->set_8u, + (speed_test_fkt)optimized->set_8u, value, dest + x, x)) return FALSE; } @@ -109,7 +108,8 @@ static BOOL check32s(const INT32* src, UINT32 length, UINT32 offset, INT32 value { if (src[offset + i] != value) { - printf("SET8U FAILED: off=%"PRIu32" len=%"PRIu32" dest[%"PRIu32"]=0x%08"PRIx32"\n", + printf("SET8U FAILED: off=%" PRIu32 " len=%" PRIu32 " dest[%" PRIu32 "]=0x%08" PRIx32 + "\n", offset, length, i + offset, src[i + offset]); return FALSE; } @@ -171,7 +171,8 @@ static BOOL check32u(const UINT32* src, UINT32 length, UINT32 offset, UINT32 val { if (src[offset + i] != value) { - printf("SET8U FAILED: off=%"PRIu32" len=%"PRIu32" dest[%"PRIu32"]=0x%08"PRIx32"\n", + printf("SET8U FAILED: off=%" PRIu32 " len=%" PRIu32 " dest[%" PRIu32 "]=0x%08" PRIx32 + "\n", offset, length, i + offset, src[i + offset]); return FALSE; } @@ -236,10 +237,8 @@ static BOOL test_set32u_speed(void) { winpr_RAND(&value, sizeof(value)); - if (!speed_test("set_32u", "", g_Iterations, - (speed_test_fkt)generic->set_32u, - (speed_test_fkt)optimized->set_32u, - value, dest + x, x)) + if (!speed_test("set_32u", "", g_Iterations, (speed_test_fkt)generic->set_32u, + (speed_test_fkt)optimized->set_32u, value, dest + x, x)) return FALSE; } @@ -257,10 +256,8 @@ static BOOL test_set32s_speed(void) { winpr_RAND(&value, sizeof(value)); - if (!speed_test("set_32s", "", g_Iterations, - (speed_test_fkt)generic->set_32s, - (speed_test_fkt)optimized->set_32s, - value, dest + x, x)) + if (!speed_test("set_32s", "", g_Iterations, (speed_test_fkt)generic->set_32s, + (speed_test_fkt)optimized->set_32s, value, dest + x, x)) return FALSE; } diff --git a/libfreerdp/primitives/test/TestPrimitivesShift.c b/libfreerdp/primitives/test/TestPrimitivesShift.c index 16d7d5f0b..448c2d1a2 100644 --- a/libfreerdp/primitives/test/TestPrimitivesShift.c +++ b/libfreerdp/primitives/test/TestPrimitivesShift.c @@ -275,16 +275,12 @@ static BOOL test_lShift_16s_speed(void) winpr_RAND((BYTE*)src, sizeof(src)); winpr_RAND((BYTE*)&val, sizeof(val)); - if (!speed_test("lShift_16s", "aligned", g_Iterations, - (speed_test_fkt)generic->lShiftC_16s, - (speed_test_fkt)optimized->lShiftC_16s, src, val, - dst, MAX_TEST_SIZE)) + if (!speed_test("lShift_16s", "aligned", g_Iterations, (speed_test_fkt)generic->lShiftC_16s, + (speed_test_fkt)optimized->lShiftC_16s, src, val, dst, MAX_TEST_SIZE)) return FALSE; - if (!speed_test("lShift_16s", "unaligned", g_Iterations, - (speed_test_fkt)generic->lShiftC_16s, - (speed_test_fkt)optimized->lShiftC_16s, src + 1, val, - dst, MAX_TEST_SIZE)) + if (!speed_test("lShift_16s", "unaligned", g_Iterations, (speed_test_fkt)generic->lShiftC_16s, + (speed_test_fkt)optimized->lShiftC_16s, src + 1, val, dst, MAX_TEST_SIZE)) return FALSE; return TRUE; @@ -298,16 +294,12 @@ static BOOL test_lShift_16u_speed(void) winpr_RAND((BYTE*)&val, sizeof(val)); winpr_RAND((BYTE*)src, sizeof(src)); - if (!speed_test("lShift_16u", "aligned", g_Iterations, - (speed_test_fkt)generic->lShiftC_16u, - (speed_test_fkt)optimized->lShiftC_16u, src, val, - dst, MAX_TEST_SIZE)) + if (!speed_test("lShift_16u", "aligned", g_Iterations, (speed_test_fkt)generic->lShiftC_16u, + (speed_test_fkt)optimized->lShiftC_16u, src, val, dst, MAX_TEST_SIZE)) return FALSE; - if (!speed_test("lShift_16u", "unaligned", g_Iterations, - (speed_test_fkt)generic->lShiftC_16u, - (speed_test_fkt)optimized->lShiftC_16u, src + 1, val, - dst, MAX_TEST_SIZE)) + if (!speed_test("lShift_16u", "unaligned", g_Iterations, (speed_test_fkt)generic->lShiftC_16u, + (speed_test_fkt)optimized->lShiftC_16u, src + 1, val, dst, MAX_TEST_SIZE)) return FALSE; return TRUE; @@ -321,16 +313,12 @@ static BOOL test_rShift_16s_speed(void) winpr_RAND((BYTE*)src, sizeof(src)); winpr_RAND((BYTE*)&val, sizeof(val)); - if (!speed_test("rShift_16s", "aligned", g_Iterations, - (speed_test_fkt)generic->rShiftC_16s, - (speed_test_fkt)optimized->rShiftC_16s, src, val, - dst, MAX_TEST_SIZE)) + if (!speed_test("rShift_16s", "aligned", g_Iterations, (speed_test_fkt)generic->rShiftC_16s, + (speed_test_fkt)optimized->rShiftC_16s, src, val, dst, MAX_TEST_SIZE)) return FALSE; - if (!speed_test("rShift_16s", "unaligned", g_Iterations, - (speed_test_fkt)generic->rShiftC_16s, - (speed_test_fkt)optimized->rShiftC_16s, src + 1, val, - dst, MAX_TEST_SIZE)) + if (!speed_test("rShift_16s", "unaligned", g_Iterations, (speed_test_fkt)generic->rShiftC_16s, + (speed_test_fkt)optimized->rShiftC_16s, src + 1, val, dst, MAX_TEST_SIZE)) return FALSE; return TRUE; @@ -344,16 +332,12 @@ static BOOL test_rShift_16u_speed(void) winpr_RAND((BYTE*)&val, sizeof(val)); winpr_RAND((BYTE*)src, sizeof(src)); - if (!speed_test("rShift_16u", "aligned", g_Iterations, - (speed_test_fkt)generic->rShiftC_16u, - (speed_test_fkt)optimized->rShiftC_16u, src, val, - dst, MAX_TEST_SIZE)) + if (!speed_test("rShift_16u", "aligned", g_Iterations, (speed_test_fkt)generic->rShiftC_16u, + (speed_test_fkt)optimized->rShiftC_16u, src, val, dst, MAX_TEST_SIZE)) return FALSE; - if (!speed_test("rShift_16u", "unaligned", g_Iterations, - (speed_test_fkt)generic->rShiftC_16u, - (speed_test_fkt)optimized->rShiftC_16u, src + 1, val, - dst, MAX_TEST_SIZE)) + if (!speed_test("rShift_16u", "unaligned", g_Iterations, (speed_test_fkt)generic->rShiftC_16u, + (speed_test_fkt)optimized->rShiftC_16u, src + 1, val, dst, MAX_TEST_SIZE)) return FALSE; return TRUE; diff --git a/libfreerdp/primitives/test/TestPrimitivesSign.c b/libfreerdp/primitives/test/TestPrimitivesSign.c index 976a6cec6..49c968399 100644 --- a/libfreerdp/primitives/test/TestPrimitivesSign.c +++ b/libfreerdp/primitives/test/TestPrimitivesSign.c @@ -65,16 +65,12 @@ static int test_sign16s_speed(void) INT16 ALIGN(src[MAX_TEST_SIZE + 3]), ALIGN(dst[MAX_TEST_SIZE + 3]); winpr_RAND((BYTE*)src, sizeof(src)); - if (!speed_test("sign16s", "aligned", g_Iterations, - (speed_test_fkt)generic->sign_16s, - (speed_test_fkt)optimized->sign_16s, src + 1, dst + 1, - MAX_TEST_SIZE)) + if (!speed_test("sign16s", "aligned", g_Iterations, (speed_test_fkt)generic->sign_16s, + (speed_test_fkt)optimized->sign_16s, src + 1, dst + 1, MAX_TEST_SIZE)) return FALSE; - if (!speed_test("sign16s", "unaligned", g_Iterations, - (speed_test_fkt)generic->sign_16s, - (speed_test_fkt)optimized->sign_16s, src + 1, dst + 2, - MAX_TEST_SIZE)) + if (!speed_test("sign16s", "unaligned", g_Iterations, (speed_test_fkt)generic->sign_16s, + (speed_test_fkt)optimized->sign_16s, src + 1, dst + 2, MAX_TEST_SIZE)) return FALSE; return TRUE; diff --git a/libfreerdp/primitives/test/TestPrimitivesYCbCr.c b/libfreerdp/primitives/test/TestPrimitivesYCbCr.c index bbd7758cc..d8b5bafec 100644 --- a/libfreerdp/primitives/test/TestPrimitivesYCbCr.c +++ b/libfreerdp/primitives/test/TestPrimitivesYCbCr.c @@ -12,1560 +12,968 @@ #define TAG __FILE__ -static const INT16 TEST_Y_COMPONENT[4096] = -{ - -32, +16, +64, +272, -32, -16, +0, -16, - -32, -24, -16, -8, +0, -24, -48, -72, - -96, -90, -84, -78, -72, -98, -124, -150, - -176, -192, -208, -224, -240, -256, -272, -288, - -304, -304, -304, -304, -304, -336, -368, -400, - -432, -450, -468, -486, -504, -522, -540, -558, - -576, -598, -620, -642, -664, -686, -708, -730, - -752, -768, -784, -800, -816, -816, -816, -816, - +68, +120, +172, +240, +53, +55, +57, +43, - +30, +32, +34, +36, +38, +20, +2, -16, - -34, -36, -38, -40, -42, -68, -94, -120, - -146, -148, -151, -186, -220, -227, -233, -240, - -247, -254, -261, -268, -275, -302, -329, -356, - -384, -403, -423, -443, -463, -484, -506, -528, - -550, -572, -594, -616, -639, -673, -707, -709, - -712, -733, -754, -775, -796, -796, -796, -796, - +168, +224, +281, +209, +138, +126, +115, +103, - +92, +88, +84, +80, +76, +64, +52, +40, - +28, +18, +8, -2, -12, -38, -64, -90, - -116, -105, -95, -148, -201, -198, -195, -192, - -190, -204, -218, -232, -247, -269, -291, -313, - -336, -357, -379, -400, -422, -447, -473, -498, - -524, -546, -569, -591, -614, -660, -707, -689, - -672, -698, -724, -750, -776, -776, -776, -776, - +268, +312, +357, +273, +191, +181, +172, +162, - +154, +144, +134, +124, +114, +108, +102, +80, - +58, +56, +54, +52, +50, +24, -2, -44, - -86, -61, -38, -93, -149, -137, -124, -144, - -165, -170, -175, -196, -218, -235, -252, -269, - -288, -310, -334, -357, -381, -409, -439, -468, - -498, -520, -543, -565, -589, -647, -706, -668, - -632, -663, -694, -725, -756, -756, -756, -756, - +368, +401, +434, +339, +244, +237, +230, +223, - +216, +200, +184, +168, +152, +152, +152, +120, - +88, +94, +100, +106, +112, +86, +60, +2, - -56, -18, +19, -39, -98, -76, -55, -97, - -140, -136, -133, -161, -190, -202, -215, -227, - -240, -265, -290, -315, -340, -373, -406, -439, - -472, -495, -518, -541, -564, -635, -706, -649, - -592, -628, -664, -700, -736, -736, -736, -736, - +404, +556, +454, +383, +313, +531, +239, +282, - +326, +304, +282, +260, +238, +246, +254, +118, - +238, +196, +154, +32, -90, -88, -86, +76, - +238, +243, +247, +29, -191, -232, -272, -121, - +29, -62, -153, -149, -145, -162, -180, -197, - -216, -240, -265, -289, -315, -345, -376, -406, - -438, -446, -456, -497, -539, -595, -653, -502, - -608, -625, -642, -675, -708, -708, -708, -708, - +440, +713, +475, +428, +382, +827, +249, +342, - +436, +408, +380, +352, +324, +340, +356, -140, - -124, +42, +208, +214, +220, +250, +280, +406, - +532, +504, +476, +352, +229, +125, +22, -146, - -314, -244, -175, -138, -101, -123, -146, -169, - -192, -216, -241, -265, -290, -318, -347, -375, - -404, -399, -395, -454, -514, -557, -601, -356, - -624, -622, -620, -650, -680, -680, -680, -680, - +604, +677, +495, +457, +419, +770, +354, +386, - +418, +416, +414, +380, +346, +258, -342, -302, - -6, +288, +582, +604, +626, +588, +550, +688, - +826, +829, +833, +724, +616, +481, +348, +181, - +15, -139, -292, -175, -56, -83, -112, -139, - -168, -192, -216, -240, -265, -291, -317, -343, - -370, -351, -333, -411, -489, -486, -484, -402, - -576, -587, -598, -625, -652, -652, -652, -652, - +1280, +1154, +1028, +998, +968, +970, +460, +430, - +400, +424, +448, +408, +368, +432, -528, -208, - +112, +534, +956, +994, +1032, +926, +820, +970, - +1120, +1155, +1190, +1097, +1004, +839, +674, +509, - +344, +223, +102, +45, -12, -45, -78, -111, - -144, -168, -192, -216, -240, -264, -288, -312, - -336, -304, -272, -368, -464, -416, -368, -448, - -528, -552, -576, -600, -624, -624, -624, -624, - +770, +671, +573, +554, +536, +629, +467, +464, - +462, +492, +523, +490, +457, +281, -405, -101, - +204, +599, +995, +1310, +1370, +1297, +1225, +1296, - +1368, +1432, +1498, +1402, +1308, +1184, +1062, +874, - +688, +586, +485, +303, +123, -82, -32, -76, - -122, -174, -226, -199, -171, -193, -216, -238, - -261, -314, -368, -325, -283, -360, -438, -451, - -465, -515, -565, -583, -601, -617, -633, -633, - +772, +701, +630, +623, +616, +545, +474, +499, - +524, +561, +599, +572, +546, +131, -283, +6, - +296, +665, +1034, +1627, +1708, +1669, +1630, +1623, - +1616, +1711, +1806, +1709, +1612, +1531, +1450, +1241, - +1032, +950, +869, +563, +258, -120, +15, -42, - -100, -180, -261, -182, -103, -123, -144, -165, - -186, -325, -464, -283, -102, -305, -508, -455, - -402, -478, -554, -566, -578, -610, -642, -642, - +774, +730, +687, +675, +664, +620, +577, +581, - +586, +597, +610, +590, +571, -147, -96, +209, - +516, +794, +1073, +1575, +1822, +1976, +1875, +1869, - +1864, +1988, +2114, +2014, +1916, +1876, +1838, +1606, - +1376, +1266, +1156, +902, +137, -61, -3, -120, - -238, -122, -7, -69, -130, -164, -200, -219, - -239, -271, -304, -128, -209, -297, -386, -426, - -467, -937, -895, -549, -459, -667, -619, -619, - +776, +760, +744, +728, +712, +696, +680, +664, - +648, +635, +622, +609, +596, -425, +90, +413, - +736, +924, +1112, +1524, +1936, +2284, +2120, +2116, - +2112, +2267, +2422, +2321, +2220, +2223, +2226, +1973, - +1720, +1582, +1444, +1242, +16, -2, -20, +58, - +136, -65, -267, -212, -158, -207, -257, -274, - -292, -218, -144, +26, -316, -290, -264, -142, - -20, +2956, +2860, -788, -852, -980, -596, -596, - +826, +807, +789, +770, +752, +749, +747, +744, - +742, +677, +613, +516, +421, -285, +288, +573, - +860, +1081, +1303, +1668, +2034, +2313, +2337, +2344, - +2352, +2452, +2554, +2574, +2596, +2506, +2418, +2248, - +2080, +1961, +1843, +925, +7, +40, +74, +748, - +654, +453, +251, +48, -154, -107, -61, -111, - -161, -28, +104, +45, -271, -274, -278, -842, - +1411, +3007, +3323, +327, -1389, -1197, -493, -493, - +876, +855, +834, +813, +792, +803, +814, +825, - +836, +720, +605, +681, +758, +110, +487, +735, - +984, +1239, +1494, +1813, +2132, +2343, +2554, +2573, - +2592, +2639, +2686, +2829, +2972, +2791, +2610, +2525, - +2440, +2341, +2243, +608, -2, +83, +169, +1438, - +1172, +970, +768, +565, +363, +249, +135, +52, - -30, -95, -160, -193, -226, -259, -292, +763, - -742, +2290, +1738, -1118, -902, -902, -390, -390, - +926, +902, +879, +855, +832, +824, +817, +809, - +802, +763, +724, +397, +2375, +970, +589, +848, - +1108, +1396, +1685, +1941, +2198, +2468, +2739, +2785, - +2832, +2888, +2946, +3178, +2900, +3058, +2962, +2848, - +2736, +2896, +2546, -364, +309, +205, +871, +1760, - +1626, +1471, +1317, +1145, +975, +844, +714, +599, - +485, +351, +216, +146, +75, -355, +750, +2687, - +529, -1067, -615, -835, -799, -847, -383, -383, - +976, +950, +924, +898, +872, +846, +820, +794, - +768, +806, +844, +882, +1432, +2598, +692, +962, - +1232, +1554, +1876, +2070, +2264, +2594, +2924, +2998, - +3072, +3139, +3206, +3273, +2316, +3071, +3314, +3173, - +3032, +2941, +1826, -57, +108, +73, +1574, +2083, - +2080, +1973, +1866, +1727, +1588, +1441, +1294, +1147, - +1000, +796, +592, +484, +376, +828, +256, +772, - -248, -72, -408, +984, -184, -536, -376, -376, - +1026, +997, +969, +941, +913, +888, +864, +840, - +816, +762, +709, +768, +1339, +2269, +2176, +1411, - +1414, +1677, +1941, +2188, +2436, +2730, +3023, +3157, - +3291, +3349, +3409, +3420, +2152, +3000, +3594, +3403, - +3213, +3233, +951, +12, +97, -303, +2883, +2755, - +2373, +2312, +2252, +2143, +2036, +1861, +1687, +1544, - +1403, +1254, +1106, +974, +842, +1229, +1105, +21, - +217, +46, -381, +1912, +3181, +2765, +301, -723, - +1076, +1045, +1015, +984, +954, +931, +909, +886, - +864, +719, +575, +654, +1246, +1685, +3149, +1604, - +1596, +1801, +2006, +2307, +2609, +2866, +3123, +3316, - +3510, +3561, +3613, +3568, +1988, +2931, +3875, +3634, - +3394, +3527, +76, +81, +86, +859, +3168, +2917, - +2666, +2652, +2639, +2561, +2484, +2282, +2081, +1943, - +1806, +1713, +1621, +1464, +1308, +1119, +931, +550, - +170, -92, -354, +1560, +3986, +1970, -558, -558, - +1126, +1092, +1060, +1027, +995, +973, +953, +932, - +912, +899, +888, -340, +1249, +1756, +2521, +2421, - +1810, +2036, +2263, +2521, +2781, +3066, +3350, +3443, - +3537, +3612, +3688, +3476, +2496, +3021, +3803, +3833, - +3863, +2843, +33, +133, -21, +2099, +3197, +3061, - +2927, +2944, +2961, +2882, +2804, +2607, +2410, +2309, - +2209, +2139, +2071, +1842, +1614, +1328, +1044, +663, - +283, +10, -263, -488, -201, -201, -457, -457, - +1176, +1141, +1106, +1071, +1036, +1017, +998, +979, - +960, +825, +690, +203, +740, +1573, +1894, +3239, - +2024, +2272, +2521, +2737, +2954, +3010, +3067, +3315, - +3564, +3664, +3764, +3384, +3004, +3112, +3732, +3776, - +3820, +1905, -10, +187, -128, +3341, +3226, +3207, - +3188, +3236, +3284, +3204, +3124, +2932, +2740, +2676, - +2612, +2567, +2522, +2221, +1920, +1539, +1158, +777, - +396, +112, -172, -488, -292, -324, -356, -356, - +1194, +1162, +1131, +1099, +1069, +1047, +1026, +972, - +920, +969, +507, +380, +767, +1428, +1834, +2799, - +2486, +2347, +2721, +2919, +3118, +3290, +3462, +3266, - +3071, +3157, +3243, +3521, +3800, +3674, +3548, +3710, - +3873, +874, +179, +91, +517, +3439, +3291, +3333, - +3377, +3403, +3430, +3361, +3292, +3174, +3057, +3004, - +2951, +2761, +2572, +2222, +1874, +1554, +1235, +883, - +533, +220, -93, -470, -335, -319, -303, -303, - +1212, +1184, +1157, +1129, +1102, +1078, +1055, +967, - +880, +1114, +325, +559, +794, +1284, +1775, +2361, - +2948, +2423, +2923, +3103, +3283, +3314, +3346, +3474, - +3602, +3674, +3747, +3659, +3572, +3980, +3877, +3901, - +3926, -157, +368, +253, +1674, +3795, +3356, +3461, - +3566, +3571, +3577, +3518, +3460, +3417, +3375, +3332, - +3290, +2956, +2623, +2225, +1828, +1570, +1313, +991, - +670, +328, -14, -452, -378, -314, -250, -250, - +1230, +1206, +1182, +1158, +1135, +1109, +1083, +1025, - +968, +779, +78, +481, +885, +1284, +1939, +2466, - +3250, +2626, +2772, +3157, +3543, +3514, +3486, +3729, - +3717, +3775, +3834, +3780, +3728, +3934, +3885, +3915, - +2667, +92, +333, +173, +2831, +3701, +3549, +3587, - +3627, +3642, +3659, +3643, +3628, +3675, +3724, +3436, - +3149, +2847, +2545, +2275, +2006, +1730, +1454, +1114, - +775, +388, +1, -402, -293, -309, -325, -325, - +1248, +1228, +1208, +1188, +1168, +1140, +1112, +1084, - +1056, +700, +344, +660, +976, +1284, +2104, +2316, - +3040, +2319, +2110, +2189, +2268, +2691, +3114, +3729, - +3832, +3877, +3922, +3903, +3884, +3889, +3894, +3931, - +1408, +341, +298, +95, +3988, +3609, +3742, +3715, - +3688, +3715, +3742, +3769, +3796, +3679, +3562, +3285, - +3008, +2738, +2468, +2326, +2184, +1890, +1596, +1238, - +880, +448, +16, -352, -208, -304, -400, -400, - +1296, +1284, +1272, +1260, +1249, +1165, +1081, +1093, - +1106, +232, +382, +677, +971, +973, +1232, +834, - +693, +537, +639, +564, +490, +563, +637, -106, - +944, +2358, +3773, +3795, +4074, +3964, +3855, +4337, - +212, +204, +197, +1341, +4023, +3813, +3860, +3810, - +3762, +3766, +3771, +3776, +3781, +3603, +3427, +3201, - +2977, +2838, +2699, +2400, +2101, +1982, +1607, +1280, - +954, +545, -120, -321, -266, -314, -362, -362, - +1344, +1340, +1337, +1333, +1330, +1190, +1051, +1103, - +1156, +20, +933, +950, +967, +919, +872, +889, - +906, +805, +705, +733, +761, +740, +720, +668, - +616, +328, +40, +1640, +3752, +3784, +3816, +3208, - +40, +581, +97, +2589, +4058, +4018, +3979, +3907, - +3836, +3818, +3801, +3784, +3767, +3529, +3292, +3375, - +3458, +3706, +3954, +3754, +3555, +2843, +1619, +1067, - +516, +386, -256, -290, -324, -324, -324, -324, - +1392, +1364, +1337, +1309, +1283, +1247, +1212, +968, - +982, +1424, +1099, +1079, +1058, +1072, +1088, +815, - +799, +1056, +802, +772, +743, +645, +547, +769, - +736, +649, +563, +332, +102, +1939, +4033, +1982, - +444, +332, -36, +4076, +4093, +4047, +4001, +3955, - +3910, +3870, +3830, +3791, +3752, +3806, +3861, +3835, - +3811, +3678, +3545, +3380, +3216, +3639, +3806, +2341, - +1134, +1091, +24, -387, -286, -286, -286, -286, - +1440, +1389, +1338, +1287, +1236, +1305, +1374, +1091, - +1320, +1037, +1267, +1208, +1150, +715, +281, +486, - +1204, +1564, +901, +1325, +1750, +1830, +1911, +1383, - +344, +459, +574, +817, +548, +351, +666, +757, - +336, +340, +856, +4028, +4128, +4076, +4024, +4004, - +3984, +3922, +3861, +3799, +3738, +3828, +3919, +3785, - +3652, +3394, +3137, +3007, +2878, +2900, +2923, +3105, - +3800, +1284, +1328, +28, -248, -248, -248, -248, - +1456, +1406, +1358, +1309, +1261, +1209, +1159, +1444, - +1218, +1265, +33, -654, -1342, -977, -356, +394, - +1401, +1753, +1338, +1738, +2140, +2575, +3009, +3524, - +3784, +2536, +1033, +265, +522, +440, +615, +629, - +388, +403, +2211, +4051, +4099, +4078, +4058, +3990, - +3922, +3910, +3898, +3886, +3875, +3805, +3735, +3553, - +3373, +3126, +2879, +2585, +2291, +2026, +1762, +2649, - +3026, +2303, +2092, +665, -250, -250, -250, -250, - +1472, +1425, +1379, +1332, +1286, +1371, +1457, +1030, - -932, -1834, -1712, -1237, -763, -621, +33, +815, - +1598, +1943, +1776, +2153, +2531, +2808, +3085, +3362, - +3640, +4102, +4052, +3042, +496, +530, +564, +502, - +440, +211, +3055, +3818, +4070, +4081, +4093, +3976, - +3860, +3898, +3936, +3974, +4013, +3783, +3553, +3323, - +3094, +2858, +2623, +2420, +2217, +1921, +1626, +915, - +2764, +250, +296, +22, -252, -252, -252, -252, - +1488, +1443, +1399, +1371, +1343, +1308, +1530, -408, - -1834, -1589, -1089, -811, -535, -281, +485, +1171, - +1859, +2132, +2150, +2503, +2857, +3105, +3352, +3536, - +3720, +3875, +3775, +4298, +4054, +2123, +449, +502, - +556, +546, +26, +2113, +3945, +4115, +4031, +3946, - +3862, +3838, +3814, +3982, +3894, +3488, +3338, +3140, - +2943, +2622, +2302, +2030, +1758, +1495, +1234, +1259, - +774, -347, -188, -189, -190, -222, -254, -254, - +1504, +1462, +1420, +1410, +1400, +1246, +1604, -1334, - -1712, -1089, -978, -643, -308, +59, +938, +1529, - +2120, +2322, +2524, +2854, +3184, +3402, +3620, +3710, - +3800, +3905, +4010, +4019, +4028, +3973, +334, +503, - +672, +627, +582, +409, +236, +2359, +3970, +3917, - +3864, +3778, +3692, +3990, +3776, +3194, +3124, +2958, - +2792, +2387, +1982, +1641, +1300, +1071, +842, +69, - -192, -176, -160, -144, -128, -192, -256, -256, - +1546, +1496, +1447, +1430, +1413, +1627, +1330, -2102, - -1184, -819, -712, -395, -80, +405, +1148, +1713, - +2280, +2486, +2692, +2995, +3297, +3467, +3638, +3712, - +3787, +3915, +4045, +3917, +4047, +3097, +357, +655, - +699, +198, +466, +381, +297, +376, +200, +1815, - +3431, +3568, +3961, +4114, +3755, +3310, +3121, +2804, - +2487, +2208, +1931, +1189, +447, +37, -116, -254, - -136, -111, -86, -109, -132, -196, -260, -260, - +1588, +1531, +1475, +1450, +1426, +1497, +33, -1591, - -1168, -807, -446, -149, +148, +753, +1358, +1899, - +2440, +2650, +2861, +3136, +3411, +3533, +3656, +3715, - +3774, +3927, +4080, +3817, +4066, +2223, +380, +553, - +214, +3610, +350, +354, +358, +442, +526, +226, - -74, +286, +1158, +1678, +1686, +1634, +1582, +1114, - +646, +239, -168, -31, +107, -228, -51, -65, - -80, -46, -12, -74, -136, -200, -264, -264, - +1630, +1565, +1502, +1470, +1439, +1590, -817, -1399, - -960, -633, -308, -14, +280, +875, +1472, +1971, - +2472, +2718, +2965, +3229, +3492, +3582, +3674, +3701, - +3729, +3793, +3859, +4147, +4181, +707, +563, +417, - +1297, +3917, +4234, +2198, +163, +267, +372, +348, - +325, +108, +147, +186, -31, +38, +107, +96, - +85, +61, +38, -162, -106, -126, +111, +876, - -152, -93, -34, -87, -140, -204, -268, -268, - +1672, +1601, +1530, +1491, +1452, +1685, -1666, -1209, - -752, -461, -170, +121, +412, +999, +1586, +2045, - +2504, +2787, +3071, +3322, +3574, +3633, +3693, +3688, - +3684, +3661, +3638, +3711, +2760, +473, +746, +283, - +2380, +4225, +4022, +4043, +4064, +2141, +218, +215, - +212, +186, +160, +230, +300, +234, +168, +102, - +36, -117, -269, +218, +1218, +2025, +2833, +1048, - -224, -140, -56, -100, -144, -208, -272, -272, - +1626, +1607, +1589, +1458, +1585, +692, -1479, -1107, - -736, -451, -168, +115, +400, +805, +1468, +1937, - +2408, +2703, +2999, +3327, +3655, +3568, +3482, +3620, - +3759, +3439, +3121, +1601, +851, +819, +533, +437, - +3415, +4252, +4066, +4055, +4045, +4084, +4124, +2995, - +1867, +1068, +269, +62, -145, -38, +69, +704, - +1339, +2183, +3028, +2816, +2861, +2953, +2790, -349, - +96, -19, -134, -137, -140, -204, -268, -268, - +1580, +1614, +1649, +1427, +1718, -300, -1293, -1006, - -720, -443, -166, +111, +388, +613, +1350, +1831, - +2312, +2620, +2928, +3076, +3225, +3249, +3273, +3297, - +3322, +3475, +3628, +3333, +1502, +655, +832, +593, - +3938, +4024, +4110, +4068, +4026, +3980, +3934, +3984, - +4034, +3998, +3962, +3990, +4018, +3786, +3554, +3610, - +3666, +3459, +3253, +3111, +2969, +2858, +2236, -210, - -96, -154, -212, -174, -136, -200, -264, -264, - +1662, +1653, +1644, +1619, +1851, -988, -1266, -985, - -704, -401, -100, +9, +120, +403, +944, +1579, - +2216, +2504, +2793, +2873, +2954, +2976, +2999, +3085, - +3173, +3237, +3303, +3575, +521, +553, +587, +1771, - +3981, +4019, +4058, +4032, +4007, +3971, +3936, +3948, - +3961, +3920, +3879, +3806, +3989, +3866, +3743, +3636, - +3529, +3375, +3222, +3069, +2916, +2907, +1362, -119, - -64, -113, -162, -147, -132, -196, -260, -260, - +1744, +1692, +1640, +1556, +1472, -1932, -1240, -964, - -688, -361, -34, +165, +364, +707, +1050, +1585, - +2120, +2389, +2658, +2671, +2684, +2705, +2726, +2875, - +3024, +3001, +2978, +2283, +564, +965, +342, +2951, - +4024, +4015, +4006, +3997, +3988, +3963, +3938, +3913, - +3888, +3842, +3796, +3622, +3960, +3946, +3932, +3662, - +3392, +3292, +3192, +3028, +2864, +2956, +488, -28, - -32, -72, -112, -120, -128, -192, -256, -256, - +1834, +1635, +1692, +1718, +208, -1663, -1229, -924, - -619, -283, +50, +256, +719, +705, +948, +1126, - +1562, +1845, +2129, +2236, +2344, +2447, +2551, +2654, - +2759, +2738, +2719, +1562, +663, +623, +327, +4207, - +3992, +4012, +4034, +3990, +3948, +3922, +3898, +3872, - +3848, +3774, +3701, +3484, +3523, +3726, +3929, +3812, - +3695, +3604, +3513, +3407, +3300, +3350, -440, -231, - -22, -48, -74, -100, -126, -174, -222, -222, - +1924, +1578, +1745, +1880, -1057, -1394, -1219, -884, - -550, -207, +135, +93, +563, +449, +847, +669, - +1004, +1302, +1600, +1802, +2005, +2191, +2377, +2435, - +2494, +2477, +2460, +843, +763, +794, +1337, +3928, - +3960, +4011, +4062, +3985, +3908, +3883, +3858, +3833, - +3808, +3707, +3607, +3603, +3599, +3506, +3414, +3706, - +3998, +3916, +3835, +3786, +3737, +2208, -345, +78, - -12, -24, -36, -80, -124, -156, -188, -188, - +1598, +1585, +1829, +2154, -1873, -1413, -1208, -556, - -417, -514, -102, +440, +214, +191, +681, +435, - +702, +870, +1039, +1224, +1409, +1709, +2010, +2039, - +2069, +2086, +1849, +795, +766, +596, +2474, +3953, - +3896, +3928, +3962, +3914, +3868, +3842, +3818, +3792, - +3768, +3687, +3608, +3577, +3546, +3462, +3379, +3312, - +3245, +3364, +3484, +3189, +2893, +858, -154, +35, - -34, -48, -62, -108, -154, -154, -154, -154, - +1784, +1849, +1915, +892, -1666, -1176, -1711, -741, - -796, -822, +175, -748, +378, +191, +517, +202, - +400, +439, +479, +646, +814, +1229, +1645, +1644, - +1644, +1697, +1239, +748, +770, +399, +3613, +3978, - +3832, +3847, +3862, +3845, +3828, +3803, +3778, +3753, - +3728, +3669, +3611, +3552, +3494, +3419, +3345, +3174, - +3004, +2813, +2623, +2592, +2562, -237, +37, -9, - -56, -72, -88, -136, -184, -152, -120, -120, - +1802, +1900, +2255, -286, -1290, -1129, -712, -391, - -327, -385, -445, +201, -178, +436, +27, -45, - -118, +204, +270, +384, +498, +685, +874, +998, - +1123, +1252, +1127, +794, +717, +1161, +3654, +3843, - +3776, +3788, +3802, +3782, +3764, +3616, +3726, +3690, - +3656, +3595, +3536, +3476, +3417, +3341, +3265, +3078, - +2891, +2687, +2484, +2617, +1982, -28, +8, +14, - +18, -18, -54, +6, +66, -30, -126, -126, - +1820, +1696, +2084, -2232, -1939, -570, -1762, -1834, - -1394, -461, -552, -387, -223, -1110, -462, -37, - -124, -31, -451, -134, +183, +143, +104, +353, - +602, +809, +1017, +841, +665, +1924, +3696, +3708, - +3720, +3731, +3742, +3721, +3700, +3431, +3674, +3629, - +3584, +3523, +3462, +3401, +3341, +3264, +3187, +2982, - +2778, +2562, +2346, +2386, +891, -77, -20, +36, - +92, +36, -20, -108, -196, -164, -132, -132, - +1710, +1955, +1177, -2833, -955, -2075, -2172, -364, - -1885, -1352, -820, -1599, -843, -1249, -887, -652, - -674, -554, -435, -636, -325, -304, -282, -101, - -175, +493, +906, +871, +580, +2767, +3674, +3653, - +3632, +3656, +3682, +3626, +3572, +3436, +3558, +3534, - +3512, +3449, +3388, +3325, +3264, +3186, +3108, +2902, - +2697, +2500, +2304, +2219, +343, +179, +271, +154, - +38, -6, -50, -110, -170, -154, -138, -138, - +1600, +1959, -242, -2667, -2020, -2557, -2582, -1455, - +696, +316, +960, +2052, +2120, +1940, +1760, +1292, - +824, -310, -932, -1394, -832, -750, -668, -298, - -440, +434, +796, +902, +496, +3610, +3652, +3598, - +3544, +3583, +3622, +3533, +3444, +3443, +3442, +3441, - +3440, +3377, +3314, +3251, +3188, +3109, +3030, +2823, - +2616, +2439, +2262, +2053, -204, +179, +50, +17, - -16, -48, -80, -112, -144, -144, -144, -144, - +1956, +1852, -2091, -3025, -1145, +322, +2045, +1672, - +1555, +1328, +1614, +1916, +1706, +1622, +1282, +1502, - +1466, +1301, +1393, +940, -792, -1548, -768, -820, - -617, +926, +934, +909, +1397, +3323, +3456, +3446, - +3436, +3393, +3351, +3388, +3426, +3373, +3321, +3444, - +3313, +3264, +3217, +3153, +3090, +2997, +2906, +2686, - +2467, +2290, +2115, +1282, -61, +136, +79, +36, - -5, -37, -69, -101, -133, -133, -133, -133, - +1800, +1746, +669, +1992, +1779, +1665, +1552, +1727, - +1390, +1317, +1245, +1269, +1293, +1560, +1316, +1456, - +1084, +1121, +1158, +971, +1297, +726, -869, -1343, - -794, +1419, +1072, +917, +2299, +3036, +3261, +3294, - +3328, +3204, +3080, +3244, +3409, +3305, +3201, +3449, - +3186, +3153, +3121, +3056, +2992, +2887, +2783, +2550, - +2318, +2143, +1968, +513, +82, +95, +108, +57, - +6, -26, -58, -90, -122, -122, -122, -122, - +1516, +1832, +1636, +1905, +1406, +1344, +1283, +1589, - +1641, +1465, +1291, +1277, +1263, +1386, +1254, +1314, - +1118, +1116, +1115, +905, +953, +1160, +1111, +118, - -363, +807, +698, +700, +2240, +3325, +2361, +2934, - +3252, +2998, +2745, +2924, +3103, +3155, +2952, +3277, - +3091, +3057, +3024, +2959, +2894, +2776, +2659, +2414, - +2169, +2074, +1981, +255, +65, +68, +73, +44, - +17, -15, -47, -79, -111, -111, -111, -111, - +1744, +1662, +1581, +1563, +1546, +1536, +1527, +1453, - +1380, +1359, +1339, +1286, +1234, +1213, +1193, +1172, - +1152, +1112, +1073, +1097, +1122, +826, +1043, +1067, - +1092, +964, +837, +741, +2182, +2078, +2487, +2831, - +2664, +2793, +2923, +2860, +2798, +3007, +2705, +3106, - +2996, +2962, +2928, +2862, +2796, +2666, +2536, +2278, - +2020, +1751, +1482, -259, +48, +43, +38, +33, - +28, -4, -36, -68, -100, -100, -100, -100, - +1684, +1640, +1596, +1584, +1573, +1543, +1513, +1451, - +1391, +1359, +1329, +1282, +1236, +1213, +1190, +1168, - +1146, +1107, +1069, +1063, +1058, +920, +1038, +996, - +955, +924, +894, +880, +1635, +1679, +2235, +2439, - +2132, +2451, +2771, +2580, +2644, +2713, +2528, +2742, - +2701, +2828, +2699, +2570, +2442, +2383, +2324, +2105, - +1887, +1732, +811, -79, +55, +62, +71, +46, - +23, -7, -37, -67, -97, -113, -129, -129, - +1624, +1618, +1612, +1606, +1601, +1551, +1501, +1451, - +1402, +1361, +1320, +1279, +1239, +1214, +1189, +1164, - +1140, +1103, +1067, +1031, +995, +1014, +1034, +926, - +818, +885, +953, +1021, +1089, +1024, +1472, +2048, - +2112, +2110, +2109, +2044, +2491, +2421, +2352, +2379, - +2406, +2694, +2471, +2279, +2088, +2100, +2113, +1933, - +1754, +1715, +140, +101, +62, +83, +104, +61, - +18, -10, -38, -66, -94, -126, -158, -158, - +1724, +1788, +1852, +1692, +1532, +1494, +1456, +1418, - +1381, +1345, +1311, +1275, +1241, +1214, +1187, +1160, - +1134, +1098, +1064, +1029, +995, +996, +998, +935, - +873, +877, +883, +792, +702, +657, +1125, +1832, - +2284, +1193, +1638, +1796, +2209, +2320, +2176, +2239, - +2047, +2560, +2562, +1891, +1734, +1673, +1613, +1744, - +1621, +1152, -83, -8, +69, +70, +73, +42, - +13, -13, -39, -65, -91, -139, -187, -187, - +1824, +1702, +1580, +1522, +1464, +1438, +1412, +1386, - +1360, +1331, +1302, +1273, +1244, +1215, +1186, +1157, - +1128, +1095, +1062, +1029, +996, +979, +962, +945, - +928, +871, +814, +821, +828, +803, +1290, +1617, - +1944, +2068, +1168, +1292, +1416, +1708, +1488, +1844, - +1688, +2171, +2142, +1249, +1380, +1503, +1626, +1045, - -48, +79, +206, +141, +76, +59, +42, +25, - +8, -16, -40, -64, -88, -152, -216, -216, - +1688, +1615, +1542, +1501, +1460, +1429, +1398, +1367, - +1336, +1309, +1284, +1257, +1232, +1205, +1180, +1153, - +1128, +1092, +1058, +1022, +988, +968, +950, +930, - +912, +861, +812, +793, +776, +595, +672, +971, - +1272, +330, +924, +1038, +1152, +1298, +1444, +1910, - +1608, +1531, +1200, +515, +344, +259, +176, +251, - +72, +122, +174, +128, +84, +64, +46, +26, - +8, -18, -44, -70, -96, -144, -192, -192, - +1552, +1528, +1504, +1480, +1456, +1420, +1384, +1348, - +1312, +1289, +1266, +1243, +1220, +1197, +1174, +1151, - +1128, +1091, +1054, +1017, +980, +959, +938, +917, - +896, +853, +810, +767, +724, +645, +566, +583, - +600, +640, +680, +528, +376, +376, +888, +1464, - +1016, +637, +258, +295, +332, +297, +262, +227, - +192, +167, +142, +117, +92, +71, +50, +29, - +8, -20, -48, -76, -104, -136, -168, -168, - +1544, +1521, +1498, +1475, +1452, +1411, +1370, +1329, - +1288, +1267, +1248, +1227, +1208, +1187, +1168, +1147, - +1128, +1088, +1050, +1010, +972, +948, +926, +902, - +880, +843, +808, +771, +736, +677, +620, +609, - +600, +614, +628, +546, +464, +238, +2060, +1690, - +1576, +1709, +308, +313, +320, +285, +252, +217, - +184, +162, +142, +120, +100, +76, +54, +30, - +8, -22, -52, -82, -112, -128, -144, -144, - +1536, +1514, +1492, +1470, +1448, +1402, +1356, +1310, - +1264, +1247, +1230, +1213, +1196, +1179, +1162, +1145, - +1128, +1087, +1046, +1005, +964, +939, +914, +889, - +864, +835, +806, +777, +748, +711, +674, +637, - +600, +588, +576, +564, +552, +612, +160, +1916, - +1112, +223, +358, +333, +308, +275, +242, +209, - +176, +159, +142, +125, +108, +83, +58, +33, - +8, -24, -56, -88, -120, -120, -120, -120, - +1536, +1514, +1492, +1470, +1448, +1402, +1356, +1310, - +1264, +1246, +1230, +1212, +1196, +1178, +1162, +1144, - +1128, +1086, +1046, +1004, +964, +938, +914, +888, - +864, +834, +806, +776, +748, +710, +674, +636, - +600, +588, +576, +564, +552, +644, +480, +108, - +504, +158, +326, +316, +308, +274, +242, +208, - +176, +158, +142, +124, +108, +82, +58, +32, - +8, -24, -56, -88, -120, -120, -120, -120, - +1536, +1514, +1492, +1470, +1448, +1402, +1356, +1310, - +1264, +1247, +1230, +1213, +1196, +1179, +1162, +1145, - +1128, +1087, +1046, +1005, +964, +939, +914, +889, - +864, +835, +806, +777, +748, +711, +674, +637, - +600, +588, +576, +564, +552, +420, +288, +348, - +408, +351, +294, +301, +308, +275, +242, +209, - +176, +159, +142, +125, +108, +83, +58, +33, - +8, -24, -56, -88, -120, -120, -120, -120, - +1536, +1514, +1492, +1470, +1448, +1402, +1356, +1310, - +1264, +1246, +1230, +1212, +1196, +1178, +1162, +1144, - +1128, +1086, +1046, +1004, +964, +938, +914, +888, - +864, +834, +806, +776, +748, +710, +674, +636, - +600, +588, +576, +564, +552, +420, +288, +348, - +408, +350, +294, +300, +308, +274, +242, +208, - +176, +158, +142, +124, +108, +82, +58, +32, - +8, -24, -56, -88, -120, -120, -120, -120 +static const INT16 TEST_Y_COMPONENT[4096] = { + -32, +16, +64, +272, -32, -16, +0, -16, -32, -24, -16, -8, +0, + -24, -48, -72, -96, -90, -84, -78, -72, -98, -124, -150, -176, -192, + -208, -224, -240, -256, -272, -288, -304, -304, -304, -304, -304, -336, -368, + -400, -432, -450, -468, -486, -504, -522, -540, -558, -576, -598, -620, -642, + -664, -686, -708, -730, -752, -768, -784, -800, -816, -816, -816, -816, +68, + +120, +172, +240, +53, +55, +57, +43, +30, +32, +34, +36, +38, +20, + +2, -16, -34, -36, -38, -40, -42, -68, -94, -120, -146, -148, -151, + -186, -220, -227, -233, -240, -247, -254, -261, -268, -275, -302, -329, -356, + -384, -403, -423, -443, -463, -484, -506, -528, -550, -572, -594, -616, -639, + -673, -707, -709, -712, -733, -754, -775, -796, -796, -796, -796, +168, +224, + +281, +209, +138, +126, +115, +103, +92, +88, +84, +80, +76, +64, +52, + +40, +28, +18, +8, -2, -12, -38, -64, -90, -116, -105, -95, -148, + -201, -198, -195, -192, -190, -204, -218, -232, -247, -269, -291, -313, -336, + -357, -379, -400, -422, -447, -473, -498, -524, -546, -569, -591, -614, -660, + -707, -689, -672, -698, -724, -750, -776, -776, -776, -776, +268, +312, +357, + +273, +191, +181, +172, +162, +154, +144, +134, +124, +114, +108, +102, +80, + +58, +56, +54, +52, +50, +24, -2, -44, -86, -61, -38, -93, -149, + -137, -124, -144, -165, -170, -175, -196, -218, -235, -252, -269, -288, -310, + -334, -357, -381, -409, -439, -468, -498, -520, -543, -565, -589, -647, -706, + -668, -632, -663, -694, -725, -756, -756, -756, -756, +368, +401, +434, +339, + +244, +237, +230, +223, +216, +200, +184, +168, +152, +152, +152, +120, +88, + +94, +100, +106, +112, +86, +60, +2, -56, -18, +19, -39, -98, -76, + -55, -97, -140, -136, -133, -161, -190, -202, -215, -227, -240, -265, -290, + -315, -340, -373, -406, -439, -472, -495, -518, -541, -564, -635, -706, -649, + -592, -628, -664, -700, -736, -736, -736, -736, +404, +556, +454, +383, +313, + +531, +239, +282, +326, +304, +282, +260, +238, +246, +254, +118, +238, +196, + +154, +32, -90, -88, -86, +76, +238, +243, +247, +29, -191, -232, -272, + -121, +29, -62, -153, -149, -145, -162, -180, -197, -216, -240, -265, -289, + -315, -345, -376, -406, -438, -446, -456, -497, -539, -595, -653, -502, -608, + -625, -642, -675, -708, -708, -708, -708, +440, +713, +475, +428, +382, +827, + +249, +342, +436, +408, +380, +352, +324, +340, +356, -140, -124, +42, +208, + +214, +220, +250, +280, +406, +532, +504, +476, +352, +229, +125, +22, -146, + -314, -244, -175, -138, -101, -123, -146, -169, -192, -216, -241, -265, -290, + -318, -347, -375, -404, -399, -395, -454, -514, -557, -601, -356, -624, -622, + -620, -650, -680, -680, -680, -680, +604, +677, +495, +457, +419, +770, +354, + +386, +418, +416, +414, +380, +346, +258, -342, -302, -6, +288, +582, +604, + +626, +588, +550, +688, +826, +829, +833, +724, +616, +481, +348, +181, +15, + -139, -292, -175, -56, -83, -112, -139, -168, -192, -216, -240, -265, -291, + -317, -343, -370, -351, -333, -411, -489, -486, -484, -402, -576, -587, -598, + -625, -652, -652, -652, -652, +1280, +1154, +1028, +998, +968, +970, +460, +430, + +400, +424, +448, +408, +368, +432, -528, -208, +112, +534, +956, +994, +1032, + +926, +820, +970, +1120, +1155, +1190, +1097, +1004, +839, +674, +509, +344, +223, + +102, +45, -12, -45, -78, -111, -144, -168, -192, -216, -240, -264, -288, + -312, -336, -304, -272, -368, -464, -416, -368, -448, -528, -552, -576, -600, + -624, -624, -624, -624, +770, +671, +573, +554, +536, +629, +467, +464, +462, + +492, +523, +490, +457, +281, -405, -101, +204, +599, +995, +1310, +1370, +1297, + +1225, +1296, +1368, +1432, +1498, +1402, +1308, +1184, +1062, +874, +688, +586, +485, + +303, +123, -82, -32, -76, -122, -174, -226, -199, -171, -193, -216, -238, + -261, -314, -368, -325, -283, -360, -438, -451, -465, -515, -565, -583, -601, + -617, -633, -633, +772, +701, +630, +623, +616, +545, +474, +499, +524, +561, + +599, +572, +546, +131, -283, +6, +296, +665, +1034, +1627, +1708, +1669, +1630, + +1623, +1616, +1711, +1806, +1709, +1612, +1531, +1450, +1241, +1032, +950, +869, +563, + +258, -120, +15, -42, -100, -180, -261, -182, -103, -123, -144, -165, -186, + -325, -464, -283, -102, -305, -508, -455, -402, -478, -554, -566, -578, -610, + -642, -642, +774, +730, +687, +675, +664, +620, +577, +581, +586, +597, +610, + +590, +571, -147, -96, +209, +516, +794, +1073, +1575, +1822, +1976, +1875, +1869, + +1864, +1988, +2114, +2014, +1916, +1876, +1838, +1606, +1376, +1266, +1156, +902, +137, + -61, -3, -120, -238, -122, -7, -69, -130, -164, -200, -219, -239, -271, + -304, -128, -209, -297, -386, -426, -467, -937, -895, -549, -459, -667, -619, + -619, +776, +760, +744, +728, +712, +696, +680, +664, +648, +635, +622, +609, + +596, -425, +90, +413, +736, +924, +1112, +1524, +1936, +2284, +2120, +2116, +2112, + +2267, +2422, +2321, +2220, +2223, +2226, +1973, +1720, +1582, +1444, +1242, +16, -2, + -20, +58, +136, -65, -267, -212, -158, -207, -257, -274, -292, -218, -144, + +26, -316, -290, -264, -142, -20, +2956, +2860, -788, -852, -980, -596, -596, + +826, +807, +789, +770, +752, +749, +747, +744, +742, +677, +613, +516, +421, + -285, +288, +573, +860, +1081, +1303, +1668, +2034, +2313, +2337, +2344, +2352, +2452, + +2554, +2574, +2596, +2506, +2418, +2248, +2080, +1961, +1843, +925, +7, +40, +74, + +748, +654, +453, +251, +48, -154, -107, -61, -111, -161, -28, +104, +45, + -271, -274, -278, -842, +1411, +3007, +3323, +327, -1389, -1197, -493, -493, +876, + +855, +834, +813, +792, +803, +814, +825, +836, +720, +605, +681, +758, +110, + +487, +735, +984, +1239, +1494, +1813, +2132, +2343, +2554, +2573, +2592, +2639, +2686, + +2829, +2972, +2791, +2610, +2525, +2440, +2341, +2243, +608, -2, +83, +169, +1438, + +1172, +970, +768, +565, +363, +249, +135, +52, -30, -95, -160, -193, -226, + -259, -292, +763, -742, +2290, +1738, -1118, -902, -902, -390, -390, +926, +902, + +879, +855, +832, +824, +817, +809, +802, +763, +724, +397, +2375, +970, +589, + +848, +1108, +1396, +1685, +1941, +2198, +2468, +2739, +2785, +2832, +2888, +2946, +3178, + +2900, +3058, +2962, +2848, +2736, +2896, +2546, -364, +309, +205, +871, +1760, +1626, + +1471, +1317, +1145, +975, +844, +714, +599, +485, +351, +216, +146, +75, -355, + +750, +2687, +529, -1067, -615, -835, -799, -847, -383, -383, +976, +950, +924, + +898, +872, +846, +820, +794, +768, +806, +844, +882, +1432, +2598, +692, +962, + +1232, +1554, +1876, +2070, +2264, +2594, +2924, +2998, +3072, +3139, +3206, +3273, +2316, + +3071, +3314, +3173, +3032, +2941, +1826, -57, +108, +73, +1574, +2083, +2080, +1973, + +1866, +1727, +1588, +1441, +1294, +1147, +1000, +796, +592, +484, +376, +828, +256, + +772, -248, -72, -408, +984, -184, -536, -376, -376, +1026, +997, +969, +941, + +913, +888, +864, +840, +816, +762, +709, +768, +1339, +2269, +2176, +1411, +1414, + +1677, +1941, +2188, +2436, +2730, +3023, +3157, +3291, +3349, +3409, +3420, +2152, +3000, + +3594, +3403, +3213, +3233, +951, +12, +97, -303, +2883, +2755, +2373, +2312, +2252, + +2143, +2036, +1861, +1687, +1544, +1403, +1254, +1106, +974, +842, +1229, +1105, +21, + +217, +46, -381, +1912, +3181, +2765, +301, -723, +1076, +1045, +1015, +984, +954, + +931, +909, +886, +864, +719, +575, +654, +1246, +1685, +3149, +1604, +1596, +1801, + +2006, +2307, +2609, +2866, +3123, +3316, +3510, +3561, +3613, +3568, +1988, +2931, +3875, + +3634, +3394, +3527, +76, +81, +86, +859, +3168, +2917, +2666, +2652, +2639, +2561, + +2484, +2282, +2081, +1943, +1806, +1713, +1621, +1464, +1308, +1119, +931, +550, +170, + -92, -354, +1560, +3986, +1970, -558, -558, +1126, +1092, +1060, +1027, +995, +973, + +953, +932, +912, +899, +888, -340, +1249, +1756, +2521, +2421, +1810, +2036, +2263, + +2521, +2781, +3066, +3350, +3443, +3537, +3612, +3688, +3476, +2496, +3021, +3803, +3833, + +3863, +2843, +33, +133, -21, +2099, +3197, +3061, +2927, +2944, +2961, +2882, +2804, + +2607, +2410, +2309, +2209, +2139, +2071, +1842, +1614, +1328, +1044, +663, +283, +10, + -263, -488, -201, -201, -457, -457, +1176, +1141, +1106, +1071, +1036, +1017, +998, + +979, +960, +825, +690, +203, +740, +1573, +1894, +3239, +2024, +2272, +2521, +2737, + +2954, +3010, +3067, +3315, +3564, +3664, +3764, +3384, +3004, +3112, +3732, +3776, +3820, + +1905, -10, +187, -128, +3341, +3226, +3207, +3188, +3236, +3284, +3204, +3124, +2932, + +2740, +2676, +2612, +2567, +2522, +2221, +1920, +1539, +1158, +777, +396, +112, -172, + -488, -292, -324, -356, -356, +1194, +1162, +1131, +1099, +1069, +1047, +1026, +972, + +920, +969, +507, +380, +767, +1428, +1834, +2799, +2486, +2347, +2721, +2919, +3118, + +3290, +3462, +3266, +3071, +3157, +3243, +3521, +3800, +3674, +3548, +3710, +3873, +874, + +179, +91, +517, +3439, +3291, +3333, +3377, +3403, +3430, +3361, +3292, +3174, +3057, + +3004, +2951, +2761, +2572, +2222, +1874, +1554, +1235, +883, +533, +220, -93, -470, + -335, -319, -303, -303, +1212, +1184, +1157, +1129, +1102, +1078, +1055, +967, +880, + +1114, +325, +559, +794, +1284, +1775, +2361, +2948, +2423, +2923, +3103, +3283, +3314, + +3346, +3474, +3602, +3674, +3747, +3659, +3572, +3980, +3877, +3901, +3926, -157, +368, + +253, +1674, +3795, +3356, +3461, +3566, +3571, +3577, +3518, +3460, +3417, +3375, +3332, + +3290, +2956, +2623, +2225, +1828, +1570, +1313, +991, +670, +328, -14, -452, -378, + -314, -250, -250, +1230, +1206, +1182, +1158, +1135, +1109, +1083, +1025, +968, +779, + +78, +481, +885, +1284, +1939, +2466, +3250, +2626, +2772, +3157, +3543, +3514, +3486, + +3729, +3717, +3775, +3834, +3780, +3728, +3934, +3885, +3915, +2667, +92, +333, +173, + +2831, +3701, +3549, +3587, +3627, +3642, +3659, +3643, +3628, +3675, +3724, +3436, +3149, + +2847, +2545, +2275, +2006, +1730, +1454, +1114, +775, +388, +1, -402, -293, -309, + -325, -325, +1248, +1228, +1208, +1188, +1168, +1140, +1112, +1084, +1056, +700, +344, + +660, +976, +1284, +2104, +2316, +3040, +2319, +2110, +2189, +2268, +2691, +3114, +3729, + +3832, +3877, +3922, +3903, +3884, +3889, +3894, +3931, +1408, +341, +298, +95, +3988, + +3609, +3742, +3715, +3688, +3715, +3742, +3769, +3796, +3679, +3562, +3285, +3008, +2738, + +2468, +2326, +2184, +1890, +1596, +1238, +880, +448, +16, -352, -208, -304, -400, + -400, +1296, +1284, +1272, +1260, +1249, +1165, +1081, +1093, +1106, +232, +382, +677, + +971, +973, +1232, +834, +693, +537, +639, +564, +490, +563, +637, -106, +944, + +2358, +3773, +3795, +4074, +3964, +3855, +4337, +212, +204, +197, +1341, +4023, +3813, + +3860, +3810, +3762, +3766, +3771, +3776, +3781, +3603, +3427, +3201, +2977, +2838, +2699, + +2400, +2101, +1982, +1607, +1280, +954, +545, -120, -321, -266, -314, -362, -362, + +1344, +1340, +1337, +1333, +1330, +1190, +1051, +1103, +1156, +20, +933, +950, +967, + +919, +872, +889, +906, +805, +705, +733, +761, +740, +720, +668, +616, +328, + +40, +1640, +3752, +3784, +3816, +3208, +40, +581, +97, +2589, +4058, +4018, +3979, + +3907, +3836, +3818, +3801, +3784, +3767, +3529, +3292, +3375, +3458, +3706, +3954, +3754, + +3555, +2843, +1619, +1067, +516, +386, -256, -290, -324, -324, -324, -324, +1392, + +1364, +1337, +1309, +1283, +1247, +1212, +968, +982, +1424, +1099, +1079, +1058, +1072, + +1088, +815, +799, +1056, +802, +772, +743, +645, +547, +769, +736, +649, +563, + +332, +102, +1939, +4033, +1982, +444, +332, -36, +4076, +4093, +4047, +4001, +3955, + +3910, +3870, +3830, +3791, +3752, +3806, +3861, +3835, +3811, +3678, +3545, +3380, +3216, + +3639, +3806, +2341, +1134, +1091, +24, -387, -286, -286, -286, -286, +1440, +1389, + +1338, +1287, +1236, +1305, +1374, +1091, +1320, +1037, +1267, +1208, +1150, +715, +281, + +486, +1204, +1564, +901, +1325, +1750, +1830, +1911, +1383, +344, +459, +574, +817, + +548, +351, +666, +757, +336, +340, +856, +4028, +4128, +4076, +4024, +4004, +3984, + +3922, +3861, +3799, +3738, +3828, +3919, +3785, +3652, +3394, +3137, +3007, +2878, +2900, + +2923, +3105, +3800, +1284, +1328, +28, -248, -248, -248, -248, +1456, +1406, +1358, + +1309, +1261, +1209, +1159, +1444, +1218, +1265, +33, -654, -1342, -977, -356, +394, + +1401, +1753, +1338, +1738, +2140, +2575, +3009, +3524, +3784, +2536, +1033, +265, +522, + +440, +615, +629, +388, +403, +2211, +4051, +4099, +4078, +4058, +3990, +3922, +3910, + +3898, +3886, +3875, +3805, +3735, +3553, +3373, +3126, +2879, +2585, +2291, +2026, +1762, + +2649, +3026, +2303, +2092, +665, -250, -250, -250, -250, +1472, +1425, +1379, +1332, + +1286, +1371, +1457, +1030, -932, -1834, -1712, -1237, -763, -621, +33, +815, +1598, + +1943, +1776, +2153, +2531, +2808, +3085, +3362, +3640, +4102, +4052, +3042, +496, +530, + +564, +502, +440, +211, +3055, +3818, +4070, +4081, +4093, +3976, +3860, +3898, +3936, + +3974, +4013, +3783, +3553, +3323, +3094, +2858, +2623, +2420, +2217, +1921, +1626, +915, + +2764, +250, +296, +22, -252, -252, -252, -252, +1488, +1443, +1399, +1371, +1343, + +1308, +1530, -408, -1834, -1589, -1089, -811, -535, -281, +485, +1171, +1859, +2132, + +2150, +2503, +2857, +3105, +3352, +3536, +3720, +3875, +3775, +4298, +4054, +2123, +449, + +502, +556, +546, +26, +2113, +3945, +4115, +4031, +3946, +3862, +3838, +3814, +3982, + +3894, +3488, +3338, +3140, +2943, +2622, +2302, +2030, +1758, +1495, +1234, +1259, +774, + -347, -188, -189, -190, -222, -254, -254, +1504, +1462, +1420, +1410, +1400, +1246, + +1604, -1334, -1712, -1089, -978, -643, -308, +59, +938, +1529, +2120, +2322, +2524, + +2854, +3184, +3402, +3620, +3710, +3800, +3905, +4010, +4019, +4028, +3973, +334, +503, + +672, +627, +582, +409, +236, +2359, +3970, +3917, +3864, +3778, +3692, +3990, +3776, + +3194, +3124, +2958, +2792, +2387, +1982, +1641, +1300, +1071, +842, +69, -192, -176, + -160, -144, -128, -192, -256, -256, +1546, +1496, +1447, +1430, +1413, +1627, +1330, + -2102, -1184, -819, -712, -395, -80, +405, +1148, +1713, +2280, +2486, +2692, +2995, + +3297, +3467, +3638, +3712, +3787, +3915, +4045, +3917, +4047, +3097, +357, +655, +699, + +198, +466, +381, +297, +376, +200, +1815, +3431, +3568, +3961, +4114, +3755, +3310, + +3121, +2804, +2487, +2208, +1931, +1189, +447, +37, -116, -254, -136, -111, -86, + -109, -132, -196, -260, -260, +1588, +1531, +1475, +1450, +1426, +1497, +33, -1591, + -1168, -807, -446, -149, +148, +753, +1358, +1899, +2440, +2650, +2861, +3136, +3411, + +3533, +3656, +3715, +3774, +3927, +4080, +3817, +4066, +2223, +380, +553, +214, +3610, + +350, +354, +358, +442, +526, +226, -74, +286, +1158, +1678, +1686, +1634, +1582, + +1114, +646, +239, -168, -31, +107, -228, -51, -65, -80, -46, -12, -74, + -136, -200, -264, -264, +1630, +1565, +1502, +1470, +1439, +1590, -817, -1399, -960, + -633, -308, -14, +280, +875, +1472, +1971, +2472, +2718, +2965, +3229, +3492, +3582, + +3674, +3701, +3729, +3793, +3859, +4147, +4181, +707, +563, +417, +1297, +3917, +4234, + +2198, +163, +267, +372, +348, +325, +108, +147, +186, -31, +38, +107, +96, + +85, +61, +38, -162, -106, -126, +111, +876, -152, -93, -34, -87, -140, + -204, -268, -268, +1672, +1601, +1530, +1491, +1452, +1685, -1666, -1209, -752, -461, + -170, +121, +412, +999, +1586, +2045, +2504, +2787, +3071, +3322, +3574, +3633, +3693, + +3688, +3684, +3661, +3638, +3711, +2760, +473, +746, +283, +2380, +4225, +4022, +4043, + +4064, +2141, +218, +215, +212, +186, +160, +230, +300, +234, +168, +102, +36, + -117, -269, +218, +1218, +2025, +2833, +1048, -224, -140, -56, -100, -144, -208, + -272, -272, +1626, +1607, +1589, +1458, +1585, +692, -1479, -1107, -736, -451, -168, + +115, +400, +805, +1468, +1937, +2408, +2703, +2999, +3327, +3655, +3568, +3482, +3620, + +3759, +3439, +3121, +1601, +851, +819, +533, +437, +3415, +4252, +4066, +4055, +4045, + +4084, +4124, +2995, +1867, +1068, +269, +62, -145, -38, +69, +704, +1339, +2183, + +3028, +2816, +2861, +2953, +2790, -349, +96, -19, -134, -137, -140, -204, -268, + -268, +1580, +1614, +1649, +1427, +1718, -300, -1293, -1006, -720, -443, -166, +111, + +388, +613, +1350, +1831, +2312, +2620, +2928, +3076, +3225, +3249, +3273, +3297, +3322, + +3475, +3628, +3333, +1502, +655, +832, +593, +3938, +4024, +4110, +4068, +4026, +3980, + +3934, +3984, +4034, +3998, +3962, +3990, +4018, +3786, +3554, +3610, +3666, +3459, +3253, + +3111, +2969, +2858, +2236, -210, -96, -154, -212, -174, -136, -200, -264, -264, + +1662, +1653, +1644, +1619, +1851, -988, -1266, -985, -704, -401, -100, +9, +120, + +403, +944, +1579, +2216, +2504, +2793, +2873, +2954, +2976, +2999, +3085, +3173, +3237, + +3303, +3575, +521, +553, +587, +1771, +3981, +4019, +4058, +4032, +4007, +3971, +3936, + +3948, +3961, +3920, +3879, +3806, +3989, +3866, +3743, +3636, +3529, +3375, +3222, +3069, + +2916, +2907, +1362, -119, -64, -113, -162, -147, -132, -196, -260, -260, +1744, + +1692, +1640, +1556, +1472, -1932, -1240, -964, -688, -361, -34, +165, +364, +707, + +1050, +1585, +2120, +2389, +2658, +2671, +2684, +2705, +2726, +2875, +3024, +3001, +2978, + +2283, +564, +965, +342, +2951, +4024, +4015, +4006, +3997, +3988, +3963, +3938, +3913, + +3888, +3842, +3796, +3622, +3960, +3946, +3932, +3662, +3392, +3292, +3192, +3028, +2864, + +2956, +488, -28, -32, -72, -112, -120, -128, -192, -256, -256, +1834, +1635, + +1692, +1718, +208, -1663, -1229, -924, -619, -283, +50, +256, +719, +705, +948, + +1126, +1562, +1845, +2129, +2236, +2344, +2447, +2551, +2654, +2759, +2738, +2719, +1562, + +663, +623, +327, +4207, +3992, +4012, +4034, +3990, +3948, +3922, +3898, +3872, +3848, + +3774, +3701, +3484, +3523, +3726, +3929, +3812, +3695, +3604, +3513, +3407, +3300, +3350, + -440, -231, -22, -48, -74, -100, -126, -174, -222, -222, +1924, +1578, +1745, + +1880, -1057, -1394, -1219, -884, -550, -207, +135, +93, +563, +449, +847, +669, + +1004, +1302, +1600, +1802, +2005, +2191, +2377, +2435, +2494, +2477, +2460, +843, +763, + +794, +1337, +3928, +3960, +4011, +4062, +3985, +3908, +3883, +3858, +3833, +3808, +3707, + +3607, +3603, +3599, +3506, +3414, +3706, +3998, +3916, +3835, +3786, +3737, +2208, -345, + +78, -12, -24, -36, -80, -124, -156, -188, -188, +1598, +1585, +1829, +2154, + -1873, -1413, -1208, -556, -417, -514, -102, +440, +214, +191, +681, +435, +702, + +870, +1039, +1224, +1409, +1709, +2010, +2039, +2069, +2086, +1849, +795, +766, +596, + +2474, +3953, +3896, +3928, +3962, +3914, +3868, +3842, +3818, +3792, +3768, +3687, +3608, + +3577, +3546, +3462, +3379, +3312, +3245, +3364, +3484, +3189, +2893, +858, -154, +35, + -34, -48, -62, -108, -154, -154, -154, -154, +1784, +1849, +1915, +892, -1666, + -1176, -1711, -741, -796, -822, +175, -748, +378, +191, +517, +202, +400, +439, + +479, +646, +814, +1229, +1645, +1644, +1644, +1697, +1239, +748, +770, +399, +3613, + +3978, +3832, +3847, +3862, +3845, +3828, +3803, +3778, +3753, +3728, +3669, +3611, +3552, + +3494, +3419, +3345, +3174, +3004, +2813, +2623, +2592, +2562, -237, +37, -9, -56, + -72, -88, -136, -184, -152, -120, -120, +1802, +1900, +2255, -286, -1290, -1129, + -712, -391, -327, -385, -445, +201, -178, +436, +27, -45, -118, +204, +270, + +384, +498, +685, +874, +998, +1123, +1252, +1127, +794, +717, +1161, +3654, +3843, + +3776, +3788, +3802, +3782, +3764, +3616, +3726, +3690, +3656, +3595, +3536, +3476, +3417, + +3341, +3265, +3078, +2891, +2687, +2484, +2617, +1982, -28, +8, +14, +18, -18, + -54, +6, +66, -30, -126, -126, +1820, +1696, +2084, -2232, -1939, -570, -1762, + -1834, -1394, -461, -552, -387, -223, -1110, -462, -37, -124, -31, -451, -134, + +183, +143, +104, +353, +602, +809, +1017, +841, +665, +1924, +3696, +3708, +3720, + +3731, +3742, +3721, +3700, +3431, +3674, +3629, +3584, +3523, +3462, +3401, +3341, +3264, + +3187, +2982, +2778, +2562, +2346, +2386, +891, -77, -20, +36, +92, +36, -20, + -108, -196, -164, -132, -132, +1710, +1955, +1177, -2833, -955, -2075, -2172, -364, + -1885, -1352, -820, -1599, -843, -1249, -887, -652, -674, -554, -435, -636, -325, + -304, -282, -101, -175, +493, +906, +871, +580, +2767, +3674, +3653, +3632, +3656, + +3682, +3626, +3572, +3436, +3558, +3534, +3512, +3449, +3388, +3325, +3264, +3186, +3108, + +2902, +2697, +2500, +2304, +2219, +343, +179, +271, +154, +38, -6, -50, -110, + -170, -154, -138, -138, +1600, +1959, -242, -2667, -2020, -2557, -2582, -1455, +696, + +316, +960, +2052, +2120, +1940, +1760, +1292, +824, -310, -932, -1394, -832, -750, + -668, -298, -440, +434, +796, +902, +496, +3610, +3652, +3598, +3544, +3583, +3622, + +3533, +3444, +3443, +3442, +3441, +3440, +3377, +3314, +3251, +3188, +3109, +3030, +2823, + +2616, +2439, +2262, +2053, -204, +179, +50, +17, -16, -48, -80, -112, -144, + -144, -144, -144, +1956, +1852, -2091, -3025, -1145, +322, +2045, +1672, +1555, +1328, + +1614, +1916, +1706, +1622, +1282, +1502, +1466, +1301, +1393, +940, -792, -1548, -768, + -820, -617, +926, +934, +909, +1397, +3323, +3456, +3446, +3436, +3393, +3351, +3388, + +3426, +3373, +3321, +3444, +3313, +3264, +3217, +3153, +3090, +2997, +2906, +2686, +2467, + +2290, +2115, +1282, -61, +136, +79, +36, -5, -37, -69, -101, -133, -133, + -133, -133, +1800, +1746, +669, +1992, +1779, +1665, +1552, +1727, +1390, +1317, +1245, + +1269, +1293, +1560, +1316, +1456, +1084, +1121, +1158, +971, +1297, +726, -869, -1343, + -794, +1419, +1072, +917, +2299, +3036, +3261, +3294, +3328, +3204, +3080, +3244, +3409, + +3305, +3201, +3449, +3186, +3153, +3121, +3056, +2992, +2887, +2783, +2550, +2318, +2143, + +1968, +513, +82, +95, +108, +57, +6, -26, -58, -90, -122, -122, -122, + -122, +1516, +1832, +1636, +1905, +1406, +1344, +1283, +1589, +1641, +1465, +1291, +1277, + +1263, +1386, +1254, +1314, +1118, +1116, +1115, +905, +953, +1160, +1111, +118, -363, + +807, +698, +700, +2240, +3325, +2361, +2934, +3252, +2998, +2745, +2924, +3103, +3155, + +2952, +3277, +3091, +3057, +3024, +2959, +2894, +2776, +2659, +2414, +2169, +2074, +1981, + +255, +65, +68, +73, +44, +17, -15, -47, -79, -111, -111, -111, -111, + +1744, +1662, +1581, +1563, +1546, +1536, +1527, +1453, +1380, +1359, +1339, +1286, +1234, + +1213, +1193, +1172, +1152, +1112, +1073, +1097, +1122, +826, +1043, +1067, +1092, +964, + +837, +741, +2182, +2078, +2487, +2831, +2664, +2793, +2923, +2860, +2798, +3007, +2705, + +3106, +2996, +2962, +2928, +2862, +2796, +2666, +2536, +2278, +2020, +1751, +1482, -259, + +48, +43, +38, +33, +28, -4, -36, -68, -100, -100, -100, -100, +1684, + +1640, +1596, +1584, +1573, +1543, +1513, +1451, +1391, +1359, +1329, +1282, +1236, +1213, + +1190, +1168, +1146, +1107, +1069, +1063, +1058, +920, +1038, +996, +955, +924, +894, + +880, +1635, +1679, +2235, +2439, +2132, +2451, +2771, +2580, +2644, +2713, +2528, +2742, + +2701, +2828, +2699, +2570, +2442, +2383, +2324, +2105, +1887, +1732, +811, -79, +55, + +62, +71, +46, +23, -7, -37, -67, -97, -113, -129, -129, +1624, +1618, + +1612, +1606, +1601, +1551, +1501, +1451, +1402, +1361, +1320, +1279, +1239, +1214, +1189, + +1164, +1140, +1103, +1067, +1031, +995, +1014, +1034, +926, +818, +885, +953, +1021, + +1089, +1024, +1472, +2048, +2112, +2110, +2109, +2044, +2491, +2421, +2352, +2379, +2406, + +2694, +2471, +2279, +2088, +2100, +2113, +1933, +1754, +1715, +140, +101, +62, +83, + +104, +61, +18, -10, -38, -66, -94, -126, -158, -158, +1724, +1788, +1852, + +1692, +1532, +1494, +1456, +1418, +1381, +1345, +1311, +1275, +1241, +1214, +1187, +1160, + +1134, +1098, +1064, +1029, +995, +996, +998, +935, +873, +877, +883, +792, +702, + +657, +1125, +1832, +2284, +1193, +1638, +1796, +2209, +2320, +2176, +2239, +2047, +2560, + +2562, +1891, +1734, +1673, +1613, +1744, +1621, +1152, -83, -8, +69, +70, +73, + +42, +13, -13, -39, -65, -91, -139, -187, -187, +1824, +1702, +1580, +1522, + +1464, +1438, +1412, +1386, +1360, +1331, +1302, +1273, +1244, +1215, +1186, +1157, +1128, + +1095, +1062, +1029, +996, +979, +962, +945, +928, +871, +814, +821, +828, +803, + +1290, +1617, +1944, +2068, +1168, +1292, +1416, +1708, +1488, +1844, +1688, +2171, +2142, + +1249, +1380, +1503, +1626, +1045, -48, +79, +206, +141, +76, +59, +42, +25, + +8, -16, -40, -64, -88, -152, -216, -216, +1688, +1615, +1542, +1501, +1460, + +1429, +1398, +1367, +1336, +1309, +1284, +1257, +1232, +1205, +1180, +1153, +1128, +1092, + +1058, +1022, +988, +968, +950, +930, +912, +861, +812, +793, +776, +595, +672, + +971, +1272, +330, +924, +1038, +1152, +1298, +1444, +1910, +1608, +1531, +1200, +515, + +344, +259, +176, +251, +72, +122, +174, +128, +84, +64, +46, +26, +8, + -18, -44, -70, -96, -144, -192, -192, +1552, +1528, +1504, +1480, +1456, +1420, + +1384, +1348, +1312, +1289, +1266, +1243, +1220, +1197, +1174, +1151, +1128, +1091, +1054, + +1017, +980, +959, +938, +917, +896, +853, +810, +767, +724, +645, +566, +583, + +600, +640, +680, +528, +376, +376, +888, +1464, +1016, +637, +258, +295, +332, + +297, +262, +227, +192, +167, +142, +117, +92, +71, +50, +29, +8, -20, + -48, -76, -104, -136, -168, -168, +1544, +1521, +1498, +1475, +1452, +1411, +1370, + +1329, +1288, +1267, +1248, +1227, +1208, +1187, +1168, +1147, +1128, +1088, +1050, +1010, + +972, +948, +926, +902, +880, +843, +808, +771, +736, +677, +620, +609, +600, + +614, +628, +546, +464, +238, +2060, +1690, +1576, +1709, +308, +313, +320, +285, + +252, +217, +184, +162, +142, +120, +100, +76, +54, +30, +8, -22, -52, + -82, -112, -128, -144, -144, +1536, +1514, +1492, +1470, +1448, +1402, +1356, +1310, + +1264, +1247, +1230, +1213, +1196, +1179, +1162, +1145, +1128, +1087, +1046, +1005, +964, + +939, +914, +889, +864, +835, +806, +777, +748, +711, +674, +637, +600, +588, + +576, +564, +552, +612, +160, +1916, +1112, +223, +358, +333, +308, +275, +242, + +209, +176, +159, +142, +125, +108, +83, +58, +33, +8, -24, -56, -88, + -120, -120, -120, -120, +1536, +1514, +1492, +1470, +1448, +1402, +1356, +1310, +1264, + +1246, +1230, +1212, +1196, +1178, +1162, +1144, +1128, +1086, +1046, +1004, +964, +938, + +914, +888, +864, +834, +806, +776, +748, +710, +674, +636, +600, +588, +576, + +564, +552, +644, +480, +108, +504, +158, +326, +316, +308, +274, +242, +208, + +176, +158, +142, +124, +108, +82, +58, +32, +8, -24, -56, -88, -120, + -120, -120, -120, +1536, +1514, +1492, +1470, +1448, +1402, +1356, +1310, +1264, +1247, + +1230, +1213, +1196, +1179, +1162, +1145, +1128, +1087, +1046, +1005, +964, +939, +914, + +889, +864, +835, +806, +777, +748, +711, +674, +637, +600, +588, +576, +564, + +552, +420, +288, +348, +408, +351, +294, +301, +308, +275, +242, +209, +176, + +159, +142, +125, +108, +83, +58, +33, +8, -24, -56, -88, -120, -120, + -120, -120, +1536, +1514, +1492, +1470, +1448, +1402, +1356, +1310, +1264, +1246, +1230, + +1212, +1196, +1178, +1162, +1144, +1128, +1086, +1046, +1004, +964, +938, +914, +888, + +864, +834, +806, +776, +748, +710, +674, +636, +600, +588, +576, +564, +552, + +420, +288, +348, +408, +350, +294, +300, +308, +274, +242, +208, +176, +158, + +142, +124, +108, +82, +58, +32, +8, -24, -56, -88, -120, -120, -120, + -120 }; -static const INT16 TEST_CB_COMPONENT[4096] = -{ - +1728, +1730, +1732, +1734, +1736, +1738, +1740, +1742, - +1744, +1740, +1736, +1732, +1728, +1796, +1864, +1804, - +1744, +1754, +1764, +1774, +1784, +1794, +1804, +1814, - +1824, +1774, +1724, +1802, +1880, +1814, +1748, +1810, - +1872, +1878, +1884, +1890, +1896, +1910, +1924, +1938, - +1952, +1938, +1924, +1910, +1896, +1914, +1932, +1950, - +1968, +1974, +1980, +1986, +1992, +1998, +2004, +2010, - +2016, +2016, +2016, +2016, +2016, +2016, +2016, +2016, - +1710, +1697, +1684, +1704, +1723, +1726, +1730, +1733, - +1737, +1738, +1740, +1741, +1743, +1758, +1774, +1757, - +1741, +1762, +1783, +1788, +1793, +1774, +1755, +1784, - +1813, +1817, +1821, +1825, +1829, +1857, +1885, +1881, - +1877, +1849, +1821, +1857, +1894, +1904, +1914, +1924, - +1935, +1928, +1922, +1915, +1909, +1922, +1936, +1949, - +1963, +1974, +1985, +1997, +2008, +2009, +2011, +2012, - +2014, +2017, +2020, +2023, +2026, +2026, +2026, +2026, - +1692, +1664, +1637, +1674, +1711, +1715, +1720, +1725, - +1730, +1737, +1744, +1751, +1758, +1721, +1684, +1711, - +1738, +1770, +1802, +1802, +1802, +1754, +1706, +1754, - +1802, +1860, +1918, +1848, +1778, +1900, +2022, +1952, - +1882, +1820, +1759, +1825, +1892, +1898, +1905, +1911, - +1918, +1919, +1920, +1921, +1922, +1931, +1940, +1949, - +1958, +1974, +1991, +2008, +2025, +2021, +2018, +2015, - +2012, +2018, +2024, +2030, +2036, +2036, +2036, +2036, - +1674, +1631, +1589, +1644, +1698, +1703, +1710, +1716, - +1723, +1735, +1748, +1760, +1773, +1763, +1754, +1760, - +1767, +1794, +1821, +1800, +1779, +1830, +1881, +1900, - +1919, +2047, +2175, +2015, +1855, +1879, +1903, +1927, - +1951, +1759, +1824, +1856, +1890, +1892, +1895, +1897, - +1901, +1909, +1918, +1926, +1935, +1939, +1944, +1948, - +1953, +1974, +1996, +2019, +2041, +2032, +2025, +2017, - +2010, +2019, +2028, +2037, +2046, +2046, +2046, +2046, - +1656, +1599, +1543, +1614, +1686, +1693, +1701, +1708, - +1716, +1734, +1752, +1770, +1788, +1806, +1824, +1810, - +1796, +1818, +1840, +2054, +2268, +1650, +1032, +510, - -12, -70, -128, +390, +908, +1602, +2296, +2158, - +2020, +1699, +1890, +1889, +1888, +1887, +1886, +1885, - +1884, +1900, +1916, +1932, +1948, +1948, +1948, +1948, - +1948, +1975, +2003, +2030, +2058, +2045, +2033, +2020, - +2008, +2020, +2032, +2044, +2056, +2056, +2056, +2056, - +1590, +1570, +1551, +1612, +1673, +1579, +1742, +1713, - +1685, +1672, +1660, +1711, +1763, +1694, +1626, +1941, - +2001, +2060, +583, -654, -1891, -2046, -2201, -2084, - -1967, -2049, -2131, -2053, -1975, -1751, -1527, +41, - +1609, +2374, +1859, +2000, +1886, +1898, +1912, +1909, - +1907, +1900, +1894, +1919, +1945, +1944, +1944, +1943, - +1943, +1967, +1992, +2017, +2042, +2032, +2023, +2014, - +2006, +2017, +2028, +2039, +2050, +2050, +2050, +2050, - +1524, +1542, +1560, +1610, +1661, +1467, +1785, +1719, - +1654, +1611, +1568, +1653, +1738, +1839, +1940, +793, - -866, -2050, -2210, -2082, -1954, -1902, -1850, -1862, - -1874, -1980, -2086, -1936, -1786, -1776, -1766, -1820, - -1874, -534, +1829, +2112, +1884, +1911, +1939, +1934, - +1930, +1901, +1872, +1907, +1942, +1941, +1940, +1939, - +1938, +1960, +1982, +2004, +2027, +2021, +2015, +2009, - +2004, +2014, +2024, +2034, +2044, +2044, +2044, +2044, - +1586, +1641, +1697, +1704, +1712, +1577, +1699, +1660, - +1623, +1613, +1604, +1642, +1681, +1791, -402, -2036, - -1877, -2144, -1899, -1942, -1985, -1918, -1851, -1880, - -1909, -1959, -2009, -1931, -1853, -1801, -1749, -1617, - -1485, -1939, -1882, +96, +2074, +1971, +1869, +1895, - +1921, +1885, +1850, +1894, +1939, +1937, +1936, +1934, - +1933, +1952, +1972, +1991, +2011, +2008, +2006, +2003, - +2002, +2011, +2020, +2029, +2038, +2038, +2038, +2038, - +1136, +1229, +1322, +1287, +1252, +1433, +1614, +1603, - +1592, +1616, +1640, +1632, +1624, +2256, -1720, -1792, - -1864, -1982, -2100, -2058, -2016, -1934, -1852, -1898, - -1944, -1938, -1932, -1926, -1920, -1826, -1732, -1670, - -1608, -1552, -1496, -1664, -1320, +2288, +1800, +1856, - +1912, +1870, +1828, +1882, +1936, +1934, +1932, +1930, - +1928, +1945, +1962, +1979, +1996, +1997, +1998, +1999, - +2000, +2008, +2016, +2024, +2032, +2032, +2032, +2032, - +1552, +1624, +1698, +1674, +1652, +1644, +1638, +1614, - +1592, +1611, +1630, +1681, +1733, +1146, -2000, -1787, - -1830, -1924, -2019, -2049, -2080, -1986, -1893, -1895, - -1898, -1896, -1894, -1860, -1827, -1779, -1731, -1667, - -1604, -1615, -1626, -1878, -594, +2063, +1903, +2016, - +1873, +2132, +1880, +1884, +1888, +1921, +1955, +1941, - +1927, +1925, +1925, +1955, +1987, +2005, +2025, +2043, - +2063, +1995, +1927, +2099, +2015, +2095, +2175, +2175, - +1456, +1509, +1562, +1551, +1540, +1601, +1662, +1627, - +1592, +1606, +1621, +1731, +1842, +37, -2281, -1782, - -1796, -1867, -1938, -2041, -2144, -2039, -1934, -1893, - -1852, -1854, -1857, -1795, -1734, -1732, -1731, -1665, - -1600, -1678, -1757, -1836, +645, +2094, +2007, +1920, - +1322, +2139, +1933, +1886, +1840, +1909, +1979, +1952, - +1926, +1907, +1888, +1933, +1978, +2015, +2052, +2089, - +2126, +1982, +1838, +2174, +1998, +2158, +2318, +2318, - +1488, +1520, +1554, +1554, +1556, +1588, +1622, +1606, - +1592, +1569, +1547, +1700, +1855, -993, -2049, -1825, - -1858, -1905, -1953, -2016, -2080, -1995, -1911, -1858, - -1806, -1812, -1819, -1729, -1641, -1685, -1730, -1678, - -1628, -1677, -1727, -2194, +1947, +2125, +2046, +945, - -2205, +114, +2177, +2144, +1856, +1912, +1970, +1963, - +1957, +1935, +1915, +1925, +1937, +1991, +2047, +2181, - +2061, +2337, +2613, +1817, +2301, +2157, +2269, +2397, - +1520, +1533, +1546, +1559, +1572, +1577, +1582, +1587, - +1592, +1533, +1474, +1671, +1868, -2023, -1818, -1869, - -1920, -1944, -1968, -1992, -2016, -1952, -1888, -1824, - -1760, -1771, -1782, -1665, -1548, -1639, -1730, -1693, - -1656, -1677, -1699, -1017, +2226, +1644, +2087, -286, - -2148, -2167, -1674, +611, +2384, +2173, +1962, +1975, - +1988, +1965, +1942, +1919, +1896, +1969, +2042, +2019, - +1484, -1916, -1220, +2484, +1068, -916, +1708, +1964, - +1504, +1514, +1526, +1536, +1548, +1550, +1554, +1556, - +1560, +1581, +1604, +1786, +689, -2138, -1894, -1905, - -1918, -1926, -1935, -1943, -1952, -1878, -1805, -1731, - -1658, -1626, -1596, -1549, -1503, -1507, -1513, -1518, - -1524, -1526, -1785, +148, +2080, +1995, +2422, -2094, - -2003, -2033, -1809, -1665, -1776, -189, +1398, +2536, - +2139, +2122, +2105, +2327, +2295, +2204, +2113, +2870, - -213, -1669, -1077, -1237, -1653, -1589, +2059, +1931, - +1488, +1497, +1506, +1515, +1524, +1525, +1526, +1527, - +1528, +1631, +1735, +1902, -490, -2254, -1971, -1943, - -1916, -1909, -1902, -1895, -1888, -1805, -1722, -1639, - -1556, -1483, -1411, -1434, -1458, -1377, -1297, -1344, - -1392, -1376, -1872, +1312, +1935, +1834, +1734, -2622, - -2370, -2157, -1945, -1892, -1840, -2039, -2239, -2022, - -782, -281, +220, +433, +134, -377, -888, -1655, - -1398, -1166, -934, -1374, -1302, -726, +2410, +1898, - +1472, +1478, +1486, +1492, +1500, +1498, +1498, +1496, - +1496, +1600, +1705, +1666, -933, -1474, -2015, -1964, - -1914, -1891, -1869, -1846, -1824, -1731, -1639, -1546, - -1454, -1387, -1321, -1191, -1317, -1150, -1240, -1250, - -1260, -1545, -1575, +2459, +1885, +2057, +182, -2429, - -2225, -2088, -1952, -1928, -1904, -1905, -1907, -2149, - -1879, -1835, -1793, -1670, -1803, -1645, -1489, -1491, - -1239, -1335, -1431, -1335, -1495, +681, +2345, +2089, - +1456, +1461, +1466, +1471, +1476, +1473, +1470, +1467, - +1464, +1570, +1676, +1174, -1888, -950, -2060, -1986, - -1912, -1874, -1836, -1798, -1760, -1658, -1556, -1454, - -1352, -1292, -1232, -1204, -1688, -1180, -1184, -1156, - -1128, -1203, -254, +2071, +1836, +2281, -1370, -2237, - -2080, -2020, -1960, -1964, -1968, -2028, -2088, -2020, - -1952, -1855, -1758, -1725, -1692, -1635, -1578, -1329, - -1592, -1504, -1416, -1040, -1688, +2088, +2280, +2280, - +1428, +1438, +1450, +1460, +1472, +1463, +1454, +1493, - +1533, +1512, +1748, -160, -2068, -1346, -1137, -1775, - -1902, -1848, -1794, -1708, -1622, -1544, -1466, -1356, - -1247, -1198, -1149, -1196, -1755, -1246, -993, -1012, - -1032, -1202, +930, +2023, +1837, +2238, -2480, -2286, - -1838, -1799, -1761, -1835, -1909, -1954, -2000, -1982, - -1964, -1908, -1853, -1829, -1807, -1749, -1692, -1538, - -1642, -1526, -1410, -638, -122, +774, +1926, +1926, - +1400, +1417, +1434, +1451, +1469, +1454, +1439, +1520, - +1602, +1455, +1820, -1239, -1737, -1743, -726, -1821, - -1892, -1822, -1752, -1618, -1485, -1431, -1377, -1259, - -1142, -1104, -1066, -1188, -1823, -1313, -803, -869, - -936, -1203, +2115, +1976, +1838, +916, -2055, -1569, - -1596, -1579, -1563, -1706, -1850, -1881, -1913, -1944, - -1976, -1962, -1949, -1935, -1922, -1864, -1807, -1749, - -1692, -1548, -1404, -1004, -92, +996, +2084, +2084, - +1372, +1394, +1418, +1441, +1465, +1444, +1423, +1483, - +1543, +1765, +1732, -2204, -1533, -1611, -1179, -1274, - -1882, -1764, -1646, -1560, -1475, -1301, -1127, -1113, - -1101, -994, -887, -1052, -1730, -1395, -804, -709, - -872, -306, +2051, +1929, +2063, -151, -1597, -1347, - -1354, -1326, -1300, -1417, -1535, -1599, -1665, -1730, - -1796, -1824, -1852, -1880, -1909, -1883, -1857, -1767, - -1678, -1570, -1462, -1434, +1154, +2402, +1858, +1858, - +1344, +1373, +1403, +1432, +1462, +1435, +1409, +1446, - +1484, +1564, +621, -1890, -1842, -1737, -1633, -728, - -1872, -1706, -1541, -1503, -1466, -1428, -1391, -1225, - -1060, -884, -709, -917, -1638, -1478, -807, -551, - -808, +590, +1988, +1882, +2288, -1218, -1140, -1126, - -1112, -1075, -1038, -1129, -1220, -1319, -1418, -1517, - -1616, -1686, -1756, -1826, -1896, -1902, -1908, -1786, - -1664, -1592, -1520, -1864, +2400, +2016, +2144, +2144, - +1348, +1372, +1398, +1424, +1450, +1463, +1477, +1491, - +1505, +1729, -607, -1838, -1790, -1735, -1681, -1003, - -1350, -1710, -1558, -1519, -1480, -1382, -1285, -1379, - -1475, -1208, -941, -611, -793, -796, -800, -611, - -680, +1364, +1872, +1932, +1481, -1150, -966, -926, - -886, -868, -851, -929, -1009, -1061, -1114, -1230, - -1348, -1521, -1695, -1805, -1915, -1900, -1886, -1792, - -1698, -1604, -1766, -744, +2326, +2134, +2198, +2198, - +1352, +1373, +1395, +1417, +1439, +1492, +1546, +1536, - +1526, +1894, -1835, -1787, -1739, -1735, -1731, -1279, - -828, -1714, -1577, -1536, -1495, -1337, -1180, -1023, - -866, -764, -663, -562, -973, -371, -282, -417, - -552, +2138, +1757, +1983, +674, -1083, -793, -726, - -660, -662, -665, -731, -798, -804, -811, -945, - -1080, -1357, -1635, -1784, -1934, -1899, -1865, -1798, - -1732, -1616, -2012, +376, +2252, +2252, +2252, +2252, - +1356, +1373, +1391, +1409, +1427, +1425, +1423, +1501, - +1579, +907, -1814, -1702, -1847, -1909, -1716, -1634, - -786, -1686, -1819, -1712, -1605, -1371, -1139, -921, - -705, -656, -608, -384, -416, -233, -308, -477, - +376, +1968, +1769, +2033, -5, -839, -651, -606, - -562, -584, -606, -660, -715, -739, -763, -963, - -1164, -1432, -1702, -1843, -1985, -1977, -1971, -1884, - -1798, -2012, -2226, +2152, +2178, +2194, +2210, +2210, - +1360, +1374, +1388, +1402, +1416, +1358, +1300, +1466, - +1632, -81, -1794, -1619, -1956, -2085, -1702, -1991, - -744, -891, -526, -353, -180, -383, -586, -821, - -1056, -805, -554, -463, -372, -353, -334, -539, - +1304, +1799, +1782, +2085, -684, -597, -510, -487, - -464, -506, -548, -590, -632, -674, -716, -982, - -1248, -1509, -1770, -1903, -2036, -2057, -2078, -1971, - -1864, -1896, -1416, +2392, +2104, +2136, +2168, +2168, - +1346, +1358, +1371, +1383, +1396, +1395, +1393, +1552, - +1711, -1177, -1762, -2203, -1364, -465, +690, +1942, - +1913, +1747, +1837, +1816, +1794, +1889, +1983, +1774, - +1564, +548, -468, -299, -386, -391, -398, -147, - +1895, +1920, +1946, +1284, -401, -397, -393, -421, - -450, -478, -507, -568, -629, -722, -815, -1068, - -1321, -1697, -2074, -2082, -2091, -2129, -2168, -2030, - -1894, -2028, +142, +2280, +2114, +2082, +2050, +2050, - +1332, +1343, +1354, +1365, +1377, +1432, +1487, +1382, - +1278, -1763, -195, +1308, +1788, +1667, +1547, +1522, - +1498, +1569, +1641, +1681, +1721, +1600, +1480, +1552, - +1624, +1901, +2179, +1145, -401, -431, -462, -12, - +1974, +1786, +2111, +484, -119, -198, -277, -356, - -436, -451, -467, -547, -627, -770, -914, -898, - -882, -606, -330, -470, -611, -1435, -2259, -2091, - -1924, -2160, +1700, +2168, +2124, +2028, +1932, +1932, - +1318, +1327, +1337, +1346, +1357, +1405, +1452, +1420, - +1389, +1381, +1629, +1748, +1356, +1495, +1635, +1631, - +1627, +1551, +1732, +1689, +1647, +1728, +1809, +1730, - +1652, +1686, +1721, +1948, +1921, +874, -430, +363, - +1925, +1764, +1859, +148, -28, -95, -160, -291, - -422, -423, -426, -557, -688, -370, -309, -280, - -251, -570, -890, -858, -826, -563, -301, -1079, - -1858, -1636, +2170, +2296, +2166, +2118, +2070, +2070, - +1304, +1312, +1321, +1329, +1338, +1378, +1419, +1459, - +1500, +1452, +1404, +1420, +1436, +1580, +1724, +1484, - +1244, +1022, +1313, +1187, +1062, +1088, +1115, +1397, - +1680, +1728, +1777, +1729, +1682, +1922, +1651, +1763, - +1876, +1742, +1609, -189, +62, +8, -45, -226, - -408, -397, -387, -568, -750, -227, -217, -430, - -644, -1047, -1451, -1502, -1554, -1229, -905, -580, - -256, -856, +1616, +1912, +2208, +2208, +2208, +2208, - +1290, +1304, +1319, +1334, +1350, +1377, +1404, +1271, - +1395, +1525, +1655, +1769, +1884, +1802, +1720, +1430, - +1141, +1026, +1168, +1037, +908, +700, +491, +331, - +172, +873, +1575, +1524, +1731, +1991, +1738, +1774, - +1811, +1914, +993, -119, +48, -74, -196, -271, - -346, -407, -470, -324, -179, -213, -503, -810, - -1117, -1273, -1430, -1636, -1841, -1823, -1551, -1246, - -686, +1194, +1026, +1610, +2194, +2194, +2194, +2194, - +1276, +1297, +1319, +1341, +1363, +1376, +1390, +1340, - +1802, +1854, +1907, +1863, +1820, +1768, +1717, +1377, - +1038, +1031, +1024, +889, +755, +568, +381, +290, - +200, +19, -162, +553, +1781, +2060, +1827, +1786, - +1746, +2086, +378, -50, +35, -156, -348, -316, - -284, -419, -554, -337, -121, -456, -791, -934, - -1078, -1244, -1411, -1514, -1617, -1907, -1686, -1657, - -1116, +1964, +1972, +2076, +2180, +2180, +2180, +2180, - +1262, +1289, +1318, +1346, +1375, +1359, +1344, +1632, - +1921, +1927, +1934, +1876, +1820, +1702, +1585, +1259, - +935, +907, +880, +724, +569, +436, +302, +217, - +132, +44, -43, -99, +102, +801, +2011, +1878, - +1745, +1426, +2131, +916, -43, -191, -340, -393, - -446, -461, -478, -237, -254, -522, -790, -962, - -1135, -1519, -1647, -1760, -1872, -1446, -2045, -1827, - -1354, +2254, +2278, +2222, +2166, +2166, +2166, +2166, - +1248, +1283, +1318, +1353, +1388, +1343, +1298, +1925, - +2040, +2001, +1962, +1891, +1820, +1637, +1454, +1143, - +832, +784, +736, +560, +384, +304, +224, +144, - +64, +70, +76, +18, -40, +54, +1684, +1714, - +1744, +1790, +1836, +1882, +1928, +798, -332, -470, - -608, -505, -402, -139, -388, -589, -790, -991, - -1192, -1794, -1884, -2006, -2128, -2266, -868, +818, - +2504, +2288, +2072, +2112, +2152, +2152, +2152, +2152, - +1238, +1263, +1290, +1332, +1375, +1301, +1484, +2002, - +2009, +1973, +1939, +1871, +1805, +1608, +1411, +1118, - +826, +751, +676, +505, +334, +273, +212, +151, - +91, +69, +48, +11, -26, +482, +1758, +1771, - +1784, +2033, +1771, +1860, +1950, +1989, +2029, +884, - -260, -1156, -261, -309, -614, -922, -975, -1411, - -1848, -2062, -2019, -697, +626, +2060, +2471, +2273, - +2076, +2051, +2026, +2081, +2136, +2136, +2136, +2136, - +1228, +1245, +1263, +1313, +1363, +1260, +1670, +2080, - +1978, +1947, +1916, +1853, +1791, +1580, +1369, +1094, - +820, +718, +616, +450, +285, +243, +201, +159, - +118, +69, +20, +4, -13, +910, +1833, +1828, - +1824, +229, +1706, +1839, +1972, +1901, +1830, +1983, - +2136, +2032, +1416, +1056, +696, +280, +376, +728, - +1080, +1767, +2454, +2405, +2356, +2035, +2226, +2193, - +2160, +2070, +1980, +2050, +2120, +2120, +2120, +2120, - +1218, +1226, +1235, +1292, +1350, +1235, +1888, +2061, - +1979, +1935, +1893, +1834, +1776, +1551, +1326, +1070, - +814, +685, +556, +395, +235, +212, +189, +166, - +145, +116, +88, -68, +33, +1306, +1811, +1949, - +1576, -200, -183, +905, +1994, +1956, +1919, +1881, - +1844, +2004, +1909, +2005, +2102, +2042, +2239, +2195, - +2152, +2043, +1935, +2370, +2038, +2697, +1821, +368, - +2244, +2121, +1998, +2051, +2104, +2104, +2104, +2104, - +1208, +1208, +1209, +1273, +1338, +1210, +2107, +2043, - +1980, +1925, +1871, +1816, +1762, +1523, +1285, +1046, - +808, +652, +497, +341, +186, +182, +179, +175, - +172, +164, +157, +117, +590, +1958, +1791, +1815, - +816, +140, -24, -28, -32, +988, +2008, +2036, - +2064, +1977, +1890, +1931, +1972, +2013, +2054, +2127, - +2200, +2320, +2440, +2080, +184, -1760, -3192, +336, - +2328, +2172, +2016, +2052, +2088, +2088, +2088, +2088, - +1222, +1215, +1209, +1266, +1325, +1459, +2104, +2046, - +1989, +1945, +1903, +1861, +1819, +1612, +1406, +1136, - +866, +715, +564, +446, +328, +295, +263, +230, - +199, +481, +764, +711, +1427, +2086, +1721, +1692, - +128, -37, +55, -14, -82, -108, -135, +335, - +804, +1293, +1783, +2272, +2250, +2197, +1889, +1356, - +568, -763, -2095, -3010, -2646, -2931, -2705, +2305, - +2196, +2159, +2122, +2117, +2112, +2112, +2112, +2112, - +1236, +1223, +1210, +1261, +1313, +1708, +2103, +2050, - +1998, +1967, +1937, +1907, +1877, +1702, +1528, +1226, - +924, +778, +633, +552, +471, +409, +348, +287, - +226, +287, +349, +283, +1241, +1702, +1652, +1826, - -48, +43, +134, +1, -132, -181, -230, -343, - -456, -670, -884, -202, -544, -946, -1860, -1718, - -2088, -2311, -2534, -2469, -2404, -2311, -1706, +2483, - +2064, +2146, +2228, +2182, +2136, +2136, +2136, +2136, - +1250, +1230, +1211, +1255, +1300, +1957, +2101, +2054, - +2007, +1956, +1906, +1856, +1806, +1696, +1586, +1284, - +982, +841, +701, +657, +613, +554, +497, +438, - +381, +412, +445, +717, +1758, +1782, +1807, +1095, - -128, -70, -11, -97, -182, -253, -325, -428, - -532, -761, -991, -580, -170, -1033, -873, -1976, - -1800, -2018, -2237, -2343, -2450, -2650, -35, +2308, - +2092, +2117, +2142, +2151, +2160, +2160, +2160, +2160, - +1264, +1238, +1212, +1250, +1288, +2206, +2100, +2058, - +2016, +1946, +1876, +1806, +1736, +1690, +1644, +1342, - +1040, +905, +770, +763, +756, +701, +646, +591, - +536, +539, +542, +897, +1764, +1607, +1962, +365, - -208, -182, -156, -194, -232, -326, -420, -514, - -608, -853, -1098, -1471, -820, -97, -910, -955, - -2024, -2238, -2452, -2474, -2496, -2990, +1636, +2134, - +2120, +2088, +2056, +2120, +2184, +2184, +2184, +2184, - +1198, +1191, +1185, +1227, +1525, +2065, +2093, +2009, - +1925, +1887, +1850, +1781, +1712, +1682, +1653, +1464, - +1275, +1130, +986, +937, +889, +840, +792, +743, - +696, +684, +674, +1335, +1741, +1839, +1939, +54, - -294, -295, -297, -298, -300, -414, -527, -641, - -755, -947, -1140, -1732, -1813, -733, -166, -1038, - -887, -1234, -1581, -1609, -1636, -1158, +2392, +2279, - +2166, +2119, +2072, +2121, +2170, +2170, +2170, +2170, - +1132, +1145, +1159, +1205, +1763, +1924, +2086, +1960, - +1834, +1829, +1825, +1756, +1688, +1675, +1663, +1586, - +1510, +1356, +1202, +1112, +1023, +981, +939, +897, - +856, +831, +807, +1774, +1718, +1817, +1405, -512, - -380, -409, -438, -403, -369, -502, -635, -768, - -902, -1042, -1182, -1482, -1782, -2138, -1982, -610, - -262, -486, -711, -744, -777, +162, +2125, +1912, - +2212, +2150, +2088, +2122, +2156, +2156, +2156, +2156, - +1194, +1146, +1100, +1182, +1776, +1927, +2079, +1863, - +1903, +1978, +1799, +1843, +1632, +1619, +1608, +1612, - +1617, +1517, +1418, +1351, +1284, +1216, +1149, +1098, - +1048, +945, +1099, +1781, +1695, +1954, +422, -566, - -530, -554, -579, -571, -565, -686, -806, -927, - -1049, -1232, -1416, -1679, -1943, -2342, -2486, -2501, - -2773, -2074, -1376, -1671, -2221, +458, +2369, +2137, - +2162, +2133, +2104, +2123, +2142, +2142, +2142, +2142, - +1256, +1149, +1043, +1160, +1790, +1931, +2073, +1766, - +1972, +2129, +1774, +1931, +1576, +1565, +1554, +1639, - +1724, +1679, +1635, +1590, +1546, +1453, +1361, +1300, - +1240, +1060, +1392, +1788, +1672, +2092, -560, -620, - -680, -700, -721, -741, -762, -870, -979, -1087, - -1196, -1423, -1650, -1877, -2104, -2291, -2478, -2857, - -2724, -2895, -3067, -3110, -3666, +2547, +2103, +2107, - +2112, +2116, +2120, +2124, +2128, +2128, +2128, +2128, - +1214, +1170, +1128, +1453, +1779, +1692, +1861, +1807, - +1753, +1732, +1712, +1803, +1640, +1759, +1623, +1710, - +1799, +1666, +1790, +1755, +1719, +1628, +1539, +1497, - +1456, +1352, +1504, +1752, +1745, +1445, -902, -898, - -894, -907, -921, -935, -950, -1070, -1190, -1310, - -1431, -1641, -1852, -2062, -2273, -2431, -2590, -2812, - -2779, -2929, -3080, -3279, -2198, +2298, +2187, +2124, - +2062, +2081, +2100, +2119, +2138, +2138, +2138, +2138, - +1172, +1193, +1214, +1747, +1769, +1710, +2163, +2360, - +2046, +1592, +1651, +1677, +1704, +1954, +1693, +1783, - +1874, +1654, +1947, +1920, +1893, +1805, +1718, +1695, - +1672, +1644, +1617, +1717, +1818, +798, -1245, -1176, - -1108, -1115, -1123, -1131, -1139, -1270, -1402, -1534, - -1666, -1860, -2054, -2248, -2442, -2572, -2702, -2768, - -2834, -2964, -3094, -3192, -219, +2306, +2272, +2142, - +2012, +2046, +2080, +2114, +2148, +2148, +2148, +2148, - +1194, +1150, +1364, +1784, +1694, +1983, +2272, +1441, - +2147, +1980, +1813, +1838, +1864, +1909, +1698, +1823, - +1949, +1818, +1943, +1989, +2034, +1933, +1833, +1812, - +1792, +1712, +1633, +1649, +1923, -536, -1459, -1390, - -1322, -1354, -1388, -1421, -1455, -1566, -1678, -1789, - -1901, -2078, -2256, -2433, -2611, -2744, -2878, -2915, - -2953, -2998, -3044, -3777, +1633, +2298, +1941, +2015, - +2090, +2107, +2124, +2141, +2158, +2158, +2158, +2158, - +1216, +1109, +1514, +1823, +1620, +2001, +1870, +1803, - +1224, +1600, +1464, +1232, +1000, +1096, +1192, +1352, - +1512, +1726, +1940, +2058, +2176, +2062, +1948, +1930, - +1912, +1781, +1650, +1583, +2028, -1871, -1674, -1605, - -1536, -1595, -1654, -1713, -1772, -1863, -1954, -2045, - -2136, -2297, -2458, -2619, -2780, -2917, -3054, -3063, - -3072, -3033, -2994, -2827, +2460, +2035, +2122, +2145, - +2168, +2168, +2168, +2168, +2168, +2168, +2168, +2168, - +1190, +1271, +1610, +1756, +1647, +1523, +1144, +1324, - +1249, +1364, +1224, +1211, +1199, +1255, +1566, +1430, - +1294, +1404, +1514, +1800, +2087, +2075, +2063, +2003, - +1944, +1654, +1621, +1811, +979, -1997, -1903, -1888, - -1874, -1927, -1982, -2036, -2091, -2163, -2236, -2308, - -2381, -2513, -2646, -2778, -2911, -3005, -3100, -3114, - -3129, -3039, -3206, -1084, +2317, +2104, +2148, +2159, - +2171, +2175, +2179, +2183, +2187, +2187, +2187, +2187, - +1164, +1179, +1195, +1179, +1163, +1302, +1442, +1358, - +1274, +1385, +1496, +1447, +1399, +1158, +1429, +1508, - +1588, +1594, +1601, +1543, +1486, +1832, +2179, +2077, - +1976, +1528, +1593, +1785, -582, -2381, -2133, -2172, - -2212, -2261, -2311, -2361, -2411, -2464, -2518, -2572, - -2626, -2730, -2834, -2938, -3042, -3094, -3146, -3166, - -3186, -3046, -3418, +658, +2174, +2174, +2174, +2174, - +2174, +2182, +2190, +2198, +2206, +2206, +2206, +2206, - +1202, +1230, +1259, +1272, +1286, +1321, +1356, +1343, - +1331, +1405, +1480, +1474, +1470, +1349, +1483, +1522, - +1562, +1576, +1591, +1573, +1557, +1589, +1622, +1718, - +1816, +1690, +1820, +1694, -2015, -2556, -2330, -2376, - -2422, -2610, -2799, -2700, -2602, -2669, -2736, -2803, - -2871, -2946, -3022, -3097, -3173, -3182, -3192, -3153, - -3115, -3324, -3278, +2256, +2159, +2147, +2136, +2156, - +2177, +2189, +2201, +2213, +2225, +2225, +2225, +2225, - +1240, +1282, +1325, +1367, +1410, +1340, +1271, +1329, - +1388, +1426, +1465, +1503, +1542, +1540, +1539, +1537, - +1536, +1559, +1582, +1605, +1628, +1603, +1578, +1617, - +1656, +1596, +1536, +1604, -2936, -2476, -2528, -2580, - -2632, -2704, -2777, -2785, -2794, -2874, -2955, -3035, - -3116, -3163, -3210, -3257, -3304, -3271, -3238, -3141, - -3044, -3091, -2114, +2319, +2144, +2121, +2098, +2139, - +2180, +2196, +2212, +2228, +2244, +2244, +2244, +2244, - +1230, +1255, +1281, +1306, +1333, +1303, +1272, +1338, - +1405, +1436, +1468, +1500, +1533, +1535, +1537, +1539, - +1542, +1562, +1584, +1605, +1627, +1601, +1577, +1616, - +1656, +1807, +1959, -417, -2793, -2797, -2545, -2581, - -2618, -2687, -2757, -2794, -2833, -2901, -2968, -3036, - -3105, -3145, -3186, -3178, -3171, -3149, -3128, -3058, - -2989, -3221, -126, +2281, +2129, +2084, +2040, +2107, - +2175, +2189, +2203, +2217, +2231, +2231, +2231, +2231, - +1220, +1229, +1238, +1247, +1257, +1266, +1275, +1348, - +1422, +1447, +1473, +1499, +1525, +1530, +1536, +1542, - +1548, +1567, +1587, +1606, +1626, +1601, +1577, +1616, - +1656, +1763, +1871, +1658, -2138, -2862, -2563, -2583, - -2604, -2671, -2738, -2805, -2873, -2928, -2983, -3038, - -3094, -3128, -3162, -3100, -3038, -3028, -3018, -2976, - -2934, -3352, +1862, +2244, +2114, +2048, +1982, +2076, - +2170, +2182, +2194, +2206, +2218, +2218, +2218, +2218, - +1210, +1234, +1259, +1283, +1308, +1325, +1341, +1390, - +1439, +1457, +1477, +1496, +1516, +1525, +1535, +1544, - +1554, +1571, +1589, +1607, +1625, +1616, +1608, +1632, - +1656, +1718, +1782, +1685, +1845, +528, -2836, -2728, - -2622, -2654, -2687, -2719, -2752, -2763, -2773, -2992, - -2955, -3030, -3106, -2813, -2777, -3226, -2908, -3134, - -3359, -971, +2186, +2270, +2099, +2075, +2052, +2108, - +2165, +2175, +2185, +2195, +2205, +2205, +2205, +2205, - +1200, +1240, +1280, +1320, +1360, +1384, +1408, +1432, - +1456, +1469, +1482, +1495, +1508, +1521, +1534, +1547, - +1560, +1576, +1592, +1608, +1624, +1632, +1640, +1648, - +1656, +1675, +1694, +1713, +1732, +1871, +986, -827, - -2640, -2638, -2636, -2634, -2632, -2598, -2564, -2946, - -2816, -2933, -3050, -2783, -3028, -3169, -1774, +293, - +2360, +2179, +1998, +2041, +2084, +2103, +2122, +2141, - +2160, +2168, +2176, +2184, +2192, +2192, +2192, +2192, - +1232, +1266, +1300, +1334, +1368, +1390, +1412, +1434, - +1456, +1468, +1482, +1494, +1508, +1520, +1534, +1546, - +1560, +1578, +1596, +1614, +1632, +1640, +1648, +1656, - +1664, +1645, +1628, +1705, +1784, +2101, +1908, +1298, - +688, +1071, -594, -1587, -2580, -2891, -3202, -2281, - -2640, -2058, -1476, -94, +1032, +2278, +2244, +2209, - +2176, +2131, +2088, +2091, +2096, +2111, +2128, +2143, - +2160, +2168, +2176, +2184, +2192, +2192, +2192, +2192, - +1264, +1292, +1320, +1348, +1376, +1396, +1416, +1436, - +1456, +1469, +1482, +1495, +1508, +1521, +1534, +1547, - +1560, +1580, +1600, +1620, +1640, +1648, +1656, +1664, - +1672, +1617, +1562, +1699, +1836, +1821, +1806, +1887, - +1968, +1964, +1960, +2020, +2080, +1936, +1792, +1200, - +1632, +1889, +2146, +2083, +2020, +2093, +2166, +2079, - +1992, +2085, +2178, +2143, +2108, +2121, +2134, +2147, - +2160, +2168, +2176, +2184, +2192, +2192, +2192, +2192, - +1296, +1318, +1340, +1362, +1384, +1402, +1420, +1438, - +1456, +1468, +1482, +1494, +1508, +1520, +1534, +1546, - +1560, +1582, +1604, +1626, +1648, +1656, +1664, +1672, - +1680, +1667, +1656, +1739, +1824, +1811, +1800, +1835, - +1872, +1881, +1890, +1819, +1748, +1995, +450, +937, - +912, +715, +2056, +2019, +1984, +2035, +2088, +2059, - +2032, +2085, +2140, +2129, +2120, +2129, +2140, +2149, - +2160, +2168, +2176, +2184, +2192, +2192, +2192, +2192, - +1328, +1344, +1360, +1376, +1392, +1408, +1424, +1440, - +1456, +1469, +1482, +1495, +1508, +1521, +1534, +1547, - +1560, +1584, +1608, +1632, +1656, +1664, +1672, +1680, - +1688, +1719, +1750, +1781, +1812, +1803, +1794, +1785, - +1776, +1798, +1820, +1874, +1928, +1798, +2180, +674, - +1216, +2103, +1966, +1957, +1948, +1979, +2010, +2041, - +2072, +2087, +2102, +2117, +2132, +2139, +2146, +2153, - +2160, +2168, +2176, +2184, +2192, +2192, +2192, +2192, - +1328, +1344, +1360, +1376, +1392, +1408, +1424, +1440, - +1456, +1468, +1482, +1494, +1508, +1520, +1534, +1546, - +1560, +1584, +1608, +1632, +1656, +1664, +1672, +1680, - +1688, +1718, +1750, +1780, +1812, +1802, +1794, +1784, - +1776, +1798, +1820, +1858, +1896, +1750, +1860, +2338, - +1792, +2134, +1966, +1956, +1948, +1978, +2010, +2040, - +2072, +2086, +2102, +2116, +2132, +2138, +2146, +2152, - +2160, +2168, +2176, +2184, +2192, +2192, +2192, +2192, - +1328, +1344, +1360, +1376, +1392, +1408, +1424, +1440, - +1456, +1469, +1482, +1495, +1508, +1521, +1534, +1547, - +1560, +1584, +1608, +1632, +1656, +1664, +1672, +1680, - +1688, +1719, +1750, +1781, +1812, +1803, +1794, +1785, - +1776, +1798, +1820, +1842, +1864, +1958, +2052, +1954, - +1856, +1911, +1966, +1957, +1948, +1979, +2010, +2041, - +2072, +2087, +2102, +2117, +2132, +2139, +2146, +2153, - +2160, +2168, +2176, +2184, +2192, +2192, +2192, +2192, - +1328, +1344, +1360, +1376, +1392, +1408, +1424, +1440, - +1456, +1468, +1482, +1494, +1508, +1520, +1534, +1546, - +1560, +1584, +1608, +1632, +1656, +1664, +1672, +1680, - +1688, +1718, +1750, +1780, +1812, +1802, +1794, +1784, - +1776, +1798, +1820, +1842, +1864, +1958, +2052, +1954, - +1856, +1910, +1966, +1956, +1948, +1978, +2010, +2040, - +2072, +2086, +2102, +2116, +2132, +2138, +2146, +2152, - +2160, +2168, +2176, +2184, +2192, +2192, +2192, +2192 +static const INT16 TEST_CB_COMPONENT[4096] = { + +1728, +1730, +1732, +1734, +1736, +1738, +1740, +1742, +1744, +1740, +1736, +1732, +1728, + +1796, +1864, +1804, +1744, +1754, +1764, +1774, +1784, +1794, +1804, +1814, +1824, +1774, + +1724, +1802, +1880, +1814, +1748, +1810, +1872, +1878, +1884, +1890, +1896, +1910, +1924, + +1938, +1952, +1938, +1924, +1910, +1896, +1914, +1932, +1950, +1968, +1974, +1980, +1986, + +1992, +1998, +2004, +2010, +2016, +2016, +2016, +2016, +2016, +2016, +2016, +2016, +1710, + +1697, +1684, +1704, +1723, +1726, +1730, +1733, +1737, +1738, +1740, +1741, +1743, +1758, + +1774, +1757, +1741, +1762, +1783, +1788, +1793, +1774, +1755, +1784, +1813, +1817, +1821, + +1825, +1829, +1857, +1885, +1881, +1877, +1849, +1821, +1857, +1894, +1904, +1914, +1924, + +1935, +1928, +1922, +1915, +1909, +1922, +1936, +1949, +1963, +1974, +1985, +1997, +2008, + +2009, +2011, +2012, +2014, +2017, +2020, +2023, +2026, +2026, +2026, +2026, +1692, +1664, + +1637, +1674, +1711, +1715, +1720, +1725, +1730, +1737, +1744, +1751, +1758, +1721, +1684, + +1711, +1738, +1770, +1802, +1802, +1802, +1754, +1706, +1754, +1802, +1860, +1918, +1848, + +1778, +1900, +2022, +1952, +1882, +1820, +1759, +1825, +1892, +1898, +1905, +1911, +1918, + +1919, +1920, +1921, +1922, +1931, +1940, +1949, +1958, +1974, +1991, +2008, +2025, +2021, + +2018, +2015, +2012, +2018, +2024, +2030, +2036, +2036, +2036, +2036, +1674, +1631, +1589, + +1644, +1698, +1703, +1710, +1716, +1723, +1735, +1748, +1760, +1773, +1763, +1754, +1760, + +1767, +1794, +1821, +1800, +1779, +1830, +1881, +1900, +1919, +2047, +2175, +2015, +1855, + +1879, +1903, +1927, +1951, +1759, +1824, +1856, +1890, +1892, +1895, +1897, +1901, +1909, + +1918, +1926, +1935, +1939, +1944, +1948, +1953, +1974, +1996, +2019, +2041, +2032, +2025, + +2017, +2010, +2019, +2028, +2037, +2046, +2046, +2046, +2046, +1656, +1599, +1543, +1614, + +1686, +1693, +1701, +1708, +1716, +1734, +1752, +1770, +1788, +1806, +1824, +1810, +1796, + +1818, +1840, +2054, +2268, +1650, +1032, +510, -12, -70, -128, +390, +908, +1602, + +2296, +2158, +2020, +1699, +1890, +1889, +1888, +1887, +1886, +1885, +1884, +1900, +1916, + +1932, +1948, +1948, +1948, +1948, +1948, +1975, +2003, +2030, +2058, +2045, +2033, +2020, + +2008, +2020, +2032, +2044, +2056, +2056, +2056, +2056, +1590, +1570, +1551, +1612, +1673, + +1579, +1742, +1713, +1685, +1672, +1660, +1711, +1763, +1694, +1626, +1941, +2001, +2060, + +583, -654, -1891, -2046, -2201, -2084, -1967, -2049, -2131, -2053, -1975, -1751, -1527, + +41, +1609, +2374, +1859, +2000, +1886, +1898, +1912, +1909, +1907, +1900, +1894, +1919, + +1945, +1944, +1944, +1943, +1943, +1967, +1992, +2017, +2042, +2032, +2023, +2014, +2006, + +2017, +2028, +2039, +2050, +2050, +2050, +2050, +1524, +1542, +1560, +1610, +1661, +1467, + +1785, +1719, +1654, +1611, +1568, +1653, +1738, +1839, +1940, +793, -866, -2050, -2210, + -2082, -1954, -1902, -1850, -1862, -1874, -1980, -2086, -1936, -1786, -1776, -1766, -1820, + -1874, -534, +1829, +2112, +1884, +1911, +1939, +1934, +1930, +1901, +1872, +1907, +1942, + +1941, +1940, +1939, +1938, +1960, +1982, +2004, +2027, +2021, +2015, +2009, +2004, +2014, + +2024, +2034, +2044, +2044, +2044, +2044, +1586, +1641, +1697, +1704, +1712, +1577, +1699, + +1660, +1623, +1613, +1604, +1642, +1681, +1791, -402, -2036, -1877, -2144, -1899, -1942, + -1985, -1918, -1851, -1880, -1909, -1959, -2009, -1931, -1853, -1801, -1749, -1617, -1485, + -1939, -1882, +96, +2074, +1971, +1869, +1895, +1921, +1885, +1850, +1894, +1939, +1937, + +1936, +1934, +1933, +1952, +1972, +1991, +2011, +2008, +2006, +2003, +2002, +2011, +2020, + +2029, +2038, +2038, +2038, +2038, +1136, +1229, +1322, +1287, +1252, +1433, +1614, +1603, + +1592, +1616, +1640, +1632, +1624, +2256, -1720, -1792, -1864, -1982, -2100, -2058, -2016, + -1934, -1852, -1898, -1944, -1938, -1932, -1926, -1920, -1826, -1732, -1670, -1608, -1552, + -1496, -1664, -1320, +2288, +1800, +1856, +1912, +1870, +1828, +1882, +1936, +1934, +1932, + +1930, +1928, +1945, +1962, +1979, +1996, +1997, +1998, +1999, +2000, +2008, +2016, +2024, + +2032, +2032, +2032, +2032, +1552, +1624, +1698, +1674, +1652, +1644, +1638, +1614, +1592, + +1611, +1630, +1681, +1733, +1146, -2000, -1787, -1830, -1924, -2019, -2049, -2080, -1986, + -1893, -1895, -1898, -1896, -1894, -1860, -1827, -1779, -1731, -1667, -1604, -1615, -1626, + -1878, -594, +2063, +1903, +2016, +1873, +2132, +1880, +1884, +1888, +1921, +1955, +1941, + +1927, +1925, +1925, +1955, +1987, +2005, +2025, +2043, +2063, +1995, +1927, +2099, +2015, + +2095, +2175, +2175, +1456, +1509, +1562, +1551, +1540, +1601, +1662, +1627, +1592, +1606, + +1621, +1731, +1842, +37, -2281, -1782, -1796, -1867, -1938, -2041, -2144, -2039, -1934, + -1893, -1852, -1854, -1857, -1795, -1734, -1732, -1731, -1665, -1600, -1678, -1757, -1836, + +645, +2094, +2007, +1920, +1322, +2139, +1933, +1886, +1840, +1909, +1979, +1952, +1926, + +1907, +1888, +1933, +1978, +2015, +2052, +2089, +2126, +1982, +1838, +2174, +1998, +2158, + +2318, +2318, +1488, +1520, +1554, +1554, +1556, +1588, +1622, +1606, +1592, +1569, +1547, + +1700, +1855, -993, -2049, -1825, -1858, -1905, -1953, -2016, -2080, -1995, -1911, -1858, + -1806, -1812, -1819, -1729, -1641, -1685, -1730, -1678, -1628, -1677, -1727, -2194, +1947, + +2125, +2046, +945, -2205, +114, +2177, +2144, +1856, +1912, +1970, +1963, +1957, +1935, + +1915, +1925, +1937, +1991, +2047, +2181, +2061, +2337, +2613, +1817, +2301, +2157, +2269, + +2397, +1520, +1533, +1546, +1559, +1572, +1577, +1582, +1587, +1592, +1533, +1474, +1671, + +1868, -2023, -1818, -1869, -1920, -1944, -1968, -1992, -2016, -1952, -1888, -1824, -1760, + -1771, -1782, -1665, -1548, -1639, -1730, -1693, -1656, -1677, -1699, -1017, +2226, +1644, + +2087, -286, -2148, -2167, -1674, +611, +2384, +2173, +1962, +1975, +1988, +1965, +1942, + +1919, +1896, +1969, +2042, +2019, +1484, -1916, -1220, +2484, +1068, -916, +1708, +1964, + +1504, +1514, +1526, +1536, +1548, +1550, +1554, +1556, +1560, +1581, +1604, +1786, +689, + -2138, -1894, -1905, -1918, -1926, -1935, -1943, -1952, -1878, -1805, -1731, -1658, -1626, + -1596, -1549, -1503, -1507, -1513, -1518, -1524, -1526, -1785, +148, +2080, +1995, +2422, + -2094, -2003, -2033, -1809, -1665, -1776, -189, +1398, +2536, +2139, +2122, +2105, +2327, + +2295, +2204, +2113, +2870, -213, -1669, -1077, -1237, -1653, -1589, +2059, +1931, +1488, + +1497, +1506, +1515, +1524, +1525, +1526, +1527, +1528, +1631, +1735, +1902, -490, -2254, + -1971, -1943, -1916, -1909, -1902, -1895, -1888, -1805, -1722, -1639, -1556, -1483, -1411, + -1434, -1458, -1377, -1297, -1344, -1392, -1376, -1872, +1312, +1935, +1834, +1734, -2622, + -2370, -2157, -1945, -1892, -1840, -2039, -2239, -2022, -782, -281, +220, +433, +134, + -377, -888, -1655, -1398, -1166, -934, -1374, -1302, -726, +2410, +1898, +1472, +1478, + +1486, +1492, +1500, +1498, +1498, +1496, +1496, +1600, +1705, +1666, -933, -1474, -2015, + -1964, -1914, -1891, -1869, -1846, -1824, -1731, -1639, -1546, -1454, -1387, -1321, -1191, + -1317, -1150, -1240, -1250, -1260, -1545, -1575, +2459, +1885, +2057, +182, -2429, -2225, + -2088, -1952, -1928, -1904, -1905, -1907, -2149, -1879, -1835, -1793, -1670, -1803, -1645, + -1489, -1491, -1239, -1335, -1431, -1335, -1495, +681, +2345, +2089, +1456, +1461, +1466, + +1471, +1476, +1473, +1470, +1467, +1464, +1570, +1676, +1174, -1888, -950, -2060, -1986, + -1912, -1874, -1836, -1798, -1760, -1658, -1556, -1454, -1352, -1292, -1232, -1204, -1688, + -1180, -1184, -1156, -1128, -1203, -254, +2071, +1836, +2281, -1370, -2237, -2080, -2020, + -1960, -1964, -1968, -2028, -2088, -2020, -1952, -1855, -1758, -1725, -1692, -1635, -1578, + -1329, -1592, -1504, -1416, -1040, -1688, +2088, +2280, +2280, +1428, +1438, +1450, +1460, + +1472, +1463, +1454, +1493, +1533, +1512, +1748, -160, -2068, -1346, -1137, -1775, -1902, + -1848, -1794, -1708, -1622, -1544, -1466, -1356, -1247, -1198, -1149, -1196, -1755, -1246, + -993, -1012, -1032, -1202, +930, +2023, +1837, +2238, -2480, -2286, -1838, -1799, -1761, + -1835, -1909, -1954, -2000, -1982, -1964, -1908, -1853, -1829, -1807, -1749, -1692, -1538, + -1642, -1526, -1410, -638, -122, +774, +1926, +1926, +1400, +1417, +1434, +1451, +1469, + +1454, +1439, +1520, +1602, +1455, +1820, -1239, -1737, -1743, -726, -1821, -1892, -1822, + -1752, -1618, -1485, -1431, -1377, -1259, -1142, -1104, -1066, -1188, -1823, -1313, -803, + -869, -936, -1203, +2115, +1976, +1838, +916, -2055, -1569, -1596, -1579, -1563, -1706, + -1850, -1881, -1913, -1944, -1976, -1962, -1949, -1935, -1922, -1864, -1807, -1749, -1692, + -1548, -1404, -1004, -92, +996, +2084, +2084, +1372, +1394, +1418, +1441, +1465, +1444, + +1423, +1483, +1543, +1765, +1732, -2204, -1533, -1611, -1179, -1274, -1882, -1764, -1646, + -1560, -1475, -1301, -1127, -1113, -1101, -994, -887, -1052, -1730, -1395, -804, -709, + -872, -306, +2051, +1929, +2063, -151, -1597, -1347, -1354, -1326, -1300, -1417, -1535, + -1599, -1665, -1730, -1796, -1824, -1852, -1880, -1909, -1883, -1857, -1767, -1678, -1570, + -1462, -1434, +1154, +2402, +1858, +1858, +1344, +1373, +1403, +1432, +1462, +1435, +1409, + +1446, +1484, +1564, +621, -1890, -1842, -1737, -1633, -728, -1872, -1706, -1541, -1503, + -1466, -1428, -1391, -1225, -1060, -884, -709, -917, -1638, -1478, -807, -551, -808, + +590, +1988, +1882, +2288, -1218, -1140, -1126, -1112, -1075, -1038, -1129, -1220, -1319, + -1418, -1517, -1616, -1686, -1756, -1826, -1896, -1902, -1908, -1786, -1664, -1592, -1520, + -1864, +2400, +2016, +2144, +2144, +1348, +1372, +1398, +1424, +1450, +1463, +1477, +1491, + +1505, +1729, -607, -1838, -1790, -1735, -1681, -1003, -1350, -1710, -1558, -1519, -1480, + -1382, -1285, -1379, -1475, -1208, -941, -611, -793, -796, -800, -611, -680, +1364, + +1872, +1932, +1481, -1150, -966, -926, -886, -868, -851, -929, -1009, -1061, -1114, + -1230, -1348, -1521, -1695, -1805, -1915, -1900, -1886, -1792, -1698, -1604, -1766, -744, + +2326, +2134, +2198, +2198, +1352, +1373, +1395, +1417, +1439, +1492, +1546, +1536, +1526, + +1894, -1835, -1787, -1739, -1735, -1731, -1279, -828, -1714, -1577, -1536, -1495, -1337, + -1180, -1023, -866, -764, -663, -562, -973, -371, -282, -417, -552, +2138, +1757, + +1983, +674, -1083, -793, -726, -660, -662, -665, -731, -798, -804, -811, -945, + -1080, -1357, -1635, -1784, -1934, -1899, -1865, -1798, -1732, -1616, -2012, +376, +2252, + +2252, +2252, +2252, +1356, +1373, +1391, +1409, +1427, +1425, +1423, +1501, +1579, +907, + -1814, -1702, -1847, -1909, -1716, -1634, -786, -1686, -1819, -1712, -1605, -1371, -1139, + -921, -705, -656, -608, -384, -416, -233, -308, -477, +376, +1968, +1769, +2033, + -5, -839, -651, -606, -562, -584, -606, -660, -715, -739, -763, -963, -1164, + -1432, -1702, -1843, -1985, -1977, -1971, -1884, -1798, -2012, -2226, +2152, +2178, +2194, + +2210, +2210, +1360, +1374, +1388, +1402, +1416, +1358, +1300, +1466, +1632, -81, -1794, + -1619, -1956, -2085, -1702, -1991, -744, -891, -526, -353, -180, -383, -586, -821, + -1056, -805, -554, -463, -372, -353, -334, -539, +1304, +1799, +1782, +2085, -684, + -597, -510, -487, -464, -506, -548, -590, -632, -674, -716, -982, -1248, -1509, + -1770, -1903, -2036, -2057, -2078, -1971, -1864, -1896, -1416, +2392, +2104, +2136, +2168, + +2168, +1346, +1358, +1371, +1383, +1396, +1395, +1393, +1552, +1711, -1177, -1762, -2203, + -1364, -465, +690, +1942, +1913, +1747, +1837, +1816, +1794, +1889, +1983, +1774, +1564, + +548, -468, -299, -386, -391, -398, -147, +1895, +1920, +1946, +1284, -401, -397, + -393, -421, -450, -478, -507, -568, -629, -722, -815, -1068, -1321, -1697, -2074, + -2082, -2091, -2129, -2168, -2030, -1894, -2028, +142, +2280, +2114, +2082, +2050, +2050, + +1332, +1343, +1354, +1365, +1377, +1432, +1487, +1382, +1278, -1763, -195, +1308, +1788, + +1667, +1547, +1522, +1498, +1569, +1641, +1681, +1721, +1600, +1480, +1552, +1624, +1901, + +2179, +1145, -401, -431, -462, -12, +1974, +1786, +2111, +484, -119, -198, -277, + -356, -436, -451, -467, -547, -627, -770, -914, -898, -882, -606, -330, -470, + -611, -1435, -2259, -2091, -1924, -2160, +1700, +2168, +2124, +2028, +1932, +1932, +1318, + +1327, +1337, +1346, +1357, +1405, +1452, +1420, +1389, +1381, +1629, +1748, +1356, +1495, + +1635, +1631, +1627, +1551, +1732, +1689, +1647, +1728, +1809, +1730, +1652, +1686, +1721, + +1948, +1921, +874, -430, +363, +1925, +1764, +1859, +148, -28, -95, -160, -291, + -422, -423, -426, -557, -688, -370, -309, -280, -251, -570, -890, -858, -826, + -563, -301, -1079, -1858, -1636, +2170, +2296, +2166, +2118, +2070, +2070, +1304, +1312, + +1321, +1329, +1338, +1378, +1419, +1459, +1500, +1452, +1404, +1420, +1436, +1580, +1724, + +1484, +1244, +1022, +1313, +1187, +1062, +1088, +1115, +1397, +1680, +1728, +1777, +1729, + +1682, +1922, +1651, +1763, +1876, +1742, +1609, -189, +62, +8, -45, -226, -408, + -397, -387, -568, -750, -227, -217, -430, -644, -1047, -1451, -1502, -1554, -1229, + -905, -580, -256, -856, +1616, +1912, +2208, +2208, +2208, +2208, +1290, +1304, +1319, + +1334, +1350, +1377, +1404, +1271, +1395, +1525, +1655, +1769, +1884, +1802, +1720, +1430, + +1141, +1026, +1168, +1037, +908, +700, +491, +331, +172, +873, +1575, +1524, +1731, + +1991, +1738, +1774, +1811, +1914, +993, -119, +48, -74, -196, -271, -346, -407, + -470, -324, -179, -213, -503, -810, -1117, -1273, -1430, -1636, -1841, -1823, -1551, + -1246, -686, +1194, +1026, +1610, +2194, +2194, +2194, +2194, +1276, +1297, +1319, +1341, + +1363, +1376, +1390, +1340, +1802, +1854, +1907, +1863, +1820, +1768, +1717, +1377, +1038, + +1031, +1024, +889, +755, +568, +381, +290, +200, +19, -162, +553, +1781, +2060, + +1827, +1786, +1746, +2086, +378, -50, +35, -156, -348, -316, -284, -419, -554, + -337, -121, -456, -791, -934, -1078, -1244, -1411, -1514, -1617, -1907, -1686, -1657, + -1116, +1964, +1972, +2076, +2180, +2180, +2180, +2180, +1262, +1289, +1318, +1346, +1375, + +1359, +1344, +1632, +1921, +1927, +1934, +1876, +1820, +1702, +1585, +1259, +935, +907, + +880, +724, +569, +436, +302, +217, +132, +44, -43, -99, +102, +801, +2011, + +1878, +1745, +1426, +2131, +916, -43, -191, -340, -393, -446, -461, -478, -237, + -254, -522, -790, -962, -1135, -1519, -1647, -1760, -1872, -1446, -2045, -1827, -1354, + +2254, +2278, +2222, +2166, +2166, +2166, +2166, +1248, +1283, +1318, +1353, +1388, +1343, + +1298, +1925, +2040, +2001, +1962, +1891, +1820, +1637, +1454, +1143, +832, +784, +736, + +560, +384, +304, +224, +144, +64, +70, +76, +18, -40, +54, +1684, +1714, + +1744, +1790, +1836, +1882, +1928, +798, -332, -470, -608, -505, -402, -139, -388, + -589, -790, -991, -1192, -1794, -1884, -2006, -2128, -2266, -868, +818, +2504, +2288, + +2072, +2112, +2152, +2152, +2152, +2152, +1238, +1263, +1290, +1332, +1375, +1301, +1484, + +2002, +2009, +1973, +1939, +1871, +1805, +1608, +1411, +1118, +826, +751, +676, +505, + +334, +273, +212, +151, +91, +69, +48, +11, -26, +482, +1758, +1771, +1784, + +2033, +1771, +1860, +1950, +1989, +2029, +884, -260, -1156, -261, -309, -614, -922, + -975, -1411, -1848, -2062, -2019, -697, +626, +2060, +2471, +2273, +2076, +2051, +2026, + +2081, +2136, +2136, +2136, +2136, +1228, +1245, +1263, +1313, +1363, +1260, +1670, +2080, + +1978, +1947, +1916, +1853, +1791, +1580, +1369, +1094, +820, +718, +616, +450, +285, + +243, +201, +159, +118, +69, +20, +4, -13, +910, +1833, +1828, +1824, +229, + +1706, +1839, +1972, +1901, +1830, +1983, +2136, +2032, +1416, +1056, +696, +280, +376, + +728, +1080, +1767, +2454, +2405, +2356, +2035, +2226, +2193, +2160, +2070, +1980, +2050, + +2120, +2120, +2120, +2120, +1218, +1226, +1235, +1292, +1350, +1235, +1888, +2061, +1979, + +1935, +1893, +1834, +1776, +1551, +1326, +1070, +814, +685, +556, +395, +235, +212, + +189, +166, +145, +116, +88, -68, +33, +1306, +1811, +1949, +1576, -200, -183, + +905, +1994, +1956, +1919, +1881, +1844, +2004, +1909, +2005, +2102, +2042, +2239, +2195, + +2152, +2043, +1935, +2370, +2038, +2697, +1821, +368, +2244, +2121, +1998, +2051, +2104, + +2104, +2104, +2104, +1208, +1208, +1209, +1273, +1338, +1210, +2107, +2043, +1980, +1925, + +1871, +1816, +1762, +1523, +1285, +1046, +808, +652, +497, +341, +186, +182, +179, + +175, +172, +164, +157, +117, +590, +1958, +1791, +1815, +816, +140, -24, -28, + -32, +988, +2008, +2036, +2064, +1977, +1890, +1931, +1972, +2013, +2054, +2127, +2200, + +2320, +2440, +2080, +184, -1760, -3192, +336, +2328, +2172, +2016, +2052, +2088, +2088, + +2088, +2088, +1222, +1215, +1209, +1266, +1325, +1459, +2104, +2046, +1989, +1945, +1903, + +1861, +1819, +1612, +1406, +1136, +866, +715, +564, +446, +328, +295, +263, +230, + +199, +481, +764, +711, +1427, +2086, +1721, +1692, +128, -37, +55, -14, -82, + -108, -135, +335, +804, +1293, +1783, +2272, +2250, +2197, +1889, +1356, +568, -763, + -2095, -3010, -2646, -2931, -2705, +2305, +2196, +2159, +2122, +2117, +2112, +2112, +2112, + +2112, +1236, +1223, +1210, +1261, +1313, +1708, +2103, +2050, +1998, +1967, +1937, +1907, + +1877, +1702, +1528, +1226, +924, +778, +633, +552, +471, +409, +348, +287, +226, + +287, +349, +283, +1241, +1702, +1652, +1826, -48, +43, +134, +1, -132, -181, + -230, -343, -456, -670, -884, -202, -544, -946, -1860, -1718, -2088, -2311, -2534, + -2469, -2404, -2311, -1706, +2483, +2064, +2146, +2228, +2182, +2136, +2136, +2136, +2136, + +1250, +1230, +1211, +1255, +1300, +1957, +2101, +2054, +2007, +1956, +1906, +1856, +1806, + +1696, +1586, +1284, +982, +841, +701, +657, +613, +554, +497, +438, +381, +412, + +445, +717, +1758, +1782, +1807, +1095, -128, -70, -11, -97, -182, -253, -325, + -428, -532, -761, -991, -580, -170, -1033, -873, -1976, -1800, -2018, -2237, -2343, + -2450, -2650, -35, +2308, +2092, +2117, +2142, +2151, +2160, +2160, +2160, +2160, +1264, + +1238, +1212, +1250, +1288, +2206, +2100, +2058, +2016, +1946, +1876, +1806, +1736, +1690, + +1644, +1342, +1040, +905, +770, +763, +756, +701, +646, +591, +536, +539, +542, + +897, +1764, +1607, +1962, +365, -208, -182, -156, -194, -232, -326, -420, -514, + -608, -853, -1098, -1471, -820, -97, -910, -955, -2024, -2238, -2452, -2474, -2496, + -2990, +1636, +2134, +2120, +2088, +2056, +2120, +2184, +2184, +2184, +2184, +1198, +1191, + +1185, +1227, +1525, +2065, +2093, +2009, +1925, +1887, +1850, +1781, +1712, +1682, +1653, + +1464, +1275, +1130, +986, +937, +889, +840, +792, +743, +696, +684, +674, +1335, + +1741, +1839, +1939, +54, -294, -295, -297, -298, -300, -414, -527, -641, -755, + -947, -1140, -1732, -1813, -733, -166, -1038, -887, -1234, -1581, -1609, -1636, -1158, + +2392, +2279, +2166, +2119, +2072, +2121, +2170, +2170, +2170, +2170, +1132, +1145, +1159, + +1205, +1763, +1924, +2086, +1960, +1834, +1829, +1825, +1756, +1688, +1675, +1663, +1586, + +1510, +1356, +1202, +1112, +1023, +981, +939, +897, +856, +831, +807, +1774, +1718, + +1817, +1405, -512, -380, -409, -438, -403, -369, -502, -635, -768, -902, -1042, + -1182, -1482, -1782, -2138, -1982, -610, -262, -486, -711, -744, -777, +162, +2125, + +1912, +2212, +2150, +2088, +2122, +2156, +2156, +2156, +2156, +1194, +1146, +1100, +1182, + +1776, +1927, +2079, +1863, +1903, +1978, +1799, +1843, +1632, +1619, +1608, +1612, +1617, + +1517, +1418, +1351, +1284, +1216, +1149, +1098, +1048, +945, +1099, +1781, +1695, +1954, + +422, -566, -530, -554, -579, -571, -565, -686, -806, -927, -1049, -1232, -1416, + -1679, -1943, -2342, -2486, -2501, -2773, -2074, -1376, -1671, -2221, +458, +2369, +2137, + +2162, +2133, +2104, +2123, +2142, +2142, +2142, +2142, +1256, +1149, +1043, +1160, +1790, + +1931, +2073, +1766, +1972, +2129, +1774, +1931, +1576, +1565, +1554, +1639, +1724, +1679, + +1635, +1590, +1546, +1453, +1361, +1300, +1240, +1060, +1392, +1788, +1672, +2092, -560, + -620, -680, -700, -721, -741, -762, -870, -979, -1087, -1196, -1423, -1650, -1877, + -2104, -2291, -2478, -2857, -2724, -2895, -3067, -3110, -3666, +2547, +2103, +2107, +2112, + +2116, +2120, +2124, +2128, +2128, +2128, +2128, +1214, +1170, +1128, +1453, +1779, +1692, + +1861, +1807, +1753, +1732, +1712, +1803, +1640, +1759, +1623, +1710, +1799, +1666, +1790, + +1755, +1719, +1628, +1539, +1497, +1456, +1352, +1504, +1752, +1745, +1445, -902, -898, + -894, -907, -921, -935, -950, -1070, -1190, -1310, -1431, -1641, -1852, -2062, -2273, + -2431, -2590, -2812, -2779, -2929, -3080, -3279, -2198, +2298, +2187, +2124, +2062, +2081, + +2100, +2119, +2138, +2138, +2138, +2138, +1172, +1193, +1214, +1747, +1769, +1710, +2163, + +2360, +2046, +1592, +1651, +1677, +1704, +1954, +1693, +1783, +1874, +1654, +1947, +1920, + +1893, +1805, +1718, +1695, +1672, +1644, +1617, +1717, +1818, +798, -1245, -1176, -1108, + -1115, -1123, -1131, -1139, -1270, -1402, -1534, -1666, -1860, -2054, -2248, -2442, -2572, + -2702, -2768, -2834, -2964, -3094, -3192, -219, +2306, +2272, +2142, +2012, +2046, +2080, + +2114, +2148, +2148, +2148, +2148, +1194, +1150, +1364, +1784, +1694, +1983, +2272, +1441, + +2147, +1980, +1813, +1838, +1864, +1909, +1698, +1823, +1949, +1818, +1943, +1989, +2034, + +1933, +1833, +1812, +1792, +1712, +1633, +1649, +1923, -536, -1459, -1390, -1322, -1354, + -1388, -1421, -1455, -1566, -1678, -1789, -1901, -2078, -2256, -2433, -2611, -2744, -2878, + -2915, -2953, -2998, -3044, -3777, +1633, +2298, +1941, +2015, +2090, +2107, +2124, +2141, + +2158, +2158, +2158, +2158, +1216, +1109, +1514, +1823, +1620, +2001, +1870, +1803, +1224, + +1600, +1464, +1232, +1000, +1096, +1192, +1352, +1512, +1726, +1940, +2058, +2176, +2062, + +1948, +1930, +1912, +1781, +1650, +1583, +2028, -1871, -1674, -1605, -1536, -1595, -1654, + -1713, -1772, -1863, -1954, -2045, -2136, -2297, -2458, -2619, -2780, -2917, -3054, -3063, + -3072, -3033, -2994, -2827, +2460, +2035, +2122, +2145, +2168, +2168, +2168, +2168, +2168, + +2168, +2168, +2168, +1190, +1271, +1610, +1756, +1647, +1523, +1144, +1324, +1249, +1364, + +1224, +1211, +1199, +1255, +1566, +1430, +1294, +1404, +1514, +1800, +2087, +2075, +2063, + +2003, +1944, +1654, +1621, +1811, +979, -1997, -1903, -1888, -1874, -1927, -1982, -2036, + -2091, -2163, -2236, -2308, -2381, -2513, -2646, -2778, -2911, -3005, -3100, -3114, -3129, + -3039, -3206, -1084, +2317, +2104, +2148, +2159, +2171, +2175, +2179, +2183, +2187, +2187, + +2187, +2187, +1164, +1179, +1195, +1179, +1163, +1302, +1442, +1358, +1274, +1385, +1496, + +1447, +1399, +1158, +1429, +1508, +1588, +1594, +1601, +1543, +1486, +1832, +2179, +2077, + +1976, +1528, +1593, +1785, -582, -2381, -2133, -2172, -2212, -2261, -2311, -2361, -2411, + -2464, -2518, -2572, -2626, -2730, -2834, -2938, -3042, -3094, -3146, -3166, -3186, -3046, + -3418, +658, +2174, +2174, +2174, +2174, +2174, +2182, +2190, +2198, +2206, +2206, +2206, + +2206, +1202, +1230, +1259, +1272, +1286, +1321, +1356, +1343, +1331, +1405, +1480, +1474, + +1470, +1349, +1483, +1522, +1562, +1576, +1591, +1573, +1557, +1589, +1622, +1718, +1816, + +1690, +1820, +1694, -2015, -2556, -2330, -2376, -2422, -2610, -2799, -2700, -2602, -2669, + -2736, -2803, -2871, -2946, -3022, -3097, -3173, -3182, -3192, -3153, -3115, -3324, -3278, + +2256, +2159, +2147, +2136, +2156, +2177, +2189, +2201, +2213, +2225, +2225, +2225, +2225, + +1240, +1282, +1325, +1367, +1410, +1340, +1271, +1329, +1388, +1426, +1465, +1503, +1542, + +1540, +1539, +1537, +1536, +1559, +1582, +1605, +1628, +1603, +1578, +1617, +1656, +1596, + +1536, +1604, -2936, -2476, -2528, -2580, -2632, -2704, -2777, -2785, -2794, -2874, -2955, + -3035, -3116, -3163, -3210, -3257, -3304, -3271, -3238, -3141, -3044, -3091, -2114, +2319, + +2144, +2121, +2098, +2139, +2180, +2196, +2212, +2228, +2244, +2244, +2244, +2244, +1230, + +1255, +1281, +1306, +1333, +1303, +1272, +1338, +1405, +1436, +1468, +1500, +1533, +1535, + +1537, +1539, +1542, +1562, +1584, +1605, +1627, +1601, +1577, +1616, +1656, +1807, +1959, + -417, -2793, -2797, -2545, -2581, -2618, -2687, -2757, -2794, -2833, -2901, -2968, -3036, + -3105, -3145, -3186, -3178, -3171, -3149, -3128, -3058, -2989, -3221, -126, +2281, +2129, + +2084, +2040, +2107, +2175, +2189, +2203, +2217, +2231, +2231, +2231, +2231, +1220, +1229, + +1238, +1247, +1257, +1266, +1275, +1348, +1422, +1447, +1473, +1499, +1525, +1530, +1536, + +1542, +1548, +1567, +1587, +1606, +1626, +1601, +1577, +1616, +1656, +1763, +1871, +1658, + -2138, -2862, -2563, -2583, -2604, -2671, -2738, -2805, -2873, -2928, -2983, -3038, -3094, + -3128, -3162, -3100, -3038, -3028, -3018, -2976, -2934, -3352, +1862, +2244, +2114, +2048, + +1982, +2076, +2170, +2182, +2194, +2206, +2218, +2218, +2218, +2218, +1210, +1234, +1259, + +1283, +1308, +1325, +1341, +1390, +1439, +1457, +1477, +1496, +1516, +1525, +1535, +1544, + +1554, +1571, +1589, +1607, +1625, +1616, +1608, +1632, +1656, +1718, +1782, +1685, +1845, + +528, -2836, -2728, -2622, -2654, -2687, -2719, -2752, -2763, -2773, -2992, -2955, -3030, + -3106, -2813, -2777, -3226, -2908, -3134, -3359, -971, +2186, +2270, +2099, +2075, +2052, + +2108, +2165, +2175, +2185, +2195, +2205, +2205, +2205, +2205, +1200, +1240, +1280, +1320, + +1360, +1384, +1408, +1432, +1456, +1469, +1482, +1495, +1508, +1521, +1534, +1547, +1560, + +1576, +1592, +1608, +1624, +1632, +1640, +1648, +1656, +1675, +1694, +1713, +1732, +1871, + +986, -827, -2640, -2638, -2636, -2634, -2632, -2598, -2564, -2946, -2816, -2933, -3050, + -2783, -3028, -3169, -1774, +293, +2360, +2179, +1998, +2041, +2084, +2103, +2122, +2141, + +2160, +2168, +2176, +2184, +2192, +2192, +2192, +2192, +1232, +1266, +1300, +1334, +1368, + +1390, +1412, +1434, +1456, +1468, +1482, +1494, +1508, +1520, +1534, +1546, +1560, +1578, + +1596, +1614, +1632, +1640, +1648, +1656, +1664, +1645, +1628, +1705, +1784, +2101, +1908, + +1298, +688, +1071, -594, -1587, -2580, -2891, -3202, -2281, -2640, -2058, -1476, -94, + +1032, +2278, +2244, +2209, +2176, +2131, +2088, +2091, +2096, +2111, +2128, +2143, +2160, + +2168, +2176, +2184, +2192, +2192, +2192, +2192, +1264, +1292, +1320, +1348, +1376, +1396, + +1416, +1436, +1456, +1469, +1482, +1495, +1508, +1521, +1534, +1547, +1560, +1580, +1600, + +1620, +1640, +1648, +1656, +1664, +1672, +1617, +1562, +1699, +1836, +1821, +1806, +1887, + +1968, +1964, +1960, +2020, +2080, +1936, +1792, +1200, +1632, +1889, +2146, +2083, +2020, + +2093, +2166, +2079, +1992, +2085, +2178, +2143, +2108, +2121, +2134, +2147, +2160, +2168, + +2176, +2184, +2192, +2192, +2192, +2192, +1296, +1318, +1340, +1362, +1384, +1402, +1420, + +1438, +1456, +1468, +1482, +1494, +1508, +1520, +1534, +1546, +1560, +1582, +1604, +1626, + +1648, +1656, +1664, +1672, +1680, +1667, +1656, +1739, +1824, +1811, +1800, +1835, +1872, + +1881, +1890, +1819, +1748, +1995, +450, +937, +912, +715, +2056, +2019, +1984, +2035, + +2088, +2059, +2032, +2085, +2140, +2129, +2120, +2129, +2140, +2149, +2160, +2168, +2176, + +2184, +2192, +2192, +2192, +2192, +1328, +1344, +1360, +1376, +1392, +1408, +1424, +1440, + +1456, +1469, +1482, +1495, +1508, +1521, +1534, +1547, +1560, +1584, +1608, +1632, +1656, + +1664, +1672, +1680, +1688, +1719, +1750, +1781, +1812, +1803, +1794, +1785, +1776, +1798, + +1820, +1874, +1928, +1798, +2180, +674, +1216, +2103, +1966, +1957, +1948, +1979, +2010, + +2041, +2072, +2087, +2102, +2117, +2132, +2139, +2146, +2153, +2160, +2168, +2176, +2184, + +2192, +2192, +2192, +2192, +1328, +1344, +1360, +1376, +1392, +1408, +1424, +1440, +1456, + +1468, +1482, +1494, +1508, +1520, +1534, +1546, +1560, +1584, +1608, +1632, +1656, +1664, + +1672, +1680, +1688, +1718, +1750, +1780, +1812, +1802, +1794, +1784, +1776, +1798, +1820, + +1858, +1896, +1750, +1860, +2338, +1792, +2134, +1966, +1956, +1948, +1978, +2010, +2040, + +2072, +2086, +2102, +2116, +2132, +2138, +2146, +2152, +2160, +2168, +2176, +2184, +2192, + +2192, +2192, +2192, +1328, +1344, +1360, +1376, +1392, +1408, +1424, +1440, +1456, +1469, + +1482, +1495, +1508, +1521, +1534, +1547, +1560, +1584, +1608, +1632, +1656, +1664, +1672, + +1680, +1688, +1719, +1750, +1781, +1812, +1803, +1794, +1785, +1776, +1798, +1820, +1842, + +1864, +1958, +2052, +1954, +1856, +1911, +1966, +1957, +1948, +1979, +2010, +2041, +2072, + +2087, +2102, +2117, +2132, +2139, +2146, +2153, +2160, +2168, +2176, +2184, +2192, +2192, + +2192, +2192, +1328, +1344, +1360, +1376, +1392, +1408, +1424, +1440, +1456, +1468, +1482, + +1494, +1508, +1520, +1534, +1546, +1560, +1584, +1608, +1632, +1656, +1664, +1672, +1680, + +1688, +1718, +1750, +1780, +1812, +1802, +1794, +1784, +1776, +1798, +1820, +1842, +1864, + +1958, +2052, +1954, +1856, +1910, +1966, +1956, +1948, +1978, +2010, +2040, +2072, +2086, + +2102, +2116, +2132, +2138, +2146, +2152, +2160, +2168, +2176, +2184, +2192, +2192, +2192, + +2192 }; -static const INT16 TEST_CR_COMPONENT[4096] = -{ - -2112, -2114, -2116, -2118, -2120, -2122, -2124, -2126, - -2128, -2118, -2108, -2098, -2088, -2150, -2212, -2146, - -2080, -2100, -2120, -2140, -2160, -2164, -2168, -2172, - -2176, -2092, -2008, -2052, -2096, -2132, -2168, -2076, - -1984, -2088, -2192, -2168, -2144, -2136, -2128, -2120, - -2112, -2126, -2140, -2154, -2168, -2150, -2132, -2114, - -2096, -2096, -2096, -2096, -2096, -2096, -2096, -2096, - -2096, -2080, -2064, -2048, -2032, -2032, -2032, -2032, - -2128, -2113, -2098, -2115, -2132, -2133, -2134, -2135, - -2137, -2127, -2117, -2107, -2097, -2117, -2137, -2125, - -2114, -2134, -2154, -2159, -2163, -2135, -2108, -2128, - -2149, -2132, -2116, -2116, -2115, -2115, -2114, -2098, - -2082, -2112, -2142, -2141, -2139, -2133, -2128, -2122, - -2117, -2127, -2137, -2147, -2158, -2146, -2134, -2122, - -2111, -2108, -2106, -2104, -2102, -2101, -2101, -2101, - -2101, -2087, -2073, -2059, -2045, -2045, -2045, -2045, - -2144, -2112, -2080, -2112, -2145, -2145, -2145, -2145, - -2146, -2136, -2126, -2116, -2107, -2085, -2063, -2105, - -2148, -2168, -2189, -2178, -2167, -2107, -2048, -2085, - -2122, -2173, -2225, -2180, -2135, -2098, -2061, -2120, - -2180, -2136, -2093, -2114, -2135, -2131, -2128, -2125, - -2122, -2128, -2135, -2141, -2148, -2142, -2137, -2131, - -2126, -2121, -2117, -2112, -2108, -2107, -2107, -2106, - -2106, -2094, -2082, -2070, -2058, -2058, -2058, -2058, - -2160, -2111, -2062, -2109, -2157, -2156, -2155, -2154, - -2155, -2145, -2135, -2125, -2116, -2132, -2148, -2132, - -2118, -2154, -2191, -2181, -2170, -2494, -2308, -2393, - -2479, -2470, -2461, -2243, -2282, -2353, -2167, -2174, - -2182, -2160, -2139, -2135, -2130, -2128, -2128, -2127, - -2127, -2129, -2132, -2134, -2138, -2138, -2139, -2139, - -2141, -2133, -2127, -2120, -2114, -2112, -2112, -2111, - -2111, -2101, -2091, -2081, -2071, -2071, -2071, -2071, - -2176, -2110, -2045, -2107, -2170, -2168, -2167, -2165, - -2164, -2154, -2145, -2135, -2126, -2180, -2235, -2161, - -2088, -2141, -2195, -2440, -2686, -2371, -1033, -398, - +236, +305, +375, -3, -894, -2096, -2787, -2485, - -2184, -2185, -2187, -2156, -2126, -2127, -2129, -2130, - -2132, -2131, -2130, -2129, -2128, -2135, -2142, -2149, - -2156, -2147, -2138, -2129, -2120, -2119, -2118, -2117, - -2116, -2108, -2100, -2092, -2084, -2084, -2084, -2084, - -2112, -2085, -2058, -2112, -2166, -2067, -2225, -2190, - -2157, -2107, -2057, -2104, -2151, -2119, -2088, -2632, - -2666, -2263, -837, +844, +2526, +3327, +2847, +2847, - +2847, +2726, +2606, +2967, +3070, +2968, +2867, +397, - -2074, -2745, -2137, -2281, -2169, -2202, -2236, -2190, - -2145, -2145, -2147, -2148, -2150, -2152, -2156, -2159, - -2163, -2159, -2156, -2152, -2150, -2130, -2111, -2123, - -2137, -2127, -2117, -2107, -2097, -2097, -2097, -2097, - -2048, -2060, -2073, -2118, -2163, -1967, -2284, -2217, - -2150, -2060, -1971, -2074, -2177, -2315, -2454, -1057, - +1364, +2990, +2568, +2593, +2619, +2369, +2631, +2508, - +2386, +2332, +2278, +2352, +2427, +2913, +2888, +3022, - +3156, +1302, -2088, -2406, -2213, -2279, -2345, -2251, - -2158, -2161, -2165, -2168, -2172, -2171, -2171, -2170, - -2170, -2172, -2175, -2177, -2180, -2142, -2105, -2131, - -2158, -2146, -2134, -2122, -2110, -2110, -2110, -2110, - -2112, -2163, -2215, -2235, -2255, -1994, -2247, -2194, - -2143, -2109, -2076, -2123, -2170, -2270, +700, +3527, - +2770, +2035, +2325, +2293, +2263, +2178, +2350, +2265, - +2181, +2129, +2078, +2154, +2231, +2521, +2557, +2559, - +2562, +3221, +3113, +140, -2832, -2034, -2261, -2199, - -2139, -2160, -2182, -2188, -2194, -2189, -2185, -2181, - -2177, -2185, -2193, -2201, -2210, -2154, -2098, -2138, - -2179, -2165, -2151, -2137, -2123, -2123, -2123, -2123, - -1664, -1755, -1846, -1841, -1836, -1767, -2210, -2173, - -2136, -2159, -2182, -2173, -2164, -2739, +2830, +2735, - +2640, +2361, +2082, +1995, +1908, +1989, +2070, +2023, - +1976, +1927, +1878, +1957, +2036, +2131, +2226, +2353, - +2480, +2581, +2682, +2943, +2692, -2815, -2178, -2149, - -2120, -2160, -2200, -2208, -2216, -2208, -2200, -2192, - -2184, -2198, -2212, -2226, -2240, -2166, -2092, -2146, - -2200, -2184, -2168, -2152, -2136, -2136, -2136, -2136, - -2096, -2166, -2238, -2228, -2220, -2087, -2210, -2173, - -2137, -2189, -2243, -2152, -2318, -2031, +3375, +2861, - +2605, +2305, +2007, +1851, +1697, +1756, +1815, +1810, - +1806, +1756, +1707, +1754, +1801, +1911, +2023, +2149, - +2277, +2299, +2323, +2729, +1345, -2439, -2129, -2217, - -2307, -2349, -2136, -2179, -2222, -2223, -2224, -2193, - -2162, -2171, -2180, -2190, -2199, -2198, -2198, -2213, - -2229, -2172, -2115, -2170, -2225, -2113, -2257, -2257, - -2016, -2067, -2118, -2105, -2093, -2152, -2211, -2174, - -2138, -2221, -2305, -2132, -2472, +212, +2897, +2477, - +2570, +2251, +1932, +1709, +1487, +1524, +1561, +1598, - +1636, +1586, +1537, +1552, +1567, +1693, +1820, +1947, - +2074, +2019, +1964, +2261, -514, -2321, -2080, -2031, - -1982, -2283, -2073, -2151, -2229, -2238, -2248, -2194, - -2140, -2144, -2149, -2154, -2159, -2231, -2304, -2281, - -2258, -2160, -2062, -2188, -2314, -2090, -2378, -2378, - -2064, -2094, -2126, -2125, -2125, -2152, -2179, -2159, - -2139, -2204, -2270, -2144, -2530, +1688, +2834, +2460, - +2343, +2147, +1953, +1678, +1404, +1387, +1370, +1418, - +1466, +1416, +1366, +1349, +1332, +1442, +1553, +1663, - +1775, +1817, +1861, +2415, -2405, -2457, -1999, -2035, - -281, -1464, -2393, -2378, -2363, -2301, -2240, -2195, - -2150, -2165, -2181, -2182, -2182, -2199, -2218, -2188, - -2159, -2756, -2329, -1934, -2307, -2627, -2179, -2307, - -2112, -2123, -2135, -2146, -2158, -2153, -2149, -2144, - -2140, -2188, -2236, -2156, -2588, +3164, +2772, +2444, - +2116, +2045, +1975, +1648, +1322, +1251, +1181, +1238, - +1296, +1246, +1197, +1147, +1098, +1192, +1287, +1381, - +1476, +1617, +1758, +1291, -2760, -2083, -2430, -1273, - -628, -647, -667, -1582, -2498, -2365, -2233, -2196, - -2160, -2187, -2215, -2210, -2206, -2169, -2133, -2096, - -2060, -280, -548, -2448, -1788, -860, -1980, -2236, - -2112, -2120, -2130, -2140, -2150, -2145, -2141, -2137, - -2133, -2147, -2161, -2079, -718, +3207, +2525, +2291, - +2057, +1941, +1827, +1553, +1279, +1174, +1070, +1094, - +1118, +1044, +970, +976, +983, +1001, +1019, +1165, - +1313, +1305, +1555, -212, -2491, -2189, -2401, -867, - -615, -642, -671, -603, -536, -1354, -2172, -2271, - -2370, -2340, -2311, -2330, -2349, -2315, -2282, -2697, - -1321, -420, -543, -394, -757, -741, -2261, -2261, - -2112, -2119, -2127, -2135, -2143, -2138, -2134, -2130, - -2126, -2106, -2087, -2259, +640, +2995, +2279, +2138, - +1998, +1839, +1681, +1459, +1237, +1098, +960, +950, - +940, +842, +744, +806, +869, +811, +753, +951, - +1150, +995, +1352, -1715, -2222, -2297, -2372, -463, - -602, -639, -676, -649, -623, -600, -577, -810, - -1044, -1214, -1384, -1426, -1469, -1183, -897, -483, - -582, -560, -538, -900, -750, -1134, -2542, -2286, - -2112, -2117, -2123, -2129, -2135, -2131, -2127, -2123, - -2119, -2017, -1916, -2886, +1262, +2014, +2256, +2097, - +1939, +1736, +1534, +1364, +1194, +1022, +850, +806, - +762, +736, +710, +508, +818, +604, +646, +752, - +859, +1131, +1149, -2865, -2273, -2339, -1639, -425, - -493, -522, -553, -566, -581, -677, -773, -661, - -550, -567, -585, -586, -588, -657, -727, -572, - -675, -668, -661, -798, -679, -1799, -2407, -2151, - -2112, -2116, -2120, -2124, -2128, -2124, -2120, -2116, - -2112, -2185, -2258, -1723, +1884, +1035, +2234, +2057, - +1880, +1634, +1388, +1270, +1152, +946, +740, +662, - +584, +630, +676, +466, +1280, +654, +540, +554, - +568, +757, -78, -2481, -2324, -2383, -906, -389, - -384, -407, -430, -485, -540, -499, -458, -513, - -568, -689, -810, -771, -732, -645, -558, -663, - -768, -776, -784, -696, -608, -2464, -2272, -2016, - -2104, -2110, -2116, -2122, -2129, -2105, -2081, -2105, - -2130, -2204, -2536, -84, +1856, +1148, +1209, +1701, - +1683, +1507, +1332, +1188, +1045, +837, +630, +518, - +407, +489, +572, +398, +1249, +662, +330, +383, - +436, +589, -1304, -2350, -2117, -2615, +213, -12, - -239, -265, -293, -320, -348, -377, -407, -484, - -562, -626, -691, -675, -661, -625, -590, -682, - -776, -804, -832, -540, -248, -664, -1848, -2616, - -2096, -2104, -2113, -2121, -2130, -2086, -2043, -2095, - -2148, -2225, -2815, +1555, +1829, +1519, +697, +1603, - +1486, +1381, +1276, +1107, +938, +729, +520, +375, - +230, +349, +468, +331, +1219, +670, +121, +212, - +304, +423, -2531, -2477, -2423, -1569, +309, -149, - -94, -125, -157, -157, -157, -256, -356, -456, - -556, -564, -573, -581, -590, -606, -623, -703, - -784, -832, -880, -384, +112, -1424, -2448, -2192, - -2088, -2098, -2109, -2119, -2131, -2099, -2068, -2100, - -2134, -2485, -2325, +2921, +2025, +1536, +1048, +1088, - +1385, +1270, +1156, +993, +831, +700, +570, +407, - +245, +256, +268, +343, +932, +662, +135, +185, - +236, -337, -2445, -2346, -2504, -793, +149, -75, - -45, -64, -84, -88, -93, -183, -273, -363, - -454, -454, -454, -518, -583, -619, -655, -723, - -792, -796, -800, -868, -1960, -2296, -2376, -2248, - -2080, -2093, -2106, -2119, -2132, -2113, -2094, -2107, - -2120, -2234, -813, +2752, +2222, +1555, +1401, +574, - +1284, +1160, +1036, +880, +724, +672, +620, +440, - +260, +164, +69, +357, +646, +654, +151, +159, - +168, -1096, -2361, -2217, -2586, -18, -11, -3, - +4, -4, -13, -21, -30, -110, -191, -271, - -352, -344, -336, -456, -576, -632, -688, -744, - -800, -760, -720, -584, -2496, -2400, -2304, -2304, - -2072, -2086, -2102, -2117, -2133, -2171, -2211, -2170, - -2130, -2462, +1045, +2615, +2138, +1656, +1432, +807, - +951, +1193, +924, +734, +545, +397, +250, +486, - +723, +569, +416, +311, +207, +384, +305, +242, - +180, -1825, -2295, -2348, -1891, +69, -19, -10, - -3, -7, -12, -16, -22, -65, -107, -182, - -258, -309, -361, -477, -593, -640, -688, -736, - -784, -752, -720, -1200, -2448, -2384, -2320, -2320, - -2064, -2081, -2099, -2116, -2134, -2231, -2329, -2234, - -2140, -2691, +2902, +2478, +2055, +1759, +1464, +1041, - +618, +1227, +812, +589, +366, +379, +392, +277, - +162, +207, +253, +267, +281, +114, -52, +70, - +192, -2555, -2230, -2481, -1197, +156, -28, -19, - -10, -11, -12, -13, -15, -20, -25, -94, - -164, -275, -387, -498, -610, -649, -689, -728, - -768, -744, -720, -1816, -2400, -2368, -2336, -2336, - -2056, -2075, -2095, -2115, -2135, -2178, -2222, -2138, - -2310, -1319, +2743, +2293, +2099, +1893, +1432, +1242, - +541, +1036, +1020, +699, +379, +376, +374, +275, - +177, +196, +217, +189, +162, +100, +39, +153, - -756, -2420, -2293, -2549, -502, +131, -4, -10, - -17, -14, -12, -9, -7, -7, -6, -102, - -198, -320, -444, -519, -595, -641, -689, -720, - -752, -768, -784, -2192, -2320, -2336, -2352, -2352, - -2048, -2070, -2092, -2114, -2136, -2126, -2116, -2042, - -2480, +52, +2584, +2108, +2144, +2028, +1400, +1444, - +464, +78, -308, -470, -632, -394, -156, +18, - +192, +187, +182, +113, +44, +87, +130, +237, - -1704, -2286, -2356, -2618, +192, +106, +20, -2, - -24, -18, -12, -6, +0, +6, +12, -110, - -232, -367, -502, -541, -580, -635, -690, -713, - -736, -792, -848, -2568, -2240, -2304, -2368, -2368, - -2046, -2068, -2091, -2113, -2136, -2121, -2105, -2186, - -2523, +1999, +2681, +2740, +1518, +117, -1541, -2639, - -2457, -2465, -2474, -2466, -2459, -2498, -2536, -2303, - -2070, -995, +81, -76, +24, +35, +47, -150, - -2394, -2422, -2450, -1806, +117, +85, +53, +21, - -11, -11, -11, -11, -11, -11, -11, -107, - -203, -404, -606, -615, -625, -610, -596, -693, - -791, -757, -1491, -2401, -2287, -2303, -2319, -2319, - -2044, -2067, -2090, -2113, -2137, -2116, -2095, -2074, - -2054, +2923, +219, -1748, -2692, -2563, -2435, -2114, - -2306, -2193, -2080, -2159, -2239, -2298, -2357, -2320, - -2284, -2432, -2580, -1544, +4, -16, -36, -280, - -2572, -2302, -2544, -994, +43, +64, +86, +44, - +2, -4, -10, -16, -22, -28, -34, -104, - -174, -186, -198, -178, -158, -330, -502, -674, - -846, -722, -2134, -2234, -2334, -2302, -2270, -2270, - -2042, -2065, -2089, -2112, -2137, -2159, -2180, -2154, - -2129, -2458, -2532, -2604, -2166, -2218, -2272, -2293, - -2315, -2000, -2198, -2219, -2242, -2322, -2401, -2385, - -2370, -2285, -2201, -2452, -2704, -1411, +137, -1402, - -2174, -2502, -2830, +250, +0, +28, +55, +35, - +15, +3, -9, -21, -33, -45, -57, -101, - -145, -175, -206, -220, -235, -177, -120, -414, - -709, -191, -2489, -2547, -2349, -2349, -2349, -2349, - -2040, -2064, -2089, -2113, -2138, -2202, -2267, -2235, - -2204, -2207, -2210, -2181, -2152, -2131, -2110, -2217, - -1812, -1552, -2317, -2025, -1734, -1578, -1423, -1939, - -2456, -2395, -2334, -2081, -2340, -2551, -2250, -2013, - -2288, -2446, -2093, -43, -42, -8, +25, +26, - +28, +10, -8, -26, -44, -62, -80, -98, - -116, -165, -214, -263, -312, -281, -250, -155, - -60, -940, -1820, -2348, -2364, -2396, -2428, -2428, - -2038, -2058, -2079, -2100, -2122, -2123, -2124, -2285, - -2191, -2065, -1940, -1910, -1882, -2232, -2327, -2149, - -1717, -1485, -2022, -1759, -1497, -1242, -987, -716, - -446, -1226, -2007, -2723, -2160, -2330, -2245, -2175, - -2362, -2338, -1034, +109, -28, -19, -10, +15, - +41, +19, -3, -25, -47, -89, -131, -141, - -151, -208, -266, -355, -445, -458, -472, -405, - -83, -1135, -1163, -1895, -2371, -2387, -2403, -2403, - -2036, -2053, -2071, -2089, -2107, -2044, -1982, -2080, - -1666, -1668, -1671, -1897, -2124, -2590, -2545, -2083, - -1622, -1419, -1729, -1495, -1261, -1162, -1064, -774, - -484, -314, -144, -806, -2492, -2366, -2240, -2338, - -2436, -2486, -489, +4, -15, -30, -45, +4, - +54, +28, +2, -24, -50, -116, -182, -184, - -186, -252, -318, -448, -578, -636, -694, -656, - -106, -2098, -2042, -2210, -2378, -2378, -2378, -2378, - -2034, -2047, -2062, -2076, -2091, -2093, -2096, -1650, - -1461, -1687, -1913, -2155, -2398, -2676, -2442, -2016, - -1591, -1448, -1563, -1341, -1120, -986, -853, -623, - -394, -265, -137, +200, +24, -1554, -2363, -2324, - -2286, -2122, -2727, -1220, +31, +136, -15, +25, - +67, +37, +7, -7, -21, -111, -201, -211, - -221, -295, -370, -460, -551, -509, -468, -634, - -545, -2805, -2249, -2301, -2353, -2353, -2353, -2353, - -2032, -2043, -2054, -2065, -2076, -2143, -2210, -1477, - -1768, -1962, -2156, -2414, -2672, -2762, -2340, -1950, - -1560, -1479, -1398, -1189, -980, -811, -642, -473, - -304, -217, -130, -75, -20, +27, -2486, -2311, - -2136, -2527, -2406, -2445, -2484, -979, +14, +47, - +80, +46, +12, +10, +8, -106, -220, -238, - -256, -339, -422, -473, -524, -639, -754, -1637, - -2520, -2232, -2456, -2392, -2328, -2328, -2328, -2328, - -2012, -2030, -2049, -2052, -2055, -2191, -2073, -1585, - -1867, -2081, -2296, -2526, -2757, -2653, -2294, -1886, - -1479, -1380, -1282, -1087, -893, -748, -604, -491, - -379, -243, -109, -181, +1, -606, -2493, -2283, - -2331, -2481, -2376, -2413, -2452, -2308, -2421, -1350, - -278, -124, +30, +88, +145, +127, +109, +27, - -56, -278, -501, -1107, -1714, -2162, -2612, -2532, - -2453, -2297, -2397, -2369, -2341, -2341, -2341, -2341, - -1992, -2018, -2045, -2040, -2035, -2241, -1936, -1695, - -1966, -2201, -2436, -2639, -2842, -2545, -2248, -1823, - -1398, -1282, -1166, -986, -806, -686, -566, -510, - -454, -271, -88, -289, +22, -1239, -2500, -2257, - -2526, -388, -2346, -2383, -2421, -2358, -2296, -2490, - -2684, -2342, -2001, -1627, -1254, -1176, -1099, -1501, - -1904, -2266, -2628, -2510, -2393, -2407, -2422, -2404, - -2386, -2362, -2338, -2346, -2354, -2354, -2354, -2354, - -1972, -2006, -2040, -2043, -2046, -2194, -1831, -1835, - -2097, -2336, -2576, -2735, -2895, -2564, -2234, -1839, - -1445, -1279, -1114, -916, -719, -623, -528, -528, - -529, -425, -323, -59, -53, -2527, -2443, -2517, - -2081, +170, -140, -1312, -2485, -2440, -2395, -2382, - -2370, -2400, -2431, -2509, -2589, -2559, -2530, -2500, - -2472, -2429, -2387, -2489, -2335, -2939, -2008, -1331, - -2447, -2395, -2343, -2355, -2367, -2367, -2367, -2367, - -1952, -1994, -2037, -2047, -2058, -2148, -1727, -1977, - -2228, -2472, -2716, -2832, -2948, -2584, -2220, -1856, - -1492, -1277, -1062, -847, -632, -561, -490, -547, - -604, -581, -558, -343, -1152, -2281, -2386, -2523, - -1124, -40, +19, +15, +10, -1242, -2495, -2531, - -2568, -2459, -2350, -2369, -2388, -2407, -2426, -2477, - -2528, -2593, -2659, -2212, -1254, +369, +967, -1026, - -2508, -2428, -2348, -2364, -2380, -2380, -2380, -2380, - -1948, -1996, -2044, -2060, -2077, -1957, -1837, -2069, - -2303, -2545, -2788, -2918, -3049, -2873, -2442, -2026, - -1611, -1374, -1138, -965, -793, -732, -672, -707, - -743, -847, -953, -2017, -2059, -2441, -2313, -2327, - -295, +99, -19, +23, +65, +26, -13, -629, - -1246, -1795, -2345, -2509, -2675, -2540, -2406, -1887, - -1368, -467, +434, +439, +699, +1162, +856, -2695, - -2409, -2413, -2417, -2389, -2361, -2361, -2361, -2361, - -1944, -1998, -2052, -2074, -2097, -1767, -1949, -2163, - -2378, -2619, -2860, -3005, -3150, -3163, -2664, -2197, - -1730, -1472, -1214, -1084, -954, -904, -854, -868, - -882, -859, -836, -877, -1942, -2091, -2240, -2389, - +22, -18, -57, +32, +121, +14, -93, -9, - +76, +149, +221, +166, +110, +143, +175, +239, - +304, +379, +455, +530, +605, +676, +235, -2573, - -2310, -2398, -2486, -2414, -2342, -2342, -2342, -2342, - -1940, -2000, -2060, -2072, -2084, -1640, -1964, -2144, - -2325, -2532, -2740, -2899, -3059, -3052, -2790, -2319, - -1849, -1569, -1290, -1202, -1115, -1075, -1036, -1028, - -1021, -1077, -1135, -503, -2689, -2395, -2359, -1553, - +19, -6, -30, +25, +80, +34, -12, +37, - +86, +124, +162, +137, +111, +137, +163, +237, - +312, +393, +475, +525, +574, +654, -803, -2466, - -2339, -2383, -2427, -2375, -2323, -2323, -2323, -2323, - -1936, -2002, -2068, -2070, -2072, -1514, -1980, -2126, - -2272, -2446, -2620, -2794, -2968, -2942, -2916, -2442, - -1968, -1667, -1366, -1321, -1276, -1247, -1218, -1189, - -1160, -1041, -922, -1411, -2412, -2189, -2478, -719, - +16, +6, -4, +18, +40, +54, +68, +82, - +96, +100, +104, +108, +112, +132, +152, +236, - +320, +408, +496, +520, +544, +632, -1840, -2360, - -2368, -2368, -2368, -2336, -2304, -2304, -2304, -2304, - -1898, -1921, -1944, -2111, -1766, -1551, -1848, -1985, - -2122, -2318, -2515, -2664, -2813, -3074, -3079, -2828, - -2321, -2024, -1729, -1608, -1489, -1457, -1425, -1393, - -1362, -1246, -1131, -1879, -2372, -2532, -2693, +331, - +25, +40, +55, +54, +54, +71, +88, +105, - +123, +151, +180, +208, +237, +83, -70, +48, - +167, +248, +329, +346, +363, +733, -2738, -2577, - -2416, -2395, -2374, -2353, -2332, -2332, -2332, -2332, - -1860, -1840, -1820, -2152, -1460, -1588, -1716, -1844, - -1972, -2191, -2411, -2535, -2659, -2950, -2730, -2958, - -2674, -2383, -2092, -1897, -1703, -1668, -1633, -1598, - -1564, -1452, -1340, -2348, -2333, -2365, -1885, -157, - +34, +74, +115, +91, +68, +88, +109, +129, - +150, +203, +256, +309, +362, +291, +220, +117, - +14, +88, +162, +172, +183, -702, -2612, -2282, - -2464, -2422, -2380, -2370, -2360, -2360, -2360, -2360, - -2110, -1967, -1824, -1953, -1314, -1513, -1712, -1815, - -1918, -2207, -2242, -2453, -2408, -2602, -2541, -2752, - -2707, -2692, -2679, -2409, -2140, -2054, -1968, -1867, - -1766, -1721, -1677, -2369, -2293, -2516, -948, -53, - +75, +92, +110, +95, +82, +105, +129, +152, - +177, +222, +268, +313, +359, +354, +350, +441, - +533, +472, +411, +414, +674, -1689, -2518, -2339, - -2416, -2401, -2386, -2387, -2388, -2388, -2388, -2388, - -1848, -1838, -1828, -1754, -1168, -1438, -1708, -1786, - -1864, -2225, -2075, -2372, -2158, -2255, -2353, -2546, - -2740, -2747, -2755, -2666, -2578, -2441, -2305, -2136, - -1968, -1991, -2015, -2390, -2254, -2669, -13, +51, - +116, +111, +106, +101, +96, +123, +150, +177, - +204, +242, +280, +318, +356, +418, +480, +510, - +540, +600, +661, +657, +1166, -2677, -2425, -2396, - -2368, -2380, -2392, -2404, -2416, -2416, -2416, -2416, - -1882, -1711, -1796, -1369, -1198, -1419, -1640, -1749, - -1858, -1977, -1842, -2058, -2019, -2113, -2207, -2366, - -2525, -2478, -2689, -2836, -2983, -2759, -2536, -2393, - -2250, -2194, -2139, -2357, -2318, -2018, +72, +113, - +157, +150, +145, +139, +134, +159, +186, +212, - +239, +273, +308, +342, +377, +439, +502, +548, - +595, +632, +669, +931, +170, -2666, -2430, -2403, - -2376, -2385, -2394, -2403, -2412, -2412, -2412, -2412, - -1916, -1840, -2276, -1240, -1228, -1400, -1572, -1712, - -1852, -1731, -1610, -1745, -1881, -1972, -2063, -2186, - -2310, -2211, -2625, -2751, -2877, -2822, -2768, -2650, - -2532, -2398, -2265, -2324, -2383, -1369, +156, +177, - +198, +191, +185, +178, +172, +197, +223, +248, - +274, +305, +336, +367, +398, +461, +524, +587, - +650, +664, +679, +1206, -827, -2656, -2437, -2410, - -2384, -2390, -2396, -2402, -2408, -2408, -2408, -2408, - -1950, -1953, -1956, -1063, -1194, -1317, -1440, -1435, - -1430, -1499, -1314, -1431, -1550, -1638, -1726, -1798, - -1871, -1927, -2240, -2409, -2578, -2597, -2616, -2731, - -2846, -2554, -2262, -2259, -2511, -527, +176, +207, - +239, +231, +224, +217, +210, +234, +259, +284, - +309, +336, +364, +391, +419, +482, +546, +609, - +673, +744, +816, +936, -2015, -2485, -2187, -2289, - -2392, -2395, -2398, -2401, -2404, -2404, -2404, -2404, - -1984, -2066, -1636, -886, -1160, -1234, -1308, -1414, - -1520, -2037, -2042, -1887, -1732, -1817, -1902, -1923, - -1944, -1900, -1856, -2068, -2280, -2372, -2464, -2556, - -2648, -2454, -2260, -2194, -2640, +314, +196, +238, - +280, +272, +264, +256, +248, +272, +296, +320, - +344, +368, +392, +416, +440, +504, +568, +632, - +696, +825, +954, +923, -2692, -2315, -2450, -2425, - -2400, -2400, -2400, -2400, -2400, -2400, -2400, -2400, - -2252, -1953, -1142, -1035, -1441, -1826, -2211, -2244, - -2278, -2220, -1908, -1914, -1922, -2001, -2336, -2095, - -2111, -2171, -2231, -2131, -2031, -2143, -2255, -2303, - -2352, -2306, -2260, -2359, -1689, +442, +269, +305, - +341, +333, +325, +317, +309, +329, +349, +369, - +389, +415, +441, +468, +494, +536, +579, +669, - +760, +797, +1091, -248, -2610, -2406, -2459, -2431, - -2404, -2400, -2396, -2392, -2388, -2388, -2388, -2388, - -2008, -2096, -1673, -1953, -2234, -2162, -2091, -2051, - -2012, -2149, -2286, -2199, -2113, -1930, -2259, -2012, - -2278, -2186, -2094, -2194, -2295, -2171, -2047, -2051, - -2056, -2158, -2261, -2524, -739, +570, +343, +372, - +402, +394, +386, +378, +370, +386, +402, +418, - +434, +462, +491, +520, +549, +569, +590, +707, - +824, +770, +1228, -1418, -2528, -2498, -2468, -2438, - -2408, -2400, -2392, -2384, -2376, -2376, -2376, -2376, - -1988, -2191, -2139, -2150, -2163, -2130, -2098, -2081, - -2066, -2140, -2216, -2179, -2143, -2066, -2245, -2137, - -2285, -2233, -2181, -2225, -2270, -2326, -2382, -2166, - -1952, -2250, -2549, -2465, +180, +394, +352, +407, - +463, +455, +447, +423, +399, +523, +391, +547, - +447, +493, +540, +572, +603, +633, +665, +792, - +920, +1094, +1269, -2764, -2446, -2429, -2413, -2412, - -2412, -2400, -2388, -2376, -2364, -2364, -2364, -2364, - -1968, -2031, -2094, -2093, -2092, -2099, -2106, -2113, - -2120, -2133, -2147, -2160, -2174, -2203, -2233, -2262, - -2292, -2280, -2269, -2257, -2246, -2226, -2207, -2283, - -2360, -2343, -2327, -2406, +586, -38, +363, +443, - +524, +516, +508, +468, +428, +660, +380, +676, - +460, +525, +591, +624, +658, +699, +741, +878, - +1016, +907, +286, -2575, -2364, -2361, -2358, -2387, - -2416, -2400, -2384, -2368, -2352, -2352, -2352, -2352, - -2020, -2071, -2124, -2080, -2037, -2062, -2089, -2115, - -2142, -2152, -2164, -2176, -2188, -2211, -2235, -2259, - -2283, -2275, -2267, -2260, -2253, -2249, -2246, -2290, - -2336, -2337, -2339, -1205, -71, -16, +296, +496, - +441, +469, +497, +381, +521, +635, +493, +735, - +465, +544, +624, +640, +656, +747, +839, +899, - +960, +1115, -1033, -2493, -2418, -2378, -2339, -2379, - -2420, -2408, -2396, -2384, -2372, -2372, -2372, -2372, - -2072, -2113, -2155, -2068, -1982, -2027, -2073, -2118, - -2164, -2173, -2183, -2193, -2203, -2220, -2238, -2256, - -2274, -2270, -2267, -2264, -2261, -2273, -2286, -2299, - -2312, -2332, -2352, -2052, -729, +7, +230, +550, - +358, +422, +486, +294, +614, +610, +606, +794, - +470, +564, +658, +656, +655, +797, +939, +921, - +904, +1324, -2352, -2412, -2472, -2396, -2320, -2372, - -2424, -2416, -2408, -2400, -2392, -2392, -2392, -2392, - -1996, -1930, -1865, -1960, -2055, -2087, -2120, -2153, - -2186, -2193, -2201, -2209, -2217, -2229, -2241, -2253, - -2265, -2265, -2266, -2267, -2268, -2280, -2294, -2306, - -2320, -2342, -2365, -2707, -2538, -1491, -188, +172, - +275, +327, +379, +287, +451, +505, +559, +773, - +475, +551, +628, +512, +653, +909, +654, +1007, - +1104, -739, -2583, -2506, -2430, -2397, -2365, -2396, - -2428, -2424, -2420, -2416, -2412, -2412, -2412, -2412, - -1920, -2004, -2088, -2108, -2128, -2148, -2168, -2188, - -2208, -2214, -2220, -2226, -2232, -2238, -2244, -2250, - -2256, -2261, -2266, -2271, -2276, -2289, -2302, -2315, - -2328, -2353, -2378, -2339, -2300, -2477, -1630, -719, - +192, +232, +272, +280, +288, +400, +512, +752, - +480, +539, +598, +369, +652, +767, -142, -1211, - -2792, -2547, -2302, -2345, -2388, -2399, -2410, -2421, - -2432, -2432, -2432, -2432, -2432, -2432, -2432, -2432, - -2024, -2070, -2116, -2130, -2144, -2164, -2184, -2204, - -2224, -2228, -2232, -2236, -2240, -2244, -2248, -2252, - -2256, -2262, -2270, -2276, -2284, -2296, -2310, -2322, - -2336, -2319, -2304, -2287, -2272, -2559, -2336, -1855, - -1376, -2264, -1104, -520, +64, +384, +704, +704, - +192, -44, -280, -1236, -1936, -3018, -2564, -2349, - -2392, -2390, -2390, -2388, -2388, -2398, -2410, -2420, - -2432, -2432, -2432, -2432, -2432, -2432, -2432, -2432, - -2128, -2136, -2144, -2152, -2160, -2180, -2200, -2220, - -2240, -2242, -2244, -2246, -2248, -2250, -2252, -2254, - -2256, -2265, -2274, -2283, -2292, -2305, -2318, -2331, - -2344, -2287, -2230, -2237, -2244, -2387, -2530, -2481, - -2432, -2456, -2480, -2600, -2720, -2448, -2176, -1904, - -2144, -2419, -2694, -2585, -2476, -2451, -2426, -2465, - -2504, -2491, -2478, -2433, -2388, -2399, -2410, -2421, - -2432, -2432, -2432, -2432, -2432, -2432, -2432, -2432, - -2104, -2122, -2140, -2158, -2176, -2196, -2216, -2236, - -2256, -2256, -2256, -2256, -2256, -2256, -2256, -2256, - -2256, -2266, -2278, -2288, -2300, -2312, -2326, -2338, - -2352, -2317, -2284, -2281, -2280, -2357, -2436, -2417, - -2400, -2408, -2416, -2360, -2304, -2480, -864, -1648, - -1408, -1225, -2580, -2509, -2440, -2427, -2416, -2435, - -2456, -2446, -2438, -2412, -2388, -2398, -2410, -2420, - -2432, -2432, -2432, -2432, -2432, -2432, -2432, -2432, - -2080, -2108, -2136, -2164, -2192, -2212, -2232, -2252, - -2272, -2270, -2268, -2266, -2264, -2262, -2260, -2258, - -2256, -2269, -2282, -2295, -2308, -2321, -2334, -2347, - -2360, -2349, -2338, -2327, -2316, -2329, -2342, -2355, - -2368, -2360, -2352, -2376, -2400, -2256, -2624, -1392, - -1696, -2593, -2466, -2435, -2404, -2405, -2406, -2407, - -2408, -2403, -2398, -2393, -2388, -2399, -2410, -2421, - -2432, -2432, -2432, -2432, -2432, -2432, -2432, -2432, - -2080, -2108, -2136, -2164, -2192, -2212, -2232, -2252, - -2272, -2270, -2268, -2266, -2264, -2262, -2260, -2258, - -2256, -2268, -2282, -2294, -2308, -2320, -2334, -2346, - -2360, -2348, -2338, -2326, -2316, -2328, -2342, -2354, - -2368, -2360, -2352, -2360, -2368, -2352, -2592, -2192, - -2560, -2768, -2466, -2434, -2404, -2404, -2406, -2406, - -2408, -2402, -2398, -2392, -2388, -2398, -2410, -2420, - -2432, -2432, -2432, -2432, -2432, -2432, -2432, -2432, - -2080, -2108, -2136, -2164, -2192, -2212, -2232, -2252, - -2272, -2270, -2268, -2266, -2264, -2262, -2260, -2258, - -2256, -2269, -2282, -2295, -2308, -2321, -2334, -2347, - -2360, -2349, -2338, -2327, -2316, -2329, -2342, -2355, - -2368, -2360, -2352, -2344, -2336, -2448, -2560, -2480, - -2400, -2433, -2466, -2435, -2404, -2405, -2406, -2407, - -2408, -2403, -2398, -2393, -2388, -2399, -2410, -2421, - -2432, -2432, -2432, -2432, -2432, -2432, -2432, -2432, - -2080, -2108, -2136, -2164, -2192, -2212, -2232, -2252, - -2272, -2270, -2268, -2266, -2264, -2262, -2260, -2258, - -2256, -2268, -2282, -2294, -2308, -2320, -2334, -2346, - -2360, -2348, -2338, -2326, -2316, -2328, -2342, -2354, - -2368, -2360, -2352, -2344, -2336, -2448, -2560, -2480, - -2400, -2432, -2466, -2434, -2404, -2404, -2406, -2406, - -2408, -2402, -2398, -2392, -2388, -2398, -2410, -2420, - -2432, -2432, -2432, -2432, -2432, -2432, -2432, -2432 +static const INT16 TEST_CR_COMPONENT[4096] = { + -2112, -2114, -2116, -2118, -2120, -2122, -2124, -2126, -2128, -2118, -2108, -2098, -2088, + -2150, -2212, -2146, -2080, -2100, -2120, -2140, -2160, -2164, -2168, -2172, -2176, -2092, + -2008, -2052, -2096, -2132, -2168, -2076, -1984, -2088, -2192, -2168, -2144, -2136, -2128, + -2120, -2112, -2126, -2140, -2154, -2168, -2150, -2132, -2114, -2096, -2096, -2096, -2096, + -2096, -2096, -2096, -2096, -2096, -2080, -2064, -2048, -2032, -2032, -2032, -2032, -2128, + -2113, -2098, -2115, -2132, -2133, -2134, -2135, -2137, -2127, -2117, -2107, -2097, -2117, + -2137, -2125, -2114, -2134, -2154, -2159, -2163, -2135, -2108, -2128, -2149, -2132, -2116, + -2116, -2115, -2115, -2114, -2098, -2082, -2112, -2142, -2141, -2139, -2133, -2128, -2122, + -2117, -2127, -2137, -2147, -2158, -2146, -2134, -2122, -2111, -2108, -2106, -2104, -2102, + -2101, -2101, -2101, -2101, -2087, -2073, -2059, -2045, -2045, -2045, -2045, -2144, -2112, + -2080, -2112, -2145, -2145, -2145, -2145, -2146, -2136, -2126, -2116, -2107, -2085, -2063, + -2105, -2148, -2168, -2189, -2178, -2167, -2107, -2048, -2085, -2122, -2173, -2225, -2180, + -2135, -2098, -2061, -2120, -2180, -2136, -2093, -2114, -2135, -2131, -2128, -2125, -2122, + -2128, -2135, -2141, -2148, -2142, -2137, -2131, -2126, -2121, -2117, -2112, -2108, -2107, + -2107, -2106, -2106, -2094, -2082, -2070, -2058, -2058, -2058, -2058, -2160, -2111, -2062, + -2109, -2157, -2156, -2155, -2154, -2155, -2145, -2135, -2125, -2116, -2132, -2148, -2132, + -2118, -2154, -2191, -2181, -2170, -2494, -2308, -2393, -2479, -2470, -2461, -2243, -2282, + -2353, -2167, -2174, -2182, -2160, -2139, -2135, -2130, -2128, -2128, -2127, -2127, -2129, + -2132, -2134, -2138, -2138, -2139, -2139, -2141, -2133, -2127, -2120, -2114, -2112, -2112, + -2111, -2111, -2101, -2091, -2081, -2071, -2071, -2071, -2071, -2176, -2110, -2045, -2107, + -2170, -2168, -2167, -2165, -2164, -2154, -2145, -2135, -2126, -2180, -2235, -2161, -2088, + -2141, -2195, -2440, -2686, -2371, -1033, -398, +236, +305, +375, -3, -894, -2096, + -2787, -2485, -2184, -2185, -2187, -2156, -2126, -2127, -2129, -2130, -2132, -2131, -2130, + -2129, -2128, -2135, -2142, -2149, -2156, -2147, -2138, -2129, -2120, -2119, -2118, -2117, + -2116, -2108, -2100, -2092, -2084, -2084, -2084, -2084, -2112, -2085, -2058, -2112, -2166, + -2067, -2225, -2190, -2157, -2107, -2057, -2104, -2151, -2119, -2088, -2632, -2666, -2263, + -837, +844, +2526, +3327, +2847, +2847, +2847, +2726, +2606, +2967, +3070, +2968, +2867, + +397, -2074, -2745, -2137, -2281, -2169, -2202, -2236, -2190, -2145, -2145, -2147, -2148, + -2150, -2152, -2156, -2159, -2163, -2159, -2156, -2152, -2150, -2130, -2111, -2123, -2137, + -2127, -2117, -2107, -2097, -2097, -2097, -2097, -2048, -2060, -2073, -2118, -2163, -1967, + -2284, -2217, -2150, -2060, -1971, -2074, -2177, -2315, -2454, -1057, +1364, +2990, +2568, + +2593, +2619, +2369, +2631, +2508, +2386, +2332, +2278, +2352, +2427, +2913, +2888, +3022, + +3156, +1302, -2088, -2406, -2213, -2279, -2345, -2251, -2158, -2161, -2165, -2168, -2172, + -2171, -2171, -2170, -2170, -2172, -2175, -2177, -2180, -2142, -2105, -2131, -2158, -2146, + -2134, -2122, -2110, -2110, -2110, -2110, -2112, -2163, -2215, -2235, -2255, -1994, -2247, + -2194, -2143, -2109, -2076, -2123, -2170, -2270, +700, +3527, +2770, +2035, +2325, +2293, + +2263, +2178, +2350, +2265, +2181, +2129, +2078, +2154, +2231, +2521, +2557, +2559, +2562, + +3221, +3113, +140, -2832, -2034, -2261, -2199, -2139, -2160, -2182, -2188, -2194, -2189, + -2185, -2181, -2177, -2185, -2193, -2201, -2210, -2154, -2098, -2138, -2179, -2165, -2151, + -2137, -2123, -2123, -2123, -2123, -1664, -1755, -1846, -1841, -1836, -1767, -2210, -2173, + -2136, -2159, -2182, -2173, -2164, -2739, +2830, +2735, +2640, +2361, +2082, +1995, +1908, + +1989, +2070, +2023, +1976, +1927, +1878, +1957, +2036, +2131, +2226, +2353, +2480, +2581, + +2682, +2943, +2692, -2815, -2178, -2149, -2120, -2160, -2200, -2208, -2216, -2208, -2200, + -2192, -2184, -2198, -2212, -2226, -2240, -2166, -2092, -2146, -2200, -2184, -2168, -2152, + -2136, -2136, -2136, -2136, -2096, -2166, -2238, -2228, -2220, -2087, -2210, -2173, -2137, + -2189, -2243, -2152, -2318, -2031, +3375, +2861, +2605, +2305, +2007, +1851, +1697, +1756, + +1815, +1810, +1806, +1756, +1707, +1754, +1801, +1911, +2023, +2149, +2277, +2299, +2323, + +2729, +1345, -2439, -2129, -2217, -2307, -2349, -2136, -2179, -2222, -2223, -2224, -2193, + -2162, -2171, -2180, -2190, -2199, -2198, -2198, -2213, -2229, -2172, -2115, -2170, -2225, + -2113, -2257, -2257, -2016, -2067, -2118, -2105, -2093, -2152, -2211, -2174, -2138, -2221, + -2305, -2132, -2472, +212, +2897, +2477, +2570, +2251, +1932, +1709, +1487, +1524, +1561, + +1598, +1636, +1586, +1537, +1552, +1567, +1693, +1820, +1947, +2074, +2019, +1964, +2261, + -514, -2321, -2080, -2031, -1982, -2283, -2073, -2151, -2229, -2238, -2248, -2194, -2140, + -2144, -2149, -2154, -2159, -2231, -2304, -2281, -2258, -2160, -2062, -2188, -2314, -2090, + -2378, -2378, -2064, -2094, -2126, -2125, -2125, -2152, -2179, -2159, -2139, -2204, -2270, + -2144, -2530, +1688, +2834, +2460, +2343, +2147, +1953, +1678, +1404, +1387, +1370, +1418, + +1466, +1416, +1366, +1349, +1332, +1442, +1553, +1663, +1775, +1817, +1861, +2415, -2405, + -2457, -1999, -2035, -281, -1464, -2393, -2378, -2363, -2301, -2240, -2195, -2150, -2165, + -2181, -2182, -2182, -2199, -2218, -2188, -2159, -2756, -2329, -1934, -2307, -2627, -2179, + -2307, -2112, -2123, -2135, -2146, -2158, -2153, -2149, -2144, -2140, -2188, -2236, -2156, + -2588, +3164, +2772, +2444, +2116, +2045, +1975, +1648, +1322, +1251, +1181, +1238, +1296, + +1246, +1197, +1147, +1098, +1192, +1287, +1381, +1476, +1617, +1758, +1291, -2760, -2083, + -2430, -1273, -628, -647, -667, -1582, -2498, -2365, -2233, -2196, -2160, -2187, -2215, + -2210, -2206, -2169, -2133, -2096, -2060, -280, -548, -2448, -1788, -860, -1980, -2236, + -2112, -2120, -2130, -2140, -2150, -2145, -2141, -2137, -2133, -2147, -2161, -2079, -718, + +3207, +2525, +2291, +2057, +1941, +1827, +1553, +1279, +1174, +1070, +1094, +1118, +1044, + +970, +976, +983, +1001, +1019, +1165, +1313, +1305, +1555, -212, -2491, -2189, -2401, + -867, -615, -642, -671, -603, -536, -1354, -2172, -2271, -2370, -2340, -2311, -2330, + -2349, -2315, -2282, -2697, -1321, -420, -543, -394, -757, -741, -2261, -2261, -2112, + -2119, -2127, -2135, -2143, -2138, -2134, -2130, -2126, -2106, -2087, -2259, +640, +2995, + +2279, +2138, +1998, +1839, +1681, +1459, +1237, +1098, +960, +950, +940, +842, +744, + +806, +869, +811, +753, +951, +1150, +995, +1352, -1715, -2222, -2297, -2372, -463, + -602, -639, -676, -649, -623, -600, -577, -810, -1044, -1214, -1384, -1426, -1469, + -1183, -897, -483, -582, -560, -538, -900, -750, -1134, -2542, -2286, -2112, -2117, + -2123, -2129, -2135, -2131, -2127, -2123, -2119, -2017, -1916, -2886, +1262, +2014, +2256, + +2097, +1939, +1736, +1534, +1364, +1194, +1022, +850, +806, +762, +736, +710, +508, + +818, +604, +646, +752, +859, +1131, +1149, -2865, -2273, -2339, -1639, -425, -493, + -522, -553, -566, -581, -677, -773, -661, -550, -567, -585, -586, -588, -657, + -727, -572, -675, -668, -661, -798, -679, -1799, -2407, -2151, -2112, -2116, -2120, + -2124, -2128, -2124, -2120, -2116, -2112, -2185, -2258, -1723, +1884, +1035, +2234, +2057, + +1880, +1634, +1388, +1270, +1152, +946, +740, +662, +584, +630, +676, +466, +1280, + +654, +540, +554, +568, +757, -78, -2481, -2324, -2383, -906, -389, -384, -407, + -430, -485, -540, -499, -458, -513, -568, -689, -810, -771, -732, -645, -558, + -663, -768, -776, -784, -696, -608, -2464, -2272, -2016, -2104, -2110, -2116, -2122, + -2129, -2105, -2081, -2105, -2130, -2204, -2536, -84, +1856, +1148, +1209, +1701, +1683, + +1507, +1332, +1188, +1045, +837, +630, +518, +407, +489, +572, +398, +1249, +662, + +330, +383, +436, +589, -1304, -2350, -2117, -2615, +213, -12, -239, -265, -293, + -320, -348, -377, -407, -484, -562, -626, -691, -675, -661, -625, -590, -682, + -776, -804, -832, -540, -248, -664, -1848, -2616, -2096, -2104, -2113, -2121, -2130, + -2086, -2043, -2095, -2148, -2225, -2815, +1555, +1829, +1519, +697, +1603, +1486, +1381, + +1276, +1107, +938, +729, +520, +375, +230, +349, +468, +331, +1219, +670, +121, + +212, +304, +423, -2531, -2477, -2423, -1569, +309, -149, -94, -125, -157, -157, + -157, -256, -356, -456, -556, -564, -573, -581, -590, -606, -623, -703, -784, + -832, -880, -384, +112, -1424, -2448, -2192, -2088, -2098, -2109, -2119, -2131, -2099, + -2068, -2100, -2134, -2485, -2325, +2921, +2025, +1536, +1048, +1088, +1385, +1270, +1156, + +993, +831, +700, +570, +407, +245, +256, +268, +343, +932, +662, +135, +185, + +236, -337, -2445, -2346, -2504, -793, +149, -75, -45, -64, -84, -88, -93, + -183, -273, -363, -454, -454, -454, -518, -583, -619, -655, -723, -792, -796, + -800, -868, -1960, -2296, -2376, -2248, -2080, -2093, -2106, -2119, -2132, -2113, -2094, + -2107, -2120, -2234, -813, +2752, +2222, +1555, +1401, +574, +1284, +1160, +1036, +880, + +724, +672, +620, +440, +260, +164, +69, +357, +646, +654, +151, +159, +168, + -1096, -2361, -2217, -2586, -18, -11, -3, +4, -4, -13, -21, -30, -110, + -191, -271, -352, -344, -336, -456, -576, -632, -688, -744, -800, -760, -720, + -584, -2496, -2400, -2304, -2304, -2072, -2086, -2102, -2117, -2133, -2171, -2211, -2170, + -2130, -2462, +1045, +2615, +2138, +1656, +1432, +807, +951, +1193, +924, +734, +545, + +397, +250, +486, +723, +569, +416, +311, +207, +384, +305, +242, +180, -1825, + -2295, -2348, -1891, +69, -19, -10, -3, -7, -12, -16, -22, -65, -107, + -182, -258, -309, -361, -477, -593, -640, -688, -736, -784, -752, -720, -1200, + -2448, -2384, -2320, -2320, -2064, -2081, -2099, -2116, -2134, -2231, -2329, -2234, -2140, + -2691, +2902, +2478, +2055, +1759, +1464, +1041, +618, +1227, +812, +589, +366, +379, + +392, +277, +162, +207, +253, +267, +281, +114, -52, +70, +192, -2555, -2230, + -2481, -1197, +156, -28, -19, -10, -11, -12, -13, -15, -20, -25, -94, + -164, -275, -387, -498, -610, -649, -689, -728, -768, -744, -720, -1816, -2400, + -2368, -2336, -2336, -2056, -2075, -2095, -2115, -2135, -2178, -2222, -2138, -2310, -1319, + +2743, +2293, +2099, +1893, +1432, +1242, +541, +1036, +1020, +699, +379, +376, +374, + +275, +177, +196, +217, +189, +162, +100, +39, +153, -756, -2420, -2293, -2549, + -502, +131, -4, -10, -17, -14, -12, -9, -7, -7, -6, -102, -198, + -320, -444, -519, -595, -641, -689, -720, -752, -768, -784, -2192, -2320, -2336, + -2352, -2352, -2048, -2070, -2092, -2114, -2136, -2126, -2116, -2042, -2480, +52, +2584, + +2108, +2144, +2028, +1400, +1444, +464, +78, -308, -470, -632, -394, -156, +18, + +192, +187, +182, +113, +44, +87, +130, +237, -1704, -2286, -2356, -2618, +192, + +106, +20, -2, -24, -18, -12, -6, +0, +6, +12, -110, -232, -367, + -502, -541, -580, -635, -690, -713, -736, -792, -848, -2568, -2240, -2304, -2368, + -2368, -2046, -2068, -2091, -2113, -2136, -2121, -2105, -2186, -2523, +1999, +2681, +2740, + +1518, +117, -1541, -2639, -2457, -2465, -2474, -2466, -2459, -2498, -2536, -2303, -2070, + -995, +81, -76, +24, +35, +47, -150, -2394, -2422, -2450, -1806, +117, +85, + +53, +21, -11, -11, -11, -11, -11, -11, -11, -107, -203, -404, -606, + -615, -625, -610, -596, -693, -791, -757, -1491, -2401, -2287, -2303, -2319, -2319, + -2044, -2067, -2090, -2113, -2137, -2116, -2095, -2074, -2054, +2923, +219, -1748, -2692, + -2563, -2435, -2114, -2306, -2193, -2080, -2159, -2239, -2298, -2357, -2320, -2284, -2432, + -2580, -1544, +4, -16, -36, -280, -2572, -2302, -2544, -994, +43, +64, +86, + +44, +2, -4, -10, -16, -22, -28, -34, -104, -174, -186, -198, -178, + -158, -330, -502, -674, -846, -722, -2134, -2234, -2334, -2302, -2270, -2270, -2042, + -2065, -2089, -2112, -2137, -2159, -2180, -2154, -2129, -2458, -2532, -2604, -2166, -2218, + -2272, -2293, -2315, -2000, -2198, -2219, -2242, -2322, -2401, -2385, -2370, -2285, -2201, + -2452, -2704, -1411, +137, -1402, -2174, -2502, -2830, +250, +0, +28, +55, +35, + +15, +3, -9, -21, -33, -45, -57, -101, -145, -175, -206, -220, -235, + -177, -120, -414, -709, -191, -2489, -2547, -2349, -2349, -2349, -2349, -2040, -2064, + -2089, -2113, -2138, -2202, -2267, -2235, -2204, -2207, -2210, -2181, -2152, -2131, -2110, + -2217, -1812, -1552, -2317, -2025, -1734, -1578, -1423, -1939, -2456, -2395, -2334, -2081, + -2340, -2551, -2250, -2013, -2288, -2446, -2093, -43, -42, -8, +25, +26, +28, + +10, -8, -26, -44, -62, -80, -98, -116, -165, -214, -263, -312, -281, + -250, -155, -60, -940, -1820, -2348, -2364, -2396, -2428, -2428, -2038, -2058, -2079, + -2100, -2122, -2123, -2124, -2285, -2191, -2065, -1940, -1910, -1882, -2232, -2327, -2149, + -1717, -1485, -2022, -1759, -1497, -1242, -987, -716, -446, -1226, -2007, -2723, -2160, + -2330, -2245, -2175, -2362, -2338, -1034, +109, -28, -19, -10, +15, +41, +19, + -3, -25, -47, -89, -131, -141, -151, -208, -266, -355, -445, -458, -472, + -405, -83, -1135, -1163, -1895, -2371, -2387, -2403, -2403, -2036, -2053, -2071, -2089, + -2107, -2044, -1982, -2080, -1666, -1668, -1671, -1897, -2124, -2590, -2545, -2083, -1622, + -1419, -1729, -1495, -1261, -1162, -1064, -774, -484, -314, -144, -806, -2492, -2366, + -2240, -2338, -2436, -2486, -489, +4, -15, -30, -45, +4, +54, +28, +2, + -24, -50, -116, -182, -184, -186, -252, -318, -448, -578, -636, -694, -656, + -106, -2098, -2042, -2210, -2378, -2378, -2378, -2378, -2034, -2047, -2062, -2076, -2091, + -2093, -2096, -1650, -1461, -1687, -1913, -2155, -2398, -2676, -2442, -2016, -1591, -1448, + -1563, -1341, -1120, -986, -853, -623, -394, -265, -137, +200, +24, -1554, -2363, + -2324, -2286, -2122, -2727, -1220, +31, +136, -15, +25, +67, +37, +7, -7, + -21, -111, -201, -211, -221, -295, -370, -460, -551, -509, -468, -634, -545, + -2805, -2249, -2301, -2353, -2353, -2353, -2353, -2032, -2043, -2054, -2065, -2076, -2143, + -2210, -1477, -1768, -1962, -2156, -2414, -2672, -2762, -2340, -1950, -1560, -1479, -1398, + -1189, -980, -811, -642, -473, -304, -217, -130, -75, -20, +27, -2486, -2311, + -2136, -2527, -2406, -2445, -2484, -979, +14, +47, +80, +46, +12, +10, +8, + -106, -220, -238, -256, -339, -422, -473, -524, -639, -754, -1637, -2520, -2232, + -2456, -2392, -2328, -2328, -2328, -2328, -2012, -2030, -2049, -2052, -2055, -2191, -2073, + -1585, -1867, -2081, -2296, -2526, -2757, -2653, -2294, -1886, -1479, -1380, -1282, -1087, + -893, -748, -604, -491, -379, -243, -109, -181, +1, -606, -2493, -2283, -2331, + -2481, -2376, -2413, -2452, -2308, -2421, -1350, -278, -124, +30, +88, +145, +127, + +109, +27, -56, -278, -501, -1107, -1714, -2162, -2612, -2532, -2453, -2297, -2397, + -2369, -2341, -2341, -2341, -2341, -1992, -2018, -2045, -2040, -2035, -2241, -1936, -1695, + -1966, -2201, -2436, -2639, -2842, -2545, -2248, -1823, -1398, -1282, -1166, -986, -806, + -686, -566, -510, -454, -271, -88, -289, +22, -1239, -2500, -2257, -2526, -388, + -2346, -2383, -2421, -2358, -2296, -2490, -2684, -2342, -2001, -1627, -1254, -1176, -1099, + -1501, -1904, -2266, -2628, -2510, -2393, -2407, -2422, -2404, -2386, -2362, -2338, -2346, + -2354, -2354, -2354, -2354, -1972, -2006, -2040, -2043, -2046, -2194, -1831, -1835, -2097, + -2336, -2576, -2735, -2895, -2564, -2234, -1839, -1445, -1279, -1114, -916, -719, -623, + -528, -528, -529, -425, -323, -59, -53, -2527, -2443, -2517, -2081, +170, -140, + -1312, -2485, -2440, -2395, -2382, -2370, -2400, -2431, -2509, -2589, -2559, -2530, -2500, + -2472, -2429, -2387, -2489, -2335, -2939, -2008, -1331, -2447, -2395, -2343, -2355, -2367, + -2367, -2367, -2367, -1952, -1994, -2037, -2047, -2058, -2148, -1727, -1977, -2228, -2472, + -2716, -2832, -2948, -2584, -2220, -1856, -1492, -1277, -1062, -847, -632, -561, -490, + -547, -604, -581, -558, -343, -1152, -2281, -2386, -2523, -1124, -40, +19, +15, + +10, -1242, -2495, -2531, -2568, -2459, -2350, -2369, -2388, -2407, -2426, -2477, -2528, + -2593, -2659, -2212, -1254, +369, +967, -1026, -2508, -2428, -2348, -2364, -2380, -2380, + -2380, -2380, -1948, -1996, -2044, -2060, -2077, -1957, -1837, -2069, -2303, -2545, -2788, + -2918, -3049, -2873, -2442, -2026, -1611, -1374, -1138, -965, -793, -732, -672, -707, + -743, -847, -953, -2017, -2059, -2441, -2313, -2327, -295, +99, -19, +23, +65, + +26, -13, -629, -1246, -1795, -2345, -2509, -2675, -2540, -2406, -1887, -1368, -467, + +434, +439, +699, +1162, +856, -2695, -2409, -2413, -2417, -2389, -2361, -2361, -2361, + -2361, -1944, -1998, -2052, -2074, -2097, -1767, -1949, -2163, -2378, -2619, -2860, -3005, + -3150, -3163, -2664, -2197, -1730, -1472, -1214, -1084, -954, -904, -854, -868, -882, + -859, -836, -877, -1942, -2091, -2240, -2389, +22, -18, -57, +32, +121, +14, + -93, -9, +76, +149, +221, +166, +110, +143, +175, +239, +304, +379, +455, + +530, +605, +676, +235, -2573, -2310, -2398, -2486, -2414, -2342, -2342, -2342, -2342, + -1940, -2000, -2060, -2072, -2084, -1640, -1964, -2144, -2325, -2532, -2740, -2899, -3059, + -3052, -2790, -2319, -1849, -1569, -1290, -1202, -1115, -1075, -1036, -1028, -1021, -1077, + -1135, -503, -2689, -2395, -2359, -1553, +19, -6, -30, +25, +80, +34, -12, + +37, +86, +124, +162, +137, +111, +137, +163, +237, +312, +393, +475, +525, + +574, +654, -803, -2466, -2339, -2383, -2427, -2375, -2323, -2323, -2323, -2323, -1936, + -2002, -2068, -2070, -2072, -1514, -1980, -2126, -2272, -2446, -2620, -2794, -2968, -2942, + -2916, -2442, -1968, -1667, -1366, -1321, -1276, -1247, -1218, -1189, -1160, -1041, -922, + -1411, -2412, -2189, -2478, -719, +16, +6, -4, +18, +40, +54, +68, +82, + +96, +100, +104, +108, +112, +132, +152, +236, +320, +408, +496, +520, +544, + +632, -1840, -2360, -2368, -2368, -2368, -2336, -2304, -2304, -2304, -2304, -1898, -1921, + -1944, -2111, -1766, -1551, -1848, -1985, -2122, -2318, -2515, -2664, -2813, -3074, -3079, + -2828, -2321, -2024, -1729, -1608, -1489, -1457, -1425, -1393, -1362, -1246, -1131, -1879, + -2372, -2532, -2693, +331, +25, +40, +55, +54, +54, +71, +88, +105, +123, + +151, +180, +208, +237, +83, -70, +48, +167, +248, +329, +346, +363, +733, + -2738, -2577, -2416, -2395, -2374, -2353, -2332, -2332, -2332, -2332, -1860, -1840, -1820, + -2152, -1460, -1588, -1716, -1844, -1972, -2191, -2411, -2535, -2659, -2950, -2730, -2958, + -2674, -2383, -2092, -1897, -1703, -1668, -1633, -1598, -1564, -1452, -1340, -2348, -2333, + -2365, -1885, -157, +34, +74, +115, +91, +68, +88, +109, +129, +150, +203, + +256, +309, +362, +291, +220, +117, +14, +88, +162, +172, +183, -702, -2612, + -2282, -2464, -2422, -2380, -2370, -2360, -2360, -2360, -2360, -2110, -1967, -1824, -1953, + -1314, -1513, -1712, -1815, -1918, -2207, -2242, -2453, -2408, -2602, -2541, -2752, -2707, + -2692, -2679, -2409, -2140, -2054, -1968, -1867, -1766, -1721, -1677, -2369, -2293, -2516, + -948, -53, +75, +92, +110, +95, +82, +105, +129, +152, +177, +222, +268, + +313, +359, +354, +350, +441, +533, +472, +411, +414, +674, -1689, -2518, -2339, + -2416, -2401, -2386, -2387, -2388, -2388, -2388, -2388, -1848, -1838, -1828, -1754, -1168, + -1438, -1708, -1786, -1864, -2225, -2075, -2372, -2158, -2255, -2353, -2546, -2740, -2747, + -2755, -2666, -2578, -2441, -2305, -2136, -1968, -1991, -2015, -2390, -2254, -2669, -13, + +51, +116, +111, +106, +101, +96, +123, +150, +177, +204, +242, +280, +318, + +356, +418, +480, +510, +540, +600, +661, +657, +1166, -2677, -2425, -2396, -2368, + -2380, -2392, -2404, -2416, -2416, -2416, -2416, -1882, -1711, -1796, -1369, -1198, -1419, + -1640, -1749, -1858, -1977, -1842, -2058, -2019, -2113, -2207, -2366, -2525, -2478, -2689, + -2836, -2983, -2759, -2536, -2393, -2250, -2194, -2139, -2357, -2318, -2018, +72, +113, + +157, +150, +145, +139, +134, +159, +186, +212, +239, +273, +308, +342, +377, + +439, +502, +548, +595, +632, +669, +931, +170, -2666, -2430, -2403, -2376, -2385, + -2394, -2403, -2412, -2412, -2412, -2412, -1916, -1840, -2276, -1240, -1228, -1400, -1572, + -1712, -1852, -1731, -1610, -1745, -1881, -1972, -2063, -2186, -2310, -2211, -2625, -2751, + -2877, -2822, -2768, -2650, -2532, -2398, -2265, -2324, -2383, -1369, +156, +177, +198, + +191, +185, +178, +172, +197, +223, +248, +274, +305, +336, +367, +398, +461, + +524, +587, +650, +664, +679, +1206, -827, -2656, -2437, -2410, -2384, -2390, -2396, + -2402, -2408, -2408, -2408, -2408, -1950, -1953, -1956, -1063, -1194, -1317, -1440, -1435, + -1430, -1499, -1314, -1431, -1550, -1638, -1726, -1798, -1871, -1927, -2240, -2409, -2578, + -2597, -2616, -2731, -2846, -2554, -2262, -2259, -2511, -527, +176, +207, +239, +231, + +224, +217, +210, +234, +259, +284, +309, +336, +364, +391, +419, +482, +546, + +609, +673, +744, +816, +936, -2015, -2485, -2187, -2289, -2392, -2395, -2398, -2401, + -2404, -2404, -2404, -2404, -1984, -2066, -1636, -886, -1160, -1234, -1308, -1414, -1520, + -2037, -2042, -1887, -1732, -1817, -1902, -1923, -1944, -1900, -1856, -2068, -2280, -2372, + -2464, -2556, -2648, -2454, -2260, -2194, -2640, +314, +196, +238, +280, +272, +264, + +256, +248, +272, +296, +320, +344, +368, +392, +416, +440, +504, +568, +632, + +696, +825, +954, +923, -2692, -2315, -2450, -2425, -2400, -2400, -2400, -2400, -2400, + -2400, -2400, -2400, -2252, -1953, -1142, -1035, -1441, -1826, -2211, -2244, -2278, -2220, + -1908, -1914, -1922, -2001, -2336, -2095, -2111, -2171, -2231, -2131, -2031, -2143, -2255, + -2303, -2352, -2306, -2260, -2359, -1689, +442, +269, +305, +341, +333, +325, +317, + +309, +329, +349, +369, +389, +415, +441, +468, +494, +536, +579, +669, +760, + +797, +1091, -248, -2610, -2406, -2459, -2431, -2404, -2400, -2396, -2392, -2388, -2388, + -2388, -2388, -2008, -2096, -1673, -1953, -2234, -2162, -2091, -2051, -2012, -2149, -2286, + -2199, -2113, -1930, -2259, -2012, -2278, -2186, -2094, -2194, -2295, -2171, -2047, -2051, + -2056, -2158, -2261, -2524, -739, +570, +343, +372, +402, +394, +386, +378, +370, + +386, +402, +418, +434, +462, +491, +520, +549, +569, +590, +707, +824, +770, + +1228, -1418, -2528, -2498, -2468, -2438, -2408, -2400, -2392, -2384, -2376, -2376, -2376, + -2376, -1988, -2191, -2139, -2150, -2163, -2130, -2098, -2081, -2066, -2140, -2216, -2179, + -2143, -2066, -2245, -2137, -2285, -2233, -2181, -2225, -2270, -2326, -2382, -2166, -1952, + -2250, -2549, -2465, +180, +394, +352, +407, +463, +455, +447, +423, +399, +523, + +391, +547, +447, +493, +540, +572, +603, +633, +665, +792, +920, +1094, +1269, + -2764, -2446, -2429, -2413, -2412, -2412, -2400, -2388, -2376, -2364, -2364, -2364, -2364, + -1968, -2031, -2094, -2093, -2092, -2099, -2106, -2113, -2120, -2133, -2147, -2160, -2174, + -2203, -2233, -2262, -2292, -2280, -2269, -2257, -2246, -2226, -2207, -2283, -2360, -2343, + -2327, -2406, +586, -38, +363, +443, +524, +516, +508, +468, +428, +660, +380, + +676, +460, +525, +591, +624, +658, +699, +741, +878, +1016, +907, +286, -2575, + -2364, -2361, -2358, -2387, -2416, -2400, -2384, -2368, -2352, -2352, -2352, -2352, -2020, + -2071, -2124, -2080, -2037, -2062, -2089, -2115, -2142, -2152, -2164, -2176, -2188, -2211, + -2235, -2259, -2283, -2275, -2267, -2260, -2253, -2249, -2246, -2290, -2336, -2337, -2339, + -1205, -71, -16, +296, +496, +441, +469, +497, +381, +521, +635, +493, +735, + +465, +544, +624, +640, +656, +747, +839, +899, +960, +1115, -1033, -2493, -2418, + -2378, -2339, -2379, -2420, -2408, -2396, -2384, -2372, -2372, -2372, -2372, -2072, -2113, + -2155, -2068, -1982, -2027, -2073, -2118, -2164, -2173, -2183, -2193, -2203, -2220, -2238, + -2256, -2274, -2270, -2267, -2264, -2261, -2273, -2286, -2299, -2312, -2332, -2352, -2052, + -729, +7, +230, +550, +358, +422, +486, +294, +614, +610, +606, +794, +470, + +564, +658, +656, +655, +797, +939, +921, +904, +1324, -2352, -2412, -2472, -2396, + -2320, -2372, -2424, -2416, -2408, -2400, -2392, -2392, -2392, -2392, -1996, -1930, -1865, + -1960, -2055, -2087, -2120, -2153, -2186, -2193, -2201, -2209, -2217, -2229, -2241, -2253, + -2265, -2265, -2266, -2267, -2268, -2280, -2294, -2306, -2320, -2342, -2365, -2707, -2538, + -1491, -188, +172, +275, +327, +379, +287, +451, +505, +559, +773, +475, +551, + +628, +512, +653, +909, +654, +1007, +1104, -739, -2583, -2506, -2430, -2397, -2365, + -2396, -2428, -2424, -2420, -2416, -2412, -2412, -2412, -2412, -1920, -2004, -2088, -2108, + -2128, -2148, -2168, -2188, -2208, -2214, -2220, -2226, -2232, -2238, -2244, -2250, -2256, + -2261, -2266, -2271, -2276, -2289, -2302, -2315, -2328, -2353, -2378, -2339, -2300, -2477, + -1630, -719, +192, +232, +272, +280, +288, +400, +512, +752, +480, +539, +598, + +369, +652, +767, -142, -1211, -2792, -2547, -2302, -2345, -2388, -2399, -2410, -2421, + -2432, -2432, -2432, -2432, -2432, -2432, -2432, -2432, -2024, -2070, -2116, -2130, -2144, + -2164, -2184, -2204, -2224, -2228, -2232, -2236, -2240, -2244, -2248, -2252, -2256, -2262, + -2270, -2276, -2284, -2296, -2310, -2322, -2336, -2319, -2304, -2287, -2272, -2559, -2336, + -1855, -1376, -2264, -1104, -520, +64, +384, +704, +704, +192, -44, -280, -1236, + -1936, -3018, -2564, -2349, -2392, -2390, -2390, -2388, -2388, -2398, -2410, -2420, -2432, + -2432, -2432, -2432, -2432, -2432, -2432, -2432, -2128, -2136, -2144, -2152, -2160, -2180, + -2200, -2220, -2240, -2242, -2244, -2246, -2248, -2250, -2252, -2254, -2256, -2265, -2274, + -2283, -2292, -2305, -2318, -2331, -2344, -2287, -2230, -2237, -2244, -2387, -2530, -2481, + -2432, -2456, -2480, -2600, -2720, -2448, -2176, -1904, -2144, -2419, -2694, -2585, -2476, + -2451, -2426, -2465, -2504, -2491, -2478, -2433, -2388, -2399, -2410, -2421, -2432, -2432, + -2432, -2432, -2432, -2432, -2432, -2432, -2104, -2122, -2140, -2158, -2176, -2196, -2216, + -2236, -2256, -2256, -2256, -2256, -2256, -2256, -2256, -2256, -2256, -2266, -2278, -2288, + -2300, -2312, -2326, -2338, -2352, -2317, -2284, -2281, -2280, -2357, -2436, -2417, -2400, + -2408, -2416, -2360, -2304, -2480, -864, -1648, -1408, -1225, -2580, -2509, -2440, -2427, + -2416, -2435, -2456, -2446, -2438, -2412, -2388, -2398, -2410, -2420, -2432, -2432, -2432, + -2432, -2432, -2432, -2432, -2432, -2080, -2108, -2136, -2164, -2192, -2212, -2232, -2252, + -2272, -2270, -2268, -2266, -2264, -2262, -2260, -2258, -2256, -2269, -2282, -2295, -2308, + -2321, -2334, -2347, -2360, -2349, -2338, -2327, -2316, -2329, -2342, -2355, -2368, -2360, + -2352, -2376, -2400, -2256, -2624, -1392, -1696, -2593, -2466, -2435, -2404, -2405, -2406, + -2407, -2408, -2403, -2398, -2393, -2388, -2399, -2410, -2421, -2432, -2432, -2432, -2432, + -2432, -2432, -2432, -2432, -2080, -2108, -2136, -2164, -2192, -2212, -2232, -2252, -2272, + -2270, -2268, -2266, -2264, -2262, -2260, -2258, -2256, -2268, -2282, -2294, -2308, -2320, + -2334, -2346, -2360, -2348, -2338, -2326, -2316, -2328, -2342, -2354, -2368, -2360, -2352, + -2360, -2368, -2352, -2592, -2192, -2560, -2768, -2466, -2434, -2404, -2404, -2406, -2406, + -2408, -2402, -2398, -2392, -2388, -2398, -2410, -2420, -2432, -2432, -2432, -2432, -2432, + -2432, -2432, -2432, -2080, -2108, -2136, -2164, -2192, -2212, -2232, -2252, -2272, -2270, + -2268, -2266, -2264, -2262, -2260, -2258, -2256, -2269, -2282, -2295, -2308, -2321, -2334, + -2347, -2360, -2349, -2338, -2327, -2316, -2329, -2342, -2355, -2368, -2360, -2352, -2344, + -2336, -2448, -2560, -2480, -2400, -2433, -2466, -2435, -2404, -2405, -2406, -2407, -2408, + -2403, -2398, -2393, -2388, -2399, -2410, -2421, -2432, -2432, -2432, -2432, -2432, -2432, + -2432, -2432, -2080, -2108, -2136, -2164, -2192, -2212, -2232, -2252, -2272, -2270, -2268, + -2266, -2264, -2262, -2260, -2258, -2256, -2268, -2282, -2294, -2308, -2320, -2334, -2346, + -2360, -2348, -2338, -2326, -2316, -2328, -2342, -2354, -2368, -2360, -2352, -2344, -2336, + -2448, -2560, -2480, -2400, -2432, -2466, -2434, -2404, -2404, -2406, -2406, -2408, -2402, + -2398, -2392, -2388, -2398, -2410, -2420, -2432, -2432, -2432, -2432, -2432, -2432, -2432, + -2432 }; /** * 64x64 XRGB Image */ -static const UINT32 TEST_XRGB_IMAGE[4096] = -{ +static const UINT32 TEST_XRGB_IMAGE[4096] = { 0xFF229cdf, 0xFF249de0, 0xFF259fe2, 0xFF2ca5e8, 0xFF229cdf, 0xFF229ce0, 0xFF239de0, 0xFF229ce0, 0xFF229cdf, 0xFF229cdf, 0xFF239ce0, 0xFF249ce0, 0xFF249ce0, 0xFF219ce3, 0xFF1e9ce6, 0xFF209ae2, 0xFF2299dd, 0xFF2199de, 0xFF209adf, 0xFF209ae0, 0xFF1f9be0, 0xFF1e9ae0, 0xFF1d99e0, 0xFF1c98e0, @@ -2080,8 +1488,7 @@ static const UINT32 TEST_XRGB_IMAGE[4096] = 0xFF169ff8, 0xFF159ef7, 0xFF149df7, 0xFF139cf6, 0xFF129bf5, 0xFF129bf5, 0xFF129bf5, 0xFF129bf5 }; -static int test_bmp_cmp_count(const BYTE* mem1, const BYTE* mem2, int size, - int channel, int margin) +static int test_bmp_cmp_count(const BYTE* mem1, const BYTE* mem2, int size, int channel, int margin) { int error; int count = 0; @@ -2107,8 +1514,8 @@ static int test_bmp_cmp_count(const BYTE* mem1, const BYTE* mem2, int size, return count; } -static int test_bmp_cmp_dump(const BYTE* actual, const BYTE* expected, int size, - int channel, int margin) +static int test_bmp_cmp_dump(const BYTE* actual, const BYTE* expected, int size, int channel, + int margin) { int error[3]; int count = 0; @@ -2121,8 +1528,8 @@ static int test_bmp_cmp_dump(const BYTE* actual, const BYTE* expected, int size, { if (*actual != *expected) { - const UINT32 pixel = *((UINT32*) &actual[-channel]); - const UINT32 ePixel = *((UINT32*) &expected[-channel]); + const UINT32 pixel = *((UINT32*)&actual[-channel]); + const UINT32 ePixel = *((UINT32*)&expected[-channel]); const INT16 Y = TEST_Y_COMPONENT[index]; const INT16 Cb = TEST_CB_COMPONENT[index]; const INT16 Cr = TEST_CR_COMPONENT[index]; @@ -2139,7 +1546,9 @@ static int test_bmp_cmp_dump(const BYTE* actual, const BYTE* expected, int size, if ((error[0] > margin) || (error[1] > margin) || (error[2] > margin)) { - printf("(%2d,%2d) Y: %+5"PRId16" Cb: %+5"PRId16" Cr: %+5"PRId16" R: %03"PRIu8"/%03"PRIu8" G: %03"PRIu8"/%03"PRIu8" B: %03"PRIu8"/%03"PRIu8" %d %d %d\n", + printf("(%2d,%2d) Y: %+5" PRId16 " Cb: %+5" PRId16 " Cr: %+5" PRId16 + " R: %03" PRIu8 "/%03" PRIu8 " G: %03" PRIu8 "/%03" PRIu8 " B: %03" PRIu8 + "/%03" PRIu8 " %d %d %d\n", x, y, Y, Cb, Cr, R, eR, G, eG, B, eB, R - eR, G - eG, B - eB); count++; } @@ -2170,8 +1579,8 @@ static int test_PrimitivesYCbCr(const primitives_t* prims, UINT32 format, prim_s PROFILER_DEFINE(prof) PROFILER_DEFINE(prof1) PROFILER_DEFINE(prof2) - //return test_YCbCr_pixels(); - expected = (BYTE*) TEST_XRGB_IMAGE; + // return test_YCbCr_pixels(); + expected = (BYTE*)TEST_XRGB_IMAGE; actual = _aligned_malloc(dstSize, 16); actual1 = _aligned_malloc(dstSize, 16); PROFILER_CREATE(prof, "yCbCrToRGB_16s8u") @@ -2203,9 +1612,8 @@ static int test_PrimitivesYCbCr(const primitives_t* prims, UINT32 format, prim_s { PROFILER_ENTER(prof) - status = prims->yCbCrToRGB_16s8u_P3AC4R((const INT16**) pYCbCr, srcStride, - actual, dstStride, format, - &roi); + status = prims->yCbCrToRGB_16s8u_P3AC4R((const INT16**)pYCbCr, srcStride, actual, dstStride, + format, &roi); if (status != PRIMITIVES_SUCCESS) goto fail; @@ -2221,16 +1629,16 @@ static int test_PrimitivesYCbCr(const primitives_t* prims, UINT32 format, prim_s CopyMemory(pSrcDst[1], pYCbCr[1], srcSize); CopyMemory(pSrcDst[2], pYCbCr[2], srcSize); PROFILER_ENTER(prof1) - status = prims->yCbCrToRGB_16s16s_P3P3((const INT16**) pSrcDst, srcStride, - pSrcDst, srcStride, &roi); + status = prims->yCbCrToRGB_16s16s_P3P3((const INT16**)pSrcDst, srcStride, pSrcDst, + srcStride, &roi); PROFILER_EXIT(prof1) if (status != PRIMITIVES_SUCCESS) goto fail2; PROFILER_ENTER(prof2) - status = prims->RGBToRGB_16s8u_P3AC4R((const INT16**) pSrcDst, srcStride, - actual1, dstStride, format, &roi); + status = prims->RGBToRGB_16s8u_P3AC4R((const INT16**)pSrcDst, srcStride, actual1, dstStride, + format, &roi); PROFILER_EXIT(prof2) fail2: _aligned_free(pSrcDst[0]); @@ -2244,11 +1652,11 @@ static int test_PrimitivesYCbCr(const primitives_t* prims, UINT32 format, prim_s if (compare) { cnt[2] = test_bmp_cmp_count(actual, expected, dstSize, 2, margin); /* red */ - err[2] = ((float) cnt[2]) / ((float) dstSize / 4) * 100.0f; + err[2] = ((float)cnt[2]) / ((float)dstSize / 4) * 100.0f; cnt[1] = test_bmp_cmp_count(actual, expected, dstSize, 1, margin); /* green */ - err[1] = ((float) cnt[1]) / ((float) dstSize / 4) * 100.0f; + err[1] = ((float)cnt[1]) / ((float)dstSize / 4) * 100.0f; cnt[0] = test_bmp_cmp_count(actual, expected, dstSize, 0, margin); /* blue */ - err[0] = ((float) cnt[0]) / ((float) dstSize / 4) * 100.0f; + err[0] = ((float)cnt[0]) / ((float)dstSize / 4) * 100.0f; if (cnt[0] || cnt[1] || cnt[2]) { @@ -2265,11 +1673,11 @@ static int test_PrimitivesYCbCr(const primitives_t* prims, UINT32 format, prim_s } cnt[2] = test_bmp_cmp_count(actual1, expected, dstSize, 2, margin); /* red */ - err[2] = ((float) cnt[2]) / ((float) dstSize / 4) * 100.0f; + err[2] = ((float)cnt[2]) / ((float)dstSize / 4) * 100.0f; cnt[1] = test_bmp_cmp_count(actual1, expected, dstSize, 1, margin); /* green */ - err[1] = ((float) cnt[1]) / ((float) dstSize / 4) * 100.0f; + err[1] = ((float)cnt[1]) / ((float)dstSize / 4) * 100.0f; cnt[0] = test_bmp_cmp_count(actual1, expected, dstSize, 0, margin); /* blue */ - err[0] = ((float) cnt[0]) / ((float) dstSize / 4) * 100.0f; + err[0] = ((float)cnt[0]) / ((float)dstSize / 4) * 100.0f; if (cnt[0] || cnt[1] || cnt[2]) { @@ -2305,17 +1713,9 @@ fail: int TestPrimitivesYCbCr(int argc, char* argv[]) { - const UINT32 formats[] = - { - PIXEL_FORMAT_XRGB32, - PIXEL_FORMAT_XBGR32, - PIXEL_FORMAT_ARGB32, - PIXEL_FORMAT_ABGR32, - PIXEL_FORMAT_RGBA32, - PIXEL_FORMAT_RGBX32, - PIXEL_FORMAT_BGRA32, - PIXEL_FORMAT_BGRX32 - }; + const UINT32 formats[] = { PIXEL_FORMAT_XRGB32, PIXEL_FORMAT_XBGR32, PIXEL_FORMAT_ARGB32, + PIXEL_FORMAT_ABGR32, PIXEL_FORMAT_RGBA32, PIXEL_FORMAT_RGBX32, + PIXEL_FORMAT_BGRA32, PIXEL_FORMAT_BGRX32 }; const primitives_t* prims = primitives_get(); const primitives_t* generics = primitives_get_generic(); UINT32 x; @@ -2328,7 +1728,8 @@ int TestPrimitivesYCbCr(int argc, char* argv[]) { prim_size_t roi = { 64, 64 }; int rc; - printf("----------------------- GENERIC %s [%"PRIu32"x%"PRIu32"] COMPARE CONTENT ----\n", + printf("----------------------- GENERIC %s [%" PRIu32 "x%" PRIu32 + "] COMPARE CONTENT ----\n", FreeRDPGetColorFormatName(formats[x]), roi.width, roi.height); rc = test_PrimitivesYCbCr(generics, formats[x], roi, TRUE); @@ -2337,7 +1738,8 @@ int TestPrimitivesYCbCr(int argc, char* argv[]) printf("------------------------- END %s ----------------------\n", FreeRDPGetColorFormatName(formats[x])); - printf("---------------------- OPTIMIZED %s [%"PRIu32"x%"PRIu32"] COMPARE CONTENT ----\n", + printf("---------------------- OPTIMIZED %s [%" PRIu32 "x%" PRIu32 + "] COMPARE CONTENT ----\n", FreeRDPGetColorFormatName(formats[x]), roi.width, roi.height); rc = test_PrimitivesYCbCr(prims, formats[x], roi, TRUE); @@ -2356,20 +1758,19 @@ int TestPrimitivesYCbCr(int argc, char* argv[]) { winpr_RAND((BYTE*)&roi.width, sizeof(roi.width)); roi.width %= 2048; - } - while (roi.width < 16); + } while (roi.width < 16); do { winpr_RAND((BYTE*)&roi.height, sizeof(roi.height)); roi.height %= 2048; - } - while (roi.height < 16); + } while (roi.height < 16); for (x = 0; x < sizeof(formats) / sizeof(formats[0]); x++) { int rc; - printf("----------------------- GENERIC %s [%"PRIu32"x%"PRIu32"] COMPARE CONTENT ----\n", + printf("----------------------- GENERIC %s [%" PRIu32 "x%" PRIu32 + "] COMPARE CONTENT ----\n", FreeRDPGetColorFormatName(formats[x]), roi.width, roi.height); rc = test_PrimitivesYCbCr(generics, formats[x], roi, FALSE); @@ -2378,7 +1779,8 @@ int TestPrimitivesYCbCr(int argc, char* argv[]) printf("------------------------- END %s ----------------------\n", FreeRDPGetColorFormatName(formats[x])); - printf("---------------------- OPTIMIZED %s [%"PRIu32"x%"PRIu32"] COMPARE CONTENT ----\n", + printf("---------------------- OPTIMIZED %s [%" PRIu32 "x%" PRIu32 + "] COMPARE CONTENT ----\n", FreeRDPGetColorFormatName(formats[x]), roi.width, roi.height); rc = test_PrimitivesYCbCr(prims, formats[x], roi, FALSE); @@ -2398,7 +1800,8 @@ int TestPrimitivesYCbCr(int argc, char* argv[]) for (x = 0; x < sizeof(formats) / sizeof(formats[0]); x++) { int rc; - printf("----------------------- GENERIC %s [%"PRIu32"x%"PRIu32"] COMPARE CONTENT ----\n", + printf("----------------------- GENERIC %s [%" PRIu32 "x%" PRIu32 + "] COMPARE CONTENT ----\n", FreeRDPGetColorFormatName(formats[x]), roi.width, roi.height); rc = test_PrimitivesYCbCr(generics, formats[x], roi, FALSE); @@ -2407,7 +1810,8 @@ int TestPrimitivesYCbCr(int argc, char* argv[]) printf("------------------------- END %s ----------------------\n", FreeRDPGetColorFormatName(formats[x])); - printf("---------------------- OPTIMIZED %s [%"PRIu32"x%"PRIu32"] COMPARE CONTENT ----\n", + printf("---------------------- OPTIMIZED %s [%" PRIu32 "x%" PRIu32 + "] COMPARE CONTENT ----\n", FreeRDPGetColorFormatName(formats[x]), roi.width, roi.height); rc = test_PrimitivesYCbCr(prims, formats[x], roi, FALSE); diff --git a/libfreerdp/primitives/test/TestPrimitivesYCoCg.c b/libfreerdp/primitives/test/TestPrimitivesYCoCg.c index 465319ec8..e2365131e 100644 --- a/libfreerdp/primitives/test/TestPrimitivesYCoCg.c +++ b/libfreerdp/primitives/test/TestPrimitivesYCoCg.c @@ -34,15 +34,8 @@ static BOOL test_YCoCgRToRGB_8u_AC4R_func(UINT32 width, UINT32 height) UINT32 i, x; const UINT32 srcStride = width * 4; const UINT32 size = srcStride * height; - const UINT32 formats[] = - { - PIXEL_FORMAT_ARGB32, - PIXEL_FORMAT_ABGR32, - PIXEL_FORMAT_RGBA32, - PIXEL_FORMAT_RGBX32, - PIXEL_FORMAT_BGRA32, - PIXEL_FORMAT_BGRX32 - }; + const UINT32 formats[] = { PIXEL_FORMAT_ARGB32, PIXEL_FORMAT_ABGR32, PIXEL_FORMAT_RGBA32, + PIXEL_FORMAT_RGBX32, PIXEL_FORMAT_BGRA32, PIXEL_FORMAT_BGRX32 }; PROFILER_DEFINE(genericProf) PROFILER_DEFINE(optProf) in = _aligned_malloc(size, 16); @@ -62,18 +55,16 @@ static BOOL test_YCoCgRToRGB_8u_AC4R_func(UINT32 width, UINT32 height) PROFILER_CREATE(genericProf, "YCoCgRToRGB_8u_AC4R-GENERIC") PROFILER_CREATE(optProf, "YCoCgRToRGB_8u_AC4R-OPT") PROFILER_ENTER(genericProf) - status = generic->YCoCgToRGB_8u_AC4R( - in, srcStride, - out_c, format, dstStride, width, height, 2, TRUE); + status = generic->YCoCgToRGB_8u_AC4R(in, srcStride, out_c, format, dstStride, width, height, + 2, TRUE); PROFILER_EXIT(genericProf) if (status != PRIMITIVES_SUCCESS) goto loop_fail; PROFILER_ENTER(optProf) - status = optimized->YCoCgToRGB_8u_AC4R( - in, srcStride, - out_sse, format, dstStride, width, height, 2, TRUE); + status = optimized->YCoCgToRGB_8u_AC4R(in, srcStride, out_sse, format, dstStride, width, + height, 2, TRUE); PROFILER_EXIT(optProf) if (status != PRIMITIVES_SUCCESS) @@ -88,14 +79,16 @@ static BOOL test_YCoCgRToRGB_8u_AC4R_func(UINT32 width, UINT32 height) if (c != sse) { - printf("optimized->YCoCgRToRGB FAIL[%s] [%"PRIu32"]: 0x%08"PRIx32" -> C 0x%08"PRIx32" vs optimized 0x%08"PRIx32"\n", + printf("optimized->YCoCgRToRGB FAIL[%s] [%" PRIu32 "]: 0x%08" PRIx32 + " -> C 0x%08" PRIx32 " vs optimized 0x%08" PRIx32 "\n", formatName, i, in[i + 1], c, sse); status = -1; } } } - printf("--------------------------- [%s] [%"PRIu32"x%"PRIu32"] ---------------------------\n", + printf("--------------------------- [%s] [%" PRIu32 "x%" PRIu32 + "] ---------------------------\n", formatName, width, height); PROFILER_PRINT_HEADER PROFILER_PRINT(genericProf) @@ -133,15 +126,13 @@ int TestPrimitivesYCoCg(int argc, char* argv[]) { winpr_RAND((BYTE*)&w, sizeof(w)); w %= 2048; - } - while (w < 16); + } while (w < 16); do { winpr_RAND((BYTE*)&h, sizeof(h)); h %= 2048; - } - while (h < 16); + } while (h < 16); if (!test_YCoCgRToRGB_8u_AC4R_func(w, h)) return 1; diff --git a/libfreerdp/primitives/test/TestPrimitivesYUV.c b/libfreerdp/primitives/test/TestPrimitivesYUV.c index 8abe04e85..09a14bc92 100644 --- a/libfreerdp/primitives/test/TestPrimitivesYUV.c +++ b/libfreerdp/primitives/test/TestPrimitivesYUV.c @@ -26,7 +26,8 @@ static BOOL similar(const BYTE* src, const BYTE* dst, size_t size) if (abs(diff) > 4) { - fprintf(stderr, "%"PRIuz" %02"PRIX8" : %02"PRIX8" diff=%d\n", x, src[x], dst[x], abs(diff)); + fprintf(stderr, "%" PRIuz " %02" PRIX8 " : %02" PRIX8 " diff=%d\n", x, src[x], dst[x], + abs(diff)); return FALSE; } } @@ -54,8 +55,10 @@ static BOOL similarRGB(const BYTE* src, const BYTE* dst, size_t size, UINT32 for if ((abs(sR - dR) > maxDiff) || (abs(sG - dG) > maxDiff) || (abs(sB - dB) > maxDiff)) { - fprintf(stderr, "Color value mismatch R[%02X %02X], G[%02X %02X], B[%02X %02X] at position %lu", - sR, dR, sG, dG, sA, dA, x); + fprintf( + stderr, + "Color value mismatch R[%02X %02X], G[%02X %02X], B[%02X %02X] at position %lu", + sR, dR, sG, dG, sA, dA, x); return FALSE; } @@ -79,8 +82,7 @@ static void get_size(BOOL large, UINT32* width, UINT32* height) *height = (*height % 64 + 1) << shift; } -static BOOL check_padding(const BYTE* psrc, size_t size, size_t padding, - const char* buffer) +static BOOL check_padding(const BYTE* psrc, size_t size, size_t padding, const char* buffer) { size_t x; BOOL rc = TRUE; @@ -106,7 +108,8 @@ static BOOL check_padding(const BYTE* psrc, size_t size, size_t padding, while ((x < halfPad) && (*esrc++ != 'A')) x++; - fprintf(stderr, "Buffer underflow detected %02"PRIx8" != %02X %s [%"PRIuz"-%"PRIuz"]\n", + fprintf(stderr, + "Buffer underflow detected %02" PRIx8 " != %02X %s [%" PRIuz "-%" PRIuz "]\n", d, 'A', buffer, start, x); return FALSE; } @@ -118,8 +121,9 @@ static BOOL check_padding(const BYTE* psrc, size_t size, size_t padding, while ((x < halfPad) && (*esrc++ != 'A')) x++; - fprintf(stderr, "Buffer overflow detected %02"PRIx8" != %02X %s [%"PRIuz"-%"PRIuz"]\n", - d, 'A', buffer, start, x); + fprintf(stderr, + "Buffer overflow detected %02" PRIx8 " != %02X %s [%" PRIuz "-%" PRIuz "]\n", d, + 'A', buffer, start, x); return FALSE; } } @@ -182,7 +186,8 @@ static BOOL TestPrimitiveYUVCombine(primitives_t* prims, prim_size_t roi) PROFILER_DEFINE(yuvSplit) awidth = roi.width + 16 - roi.width % 16; aheight = roi.height + 16 - roi.height % 16; - fprintf(stderr, "Running YUVCombine on frame size %"PRIu32"x%"PRIu32" [%"PRIu32"x%"PRIu32"]\n", + fprintf(stderr, + "Running YUVCombine on frame size %" PRIu32 "x%" PRIu32 " [%" PRIu32 "x%" PRIu32 "]\n", roi.width, roi.height, awidth, aheight); PROFILER_CREATE(yuvCombine, "YUV420CombineToYUV444") PROFILER_CREATE(yuvSplit, "YUV444SplitToYUV420") @@ -241,19 +246,15 @@ static BOOL TestPrimitiveYUVCombine(primitives_t* prims, prim_size_t roi) PROFILER_ENTER(yuvCombine) - if (prims->YUV420CombineToYUV444(AVC444_LUMA, - (const BYTE**)luma, lumaStride, - roi.width, roi.height, - yuv, yuvStride, &rect) != PRIMITIVES_SUCCESS) + if (prims->YUV420CombineToYUV444(AVC444_LUMA, (const BYTE**)luma, lumaStride, roi.width, + roi.height, yuv, yuvStride, &rect) != PRIMITIVES_SUCCESS) { PROFILER_EXIT(yuvCombine) goto fail; } - if (prims->YUV420CombineToYUV444(AVC444_CHROMAv1, - (const BYTE**)chroma, chromaStride, - roi.width, roi.height, - yuv, yuvStride, &rect) != PRIMITIVES_SUCCESS) + if (prims->YUV420CombineToYUV444(AVC444_CHROMAv1, (const BYTE**)chroma, chromaStride, roi.width, + roi.height, yuv, yuvStride, &rect) != PRIMITIVES_SUCCESS) { PROFILER_EXIT(yuvCombine) goto fail; @@ -279,8 +280,8 @@ static BOOL TestPrimitiveYUVCombine(primitives_t* prims, prim_size_t roi) PROFILER_ENTER(yuvSplit) - if (prims->YUV444SplitToYUV420((const BYTE**)yuv, yuvStride, pmain, lumaStride, - paux, chromaStride, &roi) != PRIMITIVES_SUCCESS) + if (prims->YUV444SplitToYUV420((const BYTE**)yuv, yuvStride, pmain, lumaStride, paux, + chromaStride, &roi) != PRIMITIVES_SUCCESS) { PROFILER_EXIT(yuvSplit) goto fail; @@ -320,9 +321,7 @@ static BOOL TestPrimitiveYUVCombine(primitives_t* prims, prim_size_t roi) continue; } - if (!similar(luma[i] + y * lstride, - pmain[i] + y * lstride, - w)) + if (!similar(luma[i] + y * lstride, pmain[i] + y * lstride, w)) goto fail; /* Need to ignore lines of destination Y plane, @@ -339,9 +338,7 @@ static BOOL TestPrimitiveYUVCombine(primitives_t* prims, prim_size_t roi) continue; } - if (!similar(chroma[i] + y * cstride, - paux[i] + y * cstride, - w)) + if (!similar(chroma[i] + y * cstride, paux[i] + y * cstride, w)) goto fail; } } @@ -372,7 +369,7 @@ static BOOL TestPrimitiveYUV(primitives_t* prims, prim_size_t roi, BOOL use444) BOOL rc = FALSE; UINT32 x, y; UINT32 awidth, aheight; - BYTE* yuv[3] = {0}; + BYTE* yuv[3] = { 0 }; UINT32 yuv_step[3]; BYTE* rgb = NULL; BYTE* rgb_dst = NULL; @@ -380,17 +377,9 @@ static BOOL TestPrimitiveYUV(primitives_t* prims, prim_size_t roi, BOOL use444) size_t uvsize, uvwidth; size_t padding = 100 * 16; UINT32 stride; - const UINT32 formats[] = - { - PIXEL_FORMAT_XRGB32, - PIXEL_FORMAT_XBGR32, - PIXEL_FORMAT_ARGB32, - PIXEL_FORMAT_ABGR32, - PIXEL_FORMAT_RGBA32, - PIXEL_FORMAT_RGBX32, - PIXEL_FORMAT_BGRA32, - PIXEL_FORMAT_BGRX32 - }; + const UINT32 formats[] = { PIXEL_FORMAT_XRGB32, PIXEL_FORMAT_XBGR32, PIXEL_FORMAT_ARGB32, + PIXEL_FORMAT_ABGR32, PIXEL_FORMAT_RGBA32, PIXEL_FORMAT_RGBX32, + PIXEL_FORMAT_BGRA32, PIXEL_FORMAT_BGRX32 }; PROFILER_DEFINE(rgbToYUV420) PROFILER_DEFINE(rgbToYUV444) PROFILER_DEFINE(yuv420ToRGB) @@ -418,7 +407,7 @@ static BOOL TestPrimitiveYUV(primitives_t* prims, prim_size_t roi, BOOL use444) return FALSE; } - fprintf(stderr, "Running AVC%s on frame size %"PRIu32"x%"PRIu32"\n", use444 ? "444" : "420", + fprintf(stderr, "Running AVC%s on frame size %" PRIu32 "x%" PRIu32 "\n", use444 ? "444" : "420", roi.width, roi.height); /* Test RGB to YUV444 conversion and vice versa */ @@ -467,9 +456,7 @@ static BOOL TestPrimitiveYUV(primitives_t* prims, prim_size_t roi, BOOL use444) if (use444) { PROFILER_ENTER(rgbToYUV444) - rc = prims->RGBToYUV444_8u_P3AC4R(rgb, DstFormat, - stride, yuv, yuv_step, - &roi); + rc = prims->RGBToYUV444_8u_P3AC4R(rgb, DstFormat, stride, yuv, yuv_step, &roi); PROFILER_EXIT(rgbToYUV444) if (rc != PRIMITIVES_SUCCESS) @@ -482,9 +469,7 @@ static BOOL TestPrimitiveYUV(primitives_t* prims, prim_size_t roi, BOOL use444) else { PROFILER_ENTER(rgbToYUV420) - rc = prims->RGBToYUV420_8u_P3AC4R(rgb, DstFormat, - stride, yuv, yuv_step, - &roi); + rc = prims->RGBToYUV420_8u_P3AC4R(rgb, DstFormat, stride, yuv, yuv_step, &roi); PROFILER_EXIT(rgbToYUV420) if (rc != PRIMITIVES_SUCCESS) @@ -513,8 +498,7 @@ static BOOL TestPrimitiveYUV(primitives_t* prims, prim_size_t roi, BOOL use444) { PROFILER_ENTER(yuv444ToRGB) rc = prims->YUV444ToRGB_8u_P3AC4R((const BYTE**)yuv, yuv_step, rgb_dst, stride, - DstFormat, - &roi); + DstFormat, &roi); PROFILER_EXIT(yuv444ToRGB) if (rc != PRIMITIVES_SUCCESS) @@ -533,8 +517,8 @@ static BOOL TestPrimitiveYUV(primitives_t* prims, prim_size_t roi, BOOL use444) { PROFILER_ENTER(yuv420ToRGB) - if (prims->YUV420ToRGB_8u_P3AC4R((const BYTE**)yuv, yuv_step, rgb_dst, - stride, DstFormat, &roi) != PRIMITIVES_SUCCESS) + if (prims->YUV420ToRGB_8u_P3AC4R((const BYTE**)yuv, yuv_step, rgb_dst, stride, + DstFormat, &roi) != PRIMITIVES_SUCCESS) { PROFILER_EXIT(yuv420ToRGB) goto fail; @@ -638,8 +622,7 @@ static BOOL check_for_mismatches(const BYTE* planeA, const BYTE* planeB, UINT32 if (fabsf((float)a - (float)b) > 2.0f) { rc = TRUE; - fprintf(stderr, "[%08x] %02x != %02x\n", - x, a, b); + fprintf(stderr, "[%08x] %02x != %02x\n", x, a, b); } } @@ -680,10 +663,10 @@ static BOOL TestPrimitiveRgbToLumaChroma(primitives_t* prims, prim_size_t roi, U BOOL rc = FALSE; UINT32 x, y, cnt; UINT32 awidth, aheight; - BYTE* luma[3] = {0}; - BYTE* chroma[3] = {0}; - BYTE* lumaGeneric[3] = {0}; - BYTE* chromaGeneric[3] = {0}; + BYTE* luma[3] = { 0 }; + BYTE* chroma[3] = { 0 }; + BYTE* lumaGeneric[3] = { 0 }; + BYTE* chromaGeneric[3] = { 0 }; UINT32 yuv_step[3]; BYTE* rgb = NULL; size_t size; @@ -691,17 +674,9 @@ static BOOL TestPrimitiveRgbToLumaChroma(primitives_t* prims, prim_size_t roi, U const size_t padding = 0x1000; UINT32 stride; __RGBToAVC444YUV_t fkt, gen; - const UINT32 formats[] = - { - PIXEL_FORMAT_XRGB32, - PIXEL_FORMAT_XBGR32, - PIXEL_FORMAT_ARGB32, - PIXEL_FORMAT_ABGR32, - PIXEL_FORMAT_RGBA32, - PIXEL_FORMAT_RGBX32, - PIXEL_FORMAT_BGRA32, - PIXEL_FORMAT_BGRX32 - }; + const UINT32 formats[] = { PIXEL_FORMAT_XRGB32, PIXEL_FORMAT_XBGR32, PIXEL_FORMAT_ARGB32, + PIXEL_FORMAT_ABGR32, PIXEL_FORMAT_RGBA32, PIXEL_FORMAT_RGBX32, + PIXEL_FORMAT_BGRA32, PIXEL_FORMAT_BGRX32 }; PROFILER_DEFINE(rgbToYUV444) PROFILER_DEFINE(rgbToYUV444opt) /* Buffers need to be 16x16 aligned. */ @@ -742,8 +717,8 @@ static BOOL TestPrimitiveRgbToLumaChroma(primitives_t* prims, prim_size_t roi, U if (!fkt || !gen) return FALSE; - fprintf(stderr, "Running AVC444 on frame size %"PRIu32"x%"PRIu32"\n", - roi.width, roi.height); + fprintf(stderr, "Running AVC444 on frame size %" PRIu32 "x%" PRIu32 "\n", roi.width, + roi.height); /* Test RGB to YUV444 conversion and vice versa */ if (!(rgb = set_padding(size * sizeof(UINT32), padding))) @@ -886,7 +861,7 @@ int TestPrimitivesYUV(int argc, char* argv[]) if (argc > 1) { - int rc = sscanf(argv[1], "%"PRIu32"x%"PRIu32, &roi.width, &roi.height); + int rc = sscanf(argv[1], "%" PRIu32 "x%" PRIu32, &roi.width, &roi.height); if (rc != 2) { @@ -975,4 +950,3 @@ int TestPrimitivesYUV(int argc, char* argv[]) end: return rc; } - diff --git a/libfreerdp/primitives/test/measure.h b/libfreerdp/primitives/test/measure.h index 4377ee8c5..a54003084 100644 --- a/libfreerdp/primitives/test/measure.h +++ b/libfreerdp/primitives/test/measure.h @@ -53,14 +53,16 @@ #ifdef GOOGLE_PROFILER #include -#define PROFILER_START(_prefix_) \ - do { \ - char _path[PATH_MAX]; \ - sprintf_s(_path, sizeof(_path), "./%s.prof", (_prefix_)); \ - ProfilerStart(_path); \ +#define PROFILER_START(_prefix_) \ + do \ + { \ + char _path[PATH_MAX]; \ + sprintf_s(_path, sizeof(_path), "./%s.prof", (_prefix_)); \ + ProfilerStart(_path); \ } while (0); -# define PROFILER_STOP \ - do { \ +#define PROFILER_STOP \ + do \ + { \ ProfilerStop(); \ } while (0); #else @@ -75,63 +77,68 @@ extern void _floatprint(float t, char* output); #define CLOCK_MONOTONIC_RAW 4 #endif // !CLOCK_MONOTONIC_RAW -#define MEASURE_LOOP_START(_prefix_, _count_) \ - { struct timespec _start, _stop; \ - char *_prefix; \ - int _count = (_count_); \ - int _loop; \ - float _delta; \ - char _str1[32], _str2[32]; \ - _prefix = strdup(_prefix_); \ - _str1[0] = '\0'; _str2[0] = '\0'; \ - clock_gettime(CLOCK_MONOTONIC_RAW, &_start); \ - PROFILER_START(_prefix); \ - _loop = (_count); \ - do { +#define MEASURE_LOOP_START(_prefix_, _count_) \ + { \ + struct timespec _start, _stop; \ + char* _prefix; \ + int _count = (_count_); \ + int _loop; \ + float _delta; \ + char _str1[32], _str2[32]; \ + _prefix = strdup(_prefix_); \ + _str1[0] = '\0'; \ + _str2[0] = '\0'; \ + clock_gettime(CLOCK_MONOTONIC_RAW, &_start); \ + PROFILER_START(_prefix); \ + _loop = (_count); \ + do \ + { -#define MEASURE_LOOP_STOP \ - } while (--_loop); +#define MEASURE_LOOP_STOP \ + } \ + while (--_loop) \ + ; -#define MEASURE_GET_RESULTS(_result_) \ - PROFILER_STOP; \ - clock_gettime(CLOCK_MONOTONIC_RAW, &_stop); \ - _delta = _delta_time(&_start, &_stop); \ - (_result_) = (float) _count / _delta; \ - free(_prefix); \ - } - -#define MEASURE_SHOW_RESULTS(_result_) \ - PROFILER_STOP; \ +#define MEASURE_GET_RESULTS(_result_) \ + PROFILER_STOP; \ clock_gettime(CLOCK_MONOTONIC_RAW, &_stop); \ - _delta = _delta_time(&_start, &_stop); \ - (_result_) = (float) _count / _delta; \ - _floatprint((float) _count / _delta, _str1); \ - printf("%s: %9d iterations in %5.1f seconds = %s/s \n", \ - _prefix, _count, _delta, _str1); \ - free(_prefix); \ + _delta = _delta_time(&_start, &_stop); \ + (_result_) = (float)_count / _delta; \ + free(_prefix); \ } -#define MEASURE_SHOW_RESULTS_SCALED(_scale_, _label_) \ - PROFILER_STOP; \ - clock_gettime(CLOCK_MONOTONIC_RAW, &_stop); \ - _delta = _delta_time(&_start, &_stop); \ - _floatprint((float) _count / _delta, _str1); \ - _floatprint((float) _count / _delta * (_scale_), _str2); \ - printf("%s: %9d iterations in %5.1f seconds = %s/s = %s%s \n", \ - _prefix, _count, _delta, _str1, _str2, _label_); \ - free(_prefix); \ +#define MEASURE_SHOW_RESULTS(_result_) \ + PROFILER_STOP; \ + clock_gettime(CLOCK_MONOTONIC_RAW, &_stop); \ + _delta = _delta_time(&_start, &_stop); \ + (_result_) = (float)_count / _delta; \ + _floatprint((float)_count / _delta, _str1); \ + printf("%s: %9d iterations in %5.1f seconds = %s/s \n", _prefix, _count, _delta, _str1); \ + free(_prefix); \ } -#define MEASURE_TIMED(_label_, _init_iter_, _test_time_, _result_, _call_) \ - { float _r; \ - MEASURE_LOOP_START(_label_, _init_iter_); \ - _call_; \ - MEASURE_LOOP_STOP; \ - MEASURE_GET_RESULTS(_r); \ - MEASURE_LOOP_START(_label_, _r * _test_time_); \ - _call_; \ - MEASURE_LOOP_STOP; \ - MEASURE_SHOW_RESULTS(_result_); \ +#define MEASURE_SHOW_RESULTS_SCALED(_scale_, _label_) \ + PROFILER_STOP; \ + clock_gettime(CLOCK_MONOTONIC_RAW, &_stop); \ + _delta = _delta_time(&_start, &_stop); \ + _floatprint((float)_count / _delta, _str1); \ + _floatprint((float)_count / _delta * (_scale_), _str2); \ + printf("%s: %9d iterations in %5.1f seconds = %s/s = %s%s \n", _prefix, _count, _delta, _str1, \ + _str2, _label_); \ + free(_prefix); \ + } + +#define MEASURE_TIMED(_label_, _init_iter_, _test_time_, _result_, _call_) \ + { \ + float _r; \ + MEASURE_LOOP_START(_label_, _init_iter_); \ + _call_; \ + MEASURE_LOOP_STOP; \ + MEASURE_GET_RESULTS(_r); \ + MEASURE_LOOP_START(_label_, _r* _test_time_); \ + _call_; \ + MEASURE_LOOP_STOP; \ + MEASURE_SHOW_RESULTS(_result_); \ } #endif diff --git a/libfreerdp/primitives/test/prim_test.c b/libfreerdp/primitives/test/prim_test.c index 25cc37443..e618b516c 100644 --- a/libfreerdp/primitives/test/prim_test.c +++ b/libfreerdp/primitives/test/prim_test.c @@ -59,8 +59,8 @@ float _delta_time(const struct timespec* t0, const struct timespec* t1) nsecs += 1000000000; } - retval = (double) secs + (double) nsecs / (double) 1000000000.0; - return (retval < 0.0) ? 0.0 : (float) retval; + retval = (double)secs + (double)nsecs / (double)1000000000.0; + return (retval < 0.0) ? 0.0 : (float)retval; } #endif @@ -71,42 +71,45 @@ void _floatprint(float t, char* output) float f = 10.0; int i; - while (t > f) f *= 10.0; + while (t > f) + f *= 10.0; f /= 1000.0; - i = ((int)(t / f + 0.5)) * (int) f; + i = ((int)(t / f + 0.5)) * (int)f; - if (t < 0.0) sprintf(output, "%f", t); - else if (i == 0) sprintf(output, "%d", (int)(t + 0.5)); - else if (t < 1e+3) sprintf(output, "%3d", i); - else if (t < 1e+6) sprintf(output, "%3d,%03d", - i / 1000, i % 1000); - else if (t < 1e+9) sprintf(output, "%3d,%03d,000", - i / 1000000, (i % 1000000) / 1000); - else if (t < 1e+12) sprintf(output, "%3d,%03d,000,000", - i / 1000000000, (i % 1000000000) / 1000000); - else sprintf(output, "%f", t); + if (t < 0.0) + sprintf(output, "%f", t); + else if (i == 0) + sprintf(output, "%d", (int)(t + 0.5)); + else if (t < 1e+3) + sprintf(output, "%3d", i); + else if (t < 1e+6) + sprintf(output, "%3d,%03d", i / 1000, i % 1000); + else if (t < 1e+9) + sprintf(output, "%3d,%03d,000", i / 1000000, (i % 1000000) / 1000); + else if (t < 1e+12) + sprintf(output, "%3d,%03d,000,000", i / 1000000000, (i % 1000000000) / 1000000); + else + sprintf(output, "%f", t); } - -void prim_test_setup(BOOL performance) { +void prim_test_setup(BOOL performance) +{ generic = primitives_get_generic(); optimized = primitives_get(); g_TestPrimitivesPerformance = performance; } - -BOOL speed_test(const char* name, const char* dsc, UINT32 iterations, - pstatus_t(*generic)(), pstatus_t(*optimised)(), ...) +BOOL speed_test(const char* name, const char* dsc, UINT32 iterations, pstatus_t (*generic)(), + pstatus_t (*optimised)(), ...) { UINT32 i; if (!name || !generic || !optimised || (iterations == 0)) return FALSE; - for (i=0; iPipeFlags); move += 12; /* Already set to zero by memset - MsPipe->PipeHandle = 0; - MsPipe->bEndpointAddress = 0; - MsPipe->bInterval = 0; - MsPipe->PipeType = 0; - MsPipe->InitCompleted = 0; + MsPipe->PipeHandle = 0; + MsPipe->bEndpointAddress = 0; + MsPipe->bInterval = 0; + MsPipe->PipeType = 0; + MsPipe->InitCompleted = 0; */ MsPipes[pnum] = MsPipe; } @@ -112,8 +112,7 @@ out_error: static MSUSB_INTERFACE_DESCRIPTOR* msusb_msinterface_new() { - return (MSUSB_INTERFACE_DESCRIPTOR*) calloc(1, - sizeof(MSUSB_INTERFACE_DESCRIPTOR)); + return (MSUSB_INTERFACE_DESCRIPTOR*)calloc(1, sizeof(MSUSB_INTERFACE_DESCRIPTOR)); } static void msusb_msinterface_free(MSUSB_INTERFACE_DESCRIPTOR* MsInterface) @@ -126,8 +125,8 @@ static void msusb_msinterface_free(MSUSB_INTERFACE_DESCRIPTOR* MsInterface) } } -static void msusb_msinterface_free_list(MSUSB_INTERFACE_DESCRIPTOR** - MsInterfaces, UINT32 NumInterfaces) +static void msusb_msinterface_free_list(MSUSB_INTERFACE_DESCRIPTOR** MsInterfaces, + UINT32 NumInterfaces) { UINT32 inum = 0; @@ -142,15 +141,14 @@ static void msusb_msinterface_free_list(MSUSB_INTERFACE_DESCRIPTOR** } } -void msusb_msinterface_replace(MSUSB_CONFIG_DESCRIPTOR* MsConfig, - BYTE InterfaceNumber, MSUSB_INTERFACE_DESCRIPTOR* NewMsInterface) +void msusb_msinterface_replace(MSUSB_CONFIG_DESCRIPTOR* MsConfig, BYTE InterfaceNumber, + MSUSB_INTERFACE_DESCRIPTOR* NewMsInterface) { msusb_msinterface_free(MsConfig->MsInterfaces[InterfaceNumber]); MsConfig->MsInterfaces[InterfaceNumber] = NewMsInterface; } -MSUSB_INTERFACE_DESCRIPTOR* msusb_msinterface_read(BYTE* data, UINT32 data_size, - int* offset) +MSUSB_INTERFACE_DESCRIPTOR* msusb_msinterface_read(BYTE* data, UINT32 data_size, int* offset) { MSUSB_INTERFACE_DESCRIPTOR* MsInterface; MsInterface = msusb_msinterface_new(); @@ -173,9 +171,8 @@ MSUSB_INTERFACE_DESCRIPTOR* msusb_msinterface_read(BYTE* data, UINT32 data_size, if (MsInterface->NumberOfPipes > 0) { - MsInterface->MsPipes = - msusb_mspipes_read(data + (*offset), data_size - (*offset), - MsInterface->NumberOfPipes, offset); + MsInterface->MsPipes = msusb_mspipes_read(data + (*offset), data_size - (*offset), + MsInterface->NumberOfPipes, offset); if (!MsInterface->MsPipes) goto out_error; @@ -187,8 +184,7 @@ out_error: return NULL; } -int msusb_msinterface_write(MSUSB_INTERFACE_DESCRIPTOR* MsInterface, BYTE* data, - int* offset) +int msusb_msinterface_write(MSUSB_INTERFACE_DESCRIPTOR* MsInterface, BYTE* data, int* offset) { MSUSB_PIPE_DESCRIPTOR** MsPipes; MSUSB_PIPE_DESCRIPTOR* MsPipe; @@ -239,29 +235,27 @@ int msusb_msinterface_write(MSUSB_INTERFACE_DESCRIPTOR* MsInterface, BYTE* data, return 0; } -static MSUSB_INTERFACE_DESCRIPTOR** msusb_msinterface_read_list(BYTE* data, - UINT32 data_size, UINT32 NumInterfaces) +static MSUSB_INTERFACE_DESCRIPTOR** msusb_msinterface_read_list(BYTE* data, UINT32 data_size, + UINT32 NumInterfaces) { UINT32 inum; int offset = 0; MSUSB_INTERFACE_DESCRIPTOR** MsInterfaces; - MsInterfaces = (MSUSB_INTERFACE_DESCRIPTOR**) calloc(NumInterfaces, - sizeof(MSUSB_INTERFACE_DESCRIPTOR*)); + MsInterfaces = + (MSUSB_INTERFACE_DESCRIPTOR**)calloc(NumInterfaces, sizeof(MSUSB_INTERFACE_DESCRIPTOR*)); if (!MsInterfaces) return NULL; for (inum = 0; inum < NumInterfaces; inum++) { - MsInterfaces[inum] = msusb_msinterface_read(data + offset, data_size - offset, - &offset); + MsInterfaces[inum] = msusb_msinterface_read(data + offset, data_size - offset, &offset); } return MsInterfaces; } -int msusb_msconfig_write(MSUSB_CONFIG_DESCRIPTOR* MsConfg, BYTE* data, - int* offset) +int msusb_msconfig_write(MSUSB_CONFIG_DESCRIPTOR* MsConfg, BYTE* data, int* offset) { UINT32 inum = 0; MSUSB_INTERFACE_DESCRIPTOR** MsInterfaces; @@ -285,7 +279,7 @@ int msusb_msconfig_write(MSUSB_CONFIG_DESCRIPTOR* MsConfg, BYTE* data, MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_new() { - return (MSUSB_CONFIG_DESCRIPTOR*) calloc(1, sizeof(MSUSB_CONFIG_DESCRIPTOR)); + return (MSUSB_CONFIG_DESCRIPTOR*)calloc(1, sizeof(MSUSB_CONFIG_DESCRIPTOR)); } void msusb_msconfig_free(MSUSB_CONFIG_DESCRIPTOR* MsConfig) @@ -298,8 +292,7 @@ void msusb_msconfig_free(MSUSB_CONFIG_DESCRIPTOR* MsConfig) } } -MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_read(BYTE* data, UINT32 data_size, - UINT32 NumInterfaces) +MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_read(BYTE* data, UINT32 data_size, UINT32 NumInterfaces) { UINT32 i, offset = 0; UINT16 lenInterface; @@ -318,13 +311,14 @@ MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_read(BYTE* data, UINT32 data_size, if (lenConfiguration != 0x9 || typeConfiguration != 0x2) { - DEBUG_MSUSB("%s: len and type must be 0x9 and 0x2 , but it is 0x%"PRIx8" and 0x%"PRIx8"", + DEBUG_MSUSB("%s: len and type must be 0x9 and 0x2 , but it is 0x%" PRIx8 " and 0x%" PRIx8 + "", __FUNCTION__, lenConfiguration, typeConfiguration); } data_read_UINT16(data + offset + 2, MsConfig->wTotalLength); data_read_BYTE(data + offset + 5, MsConfig->bConfigurationValue); - MsConfig->NumInterfaces = NumInterfaces; + MsConfig->NumInterfaces = NumInterfaces; MsConfig->ConfigurationHandle = 0; MsConfig->InitCompleted = 0; MsConfig->MsOutSize = 0; @@ -333,8 +327,7 @@ MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_read(BYTE* data, UINT32 data_size, if (NumInterfaces > 0) { - MsConfig->MsInterfaces = msusb_msinterface_read_list(data, data_size, - NumInterfaces); + MsConfig->MsInterfaces = msusb_msinterface_read_list(data, data_size, NumInterfaces); } return MsConfig; @@ -347,45 +340,46 @@ void msusb_msconfig_dump(MSUSB_CONFIG_DESCRIPTOR* MsConfig) MSUSB_PIPE_DESCRIPTOR** MsPipes; MSUSB_PIPE_DESCRIPTOR* MsPipe; UINT32 inum = 0, pnum = 0; - WLog_INFO(TAG, "=================MsConfig:========================"); - WLog_INFO(TAG, "wTotalLength:%"PRIu16"", MsConfig->wTotalLength); - WLog_INFO(TAG, "bConfigurationValue:%"PRIu8"", MsConfig->bConfigurationValue); - WLog_INFO(TAG, "ConfigurationHandle:0x%08"PRIx32"", MsConfig->ConfigurationHandle); - WLog_INFO(TAG, "InitCompleted:%d", MsConfig->InitCompleted); - WLog_INFO(TAG, "MsOutSize:%d", MsConfig->MsOutSize); - WLog_INFO(TAG, "NumInterfaces:%"PRIu32"", MsConfig->NumInterfaces); + WLog_INFO(TAG, "=================MsConfig:========================"); + WLog_INFO(TAG, "wTotalLength:%" PRIu16 "", MsConfig->wTotalLength); + WLog_INFO(TAG, "bConfigurationValue:%" PRIu8 "", MsConfig->bConfigurationValue); + WLog_INFO(TAG, "ConfigurationHandle:0x%08" PRIx32 "", MsConfig->ConfigurationHandle); + WLog_INFO(TAG, "InitCompleted:%d", MsConfig->InitCompleted); + WLog_INFO(TAG, "MsOutSize:%d", MsConfig->MsOutSize); + WLog_INFO(TAG, "NumInterfaces:%" PRIu32 "", MsConfig->NumInterfaces); MsInterfaces = MsConfig->MsInterfaces; for (inum = 0; inum < MsConfig->NumInterfaces; inum++) { MsInterface = MsInterfaces[inum]; - WLog_INFO(TAG, " Interface: %"PRIu8"", MsInterface->InterfaceNumber); - WLog_INFO(TAG, " Length: %"PRIu16"", MsInterface->Length); - WLog_INFO(TAG, " NumberOfPipesExpected: %"PRIu16"", + WLog_INFO(TAG, " Interface: %" PRIu8 "", MsInterface->InterfaceNumber); + WLog_INFO(TAG, " Length: %" PRIu16 "", MsInterface->Length); + WLog_INFO(TAG, " NumberOfPipesExpected: %" PRIu16 "", MsInterface->NumberOfPipesExpected); - WLog_INFO(TAG, " AlternateSetting: %"PRIu8"", MsInterface->AlternateSetting); - WLog_INFO(TAG, " NumberOfPipes: %"PRIu32"", MsInterface->NumberOfPipes); - WLog_INFO(TAG, " InterfaceHandle: 0x%08"PRIx32"", MsInterface->InterfaceHandle); - WLog_INFO(TAG, " bInterfaceClass: 0x%02"PRIx8"", MsInterface->bInterfaceClass); - WLog_INFO(TAG, " bInterfaceSubClass: 0x%02"PRIx8"", MsInterface->bInterfaceSubClass); - WLog_INFO(TAG, " bInterfaceProtocol: 0x%02"PRIx8"", MsInterface->bInterfaceProtocol); - WLog_INFO(TAG, " InitCompleted: %d", MsInterface->InitCompleted); + WLog_INFO(TAG, " AlternateSetting: %" PRIu8 "", MsInterface->AlternateSetting); + WLog_INFO(TAG, " NumberOfPipes: %" PRIu32 "", MsInterface->NumberOfPipes); + WLog_INFO(TAG, " InterfaceHandle: 0x%08" PRIx32 "", MsInterface->InterfaceHandle); + WLog_INFO(TAG, " bInterfaceClass: 0x%02" PRIx8 "", MsInterface->bInterfaceClass); + WLog_INFO(TAG, " bInterfaceSubClass: 0x%02" PRIx8 "", MsInterface->bInterfaceSubClass); + WLog_INFO(TAG, " bInterfaceProtocol: 0x%02" PRIx8 "", MsInterface->bInterfaceProtocol); + WLog_INFO(TAG, " InitCompleted: %d", MsInterface->InitCompleted); MsPipes = MsInterface->MsPipes; for (pnum = 0; pnum < MsInterface->NumberOfPipes; pnum++) { MsPipe = MsPipes[pnum]; - WLog_INFO(TAG, " Pipe: %d", pnum); - WLog_INFO(TAG, " MaximumPacketSize: 0x%04"PRIx16"", MsPipe->MaximumPacketSize); - WLog_INFO(TAG, " MaximumTransferSize: 0x%08"PRIx32"", MsPipe->MaximumTransferSize); - WLog_INFO(TAG, " PipeFlags: 0x%08"PRIx32"", MsPipe->PipeFlags); - WLog_INFO(TAG, " PipeHandle: 0x%08"PRIx32"", MsPipe->PipeHandle); - WLog_INFO(TAG, " bEndpointAddress: 0x%02"PRIx8"", MsPipe->bEndpointAddress); - WLog_INFO(TAG, " bInterval: %"PRIu8"", MsPipe->bInterval); - WLog_INFO(TAG, " PipeType: 0x%02"PRIx8"", MsPipe->PipeType); - WLog_INFO(TAG, " InitCompleted: %d", MsPipe->InitCompleted); + WLog_INFO(TAG, " Pipe: %d", pnum); + WLog_INFO(TAG, " MaximumPacketSize: 0x%04" PRIx16 "", MsPipe->MaximumPacketSize); + WLog_INFO(TAG, " MaximumTransferSize: 0x%08" PRIx32 "", + MsPipe->MaximumTransferSize); + WLog_INFO(TAG, " PipeFlags: 0x%08" PRIx32 "", MsPipe->PipeFlags); + WLog_INFO(TAG, " PipeHandle: 0x%08" PRIx32 "", MsPipe->PipeHandle); + WLog_INFO(TAG, " bEndpointAddress: 0x%02" PRIx8 "", MsPipe->bEndpointAddress); + WLog_INFO(TAG, " bInterval: %" PRIu8 "", MsPipe->bInterval); + WLog_INFO(TAG, " PipeType: 0x%02" PRIx8 "", MsPipe->PipeType); + WLog_INFO(TAG, " InitCompleted: %d", MsPipe->InitCompleted); } } - WLog_INFO(TAG, "=================================================="); + WLog_INFO(TAG, "=================================================="); } diff --git a/libfreerdp/utils/passphrase.c b/libfreerdp/utils/passphrase.c index ab6e3e7a9..bf6414a9d 100644 --- a/libfreerdp/utils/passphrase.c +++ b/libfreerdp/utils/passphrase.c @@ -58,8 +58,7 @@ char* freerdp_passphrase_read(const char* prompt, char* buf, size_t bufsiz, int } ctermid(term_name); - if(from_stdin || strcmp(term_name, "") == 0 - || (term_file = open(term_name, O_RDWR)) == -1) + if (from_stdin || strcmp(term_name, "") == 0 || (term_file = open(term_name, O_RDWR)) == -1) { write_file = STDERR_FILENO; terminal_fildes = STDIN_FILENO; @@ -80,7 +79,7 @@ char* freerdp_passphrase_read(const char* prompt, char* buf, size_t bufsiz, int terminal_needs_reset = 0; } - if (write(write_file, prompt, strlen(prompt)) == (ssize_t) -1) + if (write(write_file, prompt, strlen(prompt)) == (ssize_t)-1) goto error; buf_iter = buf; @@ -88,7 +87,7 @@ char* freerdp_passphrase_read(const char* prompt, char* buf, size_t bufsiz, int { if (read_char == '\n') break; - if (read_bytes < (bufsiz - (size_t) 1)) + if (read_bytes < (bufsiz - (size_t)1)) { read_bytes++; *buf_iter = read_char; @@ -98,12 +97,12 @@ char* freerdp_passphrase_read(const char* prompt, char* buf, size_t bufsiz, int *buf_iter = '\0'; buf_iter = NULL; read_char = '\0'; - if (nbytes == (ssize_t) -1) + if (nbytes == (ssize_t)-1) goto error; if (terminal_needs_reset) { - if (tcsetattr(terminal_fildes, TCSAFLUSH, &orig_flags) == -1) + if (tcsetattr(terminal_fildes, TCSAFLUSH, &orig_flags) == -1) goto error; terminal_needs_reset = 0; } @@ -116,18 +115,18 @@ char* freerdp_passphrase_read(const char* prompt, char* buf, size_t bufsiz, int return buf; - error: - { - int saved_errno = errno; - buf_iter = NULL; - read_char = '\0'; - if (terminal_needs_reset) - tcsetattr(terminal_fildes, TCSAFLUSH, &orig_flags); - if (terminal_fildes != STDIN_FILENO) - close(terminal_fildes); - errno = saved_errno; - return NULL; - } +error: +{ + int saved_errno = errno; + buf_iter = NULL; + read_char = '\0'; + if (terminal_needs_reset) + tcsetattr(terminal_fildes, TCSAFLUSH, &orig_flags); + if (terminal_fildes != STDIN_FILENO) + close(terminal_fildes); + errno = saved_errno; + return NULL; +} } #else @@ -138,4 +137,3 @@ char* freerdp_passphrase_read(const char* prompt, char* buf, size_t bufsiz, int } #endif - diff --git a/libfreerdp/utils/pcap.c b/libfreerdp/utils/pcap.c index 11a277bad..e50bbd7e7 100644 --- a/libfreerdp/utils/pcap.c +++ b/libfreerdp/utils/pcap.c @@ -42,7 +42,7 @@ int gettimeofday(struct timeval* tp, void* tz) { struct _timeb timebuffer; _ftime(&timebuffer); - tp->tv_sec = (long) timebuffer.time; + tp->tv_sec = (long)timebuffer.time; tp->tv_usec = timebuffer.millitm * 1000; return 0; } @@ -51,26 +51,26 @@ int gettimeofday(struct timeval* tp, void* tz) #include #include -#define PCAP_MAGIC 0xA1B2C3D4 +#define PCAP_MAGIC 0xA1B2C3D4 static BOOL pcap_read_header(rdpPcap* pcap, pcap_header* header) { - return fread((void*) header, sizeof(pcap_header), 1, pcap->fp) == 1; + return fread((void*)header, sizeof(pcap_header), 1, pcap->fp) == 1; } static BOOL pcap_write_header(rdpPcap* pcap, pcap_header* header) { - return fwrite((void*) header, sizeof(pcap_header), 1, pcap->fp) == 1; + return fwrite((void*)header, sizeof(pcap_header), 1, pcap->fp) == 1; } static BOOL pcap_read_record_header(rdpPcap* pcap, pcap_record_header* record) { - return fread((void*) record, sizeof(pcap_record_header), 1, pcap->fp) == 1; + return fread((void*)record, sizeof(pcap_record_header), 1, pcap->fp) == 1; } static BOOL pcap_write_record_header(rdpPcap* pcap, pcap_record_header* record) { - return fwrite((void*) record, sizeof(pcap_record_header), 1, pcap->fp) == 1; + return fwrite((void*)record, sizeof(pcap_record_header), 1, pcap->fp) == 1; } static BOOL pcap_read_record(rdpPcap* pcap, pcap_record* record) @@ -95,7 +95,7 @@ static BOOL pcap_read_record(rdpPcap* pcap, pcap_record* record) static BOOL pcap_write_record(rdpPcap* pcap, pcap_record* record) { return pcap_write_record_header(pcap, &record->header) && - (fwrite(record->data, record->length, 1, pcap->fp) == 1); + (fwrite(record->data, record->length, 1, pcap->fp) == 1); } BOOL pcap_add_record(rdpPcap* pcap, void* data, UINT32 length) @@ -105,7 +105,7 @@ BOOL pcap_add_record(rdpPcap* pcap, void* data, UINT32 length) if (pcap->tail == NULL) { - pcap->tail = (pcap_record*) calloc(1, sizeof(pcap_record)); + pcap->tail = (pcap_record*)calloc(1, sizeof(pcap_record)); if (!pcap->tail) return FALSE; @@ -115,7 +115,7 @@ BOOL pcap_add_record(rdpPcap* pcap, void* data, UINT32 length) } else { - record = (pcap_record*) calloc(1, sizeof(pcap_record)); + record = (pcap_record*)calloc(1, sizeof(pcap_record)); if (!record) return FALSE; @@ -163,8 +163,7 @@ BOOL pcap_get_next_record_content(rdpPcap* pcap, pcap_record* record) BOOL pcap_get_next_record(rdpPcap* pcap, pcap_record* record) { - return pcap_has_next_record(pcap) && - pcap_read_record(pcap, record); + return pcap_has_next_record(pcap) && pcap_read_record(pcap, record); } rdpPcap* pcap_open(char* name, BOOL write) @@ -179,7 +178,7 @@ rdpPcap* pcap_open(char* name, BOOL write) return NULL; } - pcap = (rdpPcap*) calloc(1, sizeof(rdpPcap)); + pcap = (rdpPcap*)calloc(1, sizeof(rdpPcap)); if (!pcap) goto fail_close; diff --git a/libfreerdp/utils/profiler.c b/libfreerdp/utils/profiler.c index a240e4d00..acbe3a126 100644 --- a/libfreerdp/utils/profiler.c +++ b/libfreerdp/utils/profiler.c @@ -37,7 +37,7 @@ struct _PROFILER PROFILER* profiler_create(const char* name) { - PROFILER* profiler = (PROFILER*) calloc(1, sizeof(PROFILER)); + PROFILER* profiler = (PROFILER*)calloc(1, sizeof(PROFILER)); if (!profiler) return NULL; @@ -77,20 +77,24 @@ void profiler_exit(PROFILER* profiler) void profiler_print_header(void) { - WLog_INFO(TAG, "-------------------------------+------------+-------------+-----------+-------"); - WLog_INFO(TAG, "PROFILER NAME | COUNT | TOTAL | AVG | IPS"); - WLog_INFO(TAG, "-------------------------------+------------+-------------+-----------+-------"); + WLog_INFO(TAG, + "-------------------------------+------------+-------------+-----------+-------"); + WLog_INFO(TAG, + "PROFILER NAME | COUNT | TOTAL | AVG | IPS"); + WLog_INFO(TAG, + "-------------------------------+------------+-------------+-----------+-------"); } void profiler_print(PROFILER* profiler) { double s = stopwatch_get_elapsed_time_in_seconds(profiler->stopwatch); double avg = profiler->stopwatch->count == 0 ? 0 : s / profiler->stopwatch->count; - WLog_INFO(TAG, "%-30s | %10u | %10.4fs | %8.6fs | %6.0f", - profiler->name, profiler->stopwatch->count, s, avg, profiler->stopwatch->count / s); + WLog_INFO(TAG, "%-30s | %10u | %10.4fs | %8.6fs | %6.0f", profiler->name, + profiler->stopwatch->count, s, avg, profiler->stopwatch->count / s); } void profiler_print_footer(void) { - WLog_INFO(TAG, "-------------------------------+------------+-------------+-----------+-------"); + WLog_INFO(TAG, + "-------------------------------+------------+-------------+-----------+-------"); } diff --git a/libfreerdp/utils/ringbuffer.c b/libfreerdp/utils/ringbuffer.c index 1acc2da1c..5b8b5bb21 100644 --- a/libfreerdp/utils/ringbuffer.c +++ b/libfreerdp/utils/ringbuffer.c @@ -35,7 +35,10 @@ #ifdef WITH_DEBUG_RINGBUFFER #define DEBUG_RINGBUFFER(...) WLog_DBG(TAG, __VA_ARGS__) #else -#define DEBUG_RINGBUFFER(...) do { } while (0) +#define DEBUG_RINGBUFFER(...) \ + do \ + { \ + } while (0) #endif BOOL ringbuffer_init(RingBuffer* rb, size_t initialSize) @@ -47,7 +50,7 @@ BOOL ringbuffer_init(RingBuffer* rb, size_t initialSize) rb->readPtr = rb->writePtr = 0; rb->initialSize = rb->size = rb->freeSize = initialSize; - DEBUG_RINGBUFFER("ringbuffer_init(%p)", (void*) rb); + DEBUG_RINGBUFFER("ringbuffer_init(%p)", (void*)rb); return TRUE; } @@ -63,7 +66,7 @@ size_t ringbuffer_capacity(const RingBuffer* rb) void ringbuffer_destroy(RingBuffer* rb) { - DEBUG_RINGBUFFER("ringbuffer_destroy(%p)", (void*) rb); + DEBUG_RINGBUFFER("ringbuffer_destroy(%p)", (void*)rb); free(rb->buffer); rb->buffer = NULL; } @@ -71,14 +74,14 @@ void ringbuffer_destroy(RingBuffer* rb) static BOOL ringbuffer_realloc(RingBuffer* rb, size_t targetSize) { BYTE* newData; - DEBUG_RINGBUFFER("ringbuffer_realloc(%p): targetSize: %"PRIdz"", (void*) rb, targetSize); + DEBUG_RINGBUFFER("ringbuffer_realloc(%p): targetSize: %" PRIdz "", (void*)rb, targetSize); if (rb->writePtr == rb->readPtr) { /* when no size is used we can realloc() and set the heads at the * beginning of the buffer */ - newData = (BYTE*) realloc(rb->buffer, targetSize); + newData = (BYTE*)realloc(rb->buffer, targetSize); if (!newData) return FALSE; @@ -96,7 +99,7 @@ static BOOL ringbuffer_realloc(RingBuffer* rb, size_t targetSize) * v v * [............|XXXXXXXXXXXXXX|..........] */ - newData = (BYTE*) realloc(rb->buffer, targetSize); + newData = (BYTE*)realloc(rb->buffer, targetSize); if (!newData) return FALSE; @@ -108,7 +111,7 @@ static BOOL ringbuffer_realloc(RingBuffer* rb, size_t targetSize) /* in case of malloc the read head is moved at the beginning of the new buffer * and the write head is set accordingly */ - newData = (BYTE*) malloc(targetSize); + newData = (BYTE*)malloc(targetSize); if (!newData) return FALSE; @@ -159,7 +162,7 @@ BOOL ringbuffer_write(RingBuffer* rb, const BYTE* ptr, size_t sz) { size_t toWrite; size_t remaining; - DEBUG_RINGBUFFER("ringbuffer_write(%p): sz: %"PRIdz"", (void*) rb, sz); + DEBUG_RINGBUFFER("ringbuffer_write(%p): sz: %" PRIdz "", (void*)rb, sz); if ((rb->freeSize <= sz) && !ringbuffer_realloc(rb, rb->size + sz)) return FALSE; @@ -193,7 +196,7 @@ BOOL ringbuffer_write(RingBuffer* rb, const BYTE* ptr, size_t sz) BYTE* ringbuffer_ensure_linear_write(RingBuffer* rb, size_t sz) { - DEBUG_RINGBUFFER("ringbuffer_ensure_linear_write(%p): sz: %"PRIdz"", (void*) rb, sz); + DEBUG_RINGBUFFER("ringbuffer_ensure_linear_write(%p): sz: %" PRIdz "", (void*)rb, sz); if (rb->freeSize < sz) { @@ -224,7 +227,7 @@ BYTE* ringbuffer_ensure_linear_write(RingBuffer* rb, size_t sz) BOOL ringbuffer_commit_written_bytes(RingBuffer* rb, size_t sz) { - DEBUG_RINGBUFFER("ringbuffer_commit_written_bytes(%p): sz: %"PRIdz"", (void*) rb, sz); + DEBUG_RINGBUFFER("ringbuffer_commit_written_bytes(%p): sz: %" PRIdz "", (void*)rb, sz); if (sz < 1) return TRUE; @@ -243,7 +246,7 @@ int ringbuffer_peek(const RingBuffer* rb, DataChunk chunks[2], size_t sz) size_t toRead; int chunkIndex = 0; int status = 0; - DEBUG_RINGBUFFER("ringbuffer_peek(%p): sz: %"PRIdz"", (void*) rb, sz); + DEBUG_RINGBUFFER("ringbuffer_peek(%p): sz: %" PRIdz "", (void*)rb, sz); if (sz < 1) return 0; @@ -277,7 +280,7 @@ int ringbuffer_peek(const RingBuffer* rb, DataChunk chunks[2], size_t sz) void ringbuffer_commit_read_bytes(RingBuffer* rb, size_t sz) { - DEBUG_RINGBUFFER("ringbuffer_commit_read_bytes(%p): sz: %"PRIdz"", (void*) rb, sz); + DEBUG_RINGBUFFER("ringbuffer_commit_read_bytes(%p): sz: %" PRIdz "", (void*)rb, sz); if (sz < 1) return; @@ -287,7 +290,6 @@ void ringbuffer_commit_read_bytes(RingBuffer* rb, size_t sz) rb->freeSize += sz; /* when we reach a reasonable free size, we can go back to the original size */ - if ((rb->size != rb->initialSize) - && (ringbuffer_used(rb) < rb->initialSize / 2)) + if ((rb->size != rb->initialSize) && (ringbuffer_used(rb) < rb->initialSize / 2)) ringbuffer_realloc(rb, rb->initialSize); } diff --git a/libfreerdp/utils/signal.c b/libfreerdp/utils/signal.c index a3d832415..6ac039530 100644 --- a/libfreerdp/utils/signal.c +++ b/libfreerdp/utils/signal.c @@ -67,41 +67,23 @@ static void fatal_handler(int signum) raise(signum); } -const int fatal_signals[] = -{ - SIGABRT, - SIGALRM, - SIGBUS, - SIGFPE, - SIGHUP, - SIGILL, - SIGINT, - SIGKILL, - SIGQUIT, - SIGSEGV, - SIGSTOP, - SIGTERM, - SIGTSTP, - SIGTTIN, - SIGTTOU, - SIGUSR1, - SIGUSR2, +const int fatal_signals[] = { SIGABRT, SIGALRM, SIGBUS, SIGFPE, SIGHUP, SIGILL, + SIGINT, SIGKILL, SIGQUIT, SIGSEGV, SIGSTOP, SIGTERM, + SIGTSTP, SIGTTIN, SIGTTOU, SIGUSR1, SIGUSR2, #ifdef SIGPOLL - SIGPOLL, + SIGPOLL, #endif #ifdef SIGPROF - SIGPROF, + SIGPROF, #endif #ifdef SIGSYS - SIGSYS, + SIGSYS, #endif - SIGTRAP, + SIGTRAP, #ifdef SIGVTALRM - SIGVTALRM, + SIGVTALRM, #endif - SIGXCPU, - SIGXFSZ -}; + SIGXCPU, SIGXFSZ }; int freerdp_handle_signals(void) { @@ -114,7 +96,7 @@ int freerdp_handle_signals(void) sigdelset(&(fatal_sigaction.sa_mask), SIGCONT); pthread_sigmask(SIG_BLOCK, &(fatal_sigaction.sa_mask), &orig_set); fatal_sigaction.sa_handler = fatal_handler; - fatal_sigaction.sa_flags = 0; + fatal_sigaction.sa_flags = 0; for (signal_index = 0; signal_index < ARRAYSIZE(fatal_signals); signal_index++) { diff --git a/libfreerdp/utils/stopwatch.c b/libfreerdp/utils/stopwatch.c index 4026dd812..672c408f3 100644 --- a/libfreerdp/utils/stopwatch.c +++ b/libfreerdp/utils/stopwatch.c @@ -49,12 +49,13 @@ STOPWATCH* stopwatch_create() { STOPWATCH* sw; #ifdef _WIN32 - if (stopwatch_freq.QuadPart == 0) { + if (stopwatch_freq.QuadPart == 0) + { QueryPerformanceFrequency(&stopwatch_freq); } #endif - sw = (STOPWATCH*) malloc(sizeof(STOPWATCH)); + sw = (STOPWATCH*)malloc(sizeof(STOPWATCH)); if (!sw) return NULL; stopwatch_reset(sw); @@ -89,12 +90,11 @@ void stopwatch_reset(STOPWATCH* stopwatch) double stopwatch_get_elapsed_time_in_seconds(STOPWATCH* stopwatch) { - return (stopwatch->elapsed/1000000.0); + return (stopwatch->elapsed / 1000000.0); } void stopwatch_get_elapsed_time_in_useconds(STOPWATCH* stopwatch, UINT32* sec, UINT32* usec) { - *sec = (UINT32) stopwatch->elapsed / 1000000; - *usec = (UINT32) stopwatch->elapsed % 1000000; + *sec = (UINT32)stopwatch->elapsed / 1000000; + *usec = (UINT32)stopwatch->elapsed % 1000000; } - diff --git a/libfreerdp/utils/test/TestRingBuffer.c b/libfreerdp/utils/test/TestRingBuffer.c index 857846d07..e3491e5ec 100644 --- a/libfreerdp/utils/test/TestRingBuffer.c +++ b/libfreerdp/utils/test/TestRingBuffer.c @@ -80,14 +80,13 @@ error: return FALSE; } - int TestRingBuffer(int argc, char* argv[]) { RingBuffer ringBuffer; int testNo = 0; - BYTE *tmpBuf; - BYTE *rb_ptr; - int i/*, chunkNb, counter*/; + BYTE* tmpBuf; + BYTE* rb_ptr; + int i /*, chunkNb, counter*/; DataChunk chunks[2]; if (!ringbuffer_init(&ringBuffer, 10)) @@ -96,7 +95,7 @@ int TestRingBuffer(int argc, char* argv[]) return -1; } - tmpBuf = (BYTE *)malloc(50); + tmpBuf = (BYTE*)malloc(50); if (!tmpBuf) return -1; @@ -105,7 +104,7 @@ int TestRingBuffer(int argc, char* argv[]) fprintf(stderr, "%d: basic tests...", ++testNo); if (!ringbuffer_write(&ringBuffer, tmpBuf, 5) || !ringbuffer_write(&ringBuffer, tmpBuf, 5) || - !ringbuffer_write(&ringBuffer, tmpBuf, 5)) + !ringbuffer_write(&ringBuffer, tmpBuf, 5)) { fprintf(stderr, "error when writing bytes\n"); return -1; @@ -113,7 +112,8 @@ int TestRingBuffer(int argc, char* argv[]) if (ringbuffer_used(&ringBuffer) != 15) { - fprintf(stderr, "invalid used size got %"PRIuz" when I would expect 15\n", ringbuffer_used(&ringBuffer)); + fprintf(stderr, "invalid used size got %" PRIuz " when I would expect 15\n", + ringbuffer_used(&ringBuffer)); return -1; } @@ -125,26 +125,27 @@ int TestRingBuffer(int argc, char* argv[]) ringbuffer_commit_read_bytes(&ringBuffer, chunks[0].size); /* check retrieved bytes */ - for (i = 0; i < (int) chunks[0].size; i++) + for (i = 0; i < (int)chunks[0].size; i++) { if (chunks[0].data[i] != i % 5) { - fprintf(stderr, "invalid byte at %d, got %"PRIu8" instead of %d\n", i, chunks[0].data[i], i % 5); + fprintf(stderr, "invalid byte at %d, got %" PRIu8 " instead of %d\n", i, + chunks[0].data[i], i % 5); return -1; } } if (ringbuffer_used(&ringBuffer) != 5) { - fprintf(stderr, "invalid used size after read got %"PRIuz" when I would expect 5\n", ringbuffer_used(&ringBuffer)); + fprintf(stderr, "invalid used size after read got %" PRIuz " when I would expect 5\n", + ringbuffer_used(&ringBuffer)); return -1; } /* write some more bytes to have writePtr < readPtr and data splitted in 2 chunks */ if (!ringbuffer_write(&ringBuffer, tmpBuf, 6) || - ringbuffer_peek(&ringBuffer, chunks, 11) != 2 || - chunks[0].size != 10 || - chunks[1].size != 1) + ringbuffer_peek(&ringBuffer, chunks, 11) != 2 || chunks[0].size != 10 || + chunks[1].size != 1) { fprintf(stderr, "invalid read of splitted data\n"); return -1; @@ -179,7 +180,7 @@ int TestRingBuffer(int argc, char* argv[]) return -1; } - //ringbuffer_commit_read_bytes(&ringBuffer, 25); + // ringbuffer_commit_read_bytes(&ringBuffer, 25); } for (i = 0; i < 1000; i++) @@ -188,15 +189,14 @@ int TestRingBuffer(int argc, char* argv[]) for (i = 0; i < 1000; i++) ringbuffer_commit_read_bytes(&ringBuffer, 25); - if (ringbuffer_capacity(&ringBuffer) != 10) { - fprintf(stderr, "not the expected capacity, have %"PRIuz" and expects 10\n", ringbuffer_capacity(&ringBuffer)); + fprintf(stderr, "not the expected capacity, have %" PRIuz " and expects 10\n", + ringbuffer_capacity(&ringBuffer)); return -1; } fprintf(stderr, "ok\n"); - fprintf(stderr, "%d: free size is correctly computed...", ++testNo); for (i = 0; i < 1000; i++) { @@ -224,4 +224,3 @@ int TestRingBuffer(int argc, char* argv[]) free(tmpBuf); return 0; } - diff --git a/rdtk/include/rdtk/api.h b/rdtk/include/rdtk/api.h index ef8b01382..d28493a04 100644 --- a/rdtk/include/rdtk/api.h +++ b/rdtk/include/rdtk/api.h @@ -24,25 +24,25 @@ /* Don't do any export */ #if 0 #if defined _WIN32 || defined __CYGWIN__ - #ifdef RDTK_EXPORTS - #ifdef __GNUC__ - #define RDTK_EXPORT __attribute__((dllexport)) - #else - #define RDTK_EXPORT __declspec(dllexport) - #endif - #else - #ifdef __GNUC__ - #define RDTK_EXPORT __attribute__((dllimport)) - #else - #define RDTK_EXPORT __declspec(dllimport) - #endif - #endif +#ifdef RDTK_EXPORTS +#ifdef __GNUC__ +#define RDTK_EXPORT __attribute__((dllexport)) #else - #if __GNUC__ >= 4 - #define RDTK_EXPORT __attribute__ ((visibility("default"))) - #else - #define RDTK_EXPORT - #endif +#define RDTK_EXPORT __declspec(dllexport) +#endif +#else +#ifdef __GNUC__ +#define RDTK_EXPORT __attribute__((dllimport)) +#else +#define RDTK_EXPORT __declspec(dllimport) +#endif +#endif +#else +#if __GNUC__ >= 4 +#define RDTK_EXPORT __attribute__((visibility("default"))) +#else +#define RDTK_EXPORT +#endif #endif #endif #define RDTK_EXPORT diff --git a/rdtk/include/rdtk/rdtk.h b/rdtk/include/rdtk/rdtk.h index dff5139f8..f71503908 100644 --- a/rdtk/include/rdtk/rdtk.h +++ b/rdtk/include/rdtk/rdtk.h @@ -37,43 +37,47 @@ typedef struct rdtk_text_field rdtkTextField; typedef struct rdtk_nine_patch rdtkNinePatch; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Engine */ + /* Engine */ -RDTK_EXPORT rdtkEngine* rdtk_engine_new(); -RDTK_EXPORT void rdtk_engine_free(rdtkEngine* engine); + RDTK_EXPORT rdtkEngine* rdtk_engine_new(); + RDTK_EXPORT void rdtk_engine_free(rdtkEngine* engine); -/* Surface */ + /* Surface */ -RDTK_EXPORT int rdtk_surface_fill(rdtkSurface* surface, int x, int y, int width, int height, UINT32 color); + RDTK_EXPORT int rdtk_surface_fill(rdtkSurface* surface, int x, int y, int width, int height, + UINT32 color); -RDTK_EXPORT rdtkSurface* rdtk_surface_new(rdtkEngine* engine, BYTE* data, int width, int height, int scanline); -RDTK_EXPORT void rdtk_surface_free(rdtkSurface* surface); + RDTK_EXPORT rdtkSurface* rdtk_surface_new(rdtkEngine* engine, BYTE* data, int width, int height, + int scanline); + RDTK_EXPORT void rdtk_surface_free(rdtkSurface* surface); -/* Font */ + /* Font */ -RDTK_EXPORT int rdtk_font_draw_text(rdtkSurface* surface, int nXDst, int nYDst, rdtkFont* font, const char* text); + RDTK_EXPORT int rdtk_font_draw_text(rdtkSurface* surface, int nXDst, int nYDst, rdtkFont* font, + const char* text); -/* Button */ + /* Button */ -RDTK_EXPORT int rdtk_button_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, int nHeight, - rdtkButton* button, const char* text); + RDTK_EXPORT int rdtk_button_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, + int nHeight, rdtkButton* button, const char* text); -/* Label */ + /* Label */ -RDTK_EXPORT int rdtk_label_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, int nHeight, - rdtkLabel* label, const char* text, int hAlign, int vAlign); + RDTK_EXPORT int rdtk_label_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, + int nHeight, rdtkLabel* label, const char* text, int hAlign, + int vAlign); -/* TextField */ + /* TextField */ -RDTK_EXPORT int rdtk_text_field_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, int nHeight, - rdtkTextField* textField, const char* text); + RDTK_EXPORT int rdtk_text_field_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, + int nHeight, rdtkTextField* textField, const char* text); #ifdef __cplusplus } #endif #endif /* RDTK_H */ - diff --git a/rdtk/librdtk/rdtk_button.c b/rdtk/librdtk/rdtk_button.c index 88993786a..c0427d18a 100644 --- a/rdtk/librdtk/rdtk_button.c +++ b/rdtk/librdtk/rdtk_button.c @@ -25,7 +25,7 @@ #include "rdtk_button.h" int rdtk_button_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, int nHeight, - rdtkButton* button, const char* text) + rdtkButton* button, const char* text) { int offsetX; int offsetY; @@ -74,7 +74,7 @@ rdtkButton* rdtk_button_new(rdtkEngine* engine, rdtkNinePatch* ninePatch) { rdtkButton* button; - button = (rdtkButton*) calloc(1, sizeof(rdtkButton)); + button = (rdtkButton*)calloc(1, sizeof(rdtkButton)); if (!button) return NULL; @@ -110,4 +110,3 @@ int rdtk_button_engine_uninit(rdtkEngine* engine) return 1; } - diff --git a/rdtk/librdtk/rdtk_button.h b/rdtk/librdtk/rdtk_button.h index 7d79ac707..691295943 100644 --- a/rdtk/librdtk/rdtk_button.h +++ b/rdtk/librdtk/rdtk_button.h @@ -33,18 +33,18 @@ struct rdtk_button }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -int rdtk_button_engine_init(rdtkEngine* engine); -int rdtk_button_engine_uninit(rdtkEngine* engine); + int rdtk_button_engine_init(rdtkEngine* engine); + int rdtk_button_engine_uninit(rdtkEngine* engine); -rdtkButton* rdtk_button_new(rdtkEngine* engine, rdtkNinePatch* ninePatch); -void rdtk_button_free(rdtkButton* button); + rdtkButton* rdtk_button_new(rdtkEngine* engine, rdtkNinePatch* ninePatch); + void rdtk_button_free(rdtkButton* button); #ifdef __cplusplus } #endif #endif /* RDTK_BUTTON_PRIVATE_H */ - diff --git a/rdtk/librdtk/rdtk_engine.c b/rdtk/librdtk/rdtk_engine.c index 5bbfdd8a0..5c20e3f5b 100644 --- a/rdtk/librdtk/rdtk_engine.c +++ b/rdtk/librdtk/rdtk_engine.c @@ -31,7 +31,7 @@ rdtkEngine* rdtk_engine_new() { rdtkEngine* engine; - engine = (rdtkEngine*) calloc(1, sizeof(rdtkEngine)); + engine = (rdtkEngine*)calloc(1, sizeof(rdtkEngine)); if (!engine) return NULL; diff --git a/rdtk/librdtk/rdtk_engine.h b/rdtk/librdtk/rdtk_engine.h index c81587282..7e3aed063 100644 --- a/rdtk/librdtk/rdtk_engine.h +++ b/rdtk/librdtk/rdtk_engine.h @@ -35,14 +35,12 @@ struct rdtk_engine }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif - - #ifdef __cplusplus } #endif #endif /* RDTK_ENGINE_PRIVATE_H */ - diff --git a/rdtk/librdtk/rdtk_font.c b/rdtk/librdtk/rdtk_font.c index 4564d46e3..32325fa5f 100644 --- a/rdtk/librdtk/rdtk_font.c +++ b/rdtk/librdtk/rdtk_font.c @@ -169,7 +169,7 @@ static char* rdtk_font_load_descriptor_file(const char* filename, int* pSize) return NULL; } - buffer = (BYTE*) malloc(fileSize + 2); + buffer = (BYTE*)malloc(fileSize + 2); if (!buffer) { @@ -195,14 +195,14 @@ static char* rdtk_font_load_descriptor_file(const char* filename, int* pSize) buffer[fileSize] = '\0'; buffer[fileSize + 1] = '\0'; - *pSize = (int) fileSize; - return (char*) buffer; + *pSize = (int)fileSize; + return (char*)buffer; } static int rdtk_font_convert_descriptor_code_to_utf8(const char* str, BYTE* utf8) { size_t len = strlen(str); - *((UINT32*) utf8) = 0; + *((UINT32*)utf8) = 0; if (len < 1) return 1; @@ -245,7 +245,7 @@ static int rdtk_font_parse_descriptor_buffer(rdtkFont* font, BYTE* buffer, int s int index; int count; rdtkGlyph* glyph; - p = strstr((char*) buffer, ""); + p = strstr((char*)buffer, ""); if (!p) return -1; @@ -359,7 +359,7 @@ static int rdtk_font_parse_descriptor_buffer(rdtkFont* font, BYTE* buffer, int s return -1; p = q + 1; - //printf("size: %d family: %s height: %d style: %s\n", + // printf("size: %d family: %s height: %d style: %s\n", // font->size, font->family, font->height, font->style); beg = p; count = 0; @@ -387,7 +387,7 @@ static int rdtk_font_parse_descriptor_buffer(rdtkFont* font, BYTE* buffer, int s font->glyphs = NULL; if (count > 0) - font->glyphs = (rdtkGlyph*) calloc(font->glyphCount, sizeof(rdtkGlyph)); + font->glyphs = (rdtkGlyph*)calloc(font->glyphCount, sizeof(rdtkGlyph)); if (!font->glyphs) return -1; @@ -582,7 +582,7 @@ static int rdtk_font_load_descriptor(rdtkFont* font, const char* filename) if (!buffer) return -1; - return rdtk_font_parse_descriptor_buffer(font, (BYTE*) buffer, size); + return rdtk_font_parse_descriptor_buffer(font, (BYTE*)buffer, size); } rdtkFont* rdtk_font_new(rdtkEngine* engine, const char* path, const char* file) { @@ -598,13 +598,13 @@ rdtkFont* rdtk_font_new(rdtkEngine* engine, const char* path, const char* file) goto cleanup; length = strlen(fontBaseFile); - fontImageFile = (char*) malloc(length + 8); + fontImageFile = (char*)malloc(length + 8); if (!fontImageFile) goto cleanup; sprintf_s(fontImageFile, length + 8, "%s.png", fontBaseFile); - fontDescriptorFile = (char*) malloc(length + 8); + fontDescriptorFile = (char*)malloc(length + 8); if (!fontDescriptorFile) goto cleanup; @@ -617,7 +617,7 @@ rdtkFont* rdtk_font_new(rdtkEngine* engine, const char* path, const char* file) if (!PathFileExistsA(fontDescriptorFile)) goto cleanup; - font = (rdtkFont*) calloc(1, sizeof(rdtkFont)); + font = (rdtkFont*)calloc(1, sizeof(rdtkFont)); if (!font) goto cleanup; @@ -664,7 +664,7 @@ static rdtkFont* rdtk_embedded_font_new(rdtkEngine* engine, BYTE* imageData, int int status; BYTE* buffer; rdtkFont* font; - font = (rdtkFont*) calloc(1, sizeof(rdtkFont)); + font = (rdtkFont*)calloc(1, sizeof(rdtkFont)); if (!font) return NULL; @@ -688,7 +688,7 @@ static rdtkFont* rdtk_embedded_font_new(rdtkEngine* engine, BYTE* imageData, int } size = descriptorSize; - buffer = (BYTE*) malloc(size); + buffer = (BYTE*)malloc(size); if (!buffer) { @@ -730,13 +730,14 @@ int rdtk_font_engine_init(rdtkEngine* engine) BYTE* imageData = NULL; BYTE* descriptorData = NULL; imageSize = rdtk_get_embedded_resource_file("source_serif_pro_regular_12.png", &imageData); - descriptorSize = rdtk_get_embedded_resource_file("source_serif_pro_regular_12.xml", - &descriptorData); + descriptorSize = + rdtk_get_embedded_resource_file("source_serif_pro_regular_12.xml", &descriptorData); if ((imageSize < 0) || (descriptorSize < 0)) return -1; - engine->font = rdtk_embedded_font_new(engine, imageData, imageSize, descriptorData, descriptorSize); + engine->font = + rdtk_embedded_font_new(engine, imageData, imageSize, descriptorData, descriptorSize); } return 1; diff --git a/rdtk/librdtk/rdtk_font.h b/rdtk/librdtk/rdtk_font.h index 8f3b984d0..49d776992 100644 --- a/rdtk/librdtk/rdtk_font.h +++ b/rdtk/librdtk/rdtk_font.h @@ -53,20 +53,20 @@ struct rdtk_font }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -int rdtk_font_text_draw_size(rdtkFont* font, int* width, int* height, const char* text); + int rdtk_font_text_draw_size(rdtkFont* font, int* width, int* height, const char* text); -int rdtk_font_engine_init(rdtkEngine* engine); -int rdtk_font_engine_uninit(rdtkEngine* engine); + int rdtk_font_engine_init(rdtkEngine* engine); + int rdtk_font_engine_uninit(rdtkEngine* engine); -rdtkFont* rdtk_font_new(rdtkEngine* engine, const char* path, const char* file); -void rdtk_font_free(rdtkFont* font); + rdtkFont* rdtk_font_new(rdtkEngine* engine, const char* path, const char* file); + void rdtk_font_free(rdtkFont* font); #ifdef __cplusplus } #endif #endif /* RDTK_FONT_PRIVATE_H */ - diff --git a/rdtk/librdtk/rdtk_label.c b/rdtk/librdtk/rdtk_label.c index feb7c6b62..14aa73941 100644 --- a/rdtk/librdtk/rdtk_label.c +++ b/rdtk/librdtk/rdtk_label.c @@ -25,7 +25,7 @@ #include "rdtk_label.h" int rdtk_label_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, int nHeight, - rdtkLabel* label, const char* text, int hAlign, int vAlign) + rdtkLabel* label, const char* text, int hAlign, int vAlign) { int offsetX; int offsetY; @@ -60,7 +60,7 @@ rdtkLabel* rdtk_label_new(rdtkEngine* engine) { rdtkLabel* label; - label = (rdtkLabel*) calloc(1, sizeof(rdtkLabel)); + label = (rdtkLabel*)calloc(1, sizeof(rdtkLabel)); if (!label) return NULL; diff --git a/rdtk/librdtk/rdtk_label.h b/rdtk/librdtk/rdtk_label.h index a0f2a603a..eefe67aec 100644 --- a/rdtk/librdtk/rdtk_label.h +++ b/rdtk/librdtk/rdtk_label.h @@ -31,18 +31,18 @@ struct rdtk_label }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -int rdtk_label_engine_init(rdtkEngine* engine); -int rdtk_label_engine_uninit(rdtkEngine* engine); + int rdtk_label_engine_init(rdtkEngine* engine); + int rdtk_label_engine_uninit(rdtkEngine* engine); -rdtkLabel* rdtk_label_new(rdtkEngine* engine); -void rdtk_label_free(rdtkLabel* label); + rdtkLabel* rdtk_label_new(rdtkEngine* engine); + void rdtk_label_free(rdtkLabel* label); #ifdef __cplusplus } #endif #endif /* RDTK_LABEL_PRIVATE_H */ - diff --git a/rdtk/librdtk/rdtk_nine_patch.c b/rdtk/librdtk/rdtk_nine_patch.c index c6532e044..35a97973b 100644 --- a/rdtk/librdtk/rdtk_nine_patch.c +++ b/rdtk/librdtk/rdtk_nine_patch.c @@ -26,8 +26,8 @@ #include "rdtk_nine_patch.h" -int rdtk_image_copy_alpha_blend(BYTE* pDstData, int nDstStep, int nXDst, int nYDst, - int nWidth, int nHeight, BYTE* pSrcData, int nSrcStep, int nXSrc, int nYSrc) +int rdtk_image_copy_alpha_blend(BYTE* pDstData, int nDstStep, int nXDst, int nYDst, int nWidth, + int nHeight, BYTE* pSrcData, int nSrcStep, int nXSrc, int nYSrc) { int x, y; BYTE A, R, G, B; @@ -102,8 +102,8 @@ int rdtk_nine_patch_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, nYSrc = 0; width = ninePatch->scaleLeft; height = ninePatch->scaleTop; - rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, - width, height, pSrcData, nSrcStep, nXSrc, nYSrc); + rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, width, height, pSrcData, + nSrcStep, nXSrc, nYSrc); x += width; /* top middle (scalable) */ nXSrc = ninePatch->scaleLeft; @@ -117,8 +117,8 @@ int rdtk_nine_patch_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, if (width > ninePatch->scaleWidth) width = ninePatch->scaleWidth; - rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, - width, height, pSrcData, nSrcStep, nXSrc, nYSrc); + rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, width, height, + pSrcData, nSrcStep, nXSrc, nYSrc); x += width; } @@ -127,8 +127,8 @@ int rdtk_nine_patch_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, nYSrc = 0; width = ninePatch->width - ninePatch->scaleRight; height = ninePatch->scaleTop; - rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, - width, height, pSrcData, nSrcStep, nXSrc, nYSrc); + rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, width, height, pSrcData, + nSrcStep, nXSrc, nYSrc); /* middle */ x = 0; y = ninePatch->scaleTop; @@ -137,8 +137,8 @@ int rdtk_nine_patch_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, nYSrc = ninePatch->scaleTop; width = ninePatch->scaleLeft; height = ninePatch->scaleHeight; - rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, - width, height, pSrcData, nSrcStep, nXSrc, nYSrc); + rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, width, height, pSrcData, + nSrcStep, nXSrc, nYSrc); x += width; /* middle (scalable) */ nXSrc = ninePatch->scaleLeft; @@ -152,8 +152,8 @@ int rdtk_nine_patch_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, if (width > ninePatch->scaleWidth) width = ninePatch->scaleWidth; - rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, - width, height, pSrcData, nSrcStep, nXSrc, nYSrc); + rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, width, height, + pSrcData, nSrcStep, nXSrc, nYSrc); x += width; } @@ -162,8 +162,8 @@ int rdtk_nine_patch_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, nYSrc = ninePatch->scaleTop; width = ninePatch->width - ninePatch->scaleRight; height = ninePatch->scaleHeight; - rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, - width, height, pSrcData, nSrcStep, nXSrc, nYSrc); + rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, width, height, pSrcData, + nSrcStep, nXSrc, nYSrc); /* bottom */ x = 0; y = ninePatch->scaleBottom; @@ -172,8 +172,8 @@ int rdtk_nine_patch_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, nYSrc = ninePatch->scaleBottom; width = ninePatch->scaleLeft; height = ninePatch->height - ninePatch->scaleBottom; - rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, - width, height, pSrcData, nSrcStep, nXSrc, nYSrc); + rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, width, height, pSrcData, + nSrcStep, nXSrc, nYSrc); x += width; /* bottom middle (scalable) */ nXSrc = ninePatch->scaleLeft; @@ -187,8 +187,8 @@ int rdtk_nine_patch_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, if (width > ninePatch->scaleWidth) width = ninePatch->scaleWidth; - rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, - width, height, pSrcData, nSrcStep, nXSrc, nYSrc); + rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, width, height, + pSrcData, nSrcStep, nXSrc, nYSrc); x += width; } @@ -197,8 +197,8 @@ int rdtk_nine_patch_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, nYSrc = ninePatch->scaleBottom; width = ninePatch->width - ninePatch->scaleRight; height = ninePatch->height - ninePatch->scaleBottom; - rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, - width, height, pSrcData, nSrcStep, nXSrc, nYSrc); + rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, width, height, pSrcData, + nSrcStep, nXSrc, nYSrc); return 1; } @@ -217,7 +217,7 @@ int rdtk_nine_patch_set_image(rdtkNinePatch* ninePatch, wImage* image) data = image->data; /* parse scalable area */ beg = end = -1; - pixel = (UINT32*) &data[4]; /* (1, 0) */ + pixel = (UINT32*)&data[4]; /* (1, 0) */ for (x = 1; x < width - 1; x++) { @@ -244,7 +244,7 @@ int rdtk_nine_patch_set_image(rdtkNinePatch* ninePatch, wImage* image) ninePatch->scaleRight = end - 1; ninePatch->scaleWidth = ninePatch->scaleRight - ninePatch->scaleLeft; beg = end = -1; - pixel = (UINT32*) &data[scanline]; /* (0, 1) */ + pixel = (UINT32*)&data[scanline]; /* (0, 1) */ for (y = 1; y < height - 1; y++) { @@ -264,7 +264,7 @@ int rdtk_nine_patch_set_image(rdtkNinePatch* ninePatch, wImage* image) } } - pixel = (UINT32*) & ((BYTE*) pixel)[scanline]; + pixel = (UINT32*)&((BYTE*)pixel)[scanline]; } ninePatch->scaleTop = beg - 1; @@ -272,7 +272,7 @@ int rdtk_nine_patch_set_image(rdtkNinePatch* ninePatch, wImage* image) ninePatch->scaleHeight = ninePatch->scaleBottom - ninePatch->scaleTop; /* parse fillable area */ beg = end = -1; - pixel = (UINT32*) &data[((height - 1) * scanline) + 4]; /* (1, height - 1) */ + pixel = (UINT32*)&data[((height - 1) * scanline) + 4]; /* (1, height - 1) */ for (x = 1; x < width - 1; x++) { @@ -299,7 +299,7 @@ int rdtk_nine_patch_set_image(rdtkNinePatch* ninePatch, wImage* image) ninePatch->fillRight = end - 1; ninePatch->fillWidth = ninePatch->fillRight - ninePatch->fillLeft; beg = end = -1; - pixel = (UINT32*) &data[((width - 1) * 4) + scanline]; /* (width - 1, 1) */ + pixel = (UINT32*)&data[((width - 1) * 4) + scanline]; /* (width - 1, 1) */ for (y = 1; y < height - 1; y++) { @@ -319,7 +319,7 @@ int rdtk_nine_patch_set_image(rdtkNinePatch* ninePatch, wImage* image) } } - pixel = (UINT32*) & ((BYTE*) pixel)[scanline]; + pixel = (UINT32*)&((BYTE*)pixel)[scanline]; } ninePatch->fillTop = beg - 1; @@ -345,7 +345,7 @@ int rdtk_nine_patch_set_image(rdtkNinePatch* ninePatch, wImage* image) rdtkNinePatch* rdtk_nine_patch_new(rdtkEngine* engine) { rdtkNinePatch* ninePatch; - ninePatch = (rdtkNinePatch*) calloc(1, sizeof(rdtkNinePatch)); + ninePatch = (rdtkNinePatch*)calloc(1, sizeof(rdtkNinePatch)); if (!ninePatch) return NULL; diff --git a/rdtk/librdtk/rdtk_nine_patch.h b/rdtk/librdtk/rdtk_nine_patch.h index 157a68758..0e2d549da 100644 --- a/rdtk/librdtk/rdtk_nine_patch.h +++ b/rdtk/librdtk/rdtk_nine_patch.h @@ -54,21 +54,22 @@ struct rdtk_nine_patch }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -int rdtk_nine_patch_set_image(rdtkNinePatch* ninePatch, wImage* image); -int rdtk_nine_patch_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, int nHeight, rdtkNinePatch* ninePatch); + int rdtk_nine_patch_set_image(rdtkNinePatch* ninePatch, wImage* image); + int rdtk_nine_patch_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, int nHeight, + rdtkNinePatch* ninePatch); -int rdtk_nine_patch_engine_init(rdtkEngine* engine); -int rdtk_nine_patch_engine_uninit(rdtkEngine* engine); + int rdtk_nine_patch_engine_init(rdtkEngine* engine); + int rdtk_nine_patch_engine_uninit(rdtkEngine* engine); -rdtkNinePatch* rdtk_nine_patch_new(rdtkEngine* engine); -void rdtk_nine_patch_free(rdtkNinePatch* ninePatch); + rdtkNinePatch* rdtk_nine_patch_new(rdtkEngine* engine); + void rdtk_nine_patch_free(rdtkNinePatch* ninePatch); #ifdef __cplusplus } #endif #endif /* RDTK_NINE_PATCH_PRIVATE_H */ - diff --git a/rdtk/librdtk/rdtk_resources.c b/rdtk/librdtk/rdtk_resources.c index ccae746a7..17a16763d 100644 --- a/rdtk/librdtk/rdtk_resources.c +++ b/rdtk/librdtk/rdtk_resources.c @@ -25,1288 +25,972 @@ /* Nine Patches */ static BYTE btn_default_normal_9_png[] = { - 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, - 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x32, - 0x08, 0x06, 0x00, 0x00, 0x00, 0x42, 0xb5, 0xcb, 0x95, 0x00, 0x00, 0x00, - 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x89, 0x00, 0x00, 0x0b, - 0x89, 0x01, 0x37, 0xc9, 0xcb, 0xad, 0x00, 0x00, 0x02, 0x5d, 0x49, 0x44, - 0x41, 0x54, 0x58, 0x85, 0xed, 0x58, 0x41, 0xae, 0xd3, 0x40, 0x0c, 0x7d, - 0x9e, 0x52, 0x84, 0x10, 0x69, 0xd5, 0x05, 0x57, 0xe8, 0x8e, 0x4d, 0x51, - 0x57, 0xdc, 0x80, 0x43, 0xf4, 0x08, 0x1c, 0xaa, 0x87, 0xe0, 0x02, 0x88, - 0x13, 0xb0, 0xeb, 0x0d, 0x10, 0x8b, 0x4a, 0x5f, 0x15, 0x42, 0xe4, 0x63, - 0xb3, 0xa0, 0x53, 0x39, 0x8e, 0x3d, 0x33, 0x49, 0xbf, 0xf4, 0x37, 0x58, - 0x8a, 0x32, 0x3f, 0x99, 0xf1, 0xf3, 0x1b, 0x3f, 0x7b, 0xd2, 0x4f, 0x22, - 0x02, 0x22, 0x82, 0x63, 0xe2, 0x3d, 0x6c, 0xb0, 0x91, 0x33, 0x91, 0xb9, - 0xae, 0x9e, 0x02, 0x1d, 0xc0, 0xeb, 0xe3, 0xf1, 0xf8, 0x71, 0xbb, 0xdd, - 0x7e, 0x00, 0x40, 0x44, 0x74, 0x63, 0x6c, 0x99, 0xe7, 0x48, 0x45, 0x24, - 0x8f, 0xe5, 0x74, 0x3a, 0x7d, 0x3d, 0x1c, 0x0e, 0x9f, 0x01, 0xfc, 0xd4, - 0x73, 0x5f, 0x38, 0x40, 0xdd, 0x7e, 0xbf, 0xff, 0xb4, 0xd9, 0x6c, 0x76, - 0x44, 0x84, 0x94, 0x52, 0x13, 0x10, 0x33, 0x43, 0x44, 0xb0, 0x5e, 0xaf, - 0xdf, 0x03, 0xf8, 0xd2, 0x02, 0xb4, 0xea, 0xba, 0x6e, 0xd7, 0xf7, 0xbd, - 0xa4, 0x94, 0x6e, 0x40, 0x16, 0xcc, 0xb2, 0x61, 0x66, 0x30, 0x33, 0xba, - 0xae, 0xdb, 0x01, 0x58, 0x01, 0xf8, 0xae, 0x9d, 0x26, 0x8c, 0x93, 0xbe, - 0x64, 0xe6, 0x41, 0xd4, 0x3a, 0x99, 0xb5, 0xbf, 0xaf, 0x6b, 0x97, 0x36, - 0x7a, 0x8f, 0xd1, 0x20, 0xda, 0xcc, 0x42, 0x8f, 0xf5, 0x3b, 0x0d, 0x66, - 0x41, 0x2d, 0x23, 0x6b, 0xe4, 0x2d, 0x72, 0x12, 0x1f, 0x82, 0xc1, 0x11, - 0x99, 0x07, 0x14, 0x32, 0x9c, 0xfa, 0x4e, 0x4f, 0xf3, 0xb6, 0x6e, 0x10, - 0x4d, 0x0d, 0x24, 0xd8, 0xae, 0x36, 0x46, 0x59, 0xaa, 0xf9, 0x1e, 0x6d, - 0x65, 0x74, 0x79, 0xe6, 0x32, 0xca, 0x0b, 0xb4, 0x08, 0x22, 0x86, 0x01, - 0xd0, 0x88, 0x91, 0xab, 0x3a, 0xed, 0x00, 0x88, 0x55, 0x67, 0x05, 0x32, - 0x8b, 0x91, 0x8e, 0x9e, 0x99, 0x5d, 0x59, 0xe7, 0x77, 0x16, 0xcc, 0x63, - 0x54, 0x55, 0x5d, 0x8b, 0xe2, 0x5a, 0x94, 0x57, 0xcc, 0x11, 0x00, 0xa4, - 0x94, 0x06, 0x0e, 0x4b, 0x2d, 0x68, 0x32, 0xa3, 0x28, 0xe1, 0x76, 0x6c, - 0xe7, 0x96, 0x98, 0x85, 0x75, 0xa4, 0x23, 0xd5, 0x2c, 0x22, 0x46, 0x26, - 0x80, 0x76, 0xd5, 0x45, 0x36, 0xf7, 0xb4, 0x2c, 0x32, 0xca, 0x6c, 0xf4, - 0x65, 0x41, 0xed, 0x75, 0x9d, 0xd3, 0x94, 0x23, 0x8a, 0xa2, 0x8e, 0x1a, - 0x6a, 0x14, 0x6c, 0x8d, 0xd1, 0x28, 0xc1, 0x59, 0x79, 0x5e, 0x7e, 0x74, - 0x00, 0x93, 0x0b, 0x36, 0x2f, 0xce, 0x8e, 0xb5, 0x20, 0xac, 0xd9, 0x43, - 0x32, 0xda, 0xba, 0x62, 0x1d, 0x79, 0x2c, 0x22, 0x33, 0x2c, 0xa7, 0xd5, - 0x51, 0xa9, 0xa1, 0x96, 0xba, 0xb9, 0x67, 0xc5, 0x5e, 0x07, 0x60, 0xa0, - 0xbc, 0x08, 0xbc, 0xa5, 0x8e, 0x5c, 0xd5, 0xd5, 0xa2, 0xaf, 0x3d, 0xf7, - 0x80, 0x8a, 0x05, 0x5b, 0xcb, 0x91, 0xc7, 0x2e, 0x12, 0x8d, 0xbb, 0x75, - 0x5a, 0x49, 0x79, 0xec, 0x39, 0x28, 0xc8, 0xfb, 0xbe, 0x16, 0xd4, 0xc2, - 0x2a, 0xb2, 0xb0, 0x8e, 0x98, 0x19, 0x29, 0xfd, 0x4b, 0xa1, 0x77, 0xa4, - 0x5b, 0xb0, 0x5a, 0x0b, 0x6a, 0xfa, 0x80, 0xb4, 0x7b, 0xaf, 0x81, 0xa3, - 0xe3, 0xc3, 0x5a, 0x73, 0xaf, 0x6b, 0x3d, 0x77, 0x9e, 0xe4, 0x28, 0x8f, - 0x24, 0x7f, 0xf7, 0x51, 0x9e, 0x73, 0x64, 0xc7, 0x36, 0x10, 0xe7, 0x23, - 0x66, 0x7e, 0x1d, 0x79, 0x8d, 0xb5, 0x75, 0x3b, 0x43, 0x46, 0x76, 0x71, - 0xad, 0xb1, 0x3a, 0x42, 0x78, 0xb6, 0x8f, 0xfc, 0xb8, 0xd7, 0x59, 0x47, - 0x25, 0x25, 0x3a, 0xef, 0x2c, 0x23, 0xba, 0xbb, 0x33, 0xb4, 0x5a, 0x53, - 0x1d, 0xcd, 0xd8, 0x3a, 0x57, 0x75, 0xa3, 0x87, 0xcc, 0x8c, 0xbe, 0xef, - 0x5d, 0x27, 0x25, 0x61, 0x10, 0x11, 0x96, 0xcb, 0xd1, 0xcf, 0xd7, 0x1b, - 0x90, 0xb5, 0xc7, 0xf3, 0xf9, 0xfc, 0xb0, 0x58, 0x2c, 0x56, 0x53, 0xb7, - 0x8a, 0x88, 0x70, 0xb9, 0x5c, 0x1e, 0x00, 0x3c, 0x8e, 0xde, 0x39, 0xf3, - 0xdf, 0x02, 0x78, 0x77, 0xbd, 0x2f, 0x26, 0x21, 0x01, 0x7f, 0x00, 0xfc, - 0x00, 0xf0, 0xed, 0x7a, 0x2f, 0x02, 0xbd, 0x04, 0xf0, 0x06, 0xc0, 0x2b, - 0x34, 0xca, 0x5f, 0x19, 0x03, 0xf8, 0x05, 0xe0, 0x02, 0xe0, 0xf7, 0xc4, - 0xb5, 0xff, 0xed, 0xb9, 0x6d, 0x46, 0xb5, 0x0b, 0x26, 0xfe, 0xd3, 0x50, - 0x44, 0xf0, 0x17, 0xa0, 0xb1, 0xe0, 0x73, 0xc3, 0xe6, 0x24, 0xdb, 0x00, - 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x32, 0x08, 0x06, 0x00, 0x00, 0x00, 0x42, 0xb5, 0xcb, + 0x95, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x89, 0x00, 0x00, 0x0b, + 0x89, 0x01, 0x37, 0xc9, 0xcb, 0xad, 0x00, 0x00, 0x02, 0x5d, 0x49, 0x44, 0x41, 0x54, 0x58, 0x85, + 0xed, 0x58, 0x41, 0xae, 0xd3, 0x40, 0x0c, 0x7d, 0x9e, 0x52, 0x84, 0x10, 0x69, 0xd5, 0x05, 0x57, + 0xe8, 0x8e, 0x4d, 0x51, 0x57, 0xdc, 0x80, 0x43, 0xf4, 0x08, 0x1c, 0xaa, 0x87, 0xe0, 0x02, 0x88, + 0x13, 0xb0, 0xeb, 0x0d, 0x10, 0x8b, 0x4a, 0x5f, 0x15, 0x42, 0xe4, 0x63, 0xb3, 0xa0, 0x53, 0x39, + 0x8e, 0x3d, 0x33, 0x49, 0xbf, 0xf4, 0x37, 0x58, 0x8a, 0x32, 0x3f, 0x99, 0xf1, 0xf3, 0x1b, 0x3f, + 0x7b, 0xd2, 0x4f, 0x22, 0x02, 0x22, 0x82, 0x63, 0xe2, 0x3d, 0x6c, 0xb0, 0x91, 0x33, 0x91, 0xb9, + 0xae, 0x9e, 0x02, 0x1d, 0xc0, 0xeb, 0xe3, 0xf1, 0xf8, 0x71, 0xbb, 0xdd, 0x7e, 0x00, 0x40, 0x44, + 0x74, 0x63, 0x6c, 0x99, 0xe7, 0x48, 0x45, 0x24, 0x8f, 0xe5, 0x74, 0x3a, 0x7d, 0x3d, 0x1c, 0x0e, + 0x9f, 0x01, 0xfc, 0xd4, 0x73, 0x5f, 0x38, 0x40, 0xdd, 0x7e, 0xbf, 0xff, 0xb4, 0xd9, 0x6c, 0x76, + 0x44, 0x84, 0x94, 0x52, 0x13, 0x10, 0x33, 0x43, 0x44, 0xb0, 0x5e, 0xaf, 0xdf, 0x03, 0xf8, 0xd2, + 0x02, 0xb4, 0xea, 0xba, 0x6e, 0xd7, 0xf7, 0xbd, 0xa4, 0x94, 0x6e, 0x40, 0x16, 0xcc, 0xb2, 0x61, + 0x66, 0x30, 0x33, 0xba, 0xae, 0xdb, 0x01, 0x58, 0x01, 0xf8, 0xae, 0x9d, 0x26, 0x8c, 0x93, 0xbe, + 0x64, 0xe6, 0x41, 0xd4, 0x3a, 0x99, 0xb5, 0xbf, 0xaf, 0x6b, 0x97, 0x36, 0x7a, 0x8f, 0xd1, 0x20, + 0xda, 0xcc, 0x42, 0x8f, 0xf5, 0x3b, 0x0d, 0x66, 0x41, 0x2d, 0x23, 0x6b, 0xe4, 0x2d, 0x72, 0x12, + 0x1f, 0x82, 0xc1, 0x11, 0x99, 0x07, 0x14, 0x32, 0x9c, 0xfa, 0x4e, 0x4f, 0xf3, 0xb6, 0x6e, 0x10, + 0x4d, 0x0d, 0x24, 0xd8, 0xae, 0x36, 0x46, 0x59, 0xaa, 0xf9, 0x1e, 0x6d, 0x65, 0x74, 0x79, 0xe6, + 0x32, 0xca, 0x0b, 0xb4, 0x08, 0x22, 0x86, 0x01, 0xd0, 0x88, 0x91, 0xab, 0x3a, 0xed, 0x00, 0x88, + 0x55, 0x67, 0x05, 0x32, 0x8b, 0x91, 0x8e, 0x9e, 0x99, 0x5d, 0x59, 0xe7, 0x77, 0x16, 0xcc, 0x63, + 0x54, 0x55, 0x5d, 0x8b, 0xe2, 0x5a, 0x94, 0x57, 0xcc, 0x11, 0x00, 0xa4, 0x94, 0x06, 0x0e, 0x4b, + 0x2d, 0x68, 0x32, 0xa3, 0x28, 0xe1, 0x76, 0x6c, 0xe7, 0x96, 0x98, 0x85, 0x75, 0xa4, 0x23, 0xd5, + 0x2c, 0x22, 0x46, 0x26, 0x80, 0x76, 0xd5, 0x45, 0x36, 0xf7, 0xb4, 0x2c, 0x32, 0xca, 0x6c, 0xf4, + 0x65, 0x41, 0xed, 0x75, 0x9d, 0xd3, 0x94, 0x23, 0x8a, 0xa2, 0x8e, 0x1a, 0x6a, 0x14, 0x6c, 0x8d, + 0xd1, 0x28, 0xc1, 0x59, 0x79, 0x5e, 0x7e, 0x74, 0x00, 0x93, 0x0b, 0x36, 0x2f, 0xce, 0x8e, 0xb5, + 0x20, 0xac, 0xd9, 0x43, 0x32, 0xda, 0xba, 0x62, 0x1d, 0x79, 0x2c, 0x22, 0x33, 0x2c, 0xa7, 0xd5, + 0x51, 0xa9, 0xa1, 0x96, 0xba, 0xb9, 0x67, 0xc5, 0x5e, 0x07, 0x60, 0xa0, 0xbc, 0x08, 0xbc, 0xa5, + 0x8e, 0x5c, 0xd5, 0xd5, 0xa2, 0xaf, 0x3d, 0xf7, 0x80, 0x8a, 0x05, 0x5b, 0xcb, 0x91, 0xc7, 0x2e, + 0x12, 0x8d, 0xbb, 0x75, 0x5a, 0x49, 0x79, 0xec, 0x39, 0x28, 0xc8, 0xfb, 0xbe, 0x16, 0xd4, 0xc2, + 0x2a, 0xb2, 0xb0, 0x8e, 0x98, 0x19, 0x29, 0xfd, 0x4b, 0xa1, 0x77, 0xa4, 0x5b, 0xb0, 0x5a, 0x0b, + 0x6a, 0xfa, 0x80, 0xb4, 0x7b, 0xaf, 0x81, 0xa3, 0xe3, 0xc3, 0x5a, 0x73, 0xaf, 0x6b, 0x3d, 0x77, + 0x9e, 0xe4, 0x28, 0x8f, 0x24, 0x7f, 0xf7, 0x51, 0x9e, 0x73, 0x64, 0xc7, 0x36, 0x10, 0xe7, 0x23, + 0x66, 0x7e, 0x1d, 0x79, 0x8d, 0xb5, 0x75, 0x3b, 0x43, 0x46, 0x76, 0x71, 0xad, 0xb1, 0x3a, 0x42, + 0x78, 0xb6, 0x8f, 0xfc, 0xb8, 0xd7, 0x59, 0x47, 0x25, 0x25, 0x3a, 0xef, 0x2c, 0x23, 0xba, 0xbb, + 0x33, 0xb4, 0x5a, 0x53, 0x1d, 0xcd, 0xd8, 0x3a, 0x57, 0x75, 0xa3, 0x87, 0xcc, 0x8c, 0xbe, 0xef, + 0x5d, 0x27, 0x25, 0x61, 0x10, 0x11, 0x96, 0xcb, 0xd1, 0xcf, 0xd7, 0x1b, 0x90, 0xb5, 0xc7, 0xf3, + 0xf9, 0xfc, 0xb0, 0x58, 0x2c, 0x56, 0x53, 0xb7, 0x8a, 0x88, 0x70, 0xb9, 0x5c, 0x1e, 0x00, 0x3c, + 0x8e, 0xde, 0x39, 0xf3, 0xdf, 0x02, 0x78, 0x77, 0xbd, 0x2f, 0x26, 0x21, 0x01, 0x7f, 0x00, 0xfc, + 0x00, 0xf0, 0xed, 0x7a, 0x2f, 0x02, 0xbd, 0x04, 0xf0, 0x06, 0xc0, 0x2b, 0x34, 0xca, 0x5f, 0x19, + 0x03, 0xf8, 0x05, 0xe0, 0x02, 0xe0, 0xf7, 0xc4, 0xb5, 0xff, 0xed, 0xb9, 0x6d, 0x46, 0xb5, 0x0b, + 0x26, 0xfe, 0xd3, 0x50, 0x44, 0xf0, 0x17, 0xa0, 0xb1, 0xe0, 0x73, 0xc3, 0xe6, 0x24, 0xdb, 0x00, + 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; static int btn_default_normal_9_png_len = 683; static BYTE textfield_default_9_png[] = { - 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, - 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x32, - 0x08, 0x06, 0x00, 0x00, 0x00, 0x46, 0x40, 0x1b, 0xa8, 0x00, 0x00, 0x00, - 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x89, 0x00, 0x00, 0x0b, - 0x89, 0x01, 0x37, 0xc9, 0xcb, 0xad, 0x00, 0x00, 0x01, 0x53, 0x49, 0x44, - 0x41, 0x54, 0x58, 0x85, 0xed, 0x98, 0x4b, 0x6e, 0x83, 0x30, 0x10, 0x86, - 0x67, 0xc6, 0xa8, 0x8a, 0x58, 0xb1, 0x45, 0xa2, 0x9b, 0x8a, 0x83, 0xf4, - 0x28, 0xbd, 0x03, 0xea, 0x71, 0xb8, 0x0b, 0xf7, 0x60, 0x55, 0xa9, 0x97, - 0x60, 0x51, 0x4f, 0x17, 0xcd, 0x44, 0x7e, 0x76, 0x30, 0x09, 0x52, 0xa9, - 0xf8, 0x25, 0x0b, 0x3f, 0x26, 0xf3, 0xf9, 0xb7, 0xad, 0x10, 0x07, 0x98, - 0x19, 0x0a, 0x54, 0x16, 0xcc, 0x0c, 0x18, 0xf4, 0x3d, 0x03, 0x44, 0x7d, - 0xa5, 0xb2, 0x00, 0xf0, 0x29, 0x8d, 0xca, 0x1d, 0x99, 0xa6, 0xe9, 0xbd, - 0xef, 0xfb, 0x37, 0x71, 0x85, 0xa8, 0xb3, 0xdc, 0x15, 0xa8, 0xaa, 0x0a, - 0xda, 0xb6, 0x7d, 0xcd, 0x02, 0x2e, 0x97, 0x0b, 0xd7, 0x75, 0xfd, 0x63, - 0xcd, 0x49, 0x9e, 0x02, 0xb9, 0x89, 0x83, 0x09, 0x7d, 0xb9, 0x71, 0x1e, - 0xc0, 0x18, 0xc3, 0xc6, 0x18, 0x40, 0xc4, 0x5b, 0x59, 0xeb, 0x80, 0x99, - 0xa5, 0x6e, 0xb3, 0x00, 0x22, 0x62, 0x22, 0x8a, 0x00, 0x39, 0x50, 0x98, - 0xfc, 0xda, 0xf6, 0x0e, 0x82, 0x07, 0x90, 0xa4, 0x2e, 0x24, 0x07, 0x90, - 0x65, 0x94, 0xa7, 0xb5, 0x16, 0x52, 0x27, 0x32, 0x02, 0x48, 0x72, 0x79, - 0x6a, 0x0e, 0xa4, 0x10, 0x51, 0x32, 0x46, 0x75, 0xb0, 0x66, 0x1f, 0xc4, - 0x41, 0x22, 0x96, 0x93, 0x00, 0xb7, 0x9e, 0x83, 0xb8, 0x27, 0x47, 0x92, - 0xa7, 0xe2, 0x92, 0xbe, 0xb4, 0xe4, 0xa9, 0xc9, 0xe4, 0x54, 0x85, 0x1d, - 0xa9, 0xe4, 0xbf, 0x6d, 0x72, 0x0a, 0xa8, 0x3a, 0x08, 0x81, 0x25, 0xfd, - 0xc5, 0x80, 0x7b, 0x75, 0x38, 0x40, 0xb4, 0x6e, 0x87, 0x73, 0xa0, 0x02, - 0xee, 0x7d, 0xd9, 0xa8, 0x80, 0x87, 0xeb, 0x7f, 0x00, 0x8a, 0x7e, 0x29, - 0x6c, 0x01, 0x3c, 0x7c, 0x63, 0x43, 0xc0, 0xae, 0xf2, 0x00, 0x6b, 0xbf, - 0xc0, 0x36, 0x03, 0xf6, 0xd0, 0x09, 0x38, 0x01, 0x27, 0xe0, 0x04, 0xfc, - 0x01, 0x00, 0xaa, 0x80, 0xc2, 0x6b, 0x6e, 0xa4, 0xcd, 0x0e, 0xd6, 0x82, - 0xa3, 0xfb, 0x41, 0x70, 0xdf, 0x52, 0x21, 0x5a, 0xac, 0xe7, 0x80, 0x88, - 0x10, 0x11, 0x09, 0x11, 0xe9, 0x3a, 0xe6, 0xd5, 0x53, 0x45, 0xc6, 0xe5, - 0x73, 0x4d, 0xd3, 0x78, 0x6f, 0x2d, 0xaf, 0x31, 0x0c, 0xc3, 0x4b, 0xd7, - 0x75, 0x4f, 0xea, 0xd4, 0x33, 0x5a, 0x96, 0xc5, 0xce, 0xf3, 0xbc, 0x8c, - 0xe3, 0xf8, 0xb1, 0x35, 0xc7, 0xa9, 0x23, 0x6a, 0xef, 0x3f, 0xa4, 0xbe, - 0x01, 0x9f, 0x91, 0x87, 0x71, 0x3a, 0x69, 0xd1, 0x87, 0x00, 0x00, 0x00, - 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x32, 0x08, 0x06, 0x00, 0x00, 0x00, 0x46, 0x40, 0x1b, + 0xa8, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x89, 0x00, 0x00, 0x0b, + 0x89, 0x01, 0x37, 0xc9, 0xcb, 0xad, 0x00, 0x00, 0x01, 0x53, 0x49, 0x44, 0x41, 0x54, 0x58, 0x85, + 0xed, 0x98, 0x4b, 0x6e, 0x83, 0x30, 0x10, 0x86, 0x67, 0xc6, 0xa8, 0x8a, 0x58, 0xb1, 0x45, 0xa2, + 0x9b, 0x8a, 0x83, 0xf4, 0x28, 0xbd, 0x03, 0xea, 0x71, 0xb8, 0x0b, 0xf7, 0x60, 0x55, 0xa9, 0x97, + 0x60, 0x51, 0x4f, 0x17, 0xcd, 0x44, 0x7e, 0x76, 0x30, 0x09, 0x52, 0xa9, 0xf8, 0x25, 0x0b, 0x3f, + 0x26, 0xf3, 0xf9, 0xb7, 0xad, 0x10, 0x07, 0x98, 0x19, 0x0a, 0x54, 0x16, 0xcc, 0x0c, 0x18, 0xf4, + 0x3d, 0x03, 0x44, 0x7d, 0xa5, 0xb2, 0x00, 0xf0, 0x29, 0x8d, 0xca, 0x1d, 0x99, 0xa6, 0xe9, 0xbd, + 0xef, 0xfb, 0x37, 0x71, 0x85, 0xa8, 0xb3, 0xdc, 0x15, 0xa8, 0xaa, 0x0a, 0xda, 0xb6, 0x7d, 0xcd, + 0x02, 0x2e, 0x97, 0x0b, 0xd7, 0x75, 0xfd, 0x63, 0xcd, 0x49, 0x9e, 0x02, 0xb9, 0x89, 0x83, 0x09, + 0x7d, 0xb9, 0x71, 0x1e, 0xc0, 0x18, 0xc3, 0xc6, 0x18, 0x40, 0xc4, 0x5b, 0x59, 0xeb, 0x80, 0x99, + 0xa5, 0x6e, 0xb3, 0x00, 0x22, 0x62, 0x22, 0x8a, 0x00, 0x39, 0x50, 0x98, 0xfc, 0xda, 0xf6, 0x0e, + 0x82, 0x07, 0x90, 0xa4, 0x2e, 0x24, 0x07, 0x90, 0x65, 0x94, 0xa7, 0xb5, 0x16, 0x52, 0x27, 0x32, + 0x02, 0x48, 0x72, 0x79, 0x6a, 0x0e, 0xa4, 0x10, 0x51, 0x32, 0x46, 0x75, 0xb0, 0x66, 0x1f, 0xc4, + 0x41, 0x22, 0x96, 0x93, 0x00, 0xb7, 0x9e, 0x83, 0xb8, 0x27, 0x47, 0x92, 0xa7, 0xe2, 0x92, 0xbe, + 0xb4, 0xe4, 0xa9, 0xc9, 0xe4, 0x54, 0x85, 0x1d, 0xa9, 0xe4, 0xbf, 0x6d, 0x72, 0x0a, 0xa8, 0x3a, + 0x08, 0x81, 0x25, 0xfd, 0xc5, 0x80, 0x7b, 0x75, 0x38, 0x40, 0xb4, 0x6e, 0x87, 0x73, 0xa0, 0x02, + 0xee, 0x7d, 0xd9, 0xa8, 0x80, 0x87, 0xeb, 0x7f, 0x00, 0x8a, 0x7e, 0x29, 0x6c, 0x01, 0x3c, 0x7c, + 0x63, 0x43, 0xc0, 0xae, 0xf2, 0x00, 0x6b, 0xbf, 0xc0, 0x36, 0x03, 0xf6, 0xd0, 0x09, 0x38, 0x01, + 0x27, 0xe0, 0x04, 0xfc, 0x01, 0x00, 0xaa, 0x80, 0xc2, 0x6b, 0x6e, 0xa4, 0xcd, 0x0e, 0xd6, 0x82, + 0xa3, 0xfb, 0x41, 0x70, 0xdf, 0x52, 0x21, 0x5a, 0xac, 0xe7, 0x80, 0x88, 0x10, 0x11, 0x09, 0x11, + 0xe9, 0x3a, 0xe6, 0xd5, 0x53, 0x45, 0xc6, 0xe5, 0x73, 0x4d, 0xd3, 0x78, 0x6f, 0x2d, 0xaf, 0x31, + 0x0c, 0xc3, 0x4b, 0xd7, 0x75, 0x4f, 0xea, 0xd4, 0x33, 0x5a, 0x96, 0xc5, 0xce, 0xf3, 0xbc, 0x8c, + 0xe3, 0xf8, 0xb1, 0x35, 0xc7, 0xa9, 0x23, 0x6a, 0xef, 0x3f, 0xa4, 0xbe, 0x01, 0x9f, 0x91, 0x87, + 0x71, 0x3a, 0x69, 0xd1, 0x87, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, + 0x82 }; static int textfield_default_9_png_len = 417; /* Fonts */ static BYTE source_serif_pro_regular_12_png[] = { - 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, - 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x02, 0xe7, 0x00, 0x00, 0x00, 0x11, - 0x08, 0x06, 0x00, 0x00, 0x00, 0x7e, 0x53, 0x02, 0xe5, 0x00, 0x00, 0x00, - 0x04, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08, 0x08, 0x7c, 0x08, 0x64, - 0x88, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0e, - 0xc4, 0x00, 0x00, 0x0e, 0xc4, 0x01, 0x95, 0x2b, 0x0e, 0x1b, 0x00, 0x00, - 0x20, 0x00, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c, 0xed, 0x9d, 0x77, 0xd8, - 0x55, 0xc5, 0xb5, 0xc6, 0x7f, 0x14, 0x15, 0xb1, 0xa2, 0x62, 0x12, 0x8d, - 0x0d, 0x1b, 0x26, 0xf6, 0x86, 0x1a, 0x13, 0x10, 0x7b, 0xb0, 0xc4, 0x28, - 0x18, 0x4b, 0x14, 0x31, 0x17, 0x15, 0x8d, 0xc6, 0x42, 0xbc, 0x26, 0x16, - 0xbc, 0x46, 0x63, 0xbc, 0x26, 0xd8, 0x35, 0x09, 0x0a, 0x51, 0xb1, 0x44, - 0x63, 0x8f, 0x1d, 0xf9, 0x00, 0x1b, 0x62, 0x45, 0xc4, 0xd8, 0x51, 0x11, - 0x8d, 0x8a, 0x60, 0x45, 0x41, 0x7c, 0xef, 0x1f, 0xef, 0xcc, 0xdd, 0x73, - 0xf6, 0xd9, 0xfb, 0x9c, 0xf3, 0x7d, 0x7c, 0x60, 0xd4, 0xef, 0x7d, 0x9e, - 0x79, 0xce, 0xd9, 0xb3, 0x67, 0x66, 0xcf, 0x9e, 0xb2, 0x66, 0xcd, 0x5a, - 0x6b, 0xd6, 0x6e, 0x27, 0x89, 0xaf, 0x19, 0x3a, 0x01, 0x5f, 0x00, 0x9f, - 0x87, 0xdf, 0x36, 0xb4, 0xa1, 0x0d, 0x6d, 0x68, 0x43, 0x1b, 0xda, 0xd0, - 0x86, 0x79, 0x45, 0x07, 0x60, 0x71, 0xe0, 0xfd, 0x2f, 0xbb, 0x22, 0x6d, - 0xf8, 0x7a, 0xa3, 0x7d, 0xf2, 0xff, 0x5f, 0xc0, 0x7e, 0x05, 0xff, 0x9b, - 0x83, 0x29, 0xf3, 0x5a, 0xa1, 0x66, 0x22, 0x5f, 0xcf, 0x8d, 0x80, 0xbf, - 0x01, 0x9b, 0x00, 0x7f, 0xa9, 0x91, 0x6f, 0x10, 0xf0, 0xe6, 0x7c, 0xac, - 0x57, 0x11, 0x9e, 0x03, 0x56, 0x58, 0xc0, 0xcf, 0x9c, 0x1f, 0xe8, 0x04, - 0x74, 0xfe, 0xb2, 0x2b, 0x31, 0x1f, 0xd0, 0x11, 0xf8, 0x01, 0xb0, 0xd4, - 0x97, 0x5d, 0x91, 0x36, 0xb4, 0xa1, 0x0d, 0x5f, 0x6b, 0x08, 0x78, 0x1b, - 0x18, 0x8d, 0xd7, 0xaa, 0x27, 0x81, 0x55, 0x0a, 0xd2, 0x9d, 0x0d, 0x3c, - 0x16, 0xd2, 0x0f, 0x99, 0x87, 0xe7, 0xfd, 0x1e, 0xb8, 0xb9, 0x99, 0x79, - 0x96, 0x00, 0x0e, 0x00, 0xae, 0x06, 0x0e, 0x9b, 0x87, 0x67, 0x47, 0x6c, - 0x0a, 0xfc, 0x0f, 0xf0, 0x40, 0x0b, 0xf2, 0xfe, 0x04, 0x78, 0x0a, 0x98, - 0x0d, 0x34, 0x01, 0x0b, 0x35, 0x90, 0x27, 0xd6, 0xff, 0x1a, 0xea, 0xd7, - 0x7f, 0x0c, 0x5e, 0x9f, 0x17, 0xad, 0x11, 0xbf, 0x06, 0x70, 0x2d, 0xf0, - 0x0e, 0x70, 0x74, 0x9d, 0xe7, 0xfe, 0x1c, 0xb8, 0xaa, 0x81, 0xe7, 0xb6, - 0xe1, 0xeb, 0x8b, 0x01, 0x78, 0x5e, 0x5f, 0x40, 0x36, 0x7f, 0xcf, 0x05, - 0x5e, 0x00, 0xfe, 0x8e, 0x37, 0x78, 0x35, 0xd1, 0x1e, 0x78, 0x06, 0xd8, - 0x07, 0x58, 0x0d, 0xf8, 0x6e, 0x88, 0x4f, 0xff, 0x03, 0xac, 0x09, 0x9c, - 0x11, 0xfe, 0x6f, 0x06, 0xfc, 0x36, 0x57, 0xce, 0x2a, 0xc0, 0xaf, 0x81, - 0x2e, 0x98, 0xf1, 0xed, 0x14, 0xe2, 0x57, 0x06, 0xc6, 0x03, 0x93, 0x0a, - 0xf2, 0xc4, 0xe7, 0x9f, 0x96, 0x8b, 0x5b, 0x1f, 0xb8, 0x2f, 0xe4, 0x9b, - 0x02, 0x5c, 0x49, 0xf5, 0xa4, 0x89, 0x48, 0xeb, 0xb9, 0x3c, 0x70, 0x13, - 0x6e, 0x84, 0x87, 0x42, 0x1d, 0x7e, 0x93, 0x4b, 0xbf, 0x74, 0xf8, 0x9d, - 0x01, 0xbc, 0x1b, 0xfe, 0x77, 0x02, 0x16, 0x29, 0x29, 0xbf, 0xb5, 0xb0, - 0x0e, 0xde, 0x69, 0x4f, 0x0b, 0xd7, 0xbb, 0x00, 0x13, 0xf0, 0x3b, 0x5e, - 0x01, 0x2c, 0x96, 0xa4, 0x6d, 0x0f, 0x6c, 0x0c, 0x1c, 0x1b, 0xd2, 0xa5, - 0x58, 0x16, 0xf8, 0x2b, 0x70, 0x1b, 0xf0, 0x3a, 0x70, 0x07, 0xd9, 0xfb, - 0xb7, 0xc3, 0x6d, 0x7c, 0x0f, 0xf0, 0x08, 0x30, 0x11, 0xd8, 0xab, 0xa4, - 0x3e, 0x07, 0xe3, 0x01, 0x13, 0xf1, 0x12, 0x26, 0x7a, 0x69, 0x48, 0xd1, - 0x01, 0xf8, 0x45, 0x78, 0xde, 0x9f, 0xa8, 0x1c, 0x1b, 0x65, 0xe8, 0x1f, - 0xea, 0xf0, 0x28, 0x26, 0x72, 0xab, 0x27, 0xf7, 0x06, 0xe1, 0x81, 0x3b, - 0x36, 0xa4, 0xe9, 0xd7, 0x40, 0x79, 0xf3, 0x1b, 0x83, 0x80, 0xfb, 0x81, - 0xb7, 0x80, 0xa1, 0x64, 0x63, 0x38, 0xc5, 0x32, 0xc0, 0xa9, 0xb8, 0xde, - 0xf7, 0xe1, 0x85, 0xe6, 0x69, 0xe0, 0x2c, 0x3c, 0xfe, 0xca, 0xb0, 0x3b, - 0xf0, 0x11, 0xc5, 0xe3, 0xb8, 0x2f, 0xf0, 0x30, 0xee, 0x8f, 0x29, 0xb8, - 0xad, 0x26, 0x85, 0xb8, 0x1d, 0x73, 0x69, 0x37, 0xc6, 0x8b, 0xcd, 0xf8, - 0x24, 0xdd, 0x4d, 0x78, 0x81, 0xef, 0x1b, 0xea, 0x13, 0xcb, 0x69, 0x02, - 0x1e, 0xc4, 0xf3, 0x7b, 0x28, 0xf0, 0xad, 0xa4, 0x9c, 0xdd, 0x70, 0x5f, - 0xa6, 0x69, 0x63, 0x78, 0x1d, 0xcf, 0xa1, 0x5a, 0x69, 0xde, 0xa2, 0x92, - 0x59, 0x58, 0x07, 0xb8, 0x34, 0xd4, 0x6b, 0x34, 0xf0, 0x04, 0x66, 0x2a, - 0x62, 0x9a, 0x7d, 0x70, 0x7f, 0x0b, 0xcf, 0xbb, 0x3b, 0x92, 0xbc, 0xb7, - 0x85, 0x38, 0x85, 0x34, 0xfb, 0x00, 0x7b, 0xe3, 0x71, 0x13, 0x99, 0x98, - 0x7b, 0x93, 0xf4, 0xa7, 0xe0, 0xb9, 0xa3, 0x50, 0x8f, 0x7b, 0xf0, 0x9c, - 0xc9, 0xe7, 0x19, 0x85, 0x17, 0xf1, 0x83, 0x80, 0xd7, 0xf0, 0x9c, 0xbf, - 0x1f, 0x58, 0xb1, 0x20, 0xed, 0x5d, 0x54, 0xa3, 0x77, 0x78, 0x9f, 0xb9, - 0xc0, 0xad, 0x05, 0xf7, 0x23, 0x8e, 0x0c, 0xe5, 0x3c, 0x0a, 0xec, 0x1b, - 0xda, 0xe2, 0xa1, 0x10, 0x77, 0x55, 0x2e, 0xed, 0x51, 0x98, 0xc9, 0xf8, - 0x3c, 0xb4, 0xcf, 0xa6, 0xc9, 0xbd, 0x7e, 0xb8, 0x6d, 0xc7, 0x84, 0xe7, - 0x0e, 0x03, 0x56, 0x4a, 0xee, 0x17, 0x8d, 0x93, 0xc7, 0xc3, 0xb3, 0xf6, - 0xcf, 0x3d, 0x67, 0xe7, 0xf0, 0xfe, 0xb1, 0xac, 0x0b, 0x80, 0xae, 0xb9, - 0xb2, 0xf2, 0x63, 0xe5, 0x7e, 0xdc, 0x6f, 0x43, 0x80, 0x85, 0x93, 0xb4, - 0xed, 0x31, 0x6d, 0x7f, 0x3c, 0xa4, 0x79, 0x0a, 0x33, 0x29, 0xdd, 0x42, - 0xda, 0xb7, 0xc8, 0xc6, 0x45, 0x5a, 0x5e, 0xac, 0xeb, 0x0f, 0x42, 0x3d, - 0x62, 0x7f, 0xdd, 0x15, 0xca, 0x6c, 0x1f, 0xea, 0x38, 0x3d, 0xdc, 0x7b, - 0x08, 0xd8, 0x0e, 0x38, 0x27, 0xa4, 0x13, 0x66, 0x8c, 0x8e, 0x09, 0xf5, - 0x58, 0x2a, 0xd4, 0xe1, 0x23, 0xe0, 0x45, 0xe0, 0x57, 0x21, 0xed, 0xd4, - 0x90, 0xf6, 0x29, 0xe0, 0x50, 0x2c, 0x38, 0x18, 0x85, 0xfb, 0xf5, 0x43, - 0x60, 0x1c, 0x5e, 0x53, 0xb6, 0xc7, 0xe3, 0xe6, 0xb3, 0xd0, 0x26, 0xeb, - 0x02, 0x27, 0x01, 0xcf, 0x86, 0xfc, 0x53, 0x81, 0x8b, 0xc2, 0xb3, 0x2e, - 0xc2, 0x4c, 0xd8, 0x9b, 0x98, 0x39, 0x05, 0x33, 0x5d, 0xa3, 0x81, 0x8f, - 0xb1, 0x46, 0xf6, 0x11, 0xa0, 0x4f, 0x78, 0xde, 0x18, 0x4c, 0xdf, 0x5f, - 0x04, 0x7e, 0x99, 0x94, 0xd7, 0x94, 0x0b, 0x9f, 0x85, 0xf7, 0x8d, 0xcf, - 0xd8, 0x06, 0x8f, 0x83, 0x5b, 0xf1, 0x7c, 0xcb, 0xe3, 0x38, 0x3c, 0xb7, - 0xe7, 0x15, 0x57, 0x02, 0x3d, 0x30, 0xb3, 0xda, 0x28, 0xba, 0x02, 0xdf, - 0x07, 0x7e, 0x46, 0x25, 0xed, 0x68, 0x29, 0x36, 0x02, 0x76, 0x00, 0xb6, - 0x6a, 0x66, 0xbe, 0x6d, 0x80, 0x11, 0x78, 0x2d, 0x1b, 0x09, 0x7c, 0x8a, - 0xd7, 0xba, 0x7a, 0x88, 0xf5, 0xdf, 0x9b, 0xfa, 0xf5, 0xef, 0x8a, 0x69, - 0x7b, 0xc7, 0x1a, 0xf1, 0x6f, 0xe1, 0x79, 0xd4, 0xa5, 0x81, 0xb2, 0xd6, - 0xc5, 0x74, 0xac, 0x35, 0xda, 0xad, 0x0d, 0x5f, 0x4d, 0xfc, 0x09, 0xd3, - 0x9c, 0x23, 0x92, 0xb8, 0xa3, 0xf0, 0xf8, 0xef, 0x8b, 0xd7, 0xa5, 0xda, - 0x90, 0xf4, 0xb9, 0xa4, 0xdf, 0x4a, 0x7a, 0x49, 0xd2, 0x7e, 0x92, 0x08, - 0xff, 0xf7, 0x0d, 0xff, 0x91, 0xb4, 0x93, 0xa4, 0x83, 0xc3, 0xff, 0x7e, - 0x92, 0xf6, 0x49, 0xee, 0xfd, 0x58, 0xd2, 0x74, 0x49, 0x47, 0x48, 0x9a, - 0x26, 0xe9, 0x77, 0x92, 0xee, 0x0e, 0xf7, 0xae, 0x95, 0x74, 0xa3, 0xa4, - 0xf5, 0x65, 0x7c, 0x3f, 0xc9, 0x87, 0xa4, 0xe3, 0x25, 0xed, 0x92, 0x8b, - 0x7b, 0x41, 0xd2, 0x15, 0xe1, 0xff, 0xda, 0x21, 0xdf, 0xe1, 0xb9, 0x34, - 0x31, 0xa4, 0x75, 0xbe, 0x46, 0xd2, 0xb0, 0xe4, 0xde, 0x6a, 0x92, 0x66, - 0x49, 0x5a, 0x37, 0x5c, 0x2f, 0x2a, 0xe9, 0x7d, 0x49, 0xf7, 0x84, 0xf2, - 0x6e, 0x0b, 0x75, 0x9d, 0x21, 0xe9, 0xc8, 0x92, 0xf2, 0x5b, 0x2b, 0x1c, - 0x2f, 0xe9, 0xc4, 0xf0, 0xbf, 0x7b, 0xa8, 0x57, 0x6c, 0x8b, 0x1b, 0x24, - 0x0d, 0x0f, 0xff, 0x3b, 0x4b, 0xba, 0x2f, 0xd4, 0x51, 0x92, 0x86, 0xe4, - 0xca, 0xb9, 0x5b, 0xd2, 0xed, 0xe1, 0x7f, 0x17, 0x49, 0x53, 0x92, 0xeb, - 0x5f, 0x84, 0x3c, 0x6b, 0x86, 0xeb, 0xff, 0x92, 0x34, 0x57, 0xd2, 0x86, - 0xb9, 0x32, 0x56, 0x95, 0x34, 0x33, 0xa4, 0x8d, 0x71, 0xd3, 0x6a, 0xd4, - 0x7d, 0x39, 0x49, 0xe3, 0x24, 0x9d, 0x2c, 0xa9, 0x53, 0x12, 0xdf, 0x54, - 0x10, 0x1e, 0x94, 0x34, 0x59, 0xd2, 0x16, 0xa1, 0xfc, 0x1f, 0x86, 0xb4, - 0xa3, 0x24, 0x3d, 0x14, 0xfe, 0x1f, 0x1e, 0xfa, 0x61, 0xf5, 0x70, 0xbd, - 0xbd, 0xa4, 0x2f, 0xc2, 0x6f, 0x4b, 0xda, 0x76, 0x39, 0x49, 0x2b, 0x34, - 0x98, 0x76, 0x05, 0x49, 0x5d, 0x4b, 0xee, 0x75, 0x91, 0x74, 0x8c, 0xa4, - 0x2b, 0x25, 0xbd, 0x28, 0xe9, 0x2e, 0x49, 0xed, 0x93, 0xfb, 0x7b, 0x84, - 0x76, 0x3a, 0x3a, 0xd7, 0x0e, 0xcb, 0x4a, 0xba, 0x3c, 0xdc, 0x5b, 0xbb, - 0xa4, 0xec, 0x91, 0xa1, 0x3d, 0xf6, 0xaa, 0x51, 0x37, 0xa9, 0xb2, 0xbf, - 0x7f, 0x29, 0x69, 0x8e, 0xa4, 0xf5, 0xc2, 0xf5, 0x00, 0x49, 0xff, 0x96, - 0xe7, 0x5b, 0x4c, 0xd3, 0x41, 0xd2, 0x1b, 0xb9, 0x7c, 0xf9, 0x72, 0x96, - 0x96, 0xc7, 0xd7, 0x9b, 0x92, 0xd6, 0xaa, 0xf3, 0x4c, 0x42, 0x1b, 0xd4, - 0x2a, 0x0f, 0x79, 0xde, 0xc4, 0xb8, 0xfd, 0x24, 0xbd, 0x2d, 0xa9, 0xaf, - 0xa4, 0x76, 0x49, 0x9a, 0xe3, 0x43, 0xde, 0x7a, 0xcf, 0x23, 0xc4, 0xe5, - 0xd3, 0xd6, 0x4a, 0x5f, 0xeb, 0x5e, 0x3e, 0xbe, 0xb3, 0xa4, 0xb1, 0x05, - 0xef, 0x5e, 0xaf, 0xfc, 0x18, 0x66, 0xca, 0x34, 0x72, 0xa5, 0x82, 0x7b, - 0xed, 0x24, 0xfd, 0xab, 0xa4, 0xee, 0x71, 0x8e, 0xed, 0x5b, 0x70, 0x6f, - 0x4a, 0xee, 0xfa, 0x34, 0x49, 0x8f, 0x4b, 0xfa, 0x4e, 0x12, 0x77, 0x98, - 0xdc, 0xdf, 0xf9, 0x31, 0x95, 0xaf, 0x73, 0x2f, 0x99, 0x9e, 0x44, 0x1a, - 0x79, 0xb8, 0xa4, 0x67, 0x24, 0xad, 0x9c, 0xd4, 0xf1, 0x38, 0x49, 0x2f, - 0xe7, 0xca, 0x2f, 0x2a, 0xeb, 0x5b, 0x32, 0x4d, 0x1d, 0x91, 0xc4, 0xfd, - 0x41, 0xd2, 0xd3, 0xf2, 0x38, 0x47, 0x52, 0x47, 0x49, 0x9f, 0x48, 0x3a, - 0x34, 0xe4, 0x3d, 0xab, 0xa4, 0xbc, 0xce, 0xf2, 0xbc, 0x6e, 0x49, 0xdf, - 0xef, 0x11, 0xe2, 0x76, 0x2c, 0x48, 0xff, 0xa4, 0xa4, 0x25, 0x92, 0xeb, - 0xed, 0x42, 0xda, 0x9d, 0x72, 0xe9, 0x6e, 0x91, 0xf4, 0x4a, 0x2e, 0x6e, - 0x19, 0x99, 0x16, 0xa5, 0x71, 0x0b, 0xc9, 0x7d, 0xf8, 0x90, 0xb2, 0xf1, - 0xdb, 0x41, 0x1e, 0x33, 0xdf, 0x2d, 0x78, 0xfe, 0xc9, 0xe1, 0x79, 0x9b, - 0x24, 0x71, 0x1d, 0x25, 0x3d, 0x20, 0x69, 0xe1, 0xe4, 0x5d, 0x7f, 0x95, - 0xcb, 0xd7, 0x27, 0xc4, 0x1f, 0x54, 0xd0, 0x16, 0x9b, 0xc9, 0x34, 0xbf, - 0x6c, 0x0c, 0x96, 0xb5, 0x5d, 0x73, 0x42, 0xb7, 0x50, 0xc7, 0x2e, 0xcd, - 0xcc, 0xd7, 0x1a, 0xcf, 0xae, 0xd5, 0xd7, 0xf5, 0xc2, 0xf5, 0x92, 0xae, - 0x9e, 0x87, 0x67, 0x36, 0x52, 0xff, 0x85, 0x65, 0xfe, 0xa0, 0x91, 0xf8, - 0x46, 0xdb, 0xa3, 0x35, 0xdb, 0xed, 0xeb, 0x10, 0xce, 0xfb, 0x86, 0xb5, - 0x87, 0x72, 0xff, 0x87, 0xd4, 0xb8, 0x2e, 0x0c, 0xed, 0x81, 0x99, 0x78, - 0xd7, 0xff, 0x0a, 0x96, 0xa0, 0x12, 0x7e, 0x5f, 0x4a, 0x78, 0xf8, 0xd5, - 0x81, 0x97, 0xc3, 0xff, 0xd5, 0x42, 0xda, 0x88, 0x73, 0xb1, 0x24, 0xe5, - 0x02, 0xac, 0x76, 0x1a, 0x89, 0x25, 0x20, 0x2b, 0x02, 0xdb, 0x62, 0xe9, - 0xc7, 0xf3, 0x21, 0x6d, 0xaf, 0x24, 0xdf, 0x7a, 0x58, 0xb2, 0x7e, 0x5b, - 0x6e, 0xbf, 0xb0, 0x34, 0x99, 0xda, 0x6a, 0x66, 0xf8, 0xfd, 0xa4, 0x64, - 0x6f, 0x11, 0xeb, 0xbc, 0x1e, 0x96, 0x3c, 0x9d, 0x93, 0xbb, 0x77, 0x27, - 0x96, 0xb4, 0x01, 0xcc, 0x02, 0x96, 0xc3, 0xbb, 0x97, 0x6d, 0x80, 0xef, - 0x61, 0x89, 0xdc, 0x3a, 0xc0, 0x79, 0x05, 0x65, 0xcf, 0xab, 0x2a, 0x31, - 0xc5, 0x6e, 0x64, 0x6a, 0xc5, 0xc3, 0xb1, 0x94, 0xe7, 0x99, 0x70, 0x7d, - 0x19, 0x56, 0x83, 0x2d, 0x8f, 0xdf, 0xb3, 0x37, 0xde, 0x71, 0xe5, 0xb1, - 0x10, 0x6e, 0xbf, 0x7f, 0x86, 0xeb, 0x19, 0xc0, 0x0d, 0x64, 0x6d, 0xba, - 0x08, 0x96, 0xa2, 0xbe, 0x10, 0xae, 0xaf, 0xc0, 0xd2, 0xa9, 0x54, 0xfa, - 0xda, 0x0e, 0xbf, 0xeb, 0x8d, 0xb9, 0xb2, 0x67, 0x52, 0x8c, 0x8e, 0xa1, - 0xde, 0x97, 0x62, 0x95, 0xe4, 0xa7, 0xc9, 0xbd, 0x5e, 0x05, 0xe1, 0x66, - 0x2c, 0x5d, 0x8b, 0x75, 0x7a, 0x38, 0xfc, 0x8e, 0xc7, 0x52, 0x5f, 0x70, - 0xfb, 0xdf, 0x40, 0x36, 0xbe, 0xee, 0xc1, 0x12, 0xad, 0xe3, 0x4a, 0xea, - 0x50, 0x86, 0x0e, 0x58, 0xda, 0x3d, 0x09, 0xf7, 0x67, 0x23, 0xd8, 0x06, - 0x4b, 0xba, 0x8f, 0x08, 0xf9, 0x53, 0xcc, 0xc0, 0xbb, 0xdd, 0xfd, 0x71, - 0xfd, 0x77, 0xc0, 0x12, 0x6f, 0x80, 0x3d, 0xb0, 0xf4, 0xa9, 0x2f, 0x96, - 0x42, 0xa7, 0xed, 0x30, 0x1d, 0x38, 0x10, 0x98, 0x8c, 0xa5, 0x6c, 0x79, - 0xa9, 0x4e, 0x27, 0x2c, 0x01, 0x7d, 0x93, 0xe6, 0x69, 0x08, 0x86, 0xe1, - 0xf6, 0xdf, 0x19, 0xd8, 0x00, 0xf8, 0x33, 0x96, 0x7c, 0xdd, 0x9e, 0xa4, - 0x99, 0x4b, 0x36, 0x8e, 0xca, 0x30, 0x13, 0xab, 0xd8, 0x9e, 0x0b, 0xef, - 0x50, 0x0f, 0x77, 0x63, 0xa9, 0x60, 0x2d, 0xdc, 0x12, 0xd2, 0xac, 0x07, - 0x0c, 0xc7, 0x52, 0x80, 0xeb, 0xa8, 0xd4, 0xc6, 0x3c, 0x1c, 0xea, 0xf7, - 0x65, 0xe3, 0xaf, 0xc0, 0x99, 0x64, 0x34, 0xa8, 0xb9, 0xf8, 0x04, 0x4b, - 0x6b, 0x07, 0x16, 0xdc, 0xdb, 0x8e, 0x72, 0x8d, 0xc9, 0x87, 0x58, 0x9a, - 0x7e, 0x11, 0xa6, 0x73, 0x65, 0xf8, 0x11, 0x70, 0x02, 0x96, 0xb4, 0xa5, - 0xa6, 0x76, 0x17, 0x63, 0xfa, 0x34, 0xbc, 0x4e, 0xfd, 0x9a, 0xb0, 0x9a, - 0xf4, 0x38, 0x4c, 0xd3, 0x86, 0xe2, 0xf1, 0xf8, 0x5a, 0xb8, 0x2f, 0x6c, - 0x1e, 0x31, 0x19, 0xb8, 0xb0, 0x4e, 0x59, 0xff, 0x06, 0xae, 0xc7, 0xe3, - 0x3c, 0x62, 0x20, 0xa6, 0x39, 0x51, 0xe2, 0xfb, 0x39, 0x1e, 0x23, 0xef, - 0x03, 0xef, 0xe1, 0x77, 0x2c, 0xc2, 0x27, 0x98, 0x16, 0xb4, 0x04, 0xf1, - 0x79, 0x3f, 0xcb, 0xc5, 0xaf, 0x87, 0x25, 0xf3, 0x1f, 0x26, 0x71, 0xe3, - 0xb0, 0x34, 0x7b, 0xbb, 0x24, 0x6e, 0x09, 0xac, 0x95, 0x58, 0x15, 0x4b, - 0x6c, 0x23, 0xb6, 0xc3, 0x1a, 0xaf, 0x14, 0x73, 0xb0, 0x74, 0x7e, 0x0b, - 0x32, 0x13, 0xc9, 0x23, 0x70, 0x3b, 0x4c, 0x2d, 0xa8, 0xdb, 0xf9, 0xe1, - 0xf9, 0xa9, 0x69, 0xc3, 0xcf, 0x80, 0x7f, 0xe0, 0xf5, 0x0f, 0xe0, 0x55, - 0xac, 0x09, 0x88, 0x58, 0x1c, 0x8f, 0x83, 0x51, 0x14, 0xf7, 0xe7, 0xa3, - 0x58, 0x3b, 0x3d, 0x3f, 0x4d, 0xea, 0x5e, 0xc6, 0x9a, 0xd8, 0x0f, 0xeb, - 0x25, 0xfc, 0x0f, 0xc3, 0xa6, 0x64, 0xbc, 0xc7, 0xfc, 0xc2, 0x6c, 0x8a, - 0xcf, 0xa7, 0xcd, 0xa6, 0x31, 0x13, 0x9a, 0x36, 0xd4, 0xc7, 0xe6, 0x5f, - 0x76, 0x05, 0xbe, 0x6a, 0x68, 0x8f, 0xd5, 0x7f, 0xef, 0x60, 0xa6, 0x2e, - 0x32, 0x4c, 0x2f, 0x90, 0x4d, 0x88, 0x26, 0xcc, 0xe0, 0x9e, 0x12, 0xfe, - 0x0f, 0xc6, 0x8b, 0x5d, 0x53, 0xb8, 0xbf, 0x12, 0x95, 0xea, 0xfa, 0x67, - 0x31, 0x03, 0xff, 0x06, 0x66, 0xb4, 0x3f, 0x0b, 0x01, 0x32, 0x95, 0xd0, - 0xc2, 0xd8, 0x9c, 0xe5, 0xbf, 0x0b, 0xea, 0x34, 0x18, 0x2f, 0x0e, 0xfd, - 0x31, 0x23, 0x79, 0x35, 0x66, 0x34, 0x7b, 0x61, 0x46, 0x64, 0x36, 0x56, - 0x6f, 0x76, 0x49, 0xea, 0xdc, 0x3f, 0xfc, 0x9f, 0x94, 0x2b, 0xeb, 0x06, - 0x6c, 0xaf, 0x16, 0xcd, 0x59, 0xe6, 0x60, 0x62, 0xdd, 0x15, 0xdb, 0xe1, - 0xf5, 0xc6, 0xea, 0xaa, 0xf9, 0x89, 0xae, 0x58, 0xbd, 0xf5, 0x74, 0xb8, - 0xee, 0x85, 0x99, 0xf3, 0x88, 0xa7, 0x30, 0xa3, 0xb8, 0x75, 0x9d, 0x72, - 0xe6, 0x60, 0x55, 0xf2, 0xc5, 0x49, 0xdc, 0xdc, 0x10, 0x0f, 0x5e, 0x78, - 0xf7, 0x48, 0xee, 0xc5, 0x77, 0x7e, 0x23, 0x89, 0x3b, 0x0a, 0x9b, 0x14, - 0xbc, 0x9a, 0x2b, 0xbb, 0xec, 0x70, 0xcb, 0x01, 0x98, 0xe9, 0x1f, 0x51, - 0xa7, 0x6e, 0x60, 0xd3, 0x9c, 0x63, 0x71, 0x9f, 0x45, 0xc6, 0xa0, 0x77, - 0xf8, 0x5d, 0x15, 0x2f, 0xa2, 0xf1, 0x7f, 0x7e, 0xd1, 0x7b, 0x0c, 0x9b, - 0x4b, 0xdd, 0x8d, 0xc7, 0x4f, 0x6a, 0xd3, 0x5e, 0x14, 0xb7, 0x35, 0x5e, - 0xd0, 0x76, 0x0c, 0xff, 0x47, 0x62, 0x26, 0xa2, 0xa9, 0x46, 0xe8, 0x10, - 0xd2, 0x6d, 0x8d, 0x37, 0x3f, 0x8f, 0x51, 0xde, 0xe6, 0x91, 0x71, 0x5f, - 0x03, 0x6f, 0xe8, 0x46, 0xe0, 0x8d, 0xda, 0x03, 0xa1, 0x1e, 0x97, 0x60, - 0xe6, 0xb3, 0x09, 0xab, 0xa4, 0x85, 0x4d, 0x5b, 0x36, 0xc2, 0x8b, 0x7c, - 0x8a, 0x9d, 0x31, 0x93, 0x75, 0x0b, 0x99, 0x1a, 0xbc, 0x11, 0xc4, 0x74, - 0xef, 0xe2, 0x39, 0xf1, 0x34, 0xc5, 0xe6, 0x17, 0x3b, 0xe1, 0x8d, 0x53, - 0x2d, 0x08, 0x6f, 0x3c, 0x36, 0xa3, 0xd2, 0x94, 0x22, 0x8f, 0x89, 0x78, - 0x0e, 0xdd, 0x5e, 0x23, 0xcd, 0xe3, 0x98, 0x31, 0xbf, 0x1d, 0x9b, 0x3b, - 0x4c, 0x22, 0xdb, 0x30, 0xa6, 0x18, 0x43, 0xb5, 0x9a, 0x78, 0x41, 0xe3, - 0x58, 0xea, 0xbf, 0x4f, 0x3d, 0xcc, 0x06, 0x2e, 0xc7, 0xa6, 0x60, 0xf9, - 0xf7, 0xf9, 0x05, 0x99, 0xd9, 0x43, 0x1e, 0x73, 0x31, 0xc3, 0xdd, 0x9e, - 0x6c, 0xa3, 0x5c, 0x84, 0xa3, 0x30, 0x23, 0xf7, 0x5c, 0xc1, 0xbd, 0xe1, - 0xc0, 0x96, 0xc0, 0x86, 0x75, 0xea, 0x38, 0x15, 0x9f, 0x67, 0x39, 0x12, - 0xcf, 0x95, 0x22, 0x86, 0xf9, 0x52, 0x4c, 0x0b, 0x8b, 0x6c, 0x9b, 0x53, - 0x74, 0xa5, 0x9a, 0x1e, 0x6c, 0x43, 0xa5, 0xa9, 0xcb, 0x4f, 0xf0, 0x7b, - 0x9f, 0x87, 0x37, 0x06, 0x65, 0xf8, 0x51, 0x9d, 0x67, 0x95, 0x61, 0x36, - 0x36, 0xdf, 0xda, 0x83, 0x4a, 0x93, 0xc3, 0x7e, 0x05, 0xcf, 0xfb, 0x0c, - 0x33, 0xdc, 0xa9, 0x40, 0x63, 0x17, 0xbc, 0x21, 0x79, 0x0f, 0xf8, 0x69, - 0x12, 0xbf, 0x03, 0x95, 0x26, 0x52, 0x11, 0xb7, 0x87, 0x70, 0x26, 0x9e, - 0xf3, 0xbb, 0x62, 0x61, 0x53, 0x11, 0x66, 0xe0, 0xf9, 0xdf, 0x8f, 0xec, - 0x0c, 0xd1, 0x00, 0x2a, 0xcf, 0x38, 0xad, 0x8a, 0x05, 0x12, 0x11, 0x67, - 0x60, 0x3a, 0x52, 0xb4, 0xc1, 0x03, 0xcf, 0xcf, 0xbb, 0x30, 0xad, 0x68, - 0x04, 0x7f, 0xc4, 0x1b, 0x92, 0x7a, 0x7d, 0x99, 0xc7, 0x0c, 0xbc, 0xb9, - 0x02, 0x0b, 0x4b, 0x6e, 0xc4, 0xc2, 0x91, 0x29, 0xa1, 0xcc, 0x32, 0x73, - 0x91, 0x65, 0xf0, 0xe6, 0xe2, 0x6e, 0x4c, 0xdb, 0x8f, 0x4f, 0xee, 0x6d, - 0x8e, 0x37, 0x1d, 0x0f, 0xe1, 0x7e, 0xf8, 0x75, 0x72, 0x6f, 0x0f, 0x4c, - 0xb7, 0xee, 0xc7, 0x82, 0xa3, 0xef, 0x15, 0x94, 0xbd, 0x1e, 0x16, 0xea, - 0x8c, 0xc6, 0x63, 0xf7, 0x22, 0x4c, 0xfb, 0x36, 0xc4, 0x7d, 0xb2, 0x0a, - 0xde, 0x34, 0x35, 0xe1, 0x35, 0x3b, 0xc5, 0x31, 0x78, 0xdd, 0x7f, 0x28, - 0xe4, 0x3f, 0x10, 0xcf, 0xd5, 0x23, 0x73, 0xe9, 0x3a, 0x63, 0x13, 0xa6, - 0x6b, 0x30, 0xbf, 0x73, 0x13, 0x19, 0xd3, 0xdd, 0x13, 0xcf, 0xcf, 0xf7, - 0x72, 0x79, 0x76, 0x0f, 0xf5, 0x7a, 0x97, 0x72, 0x5c, 0x8b, 0x37, 0xa1, - 0xaf, 0x51, 0x3e, 0x5e, 0xc0, 0x66, 0xa0, 0xe7, 0x63, 0x01, 0xc1, 0x40, - 0xbc, 0x81, 0xbe, 0x0f, 0x0b, 0x4e, 0x06, 0x62, 0x81, 0xd0, 0xd5, 0xd8, - 0xec, 0xf5, 0x4e, 0xb2, 0x31, 0x9f, 0xe6, 0x1b, 0x00, 0xfc, 0x01, 0x6f, - 0x1a, 0xdf, 0xc6, 0x9b, 0xc1, 0x74, 0xe3, 0xb0, 0x15, 0x1e, 0xdb, 0x63, - 0x31, 0x7d, 0x3e, 0x33, 0x29, 0xa7, 0x1b, 0x5e, 0x23, 0x26, 0x61, 0x7a, - 0x33, 0x02, 0xf7, 0xd9, 0x2b, 0xd8, 0x3c, 0x2c, 0xa2, 0x2f, 0xde, 0xc4, - 0x8f, 0x0b, 0xcf, 0xd9, 0x9d, 0x4a, 0x41, 0x4d, 0x47, 0x3c, 0xee, 0x1f, - 0xc4, 0x63, 0xf5, 0xa0, 0xf0, 0x0e, 0x23, 0xb0, 0x00, 0xf7, 0x5e, 0xdc, - 0x17, 0x13, 0xc9, 0x04, 0xa5, 0x9b, 0xe0, 0xf5, 0xa1, 0x07, 0xe6, 0xd3, - 0x9a, 0x30, 0xdf, 0xd7, 0x19, 0x9b, 0x88, 0x5e, 0x4c, 0xc6, 0xb7, 0x2c, - 0x1e, 0xe2, 0x2e, 0x49, 0xe2, 0xc6, 0xe2, 0xf9, 0xf1, 0x6f, 0xdc, 0x4f, - 0x4b, 0xe3, 0xf1, 0xf4, 0x19, 0x9e, 0x33, 0xf1, 0xfe, 0x54, 0x3c, 0xf6, - 0xb6, 0xc2, 0x63, 0x2e, 0x9a, 0x1a, 0xae, 0x1e, 0xea, 0xf7, 0x41, 0xa8, - 0xd7, 0xd2, 0x58, 0xa0, 0xfc, 0x01, 0x16, 0xb2, 0x9d, 0x84, 0x85, 0x27, - 0x93, 0xf0, 0xc6, 0xf5, 0xa4, 0xd0, 0xae, 0x0f, 0x27, 0xcf, 0x1d, 0x81, - 0x85, 0xcd, 0xe3, 0xc3, 0x73, 0xa3, 0x49, 0xe0, 0x13, 0x64, 0xfc, 0xc5, - 0x4c, 0x2c, 0xc4, 0x69, 0x3d, 0x48, 0x1a, 0x2d, 0x69, 0x9b, 0x3a, 0x22, - 0xf6, 0x7f, 0x24, 0xff, 0x6f, 0xcc, 0xdd, 0xbb, 0x55, 0x56, 0xfb, 0x0e, - 0x91, 0xf4, 0x7a, 0xee, 0xde, 0x9b, 0xb2, 0xda, 0xb3, 0x73, 0x10, 0xe5, - 0x1f, 0x12, 0xe2, 0x4f, 0x93, 0x55, 0x97, 0xd7, 0xc9, 0xea, 0xc4, 0x9f, - 0xe7, 0xf2, 0x9d, 0x13, 0xd2, 0xff, 0x2e, 0x17, 0xbf, 0xa8, 0x6c, 0x8e, - 0x92, 0xaf, 0xdf, 0x63, 0xca, 0x4c, 0x61, 0xd2, 0x10, 0xcd, 0x62, 0x52, - 0xd3, 0x99, 0x97, 0x64, 0x95, 0x64, 0x67, 0x49, 0x4f, 0xd4, 0x51, 0x4b, - 0xb4, 0x86, 0x1a, 0xe6, 0x20, 0x49, 0xe7, 0x26, 0xd7, 0x1f, 0x4a, 0x3a, - 0x3d, 0xb9, 0x5e, 0x24, 0x3c, 0xeb, 0x98, 0x16, 0x3c, 0xff, 0x61, 0xd9, - 0x74, 0x28, 0x1f, 0xdf, 0x49, 0x56, 0x4d, 0x8f, 0x56, 0xa6, 0x6a, 0xed, - 0x2e, 0xe9, 0x9f, 0xb2, 0xea, 0x76, 0x48, 0x28, 0x3f, 0xa6, 0x7f, 0x47, - 0x36, 0xe3, 0x78, 0x54, 0xd2, 0x9d, 0x92, 0x7e, 0x12, 0xe2, 0x9b, 0x24, - 0x5d, 0x26, 0xe9, 0x8f, 0xb2, 0x49, 0xcd, 0x04, 0x49, 0x83, 0x55, 0x69, - 0xee, 0x11, 0xc3, 0x60, 0xd9, 0x24, 0x27, 0xbe, 0xd3, 0xe3, 0xb2, 0x5a, - 0x7e, 0x50, 0xa8, 0x67, 0x34, 0x3d, 0xc9, 0xab, 0xcd, 0x91, 0xfb, 0x79, - 0x8e, 0xa4, 0xe7, 0x64, 0x73, 0x80, 0xa5, 0x93, 0x7b, 0x69, 0xdc, 0x77, - 0xe4, 0x7e, 0x7e, 0x4a, 0xd2, 0xb6, 0xf3, 0xd8, 0x2f, 0xdb, 0x86, 0x72, - 0xae, 0x50, 0xa6, 0xee, 0xef, 0x2a, 0x8f, 0xcd, 0xb7, 0x42, 0x3f, 0x7d, - 0x2f, 0xf4, 0xd5, 0x0c, 0x79, 0xbc, 0xb4, 0x97, 0xcd, 0x88, 0xa2, 0x2a, - 0x7f, 0x7f, 0x59, 0xed, 0x8a, 0xa4, 0xa5, 0x42, 0x9b, 0xe6, 0x4d, 0xa4, - 0xae, 0x96, 0xcd, 0xba, 0x76, 0x0a, 0xf7, 0xfb, 0x96, 0xd4, 0x47, 0xaa, - 0x34, 0x09, 0xb8, 0x28, 0xb4, 0x61, 0x67, 0xd9, 0x64, 0xe6, 0x82, 0x06, - 0xdf, 0x2b, 0x2d, 0x27, 0x0d, 0x5d, 0xc3, 0xbd, 0x41, 0x35, 0xd2, 0xce, - 0x68, 0xa0, 0xbc, 0x77, 0x92, 0xff, 0x6f, 0x34, 0xa3, 0x5e, 0xb5, 0xea, - 0x96, 0x1f, 0x8f, 0x8d, 0xcc, 0x81, 0xb2, 0x7b, 0x31, 0x7e, 0x1b, 0x49, - 0x1f, 0xa9, 0xb6, 0x1a, 0xbf, 0x56, 0xf9, 0x31, 0x4c, 0x91, 0xc7, 0x81, - 0x24, 0xfd, 0x34, 0x89, 0x5f, 0x59, 0xd2, 0xdf, 0x6a, 0xd4, 0x7d, 0x4a, - 0xf8, 0xfd, 0x79, 0xb8, 0x7f, 0x42, 0xc1, 0x3d, 0xe4, 0x39, 0x72, 0x5e, - 0xc9, 0xb3, 0x97, 0x0d, 0x79, 0x0f, 0xab, 0x53, 0xe7, 0x5b, 0x65, 0x3a, - 0xfa, 0xa2, 0xa4, 0xbf, 0x96, 0x94, 0xb5, 0x62, 0xc8, 0x7b, 0x40, 0x8d, - 0xb2, 0x76, 0x93, 0xf4, 0xa9, 0x2a, 0xc7, 0xf0, 0x69, 0x21, 0xdd, 0x64, - 0xd9, 0x74, 0x6e, 0x89, 0x82, 0xb2, 0xe7, 0xa5, 0xbf, 0xca, 0xda, 0x6f, - 0xf3, 0x10, 0xbf, 0x47, 0x12, 0x97, 0x37, 0x69, 0x89, 0xe1, 0x50, 0xd9, - 0x84, 0x66, 0xf9, 0x70, 0x7d, 0x9d, 0xdc, 0x3f, 0x97, 0x4a, 0x9a, 0x94, - 0xa4, 0x7b, 0x4a, 0x36, 0x59, 0x29, 0xaa, 0xdf, 0x5a, 0x92, 0x66, 0xcb, - 0x73, 0x3f, 0x6f, 0x0a, 0x98, 0x0f, 0xdf, 0x96, 0x4d, 0x89, 0x4e, 0x97, - 0xe7, 0xf5, 0xa9, 0x35, 0xd2, 0xf6, 0x90, 0xcd, 0x0b, 0x8f, 0xab, 0xd3, - 0x16, 0x7d, 0x24, 0x5d, 0xd5, 0x40, 0xdb, 0xad, 0x2b, 0xd3, 0xd0, 0xa3, - 0x55, 0xbd, 0x16, 0x37, 0x1a, 0xba, 0x48, 0x7a, 0x2f, 0xa9, 0x77, 0x8f, - 0xf0, 0x8c, 0x3e, 0x25, 0xcf, 0x1e, 0xab, 0xcc, 0x1c, 0x70, 0x53, 0x99, - 0x56, 0xf7, 0x97, 0xd7, 0xd1, 0x4f, 0x94, 0xad, 0xaf, 0x2b, 0x84, 0xf4, - 0x07, 0xc9, 0xe6, 0x46, 0x73, 0x24, 0xf5, 0x0e, 0xf7, 0x3a, 0xcb, 0x6b, - 0xb7, 0x92, 0xb2, 0xd7, 0x95, 0x4d, 0x62, 0xb7, 0x08, 0xd7, 0x8b, 0xc9, - 0x34, 0x2f, 0x1d, 0xc3, 0x45, 0x6d, 0x15, 0xdb, 0x4b, 0x92, 0x76, 0x0e, - 0xd7, 0xdb, 0xc8, 0xfd, 0xb7, 0xaf, 0x2a, 0xcd, 0x91, 0x24, 0x8f, 0x81, - 0x68, 0x1e, 0xb6, 0x59, 0x88, 0x8b, 0xe3, 0x6a, 0xb0, 0xbc, 0xae, 0xa5, - 0xf5, 0x42, 0x36, 0xe3, 0x1d, 0x53, 0x10, 0x9f, 0xd6, 0x67, 0x67, 0xd9, - 0x9c, 0xb6, 0x68, 0x3d, 0x4c, 0xd3, 0x2d, 0xa9, 0x8c, 0xfe, 0x3f, 0x2a, - 0x9b, 0x8f, 0x21, 0x9b, 0x5e, 0xcd, 0x91, 0x4d, 0x16, 0x51, 0x66, 0xfe, - 0xbb, 0x77, 0x41, 0xbe, 0x27, 0x64, 0x53, 0x5d, 0x94, 0x99, 0x8d, 0xc6, - 0x77, 0xe8, 0x21, 0xd3, 0xba, 0x2d, 0xc3, 0xf5, 0x42, 0xa1, 0xec, 0x1b, - 0x92, 0x77, 0x3e, 0x25, 0xe4, 0xb9, 0x47, 0xd9, 0xfa, 0xda, 0x43, 0xe6, - 0xdd, 0xf6, 0x93, 0xcd, 0x4a, 0xe7, 0x28, 0xe3, 0x05, 0x17, 0x97, 0xd7, - 0xfc, 0xf4, 0xfd, 0xf7, 0x97, 0x4d, 0xdc, 0x24, 0xd3, 0xfd, 0xe1, 0x72, - 0x9f, 0x9e, 0x1e, 0xde, 0x2b, 0x9a, 0x15, 0xaf, 0x2f, 0xd3, 0x91, 0x5a, - 0xf3, 0xbf, 0x43, 0x78, 0x56, 0x1a, 0x5f, 0x14, 0x87, 0xa4, 0x67, 0x55, - 0xc9, 0xf7, 0x2d, 0x16, 0x9e, 0x17, 0xaf, 0xff, 0xa5, 0x4a, 0x93, 0xe6, - 0x03, 0x42, 0x19, 0x3f, 0x4c, 0xe2, 0x26, 0x84, 0x7c, 0xf1, 0x7a, 0xaf, - 0xf0, 0xee, 0x9b, 0x86, 0xeb, 0xf3, 0x25, 0xed, 0x9a, 0xab, 0xf3, 0x73, - 0x72, 0xff, 0xc6, 0xeb, 0xc8, 0xd7, 0xc4, 0xf7, 0x89, 0xfd, 0xb8, 0xbe, - 0x3c, 0xf6, 0xe2, 0xda, 0xba, 0x84, 0xcc, 0x3f, 0x94, 0xbd, 0xfb, 0x7b, - 0x32, 0x4f, 0x85, 0x6c, 0xba, 0xf7, 0xa0, 0x3c, 0x97, 0x57, 0x49, 0xd2, - 0x5c, 0xda, 0x3e, 0xec, 0x0c, 0xde, 0xae, 0xc3, 0xc3, 0xa7, 0x3b, 0xea, - 0xbc, 0xfa, 0xa7, 0x3f, 0x96, 0x0a, 0x9e, 0x82, 0x77, 0x7a, 0xa3, 0xf1, - 0x6e, 0x18, 0xbc, 0x63, 0xda, 0x00, 0x1f, 0xc8, 0x99, 0x8b, 0x77, 0xe9, - 0x3d, 0xb0, 0xa4, 0x7d, 0x27, 0xac, 0x7e, 0x3c, 0x12, 0x9b, 0x76, 0xac, - 0x8a, 0xa5, 0x33, 0x23, 0xf0, 0xee, 0xfe, 0x58, 0xac, 0x3a, 0xec, 0x99, - 0x3c, 0xab, 0x2f, 0xde, 0xd1, 0xe5, 0xb1, 0x06, 0xd9, 0x61, 0xcb, 0x14, - 0x53, 0x93, 0xfb, 0x11, 0xab, 0x63, 0xa9, 0xe9, 0x27, 0x54, 0xaa, 0x3c, - 0x37, 0xa7, 0xfa, 0x40, 0x64, 0xff, 0xe4, 0xfa, 0x22, 0x5a, 0x86, 0xdd, - 0x70, 0xfb, 0x44, 0x74, 0x26, 0x93, 0x76, 0x43, 0xa6, 0x0a, 0x6d, 0xae, - 0x07, 0x94, 0x1f, 0xe1, 0x76, 0x3e, 0x31, 0x17, 0x7f, 0x33, 0x96, 0x26, - 0x6c, 0x82, 0x0f, 0x27, 0xcd, 0xc6, 0x3b, 0xde, 0x8b, 0xc8, 0x0e, 0x2b, - 0xe5, 0xf1, 0x6d, 0x2c, 0x85, 0xde, 0x0c, 0x4b, 0x97, 0xaf, 0xc7, 0x3b, - 0xf5, 0x0d, 0x80, 0xb5, 0xf1, 0x4e, 0x73, 0x07, 0x6c, 0x7e, 0x73, 0x42, - 0x08, 0x29, 0x3a, 0x63, 0xb5, 0x7a, 0x34, 0x0f, 0xfa, 0x0c, 0x4b, 0x89, - 0x3f, 0xc2, 0x3b, 0xff, 0xe7, 0xb0, 0x59, 0x11, 0x58, 0x82, 0xdb, 0x17, - 0x4b, 0x04, 0xc1, 0x63, 0x60, 0x03, 0xac, 0xbd, 0xd9, 0x08, 0x8f, 0x83, - 0xd4, 0xcc, 0x26, 0x8d, 0x7b, 0x2e, 0xfc, 0x6e, 0x8c, 0x77, 0xfe, 0xf3, - 0x82, 0x51, 0xa1, 0x9c, 0xe9, 0x64, 0x52, 0xcb, 0xe1, 0x58, 0xda, 0x39, - 0x1c, 0x8f, 0xd9, 0xc9, 0x58, 0x8a, 0x76, 0x1f, 0x1e, 0x2f, 0x03, 0x43, - 0x5d, 0x63, 0x9b, 0xaf, 0x81, 0xc7, 0x12, 0x58, 0x92, 0x05, 0x95, 0x87, - 0x7b, 0x17, 0xc5, 0xd2, 0xa2, 0x89, 0xa1, 0x8c, 0x0f, 0xa9, 0x6d, 0xda, - 0xd2, 0x1f, 0xef, 0xca, 0xa7, 0x61, 0xc9, 0x51, 0xdf, 0xf0, 0xdc, 0xe5, - 0x28, 0x37, 0x3d, 0x6a, 0x14, 0x33, 0xc2, 0xef, 0xd2, 0xb9, 0xf8, 0xfe, - 0x64, 0x63, 0xbc, 0x4c, 0xad, 0x9e, 0xa6, 0x59, 0x36, 0x89, 0xef, 0x5a, - 0x50, 0xaf, 0x65, 0xb0, 0xf9, 0x40, 0x1a, 0xca, 0xca, 0x8a, 0xa1, 0x7f, - 0xad, 0x8a, 0xb7, 0x00, 0x2b, 0xe1, 0xc3, 0xe0, 0xef, 0x53, 0x7d, 0x28, - 0xbc, 0x25, 0x98, 0x8c, 0x35, 0x01, 0x87, 0x26, 0x71, 0x87, 0x51, 0xdb, - 0x23, 0x54, 0xc4, 0x15, 0xd8, 0x9c, 0xe8, 0x54, 0x8a, 0x0f, 0xf7, 0x2d, - 0x43, 0xb9, 0xe6, 0x2a, 0xb6, 0x6d, 0xd9, 0x21, 0xb4, 0x4e, 0x58, 0xab, - 0xf2, 0x43, 0x2c, 0x11, 0xfb, 0x2e, 0xa6, 0xe7, 0x45, 0x88, 0xf1, 0xdf, - 0xc9, 0xc5, 0xf7, 0xc7, 0x92, 0xa8, 0xe9, 0x78, 0x9e, 0xef, 0x4e, 0xa5, - 0x99, 0xdf, 0xc9, 0xb8, 0x0d, 0x57, 0xc2, 0x26, 0x42, 0x53, 0xf1, 0xf8, - 0xcf, 0x9b, 0x85, 0xb5, 0x36, 0x1e, 0xc1, 0xde, 0xb8, 0xf6, 0x09, 0xd7, - 0xeb, 0x61, 0x49, 0x5f, 0x91, 0x59, 0xc6, 0x1d, 0x78, 0x8d, 0xda, 0x16, - 0xd3, 0xa2, 0xef, 0x60, 0x69, 0xe6, 0x75, 0xf8, 0x50, 0xe0, 0x9a, 0x40, - 0x77, 0x7c, 0x60, 0xb3, 0xcc, 0xd4, 0xea, 0x79, 0xdc, 0x57, 0x5d, 0x4a, - 0x9e, 0x91, 0xe2, 0x2d, 0xbc, 0x66, 0x1d, 0x82, 0xd7, 0xa8, 0x22, 0xb3, - 0x48, 0xb0, 0x04, 0x6e, 0x18, 0x96, 0xb0, 0x0d, 0xad, 0x53, 0xe6, 0x28, - 0x4c, 0xd3, 0xeb, 0x69, 0x9b, 0x2e, 0xc4, 0x6b, 0xe3, 0x39, 0x98, 0x6e, - 0xef, 0x54, 0x27, 0x7d, 0x11, 0x16, 0xc5, 0xa6, 0x84, 0x97, 0x87, 0xeb, - 0xa8, 0x69, 0xd9, 0xa0, 0x24, 0xfd, 0x7d, 0x98, 0x3e, 0xc7, 0xb4, 0x77, - 0x60, 0x93, 0xc2, 0xdf, 0x61, 0xc9, 0x65, 0x34, 0x4d, 0x9d, 0x86, 0xc7, - 0xd0, 0x6c, 0x3c, 0x66, 0xee, 0x25, 0x33, 0x23, 0xfa, 0x84, 0x6a, 0x8d, - 0xce, 0x19, 0x58, 0xfa, 0x19, 0xcd, 0x1f, 0x3f, 0xc6, 0x63, 0xb1, 0x2f, - 0xf5, 0xb1, 0x6e, 0xf8, 0x6d, 0x0a, 0xbf, 0x0f, 0xe3, 0xf6, 0x5e, 0x89, - 0x6a, 0xcd, 0xec, 0xf5, 0x64, 0x34, 0xfe, 0x89, 0xf0, 0xdb, 0x3d, 0xfc, - 0xfe, 0x2f, 0xc5, 0x9a, 0xbf, 0x4b, 0x31, 0x2f, 0x53, 0x86, 0x1e, 0x58, - 0x72, 0x7f, 0x20, 0xf5, 0x5d, 0x36, 0x7f, 0x80, 0x25, 0xe2, 0xe0, 0xb6, - 0x8a, 0x73, 0x71, 0x22, 0xee, 0xef, 0xcb, 0xc2, 0x75, 0x34, 0x51, 0x5c, - 0xa3, 0x20, 0xdf, 0xcd, 0x64, 0xe6, 0xc4, 0xb1, 0x1d, 0xe3, 0x3b, 0x9c, - 0x4e, 0xa6, 0xbd, 0x00, 0xf3, 0x17, 0xa7, 0x62, 0xe9, 0xf3, 0x16, 0xb8, - 0xaf, 0x4f, 0x0d, 0xf7, 0x1e, 0x20, 0xa3, 0x2b, 0xe3, 0x43, 0xf9, 0x47, - 0x91, 0xf5, 0x57, 0x7c, 0xe7, 0x8f, 0xb0, 0x84, 0x3c, 0xc5, 0x95, 0x64, - 0xbc, 0xdd, 0x76, 0x78, 0x3d, 0xdc, 0x05, 0x3b, 0xa2, 0x58, 0x07, 0x5b, - 0x4c, 0x74, 0xc6, 0xf4, 0xb2, 0x9e, 0x16, 0x68, 0x2e, 0xd5, 0xed, 0x5b, - 0x14, 0x07, 0x36, 0xe9, 0xdc, 0x91, 0xcc, 0x84, 0x70, 0x57, 0x2a, 0xf9, - 0xc0, 0x91, 0x98, 0x6e, 0xc5, 0xb9, 0xb3, 0x27, 0x6e, 0xdb, 0x78, 0x50, - 0xbe, 0x1b, 0xb6, 0x16, 0xf8, 0x38, 0xc9, 0x73, 0x3d, 0xd6, 0xa0, 0xfc, - 0x25, 0xbc, 0x43, 0xd1, 0xc1, 0xff, 0xe1, 0x98, 0x7f, 0x5b, 0x22, 0x5c, - 0xef, 0x40, 0x36, 0x56, 0xce, 0xc2, 0xfd, 0xd8, 0x01, 0x8f, 0x95, 0xfb, - 0xb1, 0x16, 0xa0, 0x2b, 0xa6, 0x23, 0x23, 0x0a, 0xde, 0x23, 0xe2, 0x44, - 0xcc, 0x07, 0xf4, 0xc3, 0x1a, 0xab, 0x7d, 0xf1, 0x9c, 0x1e, 0x81, 0xfb, - 0x7e, 0x65, 0x60, 0xb3, 0xf6, 0x58, 0x6d, 0xf3, 0x4e, 0x71, 0x19, 0xff, - 0x8f, 0x94, 0x39, 0xcf, 0x33, 0x77, 0xd3, 0xb1, 0xea, 0x70, 0x6d, 0xdc, - 0xe9, 0xdd, 0xf1, 0x84, 0x5d, 0x11, 0xab, 0xbf, 0x3e, 0xc6, 0x13, 0xf6, - 0xbf, 0xb0, 0x4d, 0xe5, 0x6f, 0xb0, 0xea, 0x60, 0x37, 0xdc, 0x80, 0xcf, - 0xe0, 0x46, 0xdd, 0x11, 0x13, 0x9c, 0x6e, 0x98, 0xd1, 0xfb, 0x53, 0x78, - 0xd9, 0xdb, 0x30, 0xd3, 0x48, 0x78, 0x99, 0x6b, 0x0a, 0xea, 0xb7, 0x38, - 0x95, 0x76, 0xc0, 0x11, 0xb3, 0x92, 0xfb, 0xf5, 0xf0, 0x08, 0x95, 0xf6, - 0xd3, 0xe0, 0xc6, 0x8a, 0xd7, 0x83, 0x0a, 0xf2, 0x34, 0x51, 0xcd, 0xd0, - 0xa7, 0xe8, 0x84, 0xeb, 0x3e, 0x26, 0x89, 0xfb, 0x84, 0x4a, 0x75, 0xd4, - 0xc2, 0x49, 0x7c, 0xa3, 0x58, 0x1c, 0x0f, 0xd8, 0x83, 0xc9, 0x6c, 0xcc, - 0x23, 0x76, 0xc7, 0x04, 0xea, 0x70, 0xdc, 0x0f, 0x07, 0x63, 0x66, 0xfa, - 0x46, 0xca, 0x6d, 0xf7, 0xe2, 0x82, 0x25, 0x3c, 0xb0, 0x6e, 0x08, 0x79, - 0x16, 0x0f, 0x75, 0x8f, 0x66, 0x2a, 0xff, 0xc2, 0xea, 0xb4, 0x43, 0x72, - 0xf9, 0x0f, 0x0d, 0xf5, 0x8f, 0x9b, 0x90, 0xe8, 0x71, 0x67, 0x5f, 0x6c, - 0x3a, 0xd2, 0x0b, 0x13, 0x85, 0x25, 0xf0, 0xe2, 0x72, 0x24, 0xee, 0xdf, - 0x31, 0x78, 0xc1, 0x5f, 0x11, 0xb7, 0xff, 0x27, 0x54, 0x33, 0x7b, 0x69, - 0xdc, 0x01, 0x78, 0x31, 0x3a, 0x97, 0x4a, 0x26, 0x11, 0x1a, 0x33, 0x6b, - 0x49, 0xb1, 0x0c, 0x1e, 0x6f, 0x7d, 0xc8, 0xbc, 0x18, 0xcc, 0xc4, 0x6a, - 0xb1, 0x13, 0xc8, 0x08, 0xe1, 0x9a, 0x64, 0xe6, 0x5e, 0x87, 0x62, 0x55, - 0x6b, 0xdc, 0x50, 0xad, 0x47, 0xc6, 0x9c, 0x7f, 0x3b, 0xfc, 0xbe, 0x9e, - 0x3c, 0x23, 0x7a, 0xcd, 0x20, 0xe4, 0xb9, 0x13, 0xf8, 0x31, 0x95, 0x0c, - 0x7c, 0x8a, 0x11, 0xd8, 0xbb, 0xc5, 0x32, 0x78, 0xd1, 0x98, 0x80, 0x99, - 0x93, 0x19, 0xcc, 0xbb, 0x3d, 0x6a, 0x64, 0xca, 0xa7, 0xe7, 0xe2, 0x47, - 0x90, 0x8d, 0xf1, 0x57, 0x28, 0x46, 0x9a, 0x26, 0x3d, 0x8b, 0x32, 0x9d, - 0x6a, 0x66, 0x7f, 0x11, 0x4c, 0x03, 0x4e, 0xc0, 0x9b, 0xf1, 0x35, 0x72, - 0xf7, 0xd3, 0xb2, 0x62, 0x18, 0x51, 0xab, 0xe2, 0x2d, 0xc0, 0x6e, 0x98, - 0xde, 0x0c, 0xc1, 0x1b, 0xd2, 0xd5, 0x5a, 0xa1, 0xcc, 0x4b, 0xf0, 0x82, - 0xb4, 0x3a, 0x7e, 0xc7, 0xcd, 0x68, 0xdc, 0x2d, 0xdc, 0x20, 0xbc, 0x38, - 0x8c, 0xa4, 0x7a, 0x13, 0x3e, 0x93, 0xf2, 0xbe, 0x8d, 0x6d, 0x9b, 0x57, - 0xb9, 0xf7, 0xc7, 0x0b, 0xe9, 0xad, 0xc0, 0x92, 0x98, 0x01, 0x7d, 0x04, - 0x33, 0x09, 0x65, 0x36, 0xb2, 0x31, 0x3e, 0xcf, 0x48, 0x8c, 0xc0, 0x73, - 0x74, 0xc3, 0x50, 0xb7, 0xbc, 0x6d, 0xa8, 0xb0, 0x39, 0xc1, 0x0a, 0xb8, - 0x4d, 0x5f, 0xc7, 0x26, 0x89, 0x7f, 0x2c, 0x79, 0x4e, 0x2d, 0x14, 0x31, - 0xf4, 0x0b, 0x51, 0xce, 0x30, 0x5f, 0x8e, 0x17, 0xce, 0xc5, 0x29, 0x36, - 0x69, 0x89, 0x78, 0x15, 0x9b, 0x44, 0x6c, 0x8f, 0xe7, 0xdc, 0x3d, 0x21, - 0x7e, 0x14, 0x9e, 0x3b, 0x7b, 0xe2, 0x85, 0xf5, 0x9e, 0xc2, 0xdc, 0xc6, - 0xb2, 0x98, 0x6e, 0xbe, 0x8f, 0x69, 0x53, 0x3d, 0x9c, 0x15, 0xf2, 0xbc, - 0x42, 0xf5, 0x9c, 0x8a, 0x38, 0x1e, 0xcf, 0x85, 0x5f, 0x50, 0xff, 0xfc, - 0xc5, 0xa7, 0x78, 0xbe, 0xf7, 0xac, 0x91, 0x66, 0x1f, 0xcc, 0xb0, 0xdd, - 0x84, 0xfb, 0xe5, 0x30, 0xcc, 0xf4, 0x37, 0xd7, 0x7c, 0x6c, 0x1a, 0x5e, - 0x6f, 0xdf, 0xc3, 0xeb, 0xc3, 0x9f, 0x43, 0xfc, 0xc2, 0xa5, 0x39, 0x2a, - 0x31, 0x19, 0xd3, 0xbe, 0xad, 0xb1, 0x87, 0xa5, 0x14, 0xbf, 0xc2, 0xe3, - 0x7c, 0x73, 0x2a, 0xcd, 0x37, 0x8b, 0xd0, 0x0b, 0xd3, 0xdb, 0xa6, 0x10, - 0xc6, 0xe1, 0xfe, 0x7e, 0xa3, 0x34, 0x47, 0x86, 0x3b, 0xb0, 0x10, 0x28, - 0x7a, 0x34, 0xeb, 0x87, 0xdb, 0xa4, 0xde, 0x39, 0x87, 0x68, 0xd6, 0x33, - 0x2f, 0x1e, 0xda, 0xd6, 0xc6, 0x6b, 0xe4, 0x5a, 0xcc, 0xdb, 0x26, 0xf5, - 0xf3, 0xdc, 0x75, 0x1c, 0x23, 0xf5, 0xec, 0xdc, 0xf3, 0xef, 0xb0, 0x05, - 0xee, 0x93, 0x14, 0x91, 0xd1, 0xff, 0x41, 0x9d, 0xb2, 0x26, 0xe1, 0xbe, - 0xdc, 0x8c, 0xfa, 0xfd, 0x95, 0xe2, 0x26, 0x2a, 0x85, 0x8c, 0x67, 0x60, - 0x33, 0xd6, 0x57, 0xf1, 0xdc, 0x28, 0x32, 0xd3, 0x6b, 0x29, 0x2e, 0xc7, - 0xef, 0x1c, 0x37, 0xea, 0x7b, 0x52, 0x79, 0x7e, 0x6a, 0x24, 0x16, 0x60, - 0xf5, 0xc4, 0x0c, 0xfc, 0x2c, 0xcc, 0x3b, 0xf6, 0xc5, 0x63, 0x7a, 0x77, - 0x8a, 0x85, 0xba, 0x87, 0x63, 0xb3, 0xa9, 0xdf, 0x53, 0x69, 0x8e, 0x15, - 0xf1, 0xb7, 0x90, 0x3f, 0x9a, 0xc6, 0xed, 0x49, 0x66, 0xc6, 0x18, 0x4d, - 0xbb, 0x8e, 0xc1, 0x1b, 0x93, 0xe8, 0x01, 0xaf, 0x5d, 0x08, 0xb5, 0x36, - 0x6c, 0xb1, 0x9f, 0xdb, 0xe1, 0x8d, 0xd6, 0x14, 0xcc, 0x9b, 0xed, 0x87, - 0xcd, 0x91, 0xae, 0x01, 0x7e, 0xdd, 0x1e, 0x33, 0xe6, 0x65, 0xc4, 0xa5, - 0x09, 0x0f, 0xf6, 0x2d, 0xc2, 0xff, 0x07, 0xb0, 0xc4, 0xb3, 0xa9, 0x20, - 0xed, 0xf3, 0x98, 0xb0, 0xed, 0x8a, 0x17, 0x95, 0x3d, 0xc9, 0x18, 0xf7, - 0x1e, 0x78, 0x17, 0x72, 0x7a, 0x08, 0xb3, 0xf0, 0x0e, 0x63, 0x16, 0x19, - 0x03, 0xbd, 0x1c, 0x96, 0xcc, 0x8e, 0x4d, 0xca, 0x1c, 0x4c, 0x66, 0x0f, - 0x78, 0x7c, 0xf8, 0x2d, 0x62, 0xc2, 0x3f, 0xa4, 0xd8, 0xf5, 0x5d, 0xe7, - 0xe4, 0xfe, 0xfc, 0x40, 0x2f, 0xaa, 0x19, 0xfa, 0x14, 0xdb, 0xe2, 0xf7, - 0x49, 0x27, 0xe1, 0x14, 0xfc, 0xae, 0x11, 0xcb, 0x27, 0xf1, 0x8d, 0xa0, - 0x3d, 0x1e, 0x98, 0xc3, 0x28, 0xde, 0xa8, 0x44, 0x8c, 0xc5, 0x83, 0xf6, - 0x4c, 0xdc, 0xae, 0x7b, 0x51, 0x2d, 0xa9, 0x6c, 0x2a, 0xc9, 0xfb, 0x02, - 0xde, 0xbd, 0xbd, 0x4b, 0xf5, 0x81, 0xb7, 0xb7, 0xc8, 0x18, 0x51, 0xb0, - 0x14, 0x66, 0x30, 0x66, 0xba, 0xe3, 0x80, 0x1c, 0x89, 0x77, 0xdd, 0xe3, - 0xf1, 0x6e, 0xfe, 0xa7, 0x78, 0x00, 0xc7, 0x03, 0x5e, 0x97, 0xe2, 0x71, - 0xd4, 0x13, 0x33, 0xc6, 0x2b, 0xe2, 0x89, 0x50, 0x0f, 0x37, 0x61, 0xc6, - 0x7f, 0x3a, 0xb6, 0x2b, 0x3b, 0x92, 0x6c, 0x61, 0xfa, 0x0b, 0xc5, 0x87, - 0x54, 0x63, 0x88, 0x13, 0xa2, 0x63, 0xc8, 0xf7, 0x34, 0x5e, 0xb8, 0xd7, - 0x0f, 0xe5, 0x82, 0x17, 0xa9, 0x0f, 0x6a, 0x3c, 0x7f, 0x1d, 0x2a, 0x25, - 0x93, 0x29, 0x73, 0xde, 0x1b, 0x8f, 0xe5, 0xd4, 0x2e, 0xbc, 0x5f, 0x78, - 0x76, 0x53, 0x08, 0xdf, 0xc7, 0x63, 0xb2, 0x4f, 0xad, 0x97, 0xc4, 0xed, - 0x78, 0x23, 0xb6, 0x69, 0x3c, 0x1b, 0xcf, 0xc1, 0x1e, 0x25, 0x69, 0x3b, - 0xd0, 0xd8, 0xe2, 0x1c, 0x5d, 0x98, 0x8d, 0xab, 0x91, 0x26, 0xba, 0xbb, - 0xfc, 0x7e, 0x8d, 0x34, 0x6b, 0x26, 0xff, 0x47, 0x53, 0x6d, 0xb7, 0xff, - 0x26, 0xb6, 0xbf, 0x8c, 0xcf, 0xb9, 0xa4, 0x81, 0xba, 0xb5, 0x36, 0x2e, - 0xc1, 0xf3, 0xe9, 0x32, 0xcc, 0x3c, 0x9d, 0xd9, 0x8c, 0xbc, 0x8b, 0x52, - 0xbc, 0x99, 0xbf, 0x01, 0xd3, 0xca, 0x43, 0xb0, 0x7b, 0xb6, 0x22, 0x62, - 0x5f, 0x86, 0x0f, 0xf1, 0xc2, 0xd2, 0x8d, 0x6a, 0xc6, 0xef, 0x11, 0xb2, - 0xc3, 0xd2, 0x79, 0x44, 0xcd, 0x5e, 0x5e, 0x82, 0x35, 0x02, 0x6f, 0x14, - 0xb6, 0xc7, 0x82, 0x8e, 0xc8, 0xcc, 0xbc, 0x84, 0xb5, 0x4c, 0x45, 0x88, - 0xf1, 0x65, 0x1b, 0xf4, 0xd7, 0xf1, 0x78, 0x1b, 0x4c, 0x25, 0x2d, 0x8d, - 0xff, 0x3f, 0xc4, 0x34, 0x67, 0x43, 0xbc, 0xa9, 0x3e, 0xb8, 0xa4, 0x9c, - 0x32, 0xbc, 0x4f, 0xf1, 0xe1, 0xd9, 0x15, 0x28, 0xb7, 0xeb, 0xbd, 0x12, - 0x33, 0x20, 0xbb, 0x63, 0x26, 0xac, 0x96, 0x4b, 0xcb, 0x3b, 0x30, 0xbd, - 0xdd, 0x8b, 0x6c, 0x3e, 0xcf, 0x09, 0xff, 0xf7, 0xa0, 0xdc, 0xde, 0x3c, - 0xe2, 0x2c, 0x2c, 0x01, 0xfc, 0x2d, 0xde, 0xdc, 0xed, 0x50, 0x23, 0x2d, - 0x64, 0xe7, 0x76, 0xca, 0xce, 0x2c, 0xad, 0x8d, 0x25, 0x64, 0x7f, 0xa4, - 0x9a, 0x81, 0x2d, 0xc3, 0x2d, 0x14, 0xbb, 0x54, 0x8c, 0xb8, 0x9b, 0x4a, - 0xed, 0xcd, 0x93, 0x98, 0xa6, 0xe6, 0x99, 0xbc, 0x7a, 0x88, 0x2e, 0x8c, - 0x47, 0x63, 0x06, 0xbd, 0x48, 0xf0, 0x54, 0x0b, 0xc2, 0xf4, 0xb4, 0x03, - 0xc5, 0x9a, 0x58, 0x30, 0x4d, 0xaa, 0xf7, 0x85, 0xc3, 0x85, 0xb0, 0x76, - 0xa3, 0x57, 0x08, 0x3f, 0xc4, 0x73, 0xa4, 0x16, 0xfd, 0x89, 0x98, 0x88, - 0x05, 0x7d, 0xa7, 0xe0, 0x35, 0x66, 0x00, 0x99, 0x8b, 0xd0, 0xf9, 0x8d, - 0x0d, 0xb1, 0x90, 0xa8, 0x0b, 0xc5, 0x2e, 0xa2, 0x17, 0x34, 0xda, 0x51, - 0xdd, 0xd6, 0xf1, 0xba, 0xec, 0xac, 0x4b, 0x9a, 0x6e, 0x2e, 0x8d, 0xf5, - 0x57, 0x8a, 0x3c, 0x1f, 0x76, 0x3a, 0xde, 0x90, 0xdd, 0x85, 0x0f, 0x54, - 0x3f, 0x45, 0xa5, 0x2b, 0xd8, 0x79, 0xc1, 0x7b, 0x78, 0x9c, 0x1c, 0x80, - 0x69, 0x73, 0x27, 0x2a, 0xb5, 0x23, 0x2f, 0xe3, 0x31, 0xb0, 0x27, 0xa6, - 0xcd, 0xd7, 0x86, 0xd0, 0x19, 0xd3, 0x8d, 0xed, 0xa9, 0x76, 0x3c, 0x02, - 0xa6, 0x69, 0x53, 0xb0, 0x00, 0x69, 0xd5, 0x82, 0xfb, 0x6f, 0x62, 0xba, - 0xb2, 0x1f, 0x1e, 0xab, 0xab, 0x50, 0xb9, 0x09, 0x5a, 0x03, 0x6b, 0x24, - 0x8e, 0x27, 0x13, 0x6c, 0xbd, 0x8d, 0xf9, 0xad, 0x01, 0x35, 0xde, 0xe7, - 0xf7, 0xe1, 0x7d, 0xae, 0xa5, 0x52, 0x6b, 0x3c, 0x0d, 0xd3, 0xaf, 0xad, - 0x80, 0x3b, 0xdb, 0x63, 0xe2, 0x51, 0xb6, 0xab, 0xef, 0x85, 0x89, 0xf5, - 0xd0, 0xf0, 0xff, 0x24, 0xdc, 0x09, 0xbd, 0xc2, 0xfd, 0x4e, 0xa1, 0xf2, - 0x3f, 0x4e, 0xf2, 0x4c, 0x0c, 0xbf, 0xf9, 0x5d, 0x78, 0x6f, 0xac, 0x2a, - 0x89, 0x07, 0x0c, 0x66, 0x62, 0xc2, 0x1b, 0x77, 0x7f, 0xef, 0x63, 0xe6, - 0xa6, 0x5b, 0x92, 0x47, 0xa1, 0xf2, 0x53, 0x70, 0x23, 0x8c, 0x2c, 0xa9, - 0xe7, 0xf3, 0x14, 0x0f, 0x84, 0x95, 0x92, 0xfb, 0x0b, 0x02, 0x9d, 0xa9, - 0x94, 0x24, 0xe6, 0x4d, 0x5a, 0xc0, 0x4c, 0x5a, 0x7a, 0xc0, 0x6b, 0x03, - 0xdc, 0xfe, 0x8d, 0x7a, 0x36, 0xb8, 0x00, 0xab, 0xe6, 0xf2, 0x92, 0xab, - 0xf3, 0xa8, 0x3e, 0x70, 0xf4, 0x39, 0x9e, 0x9c, 0x6b, 0x61, 0x46, 0xb8, - 0x17, 0x95, 0x92, 0xca, 0x5e, 0x98, 0xc0, 0x0f, 0xc9, 0xe5, 0x5b, 0x0d, - 0xab, 0x80, 0x1f, 0xa0, 0x9a, 0x29, 0xfc, 0x36, 0x95, 0x1b, 0x89, 0x81, - 0x58, 0x7a, 0x37, 0x2c, 0x89, 0x5b, 0x8b, 0xca, 0x05, 0xf7, 0xd9, 0xf0, - 0x9b, 0x97, 0xb2, 0x82, 0x17, 0xb0, 0x27, 0x30, 0x33, 0x9a, 0x6f, 0x3f, - 0x70, 0xfb, 0xa4, 0xea, 0xd6, 0x59, 0x98, 0x20, 0x6f, 0x8d, 0x19, 0x94, - 0x89, 0xd4, 0x3f, 0x4c, 0x1b, 0xb1, 0x75, 0x48, 0xbf, 0x3d, 0x5e, 0x08, - 0x4e, 0x26, 0xdb, 0x1c, 0x82, 0x0f, 0x3b, 0xce, 0xce, 0xe5, 0x99, 0x4a, - 0x26, 0xfd, 0x7d, 0x3b, 0xa9, 0x4b, 0x1f, 0xbc, 0x81, 0x99, 0x8b, 0xd5, - 0xe8, 0x27, 0xe1, 0x83, 0x2e, 0x51, 0x0b, 0xb5, 0x28, 0x96, 0x9a, 0x6d, - 0x42, 0xd6, 0xee, 0x9b, 0x62, 0xe6, 0xbf, 0x51, 0xaf, 0x2d, 0x9f, 0x62, - 0x29, 0xfb, 0xd0, 0x90, 0xb7, 0xc8, 0x47, 0xf0, 0xb9, 0x54, 0x9b, 0x36, - 0xe5, 0xd1, 0x0e, 0xab, 0xdf, 0x6f, 0xa7, 0x5a, 0xc2, 0x92, 0xc7, 0x52, - 0x54, 0x1f, 0xac, 0x2e, 0xc3, 0x59, 0x78, 0x21, 0xdd, 0xb5, 0xc1, 0xf4, - 0x0b, 0x0a, 0x73, 0x93, 0xdf, 0xdf, 0xe0, 0xf6, 0xde, 0xb2, 0x3c, 0x79, - 0x05, 0x4e, 0xa2, 0xd8, 0x73, 0xd0, 0x6c, 0xbc, 0xa9, 0xec, 0x8f, 0x0f, - 0x42, 0x35, 0xe2, 0xf9, 0x26, 0xc5, 0xa3, 0x78, 0x21, 0x3f, 0x04, 0xcf, - 0x97, 0x88, 0x8b, 0x43, 0xdd, 0xd6, 0x29, 0xc8, 0x73, 0x30, 0xd9, 0xb7, - 0x00, 0x1a, 0xc1, 0x1d, 0x78, 0x9e, 0x17, 0x49, 0xf3, 0xb6, 0xc5, 0xe3, - 0x29, 0xef, 0xad, 0x24, 0xc5, 0x68, 0xac, 0xdd, 0xea, 0x95, 0xc4, 0xcd, - 0xa2, 0xd2, 0xdb, 0xcc, 0xe7, 0x64, 0x07, 0xa3, 0x9a, 0x83, 0x47, 0xf1, - 0x7c, 0x4d, 0xeb, 0xb6, 0x50, 0x88, 0x2b, 0xa3, 0x7d, 0xaf, 0x87, 0x3a, - 0x9d, 0x84, 0x17, 0xbf, 0x5a, 0x07, 0xae, 0x6e, 0x0f, 0xf5, 0xdc, 0x88, - 0x4a, 0x09, 0xe0, 0x75, 0x58, 0x2a, 0xd8, 0x0d, 0xd3, 0xb4, 0x22, 0xc4, - 0x8d, 0xf5, 0x04, 0xdc, 0xc7, 0x8f, 0x61, 0xad, 0x5a, 0x4b, 0x0f, 0x34, - 0xb7, 0xc3, 0xc2, 0x82, 0xf8, 0xcd, 0x80, 0x14, 0x77, 0x54, 0xa5, 0xce, - 0x70, 0x1b, 0xb5, 0x37, 0xee, 0xd3, 0xa9, 0x96, 0x2a, 0x37, 0x47, 0xda, - 0x19, 0x71, 0x00, 0x1e, 0x8b, 0x3b, 0x61, 0xba, 0x9b, 0xa7, 0x79, 0xf5, - 0x10, 0x85, 0x12, 0x4f, 0x52, 0xee, 0x87, 0x7d, 0x22, 0x99, 0xe9, 0x49, - 0x19, 0x9e, 0xa4, 0xf1, 0x79, 0x99, 0x47, 0x0f, 0xbc, 0xe9, 0xee, 0x49, - 0x26, 0xe8, 0xf9, 0x47, 0x0b, 0xcb, 0x6a, 0x2e, 0xae, 0xc5, 0xc2, 0x9d, - 0xd3, 0x30, 0xad, 0x58, 0xb3, 0x76, 0xf2, 0xf9, 0x8e, 0x47, 0xa9, 0xa6, - 0x1f, 0xf1, 0xf0, 0xed, 0x78, 0x6a, 0x23, 0xf6, 0x65, 0x23, 0xfd, 0x55, - 0x0b, 0xfb, 0xe0, 0xf9, 0xb3, 0x3f, 0x3e, 0x40, 0xbe, 0x1c, 0x8d, 0xad, - 0x73, 0x73, 0xa9, 0xbf, 0x81, 0x00, 0x0b, 0x5c, 0x36, 0xc6, 0x6b, 0xec, - 0x75, 0x05, 0xf7, 0xaf, 0xc4, 0x9b, 0xf0, 0x3e, 0x98, 0x16, 0xcc, 0xc0, - 0xbc, 0xd7, 0x11, 0x98, 0x6e, 0x14, 0xd1, 0x8e, 0xb3, 0x71, 0xff, 0x3d, - 0x84, 0xf9, 0x97, 0xa2, 0x03, 0xd1, 0x97, 0x62, 0xfa, 0xb0, 0x2f, 0x95, - 0x82, 0xb7, 0x76, 0x58, 0xeb, 0x3f, 0x9e, 0xcc, 0xe4, 0xf9, 0xfc, 0xf0, - 0xfb, 0x01, 0xb5, 0xad, 0x35, 0xba, 0x50, 0x5b, 0x08, 0x08, 0xb8, 0x51, - 0x26, 0x51, 0xdb, 0xe6, 0x33, 0x75, 0x9d, 0xd8, 0x8d, 0x4a, 0xd5, 0xf7, - 0x6c, 0xcc, 0x88, 0xa5, 0x8b, 0xd9, 0xd6, 0x98, 0x80, 0xa7, 0x44, 0x68, - 0x49, 0x2c, 0xad, 0x4c, 0x3f, 0x38, 0x74, 0x2f, 0x1e, 0xd4, 0xab, 0x63, - 0x26, 0x7c, 0x34, 0x66, 0x34, 0xfa, 0x52, 0x79, 0xf2, 0x7e, 0xad, 0xf0, - 0x9c, 0xe9, 0xb8, 0x31, 0x8a, 0x70, 0x1f, 0xc5, 0x92, 0xc5, 0x1e, 0x21, - 0x6f, 0x6b, 0xef, 0xa6, 0x9f, 0x20, 0xb3, 0x05, 0xcb, 0xc7, 0x4f, 0xc1, - 0x0c, 0x66, 0x3b, 0x2c, 0x7d, 0xc9, 0x13, 0xe3, 0x0b, 0xb1, 0xb4, 0x36, - 0x4a, 0x07, 0x0e, 0xc2, 0xa6, 0x24, 0xf5, 0xec, 0xfe, 0xc1, 0x4c, 0xd8, - 0xb2, 0x98, 0x38, 0x74, 0xcf, 0x85, 0x15, 0x70, 0xfb, 0xc6, 0x81, 0xde, - 0x0d, 0x0f, 0xa8, 0x7a, 0xb6, 0xf2, 0x2f, 0x50, 0x29, 0x05, 0xdb, 0x0a, - 0x4b, 0xba, 0x7f, 0x87, 0x4d, 0x2b, 0xba, 0x93, 0x9d, 0x9c, 0x5e, 0x01, - 0x7b, 0x6a, 0x88, 0x65, 0x76, 0xc2, 0xbb, 0xc6, 0x2b, 0xa8, 0x34, 0x47, - 0x19, 0x15, 0xd2, 0x45, 0x26, 0xa4, 0x1f, 0x5e, 0xcc, 0x6f, 0x4a, 0xd2, - 0x2c, 0x8c, 0x37, 0x7a, 0x5b, 0x92, 0xd9, 0x18, 0xa6, 0xed, 0x17, 0x31, - 0x16, 0x13, 0x8f, 0x3c, 0xd3, 0xfe, 0x32, 0xde, 0xfc, 0x1c, 0x4b, 0xe3, - 0x3b, 0xfe, 0x2f, 0xb0, 0xfa, 0x6a, 0x57, 0x8a, 0x25, 0x88, 0x4f, 0x93, - 0x7d, 0x6c, 0x2b, 0xe2, 0x2e, 0x3c, 0x1e, 0x97, 0xc1, 0x12, 0xa6, 0x55, - 0xf1, 0x22, 0x30, 0x0b, 0xb7, 0xf7, 0xdd, 0x58, 0x2b, 0x74, 0x3c, 0x95, - 0xb6, 0xa7, 0x7d, 0xb0, 0x1a, 0x3e, 0xad, 0xdb, 0x2c, 0xac, 0xed, 0xa8, - 0x65, 0xda, 0x12, 0xb1, 0x2e, 0xde, 0xb1, 0xff, 0x19, 0x33, 0x2f, 0x27, - 0xe0, 0x7e, 0x4f, 0x17, 0xb3, 0x8e, 0xd4, 0xf6, 0xbe, 0x02, 0x66, 0xb6, - 0x87, 0x61, 0x4d, 0x55, 0xfd, 0x0f, 0x1f, 0x54, 0x6e, 0x8e, 0xeb, 0xe1, - 0x49, 0xcc, 0x6c, 0x5e, 0x81, 0xc7, 0x50, 0x2a, 0x71, 0xad, 0xf7, 0x7e, - 0xad, 0x81, 0x46, 0xfa, 0xfd, 0x46, 0x4c, 0x7c, 0x1b, 0x35, 0xc3, 0xa8, - 0xf5, 0xd1, 0x97, 0xbf, 0xe0, 0xf9, 0x37, 0x99, 0x96, 0x9d, 0xcc, 0x3f, - 0x1b, 0x8f, 0x97, 0x74, 0x31, 0xba, 0x0d, 0x2f, 0x3c, 0xd7, 0x60, 0x0d, - 0x12, 0x98, 0x76, 0x1c, 0x89, 0x19, 0x8e, 0x5a, 0x12, 0x98, 0x3c, 0xce, - 0xc5, 0x1b, 0xdc, 0x7c, 0x9e, 0xce, 0xd8, 0xdc, 0xe0, 0x42, 0xb2, 0xb3, - 0x07, 0x45, 0x18, 0x83, 0xe7, 0x48, 0xde, 0x8e, 0x39, 0x1d, 0x63, 0x2b, - 0xe1, 0xf9, 0xdc, 0x5c, 0x8d, 0xc8, 0xe9, 0x78, 0xee, 0x8c, 0xc0, 0xcc, - 0xf2, 0x96, 0xf8, 0x9d, 0x97, 0xa7, 0xda, 0x0b, 0x47, 0x8a, 0xcb, 0xb1, - 0x14, 0xba, 0x96, 0x57, 0x18, 0xb0, 0xa6, 0xe6, 0x23, 0xaa, 0xe9, 0xed, - 0xbd, 0x98, 0x36, 0x95, 0x6d, 0x00, 0x3a, 0x61, 0xc1, 0x4f, 0xdc, 0xe0, - 0x7e, 0x81, 0xdb, 0xbe, 0x3b, 0x56, 0x7b, 0xb7, 0x04, 0x03, 0xb1, 0xfd, - 0xf8, 0x40, 0x2a, 0x25, 0x8c, 0xed, 0xa9, 0x6d, 0x66, 0xf0, 0x0e, 0xd6, - 0xcc, 0xad, 0x57, 0x23, 0x4d, 0x6b, 0x20, 0xda, 0xd0, 0xc6, 0xcd, 0x47, - 0xb4, 0x0f, 0x2e, 0x33, 0xf5, 0xd8, 0x8a, 0x8c, 0xd9, 0xd8, 0x0a, 0x9b, - 0xc4, 0x9c, 0x15, 0xc2, 0x76, 0x54, 0x32, 0x61, 0x3f, 0xc2, 0xed, 0x36, - 0x14, 0x8f, 0xa3, 0x48, 0xaf, 0x16, 0xa5, 0xda, 0x93, 0xd5, 0x69, 0xa1, - 0xbc, 0x54, 0x1b, 0xb0, 0x3a, 0xf5, 0x5d, 0x7e, 0x82, 0xdb, 0x71, 0x21, - 0xca, 0x3f, 0x50, 0xb8, 0x20, 0x70, 0x0e, 0xe6, 0x87, 0xca, 0xce, 0x1c, - 0x2c, 0x28, 0x9c, 0x82, 0xfb, 0x24, 0xf2, 0x40, 0x1d, 0xb1, 0xe0, 0xe9, - 0x6e, 0x2a, 0x2d, 0x11, 0xc0, 0x9b, 0xd7, 0xd8, 0xcf, 0x3d, 0xc9, 0xfa, - 0xf2, 0x3c, 0xdc, 0x5f, 0xd1, 0xac, 0x6d, 0x09, 0x1a, 0x77, 0x51, 0x0c, - 0xfe, 0xe0, 0x5a, 0x14, 0x86, 0x46, 0x33, 0xbc, 0x74, 0x33, 0xfc, 0x31, - 0x99, 0xc5, 0x40, 0xba, 0x96, 0xbf, 0x48, 0x26, 0xac, 0x6c, 0x87, 0x4d, - 0xb5, 0x8a, 0xe8, 0xfa, 0x83, 0x98, 0x57, 0xfd, 0x25, 0xc5, 0x9b, 0xb0, - 0x6b, 0x31, 0x6d, 0x7e, 0x9d, 0x4c, 0x70, 0xf0, 0x37, 0xfc, 0x0e, 0x37, - 0x15, 0xa4, 0xdf, 0x1d, 0xcf, 0xcd, 0xd1, 0x78, 0xfc, 0x6d, 0x4e, 0xf1, - 0x17, 0x5d, 0x6f, 0xc3, 0xbc, 0xe7, 0x50, 0x2a, 0x2d, 0x15, 0x06, 0x62, - 0x3a, 0x36, 0x20, 0xd4, 0xb7, 0x23, 0xcd, 0xa3, 0xd5, 0xf5, 0x11, 0x4e, - 0x9f, 0xa6, 0x5e, 0x08, 0xf2, 0xe1, 0xb7, 0xc9, 0x89, 0xd6, 0xdf, 0xcb, - 0x5e, 0x3f, 0xd2, 0xfb, 0x6b, 0xc8, 0xa7, 0x82, 0x47, 0x85, 0x13, 0xba, - 0x13, 0x94, 0x79, 0xfb, 0x88, 0xe1, 0x12, 0x65, 0x1f, 0x03, 0x8a, 0x61, - 0x65, 0x49, 0x8f, 0xc8, 0x1f, 0xcc, 0x38, 0x31, 0x89, 0x3f, 0x4c, 0xf6, - 0x0c, 0x30, 0x41, 0xf6, 0xfe, 0x71, 0xb9, 0x7c, 0x4a, 0x79, 0x4d, 0x65, - 0x1f, 0xb9, 0x39, 0x23, 0x57, 0x56, 0x77, 0xf9, 0xb4, 0xfe, 0x46, 0xb9, - 0xf8, 0x5b, 0xe5, 0x0f, 0xc0, 0xb4, 0xe4, 0x44, 0x7b, 0xad, 0xf0, 0x5a, - 0x38, 0x9d, 0x9b, 0x8f, 0xbf, 0x37, 0x9c, 0xf0, 0xed, 0xac, 0xda, 0x1f, - 0x96, 0xd8, 0x25, 0xbc, 0xdf, 0x78, 0xd9, 0x5b, 0x48, 0x3c, 0x45, 0xbc, - 0xb6, 0xec, 0x35, 0xe5, 0x8d, 0x70, 0xc2, 0xf7, 0x53, 0xf9, 0x94, 0x76, - 0x3c, 0x55, 0x5f, 0x0b, 0xf1, 0x63, 0x38, 0xa3, 0xe4, 0x8f, 0x4d, 0x3c, - 0x2e, 0x7f, 0xc8, 0x26, 0xfd, 0x30, 0x4c, 0x0c, 0x43, 0x42, 0x1e, 0xe4, - 0x0f, 0x73, 0x5c, 0x15, 0xda, 0xfa, 0xc1, 0x90, 0x37, 0xed, 0xbf, 0x3e, - 0xa1, 0x0e, 0xf7, 0xcb, 0xde, 0x12, 0x8e, 0x4b, 0xca, 0x3c, 0x34, 0x94, - 0x93, 0xff, 0xb8, 0x54, 0xd7, 0xd0, 0xee, 0xcf, 0xcb, 0x27, 0xfd, 0xc7, - 0xc9, 0x1f, 0x4b, 0x21, 0xb4, 0xcd, 0x89, 0xf2, 0x49, 0xf8, 0x43, 0x55, - 0x79, 0xd2, 0x3d, 0x6d, 0xbf, 0x18, 0x17, 0x4f, 0xf8, 0xaf, 0xa6, 0xe2, - 0xb6, 0x6c, 0xcd, 0x30, 0x41, 0xfe, 0x78, 0x4e, 0x1a, 0xb7, 0xaa, 0x7c, - 0xf2, 0x7a, 0x64, 0x49, 0x5b, 0x16, 0x85, 0x61, 0xb2, 0xe7, 0xa2, 0x09, - 0x92, 0x4e, 0x4a, 0xe2, 0xcf, 0x93, 0x34, 0x31, 0xbc, 0xcf, 0x58, 0xf9, - 0x83, 0x42, 0x7b, 0x85, 0x36, 0x97, 0xec, 0xc5, 0x63, 0x8c, 0xb2, 0xb1, - 0x31, 0x28, 0xd7, 0x3e, 0xbd, 0xe4, 0x53, 0xf8, 0x0f, 0x86, 0x74, 0x93, - 0xe5, 0xb9, 0xb7, 0x71, 0x41, 0x39, 0x4d, 0x21, 0xdc, 0x2f, 0x7b, 0x24, - 0x48, 0x3f, 0xa6, 0xd1, 0x2f, 0x94, 0x2f, 0xd9, 0x3b, 0xc5, 0x93, 0x49, - 0x78, 0x31, 0xc4, 0x0f, 0x90, 0xbd, 0xc4, 0x48, 0xf6, 0x4c, 0x31, 0x59, - 0x99, 0xe7, 0x9f, 0x7c, 0xd8, 0x58, 0x3e, 0xd5, 0xfe, 0x8a, 0xdc, 0x7f, - 0x4f, 0x87, 0xeb, 0xe8, 0x51, 0x27, 0xad, 0xdb, 0x34, 0x55, 0x7a, 0x7f, - 0xfa, 0x7b, 0xf2, 0x9c, 0x07, 0x42, 0xda, 0x7e, 0xca, 0x3c, 0x28, 0xbc, - 0x2d, 0x8f, 0x8b, 0xfc, 0x33, 0x25, 0xe9, 0xd8, 0xdc, 0x3b, 0xe5, 0xf3, - 0x2c, 0x24, 0x7b, 0x02, 0x9a, 0x1a, 0xe2, 0x1f, 0x93, 0xbd, 0x1f, 0xd4, - 0x7a, 0xff, 0x4f, 0xe5, 0xf9, 0xb1, 0x83, 0x3c, 0x87, 0x3e, 0x0f, 0xe5, - 0xc6, 0x8f, 0x18, 0xdd, 0xa6, 0x8c, 0x96, 0x5d, 0x24, 0x7b, 0xa4, 0x92, - 0xec, 0x3d, 0x60, 0x5f, 0xd9, 0x03, 0xc2, 0x23, 0x21, 0xdf, 0xd3, 0x92, - 0x8e, 0xca, 0xd5, 0xfb, 0x5b, 0xa1, 0x8d, 0xf2, 0xef, 0x73, 0x50, 0x78, - 0xff, 0xb1, 0x21, 0xff, 0x30, 0x55, 0x7e, 0x5c, 0xeb, 0xa7, 0xca, 0xbc, - 0x47, 0x4c, 0x0d, 0xf5, 0x58, 0xaa, 0xa0, 0x9c, 0x9d, 0x24, 0xbd, 0x2b, - 0x7f, 0x8c, 0x68, 0xe5, 0x50, 0x9f, 0x26, 0x99, 0x16, 0x2d, 0x12, 0xd2, - 0xfc, 0x2c, 0xb4, 0x45, 0x6c, 0xab, 0x26, 0x65, 0x1e, 0x1c, 0xce, 0x95, - 0x3d, 0xf2, 0x8c, 0x91, 0x69, 0xca, 0x51, 0xf2, 0xfc, 0x1d, 0x23, 0x8f, - 0xa5, 0x09, 0xf2, 0x07, 0xe7, 0xd2, 0xb9, 0x70, 0x48, 0xae, 0xbc, 0xd1, - 0xaa, 0xf4, 0x8c, 0x10, 0xc3, 0x76, 0xe1, 0xfd, 0x3e, 0x96, 0xbd, 0x7c, - 0x8c, 0x55, 0xa5, 0x47, 0x85, 0xa2, 0xb0, 0x58, 0x28, 0xb3, 0xa8, 0xbc, - 0x7c, 0xb8, 0x59, 0x52, 0xcf, 0x82, 0xf8, 0xe1, 0x72, 0x9f, 0xe7, 0xe3, - 0x2f, 0x91, 0x3d, 0x9f, 0xbc, 0xa7, 0xcc, 0x43, 0xc8, 0xa6, 0xa1, 0x1f, - 0xe6, 0x84, 0x7a, 0x8e, 0x96, 0x69, 0x40, 0x9a, 0xef, 0xd8, 0xdc, 0xfb, - 0xde, 0x27, 0x7b, 0x70, 0x89, 0xf7, 0x67, 0x4a, 0xfa, 0x4c, 0x95, 0xe3, - 0xea, 0x49, 0x65, 0x9e, 0x2e, 0xa4, 0x72, 0xaf, 0x36, 0xe9, 0x07, 0xeb, - 0xd2, 0xb1, 0x5e, 0x96, 0xbe, 0x25, 0x61, 0x49, 0xd9, 0x73, 0xd7, 0x9b, - 0xb2, 0x67, 0x9b, 0x01, 0xe1, 0xfd, 0xff, 0xad, 0xcc, 0xb3, 0xd8, 0x9a, - 0xca, 0xe6, 0xc8, 0xd9, 0xb2, 0x37, 0x89, 0xb1, 0xb2, 0xe7, 0x8c, 0xfd, - 0x92, 0xb2, 0xf6, 0x96, 0x69, 0xda, 0xe3, 0xb2, 0x27, 0xab, 0x33, 0xe5, - 0x8f, 0x32, 0x21, 0xd3, 0xaf, 0x97, 0xe4, 0xf1, 0xf3, 0xf7, 0x70, 0x4f, - 0xb2, 0x67, 0xa1, 0xf8, 0x71, 0xb5, 0x9f, 0xc8, 0xeb, 0xcb, 0x24, 0x79, - 0x4c, 0x5f, 0x22, 0x8f, 0xbb, 0xf5, 0xe5, 0xf1, 0x16, 0xdb, 0xf8, 0x9f, - 0xb9, 0x77, 0x58, 0x2e, 0x94, 0xf3, 0x86, 0x3c, 0x7e, 0x47, 0x87, 0xfc, - 0xc7, 0xca, 0x34, 0x73, 0x8d, 0xf0, 0x5c, 0x85, 0xf7, 0x8c, 0xf3, 0x61, - 0x6c, 0x12, 0x77, 0xb4, 0xec, 0x79, 0x2b, 0xd2, 0x87, 0xcb, 0x73, 0xcf, - 0x18, 0x12, 0xe2, 0x09, 0xf5, 0x6d, 0x0a, 0xd7, 0xd3, 0x64, 0x5e, 0x08, - 0xd9, 0xdb, 0x86, 0xe4, 0x31, 0xb0, 0xb2, 0x4c, 0x1b, 0xa2, 0x97, 0x93, - 0xd7, 0xe4, 0xb5, 0x3b, 0x7d, 0xee, 0xb4, 0xd0, 0x66, 0x07, 0x2a, 0xa3, - 0x7b, 0xf7, 0xc9, 0x73, 0x73, 0x74, 0xae, 0x6e, 0x45, 0xf5, 0x5d, 0x2d, - 0xf7, 0x5e, 0x47, 0x87, 0x7a, 0xf4, 0x96, 0xe7, 0xe8, 0x58, 0x79, 0x8e, - 0xfe, 0x49, 0x95, 0xeb, 0x68, 0x1c, 0x47, 0xd7, 0xca, 0xf4, 0x77, 0x9c, - 0xdc, 0x97, 0xe9, 0x47, 0xd2, 0x8e, 0x92, 0x69, 0x78, 0x93, 0x3c, 0x1e, - 0x2e, 0x4c, 0xde, 0x1f, 0x99, 0xa7, 0x89, 0xeb, 0xf1, 0x6b, 0xf2, 0x07, - 0xca, 0xe2, 0xbd, 0xe8, 0x5d, 0x6c, 0x9c, 0xec, 0x15, 0x29, 0xff, 0x11, - 0xae, 0xe3, 0x64, 0xba, 0x74, 0x8f, 0xa4, 0x81, 0x49, 0xfc, 0xae, 0x32, - 0x0d, 0x1e, 0x2f, 0xb7, 0x7f, 0x6f, 0x79, 0x6e, 0xdd, 0xa5, 0x8c, 0x67, - 0x88, 0xe1, 0x08, 0x55, 0xf7, 0x51, 0x1a, 0x6e, 0x51, 0xa5, 0xe7, 0xc1, - 0x8e, 0xf2, 0x5a, 0x98, 0xf7, 0xf0, 0x74, 0x81, 0xfc, 0x21, 0xc4, 0x07, - 0x65, 0xde, 0x71, 0xa8, 0xbc, 0xc6, 0x7f, 0xac, 0x4a, 0xef, 0x2c, 0x31, - 0xfc, 0xaf, 0xb2, 0x8f, 0x28, 0xc6, 0xf0, 0xbe, 0x3c, 0x6e, 0x6e, 0x0a, - 0xe1, 0xae, 0x5c, 0x5b, 0xe5, 0xff, 0x0f, 0xa9, 0x71, 0x5d, 0x18, 0xda, - 0x49, 0xcd, 0x31, 0x33, 0xaa, 0x8b, 0x29, 0x14, 0xdb, 0xee, 0xac, 0xc5, - 0xfc, 0x37, 0x2d, 0x89, 0x36, 0xcb, 0x07, 0x86, 0xdf, 0x35, 0xb1, 0xca, - 0x6f, 0x23, 0x5a, 0xf7, 0x70, 0x02, 0xa1, 0xcc, 0xeb, 0xa8, 0x3e, 0xec, - 0x96, 0xe2, 0x34, 0x2c, 0x0d, 0x3f, 0xbf, 0x46, 0x9a, 0x6f, 0x22, 0x3a, - 0xe2, 0xf6, 0x8b, 0x9f, 0x4f, 0xaf, 0x87, 0xa5, 0xf1, 0x8e, 0x79, 0x15, - 0xbe, 0xbc, 0x8f, 0xda, 0x6c, 0x87, 0x25, 0x77, 0xe3, 0xb1, 0x84, 0x2d, - 0xda, 0x99, 0x2f, 0x82, 0xa5, 0x05, 0x65, 0xea, 0xf2, 0x36, 0xcc, 0x1f, - 0x2c, 0x89, 0xcd, 0xe0, 0x7a, 0x52, 0x2d, 0x19, 0x6a, 0x83, 0xb5, 0x9d, - 0x83, 0xb0, 0x46, 0xf3, 0x19, 0x2c, 0xe1, 0x1b, 0xce, 0x7f, 0xc6, 0x47, - 0xa1, 0xda, 0x60, 0xba, 0x77, 0x2a, 0xc5, 0x1f, 0xb9, 0x5b, 0x07, 0xaf, - 0x65, 0x9b, 0x37, 0x98, 0x3e, 0xa2, 0xa9, 0xc6, 0xbd, 0x5e, 0xcd, 0xa9, - 0xdc, 0x57, 0x04, 0xbb, 0xe2, 0xc3, 0x78, 0xdb, 0x63, 0x4d, 0x7d, 0x3b, - 0x2c, 0x0d, 0xbd, 0x11, 0x4b, 0x30, 0xeb, 0x7d, 0xbc, 0xab, 0x11, 0x9c, - 0x8a, 0xcd, 0xe2, 0xbe, 0x2e, 0x1f, 0x22, 0x6a, 0x64, 0x1c, 0xa5, 0x18, - 0x82, 0xa5, 0xf2, 0x65, 0xfe, 0xef, 0xbf, 0x29, 0xe8, 0x8b, 0xa5, 0xfe, - 0x17, 0xd7, 0x4b, 0x98, 0x60, 0x26, 0xd6, 0x02, 0x4d, 0xa7, 0xb2, 0xdd, - 0x97, 0xc3, 0x1a, 0xb2, 0x23, 0xa9, 0xc3, 0x1b, 0x2e, 0xa8, 0x8f, 0x84, - 0x2c, 0x08, 0x9b, 0xef, 0xa3, 0xb1, 0xcd, 0xd3, 0xfa, 0xd8, 0x7e, 0xea, - 0x0c, 0x3c, 0xb1, 0x5a, 0x9b, 0x31, 0x07, 0xdb, 0x5d, 0x5f, 0x55, 0x27, - 0xcd, 0xae, 0x64, 0x5f, 0x98, 0x6c, 0x43, 0x86, 0xcf, 0x71, 0x3f, 0x35, - 0x8a, 0xa3, 0xb1, 0x6d, 0xe1, 0x97, 0xc9, 0x58, 0xdc, 0x8b, 0xd5, 0xdc, - 0x87, 0xe1, 0x03, 0x7d, 0x8b, 0xe1, 0x83, 0x60, 0xaf, 0x52, 0x69, 0x6b, - 0xdf, 0x86, 0xf9, 0x87, 0x45, 0x31, 0x1d, 0x99, 0x81, 0xdd, 0x8a, 0xdd, - 0x4c, 0x1b, 0x63, 0x5e, 0x86, 0x57, 0xf0, 0x59, 0xa1, 0xfd, 0x70, 0x1b, - 0xb5, 0x8d, 0xd1, 0xff, 0x3c, 0x0c, 0xc2, 0x26, 0x20, 0x83, 0xc9, 0x36, - 0xfb, 0xe0, 0xf3, 0x39, 0x4b, 0xe1, 0x73, 0x2c, 0xc7, 0x90, 0x7d, 0xc8, - 0xad, 0x1e, 0x7a, 0xb5, 0x66, 0xe5, 0xbe, 0x02, 0xb8, 0x0c, 0x9b, 0xb9, - 0xc6, 0xc3, 0xb0, 0x22, 0xf3, 0x8c, 0xd5, 0x5a, 0x26, 0x75, 0xdf, 0xa2, - 0xdc, 0x83, 0x55, 0x1b, 0xbe, 0x39, 0xd8, 0x87, 0x4c, 0xe8, 0xdb, 0x28, - 0x8e, 0xc1, 0xde, 0xa1, 0x52, 0x07, 0x0c, 0x43, 0xb1, 0x49, 0xeb, 0x75, - 0x34, 0xb0, 0x79, 0x6c, 0x6d, 0xc9, 0xf9, 0x97, 0x8d, 0x75, 0xf0, 0xe1, - 0xa1, 0x8b, 0xf0, 0xa9, 0xd7, 0x5f, 0xd5, 0x4e, 0xde, 0x22, 0xfc, 0x00, - 0xdb, 0x17, 0xef, 0x4d, 0xe5, 0x61, 0xc2, 0x36, 0xb4, 0x2e, 0x16, 0xc1, - 0x5f, 0x44, 0x9b, 0x45, 0xb5, 0x5f, 0xf5, 0x36, 0x7c, 0x33, 0x31, 0x08, - 0x6f, 0x92, 0x1e, 0xc1, 0x2e, 0xad, 0xda, 0x24, 0xc1, 0xb5, 0x71, 0x3a, - 0x76, 0x7f, 0xb8, 0x09, 0x95, 0x2e, 0x3e, 0xdb, 0xd0, 0x86, 0xaf, 0x3a, - 0x9e, 0xc4, 0x0c, 0xf9, 0x8e, 0x58, 0x43, 0xbd, 0x18, 0xb6, 0x9b, 0xee, - 0x8d, 0xc7, 0x7b, 0xde, 0xfd, 0x68, 0xa3, 0x38, 0x04, 0x1f, 0x98, 0x3d, - 0x19, 0x9f, 0xa5, 0xb9, 0x98, 0xca, 0xb3, 0x72, 0x5f, 0x65, 0xb4, 0x49, - 0xce, 0x1b, 0x43, 0x7b, 0x7c, 0x10, 0xf4, 0x0b, 0x3c, 0xce, 0x16, 0xa3, - 0x79, 0x1e, 0xbf, 0xf2, 0x68, 0x6e, 0xbb, 0x03, 0x5f, 0xfe, 0xe7, 0xb5, - 0x5b, 0x1b, 0xcf, 0x62, 0x37, 0x36, 0x8d, 0xf8, 0x3b, 0x6d, 0x09, 0xe2, - 0xc7, 0x93, 0xda, 0x18, 0xf3, 0xf9, 0x8f, 0xb9, 0x58, 0xbd, 0xfb, 0x44, - 0xbd, 0x84, 0x6d, 0xf8, 0xc6, 0xa0, 0xa5, 0x1f, 0x02, 0xfb, 0xa6, 0xe2, - 0x14, 0x4c, 0xb3, 0x1e, 0xc4, 0x5a, 0x87, 0x67, 0xa8, 0xfe, 0xb4, 0x79, - 0x1b, 0xda, 0xf0, 0x55, 0xc4, 0x8f, 0xb1, 0x66, 0xfc, 0x9f, 0xf8, 0x5b, - 0x18, 0x71, 0xcd, 0xdf, 0x94, 0x96, 0x33, 0xe6, 0x60, 0x49, 0xfc, 0xba, - 0xd8, 0x75, 0x7e, 0x25, 0xe2, 0x26, 0x00, 0x00, 0x00, 0x32, 0x49, 0x44, - 0x41, 0x54, 0xea, 0x65, 0x54, 0x3b, 0x08, 0xf8, 0x2a, 0x62, 0x6f, 0xec, - 0x38, 0x01, 0xec, 0xbd, 0x64, 0x43, 0xec, 0xb0, 0xa1, 0x16, 0xae, 0x26, - 0x73, 0xcc, 0xf1, 0x10, 0x16, 0x8c, 0x7c, 0x53, 0xd6, 0x62, 0x61, 0xcd, - 0x55, 0x4f, 0xcc, 0xa0, 0x1f, 0x5a, 0x3b, 0xf9, 0xfc, 0xc1, 0xff, 0x01, - 0xf4, 0x4f, 0x9a, 0x26, 0x12, 0xca, 0xbf, 0xd8, 0x00, 0x00, 0x00, 0x00, - 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x02, 0xe7, 0x00, 0x00, 0x00, 0x11, 0x08, 0x06, 0x00, 0x00, 0x00, 0x7e, 0x53, 0x02, + 0xe5, 0x00, 0x00, 0x00, 0x04, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08, 0x08, 0x7c, 0x08, 0x64, + 0x88, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0e, 0xc4, 0x00, 0x00, 0x0e, + 0xc4, 0x01, 0x95, 0x2b, 0x0e, 0x1b, 0x00, 0x00, 0x20, 0x00, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c, + 0xed, 0x9d, 0x77, 0xd8, 0x55, 0xc5, 0xb5, 0xc6, 0x7f, 0x14, 0x15, 0xb1, 0xa2, 0x62, 0x12, 0x8d, + 0x0d, 0x1b, 0x26, 0xf6, 0x86, 0x1a, 0x13, 0x10, 0x7b, 0xb0, 0xc4, 0x28, 0x18, 0x4b, 0x14, 0x31, + 0x17, 0x15, 0x8d, 0xc6, 0x42, 0xbc, 0x26, 0x16, 0xbc, 0x46, 0x63, 0xbc, 0x26, 0xd8, 0x35, 0x09, + 0x0a, 0x51, 0xb1, 0x44, 0x63, 0x8f, 0x1d, 0xf9, 0x00, 0x1b, 0x62, 0x45, 0xc4, 0xd8, 0x51, 0x11, + 0x8d, 0x8a, 0x60, 0x45, 0x41, 0x7c, 0xef, 0x1f, 0xef, 0xcc, 0xdd, 0x73, 0xf6, 0xd9, 0xfb, 0x9c, + 0xf3, 0x7d, 0x7c, 0x60, 0xd4, 0xef, 0x7d, 0x9e, 0x79, 0xce, 0xd9, 0xb3, 0x67, 0x66, 0xcf, 0x9e, + 0xb2, 0x66, 0xcd, 0x5a, 0x6b, 0xd6, 0x6e, 0x27, 0x89, 0xaf, 0x19, 0x3a, 0x01, 0x5f, 0x00, 0x9f, + 0x87, 0xdf, 0x36, 0xb4, 0xa1, 0x0d, 0x6d, 0x68, 0x43, 0x1b, 0xda, 0xd0, 0x86, 0x79, 0x45, 0x07, + 0x60, 0x71, 0xe0, 0xfd, 0x2f, 0xbb, 0x22, 0x6d, 0xf8, 0x7a, 0xa3, 0x7d, 0xf2, 0xff, 0x5f, 0xc0, + 0x7e, 0x05, 0xff, 0x9b, 0x83, 0x29, 0xf3, 0x5a, 0xa1, 0x66, 0x22, 0x5f, 0xcf, 0x8d, 0x80, 0xbf, + 0x01, 0x9b, 0x00, 0x7f, 0xa9, 0x91, 0x6f, 0x10, 0xf0, 0xe6, 0x7c, 0xac, 0x57, 0x11, 0x9e, 0x03, + 0x56, 0x58, 0xc0, 0xcf, 0x9c, 0x1f, 0xe8, 0x04, 0x74, 0xfe, 0xb2, 0x2b, 0x31, 0x1f, 0xd0, 0x11, + 0xf8, 0x01, 0xb0, 0xd4, 0x97, 0x5d, 0x91, 0x36, 0xb4, 0xa1, 0x0d, 0x5f, 0x6b, 0x08, 0x78, 0x1b, + 0x18, 0x8d, 0xd7, 0xaa, 0x27, 0x81, 0x55, 0x0a, 0xd2, 0x9d, 0x0d, 0x3c, 0x16, 0xd2, 0x0f, 0x99, + 0x87, 0xe7, 0xfd, 0x1e, 0xb8, 0xb9, 0x99, 0x79, 0x96, 0x00, 0x0e, 0x00, 0xae, 0x06, 0x0e, 0x9b, + 0x87, 0x67, 0x47, 0x6c, 0x0a, 0xfc, 0x0f, 0xf0, 0x40, 0x0b, 0xf2, 0xfe, 0x04, 0x78, 0x0a, 0x98, + 0x0d, 0x34, 0x01, 0x0b, 0x35, 0x90, 0x27, 0xd6, 0xff, 0x1a, 0xea, 0xd7, 0x7f, 0x0c, 0x5e, 0x9f, + 0x17, 0xad, 0x11, 0xbf, 0x06, 0x70, 0x2d, 0xf0, 0x0e, 0x70, 0x74, 0x9d, 0xe7, 0xfe, 0x1c, 0xb8, + 0xaa, 0x81, 0xe7, 0xb6, 0xe1, 0xeb, 0x8b, 0x01, 0x78, 0x5e, 0x5f, 0x40, 0x36, 0x7f, 0xcf, 0x05, + 0x5e, 0x00, 0xfe, 0x8e, 0x37, 0x78, 0x35, 0xd1, 0x1e, 0x78, 0x06, 0xd8, 0x07, 0x58, 0x0d, 0xf8, + 0x6e, 0x88, 0x4f, 0xff, 0x03, 0xac, 0x09, 0x9c, 0x11, 0xfe, 0x6f, 0x06, 0xfc, 0x36, 0x57, 0xce, + 0x2a, 0xc0, 0xaf, 0x81, 0x2e, 0x98, 0xf1, 0xed, 0x14, 0xe2, 0x57, 0x06, 0xc6, 0x03, 0x93, 0x0a, + 0xf2, 0xc4, 0xe7, 0x9f, 0x96, 0x8b, 0x5b, 0x1f, 0xb8, 0x2f, 0xe4, 0x9b, 0x02, 0x5c, 0x49, 0xf5, + 0xa4, 0x89, 0x48, 0xeb, 0xb9, 0x3c, 0x70, 0x13, 0x6e, 0x84, 0x87, 0x42, 0x1d, 0x7e, 0x93, 0x4b, + 0xbf, 0x74, 0xf8, 0x9d, 0x01, 0xbc, 0x1b, 0xfe, 0x77, 0x02, 0x16, 0x29, 0x29, 0xbf, 0xb5, 0xb0, + 0x0e, 0xde, 0x69, 0x4f, 0x0b, 0xd7, 0xbb, 0x00, 0x13, 0xf0, 0x3b, 0x5e, 0x01, 0x2c, 0x96, 0xa4, + 0x6d, 0x0f, 0x6c, 0x0c, 0x1c, 0x1b, 0xd2, 0xa5, 0x58, 0x16, 0xf8, 0x2b, 0x70, 0x1b, 0xf0, 0x3a, + 0x70, 0x07, 0xd9, 0xfb, 0xb7, 0xc3, 0x6d, 0x7c, 0x0f, 0xf0, 0x08, 0x30, 0x11, 0xd8, 0xab, 0xa4, + 0x3e, 0x07, 0xe3, 0x01, 0x13, 0xf1, 0x12, 0x26, 0x7a, 0x69, 0x48, 0xd1, 0x01, 0xf8, 0x45, 0x78, + 0xde, 0x9f, 0xa8, 0x1c, 0x1b, 0x65, 0xe8, 0x1f, 0xea, 0xf0, 0x28, 0x26, 0x72, 0xab, 0x27, 0xf7, + 0x06, 0xe1, 0x81, 0x3b, 0x36, 0xa4, 0xe9, 0xd7, 0x40, 0x79, 0xf3, 0x1b, 0x83, 0x80, 0xfb, 0x81, + 0xb7, 0x80, 0xa1, 0x64, 0x63, 0x38, 0xc5, 0x32, 0xc0, 0xa9, 0xb8, 0xde, 0xf7, 0xe1, 0x85, 0xe6, + 0x69, 0xe0, 0x2c, 0x3c, 0xfe, 0xca, 0xb0, 0x3b, 0xf0, 0x11, 0xc5, 0xe3, 0xb8, 0x2f, 0xf0, 0x30, + 0xee, 0x8f, 0x29, 0xb8, 0xad, 0x26, 0x85, 0xb8, 0x1d, 0x73, 0x69, 0x37, 0xc6, 0x8b, 0xcd, 0xf8, + 0x24, 0xdd, 0x4d, 0x78, 0x81, 0xef, 0x1b, 0xea, 0x13, 0xcb, 0x69, 0x02, 0x1e, 0xc4, 0xf3, 0x7b, + 0x28, 0xf0, 0xad, 0xa4, 0x9c, 0xdd, 0x70, 0x5f, 0xa6, 0x69, 0x63, 0x78, 0x1d, 0xcf, 0xa1, 0x5a, + 0x69, 0xde, 0xa2, 0x92, 0x59, 0x58, 0x07, 0xb8, 0x34, 0xd4, 0x6b, 0x34, 0xf0, 0x04, 0x66, 0x2a, + 0x62, 0x9a, 0x7d, 0x70, 0x7f, 0x0b, 0xcf, 0xbb, 0x3b, 0x92, 0xbc, 0xb7, 0x85, 0x38, 0x85, 0x34, + 0xfb, 0x00, 0x7b, 0xe3, 0x71, 0x13, 0x99, 0x98, 0x7b, 0x93, 0xf4, 0xa7, 0xe0, 0xb9, 0xa3, 0x50, + 0x8f, 0x7b, 0xf0, 0x9c, 0xc9, 0xe7, 0x19, 0x85, 0x17, 0xf1, 0x83, 0x80, 0xd7, 0xf0, 0x9c, 0xbf, + 0x1f, 0x58, 0xb1, 0x20, 0xed, 0x5d, 0x54, 0xa3, 0x77, 0x78, 0x9f, 0xb9, 0xc0, 0xad, 0x05, 0xf7, + 0x23, 0x8e, 0x0c, 0xe5, 0x3c, 0x0a, 0xec, 0x1b, 0xda, 0xe2, 0xa1, 0x10, 0x77, 0x55, 0x2e, 0xed, + 0x51, 0x98, 0xc9, 0xf8, 0x3c, 0xb4, 0xcf, 0xa6, 0xc9, 0xbd, 0x7e, 0xb8, 0x6d, 0xc7, 0x84, 0xe7, + 0x0e, 0x03, 0x56, 0x4a, 0xee, 0x17, 0x8d, 0x93, 0xc7, 0xc3, 0xb3, 0xf6, 0xcf, 0x3d, 0x67, 0xe7, + 0xf0, 0xfe, 0xb1, 0xac, 0x0b, 0x80, 0xae, 0xb9, 0xb2, 0xf2, 0x63, 0xe5, 0x7e, 0xdc, 0x6f, 0x43, + 0x80, 0x85, 0x93, 0xb4, 0xed, 0x31, 0x6d, 0x7f, 0x3c, 0xa4, 0x79, 0x0a, 0x33, 0x29, 0xdd, 0x42, + 0xda, 0xb7, 0xc8, 0xc6, 0x45, 0x5a, 0x5e, 0xac, 0xeb, 0x0f, 0x42, 0x3d, 0x62, 0x7f, 0xdd, 0x15, + 0xca, 0x6c, 0x1f, 0xea, 0x38, 0x3d, 0xdc, 0x7b, 0x08, 0xd8, 0x0e, 0x38, 0x27, 0xa4, 0x13, 0x66, + 0x8c, 0x8e, 0x09, 0xf5, 0x58, 0x2a, 0xd4, 0xe1, 0x23, 0xe0, 0x45, 0xe0, 0x57, 0x21, 0xed, 0xd4, + 0x90, 0xf6, 0x29, 0xe0, 0x50, 0x2c, 0x38, 0x18, 0x85, 0xfb, 0xf5, 0x43, 0x60, 0x1c, 0x5e, 0x53, + 0xb6, 0xc7, 0xe3, 0xe6, 0xb3, 0xd0, 0x26, 0xeb, 0x02, 0x27, 0x01, 0xcf, 0x86, 0xfc, 0x53, 0x81, + 0x8b, 0xc2, 0xb3, 0x2e, 0xc2, 0x4c, 0xd8, 0x9b, 0x98, 0x39, 0x05, 0x33, 0x5d, 0xa3, 0x81, 0x8f, + 0xb1, 0x46, 0xf6, 0x11, 0xa0, 0x4f, 0x78, 0xde, 0x18, 0x4c, 0xdf, 0x5f, 0x04, 0x7e, 0x99, 0x94, + 0xd7, 0x94, 0x0b, 0x9f, 0x85, 0xf7, 0x8d, 0xcf, 0xd8, 0x06, 0x8f, 0x83, 0x5b, 0xf1, 0x7c, 0xcb, + 0xe3, 0x38, 0x3c, 0xb7, 0xe7, 0x15, 0x57, 0x02, 0x3d, 0x30, 0xb3, 0xda, 0x28, 0xba, 0x02, 0xdf, + 0x07, 0x7e, 0x46, 0x25, 0xed, 0x68, 0x29, 0x36, 0x02, 0x76, 0x00, 0xb6, 0x6a, 0x66, 0xbe, 0x6d, + 0x80, 0x11, 0x78, 0x2d, 0x1b, 0x09, 0x7c, 0x8a, 0xd7, 0xba, 0x7a, 0x88, 0xf5, 0xdf, 0x9b, 0xfa, + 0xf5, 0xef, 0x8a, 0x69, 0x7b, 0xc7, 0x1a, 0xf1, 0x6f, 0xe1, 0x79, 0xd4, 0xa5, 0x81, 0xb2, 0xd6, + 0xc5, 0x74, 0xac, 0x35, 0xda, 0xad, 0x0d, 0x5f, 0x4d, 0xfc, 0x09, 0xd3, 0x9c, 0x23, 0x92, 0xb8, + 0xa3, 0xf0, 0xf8, 0xef, 0x8b, 0xd7, 0xa5, 0xda, 0x90, 0xf4, 0xb9, 0xa4, 0xdf, 0x4a, 0x7a, 0x49, + 0xd2, 0x7e, 0x92, 0x08, 0xff, 0xf7, 0x0d, 0xff, 0x91, 0xb4, 0x93, 0xa4, 0x83, 0xc3, 0xff, 0x7e, + 0x92, 0xf6, 0x49, 0xee, 0xfd, 0x58, 0xd2, 0x74, 0x49, 0x47, 0x48, 0x9a, 0x26, 0xe9, 0x77, 0x92, + 0xee, 0x0e, 0xf7, 0xae, 0x95, 0x74, 0xa3, 0xa4, 0xf5, 0x65, 0x7c, 0x3f, 0xc9, 0x87, 0xa4, 0xe3, + 0x25, 0xed, 0x92, 0x8b, 0x7b, 0x41, 0xd2, 0x15, 0xe1, 0xff, 0xda, 0x21, 0xdf, 0xe1, 0xb9, 0x34, + 0x31, 0xa4, 0x75, 0xbe, 0x46, 0xd2, 0xb0, 0xe4, 0xde, 0x6a, 0x92, 0x66, 0x49, 0x5a, 0x37, 0x5c, + 0x2f, 0x2a, 0xe9, 0x7d, 0x49, 0xf7, 0x84, 0xf2, 0x6e, 0x0b, 0x75, 0x9d, 0x21, 0xe9, 0xc8, 0x92, + 0xf2, 0x5b, 0x2b, 0x1c, 0x2f, 0xe9, 0xc4, 0xf0, 0xbf, 0x7b, 0xa8, 0x57, 0x6c, 0x8b, 0x1b, 0x24, + 0x0d, 0x0f, 0xff, 0x3b, 0x4b, 0xba, 0x2f, 0xd4, 0x51, 0x92, 0x86, 0xe4, 0xca, 0xb9, 0x5b, 0xd2, + 0xed, 0xe1, 0x7f, 0x17, 0x49, 0x53, 0x92, 0xeb, 0x5f, 0x84, 0x3c, 0x6b, 0x86, 0xeb, 0xff, 0x92, + 0x34, 0x57, 0xd2, 0x86, 0xb9, 0x32, 0x56, 0x95, 0x34, 0x33, 0xa4, 0x8d, 0x71, 0xd3, 0x6a, 0xd4, + 0x7d, 0x39, 0x49, 0xe3, 0x24, 0x9d, 0x2c, 0xa9, 0x53, 0x12, 0xdf, 0x54, 0x10, 0x1e, 0x94, 0x34, + 0x59, 0xd2, 0x16, 0xa1, 0xfc, 0x1f, 0x86, 0xb4, 0xa3, 0x24, 0x3d, 0x14, 0xfe, 0x1f, 0x1e, 0xfa, + 0x61, 0xf5, 0x70, 0xbd, 0xbd, 0xa4, 0x2f, 0xc2, 0x6f, 0x4b, 0xda, 0x76, 0x39, 0x49, 0x2b, 0x34, + 0x98, 0x76, 0x05, 0x49, 0x5d, 0x4b, 0xee, 0x75, 0x91, 0x74, 0x8c, 0xa4, 0x2b, 0x25, 0xbd, 0x28, + 0xe9, 0x2e, 0x49, 0xed, 0x93, 0xfb, 0x7b, 0x84, 0x76, 0x3a, 0x3a, 0xd7, 0x0e, 0xcb, 0x4a, 0xba, + 0x3c, 0xdc, 0x5b, 0xbb, 0xa4, 0xec, 0x91, 0xa1, 0x3d, 0xf6, 0xaa, 0x51, 0x37, 0xa9, 0xb2, 0xbf, + 0x7f, 0x29, 0x69, 0x8e, 0xa4, 0xf5, 0xc2, 0xf5, 0x00, 0x49, 0xff, 0x96, 0xe7, 0x5b, 0x4c, 0xd3, + 0x41, 0xd2, 0x1b, 0xb9, 0x7c, 0xf9, 0x72, 0x96, 0x96, 0xc7, 0xd7, 0x9b, 0x92, 0xd6, 0xaa, 0xf3, + 0x4c, 0x42, 0x1b, 0xd4, 0x2a, 0x0f, 0x79, 0xde, 0xc4, 0xb8, 0xfd, 0x24, 0xbd, 0x2d, 0xa9, 0xaf, + 0xa4, 0x76, 0x49, 0x9a, 0xe3, 0x43, 0xde, 0x7a, 0xcf, 0x23, 0xc4, 0xe5, 0xd3, 0xd6, 0x4a, 0x5f, + 0xeb, 0x5e, 0x3e, 0xbe, 0xb3, 0xa4, 0xb1, 0x05, 0xef, 0x5e, 0xaf, 0xfc, 0x18, 0x66, 0xca, 0x34, + 0x72, 0xa5, 0x82, 0x7b, 0xed, 0x24, 0xfd, 0xab, 0xa4, 0xee, 0x71, 0x8e, 0xed, 0x5b, 0x70, 0x6f, + 0x4a, 0xee, 0xfa, 0x34, 0x49, 0x8f, 0x4b, 0xfa, 0x4e, 0x12, 0x77, 0x98, 0xdc, 0xdf, 0xf9, 0x31, + 0x95, 0xaf, 0x73, 0x2f, 0x99, 0x9e, 0x44, 0x1a, 0x79, 0xb8, 0xa4, 0x67, 0x24, 0xad, 0x9c, 0xd4, + 0xf1, 0x38, 0x49, 0x2f, 0xe7, 0xca, 0x2f, 0x2a, 0xeb, 0x5b, 0x32, 0x4d, 0x1d, 0x91, 0xc4, 0xfd, + 0x41, 0xd2, 0xd3, 0xf2, 0x38, 0x47, 0x52, 0x47, 0x49, 0x9f, 0x48, 0x3a, 0x34, 0xe4, 0x3d, 0xab, + 0xa4, 0xbc, 0xce, 0xf2, 0xbc, 0x6e, 0x49, 0xdf, 0xef, 0x11, 0xe2, 0x76, 0x2c, 0x48, 0xff, 0xa4, + 0xa4, 0x25, 0x92, 0xeb, 0xed, 0x42, 0xda, 0x9d, 0x72, 0xe9, 0x6e, 0x91, 0xf4, 0x4a, 0x2e, 0x6e, + 0x19, 0x99, 0x16, 0xa5, 0x71, 0x0b, 0xc9, 0x7d, 0xf8, 0x90, 0xb2, 0xf1, 0xdb, 0x41, 0x1e, 0x33, + 0xdf, 0x2d, 0x78, 0xfe, 0xc9, 0xe1, 0x79, 0x9b, 0x24, 0x71, 0x1d, 0x25, 0x3d, 0x20, 0x69, 0xe1, + 0xe4, 0x5d, 0x7f, 0x95, 0xcb, 0xd7, 0x27, 0xc4, 0x1f, 0x54, 0xd0, 0x16, 0x9b, 0xc9, 0x34, 0xbf, + 0x6c, 0x0c, 0x96, 0xb5, 0x5d, 0x73, 0x42, 0xb7, 0x50, 0xc7, 0x2e, 0xcd, 0xcc, 0xd7, 0x1a, 0xcf, + 0xae, 0xd5, 0xd7, 0xf5, 0xc2, 0xf5, 0x92, 0xae, 0x9e, 0x87, 0x67, 0x36, 0x52, 0xff, 0x85, 0x65, + 0xfe, 0xa0, 0x91, 0xf8, 0x46, 0xdb, 0xa3, 0x35, 0xdb, 0xed, 0xeb, 0x10, 0xce, 0xfb, 0x86, 0xb5, + 0x87, 0x72, 0xff, 0x87, 0xd4, 0xb8, 0x2e, 0x0c, 0xed, 0x81, 0x99, 0x78, 0xd7, 0xff, 0x0a, 0x96, + 0xa0, 0x12, 0x7e, 0x5f, 0x4a, 0x78, 0xf8, 0xd5, 0x81, 0x97, 0xc3, 0xff, 0xd5, 0x42, 0xda, 0x88, + 0x73, 0xb1, 0x24, 0xe5, 0x02, 0xac, 0x76, 0x1a, 0x89, 0x25, 0x20, 0x2b, 0x02, 0xdb, 0x62, 0xe9, + 0xc7, 0xf3, 0x21, 0x6d, 0xaf, 0x24, 0xdf, 0x7a, 0x58, 0xb2, 0x7e, 0x5b, 0x6e, 0xbf, 0xb0, 0x34, + 0x99, 0xda, 0x6a, 0x66, 0xf8, 0xfd, 0xa4, 0x64, 0x6f, 0x11, 0xeb, 0xbc, 0x1e, 0x96, 0x3c, 0x9d, + 0x93, 0xbb, 0x77, 0x27, 0x96, 0xb4, 0x01, 0xcc, 0x02, 0x96, 0xc3, 0xbb, 0x97, 0x6d, 0x80, 0xef, + 0x61, 0x89, 0xdc, 0x3a, 0xc0, 0x79, 0x05, 0x65, 0xcf, 0xab, 0x2a, 0x31, 0xc5, 0x6e, 0x64, 0x6a, + 0xc5, 0xc3, 0xb1, 0x94, 0xe7, 0x99, 0x70, 0x7d, 0x19, 0x56, 0x83, 0x2d, 0x8f, 0xdf, 0xb3, 0x37, + 0xde, 0x71, 0xe5, 0xb1, 0x10, 0x6e, 0xbf, 0x7f, 0x86, 0xeb, 0x19, 0xc0, 0x0d, 0x64, 0x6d, 0xba, + 0x08, 0x96, 0xa2, 0xbe, 0x10, 0xae, 0xaf, 0xc0, 0xd2, 0xa9, 0x54, 0xfa, 0xda, 0x0e, 0xbf, 0xeb, + 0x8d, 0xb9, 0xb2, 0x67, 0x52, 0x8c, 0x8e, 0xa1, 0xde, 0x97, 0x62, 0x95, 0xe4, 0xa7, 0xc9, 0xbd, + 0x5e, 0x05, 0xe1, 0x66, 0x2c, 0x5d, 0x8b, 0x75, 0x7a, 0x38, 0xfc, 0x8e, 0xc7, 0x52, 0x5f, 0x70, + 0xfb, 0xdf, 0x40, 0x36, 0xbe, 0xee, 0xc1, 0x12, 0xad, 0xe3, 0x4a, 0xea, 0x50, 0x86, 0x0e, 0x58, + 0xda, 0x3d, 0x09, 0xf7, 0x67, 0x23, 0xd8, 0x06, 0x4b, 0xba, 0x8f, 0x08, 0xf9, 0x53, 0xcc, 0xc0, + 0xbb, 0xdd, 0xfd, 0x71, 0xfd, 0x77, 0xc0, 0x12, 0x6f, 0x80, 0x3d, 0xb0, 0xf4, 0xa9, 0x2f, 0x96, + 0x42, 0xa7, 0xed, 0x30, 0x1d, 0x38, 0x10, 0x98, 0x8c, 0xa5, 0x6c, 0x79, 0xa9, 0x4e, 0x27, 0x2c, + 0x01, 0x7d, 0x93, 0xe6, 0x69, 0x08, 0x86, 0xe1, 0xf6, 0xdf, 0x19, 0xd8, 0x00, 0xf8, 0x33, 0x96, + 0x7c, 0xdd, 0x9e, 0xa4, 0x99, 0x4b, 0x36, 0x8e, 0xca, 0x30, 0x13, 0xab, 0xd8, 0x9e, 0x0b, 0xef, + 0x50, 0x0f, 0x77, 0x63, 0xa9, 0x60, 0x2d, 0xdc, 0x12, 0xd2, 0xac, 0x07, 0x0c, 0xc7, 0x52, 0x80, + 0xeb, 0xa8, 0xd4, 0xc6, 0x3c, 0x1c, 0xea, 0xf7, 0x65, 0xe3, 0xaf, 0xc0, 0x99, 0x64, 0x34, 0xa8, + 0xb9, 0xf8, 0x04, 0x4b, 0x6b, 0x07, 0x16, 0xdc, 0xdb, 0x8e, 0x72, 0x8d, 0xc9, 0x87, 0x58, 0x9a, + 0x7e, 0x11, 0xa6, 0x73, 0x65, 0xf8, 0x11, 0x70, 0x02, 0x96, 0xb4, 0xa5, 0xa6, 0x76, 0x17, 0x63, + 0xfa, 0x34, 0xbc, 0x4e, 0xfd, 0x9a, 0xb0, 0x9a, 0xf4, 0x38, 0x4c, 0xd3, 0x86, 0xe2, 0xf1, 0xf8, + 0x5a, 0xb8, 0x2f, 0x6c, 0x1e, 0x31, 0x19, 0xb8, 0xb0, 0x4e, 0x59, 0xff, 0x06, 0xae, 0xc7, 0xe3, + 0x3c, 0x62, 0x20, 0xa6, 0x39, 0x51, 0xe2, 0xfb, 0x39, 0x1e, 0x23, 0xef, 0x03, 0xef, 0xe1, 0x77, + 0x2c, 0xc2, 0x27, 0x98, 0x16, 0xb4, 0x04, 0xf1, 0x79, 0x3f, 0xcb, 0xc5, 0xaf, 0x87, 0x25, 0xf3, + 0x1f, 0x26, 0x71, 0xe3, 0xb0, 0x34, 0x7b, 0xbb, 0x24, 0x6e, 0x09, 0xac, 0x95, 0x58, 0x15, 0x4b, + 0x6c, 0x23, 0xb6, 0xc3, 0x1a, 0xaf, 0x14, 0x73, 0xb0, 0x74, 0x7e, 0x0b, 0x32, 0x13, 0xc9, 0x23, + 0x70, 0x3b, 0x4c, 0x2d, 0xa8, 0xdb, 0xf9, 0xe1, 0xf9, 0xa9, 0x69, 0xc3, 0xcf, 0x80, 0x7f, 0xe0, + 0xf5, 0x0f, 0xe0, 0x55, 0xac, 0x09, 0x88, 0x58, 0x1c, 0x8f, 0x83, 0x51, 0x14, 0xf7, 0xe7, 0xa3, + 0x58, 0x3b, 0x3d, 0x3f, 0x4d, 0xea, 0x5e, 0xc6, 0x9a, 0xd8, 0x0f, 0xeb, 0x25, 0xfc, 0x0f, 0xc3, + 0xa6, 0x64, 0xbc, 0xc7, 0xfc, 0xc2, 0x6c, 0x8a, 0xcf, 0xa7, 0xcd, 0xa6, 0x31, 0x13, 0x9a, 0x36, + 0xd4, 0xc7, 0xe6, 0x5f, 0x76, 0x05, 0xbe, 0x6a, 0x68, 0x8f, 0xd5, 0x7f, 0xef, 0x60, 0xa6, 0x2e, + 0x32, 0x4c, 0x2f, 0x90, 0x4d, 0x88, 0x26, 0xcc, 0xe0, 0x9e, 0x12, 0xfe, 0x0f, 0xc6, 0x8b, 0x5d, + 0x53, 0xb8, 0xbf, 0x12, 0x95, 0xea, 0xfa, 0x67, 0x31, 0x03, 0xff, 0x06, 0x66, 0xb4, 0x3f, 0x0b, + 0x01, 0x32, 0x95, 0xd0, 0xc2, 0xd8, 0x9c, 0xe5, 0xbf, 0x0b, 0xea, 0x34, 0x18, 0x2f, 0x0e, 0xfd, + 0x31, 0x23, 0x79, 0x35, 0x66, 0x34, 0x7b, 0x61, 0x46, 0x64, 0x36, 0x56, 0x6f, 0x76, 0x49, 0xea, + 0xdc, 0x3f, 0xfc, 0x9f, 0x94, 0x2b, 0xeb, 0x06, 0x6c, 0xaf, 0x16, 0xcd, 0x59, 0xe6, 0x60, 0x62, + 0xdd, 0x15, 0xdb, 0xe1, 0xf5, 0xc6, 0xea, 0xaa, 0xf9, 0x89, 0xae, 0x58, 0xbd, 0xf5, 0x74, 0xb8, + 0xee, 0x85, 0x99, 0xf3, 0x88, 0xa7, 0x30, 0xa3, 0xb8, 0x75, 0x9d, 0x72, 0xe6, 0x60, 0x55, 0xf2, + 0xc5, 0x49, 0xdc, 0xdc, 0x10, 0x0f, 0x5e, 0x78, 0xf7, 0x48, 0xee, 0xc5, 0x77, 0x7e, 0x23, 0x89, + 0x3b, 0x0a, 0x9b, 0x14, 0xbc, 0x9a, 0x2b, 0xbb, 0xec, 0x70, 0xcb, 0x01, 0x98, 0xe9, 0x1f, 0x51, + 0xa7, 0x6e, 0x60, 0xd3, 0x9c, 0x63, 0x71, 0x9f, 0x45, 0xc6, 0xa0, 0x77, 0xf8, 0x5d, 0x15, 0x2f, + 0xa2, 0xf1, 0x7f, 0x7e, 0xd1, 0x7b, 0x0c, 0x9b, 0x4b, 0xdd, 0x8d, 0xc7, 0x4f, 0x6a, 0xd3, 0x5e, + 0x14, 0xb7, 0x35, 0x5e, 0xd0, 0x76, 0x0c, 0xff, 0x47, 0x62, 0x26, 0xa2, 0xa9, 0x46, 0xe8, 0x10, + 0xd2, 0x6d, 0x8d, 0x37, 0x3f, 0x8f, 0x51, 0xde, 0xe6, 0x91, 0x71, 0x5f, 0x03, 0x6f, 0xe8, 0x46, + 0xe0, 0x8d, 0xda, 0x03, 0xa1, 0x1e, 0x97, 0x60, 0xe6, 0xb3, 0x09, 0xab, 0xa4, 0x85, 0x4d, 0x5b, + 0x36, 0xc2, 0x8b, 0x7c, 0x8a, 0x9d, 0x31, 0x93, 0x75, 0x0b, 0x99, 0x1a, 0xbc, 0x11, 0xc4, 0x74, + 0xef, 0xe2, 0x39, 0xf1, 0x34, 0xc5, 0xe6, 0x17, 0x3b, 0xe1, 0x8d, 0x53, 0x2d, 0x08, 0x6f, 0x3c, + 0x36, 0xa3, 0xd2, 0x94, 0x22, 0x8f, 0x89, 0x78, 0x0e, 0xdd, 0x5e, 0x23, 0xcd, 0xe3, 0x98, 0x31, + 0xbf, 0x1d, 0x9b, 0x3b, 0x4c, 0x22, 0xdb, 0x30, 0xa6, 0x18, 0x43, 0xb5, 0x9a, 0x78, 0x41, 0xe3, + 0x58, 0xea, 0xbf, 0x4f, 0x3d, 0xcc, 0x06, 0x2e, 0xc7, 0xa6, 0x60, 0xf9, 0xf7, 0xf9, 0x05, 0x99, + 0xd9, 0x43, 0x1e, 0x73, 0x31, 0xc3, 0xdd, 0x9e, 0x6c, 0xa3, 0x5c, 0x84, 0xa3, 0x30, 0x23, 0xf7, + 0x5c, 0xc1, 0xbd, 0xe1, 0xc0, 0x96, 0xc0, 0x86, 0x75, 0xea, 0x38, 0x15, 0x9f, 0x67, 0x39, 0x12, + 0xcf, 0x95, 0x22, 0x86, 0xf9, 0x52, 0x4c, 0x0b, 0x8b, 0x6c, 0x9b, 0x53, 0x74, 0xa5, 0x9a, 0x1e, + 0x6c, 0x43, 0xa5, 0xa9, 0xcb, 0x4f, 0xf0, 0x7b, 0x9f, 0x87, 0x37, 0x06, 0x65, 0xf8, 0x51, 0x9d, + 0x67, 0x95, 0x61, 0x36, 0x36, 0xdf, 0xda, 0x83, 0x4a, 0x93, 0xc3, 0x7e, 0x05, 0xcf, 0xfb, 0x0c, + 0x33, 0xdc, 0xa9, 0x40, 0x63, 0x17, 0xbc, 0x21, 0x79, 0x0f, 0xf8, 0x69, 0x12, 0xbf, 0x03, 0x95, + 0x26, 0x52, 0x11, 0xb7, 0x87, 0x70, 0x26, 0x9e, 0xf3, 0xbb, 0x62, 0x61, 0x53, 0x11, 0x66, 0xe0, + 0xf9, 0xdf, 0x8f, 0xec, 0x0c, 0xd1, 0x00, 0x2a, 0xcf, 0x38, 0xad, 0x8a, 0x05, 0x12, 0x11, 0x67, + 0x60, 0x3a, 0x52, 0xb4, 0xc1, 0x03, 0xcf, 0xcf, 0xbb, 0x30, 0xad, 0x68, 0x04, 0x7f, 0xc4, 0x1b, + 0x92, 0x7a, 0x7d, 0x99, 0xc7, 0x0c, 0xbc, 0xb9, 0x02, 0x0b, 0x4b, 0x6e, 0xc4, 0xc2, 0x91, 0x29, + 0xa1, 0xcc, 0x32, 0x73, 0x91, 0x65, 0xf0, 0xe6, 0xe2, 0x6e, 0x4c, 0xdb, 0x8f, 0x4f, 0xee, 0x6d, + 0x8e, 0x37, 0x1d, 0x0f, 0xe1, 0x7e, 0xf8, 0x75, 0x72, 0x6f, 0x0f, 0x4c, 0xb7, 0xee, 0xc7, 0x82, + 0xa3, 0xef, 0x15, 0x94, 0xbd, 0x1e, 0x16, 0xea, 0x8c, 0xc6, 0x63, 0xf7, 0x22, 0x4c, 0xfb, 0x36, + 0xc4, 0x7d, 0xb2, 0x0a, 0xde, 0x34, 0x35, 0xe1, 0x35, 0x3b, 0xc5, 0x31, 0x78, 0xdd, 0x7f, 0x28, + 0xe4, 0x3f, 0x10, 0xcf, 0xd5, 0x23, 0x73, 0xe9, 0x3a, 0x63, 0x13, 0xa6, 0x6b, 0x30, 0xbf, 0x73, + 0x13, 0x19, 0xd3, 0xdd, 0x13, 0xcf, 0xcf, 0xf7, 0x72, 0x79, 0x76, 0x0f, 0xf5, 0x7a, 0x97, 0x72, + 0x5c, 0x8b, 0x37, 0xa1, 0xaf, 0x51, 0x3e, 0x5e, 0xc0, 0x66, 0xa0, 0xe7, 0x63, 0x01, 0xc1, 0x40, + 0xbc, 0x81, 0xbe, 0x0f, 0x0b, 0x4e, 0x06, 0x62, 0x81, 0xd0, 0xd5, 0xd8, 0xec, 0xf5, 0x4e, 0xb2, + 0x31, 0x9f, 0xe6, 0x1b, 0x00, 0xfc, 0x01, 0x6f, 0x1a, 0xdf, 0xc6, 0x9b, 0xc1, 0x74, 0xe3, 0xb0, + 0x15, 0x1e, 0xdb, 0x63, 0x31, 0x7d, 0x3e, 0x33, 0x29, 0xa7, 0x1b, 0x5e, 0x23, 0x26, 0x61, 0x7a, + 0x33, 0x02, 0xf7, 0xd9, 0x2b, 0xd8, 0x3c, 0x2c, 0xa2, 0x2f, 0xde, 0xc4, 0x8f, 0x0b, 0xcf, 0xd9, + 0x9d, 0x4a, 0x41, 0x4d, 0x47, 0x3c, 0xee, 0x1f, 0xc4, 0x63, 0xf5, 0xa0, 0xf0, 0x0e, 0x23, 0xb0, + 0x00, 0xf7, 0x5e, 0xdc, 0x17, 0x13, 0xc9, 0x04, 0xa5, 0x9b, 0xe0, 0xf5, 0xa1, 0x07, 0xe6, 0xd3, + 0x9a, 0x30, 0xdf, 0xd7, 0x19, 0x9b, 0x88, 0x5e, 0x4c, 0xc6, 0xb7, 0x2c, 0x1e, 0xe2, 0x2e, 0x49, + 0xe2, 0xc6, 0xe2, 0xf9, 0xf1, 0x6f, 0xdc, 0x4f, 0x4b, 0xe3, 0xf1, 0xf4, 0x19, 0x9e, 0x33, 0xf1, + 0xfe, 0x54, 0x3c, 0xf6, 0xb6, 0xc2, 0x63, 0x2e, 0x9a, 0x1a, 0xae, 0x1e, 0xea, 0xf7, 0x41, 0xa8, + 0xd7, 0xd2, 0x58, 0xa0, 0xfc, 0x01, 0x16, 0xb2, 0x9d, 0x84, 0x85, 0x27, 0x93, 0xf0, 0xc6, 0xf5, + 0xa4, 0xd0, 0xae, 0x0f, 0x27, 0xcf, 0x1d, 0x81, 0x85, 0xcd, 0xe3, 0xc3, 0x73, 0xa3, 0x49, 0xe0, + 0x13, 0x64, 0xfc, 0xc5, 0x4c, 0x2c, 0xc4, 0x69, 0x3d, 0x48, 0x1a, 0x2d, 0x69, 0x9b, 0x3a, 0x22, + 0xf6, 0x7f, 0x24, 0xff, 0x6f, 0xcc, 0xdd, 0xbb, 0x55, 0x56, 0xfb, 0x0e, 0x91, 0xf4, 0x7a, 0xee, + 0xde, 0x9b, 0xb2, 0xda, 0xb3, 0x73, 0x10, 0xe5, 0x1f, 0x12, 0xe2, 0x4f, 0x93, 0x55, 0x97, 0xd7, + 0xc9, 0xea, 0xc4, 0x9f, 0xe7, 0xf2, 0x9d, 0x13, 0xd2, 0xff, 0x2e, 0x17, 0xbf, 0xa8, 0x6c, 0x8e, + 0x92, 0xaf, 0xdf, 0x63, 0xca, 0x4c, 0x61, 0xd2, 0x10, 0xcd, 0x62, 0x52, 0xd3, 0x99, 0x97, 0x64, + 0x95, 0x64, 0x67, 0x49, 0x4f, 0xd4, 0x51, 0x4b, 0xb4, 0x86, 0x1a, 0xe6, 0x20, 0x49, 0xe7, 0x26, + 0xd7, 0x1f, 0x4a, 0x3a, 0x3d, 0xb9, 0x5e, 0x24, 0x3c, 0xeb, 0x98, 0x16, 0x3c, 0xff, 0x61, 0xd9, + 0x74, 0x28, 0x1f, 0xdf, 0x49, 0x56, 0x4d, 0x8f, 0x56, 0xa6, 0x6a, 0xed, 0x2e, 0xe9, 0x9f, 0xb2, + 0xea, 0x76, 0x48, 0x28, 0x3f, 0xa6, 0x7f, 0x47, 0x36, 0xe3, 0x78, 0x54, 0xd2, 0x9d, 0x92, 0x7e, + 0x12, 0xe2, 0x9b, 0x24, 0x5d, 0x26, 0xe9, 0x8f, 0xb2, 0x49, 0xcd, 0x04, 0x49, 0x83, 0x55, 0x69, + 0xee, 0x11, 0xc3, 0x60, 0xd9, 0x24, 0x27, 0xbe, 0xd3, 0xe3, 0xb2, 0x5a, 0x7e, 0x50, 0xa8, 0x67, + 0x34, 0x3d, 0xc9, 0xab, 0xcd, 0x91, 0xfb, 0x79, 0x8e, 0xa4, 0xe7, 0x64, 0x73, 0x80, 0xa5, 0x93, + 0x7b, 0x69, 0xdc, 0x77, 0xe4, 0x7e, 0x7e, 0x4a, 0xd2, 0xb6, 0xf3, 0xd8, 0x2f, 0xdb, 0x86, 0x72, + 0xae, 0x50, 0xa6, 0xee, 0xef, 0x2a, 0x8f, 0xcd, 0xb7, 0x42, 0x3f, 0x7d, 0x2f, 0xf4, 0xd5, 0x0c, + 0x79, 0xbc, 0xb4, 0x97, 0xcd, 0x88, 0xa2, 0x2a, 0x7f, 0x7f, 0x59, 0xed, 0x8a, 0xa4, 0xa5, 0x42, + 0x9b, 0xe6, 0x4d, 0xa4, 0xae, 0x96, 0xcd, 0xba, 0x76, 0x0a, 0xf7, 0xfb, 0x96, 0xd4, 0x47, 0xaa, + 0x34, 0x09, 0xb8, 0x28, 0xb4, 0x61, 0x67, 0xd9, 0x64, 0xe6, 0x82, 0x06, 0xdf, 0x2b, 0x2d, 0x27, + 0x0d, 0x5d, 0xc3, 0xbd, 0x41, 0x35, 0xd2, 0xce, 0x68, 0xa0, 0xbc, 0x77, 0x92, 0xff, 0x6f, 0x34, + 0xa3, 0x5e, 0xb5, 0xea, 0x96, 0x1f, 0x8f, 0x8d, 0xcc, 0x81, 0xb2, 0x7b, 0x31, 0x7e, 0x1b, 0x49, + 0x1f, 0xa9, 0xb6, 0x1a, 0xbf, 0x56, 0xf9, 0x31, 0x4c, 0x91, 0xc7, 0x81, 0x24, 0xfd, 0x34, 0x89, + 0x5f, 0x59, 0xd2, 0xdf, 0x6a, 0xd4, 0x7d, 0x4a, 0xf8, 0xfd, 0x79, 0xb8, 0x7f, 0x42, 0xc1, 0x3d, + 0xe4, 0x39, 0x72, 0x5e, 0xc9, 0xb3, 0x97, 0x0d, 0x79, 0x0f, 0xab, 0x53, 0xe7, 0x5b, 0x65, 0x3a, + 0xfa, 0xa2, 0xa4, 0xbf, 0x96, 0x94, 0xb5, 0x62, 0xc8, 0x7b, 0x40, 0x8d, 0xb2, 0x76, 0x93, 0xf4, + 0xa9, 0x2a, 0xc7, 0xf0, 0x69, 0x21, 0xdd, 0x64, 0xd9, 0x74, 0x6e, 0x89, 0x82, 0xb2, 0xe7, 0xa5, + 0xbf, 0xca, 0xda, 0x6f, 0xf3, 0x10, 0xbf, 0x47, 0x12, 0x97, 0x37, 0x69, 0x89, 0xe1, 0x50, 0xd9, + 0x84, 0x66, 0xf9, 0x70, 0x7d, 0x9d, 0xdc, 0x3f, 0x97, 0x4a, 0x9a, 0x94, 0xa4, 0x7b, 0x4a, 0x36, + 0x59, 0x29, 0xaa, 0xdf, 0x5a, 0x92, 0x66, 0xcb, 0x73, 0x3f, 0x6f, 0x0a, 0x98, 0x0f, 0xdf, 0x96, + 0x4d, 0x89, 0x4e, 0x97, 0xe7, 0xf5, 0xa9, 0x35, 0xd2, 0xf6, 0x90, 0xcd, 0x0b, 0x8f, 0xab, 0xd3, + 0x16, 0x7d, 0x24, 0x5d, 0xd5, 0x40, 0xdb, 0xad, 0x2b, 0xd3, 0xd0, 0xa3, 0x55, 0xbd, 0x16, 0x37, + 0x1a, 0xba, 0x48, 0x7a, 0x2f, 0xa9, 0x77, 0x8f, 0xf0, 0x8c, 0x3e, 0x25, 0xcf, 0x1e, 0xab, 0xcc, + 0x1c, 0x70, 0x53, 0x99, 0x56, 0xf7, 0x97, 0xd7, 0xd1, 0x4f, 0x94, 0xad, 0xaf, 0x2b, 0x84, 0xf4, + 0x07, 0xc9, 0xe6, 0x46, 0x73, 0x24, 0xf5, 0x0e, 0xf7, 0x3a, 0xcb, 0x6b, 0xb7, 0x92, 0xb2, 0xd7, + 0x95, 0x4d, 0x62, 0xb7, 0x08, 0xd7, 0x8b, 0xc9, 0x34, 0x2f, 0x1d, 0xc3, 0x45, 0x6d, 0x15, 0xdb, + 0x4b, 0x92, 0x76, 0x0e, 0xd7, 0xdb, 0xc8, 0xfd, 0xb7, 0xaf, 0x2a, 0xcd, 0x91, 0x24, 0x8f, 0x81, + 0x68, 0x1e, 0xb6, 0x59, 0x88, 0x8b, 0xe3, 0x6a, 0xb0, 0xbc, 0xae, 0xa5, 0xf5, 0x42, 0x36, 0xe3, + 0x1d, 0x53, 0x10, 0x9f, 0xd6, 0x67, 0x67, 0xd9, 0x9c, 0xb6, 0x68, 0x3d, 0x4c, 0xd3, 0x2d, 0xa9, + 0x8c, 0xfe, 0x3f, 0x2a, 0x9b, 0x8f, 0x21, 0x9b, 0x5e, 0xcd, 0x91, 0x4d, 0x16, 0x51, 0x66, 0xfe, + 0xbb, 0x77, 0x41, 0xbe, 0x27, 0x64, 0x53, 0x5d, 0x94, 0x99, 0x8d, 0xc6, 0x77, 0xe8, 0x21, 0xd3, + 0xba, 0x2d, 0xc3, 0xf5, 0x42, 0xa1, 0xec, 0x1b, 0x92, 0x77, 0x3e, 0x25, 0xe4, 0xb9, 0x47, 0xd9, + 0xfa, 0xda, 0x43, 0xe6, 0xdd, 0xf6, 0x93, 0xcd, 0x4a, 0xe7, 0x28, 0xe3, 0x05, 0x17, 0x97, 0xd7, + 0xfc, 0xf4, 0xfd, 0xf7, 0x97, 0x4d, 0xdc, 0x24, 0xd3, 0xfd, 0xe1, 0x72, 0x9f, 0x9e, 0x1e, 0xde, + 0x2b, 0x9a, 0x15, 0xaf, 0x2f, 0xd3, 0x91, 0x5a, 0xf3, 0xbf, 0x43, 0x78, 0x56, 0x1a, 0x5f, 0x14, + 0x87, 0xa4, 0x67, 0x55, 0xc9, 0xf7, 0x2d, 0x16, 0x9e, 0x17, 0xaf, 0xff, 0xa5, 0x4a, 0x93, 0xe6, + 0x03, 0x42, 0x19, 0x3f, 0x4c, 0xe2, 0x26, 0x84, 0x7c, 0xf1, 0x7a, 0xaf, 0xf0, 0xee, 0x9b, 0x86, + 0xeb, 0xf3, 0x25, 0xed, 0x9a, 0xab, 0xf3, 0x73, 0x72, 0xff, 0xc6, 0xeb, 0xc8, 0xd7, 0xc4, 0xf7, + 0x89, 0xfd, 0xb8, 0xbe, 0x3c, 0xf6, 0xe2, 0xda, 0xba, 0x84, 0xcc, 0x3f, 0x94, 0xbd, 0xfb, 0x7b, + 0x32, 0x4f, 0x85, 0x6c, 0xba, 0xf7, 0xa0, 0x3c, 0x97, 0x57, 0x49, 0xd2, 0x5c, 0xda, 0x3e, 0xec, + 0x0c, 0xde, 0xae, 0xc3, 0xc3, 0xa7, 0x3b, 0xea, 0xbc, 0xfa, 0xa7, 0x3f, 0x96, 0x0a, 0x9e, 0x82, + 0x77, 0x7a, 0xa3, 0xf1, 0x6e, 0x18, 0xbc, 0x63, 0xda, 0x00, 0x1f, 0xc8, 0x99, 0x8b, 0x77, 0xe9, + 0x3d, 0xb0, 0xa4, 0x7d, 0x27, 0xac, 0x7e, 0x3c, 0x12, 0x9b, 0x76, 0xac, 0x8a, 0xa5, 0x33, 0x23, + 0xf0, 0xee, 0xfe, 0x58, 0xac, 0x3a, 0xec, 0x99, 0x3c, 0xab, 0x2f, 0xde, 0xd1, 0xe5, 0xb1, 0x06, + 0xd9, 0x61, 0xcb, 0x14, 0x53, 0x93, 0xfb, 0x11, 0xab, 0x63, 0xa9, 0xe9, 0x27, 0x54, 0xaa, 0x3c, + 0x37, 0xa7, 0xfa, 0x40, 0x64, 0xff, 0xe4, 0xfa, 0x22, 0x5a, 0x86, 0xdd, 0x70, 0xfb, 0x44, 0x74, + 0x26, 0x93, 0x76, 0x43, 0xa6, 0x0a, 0x6d, 0xae, 0x07, 0x94, 0x1f, 0xe1, 0x76, 0x3e, 0x31, 0x17, + 0x7f, 0x33, 0x96, 0x26, 0x6c, 0x82, 0x0f, 0x27, 0xcd, 0xc6, 0x3b, 0xde, 0x8b, 0xc8, 0x0e, 0x2b, + 0xe5, 0xf1, 0x6d, 0x2c, 0x85, 0xde, 0x0c, 0x4b, 0x97, 0xaf, 0xc7, 0x3b, 0xf5, 0x0d, 0x80, 0xb5, + 0xf1, 0x4e, 0x73, 0x07, 0x6c, 0x7e, 0x73, 0x42, 0x08, 0x29, 0x3a, 0x63, 0xb5, 0x7a, 0x34, 0x0f, + 0xfa, 0x0c, 0x4b, 0x89, 0x3f, 0xc2, 0x3b, 0xff, 0xe7, 0xb0, 0x59, 0x11, 0x58, 0x82, 0xdb, 0x17, + 0x4b, 0x04, 0xc1, 0x63, 0x60, 0x03, 0xac, 0xbd, 0xd9, 0x08, 0x8f, 0x83, 0xd4, 0xcc, 0x26, 0x8d, + 0x7b, 0x2e, 0xfc, 0x6e, 0x8c, 0x77, 0xfe, 0xf3, 0x82, 0x51, 0xa1, 0x9c, 0xe9, 0x64, 0x52, 0xcb, + 0xe1, 0x58, 0xda, 0x39, 0x1c, 0x8f, 0xd9, 0xc9, 0x58, 0x8a, 0x76, 0x1f, 0x1e, 0x2f, 0x03, 0x43, + 0x5d, 0x63, 0x9b, 0xaf, 0x81, 0xc7, 0x12, 0x58, 0x92, 0x05, 0x95, 0x87, 0x7b, 0x17, 0xc5, 0xd2, + 0xa2, 0x89, 0xa1, 0x8c, 0x0f, 0xa9, 0x6d, 0xda, 0xd2, 0x1f, 0xef, 0xca, 0xa7, 0x61, 0xc9, 0x51, + 0xdf, 0xf0, 0xdc, 0xe5, 0x28, 0x37, 0x3d, 0x6a, 0x14, 0x33, 0xc2, 0xef, 0xd2, 0xb9, 0xf8, 0xfe, + 0x64, 0x63, 0xbc, 0x4c, 0xad, 0x9e, 0xa6, 0x59, 0x36, 0x89, 0xef, 0x5a, 0x50, 0xaf, 0x65, 0xb0, + 0xf9, 0x40, 0x1a, 0xca, 0xca, 0x8a, 0xa1, 0x7f, 0xad, 0x8a, 0xb7, 0x00, 0x2b, 0xe1, 0xc3, 0xe0, + 0xef, 0x53, 0x7d, 0x28, 0xbc, 0x25, 0x98, 0x8c, 0x35, 0x01, 0x87, 0x26, 0x71, 0x87, 0x51, 0xdb, + 0x23, 0x54, 0xc4, 0x15, 0xd8, 0x9c, 0xe8, 0x54, 0x8a, 0x0f, 0xf7, 0x2d, 0x43, 0xb9, 0xe6, 0x2a, + 0xb6, 0x6d, 0xd9, 0x21, 0xb4, 0x4e, 0x58, 0xab, 0xf2, 0x43, 0x2c, 0x11, 0xfb, 0x2e, 0xa6, 0xe7, + 0x45, 0x88, 0xf1, 0xdf, 0xc9, 0xc5, 0xf7, 0xc7, 0x92, 0xa8, 0xe9, 0x78, 0x9e, 0xef, 0x4e, 0xa5, + 0x99, 0xdf, 0xc9, 0xb8, 0x0d, 0x57, 0xc2, 0x26, 0x42, 0x53, 0xf1, 0xf8, 0xcf, 0x9b, 0x85, 0xb5, + 0x36, 0x1e, 0xc1, 0xde, 0xb8, 0xf6, 0x09, 0xd7, 0xeb, 0x61, 0x49, 0x5f, 0x91, 0x59, 0xc6, 0x1d, + 0x78, 0x8d, 0xda, 0x16, 0xd3, 0xa2, 0xef, 0x60, 0x69, 0xe6, 0x75, 0xf8, 0x50, 0xe0, 0x9a, 0x40, + 0x77, 0x7c, 0x60, 0xb3, 0xcc, 0xd4, 0xea, 0x79, 0xdc, 0x57, 0x5d, 0x4a, 0x9e, 0x91, 0xe2, 0x2d, + 0xbc, 0x66, 0x1d, 0x82, 0xd7, 0xa8, 0x22, 0xb3, 0x48, 0xb0, 0x04, 0x6e, 0x18, 0x96, 0xb0, 0x0d, + 0xad, 0x53, 0xe6, 0x28, 0x4c, 0xd3, 0xeb, 0x69, 0x9b, 0x2e, 0xc4, 0x6b, 0xe3, 0x39, 0x98, 0x6e, + 0xef, 0x54, 0x27, 0x7d, 0x11, 0x16, 0xc5, 0xa6, 0x84, 0x97, 0x87, 0xeb, 0xa8, 0x69, 0xd9, 0xa0, + 0x24, 0xfd, 0x7d, 0x98, 0x3e, 0xc7, 0xb4, 0x77, 0x60, 0x93, 0xc2, 0xdf, 0x61, 0xc9, 0x65, 0x34, + 0x4d, 0x9d, 0x86, 0xc7, 0xd0, 0x6c, 0x3c, 0x66, 0xee, 0x25, 0x33, 0x23, 0xfa, 0x84, 0x6a, 0x8d, + 0xce, 0x19, 0x58, 0xfa, 0x19, 0xcd, 0x1f, 0x3f, 0xc6, 0x63, 0xb1, 0x2f, 0xf5, 0xb1, 0x6e, 0xf8, + 0x6d, 0x0a, 0xbf, 0x0f, 0xe3, 0xf6, 0x5e, 0x89, 0x6a, 0xcd, 0xec, 0xf5, 0x64, 0x34, 0xfe, 0x89, + 0xf0, 0xdb, 0x3d, 0xfc, 0xfe, 0x2f, 0xc5, 0x9a, 0xbf, 0x4b, 0x31, 0x2f, 0x53, 0x86, 0x1e, 0x58, + 0x72, 0x7f, 0x20, 0xf5, 0x5d, 0x36, 0x7f, 0x80, 0x25, 0xe2, 0xe0, 0xb6, 0x8a, 0x73, 0x71, 0x22, + 0xee, 0xef, 0xcb, 0xc2, 0x75, 0x34, 0x51, 0x5c, 0xa3, 0x20, 0xdf, 0xcd, 0x64, 0xe6, 0xc4, 0xb1, + 0x1d, 0xe3, 0x3b, 0x9c, 0x4e, 0xa6, 0xbd, 0x00, 0xf3, 0x17, 0xa7, 0x62, 0xe9, 0xf3, 0x16, 0xb8, + 0xaf, 0x4f, 0x0d, 0xf7, 0x1e, 0x20, 0xa3, 0x2b, 0xe3, 0x43, 0xf9, 0x47, 0x91, 0xf5, 0x57, 0x7c, + 0xe7, 0x8f, 0xb0, 0x84, 0x3c, 0xc5, 0x95, 0x64, 0xbc, 0xdd, 0x76, 0x78, 0x3d, 0xdc, 0x05, 0x3b, + 0xa2, 0x58, 0x07, 0x5b, 0x4c, 0x74, 0xc6, 0xf4, 0xb2, 0x9e, 0x16, 0x68, 0x2e, 0xd5, 0xed, 0x5b, + 0x14, 0x07, 0x36, 0xe9, 0xdc, 0x91, 0xcc, 0x84, 0x70, 0x57, 0x2a, 0xf9, 0xc0, 0x91, 0x98, 0x6e, + 0xc5, 0xb9, 0xb3, 0x27, 0x6e, 0xdb, 0x78, 0x50, 0xbe, 0x1b, 0xb6, 0x16, 0xf8, 0x38, 0xc9, 0x73, + 0x3d, 0xd6, 0xa0, 0xfc, 0x25, 0xbc, 0x43, 0xd1, 0xc1, 0xff, 0xe1, 0x98, 0x7f, 0x5b, 0x22, 0x5c, + 0xef, 0x40, 0x36, 0x56, 0xce, 0xc2, 0xfd, 0xd8, 0x01, 0x8f, 0x95, 0xfb, 0xb1, 0x16, 0xa0, 0x2b, + 0xa6, 0x23, 0x23, 0x0a, 0xde, 0x23, 0xe2, 0x44, 0xcc, 0x07, 0xf4, 0xc3, 0x1a, 0xab, 0x7d, 0xf1, + 0x9c, 0x1e, 0x81, 0xfb, 0x7e, 0x65, 0x60, 0xb3, 0xf6, 0x58, 0x6d, 0xf3, 0x4e, 0x71, 0x19, 0xff, + 0x8f, 0x94, 0x39, 0xcf, 0x33, 0x77, 0xd3, 0xb1, 0xea, 0x70, 0x6d, 0xdc, 0xe9, 0xdd, 0xf1, 0x84, + 0x5d, 0x11, 0xab, 0xbf, 0x3e, 0xc6, 0x13, 0xf6, 0xbf, 0xb0, 0x4d, 0xe5, 0x6f, 0xb0, 0xea, 0x60, + 0x37, 0xdc, 0x80, 0xcf, 0xe0, 0x46, 0xdd, 0x11, 0x13, 0x9c, 0x6e, 0x98, 0xd1, 0xfb, 0x53, 0x78, + 0xd9, 0xdb, 0x30, 0xd3, 0x48, 0x78, 0x99, 0x6b, 0x0a, 0xea, 0xb7, 0x38, 0x95, 0x76, 0xc0, 0x11, + 0xb3, 0x92, 0xfb, 0xf5, 0xf0, 0x08, 0x95, 0xf6, 0xd3, 0xe0, 0xc6, 0x8a, 0xd7, 0x83, 0x0a, 0xf2, + 0x34, 0x51, 0xcd, 0xd0, 0xa7, 0xe8, 0x84, 0xeb, 0x3e, 0x26, 0x89, 0xfb, 0x84, 0x4a, 0x75, 0xd4, + 0xc2, 0x49, 0x7c, 0xa3, 0x58, 0x1c, 0x0f, 0xd8, 0x83, 0xc9, 0x6c, 0xcc, 0x23, 0x76, 0xc7, 0x04, + 0xea, 0x70, 0xdc, 0x0f, 0x07, 0x63, 0x66, 0xfa, 0x46, 0xca, 0x6d, 0xf7, 0xe2, 0x82, 0x25, 0x3c, + 0xb0, 0x6e, 0x08, 0x79, 0x16, 0x0f, 0x75, 0x8f, 0x66, 0x2a, 0xff, 0xc2, 0xea, 0xb4, 0x43, 0x72, + 0xf9, 0x0f, 0x0d, 0xf5, 0x8f, 0x9b, 0x90, 0xe8, 0x71, 0x67, 0x5f, 0x6c, 0x3a, 0xd2, 0x0b, 0x13, + 0x85, 0x25, 0xf0, 0xe2, 0x72, 0x24, 0xee, 0xdf, 0x31, 0x78, 0xc1, 0x5f, 0x11, 0xb7, 0xff, 0x27, + 0x54, 0x33, 0x7b, 0x69, 0xdc, 0x01, 0x78, 0x31, 0x3a, 0x97, 0x4a, 0x26, 0x11, 0x1a, 0x33, 0x6b, + 0x49, 0xb1, 0x0c, 0x1e, 0x6f, 0x7d, 0xc8, 0xbc, 0x18, 0xcc, 0xc4, 0x6a, 0xb1, 0x13, 0xc8, 0x08, + 0xe1, 0x9a, 0x64, 0xe6, 0x5e, 0x87, 0x62, 0x55, 0x6b, 0xdc, 0x50, 0xad, 0x47, 0xc6, 0x9c, 0x7f, + 0x3b, 0xfc, 0xbe, 0x9e, 0x3c, 0x23, 0x7a, 0xcd, 0x20, 0xe4, 0xb9, 0x13, 0xf8, 0x31, 0x95, 0x0c, + 0x7c, 0x8a, 0x11, 0xd8, 0xbb, 0xc5, 0x32, 0x78, 0xd1, 0x98, 0x80, 0x99, 0x93, 0x19, 0xcc, 0xbb, + 0x3d, 0x6a, 0x64, 0xca, 0xa7, 0xe7, 0xe2, 0x47, 0x90, 0x8d, 0xf1, 0x57, 0x28, 0x46, 0x9a, 0x26, + 0x3d, 0x8b, 0x32, 0x9d, 0x6a, 0x66, 0x7f, 0x11, 0x4c, 0x03, 0x4e, 0xc0, 0x9b, 0xf1, 0x35, 0x72, + 0xf7, 0xd3, 0xb2, 0x62, 0x18, 0x51, 0xab, 0xe2, 0x2d, 0xc0, 0x6e, 0x98, 0xde, 0x0c, 0xc1, 0x1b, + 0xd2, 0xd5, 0x5a, 0xa1, 0xcc, 0x4b, 0xf0, 0x82, 0xb4, 0x3a, 0x7e, 0xc7, 0xcd, 0x68, 0xdc, 0x2d, + 0xdc, 0x20, 0xbc, 0x38, 0x8c, 0xa4, 0x7a, 0x13, 0x3e, 0x93, 0xf2, 0xbe, 0x8d, 0x6d, 0x9b, 0x57, + 0xb9, 0xf7, 0xc7, 0x0b, 0xe9, 0xad, 0xc0, 0x92, 0x98, 0x01, 0x7d, 0x04, 0x33, 0x09, 0x65, 0x36, + 0xb2, 0x31, 0x3e, 0xcf, 0x48, 0x8c, 0xc0, 0x73, 0x74, 0xc3, 0x50, 0xb7, 0xbc, 0x6d, 0xa8, 0xb0, + 0x39, 0xc1, 0x0a, 0xb8, 0x4d, 0x5f, 0xc7, 0x26, 0x89, 0x7f, 0x2c, 0x79, 0x4e, 0x2d, 0x14, 0x31, + 0xf4, 0x0b, 0x51, 0xce, 0x30, 0x5f, 0x8e, 0x17, 0xce, 0xc5, 0x29, 0x36, 0x69, 0x89, 0x78, 0x15, + 0x9b, 0x44, 0x6c, 0x8f, 0xe7, 0xdc, 0x3d, 0x21, 0x7e, 0x14, 0x9e, 0x3b, 0x7b, 0xe2, 0x85, 0xf5, + 0x9e, 0xc2, 0xdc, 0xc6, 0xb2, 0x98, 0x6e, 0xbe, 0x8f, 0x69, 0x53, 0x3d, 0x9c, 0x15, 0xf2, 0xbc, + 0x42, 0xf5, 0x9c, 0x8a, 0x38, 0x1e, 0xcf, 0x85, 0x5f, 0x50, 0xff, 0xfc, 0xc5, 0xa7, 0x78, 0xbe, + 0xf7, 0xac, 0x91, 0x66, 0x1f, 0xcc, 0xb0, 0xdd, 0x84, 0xfb, 0xe5, 0x30, 0xcc, 0xf4, 0x37, 0xd7, + 0x7c, 0x6c, 0x1a, 0x5e, 0x6f, 0xdf, 0xc3, 0xeb, 0xc3, 0x9f, 0x43, 0xfc, 0xc2, 0xa5, 0x39, 0x2a, + 0x31, 0x19, 0xd3, 0xbe, 0xad, 0xb1, 0x87, 0xa5, 0x14, 0xbf, 0xc2, 0xe3, 0x7c, 0x73, 0x2a, 0xcd, + 0x37, 0x8b, 0xd0, 0x0b, 0xd3, 0xdb, 0xa6, 0x10, 0xc6, 0xe1, 0xfe, 0x7e, 0xa3, 0x34, 0x47, 0x86, + 0x3b, 0xb0, 0x10, 0x28, 0x7a, 0x34, 0xeb, 0x87, 0xdb, 0xa4, 0xde, 0x39, 0x87, 0x68, 0xd6, 0x33, + 0x2f, 0x1e, 0xda, 0xd6, 0xc6, 0x6b, 0xe4, 0x5a, 0xcc, 0xdb, 0x26, 0xf5, 0xf3, 0xdc, 0x75, 0x1c, + 0x23, 0xf5, 0xec, 0xdc, 0xf3, 0xef, 0xb0, 0x05, 0xee, 0x93, 0x14, 0x91, 0xd1, 0xff, 0x41, 0x9d, + 0xb2, 0x26, 0xe1, 0xbe, 0xdc, 0x8c, 0xfa, 0xfd, 0x95, 0xe2, 0x26, 0x2a, 0x85, 0x8c, 0x67, 0x60, + 0x33, 0xd6, 0x57, 0xf1, 0xdc, 0x28, 0x32, 0xd3, 0x6b, 0x29, 0x2e, 0xc7, 0xef, 0x1c, 0x37, 0xea, + 0x7b, 0x52, 0x79, 0x7e, 0x6a, 0x24, 0x16, 0x60, 0xf5, 0xc4, 0x0c, 0xfc, 0x2c, 0xcc, 0x3b, 0xf6, + 0xc5, 0x63, 0x7a, 0x77, 0x8a, 0x85, 0xba, 0x87, 0x63, 0xb3, 0xa9, 0xdf, 0x53, 0x69, 0x8e, 0x15, + 0xf1, 0xb7, 0x90, 0x3f, 0x9a, 0xc6, 0xed, 0x49, 0x66, 0xc6, 0x18, 0x4d, 0xbb, 0x8e, 0xc1, 0x1b, + 0x93, 0xe8, 0x01, 0xaf, 0x5d, 0x08, 0xb5, 0x36, 0x6c, 0xb1, 0x9f, 0xdb, 0xe1, 0x8d, 0xd6, 0x14, + 0xcc, 0x9b, 0xed, 0x87, 0xcd, 0x91, 0xae, 0x01, 0x7e, 0xdd, 0x1e, 0x33, 0xe6, 0x65, 0xc4, 0xa5, + 0x09, 0x0f, 0xf6, 0x2d, 0xc2, 0xff, 0x07, 0xb0, 0xc4, 0xb3, 0xa9, 0x20, 0xed, 0xf3, 0x98, 0xb0, + 0xed, 0x8a, 0x17, 0x95, 0x3d, 0xc9, 0x18, 0xf7, 0x1e, 0x78, 0x17, 0x72, 0x7a, 0x08, 0xb3, 0xf0, + 0x0e, 0x63, 0x16, 0x19, 0x03, 0xbd, 0x1c, 0x96, 0xcc, 0x8e, 0x4d, 0xca, 0x1c, 0x4c, 0x66, 0x0f, + 0x78, 0x7c, 0xf8, 0x2d, 0x62, 0xc2, 0x3f, 0xa4, 0xd8, 0xf5, 0x5d, 0xe7, 0xe4, 0xfe, 0xfc, 0x40, + 0x2f, 0xaa, 0x19, 0xfa, 0x14, 0xdb, 0xe2, 0xf7, 0x49, 0x27, 0xe1, 0x14, 0xfc, 0xae, 0x11, 0xcb, + 0x27, 0xf1, 0x8d, 0xa0, 0x3d, 0x1e, 0x98, 0xc3, 0x28, 0xde, 0xa8, 0x44, 0x8c, 0xc5, 0x83, 0xf6, + 0x4c, 0xdc, 0xae, 0x7b, 0x51, 0x2d, 0xa9, 0x6c, 0x2a, 0xc9, 0xfb, 0x02, 0xde, 0xbd, 0xbd, 0x4b, + 0xf5, 0x81, 0xb7, 0xb7, 0xc8, 0x18, 0x51, 0xb0, 0x14, 0x66, 0x30, 0x66, 0xba, 0xe3, 0x80, 0x1c, + 0x89, 0x77, 0xdd, 0xe3, 0xf1, 0x6e, 0xfe, 0xa7, 0x78, 0x00, 0xc7, 0x03, 0x5e, 0x97, 0xe2, 0x71, + 0xd4, 0x13, 0x33, 0xc6, 0x2b, 0xe2, 0x89, 0x50, 0x0f, 0x37, 0x61, 0xc6, 0x7f, 0x3a, 0xb6, 0x2b, + 0x3b, 0x92, 0x6c, 0x61, 0xfa, 0x0b, 0xc5, 0x87, 0x54, 0x63, 0x88, 0x13, 0xa2, 0x63, 0xc8, 0xf7, + 0x34, 0x5e, 0xb8, 0xd7, 0x0f, 0xe5, 0x82, 0x17, 0xa9, 0x0f, 0x6a, 0x3c, 0x7f, 0x1d, 0x2a, 0x25, + 0x93, 0x29, 0x73, 0xde, 0x1b, 0x8f, 0xe5, 0xd4, 0x2e, 0xbc, 0x5f, 0x78, 0x76, 0x53, 0x08, 0xdf, + 0xc7, 0x63, 0xb2, 0x4f, 0xad, 0x97, 0xc4, 0xed, 0x78, 0x23, 0xb6, 0x69, 0x3c, 0x1b, 0xcf, 0xc1, + 0x1e, 0x25, 0x69, 0x3b, 0xd0, 0xd8, 0xe2, 0x1c, 0x5d, 0x98, 0x8d, 0xab, 0x91, 0x26, 0xba, 0xbb, + 0xfc, 0x7e, 0x8d, 0x34, 0x6b, 0x26, 0xff, 0x47, 0x53, 0x6d, 0xb7, 0xff, 0x26, 0xb6, 0xbf, 0x8c, + 0xcf, 0xb9, 0xa4, 0x81, 0xba, 0xb5, 0x36, 0x2e, 0xc1, 0xf3, 0xe9, 0x32, 0xcc, 0x3c, 0x9d, 0xd9, + 0x8c, 0xbc, 0x8b, 0x52, 0xbc, 0x99, 0xbf, 0x01, 0xd3, 0xca, 0x43, 0xb0, 0x7b, 0xb6, 0x22, 0x62, + 0x5f, 0x86, 0x0f, 0xf1, 0xc2, 0xd2, 0x8d, 0x6a, 0xc6, 0xef, 0x11, 0xb2, 0xc3, 0xd2, 0x79, 0x44, + 0xcd, 0x5e, 0x5e, 0x82, 0x35, 0x02, 0x6f, 0x14, 0xb6, 0xc7, 0x82, 0x8e, 0xc8, 0xcc, 0xbc, 0x84, + 0xb5, 0x4c, 0x45, 0x88, 0xf1, 0x65, 0x1b, 0xf4, 0xd7, 0xf1, 0x78, 0x1b, 0x4c, 0x25, 0x2d, 0x8d, + 0xff, 0x3f, 0xc4, 0x34, 0x67, 0x43, 0xbc, 0xa9, 0x3e, 0xb8, 0xa4, 0x9c, 0x32, 0xbc, 0x4f, 0xf1, + 0xe1, 0xd9, 0x15, 0x28, 0xb7, 0xeb, 0xbd, 0x12, 0x33, 0x20, 0xbb, 0x63, 0x26, 0xac, 0x96, 0x4b, + 0xcb, 0x3b, 0x30, 0xbd, 0xdd, 0x8b, 0x6c, 0x3e, 0xcf, 0x09, 0xff, 0xf7, 0xa0, 0xdc, 0xde, 0x3c, + 0xe2, 0x2c, 0x2c, 0x01, 0xfc, 0x2d, 0xde, 0xdc, 0xed, 0x50, 0x23, 0x2d, 0x64, 0xe7, 0x76, 0xca, + 0xce, 0x2c, 0xad, 0x8d, 0x25, 0x64, 0x7f, 0xa4, 0x9a, 0x81, 0x2d, 0xc3, 0x2d, 0x14, 0xbb, 0x54, + 0x8c, 0xb8, 0x9b, 0x4a, 0xed, 0xcd, 0x93, 0x98, 0xa6, 0xe6, 0x99, 0xbc, 0x7a, 0x88, 0x2e, 0x8c, + 0x47, 0x63, 0x06, 0xbd, 0x48, 0xf0, 0x54, 0x0b, 0xc2, 0xf4, 0xb4, 0x03, 0xc5, 0x9a, 0x58, 0x30, + 0x4d, 0xaa, 0xf7, 0x85, 0xc3, 0x85, 0xb0, 0x76, 0xa3, 0x57, 0x08, 0x3f, 0xc4, 0x73, 0xa4, 0x16, + 0xfd, 0x89, 0x98, 0x88, 0x05, 0x7d, 0xa7, 0xe0, 0x35, 0x66, 0x00, 0x99, 0x8b, 0xd0, 0xf9, 0x8d, + 0x0d, 0xb1, 0x90, 0xa8, 0x0b, 0xc5, 0x2e, 0xa2, 0x17, 0x34, 0xda, 0x51, 0xdd, 0xd6, 0xf1, 0xba, + 0xec, 0xac, 0x4b, 0x9a, 0x6e, 0x2e, 0x8d, 0xf5, 0x57, 0x8a, 0x3c, 0x1f, 0x76, 0x3a, 0xde, 0x90, + 0xdd, 0x85, 0x0f, 0x54, 0x3f, 0x45, 0xa5, 0x2b, 0xd8, 0x79, 0xc1, 0x7b, 0x78, 0x9c, 0x1c, 0x80, + 0x69, 0x73, 0x27, 0x2a, 0xb5, 0x23, 0x2f, 0xe3, 0x31, 0xb0, 0x27, 0xa6, 0xcd, 0xd7, 0x86, 0xd0, + 0x19, 0xd3, 0x8d, 0xed, 0xa9, 0x76, 0x3c, 0x02, 0xa6, 0x69, 0x53, 0xb0, 0x00, 0x69, 0xd5, 0x82, + 0xfb, 0x6f, 0x62, 0xba, 0xb2, 0x1f, 0x1e, 0xab, 0xab, 0x50, 0xb9, 0x09, 0x5a, 0x03, 0x6b, 0x24, + 0x8e, 0x27, 0x13, 0x6c, 0xbd, 0x8d, 0xf9, 0xad, 0x01, 0x35, 0xde, 0xe7, 0xf7, 0xe1, 0x7d, 0xae, + 0xa5, 0x52, 0x6b, 0x3c, 0x0d, 0xd3, 0xaf, 0xad, 0x80, 0x3b, 0xdb, 0x63, 0xe2, 0x51, 0xb6, 0xab, + 0xef, 0x85, 0x89, 0xf5, 0xd0, 0xf0, 0xff, 0x24, 0xdc, 0x09, 0xbd, 0xc2, 0xfd, 0x4e, 0xa1, 0xf2, + 0x3f, 0x4e, 0xf2, 0x4c, 0x0c, 0xbf, 0xf9, 0x5d, 0x78, 0x6f, 0xac, 0x2a, 0x89, 0x07, 0x0c, 0x66, + 0x62, 0xc2, 0x1b, 0x77, 0x7f, 0xef, 0x63, 0xe6, 0xa6, 0x5b, 0x92, 0x47, 0xa1, 0xf2, 0x53, 0x70, + 0x23, 0x8c, 0x2c, 0xa9, 0xe7, 0xf3, 0x14, 0x0f, 0x84, 0x95, 0x92, 0xfb, 0x0b, 0x02, 0x9d, 0xa9, + 0x94, 0x24, 0xe6, 0x4d, 0x5a, 0xc0, 0x4c, 0x5a, 0x7a, 0xc0, 0x6b, 0x03, 0xdc, 0xfe, 0x8d, 0x7a, + 0x36, 0xb8, 0x00, 0xab, 0xe6, 0xf2, 0x92, 0xab, 0xf3, 0xa8, 0x3e, 0x70, 0xf4, 0x39, 0x9e, 0x9c, + 0x6b, 0x61, 0x46, 0xb8, 0x17, 0x95, 0x92, 0xca, 0x5e, 0x98, 0xc0, 0x0f, 0xc9, 0xe5, 0x5b, 0x0d, + 0xab, 0x80, 0x1f, 0xa0, 0x9a, 0x29, 0xfc, 0x36, 0x95, 0x1b, 0x89, 0x81, 0x58, 0x7a, 0x37, 0x2c, + 0x89, 0x5b, 0x8b, 0xca, 0x05, 0xf7, 0xd9, 0xf0, 0x9b, 0x97, 0xb2, 0x82, 0x17, 0xb0, 0x27, 0x30, + 0x33, 0x9a, 0x6f, 0x3f, 0x70, 0xfb, 0xa4, 0xea, 0xd6, 0x59, 0x98, 0x20, 0x6f, 0x8d, 0x19, 0x94, + 0x89, 0xd4, 0x3f, 0x4c, 0x1b, 0xb1, 0x75, 0x48, 0xbf, 0x3d, 0x5e, 0x08, 0x4e, 0x26, 0xdb, 0x1c, + 0x82, 0x0f, 0x3b, 0xce, 0xce, 0xe5, 0x99, 0x4a, 0x26, 0xfd, 0x7d, 0x3b, 0xa9, 0x4b, 0x1f, 0xbc, + 0x81, 0x99, 0x8b, 0xd5, 0xe8, 0x27, 0xe1, 0x83, 0x2e, 0x51, 0x0b, 0xb5, 0x28, 0x96, 0x9a, 0x6d, + 0x42, 0xd6, 0xee, 0x9b, 0x62, 0xe6, 0xbf, 0x51, 0xaf, 0x2d, 0x9f, 0x62, 0x29, 0xfb, 0xd0, 0x90, + 0xb7, 0xc8, 0x47, 0xf0, 0xb9, 0x54, 0x9b, 0x36, 0xe5, 0xd1, 0x0e, 0xab, 0xdf, 0x6f, 0xa7, 0x5a, + 0xc2, 0x92, 0xc7, 0x52, 0x54, 0x1f, 0xac, 0x2e, 0xc3, 0x59, 0x78, 0x21, 0xdd, 0xb5, 0xc1, 0xf4, + 0x0b, 0x0a, 0x73, 0x93, 0xdf, 0xdf, 0xe0, 0xf6, 0xde, 0xb2, 0x3c, 0x79, 0x05, 0x4e, 0xa2, 0xd8, + 0x73, 0xd0, 0x6c, 0xbc, 0xa9, 0xec, 0x8f, 0x0f, 0x42, 0x35, 0xe2, 0xf9, 0x26, 0xc5, 0xa3, 0x78, + 0x21, 0x3f, 0x04, 0xcf, 0x97, 0x88, 0x8b, 0x43, 0xdd, 0xd6, 0x29, 0xc8, 0x73, 0x30, 0xd9, 0xb7, + 0x00, 0x1a, 0xc1, 0x1d, 0x78, 0x9e, 0x17, 0x49, 0xf3, 0xb6, 0xc5, 0xe3, 0x29, 0xef, 0xad, 0x24, + 0xc5, 0x68, 0xac, 0xdd, 0xea, 0x95, 0xc4, 0xcd, 0xa2, 0xd2, 0xdb, 0xcc, 0xe7, 0x64, 0x07, 0xa3, + 0x9a, 0x83, 0x47, 0xf1, 0x7c, 0x4d, 0xeb, 0xb6, 0x50, 0x88, 0x2b, 0xa3, 0x7d, 0xaf, 0x87, 0x3a, + 0x9d, 0x84, 0x17, 0xbf, 0x5a, 0x07, 0xae, 0x6e, 0x0f, 0xf5, 0xdc, 0x88, 0x4a, 0x09, 0xe0, 0x75, + 0x58, 0x2a, 0xd8, 0x0d, 0xd3, 0xb4, 0x22, 0xc4, 0x8d, 0xf5, 0x04, 0xdc, 0xc7, 0x8f, 0x61, 0xad, + 0x5a, 0x4b, 0x0f, 0x34, 0xb7, 0xc3, 0xc2, 0x82, 0xf8, 0xcd, 0x80, 0x14, 0x77, 0x54, 0xa5, 0xce, + 0x70, 0x1b, 0xb5, 0x37, 0xee, 0xd3, 0xa9, 0x96, 0x2a, 0x37, 0x47, 0xda, 0x19, 0x71, 0x00, 0x1e, + 0x8b, 0x3b, 0x61, 0xba, 0x9b, 0xa7, 0x79, 0xf5, 0x10, 0x85, 0x12, 0x4f, 0x52, 0xee, 0x87, 0x7d, + 0x22, 0x99, 0xe9, 0x49, 0x19, 0x9e, 0xa4, 0xf1, 0x79, 0x99, 0x47, 0x0f, 0xbc, 0xe9, 0xee, 0x49, + 0x26, 0xe8, 0xf9, 0x47, 0x0b, 0xcb, 0x6a, 0x2e, 0xae, 0xc5, 0xc2, 0x9d, 0xd3, 0x30, 0xad, 0x58, + 0xb3, 0x76, 0xf2, 0xf9, 0x8e, 0x47, 0xa9, 0xa6, 0x1f, 0xf1, 0xf0, 0xed, 0x78, 0x6a, 0x23, 0xf6, + 0x65, 0x23, 0xfd, 0x55, 0x0b, 0xfb, 0xe0, 0xf9, 0xb3, 0x3f, 0x3e, 0x40, 0xbe, 0x1c, 0x8d, 0xad, + 0x73, 0x73, 0xa9, 0xbf, 0x81, 0x00, 0x0b, 0x5c, 0x36, 0xc6, 0x6b, 0xec, 0x75, 0x05, 0xf7, 0xaf, + 0xc4, 0x9b, 0xf0, 0x3e, 0x98, 0x16, 0xcc, 0xc0, 0xbc, 0xd7, 0x11, 0x98, 0x6e, 0x14, 0xd1, 0x8e, + 0xb3, 0x71, 0xff, 0x3d, 0x84, 0xf9, 0x97, 0xa2, 0x03, 0xd1, 0x97, 0x62, 0xfa, 0xb0, 0x2f, 0x95, + 0x82, 0xb7, 0x76, 0x58, 0xeb, 0x3f, 0x9e, 0xcc, 0xe4, 0xf9, 0xfc, 0xf0, 0xfb, 0x01, 0xb5, 0xad, + 0x35, 0xba, 0x50, 0x5b, 0x08, 0x08, 0xb8, 0x51, 0x26, 0x51, 0xdb, 0xe6, 0x33, 0x75, 0x9d, 0xd8, + 0x8d, 0x4a, 0xd5, 0xf7, 0x6c, 0xcc, 0x88, 0xa5, 0x8b, 0xd9, 0xd6, 0x98, 0x80, 0xa7, 0x44, 0x68, + 0x49, 0x2c, 0xad, 0x4c, 0x3f, 0x38, 0x74, 0x2f, 0x1e, 0xd4, 0xab, 0x63, 0x26, 0x7c, 0x34, 0x66, + 0x34, 0xfa, 0x52, 0x79, 0xf2, 0x7e, 0xad, 0xf0, 0x9c, 0xe9, 0xb8, 0x31, 0x8a, 0x70, 0x1f, 0xc5, + 0x92, 0xc5, 0x1e, 0x21, 0x6f, 0x6b, 0xef, 0xa6, 0x9f, 0x20, 0xb3, 0x05, 0xcb, 0xc7, 0x4f, 0xc1, + 0x0c, 0x66, 0x3b, 0x2c, 0x7d, 0xc9, 0x13, 0xe3, 0x0b, 0xb1, 0xb4, 0x36, 0x4a, 0x07, 0x0e, 0xc2, + 0xa6, 0x24, 0xf5, 0xec, 0xfe, 0xc1, 0x4c, 0xd8, 0xb2, 0x98, 0x38, 0x74, 0xcf, 0x85, 0x15, 0x70, + 0xfb, 0xc6, 0x81, 0xde, 0x0d, 0x0f, 0xa8, 0x7a, 0xb6, 0xf2, 0x2f, 0x50, 0x29, 0x05, 0xdb, 0x0a, + 0x4b, 0xba, 0x7f, 0x87, 0x4d, 0x2b, 0xba, 0x93, 0x9d, 0x9c, 0x5e, 0x01, 0x7b, 0x6a, 0x88, 0x65, + 0x76, 0xc2, 0xbb, 0xc6, 0x2b, 0xa8, 0x34, 0x47, 0x19, 0x15, 0xd2, 0x45, 0x26, 0xa4, 0x1f, 0x5e, + 0xcc, 0x6f, 0x4a, 0xd2, 0x2c, 0x8c, 0x37, 0x7a, 0x5b, 0x92, 0xd9, 0x18, 0xa6, 0xed, 0x17, 0x31, + 0x16, 0x13, 0x8f, 0x3c, 0xd3, 0xfe, 0x32, 0xde, 0xfc, 0x1c, 0x4b, 0xe3, 0x3b, 0xfe, 0x2f, 0xb0, + 0xfa, 0x6a, 0x57, 0x8a, 0x25, 0x88, 0x4f, 0x93, 0x7d, 0x6c, 0x2b, 0xe2, 0x2e, 0x3c, 0x1e, 0x97, + 0xc1, 0x12, 0xa6, 0x55, 0xf1, 0x22, 0x30, 0x0b, 0xb7, 0xf7, 0xdd, 0x58, 0x2b, 0x74, 0x3c, 0x95, + 0xb6, 0xa7, 0x7d, 0xb0, 0x1a, 0x3e, 0xad, 0xdb, 0x2c, 0xac, 0xed, 0xa8, 0x65, 0xda, 0x12, 0xb1, + 0x2e, 0xde, 0xb1, 0xff, 0x19, 0x33, 0x2f, 0x27, 0xe0, 0x7e, 0x4f, 0x17, 0xb3, 0x8e, 0xd4, 0xf6, + 0xbe, 0x02, 0x66, 0xb6, 0x87, 0x61, 0x4d, 0x55, 0xfd, 0x0f, 0x1f, 0x54, 0x6e, 0x8e, 0xeb, 0xe1, + 0x49, 0xcc, 0x6c, 0x5e, 0x81, 0xc7, 0x50, 0x2a, 0x71, 0xad, 0xf7, 0x7e, 0xad, 0x81, 0x46, 0xfa, + 0xfd, 0x46, 0x4c, 0x7c, 0x1b, 0x35, 0xc3, 0xa8, 0xf5, 0xd1, 0x97, 0xbf, 0xe0, 0xf9, 0x37, 0x99, + 0x96, 0x9d, 0xcc, 0x3f, 0x1b, 0x8f, 0x97, 0x74, 0x31, 0xba, 0x0d, 0x2f, 0x3c, 0xd7, 0x60, 0x0d, + 0x12, 0x98, 0x76, 0x1c, 0x89, 0x19, 0x8e, 0x5a, 0x12, 0x98, 0x3c, 0xce, 0xc5, 0x1b, 0xdc, 0x7c, + 0x9e, 0xce, 0xd8, 0xdc, 0xe0, 0x42, 0xb2, 0xb3, 0x07, 0x45, 0x18, 0x83, 0xe7, 0x48, 0xde, 0x8e, + 0x39, 0x1d, 0x63, 0x2b, 0xe1, 0xf9, 0xdc, 0x5c, 0x8d, 0xc8, 0xe9, 0x78, 0xee, 0x8c, 0xc0, 0xcc, + 0xf2, 0x96, 0xf8, 0x9d, 0x97, 0xa7, 0xda, 0x0b, 0x47, 0x8a, 0xcb, 0xb1, 0x14, 0xba, 0x96, 0x57, + 0x18, 0xb0, 0xa6, 0xe6, 0x23, 0xaa, 0xe9, 0xed, 0xbd, 0x98, 0x36, 0x95, 0x6d, 0x00, 0x3a, 0x61, + 0xc1, 0x4f, 0xdc, 0xe0, 0x7e, 0x81, 0xdb, 0xbe, 0x3b, 0x56, 0x7b, 0xb7, 0x04, 0x03, 0xb1, 0xfd, + 0xf8, 0x40, 0x2a, 0x25, 0x8c, 0xed, 0xa9, 0x6d, 0x66, 0xf0, 0x0e, 0xd6, 0xcc, 0xad, 0x57, 0x23, + 0x4d, 0x6b, 0x20, 0xda, 0xd0, 0xc6, 0xcd, 0x47, 0xb4, 0x0f, 0x2e, 0x33, 0xf5, 0xd8, 0x8a, 0x8c, + 0xd9, 0xd8, 0x0a, 0x9b, 0xc4, 0x9c, 0x15, 0xc2, 0x76, 0x54, 0x32, 0x61, 0x3f, 0xc2, 0xed, 0x36, + 0x14, 0x8f, 0xa3, 0x48, 0xaf, 0x16, 0xa5, 0xda, 0x93, 0xd5, 0x69, 0xa1, 0xbc, 0x54, 0x1b, 0xb0, + 0x3a, 0xf5, 0x5d, 0x7e, 0x82, 0xdb, 0x71, 0x21, 0xca, 0x3f, 0x50, 0xb8, 0x20, 0x70, 0x0e, 0xe6, + 0x87, 0xca, 0xce, 0x1c, 0x2c, 0x28, 0x9c, 0x82, 0xfb, 0x24, 0xf2, 0x40, 0x1d, 0xb1, 0xe0, 0xe9, + 0x6e, 0x2a, 0x2d, 0x11, 0xc0, 0x9b, 0xd7, 0xd8, 0xcf, 0x3d, 0xc9, 0xfa, 0xf2, 0x3c, 0xdc, 0x5f, + 0xd1, 0xac, 0x6d, 0x09, 0x1a, 0x77, 0x51, 0x0c, 0xfe, 0xe0, 0x5a, 0x14, 0x86, 0x46, 0x33, 0xbc, + 0x74, 0x33, 0xfc, 0x31, 0x99, 0xc5, 0x40, 0xba, 0x96, 0xbf, 0x48, 0x26, 0xac, 0x6c, 0x87, 0x4d, + 0xb5, 0x8a, 0xe8, 0xfa, 0x83, 0x98, 0x57, 0xfd, 0x25, 0xc5, 0x9b, 0xb0, 0x6b, 0x31, 0x6d, 0x7e, + 0x9d, 0x4c, 0x70, 0xf0, 0x37, 0xfc, 0x0e, 0x37, 0x15, 0xa4, 0xdf, 0x1d, 0xcf, 0xcd, 0xd1, 0x78, + 0xfc, 0x6d, 0x4e, 0xf1, 0x17, 0x5d, 0x6f, 0xc3, 0xbc, 0xe7, 0x50, 0x2a, 0x2d, 0x15, 0x06, 0x62, + 0x3a, 0x36, 0x20, 0xd4, 0xb7, 0x23, 0xcd, 0xa3, 0xd5, 0xf5, 0x11, 0x4e, 0x9f, 0xa6, 0x5e, 0x08, + 0xf2, 0xe1, 0xb7, 0xc9, 0x89, 0xd6, 0xdf, 0xcb, 0x5e, 0x3f, 0xd2, 0xfb, 0x6b, 0xc8, 0xa7, 0x82, + 0x47, 0x85, 0x13, 0xba, 0x13, 0x94, 0x79, 0xfb, 0x88, 0xe1, 0x12, 0x65, 0x1f, 0x03, 0x8a, 0x61, + 0x65, 0x49, 0x8f, 0xc8, 0x1f, 0xcc, 0x38, 0x31, 0x89, 0x3f, 0x4c, 0xf6, 0x0c, 0x30, 0x41, 0xf6, + 0xfe, 0x71, 0xb9, 0x7c, 0x4a, 0x79, 0x4d, 0x65, 0x1f, 0xb9, 0x39, 0x23, 0x57, 0x56, 0x77, 0xf9, + 0xb4, 0xfe, 0x46, 0xb9, 0xf8, 0x5b, 0xe5, 0x0f, 0xc0, 0xb4, 0xe4, 0x44, 0x7b, 0xad, 0xf0, 0x5a, + 0x38, 0x9d, 0x9b, 0x8f, 0xbf, 0x37, 0x9c, 0xf0, 0xed, 0xac, 0xda, 0x1f, 0x96, 0xd8, 0x25, 0xbc, + 0xdf, 0x78, 0xd9, 0x5b, 0x48, 0x3c, 0x45, 0xbc, 0xb6, 0xec, 0x35, 0xe5, 0x8d, 0x70, 0xc2, 0xf7, + 0x53, 0xf9, 0x94, 0x76, 0x3c, 0x55, 0x5f, 0x0b, 0xf1, 0x63, 0x38, 0xa3, 0xe4, 0x8f, 0x4d, 0x3c, + 0x2e, 0x7f, 0xc8, 0x26, 0xfd, 0x30, 0x4c, 0x0c, 0x43, 0x42, 0x1e, 0xe4, 0x0f, 0x73, 0x5c, 0x15, + 0xda, 0xfa, 0xc1, 0x90, 0x37, 0xed, 0xbf, 0x3e, 0xa1, 0x0e, 0xf7, 0xcb, 0xde, 0x12, 0x8e, 0x4b, + 0xca, 0x3c, 0x34, 0x94, 0x93, 0xff, 0xb8, 0x54, 0xd7, 0xd0, 0xee, 0xcf, 0xcb, 0x27, 0xfd, 0xc7, + 0xc9, 0x1f, 0x4b, 0x21, 0xb4, 0xcd, 0x89, 0xf2, 0x49, 0xf8, 0x43, 0x55, 0x79, 0xd2, 0x3d, 0x6d, + 0xbf, 0x18, 0x17, 0x4f, 0xf8, 0xaf, 0xa6, 0xe2, 0xb6, 0x6c, 0xcd, 0x30, 0x41, 0xfe, 0x78, 0x4e, + 0x1a, 0xb7, 0xaa, 0x7c, 0xf2, 0x7a, 0x64, 0x49, 0x5b, 0x16, 0x85, 0x61, 0xb2, 0xe7, 0xa2, 0x09, + 0x92, 0x4e, 0x4a, 0xe2, 0xcf, 0x93, 0x34, 0x31, 0xbc, 0xcf, 0x58, 0xf9, 0x83, 0x42, 0x7b, 0x85, + 0x36, 0x97, 0xec, 0xc5, 0x63, 0x8c, 0xb2, 0xb1, 0x31, 0x28, 0xd7, 0x3e, 0xbd, 0xe4, 0x53, 0xf8, + 0x0f, 0x86, 0x74, 0x93, 0xe5, 0xb9, 0xb7, 0x71, 0x41, 0x39, 0x4d, 0x21, 0xdc, 0x2f, 0x7b, 0x24, + 0x48, 0x3f, 0xa6, 0xd1, 0x2f, 0x94, 0x2f, 0xd9, 0x3b, 0xc5, 0x93, 0x49, 0x78, 0x31, 0xc4, 0x0f, + 0x90, 0xbd, 0xc4, 0x48, 0xf6, 0x4c, 0x31, 0x59, 0x99, 0xe7, 0x9f, 0x7c, 0xd8, 0x58, 0x3e, 0xd5, + 0xfe, 0x8a, 0xdc, 0x7f, 0x4f, 0x87, 0xeb, 0xe8, 0x51, 0x27, 0xad, 0xdb, 0x34, 0x55, 0x7a, 0x7f, + 0xfa, 0x7b, 0xf2, 0x9c, 0x07, 0x42, 0xda, 0x7e, 0xca, 0x3c, 0x28, 0xbc, 0x2d, 0x8f, 0x8b, 0xfc, + 0x33, 0x25, 0xe9, 0xd8, 0xdc, 0x3b, 0xe5, 0xf3, 0x2c, 0x24, 0x7b, 0x02, 0x9a, 0x1a, 0xe2, 0x1f, + 0x93, 0xbd, 0x1f, 0xd4, 0x7a, 0xff, 0x4f, 0xe5, 0xf9, 0xb1, 0x83, 0x3c, 0x87, 0x3e, 0x0f, 0xe5, + 0xc6, 0x8f, 0x18, 0xdd, 0xa6, 0x8c, 0x96, 0x5d, 0x24, 0x7b, 0xa4, 0x92, 0xec, 0x3d, 0x60, 0x5f, + 0xd9, 0x03, 0xc2, 0x23, 0x21, 0xdf, 0xd3, 0x92, 0x8e, 0xca, 0xd5, 0xfb, 0x5b, 0xa1, 0x8d, 0xf2, + 0xef, 0x73, 0x50, 0x78, 0xff, 0xb1, 0x21, 0xff, 0x30, 0x55, 0x7e, 0x5c, 0xeb, 0xa7, 0xca, 0xbc, + 0x47, 0x4c, 0x0d, 0xf5, 0x58, 0xaa, 0xa0, 0x9c, 0x9d, 0x24, 0xbd, 0x2b, 0x7f, 0x8c, 0x68, 0xe5, + 0x50, 0x9f, 0x26, 0x99, 0x16, 0x2d, 0x12, 0xd2, 0xfc, 0x2c, 0xb4, 0x45, 0x6c, 0xab, 0x26, 0x65, + 0x1e, 0x1c, 0xce, 0x95, 0x3d, 0xf2, 0x8c, 0x91, 0x69, 0xca, 0x51, 0xf2, 0xfc, 0x1d, 0x23, 0x8f, + 0xa5, 0x09, 0xf2, 0x07, 0xe7, 0xd2, 0xb9, 0x70, 0x48, 0xae, 0xbc, 0xd1, 0xaa, 0xf4, 0x8c, 0x10, + 0xc3, 0x76, 0xe1, 0xfd, 0x3e, 0x96, 0xbd, 0x7c, 0x8c, 0x55, 0xa5, 0x47, 0x85, 0xa2, 0xb0, 0x58, + 0x28, 0xb3, 0xa8, 0xbc, 0x7c, 0xb8, 0x59, 0x52, 0xcf, 0x82, 0xf8, 0xe1, 0x72, 0x9f, 0xe7, 0xe3, + 0x2f, 0x91, 0x3d, 0x9f, 0xbc, 0xa7, 0xcc, 0x43, 0xc8, 0xa6, 0xa1, 0x1f, 0xe6, 0x84, 0x7a, 0x8e, + 0x96, 0x69, 0x40, 0x9a, 0xef, 0xd8, 0xdc, 0xfb, 0xde, 0x27, 0x7b, 0x70, 0x89, 0xf7, 0x67, 0x4a, + 0xfa, 0x4c, 0x95, 0xe3, 0xea, 0x49, 0x65, 0x9e, 0x2e, 0xa4, 0x72, 0xaf, 0x36, 0xe9, 0x07, 0xeb, + 0xd2, 0xb1, 0x5e, 0x96, 0xbe, 0x25, 0x61, 0x49, 0xd9, 0x73, 0xd7, 0x9b, 0xb2, 0x67, 0x9b, 0x01, + 0xe1, 0xfd, 0xff, 0xad, 0xcc, 0xb3, 0xd8, 0x9a, 0xca, 0xe6, 0xc8, 0xd9, 0xb2, 0x37, 0x89, 0xb1, + 0xb2, 0xe7, 0x8c, 0xfd, 0x92, 0xb2, 0xf6, 0x96, 0x69, 0xda, 0xe3, 0xb2, 0x27, 0xab, 0x33, 0xe5, + 0x8f, 0x32, 0x21, 0xd3, 0xaf, 0x97, 0xe4, 0xf1, 0xf3, 0xf7, 0x70, 0x4f, 0xb2, 0x67, 0xa1, 0xf8, + 0x71, 0xb5, 0x9f, 0xc8, 0xeb, 0xcb, 0x24, 0x79, 0x4c, 0x5f, 0x22, 0x8f, 0xbb, 0xf5, 0xe5, 0xf1, + 0x16, 0xdb, 0xf8, 0x9f, 0xb9, 0x77, 0x58, 0x2e, 0x94, 0xf3, 0x86, 0x3c, 0x7e, 0x47, 0x87, 0xfc, + 0xc7, 0xca, 0x34, 0x73, 0x8d, 0xf0, 0x5c, 0x85, 0xf7, 0x8c, 0xf3, 0x61, 0x6c, 0x12, 0x77, 0xb4, + 0xec, 0x79, 0x2b, 0xd2, 0x87, 0xcb, 0x73, 0xcf, 0x18, 0x12, 0xe2, 0x09, 0xf5, 0x6d, 0x0a, 0xd7, + 0xd3, 0x64, 0x5e, 0x08, 0xd9, 0xdb, 0x86, 0xe4, 0x31, 0xb0, 0xb2, 0x4c, 0x1b, 0xa2, 0x97, 0x93, + 0xd7, 0xe4, 0xb5, 0x3b, 0x7d, 0xee, 0xb4, 0xd0, 0x66, 0x07, 0x2a, 0xa3, 0x7b, 0xf7, 0xc9, 0x73, + 0x73, 0x74, 0xae, 0x6e, 0x45, 0xf5, 0x5d, 0x2d, 0xf7, 0x5e, 0x47, 0x87, 0x7a, 0xf4, 0x96, 0xe7, + 0xe8, 0x58, 0x79, 0x8e, 0xfe, 0x49, 0x95, 0xeb, 0x68, 0x1c, 0x47, 0xd7, 0xca, 0xf4, 0x77, 0x9c, + 0xdc, 0x97, 0xe9, 0x47, 0xd2, 0x8e, 0x92, 0x69, 0x78, 0x93, 0x3c, 0x1e, 0x2e, 0x4c, 0xde, 0x1f, + 0x99, 0xa7, 0x89, 0xeb, 0xf1, 0x6b, 0xf2, 0x07, 0xca, 0xe2, 0xbd, 0xe8, 0x5d, 0x6c, 0x9c, 0xec, + 0x15, 0x29, 0xff, 0x11, 0xae, 0xe3, 0x64, 0xba, 0x74, 0x8f, 0xa4, 0x81, 0x49, 0xfc, 0xae, 0x32, + 0x0d, 0x1e, 0x2f, 0xb7, 0x7f, 0x6f, 0x79, 0x6e, 0xdd, 0xa5, 0x8c, 0x67, 0x88, 0xe1, 0x08, 0x55, + 0xf7, 0x51, 0x1a, 0x6e, 0x51, 0xa5, 0xe7, 0xc1, 0x8e, 0xf2, 0x5a, 0x98, 0xf7, 0xf0, 0x74, 0x81, + 0xfc, 0x21, 0xc4, 0x07, 0x65, 0xde, 0x71, 0xa8, 0xbc, 0xc6, 0x7f, 0xac, 0x4a, 0xef, 0x2c, 0x31, + 0xfc, 0xaf, 0xb2, 0x8f, 0x28, 0xc6, 0xf0, 0xbe, 0x3c, 0x6e, 0x6e, 0x0a, 0xe1, 0xae, 0x5c, 0x5b, + 0xe5, 0xff, 0x0f, 0xa9, 0x71, 0x5d, 0x18, 0xda, 0x49, 0xcd, 0x31, 0x33, 0xaa, 0x8b, 0x29, 0x14, + 0xdb, 0xee, 0xac, 0xc5, 0xfc, 0x37, 0x2d, 0x89, 0x36, 0xcb, 0x07, 0x86, 0xdf, 0x35, 0xb1, 0xca, + 0x6f, 0x23, 0x5a, 0xf7, 0x70, 0x02, 0xa1, 0xcc, 0xeb, 0xa8, 0x3e, 0xec, 0x96, 0xe2, 0x34, 0x2c, + 0x0d, 0x3f, 0xbf, 0x46, 0x9a, 0x6f, 0x22, 0x3a, 0xe2, 0xf6, 0x8b, 0x9f, 0x4f, 0xaf, 0x87, 0xa5, + 0xf1, 0x8e, 0x79, 0x15, 0xbe, 0xbc, 0x8f, 0xda, 0x6c, 0x87, 0x25, 0x77, 0xe3, 0xb1, 0x84, 0x2d, + 0xda, 0x99, 0x2f, 0x82, 0xa5, 0x05, 0x65, 0xea, 0xf2, 0x36, 0xcc, 0x1f, 0x2c, 0x89, 0xcd, 0xe0, + 0x7a, 0x52, 0x2d, 0x19, 0x6a, 0x83, 0xb5, 0x9d, 0x83, 0xb0, 0x46, 0xf3, 0x19, 0x2c, 0xe1, 0x1b, + 0xce, 0x7f, 0xc6, 0x47, 0xa1, 0xda, 0x60, 0xba, 0x77, 0x2a, 0xc5, 0x1f, 0xb9, 0x5b, 0x07, 0xaf, + 0x65, 0x9b, 0x37, 0x98, 0x3e, 0xa2, 0xa9, 0xc6, 0xbd, 0x5e, 0xcd, 0xa9, 0xdc, 0x57, 0x04, 0xbb, + 0xe2, 0xc3, 0x78, 0xdb, 0x63, 0x4d, 0x7d, 0x3b, 0x2c, 0x0d, 0xbd, 0x11, 0x4b, 0x30, 0xeb, 0x7d, + 0xbc, 0xab, 0x11, 0x9c, 0x8a, 0xcd, 0xe2, 0xbe, 0x2e, 0x1f, 0x22, 0x6a, 0x64, 0x1c, 0xa5, 0x18, + 0x82, 0xa5, 0xf2, 0x65, 0xfe, 0xef, 0xbf, 0x29, 0xe8, 0x8b, 0xa5, 0xfe, 0x17, 0xd7, 0x4b, 0x98, + 0x60, 0x26, 0xd6, 0x02, 0x4d, 0xa7, 0xb2, 0xdd, 0x97, 0xc3, 0x1a, 0xb2, 0x23, 0xa9, 0xc3, 0x1b, + 0x2e, 0xa8, 0x8f, 0x84, 0x2c, 0x08, 0x9b, 0xef, 0xa3, 0xb1, 0xcd, 0xd3, 0xfa, 0xd8, 0x7e, 0xea, + 0x0c, 0x3c, 0xb1, 0x5a, 0x9b, 0x31, 0x07, 0xdb, 0x5d, 0x5f, 0x55, 0x27, 0xcd, 0xae, 0x64, 0x5f, + 0x98, 0x6c, 0x43, 0x86, 0xcf, 0x71, 0x3f, 0x35, 0x8a, 0xa3, 0xb1, 0x6d, 0xe1, 0x97, 0xc9, 0x58, + 0xdc, 0x8b, 0xd5, 0xdc, 0x87, 0xe1, 0x03, 0x7d, 0x8b, 0xe1, 0x83, 0x60, 0xaf, 0x52, 0x69, 0x6b, + 0xdf, 0x86, 0xf9, 0x87, 0x45, 0x31, 0x1d, 0x99, 0x81, 0xdd, 0x8a, 0xdd, 0x4c, 0x1b, 0x63, 0x5e, + 0x86, 0x57, 0xf0, 0x59, 0xa1, 0xfd, 0x70, 0x1b, 0xb5, 0x8d, 0xd1, 0xff, 0x3c, 0x0c, 0xc2, 0x26, + 0x20, 0x83, 0xc9, 0x36, 0xfb, 0xe0, 0xf3, 0x39, 0x4b, 0xe1, 0x73, 0x2c, 0xc7, 0x90, 0x7d, 0xc8, + 0xad, 0x1e, 0x7a, 0xb5, 0x66, 0xe5, 0xbe, 0x02, 0xb8, 0x0c, 0x9b, 0xb9, 0xc6, 0xc3, 0xb0, 0x22, + 0xf3, 0x8c, 0xd5, 0x5a, 0x26, 0x75, 0xdf, 0xa2, 0xdc, 0x83, 0x55, 0x1b, 0xbe, 0x39, 0xd8, 0x87, + 0x4c, 0xe8, 0xdb, 0x28, 0x8e, 0xc1, 0xde, 0xa1, 0x52, 0x07, 0x0c, 0x43, 0xb1, 0x49, 0xeb, 0x75, + 0x34, 0xb0, 0x79, 0x6c, 0x6d, 0xc9, 0xf9, 0x97, 0x8d, 0x75, 0xf0, 0xe1, 0xa1, 0x8b, 0xf0, 0xa9, + 0xd7, 0x5f, 0xd5, 0x4e, 0xde, 0x22, 0xfc, 0x00, 0xdb, 0x17, 0xef, 0x4d, 0xe5, 0x61, 0xc2, 0x36, + 0xb4, 0x2e, 0x16, 0xc1, 0x5f, 0x44, 0x9b, 0x45, 0xb5, 0x5f, 0xf5, 0x36, 0x7c, 0x33, 0x31, 0x08, + 0x6f, 0x92, 0x1e, 0xc1, 0x2e, 0xad, 0xda, 0x24, 0xc1, 0xb5, 0x71, 0x3a, 0x76, 0x7f, 0xb8, 0x09, + 0x95, 0x2e, 0x3e, 0xdb, 0xd0, 0x86, 0xaf, 0x3a, 0x9e, 0xc4, 0x0c, 0xf9, 0x8e, 0x58, 0x43, 0xbd, + 0x18, 0xb6, 0x9b, 0xee, 0x8d, 0xc7, 0x7b, 0xde, 0xfd, 0x68, 0xa3, 0x38, 0x04, 0x1f, 0x98, 0x3d, + 0x19, 0x9f, 0xa5, 0xb9, 0x98, 0xca, 0xb3, 0x72, 0x5f, 0x65, 0xb4, 0x49, 0xce, 0x1b, 0x43, 0x7b, + 0x7c, 0x10, 0xf4, 0x0b, 0x3c, 0xce, 0x16, 0xa3, 0x79, 0x1e, 0xbf, 0xf2, 0x68, 0x6e, 0xbb, 0x03, + 0x5f, 0xfe, 0xe7, 0xb5, 0x5b, 0x1b, 0xcf, 0x62, 0x37, 0x36, 0x8d, 0xf8, 0x3b, 0x6d, 0x09, 0xe2, + 0xc7, 0x93, 0xda, 0x18, 0xf3, 0xf9, 0x8f, 0xb9, 0x58, 0xbd, 0xfb, 0x44, 0xbd, 0x84, 0x6d, 0xf8, + 0xc6, 0xa0, 0xa5, 0x1f, 0x02, 0xfb, 0xa6, 0xe2, 0x14, 0x4c, 0xb3, 0x1e, 0xc4, 0x5a, 0x87, 0x67, + 0xa8, 0xfe, 0xb4, 0x79, 0x1b, 0xda, 0xf0, 0x55, 0xc4, 0x8f, 0xb1, 0x66, 0xfc, 0x9f, 0xf8, 0x5b, + 0x18, 0x71, 0xcd, 0xdf, 0x94, 0x96, 0x33, 0xe6, 0x60, 0x49, 0xfc, 0xba, 0xd8, 0x75, 0x7e, 0x25, + 0xe2, 0x26, 0x00, 0x00, 0x00, 0x32, 0x49, 0x44, 0x41, 0x54, 0xea, 0x65, 0x54, 0x3b, 0x08, 0xf8, + 0x2a, 0x62, 0x6f, 0xec, 0x38, 0x01, 0xec, 0xbd, 0x64, 0x43, 0xec, 0xb0, 0xa1, 0x16, 0xae, 0x26, + 0x73, 0xcc, 0xf1, 0x10, 0x16, 0x8c, 0x7c, 0x53, 0xd6, 0x62, 0x61, 0xcd, 0x55, 0x4f, 0xcc, 0xa0, + 0x1f, 0x5a, 0x3b, 0xf9, 0xfc, 0xc1, 0xff, 0x01, 0xf4, 0x4f, 0x9a, 0x26, 0x12, 0xca, 0xbf, 0xd8, + 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; static int source_serif_pro_regular_12_png_len = 8348; static BYTE source_serif_pro_regular_12_xml[] = { - 0x3c, 0x3f, 0x78, 0x6d, 0x6c, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x3d, 0x22, 0x31, 0x2e, 0x30, 0x22, 0x20, 0x65, 0x6e, 0x63, 0x6f, - 0x64, 0x69, 0x6e, 0x67, 0x3d, 0x22, 0x75, 0x74, 0x66, 0x2d, 0x38, 0x22, - 0x3f, 0x3e, 0x0a, 0x3c, 0x46, 0x6f, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x7a, - 0x65, 0x3d, 0x22, 0x31, 0x32, 0x22, 0x20, 0x66, 0x61, 0x6d, 0x69, 0x6c, - 0x79, 0x3d, 0x22, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x53, 0x65, - 0x72, 0x69, 0x66, 0x20, 0x50, 0x72, 0x6f, 0x22, 0x20, 0x68, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x3d, 0x22, 0x32, 0x30, 0x22, 0x20, 0x73, 0x74, 0x79, - 0x6c, 0x65, 0x3d, 0x22, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x22, - 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, - 0x74, 0x68, 0x3d, 0x22, 0x34, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x3d, 0x22, 0x30, 0x20, 0x31, 0x35, 0x22, 0x20, 0x72, 0x65, 0x63, - 0x74, 0x3d, 0x22, 0x30, 0x20, 0x31, 0x33, 0x20, 0x30, 0x20, 0x30, 0x22, - 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x20, 0x22, 0x2f, 0x3e, 0x0a, - 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, - 0x3d, 0x22, 0x34, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, - 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, - 0x30, 0x20, 0x32, 0x20, 0x32, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, - 0x64, 0x65, 0x3d, 0x22, 0x21, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, - 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x36, - 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, - 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x32, 0x20, 0x31, - 0x20, 0x35, 0x20, 0x35, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, - 0x26, 0x71, 0x75, 0x6f, 0x74, 0x3b, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, - 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, - 0x31, 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, - 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x37, - 0x20, 0x32, 0x20, 0x38, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, - 0x65, 0x3d, 0x22, 0x23, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, - 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, - 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x33, - 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x31, 0x35, 0x20, 0x31, - 0x20, 0x38, 0x20, 0x31, 0x34, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, - 0x22, 0x24, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, - 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x34, 0x22, 0x20, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, - 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x32, 0x33, 0x20, 0x32, 0x20, - 0x31, 0x32, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, - 0x22, 0x25, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, - 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x32, 0x22, 0x20, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, - 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x33, 0x35, 0x20, 0x32, 0x20, - 0x31, 0x32, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, - 0x22, 0x26, 0x61, 0x6d, 0x70, 0x3b, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, - 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, - 0x33, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, - 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, 0x37, - 0x20, 0x31, 0x20, 0x32, 0x20, 0x35, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, - 0x3d, 0x22, 0x27, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, - 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x35, 0x22, 0x20, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x32, 0x22, - 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, 0x39, 0x20, 0x30, 0x20, - 0x34, 0x20, 0x31, 0x37, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, - 0x28, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, - 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x36, 0x22, 0x20, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x32, 0x22, 0x20, 0x72, - 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x33, 0x20, 0x30, 0x20, 0x35, 0x20, - 0x31, 0x37, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x29, 0x22, - 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, - 0x64, 0x74, 0x68, 0x3d, 0x22, 0x36, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x3d, 0x22, 0x2d, 0x31, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, - 0x63, 0x74, 0x3d, 0x22, 0x35, 0x38, 0x20, 0x31, 0x20, 0x38, 0x20, 0x36, - 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x2a, 0x22, 0x2f, 0x3e, - 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, - 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x3d, 0x22, 0x30, 0x20, 0x36, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, - 0x22, 0x36, 0x36, 0x20, 0x34, 0x20, 0x39, 0x20, 0x38, 0x22, 0x20, 0x63, - 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x2b, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, - 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, - 0x34, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x2d, - 0x31, 0x20, 0x31, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, - 0x37, 0x35, 0x20, 0x31, 0x31, 0x20, 0x34, 0x20, 0x36, 0x22, 0x20, 0x63, - 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x2c, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, - 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, - 0x36, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, - 0x20, 0x31, 0x30, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x37, - 0x39, 0x20, 0x38, 0x20, 0x34, 0x20, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, - 0x65, 0x3d, 0x22, 0x2d, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, - 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x34, 0x22, - 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x31, - 0x32, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x38, 0x33, 0x20, - 0x31, 0x30, 0x20, 0x33, 0x20, 0x33, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, - 0x3d, 0x22, 0x2e, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, - 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x35, 0x22, 0x20, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x33, 0x22, - 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x38, 0x36, 0x20, 0x31, 0x20, - 0x36, 0x20, 0x31, 0x34, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, - 0x2f, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, - 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, - 0x65, 0x63, 0x74, 0x3d, 0x22, 0x39, 0x32, 0x20, 0x32, 0x20, 0x37, 0x20, - 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x30, 0x22, - 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, - 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, - 0x74, 0x3d, 0x22, 0x39, 0x39, 0x20, 0x32, 0x20, 0x37, 0x20, 0x31, 0x31, - 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x31, 0x22, 0x2f, 0x3e, - 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, - 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, - 0x22, 0x31, 0x30, 0x36, 0x20, 0x32, 0x20, 0x38, 0x20, 0x31, 0x31, 0x22, - 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x32, 0x22, 0x2f, 0x3e, 0x0a, - 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, - 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, - 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, - 0x31, 0x31, 0x34, 0x20, 0x32, 0x20, 0x37, 0x20, 0x31, 0x31, 0x22, 0x20, - 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x33, 0x22, 0x2f, 0x3e, 0x0a, 0x20, - 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, - 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, - 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x31, - 0x32, 0x31, 0x20, 0x32, 0x20, 0x37, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, - 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x34, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, - 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, - 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, - 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x31, 0x32, - 0x38, 0x20, 0x32, 0x20, 0x37, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, - 0x64, 0x65, 0x3d, 0x22, 0x35, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, - 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, - 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, - 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x31, 0x33, 0x35, - 0x20, 0x31, 0x20, 0x37, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, - 0x65, 0x3d, 0x22, 0x36, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, - 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, - 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x35, - 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x31, 0x34, 0x32, 0x20, - 0x33, 0x20, 0x37, 0x20, 0x31, 0x30, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, - 0x3d, 0x22, 0x37, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, - 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, - 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x31, 0x34, 0x39, 0x20, 0x32, - 0x20, 0x37, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, - 0x22, 0x38, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, - 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, - 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x31, 0x35, 0x36, 0x20, 0x32, 0x20, - 0x37, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, - 0x39, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, - 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x34, 0x22, 0x20, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x37, 0x22, 0x20, 0x72, - 0x65, 0x63, 0x74, 0x3d, 0x22, 0x31, 0x36, 0x33, 0x20, 0x35, 0x20, 0x33, - 0x20, 0x38, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x3a, 0x22, - 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, - 0x64, 0x74, 0x68, 0x3d, 0x22, 0x34, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x3d, 0x22, 0x2d, 0x31, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, - 0x63, 0x74, 0x3d, 0x22, 0x31, 0x36, 0x36, 0x20, 0x35, 0x20, 0x35, 0x20, - 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x3b, 0x22, - 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, - 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x35, 0x22, 0x20, 0x72, 0x65, 0x63, - 0x74, 0x3d, 0x22, 0x31, 0x37, 0x31, 0x20, 0x33, 0x20, 0x37, 0x20, 0x39, - 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x26, 0x6c, 0x74, 0x3b, - 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, - 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, - 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, - 0x63, 0x74, 0x3d, 0x22, 0x31, 0x37, 0x38, 0x20, 0x35, 0x20, 0x39, 0x20, - 0x34, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x3d, 0x22, 0x2f, - 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, - 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x3d, 0x22, 0x31, 0x20, 0x35, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, - 0x3d, 0x22, 0x31, 0x38, 0x37, 0x20, 0x33, 0x20, 0x37, 0x20, 0x39, 0x22, - 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x3e, 0x22, 0x2f, 0x3e, 0x0a, - 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, - 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, - 0x22, 0x31, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, - 0x31, 0x39, 0x34, 0x20, 0x31, 0x20, 0x36, 0x20, 0x31, 0x32, 0x22, 0x20, - 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x3f, 0x22, 0x2f, 0x3e, 0x0a, 0x20, - 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, - 0x22, 0x31, 0x34, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, - 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, - 0x32, 0x30, 0x30, 0x20, 0x32, 0x20, 0x31, 0x33, 0x20, 0x31, 0x33, 0x22, - 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x40, 0x22, 0x2f, 0x3e, 0x0a, - 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, - 0x3d, 0x22, 0x31, 0x31, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, - 0x22, 0x32, 0x31, 0x33, 0x20, 0x32, 0x20, 0x31, 0x31, 0x20, 0x31, 0x31, - 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x41, 0x22, 0x2f, 0x3e, - 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, - 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, - 0x3d, 0x22, 0x32, 0x32, 0x34, 0x20, 0x32, 0x20, 0x39, 0x20, 0x31, 0x31, - 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x42, 0x22, 0x2f, 0x3e, - 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, - 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, - 0x3d, 0x22, 0x32, 0x33, 0x33, 0x20, 0x32, 0x20, 0x39, 0x20, 0x31, 0x31, - 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x43, 0x22, 0x2f, 0x3e, - 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, - 0x68, 0x3d, 0x22, 0x31, 0x31, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, - 0x3d, 0x22, 0x32, 0x34, 0x32, 0x20, 0x32, 0x20, 0x31, 0x31, 0x20, 0x31, - 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x44, 0x22, 0x2f, - 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, - 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, - 0x74, 0x3d, 0x22, 0x32, 0x35, 0x33, 0x20, 0x32, 0x20, 0x39, 0x20, 0x31, - 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x45, 0x22, 0x2f, - 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, - 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, - 0x3d, 0x22, 0x32, 0x36, 0x32, 0x20, 0x32, 0x20, 0x39, 0x20, 0x31, 0x31, - 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x46, 0x22, 0x2f, 0x3e, - 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, - 0x68, 0x3d, 0x22, 0x31, 0x31, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, - 0x3d, 0x22, 0x32, 0x37, 0x31, 0x20, 0x32, 0x20, 0x31, 0x30, 0x20, 0x31, - 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x47, 0x22, 0x2f, - 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, - 0x74, 0x68, 0x3d, 0x22, 0x31, 0x32, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, - 0x74, 0x3d, 0x22, 0x32, 0x38, 0x31, 0x20, 0x32, 0x20, 0x31, 0x32, 0x20, - 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x48, 0x22, - 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, - 0x64, 0x74, 0x68, 0x3d, 0x22, 0x36, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, - 0x74, 0x3d, 0x22, 0x32, 0x39, 0x33, 0x20, 0x32, 0x20, 0x35, 0x20, 0x31, - 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x49, 0x22, 0x2f, - 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, - 0x74, 0x68, 0x3d, 0x22, 0x36, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x3d, 0x22, 0x2d, 0x32, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, - 0x74, 0x3d, 0x22, 0x32, 0x39, 0x38, 0x20, 0x32, 0x20, 0x38, 0x20, 0x31, - 0x34, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x4a, 0x22, 0x2f, - 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, - 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, - 0x74, 0x3d, 0x22, 0x33, 0x30, 0x36, 0x20, 0x32, 0x20, 0x31, 0x31, 0x20, - 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x4b, 0x22, - 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, - 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, - 0x74, 0x3d, 0x22, 0x33, 0x31, 0x37, 0x20, 0x32, 0x20, 0x39, 0x20, 0x31, - 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x4c, 0x22, 0x2f, - 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, - 0x74, 0x68, 0x3d, 0x22, 0x31, 0x34, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, - 0x74, 0x3d, 0x22, 0x33, 0x32, 0x36, 0x20, 0x32, 0x20, 0x31, 0x34, 0x20, - 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x4d, 0x22, - 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, - 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x32, 0x22, 0x20, 0x6f, 0x66, 0x66, - 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, - 0x63, 0x74, 0x3d, 0x22, 0x33, 0x34, 0x30, 0x20, 0x32, 0x20, 0x31, 0x32, - 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x4e, - 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, - 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x31, 0x22, 0x20, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, - 0x65, 0x63, 0x74, 0x3d, 0x22, 0x33, 0x35, 0x32, 0x20, 0x32, 0x20, 0x31, - 0x30, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, - 0x4f, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, - 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, 0x6f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, - 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x33, 0x36, 0x32, 0x20, 0x32, 0x20, - 0x39, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, - 0x50, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, - 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x31, 0x22, 0x20, 0x6f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, - 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x33, 0x37, 0x31, 0x20, 0x32, 0x20, - 0x31, 0x30, 0x20, 0x31, 0x35, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, - 0x22, 0x51, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, - 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, - 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x33, 0x38, 0x31, 0x20, 0x32, - 0x20, 0x31, 0x31, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, - 0x3d, 0x22, 0x52, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, - 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, - 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x33, 0x39, 0x32, 0x20, 0x32, - 0x20, 0x37, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, - 0x22, 0x53, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, - 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, - 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x33, 0x39, 0x39, 0x20, 0x32, - 0x20, 0x39, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, - 0x22, 0x54, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, - 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x32, 0x22, 0x20, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, - 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, 0x30, 0x38, 0x20, 0x32, - 0x20, 0x31, 0x32, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, - 0x3d, 0x22, 0x55, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, - 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x31, 0x22, - 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, - 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, 0x32, 0x30, 0x20, - 0x32, 0x20, 0x31, 0x31, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, - 0x65, 0x3d, 0x22, 0x56, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, - 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x35, - 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, - 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, 0x33, 0x31, - 0x20, 0x32, 0x20, 0x31, 0x36, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, - 0x64, 0x65, 0x3d, 0x22, 0x57, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, - 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, - 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, - 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, 0x34, - 0x37, 0x20, 0x32, 0x20, 0x31, 0x31, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, - 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x58, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, - 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, - 0x31, 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, - 0x2d, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, - 0x34, 0x35, 0x38, 0x20, 0x32, 0x20, 0x31, 0x31, 0x20, 0x31, 0x31, 0x22, - 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x59, 0x22, 0x2f, 0x3e, 0x0a, - 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, - 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, - 0x22, 0x34, 0x36, 0x39, 0x20, 0x32, 0x20, 0x38, 0x20, 0x31, 0x31, 0x22, - 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x5a, 0x22, 0x2f, 0x3e, 0x0a, - 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, - 0x3d, 0x22, 0x36, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, - 0x22, 0x32, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, - 0x34, 0x37, 0x37, 0x20, 0x31, 0x20, 0x34, 0x20, 0x31, 0x34, 0x22, 0x20, - 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x5b, 0x22, 0x2f, 0x3e, 0x0a, 0x20, - 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, - 0x22, 0x35, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, - 0x30, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, - 0x38, 0x31, 0x20, 0x31, 0x20, 0x36, 0x20, 0x31, 0x34, 0x22, 0x20, 0x63, - 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x5c, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, - 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, - 0x35, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, - 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, 0x38, - 0x37, 0x20, 0x31, 0x20, 0x34, 0x20, 0x31, 0x34, 0x22, 0x20, 0x63, 0x6f, - 0x64, 0x65, 0x3d, 0x22, 0x5d, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, - 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, - 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, - 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, 0x39, 0x31, - 0x20, 0x35, 0x20, 0x37, 0x20, 0x35, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, - 0x3d, 0x22, 0x5e, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, - 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x31, 0x35, - 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, 0x39, 0x38, 0x20, - 0x31, 0x33, 0x20, 0x37, 0x20, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, - 0x3d, 0x22, 0x5f, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, - 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x36, 0x22, 0x20, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x33, 0x22, - 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x30, 0x35, 0x20, 0x31, - 0x20, 0x34, 0x20, 0x34, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, - 0x60, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, - 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x37, 0x22, 0x20, 0x72, - 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x30, 0x39, 0x20, 0x35, 0x20, 0x39, - 0x20, 0x38, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x61, 0x22, - 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, - 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, - 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, - 0x63, 0x74, 0x3d, 0x22, 0x35, 0x31, 0x38, 0x20, 0x31, 0x20, 0x39, 0x20, - 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x62, 0x22, - 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, - 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, - 0x74, 0x3d, 0x22, 0x35, 0x32, 0x37, 0x20, 0x35, 0x20, 0x37, 0x20, 0x38, - 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x63, 0x22, 0x2f, 0x3e, - 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, - 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x3d, 0x22, 0x31, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, - 0x3d, 0x22, 0x35, 0x33, 0x34, 0x20, 0x31, 0x20, 0x39, 0x20, 0x31, 0x32, - 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x64, 0x22, 0x2f, 0x3e, - 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, - 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x3d, 0x22, 0x31, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, - 0x22, 0x35, 0x34, 0x33, 0x20, 0x35, 0x20, 0x37, 0x20, 0x38, 0x22, 0x20, - 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x20, - 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, - 0x22, 0x36, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, - 0x30, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, - 0x35, 0x30, 0x20, 0x31, 0x20, 0x38, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, - 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x66, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, - 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, - 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, - 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x35, - 0x38, 0x20, 0x35, 0x20, 0x38, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, - 0x64, 0x65, 0x3d, 0x22, 0x67, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, - 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, - 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, - 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x36, - 0x36, 0x20, 0x31, 0x20, 0x31, 0x30, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, - 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x68, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, - 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, - 0x34, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, - 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x37, - 0x36, 0x20, 0x31, 0x20, 0x34, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, - 0x64, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, - 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x34, - 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x2d, 0x32, - 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x38, - 0x30, 0x20, 0x31, 0x20, 0x36, 0x20, 0x31, 0x36, 0x22, 0x20, 0x63, 0x6f, - 0x64, 0x65, 0x3d, 0x22, 0x6a, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, - 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, - 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, - 0x32, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x38, 0x36, - 0x20, 0x30, 0x20, 0x31, 0x30, 0x20, 0x31, 0x33, 0x22, 0x20, 0x63, 0x6f, - 0x64, 0x65, 0x3d, 0x22, 0x6b, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, - 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x35, - 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, - 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x39, 0x36, - 0x20, 0x31, 0x20, 0x35, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, - 0x65, 0x3d, 0x22, 0x6c, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, - 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x34, - 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, - 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x36, 0x30, 0x31, - 0x20, 0x35, 0x20, 0x31, 0x34, 0x20, 0x38, 0x22, 0x20, 0x63, 0x6f, 0x64, - 0x65, 0x3d, 0x22, 0x6d, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, - 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, - 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, - 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x36, 0x31, 0x35, - 0x20, 0x35, 0x20, 0x31, 0x30, 0x20, 0x38, 0x22, 0x20, 0x63, 0x6f, 0x64, - 0x65, 0x3d, 0x22, 0x6e, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, - 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, - 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x37, - 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x36, 0x32, 0x35, 0x20, - 0x35, 0x20, 0x38, 0x20, 0x38, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, - 0x22, 0x6f, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, - 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x37, 0x22, - 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x36, 0x33, 0x33, 0x20, 0x35, - 0x20, 0x39, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, - 0x22, 0x70, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, - 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x37, 0x22, 0x20, - 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x36, 0x34, 0x32, 0x20, 0x35, 0x20, - 0x39, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, - 0x71, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, - 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x37, 0x22, 0x20, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x37, 0x22, 0x20, 0x72, - 0x65, 0x63, 0x74, 0x3d, 0x22, 0x36, 0x35, 0x31, 0x20, 0x35, 0x20, 0x37, - 0x20, 0x38, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x72, 0x22, - 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, - 0x64, 0x74, 0x68, 0x3d, 0x22, 0x37, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, - 0x74, 0x3d, 0x22, 0x36, 0x35, 0x38, 0x20, 0x35, 0x20, 0x36, 0x20, 0x38, - 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x73, 0x22, 0x2f, 0x3e, - 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, - 0x68, 0x3d, 0x22, 0x35, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x3d, 0x22, 0x2d, 0x31, 0x20, 0x35, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, - 0x3d, 0x22, 0x36, 0x36, 0x34, 0x20, 0x33, 0x20, 0x36, 0x20, 0x31, 0x30, - 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x74, 0x22, 0x2f, 0x3e, - 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, - 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x3d, 0x22, 0x2d, 0x31, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, - 0x3d, 0x22, 0x36, 0x37, 0x30, 0x20, 0x35, 0x20, 0x31, 0x30, 0x20, 0x38, - 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x75, 0x22, 0x2f, 0x3e, - 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, - 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x3d, 0x22, 0x30, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, - 0x22, 0x36, 0x38, 0x30, 0x20, 0x35, 0x20, 0x38, 0x20, 0x38, 0x22, 0x20, - 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x76, 0x22, 0x2f, 0x3e, 0x0a, 0x20, - 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, - 0x22, 0x31, 0x32, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, - 0x22, 0x30, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, - 0x36, 0x38, 0x38, 0x20, 0x35, 0x20, 0x31, 0x33, 0x20, 0x38, 0x22, 0x20, - 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x77, 0x22, 0x2f, 0x3e, 0x0a, 0x20, - 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, - 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, - 0x30, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x37, - 0x30, 0x31, 0x20, 0x35, 0x20, 0x38, 0x20, 0x38, 0x22, 0x20, 0x63, 0x6f, - 0x64, 0x65, 0x3d, 0x22, 0x78, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, - 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, - 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x2d, 0x31, - 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x37, 0x30, - 0x39, 0x20, 0x35, 0x20, 0x39, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, - 0x64, 0x65, 0x3d, 0x22, 0x79, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, - 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, - 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, - 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x37, 0x31, 0x38, - 0x20, 0x35, 0x20, 0x36, 0x20, 0x38, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, - 0x3d, 0x22, 0x7a, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, - 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x35, 0x22, 0x20, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x33, 0x22, - 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x37, 0x32, 0x34, 0x20, 0x31, - 0x20, 0x35, 0x20, 0x31, 0x34, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, - 0x22, 0x7b, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, - 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x35, 0x22, 0x20, 0x6f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x32, 0x20, 0x33, 0x22, 0x20, - 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x37, 0x32, 0x39, 0x20, 0x31, 0x20, - 0x32, 0x20, 0x31, 0x36, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, - 0x7c, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, - 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x35, 0x22, 0x20, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x33, 0x22, 0x20, 0x72, - 0x65, 0x63, 0x74, 0x3d, 0x22, 0x37, 0x33, 0x31, 0x20, 0x31, 0x20, 0x35, - 0x20, 0x31, 0x34, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x7d, - 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, - 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, - 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x38, 0x22, 0x20, 0x72, 0x65, - 0x63, 0x74, 0x3d, 0x22, 0x37, 0x33, 0x36, 0x20, 0x36, 0x20, 0x37, 0x20, - 0x33, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x7e, 0x22, 0x2f, - 0x3e, 0x0a, 0x3c, 0x2f, 0x46, 0x6f, 0x6e, 0x74, 0x3e, 0x0a + 0x3c, 0x3f, 0x78, 0x6d, 0x6c, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x31, + 0x2e, 0x30, 0x22, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x3d, 0x22, 0x75, 0x74, + 0x66, 0x2d, 0x38, 0x22, 0x3f, 0x3e, 0x0a, 0x3c, 0x46, 0x6f, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x7a, + 0x65, 0x3d, 0x22, 0x31, 0x32, 0x22, 0x20, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x3d, 0x22, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x53, 0x65, 0x72, 0x69, 0x66, 0x20, 0x50, 0x72, 0x6f, 0x22, + 0x20, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x22, 0x32, 0x30, 0x22, 0x20, 0x73, 0x74, 0x79, + 0x6c, 0x65, 0x3d, 0x22, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x22, 0x3e, 0x0a, 0x20, 0x3c, + 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x34, 0x22, 0x20, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x31, 0x35, 0x22, 0x20, 0x72, 0x65, 0x63, + 0x74, 0x3d, 0x22, 0x30, 0x20, 0x31, 0x33, 0x20, 0x30, 0x20, 0x30, 0x22, 0x20, 0x63, 0x6f, 0x64, + 0x65, 0x3d, 0x22, 0x20, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, + 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x34, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, + 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x32, 0x20, + 0x32, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x21, 0x22, 0x2f, 0x3e, + 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x36, + 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x33, 0x22, 0x20, 0x72, + 0x65, 0x63, 0x74, 0x3d, 0x22, 0x32, 0x20, 0x31, 0x20, 0x35, 0x20, 0x35, 0x22, 0x20, 0x63, 0x6f, + 0x64, 0x65, 0x3d, 0x22, 0x26, 0x71, 0x75, 0x6f, 0x74, 0x3b, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, + 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, + 0x74, 0x3d, 0x22, 0x37, 0x20, 0x32, 0x20, 0x38, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, + 0x65, 0x3d, 0x22, 0x23, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, + 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, + 0x22, 0x30, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x31, 0x35, 0x20, 0x31, + 0x20, 0x38, 0x20, 0x31, 0x34, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x24, 0x22, 0x2f, + 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, + 0x31, 0x34, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, + 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x32, 0x33, 0x20, 0x32, 0x20, 0x31, 0x32, 0x20, 0x31, + 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x25, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, + 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x32, 0x22, 0x20, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, + 0x74, 0x3d, 0x22, 0x33, 0x35, 0x20, 0x32, 0x20, 0x31, 0x32, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, + 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x26, 0x61, 0x6d, 0x70, 0x3b, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, + 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x33, 0x22, 0x20, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, + 0x3d, 0x22, 0x34, 0x37, 0x20, 0x31, 0x20, 0x32, 0x20, 0x35, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, + 0x3d, 0x22, 0x27, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, + 0x64, 0x74, 0x68, 0x3d, 0x22, 0x35, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, + 0x31, 0x20, 0x32, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, 0x39, 0x20, 0x30, 0x20, + 0x34, 0x20, 0x31, 0x37, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x28, 0x22, 0x2f, 0x3e, + 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x36, + 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x32, 0x22, 0x20, 0x72, + 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x33, 0x20, 0x30, 0x20, 0x35, 0x20, 0x31, 0x37, 0x22, 0x20, + 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x29, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, + 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x36, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x3d, 0x22, 0x2d, 0x31, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, + 0x35, 0x38, 0x20, 0x31, 0x20, 0x38, 0x20, 0x36, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, + 0x2a, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, + 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, + 0x36, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x36, 0x36, 0x20, 0x34, 0x20, 0x39, 0x20, + 0x38, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x2b, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, + 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x34, 0x22, 0x20, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x2d, 0x31, 0x20, 0x31, 0x33, 0x22, 0x20, 0x72, 0x65, + 0x63, 0x74, 0x3d, 0x22, 0x37, 0x35, 0x20, 0x31, 0x31, 0x20, 0x34, 0x20, 0x36, 0x22, 0x20, 0x63, + 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x2c, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, + 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x36, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x3d, 0x22, 0x31, 0x20, 0x31, 0x30, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x37, + 0x39, 0x20, 0x38, 0x20, 0x34, 0x20, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x2d, + 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, + 0x3d, 0x22, 0x34, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x31, + 0x32, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x38, 0x33, 0x20, 0x31, 0x30, 0x20, 0x33, + 0x20, 0x33, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x2e, 0x22, 0x2f, 0x3e, 0x0a, 0x20, + 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x35, 0x22, 0x20, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, + 0x74, 0x3d, 0x22, 0x38, 0x36, 0x20, 0x31, 0x20, 0x36, 0x20, 0x31, 0x34, 0x22, 0x20, 0x63, 0x6f, + 0x64, 0x65, 0x3d, 0x22, 0x2f, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, + 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x39, 0x32, 0x20, + 0x32, 0x20, 0x37, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x30, 0x22, + 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, + 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, + 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x39, 0x39, 0x20, 0x32, 0x20, 0x37, 0x20, 0x31, 0x31, + 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x31, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, + 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, + 0x22, 0x31, 0x30, 0x36, 0x20, 0x32, 0x20, 0x38, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, + 0x65, 0x3d, 0x22, 0x32, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, + 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, + 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x31, 0x31, 0x34, 0x20, + 0x32, 0x20, 0x37, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x33, 0x22, + 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, + 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, + 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x31, 0x32, 0x31, 0x20, 0x32, 0x20, 0x37, 0x20, 0x31, + 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x34, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, + 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, + 0x3d, 0x22, 0x31, 0x32, 0x38, 0x20, 0x32, 0x20, 0x37, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, + 0x64, 0x65, 0x3d, 0x22, 0x35, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, + 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x3d, 0x22, 0x31, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x31, 0x33, 0x35, + 0x20, 0x31, 0x20, 0x37, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x36, + 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, + 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x35, + 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x31, 0x34, 0x32, 0x20, 0x33, 0x20, 0x37, 0x20, + 0x31, 0x30, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x37, 0x22, 0x2f, 0x3e, 0x0a, 0x20, + 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, + 0x74, 0x3d, 0x22, 0x31, 0x34, 0x39, 0x20, 0x32, 0x20, 0x37, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, + 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x38, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, + 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x31, 0x35, + 0x36, 0x20, 0x32, 0x20, 0x37, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, + 0x39, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, + 0x68, 0x3d, 0x22, 0x34, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, + 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x31, 0x36, 0x33, 0x20, 0x35, 0x20, 0x33, + 0x20, 0x38, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x3a, 0x22, 0x2f, 0x3e, 0x0a, 0x20, + 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x34, 0x22, 0x20, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x2d, 0x31, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, + 0x63, 0x74, 0x3d, 0x22, 0x31, 0x36, 0x36, 0x20, 0x35, 0x20, 0x35, 0x20, 0x31, 0x32, 0x22, 0x20, + 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x3b, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, + 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x35, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x31, + 0x37, 0x31, 0x20, 0x33, 0x20, 0x37, 0x20, 0x39, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, + 0x26, 0x6c, 0x74, 0x3b, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, + 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, + 0x22, 0x30, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x31, 0x37, 0x38, 0x20, + 0x35, 0x20, 0x39, 0x20, 0x34, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x3d, 0x22, 0x2f, + 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, + 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x35, 0x22, 0x20, + 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x31, 0x38, 0x37, 0x20, 0x33, 0x20, 0x37, 0x20, 0x39, 0x22, + 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x3e, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, + 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, + 0x31, 0x39, 0x34, 0x20, 0x31, 0x20, 0x36, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, + 0x3d, 0x22, 0x3f, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, + 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x34, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, + 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x32, 0x30, 0x30, 0x20, + 0x32, 0x20, 0x31, 0x33, 0x20, 0x31, 0x33, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x40, + 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, + 0x3d, 0x22, 0x31, 0x31, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, + 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x32, 0x31, 0x33, 0x20, 0x32, 0x20, 0x31, + 0x31, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x41, 0x22, 0x2f, 0x3e, + 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, + 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, + 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x32, 0x32, 0x34, 0x20, 0x32, 0x20, 0x39, 0x20, 0x31, 0x31, + 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x42, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, + 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, + 0x3d, 0x22, 0x32, 0x33, 0x33, 0x20, 0x32, 0x20, 0x39, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, + 0x64, 0x65, 0x3d, 0x22, 0x43, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, + 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x31, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x32, 0x34, + 0x32, 0x20, 0x32, 0x20, 0x31, 0x31, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, + 0x22, 0x44, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, + 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, + 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x32, 0x35, 0x33, 0x20, 0x32, + 0x20, 0x39, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x45, 0x22, 0x2f, + 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, + 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, + 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x32, 0x36, 0x32, 0x20, 0x32, 0x20, 0x39, 0x20, 0x31, 0x31, + 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x46, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, + 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x31, 0x22, 0x20, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, + 0x3d, 0x22, 0x32, 0x37, 0x31, 0x20, 0x32, 0x20, 0x31, 0x30, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, + 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x47, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, + 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x32, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x32, + 0x38, 0x31, 0x20, 0x32, 0x20, 0x31, 0x32, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, + 0x3d, 0x22, 0x48, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, + 0x64, 0x74, 0x68, 0x3d, 0x22, 0x36, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, + 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x32, 0x39, 0x33, 0x20, 0x32, + 0x20, 0x35, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x49, 0x22, 0x2f, + 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, + 0x36, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x2d, 0x32, 0x20, 0x34, 0x22, + 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x32, 0x39, 0x38, 0x20, 0x32, 0x20, 0x38, 0x20, 0x31, + 0x34, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x4a, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, + 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, + 0x74, 0x3d, 0x22, 0x33, 0x30, 0x36, 0x20, 0x32, 0x20, 0x31, 0x31, 0x20, 0x31, 0x31, 0x22, 0x20, + 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x4b, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, + 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x33, + 0x31, 0x37, 0x20, 0x32, 0x20, 0x39, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, + 0x22, 0x4c, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, + 0x74, 0x68, 0x3d, 0x22, 0x31, 0x34, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, + 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x33, 0x32, 0x36, 0x20, 0x32, + 0x20, 0x31, 0x34, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x4d, 0x22, + 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, + 0x22, 0x31, 0x32, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, + 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x33, 0x34, 0x30, 0x20, 0x32, 0x20, 0x31, 0x32, + 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x4e, 0x22, 0x2f, 0x3e, 0x0a, + 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x31, + 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, + 0x65, 0x63, 0x74, 0x3d, 0x22, 0x33, 0x35, 0x32, 0x20, 0x32, 0x20, 0x31, 0x30, 0x20, 0x31, 0x31, + 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x4f, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, + 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, + 0x3d, 0x22, 0x33, 0x36, 0x32, 0x20, 0x32, 0x20, 0x39, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, + 0x64, 0x65, 0x3d, 0x22, 0x50, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, + 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x31, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x33, 0x37, + 0x31, 0x20, 0x32, 0x20, 0x31, 0x30, 0x20, 0x31, 0x35, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, + 0x22, 0x51, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, + 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, + 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x33, 0x38, 0x31, 0x20, 0x32, + 0x20, 0x31, 0x31, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x52, 0x22, + 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, + 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, + 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x33, 0x39, 0x32, 0x20, 0x32, 0x20, 0x37, 0x20, 0x31, + 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x53, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, + 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, + 0x74, 0x3d, 0x22, 0x33, 0x39, 0x39, 0x20, 0x32, 0x20, 0x39, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, + 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x54, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, + 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x32, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, + 0x30, 0x38, 0x20, 0x32, 0x20, 0x31, 0x32, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, + 0x3d, 0x22, 0x55, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, + 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x31, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, + 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, 0x32, 0x30, 0x20, + 0x32, 0x20, 0x31, 0x31, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x56, + 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, + 0x3d, 0x22, 0x31, 0x35, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, + 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, 0x33, 0x31, 0x20, 0x32, 0x20, 0x31, + 0x36, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x57, 0x22, 0x2f, 0x3e, + 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, + 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x34, 0x22, 0x20, + 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, 0x34, 0x37, 0x20, 0x32, 0x20, 0x31, 0x31, 0x20, 0x31, + 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x58, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, + 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x2d, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, + 0x63, 0x74, 0x3d, 0x22, 0x34, 0x35, 0x38, 0x20, 0x32, 0x20, 0x31, 0x31, 0x20, 0x31, 0x31, 0x22, + 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x59, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, + 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, 0x6f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x34, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, + 0x22, 0x34, 0x36, 0x39, 0x20, 0x32, 0x20, 0x38, 0x20, 0x31, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, + 0x65, 0x3d, 0x22, 0x5a, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, + 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x36, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, + 0x22, 0x32, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, 0x37, 0x37, 0x20, + 0x31, 0x20, 0x34, 0x20, 0x31, 0x34, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x5b, 0x22, + 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, + 0x22, 0x35, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x33, 0x22, + 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, 0x38, 0x31, 0x20, 0x31, 0x20, 0x36, 0x20, 0x31, + 0x34, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x5c, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, + 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x35, 0x22, 0x20, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, + 0x3d, 0x22, 0x34, 0x38, 0x37, 0x20, 0x31, 0x20, 0x34, 0x20, 0x31, 0x34, 0x22, 0x20, 0x63, 0x6f, + 0x64, 0x65, 0x3d, 0x22, 0x5d, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, + 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x3d, 0x22, 0x31, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, 0x39, 0x31, + 0x20, 0x35, 0x20, 0x37, 0x20, 0x35, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x5e, 0x22, + 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, + 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x31, 0x35, + 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x34, 0x39, 0x38, 0x20, 0x31, 0x33, 0x20, 0x37, + 0x20, 0x31, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x5f, 0x22, 0x2f, 0x3e, 0x0a, 0x20, + 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x36, 0x22, 0x20, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, + 0x74, 0x3d, 0x22, 0x35, 0x30, 0x35, 0x20, 0x31, 0x20, 0x34, 0x20, 0x34, 0x22, 0x20, 0x63, 0x6f, + 0x64, 0x65, 0x3d, 0x22, 0x60, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, + 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x3d, 0x22, 0x30, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x30, 0x39, + 0x20, 0x35, 0x20, 0x39, 0x20, 0x38, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x61, 0x22, + 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, + 0x22, 0x31, 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x33, + 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x31, 0x38, 0x20, 0x31, 0x20, 0x39, 0x20, + 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x2f, 0x3e, 0x0a, 0x20, + 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, + 0x74, 0x3d, 0x22, 0x35, 0x32, 0x37, 0x20, 0x35, 0x20, 0x37, 0x20, 0x38, 0x22, 0x20, 0x63, 0x6f, + 0x64, 0x65, 0x3d, 0x22, 0x63, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, + 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x3d, 0x22, 0x31, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x33, + 0x34, 0x20, 0x31, 0x20, 0x39, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, + 0x64, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, + 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, + 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x34, 0x33, 0x20, 0x35, 0x20, 0x37, + 0x20, 0x38, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x20, + 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x36, 0x22, 0x20, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, + 0x74, 0x3d, 0x22, 0x35, 0x35, 0x30, 0x20, 0x31, 0x20, 0x38, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, + 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x66, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, + 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x3d, 0x22, 0x31, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x35, + 0x38, 0x20, 0x35, 0x20, 0x38, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, + 0x67, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, + 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, + 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x36, 0x36, 0x20, 0x31, 0x20, + 0x31, 0x30, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x68, 0x22, 0x2f, + 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, + 0x34, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x33, 0x22, 0x20, + 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x37, 0x36, 0x20, 0x31, 0x20, 0x34, 0x20, 0x31, 0x32, + 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, + 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x34, 0x22, 0x20, 0x6f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x2d, 0x32, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, + 0x3d, 0x22, 0x35, 0x38, 0x30, 0x20, 0x31, 0x20, 0x36, 0x20, 0x31, 0x36, 0x22, 0x20, 0x63, 0x6f, + 0x64, 0x65, 0x3d, 0x22, 0x6a, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, + 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x3d, 0x22, 0x30, 0x20, 0x32, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x38, 0x36, + 0x20, 0x30, 0x20, 0x31, 0x30, 0x20, 0x31, 0x33, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, + 0x6b, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, + 0x68, 0x3d, 0x22, 0x35, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, + 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x35, 0x39, 0x36, 0x20, 0x31, 0x20, 0x35, + 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x6c, 0x22, 0x2f, 0x3e, 0x0a, + 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x34, + 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x37, 0x22, 0x20, 0x72, + 0x65, 0x63, 0x74, 0x3d, 0x22, 0x36, 0x30, 0x31, 0x20, 0x35, 0x20, 0x31, 0x34, 0x20, 0x38, 0x22, + 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x6d, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, + 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x22, 0x20, 0x6f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, + 0x22, 0x36, 0x31, 0x35, 0x20, 0x35, 0x20, 0x31, 0x30, 0x20, 0x38, 0x22, 0x20, 0x63, 0x6f, 0x64, + 0x65, 0x3d, 0x22, 0x6e, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, + 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, + 0x22, 0x31, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x36, 0x32, 0x35, 0x20, + 0x35, 0x20, 0x38, 0x20, 0x38, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x6f, 0x22, 0x2f, + 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, + 0x31, 0x30, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x37, 0x22, + 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x36, 0x33, 0x33, 0x20, 0x35, 0x20, 0x39, 0x20, 0x31, + 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x70, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, + 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, + 0x3d, 0x22, 0x36, 0x34, 0x32, 0x20, 0x35, 0x20, 0x39, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, + 0x64, 0x65, 0x3d, 0x22, 0x71, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, + 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x37, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x3d, 0x22, 0x30, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x36, 0x35, 0x31, + 0x20, 0x35, 0x20, 0x37, 0x20, 0x38, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x72, 0x22, + 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, + 0x22, 0x37, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x37, 0x22, + 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x36, 0x35, 0x38, 0x20, 0x35, 0x20, 0x36, 0x20, 0x38, + 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x73, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, + 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x35, 0x22, 0x20, 0x6f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x2d, 0x31, 0x20, 0x35, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, + 0x3d, 0x22, 0x36, 0x36, 0x34, 0x20, 0x33, 0x20, 0x36, 0x20, 0x31, 0x30, 0x22, 0x20, 0x63, 0x6f, + 0x64, 0x65, 0x3d, 0x22, 0x74, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, + 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x3d, 0x22, 0x2d, 0x31, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x36, 0x37, + 0x30, 0x20, 0x35, 0x20, 0x31, 0x30, 0x20, 0x38, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, + 0x75, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, + 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, + 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x36, 0x38, 0x30, 0x20, 0x35, 0x20, 0x38, + 0x20, 0x38, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x76, 0x22, 0x2f, 0x3e, 0x0a, 0x20, + 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x32, 0x22, + 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, + 0x63, 0x74, 0x3d, 0x22, 0x36, 0x38, 0x38, 0x20, 0x35, 0x20, 0x31, 0x33, 0x20, 0x38, 0x22, 0x20, + 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x77, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, + 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x37, + 0x30, 0x31, 0x20, 0x35, 0x20, 0x38, 0x20, 0x38, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, + 0x78, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, + 0x68, 0x3d, 0x22, 0x38, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x2d, 0x31, + 0x20, 0x37, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x37, 0x30, 0x39, 0x20, 0x35, 0x20, + 0x39, 0x20, 0x31, 0x32, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x79, 0x22, 0x2f, 0x3e, + 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x38, + 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x37, 0x22, 0x20, 0x72, + 0x65, 0x63, 0x74, 0x3d, 0x22, 0x37, 0x31, 0x38, 0x20, 0x35, 0x20, 0x36, 0x20, 0x38, 0x22, 0x20, + 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x7a, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, + 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x35, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x37, + 0x32, 0x34, 0x20, 0x31, 0x20, 0x35, 0x20, 0x31, 0x34, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, + 0x22, 0x7b, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, + 0x74, 0x68, 0x3d, 0x22, 0x35, 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x32, + 0x20, 0x33, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, 0x37, 0x32, 0x39, 0x20, 0x31, 0x20, + 0x32, 0x20, 0x31, 0x36, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x7c, 0x22, 0x2f, 0x3e, + 0x0a, 0x20, 0x3c, 0x43, 0x68, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x35, + 0x22, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x30, 0x20, 0x33, 0x22, 0x20, 0x72, + 0x65, 0x63, 0x74, 0x3d, 0x22, 0x37, 0x33, 0x31, 0x20, 0x31, 0x20, 0x35, 0x20, 0x31, 0x34, 0x22, + 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x22, 0x7d, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x3c, 0x43, 0x68, + 0x61, 0x72, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x39, 0x22, 0x20, 0x6f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x3d, 0x22, 0x31, 0x20, 0x38, 0x22, 0x20, 0x72, 0x65, 0x63, 0x74, 0x3d, 0x22, + 0x37, 0x33, 0x36, 0x20, 0x36, 0x20, 0x37, 0x20, 0x33, 0x22, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3d, + 0x22, 0x7e, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x46, 0x6f, 0x6e, 0x74, 0x3e, 0x0a }; static int source_serif_pro_regular_12_xml_len = 5758; diff --git a/rdtk/librdtk/rdtk_resources.h b/rdtk/librdtk/rdtk_resources.h index 4bf1c3b70..d1a89cf6f 100644 --- a/rdtk/librdtk/rdtk_resources.h +++ b/rdtk/librdtk/rdtk_resources.h @@ -24,14 +24,14 @@ #include "rdtk_engine.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -int rdtk_get_embedded_resource_file(const char* filename, BYTE** pData); + int rdtk_get_embedded_resource_file(const char* filename, BYTE** pData); #ifdef __cplusplus } #endif #endif /* RDTK_RESOURCES_PRIVATE_H */ - diff --git a/rdtk/librdtk/rdtk_surface.c b/rdtk/librdtk/rdtk_surface.c index 8e20cdf1b..306b8fde6 100644 --- a/rdtk/librdtk/rdtk_surface.c +++ b/rdtk/librdtk/rdtk_surface.c @@ -24,8 +24,8 @@ int rdtk_surface_fill(rdtkSurface* surface, int x, int y, int width, int height, UINT32 color) { - freerdp_image_fill(surface->data, PIXEL_FORMAT_XRGB32, - surface->scanline, x, y, width, height, color); + freerdp_image_fill(surface->data, PIXEL_FORMAT_XRGB32, surface->scanline, x, y, width, height, + color); return 1; } @@ -34,7 +34,7 @@ rdtkSurface* rdtk_surface_new(rdtkEngine* engine, BYTE* data, int width, int hei { rdtkSurface* surface; - surface = (rdtkSurface*) calloc(1, sizeof(rdtkSurface)); + surface = (rdtkSurface*)calloc(1, sizeof(rdtkSurface)); if (!surface) return NULL; @@ -56,7 +56,7 @@ rdtkSurface* rdtk_surface_new(rdtkEngine* engine, BYTE* data, int width, int hei { surface->scanline = (surface->width + (surface->width % 4)) * 4; - surface->data = (BYTE*) calloc(surface->height, surface->scanline); + surface->data = (BYTE*)calloc(surface->height, surface->scanline); if (!surface->data) { @@ -82,4 +82,3 @@ void rdtk_surface_free(rdtkSurface* surface) free(surface); } - diff --git a/rdtk/librdtk/rdtk_surface.h b/rdtk/librdtk/rdtk_surface.h index 196943e0f..081d47f23 100644 --- a/rdtk/librdtk/rdtk_surface.h +++ b/rdtk/librdtk/rdtk_surface.h @@ -34,4 +34,3 @@ struct rdtk_surface BOOL owner; }; #endif /* RDTK_SURFACE_PRIVATE_H */ - diff --git a/rdtk/librdtk/rdtk_text_field.c b/rdtk/librdtk/rdtk_text_field.c index baa5fb1c4..ec7681231 100644 --- a/rdtk/librdtk/rdtk_text_field.c +++ b/rdtk/librdtk/rdtk_text_field.c @@ -25,7 +25,7 @@ #include "rdtk_text_field.h" int rdtk_text_field_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, int nHeight, - rdtkTextField* textField, const char* text) + rdtkTextField* textField, const char* text) { int offsetX; int offsetY; @@ -74,7 +74,7 @@ rdtkTextField* rdtk_text_field_new(rdtkEngine* engine, rdtkNinePatch* ninePatch) { rdtkTextField* textField; - textField = (rdtkTextField*) calloc(1, sizeof(rdtkTextField)); + textField = (rdtkTextField*)calloc(1, sizeof(rdtkTextField)); if (!textField) return NULL; diff --git a/rdtk/librdtk/rdtk_text_field.h b/rdtk/librdtk/rdtk_text_field.h index ba03afa30..571d80e25 100644 --- a/rdtk/librdtk/rdtk_text_field.h +++ b/rdtk/librdtk/rdtk_text_field.h @@ -33,18 +33,18 @@ struct rdtk_text_field }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -int rdtk_text_field_engine_init(rdtkEngine* engine); -int rdtk_text_field_engine_uninit(rdtkEngine* engine); + int rdtk_text_field_engine_init(rdtkEngine* engine); + int rdtk_text_field_engine_uninit(rdtkEngine* engine); -rdtkTextField* rdtk_text_field_new(rdtkEngine* engine, rdtkNinePatch* ninePatch); -void rdtk_text_field_free(rdtkTextField* textField); + rdtkTextField* rdtk_text_field_new(rdtkEngine* engine, rdtkNinePatch* ninePatch); + void rdtk_text_field_free(rdtkTextField* textField); #ifdef __cplusplus } #endif #endif /* RDTK_TEXT_FIELD_PRIVATE_H */ - diff --git a/rdtk/librdtk/test/TestRdTkNinePatch.c b/rdtk/librdtk/test/TestRdTkNinePatch.c index f34ac4eb7..5844d6ac7 100644 --- a/rdtk/librdtk/test/TestRdTkNinePatch.c +++ b/rdtk/librdtk/test/TestRdTkNinePatch.c @@ -13,7 +13,7 @@ int TestRdTkNinePatch(int argc, char* argv[]) if (!(engine = rdtk_engine_new())) { - printf("%s: error creating rdtk engine (%"PRIu32")\n", __FUNCTION__, GetLastError()); + printf("%s: error creating rdtk engine (%" PRIu32 ")\n", __FUNCTION__, GetLastError()); goto out; } @@ -24,23 +24,24 @@ int TestRdTkNinePatch(int argc, char* argv[]) /* let rdtk allocate the surface buffer */ if (!(surface = rdtk_surface_new(engine, NULL, width, height, scanline))) { - printf("%s: error creating auto-allocated surface (%"PRIu32")\n", __FUNCTION__, GetLastError()); + printf("%s: error creating auto-allocated surface (%" PRIu32 ")\n", __FUNCTION__, + GetLastError()); goto out; } rdtk_surface_free(surface); surface = NULL; - /* test self-allocated buffer */ if (!(data = calloc(height, scanline))) { - printf("%s: error allocating surface buffer (%"PRIu32")\n", __FUNCTION__, GetLastError()); + printf("%s: error allocating surface buffer (%" PRIu32 ")\n", __FUNCTION__, GetLastError()); goto out; } if (!(surface = rdtk_surface_new(engine, data, width, height, scanline))) { - printf("%s: error creating self-allocated surface (%"PRIu32")\n", __FUNCTION__, GetLastError()); + printf("%s: error creating self-allocated surface (%" PRIu32 ")\n", __FUNCTION__, + GetLastError()); goto out; } diff --git a/rdtk/sample/rdtk_x11.c b/rdtk/sample/rdtk_x11.c index 9e1a7a243..28bc98948 100644 --- a/rdtk/sample/rdtk_x11.c +++ b/rdtk/sample/rdtk_x11.c @@ -55,7 +55,7 @@ int main(int argc, char** argv) unsigned long background; XPixmapFormatValues* pf; XPixmapFormatValues* pfs; - + display = XOpenDisplay(NULL); if (!display) @@ -100,7 +100,7 @@ int main(int argc, char** argv) return 1; scanline = width * 4; - buffer = (BYTE*) calloc(height, scanline); + buffer = (BYTE*)calloc(height, scanline); if (!buffer) return 1; @@ -111,8 +111,7 @@ int main(int argc, char** argv) rdtk_button_draw(surface, 16, 64, 128, 32, NULL, "button"); rdtk_text_field_draw(surface, 16, 128, 128, 32, NULL, "text field"); - window = XCreateSimpleWindow(display, root_window, - x, y, width, height, 1, border, background); + window = XCreateSimpleWindow(display, root_window, x, y, width, height, 1, border, background); XSelectInput(display, window, ExposureMask | KeyPressMask); XMapWindow(display, window); @@ -122,9 +121,9 @@ int main(int argc, char** argv) pixmap = XCreatePixmap(display, window, width, height, depth); - image = XCreateImage(display, visual, depth, ZPixmap, 0, - (char*) buffer, width, height, scanline_pad, 0); - + image = XCreateImage(display, visual, depth, ZPixmap, 0, (char*)buffer, width, height, + scanline_pad, 0); + while (1) { XNextEvent(display, &event); diff --git a/resources/FreeRDP_Icon_256px.h b/resources/FreeRDP_Icon_256px.h index 497048b2c..44736f357 100644 --- a/resources/FreeRDP_Icon_256px.h +++ b/resources/FreeRDP_Icon_256px.h @@ -1,8195 +1,9365 @@ -static unsigned long FreeRDP_Icon_256px_prop [] = { - 256, 256 - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 541756835u , 1615498659u - , 2152369571u , 2940898723u , 3209334179u , 3209334179u , 3209334179u , 2940898723u , 2152369571u , 1078627747u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 541756835u , 2152369571u , 3746205091u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 3746205091u , 1883934115u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 541756835u , 2672463267u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 2940898723u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 541756835u - , 2672463267u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 2672463267u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 2152369571u , 4014640547u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 1078627747u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 810192291u , 3477769635u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 2940898723u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4014640547u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 273321379u , 3209334179u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 810192291u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 810192291u , 4014640547u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 1078627747u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1615498659u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 1078627747u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 2404027811u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 1078627747u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 2672463267u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 1078627747u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 273321379u , 3477769635u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 1078627747u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 273321379u , 3477769635u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 541756835u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 273321379u , 3477769635u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 273321379u , 3477769635u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 3209334179u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 273321379u - , 3477769635u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 2404027811u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 273321379u , 3477769635u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 1615498659u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 273321379u , 3477769635u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 541756835u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 273321379u , 3477769635u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 3477769635u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 273321379u , 3477769635u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 2404027811u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 2940898723u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 810192291u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2672463267u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 3746205091u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 2404027811u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 2404027811u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 1615498659u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 810192291u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1347063203u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 3746205091u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 810192291u , 4014640547u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 1883934115u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 273321379u , 3746205091u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 273321379u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 3477769635u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 2672463267u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 2672463267u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 1078627747u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 1883934115u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 3746205091u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 1078627747u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 1615498659u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 541756835u , 4014640547u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4014640547u , 273321379u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 3477769635u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 2152369571u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 2672463267u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 273321379u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1615498659u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 2672463267u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 810192291u , 4014640547u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 810192291u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 273321379u , 3477769635u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 3477769635u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 2672463267u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 1615498659u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 1615498659u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 273321379u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 541756835u , 4014640547u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 2940898723u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 3477769635u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 1347063203u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2404027811u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 273321379u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 1078627747u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 2940898723u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 273321379u , 4014640547u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 1615498659u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 2940898723u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 541756835u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1615498659u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 3477769635u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 541756835u , 4014640547u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 2404027811u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 3209334179u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 1347063203u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 1883934115u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 273321379u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 541756835u , 4014640547u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 3477769635u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 3209334179u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 2404027811u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 1883934115u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 1347063203u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 541756835u , 4014640547u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 541756835u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 3209334179u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 3746205091u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 1615498659u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 2940898723u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 273321379u , 4014640547u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 2152369571u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 2940898723u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 1078627747u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1078627747u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 273321379u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 273321379u , 3746205091u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4014640547u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 2152369571u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 3209334179u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 810192291u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 2404027811u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 3209334179u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 1883934115u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 1615498659u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 1078627747u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 273321379u , 4014640547u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 273321379u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 2404027811u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 3211638728u , 3211638728u - , 3211638728u , 2154674120u , 275625928u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 810192291u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283668652u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4016945096u , 1617803208u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 3209334179u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283800239u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 1349367752u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 1347063203u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4284261046u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4016945096u , 275625928u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 3746205091u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4284392888u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2154674120u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4284788159u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4016945096u , 544061384u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 273321379u - , 4014640547u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4284919745u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2674767816u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 2672463267u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 544061384u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 541756835u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 3211638728u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 3209334179u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283536810u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 1080932296u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 1078627747u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283668652u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 3748509640u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 3209334179u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283800239u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 2154674120u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 1347063203u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283800238u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4016945096u , 275625928u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 3746205091u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4280836731u , 4284524473u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 2674767816u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 1615498659u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4280573046u , 4280309360u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 1080932296u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 3746205091u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4279716967u , 4278597203u , 4282417045u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 3480074184u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 1615498659u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4279716967u , 4278597203u , 4278992474u , 4284524473u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 1886238664u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 3746205091u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4279716967u , 4278597203u , 4278597203u , 4280309360u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4016945096u , 275625928u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 1615498659u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4278860632u , 4278597203u , 4278597203u , 4278597203u - , 4283273123u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2674767816u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 3746205091u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278992474u , 4284985281u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 1080932296u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 1615498659u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4281165439u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 3748509640u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 3746205091u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4283668395u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2154674120u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1615498659u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4279453282u , 4284985281u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4016945096u - , 544061384u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 3746205091u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4282219924u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4282021774u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 2943203272u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 1078627747u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4284129202u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 1349367752u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 3209334179u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4280309360u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 3748509640u , 275625928u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 810192291u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282417045u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 2154674120u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 2672463267u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278992474u , 4284985281u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 812496840u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 541756835u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4280704632u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 3211638728u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4283668395u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 1617803208u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 3746205091u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4279453282u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4016945096u , 275625928u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 1615498659u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4282021774u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2674767816u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 3209334179u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278992474u , 4284524473u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 1080932296u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 541756835u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4280309360u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 3480074184u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4283668395u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2154674120u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 3746205091u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4279453282u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4016945096u - , 544061384u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 1078627747u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4282021774u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 3211638728u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 2672463267u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278992474u , 4284985281u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 1349367752u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 4014640547u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4281165439u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 3748509640u , 275625928u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 1347063203u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4284524473u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 2154674120u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 2404027811u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4280309360u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 544061384u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 3746205091u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4283668395u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 3211638728u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 810192291u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4280309360u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 1349367752u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1883934115u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4282219924u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4284129202u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 3748509640u , 275625928u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 2940898723u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4281165439u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2154674120u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 4014640547u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4284524473u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4016945096u , 275625928u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 810192291u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4282021774u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2154674120u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 1615498659u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4279453282u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4016945096u , 275625928u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 2672463267u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4278860632u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4283273123u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 1886238664u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 3477769635u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4279716967u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4280704632u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 3748509640u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4279716967u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4284985281u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 1080932296u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 1078627747u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4279716967u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4282812316u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 2674767816u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 1615498659u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4280309617u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4280704632u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4016945096u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 2404027811u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4280836731u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4284985281u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 1080932296u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 3209334179u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4280836731u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4282812316u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 2406332360u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 3746205091u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4281429125u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4281165439u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 3480074184u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278992474u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 1078627747u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4284129202u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 1080932296u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 1347063203u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4282812574u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282417045u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 1886238664u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4281165439u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 2406332360u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 2404027811u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4278860632u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4279848553u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 3211638728u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 3209334179u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4279716967u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 3480074184u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 3477769635u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4279716967u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4284129202u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4280836731u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4283668395u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4280836731u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282021774u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 1078627747u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282021774u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 1078627747u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4281956239u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282021774u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 1347063203u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4280309360u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4278860632u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4280309360u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4279716967u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4280309360u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 2404027811u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4280309617u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4280309360u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 3209334179u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283207845u , 4283668652u , 4283800239u , 4284261046u , 4284261046u , 4284524474u , 4284788159u , 4284788159u - , 4284788159u , 4284788159u , 4285117123u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4284524473u - , 4283668395u , 4283668395u , 4283668395u , 4283668395u , 4282417045u , 4282021774u , 4282021774u , 4280309360u - , 4280309360u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4281165439u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 3211638728u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 3209334179u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283536810u , 4283800239u , 4284261046u , 4284656316u , 4284919745u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4284985281u , 4283668395u , 4282417045u , 4281560710u , 4280309360u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282021774u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 2943203272u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 3209334179u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283207845u , 4283800239u , 4284392888u - , 4284788159u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4284129202u , 4282417045u , 4280704632u , 4278992474u , 4278597203u , 4282021774u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 2154674120u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283207845u , 4283800239u , 4284392888u , 4285117123u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4284129202u , 4284524473u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 1349367752u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283339432u , 4284063667u - , 4284788159u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 544061384u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283536810u , 4284392888u , 4285117123u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 3748509640u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283339432u , 4284063667u , 4284919745u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 2674767816u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 541756835u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283800239u , 4284656316u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 1349367752u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 1078627747u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283207845u , 4284261046u , 4285117123u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 3748509640u , 1617803208u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 1078627747u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283339432u , 4284524474u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 3748509640u , 1617803208u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 1078627747u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283668652u - , 4284788159u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 3211638728u , 1080932296u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 1078627747u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283668652u , 4284788159u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2674767816u - , 275625928u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 1078627747u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283668652u , 4284788159u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4016945096u , 1349367752u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 1615498659u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283339432u , 4284524474u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 2943203272u , 275625928u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283207845u - , 4284261046u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4016945096u , 1349367752u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283800239u , 4285117123u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2406332360u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283339432u , 4284788159u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 3480074184u , 275625928u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4284261046u , 4285248710u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4016945096u - , 812496840u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283536810u , 4284919745u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4016945096u , 1617803208u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4284063667u , 4285248710u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 1617803208u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283207845u , 4284788159u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 2674767816u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283668652u , 4285248710u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2674767816u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4284261046u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2674767816u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283207845u , 4284656316u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2674767816u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283536810u , 4284919745u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2154674120u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283668652u , 4285248710u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 1617803208u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283932081u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 1080932296u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4284261046u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4016945096u , 812496840u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4284524474u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 3480074184u , 275625928u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4284524474u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 2943203272u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4283076003u , 4284524474u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 1886238664u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4283076003u , 4284524474u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 812496840u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4283076003u , 4284524474u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 3748509640u , 275625928u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4283076003u - , 4284524474u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2406332360u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283076003u , 4284524474u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 1080932296u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283076003u , 4283932081u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 3748509640u - , 275625928u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283076003u , 4283932081u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 2154674120u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2152369571u , 4283076003u , 4283536810u , 4285248710u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 544061384u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 1078627747u , 4283207845u , 4285248710u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 3211638728u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 1078627747u , 4284919745u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 1080932296u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2406332360u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 3748509640u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 1617803208u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 1617803208u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 544061384u , 4016945096u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 3748509640u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 3480074184u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 1617803208u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 2154674120u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 3748509640u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 812496840u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 1617803208u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 3480074184u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 3480074184u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 2154674120u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 1080932296u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 544061384u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2674767816u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 3211638728u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4284985281u , 4282021774u , 4281560710u , 4280309360u , 4280309360u , 4280309360u - , 4280309360u , 4280309360u , 4280309360u , 4280309360u , 4280309360u , 4282021774u , 4282417045u , 540702606u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 1349367752u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4280704632u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4010161747u - , 805713491u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 3748509640u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4280309360u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 3473290835u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2154674120u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4280309360u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 1611019859u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 275625928u , 4016945096u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4280309360u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 3204855379u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 2154674120u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4281165439u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 268842579u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 275625928u , 4016945096u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4282812316u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 1342584403u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 2154674120u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4278992474u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 2147890771u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 275625928u - , 4016945096u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4283273123u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 2667984467u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 2154674120u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4284985281u , 4283668395u , 4282812316u , 4282021774u , 4282021774u , 4282021774u - , 4282021774u , 4282021774u , 4282021774u , 4282021774u , 4282812316u , 4283668395u , 4284985281u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4282021774u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 3204855379u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 3748509640u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4284985281u , 4282812316u - , 4281165439u , 4279453282u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278992474u - , 4280704632u , 4282417045u , 4284524473u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4284524473u , 4281165439u , 4279453282u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278992474u , 2402578311u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 1617803208u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4284985281u , 4282812316u , 4280309360u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4279848553u , 4282417045u , 4284985281u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4284985281u , 4283668395u , 4283273123u , 4282021774u , 4282021774u , 4282021774u , 4282021774u , 4283668395u - , 4284129202u , 4285380552u , 3748509640u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 3211638728u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4284524473u , 4282021774u , 4278992474u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4281165439u , 4284524473u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 544061384u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 544061384u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4284985281u - , 4282021774u , 4278992474u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4281165439u , 4284524473u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 1886238664u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 2406332360u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4283273123u , 4278992474u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278992474u , 4282021774u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 2943203272u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 4016945096u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4284985281u , 4280704632u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4279848553u , 4284524473u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4016945096u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 1349367752u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4284129202u , 4278992474u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278992474u , 4283273123u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 812496840u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 2674767816u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4282812316u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282021774u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 1617803208u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 4016945096u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4282812316u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282673278u , 4282673278u , 4284711316u , 4286815145u - , 4286815145u , 4283725193u , 4282673278u , 4282673278u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4281165439u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2674767816u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 1349367752u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4282812316u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4279649118u - , 4284711316u , 4288853183u , 4292929258u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4292929258u , 4288853183u , 4284711316u - , 4279649118u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4281165439u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 3480074184u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 2674767816u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4282812316u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4283725193u , 4289839305u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4289839305u , 4282673278u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4281560710u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 3748509640u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4283668395u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4284711316u , 4292929258u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967033u - , 4294901234u , 4294900973u , 4294900972u , 4292863195u , 4284711052u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4282812316u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 1080932296u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 812496840u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4284985281u , 4278992474u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4281687155u , 4290891220u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294901235u , 4294900972u - , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4291876815u , 4280635239u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4284129202u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 1886238664u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 1886238664u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4280309360u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4285763230u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967031u , 4294900972u , 4294900972u - , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4293914854u , 4285763230u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4279453282u , 4284985281u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2674767816u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2943203272u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4282417045u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4279649118u , 4289839305u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294900974u , 4294900972u , 4294900972u - , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294967033u - , 4288853183u , 4279649118u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4281560710u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 3211638728u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 4016945096u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4284524473u , 4278992474u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4279649118u , 4291877343u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4288853183u , 4283724934u , 4294900972u , 4294900972u , 4294900972u - , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294901235u - , 4294967295u , 4291877343u , 4279649118u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4283668395u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 812496840u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4281165439u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4279649118u , 4291877343u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4292929258u , 4282673278u , 4278597203u , 4282673273u , 4294900972u , 4294900972u , 4294900972u - , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4291876817u - , 4288853183u , 4294967295u , 4291877343u , 4279649118u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4279848553u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 544061384u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 1617803208u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4284524473u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4279649118u , 4291877343u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4291877343u , 4279649118u , 4278597203u , 4278597203u , 4280635238u , 4294900972u , 4294900972u , 4294900972u - , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4290825158u - , 4278597203u , 4284711316u , 4294967295u , 4291877343u , 4279649118u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282812316u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 1080932296u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 2674767816u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4281165439u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4289839305u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4291877343u - , 4279649118u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4291876815u , 4294900972u , 4294900972u - , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4287800745u - , 4278597203u , 4278597203u , 4284711316u , 4294967295u , 4288853183u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4279453282u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2154674120u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 3211638728u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4284524473u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4285763230u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4293915380u , 4279649118u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4283724931u , 4294900972u , 4294900972u - , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4280635238u - , 4278597203u , 4278597203u , 4278597203u , 4288853183u , 4294967295u , 4285763230u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4283668395u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2674767816u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4282021774u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4281687155u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4284711316u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4286749088u , 4294900972u - , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4284711052u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4279649118u , 4293915380u , 4293915380u , 4280635241u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4280704632u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 3211638728u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 812496840u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4279453282u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4290891220u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4292929258u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4283724931u - , 4291876815u , 4294900972u , 4294900972u , 4294900972u , 4290825158u , 4282673273u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4285763230u , 4294967295u , 4290891220u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4284985281u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4016945096u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 1080932296u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4284129202u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4283725193u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4285763230u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4282673273u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4279649118u , 4294967295u , 4294967295u , 4282673278u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4282812316u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 2154674120u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4282021774u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4291877343u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4280635241u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4290891220u , 4294967295u , 4290891220u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4280704632u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 1080932296u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 2406332360u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4280309360u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282673278u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4293915380u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4286815145u , 4294967295u , 4294967295u - , 4282673278u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278992474u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 1617803208u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 3211638728u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4288853183u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4290891220u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4284711316u , 4294967295u , 4294967295u - , 4288853183u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4284129202u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2154674120u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 3211638728u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4283668395u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4279649118u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4290891220u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282673278u , 4294967295u , 4294967295u - , 4293915380u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4282812316u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 2674767816u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4282812316u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4283725193u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4290891220u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4283725193u , 4294967295u , 4294967295u - , 4294967295u , 4283725193u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4282021774u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 3211638728u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4282021774u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4287801268u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4291877343u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4286815145u , 4294967295u , 4294967295u - , 4294967295u , 4287801268u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4280309360u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4016945096u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4281560710u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4291877343u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4279649118u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4288853183u , 4294967295u , 4294967295u - , 4294967295u , 4290891220u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4280309360u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1080932296u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4280309360u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4283725193u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4292929258u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4280309360u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 812496840u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1080932296u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4280309360u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4280635241u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4288853183u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282673278u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278992474u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 1080932296u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1080932296u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4280309360u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282673278u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4280635241u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4290891220u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4282673278u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 1617803208u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1080932296u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4280309360u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282673278u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4290891220u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4283725193u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4282673278u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278992474u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 2154674120u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1080932296u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4280309360u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282673278u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4285763230u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4280635241u , 4293915380u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4282673278u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4280309360u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 2154674120u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1080932296u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4281560710u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282673278u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4284711316u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4279649118u , 4291877343u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4282673278u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4280309360u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 3211638728u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1080932296u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4282021774u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282673278u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4286815145u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4281687155u , 4293915380u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4282673278u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4280704632u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 3211638728u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1080932296u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4282812316u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282673278u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4291877343u , 4282673278u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4279649118u , 4287801268u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4280635241u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4282021774u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 3748509640u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1080932296u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4283668395u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4291877343u , 4285763230u , 4281687155u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4280635241u , 4283725193u , 4288853183u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4282812316u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1080932296u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4292929258u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4291877343u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4284129202u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1080932296u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4280309360u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4289839305u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4288853183u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278992474u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4283668395u , 4283668395u , 4282021774u - , 4282021774u , 4282021774u , 4282021774u , 4282021774u , 4282021774u , 4282021774u , 4282021774u , 4282021774u - , 4282417045u , 4283668395u , 4283668395u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 544061384u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 1080932296u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4282021774u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4285763230u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4284711316u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4280704632u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4284524473u , 4282812316u , 4281165439u , 4279848553u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4280635238u , 4282673273u , 4286749088u , 4286749088u , 4286749088u , 4286749088u , 4285762966u , 4282673273u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4279453282u , 4281165439u , 4284985281u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 1080932296u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 812496840u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4284129202u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4280635241u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4280635241u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4282812316u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4284985281u , 4282417045u , 4279848553u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4279648861u , 4286749088u , 4292862937u - , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u - , 4293914850u , 4287800745u , 4279648861u , 4278597203u , 4278597203u , 4278597203u , 4279848553u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 1080932296u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4279453282u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4291877343u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4291877343u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4284985281u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4284524473u , 4281165439u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4281686896u , 4293914850u , 4294900972u , 4294900972u - , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u - , 4294900972u , 4294900972u , 4289838780u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4283273123u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 1080932296u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4282021774u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4285763230u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4284711316u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4281165439u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4284524473u , 4281165439u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4292862937u , 4294900972u , 4294900972u , 4294900972u - , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u - , 4294900972u , 4294900972u , 4290825158u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282021774u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 1617803208u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 4016945096u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4284524473u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4279649118u - , 4293915380u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4293915380u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4283668395u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4282021774u , 4278992474u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4292862937u , 4294900972u , 4294900972u , 4294900972u - , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u - , 4294900972u , 4293914850u , 4283724931u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282812316u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 2154674120u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 3211638728u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4281165439u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4286815145u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4286815145u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4279848553u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4284524473u , 4280309360u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4281686896u , 4291876815u , 4294900972u , 4294900972u - , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4294900972u , 4293914850u - , 4288787123u , 4280635238u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4284524473u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 2154674120u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 3211638728u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4284524473u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4279649118u , 4293915380u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4292929258u , 4279649118u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282812316u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4284129202u , 4278992474u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4281686896u , 4285762966u - , 4287800745u , 4290825158u , 4290825158u , 4290825158u , 4287800745u , 4286749088u , 4282673273u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4279848553u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 2154674120u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 2154674120u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4281165439u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4284711316u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4283725193u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4280309360u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4282812316u , 4278992474u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282812316u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 2154674120u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 2154674120u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4284985281u , 4278992474u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4290891220u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4289839305u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4283668395u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4284129202u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4281165439u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 2154674120u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 1080932296u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4282417045u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4279649118u , 4293915380u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4292929258u , 4279649118u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4281560710u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4284524473u , 4278992474u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4279848553u , 4284985281u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 2154674120u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 812496840u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4280309360u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4281687155u , 4293915380u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4293915380u , 4281687155u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4279453282u , 4284985281u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4281560710u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4279848553u , 4284985281u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 2943203272u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4284985281u , 4278992474u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4284711316u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4283725193u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4284129202u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4280309360u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4279848553u , 4284985281u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 3211638728u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 3480074184u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4284129202u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4284711316u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4284711316u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4282812316u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4280309360u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4279453282u , 4284985281u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 3211638728u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 2674767816u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4282812316u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282673278u , 4293915380u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4293915380u , 4281687155u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4281560710u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4280309360u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278992474u , 4284129202u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 3211638728u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 1886238664u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4282812316u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4281687155u - , 4291877343u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4291877343u - , 4280635241u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4281165439u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4282021774u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278992474u - , 4284129202u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 3211638728u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 1080932296u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4282812316u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4286815145u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4286815145u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4281165439u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4280309360u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278992474u , 4284129202u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 2406332360u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4282812316u , 4278992474u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4281687155u , 4290891220u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4290891220u , 4280635241u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282417045u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4282812316u , 4279453282u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4283668395u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 2154674120u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 3480074184u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4284129202u , 4279453282u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282673278u , 4289839305u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4288853183u , 4282673278u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278992474u , 4283273123u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4284129202u , 4281165439u - , 4278992474u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282812316u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 2154674120u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 2406332360u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4284985281u , 4280704632u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4280635241u , 4285763230u - , 4290891220u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u - , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4294967295u , 4290891220u - , 4285763230u , 4279649118u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4280309360u , 4284524473u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4283273123u , 4281165439u , 4278992474u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4282812316u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 2154674120u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 1617803208u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4283273123u , 4279453282u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4282673278u , 4285763230u , 4287801268u , 4290891220u , 4290891220u , 4290891220u - , 4290891220u , 4290891220u , 4290891220u , 4286815145u , 4285763230u , 4282673278u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278992474u , 4282417045u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4284129202u , 4281560710u , 4279453282u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u , 4278597203u - , 4278597203u , 4278597203u , 4278597203u , 4282812316u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u , 4285380552u - , 4285380552u , 2154674120u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u - , 0u , 0u , 0u , 0u , 0u , 0u , 0u , 0u +static unsigned long FreeRDP_Icon_256px_prop[] = { + 256, 256, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 541756835u, 1615498659u, 2152369571u, 2940898723u, 3209334179u, + 3209334179u, 3209334179u, 2940898723u, 2152369571u, 1078627747u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 541756835u, 2152369571u, 3746205091u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 3746205091u, 1883934115u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 541756835u, 2672463267u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 2940898723u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 541756835u, 2672463267u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 2672463267u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2152369571u, 4014640547u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 1078627747u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 810192291u, 3477769635u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 2940898723u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4014640547u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 273321379u, 3209334179u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 810192291u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 810192291u, + 4014640547u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 1078627747u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1615498659u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 1078627747u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 2404027811u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 1078627747u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2672463267u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 1078627747u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 273321379u, 3477769635u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 1078627747u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 273321379u, + 3477769635u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 541756835u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 273321379u, 3477769635u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 273321379u, 3477769635u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 3209334179u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 273321379u, 3477769635u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 2404027811u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 273321379u, 3477769635u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 1615498659u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 273321379u, 3477769635u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 541756835u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 273321379u, 3477769635u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 3477769635u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 273321379u, + 3477769635u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 2404027811u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2940898723u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 810192291u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 2672463267u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 3746205091u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 2404027811u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 2404027811u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1615498659u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 810192291u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 1347063203u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 3746205091u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 810192291u, 4014640547u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 1883934115u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 273321379u, 3746205091u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 273321379u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 3477769635u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 2672463267u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2672463267u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 1078627747u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 1883934115u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 3746205091u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1078627747u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 1615498659u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 541756835u, 4014640547u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4014640547u, 273321379u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 3477769635u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 2152369571u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 2672463267u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 273321379u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1615498659u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 2672463267u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 810192291u, 4014640547u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 810192291u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 273321379u, 3477769635u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 3477769635u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2672463267u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 1615498659u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 1615498659u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 273321379u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 541756835u, 4014640547u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 2940898723u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 3477769635u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 1347063203u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2404027811u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 273321379u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 1078627747u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 2940898723u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 273321379u, + 4014640547u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 1615498659u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2940898723u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 541756835u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1615498659u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 3477769635u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 541756835u, 4014640547u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 2404027811u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 3209334179u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 1347063203u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1883934115u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 273321379u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 541756835u, 4014640547u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 3477769635u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 3209334179u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 2404027811u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1883934115u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 1347063203u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 541756835u, 4014640547u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 541756835u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 3209334179u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 3746205091u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 1615498659u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 2940898723u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 273321379u, 4014640547u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 2152369571u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2940898723u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 1078627747u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 1078627747u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 273321379u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 273321379u, 3746205091u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4014640547u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 3209334179u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 810192291u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 2404027811u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 3209334179u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 1883934115u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 1615498659u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 1078627747u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 273321379u, 4014640547u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 273321379u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2404027811u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 3211638728u, 3211638728u, 3211638728u, 2154674120u, + 275625928u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 810192291u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283668652u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4016945096u, 1617803208u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 3209334179u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283800239u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 1349367752u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 1347063203u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4284261046u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4016945096u, 275625928u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 3746205091u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4284392888u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4284788159u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4016945096u, 544061384u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 273321379u, + 4014640547u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4284919745u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 2674767816u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2672463267u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 544061384u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 541756835u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 3211638728u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3209334179u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283536810u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 1080932296u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1078627747u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283668652u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3748509640u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3209334179u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283800239u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2154674120u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1347063203u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283800238u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4016945096u, + 275625928u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3746205091u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4280836731u, 4284524473u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2674767816u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1615498659u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4280573046u, 4280309360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 1080932296u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3746205091u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4279716967u, 4278597203u, + 4282417045u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3480074184u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1615498659u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4279716967u, 4278597203u, 4278992474u, 4284524473u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1886238664u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3746205091u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4279716967u, + 4278597203u, 4278597203u, 4280309360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4016945096u, 275625928u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1615498659u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4278860632u, 4278597203u, 4278597203u, 4278597203u, + 4283273123u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2674767816u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3746205091u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278992474u, 4284985281u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1080932296u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1615498659u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4281165439u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 3748509640u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3746205091u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4283668395u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1615498659u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279453282u, 4284985281u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4016945096u, 544061384u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3746205091u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4282219924u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 2943203272u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1078627747u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4284129202u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1349367752u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3209334179u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280309360u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 3748509640u, 275625928u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 810192291u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281956239u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4282417045u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 2154674120u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2672463267u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278992474u, + 4284985281u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 812496840u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 541756835u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280704632u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 3211638728u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4283668395u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 1617803208u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 3746205091u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279453282u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4016945096u, 275625928u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 1615498659u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 2674767816u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 3209334179u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278992474u, 4284524473u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 1080932296u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 541756835u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281956239u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280309360u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3480074184u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283668395u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 2154674120u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 3746205091u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4279453282u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4016945096u, 544061384u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 1078627747u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282021774u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3211638728u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2672463267u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278992474u, 4284985281u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 1349367752u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 4014640547u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4281165439u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 3748509640u, 275625928u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 1347063203u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4284524473u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2404027811u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281956239u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4280309360u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 544061384u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 3746205091u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4283668395u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 3211638728u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 810192291u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280309360u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1349367752u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1883934115u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4282219924u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4284129202u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 3748509640u, 275625928u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 2940898723u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4281165439u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 2154674120u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 4014640547u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4284524473u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4016945096u, 275625928u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 810192291u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2154674120u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1615498659u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279453282u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4016945096u, + 275625928u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2672463267u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4278860632u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283273123u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1886238664u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 3477769635u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4279716967u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4280704632u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 3748509640u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4279716967u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4284985281u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1080932296u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 1078627747u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4279716967u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4282812316u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 2674767816u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 1615498659u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4280309617u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4280704632u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4016945096u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2404027811u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4280836731u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4284985281u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1080932296u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 3209334179u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4280836731u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4282812316u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2406332360u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 3746205091u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281429125u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281165439u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3480074184u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278992474u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1078627747u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4284129202u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 1080932296u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1347063203u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4282812574u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282417045u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1886238664u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4281165439u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2406332360u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2404027811u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4278860632u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279848553u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3211638728u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 3209334179u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4279716967u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 3480074184u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 3477769635u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4279716967u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4284129202u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4280836731u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283668395u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4280836731u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1078627747u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282021774u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1078627747u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1347063203u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4280309360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4278860632u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280309360u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4279716967u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4280309360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2404027811u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4280309617u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280309360u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 3209334179u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283207845u, 4283668652u, 4283800239u, 4284261046u, 4284261046u, 4284524474u, 4284788159u, + 4284788159u, 4284788159u, 4284788159u, 4285117123u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4284524473u, 4283668395u, 4283668395u, 4283668395u, 4283668395u, 4282417045u, + 4282021774u, 4282021774u, 4280309360u, 4280309360u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4281165439u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 3211638728u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 3209334179u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283536810u, 4283800239u, + 4284261046u, 4284656316u, 4284919745u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4284985281u, 4283668395u, 4282417045u, 4281560710u, 4280309360u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282021774u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2943203272u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 3209334179u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283207845u, 4283800239u, 4284392888u, + 4284788159u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284129202u, 4282417045u, + 4280704632u, 4278992474u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2154674120u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283207845u, 4283800239u, 4284392888u, + 4285117123u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284129202u, + 4284524473u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1349367752u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283339432u, 4284063667u, + 4284788159u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 544061384u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283536810u, + 4284392888u, 4285117123u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3748509640u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283339432u, 4284063667u, 4284919745u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 2674767816u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 541756835u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283800239u, 4284656316u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 1349367752u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 1078627747u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283207845u, 4284261046u, 4285117123u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3748509640u, 1617803208u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 1078627747u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283339432u, 4284524474u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 3748509640u, 1617803208u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1078627747u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283668652u, 4284788159u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 3211638728u, 1080932296u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1078627747u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283668652u, 4284788159u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 2674767816u, 275625928u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1078627747u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283668652u, 4284788159u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4016945096u, + 1349367752u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 1615498659u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283339432u, + 4284524474u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2943203272u, 275625928u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283207845u, 4284261046u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4016945096u, 1349367752u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283800239u, 4285117123u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2406332360u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283339432u, + 4284788159u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 3480074184u, 275625928u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 2152369571u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4284261046u, 4285248710u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4016945096u, 812496840u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283536810u, 4284919745u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4016945096u, 1617803208u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 2152369571u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4284063667u, 4285248710u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 1617803208u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283207845u, 4284788159u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 2674767816u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283668652u, 4285248710u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2674767816u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4284261046u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 2674767816u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283207845u, 4284656316u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 2674767816u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 2152369571u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283536810u, + 4284919745u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283668652u, 4285248710u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1617803208u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 2152369571u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283932081u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 1080932296u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4284261046u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4016945096u, + 812496840u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4284524474u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3480074184u, 275625928u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4284524474u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2943203272u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4284524474u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 1886238664u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 2152369571u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4284524474u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 812496840u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4284524474u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 3748509640u, 275625928u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 2152369571u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4284524474u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 2406332360u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4284524474u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1080932296u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283932081u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 3748509640u, 275625928u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, + 4283932081u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 2154674120u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2152369571u, 4283076003u, 4283536810u, 4285248710u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 544061384u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1078627747u, 4283207845u, + 4285248710u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 3211638728u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1078627747u, 4284919745u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 1080932296u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 2406332360u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3748509640u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1617803208u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 1617803208u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 544061384u, 4016945096u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3748509640u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 3480074184u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1617803208u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 2154674120u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 3748509640u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 812496840u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1617803208u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 3480074184u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 3480074184u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2154674120u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 1080932296u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 544061384u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2674767816u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 3211638728u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284985281u, 4282021774u, 4281560710u, + 4280309360u, 4280309360u, 4280309360u, 4280309360u, 4280309360u, 4280309360u, 4280309360u, + 4280309360u, 4282021774u, 4282417045u, 540702606u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 1349367752u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4280704632u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4010161747u, 805713491u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 3748509640u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4280309360u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 3473290835u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2154674120u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4280309360u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 1611019859u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 275625928u, 4016945096u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4280309360u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 3204855379u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2154674120u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4281165439u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 268842579u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 275625928u, 4016945096u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4282812316u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 1342584403u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2154674120u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4278992474u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 2147890771u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 275625928u, 4016945096u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4283273123u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 2667984467u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2154674120u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4284985281u, 4283668395u, 4282812316u, 4282021774u, 4282021774u, 4282021774u, 4282021774u, + 4282021774u, 4282021774u, 4282021774u, 4282812316u, 4283668395u, 4284985281u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4282021774u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 3204855379u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 3748509640u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4284985281u, 4282812316u, 4281165439u, 4279453282u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278992474u, 4280704632u, 4282417045u, 4284524473u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284524473u, 4281165439u, + 4279453282u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278992474u, 2402578311u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 1617803208u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4284985281u, 4282812316u, 4280309360u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279848553u, 4282417045u, 4284985281u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284985281u, 4283668395u, + 4283273123u, 4282021774u, 4282021774u, 4282021774u, 4282021774u, 4283668395u, 4284129202u, + 4285380552u, 3748509640u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 3211638728u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4284524473u, 4282021774u, 4278992474u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281165439u, 4284524473u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 544061384u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 544061384u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284985281u, 4282021774u, + 4278992474u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4281165439u, 4284524473u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 1886238664u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2406332360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4283273123u, 4278992474u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278992474u, 4282021774u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 2943203272u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 4016945096u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4284985281u, 4280704632u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4279848553u, 4284524473u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4016945096u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 1349367752u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284129202u, + 4278992474u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278992474u, 4283273123u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 812496840u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 2674767816u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4282812316u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1617803208u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 4016945096u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4282812316u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4282673278u, 4282673278u, 4284711316u, 4286815145u, + 4286815145u, 4283725193u, 4282673278u, 4282673278u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4281165439u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 2674767816u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1349367752u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4282812316u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4279649118u, 4284711316u, 4288853183u, 4292929258u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4292929258u, 4288853183u, 4284711316u, 4279649118u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4281165439u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 3480074184u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 2674767816u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4282812316u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283725193u, 4289839305u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4289839305u, 4282673278u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281560710u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 3748509640u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4283668395u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4284711316u, + 4292929258u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967033u, 4294901234u, + 4294900973u, 4294900972u, 4292863195u, 4284711052u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4282812316u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 1080932296u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 812496840u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4284985281u, 4278992474u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4281687155u, 4290891220u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294901235u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4291876815u, 4280635239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4284129202u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1886238664u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1886238664u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4280309360u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4285763230u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967031u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4293914854u, + 4285763230u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279453282u, 4284985281u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 2674767816u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2943203272u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4282417045u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, + 4289839305u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294900974u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294967033u, 4288853183u, 4279649118u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4281560710u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 3211638728u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 4016945096u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284524473u, + 4278992474u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4279649118u, 4291877343u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4288853183u, 4283724934u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294901235u, 4294967295u, 4291877343u, 4279649118u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4283668395u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 812496840u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4281165439u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, 4291877343u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4292929258u, 4282673278u, + 4278597203u, 4282673273u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4291876817u, 4288853183u, + 4294967295u, 4291877343u, 4279649118u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279848553u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 544061384u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 1617803208u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284524473u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4279649118u, 4291877343u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4291877343u, 4279649118u, 4278597203u, 4278597203u, 4280635238u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4290825158u, 4278597203u, 4284711316u, 4294967295u, 4291877343u, + 4279649118u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4282812316u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1080932296u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2674767816u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4281165439u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4289839305u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4291877343u, 4279649118u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4291876815u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4287800745u, + 4278597203u, 4278597203u, 4284711316u, 4294967295u, 4288853183u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4279453282u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 2154674120u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 3211638728u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284524473u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4285763230u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4293915380u, 4279649118u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4283724931u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4280635238u, 4278597203u, 4278597203u, 4278597203u, + 4288853183u, 4294967295u, 4285763230u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283668395u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 2674767816u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4282021774u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281687155u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4284711316u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4286749088u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4284711052u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, 4293915380u, 4293915380u, + 4280635241u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4280704632u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3211638728u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 812496840u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4279453282u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4290891220u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4292929258u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4283724931u, 4291876815u, 4294900972u, 4294900972u, + 4294900972u, 4290825158u, 4282673273u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4285763230u, 4294967295u, 4290891220u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4284985281u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4016945096u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1080932296u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4284129202u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283725193u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4285763230u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4282673273u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, + 4294967295u, 4294967295u, 4282673278u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282812316u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 2154674120u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4282021774u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4291877343u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4280635241u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4290891220u, 4294967295u, 4290891220u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4280704632u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 1080932296u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 2406332360u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4280309360u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282673278u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4293915380u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4286815145u, 4294967295u, 4294967295u, 4282673278u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278992474u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 1617803208u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3211638728u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4288853183u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4290891220u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4284711316u, 4294967295u, + 4294967295u, 4288853183u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4284129202u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 3211638728u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4283668395u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4290891220u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4282673278u, 4294967295u, 4294967295u, 4293915380u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4282812316u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 2674767816u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4282812316u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4283725193u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4290891220u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283725193u, + 4294967295u, 4294967295u, 4294967295u, 4283725193u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3211638728u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4282021774u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4287801268u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4291877343u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4286815145u, 4294967295u, 4294967295u, 4294967295u, + 4287801268u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4280309360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4016945096u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4281560710u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4291877343u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4279649118u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4288853183u, 4294967295u, 4294967295u, 4294967295u, 4290891220u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280309360u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 1080932296u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4280309360u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4283725193u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4292929258u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4280309360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 812496840u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1080932296u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4280309360u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4280635241u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4288853183u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4282673278u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278992474u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 1080932296u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1080932296u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4280309360u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282673278u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4280635241u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4290891220u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4282673278u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1617803208u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1080932296u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4280309360u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4282673278u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4290891220u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4283725193u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4282673278u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278992474u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2154674120u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 1080932296u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4280309360u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4282673278u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4285763230u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4280635241u, 4293915380u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4282673278u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280309360u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 1080932296u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4281560710u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282673278u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4284711316u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, + 4291877343u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4282673278u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4280309360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 3211638728u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 1080932296u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4282021774u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4282673278u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4286815145u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4281687155u, 4293915380u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4282673278u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280704632u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 3211638728u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 1080932296u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4282812316u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282673278u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4291877343u, + 4282673278u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, 4287801268u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4280635241u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3748509640u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1080932296u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4283668395u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4291877343u, 4285763230u, + 4281687155u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280635241u, 4283725193u, + 4288853183u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282812316u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1080932296u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4292929258u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4291877343u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4284129202u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1080932296u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4280309360u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4289839305u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4288853183u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278992474u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4283668395u, 4283668395u, 4282021774u, 4282021774u, + 4282021774u, 4282021774u, 4282021774u, 4282021774u, 4282021774u, 4282021774u, 4282021774u, + 4282417045u, 4283668395u, 4283668395u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 544061384u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 1080932296u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4282021774u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4285763230u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4284711316u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4280704632u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4284524473u, 4282812316u, 4281165439u, 4279848553u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4280635238u, 4282673273u, 4286749088u, 4286749088u, + 4286749088u, 4286749088u, 4285762966u, 4282673273u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4279453282u, 4281165439u, 4284985281u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 1080932296u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 812496840u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284129202u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280635241u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4280635241u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4282812316u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4284985281u, 4282417045u, 4279848553u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279648861u, 4286749088u, 4292862937u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4293914850u, 4287800745u, 4279648861u, 4278597203u, 4278597203u, 4278597203u, + 4279848553u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1080932296u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4279453282u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4291877343u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4291877343u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4284985281u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284524473u, 4281165439u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4281686896u, 4293914850u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4289838780u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283273123u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 1080932296u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4282021774u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4285763230u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4284711316u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4281165439u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4284524473u, 4281165439u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4292862937u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4290825158u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1617803208u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 4016945096u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284524473u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, 4293915380u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4293915380u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283668395u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4282021774u, 4278992474u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4292862937u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4293914850u, 4283724931u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282812316u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2154674120u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3211638728u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4281165439u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4286815145u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4286815145u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4279848553u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284524473u, 4280309360u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281686896u, 4291876815u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4293914850u, 4288787123u, 4280635238u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4284524473u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 3211638728u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4284524473u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, + 4293915380u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4292929258u, 4279649118u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282812316u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4284129202u, 4278992474u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281686896u, 4285762966u, 4287800745u, + 4290825158u, 4290825158u, 4290825158u, 4287800745u, 4286749088u, 4282673273u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279848553u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 2154674120u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2154674120u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4281165439u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4284711316u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4283725193u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4280309360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4282812316u, 4278992474u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4282812316u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 2154674120u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2154674120u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4284985281u, 4278992474u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4290891220u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4289839305u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283668395u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4284129202u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281165439u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1080932296u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4282417045u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, + 4293915380u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4292929258u, + 4279649118u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4281560710u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4284524473u, 4278992474u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4279848553u, 4284985281u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 2154674120u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 812496840u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4280309360u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281687155u, 4293915380u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4293915380u, 4281687155u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4279453282u, 4284985281u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4281560710u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279848553u, 4284985281u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2943203272u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4284985281u, 4278992474u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4284711316u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4283725193u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4284129202u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4280309360u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4279848553u, 4284985281u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 3211638728u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 3480074184u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4284129202u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4284711316u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4284711316u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4282812316u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4280309360u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279453282u, 4284985281u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3211638728u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2674767816u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4282812316u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282673278u, 4293915380u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4293915380u, 4281687155u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281560710u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4280309360u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278992474u, 4284129202u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 3211638728u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1886238664u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4282812316u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4281687155u, 4291877343u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4291877343u, 4280635241u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4281165439u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4282021774u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278992474u, 4284129202u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 3211638728u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1080932296u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4282812316u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4286815145u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4286815145u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281165439u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4280309360u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278992474u, + 4284129202u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2406332360u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4282812316u, + 4278992474u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4281687155u, 4290891220u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4290891220u, 4280635241u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4282417045u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4282812316u, 4279453282u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4283668395u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 2154674120u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 3480074184u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284129202u, 4279453282u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282673278u, + 4289839305u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4288853183u, 4282673278u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278992474u, 4283273123u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284129202u, 4281165439u, 4278992474u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282812316u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2406332360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4284985281u, 4280704632u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280635241u, 4285763230u, + 4290891220u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4290891220u, 4285763230u, 4279649118u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280309360u, + 4284524473u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4283273123u, 4281165439u, 4278992474u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4282812316u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2154674120u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1617803208u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4283273123u, 4279453282u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282673278u, + 4285763230u, 4287801268u, 4290891220u, 4290891220u, 4290891220u, 4290891220u, 4290891220u, + 4290891220u, 4286815145u, 4285763230u, 4282673278u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278992474u, 4282417045u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284129202u, 4281560710u, 4279453282u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282812316u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u }; diff --git a/scripts/LECHash.c b/scripts/LECHash.c index 885de6c18..947ff47b9 100644 --- a/scripts/LECHash.c +++ b/scripts/LECHash.c @@ -1,39 +1,42 @@ -#include +#include typedef unsigned short UINT16; -static UINT16 HuffCodeLEC[] = -{ - 0x0004, 0x0024, 0x0014, 0x0011, 0x0051, 0x0031, 0x0071, 0x0009, 0x0049, 0x0029, 0x0069, 0x0015, 0x0095, - 0x0055, 0x00d5, 0x0035, 0x00b5, 0x0075, 0x001d, 0x00f5, 0x011d, 0x009d, 0x019d, 0x005d, 0x000d, 0x008d, 0x015d, - 0x00dd, 0x01dd, 0x003d, 0x013d, 0x00bd, 0x004d, 0x01bd, 0x007d, 0x006b, 0x017d, 0x00fd, 0x01fd, 0x0003, 0x0103, - 0x0083, 0x0183, 0x026b, 0x0043, 0x016b, 0x036b, 0x00eb, 0x0143, 0x00c3, 0x02eb, 0x01c3, 0x01eb, 0x0023, 0x03eb, - 0x0123, 0x00a3, 0x01a3, 0x001b, 0x021b, 0x0063, 0x011b, 0x0163, 0x00e3, 0x00cd, 0x01e3, 0x0013, 0x0113, 0x0093, - 0x031b, 0x009b, 0x029b, 0x0193, 0x0053, 0x019b, 0x039b, 0x005b, 0x025b, 0x015b, 0x035b, 0x0153, 0x00d3, 0x00db, - 0x02db, 0x01db, 0x03db, 0x003b, 0x023b, 0x013b, 0x01d3, 0x033b, 0x00bb, 0x02bb, 0x01bb, 0x03bb, 0x007b, 0x002d, - 0x027b, 0x017b, 0x037b, 0x00fb, 0x02fb, 0x01fb, 0x03fb, 0x0007, 0x0207, 0x0107, 0x0307, 0x0087, 0x0287, 0x0187, - 0x0387, 0x0033, 0x0047, 0x0247, 0x0147, 0x0347, 0x00c7, 0x02c7, 0x01c7, 0x0133, 0x03c7, 0x0027, 0x0227, 0x0127, - 0x0327, 0x00a7, 0x00b3, 0x0019, 0x01b3, 0x0073, 0x02a7, 0x0173, 0x01a7, 0x03a7, 0x0067, 0x00f3, 0x0267, 0x0167, - 0x0367, 0x00e7, 0x02e7, 0x01e7, 0x03e7, 0x01f3, 0x0017, 0x0217, 0x0117, 0x0317, 0x0097, 0x0297, 0x0197, 0x0397, - 0x0057, 0x0257, 0x0157, 0x0357, 0x00d7, 0x02d7, 0x01d7, 0x03d7, 0x0037, 0x0237, 0x0137, 0x0337, 0x00b7, 0x02b7, - 0x01b7, 0x03b7, 0x0077, 0x0277, 0x07ff, 0x0177, 0x0377, 0x00f7, 0x02f7, 0x01f7, 0x03f7, 0x03ff, 0x000f, 0x020f, - 0x010f, 0x030f, 0x008f, 0x028f, 0x018f, 0x038f, 0x004f, 0x024f, 0x014f, 0x034f, 0x00cf, 0x000b, 0x02cf, 0x01cf, - 0x03cf, 0x002f, 0x022f, 0x010b, 0x012f, 0x032f, 0x00af, 0x02af, 0x01af, 0x008b, 0x03af, 0x006f, 0x026f, 0x018b, - 0x016f, 0x036f, 0x00ef, 0x02ef, 0x01ef, 0x03ef, 0x001f, 0x021f, 0x011f, 0x031f, 0x009f, 0x029f, 0x019f, 0x039f, - 0x005f, 0x004b, 0x025f, 0x015f, 0x035f, 0x00df, 0x02df, 0x01df, 0x03df, 0x003f, 0x023f, 0x013f, 0x033f, 0x00bf, - 0x02bf, 0x014b, 0x01bf, 0x00ad, 0x00cb, 0x01cb, 0x03bf, 0x002b, 0x007f, 0x027f, 0x017f, 0x012b, 0x037f, 0x00ff, - 0x02ff, 0x00ab, 0x01ab, 0x006d, 0x0059, 0x17ff, 0x0fff, 0x0039, 0x0079, 0x01ff, 0x0005, 0x0045, 0x0034, 0x000c, - 0x002c, 0x001c, 0x0000, 0x003c, 0x0002, 0x0022, 0x0010, 0x0012, 0x0008, 0x0032, 0x000a, 0x002a, 0x001a, 0x003a, - 0x0006, 0x0026, 0x0016, 0x0036, 0x000e, 0x002e, 0x001e, 0x003e, 0x0001, 0x00ed, 0x0018, 0x0021, 0x0025, 0x0065 +static UINT16 HuffCodeLEC[] = { + 0x0004, 0x0024, 0x0014, 0x0011, 0x0051, 0x0031, 0x0071, 0x0009, 0x0049, 0x0029, 0x0069, 0x0015, + 0x0095, 0x0055, 0x00d5, 0x0035, 0x00b5, 0x0075, 0x001d, 0x00f5, 0x011d, 0x009d, 0x019d, 0x005d, + 0x000d, 0x008d, 0x015d, 0x00dd, 0x01dd, 0x003d, 0x013d, 0x00bd, 0x004d, 0x01bd, 0x007d, 0x006b, + 0x017d, 0x00fd, 0x01fd, 0x0003, 0x0103, 0x0083, 0x0183, 0x026b, 0x0043, 0x016b, 0x036b, 0x00eb, + 0x0143, 0x00c3, 0x02eb, 0x01c3, 0x01eb, 0x0023, 0x03eb, 0x0123, 0x00a3, 0x01a3, 0x001b, 0x021b, + 0x0063, 0x011b, 0x0163, 0x00e3, 0x00cd, 0x01e3, 0x0013, 0x0113, 0x0093, 0x031b, 0x009b, 0x029b, + 0x0193, 0x0053, 0x019b, 0x039b, 0x005b, 0x025b, 0x015b, 0x035b, 0x0153, 0x00d3, 0x00db, 0x02db, + 0x01db, 0x03db, 0x003b, 0x023b, 0x013b, 0x01d3, 0x033b, 0x00bb, 0x02bb, 0x01bb, 0x03bb, 0x007b, + 0x002d, 0x027b, 0x017b, 0x037b, 0x00fb, 0x02fb, 0x01fb, 0x03fb, 0x0007, 0x0207, 0x0107, 0x0307, + 0x0087, 0x0287, 0x0187, 0x0387, 0x0033, 0x0047, 0x0247, 0x0147, 0x0347, 0x00c7, 0x02c7, 0x01c7, + 0x0133, 0x03c7, 0x0027, 0x0227, 0x0127, 0x0327, 0x00a7, 0x00b3, 0x0019, 0x01b3, 0x0073, 0x02a7, + 0x0173, 0x01a7, 0x03a7, 0x0067, 0x00f3, 0x0267, 0x0167, 0x0367, 0x00e7, 0x02e7, 0x01e7, 0x03e7, + 0x01f3, 0x0017, 0x0217, 0x0117, 0x0317, 0x0097, 0x0297, 0x0197, 0x0397, 0x0057, 0x0257, 0x0157, + 0x0357, 0x00d7, 0x02d7, 0x01d7, 0x03d7, 0x0037, 0x0237, 0x0137, 0x0337, 0x00b7, 0x02b7, 0x01b7, + 0x03b7, 0x0077, 0x0277, 0x07ff, 0x0177, 0x0377, 0x00f7, 0x02f7, 0x01f7, 0x03f7, 0x03ff, 0x000f, + 0x020f, 0x010f, 0x030f, 0x008f, 0x028f, 0x018f, 0x038f, 0x004f, 0x024f, 0x014f, 0x034f, 0x00cf, + 0x000b, 0x02cf, 0x01cf, 0x03cf, 0x002f, 0x022f, 0x010b, 0x012f, 0x032f, 0x00af, 0x02af, 0x01af, + 0x008b, 0x03af, 0x006f, 0x026f, 0x018b, 0x016f, 0x036f, 0x00ef, 0x02ef, 0x01ef, 0x03ef, 0x001f, + 0x021f, 0x011f, 0x031f, 0x009f, 0x029f, 0x019f, 0x039f, 0x005f, 0x004b, 0x025f, 0x015f, 0x035f, + 0x00df, 0x02df, 0x01df, 0x03df, 0x003f, 0x023f, 0x013f, 0x033f, 0x00bf, 0x02bf, 0x014b, 0x01bf, + 0x00ad, 0x00cb, 0x01cb, 0x03bf, 0x002b, 0x007f, 0x027f, 0x017f, 0x012b, 0x037f, 0x00ff, 0x02ff, + 0x00ab, 0x01ab, 0x006d, 0x0059, 0x17ff, 0x0fff, 0x0039, 0x0079, 0x01ff, 0x0005, 0x0045, 0x0034, + 0x000c, 0x002c, 0x001c, 0x0000, 0x003c, 0x0002, 0x0022, 0x0010, 0x0012, 0x0008, 0x0032, 0x000a, + 0x002a, 0x001a, 0x003a, 0x0006, 0x0026, 0x0016, 0x0036, 0x000e, 0x002e, 0x001e, 0x003e, 0x0001, + 0x00ed, 0x0018, 0x0021, 0x0025, 0x0065 }; UINT16 HashTable[512] = { [0 ... 511] = 0xffff }; -static UINT16 tab[8] = {511, 0, 508, 448, 494, 347, 486, 482}; +static UINT16 tab[8] = { 511, 0, 508, 448, 494, 347, 486, 482 }; UINT16 hash(UINT16 key) { UINT16 h; - h = (key & 0x1ff) ^ (key >> 9) ^ (key >> 4) ^ (key >> 7); + h = (key & 0x1ff) ^ (key >> 9) ^ (key >> 4) ^ (key >> 7); return h; } @@ -89,14 +92,14 @@ main() for (i = 0; i < 512; i++) { if (i == 511) - printf("0x%04"PRIx16" };\n", HashTable[i]); + printf("0x%04" PRIx16 " };\n", HashTable[i]); else - printf("0x%04"PRIx16", ", HashTable[i]); + printf("0x%04" PRIx16 ", ", HashTable[i]); } for (i = 0; i < 293; i++) if (i != getvalue(HuffCodeLEC[i])) - printf("Fail :( at %d : 0x%04"PRIx16"\n", i, HuffCodeLEC[i]); + printf("Fail :( at %d : 0x%04" PRIx16 "\n", i, HuffCodeLEC[i]); return 0; } diff --git a/scripts/LOMHash.c b/scripts/LOMHash.c index 9a7bf8ecb..616117d68 100644 --- a/scripts/LOMHash.c +++ b/scripts/LOMHash.c @@ -1,12 +1,10 @@ -#include +#include typedef unsigned short UINT16; typedef unsigned char BYTE; -static UINT16 HuffCodeLOM[] = -{ - 0x0001, 0x0000, 0x0002, 0x0009, 0x0006, 0x0005, 0x000d, 0x000b, 0x0003, 0x001b, 0x0007, 0x0017, 0x0037, - 0x000f, 0x004f, 0x006f, 0x002f, 0x00ef, 0x001f, 0x005f, 0x015f, 0x009f, 0x00df, 0x01df, 0x003f, 0x013f, 0x00bf, - 0x01bf, 0x007f, 0x017f, 0x00ff, 0x01ff -}; +static UINT16 HuffCodeLOM[] = { 0x0001, 0x0000, 0x0002, 0x0009, 0x0006, 0x0005, 0x000d, 0x000b, + 0x0003, 0x001b, 0x0007, 0x0017, 0x0037, 0x000f, 0x004f, 0x006f, + 0x002f, 0x00ef, 0x001f, 0x005f, 0x015f, 0x009f, 0x00df, 0x01df, + 0x003f, 0x013f, 0x00bf, 0x01bf, 0x007f, 0x017f, 0x00ff, 0x01ff }; UINT16 HashTable[32] = { [0 ... 31] = 0xffff }; @@ -14,7 +12,7 @@ BYTE tab[4] = { 0, 4, 10, 19 }; UINT16 hash(UINT16 key) { - return ((key & 0x1f) ^ (key >> 5) ^ (key >> 9)); + return ((key & 0x1f) ^ (key >> 5) ^ (key >> 9)); } BYTE minihash(UINT16 key) @@ -44,7 +42,7 @@ void buildhashtable(void) HashTable[h] ^= 0xfe0; } - printf("at %d %"PRIu16"=0x%"PRIx16"\n", i, h, HashTable[h]); + printf("at %d %" PRIu16 "=0x%" PRIx16 "\n", i, h, HashTable[h]); } } @@ -69,14 +67,14 @@ main() for (i = 0; i < 32; i++) { if (i == 31) - printf("0x%"PRIx16" };\n", HashTable[i]); + printf("0x%" PRIx16 " };\n", HashTable[i]); else - printf("0x%"PRIx16", ", HashTable[i]); + printf("0x%" PRIx16 ", ", HashTable[i]); } for (i = 0; i < 32; i++) if (i != getvalue(HuffCodeLOM[i])) - printf("Fail :( at %d : 0x%04"PRIx16" got %"PRIu8"\n", i, HuffCodeLOM[i], + printf("Fail :( at %d : 0x%04" PRIx16 " got %" PRIu8 "\n", i, HuffCodeLOM[i], getvalue(HuffCodeLOM[i])); return 0; diff --git a/server/Mac/mf_audin.c b/server/Mac/mf_audin.c index 3584a571b..36e10392b 100644 --- a/server/Mac/mf_audin.c +++ b/server/Mac/mf_audin.c @@ -58,7 +58,7 @@ static UINT mf_peer_audin_open_result(audin_server_context* context, UINT32 resu * @return 0 on success, otherwise a Win32 error code */ static UINT mf_peer_audin_receive_samples(audin_server_context* context, const void* buf, - int nframes) + int nframes) { return CHANNEL_RC_OK; } diff --git a/server/Mac/mf_audin.h b/server/Mac/mf_audin.h index e50e119b8..d0c2011c1 100644 --- a/server/Mac/mf_audin.h +++ b/server/Mac/mf_audin.h @@ -27,8 +27,6 @@ #include "mf_interface.h" #include "mfreerdp.h" - void mf_peer_audin_init(mfPeerContext* context); #endif /* FREERDP_SERVER_MAC_AUDIN_H */ - diff --git a/server/Mac/mf_event.c b/server/Mac/mf_event.c index 525981950..9341ad72b 100644 --- a/server/Mac/mf_event.c +++ b/server/Mac/mf_event.c @@ -37,117 +37,118 @@ int mf_is_event_set(mfEventQueue* event_queue) fd_set rfds; int num_set; struct timeval time; - + FD_ZERO(&rfds); FD_SET(event_queue->pipe_fd[0], &rfds); memset(&time, 0, sizeof(time)); num_set = select(event_queue->pipe_fd[0] + 1, &rfds, 0, 0, &time); - + return (num_set == 1); } void mf_signal_event(mfEventQueue* event_queue) { int length; - + length = write(event_queue->pipe_fd[1], "sig", 4); - + if (length != 4) - WLog_ERR(TAG, "mf_signal_event: error"); + WLog_ERR(TAG, "mf_signal_event: error"); } void mf_set_event(mfEventQueue* event_queue) { int length; - + length = write(event_queue->pipe_fd[1], "sig", 4); - + if (length != 4) - WLog_ERR(TAG, "mf_set_event: error"); + WLog_ERR(TAG, "mf_set_event: error"); } void mf_clear_events(mfEventQueue* event_queue) { int length; - + while (mf_is_event_set(event_queue)) { length = read(event_queue->pipe_fd[0], &length, 4); - + if (length != 4) - WLog_ERR(TAG, "mf_clear_event: error"); + WLog_ERR(TAG, "mf_clear_event: error"); } } void mf_clear_event(mfEventQueue* event_queue) { int length; - + length = read(event_queue->pipe_fd[0], &length, 4); - + if (length != 4) - WLog_ERR(TAG, "mf_clear_event: error"); + WLog_ERR(TAG, "mf_clear_event: error"); } void mf_event_push(mfEventQueue* event_queue, mfEvent* event) { pthread_mutex_lock(&(event_queue->mutex)); - + if (event_queue->count >= event_queue->size) { event_queue->size *= 2; - event_queue->events = (mfEvent**) realloc((void*) event_queue->events, sizeof(mfEvent*) * event_queue->size); + event_queue->events = + (mfEvent**)realloc((void*)event_queue->events, sizeof(mfEvent*) * event_queue->size); } - + event_queue->events[(event_queue->count)++] = event; - + pthread_mutex_unlock(&(event_queue->mutex)); - + mf_set_event(event_queue); } mfEvent* mf_event_peek(mfEventQueue* event_queue) { mfEvent* event; - + pthread_mutex_lock(&(event_queue->mutex)); - + if (event_queue->count < 1) event = NULL; else event = event_queue->events[0]; - + pthread_mutex_unlock(&(event_queue->mutex)); - + return event; } mfEvent* mf_event_pop(mfEventQueue* event_queue) { mfEvent* event; - + pthread_mutex_lock(&(event_queue->mutex)); - + if (event_queue->count < 1) return NULL; - + /* remove event signal */ mf_clear_event(event_queue); - + event = event_queue->events[0]; (event_queue->count)--; - + memmove(&event_queue->events[0], &event_queue->events[1], event_queue->count * sizeof(void*)); - + pthread_mutex_unlock(&(event_queue->mutex)); - + return event; } mfEventRegion* mf_event_region_new(int x, int y, int width, int height) { mfEventRegion* event_region = malloc(sizeof(mfEventRegion)); - + if (event_region != NULL) { event_region->x = x; @@ -155,7 +156,7 @@ mfEventRegion* mf_event_region_new(int x, int y, int width, int height) event_region->width = width; event_region->height = height; } - + return event_region; } @@ -181,25 +182,25 @@ void mf_event_free(mfEvent* event) mfEventQueue* mf_event_queue_new() { mfEventQueue* event_queue = malloc(sizeof(mfEventQueue)); - + if (event_queue != NULL) { event_queue->pipe_fd[0] = -1; event_queue->pipe_fd[1] = -1; - + event_queue->size = 16; event_queue->count = 0; - event_queue->events = (mfEvent**) malloc(sizeof(mfEvent*) * event_queue->size); - + event_queue->events = (mfEvent**)malloc(sizeof(mfEvent*) * event_queue->size); + if (pipe(event_queue->pipe_fd) < 0) { free(event_queue); return NULL; } - + pthread_mutex_init(&(event_queue->mutex), NULL); } - + return event_queue; } @@ -210,12 +211,12 @@ void mf_event_queue_free(mfEventQueue* event_queue) close(event_queue->pipe_fd[0]); event_queue->pipe_fd[0] = -1; } - + if (event_queue->pipe_fd[1] != -1) { close(event_queue->pipe_fd[1]); event_queue->pipe_fd[1] = -1; } - + pthread_mutex_destroy(&(event_queue->mutex)); } diff --git a/server/Mac/mf_event.h b/server/Mac/mf_event.h index 883ba4132..197cfd791 100644 --- a/server/Mac/mf_event.h +++ b/server/Mac/mf_event.h @@ -52,7 +52,7 @@ struct mf_event_queue struct mf_event_region { int type; - + int x; int y; int width; diff --git a/server/Mac/mf_info.c b/server/Mac/mf_info.c index da7b44d06..67abf19dc 100644 --- a/server/Mac/mf_info.c +++ b/server/Mac/mf_info.c @@ -17,7 +17,6 @@ * limitations under the License. */ - #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -29,89 +28,89 @@ #include "mf_mountain_lion.h" #define MF_INFO_DEFAULT_FPS 30 -#define MF_INFO_MAXPEERS 32 +#define MF_INFO_MAXPEERS 32 static mfInfo* mfInfoInstance = NULL; int mf_info_lock(mfInfo* mfi) { int status = pthread_mutex_lock(&mfi->mutex); - + switch (status) { case 0: return TRUE; break; - + default: return -1; break; } - + return 1; } int mf_info_try_lock(mfInfo* mfi, UINT32 ms) { int status = pthread_mutex_trylock(&mfi->mutex); - + switch (status) { case 0: return TRUE; break; - + case EBUSY: return FALSE; break; - + default: return -1; break; } - + return 1; } int mf_info_unlock(mfInfo* mfi) { int status = pthread_mutex_unlock(&mfi->mutex); - + switch (status) { case 0: return TRUE; break; - + default: return -1; break; } - + return 1; } mfInfo* mf_info_init() { mfInfo* mfi; - - mfi = (mfInfo*) calloc(1, sizeof(mfInfo)); - + + mfi = (mfInfo*)calloc(1, sizeof(mfInfo)); + if (mfi != NULL) { pthread_mutex_init(&mfi->mutex, NULL); - - mfi->peers = (freerdp_peer**) calloc(MF_INFO_MAXPEERS, sizeof(freerdp_peer*)); + + mfi->peers = (freerdp_peer**)calloc(MF_INFO_MAXPEERS, sizeof(freerdp_peer*)); if (!mfi->peers) { free(mfi); return NULL; } - + mfi->framesPerSecond = MF_INFO_DEFAULT_FPS; mfi->input_disabled = FALSE; } - + return mfi; } @@ -119,7 +118,7 @@ mfInfo* mf_info_get_instance() { if (mfInfoInstance == NULL) mfInfoInstance = mf_info_init(); - + return mfInfoInstance; } @@ -129,38 +128,38 @@ void mf_info_peer_register(mfInfo* mfi, mfPeerContext* context) { int i; int peerId; - + if (mfi->peerCount == MF_INFO_MAXPEERS) { mf_info_unlock(mfi); return; } - + context->info = mfi; - + if (mfi->peerCount == 0) { mf_mlion_display_info(&mfi->servscreen_width, &mfi->servscreen_height, &mfi->scale); mf_mlion_screen_updates_init(); mf_mlion_start_getting_screen_updates(); } - + peerId = 0; - for(i=0; ipeers[i] == NULL) { peerId = i; break; } } - - mfi->peers[peerId] = ((rdpContext*) context)->peer; + + mfi->peers[peerId] = ((rdpContext*)context)->peer; mfi->peers[peerId]->pId = peerId; mfi->peerCount++; - + mf_info_unlock(mfi); } } @@ -170,11 +169,11 @@ void mf_info_peer_unregister(mfInfo* mfi, mfPeerContext* context) if (mf_info_lock(mfi) > 0) { int peerId; - - peerId = ((rdpContext*) context)->peer->pId; + + peerId = ((rdpContext*)context)->peer->pId; mfi->peers[peerId] = NULL; mfi->peerCount--; - + if (mfi->peerCount == 0) mf_mlion_stop_getting_screen_updates(); @@ -184,15 +183,14 @@ void mf_info_peer_unregister(mfInfo* mfi, mfPeerContext* context) BOOL mf_info_have_updates(mfInfo* mfi) { - if(mfi->framesWaiting == 0) + if (mfi->framesWaiting == 0) return FALSE; - + return TRUE; } void mf_info_update_changes(mfInfo* mfi) { - } void mf_info_find_invalid_region(mfInfo* mfi) @@ -228,9 +226,9 @@ void mf_info_getScreenData(mfInfo* mfi, long* width, long* height, BYTE** pBits, *width = mfi->invalid.width / mfi->scale; *height = mfi->invalid.height / mfi->scale; *pitch = mfi->servscreen_width * mfi->scale * 4; - - mf_mlion_get_pixelData(mfi->invalid.x / mfi->scale, mfi->invalid.y / mfi->scale, *width, *height, pBits); - + + mf_mlion_get_pixelData(mfi->invalid.x / mfi->scale, mfi->invalid.y / mfi->scale, *width, + *height, pBits); + *pBits = *pBits + (mfi->invalid.x * 4) + (*pitch * mfi->invalid.y); - } diff --git a/server/Mac/mf_info.h b/server/Mac/mf_info.h index 9c092a0cb..8f089824e 100644 --- a/server/Mac/mf_info.h +++ b/server/Mac/mf_info.h @@ -23,8 +23,6 @@ #define FREERDP_SERVER_MAC_INFO_DEFAULT_FPS 1 #define FREERDP_SERVER_MAC_INFO_MAXPEERS 1 - - #include #include @@ -45,6 +43,7 @@ void mf_info_clear_invalid_region(mfInfo* mfi); void mf_info_invalidate_full_screen(mfInfo* mfi); BOOL mf_info_have_invalid_region(mfInfo* mfi); void mf_info_getScreenData(mfInfo* mfi, long* width, long* height, BYTE** pBits, int* pitch); -//BOOL CALLBACK mf_info_monEnumCB(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData); +// BOOL CALLBACK mf_info_monEnumCB(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM +// dwData); #endif /* FREERDP_SERVER_MAC_INFO_H */ diff --git a/server/Mac/mf_input.c b/server/Mac/mf_input.c index bd1c2a09d..66922a0b7 100644 --- a/server/Mac/mf_input.c +++ b/server/Mac/mf_input.c @@ -32,263 +32,262 @@ #include #define TAG SERVER_TAG("mac") -static const CGKeyCode keymap[256] = -{ - 0xFF, //0x0 - kVK_Escape, //0x1 - kVK_ANSI_1, //0x2 - kVK_ANSI_2, //0x3 - kVK_ANSI_3, //0x4 - kVK_ANSI_4, //0x5 - kVK_ANSI_5, //0x6 - kVK_ANSI_6, //0x7 - kVK_ANSI_7, //0x8 - kVK_ANSI_8, //0x9 - kVK_ANSI_9, //0xa - kVK_ANSI_0, //0xb - kVK_ANSI_Minus, //0xc - kVK_ANSI_Equal, //0xd - kVK_Delete, //0xe - kVK_Tab, //0xf - kVK_ANSI_Q, //0x10 - kVK_ANSI_W, //0x11 - kVK_ANSI_E, //0x12 - kVK_ANSI_R, //0x13 - kVK_ANSI_T, //0x14 - kVK_ANSI_Y, //0x15 - kVK_ANSI_U, //0x16 - kVK_ANSI_I, //0x17 - kVK_ANSI_O, //0x18 - kVK_ANSI_P, //0x19 - kVK_ANSI_LeftBracket, //0x1a - kVK_ANSI_RightBracket, //0x1b - kVK_Return, //0x1c - kVK_Control, //0x1d - kVK_ANSI_A, //0x1e - kVK_ANSI_S, //0x1f - kVK_ANSI_D, //0x20 - kVK_ANSI_F, //0x21 - kVK_ANSI_G, //0x22 - kVK_ANSI_H, //0x23 - kVK_ANSI_J, //0x24 - kVK_ANSI_K, //0x25 - kVK_ANSI_L, //0x26 - kVK_ANSI_Semicolon, //0x27 - kVK_ANSI_Quote, //0x28 - kVK_ANSI_Grave, //0x29 - kVK_Shift, //0x2a - kVK_ANSI_Backslash, //0x2b - kVK_ANSI_Z, //0x2c - kVK_ANSI_X, //0x2d - kVK_ANSI_C, //0x2e - kVK_ANSI_V, //0x2f - kVK_ANSI_B, //0x30 - kVK_ANSI_N, //0x31 - kVK_ANSI_M, //0x32 - kVK_ANSI_Comma, //0x33 - kVK_ANSI_Period, //0x34 - kVK_ANSI_Slash, //0x35 - kVK_Shift, //0x36 - kVK_ANSI_KeypadMultiply, //0x37 - kVK_Option, //0x38 - kVK_Space, //0x39 - kVK_CapsLock, //0x3a - kVK_F1, //0x3b - kVK_F2, //0x3c - kVK_F3, //0x3d - kVK_F4, //0x3e - kVK_F5, //0x3f - kVK_F6, //0x40 - kVK_F7, //0x41 - kVK_F8, //0x42 - kVK_F9, //0x43 - kVK_F10, //0x44 - 0xFF, //0x45 -- numlock - 0xFF, //0x46 -- scroll lock - kVK_ANSI_Keypad7, //0x47 - kVK_ANSI_Keypad8, //0x48 - kVK_ANSI_Keypad9, //0x49 - kVK_ANSI_KeypadMinus, //0x4a - kVK_ANSI_Keypad4, //0x4b - kVK_ANSI_Keypad5, //0x4c - kVK_ANSI_Keypad6, //0x4d - kVK_ANSI_KeypadPlus, //0x4e - kVK_ANSI_Keypad1, //0x4f - kVK_ANSI_Keypad2, //0x50 - kVK_ANSI_Keypad3, //0x51 - kVK_ANSI_Keypad0, //0x52 - kVK_ANSI_KeypadDecimal, //0x53 - 0xFF, //0x54 - 0xFF, //0x55 - 0xFF, //0x56 - kVK_F11, //0x57 - kVK_F12, //0x58 - 0xFF, //0x59 -- pause - 0xFF, //0x5a - kVK_Control, //0x5b - kVK_Control, //0x5c - 0xFF, //0x5d -- application - 0xFF, //0x5e -- power - 0xFF, //0x5f -- sleep - 0xFF, //0x60 - 0xFF, //0x61 - 0xFF, //0x62 - 0xFF, //0x63 -- wake - 0xFF, //0x64 - 0xFF, //0x65 - 0xFF, //0x66 - 0xFF, //0x67 - 0xFF, //0x68 - 0xFF, //0x69 - 0xFF, //0x6a - 0xFF, //0x6b - 0xFF, //0x6c - 0xFF, //0x6d - 0xFF, //0x6e - 0xFF, //0x6f - 0xFF, //0x70 - 0xFF, //0x71 - 0xFF, //0x72 - 0xFF, //0x73 - 0xFF, //0x74 - 0xFF, //0x75 - 0xFF, //0x76 - 0xFF, //0x77 - 0xFF, //0x78 - 0xFF, //0x79 - 0xFF, //0x7a - 0xFF, //0x7b - 0xFF, //0x7c - 0xFF, //0x7d - 0xFF, //0x7e - 0xFF, //0x7f - 0xFF, //0x80 - 0xFF, //0x81 - 0xFF, //0x82 - 0xFF, //0x83 - 0xFF, //0x84 - 0xFF, //0x85 - 0xFF, //0x86 - 0xFF, //0x87 - 0xFF, //0x88 - 0xFF, //0x89 - 0xFF, //0x8a - 0xFF, //0x8b - 0xFF, //0x8c - 0xFF, //0x8d - 0xFF, //0x8e - 0xFF, //0x8f - 0xFF, //0x90 - 0xFF, //0x91 - 0xFF, //0x92 - 0xFF, //0x93 - 0xFF, //0x94 - 0xFF, //0x95 - 0xFF, //0x96 - 0xFF, //0x97 - 0xFF, //0x98 - 0xFF, //0x99 - 0xFF, //0x9a - 0xFF, //0x9b - 0xFF, //0x9c - 0xFF, //0x9d - 0xFF, //0x9e - 0xFF, //0x9f - 0xFF, //0xa0 - 0xFF, //0xa1 - 0xFF, //0xa2 - 0xFF, //0xa3 - 0xFF, //0xa4 - 0xFF, //0xa5 - 0xFF, //0xa6 - 0xFF, //0xa7 - 0xFF, //0xa8 - 0xFF, //0xa9 - 0xFF, //0xaa - 0xFF, //0xab - 0xFF, //0xac - 0xFF, //0xad - 0xFF, //0xae - 0xFF, //0xaf - 0xFF, //0xb0 - 0xFF, //0xb1 - 0xFF, //0xb2 - 0xFF, //0xb3 - 0xFF, //0xb4 - 0xFF, //0xb5 - 0xFF, //0xb6 - 0xFF, //0xb7 - 0xFF, //0xb8 - 0xFF, //0xb9 - 0xFF, //0xba - 0xFF, //0xbb - 0xFF, //0xbc - 0xFF, //0xbd - 0xFF, //0xbe - 0xFF, //0xbf - 0xFF, //0xc0 - 0xFF, //0xc1 - 0xFF, //0xc2 - 0xFF, //0xc3 - 0xFF, //0xc4 - 0xFF, //0xc5 - 0xFF, //0xc6 - 0xFF, //0xc7 - 0xFF, //0xc8 - 0xFF, //0xc9 - 0xFF, //0xca - 0xFF, //0xcb - 0xFF, //0xcc - 0xFF, //0xcd - 0xFF, //0xce - 0xFF, //0xcf - 0xFF, //0xd0 - 0xFF, //0xd1 - 0xFF, //0xd2 - 0xFF, //0xd3 - 0xFF, //0xd4 - 0xFF, //0xd5 - 0xFF, //0xd6 - 0xFF, //0xd7 - 0xFF, //0xd8 - 0xFF, //0xd9 - 0xFF, //0xda - 0xFF, //0xdb - 0xFF, //0xdc - 0xFF, //0xdd - 0xFF, //0xde - 0xFF, //0xdf - 0xFF, //0xe0 - 0xFF, //0xe1 - 0xFF, //0xe2 - 0xFF, //0xe3 - 0xFF, //0xe4 - 0xFF, //0xe5 - 0xFF, //0xe6 - 0xFF, //0xe7 - 0xFF, //0xe8 - 0xFF, //0xe9 - 0xFF, //0xea - 0xFF, //0xeb - 0xFF, //0xec - 0xFF, //0xed - 0xFF, //0xee - 0xFF, //0xef - 0xFF, //0xf0 - 0xFF, //0xf1 - 0xFF, //0xf2 - 0xFF, //0xf3 - 0xFF, //0xf4 - 0xFF, //0xf5 - 0xFF, //0xf6 - 0xFF, //0xf7 - 0xFF, //0xf8 - 0xFF, //0xf9 - 0xFF, //0xfa - 0xFF, //0xfb - 0xFF, //0xfc - 0xFF, //0xfd - 0xFF, //0xfe +static const CGKeyCode keymap[256] = { + 0xFF, // 0x0 + kVK_Escape, // 0x1 + kVK_ANSI_1, // 0x2 + kVK_ANSI_2, // 0x3 + kVK_ANSI_3, // 0x4 + kVK_ANSI_4, // 0x5 + kVK_ANSI_5, // 0x6 + kVK_ANSI_6, // 0x7 + kVK_ANSI_7, // 0x8 + kVK_ANSI_8, // 0x9 + kVK_ANSI_9, // 0xa + kVK_ANSI_0, // 0xb + kVK_ANSI_Minus, // 0xc + kVK_ANSI_Equal, // 0xd + kVK_Delete, // 0xe + kVK_Tab, // 0xf + kVK_ANSI_Q, // 0x10 + kVK_ANSI_W, // 0x11 + kVK_ANSI_E, // 0x12 + kVK_ANSI_R, // 0x13 + kVK_ANSI_T, // 0x14 + kVK_ANSI_Y, // 0x15 + kVK_ANSI_U, // 0x16 + kVK_ANSI_I, // 0x17 + kVK_ANSI_O, // 0x18 + kVK_ANSI_P, // 0x19 + kVK_ANSI_LeftBracket, // 0x1a + kVK_ANSI_RightBracket, // 0x1b + kVK_Return, // 0x1c + kVK_Control, // 0x1d + kVK_ANSI_A, // 0x1e + kVK_ANSI_S, // 0x1f + kVK_ANSI_D, // 0x20 + kVK_ANSI_F, // 0x21 + kVK_ANSI_G, // 0x22 + kVK_ANSI_H, // 0x23 + kVK_ANSI_J, // 0x24 + kVK_ANSI_K, // 0x25 + kVK_ANSI_L, // 0x26 + kVK_ANSI_Semicolon, // 0x27 + kVK_ANSI_Quote, // 0x28 + kVK_ANSI_Grave, // 0x29 + kVK_Shift, // 0x2a + kVK_ANSI_Backslash, // 0x2b + kVK_ANSI_Z, // 0x2c + kVK_ANSI_X, // 0x2d + kVK_ANSI_C, // 0x2e + kVK_ANSI_V, // 0x2f + kVK_ANSI_B, // 0x30 + kVK_ANSI_N, // 0x31 + kVK_ANSI_M, // 0x32 + kVK_ANSI_Comma, // 0x33 + kVK_ANSI_Period, // 0x34 + kVK_ANSI_Slash, // 0x35 + kVK_Shift, // 0x36 + kVK_ANSI_KeypadMultiply, // 0x37 + kVK_Option, // 0x38 + kVK_Space, // 0x39 + kVK_CapsLock, // 0x3a + kVK_F1, // 0x3b + kVK_F2, // 0x3c + kVK_F3, // 0x3d + kVK_F4, // 0x3e + kVK_F5, // 0x3f + kVK_F6, // 0x40 + kVK_F7, // 0x41 + kVK_F8, // 0x42 + kVK_F9, // 0x43 + kVK_F10, // 0x44 + 0xFF, // 0x45 -- numlock + 0xFF, // 0x46 -- scroll lock + kVK_ANSI_Keypad7, // 0x47 + kVK_ANSI_Keypad8, // 0x48 + kVK_ANSI_Keypad9, // 0x49 + kVK_ANSI_KeypadMinus, // 0x4a + kVK_ANSI_Keypad4, // 0x4b + kVK_ANSI_Keypad5, // 0x4c + kVK_ANSI_Keypad6, // 0x4d + kVK_ANSI_KeypadPlus, // 0x4e + kVK_ANSI_Keypad1, // 0x4f + kVK_ANSI_Keypad2, // 0x50 + kVK_ANSI_Keypad3, // 0x51 + kVK_ANSI_Keypad0, // 0x52 + kVK_ANSI_KeypadDecimal, // 0x53 + 0xFF, // 0x54 + 0xFF, // 0x55 + 0xFF, // 0x56 + kVK_F11, // 0x57 + kVK_F12, // 0x58 + 0xFF, // 0x59 -- pause + 0xFF, // 0x5a + kVK_Control, // 0x5b + kVK_Control, // 0x5c + 0xFF, // 0x5d -- application + 0xFF, // 0x5e -- power + 0xFF, // 0x5f -- sleep + 0xFF, // 0x60 + 0xFF, // 0x61 + 0xFF, // 0x62 + 0xFF, // 0x63 -- wake + 0xFF, // 0x64 + 0xFF, // 0x65 + 0xFF, // 0x66 + 0xFF, // 0x67 + 0xFF, // 0x68 + 0xFF, // 0x69 + 0xFF, // 0x6a + 0xFF, // 0x6b + 0xFF, // 0x6c + 0xFF, // 0x6d + 0xFF, // 0x6e + 0xFF, // 0x6f + 0xFF, // 0x70 + 0xFF, // 0x71 + 0xFF, // 0x72 + 0xFF, // 0x73 + 0xFF, // 0x74 + 0xFF, // 0x75 + 0xFF, // 0x76 + 0xFF, // 0x77 + 0xFF, // 0x78 + 0xFF, // 0x79 + 0xFF, // 0x7a + 0xFF, // 0x7b + 0xFF, // 0x7c + 0xFF, // 0x7d + 0xFF, // 0x7e + 0xFF, // 0x7f + 0xFF, // 0x80 + 0xFF, // 0x81 + 0xFF, // 0x82 + 0xFF, // 0x83 + 0xFF, // 0x84 + 0xFF, // 0x85 + 0xFF, // 0x86 + 0xFF, // 0x87 + 0xFF, // 0x88 + 0xFF, // 0x89 + 0xFF, // 0x8a + 0xFF, // 0x8b + 0xFF, // 0x8c + 0xFF, // 0x8d + 0xFF, // 0x8e + 0xFF, // 0x8f + 0xFF, // 0x90 + 0xFF, // 0x91 + 0xFF, // 0x92 + 0xFF, // 0x93 + 0xFF, // 0x94 + 0xFF, // 0x95 + 0xFF, // 0x96 + 0xFF, // 0x97 + 0xFF, // 0x98 + 0xFF, // 0x99 + 0xFF, // 0x9a + 0xFF, // 0x9b + 0xFF, // 0x9c + 0xFF, // 0x9d + 0xFF, // 0x9e + 0xFF, // 0x9f + 0xFF, // 0xa0 + 0xFF, // 0xa1 + 0xFF, // 0xa2 + 0xFF, // 0xa3 + 0xFF, // 0xa4 + 0xFF, // 0xa5 + 0xFF, // 0xa6 + 0xFF, // 0xa7 + 0xFF, // 0xa8 + 0xFF, // 0xa9 + 0xFF, // 0xaa + 0xFF, // 0xab + 0xFF, // 0xac + 0xFF, // 0xad + 0xFF, // 0xae + 0xFF, // 0xaf + 0xFF, // 0xb0 + 0xFF, // 0xb1 + 0xFF, // 0xb2 + 0xFF, // 0xb3 + 0xFF, // 0xb4 + 0xFF, // 0xb5 + 0xFF, // 0xb6 + 0xFF, // 0xb7 + 0xFF, // 0xb8 + 0xFF, // 0xb9 + 0xFF, // 0xba + 0xFF, // 0xbb + 0xFF, // 0xbc + 0xFF, // 0xbd + 0xFF, // 0xbe + 0xFF, // 0xbf + 0xFF, // 0xc0 + 0xFF, // 0xc1 + 0xFF, // 0xc2 + 0xFF, // 0xc3 + 0xFF, // 0xc4 + 0xFF, // 0xc5 + 0xFF, // 0xc6 + 0xFF, // 0xc7 + 0xFF, // 0xc8 + 0xFF, // 0xc9 + 0xFF, // 0xca + 0xFF, // 0xcb + 0xFF, // 0xcc + 0xFF, // 0xcd + 0xFF, // 0xce + 0xFF, // 0xcf + 0xFF, // 0xd0 + 0xFF, // 0xd1 + 0xFF, // 0xd2 + 0xFF, // 0xd3 + 0xFF, // 0xd4 + 0xFF, // 0xd5 + 0xFF, // 0xd6 + 0xFF, // 0xd7 + 0xFF, // 0xd8 + 0xFF, // 0xd9 + 0xFF, // 0xda + 0xFF, // 0xdb + 0xFF, // 0xdc + 0xFF, // 0xdd + 0xFF, // 0xde + 0xFF, // 0xdf + 0xFF, // 0xe0 + 0xFF, // 0xe1 + 0xFF, // 0xe2 + 0xFF, // 0xe3 + 0xFF, // 0xe4 + 0xFF, // 0xe5 + 0xFF, // 0xe6 + 0xFF, // 0xe7 + 0xFF, // 0xe8 + 0xFF, // 0xe9 + 0xFF, // 0xea + 0xFF, // 0xeb + 0xFF, // 0xec + 0xFF, // 0xed + 0xFF, // 0xee + 0xFF, // 0xef + 0xFF, // 0xf0 + 0xFF, // 0xf1 + 0xFF, // 0xf2 + 0xFF, // 0xf3 + 0xFF, // 0xf4 + 0xFF, // 0xf5 + 0xFF, // 0xf6 + 0xFF, // 0xf7 + 0xFF, // 0xf8 + 0xFF, // 0xf9 + 0xFF, // 0xfa + 0xFF, // 0xfb + 0xFF, // 0xfc + 0xFF, // 0xfd + 0xFF, // 0xfe }; BOOL mf_input_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) @@ -307,7 +306,7 @@ BOOL mf_input_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) { switch (code) { - //case 0x52: //insert + // case 0x52: //insert case 0x53: kCode = kVK_ForwardDelete; break; @@ -387,11 +386,8 @@ BOOL mf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) scroll_x = scroll; CGEventSourceRef source = CGEventSourceCreate(kCGEventSourceStateHIDSystemState); - CGEventRef scrollEvent = CGEventCreateScrollWheelEvent(source, - kCGScrollEventUnitLine, - wheelCount, - scroll_y, - scroll_x); + CGEventRef scrollEvent = CGEventCreateScrollWheelEvent(source, kCGScrollEventUnitLine, + wheelCount, scroll_y, scroll_x); CGEventPost(kCGHIDEventTap, scrollEvent); CFRelease(scrollEvent); CFRelease(source); @@ -403,9 +399,9 @@ BOOL mf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) CGEventType mouseType = kCGEventNull; CGMouseButton mouseButton = kCGMouseButtonLeft; mfi = mf_info_get_instance(); - //width and height of primary screen (even in multimon setups - width = (float) mfi->servscreen_width; - height = (float) mfi->servscreen_height; + // width and height of primary screen (even in multimon setups + width = (float)mfi->servscreen_width; + height = (float)mfi->servscreen_height; x += mfi->servscreen_xoffset; y += mfi->servscreen_yoffset; @@ -428,11 +424,9 @@ BOOL mf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) mouseType = kCGEventMouseMoved; } - CGEventRef move = CGEventCreateMouseEvent(source, - mouseType, - CGPointMake(x, y), - mouseButton // ignored for just movement - ); + CGEventRef move = CGEventCreateMouseEvent(source, mouseType, CGPointMake(x, y), + mouseButton // ignored for just movement + ); CGEventPost(kCGHIDEventTap, move); CFRelease(move); } @@ -483,11 +477,8 @@ BOOL mf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) } } - CGEventRef mouseEvent = CGEventCreateMouseEvent(source, - mouseType, - CGPointMake(x, y), - mouseButton - ); + CGEventRef mouseEvent = + CGEventCreateMouseEvent(source, mouseType, CGPointMake(x, y), mouseButton); CGEventPost(kCGHIDEventTap, mouseEvent); CFRelease(mouseEvent); CFRelease(source); @@ -501,7 +492,6 @@ BOOL mf_input_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT return FALSE; } - BOOL mf_input_keyboard_event_dummy(rdpInput* input, UINT16 flags, UINT16 code) { return FALSE; diff --git a/server/Mac/mf_input.h b/server/Mac/mf_input.h index 336ac24f1..48330e3ce 100644 --- a/server/Mac/mf_input.h +++ b/server/Mac/mf_input.h @@ -27,7 +27,7 @@ BOOL mf_input_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) BOOL mf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y); BOOL mf_input_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y); -//dummy versions +// dummy versions BOOL mf_input_keyboard_event_dummy(rdpInput* input, UINT16 flags, UINT16 code); BOOL mf_input_unicode_keyboard_event_dummy(rdpInput* input, UINT16 flags, UINT16 code); BOOL mf_input_mouse_event_dummy(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y); diff --git a/server/Mac/mf_interface.h b/server/Mac/mf_interface.h index 9019d684e..26bd7c85e 100644 --- a/server/Mac/mf_interface.h +++ b/server/Mac/mf_interface.h @@ -49,7 +49,7 @@ typedef struct mf_peer_context mfPeerContext; struct mf_peer_context { rdpContext _p; - + mfInfo* info; wStream* s; BOOL activated; @@ -57,25 +57,24 @@ struct mf_peer_context BOOL audin_open; RFX_CONTEXT* rfx_context; NSC_CONTEXT* nsc_context; - + //#ifdef WITH_SERVER_CHANNELS HANDLE vcm; //#endif //#ifdef CHANNEL_AUDIN_SERVER audin_server_context* audin; //#endif - + //#ifdef CHANNEL_RDPSND_SERVER RdpsndServerContext* rdpsnd; //#endif }; - struct mf_info { - //STREAM* s; - - //screen and monitor info + // STREAM* s; + + // screen and monitor info UINT32 screenID; UINT32 virtscreen_width; UINT32 virtscreen_height; @@ -83,7 +82,7 @@ struct mf_info UINT32 servscreen_height; UINT32 servscreen_xoffset; UINT32 servscreen_yoffset; - + int bitsPerPixel; int peerCount; int activePeerCount; @@ -91,10 +90,10 @@ struct mf_info freerdp_peer** peers; unsigned int framesWaiting; UINT32 scale; - + RFX_RECT invalid; pthread_mutex_t mutex; - + BOOL mouse_down_left; BOOL mouse_down_right; BOOL mouse_down_other; diff --git a/server/Mac/mf_mountain_lion.c b/server/Mac/mf_mountain_lion.c index 46af1907f..f754c7c7d 100644 --- a/server/Mac/mf_mountain_lion.c +++ b/server/Mac/mf_mountain_lion.c @@ -36,192 +36,182 @@ BYTE* localBuf = NULL; BOOL ready = FALSE; -void (^streamHandler)(CGDisplayStreamFrameStatus, uint64_t, IOSurfaceRef, CGDisplayStreamUpdateRef) = ^(CGDisplayStreamFrameStatus status, uint64_t displayTime, IOSurfaceRef frameSurface, CGDisplayStreamUpdateRef updateRef) -{ - - dispatch_semaphore_wait(region_sem, DISPATCH_TIME_FOREVER); - - //may need to move this down - if(ready == TRUE) - { - - RFX_RECT rect; - unsigned long offset_beg; - unsigned long stride; - int i; - - rect.x = 0; - rect.y = 0; - rect.width = 0; - rect.height = 0; - mf_mlion_peek_dirty_region(&rect); - - - //lock surface - IOSurfaceLock(frameSurface, kIOSurfaceLockReadOnly, NULL); - //get pointer - void* baseAddress = IOSurfaceGetBaseAddress(frameSurface); - //copy region - - stride = IOSurfaceGetBytesPerRow(frameSurface); - //memcpy(localBuf, baseAddress + offset_beg, surflen); - for(i = 0; i < rect.height; i++) - { - offset_beg = (stride * (rect.y + i) + (rect.x * 4)); - memcpy(localBuf + offset_beg, - baseAddress + offset_beg, - rect.width * 4); - } - - //unlock surface - IOSurfaceUnlock(frameSurface, kIOSurfaceLockReadOnly, NULL); - - ready = FALSE; - dispatch_semaphore_signal(data_sem); - } - - if (status != kCGDisplayStreamFrameStatusFrameComplete) - { - switch(status) - { - case kCGDisplayStreamFrameStatusFrameIdle: - break; - - case kCGDisplayStreamFrameStatusStopped: - break; - - case kCGDisplayStreamFrameStatusFrameBlank: - break; - - default: - break; - - } - } - else if (lastUpdate == NULL) - { - CFRetain(updateRef); - lastUpdate = updateRef; - } - else - { - CGDisplayStreamUpdateRef tmpRef; - tmpRef = lastUpdate; - lastUpdate = CGDisplayStreamUpdateCreateMergedUpdate(tmpRef, updateRef); - CFRelease(tmpRef); - } - - dispatch_semaphore_signal(region_sem); +void (^streamHandler)(CGDisplayStreamFrameStatus, uint64_t, IOSurfaceRef, + CGDisplayStreamUpdateRef) = ^(CGDisplayStreamFrameStatus status, + uint64_t displayTime, IOSurfaceRef frameSurface, + CGDisplayStreamUpdateRef updateRef) { + dispatch_semaphore_wait(region_sem, DISPATCH_TIME_FOREVER); + + // may need to move this down + if (ready == TRUE) + { + + RFX_RECT rect; + unsigned long offset_beg; + unsigned long stride; + int i; + + rect.x = 0; + rect.y = 0; + rect.width = 0; + rect.height = 0; + mf_mlion_peek_dirty_region(&rect); + + // lock surface + IOSurfaceLock(frameSurface, kIOSurfaceLockReadOnly, NULL); + // get pointer + void* baseAddress = IOSurfaceGetBaseAddress(frameSurface); + // copy region + + stride = IOSurfaceGetBytesPerRow(frameSurface); + // memcpy(localBuf, baseAddress + offset_beg, surflen); + for (i = 0; i < rect.height; i++) + { + offset_beg = (stride * (rect.y + i) + (rect.x * 4)); + memcpy(localBuf + offset_beg, baseAddress + offset_beg, rect.width * 4); + } + + // unlock surface + IOSurfaceUnlock(frameSurface, kIOSurfaceLockReadOnly, NULL); + + ready = FALSE; + dispatch_semaphore_signal(data_sem); + } + + if (status != kCGDisplayStreamFrameStatusFrameComplete) + { + switch (status) + { + case kCGDisplayStreamFrameStatusFrameIdle: + break; + + case kCGDisplayStreamFrameStatusStopped: + break; + + case kCGDisplayStreamFrameStatusFrameBlank: + break; + + default: + break; + } + } + else if (lastUpdate == NULL) + { + CFRetain(updateRef); + lastUpdate = updateRef; + } + else + { + CGDisplayStreamUpdateRef tmpRef; + tmpRef = lastUpdate; + lastUpdate = CGDisplayStreamUpdateCreateMergedUpdate(tmpRef, updateRef); + CFRelease(tmpRef); + } + + dispatch_semaphore_signal(region_sem); }; int mf_mlion_display_info(UINT32* disp_width, UINT32* disp_height, UINT32* scale) { CGDirectDisplayID display_id; - + display_id = CGMainDisplayID(); - + CGDisplayModeRef mode = CGDisplayCopyDisplayMode(display_id); - + size_t pixelWidth = CGDisplayModeGetPixelWidth(mode); - //size_t pixelHeight = CGDisplayModeGetPixelHeight(mode); - + // size_t pixelHeight = CGDisplayModeGetPixelHeight(mode); + size_t wide = CGDisplayPixelsWide(display_id); size_t high = CGDisplayPixelsHigh(display_id); - + CGDisplayModeRelease(mode); - - *disp_width = wide;//pixelWidth; - *disp_height = high;//pixelHeight; + + *disp_width = wide; // pixelWidth; + *disp_height = high; // pixelHeight; *scale = pixelWidth / wide; - + return 0; } int mf_mlion_screen_updates_init() { CGDirectDisplayID display_id; - + display_id = CGMainDisplayID(); - + screen_update_q = dispatch_queue_create("mfreerdp.server.screenUpdate", NULL); - + region_sem = dispatch_semaphore_create(1); data_sem = dispatch_semaphore_create(1); - + UINT32 pixelWidth; UINT32 pixelHeight; UINT32 scale; - + mf_mlion_display_info(&pixelWidth, &pixelHeight, &scale); - + localBuf = malloc(pixelWidth * pixelHeight * 4); if (!localBuf) return -1; - + CFDictionaryRef opts; - - void * keys[2]; - void * values[2]; - - keys[0] = (void *) kCGDisplayStreamShowCursor; - values[0] = (void *) kCFBooleanFalse; - - opts = CFDictionaryCreate(kCFAllocatorDefault, (const void **) keys, (const void **) values, 1, NULL, NULL); - - - stream = CGDisplayStreamCreateWithDispatchQueue(display_id, - pixelWidth, - pixelHeight, - 'BGRA', - opts, - screen_update_q, - streamHandler); - + + void* keys[2]; + void* values[2]; + + keys[0] = (void*)kCGDisplayStreamShowCursor; + values[0] = (void*)kCFBooleanFalse; + + opts = CFDictionaryCreate(kCFAllocatorDefault, (const void**)keys, (const void**)values, 1, + NULL, NULL); + + stream = CGDisplayStreamCreateWithDispatchQueue(display_id, pixelWidth, pixelHeight, 'BGRA', + opts, screen_update_q, streamHandler); + CFRelease(opts); - + return 0; - } int mf_mlion_start_getting_screen_updates() { CGError err; - + err = CGDisplayStreamStart(stream); - + if (err != kCGErrorSuccess) { return 1; } - + return 0; - } int mf_mlion_stop_getting_screen_updates() { CGError err; - + err = CGDisplayStreamStop(stream); - + if (err != kCGErrorSuccess) { return 1; } - + return 0; } int mf_mlion_get_dirty_region(RFX_RECT* invalid) { dispatch_semaphore_wait(region_sem, DISPATCH_TIME_FOREVER); - + if (lastUpdate != NULL) { mf_mlion_peek_dirty_region(invalid); } - + dispatch_semaphore_signal(region_sem); - + return 0; } @@ -229,37 +219,38 @@ int mf_mlion_peek_dirty_region(RFX_RECT* invalid) { size_t num_rects, i; CGRect dirtyRegion; - - const CGRect * rects = CGDisplayStreamUpdateGetRects(lastUpdate, kCGDisplayStreamUpdateDirtyRects, &num_rects); - - if (num_rects == 0) { + + const CGRect* rects = + CGDisplayStreamUpdateGetRects(lastUpdate, kCGDisplayStreamUpdateDirtyRects, &num_rects); + + if (num_rects == 0) + { return 0; } - + dirtyRegion = *rects; for (i = 0; i < num_rects; i++) { - dirtyRegion = CGRectUnion(dirtyRegion, *(rects+i)); + dirtyRegion = CGRectUnion(dirtyRegion, *(rects + i)); } - + invalid->x = dirtyRegion.origin.x; invalid->y = dirtyRegion.origin.y; invalid->height = dirtyRegion.size.height; invalid->width = dirtyRegion.size.width; - + return 0; } int mf_mlion_clear_dirty_region() { dispatch_semaphore_wait(region_sem, DISPATCH_TIME_FOREVER); - + CFRelease(lastUpdate); lastUpdate = NULL; - + dispatch_semaphore_signal(region_sem); - - + return 0; } @@ -269,11 +260,11 @@ int mf_mlion_get_pixelData(long x, long y, long width, long height, BYTE** pxDat ready = TRUE; dispatch_semaphore_wait(data_sem, DISPATCH_TIME_FOREVER); dispatch_semaphore_signal(region_sem); - - //this second wait allows us to block until data is copied... more on this later + + // this second wait allows us to block until data is copied... more on this later dispatch_semaphore_wait(data_sem, DISPATCH_TIME_FOREVER); *pxData = localBuf; dispatch_semaphore_signal(data_sem); - + return 0; } diff --git a/server/Mac/mf_mountain_lion.h b/server/Mac/mf_mountain_lion.h index 1790a3cca..c1fbe9bb5 100644 --- a/server/Mac/mf_mountain_lion.h +++ b/server/Mac/mf_mountain_lion.h @@ -22,7 +22,6 @@ #include - int mf_mlion_display_info(UINT32* disp_width, UINT32* dispHeight, UINT32* scale); int mf_mlion_screen_updates_init(void); @@ -34,6 +33,6 @@ int mf_mlion_get_dirty_region(RFX_RECT* invalid); int mf_mlion_peek_dirty_region(RFX_RECT* invalid); int mf_mlion_clear_dirty_region(void); -int mf_mlion_get_pixelData(long x, long y, long width, long height, BYTE **pxData); +int mf_mlion_get_pixelData(long x, long y, long width, long height, BYTE** pxData); #endif /* FREERDP_SERVER_MAC_MLION_H */ diff --git a/server/Mac/mf_peer.c b/server/Mac/mf_peer.c index 1c82e7212..5904b4b09 100644 --- a/server/Mac/mf_peer.c +++ b/server/Mac/mf_peer.c @@ -45,7 +45,7 @@ #include "CoreVideo/CoreVideo.h" -//refactor these +// refactor these static int info_last_sec = 0; static int info_last_nsec = 0; @@ -63,15 +63,14 @@ static BOOL mf_peer_get_fds(freerdp_peer* client, void** rfds, int* rcount) if (info_event_queue->pipe_fd[0] == -1) return TRUE; - rfds[*rcount] = (void*)(long) info_event_queue->pipe_fd[0]; + rfds[*rcount] = (void*)(long)info_event_queue->pipe_fd[0]; (*rcount)++; return TRUE; } - static void mf_peer_rfx_update(freerdp_peer* client) { - //check + // check mfInfo* mfi = mf_info_get_instance(); mf_info_find_invalid_region(mfi); @@ -86,14 +85,14 @@ static void mf_peer_rfx_update(freerdp_peer* client) BYTE* dataBits = NULL; mf_info_getScreenData(mfi, &width, &height, &dataBits, &pitch); mf_info_clear_invalid_region(mfi); - //encode + // encode wStream* s; RFX_RECT rect; rdpUpdate* update; mfPeerContext* mfp; SURFACE_BITS_COMMAND cmd = { 0 }; update = client->update; - mfp = (mfPeerContext*) client->context; + mfp = (mfPeerContext*)client->context; s = mfp->s; Stream_Clear(s); Stream_SetPosition(s, 0); @@ -106,8 +105,8 @@ static void mf_peer_rfx_update(freerdp_peer* client) mfp->rfx_context->width = mfi->servscreen_width; mfp->rfx_context->height = mfi->servscreen_height; - if (!(rfx_compose_message(mfp->rfx_context, s, &rect, 1, - (BYTE*) dataBits, rect.width, rect.height, pitch))) + if (!(rfx_compose_message(mfp->rfx_context, s, &rect, 1, (BYTE*)dataBits, rect.width, + rect.height, pitch))) { return; } @@ -122,14 +121,14 @@ static void mf_peer_rfx_update(freerdp_peer* client) cmd.bmp.height = rect.height; cmd.bmp.bitmapDataLength = Stream_GetPosition(s); cmd.bmp.bitmapData = Stream_Buffer(s); - //send + // send update->SurfaceBits(update->context, &cmd); - //clean up... maybe? + // clean up... maybe? } static BOOL mf_peer_check_fds(freerdp_peer* client) { - mfPeerContext* context = (mfPeerContext*) client->context; + mfPeerContext* context = (mfPeerContext*)client->context; mfEvent* event; if (context->activated == FALSE) @@ -170,7 +169,7 @@ static BOOL mf_peer_context_new(freerdp_peer* client, mfPeerContext* context) if (!(context->s = Stream_New(NULL, 0xFFFF))) goto fail_stream_new; - context->vcm = WTSOpenServerA((LPSTR) client->context); + context->vcm = WTSOpenServerA((LPSTR)client->context); if (!context->vcm || context->vcm == INVALID_HANDLE_VALUE) goto fail_open_server; @@ -196,7 +195,7 @@ static void mf_peer_context_free(freerdp_peer* client, mfPeerContext* context) dispatch_suspend(info_timer); Stream_Free(context->s, TRUE); rfx_context_free(context->rfx_context); - //nsc_context_free(context->nsc_context); + // nsc_context_free(context->nsc_context); #ifdef CHANNEL_AUDIN_SERVER if (context->audin) @@ -218,30 +217,26 @@ static void mf_peer_context_free(freerdp_peer* client, mfPeerContext* context) static BOOL mf_peer_init(freerdp_peer* client) { client->ContextSize = sizeof(mfPeerContext); - client->ContextNew = (psPeerContextNew) mf_peer_context_new; - client->ContextFree = (psPeerContextFree) mf_peer_context_free; + client->ContextNew = (psPeerContextNew)mf_peer_context_new; + client->ContextFree = (psPeerContextFree)mf_peer_context_free; if (!freerdp_peer_context_new(client)) return FALSE; info_event_queue = mf_event_queue_new(); - info_queue = dispatch_queue_create("FreeRDP.update.timer", - DISPATCH_QUEUE_SERIAL); - info_timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, - info_queue); + info_queue = dispatch_queue_create("FreeRDP.update.timer", DISPATCH_QUEUE_SERIAL); + info_timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, info_queue); if (info_timer) { - //DEBUG_WARN( "created timer\n"); + // DEBUG_WARN( "created timer\n"); dispatch_source_set_timer(info_timer, DISPATCH_TIME_NOW, 42ull * NSEC_PER_MSEC, 100ull * NSEC_PER_MSEC); - dispatch_source_set_event_handler(info_timer, ^ - { - //DEBUG_WARN( "dispatch\n"); - mfEvent* event = mf_event_new(FREERDP_SERVER_MAC_EVENT_TYPE_FRAME_TICK); - mf_event_push(info_event_queue, (mfEvent*) event); - } - ); + dispatch_source_set_event_handler(info_timer, ^{ + // DEBUG_WARN( "dispatch\n"); + mfEvent* event = mf_event_new(FREERDP_SERVER_MAC_EVENT_TYPE_FRAME_TICK); + mf_event_push(info_event_queue, (mfEvent*)event); + }); dispatch_resume(info_timer); } @@ -250,16 +245,16 @@ static BOOL mf_peer_init(freerdp_peer* client) static BOOL mf_peer_post_connect(freerdp_peer* client) { - mfPeerContext* context = (mfPeerContext*) client->context; + mfPeerContext* context = (mfPeerContext*)client->context; rdpSettings* settings = client->settings; mfInfo* mfi = mf_info_get_instance(); mfi->scale = 1; - //mfi->servscreen_width = 2880 / mfi->scale; - //mfi->servscreen_height = 1800 / mfi->scale; + // mfi->servscreen_width = 2880 / mfi->scale; + // mfi->servscreen_height = 1800 / mfi->scale; UINT32 bitsPerPixel = 32; - if ((settings->DesktopWidth != mfi->servscreen_width) - || (settings->DesktopHeight != mfi->servscreen_height)) + if ((settings->DesktopWidth != mfi->servscreen_width) || + (settings->DesktopHeight != mfi->servscreen_height)) { } @@ -287,7 +282,7 @@ static BOOL mf_peer_post_connect(freerdp_peer* client) static BOOL mf_peer_activate(freerdp_peer* client) { - mfPeerContext* context = (mfPeerContext*) client->context; + mfPeerContext* context = (mfPeerContext*)client->context; rfx_context_reset(context->rfx_context, client->settings->DesktopWidth, client->settings->DesktopHeight); context->activated = TRUE; @@ -302,7 +297,7 @@ static BOOL mf_peer_synchronize_event(rdpInput* input, UINT32 flags) void mf_peer_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) { UINT16 down = 0x4000; - //UINT16 up = 0x8000; + // UINT16 up = 0x8000; bool state_down = FALSE; if (flags == down) @@ -316,13 +311,11 @@ static BOOL mf_peer_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 return FALSE; } -static BOOL mf_peer_suppress_output(rdpContext* context, BYTE allow, - const RECTANGLE_16* area) +static BOOL mf_peer_suppress_output(rdpContext* context, BYTE allow, const RECTANGLE_16* area) { return FALSE; } - static void* mf_peer_main_loop(void* arg) { int i; @@ -332,7 +325,7 @@ static void* mf_peer_main_loop(void* arg) void* rfds[32]; fd_set rfds_set; mfPeerContext* context; - freerdp_peer* client = (freerdp_peer*) arg; + freerdp_peer* client = (freerdp_peer*)arg; memset(rfds, 0, sizeof(rfds)); if (!mf_peer_init(client)) @@ -359,14 +352,14 @@ static void* mf_peer_main_loop(void* arg) client->PostConnect = mf_peer_post_connect; client->Activate = mf_peer_activate; client->input->SynchronizeEvent = mf_peer_synchronize_event; - client->input->KeyboardEvent = mf_input_keyboard_event;//mf_peer_keyboard_event; + client->input->KeyboardEvent = mf_input_keyboard_event; // mf_peer_keyboard_event; client->input->UnicodeKeyboardEvent = mf_peer_unicode_keyboard_event; client->input->MouseEvent = mf_input_mouse_event; client->input->ExtendedMouseEvent = mf_input_extended_mouse_event; - //client->update->RefreshRect = mf_peer_refresh_rect; + // client->update->RefreshRect = mf_peer_refresh_rect; client->update->SuppressOutput = mf_peer_suppress_output; client->Initialize(client); - context = (mfPeerContext*) client->context; + context = (mfPeerContext*)client->context; while (1) { @@ -402,9 +395,7 @@ static void* mf_peer_main_loop(void* arg) if (select(max_fds + 1, &rfds_set, NULL, NULL, NULL) == -1) { /* these are not really errors */ - if (!((errno == EAGAIN) || - (errno == EWOULDBLOCK) || - (errno == EINPROGRESS) || + if (!((errno == EAGAIN) || (errno == EWOULDBLOCK) || (errno == EINPROGRESS) || (errno == EINTR))) /* signal occurred */ { break; diff --git a/server/Mac/mf_rdpsnd.c b/server/Mac/mf_rdpsnd.c index 8c7a18032..6d555c5ab 100644 --- a/server/Mac/mf_rdpsnd.c +++ b/server/Mac/mf_rdpsnd.c @@ -41,8 +41,8 @@ static void mf_peer_rdpsnd_activated(RdpsndServerContext* context) int i, j; BOOL formatAgreed = FALSE; AUDIO_FORMAT* agreedFormat = NULL; - //we should actually loop through the list of client formats here - //and see if we can send the client something that it supports... + // we should actually loop through the list of client formats here + // and see if we can send the client something that it supports... WLog_DBG(TAG, "Client supports the following %d formats: ", context->num_client_formats); for (i = 0; i < context->num_client_formats; i++) @@ -52,7 +52,8 @@ static void mf_peer_rdpsnd_activated(RdpsndServerContext* context) { if ((context->client_formats[i].wFormatTag == context->server_formats[j].wFormatTag) && (context->client_formats[i].nChannels == context->server_formats[j].nChannels) && - (context->client_formats[i].nSamplesPerSec == context->server_formats[j].nSamplesPerSec)) + (context->client_formats[i].nSamplesPerSec == + context->server_formats[j].nSamplesPerSec)) { WLog_DBG(TAG, "agreed on format!"); formatAgreed = TRUE; @@ -90,44 +91,34 @@ static void mf_peer_rdpsnd_activated(RdpsndServerContext* context) } recorderState.dataFormat.mSampleRate = agreedFormat->nSamplesPerSec; - recorderState.dataFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | - kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked; + recorderState.dataFormat.mFormatFlags = + kAudioFormatFlagIsSignedInteger | kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked; recorderState.dataFormat.mBytesPerPacket = 4; recorderState.dataFormat.mFramesPerPacket = 1; recorderState.dataFormat.mBytesPerFrame = 4; recorderState.dataFormat.mChannelsPerFrame = agreedFormat->nChannels; recorderState.dataFormat.mBitsPerChannel = agreedFormat->wBitsPerSample; recorderState.snd_context = context; - status = AudioQueueNewInput(&recorderState.dataFormat, - mf_peer_rdpsnd_input_callback, - &recorderState, - NULL, - kCFRunLoopCommonModes, - 0, - &recorderState.queue); + status = + AudioQueueNewInput(&recorderState.dataFormat, mf_peer_rdpsnd_input_callback, &recorderState, + NULL, kCFRunLoopCommonModes, 0, &recorderState.queue); if (status != noErr) { - WLog_DBG(TAG, "Failed to create a new Audio Queue. Status code: %"PRId32"", status); + WLog_DBG(TAG, "Failed to create a new Audio Queue. Status code: %" PRId32 "", status); } UInt32 dataFormatSize = sizeof(recorderState.dataFormat); - AudioQueueGetProperty(recorderState.queue, - kAudioConverterCurrentInputStreamDescription, - &recorderState.dataFormat, - &dataFormatSize); + AudioQueueGetProperty(recorderState.queue, kAudioConverterCurrentInputStreamDescription, + &recorderState.dataFormat, &dataFormatSize); mf_rdpsnd_derive_buffer_size(recorderState.queue, &recorderState.dataFormat, 0.05, &recorderState.bufferByteSize); for (i = 0; i < SND_NUMBUFFERS; ++i) { - AudioQueueAllocateBuffer(recorderState.queue, - recorderState.bufferByteSize, + AudioQueueAllocateBuffer(recorderState.queue, recorderState.bufferByteSize, &recorderState.buffers[i]); - AudioQueueEnqueueBuffer(recorderState.queue, - recorderState.buffers[i], - 0, - NULL); + AudioQueueEnqueueBuffer(recorderState.queue, recorderState.buffers[i], 0, NULL); } recorderState.currentPacket = 0; @@ -140,7 +131,8 @@ BOOL mf_peer_rdpsnd_init(mfPeerContext* context) context->rdpsnd = rdpsnd_server_context_new(context->vcm); context->rdpsnd->rdpcontext = &context->_p; context->rdpsnd->data = context; - context->rdpsnd->num_server_formats = server_rdpsnd_get_formats(&context->rdpsnd->server_formats); + context->rdpsnd->num_server_formats = + server_rdpsnd_get_formats(&context->rdpsnd->server_formats); if (context->rdpsnd->num_server_formats > 0) context->rdpsnd->src_format = &context->rdpsnd->server_formats[0]; @@ -157,12 +149,10 @@ BOOL mf_peer_rdpsnd_stop() return TRUE; } -void mf_peer_rdpsnd_input_callback(void* inUserData, - AudioQueueRef inAQ, - AudioQueueBufferRef inBuffer, - const AudioTimeStamp* inStartTime, - UInt32 inNumberPacketDescriptions, - const AudioStreamPacketDescription* inPacketDescs) +void mf_peer_rdpsnd_input_callback(void* inUserData, AudioQueueRef inAQ, + AudioQueueBufferRef inBuffer, const AudioTimeStamp* inStartTime, + UInt32 inNumberPacketDescriptions, + const AudioStreamPacketDescription* inPacketDescs) { OSStatus status; AQRecorderState* rState; @@ -170,32 +160,29 @@ void mf_peer_rdpsnd_input_callback(void* inUserDa if (inNumberPacketDescriptions == 0 && rState->dataFormat.mBytesPerPacket != 0) { - inNumberPacketDescriptions = inBuffer->mAudioDataByteSize / rState->dataFormat.mBytesPerPacket; + inNumberPacketDescriptions = + inBuffer->mAudioDataByteSize / rState->dataFormat.mBytesPerPacket; } if (rState->isRunning == 0) { - return ; + return; } rState->snd_context->SendSamples(rState->snd_context, inBuffer->mAudioData, - inBuffer->mAudioDataByteSize / 4, (UINT16)(GetTickCount() & 0xffff)); - status = AudioQueueEnqueueBuffer( - rState->queue, - inBuffer, - 0, - NULL); + inBuffer->mAudioDataByteSize / 4, + (UINT16)(GetTickCount() & 0xffff)); + status = AudioQueueEnqueueBuffer(rState->queue, inBuffer, 0, NULL); if (status != noErr) { - WLog_DBG(TAG, "AudioQueueEnqueueBuffer() returned status = %"PRId32"", status); + WLog_DBG(TAG, "AudioQueueEnqueueBuffer() returned status = %" PRId32 "", status); } } -void mf_rdpsnd_derive_buffer_size(AudioQueueRef audioQueue, - AudioStreamBasicDescription* ASBDescription, - Float64 seconds, - UInt32* outBufferSize) +void mf_rdpsnd_derive_buffer_size(AudioQueueRef audioQueue, + AudioStreamBasicDescription* ASBDescription, Float64 seconds, + UInt32* outBufferSize) { static const int maxBufferSize = 0x50000; int maxPacketSize = ASBDescription->mBytesPerPacket; @@ -203,17 +190,12 @@ void mf_rdpsnd_derive_buffer_size(AudioQueueRef audioQueue, if (maxPacketSize == 0) { UInt32 maxVBRPacketSize = sizeof(maxPacketSize); - AudioQueueGetProperty(audioQueue, - kAudioQueueProperty_MaximumOutputPacketSize, + AudioQueueGetProperty(audioQueue, kAudioQueueProperty_MaximumOutputPacketSize, // in Mac OS X v10.5, instead use // kAudioConverterPropertyMaximumOutputPacketSize - &maxPacketSize, - &maxVBRPacketSize - ); + &maxPacketSize, &maxVBRPacketSize); } - Float64 numBytesForTime = - ASBDescription->mSampleRate * maxPacketSize * seconds; + Float64 numBytesForTime = ASBDescription->mSampleRate * maxPacketSize * seconds; *outBufferSize = (UInt32)(numBytesForTime < maxBufferSize ? numBytesForTime : maxBufferSize); } - diff --git a/server/Mac/mf_rdpsnd.h b/server/Mac/mf_rdpsnd.h index ea9099699..2fddfdc1b 100644 --- a/server/Mac/mf_rdpsnd.h +++ b/server/Mac/mf_rdpsnd.h @@ -30,31 +30,26 @@ #include "mf_interface.h" #include "mfreerdp.h" -void mf_rdpsnd_derive_buffer_size (AudioQueueRef audioQueue, - AudioStreamBasicDescription *ASBDescription, - Float64 seconds, - UInt32 *outBufferSize); +void mf_rdpsnd_derive_buffer_size(AudioQueueRef audioQueue, + AudioStreamBasicDescription* ASBDescription, Float64 seconds, + UInt32* outBufferSize); -void mf_peer_rdpsnd_input_callback (void *inUserData, - AudioQueueRef inAQ, - AudioQueueBufferRef inBuffer, - const AudioTimeStamp *inStartTime, - UInt32 inNumberPacketDescriptions, - const AudioStreamPacketDescription *inPacketDescs); +void mf_peer_rdpsnd_input_callback(void* inUserData, AudioQueueRef inAQ, + AudioQueueBufferRef inBuffer, const AudioTimeStamp* inStartTime, + UInt32 inNumberPacketDescriptions, + const AudioStreamPacketDescription* inPacketDescs); - -#define SND_NUMBUFFERS 3 +#define SND_NUMBUFFERS 3 struct _AQRecorderState { - AudioStreamBasicDescription dataFormat; - AudioQueueRef queue; - AudioQueueBufferRef buffers[SND_NUMBUFFERS]; - AudioFileID audioFile; - UInt32 bufferByteSize; - SInt64 currentPacket; - bool isRunning; - RdpsndServerContext* snd_context; - + AudioStreamBasicDescription dataFormat; + AudioQueueRef queue; + AudioQueueBufferRef buffers[SND_NUMBUFFERS]; + AudioFileID audioFile; + UInt32 bufferByteSize; + SInt64 currentPacket; + bool isRunning; + RdpsndServerContext* snd_context; }; typedef struct _AQRecorderState AQRecorderState; @@ -63,4 +58,3 @@ BOOL mf_peer_rdpsnd_init(mfPeerContext* context); BOOL mf_peer_rdpsnd_stop(void); #endif /* FREERDP_SERVER_MAC_RDPSND_H */ - diff --git a/server/Mac/mfreerdp.c b/server/Mac/mfreerdp.c index 0bcbe71d0..cd45131f1 100644 --- a/server/Mac/mfreerdp.c +++ b/server/Mac/mfreerdp.c @@ -82,10 +82,8 @@ static void mf_server_main_loop(freerdp_listener* instance) if (select(max_fds + 1, &rfds_set, NULL, NULL, NULL) == -1) { /* these are not really errors */ - if (!((errno == EAGAIN) || - (errno == EWOULDBLOCK) || - (errno == EINPROGRESS) || - (errno == EINTR))) /* signal occurred */ + if (!((errno == EAGAIN) || (errno == EWOULDBLOCK) || (errno == EINPROGRESS) || + (errno == EINTR))) /* signal occurred */ { break; } @@ -107,7 +105,7 @@ int main(int argc, char* argv[]) signal(SIGPIPE, SIG_IGN); WTSRegisterWtsApiFunctionTable(FreeRDP_InitWtsApi()); - + if (!(instance = freerdp_listener_new())) return 1; diff --git a/server/Sample/sf_audin.c b/server/Sample/sf_audin.c index d8ca1d962..5eea5dfb4 100644 --- a/server/Sample/sf_audin.c +++ b/server/Sample/sf_audin.c @@ -23,8 +23,6 @@ #include "config.h" #endif - - #include "sfreerdp.h" #include "sf_audin.h" @@ -55,7 +53,7 @@ static UINT sf_peer_audin_open_result(audin_server_context* context, UINT32 resu { /* TODO: Implement */ WLog_WARN(TAG, "%s not implemented", __FUNCTION__); - WLog_DBG(TAG, "AUDIN open result %"PRIu32".", result); + WLog_DBG(TAG, "AUDIN open result %" PRIu32 ".", result); return CHANNEL_RC_OK; } @@ -64,13 +62,12 @@ static UINT sf_peer_audin_open_result(audin_server_context* context, UINT32 resu * * @return 0 on success, otherwise a Win32 error code */ -static UINT sf_peer_audin_receive_samples(audin_server_context* context, - const AUDIO_FORMAT* format, wStream* buf, - size_t nframes) +static UINT sf_peer_audin_receive_samples(audin_server_context* context, const AUDIO_FORMAT* format, + wStream* buf, size_t nframes) { /* TODO: Implement */ WLog_WARN(TAG, "%s not implemented", __FUNCTION__); - WLog_DBG(TAG, "%s receive %"PRIdz" frames.", __FUNCTION__, nframes); + WLog_DBG(TAG, "%s receive %" PRIdz " frames.", __FUNCTION__, nframes); return CHANNEL_RC_OK; } diff --git a/server/Sample/sf_audin.h b/server/Sample/sf_audin.h index e99321c87..784747814 100644 --- a/server/Sample/sf_audin.h +++ b/server/Sample/sf_audin.h @@ -29,4 +29,3 @@ void sf_peer_audin_init(testPeerContext* context); #endif /* FREERDP_SERVER_SAMPLE_SF_AUDIN_H */ - diff --git a/server/Sample/sf_rdpsnd.c b/server/Sample/sf_rdpsnd.c index 20c6aceaf..558b1949a 100644 --- a/server/Sample/sf_rdpsnd.c +++ b/server/Sample/sf_rdpsnd.c @@ -25,7 +25,6 @@ #include - #include "sf_rdpsnd.h" #include @@ -43,7 +42,8 @@ BOOL sf_peer_rdpsnd_init(testPeerContext* context) context->rdpsnd = rdpsnd_server_context_new(context->vcm); context->rdpsnd->rdpcontext = &context->_p; context->rdpsnd->data = context; - context->rdpsnd->num_server_formats = server_rdpsnd_get_formats(&context->rdpsnd->server_formats); + context->rdpsnd->num_server_formats = + server_rdpsnd_get_formats(&context->rdpsnd->server_formats); if (context->rdpsnd->num_server_formats > 0) context->rdpsnd->src_format = &context->rdpsnd->server_formats[0]; diff --git a/server/Sample/sf_rdpsnd.h b/server/Sample/sf_rdpsnd.h index 7da3f5acf..f9b0ef481 100644 --- a/server/Sample/sf_rdpsnd.h +++ b/server/Sample/sf_rdpsnd.h @@ -29,4 +29,3 @@ BOOL sf_peer_rdpsnd_init(testPeerContext* context); #endif /* FREERDP_SERVER_SAMPLE_SF_RDPSND_H */ - diff --git a/server/Sample/sfreerdp.c b/server/Sample/sfreerdp.c index 3b1a35d14..df6b86cd6 100644 --- a/server/Sample/sfreerdp.c +++ b/server/Sample/sfreerdp.c @@ -77,7 +77,7 @@ BOOL test_peer_context_new(freerdp_peer* client, testPeerContext* context) context->icon_x = -1; context->icon_y = -1; - context->vcm = WTSOpenServerA((LPSTR) client->context); + context->vcm = WTSOpenServerA((LPSTR)client->context); if (!context->vcm || context->vcm == INVALID_HANDLE_VALUE) goto fail_open_server; @@ -128,15 +128,15 @@ void test_peer_context_free(freerdp_peer* client, testPeerContext* context) if (context->encomsp) encomsp_server_context_free(context->encomsp); - WTSCloseServer((HANDLE) context->vcm); + WTSCloseServer((HANDLE)context->vcm); } } static BOOL test_peer_init(freerdp_peer* client) { client->ContextSize = sizeof(testPeerContext); - client->ContextNew = (psPeerContextNew) test_peer_context_new; - client->ContextFree = (psPeerContextFree) test_peer_context_free; + client->ContextNew = (psPeerContextNew)test_peer_context_new; + client->ContextFree = (psPeerContextFree)test_peer_context_free; return freerdp_peer_context_new(client); } @@ -151,7 +151,7 @@ static void test_peer_begin_frame(freerdp_peer* client) { rdpUpdate* update = client->update; SURFACE_FRAME_MARKER fm; - testPeerContext* context = (testPeerContext*) client->context; + testPeerContext* context = (testPeerContext*)client->context; fm.frameAction = SURFACECMD_FRAMEACTION_BEGIN; fm.frameId = context->frame_id; update->SurfaceFrameMarker(update->context, &fm); @@ -161,7 +161,7 @@ static void test_peer_end_frame(freerdp_peer* client) { rdpUpdate* update = client->update; SURFACE_FRAME_MARKER fm; - testPeerContext* context = (testPeerContext*) client->context; + testPeerContext* context = (testPeerContext*)client->context; fm.frameAction = SURFACECMD_FRAMEACTION_END; fm.frameId = context->frame_id; update->SurfaceFrameMarker(update->context, &fm); @@ -176,7 +176,7 @@ static BOOL test_peer_draw_background(freerdp_peer* client) BYTE* rgb_data; rdpUpdate* update = client->update; SURFACE_BITS_COMMAND cmd = { 0 }; - testPeerContext* context = (testPeerContext*) client->context; + testPeerContext* context = (testPeerContext*)client->context; BOOL ret = FALSE; if (!client->settings->RemoteFxCodec && !client->settings->NSCodec) @@ -199,8 +199,8 @@ static BOOL test_peer_draw_background(freerdp_peer* client) if (client->settings->RemoteFxCodec) { - if (!rfx_compose_message(context->rfx_context, s, - &rect, 1, rgb_data, rect.width, rect.height, rect.width * 3)) + if (!rfx_compose_message(context->rfx_context, s, &rect, 1, rgb_data, rect.width, + rect.height, rect.width * 3)) { goto out; } @@ -209,8 +209,8 @@ static BOOL test_peer_draw_background(freerdp_peer* client) } else { - nsc_compose_message(context->nsc_context, s, - rgb_data, rect.width, rect.height, rect.width * 3); + nsc_compose_message(context->nsc_context, s, rgb_data, rect.width, rect.height, + rect.width * 3); cmd.bmp.codecID = client->settings->NSCodecId; } @@ -235,7 +235,7 @@ out: static BOOL test_peer_load_icon(freerdp_peer* client) { - testPeerContext* context = (testPeerContext*) client->context; + testPeerContext* context = (testPeerContext*)client->context; FILE* fp; int i; char line[50]; @@ -291,7 +291,7 @@ static BOOL test_peer_load_icon(freerdp_peer* client) return TRUE; out_fail: free(rgb_data); - context->bg_data = NULL; + context->bg_data = NULL; fclose(fp); return FALSE; } @@ -302,7 +302,7 @@ static void test_peer_draw_icon(freerdp_peer* client, int x, int y) RFX_RECT rect; rdpUpdate* update = client->update; SURFACE_BITS_COMMAND cmd = { 0 }; - testPeerContext* context = (testPeerContext*) client->context; + testPeerContext* context = (testPeerContext*)client->context; if (client->update->dump_rfx) return; @@ -325,14 +325,14 @@ static void test_peer_draw_icon(freerdp_peer* client, int x, int y) if (client->settings->RemoteFxCodec) { - rfx_compose_message(context->rfx_context, s, - &rect, 1, context->bg_data, rect.width, rect.height, rect.width * 3); + rfx_compose_message(context->rfx_context, s, &rect, 1, context->bg_data, rect.width, + rect.height, rect.width * 3); cmd.bmp.codecID = client->settings->RemoteFxCodecId; } else { - nsc_compose_message(context->nsc_context, s, - context->bg_data, rect.width, rect.height, rect.width * 3); + nsc_compose_message(context->nsc_context, s, context->bg_data, rect.width, rect.height, + rect.width * 3); cmd.bmp.codecID = client->settings->NSCodecId; } @@ -353,14 +353,14 @@ static void test_peer_draw_icon(freerdp_peer* client, int x, int y) if (client->settings->RemoteFxCodec) { - rfx_compose_message(context->rfx_context, s, - &rect, 1, context->icon_data, rect.width, rect.height, rect.width * 3); + rfx_compose_message(context->rfx_context, s, &rect, 1, context->icon_data, rect.width, + rect.height, rect.width * 3); cmd.bmp.codecID = client->settings->RemoteFxCodecId; } else { - nsc_compose_message(context->nsc_context, s, - context->icon_data, rect.width, rect.height, rect.width * 3); + nsc_compose_message(context->nsc_context, s, context->icon_data, rect.width, rect.height, + rect.width * 3); cmd.bmp.codecID = client->settings->NSCodecId; } @@ -379,8 +379,7 @@ static void test_peer_draw_icon(freerdp_peer* client, int x, int y) test_peer_end_frame(client); } -static BOOL test_sleep_tsdiff(UINT32* old_sec, UINT32* old_usec, UINT32 new_sec, - UINT32 new_usec) +static BOOL test_sleep_tsdiff(UINT32* old_sec, UINT32* old_usec, UINT32 new_sec, UINT32 new_usec) { INT32 sec, usec; @@ -450,9 +449,9 @@ BOOL tf_peer_dump_rfx(freerdp_peer* client) pcap_get_next_record_content(pcap_rfx, &record); Stream_SetPointer(s, Stream_Buffer(s) + Stream_Capacity(s)); - if (test_dump_rfx_realtime - && test_sleep_tsdiff(&prev_seconds, &prev_useconds, record.header.ts_sec, - record.header.ts_usec) == FALSE) + if (test_dump_rfx_realtime && + test_sleep_tsdiff(&prev_seconds, &prev_useconds, record.header.ts_sec, + record.header.ts_usec) == FALSE) break; update->SurfaceCommand(update->context, s); @@ -473,12 +472,12 @@ static DWORD WINAPI tf_debug_channel_thread_func(LPVOID arg) void* buffer; DWORD BytesReturned = 0; ULONG written; - testPeerContext* context = (testPeerContext*) arg; + testPeerContext* context = (testPeerContext*)arg; - if (WTSVirtualChannelQuery(context->debug_channel, WTSVirtualFileHandle, - &buffer, &BytesReturned) == TRUE) + if (WTSVirtualChannelQuery(context->debug_channel, WTSVirtualFileHandle, &buffer, + &BytesReturned) == TRUE) { - fd = *((void**) buffer); + fd = *((void**)buffer); WTSFreeMemory(buffer); if (!(context->event = CreateWaitObjectEvent(NULL, TRUE, FALSE, fd))) @@ -497,7 +496,7 @@ static DWORD WINAPI tf_debug_channel_thread_func(LPVOID arg) Stream_SetPosition(s, 0); - if (WTSVirtualChannelRead(context->debug_channel, 0, (PCHAR) Stream_Buffer(s), + if (WTSVirtualChannelRead(context->debug_channel, 0, (PCHAR)Stream_Buffer(s), Stream_Capacity(s), &BytesReturned) == FALSE) { if (BytesReturned == 0) @@ -505,7 +504,7 @@ static DWORD WINAPI tf_debug_channel_thread_func(LPVOID arg) Stream_EnsureRemainingCapacity(s, BytesReturned); - if (WTSVirtualChannelRead(context->debug_channel, 0, (PCHAR) Stream_Buffer(s), + if (WTSVirtualChannelRead(context->debug_channel, 0, (PCHAR)Stream_Buffer(s), Stream_Capacity(s), &BytesReturned) == FALSE) { /* should not happen */ @@ -514,7 +513,7 @@ static DWORD WINAPI tf_debug_channel_thread_func(LPVOID arg) } Stream_SetPosition(s, BytesReturned); - WLog_DBG(TAG, "got %"PRIu32" bytes", BytesReturned); + WLog_DBG(TAG, "got %" PRIu32 " bytes", BytesReturned); } Stream_Free(s, TRUE); @@ -523,16 +522,16 @@ static DWORD WINAPI tf_debug_channel_thread_func(LPVOID arg) BOOL tf_peer_post_connect(freerdp_peer* client) { - testPeerContext* context = (testPeerContext*) client->context; + testPeerContext* context = (testPeerContext*)client->context; /** * This callback is called when the entire connection sequence is done, i.e. we've received the * Font List PDU from the client and sent out the Font Map PDU. * The server may start sending graphics output and receiving keyboard/mouse input after this * callback returns. */ - WLog_DBG(TAG, "Client %s is activated (osMajorType %"PRIu32" osMinorType %"PRIu32")", - client->local ? "(local)" : client->hostname, - client->settings->OsMajorType, client->settings->OsMinorType); + WLog_DBG(TAG, "Client %s is activated (osMajorType %" PRIu32 " osMinorType %" PRIu32 ")", + client->local ? "(local)" : client->hostname, client->settings->OsMajorType, + client->settings->OsMinorType); if (client->settings->AutoLogonEnabled) { @@ -543,7 +542,7 @@ BOOL tf_peer_post_connect(freerdp_peer* client) } WLog_DBG(TAG, ""); - WLog_DBG(TAG, "Client requested desktop: %"PRIu32"x%"PRIu32"x%"PRIu32"", + WLog_DBG(TAG, "Client requested desktop: %" PRIu32 "x%" PRIu32 "x%" PRIu32 "", client->settings->DesktopWidth, client->settings->DesktopHeight, client->settings->ColorDepth); #if (SAMPLE_SERVER_USE_CLIENT_RESOLUTION == 1) @@ -556,12 +555,13 @@ BOOL tf_peer_post_connect(freerdp_peer* client) #else client->settings->DesktopWidth = context->rfx_context->width; client->settings->DesktopHeight = context->rfx_context->height; - WLog_DBG(TAG, "Resizing client to %"PRIu32"x%"PRIu32"", client->settings->DesktopWidth, + WLog_DBG(TAG, "Resizing client to %" PRIu32 "x%" PRIu32 "", client->settings->DesktopWidth, client->settings->DesktopHeight); client->update->DesktopResize(client->update->context); #endif - /* A real server should tag the peer as activated here and start sending updates in main loop. */ + /* A real server should tag the peer as activated here and start sending updates in main loop. + */ if (!test_peer_load_icon(client)) { WLog_DBG(TAG, "Unable to load icon"); @@ -570,8 +570,7 @@ BOOL tf_peer_post_connect(freerdp_peer* client) if (WTSVirtualChannelManagerIsChannelJoined(context->vcm, "rdpdbg")) { - context->debug_channel = WTSVirtualChannelOpen(context->vcm, - WTS_CURRENT_SESSION, "rdpdbg"); + context->debug_channel = WTSVirtualChannelOpen(context->vcm, WTS_CURRENT_SESSION, "rdpdbg"); if (context->debug_channel != NULL) { @@ -583,8 +582,8 @@ BOOL tf_peer_post_connect(freerdp_peer* client) return FALSE; } - if (!(context->debug_channel_thread = CreateThread(NULL, 0, - tf_debug_channel_thread_func, (void*) context, 0, NULL))) + if (!(context->debug_channel_thread = + CreateThread(NULL, 0, tf_debug_channel_thread_func, (void*)context, 0, NULL))) { WLog_ERR(TAG, "Failed to create debug channel thread"); CloseHandle(context->stopEvent); @@ -612,11 +611,11 @@ BOOL tf_peer_post_connect(freerdp_peer* client) BOOL tf_peer_activate(freerdp_peer* client) { - testPeerContext* context = (testPeerContext*) client->context; + testPeerContext* context = (testPeerContext*)client->context; context->activated = TRUE; - //client->settings->CompressionLevel = PACKET_COMPR_TYPE_8K; - //client->settings->CompressionLevel = PACKET_COMPR_TYPE_64K; - //client->settings->CompressionLevel = PACKET_COMPR_TYPE_RDP6; + // client->settings->CompressionLevel = PACKET_COMPR_TYPE_8K; + // client->settings->CompressionLevel = PACKET_COMPR_TYPE_64K; + // client->settings->CompressionLevel = PACKET_COMPR_TYPE_RDP6; client->settings->CompressionLevel = PACKET_COMPR_TYPE_RDP61; if (test_pcap_file != NULL) @@ -635,7 +634,7 @@ BOOL tf_peer_activate(freerdp_peer* client) BOOL tf_peer_synchronize_event(rdpInput* input, UINT32 flags) { WINPR_UNUSED(input); - WLog_DBG(TAG, "Client sent a synchronize event (flags:0x%"PRIX32")", flags); + WLog_DBG(TAG, "Client sent a synchronize event (flags:0x%" PRIX32 ")", flags); return TRUE; } @@ -643,9 +642,9 @@ BOOL tf_peer_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) { freerdp_peer* client = input->context->peer; rdpUpdate* update = client->update; - testPeerContext* context = (testPeerContext*) input->context; - WLog_DBG(TAG, "Client sent a keyboard event (flags:0x%04"PRIX16" code:0x%04"PRIX16")", flags, - code); + testPeerContext* context = (testPeerContext*)input->context; + WLog_DBG(TAG, "Client sent a keyboard event (flags:0x%04" PRIX16 " code:0x%04" PRIX16 ")", + flags, code); if ((flags & 0x4000) && code == 0x22) /* 'g' key */ { @@ -702,7 +701,8 @@ BOOL tf_peer_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) BOOL tf_peer_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) { WINPR_UNUSED(input); - WLog_DBG(TAG, "Client sent a unicode keyboard event (flags:0x%04"PRIX16" code:0x%04"PRIX16")", + WLog_DBG(TAG, + "Client sent a unicode keyboard event (flags:0x%04" PRIX16 " code:0x%04" PRIX16 ")", flags, code); return TRUE; } @@ -710,22 +710,22 @@ BOOL tf_peer_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) BOOL tf_peer_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) { WINPR_UNUSED(flags); - //WLog_DBG(TAG, "Client sent a mouse event (flags:0x%04"PRIX16" pos:%"PRIu16",%"PRIu16")", flags, x, y); + // WLog_DBG(TAG, "Client sent a mouse event (flags:0x%04"PRIX16" pos:%"PRIu16",%"PRIu16")", + // flags, x, y); test_peer_draw_icon(input->context->peer, x + 10, y); return TRUE; } -BOOL tf_peer_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, - UINT16 y) +BOOL tf_peer_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) { WINPR_UNUSED(flags); - //WLog_DBG(TAG, "Client sent an extended mouse event (flags:0x%04"PRIX16" pos:%"PRIu16",%"PRIu16")", flags, x, y); + // WLog_DBG(TAG, "Client sent an extended mouse event (flags:0x%04"PRIX16" + // pos:%"PRIu16",%"PRIu16")", flags, x, y); test_peer_draw_icon(input->context->peer, x + 10, y); return TRUE; } -static BOOL tf_peer_refresh_rect(rdpContext* context, BYTE count, - const RECTANGLE_16* areas) +static BOOL tf_peer_refresh_rect(rdpContext* context, BYTE count, const RECTANGLE_16* areas) { BYTE i; WINPR_UNUSED(context); @@ -733,23 +733,22 @@ static BOOL tf_peer_refresh_rect(rdpContext* context, BYTE count, for (i = 0; i < count; i++) { - WLog_DBG(TAG, " (%"PRIu16", %"PRIu16") (%"PRIu16", %"PRIu16")", areas[i].left, areas[i].top, - areas[i].right, areas[i].bottom); + WLog_DBG(TAG, " (%" PRIu16 ", %" PRIu16 ") (%" PRIu16 ", %" PRIu16 ")", areas[i].left, + areas[i].top, areas[i].right, areas[i].bottom); } return TRUE; } -static BOOL tf_peer_suppress_output(rdpContext* context, BYTE allow, - const RECTANGLE_16* area) +static BOOL tf_peer_suppress_output(rdpContext* context, BYTE allow, const RECTANGLE_16* area) { WINPR_UNUSED(context); if (allow > 0) { - WLog_DBG(TAG, "Client restore output (%"PRIu16", %"PRIu16") (%"PRIu16", %"PRIu16").", area->left, - area->top, - area->right, area->bottom); + WLog_DBG(TAG, + "Client restore output (%" PRIu16 ", %" PRIu16 ") (%" PRIu16 ", %" PRIu16 ").", + area->left, area->top, area->right, area->bottom); } else { @@ -765,7 +764,7 @@ static DWORD WINAPI test_peer_mainloop(LPVOID arg) DWORD count; DWORD status; testPeerContext* context; - freerdp_peer* client = (freerdp_peer*) arg; + freerdp_peer* client = (freerdp_peer*)arg; if (!test_peer_init(client)) { @@ -778,8 +777,8 @@ static DWORD WINAPI test_peer_mainloop(LPVOID arg) client->settings->PrivateKeyFile = _strdup("server.key"); client->settings->RdpKeyFile = _strdup("server.key"); - if (!client->settings->CertificateFile || !client->settings->PrivateKeyFile - || !client->settings->RdpKeyFile) + if (!client->settings->CertificateFile || !client->settings->PrivateKeyFile || + !client->settings->RdpKeyFile) { WLog_ERR(TAG, "Memory allocation failed (strdup)"); freerdp_peer_free(client); @@ -808,9 +807,8 @@ static DWORD WINAPI test_peer_mainloop(LPVOID arg) client->update->SuppressOutput = tf_peer_suppress_output; client->settings->MultifragMaxRequestSize = 0xFFFFFF; /* FIXME */ client->Initialize(client); - context = (testPeerContext*) client->context; - WLog_INFO(TAG, "We've got a client %s", - client->local ? "(local)" : client->hostname); + context = (testPeerContext*)client->context; + WLog_INFO(TAG, "We've got a client %s", client->local ? "(local)" : client->hostname); while (1) { @@ -842,8 +840,7 @@ static DWORD WINAPI test_peer_mainloop(LPVOID arg) break; } - WLog_INFO(TAG, "Client %s disconnected.", - client->local ? "(local)" : client->hostname); + WLog_INFO(TAG, "Client %s disconnected.", client->local ? "(local)" : client->hostname); client->Disconnect(client); freerdp_peer_context_free(client); freerdp_peer_free(client); @@ -855,7 +852,7 @@ static BOOL test_peer_accepted(freerdp_listener* instance, freerdp_peer* client) HANDLE hThread; WINPR_UNUSED(instance); - if (!(hThread = CreateThread(NULL, 0, test_peer_mainloop, (void*) client, 0, NULL))) + if (!(hThread = CreateThread(NULL, 0, test_peer_mainloop, (void*)client, 0, NULL))) return FALSE; CloseHandle(hThread); @@ -956,10 +953,10 @@ int main(int argc, char* argv[]) return -1; } - if ((localOnly || instance->Open(instance, NULL, port)) && - instance->OpenLocal(instance, file)) + if ((localOnly || instance->Open(instance, NULL, port)) && instance->OpenLocal(instance, file)) { - /* Entering the server main loop. In a real server the listener can be run in its own thread. */ + /* Entering the server main loop. In a real server the listener can be run in its own + * thread. */ test_server_mainloop(instance); } @@ -968,4 +965,3 @@ int main(int argc, char* argv[]) WSACleanup(); return 0; } - diff --git a/server/Sample/sfreerdp.h b/server/Sample/sfreerdp.h index 529282efd..d9684b620 100644 --- a/server/Sample/sfreerdp.h +++ b/server/Sample/sfreerdp.h @@ -61,4 +61,3 @@ struct test_peer_context typedef struct test_peer_context testPeerContext; #endif /* FREERDP_SERVER_SAMPLE_SFREERDP_SERVER_H */ - diff --git a/server/Windows/cli/wfreerdp.c b/server/Windows/cli/wfreerdp.c index edcd23ad2..0a6e85f4a 100644 --- a/server/Windows/cli/wfreerdp.c +++ b/server/Windows/cli/wfreerdp.c @@ -40,8 +40,7 @@ int IDcount = 0; BOOL CALLBACK moncb(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) { - WLog_DBG(TAG, "%d\t(%ld, %ld), (%ld, %ld)", - IDcount, lprcMonitor->left, lprcMonitor->top, + WLog_DBG(TAG, "%d\t(%ld, %ld), (%ld, %ld)", IDcount, lprcMonitor->left, lprcMonitor->top, lprcMonitor->right, lprcMonitor->bottom); IDcount++; return TRUE; @@ -54,13 +53,13 @@ int main(int argc, char* argv[]) wfServer* server; server = wfreerdp_server_new(); set_screen_id(0); - //handle args + // handle args index = 1; errno = 0; while (index < argc) { - //first the args that will cause the program to terminate + // first the args that will cause the program to terminate if (strcmp("--list-screens", argv[index]) == 0) { _TCHAR name[128]; @@ -71,7 +70,7 @@ int main(int argc, char* argv[]) WLog_INFO(TAG, "Detecting screens..."); WLog_INFO(TAG, "ID\tResolution\t\tName (Interface)"); - for (i = 0; ; i++) + for (i = 0;; i++) { if (get_screen_info(i, name, &width, &height, &bpp) != 0) { @@ -145,7 +144,7 @@ int main(int argc, char* argv[]) WLog_INFO(TAG, "Detecting screens..."); WLog_INFO(TAG, "ID\tResolution\t\tName (Interface)"); - for (i = 0; ; i++) + for (i = 0;; i++) { if (get_screen_info(i, name, &width, &height, &bpp) != 0) { diff --git a/server/Windows/wf_directsound.c b/server/Windows/wf_directsound.c index ff69b210d..441397a0c 100644 --- a/server/Windows/wf_directsound.c +++ b/server/Windows/wf_directsound.c @@ -3,7 +3,6 @@ #include "wf_info.h" #include "wf_rdpsnd.h" - #include #define INITGUID @@ -34,8 +33,8 @@ int wf_directsound_activate(RdpsndServerContext* context) HRESULT hr; wfInfo* wfi; HANDLE hThread; - - LPDIRECTSOUNDCAPTUREBUFFER pDSCB; + + LPDIRECTSOUNDCAPTUREBUFFER pDSCB; wfi = wf_info_get_instance(); if (!wfi) @@ -97,11 +96,11 @@ static DWORD WINAPI wf_rdpsnd_directsound_thread(LPVOID lpParam) wfPeerContext* context; wfInfo* wfi; - VOID* pbCaptureData = NULL; + VOID* pbCaptureData = NULL; DWORD dwCaptureLength = 0; VOID* pbCaptureData2 = NULL; DWORD dwCaptureLength2 = 0; - VOID* pbPlayData = NULL; + VOID* pbPlayData = NULL; DWORD dwReadPos = 0; LONG lLockSize = 0; @@ -137,7 +136,7 @@ static DWORD WINAPI wf_rdpsnd_directsound_thread(LPVOID lpParam) if (wf_rdpsnd_lock() > 0) { - //check for main exit condition + // check for main exit condition if (wfi->snd_stop == TRUE) { wf_rdpsnd_unlock(); @@ -152,10 +151,12 @@ static DWORD WINAPI wf_rdpsnd_directsound_thread(LPVOID lpParam) break; } - lLockSize = dwReadPos - lastPos;//dscbd.dwBufferBytes; - if (lLockSize < 0) lLockSize += dscbd.dwBufferBytes; + lLockSize = dwReadPos - lastPos; // dscbd.dwBufferBytes; + if (lLockSize < 0) + lLockSize += dscbd.dwBufferBytes; - //WLog_DBG(TAG, "Last, read, lock = [%"PRIu32", %"PRIu32", %"PRId32"]\n", lastPos, dwReadPos, lLockSize); + // WLog_DBG(TAG, "Last, read, lock = [%"PRIu32", %"PRIu32", %"PRId32"]\n", lastPos, + // dwReadPos, lLockSize); if (lLockSize == 0) { @@ -163,8 +164,8 @@ static DWORD WINAPI wf_rdpsnd_directsound_thread(LPVOID lpParam) continue; } - - hr = capBuf->lpVtbl->Lock(capBuf, lastPos, lLockSize, &pbCaptureData, &dwCaptureLength, &pbCaptureData2, &dwCaptureLength2, 0L); + hr = capBuf->lpVtbl->Lock(capBuf, lastPos, lLockSize, &pbCaptureData, &dwCaptureLength, + &pbCaptureData2, &dwCaptureLength2, 0L); if (FAILED(hr)) { WLog_ERR(TAG, "Failed to lock sound capture buffer"); @@ -172,16 +173,18 @@ static DWORD WINAPI wf_rdpsnd_directsound_thread(LPVOID lpParam) break; } - //fwrite(pbCaptureData, 1, dwCaptureLength, pFile); - //fwrite(pbCaptureData2, 1, dwCaptureLength2, pFile); + // fwrite(pbCaptureData, 1, dwCaptureLength, pFile); + // fwrite(pbCaptureData2, 1, dwCaptureLength2, pFile); - //FIXME: frames = bytes/(bytespersample * channels) - - context->rdpsnd->SendSamples(context->rdpsnd, pbCaptureData, dwCaptureLength/4, (UINT16)(beg & 0xffff)); - context->rdpsnd->SendSamples(context->rdpsnd, pbCaptureData2, dwCaptureLength2/4, (UINT16)(beg & 0xffff)); + // FIXME: frames = bytes/(bytespersample * channels) + context->rdpsnd->SendSamples(context->rdpsnd, pbCaptureData, dwCaptureLength / 4, + (UINT16)(beg & 0xffff)); + context->rdpsnd->SendSamples(context->rdpsnd, pbCaptureData2, dwCaptureLength2 / 4, + (UINT16)(beg & 0xffff)); - hr = capBuf->lpVtbl->Unlock(capBuf, pbCaptureData, dwCaptureLength, pbCaptureData2, dwCaptureLength2); + hr = capBuf->lpVtbl->Unlock(capBuf, pbCaptureData, dwCaptureLength, pbCaptureData2, + dwCaptureLength2); if (FAILED(hr)) { WLog_ERR(TAG, "Failed to unlock sound capture buffer"); @@ -189,7 +192,7 @@ static DWORD WINAPI wf_rdpsnd_directsound_thread(LPVOID lpParam) return 0; } - //TODO keep track of location in buffer + // TODO keep track of location in buffer lastPos += dwCaptureLength; lastPos %= dscbd.dwBufferBytes; lastPos += dwCaptureLength2; @@ -197,8 +200,6 @@ static DWORD WINAPI wf_rdpsnd_directsound_thread(LPVOID lpParam) wf_rdpsnd_unlock(); } - - } WLog_INFO(TAG, "Trying to stop sound capture"); diff --git a/server/Windows/wf_dxgi.c b/server/Windows/wf_dxgi.c index 5a18fb150..fc2c91124 100644 --- a/server/Windows/wf_dxgi.c +++ b/server/Windows/wf_dxgi.c @@ -37,8 +37,7 @@ #define TAG SERVER_TAG("windows") /* Driver types supported */ -D3D_DRIVER_TYPE DriverTypes[] = -{ +D3D_DRIVER_TYPE DriverTypes[] = { D3D_DRIVER_TYPE_HARDWARE, D3D_DRIVER_TYPE_WARP, D3D_DRIVER_TYPE_REFERENCE, @@ -46,13 +45,8 @@ D3D_DRIVER_TYPE DriverTypes[] = UINT NumDriverTypes = ARRAYSIZE(DriverTypes); /* Feature levels supported */ -D3D_FEATURE_LEVEL FeatureLevels[] = -{ - D3D_FEATURE_LEVEL_11_0, - D3D_FEATURE_LEVEL_10_1, - D3D_FEATURE_LEVEL_10_0, - D3D_FEATURE_LEVEL_9_1 -}; +D3D_FEATURE_LEVEL FeatureLevels[] = { D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_10_1, + D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_9_1 }; UINT NumFeatureLevels = ARRAYSIZE(FeatureLevels); @@ -92,12 +86,14 @@ int wf_dxgi_createDevice(wfInfo* wfi) for (DriverTypeIndex = 0; DriverTypeIndex < NumDriverTypes; ++DriverTypeIndex) { - status = D3D11CreateDevice(NULL, DriverTypes[DriverTypeIndex], NULL, 0, FeatureLevels, NumFeatureLevels, - D3D11_SDK_VERSION, &gDevice, &FeatureLevel, &gContext); + status = D3D11CreateDevice(NULL, DriverTypes[DriverTypeIndex], NULL, 0, FeatureLevels, + NumFeatureLevels, D3D11_SDK_VERSION, &gDevice, &FeatureLevel, + &gContext); if (SUCCEEDED(status)) break; - WLog_INFO(TAG, "D3D11CreateDevice returned [%ld] for Driver Type %d", status, DriverTypes[DriverTypeIndex]); + WLog_INFO(TAG, "D3D11CreateDevice returned [%ld] for Driver Type %d", status, + DriverTypes[DriverTypeIndex]); } if (FAILED(status)) @@ -114,30 +110,30 @@ int wf_dxgi_getDuplication(wfInfo* wfi) HRESULT status; UINT dTop, i = 0; DXGI_OUTPUT_DESC desc; - IDXGIOutput * pOutput; + IDXGIOutput* pOutput; IDXGIDevice* DxgiDevice = NULL; IDXGIAdapter* DxgiAdapter = NULL; IDXGIOutput* DxgiOutput = NULL; IDXGIOutput1* DxgiOutput1 = NULL; - status = gDevice->lpVtbl->QueryInterface(gDevice, &IID_IDXGIDevice, (void**) &DxgiDevice); + status = gDevice->lpVtbl->QueryInterface(gDevice, &IID_IDXGIDevice, (void**)&DxgiDevice); if (FAILED(status)) { WLog_ERR(TAG, "Failed to get QI for DXGI Device"); return 1; } - - status = DxgiDevice->lpVtbl->GetParent(DxgiDevice, &IID_IDXGIAdapter, (void**) &DxgiAdapter); + + status = DxgiDevice->lpVtbl->GetParent(DxgiDevice, &IID_IDXGIAdapter, (void**)&DxgiAdapter); DxgiDevice->lpVtbl->Release(DxgiDevice); DxgiDevice = NULL; - + if (FAILED(status)) { WLog_ERR(TAG, "Failed to get parent DXGI Adapter"); return 1; } - + ZeroMemory(&desc, sizeof(desc)); pOutput = NULL; @@ -167,32 +163,37 @@ int wf_dxgi_getDuplication(wfInfo* wfi) status = DxgiAdapter->lpVtbl->EnumOutputs(DxgiAdapter, dTop, &DxgiOutput); DxgiAdapter->lpVtbl->Release(DxgiAdapter); DxgiAdapter = NULL; - + if (FAILED(status)) { WLog_ERR(TAG, "Failed to get output"); return 1; } - status = DxgiOutput->lpVtbl->QueryInterface(DxgiOutput, &IID_IDXGIOutput1, (void**) &DxgiOutput1); + status = + DxgiOutput->lpVtbl->QueryInterface(DxgiOutput, &IID_IDXGIOutput1, (void**)&DxgiOutput1); DxgiOutput->lpVtbl->Release(DxgiOutput); DxgiOutput = NULL; - + if (FAILED(status)) { WLog_ERR(TAG, "Failed to get IDXGIOutput1"); return 1; } - status = DxgiOutput1->lpVtbl->DuplicateOutput(DxgiOutput1, (IUnknown*)gDevice, &gOutputDuplication); + status = + DxgiOutput1->lpVtbl->DuplicateOutput(DxgiOutput1, (IUnknown*)gDevice, &gOutputDuplication); DxgiOutput1->lpVtbl->Release(DxgiOutput1); DxgiOutput1 = NULL; - + if (FAILED(status)) { if (status == DXGI_ERROR_NOT_CURRENTLY_AVAILABLE) { - WLog_ERR(TAG, "There is already the maximum number of applications using the Desktop Duplication API running, please close one of those applications and then try again."); + WLog_ERR( + TAG, + "There is already the maximum number of applications using the Desktop Duplication " + "API running, please close one of those applications and then try again."); return 1; } @@ -203,7 +204,6 @@ int wf_dxgi_getDuplication(wfInfo* wfi) return 0; } - int wf_dxgi_cleanup(wfInfo* wfi) { if (wfi->framesWaiting > 0) @@ -223,13 +223,13 @@ int wf_dxgi_cleanup(wfInfo* wfi) gOutputDuplication = NULL; } - if(gContext) + if (gContext) { gContext->lpVtbl->Release(gContext); gContext = NULL; } - if(gDevice) + if (gDevice) { gDevice->lpVtbl->Release(gDevice); gDevice = NULL; @@ -257,7 +257,8 @@ int wf_dxgi_nextFrame(wfInfo* wfi, UINT timeout) gAcquiredDesktopImage = NULL; } - status = gOutputDuplication->lpVtbl->AcquireNextFrame(gOutputDuplication, timeout, &FrameInfo, &DesktopResource); + status = gOutputDuplication->lpVtbl->AcquireNextFrame(gOutputDuplication, timeout, &FrameInfo, + &DesktopResource); if (status == DXGI_ERROR_WAIT_TIMEOUT) { @@ -281,7 +282,7 @@ int wf_dxgi_nextFrame(wfInfo* wfi, UINT timeout) { gOutputDuplication->lpVtbl->Release(gOutputDuplication); gOutputDuplication = NULL; - } + } wf_dxgi_getDuplication(wfi); @@ -296,18 +297,19 @@ int wf_dxgi_nextFrame(wfInfo* wfi, UINT timeout) { WLog_ERR(TAG, "Failed to release frame with status=%ld", status); } - + return 1; } } - - status = DesktopResource->lpVtbl->QueryInterface(DesktopResource, &IID_ID3D11Texture2D, (void**) &gAcquiredDesktopImage); + + status = DesktopResource->lpVtbl->QueryInterface(DesktopResource, &IID_ID3D11Texture2D, + (void**)&gAcquiredDesktopImage); DesktopResource->lpVtbl->Release(DesktopResource); DesktopResource = NULL; if (FAILED(status)) { - return 1; + return 1; } wfi->framesWaiting = FrameInfo.AccumulatedFrames; @@ -360,9 +362,10 @@ int wf_dxgi_getPixelData(wfInfo* wfi, BYTE** data, int* pitch, RECT* invalid) return 1; } - gContext->lpVtbl->CopySubresourceRegion(gContext, (ID3D11Resource*) sStage, 0,0,0,0, (ID3D11Resource*) gAcquiredDesktopImage, 0, &Box); - - status = sStage->lpVtbl->QueryInterface(sStage, &IID_IDXGISurface, (void**) &surf); + gContext->lpVtbl->CopySubresourceRegion(gContext, (ID3D11Resource*)sStage, 0, 0, 0, 0, + (ID3D11Resource*)gAcquiredDesktopImage, 0, &Box); + + status = sStage->lpVtbl->QueryInterface(sStage, &IID_IDXGISurface, (void**)&surf); if (FAILED(status)) { @@ -379,7 +382,7 @@ int wf_dxgi_getPixelData(wfInfo* wfi, BYTE** data, int* pitch, RECT* invalid) exit(1); return 1; } - + *data = mappedRect.pBits; *pitch = mappedRect.Pitch; @@ -436,8 +439,8 @@ int wf_dxgi_getInvalidRegion(RECT* invalid) DataBuffer = NULL; } - DataBuffer = (BYTE*) malloc(FrameInfo.TotalMetadataBufferSize); - + DataBuffer = (BYTE*)malloc(FrameInfo.TotalMetadataBufferSize); + if (!DataBuffer) { DataBufferSize = 0; @@ -450,7 +453,8 @@ int wf_dxgi_getInvalidRegion(RECT* invalid) BufSize = FrameInfo.TotalMetadataBufferSize; - status = gOutputDuplication->lpVtbl->GetFrameMoveRects(gOutputDuplication, BufSize, (DXGI_OUTDUPL_MOVE_RECT*) DataBuffer, &BufSize); + status = gOutputDuplication->lpVtbl->GetFrameMoveRects( + gOutputDuplication, BufSize, (DXGI_OUTDUPL_MOVE_RECT*)DataBuffer, &BufSize); if (FAILED(status)) { @@ -461,7 +465,8 @@ int wf_dxgi_getInvalidRegion(RECT* invalid) DirtyRects = DataBuffer + BufSize; BufSize = FrameInfo.TotalMetadataBufferSize - BufSize; - status = gOutputDuplication->lpVtbl->GetFrameDirtyRects(gOutputDuplication, BufSize, (RECT*) DirtyRects, &BufSize); + status = gOutputDuplication->lpVtbl->GetFrameDirtyRects(gOutputDuplication, BufSize, + (RECT*)DirtyRects, &BufSize); if (FAILED(status)) { @@ -470,9 +475,9 @@ int wf_dxgi_getInvalidRegion(RECT* invalid) } dirty = BufSize / sizeof(RECT); - pRect = (RECT*) DirtyRects; + pRect = (RECT*)DirtyRects; - for(i = 0; i -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * FreeRDP: A Remote Desktop Protocol Client + * FreeRDP Windows Server + * + * Copyright 2012 Corey Clayton + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -36,8 +36,7 @@ #include #define TAG SERVER_TAG("windows") -#define SERVER_KEY "Software\\"FREERDP_VENDOR_STRING"\\" \ - FREERDP_PRODUCT_STRING"\\Server" +#define SERVER_KEY "Software\\" FREERDP_VENDOR_STRING "\\" FREERDP_PRODUCT_STRING "\\Server" static wfInfo* wfInfoInstance = NULL; static int _IDcount = 0; @@ -100,7 +99,7 @@ BOOL wf_info_unlock(wfInfo* wfi) wfInfo* wf_info_init() { wfInfo* wfi; - wfi = (wfInfo*) calloc(1, sizeof(wfInfo)); + wfi = (wfInfo*)calloc(1, sizeof(wfInfo)); if (wfi != NULL) { @@ -139,7 +138,8 @@ wfInfo* wf_info_init() return NULL; } - wfi->peers = (freerdp_peer**) calloc(FREERDP_SERVER_WIN_INFO_MAXPEERS, sizeof(freerdp_peer*)); + wfi->peers = + (freerdp_peer**)calloc(FREERDP_SERVER_WIN_INFO_MAXPEERS, sizeof(freerdp_peer*)); if (!wfi->peers) { @@ -151,27 +151,27 @@ wfInfo* wf_info_init() return NULL; } - //Set FPS + // Set FPS wfi->framesPerSecond = FREERDP_SERVER_WIN_INFO_DEFAULT_FPS; - status = RegOpenKeyExA(HKEY_LOCAL_MACHINE, SERVER_KEY, 0, - KEY_READ | KEY_WOW64_64KEY, &hKey); + status = + RegOpenKeyExA(HKEY_LOCAL_MACHINE, SERVER_KEY, 0, KEY_READ | KEY_WOW64_64KEY, &hKey); if (status == ERROR_SUCCESS) { - if (RegQueryValueEx(hKey, _T("FramesPerSecond"), NULL, &dwType, (BYTE*) &dwValue, + if (RegQueryValueEx(hKey, _T("FramesPerSecond"), NULL, &dwType, (BYTE*)&dwValue, &dwSize) == ERROR_SUCCESS) wfi->framesPerSecond = dwValue; } RegCloseKey(hKey); - //Set input toggle + // Set input toggle wfi->input_disabled = FALSE; - status = RegOpenKeyExA(HKEY_LOCAL_MACHINE, SERVER_KEY, - 0, KEY_READ | KEY_WOW64_64KEY, &hKey); + status = + RegOpenKeyExA(HKEY_LOCAL_MACHINE, SERVER_KEY, 0, KEY_READ | KEY_WOW64_64KEY, &hKey); if (status == ERROR_SUCCESS) { - if (RegQueryValueEx(hKey, _T("DisableInput"), NULL, &dwType, (BYTE*) &dwValue, + if (RegQueryValueEx(hKey, _T("DisableInput"), NULL, &dwType, (BYTE*)&dwValue, &dwSize) == ERROR_SUCCESS) { if (dwValue != 0) @@ -212,7 +212,7 @@ BOOL wf_info_peer_register(wfInfo* wfi, wfPeerContext* context) if (!(context->updateEvent = CreateEvent(NULL, TRUE, FALSE, NULL))) goto fail_update_event; - //get the offset of the top left corner of selected screen + // get the offset of the top left corner of selected screen EnumDisplayMonitors(NULL, NULL, wf_info_monEnumCB, 0); _IDcount = 0; #ifdef WITH_DXGI_1_2 @@ -228,10 +228,10 @@ BOOL wf_info_peer_register(wfInfo* wfi, wfPeerContext* context) #endif - //look through the array of peers until an empty slot + // look through the array of peers until an empty slot for (i = 0; i < FREERDP_SERVER_WIN_INFO_MAXPEERS; ++i) { - //empty index will be our peer id + // empty index will be our peer id if (wfi->peers[i] == NULL) { peerId = i; @@ -239,7 +239,7 @@ BOOL wf_info_peer_register(wfInfo* wfi, wfPeerContext* context) } } - wfi->peers[peerId] = ((rdpContext*) context)->peer; + wfi->peers[peerId] = ((rdpContext*)context)->peer; wfi->peers[peerId]->pId = peerId; wfi->peerCount++; WLog_INFO(TAG, "Registering Peer: id=%d #=%d", peerId, wfi->peerCount); @@ -261,7 +261,7 @@ void wf_info_peer_unregister(wfInfo* wfi, wfPeerContext* context) if (wf_info_lock(wfi)) { int peerId; - peerId = ((rdpContext*) context)->peer->pId; + peerId = ((rdpContext*)context)->peer->pId; wfi->peers[peerId] = NULL; wfi->peerCount--; CloseHandle(context->updateEvent); @@ -273,7 +273,8 @@ void wf_info_peer_unregister(wfInfo* wfi, wfPeerContext* context) #endif wf_info_unlock(wfi); - wfreerdp_server_peer_callback_event(peerId, FREERDP_SERVER_WIN_SRV_CALLBACK_EVENT_DISCONNECT); + wfreerdp_server_peer_callback_event(peerId, + FREERDP_SERVER_WIN_SRV_CALLBACK_EVENT_DISCONNECT); } } @@ -299,7 +300,7 @@ void wf_info_update_changes(wfInfo* wfi) wf_dxgi_nextFrame(wfi, wfi->framesPerSecond * 1000); #else GETCHANGESBUF* buf; - buf = (GETCHANGESBUF*) wfi->changeBuffer; + buf = (GETCHANGESBUF*)wfi->changeBuffer; wfi->nextUpdate = buf->buffer->counter; #endif } @@ -311,13 +312,13 @@ void wf_info_find_invalid_region(wfInfo* wfi) #else int i; GETCHANGESBUF* buf; - buf = (GETCHANGESBUF*) wfi->changeBuffer; + buf = (GETCHANGESBUF*)wfi->changeBuffer; for (i = wfi->lastUpdate; i != wfi->nextUpdate; i = (i + 1) % MAXCHANGES_BUF) { LPRECT lpR = &buf->buffer->pointrect[i].rect; - //need to make sure we only get updates from the selected screen + // need to make sure we only get updates from the selected screen if ((lpR->left >= wfi->servscreen_xoffset) && (lpR->right <= (wfi->servscreen_xoffset + wfi->servscreen_width)) && (lpR->top >= wfi->servscreen_yoffset) && @@ -345,7 +346,8 @@ void wf_info_find_invalid_region(wfInfo* wfi) if (wfi->invalid.bottom >= wfi->servscreen_height) wfi->invalid.bottom = wfi->servscreen_height - 1; - //WLog_DBG(TAG, "invalid region: (%"PRId32", %"PRId32"), (%"PRId32", %"PRId32")", wfi->invalid.left, wfi->invalid.top, wfi->invalid.right, wfi->invalid.bottom); + // WLog_DBG(TAG, "invalid region: (%"PRId32", %"PRId32"), (%"PRId32", %"PRId32")", + // wfi->invalid.left, wfi->invalid.top, wfi->invalid.right, wfi->invalid.bottom); } void wf_info_clear_invalid_region(wfInfo* wfi) @@ -374,7 +376,7 @@ void wf_info_getScreenData(wfInfo* wfi, long* width, long* height, BYTE** pBits, { long offset; GETCHANGESBUF* changes; - changes = (GETCHANGESBUF*) wfi->changeBuffer; + changes = (GETCHANGESBUF*)wfi->changeBuffer; *width += 1; *height += 1; offset = (4 * wfi->invalid.left) + (wfi->invalid.top * wfi->virtscreen_width * 4); diff --git a/server/Windows/wf_info.h b/server/Windows/wf_info.h index affa7e827..82b1781b5 100644 --- a/server/Windows/wf_info.h +++ b/server/Windows/wf_info.h @@ -40,6 +40,7 @@ void wf_info_clear_invalid_region(wfInfo* wfi); void wf_info_invalidate_full_screen(wfInfo* wfi); BOOL wf_info_have_invalid_region(wfInfo* wfi); void wf_info_getScreenData(wfInfo* wfi, long* width, long* height, BYTE** pBits, int* pitch); -BOOL CALLBACK wf_info_monEnumCB(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData); +BOOL CALLBACK wf_info_monEnumCB(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, + LPARAM dwData); #endif /* FREERDP_SERVER_WIN_INFO_H */ diff --git a/server/Windows/wf_input.c b/server/Windows/wf_input.c index fb4faef33..56ba8cd8d 100644 --- a/server/Windows/wf_input.c +++ b/server/Windows/wf_input.c @@ -91,13 +91,13 @@ BOOL wf_peer_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) if (!wfi) return FALSE; - //width and height of primary screen (even in multimon setups - width = (float) GetSystemMetrics(SM_CXSCREEN); - height = (float) GetSystemMetrics(SM_CYSCREEN); + // width and height of primary screen (even in multimon setups + width = (float)GetSystemMetrics(SM_CXSCREEN); + height = (float)GetSystemMetrics(SM_CYSCREEN); x += wfi->servscreen_xoffset; y += wfi->servscreen_yoffset; - mouse_event.mi.dx = (LONG)((float) x * (65535.0f / width)); - mouse_event.mi.dy = (LONG)((float) y * (65535.0f / height)); + mouse_event.mi.dx = (LONG)((float)x * (65535.0f / width)); + mouse_event.mi.dy = (LONG)((float)y * (65535.0f / height)); mouse_event.mi.dwFlags = MOUSEEVENTF_ABSOLUTE; if (flags & PTR_FLAGS_MOVE) @@ -157,13 +157,13 @@ BOOL wf_peer_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT1 if (!wfi) return FALSE; - //width and height of primary screen (even in multimon setups - width = (float) GetSystemMetrics(SM_CXSCREEN); - height = (float) GetSystemMetrics(SM_CYSCREEN); + // width and height of primary screen (even in multimon setups + width = (float)GetSystemMetrics(SM_CXSCREEN); + height = (float)GetSystemMetrics(SM_CYSCREEN); x += wfi->servscreen_xoffset; y += wfi->servscreen_yoffset; - mouse_event.mi.dx = (LONG)((float) x * (65535.0f / width)); - mouse_event.mi.dy = (LONG)((float) y * (65535.0f / height)); + mouse_event.mi.dx = (LONG)((float)x * (65535.0f / width)); + mouse_event.mi.dy = (LONG)((float)y * (65535.0f / height)); mouse_event.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE; SendInput(1, &mouse_event, sizeof(INPUT)); } diff --git a/server/Windows/wf_input.h b/server/Windows/wf_input.h index c459787c2..b4e8c5778 100644 --- a/server/Windows/wf_input.h +++ b/server/Windows/wf_input.h @@ -27,7 +27,7 @@ BOOL wf_peer_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code); BOOL wf_peer_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y); BOOL wf_peer_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y); -//dummy versions +// dummy versions BOOL wf_peer_keyboard_event_dummy(rdpInput* input, UINT16 flags, UINT16 code); BOOL wf_peer_unicode_keyboard_event_dummy(rdpInput* input, UINT16 flags, UINT16 code); BOOL wf_peer_mouse_event_dummy(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y); diff --git a/server/Windows/wf_interface.c b/server/Windows/wf_interface.c index 2e688b99f..cd801e914 100644 --- a/server/Windows/wf_interface.c +++ b/server/Windows/wf_interface.c @@ -41,8 +41,7 @@ #define TAG SERVER_TAG("windows") -#define SERVER_KEY "Software\\"FREERDP_VENDOR_STRING"\\" \ - FREERDP_PRODUCT_STRING"\\Server" +#define SERVER_KEY "Software\\" FREERDP_VENDOR_STRING "\\" FREERDP_PRODUCT_STRING "\\Server" cbCallback cbEvent; @@ -64,9 +63,8 @@ int get_screen_info(int id, _TCHAR* name, int* width, int* height, int* bpp) *width = GetDeviceCaps(dc, HORZRES); *height = GetDeviceCaps(dc, VERTRES); *bpp = GetDeviceCaps(dc, BITSPIXEL); - //ReleaseDC(NULL, dc); + // ReleaseDC(NULL, dc); DeleteDC(dc); - } else { @@ -108,9 +106,9 @@ static DWORD WINAPI wf_server_main_loop(LPVOID lpParam) wfi->force_all_disconnect = FALSE; ZeroMemory(rfds, sizeof(rfds)); - instance = (freerdp_listener*) lpParam; + instance = (freerdp_listener*)lpParam; - while(wfi->force_all_disconnect == FALSE) + while (wfi->force_all_disconnect == FALSE) { rcount = 0; @@ -136,7 +134,6 @@ static DWORD WINAPI wf_server_main_loop(LPVOID lpParam) if (max_fds == 0) break; - select(max_fds + 1, &rfds_set, NULL, NULL, NULL); if (instance->CheckFileDescriptor(instance) != TRUE) @@ -160,13 +157,12 @@ BOOL wfreerdp_server_start(wfServer* server) server->instance->PeerAccepted = wf_peer_accepted; instance = server->instance; - wf_settings_read_dword(HKEY_LOCAL_MACHINE, SERVER_KEY, - _T("DefaultPort"), &server->port); + wf_settings_read_dword(HKEY_LOCAL_MACHINE, SERVER_KEY, _T("DefaultPort"), &server->port); - if (!instance->Open(instance, NULL, (UINT16) server->port)) + if (!instance->Open(instance, NULL, (UINT16)server->port)) return FALSE; - if (!(server->thread = CreateThread(NULL, 0, wf_server_main_loop, (void*) instance, 0, NULL))) + if (!(server->thread = CreateThread(NULL, 0, wf_server_main_loop, (void*)instance, 0, NULL))) return FALSE; return TRUE; @@ -193,7 +189,7 @@ wfServer* wfreerdp_server_new() if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) return NULL; - server = (wfServer*) calloc(1, sizeof(wfServer)); + server = (wfServer*)calloc(1, sizeof(wfServer)); if (server) { @@ -241,7 +237,7 @@ UINT32 wfreerdp_server_num_peers() return wfi->peerCount; } -UINT32 wfreerdp_server_get_peer_hostname(int pId, wchar_t * dstStr) +UINT32 wfreerdp_server_get_peer_hostname(int pId, wchar_t* dstStr) { wfInfo* wfi; freerdp_peer* peer; @@ -296,7 +292,6 @@ BOOL wfreerdp_server_peer_is_connected(int pId) return FALSE; peer = wfi->peers[pId]; - if (peer) { return peer->connected; @@ -357,4 +352,3 @@ void wfreerdp_server_peer_callback_event(int pId, UINT32 eType) if (cbEvent) cbEvent(pId, eType); } - diff --git a/server/Windows/wf_interface.h b/server/Windows/wf_interface.h index 1fbe223ae..e62838dd1 100644 --- a/server/Windows/wf_interface.h +++ b/server/Windows/wf_interface.h @@ -1,22 +1,22 @@ /** -* FreeRDP: A Remote Desktop Protocol Client -* FreeRDP Windows Server -* -* Copyright 2012 Marc-Andre Moreau -* Copyright 2012 Corey Clayton -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * FreeRDP: A Remote Desktop Protocol Client + * FreeRDP Windows Server + * + * Copyright 2012 Marc-Andre Moreau + * Copyright 2012 Corey Clayton + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef FREERDP_SERVER_WIN_INTERFACE_H #define FREERDP_SERVER_WIN_INTERFACE_H @@ -33,7 +33,7 @@ #include #if _WIN32_WINNT >= 0x0602 -#define WITH_DXGI_1_2 1 +#define WITH_DXGI_1_2 1 #endif #define FREERDP_SERVER_WIN_SRV_CALLBACK_EVENT_CONNECT 1 @@ -48,7 +48,7 @@ struct wf_info { wStream* s; - //screen and monitor info + // screen and monitor info int screenID; int virtscreen_width; int virtscreen_height; @@ -113,7 +113,7 @@ struct wf_server }; typedef struct wf_server wfServer; -typedef void (__stdcall* cbCallback) (int, UINT32); +typedef void(__stdcall* cbCallback)(int, UINT32); FREERDP_API int get_screen_info(int id, _TCHAR* name, int* w, int* h, int* b); FREERDP_API void set_screen_id(int id); @@ -127,7 +127,7 @@ FREERDP_API void wfreerdp_server_free(wfServer* server); FREERDP_API BOOL wfreerdp_server_is_running(wfServer* server); FREERDP_API UINT32 wfreerdp_server_num_peers(void); -FREERDP_API UINT32 wfreerdp_server_get_peer_hostname(int pId, wchar_t * dstStr); +FREERDP_API UINT32 wfreerdp_server_get_peer_hostname(int pId, wchar_t* dstStr); FREERDP_API BOOL wfreerdp_server_peer_is_local(int pId); FREERDP_API BOOL wfreerdp_server_peer_is_connected(int pId); FREERDP_API BOOL wfreerdp_server_peer_is_activated(int pId); diff --git a/server/Windows/wf_mirage.c b/server/Windows/wf_mirage.c index 69d0882d0..272bcbc64 100644 --- a/server/Windows/wf_mirage.c +++ b/server/Windows/wf_mirage.c @@ -26,7 +26,7 @@ #include #define TAG SERVER_TAG("Windows.mirror") -#define DEVICE_KEY_PREFIX _T("\\Registry\\Machine\\") +#define DEVICE_KEY_PREFIX _T("\\Registry\\Machine\\") /* This function will iterate over the loaded display devices until it finds the mirror device we want to load. If found, it will then copy the registry @@ -54,7 +54,7 @@ BOOL wf_mirror_driver_find_display_device(wfInfo* wfi) if (_tcsnicmp(deviceInfo.DeviceKey, DEVICE_KEY_PREFIX, deviceKeyPrefixLength) == 0) { deviceKeyLength = _tcslen(deviceInfo.DeviceKey) - deviceKeyPrefixLength; - wfi->deviceKey = (LPTSTR) malloc((deviceKeyLength + 1) * sizeof(TCHAR)); + wfi->deviceKey = (LPTSTR)malloc((deviceKeyLength + 1) * sizeof(TCHAR)); if (!wfi->deviceKey) return FALSE; @@ -90,8 +90,8 @@ BOOL wf_mirror_driver_display_device_attach(wfInfo* wfi, DWORD mode) DWORD dwType; DWORD dwSize; DWORD dwValue; - status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, wfi->deviceKey, - 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, &hKey); + status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, wfi->deviceKey, 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, + &hKey); if (status != ERROR_SUCCESS) { @@ -104,8 +104,7 @@ BOOL wf_mirror_driver_display_device_attach(wfInfo* wfi, DWORD mode) } dwSize = sizeof(DWORD); - status = RegQueryValueEx(hKey, _T("Attach.ToDesktop"), - NULL, &dwType, (BYTE*) &dwValue, &dwSize); + status = RegQueryValueEx(hKey, _T("Attach.ToDesktop"), NULL, &dwType, (BYTE*)&dwValue, &dwSize); if (status != ERROR_SUCCESS) { @@ -117,12 +116,11 @@ BOOL wf_mirror_driver_display_device_attach(wfInfo* wfi, DWORD mode) return FALSE; } - if (dwValue ^ mode) //only if we want to change modes + if (dwValue ^ mode) // only if we want to change modes { dwValue = mode; dwSize = sizeof(DWORD); - status = RegSetValueEx(hKey, _T("Attach.ToDesktop"), - 0, REG_DWORD, (BYTE*) &dwValue, dwSize); + status = RegSetValueEx(hKey, _T("Attach.ToDesktop"), 0, REG_DWORD, (BYTE*)&dwValue, dwSize); if (status != ERROR_SUCCESS) { @@ -211,13 +209,13 @@ BOOL wf_mirror_driver_update(wfInfo* wfi, int mode) return FALSE; } - deviceMode = (DEVMODE*) malloc(sizeof(DEVMODE) + EXT_DEVMODE_SIZE_MAX); + deviceMode = (DEVMODE*)malloc(sizeof(DEVMODE) + EXT_DEVMODE_SIZE_MAX); if (!deviceMode) return FALSE; deviceMode->dmDriverExtra = 2 * sizeof(DWORD); - extHdr = (DWORD*)((BYTE*) &deviceMode + sizeof(DEVMODE)); + extHdr = (DWORD*)((BYTE*)&deviceMode + sizeof(DEVMODE)); extHdr[0] = dmf_devmodewext_magic_sig; extHdr[1] = 0; drvExtraSaved = deviceMode->dmDriverExtra; @@ -238,8 +236,8 @@ BOOL wf_mirror_driver_update(wfInfo* wfi, int mode) deviceMode->dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_POSITION; _tcsncpy_s(deviceMode->dmDeviceName, 32, wfi->deviceName, _tcslen(wfi->deviceName)); - disp_change_status = ChangeDisplaySettingsEx(wfi->deviceName, deviceMode, NULL, CDS_UPDATEREGISTRY, - NULL); + disp_change_status = + ChangeDisplaySettingsEx(wfi->deviceName, deviceMode, NULL, CDS_UPDATEREGISTRY, NULL); status = (disp_change_status == DISP_CHANGE_SUCCESSFUL) ? TRUE : FALSE; if (!status) @@ -259,17 +257,13 @@ BOOL wf_mirror_driver_map_memory(wfInfo* wfi) { LPVOID lpMsgBuf; DWORD dw = GetLastError(); - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - dw, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &lpMsgBuf, - 0, NULL); + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, + NULL); // Display the error message and exit the process - WLog_ERR(TAG, "CreateDC failed on device [%s] with error %lu: %s", wfi->deviceName, dw, lpMsgBuf); + WLog_ERR(TAG, "CreateDC failed on device [%s] with error %lu: %s", wfi->deviceName, dw, + lpMsgBuf); LocalFree(lpMsgBuf); } return FALSE; @@ -281,7 +275,7 @@ BOOL wf_mirror_driver_map_memory(wfInfo* wfi) return FALSE; status = ExtEscape(wfi->driverDC, dmf_esc_usm_pipe_map, 0, 0, sizeof(GETCHANGESBUF), - (LPSTR) wfi->changeBuffer); + (LPSTR)wfi->changeBuffer); if (status <= 0) { @@ -298,7 +292,7 @@ BOOL wf_mirror_driver_cleanup(wfInfo* wfi) { int status; status = ExtEscape(wfi->driverDC, dmf_esc_usm_pipe_unmap, sizeof(GETCHANGESBUF), - (LPSTR) wfi->changeBuffer, 0, 0); + (LPSTR)wfi->changeBuffer, 0, 0); if (status <= 0) { diff --git a/server/Windows/wf_mirage.h b/server/Windows/wf_mirage.h index b88971871..a03f0b95f 100644 --- a/server/Windows/wf_mirage.h +++ b/server/Windows/wf_mirage.h @@ -29,24 +29,22 @@ enum MIRROR_UNLOAD = 1 }; - - enum { DMF_ESCAPE_BASE_1_VB = 1030, - DMF_ESCAPE_BASE_2_VB = 1026, + DMF_ESCAPE_BASE_2_VB = 1026, DMF_ESCAPE_BASE_3_VB = 24 }; -#ifdef _WIN64 +#ifdef _WIN64 -#define CLIENT_64BIT 0x8000 +#define CLIENT_64BIT 0x8000 enum { DMF_ESCAPE_BASE_1 = CLIENT_64BIT | DMF_ESCAPE_BASE_1_VB, - DMF_ESCAPE_BASE_2 = CLIENT_64BIT | DMF_ESCAPE_BASE_2_VB, - DMF_ESCAPE_BASE_3 = CLIENT_64BIT | DMF_ESCAPE_BASE_3_VB, + DMF_ESCAPE_BASE_2 = CLIENT_64BIT | DMF_ESCAPE_BASE_2_VB, + DMF_ESCAPE_BASE_3 = CLIENT_64BIT | DMF_ESCAPE_BASE_3_VB, }; #else @@ -54,8 +52,8 @@ enum enum { DMF_ESCAPE_BASE_1 = DMF_ESCAPE_BASE_1_VB, - DMF_ESCAPE_BASE_2 = DMF_ESCAPE_BASE_2_VB, - DMF_ESCAPE_BASE_3 = DMF_ESCAPE_BASE_3_VB, + DMF_ESCAPE_BASE_2 = DMF_ESCAPE_BASE_2_VB, + DMF_ESCAPE_BASE_3 = DMF_ESCAPE_BASE_3_VB, }; #endif @@ -71,8 +69,8 @@ typedef enum } dmf_escape; -#define CLIP_LIMIT 50 -#define MAXCHANGES_BUF 20000 +#define CLIP_LIMIT 50 +#define MAXCHANGES_BUF 20000 typedef enum { @@ -94,9 +92,9 @@ typedef enum dmf_dfn_assert_off = 65, } dmf_UpdEvent; -#define NOCACHE 1 -#define OLDCACHE 2 -#define NEWCACHE 3 +#define NOCACHE 1 +#define OLDCACHE 2 +#define NEWCACHE 3 typedef struct { @@ -118,19 +116,19 @@ typedef struct CHANGES_RECORD pointrect[MAXCHANGES_BUF]; } CHANGES_BUF; -#define EXT_DEVMODE_SIZE_MAX 3072 -#define DMF_PIPE_SEC_SIZE_DEFAULT ALIGN64K(sizeof(CHANGES_BUF)) +#define EXT_DEVMODE_SIZE_MAX 3072 +#define DMF_PIPE_SEC_SIZE_DEFAULT ALIGN64K(sizeof(CHANGES_BUF)) typedef struct { - CHANGES_BUF* buffer; - PVOID Userbuffer; + CHANGES_BUF* buffer; + PVOID Userbuffer; } GETCHANGESBUF; -#define dmf_sprb_ERRORMASK 0x07FF -#define dmf_sprb_STRICTSESSION_AFF 0x1FFF +#define dmf_sprb_ERRORMASK 0x07FF +#define dmf_sprb_STRICTSESSION_AFF 0x1FFF -typedef enum +typedef enum { dmf_sprb_internal_error = 0x0001, dmf_sprb_miniport_gen_error = 0x0004, @@ -144,11 +142,11 @@ typedef enum dmf_sprb_pdev_detached = 0x2000, } dmf_session_prob_status; -#define DMF_ESC_RET_FAILF 0x80000000 -#define DMF_ESC_RET_SSTMASK 0x0000FFFF -#define DMF_ESC_RET_IMMMASK 0x7FFF0000 +#define DMF_ESC_RET_FAILF 0x80000000 +#define DMF_ESC_RET_SSTMASK 0x0000FFFF +#define DMF_ESC_RET_IMMMASK 0x7FFF0000 -typedef enum +typedef enum { dmf_escret_generic_ok = 0x00010000, dmf_escret_bad_state = 0x00100000, @@ -176,8 +174,8 @@ enum esc_qvi_prod_name_max = 16, }; -#define ESC_QVI_PROD_MIRAGE "MIRAGE" -#define ESC_QVI_PROD_QUASAR "QUASAR" +#define ESC_QVI_PROD_MIRAGE "MIRAGE" +#define ESC_QVI_PROD_QUASAR "QUASAR" typedef struct { diff --git a/server/Windows/wf_peer.c b/server/Windows/wf_peer.c index ec5dd8c14..5a5e96a7b 100644 --- a/server/Windows/wf_peer.c +++ b/server/Windows/wf_peer.c @@ -1,22 +1,22 @@ /** -* FreeRDP: A Remote Desktop Protocol Client -* FreeRDP Windows Server -* -* Copyright 2012 Marc-Andre Moreau -* Copyright 2012 Corey Clayton -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * FreeRDP: A Remote Desktop Protocol Client + * FreeRDP Windows Server + * + * Copyright 2012 Marc-Andre Moreau + * Copyright 2012 Corey Clayton + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -42,8 +42,7 @@ #define TAG SERVER_TAG("windows") -#define SERVER_KEY "Software\\"FREERDP_VENDOR_STRING"\\" \ - FREERDP_PRODUCT_STRING +#define SERVER_KEY "Software\\" FREERDP_VENDOR_STRING "\\" FREERDP_PRODUCT_STRING static DWORD WINAPI wf_peer_main_loop(LPVOID lpParam); @@ -52,7 +51,7 @@ static BOOL wf_peer_context_new(freerdp_peer* client, wfPeerContext* context) if (!(context->info = wf_info_get_instance())) return FALSE; - context->vcm = WTSOpenServerA((LPSTR) client->context); + context->vcm = WTSOpenServerA((LPSTR)client->context); if (!context->vcm || context->vcm == INVALID_HANDLE_VALUE) return FALSE; @@ -85,8 +84,8 @@ static void wf_peer_context_free(freerdp_peer* client, wfPeerContext* context) static BOOL wf_peer_init(freerdp_peer* client) { client->ContextSize = sizeof(wfPeerContext); - client->ContextNew = (psPeerContextNew) wf_peer_context_new; - client->ContextFree = (psPeerContextFree) wf_peer_context_free; + client->ContextNew = (psPeerContextNew)wf_peer_context_new; + client->ContextFree = (psPeerContextFree)wf_peer_context_free; return freerdp_peer_context_new(client); } @@ -94,18 +93,17 @@ static BOOL wf_peer_post_connect(freerdp_peer* client) { wfInfo* wfi; rdpSettings* settings; - wfPeerContext* context = (wfPeerContext*) client->context; + wfPeerContext* context = (wfPeerContext*)client->context; wfi = context->info; settings = client->settings; if ((get_screen_info(wfi->screenID, NULL, &wfi->servscreen_width, &wfi->servscreen_height, &wfi->bitsPerPixel) == 0) || - (wfi->servscreen_width == 0) || - (wfi->servscreen_height == 0) || - (wfi->bitsPerPixel == 0)) + (wfi->servscreen_width == 0) || (wfi->servscreen_height == 0) || (wfi->bitsPerPixel == 0)) { WLog_ERR(TAG, "postconnect: error getting screen info for screen %d", wfi->screenID); - WLog_ERR(TAG, "\t%dx%dx%d", wfi->servscreen_height, wfi->servscreen_width, wfi->bitsPerPixel); + WLog_ERR(TAG, "\t%dx%dx%d", wfi->servscreen_height, wfi->servscreen_width, + wfi->bitsPerPixel); return FALSE; } @@ -114,8 +112,9 @@ static BOOL wf_peer_post_connect(freerdp_peer* client) { /* WLog_DBG(TAG, "Client requested resolution %"PRIu32"x%"PRIu32", but will resize to %dx%d", - settings->DesktopWidth, settings->DesktopHeight, wfi->servscreen_width, wfi->servscreen_height); - */ + settings->DesktopWidth, settings->DesktopHeight, wfi->servscreen_width, + wfi->servscreen_height); + */ settings->DesktopWidth = wfi->servscreen_width; settings->DesktopHeight = wfi->servscreen_height; settings->ColorDepth = wfi->bitsPerPixel; @@ -133,18 +132,18 @@ static BOOL wf_peer_post_connect(freerdp_peer* client) static BOOL wf_peer_activate(freerdp_peer* client) { wfInfo* wfi; - wfPeerContext* context = (wfPeerContext*) client->context; + wfPeerContext* context = (wfPeerContext*)client->context; wfi = context->info; client->activated = TRUE; wf_update_peer_activate(wfi, context); - wfreerdp_server_peer_callback_event(((rdpContext*) context)->peer->pId, + wfreerdp_server_peer_callback_event(((rdpContext*)context)->peer->pId, FREERDP_SERVER_WIN_SRV_CALLBACK_EVENT_ACTIVATE); return TRUE; } static BOOL wf_peer_logon(freerdp_peer* client, SEC_WINNT_AUTH_IDENTITY* identity, BOOL automatic) { - wfreerdp_server_peer_callback_event(((rdpContext*) client->context)->peer->pId, + wfreerdp_server_peer_callback_event(((rdpContext*)client->context)->peer->pId, FREERDP_SERVER_WIN_SRV_CALLBACK_EVENT_AUTH); return TRUE; } @@ -173,9 +172,9 @@ static DWORD WINAPI wf_peer_socket_listener(LPVOID lpParam) void* rfds[32]; fd_set rfds_set; wfPeerContext* context; - freerdp_peer* client = (freerdp_peer*) lpParam; + freerdp_peer* client = (freerdp_peer*)lpParam; ZeroMemory(rfds, sizeof(rfds)); - context = (wfPeerContext*) client->context; + context = (wfPeerContext*)client->context; while (1) { @@ -216,8 +215,8 @@ static DWORD WINAPI wf_peer_socket_listener(LPVOID lpParam) static BOOL wf_peer_read_settings(freerdp_peer* client) { - if (!wf_settings_read_string_ascii(HKEY_LOCAL_MACHINE, SERVER_KEY, - _T("CertificateFile"), &(client->settings->CertificateFile))) + if (!wf_settings_read_string_ascii(HKEY_LOCAL_MACHINE, SERVER_KEY, _T("CertificateFile"), + &(client->settings->CertificateFile))) { client->settings->CertificateFile = _strdup("server.crt"); @@ -225,8 +224,8 @@ static BOOL wf_peer_read_settings(freerdp_peer* client) return FALSE; } - if (!wf_settings_read_string_ascii(HKEY_LOCAL_MACHINE, SERVER_KEY, - _T("PrivateKeyFile"), &(client->settings->PrivateKeyFile))) + if (!wf_settings_read_string_ascii(HKEY_LOCAL_MACHINE, SERVER_KEY, _T("PrivateKeyFile"), + &(client->settings->PrivateKeyFile))) { client->settings->PrivateKeyFile = _strdup("server.key"); @@ -245,7 +244,7 @@ DWORD WINAPI wf_peer_main_loop(LPVOID lpParam) HANDLE handles[32]; rdpSettings* settings; wfPeerContext* context; - freerdp_peer* client = (freerdp_peer*) lpParam; + freerdp_peer* client = (freerdp_peer*)lpParam; if (!wf_peer_init(client)) goto fail_peer_init; @@ -271,7 +270,7 @@ DWORD WINAPI wf_peer_main_loop(LPVOID lpParam) if (!client->Initialize(client)) goto fail_client_initialize; - context = (wfPeerContext*) client->context; + context = (wfPeerContext*)client->context; if (context->socketClose) goto fail_socked_closed; @@ -335,7 +334,7 @@ DWORD WINAPI wf_peer_main_loop(LPVOID lpParam) break; } - //force disconnect + // force disconnect if (wfi->force_all_disconnect == TRUE) { WLog_INFO(TAG, "Forcing Disconnect -> "); diff --git a/server/Windows/wf_rdpsnd.c b/server/Windows/wf_rdpsnd.c index 84be3067c..946deea5d 100644 --- a/server/Windows/wf_rdpsnd.c +++ b/server/Windows/wf_rdpsnd.c @@ -53,15 +53,16 @@ static void wf_peer_rdpsnd_activated(RdpsndServerContext* context) for (i = 0; i < context->num_client_formats; i++) { - //TODO: improve the way we agree on a format + // TODO: improve the way we agree on a format for (j = 0; j < context->num_server_formats; j++) { if ((context->client_formats[i].wFormatTag == context->server_formats[j].wFormatTag) && (context->client_formats[i].nChannels == context->server_formats[j].nChannels) && - (context->client_formats[i].nSamplesPerSec == context->server_formats[j].nSamplesPerSec)) + (context->client_formats[i].nSamplesPerSec == + context->server_formats[j].nSamplesPerSec)) { WLog_DBG(TAG, "agreed on format!"); - wfi->agreed_format = (AUDIO_FORMAT*) &context->server_formats[j]; + wfi->agreed_format = (AUDIO_FORMAT*)&context->server_formats[j]; break; } } @@ -139,7 +140,8 @@ BOOL wf_peer_rdpsnd_init(wfPeerContext* context) context->rdpsnd = rdpsnd_server_context_new(context->vcm); context->rdpsnd->rdpcontext = &context->_p; context->rdpsnd->data = context; - context->rdpsnd->num_server_formats = server_rdpsnd_get_formats(&context->rdpsnd->server_formats); + context->rdpsnd->num_server_formats = + server_rdpsnd_get_formats(&context->rdpsnd->server_formats); if (context->rdpsnd->num_server_formats > 0) context->rdpsnd->src_format = &context->rdpsnd->server_formats[0]; @@ -150,4 +152,3 @@ BOOL wf_peer_rdpsnd_init(wfPeerContext* context) wfi->snd_stop = FALSE; return TRUE; } - diff --git a/server/Windows/wf_rdpsnd.h b/server/Windows/wf_rdpsnd.h index 9a82664e2..88e631d97 100644 --- a/server/Windows/wf_rdpsnd.h +++ b/server/Windows/wf_rdpsnd.h @@ -30,6 +30,4 @@ int wf_rdpsnd_lock(void); int wf_rdpsnd_unlock(void); BOOL wf_peer_rdpsnd_init(wfPeerContext* context); - #endif /* FREERDP_SERVER_WIN_RDPSND_H */ - diff --git a/server/Windows/wf_settings.c b/server/Windows/wf_settings.c index bbbdedd4c..15dc541a0 100644 --- a/server/Windows/wf_settings.c +++ b/server/Windows/wf_settings.c @@ -40,7 +40,7 @@ BOOL wf_settings_read_dword(HKEY key, LPCSTR subkey, LPTSTR name, DWORD* value) { dwSize = sizeof(DWORD); - status = RegQueryValueEx(hKey, name, NULL, &dwType, (BYTE*) &dwValue, &dwSize); + status = RegQueryValueEx(hKey, name, NULL, &dwType, (BYTE*)&dwValue, &dwSize); if (status == ERROR_SUCCESS) *value = dwValue; @@ -72,10 +72,10 @@ BOOL wf_settings_read_string_ascii(HKEY key, LPCSTR subkey, LPTSTR name, char** if (status == ERROR_SUCCESS) { - strX = (LPTSTR) malloc(dwSize + sizeof(TCHAR)); + strX = (LPTSTR)malloc(dwSize + sizeof(TCHAR)); if (!strX) return FALSE; - status = RegQueryValueEx(hKey, name, NULL, &dwType, (BYTE*) strX, &dwSize); + status = RegQueryValueEx(hKey, name, NULL, &dwType, (BYTE*)strX, &dwSize); if (status != ERROR_SUCCESS) { @@ -89,12 +89,12 @@ BOOL wf_settings_read_string_ascii(HKEY key, LPCSTR subkey, LPTSTR name, char** { #ifdef UNICODE length = WideCharToMultiByte(CP_UTF8, 0, strX, lstrlenW(strX), NULL, 0, NULL, NULL); - strA = (char*) malloc(length + 1); + strA = (char*)malloc(length + 1); WideCharToMultiByte(CP_UTF8, 0, strX, lstrlenW(strX), strA, length, NULL, NULL); strA[length] = '\0'; free(strX); #else - strA = (char*) strX; + strA = (char*)strX; #endif *value = strA; return TRUE; diff --git a/server/Windows/wf_update.c b/server/Windows/wf_update.c index 4b93df9d8..21a4c72b2 100644 --- a/server/Windows/wf_update.c +++ b/server/Windows/wf_update.c @@ -1,22 +1,22 @@ /** -* FreeRDP: A Remote Desktop Protocol Client -* FreeRDP Windows Server -* -* Copyright 2012 Marc-Andre Moreau -* Copyright 2012 Corey Clayton -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * FreeRDP: A Remote Desktop Protocol Client + * FreeRDP Windows Server + * + * Copyright 2012 Marc-Andre Moreau + * Copyright 2012 Corey Clayton + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -45,7 +45,7 @@ DWORD WINAPI wf_update_thread(LPVOID lpParam) wfInfo* wfi; DWORD beg, end; DWORD diff, rate; - wfi = (wfInfo*) lpParam; + wfi = (wfInfo*)lpParam; fps = wfi->framesPerSecond; rate = 1000 / fps; @@ -62,7 +62,7 @@ DWORD WINAPI wf_update_thread(LPVOID lpParam) if (wf_info_have_updates(wfi)) { wf_update_encode(wfi); - //WLog_DBG(TAG, "Start of parallel sending"); + // WLog_DBG(TAG, "Start of parallel sending"); index = 0; for (peerindex = 0; peerindex < wfi->peerCount; peerindex++) @@ -71,20 +71,21 @@ DWORD WINAPI wf_update_thread(LPVOID lpParam) { if (wfi->peers[index] && wfi->peers[index]->activated) { - //WLog_DBG(TAG, "Setting event for %d of %d", index + 1, wfi->activePeerCount); - SetEvent(((wfPeerContext*) wfi->peers[index]->context)->updateEvent); + // WLog_DBG(TAG, "Setting event for %d of %d", index + 1, + // wfi->activePeerCount); + SetEvent(((wfPeerContext*)wfi->peers[index]->context)->updateEvent); } } } for (index = 0; index < wfi->activePeerCount; index++) { - //WLog_DBG(TAG, "Waiting for %d of %d", index + 1, wfi->activePeerCount); - //WaitForSingleObject(wfi->updateSemaphore, INFINITE); + // WLog_DBG(TAG, "Waiting for %d of %d", index + 1, wfi->activePeerCount); + // WaitForSingleObject(wfi->updateSemaphore, INFINITE); WaitForSingleObject(wfi->updateSemaphore, 1000); } - //WLog_DBG(TAG, "End of parallel sending"); + // WLog_DBG(TAG, "End of parallel sending"); wf_info_clear_invalid_region(wfi); } } @@ -101,7 +102,7 @@ DWORD WINAPI wf_update_thread(LPVOID lpParam) } } - //WLog_DBG(TAG, "Exiting Update Thread"); + // WLog_DBG(TAG, "Exiting Update Thread"); return 0; } @@ -118,13 +119,14 @@ void wf_update_encode(wfInfo* wfi) wf_info_getScreenData(wfi, &width, &height, &pDataBits, &stride); rect.x = 0; rect.y = 0; - rect.width = (UINT16) width; - rect.height = (UINT16) height; - //WLog_DBG(TAG, "x:%"PRId32" y:%"PRId32" w:%ld h:%ld", wfi->invalid.left, wfi->invalid.top, width, height); + rect.width = (UINT16)width; + rect.height = (UINT16)height; + // WLog_DBG(TAG, "x:%"PRId32" y:%"PRId32" w:%ld h:%ld", wfi->invalid.left, wfi->invalid.top, + // width, height); Stream_Clear(wfi->s); - if (!(rfx_compose_message(wfi->rfx_context, wfi->s, &rect, 1, - pDataBits, width, height, stride))) + if (!(rfx_compose_message(wfi->rfx_context, wfi->s, &rect, 1, pDataBits, width, height, + stride))) { return; } @@ -144,7 +146,7 @@ void wf_update_encode(wfInfo* wfi) void wf_update_peer_send(wfInfo* wfi, wfPeerContext* context) { - freerdp_peer* client = ((rdpContext*) context)->peer; + freerdp_peer* client = ((rdpContext*)context)->peer; /* This happens when the RemoteFX encoder state is reset */ @@ -152,10 +154,10 @@ void wf_update_peer_send(wfInfo* wfi, wfPeerContext* context) context->frame_idx = 0; /* - * When a new client connects, it is possible that old frames from - * from a previous encoding state remain. Those frames should be discarded - * as they will cause an error condition in mstsc. - */ + * When a new client connects, it is possible that old frames from + * from a previous encoding state remain. Those frames should be discarded + * as they will cause an error condition in mstsc. + */ if ((context->frame_idx + 1) != wfi->frame_idx) { @@ -164,8 +166,8 @@ void wf_update_peer_send(wfInfo* wfi, wfPeerContext* context) return; /* This is an unexpected error condition */ - WLog_DBG(TAG, "Unexpected Frame Index: Actual: %d Expected: %d", - wfi->frame_idx, context->frame_idx + 1); + WLog_DBG(TAG, "Unexpected Frame Index: Actual: %d Expected: %d", wfi->frame_idx, + context->frame_idx + 1); } wfi->cmd.bmp.codecID = client->settings->RemoteFxCodecId; @@ -221,7 +223,7 @@ void wf_update_peer_deactivate(wfInfo* wfi, wfPeerContext* context) { if (wf_info_lock(wfi) > 0) { - freerdp_peer* client = ((rdpContext*) context)->peer; + freerdp_peer* client = ((rdpContext*)context)->peer; if (client->activated) { diff --git a/server/Windows/wf_wasapi.c b/server/Windows/wf_wasapi.c index 60c3df73d..9a9dca1c1 100644 --- a/server/Windows/wf_wasapi.c +++ b/server/Windows/wf_wasapi.c @@ -12,19 +12,20 @@ //#define REFTIMES_PER_SEC 10000000 //#define REFTIMES_PER_MILLISEC 10000 -#define REFTIMES_PER_SEC 100000 -#define REFTIMES_PER_MILLISEC 100 +#define REFTIMES_PER_SEC 100000 +#define REFTIMES_PER_MILLISEC 100 //#define REFTIMES_PER_SEC 50000 //#define REFTIMES_PER_MILLISEC 50 - -DEFINE_GUID(CLSID_MMDeviceEnumerator, 0xBCDE0395, 0xE52F, 0x467C, - 0x8E, 0x3D, 0xC4, 0x57, 0x92, 0x91, 0x69, 0x2E); -DEFINE_GUID(IID_IMMDeviceEnumerator, 0xA95664D2, 0x9614, 0x4F35, - 0xA7, 0x46, 0xDE, 0x8D, 0xB6, 0x36, 0x17, 0xE6); -DEFINE_GUID(IID_IAudioClient, 0x1cb9ad4c, 0xdbfa, 0x4c32, 0xb1,0x78, 0xc2,0xf5,0x68,0xa7,0x03,0xb2); -DEFINE_GUID(IID_IAudioCaptureClient, 0xc8adbd64, 0xe71e, 0x48a0, 0xa4,0xde, 0x18,0x5c,0x39,0x5c,0xd3,0x17); +DEFINE_GUID(CLSID_MMDeviceEnumerator, 0xBCDE0395, 0xE52F, 0x467C, 0x8E, 0x3D, 0xC4, 0x57, 0x92, + 0x91, 0x69, 0x2E); +DEFINE_GUID(IID_IMMDeviceEnumerator, 0xA95664D2, 0x9614, 0x4F35, 0xA7, 0x46, 0xDE, 0x8D, 0xB6, 0x36, + 0x17, 0xE6); +DEFINE_GUID(IID_IAudioClient, 0x1cb9ad4c, 0xdbfa, 0x4c32, 0xb1, 0x78, 0xc2, 0xf5, 0x68, 0xa7, 0x03, + 0xb2); +DEFINE_GUID(IID_IAudioCaptureClient, 0xc8adbd64, 0xe71e, 0x48a0, 0xa4, 0xde, 0x18, 0x5c, 0x39, 0x5c, + 0xd3, 0x17); LPWSTR devStr = NULL; wfPeerContext* latestPeer = NULL; @@ -37,7 +38,7 @@ int wf_rdpsnd_set_latest_peer(wfPeerContext* peer) int wf_wasapi_activate(RdpsndServerContext* context) { - wchar_t * pattern = L"Stereo Mix"; + wchar_t* pattern = L"Stereo Mix"; HANDLE hThread; wf_wasapi_get_device_string(pattern, &devStr); @@ -59,26 +60,28 @@ int wf_wasapi_activate(RdpsndServerContext* context) return 0; } -int wf_wasapi_get_device_string(LPWSTR pattern, LPWSTR * deviceStr) +int wf_wasapi_get_device_string(LPWSTR pattern, LPWSTR* deviceStr) { HRESULT hr; - IMMDeviceEnumerator *pEnumerator = NULL; - IMMDeviceCollection *pCollection = NULL; - IMMDevice *pEndpoint = NULL; - IPropertyStore *pProps = NULL; + IMMDeviceEnumerator* pEnumerator = NULL; + IMMDeviceCollection* pCollection = NULL; + IMMDevice* pEndpoint = NULL; + IPropertyStore* pProps = NULL; LPWSTR pwszID = NULL; unsigned int count, i; CoInitialize(NULL); - hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, &IID_IMMDeviceEnumerator, (void **) &pEnumerator); + hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, &IID_IMMDeviceEnumerator, + (void**)&pEnumerator); if (FAILED(hr)) { WLog_ERR(TAG, "Failed to cocreate device enumerator"); exit(1); } - hr = pEnumerator->lpVtbl->EnumAudioEndpoints(pEnumerator, eCapture, DEVICE_STATE_ACTIVE, &pCollection); - if ( FAILED(hr) ) + hr = pEnumerator->lpVtbl->EnumAudioEndpoints(pEnumerator, eCapture, DEVICE_STATE_ACTIVE, + &pCollection); + if (FAILED(hr)) { WLog_ERR(TAG, "Failed to create endpoint collection"); exit(1); @@ -99,44 +102,44 @@ int wf_wasapi_get_device_string(LPWSTR pattern, LPWSTR * deviceStr) PropVariantInit(&nameVar); hr = pCollection->lpVtbl->Item(pCollection, i, &pEndpoint); - if ( FAILED(hr) ) + if (FAILED(hr)) { WLog_ERR(TAG, "Failed to get endpoint %u", i); exit(1); } hr = pEndpoint->lpVtbl->GetId(pEndpoint, &pwszID); - if ( FAILED(hr) ) + if (FAILED(hr)) { WLog_ERR(TAG, "Failed to get endpoint ID"); exit(1); } hr = pEndpoint->lpVtbl->OpenPropertyStore(pEndpoint, STGM_READ, &pProps); - if ( FAILED(hr) ) + if (FAILED(hr)) { WLog_ERR(TAG, "Failed to open property store"); exit(1); } hr = pProps->lpVtbl->GetValue(pProps, &PKEY_Device_FriendlyName, &nameVar); - if ( FAILED(hr) ) + if (FAILED(hr)) { WLog_ERR(TAG, "Failed to get device friendly name"); exit(1); } - //do this a more reliable way + // do this a more reliable way if (wcscmp(pattern, nameVar.pwszVal) < 0) { unsigned int devStrLen; WLog_INFO(TAG, "Using sound ouput endpoint: [%s] (%s)", nameVar.pwszVal, pwszID); - //WLog_INFO(TAG, "matched %d characters", wcscmp(pattern, nameVar.pwszVal); + // WLog_INFO(TAG, "matched %d characters", wcscmp(pattern, nameVar.pwszVal); devStrLen = wcslen(pwszID); - *deviceStr = (LPWSTR) calloc(devStrLen + 1, 2); + *deviceStr = (LPWSTR)calloc(devStrLen + 1, 2); if (!deviceStr) return -1; - wcscpy_s(*deviceStr, devStrLen+1, pwszID); + wcscpy_s(*deviceStr, devStrLen + 1, pwszID); } CoTaskMemFree(pwszID); pwszID = NULL; @@ -147,7 +150,6 @@ int wf_wasapi_get_device_string(LPWSTR pattern, LPWSTR * deviceStr) pEndpoint->lpVtbl->Release(pEndpoint); pEndpoint = NULL; - } pCollection->lpVtbl->Release(pCollection); @@ -162,11 +164,11 @@ int wf_wasapi_get_device_string(LPWSTR pattern, LPWSTR * deviceStr) static DWORD WINAPI wf_rdpsnd_wasapi_thread(LPVOID lpParam) { - IMMDeviceEnumerator *pEnumerator = NULL; - IMMDevice *pDevice = NULL; - IAudioClient *pAudioClient = NULL; - IAudioCaptureClient *pCaptureClient = NULL; - WAVEFORMATEX *pwfx = NULL; + IMMDeviceEnumerator* pEnumerator = NULL; + IMMDevice* pDevice = NULL; + IAudioClient* pAudioClient = NULL; + IAudioCaptureClient* pCaptureClient = NULL; + WAVEFORMATEX* pwfx = NULL; HRESULT hr; REFERENCE_TIME hnsRequestedDuration = REFTIMES_PER_SEC; REFERENCE_TIME hnsActualDuration; @@ -174,7 +176,7 @@ static DWORD WINAPI wf_rdpsnd_wasapi_thread(LPVOID lpParam) UINT32 numFramesAvailable; UINT32 packetLength = 0; UINT32 dCount = 0; - BYTE *pData; + BYTE* pData; wfPeerContext* context; wfInfo* wfi; @@ -183,7 +185,8 @@ static DWORD WINAPI wf_rdpsnd_wasapi_thread(LPVOID lpParam) context = (wfPeerContext*)lpParam; CoInitialize(NULL); - hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, &IID_IMMDeviceEnumerator, (void **) &pEnumerator); + hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, &IID_IMMDeviceEnumerator, + (void**)&pEnumerator); if (FAILED(hr)) { WLog_ERR(TAG, "Failed to cocreate device enumerator"); @@ -197,7 +200,8 @@ static DWORD WINAPI wf_rdpsnd_wasapi_thread(LPVOID lpParam) exit(1); } - hr = pDevice->lpVtbl->Activate(pDevice, &IID_IAudioClient, CLSCTX_ALL, NULL, (void **)&pAudioClient); + hr = pDevice->lpVtbl->Activate(pDevice, &IID_IAudioClient, CLSCTX_ALL, NULL, + (void**)&pAudioClient); if (FAILED(hr)) { WLog_ERR(TAG, "Failed to activate audio client"); @@ -219,9 +223,8 @@ static DWORD WINAPI wf_rdpsnd_wasapi_thread(LPVOID lpParam) pwfx->wBitsPerSample = wfi->agreed_format->wBitsPerSample; pwfx->cbSize = wfi->agreed_format->cbSize; - hr = pAudioClient->lpVtbl->Initialize( - pAudioClient, AUDCLNT_SHAREMODE_SHARED, 0, - hnsRequestedDuration, 0, pwfx, NULL); + hr = pAudioClient->lpVtbl->Initialize(pAudioClient, AUDCLNT_SHAREMODE_SHARED, 0, + hnsRequestedDuration, 0, pwfx, NULL); if (FAILED(hr)) { @@ -236,7 +239,8 @@ static DWORD WINAPI wf_rdpsnd_wasapi_thread(LPVOID lpParam) exit(1); } - hr = pAudioClient->lpVtbl->GetService(pAudioClient, &IID_IAudioCaptureClient, (void **) &pCaptureClient); + hr = pAudioClient->lpVtbl->GetService(pAudioClient, &IID_IAudioCaptureClient, + (void**)&pCaptureClient); if (FAILED(hr)) { WLog_ERR(TAG, "Failed to get the capture client"); @@ -258,7 +262,7 @@ static DWORD WINAPI wf_rdpsnd_wasapi_thread(LPVOID lpParam) { DWORD flags; - Sleep(hnsActualDuration/REFTIMES_PER_MILLISEC/2); + Sleep(hnsActualDuration / REFTIMES_PER_MILLISEC / 2); hr = pCaptureClient->lpVtbl->GetNextPacketSize(pCaptureClient, &packetLength); if (FAILED(hr)) @@ -269,17 +273,19 @@ static DWORD WINAPI wf_rdpsnd_wasapi_thread(LPVOID lpParam) while (packetLength != 0) { - hr = pCaptureClient->lpVtbl->GetBuffer(pCaptureClient, &pData, &numFramesAvailable, &flags, NULL, NULL); + hr = pCaptureClient->lpVtbl->GetBuffer(pCaptureClient, &pData, &numFramesAvailable, + &flags, NULL, NULL); if (FAILED(hr)) { WLog_ERR(TAG, "Failed to get buffer"); exit(1); } - //Here we are writing the audio data - //not sure if this flag is ever set by the system; msdn is not clear about it + // Here we are writing the audio data + // not sure if this flag is ever set by the system; msdn is not clear about it if (!(flags & AUDCLNT_BUFFERFLAGS_SILENT)) - context->rdpsnd->SendSamples(context->rdpsnd, pData, packetLength, (UINT16)(GetTickCount() & 0xffff)); + context->rdpsnd->SendSamples(context->rdpsnd, pData, packetLength, + (UINT16)(GetTickCount() & 0xffff)); hr = pCaptureClient->lpVtbl->ReleaseBuffer(pCaptureClient, numFramesAvailable); if (FAILED(hr)) diff --git a/server/Windows/wf_wasapi.h b/server/Windows/wf_wasapi.h index 303b4f9b2..da9c7dc21 100644 --- a/server/Windows/wf_wasapi.h +++ b/server/Windows/wf_wasapi.h @@ -8,7 +8,7 @@ int wf_rdpsnd_set_latest_peer(wfPeerContext* peer); int wf_wasapi_activate(RdpsndServerContext* context); -int wf_wasapi_get_device_string(LPWSTR pattern, LPWSTR * deviceStr); +int wf_wasapi_get_device_string(LPWSTR pattern, LPWSTR* deviceStr); DWORD WINAPI wf_rdpsnd_wasapi_thread(LPVOID lpParam); diff --git a/server/common/server.c b/server/common/server.c index d447a76c4..1ee38c545 100644 --- a/server/common/server.c +++ b/server/common/server.c @@ -30,57 +30,47 @@ size_t server_audin_get_formats(AUDIO_FORMAT** dst_formats) { /* Default supported audio formats */ - BYTE adpcm_data_7[] = - { - 0xf4, 0x07, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, - 0xff, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x40, 0x00, 0xf0, 0x00, - 0x00, 0x00, 0xcc, 0x01, 0x30, 0xff, 0x88, 0x01, 0x18, 0xff - }; - BYTE adpcm_data_3[] = - { - 0xf4, 0x03, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, - 0xff, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x40, 0x00, 0xf0, 0x00, - 0x00, 0x00, 0xcc, 0x01, 0x30, 0xff, 0x88, 0x01, 0x18, 0xff - }; - BYTE adpcm_data_1[] = - { - 0xf4, 0x01, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, - 0xff, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x40, 0x00, 0xf0, 0x00, - 0x00, 0x00, 0xcc, 0x01, 0x30, 0xff, 0x88, 0x01, 0x18, 0xff - }; + BYTE adpcm_data_7[] = { 0xf4, 0x07, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, + 0xff, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x40, 0x00, 0xf0, 0x00, + 0x00, 0x00, 0xcc, 0x01, 0x30, 0xff, 0x88, 0x01, 0x18, 0xff }; + BYTE adpcm_data_3[] = { 0xf4, 0x03, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, + 0xff, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x40, 0x00, 0xf0, 0x00, + 0x00, 0x00, 0xcc, 0x01, 0x30, 0xff, 0x88, 0x01, 0x18, 0xff }; + BYTE adpcm_data_1[] = { 0xf4, 0x01, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, + 0xff, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x40, 0x00, 0xf0, 0x00, + 0x00, 0x00, 0xcc, 0x01, 0x30, 0xff, 0x88, 0x01, 0x18, 0xff }; BYTE adpcm_dvi_data_7[] = { 0xf9, 0x07 }; BYTE adpcm_dvi_data_3[] = { 0xf9, 0x03 }; BYTE adpcm_dvi_data_1[] = { 0xf9, 0x01 }; BYTE gsm610_data[] = { 0x40, 0x01 }; - const AUDIO_FORMAT default_supported_audio_formats[] = - { + const AUDIO_FORMAT default_supported_audio_formats[] = { /* Formats sent by windows 10 server */ - { WAVE_FORMAT_AAC_MS, 2, 44100, 24000, 4, 16, 0, NULL }, - { WAVE_FORMAT_AAC_MS, 2, 44100, 20000, 4, 16, 0, NULL }, - { WAVE_FORMAT_AAC_MS, 2, 44100, 16000, 4, 16, 0, NULL }, - { WAVE_FORMAT_AAC_MS, 2, 44100, 12000, 4, 16, 0, NULL }, - { WAVE_FORMAT_PCM, 2, 44100, 176400, 4, 16, 0, NULL }, - { WAVE_FORMAT_ADPCM, 2, 44100, 44359, 2048, 4, 32, adpcm_data_7 }, - { WAVE_FORMAT_DVI_ADPCM, 2, 44100, 44251, 2048, 4, 2, adpcm_dvi_data_7 }, - { WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, 0, NULL }, - { WAVE_FORMAT_ADPCM, 2, 22050, 22311, 1024, 4, 32, adpcm_data_3 }, - { WAVE_FORMAT_DVI_ADPCM, 2, 22050, 22201, 1024, 4, 2, adpcm_dvi_data_3 }, - { WAVE_FORMAT_ADPCM, 1, 44100, 22179, 1024, 4, 32, adpcm_data_7 }, - { WAVE_FORMAT_DVI_ADPCM, 1, 44100, 22125, 1024, 4, 2, adpcm_dvi_data_7 }, - { WAVE_FORMAT_ADPCM, 2, 11025, 11289, 512, 4, 32, adpcm_data_1 }, - { WAVE_FORMAT_DVI_ADPCM, 2, 11025, 11177, 512, 4, 2, adpcm_dvi_data_1 }, - { WAVE_FORMAT_ADPCM, 1, 22050, 11155, 512, 4, 32, adpcm_data_3 }, - { WAVE_FORMAT_DVI_ADPCM, 1, 22050, 11100, 512, 4, 2, adpcm_dvi_data_3 }, - { WAVE_FORMAT_GSM610, 1, 44100, 8957, 65, 0, 2, gsm610_data }, - { WAVE_FORMAT_ADPCM, 2, 8000, 8192, 512, 4, 32, adpcm_data_1 }, - { WAVE_FORMAT_DVI_ADPCM, 2, 8000, 8110, 512, 4, 2, adpcm_dvi_data_1 }, - { WAVE_FORMAT_ADPCM, 1, 11025, 5644, 256, 4, 32, adpcm_data_1 }, - { WAVE_FORMAT_DVI_ADPCM, 1, 11025, 5588, 256, 4, 2, adpcm_dvi_data_1 }, - { WAVE_FORMAT_GSM610, 1, 22050, 4478, 65, 0, 2, gsm610_data }, - { WAVE_FORMAT_ADPCM, 1, 8000, 4096, 256, 4, 32, adpcm_data_1 }, - { WAVE_FORMAT_DVI_ADPCM, 1, 8000, 4055, 256, 4, 2, adpcm_dvi_data_1 }, - { WAVE_FORMAT_GSM610, 1, 11025, 2239, 65, 0, 2, gsm610_data }, - { WAVE_FORMAT_GSM610, 1, 8000, 1625, 65, 0, 2, gsm610_data }, + { WAVE_FORMAT_AAC_MS, 2, 44100, 24000, 4, 16, 0, NULL }, + { WAVE_FORMAT_AAC_MS, 2, 44100, 20000, 4, 16, 0, NULL }, + { WAVE_FORMAT_AAC_MS, 2, 44100, 16000, 4, 16, 0, NULL }, + { WAVE_FORMAT_AAC_MS, 2, 44100, 12000, 4, 16, 0, NULL }, + { WAVE_FORMAT_PCM, 2, 44100, 176400, 4, 16, 0, NULL }, + { WAVE_FORMAT_ADPCM, 2, 44100, 44359, 2048, 4, 32, adpcm_data_7 }, + { WAVE_FORMAT_DVI_ADPCM, 2, 44100, 44251, 2048, 4, 2, adpcm_dvi_data_7 }, + { WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, 0, NULL }, + { WAVE_FORMAT_ADPCM, 2, 22050, 22311, 1024, 4, 32, adpcm_data_3 }, + { WAVE_FORMAT_DVI_ADPCM, 2, 22050, 22201, 1024, 4, 2, adpcm_dvi_data_3 }, + { WAVE_FORMAT_ADPCM, 1, 44100, 22179, 1024, 4, 32, adpcm_data_7 }, + { WAVE_FORMAT_DVI_ADPCM, 1, 44100, 22125, 1024, 4, 2, adpcm_dvi_data_7 }, + { WAVE_FORMAT_ADPCM, 2, 11025, 11289, 512, 4, 32, adpcm_data_1 }, + { WAVE_FORMAT_DVI_ADPCM, 2, 11025, 11177, 512, 4, 2, adpcm_dvi_data_1 }, + { WAVE_FORMAT_ADPCM, 1, 22050, 11155, 512, 4, 32, adpcm_data_3 }, + { WAVE_FORMAT_DVI_ADPCM, 1, 22050, 11100, 512, 4, 2, adpcm_dvi_data_3 }, + { WAVE_FORMAT_GSM610, 1, 44100, 8957, 65, 0, 2, gsm610_data }, + { WAVE_FORMAT_ADPCM, 2, 8000, 8192, 512, 4, 32, adpcm_data_1 }, + { WAVE_FORMAT_DVI_ADPCM, 2, 8000, 8110, 512, 4, 2, adpcm_dvi_data_1 }, + { WAVE_FORMAT_ADPCM, 1, 11025, 5644, 256, 4, 32, adpcm_data_1 }, + { WAVE_FORMAT_DVI_ADPCM, 1, 11025, 5588, 256, 4, 2, adpcm_dvi_data_1 }, + { WAVE_FORMAT_GSM610, 1, 22050, 4478, 65, 0, 2, gsm610_data }, + { WAVE_FORMAT_ADPCM, 1, 8000, 4096, 256, 4, 32, adpcm_data_1 }, + { WAVE_FORMAT_DVI_ADPCM, 1, 8000, 4055, 256, 4, 2, adpcm_dvi_data_1 }, + { WAVE_FORMAT_GSM610, 1, 11025, 2239, 65, 0, 2, gsm610_data }, + { WAVE_FORMAT_GSM610, 1, 8000, 1625, 65, 0, 2, gsm610_data }, /* Formats added for others */ { WAVE_FORMAT_MSG723, 2, 44100, 0, 4, 16, 0, NULL }, @@ -132,13 +122,11 @@ fail: return 0; } - size_t server_rdpsnd_get_formats(AUDIO_FORMAT** dst_formats) { size_t x, y = 0; /* Default supported audio formats */ - static const AUDIO_FORMAT default_supported_audio_formats[] = - { + static const AUDIO_FORMAT default_supported_audio_formats[] = { { WAVE_FORMAT_AAC_MS, 2, 44100, 176400, 4, 16, 0, NULL }, { WAVE_FORMAT_MPEGLAYER3, 2, 44100, 176400, 4, 16, 0, NULL }, { WAVE_FORMAT_MSG723, 2, 44100, 176400, 4, 16, 0, NULL }, @@ -148,8 +136,8 @@ size_t server_rdpsnd_get_formats(AUDIO_FORMAT** dst_formats) { WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, 0, NULL }, { WAVE_FORMAT_MULAW, 2, 22050, 44100, 2, 8, 0, NULL }, }; - AUDIO_FORMAT* supported_audio_formats = audio_formats_new(ARRAYSIZE( - default_supported_audio_formats)); + AUDIO_FORMAT* supported_audio_formats = + audio_formats_new(ARRAYSIZE(default_supported_audio_formats)); if (!supported_audio_formats) goto fail; diff --git a/server/proxy/freerdp_proxy.c b/server/proxy/freerdp_proxy.c index c2df8d056..df60aa762 100644 --- a/server/proxy/freerdp_proxy.c +++ b/server/proxy/freerdp_proxy.c @@ -28,7 +28,6 @@ #define TAG PROXY_TAG("server") - int main(int argc, char* argv[]) { const char* cfg = "config.ini"; diff --git a/server/proxy/modules/demo/demo.c b/server/proxy/modules/demo/demo.c index 1219235bf..0c700305e 100644 --- a/server/proxy/modules/demo/demo.c +++ b/server/proxy/modules/demo/demo.c @@ -23,7 +23,7 @@ static BOOL demo_filter_keyboard_event(moduleOperations* module, rdpContext* context, void* param) { - proxyKeyboardEventInfo* event_data = (proxyKeyboardEventInfo*) param; + proxyKeyboardEventInfo* event_data = (proxyKeyboardEventInfo*)param; WINPR_UNUSED(event_data); return TRUE; @@ -31,11 +31,11 @@ static BOOL demo_filter_keyboard_event(moduleOperations* module, rdpContext* con static BOOL demo_filter_mouse_event(moduleOperations* module, rdpContext* context, void* param) { - proxyMouseEventInfo* event_data = (proxyMouseEventInfo*) param; + proxyMouseEventInfo* event_data = (proxyMouseEventInfo*)param; if (event_data->x % 100 == 0) { - printf("filter_demo: mouse x is currently %"PRIu16"\n", event_data->x); + printf("filter_demo: mouse x is currently %" PRIu16 "\n", event_data->x); } return TRUE; diff --git a/server/proxy/pf_capture.c b/server/proxy/pf_capture.c index b9b99e416..9bff68fe6 100644 --- a/server/proxy/pf_capture.c +++ b/server/proxy/pf_capture.c @@ -41,19 +41,20 @@ static BOOL pf_capture_create_user_captures_dir(const char* base_dir, const char char* buf = NULL; BOOL ret = FALSE; - /* create sub-directory in base captures directory for current username, if it doesn't already exists. */ + /* create sub-directory in base captures directory for current username, if it doesn't already + * exists. */ rc = _snprintf(NULL, 0, "%s/%s", base_dir, username); if (rc < 0) return FALSE; - size = (size_t) rc; + size = (size_t)rc; buf = malloc(size + 1); if (!buf) return FALSE; rc = sprintf(buf, "%s/%s", base_dir, username); - if (rc < 0 || (size_t) rc != size) + if (rc < 0 || (size_t)rc != size) goto out; if (!pf_capture_create_dir_if_not_exists(buf)) @@ -70,7 +71,7 @@ static BOOL pf_capture_create_current_session_captures_dir(pClientContext* pc) { proxyConfig* config = pc->pdata->config; rdpSettings* settings = pc->context.settings; - const char* fmt = "%s/%s/%s_%02u-%02u-%"PRIu16"_%02u-%02u-%02u-%03u"; + const char* fmt = "%s/%s/%s_%02u-%02u-%" PRIu16 "_%02u-%02u-%02u-%03u"; int rc; size_t size; SYSTEMTIME localTime; @@ -79,13 +80,13 @@ static BOOL pf_capture_create_current_session_captures_dir(pClientContext* pc) /* create sub-directory in current user's captures directory, for the specific session. */ rc = _snprintf(NULL, 0, fmt, config->CapturesDirectory, settings->Username, - settings->ServerHostname, localTime.wDay, localTime.wMonth, localTime.wYear, - localTime.wHour, localTime.wMinute, localTime.wSecond, localTime.wMilliseconds); + settings->ServerHostname, localTime.wDay, localTime.wMonth, localTime.wYear, + localTime.wHour, localTime.wMinute, localTime.wSecond, localTime.wMilliseconds); if (rc < 0) return FALSE; - size = (size_t) rc; + size = (size_t)rc; /* `pc->frames_dir` will be used by proxy client for saving frames to storage. */ pc->frames_dir = malloc(size + 1); @@ -93,10 +94,10 @@ static BOOL pf_capture_create_current_session_captures_dir(pClientContext* pc) return FALSE; rc = sprintf(pc->frames_dir, fmt, config->CapturesDirectory, settings->Username, - settings->ServerHostname, localTime.wDay, localTime.wMonth, localTime.wYear, - localTime.wHour, localTime.wMinute, localTime.wSecond, localTime.wMilliseconds); + settings->ServerHostname, localTime.wDay, localTime.wMonth, localTime.wYear, + localTime.wHour, localTime.wMinute, localTime.wSecond, localTime.wMilliseconds); - if (rc < 0 || (size_t) rc != size) + if (rc < 0 || (size_t)rc != size) goto error; if (!pf_capture_create_dir_if_not_exists(pc->frames_dir)) @@ -109,7 +110,6 @@ error: return FALSE; } - /* creates a directory to store captured session frames. * * @context: current session. @@ -139,7 +139,7 @@ BOOL pf_capture_save_frame(pClientContext* pc, const BYTE* frame) { rdpSettings* settings = pc->context.settings; int rc; - const char* fmt = "%s/%"PRIu64".bmp"; + const char* fmt = "%s/%" PRIu64 ".bmp"; char* file_path = NULL; size_t size; @@ -150,17 +150,17 @@ BOOL pf_capture_save_frame(pClientContext* pc, const BYTE* frame) if (rc < 0) return FALSE; - size = (size_t) rc; + size = (size_t)rc; file_path = malloc(size + 1); if (!file_path) return FALSE; rc = sprintf(file_path, fmt, pc->frames_dir, pc->frames_count++); - if (rc < 0 || (size_t) rc != size) + if (rc < 0 || (size_t)rc != size) goto out; rc = winpr_bitmap_write(file_path, frame, settings->DesktopWidth, settings->DesktopHeight, - settings->ColorDepth); + settings->ColorDepth); out: free(file_path); diff --git a/server/proxy/pf_channels.c b/server/proxy/pf_channels.c index 6d8d316fc..01d06db9d 100644 --- a/server/proxy/pf_channels.c +++ b/server/proxy/pf_channels.c @@ -51,17 +51,16 @@ static void pf_channels_wait_for_server_dynvc(pServerContext* ps) WLog_DBG(TAG, "pf_channels_wait_for_server_dynvc(): server's drdynvc is ready!"); } -void pf_OnChannelConnectedEventHandler(void* data, - ChannelConnectedEventArgs* e) +void pf_OnChannelConnectedEventHandler(void* data, ChannelConnectedEventArgs* e) { - pClientContext* pc = (pClientContext*) data; + pClientContext* pc = (pClientContext*)data; pServerContext* ps = pc->pdata->ps; WLog_INFO(TAG, "Channel connected: %s", e->name); if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0) { - pc->rdpei = (RdpeiClientContext*) e->pInterface; + pc->rdpei = (RdpeiClientContext*)e->pInterface; } else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) { @@ -73,7 +72,7 @@ void pf_OnChannelConnectedEventHandler(void* data, return; } - pc->gfx_proxy = (RdpgfxClientContext*) e->pInterface; + pc->gfx_proxy = (RdpgfxClientContext*)e->pInterface; pf_rdpgfx_pipeline_init(pc->gfx_proxy, ps->gfx, pc->pdata); } else if (strcmp(e->name, DISP_DVC_CHANNEL_NAME) == 0) @@ -110,7 +109,7 @@ void pf_OnChannelConnectedEventHandler(void* data, return; } - pc->cliprdr = (CliprdrClientContext*) e->pInterface; + pc->cliprdr = (CliprdrClientContext*)e->pInterface; pf_cliprdr_register_callbacks(pc->cliprdr, ps->cliprdr, pc->pdata); } else if (strcmp(e->name, "rdpsnd") == 0) @@ -127,11 +126,10 @@ void pf_OnChannelConnectedEventHandler(void* data, } } -void pf_OnChannelDisconnectedEventHandler(void* data, - ChannelDisconnectedEventArgs* e) +void pf_OnChannelDisconnectedEventHandler(void* data, ChannelDisconnectedEventArgs* e) { - rdpContext* context = (rdpContext*) data; - pClientContext* pc = (pClientContext*) context; + rdpContext* context = (rdpContext*)data; + pClientContext* pc = (pClientContext*)context; pServerContext* ps = pc->pdata->ps; WLog_INFO(TAG, "Channel disconnected: %s", e->name); @@ -175,8 +173,8 @@ void pf_OnChannelDisconnectedEventHandler(void* data, BOOL pf_server_channels_init(pServerContext* ps) { - rdpContext* context = (rdpContext*) ps; - rdpContext* client = (rdpContext*) ps->pdata->pc; + rdpContext* context = (rdpContext*)ps; + rdpContext* client = (rdpContext*)ps->pdata->pc; proxyConfig* config = ps->pdata->config; if (context->settings->SupportGraphicsPipeline && config->GFX) @@ -191,7 +189,8 @@ BOOL pf_server_channels_init(pServerContext* ps) return FALSE; } - if (config->Clipboard && WTSVirtualChannelManagerIsChannelJoined(ps->vcm, CLIPRDR_SVC_CHANNEL_NAME)) + if (config->Clipboard && + WTSVirtualChannelManagerIsChannelJoined(ps->vcm, CLIPRDR_SVC_CHANNEL_NAME)) { client->settings->RedirectClipboard = TRUE; @@ -234,5 +233,5 @@ void pf_server_channels_free(pServerContext* ps) ps->rdpsnd = NULL; } - pf_modules_run_hook(HOOK_TYPE_SERVER_CHANNELS_FREE, (rdpContext*) ps); + pf_modules_run_hook(HOOK_TYPE_SERVER_CHANNELS_FREE, (rdpContext*)ps); } diff --git a/server/proxy/pf_channels.h b/server/proxy/pf_channels.h index cdfb90e4a..f7663f20e 100644 --- a/server/proxy/pf_channels.h +++ b/server/proxy/pf_channels.h @@ -27,10 +27,8 @@ #include "pf_context.h" -void pf_OnChannelConnectedEventHandler(void* context, - ChannelConnectedEventArgs* e); -void pf_OnChannelDisconnectedEventHandler(void* context, - ChannelDisconnectedEventArgs* e); +void pf_OnChannelConnectedEventHandler(void* context, ChannelConnectedEventArgs* e); +void pf_OnChannelDisconnectedEventHandler(void* context, ChannelDisconnectedEventArgs* e); BOOL pf_server_channels_init(pServerContext* ps); void pf_server_channels_free(pServerContext* ps); diff --git a/server/proxy/pf_client.c b/server/proxy/pf_client.c index 80f0a9c3e..fd85a7ed9 100644 --- a/server/proxy/pf_client.c +++ b/server/proxy/pf_client.c @@ -71,13 +71,13 @@ static BOOL proxy_server_reactivate(rdpContext* ps, const rdpContext* pc) static void pf_OnErrorInfo(void* ctx, ErrorInfoEventArgs* e) { - pClientContext* pc = (pClientContext*) ctx; + pClientContext* pc = (pClientContext*)ctx; pServerContext* ps = pc->pdata->ps; if (e->code == ERRINFO_NONE) return; - WLog_WARN(TAG, "received error info code: 0x%08"PRIu32", msg: %s", e->code, + WLog_WARN(TAG, "received error info code: 0x%08" PRIu32 ", msg: %s", e->code, freerdp_get_error_info_string(e->code)); /* forward error back to client */ @@ -87,7 +87,7 @@ static void pf_OnErrorInfo(void* ctx, ErrorInfoEventArgs* e) static BOOL pf_client_load_rdpsnd(pClientContext* pc, proxyConfig* config) { - rdpContext* context = (rdpContext*) pc; + rdpContext* context = (rdpContext*)pc; pServerContext* ps = pc->pdata->ps; /* @@ -103,8 +103,8 @@ static BOOL pf_client_load_rdpsnd(pClientContext* pc, proxyConfig* config) params[1] = "sys:proxy"; else params[1] = "sys:fake"; - - if (!freerdp_client_add_static_channel(context->settings, 2, (char**) params)) + + if (!freerdp_client_add_static_channel(context->settings, 2, (char**)params)) return FALSE; } @@ -119,7 +119,7 @@ static BOOL pf_client_load_rdpsnd(pClientContext* pc, proxyConfig* config) */ static BOOL pf_client_pre_connect(freerdp* instance) { - pClientContext* pc = (pClientContext*) instance->context; + pClientContext* pc = (pClientContext*)instance->context; pServerContext* ps = pc->pdata->ps; proxyConfig* config = ps->pdata->config; rdpSettings* settings = instance->settings; @@ -155,8 +155,7 @@ static BOOL pf_client_pre_connect(freerdp* instance) * Register the channel listeners. * They are required to set up / tear down channels if they are loaded. */ - PubSub_SubscribeChannelConnected(instance->context->pubSub, - pf_OnChannelConnectedEventHandler); + PubSub_SubscribeChannelConnected(instance->context->pubSub, pf_OnChannelConnectedEventHandler); PubSub_SubscribeChannelDisconnected(instance->context->pubSub, pf_OnChannelDisconnectedEventHandler); PubSub_SubscribeErrorInfo(instance->context->pubSub, pf_OnErrorInfo); @@ -173,8 +172,7 @@ static BOOL pf_client_pre_connect(freerdp* instance) return FALSE; } - if (!freerdp_client_load_addins(instance->context->channels, - instance->settings)) + if (!freerdp_client_load_addins(instance->context->channels, instance->settings)) { WLog_ERR(TAG, "Failed to load addins"); return FALSE; @@ -204,8 +202,8 @@ static BOOL pf_client_post_connect(freerdp* instance) context = instance->context; settings = instance->settings; update = instance->update; - pc = (pClientContext*) context; - ps = (rdpContext*) pc->pdata->ps; + pc = (pClientContext*)context; + ps = (rdpContext*)pc->pdata->ps; config = pc->pdata->config; if (config->SessionCapture) @@ -240,7 +238,7 @@ static BOOL pf_client_post_connect(freerdp* instance) offscreen_cache_register_callbacks(update); palette_cache_register_callbacks(update); } - + pf_client_register_update_callbacks(update); /* @@ -251,7 +249,6 @@ static BOOL pf_client_post_connect(freerdp* instance) return proxy_server_reactivate(ps, context); } - /* This function is called whether a session ends by failure or success. * Clean up everything allocated by pre_connect and post_connect. */ @@ -266,7 +263,7 @@ static void pf_client_post_disconnect(freerdp* instance) if (!instance->context) return; - context = (pClientContext*) instance->context; + context = (pClientContext*)instance->context; pdata = context->pdata; PubSub_UnsubscribeChannelConnected(instance->context->pubSub, @@ -331,7 +328,7 @@ static BOOL pf_client_connect_without_nla(pClientContext* pc) static BOOL pf_client_connect(freerdp* instance) { - pClientContext* pc = (pClientContext*) instance->context; + pClientContext* pc = (pClientContext*)instance->context; BOOL rc = FALSE; pf_client_set_security_settings(pc); @@ -379,7 +376,7 @@ static DWORD WINAPI pf_client_thread_proc(LPVOID arg) */ handles[64] = pdata->abort_event; - if (!pf_modules_run_hook(HOOK_TYPE_CLIENT_PRE_CONNECT, (rdpContext*) ps)) + if (!pf_modules_run_hook(HOOK_TYPE_CLIENT_PRE_CONNECT, (rdpContext*)ps)) { proxy_data_abort_connect(pdata); return FALSE; @@ -405,7 +402,7 @@ static DWORD WINAPI pf_client_thread_proc(LPVOID arg) if (status == WAIT_FAILED) { - WLog_ERR(TAG, "%s: WaitForMultipleObjects failed with %"PRIu32"", __FUNCTION__, + WLog_ERR(TAG, "%s: WaitForMultipleObjects failed with %" PRIu32 "", __FUNCTION__, status); break; } @@ -471,9 +468,9 @@ static int pf_logon_error_info(freerdp* instance, UINT32 data, UINT32 type) * @return 1 if the certificate is trusted, 2 if temporary trusted, 0 otherwise. */ static DWORD pf_client_verify_certificate_ex(freerdp* instance, const char* host, UINT16 port, - const char* common_name, - const char* subject, const char* issuer, - const char* fingerprint, DWORD flags) + const char* common_name, const char* subject, + const char* issuer, const char* fingerprint, + DWORD flags) { /* TODO: Add trust level to proxy configurable settings */ return 1; @@ -498,13 +495,10 @@ static DWORD pf_client_verify_certificate_ex(freerdp* instance, const char* host * * @return 1 if the certificate is trusted, 2 if temporary trusted, 0 otherwise. */ -static DWORD pf_client_verify_changed_certificate_ex(freerdp* instance, - const char* host, UINT16 port, - const char* common_name, - const char* subject, const char* issuer, - const char* fingerprint, - const char* old_subject, const char* old_issuer, - const char* old_fingerprint, DWORD flags) +static DWORD pf_client_verify_changed_certificate_ex( + freerdp* instance, const char* host, UINT16 port, const char* common_name, const char* subject, + const char* issuer, const char* fingerprint, const char* old_subject, const char* old_issuer, + const char* old_fingerprint, DWORD flags) { /* TODO: Add trust level to proxy configurable settings */ return 1; @@ -527,7 +521,7 @@ static BOOL pf_client_client_new(freerdp* instance, rdpContext* context) static void pf_client_client_free(freerdp* instance, rdpContext* context) { - pClientContext* pc = (pClientContext*) context; + pClientContext* pc = (pClientContext*)context; if (!pc) return; @@ -538,7 +532,7 @@ static void pf_client_client_free(freerdp* instance, rdpContext* context) static int pf_client_client_stop(rdpContext* context) { - pClientContext* pc = (pClientContext*) context; + pClientContext* pc = (pClientContext*)context; proxyData* pdata = pc->pdata; WLog_DBG(TAG, "aborting client connection"); diff --git a/server/proxy/pf_cliprdr.c b/server/proxy/pf_cliprdr.c index 92337b584..1000e7568 100644 --- a/server/proxy/pf_cliprdr.c +++ b/server/proxy/pf_cliprdr.c @@ -77,7 +77,7 @@ static INLINE void pf_cliprdr_create_text_only_format_list(CLIPRDR_FORMAT_LIST* * text is valid according to the configuration value of `MaxTextLength`. */ static BOOL pf_cliprdr_is_copy_paste_valid(proxyConfig* config, - const CLIPRDR_FORMAT_DATA_RESPONSE* pdu, UINT32 format) + const CLIPRDR_FORMAT_DATA_RESPONSE* pdu, UINT32 format) { size_t copy_len; if (config->MaxTextLength == 0) @@ -92,7 +92,7 @@ static BOOL pf_cliprdr_is_copy_paste_valid(proxyConfig* config, return FALSE; } - WLog_DBG(TAG, "pf_cliprdr_is_copy_paste_valid(): checking format %"PRIu32"", format); + WLog_DBG(TAG, "pf_cliprdr_is_copy_paste_valid(): checking format %" PRIu32 "", format); switch (format) { @@ -103,13 +103,13 @@ static BOOL pf_cliprdr_is_copy_paste_valid(proxyConfig* config, copy_len = pdu->dataLen; break; default: - WLog_WARN(TAG, "received unknown format: %"PRIu32", format"); + WLog_WARN(TAG, "received unknown format: %" PRIu32 ", format"); return FALSE; } if (copy_len > config->MaxTextLength) { - WLog_WARN(TAG, "text size is too large: %"PRIu32" (max %"PRIu32")", copy_len, + WLog_WARN(TAG, "text size is too large: %" PRIu32 " (max %" PRIu32 ")", copy_len, config->MaxTextLength); return FALSE; } @@ -133,9 +133,9 @@ static INLINE void pf_cliprdr_create_failed_format_data_response(CLIPRDR_FORMAT_ /* server callbacks */ static UINT pf_cliprdr_ClientCapabilities(CliprdrServerContext* context, - const CLIPRDR_CAPABILITIES* capabilities) + const CLIPRDR_CAPABILITIES* capabilities) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrClientContext* client = pdata->pc->cliprdr; WLog_VRB(TAG, __FUNCTION__); return client->ClientCapabilities(client, capabilities); @@ -144,7 +144,7 @@ static UINT pf_cliprdr_ClientCapabilities(CliprdrServerContext* context, static UINT pf_cliprdr_TempDirectory(CliprdrServerContext* context, const CLIPRDR_TEMP_DIRECTORY* tempDirectory) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrClientContext* client = pdata->pc->cliprdr; WLog_VRB(TAG, __FUNCTION__); return client->TempDirectory(client, tempDirectory); @@ -153,7 +153,7 @@ static UINT pf_cliprdr_TempDirectory(CliprdrServerContext* context, static UINT pf_cliprdr_ClientFormatList(CliprdrServerContext* context, const CLIPRDR_FORMAT_LIST* formatList) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrClientContext* client = pdata->pc->cliprdr; WLog_VRB(TAG, __FUNCTION__); @@ -168,43 +168,44 @@ static UINT pf_cliprdr_ClientFormatList(CliprdrServerContext* context, return client->ClientFormatList(client, formatList); } -static UINT pf_cliprdr_ClientFormatListResponse(CliprdrServerContext* context, - const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) +static UINT +pf_cliprdr_ClientFormatListResponse(CliprdrServerContext* context, + const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrClientContext* client = pdata->pc->cliprdr; WLog_VRB(TAG, __FUNCTION__); return client->ClientFormatListResponse(client, formatListResponse); } static UINT pf_cliprdr_ClientLockClipboardData(CliprdrServerContext* context, - const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) + const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrClientContext* client = pdata->pc->cliprdr; WLog_VRB(TAG, __FUNCTION__); return client->ClientLockClipboardData(client, lockClipboardData); } -static UINT pf_cliprdr_ClientUnlockClipboardData(CliprdrServerContext* context, - const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) +static UINT +pf_cliprdr_ClientUnlockClipboardData(CliprdrServerContext* context, + const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrClientContext* client = pdata->pc->cliprdr; WLog_VRB(TAG, __FUNCTION__); return client->ClientUnlockClipboardData(client, unlockClipboardData); } static UINT pf_cliprdr_ClientFormatDataRequest(CliprdrServerContext* context, - const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) + const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrClientContext* client = pdata->pc->cliprdr; CliprdrServerContext* server = pdata->ps->cliprdr; WLog_VRB(TAG, __FUNCTION__); - if (pdata->config->TextOnly && - !pf_cliprdr_is_text_format(formatDataRequest->requestedFormatId)) + if (pdata->config->TextOnly && !pf_cliprdr_is_text_format(formatDataRequest->requestedFormatId)) { CLIPRDR_FORMAT_DATA_RESPONSE resp; pf_cliprdr_create_failed_format_data_response(&resp); @@ -214,16 +215,18 @@ static UINT pf_cliprdr_ClientFormatDataRequest(CliprdrServerContext* context, return client->ClientFormatDataRequest(client, formatDataRequest); } -static UINT pf_cliprdr_ClientFormatDataResponse(CliprdrServerContext* context, - const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) +static UINT +pf_cliprdr_ClientFormatDataResponse(CliprdrServerContext* context, + const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrClientContext* client = pdata->pc->cliprdr; WLog_VRB(TAG, __FUNCTION__); if (pf_cliprdr_is_text_format(client->lastRequestedFormatId)) { - if (!pf_cliprdr_is_copy_paste_valid(pdata->config, formatDataResponse, client->lastRequestedFormatId)) + if (!pf_cliprdr_is_copy_paste_valid(pdata->config, formatDataResponse, + client->lastRequestedFormatId)) { CLIPRDR_FORMAT_DATA_RESPONSE resp; pf_cliprdr_create_failed_format_data_response(&resp); @@ -234,10 +237,11 @@ static UINT pf_cliprdr_ClientFormatDataResponse(CliprdrServerContext* context, return client->ClientFormatDataResponse(client, formatDataResponse); } -static UINT pf_cliprdr_ClientFileContentsRequest(CliprdrServerContext* context, - const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +static UINT +pf_cliprdr_ClientFileContentsRequest(CliprdrServerContext* context, + const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrClientContext* client = pdata->pc->cliprdr; WLog_VRB(TAG, __FUNCTION__); @@ -247,10 +251,11 @@ static UINT pf_cliprdr_ClientFileContentsRequest(CliprdrServerContext* context, return client->ClientFileContentsRequest(client, fileContentsRequest); } -static UINT pf_cliprdr_ClientFileContentsResponse(CliprdrServerContext* context, - const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) +static UINT +pf_cliprdr_ClientFileContentsResponse(CliprdrServerContext* context, + const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrClientContext* client = pdata->pc->cliprdr; WLog_VRB(TAG, __FUNCTION__); @@ -263,9 +268,9 @@ static UINT pf_cliprdr_ClientFileContentsResponse(CliprdrServerContext* context, /* client callbacks */ static UINT pf_cliprdr_ServerCapabilities(CliprdrClientContext* context, - const CLIPRDR_CAPABILITIES* capabilities) + const CLIPRDR_CAPABILITIES* capabilities) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrServerContext* server = pdata->ps->cliprdr; WLog_VRB(TAG, __FUNCTION__); return server->ServerCapabilities(server, capabilities); @@ -274,7 +279,7 @@ static UINT pf_cliprdr_ServerCapabilities(CliprdrClientContext* context, static UINT pf_cliprdr_MonitorReady(CliprdrClientContext* context, const CLIPRDR_MONITOR_READY* monitorReady) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrServerContext* server = pdata->ps->cliprdr; WLog_VRB(TAG, __FUNCTION__); return server->MonitorReady(server, monitorReady); @@ -283,7 +288,7 @@ static UINT pf_cliprdr_MonitorReady(CliprdrClientContext* context, static UINT pf_cliprdr_ServerFormatList(CliprdrClientContext* context, const CLIPRDR_FORMAT_LIST* formatList) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrServerContext* server = pdata->ps->cliprdr; WLog_VRB(TAG, __FUNCTION__); @@ -297,47 +302,44 @@ static UINT pf_cliprdr_ServerFormatList(CliprdrClientContext* context, return server->ServerFormatList(server, formatList); } - -static UINT pf_cliprdr_ServerFormatListResponse(CliprdrClientContext* context, - const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) +static UINT +pf_cliprdr_ServerFormatListResponse(CliprdrClientContext* context, + const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrServerContext* server = pdata->ps->cliprdr; WLog_VRB(TAG, __FUNCTION__); return server->ServerFormatListResponse(server, formatListResponse); } - static UINT pf_cliprdr_ServerLockClipboardData(CliprdrClientContext* context, - const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) + const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrServerContext* server = pdata->ps->cliprdr; WLog_VRB(TAG, __FUNCTION__); return server->ServerLockClipboardData(server, lockClipboardData); } - -static UINT pf_cliprdr_ServerUnlockClipboardData(CliprdrClientContext* context, - const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) +static UINT +pf_cliprdr_ServerUnlockClipboardData(CliprdrClientContext* context, + const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrServerContext* server = pdata->ps->cliprdr; WLog_VRB(TAG, __FUNCTION__); return server->ServerUnlockClipboardData(server, unlockClipboardData); } - static UINT pf_cliprdr_ServerFormatDataRequest(CliprdrClientContext* context, - const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) + const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrServerContext* server = pdata->ps->cliprdr; CliprdrClientContext* client = pdata->pc->cliprdr; WLog_VRB(TAG, __FUNCTION__); - if (pdata->config->TextOnly && - !pf_cliprdr_is_text_format(formatDataRequest->requestedFormatId)) + if (pdata->config->TextOnly && !pf_cliprdr_is_text_format(formatDataRequest->requestedFormatId)) { /* proxy's client needs to return a failed response directly to the client */ CLIPRDR_FORMAT_DATA_RESPONSE resp; @@ -348,16 +350,18 @@ static UINT pf_cliprdr_ServerFormatDataRequest(CliprdrClientContext* context, return server->ServerFormatDataRequest(server, formatDataRequest); } -static UINT pf_cliprdr_ServerFormatDataResponse(CliprdrClientContext* context, - const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) +static UINT +pf_cliprdr_ServerFormatDataResponse(CliprdrClientContext* context, + const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrServerContext* server = pdata->ps->cliprdr; WLog_VRB(TAG, __FUNCTION__); if (pf_cliprdr_is_text_format(server->lastRequestedFormatId)) { - if (!pf_cliprdr_is_copy_paste_valid(pdata->config, formatDataResponse, server->lastRequestedFormatId)) + if (!pf_cliprdr_is_copy_paste_valid(pdata->config, formatDataResponse, + server->lastRequestedFormatId)) { CLIPRDR_FORMAT_DATA_RESPONSE resp; pf_cliprdr_create_failed_format_data_response(&resp); @@ -368,11 +372,11 @@ static UINT pf_cliprdr_ServerFormatDataResponse(CliprdrClientContext* context, return server->ServerFormatDataResponse(server, formatDataResponse); } - -static UINT pf_cliprdr_ServerFileContentsRequest(CliprdrClientContext* context, - const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +static UINT +pf_cliprdr_ServerFileContentsRequest(CliprdrClientContext* context, + const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrServerContext* server = pdata->ps->cliprdr; WLog_VRB(TAG, __FUNCTION__); @@ -382,11 +386,11 @@ static UINT pf_cliprdr_ServerFileContentsRequest(CliprdrClientContext* context, return server->ServerFileContentsRequest(server, fileContentsRequest); } - -static UINT pf_cliprdr_ServerFileContentsResponse(CliprdrClientContext* context, - const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) +static UINT +pf_cliprdr_ServerFileContentsResponse(CliprdrClientContext* context, + const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) { - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; CliprdrServerContext* server = pdata->ps->cliprdr; WLog_VRB(TAG, __FUNCTION__); @@ -397,12 +401,11 @@ static UINT pf_cliprdr_ServerFileContentsResponse(CliprdrClientContext* context, } void pf_cliprdr_register_callbacks(CliprdrClientContext* cliprdr_client, - CliprdrServerContext* cliprdr_server, - proxyData* pdata) + CliprdrServerContext* cliprdr_server, proxyData* pdata) { /* Set server and client side references to proxy data */ - cliprdr_server->custom = (void*) pdata; - cliprdr_client->custom = (void*) pdata; + cliprdr_server->custom = (void*)pdata; + cliprdr_client->custom = (void*)pdata; /* Set server callbacks */ cliprdr_server->ClientCapabilities = pf_cliprdr_ClientCapabilities; cliprdr_server->TempDirectory = pf_cliprdr_TempDirectory; diff --git a/server/proxy/pf_cliprdr.h b/server/proxy/pf_cliprdr.h index 5c7957130..74d3cdf21 100644 --- a/server/proxy/pf_cliprdr.h +++ b/server/proxy/pf_cliprdr.h @@ -28,7 +28,6 @@ BOOL pf_server_cliprdr_init(pServerContext* ps); void pf_cliprdr_register_callbacks(CliprdrClientContext* cliprdr_client, - CliprdrServerContext* cliprdr_server, - proxyData* pdata); + CliprdrServerContext* cliprdr_server, proxyData* pdata); #endif /* FREERDP_SERVER_PROXY_PFCLIPRDR_H */ diff --git a/server/proxy/pf_config.c b/server/proxy/pf_config.c index 33e627b57..a2a9b1209 100644 --- a/server/proxy/pf_config.c +++ b/server/proxy/pf_config.c @@ -32,9 +32,10 @@ #define CONFIG_PRINT_SECTION(section) WLog_INFO(TAG, "\t%s:", section) #define CONFIG_PRINT_STR(config, key) WLog_INFO(TAG, "\t\t%s: %s", #key, config->key) -#define CONFIG_PRINT_BOOL(config, key) WLog_INFO(TAG, "\t\t%s: %s", #key, config->key ? "TRUE" : "FALSE") -#define CONFIG_PRINT_UINT16(config, key) WLog_INFO(TAG, "\t\t%s: %"PRIu16"", #key, config->key) -#define CONFIG_PRINT_UINT32(config, key) WLog_INFO(TAG, "\t\t%s: %"PRIu32"", #key, config->key) +#define CONFIG_PRINT_BOOL(config, key) \ + WLog_INFO(TAG, "\t\t%s: %s", #key, config->key ? "TRUE" : "FALSE") +#define CONFIG_PRINT_UINT16(config, key) WLog_INFO(TAG, "\t\t%s: %" PRIu16 "", #key, config->key) +#define CONFIG_PRINT_UINT32(config, key) WLog_INFO(TAG, "\t\t%s: %" PRIu32 "", #key, config->key) BOOL pf_config_get_uint16(wIniFile* ini, const char* section, const char* key, UINT16* result) { @@ -47,7 +48,7 @@ BOOL pf_config_get_uint16(wIniFile* ini, const char* section, const char* key, U return FALSE; } - *result = (UINT16) val; + *result = (UINT16)val; return TRUE; } @@ -62,7 +63,7 @@ BOOL pf_config_get_uint32(wIniFile* ini, const char* section, const char* key, U return FALSE; } - *result = (UINT32) val; + *result = (UINT32)val; return TRUE; } @@ -74,7 +75,8 @@ BOOL pf_config_get_bool(wIniFile* ini, const char* section, const char* key) str_value = IniFile_GetKeyValueString(ini, section, key); if (!str_value) { - WLog_WARN(TAG, "[%s]: key '%s.%s' not found, value defaults to false.", __FUNCTION__, key, section); + WLog_WARN(TAG, "[%s]: key '%s.%s' not found, value defaults to false.", __FUNCTION__, key, + section); return FALSE; } @@ -120,7 +122,7 @@ static BOOL pf_config_load_server(wIniFile* ini, proxyConfig* config) if (!config->Host) return FALSE; - + return TRUE; } @@ -199,7 +201,8 @@ static BOOL pf_config_load_modules(wIniFile* ini, proxyConfig* config) if (!pf_modules_register_new(path, module_name)) { - WLog_ERR(TAG, "pf_config_load_modules(): failed to register %s (%s)", module_name, path); + WLog_ERR(TAG, "pf_config_load_modules(): failed to register %s (%s)", module_name, + path); continue; } diff --git a/server/proxy/pf_config.h b/server/proxy/pf_config.h index 2e5757703..36b536d08 100644 --- a/server/proxy/pf_config.h +++ b/server/proxy/pf_config.h @@ -68,8 +68,10 @@ struct proxy_config typedef struct proxy_config proxyConfig; -FREERDP_API BOOL pf_config_get_uint16(wIniFile* ini, const char* section, const char* key, UINT16* result); -FREERDP_API BOOL pf_config_get_uint32(wIniFile* ini, const char* section, const char* key, UINT32* result); +FREERDP_API BOOL pf_config_get_uint16(wIniFile* ini, const char* section, const char* key, + UINT16* result); +FREERDP_API BOOL pf_config_get_uint32(wIniFile* ini, const char* section, const char* key, + UINT32* result); FREERDP_API BOOL pf_config_get_bool(wIniFile* ini, const char* section, const char* key); FREERDP_API const char* pf_config_get_str(wIniFile* ini, const char* section, const char* key); diff --git a/server/proxy/pf_context.c b/server/proxy/pf_context.c index 7213432c4..616820767 100644 --- a/server/proxy/pf_context.c +++ b/server/proxy/pf_context.c @@ -1,30 +1,29 @@ /** -* FreeRDP: A Remote Desktop Protocol Implementation -* FreeRDP Proxy Server -* -* Copyright 2019 Mati Shabtay -* Copyright 2019 Kobi Mizrachi -* Copyright 2019 Idan Freiberg -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * FreeRDP: A Remote Desktop Protocol Implementation + * FreeRDP Proxy Server + * + * Copyright 2019 Mati Shabtay + * Copyright 2019 Kobi Mizrachi + * Copyright 2019 Idan Freiberg + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include "pf_client.h" #include "pf_context.h" /* Proxy context initialization callback */ -static BOOL client_to_proxy_context_new(freerdp_peer* client, - pServerContext* context) +static BOOL client_to_proxy_context_new(freerdp_peer* client, pServerContext* context) { context->dynvcReady = NULL; context->modules_info = NULL; @@ -33,7 +32,7 @@ static BOOL client_to_proxy_context_new(freerdp_peer* client, if (!context->modules_info) return FALSE; - context->vcm = WTSOpenServerA((LPSTR) client->context); + context->vcm = WTSOpenServerA((LPSTR)client->context); if (!context->vcm || context->vcm == INVALID_HANDLE_VALUE) goto error; @@ -58,15 +57,14 @@ error: } /* Proxy context free callback */ -static void client_to_proxy_context_free(freerdp_peer* client, - pServerContext* context) +static void client_to_proxy_context_free(freerdp_peer* client, pServerContext* context) { WINPR_UNUSED(client); if (!context) return; - WTSCloseServer((HANDLE) context->vcm); + WTSCloseServer((HANDLE)context->vcm); if (context->dynvcReady) { @@ -80,8 +78,8 @@ static void client_to_proxy_context_free(freerdp_peer* client, BOOL pf_context_init_server_context(freerdp_peer* client) { client->ContextSize = sizeof(pServerContext); - client->ContextNew = (psPeerContextNew) client_to_proxy_context_new; - client->ContextFree = (psPeerContextFree) client_to_proxy_context_free; + client->ContextNew = (psPeerContextNew)client_to_proxy_context_new; + client->ContextFree = (psPeerContextFree)client_to_proxy_context_free; return freerdp_peer_context_new(client); } @@ -149,7 +147,7 @@ pClientContext* pf_context_create_client_context(rdpSettings* clientSettings) if (!context) return NULL; - pc = (pClientContext*) context; + pc = (pClientContext*)context; if (!pf_context_copy_settings(context->settings, clientSettings)) goto error; diff --git a/server/proxy/pf_context.h b/server/proxy/pf_context.h index 311123391..afbd15435 100644 --- a/server/proxy/pf_context.h +++ b/server/proxy/pf_context.h @@ -78,9 +78,10 @@ struct p_client_context * In a case when freerdp_connect fails, * Used for NLA fallback feature, to check if the server should close the connection. * When it is set to TRUE, proxy's client knows it shouldn't signal the server thread to closed - * the connection when pf_client_post_disconnect is called, because it is trying to connect reconnect without NLA. - * It must be set to TRUE before the first try, and to FALSE after the connection fully established, - * to ensure graceful shutdown of the connection when it will be closed. + * the connection when pf_client_post_disconnect is called, because it is trying to connect + * reconnect without NLA. It must be set to TRUE before the first try, and to FALSE after the + * connection fully established, to ensure graceful shutdown of the connection when it will be + * closed. */ BOOL allow_next_conn_failure; diff --git a/server/proxy/pf_disp.c b/server/proxy/pf_disp.c index e03b7e0c9..d6d62e7da 100644 --- a/server/proxy/pf_disp.c +++ b/server/proxy/pf_disp.c @@ -41,18 +41,17 @@ BOOL pf_server_disp_init(pServerContext* ps) static UINT pf_disp_monitor_layout(DispServerContext* context, const DISPLAY_CONTROL_MONITOR_LAYOUT_PDU* pdu) { - proxyData* pdata = (proxyData*) context->custom; - DispClientContext* client = (DispClientContext*) pdata->pc->disp; + proxyData* pdata = (proxyData*)context->custom; + DispClientContext* client = (DispClientContext*)pdata->pc->disp; WLog_DBG(TAG, __FUNCTION__); return client->SendMonitorLayout(client, pdu->NumMonitors, pdu->Monitors); } static UINT pf_disp_on_caps_control(DispClientContext* context, UINT32 MaxNumMonitors, - UINT32 MaxMonitorAreaFactorA, - UINT32 MaxMonitorAreaFactorB) + UINT32 MaxMonitorAreaFactorA, UINT32 MaxMonitorAreaFactorB) { - proxyData* pdata = (proxyData*) context->custom; - DispServerContext* server = (DispServerContext*) pdata->ps->disp; + proxyData* pdata = (proxyData*)context->custom; + DispServerContext* server = (DispServerContext*)pdata->ps->disp; WLog_DBG(TAG, __FUNCTION__); /* Update caps of proxy's disp server */ server->MaxMonitorAreaFactorA = MaxMonitorAreaFactorA; @@ -63,10 +62,10 @@ static UINT pf_disp_on_caps_control(DispClientContext* context, UINT32 MaxNumMon } void pf_disp_register_callbacks(DispClientContext* client, DispServerContext* server, - proxyData* pdata) + proxyData* pdata) { - client->custom = (void*) pdata; - server->custom = (void*) pdata; + client->custom = (void*)pdata; + server->custom = (void*)pdata; /* client receives from server, forward using disp server to original client */ client->DisplayControlCaps = pf_disp_on_caps_control; /* server receives from client, forward to target server using disp client */ diff --git a/server/proxy/pf_disp.h b/server/proxy/pf_disp.h index ae83c2720..4a20a3a6d 100644 --- a/server/proxy/pf_disp.h +++ b/server/proxy/pf_disp.h @@ -27,6 +27,6 @@ BOOL pf_server_disp_init(pServerContext* ps); void pf_disp_register_callbacks(DispClientContext* client, DispServerContext* server, - proxyData* pdata); + proxyData* pdata); #endif /*FREERDP_SERVER_PROXY_RDPEDISP_H*/ diff --git a/server/proxy/pf_gdi.c b/server/proxy/pf_gdi.c index 67ddd76a2..d27144149 100644 --- a/server/proxy/pf_gdi.c +++ b/server/proxy/pf_gdi.c @@ -37,8 +37,7 @@ #define TAG PROXY_TAG("gdi") /* TODO: Figure how to use functions decleared in update.c */ -static BOOL pf_gdi_set_bounds(rdpContext* context, - const rdpBounds* bounds) +static BOOL pf_gdi_set_bounds(rdpContext* context, const rdpBounds* bounds) { WLog_INFO(TAG, __FUNCTION__); return TRUE; @@ -62,8 +61,7 @@ static BOOL pf_gdi_scrblt(rdpContext* context, const SCRBLT_ORDER* scrblt) return TRUE; } -static BOOL pf_gdi_opaque_rect(rdpContext* context, - const OPAQUE_RECT_ORDER* opaque_rect) +static BOOL pf_gdi_opaque_rect(rdpContext* context, const OPAQUE_RECT_ORDER* opaque_rect) { WLog_INFO(TAG, __FUNCTION__); return TRUE; @@ -82,8 +80,7 @@ static BOOL pf_gdi_line_to(rdpContext* context, const LINE_TO_ORDER* line_to) return TRUE; } -static BOOL pf_gdi_polyline(rdpContext* context, - const POLYLINE_ORDER* polyline) +static BOOL pf_gdi_polyline(rdpContext* context, const POLYLINE_ORDER* polyline) { WLog_INFO(TAG, __FUNCTION__); return TRUE; @@ -101,16 +98,13 @@ static BOOL pf_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt) return TRUE; } - -static BOOL pf_gdi_polygon_sc(rdpContext* context, - const POLYGON_SC_ORDER* polygon_sc) +static BOOL pf_gdi_polygon_sc(rdpContext* context, const POLYGON_SC_ORDER* polygon_sc) { WLog_INFO(TAG, __FUNCTION__); return TRUE; } -static BOOL pf_gdi_polygon_cb(rdpContext* context, - POLYGON_CB_ORDER* polygon_cb) +static BOOL pf_gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb) { WLog_INFO(TAG, __FUNCTION__); return TRUE; @@ -123,8 +117,7 @@ static BOOL pf_gdi_surface_frame_marker(rdpContext* context, return TRUE; } -static BOOL pf_gdi_surface_bits(rdpContext* context, - const SURFACE_BITS_COMMAND* cmd) +static BOOL pf_gdi_surface_bits(rdpContext* context, const SURFACE_BITS_COMMAND* cmd) { WLog_INFO(TAG, __FUNCTION__); return TRUE; @@ -148,4 +141,3 @@ void pf_gdi_register_update_callbacks(rdpUpdate* update) update->SurfaceBits = pf_gdi_surface_bits; update->SurfaceFrameMarker = pf_gdi_surface_frame_marker; } - diff --git a/server/proxy/pf_graphics.c b/server/proxy/pf_graphics.c index 1a2a8b660..49dc61de5 100644 --- a/server/proxy/pf_graphics.c +++ b/server/proxy/pf_graphics.c @@ -56,8 +56,7 @@ static BOOL pf_Bitmap_Paint(rdpContext* context, rdpBitmap* bitmap) return TRUE; } -static BOOL pf_Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, - BOOL primary) +static BOOL pf_Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, BOOL primary) { return TRUE; } @@ -72,8 +71,7 @@ static void pf_Pointer_Free(rdpContext* context, rdpPointer* pointer) { } -static BOOL pf_Pointer_Set(rdpContext* context, - const rdpPointer* pointer) +static BOOL pf_Pointer_Set(rdpContext* context, const rdpPointer* pointer) { return TRUE; } @@ -103,22 +101,19 @@ static void pf_Glyph_Free(rdpContext* context, rdpGlyph* glyph) { } -static BOOL pf_Glyph_Draw(rdpContext* context, const rdpGlyph* glyph, INT32 x, - INT32 y, INT32 w, INT32 h, INT32 sx, INT32 sy, - BOOL fOpRedundant) +static BOOL pf_Glyph_Draw(rdpContext* context, const rdpGlyph* glyph, INT32 x, INT32 y, INT32 w, + INT32 h, INT32 sx, INT32 sy, BOOL fOpRedundant) { return TRUE; } -static BOOL pf_Glyph_BeginDraw(rdpContext* context, INT32 x, INT32 y, - INT32 width, INT32 height, UINT32 bgcolor, - UINT32 fgcolor, BOOL fOpRedundant) +static BOOL pf_Glyph_BeginDraw(rdpContext* context, INT32 x, INT32 y, INT32 width, INT32 height, + UINT32 bgcolor, UINT32 fgcolor, BOOL fOpRedundant) { return TRUE; } -static BOOL pf_Glyph_EndDraw(rdpContext* context, INT32 x, INT32 y, - INT32 width, INT32 height, +static BOOL pf_Glyph_EndDraw(rdpContext* context, INT32 x, INT32 y, INT32 width, INT32 height, UINT32 bgcolor, UINT32 fgcolor) { return TRUE; @@ -129,7 +124,7 @@ BOOL pf_register_pointer(rdpGraphics* graphics) { rdpPointer* pointer = NULL; - if (!(pointer = (rdpPointer*) calloc(1, sizeof(rdpPointer)))) + if (!(pointer = (rdpPointer*)calloc(1, sizeof(rdpPointer)))) return FALSE; pointer->size = sizeof(rdpPointer); diff --git a/server/proxy/pf_input.c b/server/proxy/pf_input.c index b56ea04d5..156548db5 100644 --- a/server/proxy/pf_input.c +++ b/server/proxy/pf_input.c @@ -81,8 +81,7 @@ static BOOL pf_server_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT1 return TRUE; } -static BOOL pf_server_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, - UINT16 y) +static BOOL pf_server_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) { pServerContext* ps = (pServerContext*)input->context; pClientContext* pc = ps->pdata->pc; diff --git a/server/proxy/pf_modules.c b/server/proxy/pf_modules.c index 4a68a596a..f4e8278ad 100644 --- a/server/proxy/pf_modules.c +++ b/server/proxy/pf_modules.c @@ -103,17 +103,17 @@ BOOL pf_modules_run_hook(PF_HOOK_TYPE type, rdpContext* context) switch (type) { - case HOOK_TYPE_CLIENT_PRE_CONNECT: - IFCALLRET(ops->ClientPreConnect, ok, ops, context); - break; + case HOOK_TYPE_CLIENT_PRE_CONNECT: + IFCALLRET(ops->ClientPreConnect, ok, ops, context); + break; - case HOOK_TYPE_SERVER_CHANNELS_INIT: - IFCALLRET(ops->ServerChannelsInit, ok, ops, context); - break; + case HOOK_TYPE_SERVER_CHANNELS_INIT: + IFCALLRET(ops->ServerChannelsInit, ok, ops, context); + break; - case HOOK_TYPE_SERVER_CHANNELS_FREE: - IFCALLRET(ops->ServerChannelsFree, ok, ops, context); - break; + case HOOK_TYPE_SERVER_CHANNELS_FREE: + IFCALLRET(ops->ServerChannelsFree, ok, ops, context); + break; } if (!ok) @@ -149,13 +149,13 @@ BOOL pf_modules_run_filter(PF_FILTER_TYPE type, rdpContext* server, void* param) switch (type) { - case FILTER_TYPE_KEYBOARD: - IFCALLRET(ops->KeyboardEvent, result, ops, server, param); - break; + case FILTER_TYPE_KEYBOARD: + IFCALLRET(ops->KeyboardEvent, result, ops, server, param); + break; - case FILTER_TYPE_MOUSE: - IFCALLRET(ops->MouseEvent, result, ops, server, param); - break; + case FILTER_TYPE_MOUSE: + IFCALLRET(ops->MouseEvent, result, ops, server, param); + break; } if (!result) @@ -236,7 +236,7 @@ static BOOL pf_modules_set_session_data(moduleOperations* module, rdpContext* co if (data == NULL) /* no need to store anything */ return FALSE; - ps = (pServerContext*) context; + ps = (pServerContext*)context; if (HashTable_Add(ps->modules_info, (void*)module, data) < 0) { WLog_ERR(TAG, "[%s]: HashTable_Add failed!"); diff --git a/server/proxy/pf_rdpgfx.c b/server/proxy/pf_rdpgfx.c index 74c24c7b9..4bcfd7467 100644 --- a/server/proxy/pf_rdpgfx.c +++ b/server/proxy/pf_rdpgfx.c @@ -48,9 +48,9 @@ static UINT pf_rdpgfx_reset_graphics(RdpgfxClientContext* context, const RDPGFX_RESET_GRAPHICS_PDU* resetGraphics) { UINT error; - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; proxyConfig* config = pdata->config; - RdpgfxServerContext* server = (RdpgfxServerContext*) pdata->ps->gfx; + RdpgfxServerContext* server = (RdpgfxServerContext*)pdata->ps->gfx; RdpgfxClientContext* gfx_decoder = pdata->pc->gfx_decoder; WLog_VRB(TAG, __FUNCTION__); @@ -67,9 +67,9 @@ static UINT pf_rdpgfx_start_frame(RdpgfxClientContext* context, const RDPGFX_START_FRAME_PDU* startFrame) { UINT error; - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; proxyConfig* config = pdata->config; - RdpgfxServerContext* server = (RdpgfxServerContext*) pdata->ps->gfx; + RdpgfxServerContext* server = (RdpgfxServerContext*)pdata->ps->gfx; RdpgfxClientContext* gfx_decoder = pdata->pc->gfx_decoder; WLog_VRB(TAG, __FUNCTION__); @@ -82,13 +82,12 @@ static UINT pf_rdpgfx_start_frame(RdpgfxClientContext* context, return gfx_decoder->StartFrame(gfx_decoder, startFrame); } -static UINT pf_rdpgfx_end_frame(RdpgfxClientContext* context, - const RDPGFX_END_FRAME_PDU* endFrame) +static UINT pf_rdpgfx_end_frame(RdpgfxClientContext* context, const RDPGFX_END_FRAME_PDU* endFrame) { UINT error; - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; proxyConfig* config = pdata->config; - RdpgfxServerContext* server = (RdpgfxServerContext*) pdata->ps->gfx; + RdpgfxServerContext* server = (RdpgfxServerContext*)pdata->ps->gfx; RdpgfxClientContext* gfx_decoder = pdata->pc->gfx_decoder; WLog_VRB(TAG, __FUNCTION__); @@ -105,9 +104,9 @@ static UINT pf_rdpgfx_surface_command(RdpgfxClientContext* context, const RDPGFX_SURFACE_COMMAND* cmd) { UINT error; - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; proxyConfig* config = pdata->config; - RdpgfxServerContext* server = (RdpgfxServerContext*) pdata->ps->gfx; + RdpgfxServerContext* server = (RdpgfxServerContext*)pdata->ps->gfx; RdpgfxClientContext* gfx_decoder = pdata->pc->gfx_decoder; WLog_VRB(TAG, __FUNCTION__); @@ -120,13 +119,14 @@ static UINT pf_rdpgfx_surface_command(RdpgfxClientContext* context, return gfx_decoder->SurfaceCommand(gfx_decoder, cmd); } -static UINT pf_rdpgfx_delete_encoding_context(RdpgfxClientContext* context, - const RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext) +static UINT +pf_rdpgfx_delete_encoding_context(RdpgfxClientContext* context, + const RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext) { UINT error; - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; proxyConfig* config = pdata->config; - RdpgfxServerContext* server = (RdpgfxServerContext*) pdata->ps->gfx; + RdpgfxServerContext* server = (RdpgfxServerContext*)pdata->ps->gfx; RdpgfxClientContext* gfx_decoder = pdata->pc->gfx_decoder; WLog_VRB(TAG, __FUNCTION__); @@ -143,9 +143,9 @@ static UINT pf_rdpgfx_create_surface(RdpgfxClientContext* context, const RDPGFX_CREATE_SURFACE_PDU* createSurface) { UINT error; - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; proxyConfig* config = pdata->config; - RdpgfxServerContext* server = (RdpgfxServerContext*) pdata->ps->gfx; + RdpgfxServerContext* server = (RdpgfxServerContext*)pdata->ps->gfx; RdpgfxClientContext* gfx_decoder = pdata->pc->gfx_decoder; WLog_VRB(TAG, __FUNCTION__); @@ -162,9 +162,9 @@ static UINT pf_rdpgfx_delete_surface(RdpgfxClientContext* context, const RDPGFX_DELETE_SURFACE_PDU* deleteSurface) { UINT error; - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; proxyConfig* config = pdata->config; - RdpgfxServerContext* server = (RdpgfxServerContext*) pdata->ps->gfx; + RdpgfxServerContext* server = (RdpgfxServerContext*)pdata->ps->gfx; RdpgfxClientContext* gfx_decoder = pdata->pc->gfx_decoder; WLog_VRB(TAG, __FUNCTION__); @@ -181,9 +181,9 @@ static UINT pf_rdpgfx_solid_fill(RdpgfxClientContext* context, const RDPGFX_SOLID_FILL_PDU* solidFill) { UINT error; - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; proxyConfig* config = pdata->config; - RdpgfxServerContext* server = (RdpgfxServerContext*) pdata->ps->gfx; + RdpgfxServerContext* server = (RdpgfxServerContext*)pdata->ps->gfx; RdpgfxClientContext* gfx_decoder = pdata->pc->gfx_decoder; WLog_VRB(TAG, __FUNCTION__); @@ -197,12 +197,12 @@ static UINT pf_rdpgfx_solid_fill(RdpgfxClientContext* context, } static UINT pf_rdpgfx_surface_to_surface(RdpgfxClientContext* context, - const RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface) + const RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface) { UINT error; - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; proxyConfig* config = pdata->config; - RdpgfxServerContext* server = (RdpgfxServerContext*) pdata->ps->gfx; + RdpgfxServerContext* server = (RdpgfxServerContext*)pdata->ps->gfx; RdpgfxClientContext* gfx_decoder = pdata->pc->gfx_decoder; WLog_VRB(TAG, __FUNCTION__); @@ -219,9 +219,9 @@ static UINT pf_rdpgfx_surface_to_cache(RdpgfxClientContext* context, const RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache) { UINT error; - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; proxyConfig* config = pdata->config; - RdpgfxServerContext* server = (RdpgfxServerContext*) pdata->ps->gfx; + RdpgfxServerContext* server = (RdpgfxServerContext*)pdata->ps->gfx; RdpgfxClientContext* gfx_decoder = pdata->pc->gfx_decoder; WLog_VRB(TAG, __FUNCTION__); @@ -238,9 +238,9 @@ static UINT pf_rdpgfx_cache_to_surface(RdpgfxClientContext* context, const RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface) { UINT error; - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; proxyConfig* config = pdata->config; - RdpgfxServerContext* server = (RdpgfxServerContext*) pdata->ps->gfx; + RdpgfxServerContext* server = (RdpgfxServerContext*)pdata->ps->gfx; RdpgfxClientContext* gfx_decoder = pdata->pc->gfx_decoder; WLog_VRB(TAG, __FUNCTION__); @@ -254,10 +254,10 @@ static UINT pf_rdpgfx_cache_to_surface(RdpgfxClientContext* context, } static UINT pf_rdpgfx_cache_import_reply(RdpgfxClientContext* context, - const RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply) + const RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply) { - proxyData* pdata = (proxyData*) context->custom; - RdpgfxServerContext* server = (RdpgfxServerContext*) pdata->ps->gfx; + proxyData* pdata = (proxyData*)context->custom; + RdpgfxServerContext* server = (RdpgfxServerContext*)pdata->ps->gfx; WLog_VRB(TAG, __FUNCTION__); return server->CacheImportReply(server, cacheImportReply); } @@ -266,9 +266,9 @@ static UINT pf_rdpgfx_evict_cache_entry(RdpgfxClientContext* context, const RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry) { UINT error; - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; proxyConfig* config = pdata->config; - RdpgfxServerContext* server = (RdpgfxServerContext*) pdata->ps->gfx; + RdpgfxServerContext* server = (RdpgfxServerContext*)pdata->ps->gfx; RdpgfxClientContext* gfx_decoder = pdata->pc->gfx_decoder; WLog_VRB(TAG, __FUNCTION__); @@ -282,12 +282,12 @@ static UINT pf_rdpgfx_evict_cache_entry(RdpgfxClientContext* context, } static UINT pf_rdpgfx_map_surface_to_output(RdpgfxClientContext* context, - const RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput) + const RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput) { UINT error; - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; proxyConfig* config = pdata->config; - RdpgfxServerContext* server = (RdpgfxServerContext*) pdata->ps->gfx; + RdpgfxServerContext* server = (RdpgfxServerContext*)pdata->ps->gfx; RdpgfxClientContext* gfx_decoder = pdata->pc->gfx_decoder; WLog_VRB(TAG, __FUNCTION__); @@ -301,12 +301,12 @@ static UINT pf_rdpgfx_map_surface_to_output(RdpgfxClientContext* context, } static UINT pf_rdpgfx_map_surface_to_window(RdpgfxClientContext* context, - const RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow) + const RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow) { UINT error; - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; proxyConfig* config = pdata->config; - RdpgfxServerContext* server = (RdpgfxServerContext*) pdata->ps->gfx; + RdpgfxServerContext* server = (RdpgfxServerContext*)pdata->ps->gfx; RdpgfxClientContext* gfx_decoder = pdata->pc->gfx_decoder; WLog_VRB(TAG, __FUNCTION__); @@ -319,13 +319,14 @@ static UINT pf_rdpgfx_map_surface_to_window(RdpgfxClientContext* context, return gfx_decoder->MapSurfaceToWindow(gfx_decoder, surfaceToWindow); } -static UINT pf_rdpgfx_map_surface_to_scaled_window(RdpgfxClientContext* context, - const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* surfaceToScaledWindow) +static UINT pf_rdpgfx_map_surface_to_scaled_window( + RdpgfxClientContext* context, + const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* surfaceToScaledWindow) { UINT error; - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; proxyConfig* config = pdata->config; - RdpgfxServerContext* server = (RdpgfxServerContext*) pdata->ps->gfx; + RdpgfxServerContext* server = (RdpgfxServerContext*)pdata->ps->gfx; RdpgfxClientContext* gfx_decoder = pdata->pc->gfx_decoder; WLog_VRB(TAG, __FUNCTION__); @@ -338,14 +339,14 @@ static UINT pf_rdpgfx_map_surface_to_scaled_window(RdpgfxClientContext* context, return gfx_decoder->MapSurfaceToScaledWindow(gfx_decoder, surfaceToScaledWindow); } - -static UINT pf_rdpgfx_map_surface_to_scaled_output(RdpgfxClientContext* context, - const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* surfaceToScaledOutput) +static UINT pf_rdpgfx_map_surface_to_scaled_output( + RdpgfxClientContext* context, + const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* surfaceToScaledOutput) { UINT error; - proxyData* pdata = (proxyData*) context->custom; + proxyData* pdata = (proxyData*)context->custom; proxyConfig* config = pdata->config; - RdpgfxServerContext* server = (RdpgfxServerContext*) pdata->ps->gfx; + RdpgfxServerContext* server = (RdpgfxServerContext*)pdata->ps->gfx; RdpgfxClientContext* gfx_decoder = pdata->pc->gfx_decoder; WLog_VRB(TAG, __FUNCTION__); @@ -358,8 +359,8 @@ static UINT pf_rdpgfx_map_surface_to_scaled_output(RdpgfxClientContext* context, return gfx_decoder->MapSurfaceToScaledOutput(gfx_decoder, surfaceToScaledOutput); } -static UINT pf_rdpgfx_on_open(RdpgfxClientContext* context, - BOOL* do_caps_advertise, BOOL* send_frame_acks) +static UINT pf_rdpgfx_on_open(RdpgfxClientContext* context, BOOL* do_caps_advertise, + BOOL* send_frame_acks) { WLog_VRB(TAG, __FUNCTION__); @@ -375,8 +376,8 @@ static UINT pf_rdpgfx_on_open(RdpgfxClientContext* context, static UINT pf_rdpgfx_caps_confirm(RdpgfxClientContext* context, const RDPGFX_CAPS_CONFIRM_PDU* capsConfirm) { - proxyData* pdata = (proxyData*) context->custom; - RdpgfxServerContext* server = (RdpgfxServerContext*) pdata->ps->gfx; + proxyData* pdata = (proxyData*)context->custom; + RdpgfxServerContext* server = (RdpgfxServerContext*)pdata->ps->gfx; WLog_VRB(TAG, __FUNCTION__); return server->CapsConfirm(server, capsConfirm); } @@ -385,8 +386,8 @@ static UINT pf_rdpgfx_caps_confirm(RdpgfxClientContext* context, static UINT pf_rdpgfx_caps_advertise(RdpgfxServerContext* context, const RDPGFX_CAPS_ADVERTISE_PDU* capsAdvertise) { - proxyData* pdata = (proxyData*) context->custom; - RdpgfxClientContext* client = (RdpgfxClientContext*) pdata->pc->gfx_proxy; + proxyData* pdata = (proxyData*)context->custom; + RdpgfxClientContext* client = (RdpgfxClientContext*)pdata->pc->gfx_proxy; UINT16 index; UINT16 proxySupportedCapsSetCount = 0; RDPGFX_CAPS_ADVERTISE_PDU supportedCapsAdvertise; @@ -419,26 +420,27 @@ static UINT pf_rdpgfx_caps_advertise(RdpgfxServerContext* context, static UINT pf_rdpgfx_frame_acknowledge(RdpgfxServerContext* context, const RDPGFX_FRAME_ACKNOWLEDGE_PDU* frameAcknowledge) { - proxyData* pdata = (proxyData*) context->custom; - RdpgfxClientContext* client = (RdpgfxClientContext*) pdata->pc->gfx_proxy; + proxyData* pdata = (proxyData*)context->custom; + RdpgfxClientContext* client = (RdpgfxClientContext*)pdata->pc->gfx_proxy; WLog_VRB(TAG, __FUNCTION__); return client->FrameAcknowledge(client, frameAcknowledge); } -static UINT pf_rdpgfx_qoe_frame_acknowledge(RdpgfxServerContext* context, - const RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU* qoeFrameAcknowledge) +static UINT +pf_rdpgfx_qoe_frame_acknowledge(RdpgfxServerContext* context, + const RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU* qoeFrameAcknowledge) { - proxyData* pdata = (proxyData*) context->custom; - RdpgfxClientContext* client = (RdpgfxClientContext*) pdata->pc->gfx_proxy; + proxyData* pdata = (proxyData*)context->custom; + RdpgfxClientContext* client = (RdpgfxClientContext*)pdata->pc->gfx_proxy; WLog_VRB(TAG, __FUNCTION__); return client->QoeFrameAcknowledge(client, qoeFrameAcknowledge); } static UINT pf_rdpgfx_cache_import_offer(RdpgfxServerContext* context, - const RDPGFX_CACHE_IMPORT_OFFER_PDU* cacheImportOffer) + const RDPGFX_CACHE_IMPORT_OFFER_PDU* cacheImportOffer) { - proxyData* pdata = (proxyData*) context->custom; - RdpgfxClientContext* client = (RdpgfxClientContext*) pdata->pc->gfx_proxy; + proxyData* pdata = (proxyData*)context->custom; + RdpgfxClientContext* client = (RdpgfxClientContext*)pdata->pc->gfx_proxy; WLog_VRB(TAG, __FUNCTION__); if (pdata->config->SessionCapture) @@ -467,8 +469,8 @@ void pf_rdpgfx_pipeline_init(RdpgfxClientContext* gfx, RdpgfxServerContext* serv gdi_graphics_pipeline_init(pc->context.gdi, pc->gfx_decoder); /* Set server and client side references to proxy data */ - gfx->custom = (void*) pdata; - server->custom = (void*) pdata; + gfx->custom = (void*)pdata; + server->custom = (void*)pdata; /* Set client callbacks */ gfx->ResetGraphics = pf_rdpgfx_reset_graphics; gfx->StartFrame = pf_rdpgfx_start_frame; diff --git a/server/proxy/pf_server.c b/server/proxy/pf_server.c index b71e93a77..a7ee7f2fe 100644 --- a/server/proxy/pf_server.c +++ b/server/proxy/pf_server.c @@ -54,14 +54,14 @@ #define TAG PROXY_TAG("server") -static BOOL pf_server_parse_target_from_routing_token(rdpContext* context, - char** target, DWORD* port) +static BOOL pf_server_parse_target_from_routing_token(rdpContext* context, char** target, + DWORD* port) { -#define TARGET_MAX (100) +#define TARGET_MAX (100) #define ROUTING_TOKEN_PREFIX "Cookie: msts=" char* colon; size_t len; - const size_t prefix_len = strnlen(ROUTING_TOKEN_PREFIX, sizeof(ROUTING_TOKEN_PREFIX)); + const size_t prefix_len = strnlen(ROUTING_TOKEN_PREFIX, sizeof(ROUTING_TOKEN_PREFIX)); DWORD routing_token_length; const char* routing_token = freerdp_nego_get_routing_token(context, &routing_token_length); @@ -73,8 +73,11 @@ static BOOL pf_server_parse_target_from_routing_token(rdpContext* context, if ((routing_token_length <= prefix_len) || (routing_token_length >= TARGET_MAX)) { - WLog_ERR(TAG, "pf_server_parse_target_from_routing_token(): invalid routing token length: %"PRIu32"", - routing_token_length); + WLog_ERR( + TAG, + "pf_server_parse_target_from_routing_token(): invalid routing token length: %" PRIu32 + "", + routing_token_length); return FALSE; } @@ -110,7 +113,7 @@ static BOOL pf_server_get_target_info(rdpContext* context, rdpSettings* settings proxyConfig* config) { WLog_INFO(TAG, "pf_server_get_target_info(): fetching target from %s", - config->UseLoadBalanceInfo ? "load-balance-info" : "config"); + config->UseLoadBalanceInfo ? "load-balance-info" : "config"); if (config->UseLoadBalanceInfo) return pf_server_parse_target_from_routing_token(context, &settings->ServerHostname, @@ -169,7 +172,7 @@ static BOOL pf_server_post_connect(freerdp_peer* client) return FALSE; } - WLog_INFO(TAG, "pf_server_post_connect(): target == %s:%"PRIu16"", + WLog_INFO(TAG, "pf_server_post_connect(): target == %s:%" PRIu16 "", client_settings->ServerHostname, client_settings->ServerPort); if (!pf_server_channels_init(ps)) @@ -308,41 +311,43 @@ static DWORD WINAPI pf_server_handle_client(LPVOID arg) /* only disconnect after checking client's and vcm's file descriptors */ if (proxy_data_shall_disconnect(pdata)) { - WLog_INFO(TAG, "abort_event is set, closing connection with client %s", client->hostname); + WLog_INFO(TAG, "abort_event is set, closing connection with client %s", + client->hostname); break; } - + switch (WTSVirtualChannelManagerGetDrdynvcState(ps->vcm)) { - /* Dynamic channel status may have been changed after processing */ - case DRDYNVC_STATE_NONE: + /* Dynamic channel status may have been changed after processing */ + case DRDYNVC_STATE_NONE: - /* Initialize drdynvc channel */ - if (!WTSVirtualChannelManagerCheckFileDescriptor(ps->vcm)) - { - WLog_ERR(TAG, "Failed to initialize drdynvc channel"); - goto fail; - } + /* Initialize drdynvc channel */ + if (!WTSVirtualChannelManagerCheckFileDescriptor(ps->vcm)) + { + WLog_ERR(TAG, "Failed to initialize drdynvc channel"); + goto fail; + } - break; + break; - case DRDYNVC_STATE_READY: - if (WaitForSingleObject(ps->dynvcReady, 0) == WAIT_TIMEOUT) - { - SetEvent(ps->dynvcReady); - } + case DRDYNVC_STATE_READY: + if (WaitForSingleObject(ps->dynvcReady, 0) == WAIT_TIMEOUT) + { + SetEvent(ps->dynvcReady); + } - break; + break; - default: - break; + default: + break; } } fail: - pc = (rdpContext*) pdata->pc; - WLog_INFO(TAG, "pf_server_handle_client(): starting shutdown of connection (client %s)", client->hostname); + pc = (rdpContext*)pdata->pc; + WLog_INFO(TAG, "pf_server_handle_client(): starting shutdown of connection (client %s)", + client->hostname); WLog_INFO(TAG, "pf_server_handle_client(): stopping proxy's client"); freerdp_client_stop(pc); WLog_INFO(TAG, "pf_server_handle_client(): freeing server's channels"); diff --git a/server/proxy/pf_update.c b/server/proxy/pf_update.c index 17bbc645b..180dc087e 100644 --- a/server/proxy/pf_update.c +++ b/server/proxy/pf_update.c @@ -32,19 +32,17 @@ /* server callbacks */ -static BOOL pf_server_refresh_rect(rdpContext* context, BYTE count, - const RECTANGLE_16* areas) +static BOOL pf_server_refresh_rect(rdpContext* context, BYTE count, const RECTANGLE_16* areas) { pServerContext* ps = (pServerContext*)context; - rdpContext* pc = (rdpContext*) ps->pdata->pc; + rdpContext* pc = (rdpContext*)ps->pdata->pc; return pc->update->RefreshRect(pc, count, areas); } -static BOOL pf_server_suppress_output(rdpContext* context, BYTE allow, - const RECTANGLE_16* area) +static BOOL pf_server_suppress_output(rdpContext* context, BYTE allow, const RECTANGLE_16* area) { pServerContext* ps = (pServerContext*)context; - rdpContext* pc = (rdpContext*) ps->pdata->pc; + rdpContext* pc = (rdpContext*)ps->pdata->pc; return pc->update->SuppressOutput(pc, allow, area); } @@ -56,7 +54,7 @@ static BOOL pf_server_suppress_output(rdpContext* context, BYTE allow, */ static BOOL pf_client_begin_paint(rdpContext* context) { - pClientContext* pc = (pClientContext*) context; + pClientContext* pc = (pClientContext*)context; proxyData* pdata = pc->pdata; rdpContext* ps = (rdpContext*)pdata->ps; return ps->update->BeginPaint(ps); @@ -69,7 +67,7 @@ static BOOL pf_client_begin_paint(rdpContext* context) */ static BOOL pf_client_end_paint(rdpContext* context) { - pClientContext* pc = (pClientContext*) context; + pClientContext* pc = (pClientContext*)context; proxyData* pdata = pc->pdata; rdpContext* ps = (rdpContext*)pdata->ps; rdpGdi* gdi = context->gdi; @@ -97,7 +95,7 @@ static BOOL pf_client_end_paint(rdpContext* context) static BOOL pf_client_bitmap_update(rdpContext* context, const BITMAP_UPDATE* bitmap) { - pClientContext* pc = (pClientContext*) context; + pClientContext* pc = (pClientContext*)context; proxyData* pdata = pc->pdata; rdpContext* ps = (rdpContext*)pdata->ps; return ps->update->BitmapUpdate(ps, bitmap); @@ -105,7 +103,7 @@ static BOOL pf_client_bitmap_update(rdpContext* context, const BITMAP_UPDATE* bi static BOOL pf_client_desktop_resize(rdpContext* context) { - pClientContext* pc = (pClientContext*) context; + pClientContext* pc = (pClientContext*)context; proxyData* pdata = pc->pdata; rdpContext* ps = (rdpContext*)pdata->ps; ps->settings->DesktopWidth = context->settings->DesktopWidth; @@ -116,52 +114,51 @@ static BOOL pf_client_desktop_resize(rdpContext* context) static BOOL pf_client_remote_monitors(rdpContext* context, UINT32 count, const MONITOR_DEF* monitors) { - pClientContext* pc = (pClientContext*) context; + pClientContext* pc = (pClientContext*)context; proxyData* pdata = pc->pdata; rdpContext* ps = (rdpContext*)pdata->ps; return freerdp_display_send_monitor_layout(ps, count, monitors); } static BOOL pf_client_send_pointer_system(rdpContext* context, - const POINTER_SYSTEM_UPDATE* pointer_system) + const POINTER_SYSTEM_UPDATE* pointer_system) { - pClientContext* pc = (pClientContext*) context; + pClientContext* pc = (pClientContext*)context; proxyData* pdata = pc->pdata; rdpContext* ps = (rdpContext*)pdata->ps; return ps->update->pointer->PointerSystem(ps, pointer_system); } static BOOL pf_client_send_pointer_position(rdpContext* context, - const POINTER_POSITION_UPDATE* pointerPosition) + const POINTER_POSITION_UPDATE* pointerPosition) { - pClientContext* pc = (pClientContext*) context; + pClientContext* pc = (pClientContext*)context; proxyData* pdata = pc->pdata; rdpContext* ps = (rdpContext*)pdata->ps; return ps->update->pointer->PointerPosition(ps, pointerPosition); } static BOOL pf_client_send_pointer_color(rdpContext* context, - const POINTER_COLOR_UPDATE* pointer_color) + const POINTER_COLOR_UPDATE* pointer_color) { - pClientContext* pc = (pClientContext*) context; + pClientContext* pc = (pClientContext*)context; proxyData* pdata = pc->pdata; rdpContext* ps = (rdpContext*)pdata->ps; return ps->update->pointer->PointerColor(ps, pointer_color); } -static BOOL pf_client_send_pointer_new(rdpContext* context, - const POINTER_NEW_UPDATE* pointer_new) +static BOOL pf_client_send_pointer_new(rdpContext* context, const POINTER_NEW_UPDATE* pointer_new) { - pClientContext* pc = (pClientContext*) context; + pClientContext* pc = (pClientContext*)context; proxyData* pdata = pc->pdata; rdpContext* ps = (rdpContext*)pdata->ps; return ps->update->pointer->PointerNew(ps, pointer_new); } static BOOL pf_client_send_pointer_cached(rdpContext* context, - const POINTER_CACHED_UPDATE* pointer_cached) + const POINTER_CACHED_UPDATE* pointer_cached) { - pClientContext* pc = (pClientContext*) context; + pClientContext* pc = (pClientContext*)context; proxyData* pdata = pc->pdata; rdpContext* ps = (rdpContext*)pdata->ps; return ps->update->pointer->PointerCached(ps, pointer_cached); @@ -169,7 +166,7 @@ static BOOL pf_client_send_pointer_cached(rdpContext* context, static BOOL pf_client_save_session_info(rdpContext* context, UINT32 type, void* data) { - pClientContext* pc = (pClientContext*) context; + pClientContext* pc = (pClientContext*)context; proxyData* pdata = pc->pdata; rdpContext* ps = (rdpContext*)pdata->ps; return ps->update->SaveSessionInfo(ps, type, data); diff --git a/server/shadow/Mac/mac_shadow.c b/server/shadow/Mac/mac_shadow.c index 2297005a0..053232978 100644 --- a/server/shadow/Mac/mac_shadow.c +++ b/server/shadow/Mac/mac_shadow.c @@ -29,11 +29,10 @@ #define TAG SERVER_TAG("shadow.mac") - static macShadowSubsystem* g_Subsystem = NULL; static BOOL mac_shadow_input_synchronize_event(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT32 flags) + rdpShadowClient* client, UINT32 flags) { if (!subsystem || !client) return FALSE; @@ -41,8 +40,8 @@ static BOOL mac_shadow_input_synchronize_event(rdpShadowSubsystem* subsystem, return TRUE; } -static BOOL mac_shadow_input_keyboard_event(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT16 flags, UINT16 code) +static BOOL mac_shadow_input_keyboard_event(rdpShadowSubsystem* subsystem, rdpShadowClient* client, + UINT16 flags, UINT16 code) { DWORD vkcode; DWORD keycode; @@ -72,13 +71,13 @@ static BOOL mac_shadow_input_keyboard_event(rdpShadowSubsystem* subsystem, if (flags & KBD_FLAGS_DOWN) { - kbdEvent = CGEventCreateKeyboardEvent(source, (CGKeyCode) keycode, TRUE); + kbdEvent = CGEventCreateKeyboardEvent(source, (CGKeyCode)keycode, TRUE); CGEventPost(kCGHIDEventTap, kbdEvent); CFRelease(kbdEvent); } else if (flags & KBD_FLAGS_RELEASE) { - kbdEvent = CGEventCreateKeyboardEvent(source, (CGKeyCode) keycode, FALSE); + kbdEvent = CGEventCreateKeyboardEvent(source, (CGKeyCode)keycode, FALSE); CGEventPost(kCGHIDEventTap, kbdEvent); CFRelease(kbdEvent); } @@ -87,8 +86,9 @@ static BOOL mac_shadow_input_keyboard_event(rdpShadowSubsystem* subsystem, return TRUE; } -static BOOL mac_shadow_input_unicode_keyboard_event(rdpShadowSubsystem* - subsystem, rdpShadowClient* client, UINT16 flags, UINT16 code) +static BOOL mac_shadow_input_unicode_keyboard_event(rdpShadowSubsystem* subsystem, + rdpShadowClient* client, UINT16 flags, + UINT16 code) { if (!subsystem || !client) return FALSE; @@ -96,8 +96,8 @@ static BOOL mac_shadow_input_unicode_keyboard_event(rdpShadowSubsystem* return TRUE; } -static BOOL mac_shadow_input_mouse_event(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT16 flags, UINT16 x, UINT16 y) +static BOOL mac_shadow_input_mouse_event(rdpShadowSubsystem* subsystem, rdpShadowClient* client, + UINT16 flags, UINT16 x, UINT16 y) { macShadowSubsystem* mac = (macShadowSubsystem*)subsystem; UINT32 scrollX = 0; @@ -120,19 +120,16 @@ static BOOL mac_shadow_input_mouse_event(rdpShadowSubsystem* subsystem, scrollY = (flags & WheelRotationMask) / 120; } - CGEventSourceRef source = CGEventSourceCreate( - kCGEventSourceStateHIDSystemState); - CGEventRef scroll = CGEventCreateScrollWheelEvent(source, - kCGScrollEventUnitLine, - wheelCount, scrollY, scrollX); + CGEventSourceRef source = CGEventSourceCreate(kCGEventSourceStateHIDSystemState); + CGEventRef scroll = CGEventCreateScrollWheelEvent(source, kCGScrollEventUnitLine, + wheelCount, scrollY, scrollX); CGEventPost(kCGHIDEventTap, scroll); CFRelease(scroll); CFRelease(source); } else { - CGEventSourceRef source = CGEventSourceCreate( - kCGEventSourceStateHIDSystemState); + CGEventSourceRef source = CGEventSourceCreate(kCGEventSourceStateHIDSystemState); CGEventType mouseType = kCGEventNull; CGMouseButton mouseButton = kCGMouseButtonLeft; @@ -147,8 +144,8 @@ static BOOL mac_shadow_input_mouse_event(rdpShadowSubsystem* subsystem, else mouseType = kCGEventMouseMoved; - CGEventRef move = CGEventCreateMouseEvent(source, mouseType, CGPointMake(x, y), - mouseButton); + CGEventRef move = + CGEventCreateMouseEvent(source, mouseType, CGPointMake(x, y), mouseButton); CGEventPost(kCGHIDEventTap, move); CFRelease(move); } @@ -199,8 +196,8 @@ static BOOL mac_shadow_input_mouse_event(rdpShadowSubsystem* subsystem, } } - CGEventRef mouseEvent = CGEventCreateMouseEvent(source, mouseType, - CGPointMake(x, y), mouseButton); + CGEventRef mouseEvent = + CGEventCreateMouseEvent(source, mouseType, CGPointMake(x, y), mouseButton); CGEventPost(kCGHIDEventTap, mouseEvent); CFRelease(mouseEvent); CFRelease(source); @@ -210,7 +207,8 @@ static BOOL mac_shadow_input_mouse_event(rdpShadowSubsystem* subsystem, } static BOOL mac_shadow_input_extended_mouse_event(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT16 flags, UINT16 x, UINT16 y) + rdpShadowClient* client, UINT16 flags, UINT16 x, + UINT16 y) { if (!subsystem || !client) return FALSE; @@ -282,18 +280,18 @@ static int mac_shadow_capture_get_dirty_region(macShadowSubsystem* subsystem) const CGRect* rects; RECTANGLE_16 invalidRect; rdpShadowSurface* surface = subsystem->common.server->surface; - rects = CGDisplayStreamUpdateGetRects(subsystem->lastUpdate, - kCGDisplayStreamUpdateDirtyRects, &numRects); + rects = CGDisplayStreamUpdateGetRects(subsystem->lastUpdate, kCGDisplayStreamUpdateDirtyRects, + &numRects); if (!numRects) return -1; for (index = 0; index < numRects; index++) { - invalidRect.left = (UINT16) rects[index].origin.x; - invalidRect.top = (UINT16) rects[index].origin.y; - invalidRect.right = invalidRect.left + (UINT16) rects[index].size.width; - invalidRect.bottom = invalidRect.top + (UINT16) rects[index].size.height; + invalidRect.left = (UINT16)rects[index].origin.x; + invalidRect.top = (UINT16)rects[index].origin.y; + invalidRect.right = invalidRect.left + (UINT16)rects[index].size.width; + invalidRect.bottom = invalidRect.top + (UINT16)rects[index].size.height; if (subsystem->retina) { @@ -304,16 +302,15 @@ static int mac_shadow_capture_get_dirty_region(macShadowSubsystem* subsystem) invalidRect.bottom /= 2; } - region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), - &invalidRect); + region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect); } return 0; } -static int freerdp_image_copy_from_retina(BYTE* pDstData, DWORD DstFormat, - int nDstStep, int nXDst, int nYDst, - int nWidth, int nHeight, BYTE* pSrcData, int nSrcStep, int nXSrc, int nYSrc) +static int freerdp_image_copy_from_retina(BYTE* pDstData, DWORD DstFormat, int nDstStep, int nXDst, + int nYDst, int nWidth, int nHeight, BYTE* pSrcData, + int nSrcStep, int nXSrc, int nYSrc) { BYTE* pSrcPixel; BYTE* pDstPixel; @@ -348,12 +345,9 @@ static int freerdp_image_copy_from_retina(BYTE* pDstData, DWORD DstFormat, UINT32 R, G, B; UINT32 color; /* simple box filter scaling, could be improved with better algorithm */ - B = pSrcPixel[0] + pSrcPixel[4] + pSrcPixel[nSrcStep + 0] + pSrcPixel[nSrcStep + - 4]; - G = pSrcPixel[1] + pSrcPixel[5] + pSrcPixel[nSrcStep + 1] + pSrcPixel[nSrcStep + - 5]; - R = pSrcPixel[2] + pSrcPixel[6] + pSrcPixel[nSrcStep + 2] + pSrcPixel[nSrcStep + - 6]; + B = pSrcPixel[0] + pSrcPixel[4] + pSrcPixel[nSrcStep + 0] + pSrcPixel[nSrcStep + 4]; + G = pSrcPixel[1] + pSrcPixel[5] + pSrcPixel[nSrcStep + 1] + pSrcPixel[nSrcStep + 5]; + R = pSrcPixel[2] + pSrcPixel[6] + pSrcPixel[nSrcStep + 2] + pSrcPixel[nSrcStep + 6]; pSrcPixel += 8; color = FreeRDPGetColor(DstFormat, R >> 2, G >> 2, B >> 2, 0xFF); WriteColor(pDstPixel, DstFormat, color); @@ -367,109 +361,106 @@ static int freerdp_image_copy_from_retina(BYTE* pDstData, DWORD DstFormat, return 1; } -static void (^mac_capture_stream_handler)(CGDisplayStreamFrameStatus, uint64_t, - IOSurfaceRef, CGDisplayStreamUpdateRef) = - ^(CGDisplayStreamFrameStatus status, uint64_t displayTime, - IOSurfaceRef frameSurface, CGDisplayStreamUpdateRef updateRef) -{ - int x, y; - int count; - int width; - int height; - int nSrcStep; - BYTE* pSrcData; - RECTANGLE_16 surfaceRect; - const RECTANGLE_16* extents; - macShadowSubsystem* subsystem = g_Subsystem; - rdpShadowServer* server = subsystem->common.server; - rdpShadowSurface* surface = server->surface; - count = ArrayList_Count(server->clients); +static void (^mac_capture_stream_handler)( + CGDisplayStreamFrameStatus, uint64_t, IOSurfaceRef, + CGDisplayStreamUpdateRef) = ^(CGDisplayStreamFrameStatus status, uint64_t displayTime, + IOSurfaceRef frameSurface, CGDisplayStreamUpdateRef updateRef) { + int x, y; + int count; + int width; + int height; + int nSrcStep; + BYTE* pSrcData; + RECTANGLE_16 surfaceRect; + const RECTANGLE_16* extents; + macShadowSubsystem* subsystem = g_Subsystem; + rdpShadowServer* server = subsystem->common.server; + rdpShadowSurface* surface = server->surface; + count = ArrayList_Count(server->clients); - if (count < 1) - return; + if (count < 1) + return; - mac_shadow_capture_get_dirty_region(subsystem); - surfaceRect.left = 0; - surfaceRect.top = 0; - surfaceRect.right = surface->width; - surfaceRect.bottom = surface->height; - region16_intersect_rect(&(surface->invalidRegion), &(surface->invalidRegion), - &surfaceRect); + mac_shadow_capture_get_dirty_region(subsystem); + surfaceRect.left = 0; + surfaceRect.top = 0; + surfaceRect.right = surface->width; + surfaceRect.bottom = surface->height; + region16_intersect_rect(&(surface->invalidRegion), &(surface->invalidRegion), &surfaceRect); - if (!region16_is_empty(&(surface->invalidRegion))) - { - extents = region16_extents(&(surface->invalidRegion)); - x = extents->left; - y = extents->top; - width = extents->right - extents->left; - height = extents->bottom - extents->top; - IOSurfaceLock(frameSurface, kIOSurfaceLockReadOnly, NULL); - pSrcData = (BYTE*) IOSurfaceGetBaseAddress(frameSurface); - nSrcStep = (int) IOSurfaceGetBytesPerRow(frameSurface); + if (!region16_is_empty(&(surface->invalidRegion))) + { + extents = region16_extents(&(surface->invalidRegion)); + x = extents->left; + y = extents->top; + width = extents->right - extents->left; + height = extents->bottom - extents->top; + IOSurfaceLock(frameSurface, kIOSurfaceLockReadOnly, NULL); + pSrcData = (BYTE*)IOSurfaceGetBaseAddress(frameSurface); + nSrcStep = (int)IOSurfaceGetBytesPerRow(frameSurface); - if (subsystem->retina) - { - freerdp_image_copy_from_retina(surface->data, surface->format, - surface->scanline, - x, y, width, height, pSrcData, nSrcStep, x, y); - } - else - { - freerdp_image_copy(surface->data, surface->format, surface->scanline, - x, y, width, height, pSrcData, PIXEL_FORMAT_BGRX32, nSrcStep, x, y, NULL, FREERDP_FLIP_NONE); - } + if (subsystem->retina) + { + freerdp_image_copy_from_retina(surface->data, surface->format, surface->scanline, x, y, + width, height, pSrcData, nSrcStep, x, y); + } + else + { + freerdp_image_copy(surface->data, surface->format, surface->scanline, x, y, width, height, + pSrcData, PIXEL_FORMAT_BGRX32, nSrcStep, x, y, NULL, + FREERDP_FLIP_NONE); + } - IOSurfaceUnlock(frameSurface, kIOSurfaceLockReadOnly, NULL); - ArrayList_Lock(server->clients); - count = ArrayList_Count(server->clients); - EnterCriticalSection(&(surface->lock)); - shadow_subsystem_frame_update(&subsystem->common); - LeaveCriticalSection(&(surface->lock)); + IOSurfaceUnlock(frameSurface, kIOSurfaceLockReadOnly, NULL); + ArrayList_Lock(server->clients); + count = ArrayList_Count(server->clients); + EnterCriticalSection(&(surface->lock)); + shadow_subsystem_frame_update(&subsystem->common); + LeaveCriticalSection(&(surface->lock)); - if (count == 1) - { - rdpShadowClient* client; - client = (rdpShadowClient*) ArrayList_GetItem(server->clients, 0); + if (count == 1) + { + rdpShadowClient* client; + client = (rdpShadowClient*)ArrayList_GetItem(server->clients, 0); - if (client) - { - subsystem->common.captureFrameRate = shadow_encoder_preferred_fps(client->encoder); - } - } + if (client) + { + subsystem->common.captureFrameRate = shadow_encoder_preferred_fps(client->encoder); + } + } - ArrayList_Unlock(server->clients); - region16_clear(&(surface->invalidRegion)); - } + ArrayList_Unlock(server->clients); + region16_clear(&(surface->invalidRegion)); + } - if (status != kCGDisplayStreamFrameStatusFrameComplete) - { - switch (status) - { - case kCGDisplayStreamFrameStatusFrameIdle: - break; + if (status != kCGDisplayStreamFrameStatusFrameComplete) + { + switch (status) + { + case kCGDisplayStreamFrameStatusFrameIdle: + break; - case kCGDisplayStreamFrameStatusStopped: - break; + case kCGDisplayStreamFrameStatusStopped: + break; - case kCGDisplayStreamFrameStatusFrameBlank: - break; + case kCGDisplayStreamFrameStatusFrameBlank: + break; - default: - break; - } - } - else if (!subsystem->lastUpdate) - { - CFRetain(updateRef); - subsystem->lastUpdate = updateRef; - } - else - { - CGDisplayStreamUpdateRef tmpRef = subsystem->lastUpdate; - subsystem->lastUpdate = CGDisplayStreamUpdateCreateMergedUpdate(tmpRef, - updateRef); - CFRelease(tmpRef); - } + default: + break; + } + } + else if (!subsystem->lastUpdate) + { + CFRetain(updateRef); + subsystem->lastUpdate = updateRef; + } + else + { + CGDisplayStreamUpdateRef tmpRef = subsystem->lastUpdate; + subsystem->lastUpdate = CGDisplayStreamUpdateCreateMergedUpdate(tmpRef, updateRef); + CFRelease(tmpRef); + } }; static int mac_shadow_capture_init(macShadowSubsystem* subsystem) @@ -480,13 +471,13 @@ static int mac_shadow_capture_init(macShadowSubsystem* subsystem) CGDirectDisplayID displayId; displayId = CGMainDisplayID(); subsystem->captureQueue = dispatch_queue_create("mac.shadow.capture", NULL); - keys[0] = (void*) kCGDisplayStreamShowCursor; - values[0] = (void*) kCFBooleanFalse; - opts = CFDictionaryCreate(kCFAllocatorDefault, (const void**) keys, - (const void**) values, 1, NULL, NULL); - subsystem->stream = CGDisplayStreamCreateWithDispatchQueue(displayId, - subsystem->pixelWidth, subsystem->pixelHeight, - 'BGRA', opts, subsystem->captureQueue, mac_capture_stream_handler); + keys[0] = (void*)kCGDisplayStreamShowCursor; + values[0] = (void*)kCFBooleanFalse; + opts = CFDictionaryCreate(kCFAllocatorDefault, (const void**)keys, (const void**)values, 1, + NULL, NULL); + subsystem->stream = CGDisplayStreamCreateWithDispatchQueue( + displayId, subsystem->pixelWidth, subsystem->pixelHeight, 'BGRA', opts, + subsystem->captureQueue, mac_capture_stream_handler); CFRelease(opts); return 1; } @@ -496,8 +487,7 @@ static int mac_shadow_screen_grab(macShadowSubsystem* subsystem) return 1; } -static int mac_shadow_subsystem_process_message(macShadowSubsystem* subsystem, - wMessage* message) +static int mac_shadow_subsystem_process_message(macShadowSubsystem* subsystem, wMessage* message) { rdpShadowServer* server = subsystem->common.server; rdpShadowSurface* surface = server->surface; @@ -511,7 +501,7 @@ static int mac_shadow_subsystem_process_message(macShadowSubsystem* subsystem, break; default: - WLog_ERR(TAG, "Unknown message id: %"PRIu32"", message->id); + WLog_ERR(TAG, "Unknown message id: %" PRIu32 "", message->id); break; } @@ -586,8 +576,8 @@ static int mac_shadow_enum_monitors(MONITOR_DEF* monitors, int maxMonitors) monitor = &monitors[index]; monitor->left = 0; monitor->top = 0; - monitor->right = (int) wide; - monitor->bottom = (int) high; + monitor->right = (int)wide; + monitor->bottom = (int)high; monitor->flags = 1; return numMonitors; } @@ -623,8 +613,7 @@ static int mac_shadow_subsystem_start(macShadowSubsystem* subsystem) mac_shadow_capture_start(subsystem); - if (!(thread = CreateThread(NULL, 0, mac_shadow_subsystem_thread, - (void*) subsystem, 0, NULL))) + if (!(thread = CreateThread(NULL, 0, mac_shadow_subsystem_thread, (void*)subsystem, 0, NULL))) { WLog_ERR(TAG, "Failed to create thread"); return -1; @@ -653,7 +642,7 @@ static void mac_shadow_subsystem_free(macShadowSubsystem* subsystem) static macShadowSubsystem* mac_shadow_subsystem_new(void) { macShadowSubsystem* subsystem; - subsystem = (macShadowSubsystem*) calloc(1, sizeof(macShadowSubsystem)); + subsystem = (macShadowSubsystem*)calloc(1, sizeof(macShadowSubsystem)); if (!subsystem) return NULL; @@ -668,12 +657,12 @@ static macShadowSubsystem* mac_shadow_subsystem_new(void) FREERDP_API int Mac_ShadowSubsystemEntry(RDP_SHADOW_ENTRY_POINTS* pEntryPoints) { - pEntryPoints->New = (pfnShadowSubsystemNew) mac_shadow_subsystem_new; - pEntryPoints->Free = (pfnShadowSubsystemFree) mac_shadow_subsystem_free; - pEntryPoints->Init = (pfnShadowSubsystemInit) mac_shadow_subsystem_init; - pEntryPoints->Uninit = (pfnShadowSubsystemInit) mac_shadow_subsystem_uninit; - pEntryPoints->Start = (pfnShadowSubsystemStart) mac_shadow_subsystem_start; - pEntryPoints->Stop = (pfnShadowSubsystemStop) mac_shadow_subsystem_stop; - pEntryPoints->EnumMonitors = (pfnShadowEnumMonitors) mac_shadow_enum_monitors; + pEntryPoints->New = (pfnShadowSubsystemNew)mac_shadow_subsystem_new; + pEntryPoints->Free = (pfnShadowSubsystemFree)mac_shadow_subsystem_free; + pEntryPoints->Init = (pfnShadowSubsystemInit)mac_shadow_subsystem_init; + pEntryPoints->Uninit = (pfnShadowSubsystemInit)mac_shadow_subsystem_uninit; + pEntryPoints->Start = (pfnShadowSubsystemStart)mac_shadow_subsystem_start; + pEntryPoints->Stop = (pfnShadowSubsystemStop)mac_shadow_subsystem_stop; + pEntryPoints->EnumMonitors = (pfnShadowEnumMonitors)mac_shadow_enum_monitors; return 1; } diff --git a/server/shadow/Mac/mac_shadow.h b/server/shadow/Mac/mac_shadow.h index e776afb80..2c31572e3 100644 --- a/server/shadow/Mac/mac_shadow.h +++ b/server/shadow/Mac/mac_shadow.h @@ -53,11 +53,10 @@ struct mac_shadow_subsystem }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif - - #ifdef __cplusplus } #endif diff --git a/server/shadow/Win/win_dxgi.c b/server/shadow/Win/win_dxgi.c index ce5ef9752..3c9526e78 100644 --- a/server/shadow/Win/win_dxgi.c +++ b/server/shadow/Win/win_dxgi.c @@ -30,8 +30,7 @@ #ifdef WITH_DXGI_1_2 -static D3D_DRIVER_TYPE DriverTypes[] = -{ +static D3D_DRIVER_TYPE DriverTypes[] = { D3D_DRIVER_TYPE_HARDWARE, D3D_DRIVER_TYPE_WARP, D3D_DRIVER_TYPE_REFERENCE, @@ -39,22 +38,20 @@ static D3D_DRIVER_TYPE DriverTypes[] = static UINT NumDriverTypes = ARRAYSIZE(DriverTypes); -static D3D_FEATURE_LEVEL FeatureLevels[] = -{ - D3D_FEATURE_LEVEL_11_0, - D3D_FEATURE_LEVEL_10_1, - D3D_FEATURE_LEVEL_10_0, - D3D_FEATURE_LEVEL_9_1 -}; +static D3D_FEATURE_LEVEL FeatureLevels[] = { D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_10_1, + D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_9_1 }; static UINT NumFeatureLevels = ARRAYSIZE(FeatureLevels); static HMODULE d3d11_module = NULL; -typedef HRESULT (WINAPI * fnD3D11CreateDevice)( - IDXGIAdapter* pAdapter, D3D_DRIVER_TYPE DriverType, HMODULE Software, UINT Flags, - CONST D3D_FEATURE_LEVEL* pFeatureLevels, UINT FeatureLevels, UINT SDKVersion, - ID3D11Device** ppDevice, D3D_FEATURE_LEVEL* pFeatureLevel, ID3D11DeviceContext** ppImmediateContext); +typedef HRESULT(WINAPI* fnD3D11CreateDevice)(IDXGIAdapter* pAdapter, D3D_DRIVER_TYPE DriverType, + HMODULE Software, UINT Flags, + CONST D3D_FEATURE_LEVEL* pFeatureLevels, + UINT FeatureLevels, UINT SDKVersion, + ID3D11Device** ppDevice, + D3D_FEATURE_LEVEL* pFeatureLevel, + ID3D11DeviceContext** ppImmediateContext); static fnD3D11CreateDevice pfnD3D11CreateDevice = NULL; @@ -65,76 +62,140 @@ static fnD3D11CreateDevice pfnD3D11CreateDevice = NULL; /* d3d11.h GUIDs */ -DEFINE_GUID(IID_ID3D11DeviceChild,0x1841e5c8,0x16b0,0x489b,0xbc,0xc8,0x44,0xcf,0xb0,0xd5,0xde,0xae); -DEFINE_GUID(IID_ID3D11DepthStencilState,0x03823efb,0x8d8f,0x4e1c,0x9a,0xa2,0xf6,0x4b,0xb2,0xcb,0xfd,0xf1); -DEFINE_GUID(IID_ID3D11BlendState,0x75b68faa,0x347d,0x4159,0x8f,0x45,0xa0,0x64,0x0f,0x01,0xcd,0x9a); -DEFINE_GUID(IID_ID3D11RasterizerState,0x9bb4ab81,0xab1a,0x4d8f,0xb5,0x06,0xfc,0x04,0x20,0x0b,0x6e,0xe7); -DEFINE_GUID(IID_ID3D11Resource,0xdc8e63f3,0xd12b,0x4952,0xb4,0x7b,0x5e,0x45,0x02,0x6a,0x86,0x2d); -DEFINE_GUID(IID_ID3D11Buffer,0x48570b85,0xd1ee,0x4fcd,0xa2,0x50,0xeb,0x35,0x07,0x22,0xb0,0x37); -DEFINE_GUID(IID_ID3D11Texture1D,0xf8fb5c27,0xc6b3,0x4f75,0xa4,0xc8,0x43,0x9a,0xf2,0xef,0x56,0x4c); -DEFINE_GUID(IID_ID3D11Texture2D,0x6f15aaf2,0xd208,0x4e89,0x9a,0xb4,0x48,0x95,0x35,0xd3,0x4f,0x9c); -DEFINE_GUID(IID_ID3D11Texture3D,0x037e866e,0xf56d,0x4357,0xa8,0xaf,0x9d,0xab,0xbe,0x6e,0x25,0x0e); -DEFINE_GUID(IID_ID3D11View,0x839d1216,0xbb2e,0x412b,0xb7,0xf4,0xa9,0xdb,0xeb,0xe0,0x8e,0xd1); -DEFINE_GUID(IID_ID3D11ShaderResourceView,0xb0e06fe0,0x8192,0x4e1a,0xb1,0xca,0x36,0xd7,0x41,0x47,0x10,0xb2); -DEFINE_GUID(IID_ID3D11RenderTargetView,0xdfdba067,0x0b8d,0x4865,0x87,0x5b,0xd7,0xb4,0x51,0x6c,0xc1,0x64); -DEFINE_GUID(IID_ID3D11DepthStencilView,0x9fdac92a,0x1876,0x48c3,0xaf,0xad,0x25,0xb9,0x4f,0x84,0xa9,0xb6); -DEFINE_GUID(IID_ID3D11UnorderedAccessView,0x28acf509,0x7f5c,0x48f6,0x86,0x11,0xf3,0x16,0x01,0x0a,0x63,0x80); -DEFINE_GUID(IID_ID3D11VertexShader,0x3b301d64,0xd678,0x4289,0x88,0x97,0x22,0xf8,0x92,0x8b,0x72,0xf3); -DEFINE_GUID(IID_ID3D11HullShader,0x8e5c6061,0x628a,0x4c8e,0x82,0x64,0xbb,0xe4,0x5c,0xb3,0xd5,0xdd); -DEFINE_GUID(IID_ID3D11DomainShader,0xf582c508,0x0f36,0x490c,0x99,0x77,0x31,0xee,0xce,0x26,0x8c,0xfa); -DEFINE_GUID(IID_ID3D11GeometryShader,0x38325b96,0xeffb,0x4022,0xba,0x02,0x2e,0x79,0x5b,0x70,0x27,0x5c); -DEFINE_GUID(IID_ID3D11PixelShader,0xea82e40d,0x51dc,0x4f33,0x93,0xd4,0xdb,0x7c,0x91,0x25,0xae,0x8c); -DEFINE_GUID(IID_ID3D11ComputeShader,0x4f5b196e,0xc2bd,0x495e,0xbd,0x01,0x1f,0xde,0xd3,0x8e,0x49,0x69); -DEFINE_GUID(IID_ID3D11InputLayout,0xe4819ddc,0x4cf0,0x4025,0xbd,0x26,0x5d,0xe8,0x2a,0x3e,0x07,0xb7); -DEFINE_GUID(IID_ID3D11SamplerState,0xda6fea51,0x564c,0x4487,0x98,0x10,0xf0,0xd0,0xf9,0xb4,0xe3,0xa5); -DEFINE_GUID(IID_ID3D11Asynchronous,0x4b35d0cd,0x1e15,0x4258,0x9c,0x98,0x1b,0x13,0x33,0xf6,0xdd,0x3b); -DEFINE_GUID(IID_ID3D11Query,0xd6c00747,0x87b7,0x425e,0xb8,0x4d,0x44,0xd1,0x08,0x56,0x0a,0xfd); -DEFINE_GUID(IID_ID3D11Predicate,0x9eb576dd,0x9f77,0x4d86,0x81,0xaa,0x8b,0xab,0x5f,0xe4,0x90,0xe2); -DEFINE_GUID(IID_ID3D11Counter,0x6e8c49fb,0xa371,0x4770,0xb4,0x40,0x29,0x08,0x60,0x22,0xb7,0x41); -DEFINE_GUID(IID_ID3D11ClassInstance,0xa6cd7faa,0xb0b7,0x4a2f,0x94,0x36,0x86,0x62,0xa6,0x57,0x97,0xcb); -DEFINE_GUID(IID_ID3D11ClassLinkage,0xddf57cba,0x9543,0x46e4,0xa1,0x2b,0xf2,0x07,0xa0,0xfe,0x7f,0xed); -DEFINE_GUID(IID_ID3D11CommandList,0xa24bc4d1,0x769e,0x43f7,0x80,0x13,0x98,0xff,0x56,0x6c,0x18,0xe2); -DEFINE_GUID(IID_ID3D11DeviceContext,0xc0bfa96c,0xe089,0x44fb,0x8e,0xaf,0x26,0xf8,0x79,0x61,0x90,0xda); -DEFINE_GUID(IID_ID3D11VideoDecoder,0x3C9C5B51,0x995D,0x48d1,0x9B,0x8D,0xFA,0x5C,0xAE,0xDE,0xD6,0x5C); -DEFINE_GUID(IID_ID3D11VideoProcessorEnumerator,0x31627037,0x53AB,0x4200,0x90,0x61,0x05,0xFA,0xA9,0xAB,0x45,0xF9); -DEFINE_GUID(IID_ID3D11VideoProcessor,0x1D7B0652,0x185F,0x41c6,0x85,0xCE,0x0C,0x5B,0xE3,0xD4,0xAE,0x6C); -DEFINE_GUID(IID_ID3D11AuthenticatedChannel,0x3015A308,0xDCBD,0x47aa,0xA7,0x47,0x19,0x24,0x86,0xD1,0x4D,0x4A); -DEFINE_GUID(IID_ID3D11CryptoSession,0x9B32F9AD,0xBDCC,0x40a6,0xA3,0x9D,0xD5,0xC8,0x65,0x84,0x57,0x20); -DEFINE_GUID(IID_ID3D11VideoDecoderOutputView,0xC2931AEA,0x2A85,0x4f20,0x86,0x0F,0xFB,0xA1,0xFD,0x25,0x6E,0x18); -DEFINE_GUID(IID_ID3D11VideoProcessorInputView,0x11EC5A5F,0x51DC,0x4945,0xAB,0x34,0x6E,0x8C,0x21,0x30,0x0E,0xA5); -DEFINE_GUID(IID_ID3D11VideoProcessorOutputView,0xA048285E,0x25A9,0x4527,0xBD,0x93,0xD6,0x8B,0x68,0xC4,0x42,0x54); -DEFINE_GUID(IID_ID3D11VideoContext,0x61F21C45,0x3C0E,0x4a74,0x9C,0xEA,0x67,0x10,0x0D,0x9A,0xD5,0xE4); -DEFINE_GUID(IID_ID3D11VideoDevice,0x10EC4D5B,0x975A,0x4689,0xB9,0xE4,0xD0,0xAA,0xC3,0x0F,0xE3,0x33); -DEFINE_GUID(IID_ID3D11Device,0xdb6f6ddb,0xac77,0x4e88,0x82,0x53,0x81,0x9d,0xf9,0xbb,0xf1,0x40); +DEFINE_GUID(IID_ID3D11DeviceChild, 0x1841e5c8, 0x16b0, 0x489b, 0xbc, 0xc8, 0x44, 0xcf, 0xb0, 0xd5, + 0xde, 0xae); +DEFINE_GUID(IID_ID3D11DepthStencilState, 0x03823efb, 0x8d8f, 0x4e1c, 0x9a, 0xa2, 0xf6, 0x4b, 0xb2, + 0xcb, 0xfd, 0xf1); +DEFINE_GUID(IID_ID3D11BlendState, 0x75b68faa, 0x347d, 0x4159, 0x8f, 0x45, 0xa0, 0x64, 0x0f, 0x01, + 0xcd, 0x9a); +DEFINE_GUID(IID_ID3D11RasterizerState, 0x9bb4ab81, 0xab1a, 0x4d8f, 0xb5, 0x06, 0xfc, 0x04, 0x20, + 0x0b, 0x6e, 0xe7); +DEFINE_GUID(IID_ID3D11Resource, 0xdc8e63f3, 0xd12b, 0x4952, 0xb4, 0x7b, 0x5e, 0x45, 0x02, 0x6a, + 0x86, 0x2d); +DEFINE_GUID(IID_ID3D11Buffer, 0x48570b85, 0xd1ee, 0x4fcd, 0xa2, 0x50, 0xeb, 0x35, 0x07, 0x22, 0xb0, + 0x37); +DEFINE_GUID(IID_ID3D11Texture1D, 0xf8fb5c27, 0xc6b3, 0x4f75, 0xa4, 0xc8, 0x43, 0x9a, 0xf2, 0xef, + 0x56, 0x4c); +DEFINE_GUID(IID_ID3D11Texture2D, 0x6f15aaf2, 0xd208, 0x4e89, 0x9a, 0xb4, 0x48, 0x95, 0x35, 0xd3, + 0x4f, 0x9c); +DEFINE_GUID(IID_ID3D11Texture3D, 0x037e866e, 0xf56d, 0x4357, 0xa8, 0xaf, 0x9d, 0xab, 0xbe, 0x6e, + 0x25, 0x0e); +DEFINE_GUID(IID_ID3D11View, 0x839d1216, 0xbb2e, 0x412b, 0xb7, 0xf4, 0xa9, 0xdb, 0xeb, 0xe0, 0x8e, + 0xd1); +DEFINE_GUID(IID_ID3D11ShaderResourceView, 0xb0e06fe0, 0x8192, 0x4e1a, 0xb1, 0xca, 0x36, 0xd7, 0x41, + 0x47, 0x10, 0xb2); +DEFINE_GUID(IID_ID3D11RenderTargetView, 0xdfdba067, 0x0b8d, 0x4865, 0x87, 0x5b, 0xd7, 0xb4, 0x51, + 0x6c, 0xc1, 0x64); +DEFINE_GUID(IID_ID3D11DepthStencilView, 0x9fdac92a, 0x1876, 0x48c3, 0xaf, 0xad, 0x25, 0xb9, 0x4f, + 0x84, 0xa9, 0xb6); +DEFINE_GUID(IID_ID3D11UnorderedAccessView, 0x28acf509, 0x7f5c, 0x48f6, 0x86, 0x11, 0xf3, 0x16, 0x01, + 0x0a, 0x63, 0x80); +DEFINE_GUID(IID_ID3D11VertexShader, 0x3b301d64, 0xd678, 0x4289, 0x88, 0x97, 0x22, 0xf8, 0x92, 0x8b, + 0x72, 0xf3); +DEFINE_GUID(IID_ID3D11HullShader, 0x8e5c6061, 0x628a, 0x4c8e, 0x82, 0x64, 0xbb, 0xe4, 0x5c, 0xb3, + 0xd5, 0xdd); +DEFINE_GUID(IID_ID3D11DomainShader, 0xf582c508, 0x0f36, 0x490c, 0x99, 0x77, 0x31, 0xee, 0xce, 0x26, + 0x8c, 0xfa); +DEFINE_GUID(IID_ID3D11GeometryShader, 0x38325b96, 0xeffb, 0x4022, 0xba, 0x02, 0x2e, 0x79, 0x5b, + 0x70, 0x27, 0x5c); +DEFINE_GUID(IID_ID3D11PixelShader, 0xea82e40d, 0x51dc, 0x4f33, 0x93, 0xd4, 0xdb, 0x7c, 0x91, 0x25, + 0xae, 0x8c); +DEFINE_GUID(IID_ID3D11ComputeShader, 0x4f5b196e, 0xc2bd, 0x495e, 0xbd, 0x01, 0x1f, 0xde, 0xd3, 0x8e, + 0x49, 0x69); +DEFINE_GUID(IID_ID3D11InputLayout, 0xe4819ddc, 0x4cf0, 0x4025, 0xbd, 0x26, 0x5d, 0xe8, 0x2a, 0x3e, + 0x07, 0xb7); +DEFINE_GUID(IID_ID3D11SamplerState, 0xda6fea51, 0x564c, 0x4487, 0x98, 0x10, 0xf0, 0xd0, 0xf9, 0xb4, + 0xe3, 0xa5); +DEFINE_GUID(IID_ID3D11Asynchronous, 0x4b35d0cd, 0x1e15, 0x4258, 0x9c, 0x98, 0x1b, 0x13, 0x33, 0xf6, + 0xdd, 0x3b); +DEFINE_GUID(IID_ID3D11Query, 0xd6c00747, 0x87b7, 0x425e, 0xb8, 0x4d, 0x44, 0xd1, 0x08, 0x56, 0x0a, + 0xfd); +DEFINE_GUID(IID_ID3D11Predicate, 0x9eb576dd, 0x9f77, 0x4d86, 0x81, 0xaa, 0x8b, 0xab, 0x5f, 0xe4, + 0x90, 0xe2); +DEFINE_GUID(IID_ID3D11Counter, 0x6e8c49fb, 0xa371, 0x4770, 0xb4, 0x40, 0x29, 0x08, 0x60, 0x22, 0xb7, + 0x41); +DEFINE_GUID(IID_ID3D11ClassInstance, 0xa6cd7faa, 0xb0b7, 0x4a2f, 0x94, 0x36, 0x86, 0x62, 0xa6, 0x57, + 0x97, 0xcb); +DEFINE_GUID(IID_ID3D11ClassLinkage, 0xddf57cba, 0x9543, 0x46e4, 0xa1, 0x2b, 0xf2, 0x07, 0xa0, 0xfe, + 0x7f, 0xed); +DEFINE_GUID(IID_ID3D11CommandList, 0xa24bc4d1, 0x769e, 0x43f7, 0x80, 0x13, 0x98, 0xff, 0x56, 0x6c, + 0x18, 0xe2); +DEFINE_GUID(IID_ID3D11DeviceContext, 0xc0bfa96c, 0xe089, 0x44fb, 0x8e, 0xaf, 0x26, 0xf8, 0x79, 0x61, + 0x90, 0xda); +DEFINE_GUID(IID_ID3D11VideoDecoder, 0x3C9C5B51, 0x995D, 0x48d1, 0x9B, 0x8D, 0xFA, 0x5C, 0xAE, 0xDE, + 0xD6, 0x5C); +DEFINE_GUID(IID_ID3D11VideoProcessorEnumerator, 0x31627037, 0x53AB, 0x4200, 0x90, 0x61, 0x05, 0xFA, + 0xA9, 0xAB, 0x45, 0xF9); +DEFINE_GUID(IID_ID3D11VideoProcessor, 0x1D7B0652, 0x185F, 0x41c6, 0x85, 0xCE, 0x0C, 0x5B, 0xE3, + 0xD4, 0xAE, 0x6C); +DEFINE_GUID(IID_ID3D11AuthenticatedChannel, 0x3015A308, 0xDCBD, 0x47aa, 0xA7, 0x47, 0x19, 0x24, + 0x86, 0xD1, 0x4D, 0x4A); +DEFINE_GUID(IID_ID3D11CryptoSession, 0x9B32F9AD, 0xBDCC, 0x40a6, 0xA3, 0x9D, 0xD5, 0xC8, 0x65, 0x84, + 0x57, 0x20); +DEFINE_GUID(IID_ID3D11VideoDecoderOutputView, 0xC2931AEA, 0x2A85, 0x4f20, 0x86, 0x0F, 0xFB, 0xA1, + 0xFD, 0x25, 0x6E, 0x18); +DEFINE_GUID(IID_ID3D11VideoProcessorInputView, 0x11EC5A5F, 0x51DC, 0x4945, 0xAB, 0x34, 0x6E, 0x8C, + 0x21, 0x30, 0x0E, 0xA5); +DEFINE_GUID(IID_ID3D11VideoProcessorOutputView, 0xA048285E, 0x25A9, 0x4527, 0xBD, 0x93, 0xD6, 0x8B, + 0x68, 0xC4, 0x42, 0x54); +DEFINE_GUID(IID_ID3D11VideoContext, 0x61F21C45, 0x3C0E, 0x4a74, 0x9C, 0xEA, 0x67, 0x10, 0x0D, 0x9A, + 0xD5, 0xE4); +DEFINE_GUID(IID_ID3D11VideoDevice, 0x10EC4D5B, 0x975A, 0x4689, 0xB9, 0xE4, 0xD0, 0xAA, 0xC3, 0x0F, + 0xE3, 0x33); +DEFINE_GUID(IID_ID3D11Device, 0xdb6f6ddb, 0xac77, 0x4e88, 0x82, 0x53, 0x81, 0x9d, 0xf9, 0xbb, 0xf1, + 0x40); /* dxgi.h GUIDs */ -DEFINE_GUID(IID_IDXGIObject, 0xaec22fb8, 0x76f3, 0x4639, 0x9b, 0xe0, 0x28, 0xeb, 0x43, 0xa6, 0x7a, 0x2e); -DEFINE_GUID(IID_IDXGIDeviceSubObject, 0x3d3e0379, 0xf9de, 0x4d58, 0xbb, 0x6c, 0x18, 0xd6, 0x29, 0x92, 0xf1, 0xa6); -DEFINE_GUID(IID_IDXGIResource, 0x035f3ab4, 0x482e, 0x4e50, 0xb4, 0x1f, 0x8a, 0x7f, 0x8b, 0xd8, 0x96, 0x0b); -DEFINE_GUID(IID_IDXGIKeyedMutex, 0x9d8e1289, 0xd7b3, 0x465f, 0x81, 0x26, 0x25, 0x0e, 0x34, 0x9a, 0xf8, 0x5d); -DEFINE_GUID(IID_IDXGISurface, 0xcafcb56c, 0x6ac3, 0x4889, 0xbf, 0x47, 0x9e, 0x23, 0xbb, 0xd2, 0x60, 0xec); -DEFINE_GUID(IID_IDXGISurface1, 0x4AE63092, 0x6327, 0x4c1b, 0x80, 0xAE, 0xBF, 0xE1, 0x2E, 0xA3, 0x2B, 0x86); -DEFINE_GUID(IID_IDXGIAdapter, 0x2411e7e1, 0x12ac, 0x4ccf, 0xbd, 0x14, 0x97, 0x98, 0xe8, 0x53, 0x4d, 0xc0); -DEFINE_GUID(IID_IDXGIOutput, 0xae02eedb, 0xc735, 0x4690, 0x8d, 0x52, 0x5a, 0x8d, 0xc2, 0x02, 0x13, 0xaa); -DEFINE_GUID(IID_IDXGISwapChain, 0x310d36a0, 0xd2e7, 0x4c0a, 0xaa, 0x04, 0x6a, 0x9d, 0x23, 0xb8, 0x88, 0x6a); -DEFINE_GUID(IID_IDXGIFactory, 0x7b7166ec, 0x21c7, 0x44ae, 0xb2, 0x1a, 0xc9, 0xae, 0x32, 0x1a, 0xe3, 0x69); -DEFINE_GUID(IID_IDXGIDevice, 0x54ec77fa, 0x1377, 0x44e6, 0x8c, 0x32, 0x88, 0xfd, 0x5f, 0x44, 0xc8, 0x4c); -DEFINE_GUID(IID_IDXGIFactory1, 0x770aae78, 0xf26f, 0x4dba, 0xa8, 0x29, 0x25, 0x3c, 0x83, 0xd1, 0xb3, 0x87); -DEFINE_GUID(IID_IDXGIAdapter1, 0x29038f61, 0x3839, 0x4626, 0x91, 0xfd, 0x08, 0x68, 0x79, 0x01, 0x1a, 0x05); -DEFINE_GUID(IID_IDXGIDevice1, 0x77db970f, 0x6276, 0x48ba, 0xba, 0x28, 0x07, 0x01, 0x43, 0xb4, 0x39, 0x2c); +DEFINE_GUID(IID_IDXGIObject, 0xaec22fb8, 0x76f3, 0x4639, 0x9b, 0xe0, 0x28, 0xeb, 0x43, 0xa6, 0x7a, + 0x2e); +DEFINE_GUID(IID_IDXGIDeviceSubObject, 0x3d3e0379, 0xf9de, 0x4d58, 0xbb, 0x6c, 0x18, 0xd6, 0x29, + 0x92, 0xf1, 0xa6); +DEFINE_GUID(IID_IDXGIResource, 0x035f3ab4, 0x482e, 0x4e50, 0xb4, 0x1f, 0x8a, 0x7f, 0x8b, 0xd8, 0x96, + 0x0b); +DEFINE_GUID(IID_IDXGIKeyedMutex, 0x9d8e1289, 0xd7b3, 0x465f, 0x81, 0x26, 0x25, 0x0e, 0x34, 0x9a, + 0xf8, 0x5d); +DEFINE_GUID(IID_IDXGISurface, 0xcafcb56c, 0x6ac3, 0x4889, 0xbf, 0x47, 0x9e, 0x23, 0xbb, 0xd2, 0x60, + 0xec); +DEFINE_GUID(IID_IDXGISurface1, 0x4AE63092, 0x6327, 0x4c1b, 0x80, 0xAE, 0xBF, 0xE1, 0x2E, 0xA3, 0x2B, + 0x86); +DEFINE_GUID(IID_IDXGIAdapter, 0x2411e7e1, 0x12ac, 0x4ccf, 0xbd, 0x14, 0x97, 0x98, 0xe8, 0x53, 0x4d, + 0xc0); +DEFINE_GUID(IID_IDXGIOutput, 0xae02eedb, 0xc735, 0x4690, 0x8d, 0x52, 0x5a, 0x8d, 0xc2, 0x02, 0x13, + 0xaa); +DEFINE_GUID(IID_IDXGISwapChain, 0x310d36a0, 0xd2e7, 0x4c0a, 0xaa, 0x04, 0x6a, 0x9d, 0x23, 0xb8, + 0x88, 0x6a); +DEFINE_GUID(IID_IDXGIFactory, 0x7b7166ec, 0x21c7, 0x44ae, 0xb2, 0x1a, 0xc9, 0xae, 0x32, 0x1a, 0xe3, + 0x69); +DEFINE_GUID(IID_IDXGIDevice, 0x54ec77fa, 0x1377, 0x44e6, 0x8c, 0x32, 0x88, 0xfd, 0x5f, 0x44, 0xc8, + 0x4c); +DEFINE_GUID(IID_IDXGIFactory1, 0x770aae78, 0xf26f, 0x4dba, 0xa8, 0x29, 0x25, 0x3c, 0x83, 0xd1, 0xb3, + 0x87); +DEFINE_GUID(IID_IDXGIAdapter1, 0x29038f61, 0x3839, 0x4626, 0x91, 0xfd, 0x08, 0x68, 0x79, 0x01, 0x1a, + 0x05); +DEFINE_GUID(IID_IDXGIDevice1, 0x77db970f, 0x6276, 0x48ba, 0xba, 0x28, 0x07, 0x01, 0x43, 0xb4, 0x39, + 0x2c); /* dxgi1_2.h GUIDs */ -DEFINE_GUID(IID_IDXGIDisplayControl, 0xea9dbf1a, 0xc88e, 0x4486, 0x85, 0x4a, 0x98, 0xaa, 0x01, 0x38, 0xf3, 0x0c); -DEFINE_GUID(IID_IDXGIOutputDuplication, 0x191cfac3, 0xa341, 0x470d, 0xb2, 0x6e, 0xa8, 0x64, 0xf4, 0x28, 0x31, 0x9c); -DEFINE_GUID(IID_IDXGISurface2, 0xaba496dd, 0xb617, 0x4cb8, 0xa8, 0x66, 0xbc, 0x44, 0xd7, 0xeb, 0x1f, 0xa2); -DEFINE_GUID(IID_IDXGIResource1, 0x30961379, 0x4609, 0x4a41, 0x99, 0x8e, 0x54, 0xfe, 0x56, 0x7e, 0xe0, 0xc1); -DEFINE_GUID(IID_IDXGIDevice2, 0x05008617, 0xfbfd, 0x4051, 0xa7, 0x90, 0x14, 0x48, 0x84, 0xb4, 0xf6, 0xa9); -DEFINE_GUID(IID_IDXGISwapChain1, 0x790a45f7, 0x0d42, 0x4876, 0x98, 0x3a, 0x0a, 0x55, 0xcf, 0xe6, 0xf4, 0xaa); -DEFINE_GUID(IID_IDXGIFactory2, 0x50c83a1c, 0xe072, 0x4c48, 0x87, 0xb0, 0x36, 0x30, 0xfa, 0x36, 0xa6, 0xd0); -DEFINE_GUID(IID_IDXGIAdapter2, 0x0AA1AE0A, 0xFA0E, 0x4B84, 0x86, 0x44, 0xE0, 0x5F, 0xF8, 0xE5, 0xAC, 0xB5); -DEFINE_GUID(IID_IDXGIOutput1, 0x00cddea8, 0x939b, 0x4b83, 0xa3, 0x40, 0xa6, 0x85, 0x22, 0x66, 0x66, 0xcc); +DEFINE_GUID(IID_IDXGIDisplayControl, 0xea9dbf1a, 0xc88e, 0x4486, 0x85, 0x4a, 0x98, 0xaa, 0x01, 0x38, + 0xf3, 0x0c); +DEFINE_GUID(IID_IDXGIOutputDuplication, 0x191cfac3, 0xa341, 0x470d, 0xb2, 0x6e, 0xa8, 0x64, 0xf4, + 0x28, 0x31, 0x9c); +DEFINE_GUID(IID_IDXGISurface2, 0xaba496dd, 0xb617, 0x4cb8, 0xa8, 0x66, 0xbc, 0x44, 0xd7, 0xeb, 0x1f, + 0xa2); +DEFINE_GUID(IID_IDXGIResource1, 0x30961379, 0x4609, 0x4a41, 0x99, 0x8e, 0x54, 0xfe, 0x56, 0x7e, + 0xe0, 0xc1); +DEFINE_GUID(IID_IDXGIDevice2, 0x05008617, 0xfbfd, 0x4051, 0xa7, 0x90, 0x14, 0x48, 0x84, 0xb4, 0xf6, + 0xa9); +DEFINE_GUID(IID_IDXGISwapChain1, 0x790a45f7, 0x0d42, 0x4876, 0x98, 0x3a, 0x0a, 0x55, 0xcf, 0xe6, + 0xf4, 0xaa); +DEFINE_GUID(IID_IDXGIFactory2, 0x50c83a1c, 0xe072, 0x4c48, 0x87, 0xb0, 0x36, 0x30, 0xfa, 0x36, 0xa6, + 0xd0); +DEFINE_GUID(IID_IDXGIAdapter2, 0x0AA1AE0A, 0xFA0E, 0x4B84, 0x86, 0x44, 0xE0, 0x5F, 0xF8, 0xE5, 0xAC, + 0xB5); +DEFINE_GUID(IID_IDXGIOutput1, 0x00cddea8, 0x939b, 0x4b83, 0xa3, 0x40, 0xa6, 0x85, 0x22, 0x66, 0x66, + 0xcc); const char* GetDxgiErrorString(HRESULT hr) { @@ -229,7 +290,7 @@ static void win_shadow_d3d11_module_init() if (!d3d11_module) return; - pfnD3D11CreateDevice = (fnD3D11CreateDevice) GetProcAddress(d3d11_module, "D3D11CreateDevice"); + pfnD3D11CreateDevice = (fnD3D11CreateDevice)GetProcAddress(d3d11_module, "D3D11CreateDevice"); } int win_shadow_dxgi_init_duplication(winShadowSubsystem* subsystem) @@ -245,17 +306,17 @@ int win_shadow_dxgi_init_duplication(winShadowSubsystem* subsystem) IDXGIOutput* dxgiOutput = NULL; IDXGIOutput1* dxgiOutput1 = NULL; - hr = subsystem->dxgiDevice->lpVtbl->QueryInterface(subsystem->dxgiDevice, - &IID_IDXGIDevice, (void**) &dxgiDevice); + hr = subsystem->dxgiDevice->lpVtbl->QueryInterface(subsystem->dxgiDevice, &IID_IDXGIDevice, + (void**)&dxgiDevice); if (FAILED(hr)) { WLog_ERR(TAG, "ID3D11Device::QueryInterface(IDXGIDevice) failure: %s (0x%08lX)", - GetDxgiErrorString(hr), hr); + GetDxgiErrorString(hr), hr); return -1; } - hr = dxgiDevice->lpVtbl->GetParent(dxgiDevice, &IID_IDXGIAdapter, (void**) &dxgiAdapter); + hr = dxgiDevice->lpVtbl->GetParent(dxgiDevice, &IID_IDXGIAdapter, (void**)&dxgiAdapter); if (dxgiDevice) { @@ -266,7 +327,7 @@ int win_shadow_dxgi_init_duplication(winShadowSubsystem* subsystem) if (FAILED(hr)) { WLog_ERR(TAG, "IDXGIDevice::GetParent(IDXGIAdapter) failure: %s (0x%08lX)", - GetDxgiErrorString(hr), hr); + GetDxgiErrorString(hr), hr); return -1; } @@ -281,8 +342,7 @@ int win_shadow_dxgi_init_duplication(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IDXGIOutput::GetDesc failure: %s (0x%08lX)", - GetDxgiErrorString(hr), hr); + WLog_ERR(TAG, "IDXGIOutput::GetDesc failure: %s (0x%08lX)", GetDxgiErrorString(hr), hr); return -1; } @@ -305,12 +365,12 @@ int win_shadow_dxgi_init_duplication(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IDXGIAdapter::EnumOutputs failure: %s (0x%08lX)", - GetDxgiErrorString(hr), hr); + WLog_ERR(TAG, "IDXGIAdapter::EnumOutputs failure: %s (0x%08lX)", GetDxgiErrorString(hr), + hr); return -1; } - hr = dxgiOutput->lpVtbl->QueryInterface(dxgiOutput, &IID_IDXGIOutput1, (void**) &dxgiOutput1); + hr = dxgiOutput->lpVtbl->QueryInterface(dxgiOutput, &IID_IDXGIOutput1, (void**)&dxgiOutput1); if (dxgiOutput) { @@ -321,12 +381,12 @@ int win_shadow_dxgi_init_duplication(winShadowSubsystem* subsystem) if (FAILED(hr)) { WLog_ERR(TAG, "IDXGIOutput::QueryInterface(IDXGIOutput1) failure: %s (0x%08lX)", - GetDxgiErrorString(hr), hr); + GetDxgiErrorString(hr), hr); return -1; } - hr = dxgiOutput1->lpVtbl->DuplicateOutput(dxgiOutput1, (IUnknown*) subsystem->dxgiDevice, - &(subsystem->dxgiOutputDuplication)); + hr = dxgiOutput1->lpVtbl->DuplicateOutput(dxgiOutput1, (IUnknown*)subsystem->dxgiDevice, + &(subsystem->dxgiOutputDuplication)); if (dxgiOutput1) { @@ -336,8 +396,8 @@ int win_shadow_dxgi_init_duplication(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IDXGIOutput1::DuplicateOutput failure: %s (0x%08lX)", - GetDxgiErrorString(hr), hr); + WLog_ERR(TAG, "IDXGIOutput1::DuplicateOutput failure: %s (0x%08lX)", GetDxgiErrorString(hr), + hr); return -1; } @@ -353,13 +413,13 @@ int win_shadow_dxgi_init_duplication(winShadowSubsystem* subsystem) textureDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; textureDesc.MiscFlags = 0; - hr = subsystem->dxgiDevice->lpVtbl->CreateTexture2D(subsystem->dxgiDevice, - &textureDesc, NULL, &(subsystem->dxgiStage)); + hr = subsystem->dxgiDevice->lpVtbl->CreateTexture2D(subsystem->dxgiDevice, &textureDesc, NULL, + &(subsystem->dxgiStage)); if (FAILED(hr)) { - WLog_ERR(TAG, "ID3D11Device::CreateTexture2D failure: %s (0x%08lX)", - GetDxgiErrorString(hr), hr); + WLog_ERR(TAG, "ID3D11Device::CreateTexture2D failure: %s (0x%08lX)", GetDxgiErrorString(hr), + hr); return -1; } @@ -385,8 +445,8 @@ int win_shadow_dxgi_init(winShadowSubsystem* subsystem) for (DriverTypeIndex = 0; DriverTypeIndex < NumDriverTypes; ++DriverTypeIndex) { hr = pfnD3D11CreateDevice(NULL, DriverTypes[DriverTypeIndex], NULL, 0, FeatureLevels, - NumFeatureLevels, D3D11_SDK_VERSION, &(subsystem->dxgiDevice), &(subsystem->featureLevel), - &(subsystem->dxgiDeviceContext)); + NumFeatureLevels, D3D11_SDK_VERSION, &(subsystem->dxgiDevice), + &(subsystem->featureLevel), &(subsystem->dxgiDeviceContext)); if (SUCCEEDED(hr)) break; @@ -438,8 +498,8 @@ int win_shadow_dxgi_uninit(winShadowSubsystem* subsystem) return 1; } -int win_shadow_dxgi_fetch_frame_data(winShadowSubsystem* subsystem, - BYTE** ppDstData, int* pnDstStep, int x, int y, int width, int height) +int win_shadow_dxgi_fetch_frame_data(winShadowSubsystem* subsystem, BYTE** ppDstData, + int* pnDstStep, int x, int y, int width, int height) { int status; HRESULT hr; @@ -456,16 +516,17 @@ int win_shadow_dxgi_fetch_frame_data(winShadowSubsystem* subsystem, Box.front = 0; Box.back = 1; - subsystem->dxgiDeviceContext->lpVtbl->CopySubresourceRegion(subsystem->dxgiDeviceContext, - (ID3D11Resource*) subsystem->dxgiStage, 0, 0, 0, 0, (ID3D11Resource*) subsystem->dxgiDesktopImage, 0, &Box); + subsystem->dxgiDeviceContext->lpVtbl->CopySubresourceRegion( + subsystem->dxgiDeviceContext, (ID3D11Resource*)subsystem->dxgiStage, 0, 0, 0, 0, + (ID3D11Resource*)subsystem->dxgiDesktopImage, 0, &Box); - hr = subsystem->dxgiStage->lpVtbl->QueryInterface(subsystem->dxgiStage, - &IID_IDXGISurface, (void**) &(subsystem->dxgiSurface)); + hr = subsystem->dxgiStage->lpVtbl->QueryInterface(subsystem->dxgiStage, &IID_IDXGISurface, + (void**)&(subsystem->dxgiSurface)); if (FAILED(hr)) { WLog_ERR(TAG, "ID3D11Texture2D::QueryInterface(IDXGISurface) failure: %s 0x%08lX", - GetDxgiErrorString(hr), hr); + GetDxgiErrorString(hr), hr); return -1; } @@ -473,8 +534,7 @@ int win_shadow_dxgi_fetch_frame_data(winShadowSubsystem* subsystem, if (FAILED(hr)) { - WLog_ERR(TAG, "IDXGISurface::Map failure: %s 0x%08lX", - GetDxgiErrorString(hr), hr); + WLog_ERR(TAG, "IDXGISurface::Map failure: %s 0x%08lX", GetDxgiErrorString(hr), hr); if (hr == DXGI_ERROR_DEVICE_REMOVED) { @@ -492,7 +552,7 @@ int win_shadow_dxgi_fetch_frame_data(winShadowSubsystem* subsystem, } subsystem->dxgiSurfaceMapped = TRUE; - + *ppDstData = mappedRect.pBits; *pnDstStep = mappedRect.Pitch; @@ -517,7 +577,8 @@ int win_shadow_dxgi_release_frame_data(winShadowSubsystem* subsystem) { if (subsystem->dxgiFrameAcquired) { - subsystem->dxgiOutputDuplication->lpVtbl->ReleaseFrame(subsystem->dxgiOutputDuplication); + subsystem->dxgiOutputDuplication->lpVtbl->ReleaseFrame( + subsystem->dxgiOutputDuplication); subsystem->dxgiFrameAcquired = FALSE; } } @@ -547,8 +608,9 @@ int win_shadow_dxgi_get_next_frame(winShadowSubsystem* subsystem) subsystem->dxgiDesktopImage = NULL; } - hr = subsystem->dxgiOutputDuplication->lpVtbl->AcquireNextFrame(subsystem->dxgiOutputDuplication, - timeout, &(subsystem->dxgiFrameInfo), &(subsystem->dxgiResource)); + hr = subsystem->dxgiOutputDuplication->lpVtbl->AcquireNextFrame( + subsystem->dxgiOutputDuplication, timeout, &(subsystem->dxgiFrameInfo), + &(subsystem->dxgiResource)); if (SUCCEEDED(hr)) { @@ -562,7 +624,7 @@ int win_shadow_dxgi_get_next_frame(winShadowSubsystem* subsystem) if (FAILED(hr)) { WLog_ERR(TAG, "IDXGIOutputDuplication::AcquireNextFrame failure: %s (0x%08lX)", - GetDxgiErrorString(hr), hr); + GetDxgiErrorString(hr), hr); if (hr == DXGI_ERROR_ACCESS_LOST) { @@ -578,7 +640,7 @@ int win_shadow_dxgi_get_next_frame(winShadowSubsystem* subsystem) { subsystem->dxgiOutputDuplication->lpVtbl->Release(subsystem->dxgiOutputDuplication); subsystem->dxgiOutputDuplication = NULL; - } + } status = win_shadow_dxgi_init_duplication(subsystem); @@ -601,9 +663,9 @@ int win_shadow_dxgi_get_next_frame(winShadowSubsystem* subsystem) return -1; } - - hr = subsystem->dxgiResource->lpVtbl->QueryInterface(subsystem->dxgiResource, - &IID_ID3D11Texture2D, (void**) &(subsystem->dxgiDesktopImage)); + + hr = subsystem->dxgiResource->lpVtbl->QueryInterface( + subsystem->dxgiResource, &IID_ID3D11Texture2D, (void**)&(subsystem->dxgiDesktopImage)); if (subsystem->dxgiResource) { @@ -614,7 +676,7 @@ int win_shadow_dxgi_get_next_frame(winShadowSubsystem* subsystem) if (FAILED(hr)) { WLog_ERR(TAG, "IDXGIResource::QueryInterface(ID3D11Texture2D) failure: %s (0x%08lX)", - GetDxgiErrorString(hr), hr); + GetDxgiErrorString(hr), hr); return -1; } @@ -626,7 +688,7 @@ int win_shadow_dxgi_get_invalid_region(winShadowSubsystem* subsystem) UINT i; HRESULT hr; POINT* pSrcPt; - RECT* pDstRect; + RECT* pDstRect; RECT* pDirtyRect; UINT numMoveRects; UINT numDirtyRects; @@ -650,8 +712,8 @@ int win_shadow_dxgi_get_invalid_region(winShadowSubsystem* subsystem) if (MetadataBufferSize > subsystem->MetadataBufferSize) { - subsystem->MetadataBuffer = (BYTE*) realloc(subsystem->MetadataBuffer, MetadataBufferSize); - + subsystem->MetadataBuffer = (BYTE*)realloc(subsystem->MetadataBuffer, MetadataBufferSize); + if (!subsystem->MetadataBuffer) return -1; @@ -663,15 +725,19 @@ int win_shadow_dxgi_get_invalid_region(winShadowSubsystem* subsystem) UsedBufferSize = 0; MoveRectsBufferSize = MetadataBufferSize - UsedBufferSize; - pMoveRectBuffer = (DXGI_OUTDUPL_MOVE_RECT*) &(subsystem->MetadataBuffer[UsedBufferSize]); + pMoveRectBuffer = (DXGI_OUTDUPL_MOVE_RECT*)&(subsystem->MetadataBuffer[UsedBufferSize]); - hr = subsystem->dxgiOutputDuplication->lpVtbl->GetFrameMoveRects(subsystem->dxgiOutputDuplication, - MoveRectsBufferSize, pMoveRectBuffer, &MoveRectsBufferSize); + hr = subsystem->dxgiOutputDuplication->lpVtbl->GetFrameMoveRects( + subsystem->dxgiOutputDuplication, MoveRectsBufferSize, pMoveRectBuffer, + &MoveRectsBufferSize); if (FAILED(hr)) { - WLog_ERR(TAG, "IDXGIOutputDuplication::GetFrameMoveRects failure: %s (0x%08lX) Size: %u Total %u Used: %u", - GetDxgiErrorString(hr), hr, MoveRectsBufferSize, MetadataBufferSize, UsedBufferSize); + WLog_ERR(TAG, + "IDXGIOutputDuplication::GetFrameMoveRects failure: %s (0x%08lX) Size: %u Total " + "%u Used: %u", + GetDxgiErrorString(hr), hr, MoveRectsBufferSize, MetadataBufferSize, + UsedBufferSize); return -1; } @@ -680,15 +746,19 @@ int win_shadow_dxgi_get_invalid_region(winShadowSubsystem* subsystem) UsedBufferSize += MoveRectsBufferSize; DirtyRectsBufferSize = MetadataBufferSize - UsedBufferSize; - pDirtyRectsBuffer = (RECT*) &(subsystem->MetadataBuffer[UsedBufferSize]); + pDirtyRectsBuffer = (RECT*)&(subsystem->MetadataBuffer[UsedBufferSize]); - hr = subsystem->dxgiOutputDuplication->lpVtbl->GetFrameDirtyRects(subsystem->dxgiOutputDuplication, - DirtyRectsBufferSize, pDirtyRectsBuffer, &DirtyRectsBufferSize); + hr = subsystem->dxgiOutputDuplication->lpVtbl->GetFrameDirtyRects( + subsystem->dxgiOutputDuplication, DirtyRectsBufferSize, pDirtyRectsBuffer, + &DirtyRectsBufferSize); if (FAILED(hr)) { - WLog_ERR(TAG, "IDXGIOutputDuplication::GetFrameDirtyRects failure: %s (0x%08lX) Size: %u Total %u Used: %u", - GetDxgiErrorString(hr), hr, DirtyRectsBufferSize, MetadataBufferSize, UsedBufferSize); + WLog_ERR(TAG, + "IDXGIOutputDuplication::GetFrameDirtyRects failure: %s (0x%08lX) Size: %u Total " + "%u Used: %u", + GetDxgiErrorString(hr), hr, DirtyRectsBufferSize, MetadataBufferSize, + UsedBufferSize); return -1; } @@ -700,10 +770,10 @@ int win_shadow_dxgi_get_invalid_region(winShadowSubsystem* subsystem) pSrcPt = &(pMoveRect->SourcePoint); pDstRect = &(pMoveRect->DestinationRect); - invalidRect.left = (UINT16) pDstRect->left; - invalidRect.top = (UINT16) pDstRect->top; - invalidRect.right = (UINT16) pDstRect->right; - invalidRect.bottom = (UINT16) pDstRect->bottom; + invalidRect.left = (UINT16)pDstRect->left; + invalidRect.top = (UINT16)pDstRect->top; + invalidRect.right = (UINT16)pDstRect->right; + invalidRect.bottom = (UINT16)pDstRect->bottom; region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect); } @@ -714,10 +784,10 @@ int win_shadow_dxgi_get_invalid_region(winShadowSubsystem* subsystem) { pDirtyRect = &pDirtyRectsBuffer[i]; - invalidRect.left = (UINT16) pDirtyRect->left; - invalidRect.top = (UINT16) pDirtyRect->top; - invalidRect.right = (UINT16) pDirtyRect->right; - invalidRect.bottom = (UINT16) pDirtyRect->bottom; + invalidRect.left = (UINT16)pDirtyRect->left; + invalidRect.top = (UINT16)pDirtyRect->top; + invalidRect.right = (UINT16)pDirtyRect->right; + invalidRect.bottom = (UINT16)pDirtyRect->bottom; region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect); } diff --git a/server/shadow/Win/win_dxgi.h b/server/shadow/Win/win_dxgi.h index 92b208984..ffe80a049 100644 --- a/server/shadow/Win/win_dxgi.h +++ b/server/shadow/Win/win_dxgi.h @@ -37,19 +37,20 @@ #include "win_shadow.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif #ifdef WITH_DXGI_1_2 -int win_shadow_dxgi_init(winShadowSubsystem* subsystem); -int win_shadow_dxgi_uninit(winShadowSubsystem* subsystem); + int win_shadow_dxgi_init(winShadowSubsystem* subsystem); + int win_shadow_dxgi_uninit(winShadowSubsystem* subsystem); -int win_shadow_dxgi_fetch_frame_data(winShadowSubsystem* subsystem, - BYTE** ppDstData, int* pnDstStep, int x, int y, int width, int height); + int win_shadow_dxgi_fetch_frame_data(winShadowSubsystem* subsystem, BYTE** ppDstData, + int* pnDstStep, int x, int y, int width, int height); -int win_shadow_dxgi_get_next_frame(winShadowSubsystem* subsystem); -int win_shadow_dxgi_get_invalid_region(winShadowSubsystem* subsystem); + int win_shadow_dxgi_get_next_frame(winShadowSubsystem* subsystem); + int win_shadow_dxgi_get_invalid_region(winShadowSubsystem* subsystem); #endif diff --git a/server/shadow/Win/win_rdp.c b/server/shadow/Win/win_rdp.c index 104f30504..cd550855f 100644 --- a/server/shadow/Win/win_rdp.c +++ b/server/shadow/Win/win_rdp.c @@ -28,17 +28,15 @@ #define TAG SERVER_TAG("shadow.win") -static void shw_OnChannelConnectedEventHandler(void* context, - ChannelConnectedEventArgs* e) +static void shw_OnChannelConnectedEventHandler(void* context, ChannelConnectedEventArgs* e) { - shwContext* shw = (shwContext*) context; + shwContext* shw = (shwContext*)context; WLog_INFO(TAG, "OnChannelConnected: %s", e->name); } -static void shw_OnChannelDisconnectedEventHandler(void* context, - ChannelDisconnectedEventArgs* e) +static void shw_OnChannelDisconnectedEventHandler(void* context, ChannelDisconnectedEventArgs* e) { - shwContext* shw = (shwContext*) context; + shwContext* shw = (shwContext*)context; WLog_INFO(TAG, "OnChannelDisconnected: %s", e->name); } @@ -46,7 +44,7 @@ static BOOL shw_begin_paint(rdpContext* context) { shwContext* shw; rdpGdi* gdi = context->gdi; - shw = (shwContext*) context; + shw = (shwContext*)context; gdi->primary->hdc->hwnd->invalid->null = TRUE; gdi->primary->hdc->hwnd->ninvalid = 0; return TRUE; @@ -59,7 +57,7 @@ static BOOL shw_end_paint(rdpContext* context) HGDI_RGN cinvalid; RECTANGLE_16 invalidRect; rdpGdi* gdi = context->gdi; - shwContext* shw = (shwContext*) context; + shwContext* shw = (shwContext*)context; winShadowSubsystem* subsystem = shw->subsystem; rdpShadowSurface* surface = subsystem->base.server->surface; ninvalid = gdi->primary->hdc->hwnd->ninvalid; @@ -71,8 +69,7 @@ static BOOL shw_end_paint(rdpContext* context) invalidRect.top = cinvalid[index].y; invalidRect.right = cinvalid[index].x + cinvalid[index].w; invalidRect.bottom = cinvalid[index].y + cinvalid[index].h; - region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), - &invalidRect); + region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect); } SetEvent(subsystem->RdpUpdateEnterEvent); @@ -89,19 +86,17 @@ BOOL shw_desktop_resize(rdpContext* context) static BOOL shw_surface_frame_marker(rdpContext* context, const SURFACE_FRAME_MARKER* surfaceFrameMarker) { - shwContext* shw = (shwContext*) context; + shwContext* shw = (shwContext*)context; return TRUE; } -static BOOL shw_authenticate(freerdp* instance, char** username, char** password, - char** domain) +static BOOL shw_authenticate(freerdp* instance, char** username, char** password, char** domain) { return TRUE; } -static DWORD shw_verify_certificate(freerdp* instance, const char* common_name, - const char* subject, const char* issuer, - const char* fingerprint, BOOL host_mismatch) +static DWORD shw_verify_certificate(freerdp* instance, const char* common_name, const char* subject, + const char* issuer, const char* fingerprint, BOOL host_mismatch) { return 1; } @@ -112,10 +107,9 @@ static int shw_verify_x509_certificate(freerdp* instance, BYTE* data, int length return 1; } -static void shw_OnConnectionResultEventHandler(void* context, - ConnectionResultEventArgs* e) +static void shw_OnConnectionResultEventHandler(void* context, ConnectionResultEventArgs* e) { - shwContext* shw = (shwContext*) context; + shwContext* shw = (shwContext*)context; WLog_INFO(TAG, "OnConnectionResult: %d", e->result); } @@ -123,13 +117,10 @@ static BOOL shw_pre_connect(freerdp* instance) { shwContext* shw; rdpContext* context = instance->context; - shw = (shwContext*) context; - PubSub_SubscribeConnectionResult(context->pubSub, - shw_OnConnectionResultEventHandler); - PubSub_SubscribeChannelConnected(context->pubSub, - shw_OnChannelConnectedEventHandler); - PubSub_SubscribeChannelDisconnected(context->pubSub, - shw_OnChannelDisconnectedEventHandler); + shw = (shwContext*)context; + PubSub_SubscribeConnectionResult(context->pubSub, shw_OnConnectionResultEventHandler); + PubSub_SubscribeChannelConnected(context->pubSub, shw_OnChannelConnectedEventHandler); + PubSub_SubscribeChannelDisconnected(context->pubSub, shw_OnChannelDisconnectedEventHandler); if (!freerdp_client_load_addins(context->channels, instance->settings)) return FALSE; @@ -142,7 +133,7 @@ static BOOL shw_post_connect(freerdp* instance) rdpGdi* gdi; shwContext* shw; rdpSettings* settings; - shw = (shwContext*) instance->context; + shw = (shwContext*)instance->context; settings = instance->settings; if (!gdi_init(instance, PIXEL_FORMAT_BGRX32)) @@ -169,11 +160,11 @@ static DWORD WINAPI shw_client_thread(LPVOID arg) shwContext* shw; rdpContext* context; rdpChannels* channels; - freerdp* instance = (freerdp*) arg; + freerdp* instance = (freerdp*)arg; ZeroMemory(rfds, sizeof(rfds)); ZeroMemory(wfds, sizeof(wfds)); - context = (rdpContext*) instance->context; - shw = (shwContext*) context; + context = (rdpContext*)instance->context; + shw = (shwContext*)context; bSuccess = freerdp_connect(instance); WLog_INFO(TAG, "freerdp_connect: %d", bSuccess); @@ -210,8 +201,7 @@ static DWORD WINAPI shw_client_thread(LPVOID arg) for (index = 0; index < wcount; index++) fds[fds_count++] = wfds[index]; - if (MsgWaitForMultipleObjects(fds_count, fds, FALSE, 1000, - QS_ALLINPUT) == WAIT_FAILED) + if (MsgWaitForMultipleObjects(fds_count, fds, FALSE, 1000, QS_ALLINPUT) == WAIT_FAILED) { WLog_ERR(TAG, "MsgWaitForMultipleObjects failure: 0x%08lX", GetLastError()); break; @@ -257,10 +247,9 @@ static int shw_freerdp_client_start(rdpContext* context) { shwContext* shw; freerdp* instance = context->instance; - shw = (shwContext*) context; + shw = (shwContext*)context; - if (!(shw->thread = CreateThread(NULL, 0, shw_client_thread, - instance, 0, NULL))) + if (!(shw->thread = CreateThread(NULL, 0, shw_client_thread, instance, 0, NULL))) { WLog_ERR(TAG, "Failed to create thread"); return -1; @@ -271,7 +260,7 @@ static int shw_freerdp_client_start(rdpContext* context) static int shw_freerdp_client_stop(rdpContext* context) { - shwContext* shw = (shwContext*) context; + shwContext* shw = (shwContext*)context; SetEvent(shw->StopEvent); return 0; } @@ -280,7 +269,7 @@ static BOOL shw_freerdp_client_new(freerdp* instance, rdpContext* context) { shwContext* shw; rdpSettings* settings; - shw = (shwContext*) instance->context; + shw = (shwContext*)instance->context; if (!(shw->StopEvent = CreateEvent(NULL, TRUE, FALSE, NULL))) return FALSE; @@ -335,7 +324,7 @@ static BOOL shw_freerdp_client_new(freerdp* instance, rdpContext* context) static void shw_freerdp_client_free(freerdp* instance, rdpContext* context) { - shwContext* shw = (shwContext*) instance->context; + shwContext* shw = (shwContext*)instance->context; } int shw_RdpClientEntry(RDP_CLIENT_ENTRY_POINTS* pEntryPoints) @@ -371,7 +360,7 @@ int win_shadow_rdp_init(winShadowSubsystem* subsystem) if (!(context = freerdp_client_context_new(&clientEntryPoints))) goto fail_context; - subsystem->shw = (shwContext*) context; + subsystem->shw = (shwContext*)context; subsystem->shw->settings = context->settings; subsystem->shw->subsystem = subsystem; return 1; @@ -387,7 +376,7 @@ int win_shadow_rdp_start(winShadowSubsystem* subsystem) { int status; shwContext* shw = subsystem->shw; - rdpContext* context = (rdpContext*) shw; + rdpContext* context = (rdpContext*)shw; status = freerdp_client_start(context); return status; } @@ -396,7 +385,7 @@ int win_shadow_rdp_stop(winShadowSubsystem* subsystem) { int status; shwContext* shw = subsystem->shw; - rdpContext* context = (rdpContext*) shw; + rdpContext* context = (rdpContext*)shw; status = freerdp_client_stop(context); return status; } diff --git a/server/shadow/Win/win_rdp.h b/server/shadow/Win/win_rdp.h index bc6b1a185..0688da1ba 100644 --- a/server/shadow/Win/win_rdp.h +++ b/server/shadow/Win/win_rdp.h @@ -40,14 +40,15 @@ struct shw_context }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -int win_shadow_rdp_init(winShadowSubsystem* subsystem); -int win_shadow_rdp_uninit(winShadowSubsystem* subsystem); + int win_shadow_rdp_init(winShadowSubsystem* subsystem); + int win_shadow_rdp_uninit(winShadowSubsystem* subsystem); -int win_shadow_rdp_start(winShadowSubsystem* subsystem); -int win_shadow_rdp_stop(winShadowSubsystem* subsystem); + int win_shadow_rdp_start(winShadowSubsystem* subsystem); + int win_shadow_rdp_stop(winShadowSubsystem* subsystem); #ifdef __cplusplus } diff --git a/server/shadow/Win/win_shadow.c b/server/shadow/Win/win_shadow.c index e54bbd1bf..550f367fd 100644 --- a/server/shadow/Win/win_shadow.c +++ b/server/shadow/Win/win_shadow.c @@ -38,14 +38,14 @@ #endif static BOOL win_shadow_input_synchronize_event(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT32 flags) + rdpShadowClient* client, UINT32 flags) { WLog_WARN(TAG, "%s: TODO: Implement!", __FUNCTION__); return TRUE; } -static BOOL win_shadow_input_keyboard_event(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT16 flags, UINT16 code) +static BOOL win_shadow_input_keyboard_event(rdpShadowSubsystem* subsystem, rdpShadowClient* client, + UINT16 flags, UINT16 code) { UINT rc; INPUT event; @@ -69,7 +69,8 @@ static BOOL win_shadow_input_keyboard_event(rdpShadowSubsystem* subsystem, } static BOOL win_shadow_input_unicode_keyboard_event(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT16 flags, UINT16 code) + rdpShadowClient* client, UINT16 flags, + UINT16 code) { UINT rc; INPUT event; @@ -89,8 +90,8 @@ static BOOL win_shadow_input_unicode_keyboard_event(rdpShadowSubsystem* subsyste return TRUE; } -static BOOL win_shadow_input_mouse_event(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT16 flags, UINT16 x, UINT16 y) +static BOOL win_shadow_input_mouse_event(rdpShadowSubsystem* subsystem, rdpShadowClient* client, + UINT16 flags, UINT16 x, UINT16 y) { UINT rc = 1; INPUT event; @@ -123,10 +124,10 @@ static BOOL win_shadow_input_mouse_event(rdpShadowSubsystem* subsystem, } else { - width = (float) GetSystemMetrics(SM_CXSCREEN); - height = (float) GetSystemMetrics(SM_CYSCREEN); - event.mi.dx = (LONG)((float) x * (65535.0f / width)); - event.mi.dy = (LONG)((float) y * (65535.0f / height)); + width = (float)GetSystemMetrics(SM_CXSCREEN); + height = (float)GetSystemMetrics(SM_CYSCREEN); + event.mi.dx = (LONG)((float)x * (65535.0f / width)); + event.mi.dy = (LONG)((float)y * (65535.0f / height)); event.mi.dwFlags = MOUSEEVENTF_ABSOLUTE; if (flags & PTR_FLAGS_MOVE) @@ -174,7 +175,8 @@ static BOOL win_shadow_input_mouse_event(rdpShadowSubsystem* subsystem, } static BOOL win_shadow_input_extended_mouse_event(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT16 flags, UINT16 x, UINT16 y) + rdpShadowClient* client, UINT16 flags, UINT16 x, + UINT16 y) { UINT rc = 1; INPUT event; @@ -188,10 +190,10 @@ static BOOL win_shadow_input_extended_mouse_event(rdpShadowSubsystem* subsystem, if (flags & PTR_FLAGS_MOVE) { - width = (float) GetSystemMetrics(SM_CXSCREEN); - height = (float) GetSystemMetrics(SM_CYSCREEN); - event.mi.dx = (LONG)((float) x * (65535.0f / width)); - event.mi.dy = (LONG)((float) y * (65535.0f / height)); + width = (float)GetSystemMetrics(SM_CXSCREEN); + height = (float)GetSystemMetrics(SM_CYSCREEN); + event.mi.dx = (LONG)((float)x * (65535.0f / width)); + event.mi.dy = (LONG)((float)y * (65535.0f / height)); event.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE; rc = SendInput(1, &event, sizeof(INPUT)); if (rc == 0) @@ -218,9 +220,8 @@ static BOOL win_shadow_input_extended_mouse_event(rdpShadowSubsystem* subsystem, return TRUE; } - -static int win_shadow_invalidate_region(winShadowSubsystem* subsystem, int x, int y, - int width, int height) +static int win_shadow_invalidate_region(winShadowSubsystem* subsystem, int x, int y, int width, + int height) { rdpShadowServer* server; rdpShadowSurface* surface; @@ -232,8 +233,7 @@ static int win_shadow_invalidate_region(winShadowSubsystem* subsystem, int x, in invalidRect.right = x + width; invalidRect.bottom = y + height; EnterCriticalSection(&(surface->lock)); - region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), - &invalidRect); + region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect); LeaveCriticalSection(&(surface->lock)); return 1; } @@ -263,8 +263,7 @@ static int win_shadow_surface_copy(winShadowSubsystem* subsystem) surfaceRect.top = surface->y; surfaceRect.right = surface->x + surface->width; surfaceRect.bottom = surface->y + surface->height; - region16_intersect_rect(&(surface->invalidRegion), &(surface->invalidRegion), - &surfaceRect); + region16_intersect_rect(&(surface->invalidRegion), &(surface->invalidRegion), &surfaceRect); if (region16_is_empty(&(surface->invalidRegion))) return 1; @@ -285,9 +284,8 @@ static int win_shadow_surface_copy(winShadowSubsystem* subsystem) height = surface->height; } - WLog_INFO(TAG, - "SurfaceCopy x: %d y: %d width: %d height: %d right: %d bottom: %d", - x, y, width, height, x + width, y + height); + WLog_INFO(TAG, "SurfaceCopy x: %d y: %d width: %d height: %d right: %d bottom: %d", x, y, width, + height, x + width, y + height); #if defined(WITH_WDS_API) { rdpGdi* gdi; @@ -302,15 +300,13 @@ static int win_shadow_surface_copy(winShadowSubsystem* subsystem) } #elif defined(WITH_DXGI_1_2) DstFormat = PIXEL_FORMAT_BGRX32; - status = win_shadow_dxgi_fetch_frame_data(subsystem, &pDstData, &nDstStep, x, y, - width, height); + status = win_shadow_dxgi_fetch_frame_data(subsystem, &pDstData, &nDstStep, x, y, width, height); #endif if (status <= 0) return status; - if (!freerdp_image_copy(surface->data, surface->format, - surface->scanline, x, y, width, height, + if (!freerdp_image_copy(surface->data, surface->format, surface->scanline, x, y, width, height, pDstData, DstFormat, nDstStep, x, y, NULL, FREERDP_FLIP_NONE)) return ERROR_INTERNAL_ERROR; @@ -488,9 +484,7 @@ static int win_shadow_subsystem_start(rdpShadowSubsystem* arg) if (!subsystem) return -1; - if (!(thread = CreateThread(NULL, 0, - win_shadow_subsystem_thread, - (void*) subsystem, 0, NULL))) + if (!(thread = CreateThread(NULL, 0, win_shadow_subsystem_thread, (void*)subsystem, 0, NULL))) { WLog_ERR(TAG, "Failed to create thread"); return -1; @@ -523,7 +517,7 @@ static void win_shadow_subsystem_free(rdpShadowSubsystem* arg) static rdpShadowSubsystem* win_shadow_subsystem_new(void) { winShadowSubsystem* subsystem; - subsystem = (winShadowSubsystem*) calloc(1, sizeof(winShadowSubsystem)); + subsystem = (winShadowSubsystem*)calloc(1, sizeof(winShadowSubsystem)); if (!subsystem) return NULL; diff --git a/server/shadow/Win/win_shadow.h b/server/shadow/Win/win_shadow.h index f42006c22..835bb6612 100644 --- a/server/shadow/Win/win_shadow.h +++ b/server/shadow/Win/win_shadow.h @@ -78,11 +78,10 @@ struct win_shadow_subsystem }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif - - #ifdef __cplusplus } #endif diff --git a/server/shadow/Win/win_wds.c b/server/shadow/Win/win_wds.c index 024c9626b..1516a316b 100644 --- a/server/shadow/Win/win_wds.c +++ b/server/shadow/Win/win_wds.c @@ -182,16 +182,16 @@ const char* GetRDPSessionEventString(DISPID id) return "OnUnknown"; } -static HRESULT STDMETHODCALLTYPE Shadow_IRDPSessionEvents_QueryInterface( - __RPC__in _IRDPSessionEvents* This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - _COM_Outptr_ void** ppvObject) +static HRESULT STDMETHODCALLTYPE +Shadow_IRDPSessionEvents_QueryInterface(__RPC__in _IRDPSessionEvents* This, + /* [in] */ __RPC__in REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void** ppvObject) { *ppvObject = NULL; - if (IsEqualIID(riid, &DIID__IRDPSessionEvents) || - IsEqualIID(riid, &IID_IDispatch) || IsEqualIID(riid, &IID_IUnknown)) + if (IsEqualIID(riid, &DIID__IRDPSessionEvents) || IsEqualIID(riid, &IID_IDispatch) || + IsEqualIID(riid, &IID_IUnknown)) { *ppvObject = This; } @@ -203,15 +203,13 @@ static HRESULT STDMETHODCALLTYPE Shadow_IRDPSessionEvents_QueryInterface( return S_OK; } -static ULONG STDMETHODCALLTYPE Shadow_IRDPSessionEvents_AddRef( - __RPC__in _IRDPSessionEvents* This) +static ULONG STDMETHODCALLTYPE Shadow_IRDPSessionEvents_AddRef(__RPC__in _IRDPSessionEvents* This) { Shadow_IRDPSessionEvents_RefCount++; return Shadow_IRDPSessionEvents_RefCount; } -static ULONG STDMETHODCALLTYPE Shadow_IRDPSessionEvents_Release( - __RPC__in _IRDPSessionEvents* This) +static ULONG STDMETHODCALLTYPE Shadow_IRDPSessionEvents_Release(__RPC__in _IRDPSessionEvents* This) { if (!Shadow_IRDPSessionEvents_RefCount) return 0; @@ -220,20 +218,20 @@ static ULONG STDMETHODCALLTYPE Shadow_IRDPSessionEvents_Release( return Shadow_IRDPSessionEvents_RefCount; } -static HRESULT STDMETHODCALLTYPE Shadow_IRDPSessionEvents_GetTypeInfoCount( - __RPC__in _IRDPSessionEvents* This, - /* [out] */ __RPC__out UINT* pctinfo) +static HRESULT STDMETHODCALLTYPE +Shadow_IRDPSessionEvents_GetTypeInfoCount(__RPC__in _IRDPSessionEvents* This, + /* [out] */ __RPC__out UINT* pctinfo) { WLog_INFO(TAG, "Shadow_IRDPSessionEvents_GetTypeInfoCount"); *pctinfo = 1; return S_OK; } -static HRESULT STDMETHODCALLTYPE Shadow_IRDPSessionEvents_GetTypeInfo( - __RPC__in _IRDPSessionEvents* This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo** ppTInfo) +static HRESULT STDMETHODCALLTYPE +Shadow_IRDPSessionEvents_GetTypeInfo(__RPC__in _IRDPSessionEvents* This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ __RPC__deref_out_opt ITypeInfo** ppTInfo) { WLog_INFO(TAG, "Shadow_IRDPSessionEvents_GetTypeInfo"); return E_NOTIMPL; @@ -251,24 +249,23 @@ static HRESULT STDMETHODCALLTYPE Shadow_IRDPSessionEvents_GetIDsOfNames( return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE Shadow_IRDPSessionEvents_Invoke( - _IRDPSessionEvents* This, - /* [annotation][in] */ - _In_ DISPID dispIdMember, - /* [annotation][in] */ - _In_ REFIID riid, - /* [annotation][in] */ - _In_ LCID lcid, - /* [annotation][in] */ - _In_ WORD wFlags, - /* [annotation][out][in] */ - _In_ DISPPARAMS* pDispParams, - /* [annotation][out] */ - _Out_opt_ VARIANT* pVarResult, - /* [annotation][out] */ - _Out_opt_ EXCEPINFO* pExcepInfo, - /* [annotation][out] */ - _Out_opt_ UINT* puArgErr) +static HRESULT STDMETHODCALLTYPE Shadow_IRDPSessionEvents_Invoke(_IRDPSessionEvents* This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS* pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT* pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO* pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT* puArgErr) { HRESULT hr; VARIANT vr; @@ -278,45 +275,46 @@ static HRESULT STDMETHODCALLTYPE Shadow_IRDPSessionEvents_Invoke( switch (dispIdMember) { case DISPID_RDPSRAPI_EVENT_ON_ATTENDEE_CONNECTED: + { + int level; + IDispatch* pDispatch; + IRDPSRAPIAttendee* pAttendee; + vr.vt = VT_DISPATCH; + vr.pdispVal = NULL; + hr = DispGetParam(pDispParams, 0, VT_DISPATCH, &vr, &uArgErr); + + if (FAILED(hr)) { - int level; - IDispatch* pDispatch; - IRDPSRAPIAttendee* pAttendee; - vr.vt = VT_DISPATCH; - vr.pdispVal = NULL; - hr = DispGetParam(pDispParams, 0, VT_DISPATCH, &vr, &uArgErr); - - if (FAILED(hr)) - { - WLog_ERR(TAG, "%s DispGetParam(0, VT_DISPATCH) failure: 0x%08lX", - GetRDPSessionEventString(dispIdMember), hr); - return hr; - } - - pDispatch = vr.pdispVal; - hr = pDispatch->lpVtbl->QueryInterface(pDispatch, &IID_IRDPSRAPIAttendee, (void**) &pAttendee); - - if (FAILED(hr)) - { - WLog_INFO(TAG, "%s IDispatch::QueryInterface(IRDPSRAPIAttendee) failure: 0x%08lX", - GetRDPSessionEventString(dispIdMember), hr); - return hr; - } - - level = CTRL_LEVEL_VIEW; - //level = CTRL_LEVEL_INTERACTIVE; - hr = pAttendee->lpVtbl->put_ControlLevel(pAttendee, level); - - if (FAILED(hr)) - { - WLog_INFO(TAG, "%s IRDPSRAPIAttendee::put_ControlLevel() failure: 0x%08lX", - GetRDPSessionEventString(dispIdMember), hr); - return hr; - } - - pAttendee->lpVtbl->Release(pAttendee); + WLog_ERR(TAG, "%s DispGetParam(0, VT_DISPATCH) failure: 0x%08lX", + GetRDPSessionEventString(dispIdMember), hr); + return hr; } - break; + + pDispatch = vr.pdispVal; + hr = pDispatch->lpVtbl->QueryInterface(pDispatch, &IID_IRDPSRAPIAttendee, + (void**)&pAttendee); + + if (FAILED(hr)) + { + WLog_INFO(TAG, "%s IDispatch::QueryInterface(IRDPSRAPIAttendee) failure: 0x%08lX", + GetRDPSessionEventString(dispIdMember), hr); + return hr; + } + + level = CTRL_LEVEL_VIEW; + // level = CTRL_LEVEL_INTERACTIVE; + hr = pAttendee->lpVtbl->put_ControlLevel(pAttendee, level); + + if (FAILED(hr)) + { + WLog_INFO(TAG, "%s IRDPSRAPIAttendee::put_ControlLevel() failure: 0x%08lX", + GetRDPSessionEventString(dispIdMember), hr); + return hr; + } + + pAttendee->lpVtbl->Release(pAttendee); + } + break; case DISPID_RDPSRAPI_EVENT_ON_ATTENDEE_DISCONNECTED: break; @@ -340,55 +338,56 @@ static HRESULT STDMETHODCALLTYPE Shadow_IRDPSessionEvents_Invoke( break; case DISPID_RDPSRAPI_EVENT_ON_CTRLLEVEL_CHANGE_REQUEST: + { + int level; + IDispatch* pDispatch; + IRDPSRAPIAttendee* pAttendee; + vr.vt = VT_INT; + vr.pdispVal = NULL; + hr = DispGetParam(pDispParams, 1, VT_INT, &vr, &uArgErr); + + if (FAILED(hr)) { - int level; - IDispatch* pDispatch; - IRDPSRAPIAttendee* pAttendee; - vr.vt = VT_INT; - vr.pdispVal = NULL; - hr = DispGetParam(pDispParams, 1, VT_INT, &vr, &uArgErr); - - if (FAILED(hr)) - { - WLog_INFO(TAG, "%s DispGetParam(1, VT_INT) failure: 0x%08lX", - GetRDPSessionEventString(dispIdMember), hr); - return hr; - } - - level = vr.intVal; - vr.vt = VT_DISPATCH; - vr.pdispVal = NULL; - hr = DispGetParam(pDispParams, 0, VT_DISPATCH, &vr, &uArgErr); - - if (FAILED(hr)) - { - WLog_ERR(TAG, "%s DispGetParam(0, VT_DISPATCH) failure: 0x%08lX", - GetRDPSessionEventString(dispIdMember), hr); - return hr; - } - - pDispatch = vr.pdispVal; - hr = pDispatch->lpVtbl->QueryInterface(pDispatch, &IID_IRDPSRAPIAttendee, (void**) &pAttendee); - - if (FAILED(hr)) - { - WLog_INFO(TAG, "%s IDispatch::QueryInterface(IRDPSRAPIAttendee) failure: 0x%08lX", - GetRDPSessionEventString(dispIdMember), hr); - return hr; - } - - hr = pAttendee->lpVtbl->put_ControlLevel(pAttendee, level); - - if (FAILED(hr)) - { - WLog_INFO(TAG, "%s IRDPSRAPIAttendee::put_ControlLevel() failure: 0x%08lX", - GetRDPSessionEventString(dispIdMember), hr); - return hr; - } - - pAttendee->lpVtbl->Release(pAttendee); + WLog_INFO(TAG, "%s DispGetParam(1, VT_INT) failure: 0x%08lX", + GetRDPSessionEventString(dispIdMember), hr); + return hr; } - break; + + level = vr.intVal; + vr.vt = VT_DISPATCH; + vr.pdispVal = NULL; + hr = DispGetParam(pDispParams, 0, VT_DISPATCH, &vr, &uArgErr); + + if (FAILED(hr)) + { + WLog_ERR(TAG, "%s DispGetParam(0, VT_DISPATCH) failure: 0x%08lX", + GetRDPSessionEventString(dispIdMember), hr); + return hr; + } + + pDispatch = vr.pdispVal; + hr = pDispatch->lpVtbl->QueryInterface(pDispatch, &IID_IRDPSRAPIAttendee, + (void**)&pAttendee); + + if (FAILED(hr)) + { + WLog_INFO(TAG, "%s IDispatch::QueryInterface(IRDPSRAPIAttendee) failure: 0x%08lX", + GetRDPSessionEventString(dispIdMember), hr); + return hr; + } + + hr = pAttendee->lpVtbl->put_ControlLevel(pAttendee, level); + + if (FAILED(hr)) + { + WLog_INFO(TAG, "%s IRDPSRAPIAttendee::put_ControlLevel() failure: 0x%08lX", + GetRDPSessionEventString(dispIdMember), hr); + return hr; + } + + pAttendee->lpVtbl->Release(pAttendee); + } + break; case DISPID_RDPSRAPI_EVENT_ON_GRAPHICS_STREAM_PAUSED: break; @@ -445,24 +444,17 @@ static HRESULT STDMETHODCALLTYPE Shadow_IRDPSessionEvents_Invoke( return S_OK; } -static _IRDPSessionEventsVtbl Shadow_IRDPSessionEventsVtbl = -{ +static _IRDPSessionEventsVtbl Shadow_IRDPSessionEventsVtbl = { /* IUnknown */ - Shadow_IRDPSessionEvents_QueryInterface, - Shadow_IRDPSessionEvents_AddRef, + Shadow_IRDPSessionEvents_QueryInterface, Shadow_IRDPSessionEvents_AddRef, Shadow_IRDPSessionEvents_Release, /* IDispatch */ - Shadow_IRDPSessionEvents_GetTypeInfoCount, - Shadow_IRDPSessionEvents_GetTypeInfo, - Shadow_IRDPSessionEvents_GetIDsOfNames, - Shadow_IRDPSessionEvents_Invoke + Shadow_IRDPSessionEvents_GetTypeInfoCount, Shadow_IRDPSessionEvents_GetTypeInfo, + Shadow_IRDPSessionEvents_GetIDsOfNames, Shadow_IRDPSessionEvents_Invoke }; -static _IRDPSessionEvents Shadow_IRDPSessionEvents = -{ - &Shadow_IRDPSessionEventsVtbl -}; +static _IRDPSessionEvents Shadow_IRDPSessionEvents = { &Shadow_IRDPSessionEventsVtbl }; static LRESULT CALLBACK ShadowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { @@ -511,8 +503,8 @@ int win_shadow_wds_wnd_init(winShadowSubsystem* subsystem) } hInstance = wndClassEx.hInstance; - subsystem->hWnd = CreateWindowEx(0, wndClassEx.lpszClassName, - 0, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, hInstance, NULL); + subsystem->hWnd = CreateWindowEx(0, wndClassEx.lpszClassName, 0, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, + hInstance, NULL); if (!subsystem->hWnd) { @@ -558,8 +550,8 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) return -1; } - hr = CoCreateInstance(&CLSID_RDPSession, NULL, CLSCTX_ALL, - &IID_IRDPSRAPISharingSession, (void**) & (subsystem->pSharingSession)); + hr = CoCreateInstance(&CLSID_RDPSession, NULL, CLSCTX_ALL, &IID_IRDPSRAPISharingSession, + (void**)&(subsystem->pSharingSession)); if (FAILED(hr)) { @@ -567,8 +559,8 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) return -1; } - pUnknown = (IUnknown*) subsystem->pSharingSession; - hr = pUnknown->lpVtbl->QueryInterface(pUnknown, &IID_IConnectionPointContainer, (void**) &pCPC); + pUnknown = (IUnknown*)subsystem->pSharingSession; + hr = pUnknown->lpVtbl->QueryInterface(pUnknown, &IID_IConnectionPointContainer, (void**)&pCPC); if (FAILED(hr)) { @@ -580,15 +572,17 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IConnectionPointContainer::FindConnectionPoint(_IRDPSessionEvents) failure: 0x%08lX", - hr); + WLog_ERR( + TAG, + "IConnectionPointContainer::FindConnectionPoint(_IRDPSessionEvents) failure: 0x%08lX", + hr); return -1; } dwCookie = 0; subsystem->pSessionEvents = &Shadow_IRDPSessionEvents; subsystem->pSessionEvents->lpVtbl->AddRef(subsystem->pSessionEvents); - hr = pCP->lpVtbl->Advise(pCP, (IUnknown*) subsystem->pSessionEvents, &dwCookie); + hr = pCP->lpVtbl->Advise(pCP, (IUnknown*)subsystem->pSessionEvents, &dwCookie); if (FAILED(hr)) { @@ -604,8 +598,8 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) return -1; } - hr = subsystem->pSharingSession->lpVtbl->GetDesktopSharedRect(subsystem->pSharingSession, - &left, &top, &right, &bottom); + hr = subsystem->pSharingSession->lpVtbl->GetDesktopSharedRect(subsystem->pSharingSession, &left, + &top, &right, &bottom); if (FAILED(hr)) { @@ -615,11 +609,12 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) width = right - left; height = bottom - top; - WLog_INFO(TAG, - "GetDesktopSharedRect(): left: %ld top: %ld right: %ld bottom: %ld width: %ld height: %ld", - left, top, right, bottom, width, height); - hr = subsystem->pSharingSession->lpVtbl->get_VirtualChannelManager(subsystem->pSharingSession, - &(subsystem->pVirtualChannelMgr)); + WLog_INFO( + TAG, + "GetDesktopSharedRect(): left: %ld top: %ld right: %ld bottom: %ld width: %ld height: %ld", + left, top, right, bottom, width, height); + hr = subsystem->pSharingSession->lpVtbl->get_VirtualChannelManager( + subsystem->pSharingSession, &(subsystem->pVirtualChannelMgr)); if (FAILED(hr)) { @@ -627,8 +622,8 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) return -1; } - hr = subsystem->pSharingSession->lpVtbl->get_ApplicationFilter(subsystem->pSharingSession, - &(subsystem->pApplicationFilter)); + hr = subsystem->pSharingSession->lpVtbl->get_ApplicationFilter( + subsystem->pSharingSession, &(subsystem->pApplicationFilter)); if (FAILED(hr)) { @@ -637,7 +632,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) } hr = subsystem->pSharingSession->lpVtbl->get_Attendees(subsystem->pSharingSession, - &(subsystem->pAttendeeMgr)); + &(subsystem->pAttendeeMgr)); if (FAILED(hr)) { @@ -646,7 +641,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) } hr = subsystem->pSharingSession->lpVtbl->get_Properties(subsystem->pSharingSession, - &(subsystem->pSessionProperties)); + &(subsystem->pSessionProperties)); if (FAILED(hr)) { @@ -658,7 +653,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) varPropertyValue.vt = VT_I4; varPropertyValue.intVal = 40000; hr = subsystem->pSessionProperties->lpVtbl->put_Property(subsystem->pSessionProperties, - bstrPropertyName, varPropertyValue); + bstrPropertyName, varPropertyValue); SysFreeString(bstrPropertyName); if (FAILED(hr)) @@ -671,27 +666,29 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) varPropertyValue.vt = VT_BOOL; varPropertyValue.boolVal = VARIANT_TRUE; hr = subsystem->pSessionProperties->lpVtbl->put_Property(subsystem->pSessionProperties, - bstrPropertyName, varPropertyValue); + bstrPropertyName, varPropertyValue); SysFreeString(bstrPropertyName); if (FAILED(hr)) { - WLog_ERR(TAG, "IRDPSRAPISessionProperties::put_Property(DrvConAttach) failure: 0x%08lX", hr); + WLog_ERR(TAG, "IRDPSRAPISessionProperties::put_Property(DrvConAttach) failure: 0x%08lX", + hr); return -1; } bstrPropertyName = SysAllocString(L"PortProtocol"); varPropertyValue.vt = VT_I4; - //varPropertyValue.intVal = 0; // AF_UNSPEC + // varPropertyValue.intVal = 0; // AF_UNSPEC varPropertyValue.intVal = 2; // AF_INET - //varPropertyValue.intVal = 23; // AF_INET6 + // varPropertyValue.intVal = 23; // AF_INET6 hr = subsystem->pSessionProperties->lpVtbl->put_Property(subsystem->pSessionProperties, - bstrPropertyName, varPropertyValue); + bstrPropertyName, varPropertyValue); SysFreeString(bstrPropertyName); if (FAILED(hr)) { - WLog_ERR(TAG, "IRDPSRAPISessionProperties::put_Property(PortProtocol) failure: 0x%08lX", hr); + WLog_ERR(TAG, "IRDPSRAPISessionProperties::put_Property(PortProtocol) failure: 0x%08lX", + hr); return -1; } @@ -704,7 +701,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) } hr = subsystem->pSharingSession->lpVtbl->get_Invitations(subsystem->pSharingSession, - &(subsystem->pInvitationMgr)); + &(subsystem->pInvitationMgr)); if (FAILED(hr)) { @@ -715,8 +712,9 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) bstrAuthString = SysAllocString(L"Shadow"); bstrGroupName = SysAllocString(L"ShadowGroup"); bstrPassword = SysAllocString(L"Shadow123!"); - hr = subsystem->pInvitationMgr->lpVtbl->CreateInvitation(subsystem->pInvitationMgr, bstrAuthString, - bstrGroupName, bstrPassword, 5, &(subsystem->pInvitation)); + hr = subsystem->pInvitationMgr->lpVtbl->CreateInvitation( + subsystem->pInvitationMgr, bstrAuthString, bstrGroupName, bstrPassword, 5, + &(subsystem->pInvitation)); SysFreeString(bstrAuthString); SysFreeString(bstrGroupName); SysFreeString(bstrPassword); @@ -740,7 +738,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) char* ConnectionString2; BSTR bstrConnectionString; hr = subsystem->pInvitation->lpVtbl->get_ConnectionString(subsystem->pInvitation, - &bstrConnectionString); + &bstrConnectionString); if (FAILED(hr)) { @@ -748,8 +746,9 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) return -1; } - status1 = ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) bstrConnectionString, - ((UINT32*) bstrConnectionString)[-1], &(ConnectionString2), 0, NULL, NULL); + status1 = ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)bstrConnectionString, + ((UINT32*)bstrConnectionString)[-1], &(ConnectionString2), 0, + NULL, NULL); SysFreeString(bstrConnectionString); status2 = freerdp_assistance_set_connection_string2(file, ConnectionString2, "Shadow123!"); free(ConnectionString2); diff --git a/server/shadow/Win/win_wds.h b/server/shadow/Win/win_wds.h index 8262e8515..f8f3d80c0 100644 --- a/server/shadow/Win/win_wds.h +++ b/server/shadow/Win/win_wds.h @@ -19,7 +19,7 @@ #ifndef FREERDP_SERVER_SHADOW_WIN_WDS_H #define FREERDP_SERVER_SHADOW_WIN_WDS_H -#define WITH_WDS_API 1 +#define WITH_WDS_API 1 #ifndef CINTERFACE #define CINTERFACE @@ -28,17 +28,18 @@ #include #ifndef DISPID_RDPAPI_EVENT_ON_BOUNDING_RECT_CHANGED -#define DISPID_RDPAPI_EVENT_ON_BOUNDING_RECT_CHANGED 340 +#define DISPID_RDPAPI_EVENT_ON_BOUNDING_RECT_CHANGED 340 #endif #include "win_shadow.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -int win_shadow_wds_init(winShadowSubsystem* subsystem); -int win_shadow_wds_uninit(winShadowSubsystem* subsystem); + int win_shadow_wds_init(winShadowSubsystem* subsystem); + int win_shadow_wds_uninit(winShadowSubsystem* subsystem); #ifdef __cplusplus } diff --git a/server/shadow/X11/x11_shadow.c b/server/shadow/X11/x11_shadow.c index d91392d91..9dfa12a5e 100644 --- a/server/shadow/X11/x11_shadow.c +++ b/server/shadow/X11/x11_shadow.c @@ -76,10 +76,9 @@ static int x11_shadow_pam_conv(int num_msg, const struct pam_message** msg, int pam_status = PAM_CONV_ERR; SHADOW_PAM_AUTH_DATA* appdata; struct pam_response* response; - appdata = (SHADOW_PAM_AUTH_DATA*) appdata_ptr; + appdata = (SHADOW_PAM_AUTH_DATA*)appdata_ptr; - if (!(response = (struct pam_response*) calloc(num_msg, - sizeof(struct pam_response)))) + if (!(response = (struct pam_response*)calloc(num_msg, sizeof(struct pam_response)))) return PAM_BUF_ERR; for (index = 0; index < num_msg; index++) @@ -162,9 +161,8 @@ static int x11_shadow_pam_get_service_name(SHADOW_PAM_AUTH_INFO* info) return 1; } -static int x11_shadow_pam_authenticate(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, const char* user, const char* domain, - const char* password) +static int x11_shadow_pam_authenticate(rdpShadowSubsystem* subsystem, rdpShadowClient* client, + const char* user, const char* domain, const char* password) { int pam_status; SHADOW_PAM_AUTH_INFO* info; @@ -199,8 +197,7 @@ static int x11_shadow_pam_authenticate(rdpShadowSubsystem* subsystem, if (pam_status != PAM_SUCCESS) { - WLog_ERR(TAG, "pam_authenticate failure: %s", pam_strerror(info->handle, - pam_status)); + WLog_ERR(TAG, "pam_authenticate failure: %s", pam_strerror(info->handle, pam_status)); free(info); return -1; } @@ -209,8 +206,7 @@ static int x11_shadow_pam_authenticate(rdpShadowSubsystem* subsystem, if (pam_status != PAM_SUCCESS) { - WLog_ERR(TAG, "pam_acct_mgmt failure: %s", pam_strerror(info->handle, - pam_status)); + WLog_ERR(TAG, "pam_acct_mgmt failure: %s", pam_strerror(info->handle, pam_status)); free(info); return -1; } @@ -222,15 +218,15 @@ static int x11_shadow_pam_authenticate(rdpShadowSubsystem* subsystem, #endif static BOOL x11_shadow_input_synchronize_event(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT32 flags) + rdpShadowClient* client, UINT32 flags) { /* TODO: Implement */ WLog_WARN(TAG, "%s not implemented", __FUNCTION__); return TRUE; } -static BOOL x11_shadow_input_keyboard_event(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT16 flags, UINT16 code) +static BOOL x11_shadow_input_keyboard_event(rdpShadowSubsystem* subsystem, rdpShadowClient* client, + UINT16 flags, UINT16 code) { #ifdef WITH_XTEST x11ShadowSubsystem* x11 = (x11ShadowSubsystem*)subsystem; @@ -273,17 +269,17 @@ static BOOL x11_shadow_input_keyboard_event(rdpShadowSubsystem* subsystem, return TRUE; } -static BOOL x11_shadow_input_unicode_keyboard_event(rdpShadowSubsystem* - subsystem, - rdpShadowClient* client, UINT16 flags, UINT16 code) +static BOOL x11_shadow_input_unicode_keyboard_event(rdpShadowSubsystem* subsystem, + rdpShadowClient* client, UINT16 flags, + UINT16 code) { /* TODO: Implement */ WLog_WARN(TAG, "%s not implemented", __FUNCTION__); return TRUE; } -static BOOL x11_shadow_input_mouse_event(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT16 flags, UINT16 x, UINT16 y) +static BOOL x11_shadow_input_mouse_event(rdpShadowSubsystem* subsystem, rdpShadowClient* client, + UINT16 flags, UINT16 x, UINT16 y) { #ifdef WITH_XTEST x11ShadowSubsystem* x11 = (x11ShadowSubsystem*)subsystem; @@ -349,7 +345,8 @@ static BOOL x11_shadow_input_mouse_event(rdpShadowSubsystem* subsystem, } static BOOL x11_shadow_input_extended_mouse_event(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT16 flags, UINT16 x, UINT16 y) + rdpShadowClient* client, UINT16 flags, UINT16 x, + UINT16 y) { #ifdef WITH_XTEST x11ShadowSubsystem* x11 = (x11ShadowSubsystem*)subsystem; @@ -411,7 +408,7 @@ static void x11_shadow_message_free(UINT32 id, SHADOW_MSG_OUT* msg) break; default: - WLog_ERR(TAG, "Unknown message id: %"PRIu32"", id); + WLog_ERR(TAG, "Unknown message id: %" PRIu32 "", id); free(msg); break; } @@ -453,7 +450,7 @@ static int x11_shadow_pointer_position_update(x11ShadowSubsystem* subsystem) memcpy(msg, &templateMsg, sizeof(templateMsg)); - if (shadow_client_post_msg(client, NULL, msgId, (SHADOW_MSG_OUT*) msg, NULL)) + if (shadow_client_post_msg(client, NULL, msgId, (SHADOW_MSG_OUT*)msg, NULL)) count++; } @@ -465,8 +462,8 @@ static int x11_shadow_pointer_alpha_update(x11ShadowSubsystem* subsystem) { SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE* msg; UINT32 msgId = SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE_ID; - msg = (SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE*) calloc(1, - sizeof(SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE)); + msg = (SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE*)calloc(1, + sizeof(SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE)); if (!msg) return -1; @@ -476,17 +473,18 @@ static int x11_shadow_pointer_alpha_update(x11ShadowSubsystem* subsystem) msg->width = subsystem->cursorWidth; msg->height = subsystem->cursorHeight; - if (shadow_subsystem_pointer_convert_alpha_pointer_data(subsystem->cursorPixels, - TRUE, - msg->width, msg->height, msg) < 0) + if (shadow_subsystem_pointer_convert_alpha_pointer_data(subsystem->cursorPixels, TRUE, + msg->width, msg->height, msg) < 0) { free(msg); return -1; } msg->common.Free = x11_shadow_message_free; - return shadow_client_boardcast_msg(subsystem->common.server, NULL, msgId, - (SHADOW_MSG_OUT*) msg, NULL) ? 1 : -1; + return shadow_client_boardcast_msg(subsystem->common.server, NULL, msgId, (SHADOW_MSG_OUT*)msg, + NULL) + ? 1 + : -1; } static int x11_shadow_query_cursor(x11ShadowSubsystem* subsystem, BOOL getImage) @@ -524,12 +522,12 @@ static int x11_shadow_query_cursor(x11ShadowSubsystem* subsystem, BOOL getImage) subsystem->cursorHeight = ci->height; subsystem->cursorId = ci->cursor_serial; n = ci->width * ci->height; - pDstPixel = (UINT32*) subsystem->cursorPixels; + pDstPixel = (UINT32*)subsystem->cursorPixels; for (k = 0; k < n; k++) { /* XFixesCursorImage.pixels is in *unsigned long*, which may be 8 bytes */ - *pDstPixel++ = (UINT32) ci->pixels[k]; + *pDstPixel++ = (UINT32)ci->pixels[k]; } XFree(ci); @@ -544,8 +542,8 @@ static int x11_shadow_query_cursor(x11ShadowSubsystem* subsystem, BOOL getImage) Window root, child; XLockDisplay(subsystem->display); - if (!XQueryPointer(subsystem->display, subsystem->root_window, - &root, &child, &root_x, &root_y, &win_x, &win_y, &mask)) + if (!XQueryPointer(subsystem->display, subsystem->root_window, &root, &child, &root_x, + &root_y, &win_x, &win_y, &mask)) { XUnlockDisplay(subsystem->display); return -1; @@ -573,8 +571,7 @@ static int x11_shadow_query_cursor(x11ShadowSubsystem* subsystem, BOOL getImage) return 1; } -static int x11_shadow_handle_xevent(x11ShadowSubsystem* subsystem, - XEvent* xevent) +static int x11_shadow_handle_xevent(x11ShadowSubsystem* subsystem, XEvent* xevent) { if (xevent->type == MotionNotify) { @@ -594,9 +591,8 @@ static int x11_shadow_handle_xevent(x11ShadowSubsystem* subsystem, return 1; } -static void x11_shadow_validate_region(x11ShadowSubsystem* subsystem, int x, - int y, - int width, int height) +static void x11_shadow_validate_region(x11ShadowSubsystem* subsystem, int x, int y, int width, + int height) { XRectangle region; @@ -610,8 +606,7 @@ static void x11_shadow_validate_region(x11ShadowSubsystem* subsystem, int x, #ifdef WITH_XFIXES XLockDisplay(subsystem->display); XFixesSetRegion(subsystem->display, subsystem->xdamage_region, ®ion, 1); - XDamageSubtract(subsystem->display, subsystem->xdamage, - subsystem->xdamage_region, None); + XDamageSubtract(subsystem->display, subsystem->xdamage, subsystem->xdamage_region, None); XUnlockDisplay(subsystem->display); #endif } @@ -744,13 +739,12 @@ static BOOL x11_shadow_check_resize(x11ShadowSubsystem* subsystem) return FALSE; } -static int x11_shadow_error_handler_for_capture(Display* display, - XErrorEvent* event) +static int x11_shadow_error_handler_for_capture(Display* display, XErrorEvent* event) { char msg[256]; - XGetErrorText(display, event->error_code, (char*) &msg, sizeof(msg)); - WLog_ERR(TAG, "X11 error: %s Error code: %x, request code: %x, minor code: %x", - msg, event->error_code, event->request_code, event->minor_code); + XGetErrorText(display, event->error_code, (char*)&msg, sizeof(msg)); + WLog_ERR(TAG, "X11 error: %s Error code: %x, request code: %x, minor code: %x", msg, + event->error_code, event->request_code, event->minor_code); /* Ignore BAD MATCH error during image capture. Abort in other case */ if (event->error_code != BadMatch) @@ -796,15 +790,14 @@ static int x11_shadow_screen_grab(x11ShadowSubsystem* subsystem) image = subsystem->fb_image; XCopyArea(subsystem->display, subsystem->root_window, subsystem->fb_pixmap, subsystem->xshm_gc, 0, 0, subsystem->width, subsystem->height, 0, 0); - status = shadow_capture_compare(surface->data, surface->scanline, - surface->width, surface->height, - (BYTE*) & (image->data[surface->width * 4]), image->bytes_per_line, - &invalidRect); + status = shadow_capture_compare(surface->data, surface->scanline, surface->width, + surface->height, (BYTE*)&(image->data[surface->width * 4]), + image->bytes_per_line, &invalidRect); } else { - image = XGetImage(subsystem->display, subsystem->root_window, - surface->x, surface->y, surface->width, surface->height, AllPlanes, ZPixmap); + image = XGetImage(subsystem->display, subsystem->root_window, surface->x, surface->y, + surface->width, surface->height, AllPlanes, ZPixmap); if (!image) { @@ -815,9 +808,9 @@ static int x11_shadow_screen_grab(x11ShadowSubsystem* subsystem) goto fail_capture; } - status = shadow_capture_compare(surface->data, surface->scanline, - surface->width, surface->height, - (BYTE*) image->data, image->bytes_per_line, &invalidRect); + status = shadow_capture_compare(surface->data, surface->scanline, surface->width, + surface->height, (BYTE*)image->data, image->bytes_per_line, + &invalidRect); } /* Restore the default error handler */ @@ -827,10 +820,8 @@ static int x11_shadow_screen_grab(x11ShadowSubsystem* subsystem) if (status) { - region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), - &invalidRect); - region16_intersect_rect(&(surface->invalidRegion), &(surface->invalidRegion), - &surfaceRect); + region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect); + region16_intersect_rect(&(surface->invalidRegion), &(surface->invalidRegion), &surfaceRect); if (!region16_is_empty(&(surface->invalidRegion))) { @@ -840,23 +831,23 @@ static int x11_shadow_screen_grab(x11ShadowSubsystem* subsystem) width = extents->right - extents->left; height = extents->bottom - extents->top; - if (!freerdp_image_copy(surface->data, surface->format, - surface->scanline, x, y, width, height, - (BYTE*) image->data, PIXEL_FORMAT_BGRX32, + if (!freerdp_image_copy(surface->data, surface->format, surface->scanline, x, y, width, + height, (BYTE*)image->data, PIXEL_FORMAT_BGRX32, image->bytes_per_line, x, y, NULL, FREERDP_FLIP_NONE)) goto fail_capture; - //x11_shadow_blend_cursor(subsystem); + // x11_shadow_blend_cursor(subsystem); count = ArrayList_Count(server->clients); shadow_subsystem_frame_update((rdpShadowSubsystem*)subsystem); if (count == 1) { rdpShadowClient* client; - client = (rdpShadowClient*) ArrayList_GetItem(server->clients, 0); + client = (rdpShadowClient*)ArrayList_GetItem(server->clients, 0); if (client) - subsystem->common.captureFrameRate = shadow_encoder_preferred_fps(client->encoder); + subsystem->common.captureFrameRate = + shadow_encoder_preferred_fps(client->encoder); } region16_clear(&(surface->invalidRegion)); @@ -878,8 +869,7 @@ fail_capture: return 0; } -static int x11_shadow_subsystem_process_message(x11ShadowSubsystem* subsystem, - wMessage* message) +static int x11_shadow_subsystem_process_message(x11ShadowSubsystem* subsystem, wMessage* message) { switch (message->id) { @@ -888,7 +878,7 @@ static int x11_shadow_subsystem_process_message(x11ShadowSubsystem* subsystem, break; default: - WLog_ERR(TAG, "Unknown message id: %"PRIu32"", message->id); + WLog_ERR(TAG, "Unknown message id: %" PRIu32 "", message->id); break; } @@ -1022,8 +1012,7 @@ static int x11_shadow_xinerama_init(x11ShadowSubsystem* subsystem) int xinerama_error; x11_shadow_subsystem_base_init(subsystem); - if (!XineramaQueryExtension(subsystem->display, &xinerama_event, - &xinerama_error)) + if (!XineramaQueryExtension(subsystem->display, &xinerama_event, &xinerama_error)) return -1; if (!XDamageQueryVersion(subsystem->display, &major, &minor)) @@ -1058,8 +1047,8 @@ static int x11_shadow_xdamage_init(x11ShadowSubsystem* subsystem) return -1; subsystem->xdamage_notify_event = damage_event + XDamageNotify; - subsystem->xdamage = XDamageCreate(subsystem->display, subsystem->root_window, - XDamageReportDeltaRectangles); + subsystem->xdamage = + XDamageCreate(subsystem->display, subsystem->root_window, XDamageReportDeltaRectangles); if (!subsystem->xdamage) return -1; @@ -1093,11 +1082,11 @@ static int x11_shadow_xshm_init(x11ShadowSubsystem* subsystem) return -1; subsystem->fb_shm_info.shmid = -1; - subsystem->fb_shm_info.shmaddr = (char*) - 1; + subsystem->fb_shm_info.shmaddr = (char*)-1; subsystem->fb_shm_info.readOnly = False; - subsystem->fb_image = XShmCreateImage(subsystem->display, subsystem->visual, - subsystem->depth, - ZPixmap, NULL, &(subsystem->fb_shm_info), subsystem->width, subsystem->height); + subsystem->fb_image = + XShmCreateImage(subsystem->display, subsystem->visual, subsystem->depth, ZPixmap, NULL, + &(subsystem->fb_shm_info), subsystem->width, subsystem->height); if (!subsystem->fb_image) { @@ -1105,9 +1094,9 @@ static int x11_shadow_xshm_init(x11ShadowSubsystem* subsystem) return -1; } - subsystem->fb_shm_info.shmid = shmget(IPC_PRIVATE, - subsystem->fb_image->bytes_per_line * subsystem->fb_image->height, - IPC_CREAT | 0600); + subsystem->fb_shm_info.shmid = + shmget(IPC_PRIVATE, subsystem->fb_image->bytes_per_line * subsystem->fb_image->height, + IPC_CREAT | 0600); if (subsystem->fb_shm_info.shmid == -1) { @@ -1118,7 +1107,7 @@ static int x11_shadow_xshm_init(x11ShadowSubsystem* subsystem) subsystem->fb_shm_info.shmaddr = shmat(subsystem->fb_shm_info.shmid, 0, 0); subsystem->fb_image->data = subsystem->fb_shm_info.shmaddr; - if (subsystem->fb_shm_info.shmaddr == ((char*) - 1)) + if (subsystem->fb_shm_info.shmaddr == ((char*)-1)) { WLog_ERR(TAG, "shmat failed"); return -1; @@ -1129,10 +1118,10 @@ static int x11_shadow_xshm_init(x11ShadowSubsystem* subsystem) XSync(subsystem->display, False); shmctl(subsystem->fb_shm_info.shmid, IPC_RMID, 0); - subsystem->fb_pixmap = XShmCreatePixmap(subsystem->display, - subsystem->root_window, subsystem->fb_image->data, &(subsystem->fb_shm_info), - subsystem->fb_image->width, subsystem->fb_image->height, - subsystem->fb_image->depth); + subsystem->fb_pixmap = + XShmCreatePixmap(subsystem->display, subsystem->root_window, subsystem->fb_image->data, + &(subsystem->fb_shm_info), subsystem->fb_image->width, + subsystem->fb_image->height, subsystem->fb_image->depth); XSync(subsystem->display, False); if (!subsystem->fb_pixmap) @@ -1288,8 +1277,8 @@ static int x11_shadow_subsystem_init(rdpShadowSubsystem* sub) ZeroMemory(&template, sizeof(template)); template.class = TrueColor; template.screen = subsystem->number; - vis = XGetVisualInfo(subsystem->display, VisualClassMask | VisualScreenMask, - &template, &vi_count); + vis = XGetVisualInfo(subsystem->display, VisualClassMask | VisualScreenMask, &template, + &vi_count); if (!vis) { @@ -1309,12 +1298,11 @@ static int x11_shadow_subsystem_init(rdpShadowSubsystem* sub) } XFree(vis); - XSelectInput(subsystem->display, subsystem->root_window, - SubstructureNotifyMask); + XSelectInput(subsystem->display, subsystem->root_window, SubstructureNotifyMask); subsystem->cursorMaxWidth = 256; subsystem->cursorMaxHeight = 256; - subsystem->cursorPixels = _aligned_malloc(subsystem->cursorMaxWidth * - subsystem->cursorMaxHeight * 4, 16); + subsystem->cursorPixels = + _aligned_malloc(subsystem->cursorMaxWidth * subsystem->cursorMaxHeight * 4, 16); if (!subsystem->cursorPixels) return -1; @@ -1345,8 +1333,8 @@ static int x11_shadow_subsystem_init(rdpShadowSubsystem* sub) subsystem->use_xdamage = FALSE; } - if (!(subsystem->common.event = CreateFileDescriptorEvent(NULL, FALSE, FALSE, - subsystem->xfds, WINPR_FD_READ))) + if (!(subsystem->common.event = + CreateFileDescriptorEvent(NULL, FALSE, FALSE, subsystem->xfds, WINPR_FD_READ))) return -1; virtualScreen = &(subsystem->common.virtualScreen); @@ -1356,7 +1344,8 @@ static int x11_shadow_subsystem_init(rdpShadowSubsystem* sub) virtualScreen->bottom = subsystem->height; virtualScreen->flags = 1; WLog_INFO(TAG, - "X11 Extensions: XFixes: %"PRId32" Xinerama: %"PRId32" XDamage: %"PRId32" XShm: %"PRId32"", + "X11 Extensions: XFixes: %" PRId32 " Xinerama: %" PRId32 " XDamage: %" PRId32 + " XShm: %" PRId32 "", subsystem->use_xfixes, subsystem->use_xinerama, subsystem->use_xdamage, subsystem->use_xshm); return 1; @@ -1397,8 +1386,8 @@ static int x11_shadow_subsystem_start(rdpShadowSubsystem* sub) if (!subsystem) return -1; - if (!(subsystem->thread = CreateThread(NULL, 0, x11_shadow_subsystem_thread, - (void*) subsystem, 0, NULL))) + if (!(subsystem->thread = + CreateThread(NULL, 0, x11_shadow_subsystem_thread, (void*)subsystem, 0, NULL))) { WLog_ERR(TAG, "Failed to create thread"); return -1; @@ -1429,7 +1418,7 @@ static int x11_shadow_subsystem_stop(rdpShadowSubsystem* sub) static rdpShadowSubsystem* x11_shadow_subsystem_new(void) { x11ShadowSubsystem* subsystem; - subsystem = (x11ShadowSubsystem*) calloc(1, sizeof(x11ShadowSubsystem)); + subsystem = (x11ShadowSubsystem*)calloc(1, sizeof(x11ShadowSubsystem)); if (!subsystem) return NULL; diff --git a/server/shadow/X11/x11_shadow.h b/server/shadow/X11/x11_shadow.h index 12629f47a..aca2d63db 100644 --- a/server/shadow/X11/x11_shadow.h +++ b/server/shadow/X11/x11_shadow.h @@ -103,11 +103,10 @@ struct x11_shadow_subsystem }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif - - #ifdef __cplusplus } #endif diff --git a/server/shadow/shadow.c b/server/shadow/shadow.c index 0e869d927..fcf8bd31e 100644 --- a/server/shadow/shadow.c +++ b/server/shadow/shadow.c @@ -101,7 +101,7 @@ int main(int argc, char** argv) if (!GetExitCodeThread(server->thread, &dwExitCode)) status = -1; else - status = (int) dwExitCode; + status = (int)dwExitCode; fail_server_start: shadow_server_uninit(server); @@ -111,4 +111,3 @@ fail_parse_command_line: fail_server_new: return status; } - diff --git a/server/shadow/shadow.h b/server/shadow/shadow.h index 2532bfd41..33eb80557 100644 --- a/server/shadow/shadow.h +++ b/server/shadow/shadow.h @@ -33,14 +33,12 @@ #include "shadow_mcevent.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif - - #ifdef __cplusplus } #endif #endif /* FREERDP_SERVER_SHADOW_SHADOW_H */ - diff --git a/server/shadow/shadow_audin.c b/server/shadow/shadow_audin.c index abaf19941..aab2532aa 100644 --- a/server/shadow/shadow_audin.c +++ b/server/shadow/shadow_audin.c @@ -71,7 +71,7 @@ static UINT AudinServerOpenResult(audin_server_context* context, UINT32 result) { /* TODO: Implement */ WLog_WARN(TAG, "%s not implemented", __FUNCTION__); - WLog_INFO(TAG, "AUDIN open result %"PRIu32".\n", result); + WLog_INFO(TAG, "AUDIN open result %" PRIu32 ".\n", result); return CHANNEL_RC_OK; } /** diff --git a/server/shadow/shadow_audin.h b/server/shadow/shadow_audin.h index 6fe0d8528..0499987ec 100644 --- a/server/shadow/shadow_audin.h +++ b/server/shadow/shadow_audin.h @@ -25,11 +25,12 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -BOOL shadow_client_audin_init(rdpShadowClient* client); -void shadow_client_audin_uninit(rdpShadowClient* client); + BOOL shadow_client_audin_init(rdpShadowClient* client); + void shadow_client_audin_uninit(rdpShadowClient* client); #ifdef __cplusplus } diff --git a/server/shadow/shadow_capture.c b/server/shadow/shadow_capture.c index 1f6f5447a..8bd79be5d 100644 --- a/server/shadow/shadow_capture.c +++ b/server/shadow/shadow_capture.c @@ -79,8 +79,8 @@ int shadow_capture_align_clip_rect(RECTANGLE_16* rect, RECTANGLE_16* clip) return 1; } -int shadow_capture_compare(BYTE* pData1, UINT32 nStep1, UINT32 nWidth, UINT32 nHeight, - BYTE* pData2, UINT32 nStep2, RECTANGLE_16* rect) +int shadow_capture_compare(BYTE* pData1, UINT32 nStep1, UINT32 nWidth, UINT32 nHeight, BYTE* pData2, + UINT32 nStep2, RECTANGLE_16* rect) { BOOL equal; BOOL allEqual; @@ -88,7 +88,7 @@ int shadow_capture_compare(BYTE* pData1, UINT32 nStep1, UINT32 nWidth, UINT32 nH UINT32 tx, ty, k; UINT32 nrow, ncol; UINT32 l, t, r, b; - BYTE* p1, *p2; + BYTE *p1, *p2; BOOL rows[1024]; #ifdef WITH_DEBUG_SHADOW_CAPTURE BOOL cols[1024]; @@ -211,8 +211,8 @@ int shadow_capture_compare(BYTE* pData1, UINT32 nStep1, UINT32 nWidth, UINT32 nH WLog_INFO(TAG, "|%s|", rows[ty] ? "O" : "X"); } - WLog_INFO(TAG, "left: %d top: %d right: %d bottom: %d ncol: %d nrow: %d", - l, t, r, b, ncol, nrow); + WLog_INFO(TAG, "left: %d top: %d right: %d bottom: %d ncol: %d nrow: %d", l, t, r, b, ncol, + nrow); free(col_str); #endif return 1; @@ -221,7 +221,7 @@ int shadow_capture_compare(BYTE* pData1, UINT32 nStep1, UINT32 nWidth, UINT32 nH rdpShadowCapture* shadow_capture_new(rdpShadowServer* server) { rdpShadowCapture* capture; - capture = (rdpShadowCapture*) calloc(1, sizeof(rdpShadowCapture)); + capture = (rdpShadowCapture*)calloc(1, sizeof(rdpShadowCapture)); if (!capture) return NULL; @@ -245,4 +245,3 @@ void shadow_capture_free(rdpShadowCapture* capture) DeleteCriticalSection(&(capture->lock)); free(capture); } - diff --git a/server/shadow/shadow_capture.h b/server/shadow/shadow_capture.h index 2989ff883..37d9563a7 100644 --- a/server/shadow/shadow_capture.h +++ b/server/shadow/shadow_capture.h @@ -35,11 +35,12 @@ struct rdp_shadow_capture }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -rdpShadowCapture* shadow_capture_new(rdpShadowServer* server); -void shadow_capture_free(rdpShadowCapture* capture); + rdpShadowCapture* shadow_capture_new(rdpShadowServer* server); + void shadow_capture_free(rdpShadowCapture* capture); #ifdef __cplusplus } diff --git a/server/shadow/shadow_channels.h b/server/shadow/shadow_channels.h index cdd739f1d..261041e84 100644 --- a/server/shadow/shadow_channels.h +++ b/server/shadow/shadow_channels.h @@ -31,11 +31,12 @@ #include "shadow_rdpgfx.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -UINT shadow_client_channels_post_connect(rdpShadowClient* client); -void shadow_client_channels_free(rdpShadowClient* client); + UINT shadow_client_channels_post_connect(rdpShadowClient* client); + void shadow_client_channels_free(rdpShadowClient* client); #ifdef __cplusplus } diff --git a/server/shadow/shadow_client.c b/server/shadow/shadow_client.c index 0616dba0d..61946543c 100644 --- a/server/shadow/shadow_client.c +++ b/server/shadow/shadow_client.c @@ -49,7 +49,7 @@ static INLINE BOOL shadow_client_rdpgfx_new_surface(rdpShadowClient* client) RDPGFX_CREATE_SURFACE_PDU createSurface; RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU surfaceToOutput; RdpgfxServerContext* context = client->rdpgfx; - rdpSettings* settings = ((rdpContext*) client)->settings; + rdpSettings* settings = ((rdpContext*)client)->settings; createSurface.width = settings->DesktopWidth; createSurface.height = settings->DesktopHeight; createSurface.pixelFormat = GFX_PIXEL_FORMAT_XRGB_8888; @@ -62,7 +62,7 @@ static INLINE BOOL shadow_client_rdpgfx_new_surface(rdpShadowClient* client) if (error) { - WLog_ERR(TAG, "CreateSurface failed with error %"PRIu32"", error); + WLog_ERR(TAG, "CreateSurface failed with error %" PRIu32 "", error); return FALSE; } @@ -70,7 +70,7 @@ static INLINE BOOL shadow_client_rdpgfx_new_surface(rdpShadowClient* client) if (error) { - WLog_ERR(TAG, "MapSurfaceToOutput failed with error %"PRIu32"", error); + WLog_ERR(TAG, "MapSurfaceToOutput failed with error %" PRIu32 "", error); return FALSE; } @@ -87,7 +87,7 @@ static INLINE BOOL shadow_client_rdpgfx_release_surface(rdpShadowClient* client) if (error) { - WLog_ERR(TAG, "DeleteSurface failed with error %"PRIu32"", error); + WLog_ERR(TAG, "DeleteSurface failed with error %" PRIu32 "", error); return FALSE; } @@ -99,7 +99,7 @@ static INLINE BOOL shadow_client_rdpgfx_reset_graphic(rdpShadowClient* client) UINT error = CHANNEL_RC_OK; RDPGFX_RESET_GRAPHICS_PDU pdu; RdpgfxServerContext* context = client->rdpgfx; - rdpSettings* settings = ((rdpContext*) client)->settings; + rdpSettings* settings = ((rdpContext*)client)->settings; pdu.width = settings->DesktopWidth; pdu.height = settings->DesktopHeight; pdu.monitorCount = client->subsystem->numMonitors; @@ -108,7 +108,7 @@ static INLINE BOOL shadow_client_rdpgfx_reset_graphic(rdpShadowClient* client) if (error) { - WLog_ERR(TAG, "ResetGraphics failed with error %"PRIu32"", error); + WLog_ERR(TAG, "ResetGraphics failed with error %" PRIu32 "", error); return FALSE; } @@ -126,13 +126,12 @@ static INLINE void shadow_client_free_queued_message(void* obj) } } -static BOOL shadow_client_context_new(freerdp_peer* peer, - rdpShadowClient* client) +static BOOL shadow_client_context_new(freerdp_peer* peer, rdpShadowClient* client) { rdpSettings* settings; rdpShadowServer* server; const wObject cb = { NULL, NULL, NULL, shadow_client_free_queued_message, NULL }; - server = (rdpShadowServer*) peer->ContextExtra; + server = (rdpShadowServer*)peer->ContextExtra; client->server = server; client->subsystem = server->subsystem; settings = peer->settings; @@ -172,7 +171,7 @@ static BOOL shadow_client_context_new(freerdp_peer* peer, goto fail_client_lock; region16_init(&(client->invalidRegion)); - client->vcm = WTSOpenServerA((LPSTR) peer->context); + client->vcm = WTSOpenServerA((LPSTR)peer->context); if (!client->vcm || client->vcm == INVALID_HANDLE_VALUE) goto fail_open_server; @@ -183,7 +182,7 @@ static BOOL shadow_client_context_new(freerdp_peer* peer, if (!(client->encoder = shadow_encoder_new(client))) goto fail_encoder_new; - if (ArrayList_Add(server->clients, (void*) client) >= 0) + if (ArrayList_Add(server->clients, (void*)client) >= 0) return TRUE; shadow_encoder_free(client->encoder); @@ -192,7 +191,7 @@ fail_encoder_new: MessageQueue_Free(client->MsgQueue); client->MsgQueue = NULL; fail_message_queue: - WTSCloseServer((HANDLE) client->vcm); + WTSCloseServer((HANDLE)client->vcm); client->vcm = NULL; fail_open_server: DeleteCriticalSection(&(client->lock)); @@ -209,12 +208,11 @@ fail_cert_file: return FALSE; } -static void shadow_client_context_free(freerdp_peer* peer, - rdpShadowClient* client) +static void shadow_client_context_free(freerdp_peer* peer, rdpShadowClient* client) { rdpShadowServer* server = client->server; WINPR_UNUSED(peer); - ArrayList_Remove(server->clients, (void*) client); + ArrayList_Remove(server->clients, (void*)client); if (client->encoder) { @@ -225,7 +223,7 @@ static void shadow_client_context_free(freerdp_peer* peer, /* Clear queued messages and free resource */ MessageQueue_Clear(client->MsgQueue); MessageQueue_Free(client->MsgQueue); - WTSCloseServer((HANDLE) client->vcm); + WTSCloseServer((HANDLE)client->vcm); client->vcm = NULL; region16_uninit(&(client->invalidRegion)); DeleteCriticalSection(&(client->lock)); @@ -240,18 +238,18 @@ static void shadow_client_message_free(wMessage* message) break; default: - WLog_ERR(TAG, "Unknown message id: %"PRIu32"", message->id); + WLog_ERR(TAG, "Unknown message id: %" PRIu32 "", message->id); free(message->wParam); break; } } -static INLINE void shadow_client_mark_invalid(rdpShadowClient* client, - int numRects, const RECTANGLE_16* rects) +static INLINE void shadow_client_mark_invalid(rdpShadowClient* client, int numRects, + const RECTANGLE_16* rects) { int index; RECTANGLE_16 screenRegion; - rdpSettings* settings = ((rdpContext*) client)->settings; + rdpSettings* settings = ((rdpContext*)client)->settings; EnterCriticalSection(&(client->lock)); /* Mark client invalid region. No rectangle means full screen */ @@ -259,8 +257,7 @@ static INLINE void shadow_client_mark_invalid(rdpShadowClient* client, { for (index = 0; index < numRects; index++) { - region16_union_rect(&(client->invalidRegion), &(client->invalidRegion), - &rects[index]); + region16_union_rect(&(client->invalidRegion), &(client->invalidRegion), &rects[index]); } } else @@ -269,8 +266,7 @@ static INLINE void shadow_client_mark_invalid(rdpShadowClient* client, screenRegion.top = 0; screenRegion.right = settings->DesktopWidth; screenRegion.bottom = settings->DesktopHeight; - region16_union_rect(&(client->invalidRegion), - &(client->invalidRegion), &screenRegion); + region16_union_rect(&(client->invalidRegion), &(client->invalidRegion), &screenRegion); } LeaveCriticalSection(&(client->lock)); @@ -287,7 +283,7 @@ static INLINE BOOL shadow_client_recalc_desktop_size(rdpShadowClient* client) int width, height; rdpShadowServer* server = client->server; rdpSettings* settings = client->context.settings; - RECTANGLE_16 viewport = {0, 0, server->surface->width, server->surface->height}; + RECTANGLE_16 viewport = { 0, 0, server->surface->width, server->surface->height }; if (server->shareSubRect) { @@ -297,8 +293,7 @@ static INLINE BOOL shadow_client_recalc_desktop_size(rdpShadowClient* client) width = viewport.right - viewport.left; height = viewport.bottom - viewport.top; - if (settings->DesktopWidth != (UINT32)width - || settings->DesktopHeight != (UINT32)height) + if (settings->DesktopWidth != (UINT32)width || settings->DesktopHeight != (UINT32)height) { settings->DesktopWidth = width; settings->DesktopHeight = height; @@ -313,7 +308,7 @@ static BOOL shadow_client_capabilities(freerdp_peer* peer) rdpShadowSubsystem* subsystem; rdpShadowClient* client; BOOL ret = TRUE; - client = (rdpShadowClient*) peer->context; + client = (rdpShadowClient*)peer->context; subsystem = client->server->subsystem; IFCALLRET(subsystem->ClientCapabilities, ret, subsystem, client); @@ -333,7 +328,7 @@ static BOOL shadow_client_post_connect(freerdp_peer* peer) rdpShadowClient* client; rdpShadowServer* server; rdpShadowSubsystem* subsystem; - client = (rdpShadowClient*) peer->context; + client = (rdpShadowClient*)peer->context; settings = peer->settings; server = client->server; subsystem = server->subsystem; @@ -342,20 +337,19 @@ static BOOL shadow_client_post_connect(freerdp_peer* peer) settings->ColorDepth = 16; /* disable 24bpp */ if (settings->MultifragMaxRequestSize < 0x3F0000) - settings->NSCodec = - FALSE; /* NSCodec compressor does not support fragmentation yet */ + settings->NSCodec = FALSE; /* NSCodec compressor does not support fragmentation yet */ - WLog_INFO(TAG, "Client from %s is activated (%"PRIu32"x%"PRIu32"@%"PRIu32")", - peer->hostname, settings->DesktopWidth, - settings->DesktopHeight, settings->ColorDepth); + WLog_INFO(TAG, "Client from %s is activated (%" PRIu32 "x%" PRIu32 "@%" PRIu32 ")", + peer->hostname, settings->DesktopWidth, settings->DesktopHeight, + settings->ColorDepth); /* Resize client if necessary */ if (shadow_client_recalc_desktop_size(client)) { peer->update->DesktopResize(peer->update->context); - WLog_INFO(TAG, "Client from %s is resized (%"PRIu32"x%"PRIu32"@%"PRIu32")", - peer->hostname, settings->DesktopWidth, - settings->DesktopHeight, settings->ColorDepth); + WLog_INFO(TAG, "Client from %s is resized (%" PRIu32 "x%" PRIu32 "@%" PRIu32 ")", + peer->hostname, settings->DesktopWidth, settings->DesktopHeight, + settings->ColorDepth); } if (shadow_client_channels_post_connect(client) != CHANNEL_RC_OK) @@ -371,8 +365,8 @@ static BOOL shadow_client_post_connect(freerdp_peer* peer) { if (subsystem->Authenticate) { - authStatus = subsystem->Authenticate(subsystem, client, - settings->Username, settings->Domain, settings->Password); + authStatus = subsystem->Authenticate(subsystem, client, settings->Username, + settings->Domain, settings->Password); } if (authStatus < 0) @@ -391,8 +385,8 @@ static BOOL shadow_client_post_connect(freerdp_peer* peer) } /* Convert rects in sub rect coordinate to client/surface coordinate */ -static INLINE void shadow_client_convert_rects(rdpShadowClient* client, - RECTANGLE_16* dst, const RECTANGLE_16* src, UINT32 numRects) +static INLINE void shadow_client_convert_rects(rdpShadowClient* client, RECTANGLE_16* dst, + const RECTANGLE_16* src, UINT32 numRects) { if (client->server->shareSubRect) { @@ -424,13 +418,12 @@ static BOOL shadow_client_refresh_request(rdpShadowClient* client) message.id = SHADOW_MSG_IN_REFRESH_REQUEST_ID; message.wParam = NULL; message.lParam = NULL; - message.context = (void*) client; + message.context = (void*)client; message.Free = NULL; return MessageQueue_Dispatch(MsgPipe->In, &message); } -static BOOL shadow_client_refresh_rect(rdpShadowClient* client, BYTE count, - RECTANGLE_16* areas) +static BOOL shadow_client_refresh_rect(rdpShadowClient* client, BYTE count, RECTANGLE_16* areas) { RECTANGLE_16* rects; @@ -440,7 +433,7 @@ static BOOL shadow_client_refresh_rect(rdpShadowClient* client, BYTE count, if (count) { - rects = (RECTANGLE_16*) calloc(count, sizeof(RECTANGLE_16)); + rects = (RECTANGLE_16*)calloc(count, sizeof(RECTANGLE_16)); if (!rects) { @@ -459,8 +452,7 @@ static BOOL shadow_client_refresh_rect(rdpShadowClient* client, BYTE count, return shadow_client_refresh_request(client); } -static BOOL shadow_client_suppress_output(rdpShadowClient* client, BYTE allow, - RECTANGLE_16* area) +static BOOL shadow_client_suppress_output(rdpShadowClient* client, BYTE allow, RECTANGLE_16* area) { RECTANGLE_16 region; client->suppressOutput = allow ? FALSE : TRUE; @@ -484,7 +476,7 @@ static BOOL shadow_client_suppress_output(rdpShadowClient* client, BYTE allow, static BOOL shadow_client_activate(freerdp_peer* peer) { rdpSettings* settings = peer->settings; - rdpShadowClient* client = (rdpShadowClient*) peer->context; + rdpShadowClient* client = (rdpShadowClient*)peer->context; if (settings->ClientDir && (strcmp(settings->ClientDir, "librdp") == 0)) { @@ -508,8 +500,7 @@ static BOOL shadow_client_activate(freerdp_peer* peer) return shadow_client_refresh_rect(client, 0, NULL); } -static BOOL shadow_client_logon(freerdp_peer* peer, - SEC_WINNT_AUTH_IDENTITY* identity, +static BOOL shadow_client_logon(freerdp_peer* peer, SEC_WINNT_AUTH_IDENTITY* identity, BOOL automatic) { char* user = NULL; @@ -520,31 +511,31 @@ static BOOL shadow_client_logon(freerdp_peer* peer, if (identity->Flags & SEC_WINNT_AUTH_IDENTITY_UNICODE) { if (identity->User) - ConvertFromUnicode(CP_UTF8, 0, identity->User, identity->UserLength, &user, 0, - NULL, NULL); + ConvertFromUnicode(CP_UTF8, 0, identity->User, identity->UserLength, &user, 0, NULL, + NULL); if (identity->Domain) - ConvertFromUnicode(CP_UTF8, 0, identity->Domain, identity->DomainLength, - &domain, 0, NULL, NULL); + ConvertFromUnicode(CP_UTF8, 0, identity->Domain, identity->DomainLength, &domain, 0, + NULL, NULL); if (identity->Password) - ConvertFromUnicode(CP_UTF8, 0, identity->Password, identity->PasswordLength, - &user, 0, NULL, NULL); + ConvertFromUnicode(CP_UTF8, 0, identity->Password, identity->PasswordLength, &user, 0, + NULL, NULL); } else { if (identity->User) - user = _strdup((char*) identity->User); + user = _strdup((char*)identity->User); if (identity->Domain) - domain = _strdup((char*) identity->Domain); + domain = _strdup((char*)identity->Domain); if (identity->Password) - password = _strdup((char*) identity->Password); + password = _strdup((char*)identity->Password); } - if ((identity->User && !user) || (identity->Domain && !domain) - || (identity->Password && !password)) + if ((identity->User && !user) || (identity->Domain && !domain) || + (identity->Password && !password)) { free(user); free(domain); @@ -579,8 +570,7 @@ static BOOL shadow_client_logon(freerdp_peer* peer, return TRUE; } -static INLINE void shadow_client_common_frame_acknowledge( - rdpShadowClient* client, UINT32 frameId) +static INLINE void shadow_client_common_frame_acknowledge(rdpShadowClient* client, UINT32 frameId) { /* * Record the last client acknowledged frame id to @@ -593,8 +583,7 @@ static INLINE void shadow_client_common_frame_acknowledge( client->encoder->lastAckframeId = frameId; } -static BOOL shadow_client_surface_frame_acknowledge(rdpShadowClient* client, - UINT32 frameId) +static BOOL shadow_client_surface_frame_acknowledge(rdpShadowClient* client, UINT32 frameId) { shadow_client_common_frame_acknowledge(client, frameId); /* @@ -604,8 +593,9 @@ static BOOL shadow_client_surface_frame_acknowledge(rdpShadowClient* client, return TRUE; } -static UINT shadow_client_rdpgfx_frame_acknowledge(RdpgfxServerContext* context, - const RDPGFX_FRAME_ACKNOWLEDGE_PDU* frameAcknowledge) +static UINT +shadow_client_rdpgfx_frame_acknowledge(RdpgfxServerContext* context, + const RDPGFX_FRAME_ACKNOWLEDGE_PDU* frameAcknowledge) { rdpShadowClient* client = (rdpShadowClient*)context->custom; shadow_client_common_frame_acknowledge(client, frameAcknowledge->frameId); @@ -616,17 +606,10 @@ static UINT shadow_client_rdpgfx_frame_acknowledge(RdpgfxServerContext* context, static BOOL shadow_are_caps_filtered(const rdpSettings* settings, UINT32 caps) { const UINT32 filter = settings->GfxCapsFilter; - const UINT32 capList[] = - { - RDPGFX_CAPVERSION_8, - RDPGFX_CAPVERSION_81, - RDPGFX_CAPVERSION_10, - RDPGFX_CAPVERSION_101, - RDPGFX_CAPVERSION_102, - RDPGFX_CAPVERSION_103, - RDPGFX_CAPVERSION_104, - RDPGFX_CAPVERSION_105, - RDPGFX_CAPVERSION_106 + const UINT32 capList[] = { + RDPGFX_CAPVERSION_8, RDPGFX_CAPVERSION_81, RDPGFX_CAPVERSION_10, + RDPGFX_CAPVERSION_101, RDPGFX_CAPVERSION_102, RDPGFX_CAPVERSION_103, + RDPGFX_CAPVERSION_104, RDPGFX_CAPVERSION_105, RDPGFX_CAPVERSION_106 }; UINT32 x; @@ -639,11 +622,9 @@ static BOOL shadow_are_caps_filtered(const rdpSettings* settings, UINT32 caps) return TRUE; } -static BOOL shadow_client_caps_test_version(RdpgfxServerContext* context, - BOOL h264, - const RDPGFX_CAPSET* capsSets, - UINT32 capsSetCount, - UINT32 capsVersion, UINT* rc) +static BOOL shadow_client_caps_test_version(RdpgfxServerContext* context, BOOL h264, + const RDPGFX_CAPSET* capsSets, UINT32 capsSetCount, + UINT32 capsVersion, UINT* rc) { UINT32 flags = 0; UINT32 index; @@ -669,8 +650,8 @@ static BOOL shadow_client_caps_test_version(RdpgfxServerContext* context, settings->GfxSmallCache = (flags & RDPGFX_CAPS_FLAG_SMALL_CACHE); if (h264) - settings->GfxAVC444v2 = settings->GfxAVC444 = settings->GfxH264 = !(flags & - RDPGFX_CAPS_FLAG_AVC_DISABLED); + settings->GfxAVC444v2 = settings->GfxAVC444 = settings->GfxH264 = + !(flags & RDPGFX_CAPS_FLAG_AVC_DISABLED); else { settings->GfxAVC444v2 = settings->GfxAVC444 = settings->GfxH264 = FALSE; @@ -692,7 +673,7 @@ static BOOL shadow_client_caps_test_version(RdpgfxServerContext* context, * @return 0 on success, otherwise a Win32 error code */ static UINT shadow_client_rdpgfx_caps_advertise(RdpgfxServerContext* context, - const RDPGFX_CAPS_ADVERTISE_PDU* capsAdvertise) + const RDPGFX_CAPS_ADVERTISE_PDU* capsAdvertise) { UINT16 index; UINT rc = ERROR_INTERNAL_ERROR; @@ -711,32 +692,32 @@ static UINT shadow_client_rdpgfx_caps_advertise(RdpgfxServerContext* context, if (!shadow_client_refresh_rect((rdpShadowClient*)context->custom, 0, NULL)) return rc; - if (shadow_client_caps_test_version(context, h264, capsAdvertise->capsSets, capsAdvertise->capsSetCount, - RDPGFX_CAPVERSION_106, &rc)) + if (shadow_client_caps_test_version(context, h264, capsAdvertise->capsSets, + capsAdvertise->capsSetCount, RDPGFX_CAPVERSION_106, &rc)) return rc; - if (shadow_client_caps_test_version(context, h264, capsAdvertise->capsSets, capsAdvertise->capsSetCount, - RDPGFX_CAPVERSION_105, &rc)) + if (shadow_client_caps_test_version(context, h264, capsAdvertise->capsSets, + capsAdvertise->capsSetCount, RDPGFX_CAPVERSION_105, &rc)) return rc; - if (shadow_client_caps_test_version(context, h264, capsAdvertise->capsSets, capsAdvertise->capsSetCount, - RDPGFX_CAPVERSION_104, &rc)) + if (shadow_client_caps_test_version(context, h264, capsAdvertise->capsSets, + capsAdvertise->capsSetCount, RDPGFX_CAPVERSION_104, &rc)) return rc; - if (shadow_client_caps_test_version(context, h264, capsAdvertise->capsSets, capsAdvertise->capsSetCount, - RDPGFX_CAPVERSION_103, &rc)) + if (shadow_client_caps_test_version(context, h264, capsAdvertise->capsSets, + capsAdvertise->capsSetCount, RDPGFX_CAPVERSION_103, &rc)) return rc; - if (shadow_client_caps_test_version(context, h264, capsAdvertise->capsSets, capsAdvertise->capsSetCount, - RDPGFX_CAPVERSION_102, &rc)) + if (shadow_client_caps_test_version(context, h264, capsAdvertise->capsSets, + capsAdvertise->capsSetCount, RDPGFX_CAPVERSION_102, &rc)) return rc; - if (shadow_client_caps_test_version(context, h264, capsAdvertise->capsSets, capsAdvertise->capsSetCount, - RDPGFX_CAPVERSION_101, &rc)) + if (shadow_client_caps_test_version(context, h264, capsAdvertise->capsSets, + capsAdvertise->capsSetCount, RDPGFX_CAPVERSION_101, &rc)) return rc; - if (shadow_client_caps_test_version(context, h264, capsAdvertise->capsSets, capsAdvertise->capsSetCount, - RDPGFX_CAPVERSION_10, &rc)) + if (shadow_client_caps_test_version(context, h264, capsAdvertise->capsSets, + capsAdvertise->capsSetCount, RDPGFX_CAPVERSION_10, &rc)) return rc; if (!shadow_are_caps_filtered(settings, RDPGFX_CAPVERSION_81)) @@ -800,14 +781,13 @@ static UINT shadow_client_rdpgfx_caps_advertise(RdpgfxServerContext* context, return CHANNEL_RC_UNSUPPORTED_VERSION; } -static INLINE UINT32 rdpgfx_estimate_h264_avc420( - RDPGFX_AVC420_BITMAP_STREAM* havc420) +static INLINE UINT32 rdpgfx_estimate_h264_avc420(RDPGFX_AVC420_BITMAP_STREAM* havc420) { /* H264 metadata + H264 stream. See rdpgfx_write_h264_avc420 */ return sizeof(UINT32) /* numRegionRects */ - + 10 /* regionRects + quantQualityVals */ - * havc420->meta.numRegionRects - + havc420->length; + + 10 /* regionRects + quantQualityVals */ + * havc420->meta.numRegionRects + + havc420->length; } /** @@ -815,11 +795,12 @@ static INLINE UINT32 rdpgfx_estimate_h264_avc420( * * @return TRUE on success */ -static BOOL shadow_client_send_surface_gfx(rdpShadowClient* client, - const BYTE* pSrcData, int nSrcStep, int nXSrc, int nYSrc, int nWidth, int nHeight) +static BOOL shadow_client_send_surface_gfx(rdpShadowClient* client, const BYTE* pSrcData, + int nSrcStep, int nXSrc, int nYSrc, int nWidth, + int nHeight) { UINT error = CHANNEL_RC_OK; - rdpContext* context = (rdpContext*) client; + rdpContext* context = (rdpContext*)client; rdpSettings* settings; rdpShadowEncoder* encoder; RDPGFX_SURFACE_COMMAND cmd; @@ -838,8 +819,8 @@ static BOOL shadow_client_send_surface_gfx(rdpShadowClient* client, cmdstart.frameId = shadow_encoder_create_frame_id(encoder); GetSystemTime(&sTime); - cmdstart.timestamp = sTime.wHour << 22 | sTime.wMinute << 16 | - sTime.wSecond << 10 | sTime.wMilliseconds; + cmdstart.timestamp = + sTime.wHour << 22 | sTime.wMinute << 16 | sTime.wSecond << 10 | sTime.wMilliseconds; cmdend.frameId = cmdstart.frameId; cmd.surfaceId = 0; cmd.codecId = 0; @@ -868,10 +849,9 @@ static BOOL shadow_client_send_surface_gfx(rdpShadowClient* client, return FALSE; } - if (avc444_compress(encoder->h264, pSrcData, cmd.format, nSrcStep, - nWidth, nHeight, version, &avc444.LC, &avc444.bitstream[0].data, - &avc444.bitstream[0].length, &avc444.bitstream[1].data, - &avc444.bitstream[1].length) < 0) + if (avc444_compress(encoder->h264, pSrcData, cmd.format, nSrcStep, nWidth, nHeight, version, + &avc444.LC, &avc444.bitstream[0].data, &avc444.bitstream[0].length, + &avc444.bitstream[1].data, &avc444.bitstream[1].length) < 0) { WLog_ERR(TAG, "avc420_compress failed for avc444"); return FALSE; @@ -894,12 +874,12 @@ static BOOL shadow_client_send_surface_gfx(rdpShadowClient* client, avc444.cbAvc420EncodedBitstream1 = rdpgfx_estimate_h264_avc420(&avc444.bitstream[0]); cmd.codecId = settings->GfxAVC444v2 ? RDPGFX_CODECID_AVC444v2 : RDPGFX_CODECID_AVC444; cmd.extra = (void*)&avc444; - IFCALLRET(client->rdpgfx->SurfaceFrameCommand, error, client->rdpgfx, &cmd, - &cmdstart, &cmdend); + IFCALLRET(client->rdpgfx->SurfaceFrameCommand, error, client->rdpgfx, &cmd, &cmdstart, + &cmdend); if (error) { - WLog_ERR(TAG, "SurfaceFrameCommand failed with error %"PRIu32"", error); + WLog_ERR(TAG, "SurfaceFrameCommand failed with error %" PRIu32 "", error); return FALSE; } } @@ -915,8 +895,8 @@ static BOOL shadow_client_send_surface_gfx(rdpShadowClient* client, return FALSE; } - if (avc420_compress(encoder->h264, pSrcData, cmd.format, nSrcStep, - nWidth, nHeight, &avc420.data, &avc420.length) < 0) + if (avc420_compress(encoder->h264, pSrcData, cmd.format, nSrcStep, nWidth, nHeight, + &avc420.data, &avc420.length) < 0) { WLog_ERR(TAG, "avc420_compress failed"); return FALSE; @@ -935,12 +915,12 @@ static BOOL shadow_client_send_surface_gfx(rdpShadowClient* client, avc420.meta.numRegionRects = 1; avc420.meta.regionRects = ®ionRect; avc420.meta.quantQualityVals = &quantQualityVal; - IFCALLRET(client->rdpgfx->SurfaceFrameCommand, error, client->rdpgfx, &cmd, - &cmdstart, &cmdend); + IFCALLRET(client->rdpgfx->SurfaceFrameCommand, error, client->rdpgfx, &cmd, &cmdstart, + &cmdend); if (error) { - WLog_ERR(TAG, "SurfaceFrameCommand failed with error %"PRIu32"", error); + WLog_ERR(TAG, "SurfaceFrameCommand failed with error %" PRIu32 "", error); return FALSE; } } @@ -953,8 +933,8 @@ static BOOL shadow_client_send_surface_gfx(rdpShadowClient* client, * * @return TRUE on success */ -static BOOL shadow_client_send_surface_bits(rdpShadowClient* client, - BYTE* pSrcData, int nSrcStep, int nXSrc, int nYSrc, int nWidth, int nHeight) +static BOOL shadow_client_send_surface_bits(rdpShadowClient* client, BYTE* pSrcData, int nSrcStep, + int nXSrc, int nYSrc, int nWidth, int nHeight) { BOOL ret = TRUE; int i; @@ -964,7 +944,7 @@ static BOOL shadow_client_send_surface_bits(rdpShadowClient* client, int numMessages; UINT32 frameId = 0; rdpUpdate* update; - rdpContext* context = (rdpContext*) client; + rdpContext* context = (rdpContext*)client; rdpSettings* settings; rdpShadowEncoder* encoder; SURFACE_BITS_COMMAND cmd = { 0 }; @@ -1000,9 +980,9 @@ static BOOL shadow_client_send_surface_bits(rdpShadowClient* client, rect.width = nWidth; rect.height = nHeight; - if (!(messages = rfx_encode_messages(encoder->rfx, &rect, 1, pSrcData, - settings->DesktopWidth, settings->DesktopHeight, nSrcStep, &numMessages, - settings->MultifragMaxRequestSize))) + if (!(messages = rfx_encode_messages( + encoder->rfx, &rect, 1, pSrcData, settings->DesktopWidth, settings->DesktopHeight, + nSrcStep, &numMessages, settings->MultifragMaxRequestSize))) { WLog_ERR(TAG, "rfx_encode_messages failed"); return FALSE; @@ -1088,8 +1068,7 @@ static BOOL shadow_client_send_surface_bits(rdpShadowClient* client, if (!encoder->frameAck) IFCALLRET(update->SurfaceBits, ret, update->context, &cmd); else - IFCALLRET(update->SurfaceFrameBits, ret, update->context, &cmd, first, last, - frameId); + IFCALLRET(update->SurfaceFrameBits, ret, update->context, &cmd, first, last, frameId); if (!ret) { @@ -1105,8 +1084,8 @@ static BOOL shadow_client_send_surface_bits(rdpShadowClient* client, * * @return TRUE on success */ -static BOOL shadow_client_send_bitmap_update(rdpShadowClient* client, - BYTE* pSrcData, int nSrcStep, int nXSrc, int nYSrc, int nWidth, int nHeight) +static BOOL shadow_client_send_bitmap_update(rdpShadowClient* client, BYTE* pSrcData, int nSrcStep, + int nXSrc, int nYSrc, int nWidth, int nHeight) { BOOL ret = TRUE; BYTE* data; @@ -1118,7 +1097,7 @@ static BOOL shadow_client_send_bitmap_update(rdpShadowClient* client, UINT32 SrcFormat; BITMAP_DATA* bitmap; rdpUpdate* update; - rdpContext* context = (rdpContext*) client; + rdpContext* context = (rdpContext*)client; rdpSettings* settings; UINT32 maxUpdateSize; UINT32 totalBitmapSize; @@ -1176,7 +1155,7 @@ static BOOL shadow_client_send_bitmap_update(rdpShadowClient* client, totalBitmapSize = 0; bitmapUpdate.count = bitmapUpdate.number = rows * cols; - if (!(bitmapData = (BITMAP_DATA*) calloc(bitmapUpdate.number, sizeof(BITMAP_DATA)))) + if (!(bitmapData = (BITMAP_DATA*)calloc(bitmapUpdate.number, sizeof(BITMAP_DATA)))) return FALSE; bitmapUpdate.rectangles = bitmapData; @@ -1221,9 +1200,8 @@ static BOOL shadow_client_send_bitmap_update(rdpShadowClient* client, DstSize = 64 * 64 * 4; buffer = encoder->grid[k]; interleaved_compress(encoder->interleaved, buffer, &DstSize, bitmap->width, - bitmap->height, - pSrcData, SrcFormat, nSrcStep, bitmap->destLeft, bitmap->destTop, NULL, - bitsPerPixel); + bitmap->height, pSrcData, SrcFormat, nSrcStep, + bitmap->destLeft, bitmap->destTop, NULL, bitsPerPixel); bitmap->bitmapDataStream = buffer; bitmap->bitmapLength = DstSize; bitmap->bitsPerPixel = bitsPerPixel; @@ -1235,8 +1213,9 @@ static BOOL shadow_client_send_bitmap_update(rdpShadowClient* client, UINT32 dstSize; buffer = encoder->grid[k]; data = &pSrcData[(bitmap->destTop * nSrcStep) + (bitmap->destLeft * 4)]; - buffer = freerdp_bitmap_compress_planar(encoder->planar, data, SrcFormat, - bitmap->width, bitmap->height, nSrcStep, buffer, &dstSize); + buffer = + freerdp_bitmap_compress_planar(encoder->planar, data, SrcFormat, bitmap->width, + bitmap->height, nSrcStep, buffer, &dstSize); bitmap->bitmapDataStream = buffer; bitmap->bitmapLength = dstSize; bitmap->bitsPerPixel = 32; @@ -1262,7 +1241,7 @@ static BOOL shadow_client_send_bitmap_update(rdpShadowClient* client, BITMAP_DATA* fragBitmapData = NULL; if (k > 0) - fragBitmapData = (BITMAP_DATA*) calloc(k, sizeof(BITMAP_DATA)); + fragBitmapData = (BITMAP_DATA*)calloc(k, sizeof(BITMAP_DATA)); if (!fragBitmapData) { @@ -1323,13 +1302,12 @@ out: * * @return TRUE on success (or nothing need to be updated) */ -static BOOL shadow_client_send_surface_update(rdpShadowClient* client, - SHADOW_GFX_STATUS* pStatus) +static BOOL shadow_client_send_surface_update(rdpShadowClient* client, SHADOW_GFX_STATUS* pStatus) { BOOL ret = TRUE; int nXSrc, nYSrc; int nWidth, nHeight; - rdpContext* context = (rdpContext*) client; + rdpContext* context = (rdpContext*)client; rdpSettings* settings; rdpShadowServer* server; rdpShadowSurface* surface; @@ -1404,12 +1382,10 @@ static BOOL shadow_client_send_surface_update(rdpShadowClient* client, pSrcData = &pSrcData[(subY * nSrcStep) + (subX * 4)]; } - //WLog_INFO(TAG, "shadow_client_send_surface_update: x: %d y: %d width: %d height: %d right: %d bottom: %d", - // nXSrc, nYSrc, nWidth, nHeight, nXSrc + nWidth, nYSrc + nHeight); + // WLog_INFO(TAG, "shadow_client_send_surface_update: x: %d y: %d width: %d height: %d right: %d + // bottom: %d", nXSrc, nYSrc, nWidth, nHeight, nXSrc + nWidth, nYSrc + nHeight); - if (settings->SupportGraphicsPipeline && - settings->GfxH264 && - pStatus->gfxOpened) + if (settings->SupportGraphicsPipeline && settings->GfxH264 && pStatus->gfxOpened) { /* GFX/h264 always full screen encoded */ nWidth = settings->DesktopWidth; @@ -1428,18 +1404,17 @@ static BOOL shadow_client_send_surface_update(rdpShadowClient* client, pStatus->gfxSurfaceCreated = TRUE; } - ret = shadow_client_send_surface_gfx(client, pSrcData, nSrcStep, 0, 0, nWidth, - nHeight); + ret = shadow_client_send_surface_gfx(client, pSrcData, nSrcStep, 0, 0, nWidth, nHeight); } else if (settings->RemoteFxCodec || settings->NSCodec) { - ret = shadow_client_send_surface_bits(client, pSrcData, nSrcStep, nXSrc, nYSrc, - nWidth, nHeight); + ret = shadow_client_send_surface_bits(client, pSrcData, nSrcStep, nXSrc, nYSrc, nWidth, + nHeight); } else { - ret = shadow_client_send_bitmap_update(client, pSrcData, nSrcStep, nXSrc, nYSrc, - nWidth, nHeight); + ret = shadow_client_send_bitmap_update(client, pSrcData, nSrcStep, nXSrc, nYSrc, nWidth, + nHeight); } out: @@ -1454,10 +1429,9 @@ out: * * @return TRUE on success */ -static BOOL shadow_client_send_resize(rdpShadowClient* client, - SHADOW_GFX_STATUS* pStatus) +static BOOL shadow_client_send_resize(rdpShadowClient* client, SHADOW_GFX_STATUS* pStatus) { - rdpContext* context = (rdpContext*) client; + rdpContext* context = (rdpContext*)client; rdpSettings* settings; freerdp_peer* peer; @@ -1497,7 +1471,7 @@ static BOOL shadow_client_send_resize(rdpShadowClient* client, EnterCriticalSection(&(client->lock)); region16_clear(&(client->invalidRegion)); LeaveCriticalSection(&(client->lock)); - WLog_INFO(TAG, "Client from %s is resized (%"PRIu32"x%"PRIu32"@%"PRIu32")", + WLog_INFO(TAG, "Client from %s is resized (%" PRIu32 "x%" PRIu32 "@%" PRIu32 ")", peer->hostname, settings->DesktopWidth, settings->DesktopHeight, settings->ColorDepth); return TRUE; @@ -1525,7 +1499,7 @@ BOOL shadow_client_surface_update(rdpShadowClient* client, REGION16* region) * @return TRUE on success */ static INLINE BOOL shadow_client_no_surface_update(rdpShadowClient* client, - SHADOW_GFX_STATUS* pStatus) + SHADOW_GFX_STATUS* pStatus) { rdpShadowServer* server; rdpShadowSurface* surface; @@ -1535,10 +1509,9 @@ static INLINE BOOL shadow_client_no_surface_update(rdpShadowClient* client, return shadow_client_surface_update(client, &(surface->invalidRegion)); } -static int shadow_client_subsystem_process_message(rdpShadowClient* client, - wMessage* message) +static int shadow_client_subsystem_process_message(rdpShadowClient* client, wMessage* message) { - rdpContext* context = (rdpContext*) client; + rdpContext* context = (rdpContext*)client; rdpUpdate* update = context->update; /* FIXME: the pointer updates appear to be broken when used with bulk compression and mstsc */ @@ -1546,92 +1519,92 @@ static int shadow_client_subsystem_process_message(rdpShadowClient* client, switch (message->id) { case SHADOW_MSG_OUT_POINTER_POSITION_UPDATE_ID: + { + POINTER_POSITION_UPDATE pointerPosition; + SHADOW_MSG_OUT_POINTER_POSITION_UPDATE* msg = + (SHADOW_MSG_OUT_POINTER_POSITION_UPDATE*)message->wParam; + pointerPosition.xPos = msg->xPos; + pointerPosition.yPos = msg->yPos; + + if (client->server->shareSubRect) { - POINTER_POSITION_UPDATE pointerPosition; - SHADOW_MSG_OUT_POINTER_POSITION_UPDATE* msg = - (SHADOW_MSG_OUT_POINTER_POSITION_UPDATE*) message->wParam; - pointerPosition.xPos = msg->xPos; - pointerPosition.yPos = msg->yPos; - - if (client->server->shareSubRect) - { - pointerPosition.xPos -= client->server->subRect.left; - pointerPosition.yPos -= client->server->subRect.top; - } - - if (client->activated) - { - if ((msg->xPos != client->pointerX) || (msg->yPos != client->pointerY)) - { - IFCALL(update->pointer->PointerPosition, context, &pointerPosition); - client->pointerX = msg->xPos; - client->pointerY = msg->yPos; - } - } - - break; + pointerPosition.xPos -= client->server->subRect.left; + pointerPosition.yPos -= client->server->subRect.top; } + if (client->activated) + { + if ((msg->xPos != client->pointerX) || (msg->yPos != client->pointerY)) + { + IFCALL(update->pointer->PointerPosition, context, &pointerPosition); + client->pointerX = msg->xPos; + client->pointerY = msg->yPos; + } + } + + break; + } + case SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE_ID: + { + POINTER_NEW_UPDATE pointerNew; + POINTER_COLOR_UPDATE* pointerColor; + POINTER_CACHED_UPDATE pointerCached; + SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE* msg = + (SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE*)message->wParam; + ZeroMemory(&pointerNew, sizeof(POINTER_NEW_UPDATE)); + pointerNew.xorBpp = 24; + pointerColor = &(pointerNew.colorPtrAttr); + pointerColor->cacheIndex = 0; + pointerColor->xPos = msg->xHot; + pointerColor->yPos = msg->yHot; + pointerColor->width = msg->width; + pointerColor->height = msg->height; + pointerColor->lengthAndMask = msg->lengthAndMask; + pointerColor->lengthXorMask = msg->lengthXorMask; + pointerColor->xorMaskData = msg->xorMaskData; + pointerColor->andMaskData = msg->andMaskData; + pointerCached.cacheIndex = pointerColor->cacheIndex; + + if (client->activated) { - POINTER_NEW_UPDATE pointerNew; - POINTER_COLOR_UPDATE* pointerColor; - POINTER_CACHED_UPDATE pointerCached; - SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE* msg = - (SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE*) message->wParam; - ZeroMemory(&pointerNew, sizeof(POINTER_NEW_UPDATE)); - pointerNew.xorBpp = 24; - pointerColor = &(pointerNew.colorPtrAttr); - pointerColor->cacheIndex = 0; - pointerColor->xPos = msg->xHot; - pointerColor->yPos = msg->yHot; - pointerColor->width = msg->width; - pointerColor->height = msg->height; - pointerColor->lengthAndMask = msg->lengthAndMask; - pointerColor->lengthXorMask = msg->lengthXorMask; - pointerColor->xorMaskData = msg->xorMaskData; - pointerColor->andMaskData = msg->andMaskData; - pointerCached.cacheIndex = pointerColor->cacheIndex; - - if (client->activated) - { - IFCALL(update->pointer->PointerNew, context, &pointerNew); - IFCALL(update->pointer->PointerCached, context, &pointerCached); - } - - break; + IFCALL(update->pointer->PointerNew, context, &pointerNew); + IFCALL(update->pointer->PointerCached, context, &pointerCached); } + break; + } + case SHADOW_MSG_OUT_AUDIO_OUT_SAMPLES_ID: + { + SHADOW_MSG_OUT_AUDIO_OUT_SAMPLES* msg = + (SHADOW_MSG_OUT_AUDIO_OUT_SAMPLES*)message->wParam; + + if (client->activated && client->rdpsnd && client->rdpsnd->Activated) { - SHADOW_MSG_OUT_AUDIO_OUT_SAMPLES* msg = (SHADOW_MSG_OUT_AUDIO_OUT_SAMPLES*) - message->wParam; - - if (client->activated && client->rdpsnd && client->rdpsnd->Activated) - { - client->rdpsnd->src_format = msg->audio_format; - IFCALL(client->rdpsnd->SendSamples, client->rdpsnd, msg->buf, msg->nFrames, - msg->wTimestamp); - } - - break; + client->rdpsnd->src_format = msg->audio_format; + IFCALL(client->rdpsnd->SendSamples, client->rdpsnd, msg->buf, msg->nFrames, + msg->wTimestamp); } + break; + } + case SHADOW_MSG_OUT_AUDIO_OUT_VOLUME_ID: + { + SHADOW_MSG_OUT_AUDIO_OUT_VOLUME* msg = + (SHADOW_MSG_OUT_AUDIO_OUT_VOLUME*)message->wParam; + + if (client->activated && client->rdpsnd && client->rdpsnd->Activated) { - SHADOW_MSG_OUT_AUDIO_OUT_VOLUME* msg = (SHADOW_MSG_OUT_AUDIO_OUT_VOLUME*) - message->wParam; - - if (client->activated && client->rdpsnd && client->rdpsnd->Activated) - { - IFCALL(client->rdpsnd->SetVolume, client->rdpsnd, msg->left, msg->right); - } - - break; + IFCALL(client->rdpsnd->SetVolume, client->rdpsnd, msg->left, msg->right); } + break; + } + default: - WLog_ERR(TAG, "Unknown message id: %"PRIu32"", message->id); + WLog_ERR(TAG, "Unknown message id: %" PRIu32 "", message->id); break; } @@ -1664,7 +1637,7 @@ static DWORD WINAPI shadow_client_thread(LPVOID arg) gfxstatus.gfxSurfaceCreated = FALSE; server = client->server; subsystem = server->subsystem; - context = (rdpContext*) client; + context = (rdpContext*)client; peer = context->peer; settings = peer->settings; peer->Capabilities = shadow_client_capabilities; @@ -1675,8 +1648,8 @@ static DWORD WINAPI shadow_client_thread(LPVOID arg) peer->Initialize(peer); peer->update->RefreshRect = (pRefreshRect)shadow_client_refresh_rect; peer->update->SuppressOutput = (pSuppressOutput)shadow_client_suppress_output; - peer->update->SurfaceFrameAcknowledge = (pSurfaceFrameAcknowledge) - shadow_client_surface_frame_acknowledge; + peer->update->SurfaceFrameAcknowledge = + (pSurfaceFrameAcknowledge)shadow_client_surface_frame_acknowledge; if ((!client->vcm) || (!subsystem->updateEvent)) goto out; @@ -1785,7 +1758,8 @@ static DWORD WINAPI shadow_client_thread(LPVOID arg) break; case DRDYNVC_STATE_READY: - if (client->audin && !IFCALLRESULT(TRUE, client->audin->IsOpen, client->audin)) + if (client->audin && + !IFCALLRESULT(TRUE, client->audin->IsOpen, client->audin)) { if (!IFCALLRESULT(FALSE, client->audin->Open, client->audin)) { @@ -1798,7 +1772,8 @@ static DWORD WINAPI shadow_client_thread(LPVOID arg) if (settings->SupportGraphicsPipeline && client->rdpgfx && !gfxstatus.gfxOpened) { - client->rdpgfx->FrameAcknowledge = shadow_client_rdpgfx_frame_acknowledge; + client->rdpgfx->FrameAcknowledge = + shadow_client_rdpgfx_frame_acknowledge; client->rdpgfx->CapsAdvertise = shadow_client_rdpgfx_caps_advertise; if (!client->rdpgfx->Open(client->rdpgfx)) @@ -1951,17 +1926,17 @@ BOOL shadow_client_accepted(freerdp_listener* listener, freerdp_peer* peer) if (!listener || !peer) return FALSE; - server = (rdpShadowServer*) listener->info; - peer->ContextExtra = (void*) server; + server = (rdpShadowServer*)listener->info; + peer->ContextExtra = (void*)server; peer->ContextSize = sizeof(rdpShadowClient); - peer->ContextNew = (psPeerContextNew) shadow_client_context_new; - peer->ContextFree = (psPeerContextFree) shadow_client_context_free; + peer->ContextNew = (psPeerContextNew)shadow_client_context_new; + peer->ContextFree = (psPeerContextFree)shadow_client_context_free; peer->settings = freerdp_settings_clone(server->settings); if (!freerdp_peer_context_new(peer)) return FALSE; - client = (rdpShadowClient*) peer->context; + client = (rdpShadowClient*)peer->context; if (!(client->thread = CreateThread(NULL, 0, shadow_client_thread, client, 0, NULL))) { @@ -1995,8 +1970,7 @@ static void shadow_msg_out_release(wMessage* message) } } -static BOOL shadow_client_dispatch_msg(rdpShadowClient* client, - wMessage* message) +static BOOL shadow_client_dispatch_msg(rdpShadowClient* client, wMessage* message) { if (!client || !message) return FALSE; @@ -2017,7 +1991,7 @@ static BOOL shadow_client_dispatch_msg(rdpShadowClient* client, BOOL shadow_client_post_msg(rdpShadowClient* client, void* context, UINT32 type, SHADOW_MSG_OUT* msg, void* lParam) { - wMessage message = {0}; + wMessage message = { 0 }; message.context = context; message.id = type; message.wParam = (void*)msg; @@ -2026,10 +2000,10 @@ BOOL shadow_client_post_msg(rdpShadowClient* client, void* context, UINT32 type, return shadow_client_dispatch_msg(client, &message); } -int shadow_client_boardcast_msg(rdpShadowServer* server, void* context, - UINT32 type, SHADOW_MSG_OUT* msg, void* lParam) +int shadow_client_boardcast_msg(rdpShadowServer* server, void* context, UINT32 type, + SHADOW_MSG_OUT* msg, void* lParam) { - wMessage message = {0}; + wMessage message = { 0 }; rdpShadowClient* client = NULL; int count = 0; int index = 0; diff --git a/server/shadow/shadow_client.h b/server/shadow/shadow_client.h index e61b4513b..aced407a7 100644 --- a/server/shadow/shadow_client.h +++ b/server/shadow/shadow_client.h @@ -22,11 +22,12 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -BOOL shadow_client_surface_update(rdpShadowClient* client, REGION16* region); -BOOL shadow_client_accepted(freerdp_listener* instance, freerdp_peer* client); + BOOL shadow_client_surface_update(rdpShadowClient* client, REGION16* region); + BOOL shadow_client_accepted(freerdp_listener* instance, freerdp_peer* client); #ifdef __cplusplus } diff --git a/server/shadow/shadow_encoder.c b/server/shadow/shadow_encoder.c index 43d2709ca..35025be6e 100644 --- a/server/shadow/shadow_encoder.c +++ b/server/shadow/shadow_encoder.c @@ -41,8 +41,9 @@ UINT32 shadow_encoder_inflight_frames(rdpShadowEncoder* encoder) * Note: This function is exported so that subsystem could * implement its own strategy to tune fps. */ - return (encoder->queueDepth == SUSPEND_FRAME_ACKNOWLEDGEMENT) ? 0 : encoder->frameId - - encoder->lastAckframeId; + return (encoder->queueDepth == SUSPEND_FRAME_ACKNOWLEDGEMENT) + ? 0 + : encoder->frameId - encoder->lastAckframeId; } UINT32 shadow_encoder_create_frame_id(rdpShadowEncoder* encoder) @@ -80,18 +81,17 @@ static int shadow_encoder_init_grid(rdpShadowEncoder* encoder) int i, j, k; int tileSize; int tileCount; - encoder->gridWidth = ((encoder->width + (encoder->maxTileWidth - 1)) / - encoder->maxTileWidth); - encoder->gridHeight = ((encoder->height + (encoder->maxTileHeight - 1)) / - encoder->maxTileHeight); + encoder->gridWidth = ((encoder->width + (encoder->maxTileWidth - 1)) / encoder->maxTileWidth); + encoder->gridHeight = + ((encoder->height + (encoder->maxTileHeight - 1)) / encoder->maxTileHeight); tileSize = encoder->maxTileWidth * encoder->maxTileHeight * 4; tileCount = encoder->gridWidth * encoder->gridHeight; - encoder->gridBuffer = (BYTE*) calloc(tileSize, tileCount); + encoder->gridBuffer = (BYTE*)calloc(tileSize, tileCount); if (!encoder->gridBuffer) return -1; - encoder->grid = (BYTE**) calloc(tileCount, sizeof(BYTE*)); + encoder->grid = (BYTE**)calloc(tileCount, sizeof(BYTE*)); if (!encoder->grid) return -1; @@ -149,7 +149,7 @@ fail: static int shadow_encoder_init_nsc(rdpShadowEncoder* encoder) { - rdpContext* context = (rdpContext*) encoder->client; + rdpContext* context = (rdpContext*)encoder->client; rdpSettings* settings = context->settings; if (!encoder->nsc) @@ -161,11 +161,14 @@ static int shadow_encoder_init_nsc(rdpShadowEncoder* encoder) if (!nsc_context_reset(encoder->nsc, encoder->width, encoder->height)) goto fail; - if (!nsc_context_set_parameters(encoder->nsc, NSC_COLOR_LOSS_LEVEL, settings->NSCodecColorLossLevel)) + if (!nsc_context_set_parameters(encoder->nsc, NSC_COLOR_LOSS_LEVEL, + settings->NSCodecColorLossLevel)) goto fail; - if (!nsc_context_set_parameters(encoder->nsc, NSC_ALLOW_SUBSAMPLING, settings->NSCodecAllowSubsampling)) + if (!nsc_context_set_parameters(encoder->nsc, NSC_ALLOW_SUBSAMPLING, + settings->NSCodecAllowSubsampling)) goto fail; - if (!nsc_context_set_parameters(encoder->nsc, NSC_DYNAMIC_COLOR_FIDELITY, settings->NSCodecAllowDynamicColorFidelity)) + if (!nsc_context_set_parameters(encoder->nsc, NSC_DYNAMIC_COLOR_FIDELITY, + settings->NSCodecAllowDynamicColorFidelity)) goto fail; if (!nsc_context_set_parameters(encoder->nsc, NSC_COLOR_FORMAT, PIXEL_FORMAT_BGRX32)) goto fail; @@ -179,7 +182,7 @@ fail: static int shadow_encoder_init_planar(rdpShadowEncoder* encoder) { DWORD planarFlags = 0; - rdpContext* context = (rdpContext*) encoder->client; + rdpContext* context = (rdpContext*)encoder->client; rdpSettings* settings = context->settings; if (settings->DrawAllowSkipAlpha) @@ -189,16 +192,15 @@ static int shadow_encoder_init_planar(rdpShadowEncoder* encoder) if (!encoder->planar) { - encoder->planar = freerdp_bitmap_planar_context_new(planarFlags, - encoder->maxTileWidth, encoder->maxTileHeight); + encoder->planar = freerdp_bitmap_planar_context_new(planarFlags, encoder->maxTileWidth, + encoder->maxTileHeight); } if (!encoder->planar) goto fail; - if (!freerdp_bitmap_planar_context_reset(encoder->planar, - encoder->maxTileWidth, - encoder->maxTileHeight)) + if (!freerdp_bitmap_planar_context_reset(encoder->planar, encoder->maxTileWidth, + encoder->maxTileHeight)) goto fail; encoder->codecs |= FREERDP_CODEC_PLANAR; @@ -257,8 +259,7 @@ static int shadow_encoder_init(rdpShadowEncoder* encoder) shadow_encoder_init_grid(encoder); if (!encoder->bs) - encoder->bs = Stream_New(NULL, - encoder->maxTileWidth * encoder->maxTileHeight * 4); + encoder->bs = Stream_New(NULL, encoder->maxTileWidth * encoder->maxTileHeight * 4); if (!encoder->bs) return -1; @@ -368,7 +369,7 @@ int shadow_encoder_reset(rdpShadowEncoder* encoder) { int status; UINT32 codecs = encoder->codecs; - rdpContext* context = (rdpContext*) encoder->client; + rdpContext* context = (rdpContext*)encoder->client; rdpSettings* settings = context->settings; status = shadow_encoder_uninit(encoder); @@ -397,8 +398,7 @@ int shadow_encoder_prepare(rdpShadowEncoder* encoder, UINT32 codecs) { int status; - if ((codecs & FREERDP_CODEC_REMOTEFX) - && !(encoder->codecs & FREERDP_CODEC_REMOTEFX)) + if ((codecs & FREERDP_CODEC_REMOTEFX) && !(encoder->codecs & FREERDP_CODEC_REMOTEFX)) { status = shadow_encoder_init_rfx(encoder); @@ -406,8 +406,7 @@ int shadow_encoder_prepare(rdpShadowEncoder* encoder, UINT32 codecs) return -1; } - if ((codecs & FREERDP_CODEC_NSCODEC) - && !(encoder->codecs & FREERDP_CODEC_NSCODEC)) + if ((codecs & FREERDP_CODEC_NSCODEC) && !(encoder->codecs & FREERDP_CODEC_NSCODEC)) { status = shadow_encoder_init_nsc(encoder); @@ -415,8 +414,7 @@ int shadow_encoder_prepare(rdpShadowEncoder* encoder, UINT32 codecs) return -1; } - if ((codecs & FREERDP_CODEC_PLANAR) - && !(encoder->codecs & FREERDP_CODEC_PLANAR)) + if ((codecs & FREERDP_CODEC_PLANAR) && !(encoder->codecs & FREERDP_CODEC_PLANAR)) { status = shadow_encoder_init_planar(encoder); @@ -424,8 +422,7 @@ int shadow_encoder_prepare(rdpShadowEncoder* encoder, UINT32 codecs) return -1; } - if ((codecs & FREERDP_CODEC_INTERLEAVED) - && !(encoder->codecs & FREERDP_CODEC_INTERLEAVED)) + if ((codecs & FREERDP_CODEC_INTERLEAVED) && !(encoder->codecs & FREERDP_CODEC_INTERLEAVED)) { status = shadow_encoder_init_interleaved(encoder); @@ -433,8 +430,8 @@ int shadow_encoder_prepare(rdpShadowEncoder* encoder, UINT32 codecs) return -1; } - if ((codecs & (FREERDP_CODEC_AVC420 | FREERDP_CODEC_AVC444)) - && !(encoder->codecs & (FREERDP_CODEC_AVC420 | FREERDP_CODEC_AVC444))) + if ((codecs & (FREERDP_CODEC_AVC420 | FREERDP_CODEC_AVC444)) && + !(encoder->codecs & (FREERDP_CODEC_AVC420 | FREERDP_CODEC_AVC444))) { status = shadow_encoder_init_h264(encoder); @@ -449,7 +446,7 @@ rdpShadowEncoder* shadow_encoder_new(rdpShadowClient* client) { rdpShadowEncoder* encoder; rdpShadowServer* server = client->server; - encoder = (rdpShadowEncoder*) calloc(1, sizeof(rdpShadowEncoder)); + encoder = (rdpShadowEncoder*)calloc(1, sizeof(rdpShadowEncoder)); if (!encoder) return NULL; diff --git a/server/shadow/shadow_encoder.h b/server/shadow/shadow_encoder.h index 0299a4b5c..91bd4ab3f 100644 --- a/server/shadow/shadow_encoder.h +++ b/server/shadow/shadow_encoder.h @@ -60,15 +60,16 @@ struct rdp_shadow_encoder }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -int shadow_encoder_reset(rdpShadowEncoder* encoder); -int shadow_encoder_prepare(rdpShadowEncoder* encoder, UINT32 codecs); -UINT32 shadow_encoder_create_frame_id(rdpShadowEncoder* encoder); + int shadow_encoder_reset(rdpShadowEncoder* encoder); + int shadow_encoder_prepare(rdpShadowEncoder* encoder, UINT32 codecs); + UINT32 shadow_encoder_create_frame_id(rdpShadowEncoder* encoder); -rdpShadowEncoder* shadow_encoder_new(rdpShadowClient* client); -void shadow_encoder_free(rdpShadowEncoder* encoder); + rdpShadowEncoder* shadow_encoder_new(rdpShadowClient* client); + void shadow_encoder_free(rdpShadowEncoder* encoder); #ifdef __cplusplus } diff --git a/server/shadow/shadow_encomsp.c b/server/shadow/shadow_encomsp.c index cb89f10f5..d03636b03 100644 --- a/server/shadow/shadow_encomsp.c +++ b/server/shadow/shadow_encomsp.c @@ -34,16 +34,18 @@ * * @return 0 on success, otherwise a Win32 error code */ -static UINT encomsp_change_participant_control_level(EncomspServerContext* context, - ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* pdu) +static UINT +encomsp_change_participant_control_level(EncomspServerContext* context, + ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* pdu) { BOOL inLobby; BOOL mayView; BOOL mayInteract; - rdpShadowClient* client = (rdpShadowClient*) context->custom; + rdpShadowClient* client = (rdpShadowClient*)context->custom; - WLog_INFO(TAG, "ChangeParticipantControlLevel: ParticipantId: %"PRIu32" Flags: 0x%04"PRIX16"", - pdu->ParticipantId, pdu->Flags); + WLog_INFO(TAG, + "ChangeParticipantControlLevel: ParticipantId: %" PRIu32 " Flags: 0x%04" PRIX16 "", + pdu->ParticipantId, pdu->Flags); mayView = (pdu->Flags & ENCOMSP_MAY_VIEW) ? TRUE : FALSE; mayInteract = (pdu->Flags & ENCOMSP_MAY_INTERACT) ? TRUE : FALSE; @@ -108,7 +110,7 @@ int shadow_client_encomsp_init(rdpShadowClient* client) encomsp->rdpcontext = &client->context; - encomsp->custom = (void*) client; + encomsp->custom = (void*)client; encomsp->ChangeParticipantControlLevel = encomsp_change_participant_control_level; @@ -120,7 +122,8 @@ int shadow_client_encomsp_init(rdpShadowClient* client) void shadow_client_encomsp_uninit(rdpShadowClient* client) { - if (client->encomsp) { + if (client->encomsp) + { client->encomsp->Stop(client->encomsp); encomsp_server_context_free(client->encomsp); client->encomsp = NULL; diff --git a/server/shadow/shadow_encomsp.h b/server/shadow/shadow_encomsp.h index 4e7d80604..6562e25ae 100644 --- a/server/shadow/shadow_encomsp.h +++ b/server/shadow/shadow_encomsp.h @@ -25,11 +25,12 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -int shadow_client_encomsp_init(rdpShadowClient* client); -void shadow_client_encomsp_uninit(rdpShadowClient* client); + int shadow_client_encomsp_init(rdpShadowClient* client); + void shadow_client_encomsp_uninit(rdpShadowClient* client); #ifdef __cplusplus } diff --git a/server/shadow/shadow_input.c b/server/shadow/shadow_input.c index 229ef1483..58143877c 100644 --- a/server/shadow/shadow_input.c +++ b/server/shadow/shadow_input.c @@ -24,7 +24,7 @@ static BOOL shadow_input_synchronize_event(rdpInput* input, UINT32 flags) { - rdpShadowClient* client = (rdpShadowClient*) input->context; + rdpShadowClient* client = (rdpShadowClient*)input->context; rdpShadowSubsystem* subsystem = client->server->subsystem; if (!client->mayInteract) @@ -35,7 +35,7 @@ static BOOL shadow_input_synchronize_event(rdpInput* input, UINT32 flags) static BOOL shadow_input_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) { - rdpShadowClient* client = (rdpShadowClient*) input->context; + rdpShadowClient* client = (rdpShadowClient*)input->context; rdpShadowSubsystem* subsystem = client->server->subsystem; if (!client->mayInteract) @@ -46,7 +46,7 @@ static BOOL shadow_input_keyboard_event(rdpInput* input, UINT16 flags, UINT16 co static BOOL shadow_input_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) { - rdpShadowClient* client = (rdpShadowClient*) input->context; + rdpShadowClient* client = (rdpShadowClient*)input->context; rdpShadowSubsystem* subsystem = client->server->subsystem; if (!client->mayInteract) @@ -57,7 +57,7 @@ static BOOL shadow_input_unicode_keyboard_event(rdpInput* input, UINT16 flags, U static BOOL shadow_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) { - rdpShadowClient* client = (rdpShadowClient*) input->context; + rdpShadowClient* client = (rdpShadowClient*)input->context; rdpShadowSubsystem* subsystem = client->server->subsystem; if (client->server->shareSubRect) @@ -71,8 +71,7 @@ static BOOL shadow_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UI client->pointerX = x; client->pointerY = y; - if ((client->pointerX == subsystem->pointerX) && - (client->pointerY == subsystem->pointerY)) + if ((client->pointerX == subsystem->pointerX) && (client->pointerY == subsystem->pointerY)) { flags &= ~PTR_FLAGS_MOVE; @@ -89,7 +88,7 @@ static BOOL shadow_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UI static BOOL shadow_input_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) { - rdpShadowClient* client = (rdpShadowClient*) input->context; + rdpShadowClient* client = (rdpShadowClient*)input->context; rdpShadowSubsystem* subsystem = client->server->subsystem; if (client->server->shareSubRect) diff --git a/server/shadow/shadow_input.h b/server/shadow/shadow_input.h index 95ed4da74..8bde31ce4 100644 --- a/server/shadow/shadow_input.h +++ b/server/shadow/shadow_input.h @@ -22,10 +22,11 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -void shadow_input_register_callbacks(rdpInput* input); + void shadow_input_register_callbacks(rdpInput* input); #ifdef __cplusplus } diff --git a/server/shadow/shadow_lobby.c b/server/shadow/shadow_lobby.c index 267772786..23283153e 100644 --- a/server/shadow/shadow_lobby.c +++ b/server/shadow/shadow_lobby.c @@ -43,7 +43,8 @@ BOOL shadow_client_init_lobby(rdpShadowServer* server) return FALSE; } - if (!(surface = rdtk_surface_new(engine, lobby->data, lobby->width, lobby->height, lobby->scanline))) + if (!(surface = + rdtk_surface_new(engine, lobby->data, lobby->width, lobby->height, lobby->scanline))) { rdtk_engine_free(engine); return FALSE; @@ -63,9 +64,10 @@ BOOL shadow_client_init_lobby(rdpShadowServer* server) height = invalidRect.bottom - invalidRect.top; rdtk_surface_fill(surface, invalidRect.left, invalidRect.top, width, height, 0x3BB9FF); - rdtk_label_draw(surface, invalidRect.left, invalidRect.top, width, height, NULL, "Welcome", 0, 0); - //rdtk_button_draw(surface, 16, 64, 128, 32, NULL, "button"); - //rdtk_text_field_draw(surface, 16, 128, 128, 32, NULL, "text field"); + rdtk_label_draw(surface, invalidRect.left, invalidRect.top, width, height, NULL, "Welcome", 0, + 0); + // rdtk_button_draw(surface, 16, 64, 128, 32, NULL, "button"); + // rdtk_text_field_draw(surface, 16, 128, 128, 32, NULL, "text field"); rdtk_surface_free(surface); diff --git a/server/shadow/shadow_lobby.h b/server/shadow/shadow_lobby.h index 6c308e6e8..37ad9cf69 100644 --- a/server/shadow/shadow_lobby.h +++ b/server/shadow/shadow_lobby.h @@ -27,10 +27,11 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -BOOL shadow_client_init_lobby(rdpShadowServer* server); + BOOL shadow_client_init_lobby(rdpShadowServer* server); #ifdef __cplusplus } diff --git a/server/shadow/shadow_mcevent.c b/server/shadow/shadow_mcevent.c index b31911c25..abeb343eb 100644 --- a/server/shadow/shadow_mcevent.c +++ b/server/shadow/shadow_mcevent.c @@ -34,7 +34,8 @@ struct rdp_shadow_multiclient_subscriber rdpShadowMultiClientEvent* shadow_multiclient_new() { - rdpShadowMultiClientEvent* event = (rdpShadowMultiClientEvent*) calloc(1, sizeof(rdpShadowMultiClientEvent)); + rdpShadowMultiClientEvent* event = + (rdpShadowMultiClientEvent*)calloc(1, sizeof(rdpShadowMultiClientEvent)); if (!event) goto out_error; @@ -74,7 +75,7 @@ out_free_event: out_free: free(event); out_error: - return (rdpShadowMultiClientEvent *)NULL; + return (rdpShadowMultiClientEvent*)NULL; } void shadow_multiclient_free(rdpShadowMultiClientEvent* event) @@ -107,7 +108,7 @@ static void _Publish(rdpShadowMultiClientEvent* event) ArrayList_Lock(subscribers); for (i = 0; i < ArrayList_Count(subscribers); i++) { - subscriber = (struct rdp_shadow_multiclient_subscriber *)ArrayList_GetItem(subscribers, i); + subscriber = (struct rdp_shadow_multiclient_subscriber*)ArrayList_GetItem(subscribers, i); /* Set flag to subscriber: I acknowledge and please handle */ subscriber->pleaseHandle = TRUE; event->consuming++; @@ -183,8 +184,7 @@ static BOOL _Consume(struct rdp_shadow_multiclient_subscriber* subscriber, BOOL rdpShadowMultiClientEvent* event = subscriber->ref; BOOL ret = FALSE; - if (WaitForSingleObject(event->event, 0) == WAIT_OBJECT_0 - && subscriber->pleaseHandle) + if (WaitForSingleObject(event->event, 0) == WAIT_OBJECT_0 && subscriber->pleaseHandle) { /* Consume my share. Server is waiting for us */ event->consuming--; @@ -211,9 +211,9 @@ static BOOL _Consume(struct rdp_shadow_multiclient_subscriber* subscriber, BOOL } else /* (event->consuming > 0) */ { - if (wait) + if (wait) { - /* + /* * This client need to wait. That means the client will * continue waiting for other clients to finish. * The last client should reset barrierEvent. @@ -227,7 +227,7 @@ static BOOL _Consume(struct rdp_shadow_multiclient_subscriber* subscriber, BOOL { /* * This is last client waiting for barrierEvent. - * We can now discard barrierEvent and notify + * We can now discard barrierEvent and notify * server to continue. */ ResetEvent(event->barrierEvent); @@ -248,7 +248,8 @@ void* shadow_multiclient_get_subscriber(rdpShadowMultiClientEvent* event) EnterCriticalSection(&(event->lock)); - subscriber = (struct rdp_shadow_multiclient_subscriber*) calloc(1, sizeof(struct rdp_shadow_multiclient_subscriber)); + subscriber = (struct rdp_shadow_multiclient_subscriber*)calloc( + 1, sizeof(struct rdp_shadow_multiclient_subscriber)); if (!subscriber) goto out_error; @@ -258,9 +259,11 @@ void* shadow_multiclient_get_subscriber(rdpShadowMultiClientEvent* event) if (ArrayList_Add(event->subscribers, subscriber) < 0) goto out_free; - WLog_VRB(TAG, "Get subscriber %p. Wait event %d. %d clients.\n", (void*) subscriber, event->eventid, event->consuming); + WLog_VRB(TAG, "Get subscriber %p. Wait event %d. %d clients.\n", (void*)subscriber, + event->eventid, event->consuming); (void)_Consume(subscriber, TRUE); - WLog_VRB(TAG, "Get subscriber %p. Quit event %d. %d clients.\n", (void*) subscriber, event->eventid, event->consuming); + WLog_VRB(TAG, "Get subscriber %p. Quit event %d. %d clients.\n", (void*)subscriber, + event->eventid, event->consuming); LeaveCriticalSection(&(event->lock)); @@ -292,9 +295,11 @@ void shadow_multiclient_release_subscriber(void* subscriber) EnterCriticalSection(&(event->lock)); - WLog_VRB(TAG, "Release Subscriber %p. Drop event %d. %d clients.\n", subscriber, event->eventid, event->consuming); + WLog_VRB(TAG, "Release Subscriber %p. Drop event %d. %d clients.\n", subscriber, event->eventid, + event->consuming); (void)_Consume(s, FALSE); - WLog_VRB(TAG, "Release Subscriber %p. Quit event %d. %d clients.\n", subscriber, event->eventid, event->consuming); + WLog_VRB(TAG, "Release Subscriber %p. Quit event %d. %d clients.\n", subscriber, event->eventid, + event->consuming); ArrayList_Remove(event->subscribers, subscriber); @@ -319,9 +324,11 @@ BOOL shadow_multiclient_consume(void* subscriber) EnterCriticalSection(&(event->lock)); - WLog_VRB(TAG, "Subscriber %p wait event %d. %d clients.\n", subscriber, event->eventid, event->consuming); + WLog_VRB(TAG, "Subscriber %p wait event %d. %d clients.\n", subscriber, event->eventid, + event->consuming); ret = _Consume(s, TRUE); - WLog_VRB(TAG, "Subscriber %p quit event %d. %d clients.\n", subscriber, event->eventid, event->consuming); + WLog_VRB(TAG, "Subscriber %p quit event %d. %d clients.\n", subscriber, event->eventid, + event->consuming); LeaveCriticalSection(&(event->lock)); diff --git a/server/shadow/shadow_mcevent.h b/server/shadow/shadow_mcevent.h index d6f4dab64..720dca67b 100644 --- a/server/shadow/shadow_mcevent.h +++ b/server/shadow/shadow_mcevent.h @@ -26,15 +26,15 @@ #include /* - * This file implemented a model that an event is consumed + * This file implemented a model that an event is consumed * by multiple clients. All clients should wait others before continue * Server should wait for all clients before continue */ struct rdp_shadow_multiclient_event { - HANDLE event; /* Kickoff event */ + HANDLE event; /* Kickoff event */ HANDLE barrierEvent; /* Represents that all clients have consumed event */ - HANDLE doneEvent; /* Event handling finished. Server could continue */ + HANDLE doneEvent; /* Event handling finished. Server could continue */ wArrayList* subscribers; CRITICAL_SECTION lock; int consuming; @@ -45,18 +45,19 @@ struct rdp_shadow_multiclient_event }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -rdpShadowMultiClientEvent* shadow_multiclient_new(); -void shadow_multiclient_free(rdpShadowMultiClientEvent* event); -void shadow_multiclient_publish(rdpShadowMultiClientEvent* event); -void shadow_multiclient_wait(rdpShadowMultiClientEvent* event); -void shadow_multiclient_publish_and_wait(rdpShadowMultiClientEvent* event); -void* shadow_multiclient_get_subscriber(rdpShadowMultiClientEvent* event); -void shadow_multiclient_release_subscriber(void* subscriber); -BOOL shadow_multiclient_consume(void* subscriber); -HANDLE shadow_multiclient_getevent(void* subscriber); + rdpShadowMultiClientEvent* shadow_multiclient_new(); + void shadow_multiclient_free(rdpShadowMultiClientEvent* event); + void shadow_multiclient_publish(rdpShadowMultiClientEvent* event); + void shadow_multiclient_wait(rdpShadowMultiClientEvent* event); + void shadow_multiclient_publish_and_wait(rdpShadowMultiClientEvent* event); + void* shadow_multiclient_get_subscriber(rdpShadowMultiClientEvent* event); + void shadow_multiclient_release_subscriber(void* subscriber); + BOOL shadow_multiclient_consume(void* subscriber); + HANDLE shadow_multiclient_getevent(void* subscriber); #ifdef __cplusplus } diff --git a/server/shadow/shadow_rdpgfx.h b/server/shadow/shadow_rdpgfx.h index 36af7572c..ce81376fe 100644 --- a/server/shadow/shadow_rdpgfx.h +++ b/server/shadow/shadow_rdpgfx.h @@ -25,11 +25,12 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -int shadow_client_rdpgfx_init(rdpShadowClient* client); -void shadow_client_rdpgfx_uninit(rdpShadowClient* client); + int shadow_client_rdpgfx_init(rdpShadowClient* client); + void shadow_client_rdpgfx_uninit(rdpShadowClient* client); #ifdef __cplusplus } diff --git a/server/shadow/shadow_rdpsnd.h b/server/shadow/shadow_rdpsnd.h index c5e60b219..ae34ea383 100644 --- a/server/shadow/shadow_rdpsnd.h +++ b/server/shadow/shadow_rdpsnd.h @@ -25,11 +25,12 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -int shadow_client_rdpsnd_init(rdpShadowClient* client); -void shadow_client_rdpsnd_uninit(rdpShadowClient* client); + int shadow_client_rdpsnd_init(rdpShadowClient* client); + void shadow_client_rdpsnd_uninit(rdpShadowClient* client); #ifdef __cplusplus } diff --git a/server/shadow/shadow_remdesk.c b/server/shadow/shadow_remdesk.c index 72c3a1408..7a3a941e3 100644 --- a/server/shadow/shadow_remdesk.c +++ b/server/shadow/shadow_remdesk.c @@ -33,7 +33,7 @@ int shadow_client_remdesk_init(rdpShadowClient* client) remdesk = client->remdesk = remdesk_server_context_new(client->vcm); remdesk->rdpcontext = &client->context; - remdesk->custom = (void*) client; + remdesk->custom = (void*)client; if (client->remdesk) client->remdesk->Start(client->remdesk); @@ -43,7 +43,8 @@ int shadow_client_remdesk_init(rdpShadowClient* client) void shadow_client_remdesk_uninit(rdpShadowClient* client) { - if (client->remdesk) { + if (client->remdesk) + { client->remdesk->Stop(client->remdesk); remdesk_server_context_free(client->remdesk); client->remdesk = NULL; diff --git a/server/shadow/shadow_remdesk.h b/server/shadow/shadow_remdesk.h index 953289377..88fdba04a 100644 --- a/server/shadow/shadow_remdesk.h +++ b/server/shadow/shadow_remdesk.h @@ -25,11 +25,12 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -int shadow_client_remdesk_init(rdpShadowClient* client); -void shadow_client_remdesk_uninit(rdpShadowClient* client); + int shadow_client_remdesk_init(rdpShadowClient* client); + void shadow_client_remdesk_uninit(rdpShadowClient* client); #ifdef __cplusplus } diff --git a/server/shadow/shadow_screen.c b/server/shadow/shadow_screen.c index 94086bb73..049437942 100644 --- a/server/shadow/shadow_screen.c +++ b/server/shadow/shadow_screen.c @@ -33,7 +33,7 @@ rdpShadowScreen* shadow_screen_new(rdpShadowServer* server) rdpShadowSubsystem* subsystem; MONITOR_DEF* primary; - screen = (rdpShadowScreen*) calloc(1, sizeof(rdpShadowScreen)); + screen = (rdpShadowScreen*)calloc(1, sizeof(rdpShadowScreen)); if (!screen) goto out_error; @@ -128,8 +128,8 @@ BOOL shadow_screen_resize(rdpShadowScreen* screen) width = primary->right - primary->left; height = primary->bottom - primary->top; - if (shadow_surface_resize(screen->primary, x, y, width, height) - && shadow_surface_resize(screen->lobby, x, y, width, height)) + if (shadow_surface_resize(screen->primary, x, y, width, height) && + shadow_surface_resize(screen->lobby, x, y, width, height)) { if ((width != screen->width) || (height != screen->height)) { @@ -139,7 +139,7 @@ BOOL shadow_screen_resize(rdpShadowScreen* screen) shadow_client_init_lobby(screen->server); } return TRUE; - } + } return FALSE; } diff --git a/server/shadow/shadow_screen.h b/server/shadow/shadow_screen.h index e8f5c1751..ca39b2fb2 100644 --- a/server/shadow/shadow_screen.h +++ b/server/shadow/shadow_screen.h @@ -39,11 +39,12 @@ struct rdp_shadow_screen }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -rdpShadowScreen* shadow_screen_new(rdpShadowServer* server); -void shadow_screen_free(rdpShadowScreen* screen); + rdpShadowScreen* shadow_screen_new(rdpShadowServer* server); + void shadow_screen_free(rdpShadowScreen* screen); #ifdef __cplusplus } diff --git a/server/shadow/shadow_server.c b/server/shadow/shadow_server.c index 76bbb8bf9..d7a7536a6 100644 --- a/server/shadow/shadow_server.c +++ b/server/shadow/shadow_server.c @@ -45,24 +45,38 @@ #define TAG SERVER_TAG("shadow") -static const COMMAND_LINE_ARGUMENT_A shadow_args[] = -{ +static const COMMAND_LINE_ARGUMENT_A shadow_args[] = { { "port", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "Server port" }, - { "ipc-socket", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "Server IPC socket" }, - { "monitors", COMMAND_LINE_VALUE_OPTIONAL, "<0,1,2...>", NULL, NULL, -1, NULL, "Select or list monitors" }, - { "rect", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "Select rectangle within monitor to share" }, - { "auth", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Clients must authenticate" }, - { "may-view", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "Clients may view without prompt" }, - { "may-interact", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "Clients may interact without prompt" }, - { "sec", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "force specific protocol security" }, - { "sec-rdp", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "rdp protocol security" }, - { "sec-tls", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "tls protocol security" }, - { "sec-nla", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "nla protocol security" }, - { "sec-ext", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "nla extended protocol security" }, - { "sam-file", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "NTLM SAM file for NLA authentication" }, - { "version", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_VERSION, NULL, NULL, NULL, -1, NULL, "Print version" }, - { "buildconfig", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_BUILDCONFIG, NULL, NULL, NULL, -1, NULL, "Print the build configuration" }, - { "help", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_HELP, NULL, NULL, NULL, -1, "?", "Print help" }, + { "ipc-socket", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Server IPC socket" }, + { "monitors", COMMAND_LINE_VALUE_OPTIONAL, "<0,1,2...>", NULL, NULL, -1, NULL, + "Select or list monitors" }, + { "rect", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Select rectangle within monitor to share" }, + { "auth", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, + "Clients must authenticate" }, + { "may-view", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, + "Clients may view without prompt" }, + { "may-interact", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, + "Clients may interact without prompt" }, + { "sec", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "force specific protocol security" }, + { "sec-rdp", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, + "rdp protocol security" }, + { "sec-tls", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, + "tls protocol security" }, + { "sec-nla", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, + "nla protocol security" }, + { "sec-ext", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, + "nla extended protocol security" }, + { "sam-file", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "NTLM SAM file for NLA authentication" }, + { "version", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_VERSION, NULL, NULL, NULL, -1, NULL, + "Print version" }, + { "buildconfig", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_BUILDCONFIG, NULL, NULL, NULL, -1, + NULL, "Print the build configuration" }, + { "help", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_HELP, NULL, NULL, NULL, -1, "?", + "Print help" }, { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; @@ -81,7 +95,8 @@ static int shadow_server_print_command_line_help(int argc, char** argv) WLog_INFO(TAG, "Syntax:"); WLog_INFO(TAG, " /flag (enables flag)"); WLog_INFO(TAG, " /option: (specifies option with value)"); - WLog_INFO(TAG, " +toggle -toggle (enables or disables toggle, where '/' is a synonym of '+')"); + WLog_INFO(TAG, + " +toggle -toggle (enables or disables toggle, where '/' is a synonym of '+')"); WLog_INFO(TAG, ""); arg = largs; @@ -93,14 +108,15 @@ static int shadow_server_print_command_line_help(int argc, char** argv) WLog_INFO(TAG, "%-20s", arg->Name); WLog_INFO(TAG, "\t%s", arg->Text); } - else if ((arg->Flags & COMMAND_LINE_VALUE_REQUIRED) || (arg->Flags & COMMAND_LINE_VALUE_OPTIONAL)) + else if ((arg->Flags & COMMAND_LINE_VALUE_REQUIRED) || + (arg->Flags & COMMAND_LINE_VALUE_OPTIONAL)) { WLog_INFO(TAG, " %s", "/"); if (arg->Format) { length = (strlen(arg->Name) + strlen(arg->Format) + 2); - str = (char*) malloc(length + 1); + str = (char*)malloc(length + 1); if (!str) return -1; @@ -119,26 +135,24 @@ static int shadow_server_print_command_line_help(int argc, char** argv) else if (arg->Flags & COMMAND_LINE_VALUE_BOOL) { length = strlen(arg->Name) + 32; - str = (char*) malloc(length + 1); + str = (char*)malloc(length + 1); if (!str) return -1; - sprintf_s(str, length + 1, "%s (default:%s)", arg->Name, - arg->Default ? "on" : "off"); + sprintf_s(str, length + 1, "%s (default:%s)", arg->Name, arg->Default ? "on" : "off"); WLog_INFO(TAG, " %s", arg->Default ? "-" : "+"); WLog_INFO(TAG, "%-20s", str); free(str); WLog_INFO(TAG, "\t%s", arg->Text); } - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); return 1; } int shadow_server_command_line_status_print(rdpShadowServer* server, int argc, char** argv, - int status) + int status) { WINPR_UNUSED(server); @@ -182,8 +196,7 @@ int shadow_server_parse_command_line(rdpShadowServer* server, int argc, char** a CommandLineClearArgumentsA(largs); flags = COMMAND_LINE_SEPARATOR_COLON; flags |= COMMAND_LINE_SIGIL_SLASH | COMMAND_LINE_SIGIL_PLUS_MINUS; - status = CommandLineParseArgumentsA(argc, argv, largs, flags, server, NULL, - NULL); + status = CommandLineParseArgumentsA(argc, argv, largs, flags, server, NULL, NULL); if (status < 0) return status; @@ -196,15 +209,14 @@ int shadow_server_parse_command_line(rdpShadowServer* server, int argc, char** a if (!(arg->Flags & COMMAND_LINE_ARGUMENT_PRESENT)) continue; - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "port") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "port") { long val = strtol(arg->Value, NULL, 0); if ((errno != 0) || (val <= 0) || (val > UINT16_MAX)) return -1; - server->port = (DWORD) val; + server->port = (DWORD)val; } CommandLineSwitchCase(arg, "ipc-socket") { @@ -358,8 +370,7 @@ int shadow_server_parse_command_line(rdpShadowServer* server, int argc, char** a { } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); arg = CommandLineFindArgumentA(largs, "monitors"); @@ -392,9 +403,9 @@ int shadow_server_parse_command_line(rdpShadowServer* server, int argc, char** a monitor = &monitors[index]; width = monitor->right - monitor->left; height = monitor->bottom - monitor->top; - WLog_INFO(TAG, " %s [%d] %dx%d\t+%"PRId32"+%"PRId32"", - (monitor->flags == 1) ? "*" : " ", index, - width, height, monitor->left, monitor->top); + WLog_INFO(TAG, " %s [%d] %dx%d\t+%" PRId32 "+%" PRId32 "", + (monitor->flags == 1) ? "*" : " ", index, width, height, monitor->left, + monitor->top); } status = COMMAND_LINE_STATUS_PRINT; @@ -435,20 +446,20 @@ static DWORD WINAPI shadow_server_thread(LPVOID arg) break; default: + { + if (!listener->CheckFileDescriptor(listener)) { - if (!listener->CheckFileDescriptor(listener)) - { - WLog_ERR(TAG, "Failed to check FreeRDP file descriptor"); - running = FALSE; - } - else - { -#ifdef _WIN32 - Sleep(100); /* FIXME: listener event handles */ -#endif - } + WLog_ERR(TAG, "Failed to check FreeRDP file descriptor"); + running = FALSE; } - break; + else + { +#ifdef _WIN32 + Sleep(100); /* FIXME: listener event handles */ +#endif + } + } + break; } } @@ -500,17 +511,18 @@ int shadow_server_start(rdpShadowServer* server) } if (!server->ipcSocket) - status = server->listener->Open(server->listener, NULL, (UINT16) server->port); + status = server->listener->Open(server->listener, NULL, (UINT16)server->port); else status = server->listener->OpenLocal(server->listener, server->ipcSocket); if (!status) { - WLog_ERR(TAG, "Problem creating listener. (Port already used or insufficient permissions?)"); + WLog_ERR(TAG, + "Problem creating listener. (Port already used or insufficient permissions?)"); return -1; } - if (!(server->thread = CreateThread(NULL, 0, shadow_server_thread, (void*) server, 0, NULL))) + if (!(server->thread = CreateThread(NULL, 0, shadow_server_thread, (void*)server, 0, NULL))) { return -1; } @@ -567,8 +579,7 @@ static int shadow_server_init_config_path(rdpShadowServer* server) if (userLibraryPath) { - if (!PathFileExistsA(userLibraryPath) && - !PathMakePathA(userLibraryPath, 0)) + if (!PathFileExistsA(userLibraryPath) && !PathMakePathA(userLibraryPath, 0)) { WLog_ERR(TAG, "Failed to create directory '%s'", userLibraryPath); free(userLibraryPath); @@ -605,8 +616,7 @@ static int shadow_server_init_config_path(rdpShadowServer* server) if (configHome) { - if (!PathFileExistsA(configHome) && - !PathMakePathA(configHome, 0)) + if (!PathFileExistsA(configHome) && !PathMakePathA(configHome, 0)) { WLog_ERR(TAG, "Failed to create directory '%s'", configHome); free(configHome); @@ -629,18 +639,10 @@ static BOOL shadow_server_init_certificate(rdpShadowServer* server) char* filepath; MAKECERT_CONTEXT* makecert = NULL; BOOL ret = FALSE; - const char* makecert_argv[6] = - { - "makecert", - "-rdp", - "-live", - "-silent", - "-y", "5" - }; + const char* makecert_argv[6] = { "makecert", "-rdp", "-live", "-silent", "-y", "5" }; int makecert_argc = (sizeof(makecert_argv) / sizeof(char*)); - if (!PathFileExistsA(server->ConfigPath) && - !PathMakePathA(server->ConfigPath, 0)) + if (!PathFileExistsA(server->ConfigPath) && !PathMakePathA(server->ConfigPath, 0)) { WLog_ERR(TAG, "Failed to create directory '%s'", server->ConfigPath); return FALSE; @@ -649,8 +651,7 @@ static BOOL shadow_server_init_certificate(rdpShadowServer* server) if (!(filepath = GetCombinedPath(server->ConfigPath, "shadow"))) return FALSE; - if (!PathFileExistsA(filepath) && - !PathMakePathA(filepath, 0)) + if (!PathFileExistsA(filepath) && !PathMakePathA(filepath, 0)) { if (!CreateDirectoryA(filepath, 0)) { @@ -665,15 +666,14 @@ static BOOL shadow_server_init_certificate(rdpShadowServer* server) if (!server->CertificateFile || !server->PrivateKeyFile) goto out_fail; - if ((!PathFileExistsA(server->CertificateFile)) || - (!PathFileExistsA(server->PrivateKeyFile))) + if ((!PathFileExistsA(server->CertificateFile)) || (!PathFileExistsA(server->PrivateKeyFile))) { makecert = makecert_context_new(); if (!makecert) goto out_fail; - if (makecert_context_process(makecert, makecert_argc, (char**) makecert_argv) < 0) + if (makecert_context_process(makecert, makecert_argc, (char**)makecert_argv) < 0) goto out_fail; if (makecert_context_set_output_file_name(makecert, "shadow") != 1) @@ -729,7 +729,7 @@ int shadow_server_init(rdpShadowServer* server) if (!server->listener) goto fail_listener; - server->listener->info = (void*) server; + server->listener->info = (void*)server; server->listener->PeerAccepted = shadow_client_accepted; server->subsystem = shadow_subsystem_new(); @@ -793,7 +793,7 @@ int shadow_server_uninit(rdpShadowServer* server) rdpShadowServer* shadow_server_new(void) { rdpShadowServer* server; - server = (rdpShadowServer*) calloc(1, sizeof(rdpShadowServer)); + server = (rdpShadowServer*)calloc(1, sizeof(rdpShadowServer)); if (!server) return NULL; @@ -822,4 +822,3 @@ void shadow_server_free(rdpShadowServer* server) server->settings = NULL; free(server); } - diff --git a/server/shadow/shadow_subsystem.c b/server/shadow/shadow_subsystem.c index cc5766a1f..aee87e1dc 100644 --- a/server/shadow/shadow_subsystem.c +++ b/server/shadow/shadow_subsystem.c @@ -105,9 +105,9 @@ fail: return status; } -static void shadow_subsystem_free_queued_message(void *obj) +static void shadow_subsystem_free_queued_message(void* obj) { - wMessage *message = (wMessage*)obj; + wMessage* message = (wMessage*)obj; if (message->Free) { message->Free(message); @@ -184,8 +184,9 @@ UINT32 shadow_enum_monitors(MONITOR_DEF* monitors, UINT32 maxMonitors) * and andmask data and fill into SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE * Caller should free the andMaskData and xorMaskData later. */ -int shadow_subsystem_pointer_convert_alpha_pointer_data(BYTE* pixels, BOOL premultiplied, - UINT32 width, UINT32 height, SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE* pointerColor) +int shadow_subsystem_pointer_convert_alpha_pointer_data( + BYTE* pixels, BOOL premultiplied, UINT32 width, UINT32 height, + SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE* pointerColor) { UINT32 x, y; BYTE* pSrc8; @@ -204,13 +205,13 @@ int shadow_subsystem_pointer_convert_alpha_pointer_data(BYTE* pixels, BOOL premu andStep += (andStep % 2); pointerColor->lengthXorMask = height * xorStep; - pointerColor->xorMaskData = (BYTE*) calloc(1, pointerColor->lengthXorMask); + pointerColor->xorMaskData = (BYTE*)calloc(1, pointerColor->lengthXorMask); if (!pointerColor->xorMaskData) return -1; pointerColor->lengthAndMask = height * andStep; - pointerColor->andMaskData = (BYTE*) calloc(1, pointerColor->lengthAndMask); + pointerColor->andMaskData = (BYTE*)calloc(1, pointerColor->lengthAndMask); if (!pointerColor->andMaskData) { @@ -249,9 +250,9 @@ int shadow_subsystem_pointer_convert_alpha_pointer_data(BYTE* pixels, BOOL premu { if (premultiplied) { - B = (B * 0xFF ) / A; - G = (G * 0xFF ) / A; - R = (R * 0xFF ) / A; + B = (B * 0xFF) / A; + G = (G * 0xFF) / A; + R = (R * 0xFF) / A; } } @@ -259,8 +260,13 @@ int shadow_subsystem_pointer_convert_alpha_pointer_data(BYTE* pixels, BOOL premu *pDst8++ = G; *pDst8++ = R; - if (andPixel) *andBits |= andBit; - if (!(andBit >>= 1)) { andBits++; andBit = 0x80; } + if (andPixel) + *andBits |= andBit; + if (!(andBit >>= 1)) + { + andBits++; + andBit = 0x80; + } } } diff --git a/server/shadow/shadow_subsystem.h b/server/shadow/shadow_subsystem.h index ef8d7ef92..5702e471c 100644 --- a/server/shadow/shadow_subsystem.h +++ b/server/shadow/shadow_subsystem.h @@ -25,21 +25,21 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -rdpShadowSubsystem* shadow_subsystem_new(void); -void shadow_subsystem_free(rdpShadowSubsystem* subsystem); + rdpShadowSubsystem* shadow_subsystem_new(void); + void shadow_subsystem_free(rdpShadowSubsystem* subsystem); -int shadow_subsystem_init(rdpShadowSubsystem* subsystem, rdpShadowServer* server); -void shadow_subsystem_uninit(rdpShadowSubsystem* subsystem); + int shadow_subsystem_init(rdpShadowSubsystem* subsystem, rdpShadowServer* server); + void shadow_subsystem_uninit(rdpShadowSubsystem* subsystem); -int shadow_subsystem_start(rdpShadowSubsystem* subsystem); -int shadow_subsystem_stop(rdpShadowSubsystem* subsystem); + int shadow_subsystem_start(rdpShadowSubsystem* subsystem); + int shadow_subsystem_stop(rdpShadowSubsystem* subsystem); #ifdef __cplusplus } #endif #endif /* FREERDP_SERVER_SHADOW_SUBSYSTEM_H */ - diff --git a/server/shadow/shadow_subsystem_builtin.c b/server/shadow/shadow_subsystem_builtin.c index 8dbbe7ef4..0bba2c3f1 100644 --- a/server/shadow/shadow_subsystem_builtin.c +++ b/server/shadow/shadow_subsystem_builtin.c @@ -41,8 +41,7 @@ extern int Mac_ShadowSubsystemEntry(RDP_SHADOW_ENTRY_POINTS* pEntryPoints); extern int Win_ShadowSubsystemEntry(RDP_SHADOW_ENTRY_POINTS* pEntryPoints); #endif -static RDP_SHADOW_SUBSYSTEM g_Subsystems[] = -{ +static RDP_SHADOW_SUBSYSTEM g_Subsystems[] = { #ifdef WITH_SHADOW_X11 { "X11", X11_ShadowSubsystemEntry }, diff --git a/server/shadow/shadow_surface.c b/server/shadow/shadow_surface.c index 78d31a77b..0e48c6f78 100644 --- a/server/shadow/shadow_surface.c +++ b/server/shadow/shadow_surface.c @@ -24,11 +24,10 @@ #include "shadow_surface.h" #define ALIGN_SCREEN_SIZE(size, align) ((size + align - 1) & (~(align - 1))) -rdpShadowSurface* shadow_surface_new(rdpShadowServer* server, int x, int y, - int width, int height) +rdpShadowSurface* shadow_surface_new(rdpShadowServer* server, int x, int y, int width, int height) { rdpShadowSurface* surface; - surface = (rdpShadowSurface*) calloc(1, sizeof(rdpShadowSurface)); + surface = (rdpShadowSurface*)calloc(1, sizeof(rdpShadowSurface)); if (!surface) return NULL; @@ -40,8 +39,7 @@ rdpShadowSurface* shadow_surface_new(rdpShadowServer* server, int x, int y, surface->height = height; surface->scanline = ALIGN_SCREEN_SIZE(surface->width, 4) * 4; surface->format = PIXEL_FORMAT_BGRX32; - surface->data = (BYTE*) calloc(ALIGN_SCREEN_SIZE(surface->height, 4), - surface->scanline); + surface->data = (BYTE*)calloc(ALIGN_SCREEN_SIZE(surface->height, 4), surface->scanline); if (!surface->data) { @@ -71,11 +69,10 @@ void shadow_surface_free(rdpShadowSurface* surface) free(surface); } -BOOL shadow_surface_resize(rdpShadowSurface* surface, int x, int y, int width, - int height) +BOOL shadow_surface_resize(rdpShadowSurface* surface, int x, int y, int width, int height) { BYTE* buffer = NULL; - int scanline = ALIGN_SCREEN_SIZE(width, 4) * 4; + int scanline = ALIGN_SCREEN_SIZE(width, 4) * 4; if (!surface) return FALSE; @@ -88,8 +85,7 @@ BOOL shadow_surface_resize(rdpShadowSurface* surface, int x, int y, int width, return TRUE; } - buffer = (BYTE*) realloc(surface->data, scanline * ALIGN_SCREEN_SIZE(height, - 4)); + buffer = (BYTE*)realloc(surface->data, scanline * ALIGN_SCREEN_SIZE(height, 4)); if (buffer) { diff --git a/server/shadow/shadow_surface.h b/server/shadow/shadow_surface.h index abfbd562b..0f3d944ab 100644 --- a/server/shadow/shadow_surface.h +++ b/server/shadow/shadow_surface.h @@ -25,12 +25,14 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -rdpShadowSurface* shadow_surface_new(rdpShadowServer* server, int x, int y, int width, int height); -void shadow_surface_free(rdpShadowSurface* surface); -BOOL shadow_surface_resize(rdpShadowSurface *surface, int x, int y, int width, int height); + rdpShadowSurface* shadow_surface_new(rdpShadowServer* server, int x, int y, int width, + int height); + void shadow_surface_free(rdpShadowSurface* surface); + BOOL shadow_surface_resize(rdpShadowSurface* surface, int x, int y, int width, int height); #ifdef __cplusplus } diff --git a/uwac/include/uwac/uwac-tools.h b/uwac/include/uwac/uwac-tools.h index 859e51dde..b7392ee62 100644 --- a/uwac/include/uwac/uwac-tools.h +++ b/uwac/include/uwac/uwac-tools.h @@ -27,7 +27,8 @@ #include /** @brief */ -struct uwac_touch_point { +struct uwac_touch_point +{ uint32_t id; wl_fixed_t x, y; }; @@ -40,14 +41,13 @@ typedef struct uwac_touch_automata UwacTouchAutomata; * * @param automata */ -UWAC_API void UwacTouchAutomataInit(UwacTouchAutomata *automata); +UWAC_API void UwacTouchAutomataInit(UwacTouchAutomata* automata); /** * * @param automata */ -UWAC_API void UwacTouchAutomataReset(UwacTouchAutomata *automata); - +UWAC_API void UwacTouchAutomataReset(UwacTouchAutomata* automata); /** * @@ -55,6 +55,6 @@ UWAC_API void UwacTouchAutomataReset(UwacTouchAutomata *automata); * @param event * @return */ -UWAC_API bool UwacTouchAutomataInjectEvent(UwacTouchAutomata *automata, UwacEvent *event); +UWAC_API bool UwacTouchAutomataInjectEvent(UwacTouchAutomata* automata, UwacEvent* event); #endif /* UWAC_TOOLS_H_ */ diff --git a/uwac/include/uwac/uwac.h b/uwac/include/uwac/uwac.h index 5c0403493..64ae41bb0 100644 --- a/uwac/include/uwac/uwac.h +++ b/uwac/include/uwac/uwac.h @@ -27,7 +27,7 @@ #include #if __GNUC__ >= 4 -#define UWAC_API __attribute__ ((visibility("default"))) +#define UWAC_API __attribute__((visibility("default"))) #else #define UWAC_API #endif @@ -39,7 +39,6 @@ typedef struct uwac_window UwacWindow; typedef struct uwac_seat UwacSeat; typedef uint32_t UwacSeatId; - /** @brief error codes */ typedef enum { @@ -59,7 +58,7 @@ typedef enum /** @brief input modifiers */ enum { - UWAC_MOD_SHIFT_MASK = 0x01, + UWAC_MOD_SHIFT_MASK = 0x01, UWAC_MOD_ALT_MASK = 0x02, UWAC_MOD_CONTROL_MASK = 0x04, }; @@ -71,7 +70,6 @@ struct uwac_size int height; }; - /** @brief event types */ enum { @@ -103,10 +101,10 @@ enum /** @brief window states */ enum { - UWAC_WINDOW_MAXIMIZED = 0x1, - UWAC_WINDOW_RESIZING = 0x2, - UWAC_WINDOW_FULLSCREEN = 0x4, - UWAC_WINDOW_ACTIVATED = 0x8, + UWAC_WINDOW_MAXIMIZED = 0x1, + UWAC_WINDOW_RESIZING = 0x2, + UWAC_WINDOW_FULLSCREEN = 0x4, + UWAC_WINDOW_ACTIVATED = 0x8, }; struct uwac_new_output_event @@ -123,7 +121,6 @@ struct uwac_new_seat_event }; typedef struct uwac_new_seat_event UwacSeatNewEvent; - struct uwac_removed_seat_event { int type; @@ -253,15 +250,14 @@ struct uwac_output_geometry_event int physical_width; int physical_height; int subpixel; - const char *make; - const char *model; + const char* make; + const char* model; int transform; }; typedef struct uwac_output_geometry_event UwacOutputGeometryEvent; /** @brief */ -union uwac_event -{ +union uwac_event { int type; UwacOutputNewEvent output_new; UwacOutputGeometryEvent output_geometry; @@ -291,314 +287,320 @@ typedef void (*UwacDataTransferHandler)(UwacSeat* seat, void* context, const cha typedef void (*UwacCancelDataTransferHandler)(UwacSeat* seat, void* context); #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/** - * install a handler that will be called when UWAC encounter internal errors. The - * handler is supposed to answer if the execution can continue. I can also be used - * to log things. - * - * @param handler - */ -UWAC_API void UwacInstallErrorHandler(UwacErrorHandler handler); + /** + * install a handler that will be called when UWAC encounter internal errors. The + * handler is supposed to answer if the execution can continue. I can also be used + * to log things. + * + * @param handler + */ + UWAC_API void UwacInstallErrorHandler(UwacErrorHandler handler); + /** + * Opens the corresponding wayland display, using NULL you will open the default + * display. + * + * @param name the name of the display to open + * @return the created UwacDisplay object + */ + UWAC_API UwacDisplay* UwacOpenDisplay(const char* name, UwacReturnCode* err); -/** - * Opens the corresponding wayland display, using NULL you will open the default - * display. - * - * @param name the name of the display to open - * @return the created UwacDisplay object - */ -UWAC_API UwacDisplay* UwacOpenDisplay(const char* name, UwacReturnCode* err); + /** + * closes the corresponding UwacDisplay + * + * @param pdisplay a pointer on the display to close + * @return UWAC_SUCCESS if the operation was successful, the corresponding error otherwise + */ + UWAC_API UwacReturnCode UwacCloseDisplay(UwacDisplay** pdisplay); -/** - * closes the corresponding UwacDisplay - * - * @param pdisplay a pointer on the display to close - * @return UWAC_SUCCESS if the operation was successful, the corresponding error otherwise - */ -UWAC_API UwacReturnCode UwacCloseDisplay(UwacDisplay** pdisplay); + /** + * Returns the file descriptor associated with the UwacDisplay, this is useful when + * you want to poll that file descriptor for activity. + * + * @param display an opened UwacDisplay + * @return the corresponding descriptor + */ + UWAC_API int UwacDisplayGetFd(UwacDisplay* display); -/** - * Returns the file descriptor associated with the UwacDisplay, this is useful when - * you want to poll that file descriptor for activity. - * - * @param display an opened UwacDisplay - * @return the corresponding descriptor - */ -UWAC_API int UwacDisplayGetFd(UwacDisplay* display); + /** + * Returns a human readable form of a Uwac error code + * + * @param error the error number + * @return the associated string + */ + UWAC_API const char* UwacErrorString(UwacReturnCode error); -/** - * Returns a human readable form of a Uwac error code - * - * @param error the error number - * @return the associated string - */ -UWAC_API const char* UwacErrorString(UwacReturnCode error); + /** + * returns the last error that occurred on a display + * + * @param display the display + * @return the last error that have been set for this display + */ + UWAC_API UwacReturnCode UwacDisplayGetLastError(const UwacDisplay* display); -/** - * returns the last error that occurred on a display - * - * @param display the display - * @return the last error that have been set for this display - */ -UWAC_API UwacReturnCode UwacDisplayGetLastError(const UwacDisplay* display); + /** + * retrieves the version of a given interface + * + * @param display the display connection + * @param name the name of the interface + * @param version the output variable for the version + * @return UWAC_SUCCESS if the interface was found, UWAC_NOT_FOUND otherwise + */ + UWAC_API UwacReturnCode UwacDisplayQueryInterfaceVersion(const UwacDisplay* display, + const char* name, uint32_t* version); -/** - * retrieves the version of a given interface - * - * @param display the display connection - * @param name the name of the interface - * @param version the output variable for the version - * @return UWAC_SUCCESS if the interface was found, UWAC_NOT_FOUND otherwise - */ -UWAC_API UwacReturnCode UwacDisplayQueryInterfaceVersion(const UwacDisplay* display, - const char* name, uint32_t* version); + /** + * returns the number SHM formats that have been reported by the compositor + * + * @param display a connected UwacDisplay + * @return the number of SHM formats supported + */ + UWAC_API uint32_t UwacDisplayQueryGetNbShmFormats(UwacDisplay* display); -/** - * returns the number SHM formats that have been reported by the compositor - * - * @param display a connected UwacDisplay - * @return the number of SHM formats supported - */ -UWAC_API uint32_t UwacDisplayQueryGetNbShmFormats(UwacDisplay* display); + /** + * returns the supported ShmFormats + * + * @param display a connected UwacDisplay + * @param formats a pointer on an array of wl_shm_format with enough place for formats_size + *items + * @param formats_size the size of the formats array + * @param filled the number of filled entries in the formats array + * @return UWAC_SUCCESS on success, an error otherwise + */ + UWAC_API UwacReturnCode UwacDisplayQueryShmFormats(const UwacDisplay* display, + enum wl_shm_format* formats, + int formats_size, int* filled); -/** - * returns the supported ShmFormats - * - * @param display a connected UwacDisplay - * @param formats a pointer on an array of wl_shm_format with enough place for formats_size items - * @param formats_size the size of the formats array - * @param filled the number of filled entries in the formats array - * @return UWAC_SUCCESS on success, an error otherwise - */ -UWAC_API UwacReturnCode UwacDisplayQueryShmFormats(const UwacDisplay* display, - enum wl_shm_format* formats, int formats_size, int* filled); + /** + * returns the number of registered outputs + * + * @param display the display to query + * @return the number of outputs + */ + UWAC_API uint32_t UwacDisplayGetNbOutputs(UwacDisplay* display); -/** - * returns the number of registered outputs - * - * @param display the display to query - * @return the number of outputs - */ -UWAC_API uint32_t UwacDisplayGetNbOutputs(UwacDisplay* display); + /** + * retrieve a particular UwacOutput object + * + * @param display the display to query + * @param index index of the output + * @return the given UwacOutput, NULL if something failed (so you should query + *UwacDisplayGetLastError() to have the reason) + */ + UWAC_API UwacOutput* UwacDisplayGetOutput(UwacDisplay* display, int index); -/** - * retrieve a particular UwacOutput object - * - * @param display the display to query - * @param index index of the output - * @return the given UwacOutput, NULL if something failed (so you should query UwacDisplayGetLastError() to have the reason) - */ -UWAC_API UwacOutput* UwacDisplayGetOutput(UwacDisplay* display, int index); + /** + * retrieve the resolution of a given UwacOutput + * + * @param output the UwacOutput + * @param resolution a pointer on the + * @return UWAC_SUCCESS on success + */ + UWAC_API UwacReturnCode UwacOutputGetResolution(UwacOutput* output, UwacSize* resolution); -/** - * retrieve the resolution of a given UwacOutput - * - * @param output the UwacOutput - * @param resolution a pointer on the - * @return UWAC_SUCCESS on success - */ -UWAC_API UwacReturnCode UwacOutputGetResolution(UwacOutput* output, UwacSize* resolution); + /** + * creates a window using a SHM surface + * + * @param display the display to attach the window to + * @param width the width of the window + * @param height the heigh of the window + * @param format format to use for the SHM surface + * @return the created UwacWindow, NULL if something failed (use UwacDisplayGetLastError() to + *know more about this) + */ + UWAC_API UwacWindow* UwacCreateWindowShm(UwacDisplay* display, uint32_t width, uint32_t height, + enum wl_shm_format format); + /** + * destroys the corresponding UwacWindow + * + * @param window a pointer on the UwacWindow to destroy + * @return if the operation completed successfully + */ + UWAC_API UwacReturnCode UwacDestroyWindow(UwacWindow** window); -/** - * creates a window using a SHM surface - * - * @param display the display to attach the window to - * @param width the width of the window - * @param height the heigh of the window - * @param format format to use for the SHM surface - * @return the created UwacWindow, NULL if something failed (use UwacDisplayGetLastError() to know more about this) - */ -UWAC_API UwacWindow* UwacCreateWindowShm(UwacDisplay* display, uint32_t width, uint32_t height, - enum wl_shm_format format); + /** + * Sets the region that should be considered opaque to the compositor. + * + * @param window the UwacWindow + * @param x + * @param y + * @param width + * @param height + * @return UWAC_SUCCESS on success, an error otherwise + */ + UWAC_API UwacReturnCode UwacWindowSetOpaqueRegion(UwacWindow* window, uint32_t x, uint32_t y, + uint32_t width, uint32_t height); -/** - * destroys the corresponding UwacWindow - * - * @param window a pointer on the UwacWindow to destroy - * @return if the operation completed successfully - */ -UWAC_API UwacReturnCode UwacDestroyWindow(UwacWindow** window); + /** + * Sets the region of the window that can trigger input events + * + * @param window the UwacWindow + * @param x + * @param y + * @param width + * @param height + * @return + */ + UWAC_API UwacReturnCode UwacWindowSetInputRegion(UwacWindow* window, uint32_t x, uint32_t y, + uint32_t width, uint32_t height); -/** - * Sets the region that should be considered opaque to the compositor. - * - * @param window the UwacWindow - * @param x - * @param y - * @param width - * @param height - * @return UWAC_SUCCESS on success, an error otherwise - */ -UWAC_API UwacReturnCode UwacWindowSetOpaqueRegion(UwacWindow* window, uint32_t x, uint32_t y, - uint32_t width, uint32_t height); + /** + * retrieves a pointer on the current window content to draw a frame + * @param window the UwacWindow + * @return a pointer on the current window content + */ + UWAC_API void* UwacWindowGetDrawingBuffer(UwacWindow* window); -/** - * Sets the region of the window that can trigger input events - * - * @param window the UwacWindow - * @param x - * @param y - * @param width - * @param height - * @return - */ -UWAC_API UwacReturnCode UwacWindowSetInputRegion(UwacWindow* window, uint32_t x, uint32_t y, - uint32_t width, uint32_t height); + /** + * sets a rectangle as dirty for the next frame of a window + * + * @param window the UwacWindow + * @param x left coordinate + * @param y top coordinate + * @param width the width of the dirty rectangle + * @param height the height of the dirty rectangle + * @return UWAC_SUCCESS on success, an Uwac error otherwise + */ + UWAC_API UwacReturnCode UwacWindowAddDamage(UwacWindow* window, uint32_t x, uint32_t y, + uint32_t width, uint32_t height); -/** - * retrieves a pointer on the current window content to draw a frame - * @param window the UwacWindow - * @return a pointer on the current window content - */ -UWAC_API void* UwacWindowGetDrawingBuffer(UwacWindow* window); + /** + * returns the geometry of the given UwacWindow buffer + * + * @param window the UwacWindow + * @param geometry the geometry to fill + * @param stride the length of a buffer line in bytes + * @return UWAC_SUCCESS on success, an Uwac error otherwise + */ + UWAC_API UwacReturnCode UwacWindowGetDrawingBufferGeometry(UwacWindow* window, + UwacSize* geometry, size_t* stride); -/** - * sets a rectangle as dirty for the next frame of a window - * - * @param window the UwacWindow - * @param x left coordinate - * @param y top coordinate - * @param width the width of the dirty rectangle - * @param height the height of the dirty rectangle - * @return UWAC_SUCCESS on success, an Uwac error otherwise - */ -UWAC_API UwacReturnCode UwacWindowAddDamage(UwacWindow* window, uint32_t x, uint32_t y, - uint32_t width, uint32_t height); + /** + * Sends a frame to the compositor with the content of the drawing buffer + * + * @param window the UwacWindow to refresh + * @param copyContentForNextFrame if true the content to display is copied in the next drawing + *buffer + * @return UWAC_SUCCESS if the operation was successful + */ + UWAC_API UwacReturnCode UwacWindowSubmitBuffer(UwacWindow* window, + bool copyContentForNextFrame); -/** - * returns the geometry of the given UwacWindow buffer - * - * @param window the UwacWindow - * @param geometry the geometry to fill - * @param stride the length of a buffer line in bytes - * @return UWAC_SUCCESS on success, an Uwac error otherwise - */ -UWAC_API UwacReturnCode UwacWindowGetDrawingBufferGeometry(UwacWindow* window, UwacSize* geometry, size_t* stride); + /** + * returns the geometry of the given UwacWindows + * + * @param window the UwacWindow + * @param geometry the geometry to fill + * @return UWAC_SUCCESS on success, an Uwac error otherwise + */ + UWAC_API UwacReturnCode UwacWindowGetGeometry(UwacWindow* window, UwacSize* geometry); -/** - * Sends a frame to the compositor with the content of the drawing buffer - * - * @param window the UwacWindow to refresh - * @param copyContentForNextFrame if true the content to display is copied in the next drawing buffer - * @return UWAC_SUCCESS if the operation was successful - */ -UWAC_API UwacReturnCode UwacWindowSubmitBuffer(UwacWindow* window, bool copyContentForNextFrame); + /** + * Sets or unset the fact that the window is set fullscreen. After this call the + * application should get prepared to receive a configure event. The output is used + * only when going fullscreen, it is optional and not used when exiting fullscreen. + * + * @param window the UwacWindow + * @param output an optional UwacOutput to put the window fullscreen on + * @param isFullscreen set or unset fullscreen + * @return UWAC_SUCCESS if the operation was a success + */ + UWAC_API UwacReturnCode UwacWindowSetFullscreenState(UwacWindow* window, UwacOutput* output, + bool isFullscreen); -/** - * returns the geometry of the given UwacWindows - * - * @param window the UwacWindow - * @param geometry the geometry to fill - * @return UWAC_SUCCESS on success, an Uwac error otherwise - */ -UWAC_API UwacReturnCode UwacWindowGetGeometry(UwacWindow* window, UwacSize* geometry); + /** + * When possible (depending on the shell) sets the title of the UwacWindow + * + * @param window the UwacWindow + * @param name title + */ + UWAC_API void UwacWindowSetTitle(UwacWindow* window, const char* name); -/** - * Sets or unset the fact that the window is set fullscreen. After this call the - * application should get prepared to receive a configure event. The output is used - * only when going fullscreen, it is optional and not used when exiting fullscreen. - * - * @param window the UwacWindow - * @param output an optional UwacOutput to put the window fullscreen on - * @param isFullscreen set or unset fullscreen - * @return UWAC_SUCCESS if the operation was a success - */ -UWAC_API UwacReturnCode UwacWindowSetFullscreenState(UwacWindow* window, UwacOutput* output, - bool isFullscreen); + /** + * + * @param display + * @param timeout + * @return + */ + UWAC_API int UwacDisplayDispatch(UwacDisplay* display, int timeout); -/** - * When possible (depending on the shell) sets the title of the UwacWindow - * - * @param window the UwacWindow - * @param name title - */ -UWAC_API void UwacWindowSetTitle(UwacWindow* window, const char* name); + /** + * Returns if you have some pending events, and you can UwacNextEvent() without blocking + * + * @param display the UwacDisplay + * @return if there's some pending events + */ + UWAC_API bool UwacHasEvent(UwacDisplay* display); -/** - * - * @param display - * @param timeout - * @return - */ -UWAC_API int UwacDisplayDispatch(UwacDisplay* display, int timeout); + /** Waits until an event occurs, and when it's there copy the event from the queue to + * event. + * + * @param display the Uwac display + * @param event the event to fill + * @return if the operation completed successfully + */ + UWAC_API UwacReturnCode UwacNextEvent(UwacDisplay* display, UwacEvent* event); -/** - * Returns if you have some pending events, and you can UwacNextEvent() without blocking - * - * @param display the UwacDisplay - * @return if there's some pending events - */ -UWAC_API bool UwacHasEvent(UwacDisplay* display); + /** + * returns the name of the given UwacSeat + * + * @param seat the UwacSeat + * @return the name of the seat + */ + UWAC_API const char* UwacSeatGetName(const UwacSeat* seat); -/** Waits until an event occurs, and when it's there copy the event from the queue to - * event. - * - * @param display the Uwac display - * @param event the event to fill - * @return if the operation completed successfully - */ -UWAC_API UwacReturnCode UwacNextEvent(UwacDisplay* display, UwacEvent* event); + /** + * returns the id of the given UwacSeat + * + * @param seat the UwacSeat + * @return the id of the seat + */ + UWAC_API UwacSeatId UwacSeatGetId(const UwacSeat* seat); -/** - * returns the name of the given UwacSeat - * - * @param seat the UwacSeat - * @return the name of the seat - */ -UWAC_API const char* UwacSeatGetName(const UwacSeat* seat); + /** + * + */ + UWAC_API UwacReturnCode UwacClipboardOfferDestroy(UwacSeat* seat); + UWAC_API UwacReturnCode UwacClipboardOfferCreate(UwacSeat* seat, const char* mime); + UWAC_API UwacReturnCode UwacClipboardOfferAnnounce(UwacSeat* seat, void* context, + UwacDataTransferHandler transfer, + UwacCancelDataTransferHandler cancel); + UWAC_API void* UwacClipboardDataGet(UwacSeat* seat, const char* mime, size_t* size); -/** - * returns the id of the given UwacSeat - * - * @param seat the UwacSeat - * @return the id of the seat - */ -UWAC_API UwacSeatId UwacSeatGetId(const UwacSeat* seat); + /** + * Inhibits or restores keyboard shortcuts. + * + * @param seat The UwacSeat to inhibit the shortcuts for + * @param inhibit Inhibit or restore keyboard shortcuts + * + * @return UWAC_SUCCESS or an appropriate error code. + */ + UWAC_API UwacReturnCode UwacSeatInhibitShortcuts(UwacSeat* seat, bool inhibit); -/** - * - */ -UWAC_API UwacReturnCode UwacClipboardOfferDestroy(UwacSeat* seat); -UWAC_API UwacReturnCode UwacClipboardOfferCreate(UwacSeat* seat, const char* mime); -UWAC_API UwacReturnCode UwacClipboardOfferAnnounce(UwacSeat* seat, - void* context, - UwacDataTransferHandler transfer, - UwacCancelDataTransferHandler cancel); -UWAC_API void* UwacClipboardDataGet(UwacSeat* seat, const char* mime, size_t* size); - -/** - * Inhibits or restores keyboard shortcuts. - * - * @param seat The UwacSeat to inhibit the shortcuts for - * @param inhibit Inhibit or restore keyboard shortcuts - * - * @return UWAC_SUCCESS or an appropriate error code. - */ -UWAC_API UwacReturnCode UwacSeatInhibitShortcuts(UwacSeat* seat, bool inhibit); - -/** - * @brief UwacSeatSetMouseCursor Sets the specified image as the new mouse cursor. - * Special values: If data == NULL && lenght == 0 - * the cursor is hidden, if data == NULL && length != 0 - * the default system cursor is used. - * - * @param seat The UwacSeat to apply the cursor image to - * @param data A pointer to the image data - * @param length The size of the image data - * @param width The image width in pixel - * @param height The image height in pixel - * @param hot_x The hotspot horizontal offset in pixel - * @param hot_y The hotspot vertical offset in pixel - * - * @return UWAC_SUCCESS if successful, an appropriate error otherwise. - */ -UWAC_API UwacReturnCode UwacSeatSetMouseCursor(UwacSeat* seat, const void* data, size_t length, - size_t width, size_t height, size_t hot_x, size_t hot_y); + /** + * @brief UwacSeatSetMouseCursor Sets the specified image as the new mouse cursor. + * Special values: If data == NULL && lenght == 0 + * the cursor is hidden, if data == NULL && length != 0 + * the default system cursor is used. + * + * @param seat The UwacSeat to apply the cursor image to + * @param data A pointer to the image data + * @param length The size of the image data + * @param width The image width in pixel + * @param height The image height in pixel + * @param hot_x The hotspot horizontal offset in pixel + * @param hot_y The hotspot vertical offset in pixel + * + * @return UWAC_SUCCESS if successful, an appropriate error otherwise. + */ + UWAC_API UwacReturnCode UwacSeatSetMouseCursor(UwacSeat* seat, const void* data, size_t length, + size_t width, size_t height, size_t hot_x, + size_t hot_y); #ifdef __cplusplus } diff --git a/uwac/libuwac/uwac-clipboard.c b/uwac/libuwac/uwac-clipboard.c index 03490a1ae..78d5bce01 100644 --- a/uwac/libuwac/uwac-clipboard.c +++ b/uwac/libuwac/uwac-clipboard.c @@ -43,8 +43,8 @@ static void data_offer_offer(void* data, struct wl_data_offer* data_offer, assert(seat); if (!seat->ignore_announcement) { - UwacClipboardEvent* event = (UwacClipboardEvent*)UwacDisplayNewEvent(seat->display, - UWAC_EVENT_CLIPBOARD_OFFER); + UwacClipboardEvent* event = + (UwacClipboardEvent*)UwacDisplayNewEvent(seat->display, UWAC_EVENT_CLIPBOARD_OFFER); if (!event) { @@ -59,10 +59,7 @@ static void data_offer_offer(void* data, struct wl_data_offer* data_offer, } } -static const struct wl_data_offer_listener data_offer_listener = -{ - .offer = data_offer_offer -}; +static const struct wl_data_offer_listener data_offer_listener = { .offer = data_offer_offer }; static void data_device_data_offer(void* data, struct wl_data_device* data_device, struct wl_data_offer* data_offer) @@ -72,8 +69,8 @@ static void data_device_data_offer(void* data, struct wl_data_device* data_devic assert(seat); if (!seat->ignore_announcement) { - UwacClipboardEvent* event = (UwacClipboardEvent*)UwacDisplayNewEvent(seat->display, - UWAC_EVENT_CLIPBOARD_SELECT); + UwacClipboardEvent* event = + (UwacClipboardEvent*)UwacDisplayNewEvent(seat->display, UWAC_EVENT_CLIPBOARD_SELECT); if (!event) { @@ -95,10 +92,8 @@ static void data_device_selection(void* data, struct wl_data_device* data_device { } -static const struct wl_data_device_listener data_device_listener = -{ - .data_offer = data_device_data_offer, - .selection = data_device_selection +static const struct wl_data_device_listener data_device_listener = { + .data_offer = data_device_data_offer, .selection = data_device_selection }; /* copy */ @@ -120,8 +115,7 @@ static void data_source_cancelled_handler(void* data, struct wl_data_source* dat seat->cancel_data(seat, seat->data_context); } -static const struct wl_data_source_listener data_source_listener = -{ +static const struct wl_data_source_listener data_source_listener = { .target = data_source_target_handler, .send = data_source_send_handler, .cancelled = data_source_cancelled_handler @@ -198,10 +192,7 @@ static void callback_done(void* data, struct wl_callback* callback, uint32_t ser *(uint32_t*)data = serial; } -static const struct wl_callback_listener callback_listener = -{ - .done = callback_done -}; +static const struct wl_callback_listener callback_listener = { .done = callback_done }; uint32_t get_serial(UwacSeat* s) { @@ -218,10 +209,9 @@ uint32_t get_serial(UwacSeat* s) return serial; } -UwacReturnCode UwacClipboardOfferAnnounce(UwacSeat* seat, - void* context, - UwacDataTransferHandler transfer, - UwacCancelDataTransferHandler cancel) +UwacReturnCode UwacClipboardOfferAnnounce(UwacSeat* seat, void* context, + UwacDataTransferHandler transfer, + UwacCancelDataTransferHandler cancel) { if (!seat) return UWAC_ERROR_INTERNAL; @@ -277,7 +267,7 @@ void* UwacClipboardDataGet(UwacSeat* seat, const char* mime, size_t* size) close(pipefd[0]); return NULL; } - } while(r > 0); + } while (r > 0); close(pipefd[0]); close(pipefd[1]); diff --git a/uwac/libuwac/uwac-display.c b/uwac/libuwac/uwac-display.c index 41c9d2cd6..4784b5374 100644 --- a/uwac/libuwac/uwac-display.c +++ b/uwac/libuwac/uwac-display.c @@ -42,28 +42,11 @@ #define TARGET_SEAT_INTERFACE 5U #define TARGET_XDG_VERSION 5U /* The version of xdg-shell that we implement */ -static const char* event_names[] = -{ - "new seat", - "removed seat", - "new output", - "configure", - "pointer enter", - "pointer leave", - "pointer motion", - "pointer buttons", - "pointer axis", - "keyboard enter", - "key", - "touch frame begin", - "touch up", - "touch down", - "touch motion", - "touch cancel", - "touch frame end", - "frame done", - "close", - NULL +static const char* event_names[] = { + "new seat", "removed seat", "new output", "configure", "pointer enter", + "pointer leave", "pointer motion", "pointer buttons", "pointer axis", "keyboard enter", + "key", "touch frame begin", "touch up", "touch down", "touch motion", + "touch cancel", "touch frame end", "frame done", "close", NULL }; bool uwac_default_error_handler(UwacDisplay* display, UwacReturnCode code, const char* msg, ...) @@ -85,7 +68,6 @@ void UwacInstallErrorHandler(UwacErrorHandler handler) uwacErrorHandler = uwac_default_error_handler; } - static void cb_shm_format(void* data, struct wl_shm* wl_shm, uint32_t format) { UwacDisplay* d = data; @@ -94,45 +76,37 @@ static void cb_shm_format(void* data, struct wl_shm* wl_shm, uint32_t format) d->has_rgb565 = true; d->shm_formats_nb++; - d->shm_formats = xrealloc((void*)d->shm_formats, sizeof(enum wl_shm_format) * d->shm_formats_nb); + d->shm_formats = + xrealloc((void*)d->shm_formats, sizeof(enum wl_shm_format) * d->shm_formats_nb); d->shm_formats[d->shm_formats_nb - 1] = format; } +struct wl_shm_listener shm_listener = { cb_shm_format }; -struct wl_shm_listener shm_listener = -{ - cb_shm_format -}; - -static void xdg_shell_ping(void *data, - struct xdg_wm_base *xdg_wm_base, - uint32_t serial) +static void xdg_shell_ping(void* data, struct xdg_wm_base* xdg_wm_base, uint32_t serial) { xdg_wm_base_pong(xdg_wm_base, serial); } -static const struct xdg_wm_base_listener xdg_wm_base_listener = -{ +static const struct xdg_wm_base_listener xdg_wm_base_listener = { xdg_shell_ping, }; #ifdef BUILD_FULLSCREEN_SHELL -static void fullscreen_capability(void *data, - struct zwp_fullscreen_shell_v1 *zwp_fullscreen_shell_v1, - uint32_t capability) +static void fullscreen_capability(void* data, + struct zwp_fullscreen_shell_v1* zwp_fullscreen_shell_v1, + uint32_t capability) { } -static const struct zwp_fullscreen_shell_v1_listener fullscreen_shell_listener = -{ +static const struct zwp_fullscreen_shell_v1_listener fullscreen_shell_listener = { fullscreen_capability, }; #endif - static void display_destroy_seat(UwacDisplay* d, uint32_t name) { - UwacSeat* seat, *tmp; + UwacSeat *seat, *tmp; wl_list_for_each_safe(seat, tmp, &d->seats, link) { if (seat->seat_id == name) @@ -142,14 +116,15 @@ static void display_destroy_seat(UwacDisplay* d, uint32_t name) } } -static void UwacSeatRegisterDDM(UwacSeat *seat) +static void UwacSeatRegisterDDM(UwacSeat* seat) { - UwacDisplay *d = seat->display; + UwacDisplay* d = seat->display; if (!d->data_device_manager) return; if (!seat->data_device) - seat->data_device = wl_data_device_manager_get_data_device(d->data_device_manager, seat->seat); + seat->data_device = + wl_data_device_manager_get_data_device(d->data_device_manager, seat->seat); } static void UwacRegisterCursor(UwacSeat* seat) @@ -165,7 +140,7 @@ static void registry_handle_global(void* data, struct wl_registry* registry, uin { UwacDisplay* d = data; UwacGlobal* global; - global = xzalloc(sizeof * global); + global = xzalloc(sizeof *global); global->name = id; global->interface = xstrdup(interface); global->version = version; @@ -178,7 +153,8 @@ static void registry_handle_global(void* data, struct wl_registry* registry, uin } else if (strcmp(interface, "wl_shm") == 0) { - d->shm = wl_registry_bind(registry, id, &wl_shm_interface, min(TARGET_SHM_INTERFACE, version)); + d->shm = + wl_registry_bind(registry, id, &wl_shm_interface, min(TARGET_SHM_INTERFACE, version)); wl_shm_add_listener(d->shm, &shm_listener, d); } else if (strcmp(interface, "wl_output") == 0) @@ -225,10 +201,10 @@ static void registry_handle_global(void* data, struct wl_registry* registry, uin } else if (strcmp(interface, "wl_data_device_manager") == 0) { - UwacSeat* seat, *tmp; + UwacSeat *seat, *tmp; d->data_device_manager = wl_registry_bind(registry, id, &wl_data_device_manager_interface, - min(TARGET_DDM_INTERFACE, version)); + min(TARGET_DDM_INTERFACE, version)); wl_list_for_each_safe(seat, tmp, &d->seats, link) { @@ -239,8 +215,8 @@ static void registry_handle_global(void* data, struct wl_registry* registry, uin } else if (strcmp(interface, "wl_shell") == 0) { - d->shell = wl_registry_bind(registry, id, &wl_shell_interface, min(TARGET_SHELL_INTERFACE, - version)); + d->shell = wl_registry_bind(registry, id, &wl_shell_interface, + min(TARGET_SHELL_INTERFACE, version)); } else if (strcmp(interface, "xdg_wm_base") == 0) { @@ -249,7 +225,8 @@ static void registry_handle_global(void* data, struct wl_registry* registry, uin } else if (strcmp(interface, "zwp_keyboard_shortcuts_inhibit_manager_v1") == 0) { - d->keyboard_inhibit_manager = wl_registry_bind(registry, id, &zwp_keyboard_shortcuts_inhibit_manager_v1_interface, 1); + d->keyboard_inhibit_manager = + wl_registry_bind(registry, id, &zwp_keyboard_shortcuts_inhibit_manager_v1_interface, 1); } else if (strcmp(interface, "zxdg_decoration_manager_v1") == 0) { @@ -257,7 +234,8 @@ static void registry_handle_global(void* data, struct wl_registry* registry, uin } else if (strcmp(interface, "org_kde_kwin_server_decoration_manager") == 0) { - d->kde_deco_manager = wl_registry_bind(registry, id, &org_kde_kwin_server_decoration_manager_interface, 1); + d->kde_deco_manager = + wl_registry_bind(registry, id, &org_kde_kwin_server_decoration_manager_interface, 1); } #if BUILD_IVI else if (strcmp(interface, "ivi_application") == 0) @@ -333,12 +311,8 @@ void* display_bind(UwacDisplay* display, uint32_t name, const struct wl_interfac return wl_registry_bind(display->registry, name, interface, version); } -static const struct wl_registry_listener registry_listener = -{ - registry_handle_global, - registry_handle_global_remove -}; - +static const struct wl_registry_listener registry_listener = { registry_handle_global, + registry_handle_global_remove }; int UwacDisplayWatchFd(UwacDisplay* display, int fd, uint32_t events, UwacTask* task) { @@ -400,7 +374,6 @@ static void display_dispatch_events(UwacTask* task, uint32_t events) } } - UwacDisplay* UwacOpenDisplay(const char* name, UwacReturnCode* err) { UwacDisplay* ret; @@ -446,7 +419,8 @@ UwacDisplay* UwacOpenDisplay(const char* name, UwacReturnCode* err) if ((wl_display_roundtrip(ret->display) < 0) || (wl_display_roundtrip(ret->display) < 0)) { - uwacErrorHandler(ret, UWAC_ERROR_UNABLE_TO_CONNECT, "Failed to process Wayland connection: %m\n"); + uwacErrorHandler(ret, UWAC_ERROR_UNABLE_TO_CONNECT, + "Failed to process Wayland connection: %m\n"); *err = UWAC_ERROR_UNABLE_TO_CONNECT; goto out_free_registry; } @@ -509,8 +483,6 @@ int UwacDisplayDispatch(UwacDisplay* display, int timeout) return 1; } - - UwacReturnCode UwacDisplayGetLastError(const UwacDisplay* display) { return display->last_error; @@ -519,10 +491,10 @@ UwacReturnCode UwacDisplayGetLastError(const UwacDisplay* display) UwacReturnCode UwacCloseDisplay(UwacDisplay** pdisplay) { UwacDisplay* display; - UwacSeat* seat, *tmpSeat; - UwacWindow* window, *tmpWindow; - UwacOutput* output, *tmpOutput; - UwacGlobal* global, *tmpGlobal; + UwacSeat *seat, *tmpSeat; + UwacWindow *window, *tmpWindow; + UwacOutput *output, *tmpOutput; + UwacGlobal *global, *tmpGlobal; assert(pdisplay); display = *pdisplay; @@ -616,8 +588,7 @@ int UwacDisplayGetFd(UwacDisplay* display) return display->epoll_fd; } -static const char* errorStrings[] = -{ +static const char* errorStrings[] = { "success", "out of memory error", "unable to connect to wayland display", @@ -639,9 +610,9 @@ const char* UwacErrorString(UwacReturnCode error) } UwacReturnCode UwacDisplayQueryInterfaceVersion(const UwacDisplay* display, const char* name, - uint32_t* version) + uint32_t* version) { - const UwacGlobal* global, *tmp; + const UwacGlobal *global, *tmp; if (!display) return UWAC_ERROR_INVALID_DISPLAY; @@ -676,9 +647,8 @@ uint32_t UwacDisplayQueryGetNbShmFormats(UwacDisplay* display) return display->shm_formats_nb; } - UwacReturnCode UwacDisplayQueryShmFormats(const UwacDisplay* display, enum wl_shm_format* formats, - int formats_size, int* filled) + int formats_size, int* filled) { if (!display) return UWAC_ERROR_INVALID_DISPLAY; @@ -720,7 +690,6 @@ UwacReturnCode UwacOutputGetResolution(UwacOutput* output, UwacSize* resolution) return UWAC_SUCCESS; } - UwacEvent* UwacDisplayNewEvent(UwacDisplay* display, int type) { UwacEventListItem* ret; diff --git a/uwac/libuwac/uwac-input.c b/uwac/libuwac/uwac-input.c index 34fae49c2..ac9294ea7 100644 --- a/uwac/libuwac/uwac-input.c +++ b/uwac/libuwac/uwac-input.c @@ -64,11 +64,9 @@ static struct wl_buffer* create_pointer_buffer(UwacSeat* seat, const void* src, goto error_mmap; } - buffer = wl_shm_pool_create_buffer(pool, 0, - seat->pointer_image->width, - seat->pointer_image->height, - seat->pointer_image->width * 4, - WL_SHM_FORMAT_ARGB8888); + buffer = + wl_shm_pool_create_buffer(pool, 0, seat->pointer_image->width, seat->pointer_image->height, + seat->pointer_image->width * 4, WL_SHM_FORMAT_ARGB8888); wl_shm_pool_destroy(pool); error_mmap: @@ -76,17 +74,15 @@ error_mmap: return buffer; } -static void on_buffer_release(void *data, struct wl_buffer *wl_buffer) { +static void on_buffer_release(void* data, struct wl_buffer* wl_buffer) +{ (void)data; wl_buffer_destroy(wl_buffer); } -const struct wl_buffer_listener buffer_release_listener = { - on_buffer_release -}; +const struct wl_buffer_listener buffer_release_listener = { on_buffer_release }; -static UwacReturnCode -set_cursor_image(UwacSeat* seat, uint32_t serial) +static UwacReturnCode set_cursor_image(UwacSeat* seat, uint32_t serial) { struct wl_buffer* buffer = NULL; struct wl_cursor* cursor; @@ -97,7 +93,8 @@ set_cursor_image(UwacSeat* seat, uint32_t serial) if (!seat || !seat->display || !seat->default_cursor || !seat->default_cursor->images) return UWAC_ERROR_INTERNAL; - switch(seat->pointer_type) { + switch (seat->pointer_type) + { case 2: /* Custom poiner */ image = seat->pointer_image; buffer = create_pointer_buffer(seat, seat->pointer_data, seat->pointer_size); @@ -128,25 +125,22 @@ set_cursor_image(UwacSeat* seat, uint32_t serial) if (buffer) wl_buffer_add_listener(buffer, &buffer_release_listener, seat); - if (surface) { + if (surface) + { wl_surface_attach(surface, buffer, -x, -y); - wl_surface_damage(surface, 0, 0, - image->width, image->height); + wl_surface_damage(surface, 0, 0, image->width, image->height); wl_surface_commit(surface); } - wl_pointer_set_cursor(seat->pointer, - serial, - surface, - x, y); + wl_pointer_set_cursor(seat->pointer, serial, surface, x, y); return UWAC_SUCCESS; } -static void keyboard_repeat_func(UwacTask *task, uint32_t events) +static void keyboard_repeat_func(UwacTask* task, uint32_t events) { - UwacSeat *input = container_of(task, UwacSeat, repeat_task); - UwacWindow *window = input->keyboard_focus; + UwacSeat* input = container_of(task, UwacSeat, repeat_task); + UwacWindow* window = input->keyboard_focus; uint64_t exp; if (read(input->repeat_timer_fd, &exp, sizeof exp) != sizeof exp) @@ -155,10 +149,11 @@ static void keyboard_repeat_func(UwacTask *task, uint32_t events) * read and we get EAGAIN. */ return; - if (window) { - UwacKeyEvent *key; + if (window) + { + UwacKeyEvent* key; - key = (UwacKeyEvent *)UwacDisplayNewEvent(input->display, UWAC_EVENT_KEY); + key = (UwacKeyEvent*)UwacDisplayNewEvent(input->display, UWAC_EVENT_KEY); if (!key) return; @@ -166,24 +161,25 @@ static void keyboard_repeat_func(UwacTask *task, uint32_t events) key->sym = input->repeat_sym; key->pressed = true; } - } -static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, - uint32_t format, int fd, uint32_t size) +static void keyboard_handle_keymap(void* data, struct wl_keyboard* keyboard, uint32_t format, + int fd, uint32_t size) { - UwacSeat *input = data; - struct xkb_keymap *keymap; - struct xkb_state *state; - char *map_str; + UwacSeat* input = data; + struct xkb_keymap* keymap; + struct xkb_state* state; + char* map_str; int mapFlags = MAP_SHARED; - if (!data) { + if (!data) + { close(fd); return; } - if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { + if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) + { close(fd); return; } @@ -192,7 +188,8 @@ static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, mapFlags = MAP_PRIVATE; map_str = mmap(NULL, size, PROT_READ, mapFlags, fd, 0); - if (map_str == MAP_FAILED) { + if (map_str == MAP_FAILED) + { close(fd); return; } @@ -201,14 +198,17 @@ static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, munmap(map_str, size); close(fd); - if (!keymap) { + if (!keymap) + { assert(uwacErrorHandler(input->display, UWAC_ERROR_INTERNAL, "failed to compile keymap\n")); return; } state = xkb_state_new(keymap); - if (!state) { - assert(uwacErrorHandler(input->display, UWAC_ERROR_NOMEMORY, "failed to create XKB state\n")); + if (!state) + { + assert( + uwacErrorHandler(input->display, UWAC_ERROR_NOMEMORY, "failed to create XKB state\n")); xkb_keymap_unref(keymap); return; } @@ -220,59 +220,68 @@ static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, input->xkb.control_mask = 1 << xkb_keymap_mod_get_index(input->xkb.keymap, "Control"); input->xkb.alt_mask = 1 << xkb_keymap_mod_get_index(input->xkb.keymap, "Mod1"); - input->xkb.shift_mask = 1 << xkb_keymap_mod_get_index(input->xkb.keymap, "Shift"); + input->xkb.shift_mask = 1 << xkb_keymap_mod_get_index(input->xkb.keymap, "Shift"); } -static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, - uint32_t serial, uint32_t time, uint32_t key, - uint32_t state_w); +static void keyboard_handle_key(void* data, struct wl_keyboard* keyboard, uint32_t serial, + uint32_t time, uint32_t key, uint32_t state_w); -static void keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, uint32_t serial, - struct wl_surface *surface, struct wl_array *keys) +static void keyboard_handle_enter(void* data, struct wl_keyboard* keyboard, uint32_t serial, + struct wl_surface* surface, struct wl_array* keys) { uint32_t *key, *pressedKey; - UwacSeat *input = (UwacSeat *)data; + UwacSeat* input = (UwacSeat*)data; size_t i, found; - UwacKeyboardEnterLeaveEvent *event; + UwacKeyboardEnterLeaveEvent* event; - event = (UwacKeyboardEnterLeaveEvent *)UwacDisplayNewEvent(input->display, UWAC_EVENT_KEYBOARD_ENTER); + event = (UwacKeyboardEnterLeaveEvent*)UwacDisplayNewEvent(input->display, + UWAC_EVENT_KEYBOARD_ENTER); if (!event) return; - event->window = input->keyboard_focus = (UwacWindow *)wl_surface_get_user_data(surface); + event->window = input->keyboard_focus = (UwacWindow*)wl_surface_get_user_data(surface); event->seat = input; /* look for keys that have been released */ found = false; - for (pressedKey = input->pressed_keys.data, i = 0; i < input->pressed_keys.size; i += sizeof(uint32_t)) { - wl_array_for_each(key, keys) { - if (*key == *pressedKey) { + for (pressedKey = input->pressed_keys.data, i = 0; i < input->pressed_keys.size; + i += sizeof(uint32_t)) + { + wl_array_for_each(key, keys) + { + if (*key == *pressedKey) + { found = true; break; } } - if (!found) { - keyboard_handle_key(data, keyboard, serial, 0, *pressedKey, WL_KEYBOARD_KEY_STATE_RELEASED); - } else { + if (!found) + { + keyboard_handle_key(data, keyboard, serial, 0, *pressedKey, + WL_KEYBOARD_KEY_STATE_RELEASED); + } + else + { pressedKey++; } } /* handle keys that are now pressed */ - wl_array_for_each(key, keys) { + wl_array_for_each(key, keys) + { keyboard_handle_key(data, keyboard, serial, 0, *key, WL_KEYBOARD_KEY_STATE_PRESSED); } } -static void keyboard_handle_leave(void *data, struct wl_keyboard *keyboard, uint32_t serial, - struct wl_surface *surface) +static void keyboard_handle_leave(void* data, struct wl_keyboard* keyboard, uint32_t serial, + struct wl_surface* surface) { struct itimerspec its; - UwacSeat *input; - UwacPointerEnterLeaveEvent *event; + UwacSeat* input; + UwacPointerEnterLeaveEvent* event; - input = (UwacSeat *)data; + input = (UwacSeat*)data; its.it_interval.tv_sec = 0; its.it_interval.tv_nsec = 0; @@ -280,18 +289,21 @@ static void keyboard_handle_leave(void *data, struct wl_keyboard *keyboard, uint its.it_value.tv_nsec = 0; timerfd_settime(input->repeat_timer_fd, 0, &its, NULL); - event = (UwacPointerEnterLeaveEvent *)UwacDisplayNewEvent(input->display, UWAC_EVENT_POINTER_LEAVE); + event = + (UwacPointerEnterLeaveEvent*)UwacDisplayNewEvent(input->display, UWAC_EVENT_POINTER_LEAVE); if (!event) return; event->window = input->keyboard_focus; } -static int update_key_pressed(UwacSeat *seat, uint32_t key) { - uint32_t *keyPtr; +static int update_key_pressed(UwacSeat* seat, uint32_t key) +{ + uint32_t* keyPtr; /* check if the key is not already pressed */ - wl_array_for_each(keyPtr, &seat->pressed_keys) { + wl_array_for_each(keyPtr, &seat->pressed_keys) + { if (*keyPtr == key) return 1; } @@ -304,40 +316,42 @@ static int update_key_pressed(UwacSeat *seat, uint32_t key) { return 0; } -static int update_key_released(UwacSeat *seat, uint32_t key) { - uint32_t *keyPtr; +static int update_key_released(UwacSeat* seat, uint32_t key) +{ + uint32_t* keyPtr; size_t i, toMove; bool found = false; - for (i = 0, keyPtr = seat->pressed_keys.data; i < seat->pressed_keys.size; i++, keyPtr++) { - if (*keyPtr == key) { + for (i = 0, keyPtr = seat->pressed_keys.data; i < seat->pressed_keys.size; i++, keyPtr++) + { + if (*keyPtr == key) + { found = true; break; } } - if (found) { + if (found) + { toMove = seat->pressed_keys.size - ((i + 1) * sizeof(uint32_t)); if (toMove) - memmove(keyPtr, keyPtr+1, toMove); + memmove(keyPtr, keyPtr + 1, toMove); seat->pressed_keys.size -= sizeof(uint32_t); } return 1; - } -static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, - uint32_t serial, uint32_t time, uint32_t key, - uint32_t state_w) +static void keyboard_handle_key(void* data, struct wl_keyboard* keyboard, uint32_t serial, + uint32_t time, uint32_t key, uint32_t state_w) { - UwacSeat *input = (UwacSeat *)data; - UwacWindow *window = input->keyboard_focus; - UwacKeyEvent *keyEvent; + UwacSeat* input = (UwacSeat*)data; + UwacWindow* window = input->keyboard_focus; + UwacKeyEvent* keyEvent; uint32_t code, num_syms; enum wl_keyboard_key_state state = state_w; - const xkb_keysym_t *syms; + const xkb_keysym_t* syms; xkb_keysym_t sym; struct itimerspec its; @@ -357,7 +371,7 @@ static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, * properly handle key grabs. In the meantime, this prevents * key event delivery while a grab is active. */ /*if (input->grab && input->grab_button == 0) - return;*/ + return;*/ num_syms = xkb_state_key_get_syms(input->xkb.state, code, &syms); @@ -365,13 +379,17 @@ static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, if (num_syms == 1) sym = syms[0]; - if (state == WL_KEYBOARD_KEY_STATE_RELEASED && key == input->repeat_key) { + if (state == WL_KEYBOARD_KEY_STATE_RELEASED && key == input->repeat_key) + { its.it_interval.tv_sec = 0; its.it_interval.tv_nsec = 0; its.it_value.tv_sec = 0; its.it_value.tv_nsec = 0; timerfd_settime(input->repeat_timer_fd, 0, &its, NULL); - } else if (state == WL_KEYBOARD_KEY_STATE_PRESSED && xkb_keymap_key_repeats(input->xkb.keymap, code)) { + } + else if (state == WL_KEYBOARD_KEY_STATE_PRESSED && + xkb_keymap_key_repeats(input->xkb.keymap, code)) + { input->repeat_sym = sym; input->repeat_key = key; input->repeat_time = time; @@ -382,20 +400,21 @@ static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, timerfd_settime(input->repeat_timer_fd, 0, &its, NULL); } - keyEvent = (UwacKeyEvent *)UwacDisplayNewEvent(input->display, UWAC_EVENT_KEY); + keyEvent = (UwacKeyEvent*)UwacDisplayNewEvent(input->display, UWAC_EVENT_KEY); if (!keyEvent) return; keyEvent->window = window; - keyEvent->sym = sym; + keyEvent->sym = sym; keyEvent->raw_key = key; keyEvent->pressed = (state == WL_KEYBOARD_KEY_STATE_PRESSED); } -static void keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, uint32_t serial, - uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) +static void keyboard_handle_modifiers(void* data, struct wl_keyboard* keyboard, uint32_t serial, + uint32_t mods_depressed, uint32_t mods_latched, + uint32_t mods_locked, uint32_t group) { - UwacSeat *input = data; + UwacSeat* input = data; xkb_mod_mask_t mask; /* If we're not using a keymap, then we don't handle PC-style modifiers */ @@ -403,7 +422,8 @@ static void keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, return; xkb_state_update_mask(input->xkb.state, mods_depressed, mods_latched, mods_locked, 0, 0, group); - mask = xkb_state_serialize_mods(input->xkb.state, XKB_STATE_MODS_DEPRESSED | XKB_STATE_MODS_LATCHED); + mask = xkb_state_serialize_mods(input->xkb.state, + XKB_STATE_MODS_DEPRESSED | XKB_STATE_MODS_LATCHED); input->modifiers = 0; if (mask & input->xkb.control_mask) input->modifiers |= UWAC_MOD_CONTROL_MASK; @@ -413,7 +433,7 @@ static void keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, input->modifiers |= UWAC_MOD_SHIFT_MASK; } -static void set_repeat_info(UwacSeat *input, int32_t rate, int32_t delay) +static void set_repeat_info(UwacSeat* input, int32_t rate, int32_t delay) { input->repeat_rate_sec = input->repeat_rate_nsec = 0; input->repeat_delay_sec = input->repeat_delay_nsec = 0; @@ -433,28 +453,24 @@ static void set_repeat_info(UwacSeat *input, int32_t rate, int32_t delay) input->repeat_delay_nsec = delay * 1000 * 1000; } - -static void keyboard_handle_repeat_info(void *data, struct wl_keyboard *keyboard, - int32_t rate, int32_t delay) +static void keyboard_handle_repeat_info(void* data, struct wl_keyboard* keyboard, int32_t rate, + int32_t delay) { - UwacSeat *input = data; + UwacSeat* input = data; set_repeat_info(input, rate, delay); } static const struct wl_keyboard_listener keyboard_listener = { - keyboard_handle_keymap, - keyboard_handle_enter, - keyboard_handle_leave, - keyboard_handle_key, - keyboard_handle_modifiers, - keyboard_handle_repeat_info + keyboard_handle_keymap, keyboard_handle_enter, keyboard_handle_leave, + keyboard_handle_key, keyboard_handle_modifiers, keyboard_handle_repeat_info }; -static bool touch_send_start_frame(UwacSeat *seat) { - UwacTouchFrameBegin *ev; +static bool touch_send_start_frame(UwacSeat* seat) +{ + UwacTouchFrameBegin* ev; - ev = (UwacTouchFrameBegin *)UwacDisplayNewEvent(seat->display, UWAC_EVENT_TOUCH_FRAME_BEGIN); + ev = (UwacTouchFrameBegin*)UwacDisplayNewEvent(seat->display, UWAC_EVENT_TOUCH_FRAME_BEGIN); if (!ev) return false; @@ -462,18 +478,18 @@ static bool touch_send_start_frame(UwacSeat *seat) { return true; } -static void touch_handle_down(void *data, struct wl_touch *wl_touch, - uint32_t serial, uint32_t time, struct wl_surface *surface, - int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) +static void touch_handle_down(void* data, struct wl_touch* wl_touch, uint32_t serial, uint32_t time, + struct wl_surface* surface, int32_t id, wl_fixed_t x_w, + wl_fixed_t y_w) { - UwacSeat *seat = data; - UwacTouchDown *tdata; + UwacSeat* seat = data; + UwacTouchDown* tdata; seat->display->serial = serial; if (!seat->touch_frame_started && !touch_send_start_frame(seat)) return; - tdata = (UwacTouchDown *)UwacDisplayNewEvent(seat->display, UWAC_EVENT_TOUCH_DOWN); + tdata = (UwacTouchDown*)UwacDisplayNewEvent(seat->display, UWAC_EVENT_TOUCH_DOWN); if (!tdata) return; @@ -525,23 +541,22 @@ static void touch_handle_down(void *data, struct wl_touch *wl_touch, #endif } -static void touch_handle_up(void *data, struct wl_touch *wl_touch, - uint32_t serial, uint32_t time, int32_t id) +static void touch_handle_up(void* data, struct wl_touch* wl_touch, uint32_t serial, uint32_t time, + int32_t id) { - UwacSeat *seat = data; - UwacTouchUp *tdata; + UwacSeat* seat = data; + UwacTouchUp* tdata; if (!seat->touch_frame_started && !touch_send_start_frame(seat)) return; - tdata = (UwacTouchUp *)UwacDisplayNewEvent(seat->display, UWAC_EVENT_TOUCH_UP); + tdata = (UwacTouchUp*)UwacDisplayNewEvent(seat->display, UWAC_EVENT_TOUCH_UP); if (!tdata) return; tdata->seat = seat; tdata->id = id; - #if 0 struct touch_point *tp, *tmp; @@ -567,16 +582,16 @@ static void touch_handle_up(void *data, struct wl_touch *wl_touch, #endif } -static void touch_handle_motion(void *data, struct wl_touch *wl_touch, - uint32_t time, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) +static void touch_handle_motion(void* data, struct wl_touch* wl_touch, uint32_t time, int32_t id, + wl_fixed_t x_w, wl_fixed_t y_w) { - UwacSeat *seat = data; - UwacTouchMotion *tdata; + UwacSeat* seat = data; + UwacTouchMotion* tdata; if (!seat->touch_frame_started && !touch_send_start_frame(seat)) return; - tdata = (UwacTouchMotion *)UwacDisplayNewEvent(seat->display, UWAC_EVENT_TOUCH_MOTION); + tdata = (UwacTouchMotion*)UwacDisplayNewEvent(seat->display, UWAC_EVENT_TOUCH_MOTION); if (!tdata) return; @@ -612,12 +627,12 @@ static void touch_handle_motion(void *data, struct wl_touch *wl_touch, #endif } -static void touch_handle_frame(void *data, struct wl_touch *wl_touch) +static void touch_handle_frame(void* data, struct wl_touch* wl_touch) { - UwacSeat *seat = data; - UwacTouchFrameEnd *ev; + UwacSeat* seat = data; + UwacTouchFrameEnd* ev; - ev = (UwacTouchFrameEnd *)UwacDisplayNewEvent(seat->display, UWAC_EVENT_TOUCH_FRAME_END); + ev = (UwacTouchFrameEnd*)UwacDisplayNewEvent(seat->display, UWAC_EVENT_TOUCH_FRAME_END); if (!ev) return; @@ -625,12 +640,12 @@ static void touch_handle_frame(void *data, struct wl_touch *wl_touch) seat->touch_frame_started = false; } -static void touch_handle_cancel(void *data, struct wl_touch *wl_touch) +static void touch_handle_cancel(void* data, struct wl_touch* wl_touch) { - UwacSeat *seat = data; - UwacTouchCancel *ev; + UwacSeat* seat = data; + UwacTouchCancel* ev; - ev = (UwacTouchCancel *)UwacDisplayNewEvent(seat->display, UWAC_EVENT_TOUCH_CANCEL); + ev = (UwacTouchCancel*)UwacDisplayNewEvent(seat->display, UWAC_EVENT_TOUCH_CANCEL); if (!ev) return; @@ -658,28 +673,26 @@ static void touch_handle_cancel(void *data, struct wl_touch *wl_touch) #endif } -static const struct wl_touch_listener touch_listener = { - touch_handle_down, - touch_handle_up, - touch_handle_motion, - touch_handle_frame, - touch_handle_cancel, - NULL, - NULL -}; +static const struct wl_touch_listener touch_listener = { touch_handle_down, + touch_handle_up, + touch_handle_motion, + touch_handle_frame, + touch_handle_cancel, + NULL, + NULL }; - -static void pointer_handle_enter(void *data, struct wl_pointer *pointer, uint32_t serial, - struct wl_surface *surface, wl_fixed_t sx_w, wl_fixed_t sy_w) +static void pointer_handle_enter(void* data, struct wl_pointer* pointer, uint32_t serial, + struct wl_surface* surface, wl_fixed_t sx_w, wl_fixed_t sy_w) { - UwacSeat *input = data; - UwacWindow *window; - UwacPointerEnterLeaveEvent *event; + UwacSeat* input = data; + UwacWindow* window; + UwacPointerEnterLeaveEvent* event; float sx = wl_fixed_to_double(sx_w); float sy = wl_fixed_to_double(sy_w); - if (!surface) { + if (!surface) + { /* enter event for a window we've just destroyed */ return; } @@ -692,7 +705,8 @@ static void pointer_handle_enter(void *data, struct wl_pointer *pointer, uint32_ input->sx = sx; input->sy = sy; - event = (UwacPointerEnterLeaveEvent *)UwacDisplayNewEvent(input->display, UWAC_EVENT_POINTER_ENTER); + event = + (UwacPointerEnterLeaveEvent*)UwacDisplayNewEvent(input->display, UWAC_EVENT_POINTER_ENTER); if (!event) return; @@ -701,21 +715,21 @@ static void pointer_handle_enter(void *data, struct wl_pointer *pointer, uint32_ event->x = sx; event->y = sy; - /* Apply cursor theme */ set_cursor_image(input, serial); } -static void pointer_handle_leave(void *data, struct wl_pointer *pointer, uint32_t serial, - struct wl_surface *surface) +static void pointer_handle_leave(void* data, struct wl_pointer* pointer, uint32_t serial, + struct wl_surface* surface) { - UwacPointerEnterLeaveEvent *event; - UwacWindow *window; - UwacSeat *input = data; + UwacPointerEnterLeaveEvent* event; + UwacWindow* window; + UwacSeat* input = data; input->display->serial = serial; - event = (UwacPointerEnterLeaveEvent *)UwacDisplayNewEvent(input->display, UWAC_EVENT_POINTER_LEAVE); + event = + (UwacPointerEnterLeaveEvent*)UwacDisplayNewEvent(input->display, UWAC_EVENT_POINTER_LEAVE); if (!event) return; @@ -725,12 +739,12 @@ static void pointer_handle_leave(void *data, struct wl_pointer *pointer, uint32_ event->window = window; } -static void pointer_handle_motion(void *data, struct wl_pointer *pointer, uint32_t time, - wl_fixed_t sx_w, wl_fixed_t sy_w) +static void pointer_handle_motion(void* data, struct wl_pointer* pointer, uint32_t time, + wl_fixed_t sx_w, wl_fixed_t sy_w) { - UwacPointerMotionEvent *motion_event; - UwacSeat *input = data; - UwacWindow *window = input->pointer_focus; + UwacPointerMotionEvent* motion_event; + UwacSeat* input = data; + UwacWindow* window = input->pointer_focus; float sx = wl_fixed_to_double(sx_w); float sy = wl_fixed_to_double(sy_w); @@ -741,7 +755,8 @@ static void pointer_handle_motion(void *data, struct wl_pointer *pointer, uint32 input->sx = sx; input->sy = sy; - motion_event = (UwacPointerMotionEvent *)UwacDisplayNewEvent(input->display, UWAC_EVENT_POINTER_MOTION); + motion_event = + (UwacPointerMotionEvent*)UwacDisplayNewEvent(input->display, UWAC_EVENT_POINTER_MOTION); if (!motion_event) return; @@ -751,16 +766,16 @@ static void pointer_handle_motion(void *data, struct wl_pointer *pointer, uint32 motion_event->y = wl_fixed_to_int(sy_w); } -static void pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial, - uint32_t time, uint32_t button, uint32_t state_w) +static void pointer_handle_button(void* data, struct wl_pointer* pointer, uint32_t serial, + uint32_t time, uint32_t button, uint32_t state_w) { - UwacPointerButtonEvent *event; - UwacSeat *seat = data; - UwacWindow *window = seat->pointer_focus; + UwacPointerButtonEvent* event; + UwacSeat* seat = data; + UwacWindow* window = seat->pointer_focus; seat->display->serial = serial; - event = (UwacPointerButtonEvent *)UwacDisplayNewEvent(seat->display, UWAC_EVENT_POINTER_BUTTONS); + event = (UwacPointerButtonEvent*)UwacDisplayNewEvent(seat->display, UWAC_EVENT_POINTER_BUTTONS); if (!event) return; @@ -772,17 +787,17 @@ static void pointer_handle_button(void *data, struct wl_pointer *pointer, uint32 event->state = (enum wl_pointer_button_state)state_w; } -static void pointer_handle_axis(void *data, struct wl_pointer *pointer, uint32_t time, - uint32_t axis, wl_fixed_t value) +static void pointer_handle_axis(void* data, struct wl_pointer* pointer, uint32_t time, + uint32_t axis, wl_fixed_t value) { - UwacPointerAxisEvent *event; - UwacSeat *seat = data; - UwacWindow *window = seat->pointer_focus; + UwacPointerAxisEvent* event; + UwacSeat* seat = data; + UwacWindow* window = seat->pointer_focus; if (!window) return; - event = (UwacPointerAxisEvent *)UwacDisplayNewEvent(seat->display, UWAC_EVENT_POINTER_AXIS); + event = (UwacPointerAxisEvent*)UwacDisplayNewEvent(seat->display, UWAC_EVENT_POINTER_AXIS); if (!event) return; @@ -794,62 +809,62 @@ static void pointer_handle_axis(void *data, struct wl_pointer *pointer, uint32_t event->value = value; } -static void pointer_frame(void *data, struct wl_pointer *wl_pointer) +static void pointer_frame(void* data, struct wl_pointer* wl_pointer) { /*UwacSeat *seat = data;*/ } -static void pointer_axis_source(void *data, struct wl_pointer *wl_pointer, uint32_t axis_source) +static void pointer_axis_source(void* data, struct wl_pointer* wl_pointer, uint32_t axis_source) { /*UwacSeat *seat = data;*/ } -static void pointer_axis_stop(void *data, struct wl_pointer *wl_pointer, uint32_t time, uint32_t axis) +static void pointer_axis_stop(void* data, struct wl_pointer* wl_pointer, uint32_t time, + uint32_t axis) { /*UwacSeat *seat = data;*/ } -static void pointer_axis_discrete(void *data, struct wl_pointer *wl_pointer, uint32_t axis, int32_t discrete) +static void pointer_axis_discrete(void* data, struct wl_pointer* wl_pointer, uint32_t axis, + int32_t discrete) { /*UwacSeat *seat = data;*/ } static const struct wl_pointer_listener pointer_listener = { - pointer_handle_enter, - pointer_handle_leave, - pointer_handle_motion, - pointer_handle_button, - pointer_handle_axis, - pointer_frame, - pointer_axis_source, - pointer_axis_stop, - pointer_axis_discrete, + pointer_handle_enter, pointer_handle_leave, pointer_handle_motion, + pointer_handle_button, pointer_handle_axis, pointer_frame, + pointer_axis_source, pointer_axis_stop, pointer_axis_discrete, }; - - -static void seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps) +static void seat_handle_capabilities(void* data, struct wl_seat* seat, enum wl_seat_capability caps) { - UwacSeat *input = data; + UwacSeat* input = data; - if ((caps & WL_SEAT_CAPABILITY_POINTER) && !input->pointer) { + if ((caps & WL_SEAT_CAPABILITY_POINTER) && !input->pointer) + { input->pointer = wl_seat_get_pointer(seat); wl_pointer_set_user_data(input->pointer, input); wl_pointer_add_listener(input->pointer, &pointer_listener, input); input->cursor_theme = wl_cursor_theme_load(NULL, 32, input->display->shm); - if (!input->cursor_theme) { - assert(uwacErrorHandler(input->display, UWAC_ERROR_NOMEMORY, "unable to get wayland cursor theme\n")); + if (!input->cursor_theme) + { + assert(uwacErrorHandler(input->display, UWAC_ERROR_NOMEMORY, + "unable to get wayland cursor theme\n")); return; } input->default_cursor = wl_cursor_theme_get_cursor(input->cursor_theme, "left_ptr"); - if (!input->default_cursor) { - assert(uwacErrorHandler(input->display, UWAC_ERROR_NOMEMORY, "unable to get wayland cursor left_ptr\n")); + if (!input->default_cursor) + { + assert(uwacErrorHandler(input->display, UWAC_ERROR_NOMEMORY, + "unable to get wayland cursor left_ptr\n")); return; } - - } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && input->pointer) { + } + else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && input->pointer) + { #ifdef WL_POINTER_RELEASE_SINCE_VERSION if (input->seat_version >= WL_POINTER_RELEASE_SINCE_VERSION) wl_pointer_release(input->pointer); @@ -864,11 +879,14 @@ static void seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_s input->pointer = NULL; } - if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !input->keyboard) { + if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !input->keyboard) + { input->keyboard = wl_seat_get_keyboard(seat); wl_keyboard_set_user_data(input->keyboard, input); wl_keyboard_add_listener(input->keyboard, &keyboard_listener, input); - } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && input->keyboard) { + } + else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && input->keyboard) + { #ifdef WL_KEYBOARD_RELEASE_SINCE_VERSION if (input->seat_version >= WL_KEYBOARD_RELEASE_SINCE_VERSION) wl_keyboard_release(input->keyboard); @@ -878,11 +896,14 @@ static void seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_s input->keyboard = NULL; } - if ((caps & WL_SEAT_CAPABILITY_TOUCH) && !input->touch) { + if ((caps & WL_SEAT_CAPABILITY_TOUCH) && !input->touch) + { input->touch = wl_seat_get_touch(seat); wl_touch_set_user_data(input->touch, input); wl_touch_add_listener(input->touch, &touch_listener, input); - } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && input->touch) { + } + else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && input->touch) + { #ifdef WL_TOUCH_RELEASE_SINCE_VERSION if (input->seat_version >= WL_TOUCH_RELEASE_SINCE_VERSION) wl_touch_release(input->touch); @@ -893,16 +914,16 @@ static void seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_s } } -static void -seat_handle_name(void *data, struct wl_seat *seat, const char *name) +static void seat_handle_name(void* data, struct wl_seat* seat, const char* name) { - UwacSeat *input = data; + UwacSeat* input = data; if (input->name) free(input->name); input->name = strdup(name); if (!input->name) - assert(uwacErrorHandler(input->display, UWAC_ERROR_NOMEMORY, "unable to strdup seat's name\n")); + assert(uwacErrorHandler(input->display, UWAC_ERROR_NOMEMORY, + "unable to strdup seat's name\n")); } static const struct wl_seat_listener seat_listener = { @@ -910,9 +931,9 @@ static const struct wl_seat_listener seat_listener = { seat_handle_name, }; - -UwacSeat *UwacSeatNew(UwacDisplay *d, uint32_t id, uint32_t version) { - UwacSeat *ret; +UwacSeat* UwacSeatNew(UwacDisplay* d, uint32_t id, uint32_t version) +{ + UwacSeat* ret; ret = xzalloc(sizeof(UwacSeat)); ret->display = d; @@ -921,7 +942,8 @@ UwacSeat *UwacSeatNew(UwacDisplay *d, uint32_t id, uint32_t version) { wl_array_init(&ret->pressed_keys); ret->xkb_context = xkb_context_new(0); - if (!ret->xkb_context) { + if (!ret->xkb_context) + { fprintf(stderr, "%s: unable to allocate a xkb_context\n", __FUNCTION__); goto error_xkb_context; } @@ -931,12 +953,14 @@ UwacSeat *UwacSeatNew(UwacDisplay *d, uint32_t id, uint32_t version) { wl_seat_set_user_data(ret->seat, ret); ret->repeat_timer_fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK); - if (ret->repeat_timer_fd < 0) { + if (ret->repeat_timer_fd < 0) + { fprintf(stderr, "%s: error creating repeat timer\n", __FUNCTION__); goto error_timer_fd; } ret->repeat_task.run = keyboard_repeat_func; - if (UwacDisplayWatchFd(d, ret->repeat_timer_fd, EPOLLIN, &ret->repeat_task) < 0) { + if (UwacDisplayWatchFd(d, ret->repeat_timer_fd, EPOLLIN, &ret->repeat_task) < 0) + { fprintf(stderr, "%s: error polling repeat timer\n", __FUNCTION__); goto error_watch_timerfd; } @@ -953,10 +977,11 @@ error_xkb_context: return NULL; } - -void UwacSeatDestroy(UwacSeat *s) { +void UwacSeatDestroy(UwacSeat* s) +{ UwacSeatInhibitShortcuts(s, false); - if (s->seat) { + if (s->seat) + { #ifdef WL_SEAT_RELEASE_SINCE_VERSION if (s->seat_version >= WL_SEAT_RELEASE_SINCE_VERSION) wl_seat_release(s->seat); @@ -972,7 +997,8 @@ void UwacSeatDestroy(UwacSeat *s) { xkb_state_unref(s->xkb.state); xkb_context_unref(s->xkb_context); - if (s->pointer) { + if (s->pointer) + { #ifdef WL_POINTER_RELEASE_SINCE_VERSION if (s->seat_version >= WL_POINTER_RELEASE_SINCE_VERSION) wl_pointer_release(s->pointer); @@ -981,7 +1007,8 @@ void UwacSeatDestroy(UwacSeat *s) { wl_pointer_destroy(s->pointer); } - if (s->touch) { + if (s->touch) + { #ifdef WL_TOUCH_RELEASE_SINCE_VERSION if (s->seat_version >= WL_TOUCH_RELEASE_SINCE_VERSION) wl_touch_release(s->touch); @@ -990,7 +1017,8 @@ void UwacSeatDestroy(UwacSeat *s) { wl_touch_destroy(s->touch); } - if (s->keyboard) { + if (s->keyboard) + { #ifdef WL_KEYBOARD_RELEASE_SINCE_VERSION if (s->seat_version >= WL_KEYBOARD_RELEASE_SINCE_VERSION) wl_keyboard_release(s->keyboard); @@ -1015,11 +1043,13 @@ void UwacSeatDestroy(UwacSeat *s) { free(s); } -const char *UwacSeatGetName(const UwacSeat *seat) { +const char* UwacSeatGetName(const UwacSeat* seat) +{ return seat->name; } -UwacSeatId UwacSeatGetId(const UwacSeat *seat) { +UwacSeatId UwacSeatGetId(const UwacSeat* seat) +{ return seat->seat_id; } @@ -1031,17 +1061,16 @@ UwacReturnCode UwacSeatInhibitShortcuts(UwacSeat* s, bool inhibit) if (s->keyboard_inhibitor) zwp_keyboard_shortcuts_inhibitor_v1_destroy(s->keyboard_inhibitor); if (inhibit && s->display && s->display->keyboard_inhibit_manager) - s->keyboard_inhibitor = zwp_keyboard_shortcuts_inhibit_manager_v1_inhibit_shortcuts(s->display->keyboard_inhibit_manager, - s->keyboard_focus->surface, s->seat); + s->keyboard_inhibitor = zwp_keyboard_shortcuts_inhibit_manager_v1_inhibit_shortcuts( + s->display->keyboard_inhibit_manager, s->keyboard_focus->surface, s->seat); if (!s->keyboard_inhibitor) return UWAC_ERROR_INTERNAL; return UWAC_SUCCESS; } -UwacReturnCode UwacSeatSetMouseCursor(UwacSeat* seat, const void* data, size_t length, - size_t width, size_t height, - size_t hot_x, size_t hot_y) +UwacReturnCode UwacSeatSetMouseCursor(UwacSeat* seat, const void* data, size_t length, size_t width, + size_t height, size_t hot_x, size_t hot_y) { if (!seat) return UWAC_ERROR_CLOSED; @@ -1072,11 +1101,13 @@ UwacReturnCode UwacSeatSetMouseCursor(UwacSeat* seat, const void* data, size_t l seat->pointer_type = 2; } /* We want to use the system cursor */ - else if (length != 0) { + else if (length != 0) + { seat->pointer_type = 0; } /* Hide the cursor */ - else { + else + { seat->pointer_type = 1; } return set_cursor_image(seat, seat->display->serial); diff --git a/uwac/libuwac/uwac-os.c b/uwac/libuwac/uwac-os.c index 8a98665db..799cdce9a 100644 --- a/uwac/libuwac/uwac-os.c +++ b/uwac/libuwac/uwac-os.c @@ -120,8 +120,7 @@ static ssize_t recvmsg_cloexec_fallback(int sockfd, struct msghdr* msg, int flag for (; cmsg != NULL; cmsg = CMSG_NXTHDR(msg, cmsg)) { - if (cmsg->cmsg_level != SOL_SOCKET || - cmsg->cmsg_type != SCM_RIGHTS) + if (cmsg->cmsg_level != SOL_SOCKET || cmsg->cmsg_type != SCM_RIGHTS) continue; data = CMSG_DATA(cmsg); diff --git a/uwac/libuwac/uwac-os.h b/uwac/libuwac/uwac-os.h index 64b582117..ef14bf4da 100644 --- a/uwac/libuwac/uwac-os.h +++ b/uwac/libuwac/uwac-os.h @@ -37,7 +37,7 @@ int uwac_os_socket_cloexec(int domain, int type, int protocol); int uwac_os_dupfd_cloexec(int fd, long minfd); -ssize_t uwac_os_recvmsg_cloexec(int sockfd, struct msghdr *msg, int flags); +ssize_t uwac_os_recvmsg_cloexec(int sockfd, struct msghdr* msg, int flags); int uwac_os_epoll_create_cloexec(void); diff --git a/uwac/libuwac/uwac-output.c b/uwac/libuwac/uwac-output.c index 2fa03c8c8..54036cb2a 100644 --- a/uwac/libuwac/uwac-output.c +++ b/uwac/libuwac/uwac-output.c @@ -29,28 +29,32 @@ #define TARGET_OUTPUT_INTERFACE 2U -static void output_handle_geometry(void *data, struct wl_output *wl_output, int x, int y, - int physical_width, int physical_height, int subpixel, - const char *make, const char *model, int transform) +static void output_handle_geometry(void* data, struct wl_output* wl_output, int x, int y, + int physical_width, int physical_height, int subpixel, + const char* make, const char* model, int transform) { - UwacOutput *output = data; + UwacOutput* output = data; -/* output->allocation.x = x; - output->allocation.y = y;*/ + /* output->allocation.x = x; + output->allocation.y = y;*/ output->transform = transform; if (output->make) free(output->make); output->make = strdup(make); - if (!output->make) { - assert(uwacErrorHandler(output->display, UWAC_ERROR_NOMEMORY, "%s: unable to strdup make\n", __FUNCTION__)); + if (!output->make) + { + assert(uwacErrorHandler(output->display, UWAC_ERROR_NOMEMORY, "%s: unable to strdup make\n", + __FUNCTION__)); } if (output->model) free(output->model); output->model = strdup(model); - if (!output->model) { - assert(uwacErrorHandler(output->display, UWAC_ERROR_NOMEMORY, "%s: unable to strdup model\n", __FUNCTION__)); + if (!output->model) + { + assert(uwacErrorHandler(output->display, UWAC_ERROR_NOMEMORY, + "%s: unable to strdup model\n", __FUNCTION__)); } UwacEvent* event = UwacDisplayNewEvent(output->display, UWAC_EVENT_OUTPUT_GEOMETRY); @@ -65,50 +69,50 @@ static void output_handle_geometry(void *data, struct wl_output *wl_output, int event->output_geometry.transform = transform; } -static void output_handle_done(void *data, struct wl_output *wl_output) +static void output_handle_done(void* data, struct wl_output* wl_output) { - UwacOutput *output = data; + UwacOutput* output = data; output->doneReceived = true; } -static void output_handle_scale(void *data, struct wl_output *wl_output, int32_t scale) +static void output_handle_scale(void* data, struct wl_output* wl_output, int32_t scale) { - UwacOutput *output = data; + UwacOutput* output = data; output->scale = scale; } -static void output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags, - int width, int height, int refresh) +static void output_handle_mode(void* data, struct wl_output* wl_output, uint32_t flags, int width, + int height, int refresh) { - UwacOutput *output = data; - //UwacDisplay *display = output->display; + UwacOutput* output = data; + // UwacDisplay *display = output->display; - if (output->doneNeeded && output->doneReceived) { + if (output->doneNeeded && output->doneReceived) + { /* TODO: we should clear the mode list */ } - if (flags & WL_OUTPUT_MODE_CURRENT) { + if (flags & WL_OUTPUT_MODE_CURRENT) + { output->resolution.width = width; output->resolution.height = height; - /* output->allocation.width = width; - output->allocation.height = height; - if (display->output_configure_handler) - (*display->output_configure_handler)( - output, display->user_data);*/ + /* output->allocation.width = width; + output->allocation.height = height; + if (display->output_configure_handler) + (*display->output_configure_handler)( + output, display->user_data);*/ } } -static const struct wl_output_listener output_listener = { - output_handle_geometry, - output_handle_mode, - output_handle_done, - output_handle_scale -}; +static const struct wl_output_listener output_listener = { output_handle_geometry, + output_handle_mode, output_handle_done, + output_handle_scale }; -UwacOutput *UwacCreateOutput(UwacDisplay *d, uint32_t id, uint32_t version) { - UwacOutput *o; +UwacOutput* UwacCreateOutput(UwacDisplay* d, uint32_t id, uint32_t version) +{ + UwacOutput* o; o = xzalloc(sizeof *o); if (!o) @@ -118,14 +122,16 @@ UwacOutput *UwacCreateOutput(UwacDisplay *d, uint32_t id, uint32_t version) { o->server_output_id = id; o->doneNeeded = (version > 1); o->doneReceived = false; - o->output = wl_registry_bind(d->registry, id, &wl_output_interface, min(TARGET_OUTPUT_INTERFACE, version)); + o->output = wl_registry_bind(d->registry, id, &wl_output_interface, + min(TARGET_OUTPUT_INTERFACE, version)); wl_output_add_listener(o->output, &output_listener, o); wl_list_insert(d->outputs.prev, &o->link); return o; } -int UwacDestroyOutput(UwacOutput *output) { +int UwacDestroyOutput(UwacOutput* output) +{ free(output->make); free(output->model); diff --git a/uwac/libuwac/uwac-priv.h b/uwac/libuwac/uwac-priv.h index 933f1b625..b6978bd5b 100644 --- a/uwac/libuwac/uwac-priv.h +++ b/uwac/libuwac/uwac-priv.h @@ -49,21 +49,22 @@ #include - extern UwacErrorHandler uwacErrorHandler; typedef struct uwac_task UwacTask; /** @brief */ -struct uwac_task { - void (*run)(UwacTask *task, uint32_t events); +struct uwac_task +{ + void (*run)(UwacTask* task, uint32_t events); struct wl_list link; }; /** @brief a global registry object */ -struct uwac_global { +struct uwac_global +{ uint32_t name; - char *interface; + char* interface; uint32_t version; struct wl_list link; }; @@ -73,42 +74,43 @@ struct uwac_event_list_item; typedef struct uwac_event_list_item UwacEventListItem; /** @brief */ -struct uwac_event_list_item { +struct uwac_event_list_item +{ UwacEvent event; UwacEventListItem *tail, *head; }; - /** @brief main connection object to a wayland display */ -struct uwac_display { +struct uwac_display +{ struct wl_list globals; - struct wl_display *display; - struct wl_registry *registry; - struct wl_compositor *compositor; - struct wl_subcompositor *subcompositor; - struct wl_shell *shell; - struct xdg_toplevel *xdg_toplevel; - struct xdg_wm_base *xdg_base; + struct wl_display* display; + struct wl_registry* registry; + struct wl_compositor* compositor; + struct wl_subcompositor* subcompositor; + struct wl_shell* shell; + struct xdg_toplevel* xdg_toplevel; + struct xdg_wm_base* xdg_base; struct wl_data_device_manager* devicemanager; - struct zwp_keyboard_shortcuts_inhibit_manager_v1 *keyboard_inhibit_manager; - struct zxdg_decoration_manager_v1 *deco_manager; - struct org_kde_kwin_server_decoration_manager *kde_deco_manager; + struct zwp_keyboard_shortcuts_inhibit_manager_v1* keyboard_inhibit_manager; + struct zxdg_decoration_manager_v1* deco_manager; + struct org_kde_kwin_server_decoration_manager* kde_deco_manager; #ifdef BUILD_IVI - struct ivi_application *ivi_application; + struct ivi_application* ivi_application; #endif #ifdef BUILD_FULLSCREEN_SHELL - struct zwp_fullscreen_shell_v1 *fullscreen_shell; + struct zwp_fullscreen_shell_v1* fullscreen_shell; #endif - struct wl_shm *shm; - enum wl_shm_format *shm_formats; + struct wl_shm* shm; + enum wl_shm_format* shm_formats; uint32_t shm_formats_nb; bool has_rgb565; - struct wl_data_device_manager *data_device_manager; - struct text_cursor_position *text_cursor_position; - struct workspace_manager *workspace_manager; + struct wl_data_device_manager* data_device_manager; + struct text_cursor_position* text_cursor_position; + struct workspace_manager* workspace_manager; struct wl_list seats; @@ -128,8 +130,9 @@ struct uwac_display { }; /** @brief an output on a wayland display */ -struct uwac_output { - UwacDisplay *display; +struct uwac_output +{ + UwacDisplay* display; bool doneNeeded; bool doneReceived; @@ -137,40 +140,42 @@ struct uwac_output { UwacSize resolution; int transform; int scale; - char *make; - char *model; + char* make; + char* model; uint32_t server_output_id; - struct wl_output *output; + struct wl_output* output; struct wl_list link; }; /** @brief a seat attached to a wayland display */ -struct uwac_seat { - UwacDisplay *display; - char *name; - struct wl_seat *seat; +struct uwac_seat +{ + UwacDisplay* display; + char* name; + struct wl_seat* seat; uint32_t seat_id; uint32_t seat_version; struct wl_data_device* data_device; struct wl_data_source* data_source; - struct wl_pointer *pointer; - struct wl_surface *pointer_surface; - struct wl_cursor_image *pointer_image; - struct wl_cursor_theme *cursor_theme; - struct wl_cursor *default_cursor; - void *pointer_data; + struct wl_pointer* pointer; + struct wl_surface* pointer_surface; + struct wl_cursor_image* pointer_image; + struct wl_cursor_theme* cursor_theme; + struct wl_cursor* default_cursor; + void* pointer_data; size_t pointer_size; int pointer_type; - struct wl_keyboard *keyboard; - struct wl_touch *touch; + struct wl_keyboard* keyboard; + struct wl_touch* touch; struct wl_data_offer* offer; - struct xkb_context *xkb_context; - struct zwp_keyboard_shortcuts_inhibitor_v1 *keyboard_inhibitor; + struct xkb_context* xkb_context; + struct zwp_keyboard_shortcuts_inhibitor_v1* keyboard_inhibitor; - struct { - struct xkb_keymap *keymap; - struct xkb_state *state; + struct + { + struct xkb_keymap* keymap; + struct xkb_state* state; xkb_mod_mask_t control_mask; xkb_mod_mask_t alt_mask; xkb_mod_mask_t shift_mask; @@ -182,11 +187,11 @@ struct uwac_seat { struct wl_array pressed_keys; - UwacWindow *pointer_focus; + UwacWindow* pointer_focus; - UwacWindow *keyboard_focus; + UwacWindow* keyboard_focus; - UwacWindow *touch_focus; + UwacWindow* touch_focus; bool touch_frame_started; int repeat_timer_fd; @@ -200,9 +205,9 @@ struct uwac_seat { bool ignore_announcement; }; - /** @brief a buffer used for drawing a surface frame */ -struct uwac_buffer { +struct uwac_buffer +{ bool used; bool dirty; #ifdef HAVE_PIXMAN_REGION @@ -210,33 +215,33 @@ struct uwac_buffer { #else REGION16 damage; #endif - struct wl_buffer *wayland_buffer; - void *data; + struct wl_buffer* wayland_buffer; + void* data; }; typedef struct uwac_buffer UwacBuffer; - /** @brief a window */ -struct uwac_window { - UwacDisplay *display; +struct uwac_window +{ + UwacDisplay* display; int width, height, stride; int surfaceStates; enum wl_shm_format format; int nbuffers; - UwacBuffer *buffers; + UwacBuffer* buffers; - struct wl_region *opaque_region; - struct wl_region *input_region; + struct wl_region* opaque_region; + struct wl_region* input_region; UwacBuffer *drawingBuffer, *pendingBuffer; - struct wl_surface *surface; - struct wl_shell_surface *shell_surface; - struct xdg_surface *xdg_surface; - struct xdg_toplevel *xdg_toplevel; - struct zxdg_toplevel_decoration_v1 *deco; - struct org_kde_kwin_server_decoration *kde_deco; + struct wl_surface* surface; + struct wl_shell_surface* shell_surface; + struct xdg_surface* xdg_surface; + struct xdg_toplevel* xdg_toplevel; + struct zxdg_toplevel_decoration_v1* deco; + struct org_kde_kwin_server_decoration* kde_deco; #ifdef BUILD_IVI - struct ivi_surface *ivi_surface; + struct ivi_surface* ivi_surface; #endif struct wl_list link; @@ -245,19 +250,17 @@ struct uwac_window { int pointer_current_cursor; }; - /* in uwa-display.c */ -UwacEvent *UwacDisplayNewEvent(UwacDisplay *d, int type); -int UwacDisplayWatchFd(UwacDisplay *display, int fd, uint32_t events, UwacTask *task); - +UwacEvent* UwacDisplayNewEvent(UwacDisplay* d, int type); +int UwacDisplayWatchFd(UwacDisplay* display, int fd, uint32_t events, UwacTask* task); /* in uwac-input.c */ -UwacSeat *UwacSeatNew(UwacDisplay *d, uint32_t id, uint32_t version); -void UwacSeatDestroy(UwacSeat *s); +UwacSeat* UwacSeatNew(UwacDisplay* d, uint32_t id, uint32_t version); +void UwacSeatDestroy(UwacSeat* s); /* in uwac-output.c */ -UwacOutput *UwacCreateOutput(UwacDisplay *d, uint32_t id, uint32_t version); -int UwacDestroyOutput(UwacOutput *output); +UwacOutput* UwacCreateOutput(UwacDisplay* d, uint32_t id, uint32_t version); +int UwacDestroyOutput(UwacOutput* output); UwacReturnCode UwacSeatRegisterClipboard(UwacSeat* s); diff --git a/uwac/libuwac/uwac-tools.c b/uwac/libuwac/uwac-tools.c index c3d27c4b2..21e8d79f1 100644 --- a/uwac/libuwac/uwac-tools.c +++ b/uwac/libuwac/uwac-tools.c @@ -25,71 +25,82 @@ #include /** @brief */ -struct uwac_touch_automata { +struct uwac_touch_automata +{ struct wl_array tp; }; -void UwacTouchAutomataInit(UwacTouchAutomata *automata) { +void UwacTouchAutomataInit(UwacTouchAutomata* automata) +{ wl_array_init(&automata->tp); } -void UwacTouchAutomataReset(UwacTouchAutomata *automata) { +void UwacTouchAutomataReset(UwacTouchAutomata* automata) +{ automata->tp.size = 0; } -bool UwacTouchAutomataInjectEvent(UwacTouchAutomata *automata, UwacEvent *event) { +bool UwacTouchAutomataInjectEvent(UwacTouchAutomata* automata, UwacEvent* event) +{ - UwacTouchPoint *tp; + UwacTouchPoint* tp; - switch (event->type) { - case UWAC_EVENT_TOUCH_FRAME_BEGIN: - break; + switch (event->type) + { + case UWAC_EVENT_TOUCH_FRAME_BEGIN: + break; - case UWAC_EVENT_TOUCH_UP: { - UwacTouchUp *touchUp = &event->touchUp; - size_t toMove = automata->tp.size - sizeof(UwacTouchPoint); + case UWAC_EVENT_TOUCH_UP: + { + UwacTouchUp* touchUp = &event->touchUp; + size_t toMove = automata->tp.size - sizeof(UwacTouchPoint); - wl_array_for_each(tp, &automata->tp) { - if ((int64_t)tp->id == touchUp->id) { - if (toMove) - memmove(tp, tp+1, toMove); - return true; - } - - toMove -= sizeof(UwacTouchPoint); - } - break; - } - - case UWAC_EVENT_TOUCH_DOWN: { - UwacTouchDown *touchDown = &event->touchDown; - - wl_array_for_each(tp, &automata->tp) { - if ((int64_t)tp->id == touchDown->id) { - tp->x = touchDown->x; - tp->y = touchDown->y; - return true; + wl_array_for_each(tp, &automata->tp) + { + if ((int64_t)tp->id == touchUp->id) + { + if (toMove) + memmove(tp, tp + 1, toMove); + return true; + } + + toMove -= sizeof(UwacTouchPoint); } + break; } - tp = wl_array_add(&automata->tp, sizeof(UwacTouchPoint)); - if (!tp) - return false; + case UWAC_EVENT_TOUCH_DOWN: + { + UwacTouchDown* touchDown = &event->touchDown; - if (touchDown->id < 0) - return false; + wl_array_for_each(tp, &automata->tp) + { + if ((int64_t)tp->id == touchDown->id) + { + tp->x = touchDown->x; + tp->y = touchDown->y; + return true; + } + } - tp->id = (uint32_t)touchDown->id; - tp->x = touchDown->x; - tp->y = touchDown->y; - break; - } + tp = wl_array_add(&automata->tp, sizeof(UwacTouchPoint)); + if (!tp) + return false; - case UWAC_EVENT_TOUCH_FRAME_END: - break; + if (touchDown->id < 0) + return false; - default: - break; + tp->id = (uint32_t)touchDown->id; + tp->x = touchDown->x; + tp->y = touchDown->y; + break; + } + + case UWAC_EVENT_TOUCH_FRAME_END: + break; + + default: + break; } return true; diff --git a/uwac/libuwac/uwac-utils.c b/uwac/libuwac/uwac-utils.c index 1585811b3..6cb1ec0ca 100644 --- a/uwac/libuwac/uwac-utils.c +++ b/uwac/libuwac/uwac-utils.c @@ -35,8 +35,10 @@ * This part is an adaptation of client/window.c from the weston project. */ -void *fail_on_null(void *p) { - if (p == NULL) { +void* fail_on_null(void* p) +{ + if (p == NULL) + { fprintf(stderr, "out of memory\n"); exit(EXIT_FAILURE); } @@ -44,20 +46,22 @@ void *fail_on_null(void *p) { return p; } -void *xmalloc(size_t s) { +void* xmalloc(size_t s) +{ return fail_on_null(malloc(s)); } -void *xzalloc(size_t s) { +void* xzalloc(size_t s) +{ return fail_on_null(zalloc(s)); } -char *xstrdup(const char *s) { +char* xstrdup(const char* s) +{ return fail_on_null(strdup(s)); } -void *xrealloc(void *p, size_t s) { +void* xrealloc(void* p, size_t s) +{ return fail_on_null(realloc(p, s)); } - - diff --git a/uwac/libuwac/uwac-utils.h b/uwac/libuwac/uwac-utils.h index 3b18bbc9e..b84d287f1 100644 --- a/uwac/libuwac/uwac-utils.h +++ b/uwac/libuwac/uwac-utils.h @@ -25,29 +25,32 @@ #include -#define min(a,b) \ - ({ __typeof__ (a) _a = (a); \ - __typeof__ (b) _b = (b); \ - _a < _b ? _a : _b; }) +#define min(a, b) \ + ({ \ + __typeof__(a) _a = (a); \ + __typeof__(b) _b = (b); \ + _a < _b ? _a : _b; \ + }) -#define container_of(ptr, type, member) ({ \ - const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \ - (type *)( (char *)__mptr - offsetof(type,member) );}) +#define container_of(ptr, type, member) \ + ({ \ + const __typeof__(((type*)0)->member)* __mptr = (ptr); \ + (type*)((char*)__mptr - offsetof(type, member)); \ + }) -#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) +#define ARRAY_LENGTH(a) (sizeof(a) / sizeof(a)[0]) +void* xmalloc(size_t s); - -void *xmalloc(size_t s); - -static inline void *zalloc(size_t size) { +static inline void* zalloc(size_t size) +{ return calloc(1, size); } -void *xzalloc(size_t s); +void* xzalloc(size_t s); -char *xstrdup(const char *s); +char* xstrdup(const char* s); -void *xrealloc(void *p, size_t s); +void* xrealloc(void* p, size_t s); #endif /* UWAC_UTILS_H_ */ diff --git a/uwac/libuwac/uwac-window.c b/uwac/libuwac/uwac-window.c index 77107248a..d2d380177 100644 --- a/uwac/libuwac/uwac-window.c +++ b/uwac/libuwac/uwac-window.c @@ -31,7 +31,6 @@ #include "uwac-utils.h" #include "uwac-os.h" - #define UWAC_INITIAL_BUFFERS 3 static int bppFromShmFormat(enum wl_shm_format format) @@ -45,17 +44,13 @@ static int bppFromShmFormat(enum wl_shm_format format) } } - static void buffer_release(void* data, struct wl_buffer* buffer) { UwacBuffer* uwacBuffer = (UwacBuffer*)data; uwacBuffer->used = false; } -static const struct wl_buffer_listener buffer_listener = -{ - buffer_release -}; +static const struct wl_buffer_listener buffer_listener = { buffer_release }; void UwacWindowDestroyBuffers(UwacWindow* w) { @@ -77,15 +72,11 @@ void UwacWindowDestroyBuffers(UwacWindow* w) w->buffers = NULL; } - int UwacWindowShmAllocBuffers(UwacWindow* w, int nbuffers, int allocSize, uint32_t width, uint32_t height, enum wl_shm_format format); -static void xdg_handle_toplevel_configure(void *data, - struct xdg_toplevel *xdg_toplevel, - int32_t width, - int32_t height, - struct wl_array *states) +static void xdg_handle_toplevel_configure(void* data, struct xdg_toplevel* xdg_toplevel, + int32_t width, int32_t height, struct wl_array* states) { UwacWindow* window = (UwacWindow*)data; UwacConfigureEvent* event; @@ -142,7 +133,8 @@ static void xdg_handle_toplevel_configure(void *data, if (ret != UWAC_SUCCESS) { - assert(uwacErrorHandler(window->display, ret, "failed to reallocate a wayland buffers\n")); + assert( + uwacErrorHandler(window->display, ret, "failed to reallocate a wayland buffers\n")); window->drawingBuffer = window->pendingBuffer = NULL; return; } @@ -158,8 +150,7 @@ static void xdg_handle_toplevel_configure(void *data, } } -static void xdg_handle_toplevel_close(void *data, - struct xdg_toplevel *xdg_toplevel) +static void xdg_handle_toplevel_close(void* data, struct xdg_toplevel* xdg_toplevel) { UwacCloseEvent* event; UwacWindow* window = (UwacWindow*)data; @@ -175,29 +166,27 @@ static void xdg_handle_toplevel_close(void *data, event->window = window; } -static const struct xdg_toplevel_listener xdg_toplevel_listener = -{ +static const struct xdg_toplevel_listener xdg_toplevel_listener = { xdg_handle_toplevel_configure, xdg_handle_toplevel_close, }; -static void xdg_handle_surface_configure(void *data, - struct xdg_surface *xdg_surface, - uint32_t serial) { +static void xdg_handle_surface_configure(void* data, struct xdg_surface* xdg_surface, + uint32_t serial) +{ xdg_surface_ack_configure(xdg_surface, serial); UwacWindow* window = (UwacWindow*)data; wl_surface_commit(window->surface); } -static const struct xdg_surface_listener xdg_surface_listener = -{ +static const struct xdg_surface_listener xdg_surface_listener = { .configure = xdg_handle_surface_configure, }; #if BUILD_IVI -static void ivi_handle_configure(void* data, struct ivi_surface* surface, - int32_t width, int32_t height) +static void ivi_handle_configure(void* data, struct ivi_surface* surface, int32_t width, + int32_t height) { UwacWindow* window = (UwacWindow*)data; UwacConfigureEvent* event; @@ -227,7 +216,8 @@ static void ivi_handle_configure(void* data, struct ivi_surface* surface, if (ret != UWAC_SUCCESS) { - assert(uwacErrorHandler(window->display, ret, "failed to reallocate a wayland buffers\n")); + assert( + uwacErrorHandler(window->display, ret, "failed to reallocate a wayland buffers\n")); window->drawingBuffer = window->pendingBuffer = NULL; return; } @@ -243,8 +233,7 @@ static void ivi_handle_configure(void* data, struct ivi_surface* surface, } } -static const struct ivi_surface_listener ivi_surface_listener = -{ +static const struct ivi_surface_listener ivi_surface_listener = { ivi_handle_configure, }; #endif @@ -254,8 +243,8 @@ void shell_ping(void* data, struct wl_shell_surface* surface, uint32_t serial) wl_shell_surface_pong(surface, serial); } -void shell_configure(void* data, struct wl_shell_surface* surface, uint32_t edges, - int32_t width, int32_t height) +void shell_configure(void* data, struct wl_shell_surface* surface, uint32_t edges, int32_t width, + int32_t height) { UwacWindow* window = (UwacWindow*)data; UwacConfigureEvent* event; @@ -285,7 +274,8 @@ void shell_configure(void* data, struct wl_shell_surface* surface, uint32_t edge if (ret != UWAC_SUCCESS) { - assert(uwacErrorHandler(window->display, ret, "failed to reallocate a wayland buffers\n")); + assert( + uwacErrorHandler(window->display, ret, "failed to reallocate a wayland buffers\n")); window->drawingBuffer = window->pendingBuffer = NULL; return; } @@ -301,19 +291,12 @@ void shell_configure(void* data, struct wl_shell_surface* surface, uint32_t edge } } - void shell_popup_done(void* data, struct wl_shell_surface* surface) { } - -static const struct wl_shell_surface_listener shell_listener = -{ - shell_ping, - shell_configure, - shell_popup_done -}; - +static const struct wl_shell_surface_listener shell_listener = { shell_ping, shell_configure, + shell_popup_done }; int UwacWindowShmAllocBuffers(UwacWindow* w, int nbuffers, int allocSize, uint32_t width, uint32_t height, enum wl_shm_format format) @@ -363,8 +346,8 @@ int UwacWindowShmAllocBuffers(UwacWindow* w, int nbuffers, int allocSize, uint32 region16_init(&buffer->damage); #endif buffer->data = data + (allocSize * i); - buffer->wayland_buffer = wl_shm_pool_create_buffer(pool, allocSize * i, width, height, w->stride, - format); + buffer->wayland_buffer = + wl_shm_pool_create_buffer(pool, allocSize * i, width, height, w->stride, format); wl_buffer_add_listener(buffer->wayland_buffer, &buffer_listener, buffer); } @@ -400,27 +383,36 @@ UwacBuffer* UwacWindowFindFreeBuffer(UwacWindow* w) return &w->buffers[i]; } -static UwacReturnCode UwacWindowSetDecorations(UwacWindow *w) +static UwacReturnCode UwacWindowSetDecorations(UwacWindow* w) { if (!w || !w->display) return UWAC_ERROR_INTERNAL; - if (w->display->deco_manager) { - w->deco = zxdg_decoration_manager_v1_get_toplevel_decoration( - w->display->deco_manager, w->xdg_toplevel); - if (!w->deco) { - uwacErrorHandler(w->display, UWAC_NOT_FOUND, "Current window manager does not allow decorating with SSD"); + if (w->display->deco_manager) + { + w->deco = zxdg_decoration_manager_v1_get_toplevel_decoration(w->display->deco_manager, + w->xdg_toplevel); + if (!w->deco) + { + uwacErrorHandler(w->display, UWAC_NOT_FOUND, + "Current window manager does not allow decorating with SSD"); } else - zxdg_toplevel_decoration_v1_set_mode(w->deco, ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE); + zxdg_toplevel_decoration_v1_set_mode(w->deco, + ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE); } - else if (w->display->kde_deco_manager) { - w->kde_deco = org_kde_kwin_server_decoration_manager_create(w->display->kde_deco_manager, w->surface); - if (!w->kde_deco) { - uwacErrorHandler(w->display, UWAC_NOT_FOUND, "Current window manager does not allow decorating with SSD"); + else if (w->display->kde_deco_manager) + { + w->kde_deco = + org_kde_kwin_server_decoration_manager_create(w->display->kde_deco_manager, w->surface); + if (!w->kde_deco) + { + uwacErrorHandler(w->display, UWAC_NOT_FOUND, + "Current window manager does not allow decorating with SSD"); } else - org_kde_kwin_server_decoration_request_mode(w->kde_deco, ORG_KDE_KWIN_SERVER_DECORATION_MODE_SERVER); + org_kde_kwin_server_decoration_request_mode(w->kde_deco, + ORG_KDE_KWIN_SERVER_DECORATION_MODE_SERVER); } return UWAC_SUCCESS; } @@ -506,7 +498,8 @@ UwacWindow* UwacCreateWindowShm(UwacDisplay* display, uint32_t width, uint32_t h else if (display->fullscreen_shell) { zwp_fullscreen_shell_v1_present_surface(display->fullscreen_shell, w->surface, - ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_CENTER, NULL); + ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_CENTER, + NULL); } #endif else @@ -530,7 +523,6 @@ out_error_free: return NULL; } - UwacReturnCode UwacDestroyWindow(UwacWindow** pwindow) { UwacWindow* w; @@ -568,7 +560,7 @@ UwacReturnCode UwacDestroyWindow(UwacWindow** pwindow) } UwacReturnCode UwacWindowSetOpaqueRegion(UwacWindow* window, uint32_t x, uint32_t y, uint32_t width, - uint32_t height) + uint32_t height) { assert(window); @@ -603,7 +595,6 @@ UwacReturnCode UwacWindowSetInputRegion(UwacWindow* window, uint32_t x, uint32_t return UWAC_SUCCESS; } - void* UwacWindowGetDrawingBuffer(UwacWindow* window) { return window->drawingBuffer->data; @@ -611,11 +602,7 @@ void* UwacWindowGetDrawingBuffer(UwacWindow* window) static void frame_done_cb(void* data, struct wl_callback* callback, uint32_t time); -static const struct wl_callback_listener frame_listener = -{ - frame_done_cb -}; - +static const struct wl_callback_listener frame_listener = { frame_done_cb }; #ifdef HAVE_PIXMAN_REGION static void damage_surface(UwacWindow* window, UwacBuffer* buffer) @@ -624,7 +611,8 @@ static void damage_surface(UwacWindow* window, UwacBuffer* buffer) const pixman_box32_t* box = pixman_region32_rectangles(&buffer->damage, &nrects); for (i = 0; i < nrects; i++, box++) - wl_surface_damage(window->surface, box->x1, box->y1, (box->x2 - box->x1), (box->y2 - box->y1)); + wl_surface_damage(window->surface, box->x1, box->y1, (box->x2 - box->x1), + (box->y2 - box->y1)); pixman_region32_clear(&buffer->damage); } @@ -654,7 +642,6 @@ static void UwacSubmitBufferPtr(UwacWindow* window, UwacBuffer* buffer) buffer->dirty = false; } - static void frame_done_cb(void* data, struct wl_callback* callback, uint32_t time) { UwacWindow* window = (UwacWindow*)data; @@ -668,7 +655,6 @@ static void frame_done_cb(void* data, struct wl_callback* callback, uint32_t tim event->window = window; } - #ifdef HAVE_PIXMAN_REGION UwacReturnCode UwacWindowAddDamage(UwacWindow* window, uint32_t x, uint32_t y, uint32_t width, uint32_t height) @@ -700,7 +686,8 @@ UwacReturnCode UwacWindowAddDamage(UwacWindow* window, uint32_t x, uint32_t y, u } #endif -UwacReturnCode UwacWindowGetDrawingBufferGeometry(UwacWindow* window, UwacSize* geometry, size_t* stride) +UwacReturnCode UwacWindowGetDrawingBufferGeometry(UwacWindow* window, UwacSize* geometry, + size_t* stride) { if (!window || !window->drawingBuffer) return UWAC_ERROR_INTERNAL; @@ -731,7 +718,8 @@ UwacReturnCode UwacWindowSubmitBuffer(UwacWindow* window, bool copyContentForNex return UWAC_ERROR_NOMEMORY; if (copyContentForNextFrame) - memcpy(window->drawingBuffer->data, window->pendingBuffer->data, window->stride * window->height); + memcpy(window->drawingBuffer->data, window->pendingBuffer->data, + window->stride * window->height); UwacSubmitBufferPtr(window, drawingBuffer); return UWAC_SUCCESS; @@ -746,9 +734,8 @@ UwacReturnCode UwacWindowGetGeometry(UwacWindow* window, UwacSize* geometry) return UWAC_SUCCESS; } - UwacReturnCode UwacWindowSetFullscreenState(UwacWindow* window, UwacOutput* output, - bool isFullscreen) + bool isFullscreen) { if (window->xdg_toplevel) { @@ -766,8 +753,7 @@ UwacReturnCode UwacWindowSetFullscreenState(UwacWindow* window, UwacOutput* outp if (isFullscreen) { wl_shell_surface_set_fullscreen(window->shell_surface, - WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, - 0, + WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 0, output ? output->output : NULL); } else diff --git a/winpr/include/winpr/asn1.h b/winpr/include/winpr/asn1.h index 6c2e46e6c..6efe2e316 100644 --- a/winpr/include/winpr/asn1.h +++ b/winpr/include/winpr/asn1.h @@ -24,491 +24,538 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef unsigned char ASN1uint8_t; -typedef signed char ASN1int8_t; + typedef unsigned char ASN1uint8_t; + typedef signed char ASN1int8_t; -typedef unsigned short ASN1uint16_t; -typedef signed short ASN1int16_t; + typedef unsigned short ASN1uint16_t; + typedef signed short ASN1int16_t; -typedef unsigned long ASN1uint32_t; -typedef signed long ASN1int32_t; + typedef unsigned long ASN1uint32_t; + typedef signed long ASN1int32_t; -typedef ASN1uint8_t ASN1octet_t; + typedef ASN1uint8_t ASN1octet_t; -typedef ASN1uint8_t ASN1bool_t; + typedef ASN1uint8_t ASN1bool_t; -struct tagASN1intx_t -{ - ASN1uint32_t length; - ASN1octet_t* value; -}; -typedef struct tagASN1intx_t ASN1intx_t; + struct tagASN1intx_t + { + ASN1uint32_t length; + ASN1octet_t* value; + }; + typedef struct tagASN1intx_t ASN1intx_t; -struct tagASN1octetstring_t -{ - ASN1uint32_t length; - ASN1octet_t* value; -}; -typedef struct tagASN1octetstring_t ASN1octetstring_t; + struct tagASN1octetstring_t + { + ASN1uint32_t length; + ASN1octet_t* value; + }; + typedef struct tagASN1octetstring_t ASN1octetstring_t; -struct tagASN1octetstring2_t -{ - ASN1uint32_t length; - ASN1octet_t value[1]; -}; -typedef struct tagASN1octetstring2_t ASN1octetstring2_t; + struct tagASN1octetstring2_t + { + ASN1uint32_t length; + ASN1octet_t value[1]; + }; + typedef struct tagASN1octetstring2_t ASN1octetstring2_t; -struct ASN1iterator_s -{ - struct ASN1iterator_s* next; - void* value; -}; -typedef struct ASN1iterator_s ASN1iterator_t; - -struct tagASN1bitstring_t -{ - ASN1uint32_t length; - ASN1octet_t* value; -}; -typedef struct tagASN1bitstring_t ASN1bitstring_t; - -typedef char ASN1char_t; - -struct tagASN1charstring_t -{ - ASN1uint32_t length; - ASN1char_t* value; -}; -typedef struct tagASN1charstring_t ASN1charstring_t; - -typedef ASN1uint16_t ASN1char16_t; - -struct tagASN1char16string_t -{ - ASN1uint32_t length; - ASN1char16_t* value; -}; -typedef struct tagASN1char16string_t ASN1char16string_t; - -typedef ASN1uint32_t ASN1char32_t; - -struct tagASN1char32string_t -{ - ASN1uint32_t length; - ASN1char32_t* value; -}; -typedef struct tagASN1char32string_t ASN1char32string_t; - -typedef ASN1char_t* ASN1ztcharstring_t; -typedef ASN1char16_t* ASN1ztchar16string_t; -typedef ASN1char32_t* ASN1ztchar32string_t; - -struct tagASN1wstring_t -{ - ASN1uint32_t length; - WCHAR* value; -}; -typedef struct tagASN1wstring_t ASN1wstring_t; - -struct ASN1objectidentifier_s -{ - struct ASN1objectidentifier_s* next; - ASN1uint32_t value; -}; -typedef struct ASN1objectidentifier_s* ASN1objectidentifier_t; - -struct tagASN1objectidentifier2_t -{ - ASN1uint16_t count; - ASN1uint32_t value[16]; -}; -typedef struct tagASN1objectidentifier2_t ASN1objectidentifier2_t; - -struct tagASN1encodedOID_t -{ - ASN1uint16_t length; - ASN1octet_t* value; -}; -typedef struct tagASN1encodedOID_t ASN1encodedOID_t; - -typedef ASN1ztcharstring_t ASN1objectdescriptor_t; - -struct tagASN1generalizedtime_t -{ - ASN1uint16_t year; - ASN1uint8_t month; - ASN1uint8_t day; - ASN1uint8_t hour; - ASN1uint8_t minute; - ASN1uint8_t second; - ASN1uint16_t millisecond; - ASN1bool_t universal; - ASN1int16_t diff; -}; -typedef struct tagASN1generalizedtime_t ASN1generalizedtime_t; - -struct tagASN1utctime_t -{ - ASN1uint8_t year; - ASN1uint8_t month; - ASN1uint8_t day; - ASN1uint8_t hour; - ASN1uint8_t minute; - ASN1uint8_t second; - ASN1bool_t universal; - ASN1int16_t diff; -}; -typedef struct tagASN1utctime_t ASN1utctime_t; - -struct tagASN1open_t -{ - ASN1uint32_t length; - - union - { - void* encoded; + struct ASN1iterator_s + { + struct ASN1iterator_s* next; void* value; }; -}; -typedef struct tagASN1open_t ASN1open_t; + typedef struct ASN1iterator_s ASN1iterator_t; -enum tagASN1blocktype_e -{ - ASN1_DER_SET_OF_BLOCK, -}; -typedef enum tagASN1blocktype_e ASN1blocktype_e; - -typedef ASN1int32_t ASN1enum_t; -typedef ASN1uint16_t ASN1choice_t; -typedef ASN1uint32_t ASN1magic_t; - -enum -{ - ASN1_CHOICE_BASE = 1, - ASN1_CHOICE_INVALID = -1, - ASN1_CHOICE_EXTENSION = 0, -}; - -enum tagASN1error_e -{ - ASN1_SUCCESS = 0, - ASN1_ERR_INTERNAL = -1001, - ASN1_ERR_EOD = -1002, - ASN1_ERR_CORRUPT = -1003, - ASN1_ERR_LARGE = -1004, - ASN1_ERR_CONSTRAINT = -1005, - ASN1_ERR_MEMORY = -1006, - ASN1_ERR_OVERFLOW = -1007, - ASN1_ERR_BADPDU = -1008, - ASN1_ERR_BADARGS = -1009, - ASN1_ERR_BADREAL = -1010, - ASN1_ERR_BADTAG = -1011, - ASN1_ERR_CHOICE = -1012, - ASN1_ERR_RULE = -1013, - ASN1_ERR_UTF8 = -1014, - ASN1_ERR_PDU_TYPE = -1051, - ASN1_ERR_NYI = -1052, - ASN1_WRN_EXTENDED = 1001, - ASN1_WRN_NOEOD = 1002, -}; -typedef enum tagASN1error_e ASN1error_e; - -enum tagASN1encodingrule_e -{ - ASN1_BER_RULE_BER = 0x0100, - ASN1_BER_RULE_CER = 0x0200, - ASN1_BER_RULE_DER = 0x0400, - ASN1_BER_RULE = ASN1_BER_RULE_BER | ASN1_BER_RULE_CER | ASN1_BER_RULE_DER, -}; -typedef enum tagASN1encodingrule_e ASN1encodingrule_e; - -typedef struct ASN1encoding_s* ASN1encoding_t; -typedef struct ASN1decoding_s* ASN1decoding_t; - -typedef ASN1int32_t (*ASN1BerEncFun_t)(ASN1encoding_t enc, ASN1uint32_t tag, void* data); -typedef ASN1int32_t (*ASN1BerDecFun_t)(ASN1decoding_t enc, ASN1uint32_t tag, void* data); - -struct tagASN1BerFunArr_t -{ - const ASN1BerEncFun_t* apfnEncoder; - const ASN1BerDecFun_t* apfnDecoder; -}; -typedef struct tagASN1BerFunArr_t ASN1BerFunArr_t; - -typedef void (*ASN1GenericFun_t)(void); -typedef void (*ASN1FreeFun_t)(void* data); - -struct tagASN1module_t -{ - ASN1magic_t nModuleName; - ASN1encodingrule_e eRule; - ASN1uint32_t dwFlags; - ASN1uint32_t cPDUs; - const ASN1FreeFun_t* apfnFreeMemory; - const ASN1uint32_t* acbStructSize; - ASN1BerFunArr_t BER; -}; -typedef struct tagASN1module_t* ASN1module_t; - -struct ASN1encoding_s -{ - ASN1magic_t magic; - ASN1uint32_t version; - ASN1module_t module; - ASN1octet_t* buf; - ASN1uint32_t size; - ASN1uint32_t len; - ASN1error_e err; - ASN1uint32_t bit; - ASN1octet_t* pos; - ASN1uint32_t cbExtraHeader; - ASN1encodingrule_e eRule; - ASN1uint32_t dwFlags; -}; - -struct ASN1decoding_s -{ - ASN1magic_t magic; - ASN1uint32_t version; - ASN1module_t module; - ASN1octet_t* buf; - ASN1uint32_t size; - ASN1uint32_t len; - ASN1error_e err; - ASN1uint32_t bit; - ASN1octet_t* pos; - ASN1encodingrule_e eRule; - ASN1uint32_t dwFlags; -}; - -enum -{ - ASN1FLAGS_NONE = 0x00000000L, - ASN1FLAGS_NOASSERT = 0x00001000L, -}; - -enum -{ - ASN1ENCODE_APPEND = 0x00000001L, - ASN1ENCODE_REUSEBUFFER = 0x00000004L, - ASN1ENCODE_SETBUFFER = 0x00000008L, - ASN1ENCODE_ALLOCATEBUFFER = 0x00000010L, - ASN1ENCODE_NOASSERT = ASN1FLAGS_NOASSERT, -}; - -enum -{ - ASN1DECODE_APPENDED = 0x00000001L, - ASN1DECODE_REWINDBUFFER = 0x00000004L, - ASN1DECODE_SETBUFFER = 0x00000008L, - ASN1DECODE_AUTOFREEBUFFER = 0x00000010L, - ASN1DECODE_NOASSERT = ASN1FLAGS_NOASSERT, -}; - - -WINPR_API ASN1module_t ASN1_CreateModule(ASN1uint32_t nVersion, ASN1encodingrule_e eRule, - ASN1uint32_t dwFlags, ASN1uint32_t cPDU, const ASN1GenericFun_t apfnEncoder[], - const ASN1GenericFun_t apfnDecoder[], const ASN1FreeFun_t apfnFreeMemory[], - const ASN1uint32_t acbStructSize[], ASN1magic_t nModuleName); - -WINPR_API void ASN1_CloseModule(ASN1module_t pModule); - -WINPR_API ASN1error_e ASN1_CreateEncoder(ASN1module_t pModule, ASN1encoding_t* ppEncoderInfo, - ASN1octet_t* pbBuf, ASN1uint32_t cbBufSize, ASN1encoding_t pParent); - -WINPR_API ASN1error_e ASN1_Encode(ASN1encoding_t pEncoderInfo, void* pDataStruct, ASN1uint32_t nPduNum, - ASN1uint32_t dwFlags, ASN1octet_t* pbBuf, ASN1uint32_t cbBufSize); - -WINPR_API void ASN1_CloseEncoder(ASN1encoding_t pEncoderInfo); - -WINPR_API void ASN1_CloseEncoder2(ASN1encoding_t pEncoderInfo); - -WINPR_API ASN1error_e ASN1_CreateDecoder(ASN1module_t pModule, ASN1decoding_t* ppDecoderInfo, - ASN1octet_t* pbBuf, ASN1uint32_t cbBufSize, ASN1decoding_t pParent); - -WINPR_API ASN1error_e ASN1_Decode(ASN1decoding_t pDecoderInfo, void** ppDataStruct, ASN1uint32_t nPduNum, - ASN1uint32_t dwFlags, ASN1octet_t* pbBuf, ASN1uint32_t cbBufSize); - -WINPR_API void ASN1_CloseDecoder(ASN1decoding_t pDecoderInfo); - -WINPR_API void ASN1_FreeEncoded(ASN1encoding_t pEncoderInfo, void* pBuf); - -WINPR_API void ASN1_FreeDecoded(ASN1decoding_t pDecoderInfo, void* pDataStruct, ASN1uint32_t nPduNum); - -enum tagASN1option_e -{ - ASN1OPT_CHANGE_RULE = 0x101, - ASN1OPT_GET_RULE = 0x201, - ASN1OPT_NOT_REUSE_BUFFER = 0x301, - ASN1OPT_REWIND_BUFFER = 0x302, - ASN1OPT_SET_DECODED_BUFFER = 0x501, - ASN1OPT_DEL_DECODED_BUFFER = 0x502, - ASN1OPT_GET_DECODED_BUFFER_SIZE = 0x601, -}; -typedef enum tagASN1option_e ASN1option_e; - -struct tagASN1optionparam_t -{ - ASN1option_e eOption; - - union + struct tagASN1bitstring_t { - ASN1encodingrule_e eRule; - ASN1uint32_t cbRequiredDecodedBufSize; - - struct - { - ASN1octet_t* pbBuf; - ASN1uint32_t cbBufSize; - } Buffer; + ASN1uint32_t length; + ASN1octet_t* value; }; -}; -typedef struct tagASN1optionparam_t ASN1optionparam_t; -typedef struct tagASN1optionparam_t ASN1optionparam_s; + typedef struct tagASN1bitstring_t ASN1bitstring_t; -WINPR_API ASN1error_e ASN1_SetEncoderOption(ASN1encoding_t pEncoderInfo, ASN1optionparam_t* pOptParam); -WINPR_API ASN1error_e ASN1_GetEncoderOption(ASN1encoding_t pEncoderInfo, ASN1optionparam_t* pOptParam); + typedef char ASN1char_t; -WINPR_API ASN1error_e ASN1_SetDecoderOption(ASN1decoding_t pDecoderInfo, ASN1optionparam_t* pOptParam); -WINPR_API ASN1error_e ASN1_GetDecoderOption(ASN1decoding_t pDecoderInfo, ASN1optionparam_t* pOptParam); + struct tagASN1charstring_t + { + ASN1uint32_t length; + ASN1char_t* value; + }; + typedef struct tagASN1charstring_t ASN1charstring_t; -WINPR_API void ASN1bitstring_free(ASN1bitstring_t* bitstring); -WINPR_API void ASN1octetstring_free(ASN1octetstring_t* octetstring); -WINPR_API void ASN1objectidentifier_free(ASN1objectidentifier_t* objectidentifier); -WINPR_API void ASN1charstring_free(ASN1charstring_t* charstring); -WINPR_API void ASN1char16string_free(ASN1char16string_t* char16string); -WINPR_API void ASN1char32string_free(ASN1char32string_t* char32string); -WINPR_API void ASN1ztcharstring_free(ASN1ztcharstring_t ztcharstring); -WINPR_API void ASN1ztchar16string_free(ASN1ztchar16string_t ztchar16string); -WINPR_API void ASN1ztchar32string_free(ASN1ztchar32string_t ztchar32string); -WINPR_API void ASN1open_free(ASN1open_t* open); -WINPR_API void ASN1utf8string_free(ASN1wstring_t* utf8string); + typedef ASN1uint16_t ASN1char16_t; -WINPR_API LPVOID ASN1DecAlloc(ASN1decoding_t dec, ASN1uint32_t size); -WINPR_API LPVOID ASN1DecRealloc(ASN1decoding_t dec, LPVOID ptr, ASN1uint32_t size); + struct tagASN1char16string_t + { + ASN1uint32_t length; + ASN1char16_t* value; + }; + typedef struct tagASN1char16string_t ASN1char16string_t; -WINPR_API void ASN1Free(LPVOID ptr); + typedef ASN1uint32_t ASN1char32_t; -WINPR_API ASN1error_e ASN1EncSetError(ASN1encoding_t enc, ASN1error_e err); -WINPR_API ASN1error_e ASN1DecSetError(ASN1decoding_t dec, ASN1error_e err); + struct tagASN1char32string_t + { + ASN1uint32_t length; + ASN1char32_t* value; + }; + typedef struct tagASN1char32string_t ASN1char32string_t; -WINPR_API ASN1uint32_t ASN1intx_uoctets(ASN1intx_t* intx); -WINPR_API void ASN1intx_free(ASN1intx_t* intx); -WINPR_API ASN1int32_t ASN1intx2int32(ASN1intx_t* intx); -WINPR_API ASN1uint32_t ASN1intx2uint32(ASN1intx_t* intx); -WINPR_API int ASN1intxisuint32(ASN1intx_t* intx); -WINPR_API void ASN1intx_setuint32(ASN1intx_t* dst, ASN1uint32_t val); + typedef ASN1char_t* ASN1ztcharstring_t; + typedef ASN1char16_t* ASN1ztchar16string_t; + typedef ASN1char32_t* ASN1ztchar32string_t; -WINPR_API ASN1uint32_t ASN1uint32_uoctets(ASN1uint32_t val); + struct tagASN1wstring_t + { + ASN1uint32_t length; + WCHAR* value; + }; + typedef struct tagASN1wstring_t ASN1wstring_t; -WINPR_API int ASN1intx_cmp(ASN1intx_t* intx1, ASN1intx_t* intx2); -WINPR_API int ASN1objectidentifier_cmp(ASN1objectidentifier_t* oid1, ASN1objectidentifier_t* oid2); -WINPR_API int ASN1objectidentifier2_cmp(ASN1objectidentifier2_t* oid1, ASN1objectidentifier2_t* oid2); -WINPR_API int ASN1bitstring_cmp(ASN1bitstring_t* str1, ASN1bitstring_t* str2, int length); -WINPR_API int ASN1octetstring_cmp(ASN1octetstring_t* str1, ASN1octetstring_t* str2); -WINPR_API int ASN1charstring_cmp(ASN1charstring_t* str1, ASN1charstring_t* str2); -WINPR_API int ASN1char16string_cmp(ASN1char16string_t* str1, ASN1char16string_t* str2); -WINPR_API int ASN1char32string_cmp(ASN1char32string_t* str1, ASN1char32string_t* str2); -WINPR_API int ASN1ztcharstring_cmp(ASN1ztcharstring_t str1, ASN1ztcharstring_t str2); -WINPR_API int ASN1ztchar16string_cmp(ASN1ztchar16string_t str1, ASN1ztchar16string_t str2); -WINPR_API int ASN1ztchar32string_cmp(ASN1ztchar32string_t str1, ASN1ztchar32string_t str2); -WINPR_API int ASN1open_cmp(ASN1open_t* open1, ASN1open_t* open2); -WINPR_API int ASN1generalizedtime_cmp(ASN1generalizedtime_t* t1, ASN1generalizedtime_t* t2); -WINPR_API int ASN1utctime_cmp(ASN1utctime_t* t1, ASN1utctime_t* t2); + struct ASN1objectidentifier_s + { + struct ASN1objectidentifier_s* next; + ASN1uint32_t value; + }; + typedef struct ASN1objectidentifier_s* ASN1objectidentifier_t; -WINPR_API int ASN1BEREncCharString(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t len, ASN1char_t* val); -WINPR_API int ASN1DEREncCharString(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t len, ASN1char_t* val); -WINPR_API int ASN1BEREncChar16String(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t len, ASN1char16_t* val); -WINPR_API int ASN1DEREncChar16String(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t len, ASN1char16_t* val); -WINPR_API int ASN1BEREncChar32String(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t len, ASN1char32_t* val); -WINPR_API int ASN1DEREncChar32String(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t len, ASN1char32_t* val); -WINPR_API int ASN1BEREncOctetString(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t len, ASN1octet_t* val); -WINPR_API int ASN1DEREncOctetString(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t len, ASN1octet_t* val); -WINPR_API int ASN1BEREncBitString(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t bitlen, ASN1octet_t* val); -WINPR_API int ASN1DEREncBitString(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t bitlen, ASN1octet_t* val); -WINPR_API int ASN1BEREncGeneralizedTime(ASN1encoding_t enc, ASN1uint32_t tag, ASN1generalizedtime_t* val); -WINPR_API int ASN1DEREncGeneralizedTime(ASN1encoding_t enc, ASN1uint32_t tag, ASN1generalizedtime_t* val); -WINPR_API int ASN1BEREncS32(ASN1encoding_t enc, ASN1uint32_t tag, ASN1int32_t val); -WINPR_API int ASN1BEREncSX(ASN1encoding_t enc, ASN1uint32_t tag, ASN1intx_t* val); -WINPR_API int ASN1BEREncZeroMultibyteString(ASN1encoding_t enc, ASN1uint32_t tag, ASN1ztcharstring_t val); -WINPR_API int ASN1DEREncZeroMultibyteString(ASN1encoding_t enc, ASN1uint32_t tag, ASN1ztcharstring_t val); -WINPR_API int ASN1BEREncMultibyteString(ASN1encoding_t enc, ASN1uint32_t tag, ASN1charstring_t* val); -WINPR_API int ASN1DEREncMultibyteString(ASN1encoding_t enc, ASN1uint32_t tag, ASN1charstring_t* val); -WINPR_API int ASN1BEREncNull(ASN1encoding_t enc, ASN1uint32_t tag); -WINPR_API int ASN1BEREncObjectIdentifier(ASN1encoding_t enc, ASN1uint32_t tag, ASN1objectidentifier_t* val); -WINPR_API int ASN1BEREncObjectIdentifier2(ASN1encoding_t enc, ASN1uint32_t tag, ASN1objectidentifier2_t* val); -WINPR_API int ASN1BEREncRemoveZeroBits(ASN1uint32_t* nbits,ASN1octet_t* val); -WINPR_API int ASN1BEREncRemoveZeroBits2(ASN1uint32_t* nbits,ASN1octet_t* val,ASN1uint32_t minlen); -WINPR_API int ASN1BEREncUTCTime(ASN1encoding_t enc, ASN1uint32_t tag, ASN1utctime_t* val); -WINPR_API int ASN1DEREncUTCTime(ASN1encoding_t enc, ASN1uint32_t tag, ASN1utctime_t* val); -WINPR_API int ASN1BEREncFlush(ASN1encoding_t enc); -WINPR_API int ASN1BEREncOpenType(ASN1encoding_t enc, ASN1open_t* val); -WINPR_API int ASN1BERDecExplicitTag(ASN1decoding_t dec, ASN1uint32_t tag, ASN1decoding_t* dd, ASN1octet_t* *ppBufEnd); + struct tagASN1objectidentifier2_t + { + ASN1uint16_t count; + ASN1uint32_t value[16]; + }; + typedef struct tagASN1objectidentifier2_t ASN1objectidentifier2_t; -WINPR_API int ASN1BERDecEndOfContents(ASN1decoding_t dec, ASN1decoding_t dd, ASN1octet_t* pBufEnd); -WINPR_API int ASN1BERDecOctetString(ASN1decoding_t dec, ASN1uint32_t tag, ASN1octetstring_t* val); -WINPR_API int ASN1BERDecOctetString2(ASN1decoding_t dec, ASN1uint32_t tag, ASN1octetstring_t* val); -WINPR_API int ASN1BERDecBitString(ASN1decoding_t dec, ASN1uint32_t tag, ASN1bitstring_t* val); -WINPR_API int ASN1BERDecBitString2(ASN1decoding_t dec, ASN1uint32_t tag, ASN1bitstring_t* val); -WINPR_API int ASN1BERDecChar16String(ASN1decoding_t dec, ASN1uint32_t tag, ASN1char16string_t* val); -WINPR_API int ASN1BERDecChar32String(ASN1decoding_t dec, ASN1uint32_t tag, ASN1char32string_t* val); -WINPR_API int ASN1BERDecCharString(ASN1decoding_t dec, ASN1uint32_t tag, ASN1charstring_t* val); -WINPR_API int ASN1BERDecGeneralizedTime(ASN1decoding_t dec, ASN1uint32_t tag, ASN1generalizedtime_t* val); -WINPR_API int ASN1BERDecZeroMultibyteString(ASN1decoding_t dec, ASN1uint32_t tag, ASN1ztcharstring_t* val); -WINPR_API int ASN1BERDecMultibyteString(ASN1decoding_t dec, ASN1uint32_t tag, ASN1charstring_t* val); -WINPR_API int ASN1BERDecNull(ASN1decoding_t dec, ASN1uint32_t tag); -WINPR_API int ASN1BERDecObjectIdentifier(ASN1decoding_t dec, ASN1uint32_t tag, ASN1objectidentifier_t* val); -WINPR_API int ASN1BERDecObjectIdentifier2(ASN1decoding_t dec, ASN1uint32_t tag, ASN1objectidentifier2_t* val); -WINPR_API int ASN1BERDecS8Val(ASN1decoding_t dec, ASN1uint32_t tag, ASN1int8_t* val); -WINPR_API int ASN1BERDecS16Val(ASN1decoding_t dec, ASN1uint32_t tag, ASN1int16_t* val); -WINPR_API int ASN1BERDecS32Val(ASN1decoding_t dec, ASN1uint32_t tag, ASN1int32_t* val); -WINPR_API int ASN1BERDecSXVal(ASN1decoding_t dec, ASN1uint32_t tag, ASN1intx_t* val); -WINPR_API int ASN1BERDecU8Val(ASN1decoding_t dec, ASN1uint32_t tag, ASN1uint8_t* val); -WINPR_API int ASN1BERDecU16Val(ASN1decoding_t dec, ASN1uint32_t tag, ASN1uint16_t* val); -WINPR_API int ASN1BERDecU32Val(ASN1decoding_t dec, ASN1uint32_t tag, ASN1uint32_t* val); -WINPR_API int ASN1BERDecUTCTime(ASN1decoding_t dec, ASN1uint32_t tag, ASN1utctime_t* val); -WINPR_API int ASN1BERDecZeroCharString(ASN1decoding_t dec, ASN1uint32_t tag, ASN1ztcharstring_t* val); -WINPR_API int ASN1BERDecZeroChar16String(ASN1decoding_t dec, ASN1uint32_t tag, ASN1ztchar16string_t* val); -WINPR_API int ASN1BERDecZeroChar32String(ASN1decoding_t dec, ASN1uint32_t tag, ASN1ztchar32string_t* val); -WINPR_API int ASN1BERDecSkip(ASN1decoding_t dec); -WINPR_API int ASN1BERDecFlush(ASN1decoding_t dec); -WINPR_API int ASN1BERDecOpenType(ASN1decoding_t dec, ASN1open_t* val); -WINPR_API int ASN1BERDecOpenType2(ASN1decoding_t dec, ASN1open_t* val); + struct tagASN1encodedOID_t + { + ASN1uint16_t length; + ASN1octet_t* value; + }; + typedef struct tagASN1encodedOID_t ASN1encodedOID_t; -WINPR_API int ASN1BEREncCheck(ASN1encoding_t enc, ASN1uint32_t noctets); -WINPR_API int ASN1BEREncTag(ASN1encoding_t enc, ASN1uint32_t tag); -WINPR_API int ASN1BEREncExplicitTag(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t* pnLenOff); -WINPR_API int ASN1BEREncEndOfContents(ASN1encoding_t enc, ASN1uint32_t nLenOff); -WINPR_API int ASN1BEREncLength(ASN1encoding_t enc, ASN1uint32_t len); + typedef ASN1ztcharstring_t ASN1objectdescriptor_t; -WINPR_API int ASN1BERDecCheck(ASN1decoding_t dec, ASN1uint32_t len); -WINPR_API int ASN1BERDecTag(ASN1decoding_t dec, ASN1uint32_t tag, ASN1uint32_t* constructed); -WINPR_API int ASN1BERDecLength(ASN1decoding_t dec, ASN1uint32_t* len, ASN1uint32_t* infinite); -WINPR_API int ASN1BERDecNotEndOfContents(ASN1decoding_t dec, ASN1octet_t* pBufEnd); -WINPR_API int ASN1BERDecPeekTag(ASN1decoding_t dec, ASN1uint32_t* tag); + struct tagASN1generalizedtime_t + { + ASN1uint16_t year; + ASN1uint8_t month; + ASN1uint8_t day; + ASN1uint8_t hour; + ASN1uint8_t minute; + ASN1uint8_t second; + ASN1uint16_t millisecond; + ASN1bool_t universal; + ASN1int16_t diff; + }; + typedef struct tagASN1generalizedtime_t ASN1generalizedtime_t; -WINPR_API int ASN1BEREncU32(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t val); -WINPR_API int ASN1BEREncBool(ASN1encoding_t enc, ASN1uint32_t tag, ASN1bool_t val); -WINPR_API int ASN1BERDecBool(ASN1decoding_t dec, ASN1uint32_t tag, ASN1bool_t* val); -WINPR_API int ASN1BEREncEoid(ASN1encoding_t enc, ASN1uint32_t tag, ASN1encodedOID_t* val); -WINPR_API int ASN1BERDecEoid(ASN1decoding_t dec, ASN1uint32_t tag, ASN1encodedOID_t* val); -WINPR_API int ASN1BERDotVal2Eoid(ASN1encoding_t enc, char* pszDotVal, ASN1encodedOID_t* pOut); -WINPR_API int ASN1BEREoid2DotVal(ASN1decoding_t dec, ASN1encodedOID_t* pIn, char** ppszDotVal); -WINPR_API void ASN1BEREoid_free(ASN1encodedOID_t* val); -WINPR_API int ASN1BEREncUTF8String(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t length, WCHAR* value); -WINPR_API int ASN1DEREncUTF8String(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t length, WCHAR* value); -WINPR_API int ASN1BERDecUTF8String(ASN1decoding_t dec, ASN1uint32_t tag, ASN1wstring_t* val); -WINPR_API int ASN1DEREncBeginBlk(ASN1encoding_t enc, ASN1blocktype_e eBlkType, void** ppBlk); -WINPR_API int ASN1DEREncNewBlkElement(void* pBlk, ASN1encoding_t* enc2); -WINPR_API int ASN1DEREncFlushBlkElement(void* pBlk); -WINPR_API int ASN1DEREncEndBlk(void* pBlk); + struct tagASN1utctime_t + { + ASN1uint8_t year; + ASN1uint8_t month; + ASN1uint8_t day; + ASN1uint8_t hour; + ASN1uint8_t minute; + ASN1uint8_t second; + ASN1bool_t universal; + ASN1int16_t diff; + }; + typedef struct tagASN1utctime_t ASN1utctime_t; + + struct tagASN1open_t + { + ASN1uint32_t length; + + union { + void* encoded; + void* value; + }; + }; + typedef struct tagASN1open_t ASN1open_t; + + enum tagASN1blocktype_e + { + ASN1_DER_SET_OF_BLOCK, + }; + typedef enum tagASN1blocktype_e ASN1blocktype_e; + + typedef ASN1int32_t ASN1enum_t; + typedef ASN1uint16_t ASN1choice_t; + typedef ASN1uint32_t ASN1magic_t; + + enum + { + ASN1_CHOICE_BASE = 1, + ASN1_CHOICE_INVALID = -1, + ASN1_CHOICE_EXTENSION = 0, + }; + + enum tagASN1error_e + { + ASN1_SUCCESS = 0, + ASN1_ERR_INTERNAL = -1001, + ASN1_ERR_EOD = -1002, + ASN1_ERR_CORRUPT = -1003, + ASN1_ERR_LARGE = -1004, + ASN1_ERR_CONSTRAINT = -1005, + ASN1_ERR_MEMORY = -1006, + ASN1_ERR_OVERFLOW = -1007, + ASN1_ERR_BADPDU = -1008, + ASN1_ERR_BADARGS = -1009, + ASN1_ERR_BADREAL = -1010, + ASN1_ERR_BADTAG = -1011, + ASN1_ERR_CHOICE = -1012, + ASN1_ERR_RULE = -1013, + ASN1_ERR_UTF8 = -1014, + ASN1_ERR_PDU_TYPE = -1051, + ASN1_ERR_NYI = -1052, + ASN1_WRN_EXTENDED = 1001, + ASN1_WRN_NOEOD = 1002, + }; + typedef enum tagASN1error_e ASN1error_e; + + enum tagASN1encodingrule_e + { + ASN1_BER_RULE_BER = 0x0100, + ASN1_BER_RULE_CER = 0x0200, + ASN1_BER_RULE_DER = 0x0400, + ASN1_BER_RULE = ASN1_BER_RULE_BER | ASN1_BER_RULE_CER | ASN1_BER_RULE_DER, + }; + typedef enum tagASN1encodingrule_e ASN1encodingrule_e; + + typedef struct ASN1encoding_s* ASN1encoding_t; + typedef struct ASN1decoding_s* ASN1decoding_t; + + typedef ASN1int32_t (*ASN1BerEncFun_t)(ASN1encoding_t enc, ASN1uint32_t tag, void* data); + typedef ASN1int32_t (*ASN1BerDecFun_t)(ASN1decoding_t enc, ASN1uint32_t tag, void* data); + + struct tagASN1BerFunArr_t + { + const ASN1BerEncFun_t* apfnEncoder; + const ASN1BerDecFun_t* apfnDecoder; + }; + typedef struct tagASN1BerFunArr_t ASN1BerFunArr_t; + + typedef void (*ASN1GenericFun_t)(void); + typedef void (*ASN1FreeFun_t)(void* data); + + struct tagASN1module_t + { + ASN1magic_t nModuleName; + ASN1encodingrule_e eRule; + ASN1uint32_t dwFlags; + ASN1uint32_t cPDUs; + const ASN1FreeFun_t* apfnFreeMemory; + const ASN1uint32_t* acbStructSize; + ASN1BerFunArr_t BER; + }; + typedef struct tagASN1module_t* ASN1module_t; + + struct ASN1encoding_s + { + ASN1magic_t magic; + ASN1uint32_t version; + ASN1module_t module; + ASN1octet_t* buf; + ASN1uint32_t size; + ASN1uint32_t len; + ASN1error_e err; + ASN1uint32_t bit; + ASN1octet_t* pos; + ASN1uint32_t cbExtraHeader; + ASN1encodingrule_e eRule; + ASN1uint32_t dwFlags; + }; + + struct ASN1decoding_s + { + ASN1magic_t magic; + ASN1uint32_t version; + ASN1module_t module; + ASN1octet_t* buf; + ASN1uint32_t size; + ASN1uint32_t len; + ASN1error_e err; + ASN1uint32_t bit; + ASN1octet_t* pos; + ASN1encodingrule_e eRule; + ASN1uint32_t dwFlags; + }; + + enum + { + ASN1FLAGS_NONE = 0x00000000L, + ASN1FLAGS_NOASSERT = 0x00001000L, + }; + + enum + { + ASN1ENCODE_APPEND = 0x00000001L, + ASN1ENCODE_REUSEBUFFER = 0x00000004L, + ASN1ENCODE_SETBUFFER = 0x00000008L, + ASN1ENCODE_ALLOCATEBUFFER = 0x00000010L, + ASN1ENCODE_NOASSERT = ASN1FLAGS_NOASSERT, + }; + + enum + { + ASN1DECODE_APPENDED = 0x00000001L, + ASN1DECODE_REWINDBUFFER = 0x00000004L, + ASN1DECODE_SETBUFFER = 0x00000008L, + ASN1DECODE_AUTOFREEBUFFER = 0x00000010L, + ASN1DECODE_NOASSERT = ASN1FLAGS_NOASSERT, + }; + + WINPR_API ASN1module_t ASN1_CreateModule(ASN1uint32_t nVersion, ASN1encodingrule_e eRule, + ASN1uint32_t dwFlags, ASN1uint32_t cPDU, + const ASN1GenericFun_t apfnEncoder[], + const ASN1GenericFun_t apfnDecoder[], + const ASN1FreeFun_t apfnFreeMemory[], + const ASN1uint32_t acbStructSize[], + ASN1magic_t nModuleName); + + WINPR_API void ASN1_CloseModule(ASN1module_t pModule); + + WINPR_API ASN1error_e ASN1_CreateEncoder(ASN1module_t pModule, ASN1encoding_t* ppEncoderInfo, + ASN1octet_t* pbBuf, ASN1uint32_t cbBufSize, + ASN1encoding_t pParent); + + WINPR_API ASN1error_e ASN1_Encode(ASN1encoding_t pEncoderInfo, void* pDataStruct, + ASN1uint32_t nPduNum, ASN1uint32_t dwFlags, + ASN1octet_t* pbBuf, ASN1uint32_t cbBufSize); + + WINPR_API void ASN1_CloseEncoder(ASN1encoding_t pEncoderInfo); + + WINPR_API void ASN1_CloseEncoder2(ASN1encoding_t pEncoderInfo); + + WINPR_API ASN1error_e ASN1_CreateDecoder(ASN1module_t pModule, ASN1decoding_t* ppDecoderInfo, + ASN1octet_t* pbBuf, ASN1uint32_t cbBufSize, + ASN1decoding_t pParent); + + WINPR_API ASN1error_e ASN1_Decode(ASN1decoding_t pDecoderInfo, void** ppDataStruct, + ASN1uint32_t nPduNum, ASN1uint32_t dwFlags, + ASN1octet_t* pbBuf, ASN1uint32_t cbBufSize); + + WINPR_API void ASN1_CloseDecoder(ASN1decoding_t pDecoderInfo); + + WINPR_API void ASN1_FreeEncoded(ASN1encoding_t pEncoderInfo, void* pBuf); + + WINPR_API void ASN1_FreeDecoded(ASN1decoding_t pDecoderInfo, void* pDataStruct, + ASN1uint32_t nPduNum); + + enum tagASN1option_e + { + ASN1OPT_CHANGE_RULE = 0x101, + ASN1OPT_GET_RULE = 0x201, + ASN1OPT_NOT_REUSE_BUFFER = 0x301, + ASN1OPT_REWIND_BUFFER = 0x302, + ASN1OPT_SET_DECODED_BUFFER = 0x501, + ASN1OPT_DEL_DECODED_BUFFER = 0x502, + ASN1OPT_GET_DECODED_BUFFER_SIZE = 0x601, + }; + typedef enum tagASN1option_e ASN1option_e; + + struct tagASN1optionparam_t + { + ASN1option_e eOption; + + union { + ASN1encodingrule_e eRule; + ASN1uint32_t cbRequiredDecodedBufSize; + + struct + { + ASN1octet_t* pbBuf; + ASN1uint32_t cbBufSize; + } Buffer; + }; + }; + typedef struct tagASN1optionparam_t ASN1optionparam_t; + typedef struct tagASN1optionparam_t ASN1optionparam_s; + + WINPR_API ASN1error_e ASN1_SetEncoderOption(ASN1encoding_t pEncoderInfo, + ASN1optionparam_t* pOptParam); + WINPR_API ASN1error_e ASN1_GetEncoderOption(ASN1encoding_t pEncoderInfo, + ASN1optionparam_t* pOptParam); + + WINPR_API ASN1error_e ASN1_SetDecoderOption(ASN1decoding_t pDecoderInfo, + ASN1optionparam_t* pOptParam); + WINPR_API ASN1error_e ASN1_GetDecoderOption(ASN1decoding_t pDecoderInfo, + ASN1optionparam_t* pOptParam); + + WINPR_API void ASN1bitstring_free(ASN1bitstring_t* bitstring); + WINPR_API void ASN1octetstring_free(ASN1octetstring_t* octetstring); + WINPR_API void ASN1objectidentifier_free(ASN1objectidentifier_t* objectidentifier); + WINPR_API void ASN1charstring_free(ASN1charstring_t* charstring); + WINPR_API void ASN1char16string_free(ASN1char16string_t* char16string); + WINPR_API void ASN1char32string_free(ASN1char32string_t* char32string); + WINPR_API void ASN1ztcharstring_free(ASN1ztcharstring_t ztcharstring); + WINPR_API void ASN1ztchar16string_free(ASN1ztchar16string_t ztchar16string); + WINPR_API void ASN1ztchar32string_free(ASN1ztchar32string_t ztchar32string); + WINPR_API void ASN1open_free(ASN1open_t* open); + WINPR_API void ASN1utf8string_free(ASN1wstring_t* utf8string); + + WINPR_API LPVOID ASN1DecAlloc(ASN1decoding_t dec, ASN1uint32_t size); + WINPR_API LPVOID ASN1DecRealloc(ASN1decoding_t dec, LPVOID ptr, ASN1uint32_t size); + + WINPR_API void ASN1Free(LPVOID ptr); + + WINPR_API ASN1error_e ASN1EncSetError(ASN1encoding_t enc, ASN1error_e err); + WINPR_API ASN1error_e ASN1DecSetError(ASN1decoding_t dec, ASN1error_e err); + + WINPR_API ASN1uint32_t ASN1intx_uoctets(ASN1intx_t* intx); + WINPR_API void ASN1intx_free(ASN1intx_t* intx); + WINPR_API ASN1int32_t ASN1intx2int32(ASN1intx_t* intx); + WINPR_API ASN1uint32_t ASN1intx2uint32(ASN1intx_t* intx); + WINPR_API int ASN1intxisuint32(ASN1intx_t* intx); + WINPR_API void ASN1intx_setuint32(ASN1intx_t* dst, ASN1uint32_t val); + + WINPR_API ASN1uint32_t ASN1uint32_uoctets(ASN1uint32_t val); + + WINPR_API int ASN1intx_cmp(ASN1intx_t* intx1, ASN1intx_t* intx2); + WINPR_API int ASN1objectidentifier_cmp(ASN1objectidentifier_t* oid1, + ASN1objectidentifier_t* oid2); + WINPR_API int ASN1objectidentifier2_cmp(ASN1objectidentifier2_t* oid1, + ASN1objectidentifier2_t* oid2); + WINPR_API int ASN1bitstring_cmp(ASN1bitstring_t* str1, ASN1bitstring_t* str2, int length); + WINPR_API int ASN1octetstring_cmp(ASN1octetstring_t* str1, ASN1octetstring_t* str2); + WINPR_API int ASN1charstring_cmp(ASN1charstring_t* str1, ASN1charstring_t* str2); + WINPR_API int ASN1char16string_cmp(ASN1char16string_t* str1, ASN1char16string_t* str2); + WINPR_API int ASN1char32string_cmp(ASN1char32string_t* str1, ASN1char32string_t* str2); + WINPR_API int ASN1ztcharstring_cmp(ASN1ztcharstring_t str1, ASN1ztcharstring_t str2); + WINPR_API int ASN1ztchar16string_cmp(ASN1ztchar16string_t str1, ASN1ztchar16string_t str2); + WINPR_API int ASN1ztchar32string_cmp(ASN1ztchar32string_t str1, ASN1ztchar32string_t str2); + WINPR_API int ASN1open_cmp(ASN1open_t* open1, ASN1open_t* open2); + WINPR_API int ASN1generalizedtime_cmp(ASN1generalizedtime_t* t1, ASN1generalizedtime_t* t2); + WINPR_API int ASN1utctime_cmp(ASN1utctime_t* t1, ASN1utctime_t* t2); + + WINPR_API int ASN1BEREncCharString(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t len, + ASN1char_t* val); + WINPR_API int ASN1DEREncCharString(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t len, + ASN1char_t* val); + WINPR_API int ASN1BEREncChar16String(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t len, + ASN1char16_t* val); + WINPR_API int ASN1DEREncChar16String(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t len, + ASN1char16_t* val); + WINPR_API int ASN1BEREncChar32String(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t len, + ASN1char32_t* val); + WINPR_API int ASN1DEREncChar32String(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t len, + ASN1char32_t* val); + WINPR_API int ASN1BEREncOctetString(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t len, + ASN1octet_t* val); + WINPR_API int ASN1DEREncOctetString(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t len, + ASN1octet_t* val); + WINPR_API int ASN1BEREncBitString(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t bitlen, + ASN1octet_t* val); + WINPR_API int ASN1DEREncBitString(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t bitlen, + ASN1octet_t* val); + WINPR_API int ASN1BEREncGeneralizedTime(ASN1encoding_t enc, ASN1uint32_t tag, + ASN1generalizedtime_t* val); + WINPR_API int ASN1DEREncGeneralizedTime(ASN1encoding_t enc, ASN1uint32_t tag, + ASN1generalizedtime_t* val); + WINPR_API int ASN1BEREncS32(ASN1encoding_t enc, ASN1uint32_t tag, ASN1int32_t val); + WINPR_API int ASN1BEREncSX(ASN1encoding_t enc, ASN1uint32_t tag, ASN1intx_t* val); + WINPR_API int ASN1BEREncZeroMultibyteString(ASN1encoding_t enc, ASN1uint32_t tag, + ASN1ztcharstring_t val); + WINPR_API int ASN1DEREncZeroMultibyteString(ASN1encoding_t enc, ASN1uint32_t tag, + ASN1ztcharstring_t val); + WINPR_API int ASN1BEREncMultibyteString(ASN1encoding_t enc, ASN1uint32_t tag, + ASN1charstring_t* val); + WINPR_API int ASN1DEREncMultibyteString(ASN1encoding_t enc, ASN1uint32_t tag, + ASN1charstring_t* val); + WINPR_API int ASN1BEREncNull(ASN1encoding_t enc, ASN1uint32_t tag); + WINPR_API int ASN1BEREncObjectIdentifier(ASN1encoding_t enc, ASN1uint32_t tag, + ASN1objectidentifier_t* val); + WINPR_API int ASN1BEREncObjectIdentifier2(ASN1encoding_t enc, ASN1uint32_t tag, + ASN1objectidentifier2_t* val); + WINPR_API int ASN1BEREncRemoveZeroBits(ASN1uint32_t* nbits, ASN1octet_t* val); + WINPR_API int ASN1BEREncRemoveZeroBits2(ASN1uint32_t* nbits, ASN1octet_t* val, + ASN1uint32_t minlen); + WINPR_API int ASN1BEREncUTCTime(ASN1encoding_t enc, ASN1uint32_t tag, ASN1utctime_t* val); + WINPR_API int ASN1DEREncUTCTime(ASN1encoding_t enc, ASN1uint32_t tag, ASN1utctime_t* val); + WINPR_API int ASN1BEREncFlush(ASN1encoding_t enc); + WINPR_API int ASN1BEREncOpenType(ASN1encoding_t enc, ASN1open_t* val); + WINPR_API int ASN1BERDecExplicitTag(ASN1decoding_t dec, ASN1uint32_t tag, ASN1decoding_t* dd, + ASN1octet_t** ppBufEnd); + + WINPR_API int ASN1BERDecEndOfContents(ASN1decoding_t dec, ASN1decoding_t dd, + ASN1octet_t* pBufEnd); + WINPR_API int ASN1BERDecOctetString(ASN1decoding_t dec, ASN1uint32_t tag, + ASN1octetstring_t* val); + WINPR_API int ASN1BERDecOctetString2(ASN1decoding_t dec, ASN1uint32_t tag, + ASN1octetstring_t* val); + WINPR_API int ASN1BERDecBitString(ASN1decoding_t dec, ASN1uint32_t tag, ASN1bitstring_t* val); + WINPR_API int ASN1BERDecBitString2(ASN1decoding_t dec, ASN1uint32_t tag, ASN1bitstring_t* val); + WINPR_API int ASN1BERDecChar16String(ASN1decoding_t dec, ASN1uint32_t tag, + ASN1char16string_t* val); + WINPR_API int ASN1BERDecChar32String(ASN1decoding_t dec, ASN1uint32_t tag, + ASN1char32string_t* val); + WINPR_API int ASN1BERDecCharString(ASN1decoding_t dec, ASN1uint32_t tag, ASN1charstring_t* val); + WINPR_API int ASN1BERDecGeneralizedTime(ASN1decoding_t dec, ASN1uint32_t tag, + ASN1generalizedtime_t* val); + WINPR_API int ASN1BERDecZeroMultibyteString(ASN1decoding_t dec, ASN1uint32_t tag, + ASN1ztcharstring_t* val); + WINPR_API int ASN1BERDecMultibyteString(ASN1decoding_t dec, ASN1uint32_t tag, + ASN1charstring_t* val); + WINPR_API int ASN1BERDecNull(ASN1decoding_t dec, ASN1uint32_t tag); + WINPR_API int ASN1BERDecObjectIdentifier(ASN1decoding_t dec, ASN1uint32_t tag, + ASN1objectidentifier_t* val); + WINPR_API int ASN1BERDecObjectIdentifier2(ASN1decoding_t dec, ASN1uint32_t tag, + ASN1objectidentifier2_t* val); + WINPR_API int ASN1BERDecS8Val(ASN1decoding_t dec, ASN1uint32_t tag, ASN1int8_t* val); + WINPR_API int ASN1BERDecS16Val(ASN1decoding_t dec, ASN1uint32_t tag, ASN1int16_t* val); + WINPR_API int ASN1BERDecS32Val(ASN1decoding_t dec, ASN1uint32_t tag, ASN1int32_t* val); + WINPR_API int ASN1BERDecSXVal(ASN1decoding_t dec, ASN1uint32_t tag, ASN1intx_t* val); + WINPR_API int ASN1BERDecU8Val(ASN1decoding_t dec, ASN1uint32_t tag, ASN1uint8_t* val); + WINPR_API int ASN1BERDecU16Val(ASN1decoding_t dec, ASN1uint32_t tag, ASN1uint16_t* val); + WINPR_API int ASN1BERDecU32Val(ASN1decoding_t dec, ASN1uint32_t tag, ASN1uint32_t* val); + WINPR_API int ASN1BERDecUTCTime(ASN1decoding_t dec, ASN1uint32_t tag, ASN1utctime_t* val); + WINPR_API int ASN1BERDecZeroCharString(ASN1decoding_t dec, ASN1uint32_t tag, + ASN1ztcharstring_t* val); + WINPR_API int ASN1BERDecZeroChar16String(ASN1decoding_t dec, ASN1uint32_t tag, + ASN1ztchar16string_t* val); + WINPR_API int ASN1BERDecZeroChar32String(ASN1decoding_t dec, ASN1uint32_t tag, + ASN1ztchar32string_t* val); + WINPR_API int ASN1BERDecSkip(ASN1decoding_t dec); + WINPR_API int ASN1BERDecFlush(ASN1decoding_t dec); + WINPR_API int ASN1BERDecOpenType(ASN1decoding_t dec, ASN1open_t* val); + WINPR_API int ASN1BERDecOpenType2(ASN1decoding_t dec, ASN1open_t* val); + + WINPR_API int ASN1BEREncCheck(ASN1encoding_t enc, ASN1uint32_t noctets); + WINPR_API int ASN1BEREncTag(ASN1encoding_t enc, ASN1uint32_t tag); + WINPR_API int ASN1BEREncExplicitTag(ASN1encoding_t enc, ASN1uint32_t tag, + ASN1uint32_t* pnLenOff); + WINPR_API int ASN1BEREncEndOfContents(ASN1encoding_t enc, ASN1uint32_t nLenOff); + WINPR_API int ASN1BEREncLength(ASN1encoding_t enc, ASN1uint32_t len); + + WINPR_API int ASN1BERDecCheck(ASN1decoding_t dec, ASN1uint32_t len); + WINPR_API int ASN1BERDecTag(ASN1decoding_t dec, ASN1uint32_t tag, ASN1uint32_t* constructed); + WINPR_API int ASN1BERDecLength(ASN1decoding_t dec, ASN1uint32_t* len, ASN1uint32_t* infinite); + WINPR_API int ASN1BERDecNotEndOfContents(ASN1decoding_t dec, ASN1octet_t* pBufEnd); + WINPR_API int ASN1BERDecPeekTag(ASN1decoding_t dec, ASN1uint32_t* tag); + + WINPR_API int ASN1BEREncU32(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t val); + WINPR_API int ASN1BEREncBool(ASN1encoding_t enc, ASN1uint32_t tag, ASN1bool_t val); + WINPR_API int ASN1BERDecBool(ASN1decoding_t dec, ASN1uint32_t tag, ASN1bool_t* val); + WINPR_API int ASN1BEREncEoid(ASN1encoding_t enc, ASN1uint32_t tag, ASN1encodedOID_t* val); + WINPR_API int ASN1BERDecEoid(ASN1decoding_t dec, ASN1uint32_t tag, ASN1encodedOID_t* val); + WINPR_API int ASN1BERDotVal2Eoid(ASN1encoding_t enc, char* pszDotVal, ASN1encodedOID_t* pOut); + WINPR_API int ASN1BEREoid2DotVal(ASN1decoding_t dec, ASN1encodedOID_t* pIn, char** ppszDotVal); + WINPR_API void ASN1BEREoid_free(ASN1encodedOID_t* val); + WINPR_API int ASN1BEREncUTF8String(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t length, + WCHAR* value); + WINPR_API int ASN1DEREncUTF8String(ASN1encoding_t enc, ASN1uint32_t tag, ASN1uint32_t length, + WCHAR* value); + WINPR_API int ASN1BERDecUTF8String(ASN1decoding_t dec, ASN1uint32_t tag, ASN1wstring_t* val); + WINPR_API int ASN1DEREncBeginBlk(ASN1encoding_t enc, ASN1blocktype_e eBlkType, void** ppBlk); + WINPR_API int ASN1DEREncNewBlkElement(void* pBlk, ASN1encoding_t* enc2); + WINPR_API int ASN1DEREncFlushBlkElement(void* pBlk); + WINPR_API int ASN1DEREncEndBlk(void* pBlk); #ifdef __cplusplus } #endif #endif /* WINPR_ASN1_H */ - diff --git a/winpr/include/winpr/bcrypt.h b/winpr/include/winpr/bcrypt.h index cf9a784eb..ebba63b49 100644 --- a/winpr/include/winpr/bcrypt.h +++ b/winpr/include/winpr/bcrypt.h @@ -29,102 +29,111 @@ typedef PVOID BCRYPT_KEY_HANDLE; typedef PVOID BCRYPT_HASH_HANDLE; typedef PVOID BCRYPT_SECRET_HANDLE; -#define BCRYPT_RSA_ALGORITHM L"RSA" -#define BCRYPT_RSA_SIGN_ALGORITHM L"RSA_SIGN" -#define BCRYPT_DH_ALGORITHM L"DH" -#define BCRYPT_DSA_ALGORITHM L"DSA" -#define BCRYPT_RC2_ALGORITHM L"RC2" -#define BCRYPT_RC4_ALGORITHM L"RC4" -#define BCRYPT_AES_ALGORITHM L"AES" -#define BCRYPT_DES_ALGORITHM L"DES" -#define BCRYPT_DESX_ALGORITHM L"DESX" -#define BCRYPT_3DES_ALGORITHM L"3DES" -#define BCRYPT_3DES_112_ALGORITHM L"3DES_112" -#define BCRYPT_MD2_ALGORITHM L"MD2" -#define BCRYPT_MD4_ALGORITHM L"MD4" -#define BCRYPT_MD5_ALGORITHM L"MD5" -#define BCRYPT_SHA1_ALGORITHM L"SHA1" -#define BCRYPT_SHA256_ALGORITHM L"SHA256" -#define BCRYPT_SHA384_ALGORITHM L"SHA384" -#define BCRYPT_SHA512_ALGORITHM L"SHA512" -#define BCRYPT_AES_GMAC_ALGORITHM L"AES-GMAC" -#define BCRYPT_ECDSA_P256_ALGORITHM L"ECDSA_P256" -#define BCRYPT_ECDSA_P384_ALGORITHM L"ECDSA_P384" -#define BCRYPT_ECDSA_P521_ALGORITHM L"ECDSA_P521" -#define BCRYPT_ECDH_P256_ALGORITHM L"ECDH_P256" -#define BCRYPT_ECDH_P384_ALGORITHM L"ECDH_P384" -#define BCRYPT_ECDH_P521_ALGORITHM L"ECDH_P521" -#define BCRYPT_RNG_ALGORITHM L"RNG" -#define BCRYPT_RNG_FIPS186_DSA_ALGORITHM L"FIPS186DSARNG" -#define BCRYPT_RNG_DUAL_EC_ALGORITHM L"DUALECRNG" +#define BCRYPT_RSA_ALGORITHM L"RSA" +#define BCRYPT_RSA_SIGN_ALGORITHM L"RSA_SIGN" +#define BCRYPT_DH_ALGORITHM L"DH" +#define BCRYPT_DSA_ALGORITHM L"DSA" +#define BCRYPT_RC2_ALGORITHM L"RC2" +#define BCRYPT_RC4_ALGORITHM L"RC4" +#define BCRYPT_AES_ALGORITHM L"AES" +#define BCRYPT_DES_ALGORITHM L"DES" +#define BCRYPT_DESX_ALGORITHM L"DESX" +#define BCRYPT_3DES_ALGORITHM L"3DES" +#define BCRYPT_3DES_112_ALGORITHM L"3DES_112" +#define BCRYPT_MD2_ALGORITHM L"MD2" +#define BCRYPT_MD4_ALGORITHM L"MD4" +#define BCRYPT_MD5_ALGORITHM L"MD5" +#define BCRYPT_SHA1_ALGORITHM L"SHA1" +#define BCRYPT_SHA256_ALGORITHM L"SHA256" +#define BCRYPT_SHA384_ALGORITHM L"SHA384" +#define BCRYPT_SHA512_ALGORITHM L"SHA512" +#define BCRYPT_AES_GMAC_ALGORITHM L"AES-GMAC" +#define BCRYPT_ECDSA_P256_ALGORITHM L"ECDSA_P256" +#define BCRYPT_ECDSA_P384_ALGORITHM L"ECDSA_P384" +#define BCRYPT_ECDSA_P521_ALGORITHM L"ECDSA_P521" +#define BCRYPT_ECDH_P256_ALGORITHM L"ECDH_P256" +#define BCRYPT_ECDH_P384_ALGORITHM L"ECDH_P384" +#define BCRYPT_ECDH_P521_ALGORITHM L"ECDH_P521" +#define BCRYPT_RNG_ALGORITHM L"RNG" +#define BCRYPT_RNG_FIPS186_DSA_ALGORITHM L"FIPS186DSARNG" +#define BCRYPT_RNG_DUAL_EC_ALGORITHM L"DUALECRNG" -#define MS_PRIMITIVE_PROVIDER L"Microsoft Primitive Provider" +#define MS_PRIMITIVE_PROVIDER L"Microsoft Primitive Provider" -#define BCRYPT_ALG_HANDLE_HMAC_FLAG 0x00000008 -#define BCRYPT_PROV_DISPATCH 0x00000001 +#define BCRYPT_ALG_HANDLE_HMAC_FLAG 0x00000008 +#define BCRYPT_PROV_DISPATCH 0x00000001 -#define BCRYPT_OBJECT_LENGTH L"ObjectLength" -#define BCRYPT_ALGORITHM_NAME L"AlgorithmName" -#define BCRYPT_PROVIDER_HANDLE L"ProviderHandle" -#define BCRYPT_CHAINING_MODE L"ChainingMode" -#define BCRYPT_BLOCK_LENGTH L"BlockLength" -#define BCRYPT_KEY_LENGTH L"KeyLength" -#define BCRYPT_KEY_OBJECT_LENGTH L"KeyObjectLength" -#define BCRYPT_KEY_STRENGTH L"KeyStrength" -#define BCRYPT_KEY_LENGTHS L"KeyLengths" -#define BCRYPT_BLOCK_SIZE_LIST L"BlockSizeList" -#define BCRYPT_EFFECTIVE_KEY_LENGTH L"EffectiveKeyLength" -#define BCRYPT_HASH_LENGTH L"HashDigestLength" -#define BCRYPT_HASH_OID_LIST L"HashOIDList" -#define BCRYPT_PADDING_SCHEMES L"PaddingSchemes" -#define BCRYPT_SIGNATURE_LENGTH L"SignatureLength" -#define BCRYPT_HASH_BLOCK_LENGTH L"HashBlockLength" -#define BCRYPT_AUTH_TAG_LENGTH L"AuthTagLength" -#define BCRYPT_PRIMITIVE_TYPE L"PrimitiveType" -#define BCRYPT_IS_KEYED_HASH L"IsKeyedHash" +#define BCRYPT_OBJECT_LENGTH L"ObjectLength" +#define BCRYPT_ALGORITHM_NAME L"AlgorithmName" +#define BCRYPT_PROVIDER_HANDLE L"ProviderHandle" +#define BCRYPT_CHAINING_MODE L"ChainingMode" +#define BCRYPT_BLOCK_LENGTH L"BlockLength" +#define BCRYPT_KEY_LENGTH L"KeyLength" +#define BCRYPT_KEY_OBJECT_LENGTH L"KeyObjectLength" +#define BCRYPT_KEY_STRENGTH L"KeyStrength" +#define BCRYPT_KEY_LENGTHS L"KeyLengths" +#define BCRYPT_BLOCK_SIZE_LIST L"BlockSizeList" +#define BCRYPT_EFFECTIVE_KEY_LENGTH L"EffectiveKeyLength" +#define BCRYPT_HASH_LENGTH L"HashDigestLength" +#define BCRYPT_HASH_OID_LIST L"HashOIDList" +#define BCRYPT_PADDING_SCHEMES L"PaddingSchemes" +#define BCRYPT_SIGNATURE_LENGTH L"SignatureLength" +#define BCRYPT_HASH_BLOCK_LENGTH L"HashBlockLength" +#define BCRYPT_AUTH_TAG_LENGTH L"AuthTagLength" +#define BCRYPT_PRIMITIVE_TYPE L"PrimitiveType" +#define BCRYPT_IS_KEYED_HASH L"IsKeyedHash" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API NTSTATUS BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE* phAlgorithm, - LPCWSTR pszAlgId, LPCWSTR pszImplementation, ULONG dwFlags); + WINPR_API NTSTATUS BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE* phAlgorithm, LPCWSTR pszAlgId, + LPCWSTR pszImplementation, ULONG dwFlags); -WINPR_API NTSTATUS BCryptCloseAlgorithmProvider(BCRYPT_ALG_HANDLE hAlgorithm, ULONG dwFlags); + WINPR_API NTSTATUS BCryptCloseAlgorithmProvider(BCRYPT_ALG_HANDLE hAlgorithm, ULONG dwFlags); -WINPR_API NTSTATUS BCryptGetProperty(BCRYPT_HANDLE hObject, LPCWSTR pszProperty, - PUCHAR pbOutput, ULONG cbOutput, ULONG* pcbResult, ULONG dwFlags); + WINPR_API NTSTATUS BCryptGetProperty(BCRYPT_HANDLE hObject, LPCWSTR pszProperty, + PUCHAR pbOutput, ULONG cbOutput, ULONG* pcbResult, + ULONG dwFlags); -WINPR_API NTSTATUS BCryptCreateHash(BCRYPT_ALG_HANDLE hAlgorithm, BCRYPT_HASH_HANDLE* phHash, - PUCHAR pbHashObject, ULONG cbHashObject, PUCHAR pbSecret, ULONG cbSecret, ULONG dwFlags); + WINPR_API NTSTATUS BCryptCreateHash(BCRYPT_ALG_HANDLE hAlgorithm, BCRYPT_HASH_HANDLE* phHash, + PUCHAR pbHashObject, ULONG cbHashObject, PUCHAR pbSecret, + ULONG cbSecret, ULONG dwFlags); -WINPR_API NTSTATUS BCryptDestroyHash(BCRYPT_HASH_HANDLE hHash); + WINPR_API NTSTATUS BCryptDestroyHash(BCRYPT_HASH_HANDLE hHash); -WINPR_API NTSTATUS BCryptHashData(BCRYPT_HASH_HANDLE hHash, PUCHAR pbInput, ULONG cbInput, ULONG dwFlags); + WINPR_API NTSTATUS BCryptHashData(BCRYPT_HASH_HANDLE hHash, PUCHAR pbInput, ULONG cbInput, + ULONG dwFlags); -WINPR_API NTSTATUS BCryptFinishHash(BCRYPT_HASH_HANDLE hHash, PUCHAR pbOutput, ULONG cbOutput, ULONG dwFlags); + WINPR_API NTSTATUS BCryptFinishHash(BCRYPT_HASH_HANDLE hHash, PUCHAR pbOutput, ULONG cbOutput, + ULONG dwFlags); -WINPR_API NTSTATUS BCryptGenRandom(BCRYPT_ALG_HANDLE hAlgorithm, PUCHAR pbBuffer, ULONG cbBuffer, ULONG dwFlags); + WINPR_API NTSTATUS BCryptGenRandom(BCRYPT_ALG_HANDLE hAlgorithm, PUCHAR pbBuffer, + ULONG cbBuffer, ULONG dwFlags); -WINPR_API NTSTATUS BCryptGenerateSymmetricKey(BCRYPT_ALG_HANDLE hAlgorithm, BCRYPT_KEY_HANDLE* phKey, - PUCHAR pbKeyObject, ULONG cbKeyObject, PUCHAR pbSecret, ULONG cbSecret, ULONG dwFlags); + WINPR_API NTSTATUS BCryptGenerateSymmetricKey(BCRYPT_ALG_HANDLE hAlgorithm, + BCRYPT_KEY_HANDLE* phKey, PUCHAR pbKeyObject, + ULONG cbKeyObject, PUCHAR pbSecret, + ULONG cbSecret, ULONG dwFlags); -WINPR_API NTSTATUS BCryptGenerateKeyPair(BCRYPT_ALG_HANDLE hAlgorithm, BCRYPT_KEY_HANDLE* phKey, - ULONG dwLength, ULONG dwFlags); + WINPR_API NTSTATUS BCryptGenerateKeyPair(BCRYPT_ALG_HANDLE hAlgorithm, BCRYPT_KEY_HANDLE* phKey, + ULONG dwLength, ULONG dwFlags); -WINPR_API NTSTATUS BCryptImportKey(BCRYPT_ALG_HANDLE hAlgorithm, BCRYPT_KEY_HANDLE hImportKey, - LPCWSTR pszBlobType, BCRYPT_KEY_HANDLE *phKey, PUCHAR pbKeyObject, - ULONG cbKeyObject, PUCHAR pbInput, ULONG cbInput, ULONG dwFlags); + WINPR_API NTSTATUS BCryptImportKey(BCRYPT_ALG_HANDLE hAlgorithm, BCRYPT_KEY_HANDLE hImportKey, + LPCWSTR pszBlobType, BCRYPT_KEY_HANDLE* phKey, + PUCHAR pbKeyObject, ULONG cbKeyObject, PUCHAR pbInput, + ULONG cbInput, ULONG dwFlags); -WINPR_API NTSTATUS BCryptDestroyKey(BCRYPT_KEY_HANDLE hKey); + WINPR_API NTSTATUS BCryptDestroyKey(BCRYPT_KEY_HANDLE hKey); -WINPR_API NTSTATUS BCryptEncrypt(BCRYPT_KEY_HANDLE hKey, PUCHAR pbInput, ULONG cbInput, - VOID* pPaddingInfo, PUCHAR pbIV, ULONG cbIV, PUCHAR pbOutput, - ULONG cbOutput, ULONG* pcbResult, ULONG dwFlags); + WINPR_API NTSTATUS BCryptEncrypt(BCRYPT_KEY_HANDLE hKey, PUCHAR pbInput, ULONG cbInput, + VOID* pPaddingInfo, PUCHAR pbIV, ULONG cbIV, PUCHAR pbOutput, + ULONG cbOutput, ULONG* pcbResult, ULONG dwFlags); -WINPR_API NTSTATUS BCryptDecrypt(BCRYPT_KEY_HANDLE hKey, PUCHAR pbInput, ULONG cbInput, - VOID* pPaddingInfo, PUCHAR pbIV, ULONG cbIV, PUCHAR pbOutput, - ULONG cbOutput, ULONG* pcbResult, ULONG dwFlags); + WINPR_API NTSTATUS BCryptDecrypt(BCRYPT_KEY_HANDLE hKey, PUCHAR pbInput, ULONG cbInput, + VOID* pPaddingInfo, PUCHAR pbIV, ULONG cbIV, PUCHAR pbOutput, + ULONG cbOutput, ULONG* pcbResult, ULONG dwFlags); #ifdef __cplusplus } diff --git a/winpr/include/winpr/bitstream.h b/winpr/include/winpr/bitstream.h index f4db63f00..29e8ca4de 100644 --- a/winpr/include/winpr/bitstream.h +++ b/winpr/include/winpr/bitstream.h @@ -30,9 +30,9 @@ struct _wBitStream { const BYTE* buffer; BYTE* pointer; - UINT32 position; - UINT32 length; - UINT32 capacity; + UINT32 position; + UINT32 length; + UINT32 capacity; UINT32 mask; UINT32 offset; UINT32 prefetch; @@ -40,119 +40,134 @@ struct _wBitStream }; typedef struct _wBitStream wBitStream; -#define BITDUMP_MSB_FIRST 0x00000001 -#define BITDUMP_STDERR 0x00000002 +#define BITDUMP_MSB_FIRST 0x00000001 +#define BITDUMP_STDERR 0x00000002 #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -static INLINE void BitStream_Prefetch(wBitStream* _bs) -{ - (_bs->prefetch) = 0; - if (((UINT32) (_bs->pointer - _bs->buffer) + 4) < (_bs->capacity)) - (_bs->prefetch) |= (*(_bs->pointer + 4) << 24); - if (((UINT32) (_bs->pointer - _bs->buffer) + 5) < (_bs->capacity)) - (_bs->prefetch) |= (*(_bs->pointer + 5) << 16); - if (((UINT32) (_bs->pointer - _bs->buffer) + 6) < (_bs->capacity)) - (_bs->prefetch) |= (*(_bs->pointer + 6) << 8); - if (((UINT32) (_bs->pointer - _bs->buffer) + 7) < (_bs->capacity)) - (_bs->prefetch) |= (*(_bs->pointer + 7) << 0); -} + static INLINE void BitStream_Prefetch(wBitStream* _bs) + { + (_bs->prefetch) = 0; + if (((UINT32)(_bs->pointer - _bs->buffer) + 4) < (_bs->capacity)) + (_bs->prefetch) |= (*(_bs->pointer + 4) << 24); + if (((UINT32)(_bs->pointer - _bs->buffer) + 5) < (_bs->capacity)) + (_bs->prefetch) |= (*(_bs->pointer + 5) << 16); + if (((UINT32)(_bs->pointer - _bs->buffer) + 6) < (_bs->capacity)) + (_bs->prefetch) |= (*(_bs->pointer + 6) << 8); + if (((UINT32)(_bs->pointer - _bs->buffer) + 7) < (_bs->capacity)) + (_bs->prefetch) |= (*(_bs->pointer + 7) << 0); + } -static INLINE void BitStream_Fetch(wBitStream* _bs) -{ - (_bs->accumulator) = 0; - if (((UINT32) (_bs->pointer - _bs->buffer) + 0) < (_bs->capacity)) - (_bs->accumulator) |= (*(_bs->pointer + 0) << 24); - if (((UINT32) (_bs->pointer - _bs->buffer) + 1) < (_bs->capacity)) - (_bs->accumulator) |= (*(_bs->pointer + 1) << 16); - if (((UINT32) (_bs->pointer - _bs->buffer) + 2) < (_bs->capacity)) - (_bs->accumulator) |= (*(_bs->pointer + 2) << 8); - if (((UINT32) (_bs->pointer - _bs->buffer) + 3) <(_bs->capacity)) - (_bs->accumulator) |= (*(_bs->pointer + 3) << 0); - BitStream_Prefetch(_bs); -} + static INLINE void BitStream_Fetch(wBitStream* _bs) + { + (_bs->accumulator) = 0; + if (((UINT32)(_bs->pointer - _bs->buffer) + 0) < (_bs->capacity)) + (_bs->accumulator) |= (*(_bs->pointer + 0) << 24); + if (((UINT32)(_bs->pointer - _bs->buffer) + 1) < (_bs->capacity)) + (_bs->accumulator) |= (*(_bs->pointer + 1) << 16); + if (((UINT32)(_bs->pointer - _bs->buffer) + 2) < (_bs->capacity)) + (_bs->accumulator) |= (*(_bs->pointer + 2) << 8); + if (((UINT32)(_bs->pointer - _bs->buffer) + 3) < (_bs->capacity)) + (_bs->accumulator) |= (*(_bs->pointer + 3) << 0); + BitStream_Prefetch(_bs); + } -static INLINE void BitStream_Flush(wBitStream* _bs) -{ - if (((UINT32) (_bs->pointer - _bs->buffer) + 0) < (_bs->capacity)) - *(_bs->pointer + 0) = (_bs->accumulator >> 24); - if (((UINT32) (_bs->pointer - _bs->buffer) + 1) < (_bs->capacity)) - *(_bs->pointer + 1) = (_bs->accumulator >> 16); - if (((UINT32) (_bs->pointer - _bs->buffer) + 2) < (_bs->capacity)) - *(_bs->pointer + 2) = (_bs->accumulator >> 8); - if (((UINT32) (_bs->pointer - _bs->buffer) + 3) < (_bs->capacity)) - *(_bs->pointer + 3) = (_bs->accumulator >> 0); -} + static INLINE void BitStream_Flush(wBitStream* _bs) + { + if (((UINT32)(_bs->pointer - _bs->buffer) + 0) < (_bs->capacity)) + *(_bs->pointer + 0) = (_bs->accumulator >> 24); + if (((UINT32)(_bs->pointer - _bs->buffer) + 1) < (_bs->capacity)) + *(_bs->pointer + 1) = (_bs->accumulator >> 16); + if (((UINT32)(_bs->pointer - _bs->buffer) + 2) < (_bs->capacity)) + *(_bs->pointer + 2) = (_bs->accumulator >> 8); + if (((UINT32)(_bs->pointer - _bs->buffer) + 3) < (_bs->capacity)) + *(_bs->pointer + 3) = (_bs->accumulator >> 0); + } -static INLINE void BitStream_Shift(wBitStream* _bs, UINT32 _nbits) -{ - if (_nbits == 0) { - } else if ((_nbits > 0) && (_nbits < 32)) { - _bs->accumulator <<= _nbits; - _bs->position += _nbits; - _bs->offset += _nbits; - if (_bs->offset < 32) { - _bs->mask = ((1 << _nbits) - 1); - _bs->accumulator |= ((_bs->prefetch >> (32 - _nbits)) & _bs->mask); - _bs->prefetch <<= _nbits; - } else { - _bs->mask = ((1 << _nbits) - 1); - _bs->accumulator |= ((_bs->prefetch >> (32 - _nbits)) & _bs->mask); - _bs->prefetch <<= _nbits; - _bs->offset -= 32; - _bs->pointer += 4; - BitStream_Prefetch(_bs); - if (_bs->offset) { - _bs->mask = ((1 << _bs->offset) - 1); - _bs->accumulator |= ((_bs->prefetch >> (32 - _bs->offset)) & _bs->mask); - _bs->prefetch <<= _bs->offset; + static INLINE void BitStream_Shift(wBitStream* _bs, UINT32 _nbits) + { + if (_nbits == 0) + { + } + else if ((_nbits > 0) && (_nbits < 32)) + { + _bs->accumulator <<= _nbits; + _bs->position += _nbits; + _bs->offset += _nbits; + if (_bs->offset < 32) + { + _bs->mask = ((1 << _nbits) - 1); + _bs->accumulator |= ((_bs->prefetch >> (32 - _nbits)) & _bs->mask); + _bs->prefetch <<= _nbits; + } + else + { + _bs->mask = ((1 << _nbits) - 1); + _bs->accumulator |= ((_bs->prefetch >> (32 - _nbits)) & _bs->mask); + _bs->prefetch <<= _nbits; + _bs->offset -= 32; + _bs->pointer += 4; + BitStream_Prefetch(_bs); + if (_bs->offset) + { + _bs->mask = ((1 << _bs->offset) - 1); + _bs->accumulator |= ((_bs->prefetch >> (32 - _bs->offset)) & _bs->mask); + _bs->prefetch <<= _bs->offset; + } } } - } else { - WLog_WARN("com.winpr.bitstream", "warning: BitStream_Shift(%u)", (unsigned)_nbits); - } -} - -static INLINE void BitStream_Shift32(wBitStream* _bs) -{ - BitStream_Shift(_bs, 16); - BitStream_Shift(_bs, 16); -} - -static INLINE void BitStream_Write_Bits(wBitStream* _bs, UINT32 _bits, UINT32 _nbits) -{ - _bs->position += _nbits; - _bs->offset += _nbits; - if (_bs->offset < 32) { - _bs->accumulator |= (_bits << (32 - _bs->offset)); - } else { - _bs->offset -= 32; - _bs->mask = ((1 << (_nbits - _bs->offset)) - 1); - _bs->accumulator |= ((_bits >> _bs->offset) & _bs->mask); - BitStream_Flush(_bs); - _bs->accumulator = 0; - _bs->pointer += 4; - if (_bs->offset) { - _bs->mask = ((1 << _bs->offset) - 1); - _bs->accumulator |= ((_bits & _bs->mask) << (32 - _bs->offset)); + else + { + WLog_WARN("com.winpr.bitstream", "warning: BitStream_Shift(%u)", (unsigned)_nbits); } } -} -static INLINE size_t BitStream_GetRemainingLength(wBitStream* _bs) -{ - return (_bs->length - _bs->position); -} + static INLINE void BitStream_Shift32(wBitStream* _bs) + { + BitStream_Shift(_bs, 16); + BitStream_Shift(_bs, 16); + } -WINPR_API void BitDump(const char* tag, UINT32 level, const BYTE* buffer, UINT32 length, UINT32 flags); -WINPR_API UINT32 ReverseBits32(UINT32 bits, UINT32 nbits); + static INLINE void BitStream_Write_Bits(wBitStream* _bs, UINT32 _bits, UINT32 _nbits) + { + _bs->position += _nbits; + _bs->offset += _nbits; + if (_bs->offset < 32) + { + _bs->accumulator |= (_bits << (32 - _bs->offset)); + } + else + { + _bs->offset -= 32; + _bs->mask = ((1 << (_nbits - _bs->offset)) - 1); + _bs->accumulator |= ((_bits >> _bs->offset) & _bs->mask); + BitStream_Flush(_bs); + _bs->accumulator = 0; + _bs->pointer += 4; + if (_bs->offset) + { + _bs->mask = ((1 << _bs->offset) - 1); + _bs->accumulator |= ((_bits & _bs->mask) << (32 - _bs->offset)); + } + } + } -WINPR_API void BitStream_Attach(wBitStream* bs, const BYTE* buffer, UINT32 capacity); + static INLINE size_t BitStream_GetRemainingLength(wBitStream* _bs) + { + return (_bs->length - _bs->position); + } -WINPR_API wBitStream* BitStream_New(); -WINPR_API void BitStream_Free(wBitStream* bs); + WINPR_API void BitDump(const char* tag, UINT32 level, const BYTE* buffer, UINT32 length, + UINT32 flags); + WINPR_API UINT32 ReverseBits32(UINT32 bits, UINT32 nbits); + + WINPR_API void BitStream_Attach(wBitStream* bs, const BYTE* buffer, UINT32 capacity); + + WINPR_API wBitStream* BitStream_New(); + WINPR_API void BitStream_Free(wBitStream* bs); #ifdef __cplusplus } diff --git a/winpr/include/winpr/clipboard.h b/winpr/include/winpr/clipboard.h index b1e7a40f4..bbf2f5f95 100644 --- a/winpr/include/winpr/clipboard.h +++ b/winpr/include/winpr/clipboard.h @@ -26,7 +26,7 @@ typedef struct _wClipboard wClipboard; typedef void* (*CLIPBOARD_SYNTHESIZE_FN)(wClipboard* clipboard, UINT32 formatId, const void* data, - UINT32* pSize); + UINT32* pSize); struct _wClipboardFileSizeRequest { @@ -53,54 +53,55 @@ struct _wClipboardDelegate void* custom; char* basePath; - UINT(*ClientRequestFileSize)(wClipboardDelegate*, const wClipboardFileSizeRequest*); - UINT(*ClipboardFileSizeSuccess)(wClipboardDelegate*, const wClipboardFileSizeRequest*, - UINT64 fileSize); - UINT(*ClipboardFileSizeFailure)(wClipboardDelegate*, const wClipboardFileSizeRequest*, - UINT errorCode); + UINT (*ClientRequestFileSize)(wClipboardDelegate*, const wClipboardFileSizeRequest*); + UINT(*ClipboardFileSizeSuccess) + (wClipboardDelegate*, const wClipboardFileSizeRequest*, UINT64 fileSize); + UINT(*ClipboardFileSizeFailure) + (wClipboardDelegate*, const wClipboardFileSizeRequest*, UINT errorCode); - UINT(*ClientRequestFileRange)(wClipboardDelegate*, const wClipboardFileRangeRequest*); - UINT(*ClipboardFileRangeSuccess)(wClipboardDelegate*, const wClipboardFileRangeRequest*, - const BYTE* data, UINT32 size); - UINT(*ClipboardFileRangeFailure)(wClipboardDelegate*, const wClipboardFileRangeRequest*, - UINT errorCode); + UINT (*ClientRequestFileRange)(wClipboardDelegate*, const wClipboardFileRangeRequest*); + UINT(*ClipboardFileRangeSuccess) + (wClipboardDelegate*, const wClipboardFileRangeRequest*, const BYTE* data, UINT32 size); + UINT(*ClipboardFileRangeFailure) + (wClipboardDelegate*, const wClipboardFileRangeRequest*, UINT errorCode); }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API void ClipboardLock(wClipboard* clipboard); -WINPR_API void ClipboardUnlock(wClipboard* clipboard); + WINPR_API void ClipboardLock(wClipboard* clipboard); + WINPR_API void ClipboardUnlock(wClipboard* clipboard); -WINPR_API BOOL ClipboardEmpty(wClipboard* clipboard); -WINPR_API UINT32 ClipboardCountFormats(wClipboard* clipboard); -WINPR_API UINT32 ClipboardGetFormatIds(wClipboard* clipboard, UINT32** ppFormatIds); + WINPR_API BOOL ClipboardEmpty(wClipboard* clipboard); + WINPR_API UINT32 ClipboardCountFormats(wClipboard* clipboard); + WINPR_API UINT32 ClipboardGetFormatIds(wClipboard* clipboard, UINT32** ppFormatIds); -WINPR_API UINT32 ClipboardCountRegisteredFormats(wClipboard* clipboard); -WINPR_API UINT32 ClipboardGetRegisteredFormatIds(wClipboard* clipboard, UINT32** ppFormatIds); -WINPR_API UINT32 ClipboardRegisterFormat(wClipboard* clipboard, const char* name); + WINPR_API UINT32 ClipboardCountRegisteredFormats(wClipboard* clipboard); + WINPR_API UINT32 ClipboardGetRegisteredFormatIds(wClipboard* clipboard, UINT32** ppFormatIds); + WINPR_API UINT32 ClipboardRegisterFormat(wClipboard* clipboard, const char* name); -WINPR_API BOOL ClipboardRegisterSynthesizer(wClipboard* clipboard, UINT32 formatId, - UINT32 syntheticId, CLIPBOARD_SYNTHESIZE_FN pfnSynthesize); + WINPR_API BOOL ClipboardRegisterSynthesizer(wClipboard* clipboard, UINT32 formatId, + UINT32 syntheticId, + CLIPBOARD_SYNTHESIZE_FN pfnSynthesize); -WINPR_API UINT32 ClipboardGetFormatId(wClipboard* clipboard, const char* name); -WINPR_API const char* ClipboardGetFormatName(wClipboard* clipboard, UINT32 formatId); -WINPR_API void* ClipboardGetData(wClipboard* clipboard, UINT32 formatId, UINT32* pSize); -WINPR_API BOOL ClipboardSetData(wClipboard* clipboard, UINT32 formatId, const void* data, - UINT32 size); + WINPR_API UINT32 ClipboardGetFormatId(wClipboard* clipboard, const char* name); + WINPR_API const char* ClipboardGetFormatName(wClipboard* clipboard, UINT32 formatId); + WINPR_API void* ClipboardGetData(wClipboard* clipboard, UINT32 formatId, UINT32* pSize); + WINPR_API BOOL ClipboardSetData(wClipboard* clipboard, UINT32 formatId, const void* data, + UINT32 size); -WINPR_API UINT64 ClipboardGetOwner(wClipboard* clipboard); -WINPR_API void ClipboardSetOwner(wClipboard* clipboard, UINT64 ownerId); + WINPR_API UINT64 ClipboardGetOwner(wClipboard* clipboard); + WINPR_API void ClipboardSetOwner(wClipboard* clipboard, UINT64 ownerId); -WINPR_API wClipboardDelegate* ClipboardGetDelegate(wClipboard* clipboard); + WINPR_API wClipboardDelegate* ClipboardGetDelegate(wClipboard* clipboard); -WINPR_API wClipboard* ClipboardCreate(void); -WINPR_API void ClipboardDestroy(wClipboard* clipboard); + WINPR_API wClipboard* ClipboardCreate(void); + WINPR_API void ClipboardDestroy(wClipboard* clipboard); #ifdef __cplusplus } #endif #endif /* WINPR_CLIPBOARD_H */ - diff --git a/winpr/include/winpr/cmdline.h b/winpr/include/winpr/cmdline.h index 96f5351d2..0616addb2 100644 --- a/winpr/include/winpr/cmdline.h +++ b/winpr/include/winpr/cmdline.h @@ -25,72 +25,75 @@ /* Command-Line Argument Flags */ -#define COMMAND_LINE_INPUT_FLAG_MASK 0x0000FFFF -#define COMMAND_LINE_OUTPUT_FLAG_MASK 0xFFFF0000 +#define COMMAND_LINE_INPUT_FLAG_MASK 0x0000FFFF +#define COMMAND_LINE_OUTPUT_FLAG_MASK 0xFFFF0000 /* Command-Line Argument Input Flags */ -#define COMMAND_LINE_VALUE_FLAG 0x00000001 -#define COMMAND_LINE_VALUE_REQUIRED 0x00000002 -#define COMMAND_LINE_VALUE_OPTIONAL 0x00000004 -#define COMMAND_LINE_VALUE_BOOL 0x00000008 +#define COMMAND_LINE_VALUE_FLAG 0x00000001 +#define COMMAND_LINE_VALUE_REQUIRED 0x00000002 +#define COMMAND_LINE_VALUE_OPTIONAL 0x00000004 +#define COMMAND_LINE_VALUE_BOOL 0x00000008 -#define COMMAND_LINE_ADVANCED 0x00000100 -#define COMMAND_LINE_PRINT 0x00000200 -#define COMMAND_LINE_PRINT_HELP 0x00000400 -#define COMMAND_LINE_PRINT_VERSION 0x00000800 -#define COMMAND_LINE_PRINT_BUILDCONFIG 0x00001000 +#define COMMAND_LINE_ADVANCED 0x00000100 +#define COMMAND_LINE_PRINT 0x00000200 +#define COMMAND_LINE_PRINT_HELP 0x00000400 +#define COMMAND_LINE_PRINT_VERSION 0x00000800 +#define COMMAND_LINE_PRINT_BUILDCONFIG 0x00001000 /* Command-Line Argument Output Flags */ -#define COMMAND_LINE_ARGUMENT_PRESENT 0x80000000 -#define COMMAND_LINE_VALUE_PRESENT 0x40000000 +#define COMMAND_LINE_ARGUMENT_PRESENT 0x80000000 +#define COMMAND_LINE_VALUE_PRESENT 0x40000000 /* Command-Line Parsing Flags */ -#define COMMAND_LINE_SIGIL_NONE 0x00000001 -#define COMMAND_LINE_SIGIL_SLASH 0x00000002 -#define COMMAND_LINE_SIGIL_DASH 0x00000004 -#define COMMAND_LINE_SIGIL_DOUBLE_DASH 0x00000008 -#define COMMAND_LINE_SIGIL_PLUS_MINUS 0x00000010 -#define COMMAND_LINE_SIGIL_ENABLE_DISABLE 0x00000020 -#define COMMAND_LINE_SIGIL_NOT_ESCAPED 0x00000040 +#define COMMAND_LINE_SIGIL_NONE 0x00000001 +#define COMMAND_LINE_SIGIL_SLASH 0x00000002 +#define COMMAND_LINE_SIGIL_DASH 0x00000004 +#define COMMAND_LINE_SIGIL_DOUBLE_DASH 0x00000008 +#define COMMAND_LINE_SIGIL_PLUS_MINUS 0x00000010 +#define COMMAND_LINE_SIGIL_ENABLE_DISABLE 0x00000020 +#define COMMAND_LINE_SIGIL_NOT_ESCAPED 0x00000040 -#define COMMAND_LINE_SEPARATOR_COLON 0x00000100 -#define COMMAND_LINE_SEPARATOR_EQUAL 0x00000200 -#define COMMAND_LINE_SEPARATOR_SPACE 0x00000400 +#define COMMAND_LINE_SEPARATOR_COLON 0x00000100 +#define COMMAND_LINE_SEPARATOR_EQUAL 0x00000200 +#define COMMAND_LINE_SEPARATOR_SPACE 0x00000400 /* Supress COMMAND_LINE_ERROR_NO_KEYWORD return. */ -#define COMMAND_LINE_IGN_UNKNOWN_KEYWORD 0x00001000 -#define COMMAND_LINE_SILENCE_PARSER 0x00002000 +#define COMMAND_LINE_IGN_UNKNOWN_KEYWORD 0x00001000 +#define COMMAND_LINE_SILENCE_PARSER 0x00002000 /* Command-Line Parsing Error Codes */ -#define COMMAND_LINE_ERROR -1000 -#define COMMAND_LINE_ERROR_NO_KEYWORD -1001 -#define COMMAND_LINE_ERROR_UNEXPECTED_VALUE -1002 -#define COMMAND_LINE_ERROR_MISSING_VALUE -1003 -#define COMMAND_LINE_ERROR_MISSING_ARGUMENT -1004 -#define COMMAND_LINE_ERROR_UNEXPECTED_SIGIL -1005 -#define COMMAND_LINE_ERROR_MEMORY -1006 -#define COMMAND_LINE_ERROR_LAST -1999 +#define COMMAND_LINE_ERROR -1000 +#define COMMAND_LINE_ERROR_NO_KEYWORD -1001 +#define COMMAND_LINE_ERROR_UNEXPECTED_VALUE -1002 +#define COMMAND_LINE_ERROR_MISSING_VALUE -1003 +#define COMMAND_LINE_ERROR_MISSING_ARGUMENT -1004 +#define COMMAND_LINE_ERROR_UNEXPECTED_SIGIL -1005 +#define COMMAND_LINE_ERROR_MEMORY -1006 +#define COMMAND_LINE_ERROR_LAST -1999 /* Command-Line Parsing Status Codes */ -#define COMMAND_LINE_STATUS_PRINT -2001 -#define COMMAND_LINE_STATUS_PRINT_HELP -2002 -#define COMMAND_LINE_STATUS_PRINT_VERSION -2003 -#define COMMAND_LINE_STATUS_PRINT_BUILDCONFIG -2004 +#define COMMAND_LINE_STATUS_PRINT -2001 +#define COMMAND_LINE_STATUS_PRINT_HELP -2002 +#define COMMAND_LINE_STATUS_PRINT_VERSION -2003 +#define COMMAND_LINE_STATUS_PRINT_BUILDCONFIG -2004 /* Command-Line Macros */ -#define CommandLineSwitchStart(_arg) if (0) { } +#define CommandLineSwitchStart(_arg) \ + if (0) \ + { \ + } #define CommandLineSwitchCase(_arg, _name) else if (strcmp(_arg->Name, _name) == 0) #define CommandLineSwitchDefault(_arg) else #define CommandLineSwitchEnd(_arg) -#define BoolValueTrue ((LPSTR) 1) -#define BoolValueFalse ((LPSTR) 0) +#define BoolValueTrue ((LPSTR)1) +#define BoolValueFalse ((LPSTR)0) typedef struct _COMMAND_LINE_ARGUMENT_A COMMAND_LINE_ARGUMENT_A; typedef struct _COMMAND_LINE_ARGUMENT_W COMMAND_LINE_ARGUMENT_W; @@ -120,9 +123,9 @@ struct _COMMAND_LINE_ARGUMENT_W }; #ifdef UNICODE -#define COMMAND_LINE_ARGUMENT COMMAND_LINE_ARGUMENT_W +#define COMMAND_LINE_ARGUMENT COMMAND_LINE_ARGUMENT_W #else -#define COMMAND_LINE_ARGUMENT COMMAND_LINE_ARGUMENT_A +#define COMMAND_LINE_ARGUMENT COMMAND_LINE_ARGUMENT_A #endif typedef int (*COMMAND_LINE_PRE_FILTER_FN_A)(void* context, int index, int argc, LPSTR* argv); @@ -132,39 +135,42 @@ typedef int (*COMMAND_LINE_POST_FILTER_FN_A)(void* context, COMMAND_LINE_ARGUMEN typedef int (*COMMAND_LINE_POST_FILTER_FN_W)(void* context, COMMAND_LINE_ARGUMENT_W* arg); #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API int CommandLineClearArgumentsA(COMMAND_LINE_ARGUMENT_A* options); -WINPR_API int CommandLineClearArgumentsW(COMMAND_LINE_ARGUMENT_W* options); + WINPR_API int CommandLineClearArgumentsA(COMMAND_LINE_ARGUMENT_A* options); + WINPR_API int CommandLineClearArgumentsW(COMMAND_LINE_ARGUMENT_W* options); -WINPR_API int CommandLineParseArgumentsA(int argc, LPSTR* argv, COMMAND_LINE_ARGUMENT_A* options, - DWORD flags, - void* context, COMMAND_LINE_PRE_FILTER_FN_A preFilter, COMMAND_LINE_POST_FILTER_FN_A postFilter); -WINPR_API int CommandLineParseArgumentsW(int argc, LPWSTR* argv, COMMAND_LINE_ARGUMENT_W* options, - DWORD flags, - void* context, COMMAND_LINE_PRE_FILTER_FN_W preFilter, COMMAND_LINE_POST_FILTER_FN_W postFilter); + WINPR_API int CommandLineParseArgumentsA(int argc, LPSTR* argv, + COMMAND_LINE_ARGUMENT_A* options, DWORD flags, + void* context, COMMAND_LINE_PRE_FILTER_FN_A preFilter, + COMMAND_LINE_POST_FILTER_FN_A postFilter); + WINPR_API int CommandLineParseArgumentsW(int argc, LPWSTR* argv, + COMMAND_LINE_ARGUMENT_W* options, DWORD flags, + void* context, COMMAND_LINE_PRE_FILTER_FN_W preFilter, + COMMAND_LINE_POST_FILTER_FN_W postFilter); -WINPR_API COMMAND_LINE_ARGUMENT_A* CommandLineFindArgumentA(COMMAND_LINE_ARGUMENT_A* options, - LPCSTR Name); -WINPR_API COMMAND_LINE_ARGUMENT_W* CommandLineFindArgumentW(COMMAND_LINE_ARGUMENT_W* options, - LPCWSTR Name); + WINPR_API COMMAND_LINE_ARGUMENT_A* CommandLineFindArgumentA(COMMAND_LINE_ARGUMENT_A* options, + LPCSTR Name); + WINPR_API COMMAND_LINE_ARGUMENT_W* CommandLineFindArgumentW(COMMAND_LINE_ARGUMENT_W* options, + LPCWSTR Name); -WINPR_API COMMAND_LINE_ARGUMENT_A* CommandLineFindNextArgumentA(COMMAND_LINE_ARGUMENT_A* argument); + WINPR_API COMMAND_LINE_ARGUMENT_A* + CommandLineFindNextArgumentA(COMMAND_LINE_ARGUMENT_A* argument); #ifdef __cplusplus } #endif #ifdef UNICODE -#define CommandLineClearArguments CommandLineClearArgumentsW -#define CommandLineParseArguments CommandLineParseArgumentsW -#define CommandLineFindArgument CommandLineFindArgumentW +#define CommandLineClearArguments CommandLineClearArgumentsW +#define CommandLineParseArguments CommandLineParseArgumentsW +#define CommandLineFindArgument CommandLineFindArgumentW #else -#define CommandLineClearArguments CommandLineClearArgumentsA -#define CommandLineParseArguments CommandLineParseArgumentsA -#define CommandLineFindArgument CommandLineFindArgumentA +#define CommandLineClearArguments CommandLineClearArgumentsA +#define CommandLineParseArguments CommandLineParseArgumentsA +#define CommandLineFindArgument CommandLineFindArgumentA #endif #endif /* WINPR_CMDLINE_H */ - diff --git a/winpr/include/winpr/collections.h b/winpr/include/winpr/collections.h index 2ce931ca1..379bad955 100644 --- a/winpr/include/winpr/collections.h +++ b/winpr/include/winpr/collections.h @@ -32,554 +32,566 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef void* (*OBJECT_NEW_FN)(void* val); -typedef void (*OBJECT_INIT_FN)(void* obj); -typedef void (*OBJECT_UNINIT_FN)(void* obj); -typedef void (*OBJECT_FREE_FN)(void* obj); -typedef BOOL (*OBJECT_EQUALS_FN)(const void* objA, const void* objB); + typedef void* (*OBJECT_NEW_FN)(void* val); + typedef void (*OBJECT_INIT_FN)(void* obj); + typedef void (*OBJECT_UNINIT_FN)(void* obj); + typedef void (*OBJECT_FREE_FN)(void* obj); + typedef BOOL (*OBJECT_EQUALS_FN)(const void* objA, const void* objB); -struct _wObject -{ - OBJECT_NEW_FN fnObjectNew; - OBJECT_INIT_FN fnObjectInit; - OBJECT_UNINIT_FN fnObjectUninit; - OBJECT_FREE_FN fnObjectFree; - OBJECT_EQUALS_FN fnObjectEquals; -}; -typedef struct _wObject wObject; + struct _wObject + { + OBJECT_NEW_FN fnObjectNew; + OBJECT_INIT_FN fnObjectInit; + OBJECT_UNINIT_FN fnObjectUninit; + OBJECT_FREE_FN fnObjectFree; + OBJECT_EQUALS_FN fnObjectEquals; + }; + typedef struct _wObject wObject; -/* System.Collections.Queue */ + /* System.Collections.Queue */ -struct _wQueue -{ - int capacity; - int growthFactor; - BOOL synchronized; + struct _wQueue + { + int capacity; + int growthFactor; + BOOL synchronized; - int head; - int tail; - int size; - void** array; - CRITICAL_SECTION lock; - HANDLE event; + int head; + int tail; + int size; + void** array; + CRITICAL_SECTION lock; + HANDLE event; - wObject object; -}; -typedef struct _wQueue wQueue; + wObject object; + }; + typedef struct _wQueue wQueue; -WINPR_API int Queue_Count(wQueue* queue); + WINPR_API int Queue_Count(wQueue* queue); -WINPR_API void Queue_Lock(wQueue* queue); -WINPR_API void Queue_Unlock(wQueue* queue); + WINPR_API void Queue_Lock(wQueue* queue); + WINPR_API void Queue_Unlock(wQueue* queue); -WINPR_API HANDLE Queue_Event(wQueue* queue); + WINPR_API HANDLE Queue_Event(wQueue* queue); -#define Queue_Object(_queue) (&_queue->object) +#define Queue_Object(_queue) (&_queue->object) -WINPR_API void Queue_Clear(wQueue* queue); + WINPR_API void Queue_Clear(wQueue* queue); -WINPR_API BOOL Queue_Contains(wQueue* queue, void* obj); + WINPR_API BOOL Queue_Contains(wQueue* queue, void* obj); -WINPR_API BOOL Queue_Enqueue(wQueue* queue, void* obj); -WINPR_API void* Queue_Dequeue(wQueue* queue); + WINPR_API BOOL Queue_Enqueue(wQueue* queue, void* obj); + WINPR_API void* Queue_Dequeue(wQueue* queue); -WINPR_API void* Queue_Peek(wQueue* queue); + WINPR_API void* Queue_Peek(wQueue* queue); -WINPR_API wQueue* Queue_New(BOOL synchronized, int capacity, int growthFactor); -WINPR_API void Queue_Free(wQueue* queue); + WINPR_API wQueue* Queue_New(BOOL synchronized, int capacity, int growthFactor); + WINPR_API void Queue_Free(wQueue* queue); -/* System.Collections.Stack */ + /* System.Collections.Stack */ -struct _wStack -{ - int size; - int capacity; - void** array; - CRITICAL_SECTION lock; - BOOL synchronized; - wObject object; -}; -typedef struct _wStack wStack; + struct _wStack + { + int size; + int capacity; + void** array; + CRITICAL_SECTION lock; + BOOL synchronized; + wObject object; + }; + typedef struct _wStack wStack; -WINPR_API int Stack_Count(wStack* stack); -WINPR_API BOOL Stack_IsSynchronized(wStack* stack); + WINPR_API int Stack_Count(wStack* stack); + WINPR_API BOOL Stack_IsSynchronized(wStack* stack); -#define Stack_Object(_stack) (&_stack->object) +#define Stack_Object(_stack) (&_stack->object) -WINPR_API void Stack_Clear(wStack* stack); -WINPR_API BOOL Stack_Contains(wStack* stack, void* obj); + WINPR_API void Stack_Clear(wStack* stack); + WINPR_API BOOL Stack_Contains(wStack* stack, void* obj); -WINPR_API void Stack_Push(wStack* stack, void* obj); -WINPR_API void* Stack_Pop(wStack* stack); + WINPR_API void Stack_Push(wStack* stack, void* obj); + WINPR_API void* Stack_Pop(wStack* stack); -WINPR_API void* Stack_Peek(wStack* stack); + WINPR_API void* Stack_Peek(wStack* stack); -WINPR_API wStack* Stack_New(BOOL synchronized); -WINPR_API void Stack_Free(wStack* stack); + WINPR_API wStack* Stack_New(BOOL synchronized); + WINPR_API void Stack_Free(wStack* stack); -/* System.Collections.ArrayList */ + /* System.Collections.ArrayList */ -struct _wArrayList -{ - int capacity; - int growthFactor; - BOOL synchronized; + struct _wArrayList + { + int capacity; + int growthFactor; + BOOL synchronized; - int size; - void** array; - CRITICAL_SECTION lock; + int size; + void** array; + CRITICAL_SECTION lock; - wObject object; -}; -typedef struct _wArrayList wArrayList; + wObject object; + }; + typedef struct _wArrayList wArrayList; -WINPR_API int ArrayList_Capacity(wArrayList* arrayList); -WINPR_API int ArrayList_Count(wArrayList* arrayList); -WINPR_API int ArrayList_Items(wArrayList* arrayList, ULONG_PTR** ppItems); -WINPR_API BOOL ArrayList_IsFixedSized(wArrayList* arrayList); -WINPR_API BOOL ArrayList_IsReadOnly(wArrayList* arrayList); -WINPR_API BOOL ArrayList_IsSynchronized(wArrayList* arrayList); + WINPR_API int ArrayList_Capacity(wArrayList* arrayList); + WINPR_API int ArrayList_Count(wArrayList* arrayList); + WINPR_API int ArrayList_Items(wArrayList* arrayList, ULONG_PTR** ppItems); + WINPR_API BOOL ArrayList_IsFixedSized(wArrayList* arrayList); + WINPR_API BOOL ArrayList_IsReadOnly(wArrayList* arrayList); + WINPR_API BOOL ArrayList_IsSynchronized(wArrayList* arrayList); -WINPR_API void ArrayList_Lock(wArrayList* arrayList); -WINPR_API void ArrayList_Unlock(wArrayList* arrayList); + WINPR_API void ArrayList_Lock(wArrayList* arrayList); + WINPR_API void ArrayList_Unlock(wArrayList* arrayList); -WINPR_API void* ArrayList_GetItem(wArrayList* arrayList, int index); -WINPR_API void ArrayList_SetItem(wArrayList* arrayList, int index, void* obj); + WINPR_API void* ArrayList_GetItem(wArrayList* arrayList, int index); + WINPR_API void ArrayList_SetItem(wArrayList* arrayList, int index, void* obj); -#define ArrayList_Object(_arrayList) (&_arrayList->object) +#define ArrayList_Object(_arrayList) (&_arrayList->object) -WINPR_API void ArrayList_Clear(wArrayList* arrayList); -WINPR_API BOOL ArrayList_Contains(wArrayList* arrayList, void* obj); + WINPR_API void ArrayList_Clear(wArrayList* arrayList); + WINPR_API BOOL ArrayList_Contains(wArrayList* arrayList, void* obj); -WINPR_API int ArrayList_Add(wArrayList* arrayList, void* obj); -WINPR_API BOOL ArrayList_Insert(wArrayList* arrayList, int index, void* obj); + WINPR_API int ArrayList_Add(wArrayList* arrayList, void* obj); + WINPR_API BOOL ArrayList_Insert(wArrayList* arrayList, int index, void* obj); -WINPR_API BOOL ArrayList_Remove(wArrayList* arrayList, void* obj); -WINPR_API BOOL ArrayList_RemoveAt(wArrayList* arrayList, int index); + WINPR_API BOOL ArrayList_Remove(wArrayList* arrayList, void* obj); + WINPR_API BOOL ArrayList_RemoveAt(wArrayList* arrayList, int index); -WINPR_API int ArrayList_IndexOf(wArrayList* arrayList, void* obj, int startIndex, int count); -WINPR_API int ArrayList_LastIndexOf(wArrayList* arrayList, void* obj, int startIndex, int count); + WINPR_API int ArrayList_IndexOf(wArrayList* arrayList, void* obj, int startIndex, int count); + WINPR_API int ArrayList_LastIndexOf(wArrayList* arrayList, void* obj, int startIndex, + int count); -WINPR_API wArrayList* ArrayList_New(BOOL synchronized); -WINPR_API void ArrayList_Free(wArrayList* arrayList); + WINPR_API wArrayList* ArrayList_New(BOOL synchronized); + WINPR_API void ArrayList_Free(wArrayList* arrayList); -/* System.Collections.DictionaryBase */ + /* System.Collections.DictionaryBase */ -struct _wDictionary -{ - BOOL synchronized; - CRITICAL_SECTION lock; -}; -typedef struct _wDictionary wDictionary; + struct _wDictionary + { + BOOL synchronized; + CRITICAL_SECTION lock; + }; + typedef struct _wDictionary wDictionary; -/* System.Collections.Specialized.ListDictionary */ + /* System.Collections.Specialized.ListDictionary */ -typedef struct _wListDictionaryItem wListDictionaryItem; + typedef struct _wListDictionaryItem wListDictionaryItem; -struct _wListDictionaryItem -{ - void* key; - void* value; + struct _wListDictionaryItem + { + void* key; + void* value; - wListDictionaryItem* next; -}; + wListDictionaryItem* next; + }; -struct _wListDictionary -{ - BOOL synchronized; - CRITICAL_SECTION lock; + struct _wListDictionary + { + BOOL synchronized; + CRITICAL_SECTION lock; - wListDictionaryItem* head; - wObject objectKey; - wObject objectValue; -}; -typedef struct _wListDictionary wListDictionary; + wListDictionaryItem* head; + wObject objectKey; + wObject objectValue; + }; + typedef struct _wListDictionary wListDictionary; -#define ListDictionary_KeyObject(_dictionary) (&_dictionary->objectKey) -#define ListDictionary_ValueObject(_dictionary) (&_dictionary->objectValue) +#define ListDictionary_KeyObject(_dictionary) (&_dictionary->objectKey) +#define ListDictionary_ValueObject(_dictionary) (&_dictionary->objectValue) -WINPR_API int ListDictionary_Count(wListDictionary* listDictionary); + WINPR_API int ListDictionary_Count(wListDictionary* listDictionary); -WINPR_API void ListDictionary_Lock(wListDictionary* listDictionary); -WINPR_API void ListDictionary_Unlock(wListDictionary* listDictionary); + WINPR_API void ListDictionary_Lock(wListDictionary* listDictionary); + WINPR_API void ListDictionary_Unlock(wListDictionary* listDictionary); -WINPR_API BOOL ListDictionary_Add(wListDictionary* listDictionary, const void* key, void* value); -WINPR_API void* ListDictionary_Remove(wListDictionary* listDictionary, const void* key); -WINPR_API void* ListDictionary_Remove_Head(wListDictionary* listDictionary); -WINPR_API void ListDictionary_Clear(wListDictionary* listDictionary); + WINPR_API BOOL ListDictionary_Add(wListDictionary* listDictionary, const void* key, + void* value); + WINPR_API void* ListDictionary_Remove(wListDictionary* listDictionary, const void* key); + WINPR_API void* ListDictionary_Remove_Head(wListDictionary* listDictionary); + WINPR_API void ListDictionary_Clear(wListDictionary* listDictionary); -WINPR_API BOOL ListDictionary_Contains(wListDictionary* listDictionary, const void* key); -WINPR_API int ListDictionary_GetKeys(wListDictionary* listDictionary, ULONG_PTR** ppKeys); + WINPR_API BOOL ListDictionary_Contains(wListDictionary* listDictionary, const void* key); + WINPR_API int ListDictionary_GetKeys(wListDictionary* listDictionary, ULONG_PTR** ppKeys); -WINPR_API void* ListDictionary_GetItemValue(wListDictionary* listDictionary, const void* key); -WINPR_API BOOL ListDictionary_SetItemValue(wListDictionary* listDictionary, const void* key, - void* value); + WINPR_API void* ListDictionary_GetItemValue(wListDictionary* listDictionary, const void* key); + WINPR_API BOOL ListDictionary_SetItemValue(wListDictionary* listDictionary, const void* key, + void* value); -WINPR_API wListDictionary* ListDictionary_New(BOOL synchronized); -WINPR_API void ListDictionary_Free(wListDictionary* listDictionary); + WINPR_API wListDictionary* ListDictionary_New(BOOL synchronized); + WINPR_API void ListDictionary_Free(wListDictionary* listDictionary); -/* System.Collections.Generic.LinkedList */ + /* System.Collections.Generic.LinkedList */ -typedef struct _wLinkedList wLinkedList; + typedef struct _wLinkedList wLinkedList; -WINPR_API int LinkedList_Count(wLinkedList* list); -WINPR_API void* LinkedList_First(wLinkedList* list); -WINPR_API void* LinkedList_Last(wLinkedList* list); + WINPR_API int LinkedList_Count(wLinkedList* list); + WINPR_API void* LinkedList_First(wLinkedList* list); + WINPR_API void* LinkedList_Last(wLinkedList* list); -WINPR_API BOOL LinkedList_Contains(wLinkedList* list, void* value); -WINPR_API void LinkedList_Clear(wLinkedList* list); + WINPR_API BOOL LinkedList_Contains(wLinkedList* list, void* value); + WINPR_API void LinkedList_Clear(wLinkedList* list); -WINPR_API BOOL LinkedList_AddFirst(wLinkedList* list, void* value); -WINPR_API BOOL LinkedList_AddLast(wLinkedList* list, void* value); + WINPR_API BOOL LinkedList_AddFirst(wLinkedList* list, void* value); + WINPR_API BOOL LinkedList_AddLast(wLinkedList* list, void* value); -WINPR_API BOOL LinkedList_Remove(wLinkedList* list, void* value); -WINPR_API void LinkedList_RemoveFirst(wLinkedList* list); -WINPR_API void LinkedList_RemoveLast(wLinkedList* list); + WINPR_API BOOL LinkedList_Remove(wLinkedList* list, void* value); + WINPR_API void LinkedList_RemoveFirst(wLinkedList* list); + WINPR_API void LinkedList_RemoveLast(wLinkedList* list); -WINPR_API void LinkedList_Enumerator_Reset(wLinkedList* list); -WINPR_API void* LinkedList_Enumerator_Current(wLinkedList* list); -WINPR_API BOOL LinkedList_Enumerator_MoveNext(wLinkedList* list); + WINPR_API void LinkedList_Enumerator_Reset(wLinkedList* list); + WINPR_API void* LinkedList_Enumerator_Current(wLinkedList* list); + WINPR_API BOOL LinkedList_Enumerator_MoveNext(wLinkedList* list); -WINPR_API wLinkedList* LinkedList_New(void); -WINPR_API void LinkedList_Free(wLinkedList* list); + WINPR_API wLinkedList* LinkedList_New(void); + WINPR_API void LinkedList_Free(wLinkedList* list); -WINPR_API wObject* LinkedList_Object(wLinkedList* list); + WINPR_API wObject* LinkedList_Object(wLinkedList* list); -/* System.Collections.Generic.KeyValuePair */ - -typedef struct _wKeyValuePair wKeyValuePair; - -struct _wKeyValuePair -{ - void* key; - void* value; - - wKeyValuePair* next; -}; - -/* Reference Table */ - -struct _wReference -{ - UINT32 Count; - void* Pointer; -}; -typedef struct _wReference wReference; - -typedef int (*REFERENCE_FREE)(void* context, void* ptr); - -struct _wReferenceTable -{ - UINT32 size; - CRITICAL_SECTION lock; - void* context; - BOOL synchronized; - wReference* array; - REFERENCE_FREE ReferenceFree; -}; -typedef struct _wReferenceTable wReferenceTable; - -WINPR_API UINT32 ReferenceTable_Add(wReferenceTable* referenceTable, void* ptr); -WINPR_API UINT32 ReferenceTable_Release(wReferenceTable* referenceTable, void* ptr); - -WINPR_API wReferenceTable* ReferenceTable_New(BOOL synchronized, void* context, - REFERENCE_FREE ReferenceFree); -WINPR_API void ReferenceTable_Free(wReferenceTable* referenceTable); - -/* Countdown Event */ - -struct _wCountdownEvent -{ - DWORD count; - CRITICAL_SECTION lock; - HANDLE event; - DWORD initialCount; -}; -typedef struct _wCountdownEvent wCountdownEvent; - -WINPR_API DWORD CountdownEvent_CurrentCount(wCountdownEvent* countdown); -WINPR_API DWORD CountdownEvent_InitialCount(wCountdownEvent* countdown); -WINPR_API BOOL CountdownEvent_IsSet(wCountdownEvent* countdown); -WINPR_API HANDLE CountdownEvent_WaitHandle(wCountdownEvent* countdown); - -WINPR_API void CountdownEvent_AddCount(wCountdownEvent* countdown, DWORD signalCount); -WINPR_API BOOL CountdownEvent_Signal(wCountdownEvent* countdown, DWORD signalCount); -WINPR_API void CountdownEvent_Reset(wCountdownEvent* countdown, DWORD count); - -WINPR_API wCountdownEvent* CountdownEvent_New(DWORD initialCount); -WINPR_API void CountdownEvent_Free(wCountdownEvent* countdown); - -/* Hash Table */ - -typedef UINT32(*HASH_TABLE_HASH_FN)(void* key); -typedef BOOL (*HASH_TABLE_KEY_COMPARE_FN)(void* key1, void* key2); -typedef BOOL (*HASH_TABLE_VALUE_COMPARE_FN)(void* value1, void* value2); -typedef void* (*HASH_TABLE_KEY_CLONE_FN)(void* key); -typedef void* (*HASH_TABLE_VALUE_CLONE_FN)(void* value); -typedef void (*HASH_TABLE_KEY_FREE_FN)(void* key); -typedef void (*HASH_TABLE_VALUE_FREE_FN)(void* value); - -struct _wHashTable -{ - BOOL synchronized; - CRITICAL_SECTION lock; - - int numOfBuckets; - int numOfElements; - float idealRatio; - float lowerRehashThreshold; - float upperRehashThreshold; - wKeyValuePair** bucketArray; - - HASH_TABLE_HASH_FN hash; - HASH_TABLE_KEY_COMPARE_FN keyCompare; - HASH_TABLE_VALUE_COMPARE_FN valueCompare; - HASH_TABLE_KEY_CLONE_FN keyClone; - HASH_TABLE_VALUE_CLONE_FN valueClone; - HASH_TABLE_KEY_FREE_FN keyFree; - HASH_TABLE_VALUE_FREE_FN valueFree; -}; -typedef struct _wHashTable wHashTable; - -WINPR_API int HashTable_Count(wHashTable* table); -WINPR_API int HashTable_Add(wHashTable* table, void* key, void* value); -WINPR_API BOOL HashTable_Remove(wHashTable* table, void* key); -WINPR_API void HashTable_Clear(wHashTable* table); -WINPR_API BOOL HashTable_Contains(wHashTable* table, void* key); -WINPR_API BOOL HashTable_ContainsKey(wHashTable* table, void* key); -WINPR_API BOOL HashTable_ContainsValue(wHashTable* table, void* value); -WINPR_API void* HashTable_GetItemValue(wHashTable* table, void* key); -WINPR_API BOOL HashTable_SetItemValue(wHashTable* table, void* key, void* value); -WINPR_API int HashTable_GetKeys(wHashTable* table, ULONG_PTR** ppKeys); - -WINPR_API UINT32 HashTable_PointerHash(void* pointer); -WINPR_API BOOL HashTable_PointerCompare(void* pointer1, void* pointer2); - -WINPR_API UINT32 HashTable_StringHash(void* key); -WINPR_API BOOL HashTable_StringCompare(void* string1, void* string2); -WINPR_API void* HashTable_StringClone(void* str); -WINPR_API void HashTable_StringFree(void* str); - -WINPR_API wHashTable* HashTable_New(BOOL synchronized); -WINPR_API void HashTable_Free(wHashTable* table); - -/* BufferPool */ - -struct _wBufferPoolItem -{ - int size; - void* buffer; -}; -typedef struct _wBufferPoolItem wBufferPoolItem; - -struct _wBufferPool -{ - int fixedSize; - DWORD alignment; - BOOL synchronized; - CRITICAL_SECTION lock; - - int size; - int capacity; - void** array; - - int aSize; - int aCapacity; - wBufferPoolItem* aArray; - - int uSize; - int uCapacity; - wBufferPoolItem* uArray; -}; -typedef struct _wBufferPool wBufferPool; - -WINPR_API int BufferPool_GetPoolSize(wBufferPool* pool); -WINPR_API int BufferPool_GetBufferSize(wBufferPool* pool, void* buffer); - -WINPR_API void* BufferPool_Take(wBufferPool* pool, int bufferSize); -WINPR_API BOOL BufferPool_Return(wBufferPool* pool, void* buffer); -WINPR_API void BufferPool_Clear(wBufferPool* pool); - -WINPR_API wBufferPool* BufferPool_New(BOOL synchronized, int fixedSize, DWORD alignment); -WINPR_API void BufferPool_Free(wBufferPool* pool); - -/* ObjectPool */ - -struct _wObjectPool -{ - int size; - int capacity; - void** array; - CRITICAL_SECTION lock; - wObject object; - BOOL synchronized; -}; -typedef struct _wObjectPool wObjectPool; - -WINPR_API void* ObjectPool_Take(wObjectPool* pool); -WINPR_API void ObjectPool_Return(wObjectPool* pool, void* obj); -WINPR_API void ObjectPool_Clear(wObjectPool* pool); - -#define ObjectPool_Object(_pool) (&_pool->object) - -WINPR_API wObjectPool* ObjectPool_New(BOOL synchronized); -WINPR_API void ObjectPool_Free(wObjectPool* pool); - -/* Message Queue */ - -typedef struct _wMessage wMessage; - -typedef void (*MESSAGE_FREE_FN)(wMessage* message); - -struct _wMessage -{ - UINT32 id; - void* context; - void* wParam; - void* lParam; - UINT64 time; - MESSAGE_FREE_FN Free; -}; - -struct _wMessageQueue -{ - int head; - int tail; - int size; - int capacity; - wMessage* array; - CRITICAL_SECTION lock; - HANDLE event; - - wObject object; -}; -typedef struct _wMessageQueue wMessageQueue; - -#define WMQ_QUIT 0xFFFFFFFF - -WINPR_API HANDLE MessageQueue_Event(wMessageQueue* queue); -WINPR_API BOOL MessageQueue_Wait(wMessageQueue* queue); -WINPR_API int MessageQueue_Size(wMessageQueue* queue); - -WINPR_API BOOL MessageQueue_Dispatch(wMessageQueue* queue, wMessage* message); -WINPR_API BOOL MessageQueue_Post(wMessageQueue* queue, void* context, UINT32 type, void* wParam, - void* lParam); -WINPR_API BOOL MessageQueue_PostQuit(wMessageQueue* queue, int nExitCode); - -WINPR_API int MessageQueue_Get(wMessageQueue* queue, wMessage* message); -WINPR_API int MessageQueue_Peek(wMessageQueue* queue, wMessage* message, BOOL remove); - -/*! \brief Clears all elements in a message queue. - * - * \note If dynamically allocated data is part of the messages, - * a custom cleanup handler must be passed in the 'callback' - * argument for MessageQueue_New. - * - * \param queue The queue to clear. - * - * \return 0 in case of success or a error code otherwise. - */ -WINPR_API int MessageQueue_Clear(wMessageQueue* queue); - -/*! \brief Creates a new message queue. - * If 'callback' is null, no custom cleanup will be done - * on message queue deallocation. - * If the 'callback' argument contains valid uninit or - * free functions those will be called by - * 'MessageQueue_Clear'. - * - * \param callback a pointer to custom initialization / cleanup functions. - * Can be NULL if not used. - * - * \return A pointer to a newly allocated MessageQueue or NULL. - */ -WINPR_API wMessageQueue* MessageQueue_New(const wObject* callback); - -/*! \brief Frees resources allocated by a message queue. - * This function will only free resources allocated - * internally. - * - * \note Empty the queue before calling this function with - * 'MessageQueue_Clear', 'MessageQueue_Get' or - * 'MessageQueue_Peek' to free all resources allocated - * by the message contained. - * - * \param queue A pointer to the queue to be freed. - */ -WINPR_API void MessageQueue_Free(wMessageQueue* queue); - -/* Message Pipe */ - -struct _wMessagePipe -{ - wMessageQueue* In; - wMessageQueue* Out; -}; -typedef struct _wMessagePipe wMessagePipe; - -WINPR_API void MessagePipe_PostQuit(wMessagePipe* pipe, int nExitCode); - -WINPR_API wMessagePipe* MessagePipe_New(void); -WINPR_API void MessagePipe_Free(wMessagePipe* pipe); - -/* Publisher/Subscriber Pattern */ - -struct _wEventArgs -{ - DWORD Size; - const char* Sender; -}; -typedef struct _wEventArgs wEventArgs; - -typedef void (*pEventHandler)(void* context, wEventArgs* e); - -#define MAX_EVENT_HANDLERS 32 - -struct _wEventType -{ - const char* EventName; - wEventArgs EventArgs; - int EventHandlerCount; - pEventHandler EventHandlers[MAX_EVENT_HANDLERS]; -}; -typedef struct _wEventType wEventType; - -#define EventArgsInit(_event_args, _sender) \ - memset(_event_args, 0, sizeof(*_event_args)); \ - ((wEventArgs*) _event_args)->Size = sizeof(*_event_args); \ - ((wEventArgs*) _event_args)->Sender = _sender + /* System.Collections.Generic.KeyValuePair */ + + typedef struct _wKeyValuePair wKeyValuePair; + + struct _wKeyValuePair + { + void* key; + void* value; + + wKeyValuePair* next; + }; + + /* Reference Table */ + + struct _wReference + { + UINT32 Count; + void* Pointer; + }; + typedef struct _wReference wReference; + + typedef int (*REFERENCE_FREE)(void* context, void* ptr); + + struct _wReferenceTable + { + UINT32 size; + CRITICAL_SECTION lock; + void* context; + BOOL synchronized; + wReference* array; + REFERENCE_FREE ReferenceFree; + }; + typedef struct _wReferenceTable wReferenceTable; + + WINPR_API UINT32 ReferenceTable_Add(wReferenceTable* referenceTable, void* ptr); + WINPR_API UINT32 ReferenceTable_Release(wReferenceTable* referenceTable, void* ptr); + + WINPR_API wReferenceTable* ReferenceTable_New(BOOL synchronized, void* context, + REFERENCE_FREE ReferenceFree); + WINPR_API void ReferenceTable_Free(wReferenceTable* referenceTable); + + /* Countdown Event */ + + struct _wCountdownEvent + { + DWORD count; + CRITICAL_SECTION lock; + HANDLE event; + DWORD initialCount; + }; + typedef struct _wCountdownEvent wCountdownEvent; + + WINPR_API DWORD CountdownEvent_CurrentCount(wCountdownEvent* countdown); + WINPR_API DWORD CountdownEvent_InitialCount(wCountdownEvent* countdown); + WINPR_API BOOL CountdownEvent_IsSet(wCountdownEvent* countdown); + WINPR_API HANDLE CountdownEvent_WaitHandle(wCountdownEvent* countdown); + + WINPR_API void CountdownEvent_AddCount(wCountdownEvent* countdown, DWORD signalCount); + WINPR_API BOOL CountdownEvent_Signal(wCountdownEvent* countdown, DWORD signalCount); + WINPR_API void CountdownEvent_Reset(wCountdownEvent* countdown, DWORD count); + + WINPR_API wCountdownEvent* CountdownEvent_New(DWORD initialCount); + WINPR_API void CountdownEvent_Free(wCountdownEvent* countdown); + + /* Hash Table */ + + typedef UINT32 (*HASH_TABLE_HASH_FN)(void* key); + typedef BOOL (*HASH_TABLE_KEY_COMPARE_FN)(void* key1, void* key2); + typedef BOOL (*HASH_TABLE_VALUE_COMPARE_FN)(void* value1, void* value2); + typedef void* (*HASH_TABLE_KEY_CLONE_FN)(void* key); + typedef void* (*HASH_TABLE_VALUE_CLONE_FN)(void* value); + typedef void (*HASH_TABLE_KEY_FREE_FN)(void* key); + typedef void (*HASH_TABLE_VALUE_FREE_FN)(void* value); + + struct _wHashTable + { + BOOL synchronized; + CRITICAL_SECTION lock; + + int numOfBuckets; + int numOfElements; + float idealRatio; + float lowerRehashThreshold; + float upperRehashThreshold; + wKeyValuePair** bucketArray; + + HASH_TABLE_HASH_FN hash; + HASH_TABLE_KEY_COMPARE_FN keyCompare; + HASH_TABLE_VALUE_COMPARE_FN valueCompare; + HASH_TABLE_KEY_CLONE_FN keyClone; + HASH_TABLE_VALUE_CLONE_FN valueClone; + HASH_TABLE_KEY_FREE_FN keyFree; + HASH_TABLE_VALUE_FREE_FN valueFree; + }; + typedef struct _wHashTable wHashTable; + + WINPR_API int HashTable_Count(wHashTable* table); + WINPR_API int HashTable_Add(wHashTable* table, void* key, void* value); + WINPR_API BOOL HashTable_Remove(wHashTable* table, void* key); + WINPR_API void HashTable_Clear(wHashTable* table); + WINPR_API BOOL HashTable_Contains(wHashTable* table, void* key); + WINPR_API BOOL HashTable_ContainsKey(wHashTable* table, void* key); + WINPR_API BOOL HashTable_ContainsValue(wHashTable* table, void* value); + WINPR_API void* HashTable_GetItemValue(wHashTable* table, void* key); + WINPR_API BOOL HashTable_SetItemValue(wHashTable* table, void* key, void* value); + WINPR_API int HashTable_GetKeys(wHashTable* table, ULONG_PTR** ppKeys); + + WINPR_API UINT32 HashTable_PointerHash(void* pointer); + WINPR_API BOOL HashTable_PointerCompare(void* pointer1, void* pointer2); + + WINPR_API UINT32 HashTable_StringHash(void* key); + WINPR_API BOOL HashTable_StringCompare(void* string1, void* string2); + WINPR_API void* HashTable_StringClone(void* str); + WINPR_API void HashTable_StringFree(void* str); + + WINPR_API wHashTable* HashTable_New(BOOL synchronized); + WINPR_API void HashTable_Free(wHashTable* table); + + /* BufferPool */ + + struct _wBufferPoolItem + { + int size; + void* buffer; + }; + typedef struct _wBufferPoolItem wBufferPoolItem; + + struct _wBufferPool + { + int fixedSize; + DWORD alignment; + BOOL synchronized; + CRITICAL_SECTION lock; + + int size; + int capacity; + void** array; + + int aSize; + int aCapacity; + wBufferPoolItem* aArray; + + int uSize; + int uCapacity; + wBufferPoolItem* uArray; + }; + typedef struct _wBufferPool wBufferPool; + + WINPR_API int BufferPool_GetPoolSize(wBufferPool* pool); + WINPR_API int BufferPool_GetBufferSize(wBufferPool* pool, void* buffer); + + WINPR_API void* BufferPool_Take(wBufferPool* pool, int bufferSize); + WINPR_API BOOL BufferPool_Return(wBufferPool* pool, void* buffer); + WINPR_API void BufferPool_Clear(wBufferPool* pool); + + WINPR_API wBufferPool* BufferPool_New(BOOL synchronized, int fixedSize, DWORD alignment); + WINPR_API void BufferPool_Free(wBufferPool* pool); + + /* ObjectPool */ + + struct _wObjectPool + { + int size; + int capacity; + void** array; + CRITICAL_SECTION lock; + wObject object; + BOOL synchronized; + }; + typedef struct _wObjectPool wObjectPool; + + WINPR_API void* ObjectPool_Take(wObjectPool* pool); + WINPR_API void ObjectPool_Return(wObjectPool* pool, void* obj); + WINPR_API void ObjectPool_Clear(wObjectPool* pool); + +#define ObjectPool_Object(_pool) (&_pool->object) + + WINPR_API wObjectPool* ObjectPool_New(BOOL synchronized); + WINPR_API void ObjectPool_Free(wObjectPool* pool); + + /* Message Queue */ + + typedef struct _wMessage wMessage; + + typedef void (*MESSAGE_FREE_FN)(wMessage* message); + + struct _wMessage + { + UINT32 id; + void* context; + void* wParam; + void* lParam; + UINT64 time; + MESSAGE_FREE_FN Free; + }; + + struct _wMessageQueue + { + int head; + int tail; + int size; + int capacity; + wMessage* array; + CRITICAL_SECTION lock; + HANDLE event; + + wObject object; + }; + typedef struct _wMessageQueue wMessageQueue; + +#define WMQ_QUIT 0xFFFFFFFF + + WINPR_API HANDLE MessageQueue_Event(wMessageQueue* queue); + WINPR_API BOOL MessageQueue_Wait(wMessageQueue* queue); + WINPR_API int MessageQueue_Size(wMessageQueue* queue); + + WINPR_API BOOL MessageQueue_Dispatch(wMessageQueue* queue, wMessage* message); + WINPR_API BOOL MessageQueue_Post(wMessageQueue* queue, void* context, UINT32 type, void* wParam, + void* lParam); + WINPR_API BOOL MessageQueue_PostQuit(wMessageQueue* queue, int nExitCode); + + WINPR_API int MessageQueue_Get(wMessageQueue* queue, wMessage* message); + WINPR_API int MessageQueue_Peek(wMessageQueue* queue, wMessage* message, BOOL remove); + + /*! \brief Clears all elements in a message queue. + * + * \note If dynamically allocated data is part of the messages, + * a custom cleanup handler must be passed in the 'callback' + * argument for MessageQueue_New. + * + * \param queue The queue to clear. + * + * \return 0 in case of success or a error code otherwise. + */ + WINPR_API int MessageQueue_Clear(wMessageQueue* queue); + + /*! \brief Creates a new message queue. + * If 'callback' is null, no custom cleanup will be done + * on message queue deallocation. + * If the 'callback' argument contains valid uninit or + * free functions those will be called by + * 'MessageQueue_Clear'. + * + * \param callback a pointer to custom initialization / cleanup functions. + * Can be NULL if not used. + * + * \return A pointer to a newly allocated MessageQueue or NULL. + */ + WINPR_API wMessageQueue* MessageQueue_New(const wObject* callback); + + /*! \brief Frees resources allocated by a message queue. + * This function will only free resources allocated + * internally. + * + * \note Empty the queue before calling this function with + * 'MessageQueue_Clear', 'MessageQueue_Get' or + * 'MessageQueue_Peek' to free all resources allocated + * by the message contained. + * + * \param queue A pointer to the queue to be freed. + */ + WINPR_API void MessageQueue_Free(wMessageQueue* queue); + + /* Message Pipe */ + + struct _wMessagePipe + { + wMessageQueue* In; + wMessageQueue* Out; + }; + typedef struct _wMessagePipe wMessagePipe; + + WINPR_API void MessagePipe_PostQuit(wMessagePipe* pipe, int nExitCode); + + WINPR_API wMessagePipe* MessagePipe_New(void); + WINPR_API void MessagePipe_Free(wMessagePipe* pipe); + + /* Publisher/Subscriber Pattern */ + + struct _wEventArgs + { + DWORD Size; + const char* Sender; + }; + typedef struct _wEventArgs wEventArgs; + + typedef void (*pEventHandler)(void* context, wEventArgs* e); + +#define MAX_EVENT_HANDLERS 32 + + struct _wEventType + { + const char* EventName; + wEventArgs EventArgs; + int EventHandlerCount; + pEventHandler EventHandlers[MAX_EVENT_HANDLERS]; + }; + typedef struct _wEventType wEventType; + +#define EventArgsInit(_event_args, _sender) \ + memset(_event_args, 0, sizeof(*_event_args)); \ + ((wEventArgs*)_event_args)->Size = sizeof(*_event_args); \ + ((wEventArgs*)_event_args)->Sender = _sender #define DEFINE_EVENT_HANDLER(_name) \ - typedef void (*p ## _name ## EventHandler)(void* context, _name ## EventArgs* e) + typedef void (*p##_name##EventHandler)(void* context, _name##EventArgs* e) -#define DEFINE_EVENT_RAISE(_name) \ - static INLINE int PubSub_On ## _name (wPubSub* pubSub, void* context, _name ## EventArgs* e) { \ - return PubSub_OnEvent(pubSub, #_name, context, (wEventArgs*) e); } +#define DEFINE_EVENT_RAISE(_name) \ + static INLINE int PubSub_On##_name(wPubSub* pubSub, void* context, _name##EventArgs* e) \ + { \ + return PubSub_OnEvent(pubSub, #_name, context, (wEventArgs*)e); \ + } -#define DEFINE_EVENT_SUBSCRIBE(_name) \ - static INLINE int PubSub_Subscribe ## _name (wPubSub* pubSub, p ## _name ## EventHandler EventHandler) { \ - return PubSub_Subscribe(pubSub, #_name, (pEventHandler) EventHandler); } +#define DEFINE_EVENT_SUBSCRIBE(_name) \ + static INLINE int PubSub_Subscribe##_name(wPubSub* pubSub, \ + p##_name##EventHandler EventHandler) \ + { \ + return PubSub_Subscribe(pubSub, #_name, (pEventHandler)EventHandler); \ + } -#define DEFINE_EVENT_UNSUBSCRIBE(_name) \ - static INLINE int PubSub_Unsubscribe ## _name (wPubSub* pubSub, p ## _name ## EventHandler EventHandler) { \ - return PubSub_Unsubscribe(pubSub, #_name, (pEventHandler) EventHandler); } +#define DEFINE_EVENT_UNSUBSCRIBE(_name) \ + static INLINE int PubSub_Unsubscribe##_name(wPubSub* pubSub, \ + p##_name##EventHandler EventHandler) \ + { \ + return PubSub_Unsubscribe(pubSub, #_name, (pEventHandler)EventHandler); \ + } -#define DEFINE_EVENT_BEGIN(_name) \ - typedef struct _ ## _name ## EventArgs { \ +#define DEFINE_EVENT_BEGIN(_name) \ + typedef struct _##_name##EventArgs \ + { \ wEventArgs e; -#define DEFINE_EVENT_END(_name) \ - } _name ## EventArgs; \ - DEFINE_EVENT_HANDLER(_name); \ - DEFINE_EVENT_RAISE(_name) \ +#define DEFINE_EVENT_END(_name) \ + } \ + _name##EventArgs; \ + DEFINE_EVENT_HANDLER(_name); \ + DEFINE_EVENT_RAISE(_name) \ DEFINE_EVENT_SUBSCRIBE(_name) \ DEFINE_EVENT_UNSUBSCRIBE(_name) -#define DEFINE_EVENT_ENTRY(_name) \ - { #_name, { sizeof( _name ## EventArgs), NULL }, 0, { NULL } }, +#define DEFINE_EVENT_ENTRY(_name) { #_name, { sizeof(_name##EventArgs), NULL }, 0, { NULL } }, struct _wPubSub { @@ -599,11 +611,13 @@ typedef struct _wEventType wEventType; WINPR_API void PubSub_AddEventTypes(wPubSub* pubSub, wEventType* events, int count); WINPR_API wEventType* PubSub_FindEventType(wPubSub* pubSub, const char* EventName); - WINPR_API int PubSub_Subscribe(wPubSub* pubSub, const char* EventName, pEventHandler EventHandler); + WINPR_API int PubSub_Subscribe(wPubSub* pubSub, const char* EventName, + pEventHandler EventHandler); WINPR_API int PubSub_Unsubscribe(wPubSub* pubSub, const char* EventName, pEventHandler EventHandler); - WINPR_API int PubSub_OnEvent(wPubSub* pubSub, const char* EventName, void* context, wEventArgs* e); + WINPR_API int PubSub_OnEvent(wPubSub* pubSub, const char* EventName, void* context, + wEventArgs* e); WINPR_API wPubSub* PubSub_New(BOOL synchronized); WINPR_API void PubSub_Free(wPubSub* pubSub); diff --git a/winpr/include/winpr/comm.h b/winpr/include/winpr/comm.h index d4a33b3dd..648722601 100644 --- a/winpr/include/winpr/comm.h +++ b/winpr/include/winpr/comm.h @@ -28,199 +28,198 @@ #include #include - #if defined __linux__ && !defined ANDROID -#define NOPARITY 0 -#define ODDPARITY 1 -#define EVENPARITY 2 -#define MARKPARITY 3 -#define SPACEPARITY 4 +#define NOPARITY 0 +#define ODDPARITY 1 +#define EVENPARITY 2 +#define MARKPARITY 3 +#define SPACEPARITY 4 -#define ONESTOPBIT 0 -#define ONE5STOPBITS 1 -#define TWOSTOPBITS 2 +#define ONESTOPBIT 0 +#define ONE5STOPBITS 1 +#define TWOSTOPBITS 2 #ifndef IGNORE -#define IGNORE 0 +#define IGNORE 0 #endif -#define CBR_110 110 -#define CBR_300 300 -#define CBR_600 600 -#define CBR_1200 1200 -#define CBR_2400 2400 -#define CBR_4800 4800 -#define CBR_9600 9600 -#define CBR_14400 14400 -#define CBR_19200 19200 -#define CBR_38400 38400 -#define CBR_56000 56000 -#define CBR_57600 57600 -#define CBR_115200 115200 -#define CBR_128000 128000 -#define CBR_256000 256000 +#define CBR_110 110 +#define CBR_300 300 +#define CBR_600 600 +#define CBR_1200 1200 +#define CBR_2400 2400 +#define CBR_4800 4800 +#define CBR_9600 9600 +#define CBR_14400 14400 +#define CBR_19200 19200 +#define CBR_38400 38400 +#define CBR_56000 56000 +#define CBR_57600 57600 +#define CBR_115200 115200 +#define CBR_128000 128000 +#define CBR_256000 256000 -#define CE_RXOVER 0x0001 -#define CE_OVERRUN 0x0002 -#define CE_RXPARITY 0x0004 -#define CE_FRAME 0x0008 -#define CE_BREAK 0x0010 -#define CE_TXFULL 0x0100 -#define CE_PTO 0x0200 -#define CE_IOE 0x0400 -#define CE_DNS 0x0800 -#define CE_OOP 0x1000 -#define CE_MODE 0x8000 +#define CE_RXOVER 0x0001 +#define CE_OVERRUN 0x0002 +#define CE_RXPARITY 0x0004 +#define CE_FRAME 0x0008 +#define CE_BREAK 0x0010 +#define CE_TXFULL 0x0100 +#define CE_PTO 0x0200 +#define CE_IOE 0x0400 +#define CE_DNS 0x0800 +#define CE_OOP 0x1000 +#define CE_MODE 0x8000 -#define IE_BADID (-1) -#define IE_OPEN (-2) -#define IE_NOPEN (-3) -#define IE_MEMORY (-4) -#define IE_DEFAULT (-5) -#define IE_HARDWARE (-10) -#define IE_BYTESIZE (-11) -#define IE_BAUDRATE (-12) +#define IE_BADID (-1) +#define IE_OPEN (-2) +#define IE_NOPEN (-3) +#define IE_MEMORY (-4) +#define IE_DEFAULT (-5) +#define IE_HARDWARE (-10) +#define IE_BYTESIZE (-11) +#define IE_BAUDRATE (-12) -#define EV_RXCHAR 0x0001 -#define EV_RXFLAG 0x0002 -#define EV_TXEMPTY 0x0004 -#define EV_CTS 0x0008 -#define EV_DSR 0x0010 -#define EV_RLSD 0x0020 -#define EV_BREAK 0x0040 -#define EV_ERR 0x0080 -#define EV_RING 0x0100 -#define EV_PERR 0x0200 -#define EV_RX80FULL 0x0400 -#define EV_EVENT1 0x0800 -#define EV_EVENT2 0x1000 +#define EV_RXCHAR 0x0001 +#define EV_RXFLAG 0x0002 +#define EV_TXEMPTY 0x0004 +#define EV_CTS 0x0008 +#define EV_DSR 0x0010 +#define EV_RLSD 0x0020 +#define EV_BREAK 0x0040 +#define EV_ERR 0x0080 +#define EV_RING 0x0100 +#define EV_PERR 0x0200 +#define EV_RX80FULL 0x0400 +#define EV_EVENT1 0x0800 +#define EV_EVENT2 0x1000 -#define SETXOFF 1 -#define SETXON 2 -#define SETRTS 3 -#define CLRRTS 4 -#define SETDTR 5 -#define CLRDTR 6 -#define RESETDEV 7 -#define SETBREAK 8 -#define CLRBREAK 9 +#define SETXOFF 1 +#define SETXON 2 +#define SETRTS 3 +#define CLRRTS 4 +#define SETDTR 5 +#define CLRDTR 6 +#define RESETDEV 7 +#define SETBREAK 8 +#define CLRBREAK 9 -#define PURGE_TXABORT 0x0001 -#define PURGE_RXABORT 0x0002 -#define PURGE_TXCLEAR 0x0004 -#define PURGE_RXCLEAR 0x0008 +#define PURGE_TXABORT 0x0001 +#define PURGE_RXABORT 0x0002 +#define PURGE_TXCLEAR 0x0004 +#define PURGE_RXCLEAR 0x0008 -#define LPTx 0x80 +#define LPTx 0x80 -#define MS_CTS_ON ((DWORD)0x0010) -#define MS_DSR_ON ((DWORD)0x0020) -#define MS_RING_ON ((DWORD)0x0040) -#define MS_RLSD_ON ((DWORD)0x0080) +#define MS_CTS_ON ((DWORD)0x0010) +#define MS_DSR_ON ((DWORD)0x0020) +#define MS_RING_ON ((DWORD)0x0040) +#define MS_RLSD_ON ((DWORD)0x0080) -#define SP_SERIALCOMM ((DWORD)0x00000001) +#define SP_SERIALCOMM ((DWORD)0x00000001) -#define PST_UNSPECIFIED ((DWORD)0x00000000) -#define PST_RS232 ((DWORD)0x00000001) -#define PST_PARALLELPORT ((DWORD)0x00000002) -#define PST_RS422 ((DWORD)0x00000003) -#define PST_RS423 ((DWORD)0x00000004) -#define PST_RS449 ((DWORD)0x00000005) -#define PST_MODEM ((DWORD)0x00000006) -#define PST_FAX ((DWORD)0x00000021) -#define PST_SCANNER ((DWORD)0x00000022) -#define PST_NETWORK_BRIDGE ((DWORD)0x00000100) -#define PST_LAT ((DWORD)0x00000101) -#define PST_TCPIP_TELNET ((DWORD)0x00000102) -#define PST_X25 ((DWORD)0x00000103) +#define PST_UNSPECIFIED ((DWORD)0x00000000) +#define PST_RS232 ((DWORD)0x00000001) +#define PST_PARALLELPORT ((DWORD)0x00000002) +#define PST_RS422 ((DWORD)0x00000003) +#define PST_RS423 ((DWORD)0x00000004) +#define PST_RS449 ((DWORD)0x00000005) +#define PST_MODEM ((DWORD)0x00000006) +#define PST_FAX ((DWORD)0x00000021) +#define PST_SCANNER ((DWORD)0x00000022) +#define PST_NETWORK_BRIDGE ((DWORD)0x00000100) +#define PST_LAT ((DWORD)0x00000101) +#define PST_TCPIP_TELNET ((DWORD)0x00000102) +#define PST_X25 ((DWORD)0x00000103) -#define PCF_DTRDSR ((DWORD)0x0001) -#define PCF_RTSCTS ((DWORD)0x0002) -#define PCF_RLSD ((DWORD)0x0004) -#define PCF_PARITY_CHECK ((DWORD)0x0008) -#define PCF_XONXOFF ((DWORD)0x0010) -#define PCF_SETXCHAR ((DWORD)0x0020) -#define PCF_TOTALTIMEOUTS ((DWORD)0x0040) -#define PCF_INTTIMEOUTS ((DWORD)0x0080) -#define PCF_SPECIALCHARS ((DWORD)0x0100) -#define PCF_16BITMODE ((DWORD)0x0200) +#define PCF_DTRDSR ((DWORD)0x0001) +#define PCF_RTSCTS ((DWORD)0x0002) +#define PCF_RLSD ((DWORD)0x0004) +#define PCF_PARITY_CHECK ((DWORD)0x0008) +#define PCF_XONXOFF ((DWORD)0x0010) +#define PCF_SETXCHAR ((DWORD)0x0020) +#define PCF_TOTALTIMEOUTS ((DWORD)0x0040) +#define PCF_INTTIMEOUTS ((DWORD)0x0080) +#define PCF_SPECIALCHARS ((DWORD)0x0100) +#define PCF_16BITMODE ((DWORD)0x0200) -#define SP_PARITY ((DWORD)0x0001) -#define SP_BAUD ((DWORD)0x0002) -#define SP_DATABITS ((DWORD)0x0004) -#define SP_STOPBITS ((DWORD)0x0008) -#define SP_HANDSHAKING ((DWORD)0x0010) -#define SP_PARITY_CHECK ((DWORD)0x0020) -#define SP_RLSD ((DWORD)0x0040) +#define SP_PARITY ((DWORD)0x0001) +#define SP_BAUD ((DWORD)0x0002) +#define SP_DATABITS ((DWORD)0x0004) +#define SP_STOPBITS ((DWORD)0x0008) +#define SP_HANDSHAKING ((DWORD)0x0010) +#define SP_PARITY_CHECK ((DWORD)0x0020) +#define SP_RLSD ((DWORD)0x0040) -#define BAUD_075 ((DWORD)0x00000001) -#define BAUD_110 ((DWORD)0x00000002) -#define BAUD_134_5 ((DWORD)0x00000004) -#define BAUD_150 ((DWORD)0x00000008) -#define BAUD_300 ((DWORD)0x00000010) -#define BAUD_600 ((DWORD)0x00000020) -#define BAUD_1200 ((DWORD)0x00000040) -#define BAUD_1800 ((DWORD)0x00000080) -#define BAUD_2400 ((DWORD)0x00000100) -#define BAUD_4800 ((DWORD)0x00000200) -#define BAUD_7200 ((DWORD)0x00000400) -#define BAUD_9600 ((DWORD)0x00000800) -#define BAUD_14400 ((DWORD)0x00001000) -#define BAUD_19200 ((DWORD)0x00002000) -#define BAUD_38400 ((DWORD)0x00004000) -#define BAUD_56K ((DWORD)0x00008000) -#define BAUD_128K ((DWORD)0x00010000) -#define BAUD_115200 ((DWORD)0x00020000) -#define BAUD_57600 ((DWORD)0x00040000) -#define BAUD_USER ((DWORD)0x10000000) +#define BAUD_075 ((DWORD)0x00000001) +#define BAUD_110 ((DWORD)0x00000002) +#define BAUD_134_5 ((DWORD)0x00000004) +#define BAUD_150 ((DWORD)0x00000008) +#define BAUD_300 ((DWORD)0x00000010) +#define BAUD_600 ((DWORD)0x00000020) +#define BAUD_1200 ((DWORD)0x00000040) +#define BAUD_1800 ((DWORD)0x00000080) +#define BAUD_2400 ((DWORD)0x00000100) +#define BAUD_4800 ((DWORD)0x00000200) +#define BAUD_7200 ((DWORD)0x00000400) +#define BAUD_9600 ((DWORD)0x00000800) +#define BAUD_14400 ((DWORD)0x00001000) +#define BAUD_19200 ((DWORD)0x00002000) +#define BAUD_38400 ((DWORD)0x00004000) +#define BAUD_56K ((DWORD)0x00008000) +#define BAUD_128K ((DWORD)0x00010000) +#define BAUD_115200 ((DWORD)0x00020000) +#define BAUD_57600 ((DWORD)0x00040000) +#define BAUD_USER ((DWORD)0x10000000) -#define DATABITS_5 ((WORD)0x0001) -#define DATABITS_6 ((WORD)0x0002) -#define DATABITS_7 ((WORD)0x0004) -#define DATABITS_8 ((WORD)0x0008) -#define DATABITS_16 ((WORD)0x0010) -#define DATABITS_16X ((WORD)0x0020) +#define DATABITS_5 ((WORD)0x0001) +#define DATABITS_6 ((WORD)0x0002) +#define DATABITS_7 ((WORD)0x0004) +#define DATABITS_8 ((WORD)0x0008) +#define DATABITS_16 ((WORD)0x0010) +#define DATABITS_16X ((WORD)0x0020) -#define STOPBITS_10 ((WORD)0x0001) -#define STOPBITS_15 ((WORD)0x0002) -#define STOPBITS_20 ((WORD)0x0004) +#define STOPBITS_10 ((WORD)0x0001) +#define STOPBITS_15 ((WORD)0x0002) +#define STOPBITS_20 ((WORD)0x0004) -#define PARITY_NONE ((WORD)0x0100) -#define PARITY_ODD ((WORD)0x0200) -#define PARITY_EVEN ((WORD)0x0400) -#define PARITY_MARK ((WORD)0x0800) -#define PARITY_SPACE ((WORD)0x1000) +#define PARITY_NONE ((WORD)0x0100) +#define PARITY_ODD ((WORD)0x0200) +#define PARITY_EVEN ((WORD)0x0400) +#define PARITY_MARK ((WORD)0x0800) +#define PARITY_SPACE ((WORD)0x1000) -#define COMMPROP_INITIALIZED ((DWORD)0xE73CF52E) +#define COMMPROP_INITIALIZED ((DWORD)0xE73CF52E) -#define DTR_CONTROL_DISABLE 0x00 -#define DTR_CONTROL_ENABLE 0x01 -#define DTR_CONTROL_HANDSHAKE 0x02 +#define DTR_CONTROL_DISABLE 0x00 +#define DTR_CONTROL_ENABLE 0x01 +#define DTR_CONTROL_HANDSHAKE 0x02 -#define RTS_CONTROL_DISABLE 0x00 -#define RTS_CONTROL_ENABLE 0x01 -#define RTS_CONTROL_HANDSHAKE 0x02 -#define RTS_CONTROL_TOGGLE 0x03 +#define RTS_CONTROL_DISABLE 0x00 +#define RTS_CONTROL_ENABLE 0x01 +#define RTS_CONTROL_HANDSHAKE 0x02 +#define RTS_CONTROL_TOGGLE 0x03 // http://msdn.microsoft.com/en-us/library/windows/desktop/aa363214%28v=vs.85%29.aspx typedef struct _DCB { DWORD DCBlength; DWORD BaudRate; - DWORD fBinary:1; - DWORD fParity:1; - DWORD fOutxCtsFlow:1; - DWORD fOutxDsrFlow:1; - DWORD fDtrControl:2; - DWORD fDsrSensitivity:1; - DWORD fTXContinueOnXoff:1; - DWORD fOutX:1; - DWORD fInX:1; - DWORD fErrorChar:1; - DWORD fNull:1; - DWORD fRtsControl:2; - DWORD fAbortOnError:1; - DWORD fDummy2:17; + DWORD fBinary : 1; + DWORD fParity : 1; + DWORD fOutxCtsFlow : 1; + DWORD fOutxDsrFlow : 1; + DWORD fDtrControl : 2; + DWORD fDsrSensitivity : 1; + DWORD fTXContinueOnXoff : 1; + DWORD fOutX : 1; + DWORD fInX : 1; + DWORD fErrorChar : 1; + DWORD fNull : 1; + DWORD fRtsControl : 2; + DWORD fAbortOnError : 1; + DWORD fDummy2 : 17; WORD wReserved; WORD XonLim; WORD XoffLim; @@ -280,77 +279,80 @@ typedef struct _COMMTIMEOUTS typedef struct _COMSTAT { - DWORD fCtsHold:1; - DWORD fDsrHold:1; - DWORD fRlsdHold:1; - DWORD fXoffHold:1; - DWORD fXoffSent:1; - DWORD fEof:1; - DWORD fTxim:1; - DWORD fReserved:25; + DWORD fCtsHold : 1; + DWORD fDsrHold : 1; + DWORD fRlsdHold : 1; + DWORD fXoffHold : 1; + DWORD fXoffSent : 1; + DWORD fEof : 1; + DWORD fTxim : 1; + DWORD fReserved : 25; DWORD cbInQue; DWORD cbOutQue; } COMSTAT, *LPCOMSTAT; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API BOOL BuildCommDCBA(LPCSTR lpDef, LPDCB lpDCB); -WINPR_API BOOL BuildCommDCBW(LPCWSTR lpDef, LPDCB lpDCB); + WINPR_API BOOL BuildCommDCBA(LPCSTR lpDef, LPDCB lpDCB); + WINPR_API BOOL BuildCommDCBW(LPCWSTR lpDef, LPDCB lpDCB); -WINPR_API BOOL BuildCommDCBAndTimeoutsA(LPCSTR lpDef, LPDCB lpDCB, LPCOMMTIMEOUTS lpCommTimeouts); -WINPR_API BOOL BuildCommDCBAndTimeoutsW(LPCWSTR lpDef, LPDCB lpDCB, LPCOMMTIMEOUTS lpCommTimeouts); + WINPR_API BOOL BuildCommDCBAndTimeoutsA(LPCSTR lpDef, LPDCB lpDCB, + LPCOMMTIMEOUTS lpCommTimeouts); + WINPR_API BOOL BuildCommDCBAndTimeoutsW(LPCWSTR lpDef, LPDCB lpDCB, + LPCOMMTIMEOUTS lpCommTimeouts); -WINPR_API BOOL CommConfigDialogA(LPCSTR lpszName, HWND hWnd, LPCOMMCONFIG lpCC); -WINPR_API BOOL CommConfigDialogW(LPCWSTR lpszName, HWND hWnd, LPCOMMCONFIG lpCC); + WINPR_API BOOL CommConfigDialogA(LPCSTR lpszName, HWND hWnd, LPCOMMCONFIG lpCC); + WINPR_API BOOL CommConfigDialogW(LPCWSTR lpszName, HWND hWnd, LPCOMMCONFIG lpCC); -WINPR_API BOOL GetCommConfig(HANDLE hCommDev, LPCOMMCONFIG lpCC, LPDWORD lpdwSize); -WINPR_API BOOL SetCommConfig(HANDLE hCommDev, LPCOMMCONFIG lpCC, DWORD dwSize); + WINPR_API BOOL GetCommConfig(HANDLE hCommDev, LPCOMMCONFIG lpCC, LPDWORD lpdwSize); + WINPR_API BOOL SetCommConfig(HANDLE hCommDev, LPCOMMCONFIG lpCC, DWORD dwSize); -WINPR_API BOOL GetCommMask(HANDLE hFile, PDWORD lpEvtMask); -WINPR_API BOOL SetCommMask(HANDLE hFile, DWORD dwEvtMask); + WINPR_API BOOL GetCommMask(HANDLE hFile, PDWORD lpEvtMask); + WINPR_API BOOL SetCommMask(HANDLE hFile, DWORD dwEvtMask); -WINPR_API BOOL GetCommModemStatus(HANDLE hFile, PDWORD lpModemStat); -WINPR_API BOOL GetCommProperties(HANDLE hFile, LPCOMMPROP lpCommProp); + WINPR_API BOOL GetCommModemStatus(HANDLE hFile, PDWORD lpModemStat); + WINPR_API BOOL GetCommProperties(HANDLE hFile, LPCOMMPROP lpCommProp); -WINPR_API BOOL GetCommState(HANDLE hFile, LPDCB lpDCB); -WINPR_API BOOL SetCommState(HANDLE hFile, LPDCB lpDCB); + WINPR_API BOOL GetCommState(HANDLE hFile, LPDCB lpDCB); + WINPR_API BOOL SetCommState(HANDLE hFile, LPDCB lpDCB); -WINPR_API BOOL GetCommTimeouts(HANDLE hFile, LPCOMMTIMEOUTS lpCommTimeouts); -WINPR_API BOOL SetCommTimeouts(HANDLE hFile, LPCOMMTIMEOUTS lpCommTimeouts); + WINPR_API BOOL GetCommTimeouts(HANDLE hFile, LPCOMMTIMEOUTS lpCommTimeouts); + WINPR_API BOOL SetCommTimeouts(HANDLE hFile, LPCOMMTIMEOUTS lpCommTimeouts); -WINPR_API BOOL GetDefaultCommConfigA(LPCSTR lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize); -WINPR_API BOOL GetDefaultCommConfigW(LPCWSTR lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize); + WINPR_API BOOL GetDefaultCommConfigA(LPCSTR lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize); + WINPR_API BOOL GetDefaultCommConfigW(LPCWSTR lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize); -WINPR_API BOOL SetDefaultCommConfigA(LPCSTR lpszName, LPCOMMCONFIG lpCC, DWORD dwSize); -WINPR_API BOOL SetDefaultCommConfigW(LPCWSTR lpszName, LPCOMMCONFIG lpCC, DWORD dwSize); + WINPR_API BOOL SetDefaultCommConfigA(LPCSTR lpszName, LPCOMMCONFIG lpCC, DWORD dwSize); + WINPR_API BOOL SetDefaultCommConfigW(LPCWSTR lpszName, LPCOMMCONFIG lpCC, DWORD dwSize); -WINPR_API BOOL SetCommBreak(HANDLE hFile); -WINPR_API BOOL ClearCommBreak(HANDLE hFile); -WINPR_API BOOL ClearCommError(HANDLE hFile, PDWORD lpErrors, LPCOMSTAT lpStat); + WINPR_API BOOL SetCommBreak(HANDLE hFile); + WINPR_API BOOL ClearCommBreak(HANDLE hFile); + WINPR_API BOOL ClearCommError(HANDLE hFile, PDWORD lpErrors, LPCOMSTAT lpStat); -WINPR_API BOOL PurgeComm(HANDLE hFile, DWORD dwFlags); -WINPR_API BOOL SetupComm(HANDLE hFile, DWORD dwInQueue, DWORD dwOutQueue); + WINPR_API BOOL PurgeComm(HANDLE hFile, DWORD dwFlags); + WINPR_API BOOL SetupComm(HANDLE hFile, DWORD dwInQueue, DWORD dwOutQueue); -WINPR_API BOOL EscapeCommFunction(HANDLE hFile, DWORD dwFunc); + WINPR_API BOOL EscapeCommFunction(HANDLE hFile, DWORD dwFunc); -WINPR_API BOOL TransmitCommChar(HANDLE hFile, char cChar); + WINPR_API BOOL TransmitCommChar(HANDLE hFile, char cChar); -WINPR_API BOOL WaitCommEvent(HANDLE hFile, PDWORD lpEvtMask, LPOVERLAPPED lpOverlapped); + WINPR_API BOOL WaitCommEvent(HANDLE hFile, PDWORD lpEvtMask, LPOVERLAPPED lpOverlapped); #ifdef UNICODE -#define BuildCommDCB BuildCommDCBW -#define BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsW -#define CommConfigDialog CommConfigDialogW -#define GetDefaultCommConfig GetDefaultCommConfigW -#define SetDefaultCommConfig SetDefaultCommConfigW +#define BuildCommDCB BuildCommDCBW +#define BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsW +#define CommConfigDialog CommConfigDialogW +#define GetDefaultCommConfig GetDefaultCommConfigW +#define SetDefaultCommConfig SetDefaultCommConfigW #else -#define BuildCommDCB BuildCommDCBA +#define BuildCommDCB BuildCommDCBA #define BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsA -#define CommConfigDialog CommConfigDialogA -#define GetDefaultCommConfig GetDefaultCommConfigA -#define SetDefaultCommConfig SetDefaultCommConfigA +#define CommConfigDialog CommConfigDialogA +#define GetDefaultCommConfig GetDefaultCommConfigA +#define SetDefaultCommConfig SetDefaultCommConfigA #endif /* Extended API */ @@ -360,79 +362,78 @@ WINPR_API BOOL WaitCommEvent(HANDLE hFile, PDWORD lpEvtMask, LPOVERLAPPED lpOver #define MAXULONG (4294967295UL) #endif + /** + * IOCTLs table according the server's serial driver: + * http://msdn.microsoft.com/en-us/library/windows/hardware/dn265347%28v=vs.85%29.aspx + */ + typedef enum _SERIAL_DRIVER_ID + { + SerialDriverUnknown = 0, + SerialDriverSerialSys, + SerialDriverSerCxSys, + SerialDriverSerCx2Sys /* default fallback, see also CommDeviceIoControl() */ + } SERIAL_DRIVER_ID; -/** - * IOCTLs table according the server's serial driver: - * http://msdn.microsoft.com/en-us/library/windows/hardware/dn265347%28v=vs.85%29.aspx - */ -typedef enum _SERIAL_DRIVER_ID -{ - SerialDriverUnknown = 0, - SerialDriverSerialSys, - SerialDriverSerCxSys, - SerialDriverSerCx2Sys /* default fallback, see also CommDeviceIoControl() */ -} SERIAL_DRIVER_ID; + /* + * About DefineCommDevice() / QueryDosDevice() + * + * Did something close to QueryDosDevice() and DefineDosDevice() but with + * folowing constraints: + * - mappings are stored in a static array. + * - QueryCommDevice returns only the mappings that have been defined through + * DefineCommDevice() + */ + WINPR_API BOOL DefineCommDevice(/* DWORD dwFlags,*/ LPCTSTR lpDeviceName, LPCTSTR lpTargetPath); + WINPR_API DWORD QueryCommDevice(LPCTSTR lpDeviceName, LPTSTR lpTargetPath, DWORD ucchMax); + WINPR_API BOOL IsCommDevice(LPCTSTR lpDeviceName); + /** + * A handle can only be created on defined devices with DefineCommDevice(). This + * also ensures that CommCreateFileA() has been registered through + * RegisterHandleCreator(). + */ + WINPR_API HANDLE CommCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, + DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, + HANDLE hTemplateFile); -/* - * About DefineCommDevice() / QueryDosDevice() - * - * Did something close to QueryDosDevice() and DefineDosDevice() but with - * folowing constraints: - * - mappings are stored in a static array. - * - QueryCommDevice returns only the mappings that have been defined through DefineCommDevice() - */ -WINPR_API BOOL DefineCommDevice(/* DWORD dwFlags,*/ LPCTSTR lpDeviceName, LPCTSTR lpTargetPath); -WINPR_API DWORD QueryCommDevice(LPCTSTR lpDeviceName, LPTSTR lpTargetPath, DWORD ucchMax); -WINPR_API BOOL IsCommDevice(LPCTSTR lpDeviceName); - -/** - * A handle can only be created on defined devices with DefineCommDevice(). This - * also ensures that CommCreateFileA() has been registered through - * RegisterHandleCreator(). - */ -WINPR_API HANDLE CommCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, - DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile); - - - -#define IOCTL_SERIAL_SET_BAUD_RATE 0x001B0004 -#define IOCTL_SERIAL_GET_BAUD_RATE 0x001B0050 -#define IOCTL_SERIAL_SET_LINE_CONTROL 0x001B000C -#define IOCTL_SERIAL_GET_LINE_CONTROL 0x001B0054 -#define IOCTL_SERIAL_SET_TIMEOUTS 0x001B001C -#define IOCTL_SERIAL_GET_TIMEOUTS 0x001B0020 +#define IOCTL_SERIAL_SET_BAUD_RATE 0x001B0004 +#define IOCTL_SERIAL_GET_BAUD_RATE 0x001B0050 +#define IOCTL_SERIAL_SET_LINE_CONTROL 0x001B000C +#define IOCTL_SERIAL_GET_LINE_CONTROL 0x001B0054 +#define IOCTL_SERIAL_SET_TIMEOUTS 0x001B001C +#define IOCTL_SERIAL_GET_TIMEOUTS 0x001B0020 /* GET_CHARS and SET_CHARS are swapped in the RDP docs [MS-RDPESP] */ -#define IOCTL_SERIAL_GET_CHARS 0x001B0058 -#define IOCTL_SERIAL_SET_CHARS 0x001B005C +#define IOCTL_SERIAL_GET_CHARS 0x001B0058 +#define IOCTL_SERIAL_SET_CHARS 0x001B005C -#define IOCTL_SERIAL_SET_DTR 0x001B0024 -#define IOCTL_SERIAL_CLR_DTR 0x001B0028 -#define IOCTL_SERIAL_RESET_DEVICE 0x001B002C -#define IOCTL_SERIAL_SET_RTS 0x001B0030 -#define IOCTL_SERIAL_CLR_RTS 0x001B0034 -#define IOCTL_SERIAL_SET_XOFF 0x001B0038 -#define IOCTL_SERIAL_SET_XON 0x001B003C -#define IOCTL_SERIAL_SET_BREAK_ON 0x001B0010 -#define IOCTL_SERIAL_SET_BREAK_OFF 0x001B0014 -#define IOCTL_SERIAL_SET_QUEUE_SIZE 0x001B0008 -#define IOCTL_SERIAL_GET_WAIT_MASK 0x001B0040 -#define IOCTL_SERIAL_SET_WAIT_MASK 0x001B0044 -#define IOCTL_SERIAL_WAIT_ON_MASK 0x001B0048 -#define IOCTL_SERIAL_IMMEDIATE_CHAR 0x001B0018 -#define IOCTL_SERIAL_PURGE 0x001B004C -#define IOCTL_SERIAL_GET_HANDFLOW 0x001B0060 -#define IOCTL_SERIAL_SET_HANDFLOW 0x001B0064 -#define IOCTL_SERIAL_GET_MODEMSTATUS 0x001B0068 -#define IOCTL_SERIAL_GET_DTRRTS 0x001B0078 +#define IOCTL_SERIAL_SET_DTR 0x001B0024 +#define IOCTL_SERIAL_CLR_DTR 0x001B0028 +#define IOCTL_SERIAL_RESET_DEVICE 0x001B002C +#define IOCTL_SERIAL_SET_RTS 0x001B0030 +#define IOCTL_SERIAL_CLR_RTS 0x001B0034 +#define IOCTL_SERIAL_SET_XOFF 0x001B0038 +#define IOCTL_SERIAL_SET_XON 0x001B003C +#define IOCTL_SERIAL_SET_BREAK_ON 0x001B0010 +#define IOCTL_SERIAL_SET_BREAK_OFF 0x001B0014 +#define IOCTL_SERIAL_SET_QUEUE_SIZE 0x001B0008 +#define IOCTL_SERIAL_GET_WAIT_MASK 0x001B0040 +#define IOCTL_SERIAL_SET_WAIT_MASK 0x001B0044 +#define IOCTL_SERIAL_WAIT_ON_MASK 0x001B0048 +#define IOCTL_SERIAL_IMMEDIATE_CHAR 0x001B0018 +#define IOCTL_SERIAL_PURGE 0x001B004C +#define IOCTL_SERIAL_GET_HANDFLOW 0x001B0060 +#define IOCTL_SERIAL_SET_HANDFLOW 0x001B0064 +#define IOCTL_SERIAL_GET_MODEMSTATUS 0x001B0068 +#define IOCTL_SERIAL_GET_DTRRTS 0x001B0078 /* according to [MS-RDPESP] it should be 0x001B0084, but servers send 0x001B006C */ -#define IOCTL_SERIAL_GET_COMMSTATUS 0x001B006C +#define IOCTL_SERIAL_GET_COMMSTATUS 0x001B006C -#define IOCTL_SERIAL_GET_PROPERTIES 0x001B0074 +#define IOCTL_SERIAL_GET_PROPERTIES 0x001B0074 /* IOCTL_SERIAL_XOFF_COUNTER 0x001B0070 */ /* IOCTL_SERIAL_LSRMST_INSERT 0x001B007C */ -#define IOCTL_SERIAL_CONFIG_SIZE 0x001B0080 +#define IOCTL_SERIAL_CONFIG_SIZE 0x001B0080 /* IOCTL_SERIAL_GET_STATS 0x001B008C */ /* IOCTL_SERIAL_CLEAR_STATS 0x001B0090 */ /* IOCTL_SERIAL_GET_MODEM_CONTROL 0x001B0094 */ @@ -453,108 +454,107 @@ WINPR_API HANDLE CommCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD /* IOCTL_PAR_IS_PORT_FREE 0x00160054 */ /* http://msdn.microsoft.com/en-us/library/windows/hardware/ff551803(v=vs.85).aspx */ -#define IOCTL_USBPRINT_GET_1284_ID 0x220034 +#define IOCTL_USBPRINT_GET_1284_ID 0x220034 + typedef struct __SERIAL_IOCTL_NAME + { + ULONG number; + const char* name; + } _SERIAL_IOCTL_NAME; -typedef struct __SERIAL_IOCTL_NAME -{ - ULONG number; - const char* name; -} _SERIAL_IOCTL_NAME; + static const _SERIAL_IOCTL_NAME _SERIAL_IOCTL_NAMES[] = { + { IOCTL_SERIAL_SET_BAUD_RATE, "IOCTL_SERIAL_SET_BAUD_RATE" }, + { IOCTL_SERIAL_GET_BAUD_RATE, "IOCTL_SERIAL_GET_BAUD_RATE" }, + { IOCTL_SERIAL_SET_LINE_CONTROL, "IOCTL_SERIAL_SET_LINE_CONTROL" }, + { IOCTL_SERIAL_GET_LINE_CONTROL, "IOCTL_SERIAL_GET_LINE_CONTROL" }, + { IOCTL_SERIAL_SET_TIMEOUTS, "IOCTL_SERIAL_SET_TIMEOUTS" }, + { IOCTL_SERIAL_GET_TIMEOUTS, "IOCTL_SERIAL_GET_TIMEOUTS" }, + { IOCTL_SERIAL_GET_CHARS, "IOCTL_SERIAL_GET_CHARS" }, + { IOCTL_SERIAL_SET_CHARS, "IOCTL_SERIAL_SET_CHARS" }, + { IOCTL_SERIAL_SET_DTR, "IOCTL_SERIAL_SET_DTR" }, + { IOCTL_SERIAL_CLR_DTR, "IOCTL_SERIAL_CLR_DTR" }, + { IOCTL_SERIAL_RESET_DEVICE, "IOCTL_SERIAL_RESET_DEVICE" }, + { IOCTL_SERIAL_SET_RTS, "IOCTL_SERIAL_SET_RTS" }, + { IOCTL_SERIAL_CLR_RTS, "IOCTL_SERIAL_CLR_RTS" }, + { IOCTL_SERIAL_SET_XOFF, "IOCTL_SERIAL_SET_XOFF" }, + { IOCTL_SERIAL_SET_XON, "IOCTL_SERIAL_SET_XON" }, + { IOCTL_SERIAL_SET_BREAK_ON, "IOCTL_SERIAL_SET_BREAK_ON" }, + { IOCTL_SERIAL_SET_BREAK_OFF, "IOCTL_SERIAL_SET_BREAK_OFF" }, + { IOCTL_SERIAL_SET_QUEUE_SIZE, "IOCTL_SERIAL_SET_QUEUE_SIZE" }, + { IOCTL_SERIAL_GET_WAIT_MASK, "IOCTL_SERIAL_GET_WAIT_MASK" }, + { IOCTL_SERIAL_SET_WAIT_MASK, "IOCTL_SERIAL_SET_WAIT_MASK" }, + { IOCTL_SERIAL_WAIT_ON_MASK, "IOCTL_SERIAL_WAIT_ON_MASK" }, + { IOCTL_SERIAL_IMMEDIATE_CHAR, "IOCTL_SERIAL_IMMEDIATE_CHAR" }, + { IOCTL_SERIAL_PURGE, "IOCTL_SERIAL_PURGE" }, + { IOCTL_SERIAL_GET_HANDFLOW, "IOCTL_SERIAL_GET_HANDFLOW" }, + { IOCTL_SERIAL_SET_HANDFLOW, "IOCTL_SERIAL_SET_HANDFLOW" }, + { IOCTL_SERIAL_GET_MODEMSTATUS, "IOCTL_SERIAL_GET_MODEMSTATUS" }, + { IOCTL_SERIAL_GET_DTRRTS, "IOCTL_SERIAL_GET_DTRRTS" }, + { IOCTL_SERIAL_GET_COMMSTATUS, "IOCTL_SERIAL_GET_COMMSTATUS" }, + { IOCTL_SERIAL_GET_PROPERTIES, "IOCTL_SERIAL_GET_PROPERTIES" }, + // {IOCTL_SERIAL_XOFF_COUNTER, "IOCTL_SERIAL_XOFF_COUNTER"}, + // {IOCTL_SERIAL_LSRMST_INSERT, "IOCTL_SERIAL_LSRMST_INSERT"}, + { IOCTL_SERIAL_CONFIG_SIZE, "IOCTL_SERIAL_CONFIG_SIZE" }, + // {IOCTL_SERIAL_GET_STATS, "IOCTL_SERIAL_GET_STATS"}, + // {IOCTL_SERIAL_CLEAR_STATS, "IOCTL_SERIAL_CLEAR_STATS"}, + // {IOCTL_SERIAL_GET_MODEM_CONTROL,"IOCTL_SERIAL_GET_MODEM_CONTROL"}, + // {IOCTL_SERIAL_SET_MODEM_CONTROL,"IOCTL_SERIAL_SET_MODEM_CONTROL"}, + // {IOCTL_SERIAL_SET_FIFO_CONTROL, "IOCTL_SERIAL_SET_FIFO_CONTROL"}, -static const _SERIAL_IOCTL_NAME _SERIAL_IOCTL_NAMES[] = -{ - {IOCTL_SERIAL_SET_BAUD_RATE, "IOCTL_SERIAL_SET_BAUD_RATE"}, - {IOCTL_SERIAL_GET_BAUD_RATE, "IOCTL_SERIAL_GET_BAUD_RATE"}, - {IOCTL_SERIAL_SET_LINE_CONTROL, "IOCTL_SERIAL_SET_LINE_CONTROL"}, - {IOCTL_SERIAL_GET_LINE_CONTROL, "IOCTL_SERIAL_GET_LINE_CONTROL"}, - {IOCTL_SERIAL_SET_TIMEOUTS, "IOCTL_SERIAL_SET_TIMEOUTS"}, - {IOCTL_SERIAL_GET_TIMEOUTS, "IOCTL_SERIAL_GET_TIMEOUTS"}, - {IOCTL_SERIAL_GET_CHARS, "IOCTL_SERIAL_GET_CHARS"}, - {IOCTL_SERIAL_SET_CHARS, "IOCTL_SERIAL_SET_CHARS"}, - {IOCTL_SERIAL_SET_DTR, "IOCTL_SERIAL_SET_DTR"}, - {IOCTL_SERIAL_CLR_DTR, "IOCTL_SERIAL_CLR_DTR"}, - {IOCTL_SERIAL_RESET_DEVICE, "IOCTL_SERIAL_RESET_DEVICE"}, - {IOCTL_SERIAL_SET_RTS, "IOCTL_SERIAL_SET_RTS"}, - {IOCTL_SERIAL_CLR_RTS, "IOCTL_SERIAL_CLR_RTS"}, - {IOCTL_SERIAL_SET_XOFF, "IOCTL_SERIAL_SET_XOFF"}, - {IOCTL_SERIAL_SET_XON, "IOCTL_SERIAL_SET_XON"}, - {IOCTL_SERIAL_SET_BREAK_ON, "IOCTL_SERIAL_SET_BREAK_ON"}, - {IOCTL_SERIAL_SET_BREAK_OFF, "IOCTL_SERIAL_SET_BREAK_OFF"}, - {IOCTL_SERIAL_SET_QUEUE_SIZE, "IOCTL_SERIAL_SET_QUEUE_SIZE"}, - {IOCTL_SERIAL_GET_WAIT_MASK, "IOCTL_SERIAL_GET_WAIT_MASK"}, - {IOCTL_SERIAL_SET_WAIT_MASK, "IOCTL_SERIAL_SET_WAIT_MASK"}, - {IOCTL_SERIAL_WAIT_ON_MASK, "IOCTL_SERIAL_WAIT_ON_MASK"}, - {IOCTL_SERIAL_IMMEDIATE_CHAR, "IOCTL_SERIAL_IMMEDIATE_CHAR"}, - {IOCTL_SERIAL_PURGE, "IOCTL_SERIAL_PURGE"}, - {IOCTL_SERIAL_GET_HANDFLOW, "IOCTL_SERIAL_GET_HANDFLOW"}, - {IOCTL_SERIAL_SET_HANDFLOW, "IOCTL_SERIAL_SET_HANDFLOW"}, - {IOCTL_SERIAL_GET_MODEMSTATUS, "IOCTL_SERIAL_GET_MODEMSTATUS"}, - {IOCTL_SERIAL_GET_DTRRTS, "IOCTL_SERIAL_GET_DTRRTS"}, - {IOCTL_SERIAL_GET_COMMSTATUS, "IOCTL_SERIAL_GET_COMMSTATUS"}, - {IOCTL_SERIAL_GET_PROPERTIES, "IOCTL_SERIAL_GET_PROPERTIES"}, - // {IOCTL_SERIAL_XOFF_COUNTER, "IOCTL_SERIAL_XOFF_COUNTER"}, - // {IOCTL_SERIAL_LSRMST_INSERT, "IOCTL_SERIAL_LSRMST_INSERT"}, - {IOCTL_SERIAL_CONFIG_SIZE, "IOCTL_SERIAL_CONFIG_SIZE"}, - // {IOCTL_SERIAL_GET_STATS, "IOCTL_SERIAL_GET_STATS"}, - // {IOCTL_SERIAL_CLEAR_STATS, "IOCTL_SERIAL_CLEAR_STATS"}, - // {IOCTL_SERIAL_GET_MODEM_CONTROL,"IOCTL_SERIAL_GET_MODEM_CONTROL"}, - // {IOCTL_SERIAL_SET_MODEM_CONTROL,"IOCTL_SERIAL_SET_MODEM_CONTROL"}, - // {IOCTL_SERIAL_SET_FIFO_CONTROL, "IOCTL_SERIAL_SET_FIFO_CONTROL"}, + // {IOCTL_PAR_QUERY_INFORMATION, "IOCTL_PAR_QUERY_INFORMATION"}, + // {IOCTL_PAR_SET_INFORMATION, "IOCTL_PAR_SET_INFORMATION"}, + // {IOCTL_PAR_QUERY_DEVICE_ID, "IOCTL_PAR_QUERY_DEVICE_ID"}, + // {IOCTL_PAR_QUERY_DEVICE_ID_SIZE,"IOCTL_PAR_QUERY_DEVICE_ID_SIZE"}, + // {IOCTL_IEEE1284_GET_MODE, "IOCTL_IEEE1284_GET_MODE"}, + // {IOCTL_IEEE1284_NEGOTIATE, "IOCTL_IEEE1284_NEGOTIATE"}, + // {IOCTL_PAR_SET_WRITE_ADDRESS, "IOCTL_PAR_SET_WRITE_ADDRESS"}, + // {IOCTL_PAR_SET_READ_ADDRESS, "IOCTL_PAR_SET_READ_ADDRESS"}, + // {IOCTL_PAR_GET_DEVICE_CAPS, "IOCTL_PAR_GET_DEVICE_CAPS"}, + // {IOCTL_PAR_GET_DEFAULT_MODES, "IOCTL_PAR_GET_DEFAULT_MODES"}, + // {IOCTL_PAR_QUERY_RAW_DEVICE_ID, "IOCTL_PAR_QUERY_RAW_DEVICE_ID"}, + // {IOCTL_PAR_IS_PORT_FREE, "IOCTL_PAR_IS_PORT_FREE"}, - // {IOCTL_PAR_QUERY_INFORMATION, "IOCTL_PAR_QUERY_INFORMATION"}, - // {IOCTL_PAR_SET_INFORMATION, "IOCTL_PAR_SET_INFORMATION"}, - // {IOCTL_PAR_QUERY_DEVICE_ID, "IOCTL_PAR_QUERY_DEVICE_ID"}, - // {IOCTL_PAR_QUERY_DEVICE_ID_SIZE,"IOCTL_PAR_QUERY_DEVICE_ID_SIZE"}, - // {IOCTL_IEEE1284_GET_MODE, "IOCTL_IEEE1284_GET_MODE"}, - // {IOCTL_IEEE1284_NEGOTIATE, "IOCTL_IEEE1284_NEGOTIATE"}, - // {IOCTL_PAR_SET_WRITE_ADDRESS, "IOCTL_PAR_SET_WRITE_ADDRESS"}, - // {IOCTL_PAR_SET_READ_ADDRESS, "IOCTL_PAR_SET_READ_ADDRESS"}, - // {IOCTL_PAR_GET_DEVICE_CAPS, "IOCTL_PAR_GET_DEVICE_CAPS"}, - // {IOCTL_PAR_GET_DEFAULT_MODES, "IOCTL_PAR_GET_DEFAULT_MODES"}, - // {IOCTL_PAR_QUERY_RAW_DEVICE_ID, "IOCTL_PAR_QUERY_RAW_DEVICE_ID"}, - // {IOCTL_PAR_IS_PORT_FREE, "IOCTL_PAR_IS_PORT_FREE"}, + { IOCTL_USBPRINT_GET_1284_ID, "IOCTL_USBPRINT_GET_1284_ID" }, - {IOCTL_USBPRINT_GET_1284_ID, "IOCTL_USBPRINT_GET_1284_ID"}, + { 0, NULL } + }; - {0, NULL} -}; + /** + * FIXME: got a proper function name and place + */ + WINPR_API const char* _comm_serial_ioctl_name(ULONG number); -/** - * FIXME: got a proper function name and place - */ -WINPR_API const char* _comm_serial_ioctl_name(ULONG number); + /** + * FIXME: got a proper function name and place + */ + WINPR_API void _comm_setServerSerialDriver(HANDLE hComm, SERIAL_DRIVER_ID); -/** - * FIXME: got a proper function name and place - */ -WINPR_API void _comm_setServerSerialDriver(HANDLE hComm, SERIAL_DRIVER_ID); + /** + * FIXME: got a proper function name and place + * + * permissive mode is disabled by default. + */ + WINPR_API BOOL _comm_set_permissive(HANDLE hDevice, BOOL permissive); -/** - * FIXME: got a proper function name and place - * - * permissive mode is disabled by default. - */ -WINPR_API BOOL _comm_set_permissive(HANDLE hDevice, BOOL permissive); + /** + * FIXME: to be moved in comm_ioctl.h + */ + WINPR_API BOOL CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, + DWORD nInBufferSize, LPVOID lpOutBuffer, + DWORD nOutBufferSize, LPDWORD lpBytesReturned, + LPOVERLAPPED lpOverlapped); + /** + * FIXME: to be moved in comm_io.h + */ + WINPR_API BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, + LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped); -/** - * FIXME: to be moved in comm_ioctl.h - */ -WINPR_API BOOL CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, - LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped); - -/** - * FIXME: to be moved in comm_io.h - */ -WINPR_API BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, - LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped); - -/** - * FIXME: to be moved in comm_io.h - */ -WINPR_API BOOL CommWriteFile(HANDLE hDevice, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, - LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped); + /** + * FIXME: to be moved in comm_io.h + */ + WINPR_API BOOL CommWriteFile(HANDLE hDevice, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, + LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped); #ifdef __cplusplus } @@ -563,4 +563,3 @@ WINPR_API BOOL CommWriteFile(HANDLE hDevice, LPCVOID lpBuffer, DWORD nNumberOfBy #endif /* __linux__ */ #endif /* WINPR_COMM_H */ - diff --git a/winpr/include/winpr/credentials.h b/winpr/include/winpr/credentials.h index f3764cd0f..ff020618c 100644 --- a/winpr/include/winpr/credentials.h +++ b/winpr/include/winpr/credentials.h @@ -25,40 +25,40 @@ #ifndef _WIN32 -#define CRED_SESSION_WILDCARD_NAME_W L"*Session" -#define CRED_SESSION_WILDCARD_NAME_A "*Session" -#define CRED_SESSION_WILDCARD_NAME_LENGTH (sizeof(CRED_SESSION_WILDCARD_NAME_A) - 1) +#define CRED_SESSION_WILDCARD_NAME_W L"*Session" +#define CRED_SESSION_WILDCARD_NAME_A "*Session" +#define CRED_SESSION_WILDCARD_NAME_LENGTH (sizeof(CRED_SESSION_WILDCARD_NAME_A) - 1) -#define CRED_MAX_STRING_LENGTH 256 -#define CRED_MAX_USERNAME_LENGTH (256 + 1 + 256) -#define CRED_MAX_GENERIC_TARGET_NAME_LENGTH 32767 -#define CRED_MAX_DOMAIN_TARGET_NAME_LENGTH (256 + 1 + 80) -#define CRED_MAX_VALUE_SIZE 256 -#define CRED_MAX_ATTRIBUTES 64 +#define CRED_MAX_STRING_LENGTH 256 +#define CRED_MAX_USERNAME_LENGTH (256 + 1 + 256) +#define CRED_MAX_GENERIC_TARGET_NAME_LENGTH 32767 +#define CRED_MAX_DOMAIN_TARGET_NAME_LENGTH (256 + 1 + 80) +#define CRED_MAX_VALUE_SIZE 256 +#define CRED_MAX_ATTRIBUTES 64 -#define CRED_FLAGS_PASSWORD_FOR_CERT 0x0001 -#define CRED_FLAGS_PROMPT_NOW 0x0002 -#define CRED_FLAGS_USERNAME_TARGET 0x0004 -#define CRED_FLAGS_OWF_CRED_BLOB 0x0008 -#define CRED_FLAGS_VALID_FLAGS 0x000F +#define CRED_FLAGS_PASSWORD_FOR_CERT 0x0001 +#define CRED_FLAGS_PROMPT_NOW 0x0002 +#define CRED_FLAGS_USERNAME_TARGET 0x0004 +#define CRED_FLAGS_OWF_CRED_BLOB 0x0008 +#define CRED_FLAGS_VALID_FLAGS 0x000F -#define CRED_TYPE_GENERIC 1 -#define CRED_TYPE_DOMAIN_PASSWORD 2 -#define CRED_TYPE_DOMAIN_CERTIFICATE 3 -#define CRED_TYPE_DOMAIN_VISIBLE_PASSWORD 4 -#define CRED_TYPE_MAXIMUM 5 -#define CRED_TYPE_MAXIMUM_EX (CRED_TYPE_MAXIMUM + 1000) +#define CRED_TYPE_GENERIC 1 +#define CRED_TYPE_DOMAIN_PASSWORD 2 +#define CRED_TYPE_DOMAIN_CERTIFICATE 3 +#define CRED_TYPE_DOMAIN_VISIBLE_PASSWORD 4 +#define CRED_TYPE_MAXIMUM 5 +#define CRED_TYPE_MAXIMUM_EX (CRED_TYPE_MAXIMUM + 1000) -#define CRED_MAX_CREDENTIAL_BLOB_SIZE 512 +#define CRED_MAX_CREDENTIAL_BLOB_SIZE 512 -#define CRED_PERSIST_NONE 0 -#define CRED_PERSIST_SESSION 1 -#define CRED_PERSIST_LOCAL_MACHINE 2 -#define CRED_PERSIST_ENTERPRISE 3 +#define CRED_PERSIST_NONE 0 +#define CRED_PERSIST_SESSION 1 +#define CRED_PERSIST_LOCAL_MACHINE 2 +#define CRED_PERSIST_ENTERPRISE 3 -#define CRED_PRESERVE_CREDENTIAL_BLOB 0x1 -#define CRED_CACHE_TARGET_INFORMATION 0x1 -#define CRED_ALLOW_NAME_RESOLUTION 0x1 +#define CRED_PRESERVE_CREDENTIAL_BLOB 0x1 +#define CRED_CACHE_TARGET_INFORMATION 0x1 +#define CRED_ALLOW_NAME_RESOLUTION 0x1 typedef struct _CREDENTIAL_ATTRIBUTEA { @@ -140,129 +140,150 @@ typedef enum _CRED_MARSHAL_TYPE { CertCredential = 1, UsernameTargetCredential -} CRED_MARSHAL_TYPE, *PCRED_MARSHAL_TYPE; +} CRED_MARSHAL_TYPE, + *PCRED_MARSHAL_TYPE; typedef enum _CRED_PROTECTION_TYPE { CredUnprotected = 0, CredUserProtection = 1, CredTrustedProtection = 2 -} CRED_PROTECTION_TYPE, *PCRED_PROTECTION_TYPE; +} CRED_PROTECTION_TYPE, + *PCRED_PROTECTION_TYPE; #ifdef UNICODE -#define CRED_SESSION_WILDCARD_NAME CRED_SESSION_WILDCARD_NAME_W -#define CREDENTIAL_ATTRIBUTE CREDENTIAL_ATTRIBUTEW -#define PCREDENTIAL_ATTRIBUTE PCREDENTIAL_ATTRIBUTEW -#define CREDENTIAL CREDENTIALW -#define PCREDENTIAL PCREDENTIALW -#define CREDENTIAL_TARGET_INFORMATION CREDENTIAL_TARGET_INFORMATIONW -#define PCREDENTIAL_TARGET_INFORMATION PCREDENTIAL_TARGET_INFORMATIONW +#define CRED_SESSION_WILDCARD_NAME CRED_SESSION_WILDCARD_NAME_W +#define CREDENTIAL_ATTRIBUTE CREDENTIAL_ATTRIBUTEW +#define PCREDENTIAL_ATTRIBUTE PCREDENTIAL_ATTRIBUTEW +#define CREDENTIAL CREDENTIALW +#define PCREDENTIAL PCREDENTIALW +#define CREDENTIAL_TARGET_INFORMATION CREDENTIAL_TARGET_INFORMATIONW +#define PCREDENTIAL_TARGET_INFORMATION PCREDENTIAL_TARGET_INFORMATIONW #else -#define CRED_SESSION_WILDCARD_NAME CRED_SESSION_WILDCARD_NAME_A -#define CREDENTIAL_ATTRIBUTE CREDENTIAL_ATTRIBUTEA -#define PCREDENTIAL_ATTRIBUTE PCREDENTIAL_ATTRIBUTEA -#define CREDENTIAL CREDENTIALA -#define PCREDENTIAL PCREDENTIALA -#define CREDENTIAL_TARGET_INFORMATION CREDENTIAL_TARGET_INFORMATIONA -#define PCREDENTIAL_TARGET_INFORMATION PCREDENTIAL_TARGET_INFORMATIONA +#define CRED_SESSION_WILDCARD_NAME CRED_SESSION_WILDCARD_NAME_A +#define CREDENTIAL_ATTRIBUTE CREDENTIAL_ATTRIBUTEA +#define PCREDENTIAL_ATTRIBUTE PCREDENTIAL_ATTRIBUTEA +#define CREDENTIAL CREDENTIALA +#define PCREDENTIAL PCREDENTIALA +#define CREDENTIAL_TARGET_INFORMATION CREDENTIAL_TARGET_INFORMATIONA +#define PCREDENTIAL_TARGET_INFORMATION PCREDENTIAL_TARGET_INFORMATIONA #endif #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API BOOL CredWriteW(PCREDENTIALW Credential, DWORD Flags); -WINPR_API BOOL CredWriteA(PCREDENTIALA Credential, DWORD Flags); + WINPR_API BOOL CredWriteW(PCREDENTIALW Credential, DWORD Flags); + WINPR_API BOOL CredWriteA(PCREDENTIALA Credential, DWORD Flags); -WINPR_API BOOL CredReadW(LPCWSTR TargetName, DWORD Type, DWORD Flags, PCREDENTIALW* Credential); -WINPR_API BOOL CredReadA(LPCSTR TargetName, DWORD Type, DWORD Flags, PCREDENTIALA* Credential); + WINPR_API BOOL CredReadW(LPCWSTR TargetName, DWORD Type, DWORD Flags, PCREDENTIALW* Credential); + WINPR_API BOOL CredReadA(LPCSTR TargetName, DWORD Type, DWORD Flags, PCREDENTIALA* Credential); -WINPR_API BOOL CredEnumerateW(LPCWSTR Filter, DWORD Flags, DWORD* Count, PCREDENTIALW** Credential); -WINPR_API BOOL CredEnumerateA(LPCSTR Filter, DWORD Flags, DWORD* Count, PCREDENTIALA** Credential); + WINPR_API BOOL CredEnumerateW(LPCWSTR Filter, DWORD Flags, DWORD* Count, + PCREDENTIALW** Credential); + WINPR_API BOOL CredEnumerateA(LPCSTR Filter, DWORD Flags, DWORD* Count, + PCREDENTIALA** Credential); -WINPR_API BOOL CredWriteDomainCredentialsW(PCREDENTIAL_TARGET_INFORMATIONW TargetInfo, PCREDENTIALW Credential, DWORD Flags); -WINPR_API BOOL CredWriteDomainCredentialsA(PCREDENTIAL_TARGET_INFORMATIONA TargetInfo, PCREDENTIALA Credential, DWORD Flags); + WINPR_API BOOL CredWriteDomainCredentialsW(PCREDENTIAL_TARGET_INFORMATIONW TargetInfo, + PCREDENTIALW Credential, DWORD Flags); + WINPR_API BOOL CredWriteDomainCredentialsA(PCREDENTIAL_TARGET_INFORMATIONA TargetInfo, + PCREDENTIALA Credential, DWORD Flags); -WINPR_API BOOL CredReadDomainCredentialsW(PCREDENTIAL_TARGET_INFORMATIONW TargetInfo, DWORD Flags, DWORD* Count, PCREDENTIALW** Credential); -WINPR_API BOOL CredReadDomainCredentialsA(PCREDENTIAL_TARGET_INFORMATIONA TargetInfo, DWORD Flags, DWORD* Count, PCREDENTIALA** Credential); + WINPR_API BOOL CredReadDomainCredentialsW(PCREDENTIAL_TARGET_INFORMATIONW TargetInfo, + DWORD Flags, DWORD* Count, PCREDENTIALW** Credential); + WINPR_API BOOL CredReadDomainCredentialsA(PCREDENTIAL_TARGET_INFORMATIONA TargetInfo, + DWORD Flags, DWORD* Count, PCREDENTIALA** Credential); -WINPR_API BOOL CredDeleteW(LPCWSTR TargetName, DWORD Type, DWORD Flags); -WINPR_API BOOL CredDeleteA(LPCSTR TargetName, DWORD Type, DWORD Flags); + WINPR_API BOOL CredDeleteW(LPCWSTR TargetName, DWORD Type, DWORD Flags); + WINPR_API BOOL CredDeleteA(LPCSTR TargetName, DWORD Type, DWORD Flags); -WINPR_API BOOL CredRenameW(LPCWSTR OldTargetName, LPCWSTR NewTargetName, DWORD Type, DWORD Flags); -WINPR_API BOOL CredRenameA(LPCSTR OldTargetName, LPCSTR NewTargetName, DWORD Type, DWORD Flags); + WINPR_API BOOL CredRenameW(LPCWSTR OldTargetName, LPCWSTR NewTargetName, DWORD Type, + DWORD Flags); + WINPR_API BOOL CredRenameA(LPCSTR OldTargetName, LPCSTR NewTargetName, DWORD Type, DWORD Flags); -WINPR_API BOOL CredGetTargetInfoW(LPCWSTR TargetName, DWORD Flags, PCREDENTIAL_TARGET_INFORMATIONW* TargetInfo); -WINPR_API BOOL CredGetTargetInfoA(LPCSTR TargetName, DWORD Flags, PCREDENTIAL_TARGET_INFORMATIONA* TargetInfo); + WINPR_API BOOL CredGetTargetInfoW(LPCWSTR TargetName, DWORD Flags, + PCREDENTIAL_TARGET_INFORMATIONW* TargetInfo); + WINPR_API BOOL CredGetTargetInfoA(LPCSTR TargetName, DWORD Flags, + PCREDENTIAL_TARGET_INFORMATIONA* TargetInfo); -WINPR_API BOOL CredMarshalCredentialW(CRED_MARSHAL_TYPE CredType, PVOID Credential, LPWSTR* MarshaledCredential); -WINPR_API BOOL CredMarshalCredentialA(CRED_MARSHAL_TYPE CredType, PVOID Credential, LPSTR* MarshaledCredential); + WINPR_API BOOL CredMarshalCredentialW(CRED_MARSHAL_TYPE CredType, PVOID Credential, + LPWSTR* MarshaledCredential); + WINPR_API BOOL CredMarshalCredentialA(CRED_MARSHAL_TYPE CredType, PVOID Credential, + LPSTR* MarshaledCredential); -WINPR_API BOOL CredUnmarshalCredentialW(LPCWSTR MarshaledCredential, PCRED_MARSHAL_TYPE CredType, PVOID* Credential); -WINPR_API BOOL CredUnmarshalCredentialA(LPCSTR MarshaledCredential, PCRED_MARSHAL_TYPE CredType, PVOID* Credential); + WINPR_API BOOL CredUnmarshalCredentialW(LPCWSTR MarshaledCredential, + PCRED_MARSHAL_TYPE CredType, PVOID* Credential); + WINPR_API BOOL CredUnmarshalCredentialA(LPCSTR MarshaledCredential, PCRED_MARSHAL_TYPE CredType, + PVOID* Credential); -WINPR_API BOOL CredIsMarshaledCredentialW(LPCWSTR MarshaledCredential); -WINPR_API BOOL CredIsMarshaledCredentialA(LPCSTR MarshaledCredential); + WINPR_API BOOL CredIsMarshaledCredentialW(LPCWSTR MarshaledCredential); + WINPR_API BOOL CredIsMarshaledCredentialA(LPCSTR MarshaledCredential); -WINPR_API BOOL CredProtectW(BOOL fAsSelf, LPWSTR pszCredentials, DWORD cchCredentials, - LPWSTR pszProtectedCredentials, DWORD* pcchMaxChars, CRED_PROTECTION_TYPE* ProtectionType); -WINPR_API BOOL CredProtectA(BOOL fAsSelf, LPSTR pszCredentials, DWORD cchCredentials, - LPSTR pszProtectedCredentials, DWORD* pcchMaxChars, CRED_PROTECTION_TYPE* ProtectionType); + WINPR_API BOOL CredProtectW(BOOL fAsSelf, LPWSTR pszCredentials, DWORD cchCredentials, + LPWSTR pszProtectedCredentials, DWORD* pcchMaxChars, + CRED_PROTECTION_TYPE* ProtectionType); + WINPR_API BOOL CredProtectA(BOOL fAsSelf, LPSTR pszCredentials, DWORD cchCredentials, + LPSTR pszProtectedCredentials, DWORD* pcchMaxChars, + CRED_PROTECTION_TYPE* ProtectionType); -WINPR_API BOOL CredUnprotectW(BOOL fAsSelf, LPWSTR pszProtectedCredentials, - DWORD cchCredentials, LPWSTR pszCredentials, DWORD* pcchMaxChars); -WINPR_API BOOL CredUnprotectA(BOOL fAsSelf, LPSTR pszProtectedCredentials, - DWORD cchCredentials, LPSTR pszCredentials, DWORD* pcchMaxChars); + WINPR_API BOOL CredUnprotectW(BOOL fAsSelf, LPWSTR pszProtectedCredentials, + DWORD cchCredentials, LPWSTR pszCredentials, DWORD* pcchMaxChars); + WINPR_API BOOL CredUnprotectA(BOOL fAsSelf, LPSTR pszProtectedCredentials, DWORD cchCredentials, + LPSTR pszCredentials, DWORD* pcchMaxChars); -WINPR_API BOOL CredIsProtectedW(LPWSTR pszProtectedCredentials, CRED_PROTECTION_TYPE* pProtectionType); -WINPR_API BOOL CredIsProtectedA(LPSTR pszProtectedCredentials, CRED_PROTECTION_TYPE* pProtectionType); + WINPR_API BOOL CredIsProtectedW(LPWSTR pszProtectedCredentials, + CRED_PROTECTION_TYPE* pProtectionType); + WINPR_API BOOL CredIsProtectedA(LPSTR pszProtectedCredentials, + CRED_PROTECTION_TYPE* pProtectionType); -WINPR_API BOOL CredFindBestCredentialW(LPCWSTR TargetName, DWORD Type, DWORD Flags, PCREDENTIALW* Credential); -WINPR_API BOOL CredFindBestCredentialA(LPCSTR TargetName, DWORD Type, DWORD Flags, PCREDENTIALA* Credential); + WINPR_API BOOL CredFindBestCredentialW(LPCWSTR TargetName, DWORD Type, DWORD Flags, + PCREDENTIALW* Credential); + WINPR_API BOOL CredFindBestCredentialA(LPCSTR TargetName, DWORD Type, DWORD Flags, + PCREDENTIALA* Credential); -WINPR_API BOOL CredGetSessionTypes(DWORD MaximumPersistCount, LPDWORD MaximumPersist); + WINPR_API BOOL CredGetSessionTypes(DWORD MaximumPersistCount, LPDWORD MaximumPersist); -WINPR_API VOID CredFree(PVOID Buffer); + WINPR_API VOID CredFree(PVOID Buffer); #ifdef __cplusplus } #endif #ifdef UNICODE -#define CredWrite CredWriteW -#define CredRead CredReadW -#define CredEnumerate CredEnumerateW -#define CredWriteDomainCredentials CredWriteDomainCredentialsW -#define CredReadDomainCredentials CredReadDomainCredentialsW -#define CredDelete CredDeleteW -#define CredRename CredRenameW -#define CredGetTargetInfo CredGetTargetInfoW -#define CredMarshalCredential CredMarshalCredentialW -#define CredUnmarshalCredential CredUnmarshalCredentialW -#define CredIsMarshaledCredential CredIsMarshaledCredentialW -#define CredProtect CredProtectW -#define CredUnprotect CredUnprotectW -#define CredIsProtected CredIsProtectedW -#define CredFindBestCredential CredFindBestCredentialW +#define CredWrite CredWriteW +#define CredRead CredReadW +#define CredEnumerate CredEnumerateW +#define CredWriteDomainCredentials CredWriteDomainCredentialsW +#define CredReadDomainCredentials CredReadDomainCredentialsW +#define CredDelete CredDeleteW +#define CredRename CredRenameW +#define CredGetTargetInfo CredGetTargetInfoW +#define CredMarshalCredential CredMarshalCredentialW +#define CredUnmarshalCredential CredUnmarshalCredentialW +#define CredIsMarshaledCredential CredIsMarshaledCredentialW +#define CredProtect CredProtectW +#define CredUnprotect CredUnprotectW +#define CredIsProtected CredIsProtectedW +#define CredFindBestCredential CredFindBestCredentialW #else -#define CredWrite CredWriteA -#define CredRead CredReadA -#define CredEnumerate CredEnumerateA -#define CredWriteDomainCredentials CredWriteDomainCredentialsA -#define CredReadDomainCredentials CredReadDomainCredentialsA -#define CredDelete CredDeleteA -#define CredRename CredRenameA -#define CredGetTargetInfo CredGetTargetInfoA -#define CredMarshalCredential CredMarshalCredentialA -#define CredUnmarshalCredential CredUnmarshalCredentialA -#define CredIsMarshaledCredential CredIsMarshaledCredentialA -#define CredProtect CredProtectA -#define CredUnprotect CredUnprotectA -#define CredIsProtected CredIsProtectedA -#define CredFindBestCredential CredFindBestCredentialA +#define CredWrite CredWriteA +#define CredRead CredReadA +#define CredEnumerate CredEnumerateA +#define CredWriteDomainCredentials CredWriteDomainCredentialsA +#define CredReadDomainCredentials CredReadDomainCredentialsA +#define CredDelete CredDeleteA +#define CredRename CredRenameA +#define CredGetTargetInfo CredGetTargetInfoA +#define CredMarshalCredential CredMarshalCredentialA +#define CredUnmarshalCredential CredUnmarshalCredentialA +#define CredIsMarshaledCredential CredIsMarshaledCredentialA +#define CredProtect CredProtectA +#define CredUnprotect CredUnprotectA +#define CredIsProtected CredIsProtectedA +#define CredFindBestCredential CredFindBestCredentialA #endif #endif #endif /* WINPR_CREDENTIALS_H */ - diff --git a/winpr/include/winpr/credui.h b/winpr/include/winpr/credui.h index 5ad1c28d7..8f3c63f38 100644 --- a/winpr/include/winpr/credui.h +++ b/winpr/include/winpr/credui.h @@ -34,39 +34,39 @@ #else -#define CREDUI_MAX_MESSAGE_LENGTH 32767 -#define CREDUI_MAX_CAPTION_LENGTH 128 -#define CREDUI_MAX_GENERIC_TARGET_LENGTH CRED_MAX_GENERIC_TARGET_NAME_LENGTH -#define CREDUI_MAX_DOMAIN_TARGET_LENGTH CRED_MAX_DOMAIN_TARGET_NAME_LENGTH -#define CREDUI_MAX_USERNAME_LENGTH CRED_MAX_USERNAME_LENGTH -#define CREDUI_MAX_PASSWORD_LENGTH (CRED_MAX_CREDENTIAL_BLOB_SIZE / 2) +#define CREDUI_MAX_MESSAGE_LENGTH 32767 +#define CREDUI_MAX_CAPTION_LENGTH 128 +#define CREDUI_MAX_GENERIC_TARGET_LENGTH CRED_MAX_GENERIC_TARGET_NAME_LENGTH +#define CREDUI_MAX_DOMAIN_TARGET_LENGTH CRED_MAX_DOMAIN_TARGET_NAME_LENGTH +#define CREDUI_MAX_USERNAME_LENGTH CRED_MAX_USERNAME_LENGTH +#define CREDUI_MAX_PASSWORD_LENGTH (CRED_MAX_CREDENTIAL_BLOB_SIZE / 2) -#define CREDUI_FLAGS_INCORRECT_PASSWORD 0x00000001 -#define CREDUI_FLAGS_DO_NOT_PERSIST 0x00000002 -#define CREDUI_FLAGS_REQUEST_ADMINISTRATOR 0x00000004 -#define CREDUI_FLAGS_EXCLUDE_CERTIFICATES 0x00000008 -#define CREDUI_FLAGS_REQUIRE_CERTIFICATE 0x00000010 -#define CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX 0x00000040 -#define CREDUI_FLAGS_ALWAYS_SHOW_UI 0x00000080 -#define CREDUI_FLAGS_REQUIRE_SMARTCARD 0x00000100 -#define CREDUI_FLAGS_PASSWORD_ONLY_OK 0x00000200 -#define CREDUI_FLAGS_VALIDATE_USERNAME 0x00000400 -#define CREDUI_FLAGS_COMPLETE_USERNAME 0x00000800 -#define CREDUI_FLAGS_PERSIST 0x00001000 -#define CREDUI_FLAGS_SERVER_CREDENTIAL 0x00004000 -#define CREDUI_FLAGS_EXPECT_CONFIRMATION 0x00020000 -#define CREDUI_FLAGS_GENERIC_CREDENTIALS 0x00040000 -#define CREDUI_FLAGS_USERNAME_TARGET_CREDENTIALS 0x00080000 -#define CREDUI_FLAGS_KEEP_USERNAME 0x00100000 +#define CREDUI_FLAGS_INCORRECT_PASSWORD 0x00000001 +#define CREDUI_FLAGS_DO_NOT_PERSIST 0x00000002 +#define CREDUI_FLAGS_REQUEST_ADMINISTRATOR 0x00000004 +#define CREDUI_FLAGS_EXCLUDE_CERTIFICATES 0x00000008 +#define CREDUI_FLAGS_REQUIRE_CERTIFICATE 0x00000010 +#define CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX 0x00000040 +#define CREDUI_FLAGS_ALWAYS_SHOW_UI 0x00000080 +#define CREDUI_FLAGS_REQUIRE_SMARTCARD 0x00000100 +#define CREDUI_FLAGS_PASSWORD_ONLY_OK 0x00000200 +#define CREDUI_FLAGS_VALIDATE_USERNAME 0x00000400 +#define CREDUI_FLAGS_COMPLETE_USERNAME 0x00000800 +#define CREDUI_FLAGS_PERSIST 0x00001000 +#define CREDUI_FLAGS_SERVER_CREDENTIAL 0x00004000 +#define CREDUI_FLAGS_EXPECT_CONFIRMATION 0x00020000 +#define CREDUI_FLAGS_GENERIC_CREDENTIALS 0x00040000 +#define CREDUI_FLAGS_USERNAME_TARGET_CREDENTIALS 0x00080000 +#define CREDUI_FLAGS_KEEP_USERNAME 0x00100000 -#define CREDUIWIN_GENERIC 0x00000001 -#define CREDUIWIN_CHECKBOX 0x00000002 -#define CREDUIWIN_AUTHPACKAGE_ONLY 0x00000010 -#define CREDUIWIN_IN_CRED_ONLY 0x00000020 -#define CREDUIWIN_ENUMERATE_ADMINS 0x00000100 -#define CREDUIWIN_ENUMERATE_CURRENT_USER 0x00000200 -#define CREDUIWIN_SECURE_PROMPT 0x00001000 -#define CREDUIWIN_PACK_32_WOW 0x10000000 +#define CREDUIWIN_GENERIC 0x00000001 +#define CREDUIWIN_CHECKBOX 0x00000002 +#define CREDUIWIN_AUTHPACKAGE_ONLY 0x00000010 +#define CREDUIWIN_IN_CRED_ONLY 0x00000020 +#define CREDUIWIN_ENUMERATE_ADMINS 0x00000100 +#define CREDUIWIN_ENUMERATE_CURRENT_USER 0x00000200 +#define CREDUIWIN_SECURE_PROMPT 0x00001000 +#define CREDUIWIN_PACK_32_WOW 0x10000000 typedef struct _CREDUI_INFOA { @@ -87,64 +87,76 @@ typedef struct _CREDUI_INFOW } CREDUI_INFOW, *PCREDUI_INFOW; #ifdef UNICODE -#define CREDUI_INFO CREDUI_INFOW -#define PCREDUI_INFO PCREDUI_INFOW +#define CREDUI_INFO CREDUI_INFOW +#define PCREDUI_INFO PCREDUI_INFOW #else -#define CREDUI_INFO CREDUI_INFOA -#define PCREDUI_INFO PCREDUI_INFOA +#define CREDUI_INFO CREDUI_INFOA +#define PCREDUI_INFO PCREDUI_INFOA #endif #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API DWORD CredUIPromptForCredentialsW(PCREDUI_INFOW pUiInfo, PCWSTR pszTargetName, - PCtxtHandle pContext, DWORD dwAuthError, PWSTR pszUserName, ULONG ulUserNameBufferSize, - PWSTR pszPassword, ULONG ulPasswordBufferSize, BOOL* save, DWORD dwFlags); -WINPR_API DWORD CredUIPromptForCredentialsA(PCREDUI_INFOA pUiInfo, PCSTR pszTargetName, - PCtxtHandle pContext, DWORD dwAuthError, PSTR pszUserName, ULONG ulUserNameBufferSize, - PSTR pszPassword, ULONG ulPasswordBufferSize, BOOL* save, DWORD dwFlags); + WINPR_API DWORD CredUIPromptForCredentialsW(PCREDUI_INFOW pUiInfo, PCWSTR pszTargetName, + PCtxtHandle pContext, DWORD dwAuthError, + PWSTR pszUserName, ULONG ulUserNameBufferSize, + PWSTR pszPassword, ULONG ulPasswordBufferSize, + BOOL* save, DWORD dwFlags); + WINPR_API DWORD CredUIPromptForCredentialsA(PCREDUI_INFOA pUiInfo, PCSTR pszTargetName, + PCtxtHandle pContext, DWORD dwAuthError, + PSTR pszUserName, ULONG ulUserNameBufferSize, + PSTR pszPassword, ULONG ulPasswordBufferSize, + BOOL* save, DWORD dwFlags); -WINPR_API DWORD CredUIParseUserNameW(CONST WCHAR* UserName, WCHAR* user, ULONG userBufferSize, WCHAR* domain, ULONG domainBufferSize); -WINPR_API DWORD CredUIParseUserNameA(CONST CHAR* userName, CHAR* user, ULONG userBufferSize, CHAR* domain, ULONG domainBufferSize); + WINPR_API DWORD CredUIParseUserNameW(CONST WCHAR* UserName, WCHAR* user, ULONG userBufferSize, + WCHAR* domain, ULONG domainBufferSize); + WINPR_API DWORD CredUIParseUserNameA(CONST CHAR* userName, CHAR* user, ULONG userBufferSize, + CHAR* domain, ULONG domainBufferSize); -WINPR_API DWORD CredUICmdLinePromptForCredentialsW(PCWSTR pszTargetName, PCtxtHandle pContext, - DWORD dwAuthError, PWSTR UserName, ULONG ulUserBufferSize, PWSTR pszPassword, - ULONG ulPasswordBufferSize, PBOOL pfSave, DWORD dwFlags); -WINPR_API DWORD CredUICmdLinePromptForCredentialsA(PCSTR pszTargetName, PCtxtHandle pContext, - DWORD dwAuthError, PSTR UserName, ULONG ulUserBufferSize, PSTR pszPassword, - ULONG ulPasswordBufferSize, PBOOL pfSave, DWORD dwFlags); + WINPR_API DWORD CredUICmdLinePromptForCredentialsW(PCWSTR pszTargetName, PCtxtHandle pContext, + DWORD dwAuthError, PWSTR UserName, + ULONG ulUserBufferSize, PWSTR pszPassword, + ULONG ulPasswordBufferSize, PBOOL pfSave, + DWORD dwFlags); + WINPR_API DWORD CredUICmdLinePromptForCredentialsA(PCSTR pszTargetName, PCtxtHandle pContext, + DWORD dwAuthError, PSTR UserName, + ULONG ulUserBufferSize, PSTR pszPassword, + ULONG ulPasswordBufferSize, PBOOL pfSave, + DWORD dwFlags); -WINPR_API DWORD CredUIConfirmCredentialsW(PCWSTR pszTargetName, BOOL bConfirm); -WINPR_API DWORD CredUIConfirmCredentialsA(PCSTR pszTargetName, BOOL bConfirm); + WINPR_API DWORD CredUIConfirmCredentialsW(PCWSTR pszTargetName, BOOL bConfirm); + WINPR_API DWORD CredUIConfirmCredentialsA(PCSTR pszTargetName, BOOL bConfirm); -WINPR_API DWORD CredUIStoreSSOCredW(PCWSTR pszRealm, PCWSTR pszUsername, PCWSTR pszPassword, BOOL bPersist); -WINPR_API DWORD CredUIStoreSSOCredA(PCSTR pszRealm, PCSTR pszUsername, PCSTR pszPassword, BOOL bPersist); + WINPR_API DWORD CredUIStoreSSOCredW(PCWSTR pszRealm, PCWSTR pszUsername, PCWSTR pszPassword, + BOOL bPersist); + WINPR_API DWORD CredUIStoreSSOCredA(PCSTR pszRealm, PCSTR pszUsername, PCSTR pszPassword, + BOOL bPersist); -WINPR_API DWORD CredUIReadSSOCredW(PCWSTR pszRealm, PWSTR* ppszUsername); -WINPR_API DWORD CredUIReadSSOCredA(PCSTR pszRealm, PSTR* ppszUsername); + WINPR_API DWORD CredUIReadSSOCredW(PCWSTR pszRealm, PWSTR* ppszUsername); + WINPR_API DWORD CredUIReadSSOCredA(PCSTR pszRealm, PSTR* ppszUsername); #ifdef __cplusplus } #endif #ifdef UNICODE -#define CredUIPromptForCredentials CredUIPromptForCredentialsW -#define CredUIParseUserName CredUIParseUserNameW -#define CredUICmdLinePromptForCredentials CredUICmdLinePromptForCredentialsW -#define CredUIConfirmCredentials CredUIConfirmCredentialsW -#define CredUIStoreSSOCred CredUIStoreSSOCredW -#define CredUIReadSSOCred CredUIReadSSOCredW +#define CredUIPromptForCredentials CredUIPromptForCredentialsW +#define CredUIParseUserName CredUIParseUserNameW +#define CredUICmdLinePromptForCredentials CredUICmdLinePromptForCredentialsW +#define CredUIConfirmCredentials CredUIConfirmCredentialsW +#define CredUIStoreSSOCred CredUIStoreSSOCredW +#define CredUIReadSSOCred CredUIReadSSOCredW #else -#define CredUIPromptForCredentials CredUIPromptForCredentialsA -#define CredUIParseUserName CredUIParseUserNameA -#define CredUICmdLinePromptForCredentials CredUICmdLinePromptForCredentialsA -#define CredUIConfirmCredentials CredUIConfirmCredentialsA -#define CredUIStoreSSOCred CredUIStoreSSOCredA -#define CredUIReadSSOCred CredUIReadSSOCredA +#define CredUIPromptForCredentials CredUIPromptForCredentialsA +#define CredUIParseUserName CredUIParseUserNameA +#define CredUICmdLinePromptForCredentials CredUICmdLinePromptForCredentialsA +#define CredUIConfirmCredentials CredUIConfirmCredentialsA +#define CredUIStoreSSOCred CredUIStoreSSOCredA +#define CredUIReadSSOCred CredUIReadSSOCredA #endif #endif #endif /* WINPR_CREDUI_H */ - diff --git a/winpr/include/winpr/crt.h b/winpr/include/winpr/crt.h index 397f7e48d..181ac14b6 100644 --- a/winpr/include/winpr/crt.h +++ b/winpr/include/winpr/crt.h @@ -70,36 +70,30 @@ static INLINE UINT64 _rotr64(UINT64 value, int shift) #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) -#define _byteswap_ulong(_val) __builtin_bswap32(_val) -#define _byteswap_uint64(_val) __builtin_bswap64(_val) +#define _byteswap_ulong(_val) __builtin_bswap32(_val) +#define _byteswap_uint64(_val) __builtin_bswap64(_val) #else static INLINE UINT32 _byteswap_ulong(UINT32 _val) { - return (((_val) >> 24) | \ - (((_val) & 0x00FF0000) >> 8) | \ - (((_val) & 0x0000FF00) << 8) | \ + return (((_val) >> 24) | (((_val)&0x00FF0000) >> 8) | (((_val)&0x0000FF00) << 8) | ((_val) << 24)); } static INLINE UINT64 _byteswap_uint64(UINT64 _val) { - return (((_val) << 56) | \ - (((_val) << 40) & 0xFF000000000000) | \ - (((_val) << 24) & 0xFF0000000000) | \ - (((_val) << 8) & 0xFF00000000) | \ - (((_val) >> 8) & 0xFF000000) | \ - (((_val) >> 24) & 0xFF0000) | \ - (((_val) >> 40) & 0xFF00) | \ - ((_val) >> 56)); + return (((_val) << 56) | (((_val) << 40) & 0xFF000000000000) | + (((_val) << 24) & 0xFF0000000000) | (((_val) << 8) & 0xFF00000000) | + (((_val) >> 8) & 0xFF000000) | (((_val) >> 24) & 0xFF0000) | (((_val) >> 40) & 0xFF00) | + ((_val) >> 56)); } #endif #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) -#define _byteswap_ushort(_val) __builtin_bswap16(_val) +#define _byteswap_ushort(_val) __builtin_bswap16(_val) #else @@ -110,18 +104,17 @@ static INLINE UINT16 _byteswap_ushort(UINT16 _val) #endif - - -#define CopyMemory(Destination, Source, Length) memcpy((Destination), (Source), (Length)) -#define MoveMemory(Destination, Source, Length) memmove((Destination), (Source), (Length)) -#define FillMemory(Destination, Length, Fill) memset((Destination), (Fill), (Length)) -#define ZeroMemory(Destination, Length) memset((Destination), 0, (Length)) +#define CopyMemory(Destination, Source, Length) memcpy((Destination), (Source), (Length)) +#define MoveMemory(Destination, Source, Length) memmove((Destination), (Source), (Length)) +#define FillMemory(Destination, Length, Fill) memset((Destination), (Fill), (Length)) +#define ZeroMemory(Destination, Length) memset((Destination), 0, (Length)) #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API PVOID SecureZeroMemory(PVOID ptr, SIZE_T cnt); + WINPR_API PVOID SecureZeroMemory(PVOID ptr, SIZE_T cnt); #ifdef __cplusplus } @@ -135,37 +128,38 @@ typedef int errno_t; #endif #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API void* _aligned_malloc(size_t size, size_t alignment); -WINPR_API void* _aligned_realloc(void* memblock, size_t size, size_t alignment); -WINPR_API void* _aligned_recalloc(void* memblock, size_t num, size_t size, size_t alignment); + WINPR_API void* _aligned_malloc(size_t size, size_t alignment); + WINPR_API void* _aligned_realloc(void* memblock, size_t size, size_t alignment); + WINPR_API void* _aligned_recalloc(void* memblock, size_t num, size_t size, size_t alignment); -WINPR_API void* _aligned_offset_malloc(size_t size, size_t alignment, size_t offset); -WINPR_API void* _aligned_offset_realloc(void* memblock, size_t size, size_t alignment, - size_t offset); -WINPR_API void* _aligned_offset_recalloc(void* memblock, size_t num, size_t size, size_t alignment, - size_t offset); + WINPR_API void* _aligned_offset_malloc(size_t size, size_t alignment, size_t offset); + WINPR_API void* _aligned_offset_realloc(void* memblock, size_t size, size_t alignment, + size_t offset); + WINPR_API void* _aligned_offset_recalloc(void* memblock, size_t num, size_t size, + size_t alignment, size_t offset); -WINPR_API size_t _aligned_msize(void* memblock, size_t alignment, size_t offset); + WINPR_API size_t _aligned_msize(void* memblock, size_t alignment, size_t offset); -WINPR_API void _aligned_free(void* memblock); + WINPR_API void _aligned_free(void* memblock); -/* Data Conversion */ + /* Data Conversion */ -WINPR_API errno_t _itoa_s(int value, char* buffer, size_t sizeInCharacters, int radix); + WINPR_API errno_t _itoa_s(int value, char* buffer, size_t sizeInCharacters, int radix); -/* Buffer Manipulation */ + /* Buffer Manipulation */ -WINPR_API errno_t memmove_s(void* dest, size_t numberOfElements, const void* src, size_t count); -WINPR_API errno_t wmemmove_s(WCHAR* dest, size_t numberOfElements, const WCHAR* src, size_t count); + WINPR_API errno_t memmove_s(void* dest, size_t numberOfElements, const void* src, size_t count); + WINPR_API errno_t wmemmove_s(WCHAR* dest, size_t numberOfElements, const WCHAR* src, + size_t count); #ifdef __cplusplus } #endif - #endif #endif /* WINPR_CRT_H */ diff --git a/winpr/include/winpr/crypto.h b/winpr/include/winpr/crypto.h index b67496086..b9d85716f 100644 --- a/winpr/include/winpr/crypto.h +++ b/winpr/include/winpr/crypto.h @@ -32,16 +32,16 @@ #endif #ifndef ALG_TYPE_RESERVED7 -#define ALG_TYPE_RESERVED7 (7 << 9) +#define ALG_TYPE_RESERVED7 (7 << 9) #endif #if (NTDDI_VERSION <= 0x05010200) -#define ALG_SID_SHA_256 12 -#define ALG_SID_SHA_384 13 -#define ALG_SID_SHA_512 14 -#define CALG_SHA_256 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_256) -#define CALG_SHA_384 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_384) -#define CALG_SHA_512 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_512) +#define ALG_SID_SHA_256 12 +#define ALG_SID_SHA_384 13 +#define ALG_SID_SHA_512 14 +#define CALG_SHA_256 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_256) +#define CALG_SHA_384 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_384) +#define CALG_SHA_512 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_512) #endif #ifndef _WIN32 @@ -56,172 +56,167 @@ typedef ULONG_PTR NCRYPT_SECRET_HANDLE; /* wincrypt.h */ -#define GET_ALG_CLASS(x) (x & (7 << 13)) -#define GET_ALG_TYPE(x) (x & (15 << 9)) -#define GET_ALG_SID(x) (x & (511)) +#define GET_ALG_CLASS(x) (x & (7 << 13)) +#define GET_ALG_TYPE(x) (x & (15 << 9)) +#define GET_ALG_SID(x) (x & (511)) -#define ALG_CLASS_ANY (0) -#define ALG_CLASS_SIGNATURE (1 << 13) -#define ALG_CLASS_MSG_ENCRYPT (2 << 13) -#define ALG_CLASS_DATA_ENCRYPT (3 << 13) -#define ALG_CLASS_HASH (4 << 13) -#define ALG_CLASS_KEY_EXCHANGE (5 << 13) -#define ALG_CLASS_ALL (7 << 13) +#define ALG_CLASS_ANY (0) +#define ALG_CLASS_SIGNATURE (1 << 13) +#define ALG_CLASS_MSG_ENCRYPT (2 << 13) +#define ALG_CLASS_DATA_ENCRYPT (3 << 13) +#define ALG_CLASS_HASH (4 << 13) +#define ALG_CLASS_KEY_EXCHANGE (5 << 13) +#define ALG_CLASS_ALL (7 << 13) -#define ALG_TYPE_ANY (0) -#define ALG_TYPE_DSS (1 << 9) -#define ALG_TYPE_RSA (2 << 9) -#define ALG_TYPE_BLOCK (3 << 9) -#define ALG_TYPE_STREAM (4 << 9) -#define ALG_TYPE_DH (5 << 9) -#define ALG_TYPE_SECURECHANNEL (6 << 9) +#define ALG_TYPE_ANY (0) +#define ALG_TYPE_DSS (1 << 9) +#define ALG_TYPE_RSA (2 << 9) +#define ALG_TYPE_BLOCK (3 << 9) +#define ALG_TYPE_STREAM (4 << 9) +#define ALG_TYPE_DH (5 << 9) +#define ALG_TYPE_SECURECHANNEL (6 << 9) -#define ALG_SID_ANY (0) +#define ALG_SID_ANY (0) -#define ALG_SID_RSA_ANY 0 -#define ALG_SID_RSA_PKCS 1 -#define ALG_SID_RSA_MSATWORK 2 -#define ALG_SID_RSA_ENTRUST 3 -#define ALG_SID_RSA_PGP 4 +#define ALG_SID_RSA_ANY 0 +#define ALG_SID_RSA_PKCS 1 +#define ALG_SID_RSA_MSATWORK 2 +#define ALG_SID_RSA_ENTRUST 3 +#define ALG_SID_RSA_PGP 4 -#define ALG_SID_DSS_ANY 0 -#define ALG_SID_DSS_PKCS 1 -#define ALG_SID_DSS_DMS 2 +#define ALG_SID_DSS_ANY 0 +#define ALG_SID_DSS_PKCS 1 +#define ALG_SID_DSS_DMS 2 -#define ALG_SID_DES 1 -#define ALG_SID_3DES 3 -#define ALG_SID_DESX 4 -#define ALG_SID_IDEA 5 -#define ALG_SID_CAST 6 -#define ALG_SID_SAFERSK64 7 -#define ALG_SID_SAFERSK128 8 -#define ALG_SID_3DES_112 9 -#define ALG_SID_CYLINK_MEK 12 -#define ALG_SID_RC5 13 +#define ALG_SID_DES 1 +#define ALG_SID_3DES 3 +#define ALG_SID_DESX 4 +#define ALG_SID_IDEA 5 +#define ALG_SID_CAST 6 +#define ALG_SID_SAFERSK64 7 +#define ALG_SID_SAFERSK128 8 +#define ALG_SID_3DES_112 9 +#define ALG_SID_CYLINK_MEK 12 +#define ALG_SID_RC5 13 -#define ALG_SID_AES_128 14 -#define ALG_SID_AES_192 15 -#define ALG_SID_AES_256 16 -#define ALG_SID_AES 17 +#define ALG_SID_AES_128 14 +#define ALG_SID_AES_192 15 +#define ALG_SID_AES_256 16 +#define ALG_SID_AES 17 -#define ALG_SID_SKIPJACK 10 -#define ALG_SID_TEK 11 +#define ALG_SID_SKIPJACK 10 +#define ALG_SID_TEK 11 -#define CRYPT_MODE_CBCI 6 -#define CRYPT_MODE_CFBP 7 -#define CRYPT_MODE_OFBP 8 -#define CRYPT_MODE_CBCOFM 9 -#define CRYPT_MODE_CBCOFMI 10 +#define CRYPT_MODE_CBCI 6 +#define CRYPT_MODE_CFBP 7 +#define CRYPT_MODE_OFBP 8 +#define CRYPT_MODE_CBCOFM 9 +#define CRYPT_MODE_CBCOFMI 10 -#define ALG_SID_RC2 2 +#define ALG_SID_RC2 2 -#define ALG_SID_RC4 1 -#define ALG_SID_SEAL 2 +#define ALG_SID_RC4 1 +#define ALG_SID_SEAL 2 -#define ALG_SID_DH_SANDF 1 -#define ALG_SID_DH_EPHEM 2 -#define ALG_SID_AGREED_KEY_ANY 3 -#define ALG_SID_KEA 4 +#define ALG_SID_DH_SANDF 1 +#define ALG_SID_DH_EPHEM 2 +#define ALG_SID_AGREED_KEY_ANY 3 +#define ALG_SID_KEA 4 -#define ALG_SID_ECDH 5 +#define ALG_SID_ECDH 5 -#define ALG_SID_MD2 1 -#define ALG_SID_MD4 2 -#define ALG_SID_MD5 3 -#define ALG_SID_SHA 4 -#define ALG_SID_SHA1 4 -#define ALG_SID_MAC 5 -#define ALG_SID_RIPEMD 6 -#define ALG_SID_RIPEMD160 7 -#define ALG_SID_SSL3SHAMD5 8 -#define ALG_SID_HMAC 9 -#define ALG_SID_TLS1PRF 10 +#define ALG_SID_MD2 1 +#define ALG_SID_MD4 2 +#define ALG_SID_MD5 3 +#define ALG_SID_SHA 4 +#define ALG_SID_SHA1 4 +#define ALG_SID_MAC 5 +#define ALG_SID_RIPEMD 6 +#define ALG_SID_RIPEMD160 7 +#define ALG_SID_SSL3SHAMD5 8 +#define ALG_SID_HMAC 9 +#define ALG_SID_TLS1PRF 10 -#define ALG_SID_HASH_REPLACE_OWF 11 +#define ALG_SID_HASH_REPLACE_OWF 11 -#define ALG_SID_SHA_256 12 -#define ALG_SID_SHA_384 13 -#define ALG_SID_SHA_512 14 +#define ALG_SID_SHA_256 12 +#define ALG_SID_SHA_384 13 +#define ALG_SID_SHA_512 14 -#define ALG_SID_SSL3_MASTER 1 -#define ALG_SID_SCHANNEL_MASTER_HASH 2 -#define ALG_SID_SCHANNEL_MAC_KEY 3 -#define ALG_SID_PCT1_MASTER 4 -#define ALG_SID_SSL2_MASTER 5 -#define ALG_SID_TLS1_MASTER 6 -#define ALG_SID_SCHANNEL_ENC_KEY 7 +#define ALG_SID_SSL3_MASTER 1 +#define ALG_SID_SCHANNEL_MASTER_HASH 2 +#define ALG_SID_SCHANNEL_MAC_KEY 3 +#define ALG_SID_PCT1_MASTER 4 +#define ALG_SID_SSL2_MASTER 5 +#define ALG_SID_TLS1_MASTER 6 +#define ALG_SID_SCHANNEL_ENC_KEY 7 -#define ALG_SID_ECMQV 1 +#define ALG_SID_ECMQV 1 -#define CALG_MD2 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD2) -#define CALG_MD4 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4) -#define CALG_MD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5) -#define CALG_SHA (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA) -#define CALG_SHA1 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA1) -#define CALG_MAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC) -#define CALG_RSA_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY) -#define CALG_DSS_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY) +#define CALG_MD2 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD2) +#define CALG_MD4 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4) +#define CALG_MD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5) +#define CALG_SHA (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA) +#define CALG_SHA1 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA1) +#define CALG_MAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC) +#define CALG_RSA_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY) +#define CALG_DSS_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY) -#define CALG_NO_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_ANY | ALG_SID_ANY) +#define CALG_NO_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_ANY | ALG_SID_ANY) -#define CALG_RSA_KEYX (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RSA | ALG_SID_RSA_ANY) -#define CALG_DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_DES) -#define CALG_3DES_112 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES_112) -#define CALG_3DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES) -#define CALG_DESX (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_DESX) -#define CALG_RC2 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_RC2) -#define CALG_RC4 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_RC4) -#define CALG_SEAL (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_SEAL) -#define CALG_DH_SF (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_SANDF) -#define CALG_DH_EPHEM (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_EPHEM) -#define CALG_AGREEDKEY_ANY (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_AGREED_KEY_ANY) -#define CALG_KEA_KEYX (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_KEA) -#define CALG_HUGHES_MD5 (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_ANY | ALG_SID_MD5) -#define CALG_SKIPJACK (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_SKIPJACK) -#define CALG_TEK (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_TEK) -#define CALG_CYLINK_MEK (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_CYLINK_MEK) -#define CALG_SSL3_SHAMD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SSL3SHAMD5) -#define CALG_SSL3_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SSL3_MASTER) -#define CALG_SCHANNEL_MASTER_HASH (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_MASTER_HASH) -#define CALG_SCHANNEL_MAC_KEY (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_MAC_KEY) -#define CALG_SCHANNEL_ENC_KEY (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_ENC_KEY) -#define CALG_PCT1_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_PCT1_MASTER) -#define CALG_SSL2_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SSL2_MASTER) -#define CALG_TLS1_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_TLS1_MASTER) -#define CALG_RC5 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_RC5) -#define CALG_HMAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HMAC) -#define CALG_TLS1PRF (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_TLS1PRF) +#define CALG_RSA_KEYX (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RSA | ALG_SID_RSA_ANY) +#define CALG_DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_DES) +#define CALG_3DES_112 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES_112) +#define CALG_3DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES) +#define CALG_DESX (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_DESX) +#define CALG_RC2 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_RC2) +#define CALG_RC4 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_RC4) +#define CALG_SEAL (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_SEAL) +#define CALG_DH_SF (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_SANDF) +#define CALG_DH_EPHEM (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_EPHEM) +#define CALG_AGREEDKEY_ANY (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_AGREED_KEY_ANY) +#define CALG_KEA_KEYX (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_KEA) +#define CALG_HUGHES_MD5 (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_ANY | ALG_SID_MD5) +#define CALG_SKIPJACK (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_SKIPJACK) +#define CALG_TEK (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_TEK) +#define CALG_CYLINK_MEK (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_CYLINK_MEK) +#define CALG_SSL3_SHAMD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SSL3SHAMD5) +#define CALG_SSL3_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SSL3_MASTER) +#define CALG_SCHANNEL_MASTER_HASH \ + (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_MASTER_HASH) +#define CALG_SCHANNEL_MAC_KEY \ + (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_MAC_KEY) +#define CALG_SCHANNEL_ENC_KEY \ + (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_ENC_KEY) +#define CALG_PCT1_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_PCT1_MASTER) +#define CALG_SSL2_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SSL2_MASTER) +#define CALG_TLS1_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_TLS1_MASTER) +#define CALG_RC5 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_RC5) +#define CALG_HMAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HMAC) +#define CALG_TLS1PRF (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_TLS1PRF) -#define CALG_HASH_REPLACE_OWF (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HASH_REPLACE_OWF) -#define CALG_AES_128 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_128) -#define CALG_AES_192 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_192) -#define CALG_AES_256 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_256) -#define CALG_AES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES) +#define CALG_HASH_REPLACE_OWF (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HASH_REPLACE_OWF) +#define CALG_AES_128 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_128) +#define CALG_AES_192 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_192) +#define CALG_AES_256 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_256) +#define CALG_AES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES) -#define CALG_SHA_256 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_256) -#define CALG_SHA_384 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_384) -#define CALG_SHA_512 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_512) +#define CALG_SHA_256 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_256) +#define CALG_SHA_384 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_384) +#define CALG_SHA_512 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_512) -#define CALG_ECDH (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_ECDH) -#define CALG_ECMQV (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_ANY | ALG_SID_ECMQV) +#define CALG_ECDH (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_ECDH) +#define CALG_ECMQV (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_ANY | ALG_SID_ECMQV) typedef struct _CRYPTOAPI_BLOB { DWORD cbData; BYTE* pbData; -} CRYPT_INTEGER_BLOB, *PCRYPT_INTEGER_BLOB, -CRYPT_UINT_BLOB, *PCRYPT_UINT_BLOB, -CRYPT_OBJID_BLOB, *PCRYPT_OBJID_BLOB, -CERT_NAME_BLOB, *PCERT_NAME_BLOB, -CERT_RDN_VALUE_BLOB, *PCERT_RDN_VALUE_BLOB, -CERT_BLOB, *PCERT_BLOB, -CRL_BLOB, *PCRL_BLOB, -DATA_BLOB, *PDATA_BLOB, -CRYPT_DATA_BLOB, *PCRYPT_DATA_BLOB, -CRYPT_HASH_BLOB, *PCRYPT_HASH_BLOB, -CRYPT_DIGEST_BLOB, *PCRYPT_DIGEST_BLOB, -CRYPT_DER_BLOB, *PCRYPT_DER_BLOB, -CRYPT_ATTR_BLOB, *PCRYPT_ATTR_BLOB; +} CRYPT_INTEGER_BLOB, *PCRYPT_INTEGER_BLOB, CRYPT_UINT_BLOB, *PCRYPT_UINT_BLOB, CRYPT_OBJID_BLOB, + *PCRYPT_OBJID_BLOB, CERT_NAME_BLOB, *PCERT_NAME_BLOB, CERT_RDN_VALUE_BLOB, + *PCERT_RDN_VALUE_BLOB, CERT_BLOB, *PCERT_BLOB, CRL_BLOB, *PCRL_BLOB, DATA_BLOB, *PDATA_BLOB, + CRYPT_DATA_BLOB, *PCRYPT_DATA_BLOB, CRYPT_HASH_BLOB, *PCRYPT_HASH_BLOB, CRYPT_DIGEST_BLOB, + *PCRYPT_DIGEST_BLOB, CRYPT_DER_BLOB, *PCRYPT_DER_BLOB, CRYPT_ATTR_BLOB, *PCRYPT_ATTR_BLOB; typedef struct _CRYPT_ALGORITHM_IDENTIFIER { @@ -266,7 +261,7 @@ typedef struct _CERT_INFO PCERT_EXTENSION rgExtension; } CERT_INFO, *PCERT_INFO; -typedef void *HCERTSTORE; +typedef void* HCERTSTORE; typedef ULONG_PTR HCRYPTPROV; typedef ULONG_PTR HCRYPTPROV_LEGACY; @@ -278,184 +273,188 @@ typedef struct _CERT_CONTEXT PCERT_INFO pCertInfo; HCERTSTORE hCertStore; } CERT_CONTEXT, *PCERT_CONTEXT; -typedef const CERT_CONTEXT *PCCERT_CONTEXT; +typedef const CERT_CONTEXT* PCCERT_CONTEXT; -#define CERT_ENCODING_TYPE_MASK 0x0000FFFF -#define CMSG_ENCODING_TYPE_MASK 0xFFFF0000 -#define GET_CERT_ENCODING_TYPE(x) (x & CERT_ENCODING_TYPE_MASK) -#define GET_CMSG_ENCODING_TYPE(x) (x & CMSG_ENCODING_TYPE_MASK) +#define CERT_ENCODING_TYPE_MASK 0x0000FFFF +#define CMSG_ENCODING_TYPE_MASK 0xFFFF0000 +#define GET_CERT_ENCODING_TYPE(x) (x & CERT_ENCODING_TYPE_MASK) +#define GET_CMSG_ENCODING_TYPE(x) (x & CMSG_ENCODING_TYPE_MASK) -#define CRYPT_ASN_ENCODING 0x00000001 -#define CRYPT_NDR_ENCODING 0x00000002 -#define X509_ASN_ENCODING 0x00000001 -#define X509_NDR_ENCODING 0x00000002 -#define PKCS_7_ASN_ENCODING 0x00010000 -#define PKCS_7_NDR_ENCODING 0x00020000 +#define CRYPT_ASN_ENCODING 0x00000001 +#define CRYPT_NDR_ENCODING 0x00000002 +#define X509_ASN_ENCODING 0x00000001 +#define X509_NDR_ENCODING 0x00000002 +#define PKCS_7_ASN_ENCODING 0x00010000 +#define PKCS_7_NDR_ENCODING 0x00020000 -#define CERT_COMPARE_MASK 0xFFFF -#define CERT_COMPARE_SHIFT 16 -#define CERT_COMPARE_ANY 0 -#define CERT_COMPARE_SHA1_HASH 1 -#define CERT_COMPARE_NAME 2 -#define CERT_COMPARE_ATTR 3 -#define CERT_COMPARE_MD5_HASH 4 -#define CERT_COMPARE_PROPERTY 5 -#define CERT_COMPARE_PUBLIC_KEY 6 -#define CERT_COMPARE_HASH CERT_COMPARE_SHA1_HASH -#define CERT_COMPARE_NAME_STR_A 7 -#define CERT_COMPARE_NAME_STR_W 8 -#define CERT_COMPARE_KEY_SPEC 9 -#define CERT_COMPARE_ENHKEY_USAGE 10 -#define CERT_COMPARE_CTL_USAGE CERT_COMPARE_ENHKEY_USAGE -#define CERT_COMPARE_SUBJECT_CERT 11 -#define CERT_COMPARE_ISSUER_OF 12 -#define CERT_COMPARE_EXISTING 13 -#define CERT_COMPARE_SIGNATURE_HASH 14 -#define CERT_COMPARE_KEY_IDENTIFIER 15 -#define CERT_COMPARE_CERT_ID 16 -#define CERT_COMPARE_CROSS_CERT_DIST_POINTS 17 -#define CERT_COMPARE_PUBKEY_MD5_HASH 18 -#define CERT_COMPARE_SUBJECT_INFO_ACCESS 19 -#define CERT_COMPARE_HASH_STR 20 -#define CERT_COMPARE_HAS_PRIVATE_KEY 21 +#define CERT_COMPARE_MASK 0xFFFF +#define CERT_COMPARE_SHIFT 16 +#define CERT_COMPARE_ANY 0 +#define CERT_COMPARE_SHA1_HASH 1 +#define CERT_COMPARE_NAME 2 +#define CERT_COMPARE_ATTR 3 +#define CERT_COMPARE_MD5_HASH 4 +#define CERT_COMPARE_PROPERTY 5 +#define CERT_COMPARE_PUBLIC_KEY 6 +#define CERT_COMPARE_HASH CERT_COMPARE_SHA1_HASH +#define CERT_COMPARE_NAME_STR_A 7 +#define CERT_COMPARE_NAME_STR_W 8 +#define CERT_COMPARE_KEY_SPEC 9 +#define CERT_COMPARE_ENHKEY_USAGE 10 +#define CERT_COMPARE_CTL_USAGE CERT_COMPARE_ENHKEY_USAGE +#define CERT_COMPARE_SUBJECT_CERT 11 +#define CERT_COMPARE_ISSUER_OF 12 +#define CERT_COMPARE_EXISTING 13 +#define CERT_COMPARE_SIGNATURE_HASH 14 +#define CERT_COMPARE_KEY_IDENTIFIER 15 +#define CERT_COMPARE_CERT_ID 16 +#define CERT_COMPARE_CROSS_CERT_DIST_POINTS 17 +#define CERT_COMPARE_PUBKEY_MD5_HASH 18 +#define CERT_COMPARE_SUBJECT_INFO_ACCESS 19 +#define CERT_COMPARE_HASH_STR 20 +#define CERT_COMPARE_HAS_PRIVATE_KEY 21 -#define CERT_FIND_ANY (CERT_COMPARE_ANY << CERT_COMPARE_SHIFT) -#define CERT_FIND_SHA1_HASH (CERT_COMPARE_SHA1_HASH << CERT_COMPARE_SHIFT) -#define CERT_FIND_MD5_HASH (CERT_COMPARE_MD5_HASH << CERT_COMPARE_SHIFT) -#define CERT_FIND_SIGNATURE_HASH (CERT_COMPARE_SIGNATURE_HASH << CERT_COMPARE_SHIFT) -#define CERT_FIND_KEY_IDENTIFIER (CERT_COMPARE_KEY_IDENTIFIER << CERT_COMPARE_SHIFT) -#define CERT_FIND_HASH CERT_FIND_SHA1_HASH -#define CERT_FIND_PROPERTY (CERT_COMPARE_PROPERTY << CERT_COMPARE_SHIFT) -#define CERT_FIND_PUBLIC_KEY (CERT_COMPARE_PUBLIC_KEY << CERT_COMPARE_SHIFT) -#define CERT_FIND_SUBJECT_NAME (CERT_COMPARE_NAME << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG) -#define CERT_FIND_SUBJECT_ATTR (CERT_COMPARE_ATTR << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG) -#define CERT_FIND_ISSUER_NAME (CERT_COMPARE_NAME << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG) -#define CERT_FIND_ISSUER_ATTR (CERT_COMPARE_ATTR << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG) -#define CERT_FIND_SUBJECT_STR_A (CERT_COMPARE_NAME_STR_A << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG) -#define CERT_FIND_SUBJECT_STR_W (CERT_COMPARE_NAME_STR_W << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG) -#define CERT_FIND_SUBJECT_STR CERT_FIND_SUBJECT_STR_W -#define CERT_FIND_ISSUER_STR_A (CERT_COMPARE_NAME_STR_A << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG) -#define CERT_FIND_ISSUER_STR_W (CERT_COMPARE_NAME_STR_W << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG) -#define CERT_FIND_ISSUER_STR CERT_FIND_ISSUER_STR_W -#define CERT_FIND_KEY_SPEC (CERT_COMPARE_KEY_SPEC << CERT_COMPARE_SHIFT) -#define CERT_FIND_ENHKEY_USAGE (CERT_COMPARE_ENHKEY_USAGE << CERT_COMPARE_SHIFT) -#define CERT_FIND_CTL_USAGE CERT_FIND_ENHKEY_USAGE -#define CERT_FIND_SUBJECT_CERT (CERT_COMPARE_SUBJECT_CERT << CERT_COMPARE_SHIFT) -#define CERT_FIND_ISSUER_OF (CERT_COMPARE_ISSUER_OF << CERT_COMPARE_SHIFT) -#define CERT_FIND_EXISTING (CERT_COMPARE_EXISTING << CERT_COMPARE_SHIFT) -#define CERT_FIND_CERT_ID (CERT_COMPARE_CERT_ID << CERT_COMPARE_SHIFT) -#define CERT_FIND_CROSS_CERT_DIST_POINTS (CERT_COMPARE_CROSS_CERT_DIST_POINTS << CERT_COMPARE_SHIFT) -#define CERT_FIND_PUBKEY_MD5_HASH (CERT_COMPARE_PUBKEY_MD5_HASH << CERT_COMPARE_SHIFT) -#define CERT_FIND_SUBJECT_INFO_ACCESS (CERT_COMPARE_SUBJECT_INFO_ACCESS << CERT_COMPARE_SHIFT) -#define CERT_FIND_HASH_STR (CERT_COMPARE_HASH_STR << CERT_COMPARE_SHIFT) -#define CERT_FIND_HAS_PRIVATE_KEY (CERT_COMPARE_HAS_PRIVATE_KEY << CERT_COMPARE_SHIFT) +#define CERT_FIND_ANY (CERT_COMPARE_ANY << CERT_COMPARE_SHIFT) +#define CERT_FIND_SHA1_HASH (CERT_COMPARE_SHA1_HASH << CERT_COMPARE_SHIFT) +#define CERT_FIND_MD5_HASH (CERT_COMPARE_MD5_HASH << CERT_COMPARE_SHIFT) +#define CERT_FIND_SIGNATURE_HASH (CERT_COMPARE_SIGNATURE_HASH << CERT_COMPARE_SHIFT) +#define CERT_FIND_KEY_IDENTIFIER (CERT_COMPARE_KEY_IDENTIFIER << CERT_COMPARE_SHIFT) +#define CERT_FIND_HASH CERT_FIND_SHA1_HASH +#define CERT_FIND_PROPERTY (CERT_COMPARE_PROPERTY << CERT_COMPARE_SHIFT) +#define CERT_FIND_PUBLIC_KEY (CERT_COMPARE_PUBLIC_KEY << CERT_COMPARE_SHIFT) +#define CERT_FIND_SUBJECT_NAME (CERT_COMPARE_NAME << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG) +#define CERT_FIND_SUBJECT_ATTR (CERT_COMPARE_ATTR << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG) +#define CERT_FIND_ISSUER_NAME (CERT_COMPARE_NAME << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG) +#define CERT_FIND_ISSUER_ATTR (CERT_COMPARE_ATTR << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG) +#define CERT_FIND_SUBJECT_STR_A \ + (CERT_COMPARE_NAME_STR_A << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG) +#define CERT_FIND_SUBJECT_STR_W \ + (CERT_COMPARE_NAME_STR_W << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG) +#define CERT_FIND_SUBJECT_STR CERT_FIND_SUBJECT_STR_W +#define CERT_FIND_ISSUER_STR_A \ + (CERT_COMPARE_NAME_STR_A << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG) +#define CERT_FIND_ISSUER_STR_W \ + (CERT_COMPARE_NAME_STR_W << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG) +#define CERT_FIND_ISSUER_STR CERT_FIND_ISSUER_STR_W +#define CERT_FIND_KEY_SPEC (CERT_COMPARE_KEY_SPEC << CERT_COMPARE_SHIFT) +#define CERT_FIND_ENHKEY_USAGE (CERT_COMPARE_ENHKEY_USAGE << CERT_COMPARE_SHIFT) +#define CERT_FIND_CTL_USAGE CERT_FIND_ENHKEY_USAGE +#define CERT_FIND_SUBJECT_CERT (CERT_COMPARE_SUBJECT_CERT << CERT_COMPARE_SHIFT) +#define CERT_FIND_ISSUER_OF (CERT_COMPARE_ISSUER_OF << CERT_COMPARE_SHIFT) +#define CERT_FIND_EXISTING (CERT_COMPARE_EXISTING << CERT_COMPARE_SHIFT) +#define CERT_FIND_CERT_ID (CERT_COMPARE_CERT_ID << CERT_COMPARE_SHIFT) +#define CERT_FIND_CROSS_CERT_DIST_POINTS (CERT_COMPARE_CROSS_CERT_DIST_POINTS << CERT_COMPARE_SHIFT) +#define CERT_FIND_PUBKEY_MD5_HASH (CERT_COMPARE_PUBKEY_MD5_HASH << CERT_COMPARE_SHIFT) +#define CERT_FIND_SUBJECT_INFO_ACCESS (CERT_COMPARE_SUBJECT_INFO_ACCESS << CERT_COMPARE_SHIFT) +#define CERT_FIND_HASH_STR (CERT_COMPARE_HASH_STR << CERT_COMPARE_SHIFT) +#define CERT_FIND_HAS_PRIVATE_KEY (CERT_COMPARE_HAS_PRIVATE_KEY << CERT_COMPARE_SHIFT) -#define CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG 0x1 -#define CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG 0x2 -#define CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG 0x4 -#define CERT_FIND_NO_ENHKEY_USAGE_FLAG 0x8 -#define CERT_FIND_OR_ENHKEY_USAGE_FLAG 0x10 -#define CERT_FIND_VALID_ENHKEY_USAGE_FLAG 0x20 -#define CERT_FIND_OPTIONAL_CTL_USAGE_FLAG CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG -#define CERT_FIND_EXT_ONLY_CTL_USAGE_FLAG CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG -#define CERT_FIND_PROP_ONLY_CTL_USAGE_FLAG CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG -#define CERT_FIND_NO_CTL_USAGE_FLAG CERT_FIND_NO_ENHKEY_USAGE_FLAG -#define CERT_FIND_OR_CTL_USAGE_FLAG CERT_FIND_OR_ENHKEY_USAGE_FLAG -#define CERT_FIND_VALID_CTL_USAGE_FLAG CERT_FIND_VALID_ENHKEY_USAGE_FLAG +#define CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG 0x1 +#define CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG 0x2 +#define CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG 0x4 +#define CERT_FIND_NO_ENHKEY_USAGE_FLAG 0x8 +#define CERT_FIND_OR_ENHKEY_USAGE_FLAG 0x10 +#define CERT_FIND_VALID_ENHKEY_USAGE_FLAG 0x20 +#define CERT_FIND_OPTIONAL_CTL_USAGE_FLAG CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG +#define CERT_FIND_EXT_ONLY_CTL_USAGE_FLAG CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG +#define CERT_FIND_PROP_ONLY_CTL_USAGE_FLAG CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG +#define CERT_FIND_NO_CTL_USAGE_FLAG CERT_FIND_NO_ENHKEY_USAGE_FLAG +#define CERT_FIND_OR_CTL_USAGE_FLAG CERT_FIND_OR_ENHKEY_USAGE_FLAG +#define CERT_FIND_VALID_CTL_USAGE_FLAG CERT_FIND_VALID_ENHKEY_USAGE_FLAG -#define CERT_NAME_EMAIL_TYPE 1 -#define CERT_NAME_RDN_TYPE 2 -#define CERT_NAME_ATTR_TYPE 3 -#define CERT_NAME_SIMPLE_DISPLAY_TYPE 4 -#define CERT_NAME_FRIENDLY_DISPLAY_TYPE 5 -#define CERT_NAME_DNS_TYPE 6 -#define CERT_NAME_URL_TYPE 7 -#define CERT_NAME_UPN_TYPE 8 +#define CERT_NAME_EMAIL_TYPE 1 +#define CERT_NAME_RDN_TYPE 2 +#define CERT_NAME_ATTR_TYPE 3 +#define CERT_NAME_SIMPLE_DISPLAY_TYPE 4 +#define CERT_NAME_FRIENDLY_DISPLAY_TYPE 5 +#define CERT_NAME_DNS_TYPE 6 +#define CERT_NAME_URL_TYPE 7 +#define CERT_NAME_UPN_TYPE 8 -#define CERT_NAME_ISSUER_FLAG 0x1 -#define CERT_NAME_DISABLE_IE4_UTF8_FLAG 0x00010000 +#define CERT_NAME_ISSUER_FLAG 0x1 +#define CERT_NAME_DISABLE_IE4_UTF8_FLAG 0x00010000 -#define CERT_NAME_SEARCH_ALL_NAMES_FLAG 0x2 +#define CERT_NAME_SEARCH_ALL_NAMES_FLAG 0x2 -#define CERT_STORE_PROV_MSG ((LPCSTR) 1) -#define CERT_STORE_PROV_MEMORY ((LPCSTR) 2) -#define CERT_STORE_PROV_FILE ((LPCSTR) 3) -#define CERT_STORE_PROV_REG ((LPCSTR) 4) -#define CERT_STORE_PROV_PKCS7 ((LPCSTR) 5) -#define CERT_STORE_PROV_SERIALIZED ((LPCSTR) 6) -#define CERT_STORE_PROV_FILENAME_A ((LPCSTR) 7) -#define CERT_STORE_PROV_FILENAME_W ((LPCSTR) 8) -#define CERT_STORE_PROV_FILENAME CERT_STORE_PROV_FILENAME_W -#define CERT_STORE_PROV_SYSTEM_A ((LPCSTR) 9) -#define CERT_STORE_PROV_SYSTEM_W ((LPCSTR) 10) -#define CERT_STORE_PROV_SYSTEM CERT_STORE_PROV_SYSTEM_W -#define CERT_STORE_PROV_COLLECTION ((LPCSTR) 11) -#define CERT_STORE_PROV_SYSTEM_REGISTRY_A ((LPCSTR) 12) -#define CERT_STORE_PROV_SYSTEM_REGISTRY_W ((LPCSTR) 13) -#define CERT_STORE_PROV_SYSTEM_REGISTRY CERT_STORE_PROV_SYSTEM_REGISTRY_W -#define CERT_STORE_PROV_PHYSICAL_W ((LPCSTR) 14) -#define CERT_STORE_PROV_PHYSICAL CERT_STORE_PROV_PHYSICAL_W -#define CERT_STORE_PROV_SMART_CARD_W ((LPCSTR) 15) -#define CERT_STORE_PROV_SMART_CARD CERT_STORE_PROV_SMART_CARD_W -#define CERT_STORE_PROV_LDAP_W ((LPCSTR) 16) -#define CERT_STORE_PROV_LDAP CERT_STORE_PROV_LDAP_W -#define CERT_STORE_PROV_PKCS12 ((LPCSTR) 17) -#define sz_CERT_STORE_PROV_MEMORY "Memory" -#define sz_CERT_STORE_PROV_FILENAME_W "File" -#define sz_CERT_STORE_PROV_FILENAME sz_CERT_STORE_PROV_FILENAME_W -#define sz_CERT_STORE_PROV_SYSTEM_W "System" -#define sz_CERT_STORE_PROV_SYSTEM sz_CERT_STORE_PROV_SYSTEM_W -#define sz_CERT_STORE_PROV_PKCS7 "PKCS7" -#define sz_CERT_STORE_PROV_PKCS12 "PKCS12" -#define sz_CERT_STORE_PROV_SERIALIZED "Serialized" -#define sz_CERT_STORE_PROV_COLLECTION "Collection" -#define sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W "SystemRegistry" -#define sz_CERT_STORE_PROV_SYSTEM_REGISTRY sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W -#define sz_CERT_STORE_PROV_PHYSICAL_W "Physical" -#define sz_CERT_STORE_PROV_PHYSICAL sz_CERT_STORE_PROV_PHYSICAL_W -#define sz_CERT_STORE_PROV_SMART_CARD_W "SmartCard" -#define sz_CERT_STORE_PROV_SMART_CARD sz_CERT_STORE_PROV_SMART_CARD_W -#define sz_CERT_STORE_PROV_LDAP_W "Ldap" -#define sz_CERT_STORE_PROV_LDAP sz_CERT_STORE_PROV_LDAP_W +#define CERT_STORE_PROV_MSG ((LPCSTR)1) +#define CERT_STORE_PROV_MEMORY ((LPCSTR)2) +#define CERT_STORE_PROV_FILE ((LPCSTR)3) +#define CERT_STORE_PROV_REG ((LPCSTR)4) +#define CERT_STORE_PROV_PKCS7 ((LPCSTR)5) +#define CERT_STORE_PROV_SERIALIZED ((LPCSTR)6) +#define CERT_STORE_PROV_FILENAME_A ((LPCSTR)7) +#define CERT_STORE_PROV_FILENAME_W ((LPCSTR)8) +#define CERT_STORE_PROV_FILENAME CERT_STORE_PROV_FILENAME_W +#define CERT_STORE_PROV_SYSTEM_A ((LPCSTR)9) +#define CERT_STORE_PROV_SYSTEM_W ((LPCSTR)10) +#define CERT_STORE_PROV_SYSTEM CERT_STORE_PROV_SYSTEM_W +#define CERT_STORE_PROV_COLLECTION ((LPCSTR)11) +#define CERT_STORE_PROV_SYSTEM_REGISTRY_A ((LPCSTR)12) +#define CERT_STORE_PROV_SYSTEM_REGISTRY_W ((LPCSTR)13) +#define CERT_STORE_PROV_SYSTEM_REGISTRY CERT_STORE_PROV_SYSTEM_REGISTRY_W +#define CERT_STORE_PROV_PHYSICAL_W ((LPCSTR)14) +#define CERT_STORE_PROV_PHYSICAL CERT_STORE_PROV_PHYSICAL_W +#define CERT_STORE_PROV_SMART_CARD_W ((LPCSTR)15) +#define CERT_STORE_PROV_SMART_CARD CERT_STORE_PROV_SMART_CARD_W +#define CERT_STORE_PROV_LDAP_W ((LPCSTR)16) +#define CERT_STORE_PROV_LDAP CERT_STORE_PROV_LDAP_W +#define CERT_STORE_PROV_PKCS12 ((LPCSTR)17) +#define sz_CERT_STORE_PROV_MEMORY "Memory" +#define sz_CERT_STORE_PROV_FILENAME_W "File" +#define sz_CERT_STORE_PROV_FILENAME sz_CERT_STORE_PROV_FILENAME_W +#define sz_CERT_STORE_PROV_SYSTEM_W "System" +#define sz_CERT_STORE_PROV_SYSTEM sz_CERT_STORE_PROV_SYSTEM_W +#define sz_CERT_STORE_PROV_PKCS7 "PKCS7" +#define sz_CERT_STORE_PROV_PKCS12 "PKCS12" +#define sz_CERT_STORE_PROV_SERIALIZED "Serialized" +#define sz_CERT_STORE_PROV_COLLECTION "Collection" +#define sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W "SystemRegistry" +#define sz_CERT_STORE_PROV_SYSTEM_REGISTRY sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W +#define sz_CERT_STORE_PROV_PHYSICAL_W "Physical" +#define sz_CERT_STORE_PROV_PHYSICAL sz_CERT_STORE_PROV_PHYSICAL_W +#define sz_CERT_STORE_PROV_SMART_CARD_W "SmartCard" +#define sz_CERT_STORE_PROV_SMART_CARD sz_CERT_STORE_PROV_SMART_CARD_W +#define sz_CERT_STORE_PROV_LDAP_W "Ldap" +#define sz_CERT_STORE_PROV_LDAP sz_CERT_STORE_PROV_LDAP_W -#define CERT_STORE_SIGNATURE_FLAG 0x00000001 -#define CERT_STORE_TIME_VALIDITY_FLAG 0x00000002 -#define CERT_STORE_REVOCATION_FLAG 0x00000004 -#define CERT_STORE_NO_CRL_FLAG 0x00010000 -#define CERT_STORE_NO_ISSUER_FLAG 0x00020000 -#define CERT_STORE_BASE_CRL_FLAG 0x00000100 -#define CERT_STORE_DELTA_CRL_FLAG 0x00000200 +#define CERT_STORE_SIGNATURE_FLAG 0x00000001 +#define CERT_STORE_TIME_VALIDITY_FLAG 0x00000002 +#define CERT_STORE_REVOCATION_FLAG 0x00000004 +#define CERT_STORE_NO_CRL_FLAG 0x00010000 +#define CERT_STORE_NO_ISSUER_FLAG 0x00020000 +#define CERT_STORE_BASE_CRL_FLAG 0x00000100 +#define CERT_STORE_DELTA_CRL_FLAG 0x00000200 -#define CERT_STORE_NO_CRYPT_RELEASE_FLAG 0x00000001 -#define CERT_STORE_SET_LOCALIZED_NAME_FLAG 0x00000002 -#define CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG 0x00000004 -#define CERT_STORE_DELETE_FLAG 0x00000010 -#define CERT_STORE_UNSAFE_PHYSICAL_FLAG 0x00000020 -#define CERT_STORE_SHARE_STORE_FLAG 0x00000040 -#define CERT_STORE_SHARE_CONTEXT_FLAG 0x00000080 -#define CERT_STORE_MANIFOLD_FLAG 0x00000100 -#define CERT_STORE_ENUM_ARCHIVED_FLAG 0x00000200 -#define CERT_STORE_UPDATE_KEYID_FLAG 0x00000400 -#define CERT_STORE_BACKUP_RESTORE_FLAG 0x00000800 -#define CERT_STORE_READONLY_FLAG 0x00008000 -#define CERT_STORE_OPEN_EXISTING_FLAG 0x00004000 -#define CERT_STORE_CREATE_NEW_FLAG 0x00002000 -#define CERT_STORE_MAXIMUM_ALLOWED_FLAG 0x00001000 +#define CERT_STORE_NO_CRYPT_RELEASE_FLAG 0x00000001 +#define CERT_STORE_SET_LOCALIZED_NAME_FLAG 0x00000002 +#define CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG 0x00000004 +#define CERT_STORE_DELETE_FLAG 0x00000010 +#define CERT_STORE_UNSAFE_PHYSICAL_FLAG 0x00000020 +#define CERT_STORE_SHARE_STORE_FLAG 0x00000040 +#define CERT_STORE_SHARE_CONTEXT_FLAG 0x00000080 +#define CERT_STORE_MANIFOLD_FLAG 0x00000100 +#define CERT_STORE_ENUM_ARCHIVED_FLAG 0x00000200 +#define CERT_STORE_UPDATE_KEYID_FLAG 0x00000400 +#define CERT_STORE_BACKUP_RESTORE_FLAG 0x00000800 +#define CERT_STORE_READONLY_FLAG 0x00008000 +#define CERT_STORE_OPEN_EXISTING_FLAG 0x00004000 +#define CERT_STORE_CREATE_NEW_FLAG 0x00002000 +#define CERT_STORE_MAXIMUM_ALLOWED_FLAG 0x00001000 -#define CERT_SYSTEM_STORE_MASK 0xFFFF0000 -#define CERT_SYSTEM_STORE_RELOCATE_FLAG 0x80000000 -#define CERT_SYSTEM_STORE_UNPROTECTED_FLAG 0x40000000 -#define CERT_SYSTEM_STORE_DEFER_READ_FLAG 0x20000000 -#define CERT_SYSTEM_STORE_LOCATION_MASK 0x00FF0000 -#define CERT_SYSTEM_STORE_LOCATION_SHIFT 16 -#define CERT_SYSTEM_STORE_CURRENT_USER_ID 1 -#define CERT_SYSTEM_STORE_LOCAL_MACHINE_ID 2 -#define CERT_SYSTEM_STORE_CURRENT_SERVICE_ID 4 -#define CERT_SYSTEM_STORE_SERVICES_ID 5 -#define CERT_SYSTEM_STORE_USERS_ID 6 -#define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID 7 -#define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID 8 -#define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID 9 +#define CERT_SYSTEM_STORE_MASK 0xFFFF0000 +#define CERT_SYSTEM_STORE_RELOCATE_FLAG 0x80000000 +#define CERT_SYSTEM_STORE_UNPROTECTED_FLAG 0x40000000 +#define CERT_SYSTEM_STORE_DEFER_READ_FLAG 0x20000000 +#define CERT_SYSTEM_STORE_LOCATION_MASK 0x00FF0000 +#define CERT_SYSTEM_STORE_LOCATION_SHIFT 16 +#define CERT_SYSTEM_STORE_CURRENT_USER_ID 1 +#define CERT_SYSTEM_STORE_LOCAL_MACHINE_ID 2 +#define CERT_SYSTEM_STORE_CURRENT_SERVICE_ID 4 +#define CERT_SYSTEM_STORE_SERVICES_ID 5 +#define CERT_SYSTEM_STORE_USERS_ID 6 +#define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID 7 +#define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID 8 +#define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID 9 #define CERT_SYSTEM_STORE_CURRENT_USER \ (CERT_SYSTEM_STORE_CURRENT_USER_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT) @@ -465,20 +464,16 @@ typedef const CERT_CONTEXT *PCCERT_CONTEXT; (CERT_SYSTEM_STORE_CURRENT_SERVICE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT) #define CERT_SYSTEM_STORE_SERVICES \ (CERT_SYSTEM_STORE_SERVICES_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT) -#define CERT_SYSTEM_STORE_USERS \ - (CERT_SYSTEM_STORE_USERS_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT) +#define CERT_SYSTEM_STORE_USERS (CERT_SYSTEM_STORE_USERS_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT) #define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY \ - (CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID << \ - CERT_SYSTEM_STORE_LOCATION_SHIFT) + (CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT) #define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY \ - (CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID << \ - CERT_SYSTEM_STORE_LOCATION_SHIFT) + (CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT) #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE \ - (CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID << \ - CERT_SYSTEM_STORE_LOCATION_SHIFT) + (CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT) HCERTSTORE CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, - HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void* pvPara); + HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void* pvPara); WINPR_API HCERTSTORE CertOpenSystemStoreW(HCRYPTPROV_LEGACY hProv, LPCWSTR szSubsystemProtocol); WINPR_API HCERTSTORE CertOpenSystemStoreA(HCRYPTPROV_LEGACY hProv, LPCSTR szSubsystemProtocol); @@ -486,61 +481,65 @@ WINPR_API HCERTSTORE CertOpenSystemStoreA(HCRYPTPROV_LEGACY hProv, LPCSTR szSubs WINPR_API BOOL CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags); #ifdef UNICODE -#define CertOpenSystemStore CertOpenSystemStoreW +#define CertOpenSystemStore CertOpenSystemStoreW #else -#define CertOpenSystemStore CertOpenSystemStoreA +#define CertOpenSystemStore CertOpenSystemStoreA #endif #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API PCCERT_CONTEXT CertFindCertificateInStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, - DWORD dwFindFlags, DWORD dwFindType, const void* pvFindPara, PCCERT_CONTEXT pPrevCertContext); + WINPR_API PCCERT_CONTEXT CertFindCertificateInStore(HCERTSTORE hCertStore, + DWORD dwCertEncodingType, DWORD dwFindFlags, + DWORD dwFindType, const void* pvFindPara, + PCCERT_CONTEXT pPrevCertContext); -WINPR_API PCCERT_CONTEXT CertEnumCertificatesInStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pPrevCertContext); + WINPR_API PCCERT_CONTEXT CertEnumCertificatesInStore(HCERTSTORE hCertStore, + PCCERT_CONTEXT pPrevCertContext); -WINPR_API DWORD CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType, - DWORD dwFlags, void* pvTypePara, LPWSTR pszNameString, DWORD cchNameString); -WINPR_API DWORD CertGetNameStringA(PCCERT_CONTEXT pCertContext, DWORD dwType, - DWORD dwFlags, void* pvTypePara, LPSTR pszNameString, DWORD cchNameString); + WINPR_API DWORD CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags, + void* pvTypePara, LPWSTR pszNameString, DWORD cchNameString); + WINPR_API DWORD CertGetNameStringA(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags, + void* pvTypePara, LPSTR pszNameString, DWORD cchNameString); #ifdef __cplusplus } #endif #ifdef UNICODE -#define CertGetNameString CertGetNameStringW +#define CertGetNameString CertGetNameStringW #else -#define CertGetNameString CertGetNameStringA +#define CertGetNameString CertGetNameStringA #endif /** * Data Protection API (DPAPI) */ -#define CRYPTPROTECTMEMORY_BLOCK_SIZE 16 +#define CRYPTPROTECTMEMORY_BLOCK_SIZE 16 -#define CRYPTPROTECTMEMORY_SAME_PROCESS 0x00000000 -#define CRYPTPROTECTMEMORY_CROSS_PROCESS 0x00000001 -#define CRYPTPROTECTMEMORY_SAME_LOGON 0x00000002 +#define CRYPTPROTECTMEMORY_SAME_PROCESS 0x00000000 +#define CRYPTPROTECTMEMORY_CROSS_PROCESS 0x00000001 +#define CRYPTPROTECTMEMORY_SAME_LOGON 0x00000002 -#define CRYPTPROTECT_PROMPT_ON_UNPROTECT 0x00000001 -#define CRYPTPROTECT_PROMPT_ON_PROTECT 0x00000002 -#define CRYPTPROTECT_PROMPT_RESERVED 0x00000004 -#define CRYPTPROTECT_PROMPT_STRONG 0x00000008 -#define CRYPTPROTECT_PROMPT_REQUIRE_STRONG 0x00000010 +#define CRYPTPROTECT_PROMPT_ON_UNPROTECT 0x00000001 +#define CRYPTPROTECT_PROMPT_ON_PROTECT 0x00000002 +#define CRYPTPROTECT_PROMPT_RESERVED 0x00000004 +#define CRYPTPROTECT_PROMPT_STRONG 0x00000008 +#define CRYPTPROTECT_PROMPT_REQUIRE_STRONG 0x00000010 -#define CRYPTPROTECT_UI_FORBIDDEN 0x1 -#define CRYPTPROTECT_LOCAL_MACHINE 0x4 -#define CRYPTPROTECT_CRED_SYNC 0x8 -#define CRYPTPROTECT_AUDIT 0x10 -#define CRYPTPROTECT_NO_RECOVERY 0x20 -#define CRYPTPROTECT_VERIFY_PROTECTION 0x40 -#define CRYPTPROTECT_CRED_REGENERATE 0x80 +#define CRYPTPROTECT_UI_FORBIDDEN 0x1 +#define CRYPTPROTECT_LOCAL_MACHINE 0x4 +#define CRYPTPROTECT_CRED_SYNC 0x8 +#define CRYPTPROTECT_AUDIT 0x10 +#define CRYPTPROTECT_NO_RECOVERY 0x20 +#define CRYPTPROTECT_VERIFY_PROTECTION 0x40 +#define CRYPTPROTECT_CRED_REGENERATE 0x80 -#define CRYPTPROTECT_FIRST_RESERVED_FLAGVAL 0x0FFFFFFF -#define CRYPTPROTECT_LAST_RESERVED_FLAGVAL 0xFFFFFFFF +#define CRYPTPROTECT_FIRST_RESERVED_FLAGVAL 0x0FFFFFFF +#define CRYPTPROTECT_LAST_RESERVED_FLAGVAL 0xFFFFFFFF typedef struct _CRYPTPROTECT_PROMPTSTRUCT { @@ -550,106 +549,120 @@ typedef struct _CRYPTPROTECT_PROMPTSTRUCT LPCWSTR szPrompt; } CRYPTPROTECT_PROMPTSTRUCT, *PCRYPTPROTECT_PROMPTSTRUCT; -#define CRYPTPROTECT_DEFAULT_PROVIDER { 0xdf9d8cd0, 0x1501, 0x11d1, { 0x8c, 0x7a, 0x00, 0xc0, 0x4f, 0xc2, 0x97, 0xeb } } +#define CRYPTPROTECT_DEFAULT_PROVIDER \ + { \ + 0xdf9d8cd0, 0x1501, 0x11d1, \ + { \ + 0x8c, 0x7a, 0x00, 0xc0, 0x4f, 0xc2, 0x97, 0xeb \ + } \ + } #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API BOOL CryptProtectMemory(LPVOID pData, DWORD cbData, DWORD dwFlags); -WINPR_API BOOL CryptUnprotectMemory(LPVOID pData, DWORD cbData, DWORD dwFlags); + WINPR_API BOOL CryptProtectMemory(LPVOID pData, DWORD cbData, DWORD dwFlags); + WINPR_API BOOL CryptUnprotectMemory(LPVOID pData, DWORD cbData, DWORD dwFlags); -WINPR_API BOOL CryptProtectData(DATA_BLOB* pDataIn, LPCWSTR szDataDescr, DATA_BLOB* pOptionalEntropy, - PVOID pvReserved, CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags, DATA_BLOB* pDataOut); -WINPR_API BOOL CryptUnprotectData(DATA_BLOB* pDataIn, LPWSTR* ppszDataDescr, DATA_BLOB* pOptionalEntropy, - PVOID pvReserved, CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags, DATA_BLOB* pDataOut); + WINPR_API BOOL CryptProtectData(DATA_BLOB* pDataIn, LPCWSTR szDataDescr, + DATA_BLOB* pOptionalEntropy, PVOID pvReserved, + CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags, + DATA_BLOB* pDataOut); + WINPR_API BOOL CryptUnprotectData(DATA_BLOB* pDataIn, LPWSTR* ppszDataDescr, + DATA_BLOB* pOptionalEntropy, PVOID pvReserved, + CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags, + DATA_BLOB* pDataOut); #ifdef __cplusplus } #endif -#define CRYPT_STRING_BASE64HEADER 0x00000000 -#define CRYPT_STRING_BASE64 0x00000001 -#define CRYPT_STRING_BINARY 0x00000002 -#define CRYPT_STRING_BASE64REQUESTHEADER 0x00000003 -#define CRYPT_STRING_HEX 0x00000004 -#define CRYPT_STRING_HEXASCII 0x00000005 -#define CRYPT_STRING_BASE64_ANY 0x00000006 -#define CRYPT_STRING_ANY 0x00000007 -#define CRYPT_STRING_HEX_ANY 0x00000008 -#define CRYPT_STRING_BASE64X509CRLHEADER 0x00000009 -#define CRYPT_STRING_HEXADDR 0x0000000A -#define CRYPT_STRING_HEXASCIIADDR 0x0000000B -#define CRYPT_STRING_HEXRAW 0x0000000C +#define CRYPT_STRING_BASE64HEADER 0x00000000 +#define CRYPT_STRING_BASE64 0x00000001 +#define CRYPT_STRING_BINARY 0x00000002 +#define CRYPT_STRING_BASE64REQUESTHEADER 0x00000003 +#define CRYPT_STRING_HEX 0x00000004 +#define CRYPT_STRING_HEXASCII 0x00000005 +#define CRYPT_STRING_BASE64_ANY 0x00000006 +#define CRYPT_STRING_ANY 0x00000007 +#define CRYPT_STRING_HEX_ANY 0x00000008 +#define CRYPT_STRING_BASE64X509CRLHEADER 0x00000009 +#define CRYPT_STRING_HEXADDR 0x0000000A +#define CRYPT_STRING_HEXASCIIADDR 0x0000000B +#define CRYPT_STRING_HEXRAW 0x0000000C -#define CRYPT_STRING_HASHDATA 0x10000000 -#define CRYPT_STRING_STRICT 0x20000000 -#define CRYPT_STRING_NOCRLF 0x40000000 -#define CRYPT_STRING_NOCR 0x80000000 +#define CRYPT_STRING_HASHDATA 0x10000000 +#define CRYPT_STRING_STRICT 0x20000000 +#define CRYPT_STRING_NOCRLF 0x40000000 +#define CRYPT_STRING_NOCR 0x80000000 BOOL CryptStringToBinaryW(LPCWSTR pszString, DWORD cchString, DWORD dwFlags, BYTE* pbBinary, - DWORD* pcbBinary, DWORD* pdwSkip, DWORD* pdwFlags); + DWORD* pcbBinary, DWORD* pdwSkip, DWORD* pdwFlags); BOOL CryptStringToBinaryA(LPCSTR pszString, DWORD cchString, DWORD dwFlags, BYTE* pbBinary, - DWORD* pcbBinary, DWORD* pdwSkip, DWORD* pdwFlags); + DWORD* pcbBinary, DWORD* pdwSkip, DWORD* pdwFlags); -BOOL CryptBinaryToStringW(CONST BYTE* pbBinary, DWORD cbBinary, DWORD dwFlags, LPWSTR pszString, DWORD* pcchString); -BOOL CryptBinaryToStringA(CONST BYTE* pbBinary, DWORD cbBinary, DWORD dwFlags, LPSTR pszString, DWORD* pcchString); +BOOL CryptBinaryToStringW(CONST BYTE* pbBinary, DWORD cbBinary, DWORD dwFlags, LPWSTR pszString, + DWORD* pcchString); +BOOL CryptBinaryToStringA(CONST BYTE* pbBinary, DWORD cbBinary, DWORD dwFlags, LPSTR pszString, + DWORD* pcchString); #ifdef UNICODE -#define CryptStringToBinary CryptStringToBinaryW -#define CryptBinaryToString CryptBinaryToStringW +#define CryptStringToBinary CryptStringToBinaryW +#define CryptBinaryToString CryptBinaryToStringW #else -#define CryptStringToBinary CryptStringToBinaryA -#define CryptBinaryToString CryptBinaryToStringA +#define CryptStringToBinary CryptStringToBinaryA +#define CryptBinaryToString CryptBinaryToStringA #endif #endif #ifndef ALG_SID_ECSDA -#define ALG_SID_ECDSA 3 -#define CALG_ECDSA (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_ECDSA) +#define ALG_SID_ECDSA 3 +#define CALG_ECDSA (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_ECDSA) #endif /** * Custom Crypto API Abstraction Layer */ -#define WINPR_MD4_DIGEST_LENGTH 16 -#define WINPR_MD5_DIGEST_LENGTH 16 -#define WINPR_SHA1_DIGEST_LENGTH 20 -#define WINPR_SHA256_DIGEST_LENGTH 32 - +#define WINPR_MD4_DIGEST_LENGTH 16 +#define WINPR_MD5_DIGEST_LENGTH 16 +#define WINPR_SHA1_DIGEST_LENGTH 20 +#define WINPR_SHA256_DIGEST_LENGTH 32 /** * HMAC */ typedef enum { - WINPR_MD_NONE = 0, - WINPR_MD_MD2 = 1, - WINPR_MD_MD4 = 2, - WINPR_MD_MD5 = 3, - WINPR_MD_SHA1 = 4, - WINPR_MD_SHA224 = 5, - WINPR_MD_SHA256 = 6, - WINPR_MD_SHA384 = 7, - WINPR_MD_SHA512 = 8, - WINPR_MD_RIPEMD160 = 9 + WINPR_MD_NONE = 0, + WINPR_MD_MD2 = 1, + WINPR_MD_MD4 = 2, + WINPR_MD_MD5 = 3, + WINPR_MD_SHA1 = 4, + WINPR_MD_SHA224 = 5, + WINPR_MD_SHA256 = 6, + WINPR_MD_SHA384 = 7, + WINPR_MD_SHA512 = 8, + WINPR_MD_RIPEMD160 = 9 } WINPR_MD_TYPE; typedef struct _winpr_hmac_ctx_private_st WINPR_HMAC_CTX; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API WINPR_HMAC_CTX* winpr_HMAC_New(void); -WINPR_API BOOL winpr_HMAC_Init(WINPR_HMAC_CTX* ctx, WINPR_MD_TYPE md, const BYTE* key, size_t keylen); -WINPR_API BOOL winpr_HMAC_Update(WINPR_HMAC_CTX* ctx, const BYTE* input, size_t ilen); -WINPR_API BOOL winpr_HMAC_Final(WINPR_HMAC_CTX* ctx, BYTE* output, size_t ilen); -WINPR_API void winpr_HMAC_Free(WINPR_HMAC_CTX* ctx); -WINPR_API BOOL winpr_HMAC(WINPR_MD_TYPE md, const BYTE* key, size_t keylen, - const BYTE* input, size_t ilen, BYTE* output, size_t olen); + WINPR_API WINPR_HMAC_CTX* winpr_HMAC_New(void); + WINPR_API BOOL winpr_HMAC_Init(WINPR_HMAC_CTX* ctx, WINPR_MD_TYPE md, const BYTE* key, + size_t keylen); + WINPR_API BOOL winpr_HMAC_Update(WINPR_HMAC_CTX* ctx, const BYTE* input, size_t ilen); + WINPR_API BOOL winpr_HMAC_Final(WINPR_HMAC_CTX* ctx, BYTE* output, size_t ilen); + WINPR_API void winpr_HMAC_Free(WINPR_HMAC_CTX* ctx); + WINPR_API BOOL winpr_HMAC(WINPR_MD_TYPE md, const BYTE* key, size_t keylen, const BYTE* input, + size_t ilen, BYTE* output, size_t olen); #ifdef __cplusplus } @@ -662,17 +675,20 @@ WINPR_API BOOL winpr_HMAC(WINPR_MD_TYPE md, const BYTE* key, size_t keylen, typedef struct _winpr_digest_ctx_private_st WINPR_DIGEST_CTX; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API WINPR_DIGEST_CTX* winpr_Digest_New(void); -WINPR_API BOOL winpr_Digest_Init_Allow_FIPS(WINPR_DIGEST_CTX* ctx, WINPR_MD_TYPE md); -WINPR_API BOOL winpr_Digest_Init(WINPR_DIGEST_CTX* ctx, WINPR_MD_TYPE md); -WINPR_API BOOL winpr_Digest_Update(WINPR_DIGEST_CTX* ctx, const BYTE* input, size_t ilen); -WINPR_API BOOL winpr_Digest_Final(WINPR_DIGEST_CTX* ctx, BYTE* output, size_t ilen); -WINPR_API void winpr_Digest_Free(WINPR_DIGEST_CTX* ctx); -WINPR_API BOOL winpr_Digest_Allow_FIPS(WINPR_MD_TYPE md, const BYTE* input, size_t ilen, BYTE* output, size_t olen); -WINPR_API BOOL winpr_Digest(WINPR_MD_TYPE md, const BYTE* input, size_t ilen, BYTE* output, size_t olen); + WINPR_API WINPR_DIGEST_CTX* winpr_Digest_New(void); + WINPR_API BOOL winpr_Digest_Init_Allow_FIPS(WINPR_DIGEST_CTX* ctx, WINPR_MD_TYPE md); + WINPR_API BOOL winpr_Digest_Init(WINPR_DIGEST_CTX* ctx, WINPR_MD_TYPE md); + WINPR_API BOOL winpr_Digest_Update(WINPR_DIGEST_CTX* ctx, const BYTE* input, size_t ilen); + WINPR_API BOOL winpr_Digest_Final(WINPR_DIGEST_CTX* ctx, BYTE* output, size_t ilen); + WINPR_API void winpr_Digest_Free(WINPR_DIGEST_CTX* ctx); + WINPR_API BOOL winpr_Digest_Allow_FIPS(WINPR_MD_TYPE md, const BYTE* input, size_t ilen, + BYTE* output, size_t olen); + WINPR_API BOOL winpr_Digest(WINPR_MD_TYPE md, const BYTE* input, size_t ilen, BYTE* output, + size_t olen); #ifdef __cplusplus } @@ -683,11 +699,12 @@ WINPR_API BOOL winpr_Digest(WINPR_MD_TYPE md, const BYTE* input, size_t ilen, BY */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API int winpr_RAND(BYTE* output, size_t len); -WINPR_API int winpr_RAND_pseudo(BYTE* output, size_t len); + WINPR_API int winpr_RAND(BYTE* output, size_t len); + WINPR_API int winpr_RAND_pseudo(BYTE* output, size_t len); #ifdef __cplusplus } @@ -700,13 +717,15 @@ WINPR_API int winpr_RAND_pseudo(BYTE* output, size_t len); typedef struct _winpr_rc4_ctx_private_st WINPR_RC4_CTX; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API WINPR_RC4_CTX* winpr_RC4_New_Allow_FIPS(const BYTE* key, size_t keylen); -WINPR_API WINPR_RC4_CTX* winpr_RC4_New(const BYTE* key, size_t keylen); -WINPR_API BOOL winpr_RC4_Update(WINPR_RC4_CTX* ctx, size_t length, const BYTE* input, BYTE* output); -WINPR_API void winpr_RC4_Free(WINPR_RC4_CTX* ctx); + WINPR_API WINPR_RC4_CTX* winpr_RC4_New_Allow_FIPS(const BYTE* key, size_t keylen); + WINPR_API WINPR_RC4_CTX* winpr_RC4_New(const BYTE* key, size_t keylen); + WINPR_API BOOL winpr_RC4_Update(WINPR_RC4_CTX* ctx, size_t length, const BYTE* input, + BYTE* output); + WINPR_API void winpr_RC4_Free(WINPR_RC4_CTX* ctx); #ifdef __cplusplus } @@ -716,73 +735,76 @@ WINPR_API void winpr_RC4_Free(WINPR_RC4_CTX* ctx); * Generic Cipher API */ -#define WINPR_AES_BLOCK_SIZE 16 +#define WINPR_AES_BLOCK_SIZE 16 /* cipher operation types */ -#define WINPR_ENCRYPT 0 -#define WINPR_DECRYPT 1 +#define WINPR_ENCRYPT 0 +#define WINPR_DECRYPT 1 /* cipher types */ -#define WINPR_CIPHER_NONE 0 -#define WINPR_CIPHER_NULL 1 -#define WINPR_CIPHER_AES_128_ECB 2 -#define WINPR_CIPHER_AES_192_ECB 3 -#define WINPR_CIPHER_AES_256_ECB 4 -#define WINPR_CIPHER_AES_128_CBC 5 -#define WINPR_CIPHER_AES_192_CBC 6 -#define WINPR_CIPHER_AES_256_CBC 7 -#define WINPR_CIPHER_AES_128_CFB128 8 -#define WINPR_CIPHER_AES_192_CFB128 9 -#define WINPR_CIPHER_AES_256_CFB128 10 -#define WINPR_CIPHER_AES_128_CTR 11 -#define WINPR_CIPHER_AES_192_CTR 12 -#define WINPR_CIPHER_AES_256_CTR 13 -#define WINPR_CIPHER_AES_128_GCM 14 -#define WINPR_CIPHER_AES_192_GCM 15 -#define WINPR_CIPHER_AES_256_GCM 16 -#define WINPR_CIPHER_CAMELLIA_128_ECB 17 -#define WINPR_CIPHER_CAMELLIA_192_ECB 18 -#define WINPR_CIPHER_CAMELLIA_256_ECB 19 -#define WINPR_CIPHER_CAMELLIA_128_CBC 20 -#define WINPR_CIPHER_CAMELLIA_192_CBC 21 -#define WINPR_CIPHER_CAMELLIA_256_CBC 22 -#define WINPR_CIPHER_CAMELLIA_128_CFB128 23 -#define WINPR_CIPHER_CAMELLIA_192_CFB128 24 -#define WINPR_CIPHER_CAMELLIA_256_CFB128 25 -#define WINPR_CIPHER_CAMELLIA_128_CTR 26 -#define WINPR_CIPHER_CAMELLIA_192_CTR 27 -#define WINPR_CIPHER_CAMELLIA_256_CTR 28 -#define WINPR_CIPHER_CAMELLIA_128_GCM 29 -#define WINPR_CIPHER_CAMELLIA_192_GCM 30 -#define WINPR_CIPHER_CAMELLIA_256_GCM 31 -#define WINPR_CIPHER_DES_ECB 32 -#define WINPR_CIPHER_DES_CBC 33 -#define WINPR_CIPHER_DES_EDE_ECB 34 -#define WINPR_CIPHER_DES_EDE_CBC 35 -#define WINPR_CIPHER_DES_EDE3_ECB 36 -#define WINPR_CIPHER_DES_EDE3_CBC 37 -#define WINPR_CIPHER_BLOWFISH_ECB 38 -#define WINPR_CIPHER_BLOWFISH_CBC 39 -#define WINPR_CIPHER_BLOWFISH_CFB64 40 -#define WINPR_CIPHER_BLOWFISH_CTR 41 -#define WINPR_CIPHER_ARC4_128 42 -#define WINPR_CIPHER_AES_128_CCM 43 -#define WINPR_CIPHER_AES_192_CCM 44 -#define WINPR_CIPHER_AES_256_CCM 45 -#define WINPR_CIPHER_CAMELLIA_128_CCM 46 -#define WINPR_CIPHER_CAMELLIA_192_CCM 47 -#define WINPR_CIPHER_CAMELLIA_256_CCM 48 +#define WINPR_CIPHER_NONE 0 +#define WINPR_CIPHER_NULL 1 +#define WINPR_CIPHER_AES_128_ECB 2 +#define WINPR_CIPHER_AES_192_ECB 3 +#define WINPR_CIPHER_AES_256_ECB 4 +#define WINPR_CIPHER_AES_128_CBC 5 +#define WINPR_CIPHER_AES_192_CBC 6 +#define WINPR_CIPHER_AES_256_CBC 7 +#define WINPR_CIPHER_AES_128_CFB128 8 +#define WINPR_CIPHER_AES_192_CFB128 9 +#define WINPR_CIPHER_AES_256_CFB128 10 +#define WINPR_CIPHER_AES_128_CTR 11 +#define WINPR_CIPHER_AES_192_CTR 12 +#define WINPR_CIPHER_AES_256_CTR 13 +#define WINPR_CIPHER_AES_128_GCM 14 +#define WINPR_CIPHER_AES_192_GCM 15 +#define WINPR_CIPHER_AES_256_GCM 16 +#define WINPR_CIPHER_CAMELLIA_128_ECB 17 +#define WINPR_CIPHER_CAMELLIA_192_ECB 18 +#define WINPR_CIPHER_CAMELLIA_256_ECB 19 +#define WINPR_CIPHER_CAMELLIA_128_CBC 20 +#define WINPR_CIPHER_CAMELLIA_192_CBC 21 +#define WINPR_CIPHER_CAMELLIA_256_CBC 22 +#define WINPR_CIPHER_CAMELLIA_128_CFB128 23 +#define WINPR_CIPHER_CAMELLIA_192_CFB128 24 +#define WINPR_CIPHER_CAMELLIA_256_CFB128 25 +#define WINPR_CIPHER_CAMELLIA_128_CTR 26 +#define WINPR_CIPHER_CAMELLIA_192_CTR 27 +#define WINPR_CIPHER_CAMELLIA_256_CTR 28 +#define WINPR_CIPHER_CAMELLIA_128_GCM 29 +#define WINPR_CIPHER_CAMELLIA_192_GCM 30 +#define WINPR_CIPHER_CAMELLIA_256_GCM 31 +#define WINPR_CIPHER_DES_ECB 32 +#define WINPR_CIPHER_DES_CBC 33 +#define WINPR_CIPHER_DES_EDE_ECB 34 +#define WINPR_CIPHER_DES_EDE_CBC 35 +#define WINPR_CIPHER_DES_EDE3_ECB 36 +#define WINPR_CIPHER_DES_EDE3_CBC 37 +#define WINPR_CIPHER_BLOWFISH_ECB 38 +#define WINPR_CIPHER_BLOWFISH_CBC 39 +#define WINPR_CIPHER_BLOWFISH_CFB64 40 +#define WINPR_CIPHER_BLOWFISH_CTR 41 +#define WINPR_CIPHER_ARC4_128 42 +#define WINPR_CIPHER_AES_128_CCM 43 +#define WINPR_CIPHER_AES_192_CCM 44 +#define WINPR_CIPHER_AES_256_CCM 45 +#define WINPR_CIPHER_CAMELLIA_128_CCM 46 +#define WINPR_CIPHER_CAMELLIA_192_CCM 47 +#define WINPR_CIPHER_CAMELLIA_256_CCM 48 typedef struct _winpr_cipher_ctx_private_st WINPR_CIPHER_CTX; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API WINPR_CIPHER_CTX* winpr_Cipher_New(int cipher, int op, const BYTE* key, const BYTE* iv); -WINPR_API BOOL winpr_Cipher_Update(WINPR_CIPHER_CTX* ctx, const BYTE* input, size_t ilen, BYTE* output, size_t* olen); -WINPR_API BOOL winpr_Cipher_Final(WINPR_CIPHER_CTX* ctx, BYTE* output, size_t* olen); -WINPR_API void winpr_Cipher_Free(WINPR_CIPHER_CTX* ctx); + WINPR_API WINPR_CIPHER_CTX* winpr_Cipher_New(int cipher, int op, const BYTE* key, + const BYTE* iv); + WINPR_API BOOL winpr_Cipher_Update(WINPR_CIPHER_CTX* ctx, const BYTE* input, size_t ilen, + BYTE* output, size_t* olen); + WINPR_API BOOL winpr_Cipher_Final(WINPR_CIPHER_CTX* ctx, BYTE* output, size_t* olen); + WINPR_API void winpr_Cipher_Free(WINPR_CIPHER_CTX* ctx); #ifdef __cplusplus } @@ -793,10 +815,12 @@ WINPR_API void winpr_Cipher_Free(WINPR_CIPHER_CTX* ctx); */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API int winpr_Cipher_BytesToKey(int cipher, int md, const BYTE* salt, const BYTE* data, int datal, int count, BYTE* key, BYTE* iv); + WINPR_API int winpr_Cipher_BytesToKey(int cipher, int md, const BYTE* salt, const BYTE* data, + int datal, int count, BYTE* key, BYTE* iv); #ifdef __cplusplus } diff --git a/winpr/include/winpr/debug.h b/winpr/include/winpr/debug.h index 45ed77817..43e6d2109 100644 --- a/winpr/include/winpr/debug.h +++ b/winpr/include/winpr/debug.h @@ -22,24 +22,24 @@ #define WINPR_DEBUG_H #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif #include #include #include -WINPR_API void winpr_log_backtrace(const char* tag, DWORD level, DWORD size); -WINPR_API void winpr_log_backtrace_ex(wLog* log, DWORD level, DWORD size); -WINPR_API void* winpr_backtrace(DWORD size); -WINPR_API void winpr_backtrace_free(void* buffer); -WINPR_API char** winpr_backtrace_symbols(void* buffer, size_t* used); -WINPR_API void winpr_backtrace_symbols_fd(void* buffer, int fd); -WINPR_API char* winpr_strerror(DWORD dw, char* dmsg, size_t size); + WINPR_API void winpr_log_backtrace(const char* tag, DWORD level, DWORD size); + WINPR_API void winpr_log_backtrace_ex(wLog* log, DWORD level, DWORD size); + WINPR_API void* winpr_backtrace(DWORD size); + WINPR_API void winpr_backtrace_free(void* buffer); + WINPR_API char** winpr_backtrace_symbols(void* buffer, size_t* used); + WINPR_API void winpr_backtrace_symbols_fd(void* buffer, int fd); + WINPR_API char* winpr_strerror(DWORD dw, char* dmsg, size_t size); #ifdef __cplusplus } #endif #endif /* WINPR_WLOG_H */ - diff --git a/winpr/include/winpr/dsparse.h b/winpr/include/winpr/dsparse.h index f93afeed6..253f6286b 100644 --- a/winpr/include/winpr/dsparse.h +++ b/winpr/include/winpr/dsparse.h @@ -35,7 +35,7 @@ #include typedef enum -{ +{ DS_NAME_NO_FLAGS = 0x0, DS_NAME_FLAG_SYNTACTICAL_ONLY = 0x1, DS_NAME_FLAG_EVAL_AT_DC = 0x2, @@ -44,7 +44,7 @@ typedef enum } DS_NAME_FLAGS; typedef enum -{ +{ DS_UNKNOWN_NAME = 0, DS_FQDN_1779_NAME = 1, DS_NT4_ACCOUNT_NAME = 2, @@ -59,7 +59,7 @@ typedef enum } DS_NAME_FORMAT; typedef enum -{ +{ DS_NAME_NO_ERROR = 0, DS_NAME_ERROR_RESOLVING = 1, DS_NAME_ERROR_NOT_FOUND = 2, @@ -94,35 +94,40 @@ typedef struct } DS_NAME_RESULT, *PDS_NAME_RESULT; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API DWORD DsCrackSpnW(LPCWSTR pszSpn, DWORD* pcServiceClass, LPWSTR ServiceClass, DWORD* pcServiceName, - LPWSTR ServiceName, DWORD* pcInstanceName, LPWSTR InstanceName, USHORT* pInstancePort); + WINPR_API DWORD DsCrackSpnW(LPCWSTR pszSpn, DWORD* pcServiceClass, LPWSTR ServiceClass, + DWORD* pcServiceName, LPWSTR ServiceName, DWORD* pcInstanceName, + LPWSTR InstanceName, USHORT* pInstancePort); -WINPR_API DWORD DsCrackSpnA(LPCSTR pszSpn, LPDWORD pcServiceClass, LPSTR ServiceClass, LPDWORD pcServiceName, - LPSTR ServiceName, LPDWORD pcInstanceName, LPSTR InstanceName, USHORT* pInstancePort); + WINPR_API DWORD DsCrackSpnA(LPCSTR pszSpn, LPDWORD pcServiceClass, LPSTR ServiceClass, + LPDWORD pcServiceName, LPSTR ServiceName, LPDWORD pcInstanceName, + LPSTR InstanceName, USHORT* pInstancePort); #ifdef UNICODE -#define DsCrackSpn DsCrackSpnW +#define DsCrackSpn DsCrackSpnW #else -#define DsCrackSpn DsCrackSpnA +#define DsCrackSpn DsCrackSpnA #endif -WINPR_API DWORD DsMakeSpnW(LPCWSTR ServiceClass, LPCWSTR ServiceName, LPCWSTR InstanceName, - USHORT InstancePort, LPCWSTR Referrer, DWORD* pcSpnLength, LPWSTR pszSpn); + WINPR_API DWORD DsMakeSpnW(LPCWSTR ServiceClass, LPCWSTR ServiceName, LPCWSTR InstanceName, + USHORT InstancePort, LPCWSTR Referrer, DWORD* pcSpnLength, + LPWSTR pszSpn); -WINPR_API DWORD DsMakeSpnA(LPCSTR ServiceClass, LPCSTR ServiceName, LPCSTR InstanceName, - USHORT InstancePort, LPCSTR Referrer, DWORD* pcSpnLength, LPSTR pszSpn); + WINPR_API DWORD DsMakeSpnA(LPCSTR ServiceClass, LPCSTR ServiceName, LPCSTR InstanceName, + USHORT InstancePort, LPCSTR Referrer, DWORD* pcSpnLength, + LPSTR pszSpn); #ifdef __cplusplus } #endif #ifdef UNICODE -#define DsMakeSpn DsMakeSpnW +#define DsMakeSpn DsMakeSpnW #else -#define DsMakeSpn DsMakeSpnA +#define DsMakeSpn DsMakeSpnA #endif #endif diff --git a/winpr/include/winpr/endian.h b/winpr/include/winpr/endian.h index 445c1840f..bd3a38328 100644 --- a/winpr/include/winpr/endian.h +++ b/winpr/include/winpr/endian.h @@ -25,105 +25,150 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -#define Data_Read_UINT8_NE(_d, _v) do { _v = \ - *((const BYTE*) _d); } while (0) - -#define Data_Read_UINT8(_d, _v) do { _v = \ - *((const BYTE*) _d); } while (0) - -#define Data_Read_UINT16_NE(_d, _v) do { _v = \ - *((const UINT16*) _d); } while (0) - -#define Data_Read_UINT16(_d, _v) do { _v = \ - (UINT16)(*((const BYTE*) _d)) + \ - (UINT16)(((UINT16)(*((const BYTE*) _d + 1))) << 8); \ -} while (0) - -#define Data_Read_UINT16_BE(_d, _v) do { _v = \ - (((UINT16)(*(const BYTE*) _d)) << 8) + \ - (UINT16)(*((const BYTE*) _d + 1)); \ -} while (0) - -#define Data_Read_UINT32_NE(_d, _v) do { _v = \ - *((UINT32*) _d); } while (0) - -#define Data_Read_UINT32(_d, _v) do { _v = \ - (UINT32)(*((const BYTE*) _d)) + \ - (((UINT32)(*((const BYTE*) _d + 1))) << 8) + \ - (((UINT32)(*((const BYTE*) _d + 2))) << 16) + \ - (((UINT32)(*((const BYTE*) _d + 3))) << 24); \ -} while (0) - -#define Data_Read_UINT32_BE(_d, _v) do { _v = \ - (((UINT32)(*((const BYTE*) _d))) << 24) + \ - (((UINT32)(*((const BYTE*) _d + 1))) << 16) + \ - (((UINT32)(*((const BYTE*) _d + 2))) << 8) + \ - (((UINT32)(*((const BYTE*) _d + 3)))); \ -} while (0) - -#define Data_Read_UINT64_NE(_d, _v) do { _v = \ - *((UINT64*) _d); } while (0) - -#define Data_Read_UINT64(_d, _v) do { _v = \ - (UINT64)(*((const BYTE*) _d)) + \ - (((UINT64)(*((const BYTE*) _d + 1))) << 8) + \ - (((UINT64)(*((const BYTE*) _d + 2))) << 16) + \ - (((UINT64)(*((const BYTE*) _d + 3))) << 24) + \ - (((UINT64)(*((const BYTE*) _d + 4))) << 32) + \ - (((UINT64)(*((const BYTE*) _d + 5))) << 40) + \ - (((UINT64)(*((const BYTE*) _d + 6))) << 48) + \ - (((UINT64)(*((const BYTE*) _d + 7))) << 56); \ -} while (0) - -#define Data_Write_UINT8_NE(_d, _v) do { \ - *((UINT8*) _d) = v; } while (0) - -#define Data_Write_UINT8(_d, _v) do { \ - *_d = (UINT8)(_v); } while (0) - -#define Data_Write_UINT16_NE(_d, _v) do { \ - *((UINT16*) _d) = _v; } while (0) - -#define Data_Write_UINT16(_d, _v) do { \ - *((BYTE*) _d) = (_v) & 0xFF; \ - *((BYTE*) _d + 1) = ((_v) >> 8) & 0xFF; \ +#define Data_Read_UINT8_NE(_d, _v) \ + do \ + { \ + _v = *((const BYTE*)_d); \ } while (0) -#define Data_Write_UINT16_BE(_d, _v) do { \ - *((BYTE*) _d) = ((_v) >> 8) & 0xFF; \ - *((BYTE*) _d + 1) = (_v) & 0xFF; \ +#define Data_Read_UINT8(_d, _v) \ + do \ + { \ + _v = *((const BYTE*)_d); \ } while (0) -#define Data_Write_UINT32_NE(_d, _v) do { \ - *((UINT32*) _d) = _v; } while (0) - -#define Data_Write_UINT32(_d, _v) do { \ - *((BYTE*) _d) = (_v) & 0xFF; \ - *((BYTE*) _d + 1) = ((_v) >> 8) & 0xFF; \ - *((BYTE*) _d + 2) = ((_v) >> 16) & 0xFF; \ - *((BYTE*) _d + 3) = ((_v) >> 24) & 0xFF; \ +#define Data_Read_UINT16_NE(_d, _v) \ + do \ + { \ + _v = *((const UINT16*)_d); \ } while (0) -#define Data_Write_UINT32_BE(_d, _v) do { \ - Data_Write_UINT16_BE((BYTE*) _d, ((_v) >> 16 & 0xFFFF)); \ - Data_Write_UINT16_BE((BYTE*) _d + 2, ((_v) & 0xFFFF)); \ +#define Data_Read_UINT16(_d, _v) \ + do \ + { \ + _v = (UINT16)(*((const BYTE*)_d)) + (UINT16)(((UINT16)(*((const BYTE*)_d + 1))) << 8); \ } while (0) -#define Data_Write_UINT64_NE(_d, _v) do { \ - *((UINT64*) _d) = _v; } while (0) +#define Data_Read_UINT16_BE(_d, _v) \ + do \ + { \ + _v = (((UINT16)(*(const BYTE*)_d)) << 8) + (UINT16)(*((const BYTE*)_d + 1)); \ + } while (0) -#define Data_Write_UINT64(_d, _v) do { \ - *((BYTE*) _d) = (UINT64)(_v) & 0xFF; \ - *((BYTE*) _d + 1) = ((UINT64)(_v) >> 8) & 0xFF; \ - *((BYTE*) _d + 2) = ((UINT64)(_v) >> 16) & 0xFF; \ - *((BYTE*) _d + 3) = ((UINT64)(_v) >> 24) & 0xFF; \ - *((BYTE*) _d + 4) = ((UINT64)(_v) >> 32) & 0xFF; \ - *((BYTE*) _d + 5) = ((UINT64)(_v) >> 40) & 0xFF; \ - *((BYTE*) _d + 6) = ((UINT64)(_v) >> 48) & 0xFF; \ - *((BYTE*) _d + 7) = ((UINT64)(_v) >> 56) & 0xFF; \ +#define Data_Read_UINT32_NE(_d, _v) \ + do \ + { \ + _v = *((UINT32*)_d); \ + } while (0) + +#define Data_Read_UINT32(_d, _v) \ + do \ + { \ + _v = (UINT32)(*((const BYTE*)_d)) + (((UINT32)(*((const BYTE*)_d + 1))) << 8) + \ + (((UINT32)(*((const BYTE*)_d + 2))) << 16) + \ + (((UINT32)(*((const BYTE*)_d + 3))) << 24); \ + } while (0) + +#define Data_Read_UINT32_BE(_d, _v) \ + do \ + { \ + _v = (((UINT32)(*((const BYTE*)_d))) << 24) + (((UINT32)(*((const BYTE*)_d + 1))) << 16) + \ + (((UINT32)(*((const BYTE*)_d + 2))) << 8) + (((UINT32)(*((const BYTE*)_d + 3)))); \ + } while (0) + +#define Data_Read_UINT64_NE(_d, _v) \ + do \ + { \ + _v = *((UINT64*)_d); \ + } while (0) + +#define Data_Read_UINT64(_d, _v) \ + do \ + { \ + _v = (UINT64)(*((const BYTE*)_d)) + (((UINT64)(*((const BYTE*)_d + 1))) << 8) + \ + (((UINT64)(*((const BYTE*)_d + 2))) << 16) + \ + (((UINT64)(*((const BYTE*)_d + 3))) << 24) + \ + (((UINT64)(*((const BYTE*)_d + 4))) << 32) + \ + (((UINT64)(*((const BYTE*)_d + 5))) << 40) + \ + (((UINT64)(*((const BYTE*)_d + 6))) << 48) + \ + (((UINT64)(*((const BYTE*)_d + 7))) << 56); \ + } while (0) + +#define Data_Write_UINT8_NE(_d, _v) \ + do \ + { \ + *((UINT8*)_d) = v; \ + } while (0) + +#define Data_Write_UINT8(_d, _v) \ + do \ + { \ + *_d = (UINT8)(_v); \ + } while (0) + +#define Data_Write_UINT16_NE(_d, _v) \ + do \ + { \ + *((UINT16*)_d) = _v; \ + } while (0) + +#define Data_Write_UINT16(_d, _v) \ + do \ + { \ + *((BYTE*)_d) = (_v)&0xFF; \ + *((BYTE*)_d + 1) = ((_v) >> 8) & 0xFF; \ + } while (0) + +#define Data_Write_UINT16_BE(_d, _v) \ + do \ + { \ + *((BYTE*)_d) = ((_v) >> 8) & 0xFF; \ + *((BYTE*)_d + 1) = (_v)&0xFF; \ + } while (0) + +#define Data_Write_UINT32_NE(_d, _v) \ + do \ + { \ + *((UINT32*)_d) = _v; \ + } while (0) + +#define Data_Write_UINT32(_d, _v) \ + do \ + { \ + *((BYTE*)_d) = (_v)&0xFF; \ + *((BYTE*)_d + 1) = ((_v) >> 8) & 0xFF; \ + *((BYTE*)_d + 2) = ((_v) >> 16) & 0xFF; \ + *((BYTE*)_d + 3) = ((_v) >> 24) & 0xFF; \ + } while (0) + +#define Data_Write_UINT32_BE(_d, _v) \ + do \ + { \ + Data_Write_UINT16_BE((BYTE*)_d, ((_v) >> 16 & 0xFFFF)); \ + Data_Write_UINT16_BE((BYTE*)_d + 2, ((_v)&0xFFFF)); \ + } while (0) + +#define Data_Write_UINT64_NE(_d, _v) \ + do \ + { \ + *((UINT64*)_d) = _v; \ + } while (0) + +#define Data_Write_UINT64(_d, _v) \ + do \ + { \ + *((BYTE*)_d) = (UINT64)(_v)&0xFF; \ + *((BYTE*)_d + 1) = ((UINT64)(_v) >> 8) & 0xFF; \ + *((BYTE*)_d + 2) = ((UINT64)(_v) >> 16) & 0xFF; \ + *((BYTE*)_d + 3) = ((UINT64)(_v) >> 24) & 0xFF; \ + *((BYTE*)_d + 4) = ((UINT64)(_v) >> 32) & 0xFF; \ + *((BYTE*)_d + 5) = ((UINT64)(_v) >> 40) & 0xFF; \ + *((BYTE*)_d + 6) = ((UINT64)(_v) >> 48) & 0xFF; \ + *((BYTE*)_d + 7) = ((UINT64)(_v) >> 56) & 0xFF; \ } while (0) #ifdef __cplusplus diff --git a/winpr/include/winpr/environment.h b/winpr/include/winpr/environment.h index d3205ca42..21c9c8f0f 100644 --- a/winpr/include/winpr/environment.h +++ b/winpr/include/winpr/environment.h @@ -28,40 +28,43 @@ #ifndef _WIN32 #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API DWORD GetCurrentDirectoryA(DWORD nBufferLength, LPSTR lpBuffer); -WINPR_API DWORD GetCurrentDirectoryW(DWORD nBufferLength, LPWSTR lpBuffer); + WINPR_API DWORD GetCurrentDirectoryA(DWORD nBufferLength, LPSTR lpBuffer); + WINPR_API DWORD GetCurrentDirectoryW(DWORD nBufferLength, LPWSTR lpBuffer); -WINPR_API BOOL SetCurrentDirectoryA(LPCSTR lpPathName); -WINPR_API BOOL SetCurrentDirectoryW(LPCWSTR lpPathName); + WINPR_API BOOL SetCurrentDirectoryA(LPCSTR lpPathName); + WINPR_API BOOL SetCurrentDirectoryW(LPCWSTR lpPathName); -WINPR_API DWORD SearchPathA(LPCSTR lpPath, LPCSTR lpFileName, LPCSTR lpExtension, DWORD nBufferLength, LPSTR lpBuffer, LPSTR* lpFilePart); -WINPR_API DWORD SearchPathW(LPCWSTR lpPath, LPCWSTR lpFileName, LPCWSTR lpExtension, DWORD nBufferLength, LPWSTR lpBuffer, LPWSTR* lpFilePart); + WINPR_API DWORD SearchPathA(LPCSTR lpPath, LPCSTR lpFileName, LPCSTR lpExtension, + DWORD nBufferLength, LPSTR lpBuffer, LPSTR* lpFilePart); + WINPR_API DWORD SearchPathW(LPCWSTR lpPath, LPCWSTR lpFileName, LPCWSTR lpExtension, + DWORD nBufferLength, LPWSTR lpBuffer, LPWSTR* lpFilePart); -WINPR_API LPSTR GetCommandLineA(VOID); -WINPR_API LPWSTR GetCommandLineW(VOID); + WINPR_API LPSTR GetCommandLineA(VOID); + WINPR_API LPWSTR GetCommandLineW(VOID); -WINPR_API BOOL NeedCurrentDirectoryForExePathA(LPCSTR ExeName); -WINPR_API BOOL NeedCurrentDirectoryForExePathW(LPCWSTR ExeName); + WINPR_API BOOL NeedCurrentDirectoryForExePathA(LPCSTR ExeName); + WINPR_API BOOL NeedCurrentDirectoryForExePathW(LPCWSTR ExeName); #ifdef __cplusplus } #endif #ifdef UNICODE -#define GetCurrentDirectory GetCurrentDirectoryW -#define SetCurrentDirectory SetCurrentDirectoryW -#define SearchPath SearchPathW -#define GetCommandLine GetCommandLineW -#define NeedCurrentDirectoryForExePath NeedCurrentDirectoryForExePathW +#define GetCurrentDirectory GetCurrentDirectoryW +#define SetCurrentDirectory SetCurrentDirectoryW +#define SearchPath SearchPathW +#define GetCommandLine GetCommandLineW +#define NeedCurrentDirectoryForExePath NeedCurrentDirectoryForExePathW #else -#define GetCurrentDirectory GetCurrentDirectoryA -#define SetCurrentDirectory SetCurrentDirectoryA -#define SearchPath SearchPathA -#define GetCommandLine GetCommandLineA -#define NeedCurrentDirectoryForExePath NeedCurrentDirectoryForExePathA +#define GetCurrentDirectory GetCurrentDirectoryA +#define SetCurrentDirectory SetCurrentDirectoryA +#define SearchPath SearchPathA +#define GetCommandLine GetCommandLineA +#define NeedCurrentDirectoryForExePath NeedCurrentDirectoryForExePathA #endif #endif @@ -69,68 +72,70 @@ WINPR_API BOOL NeedCurrentDirectoryForExePathW(LPCWSTR ExeName); #if !defined(_WIN32) || defined(_UWP) #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API DWORD GetEnvironmentVariableA(LPCSTR lpName, LPSTR lpBuffer, DWORD nSize); -WINPR_API DWORD GetEnvironmentVariableW(LPCWSTR lpName, LPWSTR lpBuffer, DWORD nSize); + WINPR_API DWORD GetEnvironmentVariableA(LPCSTR lpName, LPSTR lpBuffer, DWORD nSize); + WINPR_API DWORD GetEnvironmentVariableW(LPCWSTR lpName, LPWSTR lpBuffer, DWORD nSize); -WINPR_API BOOL SetEnvironmentVariableA(LPCSTR lpName, LPCSTR lpValue); -WINPR_API BOOL SetEnvironmentVariableW(LPCWSTR lpName, LPCWSTR lpValue); + WINPR_API BOOL SetEnvironmentVariableA(LPCSTR lpName, LPCSTR lpValue); + WINPR_API BOOL SetEnvironmentVariableW(LPCWSTR lpName, LPCWSTR lpValue); -/** - * A brief history of the GetEnvironmentStrings functions: - * http://blogs.msdn.com/b/oldnewthing/archive/2013/01/17/10385718.aspx - */ + /** + * A brief history of the GetEnvironmentStrings functions: + * http://blogs.msdn.com/b/oldnewthing/archive/2013/01/17/10385718.aspx + */ -WINPR_API LPCH GetEnvironmentStrings(VOID); -WINPR_API LPWCH GetEnvironmentStringsW(VOID); + WINPR_API LPCH GetEnvironmentStrings(VOID); + WINPR_API LPWCH GetEnvironmentStringsW(VOID); -WINPR_API BOOL SetEnvironmentStringsA(LPCH NewEnvironment); -WINPR_API BOOL SetEnvironmentStringsW(LPWCH NewEnvironment); + WINPR_API BOOL SetEnvironmentStringsA(LPCH NewEnvironment); + WINPR_API BOOL SetEnvironmentStringsW(LPWCH NewEnvironment); -WINPR_API DWORD ExpandEnvironmentStringsA(LPCSTR lpSrc, LPSTR lpDst, DWORD nSize); -WINPR_API DWORD ExpandEnvironmentStringsW(LPCWSTR lpSrc, LPWSTR lpDst, DWORD nSize); + WINPR_API DWORD ExpandEnvironmentStringsA(LPCSTR lpSrc, LPSTR lpDst, DWORD nSize); + WINPR_API DWORD ExpandEnvironmentStringsW(LPCWSTR lpSrc, LPWSTR lpDst, DWORD nSize); -WINPR_API BOOL FreeEnvironmentStringsA(LPCH lpszEnvironmentBlock); -WINPR_API BOOL FreeEnvironmentStringsW(LPWCH lpszEnvironmentBlock); + WINPR_API BOOL FreeEnvironmentStringsA(LPCH lpszEnvironmentBlock); + WINPR_API BOOL FreeEnvironmentStringsW(LPWCH lpszEnvironmentBlock); #ifdef __cplusplus } #endif #ifdef UNICODE -#define GetEnvironmentVariable GetEnvironmentVariableW -#define SetEnvironmentVariable SetEnvironmentVariableW -#define GetEnvironmentStrings GetEnvironmentStringsW -#define SetEnvironmentStrings SetEnvironmentStringsW -#define ExpandEnvironmentStrings ExpandEnvironmentStringsW -#define FreeEnvironmentStrings FreeEnvironmentStringsW +#define GetEnvironmentVariable GetEnvironmentVariableW +#define SetEnvironmentVariable SetEnvironmentVariableW +#define GetEnvironmentStrings GetEnvironmentStringsW +#define SetEnvironmentStrings SetEnvironmentStringsW +#define ExpandEnvironmentStrings ExpandEnvironmentStringsW +#define FreeEnvironmentStrings FreeEnvironmentStringsW #else -#define GetEnvironmentVariable GetEnvironmentVariableA -#define SetEnvironmentVariable SetEnvironmentVariableA -#define GetEnvironmentStringsA GetEnvironmentStrings -#define SetEnvironmentStrings SetEnvironmentStringsA -#define ExpandEnvironmentStrings ExpandEnvironmentStringsA -#define FreeEnvironmentStrings FreeEnvironmentStringsA +#define GetEnvironmentVariable GetEnvironmentVariableA +#define SetEnvironmentVariable SetEnvironmentVariableA +#define GetEnvironmentStringsA GetEnvironmentStrings +#define SetEnvironmentStrings SetEnvironmentStringsA +#define ExpandEnvironmentStrings ExpandEnvironmentStringsA +#define FreeEnvironmentStrings FreeEnvironmentStringsA #endif #endif #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API LPCH MergeEnvironmentStrings(PCSTR original, PCSTR merge); + WINPR_API LPCH MergeEnvironmentStrings(PCSTR original, PCSTR merge); -WINPR_API DWORD GetEnvironmentVariableEBA(LPCSTR envBlock, LPCSTR lpName, LPSTR lpBuffer, DWORD nSize); -WINPR_API BOOL SetEnvironmentVariableEBA(LPSTR* envBlock, LPCSTR lpName, LPCSTR lpValue); + WINPR_API DWORD GetEnvironmentVariableEBA(LPCSTR envBlock, LPCSTR lpName, LPSTR lpBuffer, + DWORD nSize); + WINPR_API BOOL SetEnvironmentVariableEBA(LPSTR* envBlock, LPCSTR lpName, LPCSTR lpValue); -WINPR_API char** EnvironmentBlockToEnvpA(LPCH lpszEnvironmentBlock); + WINPR_API char** EnvironmentBlockToEnvpA(LPCH lpszEnvironmentBlock); #ifdef __cplusplus } #endif #endif /* WINPR_ENVIRONMENT_H */ - diff --git a/winpr/include/winpr/error.h b/winpr/include/winpr/error.h index d07aae780..1678ef6bd 100644 --- a/winpr/include/winpr/error.h +++ b/winpr/include/winpr/error.h @@ -30,2952 +30,2952 @@ #else #ifndef NO_ERROR -#define NO_ERROR 0 +#define NO_ERROR 0 #endif -#define E_UNEXPECTED (HRESULT)0x8000FFFFL -#define E_NOTIMPL (HRESULT)0x80004001L -#define E_OUTOFMEMORY (HRESULT)0x8007000EL -#define E_INVALIDARG (HRESULT)0x80070057L -#define E_NOINTERFACE (HRESULT)0x80004002L -#define E_POINTER (HRESULT)0x80004003L -#define E_HANDLE (HRESULT)0x80070006L -#define E_ABORT (HRESULT)0x80004004L -#define E_FAIL (HRESULT)0x80004005L -#define E_ACCESSDENIED (HRESULT)0x80070005L +#define E_UNEXPECTED (HRESULT)0x8000FFFFL +#define E_NOTIMPL (HRESULT)0x80004001L +#define E_OUTOFMEMORY (HRESULT)0x8007000EL +#define E_INVALIDARG (HRESULT)0x80070057L +#define E_NOINTERFACE (HRESULT)0x80004002L +#define E_POINTER (HRESULT)0x80004003L +#define E_HANDLE (HRESULT)0x80070006L +#define E_ABORT (HRESULT)0x80004004L +#define E_FAIL (HRESULT)0x80004005L +#define E_ACCESSDENIED (HRESULT)0x80070005L -#define CO_E_INIT_TLS 0x80004006 -#define CO_E_INIT_SHARED_ALLOCATOR 0x80004007 -#define CO_E_INIT_MEMORY_ALLOCATOR 0x80004008 -#define CO_E_INIT_CLASS_CACHE 0x80004009 -#define CO_E_INIT_RPC_CHANNEL 0x8000400A -#define CO_E_INIT_TLS_SET_CHANNEL_CONTROL 0x8000400B -#define CO_E_INIT_TLS_CHANNEL_CONTROL 0x8000400C -#define CO_E_INIT_UNACCEPTED_USER_ALLOCATOR 0x8000400D -#define CO_E_INIT_SCM_MUTEX_EXISTS 0x8000400E -#define CO_E_INIT_SCM_FILE_MAPPING_EXISTS 0x8000400F -#define CO_E_INIT_SCM_MAP_VIEW_OF_FILE 0x80004010 -#define CO_E_INIT_SCM_EXEC_FAILURE 0x80004011 -#define CO_E_INIT_ONLY_SINGLE_THREADED 0x80004012 -#define CO_E_CANT_REMOTE 0x80004013 -#define CO_E_BAD_SERVER_NAME 0x80004014 -#define CO_E_WRONG_SERVER_IDENTITY 0x80004015 -#define CO_E_OLE1DDE_DISABLED 0x80004016 -#define CO_E_RUNAS_SYNTAX 0x80004017 -#define CO_E_CREATEPROCESS_FAILURE 0x80004018 -#define CO_E_RUNAS_CREATEPROCESS_FAILURE 0x80004019 -#define CO_E_RUNAS_LOGON_FAILURE 0x8000401A -#define CO_E_LAUNCH_PERMSSION_DENIED 0x8000401B -#define CO_E_START_SERVICE_FAILURE 0x8000401C -#define CO_E_REMOTE_COMMUNICATION_FAILURE 0x8000401D -#define CO_E_SERVER_START_TIMEOUT 0x8000401E -#define CO_E_CLSREG_INCONSISTENT 0x8000401F -#define CO_E_IIDREG_INCONSISTENT 0x80004020 -#define CO_E_NOT_SUPPORTED 0x80004021 -#define CO_E_RELOAD_DLL 0x80004022 -#define CO_E_MSI_ERROR 0x80004023 -#define CO_E_ATTEMPT_TO_CREATE_OUTSIDE_CLIENT_CONTEXT 0x80004024 -#define CO_E_SERVER_PAUSED 0x80004025 -#define CO_E_SERVER_NOT_PAUSED 0x80004026 -#define CO_E_CLASS_DISABLED 0x80004027 -#define CO_E_CLRNOTAVAILABLE 0x80004028 -#define CO_E_ASYNC_WORK_REJECTED 0x80004029 -#define CO_E_SERVER_INIT_TIMEOUT 0x8000402A -#define CO_E_NO_SECCTX_IN_ACTIVATE 0x8000402B -#define CO_E_TRACKER_CONFIG 0x80004030 -#define CO_E_THREADPOOL_CONFIG 0x80004031 -#define CO_E_SXS_CONFIG 0x80004032 -#define CO_E_MALFORMED_SPN 0x80004033 +#define CO_E_INIT_TLS 0x80004006 +#define CO_E_INIT_SHARED_ALLOCATOR 0x80004007 +#define CO_E_INIT_MEMORY_ALLOCATOR 0x80004008 +#define CO_E_INIT_CLASS_CACHE 0x80004009 +#define CO_E_INIT_RPC_CHANNEL 0x8000400A +#define CO_E_INIT_TLS_SET_CHANNEL_CONTROL 0x8000400B +#define CO_E_INIT_TLS_CHANNEL_CONTROL 0x8000400C +#define CO_E_INIT_UNACCEPTED_USER_ALLOCATOR 0x8000400D +#define CO_E_INIT_SCM_MUTEX_EXISTS 0x8000400E +#define CO_E_INIT_SCM_FILE_MAPPING_EXISTS 0x8000400F +#define CO_E_INIT_SCM_MAP_VIEW_OF_FILE 0x80004010 +#define CO_E_INIT_SCM_EXEC_FAILURE 0x80004011 +#define CO_E_INIT_ONLY_SINGLE_THREADED 0x80004012 +#define CO_E_CANT_REMOTE 0x80004013 +#define CO_E_BAD_SERVER_NAME 0x80004014 +#define CO_E_WRONG_SERVER_IDENTITY 0x80004015 +#define CO_E_OLE1DDE_DISABLED 0x80004016 +#define CO_E_RUNAS_SYNTAX 0x80004017 +#define CO_E_CREATEPROCESS_FAILURE 0x80004018 +#define CO_E_RUNAS_CREATEPROCESS_FAILURE 0x80004019 +#define CO_E_RUNAS_LOGON_FAILURE 0x8000401A +#define CO_E_LAUNCH_PERMSSION_DENIED 0x8000401B +#define CO_E_START_SERVICE_FAILURE 0x8000401C +#define CO_E_REMOTE_COMMUNICATION_FAILURE 0x8000401D +#define CO_E_SERVER_START_TIMEOUT 0x8000401E +#define CO_E_CLSREG_INCONSISTENT 0x8000401F +#define CO_E_IIDREG_INCONSISTENT 0x80004020 +#define CO_E_NOT_SUPPORTED 0x80004021 +#define CO_E_RELOAD_DLL 0x80004022 +#define CO_E_MSI_ERROR 0x80004023 +#define CO_E_ATTEMPT_TO_CREATE_OUTSIDE_CLIENT_CONTEXT 0x80004024 +#define CO_E_SERVER_PAUSED 0x80004025 +#define CO_E_SERVER_NOT_PAUSED 0x80004026 +#define CO_E_CLASS_DISABLED 0x80004027 +#define CO_E_CLRNOTAVAILABLE 0x80004028 +#define CO_E_ASYNC_WORK_REJECTED 0x80004029 +#define CO_E_SERVER_INIT_TIMEOUT 0x8000402A +#define CO_E_NO_SECCTX_IN_ACTIVATE 0x8000402B +#define CO_E_TRACKER_CONFIG 0x80004030 +#define CO_E_THREADPOOL_CONFIG 0x80004031 +#define CO_E_SXS_CONFIG 0x80004032 +#define CO_E_MALFORMED_SPN 0x80004033 -#define FACILITY_WINDOWSUPDATE 36 -#define FACILITY_WINDOWS_CE 24 -#define FACILITY_WINDOWS 8 -#define FACILITY_URT 19 -#define FACILITY_UMI 22 -#define FACILITY_SXS 23 -#define FACILITY_STORAGE 3 -#define FACILITY_STATE_MANAGEMENT 34 -#define FACILITY_SSPI 9 -#define FACILITY_SCARD 16 -#define FACILITY_SETUPAPI 15 -#define FACILITY_SECURITY 9 -#define FACILITY_RPC 1 -#define FACILITY_WIN32 7 -#define FACILITY_CONTROL 10 -#define FACILITY_NULL 0 -#define FACILITY_METADIRECTORY 35 -#define FACILITY_MSMQ 14 -#define FACILITY_MEDIASERVER 13 -#define FACILITY_INTERNET 12 -#define FACILITY_ITF 4 -#define FACILITY_HTTP 25 -#define FACILITY_DPLAY 21 -#define FACILITY_DISPATCH 2 -#define FACILITY_DIRECTORYSERVICE 37 -#define FACILITY_CONFIGURATION 33 -#define FACILITY_COMPLUS 17 -#define FACILITY_CERT 11 -#define FACILITY_BACKGROUNDCOPY 32 -#define FACILITY_ACS 20 -#define FACILITY_AAF 18 +#define FACILITY_WINDOWSUPDATE 36 +#define FACILITY_WINDOWS_CE 24 +#define FACILITY_WINDOWS 8 +#define FACILITY_URT 19 +#define FACILITY_UMI 22 +#define FACILITY_SXS 23 +#define FACILITY_STORAGE 3 +#define FACILITY_STATE_MANAGEMENT 34 +#define FACILITY_SSPI 9 +#define FACILITY_SCARD 16 +#define FACILITY_SETUPAPI 15 +#define FACILITY_SECURITY 9 +#define FACILITY_RPC 1 +#define FACILITY_WIN32 7 +#define FACILITY_CONTROL 10 +#define FACILITY_NULL 0 +#define FACILITY_METADIRECTORY 35 +#define FACILITY_MSMQ 14 +#define FACILITY_MEDIASERVER 13 +#define FACILITY_INTERNET 12 +#define FACILITY_ITF 4 +#define FACILITY_HTTP 25 +#define FACILITY_DPLAY 21 +#define FACILITY_DISPATCH 2 +#define FACILITY_DIRECTORYSERVICE 37 +#define FACILITY_CONFIGURATION 33 +#define FACILITY_COMPLUS 17 +#define FACILITY_CERT 11 +#define FACILITY_BACKGROUNDCOPY 32 +#define FACILITY_ACS 20 +#define FACILITY_AAF 18 -#define FACILITY_NT_BIT 0x10000000 +#define FACILITY_NT_BIT 0x10000000 -#define SEVERITY_SUCCESS 0 -#define SEVERITY_ERROR 1 +#define SEVERITY_SUCCESS 0 +#define SEVERITY_ERROR 1 -#define HRESULT_CODE(hr) ((hr) & 0xFFFF) -#define HRESULT_FACILITY(hr) (((hr) >> 16) & 0x1FFF) +#define HRESULT_CODE(hr) ((hr)&0xFFFF) +#define HRESULT_FACILITY(hr) (((hr) >> 16) & 0x1FFF) -#define HRESULT_FROM_NT(x) ((HRESULT) ((x) | FACILITY_NT_BIT)) +#define HRESULT_FROM_NT(x) ((HRESULT)((x) | FACILITY_NT_BIT)) -#define __HRESULT_FROM_WIN32(x) ((HRESULT) (x) <= 0 ? ((HRESULT) (x)) : \ - ((HRESULT) (((x) & 0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000))) -#define HRESULT_FROM_WIN32(x) __HRESULT_FROM_WIN32(x) +#define __HRESULT_FROM_WIN32(x) \ + ((HRESULT)(x) <= 0 ? ((HRESULT)(x)) \ + : ((HRESULT)(((x)&0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000))) +#define HRESULT_FROM_WIN32(x) __HRESULT_FROM_WIN32(x) -#define HRESULT_SEVERITY(hr) (((hr) >> 31) & 0x1) +#define HRESULT_SEVERITY(hr) (((hr) >> 31) & 0x1) -#define SUCCEEDED(hr) (((HRESULT) (hr)) >= 0) -#define FAILED(hr) (((HRESULT) (hr)) < 0) -#define IS_ERROR(Status) (((unsigned long) (Status)) >> 31 == SEVERITY_ERROR) +#define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0) +#define FAILED(hr) (((HRESULT)(hr)) < 0) +#define IS_ERROR(Status) (((unsigned long)(Status)) >> 31 == SEVERITY_ERROR) #define MAKE_HRESULT(sev, fac, code) \ - ((HRESULT) (((unsigned long) (sev) << 31) | ((unsigned long) (fac) << 16) | ((unsigned long) (code))) + ((HRESULT) (((unsigned long) (sev) << 31) | ((unsigned long) (fac) << 16) | ((unsigned long) (code))) -#define SCODE_CODE(sc) ((sc) & 0xFFFF) -#define SCODE_FACILITY(sc) (((sc) >> 16) & 0x1FFF) -#define SCODE_SEVERITY(sc) (((sc) >> 31) & 0x1) +#define SCODE_CODE(sc) ((sc)&0xFFFF) +#define SCODE_FACILITY(sc) (((sc) >> 16) & 0x1FFF) +#define SCODE_SEVERITY(sc) (((sc) >> 31) & 0x1) -#define MAKE_SCODE(sev,fac,code) \ - ((SCODE) (((unsigned long) (sev) << 31) | ((unsigned long) (fac) << 16) | ((unsigned long) (code)))) +#define MAKE_SCODE(sev, fac, code) \ + ((SCODE)(((unsigned long)(sev) << 31) | ((unsigned long)(fac) << 16) | ((unsigned long)(code)))) -#define S_OK ((HRESULT) 0L) -#define S_FALSE ((HRESULT) 1L) +#define S_OK ((HRESULT)0L) +#define S_FALSE ((HRESULT)1L) /* System Error Codes (0-499) */ -#define ERROR_SUCCESS 0x00000000 -#define ERROR_INVALID_FUNCTION 0x00000001 -#define ERROR_FILE_NOT_FOUND 0x00000002 -#define ERROR_PATH_NOT_FOUND 0x00000003 -#define ERROR_TOO_MANY_OPEN_FILES 0x00000004 -#define ERROR_ACCESS_DENIED 0x00000005 -#define ERROR_INVALID_HANDLE 0x00000006 -#define ERROR_ARENA_TRASHED 0x00000007 -#define ERROR_NOT_ENOUGH_MEMORY 0x00000008 -#define ERROR_INVALID_BLOCK 0x00000009 -#define ERROR_BAD_ENVIRONMENT 0x0000000A -#define ERROR_BAD_FORMAT 0x0000000B -#define ERROR_INVALID_ACCESS 0x0000000C -#define ERROR_INVALID_DATA 0x0000000D -#define ERROR_OUTOFMEMORY 0x0000000E -#define ERROR_INVALID_DRIVE 0x0000000F -#define ERROR_CURRENT_DIRECTORY 0x00000010 -#define ERROR_NOT_SAME_DEVICE 0x00000011 -#define ERROR_NO_MORE_FILES 0x00000012 -#define ERROR_WRITE_PROTECT 0x00000013 -#define ERROR_BAD_UNIT 0x00000014 -#define ERROR_NOT_READY 0x00000015 -#define ERROR_BAD_COMMAND 0x00000016 -#define ERROR_CRC 0x00000017 -#define ERROR_BAD_LENGTH 0x00000018 -#define ERROR_SEEK 0x00000019 -#define ERROR_NOT_DOS_DISK 0x0000001A -#define ERROR_SECTOR_NOT_FOUND 0x0000001B -#define ERROR_OUT_OF_PAPER 0x0000001C -#define ERROR_WRITE_FAULT 0x0000001D -#define ERROR_READ_FAULT 0x0000001E -#define ERROR_GEN_FAILURE 0x0000001F -#define ERROR_SHARING_VIOLATION 0x00000020 -#define ERROR_LOCK_VIOLATION 0x00000021 -#define ERROR_WRONG_DISK 0x00000022 -#define ERROR_SHARING_BUFFER_EXCEEDED 0x00000024 -#define ERROR_HANDLE_EOF 0x00000026 -#define ERROR_HANDLE_DISK_FULL 0x00000027 -#define ERROR_NOT_SUPPORTED 0x00000032 -#define ERROR_REM_NOT_LIST 0x00000033 -#define ERROR_DUP_NAME 0x00000034 -#define ERROR_BAD_NETPATH 0x00000035 -#define ERROR_NETWORK_BUSY 0x00000036 -#define ERROR_DEV_NOT_EXIST 0x00000037 -#define ERROR_TOO_MANY_CMDS 0x00000038 -#define ERROR_ADAP_HDW_ERR 0x00000039 -#define ERROR_BAD_NET_RESP 0x0000003A -#define ERROR_UNEXP_NET_ERR 0x0000003B -#define ERROR_BAD_REM_ADAP 0x0000003C -#define ERROR_PRINTQ_FULL 0x0000003D -#define ERROR_NO_SPOOL_SPACE 0x0000003E -#define ERROR_PRINT_CANCELLED 0x0000003F -#define ERROR_NETNAME_DELETED 0x00000040 -#define ERROR_NETWORK_ACCESS_DENIED 0x00000041 -#define ERROR_BAD_DEV_TYPE 0x00000042 -#define ERROR_BAD_NET_NAME 0x00000043 -#define ERROR_TOO_MANY_NAMES 0x00000044 -#define ERROR_TOO_MANY_SESS 0x00000045 -#define ERROR_SHARING_PAUSED 0x00000046 -#define ERROR_REQ_NOT_ACCEP 0x00000047 -#define ERROR_REDIR_PAUSED 0x00000048 -#define ERROR_FILE_EXISTS 0x00000050 -#define ERROR_CANNOT_MAKE 0x00000052 -#define ERROR_FAIL_I24 0x00000053 -#define ERROR_OUT_OF_STRUCTURES 0x00000054 -#define ERROR_ALREADY_ASSIGNED 0x00000055 -#define ERROR_INVALID_PASSWORD 0x00000056 -#define ERROR_INVALID_PARAMETER 0x00000057 -#define ERROR_NET_WRITE_FAULT 0x00000058 -#define ERROR_NO_PROC_SLOTS 0x00000059 -#define ERROR_TOO_MANY_SEMAPHORES 0x00000064 -#define ERROR_EXCL_SEM_ALREADY_OWNED 0x00000065 -#define ERROR_SEM_IS_SET 0x00000066 -#define ERROR_TOO_MANY_SEM_REQUESTS 0x00000067 -#define ERROR_INVALID_AT_INTERRUPT_TIME 0x00000068 -#define ERROR_SEM_OWNER_DIED 0x00000069 -#define ERROR_SEM_USER_LIMIT 0x0000006A -#define ERROR_DISK_CHANGE 0x0000006B -#define ERROR_DRIVE_LOCKED 0x0000006C -#define ERROR_BROKEN_PIPE 0x0000006D -#define ERROR_OPEN_FAILED 0x0000006E -#define ERROR_BUFFER_OVERFLOW 0x0000006F -#define ERROR_DISK_FULL 0x00000070 -#define ERROR_NO_MORE_SEARCH_HANDLES 0x00000071 -#define ERROR_INVALID_TARGET_HANDLE 0x00000072 -#define ERROR_INVALID_CATEGORY 0x00000075 -#define ERROR_INVALID_VERIFY_SWITCH 0x00000076 -#define ERROR_BAD_DRIVER_LEVEL 0x00000077 -#define ERROR_CALL_NOT_IMPLEMENTED 0x00000078 -#define ERROR_SEM_TIMEOUT 0x00000079 -#define ERROR_INSUFFICIENT_BUFFER 0x0000007A -#define ERROR_INVALID_NAME 0x0000007B -#define ERROR_INVALID_LEVEL 0x0000007C -#define ERROR_NO_VOLUME_LABEL 0x0000007D -#define ERROR_MOD_NOT_FOUND 0x0000007E -#define ERROR_PROC_NOT_FOUND 0x0000007F -#define ERROR_WAIT_NO_CHILDREN 0x00000080 -#define ERROR_CHILD_NOT_COMPLETE 0x00000081 -#define ERROR_DIRECT_ACCESS_HANDLE 0x00000082 -#define ERROR_NEGATIVE_SEEK 0x00000083 -#define ERROR_SEEK_ON_DEVICE 0x00000084 -#define ERROR_IS_JOIN_TARGET 0x00000085 -#define ERROR_IS_JOINED 0x00000086 -#define ERROR_IS_SUBSTED 0x00000087 -#define ERROR_NOT_JOINED 0x00000088 -#define ERROR_NOT_SUBSTED 0x00000089 -#define ERROR_JOIN_TO_JOIN 0x0000008A -#define ERROR_SUBST_TO_SUBST 0x0000008B -#define ERROR_JOIN_TO_SUBST 0x0000008C -#define ERROR_SUBST_TO_JOIN 0x0000008D -#define ERROR_BUSY_DRIVE 0x0000008E -#define ERROR_SAME_DRIVE 0x0000008F -#define ERROR_DIR_NOT_ROOT 0x00000090 -#define ERROR_DIR_NOT_EMPTY 0x00000091 -#define ERROR_IS_SUBST_PATH 0x00000092 -#define ERROR_IS_JOIN_PATH 0x00000093 -#define ERROR_PATH_BUSY 0x00000094 -#define ERROR_IS_SUBST_TARGET 0x00000095 -#define ERROR_SYSTEM_TRACE 0x00000096 -#define ERROR_INVALID_EVENT_COUNT 0x00000097 -#define ERROR_TOO_MANY_MUXWAITERS 0x00000098 -#define ERROR_INVALID_LIST_FORMAT 0x00000099 -#define ERROR_LABEL_TOO_LONG 0x0000009A -#define ERROR_TOO_MANY_TCBS 0x0000009B -#define ERROR_SIGNAL_REFUSED 0x0000009C -#define ERROR_DISCARDED 0x0000009D -#define ERROR_NOT_LOCKED 0x0000009E -#define ERROR_BAD_THREADID_ADDR 0x0000009F -#define ERROR_BAD_ARGUMENTS 0x000000A0 -#define ERROR_BAD_PATHNAME 0x000000A1 -#define ERROR_SIGNAL_PENDING 0x000000A2 -#define ERROR_MAX_THRDS_REACHED 0x000000A4 -#define ERROR_LOCK_FAILED 0x000000A7 -#define ERROR_BUSY 0x000000AA -#define ERROR_DEVICE_SUPPORT_IN_PROGRESS 0x000000AB -#define ERROR_CANCEL_VIOLATION 0x000000AD -#define ERROR_ATOMIC_LOCKS_NOT_SUPPORTED 0x000000AE -#define ERROR_INVALID_SEGMENT_NUMBER 0x000000B4 -#define ERROR_INVALID_ORDINAL 0x000000B6 -#define ERROR_ALREADY_EXISTS 0x000000B7 -#define ERROR_INVALID_FLAG_NUMBER 0x000000BA -#define ERROR_SEM_NOT_FOUND 0x000000BB -#define ERROR_INVALID_STARTING_CODESEG 0x000000BC -#define ERROR_INVALID_STACKSEG 0x000000BD -#define ERROR_INVALID_MODULETYPE 0x000000BE -#define ERROR_INVALID_EXE_SIGNATURE 0x000000BF -#define ERROR_EXE_MARKED_INVALID 0x000000C0 -#define ERROR_BAD_EXE_FORMAT 0x000000C1 -#define ERROR_ITERATED_DATA_EXCEEDS_64k 0x000000C2 -#define ERROR_INVALID_MINALLOCSIZE 0x000000C3 -#define ERROR_DYNLINK_FROM_INVALID_RING 0x000000C4 -#define ERROR_IOPL_NOT_ENABLED 0x000000C5 -#define ERROR_INVALID_SEGDPL 0x000000C6 -#define ERROR_AUTODATASEG_EXCEEDS_64k 0x000000C7 -#define ERROR_RING2SEG_MUST_BE_MOVABLE 0x000000C8 -#define ERROR_RELOC_CHAIN_XEEDS_SEGLIM 0x000000C9 -#define ERROR_INFLOOP_IN_RELOC_CHAIN 0x000000CA -#define ERROR_ENVVAR_NOT_FOUND 0x000000CB -#define ERROR_NO_SIGNAL_SENT 0x000000CD -#define ERROR_FILENAME_EXCED_RANGE 0x000000CE -#define ERROR_RING2_STACK_IN_USE 0x000000CF -#define ERROR_META_EXPANSION_TOO_LONG 0x000000D0 -#define ERROR_INVALID_SIGNAL_NUMBER 0x000000D1 -#define ERROR_THREAD_1_INACTIVE 0x000000D2 -#define ERROR_LOCKED 0x000000D4 -#define ERROR_TOO_MANY_MODULES 0x000000D6 -#define ERROR_NESTING_NOT_ALLOWED 0x000000D7 -#define ERROR_EXE_MACHINE_TYPE_MISMATCH 0x000000D8 -#define ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY 0x000000D9 -#define ERROR_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY 0x000000DA -#define ERROR_FILE_CHECKED_OUT 0x000000DC -#define ERROR_CHECKOUT_REQUIRED 0x000000DD -#define ERROR_BAD_FILE_TYPE 0x000000DE -#define ERROR_FILE_TOO_LARGE 0x000000DF -#define ERROR_FORMS_AUTH_REQUIRED 0x000000E0 -#define ERROR_VIRUS_INFECTED 0x000000E1 -#define ERROR_VIRUS_DELETED 0x000000E2 -#define ERROR_PIPE_LOCAL 0x000000E5 -#define ERROR_BAD_PIPE 0x000000E6 -#define ERROR_PIPE_BUSY 0x000000E7 -#define ERROR_NO_DATA 0x000000E8 -#define ERROR_PIPE_NOT_CONNECTED 0x000000E9 -#define ERROR_MORE_DATA 0x000000EA -#define ERROR_VC_DISCONNECTED 0x000000F0 -#define ERROR_INVALID_EA_NAME 0x000000FE -#define ERROR_EA_LIST_INCONSISTENT 0x000000FF -#define WAIT_TIMEOUT 0x00000102 -#define ERROR_NO_MORE_ITEMS 0x00000103 -#define ERROR_CANNOT_COPY 0x0000010A -#define ERROR_DIRECTORY 0x0000010B -#define ERROR_EAS_DIDNT_FIT 0x00000113 -#define ERROR_EA_FILE_CORRUPT 0x00000114 -#define ERROR_EA_TABLE_FULL 0x00000115 -#define ERROR_INVALID_EA_HANDLE 0x00000116 -#define ERROR_EAS_NOT_SUPPORTED 0x0000011A -#define ERROR_NOT_OWNER 0x00000120 -#define ERROR_TOO_MANY_POSTS 0x0000012A -#define ERROR_PARTIAL_COPY 0x0000012B -#define ERROR_OPLOCK_NOT_GRANTED 0x0000012C -#define ERROR_INVALID_OPLOCK_PROTOCOL 0x0000012D -#define ERROR_DISK_TOO_FRAGMENTED 0x0000012E -#define ERROR_DELETE_PENDING 0x0000012F -#define ERROR_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING 0x00000130 -#define ERROR_SHORT_NAMES_NOT_ENABLED_ON_VOLUME 0x00000131 -#define ERROR_SECURITY_STREAM_IS_INCONSISTENT 0x00000132 -#define ERROR_INVALID_LOCK_RANGE 0x00000133 -#define ERROR_IMAGE_SUBSYSTEM_NOT_PRESENT 0x00000134 -#define ERROR_NOTIFICATION_GUID_ALREADY_DEFINED 0x00000135 -#define ERROR_INVALID_EXCEPTION_HANDLER 0x00000136 -#define ERROR_DUPLICATE_PRIVILEGES 0x00000137 -#define ERROR_NO_RANGES_PROCESSED 0x00000138 -#define ERROR_NOT_ALLOWED_ON_SYSTEM_FILE 0x00000139 -#define ERROR_DISK_RESOURCES_EXHAUSTED 0x0000013A -#define ERROR_INVALID_TOKEN 0x0000013B -#define ERROR_DEVICE_FEATURE_NOT_SUPPORTED 0x0000013C -#define ERROR_MR_MID_NOT_FOUND 0x0000013D -#define ERROR_SCOPE_NOT_FOUND 0x0000013E -#define ERROR_UNDEFINED_SCOPE 0x0000013F -#define ERROR_INVALID_CAP 0x00000140 -#define ERROR_DEVICE_UNREACHABLE 0x00000141 -#define ERROR_DEVICE_NO_RESOURCES 0x00000142 -#define ERROR_DATA_CHECKSUM_ERROR 0x00000143 -#define ERROR_INTERMIXED_KERNEL_EA_OPERATION 0x00000144 -#define ERROR_FILE_LEVEL_TRIM_NOT_SUPPORTED 0x00000146 -#define ERROR_OFFSET_ALIGNMENT_VIOLATION 0x00000147 -#define ERROR_INVALID_FIELD_IN_PARAMETER_LIST 0x00000148 -#define ERROR_OPERATION_IN_PROGRESS 0x00000149 -#define ERROR_BAD_DEVICE_PATH 0x0000014A -#define ERROR_TOO_MANY_DESCRIPTORS 0x0000014B -#define ERROR_SCRUB_DATA_DISABLED 0x0000014C -#define ERROR_NOT_REDUNDANT_STORAGE 0x0000014D -#define ERROR_RESIDENT_FILE_NOT_SUPPORTED 0x0000014E -#define ERROR_COMPRESSED_FILE_NOT_SUPPORTED 0x0000014F -#define ERROR_DIRECTORY_NOT_SUPPORTED 0x00000150 -#define ERROR_NOT_READ_FROM_COPY 0x00000151 -#define ERROR_FAIL_NOACTION_REBOOT 0x0000015E -#define ERROR_FAIL_SHUTDOWN 0x0000015F -#define ERROR_FAIL_RESTART 0x00000160 -#define ERROR_MAX_SESSIONS_REACHED 0x00000161 -#define ERROR_THREAD_MODE_ALREADY_BACKGROUND 0x00000190 -#define ERROR_THREAD_MODE_NOT_BACKGROUND 0x00000191 -#define ERROR_PROCESS_MODE_ALREADY_BACKGROUND 0x00000192 -#define ERROR_PROCESS_MODE_NOT_BACKGROUND 0x00000193 -#define ERROR_INVALID_ADDRESS 0x000001E7 +#define ERROR_SUCCESS 0x00000000 +#define ERROR_INVALID_FUNCTION 0x00000001 +#define ERROR_FILE_NOT_FOUND 0x00000002 +#define ERROR_PATH_NOT_FOUND 0x00000003 +#define ERROR_TOO_MANY_OPEN_FILES 0x00000004 +#define ERROR_ACCESS_DENIED 0x00000005 +#define ERROR_INVALID_HANDLE 0x00000006 +#define ERROR_ARENA_TRASHED 0x00000007 +#define ERROR_NOT_ENOUGH_MEMORY 0x00000008 +#define ERROR_INVALID_BLOCK 0x00000009 +#define ERROR_BAD_ENVIRONMENT 0x0000000A +#define ERROR_BAD_FORMAT 0x0000000B +#define ERROR_INVALID_ACCESS 0x0000000C +#define ERROR_INVALID_DATA 0x0000000D +#define ERROR_OUTOFMEMORY 0x0000000E +#define ERROR_INVALID_DRIVE 0x0000000F +#define ERROR_CURRENT_DIRECTORY 0x00000010 +#define ERROR_NOT_SAME_DEVICE 0x00000011 +#define ERROR_NO_MORE_FILES 0x00000012 +#define ERROR_WRITE_PROTECT 0x00000013 +#define ERROR_BAD_UNIT 0x00000014 +#define ERROR_NOT_READY 0x00000015 +#define ERROR_BAD_COMMAND 0x00000016 +#define ERROR_CRC 0x00000017 +#define ERROR_BAD_LENGTH 0x00000018 +#define ERROR_SEEK 0x00000019 +#define ERROR_NOT_DOS_DISK 0x0000001A +#define ERROR_SECTOR_NOT_FOUND 0x0000001B +#define ERROR_OUT_OF_PAPER 0x0000001C +#define ERROR_WRITE_FAULT 0x0000001D +#define ERROR_READ_FAULT 0x0000001E +#define ERROR_GEN_FAILURE 0x0000001F +#define ERROR_SHARING_VIOLATION 0x00000020 +#define ERROR_LOCK_VIOLATION 0x00000021 +#define ERROR_WRONG_DISK 0x00000022 +#define ERROR_SHARING_BUFFER_EXCEEDED 0x00000024 +#define ERROR_HANDLE_EOF 0x00000026 +#define ERROR_HANDLE_DISK_FULL 0x00000027 +#define ERROR_NOT_SUPPORTED 0x00000032 +#define ERROR_REM_NOT_LIST 0x00000033 +#define ERROR_DUP_NAME 0x00000034 +#define ERROR_BAD_NETPATH 0x00000035 +#define ERROR_NETWORK_BUSY 0x00000036 +#define ERROR_DEV_NOT_EXIST 0x00000037 +#define ERROR_TOO_MANY_CMDS 0x00000038 +#define ERROR_ADAP_HDW_ERR 0x00000039 +#define ERROR_BAD_NET_RESP 0x0000003A +#define ERROR_UNEXP_NET_ERR 0x0000003B +#define ERROR_BAD_REM_ADAP 0x0000003C +#define ERROR_PRINTQ_FULL 0x0000003D +#define ERROR_NO_SPOOL_SPACE 0x0000003E +#define ERROR_PRINT_CANCELLED 0x0000003F +#define ERROR_NETNAME_DELETED 0x00000040 +#define ERROR_NETWORK_ACCESS_DENIED 0x00000041 +#define ERROR_BAD_DEV_TYPE 0x00000042 +#define ERROR_BAD_NET_NAME 0x00000043 +#define ERROR_TOO_MANY_NAMES 0x00000044 +#define ERROR_TOO_MANY_SESS 0x00000045 +#define ERROR_SHARING_PAUSED 0x00000046 +#define ERROR_REQ_NOT_ACCEP 0x00000047 +#define ERROR_REDIR_PAUSED 0x00000048 +#define ERROR_FILE_EXISTS 0x00000050 +#define ERROR_CANNOT_MAKE 0x00000052 +#define ERROR_FAIL_I24 0x00000053 +#define ERROR_OUT_OF_STRUCTURES 0x00000054 +#define ERROR_ALREADY_ASSIGNED 0x00000055 +#define ERROR_INVALID_PASSWORD 0x00000056 +#define ERROR_INVALID_PARAMETER 0x00000057 +#define ERROR_NET_WRITE_FAULT 0x00000058 +#define ERROR_NO_PROC_SLOTS 0x00000059 +#define ERROR_TOO_MANY_SEMAPHORES 0x00000064 +#define ERROR_EXCL_SEM_ALREADY_OWNED 0x00000065 +#define ERROR_SEM_IS_SET 0x00000066 +#define ERROR_TOO_MANY_SEM_REQUESTS 0x00000067 +#define ERROR_INVALID_AT_INTERRUPT_TIME 0x00000068 +#define ERROR_SEM_OWNER_DIED 0x00000069 +#define ERROR_SEM_USER_LIMIT 0x0000006A +#define ERROR_DISK_CHANGE 0x0000006B +#define ERROR_DRIVE_LOCKED 0x0000006C +#define ERROR_BROKEN_PIPE 0x0000006D +#define ERROR_OPEN_FAILED 0x0000006E +#define ERROR_BUFFER_OVERFLOW 0x0000006F +#define ERROR_DISK_FULL 0x00000070 +#define ERROR_NO_MORE_SEARCH_HANDLES 0x00000071 +#define ERROR_INVALID_TARGET_HANDLE 0x00000072 +#define ERROR_INVALID_CATEGORY 0x00000075 +#define ERROR_INVALID_VERIFY_SWITCH 0x00000076 +#define ERROR_BAD_DRIVER_LEVEL 0x00000077 +#define ERROR_CALL_NOT_IMPLEMENTED 0x00000078 +#define ERROR_SEM_TIMEOUT 0x00000079 +#define ERROR_INSUFFICIENT_BUFFER 0x0000007A +#define ERROR_INVALID_NAME 0x0000007B +#define ERROR_INVALID_LEVEL 0x0000007C +#define ERROR_NO_VOLUME_LABEL 0x0000007D +#define ERROR_MOD_NOT_FOUND 0x0000007E +#define ERROR_PROC_NOT_FOUND 0x0000007F +#define ERROR_WAIT_NO_CHILDREN 0x00000080 +#define ERROR_CHILD_NOT_COMPLETE 0x00000081 +#define ERROR_DIRECT_ACCESS_HANDLE 0x00000082 +#define ERROR_NEGATIVE_SEEK 0x00000083 +#define ERROR_SEEK_ON_DEVICE 0x00000084 +#define ERROR_IS_JOIN_TARGET 0x00000085 +#define ERROR_IS_JOINED 0x00000086 +#define ERROR_IS_SUBSTED 0x00000087 +#define ERROR_NOT_JOINED 0x00000088 +#define ERROR_NOT_SUBSTED 0x00000089 +#define ERROR_JOIN_TO_JOIN 0x0000008A +#define ERROR_SUBST_TO_SUBST 0x0000008B +#define ERROR_JOIN_TO_SUBST 0x0000008C +#define ERROR_SUBST_TO_JOIN 0x0000008D +#define ERROR_BUSY_DRIVE 0x0000008E +#define ERROR_SAME_DRIVE 0x0000008F +#define ERROR_DIR_NOT_ROOT 0x00000090 +#define ERROR_DIR_NOT_EMPTY 0x00000091 +#define ERROR_IS_SUBST_PATH 0x00000092 +#define ERROR_IS_JOIN_PATH 0x00000093 +#define ERROR_PATH_BUSY 0x00000094 +#define ERROR_IS_SUBST_TARGET 0x00000095 +#define ERROR_SYSTEM_TRACE 0x00000096 +#define ERROR_INVALID_EVENT_COUNT 0x00000097 +#define ERROR_TOO_MANY_MUXWAITERS 0x00000098 +#define ERROR_INVALID_LIST_FORMAT 0x00000099 +#define ERROR_LABEL_TOO_LONG 0x0000009A +#define ERROR_TOO_MANY_TCBS 0x0000009B +#define ERROR_SIGNAL_REFUSED 0x0000009C +#define ERROR_DISCARDED 0x0000009D +#define ERROR_NOT_LOCKED 0x0000009E +#define ERROR_BAD_THREADID_ADDR 0x0000009F +#define ERROR_BAD_ARGUMENTS 0x000000A0 +#define ERROR_BAD_PATHNAME 0x000000A1 +#define ERROR_SIGNAL_PENDING 0x000000A2 +#define ERROR_MAX_THRDS_REACHED 0x000000A4 +#define ERROR_LOCK_FAILED 0x000000A7 +#define ERROR_BUSY 0x000000AA +#define ERROR_DEVICE_SUPPORT_IN_PROGRESS 0x000000AB +#define ERROR_CANCEL_VIOLATION 0x000000AD +#define ERROR_ATOMIC_LOCKS_NOT_SUPPORTED 0x000000AE +#define ERROR_INVALID_SEGMENT_NUMBER 0x000000B4 +#define ERROR_INVALID_ORDINAL 0x000000B6 +#define ERROR_ALREADY_EXISTS 0x000000B7 +#define ERROR_INVALID_FLAG_NUMBER 0x000000BA +#define ERROR_SEM_NOT_FOUND 0x000000BB +#define ERROR_INVALID_STARTING_CODESEG 0x000000BC +#define ERROR_INVALID_STACKSEG 0x000000BD +#define ERROR_INVALID_MODULETYPE 0x000000BE +#define ERROR_INVALID_EXE_SIGNATURE 0x000000BF +#define ERROR_EXE_MARKED_INVALID 0x000000C0 +#define ERROR_BAD_EXE_FORMAT 0x000000C1 +#define ERROR_ITERATED_DATA_EXCEEDS_64k 0x000000C2 +#define ERROR_INVALID_MINALLOCSIZE 0x000000C3 +#define ERROR_DYNLINK_FROM_INVALID_RING 0x000000C4 +#define ERROR_IOPL_NOT_ENABLED 0x000000C5 +#define ERROR_INVALID_SEGDPL 0x000000C6 +#define ERROR_AUTODATASEG_EXCEEDS_64k 0x000000C7 +#define ERROR_RING2SEG_MUST_BE_MOVABLE 0x000000C8 +#define ERROR_RELOC_CHAIN_XEEDS_SEGLIM 0x000000C9 +#define ERROR_INFLOOP_IN_RELOC_CHAIN 0x000000CA +#define ERROR_ENVVAR_NOT_FOUND 0x000000CB +#define ERROR_NO_SIGNAL_SENT 0x000000CD +#define ERROR_FILENAME_EXCED_RANGE 0x000000CE +#define ERROR_RING2_STACK_IN_USE 0x000000CF +#define ERROR_META_EXPANSION_TOO_LONG 0x000000D0 +#define ERROR_INVALID_SIGNAL_NUMBER 0x000000D1 +#define ERROR_THREAD_1_INACTIVE 0x000000D2 +#define ERROR_LOCKED 0x000000D4 +#define ERROR_TOO_MANY_MODULES 0x000000D6 +#define ERROR_NESTING_NOT_ALLOWED 0x000000D7 +#define ERROR_EXE_MACHINE_TYPE_MISMATCH 0x000000D8 +#define ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY 0x000000D9 +#define ERROR_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY 0x000000DA +#define ERROR_FILE_CHECKED_OUT 0x000000DC +#define ERROR_CHECKOUT_REQUIRED 0x000000DD +#define ERROR_BAD_FILE_TYPE 0x000000DE +#define ERROR_FILE_TOO_LARGE 0x000000DF +#define ERROR_FORMS_AUTH_REQUIRED 0x000000E0 +#define ERROR_VIRUS_INFECTED 0x000000E1 +#define ERROR_VIRUS_DELETED 0x000000E2 +#define ERROR_PIPE_LOCAL 0x000000E5 +#define ERROR_BAD_PIPE 0x000000E6 +#define ERROR_PIPE_BUSY 0x000000E7 +#define ERROR_NO_DATA 0x000000E8 +#define ERROR_PIPE_NOT_CONNECTED 0x000000E9 +#define ERROR_MORE_DATA 0x000000EA +#define ERROR_VC_DISCONNECTED 0x000000F0 +#define ERROR_INVALID_EA_NAME 0x000000FE +#define ERROR_EA_LIST_INCONSISTENT 0x000000FF +#define WAIT_TIMEOUT 0x00000102 +#define ERROR_NO_MORE_ITEMS 0x00000103 +#define ERROR_CANNOT_COPY 0x0000010A +#define ERROR_DIRECTORY 0x0000010B +#define ERROR_EAS_DIDNT_FIT 0x00000113 +#define ERROR_EA_FILE_CORRUPT 0x00000114 +#define ERROR_EA_TABLE_FULL 0x00000115 +#define ERROR_INVALID_EA_HANDLE 0x00000116 +#define ERROR_EAS_NOT_SUPPORTED 0x0000011A +#define ERROR_NOT_OWNER 0x00000120 +#define ERROR_TOO_MANY_POSTS 0x0000012A +#define ERROR_PARTIAL_COPY 0x0000012B +#define ERROR_OPLOCK_NOT_GRANTED 0x0000012C +#define ERROR_INVALID_OPLOCK_PROTOCOL 0x0000012D +#define ERROR_DISK_TOO_FRAGMENTED 0x0000012E +#define ERROR_DELETE_PENDING 0x0000012F +#define ERROR_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING 0x00000130 +#define ERROR_SHORT_NAMES_NOT_ENABLED_ON_VOLUME 0x00000131 +#define ERROR_SECURITY_STREAM_IS_INCONSISTENT 0x00000132 +#define ERROR_INVALID_LOCK_RANGE 0x00000133 +#define ERROR_IMAGE_SUBSYSTEM_NOT_PRESENT 0x00000134 +#define ERROR_NOTIFICATION_GUID_ALREADY_DEFINED 0x00000135 +#define ERROR_INVALID_EXCEPTION_HANDLER 0x00000136 +#define ERROR_DUPLICATE_PRIVILEGES 0x00000137 +#define ERROR_NO_RANGES_PROCESSED 0x00000138 +#define ERROR_NOT_ALLOWED_ON_SYSTEM_FILE 0x00000139 +#define ERROR_DISK_RESOURCES_EXHAUSTED 0x0000013A +#define ERROR_INVALID_TOKEN 0x0000013B +#define ERROR_DEVICE_FEATURE_NOT_SUPPORTED 0x0000013C +#define ERROR_MR_MID_NOT_FOUND 0x0000013D +#define ERROR_SCOPE_NOT_FOUND 0x0000013E +#define ERROR_UNDEFINED_SCOPE 0x0000013F +#define ERROR_INVALID_CAP 0x00000140 +#define ERROR_DEVICE_UNREACHABLE 0x00000141 +#define ERROR_DEVICE_NO_RESOURCES 0x00000142 +#define ERROR_DATA_CHECKSUM_ERROR 0x00000143 +#define ERROR_INTERMIXED_KERNEL_EA_OPERATION 0x00000144 +#define ERROR_FILE_LEVEL_TRIM_NOT_SUPPORTED 0x00000146 +#define ERROR_OFFSET_ALIGNMENT_VIOLATION 0x00000147 +#define ERROR_INVALID_FIELD_IN_PARAMETER_LIST 0x00000148 +#define ERROR_OPERATION_IN_PROGRESS 0x00000149 +#define ERROR_BAD_DEVICE_PATH 0x0000014A +#define ERROR_TOO_MANY_DESCRIPTORS 0x0000014B +#define ERROR_SCRUB_DATA_DISABLED 0x0000014C +#define ERROR_NOT_REDUNDANT_STORAGE 0x0000014D +#define ERROR_RESIDENT_FILE_NOT_SUPPORTED 0x0000014E +#define ERROR_COMPRESSED_FILE_NOT_SUPPORTED 0x0000014F +#define ERROR_DIRECTORY_NOT_SUPPORTED 0x00000150 +#define ERROR_NOT_READ_FROM_COPY 0x00000151 +#define ERROR_FAIL_NOACTION_REBOOT 0x0000015E +#define ERROR_FAIL_SHUTDOWN 0x0000015F +#define ERROR_FAIL_RESTART 0x00000160 +#define ERROR_MAX_SESSIONS_REACHED 0x00000161 +#define ERROR_THREAD_MODE_ALREADY_BACKGROUND 0x00000190 +#define ERROR_THREAD_MODE_NOT_BACKGROUND 0x00000191 +#define ERROR_PROCESS_MODE_ALREADY_BACKGROUND 0x00000192 +#define ERROR_PROCESS_MODE_NOT_BACKGROUND 0x00000193 +#define ERROR_INVALID_ADDRESS 0x000001E7 /* System Error Codes (500-999) */ - -#define ERROR_USER_PROFILE_LOAD 0x000001F4 -#define ERROR_ARITHMETIC_OVERFLOW 0x00000216 -#define ERROR_PIPE_CONNECTED 0x00000217 -#define ERROR_PIPE_LISTENING 0x00000218 -#define ERROR_VERIFIER_STOP 0x00000219 -#define ERROR_ABIOS_ERROR 0x0000021A -#define ERROR_WX86_WARNING 0x0000021B -#define ERROR_WX86_ERROR 0x0000021C -#define ERROR_TIMER_NOT_CANCELED 0x0000021D -#define ERROR_UNWIND 0x0000021E -#define ERROR_BAD_STACK 0x0000021F -#define ERROR_INVALID_UNWIND_TARGET 0x00000220 -#define ERROR_INVALID_PORT_ATTRIBUTES 0x00000221 -#define ERROR_PORT_MESSAGE_TOO_LONG 0x00000222 -#define ERROR_INVALID_QUOTA_LOWER 0x00000223 -#define ERROR_DEVICE_ALREADY_ATTACHED 0x00000224 -#define ERROR_INSTRUCTION_MISALIGNMENT 0x00000225 -#define ERROR_PROFILING_NOT_STARTED 0x00000226 -#define ERROR_PROFILING_NOT_STOPPED 0x00000227 -#define ERROR_COULD_NOT_INTERPRET 0x00000228 -#define ERROR_PROFILING_AT_LIMIT 0x00000229 -#define ERROR_CANT_WAIT 0x0000022A -#define ERROR_CANT_TERMINATE_SELF 0x0000022B -#define ERROR_UNEXPECTED_MM_CREATE_ERR 0x0000022C -#define ERROR_UNEXPECTED_MM_MAP_ERROR 0x0000022D -#define ERROR_UNEXPECTED_MM_EXTEND_ERR 0x0000022E -#define ERROR_BAD_FUNCTION_TABLE 0x0000022F -#define ERROR_NO_GUID_TRANSLATION 0x00000230 -#define ERROR_INVALID_LDT_SIZE 0x00000231 -#define ERROR_INVALID_LDT_OFFSET 0x00000233 -#define ERROR_INVALID_LDT_DESCRIPTOR 0x00000234 -#define ERROR_TOO_MANY_THREADS 0x00000235 -#define ERROR_THREAD_NOT_IN_PROCESS 0x00000236 -#define ERROR_PAGEFILE_QUOTA_EXCEEDED 0x00000237 -#define ERROR_LOGON_SERVER_CONFLICT 0x00000238 -#define ERROR_SYNCHRONIZATION_REQUIRED 0x00000239 -#define ERROR_NET_OPEN_FAILED 0x0000023A -#define ERROR_IO_PRIVILEGE_FAILED 0x0000023B -#define ERROR_CONTROL_C_EXIT 0x0000023C -#define ERROR_MISSING_SYSTEMFILE 0x0000023D -#define ERROR_UNHANDLED_EXCEPTION 0x0000023E -#define ERROR_APP_INIT_FAILURE 0x0000023F -#define ERROR_PAGEFILE_CREATE_FAILED 0x00000240 -#define ERROR_INVALID_IMAGE_HASH 0x00000241 -#define ERROR_NO_PAGEFILE 0x00000242 -#define ERROR_ILLEGAL_FLOAT_CONTEXT 0x00000243 -#define ERROR_NO_EVENT_PAIR 0x00000244 -#define ERROR_DOMAIN_CTRLR_CONFIG_ERROR 0x00000245 -#define ERROR_ILLEGAL_CHARACTER 0x00000246 -#define ERROR_UNDEFINED_CHARACTER 0x00000247 -#define ERROR_FLOPPY_VOLUME 0x00000248 -#define ERROR_BIOS_FAILED_TO_CONNECT_INTERRUPT 0x00000249 -#define ERROR_BACKUP_CONTROLLER 0x0000024A -#define ERROR_MUTANT_LIMIT_EXCEEDED 0x0000024B -#define ERROR_FS_DRIVER_REQUIRED 0x0000024C -#define ERROR_CANNOT_LOAD_REGISTRY_FILE 0x0000024D -#define ERROR_DEBUG_ATTACH_FAILED 0x0000024E -#define ERROR_SYSTEM_PROCESS_TERMINATED 0x0000024F -#define ERROR_DATA_NOT_ACCEPTED 0x00000250 -#define ERROR_VDM_HARD_ERROR 0x00000251 -#define ERROR_DRIVER_CANCEL_TIMEOUT 0x00000252 -#define ERROR_REPLY_MESSAGE_MISMATCH 0x00000253 -#define ERROR_LOST_WRITEBEHIND_DATA 0x00000254 -#define ERROR_CLIENT_SERVER_PARAMETERS_INVALID 0x00000255 -#define ERROR_NOT_TINY_STREAM 0x00000256 -#define ERROR_STACK_OVERFLOW_READ 0x00000257 -#define ERROR_CONVERT_TO_LARGE 0x00000258 -#define ERROR_FOUND_OUT_OF_SCOPE 0x00000259 -#define ERROR_ALLOCATE_BUCKET 0x0000025A -#define ERROR_MARSHALL_OVERFLOW 0x0000025B -#define ERROR_INVALID_VARIANT 0x0000025C -#define ERROR_BAD_COMPRESSION_BUFFER 0x0000025D -#define ERROR_AUDIT_FAILED 0x0000025E -#define ERROR_TIMER_RESOLUTION_NOT_SET 0x0000025F -#define ERROR_INSUFFICIENT_LOGON_INFO 0x00000260 -#define ERROR_BAD_DLL_ENTRYPOINT 0x00000261 -#define ERROR_BAD_SERVICE_ENTRYPOINT 0x00000262 -#define ERROR_IP_ADDRESS_CONFLICT1 0x00000263 -#define ERROR_IP_ADDRESS_CONFLICT2 0x00000264 -#define ERROR_REGISTRY_QUOTA_LIMIT 0x00000265 -#define ERROR_NO_CALLBACK_ACTIVE 0x00000266 -#define ERROR_PWD_TOO_SHORT 0x00000267 -#define ERROR_PWD_TOO_RECENT 0x00000268 -#define ERROR_PWD_HISTORY_CONFLICT 0x00000269 -#define ERROR_UNSUPPORTED_COMPRESSION 0x0000026A -#define ERROR_INVALID_HW_PROFILE 0x0000026B -#define ERROR_INVALID_PLUGPLAY_DEVICE_PATH 0x0000026C -#define ERROR_QUOTA_LIST_INCONSISTENT 0x0000026D -#define ERROR_EVALUATION_EXPIRATION 0x0000026E -#define ERROR_ILLEGAL_DLL_RELOCATION 0x0000026F -#define ERROR_DLL_INIT_FAILED_LOGOFF 0x00000270 -#define ERROR_VALIDATE_CONTINUE 0x00000271 -#define ERROR_NO_MORE_MATCHES 0x00000272 -#define ERROR_RANGE_LIST_CONFLICT 0x00000273 -#define ERROR_SERVER_SID_MISMATCH 0x00000274 -#define ERROR_CANT_ENABLE_DENY_ONLY 0x00000275 -#define ERROR_FLOAT_MULTIPLE_FAULTS 0x00000276 -#define ERROR_FLOAT_MULTIPLE_TRAPS 0x00000277 -#define ERROR_NOINTERFACE 0x00000278 -#define ERROR_DRIVER_FAILED_SLEEP 0x00000279 -#define ERROR_CORRUPT_SYSTEM_FILE 0x0000027A -#define ERROR_COMMITMENT_MINIMUM 0x0000027B -#define ERROR_PNP_RESTART_ENUMERATION 0x0000027C -#define ERROR_SYSTEM_IMAGE_BAD_SIGNATURE 0x0000027D -#define ERROR_PNP_REBOOT_REQUIRED 0x0000027E -#define ERROR_INSUFFICIENT_POWER 0x0000027F -#define ERROR_MULTIPLE_FAULT_VIOLATION 0x00000280 -#define ERROR_SYSTEM_SHUTDOWN 0x00000281 -#define ERROR_PORT_NOT_SET 0x00000282 -#define ERROR_DS_VERSION_CHECK_FAILURE 0x00000283 -#define ERROR_RANGE_NOT_FOUND 0x00000284 -#define ERROR_NOT_SAFE_MODE_DRIVER 0x00000286 -#define ERROR_FAILED_DRIVER_ENTRY 0x00000287 -#define ERROR_DEVICE_ENUMERATION_ERROR 0x00000288 -#define ERROR_MOUNT_POINT_NOT_RESOLVED 0x00000289 -#define ERROR_INVALID_DEVICE_OBJECT_PARAMETER 0x0000028A +#define ERROR_USER_PROFILE_LOAD 0x000001F4 +#define ERROR_ARITHMETIC_OVERFLOW 0x00000216 +#define ERROR_PIPE_CONNECTED 0x00000217 +#define ERROR_PIPE_LISTENING 0x00000218 +#define ERROR_VERIFIER_STOP 0x00000219 +#define ERROR_ABIOS_ERROR 0x0000021A +#define ERROR_WX86_WARNING 0x0000021B +#define ERROR_WX86_ERROR 0x0000021C +#define ERROR_TIMER_NOT_CANCELED 0x0000021D +#define ERROR_UNWIND 0x0000021E +#define ERROR_BAD_STACK 0x0000021F +#define ERROR_INVALID_UNWIND_TARGET 0x00000220 +#define ERROR_INVALID_PORT_ATTRIBUTES 0x00000221 +#define ERROR_PORT_MESSAGE_TOO_LONG 0x00000222 +#define ERROR_INVALID_QUOTA_LOWER 0x00000223 +#define ERROR_DEVICE_ALREADY_ATTACHED 0x00000224 +#define ERROR_INSTRUCTION_MISALIGNMENT 0x00000225 +#define ERROR_PROFILING_NOT_STARTED 0x00000226 +#define ERROR_PROFILING_NOT_STOPPED 0x00000227 +#define ERROR_COULD_NOT_INTERPRET 0x00000228 +#define ERROR_PROFILING_AT_LIMIT 0x00000229 +#define ERROR_CANT_WAIT 0x0000022A +#define ERROR_CANT_TERMINATE_SELF 0x0000022B +#define ERROR_UNEXPECTED_MM_CREATE_ERR 0x0000022C +#define ERROR_UNEXPECTED_MM_MAP_ERROR 0x0000022D +#define ERROR_UNEXPECTED_MM_EXTEND_ERR 0x0000022E +#define ERROR_BAD_FUNCTION_TABLE 0x0000022F +#define ERROR_NO_GUID_TRANSLATION 0x00000230 +#define ERROR_INVALID_LDT_SIZE 0x00000231 +#define ERROR_INVALID_LDT_OFFSET 0x00000233 +#define ERROR_INVALID_LDT_DESCRIPTOR 0x00000234 +#define ERROR_TOO_MANY_THREADS 0x00000235 +#define ERROR_THREAD_NOT_IN_PROCESS 0x00000236 +#define ERROR_PAGEFILE_QUOTA_EXCEEDED 0x00000237 +#define ERROR_LOGON_SERVER_CONFLICT 0x00000238 +#define ERROR_SYNCHRONIZATION_REQUIRED 0x00000239 +#define ERROR_NET_OPEN_FAILED 0x0000023A +#define ERROR_IO_PRIVILEGE_FAILED 0x0000023B +#define ERROR_CONTROL_C_EXIT 0x0000023C +#define ERROR_MISSING_SYSTEMFILE 0x0000023D +#define ERROR_UNHANDLED_EXCEPTION 0x0000023E +#define ERROR_APP_INIT_FAILURE 0x0000023F +#define ERROR_PAGEFILE_CREATE_FAILED 0x00000240 +#define ERROR_INVALID_IMAGE_HASH 0x00000241 +#define ERROR_NO_PAGEFILE 0x00000242 +#define ERROR_ILLEGAL_FLOAT_CONTEXT 0x00000243 +#define ERROR_NO_EVENT_PAIR 0x00000244 +#define ERROR_DOMAIN_CTRLR_CONFIG_ERROR 0x00000245 +#define ERROR_ILLEGAL_CHARACTER 0x00000246 +#define ERROR_UNDEFINED_CHARACTER 0x00000247 +#define ERROR_FLOPPY_VOLUME 0x00000248 +#define ERROR_BIOS_FAILED_TO_CONNECT_INTERRUPT 0x00000249 +#define ERROR_BACKUP_CONTROLLER 0x0000024A +#define ERROR_MUTANT_LIMIT_EXCEEDED 0x0000024B +#define ERROR_FS_DRIVER_REQUIRED 0x0000024C +#define ERROR_CANNOT_LOAD_REGISTRY_FILE 0x0000024D +#define ERROR_DEBUG_ATTACH_FAILED 0x0000024E +#define ERROR_SYSTEM_PROCESS_TERMINATED 0x0000024F +#define ERROR_DATA_NOT_ACCEPTED 0x00000250 +#define ERROR_VDM_HARD_ERROR 0x00000251 +#define ERROR_DRIVER_CANCEL_TIMEOUT 0x00000252 +#define ERROR_REPLY_MESSAGE_MISMATCH 0x00000253 +#define ERROR_LOST_WRITEBEHIND_DATA 0x00000254 +#define ERROR_CLIENT_SERVER_PARAMETERS_INVALID 0x00000255 +#define ERROR_NOT_TINY_STREAM 0x00000256 +#define ERROR_STACK_OVERFLOW_READ 0x00000257 +#define ERROR_CONVERT_TO_LARGE 0x00000258 +#define ERROR_FOUND_OUT_OF_SCOPE 0x00000259 +#define ERROR_ALLOCATE_BUCKET 0x0000025A +#define ERROR_MARSHALL_OVERFLOW 0x0000025B +#define ERROR_INVALID_VARIANT 0x0000025C +#define ERROR_BAD_COMPRESSION_BUFFER 0x0000025D +#define ERROR_AUDIT_FAILED 0x0000025E +#define ERROR_TIMER_RESOLUTION_NOT_SET 0x0000025F +#define ERROR_INSUFFICIENT_LOGON_INFO 0x00000260 +#define ERROR_BAD_DLL_ENTRYPOINT 0x00000261 +#define ERROR_BAD_SERVICE_ENTRYPOINT 0x00000262 +#define ERROR_IP_ADDRESS_CONFLICT1 0x00000263 +#define ERROR_IP_ADDRESS_CONFLICT2 0x00000264 +#define ERROR_REGISTRY_QUOTA_LIMIT 0x00000265 +#define ERROR_NO_CALLBACK_ACTIVE 0x00000266 +#define ERROR_PWD_TOO_SHORT 0x00000267 +#define ERROR_PWD_TOO_RECENT 0x00000268 +#define ERROR_PWD_HISTORY_CONFLICT 0x00000269 +#define ERROR_UNSUPPORTED_COMPRESSION 0x0000026A +#define ERROR_INVALID_HW_PROFILE 0x0000026B +#define ERROR_INVALID_PLUGPLAY_DEVICE_PATH 0x0000026C +#define ERROR_QUOTA_LIST_INCONSISTENT 0x0000026D +#define ERROR_EVALUATION_EXPIRATION 0x0000026E +#define ERROR_ILLEGAL_DLL_RELOCATION 0x0000026F +#define ERROR_DLL_INIT_FAILED_LOGOFF 0x00000270 +#define ERROR_VALIDATE_CONTINUE 0x00000271 +#define ERROR_NO_MORE_MATCHES 0x00000272 +#define ERROR_RANGE_LIST_CONFLICT 0x00000273 +#define ERROR_SERVER_SID_MISMATCH 0x00000274 +#define ERROR_CANT_ENABLE_DENY_ONLY 0x00000275 +#define ERROR_FLOAT_MULTIPLE_FAULTS 0x00000276 +#define ERROR_FLOAT_MULTIPLE_TRAPS 0x00000277 +#define ERROR_NOINTERFACE 0x00000278 +#define ERROR_DRIVER_FAILED_SLEEP 0x00000279 +#define ERROR_CORRUPT_SYSTEM_FILE 0x0000027A +#define ERROR_COMMITMENT_MINIMUM 0x0000027B +#define ERROR_PNP_RESTART_ENUMERATION 0x0000027C +#define ERROR_SYSTEM_IMAGE_BAD_SIGNATURE 0x0000027D +#define ERROR_PNP_REBOOT_REQUIRED 0x0000027E +#define ERROR_INSUFFICIENT_POWER 0x0000027F +#define ERROR_MULTIPLE_FAULT_VIOLATION 0x00000280 +#define ERROR_SYSTEM_SHUTDOWN 0x00000281 +#define ERROR_PORT_NOT_SET 0x00000282 +#define ERROR_DS_VERSION_CHECK_FAILURE 0x00000283 +#define ERROR_RANGE_NOT_FOUND 0x00000284 +#define ERROR_NOT_SAFE_MODE_DRIVER 0x00000286 +#define ERROR_FAILED_DRIVER_ENTRY 0x00000287 +#define ERROR_DEVICE_ENUMERATION_ERROR 0x00000288 +#define ERROR_MOUNT_POINT_NOT_RESOLVED 0x00000289 +#define ERROR_INVALID_DEVICE_OBJECT_PARAMETER 0x0000028A /* The following is not a typo. It's the same spelling as in the Microsoft headers */ -#define ERROR_MCA_OCCURED 0x0000028B -#define ERROR_DRIVER_DATABASE_ERROR 0x0000028C -#define ERROR_SYSTEM_HIVE_TOO_LARGE 0x0000028D -#define ERROR_DRIVER_FAILED_PRIOR_UNLOAD 0x0000028E -#define ERROR_VOLSNAP_PREPARE_HIBERNATE 0x0000028F -#define ERROR_HIBERNATION_FAILURE 0x00000290 -#define ERROR_PWD_TOO_LONG 0x00000291 -#define ERROR_FILE_SYSTEM_LIMITATION 0x00000299 -#define ERROR_ASSERTION_FAILURE 0x0000029C -#define ERROR_ACPI_ERROR 0x0000029D -#define ERROR_WOW_ASSERTION 0x0000029E -#define ERROR_PNP_BAD_MPS_TABLE 0x0000029F -#define ERROR_PNP_TRANSLATION_FAILED 0x000002A0 -#define ERROR_PNP_IRQ_TRANSLATION_FAILED 0x000002A1 -#define ERROR_PNP_INVALID_ID 0x000002A2 -#define ERROR_WAKE_SYSTEM_DEBUGGER 0x000002A3 -#define ERROR_HANDLES_CLOSED 0x000002A4 -#define ERROR_EXTRANEOUS_INFORMATION 0x000002A5 -#define ERROR_RXACT_COMMIT_NECESSARY 0x000002A6 -#define ERROR_MEDIA_CHECK 0x000002A7 -#define ERROR_GUID_SUBSTITUTION_MADE 0x000002A8 -#define ERROR_STOPPED_ON_SYMLINK 0x000002A9 -#define ERROR_LONGJUMP 0x000002AA -#define ERROR_PLUGPLAY_QUERY_VETOED 0x000002AB -#define ERROR_UNWIND_CONSOLIDATE 0x000002AC -#define ERROR_REGISTRY_HIVE_RECOVERED 0x000002AD -#define ERROR_DLL_MIGHT_BE_INSECURE 0x000002AE -#define ERROR_DLL_MIGHT_BE_INCOMPATIBLE 0x000002AF -#define ERROR_DBG_EXCEPTION_NOT_HANDLED 0x000002B0 -#define ERROR_DBG_REPLY_LATER 0x000002B1 -#define ERROR_DBG_UNABLE_TO_PROVIDE_HANDLE 0x000002B2 -#define ERROR_DBG_TERMINATE_THREAD 0x000002B3 -#define ERROR_DBG_TERMINATE_PROCESS 0x000002B4 -#define ERROR_DBG_CONTROL_C 0x000002B5 -#define ERROR_DBG_PRINTEXCEPTION_C 0x000002B6 -#define ERROR_DBG_RIPEXCEPTION 0x000002B7 -#define ERROR_DBG_CONTROL_BREAK 0x000002B8 -#define ERROR_DBG_COMMAND_EXCEPTION 0x000002B9 -#define ERROR_OBJECT_NAME_EXISTS 0x000002BA -#define ERROR_THREAD_WAS_SUSPENDED 0x000002BB -#define ERROR_IMAGE_NOT_AT_BASE 0x000002BC -#define ERROR_RXACT_STATE_CREATED 0x000002BD -#define ERROR_SEGMENT_NOTIFICATION 0x000002BE -#define ERROR_BAD_CURRENT_DIRECTORY 0x000002BF -#define ERROR_FT_READ_RECOVERY_FROM_BACKUP 0x000002C0 -#define ERROR_FT_WRITE_RECOVERY 0x000002C1 -#define ERROR_IMAGE_MACHINE_TYPE_MISMATCH 0x000002C2 -#define ERROR_RECEIVE_PARTIAL 0x000002C3 -#define ERROR_RECEIVE_EXPEDITED 0x000002C4 -#define ERROR_RECEIVE_PARTIAL_EXPEDITED 0x000002C5 -#define ERROR_EVENT_DONE 0x000002C6 -#define ERROR_EVENT_PENDING 0x000002C7 -#define ERROR_CHECKING_FILE_SYSTEM 0x000002C8 -#define ERROR_FATAL_APP_EXIT 0x000002C9 -#define ERROR_PREDEFINED_HANDLE 0x000002CA -#define ERROR_WAS_UNLOCKED 0x000002CB -#define ERROR_SERVICE_NOTIFICATION 0x000002CC -#define ERROR_WAS_LOCKED 0x000002CD -#define ERROR_LOG_HARD_ERROR 0x000002CE -#define ERROR_ALREADY_WIN32 0x000002CF -#define ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE 0x000002D0 -#define ERROR_NO_YIELD_PERFORMED 0x000002D1 -#define ERROR_TIMER_RESUME_IGNORED 0x000002D2 -#define ERROR_ARBITRATION_UNHANDLED 0x000002D3 -#define ERROR_CARDBUS_NOT_SUPPORTED 0x000002D4 -#define ERROR_MP_PROCESSOR_MISMATCH 0x000002D5 -#define ERROR_HIBERNATED 0x000002D6 -#define ERROR_RESUME_HIBERNATION 0x000002D7 -#define ERROR_FIRMWARE_UPDATED 0x000002D8 -#define ERROR_DRIVERS_LEAKING_LOCKED_PAGES 0x000002D9 -#define ERROR_WAKE_SYSTEM 0x000002DA -#define ERROR_WAIT_1 0x000002DB -#define ERROR_WAIT_2 0x000002DC -#define ERROR_WAIT_3 0x000002DD -#define ERROR_WAIT_63 0x000002DE -#define ERROR_ABANDONED_WAIT_0 0x000002DF -#define ERROR_ABANDONED_WAIT_63 0x000002E0 -#define ERROR_USER_APC 0x000002E1 -#define ERROR_KERNEL_APC 0x000002E2 -#define ERROR_ALERTED 0x000002E3 -#define ERROR_ELEVATION_REQUIRED 0x000002E4 -#define ERROR_REPARSE 0x000002E5 -#define ERROR_OPLOCK_BREAK_IN_PROGRESS 0x000002E6 -#define ERROR_VOLUME_MOUNTED 0x000002E7 -#define ERROR_RXACT_COMMITTED 0x000002E8 -#define ERROR_NOTIFY_CLEANUP 0x000002E9 -#define ERROR_PRIMARY_TRANSPORT_CONNECT_FAILED 0x000002EA -#define ERROR_PAGE_FAULT_TRANSITION 0x000002EB -#define ERROR_PAGE_FAULT_DEMAND_ZERO 0x000002EC -#define ERROR_PAGE_FAULT_COPY_ON_WRITE 0x000002ED -#define ERROR_PAGE_FAULT_GUARD_PAGE 0x000002EE -#define ERROR_PAGE_FAULT_PAGING_FILE 0x000002EF -#define ERROR_CACHE_PAGE_LOCKED 0x000002F0 -#define ERROR_CRASH_DUMP 0x000002F1 -#define ERROR_BUFFER_ALL_ZEROS 0x000002F2 -#define ERROR_REPARSE_OBJECT 0x000002F3 -#define ERROR_RESOURCE_REQUIREMENTS_CHANGED 0x000002F4 -#define ERROR_TRANSLATION_COMPLETE 0x000002F5 -#define ERROR_NOTHING_TO_TERMINATE 0x000002F6 -#define ERROR_PROCESS_NOT_IN_JOB 0x000002F7 -#define ERROR_PROCESS_IN_JOB 0x000002F8 -#define ERROR_VOLSNAP_HIBERNATE_READY 0x000002F9 -#define ERROR_FSFILTER_OP_COMPLETED_SUCCESSFULLY 0x000002FA -#define ERROR_INTERRUPT_VECTOR_ALREADY_CONNECTED 0x000002FB -#define ERROR_INTERRUPT_STILL_CONNECTED 0x000002FC -#define ERROR_WAIT_FOR_OPLOCK 0x000002FD -#define ERROR_DBG_EXCEPTION_HANDLED 0x000002FE -#define ERROR_DBG_CONTINUE 0x000002FF -#define ERROR_CALLBACK_POP_STACK 0x00000300 -#define ERROR_COMPRESSION_DISABLED 0x00000301 -#define ERROR_CANTFETCHBACKWARDS 0x00000302 -#define ERROR_CANTSCROLLBACKWARDS 0x00000303 -#define ERROR_ROWSNOTRELEASED 0x00000304 -#define ERROR_BAD_ACCESSOR_FLAGS 0x00000305 -#define ERROR_ERRORS_ENCOUNTERED 0x00000306 -#define ERROR_NOT_CAPABLE 0x00000307 -#define ERROR_REQUEST_OUT_OF_SEQUENCE 0x00000308 -#define ERROR_VERSION_PARSE_ERROR 0x00000309 -#define ERROR_BADSTARTPOSITION 0x0000030A -#define ERROR_MEMORY_HARDWARE 0x0000030B -#define ERROR_DISK_REPAIR_DISABLED 0x0000030C -#define ERROR_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE 0x0000030D -#define ERROR_SYSTEM_POWERSTATE_TRANSITION 0x0000030E -#define ERROR_SYSTEM_POWERSTATE_COMPLEX_TRANSITION 0x0000030F -#define ERROR_MCA_EXCEPTION 0x00000310 -#define ERROR_ACCESS_AUDIT_BY_POLICY 0x00000311 -#define ERROR_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY 0x00000312 -#define ERROR_ABANDON_HIBERFILE 0x00000313 -#define ERROR_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED 0x00000314 -#define ERROR_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR 0x00000315 -#define ERROR_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR 0x00000316 -#define ERROR_BAD_MCFG_TABLE 0x00000317 -#define ERROR_DISK_REPAIR_REDIRECTED 0x00000318 -#define ERROR_DISK_REPAIR_UNSUCCESSFUL 0x00000319 -#define ERROR_CORRUPT_LOG_OVERFULL 0x0000031A -#define ERROR_CORRUPT_LOG_CORRUPTED 0x0000031B -#define ERROR_CORRUPT_LOG_UNAVAILABLE 0x0000031C -#define ERROR_CORRUPT_LOG_DELETED_FULL 0x0000031D -#define ERROR_CORRUPT_LOG_CLEARED 0x0000031E -#define ERROR_ORPHAN_NAME_EXHAUSTED 0x0000031F -#define ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE 0x00000320 -#define ERROR_CANNOT_GRANT_REQUESTED_OPLOCK 0x00000321 -#define ERROR_CANNOT_BREAK_OPLOCK 0x00000322 -#define ERROR_OPLOCK_HANDLE_CLOSED 0x00000323 -#define ERROR_NO_ACE_CONDITION 0x00000324 -#define ERROR_INVALID_ACE_CONDITION 0x00000325 -#define ERROR_FILE_HANDLE_REVOKED 0x00000326 -#define ERROR_IMAGE_AT_DIFFERENT_BASE 0x00000327 -#define ERROR_EA_ACCESS_DENIED 0x000003E2 -#define ERROR_OPERATION_ABORTED 0x000003E3 -#define ERROR_IO_INCOMPLETE 0x000003E4 -#define ERROR_IO_PENDING 0x000003E5 -#define ERROR_NOACCESS 0x000003E6 -#define ERROR_SWAPERROR 0x000003E7 +#define ERROR_MCA_OCCURED 0x0000028B +#define ERROR_DRIVER_DATABASE_ERROR 0x0000028C +#define ERROR_SYSTEM_HIVE_TOO_LARGE 0x0000028D +#define ERROR_DRIVER_FAILED_PRIOR_UNLOAD 0x0000028E +#define ERROR_VOLSNAP_PREPARE_HIBERNATE 0x0000028F +#define ERROR_HIBERNATION_FAILURE 0x00000290 +#define ERROR_PWD_TOO_LONG 0x00000291 +#define ERROR_FILE_SYSTEM_LIMITATION 0x00000299 +#define ERROR_ASSERTION_FAILURE 0x0000029C +#define ERROR_ACPI_ERROR 0x0000029D +#define ERROR_WOW_ASSERTION 0x0000029E +#define ERROR_PNP_BAD_MPS_TABLE 0x0000029F +#define ERROR_PNP_TRANSLATION_FAILED 0x000002A0 +#define ERROR_PNP_IRQ_TRANSLATION_FAILED 0x000002A1 +#define ERROR_PNP_INVALID_ID 0x000002A2 +#define ERROR_WAKE_SYSTEM_DEBUGGER 0x000002A3 +#define ERROR_HANDLES_CLOSED 0x000002A4 +#define ERROR_EXTRANEOUS_INFORMATION 0x000002A5 +#define ERROR_RXACT_COMMIT_NECESSARY 0x000002A6 +#define ERROR_MEDIA_CHECK 0x000002A7 +#define ERROR_GUID_SUBSTITUTION_MADE 0x000002A8 +#define ERROR_STOPPED_ON_SYMLINK 0x000002A9 +#define ERROR_LONGJUMP 0x000002AA +#define ERROR_PLUGPLAY_QUERY_VETOED 0x000002AB +#define ERROR_UNWIND_CONSOLIDATE 0x000002AC +#define ERROR_REGISTRY_HIVE_RECOVERED 0x000002AD +#define ERROR_DLL_MIGHT_BE_INSECURE 0x000002AE +#define ERROR_DLL_MIGHT_BE_INCOMPATIBLE 0x000002AF +#define ERROR_DBG_EXCEPTION_NOT_HANDLED 0x000002B0 +#define ERROR_DBG_REPLY_LATER 0x000002B1 +#define ERROR_DBG_UNABLE_TO_PROVIDE_HANDLE 0x000002B2 +#define ERROR_DBG_TERMINATE_THREAD 0x000002B3 +#define ERROR_DBG_TERMINATE_PROCESS 0x000002B4 +#define ERROR_DBG_CONTROL_C 0x000002B5 +#define ERROR_DBG_PRINTEXCEPTION_C 0x000002B6 +#define ERROR_DBG_RIPEXCEPTION 0x000002B7 +#define ERROR_DBG_CONTROL_BREAK 0x000002B8 +#define ERROR_DBG_COMMAND_EXCEPTION 0x000002B9 +#define ERROR_OBJECT_NAME_EXISTS 0x000002BA +#define ERROR_THREAD_WAS_SUSPENDED 0x000002BB +#define ERROR_IMAGE_NOT_AT_BASE 0x000002BC +#define ERROR_RXACT_STATE_CREATED 0x000002BD +#define ERROR_SEGMENT_NOTIFICATION 0x000002BE +#define ERROR_BAD_CURRENT_DIRECTORY 0x000002BF +#define ERROR_FT_READ_RECOVERY_FROM_BACKUP 0x000002C0 +#define ERROR_FT_WRITE_RECOVERY 0x000002C1 +#define ERROR_IMAGE_MACHINE_TYPE_MISMATCH 0x000002C2 +#define ERROR_RECEIVE_PARTIAL 0x000002C3 +#define ERROR_RECEIVE_EXPEDITED 0x000002C4 +#define ERROR_RECEIVE_PARTIAL_EXPEDITED 0x000002C5 +#define ERROR_EVENT_DONE 0x000002C6 +#define ERROR_EVENT_PENDING 0x000002C7 +#define ERROR_CHECKING_FILE_SYSTEM 0x000002C8 +#define ERROR_FATAL_APP_EXIT 0x000002C9 +#define ERROR_PREDEFINED_HANDLE 0x000002CA +#define ERROR_WAS_UNLOCKED 0x000002CB +#define ERROR_SERVICE_NOTIFICATION 0x000002CC +#define ERROR_WAS_LOCKED 0x000002CD +#define ERROR_LOG_HARD_ERROR 0x000002CE +#define ERROR_ALREADY_WIN32 0x000002CF +#define ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE 0x000002D0 +#define ERROR_NO_YIELD_PERFORMED 0x000002D1 +#define ERROR_TIMER_RESUME_IGNORED 0x000002D2 +#define ERROR_ARBITRATION_UNHANDLED 0x000002D3 +#define ERROR_CARDBUS_NOT_SUPPORTED 0x000002D4 +#define ERROR_MP_PROCESSOR_MISMATCH 0x000002D5 +#define ERROR_HIBERNATED 0x000002D6 +#define ERROR_RESUME_HIBERNATION 0x000002D7 +#define ERROR_FIRMWARE_UPDATED 0x000002D8 +#define ERROR_DRIVERS_LEAKING_LOCKED_PAGES 0x000002D9 +#define ERROR_WAKE_SYSTEM 0x000002DA +#define ERROR_WAIT_1 0x000002DB +#define ERROR_WAIT_2 0x000002DC +#define ERROR_WAIT_3 0x000002DD +#define ERROR_WAIT_63 0x000002DE +#define ERROR_ABANDONED_WAIT_0 0x000002DF +#define ERROR_ABANDONED_WAIT_63 0x000002E0 +#define ERROR_USER_APC 0x000002E1 +#define ERROR_KERNEL_APC 0x000002E2 +#define ERROR_ALERTED 0x000002E3 +#define ERROR_ELEVATION_REQUIRED 0x000002E4 +#define ERROR_REPARSE 0x000002E5 +#define ERROR_OPLOCK_BREAK_IN_PROGRESS 0x000002E6 +#define ERROR_VOLUME_MOUNTED 0x000002E7 +#define ERROR_RXACT_COMMITTED 0x000002E8 +#define ERROR_NOTIFY_CLEANUP 0x000002E9 +#define ERROR_PRIMARY_TRANSPORT_CONNECT_FAILED 0x000002EA +#define ERROR_PAGE_FAULT_TRANSITION 0x000002EB +#define ERROR_PAGE_FAULT_DEMAND_ZERO 0x000002EC +#define ERROR_PAGE_FAULT_COPY_ON_WRITE 0x000002ED +#define ERROR_PAGE_FAULT_GUARD_PAGE 0x000002EE +#define ERROR_PAGE_FAULT_PAGING_FILE 0x000002EF +#define ERROR_CACHE_PAGE_LOCKED 0x000002F0 +#define ERROR_CRASH_DUMP 0x000002F1 +#define ERROR_BUFFER_ALL_ZEROS 0x000002F2 +#define ERROR_REPARSE_OBJECT 0x000002F3 +#define ERROR_RESOURCE_REQUIREMENTS_CHANGED 0x000002F4 +#define ERROR_TRANSLATION_COMPLETE 0x000002F5 +#define ERROR_NOTHING_TO_TERMINATE 0x000002F6 +#define ERROR_PROCESS_NOT_IN_JOB 0x000002F7 +#define ERROR_PROCESS_IN_JOB 0x000002F8 +#define ERROR_VOLSNAP_HIBERNATE_READY 0x000002F9 +#define ERROR_FSFILTER_OP_COMPLETED_SUCCESSFULLY 0x000002FA +#define ERROR_INTERRUPT_VECTOR_ALREADY_CONNECTED 0x000002FB +#define ERROR_INTERRUPT_STILL_CONNECTED 0x000002FC +#define ERROR_WAIT_FOR_OPLOCK 0x000002FD +#define ERROR_DBG_EXCEPTION_HANDLED 0x000002FE +#define ERROR_DBG_CONTINUE 0x000002FF +#define ERROR_CALLBACK_POP_STACK 0x00000300 +#define ERROR_COMPRESSION_DISABLED 0x00000301 +#define ERROR_CANTFETCHBACKWARDS 0x00000302 +#define ERROR_CANTSCROLLBACKWARDS 0x00000303 +#define ERROR_ROWSNOTRELEASED 0x00000304 +#define ERROR_BAD_ACCESSOR_FLAGS 0x00000305 +#define ERROR_ERRORS_ENCOUNTERED 0x00000306 +#define ERROR_NOT_CAPABLE 0x00000307 +#define ERROR_REQUEST_OUT_OF_SEQUENCE 0x00000308 +#define ERROR_VERSION_PARSE_ERROR 0x00000309 +#define ERROR_BADSTARTPOSITION 0x0000030A +#define ERROR_MEMORY_HARDWARE 0x0000030B +#define ERROR_DISK_REPAIR_DISABLED 0x0000030C +#define ERROR_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE 0x0000030D +#define ERROR_SYSTEM_POWERSTATE_TRANSITION 0x0000030E +#define ERROR_SYSTEM_POWERSTATE_COMPLEX_TRANSITION 0x0000030F +#define ERROR_MCA_EXCEPTION 0x00000310 +#define ERROR_ACCESS_AUDIT_BY_POLICY 0x00000311 +#define ERROR_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY 0x00000312 +#define ERROR_ABANDON_HIBERFILE 0x00000313 +#define ERROR_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED 0x00000314 +#define ERROR_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR 0x00000315 +#define ERROR_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR 0x00000316 +#define ERROR_BAD_MCFG_TABLE 0x00000317 +#define ERROR_DISK_REPAIR_REDIRECTED 0x00000318 +#define ERROR_DISK_REPAIR_UNSUCCESSFUL 0x00000319 +#define ERROR_CORRUPT_LOG_OVERFULL 0x0000031A +#define ERROR_CORRUPT_LOG_CORRUPTED 0x0000031B +#define ERROR_CORRUPT_LOG_UNAVAILABLE 0x0000031C +#define ERROR_CORRUPT_LOG_DELETED_FULL 0x0000031D +#define ERROR_CORRUPT_LOG_CLEARED 0x0000031E +#define ERROR_ORPHAN_NAME_EXHAUSTED 0x0000031F +#define ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE 0x00000320 +#define ERROR_CANNOT_GRANT_REQUESTED_OPLOCK 0x00000321 +#define ERROR_CANNOT_BREAK_OPLOCK 0x00000322 +#define ERROR_OPLOCK_HANDLE_CLOSED 0x00000323 +#define ERROR_NO_ACE_CONDITION 0x00000324 +#define ERROR_INVALID_ACE_CONDITION 0x00000325 +#define ERROR_FILE_HANDLE_REVOKED 0x00000326 +#define ERROR_IMAGE_AT_DIFFERENT_BASE 0x00000327 +#define ERROR_EA_ACCESS_DENIED 0x000003E2 +#define ERROR_OPERATION_ABORTED 0x000003E3 +#define ERROR_IO_INCOMPLETE 0x000003E4 +#define ERROR_IO_PENDING 0x000003E5 +#define ERROR_NOACCESS 0x000003E6 +#define ERROR_SWAPERROR 0x000003E7 /* System Error Codes (1000-1299) */ -#define ERROR_STACK_OVERFLOW 0x000003E9 -#define ERROR_INVALID_MESSAGE 0x000003EA -#define ERROR_CAN_NOT_COMPLETE 0x000003EB -#define ERROR_INVALID_FLAGS 0x000003EC -#define ERROR_UNRECOGNIZED_VOLUME 0x000003ED -#define ERROR_FILE_INVALID 0x000003EE -#define ERROR_FULLSCREEN_MODE 0x000003EF -#define ERROR_NO_TOKEN 0x000003F0 -#define ERROR_BADDB 0x000003F1 -#define ERROR_BADKEY 0x000003F2 -#define ERROR_CANTOPEN 0x000003F3 -#define ERROR_CANTREAD 0x000003F4 -#define ERROR_CANTWRITE 0x000003F5 -#define ERROR_REGISTRY_RECOVERED 0x000003F6 -#define ERROR_REGISTRY_CORRUPT 0x000003F7 -#define ERROR_REGISTRY_IO_FAILED 0x000003F8 -#define ERROR_NOT_REGISTRY_FILE 0x000003F9 -#define ERROR_KEY_DELETED 0x000003FA -#define ERROR_NO_LOG_SPACE 0x000003FB -#define ERROR_KEY_HAS_CHILDREN 0x000003FC -#define ERROR_CHILD_MUST_BE_VOLATILE 0x000003FD -#define ERROR_NOTIFY_ENUM_DIR 0x000003FE -#define ERROR_DEPENDENT_SERVICES_RUNNING 0x0000041B -#define ERROR_INVALID_SERVICE_CONTROL 0x0000041C -#define ERROR_SERVICE_REQUEST_TIMEOUT 0x0000041D -#define ERROR_SERVICE_NO_THREAD 0x0000041E -#define ERROR_SERVICE_DATABASE_LOCKED 0x0000041F -#define ERROR_SERVICE_ALREADY_RUNNING 0x00000420 -#define ERROR_INVALID_SERVICE_ACCOUNT 0x00000421 -#define ERROR_SERVICE_DISABLED 0x00000422 -#define ERROR_CIRCULAR_DEPENDENCY 0x00000423 -#define ERROR_SERVICE_DOES_NOT_EXIST 0x00000424 -#define ERROR_SERVICE_CANNOT_ACCEPT_CTRL 0x00000425 -#define ERROR_SERVICE_NOT_ACTIVE 0x00000426 -#define ERROR_FAILED_SERVICE_CONTROLLER_CONNECT 0x00000427 -#define ERROR_EXCEPTION_IN_SERVICE 0x00000428 -#define ERROR_DATABASE_DOES_NOT_EXIST 0x00000429 -#define ERROR_SERVICE_SPECIFIC_ERROR 0x0000042A -#define ERROR_PROCESS_ABORTED 0x0000042B -#define ERROR_SERVICE_DEPENDENCY_FAIL 0x0000042C -#define ERROR_SERVICE_LOGON_FAILED 0x0000042D -#define ERROR_SERVICE_START_HANG 0x0000042E -#define ERROR_INVALID_SERVICE_LOCK 0x0000042F -#define ERROR_SERVICE_MARKED_FOR_DELETE 0x00000430 -#define ERROR_SERVICE_EXISTS 0x00000431 -#define ERROR_ALREADY_RUNNING_LKG 0x00000432 -#define ERROR_SERVICE_DEPENDENCY_DELETED 0x00000433 -#define ERROR_BOOT_ALREADY_ACCEPTED 0x00000434 -#define ERROR_SERVICE_NEVER_STARTED 0x00000435 -#define ERROR_DUPLICATE_SERVICE_NAME 0x00000436 -#define ERROR_DIFFERENT_SERVICE_ACCOUNT 0x00000437 -#define ERROR_CANNOT_DETECT_DRIVER_FAILURE 0x00000438 -#define ERROR_CANNOT_DETECT_PROCESS_ABORT 0x00000439 -#define ERROR_NO_RECOVERY_PROGRAM 0x0000043A -#define ERROR_SERVICE_NOT_IN_EXE 0x0000043B -#define ERROR_NOT_SAFEBOOT_SERVICE 0x0000043C -#define ERROR_END_OF_MEDIA 0x0000044C -#define ERROR_FILEMARK_DETECTED 0x0000044D -#define ERROR_BEGINNING_OF_MEDIA 0x0000044E -#define ERROR_SETMARK_DETECTED 0x0000044F -#define ERROR_NO_DATA_DETECTED 0x00000450 -#define ERROR_PARTITION_FAILURE 0x00000451 -#define ERROR_INVALID_BLOCK_LENGTH 0x00000452 -#define ERROR_DEVICE_NOT_PARTITIONED 0x00000453 -#define ERROR_UNABLE_TO_LOCK_MEDIA 0x00000454 -#define ERROR_UNABLE_TO_UNLOAD_MEDIA 0x00000455 -#define ERROR_MEDIA_CHANGED 0x00000456 -#define ERROR_BUS_RESET 0x00000457 -#define ERROR_NO_MEDIA_IN_DRIVE 0x00000458 -#define ERROR_NO_UNICODE_TRANSLATION 0x00000459 -#define ERROR_DLL_INIT_FAILED 0x0000045A -#define ERROR_SHUTDOWN_IN_PROGRESS 0x0000045B -#define ERROR_NO_SHUTDOWN_IN_PROGRESS 0x0000045C -#define ERROR_IO_DEVICE 0x0000045D -#define ERROR_SERIAL_NO_DEVICE 0x0000045E -#define ERROR_IRQ_BUSY 0x0000045F -#define ERROR_MORE_WRITES 0x00000460 -#define ERROR_COUNTER_TIMEOUT 0x00000461 -#define ERROR_FLOPPY_ID_MARK_NOT_FOUND 0x00000462 -#define ERROR_FLOPPY_WRONG_CYLINDER 0x00000463 -#define ERROR_FLOPPY_UNKNOWN_ERROR 0x00000464 -#define ERROR_FLOPPY_BAD_REGISTERS 0x00000465 -#define ERROR_DISK_RECALIBRATE_FAILED 0x00000466 -#define ERROR_DISK_OPERATION_FAILED 0x00000467 -#define ERROR_DISK_RESET_FAILED 0x00000468 -#define ERROR_EOM_OVERFLOW 0x00000469 -#define ERROR_NOT_ENOUGH_SERVER_MEMORY 0x0000046A -#define ERROR_POSSIBLE_DEADLOCK 0x0000046B -#define ERROR_MAPPED_ALIGNMENT 0x0000046C -#define ERROR_SET_POWER_STATE_VETOED 0x00000474 -#define ERROR_SET_POWER_STATE_FAILED 0x00000475 -#define ERROR_TOO_MANY_LINKS 0x00000476 -#define ERROR_OLD_WIN_VERSION 0x0000047E -#define ERROR_APP_WRONG_OS 0x0000047F -#define ERROR_SINGLE_INSTANCE_APP 0x00000480 -#define ERROR_RMODE_APP 0x00000481 -#define ERROR_INVALID_DLL 0x00000482 -#define ERROR_NO_ASSOCIATION 0x00000483 -#define ERROR_DDE_FAIL 0x00000484 -#define ERROR_DLL_NOT_FOUND 0x00000485 -#define ERROR_NO_MORE_USER_HANDLES 0x00000486 -#define ERROR_MESSAGE_SYNC_ONLY 0x00000487 -#define ERROR_SOURCE_ELEMENT_EMPTY 0x00000488 -#define ERROR_DESTINATION_ELEMENT_FULL 0x00000489 -#define ERROR_ILLEGAL_ELEMENT_ADDRESS 0x0000048A -#define ERROR_MAGAZINE_NOT_PRESENT 0x0000048B -#define ERROR_DEVICE_REINITIALIZATION_NEEDED 0x0000048C -#define ERROR_DEVICE_REQUIRES_CLEANING 0x0000048D -#define ERROR_DEVICE_DOOR_OPEN 0x0000048E -#define ERROR_DEVICE_NOT_CONNECTED 0x0000048F -#define ERROR_NOT_FOUND 0x00000490 -#define ERROR_NO_MATCH 0x00000491 -#define ERROR_SET_NOT_FOUND 0x00000492 -#define ERROR_POINT_NOT_FOUND 0x00000493 -#define ERROR_NO_TRACKING_SERVICE 0x00000494 -#define ERROR_NO_VOLUME_ID 0x00000495 -#define ERROR_UNABLE_TO_REMOVE_REPLACED 0x00000497 -#define ERROR_UNABLE_TO_MOVE_REPLACEMENT 0x00000498 -#define ERROR_UNABLE_TO_MOVE_REPLACEMENT_2 0x00000499 -#define ERROR_JOURNAL_DELETE_IN_PROGRESS 0x0000049A -#define ERROR_JOURNAL_NOT_ACTIVE 0x0000049B -#define ERROR_POTENTIAL_FILE_FOUND 0x0000049C -#define ERROR_JOURNAL_ENTRY_DELETED 0x0000049D -#define ERROR_SHUTDOWN_IS_SCHEDULED 0x000004A6 -#define ERROR_SHUTDOWN_USERS_LOGGED_ON 0x000004A7 -#define ERROR_BAD_DEVICE 0x000004B0 -#define ERROR_CONNECTION_UNAVAIL 0x000004B1 -#define ERROR_DEVICE_ALREADY_REMEMBERED 0x000004B2 -#define ERROR_NO_NET_OR_BAD_PATH 0x000004B3 -#define ERROR_BAD_PROVIDER 0x000004B4 -#define ERROR_CANNOT_OPEN_PROFILE 0x000004B5 -#define ERROR_BAD_PROFILE 0x000004B6 -#define ERROR_NOT_CONTAINER 0x000004B7 -#define ERROR_EXTENDED_ERROR 0x000004B8 -#define ERROR_INVALID_GROUPNAME 0x000004B9 -#define ERROR_INVALID_COMPUTERNAME 0x000004BA -#define ERROR_INVALID_EVENTNAME 0x000004BB -#define ERROR_INVALID_DOMAINNAME 0x000004BC -#define ERROR_INVALID_SERVICENAME 0x000004BD -#define ERROR_INVALID_NETNAME 0x000004BE -#define ERROR_INVALID_SHARENAME 0x000004BF -#define ERROR_INVALID_PASSWORDNAME 0x000004C0 -#define ERROR_INVALID_MESSAGENAME 0x000004C1 -#define ERROR_INVALID_MESSAGEDEST 0x000004C2 -#define ERROR_SESSION_CREDENTIAL_CONFLICT 0x000004C3 -#define ERROR_REMOTE_SESSION_LIMIT_EXCEEDED 0x000004C4 -#define ERROR_DUP_DOMAINNAME 0x000004C5 -#define ERROR_NO_NETWORK 0x000004C6 -#define ERROR_CANCELLED 0x000004C7 -#define ERROR_USER_MAPPED_FILE 0x000004C8 -#define ERROR_CONNECTION_REFUSED 0x000004C9 -#define ERROR_GRACEFUL_DISCONNECT 0x000004CA -#define ERROR_ADDRESS_ALREADY_ASSOCIATED 0x000004CB -#define ERROR_ADDRESS_NOT_ASSOCIATED 0x000004CC -#define ERROR_CONNECTION_INVALID 0x000004CD -#define ERROR_CONNECTION_ACTIVE 0x000004CE -#define ERROR_NETWORK_UNREACHABLE 0x000004CF -#define ERROR_HOST_UNREACHABLE 0x000004D0 -#define ERROR_PROTOCOL_UNREACHABLE 0x000004D1 -#define ERROR_PORT_UNREACHABLE 0x000004D2 -#define ERROR_REQUEST_ABORTED 0x000004D3 -#define ERROR_CONNECTION_ABORTED 0x000004D4 -#define ERROR_RETRY 0x000004D5 -#define ERROR_CONNECTION_COUNT_LIMIT 0x000004D6 -#define ERROR_LOGIN_TIME_RESTRICTION 0x000004D7 -#define ERROR_LOGIN_WKSTA_RESTRICTION 0x000004D8 -#define ERROR_INCORRECT_ADDRESS 0x000004D9 -#define ERROR_ALREADY_REGISTERED 0x000004DA -#define ERROR_SERVICE_NOT_FOUND 0x000004DB -#define ERROR_NOT_AUTHENTICATED 0x000004DC -#define ERROR_NOT_LOGGED_ON 0x000004DD -#define ERROR_CONTINUE 0x000004DE -#define ERROR_ALREADY_INITIALIZED 0x000004DF -#define ERROR_NO_MORE_DEVICES 0x000004E0 -#define ERROR_NO_SUCH_SITE 0x000004E1 -#define ERROR_DOMAIN_CONTROLLER_EXISTS 0x000004E2 -#define ERROR_ONLY_IF_CONNECTED 0x000004E3 -#define ERROR_OVERRIDE_NOCHANGES 0x000004E4 -#define ERROR_BAD_USER_PROFILE 0x000004E5 -#define ERROR_NOT_SUPPORTED_ON_SBS 0x000004E6 -#define ERROR_SERVER_SHUTDOWN_IN_PROGRESS 0x000004E7 -#define ERROR_HOST_DOWN 0x000004E8 -#define ERROR_NON_ACCOUNT_SID 0x000004E9 -#define ERROR_NON_DOMAIN_SID 0x000004EA -#define ERROR_APPHELP_BLOCK 0x000004EB -#define ERROR_ACCESS_DISABLED_BY_POLICY 0x000004EC -#define ERROR_REG_NAT_CONSUMPTION 0x000004ED -#define ERROR_CSCSHARE_OFFLINE 0x000004EE -#define ERROR_PKINIT_FAILURE 0x000004EF -#define ERROR_SMARTCARD_SUBSYSTEM_FAILURE 0x000004F0 -#define ERROR_DOWNGRADE_DETECTED 0x000004F1 -#define ERROR_MACHINE_LOCKED 0x000004F7 -#define ERROR_CALLBACK_SUPPLIED_INVALID_DATA 0x000004F9 -#define ERROR_SYNC_FOREGROUND_REFRESH_REQUIRED 0x000004FA -#define ERROR_DRIVER_BLOCKED 0x000004FB -#define ERROR_INVALID_IMPORT_OF_NON_DLL 0x000004FC -#define ERROR_ACCESS_DISABLED_WEBBLADE 0x000004FD -#define ERROR_ACCESS_DISABLED_WEBBLADE_TAMPER 0x000004FE -#define ERROR_RECOVERY_FAILURE 0x000004FF -#define ERROR_ALREADY_FIBER 0x00000500 -#define ERROR_ALREADY_THREAD 0x00000501 -#define ERROR_STACK_BUFFER_OVERRUN 0x00000502 -#define ERROR_PARAMETER_QUOTA_EXCEEDED 0x00000503 -#define ERROR_DEBUGGER_INACTIVE 0x00000504 -#define ERROR_DELAY_LOAD_FAILED 0x00000505 -#define ERROR_VDM_DISALLOWED 0x00000506 -#define ERROR_UNIDENTIFIED_ERROR 0x00000507 -#define ERROR_INVALID_CRUNTIME_PARAMETER 0x00000508 -#define ERROR_BEYOND_VDL 0x00000509 -#define ERROR_INCOMPATIBLE_SERVICE_SID_TYPE 0x0000050A -#define ERROR_DRIVER_PROCESS_TERMINATED 0x0000050B -#define ERROR_IMPLEMENTATION_LIMIT 0x0000050C -#define ERROR_PROCESS_IS_PROTECTED 0x0000050D -#define ERROR_SERVICE_NOTIFY_CLIENT_LAGGING 0x0000050E -#define ERROR_DISK_QUOTA_EXCEEDED 0x0000050F -#define ERROR_CONTENT_BLOCKED 0x00000510 -#define ERROR_INCOMPATIBLE_SERVICE_PRIVILEGE 0x00000511 -#define ERROR_APP_HANG 0x00000512 -#define ERROR_INVALID_LABEL 0x00000513 +#define ERROR_STACK_OVERFLOW 0x000003E9 +#define ERROR_INVALID_MESSAGE 0x000003EA +#define ERROR_CAN_NOT_COMPLETE 0x000003EB +#define ERROR_INVALID_FLAGS 0x000003EC +#define ERROR_UNRECOGNIZED_VOLUME 0x000003ED +#define ERROR_FILE_INVALID 0x000003EE +#define ERROR_FULLSCREEN_MODE 0x000003EF +#define ERROR_NO_TOKEN 0x000003F0 +#define ERROR_BADDB 0x000003F1 +#define ERROR_BADKEY 0x000003F2 +#define ERROR_CANTOPEN 0x000003F3 +#define ERROR_CANTREAD 0x000003F4 +#define ERROR_CANTWRITE 0x000003F5 +#define ERROR_REGISTRY_RECOVERED 0x000003F6 +#define ERROR_REGISTRY_CORRUPT 0x000003F7 +#define ERROR_REGISTRY_IO_FAILED 0x000003F8 +#define ERROR_NOT_REGISTRY_FILE 0x000003F9 +#define ERROR_KEY_DELETED 0x000003FA +#define ERROR_NO_LOG_SPACE 0x000003FB +#define ERROR_KEY_HAS_CHILDREN 0x000003FC +#define ERROR_CHILD_MUST_BE_VOLATILE 0x000003FD +#define ERROR_NOTIFY_ENUM_DIR 0x000003FE +#define ERROR_DEPENDENT_SERVICES_RUNNING 0x0000041B +#define ERROR_INVALID_SERVICE_CONTROL 0x0000041C +#define ERROR_SERVICE_REQUEST_TIMEOUT 0x0000041D +#define ERROR_SERVICE_NO_THREAD 0x0000041E +#define ERROR_SERVICE_DATABASE_LOCKED 0x0000041F +#define ERROR_SERVICE_ALREADY_RUNNING 0x00000420 +#define ERROR_INVALID_SERVICE_ACCOUNT 0x00000421 +#define ERROR_SERVICE_DISABLED 0x00000422 +#define ERROR_CIRCULAR_DEPENDENCY 0x00000423 +#define ERROR_SERVICE_DOES_NOT_EXIST 0x00000424 +#define ERROR_SERVICE_CANNOT_ACCEPT_CTRL 0x00000425 +#define ERROR_SERVICE_NOT_ACTIVE 0x00000426 +#define ERROR_FAILED_SERVICE_CONTROLLER_CONNECT 0x00000427 +#define ERROR_EXCEPTION_IN_SERVICE 0x00000428 +#define ERROR_DATABASE_DOES_NOT_EXIST 0x00000429 +#define ERROR_SERVICE_SPECIFIC_ERROR 0x0000042A +#define ERROR_PROCESS_ABORTED 0x0000042B +#define ERROR_SERVICE_DEPENDENCY_FAIL 0x0000042C +#define ERROR_SERVICE_LOGON_FAILED 0x0000042D +#define ERROR_SERVICE_START_HANG 0x0000042E +#define ERROR_INVALID_SERVICE_LOCK 0x0000042F +#define ERROR_SERVICE_MARKED_FOR_DELETE 0x00000430 +#define ERROR_SERVICE_EXISTS 0x00000431 +#define ERROR_ALREADY_RUNNING_LKG 0x00000432 +#define ERROR_SERVICE_DEPENDENCY_DELETED 0x00000433 +#define ERROR_BOOT_ALREADY_ACCEPTED 0x00000434 +#define ERROR_SERVICE_NEVER_STARTED 0x00000435 +#define ERROR_DUPLICATE_SERVICE_NAME 0x00000436 +#define ERROR_DIFFERENT_SERVICE_ACCOUNT 0x00000437 +#define ERROR_CANNOT_DETECT_DRIVER_FAILURE 0x00000438 +#define ERROR_CANNOT_DETECT_PROCESS_ABORT 0x00000439 +#define ERROR_NO_RECOVERY_PROGRAM 0x0000043A +#define ERROR_SERVICE_NOT_IN_EXE 0x0000043B +#define ERROR_NOT_SAFEBOOT_SERVICE 0x0000043C +#define ERROR_END_OF_MEDIA 0x0000044C +#define ERROR_FILEMARK_DETECTED 0x0000044D +#define ERROR_BEGINNING_OF_MEDIA 0x0000044E +#define ERROR_SETMARK_DETECTED 0x0000044F +#define ERROR_NO_DATA_DETECTED 0x00000450 +#define ERROR_PARTITION_FAILURE 0x00000451 +#define ERROR_INVALID_BLOCK_LENGTH 0x00000452 +#define ERROR_DEVICE_NOT_PARTITIONED 0x00000453 +#define ERROR_UNABLE_TO_LOCK_MEDIA 0x00000454 +#define ERROR_UNABLE_TO_UNLOAD_MEDIA 0x00000455 +#define ERROR_MEDIA_CHANGED 0x00000456 +#define ERROR_BUS_RESET 0x00000457 +#define ERROR_NO_MEDIA_IN_DRIVE 0x00000458 +#define ERROR_NO_UNICODE_TRANSLATION 0x00000459 +#define ERROR_DLL_INIT_FAILED 0x0000045A +#define ERROR_SHUTDOWN_IN_PROGRESS 0x0000045B +#define ERROR_NO_SHUTDOWN_IN_PROGRESS 0x0000045C +#define ERROR_IO_DEVICE 0x0000045D +#define ERROR_SERIAL_NO_DEVICE 0x0000045E +#define ERROR_IRQ_BUSY 0x0000045F +#define ERROR_MORE_WRITES 0x00000460 +#define ERROR_COUNTER_TIMEOUT 0x00000461 +#define ERROR_FLOPPY_ID_MARK_NOT_FOUND 0x00000462 +#define ERROR_FLOPPY_WRONG_CYLINDER 0x00000463 +#define ERROR_FLOPPY_UNKNOWN_ERROR 0x00000464 +#define ERROR_FLOPPY_BAD_REGISTERS 0x00000465 +#define ERROR_DISK_RECALIBRATE_FAILED 0x00000466 +#define ERROR_DISK_OPERATION_FAILED 0x00000467 +#define ERROR_DISK_RESET_FAILED 0x00000468 +#define ERROR_EOM_OVERFLOW 0x00000469 +#define ERROR_NOT_ENOUGH_SERVER_MEMORY 0x0000046A +#define ERROR_POSSIBLE_DEADLOCK 0x0000046B +#define ERROR_MAPPED_ALIGNMENT 0x0000046C +#define ERROR_SET_POWER_STATE_VETOED 0x00000474 +#define ERROR_SET_POWER_STATE_FAILED 0x00000475 +#define ERROR_TOO_MANY_LINKS 0x00000476 +#define ERROR_OLD_WIN_VERSION 0x0000047E +#define ERROR_APP_WRONG_OS 0x0000047F +#define ERROR_SINGLE_INSTANCE_APP 0x00000480 +#define ERROR_RMODE_APP 0x00000481 +#define ERROR_INVALID_DLL 0x00000482 +#define ERROR_NO_ASSOCIATION 0x00000483 +#define ERROR_DDE_FAIL 0x00000484 +#define ERROR_DLL_NOT_FOUND 0x00000485 +#define ERROR_NO_MORE_USER_HANDLES 0x00000486 +#define ERROR_MESSAGE_SYNC_ONLY 0x00000487 +#define ERROR_SOURCE_ELEMENT_EMPTY 0x00000488 +#define ERROR_DESTINATION_ELEMENT_FULL 0x00000489 +#define ERROR_ILLEGAL_ELEMENT_ADDRESS 0x0000048A +#define ERROR_MAGAZINE_NOT_PRESENT 0x0000048B +#define ERROR_DEVICE_REINITIALIZATION_NEEDED 0x0000048C +#define ERROR_DEVICE_REQUIRES_CLEANING 0x0000048D +#define ERROR_DEVICE_DOOR_OPEN 0x0000048E +#define ERROR_DEVICE_NOT_CONNECTED 0x0000048F +#define ERROR_NOT_FOUND 0x00000490 +#define ERROR_NO_MATCH 0x00000491 +#define ERROR_SET_NOT_FOUND 0x00000492 +#define ERROR_POINT_NOT_FOUND 0x00000493 +#define ERROR_NO_TRACKING_SERVICE 0x00000494 +#define ERROR_NO_VOLUME_ID 0x00000495 +#define ERROR_UNABLE_TO_REMOVE_REPLACED 0x00000497 +#define ERROR_UNABLE_TO_MOVE_REPLACEMENT 0x00000498 +#define ERROR_UNABLE_TO_MOVE_REPLACEMENT_2 0x00000499 +#define ERROR_JOURNAL_DELETE_IN_PROGRESS 0x0000049A +#define ERROR_JOURNAL_NOT_ACTIVE 0x0000049B +#define ERROR_POTENTIAL_FILE_FOUND 0x0000049C +#define ERROR_JOURNAL_ENTRY_DELETED 0x0000049D +#define ERROR_SHUTDOWN_IS_SCHEDULED 0x000004A6 +#define ERROR_SHUTDOWN_USERS_LOGGED_ON 0x000004A7 +#define ERROR_BAD_DEVICE 0x000004B0 +#define ERROR_CONNECTION_UNAVAIL 0x000004B1 +#define ERROR_DEVICE_ALREADY_REMEMBERED 0x000004B2 +#define ERROR_NO_NET_OR_BAD_PATH 0x000004B3 +#define ERROR_BAD_PROVIDER 0x000004B4 +#define ERROR_CANNOT_OPEN_PROFILE 0x000004B5 +#define ERROR_BAD_PROFILE 0x000004B6 +#define ERROR_NOT_CONTAINER 0x000004B7 +#define ERROR_EXTENDED_ERROR 0x000004B8 +#define ERROR_INVALID_GROUPNAME 0x000004B9 +#define ERROR_INVALID_COMPUTERNAME 0x000004BA +#define ERROR_INVALID_EVENTNAME 0x000004BB +#define ERROR_INVALID_DOMAINNAME 0x000004BC +#define ERROR_INVALID_SERVICENAME 0x000004BD +#define ERROR_INVALID_NETNAME 0x000004BE +#define ERROR_INVALID_SHARENAME 0x000004BF +#define ERROR_INVALID_PASSWORDNAME 0x000004C0 +#define ERROR_INVALID_MESSAGENAME 0x000004C1 +#define ERROR_INVALID_MESSAGEDEST 0x000004C2 +#define ERROR_SESSION_CREDENTIAL_CONFLICT 0x000004C3 +#define ERROR_REMOTE_SESSION_LIMIT_EXCEEDED 0x000004C4 +#define ERROR_DUP_DOMAINNAME 0x000004C5 +#define ERROR_NO_NETWORK 0x000004C6 +#define ERROR_CANCELLED 0x000004C7 +#define ERROR_USER_MAPPED_FILE 0x000004C8 +#define ERROR_CONNECTION_REFUSED 0x000004C9 +#define ERROR_GRACEFUL_DISCONNECT 0x000004CA +#define ERROR_ADDRESS_ALREADY_ASSOCIATED 0x000004CB +#define ERROR_ADDRESS_NOT_ASSOCIATED 0x000004CC +#define ERROR_CONNECTION_INVALID 0x000004CD +#define ERROR_CONNECTION_ACTIVE 0x000004CE +#define ERROR_NETWORK_UNREACHABLE 0x000004CF +#define ERROR_HOST_UNREACHABLE 0x000004D0 +#define ERROR_PROTOCOL_UNREACHABLE 0x000004D1 +#define ERROR_PORT_UNREACHABLE 0x000004D2 +#define ERROR_REQUEST_ABORTED 0x000004D3 +#define ERROR_CONNECTION_ABORTED 0x000004D4 +#define ERROR_RETRY 0x000004D5 +#define ERROR_CONNECTION_COUNT_LIMIT 0x000004D6 +#define ERROR_LOGIN_TIME_RESTRICTION 0x000004D7 +#define ERROR_LOGIN_WKSTA_RESTRICTION 0x000004D8 +#define ERROR_INCORRECT_ADDRESS 0x000004D9 +#define ERROR_ALREADY_REGISTERED 0x000004DA +#define ERROR_SERVICE_NOT_FOUND 0x000004DB +#define ERROR_NOT_AUTHENTICATED 0x000004DC +#define ERROR_NOT_LOGGED_ON 0x000004DD +#define ERROR_CONTINUE 0x000004DE +#define ERROR_ALREADY_INITIALIZED 0x000004DF +#define ERROR_NO_MORE_DEVICES 0x000004E0 +#define ERROR_NO_SUCH_SITE 0x000004E1 +#define ERROR_DOMAIN_CONTROLLER_EXISTS 0x000004E2 +#define ERROR_ONLY_IF_CONNECTED 0x000004E3 +#define ERROR_OVERRIDE_NOCHANGES 0x000004E4 +#define ERROR_BAD_USER_PROFILE 0x000004E5 +#define ERROR_NOT_SUPPORTED_ON_SBS 0x000004E6 +#define ERROR_SERVER_SHUTDOWN_IN_PROGRESS 0x000004E7 +#define ERROR_HOST_DOWN 0x000004E8 +#define ERROR_NON_ACCOUNT_SID 0x000004E9 +#define ERROR_NON_DOMAIN_SID 0x000004EA +#define ERROR_APPHELP_BLOCK 0x000004EB +#define ERROR_ACCESS_DISABLED_BY_POLICY 0x000004EC +#define ERROR_REG_NAT_CONSUMPTION 0x000004ED +#define ERROR_CSCSHARE_OFFLINE 0x000004EE +#define ERROR_PKINIT_FAILURE 0x000004EF +#define ERROR_SMARTCARD_SUBSYSTEM_FAILURE 0x000004F0 +#define ERROR_DOWNGRADE_DETECTED 0x000004F1 +#define ERROR_MACHINE_LOCKED 0x000004F7 +#define ERROR_CALLBACK_SUPPLIED_INVALID_DATA 0x000004F9 +#define ERROR_SYNC_FOREGROUND_REFRESH_REQUIRED 0x000004FA +#define ERROR_DRIVER_BLOCKED 0x000004FB +#define ERROR_INVALID_IMPORT_OF_NON_DLL 0x000004FC +#define ERROR_ACCESS_DISABLED_WEBBLADE 0x000004FD +#define ERROR_ACCESS_DISABLED_WEBBLADE_TAMPER 0x000004FE +#define ERROR_RECOVERY_FAILURE 0x000004FF +#define ERROR_ALREADY_FIBER 0x00000500 +#define ERROR_ALREADY_THREAD 0x00000501 +#define ERROR_STACK_BUFFER_OVERRUN 0x00000502 +#define ERROR_PARAMETER_QUOTA_EXCEEDED 0x00000503 +#define ERROR_DEBUGGER_INACTIVE 0x00000504 +#define ERROR_DELAY_LOAD_FAILED 0x00000505 +#define ERROR_VDM_DISALLOWED 0x00000506 +#define ERROR_UNIDENTIFIED_ERROR 0x00000507 +#define ERROR_INVALID_CRUNTIME_PARAMETER 0x00000508 +#define ERROR_BEYOND_VDL 0x00000509 +#define ERROR_INCOMPATIBLE_SERVICE_SID_TYPE 0x0000050A +#define ERROR_DRIVER_PROCESS_TERMINATED 0x0000050B +#define ERROR_IMPLEMENTATION_LIMIT 0x0000050C +#define ERROR_PROCESS_IS_PROTECTED 0x0000050D +#define ERROR_SERVICE_NOTIFY_CLIENT_LAGGING 0x0000050E +#define ERROR_DISK_QUOTA_EXCEEDED 0x0000050F +#define ERROR_CONTENT_BLOCKED 0x00000510 +#define ERROR_INCOMPATIBLE_SERVICE_PRIVILEGE 0x00000511 +#define ERROR_APP_HANG 0x00000512 +#define ERROR_INVALID_LABEL 0x00000513 /* System Error Codes (1300-1699) */ -#define ERROR_NOT_ALL_ASSIGNED 0x00000514 -#define ERROR_SOME_NOT_MAPPED 0x00000515 -#define ERROR_NO_QUOTAS_FOR_ACCOUNT 0x00000516 -#define ERROR_LOCAL_USER_SESSION_KEY 0x00000517 -#define ERROR_NULL_LM_PASSWORD 0x00000518 -#define ERROR_UNKNOWN_REVISION 0x00000519 -#define ERROR_REVISION_MISMATCH 0x0000051A -#define ERROR_INVALID_OWNER 0x0000051B -#define ERROR_INVALID_PRIMARY_GROUP 0x0000051C -#define ERROR_NO_IMPERSONATION_TOKEN 0x0000051D -#define ERROR_CANT_DISABLE_MANDATORY 0x0000051E -#define ERROR_NO_LOGON_SERVERS 0x0000051F -#define ERROR_NO_SUCH_LOGON_SESSION 0x00000520 -#define ERROR_NO_SUCH_PRIVILEGE 0x00000521 -#define ERROR_PRIVILEGE_NOT_HELD 0x00000522 -#define ERROR_INVALID_ACCOUNT_NAME 0x00000523 -#define ERROR_USER_EXISTS 0x00000524 -#define ERROR_NO_SUCH_USER 0x00000525 -#define ERROR_GROUP_EXISTS 0x00000526 -#define ERROR_NO_SUCH_GROUP 0x00000527 -#define ERROR_MEMBER_IN_GROUP 0x00000528 -#define ERROR_MEMBER_NOT_IN_GROUP 0x00000529 -#define ERROR_LAST_ADMIN 0x0000052A -#define ERROR_WRONG_PASSWORD 0x0000052B -#define ERROR_ILL_FORMED_PASSWORD 0x0000052C -#define ERROR_PASSWORD_RESTRICTION 0x0000052D -#define ERROR_LOGON_FAILURE 0x0000052E -#define ERROR_ACCOUNT_RESTRICTION 0x0000052F -#define ERROR_INVALID_LOGON_HOURS 0x00000530 -#define ERROR_INVALID_WORKSTATION 0x00000531 -#define ERROR_PASSWORD_EXPIRED 0x00000532 -#define ERROR_ACCOUNT_DISABLED 0x00000533 -#define ERROR_NONE_MAPPED 0x00000534 -#define ERROR_TOO_MANY_LUIDS_REQUESTED 0x00000535 -#define ERROR_LUIDS_EXHAUSTED 0x00000536 -#define ERROR_INVALID_SUB_AUTHORITY 0x00000537 -#define ERROR_INVALID_ACL 0x00000538 -#define ERROR_INVALID_SID 0x00000539 -#define ERROR_INVALID_SECURITY_DESCR 0x0000053A -#define ERROR_BAD_INHERITANCE_ACL 0x0000053C -#define ERROR_SERVER_DISABLED 0x0000053D -#define ERROR_SERVER_NOT_DISABLED 0x0000053E -#define ERROR_INVALID_ID_AUTHORITY 0x0000053F -#define ERROR_ALLOTTED_SPACE_EXCEEDED 0x00000540 -#define ERROR_INVALID_GROUP_ATTRIBUTES 0x00000541 -#define ERROR_BAD_IMPERSONATION_LEVEL 0x00000542 -#define ERROR_CANT_OPEN_ANONYMOUS 0x00000543 -#define ERROR_BAD_VALIDATION_CLASS 0x00000544 -#define ERROR_BAD_TOKEN_TYPE 0x00000545 -#define ERROR_NO_SECURITY_ON_OBJECT 0x00000546 -#define ERROR_CANT_ACCESS_DOMAIN_INFO 0x00000547 -#define ERROR_INVALID_SERVER_STATE 0x00000548 -#define ERROR_INVALID_DOMAIN_STATE 0x00000549 -#define ERROR_INVALID_DOMAIN_ROLE 0x0000054A -#define ERROR_NO_SUCH_DOMAIN 0x0000054B -#define ERROR_DOMAIN_EXISTS 0x0000054C -#define ERROR_DOMAIN_LIMIT_EXCEEDED 0x0000054D -#define ERROR_INTERNAL_DB_CORRUPTION 0x0000054E -#define ERROR_INTERNAL_ERROR 0x0000054F -#define ERROR_GENERIC_NOT_MAPPED 0x00000550 -#define ERROR_BAD_DESCRIPTOR_FORMAT 0x00000551 -#define ERROR_NOT_LOGON_PROCESS 0x00000552 -#define ERROR_LOGON_SESSION_EXISTS 0x00000553 -#define ERROR_NO_SUCH_PACKAGE 0x00000554 -#define ERROR_BAD_LOGON_SESSION_STATE 0x00000555 -#define ERROR_LOGON_SESSION_COLLISION 0x00000556 -#define ERROR_INVALID_LOGON_TYPE 0x00000557 -#define ERROR_CANNOT_IMPERSONATE 0x00000558 -#define ERROR_RXACT_INVALID_STATE 0x00000559 -#define ERROR_RXACT_COMMIT_FAILURE 0x0000055A -#define ERROR_SPECIAL_ACCOUNT 0x0000055B -#define ERROR_SPECIAL_GROUP 0x0000055C -#define ERROR_SPECIAL_USER 0x0000055D -#define ERROR_MEMBERS_PRIMARY_GROUP 0x0000055E -#define ERROR_TOKEN_ALREADY_IN_USE 0x0000055F -#define ERROR_NO_SUCH_ALIAS 0x00000560 -#define ERROR_MEMBER_NOT_IN_ALIAS 0x00000561 -#define ERROR_MEMBER_IN_ALIAS 0x00000562 -#define ERROR_ALIAS_EXISTS 0x00000563 -#define ERROR_LOGON_NOT_GRANTED 0x00000564 -#define ERROR_TOO_MANY_SECRETS 0x00000565 -#define ERROR_SECRET_TOO_LONG 0x00000566 -#define ERROR_INTERNAL_DB_ERROR 0x00000567 -#define ERROR_TOO_MANY_CONTEXT_IDS 0x00000568 -#define ERROR_LOGON_TYPE_NOT_GRANTED 0x00000569 -#define ERROR_NT_CROSS_ENCRYPTION_REQUIRED 0x0000056A -#define ERROR_NO_SUCH_MEMBER 0x0000056B -#define ERROR_INVALID_MEMBER 0x0000056C -#define ERROR_TOO_MANY_SIDS 0x0000056D -#define ERROR_LM_CROSS_ENCRYPTION_REQUIRED 0x0000056E -#define ERROR_NO_INHERITANCE 0x0000056F -#define ERROR_FILE_CORRUPT 0x00000570 -#define ERROR_DISK_CORRUPT 0x00000571 -#define ERROR_NO_USER_SESSION_KEY 0x00000572 -#define ERROR_LICENSE_QUOTA_EXCEEDED 0x00000573 -#define ERROR_WRONG_TARGET_NAME 0x00000574 -#define ERROR_MUTUAL_AUTH_FAILED 0x00000575 -#define ERROR_TIME_SKEW 0x00000576 -#define ERROR_CURRENT_DOMAIN_NOT_ALLOWED 0x00000577 -#define ERROR_INVALID_WINDOW_HANDLE 0x00000578 -#define ERROR_INVALID_MENU_HANDLE 0x00000579 -#define ERROR_INVALID_CURSOR_HANDLE 0x0000057A -#define ERROR_INVALID_ACCEL_HANDLE 0x0000057B -#define ERROR_INVALID_HOOK_HANDLE 0x0000057C -#define ERROR_INVALID_DWP_HANDLE 0x0000057D -#define ERROR_TLW_WITH_WSCHILD 0x0000057E -#define ERROR_CANNOT_FIND_WND_CLASS 0x0000057F -#define ERROR_WINDOW_OF_OTHER_THREAD 0x00000580 -#define ERROR_HOTKEY_ALREADY_REGISTERED 0x00000581 -#define ERROR_CLASS_ALREADY_EXISTS 0x00000582 -#define ERROR_CLASS_DOES_NOT_EXIST 0x00000583 -#define ERROR_CLASS_HAS_WINDOWS 0x00000584 -#define ERROR_INVALID_INDEX 0x00000585 -#define ERROR_INVALID_ICON_HANDLE 0x00000586 -#define ERROR_PRIVATE_DIALOG_INDEX 0x00000587 -#define ERROR_LISTBOX_ID_NOT_FOUND 0x00000588 -#define ERROR_NO_WILDCARD_CHARACTERS 0x00000589 -#define ERROR_CLIPBOARD_NOT_OPEN 0x0000058A -#define ERROR_HOTKEY_NOT_REGISTERED 0x0000058B -#define ERROR_WINDOW_NOT_DIALOG 0x0000058C -#define ERROR_CONTROL_ID_NOT_FOUND 0x0000058D -#define ERROR_INVALID_COMBOBOX_MESSAGE 0x0000058E -#define ERROR_WINDOW_NOT_COMBOBOX 0x0000058F -#define ERROR_INVALID_EDIT_HEIGHT 0x00000590 -#define ERROR_DC_NOT_FOUND 0x00000591 -#define ERROR_INVALID_HOOK_FILTER 0x00000592 -#define ERROR_INVALID_FILTER_PROC 0x00000593 -#define ERROR_HOOK_NEEDS_HMOD 0x00000594 -#define ERROR_GLOBAL_ONLY_HOOK 0x00000595 -#define ERROR_JOURNAL_HOOK_SET 0x00000596 -#define ERROR_HOOK_NOT_INSTALLED 0x00000597 -#define ERROR_INVALID_LB_MESSAGE 0x00000598 -#define ERROR_SETCOUNT_ON_BAD_LB 0x00000599 -#define ERROR_LB_WITHOUT_TABSTOPS 0x0000059A -#define ERROR_DESTROY_OBJECT_OF_OTHER_THREAD 0x0000059B -#define ERROR_CHILD_WINDOW_MENU 0x0000059C -#define ERROR_NO_SYSTEM_MENU 0x0000059D -#define ERROR_INVALID_MSGBOX_STYLE 0x0000059E -#define ERROR_INVALID_SPI_VALUE 0x0000059F -#define ERROR_SCREEN_ALREADY_LOCKED 0x000005A0 -#define ERROR_HWNDS_HAVE_DIFF_PARENT 0x000005A1 -#define ERROR_NOT_CHILD_WINDOW 0x000005A2 -#define ERROR_INVALID_GW_COMMAND 0x000005A3 -#define ERROR_INVALID_THREAD_ID 0x000005A4 -#define ERROR_NON_MDICHILD_WINDOW 0x000005A5 -#define ERROR_POPUP_ALREADY_ACTIVE 0x000005A6 -#define ERROR_NO_SCROLLBARS 0x000005A7 -#define ERROR_INVALID_SCROLLBAR_RANGE 0x000005A8 -#define ERROR_INVALID_SHOWWIN_COMMAND 0x000005A9 -#define ERROR_NO_SYSTEM_RESOURCES 0x000005AA -#define ERROR_NONPAGED_SYSTEM_RESOURCES 0x000005AB -#define ERROR_PAGED_SYSTEM_RESOURCES 0x000005AC -#define ERROR_WORKING_SET_QUOTA 0x000005AD -#define ERROR_PAGEFILE_QUOTA 0x000005AE -#define ERROR_COMMITMENT_LIMIT 0x000005AF -#define ERROR_MENU_ITEM_NOT_FOUND 0x000005B0 -#define ERROR_INVALID_KEYBOARD_HANDLE 0x000005B1 -#define ERROR_HOOK_TYPE_NOT_ALLOWED 0x000005B2 -#define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION 0x000005B3 -#define ERROR_TIMEOUT 0x000005B4 -#define ERROR_INVALID_MONITOR_HANDLE 0x000005B5 -#define ERROR_INCORRECT_SIZE 0x000005B6 -#define ERROR_SYMLINK_CLASS_DISABLED 0x000005B7 -#define ERROR_SYMLINK_NOT_SUPPORTED 0x000005B8 -#define ERROR_XML_PARSE_ERROR 0x000005B9 -#define ERROR_XMLDSIG_ERROR 0x000005BA -#define ERROR_RESTART_APPLICATION 0x000005BB -#define ERROR_WRONG_COMPARTMENT 0x000005BC -#define ERROR_AUTHIP_FAILURE 0x000005BD -#define ERROR_NO_NVRAM_RESOURCES 0x000005BE -#define ERROR_NOT_GUI_PROCESS 0x000005BF -#define ERROR_EVENTLOG_FILE_CORRUPT 0x000005DC -#define ERROR_EVENTLOG_CANT_START 0x000005DD -#define ERROR_LOG_FILE_FULL 0x000005DE -#define ERROR_EVENTLOG_FILE_CHANGED 0x000005DF -#define ERROR_INVALID_TASK_NAME 0x0000060E -#define ERROR_INVALID_TASK_INDEX 0x0000060F -#define ERROR_THREAD_ALREADY_IN_TASK 0x00000610 -#define ERROR_INSTALL_SERVICE_FAILURE 0x00000641 -#define ERROR_INSTALL_USEREXIT 0x00000642 -#define ERROR_INSTALL_FAILURE 0x00000643 -#define ERROR_INSTALL_SUSPEND 0x00000644 -#define ERROR_UNKNOWN_PRODUCT 0x00000645 -#define ERROR_UNKNOWN_FEATURE 0x00000646 -#define ERROR_UNKNOWN_COMPONENT 0x00000647 -#define ERROR_UNKNOWN_PROPERTY 0x00000648 -#define ERROR_INVALID_HANDLE_STATE 0x00000649 -#define ERROR_BAD_CONFIGURATION 0x0000064A -#define ERROR_INDEX_ABSENT 0x0000064B -#define ERROR_INSTALL_SOURCE_ABSENT 0x0000064C -#define ERROR_INSTALL_PACKAGE_VERSION 0x0000064D -#define ERROR_PRODUCT_UNINSTALLED 0x0000064E -#define ERROR_BAD_QUERY_SYNTAX 0x0000064F -#define ERROR_INVALID_FIELD 0x00000650 -#define ERROR_DEVICE_REMOVED 0x00000651 -#define ERROR_INSTALL_ALREADY_RUNNING 0x00000652 -#define ERROR_INSTALL_PACKAGE_OPEN_FAILED 0x00000653 -#define ERROR_INSTALL_PACKAGE_INVALID 0x00000654 -#define ERROR_INSTALL_UI_FAILURE 0x00000655 -#define ERROR_INSTALL_LOG_FAILURE 0x00000656 -#define ERROR_INSTALL_LANGUAGE_UNSUPPORTED 0x00000657 -#define ERROR_INSTALL_TRANSFORM_FAILURE 0x00000658 -#define ERROR_INSTALL_PACKAGE_REJECTED 0x00000659 -#define ERROR_FUNCTION_NOT_CALLED 0x0000065A -#define ERROR_FUNCTION_FAILED 0x0000065B -#define ERROR_INVALID_TABLE 0x0000065C -#define ERROR_DATATYPE_MISMATCH 0x0000065D -#define ERROR_UNSUPPORTED_TYPE 0x0000065E -#define ERROR_CREATE_FAILED 0x0000065F -#define ERROR_INSTALL_TEMP_UNWRITABLE 0x00000660 -#define ERROR_INSTALL_PLATFORM_UNSUPPORTED 0x00000661 -#define ERROR_INSTALL_NOTUSED 0x00000662 -#define ERROR_PATCH_PACKAGE_OPEN_FAILED 0x00000663 -#define ERROR_PATCH_PACKAGE_INVALID 0x00000664 -#define ERROR_PATCH_PACKAGE_UNSUPPORTED 0x00000665 -#define ERROR_PRODUCT_VERSION 0x00000666 -#define ERROR_INVALID_COMMAND_LINE 0x00000667 -#define ERROR_INSTALL_REMOTE_DISALLOWED 0x00000668 -#define ERROR_SUCCESS_REBOOT_INITIATED 0x00000669 -#define ERROR_PATCH_TARGET_NOT_FOUND 0x0000066A -#define ERROR_PATCH_PACKAGE_REJECTED 0x0000066B -#define ERROR_INSTALL_TRANSFORM_REJECTED 0x0000066C -#define ERROR_INSTALL_REMOTE_PROHIBITED 0x0000066D -#define ERROR_PATCH_REMOVAL_UNSUPPORTED 0x0000066E -#define ERROR_UNKNOWN_PATCH 0x0000066F -#define ERROR_PATCH_NO_SEQUENCE 0x00000670 -#define ERROR_PATCH_REMOVAL_DISALLOWED 0x00000671 -#define ERROR_INVALID_PATCH_XML 0x00000672 -#define ERROR_PATCH_MANAGED_ADVERTISED_PRODUCT 0x00000673 -#define ERROR_INSTALL_SERVICE_SAFEBOOT 0x00000674 -#define ERROR_FAIL_FAST_EXCEPTION 0x00000675 -#define ERROR_INSTALL_REJECTED 0x00000676 +#define ERROR_NOT_ALL_ASSIGNED 0x00000514 +#define ERROR_SOME_NOT_MAPPED 0x00000515 +#define ERROR_NO_QUOTAS_FOR_ACCOUNT 0x00000516 +#define ERROR_LOCAL_USER_SESSION_KEY 0x00000517 +#define ERROR_NULL_LM_PASSWORD 0x00000518 +#define ERROR_UNKNOWN_REVISION 0x00000519 +#define ERROR_REVISION_MISMATCH 0x0000051A +#define ERROR_INVALID_OWNER 0x0000051B +#define ERROR_INVALID_PRIMARY_GROUP 0x0000051C +#define ERROR_NO_IMPERSONATION_TOKEN 0x0000051D +#define ERROR_CANT_DISABLE_MANDATORY 0x0000051E +#define ERROR_NO_LOGON_SERVERS 0x0000051F +#define ERROR_NO_SUCH_LOGON_SESSION 0x00000520 +#define ERROR_NO_SUCH_PRIVILEGE 0x00000521 +#define ERROR_PRIVILEGE_NOT_HELD 0x00000522 +#define ERROR_INVALID_ACCOUNT_NAME 0x00000523 +#define ERROR_USER_EXISTS 0x00000524 +#define ERROR_NO_SUCH_USER 0x00000525 +#define ERROR_GROUP_EXISTS 0x00000526 +#define ERROR_NO_SUCH_GROUP 0x00000527 +#define ERROR_MEMBER_IN_GROUP 0x00000528 +#define ERROR_MEMBER_NOT_IN_GROUP 0x00000529 +#define ERROR_LAST_ADMIN 0x0000052A +#define ERROR_WRONG_PASSWORD 0x0000052B +#define ERROR_ILL_FORMED_PASSWORD 0x0000052C +#define ERROR_PASSWORD_RESTRICTION 0x0000052D +#define ERROR_LOGON_FAILURE 0x0000052E +#define ERROR_ACCOUNT_RESTRICTION 0x0000052F +#define ERROR_INVALID_LOGON_HOURS 0x00000530 +#define ERROR_INVALID_WORKSTATION 0x00000531 +#define ERROR_PASSWORD_EXPIRED 0x00000532 +#define ERROR_ACCOUNT_DISABLED 0x00000533 +#define ERROR_NONE_MAPPED 0x00000534 +#define ERROR_TOO_MANY_LUIDS_REQUESTED 0x00000535 +#define ERROR_LUIDS_EXHAUSTED 0x00000536 +#define ERROR_INVALID_SUB_AUTHORITY 0x00000537 +#define ERROR_INVALID_ACL 0x00000538 +#define ERROR_INVALID_SID 0x00000539 +#define ERROR_INVALID_SECURITY_DESCR 0x0000053A +#define ERROR_BAD_INHERITANCE_ACL 0x0000053C +#define ERROR_SERVER_DISABLED 0x0000053D +#define ERROR_SERVER_NOT_DISABLED 0x0000053E +#define ERROR_INVALID_ID_AUTHORITY 0x0000053F +#define ERROR_ALLOTTED_SPACE_EXCEEDED 0x00000540 +#define ERROR_INVALID_GROUP_ATTRIBUTES 0x00000541 +#define ERROR_BAD_IMPERSONATION_LEVEL 0x00000542 +#define ERROR_CANT_OPEN_ANONYMOUS 0x00000543 +#define ERROR_BAD_VALIDATION_CLASS 0x00000544 +#define ERROR_BAD_TOKEN_TYPE 0x00000545 +#define ERROR_NO_SECURITY_ON_OBJECT 0x00000546 +#define ERROR_CANT_ACCESS_DOMAIN_INFO 0x00000547 +#define ERROR_INVALID_SERVER_STATE 0x00000548 +#define ERROR_INVALID_DOMAIN_STATE 0x00000549 +#define ERROR_INVALID_DOMAIN_ROLE 0x0000054A +#define ERROR_NO_SUCH_DOMAIN 0x0000054B +#define ERROR_DOMAIN_EXISTS 0x0000054C +#define ERROR_DOMAIN_LIMIT_EXCEEDED 0x0000054D +#define ERROR_INTERNAL_DB_CORRUPTION 0x0000054E +#define ERROR_INTERNAL_ERROR 0x0000054F +#define ERROR_GENERIC_NOT_MAPPED 0x00000550 +#define ERROR_BAD_DESCRIPTOR_FORMAT 0x00000551 +#define ERROR_NOT_LOGON_PROCESS 0x00000552 +#define ERROR_LOGON_SESSION_EXISTS 0x00000553 +#define ERROR_NO_SUCH_PACKAGE 0x00000554 +#define ERROR_BAD_LOGON_SESSION_STATE 0x00000555 +#define ERROR_LOGON_SESSION_COLLISION 0x00000556 +#define ERROR_INVALID_LOGON_TYPE 0x00000557 +#define ERROR_CANNOT_IMPERSONATE 0x00000558 +#define ERROR_RXACT_INVALID_STATE 0x00000559 +#define ERROR_RXACT_COMMIT_FAILURE 0x0000055A +#define ERROR_SPECIAL_ACCOUNT 0x0000055B +#define ERROR_SPECIAL_GROUP 0x0000055C +#define ERROR_SPECIAL_USER 0x0000055D +#define ERROR_MEMBERS_PRIMARY_GROUP 0x0000055E +#define ERROR_TOKEN_ALREADY_IN_USE 0x0000055F +#define ERROR_NO_SUCH_ALIAS 0x00000560 +#define ERROR_MEMBER_NOT_IN_ALIAS 0x00000561 +#define ERROR_MEMBER_IN_ALIAS 0x00000562 +#define ERROR_ALIAS_EXISTS 0x00000563 +#define ERROR_LOGON_NOT_GRANTED 0x00000564 +#define ERROR_TOO_MANY_SECRETS 0x00000565 +#define ERROR_SECRET_TOO_LONG 0x00000566 +#define ERROR_INTERNAL_DB_ERROR 0x00000567 +#define ERROR_TOO_MANY_CONTEXT_IDS 0x00000568 +#define ERROR_LOGON_TYPE_NOT_GRANTED 0x00000569 +#define ERROR_NT_CROSS_ENCRYPTION_REQUIRED 0x0000056A +#define ERROR_NO_SUCH_MEMBER 0x0000056B +#define ERROR_INVALID_MEMBER 0x0000056C +#define ERROR_TOO_MANY_SIDS 0x0000056D +#define ERROR_LM_CROSS_ENCRYPTION_REQUIRED 0x0000056E +#define ERROR_NO_INHERITANCE 0x0000056F +#define ERROR_FILE_CORRUPT 0x00000570 +#define ERROR_DISK_CORRUPT 0x00000571 +#define ERROR_NO_USER_SESSION_KEY 0x00000572 +#define ERROR_LICENSE_QUOTA_EXCEEDED 0x00000573 +#define ERROR_WRONG_TARGET_NAME 0x00000574 +#define ERROR_MUTUAL_AUTH_FAILED 0x00000575 +#define ERROR_TIME_SKEW 0x00000576 +#define ERROR_CURRENT_DOMAIN_NOT_ALLOWED 0x00000577 +#define ERROR_INVALID_WINDOW_HANDLE 0x00000578 +#define ERROR_INVALID_MENU_HANDLE 0x00000579 +#define ERROR_INVALID_CURSOR_HANDLE 0x0000057A +#define ERROR_INVALID_ACCEL_HANDLE 0x0000057B +#define ERROR_INVALID_HOOK_HANDLE 0x0000057C +#define ERROR_INVALID_DWP_HANDLE 0x0000057D +#define ERROR_TLW_WITH_WSCHILD 0x0000057E +#define ERROR_CANNOT_FIND_WND_CLASS 0x0000057F +#define ERROR_WINDOW_OF_OTHER_THREAD 0x00000580 +#define ERROR_HOTKEY_ALREADY_REGISTERED 0x00000581 +#define ERROR_CLASS_ALREADY_EXISTS 0x00000582 +#define ERROR_CLASS_DOES_NOT_EXIST 0x00000583 +#define ERROR_CLASS_HAS_WINDOWS 0x00000584 +#define ERROR_INVALID_INDEX 0x00000585 +#define ERROR_INVALID_ICON_HANDLE 0x00000586 +#define ERROR_PRIVATE_DIALOG_INDEX 0x00000587 +#define ERROR_LISTBOX_ID_NOT_FOUND 0x00000588 +#define ERROR_NO_WILDCARD_CHARACTERS 0x00000589 +#define ERROR_CLIPBOARD_NOT_OPEN 0x0000058A +#define ERROR_HOTKEY_NOT_REGISTERED 0x0000058B +#define ERROR_WINDOW_NOT_DIALOG 0x0000058C +#define ERROR_CONTROL_ID_NOT_FOUND 0x0000058D +#define ERROR_INVALID_COMBOBOX_MESSAGE 0x0000058E +#define ERROR_WINDOW_NOT_COMBOBOX 0x0000058F +#define ERROR_INVALID_EDIT_HEIGHT 0x00000590 +#define ERROR_DC_NOT_FOUND 0x00000591 +#define ERROR_INVALID_HOOK_FILTER 0x00000592 +#define ERROR_INVALID_FILTER_PROC 0x00000593 +#define ERROR_HOOK_NEEDS_HMOD 0x00000594 +#define ERROR_GLOBAL_ONLY_HOOK 0x00000595 +#define ERROR_JOURNAL_HOOK_SET 0x00000596 +#define ERROR_HOOK_NOT_INSTALLED 0x00000597 +#define ERROR_INVALID_LB_MESSAGE 0x00000598 +#define ERROR_SETCOUNT_ON_BAD_LB 0x00000599 +#define ERROR_LB_WITHOUT_TABSTOPS 0x0000059A +#define ERROR_DESTROY_OBJECT_OF_OTHER_THREAD 0x0000059B +#define ERROR_CHILD_WINDOW_MENU 0x0000059C +#define ERROR_NO_SYSTEM_MENU 0x0000059D +#define ERROR_INVALID_MSGBOX_STYLE 0x0000059E +#define ERROR_INVALID_SPI_VALUE 0x0000059F +#define ERROR_SCREEN_ALREADY_LOCKED 0x000005A0 +#define ERROR_HWNDS_HAVE_DIFF_PARENT 0x000005A1 +#define ERROR_NOT_CHILD_WINDOW 0x000005A2 +#define ERROR_INVALID_GW_COMMAND 0x000005A3 +#define ERROR_INVALID_THREAD_ID 0x000005A4 +#define ERROR_NON_MDICHILD_WINDOW 0x000005A5 +#define ERROR_POPUP_ALREADY_ACTIVE 0x000005A6 +#define ERROR_NO_SCROLLBARS 0x000005A7 +#define ERROR_INVALID_SCROLLBAR_RANGE 0x000005A8 +#define ERROR_INVALID_SHOWWIN_COMMAND 0x000005A9 +#define ERROR_NO_SYSTEM_RESOURCES 0x000005AA +#define ERROR_NONPAGED_SYSTEM_RESOURCES 0x000005AB +#define ERROR_PAGED_SYSTEM_RESOURCES 0x000005AC +#define ERROR_WORKING_SET_QUOTA 0x000005AD +#define ERROR_PAGEFILE_QUOTA 0x000005AE +#define ERROR_COMMITMENT_LIMIT 0x000005AF +#define ERROR_MENU_ITEM_NOT_FOUND 0x000005B0 +#define ERROR_INVALID_KEYBOARD_HANDLE 0x000005B1 +#define ERROR_HOOK_TYPE_NOT_ALLOWED 0x000005B2 +#define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION 0x000005B3 +#define ERROR_TIMEOUT 0x000005B4 +#define ERROR_INVALID_MONITOR_HANDLE 0x000005B5 +#define ERROR_INCORRECT_SIZE 0x000005B6 +#define ERROR_SYMLINK_CLASS_DISABLED 0x000005B7 +#define ERROR_SYMLINK_NOT_SUPPORTED 0x000005B8 +#define ERROR_XML_PARSE_ERROR 0x000005B9 +#define ERROR_XMLDSIG_ERROR 0x000005BA +#define ERROR_RESTART_APPLICATION 0x000005BB +#define ERROR_WRONG_COMPARTMENT 0x000005BC +#define ERROR_AUTHIP_FAILURE 0x000005BD +#define ERROR_NO_NVRAM_RESOURCES 0x000005BE +#define ERROR_NOT_GUI_PROCESS 0x000005BF +#define ERROR_EVENTLOG_FILE_CORRUPT 0x000005DC +#define ERROR_EVENTLOG_CANT_START 0x000005DD +#define ERROR_LOG_FILE_FULL 0x000005DE +#define ERROR_EVENTLOG_FILE_CHANGED 0x000005DF +#define ERROR_INVALID_TASK_NAME 0x0000060E +#define ERROR_INVALID_TASK_INDEX 0x0000060F +#define ERROR_THREAD_ALREADY_IN_TASK 0x00000610 +#define ERROR_INSTALL_SERVICE_FAILURE 0x00000641 +#define ERROR_INSTALL_USEREXIT 0x00000642 +#define ERROR_INSTALL_FAILURE 0x00000643 +#define ERROR_INSTALL_SUSPEND 0x00000644 +#define ERROR_UNKNOWN_PRODUCT 0x00000645 +#define ERROR_UNKNOWN_FEATURE 0x00000646 +#define ERROR_UNKNOWN_COMPONENT 0x00000647 +#define ERROR_UNKNOWN_PROPERTY 0x00000648 +#define ERROR_INVALID_HANDLE_STATE 0x00000649 +#define ERROR_BAD_CONFIGURATION 0x0000064A +#define ERROR_INDEX_ABSENT 0x0000064B +#define ERROR_INSTALL_SOURCE_ABSENT 0x0000064C +#define ERROR_INSTALL_PACKAGE_VERSION 0x0000064D +#define ERROR_PRODUCT_UNINSTALLED 0x0000064E +#define ERROR_BAD_QUERY_SYNTAX 0x0000064F +#define ERROR_INVALID_FIELD 0x00000650 +#define ERROR_DEVICE_REMOVED 0x00000651 +#define ERROR_INSTALL_ALREADY_RUNNING 0x00000652 +#define ERROR_INSTALL_PACKAGE_OPEN_FAILED 0x00000653 +#define ERROR_INSTALL_PACKAGE_INVALID 0x00000654 +#define ERROR_INSTALL_UI_FAILURE 0x00000655 +#define ERROR_INSTALL_LOG_FAILURE 0x00000656 +#define ERROR_INSTALL_LANGUAGE_UNSUPPORTED 0x00000657 +#define ERROR_INSTALL_TRANSFORM_FAILURE 0x00000658 +#define ERROR_INSTALL_PACKAGE_REJECTED 0x00000659 +#define ERROR_FUNCTION_NOT_CALLED 0x0000065A +#define ERROR_FUNCTION_FAILED 0x0000065B +#define ERROR_INVALID_TABLE 0x0000065C +#define ERROR_DATATYPE_MISMATCH 0x0000065D +#define ERROR_UNSUPPORTED_TYPE 0x0000065E +#define ERROR_CREATE_FAILED 0x0000065F +#define ERROR_INSTALL_TEMP_UNWRITABLE 0x00000660 +#define ERROR_INSTALL_PLATFORM_UNSUPPORTED 0x00000661 +#define ERROR_INSTALL_NOTUSED 0x00000662 +#define ERROR_PATCH_PACKAGE_OPEN_FAILED 0x00000663 +#define ERROR_PATCH_PACKAGE_INVALID 0x00000664 +#define ERROR_PATCH_PACKAGE_UNSUPPORTED 0x00000665 +#define ERROR_PRODUCT_VERSION 0x00000666 +#define ERROR_INVALID_COMMAND_LINE 0x00000667 +#define ERROR_INSTALL_REMOTE_DISALLOWED 0x00000668 +#define ERROR_SUCCESS_REBOOT_INITIATED 0x00000669 +#define ERROR_PATCH_TARGET_NOT_FOUND 0x0000066A +#define ERROR_PATCH_PACKAGE_REJECTED 0x0000066B +#define ERROR_INSTALL_TRANSFORM_REJECTED 0x0000066C +#define ERROR_INSTALL_REMOTE_PROHIBITED 0x0000066D +#define ERROR_PATCH_REMOVAL_UNSUPPORTED 0x0000066E +#define ERROR_UNKNOWN_PATCH 0x0000066F +#define ERROR_PATCH_NO_SEQUENCE 0x00000670 +#define ERROR_PATCH_REMOVAL_DISALLOWED 0x00000671 +#define ERROR_INVALID_PATCH_XML 0x00000672 +#define ERROR_PATCH_MANAGED_ADVERTISED_PRODUCT 0x00000673 +#define ERROR_INSTALL_SERVICE_SAFEBOOT 0x00000674 +#define ERROR_FAIL_FAST_EXCEPTION 0x00000675 +#define ERROR_INSTALL_REJECTED 0x00000676 /* System Error Codes (1700-3999) */ -#define RPC_S_INVALID_STRING_BINDING 0x000006A4 -#define RPC_S_WRONG_KIND_OF_BINDING 0x000006A5 -#define RPC_S_INVALID_BINDING 0x000006A6 -#define RPC_S_PROTSEQ_NOT_SUPPORTED 0x000006A7 -#define RPC_S_INVALID_RPC_PROTSEQ 0x000006A8 -#define RPC_S_INVALID_STRING_UUID 0x000006A9 -#define RPC_S_INVALID_ENDPOINT_FORMAT 0x000006AA -#define RPC_S_INVALID_NET_ADDR 0x000006AB -#define RPC_S_NO_ENDPOINT_FOUND 0x000006AC -#define RPC_S_INVALID_TIMEOUT 0x000006AD -#define RPC_S_OBJECT_NOT_FOUND 0x000006AE -#define RPC_S_ALREADY_REGISTERED 0x000006AF -#define RPC_S_TYPE_ALREADY_REGISTERED 0x000006B0 -#define RPC_S_ALREADY_LISTENING 0x000006B1 -#define RPC_S_NO_PROTSEQS_REGISTERED 0x000006B2 -#define RPC_S_NOT_LISTENING 0x000006B3 -#define RPC_S_UNKNOWN_MGR_TYPE 0x000006B4 -#define RPC_S_UNKNOWN_IF 0x000006B5 -#define RPC_S_NO_BINDINGS 0x000006B6 -#define RPC_S_NO_PROTSEQS 0x000006B7 -#define RPC_S_CANT_CREATE_ENDPOINT 0x000006B8 -#define RPC_S_OUT_OF_RESOURCES 0x000006B9 -#define RPC_S_SERVER_UNAVAILABLE 0x000006BA -#define RPC_S_SERVER_TOO_BUSY 0x000006BB -#define RPC_S_INVALID_NETWORK_OPTIONS 0x000006BC -#define RPC_S_NO_CALL_ACTIVE 0x000006BD -#define RPC_S_CALL_FAILED 0x000006BE -#define RPC_S_CALL_FAILED_DNE 0x000006BF -#define RPC_S_PROTOCOL_ERROR 0x000006C0 -#define RPC_S_PROXY_ACCESS_DENIED 0x000006C1 -#define RPC_S_UNSUPPORTED_TRANS_SYN 0x000006C2 -#define RPC_S_UNSUPPORTED_TYPE 0x000006C4 -#define RPC_S_INVALID_TAG 0x000006C5 -#define RPC_S_INVALID_BOUND 0x000006C6 -#define RPC_S_NO_ENTRY_NAME 0x000006C7 -#define RPC_S_INVALID_NAME_SYNTAX 0x000006C8 -#define RPC_S_UNSUPPORTED_NAME_SYNTAX 0x000006C9 -#define RPC_S_UUID_NO_ADDRESS 0x000006CB -#define RPC_S_DUPLICATE_ENDPOINT 0x000006CC -#define RPC_S_UNKNOWN_AUTHN_TYPE 0x000006CD -#define RPC_S_MAX_CALLS_TOO_SMALL 0x000006CE -#define RPC_S_STRING_TOO_LONG 0x000006CF -#define RPC_S_PROTSEQ_NOT_FOUND 0x000006D0 -#define RPC_S_PROCNUM_OUT_OF_RANGE 0x000006D1 -#define RPC_S_BINDING_HAS_NO_AUTH 0x000006D2 -#define RPC_S_UNKNOWN_AUTHN_SERVICE 0x000006D3 -#define RPC_S_UNKNOWN_AUTHN_LEVEL 0x000006D4 -#define RPC_S_INVALID_AUTH_IDENTITY 0x000006D5 -#define RPC_S_UNKNOWN_AUTHZ_SERVICE 0x000006D6 -#define EPT_S_INVALID_ENTRY 0x000006D7 -#define EPT_S_CANT_PERFORM_OP 0x000006D8 -#define EPT_S_NOT_REGISTERED 0x000006D9 -#define RPC_S_NOTHING_TO_EXPORT 0x000006DA -#define RPC_S_INCOMPLETE_NAME 0x000006DB -#define RPC_S_INVALID_VERS_OPTION 0x000006DC -#define RPC_S_NO_MORE_MEMBERS 0x000006DD -#define RPC_S_NOT_ALL_OBJS_UNEXPORTED 0x000006DE -#define RPC_S_INTERFACE_NOT_FOUND 0x000006DF -#define RPC_S_ENTRY_ALREADY_EXISTS 0x000006E0 -#define RPC_S_ENTRY_NOT_FOUND 0x000006E1 -#define RPC_S_NAME_SERVICE_UNAVAILABLE 0x000006E2 -#define RPC_S_INVALID_NAF_ID 0x000006E3 -#define RPC_S_CANNOT_SUPPORT 0x000006E4 -#define RPC_S_NO_CONTEXT_AVAILABLE 0x000006E5 -#define RPC_S_INTERNAL_ERROR 0x000006E6 -#define RPC_S_ZERO_DIVIDE 0x000006E7 -#define RPC_S_ADDRESS_ERROR 0x000006E8 -#define RPC_S_FP_DIV_ZERO 0x000006E9 -#define RPC_S_FP_UNDERFLOW 0x000006EA -#define RPC_S_FP_OVERFLOW 0x000006EB -#define RPC_X_NO_MORE_ENTRIES 0x000006EC -#define RPC_X_SS_CHAR_TRANS_OPEN_FAIL 0x000006ED -#define RPC_X_SS_CHAR_TRANS_SHORT_FILE 0x000006EE -#define RPC_X_SS_IN_NULL_CONTEXT 0x000006EF -#define RPC_X_SS_CONTEXT_DAMAGED 0x000006F1 -#define RPC_X_SS_HANDLES_MISMATCH 0x000006F2 -#define RPC_X_SS_CANNOT_GET_CALL_HANDLE 0x000006F3 -#define RPC_X_NULL_REF_POINTER 0x000006F4 -#define RPC_X_ENUM_VALUE_OUT_OF_RANGE 0x000006F5 -#define RPC_X_BYTE_COUNT_TOO_SMALL 0x000006F6 -#define RPC_X_BAD_STUB_DATA 0x000006F7 -#define ERROR_INVALID_USER_BUFFER 0x000006F8 -#define ERROR_UNRECOGNIZED_MEDIA 0x000006F9 -#define ERROR_NO_TRUST_LSA_SECRET 0x000006FA -#define ERROR_NO_TRUST_SAM_ACCOUNT 0x000006FB -#define ERROR_TRUSTED_DOMAIN_FAILURE 0x000006FC -#define ERROR_TRUSTED_RELATIONSHIP_FAILURE 0x000006FD -#define ERROR_TRUST_FAILURE 0x000006FE -#define RPC_S_CALL_IN_PROGRESS 0x000006FF -#define ERROR_NETLOGON_NOT_STARTED 0x00000700 -#define ERROR_ACCOUNT_EXPIRED 0x00000701 -#define ERROR_REDIRECTOR_HAS_OPEN_HANDLES 0x00000702 -#define ERROR_PRINTER_DRIVER_ALREADY_INSTALLED 0x00000703 -#define ERROR_UNKNOWN_PORT 0x00000704 -#define ERROR_UNKNOWN_PRINTER_DRIVER 0x00000705 -#define ERROR_UNKNOWN_PRINTPROCESSOR 0x00000706 -#define ERROR_INVALID_SEPARATOR_FILE 0x00000707 -#define ERROR_INVALID_PRIORITY 0x00000708 -#define ERROR_INVALID_PRINTER_NAME 0x00000709 -#define ERROR_PRINTER_ALREADY_EXISTS 0x0000070A -#define ERROR_INVALID_PRINTER_COMMAND 0x0000070B -#define ERROR_INVALID_DATATYPE 0x0000070C -#define ERROR_INVALID_ENVIRONMENT 0x0000070D -#define RPC_S_NO_MORE_BINDINGS 0x0000070E -#define ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT 0x0000070F -#define ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT 0x00000710 -#define ERROR_NOLOGON_SERVER_TRUST_ACCOUNT 0x00000711 -#define ERROR_DOMAIN_TRUST_INCONSISTENT 0x00000712 -#define ERROR_SERVER_HAS_OPEN_HANDLES 0x00000713 -#define ERROR_RESOURCE_DATA_NOT_FOUND 0x00000714 -#define ERROR_RESOURCE_TYPE_NOT_FOUND 0x00000715 -#define ERROR_RESOURCE_NAME_NOT_FOUND 0x00000716 -#define ERROR_RESOURCE_LANG_NOT_FOUND 0x00000717 -#define ERROR_NOT_ENOUGH_QUOTA 0x00000718 -#define RPC_S_NO_INTERFACES 0x00000719 -#define RPC_S_CALL_CANCELLED 0x0000071A -#define RPC_S_BINDING_INCOMPLETE 0x0000071B -#define RPC_S_COMM_FAILURE 0x0000071C -#define RPC_S_UNSUPPORTED_AUTHN_LEVEL 0x0000071D -#define RPC_S_NO_PRINC_NAME 0x0000071E -#define RPC_S_NOT_RPC_ERROR 0x0000071F -#define RPC_S_UUID_LOCAL_ONLY 0x00000720 -#define RPC_S_SEC_PKG_ERROR 0x00000721 -#define RPC_S_NOT_CANCELLED 0x00000722 -#define RPC_X_INVALID_ES_ACTION 0x00000723 -#define RPC_X_WRONG_ES_VERSION 0x00000724 -#define RPC_X_WRONG_STUB_VERSION 0x00000725 -#define RPC_X_INVALID_PIPE_OBJECT 0x00000726 -#define RPC_X_WRONG_PIPE_ORDER 0x00000727 -#define RPC_X_WRONG_PIPE_VERSION 0x00000728 -#define RPC_S_COOKIE_AUTH_FAILED 0x00000729 -#define RPC_S_GROUP_MEMBER_NOT_FOUND 0x0000076A -#define EPT_S_CANT_CREATE 0x0000076B -#define RPC_S_INVALID_OBJECT 0x0000076C -#define ERROR_INVALID_TIME 0x0000076D -#define ERROR_INVALID_FORM_NAME 0x0000076E -#define ERROR_INVALID_FORM_SIZE 0x0000076F -#define ERROR_ALREADY_WAITING 0x00000770 -#define ERROR_PRINTER_DELETED 0x00000771 -#define ERROR_INVALID_PRINTER_STATE 0x00000772 -#define ERROR_PASSWORD_MUST_CHANGE 0x00000773 -#define ERROR_DOMAIN_CONTROLLER_NOT_FOUND 0x00000774 -#define ERROR_ACCOUNT_LOCKED_OUT 0x00000775 -#define OR_INVALID_OXID 0x00000776 -#define OR_INVALID_OID 0x00000777 -#define OR_INVALID_SET 0x00000778 -#define RPC_S_SEND_INCOMPLETE 0x00000779 -#define RPC_S_INVALID_ASYNC_HANDLE 0x0000077A -#define RPC_S_INVALID_ASYNC_CALL 0x0000077B -#define RPC_X_PIPE_CLOSED 0x0000077C -#define RPC_X_PIPE_DISCIPLINE_ERROR 0x0000077D -#define RPC_X_PIPE_EMPTY 0x0000077E -#define ERROR_NO_SITENAME 0x0000077F -#define ERROR_CANT_ACCESS_FILE 0x00000780 -#define ERROR_CANT_RESOLVE_FILENAME 0x00000781 -#define RPC_S_ENTRY_TYPE_MISMATCH 0x00000782 -#define RPC_S_NOT_ALL_OBJS_EXPORTED 0x00000783 -#define RPC_S_INTERFACE_NOT_EXPORTED 0x00000784 -#define RPC_S_PROFILE_NOT_ADDED 0x00000785 -#define RPC_S_PRF_ELT_NOT_ADDED 0x00000786 -#define RPC_S_PRF_ELT_NOT_REMOVED 0x00000787 -#define RPC_S_GRP_ELT_NOT_ADDED 0x00000788 -#define RPC_S_GRP_ELT_NOT_REMOVED 0x00000789 -#define ERROR_KM_DRIVER_BLOCKED 0x0000078A -#define ERROR_CONTEXT_EXPIRED 0x0000078B -#define ERROR_PER_USER_TRUST_QUOTA_EXCEEDED 0x0000078C -#define ERROR_ALL_USER_TRUST_QUOTA_EXCEEDED 0x0000078D -#define ERROR_USER_DELETE_TRUST_QUOTA_EXCEEDED 0x0000078E -#define ERROR_AUTHENTICATION_FIREWALL_FAILED 0x0000078F -#define ERROR_REMOTE_PRINT_CONNECTIONS_BLOCKED 0x00000790 -#define ERROR_NTLM_BLOCKED 0x00000791 -#define ERROR_PASSWORD_CHANGE_REQUIRED 0x00000792 -#define ERROR_INVALID_PIXEL_FORMAT 0x000007D0 -#define ERROR_BAD_DRIVER 0x000007D1 -#define ERROR_INVALID_WINDOW_STYLE 0x000007D2 -#define ERROR_METAFILE_NOT_SUPPORTED 0x000007D3 -#define ERROR_TRANSFORM_NOT_SUPPORTED 0x000007D4 -#define ERROR_CLIPPING_NOT_SUPPORTED 0x000007D5 -#define ERROR_INVALID_CMM 0x000007DA -#define ERROR_INVALID_PROFILE 0x000007DB -#define ERROR_TAG_NOT_FOUND 0x000007DC -#define ERROR_TAG_NOT_PRESENT 0x000007DD -#define ERROR_DUPLICATE_TAG 0x000007DE -#define ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE 0x000007DF -#define ERROR_PROFILE_NOT_FOUND 0x000007E0 -#define ERROR_INVALID_COLORSPACE 0x000007E1 -#define ERROR_ICM_NOT_ENABLED 0x000007E2 -#define ERROR_DELETING_ICM_XFORM 0x000007E3 -#define ERROR_INVALID_TRANSFORM 0x000007E4 -#define ERROR_COLORSPACE_MISMATCH 0x000007E5 -#define ERROR_INVALID_COLORINDEX 0x000007E6 -#define ERROR_PROFILE_DOES_NOT_MATCH_DEVICE 0x000007E7 -#define ERROR_CONNECTED_OTHER_PASSWORD 0x0000083C -#define ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT 0x0000083D -#define ERROR_BAD_USERNAME 0x0000089A -#define ERROR_NOT_CONNECTED 0x000008CA -#define ERROR_OPEN_FILES 0x00000961 -#define ERROR_ACTIVE_CONNECTIONS 0x00000962 -#define ERROR_DEVICE_IN_USE 0x00000964 -#define ERROR_UNKNOWN_PRINT_MONITOR 0x00000BB8 -#define ERROR_PRINTER_DRIVER_IN_USE 0x00000BB9 -#define ERROR_SPOOL_FILE_NOT_FOUND 0x00000BBA -#define ERROR_SPL_NO_STARTDOC 0x00000BBB -#define ERROR_SPL_NO_ADDJOB 0x00000BBC -#define ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED 0x00000BBD -#define ERROR_PRINT_MONITOR_ALREADY_INSTALLED 0x00000BBE -#define ERROR_INVALID_PRINT_MONITOR 0x00000BBF -#define ERROR_PRINT_MONITOR_IN_USE 0x00000BC0 -#define ERROR_PRINTER_HAS_JOBS_QUEUED 0x00000BC1 -#define ERROR_SUCCESS_REBOOT_REQUIRED 0x00000BC2 -#define ERROR_SUCCESS_RESTART_REQUIRED 0x00000BC3 -#define ERROR_PRINTER_NOT_FOUND 0x00000BC4 -#define ERROR_PRINTER_DRIVER_WARNED 0x00000BC5 -#define ERROR_PRINTER_DRIVER_BLOCKED 0x00000BC6 -#define ERROR_PRINTER_DRIVER_PACKAGE_IN_USE 0x00000BC7 -#define ERROR_CORE_DRIVER_PACKAGE_NOT_FOUND 0x00000BC8 -#define ERROR_FAIL_REBOOT_REQUIRED 0x00000BC9 -#define ERROR_FAIL_REBOOT_INITIATED 0x00000BCA -#define ERROR_PRINTER_DRIVER_DOWNLOAD_NEEDED 0x00000BCB -#define ERROR_PRINT_JOB_RESTART_REQUIRED 0x00000BCC -#define ERROR_INVALID_PRINTER_DRIVER_MANIFEST 0x00000BCD -#define ERROR_PRINTER_NOT_SHAREABLE 0x00000BCE -#define ERROR_REQUEST_PAUSED 0x00000BEA -#define ERROR_IO_REISSUE_AS_CACHED 0x00000F6E +#define RPC_S_INVALID_STRING_BINDING 0x000006A4 +#define RPC_S_WRONG_KIND_OF_BINDING 0x000006A5 +#define RPC_S_INVALID_BINDING 0x000006A6 +#define RPC_S_PROTSEQ_NOT_SUPPORTED 0x000006A7 +#define RPC_S_INVALID_RPC_PROTSEQ 0x000006A8 +#define RPC_S_INVALID_STRING_UUID 0x000006A9 +#define RPC_S_INVALID_ENDPOINT_FORMAT 0x000006AA +#define RPC_S_INVALID_NET_ADDR 0x000006AB +#define RPC_S_NO_ENDPOINT_FOUND 0x000006AC +#define RPC_S_INVALID_TIMEOUT 0x000006AD +#define RPC_S_OBJECT_NOT_FOUND 0x000006AE +#define RPC_S_ALREADY_REGISTERED 0x000006AF +#define RPC_S_TYPE_ALREADY_REGISTERED 0x000006B0 +#define RPC_S_ALREADY_LISTENING 0x000006B1 +#define RPC_S_NO_PROTSEQS_REGISTERED 0x000006B2 +#define RPC_S_NOT_LISTENING 0x000006B3 +#define RPC_S_UNKNOWN_MGR_TYPE 0x000006B4 +#define RPC_S_UNKNOWN_IF 0x000006B5 +#define RPC_S_NO_BINDINGS 0x000006B6 +#define RPC_S_NO_PROTSEQS 0x000006B7 +#define RPC_S_CANT_CREATE_ENDPOINT 0x000006B8 +#define RPC_S_OUT_OF_RESOURCES 0x000006B9 +#define RPC_S_SERVER_UNAVAILABLE 0x000006BA +#define RPC_S_SERVER_TOO_BUSY 0x000006BB +#define RPC_S_INVALID_NETWORK_OPTIONS 0x000006BC +#define RPC_S_NO_CALL_ACTIVE 0x000006BD +#define RPC_S_CALL_FAILED 0x000006BE +#define RPC_S_CALL_FAILED_DNE 0x000006BF +#define RPC_S_PROTOCOL_ERROR 0x000006C0 +#define RPC_S_PROXY_ACCESS_DENIED 0x000006C1 +#define RPC_S_UNSUPPORTED_TRANS_SYN 0x000006C2 +#define RPC_S_UNSUPPORTED_TYPE 0x000006C4 +#define RPC_S_INVALID_TAG 0x000006C5 +#define RPC_S_INVALID_BOUND 0x000006C6 +#define RPC_S_NO_ENTRY_NAME 0x000006C7 +#define RPC_S_INVALID_NAME_SYNTAX 0x000006C8 +#define RPC_S_UNSUPPORTED_NAME_SYNTAX 0x000006C9 +#define RPC_S_UUID_NO_ADDRESS 0x000006CB +#define RPC_S_DUPLICATE_ENDPOINT 0x000006CC +#define RPC_S_UNKNOWN_AUTHN_TYPE 0x000006CD +#define RPC_S_MAX_CALLS_TOO_SMALL 0x000006CE +#define RPC_S_STRING_TOO_LONG 0x000006CF +#define RPC_S_PROTSEQ_NOT_FOUND 0x000006D0 +#define RPC_S_PROCNUM_OUT_OF_RANGE 0x000006D1 +#define RPC_S_BINDING_HAS_NO_AUTH 0x000006D2 +#define RPC_S_UNKNOWN_AUTHN_SERVICE 0x000006D3 +#define RPC_S_UNKNOWN_AUTHN_LEVEL 0x000006D4 +#define RPC_S_INVALID_AUTH_IDENTITY 0x000006D5 +#define RPC_S_UNKNOWN_AUTHZ_SERVICE 0x000006D6 +#define EPT_S_INVALID_ENTRY 0x000006D7 +#define EPT_S_CANT_PERFORM_OP 0x000006D8 +#define EPT_S_NOT_REGISTERED 0x000006D9 +#define RPC_S_NOTHING_TO_EXPORT 0x000006DA +#define RPC_S_INCOMPLETE_NAME 0x000006DB +#define RPC_S_INVALID_VERS_OPTION 0x000006DC +#define RPC_S_NO_MORE_MEMBERS 0x000006DD +#define RPC_S_NOT_ALL_OBJS_UNEXPORTED 0x000006DE +#define RPC_S_INTERFACE_NOT_FOUND 0x000006DF +#define RPC_S_ENTRY_ALREADY_EXISTS 0x000006E0 +#define RPC_S_ENTRY_NOT_FOUND 0x000006E1 +#define RPC_S_NAME_SERVICE_UNAVAILABLE 0x000006E2 +#define RPC_S_INVALID_NAF_ID 0x000006E3 +#define RPC_S_CANNOT_SUPPORT 0x000006E4 +#define RPC_S_NO_CONTEXT_AVAILABLE 0x000006E5 +#define RPC_S_INTERNAL_ERROR 0x000006E6 +#define RPC_S_ZERO_DIVIDE 0x000006E7 +#define RPC_S_ADDRESS_ERROR 0x000006E8 +#define RPC_S_FP_DIV_ZERO 0x000006E9 +#define RPC_S_FP_UNDERFLOW 0x000006EA +#define RPC_S_FP_OVERFLOW 0x000006EB +#define RPC_X_NO_MORE_ENTRIES 0x000006EC +#define RPC_X_SS_CHAR_TRANS_OPEN_FAIL 0x000006ED +#define RPC_X_SS_CHAR_TRANS_SHORT_FILE 0x000006EE +#define RPC_X_SS_IN_NULL_CONTEXT 0x000006EF +#define RPC_X_SS_CONTEXT_DAMAGED 0x000006F1 +#define RPC_X_SS_HANDLES_MISMATCH 0x000006F2 +#define RPC_X_SS_CANNOT_GET_CALL_HANDLE 0x000006F3 +#define RPC_X_NULL_REF_POINTER 0x000006F4 +#define RPC_X_ENUM_VALUE_OUT_OF_RANGE 0x000006F5 +#define RPC_X_BYTE_COUNT_TOO_SMALL 0x000006F6 +#define RPC_X_BAD_STUB_DATA 0x000006F7 +#define ERROR_INVALID_USER_BUFFER 0x000006F8 +#define ERROR_UNRECOGNIZED_MEDIA 0x000006F9 +#define ERROR_NO_TRUST_LSA_SECRET 0x000006FA +#define ERROR_NO_TRUST_SAM_ACCOUNT 0x000006FB +#define ERROR_TRUSTED_DOMAIN_FAILURE 0x000006FC +#define ERROR_TRUSTED_RELATIONSHIP_FAILURE 0x000006FD +#define ERROR_TRUST_FAILURE 0x000006FE +#define RPC_S_CALL_IN_PROGRESS 0x000006FF +#define ERROR_NETLOGON_NOT_STARTED 0x00000700 +#define ERROR_ACCOUNT_EXPIRED 0x00000701 +#define ERROR_REDIRECTOR_HAS_OPEN_HANDLES 0x00000702 +#define ERROR_PRINTER_DRIVER_ALREADY_INSTALLED 0x00000703 +#define ERROR_UNKNOWN_PORT 0x00000704 +#define ERROR_UNKNOWN_PRINTER_DRIVER 0x00000705 +#define ERROR_UNKNOWN_PRINTPROCESSOR 0x00000706 +#define ERROR_INVALID_SEPARATOR_FILE 0x00000707 +#define ERROR_INVALID_PRIORITY 0x00000708 +#define ERROR_INVALID_PRINTER_NAME 0x00000709 +#define ERROR_PRINTER_ALREADY_EXISTS 0x0000070A +#define ERROR_INVALID_PRINTER_COMMAND 0x0000070B +#define ERROR_INVALID_DATATYPE 0x0000070C +#define ERROR_INVALID_ENVIRONMENT 0x0000070D +#define RPC_S_NO_MORE_BINDINGS 0x0000070E +#define ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT 0x0000070F +#define ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT 0x00000710 +#define ERROR_NOLOGON_SERVER_TRUST_ACCOUNT 0x00000711 +#define ERROR_DOMAIN_TRUST_INCONSISTENT 0x00000712 +#define ERROR_SERVER_HAS_OPEN_HANDLES 0x00000713 +#define ERROR_RESOURCE_DATA_NOT_FOUND 0x00000714 +#define ERROR_RESOURCE_TYPE_NOT_FOUND 0x00000715 +#define ERROR_RESOURCE_NAME_NOT_FOUND 0x00000716 +#define ERROR_RESOURCE_LANG_NOT_FOUND 0x00000717 +#define ERROR_NOT_ENOUGH_QUOTA 0x00000718 +#define RPC_S_NO_INTERFACES 0x00000719 +#define RPC_S_CALL_CANCELLED 0x0000071A +#define RPC_S_BINDING_INCOMPLETE 0x0000071B +#define RPC_S_COMM_FAILURE 0x0000071C +#define RPC_S_UNSUPPORTED_AUTHN_LEVEL 0x0000071D +#define RPC_S_NO_PRINC_NAME 0x0000071E +#define RPC_S_NOT_RPC_ERROR 0x0000071F +#define RPC_S_UUID_LOCAL_ONLY 0x00000720 +#define RPC_S_SEC_PKG_ERROR 0x00000721 +#define RPC_S_NOT_CANCELLED 0x00000722 +#define RPC_X_INVALID_ES_ACTION 0x00000723 +#define RPC_X_WRONG_ES_VERSION 0x00000724 +#define RPC_X_WRONG_STUB_VERSION 0x00000725 +#define RPC_X_INVALID_PIPE_OBJECT 0x00000726 +#define RPC_X_WRONG_PIPE_ORDER 0x00000727 +#define RPC_X_WRONG_PIPE_VERSION 0x00000728 +#define RPC_S_COOKIE_AUTH_FAILED 0x00000729 +#define RPC_S_GROUP_MEMBER_NOT_FOUND 0x0000076A +#define EPT_S_CANT_CREATE 0x0000076B +#define RPC_S_INVALID_OBJECT 0x0000076C +#define ERROR_INVALID_TIME 0x0000076D +#define ERROR_INVALID_FORM_NAME 0x0000076E +#define ERROR_INVALID_FORM_SIZE 0x0000076F +#define ERROR_ALREADY_WAITING 0x00000770 +#define ERROR_PRINTER_DELETED 0x00000771 +#define ERROR_INVALID_PRINTER_STATE 0x00000772 +#define ERROR_PASSWORD_MUST_CHANGE 0x00000773 +#define ERROR_DOMAIN_CONTROLLER_NOT_FOUND 0x00000774 +#define ERROR_ACCOUNT_LOCKED_OUT 0x00000775 +#define OR_INVALID_OXID 0x00000776 +#define OR_INVALID_OID 0x00000777 +#define OR_INVALID_SET 0x00000778 +#define RPC_S_SEND_INCOMPLETE 0x00000779 +#define RPC_S_INVALID_ASYNC_HANDLE 0x0000077A +#define RPC_S_INVALID_ASYNC_CALL 0x0000077B +#define RPC_X_PIPE_CLOSED 0x0000077C +#define RPC_X_PIPE_DISCIPLINE_ERROR 0x0000077D +#define RPC_X_PIPE_EMPTY 0x0000077E +#define ERROR_NO_SITENAME 0x0000077F +#define ERROR_CANT_ACCESS_FILE 0x00000780 +#define ERROR_CANT_RESOLVE_FILENAME 0x00000781 +#define RPC_S_ENTRY_TYPE_MISMATCH 0x00000782 +#define RPC_S_NOT_ALL_OBJS_EXPORTED 0x00000783 +#define RPC_S_INTERFACE_NOT_EXPORTED 0x00000784 +#define RPC_S_PROFILE_NOT_ADDED 0x00000785 +#define RPC_S_PRF_ELT_NOT_ADDED 0x00000786 +#define RPC_S_PRF_ELT_NOT_REMOVED 0x00000787 +#define RPC_S_GRP_ELT_NOT_ADDED 0x00000788 +#define RPC_S_GRP_ELT_NOT_REMOVED 0x00000789 +#define ERROR_KM_DRIVER_BLOCKED 0x0000078A +#define ERROR_CONTEXT_EXPIRED 0x0000078B +#define ERROR_PER_USER_TRUST_QUOTA_EXCEEDED 0x0000078C +#define ERROR_ALL_USER_TRUST_QUOTA_EXCEEDED 0x0000078D +#define ERROR_USER_DELETE_TRUST_QUOTA_EXCEEDED 0x0000078E +#define ERROR_AUTHENTICATION_FIREWALL_FAILED 0x0000078F +#define ERROR_REMOTE_PRINT_CONNECTIONS_BLOCKED 0x00000790 +#define ERROR_NTLM_BLOCKED 0x00000791 +#define ERROR_PASSWORD_CHANGE_REQUIRED 0x00000792 +#define ERROR_INVALID_PIXEL_FORMAT 0x000007D0 +#define ERROR_BAD_DRIVER 0x000007D1 +#define ERROR_INVALID_WINDOW_STYLE 0x000007D2 +#define ERROR_METAFILE_NOT_SUPPORTED 0x000007D3 +#define ERROR_TRANSFORM_NOT_SUPPORTED 0x000007D4 +#define ERROR_CLIPPING_NOT_SUPPORTED 0x000007D5 +#define ERROR_INVALID_CMM 0x000007DA +#define ERROR_INVALID_PROFILE 0x000007DB +#define ERROR_TAG_NOT_FOUND 0x000007DC +#define ERROR_TAG_NOT_PRESENT 0x000007DD +#define ERROR_DUPLICATE_TAG 0x000007DE +#define ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE 0x000007DF +#define ERROR_PROFILE_NOT_FOUND 0x000007E0 +#define ERROR_INVALID_COLORSPACE 0x000007E1 +#define ERROR_ICM_NOT_ENABLED 0x000007E2 +#define ERROR_DELETING_ICM_XFORM 0x000007E3 +#define ERROR_INVALID_TRANSFORM 0x000007E4 +#define ERROR_COLORSPACE_MISMATCH 0x000007E5 +#define ERROR_INVALID_COLORINDEX 0x000007E6 +#define ERROR_PROFILE_DOES_NOT_MATCH_DEVICE 0x000007E7 +#define ERROR_CONNECTED_OTHER_PASSWORD 0x0000083C +#define ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT 0x0000083D +#define ERROR_BAD_USERNAME 0x0000089A +#define ERROR_NOT_CONNECTED 0x000008CA +#define ERROR_OPEN_FILES 0x00000961 +#define ERROR_ACTIVE_CONNECTIONS 0x00000962 +#define ERROR_DEVICE_IN_USE 0x00000964 +#define ERROR_UNKNOWN_PRINT_MONITOR 0x00000BB8 +#define ERROR_PRINTER_DRIVER_IN_USE 0x00000BB9 +#define ERROR_SPOOL_FILE_NOT_FOUND 0x00000BBA +#define ERROR_SPL_NO_STARTDOC 0x00000BBB +#define ERROR_SPL_NO_ADDJOB 0x00000BBC +#define ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED 0x00000BBD +#define ERROR_PRINT_MONITOR_ALREADY_INSTALLED 0x00000BBE +#define ERROR_INVALID_PRINT_MONITOR 0x00000BBF +#define ERROR_PRINT_MONITOR_IN_USE 0x00000BC0 +#define ERROR_PRINTER_HAS_JOBS_QUEUED 0x00000BC1 +#define ERROR_SUCCESS_REBOOT_REQUIRED 0x00000BC2 +#define ERROR_SUCCESS_RESTART_REQUIRED 0x00000BC3 +#define ERROR_PRINTER_NOT_FOUND 0x00000BC4 +#define ERROR_PRINTER_DRIVER_WARNED 0x00000BC5 +#define ERROR_PRINTER_DRIVER_BLOCKED 0x00000BC6 +#define ERROR_PRINTER_DRIVER_PACKAGE_IN_USE 0x00000BC7 +#define ERROR_CORE_DRIVER_PACKAGE_NOT_FOUND 0x00000BC8 +#define ERROR_FAIL_REBOOT_REQUIRED 0x00000BC9 +#define ERROR_FAIL_REBOOT_INITIATED 0x00000BCA +#define ERROR_PRINTER_DRIVER_DOWNLOAD_NEEDED 0x00000BCB +#define ERROR_PRINT_JOB_RESTART_REQUIRED 0x00000BCC +#define ERROR_INVALID_PRINTER_DRIVER_MANIFEST 0x00000BCD +#define ERROR_PRINTER_NOT_SHAREABLE 0x00000BCE +#define ERROR_REQUEST_PAUSED 0x00000BEA +#define ERROR_IO_REISSUE_AS_CACHED 0x00000F6E /* System Error Codes (4000-5999) */ -#define ERROR_WINS_INTERNAL 0x00000FA0 -#define ERROR_CAN_NOT_DEL_LOCAL_WINS 0x00000FA1 -#define ERROR_STATIC_INIT 0x00000FA2 -#define ERROR_INC_BACKUP 0x00000FA3 -#define ERROR_FULL_BACKUP 0x00000FA4 -#define ERROR_REC_NON_EXISTENT 0x00000FA5 -#define ERROR_RPL_NOT_ALLOWED 0x00000FA6 -#define PEERDIST_ERROR_CONTENTINFO_VERSION_UNSUPPORTED 0x00000FD2 -#define PEERDIST_ERROR_CANNOT_PARSE_CONTENTINFO 0x00000FD3 -#define PEERDIST_ERROR_MISSING_DATA 0x00000FD4 -#define PEERDIST_ERROR_NO_MORE 0x00000FD5 -#define PEERDIST_ERROR_NOT_INITIALIZED 0x00000FD6 -#define PEERDIST_ERROR_ALREADY_INITIALIZED 0x00000FD7 -#define PEERDIST_ERROR_SHUTDOWN_IN_PROGRESS 0x00000FD8 -#define PEERDIST_ERROR_INVALIDATED 0x00000FD9 -#define PEERDIST_ERROR_ALREADY_EXISTS 0x00000FDA -#define PEERDIST_ERROR_OPERATION_NOTFOUND 0x00000FDB -#define PEERDIST_ERROR_ALREADY_COMPLETED 0x00000FDC -#define PEERDIST_ERROR_OUT_OF_BOUNDS 0x00000FDD -#define PEERDIST_ERROR_VERSION_UNSUPPORTED 0x00000FDE -#define PEERDIST_ERROR_INVALID_CONFIGURATION 0x00000FDF -#define PEERDIST_ERROR_NOT_LICENSED 0x00000FE0 -#define PEERDIST_ERROR_SERVICE_UNAVAILABLE 0x00000FE1 -#define PEERDIST_ERROR_TRUST_FAILURE 0x00000FE2 -#define ERROR_DHCP_ADDRESS_CONFLICT 0x00001004 -#define ERROR_WMI_GUID_NOT_FOUND 0x00001068 -#define ERROR_WMI_INSTANCE_NOT_FOUND 0x00001069 -#define ERROR_WMI_ITEMID_NOT_FOUND 0x0000106A -#define ERROR_WMI_TRY_AGAIN 0x0000106B -#define ERROR_WMI_DP_NOT_FOUND 0x0000106C -#define ERROR_WMI_UNRESOLVED_INSTANCE_REF 0x0000106D -#define ERROR_WMI_ALREADY_ENABLED 0x0000106E -#define ERROR_WMI_GUID_DISCONNECTED 0x0000106F -#define ERROR_WMI_SERVER_UNAVAILABLE 0x00001070 -#define ERROR_WMI_DP_FAILED 0x00001071 -#define ERROR_WMI_INVALID_MOF 0x00001072 -#define ERROR_WMI_INVALID_REGINFO 0x00001073 -#define ERROR_WMI_ALREADY_DISABLED 0x00001074 -#define ERROR_WMI_READ_ONLY 0x00001075 -#define ERROR_WMI_SET_FAILURE 0x00001076 -#define ERROR_NOT_APPCONTAINER 0x0000109A -#define ERROR_APPCONTAINER_REQUIRED 0x0000109B -#define ERROR_NOT_SUPPORTED_IN_APPCONTAINER 0x0000109C -#define ERROR_INVALID_PACKAGE_SID_LENGTH 0x0000109D -#define ERROR_INVALID_MEDIA 0x000010CC -#define ERROR_INVALID_LIBRARY 0x000010CD -#define ERROR_INVALID_MEDIA_POOL 0x000010CE -#define ERROR_DRIVE_MEDIA_MISMATCH 0x000010CF -#define ERROR_MEDIA_OFFLINE 0x000010D0 -#define ERROR_LIBRARY_OFFLINE 0x000010D1 -#define ERROR_EMPTY 0x000010D2 -#define ERROR_NOT_EMPTY 0x000010D3 -#define ERROR_MEDIA_UNAVAILABLE 0x000010D4 -#define ERROR_RESOURCE_DISABLED 0x000010D5 -#define ERROR_INVALID_CLEANER 0x000010D6 -#define ERROR_UNABLE_TO_CLEAN 0x000010D7 -#define ERROR_OBJECT_NOT_FOUND 0x000010D8 -#define ERROR_DATABASE_FAILURE 0x000010D9 -#define ERROR_DATABASE_FULL 0x000010DA -#define ERROR_MEDIA_INCOMPATIBLE 0x000010DB -#define ERROR_RESOURCE_NOT_PRESENT 0x000010DC -#define ERROR_INVALID_OPERATION 0x000010DD -#define ERROR_MEDIA_NOT_AVAILABLE 0x000010DE -#define ERROR_DEVICE_NOT_AVAILABLE 0x000010DF -#define ERROR_REQUEST_REFUSED 0x000010E0 -#define ERROR_INVALID_DRIVE_OBJECT 0x000010E1 -#define ERROR_LIBRARY_FULL 0x000010E2 -#define ERROR_MEDIUM_NOT_ACCESSIBLE 0x000010E3 -#define ERROR_UNABLE_TO_LOAD_MEDIUM 0x000010E4 -#define ERROR_UNABLE_TO_INVENTORY_DRIVE 0x000010E5 -#define ERROR_UNABLE_TO_INVENTORY_SLOT 0x000010E6 -#define ERROR_UNABLE_TO_INVENTORY_TRANSPORT 0x000010E7 -#define ERROR_TRANSPORT_FULL 0x000010E8 -#define ERROR_CONTROLLING_IEPORT 0x000010E9 -#define ERROR_UNABLE_TO_EJECT_MOUNTED_MEDIA 0x000010EA -#define ERROR_CLEANER_SLOT_SET 0x000010EB -#define ERROR_CLEANER_SLOT_NOT_SET 0x000010EC -#define ERROR_CLEANER_CARTRIDGE_SPENT 0x000010ED -#define ERROR_UNEXPECTED_OMID 0x000010EE -#define ERROR_CANT_DELETE_LAST_ITEM 0x000010EF -#define ERROR_MESSAGE_EXCEEDS_MAX_SIZE 0x000010F0 -#define ERROR_VOLUME_CONTAINS_SYS_FILES 0x000010F1 -#define ERROR_INDIGENOUS_TYPE 0x000010F2 -#define ERROR_NO_SUPPORTING_DRIVES 0x000010F3 -#define ERROR_CLEANER_CARTRIDGE_INSTALLED 0x000010F4 -#define ERROR_IEPORT_FULL 0x000010F5 -#define ERROR_FILE_OFFLINE 0x000010FE -#define ERROR_REMOTE_STORAGE_NOT_ACTIVE 0x000010FF -#define ERROR_REMOTE_STORAGE_MEDIA_ERROR 0x00001100 -#define ERROR_NOT_A_REPARSE_POINT 0x00001126 -#define ERROR_REPARSE_ATTRIBUTE_CONFLICT 0x00001127 -#define ERROR_INVALID_REPARSE_DATA 0x00001128 -#define ERROR_REPARSE_TAG_INVALID 0x00001129 -#define ERROR_REPARSE_TAG_MISMATCH 0x0000112A -#define ERROR_APP_DATA_NOT_FOUND 0x00001130 -#define ERROR_APP_DATA_EXPIRED 0x00001131 -#define ERROR_APP_DATA_CORRUPT 0x00001132 -#define ERROR_APP_DATA_LIMIT_EXCEEDED 0x00001133 -#define ERROR_APP_DATA_REBOOT_REQUIRED 0x00001134 -#define ERROR_SECUREBOOT_ROLLBACK_DETECTED 0x00001144 -#define ERROR_SECUREBOOT_POLICY_VIOLATION 0x00001145 -#define ERROR_SECUREBOOT_INVALID_POLICY 0x00001146 -#define ERROR_SECUREBOOT_POLICY_PUBLISHER_NOT_FOUND 0x00001147 -#define ERROR_SECUREBOOT_POLICY_NOT_SIGNED 0x00001148 -#define ERROR_SECUREBOOT_NOT_ENABLED 0x00001149 -#define ERROR_SECUREBOOT_FILE_REPLACED 0x0000114A -#define ERROR_OFFLOAD_READ_FLT_NOT_SUPPORTED 0x00001158 -#define ERROR_OFFLOAD_WRITE_FLT_NOT_SUPPORTED 0x00001159 -#define ERROR_OFFLOAD_READ_FILE_NOT_SUPPORTED 0x0000115A -#define ERROR_OFFLOAD_WRITE_FILE_NOT_SUPPORTED 0x0000115B -#define ERROR_VOLUME_NOT_SIS_ENABLED 0x00001194 -#define ERROR_DEPENDENT_RESOURCE_EXISTS 0x00001389 -#define ERROR_DEPENDENCY_NOT_FOUND 0x0000138A -#define ERROR_DEPENDENCY_ALREADY_EXISTS 0x0000138B -#define ERROR_RESOURCE_NOT_ONLINE 0x0000138C -#define ERROR_HOST_NODE_NOT_AVAILABLE 0x0000138D -#define ERROR_RESOURCE_NOT_AVAILABLE 0x0000138E -#define ERROR_RESOURCE_NOT_FOUND 0x0000138F -#define ERROR_SHUTDOWN_CLUSTER 0x00001390 -#define ERROR_CANT_EVICT_ACTIVE_NODE 0x00001391 -#define ERROR_OBJECT_ALREADY_EXISTS 0x00001392 -#define ERROR_OBJECT_IN_LIST 0x00001393 -#define ERROR_GROUP_NOT_AVAILABLE 0x00001394 -#define ERROR_GROUP_NOT_FOUND 0x00001395 -#define ERROR_GROUP_NOT_ONLINE 0x00001396 -#define ERROR_HOST_NODE_NOT_RESOURCE_OWNER 0x00001397 -#define ERROR_HOST_NODE_NOT_GROUP_OWNER 0x00001398 -#define ERROR_RESMON_CREATE_FAILED 0x00001399 -#define ERROR_RESMON_ONLINE_FAILED 0x0000139A -#define ERROR_RESOURCE_ONLINE 0x0000139B -#define ERROR_QUORUM_RESOURCE 0x0000139C -#define ERROR_NOT_QUORUM_CAPABLE 0x0000139D -#define ERROR_CLUSTER_SHUTTING_DOWN 0x0000139E -#define ERROR_INVALID_STATE 0x0000139F -#define ERROR_RESOURCE_PROPERTIES_STORED 0x000013A0 -#define ERROR_NOT_QUORUM_CLASS 0x000013A1 -#define ERROR_CORE_RESOURCE 0x000013A2 -#define ERROR_QUORUM_RESOURCE_ONLINE_FAILED 0x000013A3 -#define ERROR_QUORUMLOG_OPEN_FAILED 0x000013A4 -#define ERROR_CLUSTERLOG_CORRUPT 0x000013A5 -#define ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE 0x000013A6 -#define ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE 0x000013A7 -#define ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND 0x000013A8 -#define ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE 0x000013A9 -#define ERROR_QUORUM_OWNER_ALIVE 0x000013AA -#define ERROR_NETWORK_NOT_AVAILABLE 0x000013AB -#define ERROR_NODE_NOT_AVAILABLE 0x000013AC -#define ERROR_ALL_NODES_NOT_AVAILABLE 0x000013AD -#define ERROR_RESOURCE_FAILED 0x000013AE -#define ERROR_CLUSTER_INVALID_NODE 0x000013AF -#define ERROR_CLUSTER_NODE_EXISTS 0x000013B0 -#define ERROR_CLUSTER_JOIN_IN_PROGRESS 0x000013B1 -#define ERROR_CLUSTER_NODE_NOT_FOUND 0x000013B2 -#define ERROR_CLUSTER_LOCAL_NODE_NOT_FOUND 0x000013B3 -#define ERROR_CLUSTER_NETWORK_EXISTS 0x000013B4 -#define ERROR_CLUSTER_NETWORK_NOT_FOUND 0x000013B5 -#define ERROR_CLUSTER_NETINTERFACE_EXISTS 0x000013B6 -#define ERROR_CLUSTER_NETINTERFACE_NOT_FOUND 0x000013B7 -#define ERROR_CLUSTER_INVALID_REQUEST 0x000013B8 -#define ERROR_CLUSTER_INVALID_NETWORK_PROVIDER 0x000013B9 -#define ERROR_CLUSTER_NODE_DOWN 0x000013BA -#define ERROR_CLUSTER_NODE_UNREACHABLE 0x000013BB -#define ERROR_CLUSTER_NODE_NOT_MEMBER 0x000013BC -#define ERROR_CLUSTER_JOIN_NOT_IN_PROGRESS 0x000013BD -#define ERROR_CLUSTER_INVALID_NETWORK 0x000013BE -#define ERROR_CLUSTER_NODE_UP 0x000013C0 -#define ERROR_CLUSTER_IPADDR_IN_USE 0x000013C1 -#define ERROR_CLUSTER_NODE_NOT_PAUSED 0x000013C2 -#define ERROR_CLUSTER_NO_SECURITY_CONTEXT 0x000013C3 -#define ERROR_CLUSTER_NETWORK_NOT_INTERNAL 0x000013C4 -#define ERROR_CLUSTER_NODE_ALREADY_UP 0x000013C5 -#define ERROR_CLUSTER_NODE_ALREADY_DOWN 0x000013C6 -#define ERROR_CLUSTER_NETWORK_ALREADY_ONLINE 0x000013C7 -#define ERROR_CLUSTER_NETWORK_ALREADY_OFFLINE 0x000013C8 -#define ERROR_CLUSTER_NODE_ALREADY_MEMBER 0x000013C9 -#define ERROR_CLUSTER_LAST_INTERNAL_NETWORK 0x000013CA -#define ERROR_CLUSTER_NETWORK_HAS_DEPENDENTS 0x000013CB -#define ERROR_INVALID_OPERATION_ON_QUORUM 0x000013CC -#define ERROR_DEPENDENCY_NOT_ALLOWED 0x000013CD -#define ERROR_CLUSTER_NODE_PAUSED 0x000013CE -#define ERROR_NODE_CANT_HOST_RESOURCE 0x000013CF -#define ERROR_CLUSTER_NODE_NOT_READY 0x000013D0 -#define ERROR_CLUSTER_NODE_SHUTTING_DOWN 0x000013D1 -#define ERROR_CLUSTER_JOIN_ABORTED 0x000013D2 -#define ERROR_CLUSTER_INCOMPATIBLE_VERSIONS 0x000013D3 -#define ERROR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED 0x000013D4 -#define ERROR_CLUSTER_SYSTEM_CONFIG_CHANGED 0x000013D5 -#define ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND 0x000013D6 -#define ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED 0x000013D7 -#define ERROR_CLUSTER_RESNAME_NOT_FOUND 0x000013D8 -#define ERROR_CLUSTER_NO_RPC_PACKAGES_REGISTERED 0x000013D9 -#define ERROR_CLUSTER_OWNER_NOT_IN_PREFLIST 0x000013DA -#define ERROR_CLUSTER_DATABASE_SEQMISMATCH 0x000013DB -#define ERROR_RESMON_INVALID_STATE 0x000013DC -#define ERROR_CLUSTER_GUM_NOT_LOCKER 0x000013DD -#define ERROR_QUORUM_DISK_NOT_FOUND 0x000013DE -#define ERROR_DATABASE_BACKUP_CORRUPT 0x000013DF -#define ERROR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT 0x000013E0 -#define ERROR_RESOURCE_PROPERTY_UNCHANGEABLE 0x000013E1 -#define ERROR_CLUSTER_MEMBERSHIP_INVALID_STATE 0x00001702 -#define ERROR_CLUSTER_QUORUMLOG_NOT_FOUND 0x00001703 -#define ERROR_CLUSTER_MEMBERSHIP_HALT 0x00001704 -#define ERROR_CLUSTER_INSTANCE_ID_MISMATCH 0x00001705 -#define ERROR_CLUSTER_NETWORK_NOT_FOUND_FOR_IP 0x00001706 -#define ERROR_CLUSTER_PROPERTY_DATA_TYPE_MISMATCH 0x00001707 -#define ERROR_CLUSTER_EVICT_WITHOUT_CLEANUP 0x00001708 -#define ERROR_CLUSTER_PARAMETER_MISMATCH 0x00001709 -#define ERROR_NODE_CANNOT_BE_CLUSTERED 0x0000170A -#define ERROR_CLUSTER_WRONG_OS_VERSION 0x0000170B -#define ERROR_CLUSTER_CANT_CREATE_DUP_CLUSTER_NAME 0x0000170C -#define ERROR_CLUSCFG_ALREADY_COMMITTED 0x0000170D -#define ERROR_CLUSCFG_ROLLBACK_FAILED 0x0000170E -#define ERROR_CLUSCFG_SYSTEM_DISK_DRIVE_LETTER_CONFLICT 0x0000170F -#define ERROR_CLUSTER_OLD_VERSION 0x00001710 -#define ERROR_CLUSTER_MISMATCHED_COMPUTER_ACCT_NAME 0x00001711 -#define ERROR_CLUSTER_NO_NET_ADAPTERS 0x00001712 -#define ERROR_CLUSTER_POISONED 0x00001713 -#define ERROR_CLUSTER_GROUP_MOVING 0x00001714 -#define ERROR_CLUSTER_RESOURCE_TYPE_BUSY 0x00001715 -#define ERROR_RESOURCE_CALL_TIMED_OUT 0x00001716 -#define ERROR_INVALID_CLUSTER_IPV6_ADDRESS 0x00001717 -#define ERROR_CLUSTER_INTERNAL_INVALID_FUNCTION 0x00001718 -#define ERROR_CLUSTER_PARAMETER_OUT_OF_BOUNDS 0x00001719 -#define ERROR_CLUSTER_PARTIAL_SEND 0x0000171A -#define ERROR_CLUSTER_REGISTRY_INVALID_FUNCTION 0x0000171B -#define ERROR_CLUSTER_INVALID_STRING_TERMINATION 0x0000171C -#define ERROR_CLUSTER_INVALID_STRING_FORMAT 0x0000171D -#define ERROR_CLUSTER_DATABASE_TRANSACTION_IN_PROGRESS 0x0000171E -#define ERROR_CLUSTER_DATABASE_TRANSACTION_NOT_IN_PROGRESS 0x0000171F -#define ERROR_CLUSTER_NULL_DATA 0x00001720 -#define ERROR_CLUSTER_PARTIAL_READ 0x00001721 -#define ERROR_CLUSTER_PARTIAL_WRITE 0x00001722 -#define ERROR_CLUSTER_CANT_DESERIALIZE_DATA 0x00001723 -#define ERROR_DEPENDENT_RESOURCE_PROPERTY_CONFLICT 0x00001724 -#define ERROR_CLUSTER_NO_QUORUM 0x00001725 -#define ERROR_CLUSTER_INVALID_IPV6_NETWORK 0x00001726 -#define ERROR_CLUSTER_INVALID_IPV6_TUNNEL_NETWORK 0x00001727 -#define ERROR_QUORUM_NOT_ALLOWED_IN_THIS_GROUP 0x00001728 -#define ERROR_DEPENDENCY_TREE_TOO_COMPLEX 0x00001729 -#define ERROR_EXCEPTION_IN_RESOURCE_CALL 0x0000172A -#define ERROR_CLUSTER_RHS_FAILED_INITIALIZATION 0x0000172B -#define ERROR_CLUSTER_NOT_INSTALLED 0x0000172C -#define ERROR_CLUSTER_RESOURCES_MUST_BE_ONLINE_ON_THE_SAME_NODE 0x0000172D -#define ERROR_CLUSTER_MAX_NODES_IN_CLUSTER 0x0000172E -#define ERROR_CLUSTER_TOO_MANY_NODES 0x0000172F -#define ERROR_CLUSTER_OBJECT_ALREADY_USED 0x00001730 -#define ERROR_NONCORE_GROUPS_FOUND 0x00001731 -#define ERROR_FILE_SHARE_RESOURCE_CONFLICT 0x00001732 -#define ERROR_CLUSTER_EVICT_INVALID_REQUEST 0x00001733 -#define ERROR_CLUSTER_SINGLETON_RESOURCE 0x00001734 -#define ERROR_CLUSTER_GROUP_SINGLETON_RESOURCE 0x00001735 -#define ERROR_CLUSTER_RESOURCE_PROVIDER_FAILED 0x00001736 -#define ERROR_CLUSTER_RESOURCE_CONFIGURATION_ERROR 0x00001737 -#define ERROR_CLUSTER_GROUP_BUSY 0x00001738 -#define ERROR_CLUSTER_NOT_SHARED_VOLUME 0x00001739 -#define ERROR_CLUSTER_INVALID_SECURITY_DESCRIPTOR 0x0000173A -#define ERROR_CLUSTER_SHARED_VOLUMES_IN_USE 0x0000173B -#define ERROR_CLUSTER_USE_SHARED_VOLUMES_API 0x0000173C -#define ERROR_CLUSTER_BACKUP_IN_PROGRESS 0x0000173D -#define ERROR_NON_CSV_PATH 0x0000173E -#define ERROR_CSV_VOLUME_NOT_LOCAL 0x0000173F -#define ERROR_CLUSTER_WATCHDOG_TERMINATING 0x00001740 -#define ERROR_CLUSTER_RESOURCE_VETOED_MOVE_INCOMPATIBLE_NODES 0x00001741 -#define ERROR_CLUSTER_INVALID_NODE_WEIGHT 0x00001742 -#define ERROR_CLUSTER_RESOURCE_VETOED_CALL 0x00001743 -#define ERROR_RESMON_SYSTEM_RESOURCES_LACKING 0x00001744 -#define ERROR_CLUSTER_RESOURCE_VETOED_MOVE_NOT_ENOUGH_RESOURCES_ON_DESTINATION 0x00001745 -#define ERROR_CLUSTER_RESOURCE_VETOED_MOVE_NOT_ENOUGH_RESOURCES_ON_SOURCE 0x00001746 -#define ERROR_CLUSTER_GROUP_QUEUED 0x00001747 -#define ERROR_CLUSTER_RESOURCE_LOCKED_STATUS 0x00001748 -#define ERROR_CLUSTER_SHARED_VOLUME_FAILOVER_NOT_ALLOWED 0x00001749 -#define ERROR_CLUSTER_NODE_DRAIN_IN_PROGRESS 0x0000174A -#define ERROR_CLUSTER_DISK_NOT_CONNECTED 0x0000174B -#define ERROR_DISK_NOT_CSV_CAPABLE 0x0000174C -#define ERROR_RESOURCE_NOT_IN_AVAILABLE_STORAGE 0x0000174D -#define ERROR_CLUSTER_SHARED_VOLUME_REDIRECTED 0x0000174E -#define ERROR_CLUSTER_SHARED_VOLUME_NOT_REDIRECTED 0x0000174F -#define ERROR_CLUSTER_CANNOT_RETURN_PROPERTIES 0x00001750 -#define ERROR_CLUSTER_RESOURCE_CONTAINS_UNSUPPORTED_DIFF_AREA_FOR_SHARED_VOLUMES 0x00001751 -#define ERROR_CLUSTER_RESOURCE_IS_IN_MAINTENANCE_MODE 0x00001752 -#define ERROR_CLUSTER_AFFINITY_CONFLICT 0x00001753 -#define ERROR_CLUSTER_RESOURCE_IS_REPLICA_VIRTUAL_MACHINE 0x00001754 +#define ERROR_WINS_INTERNAL 0x00000FA0 +#define ERROR_CAN_NOT_DEL_LOCAL_WINS 0x00000FA1 +#define ERROR_STATIC_INIT 0x00000FA2 +#define ERROR_INC_BACKUP 0x00000FA3 +#define ERROR_FULL_BACKUP 0x00000FA4 +#define ERROR_REC_NON_EXISTENT 0x00000FA5 +#define ERROR_RPL_NOT_ALLOWED 0x00000FA6 +#define PEERDIST_ERROR_CONTENTINFO_VERSION_UNSUPPORTED 0x00000FD2 +#define PEERDIST_ERROR_CANNOT_PARSE_CONTENTINFO 0x00000FD3 +#define PEERDIST_ERROR_MISSING_DATA 0x00000FD4 +#define PEERDIST_ERROR_NO_MORE 0x00000FD5 +#define PEERDIST_ERROR_NOT_INITIALIZED 0x00000FD6 +#define PEERDIST_ERROR_ALREADY_INITIALIZED 0x00000FD7 +#define PEERDIST_ERROR_SHUTDOWN_IN_PROGRESS 0x00000FD8 +#define PEERDIST_ERROR_INVALIDATED 0x00000FD9 +#define PEERDIST_ERROR_ALREADY_EXISTS 0x00000FDA +#define PEERDIST_ERROR_OPERATION_NOTFOUND 0x00000FDB +#define PEERDIST_ERROR_ALREADY_COMPLETED 0x00000FDC +#define PEERDIST_ERROR_OUT_OF_BOUNDS 0x00000FDD +#define PEERDIST_ERROR_VERSION_UNSUPPORTED 0x00000FDE +#define PEERDIST_ERROR_INVALID_CONFIGURATION 0x00000FDF +#define PEERDIST_ERROR_NOT_LICENSED 0x00000FE0 +#define PEERDIST_ERROR_SERVICE_UNAVAILABLE 0x00000FE1 +#define PEERDIST_ERROR_TRUST_FAILURE 0x00000FE2 +#define ERROR_DHCP_ADDRESS_CONFLICT 0x00001004 +#define ERROR_WMI_GUID_NOT_FOUND 0x00001068 +#define ERROR_WMI_INSTANCE_NOT_FOUND 0x00001069 +#define ERROR_WMI_ITEMID_NOT_FOUND 0x0000106A +#define ERROR_WMI_TRY_AGAIN 0x0000106B +#define ERROR_WMI_DP_NOT_FOUND 0x0000106C +#define ERROR_WMI_UNRESOLVED_INSTANCE_REF 0x0000106D +#define ERROR_WMI_ALREADY_ENABLED 0x0000106E +#define ERROR_WMI_GUID_DISCONNECTED 0x0000106F +#define ERROR_WMI_SERVER_UNAVAILABLE 0x00001070 +#define ERROR_WMI_DP_FAILED 0x00001071 +#define ERROR_WMI_INVALID_MOF 0x00001072 +#define ERROR_WMI_INVALID_REGINFO 0x00001073 +#define ERROR_WMI_ALREADY_DISABLED 0x00001074 +#define ERROR_WMI_READ_ONLY 0x00001075 +#define ERROR_WMI_SET_FAILURE 0x00001076 +#define ERROR_NOT_APPCONTAINER 0x0000109A +#define ERROR_APPCONTAINER_REQUIRED 0x0000109B +#define ERROR_NOT_SUPPORTED_IN_APPCONTAINER 0x0000109C +#define ERROR_INVALID_PACKAGE_SID_LENGTH 0x0000109D +#define ERROR_INVALID_MEDIA 0x000010CC +#define ERROR_INVALID_LIBRARY 0x000010CD +#define ERROR_INVALID_MEDIA_POOL 0x000010CE +#define ERROR_DRIVE_MEDIA_MISMATCH 0x000010CF +#define ERROR_MEDIA_OFFLINE 0x000010D0 +#define ERROR_LIBRARY_OFFLINE 0x000010D1 +#define ERROR_EMPTY 0x000010D2 +#define ERROR_NOT_EMPTY 0x000010D3 +#define ERROR_MEDIA_UNAVAILABLE 0x000010D4 +#define ERROR_RESOURCE_DISABLED 0x000010D5 +#define ERROR_INVALID_CLEANER 0x000010D6 +#define ERROR_UNABLE_TO_CLEAN 0x000010D7 +#define ERROR_OBJECT_NOT_FOUND 0x000010D8 +#define ERROR_DATABASE_FAILURE 0x000010D9 +#define ERROR_DATABASE_FULL 0x000010DA +#define ERROR_MEDIA_INCOMPATIBLE 0x000010DB +#define ERROR_RESOURCE_NOT_PRESENT 0x000010DC +#define ERROR_INVALID_OPERATION 0x000010DD +#define ERROR_MEDIA_NOT_AVAILABLE 0x000010DE +#define ERROR_DEVICE_NOT_AVAILABLE 0x000010DF +#define ERROR_REQUEST_REFUSED 0x000010E0 +#define ERROR_INVALID_DRIVE_OBJECT 0x000010E1 +#define ERROR_LIBRARY_FULL 0x000010E2 +#define ERROR_MEDIUM_NOT_ACCESSIBLE 0x000010E3 +#define ERROR_UNABLE_TO_LOAD_MEDIUM 0x000010E4 +#define ERROR_UNABLE_TO_INVENTORY_DRIVE 0x000010E5 +#define ERROR_UNABLE_TO_INVENTORY_SLOT 0x000010E6 +#define ERROR_UNABLE_TO_INVENTORY_TRANSPORT 0x000010E7 +#define ERROR_TRANSPORT_FULL 0x000010E8 +#define ERROR_CONTROLLING_IEPORT 0x000010E9 +#define ERROR_UNABLE_TO_EJECT_MOUNTED_MEDIA 0x000010EA +#define ERROR_CLEANER_SLOT_SET 0x000010EB +#define ERROR_CLEANER_SLOT_NOT_SET 0x000010EC +#define ERROR_CLEANER_CARTRIDGE_SPENT 0x000010ED +#define ERROR_UNEXPECTED_OMID 0x000010EE +#define ERROR_CANT_DELETE_LAST_ITEM 0x000010EF +#define ERROR_MESSAGE_EXCEEDS_MAX_SIZE 0x000010F0 +#define ERROR_VOLUME_CONTAINS_SYS_FILES 0x000010F1 +#define ERROR_INDIGENOUS_TYPE 0x000010F2 +#define ERROR_NO_SUPPORTING_DRIVES 0x000010F3 +#define ERROR_CLEANER_CARTRIDGE_INSTALLED 0x000010F4 +#define ERROR_IEPORT_FULL 0x000010F5 +#define ERROR_FILE_OFFLINE 0x000010FE +#define ERROR_REMOTE_STORAGE_NOT_ACTIVE 0x000010FF +#define ERROR_REMOTE_STORAGE_MEDIA_ERROR 0x00001100 +#define ERROR_NOT_A_REPARSE_POINT 0x00001126 +#define ERROR_REPARSE_ATTRIBUTE_CONFLICT 0x00001127 +#define ERROR_INVALID_REPARSE_DATA 0x00001128 +#define ERROR_REPARSE_TAG_INVALID 0x00001129 +#define ERROR_REPARSE_TAG_MISMATCH 0x0000112A +#define ERROR_APP_DATA_NOT_FOUND 0x00001130 +#define ERROR_APP_DATA_EXPIRED 0x00001131 +#define ERROR_APP_DATA_CORRUPT 0x00001132 +#define ERROR_APP_DATA_LIMIT_EXCEEDED 0x00001133 +#define ERROR_APP_DATA_REBOOT_REQUIRED 0x00001134 +#define ERROR_SECUREBOOT_ROLLBACK_DETECTED 0x00001144 +#define ERROR_SECUREBOOT_POLICY_VIOLATION 0x00001145 +#define ERROR_SECUREBOOT_INVALID_POLICY 0x00001146 +#define ERROR_SECUREBOOT_POLICY_PUBLISHER_NOT_FOUND 0x00001147 +#define ERROR_SECUREBOOT_POLICY_NOT_SIGNED 0x00001148 +#define ERROR_SECUREBOOT_NOT_ENABLED 0x00001149 +#define ERROR_SECUREBOOT_FILE_REPLACED 0x0000114A +#define ERROR_OFFLOAD_READ_FLT_NOT_SUPPORTED 0x00001158 +#define ERROR_OFFLOAD_WRITE_FLT_NOT_SUPPORTED 0x00001159 +#define ERROR_OFFLOAD_READ_FILE_NOT_SUPPORTED 0x0000115A +#define ERROR_OFFLOAD_WRITE_FILE_NOT_SUPPORTED 0x0000115B +#define ERROR_VOLUME_NOT_SIS_ENABLED 0x00001194 +#define ERROR_DEPENDENT_RESOURCE_EXISTS 0x00001389 +#define ERROR_DEPENDENCY_NOT_FOUND 0x0000138A +#define ERROR_DEPENDENCY_ALREADY_EXISTS 0x0000138B +#define ERROR_RESOURCE_NOT_ONLINE 0x0000138C +#define ERROR_HOST_NODE_NOT_AVAILABLE 0x0000138D +#define ERROR_RESOURCE_NOT_AVAILABLE 0x0000138E +#define ERROR_RESOURCE_NOT_FOUND 0x0000138F +#define ERROR_SHUTDOWN_CLUSTER 0x00001390 +#define ERROR_CANT_EVICT_ACTIVE_NODE 0x00001391 +#define ERROR_OBJECT_ALREADY_EXISTS 0x00001392 +#define ERROR_OBJECT_IN_LIST 0x00001393 +#define ERROR_GROUP_NOT_AVAILABLE 0x00001394 +#define ERROR_GROUP_NOT_FOUND 0x00001395 +#define ERROR_GROUP_NOT_ONLINE 0x00001396 +#define ERROR_HOST_NODE_NOT_RESOURCE_OWNER 0x00001397 +#define ERROR_HOST_NODE_NOT_GROUP_OWNER 0x00001398 +#define ERROR_RESMON_CREATE_FAILED 0x00001399 +#define ERROR_RESMON_ONLINE_FAILED 0x0000139A +#define ERROR_RESOURCE_ONLINE 0x0000139B +#define ERROR_QUORUM_RESOURCE 0x0000139C +#define ERROR_NOT_QUORUM_CAPABLE 0x0000139D +#define ERROR_CLUSTER_SHUTTING_DOWN 0x0000139E +#define ERROR_INVALID_STATE 0x0000139F +#define ERROR_RESOURCE_PROPERTIES_STORED 0x000013A0 +#define ERROR_NOT_QUORUM_CLASS 0x000013A1 +#define ERROR_CORE_RESOURCE 0x000013A2 +#define ERROR_QUORUM_RESOURCE_ONLINE_FAILED 0x000013A3 +#define ERROR_QUORUMLOG_OPEN_FAILED 0x000013A4 +#define ERROR_CLUSTERLOG_CORRUPT 0x000013A5 +#define ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE 0x000013A6 +#define ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE 0x000013A7 +#define ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND 0x000013A8 +#define ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE 0x000013A9 +#define ERROR_QUORUM_OWNER_ALIVE 0x000013AA +#define ERROR_NETWORK_NOT_AVAILABLE 0x000013AB +#define ERROR_NODE_NOT_AVAILABLE 0x000013AC +#define ERROR_ALL_NODES_NOT_AVAILABLE 0x000013AD +#define ERROR_RESOURCE_FAILED 0x000013AE +#define ERROR_CLUSTER_INVALID_NODE 0x000013AF +#define ERROR_CLUSTER_NODE_EXISTS 0x000013B0 +#define ERROR_CLUSTER_JOIN_IN_PROGRESS 0x000013B1 +#define ERROR_CLUSTER_NODE_NOT_FOUND 0x000013B2 +#define ERROR_CLUSTER_LOCAL_NODE_NOT_FOUND 0x000013B3 +#define ERROR_CLUSTER_NETWORK_EXISTS 0x000013B4 +#define ERROR_CLUSTER_NETWORK_NOT_FOUND 0x000013B5 +#define ERROR_CLUSTER_NETINTERFACE_EXISTS 0x000013B6 +#define ERROR_CLUSTER_NETINTERFACE_NOT_FOUND 0x000013B7 +#define ERROR_CLUSTER_INVALID_REQUEST 0x000013B8 +#define ERROR_CLUSTER_INVALID_NETWORK_PROVIDER 0x000013B9 +#define ERROR_CLUSTER_NODE_DOWN 0x000013BA +#define ERROR_CLUSTER_NODE_UNREACHABLE 0x000013BB +#define ERROR_CLUSTER_NODE_NOT_MEMBER 0x000013BC +#define ERROR_CLUSTER_JOIN_NOT_IN_PROGRESS 0x000013BD +#define ERROR_CLUSTER_INVALID_NETWORK 0x000013BE +#define ERROR_CLUSTER_NODE_UP 0x000013C0 +#define ERROR_CLUSTER_IPADDR_IN_USE 0x000013C1 +#define ERROR_CLUSTER_NODE_NOT_PAUSED 0x000013C2 +#define ERROR_CLUSTER_NO_SECURITY_CONTEXT 0x000013C3 +#define ERROR_CLUSTER_NETWORK_NOT_INTERNAL 0x000013C4 +#define ERROR_CLUSTER_NODE_ALREADY_UP 0x000013C5 +#define ERROR_CLUSTER_NODE_ALREADY_DOWN 0x000013C6 +#define ERROR_CLUSTER_NETWORK_ALREADY_ONLINE 0x000013C7 +#define ERROR_CLUSTER_NETWORK_ALREADY_OFFLINE 0x000013C8 +#define ERROR_CLUSTER_NODE_ALREADY_MEMBER 0x000013C9 +#define ERROR_CLUSTER_LAST_INTERNAL_NETWORK 0x000013CA +#define ERROR_CLUSTER_NETWORK_HAS_DEPENDENTS 0x000013CB +#define ERROR_INVALID_OPERATION_ON_QUORUM 0x000013CC +#define ERROR_DEPENDENCY_NOT_ALLOWED 0x000013CD +#define ERROR_CLUSTER_NODE_PAUSED 0x000013CE +#define ERROR_NODE_CANT_HOST_RESOURCE 0x000013CF +#define ERROR_CLUSTER_NODE_NOT_READY 0x000013D0 +#define ERROR_CLUSTER_NODE_SHUTTING_DOWN 0x000013D1 +#define ERROR_CLUSTER_JOIN_ABORTED 0x000013D2 +#define ERROR_CLUSTER_INCOMPATIBLE_VERSIONS 0x000013D3 +#define ERROR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED 0x000013D4 +#define ERROR_CLUSTER_SYSTEM_CONFIG_CHANGED 0x000013D5 +#define ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND 0x000013D6 +#define ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED 0x000013D7 +#define ERROR_CLUSTER_RESNAME_NOT_FOUND 0x000013D8 +#define ERROR_CLUSTER_NO_RPC_PACKAGES_REGISTERED 0x000013D9 +#define ERROR_CLUSTER_OWNER_NOT_IN_PREFLIST 0x000013DA +#define ERROR_CLUSTER_DATABASE_SEQMISMATCH 0x000013DB +#define ERROR_RESMON_INVALID_STATE 0x000013DC +#define ERROR_CLUSTER_GUM_NOT_LOCKER 0x000013DD +#define ERROR_QUORUM_DISK_NOT_FOUND 0x000013DE +#define ERROR_DATABASE_BACKUP_CORRUPT 0x000013DF +#define ERROR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT 0x000013E0 +#define ERROR_RESOURCE_PROPERTY_UNCHANGEABLE 0x000013E1 +#define ERROR_CLUSTER_MEMBERSHIP_INVALID_STATE 0x00001702 +#define ERROR_CLUSTER_QUORUMLOG_NOT_FOUND 0x00001703 +#define ERROR_CLUSTER_MEMBERSHIP_HALT 0x00001704 +#define ERROR_CLUSTER_INSTANCE_ID_MISMATCH 0x00001705 +#define ERROR_CLUSTER_NETWORK_NOT_FOUND_FOR_IP 0x00001706 +#define ERROR_CLUSTER_PROPERTY_DATA_TYPE_MISMATCH 0x00001707 +#define ERROR_CLUSTER_EVICT_WITHOUT_CLEANUP 0x00001708 +#define ERROR_CLUSTER_PARAMETER_MISMATCH 0x00001709 +#define ERROR_NODE_CANNOT_BE_CLUSTERED 0x0000170A +#define ERROR_CLUSTER_WRONG_OS_VERSION 0x0000170B +#define ERROR_CLUSTER_CANT_CREATE_DUP_CLUSTER_NAME 0x0000170C +#define ERROR_CLUSCFG_ALREADY_COMMITTED 0x0000170D +#define ERROR_CLUSCFG_ROLLBACK_FAILED 0x0000170E +#define ERROR_CLUSCFG_SYSTEM_DISK_DRIVE_LETTER_CONFLICT 0x0000170F +#define ERROR_CLUSTER_OLD_VERSION 0x00001710 +#define ERROR_CLUSTER_MISMATCHED_COMPUTER_ACCT_NAME 0x00001711 +#define ERROR_CLUSTER_NO_NET_ADAPTERS 0x00001712 +#define ERROR_CLUSTER_POISONED 0x00001713 +#define ERROR_CLUSTER_GROUP_MOVING 0x00001714 +#define ERROR_CLUSTER_RESOURCE_TYPE_BUSY 0x00001715 +#define ERROR_RESOURCE_CALL_TIMED_OUT 0x00001716 +#define ERROR_INVALID_CLUSTER_IPV6_ADDRESS 0x00001717 +#define ERROR_CLUSTER_INTERNAL_INVALID_FUNCTION 0x00001718 +#define ERROR_CLUSTER_PARAMETER_OUT_OF_BOUNDS 0x00001719 +#define ERROR_CLUSTER_PARTIAL_SEND 0x0000171A +#define ERROR_CLUSTER_REGISTRY_INVALID_FUNCTION 0x0000171B +#define ERROR_CLUSTER_INVALID_STRING_TERMINATION 0x0000171C +#define ERROR_CLUSTER_INVALID_STRING_FORMAT 0x0000171D +#define ERROR_CLUSTER_DATABASE_TRANSACTION_IN_PROGRESS 0x0000171E +#define ERROR_CLUSTER_DATABASE_TRANSACTION_NOT_IN_PROGRESS 0x0000171F +#define ERROR_CLUSTER_NULL_DATA 0x00001720 +#define ERROR_CLUSTER_PARTIAL_READ 0x00001721 +#define ERROR_CLUSTER_PARTIAL_WRITE 0x00001722 +#define ERROR_CLUSTER_CANT_DESERIALIZE_DATA 0x00001723 +#define ERROR_DEPENDENT_RESOURCE_PROPERTY_CONFLICT 0x00001724 +#define ERROR_CLUSTER_NO_QUORUM 0x00001725 +#define ERROR_CLUSTER_INVALID_IPV6_NETWORK 0x00001726 +#define ERROR_CLUSTER_INVALID_IPV6_TUNNEL_NETWORK 0x00001727 +#define ERROR_QUORUM_NOT_ALLOWED_IN_THIS_GROUP 0x00001728 +#define ERROR_DEPENDENCY_TREE_TOO_COMPLEX 0x00001729 +#define ERROR_EXCEPTION_IN_RESOURCE_CALL 0x0000172A +#define ERROR_CLUSTER_RHS_FAILED_INITIALIZATION 0x0000172B +#define ERROR_CLUSTER_NOT_INSTALLED 0x0000172C +#define ERROR_CLUSTER_RESOURCES_MUST_BE_ONLINE_ON_THE_SAME_NODE 0x0000172D +#define ERROR_CLUSTER_MAX_NODES_IN_CLUSTER 0x0000172E +#define ERROR_CLUSTER_TOO_MANY_NODES 0x0000172F +#define ERROR_CLUSTER_OBJECT_ALREADY_USED 0x00001730 +#define ERROR_NONCORE_GROUPS_FOUND 0x00001731 +#define ERROR_FILE_SHARE_RESOURCE_CONFLICT 0x00001732 +#define ERROR_CLUSTER_EVICT_INVALID_REQUEST 0x00001733 +#define ERROR_CLUSTER_SINGLETON_RESOURCE 0x00001734 +#define ERROR_CLUSTER_GROUP_SINGLETON_RESOURCE 0x00001735 +#define ERROR_CLUSTER_RESOURCE_PROVIDER_FAILED 0x00001736 +#define ERROR_CLUSTER_RESOURCE_CONFIGURATION_ERROR 0x00001737 +#define ERROR_CLUSTER_GROUP_BUSY 0x00001738 +#define ERROR_CLUSTER_NOT_SHARED_VOLUME 0x00001739 +#define ERROR_CLUSTER_INVALID_SECURITY_DESCRIPTOR 0x0000173A +#define ERROR_CLUSTER_SHARED_VOLUMES_IN_USE 0x0000173B +#define ERROR_CLUSTER_USE_SHARED_VOLUMES_API 0x0000173C +#define ERROR_CLUSTER_BACKUP_IN_PROGRESS 0x0000173D +#define ERROR_NON_CSV_PATH 0x0000173E +#define ERROR_CSV_VOLUME_NOT_LOCAL 0x0000173F +#define ERROR_CLUSTER_WATCHDOG_TERMINATING 0x00001740 +#define ERROR_CLUSTER_RESOURCE_VETOED_MOVE_INCOMPATIBLE_NODES 0x00001741 +#define ERROR_CLUSTER_INVALID_NODE_WEIGHT 0x00001742 +#define ERROR_CLUSTER_RESOURCE_VETOED_CALL 0x00001743 +#define ERROR_RESMON_SYSTEM_RESOURCES_LACKING 0x00001744 +#define ERROR_CLUSTER_RESOURCE_VETOED_MOVE_NOT_ENOUGH_RESOURCES_ON_DESTINATION 0x00001745 +#define ERROR_CLUSTER_RESOURCE_VETOED_MOVE_NOT_ENOUGH_RESOURCES_ON_SOURCE 0x00001746 +#define ERROR_CLUSTER_GROUP_QUEUED 0x00001747 +#define ERROR_CLUSTER_RESOURCE_LOCKED_STATUS 0x00001748 +#define ERROR_CLUSTER_SHARED_VOLUME_FAILOVER_NOT_ALLOWED 0x00001749 +#define ERROR_CLUSTER_NODE_DRAIN_IN_PROGRESS 0x0000174A +#define ERROR_CLUSTER_DISK_NOT_CONNECTED 0x0000174B +#define ERROR_DISK_NOT_CSV_CAPABLE 0x0000174C +#define ERROR_RESOURCE_NOT_IN_AVAILABLE_STORAGE 0x0000174D +#define ERROR_CLUSTER_SHARED_VOLUME_REDIRECTED 0x0000174E +#define ERROR_CLUSTER_SHARED_VOLUME_NOT_REDIRECTED 0x0000174F +#define ERROR_CLUSTER_CANNOT_RETURN_PROPERTIES 0x00001750 +#define ERROR_CLUSTER_RESOURCE_CONTAINS_UNSUPPORTED_DIFF_AREA_FOR_SHARED_VOLUMES 0x00001751 +#define ERROR_CLUSTER_RESOURCE_IS_IN_MAINTENANCE_MODE 0x00001752 +#define ERROR_CLUSTER_AFFINITY_CONFLICT 0x00001753 +#define ERROR_CLUSTER_RESOURCE_IS_REPLICA_VIRTUAL_MACHINE 0x00001754 /* System Error Codes (6000-8199) */ -#define ERROR_ENCRYPTION_FAILED 0x00001770 -#define ERROR_DECRYPTION_FAILED 0x00001771 -#define ERROR_FILE_ENCRYPTED 0x00001772 -#define ERROR_NO_RECOVERY_POLICY 0x00001773 -#define ERROR_NO_EFS 0x00001774 -#define ERROR_WRONG_EFS 0x00001775 -#define ERROR_NO_USER_KEYS 0x00001776 -#define ERROR_FILE_NOT_ENCRYPTED 0x00001777 -#define ERROR_NOT_EXPORT_FORMAT 0x00001778 -#define ERROR_FILE_READ_ONLY 0x00001779 -#define ERROR_DIR_EFS_DISALLOWED 0x0000177A -#define ERROR_EFS_SERVER_NOT_TRUSTED 0x0000177B -#define ERROR_BAD_RECOVERY_POLICY 0x0000177C -#define ERROR_EFS_ALG_BLOB_TOO_BIG 0x0000177D -#define ERROR_VOLUME_NOT_SUPPORT_EFS 0x0000177E -#define ERROR_EFS_DISABLED 0x0000177F -#define ERROR_EFS_VERSION_NOT_SUPPORT 0x00001780 -#define ERROR_CS_ENCRYPTION_INVALID_SERVER_RESPONSE 0x00001781 -#define ERROR_CS_ENCRYPTION_UNSUPPORTED_SERVER 0x00001782 -#define ERROR_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE 0x00001783 -#define ERROR_CS_ENCRYPTION_NEW_ENCRYPTED_FILE 0x00001784 -#define ERROR_CS_ENCRYPTION_FILE_NOT_CSE 0x00001785 -#define ERROR_ENCRYPTION_POLICY_DENIES_OPERATION 0x00001786 -#define ERROR_NO_BROWSER_SERVERS_FOUND 0x000017E6 -#define SCHED_E_SERVICE_NOT_LOCALSYSTEM 0x00001838 -#define ERROR_LOG_SECTOR_INVALID 0x000019C8 -#define ERROR_LOG_SECTOR_PARITY_INVALID 0x000019C9 -#define ERROR_LOG_SECTOR_REMAPPED 0x000019CA -#define ERROR_LOG_BLOCK_INCOMPLETE 0x000019CB -#define ERROR_LOG_INVALID_RANGE 0x000019CC -#define ERROR_LOG_BLOCKS_EXHAUSTED 0x000019CD -#define ERROR_LOG_READ_CONTEXT_INVALID 0x000019CE -#define ERROR_LOG_RESTART_INVALID 0x000019CF -#define ERROR_LOG_BLOCK_VERSION 0x000019D0 -#define ERROR_LOG_BLOCK_INVALID 0x000019D1 -#define ERROR_LOG_READ_MODE_INVALID 0x000019D2 -#define ERROR_LOG_NO_RESTART 0x000019D3 -#define ERROR_LOG_METADATA_CORRUPT 0x000019D4 -#define ERROR_LOG_METADATA_INVALID 0x000019D5 -#define ERROR_LOG_METADATA_INCONSISTENT 0x000019D6 -#define ERROR_LOG_RESERVATION_INVALID 0x000019D7 -#define ERROR_LOG_CANT_DELETE 0x000019D8 -#define ERROR_LOG_CONTAINER_LIMIT_EXCEEDED 0x000019D9 -#define ERROR_LOG_START_OF_LOG 0x000019DA -#define ERROR_LOG_POLICY_ALREADY_INSTALLED 0x000019DB -#define ERROR_LOG_POLICY_NOT_INSTALLED 0x000019DC -#define ERROR_LOG_POLICY_INVALID 0x000019DD -#define ERROR_LOG_POLICY_CONFLICT 0x000019DE -#define ERROR_LOG_PINNED_ARCHIVE_TAIL 0x000019DF -#define ERROR_LOG_RECORD_NONEXISTENT 0x000019E0 -#define ERROR_LOG_RECORDS_RESERVED_INVALID 0x000019E1 -#define ERROR_LOG_SPACE_RESERVED_INVALID 0x000019E2 -#define ERROR_LOG_TAIL_INVALID 0x000019E3 -#define ERROR_LOG_FULL 0x000019E4 -#define ERROR_COULD_NOT_RESIZE_LOG 0x000019E5 -#define ERROR_LOG_MULTIPLEXED 0x000019E6 -#define ERROR_LOG_DEDICATED 0x000019E7 -#define ERROR_LOG_ARCHIVE_NOT_IN_PROGRESS 0x000019E8 -#define ERROR_LOG_ARCHIVE_IN_PROGRESS 0x000019E9 -#define ERROR_LOG_EPHEMERAL 0x000019EA -#define ERROR_LOG_NOT_ENOUGH_CONTAINERS 0x000019EB -#define ERROR_LOG_CLIENT_ALREADY_REGISTERED 0x000019EC -#define ERROR_LOG_CLIENT_NOT_REGISTERED 0x000019ED -#define ERROR_LOG_FULL_HANDLER_IN_PROGRESS 0x000019EE -#define ERROR_LOG_CONTAINER_READ_FAILED 0x000019EF -#define ERROR_LOG_CONTAINER_WRITE_FAILED 0x000019F0 -#define ERROR_LOG_CONTAINER_OPEN_FAILED 0x000019F1 -#define ERROR_LOG_CONTAINER_STATE_INVALID 0x000019F2 -#define ERROR_LOG_STATE_INVALID 0x000019F3 -#define ERROR_LOG_PINNED 0x000019F4 -#define ERROR_LOG_METADATA_FLUSH_FAILED 0x000019F5 -#define ERROR_LOG_INCONSISTENT_SECURITY 0x000019F6 -#define ERROR_LOG_APPENDED_FLUSH_FAILED 0x000019F7 -#define ERROR_LOG_PINNED_RESERVATION 0x000019F8 -#define ERROR_INVALID_TRANSACTION 0x00001A2C -#define ERROR_TRANSACTION_NOT_ACTIVE 0x00001A2D -#define ERROR_TRANSACTION_REQUEST_NOT_VALID 0x00001A2E -#define ERROR_TRANSACTION_NOT_REQUESTED 0x00001A2F -#define ERROR_TRANSACTION_ALREADY_ABORTED 0x00001A30 -#define ERROR_TRANSACTION_ALREADY_COMMITTED 0x00001A31 -#define ERROR_TM_INITIALIZATION_FAILED 0x00001A32 -#define ERROR_RESOURCEMANAGER_READ_ONLY 0x00001A33 -#define ERROR_TRANSACTION_NOT_JOINED 0x00001A34 -#define ERROR_TRANSACTION_SUPERIOR_EXISTS 0x00001A35 -#define ERROR_CRM_PROTOCOL_ALREADY_EXISTS 0x00001A36 -#define ERROR_TRANSACTION_PROPAGATION_FAILED 0x00001A37 -#define ERROR_CRM_PROTOCOL_NOT_FOUND 0x00001A38 -#define ERROR_TRANSACTION_INVALID_MARSHALL_BUFFER 0x00001A39 -#define ERROR_CURRENT_TRANSACTION_NOT_VALID 0x00001A3A -#define ERROR_TRANSACTION_NOT_FOUND 0x00001A3B -#define ERROR_RESOURCEMANAGER_NOT_FOUND 0x00001A3C -#define ERROR_ENLISTMENT_NOT_FOUND 0x00001A3D -#define ERROR_TRANSACTIONMANAGER_NOT_FOUND 0x00001A3E -#define ERROR_TRANSACTIONMANAGER_NOT_ONLINE 0x00001A3F -#define ERROR_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION 0x00001A40 -#define ERROR_TRANSACTION_NOT_ROOT 0x00001A41 -#define ERROR_TRANSACTION_OBJECT_EXPIRED 0x00001A42 -#define ERROR_TRANSACTION_RESPONSE_NOT_ENLISTED 0x00001A43 -#define ERROR_TRANSACTION_RECORD_TOO_LONG 0x00001A44 -#define ERROR_IMPLICIT_TRANSACTION_NOT_SUPPORTED 0x00001A45 -#define ERROR_TRANSACTION_INTEGRITY_VIOLATED 0x00001A46 -#define ERROR_TRANSACTIONMANAGER_IDENTITY_MISMATCH 0x00001A47 -#define ERROR_RM_CANNOT_BE_FROZEN_FOR_SNAPSHOT 0x00001A48 -#define ERROR_TRANSACTION_MUST_WRITETHROUGH 0x00001A49 -#define ERROR_TRANSACTION_NO_SUPERIOR 0x00001A4A -#define ERROR_HEURISTIC_DAMAGE_POSSIBLE 0x00001A4B -#define ERROR_TRANSACTIONAL_CONFLICT 0x00001A90 -#define ERROR_RM_NOT_ACTIVE 0x00001A91 -#define ERROR_RM_METADATA_CORRUPT 0x00001A92 -#define ERROR_DIRECTORY_NOT_RM 0x00001A93 -#define ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE 0x00001A95 -#define ERROR_LOG_RESIZE_INVALID_SIZE 0x00001A96 -#define ERROR_OBJECT_NO_LONGER_EXISTS 0x00001A97 -#define ERROR_STREAM_MINIVERSION_NOT_FOUND 0x00001A98 -#define ERROR_STREAM_MINIVERSION_NOT_VALID 0x00001A99 -#define ERROR_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION 0x00001A9A -#define ERROR_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT 0x00001A9B -#define ERROR_CANT_CREATE_MORE_STREAM_MINIVERSIONS 0x00001A9C -#define ERROR_REMOTE_FILE_VERSION_MISMATCH 0x00001A9E -#define ERROR_HANDLE_NO_LONGER_VALID 0x00001A9F -#define ERROR_NO_TXF_METADATA 0x00001AA0 -#define ERROR_LOG_CORRUPTION_DETECTED 0x00001AA1 -#define ERROR_CANT_RECOVER_WITH_HANDLE_OPEN 0x00001AA2 -#define ERROR_RM_DISCONNECTED 0x00001AA3 -#define ERROR_ENLISTMENT_NOT_SUPERIOR 0x00001AA4 -#define ERROR_RECOVERY_NOT_NEEDED 0x00001AA5 -#define ERROR_RM_ALREADY_STARTED 0x00001AA6 -#define ERROR_FILE_IDENTITY_NOT_PERSISTENT 0x00001AA7 -#define ERROR_CANT_BREAK_TRANSACTIONAL_DEPENDENCY 0x00001AA8 -#define ERROR_CANT_CROSS_RM_BOUNDARY 0x00001AA9 -#define ERROR_TXF_DIR_NOT_EMPTY 0x00001AAA -#define ERROR_INDOUBT_TRANSACTIONS_EXIST 0x00001AAB -#define ERROR_TM_VOLATILE 0x00001AAC -#define ERROR_ROLLBACK_TIMER_EXPIRED 0x00001AAD -#define ERROR_TXF_ATTRIBUTE_CORRUPT 0x00001AAE -#define ERROR_EFS_NOT_ALLOWED_IN_TRANSACTION 0x00001AAF -#define ERROR_TRANSACTIONAL_OPEN_NOT_ALLOWED 0x00001AB0 -#define ERROR_LOG_GROWTH_FAILED 0x00001AB1 -#define ERROR_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE 0x00001AB2 -#define ERROR_TXF_METADATA_ALREADY_PRESENT 0x00001AB3 -#define ERROR_TRANSACTION_SCOPE_CALLBACKS_NOT_SET 0x00001AB4 -#define ERROR_TRANSACTION_REQUIRED_PROMOTION 0x00001AB5 -#define ERROR_CANNOT_EXECUTE_FILE_IN_TRANSACTION 0x00001AB6 -#define ERROR_TRANSACTIONS_NOT_FROZEN 0x00001AB7 -#define ERROR_TRANSACTION_FREEZE_IN_PROGRESS 0x00001AB8 -#define ERROR_NOT_SNAPSHOT_VOLUME 0x00001AB9 -#define ERROR_NO_SAVEPOINT_WITH_OPEN_FILES 0x00001ABA -#define ERROR_DATA_LOST_REPAIR 0x00001ABB -#define ERROR_SPARSE_NOT_ALLOWED_IN_TRANSACTION 0x00001ABC -#define ERROR_TM_IDENTITY_MISMATCH 0x00001ABD -#define ERROR_FLOATED_SECTION 0x00001ABE -#define ERROR_CANNOT_ACCEPT_TRANSACTED_WORK 0x00001ABF -#define ERROR_CANNOT_ABORT_TRANSACTIONS 0x00001AC0 -#define ERROR_BAD_CLUSTERS 0x00001AC1 -#define ERROR_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION 0x00001AC2 -#define ERROR_VOLUME_DIRTY 0x00001AC3 -#define ERROR_NO_LINK_TRACKING_IN_TRANSACTION 0x00001AC4 -#define ERROR_OPERATION_NOT_SUPPORTED_IN_TRANSACTION 0x00001AC5 -#define ERROR_EXPIRED_HANDLE 0x00001AC6 -#define ERROR_TRANSACTION_NOT_ENLISTED 0x00001AC7 -#define ERROR_CTX_WINSTATION_NAME_INVALID 0x00001B59 -#define ERROR_CTX_INVALID_PD 0x00001B5A -#define ERROR_CTX_PD_NOT_FOUND 0x00001B5B -#define ERROR_CTX_WD_NOT_FOUND 0x00001B5C -#define ERROR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY 0x00001B5D -#define ERROR_CTX_SERVICE_NAME_COLLISION 0x00001B5E -#define ERROR_CTX_CLOSE_PENDING 0x00001B5F -#define ERROR_CTX_NO_OUTBUF 0x00001B60 -#define ERROR_CTX_MODEM_INF_NOT_FOUND 0x00001B61 -#define ERROR_CTX_INVALID_MODEMNAME 0x00001B62 -#define ERROR_CTX_MODEM_RESPONSE_ERROR 0x00001B63 -#define ERROR_CTX_MODEM_RESPONSE_TIMEOUT 0x00001B64 -#define ERROR_CTX_MODEM_RESPONSE_NO_CARRIER 0x00001B65 -#define ERROR_CTX_MODEM_RESPONSE_NO_DIALTONE 0x00001B66 -#define ERROR_CTX_MODEM_RESPONSE_BUSY 0x00001B67 -#define ERROR_CTX_MODEM_RESPONSE_VOICE 0x00001B68 -#define ERROR_CTX_TD_ERROR 0x00001B69 -#define ERROR_CTX_WINSTATION_NOT_FOUND 0x00001B6E -#define ERROR_CTX_WINSTATION_ALREADY_EXISTS 0x00001B6F -#define ERROR_CTX_WINSTATION_BUSY 0x00001B70 -#define ERROR_CTX_BAD_VIDEO_MODE 0x00001B71 -#define ERROR_CTX_GRAPHICS_INVALID 0x00001B7B -#define ERROR_CTX_LOGON_DISABLED 0x00001B7D -#define ERROR_CTX_NOT_CONSOLE 0x00001B7E -#define ERROR_CTX_CLIENT_QUERY_TIMEOUT 0x00001B80 -#define ERROR_CTX_CONSOLE_DISCONNECT 0x00001B81 -#define ERROR_CTX_CONSOLE_CONNECT 0x00001B82 -#define ERROR_CTX_SHADOW_DENIED 0x00001B84 -#define ERROR_CTX_WINSTATION_ACCESS_DENIED 0x00001B85 -#define ERROR_CTX_INVALID_WD 0x00001B89 -#define ERROR_CTX_SHADOW_INVALID 0x00001B8A -#define ERROR_CTX_SHADOW_DISABLED 0x00001B8B -#define ERROR_CTX_CLIENT_LICENSE_IN_USE 0x00001B8C -#define ERROR_CTX_CLIENT_LICENSE_NOT_SET 0x00001B8D -#define ERROR_CTX_LICENSE_NOT_AVAILABLE 0x00001B8E -#define ERROR_CTX_LICENSE_CLIENT_INVALID 0x00001B8F -#define ERROR_CTX_LICENSE_EXPIRED 0x00001B90 -#define ERROR_CTX_SHADOW_NOT_RUNNING 0x00001B91 -#define ERROR_CTX_SHADOW_ENDED_BY_MODE_CHANGE 0x00001B92 -#define ERROR_ACTIVATION_COUNT_EXCEEDED 0x00001B93 -#define ERROR_CTX_WINSTATIONS_DISABLED 0x00001B94 -#define ERROR_CTX_ENCRYPTION_LEVEL_REQUIRED 0x00001B95 -#define ERROR_CTX_SESSION_IN_USE 0x00001B96 -#define ERROR_CTX_NO_FORCE_LOGOFF 0x00001B97 -#define ERROR_CTX_ACCOUNT_RESTRICTION 0x00001B98 -#define ERROR_RDP_PROTOCOL_ERROR 0x00001B99 -#define ERROR_CTX_CDM_CONNECT 0x00001B9A -#define ERROR_CTX_CDM_DISCONNECT 0x00001B9B -#define ERROR_CTX_SECURITY_LAYER_ERROR 0x00001B9C -#define ERROR_TS_INCOMPATIBLE_SESSIONS 0x00001B9D -#define ERROR_TS_VIDEO_SUBSYSTEM_ERROR 0x00001B9E -#define FRS_ERR_INVALID_API_SEQUENCE 0x00001F41 -#define FRS_ERR_STARTING_SERVICE 0x00001F42 -#define FRS_ERR_STOPPING_SERVICE 0x00001F43 -#define FRS_ERR_INTERNAL_API 0x00001F44 -#define FRS_ERR_INTERNAL 0x00001F45 -#define FRS_ERR_SERVICE_COMM 0x00001F46 -#define FRS_ERR_INSUFFICIENT_PRIV 0x00001F47 -#define FRS_ERR_AUTHENTICATION 0x00001F48 -#define FRS_ERR_PARENT_INSUFFICIENT_PRIV 0x00001F49 -#define FRS_ERR_PARENT_AUTHENTICATION 0x00001F4A -#define FRS_ERR_CHILD_TO_PARENT_COMM 0x00001F4B -#define FRS_ERR_PARENT_TO_CHILD_COMM 0x00001F4C -#define FRS_ERR_SYSVOL_POPULATE 0x00001F4D -#define FRS_ERR_SYSVOL_POPULATE_TIMEOUT 0x00001F4E -#define FRS_ERR_SYSVOL_IS_BUSY 0x00001F4F -#define FRS_ERR_SYSVOL_DEMOTE 0x00001F50 -#define FRS_ERR_INVALID_SERVICE_PARAMETER 0x00001F51 +#define ERROR_ENCRYPTION_FAILED 0x00001770 +#define ERROR_DECRYPTION_FAILED 0x00001771 +#define ERROR_FILE_ENCRYPTED 0x00001772 +#define ERROR_NO_RECOVERY_POLICY 0x00001773 +#define ERROR_NO_EFS 0x00001774 +#define ERROR_WRONG_EFS 0x00001775 +#define ERROR_NO_USER_KEYS 0x00001776 +#define ERROR_FILE_NOT_ENCRYPTED 0x00001777 +#define ERROR_NOT_EXPORT_FORMAT 0x00001778 +#define ERROR_FILE_READ_ONLY 0x00001779 +#define ERROR_DIR_EFS_DISALLOWED 0x0000177A +#define ERROR_EFS_SERVER_NOT_TRUSTED 0x0000177B +#define ERROR_BAD_RECOVERY_POLICY 0x0000177C +#define ERROR_EFS_ALG_BLOB_TOO_BIG 0x0000177D +#define ERROR_VOLUME_NOT_SUPPORT_EFS 0x0000177E +#define ERROR_EFS_DISABLED 0x0000177F +#define ERROR_EFS_VERSION_NOT_SUPPORT 0x00001780 +#define ERROR_CS_ENCRYPTION_INVALID_SERVER_RESPONSE 0x00001781 +#define ERROR_CS_ENCRYPTION_UNSUPPORTED_SERVER 0x00001782 +#define ERROR_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE 0x00001783 +#define ERROR_CS_ENCRYPTION_NEW_ENCRYPTED_FILE 0x00001784 +#define ERROR_CS_ENCRYPTION_FILE_NOT_CSE 0x00001785 +#define ERROR_ENCRYPTION_POLICY_DENIES_OPERATION 0x00001786 +#define ERROR_NO_BROWSER_SERVERS_FOUND 0x000017E6 +#define SCHED_E_SERVICE_NOT_LOCALSYSTEM 0x00001838 +#define ERROR_LOG_SECTOR_INVALID 0x000019C8 +#define ERROR_LOG_SECTOR_PARITY_INVALID 0x000019C9 +#define ERROR_LOG_SECTOR_REMAPPED 0x000019CA +#define ERROR_LOG_BLOCK_INCOMPLETE 0x000019CB +#define ERROR_LOG_INVALID_RANGE 0x000019CC +#define ERROR_LOG_BLOCKS_EXHAUSTED 0x000019CD +#define ERROR_LOG_READ_CONTEXT_INVALID 0x000019CE +#define ERROR_LOG_RESTART_INVALID 0x000019CF +#define ERROR_LOG_BLOCK_VERSION 0x000019D0 +#define ERROR_LOG_BLOCK_INVALID 0x000019D1 +#define ERROR_LOG_READ_MODE_INVALID 0x000019D2 +#define ERROR_LOG_NO_RESTART 0x000019D3 +#define ERROR_LOG_METADATA_CORRUPT 0x000019D4 +#define ERROR_LOG_METADATA_INVALID 0x000019D5 +#define ERROR_LOG_METADATA_INCONSISTENT 0x000019D6 +#define ERROR_LOG_RESERVATION_INVALID 0x000019D7 +#define ERROR_LOG_CANT_DELETE 0x000019D8 +#define ERROR_LOG_CONTAINER_LIMIT_EXCEEDED 0x000019D9 +#define ERROR_LOG_START_OF_LOG 0x000019DA +#define ERROR_LOG_POLICY_ALREADY_INSTALLED 0x000019DB +#define ERROR_LOG_POLICY_NOT_INSTALLED 0x000019DC +#define ERROR_LOG_POLICY_INVALID 0x000019DD +#define ERROR_LOG_POLICY_CONFLICT 0x000019DE +#define ERROR_LOG_PINNED_ARCHIVE_TAIL 0x000019DF +#define ERROR_LOG_RECORD_NONEXISTENT 0x000019E0 +#define ERROR_LOG_RECORDS_RESERVED_INVALID 0x000019E1 +#define ERROR_LOG_SPACE_RESERVED_INVALID 0x000019E2 +#define ERROR_LOG_TAIL_INVALID 0x000019E3 +#define ERROR_LOG_FULL 0x000019E4 +#define ERROR_COULD_NOT_RESIZE_LOG 0x000019E5 +#define ERROR_LOG_MULTIPLEXED 0x000019E6 +#define ERROR_LOG_DEDICATED 0x000019E7 +#define ERROR_LOG_ARCHIVE_NOT_IN_PROGRESS 0x000019E8 +#define ERROR_LOG_ARCHIVE_IN_PROGRESS 0x000019E9 +#define ERROR_LOG_EPHEMERAL 0x000019EA +#define ERROR_LOG_NOT_ENOUGH_CONTAINERS 0x000019EB +#define ERROR_LOG_CLIENT_ALREADY_REGISTERED 0x000019EC +#define ERROR_LOG_CLIENT_NOT_REGISTERED 0x000019ED +#define ERROR_LOG_FULL_HANDLER_IN_PROGRESS 0x000019EE +#define ERROR_LOG_CONTAINER_READ_FAILED 0x000019EF +#define ERROR_LOG_CONTAINER_WRITE_FAILED 0x000019F0 +#define ERROR_LOG_CONTAINER_OPEN_FAILED 0x000019F1 +#define ERROR_LOG_CONTAINER_STATE_INVALID 0x000019F2 +#define ERROR_LOG_STATE_INVALID 0x000019F3 +#define ERROR_LOG_PINNED 0x000019F4 +#define ERROR_LOG_METADATA_FLUSH_FAILED 0x000019F5 +#define ERROR_LOG_INCONSISTENT_SECURITY 0x000019F6 +#define ERROR_LOG_APPENDED_FLUSH_FAILED 0x000019F7 +#define ERROR_LOG_PINNED_RESERVATION 0x000019F8 +#define ERROR_INVALID_TRANSACTION 0x00001A2C +#define ERROR_TRANSACTION_NOT_ACTIVE 0x00001A2D +#define ERROR_TRANSACTION_REQUEST_NOT_VALID 0x00001A2E +#define ERROR_TRANSACTION_NOT_REQUESTED 0x00001A2F +#define ERROR_TRANSACTION_ALREADY_ABORTED 0x00001A30 +#define ERROR_TRANSACTION_ALREADY_COMMITTED 0x00001A31 +#define ERROR_TM_INITIALIZATION_FAILED 0x00001A32 +#define ERROR_RESOURCEMANAGER_READ_ONLY 0x00001A33 +#define ERROR_TRANSACTION_NOT_JOINED 0x00001A34 +#define ERROR_TRANSACTION_SUPERIOR_EXISTS 0x00001A35 +#define ERROR_CRM_PROTOCOL_ALREADY_EXISTS 0x00001A36 +#define ERROR_TRANSACTION_PROPAGATION_FAILED 0x00001A37 +#define ERROR_CRM_PROTOCOL_NOT_FOUND 0x00001A38 +#define ERROR_TRANSACTION_INVALID_MARSHALL_BUFFER 0x00001A39 +#define ERROR_CURRENT_TRANSACTION_NOT_VALID 0x00001A3A +#define ERROR_TRANSACTION_NOT_FOUND 0x00001A3B +#define ERROR_RESOURCEMANAGER_NOT_FOUND 0x00001A3C +#define ERROR_ENLISTMENT_NOT_FOUND 0x00001A3D +#define ERROR_TRANSACTIONMANAGER_NOT_FOUND 0x00001A3E +#define ERROR_TRANSACTIONMANAGER_NOT_ONLINE 0x00001A3F +#define ERROR_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION 0x00001A40 +#define ERROR_TRANSACTION_NOT_ROOT 0x00001A41 +#define ERROR_TRANSACTION_OBJECT_EXPIRED 0x00001A42 +#define ERROR_TRANSACTION_RESPONSE_NOT_ENLISTED 0x00001A43 +#define ERROR_TRANSACTION_RECORD_TOO_LONG 0x00001A44 +#define ERROR_IMPLICIT_TRANSACTION_NOT_SUPPORTED 0x00001A45 +#define ERROR_TRANSACTION_INTEGRITY_VIOLATED 0x00001A46 +#define ERROR_TRANSACTIONMANAGER_IDENTITY_MISMATCH 0x00001A47 +#define ERROR_RM_CANNOT_BE_FROZEN_FOR_SNAPSHOT 0x00001A48 +#define ERROR_TRANSACTION_MUST_WRITETHROUGH 0x00001A49 +#define ERROR_TRANSACTION_NO_SUPERIOR 0x00001A4A +#define ERROR_HEURISTIC_DAMAGE_POSSIBLE 0x00001A4B +#define ERROR_TRANSACTIONAL_CONFLICT 0x00001A90 +#define ERROR_RM_NOT_ACTIVE 0x00001A91 +#define ERROR_RM_METADATA_CORRUPT 0x00001A92 +#define ERROR_DIRECTORY_NOT_RM 0x00001A93 +#define ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE 0x00001A95 +#define ERROR_LOG_RESIZE_INVALID_SIZE 0x00001A96 +#define ERROR_OBJECT_NO_LONGER_EXISTS 0x00001A97 +#define ERROR_STREAM_MINIVERSION_NOT_FOUND 0x00001A98 +#define ERROR_STREAM_MINIVERSION_NOT_VALID 0x00001A99 +#define ERROR_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION 0x00001A9A +#define ERROR_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT 0x00001A9B +#define ERROR_CANT_CREATE_MORE_STREAM_MINIVERSIONS 0x00001A9C +#define ERROR_REMOTE_FILE_VERSION_MISMATCH 0x00001A9E +#define ERROR_HANDLE_NO_LONGER_VALID 0x00001A9F +#define ERROR_NO_TXF_METADATA 0x00001AA0 +#define ERROR_LOG_CORRUPTION_DETECTED 0x00001AA1 +#define ERROR_CANT_RECOVER_WITH_HANDLE_OPEN 0x00001AA2 +#define ERROR_RM_DISCONNECTED 0x00001AA3 +#define ERROR_ENLISTMENT_NOT_SUPERIOR 0x00001AA4 +#define ERROR_RECOVERY_NOT_NEEDED 0x00001AA5 +#define ERROR_RM_ALREADY_STARTED 0x00001AA6 +#define ERROR_FILE_IDENTITY_NOT_PERSISTENT 0x00001AA7 +#define ERROR_CANT_BREAK_TRANSACTIONAL_DEPENDENCY 0x00001AA8 +#define ERROR_CANT_CROSS_RM_BOUNDARY 0x00001AA9 +#define ERROR_TXF_DIR_NOT_EMPTY 0x00001AAA +#define ERROR_INDOUBT_TRANSACTIONS_EXIST 0x00001AAB +#define ERROR_TM_VOLATILE 0x00001AAC +#define ERROR_ROLLBACK_TIMER_EXPIRED 0x00001AAD +#define ERROR_TXF_ATTRIBUTE_CORRUPT 0x00001AAE +#define ERROR_EFS_NOT_ALLOWED_IN_TRANSACTION 0x00001AAF +#define ERROR_TRANSACTIONAL_OPEN_NOT_ALLOWED 0x00001AB0 +#define ERROR_LOG_GROWTH_FAILED 0x00001AB1 +#define ERROR_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE 0x00001AB2 +#define ERROR_TXF_METADATA_ALREADY_PRESENT 0x00001AB3 +#define ERROR_TRANSACTION_SCOPE_CALLBACKS_NOT_SET 0x00001AB4 +#define ERROR_TRANSACTION_REQUIRED_PROMOTION 0x00001AB5 +#define ERROR_CANNOT_EXECUTE_FILE_IN_TRANSACTION 0x00001AB6 +#define ERROR_TRANSACTIONS_NOT_FROZEN 0x00001AB7 +#define ERROR_TRANSACTION_FREEZE_IN_PROGRESS 0x00001AB8 +#define ERROR_NOT_SNAPSHOT_VOLUME 0x00001AB9 +#define ERROR_NO_SAVEPOINT_WITH_OPEN_FILES 0x00001ABA +#define ERROR_DATA_LOST_REPAIR 0x00001ABB +#define ERROR_SPARSE_NOT_ALLOWED_IN_TRANSACTION 0x00001ABC +#define ERROR_TM_IDENTITY_MISMATCH 0x00001ABD +#define ERROR_FLOATED_SECTION 0x00001ABE +#define ERROR_CANNOT_ACCEPT_TRANSACTED_WORK 0x00001ABF +#define ERROR_CANNOT_ABORT_TRANSACTIONS 0x00001AC0 +#define ERROR_BAD_CLUSTERS 0x00001AC1 +#define ERROR_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION 0x00001AC2 +#define ERROR_VOLUME_DIRTY 0x00001AC3 +#define ERROR_NO_LINK_TRACKING_IN_TRANSACTION 0x00001AC4 +#define ERROR_OPERATION_NOT_SUPPORTED_IN_TRANSACTION 0x00001AC5 +#define ERROR_EXPIRED_HANDLE 0x00001AC6 +#define ERROR_TRANSACTION_NOT_ENLISTED 0x00001AC7 +#define ERROR_CTX_WINSTATION_NAME_INVALID 0x00001B59 +#define ERROR_CTX_INVALID_PD 0x00001B5A +#define ERROR_CTX_PD_NOT_FOUND 0x00001B5B +#define ERROR_CTX_WD_NOT_FOUND 0x00001B5C +#define ERROR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY 0x00001B5D +#define ERROR_CTX_SERVICE_NAME_COLLISION 0x00001B5E +#define ERROR_CTX_CLOSE_PENDING 0x00001B5F +#define ERROR_CTX_NO_OUTBUF 0x00001B60 +#define ERROR_CTX_MODEM_INF_NOT_FOUND 0x00001B61 +#define ERROR_CTX_INVALID_MODEMNAME 0x00001B62 +#define ERROR_CTX_MODEM_RESPONSE_ERROR 0x00001B63 +#define ERROR_CTX_MODEM_RESPONSE_TIMEOUT 0x00001B64 +#define ERROR_CTX_MODEM_RESPONSE_NO_CARRIER 0x00001B65 +#define ERROR_CTX_MODEM_RESPONSE_NO_DIALTONE 0x00001B66 +#define ERROR_CTX_MODEM_RESPONSE_BUSY 0x00001B67 +#define ERROR_CTX_MODEM_RESPONSE_VOICE 0x00001B68 +#define ERROR_CTX_TD_ERROR 0x00001B69 +#define ERROR_CTX_WINSTATION_NOT_FOUND 0x00001B6E +#define ERROR_CTX_WINSTATION_ALREADY_EXISTS 0x00001B6F +#define ERROR_CTX_WINSTATION_BUSY 0x00001B70 +#define ERROR_CTX_BAD_VIDEO_MODE 0x00001B71 +#define ERROR_CTX_GRAPHICS_INVALID 0x00001B7B +#define ERROR_CTX_LOGON_DISABLED 0x00001B7D +#define ERROR_CTX_NOT_CONSOLE 0x00001B7E +#define ERROR_CTX_CLIENT_QUERY_TIMEOUT 0x00001B80 +#define ERROR_CTX_CONSOLE_DISCONNECT 0x00001B81 +#define ERROR_CTX_CONSOLE_CONNECT 0x00001B82 +#define ERROR_CTX_SHADOW_DENIED 0x00001B84 +#define ERROR_CTX_WINSTATION_ACCESS_DENIED 0x00001B85 +#define ERROR_CTX_INVALID_WD 0x00001B89 +#define ERROR_CTX_SHADOW_INVALID 0x00001B8A +#define ERROR_CTX_SHADOW_DISABLED 0x00001B8B +#define ERROR_CTX_CLIENT_LICENSE_IN_USE 0x00001B8C +#define ERROR_CTX_CLIENT_LICENSE_NOT_SET 0x00001B8D +#define ERROR_CTX_LICENSE_NOT_AVAILABLE 0x00001B8E +#define ERROR_CTX_LICENSE_CLIENT_INVALID 0x00001B8F +#define ERROR_CTX_LICENSE_EXPIRED 0x00001B90 +#define ERROR_CTX_SHADOW_NOT_RUNNING 0x00001B91 +#define ERROR_CTX_SHADOW_ENDED_BY_MODE_CHANGE 0x00001B92 +#define ERROR_ACTIVATION_COUNT_EXCEEDED 0x00001B93 +#define ERROR_CTX_WINSTATIONS_DISABLED 0x00001B94 +#define ERROR_CTX_ENCRYPTION_LEVEL_REQUIRED 0x00001B95 +#define ERROR_CTX_SESSION_IN_USE 0x00001B96 +#define ERROR_CTX_NO_FORCE_LOGOFF 0x00001B97 +#define ERROR_CTX_ACCOUNT_RESTRICTION 0x00001B98 +#define ERROR_RDP_PROTOCOL_ERROR 0x00001B99 +#define ERROR_CTX_CDM_CONNECT 0x00001B9A +#define ERROR_CTX_CDM_DISCONNECT 0x00001B9B +#define ERROR_CTX_SECURITY_LAYER_ERROR 0x00001B9C +#define ERROR_TS_INCOMPATIBLE_SESSIONS 0x00001B9D +#define ERROR_TS_VIDEO_SUBSYSTEM_ERROR 0x00001B9E +#define FRS_ERR_INVALID_API_SEQUENCE 0x00001F41 +#define FRS_ERR_STARTING_SERVICE 0x00001F42 +#define FRS_ERR_STOPPING_SERVICE 0x00001F43 +#define FRS_ERR_INTERNAL_API 0x00001F44 +#define FRS_ERR_INTERNAL 0x00001F45 +#define FRS_ERR_SERVICE_COMM 0x00001F46 +#define FRS_ERR_INSUFFICIENT_PRIV 0x00001F47 +#define FRS_ERR_AUTHENTICATION 0x00001F48 +#define FRS_ERR_PARENT_INSUFFICIENT_PRIV 0x00001F49 +#define FRS_ERR_PARENT_AUTHENTICATION 0x00001F4A +#define FRS_ERR_CHILD_TO_PARENT_COMM 0x00001F4B +#define FRS_ERR_PARENT_TO_CHILD_COMM 0x00001F4C +#define FRS_ERR_SYSVOL_POPULATE 0x00001F4D +#define FRS_ERR_SYSVOL_POPULATE_TIMEOUT 0x00001F4E +#define FRS_ERR_SYSVOL_IS_BUSY 0x00001F4F +#define FRS_ERR_SYSVOL_DEMOTE 0x00001F50 +#define FRS_ERR_INVALID_SERVICE_PARAMETER 0x00001F51 /* System Error Codes (8200-8999) */ -#define ERROR_DS_NOT_INSTALLED 0x00002008 -#define ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY 0x00002009 -#define ERROR_DS_NO_ATTRIBUTE_OR_VALUE 0x0000200A -#define ERROR_DS_INVALID_ATTRIBUTE_SYNTAX 0x0000200B -#define ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED 0x0000200C -#define ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS 0x0000200D -#define ERROR_DS_BUSY 0x0000200E -#define ERROR_DS_UNAVAILABLE 0x0000200F -#define ERROR_DS_NO_RIDS_ALLOCATED 0x00002010 -#define ERROR_DS_NO_MORE_RIDS 0x00002011 -#define ERROR_DS_INCORRECT_ROLE_OWNER 0x00002012 -#define ERROR_DS_RIDMGR_INIT_ERROR 0x00002013 -#define ERROR_DS_OBJ_CLASS_VIOLATION 0x00002014 -#define ERROR_DS_CANT_ON_NON_LEAF 0x00002015 -#define ERROR_DS_CANT_ON_RDN 0x00002016 -#define ERROR_DS_CANT_MOD_OBJ_CLASS 0x00002017 -#define ERROR_DS_CROSS_DOM_MOVE_ERROR 0x00002018 -#define ERROR_DS_GC_NOT_AVAILABLE 0x00002019 -#define ERROR_SHARED_POLICY 0x0000201A -#define ERROR_POLICY_OBJECT_NOT_FOUND 0x0000201B -#define ERROR_POLICY_ONLY_IN_DS 0x0000201C -#define ERROR_PROMOTION_ACTIVE 0x0000201D -#define ERROR_NO_PROMOTION_ACTIVE 0x0000201E -#define ERROR_DS_OPERATIONS_ERROR 0x00002020 -#define ERROR_DS_PROTOCOL_ERROR 0x00002021 -#define ERROR_DS_TIMELIMIT_EXCEEDED 0x00002022 -#define ERROR_DS_SIZELIMIT_EXCEEDED 0x00002023 -#define ERROR_DS_ADMIN_LIMIT_EXCEEDED 0x00002024 -#define ERROR_DS_COMPARE_FALSE 0x00002025 -#define ERROR_DS_COMPARE_TRUE 0x00002026 -#define ERROR_DS_AUTH_METHOD_NOT_SUPPORTED 0x00002027 -#define ERROR_DS_STRONG_AUTH_REQUIRED 0x00002028 -#define ERROR_DS_INAPPROPRIATE_AUTH 0x00002029 -#define ERROR_DS_AUTH_UNKNOWN 0x0000202A -#define ERROR_DS_REFERRAL 0x0000202B -#define ERROR_DS_UNAVAILABLE_CRIT_EXTENSION 0x0000202C -#define ERROR_DS_CONFIDENTIALITY_REQUIRED 0x0000202D -#define ERROR_DS_INAPPROPRIATE_MATCHING 0x0000202E -#define ERROR_DS_CONSTRAINT_VIOLATION 0x0000202F -#define ERROR_DS_NO_SUCH_OBJECT 0x00002030 -#define ERROR_DS_ALIAS_PROBLEM 0x00002031 -#define ERROR_DS_INVALID_DN_SYNTAX 0x00002032 -#define ERROR_DS_IS_LEAF 0x00002033 -#define ERROR_DS_ALIAS_DEREF_PROBLEM 0x00002034 -#define ERROR_DS_UNWILLING_TO_PERFORM 0x00002035 -#define ERROR_DS_LOOP_DETECT 0x00002036 -#define ERROR_DS_NAMING_VIOLATION 0x00002037 -#define ERROR_DS_OBJECT_RESULTS_TOO_LARGE 0x00002038 -#define ERROR_DS_AFFECTS_MULTIPLE_DSAS 0x00002039 -#define ERROR_DS_SERVER_DOWN 0x0000203A -#define ERROR_DS_LOCAL_ERROR 0x0000203B -#define ERROR_DS_ENCODING_ERROR 0x0000203C -#define ERROR_DS_DECODING_ERROR 0x0000203D -#define ERROR_DS_FILTER_UNKNOWN 0x0000203E -#define ERROR_DS_PARAM_ERROR 0x0000203F -#define ERROR_DS_NOT_SUPPORTED 0x00002040 -#define ERROR_DS_NO_RESULTS_RETURNED 0x00002041 -#define ERROR_DS_CONTROL_NOT_FOUND 0x00002042 -#define ERROR_DS_CLIENT_LOOP 0x00002043 -#define ERROR_DS_REFERRAL_LIMIT_EXCEEDED 0x00002044 -#define ERROR_DS_SORT_CONTROL_MISSING 0x00002045 -#define ERROR_DS_OFFSET_RANGE_ERROR 0x00002046 -#define ERROR_DS_RIDMGR_DISABLED 0x00002047 -#define ERROR_DS_ROOT_MUST_BE_NC 0x0000206D -#define ERROR_DS_ADD_REPLICA_INHIBITED 0x0000206E -#define ERROR_DS_ATT_NOT_DEF_IN_SCHEMA 0x0000206F -#define ERROR_DS_MAX_OBJ_SIZE_EXCEEDED 0x00002070 -#define ERROR_DS_OBJ_STRING_NAME_EXISTS 0x00002071 -#define ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA 0x00002072 -#define ERROR_DS_RDN_DOESNT_MATCH_SCHEMA 0x00002073 -#define ERROR_DS_NO_REQUESTED_ATTS_FOUND 0x00002074 -#define ERROR_DS_USER_BUFFER_TO_SMALL 0x00002075 -#define ERROR_DS_ATT_IS_NOT_ON_OBJ 0x00002076 -#define ERROR_DS_ILLEGAL_MOD_OPERATION 0x00002077 -#define ERROR_DS_OBJ_TOO_LARGE 0x00002078 -#define ERROR_DS_BAD_INSTANCE_TYPE 0x00002079 -#define ERROR_DS_MASTERDSA_REQUIRED 0x0000207A -#define ERROR_DS_OBJECT_CLASS_REQUIRED 0x0000207B -#define ERROR_DS_MISSING_REQUIRED_ATT 0x0000207C -#define ERROR_DS_ATT_NOT_DEF_FOR_CLASS 0x0000207D -#define ERROR_DS_ATT_ALREADY_EXISTS 0x0000207E -#define ERROR_DS_CANT_ADD_ATT_VALUES 0x00002080 -#define ERROR_DS_SINGLE_VALUE_CONSTRAINT 0x00002081 -#define ERROR_DS_RANGE_CONSTRAINT 0x00002082 -#define ERROR_DS_ATT_VAL_ALREADY_EXISTS 0x00002083 -#define ERROR_DS_CANT_REM_MISSING_ATT 0x00002084 -#define ERROR_DS_CANT_REM_MISSING_ATT_VAL 0x00002085 -#define ERROR_DS_ROOT_CANT_BE_SUBREF 0x00002086 -#define ERROR_DS_NO_CHAINING 0x00002087 -#define ERROR_DS_NO_CHAINED_EVAL 0x00002088 -#define ERROR_DS_NO_PARENT_OBJECT 0x00002089 -#define ERROR_DS_PARENT_IS_AN_ALIAS 0x0000208A -#define ERROR_DS_CANT_MIX_MASTER_AND_REPS 0x0000208B -#define ERROR_DS_CHILDREN_EXIST 0x0000208C -#define ERROR_DS_OBJ_NOT_FOUND 0x0000208D -#define ERROR_DS_ALIASED_OBJ_MISSING 0x0000208E -#define ERROR_DS_BAD_NAME_SYNTAX 0x0000208F -#define ERROR_DS_ALIAS_POINTS_TO_ALIAS 0x00002090 -#define ERROR_DS_CANT_DEREF_ALIAS 0x00002091 -#define ERROR_DS_OUT_OF_SCOPE 0x00002092 -#define ERROR_DS_OBJECT_BEING_REMOVED 0x00002093 -#define ERROR_DS_CANT_DELETE_DSA_OBJ 0x00002094 -#define ERROR_DS_GENERIC_ERROR 0x00002095 -#define ERROR_DS_DSA_MUST_BE_INT_MASTER 0x00002096 -#define ERROR_DS_CLASS_NOT_DSA 0x00002097 -#define ERROR_DS_INSUFF_ACCESS_RIGHTS 0x00002098 -#define ERROR_DS_ILLEGAL_SUPERIOR 0x00002099 -#define ERROR_DS_ATTRIBUTE_OWNED_BY_SAM 0x0000209A -#define ERROR_DS_NAME_TOO_MANY_PARTS 0x0000209B -#define ERROR_DS_NAME_TOO_LONG 0x0000209C -#define ERROR_DS_NAME_VALUE_TOO_LONG 0x0000209D -#define ERROR_DS_NAME_UNPARSEABLE 0x0000209E -#define ERROR_DS_NAME_TYPE_UNKNOWN 0x0000209F -#define ERROR_DS_NOT_AN_OBJECT 0x000020A0 -#define ERROR_DS_SEC_DESC_TOO_SHORT 0x000020A1 -#define ERROR_DS_SEC_DESC_INVALID 0x000020A2 -#define ERROR_DS_NO_DELETED_NAME 0x000020A3 -#define ERROR_DS_SUBREF_MUST_HAVE_PARENT 0x000020A4 -#define ERROR_DS_NCNAME_MUST_BE_NC 0x000020A5 -#define ERROR_DS_CANT_ADD_SYSTEM_ONLY 0x000020A6 -#define ERROR_DS_CLASS_MUST_BE_CONCRETE 0x000020A7 -#define ERROR_DS_INVALID_DMD 0x000020A8 -#define ERROR_DS_OBJ_GUID_EXISTS 0x000020A9 -#define ERROR_DS_NOT_ON_BACKLINK 0x000020AA -#define ERROR_DS_NO_CROSSREF_FOR_NC 0x000020AB -#define ERROR_DS_SHUTTING_DOWN 0x000020AC -#define ERROR_DS_UNKNOWN_OPERATION 0x000020AD -#define ERROR_DS_INVALID_ROLE_OWNER 0x000020AE -#define ERROR_DS_COULDNT_CONTACT_FSMO 0x000020AF -#define ERROR_DS_CROSS_NC_DN_RENAME 0x000020B0 -#define ERROR_DS_CANT_MOD_SYSTEM_ONLY 0x000020B1 -#define ERROR_DS_REPLICATOR_ONLY 0x000020B2 -#define ERROR_DS_OBJ_CLASS_NOT_DEFINED 0x000020B3 -#define ERROR_DS_OBJ_CLASS_NOT_SUBCLASS 0x000020B4 -#define ERROR_DS_NAME_REFERENCE_INVALID 0x000020B5 -#define ERROR_DS_CROSS_REF_EXISTS 0x000020B6 -#define ERROR_DS_CANT_DEL_MASTER_CROSSREF 0x000020B7 -#define ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD 0x000020B8 -#define ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX 0x000020B9 -#define ERROR_DS_DUP_RDN 0x000020BA -#define ERROR_DS_DUP_OID 0x000020BB -#define ERROR_DS_DUP_MAPI_ID 0x000020BC -#define ERROR_DS_DUP_SCHEMA_ID_GUID 0x000020BD -#define ERROR_DS_DUP_LDAP_DISPLAY_NAME 0x000020BE -#define ERROR_DS_SEMANTIC_ATT_TEST 0x000020BF -#define ERROR_DS_SYNTAX_MISMATCH 0x000020C0 -#define ERROR_DS_EXISTS_IN_MUST_HAVE 0x000020C1 -#define ERROR_DS_EXISTS_IN_MAY_HAVE 0x000020C2 -#define ERROR_DS_NONEXISTENT_MAY_HAVE 0x000020C3 -#define ERROR_DS_NONEXISTENT_MUST_HAVE 0x000020C4 -#define ERROR_DS_AUX_CLS_TEST_FAIL 0x000020C5 -#define ERROR_DS_NONEXISTENT_POSS_SUP 0x000020C6 -#define ERROR_DS_SUB_CLS_TEST_FAIL 0x000020C7 -#define ERROR_DS_BAD_RDN_ATT_ID_SYNTAX 0x000020C8 -#define ERROR_DS_EXISTS_IN_AUX_CLS 0x000020C9 -#define ERROR_DS_EXISTS_IN_SUB_CLS 0x000020CA -#define ERROR_DS_EXISTS_IN_POSS_SUP 0x000020CB -#define ERROR_DS_RECALCSCHEMA_FAILED 0x000020CC -#define ERROR_DS_TREE_DELETE_NOT_FINISHED 0x000020CD -#define ERROR_DS_CANT_DELETE 0x000020CE -#define ERROR_DS_ATT_SCHEMA_REQ_ID 0x000020CF -#define ERROR_DS_BAD_ATT_SCHEMA_SYNTAX 0x000020D0 -#define ERROR_DS_CANT_CACHE_ATT 0x000020D1 -#define ERROR_DS_CANT_CACHE_CLASS 0x000020D2 -#define ERROR_DS_CANT_REMOVE_ATT_CACHE 0x000020D3 -#define ERROR_DS_CANT_REMOVE_CLASS_CACHE 0x000020D4 -#define ERROR_DS_CANT_RETRIEVE_DN 0x000020D5 -#define ERROR_DS_MISSING_SUPREF 0x000020D6 -#define ERROR_DS_CANT_RETRIEVE_INSTANCE 0x000020D7 -#define ERROR_DS_CODE_INCONSISTENCY 0x000020D8 -#define ERROR_DS_DATABASE_ERROR 0x000020D9 -#define ERROR_DS_GOVERNSID_MISSING 0x000020DA -#define ERROR_DS_MISSING_EXPECTED_ATT 0x000020DB -#define ERROR_DS_NCNAME_MISSING_CR_REF 0x000020DC -#define ERROR_DS_SECURITY_CHECKING_ERROR 0x000020DD -#define ERROR_DS_SCHEMA_NOT_LOADED 0x000020DE -#define ERROR_DS_SCHEMA_ALLOC_FAILED 0x000020DF -#define ERROR_DS_ATT_SCHEMA_REQ_SYNTAX 0x000020E0 -#define ERROR_DS_GCVERIFY_ERROR 0x000020E1 -#define ERROR_DS_DRA_SCHEMA_MISMATCH 0x000020E2 -#define ERROR_DS_CANT_FIND_DSA_OBJ 0x000020E3 -#define ERROR_DS_CANT_FIND_EXPECTED_NC 0x000020E4 -#define ERROR_DS_CANT_FIND_NC_IN_CACHE 0x000020E5 -#define ERROR_DS_CANT_RETRIEVE_CHILD 0x000020E6 -#define ERROR_DS_SECURITY_ILLEGAL_MODIFY 0x000020E7 -#define ERROR_DS_CANT_REPLACE_HIDDEN_REC 0x000020E8 -#define ERROR_DS_BAD_HIERARCHY_FILE 0x000020E9 -#define ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED 0x000020EA -#define ERROR_DS_CONFIG_PARAM_MISSING 0x000020EB -#define ERROR_DS_COUNTING_AB_INDICES_FAILED 0x000020EC -#define ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED 0x000020ED -#define ERROR_DS_INTERNAL_FAILURE 0x000020EE -#define ERROR_DS_UNKNOWN_ERROR 0x000020EF -#define ERROR_DS_ROOT_REQUIRES_CLASS_TOP 0x000020F0 -#define ERROR_DS_REFUSING_FSMO_ROLES 0x000020F1 -#define ERROR_DS_MISSING_FSMO_SETTINGS 0x000020F2 -#define ERROR_DS_UNABLE_TO_SURRENDER_ROLES 0x000020F3 -#define ERROR_DS_DRA_GENERIC 0x000020F4 -#define ERROR_DS_DRA_INVALID_PARAMETER 0x000020F5 -#define ERROR_DS_DRA_BUSY 0x000020F6 -#define ERROR_DS_DRA_BAD_DN 0x000020F7 -#define ERROR_DS_DRA_BAD_NC 0x000020F8 -#define ERROR_DS_DRA_DN_EXISTS 0x000020F9 -#define ERROR_DS_DRA_INTERNAL_ERROR 0x000020FA -#define ERROR_DS_DRA_INCONSISTENT_DIT 0x000020FB -#define ERROR_DS_DRA_CONNECTION_FAILED 0x000020FC -#define ERROR_DS_DRA_BAD_INSTANCE_TYPE 0x000020FD -#define ERROR_DS_DRA_OUT_OF_MEM 0x000020FE -#define ERROR_DS_DRA_MAIL_PROBLEM 0x000020FF -#define ERROR_DS_DRA_REF_ALREADY_EXISTS 0x00002100 -#define ERROR_DS_DRA_REF_NOT_FOUND 0x00002101 -#define ERROR_DS_DRA_OBJ_IS_REP_SOURCE 0x00002102 -#define ERROR_DS_DRA_DB_ERROR 0x00002103 -#define ERROR_DS_DRA_NO_REPLICA 0x00002104 -#define ERROR_DS_DRA_ACCESS_DENIED 0x00002105 -#define ERROR_DS_DRA_NOT_SUPPORTED 0x00002106 -#define ERROR_DS_DRA_RPC_CANCELLED 0x00002107 -#define ERROR_DS_DRA_SOURCE_DISABLED 0x00002108 -#define ERROR_DS_DRA_SINK_DISABLED 0x00002109 -#define ERROR_DS_DRA_NAME_COLLISION 0x0000210A -#define ERROR_DS_DRA_SOURCE_REINSTALLED 0x0000210B -#define ERROR_DS_DRA_MISSING_PARENT 0x0000210C -#define ERROR_DS_DRA_PREEMPTED 0x0000210D -#define ERROR_DS_DRA_ABANDON_SYNC 0x0000210E -#define ERROR_DS_DRA_SHUTDOWN 0x0000210F -#define ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET 0x00002110 -#define ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA 0x00002111 -#define ERROR_DS_DRA_EXTN_CONNECTION_FAILED 0x00002112 -#define ERROR_DS_INSTALL_SCHEMA_MISMATCH 0x00002113 -#define ERROR_DS_DUP_LINK_ID 0x00002114 -#define ERROR_DS_NAME_ERROR_RESOLVING 0x00002115 -#define ERROR_DS_NAME_ERROR_NOT_FOUND 0x00002116 -#define ERROR_DS_NAME_ERROR_NOT_UNIQUE 0x00002117 -#define ERROR_DS_NAME_ERROR_NO_MAPPING 0x00002118 -#define ERROR_DS_NAME_ERROR_DOMAIN_ONLY 0x00002119 -#define ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING 0x0000211A -#define ERROR_DS_CONSTRUCTED_ATT_MOD 0x0000211B -#define ERROR_DS_WRONG_OM_OBJ_CLASS 0x0000211C -#define ERROR_DS_DRA_REPL_PENDING 0x0000211D -#define ERROR_DS_DS_REQUIRED 0x0000211E -#define ERROR_DS_INVALID_LDAP_DISPLAY_NAME 0x0000211F -#define ERROR_DS_NON_BASE_SEARCH 0x00002120 -#define ERROR_DS_CANT_RETRIEVE_ATTS 0x00002121 -#define ERROR_DS_BACKLINK_WITHOUT_LINK 0x00002122 -#define ERROR_DS_EPOCH_MISMATCH 0x00002123 -#define ERROR_DS_SRC_NAME_MISMATCH 0x00002124 -#define ERROR_DS_SRC_AND_DST_NC_IDENTICAL 0x00002125 -#define ERROR_DS_DST_NC_MISMATCH 0x00002126 -#define ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC 0x00002127 -#define ERROR_DS_SRC_GUID_MISMATCH 0x00002128 -#define ERROR_DS_CANT_MOVE_DELETED_OBJECT 0x00002129 -#define ERROR_DS_PDC_OPERATION_IN_PROGRESS 0x0000212A -#define ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD 0x0000212B -#define ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION 0x0000212C -#define ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS 0x0000212D -#define ERROR_DS_NC_MUST_HAVE_NC_PARENT 0x0000212E -#define ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE 0x0000212F -#define ERROR_DS_DST_DOMAIN_NOT_NATIVE 0x00002130 -#define ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER 0x00002131 -#define ERROR_DS_CANT_MOVE_ACCOUNT_GROUP 0x00002132 -#define ERROR_DS_CANT_MOVE_RESOURCE_GROUP 0x00002133 -#define ERROR_DS_INVALID_SEARCH_FLAG 0x00002134 -#define ERROR_DS_NO_TREE_DELETE_ABOVE_NC 0x00002135 -#define ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE 0x00002136 -#define ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE 0x00002137 -#define ERROR_DS_SAM_INIT_FAILURE 0x00002138 -#define ERROR_DS_SENSITIVE_GROUP_VIOLATION 0x00002139 -#define ERROR_DS_CANT_MOD_PRIMARYGROUPID 0x0000213A -#define ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD 0x0000213B -#define ERROR_DS_NONSAFE_SCHEMA_CHANGE 0x0000213C -#define ERROR_DS_SCHEMA_UPDATE_DISALLOWED 0x0000213D -#define ERROR_DS_CANT_CREATE_UNDER_SCHEMA 0x0000213E -#define ERROR_DS_INSTALL_NO_SRC_SCH_VERSION 0x0000213F -#define ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE 0x00002140 -#define ERROR_DS_INVALID_GROUP_TYPE 0x00002141 -#define ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN 0x00002142 -#define ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN 0x00002143 -#define ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER 0x00002144 -#define ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER 0x00002145 -#define ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER 0x00002146 -#define ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER 0x00002147 -#define ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER 0x00002148 -#define ERROR_DS_HAVE_PRIMARY_MEMBERS 0x00002149 -#define ERROR_DS_STRING_SD_CONVERSION_FAILED 0x0000214A -#define ERROR_DS_NAMING_MASTER_GC 0x0000214B -#define ERROR_DS_DNS_LOOKUP_FAILURE 0x0000214C -#define ERROR_DS_COULDNT_UPDATE_SPNS 0x0000214D -#define ERROR_DS_CANT_RETRIEVE_SD 0x0000214E -#define ERROR_DS_KEY_NOT_UNIQUE 0x0000214F -#define ERROR_DS_WRONG_LINKED_ATT_SYNTAX 0x00002150 -#define ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD 0x00002151 -#define ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY 0x00002152 -#define ERROR_DS_CANT_START 0x00002153 -#define ERROR_DS_INIT_FAILURE 0x00002154 -#define ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION 0x00002155 -#define ERROR_DS_SOURCE_DOMAIN_IN_FOREST 0x00002156 -#define ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST 0x00002157 -#define ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED 0x00002158 -#define ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN 0x00002159 -#define ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER 0x0000215A -#define ERROR_DS_SRC_SID_EXISTS_IN_FOREST 0x0000215B -#define ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH 0x0000215C -#define ERROR_SAM_INIT_FAILURE 0x0000215D -#define ERROR_DS_DRA_SCHEMA_INFO_SHIP 0x0000215E -#define ERROR_DS_DRA_SCHEMA_CONFLICT 0x0000215F -#define ERROR_DS_DRA_EARLIER_SCHEMA_CONFLICT 0x00002160 -#define ERROR_DS_DRA_OBJ_NC_MISMATCH 0x00002161 -#define ERROR_DS_NC_STILL_HAS_DSAS 0x00002162 -#define ERROR_DS_GC_REQUIRED 0x00002163 -#define ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY 0x00002164 -#define ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS 0x00002165 -#define ERROR_DS_CANT_ADD_TO_GC 0x00002166 -#define ERROR_DS_NO_CHECKPOINT_WITH_PDC 0x00002167 -#define ERROR_DS_SOURCE_AUDITING_NOT_ENABLED 0x00002168 -#define ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC 0x00002169 -#define ERROR_DS_INVALID_NAME_FOR_SPN 0x0000216A -#define ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS 0x0000216B -#define ERROR_DS_UNICODEPWD_NOT_IN_QUOTES 0x0000216C -#define ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED 0x0000216D -#define ERROR_DS_MUST_BE_RUN_ON_DST_DC 0x0000216E -#define ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER 0x0000216F -#define ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ 0x00002170 -#define ERROR_DS_INIT_FAILURE_CONSOLE 0x00002171 -#define ERROR_DS_SAM_INIT_FAILURE_CONSOLE 0x00002172 -#define ERROR_DS_FOREST_VERSION_TOO_HIGH 0x00002173 -#define ERROR_DS_DOMAIN_VERSION_TOO_HIGH 0x00002174 -#define ERROR_DS_FOREST_VERSION_TOO_LOW 0x00002175 -#define ERROR_DS_DOMAIN_VERSION_TOO_LOW 0x00002176 -#define ERROR_DS_INCOMPATIBLE_VERSION 0x00002177 -#define ERROR_DS_LOW_DSA_VERSION 0x00002178 -#define ERROR_DS_NO_BEHAVIOR_VERSION_IN_MIXEDDOMAIN 0x00002179 -#define ERROR_DS_NOT_SUPPORTED_SORT_ORDER 0x0000217A -#define ERROR_DS_NAME_NOT_UNIQUE 0x0000217B -#define ERROR_DS_MACHINE_ACCOUNT_CREATED_PRENT4 0x0000217C -#define ERROR_DS_OUT_OF_VERSION_STORE 0x0000217D -#define ERROR_DS_INCOMPATIBLE_CONTROLS_USED 0x0000217E -#define ERROR_DS_NO_REF_DOMAIN 0x0000217F -#define ERROR_DS_RESERVED_LINK_ID 0x00002180 -#define ERROR_DS_LINK_ID_NOT_AVAILABLE 0x00002181 -#define ERROR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER 0x00002182 -#define ERROR_DS_MODIFYDN_DISALLOWED_BY_INSTANCE_TYPE 0x00002183 -#define ERROR_DS_NO_OBJECT_MOVE_IN_SCHEMA_NC 0x00002184 -#define ERROR_DS_MODIFYDN_DISALLOWED_BY_FLAG 0x00002185 -#define ERROR_DS_MODIFYDN_WRONG_GRANDPARENT 0x00002186 -#define ERROR_DS_NAME_ERROR_TRUST_REFERRAL 0x00002187 -#define ERROR_NOT_SUPPORTED_ON_STANDARD_SERVER 0x00002188 -#define ERROR_DS_CANT_ACCESS_REMOTE_PART_OF_AD 0x00002189 -#define ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE_V2 0x0000218A -#define ERROR_DS_THREAD_LIMIT_EXCEEDED 0x0000218B -#define ERROR_DS_NOT_CLOSEST 0x0000218C -#define ERROR_DS_CANT_DERIVE_SPN_WITHOUT_SERVER_REF 0x0000218D -#define ERROR_DS_SINGLE_USER_MODE_FAILED 0x0000218E -#define ERROR_DS_NTDSCRIPT_SYNTAX_ERROR 0x0000218F -#define ERROR_DS_NTDSCRIPT_PROCESS_ERROR 0x00002190 -#define ERROR_DS_DIFFERENT_REPL_EPOCHS 0x00002191 -#define ERROR_DS_DRS_EXTENSIONS_CHANGED 0x00002192 -#define ERROR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR 0x00002193 -#define ERROR_DS_NO_MSDS_INTID 0x00002194 -#define ERROR_DS_DUP_MSDS_INTID 0x00002195 -#define ERROR_DS_EXISTS_IN_RDNATTID 0x00002196 -#define ERROR_DS_AUTHORIZATION_FAILED 0x00002197 -#define ERROR_DS_INVALID_SCRIPT 0x00002198 -#define ERROR_DS_REMOTE_CROSSREF_OP_FAILED 0x00002199 -#define ERROR_DS_CROSS_REF_BUSY 0x0000219A -#define ERROR_DS_CANT_DERIVE_SPN_FOR_DELETED_DOMAIN 0x0000219B -#define ERROR_DS_CANT_DEMOTE_WITH_WRITEABLE_NC 0x0000219C -#define ERROR_DS_DUPLICATE_ID_FOUND 0x0000219D -#define ERROR_DS_INSUFFICIENT_ATTR_TO_CREATE_OBJECT 0x0000219E -#define ERROR_DS_GROUP_CONVERSION_ERROR 0x0000219F -#define ERROR_DS_CANT_MOVE_APP_BASIC_GROUP 0x000021A0 -#define ERROR_DS_CANT_MOVE_APP_QUERY_GROUP 0x000021A1 -#define ERROR_DS_ROLE_NOT_VERIFIED 0x000021A2 -#define ERROR_DS_WKO_CONTAINER_CANNOT_BE_SPECIAL 0x000021A3 -#define ERROR_DS_DOMAIN_RENAME_IN_PROGRESS 0x000021A4 -#define ERROR_DS_EXISTING_AD_CHILD_NC 0x000021A5 -#define ERROR_DS_REPL_LIFETIME_EXCEEDED 0x000021A6 -#define ERROR_DS_DISALLOWED_IN_SYSTEM_CONTAINER 0x000021A7 -#define ERROR_DS_LDAP_SEND_QUEUE_FULL 0x000021A8 -#define ERROR_DS_DRA_OUT_SCHEDULE_WINDOW 0x000021A9 -#define ERROR_DS_POLICY_NOT_KNOWN 0x000021AA -#define ERROR_NO_SITE_SETTINGS_OBJECT 0x000021AB -#define ERROR_NO_SECRETS 0x000021AC -#define ERROR_NO_WRITABLE_DC_FOUND 0x000021AD -#define ERROR_DS_NO_SERVER_OBJECT 0x000021AE -#define ERROR_DS_NO_NTDSA_OBJECT 0x000021AF -#define ERROR_DS_NON_ASQ_SEARCH 0x000021B0 -#define ERROR_DS_AUDIT_FAILURE 0x000021B1 -#define ERROR_DS_INVALID_SEARCH_FLAG_SUBTREE 0x000021B2 -#define ERROR_DS_INVALID_SEARCH_FLAG_TUPLE 0x000021B3 -#define ERROR_DS_HIERARCHY_TABLE_TOO_DEEP 0x000021B4 -#define ERROR_DS_DRA_CORRUPT_UTD_VECTOR 0x000021B5 -#define ERROR_DS_DRA_SECRETS_DENIED 0x000021B6 -#define ERROR_DS_RESERVED_MAPI_ID 0x000021B7 -#define ERROR_DS_MAPI_ID_NOT_AVAILABLE 0x000021B8 -#define ERROR_DS_DRA_MISSING_KRBTGT_SECRET 0x000021B9 -#define ERROR_DS_DOMAIN_NAME_EXISTS_IN_FOREST 0x000021BA -#define ERROR_DS_FLAT_NAME_EXISTS_IN_FOREST 0x000021BB -#define ERROR_INVALID_USER_PRINCIPAL_NAME 0x000021BC -#define ERROR_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS 0x000021BD -#define ERROR_DS_OID_NOT_FOUND 0x000021BE -#define ERROR_DS_DRA_RECYCLED_TARGET 0x000021BF -#define ERROR_DS_DISALLOWED_NC_REDIRECT 0x000021C0 -#define ERROR_DS_HIGH_ADLDS_FFL 0x000021C1 -#define ERROR_DS_HIGH_DSA_VERSION 0x000021C2 -#define ERROR_DS_LOW_ADLDS_FFL 0x000021C3 -#define ERROR_DOMAIN_SID_SAME_AS_LOCAL_WORKSTATION 0x000021C4 -#define ERROR_DS_UNDELETE_SAM_VALIDATION_FAILED 0x000021C5 -#define ERROR_INCORRECT_ACCOUNT_TYPE 0x000021C6 +#define ERROR_DS_NOT_INSTALLED 0x00002008 +#define ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY 0x00002009 +#define ERROR_DS_NO_ATTRIBUTE_OR_VALUE 0x0000200A +#define ERROR_DS_INVALID_ATTRIBUTE_SYNTAX 0x0000200B +#define ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED 0x0000200C +#define ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS 0x0000200D +#define ERROR_DS_BUSY 0x0000200E +#define ERROR_DS_UNAVAILABLE 0x0000200F +#define ERROR_DS_NO_RIDS_ALLOCATED 0x00002010 +#define ERROR_DS_NO_MORE_RIDS 0x00002011 +#define ERROR_DS_INCORRECT_ROLE_OWNER 0x00002012 +#define ERROR_DS_RIDMGR_INIT_ERROR 0x00002013 +#define ERROR_DS_OBJ_CLASS_VIOLATION 0x00002014 +#define ERROR_DS_CANT_ON_NON_LEAF 0x00002015 +#define ERROR_DS_CANT_ON_RDN 0x00002016 +#define ERROR_DS_CANT_MOD_OBJ_CLASS 0x00002017 +#define ERROR_DS_CROSS_DOM_MOVE_ERROR 0x00002018 +#define ERROR_DS_GC_NOT_AVAILABLE 0x00002019 +#define ERROR_SHARED_POLICY 0x0000201A +#define ERROR_POLICY_OBJECT_NOT_FOUND 0x0000201B +#define ERROR_POLICY_ONLY_IN_DS 0x0000201C +#define ERROR_PROMOTION_ACTIVE 0x0000201D +#define ERROR_NO_PROMOTION_ACTIVE 0x0000201E +#define ERROR_DS_OPERATIONS_ERROR 0x00002020 +#define ERROR_DS_PROTOCOL_ERROR 0x00002021 +#define ERROR_DS_TIMELIMIT_EXCEEDED 0x00002022 +#define ERROR_DS_SIZELIMIT_EXCEEDED 0x00002023 +#define ERROR_DS_ADMIN_LIMIT_EXCEEDED 0x00002024 +#define ERROR_DS_COMPARE_FALSE 0x00002025 +#define ERROR_DS_COMPARE_TRUE 0x00002026 +#define ERROR_DS_AUTH_METHOD_NOT_SUPPORTED 0x00002027 +#define ERROR_DS_STRONG_AUTH_REQUIRED 0x00002028 +#define ERROR_DS_INAPPROPRIATE_AUTH 0x00002029 +#define ERROR_DS_AUTH_UNKNOWN 0x0000202A +#define ERROR_DS_REFERRAL 0x0000202B +#define ERROR_DS_UNAVAILABLE_CRIT_EXTENSION 0x0000202C +#define ERROR_DS_CONFIDENTIALITY_REQUIRED 0x0000202D +#define ERROR_DS_INAPPROPRIATE_MATCHING 0x0000202E +#define ERROR_DS_CONSTRAINT_VIOLATION 0x0000202F +#define ERROR_DS_NO_SUCH_OBJECT 0x00002030 +#define ERROR_DS_ALIAS_PROBLEM 0x00002031 +#define ERROR_DS_INVALID_DN_SYNTAX 0x00002032 +#define ERROR_DS_IS_LEAF 0x00002033 +#define ERROR_DS_ALIAS_DEREF_PROBLEM 0x00002034 +#define ERROR_DS_UNWILLING_TO_PERFORM 0x00002035 +#define ERROR_DS_LOOP_DETECT 0x00002036 +#define ERROR_DS_NAMING_VIOLATION 0x00002037 +#define ERROR_DS_OBJECT_RESULTS_TOO_LARGE 0x00002038 +#define ERROR_DS_AFFECTS_MULTIPLE_DSAS 0x00002039 +#define ERROR_DS_SERVER_DOWN 0x0000203A +#define ERROR_DS_LOCAL_ERROR 0x0000203B +#define ERROR_DS_ENCODING_ERROR 0x0000203C +#define ERROR_DS_DECODING_ERROR 0x0000203D +#define ERROR_DS_FILTER_UNKNOWN 0x0000203E +#define ERROR_DS_PARAM_ERROR 0x0000203F +#define ERROR_DS_NOT_SUPPORTED 0x00002040 +#define ERROR_DS_NO_RESULTS_RETURNED 0x00002041 +#define ERROR_DS_CONTROL_NOT_FOUND 0x00002042 +#define ERROR_DS_CLIENT_LOOP 0x00002043 +#define ERROR_DS_REFERRAL_LIMIT_EXCEEDED 0x00002044 +#define ERROR_DS_SORT_CONTROL_MISSING 0x00002045 +#define ERROR_DS_OFFSET_RANGE_ERROR 0x00002046 +#define ERROR_DS_RIDMGR_DISABLED 0x00002047 +#define ERROR_DS_ROOT_MUST_BE_NC 0x0000206D +#define ERROR_DS_ADD_REPLICA_INHIBITED 0x0000206E +#define ERROR_DS_ATT_NOT_DEF_IN_SCHEMA 0x0000206F +#define ERROR_DS_MAX_OBJ_SIZE_EXCEEDED 0x00002070 +#define ERROR_DS_OBJ_STRING_NAME_EXISTS 0x00002071 +#define ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA 0x00002072 +#define ERROR_DS_RDN_DOESNT_MATCH_SCHEMA 0x00002073 +#define ERROR_DS_NO_REQUESTED_ATTS_FOUND 0x00002074 +#define ERROR_DS_USER_BUFFER_TO_SMALL 0x00002075 +#define ERROR_DS_ATT_IS_NOT_ON_OBJ 0x00002076 +#define ERROR_DS_ILLEGAL_MOD_OPERATION 0x00002077 +#define ERROR_DS_OBJ_TOO_LARGE 0x00002078 +#define ERROR_DS_BAD_INSTANCE_TYPE 0x00002079 +#define ERROR_DS_MASTERDSA_REQUIRED 0x0000207A +#define ERROR_DS_OBJECT_CLASS_REQUIRED 0x0000207B +#define ERROR_DS_MISSING_REQUIRED_ATT 0x0000207C +#define ERROR_DS_ATT_NOT_DEF_FOR_CLASS 0x0000207D +#define ERROR_DS_ATT_ALREADY_EXISTS 0x0000207E +#define ERROR_DS_CANT_ADD_ATT_VALUES 0x00002080 +#define ERROR_DS_SINGLE_VALUE_CONSTRAINT 0x00002081 +#define ERROR_DS_RANGE_CONSTRAINT 0x00002082 +#define ERROR_DS_ATT_VAL_ALREADY_EXISTS 0x00002083 +#define ERROR_DS_CANT_REM_MISSING_ATT 0x00002084 +#define ERROR_DS_CANT_REM_MISSING_ATT_VAL 0x00002085 +#define ERROR_DS_ROOT_CANT_BE_SUBREF 0x00002086 +#define ERROR_DS_NO_CHAINING 0x00002087 +#define ERROR_DS_NO_CHAINED_EVAL 0x00002088 +#define ERROR_DS_NO_PARENT_OBJECT 0x00002089 +#define ERROR_DS_PARENT_IS_AN_ALIAS 0x0000208A +#define ERROR_DS_CANT_MIX_MASTER_AND_REPS 0x0000208B +#define ERROR_DS_CHILDREN_EXIST 0x0000208C +#define ERROR_DS_OBJ_NOT_FOUND 0x0000208D +#define ERROR_DS_ALIASED_OBJ_MISSING 0x0000208E +#define ERROR_DS_BAD_NAME_SYNTAX 0x0000208F +#define ERROR_DS_ALIAS_POINTS_TO_ALIAS 0x00002090 +#define ERROR_DS_CANT_DEREF_ALIAS 0x00002091 +#define ERROR_DS_OUT_OF_SCOPE 0x00002092 +#define ERROR_DS_OBJECT_BEING_REMOVED 0x00002093 +#define ERROR_DS_CANT_DELETE_DSA_OBJ 0x00002094 +#define ERROR_DS_GENERIC_ERROR 0x00002095 +#define ERROR_DS_DSA_MUST_BE_INT_MASTER 0x00002096 +#define ERROR_DS_CLASS_NOT_DSA 0x00002097 +#define ERROR_DS_INSUFF_ACCESS_RIGHTS 0x00002098 +#define ERROR_DS_ILLEGAL_SUPERIOR 0x00002099 +#define ERROR_DS_ATTRIBUTE_OWNED_BY_SAM 0x0000209A +#define ERROR_DS_NAME_TOO_MANY_PARTS 0x0000209B +#define ERROR_DS_NAME_TOO_LONG 0x0000209C +#define ERROR_DS_NAME_VALUE_TOO_LONG 0x0000209D +#define ERROR_DS_NAME_UNPARSEABLE 0x0000209E +#define ERROR_DS_NAME_TYPE_UNKNOWN 0x0000209F +#define ERROR_DS_NOT_AN_OBJECT 0x000020A0 +#define ERROR_DS_SEC_DESC_TOO_SHORT 0x000020A1 +#define ERROR_DS_SEC_DESC_INVALID 0x000020A2 +#define ERROR_DS_NO_DELETED_NAME 0x000020A3 +#define ERROR_DS_SUBREF_MUST_HAVE_PARENT 0x000020A4 +#define ERROR_DS_NCNAME_MUST_BE_NC 0x000020A5 +#define ERROR_DS_CANT_ADD_SYSTEM_ONLY 0x000020A6 +#define ERROR_DS_CLASS_MUST_BE_CONCRETE 0x000020A7 +#define ERROR_DS_INVALID_DMD 0x000020A8 +#define ERROR_DS_OBJ_GUID_EXISTS 0x000020A9 +#define ERROR_DS_NOT_ON_BACKLINK 0x000020AA +#define ERROR_DS_NO_CROSSREF_FOR_NC 0x000020AB +#define ERROR_DS_SHUTTING_DOWN 0x000020AC +#define ERROR_DS_UNKNOWN_OPERATION 0x000020AD +#define ERROR_DS_INVALID_ROLE_OWNER 0x000020AE +#define ERROR_DS_COULDNT_CONTACT_FSMO 0x000020AF +#define ERROR_DS_CROSS_NC_DN_RENAME 0x000020B0 +#define ERROR_DS_CANT_MOD_SYSTEM_ONLY 0x000020B1 +#define ERROR_DS_REPLICATOR_ONLY 0x000020B2 +#define ERROR_DS_OBJ_CLASS_NOT_DEFINED 0x000020B3 +#define ERROR_DS_OBJ_CLASS_NOT_SUBCLASS 0x000020B4 +#define ERROR_DS_NAME_REFERENCE_INVALID 0x000020B5 +#define ERROR_DS_CROSS_REF_EXISTS 0x000020B6 +#define ERROR_DS_CANT_DEL_MASTER_CROSSREF 0x000020B7 +#define ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD 0x000020B8 +#define ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX 0x000020B9 +#define ERROR_DS_DUP_RDN 0x000020BA +#define ERROR_DS_DUP_OID 0x000020BB +#define ERROR_DS_DUP_MAPI_ID 0x000020BC +#define ERROR_DS_DUP_SCHEMA_ID_GUID 0x000020BD +#define ERROR_DS_DUP_LDAP_DISPLAY_NAME 0x000020BE +#define ERROR_DS_SEMANTIC_ATT_TEST 0x000020BF +#define ERROR_DS_SYNTAX_MISMATCH 0x000020C0 +#define ERROR_DS_EXISTS_IN_MUST_HAVE 0x000020C1 +#define ERROR_DS_EXISTS_IN_MAY_HAVE 0x000020C2 +#define ERROR_DS_NONEXISTENT_MAY_HAVE 0x000020C3 +#define ERROR_DS_NONEXISTENT_MUST_HAVE 0x000020C4 +#define ERROR_DS_AUX_CLS_TEST_FAIL 0x000020C5 +#define ERROR_DS_NONEXISTENT_POSS_SUP 0x000020C6 +#define ERROR_DS_SUB_CLS_TEST_FAIL 0x000020C7 +#define ERROR_DS_BAD_RDN_ATT_ID_SYNTAX 0x000020C8 +#define ERROR_DS_EXISTS_IN_AUX_CLS 0x000020C9 +#define ERROR_DS_EXISTS_IN_SUB_CLS 0x000020CA +#define ERROR_DS_EXISTS_IN_POSS_SUP 0x000020CB +#define ERROR_DS_RECALCSCHEMA_FAILED 0x000020CC +#define ERROR_DS_TREE_DELETE_NOT_FINISHED 0x000020CD +#define ERROR_DS_CANT_DELETE 0x000020CE +#define ERROR_DS_ATT_SCHEMA_REQ_ID 0x000020CF +#define ERROR_DS_BAD_ATT_SCHEMA_SYNTAX 0x000020D0 +#define ERROR_DS_CANT_CACHE_ATT 0x000020D1 +#define ERROR_DS_CANT_CACHE_CLASS 0x000020D2 +#define ERROR_DS_CANT_REMOVE_ATT_CACHE 0x000020D3 +#define ERROR_DS_CANT_REMOVE_CLASS_CACHE 0x000020D4 +#define ERROR_DS_CANT_RETRIEVE_DN 0x000020D5 +#define ERROR_DS_MISSING_SUPREF 0x000020D6 +#define ERROR_DS_CANT_RETRIEVE_INSTANCE 0x000020D7 +#define ERROR_DS_CODE_INCONSISTENCY 0x000020D8 +#define ERROR_DS_DATABASE_ERROR 0x000020D9 +#define ERROR_DS_GOVERNSID_MISSING 0x000020DA +#define ERROR_DS_MISSING_EXPECTED_ATT 0x000020DB +#define ERROR_DS_NCNAME_MISSING_CR_REF 0x000020DC +#define ERROR_DS_SECURITY_CHECKING_ERROR 0x000020DD +#define ERROR_DS_SCHEMA_NOT_LOADED 0x000020DE +#define ERROR_DS_SCHEMA_ALLOC_FAILED 0x000020DF +#define ERROR_DS_ATT_SCHEMA_REQ_SYNTAX 0x000020E0 +#define ERROR_DS_GCVERIFY_ERROR 0x000020E1 +#define ERROR_DS_DRA_SCHEMA_MISMATCH 0x000020E2 +#define ERROR_DS_CANT_FIND_DSA_OBJ 0x000020E3 +#define ERROR_DS_CANT_FIND_EXPECTED_NC 0x000020E4 +#define ERROR_DS_CANT_FIND_NC_IN_CACHE 0x000020E5 +#define ERROR_DS_CANT_RETRIEVE_CHILD 0x000020E6 +#define ERROR_DS_SECURITY_ILLEGAL_MODIFY 0x000020E7 +#define ERROR_DS_CANT_REPLACE_HIDDEN_REC 0x000020E8 +#define ERROR_DS_BAD_HIERARCHY_FILE 0x000020E9 +#define ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED 0x000020EA +#define ERROR_DS_CONFIG_PARAM_MISSING 0x000020EB +#define ERROR_DS_COUNTING_AB_INDICES_FAILED 0x000020EC +#define ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED 0x000020ED +#define ERROR_DS_INTERNAL_FAILURE 0x000020EE +#define ERROR_DS_UNKNOWN_ERROR 0x000020EF +#define ERROR_DS_ROOT_REQUIRES_CLASS_TOP 0x000020F0 +#define ERROR_DS_REFUSING_FSMO_ROLES 0x000020F1 +#define ERROR_DS_MISSING_FSMO_SETTINGS 0x000020F2 +#define ERROR_DS_UNABLE_TO_SURRENDER_ROLES 0x000020F3 +#define ERROR_DS_DRA_GENERIC 0x000020F4 +#define ERROR_DS_DRA_INVALID_PARAMETER 0x000020F5 +#define ERROR_DS_DRA_BUSY 0x000020F6 +#define ERROR_DS_DRA_BAD_DN 0x000020F7 +#define ERROR_DS_DRA_BAD_NC 0x000020F8 +#define ERROR_DS_DRA_DN_EXISTS 0x000020F9 +#define ERROR_DS_DRA_INTERNAL_ERROR 0x000020FA +#define ERROR_DS_DRA_INCONSISTENT_DIT 0x000020FB +#define ERROR_DS_DRA_CONNECTION_FAILED 0x000020FC +#define ERROR_DS_DRA_BAD_INSTANCE_TYPE 0x000020FD +#define ERROR_DS_DRA_OUT_OF_MEM 0x000020FE +#define ERROR_DS_DRA_MAIL_PROBLEM 0x000020FF +#define ERROR_DS_DRA_REF_ALREADY_EXISTS 0x00002100 +#define ERROR_DS_DRA_REF_NOT_FOUND 0x00002101 +#define ERROR_DS_DRA_OBJ_IS_REP_SOURCE 0x00002102 +#define ERROR_DS_DRA_DB_ERROR 0x00002103 +#define ERROR_DS_DRA_NO_REPLICA 0x00002104 +#define ERROR_DS_DRA_ACCESS_DENIED 0x00002105 +#define ERROR_DS_DRA_NOT_SUPPORTED 0x00002106 +#define ERROR_DS_DRA_RPC_CANCELLED 0x00002107 +#define ERROR_DS_DRA_SOURCE_DISABLED 0x00002108 +#define ERROR_DS_DRA_SINK_DISABLED 0x00002109 +#define ERROR_DS_DRA_NAME_COLLISION 0x0000210A +#define ERROR_DS_DRA_SOURCE_REINSTALLED 0x0000210B +#define ERROR_DS_DRA_MISSING_PARENT 0x0000210C +#define ERROR_DS_DRA_PREEMPTED 0x0000210D +#define ERROR_DS_DRA_ABANDON_SYNC 0x0000210E +#define ERROR_DS_DRA_SHUTDOWN 0x0000210F +#define ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET 0x00002110 +#define ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA 0x00002111 +#define ERROR_DS_DRA_EXTN_CONNECTION_FAILED 0x00002112 +#define ERROR_DS_INSTALL_SCHEMA_MISMATCH 0x00002113 +#define ERROR_DS_DUP_LINK_ID 0x00002114 +#define ERROR_DS_NAME_ERROR_RESOLVING 0x00002115 +#define ERROR_DS_NAME_ERROR_NOT_FOUND 0x00002116 +#define ERROR_DS_NAME_ERROR_NOT_UNIQUE 0x00002117 +#define ERROR_DS_NAME_ERROR_NO_MAPPING 0x00002118 +#define ERROR_DS_NAME_ERROR_DOMAIN_ONLY 0x00002119 +#define ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING 0x0000211A +#define ERROR_DS_CONSTRUCTED_ATT_MOD 0x0000211B +#define ERROR_DS_WRONG_OM_OBJ_CLASS 0x0000211C +#define ERROR_DS_DRA_REPL_PENDING 0x0000211D +#define ERROR_DS_DS_REQUIRED 0x0000211E +#define ERROR_DS_INVALID_LDAP_DISPLAY_NAME 0x0000211F +#define ERROR_DS_NON_BASE_SEARCH 0x00002120 +#define ERROR_DS_CANT_RETRIEVE_ATTS 0x00002121 +#define ERROR_DS_BACKLINK_WITHOUT_LINK 0x00002122 +#define ERROR_DS_EPOCH_MISMATCH 0x00002123 +#define ERROR_DS_SRC_NAME_MISMATCH 0x00002124 +#define ERROR_DS_SRC_AND_DST_NC_IDENTICAL 0x00002125 +#define ERROR_DS_DST_NC_MISMATCH 0x00002126 +#define ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC 0x00002127 +#define ERROR_DS_SRC_GUID_MISMATCH 0x00002128 +#define ERROR_DS_CANT_MOVE_DELETED_OBJECT 0x00002129 +#define ERROR_DS_PDC_OPERATION_IN_PROGRESS 0x0000212A +#define ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD 0x0000212B +#define ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION 0x0000212C +#define ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS 0x0000212D +#define ERROR_DS_NC_MUST_HAVE_NC_PARENT 0x0000212E +#define ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE 0x0000212F +#define ERROR_DS_DST_DOMAIN_NOT_NATIVE 0x00002130 +#define ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER 0x00002131 +#define ERROR_DS_CANT_MOVE_ACCOUNT_GROUP 0x00002132 +#define ERROR_DS_CANT_MOVE_RESOURCE_GROUP 0x00002133 +#define ERROR_DS_INVALID_SEARCH_FLAG 0x00002134 +#define ERROR_DS_NO_TREE_DELETE_ABOVE_NC 0x00002135 +#define ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE 0x00002136 +#define ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE 0x00002137 +#define ERROR_DS_SAM_INIT_FAILURE 0x00002138 +#define ERROR_DS_SENSITIVE_GROUP_VIOLATION 0x00002139 +#define ERROR_DS_CANT_MOD_PRIMARYGROUPID 0x0000213A +#define ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD 0x0000213B +#define ERROR_DS_NONSAFE_SCHEMA_CHANGE 0x0000213C +#define ERROR_DS_SCHEMA_UPDATE_DISALLOWED 0x0000213D +#define ERROR_DS_CANT_CREATE_UNDER_SCHEMA 0x0000213E +#define ERROR_DS_INSTALL_NO_SRC_SCH_VERSION 0x0000213F +#define ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE 0x00002140 +#define ERROR_DS_INVALID_GROUP_TYPE 0x00002141 +#define ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN 0x00002142 +#define ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN 0x00002143 +#define ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER 0x00002144 +#define ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER 0x00002145 +#define ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER 0x00002146 +#define ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER 0x00002147 +#define ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER 0x00002148 +#define ERROR_DS_HAVE_PRIMARY_MEMBERS 0x00002149 +#define ERROR_DS_STRING_SD_CONVERSION_FAILED 0x0000214A +#define ERROR_DS_NAMING_MASTER_GC 0x0000214B +#define ERROR_DS_DNS_LOOKUP_FAILURE 0x0000214C +#define ERROR_DS_COULDNT_UPDATE_SPNS 0x0000214D +#define ERROR_DS_CANT_RETRIEVE_SD 0x0000214E +#define ERROR_DS_KEY_NOT_UNIQUE 0x0000214F +#define ERROR_DS_WRONG_LINKED_ATT_SYNTAX 0x00002150 +#define ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD 0x00002151 +#define ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY 0x00002152 +#define ERROR_DS_CANT_START 0x00002153 +#define ERROR_DS_INIT_FAILURE 0x00002154 +#define ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION 0x00002155 +#define ERROR_DS_SOURCE_DOMAIN_IN_FOREST 0x00002156 +#define ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST 0x00002157 +#define ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED 0x00002158 +#define ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN 0x00002159 +#define ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER 0x0000215A +#define ERROR_DS_SRC_SID_EXISTS_IN_FOREST 0x0000215B +#define ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH 0x0000215C +#define ERROR_SAM_INIT_FAILURE 0x0000215D +#define ERROR_DS_DRA_SCHEMA_INFO_SHIP 0x0000215E +#define ERROR_DS_DRA_SCHEMA_CONFLICT 0x0000215F +#define ERROR_DS_DRA_EARLIER_SCHEMA_CONFLICT 0x00002160 +#define ERROR_DS_DRA_OBJ_NC_MISMATCH 0x00002161 +#define ERROR_DS_NC_STILL_HAS_DSAS 0x00002162 +#define ERROR_DS_GC_REQUIRED 0x00002163 +#define ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY 0x00002164 +#define ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS 0x00002165 +#define ERROR_DS_CANT_ADD_TO_GC 0x00002166 +#define ERROR_DS_NO_CHECKPOINT_WITH_PDC 0x00002167 +#define ERROR_DS_SOURCE_AUDITING_NOT_ENABLED 0x00002168 +#define ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC 0x00002169 +#define ERROR_DS_INVALID_NAME_FOR_SPN 0x0000216A +#define ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS 0x0000216B +#define ERROR_DS_UNICODEPWD_NOT_IN_QUOTES 0x0000216C +#define ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED 0x0000216D +#define ERROR_DS_MUST_BE_RUN_ON_DST_DC 0x0000216E +#define ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER 0x0000216F +#define ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ 0x00002170 +#define ERROR_DS_INIT_FAILURE_CONSOLE 0x00002171 +#define ERROR_DS_SAM_INIT_FAILURE_CONSOLE 0x00002172 +#define ERROR_DS_FOREST_VERSION_TOO_HIGH 0x00002173 +#define ERROR_DS_DOMAIN_VERSION_TOO_HIGH 0x00002174 +#define ERROR_DS_FOREST_VERSION_TOO_LOW 0x00002175 +#define ERROR_DS_DOMAIN_VERSION_TOO_LOW 0x00002176 +#define ERROR_DS_INCOMPATIBLE_VERSION 0x00002177 +#define ERROR_DS_LOW_DSA_VERSION 0x00002178 +#define ERROR_DS_NO_BEHAVIOR_VERSION_IN_MIXEDDOMAIN 0x00002179 +#define ERROR_DS_NOT_SUPPORTED_SORT_ORDER 0x0000217A +#define ERROR_DS_NAME_NOT_UNIQUE 0x0000217B +#define ERROR_DS_MACHINE_ACCOUNT_CREATED_PRENT4 0x0000217C +#define ERROR_DS_OUT_OF_VERSION_STORE 0x0000217D +#define ERROR_DS_INCOMPATIBLE_CONTROLS_USED 0x0000217E +#define ERROR_DS_NO_REF_DOMAIN 0x0000217F +#define ERROR_DS_RESERVED_LINK_ID 0x00002180 +#define ERROR_DS_LINK_ID_NOT_AVAILABLE 0x00002181 +#define ERROR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER 0x00002182 +#define ERROR_DS_MODIFYDN_DISALLOWED_BY_INSTANCE_TYPE 0x00002183 +#define ERROR_DS_NO_OBJECT_MOVE_IN_SCHEMA_NC 0x00002184 +#define ERROR_DS_MODIFYDN_DISALLOWED_BY_FLAG 0x00002185 +#define ERROR_DS_MODIFYDN_WRONG_GRANDPARENT 0x00002186 +#define ERROR_DS_NAME_ERROR_TRUST_REFERRAL 0x00002187 +#define ERROR_NOT_SUPPORTED_ON_STANDARD_SERVER 0x00002188 +#define ERROR_DS_CANT_ACCESS_REMOTE_PART_OF_AD 0x00002189 +#define ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE_V2 0x0000218A +#define ERROR_DS_THREAD_LIMIT_EXCEEDED 0x0000218B +#define ERROR_DS_NOT_CLOSEST 0x0000218C +#define ERROR_DS_CANT_DERIVE_SPN_WITHOUT_SERVER_REF 0x0000218D +#define ERROR_DS_SINGLE_USER_MODE_FAILED 0x0000218E +#define ERROR_DS_NTDSCRIPT_SYNTAX_ERROR 0x0000218F +#define ERROR_DS_NTDSCRIPT_PROCESS_ERROR 0x00002190 +#define ERROR_DS_DIFFERENT_REPL_EPOCHS 0x00002191 +#define ERROR_DS_DRS_EXTENSIONS_CHANGED 0x00002192 +#define ERROR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR 0x00002193 +#define ERROR_DS_NO_MSDS_INTID 0x00002194 +#define ERROR_DS_DUP_MSDS_INTID 0x00002195 +#define ERROR_DS_EXISTS_IN_RDNATTID 0x00002196 +#define ERROR_DS_AUTHORIZATION_FAILED 0x00002197 +#define ERROR_DS_INVALID_SCRIPT 0x00002198 +#define ERROR_DS_REMOTE_CROSSREF_OP_FAILED 0x00002199 +#define ERROR_DS_CROSS_REF_BUSY 0x0000219A +#define ERROR_DS_CANT_DERIVE_SPN_FOR_DELETED_DOMAIN 0x0000219B +#define ERROR_DS_CANT_DEMOTE_WITH_WRITEABLE_NC 0x0000219C +#define ERROR_DS_DUPLICATE_ID_FOUND 0x0000219D +#define ERROR_DS_INSUFFICIENT_ATTR_TO_CREATE_OBJECT 0x0000219E +#define ERROR_DS_GROUP_CONVERSION_ERROR 0x0000219F +#define ERROR_DS_CANT_MOVE_APP_BASIC_GROUP 0x000021A0 +#define ERROR_DS_CANT_MOVE_APP_QUERY_GROUP 0x000021A1 +#define ERROR_DS_ROLE_NOT_VERIFIED 0x000021A2 +#define ERROR_DS_WKO_CONTAINER_CANNOT_BE_SPECIAL 0x000021A3 +#define ERROR_DS_DOMAIN_RENAME_IN_PROGRESS 0x000021A4 +#define ERROR_DS_EXISTING_AD_CHILD_NC 0x000021A5 +#define ERROR_DS_REPL_LIFETIME_EXCEEDED 0x000021A6 +#define ERROR_DS_DISALLOWED_IN_SYSTEM_CONTAINER 0x000021A7 +#define ERROR_DS_LDAP_SEND_QUEUE_FULL 0x000021A8 +#define ERROR_DS_DRA_OUT_SCHEDULE_WINDOW 0x000021A9 +#define ERROR_DS_POLICY_NOT_KNOWN 0x000021AA +#define ERROR_NO_SITE_SETTINGS_OBJECT 0x000021AB +#define ERROR_NO_SECRETS 0x000021AC +#define ERROR_NO_WRITABLE_DC_FOUND 0x000021AD +#define ERROR_DS_NO_SERVER_OBJECT 0x000021AE +#define ERROR_DS_NO_NTDSA_OBJECT 0x000021AF +#define ERROR_DS_NON_ASQ_SEARCH 0x000021B0 +#define ERROR_DS_AUDIT_FAILURE 0x000021B1 +#define ERROR_DS_INVALID_SEARCH_FLAG_SUBTREE 0x000021B2 +#define ERROR_DS_INVALID_SEARCH_FLAG_TUPLE 0x000021B3 +#define ERROR_DS_HIERARCHY_TABLE_TOO_DEEP 0x000021B4 +#define ERROR_DS_DRA_CORRUPT_UTD_VECTOR 0x000021B5 +#define ERROR_DS_DRA_SECRETS_DENIED 0x000021B6 +#define ERROR_DS_RESERVED_MAPI_ID 0x000021B7 +#define ERROR_DS_MAPI_ID_NOT_AVAILABLE 0x000021B8 +#define ERROR_DS_DRA_MISSING_KRBTGT_SECRET 0x000021B9 +#define ERROR_DS_DOMAIN_NAME_EXISTS_IN_FOREST 0x000021BA +#define ERROR_DS_FLAT_NAME_EXISTS_IN_FOREST 0x000021BB +#define ERROR_INVALID_USER_PRINCIPAL_NAME 0x000021BC +#define ERROR_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS 0x000021BD +#define ERROR_DS_OID_NOT_FOUND 0x000021BE +#define ERROR_DS_DRA_RECYCLED_TARGET 0x000021BF +#define ERROR_DS_DISALLOWED_NC_REDIRECT 0x000021C0 +#define ERROR_DS_HIGH_ADLDS_FFL 0x000021C1 +#define ERROR_DS_HIGH_DSA_VERSION 0x000021C2 +#define ERROR_DS_LOW_ADLDS_FFL 0x000021C3 +#define ERROR_DOMAIN_SID_SAME_AS_LOCAL_WORKSTATION 0x000021C4 +#define ERROR_DS_UNDELETE_SAM_VALIDATION_FAILED 0x000021C5 +#define ERROR_INCORRECT_ACCOUNT_TYPE 0x000021C6 /* System Error Codes (9000-11999) */ -#define DNS_ERROR_RCODE_FORMAT_ERROR 0x00002329 -#define DNS_ERROR_RCODE_SERVER_FAILURE 0x0000232A -#define DNS_ERROR_RCODE_NAME_ERROR 0x0000232B -#define DNS_ERROR_RCODE_NOT_IMPLEMENTED 0x0000232C -#define DNS_ERROR_RCODE_REFUSED 0x0000232D -#define DNS_ERROR_RCODE_YXDOMAIN 0x0000232E -#define DNS_ERROR_RCODE_YXRRSET 0x0000232F -#define DNS_ERROR_RCODE_NXRRSET 0x00002330 -#define DNS_ERROR_RCODE_NOTAUTH 0x00002331 -#define DNS_ERROR_RCODE_NOTZONE 0x00002332 -#define DNS_ERROR_RCODE_BADSIG 0x00002338 -#define DNS_ERROR_RCODE_BADKEY 0x00002339 -#define DNS_ERROR_RCODE_BADTIME 0x0000233A -#define DNS_ERROR_KEYMASTER_REQUIRED 0x0000238D -#define DNS_ERROR_NOT_ALLOWED_ON_SIGNED_ZONE 0x0000238E -#define DNS_ERROR_NSEC3_INCOMPATIBLE_WITH_RSA_SHA1 0x0000238F -#define DNS_ERROR_NOT_ENOUGH_SIGNING_KEY_DESCRIPTORS 0x00002390 -#define DNS_ERROR_UNSUPPORTED_ALGORITHM 0x00002391 -#define DNS_ERROR_INVALID_KEY_SIZE 0x00002392 -#define DNS_ERROR_SIGNING_KEY_NOT_ACCESSIBLE 0x00002393 -#define DNS_ERROR_KSP_DOES_NOT_SUPPORT_PROTECTION 0x00002394 -#define DNS_ERROR_UNEXPECTED_DATA_PROTECTION_ERROR 0x00002395 -#define DNS_ERROR_UNEXPECTED_CNG_ERROR 0x00002396 -#define DNS_ERROR_UNKNOWN_SIGNING_PARAMETER_VERSION 0x00002397 -#define DNS_ERROR_KSP_NOT_ACCESSIBLE 0x00002398 -#define DNS_ERROR_TOO_MANY_SKDS 0x00002399 -#define DNS_ERROR_INVALID_ROLLOVER_PERIOD 0x0000239A -#define DNS_ERROR_INVALID_INITIAL_ROLLOVER_OFFSET 0x0000239B -#define DNS_ERROR_ROLLOVER_IN_PROGRESS 0x0000239C -#define DNS_ERROR_STANDBY_KEY_NOT_PRESENT 0x0000239D -#define DNS_ERROR_NOT_ALLOWED_ON_ZSK 0x0000239E -#define DNS_ERROR_NOT_ALLOWED_ON_ACTIVE_SKD 0x0000239F -#define DNS_ERROR_ROLLOVER_ALREADY_QUEUED 0x000023A0 -#define DNS_ERROR_NOT_ALLOWED_ON_UNSIGNED_ZONE 0x000023A1 -#define DNS_ERROR_BAD_KEYMASTER 0x000023A2 -#define DNS_ERROR_INVALID_SIGNATURE_VALIDITY_PERIOD 0x000023A3 -#define DNS_ERROR_INVALID_NSEC3_ITERATION_COUNT 0x000023A4 -#define DNS_ERROR_DNSSEC_IS_DISABLED 0x000023A5 -#define DNS_ERROR_INVALID_XML 0x000023A6 -#define DNS_ERROR_NO_VALID_TRUST_ANCHORS 0x000023A7 -#define DNS_ERROR_ROLLOVER_NOT_POKEABLE 0x000023A8 -#define DNS_ERROR_NSEC3_NAME_COLLISION 0x000023A9 -#define DNS_ERROR_NSEC_INCOMPATIBLE_WITH_NSEC3_RSA_SHA1 0x000023AA -#define DNS_INFO_NO_RECORDS 0x0000251D -#define DNS_ERROR_BAD_PACKET 0x0000251E -#define DNS_ERROR_NO_PACKET 0x0000251F -#define DNS_ERROR_RCODE 0x00002520 -#define DNS_ERROR_UNSECURE_PACKET 0x00002521 -#define DNS_REQUEST_PENDING 0x00002522 -#define DNS_ERROR_INVALID_TYPE 0x0000254F -#define DNS_ERROR_INVALID_IP_ADDRESS 0x00002550 -#define DNS_ERROR_INVALID_PROPERTY 0x00002551 -#define DNS_ERROR_TRY_AGAIN_LATER 0x00002552 -#define DNS_ERROR_NOT_UNIQUE 0x00002553 -#define DNS_ERROR_NON_RFC_NAME 0x00002554 -#define DNS_STATUS_FQDN 0x00002555 -#define DNS_STATUS_DOTTED_NAME 0x00002556 -#define DNS_STATUS_SINGLE_PART_NAME 0x00002557 -#define DNS_ERROR_INVALID_NAME_CHAR 0x00002558 -#define DNS_ERROR_NUMERIC_NAME 0x00002559 -#define DNS_ERROR_NOT_ALLOWED_ON_ROOT_SERVER 0x0000255A -#define DNS_ERROR_NOT_ALLOWED_UNDER_DELEGATION 0x0000255B -#define DNS_ERROR_CANNOT_FIND_ROOT_HINTS 0x0000255C -#define DNS_ERROR_INCONSISTENT_ROOT_HINTS 0x0000255D -#define DNS_ERROR_DWORD_VALUE_TOO_SMALL 0x0000255E -#define DNS_ERROR_DWORD_VALUE_TOO_LARGE 0x0000255F -#define DNS_ERROR_BACKGROUND_LOADING 0x00002560 -#define DNS_ERROR_NOT_ALLOWED_ON_RODC 0x00002561 -#define DNS_ERROR_NOT_ALLOWED_UNDER_DNAME 0x00002562 -#define DNS_ERROR_DELEGATION_REQUIRED 0x00002563 -#define DNS_ERROR_INVALID_POLICY_TABLE 0x00002564 -#define DNS_ERROR_ZONE_DOES_NOT_EXIST 0x00002581 -#define DNS_ERROR_NO_ZONE_INFO 0x00002582 -#define DNS_ERROR_INVALID_ZONE_OPERATION 0x00002583 -#define DNS_ERROR_ZONE_CONFIGURATION_ERROR 0x00002584 -#define DNS_ERROR_ZONE_HAS_NO_SOA_RECORD 0x00002585 -#define DNS_ERROR_ZONE_HAS_NO_NS_RECORDS 0x00002586 -#define DNS_ERROR_ZONE_LOCKED 0x00002587 -#define DNS_ERROR_ZONE_CREATION_FAILED 0x00002588 -#define DNS_ERROR_ZONE_ALREADY_EXISTS 0x00002589 -#define DNS_ERROR_AUTOZONE_ALREADY_EXISTS 0x0000258A -#define DNS_ERROR_INVALID_ZONE_TYPE 0x0000258B -#define DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP 0x0000258C -#define DNS_ERROR_ZONE_NOT_SECONDARY 0x0000258D -#define DNS_ERROR_NEED_SECONDARY_ADDRESSES 0x0000258E -#define DNS_ERROR_WINS_INIT_FAILED 0x0000258F -#define DNS_ERROR_NEED_WINS_SERVERS 0x00002590 -#define DNS_ERROR_NBSTAT_INIT_FAILED 0x00002591 -#define DNS_ERROR_SOA_DELETE_INVALID 0x00002592 -#define DNS_ERROR_FORWARDER_ALREADY_EXISTS 0x00002593 -#define DNS_ERROR_ZONE_REQUIRES_MASTER_IP 0x00002594 -#define DNS_ERROR_ZONE_IS_SHUTDOWN 0x00002595 -#define DNS_ERROR_ZONE_LOCKED_FOR_SIGNING 0x00002596 -#define DNS_ERROR_PRIMARY_REQUIRES_DATAFILE 0x000025B3 -#define DNS_ERROR_INVALID_DATAFILE_NAME 0x000025B4 -#define DNS_ERROR_DATAFILE_OPEN_FAILURE 0x000025B5 -#define DNS_ERROR_FILE_WRITEBACK_FAILED 0x000025B6 -#define DNS_ERROR_DATAFILE_PARSING 0x000025B7 -#define DNS_ERROR_RECORD_DOES_NOT_EXIST 0x000025E5 -#define DNS_ERROR_RECORD_FORMAT 0x000025E6 -#define DNS_ERROR_NODE_CREATION_FAILED 0x000025E7 -#define DNS_ERROR_UNKNOWN_RECORD_TYPE 0x000025E8 -#define DNS_ERROR_RECORD_TIMED_OUT 0x000025E9 -#define DNS_ERROR_NAME_NOT_IN_ZONE 0x000025EA -#define DNS_ERROR_CNAME_LOOP 0x000025EB -#define DNS_ERROR_NODE_IS_CNAME 0x000025EC -#define DNS_ERROR_CNAME_COLLISION 0x000025ED -#define DNS_ERROR_RECORD_ONLY_AT_ZONE_ROOT 0x000025EE -#define DNS_ERROR_RECORD_ALREADY_EXISTS 0x000025EF -#define DNS_ERROR_SECONDARY_DATA 0x000025F0 -#define DNS_ERROR_NO_CREATE_CACHE_DATA 0x000025F1 -#define DNS_ERROR_NAME_DOES_NOT_EXIST 0x000025F2 -#define DNS_WARNING_PTR_CREATE_FAILED 0x000025F3 -#define DNS_WARNING_DOMAIN_UNDELETED 0x000025F4 -#define DNS_ERROR_DS_UNAVAILABLE 0x000025F5 -#define DNS_ERROR_DS_ZONE_ALREADY_EXISTS 0x000025F6 -#define DNS_ERROR_NO_BOOTFILE_IF_DS_ZONE 0x000025F7 -#define DNS_ERROR_NODE_IS_DNAME 0x000025F8 -#define DNS_ERROR_DNAME_COLLISION 0x000025F9 -#define DNS_ERROR_ALIAS_LOOP 0x000025FA -#define DNS_INFO_AXFR_COMPLETE 0x00002617 -#define DNS_ERROR_AXFR 0x00002618 -#define DNS_INFO_ADDED_LOCAL_WINS 0x00002619 -#define DNS_STATUS_CONTINUE_NEEDED 0x00002649 -#define DNS_ERROR_NO_TCPIP 0x0000267B -#define DNS_ERROR_NO_DNS_SERVERS 0x0000267C -#define DNS_ERROR_DP_DOES_NOT_EXIST 0x000026AD -#define DNS_ERROR_DP_ALREADY_EXISTS 0x000026AE -#define DNS_ERROR_DP_NOT_ENLISTED 0x000026AF -#define DNS_ERROR_DP_ALREADY_ENLISTED 0x000026B0 -#define DNS_ERROR_DP_NOT_AVAILABLE 0x000026B1 -#define DNS_ERROR_DP_FSMO_ERROR 0x000026B2 -#define WSAEINTR 0x00002714 -#define WSAEBADF 0x00002719 -#define WSAEACCES 0x0000271D -#define WSAEFAULT 0x0000271E -#define WSAEINVAL 0x00002726 -#define WSAEMFILE 0x00002728 -#define WSAEWOULDBLOCK 0x00002733 -#define WSAEINPROGRESS 0x00002734 -#define WSAEALREADY 0x00002735 -#define WSAENOTSOCK 0x00002736 -#define WSAEDESTADDRREQ 0x00002737 -#define WSAEMSGSIZE 0x00002738 -#define WSAEPROTOTYPE 0x00002739 -#define WSAENOPROTOOPT 0x0000273A -#define WSAEPROTONOSUPPORT 0x0000273B -#define WSAESOCKTNOSUPPORT 0x0000273C -#define WSAEOPNOTSUPP 0x0000273D -#define WSAEPFNOSUPPORT 0x0000273E -#define WSAEAFNOSUPPORT 0x0000273F -#define WSAEADDRINUSE 0x00002740 -#define WSAEADDRNOTAVAIL 0x00002741 -#define WSAENETDOWN 0x00002742 -#define WSAENETUNREACH 0x00002743 -#define WSAENETRESET 0x00002744 -#define WSAECONNABORTED 0x00002745 -#define WSAECONNRESET 0x00002746 -#define WSAENOBUFS 0x00002747 -#define WSAEISCONN 0x00002748 -#define WSAENOTCONN 0x00002749 -#define WSAESHUTDOWN 0x0000274A -#define WSAETOOMANYREFS 0x0000274B -#define WSAETIMEDOUT 0x0000274C -#define WSAECONNREFUSED 0x0000274D -#define WSAELOOP 0x0000274E -#define WSAENAMETOOLONG 0x0000274F -#define WSAEHOSTDOWN 0x00002750 -#define WSAEHOSTUNREACH 0x00002751 -#define WSAENOTEMPTY 0x00002752 -#define WSAEPROCLIM 0x00002753 -#define WSAEUSERS 0x00002754 -#define WSAEDQUOT 0x00002755 -#define WSAESTALE 0x00002756 -#define WSAEREMOTE 0x00002757 -#define WSASYSNOTREADY 0x0000276B -#define WSAVERNOTSUPPORTED 0x0000276C -#define WSANOTINITIALISED 0x0000276D -#define WSAEDISCON 0x00002775 -#define WSAENOMORE 0x00002776 -#define WSAECANCELLED 0x00002777 -#define WSAEINVALIDPROCTABLE 0x00002778 -#define WSAEINVALIDPROVIDER 0x00002779 -#define WSAEPROVIDERFAILEDINIT 0x0000277A -#define WSASYSCALLFAILURE 0x0000277B -#define WSASERVICE_NOT_FOUND 0x0000277C -#define WSATYPE_NOT_FOUND 0x0000277D -#define WSA_E_NO_MORE 0x0000277E -#define WSA_E_CANCELLED 0x0000277F -#define WSAEREFUSED 0x00002780 -#define WSAHOST_NOT_FOUND 0x00002AF9 -#define WSATRY_AGAIN 0x00002AFA -#define WSANO_RECOVERY 0x00002AFB -#define WSANO_DATA 0x00002AFC -#define WSA_QOS_RECEIVERS 0x00002AFD -#define WSA_QOS_SENDERS 0x00002AFE -#define WSA_QOS_NO_SENDERS 0x00002AFF -#define WSA_QOS_NO_RECEIVERS 0x00002B00 -#define WSA_QOS_REQUEST_CONFIRMED 0x00002B01 -#define WSA_QOS_ADMISSION_FAILURE 0x00002B02 -#define WSA_QOS_POLICY_FAILURE 0x00002B03 -#define WSA_QOS_BAD_STYLE 0x00002B04 -#define WSA_QOS_BAD_OBJECT 0x00002B05 -#define WSA_QOS_TRAFFIC_CTRL_ERROR 0x00002B06 -#define WSA_QOS_GENERIC_ERROR 0x00002B07 -#define WSA_QOS_ESERVICETYPE 0x00002B08 -#define WSA_QOS_EFLOWSPEC 0x00002B09 -#define WSA_QOS_EPROVSPECBUF 0x00002B0A -#define WSA_QOS_EFILTERSTYLE 0x00002B0B -#define WSA_QOS_EFILTERTYPE 0x00002B0C -#define WSA_QOS_EFILTERCOUNT 0x00002B0D -#define WSA_QOS_EOBJLENGTH 0x00002B0E -#define WSA_QOS_EFLOWCOUNT 0x00002B0F -#define WSA_QOS_EUNKOWNPSOBJ 0x00002B10 -#define WSA_QOS_EPOLICYOBJ 0x00002B11 -#define WSA_QOS_EFLOWDESC 0x00002B12 -#define WSA_QOS_EPSFLOWSPEC 0x00002B13 -#define WSA_QOS_EPSFILTERSPEC 0x00002B14 -#define WSA_QOS_ESDMODEOBJ 0x00002B15 -#define WSA_QOS_ESHAPERATEOBJ 0x00002B16 -#define WSA_QOS_RESERVED_PETYPE 0x00002B17 -#define WSA_SECURE_HOST_NOT_FOUND 0x00002B18 -#define WSA_IPSEC_NAME_POLICY_ERROR 0x00002B19 +#define DNS_ERROR_RCODE_FORMAT_ERROR 0x00002329 +#define DNS_ERROR_RCODE_SERVER_FAILURE 0x0000232A +#define DNS_ERROR_RCODE_NAME_ERROR 0x0000232B +#define DNS_ERROR_RCODE_NOT_IMPLEMENTED 0x0000232C +#define DNS_ERROR_RCODE_REFUSED 0x0000232D +#define DNS_ERROR_RCODE_YXDOMAIN 0x0000232E +#define DNS_ERROR_RCODE_YXRRSET 0x0000232F +#define DNS_ERROR_RCODE_NXRRSET 0x00002330 +#define DNS_ERROR_RCODE_NOTAUTH 0x00002331 +#define DNS_ERROR_RCODE_NOTZONE 0x00002332 +#define DNS_ERROR_RCODE_BADSIG 0x00002338 +#define DNS_ERROR_RCODE_BADKEY 0x00002339 +#define DNS_ERROR_RCODE_BADTIME 0x0000233A +#define DNS_ERROR_KEYMASTER_REQUIRED 0x0000238D +#define DNS_ERROR_NOT_ALLOWED_ON_SIGNED_ZONE 0x0000238E +#define DNS_ERROR_NSEC3_INCOMPATIBLE_WITH_RSA_SHA1 0x0000238F +#define DNS_ERROR_NOT_ENOUGH_SIGNING_KEY_DESCRIPTORS 0x00002390 +#define DNS_ERROR_UNSUPPORTED_ALGORITHM 0x00002391 +#define DNS_ERROR_INVALID_KEY_SIZE 0x00002392 +#define DNS_ERROR_SIGNING_KEY_NOT_ACCESSIBLE 0x00002393 +#define DNS_ERROR_KSP_DOES_NOT_SUPPORT_PROTECTION 0x00002394 +#define DNS_ERROR_UNEXPECTED_DATA_PROTECTION_ERROR 0x00002395 +#define DNS_ERROR_UNEXPECTED_CNG_ERROR 0x00002396 +#define DNS_ERROR_UNKNOWN_SIGNING_PARAMETER_VERSION 0x00002397 +#define DNS_ERROR_KSP_NOT_ACCESSIBLE 0x00002398 +#define DNS_ERROR_TOO_MANY_SKDS 0x00002399 +#define DNS_ERROR_INVALID_ROLLOVER_PERIOD 0x0000239A +#define DNS_ERROR_INVALID_INITIAL_ROLLOVER_OFFSET 0x0000239B +#define DNS_ERROR_ROLLOVER_IN_PROGRESS 0x0000239C +#define DNS_ERROR_STANDBY_KEY_NOT_PRESENT 0x0000239D +#define DNS_ERROR_NOT_ALLOWED_ON_ZSK 0x0000239E +#define DNS_ERROR_NOT_ALLOWED_ON_ACTIVE_SKD 0x0000239F +#define DNS_ERROR_ROLLOVER_ALREADY_QUEUED 0x000023A0 +#define DNS_ERROR_NOT_ALLOWED_ON_UNSIGNED_ZONE 0x000023A1 +#define DNS_ERROR_BAD_KEYMASTER 0x000023A2 +#define DNS_ERROR_INVALID_SIGNATURE_VALIDITY_PERIOD 0x000023A3 +#define DNS_ERROR_INVALID_NSEC3_ITERATION_COUNT 0x000023A4 +#define DNS_ERROR_DNSSEC_IS_DISABLED 0x000023A5 +#define DNS_ERROR_INVALID_XML 0x000023A6 +#define DNS_ERROR_NO_VALID_TRUST_ANCHORS 0x000023A7 +#define DNS_ERROR_ROLLOVER_NOT_POKEABLE 0x000023A8 +#define DNS_ERROR_NSEC3_NAME_COLLISION 0x000023A9 +#define DNS_ERROR_NSEC_INCOMPATIBLE_WITH_NSEC3_RSA_SHA1 0x000023AA +#define DNS_INFO_NO_RECORDS 0x0000251D +#define DNS_ERROR_BAD_PACKET 0x0000251E +#define DNS_ERROR_NO_PACKET 0x0000251F +#define DNS_ERROR_RCODE 0x00002520 +#define DNS_ERROR_UNSECURE_PACKET 0x00002521 +#define DNS_REQUEST_PENDING 0x00002522 +#define DNS_ERROR_INVALID_TYPE 0x0000254F +#define DNS_ERROR_INVALID_IP_ADDRESS 0x00002550 +#define DNS_ERROR_INVALID_PROPERTY 0x00002551 +#define DNS_ERROR_TRY_AGAIN_LATER 0x00002552 +#define DNS_ERROR_NOT_UNIQUE 0x00002553 +#define DNS_ERROR_NON_RFC_NAME 0x00002554 +#define DNS_STATUS_FQDN 0x00002555 +#define DNS_STATUS_DOTTED_NAME 0x00002556 +#define DNS_STATUS_SINGLE_PART_NAME 0x00002557 +#define DNS_ERROR_INVALID_NAME_CHAR 0x00002558 +#define DNS_ERROR_NUMERIC_NAME 0x00002559 +#define DNS_ERROR_NOT_ALLOWED_ON_ROOT_SERVER 0x0000255A +#define DNS_ERROR_NOT_ALLOWED_UNDER_DELEGATION 0x0000255B +#define DNS_ERROR_CANNOT_FIND_ROOT_HINTS 0x0000255C +#define DNS_ERROR_INCONSISTENT_ROOT_HINTS 0x0000255D +#define DNS_ERROR_DWORD_VALUE_TOO_SMALL 0x0000255E +#define DNS_ERROR_DWORD_VALUE_TOO_LARGE 0x0000255F +#define DNS_ERROR_BACKGROUND_LOADING 0x00002560 +#define DNS_ERROR_NOT_ALLOWED_ON_RODC 0x00002561 +#define DNS_ERROR_NOT_ALLOWED_UNDER_DNAME 0x00002562 +#define DNS_ERROR_DELEGATION_REQUIRED 0x00002563 +#define DNS_ERROR_INVALID_POLICY_TABLE 0x00002564 +#define DNS_ERROR_ZONE_DOES_NOT_EXIST 0x00002581 +#define DNS_ERROR_NO_ZONE_INFO 0x00002582 +#define DNS_ERROR_INVALID_ZONE_OPERATION 0x00002583 +#define DNS_ERROR_ZONE_CONFIGURATION_ERROR 0x00002584 +#define DNS_ERROR_ZONE_HAS_NO_SOA_RECORD 0x00002585 +#define DNS_ERROR_ZONE_HAS_NO_NS_RECORDS 0x00002586 +#define DNS_ERROR_ZONE_LOCKED 0x00002587 +#define DNS_ERROR_ZONE_CREATION_FAILED 0x00002588 +#define DNS_ERROR_ZONE_ALREADY_EXISTS 0x00002589 +#define DNS_ERROR_AUTOZONE_ALREADY_EXISTS 0x0000258A +#define DNS_ERROR_INVALID_ZONE_TYPE 0x0000258B +#define DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP 0x0000258C +#define DNS_ERROR_ZONE_NOT_SECONDARY 0x0000258D +#define DNS_ERROR_NEED_SECONDARY_ADDRESSES 0x0000258E +#define DNS_ERROR_WINS_INIT_FAILED 0x0000258F +#define DNS_ERROR_NEED_WINS_SERVERS 0x00002590 +#define DNS_ERROR_NBSTAT_INIT_FAILED 0x00002591 +#define DNS_ERROR_SOA_DELETE_INVALID 0x00002592 +#define DNS_ERROR_FORWARDER_ALREADY_EXISTS 0x00002593 +#define DNS_ERROR_ZONE_REQUIRES_MASTER_IP 0x00002594 +#define DNS_ERROR_ZONE_IS_SHUTDOWN 0x00002595 +#define DNS_ERROR_ZONE_LOCKED_FOR_SIGNING 0x00002596 +#define DNS_ERROR_PRIMARY_REQUIRES_DATAFILE 0x000025B3 +#define DNS_ERROR_INVALID_DATAFILE_NAME 0x000025B4 +#define DNS_ERROR_DATAFILE_OPEN_FAILURE 0x000025B5 +#define DNS_ERROR_FILE_WRITEBACK_FAILED 0x000025B6 +#define DNS_ERROR_DATAFILE_PARSING 0x000025B7 +#define DNS_ERROR_RECORD_DOES_NOT_EXIST 0x000025E5 +#define DNS_ERROR_RECORD_FORMAT 0x000025E6 +#define DNS_ERROR_NODE_CREATION_FAILED 0x000025E7 +#define DNS_ERROR_UNKNOWN_RECORD_TYPE 0x000025E8 +#define DNS_ERROR_RECORD_TIMED_OUT 0x000025E9 +#define DNS_ERROR_NAME_NOT_IN_ZONE 0x000025EA +#define DNS_ERROR_CNAME_LOOP 0x000025EB +#define DNS_ERROR_NODE_IS_CNAME 0x000025EC +#define DNS_ERROR_CNAME_COLLISION 0x000025ED +#define DNS_ERROR_RECORD_ONLY_AT_ZONE_ROOT 0x000025EE +#define DNS_ERROR_RECORD_ALREADY_EXISTS 0x000025EF +#define DNS_ERROR_SECONDARY_DATA 0x000025F0 +#define DNS_ERROR_NO_CREATE_CACHE_DATA 0x000025F1 +#define DNS_ERROR_NAME_DOES_NOT_EXIST 0x000025F2 +#define DNS_WARNING_PTR_CREATE_FAILED 0x000025F3 +#define DNS_WARNING_DOMAIN_UNDELETED 0x000025F4 +#define DNS_ERROR_DS_UNAVAILABLE 0x000025F5 +#define DNS_ERROR_DS_ZONE_ALREADY_EXISTS 0x000025F6 +#define DNS_ERROR_NO_BOOTFILE_IF_DS_ZONE 0x000025F7 +#define DNS_ERROR_NODE_IS_DNAME 0x000025F8 +#define DNS_ERROR_DNAME_COLLISION 0x000025F9 +#define DNS_ERROR_ALIAS_LOOP 0x000025FA +#define DNS_INFO_AXFR_COMPLETE 0x00002617 +#define DNS_ERROR_AXFR 0x00002618 +#define DNS_INFO_ADDED_LOCAL_WINS 0x00002619 +#define DNS_STATUS_CONTINUE_NEEDED 0x00002649 +#define DNS_ERROR_NO_TCPIP 0x0000267B +#define DNS_ERROR_NO_DNS_SERVERS 0x0000267C +#define DNS_ERROR_DP_DOES_NOT_EXIST 0x000026AD +#define DNS_ERROR_DP_ALREADY_EXISTS 0x000026AE +#define DNS_ERROR_DP_NOT_ENLISTED 0x000026AF +#define DNS_ERROR_DP_ALREADY_ENLISTED 0x000026B0 +#define DNS_ERROR_DP_NOT_AVAILABLE 0x000026B1 +#define DNS_ERROR_DP_FSMO_ERROR 0x000026B2 +#define WSAEINTR 0x00002714 +#define WSAEBADF 0x00002719 +#define WSAEACCES 0x0000271D +#define WSAEFAULT 0x0000271E +#define WSAEINVAL 0x00002726 +#define WSAEMFILE 0x00002728 +#define WSAEWOULDBLOCK 0x00002733 +#define WSAEINPROGRESS 0x00002734 +#define WSAEALREADY 0x00002735 +#define WSAENOTSOCK 0x00002736 +#define WSAEDESTADDRREQ 0x00002737 +#define WSAEMSGSIZE 0x00002738 +#define WSAEPROTOTYPE 0x00002739 +#define WSAENOPROTOOPT 0x0000273A +#define WSAEPROTONOSUPPORT 0x0000273B +#define WSAESOCKTNOSUPPORT 0x0000273C +#define WSAEOPNOTSUPP 0x0000273D +#define WSAEPFNOSUPPORT 0x0000273E +#define WSAEAFNOSUPPORT 0x0000273F +#define WSAEADDRINUSE 0x00002740 +#define WSAEADDRNOTAVAIL 0x00002741 +#define WSAENETDOWN 0x00002742 +#define WSAENETUNREACH 0x00002743 +#define WSAENETRESET 0x00002744 +#define WSAECONNABORTED 0x00002745 +#define WSAECONNRESET 0x00002746 +#define WSAENOBUFS 0x00002747 +#define WSAEISCONN 0x00002748 +#define WSAENOTCONN 0x00002749 +#define WSAESHUTDOWN 0x0000274A +#define WSAETOOMANYREFS 0x0000274B +#define WSAETIMEDOUT 0x0000274C +#define WSAECONNREFUSED 0x0000274D +#define WSAELOOP 0x0000274E +#define WSAENAMETOOLONG 0x0000274F +#define WSAEHOSTDOWN 0x00002750 +#define WSAEHOSTUNREACH 0x00002751 +#define WSAENOTEMPTY 0x00002752 +#define WSAEPROCLIM 0x00002753 +#define WSAEUSERS 0x00002754 +#define WSAEDQUOT 0x00002755 +#define WSAESTALE 0x00002756 +#define WSAEREMOTE 0x00002757 +#define WSASYSNOTREADY 0x0000276B +#define WSAVERNOTSUPPORTED 0x0000276C +#define WSANOTINITIALISED 0x0000276D +#define WSAEDISCON 0x00002775 +#define WSAENOMORE 0x00002776 +#define WSAECANCELLED 0x00002777 +#define WSAEINVALIDPROCTABLE 0x00002778 +#define WSAEINVALIDPROVIDER 0x00002779 +#define WSAEPROVIDERFAILEDINIT 0x0000277A +#define WSASYSCALLFAILURE 0x0000277B +#define WSASERVICE_NOT_FOUND 0x0000277C +#define WSATYPE_NOT_FOUND 0x0000277D +#define WSA_E_NO_MORE 0x0000277E +#define WSA_E_CANCELLED 0x0000277F +#define WSAEREFUSED 0x00002780 +#define WSAHOST_NOT_FOUND 0x00002AF9 +#define WSATRY_AGAIN 0x00002AFA +#define WSANO_RECOVERY 0x00002AFB +#define WSANO_DATA 0x00002AFC +#define WSA_QOS_RECEIVERS 0x00002AFD +#define WSA_QOS_SENDERS 0x00002AFE +#define WSA_QOS_NO_SENDERS 0x00002AFF +#define WSA_QOS_NO_RECEIVERS 0x00002B00 +#define WSA_QOS_REQUEST_CONFIRMED 0x00002B01 +#define WSA_QOS_ADMISSION_FAILURE 0x00002B02 +#define WSA_QOS_POLICY_FAILURE 0x00002B03 +#define WSA_QOS_BAD_STYLE 0x00002B04 +#define WSA_QOS_BAD_OBJECT 0x00002B05 +#define WSA_QOS_TRAFFIC_CTRL_ERROR 0x00002B06 +#define WSA_QOS_GENERIC_ERROR 0x00002B07 +#define WSA_QOS_ESERVICETYPE 0x00002B08 +#define WSA_QOS_EFLOWSPEC 0x00002B09 +#define WSA_QOS_EPROVSPECBUF 0x00002B0A +#define WSA_QOS_EFILTERSTYLE 0x00002B0B +#define WSA_QOS_EFILTERTYPE 0x00002B0C +#define WSA_QOS_EFILTERCOUNT 0x00002B0D +#define WSA_QOS_EOBJLENGTH 0x00002B0E +#define WSA_QOS_EFLOWCOUNT 0x00002B0F +#define WSA_QOS_EUNKOWNPSOBJ 0x00002B10 +#define WSA_QOS_EPOLICYOBJ 0x00002B11 +#define WSA_QOS_EFLOWDESC 0x00002B12 +#define WSA_QOS_EPSFLOWSPEC 0x00002B13 +#define WSA_QOS_EPSFILTERSPEC 0x00002B14 +#define WSA_QOS_ESDMODEOBJ 0x00002B15 +#define WSA_QOS_ESHAPERATEOBJ 0x00002B16 +#define WSA_QOS_RESERVED_PETYPE 0x00002B17 +#define WSA_SECURE_HOST_NOT_FOUND 0x00002B18 +#define WSA_IPSEC_NAME_POLICY_ERROR 0x00002B19 /* System Error Codes (12000-15999) */ /* ERROR_INTERNET_* : (12000 - 12175) defined in WinInet.h */ -#define ERROR_IPSEC_QM_POLICY_EXISTS 0x000032C8 -#define ERROR_IPSEC_QM_POLICY_NOT_FOUND 0x000032C9 -#define ERROR_IPSEC_QM_POLICY_IN_USE 0x000032CA -#define ERROR_IPSEC_MM_POLICY_EXISTS 0x000032CB -#define ERROR_IPSEC_MM_POLICY_NOT_FOUND 0x000032CC -#define ERROR_IPSEC_MM_POLICY_IN_USE 0x000032CD -#define ERROR_IPSEC_MM_FILTER_EXISTS 0x000032CE -#define ERROR_IPSEC_MM_FILTER_NOT_FOUND 0x000032CF -#define ERROR_IPSEC_TRANSPORT_FILTER_EXISTS 0x000032D0 -#define ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND 0x000032D1 -#define ERROR_IPSEC_MM_AUTH_EXISTS 0x000032D2 -#define ERROR_IPSEC_MM_AUTH_NOT_FOUND 0x000032D3 -#define ERROR_IPSEC_MM_AUTH_IN_USE 0x000032D4 -#define ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND 0x000032D5 -#define ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND 0x000032D6 -#define ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND 0x000032D7 -#define ERROR_IPSEC_TUNNEL_FILTER_EXISTS 0x000032D8 -#define ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND 0x000032D9 -#define ERROR_IPSEC_MM_FILTER_PENDING_DELETION 0x000032DA -#define ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION 0x000032DB -#define ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION 0x000032DC -#define ERROR_IPSEC_MM_POLICY_PENDING_DELETION 0x000032DD -#define ERROR_IPSEC_MM_AUTH_PENDING_DELETION 0x000032DE -#define ERROR_IPSEC_QM_POLICY_PENDING_DELETION 0x000032DF -#define WARNING_IPSEC_MM_POLICY_PRUNED 0x000032E0 -#define WARNING_IPSEC_QM_POLICY_PRUNED 0x000032E1 -#define ERROR_IPSEC_IKE_NEG_STATUS_BEGIN 0x000035E8 -#define ERROR_IPSEC_IKE_AUTH_FAIL 0x000035E9 -#define ERROR_IPSEC_IKE_ATTRIB_FAIL 0x000035EA -#define ERROR_IPSEC_IKE_NEGOTIATION_PENDING 0x000035EB -#define ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR 0x000035EC -#define ERROR_IPSEC_IKE_TIMED_OUT 0x000035ED -#define ERROR_IPSEC_IKE_NO_CERT 0x000035EE -#define ERROR_IPSEC_IKE_SA_DELETED 0x000035EF -#define ERROR_IPSEC_IKE_SA_REAPED 0x000035F0 -#define ERROR_IPSEC_IKE_MM_ACQUIRE_DROP 0x000035F1 -#define ERROR_IPSEC_IKE_QM_ACQUIRE_DROP 0x000035F2 -#define ERROR_IPSEC_IKE_QUEUE_DROP_MM 0x000035F3 -#define ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM 0x000035F4 -#define ERROR_IPSEC_IKE_DROP_NO_RESPONSE 0x000035F5 -#define ERROR_IPSEC_IKE_MM_DELAY_DROP 0x000035F6 -#define ERROR_IPSEC_IKE_QM_DELAY_DROP 0x000035F7 -#define ERROR_IPSEC_IKE_ERROR 0x000035F8 -#define ERROR_IPSEC_IKE_CRL_FAILED 0x000035F9 -#define ERROR_IPSEC_IKE_INVALID_KEY_USAGE 0x000035FA -#define ERROR_IPSEC_IKE_INVALID_CERT_TYPE 0x000035FB -#define ERROR_IPSEC_IKE_NO_PRIVATE_KEY 0x000035FC -#define ERROR_IPSEC_IKE_SIMULTANEOUS_REKEY 0x000035FD -#define ERROR_IPSEC_IKE_DH_FAIL 0x000035FE -#define ERROR_IPSEC_IKE_CRITICAL_PAYLOAD_NOT_RECOGNIZED 0x000035FF -#define ERROR_IPSEC_IKE_INVALID_HEADER 0x00003600 -#define ERROR_IPSEC_IKE_NO_POLICY 0x00003601 -#define ERROR_IPSEC_IKE_INVALID_SIGNATURE 0x00003602 -#define ERROR_IPSEC_IKE_KERBEROS_ERROR 0x00003603 -#define ERROR_IPSEC_IKE_NO_PUBLIC_KEY 0x00003604 -#define ERROR_IPSEC_IKE_PROCESS_ERR 0x00003605 -#define ERROR_IPSEC_IKE_PROCESS_ERR_SA 0x00003606 -#define ERROR_IPSEC_IKE_PROCESS_ERR_PROP 0x00003607 -#define ERROR_IPSEC_IKE_PROCESS_ERR_TRANS 0x00003608 -#define ERROR_IPSEC_IKE_PROCESS_ERR_KE 0x00003609 -#define ERROR_IPSEC_IKE_PROCESS_ERR_ID 0x0000360A -#define ERROR_IPSEC_IKE_PROCESS_ERR_CERT 0x0000360B -#define ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ 0x0000360C -#define ERROR_IPSEC_IKE_PROCESS_ERR_HASH 0x0000360D -#define ERROR_IPSEC_IKE_PROCESS_ERR_SIG 0x0000360E -#define ERROR_IPSEC_IKE_PROCESS_ERR_NONCE 0x0000360F -#define ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY 0x00003610 -#define ERROR_IPSEC_IKE_PROCESS_ERR_DELETE 0x00003611 -#define ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR 0x00003612 -#define ERROR_IPSEC_IKE_INVALID_PAYLOAD 0x00003613 -#define ERROR_IPSEC_IKE_LOAD_SOFT_SA 0x00003614 -#define ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN 0x00003615 -#define ERROR_IPSEC_IKE_INVALID_COOKIE 0x00003616 -#define ERROR_IPSEC_IKE_NO_PEER_CERT 0x00003617 -#define ERROR_IPSEC_IKE_PEER_CRL_FAILED 0x00003618 -#define ERROR_IPSEC_IKE_POLICY_CHANGE 0x00003619 -#define ERROR_IPSEC_IKE_NO_MM_POLICY 0x0000361A -#define ERROR_IPSEC_IKE_NOTCBPRIV 0x0000361B -#define ERROR_IPSEC_IKE_SECLOADFAIL 0x0000361C -#define ERROR_IPSEC_IKE_FAILSSPINIT 0x0000361D -#define ERROR_IPSEC_IKE_FAILQUERYSSP 0x0000361E -#define ERROR_IPSEC_IKE_SRVACQFAIL 0x0000361F -#define ERROR_IPSEC_IKE_SRVQUERYCRED 0x00003620 -#define ERROR_IPSEC_IKE_GETSPIFAIL 0x00003621 -#define ERROR_IPSEC_IKE_INVALID_FILTER 0x00003622 -#define ERROR_IPSEC_IKE_OUT_OF_MEMORY 0x00003623 -#define ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED 0x00003624 -#define ERROR_IPSEC_IKE_INVALID_POLICY 0x00003625 -#define ERROR_IPSEC_IKE_UNKNOWN_DOI 0x00003626 -#define ERROR_IPSEC_IKE_INVALID_SITUATION 0x00003627 -#define ERROR_IPSEC_IKE_DH_FAILURE 0x00003628 -#define ERROR_IPSEC_IKE_INVALID_GROUP 0x00003629 -#define ERROR_IPSEC_IKE_ENCRYPT 0x0000362A -#define ERROR_IPSEC_IKE_DECRYPT 0x0000362B -#define ERROR_IPSEC_IKE_POLICY_MATCH 0x0000362C -#define ERROR_IPSEC_IKE_UNSUPPORTED_ID 0x0000362D -#define ERROR_IPSEC_IKE_INVALID_HASH 0x0000362E -#define ERROR_IPSEC_IKE_INVALID_HASH_ALG 0x0000362F -#define ERROR_IPSEC_IKE_INVALID_HASH_SIZE 0x00003630 -#define ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG 0x00003631 -#define ERROR_IPSEC_IKE_INVALID_AUTH_ALG 0x00003632 -#define ERROR_IPSEC_IKE_INVALID_SIG 0x00003633 -#define ERROR_IPSEC_IKE_LOAD_FAILED 0x00003634 -#define ERROR_IPSEC_IKE_RPC_DELETE 0x00003635 -#define ERROR_IPSEC_IKE_BENIGN_REINIT 0x00003636 -#define ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY 0x00003637 -#define ERROR_IPSEC_IKE_INVALID_MAJOR_VERSION 0x00003638 -#define ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN 0x00003639 -#define ERROR_IPSEC_IKE_MM_LIMIT 0x0000363A -#define ERROR_IPSEC_IKE_NEGOTIATION_DISABLED 0x0000363B -#define ERROR_IPSEC_IKE_QM_LIMIT 0x0000363C -#define ERROR_IPSEC_IKE_MM_EXPIRED 0x0000363D -#define ERROR_IPSEC_IKE_PEER_MM_ASSUMED_INVALID 0x0000363E -#define ERROR_IPSEC_IKE_CERT_CHAIN_POLICY_MISMATCH 0x0000363F -#define ERROR_IPSEC_IKE_UNEXPECTED_MESSAGE_ID 0x00003640 -#define ERROR_IPSEC_IKE_INVALID_AUTH_PAYLOAD 0x00003641 -#define ERROR_IPSEC_IKE_DOS_COOKIE_SENT 0x00003642 -#define ERROR_IPSEC_IKE_SHUTTING_DOWN 0x00003643 -#define ERROR_IPSEC_IKE_CGA_AUTH_FAILED 0x00003644 -#define ERROR_IPSEC_IKE_PROCESS_ERR_NATOA 0x00003645 -#define ERROR_IPSEC_IKE_INVALID_MM_FOR_QM 0x00003646 -#define ERROR_IPSEC_IKE_QM_EXPIRED 0x00003647 -#define ERROR_IPSEC_IKE_TOO_MANY_FILTERS 0x00003648 -#define ERROR_IPSEC_IKE_NEG_STATUS_END 0x00003649 -#define ERROR_IPSEC_IKE_KILL_DUMMY_NAP_TUNNEL 0x0000364A -#define ERROR_IPSEC_IKE_INNER_IP_ASSIGNMENT_FAILURE 0x0000364B -#define ERROR_IPSEC_IKE_REQUIRE_CP_PAYLOAD_MISSING 0x0000364C -#define ERROR_IPSEC_KEY_MODULE_IMPERSONATION_NEGOTIATION_PENDING 0x0000364D -#define ERROR_IPSEC_IKE_COEXISTENCE_SUPPRESS 0x0000364E -#define ERROR_IPSEC_IKE_RATELIMIT_DROP 0x0000364F -#define ERROR_IPSEC_IKE_PEER_DOESNT_SUPPORT_MOBIKE 0x00003650 -#define ERROR_IPSEC_IKE_AUTHORIZATION_FAILURE 0x00003651 -#define ERROR_IPSEC_IKE_STRONG_CRED_AUTHORIZATION_FAILURE 0x00003652 -#define ERROR_IPSEC_IKE_AUTHORIZATION_FAILURE_WITH_OPTIONAL_RETRY 0x00003653 -#define ERROR_IPSEC_IKE_STRONG_CRED_AUTHORIZATION_AND_CERTMAP_FAILURE 0x00003654 -#define ERROR_IPSEC_IKE_NEG_STATUS_EXTENDED_END 0x00003655 -#define ERROR_IPSEC_BAD_SPI 0x00003656 -#define ERROR_IPSEC_SA_LIFETIME_EXPIRED 0x00003657 -#define ERROR_IPSEC_WRONG_SA 0x00003658 -#define ERROR_IPSEC_REPLAY_CHECK_FAILED 0x00003659 -#define ERROR_IPSEC_INVALID_PACKET 0x0000365A -#define ERROR_IPSEC_INTEGRITY_CHECK_FAILED 0x0000365B -#define ERROR_IPSEC_CLEAR_TEXT_DROP 0x0000365C -#define ERROR_IPSEC_AUTH_FIREWALL_DROP 0x0000365D -#define ERROR_IPSEC_THROTTLE_DROP 0x0000365E -#define ERROR_IPSEC_DOSP_BLOCK 0x00003665 -#define ERROR_IPSEC_DOSP_RECEIVED_MULTICAST 0x00003666 -#define ERROR_IPSEC_DOSP_INVALID_PACKET 0x00003667 -#define ERROR_IPSEC_DOSP_STATE_LOOKUP_FAILED 0x00003668 -#define ERROR_IPSEC_DOSP_MAX_ENTRIES 0x00003669 -#define ERROR_IPSEC_DOSP_KEYMOD_NOT_ALLOWED 0x0000366A -#define ERROR_IPSEC_DOSP_NOT_INSTALLED 0x0000366B -#define ERROR_IPSEC_DOSP_MAX_PER_IP_RATELIMIT_QUEUES 0x0000366C -#define ERROR_SXS_SECTION_NOT_FOUND 0x000036B0 -#define ERROR_SXS_CANT_GEN_ACTCTX 0x000036B1 -#define ERROR_SXS_INVALID_ACTCTXDATA_FORMAT 0x000036B2 -#define ERROR_SXS_ASSEMBLY_NOT_FOUND 0x000036B3 -#define ERROR_SXS_MANIFEST_FORMAT_ERROR 0x000036B4 -#define ERROR_SXS_MANIFEST_PARSE_ERROR 0x000036B5 -#define ERROR_SXS_ACTIVATION_CONTEXT_DISABLED 0x000036B6 -#define ERROR_SXS_KEY_NOT_FOUND 0x000036B7 -#define ERROR_SXS_VERSION_CONFLICT 0x000036B8 -#define ERROR_SXS_WRONG_SECTION_TYPE 0x000036B9 -#define ERROR_SXS_THREAD_QUERIES_DISABLED 0x000036BA -#define ERROR_SXS_PROCESS_DEFAULT_ALREADY_SET 0x000036BB -#define ERROR_SXS_UNKNOWN_ENCODING_GROUP 0x000036BC -#define ERROR_SXS_UNKNOWN_ENCODING 0x000036BD -#define ERROR_SXS_INVALID_XML_NAMESPACE_URI 0x000036BE -#define ERROR_SXS_ROOT_MANIFEST_DEPENDENCY_NOT_INSTALLED 0x000036BF -#define ERROR_SXS_LEAF_MANIFEST_DEPENDENCY_NOT_INSTALLED 0x000036C0 -#define ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE 0x000036C1 -#define ERROR_SXS_MANIFEST_MISSING_REQUIRED_DEFAULT_NAMESPACE 0x000036C2 -#define ERROR_SXS_MANIFEST_INVALID_REQUIRED_DEFAULT_NAMESPACE 0x000036C3 -#define ERROR_SXS_PRIVATE_MANIFEST_CROSS_PATH_WITH_REPARSE_POINT 0x000036C4 -#define ERROR_SXS_DUPLICATE_DLL_NAME 0x000036C5 -#define ERROR_SXS_DUPLICATE_WINDOWCLASS_NAME 0x000036C6 -#define ERROR_SXS_DUPLICATE_CLSID 0x000036C7 -#define ERROR_SXS_DUPLICATE_IID 0x000036C8 -#define ERROR_SXS_DUPLICATE_TLBID 0x000036C9 -#define ERROR_SXS_DUPLICATE_PROGID 0x000036CA -#define ERROR_SXS_DUPLICATE_ASSEMBLY_NAME 0x000036CB -#define ERROR_SXS_FILE_HASH_MISMATCH 0x000036CC -#define ERROR_SXS_POLICY_PARSE_ERROR 0x000036CD -#define ERROR_SXS_XML_E_MISSINGQUOTE 0x000036CE -#define ERROR_SXS_XML_E_COMMENTSYNTAX 0x000036CF -#define ERROR_SXS_XML_E_BADSTARTNAMECHAR 0x000036D0 -#define ERROR_SXS_XML_E_BADNAMECHAR 0x000036D1 -#define ERROR_SXS_XML_E_BADCHARINSTRING 0x000036D2 -#define ERROR_SXS_XML_E_XMLDECLSYNTAX 0x000036D3 -#define ERROR_SXS_XML_E_BADCHARDATA 0x000036D4 -#define ERROR_SXS_XML_E_MISSINGWHITESPACE 0x000036D5 -#define ERROR_SXS_XML_E_EXPECTINGTAGEND 0x000036D6 -#define ERROR_SXS_XML_E_MISSINGSEMICOLON 0x000036D7 -#define ERROR_SXS_XML_E_UNBALANCEDPAREN 0x000036D8 -#define ERROR_SXS_XML_E_INTERNALERROR 0x000036D9 -#define ERROR_SXS_XML_E_UNEXPECTED_WHITESPACE 0x000036DA -#define ERROR_SXS_XML_E_INCOMPLETE_ENCODING 0x000036DB -#define ERROR_SXS_XML_E_MISSING_PAREN 0x000036DC -#define ERROR_SXS_XML_E_EXPECTINGCLOSEQUOTE 0x000036DD -#define ERROR_SXS_XML_E_MULTIPLE_COLONS 0x000036DE -#define ERROR_SXS_XML_E_INVALID_DECIMAL 0x000036DF -#define ERROR_SXS_XML_E_INVALID_HEXIDECIMAL 0x000036E0 -#define ERROR_SXS_XML_E_INVALID_UNICODE 0x000036E1 -#define ERROR_SXS_XML_E_WHITESPACEORQUESTIONMARK 0x000036E2 -#define ERROR_SXS_XML_E_UNEXPECTEDENDTAG 0x000036E3 -#define ERROR_SXS_XML_E_UNCLOSEDTAG 0x000036E4 -#define ERROR_SXS_XML_E_DUPLICATEATTRIBUTE 0x000036E5 -#define ERROR_SXS_XML_E_MULTIPLEROOTS 0x000036E6 -#define ERROR_SXS_XML_E_INVALIDATROOTLEVEL 0x000036E7 -#define ERROR_SXS_XML_E_BADXMLDECL 0x000036E8 -#define ERROR_SXS_XML_E_MISSINGROOT 0x000036E9 -#define ERROR_SXS_XML_E_UNEXPECTEDEOF 0x000036EA -#define ERROR_SXS_XML_E_BADPEREFINSUBSET 0x000036EB -#define ERROR_SXS_XML_E_UNCLOSEDSTARTTAG 0x000036EC -#define ERROR_SXS_XML_E_UNCLOSEDENDTAG 0x000036ED -#define ERROR_SXS_XML_E_UNCLOSEDSTRING 0x000036EE -#define ERROR_SXS_XML_E_UNCLOSEDCOMMENT 0x000036EF -#define ERROR_SXS_XML_E_UNCLOSEDDECL 0x000036F0 -#define ERROR_SXS_XML_E_UNCLOSEDCDATA 0x000036F1 -#define ERROR_SXS_XML_E_RESERVEDNAMESPACE 0x000036F2 -#define ERROR_SXS_XML_E_INVALIDENCODING 0x000036F3 -#define ERROR_SXS_XML_E_INVALIDSWITCH 0x000036F4 -#define ERROR_SXS_XML_E_BADXMLCASE 0x000036F5 -#define ERROR_SXS_XML_E_INVALID_STANDALONE 0x000036F6 -#define ERROR_SXS_XML_E_UNEXPECTED_STANDALONE 0x000036F7 -#define ERROR_SXS_XML_E_INVALID_VERSION 0x000036F8 -#define ERROR_SXS_XML_E_MISSINGEQUALS 0x000036F9 -#define ERROR_SXS_PROTECTION_RECOVERY_FAILED 0x000036FA -#define ERROR_SXS_PROTECTION_PUBLIC_KEY_TOO_SHORT 0x000036FB -#define ERROR_SXS_PROTECTION_CATALOG_NOT_VALID 0x000036FC -#define ERROR_SXS_UNTRANSLATABLE_HRESULT 0x000036FD -#define ERROR_SXS_PROTECTION_CATALOG_FILE_MISSING 0x000036FE -#define ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE 0x000036FF -#define ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME 0x00003700 -#define ERROR_SXS_ASSEMBLY_MISSING 0x00003701 -#define ERROR_SXS_CORRUPT_ACTIVATION_STACK 0x00003702 -#define ERROR_SXS_CORRUPTION 0x00003703 -#define ERROR_SXS_EARLY_DEACTIVATION 0x00003704 -#define ERROR_SXS_INVALID_DEACTIVATION 0x00003705 -#define ERROR_SXS_MULTIPLE_DEACTIVATION 0x00003706 -#define ERROR_SXS_PROCESS_TERMINATION_REQUESTED 0x00003707 -#define ERROR_SXS_RELEASE_ACTIVATION_CONTEXT 0x00003708 -#define ERROR_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY 0x00003709 -#define ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE 0x0000370A -#define ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME 0x0000370B -#define ERROR_SXS_IDENTITY_DUPLICATE_ATTRIBUTE 0x0000370C -#define ERROR_SXS_IDENTITY_PARSE_ERROR 0x0000370D -#define ERROR_MALFORMED_SUBSTITUTION_STRING 0x0000370E -#define ERROR_SXS_INCORRECT_PUBLIC_KEY_TOKEN 0x0000370F -#define ERROR_UNMAPPED_SUBSTITUTION_STRING 0x00003710 -#define ERROR_SXS_ASSEMBLY_NOT_LOCKED 0x00003711 -#define ERROR_SXS_COMPONENT_STORE_CORRUPT 0x00003712 -#define ERROR_ADVANCED_INSTALLER_FAILED 0x00003713 -#define ERROR_XML_ENCODING_MISMATCH 0x00003714 -#define ERROR_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT 0x00003715 -#define ERROR_SXS_IDENTITIES_DIFFERENT 0x00003716 -#define ERROR_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT 0x00003717 -#define ERROR_SXS_FILE_NOT_PART_OF_ASSEMBLY 0x00003718 -#define ERROR_SXS_MANIFEST_TOO_BIG 0x00003719 -#define ERROR_SXS_SETTING_NOT_REGISTERED 0x0000371A -#define ERROR_SXS_TRANSACTION_CLOSURE_INCOMPLETE 0x0000371B -#define ERROR_SMI_PRIMITIVE_INSTALLER_FAILED 0x0000371C -#define ERROR_GENERIC_COMMAND_FAILED 0x0000371D -#define ERROR_SXS_FILE_HASH_MISSING 0x0000371E -#define ERROR_EVT_INVALID_CHANNEL_PATH 0x00003A98 -#define ERROR_EVT_INVALID_QUERY 0x00003A99 -#define ERROR_EVT_PUBLISHER_METADATA_NOT_FOUND 0x00003A9A -#define ERROR_EVT_EVENT_TEMPLATE_NOT_FOUND 0x00003A9B -#define ERROR_EVT_INVALID_PUBLISHER_NAME 0x00003A9C -#define ERROR_EVT_INVALID_EVENT_DATA 0x00003A9D -#define ERROR_EVT_CHANNEL_NOT_FOUND 0x00003A9F -#define ERROR_EVT_MALFORMED_XML_TEXT 0x00003AA0 -#define ERROR_EVT_SUBSCRIPTION_TO_DIRECT_CHANNEL 0x00003AA1 -#define ERROR_EVT_CONFIGURATION_ERROR 0x00003AA2 -#define ERROR_EVT_QUERY_RESULT_STALE 0x00003AA3 -#define ERROR_EVT_QUERY_RESULT_INVALID_POSITION 0x00003AA4 -#define ERROR_EVT_NON_VALIDATING_MSXML 0x00003AA5 -#define ERROR_EVT_FILTER_ALREADYSCOPED 0x00003AA6 -#define ERROR_EVT_FILTER_NOTELTSET 0x00003AA7 -#define ERROR_EVT_FILTER_INVARG 0x00003AA8 -#define ERROR_EVT_FILTER_INVTEST 0x00003AA9 -#define ERROR_EVT_FILTER_INVTYPE 0x00003AAA -#define ERROR_EVT_FILTER_PARSEERR 0x00003AAB -#define ERROR_EVT_FILTER_UNSUPPORTEDOP 0x00003AAC -#define ERROR_EVT_FILTER_UNEXPECTEDTOKEN 0x00003AAD -#define ERROR_EVT_INVALID_OPERATION_OVER_ENABLED_DIRECT_CHANNEL 0x00003AAE -#define ERROR_EVT_INVALID_CHANNEL_PROPERTY_VALUE 0x00003AAF -#define ERROR_EVT_INVALID_PUBLISHER_PROPERTY_VALUE 0x00003AB0 -#define ERROR_EVT_CHANNEL_CANNOT_ACTIVATE 0x00003AB1 -#define ERROR_EVT_FILTER_TOO_COMPLEX 0x00003AB2 -#define ERROR_EVT_MESSAGE_NOT_FOUND 0x00003AB3 -#define ERROR_EVT_MESSAGE_ID_NOT_FOUND 0x00003AB4 -#define ERROR_EVT_UNRESOLVED_VALUE_INSERT 0x00003AB5 -#define ERROR_EVT_UNRESOLVED_PARAMETER_INSERT 0x00003AB6 -#define ERROR_EVT_MAX_INSERTS_REACHED 0x00003AB7 -#define ERROR_EVT_EVENT_DEFINITION_NOT_FOUND 0x00003AB8 -#define ERROR_EVT_MESSAGE_LOCALE_NOT_FOUND 0x00003AB9 -#define ERROR_EVT_VERSION_TOO_OLD 0x00003ABA -#define ERROR_EVT_VERSION_TOO_NEW 0x00003ABB -#define ERROR_EVT_CANNOT_OPEN_CHANNEL_OF_QUERY 0x00003ABC -#define ERROR_EVT_PUBLISHER_DISABLED 0x00003ABD -#define ERROR_EVT_FILTER_OUT_OF_RANGE 0x00003ABE -#define ERROR_EC_SUBSCRIPTION_CANNOT_ACTIVATE 0x00003AE8 -#define ERROR_EC_LOG_DISABLED 0x00003AE9 -#define ERROR_EC_CIRCULAR_FORWARDING 0x00003AEA -#define ERROR_EC_CREDSTORE_FULL 0x00003AEB -#define ERROR_EC_CRED_NOT_FOUND 0x00003AEC -#define ERROR_EC_NO_ACTIVE_CHANNEL 0x00003AED -#define ERROR_MUI_FILE_NOT_FOUND 0x00003AFC -#define ERROR_MUI_INVALID_FILE 0x00003AFD -#define ERROR_MUI_INVALID_RC_CONFIG 0x00003AFE -#define ERROR_MUI_INVALID_LOCALE_NAME 0x00003AFF -#define ERROR_MUI_INVALID_ULTIMATEFALLBACK_NAME 0x00003B00 -#define ERROR_MUI_FILE_NOT_LOADED 0x00003B01 -#define ERROR_RESOURCE_ENUM_USER_STOP 0x00003B02 -#define ERROR_MUI_INTLSETTINGS_UILANG_NOT_INSTALLED 0x00003B03 -#define ERROR_MUI_INTLSETTINGS_INVALID_LOCALE_NAME 0x00003B04 -#define ERROR_MRM_RUNTIME_NO_DEFAULT_OR_NEUTRAL_RESOURCE 0x00003B06 -#define ERROR_MRM_INVALID_PRICONFIG 0x00003B07 -#define ERROR_MRM_INVALID_FILE_TYPE 0x00003B08 -#define ERROR_MRM_UNKNOWN_QUALIFIER 0x00003B09 -#define ERROR_MRM_INVALID_QUALIFIER_VALUE 0x00003B0A -#define ERROR_MRM_NO_CANDIDATE 0x00003B0B -#define ERROR_MRM_NO_MATCH_OR_DEFAULT_CANDIDATE 0x00003B0C -#define ERROR_MRM_RESOURCE_TYPE_MISMATCH 0x00003B0D -#define ERROR_MRM_DUPLICATE_MAP_NAME 0x00003B0E -#define ERROR_MRM_DUPLICATE_ENTRY 0x00003B0F -#define ERROR_MRM_INVALID_RESOURCE_IDENTIFIER 0x00003B10 -#define ERROR_MRM_FILEPATH_TOO_LONG 0x00003B11 -#define ERROR_MRM_UNSUPPORTED_DIRECTORY_TYPE 0x00003B12 -#define ERROR_MRM_INVALID_PRI_FILE 0x00003B16 -#define ERROR_MRM_NAMED_RESOURCE_NOT_FOUND 0x00003B17 -#define ERROR_MRM_MAP_NOT_FOUND 0x00003B1F -#define ERROR_MRM_UNSUPPORTED_PROFILE_TYPE 0x00003B20 -#define ERROR_MRM_INVALID_QUALIFIER_OPERATOR 0x00003B21 -#define ERROR_MRM_INDETERMINATE_QUALIFIER_VALUE 0x00003B22 -#define ERROR_MRM_AUTOMERGE_ENABLED 0x00003B23 -#define ERROR_MRM_TOO_MANY_RESOURCES 0x00003B24 -#define ERROR_MCA_INVALID_CAPABILITIES_STRING 0x00003B60 -#define ERROR_MCA_INVALID_VCP_VERSION 0x00003B61 -#define ERROR_MCA_MONITOR_VIOLATES_MCCS_SPECIFICATION 0x00003B62 -#define ERROR_MCA_MCCS_VERSION_MISMATCH 0x00003B63 -#define ERROR_MCA_UNSUPPORTED_MCCS_VERSION 0x00003B64 -#define ERROR_MCA_INTERNAL_ERROR 0x00003B65 -#define ERROR_MCA_INVALID_TECHNOLOGY_TYPE_RETURNED 0x00003B66 -#define ERROR_MCA_UNSUPPORTED_COLOR_TEMPERATURE 0x00003B67 -#define ERROR_AMBIGUOUS_SYSTEM_DEVICE 0x00003B92 -#define ERROR_SYSTEM_DEVICE_NOT_FOUND 0x00003BC3 -#define ERROR_HASH_NOT_SUPPORTED 0x00003BC4 -#define ERROR_HASH_NOT_PRESENT 0x00003BC5 -#define ERROR_SECONDARY_IC_PROVIDER_NOT_REGISTERED 0x00003BD9 -#define ERROR_GPIO_CLIENT_INFORMATION_INVALID 0x00003BDA -#define ERROR_GPIO_VERSION_NOT_SUPPORTED 0x00003BDB -#define ERROR_GPIO_INVALID_REGISTRATION_PACKET 0x00003BDC -#define ERROR_GPIO_OPERATION_DENIED 0x00003BDD -#define ERROR_GPIO_INCOMPATIBLE_CONNECT_MODE 0x00003BDE -#define ERROR_GPIO_INTERRUPT_ALREADY_UNMASKED 0x00003BDF -#define ERROR_CANNOT_SWITCH_RUNLEVEL 0x00003C28 -#define ERROR_INVALID_RUNLEVEL_SETTING 0x00003C29 -#define ERROR_RUNLEVEL_SWITCH_TIMEOUT 0x00003C2A -#define ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT 0x00003C2B -#define ERROR_RUNLEVEL_SWITCH_IN_PROGRESS 0x00003C2C -#define ERROR_SERVICES_FAILED_AUTOSTART 0x00003C2D -#define ERROR_COM_TASK_STOP_PENDING 0x00003C8D -#define ERROR_INSTALL_OPEN_PACKAGE_FAILED 0x00003CF0 -#define ERROR_INSTALL_PACKAGE_NOT_FOUND 0x00003CF1 -#define ERROR_INSTALL_INVALID_PACKAGE 0x00003CF2 -#define ERROR_INSTALL_RESOLVE_DEPENDENCY_FAILED 0x00003CF3 -#define ERROR_INSTALL_OUT_OF_DISK_SPACE 0x00003CF4 -#define ERROR_INSTALL_NETWORK_FAILURE 0x00003CF5 -#define ERROR_INSTALL_REGISTRATION_FAILURE 0x00003CF6 -#define ERROR_INSTALL_DEREGISTRATION_FAILURE 0x00003CF7 -#define ERROR_INSTALL_CANCEL 0x00003CF8 -#define ERROR_INSTALL_FAILED 0x00003CF9 -#define ERROR_REMOVE_FAILED 0x00003CFA -#define ERROR_PACKAGE_ALREADY_EXISTS 0x00003CFB -#define ERROR_NEEDS_REMEDIATION 0x00003CFC -#define ERROR_INSTALL_PREREQUISITE_FAILED 0x00003CFD -#define ERROR_PACKAGE_REPOSITORY_CORRUPTED 0x00003CFE -#define ERROR_INSTALL_POLICY_FAILURE 0x00003CFF -#define ERROR_PACKAGE_UPDATING 0x00003D00 -#define ERROR_DEPLOYMENT_BLOCKED_BY_POLICY 0x00003D01 -#define ERROR_PACKAGES_IN_USE 0x00003D02 -#define ERROR_RECOVERY_FILE_CORRUPT 0x00003D03 -#define ERROR_INVALID_STAGED_SIGNATURE 0x00003D04 -#define ERROR_DELETING_EXISTING_APPLICATIONDATA_STORE_FAILED 0x00003D05 -#define ERROR_INSTALL_PACKAGE_DOWNGRADE 0x00003D06 -#define ERROR_SYSTEM_NEEDS_REMEDIATION 0x00003D07 -#define ERROR_APPX_INTEGRITY_FAILURE_CLR_NGEN 0x00003D08 -#define ERROR_RESILIENCY_FILE_CORRUPT 0x00003D09 -#define ERROR_INSTALL_FIREWALL_SERVICE_NOT_RUNNING 0x00003D0A -#define APPMODEL_ERROR_NO_PACKAGE 0x00003D54 -#define APPMODEL_ERROR_PACKAGE_RUNTIME_CORRUPT 0x00003D55 -#define APPMODEL_ERROR_PACKAGE_IDENTITY_CORRUPT 0x00003D56 -#define APPMODEL_ERROR_NO_APPLICATION 0x00003D57 -#define ERROR_STATE_LOAD_STORE_FAILED 0x00003DB8 -#define ERROR_STATE_GET_VERSION_FAILED 0x00003DB9 -#define ERROR_STATE_SET_VERSION_FAILED 0x00003DBA -#define ERROR_STATE_STRUCTURED_RESET_FAILED 0x00003DBB -#define ERROR_STATE_OPEN_CONTAINER_FAILED 0x00003DBC -#define ERROR_STATE_CREATE_CONTAINER_FAILED 0x00003DBD -#define ERROR_STATE_DELETE_CONTAINER_FAILED 0x00003DBE -#define ERROR_STATE_READ_SETTING_FAILED 0x00003DBF -#define ERROR_STATE_WRITE_SETTING_FAILED 0x00003DC0 -#define ERROR_STATE_DELETE_SETTING_FAILED 0x00003DC1 -#define ERROR_STATE_QUERY_SETTING_FAILED 0x00003DC2 -#define ERROR_STATE_READ_COMPOSITE_SETTING_FAILED 0x00003DC3 -#define ERROR_STATE_WRITE_COMPOSITE_SETTING_FAILED 0x00003DC4 -#define ERROR_STATE_ENUMERATE_CONTAINER_FAILED 0x00003DC5 -#define ERROR_STATE_ENUMERATE_SETTINGS_FAILED 0x00003DC6 -#define ERROR_STATE_COMPOSITE_SETTING_VALUE_SIZE_LIMIT_EXCEEDED 0x00003DC7 -#define ERROR_STATE_SETTING_VALUE_SIZE_LIMIT_EXCEEDED 0x00003DC8 -#define ERROR_STATE_SETTING_NAME_SIZE_LIMIT_EXCEEDED 0x00003DC9 -#define ERROR_STATE_CONTAINER_NAME_SIZE_LIMIT_EXCEEDED 0x00003DCA -#define ERROR_API_UNAVAILABLE 0x00003DE1 +#define ERROR_IPSEC_QM_POLICY_EXISTS 0x000032C8 +#define ERROR_IPSEC_QM_POLICY_NOT_FOUND 0x000032C9 +#define ERROR_IPSEC_QM_POLICY_IN_USE 0x000032CA +#define ERROR_IPSEC_MM_POLICY_EXISTS 0x000032CB +#define ERROR_IPSEC_MM_POLICY_NOT_FOUND 0x000032CC +#define ERROR_IPSEC_MM_POLICY_IN_USE 0x000032CD +#define ERROR_IPSEC_MM_FILTER_EXISTS 0x000032CE +#define ERROR_IPSEC_MM_FILTER_NOT_FOUND 0x000032CF +#define ERROR_IPSEC_TRANSPORT_FILTER_EXISTS 0x000032D0 +#define ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND 0x000032D1 +#define ERROR_IPSEC_MM_AUTH_EXISTS 0x000032D2 +#define ERROR_IPSEC_MM_AUTH_NOT_FOUND 0x000032D3 +#define ERROR_IPSEC_MM_AUTH_IN_USE 0x000032D4 +#define ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND 0x000032D5 +#define ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND 0x000032D6 +#define ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND 0x000032D7 +#define ERROR_IPSEC_TUNNEL_FILTER_EXISTS 0x000032D8 +#define ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND 0x000032D9 +#define ERROR_IPSEC_MM_FILTER_PENDING_DELETION 0x000032DA +#define ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION 0x000032DB +#define ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION 0x000032DC +#define ERROR_IPSEC_MM_POLICY_PENDING_DELETION 0x000032DD +#define ERROR_IPSEC_MM_AUTH_PENDING_DELETION 0x000032DE +#define ERROR_IPSEC_QM_POLICY_PENDING_DELETION 0x000032DF +#define WARNING_IPSEC_MM_POLICY_PRUNED 0x000032E0 +#define WARNING_IPSEC_QM_POLICY_PRUNED 0x000032E1 +#define ERROR_IPSEC_IKE_NEG_STATUS_BEGIN 0x000035E8 +#define ERROR_IPSEC_IKE_AUTH_FAIL 0x000035E9 +#define ERROR_IPSEC_IKE_ATTRIB_FAIL 0x000035EA +#define ERROR_IPSEC_IKE_NEGOTIATION_PENDING 0x000035EB +#define ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR 0x000035EC +#define ERROR_IPSEC_IKE_TIMED_OUT 0x000035ED +#define ERROR_IPSEC_IKE_NO_CERT 0x000035EE +#define ERROR_IPSEC_IKE_SA_DELETED 0x000035EF +#define ERROR_IPSEC_IKE_SA_REAPED 0x000035F0 +#define ERROR_IPSEC_IKE_MM_ACQUIRE_DROP 0x000035F1 +#define ERROR_IPSEC_IKE_QM_ACQUIRE_DROP 0x000035F2 +#define ERROR_IPSEC_IKE_QUEUE_DROP_MM 0x000035F3 +#define ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM 0x000035F4 +#define ERROR_IPSEC_IKE_DROP_NO_RESPONSE 0x000035F5 +#define ERROR_IPSEC_IKE_MM_DELAY_DROP 0x000035F6 +#define ERROR_IPSEC_IKE_QM_DELAY_DROP 0x000035F7 +#define ERROR_IPSEC_IKE_ERROR 0x000035F8 +#define ERROR_IPSEC_IKE_CRL_FAILED 0x000035F9 +#define ERROR_IPSEC_IKE_INVALID_KEY_USAGE 0x000035FA +#define ERROR_IPSEC_IKE_INVALID_CERT_TYPE 0x000035FB +#define ERROR_IPSEC_IKE_NO_PRIVATE_KEY 0x000035FC +#define ERROR_IPSEC_IKE_SIMULTANEOUS_REKEY 0x000035FD +#define ERROR_IPSEC_IKE_DH_FAIL 0x000035FE +#define ERROR_IPSEC_IKE_CRITICAL_PAYLOAD_NOT_RECOGNIZED 0x000035FF +#define ERROR_IPSEC_IKE_INVALID_HEADER 0x00003600 +#define ERROR_IPSEC_IKE_NO_POLICY 0x00003601 +#define ERROR_IPSEC_IKE_INVALID_SIGNATURE 0x00003602 +#define ERROR_IPSEC_IKE_KERBEROS_ERROR 0x00003603 +#define ERROR_IPSEC_IKE_NO_PUBLIC_KEY 0x00003604 +#define ERROR_IPSEC_IKE_PROCESS_ERR 0x00003605 +#define ERROR_IPSEC_IKE_PROCESS_ERR_SA 0x00003606 +#define ERROR_IPSEC_IKE_PROCESS_ERR_PROP 0x00003607 +#define ERROR_IPSEC_IKE_PROCESS_ERR_TRANS 0x00003608 +#define ERROR_IPSEC_IKE_PROCESS_ERR_KE 0x00003609 +#define ERROR_IPSEC_IKE_PROCESS_ERR_ID 0x0000360A +#define ERROR_IPSEC_IKE_PROCESS_ERR_CERT 0x0000360B +#define ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ 0x0000360C +#define ERROR_IPSEC_IKE_PROCESS_ERR_HASH 0x0000360D +#define ERROR_IPSEC_IKE_PROCESS_ERR_SIG 0x0000360E +#define ERROR_IPSEC_IKE_PROCESS_ERR_NONCE 0x0000360F +#define ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY 0x00003610 +#define ERROR_IPSEC_IKE_PROCESS_ERR_DELETE 0x00003611 +#define ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR 0x00003612 +#define ERROR_IPSEC_IKE_INVALID_PAYLOAD 0x00003613 +#define ERROR_IPSEC_IKE_LOAD_SOFT_SA 0x00003614 +#define ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN 0x00003615 +#define ERROR_IPSEC_IKE_INVALID_COOKIE 0x00003616 +#define ERROR_IPSEC_IKE_NO_PEER_CERT 0x00003617 +#define ERROR_IPSEC_IKE_PEER_CRL_FAILED 0x00003618 +#define ERROR_IPSEC_IKE_POLICY_CHANGE 0x00003619 +#define ERROR_IPSEC_IKE_NO_MM_POLICY 0x0000361A +#define ERROR_IPSEC_IKE_NOTCBPRIV 0x0000361B +#define ERROR_IPSEC_IKE_SECLOADFAIL 0x0000361C +#define ERROR_IPSEC_IKE_FAILSSPINIT 0x0000361D +#define ERROR_IPSEC_IKE_FAILQUERYSSP 0x0000361E +#define ERROR_IPSEC_IKE_SRVACQFAIL 0x0000361F +#define ERROR_IPSEC_IKE_SRVQUERYCRED 0x00003620 +#define ERROR_IPSEC_IKE_GETSPIFAIL 0x00003621 +#define ERROR_IPSEC_IKE_INVALID_FILTER 0x00003622 +#define ERROR_IPSEC_IKE_OUT_OF_MEMORY 0x00003623 +#define ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED 0x00003624 +#define ERROR_IPSEC_IKE_INVALID_POLICY 0x00003625 +#define ERROR_IPSEC_IKE_UNKNOWN_DOI 0x00003626 +#define ERROR_IPSEC_IKE_INVALID_SITUATION 0x00003627 +#define ERROR_IPSEC_IKE_DH_FAILURE 0x00003628 +#define ERROR_IPSEC_IKE_INVALID_GROUP 0x00003629 +#define ERROR_IPSEC_IKE_ENCRYPT 0x0000362A +#define ERROR_IPSEC_IKE_DECRYPT 0x0000362B +#define ERROR_IPSEC_IKE_POLICY_MATCH 0x0000362C +#define ERROR_IPSEC_IKE_UNSUPPORTED_ID 0x0000362D +#define ERROR_IPSEC_IKE_INVALID_HASH 0x0000362E +#define ERROR_IPSEC_IKE_INVALID_HASH_ALG 0x0000362F +#define ERROR_IPSEC_IKE_INVALID_HASH_SIZE 0x00003630 +#define ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG 0x00003631 +#define ERROR_IPSEC_IKE_INVALID_AUTH_ALG 0x00003632 +#define ERROR_IPSEC_IKE_INVALID_SIG 0x00003633 +#define ERROR_IPSEC_IKE_LOAD_FAILED 0x00003634 +#define ERROR_IPSEC_IKE_RPC_DELETE 0x00003635 +#define ERROR_IPSEC_IKE_BENIGN_REINIT 0x00003636 +#define ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY 0x00003637 +#define ERROR_IPSEC_IKE_INVALID_MAJOR_VERSION 0x00003638 +#define ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN 0x00003639 +#define ERROR_IPSEC_IKE_MM_LIMIT 0x0000363A +#define ERROR_IPSEC_IKE_NEGOTIATION_DISABLED 0x0000363B +#define ERROR_IPSEC_IKE_QM_LIMIT 0x0000363C +#define ERROR_IPSEC_IKE_MM_EXPIRED 0x0000363D +#define ERROR_IPSEC_IKE_PEER_MM_ASSUMED_INVALID 0x0000363E +#define ERROR_IPSEC_IKE_CERT_CHAIN_POLICY_MISMATCH 0x0000363F +#define ERROR_IPSEC_IKE_UNEXPECTED_MESSAGE_ID 0x00003640 +#define ERROR_IPSEC_IKE_INVALID_AUTH_PAYLOAD 0x00003641 +#define ERROR_IPSEC_IKE_DOS_COOKIE_SENT 0x00003642 +#define ERROR_IPSEC_IKE_SHUTTING_DOWN 0x00003643 +#define ERROR_IPSEC_IKE_CGA_AUTH_FAILED 0x00003644 +#define ERROR_IPSEC_IKE_PROCESS_ERR_NATOA 0x00003645 +#define ERROR_IPSEC_IKE_INVALID_MM_FOR_QM 0x00003646 +#define ERROR_IPSEC_IKE_QM_EXPIRED 0x00003647 +#define ERROR_IPSEC_IKE_TOO_MANY_FILTERS 0x00003648 +#define ERROR_IPSEC_IKE_NEG_STATUS_END 0x00003649 +#define ERROR_IPSEC_IKE_KILL_DUMMY_NAP_TUNNEL 0x0000364A +#define ERROR_IPSEC_IKE_INNER_IP_ASSIGNMENT_FAILURE 0x0000364B +#define ERROR_IPSEC_IKE_REQUIRE_CP_PAYLOAD_MISSING 0x0000364C +#define ERROR_IPSEC_KEY_MODULE_IMPERSONATION_NEGOTIATION_PENDING 0x0000364D +#define ERROR_IPSEC_IKE_COEXISTENCE_SUPPRESS 0x0000364E +#define ERROR_IPSEC_IKE_RATELIMIT_DROP 0x0000364F +#define ERROR_IPSEC_IKE_PEER_DOESNT_SUPPORT_MOBIKE 0x00003650 +#define ERROR_IPSEC_IKE_AUTHORIZATION_FAILURE 0x00003651 +#define ERROR_IPSEC_IKE_STRONG_CRED_AUTHORIZATION_FAILURE 0x00003652 +#define ERROR_IPSEC_IKE_AUTHORIZATION_FAILURE_WITH_OPTIONAL_RETRY 0x00003653 +#define ERROR_IPSEC_IKE_STRONG_CRED_AUTHORIZATION_AND_CERTMAP_FAILURE 0x00003654 +#define ERROR_IPSEC_IKE_NEG_STATUS_EXTENDED_END 0x00003655 +#define ERROR_IPSEC_BAD_SPI 0x00003656 +#define ERROR_IPSEC_SA_LIFETIME_EXPIRED 0x00003657 +#define ERROR_IPSEC_WRONG_SA 0x00003658 +#define ERROR_IPSEC_REPLAY_CHECK_FAILED 0x00003659 +#define ERROR_IPSEC_INVALID_PACKET 0x0000365A +#define ERROR_IPSEC_INTEGRITY_CHECK_FAILED 0x0000365B +#define ERROR_IPSEC_CLEAR_TEXT_DROP 0x0000365C +#define ERROR_IPSEC_AUTH_FIREWALL_DROP 0x0000365D +#define ERROR_IPSEC_THROTTLE_DROP 0x0000365E +#define ERROR_IPSEC_DOSP_BLOCK 0x00003665 +#define ERROR_IPSEC_DOSP_RECEIVED_MULTICAST 0x00003666 +#define ERROR_IPSEC_DOSP_INVALID_PACKET 0x00003667 +#define ERROR_IPSEC_DOSP_STATE_LOOKUP_FAILED 0x00003668 +#define ERROR_IPSEC_DOSP_MAX_ENTRIES 0x00003669 +#define ERROR_IPSEC_DOSP_KEYMOD_NOT_ALLOWED 0x0000366A +#define ERROR_IPSEC_DOSP_NOT_INSTALLED 0x0000366B +#define ERROR_IPSEC_DOSP_MAX_PER_IP_RATELIMIT_QUEUES 0x0000366C +#define ERROR_SXS_SECTION_NOT_FOUND 0x000036B0 +#define ERROR_SXS_CANT_GEN_ACTCTX 0x000036B1 +#define ERROR_SXS_INVALID_ACTCTXDATA_FORMAT 0x000036B2 +#define ERROR_SXS_ASSEMBLY_NOT_FOUND 0x000036B3 +#define ERROR_SXS_MANIFEST_FORMAT_ERROR 0x000036B4 +#define ERROR_SXS_MANIFEST_PARSE_ERROR 0x000036B5 +#define ERROR_SXS_ACTIVATION_CONTEXT_DISABLED 0x000036B6 +#define ERROR_SXS_KEY_NOT_FOUND 0x000036B7 +#define ERROR_SXS_VERSION_CONFLICT 0x000036B8 +#define ERROR_SXS_WRONG_SECTION_TYPE 0x000036B9 +#define ERROR_SXS_THREAD_QUERIES_DISABLED 0x000036BA +#define ERROR_SXS_PROCESS_DEFAULT_ALREADY_SET 0x000036BB +#define ERROR_SXS_UNKNOWN_ENCODING_GROUP 0x000036BC +#define ERROR_SXS_UNKNOWN_ENCODING 0x000036BD +#define ERROR_SXS_INVALID_XML_NAMESPACE_URI 0x000036BE +#define ERROR_SXS_ROOT_MANIFEST_DEPENDENCY_NOT_INSTALLED 0x000036BF +#define ERROR_SXS_LEAF_MANIFEST_DEPENDENCY_NOT_INSTALLED 0x000036C0 +#define ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE 0x000036C1 +#define ERROR_SXS_MANIFEST_MISSING_REQUIRED_DEFAULT_NAMESPACE 0x000036C2 +#define ERROR_SXS_MANIFEST_INVALID_REQUIRED_DEFAULT_NAMESPACE 0x000036C3 +#define ERROR_SXS_PRIVATE_MANIFEST_CROSS_PATH_WITH_REPARSE_POINT 0x000036C4 +#define ERROR_SXS_DUPLICATE_DLL_NAME 0x000036C5 +#define ERROR_SXS_DUPLICATE_WINDOWCLASS_NAME 0x000036C6 +#define ERROR_SXS_DUPLICATE_CLSID 0x000036C7 +#define ERROR_SXS_DUPLICATE_IID 0x000036C8 +#define ERROR_SXS_DUPLICATE_TLBID 0x000036C9 +#define ERROR_SXS_DUPLICATE_PROGID 0x000036CA +#define ERROR_SXS_DUPLICATE_ASSEMBLY_NAME 0x000036CB +#define ERROR_SXS_FILE_HASH_MISMATCH 0x000036CC +#define ERROR_SXS_POLICY_PARSE_ERROR 0x000036CD +#define ERROR_SXS_XML_E_MISSINGQUOTE 0x000036CE +#define ERROR_SXS_XML_E_COMMENTSYNTAX 0x000036CF +#define ERROR_SXS_XML_E_BADSTARTNAMECHAR 0x000036D0 +#define ERROR_SXS_XML_E_BADNAMECHAR 0x000036D1 +#define ERROR_SXS_XML_E_BADCHARINSTRING 0x000036D2 +#define ERROR_SXS_XML_E_XMLDECLSYNTAX 0x000036D3 +#define ERROR_SXS_XML_E_BADCHARDATA 0x000036D4 +#define ERROR_SXS_XML_E_MISSINGWHITESPACE 0x000036D5 +#define ERROR_SXS_XML_E_EXPECTINGTAGEND 0x000036D6 +#define ERROR_SXS_XML_E_MISSINGSEMICOLON 0x000036D7 +#define ERROR_SXS_XML_E_UNBALANCEDPAREN 0x000036D8 +#define ERROR_SXS_XML_E_INTERNALERROR 0x000036D9 +#define ERROR_SXS_XML_E_UNEXPECTED_WHITESPACE 0x000036DA +#define ERROR_SXS_XML_E_INCOMPLETE_ENCODING 0x000036DB +#define ERROR_SXS_XML_E_MISSING_PAREN 0x000036DC +#define ERROR_SXS_XML_E_EXPECTINGCLOSEQUOTE 0x000036DD +#define ERROR_SXS_XML_E_MULTIPLE_COLONS 0x000036DE +#define ERROR_SXS_XML_E_INVALID_DECIMAL 0x000036DF +#define ERROR_SXS_XML_E_INVALID_HEXIDECIMAL 0x000036E0 +#define ERROR_SXS_XML_E_INVALID_UNICODE 0x000036E1 +#define ERROR_SXS_XML_E_WHITESPACEORQUESTIONMARK 0x000036E2 +#define ERROR_SXS_XML_E_UNEXPECTEDENDTAG 0x000036E3 +#define ERROR_SXS_XML_E_UNCLOSEDTAG 0x000036E4 +#define ERROR_SXS_XML_E_DUPLICATEATTRIBUTE 0x000036E5 +#define ERROR_SXS_XML_E_MULTIPLEROOTS 0x000036E6 +#define ERROR_SXS_XML_E_INVALIDATROOTLEVEL 0x000036E7 +#define ERROR_SXS_XML_E_BADXMLDECL 0x000036E8 +#define ERROR_SXS_XML_E_MISSINGROOT 0x000036E9 +#define ERROR_SXS_XML_E_UNEXPECTEDEOF 0x000036EA +#define ERROR_SXS_XML_E_BADPEREFINSUBSET 0x000036EB +#define ERROR_SXS_XML_E_UNCLOSEDSTARTTAG 0x000036EC +#define ERROR_SXS_XML_E_UNCLOSEDENDTAG 0x000036ED +#define ERROR_SXS_XML_E_UNCLOSEDSTRING 0x000036EE +#define ERROR_SXS_XML_E_UNCLOSEDCOMMENT 0x000036EF +#define ERROR_SXS_XML_E_UNCLOSEDDECL 0x000036F0 +#define ERROR_SXS_XML_E_UNCLOSEDCDATA 0x000036F1 +#define ERROR_SXS_XML_E_RESERVEDNAMESPACE 0x000036F2 +#define ERROR_SXS_XML_E_INVALIDENCODING 0x000036F3 +#define ERROR_SXS_XML_E_INVALIDSWITCH 0x000036F4 +#define ERROR_SXS_XML_E_BADXMLCASE 0x000036F5 +#define ERROR_SXS_XML_E_INVALID_STANDALONE 0x000036F6 +#define ERROR_SXS_XML_E_UNEXPECTED_STANDALONE 0x000036F7 +#define ERROR_SXS_XML_E_INVALID_VERSION 0x000036F8 +#define ERROR_SXS_XML_E_MISSINGEQUALS 0x000036F9 +#define ERROR_SXS_PROTECTION_RECOVERY_FAILED 0x000036FA +#define ERROR_SXS_PROTECTION_PUBLIC_KEY_TOO_SHORT 0x000036FB +#define ERROR_SXS_PROTECTION_CATALOG_NOT_VALID 0x000036FC +#define ERROR_SXS_UNTRANSLATABLE_HRESULT 0x000036FD +#define ERROR_SXS_PROTECTION_CATALOG_FILE_MISSING 0x000036FE +#define ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE 0x000036FF +#define ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME 0x00003700 +#define ERROR_SXS_ASSEMBLY_MISSING 0x00003701 +#define ERROR_SXS_CORRUPT_ACTIVATION_STACK 0x00003702 +#define ERROR_SXS_CORRUPTION 0x00003703 +#define ERROR_SXS_EARLY_DEACTIVATION 0x00003704 +#define ERROR_SXS_INVALID_DEACTIVATION 0x00003705 +#define ERROR_SXS_MULTIPLE_DEACTIVATION 0x00003706 +#define ERROR_SXS_PROCESS_TERMINATION_REQUESTED 0x00003707 +#define ERROR_SXS_RELEASE_ACTIVATION_CONTEXT 0x00003708 +#define ERROR_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY 0x00003709 +#define ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE 0x0000370A +#define ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME 0x0000370B +#define ERROR_SXS_IDENTITY_DUPLICATE_ATTRIBUTE 0x0000370C +#define ERROR_SXS_IDENTITY_PARSE_ERROR 0x0000370D +#define ERROR_MALFORMED_SUBSTITUTION_STRING 0x0000370E +#define ERROR_SXS_INCORRECT_PUBLIC_KEY_TOKEN 0x0000370F +#define ERROR_UNMAPPED_SUBSTITUTION_STRING 0x00003710 +#define ERROR_SXS_ASSEMBLY_NOT_LOCKED 0x00003711 +#define ERROR_SXS_COMPONENT_STORE_CORRUPT 0x00003712 +#define ERROR_ADVANCED_INSTALLER_FAILED 0x00003713 +#define ERROR_XML_ENCODING_MISMATCH 0x00003714 +#define ERROR_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT 0x00003715 +#define ERROR_SXS_IDENTITIES_DIFFERENT 0x00003716 +#define ERROR_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT 0x00003717 +#define ERROR_SXS_FILE_NOT_PART_OF_ASSEMBLY 0x00003718 +#define ERROR_SXS_MANIFEST_TOO_BIG 0x00003719 +#define ERROR_SXS_SETTING_NOT_REGISTERED 0x0000371A +#define ERROR_SXS_TRANSACTION_CLOSURE_INCOMPLETE 0x0000371B +#define ERROR_SMI_PRIMITIVE_INSTALLER_FAILED 0x0000371C +#define ERROR_GENERIC_COMMAND_FAILED 0x0000371D +#define ERROR_SXS_FILE_HASH_MISSING 0x0000371E +#define ERROR_EVT_INVALID_CHANNEL_PATH 0x00003A98 +#define ERROR_EVT_INVALID_QUERY 0x00003A99 +#define ERROR_EVT_PUBLISHER_METADATA_NOT_FOUND 0x00003A9A +#define ERROR_EVT_EVENT_TEMPLATE_NOT_FOUND 0x00003A9B +#define ERROR_EVT_INVALID_PUBLISHER_NAME 0x00003A9C +#define ERROR_EVT_INVALID_EVENT_DATA 0x00003A9D +#define ERROR_EVT_CHANNEL_NOT_FOUND 0x00003A9F +#define ERROR_EVT_MALFORMED_XML_TEXT 0x00003AA0 +#define ERROR_EVT_SUBSCRIPTION_TO_DIRECT_CHANNEL 0x00003AA1 +#define ERROR_EVT_CONFIGURATION_ERROR 0x00003AA2 +#define ERROR_EVT_QUERY_RESULT_STALE 0x00003AA3 +#define ERROR_EVT_QUERY_RESULT_INVALID_POSITION 0x00003AA4 +#define ERROR_EVT_NON_VALIDATING_MSXML 0x00003AA5 +#define ERROR_EVT_FILTER_ALREADYSCOPED 0x00003AA6 +#define ERROR_EVT_FILTER_NOTELTSET 0x00003AA7 +#define ERROR_EVT_FILTER_INVARG 0x00003AA8 +#define ERROR_EVT_FILTER_INVTEST 0x00003AA9 +#define ERROR_EVT_FILTER_INVTYPE 0x00003AAA +#define ERROR_EVT_FILTER_PARSEERR 0x00003AAB +#define ERROR_EVT_FILTER_UNSUPPORTEDOP 0x00003AAC +#define ERROR_EVT_FILTER_UNEXPECTEDTOKEN 0x00003AAD +#define ERROR_EVT_INVALID_OPERATION_OVER_ENABLED_DIRECT_CHANNEL 0x00003AAE +#define ERROR_EVT_INVALID_CHANNEL_PROPERTY_VALUE 0x00003AAF +#define ERROR_EVT_INVALID_PUBLISHER_PROPERTY_VALUE 0x00003AB0 +#define ERROR_EVT_CHANNEL_CANNOT_ACTIVATE 0x00003AB1 +#define ERROR_EVT_FILTER_TOO_COMPLEX 0x00003AB2 +#define ERROR_EVT_MESSAGE_NOT_FOUND 0x00003AB3 +#define ERROR_EVT_MESSAGE_ID_NOT_FOUND 0x00003AB4 +#define ERROR_EVT_UNRESOLVED_VALUE_INSERT 0x00003AB5 +#define ERROR_EVT_UNRESOLVED_PARAMETER_INSERT 0x00003AB6 +#define ERROR_EVT_MAX_INSERTS_REACHED 0x00003AB7 +#define ERROR_EVT_EVENT_DEFINITION_NOT_FOUND 0x00003AB8 +#define ERROR_EVT_MESSAGE_LOCALE_NOT_FOUND 0x00003AB9 +#define ERROR_EVT_VERSION_TOO_OLD 0x00003ABA +#define ERROR_EVT_VERSION_TOO_NEW 0x00003ABB +#define ERROR_EVT_CANNOT_OPEN_CHANNEL_OF_QUERY 0x00003ABC +#define ERROR_EVT_PUBLISHER_DISABLED 0x00003ABD +#define ERROR_EVT_FILTER_OUT_OF_RANGE 0x00003ABE +#define ERROR_EC_SUBSCRIPTION_CANNOT_ACTIVATE 0x00003AE8 +#define ERROR_EC_LOG_DISABLED 0x00003AE9 +#define ERROR_EC_CIRCULAR_FORWARDING 0x00003AEA +#define ERROR_EC_CREDSTORE_FULL 0x00003AEB +#define ERROR_EC_CRED_NOT_FOUND 0x00003AEC +#define ERROR_EC_NO_ACTIVE_CHANNEL 0x00003AED +#define ERROR_MUI_FILE_NOT_FOUND 0x00003AFC +#define ERROR_MUI_INVALID_FILE 0x00003AFD +#define ERROR_MUI_INVALID_RC_CONFIG 0x00003AFE +#define ERROR_MUI_INVALID_LOCALE_NAME 0x00003AFF +#define ERROR_MUI_INVALID_ULTIMATEFALLBACK_NAME 0x00003B00 +#define ERROR_MUI_FILE_NOT_LOADED 0x00003B01 +#define ERROR_RESOURCE_ENUM_USER_STOP 0x00003B02 +#define ERROR_MUI_INTLSETTINGS_UILANG_NOT_INSTALLED 0x00003B03 +#define ERROR_MUI_INTLSETTINGS_INVALID_LOCALE_NAME 0x00003B04 +#define ERROR_MRM_RUNTIME_NO_DEFAULT_OR_NEUTRAL_RESOURCE 0x00003B06 +#define ERROR_MRM_INVALID_PRICONFIG 0x00003B07 +#define ERROR_MRM_INVALID_FILE_TYPE 0x00003B08 +#define ERROR_MRM_UNKNOWN_QUALIFIER 0x00003B09 +#define ERROR_MRM_INVALID_QUALIFIER_VALUE 0x00003B0A +#define ERROR_MRM_NO_CANDIDATE 0x00003B0B +#define ERROR_MRM_NO_MATCH_OR_DEFAULT_CANDIDATE 0x00003B0C +#define ERROR_MRM_RESOURCE_TYPE_MISMATCH 0x00003B0D +#define ERROR_MRM_DUPLICATE_MAP_NAME 0x00003B0E +#define ERROR_MRM_DUPLICATE_ENTRY 0x00003B0F +#define ERROR_MRM_INVALID_RESOURCE_IDENTIFIER 0x00003B10 +#define ERROR_MRM_FILEPATH_TOO_LONG 0x00003B11 +#define ERROR_MRM_UNSUPPORTED_DIRECTORY_TYPE 0x00003B12 +#define ERROR_MRM_INVALID_PRI_FILE 0x00003B16 +#define ERROR_MRM_NAMED_RESOURCE_NOT_FOUND 0x00003B17 +#define ERROR_MRM_MAP_NOT_FOUND 0x00003B1F +#define ERROR_MRM_UNSUPPORTED_PROFILE_TYPE 0x00003B20 +#define ERROR_MRM_INVALID_QUALIFIER_OPERATOR 0x00003B21 +#define ERROR_MRM_INDETERMINATE_QUALIFIER_VALUE 0x00003B22 +#define ERROR_MRM_AUTOMERGE_ENABLED 0x00003B23 +#define ERROR_MRM_TOO_MANY_RESOURCES 0x00003B24 +#define ERROR_MCA_INVALID_CAPABILITIES_STRING 0x00003B60 +#define ERROR_MCA_INVALID_VCP_VERSION 0x00003B61 +#define ERROR_MCA_MONITOR_VIOLATES_MCCS_SPECIFICATION 0x00003B62 +#define ERROR_MCA_MCCS_VERSION_MISMATCH 0x00003B63 +#define ERROR_MCA_UNSUPPORTED_MCCS_VERSION 0x00003B64 +#define ERROR_MCA_INTERNAL_ERROR 0x00003B65 +#define ERROR_MCA_INVALID_TECHNOLOGY_TYPE_RETURNED 0x00003B66 +#define ERROR_MCA_UNSUPPORTED_COLOR_TEMPERATURE 0x00003B67 +#define ERROR_AMBIGUOUS_SYSTEM_DEVICE 0x00003B92 +#define ERROR_SYSTEM_DEVICE_NOT_FOUND 0x00003BC3 +#define ERROR_HASH_NOT_SUPPORTED 0x00003BC4 +#define ERROR_HASH_NOT_PRESENT 0x00003BC5 +#define ERROR_SECONDARY_IC_PROVIDER_NOT_REGISTERED 0x00003BD9 +#define ERROR_GPIO_CLIENT_INFORMATION_INVALID 0x00003BDA +#define ERROR_GPIO_VERSION_NOT_SUPPORTED 0x00003BDB +#define ERROR_GPIO_INVALID_REGISTRATION_PACKET 0x00003BDC +#define ERROR_GPIO_OPERATION_DENIED 0x00003BDD +#define ERROR_GPIO_INCOMPATIBLE_CONNECT_MODE 0x00003BDE +#define ERROR_GPIO_INTERRUPT_ALREADY_UNMASKED 0x00003BDF +#define ERROR_CANNOT_SWITCH_RUNLEVEL 0x00003C28 +#define ERROR_INVALID_RUNLEVEL_SETTING 0x00003C29 +#define ERROR_RUNLEVEL_SWITCH_TIMEOUT 0x00003C2A +#define ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT 0x00003C2B +#define ERROR_RUNLEVEL_SWITCH_IN_PROGRESS 0x00003C2C +#define ERROR_SERVICES_FAILED_AUTOSTART 0x00003C2D +#define ERROR_COM_TASK_STOP_PENDING 0x00003C8D +#define ERROR_INSTALL_OPEN_PACKAGE_FAILED 0x00003CF0 +#define ERROR_INSTALL_PACKAGE_NOT_FOUND 0x00003CF1 +#define ERROR_INSTALL_INVALID_PACKAGE 0x00003CF2 +#define ERROR_INSTALL_RESOLVE_DEPENDENCY_FAILED 0x00003CF3 +#define ERROR_INSTALL_OUT_OF_DISK_SPACE 0x00003CF4 +#define ERROR_INSTALL_NETWORK_FAILURE 0x00003CF5 +#define ERROR_INSTALL_REGISTRATION_FAILURE 0x00003CF6 +#define ERROR_INSTALL_DEREGISTRATION_FAILURE 0x00003CF7 +#define ERROR_INSTALL_CANCEL 0x00003CF8 +#define ERROR_INSTALL_FAILED 0x00003CF9 +#define ERROR_REMOVE_FAILED 0x00003CFA +#define ERROR_PACKAGE_ALREADY_EXISTS 0x00003CFB +#define ERROR_NEEDS_REMEDIATION 0x00003CFC +#define ERROR_INSTALL_PREREQUISITE_FAILED 0x00003CFD +#define ERROR_PACKAGE_REPOSITORY_CORRUPTED 0x00003CFE +#define ERROR_INSTALL_POLICY_FAILURE 0x00003CFF +#define ERROR_PACKAGE_UPDATING 0x00003D00 +#define ERROR_DEPLOYMENT_BLOCKED_BY_POLICY 0x00003D01 +#define ERROR_PACKAGES_IN_USE 0x00003D02 +#define ERROR_RECOVERY_FILE_CORRUPT 0x00003D03 +#define ERROR_INVALID_STAGED_SIGNATURE 0x00003D04 +#define ERROR_DELETING_EXISTING_APPLICATIONDATA_STORE_FAILED 0x00003D05 +#define ERROR_INSTALL_PACKAGE_DOWNGRADE 0x00003D06 +#define ERROR_SYSTEM_NEEDS_REMEDIATION 0x00003D07 +#define ERROR_APPX_INTEGRITY_FAILURE_CLR_NGEN 0x00003D08 +#define ERROR_RESILIENCY_FILE_CORRUPT 0x00003D09 +#define ERROR_INSTALL_FIREWALL_SERVICE_NOT_RUNNING 0x00003D0A +#define APPMODEL_ERROR_NO_PACKAGE 0x00003D54 +#define APPMODEL_ERROR_PACKAGE_RUNTIME_CORRUPT 0x00003D55 +#define APPMODEL_ERROR_PACKAGE_IDENTITY_CORRUPT 0x00003D56 +#define APPMODEL_ERROR_NO_APPLICATION 0x00003D57 +#define ERROR_STATE_LOAD_STORE_FAILED 0x00003DB8 +#define ERROR_STATE_GET_VERSION_FAILED 0x00003DB9 +#define ERROR_STATE_SET_VERSION_FAILED 0x00003DBA +#define ERROR_STATE_STRUCTURED_RESET_FAILED 0x00003DBB +#define ERROR_STATE_OPEN_CONTAINER_FAILED 0x00003DBC +#define ERROR_STATE_CREATE_CONTAINER_FAILED 0x00003DBD +#define ERROR_STATE_DELETE_CONTAINER_FAILED 0x00003DBE +#define ERROR_STATE_READ_SETTING_FAILED 0x00003DBF +#define ERROR_STATE_WRITE_SETTING_FAILED 0x00003DC0 +#define ERROR_STATE_DELETE_SETTING_FAILED 0x00003DC1 +#define ERROR_STATE_QUERY_SETTING_FAILED 0x00003DC2 +#define ERROR_STATE_READ_COMPOSITE_SETTING_FAILED 0x00003DC3 +#define ERROR_STATE_WRITE_COMPOSITE_SETTING_FAILED 0x00003DC4 +#define ERROR_STATE_ENUMERATE_CONTAINER_FAILED 0x00003DC5 +#define ERROR_STATE_ENUMERATE_SETTINGS_FAILED 0x00003DC6 +#define ERROR_STATE_COMPOSITE_SETTING_VALUE_SIZE_LIMIT_EXCEEDED 0x00003DC7 +#define ERROR_STATE_SETTING_VALUE_SIZE_LIMIT_EXCEEDED 0x00003DC8 +#define ERROR_STATE_SETTING_NAME_SIZE_LIMIT_EXCEEDED 0x00003DC9 +#define ERROR_STATE_CONTAINER_NAME_SIZE_LIMIT_EXCEEDED 0x00003DCA +#define ERROR_API_UNAVAILABLE 0x00003DE1 #ifndef FACILITY_WEBSERVICES #define FACILITY_WEBSERVICES 61 -#define WS_S_ASYNC 0x003D0000 -#define WS_S_END 0x003D0001 -#define WS_E_INVALID_FORMAT 0x803D0000 -#define WS_E_OBJECT_FAULTED 0x803D0001 -#define WS_E_NUMERIC_OVERFLOW 0x803D0002 -#define WS_E_INVALID_OPERATION 0x803D0003 -#define WS_E_OPERATION_ABORTED 0x803D0004 -#define WS_E_ENDPOINT_ACCESS_DENIED 0x803D0005 -#define WS_E_OPERATION_TIMED_OUT 0x803D0006 -#define WS_E_OPERATION_ABANDONED 0x803D0007 -#define WS_E_QUOTA_EXCEEDED 0x803D0008 -#define WS_E_NO_TRANSLATION_AVAILABLE 0x803D0009 -#define WS_E_SECURITY_VERIFICATION_FAILURE 0x803D000A -#define WS_E_ADDRESS_IN_USE 0x803D000B -#define WS_E_ADDRESS_NOT_AVAILABLE 0x803D000C -#define WS_E_ENDPOINT_NOT_FOUND 0x803D000D -#define WS_E_ENDPOINT_NOT_AVAILABLE 0x803D000E -#define WS_E_ENDPOINT_FAILURE 0x803D000F -#define WS_E_ENDPOINT_UNREACHABLE 0x803D0010 -#define WS_E_ENDPOINT_ACTION_NOT_SUPPORTED 0x803D0011 -#define WS_E_ENDPOINT_TOO_BUSY 0x803D0012 -#define WS_E_ENDPOINT_FAULT_RECEIVED 0x803D0013 -#define WS_E_ENDPOINT_DISCONNECTED 0x803D0014 -#define WS_E_PROXY_FAILURE 0x803D0015 -#define WS_E_PROXY_ACCESS_DENIED 0x803D0016 -#define WS_E_NOT_SUPPORTED 0x803D0017 -#define WS_E_PROXY_REQUIRES_BASIC_AUTH 0x803D0018 -#define WS_E_PROXY_REQUIRES_DIGEST_AUTH 0x803D0019 -#define WS_E_PROXY_REQUIRES_NTLM_AUTH 0x803D001A -#define WS_E_PROXY_REQUIRES_NEGOTIATE_AUTH 0x803D001B -#define WS_E_SERVER_REQUIRES_BASIC_AUTH 0x803D001C -#define WS_E_SERVER_REQUIRES_DIGEST_AUTH 0x803D001D -#define WS_E_SERVER_REQUIRES_NTLM_AUTH 0x803D001E -#define WS_E_SERVER_REQUIRES_NEGOTIATE_AUTH 0x803D001F -#define WS_E_INVALID_ENDPOINT_URL 0x803D0020 -#define WS_E_OTHER 0x803D0021 -#define WS_E_SECURITY_TOKEN_EXPIRED 0x803D0022 -#define WS_E_SECURITY_SYSTEM_FAILURE 0x803D0023 +#define WS_S_ASYNC 0x003D0000 +#define WS_S_END 0x003D0001 +#define WS_E_INVALID_FORMAT 0x803D0000 +#define WS_E_OBJECT_FAULTED 0x803D0001 +#define WS_E_NUMERIC_OVERFLOW 0x803D0002 +#define WS_E_INVALID_OPERATION 0x803D0003 +#define WS_E_OPERATION_ABORTED 0x803D0004 +#define WS_E_ENDPOINT_ACCESS_DENIED 0x803D0005 +#define WS_E_OPERATION_TIMED_OUT 0x803D0006 +#define WS_E_OPERATION_ABANDONED 0x803D0007 +#define WS_E_QUOTA_EXCEEDED 0x803D0008 +#define WS_E_NO_TRANSLATION_AVAILABLE 0x803D0009 +#define WS_E_SECURITY_VERIFICATION_FAILURE 0x803D000A +#define WS_E_ADDRESS_IN_USE 0x803D000B +#define WS_E_ADDRESS_NOT_AVAILABLE 0x803D000C +#define WS_E_ENDPOINT_NOT_FOUND 0x803D000D +#define WS_E_ENDPOINT_NOT_AVAILABLE 0x803D000E +#define WS_E_ENDPOINT_FAILURE 0x803D000F +#define WS_E_ENDPOINT_UNREACHABLE 0x803D0010 +#define WS_E_ENDPOINT_ACTION_NOT_SUPPORTED 0x803D0011 +#define WS_E_ENDPOINT_TOO_BUSY 0x803D0012 +#define WS_E_ENDPOINT_FAULT_RECEIVED 0x803D0013 +#define WS_E_ENDPOINT_DISCONNECTED 0x803D0014 +#define WS_E_PROXY_FAILURE 0x803D0015 +#define WS_E_PROXY_ACCESS_DENIED 0x803D0016 +#define WS_E_NOT_SUPPORTED 0x803D0017 +#define WS_E_PROXY_REQUIRES_BASIC_AUTH 0x803D0018 +#define WS_E_PROXY_REQUIRES_DIGEST_AUTH 0x803D0019 +#define WS_E_PROXY_REQUIRES_NTLM_AUTH 0x803D001A +#define WS_E_PROXY_REQUIRES_NEGOTIATE_AUTH 0x803D001B +#define WS_E_SERVER_REQUIRES_BASIC_AUTH 0x803D001C +#define WS_E_SERVER_REQUIRES_DIGEST_AUTH 0x803D001D +#define WS_E_SERVER_REQUIRES_NTLM_AUTH 0x803D001E +#define WS_E_SERVER_REQUIRES_NEGOTIATE_AUTH 0x803D001F +#define WS_E_INVALID_ENDPOINT_URL 0x803D0020 +#define WS_E_OTHER 0x803D0021 +#define WS_E_SECURITY_TOKEN_EXPIRED 0x803D0022 +#define WS_E_SECURITY_SYSTEM_FAILURE 0x803D0023 #endif -#define EXCEPTION_MAXIMUM_PARAMETERS 15 +#define EXCEPTION_MAXIMUM_PARAMETERS 15 typedef struct _EXCEPTION_RECORD EXCEPTION_RECORD; -typedef struct _EXCEPTION_RECORD *PEXCEPTION_RECORD; +typedef struct _EXCEPTION_RECORD* PEXCEPTION_RECORD; struct _EXCEPTION_RECORD { @@ -3001,32 +3001,35 @@ typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER; typedef LONG (*PVECTORED_EXCEPTION_HANDLER)(PEXCEPTION_POINTERS ExceptionInfo); #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API UINT GetErrorMode(void); + WINPR_API UINT GetErrorMode(void); -WINPR_API UINT SetErrorMode(UINT uMode); + WINPR_API UINT SetErrorMode(UINT uMode); -WINPR_API DWORD GetLastError(void); + WINPR_API DWORD GetLastError(void); -WINPR_API VOID SetLastError(DWORD dwErrCode); + WINPR_API VOID SetLastError(DWORD dwErrCode); -WINPR_API VOID RestoreLastError(DWORD dwErrCode); + WINPR_API VOID RestoreLastError(DWORD dwErrCode); -WINPR_API VOID RaiseException(DWORD dwExceptionCode, DWORD dwExceptionFlags, DWORD nNumberOfArguments, CONST ULONG_PTR* lpArguments); + WINPR_API VOID RaiseException(DWORD dwExceptionCode, DWORD dwExceptionFlags, + DWORD nNumberOfArguments, CONST ULONG_PTR* lpArguments); -WINPR_API LONG UnhandledExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo); + WINPR_API LONG UnhandledExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo); -WINPR_API LPTOP_LEVEL_EXCEPTION_FILTER SetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter); + WINPR_API LPTOP_LEVEL_EXCEPTION_FILTER + SetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter); -WINPR_API PVOID AddVectoredExceptionHandler(ULONG First, PVECTORED_EXCEPTION_HANDLER Handler); + WINPR_API PVOID AddVectoredExceptionHandler(ULONG First, PVECTORED_EXCEPTION_HANDLER Handler); -WINPR_API ULONG RemoveVectoredExceptionHandler(PVOID Handle); + WINPR_API ULONG RemoveVectoredExceptionHandler(PVOID Handle); -WINPR_API PVOID AddVectoredContinueHandler(ULONG First, PVECTORED_EXCEPTION_HANDLER Handler); + WINPR_API PVOID AddVectoredContinueHandler(ULONG First, PVECTORED_EXCEPTION_HANDLER Handler); -WINPR_API ULONG RemoveVectoredContinueHandler(PVOID Handle); + WINPR_API ULONG RemoveVectoredContinueHandler(PVOID Handle); #ifdef __cplusplus } @@ -3035,4 +3038,3 @@ WINPR_API ULONG RemoveVectoredContinueHandler(PVOID Handle); #endif #endif /* WINPR_ERROR_H */ - diff --git a/winpr/include/winpr/file.h b/winpr/include/winpr/file.h index ed50cbed5..b281a809e 100644 --- a/winpr/include/winpr/file.h +++ b/winpr/include/winpr/file.h @@ -31,147 +31,147 @@ #ifndef _WIN32 #ifndef MAX_PATH -#define MAX_PATH 260 +#define MAX_PATH 260 #endif -#define INVALID_HANDLE_VALUE ((HANDLE) (LONG_PTR) - 1) -#define INVALID_FILE_SIZE ((DWORD) 0xFFFFFFFF) -#define INVALID_SET_FILE_POINTER ((DWORD) - 1) -#define INVALID_FILE_ATTRIBUTES ((DWORD) - 1) +#define INVALID_HANDLE_VALUE ((HANDLE)(LONG_PTR)-1) +#define INVALID_FILE_SIZE ((DWORD)0xFFFFFFFF) +#define INVALID_SET_FILE_POINTER ((DWORD)-1) +#define INVALID_FILE_ATTRIBUTES ((DWORD)-1) -#define FILE_ATTRIBUTE_READONLY 0x00000001 -#define FILE_ATTRIBUTE_HIDDEN 0x00000002 -#define FILE_ATTRIBUTE_SYSTEM 0x00000004 -#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 -#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 -#define FILE_ATTRIBUTE_DEVICE 0x00000040 -#define FILE_ATTRIBUTE_NORMAL 0x00000080 -#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 -#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200 -#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 -#define FILE_ATTRIBUTE_COMPRESSED 0x00000800 -#define FILE_ATTRIBUTE_OFFLINE 0x00001000 -#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000 -#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000 -#define FILE_ATTRIBUTE_VIRTUAL 0x00010000 +#define FILE_ATTRIBUTE_READONLY 0x00000001 +#define FILE_ATTRIBUTE_HIDDEN 0x00000002 +#define FILE_ATTRIBUTE_SYSTEM 0x00000004 +#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 +#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 +#define FILE_ATTRIBUTE_DEVICE 0x00000040 +#define FILE_ATTRIBUTE_NORMAL 0x00000080 +#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 +#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200 +#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 +#define FILE_ATTRIBUTE_COMPRESSED 0x00000800 +#define FILE_ATTRIBUTE_OFFLINE 0x00001000 +#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000 +#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000 +#define FILE_ATTRIBUTE_VIRTUAL 0x00010000 -#define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001 -#define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002 -#define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004 -#define FILE_NOTIFY_CHANGE_SIZE 0x00000008 -#define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010 -#define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020 -#define FILE_NOTIFY_CHANGE_CREATION 0x00000040 -#define FILE_NOTIFY_CHANGE_SECURITY 0x00000100 +#define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001 +#define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002 +#define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004 +#define FILE_NOTIFY_CHANGE_SIZE 0x00000008 +#define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010 +#define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020 +#define FILE_NOTIFY_CHANGE_CREATION 0x00000040 +#define FILE_NOTIFY_CHANGE_SECURITY 0x00000100 -#define FILE_ACTION_ADDED 0x00000001 -#define FILE_ACTION_REMOVED 0x00000002 -#define FILE_ACTION_MODIFIED 0x00000003 -#define FILE_ACTION_RENAMED_OLD_NAME 0x00000004 -#define FILE_ACTION_RENAMED_NEW_NAME 0x00000005 +#define FILE_ACTION_ADDED 0x00000001 +#define FILE_ACTION_REMOVED 0x00000002 +#define FILE_ACTION_MODIFIED 0x00000003 +#define FILE_ACTION_RENAMED_OLD_NAME 0x00000004 +#define FILE_ACTION_RENAMED_NEW_NAME 0x00000005 -#define FILE_CASE_SENSITIVE_SEARCH 0x00000001 -#define FILE_CASE_PRESERVED_NAMES 0x00000002 -#define FILE_UNICODE_ON_DISK 0x00000004 -#define FILE_PERSISTENT_ACLS 0x00000008 -#define FILE_FILE_COMPRESSION 0x00000010 -#define FILE_VOLUME_QUOTAS 0x00000020 -#define FILE_SUPPORTS_SPARSE_FILES 0x00000040 -#define FILE_SUPPORTS_REPARSE_POINTS 0x00000080 -#define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100 -#define FILE_VOLUME_IS_COMPRESSED 0x00008000 -#define FILE_SUPPORTS_OBJECT_IDS 0x00010000 -#define FILE_SUPPORTS_ENCRYPTION 0x00020000 -#define FILE_NAMED_STREAMS 0x00040000 -#define FILE_READ_ONLY_VOLUME 0x00080000 -#define FILE_SEQUENTIAL_WRITE_ONCE 0x00100000 -#define FILE_SUPPORTS_TRANSACTIONS 0x00200000 -#define FILE_SUPPORTS_HARD_LINKS 0x00400000 -#define FILE_SUPPORTS_EXTENDED_ATTRIBUTES 0x00800000 -#define FILE_SUPPORTS_OPEN_BY_FILE_ID 0x01000000 -#define FILE_SUPPORTS_USN_JOURNAL 0x02000000 +#define FILE_CASE_SENSITIVE_SEARCH 0x00000001 +#define FILE_CASE_PRESERVED_NAMES 0x00000002 +#define FILE_UNICODE_ON_DISK 0x00000004 +#define FILE_PERSISTENT_ACLS 0x00000008 +#define FILE_FILE_COMPRESSION 0x00000010 +#define FILE_VOLUME_QUOTAS 0x00000020 +#define FILE_SUPPORTS_SPARSE_FILES 0x00000040 +#define FILE_SUPPORTS_REPARSE_POINTS 0x00000080 +#define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100 +#define FILE_VOLUME_IS_COMPRESSED 0x00008000 +#define FILE_SUPPORTS_OBJECT_IDS 0x00010000 +#define FILE_SUPPORTS_ENCRYPTION 0x00020000 +#define FILE_NAMED_STREAMS 0x00040000 +#define FILE_READ_ONLY_VOLUME 0x00080000 +#define FILE_SEQUENTIAL_WRITE_ONCE 0x00100000 +#define FILE_SUPPORTS_TRANSACTIONS 0x00200000 +#define FILE_SUPPORTS_HARD_LINKS 0x00400000 +#define FILE_SUPPORTS_EXTENDED_ATTRIBUTES 0x00800000 +#define FILE_SUPPORTS_OPEN_BY_FILE_ID 0x01000000 +#define FILE_SUPPORTS_USN_JOURNAL 0x02000000 -#define FILE_FLAG_WRITE_THROUGH 0x80000000 -#define FILE_FLAG_OVERLAPPED 0x40000000 -#define FILE_FLAG_NO_BUFFERING 0x20000000 -#define FILE_FLAG_RANDOM_ACCESS 0x10000000 -#define FILE_FLAG_SEQUENTIAL_SCAN 0x08000000 -#define FILE_FLAG_DELETE_ON_CLOSE 0x04000000 -#define FILE_FLAG_BACKUP_SEMANTICS 0x02000000 -#define FILE_FLAG_POSIX_SEMANTICS 0x01000000 -#define FILE_FLAG_OPEN_REPARSE_POINT 0x00200000 -#define FILE_FLAG_OPEN_NO_RECALL 0x00100000 -#define FILE_FLAG_FIRST_PIPE_INSTANCE 0x00080000 +#define FILE_FLAG_WRITE_THROUGH 0x80000000 +#define FILE_FLAG_OVERLAPPED 0x40000000 +#define FILE_FLAG_NO_BUFFERING 0x20000000 +#define FILE_FLAG_RANDOM_ACCESS 0x10000000 +#define FILE_FLAG_SEQUENTIAL_SCAN 0x08000000 +#define FILE_FLAG_DELETE_ON_CLOSE 0x04000000 +#define FILE_FLAG_BACKUP_SEMANTICS 0x02000000 +#define FILE_FLAG_POSIX_SEMANTICS 0x01000000 +#define FILE_FLAG_OPEN_REPARSE_POINT 0x00200000 +#define FILE_FLAG_OPEN_NO_RECALL 0x00100000 +#define FILE_FLAG_FIRST_PIPE_INSTANCE 0x00080000 -#define PAGE_NOACCESS 0x00000001 -#define PAGE_READONLY 0x00000002 -#define PAGE_READWRITE 0x00000004 -#define PAGE_WRITECOPY 0x00000008 -#define PAGE_EXECUTE 0x00000010 -#define PAGE_EXECUTE_READ 0x00000020 -#define PAGE_EXECUTE_READWRITE 0x00000040 -#define PAGE_EXECUTE_WRITECOPY 0x00000080 -#define PAGE_GUARD 0x00000100 -#define PAGE_NOCACHE 0x00000200 -#define PAGE_WRITECOMBINE 0x00000400 +#define PAGE_NOACCESS 0x00000001 +#define PAGE_READONLY 0x00000002 +#define PAGE_READWRITE 0x00000004 +#define PAGE_WRITECOPY 0x00000008 +#define PAGE_EXECUTE 0x00000010 +#define PAGE_EXECUTE_READ 0x00000020 +#define PAGE_EXECUTE_READWRITE 0x00000040 +#define PAGE_EXECUTE_WRITECOPY 0x00000080 +#define PAGE_GUARD 0x00000100 +#define PAGE_NOCACHE 0x00000200 +#define PAGE_WRITECOMBINE 0x00000400 -#define MEM_COMMIT 0x00001000 -#define MEM_RESERVE 0x00002000 -#define MEM_DECOMMIT 0x00004000 -#define MEM_RELEASE 0x00008000 -#define MEM_FREE 0x00010000 -#define MEM_PRIVATE 0x00020000 -#define MEM_MAPPED 0x00040000 -#define MEM_RESET 0x00080000 -#define MEM_TOP_DOWN 0x00100000 -#define MEM_WRITE_WATCH 0x00200000 -#define MEM_PHYSICAL 0x00400000 -#define MEM_4MB_PAGES 0x80000000 -#define MEM_IMAGE SEC_IMAGE +#define MEM_COMMIT 0x00001000 +#define MEM_RESERVE 0x00002000 +#define MEM_DECOMMIT 0x00004000 +#define MEM_RELEASE 0x00008000 +#define MEM_FREE 0x00010000 +#define MEM_PRIVATE 0x00020000 +#define MEM_MAPPED 0x00040000 +#define MEM_RESET 0x00080000 +#define MEM_TOP_DOWN 0x00100000 +#define MEM_WRITE_WATCH 0x00200000 +#define MEM_PHYSICAL 0x00400000 +#define MEM_4MB_PAGES 0x80000000 +#define MEM_IMAGE SEC_IMAGE -#define SEC_NO_CHANGE 0x00400000 -#define SEC_FILE 0x00800000 -#define SEC_IMAGE 0x01000000 -#define SEC_VLM 0x02000000 -#define SEC_RESERVE 0x04000000 -#define SEC_COMMIT 0x08000000 -#define SEC_NOCACHE 0x10000000 -#define SEC_WRITECOMBINE 0x40000000 -#define SEC_LARGE_PAGES 0x80000000 +#define SEC_NO_CHANGE 0x00400000 +#define SEC_FILE 0x00800000 +#define SEC_IMAGE 0x01000000 +#define SEC_VLM 0x02000000 +#define SEC_RESERVE 0x04000000 +#define SEC_COMMIT 0x08000000 +#define SEC_NOCACHE 0x10000000 +#define SEC_WRITECOMBINE 0x40000000 +#define SEC_LARGE_PAGES 0x80000000 -#define SECTION_MAP_EXECUTE_EXPLICIT 0x00020 -#define SECTION_EXTEND_SIZE 0x00010 -#define SECTION_MAP_READ 0x00004 -#define SECTION_MAP_WRITE 0x00002 -#define SECTION_QUERY 0x00001 -#define SECTION_MAP_EXECUTE 0x00008 -#define SECTION_ALL_ACCESS 0xF001F +#define SECTION_MAP_EXECUTE_EXPLICIT 0x00020 +#define SECTION_EXTEND_SIZE 0x00010 +#define SECTION_MAP_READ 0x00004 +#define SECTION_MAP_WRITE 0x00002 +#define SECTION_QUERY 0x00001 +#define SECTION_MAP_EXECUTE 0x00008 +#define SECTION_ALL_ACCESS 0xF001F -#define FILE_MAP_COPY SECTION_QUERY -#define FILE_MAP_WRITE SECTION_MAP_WRITE -#define FILE_MAP_READ SECTION_MAP_READ -#define FILE_MAP_ALL_ACCESS SECTION_ALL_ACCESS -#define FILE_MAP_EXECUTE SECTION_MAP_EXECUTE_EXPLICIT +#define FILE_MAP_COPY SECTION_QUERY +#define FILE_MAP_WRITE SECTION_MAP_WRITE +#define FILE_MAP_READ SECTION_MAP_READ +#define FILE_MAP_ALL_ACCESS SECTION_ALL_ACCESS +#define FILE_MAP_EXECUTE SECTION_MAP_EXECUTE_EXPLICIT -#define CREATE_NEW 1 -#define CREATE_ALWAYS 2 -#define OPEN_EXISTING 3 -#define OPEN_ALWAYS 4 -#define TRUNCATE_EXISTING 5 +#define CREATE_NEW 1 +#define CREATE_ALWAYS 2 +#define OPEN_EXISTING 3 +#define OPEN_ALWAYS 4 +#define TRUNCATE_EXISTING 5 -#define FIND_FIRST_EX_CASE_SENSITIVE 0x1 -#define FIND_FIRST_EX_LARGE_FETCH 0x2 +#define FIND_FIRST_EX_CASE_SENSITIVE 0x1 +#define FIND_FIRST_EX_LARGE_FETCH 0x2 -#define STD_INPUT_HANDLE (DWORD)-10 -#define STD_OUTPUT_HANDLE (DWORD)-11 -#define STD_ERROR_HANDLE (DWORD)-12 +#define STD_INPUT_HANDLE (DWORD) - 10 +#define STD_OUTPUT_HANDLE (DWORD) - 11 +#define STD_ERROR_HANDLE (DWORD) - 12 -#define FILE_BEGIN 0 +#define FILE_BEGIN 0 #define FILE_CURRENT 1 -#define FILE_END 2 +#define FILE_END 2 #define LOCKFILE_FAIL_IMMEDIATELY 1 -#define LOCKFILE_EXCLUSIVE_LOCK 2 +#define LOCKFILE_EXCLUSIVE_LOCK 2 #define MOVEFILE_REPLACE_EXISTING 0x1 #define MOVEFILE_COPY_ALLOWED 0x2 @@ -180,8 +180,7 @@ #define MOVEFILE_CREATE_HARDLINK 0x10 #define MOVEFILE_FAIL_IF_NOT_TRACKABLE 0x20 -typedef union _FILE_SEGMENT_ELEMENT -{ +typedef union _FILE_SEGMENT_ELEMENT { PVOID64 Buffer; ULONGLONG Alignment; } FILE_SEGMENT_ELEMENT, *PFILE_SEGMENT_ELEMENT; @@ -228,181 +227,200 @@ typedef enum _FINDEX_SEARCH_OPS FindExSearchMaxSearchOp } FINDEX_SEARCH_OPS; -typedef VOID (*LPOVERLAPPED_COMPLETION_ROUTINE)(DWORD dwErrorCode, DWORD dwNumberOfBytesTransfered, LPOVERLAPPED lpOverlapped); +typedef VOID (*LPOVERLAPPED_COMPLETION_ROUTINE)(DWORD dwErrorCode, DWORD dwNumberOfBytesTransfered, + LPOVERLAPPED lpOverlapped); #ifdef UNICODE -#define WIN32_FIND_DATA WIN32_FIND_DATAW -#define PWIN32_FIND_DATA PWIN32_FIND_DATAW -#define LPWIN32_FIND_DATA LPWIN32_FIND_DATAW +#define WIN32_FIND_DATA WIN32_FIND_DATAW +#define PWIN32_FIND_DATA PWIN32_FIND_DATAW +#define LPWIN32_FIND_DATA LPWIN32_FIND_DATAW #else -#define WIN32_FIND_DATA WIN32_FIND_DATAA -#define PWIN32_FIND_DATA PWIN32_FIND_DATAA -#define LPWIN32_FIND_DATA LPWIN32_FIND_DATAA +#define WIN32_FIND_DATA WIN32_FIND_DATAA +#define PWIN32_FIND_DATA PWIN32_FIND_DATAA +#define LPWIN32_FIND_DATA LPWIN32_FIND_DATAA #endif #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, - DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile); + WINPR_API HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, + DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, + HANDLE hTemplateFile); -WINPR_API HANDLE CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, - DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile); + WINPR_API HANDLE CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, + DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, + HANDLE hTemplateFile); -WINPR_API BOOL DeleteFileA(LPCSTR lpFileName); + WINPR_API BOOL DeleteFileA(LPCSTR lpFileName); -WINPR_API BOOL DeleteFileW(LPCWSTR lpFileName); + WINPR_API BOOL DeleteFileW(LPCWSTR lpFileName); -WINPR_API BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, - LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped); + WINPR_API BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, + LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped); -WINPR_API BOOL ReadFileEx(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, - LPOVERLAPPED lpOverlapped, LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); + WINPR_API BOOL ReadFileEx(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, + LPOVERLAPPED lpOverlapped, + LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); -WINPR_API BOOL ReadFileScatter(HANDLE hFile, FILE_SEGMENT_ELEMENT aSegmentArray[], - DWORD nNumberOfBytesToRead, LPDWORD lpReserved, LPOVERLAPPED lpOverlapped); + WINPR_API BOOL ReadFileScatter(HANDLE hFile, FILE_SEGMENT_ELEMENT aSegmentArray[], + DWORD nNumberOfBytesToRead, LPDWORD lpReserved, + LPOVERLAPPED lpOverlapped); -WINPR_API BOOL WriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, - LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped); + WINPR_API BOOL WriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, + LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped); -WINPR_API BOOL WriteFileEx(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, - LPOVERLAPPED lpOverlapped, LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); + WINPR_API BOOL WriteFileEx(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, + LPOVERLAPPED lpOverlapped, + LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); -WINPR_API BOOL WriteFileGather(HANDLE hFile, FILE_SEGMENT_ELEMENT aSegmentArray[], - DWORD nNumberOfBytesToWrite, LPDWORD lpReserved, LPOVERLAPPED lpOverlapped); + WINPR_API BOOL WriteFileGather(HANDLE hFile, FILE_SEGMENT_ELEMENT aSegmentArray[], + DWORD nNumberOfBytesToWrite, LPDWORD lpReserved, + LPOVERLAPPED lpOverlapped); -WINPR_API BOOL FlushFileBuffers(HANDLE hFile); + WINPR_API BOOL FlushFileBuffers(HANDLE hFile); -typedef struct _WIN32_FILE_ATTRIBUTE_DATA -{ - DWORD dwFileAttributes; - FILETIME ftCreationTime; - FILETIME ftLastAccessTime; - FILETIME ftLastWriteTime; - DWORD nFileSizeHigh; - DWORD nFileSizeLow; -} WIN32_FILE_ATTRIBUTE_DATA, *LPWIN32_FILE_ATTRIBUTE_DATA; + typedef struct _WIN32_FILE_ATTRIBUTE_DATA + { + DWORD dwFileAttributes; + FILETIME ftCreationTime; + FILETIME ftLastAccessTime; + FILETIME ftLastWriteTime; + DWORD nFileSizeHigh; + DWORD nFileSizeLow; + } WIN32_FILE_ATTRIBUTE_DATA, *LPWIN32_FILE_ATTRIBUTE_DATA; -typedef enum _GET_FILEEX_INFO_LEVELS -{ - GetFileExInfoStandard, - GetFileExMaxInfoLevel -} GET_FILEEX_INFO_LEVELS; + typedef enum _GET_FILEEX_INFO_LEVELS + { + GetFileExInfoStandard, + GetFileExMaxInfoLevel + } GET_FILEEX_INFO_LEVELS; -WINPR_API BOOL GetFileAttributesExA(LPCSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation); + WINPR_API BOOL GetFileAttributesExA(LPCSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, + LPVOID lpFileInformation); -WINPR_API DWORD GetFileAttributesA(LPCSTR lpFileName); + WINPR_API DWORD GetFileAttributesA(LPCSTR lpFileName); -WINPR_API BOOL GetFileAttributesExW(LPCWSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation); - -WINPR_API DWORD GetFileAttributesW(LPCWSTR lpFileName); + WINPR_API BOOL GetFileAttributesExW(LPCWSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, + LPVOID lpFileInformation); -WINPR_API BOOL SetFileAttributesA(LPCSTR lpFileName, DWORD dwFileAttributes); + WINPR_API DWORD GetFileAttributesW(LPCWSTR lpFileName); -WINPR_API BOOL SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes); + WINPR_API BOOL SetFileAttributesA(LPCSTR lpFileName, DWORD dwFileAttributes); -WINPR_API BOOL SetEndOfFile(HANDLE hFile); + WINPR_API BOOL SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes); -WINPR_API DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh); + WINPR_API BOOL SetEndOfFile(HANDLE hFile); -WINPR_API DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove, - PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod); + WINPR_API DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh); -WINPR_API BOOL SetFilePointerEx(HANDLE hFile, LARGE_INTEGER liDistanceToMove, - PLARGE_INTEGER lpNewFilePointer, DWORD dwMoveMethod); + WINPR_API DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, + DWORD dwMoveMethod); -WINPR_API BOOL LockFile(HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, - DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh); + WINPR_API BOOL SetFilePointerEx(HANDLE hFile, LARGE_INTEGER liDistanceToMove, + PLARGE_INTEGER lpNewFilePointer, DWORD dwMoveMethod); -WINPR_API BOOL LockFileEx(HANDLE hFile, DWORD dwFlags, DWORD dwReserved, - DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh, LPOVERLAPPED lpOverlapped); + WINPR_API BOOL LockFile(HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, + DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh); -WINPR_API BOOL UnlockFile(HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, - DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh); + WINPR_API BOOL LockFileEx(HANDLE hFile, DWORD dwFlags, DWORD dwReserved, + DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh, + LPOVERLAPPED lpOverlapped); -WINPR_API BOOL UnlockFileEx(HANDLE hFile, DWORD dwReserved, DWORD nNumberOfBytesToUnlockLow, - DWORD nNumberOfBytesToUnlockHigh, LPOVERLAPPED lpOverlapped); + WINPR_API BOOL UnlockFile(HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, + DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh); -WINPR_API BOOL SetFileTime(HANDLE hFile, const FILETIME *lpCreationTime, - const FILETIME *lpLastAccessTime, const FILETIME *lpLastWriteTime); + WINPR_API BOOL UnlockFileEx(HANDLE hFile, DWORD dwReserved, DWORD nNumberOfBytesToUnlockLow, + DWORD nNumberOfBytesToUnlockHigh, LPOVERLAPPED lpOverlapped); -WINPR_API HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData); -WINPR_API HANDLE FindFirstFileW(LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFindFileData); + WINPR_API BOOL SetFileTime(HANDLE hFile, const FILETIME* lpCreationTime, + const FILETIME* lpLastAccessTime, const FILETIME* lpLastWriteTime); -WINPR_API HANDLE FindFirstFileExA(LPCSTR lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, LPVOID lpFindFileData, - FINDEX_SEARCH_OPS fSearchOp, LPVOID lpSearchFilter, DWORD dwAdditionalFlags); -WINPR_API HANDLE FindFirstFileExW(LPCWSTR lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, LPVOID lpFindFileData, - FINDEX_SEARCH_OPS fSearchOp, LPVOID lpSearchFilter, DWORD dwAdditionalFlags); + WINPR_API HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData); + WINPR_API HANDLE FindFirstFileW(LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFindFileData); -WINPR_API BOOL FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData); -WINPR_API BOOL FindNextFileW(HANDLE hFindFile, LPWIN32_FIND_DATAW lpFindFileData); + WINPR_API HANDLE FindFirstFileExA(LPCSTR lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, + LPVOID lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, + LPVOID lpSearchFilter, DWORD dwAdditionalFlags); + WINPR_API HANDLE FindFirstFileExW(LPCWSTR lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, + LPVOID lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, + LPVOID lpSearchFilter, DWORD dwAdditionalFlags); -WINPR_API BOOL FindClose(HANDLE hFindFile); + WINPR_API BOOL FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData); + WINPR_API BOOL FindNextFileW(HANDLE hFindFile, LPWIN32_FIND_DATAW lpFindFileData); -WINPR_API BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes); -WINPR_API BOOL CreateDirectoryW(LPCWSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes); + WINPR_API BOOL FindClose(HANDLE hFindFile); -WINPR_API BOOL RemoveDirectoryA(LPCSTR lpPathName); -WINPR_API BOOL RemoveDirectoryW(LPCWSTR lpPathName); + WINPR_API BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes); + WINPR_API BOOL CreateDirectoryW(LPCWSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes); -WINPR_API HANDLE GetStdHandle(DWORD nStdHandle); -WINPR_API BOOL SetStdHandle(DWORD nStdHandle, HANDLE hHandle); -WINPR_API BOOL SetStdHandleEx(DWORD dwStdHandle, HANDLE hNewHandle, HANDLE* phOldHandle); + WINPR_API BOOL RemoveDirectoryA(LPCSTR lpPathName); + WINPR_API BOOL RemoveDirectoryW(LPCWSTR lpPathName); -WINPR_API BOOL GetDiskFreeSpaceA(LPCSTR lpRootPathName, LPDWORD lpSectorsPerCluster, - LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters); + WINPR_API HANDLE GetStdHandle(DWORD nStdHandle); + WINPR_API BOOL SetStdHandle(DWORD nStdHandle, HANDLE hHandle); + WINPR_API BOOL SetStdHandleEx(DWORD dwStdHandle, HANDLE hNewHandle, HANDLE* phOldHandle); -WINPR_API BOOL GetDiskFreeSpaceW(LPCWSTR lpRootPathName, LPDWORD lpSectorsPerCluster, - LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters); + WINPR_API BOOL GetDiskFreeSpaceA(LPCSTR lpRootPathName, LPDWORD lpSectorsPerCluster, + LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, + LPDWORD lpTotalNumberOfClusters); -WINPR_API BOOL MoveFileExA(LPCSTR lpExistingFileName, LPCSTR lpNewFileName, DWORD dwFlags); + WINPR_API BOOL GetDiskFreeSpaceW(LPCWSTR lpRootPathName, LPDWORD lpSectorsPerCluster, + LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, + LPDWORD lpTotalNumberOfClusters); -WINPR_API BOOL MoveFileExW(LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, DWORD dwFlags); + WINPR_API BOOL MoveFileExA(LPCSTR lpExistingFileName, LPCSTR lpNewFileName, DWORD dwFlags); -WINPR_API BOOL MoveFileA(LPCSTR lpExistingFileName, LPCSTR lpNewFileName); + WINPR_API BOOL MoveFileExW(LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, DWORD dwFlags); -WINPR_API BOOL MoveFileW(LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName); + WINPR_API BOOL MoveFileA(LPCSTR lpExistingFileName, LPCSTR lpNewFileName); + + WINPR_API BOOL MoveFileW(LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName); #ifdef __cplusplus } #endif #ifdef UNICODE -#define CreateFile CreateFileW -#define DeleteFile DeleteFileW -#define FindFirstFile FindFirstFileW -#define FindFirstFileEx FindFirstFileExW -#define FindNextFile FindNextFileW -#define CreateDirectory CreateDirectoryW -#define RemoveDirectory RemoveDirectoryW -#define GetFileAttributesEx GetFileAttributesExW -#define GetFileAttributes GetFileAttributesW -#define SetFileAttributes SetFileAttributesW -#define GetDiskFreeSpace GetDiskFreeSpaceW -#define MoveFileEx MoveFileExW -#define MoveFile MoveFileW +#define CreateFile CreateFileW +#define DeleteFile DeleteFileW +#define FindFirstFile FindFirstFileW +#define FindFirstFileEx FindFirstFileExW +#define FindNextFile FindNextFileW +#define CreateDirectory CreateDirectoryW +#define RemoveDirectory RemoveDirectoryW +#define GetFileAttributesEx GetFileAttributesExW +#define GetFileAttributes GetFileAttributesW +#define SetFileAttributes SetFileAttributesW +#define GetDiskFreeSpace GetDiskFreeSpaceW +#define MoveFileEx MoveFileExW +#define MoveFile MoveFileW #else -#define CreateFile CreateFileA -#define DeleteFile DeleteFileA -#define FindFirstFile FindFirstFileA -#define FindFirstFileEx FindFirstFileExA -#define FindNextFile FindNextFileA -#define CreateDirectory CreateDirectoryA -#define RemoveDirectory RemoveDirectoryA -#define GetFileAttributesEx GetFileAttributesExA -#define GetFileAttributes GetFileAttributesA -#define SetFileAttributes SetFileAttributesA -#define GetDiskFreeSpace GetDiskFreeSpaceA -#define MoveFileEx MoveFileExA -#define MoveFile MoveFileA +#define CreateFile CreateFileA +#define DeleteFile DeleteFileA +#define FindFirstFile FindFirstFileA +#define FindFirstFileEx FindFirstFileExA +#define FindNextFile FindNextFileA +#define CreateDirectory CreateDirectoryA +#define RemoveDirectory RemoveDirectoryA +#define GetFileAttributesEx GetFileAttributesExA +#define GetFileAttributes GetFileAttributesA +#define SetFileAttributes SetFileAttributesA +#define GetDiskFreeSpace GetDiskFreeSpaceA +#define MoveFileEx MoveFileExA +#define MoveFile MoveFileA #endif /* Extra Functions */ typedef BOOL (*pcIsFileHandled)(LPCSTR lpFileName); -typedef HANDLE (*pcCreateFileA)(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, - DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile); +typedef HANDLE (*pcCreateFileA)(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, + DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, + HANDLE hTemplateFile); typedef struct _HANDLE_CREATOR { @@ -417,45 +435,53 @@ WINPR_API BOOL ValidFileNameComponent(LPCWSTR lpFileName); #ifdef _UWP #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, - DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile); + WINPR_API HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, + DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, + HANDLE hTemplateFile); -WINPR_API HANDLE CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, - DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile); + WINPR_API HANDLE CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, + DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, + HANDLE hTemplateFile); -WINPR_API DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh); + WINPR_API DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh); -WINPR_API DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove, - PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod); + WINPR_API DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, + DWORD dwMoveMethod); -WINPR_API HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData); -WINPR_API HANDLE FindFirstFileW(LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFindFileData); + WINPR_API HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData); + WINPR_API HANDLE FindFirstFileW(LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFindFileData); -WINPR_API DWORD GetFullPathNameA(LPCSTR lpFileName, DWORD nBufferLength, LPSTR lpBuffer, LPSTR* lpFilePart); + WINPR_API DWORD GetFullPathNameA(LPCSTR lpFileName, DWORD nBufferLength, LPSTR lpBuffer, + LPSTR* lpFilePart); -WINPR_API BOOL GetDiskFreeSpaceA(LPCSTR lpRootPathName, LPDWORD lpSectorsPerCluster, - LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters); + WINPR_API BOOL GetDiskFreeSpaceA(LPCSTR lpRootPathName, LPDWORD lpSectorsPerCluster, + LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, + LPDWORD lpTotalNumberOfClusters); -WINPR_API BOOL GetDiskFreeSpaceW(LPCWSTR lpRootPathName, LPDWORD lpSectorsPerCluster, - LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters); + WINPR_API BOOL GetDiskFreeSpaceW(LPCWSTR lpRootPathName, LPDWORD lpSectorsPerCluster, + LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, + LPDWORD lpTotalNumberOfClusters); -WINPR_API DWORD GetLogicalDriveStringsA(DWORD nBufferLength, LPSTR lpBuffer); + WINPR_API DWORD GetLogicalDriveStringsA(DWORD nBufferLength, LPSTR lpBuffer); -WINPR_API DWORD GetLogicalDriveStringsW(DWORD nBufferLength, LPWSTR lpBuffer); + WINPR_API DWORD GetLogicalDriveStringsW(DWORD nBufferLength, LPWSTR lpBuffer); -WINPR_API BOOL PathIsDirectoryEmptyA(LPCSTR pszPath); + WINPR_API BOOL PathIsDirectoryEmptyA(LPCSTR pszPath); -WINPR_API UINT GetACP(void); + WINPR_API UINT GetACP(void); #ifdef UNICODE -#define CreateFile CreateFileW -#define FindFirstFile FindFirstFileW +#define CreateFile CreateFileW +#define FindFirstFile FindFirstFileW #else -#define CreateFile CreateFileA -#define FindFirstFile FindFirstFileA +#define CreateFile CreateFileA +#define FindFirstFile FindFirstFileA #endif #ifdef __cplusplus @@ -463,36 +489,37 @@ WINPR_API UINT GetACP(void); #endif #ifdef UNICODE -#define FindFirstFile FindFirstFileW +#define FindFirstFile FindFirstFileW #else -#define FindFirstFile FindFirstFileA +#define FindFirstFile FindFirstFileA #endif #endif -#define WILDCARD_STAR 0x00000001 -#define WILDCARD_QM 0x00000002 -#define WILDCARD_DOS 0x00000100 -#define WILDCARD_DOS_STAR 0x00000110 -#define WILDCARD_DOS_QM 0x00000120 -#define WILDCARD_DOS_DOT 0x00000140 +#define WILDCARD_STAR 0x00000001 +#define WILDCARD_QM 0x00000002 +#define WILDCARD_DOS 0x00000100 +#define WILDCARD_DOS_STAR 0x00000110 +#define WILDCARD_DOS_QM 0x00000120 +#define WILDCARD_DOS_DOT 0x00000140 #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API BOOL FilePatternMatchA(LPCSTR lpFileName, LPCSTR lpPattern); -WINPR_API LPSTR FilePatternFindNextWildcardA(LPCSTR lpPattern, DWORD* pFlags); + WINPR_API BOOL FilePatternMatchA(LPCSTR lpFileName, LPCSTR lpPattern); + WINPR_API LPSTR FilePatternFindNextWildcardA(LPCSTR lpPattern, DWORD* pFlags); -WINPR_API int UnixChangeFileMode(const char* filename, int flags); + WINPR_API int UnixChangeFileMode(const char* filename, int flags); -WINPR_API BOOL IsNamedPipeFileNameA(LPCSTR lpName); -WINPR_API char* GetNamedPipeNameWithoutPrefixA(LPCSTR lpName); -WINPR_API char* GetNamedPipeUnixDomainSocketBaseFilePathA(void); -WINPR_API char* GetNamedPipeUnixDomainSocketFilePathA(LPCSTR lpName); + WINPR_API BOOL IsNamedPipeFileNameA(LPCSTR lpName); + WINPR_API char* GetNamedPipeNameWithoutPrefixA(LPCSTR lpName); + WINPR_API char* GetNamedPipeUnixDomainSocketBaseFilePathA(void); + WINPR_API char* GetNamedPipeUnixDomainSocketFilePathA(LPCSTR lpName); -WINPR_API int GetNamePipeFileDescriptor(HANDLE hNamedPipe); -WINPR_API HANDLE GetFileHandleForFileDescriptor(int fd); + WINPR_API int GetNamePipeFileDescriptor(HANDLE hNamedPipe); + WINPR_API HANDLE GetFileHandleForFileDescriptor(int fd); #ifdef __cplusplus } diff --git a/winpr/include/winpr/handle.h b/winpr/include/winpr/handle.h index cf69532ad..ca2b4b7f9 100644 --- a/winpr/include/winpr/handle.h +++ b/winpr/include/winpr/handle.h @@ -28,34 +28,32 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -#define WINPR_FD_READ_BIT 0 -#define WINPR_FD_READ (1 << WINPR_FD_READ_BIT) +#define WINPR_FD_READ_BIT 0 +#define WINPR_FD_READ (1 << WINPR_FD_READ_BIT) -#define WINPR_FD_WRITE_BIT 1 -#define WINPR_FD_WRITE (1 << WINPR_FD_WRITE_BIT) +#define WINPR_FD_WRITE_BIT 1 +#define WINPR_FD_WRITE (1 << WINPR_FD_WRITE_BIT) #ifndef _WIN32 -#define DUPLICATE_CLOSE_SOURCE 0x00000001 -#define DUPLICATE_SAME_ACCESS 0x00000002 +#define DUPLICATE_CLOSE_SOURCE 0x00000001 +#define DUPLICATE_SAME_ACCESS 0x00000002 -#define HANDLE_FLAG_INHERIT 0x00000001 -#define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x00000002 +#define HANDLE_FLAG_INHERIT 0x00000001 +#define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x00000002 -WINPR_API BOOL CloseHandle(HANDLE hObject); + WINPR_API BOOL CloseHandle(HANDLE hObject); -WINPR_API BOOL DuplicateHandle(HANDLE hSourceProcessHandle, - HANDLE hSourceHandle, - HANDLE hTargetProcessHandle, - LPHANDLE lpTargetHandle, - DWORD dwDesiredAccess, - BOOL bInheritHandle, DWORD dwOptions); + WINPR_API BOOL DuplicateHandle(HANDLE hSourceProcessHandle, HANDLE hSourceHandle, + HANDLE hTargetProcessHandle, LPHANDLE lpTargetHandle, + DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwOptions); -WINPR_API BOOL GetHandleInformation(HANDLE hObject, LPDWORD lpdwFlags); -WINPR_API BOOL SetHandleInformation(HANDLE hObject, DWORD dwMask, DWORD dwFlags); + WINPR_API BOOL GetHandleInformation(HANDLE hObject, LPDWORD lpdwFlags); + WINPR_API BOOL SetHandleInformation(HANDLE hObject, DWORD dwMask, DWORD dwFlags); #endif @@ -64,4 +62,3 @@ WINPR_API BOOL SetHandleInformation(HANDLE hObject, DWORD dwMask, DWORD dwFlags) #endif #endif /* WINPR_HANDLE_H */ - diff --git a/winpr/include/winpr/heap.h b/winpr/include/winpr/heap.h index 30ab48ca9..3abbe6b93 100644 --- a/winpr/include/winpr/heap.h +++ b/winpr/include/winpr/heap.h @@ -28,19 +28,20 @@ #ifndef _WIN32 -#define HEAP_GENERATE_EXCEPTIONS 0x00000004 -#define HEAP_NO_SERIALIZE 0x00000001 -#define HEAP_ZERO_MEMORY 0x00000008 -#define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010 +#define HEAP_GENERATE_EXCEPTIONS 0x00000004 +#define HEAP_NO_SERIALIZE 0x00000001 +#define HEAP_ZERO_MEMORY 0x00000008 +#define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010 #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API HANDLE GetProcessHeap(void); -WINPR_API LPVOID HeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes); -WINPR_API LPVOID HeapReAlloc(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem, SIZE_T dwBytes); -WINPR_API BOOL HeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem); + WINPR_API HANDLE GetProcessHeap(void); + WINPR_API LPVOID HeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes); + WINPR_API LPVOID HeapReAlloc(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem, SIZE_T dwBytes); + WINPR_API BOOL HeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem); #ifdef __cplusplus } @@ -49,4 +50,3 @@ WINPR_API BOOL HeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem); #endif #endif /* WINPR_HEAP_H */ - diff --git a/winpr/include/winpr/image.h b/winpr/include/winpr/image.h index be784717c..24ec02dd1 100644 --- a/winpr/include/winpr/image.h +++ b/winpr/include/winpr/image.h @@ -63,8 +63,8 @@ typedef struct _WINPR_BITMAP_CORE_HEADER WINPR_BITMAP_CORE_HEADER; #pragma pack(pop) -#define WINPR_IMAGE_BITMAP 0 -#define WINPR_IMAGE_PNG 1 +#define WINPR_IMAGE_BITMAP 0 +#define WINPR_IMAGE_PNG 1 struct _wImage { @@ -79,18 +79,20 @@ struct _wImage typedef struct _wImage wImage; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API int winpr_bitmap_write(const char* filename, const BYTE* data, int width, int height, int bpp); + WINPR_API int winpr_bitmap_write(const char* filename, const BYTE* data, int width, int height, + int bpp); -WINPR_API int winpr_image_write(wImage* image, const char* filename); -WINPR_API int winpr_image_read(wImage* image, const char* filename); + WINPR_API int winpr_image_write(wImage* image, const char* filename); + WINPR_API int winpr_image_read(wImage* image, const char* filename); -WINPR_API int winpr_image_read_buffer(wImage* image, const BYTE* buffer, int size); + WINPR_API int winpr_image_read_buffer(wImage* image, const BYTE* buffer, int size); -WINPR_API wImage* winpr_image_new(); -WINPR_API void winpr_image_free(wImage* image, BOOL bFreeBuffer); + WINPR_API wImage* winpr_image_new(); + WINPR_API void winpr_image_free(wImage* image, BOOL bFreeBuffer); #ifdef __cplusplus } diff --git a/winpr/include/winpr/ini.h b/winpr/include/winpr/ini.h index fb592e152..442645c58 100644 --- a/winpr/include/winpr/ini.h +++ b/winpr/include/winpr/ini.h @@ -26,30 +26,33 @@ typedef struct _wIniFile wIniFile; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API int IniFile_ReadBuffer(wIniFile* ini, const char* buffer); -WINPR_API int IniFile_ReadFile(wIniFile* ini, const char* filename); + WINPR_API int IniFile_ReadBuffer(wIniFile* ini, const char* buffer); + WINPR_API int IniFile_ReadFile(wIniFile* ini, const char* filename); -WINPR_API char* IniFile_WriteBuffer(wIniFile* ini); -WINPR_API int IniFile_WriteFile(wIniFile* ini, const char* filename); + WINPR_API char* IniFile_WriteBuffer(wIniFile* ini); + WINPR_API int IniFile_WriteFile(wIniFile* ini, const char* filename); -WINPR_API char** IniFile_GetSectionNames(wIniFile* ini, int* count); -WINPR_API char** IniFile_GetSectionKeyNames(wIniFile* ini, const char* section, int* count); + WINPR_API char** IniFile_GetSectionNames(wIniFile* ini, int* count); + WINPR_API char** IniFile_GetSectionKeyNames(wIniFile* ini, const char* section, int* count); -WINPR_API const char* IniFile_GetKeyValueString(wIniFile* ini, const char* section, const char* key); -WINPR_API int IniFile_GetKeyValueInt(wIniFile* ini, const char* section, const char* key); + WINPR_API const char* IniFile_GetKeyValueString(wIniFile* ini, const char* section, + const char* key); + WINPR_API int IniFile_GetKeyValueInt(wIniFile* ini, const char* section, const char* key); -WINPR_API int IniFile_SetKeyValueString(wIniFile* ini, const char* section, const char* key, const char* value); -WINPR_API int IniFile_SetKeyValueInt(wIniFile* ini, const char* section, const char* key, int value); + WINPR_API int IniFile_SetKeyValueString(wIniFile* ini, const char* section, const char* key, + const char* value); + WINPR_API int IniFile_SetKeyValueInt(wIniFile* ini, const char* section, const char* key, + int value); -WINPR_API wIniFile* IniFile_New(void); -WINPR_API void IniFile_Free(wIniFile* ini); + WINPR_API wIniFile* IniFile_New(void); + WINPR_API void IniFile_Free(wIniFile* ini); #ifdef __cplusplus } #endif #endif /* WINPR_UTILS_INI_H */ - diff --git a/winpr/include/winpr/input.h b/winpr/include/winpr/input.h index 36918847f..5c5220773 100644 --- a/winpr/include/winpr/input.h +++ b/winpr/include/winpr/input.h @@ -20,7 +20,6 @@ #ifndef WINPR_INPUT_H #define WINPR_INPUT_H - #include #include @@ -28,14 +27,14 @@ * Key Flags */ -#define KBDEXT (USHORT) 0x0100 -#define KBDMULTIVK (USHORT) 0x0200 -#define KBDSPECIAL (USHORT) 0x0400 -#define KBDNUMPAD (USHORT) 0x0800 -#define KBDUNICODE (USHORT) 0x1000 -#define KBDINJECTEDVK (USHORT) 0x2000 -#define KBDMAPPEDVK (USHORT) 0x4000 -#define KBDBREAK (USHORT) 0x8000 +#define KBDEXT (USHORT)0x0100 +#define KBDMULTIVK (USHORT)0x0200 +#define KBDSPECIAL (USHORT)0x0400 +#define KBDNUMPAD (USHORT)0x0800 +#define KBDUNICODE (USHORT)0x1000 +#define KBDINJECTEDVK (USHORT)0x2000 +#define KBDMAPPEDVK (USHORT)0x4000 +#define KBDBREAK (USHORT)0x8000 /* * Virtual Key Codes (Windows): @@ -45,320 +44,326 @@ /* Mouse buttons */ -#define VK_LBUTTON 0x01 /* Left mouse button */ -#define VK_RBUTTON 0x02 /* Right mouse button */ -#define VK_CANCEL 0x03 /* Control-break processing */ -#define VK_MBUTTON 0x04 /* Middle mouse button (three-button mouse) */ -#define VK_XBUTTON1 0x05 /* Windows 2000/XP: X1 mouse button */ -#define VK_XBUTTON2 0x06 /* Windows 2000/XP: X2 mouse button */ +#define VK_LBUTTON 0x01 /* Left mouse button */ +#define VK_RBUTTON 0x02 /* Right mouse button */ +#define VK_CANCEL 0x03 /* Control-break processing */ +#define VK_MBUTTON 0x04 /* Middle mouse button (three-button mouse) */ +#define VK_XBUTTON1 0x05 /* Windows 2000/XP: X1 mouse button */ +#define VK_XBUTTON2 0x06 /* Windows 2000/XP: X2 mouse button */ /* 0x07 is undefined */ -#define VK_BACK 0x08 /* BACKSPACE key */ -#define VK_TAB 0x09 /* TAB key */ +#define VK_BACK 0x08 /* BACKSPACE key */ +#define VK_TAB 0x09 /* TAB key */ /* 0x0A to 0x0B are reserved */ -#define VK_CLEAR 0x0C /* CLEAR key */ -#define VK_RETURN 0x0D /* ENTER key */ +#define VK_CLEAR 0x0C /* CLEAR key */ +#define VK_RETURN 0x0D /* ENTER key */ /* 0x0E to 0x0F are undefined */ -#define VK_SHIFT 0x10 /* SHIFT key */ -#define VK_CONTROL 0x11 /* CTRL key */ -#define VK_MENU 0x12 /* ALT key */ -#define VK_PAUSE 0x13 /* PAUSE key */ -#define VK_CAPITAL 0x14 /* CAPS LOCK key */ -#define VK_KANA 0x15 /* Input Method Editor (IME) Kana mode */ -#define VK_HANGUEL 0x15 /* IME Hanguel mode (maintained for compatibility; use #define VK_HANGUL) */ -#define VK_HANGUL 0x15 /* IME Hangul mode */ +#define VK_SHIFT 0x10 /* SHIFT key */ +#define VK_CONTROL 0x11 /* CTRL key */ +#define VK_MENU 0x12 /* ALT key */ +#define VK_PAUSE 0x13 /* PAUSE key */ +#define VK_CAPITAL 0x14 /* CAPS LOCK key */ +#define VK_KANA 0x15 /* Input Method Editor (IME) Kana mode */ +#define VK_HANGUEL \ + 0x15 /* IME Hanguel mode (maintained for compatibility; use #define VK_HANGUL) \ + */ +#define VK_HANGUL 0x15 /* IME Hangul mode */ /* 0x16 is undefined */ -#define VK_JUNJA 0x17 /* IME Junja mode */ -#define VK_FINAL 0x18 /* IME final mode */ -#define VK_HANJA 0x19 /* IME Hanja mode */ -#define VK_KANJI 0x19 /* IME Kanji mode */ +#define VK_JUNJA 0x17 /* IME Junja mode */ +#define VK_FINAL 0x18 /* IME final mode */ +#define VK_HANJA 0x19 /* IME Hanja mode */ +#define VK_KANJI 0x19 /* IME Kanji mode */ /* 0x1A is undefined, use it for missing Hiragana/Katakana Toggle */ -#define VK_HKTG 0x1A /* Hiragana/Katakana toggle */ -#define VK_ESCAPE 0x1B /* ESC key */ -#define VK_CONVERT 0x1C /* IME convert */ -#define VK_NONCONVERT 0x1D /* IME nonconvert */ -#define VK_ACCEPT 0x1E /* IME accept */ -#define VK_MODECHANGE 0x1F /* IME mode change request */ +#define VK_HKTG 0x1A /* Hiragana/Katakana toggle */ +#define VK_ESCAPE 0x1B /* ESC key */ +#define VK_CONVERT 0x1C /* IME convert */ +#define VK_NONCONVERT 0x1D /* IME nonconvert */ +#define VK_ACCEPT 0x1E /* IME accept */ +#define VK_MODECHANGE 0x1F /* IME mode change request */ -#define VK_SPACE 0x20 /* SPACEBAR */ -#define VK_PRIOR 0x21 /* PAGE UP key */ -#define VK_NEXT 0x22 /* PAGE DOWN key */ -#define VK_END 0x23 /* END key */ -#define VK_HOME 0x24 /* HOME key */ -#define VK_LEFT 0x25 /* LEFT ARROW key */ -#define VK_UP 0x26 /* UP ARROW key */ -#define VK_RIGHT 0x27 /* RIGHT ARROW key */ -#define VK_DOWN 0x28 /* DOWN ARROW key */ -#define VK_SELECT 0x29 /* SELECT key */ -#define VK_PRINT 0x2A /* PRINT key */ -#define VK_EXECUTE 0x2B /* EXECUTE key */ -#define VK_SNAPSHOT 0x2C /* PRINT SCREEN key */ -#define VK_INSERT 0x2D /* INS key */ -#define VK_DELETE 0x2E /* DEL key */ -#define VK_HELP 0x2F /* HELP key */ +#define VK_SPACE 0x20 /* SPACEBAR */ +#define VK_PRIOR 0x21 /* PAGE UP key */ +#define VK_NEXT 0x22 /* PAGE DOWN key */ +#define VK_END 0x23 /* END key */ +#define VK_HOME 0x24 /* HOME key */ +#define VK_LEFT 0x25 /* LEFT ARROW key */ +#define VK_UP 0x26 /* UP ARROW key */ +#define VK_RIGHT 0x27 /* RIGHT ARROW key */ +#define VK_DOWN 0x28 /* DOWN ARROW key */ +#define VK_SELECT 0x29 /* SELECT key */ +#define VK_PRINT 0x2A /* PRINT key */ +#define VK_EXECUTE 0x2B /* EXECUTE key */ +#define VK_SNAPSHOT 0x2C /* PRINT SCREEN key */ +#define VK_INSERT 0x2D /* INS key */ +#define VK_DELETE 0x2E /* DEL key */ +#define VK_HELP 0x2F /* HELP key */ /* Digits, the last 4 bits of the code represent the corresponding digit */ -#define VK_KEY_0 0x30 /* '0' key */ -#define VK_KEY_1 0x31 /* '1' key */ -#define VK_KEY_2 0x32 /* '2' key */ -#define VK_KEY_3 0x33 /* '3' key */ -#define VK_KEY_4 0x34 /* '4' key */ -#define VK_KEY_5 0x35 /* '5' key */ -#define VK_KEY_6 0x36 /* '6' key */ -#define VK_KEY_7 0x37 /* '7' key */ -#define VK_KEY_8 0x38 /* '8' key */ -#define VK_KEY_9 0x39 /* '9' key */ +#define VK_KEY_0 0x30 /* '0' key */ +#define VK_KEY_1 0x31 /* '1' key */ +#define VK_KEY_2 0x32 /* '2' key */ +#define VK_KEY_3 0x33 /* '3' key */ +#define VK_KEY_4 0x34 /* '4' key */ +#define VK_KEY_5 0x35 /* '5' key */ +#define VK_KEY_6 0x36 /* '6' key */ +#define VK_KEY_7 0x37 /* '7' key */ +#define VK_KEY_8 0x38 /* '8' key */ +#define VK_KEY_9 0x39 /* '9' key */ /* 0x3A to 0x40 are undefined */ /* The alphabet, the code corresponds to the capitalized letter in the ASCII code */ -#define VK_KEY_A 0x41 /* 'A' key */ -#define VK_KEY_B 0x42 /* 'B' key */ -#define VK_KEY_C 0x43 /* 'C' key */ -#define VK_KEY_D 0x44 /* 'D' key */ -#define VK_KEY_E 0x45 /* 'E' key */ -#define VK_KEY_F 0x46 /* 'F' key */ -#define VK_KEY_G 0x47 /* 'G' key */ -#define VK_KEY_H 0x48 /* 'H' key */ -#define VK_KEY_I 0x49 /* 'I' key */ -#define VK_KEY_J 0x4A /* 'J' key */ -#define VK_KEY_K 0x4B /* 'K' key */ -#define VK_KEY_L 0x4C /* 'L' key */ -#define VK_KEY_M 0x4D /* 'M' key */ -#define VK_KEY_N 0x4E /* 'N' key */ -#define VK_KEY_O 0x4F /* 'O' key */ -#define VK_KEY_P 0x50 /* 'P' key */ -#define VK_KEY_Q 0x51 /* 'Q' key */ -#define VK_KEY_R 0x52 /* 'R' key */ -#define VK_KEY_S 0x53 /* 'S' key */ -#define VK_KEY_T 0x54 /* 'T' key */ -#define VK_KEY_U 0x55 /* 'U' key */ -#define VK_KEY_V 0x56 /* 'V' key */ -#define VK_KEY_W 0x57 /* 'W' key */ -#define VK_KEY_X 0x58 /* 'X' key */ -#define VK_KEY_Y 0x59 /* 'Y' key */ -#define VK_KEY_Z 0x5A /* 'Z' key */ +#define VK_KEY_A 0x41 /* 'A' key */ +#define VK_KEY_B 0x42 /* 'B' key */ +#define VK_KEY_C 0x43 /* 'C' key */ +#define VK_KEY_D 0x44 /* 'D' key */ +#define VK_KEY_E 0x45 /* 'E' key */ +#define VK_KEY_F 0x46 /* 'F' key */ +#define VK_KEY_G 0x47 /* 'G' key */ +#define VK_KEY_H 0x48 /* 'H' key */ +#define VK_KEY_I 0x49 /* 'I' key */ +#define VK_KEY_J 0x4A /* 'J' key */ +#define VK_KEY_K 0x4B /* 'K' key */ +#define VK_KEY_L 0x4C /* 'L' key */ +#define VK_KEY_M 0x4D /* 'M' key */ +#define VK_KEY_N 0x4E /* 'N' key */ +#define VK_KEY_O 0x4F /* 'O' key */ +#define VK_KEY_P 0x50 /* 'P' key */ +#define VK_KEY_Q 0x51 /* 'Q' key */ +#define VK_KEY_R 0x52 /* 'R' key */ +#define VK_KEY_S 0x53 /* 'S' key */ +#define VK_KEY_T 0x54 /* 'T' key */ +#define VK_KEY_U 0x55 /* 'U' key */ +#define VK_KEY_V 0x56 /* 'V' key */ +#define VK_KEY_W 0x57 /* 'W' key */ +#define VK_KEY_X 0x58 /* 'X' key */ +#define VK_KEY_Y 0x59 /* 'Y' key */ +#define VK_KEY_Z 0x5A /* 'Z' key */ -#define VK_LWIN 0x5B /* Left Windows key (Microsoft Natural keyboard) */ -#define VK_RWIN 0x5C /* Right Windows key (Natural keyboard) */ -#define VK_APPS 0x5D /* Applications key (Natural keyboard) */ +#define VK_LWIN 0x5B /* Left Windows key (Microsoft Natural keyboard) */ +#define VK_RWIN 0x5C /* Right Windows key (Natural keyboard) */ +#define VK_APPS 0x5D /* Applications key (Natural keyboard) */ /* 0x5E is reserved */ -#define VK_POWER 0x5E /* Power key */ +#define VK_POWER 0x5E /* Power key */ -#define VK_SLEEP 0x5F /* Computer Sleep key */ +#define VK_SLEEP 0x5F /* Computer Sleep key */ /* Numeric keypad digits, the last four bits of the code represent the corresponding digit */ -#define VK_NUMPAD0 0x60 /* Numeric keypad '0' key */ -#define VK_NUMPAD1 0x61 /* Numeric keypad '1' key */ -#define VK_NUMPAD2 0x62 /* Numeric keypad '2' key */ -#define VK_NUMPAD3 0x63 /* Numeric keypad '3' key */ -#define VK_NUMPAD4 0x64 /* Numeric keypad '4' key */ -#define VK_NUMPAD5 0x65 /* Numeric keypad '5' key */ -#define VK_NUMPAD6 0x66 /* Numeric keypad '6' key */ -#define VK_NUMPAD7 0x67 /* Numeric keypad '7' key */ -#define VK_NUMPAD8 0x68 /* Numeric keypad '8' key */ -#define VK_NUMPAD9 0x69 /* Numeric keypad '9' key */ +#define VK_NUMPAD0 0x60 /* Numeric keypad '0' key */ +#define VK_NUMPAD1 0x61 /* Numeric keypad '1' key */ +#define VK_NUMPAD2 0x62 /* Numeric keypad '2' key */ +#define VK_NUMPAD3 0x63 /* Numeric keypad '3' key */ +#define VK_NUMPAD4 0x64 /* Numeric keypad '4' key */ +#define VK_NUMPAD5 0x65 /* Numeric keypad '5' key */ +#define VK_NUMPAD6 0x66 /* Numeric keypad '6' key */ +#define VK_NUMPAD7 0x67 /* Numeric keypad '7' key */ +#define VK_NUMPAD8 0x68 /* Numeric keypad '8' key */ +#define VK_NUMPAD9 0x69 /* Numeric keypad '9' key */ /* Numeric keypad operators and special keys */ -#define VK_MULTIPLY 0x6A /* Multiply key */ -#define VK_ADD 0x6B /* Add key */ -#define VK_SEPARATOR 0x6C /* Separator key */ -#define VK_SUBTRACT 0x6D /* Subtract key */ -#define VK_DECIMAL 0x6E /* Decimal key */ -#define VK_DIVIDE 0x6F /* Divide key */ +#define VK_MULTIPLY 0x6A /* Multiply key */ +#define VK_ADD 0x6B /* Add key */ +#define VK_SEPARATOR 0x6C /* Separator key */ +#define VK_SUBTRACT 0x6D /* Subtract key */ +#define VK_DECIMAL 0x6E /* Decimal key */ +#define VK_DIVIDE 0x6F /* Divide key */ /* Function keys, from F1 to F24 */ -#define VK_F1 0x70 /* F1 key */ -#define VK_F2 0x71 /* F2 key */ -#define VK_F3 0x72 /* F3 key */ -#define VK_F4 0x73 /* F4 key */ -#define VK_F5 0x74 /* F5 key */ -#define VK_F6 0x75 /* F6 key */ -#define VK_F7 0x76 /* F7 key */ -#define VK_F8 0x77 /* F8 key */ -#define VK_F9 0x78 /* F9 key */ -#define VK_F10 0x79 /* F10 key */ -#define VK_F11 0x7A /* F11 key */ -#define VK_F12 0x7B /* F12 key */ -#define VK_F13 0x7C /* F13 key */ -#define VK_F14 0x7D /* F14 key */ -#define VK_F15 0x7E /* F15 key */ -#define VK_F16 0x7F /* F16 key */ -#define VK_F17 0x80 /* F17 key */ -#define VK_F18 0x81 /* F18 key */ -#define VK_F19 0x82 /* F19 key */ -#define VK_F20 0x83 /* F20 key */ -#define VK_F21 0x84 /* F21 key */ -#define VK_F22 0x85 /* F22 key */ -#define VK_F23 0x86 /* F23 key */ -#define VK_F24 0x87 /* F24 key */ +#define VK_F1 0x70 /* F1 key */ +#define VK_F2 0x71 /* F2 key */ +#define VK_F3 0x72 /* F3 key */ +#define VK_F4 0x73 /* F4 key */ +#define VK_F5 0x74 /* F5 key */ +#define VK_F6 0x75 /* F6 key */ +#define VK_F7 0x76 /* F7 key */ +#define VK_F8 0x77 /* F8 key */ +#define VK_F9 0x78 /* F9 key */ +#define VK_F10 0x79 /* F10 key */ +#define VK_F11 0x7A /* F11 key */ +#define VK_F12 0x7B /* F12 key */ +#define VK_F13 0x7C /* F13 key */ +#define VK_F14 0x7D /* F14 key */ +#define VK_F15 0x7E /* F15 key */ +#define VK_F16 0x7F /* F16 key */ +#define VK_F17 0x80 /* F17 key */ +#define VK_F18 0x81 /* F18 key */ +#define VK_F19 0x82 /* F19 key */ +#define VK_F20 0x83 /* F20 key */ +#define VK_F21 0x84 /* F21 key */ +#define VK_F22 0x85 /* F22 key */ +#define VK_F23 0x86 /* F23 key */ +#define VK_F24 0x87 /* F24 key */ /* 0x88 to 0x8F are unassigned */ -#define VK_NUMLOCK 0x90 /* NUM LOCK key */ -#define VK_SCROLL 0x91 /* SCROLL LOCK key */ +#define VK_NUMLOCK 0x90 /* NUM LOCK key */ +#define VK_SCROLL 0x91 /* SCROLL LOCK key */ /* 0x92 to 0x96 are OEM specific */ /* 0x97 to 0x9F are unassigned */ /* Modifier keys */ -#define VK_LSHIFT 0xA0 /* Left SHIFT key */ -#define VK_RSHIFT 0xA1 /* Right SHIFT key */ -#define VK_LCONTROL 0xA2 /* Left CONTROL key */ -#define VK_RCONTROL 0xA3 /* Right CONTROL key */ -#define VK_LMENU 0xA4 /* Left MENU key */ -#define VK_RMENU 0xA5 /* Right MENU key */ +#define VK_LSHIFT 0xA0 /* Left SHIFT key */ +#define VK_RSHIFT 0xA1 /* Right SHIFT key */ +#define VK_LCONTROL 0xA2 /* Left CONTROL key */ +#define VK_RCONTROL 0xA3 /* Right CONTROL key */ +#define VK_LMENU 0xA4 /* Left MENU key */ +#define VK_RMENU 0xA5 /* Right MENU key */ /* Browser related keys */ -#define VK_BROWSER_BACK 0xA6 /* Windows 2000/XP: Browser Back key */ -#define VK_BROWSER_FORWARD 0xA7 /* Windows 2000/XP: Browser Forward key */ -#define VK_BROWSER_REFRESH 0xA8 /* Windows 2000/XP: Browser Refresh key */ -#define VK_BROWSER_STOP 0xA9 /* Windows 2000/XP: Browser Stop key */ -#define VK_BROWSER_SEARCH 0xAA /* Windows 2000/XP: Browser Search key */ -#define VK_BROWSER_FAVORITES 0xAB /* Windows 2000/XP: Browser Favorites key */ -#define VK_BROWSER_HOME 0xAC /* Windows 2000/XP: Browser Start and Home key */ +#define VK_BROWSER_BACK 0xA6 /* Windows 2000/XP: Browser Back key */ +#define VK_BROWSER_FORWARD 0xA7 /* Windows 2000/XP: Browser Forward key */ +#define VK_BROWSER_REFRESH 0xA8 /* Windows 2000/XP: Browser Refresh key */ +#define VK_BROWSER_STOP 0xA9 /* Windows 2000/XP: Browser Stop key */ +#define VK_BROWSER_SEARCH 0xAA /* Windows 2000/XP: Browser Search key */ +#define VK_BROWSER_FAVORITES 0xAB /* Windows 2000/XP: Browser Favorites key */ +#define VK_BROWSER_HOME 0xAC /* Windows 2000/XP: Browser Start and Home key */ /* Volume related keys */ -#define VK_VOLUME_MUTE 0xAD /* Windows 2000/XP: Volume Mute key */ -#define VK_VOLUME_DOWN 0xAE /* Windows 2000/XP: Volume Down key */ -#define VK_VOLUME_UP 0xAF /* Windows 2000/XP: Volume Up key */ +#define VK_VOLUME_MUTE 0xAD /* Windows 2000/XP: Volume Mute key */ +#define VK_VOLUME_DOWN 0xAE /* Windows 2000/XP: Volume Down key */ +#define VK_VOLUME_UP 0xAF /* Windows 2000/XP: Volume Up key */ /* Media player related keys */ -#define VK_MEDIA_NEXT_TRACK 0xB0 /* Windows 2000/XP: Next Track key */ -#define VK_MEDIA_PREV_TRACK 0xB1 /* Windows 2000/XP: Previous Track key */ -#define VK_MEDIA_STOP 0xB2 /* Windows 2000/XP: Stop Media key */ -#define VK_MEDIA_PLAY_PAUSE 0xB3 /* Windows 2000/XP: Play/Pause Media key */ +#define VK_MEDIA_NEXT_TRACK 0xB0 /* Windows 2000/XP: Next Track key */ +#define VK_MEDIA_PREV_TRACK 0xB1 /* Windows 2000/XP: Previous Track key */ +#define VK_MEDIA_STOP 0xB2 /* Windows 2000/XP: Stop Media key */ +#define VK_MEDIA_PLAY_PAUSE 0xB3 /* Windows 2000/XP: Play/Pause Media key */ /* Application launcher keys */ -#define VK_LAUNCH_MAIL 0xB4 /* Windows 2000/XP: Start Mail key */ -#define VK_MEDIA_SELECT 0xB5 /* Windows 2000/XP: Select Media key */ -#define VK_LAUNCH_MEDIA_SELECT 0xB5 /* Windows 2000/XP: Select Media key */ -#define VK_LAUNCH_APP1 0xB6 /* Windows 2000/XP: Start Application 1 key */ -#define VK_LAUNCH_APP2 0xB7 /* Windows 2000/XP: Start Application 2 key */ +#define VK_LAUNCH_MAIL 0xB4 /* Windows 2000/XP: Start Mail key */ +#define VK_MEDIA_SELECT 0xB5 /* Windows 2000/XP: Select Media key */ +#define VK_LAUNCH_MEDIA_SELECT 0xB5 /* Windows 2000/XP: Select Media key */ +#define VK_LAUNCH_APP1 0xB6 /* Windows 2000/XP: Start Application 1 key */ +#define VK_LAUNCH_APP2 0xB7 /* Windows 2000/XP: Start Application 2 key */ /* 0xB8 and 0xB9 are reserved */ /* OEM keys */ -#define VK_OEM_1 0xBA /* Used for miscellaneous characters; it can vary by keyboard. */ - /* Windows 2000/XP: For the US standard keyboard, the ';:' key */ +#define VK_OEM_1 0xBA /* Used for miscellaneous characters; it can vary by keyboard. */ + /* Windows 2000/XP: For the US standard keyboard, the ';:' key */ -#define VK_OEM_PLUS 0xBB /* Windows 2000/XP: For any country/region, the '+' key */ -#define VK_OEM_COMMA 0xBC /* Windows 2000/XP: For any country/region, the ',' key */ -#define VK_OEM_MINUS 0xBD /* Windows 2000/XP: For any country/region, the '-' key */ -#define VK_OEM_PERIOD 0xBE /* Windows 2000/XP: For any country/region, the '.' key */ +#define VK_OEM_PLUS 0xBB /* Windows 2000/XP: For any country/region, the '+' key */ +#define VK_OEM_COMMA 0xBC /* Windows 2000/XP: For any country/region, the ',' key */ +#define VK_OEM_MINUS 0xBD /* Windows 2000/XP: For any country/region, the '-' key */ +#define VK_OEM_PERIOD 0xBE /* Windows 2000/XP: For any country/region, the '.' key */ -#define VK_OEM_2 0xBF /* Used for miscellaneous characters; it can vary by keyboard. */ - /* Windows 2000/XP: For the US standard keyboard, the '/?' key */ +#define VK_OEM_2 0xBF /* Used for miscellaneous characters; it can vary by keyboard. */ + /* Windows 2000/XP: For the US standard keyboard, the '/?' key */ -#define VK_OEM_3 0xC0 /* Used for miscellaneous characters; it can vary by keyboard. */ - /* Windows 2000/XP: For the US standard keyboard, the '`~' key */ +#define VK_OEM_3 0xC0 /* Used for miscellaneous characters; it can vary by keyboard. */ + /* Windows 2000/XP: For the US standard keyboard, the '`~' key */ /* 0xC1 to 0xD7 are reserved */ -#define VK_ABNT_C1 0xC1 /* Brazilian (ABNT) Keyboard */ -#define VK_ABNT_C2 0xC2 /* Brazilian (ABNT) Keyboard */ +#define VK_ABNT_C1 0xC1 /* Brazilian (ABNT) Keyboard */ +#define VK_ABNT_C2 0xC2 /* Brazilian (ABNT) Keyboard */ /* 0xD8 to 0xDA are unassigned */ -#define VK_OEM_4 0xDB /* Used for miscellaneous characters; it can vary by keyboard. */ - /* Windows 2000/XP: For the US standard keyboard, the '[{' key */ +#define VK_OEM_4 0xDB /* Used for miscellaneous characters; it can vary by keyboard. */ + /* Windows 2000/XP: For the US standard keyboard, the '[{' key */ -#define VK_OEM_5 0xDC /* Used for miscellaneous characters; it can vary by keyboard. */ - /* Windows 2000/XP: For the US standard keyboard, the '\|' key */ +#define VK_OEM_5 0xDC /* Used for miscellaneous characters; it can vary by keyboard. */ + /* Windows 2000/XP: For the US standard keyboard, the '\|' key */ -#define VK_OEM_6 0xDD /* Used for miscellaneous characters; it can vary by keyboard. */ - /* Windows 2000/XP: For the US standard keyboard, the ']}' key */ +#define VK_OEM_6 0xDD /* Used for miscellaneous characters; it can vary by keyboard. */ + /* Windows 2000/XP: For the US standard keyboard, the ']}' key */ -#define VK_OEM_7 0xDE /* Used for miscellaneous characters; it can vary by keyboard. */ - /* Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key */ +#define VK_OEM_7 0xDE /* Used for miscellaneous characters; it can vary by keyboard. */ +/* Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key */ -#define VK_OEM_8 0xDF /* Used for miscellaneous characters; it can vary by keyboard. */ +#define VK_OEM_8 0xDF /* Used for miscellaneous characters; it can vary by keyboard. */ /* 0xE0 is reserved */ -#define VK_OEM_AX 0xE1 /* AX key on Japanese AX keyboard */ +#define VK_OEM_AX 0xE1 /* AX key on Japanese AX keyboard */ -#define VK_OEM_102 0xE2 /* Windows 2000/XP: Either the angle bracket key or */ - /* the backslash key on the RT 102-key keyboard */ +#define VK_OEM_102 0xE2 /* Windows 2000/XP: Either the angle bracket key or */ + /* the backslash key on the RT 102-key keyboard */ /* 0xE3 and 0xE4 are OEM specific */ -#define VK_PROCESSKEY 0xE5 /* Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key */ +#define VK_PROCESSKEY \ + 0xE5 /* Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key \ + */ /* 0xE6 is OEM specific */ -#define VK_PACKET 0xE7 /* Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. */ - /* The #define VK_PACKET key is the low word of a 32-bit Virtual Key value used */ - /* for non-keyboard input methods. For more information, */ - /* see Remark in KEYBDINPUT, SendInput, WM_KEYDOWN, and WM_KEYUP */ +#define VK_PACKET \ + 0xE7 /* Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. */ +/* The #define VK_PACKET key is the low word of a 32-bit Virtual Key value used */ +/* for non-keyboard input methods. For more information, */ +/* see Remark in KEYBDINPUT, SendInput, WM_KEYDOWN, and WM_KEYUP */ /* 0xE8 is unassigned */ /* 0xE9 to 0xF5 are OEM specific */ -#define VK_OEM_RESET 0xE9 -#define VK_OEM_JUMP 0xEA -#define VK_OEM_PA1 0xEB -#define VK_OEM_PA2 0xEC -#define VK_OEM_PA3 0xED -#define VK_OEM_WSCTRL 0xEE -#define VK_OEM_CUSEL 0xEF -#define VK_OEM_ATTN 0xF0 -#define VK_OEM_FINISH 0xF1 -#define VK_OEM_COPY 0xF2 -#define VK_OEM_AUTO 0xF3 -#define VK_OEM_ENLW 0xF4 -#define VK_OEM_BACKTAB 0xF5 +#define VK_OEM_RESET 0xE9 +#define VK_OEM_JUMP 0xEA +#define VK_OEM_PA1 0xEB +#define VK_OEM_PA2 0xEC +#define VK_OEM_PA3 0xED +#define VK_OEM_WSCTRL 0xEE +#define VK_OEM_CUSEL 0xEF +#define VK_OEM_ATTN 0xF0 +#define VK_OEM_FINISH 0xF1 +#define VK_OEM_COPY 0xF2 +#define VK_OEM_AUTO 0xF3 +#define VK_OEM_ENLW 0xF4 +#define VK_OEM_BACKTAB 0xF5 -#define VK_ATTN 0xF6 /* Attn key */ -#define VK_CRSEL 0xF7 /* CrSel key */ -#define VK_EXSEL 0xF8 /* ExSel key */ -#define VK_EREOF 0xF9 /* Erase EOF key */ -#define VK_PLAY 0xFA /* Play key */ -#define VK_ZOOM 0xFB /* Zoom key */ -#define VK_NONAME 0xFC /* Reserved */ -#define VK_PA1 0xFD /* PA1 key */ -#define VK_OEM_CLEAR 0xFE /* Clear key */ +#define VK_ATTN 0xF6 /* Attn key */ +#define VK_CRSEL 0xF7 /* CrSel key */ +#define VK_EXSEL 0xF8 /* ExSel key */ +#define VK_EREOF 0xF9 /* Erase EOF key */ +#define VK_PLAY 0xFA /* Play key */ +#define VK_ZOOM 0xFB /* Zoom key */ +#define VK_NONAME 0xFC /* Reserved */ +#define VK_PA1 0xFD /* PA1 key */ +#define VK_OEM_CLEAR 0xFE /* Clear key */ -#define VK_NONE 0xFF /* no key */ +#define VK_NONE 0xFF /* no key */ /** * For East Asian Input Method Editors (IMEs) * the following additional virtual keyboard definitions must be observed. */ -#define VK_DBE_ALPHANUMERIC 0xF0 /* Changes the mode to alphanumeric. */ -#define VK_DBE_KATAKANA 0xF1 /* Changes the mode to Katakana. */ -#define VK_DBE_HIRAGANA 0xF2 /* Changes the mode to Hiragana. */ -#define VK_DBE_SBCSCHAR 0xF3 /* Changes the mode to single-byte characters. */ -#define VK_DBE_DBCSCHAR 0xF4 /* Changes the mode to double-byte characters. */ -#define VK_DBE_ROMAN 0xF5 /* Changes the mode to Roman characters. */ -#define VK_DBE_NOROMAN 0xF6 /* Changes the mode to non-Roman characters. */ -#define VK_DBE_ENTERWORDREGISTERMODE 0xF7 /* Activates the word registration dialog box. */ -#define VK_DBE_ENTERIMECONFIGMODE 0xF8 /* Activates a dialog box for setting up an IME environment. */ -#define VK_DBE_FLUSHSTRING 0xF9 /* Deletes the undetermined string without determining it. */ -#define VK_DBE_CODEINPUT 0xFA /* Changes the mode to code input. */ -#define VK_DBE_NOCODEINPUT 0xFB /* Changes the mode to no-code input. */ +#define VK_DBE_ALPHANUMERIC 0xF0 /* Changes the mode to alphanumeric. */ +#define VK_DBE_KATAKANA 0xF1 /* Changes the mode to Katakana. */ +#define VK_DBE_HIRAGANA 0xF2 /* Changes the mode to Hiragana. */ +#define VK_DBE_SBCSCHAR 0xF3 /* Changes the mode to single-byte characters. */ +#define VK_DBE_DBCSCHAR 0xF4 /* Changes the mode to double-byte characters. */ +#define VK_DBE_ROMAN 0xF5 /* Changes the mode to Roman characters. */ +#define VK_DBE_NOROMAN 0xF6 /* Changes the mode to non-Roman characters. */ +#define VK_DBE_ENTERWORDREGISTERMODE 0xF7 /* Activates the word registration dialog box. */ +#define VK_DBE_ENTERIMECONFIGMODE \ + 0xF8 /* Activates a dialog box for setting up an IME environment. */ +#define VK_DBE_FLUSHSTRING 0xF9 /* Deletes the undetermined string without determining it. */ +#define VK_DBE_CODEINPUT 0xFA /* Changes the mode to code input. */ +#define VK_DBE_NOCODEINPUT 0xFB /* Changes the mode to no-code input. */ /* * Virtual Scan Codes @@ -368,357 +373,357 @@ * Keyboard Type 4 */ -#define KBD4_T00 VK_NONE -#define KBD4_T01 VK_ESCAPE -#define KBD4_T02 VK_KEY_1 -#define KBD4_T03 VK_KEY_2 -#define KBD4_T04 VK_KEY_3 -#define KBD4_T05 VK_KEY_4 -#define KBD4_T06 VK_KEY_5 -#define KBD4_T07 VK_KEY_6 -#define KBD4_T08 VK_KEY_7 -#define KBD4_T09 VK_KEY_8 -#define KBD4_T0A VK_KEY_9 -#define KBD4_T0B VK_KEY_0 -#define KBD4_T0C VK_OEM_MINUS -#define KBD4_T0D VK_OEM_PLUS /* NE */ -#define KBD4_T0E VK_BACK -#define KBD4_T0F VK_TAB -#define KBD4_T10 VK_KEY_Q -#define KBD4_T11 VK_KEY_W -#define KBD4_T12 VK_KEY_E -#define KBD4_T13 VK_KEY_R -#define KBD4_T14 VK_KEY_T -#define KBD4_T15 VK_KEY_Y -#define KBD4_T16 VK_KEY_U -#define KBD4_T17 VK_KEY_I -#define KBD4_T18 VK_KEY_O -#define KBD4_T19 VK_KEY_P -#define KBD4_T1A VK_OEM_4 /* NE */ -#define KBD4_T1B VK_OEM_6 /* NE */ -#define KBD4_T1C VK_RETURN -#define KBD4_T1D VK_LCONTROL -#define KBD4_T1E VK_KEY_A -#define KBD4_T1F VK_KEY_S -#define KBD4_T20 VK_KEY_D -#define KBD4_T21 VK_KEY_F -#define KBD4_T22 VK_KEY_G -#define KBD4_T23 VK_KEY_H -#define KBD4_T24 VK_KEY_J -#define KBD4_T25 VK_KEY_K -#define KBD4_T26 VK_KEY_L -#define KBD4_T27 VK_OEM_1 /* NE */ -#define KBD4_T28 VK_OEM_7 /* NE */ -#define KBD4_T29 VK_OEM_3 /* NE */ -#define KBD4_T2A VK_LSHIFT -#define KBD4_T2B VK_OEM_5 -#define KBD4_T2C VK_KEY_Z -#define KBD4_T2D VK_KEY_X -#define KBD4_T2E VK_KEY_C -#define KBD4_T2F VK_KEY_V -#define KBD4_T30 VK_KEY_B -#define KBD4_T31 VK_KEY_N -#define KBD4_T32 VK_KEY_M -#define KBD4_T33 VK_OEM_COMMA -#define KBD4_T34 VK_OEM_PERIOD -#define KBD4_T35 VK_OEM_2 -#define KBD4_T36 VK_RSHIFT -#define KBD4_T37 VK_MULTIPLY -#define KBD4_T38 VK_LMENU -#define KBD4_T39 VK_SPACE -#define KBD4_T3A VK_CAPITAL -#define KBD4_T3B VK_F1 -#define KBD4_T3C VK_F2 -#define KBD4_T3D VK_F3 -#define KBD4_T3E VK_F4 -#define KBD4_T3F VK_F5 -#define KBD4_T40 VK_F6 -#define KBD4_T41 VK_F7 -#define KBD4_T42 VK_F8 -#define KBD4_T43 VK_F9 -#define KBD4_T44 VK_F10 -#define KBD4_T45 VK_NUMLOCK -#define KBD4_T46 VK_SCROLL -#define KBD4_T47 VK_NUMPAD7 /* VK_HOME */ -#define KBD4_T48 VK_NUMPAD8 /* VK_UP */ -#define KBD4_T49 VK_NUMPAD9 /* VK_PRIOR */ -#define KBD4_T4A VK_SUBTRACT -#define KBD4_T4B VK_NUMPAD4 /* VK_LEFT */ -#define KBD4_T4C VK_NUMPAD5 /* VK_CLEAR */ -#define KBD4_T4D VK_NUMPAD6 /* VK_RIGHT */ -#define KBD4_T4E VK_ADD -#define KBD4_T4F VK_NUMPAD1 /* VK_END */ -#define KBD4_T50 VK_NUMPAD2 /* VK_DOWN */ -#define KBD4_T51 VK_NUMPAD3 /* VK_NEXT */ -#define KBD4_T52 VK_NUMPAD0 /* VK_INSERT */ -#define KBD4_T53 VK_DECIMAL /* VK_DELETE */ -#define KBD4_T54 VK_SNAPSHOT -#define KBD4_T55 VK_NONE -#define KBD4_T56 VK_OEM_102 /* NE */ -#define KBD4_T57 VK_F11 /* NE */ -#define KBD4_T58 VK_F12 /* NE */ -#define KBD4_T59 VK_CLEAR -#define KBD4_T5A VK_OEM_WSCTRL -#define KBD4_T5B VK_OEM_FINISH -#define KBD4_T5C VK_OEM_JUMP -#define KBD4_T5D VK_EREOF -#define KBD4_T5E VK_OEM_BACKTAB -#define KBD4_T5F VK_OEM_AUTO -#define KBD4_T60 VK_NONE -#define KBD4_T61 VK_NONE -#define KBD4_T62 VK_ZOOM -#define KBD4_T63 VK_HELP -#define KBD4_T64 VK_F13 -#define KBD4_T65 VK_F14 -#define KBD4_T66 VK_F15 -#define KBD4_T67 VK_F16 -#define KBD4_T68 VK_F17 -#define KBD4_T69 VK_F18 -#define KBD4_T6A VK_F19 -#define KBD4_T6B VK_F20 -#define KBD4_T6C VK_F21 -#define KBD4_T6D VK_F22 -#define KBD4_T6E VK_F23 -#define KBD4_T6F VK_OEM_PA3 -#define KBD4_T70 VK_NONE -#define KBD4_T71 VK_OEM_RESET -#define KBD4_T72 VK_NONE -#define KBD4_T73 VK_ABNT_C1 -#define KBD4_T74 VK_NONE -#define KBD4_T75 VK_NONE -#define KBD4_T76 VK_F24 -#define KBD4_T77 VK_NONE -#define KBD4_T78 VK_NONE -#define KBD4_T79 VK_NONE -#define KBD4_T7A VK_NONE -#define KBD4_T7B VK_OEM_PA1 -#define KBD4_T7C VK_TAB -#define KBD4_T7D VK_NONE -#define KBD4_T7E VK_ABNT_C2 -#define KBD4_T7F VK_OEM_PA2 +#define KBD4_T00 VK_NONE +#define KBD4_T01 VK_ESCAPE +#define KBD4_T02 VK_KEY_1 +#define KBD4_T03 VK_KEY_2 +#define KBD4_T04 VK_KEY_3 +#define KBD4_T05 VK_KEY_4 +#define KBD4_T06 VK_KEY_5 +#define KBD4_T07 VK_KEY_6 +#define KBD4_T08 VK_KEY_7 +#define KBD4_T09 VK_KEY_8 +#define KBD4_T0A VK_KEY_9 +#define KBD4_T0B VK_KEY_0 +#define KBD4_T0C VK_OEM_MINUS +#define KBD4_T0D VK_OEM_PLUS /* NE */ +#define KBD4_T0E VK_BACK +#define KBD4_T0F VK_TAB +#define KBD4_T10 VK_KEY_Q +#define KBD4_T11 VK_KEY_W +#define KBD4_T12 VK_KEY_E +#define KBD4_T13 VK_KEY_R +#define KBD4_T14 VK_KEY_T +#define KBD4_T15 VK_KEY_Y +#define KBD4_T16 VK_KEY_U +#define KBD4_T17 VK_KEY_I +#define KBD4_T18 VK_KEY_O +#define KBD4_T19 VK_KEY_P +#define KBD4_T1A VK_OEM_4 /* NE */ +#define KBD4_T1B VK_OEM_6 /* NE */ +#define KBD4_T1C VK_RETURN +#define KBD4_T1D VK_LCONTROL +#define KBD4_T1E VK_KEY_A +#define KBD4_T1F VK_KEY_S +#define KBD4_T20 VK_KEY_D +#define KBD4_T21 VK_KEY_F +#define KBD4_T22 VK_KEY_G +#define KBD4_T23 VK_KEY_H +#define KBD4_T24 VK_KEY_J +#define KBD4_T25 VK_KEY_K +#define KBD4_T26 VK_KEY_L +#define KBD4_T27 VK_OEM_1 /* NE */ +#define KBD4_T28 VK_OEM_7 /* NE */ +#define KBD4_T29 VK_OEM_3 /* NE */ +#define KBD4_T2A VK_LSHIFT +#define KBD4_T2B VK_OEM_5 +#define KBD4_T2C VK_KEY_Z +#define KBD4_T2D VK_KEY_X +#define KBD4_T2E VK_KEY_C +#define KBD4_T2F VK_KEY_V +#define KBD4_T30 VK_KEY_B +#define KBD4_T31 VK_KEY_N +#define KBD4_T32 VK_KEY_M +#define KBD4_T33 VK_OEM_COMMA +#define KBD4_T34 VK_OEM_PERIOD +#define KBD4_T35 VK_OEM_2 +#define KBD4_T36 VK_RSHIFT +#define KBD4_T37 VK_MULTIPLY +#define KBD4_T38 VK_LMENU +#define KBD4_T39 VK_SPACE +#define KBD4_T3A VK_CAPITAL +#define KBD4_T3B VK_F1 +#define KBD4_T3C VK_F2 +#define KBD4_T3D VK_F3 +#define KBD4_T3E VK_F4 +#define KBD4_T3F VK_F5 +#define KBD4_T40 VK_F6 +#define KBD4_T41 VK_F7 +#define KBD4_T42 VK_F8 +#define KBD4_T43 VK_F9 +#define KBD4_T44 VK_F10 +#define KBD4_T45 VK_NUMLOCK +#define KBD4_T46 VK_SCROLL +#define KBD4_T47 VK_NUMPAD7 /* VK_HOME */ +#define KBD4_T48 VK_NUMPAD8 /* VK_UP */ +#define KBD4_T49 VK_NUMPAD9 /* VK_PRIOR */ +#define KBD4_T4A VK_SUBTRACT +#define KBD4_T4B VK_NUMPAD4 /* VK_LEFT */ +#define KBD4_T4C VK_NUMPAD5 /* VK_CLEAR */ +#define KBD4_T4D VK_NUMPAD6 /* VK_RIGHT */ +#define KBD4_T4E VK_ADD +#define KBD4_T4F VK_NUMPAD1 /* VK_END */ +#define KBD4_T50 VK_NUMPAD2 /* VK_DOWN */ +#define KBD4_T51 VK_NUMPAD3 /* VK_NEXT */ +#define KBD4_T52 VK_NUMPAD0 /* VK_INSERT */ +#define KBD4_T53 VK_DECIMAL /* VK_DELETE */ +#define KBD4_T54 VK_SNAPSHOT +#define KBD4_T55 VK_NONE +#define KBD4_T56 VK_OEM_102 /* NE */ +#define KBD4_T57 VK_F11 /* NE */ +#define KBD4_T58 VK_F12 /* NE */ +#define KBD4_T59 VK_CLEAR +#define KBD4_T5A VK_OEM_WSCTRL +#define KBD4_T5B VK_OEM_FINISH +#define KBD4_T5C VK_OEM_JUMP +#define KBD4_T5D VK_EREOF +#define KBD4_T5E VK_OEM_BACKTAB +#define KBD4_T5F VK_OEM_AUTO +#define KBD4_T60 VK_NONE +#define KBD4_T61 VK_NONE +#define KBD4_T62 VK_ZOOM +#define KBD4_T63 VK_HELP +#define KBD4_T64 VK_F13 +#define KBD4_T65 VK_F14 +#define KBD4_T66 VK_F15 +#define KBD4_T67 VK_F16 +#define KBD4_T68 VK_F17 +#define KBD4_T69 VK_F18 +#define KBD4_T6A VK_F19 +#define KBD4_T6B VK_F20 +#define KBD4_T6C VK_F21 +#define KBD4_T6D VK_F22 +#define KBD4_T6E VK_F23 +#define KBD4_T6F VK_OEM_PA3 +#define KBD4_T70 VK_NONE +#define KBD4_T71 VK_OEM_RESET +#define KBD4_T72 VK_NONE +#define KBD4_T73 VK_ABNT_C1 +#define KBD4_T74 VK_NONE +#define KBD4_T75 VK_NONE +#define KBD4_T76 VK_F24 +#define KBD4_T77 VK_NONE +#define KBD4_T78 VK_NONE +#define KBD4_T79 VK_NONE +#define KBD4_T7A VK_NONE +#define KBD4_T7B VK_OEM_PA1 +#define KBD4_T7C VK_TAB +#define KBD4_T7D VK_NONE +#define KBD4_T7E VK_ABNT_C2 +#define KBD4_T7F VK_OEM_PA2 -#define KBD4_X10 VK_MEDIA_PREV_TRACK -#define KBD4_X19 VK_MEDIA_NEXT_TRACK -#define KBD4_X1C VK_RETURN -#define KBD4_X1D VK_RCONTROL -#define KBD4_X20 VK_VOLUME_MUTE -#define KBD4_X21 VK_LAUNCH_APP2 -#define KBD4_X22 VK_MEDIA_PLAY_PAUSE -#define KBD4_X24 VK_MEDIA_STOP -#define KBD4_X2E VK_VOLUME_DOWN -#define KBD4_X30 VK_VOLUME_UP -#define KBD4_X32 VK_BROWSER_HOME -#define KBD4_X35 VK_DIVIDE -#define KBD4_X37 VK_SNAPSHOT -#define KBD4_X38 VK_RMENU -#define KBD4_X46 VK_PAUSE /* VK_CANCEL */ -#define KBD4_X47 VK_HOME -#define KBD4_X48 VK_UP -#define KBD4_X49 VK_PRIOR -#define KBD4_X4B VK_LEFT -#define KBD4_X4D VK_RIGHT -#define KBD4_X4F VK_END -#define KBD4_X50 VK_DOWN -#define KBD4_X51 VK_NEXT /* NE */ -#define KBD4_X52 VK_INSERT -#define KBD4_X53 VK_DELETE -#define KBD4_X5B VK_LWIN -#define KBD4_X5C VK_RWIN -#define KBD4_X5D VK_APPS -#define KBD4_X5E VK_POWER -#define KBD4_X5F VK_SLEEP -#define KBD4_X65 VK_BROWSER_SEARCH -#define KBD4_X66 VK_BROWSER_FAVORITES -#define KBD4_X67 VK_BROWSER_REFRESH -#define KBD4_X68 VK_BROWSER_STOP -#define KBD4_X69 VK_BROWSER_FORWARD -#define KBD4_X6A VK_BROWSER_BACK -#define KBD4_X6B VK_LAUNCH_APP1 -#define KBD4_X6C VK_LAUNCH_MAIL -#define KBD4_X6D VK_LAUNCH_MEDIA_SELECT +#define KBD4_X10 VK_MEDIA_PREV_TRACK +#define KBD4_X19 VK_MEDIA_NEXT_TRACK +#define KBD4_X1C VK_RETURN +#define KBD4_X1D VK_RCONTROL +#define KBD4_X20 VK_VOLUME_MUTE +#define KBD4_X21 VK_LAUNCH_APP2 +#define KBD4_X22 VK_MEDIA_PLAY_PAUSE +#define KBD4_X24 VK_MEDIA_STOP +#define KBD4_X2E VK_VOLUME_DOWN +#define KBD4_X30 VK_VOLUME_UP +#define KBD4_X32 VK_BROWSER_HOME +#define KBD4_X35 VK_DIVIDE +#define KBD4_X37 VK_SNAPSHOT +#define KBD4_X38 VK_RMENU +#define KBD4_X46 VK_PAUSE /* VK_CANCEL */ +#define KBD4_X47 VK_HOME +#define KBD4_X48 VK_UP +#define KBD4_X49 VK_PRIOR +#define KBD4_X4B VK_LEFT +#define KBD4_X4D VK_RIGHT +#define KBD4_X4F VK_END +#define KBD4_X50 VK_DOWN +#define KBD4_X51 VK_NEXT /* NE */ +#define KBD4_X52 VK_INSERT +#define KBD4_X53 VK_DELETE +#define KBD4_X5B VK_LWIN +#define KBD4_X5C VK_RWIN +#define KBD4_X5D VK_APPS +#define KBD4_X5E VK_POWER +#define KBD4_X5F VK_SLEEP +#define KBD4_X65 VK_BROWSER_SEARCH +#define KBD4_X66 VK_BROWSER_FAVORITES +#define KBD4_X67 VK_BROWSER_REFRESH +#define KBD4_X68 VK_BROWSER_STOP +#define KBD4_X69 VK_BROWSER_FORWARD +#define KBD4_X6A VK_BROWSER_BACK +#define KBD4_X6B VK_LAUNCH_APP1 +#define KBD4_X6C VK_LAUNCH_MAIL +#define KBD4_X6D VK_LAUNCH_MEDIA_SELECT -#define KBD4_Y1D VK_PAUSE +#define KBD4_Y1D VK_PAUSE /** * Keyboard Type 7 */ -#define KBD7_T00 VK_NONE -#define KBD7_T01 VK_ESCAPE -#define KBD7_T02 VK_KEY_1 -#define KBD7_T03 VK_KEY_2 -#define KBD7_T04 VK_KEY_3 -#define KBD7_T05 VK_KEY_4 -#define KBD7_T06 VK_KEY_5 -#define KBD7_T07 VK_KEY_6 -#define KBD7_T08 VK_KEY_7 -#define KBD7_T09 VK_KEY_8 -#define KBD7_T0A VK_KEY_9 -#define KBD7_T0B VK_KEY_0 -#define KBD7_T0C VK_OEM_MINUS -#define KBD7_T0D VK_OEM_PLUS -#define KBD7_T0E VK_BACK -#define KBD7_T0F VK_TAB -#define KBD7_T10 VK_KEY_Q -#define KBD7_T11 VK_KEY_W -#define KBD7_T12 VK_KEY_E -#define KBD7_T13 VK_KEY_R -#define KBD7_T14 VK_KEY_T -#define KBD7_T15 VK_KEY_Y -#define KBD7_T16 VK_KEY_U -#define KBD7_T17 VK_KEY_I -#define KBD7_T18 VK_KEY_O -#define KBD7_T19 VK_KEY_P -#define KBD7_T1A VK_OEM_4 /* NE */ -#define KBD7_T1B VK_OEM_6 /* NE */ -#define KBD7_T1C VK_RETURN -#define KBD7_T1D VK_LCONTROL -#define KBD7_T1E VK_KEY_A -#define KBD7_T1F VK_KEY_S -#define KBD7_T20 VK_KEY_D -#define KBD7_T21 VK_KEY_F -#define KBD7_T22 VK_KEY_G -#define KBD7_T23 VK_KEY_H -#define KBD7_T24 VK_KEY_J -#define KBD7_T25 VK_KEY_K -#define KBD7_T26 VK_KEY_L -#define KBD7_T27 VK_OEM_1 -#define KBD7_T28 VK_OEM_7 -#define KBD7_T29 VK_OEM_3 /* NE */ -#define KBD7_T2A VK_LSHIFT -#define KBD7_T2B VK_OEM_5 /* NE */ -#define KBD7_T2C VK_KEY_Z -#define KBD7_T2D VK_KEY_X -#define KBD7_T2E VK_KEY_C -#define KBD7_T2F VK_KEY_V -#define KBD7_T30 VK_KEY_B -#define KBD7_T31 VK_KEY_N -#define KBD7_T32 VK_KEY_M -#define KBD7_T33 VK_OEM_COMMA -#define KBD7_T34 VK_OEM_PERIOD -#define KBD7_T35 VK_OEM_2 -#define KBD7_T36 VK_RSHIFT -#define KBD7_T37 VK_MULTIPLY -#define KBD7_T38 VK_LMENU -#define KBD7_T39 VK_SPACE -#define KBD7_T3A VK_CAPITAL -#define KBD7_T3B VK_F1 -#define KBD7_T3C VK_F2 -#define KBD7_T3D VK_F3 -#define KBD7_T3E VK_F4 -#define KBD7_T3F VK_F5 -#define KBD7_T40 VK_F6 -#define KBD7_T41 VK_F7 -#define KBD7_T42 VK_F8 -#define KBD7_T43 VK_F9 -#define KBD7_T44 VK_F10 -#define KBD7_T45 VK_NUMLOCK -#define KBD7_T46 VK_SCROLL -#define KBD7_T47 VK_NUMPAD7 /* VK_HOME */ -#define KBD7_T48 VK_NUMPAD8 /* VK_UP */ -#define KBD7_T49 VK_NUMPAD9 /* VK_PRIOR */ -#define KBD7_T4A VK_SUBTRACT -#define KBD7_T4B VK_NUMPAD4 /* VK_LEFT */ -#define KBD7_T4C VK_NUMPAD5 /* VK_CLEAR */ -#define KBD7_T4D VK_NUMPAD6 /* VK_RIGHT */ -#define KBD7_T4E VK_ADD -#define KBD7_T4F VK_NUMPAD1 /* VK_END */ -#define KBD7_T50 VK_NUMPAD2 /* VK_DOWN */ -#define KBD7_T51 VK_NUMPAD3 /* VK_NEXT */ -#define KBD7_T52 VK_NUMPAD0 /* VK_INSERT */ -#define KBD7_T53 VK_DECIMAL /* VK_DELETE */ -#define KBD7_T54 VK_SNAPSHOT -#define KBD7_T55 VK_NONE -#define KBD7_T56 VK_OEM_102 -#define KBD7_T57 VK_F11 -#define KBD7_T58 VK_F12 -#define KBD7_T59 VK_CLEAR -#define KBD7_T5A VK_NONAME /* NE */ -#define KBD7_T5B VK_NONAME /* NE */ -#define KBD7_T5C VK_NONAME /* NE */ -#define KBD7_T5D VK_EREOF -#define KBD7_T5E VK_NONE /* NE */ -#define KBD7_T5F VK_NONAME /* NE */ -#define KBD7_T60 VK_NONE -#define KBD7_T61 VK_NONE /* NE */ -#define KBD7_T62 VK_NONE /* NE */ -#define KBD7_T63 VK_NONE -#define KBD7_T64 VK_F13 -#define KBD7_T65 VK_F14 -#define KBD7_T66 VK_F15 -#define KBD7_T67 VK_F16 -#define KBD7_T68 VK_F17 -#define KBD7_T69 VK_F18 -#define KBD7_T6A VK_F19 -#define KBD7_T6B VK_F20 -#define KBD7_T6C VK_F21 -#define KBD7_T6D VK_F22 -#define KBD7_T6E VK_F23 -#define KBD7_T6F VK_NONE /* NE */ -#define KBD7_T70 VK_HKTG /* NE */ -#define KBD7_T71 VK_NONE /* NE */ -#define KBD7_T72 VK_NONE -#define KBD7_T73 VK_ABNT_C1 -#define KBD7_T74 VK_NONE -#define KBD7_T75 VK_NONE -#define KBD7_T76 VK_F24 -#define KBD7_T77 VK_NONE -#define KBD7_T78 VK_NONE -#define KBD7_T79 VK_CONVERT /* NE */ -#define KBD7_T7A VK_NONE -#define KBD7_T7B VK_NONCONVERT /* NE */ -#define KBD7_T7C VK_TAB -#define KBD7_T7D VK_OEM_8 -#define KBD7_T7E VK_ABNT_C2 -#define KBD7_T7F VK_OEM_PA2 +#define KBD7_T00 VK_NONE +#define KBD7_T01 VK_ESCAPE +#define KBD7_T02 VK_KEY_1 +#define KBD7_T03 VK_KEY_2 +#define KBD7_T04 VK_KEY_3 +#define KBD7_T05 VK_KEY_4 +#define KBD7_T06 VK_KEY_5 +#define KBD7_T07 VK_KEY_6 +#define KBD7_T08 VK_KEY_7 +#define KBD7_T09 VK_KEY_8 +#define KBD7_T0A VK_KEY_9 +#define KBD7_T0B VK_KEY_0 +#define KBD7_T0C VK_OEM_MINUS +#define KBD7_T0D VK_OEM_PLUS +#define KBD7_T0E VK_BACK +#define KBD7_T0F VK_TAB +#define KBD7_T10 VK_KEY_Q +#define KBD7_T11 VK_KEY_W +#define KBD7_T12 VK_KEY_E +#define KBD7_T13 VK_KEY_R +#define KBD7_T14 VK_KEY_T +#define KBD7_T15 VK_KEY_Y +#define KBD7_T16 VK_KEY_U +#define KBD7_T17 VK_KEY_I +#define KBD7_T18 VK_KEY_O +#define KBD7_T19 VK_KEY_P +#define KBD7_T1A VK_OEM_4 /* NE */ +#define KBD7_T1B VK_OEM_6 /* NE */ +#define KBD7_T1C VK_RETURN +#define KBD7_T1D VK_LCONTROL +#define KBD7_T1E VK_KEY_A +#define KBD7_T1F VK_KEY_S +#define KBD7_T20 VK_KEY_D +#define KBD7_T21 VK_KEY_F +#define KBD7_T22 VK_KEY_G +#define KBD7_T23 VK_KEY_H +#define KBD7_T24 VK_KEY_J +#define KBD7_T25 VK_KEY_K +#define KBD7_T26 VK_KEY_L +#define KBD7_T27 VK_OEM_1 +#define KBD7_T28 VK_OEM_7 +#define KBD7_T29 VK_OEM_3 /* NE */ +#define KBD7_T2A VK_LSHIFT +#define KBD7_T2B VK_OEM_5 /* NE */ +#define KBD7_T2C VK_KEY_Z +#define KBD7_T2D VK_KEY_X +#define KBD7_T2E VK_KEY_C +#define KBD7_T2F VK_KEY_V +#define KBD7_T30 VK_KEY_B +#define KBD7_T31 VK_KEY_N +#define KBD7_T32 VK_KEY_M +#define KBD7_T33 VK_OEM_COMMA +#define KBD7_T34 VK_OEM_PERIOD +#define KBD7_T35 VK_OEM_2 +#define KBD7_T36 VK_RSHIFT +#define KBD7_T37 VK_MULTIPLY +#define KBD7_T38 VK_LMENU +#define KBD7_T39 VK_SPACE +#define KBD7_T3A VK_CAPITAL +#define KBD7_T3B VK_F1 +#define KBD7_T3C VK_F2 +#define KBD7_T3D VK_F3 +#define KBD7_T3E VK_F4 +#define KBD7_T3F VK_F5 +#define KBD7_T40 VK_F6 +#define KBD7_T41 VK_F7 +#define KBD7_T42 VK_F8 +#define KBD7_T43 VK_F9 +#define KBD7_T44 VK_F10 +#define KBD7_T45 VK_NUMLOCK +#define KBD7_T46 VK_SCROLL +#define KBD7_T47 VK_NUMPAD7 /* VK_HOME */ +#define KBD7_T48 VK_NUMPAD8 /* VK_UP */ +#define KBD7_T49 VK_NUMPAD9 /* VK_PRIOR */ +#define KBD7_T4A VK_SUBTRACT +#define KBD7_T4B VK_NUMPAD4 /* VK_LEFT */ +#define KBD7_T4C VK_NUMPAD5 /* VK_CLEAR */ +#define KBD7_T4D VK_NUMPAD6 /* VK_RIGHT */ +#define KBD7_T4E VK_ADD +#define KBD7_T4F VK_NUMPAD1 /* VK_END */ +#define KBD7_T50 VK_NUMPAD2 /* VK_DOWN */ +#define KBD7_T51 VK_NUMPAD3 /* VK_NEXT */ +#define KBD7_T52 VK_NUMPAD0 /* VK_INSERT */ +#define KBD7_T53 VK_DECIMAL /* VK_DELETE */ +#define KBD7_T54 VK_SNAPSHOT +#define KBD7_T55 VK_NONE +#define KBD7_T56 VK_OEM_102 +#define KBD7_T57 VK_F11 +#define KBD7_T58 VK_F12 +#define KBD7_T59 VK_CLEAR +#define KBD7_T5A VK_NONAME /* NE */ +#define KBD7_T5B VK_NONAME /* NE */ +#define KBD7_T5C VK_NONAME /* NE */ +#define KBD7_T5D VK_EREOF +#define KBD7_T5E VK_NONE /* NE */ +#define KBD7_T5F VK_NONAME /* NE */ +#define KBD7_T60 VK_NONE +#define KBD7_T61 VK_NONE /* NE */ +#define KBD7_T62 VK_NONE /* NE */ +#define KBD7_T63 VK_NONE +#define KBD7_T64 VK_F13 +#define KBD7_T65 VK_F14 +#define KBD7_T66 VK_F15 +#define KBD7_T67 VK_F16 +#define KBD7_T68 VK_F17 +#define KBD7_T69 VK_F18 +#define KBD7_T6A VK_F19 +#define KBD7_T6B VK_F20 +#define KBD7_T6C VK_F21 +#define KBD7_T6D VK_F22 +#define KBD7_T6E VK_F23 +#define KBD7_T6F VK_NONE /* NE */ +#define KBD7_T70 VK_HKTG /* NE */ +#define KBD7_T71 VK_NONE /* NE */ +#define KBD7_T72 VK_NONE +#define KBD7_T73 VK_ABNT_C1 +#define KBD7_T74 VK_NONE +#define KBD7_T75 VK_NONE +#define KBD7_T76 VK_F24 +#define KBD7_T77 VK_NONE +#define KBD7_T78 VK_NONE +#define KBD7_T79 VK_CONVERT /* NE */ +#define KBD7_T7A VK_NONE +#define KBD7_T7B VK_NONCONVERT /* NE */ +#define KBD7_T7C VK_TAB +#define KBD7_T7D VK_OEM_8 +#define KBD7_T7E VK_ABNT_C2 +#define KBD7_T7F VK_OEM_PA2 -#define KBD7_X10 VK_MEDIA_PREV_TRACK -#define KBD7_X19 VK_MEDIA_NEXT_TRACK -#define KBD7_X1C VK_RETURN -#define KBD7_X1D VK_RCONTROL -#define KBD7_X20 VK_VOLUME_MUTE -#define KBD7_X21 VK_LAUNCH_APP2 -#define KBD7_X22 VK_MEDIA_PLAY_PAUSE -#define KBD7_X24 VK_MEDIA_STOP -#define KBD7_X2E VK_VOLUME_DOWN -#define KBD7_X30 VK_VOLUME_UP -#define KBD7_X32 VK_BROWSER_HOME -#define KBD7_X33 VK_NONE -#define KBD7_X35 VK_DIVIDE -#define KBD7_X37 VK_SNAPSHOT -#define KBD7_X38 VK_RMENU -#define KBD7_X42 VK_NONE -#define KBD7_X43 VK_NONE -#define KBD7_X44 VK_NONE -#define KBD7_X46 VK_CANCEL -#define KBD7_X47 VK_HOME -#define KBD7_X48 VK_UP -#define KBD7_X49 VK_PRIOR -#define KBD7_X4B VK_LEFT -#define KBD7_X4D VK_RIGHT -#define KBD7_X4F VK_END -#define KBD7_X50 VK_DOWN -#define KBD7_X51 VK_NEXT -#define KBD7_X52 VK_INSERT -#define KBD7_X53 VK_DELETE -#define KBD7_X5B VK_LWIN -#define KBD7_X5C VK_RWIN -#define KBD7_X5D VK_APPS -#define KBD7_X5E VK_POWER -#define KBD7_X5F VK_SLEEP -#define KBD7_X65 VK_BROWSER_SEARCH -#define KBD7_X66 VK_BROWSER_FAVORITES -#define KBD7_X67 VK_BROWSER_REFRESH -#define KBD7_X68 VK_BROWSER_STOP -#define KBD7_X69 VK_BROWSER_FORWARD -#define KBD7_X6A VK_BROWSER_BACK -#define KBD7_X6B VK_LAUNCH_APP1 -#define KBD7_X6C VK_LAUNCH_MAIL -#define KBD7_X6D VK_LAUNCH_MEDIA_SELECT -#define KBD7_XF1 VK_NONE /* NE */ -#define KBD7_XF2 VK_NONE /* NE */ +#define KBD7_X10 VK_MEDIA_PREV_TRACK +#define KBD7_X19 VK_MEDIA_NEXT_TRACK +#define KBD7_X1C VK_RETURN +#define KBD7_X1D VK_RCONTROL +#define KBD7_X20 VK_VOLUME_MUTE +#define KBD7_X21 VK_LAUNCH_APP2 +#define KBD7_X22 VK_MEDIA_PLAY_PAUSE +#define KBD7_X24 VK_MEDIA_STOP +#define KBD7_X2E VK_VOLUME_DOWN +#define KBD7_X30 VK_VOLUME_UP +#define KBD7_X32 VK_BROWSER_HOME +#define KBD7_X33 VK_NONE +#define KBD7_X35 VK_DIVIDE +#define KBD7_X37 VK_SNAPSHOT +#define KBD7_X38 VK_RMENU +#define KBD7_X42 VK_NONE +#define KBD7_X43 VK_NONE +#define KBD7_X44 VK_NONE +#define KBD7_X46 VK_CANCEL +#define KBD7_X47 VK_HOME +#define KBD7_X48 VK_UP +#define KBD7_X49 VK_PRIOR +#define KBD7_X4B VK_LEFT +#define KBD7_X4D VK_RIGHT +#define KBD7_X4F VK_END +#define KBD7_X50 VK_DOWN +#define KBD7_X51 VK_NEXT +#define KBD7_X52 VK_INSERT +#define KBD7_X53 VK_DELETE +#define KBD7_X5B VK_LWIN +#define KBD7_X5C VK_RWIN +#define KBD7_X5D VK_APPS +#define KBD7_X5E VK_POWER +#define KBD7_X5F VK_SLEEP +#define KBD7_X65 VK_BROWSER_SEARCH +#define KBD7_X66 VK_BROWSER_FAVORITES +#define KBD7_X67 VK_BROWSER_REFRESH +#define KBD7_X68 VK_BROWSER_STOP +#define KBD7_X69 VK_BROWSER_FORWARD +#define KBD7_X6A VK_BROWSER_BACK +#define KBD7_X6B VK_LAUNCH_APP1 +#define KBD7_X6C VK_LAUNCH_MAIL +#define KBD7_X6D VK_LAUNCH_MEDIA_SELECT +#define KBD7_XF1 VK_NONE /* NE */ +#define KBD7_XF2 VK_NONE /* NE */ -#define KBD7_Y1D VK_PAUSE +#define KBD7_Y1D VK_PAUSE /** * X11 Keycodes @@ -728,154 +733,155 @@ * Mac OS X */ -#define APPLE_VK_ANSI_A 0x00 -#define APPLE_VK_ANSI_S 0x01 -#define APPLE_VK_ANSI_D 0x02 -#define APPLE_VK_ANSI_F 0x03 -#define APPLE_VK_ANSI_H 0x04 -#define APPLE_VK_ANSI_G 0x05 -#define APPLE_VK_ANSI_Z 0x06 -#define APPLE_VK_ANSI_X 0x07 -#define APPLE_VK_ANSI_C 0x08 -#define APPLE_VK_ANSI_V 0x09 -#define APPLE_VK_ISO_Section 0x0A -#define APPLE_VK_ANSI_B 0x0B -#define APPLE_VK_ANSI_Q 0x0C -#define APPLE_VK_ANSI_W 0x0D -#define APPLE_VK_ANSI_E 0x0E -#define APPLE_VK_ANSI_R 0x0F -#define APPLE_VK_ANSI_Y 0x10 -#define APPLE_VK_ANSI_T 0x11 -#define APPLE_VK_ANSI_1 0x12 -#define APPLE_VK_ANSI_2 0x13 -#define APPLE_VK_ANSI_3 0x14 -#define APPLE_VK_ANSI_4 0x15 -#define APPLE_VK_ANSI_6 0x16 -#define APPLE_VK_ANSI_5 0x17 -#define APPLE_VK_ANSI_Equal 0x18 -#define APPLE_VK_ANSI_9 0x19 -#define APPLE_VK_ANSI_7 0x1A -#define APPLE_VK_ANSI_Minus 0x1B -#define APPLE_VK_ANSI_8 0x1C -#define APPLE_VK_ANSI_0 0x1D -#define APPLE_VK_ANSI_RightBracket 0x1E -#define APPLE_VK_ANSI_O 0x1F -#define APPLE_VK_ANSI_U 0x20 -#define APPLE_VK_ANSI_LeftBracket 0x21 -#define APPLE_VK_ANSI_I 0x22 -#define APPLE_VK_ANSI_P 0x23 -#define APPLE_VK_Return 0x24 -#define APPLE_VK_ANSI_L 0x25 -#define APPLE_VK_ANSI_J 0x26 -#define APPLE_VK_ANSI_Quote 0x27 -#define APPLE_VK_ANSI_K 0x28 -#define APPLE_VK_ANSI_Semicolon 0x29 -#define APPLE_VK_ANSI_Backslash 0x2A -#define APPLE_VK_ANSI_Comma 0x2B -#define APPLE_VK_ANSI_Slash 0x2C -#define APPLE_VK_ANSI_N 0x2D -#define APPLE_VK_ANSI_M 0x2E -#define APPLE_VK_ANSI_Period 0x2F -#define APPLE_VK_Tab 0x30 -#define APPLE_VK_Space 0x31 -#define APPLE_VK_ANSI_Grave 0x32 -#define APPLE_VK_Delete 0x33 -#define APPLE_VK_0x34 0x34 -#define APPLE_VK_Escape 0x35 -#define APPLE_VK_0x36 0x36 -#define APPLE_VK_Command 0x37 -#define APPLE_VK_Shift 0x38 -#define APPLE_VK_CapsLock 0x39 -#define APPLE_VK_Option 0x3A -#define APPLE_VK_Control 0x3B -#define APPLE_VK_RightShift 0x3C -#define APPLE_VK_RightOption 0x3D -#define APPLE_VK_RightControl 0x3E -#define APPLE_VK_Function 0x3F -#define APPLE_VK_F17 0x40 -#define APPLE_VK_ANSI_KeypadDecimal 0x41 -#define APPLE_VK_0x42 0x42 -#define APPLE_VK_ANSI_KeypadMultiply 0x43 -#define APPLE_VK_0x44 0x44 -#define APPLE_VK_ANSI_KeypadPlus 0x45 -#define APPLE_VK_0x46 0x46 -#define APPLE_VK_ANSI_KeypadClear 0x47 -#define APPLE_VK_VolumeUp 0x48 -#define APPLE_VK_VolumeDown 0x49 -#define APPLE_VK_Mute 0x4A -#define APPLE_VK_ANSI_KeypadDivide 0x4B -#define APPLE_VK_ANSI_KeypadEnter 0x4C -#define APPLE_VK_0x4D 0x4D -#define APPLE_VK_ANSI_KeypadMinus 0x4E -#define APPLE_VK_F18 0x4F -#define APPLE_VK_F19 0x50 -#define APPLE_VK_ANSI_KeypadEquals 0x51 -#define APPLE_VK_ANSI_Keypad0 0x52 -#define APPLE_VK_ANSI_Keypad1 0x53 -#define APPLE_VK_ANSI_Keypad2 0x54 -#define APPLE_VK_ANSI_Keypad3 0x55 -#define APPLE_VK_ANSI_Keypad4 0x56 -#define APPLE_VK_ANSI_Keypad5 0x57 -#define APPLE_VK_ANSI_Keypad6 0x58 -#define APPLE_VK_ANSI_Keypad7 0x59 -#define APPLE_VK_F20 0x5A -#define APPLE_VK_ANSI_Keypad8 0x5B -#define APPLE_VK_ANSI_Keypad9 0x5C -#define APPLE_VK_JIS_Yen 0x5D -#define APPLE_VK_JIS_Underscore 0x5E -#define APPLE_VK_JIS_KeypadComma 0x5F -#define APPLE_VK_F5 0x60 -#define APPLE_VK_F6 0x61 -#define APPLE_VK_F7 0x62 -#define APPLE_VK_F3 0x63 -#define APPLE_VK_F8 0x64 -#define APPLE_VK_F9 0x65 -#define APPLE_VK_JIS_Eisu 0x66 -#define APPLE_VK_F11 0x67 -#define APPLE_VK_JIS_Kana 0x68 -#define APPLE_VK_F13 0x69 -#define APPLE_VK_F16 0x6A -#define APPLE_VK_F14 0x6B -#define APPLE_VK_F10 0x6D -#define APPLE_VK_0x6C 0x6C -#define APPLE_VK_0x6E 0x6E -#define APPLE_VK_F12 0x6F -#define APPLE_VK_0x70 0x70 -#define APPLE_VK_F15 0x71 -#define APPLE_VK_Help 0x72 -#define APPLE_VK_Home 0x73 -#define APPLE_VK_PageUp 0x74 -#define APPLE_VK_ForwardDelete 0x75 -#define APPLE_VK_F4 0x76 -#define APPLE_VK_End 0x77 -#define APPLE_VK_F2 0x78 -#define APPLE_VK_PageDown 0x79 -#define APPLE_VK_F1 0x7A -#define APPLE_VK_LeftArrow 0x7B -#define APPLE_VK_RightArrow 0x7C -#define APPLE_VK_DownArrow 0x7D -#define APPLE_VK_UpArrow 0x7E +#define APPLE_VK_ANSI_A 0x00 +#define APPLE_VK_ANSI_S 0x01 +#define APPLE_VK_ANSI_D 0x02 +#define APPLE_VK_ANSI_F 0x03 +#define APPLE_VK_ANSI_H 0x04 +#define APPLE_VK_ANSI_G 0x05 +#define APPLE_VK_ANSI_Z 0x06 +#define APPLE_VK_ANSI_X 0x07 +#define APPLE_VK_ANSI_C 0x08 +#define APPLE_VK_ANSI_V 0x09 +#define APPLE_VK_ISO_Section 0x0A +#define APPLE_VK_ANSI_B 0x0B +#define APPLE_VK_ANSI_Q 0x0C +#define APPLE_VK_ANSI_W 0x0D +#define APPLE_VK_ANSI_E 0x0E +#define APPLE_VK_ANSI_R 0x0F +#define APPLE_VK_ANSI_Y 0x10 +#define APPLE_VK_ANSI_T 0x11 +#define APPLE_VK_ANSI_1 0x12 +#define APPLE_VK_ANSI_2 0x13 +#define APPLE_VK_ANSI_3 0x14 +#define APPLE_VK_ANSI_4 0x15 +#define APPLE_VK_ANSI_6 0x16 +#define APPLE_VK_ANSI_5 0x17 +#define APPLE_VK_ANSI_Equal 0x18 +#define APPLE_VK_ANSI_9 0x19 +#define APPLE_VK_ANSI_7 0x1A +#define APPLE_VK_ANSI_Minus 0x1B +#define APPLE_VK_ANSI_8 0x1C +#define APPLE_VK_ANSI_0 0x1D +#define APPLE_VK_ANSI_RightBracket 0x1E +#define APPLE_VK_ANSI_O 0x1F +#define APPLE_VK_ANSI_U 0x20 +#define APPLE_VK_ANSI_LeftBracket 0x21 +#define APPLE_VK_ANSI_I 0x22 +#define APPLE_VK_ANSI_P 0x23 +#define APPLE_VK_Return 0x24 +#define APPLE_VK_ANSI_L 0x25 +#define APPLE_VK_ANSI_J 0x26 +#define APPLE_VK_ANSI_Quote 0x27 +#define APPLE_VK_ANSI_K 0x28 +#define APPLE_VK_ANSI_Semicolon 0x29 +#define APPLE_VK_ANSI_Backslash 0x2A +#define APPLE_VK_ANSI_Comma 0x2B +#define APPLE_VK_ANSI_Slash 0x2C +#define APPLE_VK_ANSI_N 0x2D +#define APPLE_VK_ANSI_M 0x2E +#define APPLE_VK_ANSI_Period 0x2F +#define APPLE_VK_Tab 0x30 +#define APPLE_VK_Space 0x31 +#define APPLE_VK_ANSI_Grave 0x32 +#define APPLE_VK_Delete 0x33 +#define APPLE_VK_0x34 0x34 +#define APPLE_VK_Escape 0x35 +#define APPLE_VK_0x36 0x36 +#define APPLE_VK_Command 0x37 +#define APPLE_VK_Shift 0x38 +#define APPLE_VK_CapsLock 0x39 +#define APPLE_VK_Option 0x3A +#define APPLE_VK_Control 0x3B +#define APPLE_VK_RightShift 0x3C +#define APPLE_VK_RightOption 0x3D +#define APPLE_VK_RightControl 0x3E +#define APPLE_VK_Function 0x3F +#define APPLE_VK_F17 0x40 +#define APPLE_VK_ANSI_KeypadDecimal 0x41 +#define APPLE_VK_0x42 0x42 +#define APPLE_VK_ANSI_KeypadMultiply 0x43 +#define APPLE_VK_0x44 0x44 +#define APPLE_VK_ANSI_KeypadPlus 0x45 +#define APPLE_VK_0x46 0x46 +#define APPLE_VK_ANSI_KeypadClear 0x47 +#define APPLE_VK_VolumeUp 0x48 +#define APPLE_VK_VolumeDown 0x49 +#define APPLE_VK_Mute 0x4A +#define APPLE_VK_ANSI_KeypadDivide 0x4B +#define APPLE_VK_ANSI_KeypadEnter 0x4C +#define APPLE_VK_0x4D 0x4D +#define APPLE_VK_ANSI_KeypadMinus 0x4E +#define APPLE_VK_F18 0x4F +#define APPLE_VK_F19 0x50 +#define APPLE_VK_ANSI_KeypadEquals 0x51 +#define APPLE_VK_ANSI_Keypad0 0x52 +#define APPLE_VK_ANSI_Keypad1 0x53 +#define APPLE_VK_ANSI_Keypad2 0x54 +#define APPLE_VK_ANSI_Keypad3 0x55 +#define APPLE_VK_ANSI_Keypad4 0x56 +#define APPLE_VK_ANSI_Keypad5 0x57 +#define APPLE_VK_ANSI_Keypad6 0x58 +#define APPLE_VK_ANSI_Keypad7 0x59 +#define APPLE_VK_F20 0x5A +#define APPLE_VK_ANSI_Keypad8 0x5B +#define APPLE_VK_ANSI_Keypad9 0x5C +#define APPLE_VK_JIS_Yen 0x5D +#define APPLE_VK_JIS_Underscore 0x5E +#define APPLE_VK_JIS_KeypadComma 0x5F +#define APPLE_VK_F5 0x60 +#define APPLE_VK_F6 0x61 +#define APPLE_VK_F7 0x62 +#define APPLE_VK_F3 0x63 +#define APPLE_VK_F8 0x64 +#define APPLE_VK_F9 0x65 +#define APPLE_VK_JIS_Eisu 0x66 +#define APPLE_VK_F11 0x67 +#define APPLE_VK_JIS_Kana 0x68 +#define APPLE_VK_F13 0x69 +#define APPLE_VK_F16 0x6A +#define APPLE_VK_F14 0x6B +#define APPLE_VK_F10 0x6D +#define APPLE_VK_0x6C 0x6C +#define APPLE_VK_0x6E 0x6E +#define APPLE_VK_F12 0x6F +#define APPLE_VK_0x70 0x70 +#define APPLE_VK_F15 0x71 +#define APPLE_VK_Help 0x72 +#define APPLE_VK_Home 0x73 +#define APPLE_VK_PageUp 0x74 +#define APPLE_VK_ForwardDelete 0x75 +#define APPLE_VK_F4 0x76 +#define APPLE_VK_End 0x77 +#define APPLE_VK_F2 0x78 +#define APPLE_VK_PageDown 0x79 +#define APPLE_VK_F1 0x7A +#define APPLE_VK_LeftArrow 0x7B +#define APPLE_VK_RightArrow 0x7C +#define APPLE_VK_DownArrow 0x7D +#define APPLE_VK_UpArrow 0x7E #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/** - * Functions - */ + /** + * Functions + */ -WINPR_API char* GetVirtualKeyName(DWORD vkcode); -WINPR_API DWORD GetVirtualKeyCodeFromName(const char* vkname); -WINPR_API DWORD GetVirtualKeyCodeFromXkbKeyName(const char* xkbname); + WINPR_API char* GetVirtualKeyName(DWORD vkcode); + WINPR_API DWORD GetVirtualKeyCodeFromName(const char* vkname); + WINPR_API DWORD GetVirtualKeyCodeFromXkbKeyName(const char* xkbname); -WINPR_API DWORD GetVirtualKeyCodeFromVirtualScanCode(DWORD scancode, DWORD dwKeyboardType); -WINPR_API DWORD GetVirtualScanCodeFromVirtualKeyCode(DWORD vkcode, DWORD dwKeyboardType); + WINPR_API DWORD GetVirtualKeyCodeFromVirtualScanCode(DWORD scancode, DWORD dwKeyboardType); + WINPR_API DWORD GetVirtualScanCodeFromVirtualKeyCode(DWORD vkcode, DWORD dwKeyboardType); -#define KEYCODE_TYPE_APPLE 0x00000001 -#define KEYCODE_TYPE_EVDEV 0x00000002 +#define KEYCODE_TYPE_APPLE 0x00000001 +#define KEYCODE_TYPE_EVDEV 0x00000002 -WINPR_API DWORD GetVirtualKeyCodeFromKeycode(DWORD keycode, DWORD dwFlags); -WINPR_API DWORD GetKeycodeFromVirtualKeyCode(DWORD keycode, DWORD dwFlags); + WINPR_API DWORD GetVirtualKeyCodeFromKeycode(DWORD keycode, DWORD dwFlags); + WINPR_API DWORD GetKeycodeFromVirtualKeyCode(DWORD keycode, DWORD dwFlags); #ifdef __cplusplus } diff --git a/winpr/include/winpr/interlocked.h b/winpr/include/winpr/interlocked.h index 660f8f379..5be208598 100644 --- a/winpr/include/winpr/interlocked.h +++ b/winpr/include/winpr/interlocked.h @@ -26,56 +26,57 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif #ifndef _WIN32 #ifndef CONTAINING_RECORD #define CONTAINING_RECORD(address, type, field) \ - ((type *)(((ULONG_PTR) address) - (ULONG_PTR)(&(((type *) 0)->field)))) + ((type*)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type*)0)->field)))) #endif -typedef struct _WINPR_LIST_ENTRY WINPR_LIST_ENTRY; -typedef struct _WINPR_LIST_ENTRY* WINPR_PLIST_ENTRY; + typedef struct _WINPR_LIST_ENTRY WINPR_LIST_ENTRY; + typedef struct _WINPR_LIST_ENTRY* WINPR_PLIST_ENTRY; -struct _WINPR_LIST_ENTRY -{ + struct _WINPR_LIST_ENTRY + { WINPR_PLIST_ENTRY Flink; WINPR_PLIST_ENTRY Blink; -}; + }; -typedef struct _WINPR_SINGLE_LIST_ENTRY WINPR_SINGLE_LIST_ENTRY; -typedef struct _WINPR_SINGLE_LIST_ENTRY* WINPR_PSINGLE_LIST_ENTRY; + typedef struct _WINPR_SINGLE_LIST_ENTRY WINPR_SINGLE_LIST_ENTRY; + typedef struct _WINPR_SINGLE_LIST_ENTRY* WINPR_PSINGLE_LIST_ENTRY; -struct _WINPR_SINGLE_LIST_ENTRY -{ + struct _WINPR_SINGLE_LIST_ENTRY + { WINPR_PSINGLE_LIST_ENTRY Next; -}; + }; -typedef struct WINPR_LIST_ENTRY32 -{ - DWORD Flink; - DWORD Blink; -} WINPR_LIST_ENTRY32; -typedef WINPR_LIST_ENTRY32 *WINPR_PLIST_ENTRY32; + typedef struct WINPR_LIST_ENTRY32 + { + DWORD Flink; + DWORD Blink; + } WINPR_LIST_ENTRY32; + typedef WINPR_LIST_ENTRY32* WINPR_PLIST_ENTRY32; -typedef struct WINPR_LIST_ENTRY64 -{ - ULONGLONG Flink; - ULONGLONG Blink; -} WINPR_LIST_ENTRY64; -typedef WINPR_LIST_ENTRY64 *WINPR_PLIST_ENTRY64; + typedef struct WINPR_LIST_ENTRY64 + { + ULONGLONG Flink; + ULONGLONG Blink; + } WINPR_LIST_ENTRY64; + typedef WINPR_LIST_ENTRY64* WINPR_PLIST_ENTRY64; #ifdef _WIN64 -typedef struct _WINPR_SLIST_ENTRY *WINPR_PSLIST_ENTRY; -typedef struct DECLSPEC_ALIGN(16) _WINPR_SLIST_ENTRY -{ - WINPR_PSLIST_ENTRY Next; -} WINPR_SLIST_ENTRY; + typedef struct _WINPR_SLIST_ENTRY* WINPR_PSLIST_ENTRY; + typedef struct DECLSPEC_ALIGN(16) _WINPR_SLIST_ENTRY + { + WINPR_PSLIST_ENTRY Next; + } WINPR_SLIST_ENTRY; -#else /* _WIN64 */ +#else /* _WIN64 */ #define WINPR_SLIST_ENTRY WINPR_SINGLE_LIST_ENTRY #define _WINPR_SLIST_ENTRY _WINPR_SINGLE_LIST_ENTRY @@ -85,71 +86,75 @@ typedef struct DECLSPEC_ALIGN(16) _WINPR_SLIST_ENTRY #ifdef _WIN64 -typedef union DECLSPEC_ALIGN(16) _WINPR_SLIST_HEADER -{ - struct - { + typedef union DECLSPEC_ALIGN(16) _WINPR_SLIST_HEADER { + struct + { + ULONGLONG Alignment; + ULONGLONG Region; + } DUMMYSTRUCTNAME; + + struct + { + ULONGLONG Depth : 16; + ULONGLONG Sequence : 9; + ULONGLONG NextEntry : 39; + ULONGLONG HeaderType : 1; + ULONGLONG Init : 1; + ULONGLONG Reserved : 59; + ULONGLONG Region : 3; + } Header8; + + struct + { + ULONGLONG Depth : 16; + ULONGLONG Sequence : 48; + ULONGLONG HeaderType : 1; + ULONGLONG Reserved : 3; + ULONGLONG NextEntry : 60; + } HeaderX64; + } WINPR_SLIST_HEADER, *WINPR_PSLIST_HEADER; + +#else /* _WIN64 */ + + typedef union _WINPR_SLIST_HEADER { ULONGLONG Alignment; - ULONGLONG Region; - } DUMMYSTRUCTNAME; - struct - { - ULONGLONG Depth:16; - ULONGLONG Sequence:9; - ULONGLONG NextEntry:39; - ULONGLONG HeaderType:1; - ULONGLONG Init:1; - ULONGLONG Reserved:59; - ULONGLONG Region:3; - } Header8; - - struct - { - ULONGLONG Depth:16; - ULONGLONG Sequence:48; - ULONGLONG HeaderType:1; - ULONGLONG Reserved:3; - ULONGLONG NextEntry:60; - } HeaderX64; -} WINPR_SLIST_HEADER, *WINPR_PSLIST_HEADER; - -#else /* _WIN64 */ - -typedef union _WINPR_SLIST_HEADER -{ - ULONGLONG Alignment; - - struct - { - WINPR_SLIST_ENTRY Next; - WORD Depth; - WORD Sequence; - } DUMMYSTRUCTNAME; -} WINPR_SLIST_HEADER, *WINPR_PSLIST_HEADER; + struct + { + WINPR_SLIST_ENTRY Next; + WORD Depth; + WORD Sequence; + } DUMMYSTRUCTNAME; + } WINPR_SLIST_HEADER, *WINPR_PSLIST_HEADER; #endif /* _WIN64 */ -/* Singly-Linked List */ + /* Singly-Linked List */ -WINPR_API VOID InitializeSListHead(WINPR_PSLIST_HEADER ListHead); + WINPR_API VOID InitializeSListHead(WINPR_PSLIST_HEADER ListHead); -WINPR_API WINPR_PSLIST_ENTRY InterlockedPushEntrySList(WINPR_PSLIST_HEADER ListHead, WINPR_PSLIST_ENTRY ListEntry); -WINPR_API WINPR_PSLIST_ENTRY InterlockedPushListSListEx(WINPR_PSLIST_HEADER ListHead, WINPR_PSLIST_ENTRY List, WINPR_PSLIST_ENTRY ListEnd, ULONG Count); -WINPR_API WINPR_PSLIST_ENTRY InterlockedPopEntrySList(WINPR_PSLIST_HEADER ListHead); -WINPR_API WINPR_PSLIST_ENTRY InterlockedFlushSList(WINPR_PSLIST_HEADER ListHead); + WINPR_API WINPR_PSLIST_ENTRY InterlockedPushEntrySList(WINPR_PSLIST_HEADER ListHead, + WINPR_PSLIST_ENTRY ListEntry); + WINPR_API WINPR_PSLIST_ENTRY InterlockedPushListSListEx(WINPR_PSLIST_HEADER ListHead, + WINPR_PSLIST_ENTRY List, + WINPR_PSLIST_ENTRY ListEnd, + ULONG Count); + WINPR_API WINPR_PSLIST_ENTRY InterlockedPopEntrySList(WINPR_PSLIST_HEADER ListHead); + WINPR_API WINPR_PSLIST_ENTRY InterlockedFlushSList(WINPR_PSLIST_HEADER ListHead); -WINPR_API USHORT QueryDepthSList(WINPR_PSLIST_HEADER ListHead); + WINPR_API USHORT QueryDepthSList(WINPR_PSLIST_HEADER ListHead); -WINPR_API LONG InterlockedIncrement(LONG volatile *Addend); -WINPR_API LONG InterlockedDecrement(LONG volatile *Addend); + WINPR_API LONG InterlockedIncrement(LONG volatile* Addend); + WINPR_API LONG InterlockedDecrement(LONG volatile* Addend); -WINPR_API LONG InterlockedExchange(LONG volatile *Target, LONG Value); -WINPR_API LONG InterlockedExchangeAdd(LONG volatile *Addend, LONG Value); + WINPR_API LONG InterlockedExchange(LONG volatile* Target, LONG Value); + WINPR_API LONG InterlockedExchangeAdd(LONG volatile* Addend, LONG Value); -WINPR_API LONG InterlockedCompareExchange(LONG volatile *Destination, LONG Exchange, LONG Comperand); + WINPR_API LONG InterlockedCompareExchange(LONG volatile* Destination, LONG Exchange, + LONG Comperand); -WINPR_API PVOID InterlockedCompareExchangePointer(PVOID volatile *Destination, PVOID Exchange, PVOID Comperand); + WINPR_API PVOID InterlockedCompareExchangePointer(PVOID volatile* Destination, PVOID Exchange, + PVOID Comperand); #else /* _WIN32 */ #define WINPR_LIST_ENTRY LIST_ENTRY @@ -170,37 +175,38 @@ WINPR_API PVOID InterlockedCompareExchangePointer(PVOID volatile *Destination, P #endif /* _WIN32 */ -#if (!defined(_WIN32) || (defined(_WIN32) && (_WIN32_WINNT < 0x0502) && !defined(InterlockedCompareExchange64))) -#define WINPR_INTERLOCKED_COMPARE_EXCHANGE64 1 +#if (!defined(_WIN32) || \ + (defined(_WIN32) && (_WIN32_WINNT < 0x0502) && !defined(InterlockedCompareExchange64))) +#define WINPR_INTERLOCKED_COMPARE_EXCHANGE64 1 #endif #ifdef WINPR_INTERLOCKED_COMPARE_EXCHANGE64 -WINPR_API LONGLONG InterlockedCompareExchange64(LONGLONG volatile *Destination, LONGLONG Exchange, LONGLONG Comperand); + WINPR_API LONGLONG InterlockedCompareExchange64(LONGLONG volatile* Destination, + LONGLONG Exchange, LONGLONG Comperand); #endif -/* Doubly-Linked List */ + /* Doubly-Linked List */ -WINPR_API VOID InitializeListHead(WINPR_PLIST_ENTRY ListHead); + WINPR_API VOID InitializeListHead(WINPR_PLIST_ENTRY ListHead); -WINPR_API BOOL IsListEmpty(const WINPR_LIST_ENTRY* ListHead); + WINPR_API BOOL IsListEmpty(const WINPR_LIST_ENTRY* ListHead); -WINPR_API BOOL RemoveEntryList(WINPR_PLIST_ENTRY Entry); + WINPR_API BOOL RemoveEntryList(WINPR_PLIST_ENTRY Entry); -WINPR_API VOID InsertHeadList(WINPR_PLIST_ENTRY ListHead, WINPR_PLIST_ENTRY Entry); -WINPR_API WINPR_PLIST_ENTRY RemoveHeadList(WINPR_PLIST_ENTRY ListHead); + WINPR_API VOID InsertHeadList(WINPR_PLIST_ENTRY ListHead, WINPR_PLIST_ENTRY Entry); + WINPR_API WINPR_PLIST_ENTRY RemoveHeadList(WINPR_PLIST_ENTRY ListHead); -WINPR_API VOID InsertTailList(WINPR_PLIST_ENTRY ListHead, WINPR_PLIST_ENTRY Entry); -WINPR_API WINPR_PLIST_ENTRY RemoveTailList(WINPR_PLIST_ENTRY ListHead); -WINPR_API VOID AppendTailList(WINPR_PLIST_ENTRY ListHead, WINPR_PLIST_ENTRY ListToAppend); + WINPR_API VOID InsertTailList(WINPR_PLIST_ENTRY ListHead, WINPR_PLIST_ENTRY Entry); + WINPR_API WINPR_PLIST_ENTRY RemoveTailList(WINPR_PLIST_ENTRY ListHead); + WINPR_API VOID AppendTailList(WINPR_PLIST_ENTRY ListHead, WINPR_PLIST_ENTRY ListToAppend); -WINPR_API VOID PushEntryList(WINPR_PSINGLE_LIST_ENTRY ListHead, WINPR_PSINGLE_LIST_ENTRY Entry); -WINPR_API WINPR_PSINGLE_LIST_ENTRY PopEntryList(WINPR_PSINGLE_LIST_ENTRY ListHead); + WINPR_API VOID PushEntryList(WINPR_PSINGLE_LIST_ENTRY ListHead, WINPR_PSINGLE_LIST_ENTRY Entry); + WINPR_API WINPR_PSINGLE_LIST_ENTRY PopEntryList(WINPR_PSINGLE_LIST_ENTRY ListHead); #ifdef __cplusplus } #endif #endif /* WINPR_INTERLOCKED_H */ - diff --git a/winpr/include/winpr/intrin.h b/winpr/include/winpr/intrin.h index c06a1f02e..53f6b346a 100644 --- a/winpr/include/winpr/intrin.h +++ b/winpr/include/winpr/intrin.h @@ -4,7 +4,7 @@ * * Copyright 2015 Thincast Technologies GmbH * Copyright 2015 Bernhard Miklautz - * + * * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,12 +33,14 @@ #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) -static INLINE UINT32 __lzcnt(UINT32 _val32) { - return ((UINT32) __builtin_clz(_val32)); +static INLINE UINT32 __lzcnt(UINT32 _val32) +{ + return ((UINT32)__builtin_clz(_val32)); } -static INLINE UINT16 __lzcnt16(UINT16 _val16) { - return ((UINT16) (__builtin_clz((UINT32) _val16) - 16)); +static INLINE UINT16 __lzcnt16(UINT16 _val16) +{ + return ((UINT16)(__builtin_clz((UINT32)_val16) - 16)); } #else /* (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2) */ @@ -47,17 +49,39 @@ static INLINE UINT32 __lzcnt(UINT32 x) { unsigned y; int n = 32; - y = x >> 16; if (y != 0) { n = n - 16; x = y; } - y = x >> 8; if (y != 0) { n = n - 8; x = y; } - y = x >> 4; if (y != 0) { n = n - 4; x = y; } - y = x >> 2; if (y != 0) { n = n - 2; x = y; } - y = x >> 1; if (y != 0) return n - 2; + y = x >> 16; + if (y != 0) + { + n = n - 16; + x = y; + } + y = x >> 8; + if (y != 0) + { + n = n - 8; + x = y; + } + y = x >> 4; + if (y != 0) + { + n = n - 4; + x = y; + } + y = x >> 2; + if (y != 0) + { + n = n - 2; + x = y; + } + y = x >> 1; + if (y != 0) + return n - 2; return n - x; } static INLINE UINT16 __lzcnt16(UINT16 x) { - return ((UINT16) __lzcnt((UINT32) x)); + return ((UINT16)__lzcnt((UINT32)x)); } #endif /* (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2) */ diff --git a/winpr/include/winpr/io.h b/winpr/include/winpr/io.h index d125c7dfc..aee1ee99a 100644 --- a/winpr/include/winpr/io.h +++ b/winpr/include/winpr/io.h @@ -35,8 +35,7 @@ typedef struct _OVERLAPPED { ULONG_PTR Internal; ULONG_PTR InternalHigh; - union - { + union { struct { DWORD Offset; @@ -56,31 +55,44 @@ typedef struct _OVERLAPPED_ENTRY } OVERLAPPED_ENTRY, *LPOVERLAPPED_ENTRY; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API BOOL GetOverlappedResult(HANDLE hFile, LPOVERLAPPED lpOverlapped, LPDWORD lpNumberOfBytesTransferred, BOOL bWait); + WINPR_API BOOL GetOverlappedResult(HANDLE hFile, LPOVERLAPPED lpOverlapped, + LPDWORD lpNumberOfBytesTransferred, BOOL bWait); -WINPR_API BOOL GetOverlappedResultEx(HANDLE hFile, LPOVERLAPPED lpOverlapped, LPDWORD lpNumberOfBytesTransferred, DWORD dwMilliseconds, BOOL bAlertable); + WINPR_API BOOL GetOverlappedResultEx(HANDLE hFile, LPOVERLAPPED lpOverlapped, + LPDWORD lpNumberOfBytesTransferred, DWORD dwMilliseconds, + BOOL bAlertable); -WINPR_API BOOL DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, - LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped); + WINPR_API BOOL DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, + DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, + LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped); -WINPR_API HANDLE CreateIoCompletionPort(HANDLE FileHandle, HANDLE ExistingCompletionPort, ULONG_PTR CompletionKey, DWORD NumberOfConcurrentThreads); + WINPR_API HANDLE CreateIoCompletionPort(HANDLE FileHandle, HANDLE ExistingCompletionPort, + ULONG_PTR CompletionKey, + DWORD NumberOfConcurrentThreads); -WINPR_API BOOL GetQueuedCompletionStatus(HANDLE CompletionPort, LPDWORD lpNumberOfBytesTransferred, - PULONG_PTR lpCompletionKey, LPOVERLAPPED* lpOverlapped, DWORD dwMilliseconds); + WINPR_API BOOL GetQueuedCompletionStatus(HANDLE CompletionPort, + LPDWORD lpNumberOfBytesTransferred, + PULONG_PTR lpCompletionKey, LPOVERLAPPED* lpOverlapped, + DWORD dwMilliseconds); -WINPR_API BOOL GetQueuedCompletionStatusEx(HANDLE CompletionPort, LPOVERLAPPED_ENTRY lpCompletionPortEntries, - ULONG ulCount, PULONG ulNumEntriesRemoved, DWORD dwMilliseconds, BOOL fAlertable); + WINPR_API BOOL GetQueuedCompletionStatusEx(HANDLE CompletionPort, + LPOVERLAPPED_ENTRY lpCompletionPortEntries, + ULONG ulCount, PULONG ulNumEntriesRemoved, + DWORD dwMilliseconds, BOOL fAlertable); -WINPR_API BOOL PostQueuedCompletionStatus(HANDLE CompletionPort, DWORD dwNumberOfBytesTransferred, ULONG_PTR dwCompletionKey, LPOVERLAPPED lpOverlapped); + WINPR_API BOOL PostQueuedCompletionStatus(HANDLE CompletionPort, + DWORD dwNumberOfBytesTransferred, + ULONG_PTR dwCompletionKey, LPOVERLAPPED lpOverlapped); -WINPR_API BOOL CancelIo(HANDLE hFile); + WINPR_API BOOL CancelIo(HANDLE hFile); -WINPR_API BOOL CancelIoEx(HANDLE hFile, LPOVERLAPPED lpOverlapped); + WINPR_API BOOL CancelIoEx(HANDLE hFile, LPOVERLAPPED lpOverlapped); -WINPR_API BOOL CancelSynchronousIo(HANDLE hThread); + WINPR_API BOOL CancelSynchronousIo(HANDLE hThread); #ifdef __cplusplus } @@ -88,90 +100,90 @@ WINPR_API BOOL CancelSynchronousIo(HANDLE hThread); #define DEVICE_TYPE ULONG -#define FILE_DEVICE_BEEP 0x00000001 -#define FILE_DEVICE_CD_ROM 0x00000002 -#define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003 -#define FILE_DEVICE_CONTROLLER 0x00000004 -#define FILE_DEVICE_DATALINK 0x00000005 -#define FILE_DEVICE_DFS 0x00000006 -#define FILE_DEVICE_DISK 0x00000007 -#define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008 -#define FILE_DEVICE_FILE_SYSTEM 0x00000009 -#define FILE_DEVICE_INPORT_PORT 0x0000000a -#define FILE_DEVICE_KEYBOARD 0x0000000b -#define FILE_DEVICE_MAILSLOT 0x0000000c -#define FILE_DEVICE_MIDI_IN 0x0000000d -#define FILE_DEVICE_MIDI_OUT 0x0000000e -#define FILE_DEVICE_MOUSE 0x0000000f -#define FILE_DEVICE_MULTI_UNC_PROVIDER 0x00000010 -#define FILE_DEVICE_NAMED_PIPE 0x00000011 -#define FILE_DEVICE_NETWORK 0x00000012 -#define FILE_DEVICE_NETWORK_BROWSER 0x00000013 -#define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014 -#define FILE_DEVICE_NULL 0x00000015 -#define FILE_DEVICE_PARALLEL_PORT 0x00000016 -#define FILE_DEVICE_PHYSICAL_NETCARD 0x00000017 -#define FILE_DEVICE_PRINTER 0x00000018 -#define FILE_DEVICE_SCANNER 0x00000019 -#define FILE_DEVICE_SERIAL_MOUSE_PORT 0x0000001a -#define FILE_DEVICE_SERIAL_PORT 0x0000001b -#define FILE_DEVICE_SCREEN 0x0000001c -#define FILE_DEVICE_SOUND 0x0000001d -#define FILE_DEVICE_STREAMS 0x0000001e -#define FILE_DEVICE_TAPE 0x0000001f -#define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020 -#define FILE_DEVICE_TRANSPORT 0x00000021 -#define FILE_DEVICE_UNKNOWN 0x00000022 -#define FILE_DEVICE_VIDEO 0x00000023 -#define FILE_DEVICE_VIRTUAL_DISK 0x00000024 -#define FILE_DEVICE_WAVE_IN 0x00000025 -#define FILE_DEVICE_WAVE_OUT 0x00000026 -#define FILE_DEVICE_8042_PORT 0x00000027 -#define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028 -#define FILE_DEVICE_BATTERY 0x00000029 -#define FILE_DEVICE_BUS_EXTENDER 0x0000002a -#define FILE_DEVICE_MODEM 0x0000002b -#define FILE_DEVICE_VDM 0x0000002c -#define FILE_DEVICE_MASS_STORAGE 0x0000002d -#define FILE_DEVICE_SMB 0x0000002e -#define FILE_DEVICE_KS 0x0000002f -#define FILE_DEVICE_CHANGER 0x00000030 -#define FILE_DEVICE_SMARTCARD 0x00000031 -#define FILE_DEVICE_ACPI 0x00000032 -#define FILE_DEVICE_DVD 0x00000033 -#define FILE_DEVICE_FULLSCREEN_VIDEO 0x00000034 -#define FILE_DEVICE_DFS_FILE_SYSTEM 0x00000035 -#define FILE_DEVICE_DFS_VOLUME 0x00000036 -#define FILE_DEVICE_SERENUM 0x00000037 -#define FILE_DEVICE_TERMSRV 0x00000038 -#define FILE_DEVICE_KSEC 0x00000039 -#define FILE_DEVICE_FIPS 0x0000003A -#define FILE_DEVICE_INFINIBAND 0x0000003B -#define FILE_DEVICE_VMBUS 0x0000003E -#define FILE_DEVICE_CRYPT_PROVIDER 0x0000003F -#define FILE_DEVICE_WPD 0x00000040 -#define FILE_DEVICE_BLUETOOTH 0x00000041 -#define FILE_DEVICE_MT_COMPOSITE 0x00000042 -#define FILE_DEVICE_MT_TRANSPORT 0x00000043 -#define FILE_DEVICE_BIOMETRIC 0x00000044 -#define FILE_DEVICE_PMI 0x00000045 +#define FILE_DEVICE_BEEP 0x00000001 +#define FILE_DEVICE_CD_ROM 0x00000002 +#define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003 +#define FILE_DEVICE_CONTROLLER 0x00000004 +#define FILE_DEVICE_DATALINK 0x00000005 +#define FILE_DEVICE_DFS 0x00000006 +#define FILE_DEVICE_DISK 0x00000007 +#define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008 +#define FILE_DEVICE_FILE_SYSTEM 0x00000009 +#define FILE_DEVICE_INPORT_PORT 0x0000000a +#define FILE_DEVICE_KEYBOARD 0x0000000b +#define FILE_DEVICE_MAILSLOT 0x0000000c +#define FILE_DEVICE_MIDI_IN 0x0000000d +#define FILE_DEVICE_MIDI_OUT 0x0000000e +#define FILE_DEVICE_MOUSE 0x0000000f +#define FILE_DEVICE_MULTI_UNC_PROVIDER 0x00000010 +#define FILE_DEVICE_NAMED_PIPE 0x00000011 +#define FILE_DEVICE_NETWORK 0x00000012 +#define FILE_DEVICE_NETWORK_BROWSER 0x00000013 +#define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014 +#define FILE_DEVICE_NULL 0x00000015 +#define FILE_DEVICE_PARALLEL_PORT 0x00000016 +#define FILE_DEVICE_PHYSICAL_NETCARD 0x00000017 +#define FILE_DEVICE_PRINTER 0x00000018 +#define FILE_DEVICE_SCANNER 0x00000019 +#define FILE_DEVICE_SERIAL_MOUSE_PORT 0x0000001a +#define FILE_DEVICE_SERIAL_PORT 0x0000001b +#define FILE_DEVICE_SCREEN 0x0000001c +#define FILE_DEVICE_SOUND 0x0000001d +#define FILE_DEVICE_STREAMS 0x0000001e +#define FILE_DEVICE_TAPE 0x0000001f +#define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020 +#define FILE_DEVICE_TRANSPORT 0x00000021 +#define FILE_DEVICE_UNKNOWN 0x00000022 +#define FILE_DEVICE_VIDEO 0x00000023 +#define FILE_DEVICE_VIRTUAL_DISK 0x00000024 +#define FILE_DEVICE_WAVE_IN 0x00000025 +#define FILE_DEVICE_WAVE_OUT 0x00000026 +#define FILE_DEVICE_8042_PORT 0x00000027 +#define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028 +#define FILE_DEVICE_BATTERY 0x00000029 +#define FILE_DEVICE_BUS_EXTENDER 0x0000002a +#define FILE_DEVICE_MODEM 0x0000002b +#define FILE_DEVICE_VDM 0x0000002c +#define FILE_DEVICE_MASS_STORAGE 0x0000002d +#define FILE_DEVICE_SMB 0x0000002e +#define FILE_DEVICE_KS 0x0000002f +#define FILE_DEVICE_CHANGER 0x00000030 +#define FILE_DEVICE_SMARTCARD 0x00000031 +#define FILE_DEVICE_ACPI 0x00000032 +#define FILE_DEVICE_DVD 0x00000033 +#define FILE_DEVICE_FULLSCREEN_VIDEO 0x00000034 +#define FILE_DEVICE_DFS_FILE_SYSTEM 0x00000035 +#define FILE_DEVICE_DFS_VOLUME 0x00000036 +#define FILE_DEVICE_SERENUM 0x00000037 +#define FILE_DEVICE_TERMSRV 0x00000038 +#define FILE_DEVICE_KSEC 0x00000039 +#define FILE_DEVICE_FIPS 0x0000003A +#define FILE_DEVICE_INFINIBAND 0x0000003B +#define FILE_DEVICE_VMBUS 0x0000003E +#define FILE_DEVICE_CRYPT_PROVIDER 0x0000003F +#define FILE_DEVICE_WPD 0x00000040 +#define FILE_DEVICE_BLUETOOTH 0x00000041 +#define FILE_DEVICE_MT_COMPOSITE 0x00000042 +#define FILE_DEVICE_MT_TRANSPORT 0x00000043 +#define FILE_DEVICE_BIOMETRIC 0x00000044 +#define FILE_DEVICE_PMI 0x00000045 #define CTL_CODE(DeviceType, Function, Method, Access) \ (((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method)) -#define DEVICE_TYPE_FROM_CTL_CODE(ctrlCode) (((DWORD)(ctrlCode & 0xFFFF0000)) >> 16) +#define DEVICE_TYPE_FROM_CTL_CODE(ctrlCode) (((DWORD)(ctrlCode & 0xFFFF0000)) >> 16) -#define METHOD_FROM_CTL_CODE(ctrlCode) ((DWORD)(ctrlCode & 3)) +#define METHOD_FROM_CTL_CODE(ctrlCode) ((DWORD)(ctrlCode & 3)) -#define METHOD_BUFFERED 0 -#define METHOD_IN_DIRECT 1 -#define METHOD_OUT_DIRECT 2 -#define METHOD_NEITHER 3 +#define METHOD_BUFFERED 0 +#define METHOD_IN_DIRECT 1 +#define METHOD_OUT_DIRECT 2 +#define METHOD_NEITHER 3 -#define FILE_ANY_ACCESS 0 -#define FILE_SPECIAL_ACCESS (FILE_ANY_ACCESS) -#define FILE_READ_ACCESS (0x0001) -#define FILE_WRITE_ACCESS (0x0002) +#define FILE_ANY_ACCESS 0 +#define FILE_SPECIAL_ACCESS (FILE_ANY_ACCESS) +#define FILE_READ_ACCESS (0x0001) +#define FILE_WRITE_ACCESS (0x0002) /* * WinPR I/O Manager Custom API @@ -180,8 +192,10 @@ WINPR_API BOOL CancelSynchronousIo(HANDLE hThread); typedef HANDLE PDRIVER_OBJECT_EX; typedef HANDLE PDEVICE_OBJECT_EX; -WINPR_API NTSTATUS _IoCreateDeviceEx(PDRIVER_OBJECT_EX DriverObject, ULONG DeviceExtensionSize, PUNICODE_STRING DeviceName, - DEVICE_TYPE DeviceType, ULONG DeviceCharacteristics, BOOLEAN Exclusive, PDEVICE_OBJECT_EX* DeviceObject); +WINPR_API NTSTATUS _IoCreateDeviceEx(PDRIVER_OBJECT_EX DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, DEVICE_TYPE DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT_EX* DeviceObject); WINPR_API VOID _IoDeleteDeviceEx(PDEVICE_OBJECT_EX DeviceObject); @@ -190,27 +204,38 @@ WINPR_API VOID _IoDeleteDeviceEx(PDEVICE_OBJECT_EX DeviceObject); #ifdef _UWP #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API BOOL GetOverlappedResult(HANDLE hFile, LPOVERLAPPED lpOverlapped, LPDWORD lpNumberOfBytesTransferred, BOOL bWait); + WINPR_API BOOL GetOverlappedResult(HANDLE hFile, LPOVERLAPPED lpOverlapped, + LPDWORD lpNumberOfBytesTransferred, BOOL bWait); -WINPR_API BOOL DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, - LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped); + WINPR_API BOOL DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, + DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, + LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped); -WINPR_API HANDLE CreateIoCompletionPort(HANDLE FileHandle, HANDLE ExistingCompletionPort, ULONG_PTR CompletionKey, DWORD NumberOfConcurrentThreads); + WINPR_API HANDLE CreateIoCompletionPort(HANDLE FileHandle, HANDLE ExistingCompletionPort, + ULONG_PTR CompletionKey, + DWORD NumberOfConcurrentThreads); -WINPR_API BOOL GetQueuedCompletionStatus(HANDLE CompletionPort, LPDWORD lpNumberOfBytesTransferred, - PULONG_PTR lpCompletionKey, LPOVERLAPPED* lpOverlapped, DWORD dwMilliseconds); + WINPR_API BOOL GetQueuedCompletionStatus(HANDLE CompletionPort, + LPDWORD lpNumberOfBytesTransferred, + PULONG_PTR lpCompletionKey, LPOVERLAPPED* lpOverlapped, + DWORD dwMilliseconds); -WINPR_API BOOL GetQueuedCompletionStatusEx(HANDLE CompletionPort, LPOVERLAPPED_ENTRY lpCompletionPortEntries, - ULONG ulCount, PULONG ulNumEntriesRemoved, DWORD dwMilliseconds, BOOL fAlertable); + WINPR_API BOOL GetQueuedCompletionStatusEx(HANDLE CompletionPort, + LPOVERLAPPED_ENTRY lpCompletionPortEntries, + ULONG ulCount, PULONG ulNumEntriesRemoved, + DWORD dwMilliseconds, BOOL fAlertable); -WINPR_API BOOL PostQueuedCompletionStatus(HANDLE CompletionPort, DWORD dwNumberOfBytesTransferred, ULONG_PTR dwCompletionKey, LPOVERLAPPED lpOverlapped); + WINPR_API BOOL PostQueuedCompletionStatus(HANDLE CompletionPort, + DWORD dwNumberOfBytesTransferred, + ULONG_PTR dwCompletionKey, LPOVERLAPPED lpOverlapped); -WINPR_API BOOL CancelIo(HANDLE hFile); + WINPR_API BOOL CancelIo(HANDLE hFile); -WINPR_API BOOL CancelSynchronousIo(HANDLE hThread); + WINPR_API BOOL CancelSynchronousIo(HANDLE hThread); #ifdef __cplusplus } @@ -222,8 +247,7 @@ WINPR_API BOOL CancelSynchronousIo(HANDLE hThread); * Extended API */ -#define ACCESS_FROM_CTL_CODE(ctrlCode) ((DWORD)((ctrlCode >> 14) & 0x3)) -#define FUNCTION_FROM_CTL_CODE(ctrlCode) ((DWORD)((ctrlCode >> 2) & 0xFFF)) +#define ACCESS_FROM_CTL_CODE(ctrlCode) ((DWORD)((ctrlCode >> 14) & 0x3)) +#define FUNCTION_FROM_CTL_CODE(ctrlCode) ((DWORD)((ctrlCode >> 2) & 0xFFF)) #endif /* WINPR_IO_H */ - diff --git a/winpr/include/winpr/library.h b/winpr/include/winpr/library.h index de591b80d..df887b758 100644 --- a/winpr/include/winpr/library.h +++ b/winpr/include/winpr/library.h @@ -27,47 +27,48 @@ typedef HANDLE DLL_DIRECTORY_COOKIE; -#define LOAD_LIBRARY_SEARCH_APPLICATION_DIR 0x00000200 -#define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0x00001000 -#define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800 -#define LOAD_LIBRARY_SEARCH_USER_DIRS 0x00000400 +#define LOAD_LIBRARY_SEARCH_APPLICATION_DIR 0x00000200 +#define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0x00001000 +#define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800 +#define LOAD_LIBRARY_SEARCH_USER_DIRS 0x00000400 -#define DONT_RESOLVE_DLL_REFERENCES 0x00000001 -#define LOAD_LIBRARY_AS_DATAFILE 0x00000002 -#define LOAD_WITH_ALTERED_SEARCH_PATH 0x00000008 -#define LOAD_IGNORE_CODE_AUTHZ_LEVEL 0x00000010 -#define LOAD_LIBRARY_AS_IMAGE_RESOURCE 0x00000020 -#define LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE 0x00000040 -#define LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR 0x00000100 -#define LOAD_LIBRARY_SEARCH_APPLICATION_DIR 0x00000200 -#define LOAD_LIBRARY_SEARCH_USER_DIRS 0x00000400 -#define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800 -#define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0x00001000 +#define DONT_RESOLVE_DLL_REFERENCES 0x00000001 +#define LOAD_LIBRARY_AS_DATAFILE 0x00000002 +#define LOAD_WITH_ALTERED_SEARCH_PATH 0x00000008 +#define LOAD_IGNORE_CODE_AUTHZ_LEVEL 0x00000010 +#define LOAD_LIBRARY_AS_IMAGE_RESOURCE 0x00000020 +#define LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE 0x00000040 +#define LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR 0x00000100 +#define LOAD_LIBRARY_SEARCH_APPLICATION_DIR 0x00000200 +#define LOAD_LIBRARY_SEARCH_USER_DIRS 0x00000400 +#define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800 +#define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0x00001000 #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API DLL_DIRECTORY_COOKIE AddDllDirectory(PCWSTR NewDirectory); -WINPR_API BOOL RemoveDllDirectory(DLL_DIRECTORY_COOKIE Cookie); -WINPR_API BOOL SetDefaultDllDirectories(DWORD DirectoryFlags); + WINPR_API DLL_DIRECTORY_COOKIE AddDllDirectory(PCWSTR NewDirectory); + WINPR_API BOOL RemoveDllDirectory(DLL_DIRECTORY_COOKIE Cookie); + WINPR_API BOOL SetDefaultDllDirectories(DWORD DirectoryFlags); -WINPR_API HMODULE LoadLibraryA(LPCSTR lpLibFileName); -WINPR_API HMODULE LoadLibraryW(LPCWSTR lpLibFileName); + WINPR_API HMODULE LoadLibraryA(LPCSTR lpLibFileName); + WINPR_API HMODULE LoadLibraryW(LPCWSTR lpLibFileName); -WINPR_API HMODULE LoadLibraryExA(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags); -WINPR_API HMODULE LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags); + WINPR_API HMODULE LoadLibraryExA(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags); + WINPR_API HMODULE LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags); #ifdef __cplusplus } #endif #ifdef UNICODE -#define LoadLibrary LoadLibraryW -#define LoadLibraryEx LoadLibraryExW +#define LoadLibrary LoadLibraryW +#define LoadLibraryEx LoadLibraryExW #else -#define LoadLibrary LoadLibraryA -#define LoadLibraryEx LoadLibraryExA +#define LoadLibrary LoadLibraryA +#define LoadLibraryEx LoadLibraryExA #endif #endif @@ -75,32 +76,32 @@ WINPR_API HMODULE LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFl #if !defined(_WIN32) && !defined(__CYGWIN__) #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API HMODULE GetModuleHandleA(LPCSTR lpModuleName); -WINPR_API HMODULE GetModuleHandleW(LPCWSTR lpModuleName); + WINPR_API HMODULE GetModuleHandleA(LPCSTR lpModuleName); + WINPR_API HMODULE GetModuleHandleW(LPCWSTR lpModuleName); -WINPR_API DWORD GetModuleFileNameA(HMODULE hModule, LPSTR lpFilename, DWORD nSize); -WINPR_API DWORD GetModuleFileNameW(HMODULE hModule, LPWSTR lpFilename, DWORD nSize); + WINPR_API DWORD GetModuleFileNameA(HMODULE hModule, LPSTR lpFilename, DWORD nSize); + WINPR_API DWORD GetModuleFileNameW(HMODULE hModule, LPWSTR lpFilename, DWORD nSize); -WINPR_API FARPROC GetProcAddress(HMODULE hModule, LPCSTR lpProcName); + WINPR_API FARPROC GetProcAddress(HMODULE hModule, LPCSTR lpProcName); -WINPR_API BOOL FreeLibrary(HMODULE hLibModule); + WINPR_API BOOL FreeLibrary(HMODULE hLibModule); #ifdef __cplusplus } #endif #ifdef UNICODE -#define GetModuleHandle GetModuleHandleW -#define GetModuleFileName GetModuleFileNameW +#define GetModuleHandle GetModuleHandleW +#define GetModuleFileName GetModuleFileNameW #else -#define GetModuleHandle GetModuleHandleA -#define GetModuleFileName GetModuleFileNameA +#define GetModuleHandle GetModuleHandleA +#define GetModuleFileName GetModuleFileNameA #endif #endif #endif /* WINPR_LIBRARY_H */ - diff --git a/winpr/include/winpr/locale.h b/winpr/include/winpr/locale.h index d6bcabfe6..45ef81bb9 100644 --- a/winpr/include/winpr/locale.h +++ b/winpr/include/winpr/locale.h @@ -28,444 +28,443 @@ #include #include -#define LANG_NEUTRAL 0x00 -#define LANG_INVARIANT 0x7f +#define LANG_NEUTRAL 0x00 +#define LANG_INVARIANT 0x7f -#define LANG_AFRIKAANS 0x36 -#define LANG_ALBANIAN 0x1c -#define LANG_ALSATIAN 0x84 -#define LANG_AMHARIC 0x5e -#define LANG_ARABIC 0x01 -#define LANG_ARMENIAN 0x2b -#define LANG_ASSAMESE 0x4d -#define LANG_AZERI 0x2c -#define LANG_AZERBAIJANI 0x2c -#define LANG_BANGLA 0x45 -#define LANG_BASHKIR 0x6d -#define LANG_BASQUE 0x2d -#define LANG_BELARUSIAN 0x23 -#define LANG_BENGALI 0x45 -#define LANG_BRETON 0x7e -#define LANG_BOSNIAN 0x1a -#define LANG_BOSNIAN_NEUTRAL 0x781a -#define LANG_BULGARIAN 0x02 -#define LANG_CATALAN 0x03 -#define LANG_CENTRAL_KURDISH 0x92 -#define LANG_CHEROKEE 0x5c -#define LANG_CHINESE 0x04 -#define LANG_CHINESE_SIMPLIFIED 0x04 -#define LANG_CHINESE_TRADITIONAL 0x7c04 -#define LANG_CORSICAN 0x83 -#define LANG_CROATIAN 0x1a -#define LANG_CZECH 0x05 -#define LANG_DANISH 0x06 -#define LANG_DARI 0x8c -#define LANG_DIVEHI 0x65 -#define LANG_DUTCH 0x13 -#define LANG_ENGLISH 0x09 -#define LANG_ESTONIAN 0x25 -#define LANG_FAEROESE 0x38 -#define LANG_FARSI 0x29 -#define LANG_FILIPINO 0x64 -#define LANG_FINNISH 0x0b -#define LANG_FRENCH 0x0c -#define LANG_FRISIAN 0x62 -#define LANG_FULAH 0x67 -#define LANG_GALICIAN 0x56 -#define LANG_GEORGIAN 0x37 -#define LANG_GERMAN 0x07 -#define LANG_GREEK 0x08 -#define LANG_GREENLANDIC 0x6f -#define LANG_GUJARATI 0x47 -#define LANG_HAUSA 0x68 -#define LANG_HAWAIIAN 0x75 -#define LANG_HEBREW 0x0d -#define LANG_HINDI 0x39 -#define LANG_HUNGARIAN 0x0e -#define LANG_ICELANDIC 0x0f -#define LANG_IGBO 0x70 -#define LANG_INDONESIAN 0x21 -#define LANG_INUKTITUT 0x5d -#define LANG_IRISH 0x3c -#define LANG_ITALIAN 0x10 -#define LANG_JAPANESE 0x11 -#define LANG_KANNADA 0x4b -#define LANG_KASHMIRI 0x60 -#define LANG_KAZAK 0x3f -#define LANG_KHMER 0x53 -#define LANG_KICHE 0x86 -#define LANG_KINYARWANDA 0x87 -#define LANG_KONKANI 0x57 -#define LANG_KOREAN 0x12 -#define LANG_KYRGYZ 0x40 -#define LANG_LAO 0x54 -#define LANG_LATVIAN 0x26 -#define LANG_LITHUANIAN 0x27 -#define LANG_LOWER_SORBIAN 0x2e -#define LANG_LUXEMBOURGISH 0x6e -#define LANG_MACEDONIAN 0x2f -#define LANG_MALAY 0x3e -#define LANG_MALAYALAM 0x4c -#define LANG_MALTESE 0x3a -#define LANG_MANIPURI 0x58 -#define LANG_MAORI 0x81 -#define LANG_MAPUDUNGUN 0x7a -#define LANG_MARATHI 0x4e -#define LANG_MOHAWK 0x7c -#define LANG_MONGOLIAN 0x50 -#define LANG_NEPALI 0x61 -#define LANG_NORWEGIAN 0x14 -#define LANG_OCCITAN 0x82 -#define LANG_ODIA 0x48 -#define LANG_ORIYA 0x48 -#define LANG_PASHTO 0x63 -#define LANG_PERSIAN 0x29 -#define LANG_POLISH 0x15 -#define LANG_PORTUGUESE 0x16 -#define LANG_PULAR 0x67 -#define LANG_PUNJABI 0x46 -#define LANG_QUECHUA 0x6b -#define LANG_ROMANIAN 0x18 -#define LANG_ROMANSH 0x17 -#define LANG_RUSSIAN 0x19 -#define LANG_SAKHA 0x85 -#define LANG_SAMI 0x3b -#define LANG_SANSKRIT 0x4f -#define LANG_SCOTTISH_GAELIC 0x91 -#define LANG_SERBIAN 0x1a -#define LANG_SERBIAN_NEUTRAL 0x7c1a -#define LANG_SINDHI 0x59 -#define LANG_SINHALESE 0x5b -#define LANG_SLOVAK 0x1b -#define LANG_SLOVENIAN 0x24 -#define LANG_SOTHO 0x6c -#define LANG_SPANISH 0x0a -#define LANG_SWAHILI 0x41 -#define LANG_SWEDISH 0x1d -#define LANG_SYRIAC 0x5a -#define LANG_TAJIK 0x28 -#define LANG_TAMAZIGHT 0x5f -#define LANG_TAMIL 0x49 -#define LANG_TATAR 0x44 -#define LANG_TELUGU 0x4a -#define LANG_THAI 0x1e -#define LANG_TIBETAN 0x51 -#define LANG_TIGRIGNA 0x73 -#define LANG_TIGRINYA 0x73 -#define LANG_TSWANA 0x32 -#define LANG_TURKISH 0x1f -#define LANG_TURKMEN 0x42 -#define LANG_UIGHUR 0x80 -#define LANG_UKRAINIAN 0x22 -#define LANG_UPPER_SORBIAN 0x2e -#define LANG_URDU 0x20 -#define LANG_UZBEK 0x43 -#define LANG_VALENCIAN 0x03 -#define LANG_VIETNAMESE 0x2a -#define LANG_WELSH 0x52 -#define LANG_WOLOF 0x88 -#define LANG_XHOSA 0x34 -#define LANG_YAKUT 0x85 -#define LANG_YI 0x78 -#define LANG_YORUBA 0x6a -#define LANG_ZULU 0x35 +#define LANG_AFRIKAANS 0x36 +#define LANG_ALBANIAN 0x1c +#define LANG_ALSATIAN 0x84 +#define LANG_AMHARIC 0x5e +#define LANG_ARABIC 0x01 +#define LANG_ARMENIAN 0x2b +#define LANG_ASSAMESE 0x4d +#define LANG_AZERI 0x2c +#define LANG_AZERBAIJANI 0x2c +#define LANG_BANGLA 0x45 +#define LANG_BASHKIR 0x6d +#define LANG_BASQUE 0x2d +#define LANG_BELARUSIAN 0x23 +#define LANG_BENGALI 0x45 +#define LANG_BRETON 0x7e +#define LANG_BOSNIAN 0x1a +#define LANG_BOSNIAN_NEUTRAL 0x781a +#define LANG_BULGARIAN 0x02 +#define LANG_CATALAN 0x03 +#define LANG_CENTRAL_KURDISH 0x92 +#define LANG_CHEROKEE 0x5c +#define LANG_CHINESE 0x04 +#define LANG_CHINESE_SIMPLIFIED 0x04 +#define LANG_CHINESE_TRADITIONAL 0x7c04 +#define LANG_CORSICAN 0x83 +#define LANG_CROATIAN 0x1a +#define LANG_CZECH 0x05 +#define LANG_DANISH 0x06 +#define LANG_DARI 0x8c +#define LANG_DIVEHI 0x65 +#define LANG_DUTCH 0x13 +#define LANG_ENGLISH 0x09 +#define LANG_ESTONIAN 0x25 +#define LANG_FAEROESE 0x38 +#define LANG_FARSI 0x29 +#define LANG_FILIPINO 0x64 +#define LANG_FINNISH 0x0b +#define LANG_FRENCH 0x0c +#define LANG_FRISIAN 0x62 +#define LANG_FULAH 0x67 +#define LANG_GALICIAN 0x56 +#define LANG_GEORGIAN 0x37 +#define LANG_GERMAN 0x07 +#define LANG_GREEK 0x08 +#define LANG_GREENLANDIC 0x6f +#define LANG_GUJARATI 0x47 +#define LANG_HAUSA 0x68 +#define LANG_HAWAIIAN 0x75 +#define LANG_HEBREW 0x0d +#define LANG_HINDI 0x39 +#define LANG_HUNGARIAN 0x0e +#define LANG_ICELANDIC 0x0f +#define LANG_IGBO 0x70 +#define LANG_INDONESIAN 0x21 +#define LANG_INUKTITUT 0x5d +#define LANG_IRISH 0x3c +#define LANG_ITALIAN 0x10 +#define LANG_JAPANESE 0x11 +#define LANG_KANNADA 0x4b +#define LANG_KASHMIRI 0x60 +#define LANG_KAZAK 0x3f +#define LANG_KHMER 0x53 +#define LANG_KICHE 0x86 +#define LANG_KINYARWANDA 0x87 +#define LANG_KONKANI 0x57 +#define LANG_KOREAN 0x12 +#define LANG_KYRGYZ 0x40 +#define LANG_LAO 0x54 +#define LANG_LATVIAN 0x26 +#define LANG_LITHUANIAN 0x27 +#define LANG_LOWER_SORBIAN 0x2e +#define LANG_LUXEMBOURGISH 0x6e +#define LANG_MACEDONIAN 0x2f +#define LANG_MALAY 0x3e +#define LANG_MALAYALAM 0x4c +#define LANG_MALTESE 0x3a +#define LANG_MANIPURI 0x58 +#define LANG_MAORI 0x81 +#define LANG_MAPUDUNGUN 0x7a +#define LANG_MARATHI 0x4e +#define LANG_MOHAWK 0x7c +#define LANG_MONGOLIAN 0x50 +#define LANG_NEPALI 0x61 +#define LANG_NORWEGIAN 0x14 +#define LANG_OCCITAN 0x82 +#define LANG_ODIA 0x48 +#define LANG_ORIYA 0x48 +#define LANG_PASHTO 0x63 +#define LANG_PERSIAN 0x29 +#define LANG_POLISH 0x15 +#define LANG_PORTUGUESE 0x16 +#define LANG_PULAR 0x67 +#define LANG_PUNJABI 0x46 +#define LANG_QUECHUA 0x6b +#define LANG_ROMANIAN 0x18 +#define LANG_ROMANSH 0x17 +#define LANG_RUSSIAN 0x19 +#define LANG_SAKHA 0x85 +#define LANG_SAMI 0x3b +#define LANG_SANSKRIT 0x4f +#define LANG_SCOTTISH_GAELIC 0x91 +#define LANG_SERBIAN 0x1a +#define LANG_SERBIAN_NEUTRAL 0x7c1a +#define LANG_SINDHI 0x59 +#define LANG_SINHALESE 0x5b +#define LANG_SLOVAK 0x1b +#define LANG_SLOVENIAN 0x24 +#define LANG_SOTHO 0x6c +#define LANG_SPANISH 0x0a +#define LANG_SWAHILI 0x41 +#define LANG_SWEDISH 0x1d +#define LANG_SYRIAC 0x5a +#define LANG_TAJIK 0x28 +#define LANG_TAMAZIGHT 0x5f +#define LANG_TAMIL 0x49 +#define LANG_TATAR 0x44 +#define LANG_TELUGU 0x4a +#define LANG_THAI 0x1e +#define LANG_TIBETAN 0x51 +#define LANG_TIGRIGNA 0x73 +#define LANG_TIGRINYA 0x73 +#define LANG_TSWANA 0x32 +#define LANG_TURKISH 0x1f +#define LANG_TURKMEN 0x42 +#define LANG_UIGHUR 0x80 +#define LANG_UKRAINIAN 0x22 +#define LANG_UPPER_SORBIAN 0x2e +#define LANG_URDU 0x20 +#define LANG_UZBEK 0x43 +#define LANG_VALENCIAN 0x03 +#define LANG_VIETNAMESE 0x2a +#define LANG_WELSH 0x52 +#define LANG_WOLOF 0x88 +#define LANG_XHOSA 0x34 +#define LANG_YAKUT 0x85 +#define LANG_YI 0x78 +#define LANG_YORUBA 0x6a +#define LANG_ZULU 0x35 -#define SUBLANG_NEUTRAL 0x00 -#define SUBLANG_DEFAULT 0x01 -#define SUBLANG_SYS_DEFAULT 0x02 -#define SUBLANG_CUSTOM_DEFAULT 0x03 -#define SUBLANG_CUSTOM_UNSPECIFIED 0x04 -#define SUBLANG_UI_CUSTOM_DEFAULT 0x05 +#define SUBLANG_NEUTRAL 0x00 +#define SUBLANG_DEFAULT 0x01 +#define SUBLANG_SYS_DEFAULT 0x02 +#define SUBLANG_CUSTOM_DEFAULT 0x03 +#define SUBLANG_CUSTOM_UNSPECIFIED 0x04 +#define SUBLANG_UI_CUSTOM_DEFAULT 0x05 -#define SUBLANG_AFRIKAANS_SOUTH_AFRICA 0x01 -#define SUBLANG_ALBANIAN_ALBANIA 0x01 -#define SUBLANG_ALSATIAN_FRANCE 0x01 -#define SUBLANG_AMHARIC_ETHIOPIA 0x01 -#define SUBLANG_ARABIC_SAUDI_ARABIA 0x01 -#define SUBLANG_ARABIC_IRAQ 0x02 -#define SUBLANG_ARABIC_EGYPT 0x03 -#define SUBLANG_ARABIC_LIBYA 0x04 -#define SUBLANG_ARABIC_ALGERIA 0x05 -#define SUBLANG_ARABIC_MOROCCO 0x06 -#define SUBLANG_ARABIC_TUNISIA 0x07 -#define SUBLANG_ARABIC_OMAN 0x08 -#define SUBLANG_ARABIC_YEMEN 0x09 -#define SUBLANG_ARABIC_SYRIA 0x0a -#define SUBLANG_ARABIC_JORDAN 0x0b -#define SUBLANG_ARABIC_LEBANON 0x0c -#define SUBLANG_ARABIC_KUWAIT 0x0d -#define SUBLANG_ARABIC_UAE 0x0e -#define SUBLANG_ARABIC_BAHRAIN 0x0f -#define SUBLANG_ARABIC_QATAR 0x10 -#define SUBLANG_ARMENIAN_ARMENIA 0x01 -#define SUBLANG_ASSAMESE_INDIA 0x01 -#define SUBLANG_AZERI_LATIN 0x01 -#define SUBLANG_AZERI_CYRILLIC 0x02 -#define SUBLANG_AZERBAIJANI_AZERBAIJAN_LATIN 0x01 -#define SUBLANG_AZERBAIJANI_AZERBAIJAN_CYRILLIC 0x02 -#define SUBLANG_BANGLA_INDIA 0x01 -#define SUBLANG_BANGLA_BANGLADESH 0x02 -#define SUBLANG_BASHKIR_RUSSIA 0x01 -#define SUBLANG_BASQUE_BASQUE 0x01 -#define SUBLANG_BELARUSIAN_BELARUS 0x01 -#define SUBLANG_BENGALI_INDIA 0x01 -#define SUBLANG_BENGALI_BANGLADESH 0x02 -#define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN 0x05 -#define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x08 -#define SUBLANG_BRETON_FRANCE 0x01 -#define SUBLANG_BULGARIAN_BULGARIA 0x01 -#define SUBLANG_CATALAN_CATALAN 0x01 -#define SUBLANG_CENTRAL_KURDISH_IRAQ 0x01 -#define SUBLANG_CHEROKEE_CHEROKEE 0x01 -#define SUBLANG_CHINESE_TRADITIONAL 0x01 -#define SUBLANG_CHINESE_SIMPLIFIED 0x02 -#define SUBLANG_CHINESE_HONGKONG 0x03 -#define SUBLANG_CHINESE_SINGAPORE 0x04 -#define SUBLANG_CHINESE_MACAU 0x05 -#define SUBLANG_CORSICAN_FRANCE 0x01 -#define SUBLANG_CZECH_CZECH_REPUBLIC 0x01 -#define SUBLANG_CROATIAN_CROATIA 0x01 -#define SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN 0x04 -#define SUBLANG_DANISH_DENMARK 0x01 -#define SUBLANG_DARI_AFGHANISTAN 0x01 -#define SUBLANG_DIVEHI_MALDIVES 0x01 -#define SUBLANG_DUTCH 0x01 -#define SUBLANG_DUTCH_BELGIAN 0x02 -#define SUBLANG_ENGLISH_US 0x01 -#define SUBLANG_ENGLISH_UK 0x02 -#define SUBLANG_ENGLISH_AUS 0x03 -#define SUBLANG_ENGLISH_CAN 0x04 -#define SUBLANG_ENGLISH_NZ 0x05 -#define SUBLANG_ENGLISH_EIRE 0x06 -#define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07 -#define SUBLANG_ENGLISH_JAMAICA 0x08 -#define SUBLANG_ENGLISH_CARIBBEAN 0x09 -#define SUBLANG_ENGLISH_BELIZE 0x0a -#define SUBLANG_ENGLISH_TRINIDAD 0x0b -#define SUBLANG_ENGLISH_ZIMBABWE 0x0c -#define SUBLANG_ENGLISH_PHILIPPINES 0x0d -#define SUBLANG_ENGLISH_INDIA 0x10 -#define SUBLANG_ENGLISH_MALAYSIA 0x11 -#define SUBLANG_ENGLISH_SINGAPORE 0x12 -#define SUBLANG_ESTONIAN_ESTONIA 0x01 -#define SUBLANG_FAEROESE_FAROE_ISLANDS 0x01 -#define SUBLANG_FILIPINO_PHILIPPINES 0x01 -#define SUBLANG_FINNISH_FINLAND 0x01 -#define SUBLANG_FRENCH 0x01 -#define SUBLANG_FRENCH_BELGIAN 0x02 -#define SUBLANG_FRENCH_CANADIAN 0x03 -#define SUBLANG_FRENCH_SWISS 0x04 -#define SUBLANG_FRENCH_LUXEMBOURG 0x05 -#define SUBLANG_FRENCH_MONACO 0x06 -#define SUBLANG_FRISIAN_NETHERLANDS 0x01 -#define SUBLANG_FULAH_SENEGAL 0x02 -#define SUBLANG_GALICIAN_GALICIAN 0x01 -#define SUBLANG_GEORGIAN_GEORGIA 0x01 -#define SUBLANG_GERMAN 0x01 -#define SUBLANG_GERMAN_SWISS 0x02 -#define SUBLANG_GERMAN_AUSTRIAN 0x03 -#define SUBLANG_GERMAN_LUXEMBOURG 0x04 -#define SUBLANG_GERMAN_LIECHTENSTEIN 0x05 -#define SUBLANG_GREEK_GREECE 0x01 -#define SUBLANG_GREENLANDIC_GREENLAND 0x01 -#define SUBLANG_GUJARATI_INDIA 0x01 -#define SUBLANG_HAUSA_NIGERIA_LATIN 0x01 -#define SUBLANG_HAWAIIAN_US 0x01 -#define SUBLANG_HEBREW_ISRAEL 0x01 -#define SUBLANG_HINDI_INDIA 0x01 -#define SUBLANG_HUNGARIAN_HUNGARY 0x01 -#define SUBLANG_ICELANDIC_ICELAND 0x01 -#define SUBLANG_IGBO_NIGERIA 0x01 -#define SUBLANG_INDONESIAN_INDONESIA 0x01 -#define SUBLANG_INUKTITUT_CANADA 0x01 -#define SUBLANG_INUKTITUT_CANADA_LATIN 0x02 -#define SUBLANG_IRISH_IRELAND 0x02 -#define SUBLANG_ITALIAN 0x01 -#define SUBLANG_ITALIAN_SWISS 0x02 -#define SUBLANG_JAPANESE_JAPAN 0x01 -#define SUBLANG_KANNADA_INDIA 0x01 -#define SUBLANG_KASHMIRI_SASIA 0x02 -#define SUBLANG_KASHMIRI_INDIA 0x02 -#define SUBLANG_KAZAK_KAZAKHSTAN 0x01 -#define SUBLANG_KHMER_CAMBODIA 0x01 -#define SUBLANG_KICHE_GUATEMALA 0x01 -#define SUBLANG_KINYARWANDA_RWANDA 0x01 -#define SUBLANG_KONKANI_INDIA 0x01 -#define SUBLANG_KOREAN 0x01 -#define SUBLANG_KYRGYZ_KYRGYZSTAN 0x01 -#define SUBLANG_LAO_LAO 0x01 -#define SUBLANG_LATVIAN_LATVIA 0x01 -#define SUBLANG_LITHUANIAN 0x01 -#define SUBLANG_LOWER_SORBIAN_GERMANY 0x02 -#define SUBLANG_LUXEMBOURGISH_LUXEMBOURG 0x01 -#define SUBLANG_MACEDONIAN_MACEDONIA 0x01 -#define SUBLANG_MALAY_MALAYSIA 0x01 -#define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02 -#define SUBLANG_MALAYALAM_INDIA 0x01 -#define SUBLANG_MALTESE_MALTA 0x01 -#define SUBLANG_MAORI_NEW_ZEALAND 0x01 -#define SUBLANG_MAPUDUNGUN_CHILE 0x01 -#define SUBLANG_MARATHI_INDIA 0x01 -#define SUBLANG_MOHAWK_MOHAWK 0x01 -#define SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA 0x01 -#define SUBLANG_MONGOLIAN_PRC 0x02 -#define SUBLANG_NEPALI_INDIA 0x02 -#define SUBLANG_NEPALI_NEPAL 0x01 -#define SUBLANG_NORWEGIAN_BOKMAL 0x01 -#define SUBLANG_NORWEGIAN_NYNORSK 0x02 -#define SUBLANG_OCCITAN_FRANCE 0x01 -#define SUBLANG_ODIA_INDIA 0x01 -#define SUBLANG_ORIYA_INDIA 0x01 -#define SUBLANG_PASHTO_AFGHANISTAN 0x01 -#define SUBLANG_PERSIAN_IRAN 0x01 -#define SUBLANG_POLISH_POLAND 0x01 -#define SUBLANG_PORTUGUESE 0x02 -#define SUBLANG_PORTUGUESE_BRAZILIAN 0x01 -#define SUBLANG_PULAR_SENEGAL 0x02 -#define SUBLANG_PUNJABI_INDIA 0x01 -#define SUBLANG_PUNJABI_PAKISTAN 0x02 -#define SUBLANG_QUECHUA_BOLIVIA 0x01 -#define SUBLANG_QUECHUA_ECUADOR 0x02 -#define SUBLANG_QUECHUA_PERU 0x03 -#define SUBLANG_ROMANIAN_ROMANIA 0x01 -#define SUBLANG_ROMANSH_SWITZERLAND 0x01 -#define SUBLANG_RUSSIAN_RUSSIA 0x01 -#define SUBLANG_SAKHA_RUSSIA 0x01 -#define SUBLANG_SAMI_NORTHERN_NORWAY 0x01 -#define SUBLANG_SAMI_NORTHERN_SWEDEN 0x02 -#define SUBLANG_SAMI_NORTHERN_FINLAND 0x03 -#define SUBLANG_SAMI_LULE_NORWAY 0x04 -#define SUBLANG_SAMI_LULE_SWEDEN 0x05 -#define SUBLANG_SAMI_SOUTHERN_NORWAY 0x06 -#define SUBLANG_SAMI_SOUTHERN_SWEDEN 0x07 -#define SUBLANG_SAMI_SKOLT_FINLAND 0x08 -#define SUBLANG_SAMI_INARI_FINLAND 0x09 -#define SUBLANG_SANSKRIT_INDIA 0x01 -#define SUBLANG_SCOTTISH_GAELIC 0x01 -#define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN 0x06 -#define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x07 -#define SUBLANG_SERBIAN_MONTENEGRO_LATIN 0x0b -#define SUBLANG_SERBIAN_MONTENEGRO_CYRILLIC 0x0c -#define SUBLANG_SERBIAN_SERBIA_LATIN 0x09 -#define SUBLANG_SERBIAN_SERBIA_CYRILLIC 0x0a -#define SUBLANG_SERBIAN_CROATIA 0x01 -#define SUBLANG_SERBIAN_LATIN 0x02 -#define SUBLANG_SERBIAN_CYRILLIC 0x03 -#define SUBLANG_SINDHI_INDIA 0x01 -#define SUBLANG_SINDHI_PAKISTAN 0x02 -#define SUBLANG_SINDHI_AFGHANISTAN 0x02 -#define SUBLANG_SINHALESE_SRI_LANKA 0x01 -#define SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA 0x01 -#define SUBLANG_SLOVAK_SLOVAKIA 0x01 -#define SUBLANG_SLOVENIAN_SLOVENIA 0x01 -#define SUBLANG_SPANISH 0x01 -#define SUBLANG_SPANISH_MEXICAN 0x02 -#define SUBLANG_SPANISH_MODERN 0x03 -#define SUBLANG_SPANISH_GUATEMALA 0x04 -#define SUBLANG_SPANISH_COSTA_RICA 0x05 -#define SUBLANG_SPANISH_PANAMA 0x06 -#define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07 -#define SUBLANG_SPANISH_VENEZUELA 0x08 -#define SUBLANG_SPANISH_COLOMBIA 0x09 -#define SUBLANG_SPANISH_PERU 0x0a -#define SUBLANG_SPANISH_ARGENTINA 0x0b -#define SUBLANG_SPANISH_ECUADOR 0x0c -#define SUBLANG_SPANISH_CHILE 0x0d -#define SUBLANG_SPANISH_URUGUAY 0x0e -#define SUBLANG_SPANISH_PARAGUAY 0x0f -#define SUBLANG_SPANISH_BOLIVIA 0x10 -#define SUBLANG_SPANISH_EL_SALVADOR 0x11 -#define SUBLANG_SPANISH_HONDURAS 0x12 -#define SUBLANG_SPANISH_NICARAGUA 0x13 -#define SUBLANG_SPANISH_PUERTO_RICO 0x14 -#define SUBLANG_SPANISH_US 0x15 -#define SUBLANG_SWAHILI_KENYA 0x01 -#define SUBLANG_SWEDISH 0x01 -#define SUBLANG_SWEDISH_FINLAND 0x02 -#define SUBLANG_SYRIAC_SYRIA 0x01 -#define SUBLANG_TAJIK_TAJIKISTAN 0x01 -#define SUBLANG_TAMAZIGHT_ALGERIA_LATIN 0x02 -#define SUBLANG_TAMAZIGHT_MOROCCO_TIFINAGH 0x04 -#define SUBLANG_TAMIL_INDIA 0x01 -#define SUBLANG_TAMIL_SRI_LANKA 0x02 -#define SUBLANG_TATAR_RUSSIA 0x01 -#define SUBLANG_TELUGU_INDIA 0x01 -#define SUBLANG_THAI_THAILAND 0x01 -#define SUBLANG_TIBETAN_PRC 0x01 -#define SUBLANG_TIGRIGNA_ERITREA 0x02 -#define SUBLANG_TIGRINYA_ERITREA 0x02 -#define SUBLANG_TIGRINYA_ETHIOPIA 0x01 -#define SUBLANG_TSWANA_BOTSWANA 0x02 -#define SUBLANG_TSWANA_SOUTH_AFRICA 0x01 -#define SUBLANG_TURKISH_TURKEY 0x01 -#define SUBLANG_TURKMEN_TURKMENISTAN 0x01 -#define SUBLANG_UIGHUR_PRC 0x01 -#define SUBLANG_UKRAINIAN_UKRAINE 0x01 -#define SUBLANG_UPPER_SORBIAN_GERMANY 0x01 -#define SUBLANG_URDU_PAKISTAN 0x01 -#define SUBLANG_URDU_INDIA 0x02 -#define SUBLANG_UZBEK_LATIN 0x01 -#define SUBLANG_UZBEK_CYRILLIC 0x02 -#define SUBLANG_VALENCIAN_VALENCIA 0x02 -#define SUBLANG_VIETNAMESE_VIETNAM 0x01 -#define SUBLANG_WELSH_UNITED_KINGDOM 0x01 -#define SUBLANG_WOLOF_SENEGAL 0x01 -#define SUBLANG_XHOSA_SOUTH_AFRICA 0x01 -#define SUBLANG_YAKUT_RUSSIA 0x01 -#define SUBLANG_YI_PRC 0x01 -#define SUBLANG_YORUBA_NIGERIA 0x01 -#define SUBLANG_ZULU_SOUTH_AFRICA 0x01 +#define SUBLANG_AFRIKAANS_SOUTH_AFRICA 0x01 +#define SUBLANG_ALBANIAN_ALBANIA 0x01 +#define SUBLANG_ALSATIAN_FRANCE 0x01 +#define SUBLANG_AMHARIC_ETHIOPIA 0x01 +#define SUBLANG_ARABIC_SAUDI_ARABIA 0x01 +#define SUBLANG_ARABIC_IRAQ 0x02 +#define SUBLANG_ARABIC_EGYPT 0x03 +#define SUBLANG_ARABIC_LIBYA 0x04 +#define SUBLANG_ARABIC_ALGERIA 0x05 +#define SUBLANG_ARABIC_MOROCCO 0x06 +#define SUBLANG_ARABIC_TUNISIA 0x07 +#define SUBLANG_ARABIC_OMAN 0x08 +#define SUBLANG_ARABIC_YEMEN 0x09 +#define SUBLANG_ARABIC_SYRIA 0x0a +#define SUBLANG_ARABIC_JORDAN 0x0b +#define SUBLANG_ARABIC_LEBANON 0x0c +#define SUBLANG_ARABIC_KUWAIT 0x0d +#define SUBLANG_ARABIC_UAE 0x0e +#define SUBLANG_ARABIC_BAHRAIN 0x0f +#define SUBLANG_ARABIC_QATAR 0x10 +#define SUBLANG_ARMENIAN_ARMENIA 0x01 +#define SUBLANG_ASSAMESE_INDIA 0x01 +#define SUBLANG_AZERI_LATIN 0x01 +#define SUBLANG_AZERI_CYRILLIC 0x02 +#define SUBLANG_AZERBAIJANI_AZERBAIJAN_LATIN 0x01 +#define SUBLANG_AZERBAIJANI_AZERBAIJAN_CYRILLIC 0x02 +#define SUBLANG_BANGLA_INDIA 0x01 +#define SUBLANG_BANGLA_BANGLADESH 0x02 +#define SUBLANG_BASHKIR_RUSSIA 0x01 +#define SUBLANG_BASQUE_BASQUE 0x01 +#define SUBLANG_BELARUSIAN_BELARUS 0x01 +#define SUBLANG_BENGALI_INDIA 0x01 +#define SUBLANG_BENGALI_BANGLADESH 0x02 +#define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN 0x05 +#define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x08 +#define SUBLANG_BRETON_FRANCE 0x01 +#define SUBLANG_BULGARIAN_BULGARIA 0x01 +#define SUBLANG_CATALAN_CATALAN 0x01 +#define SUBLANG_CENTRAL_KURDISH_IRAQ 0x01 +#define SUBLANG_CHEROKEE_CHEROKEE 0x01 +#define SUBLANG_CHINESE_TRADITIONAL 0x01 +#define SUBLANG_CHINESE_SIMPLIFIED 0x02 +#define SUBLANG_CHINESE_HONGKONG 0x03 +#define SUBLANG_CHINESE_SINGAPORE 0x04 +#define SUBLANG_CHINESE_MACAU 0x05 +#define SUBLANG_CORSICAN_FRANCE 0x01 +#define SUBLANG_CZECH_CZECH_REPUBLIC 0x01 +#define SUBLANG_CROATIAN_CROATIA 0x01 +#define SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN 0x04 +#define SUBLANG_DANISH_DENMARK 0x01 +#define SUBLANG_DARI_AFGHANISTAN 0x01 +#define SUBLANG_DIVEHI_MALDIVES 0x01 +#define SUBLANG_DUTCH 0x01 +#define SUBLANG_DUTCH_BELGIAN 0x02 +#define SUBLANG_ENGLISH_US 0x01 +#define SUBLANG_ENGLISH_UK 0x02 +#define SUBLANG_ENGLISH_AUS 0x03 +#define SUBLANG_ENGLISH_CAN 0x04 +#define SUBLANG_ENGLISH_NZ 0x05 +#define SUBLANG_ENGLISH_EIRE 0x06 +#define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07 +#define SUBLANG_ENGLISH_JAMAICA 0x08 +#define SUBLANG_ENGLISH_CARIBBEAN 0x09 +#define SUBLANG_ENGLISH_BELIZE 0x0a +#define SUBLANG_ENGLISH_TRINIDAD 0x0b +#define SUBLANG_ENGLISH_ZIMBABWE 0x0c +#define SUBLANG_ENGLISH_PHILIPPINES 0x0d +#define SUBLANG_ENGLISH_INDIA 0x10 +#define SUBLANG_ENGLISH_MALAYSIA 0x11 +#define SUBLANG_ENGLISH_SINGAPORE 0x12 +#define SUBLANG_ESTONIAN_ESTONIA 0x01 +#define SUBLANG_FAEROESE_FAROE_ISLANDS 0x01 +#define SUBLANG_FILIPINO_PHILIPPINES 0x01 +#define SUBLANG_FINNISH_FINLAND 0x01 +#define SUBLANG_FRENCH 0x01 +#define SUBLANG_FRENCH_BELGIAN 0x02 +#define SUBLANG_FRENCH_CANADIAN 0x03 +#define SUBLANG_FRENCH_SWISS 0x04 +#define SUBLANG_FRENCH_LUXEMBOURG 0x05 +#define SUBLANG_FRENCH_MONACO 0x06 +#define SUBLANG_FRISIAN_NETHERLANDS 0x01 +#define SUBLANG_FULAH_SENEGAL 0x02 +#define SUBLANG_GALICIAN_GALICIAN 0x01 +#define SUBLANG_GEORGIAN_GEORGIA 0x01 +#define SUBLANG_GERMAN 0x01 +#define SUBLANG_GERMAN_SWISS 0x02 +#define SUBLANG_GERMAN_AUSTRIAN 0x03 +#define SUBLANG_GERMAN_LUXEMBOURG 0x04 +#define SUBLANG_GERMAN_LIECHTENSTEIN 0x05 +#define SUBLANG_GREEK_GREECE 0x01 +#define SUBLANG_GREENLANDIC_GREENLAND 0x01 +#define SUBLANG_GUJARATI_INDIA 0x01 +#define SUBLANG_HAUSA_NIGERIA_LATIN 0x01 +#define SUBLANG_HAWAIIAN_US 0x01 +#define SUBLANG_HEBREW_ISRAEL 0x01 +#define SUBLANG_HINDI_INDIA 0x01 +#define SUBLANG_HUNGARIAN_HUNGARY 0x01 +#define SUBLANG_ICELANDIC_ICELAND 0x01 +#define SUBLANG_IGBO_NIGERIA 0x01 +#define SUBLANG_INDONESIAN_INDONESIA 0x01 +#define SUBLANG_INUKTITUT_CANADA 0x01 +#define SUBLANG_INUKTITUT_CANADA_LATIN 0x02 +#define SUBLANG_IRISH_IRELAND 0x02 +#define SUBLANG_ITALIAN 0x01 +#define SUBLANG_ITALIAN_SWISS 0x02 +#define SUBLANG_JAPANESE_JAPAN 0x01 +#define SUBLANG_KANNADA_INDIA 0x01 +#define SUBLANG_KASHMIRI_SASIA 0x02 +#define SUBLANG_KASHMIRI_INDIA 0x02 +#define SUBLANG_KAZAK_KAZAKHSTAN 0x01 +#define SUBLANG_KHMER_CAMBODIA 0x01 +#define SUBLANG_KICHE_GUATEMALA 0x01 +#define SUBLANG_KINYARWANDA_RWANDA 0x01 +#define SUBLANG_KONKANI_INDIA 0x01 +#define SUBLANG_KOREAN 0x01 +#define SUBLANG_KYRGYZ_KYRGYZSTAN 0x01 +#define SUBLANG_LAO_LAO 0x01 +#define SUBLANG_LATVIAN_LATVIA 0x01 +#define SUBLANG_LITHUANIAN 0x01 +#define SUBLANG_LOWER_SORBIAN_GERMANY 0x02 +#define SUBLANG_LUXEMBOURGISH_LUXEMBOURG 0x01 +#define SUBLANG_MACEDONIAN_MACEDONIA 0x01 +#define SUBLANG_MALAY_MALAYSIA 0x01 +#define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02 +#define SUBLANG_MALAYALAM_INDIA 0x01 +#define SUBLANG_MALTESE_MALTA 0x01 +#define SUBLANG_MAORI_NEW_ZEALAND 0x01 +#define SUBLANG_MAPUDUNGUN_CHILE 0x01 +#define SUBLANG_MARATHI_INDIA 0x01 +#define SUBLANG_MOHAWK_MOHAWK 0x01 +#define SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA 0x01 +#define SUBLANG_MONGOLIAN_PRC 0x02 +#define SUBLANG_NEPALI_INDIA 0x02 +#define SUBLANG_NEPALI_NEPAL 0x01 +#define SUBLANG_NORWEGIAN_BOKMAL 0x01 +#define SUBLANG_NORWEGIAN_NYNORSK 0x02 +#define SUBLANG_OCCITAN_FRANCE 0x01 +#define SUBLANG_ODIA_INDIA 0x01 +#define SUBLANG_ORIYA_INDIA 0x01 +#define SUBLANG_PASHTO_AFGHANISTAN 0x01 +#define SUBLANG_PERSIAN_IRAN 0x01 +#define SUBLANG_POLISH_POLAND 0x01 +#define SUBLANG_PORTUGUESE 0x02 +#define SUBLANG_PORTUGUESE_BRAZILIAN 0x01 +#define SUBLANG_PULAR_SENEGAL 0x02 +#define SUBLANG_PUNJABI_INDIA 0x01 +#define SUBLANG_PUNJABI_PAKISTAN 0x02 +#define SUBLANG_QUECHUA_BOLIVIA 0x01 +#define SUBLANG_QUECHUA_ECUADOR 0x02 +#define SUBLANG_QUECHUA_PERU 0x03 +#define SUBLANG_ROMANIAN_ROMANIA 0x01 +#define SUBLANG_ROMANSH_SWITZERLAND 0x01 +#define SUBLANG_RUSSIAN_RUSSIA 0x01 +#define SUBLANG_SAKHA_RUSSIA 0x01 +#define SUBLANG_SAMI_NORTHERN_NORWAY 0x01 +#define SUBLANG_SAMI_NORTHERN_SWEDEN 0x02 +#define SUBLANG_SAMI_NORTHERN_FINLAND 0x03 +#define SUBLANG_SAMI_LULE_NORWAY 0x04 +#define SUBLANG_SAMI_LULE_SWEDEN 0x05 +#define SUBLANG_SAMI_SOUTHERN_NORWAY 0x06 +#define SUBLANG_SAMI_SOUTHERN_SWEDEN 0x07 +#define SUBLANG_SAMI_SKOLT_FINLAND 0x08 +#define SUBLANG_SAMI_INARI_FINLAND 0x09 +#define SUBLANG_SANSKRIT_INDIA 0x01 +#define SUBLANG_SCOTTISH_GAELIC 0x01 +#define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN 0x06 +#define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x07 +#define SUBLANG_SERBIAN_MONTENEGRO_LATIN 0x0b +#define SUBLANG_SERBIAN_MONTENEGRO_CYRILLIC 0x0c +#define SUBLANG_SERBIAN_SERBIA_LATIN 0x09 +#define SUBLANG_SERBIAN_SERBIA_CYRILLIC 0x0a +#define SUBLANG_SERBIAN_CROATIA 0x01 +#define SUBLANG_SERBIAN_LATIN 0x02 +#define SUBLANG_SERBIAN_CYRILLIC 0x03 +#define SUBLANG_SINDHI_INDIA 0x01 +#define SUBLANG_SINDHI_PAKISTAN 0x02 +#define SUBLANG_SINDHI_AFGHANISTAN 0x02 +#define SUBLANG_SINHALESE_SRI_LANKA 0x01 +#define SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA 0x01 +#define SUBLANG_SLOVAK_SLOVAKIA 0x01 +#define SUBLANG_SLOVENIAN_SLOVENIA 0x01 +#define SUBLANG_SPANISH 0x01 +#define SUBLANG_SPANISH_MEXICAN 0x02 +#define SUBLANG_SPANISH_MODERN 0x03 +#define SUBLANG_SPANISH_GUATEMALA 0x04 +#define SUBLANG_SPANISH_COSTA_RICA 0x05 +#define SUBLANG_SPANISH_PANAMA 0x06 +#define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07 +#define SUBLANG_SPANISH_VENEZUELA 0x08 +#define SUBLANG_SPANISH_COLOMBIA 0x09 +#define SUBLANG_SPANISH_PERU 0x0a +#define SUBLANG_SPANISH_ARGENTINA 0x0b +#define SUBLANG_SPANISH_ECUADOR 0x0c +#define SUBLANG_SPANISH_CHILE 0x0d +#define SUBLANG_SPANISH_URUGUAY 0x0e +#define SUBLANG_SPANISH_PARAGUAY 0x0f +#define SUBLANG_SPANISH_BOLIVIA 0x10 +#define SUBLANG_SPANISH_EL_SALVADOR 0x11 +#define SUBLANG_SPANISH_HONDURAS 0x12 +#define SUBLANG_SPANISH_NICARAGUA 0x13 +#define SUBLANG_SPANISH_PUERTO_RICO 0x14 +#define SUBLANG_SPANISH_US 0x15 +#define SUBLANG_SWAHILI_KENYA 0x01 +#define SUBLANG_SWEDISH 0x01 +#define SUBLANG_SWEDISH_FINLAND 0x02 +#define SUBLANG_SYRIAC_SYRIA 0x01 +#define SUBLANG_TAJIK_TAJIKISTAN 0x01 +#define SUBLANG_TAMAZIGHT_ALGERIA_LATIN 0x02 +#define SUBLANG_TAMAZIGHT_MOROCCO_TIFINAGH 0x04 +#define SUBLANG_TAMIL_INDIA 0x01 +#define SUBLANG_TAMIL_SRI_LANKA 0x02 +#define SUBLANG_TATAR_RUSSIA 0x01 +#define SUBLANG_TELUGU_INDIA 0x01 +#define SUBLANG_THAI_THAILAND 0x01 +#define SUBLANG_TIBETAN_PRC 0x01 +#define SUBLANG_TIGRIGNA_ERITREA 0x02 +#define SUBLANG_TIGRINYA_ERITREA 0x02 +#define SUBLANG_TIGRINYA_ETHIOPIA 0x01 +#define SUBLANG_TSWANA_BOTSWANA 0x02 +#define SUBLANG_TSWANA_SOUTH_AFRICA 0x01 +#define SUBLANG_TURKISH_TURKEY 0x01 +#define SUBLANG_TURKMEN_TURKMENISTAN 0x01 +#define SUBLANG_UIGHUR_PRC 0x01 +#define SUBLANG_UKRAINIAN_UKRAINE 0x01 +#define SUBLANG_UPPER_SORBIAN_GERMANY 0x01 +#define SUBLANG_URDU_PAKISTAN 0x01 +#define SUBLANG_URDU_INDIA 0x02 +#define SUBLANG_UZBEK_LATIN 0x01 +#define SUBLANG_UZBEK_CYRILLIC 0x02 +#define SUBLANG_VALENCIAN_VALENCIA 0x02 +#define SUBLANG_VIETNAMESE_VIETNAM 0x01 +#define SUBLANG_WELSH_UNITED_KINGDOM 0x01 +#define SUBLANG_WOLOF_SENEGAL 0x01 +#define SUBLANG_XHOSA_SOUTH_AFRICA 0x01 +#define SUBLANG_YAKUT_RUSSIA 0x01 +#define SUBLANG_YI_PRC 0x01 +#define SUBLANG_YORUBA_NIGERIA 0x01 +#define SUBLANG_ZULU_SOUTH_AFRICA 0x01 -#define SORT_DEFAULT 0x0 +#define SORT_DEFAULT 0x0 -#define SORT_INVARIANT_MATH 0x1 +#define SORT_INVARIANT_MATH 0x1 -#define SORT_JAPANESE_XJIS 0x0 -#define SORT_JAPANESE_UNICODE 0x1 -#define SORT_JAPANESE_RADICALSTROKE 0x4 +#define SORT_JAPANESE_XJIS 0x0 +#define SORT_JAPANESE_UNICODE 0x1 +#define SORT_JAPANESE_RADICALSTROKE 0x4 -#define SORT_CHINESE_BIG5 0x0 -#define SORT_CHINESE_PRCP 0x0 -#define SORT_CHINESE_UNICODE 0x1 -#define SORT_CHINESE_PRC 0x2 -#define SORT_CHINESE_BOPOMOFO 0x3 -#define SORT_CHINESE_RADICALSTROKE 0x4 +#define SORT_CHINESE_BIG5 0x0 +#define SORT_CHINESE_PRCP 0x0 +#define SORT_CHINESE_UNICODE 0x1 +#define SORT_CHINESE_PRC 0x2 +#define SORT_CHINESE_BOPOMOFO 0x3 +#define SORT_CHINESE_RADICALSTROKE 0x4 -#define SORT_KOREAN_KSC 0x0 -#define SORT_KOREAN_UNICODE 0x1 +#define SORT_KOREAN_KSC 0x0 +#define SORT_KOREAN_UNICODE 0x1 -#define SORT_GERMAN_PHONE_BOOK 0x1 +#define SORT_GERMAN_PHONE_BOOK 0x1 -#define SORT_HUNGARIAN_DEFAULT 0x0 -#define SORT_HUNGARIAN_TECHNICAL 0x1 +#define SORT_HUNGARIAN_DEFAULT 0x0 +#define SORT_HUNGARIAN_TECHNICAL 0x1 -#define SORT_GEORGIAN_TRADITIONAL 0x0 -#define SORT_GEORGIAN_MODERN 0x1 +#define SORT_GEORGIAN_TRADITIONAL 0x0 +#define SORT_GEORGIAN_MODERN 0x1 -#define MAKELANGID(p, s) ((((WORD)(s)) << 10) | (WORD)(p)) -#define PRIMARYLANGID(lgid) ((WORD)(lgid) & 0x3FF) -#define SUBLANGID(lgid) ((WORD)(lgid) >> 10) +#define MAKELANGID(p, s) ((((WORD)(s)) << 10) | (WORD)(p)) +#define PRIMARYLANGID(lgid) ((WORD)(lgid)&0x3FF) +#define SUBLANGID(lgid) ((WORD)(lgid) >> 10) -#define NLS_VALID_LOCALE_MASK 0x000FFFFF +#define NLS_VALID_LOCALE_MASK 0x000FFFFF -#define MAKELCID(lgid, srtid) ((DWORD)((((DWORD)((WORD)(srtid))) << 16) | ((DWORD)((WORD)(lgid))))) +#define MAKELCID(lgid, srtid) ((DWORD)((((DWORD)((WORD)(srtid))) << 16) | ((DWORD)((WORD)(lgid))))) #define MAKESORTLCID(lgid, srtid, ver) \ ((DWORD)((MAKELCID(lgid, srtid)) | (((DWORD)((WORD)(ver))) << 20))) -#define LANGIDFROMLCID(lcid) ((WORD)(lcid)) -#define SORTIDFROMLCID(lcid) ((WORD)((((DWORD)(lcid)) >> 16) & 0xF)) +#define LANGIDFROMLCID(lcid) ((WORD)(lcid)) +#define SORTIDFROMLCID(lcid) ((WORD)((((DWORD)(lcid)) >> 16) & 0xF)) -#define SORTVERSIONFROMLCID(lcid) ((WORD)((((DWORD)(lcid)) >> 20) & 0xF)) +#define SORTVERSIONFROMLCID(lcid) ((WORD)((((DWORD)(lcid)) >> 20) & 0xF)) -#define LOCALE_NAME_MAX_LENGTH 85 +#define LOCALE_NAME_MAX_LENGTH 85 +#define LANG_SYSTEM_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT)) +#define LANG_USER_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT)) -#define LANG_SYSTEM_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT)) -#define LANG_USER_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT)) - -#define LOCALE_SYSTEM_DEFAULT (MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT)) -#define LOCALE_USER_DEFAULT (MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT)) +#define LOCALE_SYSTEM_DEFAULT (MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT)) +#define LOCALE_USER_DEFAULT (MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT)) #define LOCALE_CUSTOM_DEFAULT \ (MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_CUSTOM_DEFAULT), SORT_DEFAULT)) @@ -476,26 +475,27 @@ #define LOCALE_CUSTOM_UI_DEFAULT \ (MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_UI_CUSTOM_DEFAULT), SORT_DEFAULT)) -#define LOCALE_NEUTRAL \ - (MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), SORT_DEFAULT)) +#define LOCALE_NEUTRAL (MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), SORT_DEFAULT)) -#define LOCALE_INVARIANT \ - (MAKELCID(MAKELANGID(LANG_INVARIANT, SUBLANG_NEUTRAL), SORT_DEFAULT)) +#define LOCALE_INVARIANT (MAKELCID(MAKELANGID(LANG_INVARIANT, SUBLANG_NEUTRAL), SORT_DEFAULT)) #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -DWORD WINAPI FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, - LPSTR lpBuffer, DWORD nSize, va_list* Arguments); + DWORD WINAPI FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, + DWORD dwLanguageId, LPSTR lpBuffer, DWORD nSize, + va_list* Arguments); -DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, - LPWSTR lpBuffer, DWORD nSize, va_list* Arguments); + DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, + DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, + va_list* Arguments); #ifdef UNICODE -#define FormatMessage FormatMessageW +#define FormatMessage FormatMessageW #else -#define FormatMessage FormatMessageA +#define FormatMessage FormatMessageA #endif #ifdef __cplusplus @@ -505,4 +505,3 @@ DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, #endif #endif /* WINPR_LOCALE_H */ - diff --git a/winpr/include/winpr/memory.h b/winpr/include/winpr/memory.h index 28e740fc4..42feee67a 100644 --- a/winpr/include/winpr/memory.h +++ b/winpr/include/winpr/memory.h @@ -34,40 +34,44 @@ #ifndef _WIN32 #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API HANDLE CreateFileMappingA(HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, DWORD flProtect, - DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCSTR lpName); -WINPR_API HANDLE CreateFileMappingW(HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, DWORD flProtect, - DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCWSTR lpName); + WINPR_API HANDLE CreateFileMappingA(HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, + DWORD flProtect, DWORD dwMaximumSizeHigh, + DWORD dwMaximumSizeLow, LPCSTR lpName); + WINPR_API HANDLE CreateFileMappingW(HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, + DWORD flProtect, DWORD dwMaximumSizeHigh, + DWORD dwMaximumSizeLow, LPCWSTR lpName); -WINPR_API HANDLE OpenFileMappingA(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName); -WINPR_API HANDLE OpenFileMappingW(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName); + WINPR_API HANDLE OpenFileMappingA(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName); + WINPR_API HANDLE OpenFileMappingW(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName); -WINPR_API LPVOID MapViewOfFile(HANDLE hFileMappingObject, DWORD dwDesiredAccess, DWORD dwFileOffsetHigh, - DWORD dwFileOffsetLow, SIZE_T dwNumberOfBytesToMap); + WINPR_API LPVOID MapViewOfFile(HANDLE hFileMappingObject, DWORD dwDesiredAccess, + DWORD dwFileOffsetHigh, DWORD dwFileOffsetLow, + SIZE_T dwNumberOfBytesToMap); -WINPR_API LPVOID MapViewOfFileEx(HANDLE hFileMappingObject, DWORD dwDesiredAccess, DWORD dwFileOffsetHigh, - DWORD dwFileOffsetLow, SIZE_T dwNumberOfBytesToMap, LPVOID lpBaseAddress); + WINPR_API LPVOID MapViewOfFileEx(HANDLE hFileMappingObject, DWORD dwDesiredAccess, + DWORD dwFileOffsetHigh, DWORD dwFileOffsetLow, + SIZE_T dwNumberOfBytesToMap, LPVOID lpBaseAddress); -WINPR_API BOOL FlushViewOfFile(LPCVOID lpBaseAddress, SIZE_T dwNumberOfBytesToFlush); + WINPR_API BOOL FlushViewOfFile(LPCVOID lpBaseAddress, SIZE_T dwNumberOfBytesToFlush); -WINPR_API BOOL UnmapViewOfFile(LPCVOID lpBaseAddress); + WINPR_API BOOL UnmapViewOfFile(LPCVOID lpBaseAddress); #ifdef __cplusplus } #endif #ifdef UNICODE -#define CreateFileMapping CreateFileMappingW -#define OpenFileMapping OpenFileMappingW +#define CreateFileMapping CreateFileMappingW +#define OpenFileMapping OpenFileMappingW #else -#define CreateFileMapping CreateFileMappingA -#define OpenFileMapping OpenFileMappingA +#define CreateFileMapping CreateFileMappingA +#define OpenFileMapping OpenFileMappingA #endif #endif #endif /* WINPR_MEMORY_H */ - diff --git a/winpr/include/winpr/midl.h b/winpr/include/winpr/midl.h index a0daaa4da..8e7875655 100644 --- a/winpr/include/winpr/midl.h +++ b/winpr/include/winpr/midl.h @@ -23,13 +23,14 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif #ifndef _WIN32 -WINPR_API void* MIDL_user_allocate(size_t cBytes); -WINPR_API void MIDL_user_free(void* p); + WINPR_API void* MIDL_user_allocate(size_t cBytes); + WINPR_API void MIDL_user_free(void* p); #endif diff --git a/winpr/include/winpr/ndr.h b/winpr/include/winpr/ndr.h index 3584f9779..2580a6ce6 100644 --- a/winpr/include/winpr/ndr.h +++ b/winpr/include/winpr/ndr.h @@ -25,11 +25,10 @@ #ifndef _WIN32 -#define __RPC_WIN32__ 1 -#define TARGET_IS_NT50_OR_LATER 1 +#define __RPC_WIN32__ 1 +#define TARGET_IS_NT50_OR_LATER 1 -typedef union _CLIENT_CALL_RETURN -{ +typedef union _CLIENT_CALL_RETURN { void* Pointer; LONG_PTR Simple; } CLIENT_CALL_RETURN; @@ -46,7 +45,7 @@ typedef struct _RPC_SYNTAX_IDENTIFIER RPC_VERSION SyntaxVersion; } RPC_SYNTAX_IDENTIFIER, PRPC_SYNTAX_IDENTIFIER; -#define RPC_MGR_EPV void +#define RPC_MGR_EPV void typedef struct _RPC_MESSAGE { @@ -76,7 +75,7 @@ typedef struct _RPC_PROTSEQ_ENDPOINT { unsigned char* RpcProtocolSequence; unsigned char* Endpoint; -} RPC_PROTSEQ_ENDPOINT, * PRPC_PROTSEQ_ENDPOINT; +} RPC_PROTSEQ_ENDPOINT, *PRPC_PROTSEQ_ENDPOINT; typedef struct _RPC_SERVER_INTERFACE { @@ -151,7 +150,7 @@ typedef struct _MIDL_STUB_MESSAGE ULONG_PTR MaxCount; ULONG Offset; ULONG ActualCount; - void *(*pfnAllocate)(size_t); + void* (*pfnAllocate)(size_t); void (*pfnFree)(void*); unsigned char* StackTop; unsigned char* pPresentedType; @@ -171,21 +170,21 @@ typedef struct _MIDL_STUB_MESSAGE int fUnused2 : 16; ULONG dwDestContext; void* pvDestContext; - //NDR_SCONTEXT* SavedContextHandles; + // NDR_SCONTEXT* SavedContextHandles; long ParamNumber; struct IRpcChannelBuffer* pRpcChannelBuffer; - //PARRAY_INFO pArrayInfo; + // PARRAY_INFO pArrayInfo; ULONG* SizePtrCountArray; ULONG* SizePtrOffsetArray; ULONG* SizePtrLengthArray; void* pArgQueue; ULONG dwStubPhase; void* LowStackMark; - //PNDR_ASYNC_MESSAGE pAsyncMsg; - //PNDR_CORRELATION_INFO pCorrInfo; + // PNDR_ASYNC_MESSAGE pAsyncMsg; + // PNDR_CORRELATION_INFO pCorrInfo; unsigned char* pCorrMemory; void* pMemoryList; - //CS_STUB_INFO* pCSInfo; + // CS_STUB_INFO* pCSInfo; unsigned char* ConformanceMark; unsigned char* VarianceMark; void* BackingStoreLowMark; @@ -244,29 +243,28 @@ struct _MIDL_STUB_DESC void* (*pfnAllocate)(size_t); void (*pfnFree)(void*); - union - { + union { handle_t* pAutoHandle; handle_t* pPrimitiveHandle; PGENERIC_BINDING_INFO pGenericBindingInfo; - } IMPLICIT_HANDLE_INFO; + } IMPLICIT_HANDLE_INFO; - const NDR_RUNDOWN* apfnNdrRundownRoutines; - const GENERIC_BINDING_ROUTINE_PAIR* aGenericBindingRoutinePairs; - const EXPR_EVAL* apfnExprEval; - const XMIT_ROUTINE_QUINTUPLE* aXmitQuintuple; - const unsigned char* pFormatTypes; + const NDR_RUNDOWN* apfnNdrRundownRoutines; + const GENERIC_BINDING_ROUTINE_PAIR* aGenericBindingRoutinePairs; + const EXPR_EVAL* apfnExprEval; + const XMIT_ROUTINE_QUINTUPLE* aXmitQuintuple; + const unsigned char* pFormatTypes; - int fCheckBounds; - ULONG Version; - MALLOC_FREE_STRUCT* pMallocFreeStruct; + int fCheckBounds; + ULONG Version; + MALLOC_FREE_STRUCT* pMallocFreeStruct; - long MIDLVersion; - const COMM_FAULT_OFFSETS* CommFaultOffsets; - const USER_MARSHAL_ROUTINE_QUADRUPLE* aUserMarshalQuadruple; + long MIDLVersion; + const COMM_FAULT_OFFSETS* CommFaultOffsets; + const USER_MARSHAL_ROUTINE_QUADRUPLE* aUserMarshalQuadruple; - const NDR_NOTIFY_ROUTINE* NotifyRoutineTable; - ULONG_PTR mFlags; + const NDR_NOTIFY_ROUTINE* NotifyRoutineTable; + ULONG_PTR mFlags; const NDR_CS_ROUTINES* CsRoutineTables; void* ProxyServerInfo; const NDR_EXPR_DESC* pExprInfo; @@ -323,7 +321,7 @@ typedef struct unsigned char Unused : 3; } INTERPRETER_OPT_FLAGS2, *PINTERPRETER_OPT_FLAGS2; -typedef struct _NDR_CORRELATION_FLAGS +typedef struct _NDR_CORRELATION_FLAGS { unsigned char Early : 1; unsigned char Split : 1; @@ -332,28 +330,27 @@ typedef struct _NDR_CORRELATION_FLAGS unsigned char Unused : 4; } NDR_CORRELATION_FLAGS; -#define FC_ALLOCATE_ALL_NODES 0x01 -#define FC_DONT_FREE 0x02 -#define FC_ALLOCED_ON_STACK 0x03 -#define FC_SIMPLE_POINTER 0x04 -#define FC_POINTER_DEREF 0x05 +#define FC_ALLOCATE_ALL_NODES 0x01 +#define FC_DONT_FREE 0x02 +#define FC_ALLOCED_ON_STACK 0x03 +#define FC_SIMPLE_POINTER 0x04 +#define FC_POINTER_DEREF 0x05 -#define HANDLE_PARAM_IS_VIA_PTR 0x80 -#define HANDLE_PARAM_IS_IN 0x40 -#define HANDLE_PARAM_IS_OUT 0x20 -#define HANDLE_PARAM_IS_RETURN 0x21 -#define NDR_STRICT_CONTEXT_HANDLE 0x08 -#define NDR_CONTEXT_HANDLE_NO_SERIALIZE 0x04 -#define NDR_CONTEXT_HANDLE_SERIALIZE 0x02 -#define NDR_CONTEXT_HANDLE_CANNOT_BE_NULL 0x01 +#define HANDLE_PARAM_IS_VIA_PTR 0x80 +#define HANDLE_PARAM_IS_IN 0x40 +#define HANDLE_PARAM_IS_OUT 0x20 +#define HANDLE_PARAM_IS_RETURN 0x21 +#define NDR_STRICT_CONTEXT_HANDLE 0x08 +#define NDR_CONTEXT_HANDLE_NO_SERIALIZE 0x04 +#define NDR_CONTEXT_HANDLE_SERIALIZE 0x02 +#define NDR_CONTEXT_HANDLE_CANNOT_BE_NULL 0x01 typedef struct { PARAM_ATTRIBUTES Attributes; unsigned short StackOffset; - union - { + union { unsigned char FormatChar; unsigned short Offset; } Type; @@ -395,139 +392,145 @@ typedef enum _NDR_PHASE NDR_PHASE_FREE } NDR_PHASE; -#define FC_NORMAL_CONFORMANCE 0x00 -#define FC_POINTER_CONFORMANCE 0x10 -#define FC_TOP_LEVEL_CONFORMANCE 0x20 -#define FC_CONSTANT_CONFORMANCE 0x40 -#define FC_TOP_LEVEL_MULTID_CONFORMANCE 0x80 +#define FC_NORMAL_CONFORMANCE 0x00 +#define FC_POINTER_CONFORMANCE 0x10 +#define FC_TOP_LEVEL_CONFORMANCE 0x20 +#define FC_CONSTANT_CONFORMANCE 0x40 +#define FC_TOP_LEVEL_MULTID_CONFORMANCE 0x80 /* Type Format Strings: http://msdn.microsoft.com/en-us/library/windows/desktop/aa379093/ */ -#define FC_ZERO 0x00 -#define FC_BYTE 0x01 -#define FC_CHAR 0x02 -#define FC_SMALL 0x03 -#define FC_USMALL 0x04 -#define FC_WCHAR 0x05 -#define FC_SHORT 0x06 -#define FC_USHORT 0x07 -#define FC_LONG 0x08 -#define FC_ULONG 0x09 -#define FC_FLOAT 0x0A -#define FC_HYPER 0x0B -#define FC_DOUBLE 0x0C -#define FC_ENUM16 0x0D -#define FC_ENUM32 0x0E -#define FC_IGNORE 0x0F -#define FC_ERROR_STATUS_T 0x10 -#define FC_RP 0x11 -#define FC_UP 0x12 -#define FC_OP 0x13 -#define FC_FP 0x14 -#define FC_STRUCT 0x15 -#define FC_PSTRUCT 0x16 -#define FC_CSTRUCT 0x17 -#define FC_CPSTRUCT 0x18 -#define FC_CVSTRUCT 0x19 -#define FC_BOGUS_STRUCT 0x1A -#define FC_CARRAY 0x1B -#define FC_CVARRAY 0x1C -#define FC_SMFARRAY 0x1D -#define FC_LGFARRAY 0x1E -#define FC_SMVARRAY 0x1F -#define FC_LGVARRAY 0x20 -#define FC_BOGUS_ARRAY 0x21 -#define FC_C_CSTRING 0x22 -#define FC_C_BSTRING 0x23 -#define FC_C_SSTRING 0x24 -#define FC_C_WSTRING 0x25 -#define FC_CSTRING 0x26 -#define FC_BSTRING 0x27 -#define FC_SSTRING 0x28 -#define FC_WSTRING 0x29 -#define FC_ENCAPSULATED_UNION 0x2A -#define FC_NON_ENCAPSULATED_UNION 0x2B -#define FC_BYTE_COUNT_POINTER 0x2C -#define FC_TRANSMIT_AS 0x2D -#define FC_REPRESENT_AS 0x2E -#define FC_IP 0x2F -#define FC_BIND_CONTEXT 0x30 -#define FC_BIND_GENERIC 0x31 -#define FC_BIND_PRIMITIVE 0x32 -#define FC_AUTO_HANDLE 0x33 -#define FC_CALLBACK_HANDLE 0x34 -#define FC_UNUSED1 0x35 -#define FC_POINTER 0x36 -#define FC_ALIGNM2 0x37 -#define FC_ALIGNM4 0x38 -#define FC_ALIGNM8 0x39 -#define FC_UNUSED2 0x3A -#define FC_UNUSED3 0x3B -#define FC_UNUSED4 0x3C -#define FC_STRUCTPAD1 0x3D -#define FC_STRUCTPAD2 0x3E -#define FC_STRUCTPAD3 0x3F -#define FC_STRUCTPAD4 0x40 -#define FC_STRUCTPAD5 0x41 -#define FC_STRUCTPAD6 0x42 -#define FC_STRUCTPAD7 0x43 -#define FC_STRING_SIZED 0x44 -#define FC_UNUSED5 0x45 -#define FC_NO_REPEAT 0x46 -#define FC_FIXED_REPEAT 0x47 -#define FC_VARIABLE_REPEAT 0x48 -#define FC_FIXED_OFFSET 0x49 -#define FC_VARIABLE_OFFSET 0x4A -#define FC_PP 0x4B -#define FC_EMBEDDED_COMPLEX 0x4C -#define FC_IN_PARAM 0x4D -#define FC_IN_PARAM_BASETYPE 0x4E -#define FC_IN_PARAM_NO_FREE_INST 0x4F -#define FC_IN_OUT_PARAM 0x50 -#define FC_OUT_PARAM 0x51 -#define FC_RETURN_PARAM 0x52 -#define FC_RETURN_PARAM_BASETYPE 0x53 -#define FC_DEREFERENCE 0x54 -#define FC_DIV_2 0x55 -#define FC_MULT_2 0x56 -#define FC_ADD_1 0x57 -#define FC_SUB_1 0x58 -#define FC_CALLBACK 0x59 -#define FC_CONSTANT_IID 0x5A -#define FC_END 0x5B -#define FC_PAD 0x5C -#define FC_SPLIT_DEREFERENCE 0x74 -#define FC_SPLIT_DIV_2 0x75 -#define FC_SPLIT_MULT_2 0x76 -#define FC_SPLIT_ADD_1 0x77 -#define FC_SPLIT_SUB_1 0x78 -#define FC_SPLIT_CALLBACK 0x79 -#define FC_HARD_STRUCT 0xB1 -#define FC_TRANSMIT_AS_PTR 0xB2 -#define FC_REPRESENT_AS_PTR 0xB3 -#define FC_USER_MARSHAL 0xB4 -#define FC_PIPE 0xB5 -#define FC_BLKHOLE 0xB6 -#define FC_RANGE 0xB7 -#define FC_INT3264 0xB8 -#define FC_UINT3264 0xB9 -#define FC_END_OF_UNIVERSE 0xBA +#define FC_ZERO 0x00 +#define FC_BYTE 0x01 +#define FC_CHAR 0x02 +#define FC_SMALL 0x03 +#define FC_USMALL 0x04 +#define FC_WCHAR 0x05 +#define FC_SHORT 0x06 +#define FC_USHORT 0x07 +#define FC_LONG 0x08 +#define FC_ULONG 0x09 +#define FC_FLOAT 0x0A +#define FC_HYPER 0x0B +#define FC_DOUBLE 0x0C +#define FC_ENUM16 0x0D +#define FC_ENUM32 0x0E +#define FC_IGNORE 0x0F +#define FC_ERROR_STATUS_T 0x10 +#define FC_RP 0x11 +#define FC_UP 0x12 +#define FC_OP 0x13 +#define FC_FP 0x14 +#define FC_STRUCT 0x15 +#define FC_PSTRUCT 0x16 +#define FC_CSTRUCT 0x17 +#define FC_CPSTRUCT 0x18 +#define FC_CVSTRUCT 0x19 +#define FC_BOGUS_STRUCT 0x1A +#define FC_CARRAY 0x1B +#define FC_CVARRAY 0x1C +#define FC_SMFARRAY 0x1D +#define FC_LGFARRAY 0x1E +#define FC_SMVARRAY 0x1F +#define FC_LGVARRAY 0x20 +#define FC_BOGUS_ARRAY 0x21 +#define FC_C_CSTRING 0x22 +#define FC_C_BSTRING 0x23 +#define FC_C_SSTRING 0x24 +#define FC_C_WSTRING 0x25 +#define FC_CSTRING 0x26 +#define FC_BSTRING 0x27 +#define FC_SSTRING 0x28 +#define FC_WSTRING 0x29 +#define FC_ENCAPSULATED_UNION 0x2A +#define FC_NON_ENCAPSULATED_UNION 0x2B +#define FC_BYTE_COUNT_POINTER 0x2C +#define FC_TRANSMIT_AS 0x2D +#define FC_REPRESENT_AS 0x2E +#define FC_IP 0x2F +#define FC_BIND_CONTEXT 0x30 +#define FC_BIND_GENERIC 0x31 +#define FC_BIND_PRIMITIVE 0x32 +#define FC_AUTO_HANDLE 0x33 +#define FC_CALLBACK_HANDLE 0x34 +#define FC_UNUSED1 0x35 +#define FC_POINTER 0x36 +#define FC_ALIGNM2 0x37 +#define FC_ALIGNM4 0x38 +#define FC_ALIGNM8 0x39 +#define FC_UNUSED2 0x3A +#define FC_UNUSED3 0x3B +#define FC_UNUSED4 0x3C +#define FC_STRUCTPAD1 0x3D +#define FC_STRUCTPAD2 0x3E +#define FC_STRUCTPAD3 0x3F +#define FC_STRUCTPAD4 0x40 +#define FC_STRUCTPAD5 0x41 +#define FC_STRUCTPAD6 0x42 +#define FC_STRUCTPAD7 0x43 +#define FC_STRING_SIZED 0x44 +#define FC_UNUSED5 0x45 +#define FC_NO_REPEAT 0x46 +#define FC_FIXED_REPEAT 0x47 +#define FC_VARIABLE_REPEAT 0x48 +#define FC_FIXED_OFFSET 0x49 +#define FC_VARIABLE_OFFSET 0x4A +#define FC_PP 0x4B +#define FC_EMBEDDED_COMPLEX 0x4C +#define FC_IN_PARAM 0x4D +#define FC_IN_PARAM_BASETYPE 0x4E +#define FC_IN_PARAM_NO_FREE_INST 0x4F +#define FC_IN_OUT_PARAM 0x50 +#define FC_OUT_PARAM 0x51 +#define FC_RETURN_PARAM 0x52 +#define FC_RETURN_PARAM_BASETYPE 0x53 +#define FC_DEREFERENCE 0x54 +#define FC_DIV_2 0x55 +#define FC_MULT_2 0x56 +#define FC_ADD_1 0x57 +#define FC_SUB_1 0x58 +#define FC_CALLBACK 0x59 +#define FC_CONSTANT_IID 0x5A +#define FC_END 0x5B +#define FC_PAD 0x5C +#define FC_SPLIT_DEREFERENCE 0x74 +#define FC_SPLIT_DIV_2 0x75 +#define FC_SPLIT_MULT_2 0x76 +#define FC_SPLIT_ADD_1 0x77 +#define FC_SPLIT_SUB_1 0x78 +#define FC_SPLIT_CALLBACK 0x79 +#define FC_HARD_STRUCT 0xB1 +#define FC_TRANSMIT_AS_PTR 0xB2 +#define FC_REPRESENT_AS_PTR 0xB3 +#define FC_USER_MARSHAL 0xB4 +#define FC_PIPE 0xB5 +#define FC_BLKHOLE 0xB6 +#define FC_RANGE 0xB7 +#define FC_INT3264 0xB8 +#define FC_UINT3264 0xB9 +#define FC_END_OF_UNIVERSE 0xBA -#define NdrFcShort(s) (byte)(s & 0xFF), (byte)(s >> 8) +#define NdrFcShort(s) (byte)(s & 0xFF), (byte)(s >> 8) -#define NdrFcLong(s) (byte)(s & 0xFF), (byte)((s & 0x0000FF00) >> 8), \ - (byte)((s & 0x00FF0000) >> 16), (byte)(s >> 24) +#define NdrFcLong(s) \ + (byte)(s & 0xFF), (byte)((s & 0x0000FF00) >> 8), (byte)((s & 0x00FF0000) >> 16), (byte)(s >> 24) -typedef void (*NDR_TYPE_SIZE_ROUTINE)(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); -typedef void (*NDR_TYPE_MARSHALL_ROUTINE)(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, unsigned char FormatChar); -typedef void (*NDR_TYPE_UNMARSHALL_ROUTINE)(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, unsigned char FormatChar); -typedef void (*NDR_TYPE_FREE_ROUTINE)(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); +typedef void (*NDR_TYPE_SIZE_ROUTINE)(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); +typedef void (*NDR_TYPE_MARSHALL_ROUTINE)(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + unsigned char FormatChar); +typedef void (*NDR_TYPE_UNMARSHALL_ROUTINE)(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + unsigned char FormatChar); +typedef void (*NDR_TYPE_FREE_ROUTINE)(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API CLIENT_CALL_RETURN NdrClientCall2(PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ...); + WINPR_API CLIENT_CALL_RETURN NdrClientCall2(PMIDL_STUB_DESC pStubDescriptor, + PFORMAT_STRING pFormat, ...); #ifdef __cplusplus } diff --git a/winpr/include/winpr/nt.h b/winpr/include/winpr/nt.h index d7ba79590..e7de38c2b 100644 --- a/winpr/include/winpr/nt.h +++ b/winpr/include/winpr/nt.h @@ -28,62 +28,62 @@ /* Defined in winnt.h, do not redefine */ -#define STATUS_WAIT_0 ((NTSTATUS)0x00000000L) -#define STATUS_ABANDONED_WAIT_0 ((NTSTATUS)0x00000080L) -#define STATUS_USER_APC ((NTSTATUS)0x000000C0L) -#define STATUS_TIMEOUT ((NTSTATUS)0x00000102L) -#define STATUS_PENDING ((NTSTATUS)0x00000103L) -#define DBG_EXCEPTION_HANDLED ((NTSTATUS)0x00010001L) -#define DBG_CONTINUE ((NTSTATUS)0x00010002L) -#define STATUS_SEGMENT_NOTIFICATION ((NTSTATUS)0x40000005L) -#define STATUS_FATAL_APP_EXIT ((NTSTATUS)0x40000015L) -#define DBG_TERMINATE_THREAD ((NTSTATUS)0x40010003L) -#define DBG_TERMINATE_PROCESS ((NTSTATUS)0x40010004L) -#define DBG_CONTROL_C ((NTSTATUS)0x40010005L) -#define DBG_PRINTEXCEPTION_C ((NTSTATUS)0x40010006L) -#define DBG_RIPEXCEPTION ((NTSTATUS)0x40010007L) -#define DBG_CONTROL_BREAK ((NTSTATUS)0x40010008L) -#define DBG_COMMAND_EXCEPTION ((NTSTATUS)0x40010009L) -#define STATUS_GUARD_PAGE_VIOLATION ((NTSTATUS)0x80000001L) -#define STATUS_DATATYPE_MISALIGNMENT ((NTSTATUS)0x80000002L) -#define STATUS_BREAKPOINT ((NTSTATUS)0x80000003L) -#define STATUS_SINGLE_STEP ((NTSTATUS)0x80000004L) -#define STATUS_LONGJUMP ((NTSTATUS)0x80000026L) -#define STATUS_UNWIND_CONSOLIDATE ((NTSTATUS)0x80000029L) -#define DBG_EXCEPTION_NOT_HANDLED ((NTSTATUS)0x80010001L) -#define STATUS_ACCESS_VIOLATION ((NTSTATUS)0xC0000005L) -#define STATUS_IN_PAGE_ERROR ((NTSTATUS)0xC0000006L) -#define STATUS_INVALID_HANDLE ((NTSTATUS)0xC0000008L) -#define STATUS_INVALID_PARAMETER ((NTSTATUS)0xC000000DL) -#define STATUS_NO_MEMORY ((NTSTATUS)0xC0000017L) -#define STATUS_ILLEGAL_INSTRUCTION ((NTSTATUS)0xC000001DL) -#define STATUS_NONCONTINUABLE_EXCEPTION ((NTSTATUS)0xC0000025L) -#define STATUS_INVALID_DISPOSITION ((NTSTATUS)0xC0000026L) -#define STATUS_ARRAY_BOUNDS_EXCEEDED ((NTSTATUS)0xC000008CL) -#define STATUS_FLOAT_DENORMAL_OPERAND ((NTSTATUS)0xC000008DL) -#define STATUS_FLOAT_DIVIDE_BY_ZERO ((NTSTATUS)0xC000008EL) -#define STATUS_FLOAT_INEXACT_RESULT ((NTSTATUS)0xC000008FL) -#define STATUS_FLOAT_INVALID_OPERATION ((NTSTATUS)0xC0000090L) -#define STATUS_FLOAT_OVERFLOW ((NTSTATUS)0xC0000091L) -#define STATUS_FLOAT_STACK_CHECK ((NTSTATUS)0xC0000092L) -#define STATUS_FLOAT_UNDERFLOW ((NTSTATUS)0xC0000093L) -#define STATUS_INTEGER_DIVIDE_BY_ZERO ((NTSTATUS)0xC0000094L) -#define STATUS_INTEGER_OVERFLOW ((NTSTATUS)0xC0000095L) -#define STATUS_PRIVILEGED_INSTRUCTION ((NTSTATUS)0xC0000096L) -#define STATUS_STACK_OVERFLOW ((NTSTATUS)0xC00000FDL) -#define STATUS_DLL_NOT_FOUND ((NTSTATUS)0xC0000135L) -#define STATUS_ORDINAL_NOT_FOUND ((NTSTATUS)0xC0000138L) -#define STATUS_ENTRYPOINT_NOT_FOUND ((NTSTATUS)0xC0000139L) -#define STATUS_CONTROL_C_EXIT ((NTSTATUS)0xC000013AL) -#define STATUS_DLL_INIT_FAILED ((NTSTATUS)0xC0000142L) -#define STATUS_FLOAT_MULTIPLE_FAULTS ((NTSTATUS)0xC00002B4L) -#define STATUS_FLOAT_MULTIPLE_TRAPS ((NTSTATUS)0xC00002B5L) -#define STATUS_REG_NAT_CONSUMPTION ((NTSTATUS)0xC00002C9L) -#define STATUS_STACK_BUFFER_OVERRUN ((NTSTATUS)0xC0000409L) -#define STATUS_INVALID_CRUNTIME_PARAMETER ((NTSTATUS)0xC0000417L) -#define STATUS_ASSERTION_FAILURE ((NTSTATUS)0xC0000420L) -#define STATUS_SXS_EARLY_DEACTIVATION ((NTSTATUS)0xC015000FL) -#define STATUS_SXS_INVALID_DEACTIVATION ((NTSTATUS)0xC0150010L) +#define STATUS_WAIT_0 ((NTSTATUS)0x00000000L) +#define STATUS_ABANDONED_WAIT_0 ((NTSTATUS)0x00000080L) +#define STATUS_USER_APC ((NTSTATUS)0x000000C0L) +#define STATUS_TIMEOUT ((NTSTATUS)0x00000102L) +#define STATUS_PENDING ((NTSTATUS)0x00000103L) +#define DBG_EXCEPTION_HANDLED ((NTSTATUS)0x00010001L) +#define DBG_CONTINUE ((NTSTATUS)0x00010002L) +#define STATUS_SEGMENT_NOTIFICATION ((NTSTATUS)0x40000005L) +#define STATUS_FATAL_APP_EXIT ((NTSTATUS)0x40000015L) +#define DBG_TERMINATE_THREAD ((NTSTATUS)0x40010003L) +#define DBG_TERMINATE_PROCESS ((NTSTATUS)0x40010004L) +#define DBG_CONTROL_C ((NTSTATUS)0x40010005L) +#define DBG_PRINTEXCEPTION_C ((NTSTATUS)0x40010006L) +#define DBG_RIPEXCEPTION ((NTSTATUS)0x40010007L) +#define DBG_CONTROL_BREAK ((NTSTATUS)0x40010008L) +#define DBG_COMMAND_EXCEPTION ((NTSTATUS)0x40010009L) +#define STATUS_GUARD_PAGE_VIOLATION ((NTSTATUS)0x80000001L) +#define STATUS_DATATYPE_MISALIGNMENT ((NTSTATUS)0x80000002L) +#define STATUS_BREAKPOINT ((NTSTATUS)0x80000003L) +#define STATUS_SINGLE_STEP ((NTSTATUS)0x80000004L) +#define STATUS_LONGJUMP ((NTSTATUS)0x80000026L) +#define STATUS_UNWIND_CONSOLIDATE ((NTSTATUS)0x80000029L) +#define DBG_EXCEPTION_NOT_HANDLED ((NTSTATUS)0x80010001L) +#define STATUS_ACCESS_VIOLATION ((NTSTATUS)0xC0000005L) +#define STATUS_IN_PAGE_ERROR ((NTSTATUS)0xC0000006L) +#define STATUS_INVALID_HANDLE ((NTSTATUS)0xC0000008L) +#define STATUS_INVALID_PARAMETER ((NTSTATUS)0xC000000DL) +#define STATUS_NO_MEMORY ((NTSTATUS)0xC0000017L) +#define STATUS_ILLEGAL_INSTRUCTION ((NTSTATUS)0xC000001DL) +#define STATUS_NONCONTINUABLE_EXCEPTION ((NTSTATUS)0xC0000025L) +#define STATUS_INVALID_DISPOSITION ((NTSTATUS)0xC0000026L) +#define STATUS_ARRAY_BOUNDS_EXCEEDED ((NTSTATUS)0xC000008CL) +#define STATUS_FLOAT_DENORMAL_OPERAND ((NTSTATUS)0xC000008DL) +#define STATUS_FLOAT_DIVIDE_BY_ZERO ((NTSTATUS)0xC000008EL) +#define STATUS_FLOAT_INEXACT_RESULT ((NTSTATUS)0xC000008FL) +#define STATUS_FLOAT_INVALID_OPERATION ((NTSTATUS)0xC0000090L) +#define STATUS_FLOAT_OVERFLOW ((NTSTATUS)0xC0000091L) +#define STATUS_FLOAT_STACK_CHECK ((NTSTATUS)0xC0000092L) +#define STATUS_FLOAT_UNDERFLOW ((NTSTATUS)0xC0000093L) +#define STATUS_INTEGER_DIVIDE_BY_ZERO ((NTSTATUS)0xC0000094L) +#define STATUS_INTEGER_OVERFLOW ((NTSTATUS)0xC0000095L) +#define STATUS_PRIVILEGED_INSTRUCTION ((NTSTATUS)0xC0000096L) +#define STATUS_STACK_OVERFLOW ((NTSTATUS)0xC00000FDL) +#define STATUS_DLL_NOT_FOUND ((NTSTATUS)0xC0000135L) +#define STATUS_ORDINAL_NOT_FOUND ((NTSTATUS)0xC0000138L) +#define STATUS_ENTRYPOINT_NOT_FOUND ((NTSTATUS)0xC0000139L) +#define STATUS_CONTROL_C_EXIT ((NTSTATUS)0xC000013AL) +#define STATUS_DLL_INIT_FAILED ((NTSTATUS)0xC0000142L) +#define STATUS_FLOAT_MULTIPLE_FAULTS ((NTSTATUS)0xC00002B4L) +#define STATUS_FLOAT_MULTIPLE_TRAPS ((NTSTATUS)0xC00002B5L) +#define STATUS_REG_NAT_CONSUMPTION ((NTSTATUS)0xC00002C9L) +#define STATUS_STACK_BUFFER_OVERRUN ((NTSTATUS)0xC0000409L) +#define STATUS_INVALID_CRUNTIME_PARAMETER ((NTSTATUS)0xC0000417L) +#define STATUS_ASSERTION_FAILURE ((NTSTATUS)0xC0000420L) +#define STATUS_SXS_EARLY_DEACTIVATION ((NTSTATUS)0xC015000FL) +#define STATUS_SXS_INVALID_DEACTIVATION ((NTSTATUS)0xC0150010L) #endif @@ -95,337 +95,337 @@ #else -#define STATUS_LOGON_FAILURE ((NTSTATUS)0xC000006DL) -#define STATUS_WRONG_PASSWORD ((NTSTATUS)0xC000006AL) -#define STATUS_PASSWORD_EXPIRED ((NTSTATUS)0xC0000071L) -#define STATUS_PASSWORD_MUST_CHANGE ((NTSTATUS)0xC0000224L) -#define STATUS_ACCESS_DENIED ((NTSTATUS)0xC0000022L) -#define STATUS_DOWNGRADE_DETECTED ((NTSTATUS)0xC0000388L) -#define STATUS_AUTHENTICATION_FIREWALL_FAILED ((NTSTATUS)0xC0000413L) -#define STATUS_ACCOUNT_DISABLED ((NTSTATUS)0xC0000072L) -#define STATUS_ACCOUNT_RESTRICTION ((NTSTATUS)0xC000006EL) -#define STATUS_ACCOUNT_LOCKED_OUT ((NTSTATUS)0xC0000234L) -#define STATUS_ACCOUNT_EXPIRED ((NTSTATUS)0xC0000193L) -#define STATUS_LOGON_TYPE_NOT_GRANTED ((NTSTATUS)0xC000015BL) +#define STATUS_LOGON_FAILURE ((NTSTATUS)0xC000006DL) +#define STATUS_WRONG_PASSWORD ((NTSTATUS)0xC000006AL) +#define STATUS_PASSWORD_EXPIRED ((NTSTATUS)0xC0000071L) +#define STATUS_PASSWORD_MUST_CHANGE ((NTSTATUS)0xC0000224L) +#define STATUS_ACCESS_DENIED ((NTSTATUS)0xC0000022L) +#define STATUS_DOWNGRADE_DETECTED ((NTSTATUS)0xC0000388L) +#define STATUS_AUTHENTICATION_FIREWALL_FAILED ((NTSTATUS)0xC0000413L) +#define STATUS_ACCOUNT_DISABLED ((NTSTATUS)0xC0000072L) +#define STATUS_ACCOUNT_RESTRICTION ((NTSTATUS)0xC000006EL) +#define STATUS_ACCOUNT_LOCKED_OUT ((NTSTATUS)0xC0000234L) +#define STATUS_ACCOUNT_EXPIRED ((NTSTATUS)0xC0000193L) +#define STATUS_LOGON_TYPE_NOT_GRANTED ((NTSTATUS)0xC000015BL) #endif -#define FACILITY_DEBUGGER 0x1 -#define FACILITY_RPC_RUNTIME 0x2 -#define FACILITY_RPC_STUBS 0x3 -#define FACILITY_IO_ERROR_CODE 0x4 -#define FACILITY_TERMINAL_SERVER 0xA -#define FACILITY_USB_ERROR_CODE 0x10 -#define FACILITY_HID_ERROR_CODE 0x11 -#define FACILITY_FIREWIRE_ERROR_CODE 0x12 -#define FACILITY_CLUSTER_ERROR_CODE 0x13 -#define FACILITY_ACPI_ERROR_CODE 0x14 -#define FACILITY_SXS_ERROR_CODE 0x15 +#define FACILITY_DEBUGGER 0x1 +#define FACILITY_RPC_RUNTIME 0x2 +#define FACILITY_RPC_STUBS 0x3 +#define FACILITY_IO_ERROR_CODE 0x4 +#define FACILITY_TERMINAL_SERVER 0xA +#define FACILITY_USB_ERROR_CODE 0x10 +#define FACILITY_HID_ERROR_CODE 0x11 +#define FACILITY_FIREWIRE_ERROR_CODE 0x12 +#define FACILITY_CLUSTER_ERROR_CODE 0x13 +#define FACILITY_ACPI_ERROR_CODE 0x14 +#define FACILITY_SXS_ERROR_CODE 0x15 /** * NTSTATUS codes */ -#if!defined(STATUS_SUCCESS) -#define STATUS_SUCCESS ((NTSTATUS)0x00000000) +#if !defined(STATUS_SUCCESS) +#define STATUS_SUCCESS ((NTSTATUS)0x00000000) #endif -#define STATUS_SEVERITY_SUCCESS 0x0 -#define STATUS_SEVERITY_INFORMATIONAL 0x1 -#define STATUS_SEVERITY_WARNING 0x2 -#define STATUS_SEVERITY_ERROR 0x3 +#define STATUS_SEVERITY_SUCCESS 0x0 +#define STATUS_SEVERITY_INFORMATIONAL 0x1 +#define STATUS_SEVERITY_WARNING 0x2 +#define STATUS_SEVERITY_ERROR 0x3 -#define STATUS_WAIT_1 ((NTSTATUS)0x00000001) -#define STATUS_WAIT_2 ((NTSTATUS)0x00000002) -#define STATUS_WAIT_3 ((NTSTATUS)0x00000003) -#define STATUS_WAIT_63 ((NTSTATUS)0x0000003f) -#define STATUS_ABANDONED ((NTSTATUS)0x00000080) -#define STATUS_ABANDONED_WAIT_63 ((NTSTATUS)0x000000BF) +#define STATUS_WAIT_1 ((NTSTATUS)0x00000001) +#define STATUS_WAIT_2 ((NTSTATUS)0x00000002) +#define STATUS_WAIT_3 ((NTSTATUS)0x00000003) +#define STATUS_WAIT_63 ((NTSTATUS)0x0000003f) +#define STATUS_ABANDONED ((NTSTATUS)0x00000080) +#define STATUS_ABANDONED_WAIT_63 ((NTSTATUS)0x000000BF) //#define STATUS_USER_APC ((NTSTATUS)0x000000C0) -#define STATUS_KERNEL_APC ((NTSTATUS)0x00000100) -#define STATUS_ALERTED ((NTSTATUS)0x00000101) +#define STATUS_KERNEL_APC ((NTSTATUS)0x00000100) +#define STATUS_ALERTED ((NTSTATUS)0x00000101) //#define STATUS_TIMEOUT ((NTSTATUS)0x00000102) //#define STATUS_PENDING ((NTSTATUS)0x00000103) -#define STATUS_REPARSE ((NTSTATUS)0x00000104) -#define STATUS_MORE_ENTRIES ((NTSTATUS)0x00000105) -#define STATUS_NOT_ALL_ASSIGNED ((NTSTATUS)0x00000106) -#define STATUS_SOME_NOT_MAPPED ((NTSTATUS)0x00000107) -#define STATUS_OPLOCK_BREAK_IN_PROGRESS ((NTSTATUS)0x00000108) -#define STATUS_VOLUME_MOUNTED ((NTSTATUS)0x00000109) -#define STATUS_RXACT_COMMITTED ((NTSTATUS)0x0000010A) -#define STATUS_NOTIFY_CLEANUP ((NTSTATUS)0x0000010B) -#define STATUS_NOTIFY_ENUM_DIR ((NTSTATUS)0x0000010C) -#define STATUS_NO_QUOTAS_FOR_ACCOUNT ((NTSTATUS)0x0000010D) -#define STATUS_PRIMARY_TRANSPORT_CONNECT_FAILED ((NTSTATUS)0x0000010E) -#define STATUS_PAGE_FAULT_TRANSITION ((NTSTATUS)0x00000110) -#define STATUS_PAGE_FAULT_DEMAND_ZERO ((NTSTATUS)0x00000111) -#define STATUS_PAGE_FAULT_COPY_ON_WRITE ((NTSTATUS)0x00000112) -#define STATUS_PAGE_FAULT_GUARD_PAGE ((NTSTATUS)0x00000113) -#define STATUS_PAGE_FAULT_PAGING_FILE ((NTSTATUS)0x00000114) -#define STATUS_CACHE_PAGE_LOCKED ((NTSTATUS)0x00000115) -#define STATUS_CRASH_DUMP ((NTSTATUS)0x00000116) -#define STATUS_BUFFER_ALL_ZEROS ((NTSTATUS)0x00000117) -#define STATUS_REPARSE_OBJECT ((NTSTATUS)0x00000118) -#define STATUS_RESOURCE_REQUIREMENTS_CHANGED ((NTSTATUS)0x00000119) -#define STATUS_TRANSLATION_COMPLETE ((NTSTATUS)0x00000120) -#define STATUS_DS_MEMBERSHIP_EVALUATED_LOCALLY ((NTSTATUS)0x00000121) -#define STATUS_NOTHING_TO_TERMINATE ((NTSTATUS)0x00000122) -#define STATUS_PROCESS_NOT_IN_JOB ((NTSTATUS)0x00000123) -#define STATUS_PROCESS_IN_JOB ((NTSTATUS)0x00000124) -#define STATUS_VOLSNAP_HIBERNATE_READY ((NTSTATUS)0x00000125) -#define STATUS_FSFILTER_OP_COMPLETED_SUCCESSFULLY ((NTSTATUS)0x00000126) +#define STATUS_REPARSE ((NTSTATUS)0x00000104) +#define STATUS_MORE_ENTRIES ((NTSTATUS)0x00000105) +#define STATUS_NOT_ALL_ASSIGNED ((NTSTATUS)0x00000106) +#define STATUS_SOME_NOT_MAPPED ((NTSTATUS)0x00000107) +#define STATUS_OPLOCK_BREAK_IN_PROGRESS ((NTSTATUS)0x00000108) +#define STATUS_VOLUME_MOUNTED ((NTSTATUS)0x00000109) +#define STATUS_RXACT_COMMITTED ((NTSTATUS)0x0000010A) +#define STATUS_NOTIFY_CLEANUP ((NTSTATUS)0x0000010B) +#define STATUS_NOTIFY_ENUM_DIR ((NTSTATUS)0x0000010C) +#define STATUS_NO_QUOTAS_FOR_ACCOUNT ((NTSTATUS)0x0000010D) +#define STATUS_PRIMARY_TRANSPORT_CONNECT_FAILED ((NTSTATUS)0x0000010E) +#define STATUS_PAGE_FAULT_TRANSITION ((NTSTATUS)0x00000110) +#define STATUS_PAGE_FAULT_DEMAND_ZERO ((NTSTATUS)0x00000111) +#define STATUS_PAGE_FAULT_COPY_ON_WRITE ((NTSTATUS)0x00000112) +#define STATUS_PAGE_FAULT_GUARD_PAGE ((NTSTATUS)0x00000113) +#define STATUS_PAGE_FAULT_PAGING_FILE ((NTSTATUS)0x00000114) +#define STATUS_CACHE_PAGE_LOCKED ((NTSTATUS)0x00000115) +#define STATUS_CRASH_DUMP ((NTSTATUS)0x00000116) +#define STATUS_BUFFER_ALL_ZEROS ((NTSTATUS)0x00000117) +#define STATUS_REPARSE_OBJECT ((NTSTATUS)0x00000118) +#define STATUS_RESOURCE_REQUIREMENTS_CHANGED ((NTSTATUS)0x00000119) +#define STATUS_TRANSLATION_COMPLETE ((NTSTATUS)0x00000120) +#define STATUS_DS_MEMBERSHIP_EVALUATED_LOCALLY ((NTSTATUS)0x00000121) +#define STATUS_NOTHING_TO_TERMINATE ((NTSTATUS)0x00000122) +#define STATUS_PROCESS_NOT_IN_JOB ((NTSTATUS)0x00000123) +#define STATUS_PROCESS_IN_JOB ((NTSTATUS)0x00000124) +#define STATUS_VOLSNAP_HIBERNATE_READY ((NTSTATUS)0x00000125) +#define STATUS_FSFILTER_OP_COMPLETED_SUCCESSFULLY ((NTSTATUS)0x00000126) -#define STATUS_OBJECT_NAME_EXISTS ((NTSTATUS)0x40000000) -#define STATUS_THREAD_WAS_SUSPENDED ((NTSTATUS)0x40000001) -#define STATUS_WORKING_SET_LIMIT_RANGE ((NTSTATUS)0x40000002) -#define STATUS_IMAGE_NOT_AT_BASE ((NTSTATUS)0x40000003) -#define STATUS_RXACT_STATE_CREATED ((NTSTATUS)0x40000004) +#define STATUS_OBJECT_NAME_EXISTS ((NTSTATUS)0x40000000) +#define STATUS_THREAD_WAS_SUSPENDED ((NTSTATUS)0x40000001) +#define STATUS_WORKING_SET_LIMIT_RANGE ((NTSTATUS)0x40000002) +#define STATUS_IMAGE_NOT_AT_BASE ((NTSTATUS)0x40000003) +#define STATUS_RXACT_STATE_CREATED ((NTSTATUS)0x40000004) //#define STATUS_SEGMENT_NOTIFICATION ((NTSTATUS)0x40000005) -#define STATUS_LOCAL_USER_SESSION_KEY ((NTSTATUS)0x40000006) -#define STATUS_BAD_CURRENT_DIRECTORY ((NTSTATUS)0x40000007) -#define STATUS_SERIAL_MORE_WRITES ((NTSTATUS)0x40000008) -#define STATUS_REGISTRY_RECOVERED ((NTSTATUS)0x40000009) -#define STATUS_FT_READ_RECOVERY_FROM_BACKUP ((NTSTATUS)0x4000000A) -#define STATUS_FT_WRITE_RECOVERY ((NTSTATUS)0x4000000B) -#define STATUS_SERIAL_COUNTER_TIMEOUT ((NTSTATUS)0x4000000C) -#define STATUS_NULL_LM_PASSWORD ((NTSTATUS)0x4000000D) -#define STATUS_IMAGE_MACHINE_TYPE_MISMATCH ((NTSTATUS)0x4000000E) -#define STATUS_RECEIVE_PARTIAL ((NTSTATUS)0x4000000F) -#define STATUS_RECEIVE_EXPEDITED ((NTSTATUS)0x40000010) -#define STATUS_RECEIVE_PARTIAL_EXPEDITED ((NTSTATUS)0x40000011) -#define STATUS_EVENT_DONE ((NTSTATUS)0x40000012) -#define STATUS_EVENT_PENDING ((NTSTATUS)0x40000013) -#define STATUS_CHECKING_FILE_SYSTEM ((NTSTATUS)0x40000014) +#define STATUS_LOCAL_USER_SESSION_KEY ((NTSTATUS)0x40000006) +#define STATUS_BAD_CURRENT_DIRECTORY ((NTSTATUS)0x40000007) +#define STATUS_SERIAL_MORE_WRITES ((NTSTATUS)0x40000008) +#define STATUS_REGISTRY_RECOVERED ((NTSTATUS)0x40000009) +#define STATUS_FT_READ_RECOVERY_FROM_BACKUP ((NTSTATUS)0x4000000A) +#define STATUS_FT_WRITE_RECOVERY ((NTSTATUS)0x4000000B) +#define STATUS_SERIAL_COUNTER_TIMEOUT ((NTSTATUS)0x4000000C) +#define STATUS_NULL_LM_PASSWORD ((NTSTATUS)0x4000000D) +#define STATUS_IMAGE_MACHINE_TYPE_MISMATCH ((NTSTATUS)0x4000000E) +#define STATUS_RECEIVE_PARTIAL ((NTSTATUS)0x4000000F) +#define STATUS_RECEIVE_EXPEDITED ((NTSTATUS)0x40000010) +#define STATUS_RECEIVE_PARTIAL_EXPEDITED ((NTSTATUS)0x40000011) +#define STATUS_EVENT_DONE ((NTSTATUS)0x40000012) +#define STATUS_EVENT_PENDING ((NTSTATUS)0x40000013) +#define STATUS_CHECKING_FILE_SYSTEM ((NTSTATUS)0x40000014) //#define STATUS_FATAL_APP_EXIT ((NTSTATUS)0x40000015) -#define STATUS_PREDEFINED_HANDLE ((NTSTATUS)0x40000016) -#define STATUS_WAS_UNLOCKED ((NTSTATUS)0x40000017) -#define STATUS_SERVICE_NOTIFICATION ((NTSTATUS)0x40000018) -#define STATUS_WAS_LOCKED ((NTSTATUS)0x40000019) -#define STATUS_LOG_HARD_ERROR ((NTSTATUS)0x4000001A) -#define STATUS_ALREADY_WIN32 ((NTSTATUS)0x4000001B) -#define STATUS_WX86_UNSIMULATE ((NTSTATUS)0x4000001C) -#define STATUS_WX86_CONTINUE ((NTSTATUS)0x4000001D) -#define STATUS_WX86_SINGLE_STEP ((NTSTATUS)0x4000001E) -#define STATUS_WX86_BREAKPOINT ((NTSTATUS)0x4000001F) -#define STATUS_WX86_EXCEPTION_CONTINUE ((NTSTATUS)0x40000020) -#define STATUS_WX86_EXCEPTION_LASTCHANCE ((NTSTATUS)0x40000021) -#define STATUS_WX86_EXCEPTION_CHAIN ((NTSTATUS)0x40000022) -#define STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE ((NTSTATUS)0x40000023) -#define STATUS_NO_YIELD_PERFORMED ((NTSTATUS)0x40000024) -#define STATUS_TIMER_RESUME_IGNORED ((NTSTATUS)0x40000025) -#define STATUS_ARBITRATION_UNHANDLED ((NTSTATUS)0x40000026) -#define STATUS_CARDBUS_NOT_SUPPORTED ((NTSTATUS)0x40000027) -#define STATUS_WX86_CREATEWX86TIB ((NTSTATUS)0x40000028) -#define STATUS_MP_PROCESSOR_MISMATCH ((NTSTATUS)0x40000029) -#define STATUS_HIBERNATED ((NTSTATUS)0x4000002A) -#define STATUS_RESUME_HIBERNATION ((NTSTATUS)0x4000002B) -#define STATUS_FIRMWARE_UPDATED ((NTSTATUS)0x4000002C) -#define STATUS_WAKE_SYSTEM ((NTSTATUS)0x40000294) -#define STATUS_DS_SHUTTING_DOWN ((NTSTATUS)0x40000370) +#define STATUS_PREDEFINED_HANDLE ((NTSTATUS)0x40000016) +#define STATUS_WAS_UNLOCKED ((NTSTATUS)0x40000017) +#define STATUS_SERVICE_NOTIFICATION ((NTSTATUS)0x40000018) +#define STATUS_WAS_LOCKED ((NTSTATUS)0x40000019) +#define STATUS_LOG_HARD_ERROR ((NTSTATUS)0x4000001A) +#define STATUS_ALREADY_WIN32 ((NTSTATUS)0x4000001B) +#define STATUS_WX86_UNSIMULATE ((NTSTATUS)0x4000001C) +#define STATUS_WX86_CONTINUE ((NTSTATUS)0x4000001D) +#define STATUS_WX86_SINGLE_STEP ((NTSTATUS)0x4000001E) +#define STATUS_WX86_BREAKPOINT ((NTSTATUS)0x4000001F) +#define STATUS_WX86_EXCEPTION_CONTINUE ((NTSTATUS)0x40000020) +#define STATUS_WX86_EXCEPTION_LASTCHANCE ((NTSTATUS)0x40000021) +#define STATUS_WX86_EXCEPTION_CHAIN ((NTSTATUS)0x40000022) +#define STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE ((NTSTATUS)0x40000023) +#define STATUS_NO_YIELD_PERFORMED ((NTSTATUS)0x40000024) +#define STATUS_TIMER_RESUME_IGNORED ((NTSTATUS)0x40000025) +#define STATUS_ARBITRATION_UNHANDLED ((NTSTATUS)0x40000026) +#define STATUS_CARDBUS_NOT_SUPPORTED ((NTSTATUS)0x40000027) +#define STATUS_WX86_CREATEWX86TIB ((NTSTATUS)0x40000028) +#define STATUS_MP_PROCESSOR_MISMATCH ((NTSTATUS)0x40000029) +#define STATUS_HIBERNATED ((NTSTATUS)0x4000002A) +#define STATUS_RESUME_HIBERNATION ((NTSTATUS)0x4000002B) +#define STATUS_FIRMWARE_UPDATED ((NTSTATUS)0x4000002C) +#define STATUS_WAKE_SYSTEM ((NTSTATUS)0x40000294) +#define STATUS_DS_SHUTTING_DOWN ((NTSTATUS)0x40000370) -#define RPC_NT_UUID_LOCAL_ONLY ((NTSTATUS)0x40020056) -#define RPC_NT_SEND_INCOMPLETE ((NTSTATUS)0x400200AF) +#define RPC_NT_UUID_LOCAL_ONLY ((NTSTATUS)0x40020056) +#define RPC_NT_SEND_INCOMPLETE ((NTSTATUS)0x400200AF) -#define STATUS_CTX_CDM_CONNECT ((NTSTATUS)0x400A0004) -#define STATUS_CTX_CDM_DISCONNECT ((NTSTATUS)0x400A0005) +#define STATUS_CTX_CDM_CONNECT ((NTSTATUS)0x400A0004) +#define STATUS_CTX_CDM_DISCONNECT ((NTSTATUS)0x400A0005) -#define STATUS_SXS_RELEASE_ACTIVATION_CONTEXT ((NTSTATUS)0x4015000D) +#define STATUS_SXS_RELEASE_ACTIVATION_CONTEXT ((NTSTATUS)0x4015000D) //#define STATUS_GUARD_PAGE_VIOLATION ((NTSTATUS)0x80000001) //#define STATUS_DATATYPE_MISALIGNMENT ((NTSTATUS)0x80000002) //#define STATUS_BREAKPOINT ((NTSTATUS)0x80000003) //#define STATUS_SINGLE_STEP ((NTSTATUS)0x80000004) -#define STATUS_BUFFER_OVERFLOW ((NTSTATUS)0x80000005) -#define STATUS_NO_MORE_FILES ((NTSTATUS)0x80000006) -#define STATUS_WAKE_SYSTEM_DEBUGGER ((NTSTATUS)0x80000007) +#define STATUS_BUFFER_OVERFLOW ((NTSTATUS)0x80000005) +#define STATUS_NO_MORE_FILES ((NTSTATUS)0x80000006) +#define STATUS_WAKE_SYSTEM_DEBUGGER ((NTSTATUS)0x80000007) -#define STATUS_HANDLES_CLOSED ((NTSTATUS)0x8000000A) -#define STATUS_NO_INHERITANCE ((NTSTATUS)0x8000000B) -#define STATUS_GUID_SUBSTITUTION_MADE ((NTSTATUS)0x8000000C) -#define STATUS_PARTIAL_COPY ((NTSTATUS)0x8000000D) -#define STATUS_DEVICE_PAPER_EMPTY ((NTSTATUS)0x8000000E) -#define STATUS_DEVICE_POWERED_OFF ((NTSTATUS)0x8000000F) -#define STATUS_DEVICE_OFF_LINE ((NTSTATUS)0x80000010) -#define STATUS_DEVICE_BUSY ((NTSTATUS)0x80000011) -#define STATUS_NO_MORE_EAS ((NTSTATUS)0x80000012) -#define STATUS_INVALID_EA_NAME ((NTSTATUS)0x80000013) -#define STATUS_EA_LIST_INCONSISTENT ((NTSTATUS)0x80000014) -#define STATUS_INVALID_EA_FLAG ((NTSTATUS)0x80000015) -#define STATUS_VERIFY_REQUIRED ((NTSTATUS)0x80000016) -#define STATUS_EXTRANEOUS_INFORMATION ((NTSTATUS)0x80000017) -#define STATUS_RXACT_COMMIT_NECESSARY ((NTSTATUS)0x80000018) -#define STATUS_NO_MORE_ENTRIES ((NTSTATUS)0x8000001A) -#define STATUS_FILEMARK_DETECTED ((NTSTATUS)0x8000001B) -#define STATUS_MEDIA_CHANGED ((NTSTATUS)0x8000001C) -#define STATUS_BUS_RESET ((NTSTATUS)0x8000001D) -#define STATUS_END_OF_MEDIA ((NTSTATUS)0x8000001E) -#define STATUS_BEGINNING_OF_MEDIA ((NTSTATUS)0x8000001F) -#define STATUS_MEDIA_CHECK ((NTSTATUS)0x80000020) -#define STATUS_SETMARK_DETECTED ((NTSTATUS)0x80000021) -#define STATUS_NO_DATA_DETECTED ((NTSTATUS)0x80000022) -#define STATUS_REDIRECTOR_HAS_OPEN_HANDLES ((NTSTATUS)0x80000023) -#define STATUS_SERVER_HAS_OPEN_HANDLES ((NTSTATUS)0x80000024) -#define STATUS_ALREADY_DISCONNECTED ((NTSTATUS)0x80000025) +#define STATUS_HANDLES_CLOSED ((NTSTATUS)0x8000000A) +#define STATUS_NO_INHERITANCE ((NTSTATUS)0x8000000B) +#define STATUS_GUID_SUBSTITUTION_MADE ((NTSTATUS)0x8000000C) +#define STATUS_PARTIAL_COPY ((NTSTATUS)0x8000000D) +#define STATUS_DEVICE_PAPER_EMPTY ((NTSTATUS)0x8000000E) +#define STATUS_DEVICE_POWERED_OFF ((NTSTATUS)0x8000000F) +#define STATUS_DEVICE_OFF_LINE ((NTSTATUS)0x80000010) +#define STATUS_DEVICE_BUSY ((NTSTATUS)0x80000011) +#define STATUS_NO_MORE_EAS ((NTSTATUS)0x80000012) +#define STATUS_INVALID_EA_NAME ((NTSTATUS)0x80000013) +#define STATUS_EA_LIST_INCONSISTENT ((NTSTATUS)0x80000014) +#define STATUS_INVALID_EA_FLAG ((NTSTATUS)0x80000015) +#define STATUS_VERIFY_REQUIRED ((NTSTATUS)0x80000016) +#define STATUS_EXTRANEOUS_INFORMATION ((NTSTATUS)0x80000017) +#define STATUS_RXACT_COMMIT_NECESSARY ((NTSTATUS)0x80000018) +#define STATUS_NO_MORE_ENTRIES ((NTSTATUS)0x8000001A) +#define STATUS_FILEMARK_DETECTED ((NTSTATUS)0x8000001B) +#define STATUS_MEDIA_CHANGED ((NTSTATUS)0x8000001C) +#define STATUS_BUS_RESET ((NTSTATUS)0x8000001D) +#define STATUS_END_OF_MEDIA ((NTSTATUS)0x8000001E) +#define STATUS_BEGINNING_OF_MEDIA ((NTSTATUS)0x8000001F) +#define STATUS_MEDIA_CHECK ((NTSTATUS)0x80000020) +#define STATUS_SETMARK_DETECTED ((NTSTATUS)0x80000021) +#define STATUS_NO_DATA_DETECTED ((NTSTATUS)0x80000022) +#define STATUS_REDIRECTOR_HAS_OPEN_HANDLES ((NTSTATUS)0x80000023) +#define STATUS_SERVER_HAS_OPEN_HANDLES ((NTSTATUS)0x80000024) +#define STATUS_ALREADY_DISCONNECTED ((NTSTATUS)0x80000025) //#define STATUS_LONGJUMP ((NTSTATUS)0x80000026) -#define STATUS_CLEANER_CARTRIDGE_INSTALLED ((NTSTATUS)0x80000027) -#define STATUS_PLUGPLAY_QUERY_VETOED ((NTSTATUS)0x80000028) +#define STATUS_CLEANER_CARTRIDGE_INSTALLED ((NTSTATUS)0x80000027) +#define STATUS_PLUGPLAY_QUERY_VETOED ((NTSTATUS)0x80000028) //#define STATUS_UNWIND_CONSOLIDATE ((NTSTATUS)0x80000029) -#define STATUS_REGISTRY_HIVE_RECOVERED ((NTSTATUS)0x8000002A) -#define STATUS_DLL_MIGHT_BE_INSECURE ((NTSTATUS)0x8000002B) -#define STATUS_DLL_MIGHT_BE_INCOMPATIBLE ((NTSTATUS)0x8000002C) +#define STATUS_REGISTRY_HIVE_RECOVERED ((NTSTATUS)0x8000002A) +#define STATUS_DLL_MIGHT_BE_INSECURE ((NTSTATUS)0x8000002B) +#define STATUS_DLL_MIGHT_BE_INCOMPATIBLE ((NTSTATUS)0x8000002C) -#define STATUS_DEVICE_REQUIRES_CLEANING ((NTSTATUS)0x80000288) -#define STATUS_DEVICE_DOOR_OPEN ((NTSTATUS)0x80000289) +#define STATUS_DEVICE_REQUIRES_CLEANING ((NTSTATUS)0x80000288) +#define STATUS_DEVICE_DOOR_OPEN ((NTSTATUS)0x80000289) -#define STATUS_CLUSTER_NODE_ALREADY_UP ((NTSTATUS)0x80130001) -#define STATUS_CLUSTER_NODE_ALREADY_DOWN ((NTSTATUS)0x80130002) -#define STATUS_CLUSTER_NETWORK_ALREADY_ONLINE ((NTSTATUS)0x80130003) -#define STATUS_CLUSTER_NETWORK_ALREADY_OFFLINE ((NTSTATUS)0x80130004) -#define STATUS_CLUSTER_NODE_ALREADY_MEMBER ((NTSTATUS)0x80130005) +#define STATUS_CLUSTER_NODE_ALREADY_UP ((NTSTATUS)0x80130001) +#define STATUS_CLUSTER_NODE_ALREADY_DOWN ((NTSTATUS)0x80130002) +#define STATUS_CLUSTER_NETWORK_ALREADY_ONLINE ((NTSTATUS)0x80130003) +#define STATUS_CLUSTER_NETWORK_ALREADY_OFFLINE ((NTSTATUS)0x80130004) +#define STATUS_CLUSTER_NODE_ALREADY_MEMBER ((NTSTATUS)0x80130005) //#define STATUS_WAIT_0 ((NTSTATUS)0x00000000) -#define STATUS_UNSUCCESSFUL ((NTSTATUS)0xC0000001) -#define STATUS_NOT_IMPLEMENTED ((NTSTATUS)0xC0000002) -#define STATUS_INVALID_INFO_CLASS ((NTSTATUS)0xC0000003) -#define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004) +#define STATUS_UNSUCCESSFUL ((NTSTATUS)0xC0000001) +#define STATUS_NOT_IMPLEMENTED ((NTSTATUS)0xC0000002) +#define STATUS_INVALID_INFO_CLASS ((NTSTATUS)0xC0000003) +#define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004) //#define STATUS_ACCESS_VIOLATION ((NTSTATUS)0xC0000005) //#define STATUS_IN_PAGE_ERROR ((NTSTATUS)0xC0000006) -#define STATUS_PAGEFILE_QUOTA ((NTSTATUS)0xC0000007) +#define STATUS_PAGEFILE_QUOTA ((NTSTATUS)0xC0000007) //#define STATUS_INVALID_HANDLE ((NTSTATUS)0xC0000008) -#define STATUS_BAD_INITIAL_STACK ((NTSTATUS)0xC0000009) -#define STATUS_BAD_INITIAL_PC ((NTSTATUS)0xC000000A) -#define STATUS_INVALID_CID ((NTSTATUS)0xC000000B) -#define STATUS_TIMER_NOT_CANCELED ((NTSTATUS)0xC000000C) +#define STATUS_BAD_INITIAL_STACK ((NTSTATUS)0xC0000009) +#define STATUS_BAD_INITIAL_PC ((NTSTATUS)0xC000000A) +#define STATUS_INVALID_CID ((NTSTATUS)0xC000000B) +#define STATUS_TIMER_NOT_CANCELED ((NTSTATUS)0xC000000C) //#define STATUS_INVALID_PARAMETER ((NTSTATUS)0xC000000D) -#define STATUS_NO_SUCH_DEVICE ((NTSTATUS)0xC000000E) -#define STATUS_NO_SUCH_FILE ((NTSTATUS)0xC000000F) -#define STATUS_INVALID_DEVICE_REQUEST ((NTSTATUS)0xC0000010) -#define STATUS_END_OF_FILE ((NTSTATUS)0xC0000011) -#define STATUS_WRONG_VOLUME ((NTSTATUS)0xC0000012) -#define STATUS_NO_MEDIA_IN_DEVICE ((NTSTATUS)0xC0000013) -#define STATUS_UNRECOGNIZED_MEDIA ((NTSTATUS)0xC0000014) -#define STATUS_NONEXISTENT_SECTOR ((NTSTATUS)0xC0000015) -#define STATUS_MORE_PROCESSING_REQUIRED ((NTSTATUS)0xC0000016) +#define STATUS_NO_SUCH_DEVICE ((NTSTATUS)0xC000000E) +#define STATUS_NO_SUCH_FILE ((NTSTATUS)0xC000000F) +#define STATUS_INVALID_DEVICE_REQUEST ((NTSTATUS)0xC0000010) +#define STATUS_END_OF_FILE ((NTSTATUS)0xC0000011) +#define STATUS_WRONG_VOLUME ((NTSTATUS)0xC0000012) +#define STATUS_NO_MEDIA_IN_DEVICE ((NTSTATUS)0xC0000013) +#define STATUS_UNRECOGNIZED_MEDIA ((NTSTATUS)0xC0000014) +#define STATUS_NONEXISTENT_SECTOR ((NTSTATUS)0xC0000015) +#define STATUS_MORE_PROCESSING_REQUIRED ((NTSTATUS)0xC0000016) //#define STATUS_NO_MEMORY ((NTSTATUS)0xC0000017) -#define STATUS_CONFLICTING_ADDRESSES ((NTSTATUS)0xC0000018) -#define STATUS_NOT_MAPPED_VIEW ((NTSTATUS)0xC0000019) -#define STATUS_UNABLE_TO_FREE_VM ((NTSTATUS)0xC000001A) -#define STATUS_UNABLE_TO_DELETE_SECTION ((NTSTATUS)0xC000001B) -#define STATUS_INVALID_SYSTEM_SERVICE ((NTSTATUS)0xC000001C) +#define STATUS_CONFLICTING_ADDRESSES ((NTSTATUS)0xC0000018) +#define STATUS_NOT_MAPPED_VIEW ((NTSTATUS)0xC0000019) +#define STATUS_UNABLE_TO_FREE_VM ((NTSTATUS)0xC000001A) +#define STATUS_UNABLE_TO_DELETE_SECTION ((NTSTATUS)0xC000001B) +#define STATUS_INVALID_SYSTEM_SERVICE ((NTSTATUS)0xC000001C) //#define STATUS_ILLEGAL_INSTRUCTION ((NTSTATUS)0xC000001D) -#define STATUS_INVALID_LOCK_SEQUENCE ((NTSTATUS)0xC000001E) -#define STATUS_INVALID_VIEW_SIZE ((NTSTATUS)0xC000001F) -#define STATUS_INVALID_FILE_FOR_SECTION ((NTSTATUS)0xC0000020) -#define STATUS_ALREADY_COMMITTED ((NTSTATUS)0xC0000021) +#define STATUS_INVALID_LOCK_SEQUENCE ((NTSTATUS)0xC000001E) +#define STATUS_INVALID_VIEW_SIZE ((NTSTATUS)0xC000001F) +#define STATUS_INVALID_FILE_FOR_SECTION ((NTSTATUS)0xC0000020) +#define STATUS_ALREADY_COMMITTED ((NTSTATUS)0xC0000021) //#define STATUS_ACCESS_DENIED ((NTSTATUS)0xC0000022) -#define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023) -#define STATUS_OBJECT_TYPE_MISMATCH ((NTSTATUS)0xC0000024) +#define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023) +#define STATUS_OBJECT_TYPE_MISMATCH ((NTSTATUS)0xC0000024) //#define STATUS_NONCONTINUABLE_EXCEPTION ((NTSTATUS)0xC0000025) //#define STATUS_INVALID_DISPOSITION ((NTSTATUS)0xC0000026) -#define STATUS_UNWIND ((NTSTATUS)0xC0000027) -#define STATUS_BAD_STACK ((NTSTATUS)0xC0000028) -#define STATUS_INVALID_UNWIND_TARGET ((NTSTATUS)0xC0000029) -#define STATUS_NOT_LOCKED ((NTSTATUS)0xC000002A) -#define STATUS_PARITY_ERROR ((NTSTATUS)0xC000002B) -#define STATUS_UNABLE_TO_DECOMMIT_VM ((NTSTATUS)0xC000002C) -#define STATUS_NOT_COMMITTED ((NTSTATUS)0xC000002D) -#define STATUS_INVALID_PORT_ATTRIBUTES ((NTSTATUS)0xC000002E) -#define STATUS_PORT_MESSAGE_TOO_LONG ((NTSTATUS)0xC000002F) -#define STATUS_INVALID_PARAMETER_MIX ((NTSTATUS)0xC0000030) -#define STATUS_INVALID_QUOTA_LOWER ((NTSTATUS)0xC0000031) -#define STATUS_DISK_CORRUPT_ERROR ((NTSTATUS)0xC0000032) -#define STATUS_OBJECT_NAME_INVALID ((NTSTATUS)0xC0000033) -#define STATUS_OBJECT_NAME_NOT_FOUND ((NTSTATUS)0xC0000034) -#define STATUS_OBJECT_NAME_COLLISION ((NTSTATUS)0xC0000035) -#define STATUS_PORT_DISCONNECTED ((NTSTATUS)0xC0000037) -#define STATUS_DEVICE_ALREADY_ATTACHED ((NTSTATUS)0xC0000038) -#define STATUS_OBJECT_PATH_INVALID ((NTSTATUS)0xC0000039) -#define STATUS_OBJECT_PATH_NOT_FOUND ((NTSTATUS)0xC000003A) -#define STATUS_OBJECT_PATH_SYNTAX_BAD ((NTSTATUS)0xC000003B) -#define STATUS_DATA_OVERRUN ((NTSTATUS)0xC000003C) -#define STATUS_DATA_LATE_ERROR ((NTSTATUS)0xC000003D) -#define STATUS_DATA_ERROR ((NTSTATUS)0xC000003E) -#define STATUS_CRC_ERROR ((NTSTATUS)0xC000003F) -#define STATUS_SECTION_TOO_BIG ((NTSTATUS)0xC0000040) -#define STATUS_PORT_CONNECTION_REFUSED ((NTSTATUS)0xC0000041) -#define STATUS_INVALID_PORT_HANDLE ((NTSTATUS)0xC0000042) -#define STATUS_SHARING_VIOLATION ((NTSTATUS)0xC0000043) -#define STATUS_QUOTA_EXCEEDED ((NTSTATUS)0xC0000044) -#define STATUS_INVALID_PAGE_PROTECTION ((NTSTATUS)0xC0000045) -#define STATUS_MUTANT_NOT_OWNED ((NTSTATUS)0xC0000046) -#define STATUS_SEMAPHORE_LIMIT_EXCEEDED ((NTSTATUS)0xC0000047) -#define STATUS_PORT_ALREADY_SET ((NTSTATUS)0xC0000048) -#define STATUS_SECTION_NOT_IMAGE ((NTSTATUS)0xC0000049) -#define STATUS_SUSPEND_COUNT_EXCEEDED ((NTSTATUS)0xC000004A) -#define STATUS_THREAD_IS_TERMINATING ((NTSTATUS)0xC000004B) -#define STATUS_BAD_WORKING_SET_LIMIT ((NTSTATUS)0xC000004C) -#define STATUS_INCOMPATIBLE_FILE_MAP ((NTSTATUS)0xC000004D) -#define STATUS_SECTION_PROTECTION ((NTSTATUS)0xC000004E) -#define STATUS_EAS_NOT_SUPPORTED ((NTSTATUS)0xC000004F) -#define STATUS_EA_TOO_LARGE ((NTSTATUS)0xC0000050) -#define STATUS_NONEXISTENT_EA_ENTRY ((NTSTATUS)0xC0000051) -#define STATUS_NO_EAS_ON_FILE ((NTSTATUS)0xC0000052) -#define STATUS_EA_CORRUPT_ERROR ((NTSTATUS)0xC0000053) -#define STATUS_FILE_LOCK_CONFLICT ((NTSTATUS)0xC0000054) -#define STATUS_LOCK_NOT_GRANTED ((NTSTATUS)0xC0000055) -#define STATUS_DELETE_PENDING ((NTSTATUS)0xC0000056) -#define STATUS_CTL_FILE_NOT_SUPPORTED ((NTSTATUS)0xC0000057) -#define STATUS_UNKNOWN_REVISION ((NTSTATUS)0xC0000058) -#define STATUS_REVISION_MISMATCH ((NTSTATUS)0xC0000059) -#define STATUS_INVALID_OWNER ((NTSTATUS)0xC000005A) -#define STATUS_INVALID_PRIMARY_GROUP ((NTSTATUS)0xC000005B) -#define STATUS_NO_IMPERSONATION_TOKEN ((NTSTATUS)0xC000005C) -#define STATUS_CANT_DISABLE_MANDATORY ((NTSTATUS)0xC000005D) -#define STATUS_NO_LOGON_SERVERS ((NTSTATUS)0xC000005E) +#define STATUS_UNWIND ((NTSTATUS)0xC0000027) +#define STATUS_BAD_STACK ((NTSTATUS)0xC0000028) +#define STATUS_INVALID_UNWIND_TARGET ((NTSTATUS)0xC0000029) +#define STATUS_NOT_LOCKED ((NTSTATUS)0xC000002A) +#define STATUS_PARITY_ERROR ((NTSTATUS)0xC000002B) +#define STATUS_UNABLE_TO_DECOMMIT_VM ((NTSTATUS)0xC000002C) +#define STATUS_NOT_COMMITTED ((NTSTATUS)0xC000002D) +#define STATUS_INVALID_PORT_ATTRIBUTES ((NTSTATUS)0xC000002E) +#define STATUS_PORT_MESSAGE_TOO_LONG ((NTSTATUS)0xC000002F) +#define STATUS_INVALID_PARAMETER_MIX ((NTSTATUS)0xC0000030) +#define STATUS_INVALID_QUOTA_LOWER ((NTSTATUS)0xC0000031) +#define STATUS_DISK_CORRUPT_ERROR ((NTSTATUS)0xC0000032) +#define STATUS_OBJECT_NAME_INVALID ((NTSTATUS)0xC0000033) +#define STATUS_OBJECT_NAME_NOT_FOUND ((NTSTATUS)0xC0000034) +#define STATUS_OBJECT_NAME_COLLISION ((NTSTATUS)0xC0000035) +#define STATUS_PORT_DISCONNECTED ((NTSTATUS)0xC0000037) +#define STATUS_DEVICE_ALREADY_ATTACHED ((NTSTATUS)0xC0000038) +#define STATUS_OBJECT_PATH_INVALID ((NTSTATUS)0xC0000039) +#define STATUS_OBJECT_PATH_NOT_FOUND ((NTSTATUS)0xC000003A) +#define STATUS_OBJECT_PATH_SYNTAX_BAD ((NTSTATUS)0xC000003B) +#define STATUS_DATA_OVERRUN ((NTSTATUS)0xC000003C) +#define STATUS_DATA_LATE_ERROR ((NTSTATUS)0xC000003D) +#define STATUS_DATA_ERROR ((NTSTATUS)0xC000003E) +#define STATUS_CRC_ERROR ((NTSTATUS)0xC000003F) +#define STATUS_SECTION_TOO_BIG ((NTSTATUS)0xC0000040) +#define STATUS_PORT_CONNECTION_REFUSED ((NTSTATUS)0xC0000041) +#define STATUS_INVALID_PORT_HANDLE ((NTSTATUS)0xC0000042) +#define STATUS_SHARING_VIOLATION ((NTSTATUS)0xC0000043) +#define STATUS_QUOTA_EXCEEDED ((NTSTATUS)0xC0000044) +#define STATUS_INVALID_PAGE_PROTECTION ((NTSTATUS)0xC0000045) +#define STATUS_MUTANT_NOT_OWNED ((NTSTATUS)0xC0000046) +#define STATUS_SEMAPHORE_LIMIT_EXCEEDED ((NTSTATUS)0xC0000047) +#define STATUS_PORT_ALREADY_SET ((NTSTATUS)0xC0000048) +#define STATUS_SECTION_NOT_IMAGE ((NTSTATUS)0xC0000049) +#define STATUS_SUSPEND_COUNT_EXCEEDED ((NTSTATUS)0xC000004A) +#define STATUS_THREAD_IS_TERMINATING ((NTSTATUS)0xC000004B) +#define STATUS_BAD_WORKING_SET_LIMIT ((NTSTATUS)0xC000004C) +#define STATUS_INCOMPATIBLE_FILE_MAP ((NTSTATUS)0xC000004D) +#define STATUS_SECTION_PROTECTION ((NTSTATUS)0xC000004E) +#define STATUS_EAS_NOT_SUPPORTED ((NTSTATUS)0xC000004F) +#define STATUS_EA_TOO_LARGE ((NTSTATUS)0xC0000050) +#define STATUS_NONEXISTENT_EA_ENTRY ((NTSTATUS)0xC0000051) +#define STATUS_NO_EAS_ON_FILE ((NTSTATUS)0xC0000052) +#define STATUS_EA_CORRUPT_ERROR ((NTSTATUS)0xC0000053) +#define STATUS_FILE_LOCK_CONFLICT ((NTSTATUS)0xC0000054) +#define STATUS_LOCK_NOT_GRANTED ((NTSTATUS)0xC0000055) +#define STATUS_DELETE_PENDING ((NTSTATUS)0xC0000056) +#define STATUS_CTL_FILE_NOT_SUPPORTED ((NTSTATUS)0xC0000057) +#define STATUS_UNKNOWN_REVISION ((NTSTATUS)0xC0000058) +#define STATUS_REVISION_MISMATCH ((NTSTATUS)0xC0000059) +#define STATUS_INVALID_OWNER ((NTSTATUS)0xC000005A) +#define STATUS_INVALID_PRIMARY_GROUP ((NTSTATUS)0xC000005B) +#define STATUS_NO_IMPERSONATION_TOKEN ((NTSTATUS)0xC000005C) +#define STATUS_CANT_DISABLE_MANDATORY ((NTSTATUS)0xC000005D) +#define STATUS_NO_LOGON_SERVERS ((NTSTATUS)0xC000005E) #ifndef STATUS_NO_SUCH_LOGON_SESSION -#define STATUS_NO_SUCH_LOGON_SESSION ((NTSTATUS)0xC000005F) +#define STATUS_NO_SUCH_LOGON_SESSION ((NTSTATUS)0xC000005F) #endif -#define STATUS_NO_SUCH_PRIVILEGE ((NTSTATUS)0xC0000060) -#define STATUS_PRIVILEGE_NOT_HELD ((NTSTATUS)0xC0000061) -#define STATUS_INVALID_ACCOUNT_NAME ((NTSTATUS)0xC0000062) -#define STATUS_USER_EXISTS ((NTSTATUS)0xC0000063) +#define STATUS_NO_SUCH_PRIVILEGE ((NTSTATUS)0xC0000060) +#define STATUS_PRIVILEGE_NOT_HELD ((NTSTATUS)0xC0000061) +#define STATUS_INVALID_ACCOUNT_NAME ((NTSTATUS)0xC0000062) +#define STATUS_USER_EXISTS ((NTSTATUS)0xC0000063) #ifndef STATUS_NO_SUCH_USER -#define STATUS_NO_SUCH_USER ((NTSTATUS)0xC0000064) +#define STATUS_NO_SUCH_USER ((NTSTATUS)0xC0000064) #endif -#define STATUS_GROUP_EXISTS ((NTSTATUS)0xC0000065) -#define STATUS_NO_SUCH_GROUP ((NTSTATUS)0xC0000066) -#define STATUS_MEMBER_IN_GROUP ((NTSTATUS)0xC0000067) -#define STATUS_MEMBER_NOT_IN_GROUP ((NTSTATUS)0xC0000068) -#define STATUS_LAST_ADMIN ((NTSTATUS)0xC0000069) +#define STATUS_GROUP_EXISTS ((NTSTATUS)0xC0000065) +#define STATUS_NO_SUCH_GROUP ((NTSTATUS)0xC0000066) +#define STATUS_MEMBER_IN_GROUP ((NTSTATUS)0xC0000067) +#define STATUS_MEMBER_NOT_IN_GROUP ((NTSTATUS)0xC0000068) +#define STATUS_LAST_ADMIN ((NTSTATUS)0xC0000069) //#define STATUS_WRONG_PASSWORD ((NTSTATUS)0xC000006A) -#define STATUS_ILL_FORMED_PASSWORD ((NTSTATUS)0xC000006B) -#define STATUS_PASSWORD_RESTRICTION ((NTSTATUS)0xC000006C) +#define STATUS_ILL_FORMED_PASSWORD ((NTSTATUS)0xC000006B) +#define STATUS_PASSWORD_RESTRICTION ((NTSTATUS)0xC000006C) //#define STATUS_LOGON_FAILURE ((NTSTATUS)0xC000006D) //#define STATUS_ACCOUNT_RESTRICTION ((NTSTATUS)0xC000006E) -#define STATUS_INVALID_LOGON_HOURS ((NTSTATUS)0xC000006F) -#define STATUS_INVALID_WORKSTATION ((NTSTATUS)0xC0000070) +#define STATUS_INVALID_LOGON_HOURS ((NTSTATUS)0xC000006F) +#define STATUS_INVALID_WORKSTATION ((NTSTATUS)0xC0000070) //#define STATUS_PASSWORD_EXPIRED ((NTSTATUS)0xC0000071) //#define STATUS_ACCOUNT_DISABLED ((NTSTATUS)0xC0000072) -#define STATUS_NONE_MAPPED ((NTSTATUS)0xC0000073) -#define STATUS_TOO_MANY_LUIDS_REQUESTED ((NTSTATUS)0xC0000074) -#define STATUS_LUIDS_EXHAUSTED ((NTSTATUS)0xC0000075) -#define STATUS_INVALID_SUB_AUTHORITY ((NTSTATUS)0xC0000076) -#define STATUS_INVALID_ACL ((NTSTATUS)0xC0000077) -#define STATUS_INVALID_SID ((NTSTATUS)0xC0000078) -#define STATUS_INVALID_SECURITY_DESCR ((NTSTATUS)0xC0000079) -#define STATUS_PROCEDURE_NOT_FOUND ((NTSTATUS)0xC000007A) -#define STATUS_INVALID_IMAGE_FORMAT ((NTSTATUS)0xC000007B) -#define STATUS_NO_TOKEN ((NTSTATUS)0xC000007C) -#define STATUS_BAD_INHERITANCE_ACL ((NTSTATUS)0xC000007D) -#define STATUS_RANGE_NOT_LOCKED ((NTSTATUS)0xC000007E) -#define STATUS_DISK_FULL ((NTSTATUS)0xC000007F) -#define STATUS_SERVER_DISABLED ((NTSTATUS)0xC0000080) -#define STATUS_SERVER_NOT_DISABLED ((NTSTATUS)0xC0000081) -#define STATUS_TOO_MANY_GUIDS_REQUESTED ((NTSTATUS)0xC0000082) -#define STATUS_GUIDS_EXHAUSTED ((NTSTATUS)0xC0000083) -#define STATUS_INVALID_ID_AUTHORITY ((NTSTATUS)0xC0000084) -#define STATUS_AGENTS_EXHAUSTED ((NTSTATUS)0xC0000085) -#define STATUS_INVALID_VOLUME_LABEL ((NTSTATUS)0xC0000086) -#define STATUS_SECTION_NOT_EXTENDED ((NTSTATUS)0xC0000087) -#define STATUS_NOT_MAPPED_DATA ((NTSTATUS)0xC0000088) -#define STATUS_RESOURCE_DATA_NOT_FOUND ((NTSTATUS)0xC0000089) -#define STATUS_RESOURCE_TYPE_NOT_FOUND ((NTSTATUS)0xC000008A) -#define STATUS_RESOURCE_NAME_NOT_FOUND ((NTSTATUS)0xC000008B) +#define STATUS_NONE_MAPPED ((NTSTATUS)0xC0000073) +#define STATUS_TOO_MANY_LUIDS_REQUESTED ((NTSTATUS)0xC0000074) +#define STATUS_LUIDS_EXHAUSTED ((NTSTATUS)0xC0000075) +#define STATUS_INVALID_SUB_AUTHORITY ((NTSTATUS)0xC0000076) +#define STATUS_INVALID_ACL ((NTSTATUS)0xC0000077) +#define STATUS_INVALID_SID ((NTSTATUS)0xC0000078) +#define STATUS_INVALID_SECURITY_DESCR ((NTSTATUS)0xC0000079) +#define STATUS_PROCEDURE_NOT_FOUND ((NTSTATUS)0xC000007A) +#define STATUS_INVALID_IMAGE_FORMAT ((NTSTATUS)0xC000007B) +#define STATUS_NO_TOKEN ((NTSTATUS)0xC000007C) +#define STATUS_BAD_INHERITANCE_ACL ((NTSTATUS)0xC000007D) +#define STATUS_RANGE_NOT_LOCKED ((NTSTATUS)0xC000007E) +#define STATUS_DISK_FULL ((NTSTATUS)0xC000007F) +#define STATUS_SERVER_DISABLED ((NTSTATUS)0xC0000080) +#define STATUS_SERVER_NOT_DISABLED ((NTSTATUS)0xC0000081) +#define STATUS_TOO_MANY_GUIDS_REQUESTED ((NTSTATUS)0xC0000082) +#define STATUS_GUIDS_EXHAUSTED ((NTSTATUS)0xC0000083) +#define STATUS_INVALID_ID_AUTHORITY ((NTSTATUS)0xC0000084) +#define STATUS_AGENTS_EXHAUSTED ((NTSTATUS)0xC0000085) +#define STATUS_INVALID_VOLUME_LABEL ((NTSTATUS)0xC0000086) +#define STATUS_SECTION_NOT_EXTENDED ((NTSTATUS)0xC0000087) +#define STATUS_NOT_MAPPED_DATA ((NTSTATUS)0xC0000088) +#define STATUS_RESOURCE_DATA_NOT_FOUND ((NTSTATUS)0xC0000089) +#define STATUS_RESOURCE_TYPE_NOT_FOUND ((NTSTATUS)0xC000008A) +#define STATUS_RESOURCE_NAME_NOT_FOUND ((NTSTATUS)0xC000008B) //#define STATUS_ARRAY_BOUNDS_EXCEEDED ((NTSTATUS)0xC000008C) //#define STATUS_FLOAT_DENORMAL_OPERAND ((NTSTATUS)0xC000008D) //#define STATUS_FLOAT_DIVIDE_BY_ZERO ((NTSTATUS)0xC000008E) @@ -437,825 +437,825 @@ //#define STATUS_INTEGER_DIVIDE_BY_ZERO ((NTSTATUS)0xC0000094) //#define STATUS_INTEGER_OVERFLOW ((NTSTATUS)0xC0000095) //#define STATUS_PRIVILEGED_INSTRUCTION ((NTSTATUS)0xC0000096) -#define STATUS_TOO_MANY_PAGING_FILES ((NTSTATUS)0xC0000097) -#define STATUS_FILE_INVALID ((NTSTATUS)0xC0000098) -#define STATUS_ALLOTTED_SPACE_EXCEEDED ((NTSTATUS)0xC0000099) -#define STATUS_INSUFFICIENT_RESOURCES ((NTSTATUS)0xC000009A) -#define STATUS_DFS_EXIT_PATH_FOUND ((NTSTATUS)0xC000009B) -#define STATUS_DEVICE_DATA_ERROR ((NTSTATUS)0xC000009C) -#define STATUS_DEVICE_NOT_CONNECTED ((NTSTATUS)0xC000009D) -#define STATUS_DEVICE_POWER_FAILURE ((NTSTATUS)0xC000009E) -#define STATUS_FREE_VM_NOT_AT_BASE ((NTSTATUS)0xC000009F) -#define STATUS_MEMORY_NOT_ALLOCATED ((NTSTATUS)0xC00000A0) -#define STATUS_WORKING_SET_QUOTA ((NTSTATUS)0xC00000A1) -#define STATUS_MEDIA_WRITE_PROTECTED ((NTSTATUS)0xC00000A2) -#define STATUS_DEVICE_NOT_READY ((NTSTATUS)0xC00000A3) -#define STATUS_INVALID_GROUP_ATTRIBUTES ((NTSTATUS)0xC00000A4) -#define STATUS_BAD_IMPERSONATION_LEVEL ((NTSTATUS)0xC00000A5) -#define STATUS_CANT_OPEN_ANONYMOUS ((NTSTATUS)0xC00000A6) -#define STATUS_BAD_VALIDATION_CLASS ((NTSTATUS)0xC00000A7) -#define STATUS_BAD_TOKEN_TYPE ((NTSTATUS)0xC00000A8) -#define STATUS_BAD_MASTER_BOOT_RECORD ((NTSTATUS)0xC00000A9) -#define STATUS_INSTRUCTION_MISALIGNMENT ((NTSTATUS)0xC00000AA) -#define STATUS_INSTANCE_NOT_AVAILABLE ((NTSTATUS)0xC00000AB) -#define STATUS_PIPE_NOT_AVAILABLE ((NTSTATUS)0xC00000AC) -#define STATUS_INVALID_PIPE_STATE ((NTSTATUS)0xC00000AD) -#define STATUS_PIPE_BUSY ((NTSTATUS)0xC00000AE) -#define STATUS_ILLEGAL_FUNCTION ((NTSTATUS)0xC00000AF) -#define STATUS_PIPE_DISCONNECTED ((NTSTATUS)0xC00000B0) -#define STATUS_PIPE_CLOSING ((NTSTATUS)0xC00000B1) -#define STATUS_PIPE_CONNECTED ((NTSTATUS)0xC00000B2) -#define STATUS_PIPE_LISTENING ((NTSTATUS)0xC00000B3) -#define STATUS_INVALID_READ_MODE ((NTSTATUS)0xC00000B4) -#define STATUS_IO_TIMEOUT ((NTSTATUS)0xC00000B5) -#define STATUS_FILE_FORCED_CLOSED ((NTSTATUS)0xC00000B6) -#define STATUS_PROFILING_NOT_STARTED ((NTSTATUS)0xC00000B7) -#define STATUS_PROFILING_NOT_STOPPED ((NTSTATUS)0xC00000B8) -#define STATUS_COULD_NOT_INTERPRET ((NTSTATUS)0xC00000B9) -#define STATUS_FILE_IS_A_DIRECTORY ((NTSTATUS)0xC00000BA) -#define STATUS_NOT_SUPPORTED ((NTSTATUS)0xC00000BB) -#define STATUS_REMOTE_NOT_LISTENING ((NTSTATUS)0xC00000BC) -#define STATUS_DUPLICATE_NAME ((NTSTATUS)0xC00000BD) -#define STATUS_BAD_NETWORK_PATH ((NTSTATUS)0xC00000BE) -#define STATUS_NETWORK_BUSY ((NTSTATUS)0xC00000BF) -#define STATUS_DEVICE_DOES_NOT_EXIST ((NTSTATUS)0xC00000C0) -#define STATUS_TOO_MANY_COMMANDS ((NTSTATUS)0xC00000C1) -#define STATUS_ADAPTER_HARDWARE_ERROR ((NTSTATUS)0xC00000C2) -#define STATUS_INVALID_NETWORK_RESPONSE ((NTSTATUS)0xC00000C3) -#define STATUS_UNEXPECTED_NETWORK_ERROR ((NTSTATUS)0xC00000C4) -#define STATUS_BAD_REMOTE_ADAPTER ((NTSTATUS)0xC00000C5) -#define STATUS_PRINT_QUEUE_FULL ((NTSTATUS)0xC00000C6) -#define STATUS_NO_SPOOL_SPACE ((NTSTATUS)0xC00000C7) -#define STATUS_PRINT_CANCELLED ((NTSTATUS)0xC00000C8) -#define STATUS_NETWORK_NAME_DELETED ((NTSTATUS)0xC00000C9) -#define STATUS_NETWORK_ACCESS_DENIED ((NTSTATUS)0xC00000CA) -#define STATUS_BAD_DEVICE_TYPE ((NTSTATUS)0xC00000CB) -#define STATUS_BAD_NETWORK_NAME ((NTSTATUS)0xC00000CC) -#define STATUS_TOO_MANY_NAMES ((NTSTATUS)0xC00000CD) -#define STATUS_TOO_MANY_SESSIONS ((NTSTATUS)0xC00000CE) -#define STATUS_SHARING_PAUSED ((NTSTATUS)0xC00000CF) -#define STATUS_REQUEST_NOT_ACCEPTED ((NTSTATUS)0xC00000D0) -#define STATUS_REDIRECTOR_PAUSED ((NTSTATUS)0xC00000D1) -#define STATUS_NET_WRITE_FAULT ((NTSTATUS)0xC00000D2) -#define STATUS_PROFILING_AT_LIMIT ((NTSTATUS)0xC00000D3) -#define STATUS_NOT_SAME_DEVICE ((NTSTATUS)0xC00000D4) -#define STATUS_FILE_RENAMED ((NTSTATUS)0xC00000D5) -#define STATUS_VIRTUAL_CIRCUIT_CLOSED ((NTSTATUS)0xC00000D6) -#define STATUS_NO_SECURITY_ON_OBJECT ((NTSTATUS)0xC00000D7) -#define STATUS_CANT_WAIT ((NTSTATUS)0xC00000D8) -#define STATUS_PIPE_EMPTY ((NTSTATUS)0xC00000D9) -#define STATUS_CANT_ACCESS_DOMAIN_INFO ((NTSTATUS)0xC00000DA) -#define STATUS_CANT_TERMINATE_SELF ((NTSTATUS)0xC00000DB) -#define STATUS_INVALID_SERVER_STATE ((NTSTATUS)0xC00000DC) -#define STATUS_INVALID_DOMAIN_STATE ((NTSTATUS)0xC00000DD) -#define STATUS_INVALID_DOMAIN_ROLE ((NTSTATUS)0xC00000DE) -#define STATUS_NO_SUCH_DOMAIN ((NTSTATUS)0xC00000DF) -#define STATUS_DOMAIN_EXISTS ((NTSTATUS)0xC00000E0) -#define STATUS_DOMAIN_LIMIT_EXCEEDED ((NTSTATUS)0xC00000E1) -#define STATUS_OPLOCK_NOT_GRANTED ((NTSTATUS)0xC00000E2) -#define STATUS_INVALID_OPLOCK_PROTOCOL ((NTSTATUS)0xC00000E3) -#define STATUS_INTERNAL_DB_CORRUPTION ((NTSTATUS)0xC00000E4) -#define STATUS_INTERNAL_ERROR ((NTSTATUS)0xC00000E5) -#define STATUS_GENERIC_NOT_MAPPED ((NTSTATUS)0xC00000E6) -#define STATUS_BAD_DESCRIPTOR_FORMAT ((NTSTATUS)0xC00000E7) -#define STATUS_INVALID_USER_BUFFER ((NTSTATUS)0xC00000E8) -#define STATUS_UNEXPECTED_IO_ERROR ((NTSTATUS)0xC00000E9) -#define STATUS_UNEXPECTED_MM_CREATE_ERR ((NTSTATUS)0xC00000EA) -#define STATUS_UNEXPECTED_MM_MAP_ERROR ((NTSTATUS)0xC00000EB) -#define STATUS_UNEXPECTED_MM_EXTEND_ERR ((NTSTATUS)0xC00000EC) -#define STATUS_NOT_LOGON_PROCESS ((NTSTATUS)0xC00000ED) -#define STATUS_LOGON_SESSION_EXISTS ((NTSTATUS)0xC00000EE) -#define STATUS_INVALID_PARAMETER_1 ((NTSTATUS)0xC00000EF) -#define STATUS_INVALID_PARAMETER_2 ((NTSTATUS)0xC00000F0) -#define STATUS_INVALID_PARAMETER_3 ((NTSTATUS)0xC00000F1) -#define STATUS_INVALID_PARAMETER_4 ((NTSTATUS)0xC00000F2) -#define STATUS_INVALID_PARAMETER_5 ((NTSTATUS)0xC00000F3) -#define STATUS_INVALID_PARAMETER_6 ((NTSTATUS)0xC00000F4) -#define STATUS_INVALID_PARAMETER_7 ((NTSTATUS)0xC00000F5) -#define STATUS_INVALID_PARAMETER_8 ((NTSTATUS)0xC00000F6) -#define STATUS_INVALID_PARAMETER_9 ((NTSTATUS)0xC00000F7) -#define STATUS_INVALID_PARAMETER_10 ((NTSTATUS)0xC00000F8) -#define STATUS_INVALID_PARAMETER_11 ((NTSTATUS)0xC00000F9) -#define STATUS_INVALID_PARAMETER_12 ((NTSTATUS)0xC00000FA) -#define STATUS_REDIRECTOR_NOT_STARTED ((NTSTATUS)0xC00000FB) -#define STATUS_REDIRECTOR_STARTED ((NTSTATUS)0xC00000FC) +#define STATUS_TOO_MANY_PAGING_FILES ((NTSTATUS)0xC0000097) +#define STATUS_FILE_INVALID ((NTSTATUS)0xC0000098) +#define STATUS_ALLOTTED_SPACE_EXCEEDED ((NTSTATUS)0xC0000099) +#define STATUS_INSUFFICIENT_RESOURCES ((NTSTATUS)0xC000009A) +#define STATUS_DFS_EXIT_PATH_FOUND ((NTSTATUS)0xC000009B) +#define STATUS_DEVICE_DATA_ERROR ((NTSTATUS)0xC000009C) +#define STATUS_DEVICE_NOT_CONNECTED ((NTSTATUS)0xC000009D) +#define STATUS_DEVICE_POWER_FAILURE ((NTSTATUS)0xC000009E) +#define STATUS_FREE_VM_NOT_AT_BASE ((NTSTATUS)0xC000009F) +#define STATUS_MEMORY_NOT_ALLOCATED ((NTSTATUS)0xC00000A0) +#define STATUS_WORKING_SET_QUOTA ((NTSTATUS)0xC00000A1) +#define STATUS_MEDIA_WRITE_PROTECTED ((NTSTATUS)0xC00000A2) +#define STATUS_DEVICE_NOT_READY ((NTSTATUS)0xC00000A3) +#define STATUS_INVALID_GROUP_ATTRIBUTES ((NTSTATUS)0xC00000A4) +#define STATUS_BAD_IMPERSONATION_LEVEL ((NTSTATUS)0xC00000A5) +#define STATUS_CANT_OPEN_ANONYMOUS ((NTSTATUS)0xC00000A6) +#define STATUS_BAD_VALIDATION_CLASS ((NTSTATUS)0xC00000A7) +#define STATUS_BAD_TOKEN_TYPE ((NTSTATUS)0xC00000A8) +#define STATUS_BAD_MASTER_BOOT_RECORD ((NTSTATUS)0xC00000A9) +#define STATUS_INSTRUCTION_MISALIGNMENT ((NTSTATUS)0xC00000AA) +#define STATUS_INSTANCE_NOT_AVAILABLE ((NTSTATUS)0xC00000AB) +#define STATUS_PIPE_NOT_AVAILABLE ((NTSTATUS)0xC00000AC) +#define STATUS_INVALID_PIPE_STATE ((NTSTATUS)0xC00000AD) +#define STATUS_PIPE_BUSY ((NTSTATUS)0xC00000AE) +#define STATUS_ILLEGAL_FUNCTION ((NTSTATUS)0xC00000AF) +#define STATUS_PIPE_DISCONNECTED ((NTSTATUS)0xC00000B0) +#define STATUS_PIPE_CLOSING ((NTSTATUS)0xC00000B1) +#define STATUS_PIPE_CONNECTED ((NTSTATUS)0xC00000B2) +#define STATUS_PIPE_LISTENING ((NTSTATUS)0xC00000B3) +#define STATUS_INVALID_READ_MODE ((NTSTATUS)0xC00000B4) +#define STATUS_IO_TIMEOUT ((NTSTATUS)0xC00000B5) +#define STATUS_FILE_FORCED_CLOSED ((NTSTATUS)0xC00000B6) +#define STATUS_PROFILING_NOT_STARTED ((NTSTATUS)0xC00000B7) +#define STATUS_PROFILING_NOT_STOPPED ((NTSTATUS)0xC00000B8) +#define STATUS_COULD_NOT_INTERPRET ((NTSTATUS)0xC00000B9) +#define STATUS_FILE_IS_A_DIRECTORY ((NTSTATUS)0xC00000BA) +#define STATUS_NOT_SUPPORTED ((NTSTATUS)0xC00000BB) +#define STATUS_REMOTE_NOT_LISTENING ((NTSTATUS)0xC00000BC) +#define STATUS_DUPLICATE_NAME ((NTSTATUS)0xC00000BD) +#define STATUS_BAD_NETWORK_PATH ((NTSTATUS)0xC00000BE) +#define STATUS_NETWORK_BUSY ((NTSTATUS)0xC00000BF) +#define STATUS_DEVICE_DOES_NOT_EXIST ((NTSTATUS)0xC00000C0) +#define STATUS_TOO_MANY_COMMANDS ((NTSTATUS)0xC00000C1) +#define STATUS_ADAPTER_HARDWARE_ERROR ((NTSTATUS)0xC00000C2) +#define STATUS_INVALID_NETWORK_RESPONSE ((NTSTATUS)0xC00000C3) +#define STATUS_UNEXPECTED_NETWORK_ERROR ((NTSTATUS)0xC00000C4) +#define STATUS_BAD_REMOTE_ADAPTER ((NTSTATUS)0xC00000C5) +#define STATUS_PRINT_QUEUE_FULL ((NTSTATUS)0xC00000C6) +#define STATUS_NO_SPOOL_SPACE ((NTSTATUS)0xC00000C7) +#define STATUS_PRINT_CANCELLED ((NTSTATUS)0xC00000C8) +#define STATUS_NETWORK_NAME_DELETED ((NTSTATUS)0xC00000C9) +#define STATUS_NETWORK_ACCESS_DENIED ((NTSTATUS)0xC00000CA) +#define STATUS_BAD_DEVICE_TYPE ((NTSTATUS)0xC00000CB) +#define STATUS_BAD_NETWORK_NAME ((NTSTATUS)0xC00000CC) +#define STATUS_TOO_MANY_NAMES ((NTSTATUS)0xC00000CD) +#define STATUS_TOO_MANY_SESSIONS ((NTSTATUS)0xC00000CE) +#define STATUS_SHARING_PAUSED ((NTSTATUS)0xC00000CF) +#define STATUS_REQUEST_NOT_ACCEPTED ((NTSTATUS)0xC00000D0) +#define STATUS_REDIRECTOR_PAUSED ((NTSTATUS)0xC00000D1) +#define STATUS_NET_WRITE_FAULT ((NTSTATUS)0xC00000D2) +#define STATUS_PROFILING_AT_LIMIT ((NTSTATUS)0xC00000D3) +#define STATUS_NOT_SAME_DEVICE ((NTSTATUS)0xC00000D4) +#define STATUS_FILE_RENAMED ((NTSTATUS)0xC00000D5) +#define STATUS_VIRTUAL_CIRCUIT_CLOSED ((NTSTATUS)0xC00000D6) +#define STATUS_NO_SECURITY_ON_OBJECT ((NTSTATUS)0xC00000D7) +#define STATUS_CANT_WAIT ((NTSTATUS)0xC00000D8) +#define STATUS_PIPE_EMPTY ((NTSTATUS)0xC00000D9) +#define STATUS_CANT_ACCESS_DOMAIN_INFO ((NTSTATUS)0xC00000DA) +#define STATUS_CANT_TERMINATE_SELF ((NTSTATUS)0xC00000DB) +#define STATUS_INVALID_SERVER_STATE ((NTSTATUS)0xC00000DC) +#define STATUS_INVALID_DOMAIN_STATE ((NTSTATUS)0xC00000DD) +#define STATUS_INVALID_DOMAIN_ROLE ((NTSTATUS)0xC00000DE) +#define STATUS_NO_SUCH_DOMAIN ((NTSTATUS)0xC00000DF) +#define STATUS_DOMAIN_EXISTS ((NTSTATUS)0xC00000E0) +#define STATUS_DOMAIN_LIMIT_EXCEEDED ((NTSTATUS)0xC00000E1) +#define STATUS_OPLOCK_NOT_GRANTED ((NTSTATUS)0xC00000E2) +#define STATUS_INVALID_OPLOCK_PROTOCOL ((NTSTATUS)0xC00000E3) +#define STATUS_INTERNAL_DB_CORRUPTION ((NTSTATUS)0xC00000E4) +#define STATUS_INTERNAL_ERROR ((NTSTATUS)0xC00000E5) +#define STATUS_GENERIC_NOT_MAPPED ((NTSTATUS)0xC00000E6) +#define STATUS_BAD_DESCRIPTOR_FORMAT ((NTSTATUS)0xC00000E7) +#define STATUS_INVALID_USER_BUFFER ((NTSTATUS)0xC00000E8) +#define STATUS_UNEXPECTED_IO_ERROR ((NTSTATUS)0xC00000E9) +#define STATUS_UNEXPECTED_MM_CREATE_ERR ((NTSTATUS)0xC00000EA) +#define STATUS_UNEXPECTED_MM_MAP_ERROR ((NTSTATUS)0xC00000EB) +#define STATUS_UNEXPECTED_MM_EXTEND_ERR ((NTSTATUS)0xC00000EC) +#define STATUS_NOT_LOGON_PROCESS ((NTSTATUS)0xC00000ED) +#define STATUS_LOGON_SESSION_EXISTS ((NTSTATUS)0xC00000EE) +#define STATUS_INVALID_PARAMETER_1 ((NTSTATUS)0xC00000EF) +#define STATUS_INVALID_PARAMETER_2 ((NTSTATUS)0xC00000F0) +#define STATUS_INVALID_PARAMETER_3 ((NTSTATUS)0xC00000F1) +#define STATUS_INVALID_PARAMETER_4 ((NTSTATUS)0xC00000F2) +#define STATUS_INVALID_PARAMETER_5 ((NTSTATUS)0xC00000F3) +#define STATUS_INVALID_PARAMETER_6 ((NTSTATUS)0xC00000F4) +#define STATUS_INVALID_PARAMETER_7 ((NTSTATUS)0xC00000F5) +#define STATUS_INVALID_PARAMETER_8 ((NTSTATUS)0xC00000F6) +#define STATUS_INVALID_PARAMETER_9 ((NTSTATUS)0xC00000F7) +#define STATUS_INVALID_PARAMETER_10 ((NTSTATUS)0xC00000F8) +#define STATUS_INVALID_PARAMETER_11 ((NTSTATUS)0xC00000F9) +#define STATUS_INVALID_PARAMETER_12 ((NTSTATUS)0xC00000FA) +#define STATUS_REDIRECTOR_NOT_STARTED ((NTSTATUS)0xC00000FB) +#define STATUS_REDIRECTOR_STARTED ((NTSTATUS)0xC00000FC) //#define STATUS_STACK_OVERFLOW ((NTSTATUS)0xC00000FD) -#define STATUS_NO_SUCH_PACKAGE ((NTSTATUS)0xC00000FE) -#define STATUS_BAD_FUNCTION_TABLE ((NTSTATUS)0xC00000FF) -#define STATUS_VARIABLE_NOT_FOUND ((NTSTATUS)0xC0000100) -#define STATUS_DIRECTORY_NOT_EMPTY ((NTSTATUS)0xC0000101) -#define STATUS_FILE_CORRUPT_ERROR ((NTSTATUS)0xC0000102) -#define STATUS_NOT_A_DIRECTORY ((NTSTATUS)0xC0000103) -#define STATUS_BAD_LOGON_SESSION_STATE ((NTSTATUS)0xC0000104) -#define STATUS_LOGON_SESSION_COLLISION ((NTSTATUS)0xC0000105) -#define STATUS_NAME_TOO_LONG ((NTSTATUS)0xC0000106) -#define STATUS_FILES_OPEN ((NTSTATUS)0xC0000107) -#define STATUS_CONNECTION_IN_USE ((NTSTATUS)0xC0000108) -#define STATUS_MESSAGE_NOT_FOUND ((NTSTATUS)0xC0000109) -#define STATUS_PROCESS_IS_TERMINATING ((NTSTATUS)0xC000010A) -#define STATUS_INVALID_LOGON_TYPE ((NTSTATUS)0xC000010B) -#define STATUS_NO_GUID_TRANSLATION ((NTSTATUS)0xC000010C) -#define STATUS_CANNOT_IMPERSONATE ((NTSTATUS)0xC000010D) -#define STATUS_IMAGE_ALREADY_LOADED ((NTSTATUS)0xC000010E) -#define STATUS_ABIOS_NOT_PRESENT ((NTSTATUS)0xC000010F) -#define STATUS_ABIOS_LID_NOT_EXIST ((NTSTATUS)0xC0000110) -#define STATUS_ABIOS_LID_ALREADY_OWNED ((NTSTATUS)0xC0000111) -#define STATUS_ABIOS_NOT_LID_OWNER ((NTSTATUS)0xC0000112) -#define STATUS_ABIOS_INVALID_COMMAND ((NTSTATUS)0xC0000113) -#define STATUS_ABIOS_INVALID_LID ((NTSTATUS)0xC0000114) -#define STATUS_ABIOS_SELECTOR_NOT_AVAILABLE ((NTSTATUS)0xC0000115) -#define STATUS_ABIOS_INVALID_SELECTOR ((NTSTATUS)0xC0000116) -#define STATUS_NO_LDT ((NTSTATUS)0xC0000117) -#define STATUS_INVALID_LDT_SIZE ((NTSTATUS)0xC0000118) -#define STATUS_INVALID_LDT_OFFSET ((NTSTATUS)0xC0000119) -#define STATUS_INVALID_LDT_DESCRIPTOR ((NTSTATUS)0xC000011A) -#define STATUS_INVALID_IMAGE_NE_FORMAT ((NTSTATUS)0xC000011B) -#define STATUS_RXACT_INVALID_STATE ((NTSTATUS)0xC000011C) -#define STATUS_RXACT_COMMIT_FAILURE ((NTSTATUS)0xC000011D) -#define STATUS_MAPPED_FILE_SIZE_ZERO ((NTSTATUS)0xC000011E) -#define STATUS_TOO_MANY_OPENED_FILES ((NTSTATUS)0xC000011F) -#define STATUS_CANCELLED ((NTSTATUS)0xC0000120) -#define STATUS_CANNOT_DELETE ((NTSTATUS)0xC0000121) -#define STATUS_INVALID_COMPUTER_NAME ((NTSTATUS)0xC0000122) -#define STATUS_FILE_DELETED ((NTSTATUS)0xC0000123) -#define STATUS_SPECIAL_ACCOUNT ((NTSTATUS)0xC0000124) -#define STATUS_SPECIAL_GROUP ((NTSTATUS)0xC0000125) -#define STATUS_SPECIAL_USER ((NTSTATUS)0xC0000126) -#define STATUS_MEMBERS_PRIMARY_GROUP ((NTSTATUS)0xC0000127) -#define STATUS_FILE_CLOSED ((NTSTATUS)0xC0000128) -#define STATUS_TOO_MANY_THREADS ((NTSTATUS)0xC0000129) -#define STATUS_THREAD_NOT_IN_PROCESS ((NTSTATUS)0xC000012A) -#define STATUS_TOKEN_ALREADY_IN_USE ((NTSTATUS)0xC000012B) -#define STATUS_PAGEFILE_QUOTA_EXCEEDED ((NTSTATUS)0xC000012C) -#define STATUS_COMMITMENT_LIMIT ((NTSTATUS)0xC000012D) -#define STATUS_INVALID_IMAGE_LE_FORMAT ((NTSTATUS)0xC000012E) -#define STATUS_INVALID_IMAGE_NOT_MZ ((NTSTATUS)0xC000012F) -#define STATUS_INVALID_IMAGE_PROTECT ((NTSTATUS)0xC0000130) -#define STATUS_INVALID_IMAGE_WIN_16 ((NTSTATUS)0xC0000131) -#define STATUS_LOGON_SERVER_CONFLICT ((NTSTATUS)0xC0000132) -#define STATUS_TIME_DIFFERENCE_AT_DC ((NTSTATUS)0xC0000133) -#define STATUS_SYNCHRONIZATION_REQUIRED ((NTSTATUS)0xC0000134) +#define STATUS_NO_SUCH_PACKAGE ((NTSTATUS)0xC00000FE) +#define STATUS_BAD_FUNCTION_TABLE ((NTSTATUS)0xC00000FF) +#define STATUS_VARIABLE_NOT_FOUND ((NTSTATUS)0xC0000100) +#define STATUS_DIRECTORY_NOT_EMPTY ((NTSTATUS)0xC0000101) +#define STATUS_FILE_CORRUPT_ERROR ((NTSTATUS)0xC0000102) +#define STATUS_NOT_A_DIRECTORY ((NTSTATUS)0xC0000103) +#define STATUS_BAD_LOGON_SESSION_STATE ((NTSTATUS)0xC0000104) +#define STATUS_LOGON_SESSION_COLLISION ((NTSTATUS)0xC0000105) +#define STATUS_NAME_TOO_LONG ((NTSTATUS)0xC0000106) +#define STATUS_FILES_OPEN ((NTSTATUS)0xC0000107) +#define STATUS_CONNECTION_IN_USE ((NTSTATUS)0xC0000108) +#define STATUS_MESSAGE_NOT_FOUND ((NTSTATUS)0xC0000109) +#define STATUS_PROCESS_IS_TERMINATING ((NTSTATUS)0xC000010A) +#define STATUS_INVALID_LOGON_TYPE ((NTSTATUS)0xC000010B) +#define STATUS_NO_GUID_TRANSLATION ((NTSTATUS)0xC000010C) +#define STATUS_CANNOT_IMPERSONATE ((NTSTATUS)0xC000010D) +#define STATUS_IMAGE_ALREADY_LOADED ((NTSTATUS)0xC000010E) +#define STATUS_ABIOS_NOT_PRESENT ((NTSTATUS)0xC000010F) +#define STATUS_ABIOS_LID_NOT_EXIST ((NTSTATUS)0xC0000110) +#define STATUS_ABIOS_LID_ALREADY_OWNED ((NTSTATUS)0xC0000111) +#define STATUS_ABIOS_NOT_LID_OWNER ((NTSTATUS)0xC0000112) +#define STATUS_ABIOS_INVALID_COMMAND ((NTSTATUS)0xC0000113) +#define STATUS_ABIOS_INVALID_LID ((NTSTATUS)0xC0000114) +#define STATUS_ABIOS_SELECTOR_NOT_AVAILABLE ((NTSTATUS)0xC0000115) +#define STATUS_ABIOS_INVALID_SELECTOR ((NTSTATUS)0xC0000116) +#define STATUS_NO_LDT ((NTSTATUS)0xC0000117) +#define STATUS_INVALID_LDT_SIZE ((NTSTATUS)0xC0000118) +#define STATUS_INVALID_LDT_OFFSET ((NTSTATUS)0xC0000119) +#define STATUS_INVALID_LDT_DESCRIPTOR ((NTSTATUS)0xC000011A) +#define STATUS_INVALID_IMAGE_NE_FORMAT ((NTSTATUS)0xC000011B) +#define STATUS_RXACT_INVALID_STATE ((NTSTATUS)0xC000011C) +#define STATUS_RXACT_COMMIT_FAILURE ((NTSTATUS)0xC000011D) +#define STATUS_MAPPED_FILE_SIZE_ZERO ((NTSTATUS)0xC000011E) +#define STATUS_TOO_MANY_OPENED_FILES ((NTSTATUS)0xC000011F) +#define STATUS_CANCELLED ((NTSTATUS)0xC0000120) +#define STATUS_CANNOT_DELETE ((NTSTATUS)0xC0000121) +#define STATUS_INVALID_COMPUTER_NAME ((NTSTATUS)0xC0000122) +#define STATUS_FILE_DELETED ((NTSTATUS)0xC0000123) +#define STATUS_SPECIAL_ACCOUNT ((NTSTATUS)0xC0000124) +#define STATUS_SPECIAL_GROUP ((NTSTATUS)0xC0000125) +#define STATUS_SPECIAL_USER ((NTSTATUS)0xC0000126) +#define STATUS_MEMBERS_PRIMARY_GROUP ((NTSTATUS)0xC0000127) +#define STATUS_FILE_CLOSED ((NTSTATUS)0xC0000128) +#define STATUS_TOO_MANY_THREADS ((NTSTATUS)0xC0000129) +#define STATUS_THREAD_NOT_IN_PROCESS ((NTSTATUS)0xC000012A) +#define STATUS_TOKEN_ALREADY_IN_USE ((NTSTATUS)0xC000012B) +#define STATUS_PAGEFILE_QUOTA_EXCEEDED ((NTSTATUS)0xC000012C) +#define STATUS_COMMITMENT_LIMIT ((NTSTATUS)0xC000012D) +#define STATUS_INVALID_IMAGE_LE_FORMAT ((NTSTATUS)0xC000012E) +#define STATUS_INVALID_IMAGE_NOT_MZ ((NTSTATUS)0xC000012F) +#define STATUS_INVALID_IMAGE_PROTECT ((NTSTATUS)0xC0000130) +#define STATUS_INVALID_IMAGE_WIN_16 ((NTSTATUS)0xC0000131) +#define STATUS_LOGON_SERVER_CONFLICT ((NTSTATUS)0xC0000132) +#define STATUS_TIME_DIFFERENCE_AT_DC ((NTSTATUS)0xC0000133) +#define STATUS_SYNCHRONIZATION_REQUIRED ((NTSTATUS)0xC0000134) //#define STATUS_DLL_NOT_FOUND ((NTSTATUS)0xC0000135) -#define STATUS_OPEN_FAILED ((NTSTATUS)0xC0000136) -#define STATUS_IO_PRIVILEGE_FAILED ((NTSTATUS)0xC0000137) +#define STATUS_OPEN_FAILED ((NTSTATUS)0xC0000136) +#define STATUS_IO_PRIVILEGE_FAILED ((NTSTATUS)0xC0000137) //#define STATUS_ORDINAL_NOT_FOUND ((NTSTATUS)0xC0000138) //#define STATUS_ENTRYPOINT_NOT_FOUND ((NTSTATUS)0xC0000139) //#define STATUS_CONTROL_C_EXIT ((NTSTATUS)0xC000013A) -#define STATUS_LOCAL_DISCONNECT ((NTSTATUS)0xC000013B) -#define STATUS_REMOTE_DISCONNECT ((NTSTATUS)0xC000013C) -#define STATUS_REMOTE_RESOURCES ((NTSTATUS)0xC000013D) -#define STATUS_LINK_FAILED ((NTSTATUS)0xC000013E) -#define STATUS_LINK_TIMEOUT ((NTSTATUS)0xC000013F) -#define STATUS_INVALID_CONNECTION ((NTSTATUS)0xC0000140) -#define STATUS_INVALID_ADDRESS ((NTSTATUS)0xC0000141) +#define STATUS_LOCAL_DISCONNECT ((NTSTATUS)0xC000013B) +#define STATUS_REMOTE_DISCONNECT ((NTSTATUS)0xC000013C) +#define STATUS_REMOTE_RESOURCES ((NTSTATUS)0xC000013D) +#define STATUS_LINK_FAILED ((NTSTATUS)0xC000013E) +#define STATUS_LINK_TIMEOUT ((NTSTATUS)0xC000013F) +#define STATUS_INVALID_CONNECTION ((NTSTATUS)0xC0000140) +#define STATUS_INVALID_ADDRESS ((NTSTATUS)0xC0000141) //#define STATUS_DLL_INIT_FAILED ((NTSTATUS)0xC0000142) -#define STATUS_MISSING_SYSTEMFILE ((NTSTATUS)0xC0000143) -#define STATUS_UNHANDLED_EXCEPTION ((NTSTATUS)0xC0000144) -#define STATUS_APP_INIT_FAILURE ((NTSTATUS)0xC0000145) -#define STATUS_PAGEFILE_CREATE_FAILED ((NTSTATUS)0xC0000146) -#define STATUS_NO_PAGEFILE ((NTSTATUS)0xC0000147) -#define STATUS_INVALID_LEVEL ((NTSTATUS)0xC0000148) -#define STATUS_WRONG_PASSWORD_CORE ((NTSTATUS)0xC0000149) -#define STATUS_ILLEGAL_FLOAT_CONTEXT ((NTSTATUS)0xC000014A) -#define STATUS_PIPE_BROKEN ((NTSTATUS)0xC000014B) -#define STATUS_REGISTRY_CORRUPT ((NTSTATUS)0xC000014C) -#define STATUS_REGISTRY_IO_FAILED ((NTSTATUS)0xC000014D) -#define STATUS_NO_EVENT_PAIR ((NTSTATUS)0xC000014E) -#define STATUS_UNRECOGNIZED_VOLUME ((NTSTATUS)0xC000014F) -#define STATUS_SERIAL_NO_DEVICE_INITED ((NTSTATUS)0xC0000150) -#define STATUS_NO_SUCH_ALIAS ((NTSTATUS)0xC0000151) -#define STATUS_MEMBER_NOT_IN_ALIAS ((NTSTATUS)0xC0000152) -#define STATUS_MEMBER_IN_ALIAS ((NTSTATUS)0xC0000153) -#define STATUS_ALIAS_EXISTS ((NTSTATUS)0xC0000154) -#define STATUS_LOGON_NOT_GRANTED ((NTSTATUS)0xC0000155) -#define STATUS_TOO_MANY_SECRETS ((NTSTATUS)0xC0000156) -#define STATUS_SECRET_TOO_LONG ((NTSTATUS)0xC0000157) -#define STATUS_INTERNAL_DB_ERROR ((NTSTATUS)0xC0000158) -#define STATUS_FULLSCREEN_MODE ((NTSTATUS)0xC0000159) -#define STATUS_TOO_MANY_CONTEXT_IDS ((NTSTATUS)0xC000015A) +#define STATUS_MISSING_SYSTEMFILE ((NTSTATUS)0xC0000143) +#define STATUS_UNHANDLED_EXCEPTION ((NTSTATUS)0xC0000144) +#define STATUS_APP_INIT_FAILURE ((NTSTATUS)0xC0000145) +#define STATUS_PAGEFILE_CREATE_FAILED ((NTSTATUS)0xC0000146) +#define STATUS_NO_PAGEFILE ((NTSTATUS)0xC0000147) +#define STATUS_INVALID_LEVEL ((NTSTATUS)0xC0000148) +#define STATUS_WRONG_PASSWORD_CORE ((NTSTATUS)0xC0000149) +#define STATUS_ILLEGAL_FLOAT_CONTEXT ((NTSTATUS)0xC000014A) +#define STATUS_PIPE_BROKEN ((NTSTATUS)0xC000014B) +#define STATUS_REGISTRY_CORRUPT ((NTSTATUS)0xC000014C) +#define STATUS_REGISTRY_IO_FAILED ((NTSTATUS)0xC000014D) +#define STATUS_NO_EVENT_PAIR ((NTSTATUS)0xC000014E) +#define STATUS_UNRECOGNIZED_VOLUME ((NTSTATUS)0xC000014F) +#define STATUS_SERIAL_NO_DEVICE_INITED ((NTSTATUS)0xC0000150) +#define STATUS_NO_SUCH_ALIAS ((NTSTATUS)0xC0000151) +#define STATUS_MEMBER_NOT_IN_ALIAS ((NTSTATUS)0xC0000152) +#define STATUS_MEMBER_IN_ALIAS ((NTSTATUS)0xC0000153) +#define STATUS_ALIAS_EXISTS ((NTSTATUS)0xC0000154) +#define STATUS_LOGON_NOT_GRANTED ((NTSTATUS)0xC0000155) +#define STATUS_TOO_MANY_SECRETS ((NTSTATUS)0xC0000156) +#define STATUS_SECRET_TOO_LONG ((NTSTATUS)0xC0000157) +#define STATUS_INTERNAL_DB_ERROR ((NTSTATUS)0xC0000158) +#define STATUS_FULLSCREEN_MODE ((NTSTATUS)0xC0000159) +#define STATUS_TOO_MANY_CONTEXT_IDS ((NTSTATUS)0xC000015A) //#define STATUS_LOGON_TYPE_NOT_GRANTED ((NTSTATUS)0xC000015B) -#define STATUS_NOT_REGISTRY_FILE ((NTSTATUS)0xC000015C) -#define STATUS_NT_CROSS_ENCRYPTION_REQUIRED ((NTSTATUS)0xC000015D) -#define STATUS_DOMAIN_CTRLR_CONFIG_ERROR ((NTSTATUS)0xC000015E) -#define STATUS_FT_MISSING_MEMBER ((NTSTATUS)0xC000015F) -#define STATUS_ILL_FORMED_SERVICE_ENTRY ((NTSTATUS)0xC0000160) -#define STATUS_ILLEGAL_CHARACTER ((NTSTATUS)0xC0000161) -#define STATUS_UNMAPPABLE_CHARACTER ((NTSTATUS)0xC0000162) -#define STATUS_UNDEFINED_CHARACTER ((NTSTATUS)0xC0000163) -#define STATUS_FLOPPY_VOLUME ((NTSTATUS)0xC0000164) -#define STATUS_FLOPPY_ID_MARK_NOT_FOUND ((NTSTATUS)0xC0000165) -#define STATUS_FLOPPY_WRONG_CYLINDER ((NTSTATUS)0xC0000166) -#define STATUS_FLOPPY_UNKNOWN_ERROR ((NTSTATUS)0xC0000167) -#define STATUS_FLOPPY_BAD_REGISTERS ((NTSTATUS)0xC0000168) -#define STATUS_DISK_RECALIBRATE_FAILED ((NTSTATUS)0xC0000169) -#define STATUS_DISK_OPERATION_FAILED ((NTSTATUS)0xC000016A) -#define STATUS_DISK_RESET_FAILED ((NTSTATUS)0xC000016B) -#define STATUS_SHARED_IRQ_BUSY ((NTSTATUS)0xC000016C) -#define STATUS_FT_ORPHANING ((NTSTATUS)0xC000016D) -#define STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT ((NTSTATUS)0xC000016E) +#define STATUS_NOT_REGISTRY_FILE ((NTSTATUS)0xC000015C) +#define STATUS_NT_CROSS_ENCRYPTION_REQUIRED ((NTSTATUS)0xC000015D) +#define STATUS_DOMAIN_CTRLR_CONFIG_ERROR ((NTSTATUS)0xC000015E) +#define STATUS_FT_MISSING_MEMBER ((NTSTATUS)0xC000015F) +#define STATUS_ILL_FORMED_SERVICE_ENTRY ((NTSTATUS)0xC0000160) +#define STATUS_ILLEGAL_CHARACTER ((NTSTATUS)0xC0000161) +#define STATUS_UNMAPPABLE_CHARACTER ((NTSTATUS)0xC0000162) +#define STATUS_UNDEFINED_CHARACTER ((NTSTATUS)0xC0000163) +#define STATUS_FLOPPY_VOLUME ((NTSTATUS)0xC0000164) +#define STATUS_FLOPPY_ID_MARK_NOT_FOUND ((NTSTATUS)0xC0000165) +#define STATUS_FLOPPY_WRONG_CYLINDER ((NTSTATUS)0xC0000166) +#define STATUS_FLOPPY_UNKNOWN_ERROR ((NTSTATUS)0xC0000167) +#define STATUS_FLOPPY_BAD_REGISTERS ((NTSTATUS)0xC0000168) +#define STATUS_DISK_RECALIBRATE_FAILED ((NTSTATUS)0xC0000169) +#define STATUS_DISK_OPERATION_FAILED ((NTSTATUS)0xC000016A) +#define STATUS_DISK_RESET_FAILED ((NTSTATUS)0xC000016B) +#define STATUS_SHARED_IRQ_BUSY ((NTSTATUS)0xC000016C) +#define STATUS_FT_ORPHANING ((NTSTATUS)0xC000016D) +#define STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT ((NTSTATUS)0xC000016E) -#define STATUS_PARTITION_FAILURE ((NTSTATUS)0xC0000172) -#define STATUS_INVALID_BLOCK_LENGTH ((NTSTATUS)0xC0000173) -#define STATUS_DEVICE_NOT_PARTITIONED ((NTSTATUS)0xC0000174) -#define STATUS_UNABLE_TO_LOCK_MEDIA ((NTSTATUS)0xC0000175) -#define STATUS_UNABLE_TO_UNLOAD_MEDIA ((NTSTATUS)0xC0000176) -#define STATUS_EOM_OVERFLOW ((NTSTATUS)0xC0000177) -#define STATUS_NO_MEDIA ((NTSTATUS)0xC0000178) -#define STATUS_NO_SUCH_MEMBER ((NTSTATUS)0xC000017A) -#define STATUS_INVALID_MEMBER ((NTSTATUS)0xC000017B) -#define STATUS_KEY_DELETED ((NTSTATUS)0xC000017C) -#define STATUS_NO_LOG_SPACE ((NTSTATUS)0xC000017D) -#define STATUS_TOO_MANY_SIDS ((NTSTATUS)0xC000017E) -#define STATUS_LM_CROSS_ENCRYPTION_REQUIRED ((NTSTATUS)0xC000017F) -#define STATUS_KEY_HAS_CHILDREN ((NTSTATUS)0xC0000180) -#define STATUS_CHILD_MUST_BE_VOLATILE ((NTSTATUS)0xC0000181) -#define STATUS_DEVICE_CONFIGURATION_ERROR ((NTSTATUS)0xC0000182) -#define STATUS_DRIVER_INTERNAL_ERROR ((NTSTATUS)0xC0000183) -#define STATUS_INVALID_DEVICE_STATE ((NTSTATUS)0xC0000184) -#define STATUS_IO_DEVICE_ERROR ((NTSTATUS)0xC0000185) -#define STATUS_DEVICE_PROTOCOL_ERROR ((NTSTATUS)0xC0000186) -#define STATUS_BACKUP_CONTROLLER ((NTSTATUS)0xC0000187) -#define STATUS_LOG_FILE_FULL ((NTSTATUS)0xC0000188) -#define STATUS_TOO_LATE ((NTSTATUS)0xC0000189) -#define STATUS_NO_TRUST_LSA_SECRET ((NTSTATUS)0xC000018A) -#define STATUS_NO_TRUST_SAM_ACCOUNT ((NTSTATUS)0xC000018B) -#define STATUS_TRUSTED_DOMAIN_FAILURE ((NTSTATUS)0xC000018C) -#define STATUS_TRUSTED_RELATIONSHIP_FAILURE ((NTSTATUS)0xC000018D) -#define STATUS_EVENTLOG_FILE_CORRUPT ((NTSTATUS)0xC000018E) -#define STATUS_EVENTLOG_CANT_START ((NTSTATUS)0xC000018F) -#define STATUS_TRUST_FAILURE ((NTSTATUS)0xC0000190) -#define STATUS_MUTANT_LIMIT_EXCEEDED ((NTSTATUS)0xC0000191) -#define STATUS_NETLOGON_NOT_STARTED ((NTSTATUS)0xC0000192) +#define STATUS_PARTITION_FAILURE ((NTSTATUS)0xC0000172) +#define STATUS_INVALID_BLOCK_LENGTH ((NTSTATUS)0xC0000173) +#define STATUS_DEVICE_NOT_PARTITIONED ((NTSTATUS)0xC0000174) +#define STATUS_UNABLE_TO_LOCK_MEDIA ((NTSTATUS)0xC0000175) +#define STATUS_UNABLE_TO_UNLOAD_MEDIA ((NTSTATUS)0xC0000176) +#define STATUS_EOM_OVERFLOW ((NTSTATUS)0xC0000177) +#define STATUS_NO_MEDIA ((NTSTATUS)0xC0000178) +#define STATUS_NO_SUCH_MEMBER ((NTSTATUS)0xC000017A) +#define STATUS_INVALID_MEMBER ((NTSTATUS)0xC000017B) +#define STATUS_KEY_DELETED ((NTSTATUS)0xC000017C) +#define STATUS_NO_LOG_SPACE ((NTSTATUS)0xC000017D) +#define STATUS_TOO_MANY_SIDS ((NTSTATUS)0xC000017E) +#define STATUS_LM_CROSS_ENCRYPTION_REQUIRED ((NTSTATUS)0xC000017F) +#define STATUS_KEY_HAS_CHILDREN ((NTSTATUS)0xC0000180) +#define STATUS_CHILD_MUST_BE_VOLATILE ((NTSTATUS)0xC0000181) +#define STATUS_DEVICE_CONFIGURATION_ERROR ((NTSTATUS)0xC0000182) +#define STATUS_DRIVER_INTERNAL_ERROR ((NTSTATUS)0xC0000183) +#define STATUS_INVALID_DEVICE_STATE ((NTSTATUS)0xC0000184) +#define STATUS_IO_DEVICE_ERROR ((NTSTATUS)0xC0000185) +#define STATUS_DEVICE_PROTOCOL_ERROR ((NTSTATUS)0xC0000186) +#define STATUS_BACKUP_CONTROLLER ((NTSTATUS)0xC0000187) +#define STATUS_LOG_FILE_FULL ((NTSTATUS)0xC0000188) +#define STATUS_TOO_LATE ((NTSTATUS)0xC0000189) +#define STATUS_NO_TRUST_LSA_SECRET ((NTSTATUS)0xC000018A) +#define STATUS_NO_TRUST_SAM_ACCOUNT ((NTSTATUS)0xC000018B) +#define STATUS_TRUSTED_DOMAIN_FAILURE ((NTSTATUS)0xC000018C) +#define STATUS_TRUSTED_RELATIONSHIP_FAILURE ((NTSTATUS)0xC000018D) +#define STATUS_EVENTLOG_FILE_CORRUPT ((NTSTATUS)0xC000018E) +#define STATUS_EVENTLOG_CANT_START ((NTSTATUS)0xC000018F) +#define STATUS_TRUST_FAILURE ((NTSTATUS)0xC0000190) +#define STATUS_MUTANT_LIMIT_EXCEEDED ((NTSTATUS)0xC0000191) +#define STATUS_NETLOGON_NOT_STARTED ((NTSTATUS)0xC0000192) //#define STATUS_ACCOUNT_EXPIRED ((NTSTATUS)0xC0000193) -#define STATUS_POSSIBLE_DEADLOCK ((NTSTATUS)0xC0000194) -#define STATUS_NETWORK_CREDENTIAL_CONFLICT ((NTSTATUS)0xC0000195) -#define STATUS_REMOTE_SESSION_LIMIT ((NTSTATUS)0xC0000196) -#define STATUS_EVENTLOG_FILE_CHANGED ((NTSTATUS)0xC0000197) -#define STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT ((NTSTATUS)0xC0000198) -#define STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT ((NTSTATUS)0xC0000199) -#define STATUS_NOLOGON_SERVER_TRUST_ACCOUNT ((NTSTATUS)0xC000019A) -#define STATUS_DOMAIN_TRUST_INCONSISTENT ((NTSTATUS)0xC000019B) -#define STATUS_FS_DRIVER_REQUIRED ((NTSTATUS)0xC000019C) -#define STATUS_NO_USER_SESSION_KEY ((NTSTATUS)0xC0000202) -#define STATUS_USER_SESSION_DELETED ((NTSTATUS)0xC0000203) -#define STATUS_RESOURCE_LANG_NOT_FOUND ((NTSTATUS)0xC0000204) -#define STATUS_INSUFF_SERVER_RESOURCES ((NTSTATUS)0xC0000205) -#define STATUS_INVALID_BUFFER_SIZE ((NTSTATUS)0xC0000206) -#define STATUS_INVALID_ADDRESS_COMPONENT ((NTSTATUS)0xC0000207) -#define STATUS_INVALID_ADDRESS_WILDCARD ((NTSTATUS)0xC0000208) -#define STATUS_TOO_MANY_ADDRESSES ((NTSTATUS)0xC0000209) -#define STATUS_ADDRESS_ALREADY_EXISTS ((NTSTATUS)0xC000020A) -#define STATUS_ADDRESS_CLOSED ((NTSTATUS)0xC000020B) -#define STATUS_CONNECTION_DISCONNECTED ((NTSTATUS)0xC000020C) -#define STATUS_CONNECTION_RESET ((NTSTATUS)0xC000020D) -#define STATUS_TOO_MANY_NODES ((NTSTATUS)0xC000020E) -#define STATUS_TRANSACTION_ABORTED ((NTSTATUS)0xC000020F) -#define STATUS_TRANSACTION_TIMED_OUT ((NTSTATUS)0xC0000210) -#define STATUS_TRANSACTION_NO_RELEASE ((NTSTATUS)0xC0000211) -#define STATUS_TRANSACTION_NO_MATCH ((NTSTATUS)0xC0000212) -#define STATUS_TRANSACTION_RESPONDED ((NTSTATUS)0xC0000213) -#define STATUS_TRANSACTION_INVALID_ID ((NTSTATUS)0xC0000214) -#define STATUS_TRANSACTION_INVALID_TYPE ((NTSTATUS)0xC0000215) -#define STATUS_NOT_SERVER_SESSION ((NTSTATUS)0xC0000216) -#define STATUS_NOT_CLIENT_SESSION ((NTSTATUS)0xC0000217) -#define STATUS_CANNOT_LOAD_REGISTRY_FILE ((NTSTATUS)0xC0000218) -#define STATUS_DEBUG_ATTACH_FAILED ((NTSTATUS)0xC0000219) -#define STATUS_SYSTEM_PROCESS_TERMINATED ((NTSTATUS)0xC000021A) -#define STATUS_DATA_NOT_ACCEPTED ((NTSTATUS)0xC000021B) -#define STATUS_NO_BROWSER_SERVERS_FOUND ((NTSTATUS)0xC000021C) -#define STATUS_VDM_HARD_ERROR ((NTSTATUS)0xC000021D) -#define STATUS_DRIVER_CANCEL_TIMEOUT ((NTSTATUS)0xC000021E) -#define STATUS_REPLY_MESSAGE_MISMATCH ((NTSTATUS)0xC000021F) -#define STATUS_MAPPED_ALIGNMENT ((NTSTATUS)0xC0000220) -#define STATUS_IMAGE_CHECKSUM_MISMATCH ((NTSTATUS)0xC0000221) -#define STATUS_LOST_WRITEBEHIND_DATA ((NTSTATUS)0xC0000222) -#define STATUS_CLIENT_SERVER_PARAMETERS_INVALID ((NTSTATUS)0xC0000223) +#define STATUS_POSSIBLE_DEADLOCK ((NTSTATUS)0xC0000194) +#define STATUS_NETWORK_CREDENTIAL_CONFLICT ((NTSTATUS)0xC0000195) +#define STATUS_REMOTE_SESSION_LIMIT ((NTSTATUS)0xC0000196) +#define STATUS_EVENTLOG_FILE_CHANGED ((NTSTATUS)0xC0000197) +#define STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT ((NTSTATUS)0xC0000198) +#define STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT ((NTSTATUS)0xC0000199) +#define STATUS_NOLOGON_SERVER_TRUST_ACCOUNT ((NTSTATUS)0xC000019A) +#define STATUS_DOMAIN_TRUST_INCONSISTENT ((NTSTATUS)0xC000019B) +#define STATUS_FS_DRIVER_REQUIRED ((NTSTATUS)0xC000019C) +#define STATUS_NO_USER_SESSION_KEY ((NTSTATUS)0xC0000202) +#define STATUS_USER_SESSION_DELETED ((NTSTATUS)0xC0000203) +#define STATUS_RESOURCE_LANG_NOT_FOUND ((NTSTATUS)0xC0000204) +#define STATUS_INSUFF_SERVER_RESOURCES ((NTSTATUS)0xC0000205) +#define STATUS_INVALID_BUFFER_SIZE ((NTSTATUS)0xC0000206) +#define STATUS_INVALID_ADDRESS_COMPONENT ((NTSTATUS)0xC0000207) +#define STATUS_INVALID_ADDRESS_WILDCARD ((NTSTATUS)0xC0000208) +#define STATUS_TOO_MANY_ADDRESSES ((NTSTATUS)0xC0000209) +#define STATUS_ADDRESS_ALREADY_EXISTS ((NTSTATUS)0xC000020A) +#define STATUS_ADDRESS_CLOSED ((NTSTATUS)0xC000020B) +#define STATUS_CONNECTION_DISCONNECTED ((NTSTATUS)0xC000020C) +#define STATUS_CONNECTION_RESET ((NTSTATUS)0xC000020D) +#define STATUS_TOO_MANY_NODES ((NTSTATUS)0xC000020E) +#define STATUS_TRANSACTION_ABORTED ((NTSTATUS)0xC000020F) +#define STATUS_TRANSACTION_TIMED_OUT ((NTSTATUS)0xC0000210) +#define STATUS_TRANSACTION_NO_RELEASE ((NTSTATUS)0xC0000211) +#define STATUS_TRANSACTION_NO_MATCH ((NTSTATUS)0xC0000212) +#define STATUS_TRANSACTION_RESPONDED ((NTSTATUS)0xC0000213) +#define STATUS_TRANSACTION_INVALID_ID ((NTSTATUS)0xC0000214) +#define STATUS_TRANSACTION_INVALID_TYPE ((NTSTATUS)0xC0000215) +#define STATUS_NOT_SERVER_SESSION ((NTSTATUS)0xC0000216) +#define STATUS_NOT_CLIENT_SESSION ((NTSTATUS)0xC0000217) +#define STATUS_CANNOT_LOAD_REGISTRY_FILE ((NTSTATUS)0xC0000218) +#define STATUS_DEBUG_ATTACH_FAILED ((NTSTATUS)0xC0000219) +#define STATUS_SYSTEM_PROCESS_TERMINATED ((NTSTATUS)0xC000021A) +#define STATUS_DATA_NOT_ACCEPTED ((NTSTATUS)0xC000021B) +#define STATUS_NO_BROWSER_SERVERS_FOUND ((NTSTATUS)0xC000021C) +#define STATUS_VDM_HARD_ERROR ((NTSTATUS)0xC000021D) +#define STATUS_DRIVER_CANCEL_TIMEOUT ((NTSTATUS)0xC000021E) +#define STATUS_REPLY_MESSAGE_MISMATCH ((NTSTATUS)0xC000021F) +#define STATUS_MAPPED_ALIGNMENT ((NTSTATUS)0xC0000220) +#define STATUS_IMAGE_CHECKSUM_MISMATCH ((NTSTATUS)0xC0000221) +#define STATUS_LOST_WRITEBEHIND_DATA ((NTSTATUS)0xC0000222) +#define STATUS_CLIENT_SERVER_PARAMETERS_INVALID ((NTSTATUS)0xC0000223) //#define STATUS_PASSWORD_MUST_CHANGE ((NTSTATUS)0xC0000224) -#define STATUS_NOT_FOUND ((NTSTATUS)0xC0000225) -#define STATUS_NOT_TINY_STREAM ((NTSTATUS)0xC0000226) -#define STATUS_RECOVERY_FAILURE ((NTSTATUS)0xC0000227) -#define STATUS_STACK_OVERFLOW_READ ((NTSTATUS)0xC0000228) -#define STATUS_FAIL_CHECK ((NTSTATUS)0xC0000229) -#define STATUS_DUPLICATE_OBJECTID ((NTSTATUS)0xC000022A) -#define STATUS_OBJECTID_EXISTS ((NTSTATUS)0xC000022B) -#define STATUS_CONVERT_TO_LARGE ((NTSTATUS)0xC000022C) -#define STATUS_RETRY ((NTSTATUS)0xC000022D) -#define STATUS_FOUND_OUT_OF_SCOPE ((NTSTATUS)0xC000022E) -#define STATUS_ALLOCATE_BUCKET ((NTSTATUS)0xC000022F) -#define STATUS_PROPSET_NOT_FOUND ((NTSTATUS)0xC0000230) -#define STATUS_MARSHALL_OVERFLOW ((NTSTATUS)0xC0000231) -#define STATUS_INVALID_VARIANT ((NTSTATUS)0xC0000232) -#define STATUS_DOMAIN_CONTROLLER_NOT_FOUND ((NTSTATUS)0xC0000233) +#define STATUS_NOT_FOUND ((NTSTATUS)0xC0000225) +#define STATUS_NOT_TINY_STREAM ((NTSTATUS)0xC0000226) +#define STATUS_RECOVERY_FAILURE ((NTSTATUS)0xC0000227) +#define STATUS_STACK_OVERFLOW_READ ((NTSTATUS)0xC0000228) +#define STATUS_FAIL_CHECK ((NTSTATUS)0xC0000229) +#define STATUS_DUPLICATE_OBJECTID ((NTSTATUS)0xC000022A) +#define STATUS_OBJECTID_EXISTS ((NTSTATUS)0xC000022B) +#define STATUS_CONVERT_TO_LARGE ((NTSTATUS)0xC000022C) +#define STATUS_RETRY ((NTSTATUS)0xC000022D) +#define STATUS_FOUND_OUT_OF_SCOPE ((NTSTATUS)0xC000022E) +#define STATUS_ALLOCATE_BUCKET ((NTSTATUS)0xC000022F) +#define STATUS_PROPSET_NOT_FOUND ((NTSTATUS)0xC0000230) +#define STATUS_MARSHALL_OVERFLOW ((NTSTATUS)0xC0000231) +#define STATUS_INVALID_VARIANT ((NTSTATUS)0xC0000232) +#define STATUS_DOMAIN_CONTROLLER_NOT_FOUND ((NTSTATUS)0xC0000233) //#define STATUS_ACCOUNT_LOCKED_OUT ((NTSTATUS)0xC0000234) -#define STATUS_HANDLE_NOT_CLOSABLE ((NTSTATUS)0xC0000235) -#define STATUS_CONNECTION_REFUSED ((NTSTATUS)0xC0000236) -#define STATUS_GRACEFUL_DISCONNECT ((NTSTATUS)0xC0000237) -#define STATUS_ADDRESS_ALREADY_ASSOCIATED ((NTSTATUS)0xC0000238) -#define STATUS_ADDRESS_NOT_ASSOCIATED ((NTSTATUS)0xC0000239) -#define STATUS_CONNECTION_INVALID ((NTSTATUS)0xC000023A) -#define STATUS_CONNECTION_ACTIVE ((NTSTATUS)0xC000023B) -#define STATUS_NETWORK_UNREACHABLE ((NTSTATUS)0xC000023C) -#define STATUS_HOST_UNREACHABLE ((NTSTATUS)0xC000023D) -#define STATUS_PROTOCOL_UNREACHABLE ((NTSTATUS)0xC000023E) -#define STATUS_PORT_UNREACHABLE ((NTSTATUS)0xC000023F) -#define STATUS_REQUEST_ABORTED ((NTSTATUS)0xC0000240) -#define STATUS_CONNECTION_ABORTED ((NTSTATUS)0xC0000241) -#define STATUS_BAD_COMPRESSION_BUFFER ((NTSTATUS)0xC0000242) -#define STATUS_USER_MAPPED_FILE ((NTSTATUS)0xC0000243) -#define STATUS_AUDIT_FAILED ((NTSTATUS)0xC0000244) -#define STATUS_TIMER_RESOLUTION_NOT_SET ((NTSTATUS)0xC0000245) -#define STATUS_CONNECTION_COUNT_LIMIT ((NTSTATUS)0xC0000246) -#define STATUS_LOGIN_TIME_RESTRICTION ((NTSTATUS)0xC0000247) -#define STATUS_LOGIN_WKSTA_RESTRICTION ((NTSTATUS)0xC0000248) -#define STATUS_IMAGE_MP_UP_MISMATCH ((NTSTATUS)0xC0000249) -#define STATUS_INSUFFICIENT_LOGON_INFO ((NTSTATUS)0xC0000250) -#define STATUS_BAD_DLL_ENTRYPOINT ((NTSTATUS)0xC0000251) -#define STATUS_BAD_SERVICE_ENTRYPOINT ((NTSTATUS)0xC0000252) -#define STATUS_LPC_REPLY_LOST ((NTSTATUS)0xC0000253) -#define STATUS_IP_ADDRESS_CONFLICT1 ((NTSTATUS)0xC0000254) -#define STATUS_IP_ADDRESS_CONFLICT2 ((NTSTATUS)0xC0000255) -#define STATUS_REGISTRY_QUOTA_LIMIT ((NTSTATUS)0xC0000256) -#define STATUS_PATH_NOT_COVERED ((NTSTATUS)0xC0000257) -#define STATUS_NO_CALLBACK_ACTIVE ((NTSTATUS)0xC0000258) -#define STATUS_LICENSE_QUOTA_EXCEEDED ((NTSTATUS)0xC0000259) -#define STATUS_PWD_TOO_SHORT ((NTSTATUS)0xC000025A) -#define STATUS_PWD_TOO_RECENT ((NTSTATUS)0xC000025B) -#define STATUS_PWD_HISTORY_CONFLICT ((NTSTATUS)0xC000025C) -#define STATUS_PLUGPLAY_NO_DEVICE ((NTSTATUS)0xC000025E) -#define STATUS_UNSUPPORTED_COMPRESSION ((NTSTATUS)0xC000025F) -#define STATUS_INVALID_HW_PROFILE ((NTSTATUS)0xC0000260) -#define STATUS_INVALID_PLUGPLAY_DEVICE_PATH ((NTSTATUS)0xC0000261) -#define STATUS_DRIVER_ORDINAL_NOT_FOUND ((NTSTATUS)0xC0000262) -#define STATUS_DRIVER_ENTRYPOINT_NOT_FOUND ((NTSTATUS)0xC0000263) -#define STATUS_RESOURCE_NOT_OWNED ((NTSTATUS)0xC0000264) -#define STATUS_TOO_MANY_LINKS ((NTSTATUS)0xC0000265) -#define STATUS_QUOTA_LIST_INCONSISTENT ((NTSTATUS)0xC0000266) -#define STATUS_FILE_IS_OFFLINE ((NTSTATUS)0xC0000267) -#define STATUS_EVALUATION_EXPIRATION ((NTSTATUS)0xC0000268) -#define STATUS_ILLEGAL_DLL_RELOCATION ((NTSTATUS)0xC0000269) -#define STATUS_LICENSE_VIOLATION ((NTSTATUS)0xC000026A) -#define STATUS_DLL_INIT_FAILED_LOGOFF ((NTSTATUS)0xC000026B) -#define STATUS_DRIVER_UNABLE_TO_LOAD ((NTSTATUS)0xC000026C) -#define STATUS_DFS_UNAVAILABLE ((NTSTATUS)0xC000026D) -#define STATUS_VOLUME_DISMOUNTED ((NTSTATUS)0xC000026E) -#define STATUS_WX86_INTERNAL_ERROR ((NTSTATUS)0xC000026F) -#define STATUS_WX86_FLOAT_STACK_CHECK ((NTSTATUS)0xC0000270) -#define STATUS_VALIDATE_CONTINUE ((NTSTATUS)0xC0000271) -#define STATUS_NO_MATCH ((NTSTATUS)0xC0000272) -#define STATUS_NO_MORE_MATCHES ((NTSTATUS)0xC0000273) -#define STATUS_NOT_A_REPARSE_POINT ((NTSTATUS)0xC0000275) -#define STATUS_IO_REPARSE_TAG_INVALID ((NTSTATUS)0xC0000276) -#define STATUS_IO_REPARSE_TAG_MISMATCH ((NTSTATUS)0xC0000277) -#define STATUS_IO_REPARSE_DATA_INVALID ((NTSTATUS)0xC0000278) -#define STATUS_IO_REPARSE_TAG_NOT_HANDLED ((NTSTATUS)0xC0000279) -#define STATUS_REPARSE_POINT_NOT_RESOLVED ((NTSTATUS)0xC0000280) -#define STATUS_DIRECTORY_IS_A_REPARSE_POINT ((NTSTATUS)0xC0000281) -#define STATUS_RANGE_LIST_CONFLICT ((NTSTATUS)0xC0000282) -#define STATUS_SOURCE_ELEMENT_EMPTY ((NTSTATUS)0xC0000283) -#define STATUS_DESTINATION_ELEMENT_FULL ((NTSTATUS)0xC0000284) -#define STATUS_ILLEGAL_ELEMENT_ADDRESS ((NTSTATUS)0xC0000285) -#define STATUS_MAGAZINE_NOT_PRESENT ((NTSTATUS)0xC0000286) -#define STATUS_REINITIALIZATION_NEEDED ((NTSTATUS)0xC0000287) -#define STATUS_ENCRYPTION_FAILED ((NTSTATUS)0xC000028A) -#define STATUS_DECRYPTION_FAILED ((NTSTATUS)0xC000028B) -#define STATUS_RANGE_NOT_FOUND ((NTSTATUS)0xC000028C) -#define STATUS_NO_RECOVERY_POLICY ((NTSTATUS)0xC000028D) -#define STATUS_NO_EFS ((NTSTATUS)0xC000028E) -#define STATUS_WRONG_EFS ((NTSTATUS)0xC000028F) -#define STATUS_NO_USER_KEYS ((NTSTATUS)0xC0000290) -#define STATUS_FILE_NOT_ENCRYPTED ((NTSTATUS)0xC0000291) -#define STATUS_NOT_EXPORT_FORMAT ((NTSTATUS)0xC0000292) -#define STATUS_FILE_ENCRYPTED ((NTSTATUS)0xC0000293) -#define STATUS_WMI_GUID_NOT_FOUND ((NTSTATUS)0xC0000295) -#define STATUS_WMI_INSTANCE_NOT_FOUND ((NTSTATUS)0xC0000296) -#define STATUS_WMI_ITEMID_NOT_FOUND ((NTSTATUS)0xC0000297) -#define STATUS_WMI_TRY_AGAIN ((NTSTATUS)0xC0000298) -#define STATUS_SHARED_POLICY ((NTSTATUS)0xC0000299) -#define STATUS_POLICY_OBJECT_NOT_FOUND ((NTSTATUS)0xC000029A) -#define STATUS_POLICY_ONLY_IN_DS ((NTSTATUS)0xC000029B) -#define STATUS_VOLUME_NOT_UPGRADED ((NTSTATUS)0xC000029C) -#define STATUS_REMOTE_STORAGE_NOT_ACTIVE ((NTSTATUS)0xC000029D) -#define STATUS_REMOTE_STORAGE_MEDIA_ERROR ((NTSTATUS)0xC000029E) -#define STATUS_NO_TRACKING_SERVICE ((NTSTATUS)0xC000029F) -#define STATUS_SERVER_SID_MISMATCH ((NTSTATUS)0xC00002A0) -#define STATUS_DS_NO_ATTRIBUTE_OR_VALUE ((NTSTATUS)0xC00002A1) -#define STATUS_DS_INVALID_ATTRIBUTE_SYNTAX ((NTSTATUS)0xC00002A2) -#define STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED ((NTSTATUS)0xC00002A3) -#define STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS ((NTSTATUS)0xC00002A4) -#define STATUS_DS_BUSY ((NTSTATUS)0xC00002A5) -#define STATUS_DS_UNAVAILABLE ((NTSTATUS)0xC00002A6) -#define STATUS_DS_NO_RIDS_ALLOCATED ((NTSTATUS)0xC00002A7) -#define STATUS_DS_NO_MORE_RIDS ((NTSTATUS)0xC00002A8) -#define STATUS_DS_INCORRECT_ROLE_OWNER ((NTSTATUS)0xC00002A9) -#define STATUS_DS_RIDMGR_INIT_ERROR ((NTSTATUS)0xC00002AA) -#define STATUS_DS_OBJ_CLASS_VIOLATION ((NTSTATUS)0xC00002AB) -#define STATUS_DS_CANT_ON_NON_LEAF ((NTSTATUS)0xC00002AC) -#define STATUS_DS_CANT_ON_RDN ((NTSTATUS)0xC00002AD) -#define STATUS_DS_CANT_MOD_OBJ_CLASS ((NTSTATUS)0xC00002AE) -#define STATUS_DS_CROSS_DOM_MOVE_FAILED ((NTSTATUS)0xC00002AF) -#define STATUS_DS_GC_NOT_AVAILABLE ((NTSTATUS)0xC00002B0) -#define STATUS_DIRECTORY_SERVICE_REQUIRED ((NTSTATUS)0xC00002B1) -#define STATUS_REPARSE_ATTRIBUTE_CONFLICT ((NTSTATUS)0xC00002B2) -#define STATUS_CANT_ENABLE_DENY_ONLY ((NTSTATUS)0xC00002B3) +#define STATUS_HANDLE_NOT_CLOSABLE ((NTSTATUS)0xC0000235) +#define STATUS_CONNECTION_REFUSED ((NTSTATUS)0xC0000236) +#define STATUS_GRACEFUL_DISCONNECT ((NTSTATUS)0xC0000237) +#define STATUS_ADDRESS_ALREADY_ASSOCIATED ((NTSTATUS)0xC0000238) +#define STATUS_ADDRESS_NOT_ASSOCIATED ((NTSTATUS)0xC0000239) +#define STATUS_CONNECTION_INVALID ((NTSTATUS)0xC000023A) +#define STATUS_CONNECTION_ACTIVE ((NTSTATUS)0xC000023B) +#define STATUS_NETWORK_UNREACHABLE ((NTSTATUS)0xC000023C) +#define STATUS_HOST_UNREACHABLE ((NTSTATUS)0xC000023D) +#define STATUS_PROTOCOL_UNREACHABLE ((NTSTATUS)0xC000023E) +#define STATUS_PORT_UNREACHABLE ((NTSTATUS)0xC000023F) +#define STATUS_REQUEST_ABORTED ((NTSTATUS)0xC0000240) +#define STATUS_CONNECTION_ABORTED ((NTSTATUS)0xC0000241) +#define STATUS_BAD_COMPRESSION_BUFFER ((NTSTATUS)0xC0000242) +#define STATUS_USER_MAPPED_FILE ((NTSTATUS)0xC0000243) +#define STATUS_AUDIT_FAILED ((NTSTATUS)0xC0000244) +#define STATUS_TIMER_RESOLUTION_NOT_SET ((NTSTATUS)0xC0000245) +#define STATUS_CONNECTION_COUNT_LIMIT ((NTSTATUS)0xC0000246) +#define STATUS_LOGIN_TIME_RESTRICTION ((NTSTATUS)0xC0000247) +#define STATUS_LOGIN_WKSTA_RESTRICTION ((NTSTATUS)0xC0000248) +#define STATUS_IMAGE_MP_UP_MISMATCH ((NTSTATUS)0xC0000249) +#define STATUS_INSUFFICIENT_LOGON_INFO ((NTSTATUS)0xC0000250) +#define STATUS_BAD_DLL_ENTRYPOINT ((NTSTATUS)0xC0000251) +#define STATUS_BAD_SERVICE_ENTRYPOINT ((NTSTATUS)0xC0000252) +#define STATUS_LPC_REPLY_LOST ((NTSTATUS)0xC0000253) +#define STATUS_IP_ADDRESS_CONFLICT1 ((NTSTATUS)0xC0000254) +#define STATUS_IP_ADDRESS_CONFLICT2 ((NTSTATUS)0xC0000255) +#define STATUS_REGISTRY_QUOTA_LIMIT ((NTSTATUS)0xC0000256) +#define STATUS_PATH_NOT_COVERED ((NTSTATUS)0xC0000257) +#define STATUS_NO_CALLBACK_ACTIVE ((NTSTATUS)0xC0000258) +#define STATUS_LICENSE_QUOTA_EXCEEDED ((NTSTATUS)0xC0000259) +#define STATUS_PWD_TOO_SHORT ((NTSTATUS)0xC000025A) +#define STATUS_PWD_TOO_RECENT ((NTSTATUS)0xC000025B) +#define STATUS_PWD_HISTORY_CONFLICT ((NTSTATUS)0xC000025C) +#define STATUS_PLUGPLAY_NO_DEVICE ((NTSTATUS)0xC000025E) +#define STATUS_UNSUPPORTED_COMPRESSION ((NTSTATUS)0xC000025F) +#define STATUS_INVALID_HW_PROFILE ((NTSTATUS)0xC0000260) +#define STATUS_INVALID_PLUGPLAY_DEVICE_PATH ((NTSTATUS)0xC0000261) +#define STATUS_DRIVER_ORDINAL_NOT_FOUND ((NTSTATUS)0xC0000262) +#define STATUS_DRIVER_ENTRYPOINT_NOT_FOUND ((NTSTATUS)0xC0000263) +#define STATUS_RESOURCE_NOT_OWNED ((NTSTATUS)0xC0000264) +#define STATUS_TOO_MANY_LINKS ((NTSTATUS)0xC0000265) +#define STATUS_QUOTA_LIST_INCONSISTENT ((NTSTATUS)0xC0000266) +#define STATUS_FILE_IS_OFFLINE ((NTSTATUS)0xC0000267) +#define STATUS_EVALUATION_EXPIRATION ((NTSTATUS)0xC0000268) +#define STATUS_ILLEGAL_DLL_RELOCATION ((NTSTATUS)0xC0000269) +#define STATUS_LICENSE_VIOLATION ((NTSTATUS)0xC000026A) +#define STATUS_DLL_INIT_FAILED_LOGOFF ((NTSTATUS)0xC000026B) +#define STATUS_DRIVER_UNABLE_TO_LOAD ((NTSTATUS)0xC000026C) +#define STATUS_DFS_UNAVAILABLE ((NTSTATUS)0xC000026D) +#define STATUS_VOLUME_DISMOUNTED ((NTSTATUS)0xC000026E) +#define STATUS_WX86_INTERNAL_ERROR ((NTSTATUS)0xC000026F) +#define STATUS_WX86_FLOAT_STACK_CHECK ((NTSTATUS)0xC0000270) +#define STATUS_VALIDATE_CONTINUE ((NTSTATUS)0xC0000271) +#define STATUS_NO_MATCH ((NTSTATUS)0xC0000272) +#define STATUS_NO_MORE_MATCHES ((NTSTATUS)0xC0000273) +#define STATUS_NOT_A_REPARSE_POINT ((NTSTATUS)0xC0000275) +#define STATUS_IO_REPARSE_TAG_INVALID ((NTSTATUS)0xC0000276) +#define STATUS_IO_REPARSE_TAG_MISMATCH ((NTSTATUS)0xC0000277) +#define STATUS_IO_REPARSE_DATA_INVALID ((NTSTATUS)0xC0000278) +#define STATUS_IO_REPARSE_TAG_NOT_HANDLED ((NTSTATUS)0xC0000279) +#define STATUS_REPARSE_POINT_NOT_RESOLVED ((NTSTATUS)0xC0000280) +#define STATUS_DIRECTORY_IS_A_REPARSE_POINT ((NTSTATUS)0xC0000281) +#define STATUS_RANGE_LIST_CONFLICT ((NTSTATUS)0xC0000282) +#define STATUS_SOURCE_ELEMENT_EMPTY ((NTSTATUS)0xC0000283) +#define STATUS_DESTINATION_ELEMENT_FULL ((NTSTATUS)0xC0000284) +#define STATUS_ILLEGAL_ELEMENT_ADDRESS ((NTSTATUS)0xC0000285) +#define STATUS_MAGAZINE_NOT_PRESENT ((NTSTATUS)0xC0000286) +#define STATUS_REINITIALIZATION_NEEDED ((NTSTATUS)0xC0000287) +#define STATUS_ENCRYPTION_FAILED ((NTSTATUS)0xC000028A) +#define STATUS_DECRYPTION_FAILED ((NTSTATUS)0xC000028B) +#define STATUS_RANGE_NOT_FOUND ((NTSTATUS)0xC000028C) +#define STATUS_NO_RECOVERY_POLICY ((NTSTATUS)0xC000028D) +#define STATUS_NO_EFS ((NTSTATUS)0xC000028E) +#define STATUS_WRONG_EFS ((NTSTATUS)0xC000028F) +#define STATUS_NO_USER_KEYS ((NTSTATUS)0xC0000290) +#define STATUS_FILE_NOT_ENCRYPTED ((NTSTATUS)0xC0000291) +#define STATUS_NOT_EXPORT_FORMAT ((NTSTATUS)0xC0000292) +#define STATUS_FILE_ENCRYPTED ((NTSTATUS)0xC0000293) +#define STATUS_WMI_GUID_NOT_FOUND ((NTSTATUS)0xC0000295) +#define STATUS_WMI_INSTANCE_NOT_FOUND ((NTSTATUS)0xC0000296) +#define STATUS_WMI_ITEMID_NOT_FOUND ((NTSTATUS)0xC0000297) +#define STATUS_WMI_TRY_AGAIN ((NTSTATUS)0xC0000298) +#define STATUS_SHARED_POLICY ((NTSTATUS)0xC0000299) +#define STATUS_POLICY_OBJECT_NOT_FOUND ((NTSTATUS)0xC000029A) +#define STATUS_POLICY_ONLY_IN_DS ((NTSTATUS)0xC000029B) +#define STATUS_VOLUME_NOT_UPGRADED ((NTSTATUS)0xC000029C) +#define STATUS_REMOTE_STORAGE_NOT_ACTIVE ((NTSTATUS)0xC000029D) +#define STATUS_REMOTE_STORAGE_MEDIA_ERROR ((NTSTATUS)0xC000029E) +#define STATUS_NO_TRACKING_SERVICE ((NTSTATUS)0xC000029F) +#define STATUS_SERVER_SID_MISMATCH ((NTSTATUS)0xC00002A0) +#define STATUS_DS_NO_ATTRIBUTE_OR_VALUE ((NTSTATUS)0xC00002A1) +#define STATUS_DS_INVALID_ATTRIBUTE_SYNTAX ((NTSTATUS)0xC00002A2) +#define STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED ((NTSTATUS)0xC00002A3) +#define STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS ((NTSTATUS)0xC00002A4) +#define STATUS_DS_BUSY ((NTSTATUS)0xC00002A5) +#define STATUS_DS_UNAVAILABLE ((NTSTATUS)0xC00002A6) +#define STATUS_DS_NO_RIDS_ALLOCATED ((NTSTATUS)0xC00002A7) +#define STATUS_DS_NO_MORE_RIDS ((NTSTATUS)0xC00002A8) +#define STATUS_DS_INCORRECT_ROLE_OWNER ((NTSTATUS)0xC00002A9) +#define STATUS_DS_RIDMGR_INIT_ERROR ((NTSTATUS)0xC00002AA) +#define STATUS_DS_OBJ_CLASS_VIOLATION ((NTSTATUS)0xC00002AB) +#define STATUS_DS_CANT_ON_NON_LEAF ((NTSTATUS)0xC00002AC) +#define STATUS_DS_CANT_ON_RDN ((NTSTATUS)0xC00002AD) +#define STATUS_DS_CANT_MOD_OBJ_CLASS ((NTSTATUS)0xC00002AE) +#define STATUS_DS_CROSS_DOM_MOVE_FAILED ((NTSTATUS)0xC00002AF) +#define STATUS_DS_GC_NOT_AVAILABLE ((NTSTATUS)0xC00002B0) +#define STATUS_DIRECTORY_SERVICE_REQUIRED ((NTSTATUS)0xC00002B1) +#define STATUS_REPARSE_ATTRIBUTE_CONFLICT ((NTSTATUS)0xC00002B2) +#define STATUS_CANT_ENABLE_DENY_ONLY ((NTSTATUS)0xC00002B3) //#define STATUS_FLOAT_MULTIPLE_FAULTS ((NTSTATUS)0xC00002B4) //#define STATUS_FLOAT_MULTIPLE_TRAPS ((NTSTATUS)0xC00002B5) -#define STATUS_DEVICE_REMOVED ((NTSTATUS)0xC00002B6) -#define STATUS_JOURNAL_DELETE_IN_PROGRESS ((NTSTATUS)0xC00002B7) -#define STATUS_JOURNAL_NOT_ACTIVE ((NTSTATUS)0xC00002B8) -#define STATUS_NOINTERFACE ((NTSTATUS)0xC00002B9) -#define STATUS_DS_ADMIN_LIMIT_EXCEEDED ((NTSTATUS)0xC00002C1) -#define STATUS_DRIVER_FAILED_SLEEP ((NTSTATUS)0xC00002C2) -#define STATUS_MUTUAL_AUTHENTICATION_FAILED ((NTSTATUS)0xC00002C3) -#define STATUS_CORRUPT_SYSTEM_FILE ((NTSTATUS)0xC00002C4) -#define STATUS_DATATYPE_MISALIGNMENT_ERROR ((NTSTATUS)0xC00002C5) -#define STATUS_WMI_READ_ONLY ((NTSTATUS)0xC00002C6) -#define STATUS_WMI_SET_FAILURE ((NTSTATUS)0xC00002C7) -#define STATUS_COMMITMENT_MINIMUM ((NTSTATUS)0xC00002C8) +#define STATUS_DEVICE_REMOVED ((NTSTATUS)0xC00002B6) +#define STATUS_JOURNAL_DELETE_IN_PROGRESS ((NTSTATUS)0xC00002B7) +#define STATUS_JOURNAL_NOT_ACTIVE ((NTSTATUS)0xC00002B8) +#define STATUS_NOINTERFACE ((NTSTATUS)0xC00002B9) +#define STATUS_DS_ADMIN_LIMIT_EXCEEDED ((NTSTATUS)0xC00002C1) +#define STATUS_DRIVER_FAILED_SLEEP ((NTSTATUS)0xC00002C2) +#define STATUS_MUTUAL_AUTHENTICATION_FAILED ((NTSTATUS)0xC00002C3) +#define STATUS_CORRUPT_SYSTEM_FILE ((NTSTATUS)0xC00002C4) +#define STATUS_DATATYPE_MISALIGNMENT_ERROR ((NTSTATUS)0xC00002C5) +#define STATUS_WMI_READ_ONLY ((NTSTATUS)0xC00002C6) +#define STATUS_WMI_SET_FAILURE ((NTSTATUS)0xC00002C7) +#define STATUS_COMMITMENT_MINIMUM ((NTSTATUS)0xC00002C8) //#define STATUS_REG_NAT_CONSUMPTION ((NTSTATUS)0xC00002C9) -#define STATUS_TRANSPORT_FULL ((NTSTATUS)0xC00002CA) -#define STATUS_DS_SAM_INIT_FAILURE ((NTSTATUS)0xC00002CB) -#define STATUS_ONLY_IF_CONNECTED ((NTSTATUS)0xC00002CC) -#define STATUS_DS_SENSITIVE_GROUP_VIOLATION ((NTSTATUS)0xC00002CD) -#define STATUS_PNP_RESTART_ENUMERATION ((NTSTATUS)0xC00002CE) -#define STATUS_JOURNAL_ENTRY_DELETED ((NTSTATUS)0xC00002CF) -#define STATUS_DS_CANT_MOD_PRIMARYGROUPID ((NTSTATUS)0xC00002D0) -#define STATUS_SYSTEM_IMAGE_BAD_SIGNATURE ((NTSTATUS)0xC00002D1) -#define STATUS_PNP_REBOOT_REQUIRED ((NTSTATUS)0xC00002D2) -#define STATUS_POWER_STATE_INVALID ((NTSTATUS)0xC00002D3) -#define STATUS_DS_INVALID_GROUP_TYPE ((NTSTATUS)0xC00002D4) -#define STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN ((NTSTATUS)0xC00002D5) -#define STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN ((NTSTATUS)0xC00002D6) -#define STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER ((NTSTATUS)0xC00002D7) -#define STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER ((NTSTATUS)0xC00002D8) -#define STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER ((NTSTATUS)0xC00002D9) -#define STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER ((NTSTATUS)0xC00002DA) -#define STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER ((NTSTATUS)0xC00002DB) -#define STATUS_DS_HAVE_PRIMARY_MEMBERS ((NTSTATUS)0xC00002DC) -#define STATUS_WMI_NOT_SUPPORTED ((NTSTATUS)0xC00002DD) -#define STATUS_INSUFFICIENT_POWER ((NTSTATUS)0xC00002DE) -#define STATUS_SAM_NEED_BOOTKEY_PASSWORD ((NTSTATUS)0xC00002DF) -#define STATUS_SAM_NEED_BOOTKEY_FLOPPY ((NTSTATUS)0xC00002E0) -#define STATUS_DS_CANT_START ((NTSTATUS)0xC00002E1) -#define STATUS_DS_INIT_FAILURE ((NTSTATUS)0xC00002E2) -#define STATUS_SAM_INIT_FAILURE ((NTSTATUS)0xC00002E3) -#define STATUS_DS_GC_REQUIRED ((NTSTATUS)0xC00002E4) -#define STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY ((NTSTATUS)0xC00002E5) -#define STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS ((NTSTATUS)0xC00002E6) -#define STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED ((NTSTATUS)0xC00002E7) -#define STATUS_MULTIPLE_FAULT_VIOLATION ((NTSTATUS)0xC00002E8) -#define STATUS_CURRENT_DOMAIN_NOT_ALLOWED ((NTSTATUS)0xC00002E9) -#define STATUS_CANNOT_MAKE ((NTSTATUS)0xC00002EA) -#define STATUS_SYSTEM_SHUTDOWN ((NTSTATUS)0xC00002EB) -#define STATUS_DS_INIT_FAILURE_CONSOLE ((NTSTATUS)0xC00002EC) -#define STATUS_DS_SAM_INIT_FAILURE_CONSOLE ((NTSTATUS)0xC00002ED) -#define STATUS_UNFINISHED_CONTEXT_DELETED ((NTSTATUS)0xC00002EE) -#define STATUS_NO_TGT_REPLY ((NTSTATUS)0xC00002EF) -#define STATUS_OBJECTID_NOT_FOUND ((NTSTATUS)0xC00002F0) -#define STATUS_NO_IP_ADDRESSES ((NTSTATUS)0xC00002F1) -#define STATUS_WRONG_CREDENTIAL_HANDLE ((NTSTATUS)0xC00002F2) -#define STATUS_CRYPTO_SYSTEM_INVALID ((NTSTATUS)0xC00002F3) -#define STATUS_MAX_REFERRALS_EXCEEDED ((NTSTATUS)0xC00002F4) -#define STATUS_MUST_BE_KDC ((NTSTATUS)0xC00002F5) -#define STATUS_STRONG_CRYPTO_NOT_SUPPORTED ((NTSTATUS)0xC00002F6) -#define STATUS_TOO_MANY_PRINCIPALS ((NTSTATUS)0xC00002F7) -#define STATUS_NO_PA_DATA ((NTSTATUS)0xC00002F8) -#define STATUS_PKINIT_NAME_MISMATCH ((NTSTATUS)0xC00002F9) -#define STATUS_SMARTCARD_LOGON_REQUIRED ((NTSTATUS)0xC00002FA) -#define STATUS_KDC_INVALID_REQUEST ((NTSTATUS)0xC00002FB) -#define STATUS_KDC_UNABLE_TO_REFER ((NTSTATUS)0xC00002FC) -#define STATUS_KDC_UNKNOWN_ETYPE ((NTSTATUS)0xC00002FD) -#define STATUS_SHUTDOWN_IN_PROGRESS ((NTSTATUS)0xC00002FE) -#define STATUS_SERVER_SHUTDOWN_IN_PROGRESS ((NTSTATUS)0xC00002FF) -#define STATUS_NOT_SUPPORTED_ON_SBS ((NTSTATUS)0xC0000300) -#define STATUS_WMI_GUID_DISCONNECTED ((NTSTATUS)0xC0000301) -#define STATUS_WMI_ALREADY_DISABLED ((NTSTATUS)0xC0000302) -#define STATUS_WMI_ALREADY_ENABLED ((NTSTATUS)0xC0000303) -#define STATUS_MFT_TOO_FRAGMENTED ((NTSTATUS)0xC0000304) -#define STATUS_COPY_PROTECTION_FAILURE ((NTSTATUS)0xC0000305) -#define STATUS_CSS_AUTHENTICATION_FAILURE ((NTSTATUS)0xC0000306) -#define STATUS_CSS_KEY_NOT_PRESENT ((NTSTATUS)0xC0000307) -#define STATUS_CSS_KEY_NOT_ESTABLISHED ((NTSTATUS)0xC0000308) -#define STATUS_CSS_SCRAMBLED_SECTOR ((NTSTATUS)0xC0000309) -#define STATUS_CSS_REGION_MISMATCH ((NTSTATUS)0xC000030A) -#define STATUS_CSS_RESETS_EXHAUSTED ((NTSTATUS)0xC000030B) -#define STATUS_PKINIT_FAILURE ((NTSTATUS)0xC0000320) -#define STATUS_SMARTCARD_SUBSYSTEM_FAILURE ((NTSTATUS)0xC0000321) -#define STATUS_NO_KERB_KEY ((NTSTATUS)0xC0000322) -#define STATUS_HOST_DOWN ((NTSTATUS)0xC0000350) -#define STATUS_UNSUPPORTED_PREAUTH ((NTSTATUS)0xC0000351) -#define STATUS_EFS_ALG_BLOB_TOO_BIG ((NTSTATUS)0xC0000352) -#define STATUS_PORT_NOT_SET ((NTSTATUS)0xC0000353) -#define STATUS_DEBUGGER_INACTIVE ((NTSTATUS)0xC0000354) -#define STATUS_DS_VERSION_CHECK_FAILURE ((NTSTATUS)0xC0000355) -#define STATUS_AUDITING_DISABLED ((NTSTATUS)0xC0000356) -#define STATUS_PRENT4_MACHINE_ACCOUNT ((NTSTATUS)0xC0000357) -#define STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER ((NTSTATUS)0xC0000358) -#define STATUS_INVALID_IMAGE_WIN_32 ((NTSTATUS)0xC0000359) -#define STATUS_INVALID_IMAGE_WIN_64 ((NTSTATUS)0xC000035A) -#define STATUS_BAD_BINDINGS ((NTSTATUS)0xC000035B) -#define STATUS_NETWORK_SESSION_EXPIRED ((NTSTATUS)0xC000035C) -#define STATUS_APPHELP_BLOCK ((NTSTATUS)0xC000035D) -#define STATUS_ALL_SIDS_FILTERED ((NTSTATUS)0xC000035E) -#define STATUS_NOT_SAFE_MODE_DRIVER ((NTSTATUS)0xC000035F) -#define STATUS_ACCESS_DISABLED_BY_POLICY_DEFAULT ((NTSTATUS)0xC0000361) -#define STATUS_ACCESS_DISABLED_BY_POLICY_PATH ((NTSTATUS)0xC0000362) -#define STATUS_ACCESS_DISABLED_BY_POLICY_PUBLISHER ((NTSTATUS)0xC0000363) -#define STATUS_ACCESS_DISABLED_BY_POLICY_OTHER ((NTSTATUS)0xC0000364) -#define STATUS_FAILED_DRIVER_ENTRY ((NTSTATUS)0xC0000365) -#define STATUS_DEVICE_ENUMERATION_ERROR ((NTSTATUS)0xC0000366) -#define STATUS_WAIT_FOR_OPLOCK ((NTSTATUS)0x00000367) -#define STATUS_MOUNT_POINT_NOT_RESOLVED ((NTSTATUS)0xC0000368) -#define STATUS_INVALID_DEVICE_OBJECT_PARAMETER ((NTSTATUS)0xC0000369) +#define STATUS_TRANSPORT_FULL ((NTSTATUS)0xC00002CA) +#define STATUS_DS_SAM_INIT_FAILURE ((NTSTATUS)0xC00002CB) +#define STATUS_ONLY_IF_CONNECTED ((NTSTATUS)0xC00002CC) +#define STATUS_DS_SENSITIVE_GROUP_VIOLATION ((NTSTATUS)0xC00002CD) +#define STATUS_PNP_RESTART_ENUMERATION ((NTSTATUS)0xC00002CE) +#define STATUS_JOURNAL_ENTRY_DELETED ((NTSTATUS)0xC00002CF) +#define STATUS_DS_CANT_MOD_PRIMARYGROUPID ((NTSTATUS)0xC00002D0) +#define STATUS_SYSTEM_IMAGE_BAD_SIGNATURE ((NTSTATUS)0xC00002D1) +#define STATUS_PNP_REBOOT_REQUIRED ((NTSTATUS)0xC00002D2) +#define STATUS_POWER_STATE_INVALID ((NTSTATUS)0xC00002D3) +#define STATUS_DS_INVALID_GROUP_TYPE ((NTSTATUS)0xC00002D4) +#define STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN ((NTSTATUS)0xC00002D5) +#define STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN ((NTSTATUS)0xC00002D6) +#define STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER ((NTSTATUS)0xC00002D7) +#define STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER ((NTSTATUS)0xC00002D8) +#define STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER ((NTSTATUS)0xC00002D9) +#define STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER ((NTSTATUS)0xC00002DA) +#define STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER ((NTSTATUS)0xC00002DB) +#define STATUS_DS_HAVE_PRIMARY_MEMBERS ((NTSTATUS)0xC00002DC) +#define STATUS_WMI_NOT_SUPPORTED ((NTSTATUS)0xC00002DD) +#define STATUS_INSUFFICIENT_POWER ((NTSTATUS)0xC00002DE) +#define STATUS_SAM_NEED_BOOTKEY_PASSWORD ((NTSTATUS)0xC00002DF) +#define STATUS_SAM_NEED_BOOTKEY_FLOPPY ((NTSTATUS)0xC00002E0) +#define STATUS_DS_CANT_START ((NTSTATUS)0xC00002E1) +#define STATUS_DS_INIT_FAILURE ((NTSTATUS)0xC00002E2) +#define STATUS_SAM_INIT_FAILURE ((NTSTATUS)0xC00002E3) +#define STATUS_DS_GC_REQUIRED ((NTSTATUS)0xC00002E4) +#define STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY ((NTSTATUS)0xC00002E5) +#define STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS ((NTSTATUS)0xC00002E6) +#define STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED ((NTSTATUS)0xC00002E7) +#define STATUS_MULTIPLE_FAULT_VIOLATION ((NTSTATUS)0xC00002E8) +#define STATUS_CURRENT_DOMAIN_NOT_ALLOWED ((NTSTATUS)0xC00002E9) +#define STATUS_CANNOT_MAKE ((NTSTATUS)0xC00002EA) +#define STATUS_SYSTEM_SHUTDOWN ((NTSTATUS)0xC00002EB) +#define STATUS_DS_INIT_FAILURE_CONSOLE ((NTSTATUS)0xC00002EC) +#define STATUS_DS_SAM_INIT_FAILURE_CONSOLE ((NTSTATUS)0xC00002ED) +#define STATUS_UNFINISHED_CONTEXT_DELETED ((NTSTATUS)0xC00002EE) +#define STATUS_NO_TGT_REPLY ((NTSTATUS)0xC00002EF) +#define STATUS_OBJECTID_NOT_FOUND ((NTSTATUS)0xC00002F0) +#define STATUS_NO_IP_ADDRESSES ((NTSTATUS)0xC00002F1) +#define STATUS_WRONG_CREDENTIAL_HANDLE ((NTSTATUS)0xC00002F2) +#define STATUS_CRYPTO_SYSTEM_INVALID ((NTSTATUS)0xC00002F3) +#define STATUS_MAX_REFERRALS_EXCEEDED ((NTSTATUS)0xC00002F4) +#define STATUS_MUST_BE_KDC ((NTSTATUS)0xC00002F5) +#define STATUS_STRONG_CRYPTO_NOT_SUPPORTED ((NTSTATUS)0xC00002F6) +#define STATUS_TOO_MANY_PRINCIPALS ((NTSTATUS)0xC00002F7) +#define STATUS_NO_PA_DATA ((NTSTATUS)0xC00002F8) +#define STATUS_PKINIT_NAME_MISMATCH ((NTSTATUS)0xC00002F9) +#define STATUS_SMARTCARD_LOGON_REQUIRED ((NTSTATUS)0xC00002FA) +#define STATUS_KDC_INVALID_REQUEST ((NTSTATUS)0xC00002FB) +#define STATUS_KDC_UNABLE_TO_REFER ((NTSTATUS)0xC00002FC) +#define STATUS_KDC_UNKNOWN_ETYPE ((NTSTATUS)0xC00002FD) +#define STATUS_SHUTDOWN_IN_PROGRESS ((NTSTATUS)0xC00002FE) +#define STATUS_SERVER_SHUTDOWN_IN_PROGRESS ((NTSTATUS)0xC00002FF) +#define STATUS_NOT_SUPPORTED_ON_SBS ((NTSTATUS)0xC0000300) +#define STATUS_WMI_GUID_DISCONNECTED ((NTSTATUS)0xC0000301) +#define STATUS_WMI_ALREADY_DISABLED ((NTSTATUS)0xC0000302) +#define STATUS_WMI_ALREADY_ENABLED ((NTSTATUS)0xC0000303) +#define STATUS_MFT_TOO_FRAGMENTED ((NTSTATUS)0xC0000304) +#define STATUS_COPY_PROTECTION_FAILURE ((NTSTATUS)0xC0000305) +#define STATUS_CSS_AUTHENTICATION_FAILURE ((NTSTATUS)0xC0000306) +#define STATUS_CSS_KEY_NOT_PRESENT ((NTSTATUS)0xC0000307) +#define STATUS_CSS_KEY_NOT_ESTABLISHED ((NTSTATUS)0xC0000308) +#define STATUS_CSS_SCRAMBLED_SECTOR ((NTSTATUS)0xC0000309) +#define STATUS_CSS_REGION_MISMATCH ((NTSTATUS)0xC000030A) +#define STATUS_CSS_RESETS_EXHAUSTED ((NTSTATUS)0xC000030B) +#define STATUS_PKINIT_FAILURE ((NTSTATUS)0xC0000320) +#define STATUS_SMARTCARD_SUBSYSTEM_FAILURE ((NTSTATUS)0xC0000321) +#define STATUS_NO_KERB_KEY ((NTSTATUS)0xC0000322) +#define STATUS_HOST_DOWN ((NTSTATUS)0xC0000350) +#define STATUS_UNSUPPORTED_PREAUTH ((NTSTATUS)0xC0000351) +#define STATUS_EFS_ALG_BLOB_TOO_BIG ((NTSTATUS)0xC0000352) +#define STATUS_PORT_NOT_SET ((NTSTATUS)0xC0000353) +#define STATUS_DEBUGGER_INACTIVE ((NTSTATUS)0xC0000354) +#define STATUS_DS_VERSION_CHECK_FAILURE ((NTSTATUS)0xC0000355) +#define STATUS_AUDITING_DISABLED ((NTSTATUS)0xC0000356) +#define STATUS_PRENT4_MACHINE_ACCOUNT ((NTSTATUS)0xC0000357) +#define STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER ((NTSTATUS)0xC0000358) +#define STATUS_INVALID_IMAGE_WIN_32 ((NTSTATUS)0xC0000359) +#define STATUS_INVALID_IMAGE_WIN_64 ((NTSTATUS)0xC000035A) +#define STATUS_BAD_BINDINGS ((NTSTATUS)0xC000035B) +#define STATUS_NETWORK_SESSION_EXPIRED ((NTSTATUS)0xC000035C) +#define STATUS_APPHELP_BLOCK ((NTSTATUS)0xC000035D) +#define STATUS_ALL_SIDS_FILTERED ((NTSTATUS)0xC000035E) +#define STATUS_NOT_SAFE_MODE_DRIVER ((NTSTATUS)0xC000035F) +#define STATUS_ACCESS_DISABLED_BY_POLICY_DEFAULT ((NTSTATUS)0xC0000361) +#define STATUS_ACCESS_DISABLED_BY_POLICY_PATH ((NTSTATUS)0xC0000362) +#define STATUS_ACCESS_DISABLED_BY_POLICY_PUBLISHER ((NTSTATUS)0xC0000363) +#define STATUS_ACCESS_DISABLED_BY_POLICY_OTHER ((NTSTATUS)0xC0000364) +#define STATUS_FAILED_DRIVER_ENTRY ((NTSTATUS)0xC0000365) +#define STATUS_DEVICE_ENUMERATION_ERROR ((NTSTATUS)0xC0000366) +#define STATUS_WAIT_FOR_OPLOCK ((NTSTATUS)0x00000367) +#define STATUS_MOUNT_POINT_NOT_RESOLVED ((NTSTATUS)0xC0000368) +#define STATUS_INVALID_DEVICE_OBJECT_PARAMETER ((NTSTATUS)0xC0000369) /* The following is not a typo. It's the same spelling as in the Microsoft headers */ -#define STATUS_MCA_OCCURED ((NTSTATUS)0xC000036A) -#define STATUS_DRIVER_BLOCKED_CRITICAL ((NTSTATUS)0xC000036B) -#define STATUS_DRIVER_BLOCKED ((NTSTATUS)0xC000036C) -#define STATUS_DRIVER_DATABASE_ERROR ((NTSTATUS)0xC000036D) -#define STATUS_SYSTEM_HIVE_TOO_LARGE ((NTSTATUS)0xC000036E) -#define STATUS_INVALID_IMPORT_OF_NON_DLL ((NTSTATUS)0xC000036F) -#define STATUS_SMARTCARD_WRONG_PIN ((NTSTATUS)0xC0000380) -#define STATUS_SMARTCARD_CARD_BLOCKED ((NTSTATUS)0xC0000381) -#define STATUS_SMARTCARD_CARD_NOT_AUTHENTICATED ((NTSTATUS)0xC0000382) -#define STATUS_SMARTCARD_NO_CARD ((NTSTATUS)0xC0000383) -#define STATUS_SMARTCARD_NO_KEY_CONTAINER ((NTSTATUS)0xC0000384) -#define STATUS_SMARTCARD_NO_CERTIFICATE ((NTSTATUS)0xC0000385) -#define STATUS_SMARTCARD_NO_KEYSET ((NTSTATUS)0xC0000386) -#define STATUS_SMARTCARD_IO_ERROR ((NTSTATUS)0xC0000387) +#define STATUS_MCA_OCCURED ((NTSTATUS)0xC000036A) +#define STATUS_DRIVER_BLOCKED_CRITICAL ((NTSTATUS)0xC000036B) +#define STATUS_DRIVER_BLOCKED ((NTSTATUS)0xC000036C) +#define STATUS_DRIVER_DATABASE_ERROR ((NTSTATUS)0xC000036D) +#define STATUS_SYSTEM_HIVE_TOO_LARGE ((NTSTATUS)0xC000036E) +#define STATUS_INVALID_IMPORT_OF_NON_DLL ((NTSTATUS)0xC000036F) +#define STATUS_SMARTCARD_WRONG_PIN ((NTSTATUS)0xC0000380) +#define STATUS_SMARTCARD_CARD_BLOCKED ((NTSTATUS)0xC0000381) +#define STATUS_SMARTCARD_CARD_NOT_AUTHENTICATED ((NTSTATUS)0xC0000382) +#define STATUS_SMARTCARD_NO_CARD ((NTSTATUS)0xC0000383) +#define STATUS_SMARTCARD_NO_KEY_CONTAINER ((NTSTATUS)0xC0000384) +#define STATUS_SMARTCARD_NO_CERTIFICATE ((NTSTATUS)0xC0000385) +#define STATUS_SMARTCARD_NO_KEYSET ((NTSTATUS)0xC0000386) +#define STATUS_SMARTCARD_IO_ERROR ((NTSTATUS)0xC0000387) //#define STATUS_DOWNGRADE_DETECTED ((NTSTATUS)0xC0000388) -#define STATUS_SMARTCARD_CERT_REVOKED ((NTSTATUS)0xC0000389) -#define STATUS_ISSUING_CA_UNTRUSTED ((NTSTATUS)0xC000038A) -#define STATUS_REVOCATION_OFFLINE_C ((NTSTATUS)0xC000038B) -#define STATUS_PKINIT_CLIENT_FAILURE ((NTSTATUS)0xC000038C) -#define STATUS_SMARTCARD_CERT_EXPIRED ((NTSTATUS)0xC000038D) -#define STATUS_DRIVER_FAILED_PRIOR_UNLOAD ((NTSTATUS)0xC000038E) -#define STATUS_SMARTCARD_SILENT_CONTEXT ((NTSTATUS)0xC000038F) -#define STATUS_PER_USER_TRUST_QUOTA_EXCEEDED ((NTSTATUS)0xC0000401) -#define STATUS_ALL_USER_TRUST_QUOTA_EXCEEDED ((NTSTATUS)0xC0000402) -#define STATUS_USER_DELETE_TRUST_QUOTA_EXCEEDED ((NTSTATUS)0xC0000403) -#define STATUS_DS_NAME_NOT_UNIQUE ((NTSTATUS)0xC0000404) -#define STATUS_DS_DUPLICATE_ID_FOUND ((NTSTATUS)0xC0000405) -#define STATUS_DS_GROUP_CONVERSION_ERROR ((NTSTATUS)0xC0000406) -#define STATUS_VOLSNAP_PREPARE_HIBERNATE ((NTSTATUS)0xC0000407) -#define STATUS_USER2USER_REQUIRED ((NTSTATUS)0xC0000408) +#define STATUS_SMARTCARD_CERT_REVOKED ((NTSTATUS)0xC0000389) +#define STATUS_ISSUING_CA_UNTRUSTED ((NTSTATUS)0xC000038A) +#define STATUS_REVOCATION_OFFLINE_C ((NTSTATUS)0xC000038B) +#define STATUS_PKINIT_CLIENT_FAILURE ((NTSTATUS)0xC000038C) +#define STATUS_SMARTCARD_CERT_EXPIRED ((NTSTATUS)0xC000038D) +#define STATUS_DRIVER_FAILED_PRIOR_UNLOAD ((NTSTATUS)0xC000038E) +#define STATUS_SMARTCARD_SILENT_CONTEXT ((NTSTATUS)0xC000038F) +#define STATUS_PER_USER_TRUST_QUOTA_EXCEEDED ((NTSTATUS)0xC0000401) +#define STATUS_ALL_USER_TRUST_QUOTA_EXCEEDED ((NTSTATUS)0xC0000402) +#define STATUS_USER_DELETE_TRUST_QUOTA_EXCEEDED ((NTSTATUS)0xC0000403) +#define STATUS_DS_NAME_NOT_UNIQUE ((NTSTATUS)0xC0000404) +#define STATUS_DS_DUPLICATE_ID_FOUND ((NTSTATUS)0xC0000405) +#define STATUS_DS_GROUP_CONVERSION_ERROR ((NTSTATUS)0xC0000406) +#define STATUS_VOLSNAP_PREPARE_HIBERNATE ((NTSTATUS)0xC0000407) +#define STATUS_USER2USER_REQUIRED ((NTSTATUS)0xC0000408) //#define STATUS_STACK_BUFFER_OVERRUN ((NTSTATUS)0xC0000409) -#define STATUS_NO_S4U_PROT_SUPPORT ((NTSTATUS)0xC000040A) -#define STATUS_CROSSREALM_DELEGATION_FAILURE ((NTSTATUS)0xC000040B) -#define STATUS_REVOCATION_OFFLINE_KDC ((NTSTATUS)0xC000040C) -#define STATUS_ISSUING_CA_UNTRUSTED_KDC ((NTSTATUS)0xC000040D) -#define STATUS_KDC_CERT_EXPIRED ((NTSTATUS)0xC000040E) -#define STATUS_KDC_CERT_REVOKED ((NTSTATUS)0xC000040F) -#define STATUS_PARAMETER_QUOTA_EXCEEDED ((NTSTATUS)0xC0000410) -#define STATUS_HIBERNATION_FAILURE ((NTSTATUS)0xC0000411) -#define STATUS_DELAY_LOAD_FAILED ((NTSTATUS)0xC0000412) +#define STATUS_NO_S4U_PROT_SUPPORT ((NTSTATUS)0xC000040A) +#define STATUS_CROSSREALM_DELEGATION_FAILURE ((NTSTATUS)0xC000040B) +#define STATUS_REVOCATION_OFFLINE_KDC ((NTSTATUS)0xC000040C) +#define STATUS_ISSUING_CA_UNTRUSTED_KDC ((NTSTATUS)0xC000040D) +#define STATUS_KDC_CERT_EXPIRED ((NTSTATUS)0xC000040E) +#define STATUS_KDC_CERT_REVOKED ((NTSTATUS)0xC000040F) +#define STATUS_PARAMETER_QUOTA_EXCEEDED ((NTSTATUS)0xC0000410) +#define STATUS_HIBERNATION_FAILURE ((NTSTATUS)0xC0000411) +#define STATUS_DELAY_LOAD_FAILED ((NTSTATUS)0xC0000412) //#define STATUS_AUTHENTICATION_FIREWALL_FAILED ((NTSTATUS)0xC0000413) -#define STATUS_VDM_DISALLOWED ((NTSTATUS)0xC0000414) -#define STATUS_HUNG_DISPLAY_DRIVER_THREAD ((NTSTATUS)0xC0000415) +#define STATUS_VDM_DISALLOWED ((NTSTATUS)0xC0000414) +#define STATUS_HUNG_DISPLAY_DRIVER_THREAD ((NTSTATUS)0xC0000415) //#define STATUS_INVALID_CRUNTIME_PARAMETER ((NTSTATUS)0xC0000417) //#define STATUS_ASSERTION_FAILURE ((NTSTATUS)0xC0000420L) -#define STATUS_CALLBACK_POP_STACK ((NTSTATUS)0xC0000423) -#define STATUS_WOW_ASSERTION ((NTSTATUS)0xC0009898) +#define STATUS_CALLBACK_POP_STACK ((NTSTATUS)0xC0000423) +#define STATUS_WOW_ASSERTION ((NTSTATUS)0xC0009898) -#define RPC_NT_INVALID_STRING_BINDING ((NTSTATUS)0xC0020001) -#define RPC_NT_WRONG_KIND_OF_BINDING ((NTSTATUS)0xC0020002) -#define RPC_NT_INVALID_BINDING ((NTSTATUS)0xC0020003) -#define RPC_NT_PROTSEQ_NOT_SUPPORTED ((NTSTATUS)0xC0020004) -#define RPC_NT_INVALID_RPC_PROTSEQ ((NTSTATUS)0xC0020005) -#define RPC_NT_INVALID_STRING_UUID ((NTSTATUS)0xC0020006) -#define RPC_NT_INVALID_ENDPOINT_FORMAT ((NTSTATUS)0xC0020007) -#define RPC_NT_INVALID_NET_ADDR ((NTSTATUS)0xC0020008) -#define RPC_NT_NO_ENDPOINT_FOUND ((NTSTATUS)0xC0020009) -#define RPC_NT_INVALID_TIMEOUT ((NTSTATUS)0xC002000A) -#define RPC_NT_OBJECT_NOT_FOUND ((NTSTATUS)0xC002000B) -#define RPC_NT_ALREADY_REGISTERED ((NTSTATUS)0xC002000C) -#define RPC_NT_TYPE_ALREADY_REGISTERED ((NTSTATUS)0xC002000D) -#define RPC_NT_ALREADY_LISTENING ((NTSTATUS)0xC002000E) -#define RPC_NT_NO_PROTSEQS_REGISTERED ((NTSTATUS)0xC002000F) -#define RPC_NT_NOT_LISTENING ((NTSTATUS)0xC0020010) -#define RPC_NT_UNKNOWN_MGR_TYPE ((NTSTATUS)0xC0020011) -#define RPC_NT_UNKNOWN_IF ((NTSTATUS)0xC0020012) -#define RPC_NT_NO_BINDINGS ((NTSTATUS)0xC0020013) -#define RPC_NT_NO_PROTSEQS ((NTSTATUS)0xC0020014) -#define RPC_NT_CANT_CREATE_ENDPOINT ((NTSTATUS)0xC0020015) -#define RPC_NT_OUT_OF_RESOURCES ((NTSTATUS)0xC0020016) -#define RPC_NT_SERVER_UNAVAILABLE ((NTSTATUS)0xC0020017) -#define RPC_NT_SERVER_TOO_BUSY ((NTSTATUS)0xC0020018) -#define RPC_NT_INVALID_NETWORK_OPTIONS ((NTSTATUS)0xC0020019) -#define RPC_NT_NO_CALL_ACTIVE ((NTSTATUS)0xC002001A) -#define RPC_NT_CALL_FAILED ((NTSTATUS)0xC002001B) -#define RPC_NT_CALL_FAILED_DNE ((NTSTATUS)0xC002001C) -#define RPC_NT_PROTOCOL_ERROR ((NTSTATUS)0xC002001D) -#define RPC_NT_UNSUPPORTED_TRANS_SYN ((NTSTATUS)0xC002001F) -#define RPC_NT_UNSUPPORTED_TYPE ((NTSTATUS)0xC0020021) -#define RPC_NT_INVALID_TAG ((NTSTATUS)0xC0020022) -#define RPC_NT_INVALID_BOUND ((NTSTATUS)0xC0020023) -#define RPC_NT_NO_ENTRY_NAME ((NTSTATUS)0xC0020024) -#define RPC_NT_INVALID_NAME_SYNTAX ((NTSTATUS)0xC0020025) -#define RPC_NT_UNSUPPORTED_NAME_SYNTAX ((NTSTATUS)0xC0020026) -#define RPC_NT_UUID_NO_ADDRESS ((NTSTATUS)0xC0020028) -#define RPC_NT_DUPLICATE_ENDPOINT ((NTSTATUS)0xC0020029) -#define RPC_NT_UNKNOWN_AUTHN_TYPE ((NTSTATUS)0xC002002A) -#define RPC_NT_MAX_CALLS_TOO_SMALL ((NTSTATUS)0xC002002B) -#define RPC_NT_STRING_TOO_LONG ((NTSTATUS)0xC002002C) -#define RPC_NT_PROTSEQ_NOT_FOUND ((NTSTATUS)0xC002002D) -#define RPC_NT_PROCNUM_OUT_OF_RANGE ((NTSTATUS)0xC002002E) -#define RPC_NT_BINDING_HAS_NO_AUTH ((NTSTATUS)0xC002002F) -#define RPC_NT_UNKNOWN_AUTHN_SERVICE ((NTSTATUS)0xC0020030) -#define RPC_NT_UNKNOWN_AUTHN_LEVEL ((NTSTATUS)0xC0020031) -#define RPC_NT_INVALID_AUTH_IDENTITY ((NTSTATUS)0xC0020032) -#define RPC_NT_UNKNOWN_AUTHZ_SERVICE ((NTSTATUS)0xC0020033) -#define EPT_NT_INVALID_ENTRY ((NTSTATUS)0xC0020034) -#define EPT_NT_CANT_PERFORM_OP ((NTSTATUS)0xC0020035) -#define EPT_NT_NOT_REGISTERED ((NTSTATUS)0xC0020036) -#define RPC_NT_NOTHING_TO_EXPORT ((NTSTATUS)0xC0020037) -#define RPC_NT_INCOMPLETE_NAME ((NTSTATUS)0xC0020038) -#define RPC_NT_INVALID_VERS_OPTION ((NTSTATUS)0xC0020039) -#define RPC_NT_NO_MORE_MEMBERS ((NTSTATUS)0xC002003A) -#define RPC_NT_NOT_ALL_OBJS_UNEXPORTED ((NTSTATUS)0xC002003B) -#define RPC_NT_INTERFACE_NOT_FOUND ((NTSTATUS)0xC002003C) -#define RPC_NT_ENTRY_ALREADY_EXISTS ((NTSTATUS)0xC002003D) -#define RPC_NT_ENTRY_NOT_FOUND ((NTSTATUS)0xC002003E) -#define RPC_NT_NAME_SERVICE_UNAVAILABLE ((NTSTATUS)0xC002003F) -#define RPC_NT_INVALID_NAF_ID ((NTSTATUS)0xC0020040) -#define RPC_NT_CANNOT_SUPPORT ((NTSTATUS)0xC0020041) -#define RPC_NT_NO_CONTEXT_AVAILABLE ((NTSTATUS)0xC0020042) -#define RPC_NT_INTERNAL_ERROR ((NTSTATUS)0xC0020043) -#define RPC_NT_ZERO_DIVIDE ((NTSTATUS)0xC0020044) -#define RPC_NT_ADDRESS_ERROR ((NTSTATUS)0xC0020045) -#define RPC_NT_FP_DIV_ZERO ((NTSTATUS)0xC0020046) -#define RPC_NT_FP_UNDERFLOW ((NTSTATUS)0xC0020047) -#define RPC_NT_FP_OVERFLOW ((NTSTATUS)0xC0020048) -#define RPC_NT_CALL_IN_PROGRESS ((NTSTATUS)0xC0020049) -#define RPC_NT_NO_MORE_BINDINGS ((NTSTATUS)0xC002004A) -#define RPC_NT_GROUP_MEMBER_NOT_FOUND ((NTSTATUS)0xC002004B) -#define EPT_NT_CANT_CREATE ((NTSTATUS)0xC002004C) -#define RPC_NT_INVALID_OBJECT ((NTSTATUS)0xC002004D) -#define RPC_NT_NO_INTERFACES ((NTSTATUS)0xC002004F) -#define RPC_NT_CALL_CANCELLED ((NTSTATUS)0xC0020050) -#define RPC_NT_BINDING_INCOMPLETE ((NTSTATUS)0xC0020051) -#define RPC_NT_COMM_FAILURE ((NTSTATUS)0xC0020052) -#define RPC_NT_UNSUPPORTED_AUTHN_LEVEL ((NTSTATUS)0xC0020053) -#define RPC_NT_NO_PRINC_NAME ((NTSTATUS)0xC0020054) -#define RPC_NT_NOT_RPC_ERROR ((NTSTATUS)0xC0020055) -#define RPC_NT_SEC_PKG_ERROR ((NTSTATUS)0xC0020057) -#define RPC_NT_NOT_CANCELLED ((NTSTATUS)0xC0020058) -#define RPC_NT_INVALID_ASYNC_HANDLE ((NTSTATUS)0xC0020062) -#define RPC_NT_INVALID_ASYNC_CALL ((NTSTATUS)0xC0020063) +#define RPC_NT_INVALID_STRING_BINDING ((NTSTATUS)0xC0020001) +#define RPC_NT_WRONG_KIND_OF_BINDING ((NTSTATUS)0xC0020002) +#define RPC_NT_INVALID_BINDING ((NTSTATUS)0xC0020003) +#define RPC_NT_PROTSEQ_NOT_SUPPORTED ((NTSTATUS)0xC0020004) +#define RPC_NT_INVALID_RPC_PROTSEQ ((NTSTATUS)0xC0020005) +#define RPC_NT_INVALID_STRING_UUID ((NTSTATUS)0xC0020006) +#define RPC_NT_INVALID_ENDPOINT_FORMAT ((NTSTATUS)0xC0020007) +#define RPC_NT_INVALID_NET_ADDR ((NTSTATUS)0xC0020008) +#define RPC_NT_NO_ENDPOINT_FOUND ((NTSTATUS)0xC0020009) +#define RPC_NT_INVALID_TIMEOUT ((NTSTATUS)0xC002000A) +#define RPC_NT_OBJECT_NOT_FOUND ((NTSTATUS)0xC002000B) +#define RPC_NT_ALREADY_REGISTERED ((NTSTATUS)0xC002000C) +#define RPC_NT_TYPE_ALREADY_REGISTERED ((NTSTATUS)0xC002000D) +#define RPC_NT_ALREADY_LISTENING ((NTSTATUS)0xC002000E) +#define RPC_NT_NO_PROTSEQS_REGISTERED ((NTSTATUS)0xC002000F) +#define RPC_NT_NOT_LISTENING ((NTSTATUS)0xC0020010) +#define RPC_NT_UNKNOWN_MGR_TYPE ((NTSTATUS)0xC0020011) +#define RPC_NT_UNKNOWN_IF ((NTSTATUS)0xC0020012) +#define RPC_NT_NO_BINDINGS ((NTSTATUS)0xC0020013) +#define RPC_NT_NO_PROTSEQS ((NTSTATUS)0xC0020014) +#define RPC_NT_CANT_CREATE_ENDPOINT ((NTSTATUS)0xC0020015) +#define RPC_NT_OUT_OF_RESOURCES ((NTSTATUS)0xC0020016) +#define RPC_NT_SERVER_UNAVAILABLE ((NTSTATUS)0xC0020017) +#define RPC_NT_SERVER_TOO_BUSY ((NTSTATUS)0xC0020018) +#define RPC_NT_INVALID_NETWORK_OPTIONS ((NTSTATUS)0xC0020019) +#define RPC_NT_NO_CALL_ACTIVE ((NTSTATUS)0xC002001A) +#define RPC_NT_CALL_FAILED ((NTSTATUS)0xC002001B) +#define RPC_NT_CALL_FAILED_DNE ((NTSTATUS)0xC002001C) +#define RPC_NT_PROTOCOL_ERROR ((NTSTATUS)0xC002001D) +#define RPC_NT_UNSUPPORTED_TRANS_SYN ((NTSTATUS)0xC002001F) +#define RPC_NT_UNSUPPORTED_TYPE ((NTSTATUS)0xC0020021) +#define RPC_NT_INVALID_TAG ((NTSTATUS)0xC0020022) +#define RPC_NT_INVALID_BOUND ((NTSTATUS)0xC0020023) +#define RPC_NT_NO_ENTRY_NAME ((NTSTATUS)0xC0020024) +#define RPC_NT_INVALID_NAME_SYNTAX ((NTSTATUS)0xC0020025) +#define RPC_NT_UNSUPPORTED_NAME_SYNTAX ((NTSTATUS)0xC0020026) +#define RPC_NT_UUID_NO_ADDRESS ((NTSTATUS)0xC0020028) +#define RPC_NT_DUPLICATE_ENDPOINT ((NTSTATUS)0xC0020029) +#define RPC_NT_UNKNOWN_AUTHN_TYPE ((NTSTATUS)0xC002002A) +#define RPC_NT_MAX_CALLS_TOO_SMALL ((NTSTATUS)0xC002002B) +#define RPC_NT_STRING_TOO_LONG ((NTSTATUS)0xC002002C) +#define RPC_NT_PROTSEQ_NOT_FOUND ((NTSTATUS)0xC002002D) +#define RPC_NT_PROCNUM_OUT_OF_RANGE ((NTSTATUS)0xC002002E) +#define RPC_NT_BINDING_HAS_NO_AUTH ((NTSTATUS)0xC002002F) +#define RPC_NT_UNKNOWN_AUTHN_SERVICE ((NTSTATUS)0xC0020030) +#define RPC_NT_UNKNOWN_AUTHN_LEVEL ((NTSTATUS)0xC0020031) +#define RPC_NT_INVALID_AUTH_IDENTITY ((NTSTATUS)0xC0020032) +#define RPC_NT_UNKNOWN_AUTHZ_SERVICE ((NTSTATUS)0xC0020033) +#define EPT_NT_INVALID_ENTRY ((NTSTATUS)0xC0020034) +#define EPT_NT_CANT_PERFORM_OP ((NTSTATUS)0xC0020035) +#define EPT_NT_NOT_REGISTERED ((NTSTATUS)0xC0020036) +#define RPC_NT_NOTHING_TO_EXPORT ((NTSTATUS)0xC0020037) +#define RPC_NT_INCOMPLETE_NAME ((NTSTATUS)0xC0020038) +#define RPC_NT_INVALID_VERS_OPTION ((NTSTATUS)0xC0020039) +#define RPC_NT_NO_MORE_MEMBERS ((NTSTATUS)0xC002003A) +#define RPC_NT_NOT_ALL_OBJS_UNEXPORTED ((NTSTATUS)0xC002003B) +#define RPC_NT_INTERFACE_NOT_FOUND ((NTSTATUS)0xC002003C) +#define RPC_NT_ENTRY_ALREADY_EXISTS ((NTSTATUS)0xC002003D) +#define RPC_NT_ENTRY_NOT_FOUND ((NTSTATUS)0xC002003E) +#define RPC_NT_NAME_SERVICE_UNAVAILABLE ((NTSTATUS)0xC002003F) +#define RPC_NT_INVALID_NAF_ID ((NTSTATUS)0xC0020040) +#define RPC_NT_CANNOT_SUPPORT ((NTSTATUS)0xC0020041) +#define RPC_NT_NO_CONTEXT_AVAILABLE ((NTSTATUS)0xC0020042) +#define RPC_NT_INTERNAL_ERROR ((NTSTATUS)0xC0020043) +#define RPC_NT_ZERO_DIVIDE ((NTSTATUS)0xC0020044) +#define RPC_NT_ADDRESS_ERROR ((NTSTATUS)0xC0020045) +#define RPC_NT_FP_DIV_ZERO ((NTSTATUS)0xC0020046) +#define RPC_NT_FP_UNDERFLOW ((NTSTATUS)0xC0020047) +#define RPC_NT_FP_OVERFLOW ((NTSTATUS)0xC0020048) +#define RPC_NT_CALL_IN_PROGRESS ((NTSTATUS)0xC0020049) +#define RPC_NT_NO_MORE_BINDINGS ((NTSTATUS)0xC002004A) +#define RPC_NT_GROUP_MEMBER_NOT_FOUND ((NTSTATUS)0xC002004B) +#define EPT_NT_CANT_CREATE ((NTSTATUS)0xC002004C) +#define RPC_NT_INVALID_OBJECT ((NTSTATUS)0xC002004D) +#define RPC_NT_NO_INTERFACES ((NTSTATUS)0xC002004F) +#define RPC_NT_CALL_CANCELLED ((NTSTATUS)0xC0020050) +#define RPC_NT_BINDING_INCOMPLETE ((NTSTATUS)0xC0020051) +#define RPC_NT_COMM_FAILURE ((NTSTATUS)0xC0020052) +#define RPC_NT_UNSUPPORTED_AUTHN_LEVEL ((NTSTATUS)0xC0020053) +#define RPC_NT_NO_PRINC_NAME ((NTSTATUS)0xC0020054) +#define RPC_NT_NOT_RPC_ERROR ((NTSTATUS)0xC0020055) +#define RPC_NT_SEC_PKG_ERROR ((NTSTATUS)0xC0020057) +#define RPC_NT_NOT_CANCELLED ((NTSTATUS)0xC0020058) +#define RPC_NT_INVALID_ASYNC_HANDLE ((NTSTATUS)0xC0020062) +#define RPC_NT_INVALID_ASYNC_CALL ((NTSTATUS)0xC0020063) -#define RPC_NT_NO_MORE_ENTRIES ((NTSTATUS)0xC0030001) -#define RPC_NT_SS_CHAR_TRANS_OPEN_FAIL ((NTSTATUS)0xC0030002) -#define RPC_NT_SS_CHAR_TRANS_SHORT_FILE ((NTSTATUS)0xC0030003) -#define RPC_NT_SS_IN_NULL_CONTEXT ((NTSTATUS)0xC0030004) -#define RPC_NT_SS_CONTEXT_MISMATCH ((NTSTATUS)0xC0030005) -#define RPC_NT_SS_CONTEXT_DAMAGED ((NTSTATUS)0xC0030006) -#define RPC_NT_SS_HANDLES_MISMATCH ((NTSTATUS)0xC0030007) -#define RPC_NT_SS_CANNOT_GET_CALL_HANDLE ((NTSTATUS)0xC0030008) -#define RPC_NT_NULL_REF_POINTER ((NTSTATUS)0xC0030009) -#define RPC_NT_ENUM_VALUE_OUT_OF_RANGE ((NTSTATUS)0xC003000A) -#define RPC_NT_BYTE_COUNT_TOO_SMALL ((NTSTATUS)0xC003000B) -#define RPC_NT_BAD_STUB_DATA ((NTSTATUS)0xC003000C) -#define RPC_NT_INVALID_ES_ACTION ((NTSTATUS)0xC0030059) -#define RPC_NT_WRONG_ES_VERSION ((NTSTATUS)0xC003005A) -#define RPC_NT_WRONG_STUB_VERSION ((NTSTATUS)0xC003005B) -#define RPC_NT_INVALID_PIPE_OBJECT ((NTSTATUS)0xC003005C) -#define RPC_NT_INVALID_PIPE_OPERATION ((NTSTATUS)0xC003005D) -#define RPC_NT_WRONG_PIPE_VERSION ((NTSTATUS)0xC003005E) -#define RPC_NT_PIPE_CLOSED ((NTSTATUS)0xC003005F) -#define RPC_NT_PIPE_DISCIPLINE_ERROR ((NTSTATUS)0xC0030060) -#define RPC_NT_PIPE_EMPTY ((NTSTATUS)0xC0030061) +#define RPC_NT_NO_MORE_ENTRIES ((NTSTATUS)0xC0030001) +#define RPC_NT_SS_CHAR_TRANS_OPEN_FAIL ((NTSTATUS)0xC0030002) +#define RPC_NT_SS_CHAR_TRANS_SHORT_FILE ((NTSTATUS)0xC0030003) +#define RPC_NT_SS_IN_NULL_CONTEXT ((NTSTATUS)0xC0030004) +#define RPC_NT_SS_CONTEXT_MISMATCH ((NTSTATUS)0xC0030005) +#define RPC_NT_SS_CONTEXT_DAMAGED ((NTSTATUS)0xC0030006) +#define RPC_NT_SS_HANDLES_MISMATCH ((NTSTATUS)0xC0030007) +#define RPC_NT_SS_CANNOT_GET_CALL_HANDLE ((NTSTATUS)0xC0030008) +#define RPC_NT_NULL_REF_POINTER ((NTSTATUS)0xC0030009) +#define RPC_NT_ENUM_VALUE_OUT_OF_RANGE ((NTSTATUS)0xC003000A) +#define RPC_NT_BYTE_COUNT_TOO_SMALL ((NTSTATUS)0xC003000B) +#define RPC_NT_BAD_STUB_DATA ((NTSTATUS)0xC003000C) +#define RPC_NT_INVALID_ES_ACTION ((NTSTATUS)0xC0030059) +#define RPC_NT_WRONG_ES_VERSION ((NTSTATUS)0xC003005A) +#define RPC_NT_WRONG_STUB_VERSION ((NTSTATUS)0xC003005B) +#define RPC_NT_INVALID_PIPE_OBJECT ((NTSTATUS)0xC003005C) +#define RPC_NT_INVALID_PIPE_OPERATION ((NTSTATUS)0xC003005D) +#define RPC_NT_WRONG_PIPE_VERSION ((NTSTATUS)0xC003005E) +#define RPC_NT_PIPE_CLOSED ((NTSTATUS)0xC003005F) +#define RPC_NT_PIPE_DISCIPLINE_ERROR ((NTSTATUS)0xC0030060) +#define RPC_NT_PIPE_EMPTY ((NTSTATUS)0xC0030061) -#define STATUS_PNP_BAD_MPS_TABLE ((NTSTATUS)0xC0040035) -#define STATUS_PNP_TRANSLATION_FAILED ((NTSTATUS)0xC0040036) -#define STATUS_PNP_IRQ_TRANSLATION_FAILED ((NTSTATUS)0xC0040037) -#define STATUS_PNP_INVALID_ID ((NTSTATUS)0xC0040038) +#define STATUS_PNP_BAD_MPS_TABLE ((NTSTATUS)0xC0040035) +#define STATUS_PNP_TRANSLATION_FAILED ((NTSTATUS)0xC0040036) +#define STATUS_PNP_IRQ_TRANSLATION_FAILED ((NTSTATUS)0xC0040037) +#define STATUS_PNP_INVALID_ID ((NTSTATUS)0xC0040038) -#define STATUS_ACPI_INVALID_OPCODE ((NTSTATUS)0xC0140001L) -#define STATUS_ACPI_STACK_OVERFLOW ((NTSTATUS)0xC0140002L) -#define STATUS_ACPI_ASSERT_FAILED ((NTSTATUS)0xC0140003L) -#define STATUS_ACPI_INVALID_INDEX ((NTSTATUS)0xC0140004L) -#define STATUS_ACPI_INVALID_ARGUMENT ((NTSTATUS)0xC0140005L) -#define STATUS_ACPI_FATAL ((NTSTATUS)0xC0140006L) -#define STATUS_ACPI_INVALID_SUPERNAME ((NTSTATUS)0xC0140007L) -#define STATUS_ACPI_INVALID_ARGTYPE ((NTSTATUS)0xC0140008L) -#define STATUS_ACPI_INVALID_OBJTYPE ((NTSTATUS)0xC0140009L) -#define STATUS_ACPI_INVALID_TARGETTYPE ((NTSTATUS)0xC014000AL) -#define STATUS_ACPI_INCORRECT_ARGUMENT_COUNT ((NTSTATUS)0xC014000BL) -#define STATUS_ACPI_ADDRESS_NOT_MAPPED ((NTSTATUS)0xC014000CL) -#define STATUS_ACPI_INVALID_EVENTTYPE ((NTSTATUS)0xC014000DL) -#define STATUS_ACPI_HANDLER_COLLISION ((NTSTATUS)0xC014000EL) -#define STATUS_ACPI_INVALID_DATA ((NTSTATUS)0xC014000FL) -#define STATUS_ACPI_INVALID_REGION ((NTSTATUS)0xC0140010L) -#define STATUS_ACPI_INVALID_ACCESS_SIZE ((NTSTATUS)0xC0140011L) -#define STATUS_ACPI_ACQUIRE_GLOBAL_LOCK ((NTSTATUS)0xC0140012L) -#define STATUS_ACPI_ALREADY_INITIALIZED ((NTSTATUS)0xC0140013L) -#define STATUS_ACPI_NOT_INITIALIZED ((NTSTATUS)0xC0140014L) -#define STATUS_ACPI_INVALID_MUTEX_LEVEL ((NTSTATUS)0xC0140015L) -#define STATUS_ACPI_MUTEX_NOT_OWNED ((NTSTATUS)0xC0140016L) -#define STATUS_ACPI_MUTEX_NOT_OWNER ((NTSTATUS)0xC0140017L) -#define STATUS_ACPI_RS_ACCESS ((NTSTATUS)0xC0140018L) -#define STATUS_ACPI_INVALID_TABLE ((NTSTATUS)0xC0140019L) -#define STATUS_ACPI_REG_HANDLER_FAILED ((NTSTATUS)0xC0140020L) -#define STATUS_ACPI_POWER_REQUEST_FAILED ((NTSTATUS)0xC0140021L) +#define STATUS_ACPI_INVALID_OPCODE ((NTSTATUS)0xC0140001L) +#define STATUS_ACPI_STACK_OVERFLOW ((NTSTATUS)0xC0140002L) +#define STATUS_ACPI_ASSERT_FAILED ((NTSTATUS)0xC0140003L) +#define STATUS_ACPI_INVALID_INDEX ((NTSTATUS)0xC0140004L) +#define STATUS_ACPI_INVALID_ARGUMENT ((NTSTATUS)0xC0140005L) +#define STATUS_ACPI_FATAL ((NTSTATUS)0xC0140006L) +#define STATUS_ACPI_INVALID_SUPERNAME ((NTSTATUS)0xC0140007L) +#define STATUS_ACPI_INVALID_ARGTYPE ((NTSTATUS)0xC0140008L) +#define STATUS_ACPI_INVALID_OBJTYPE ((NTSTATUS)0xC0140009L) +#define STATUS_ACPI_INVALID_TARGETTYPE ((NTSTATUS)0xC014000AL) +#define STATUS_ACPI_INCORRECT_ARGUMENT_COUNT ((NTSTATUS)0xC014000BL) +#define STATUS_ACPI_ADDRESS_NOT_MAPPED ((NTSTATUS)0xC014000CL) +#define STATUS_ACPI_INVALID_EVENTTYPE ((NTSTATUS)0xC014000DL) +#define STATUS_ACPI_HANDLER_COLLISION ((NTSTATUS)0xC014000EL) +#define STATUS_ACPI_INVALID_DATA ((NTSTATUS)0xC014000FL) +#define STATUS_ACPI_INVALID_REGION ((NTSTATUS)0xC0140010L) +#define STATUS_ACPI_INVALID_ACCESS_SIZE ((NTSTATUS)0xC0140011L) +#define STATUS_ACPI_ACQUIRE_GLOBAL_LOCK ((NTSTATUS)0xC0140012L) +#define STATUS_ACPI_ALREADY_INITIALIZED ((NTSTATUS)0xC0140013L) +#define STATUS_ACPI_NOT_INITIALIZED ((NTSTATUS)0xC0140014L) +#define STATUS_ACPI_INVALID_MUTEX_LEVEL ((NTSTATUS)0xC0140015L) +#define STATUS_ACPI_MUTEX_NOT_OWNED ((NTSTATUS)0xC0140016L) +#define STATUS_ACPI_MUTEX_NOT_OWNER ((NTSTATUS)0xC0140017L) +#define STATUS_ACPI_RS_ACCESS ((NTSTATUS)0xC0140018L) +#define STATUS_ACPI_INVALID_TABLE ((NTSTATUS)0xC0140019L) +#define STATUS_ACPI_REG_HANDLER_FAILED ((NTSTATUS)0xC0140020L) +#define STATUS_ACPI_POWER_REQUEST_FAILED ((NTSTATUS)0xC0140021L) -#define STATUS_CTX_WINSTATION_NAME_INVALID ((NTSTATUS)0xC00A0001) -#define STATUS_CTX_INVALID_PD ((NTSTATUS)0xC00A0002) -#define STATUS_CTX_PD_NOT_FOUND ((NTSTATUS)0xC00A0003) -#define STATUS_CTX_CLOSE_PENDING ((NTSTATUS)0xC00A0006) -#define STATUS_CTX_NO_OUTBUF ((NTSTATUS)0xC00A0007) -#define STATUS_CTX_MODEM_INF_NOT_FOUND ((NTSTATUS)0xC00A0008) -#define STATUS_CTX_INVALID_MODEMNAME ((NTSTATUS)0xC00A0009) -#define STATUS_CTX_RESPONSE_ERROR ((NTSTATUS)0xC00A000A) -#define STATUS_CTX_MODEM_RESPONSE_TIMEOUT ((NTSTATUS)0xC00A000B) -#define STATUS_CTX_MODEM_RESPONSE_NO_CARRIER ((NTSTATUS)0xC00A000C) -#define STATUS_CTX_MODEM_RESPONSE_NO_DIALTONE ((NTSTATUS)0xC00A000D) -#define STATUS_CTX_MODEM_RESPONSE_BUSY ((NTSTATUS)0xC00A000E) -#define STATUS_CTX_MODEM_RESPONSE_VOICE ((NTSTATUS)0xC00A000F) -#define STATUS_CTX_TD_ERROR ((NTSTATUS)0xC00A0010) -#define STATUS_CTX_LICENSE_CLIENT_INVALID ((NTSTATUS)0xC00A0012) -#define STATUS_CTX_LICENSE_NOT_AVAILABLE ((NTSTATUS)0xC00A0013) -#define STATUS_CTX_LICENSE_EXPIRED ((NTSTATUS)0xC00A0014) -#define STATUS_CTX_WINSTATION_NOT_FOUND ((NTSTATUS)0xC00A0015) -#define STATUS_CTX_WINSTATION_NAME_COLLISION ((NTSTATUS)0xC00A0016) -#define STATUS_CTX_WINSTATION_BUSY ((NTSTATUS)0xC00A0017) -#define STATUS_CTX_BAD_VIDEO_MODE ((NTSTATUS)0xC00A0018) -#define STATUS_CTX_GRAPHICS_INVALID ((NTSTATUS)0xC00A0022) -#define STATUS_CTX_NOT_CONSOLE ((NTSTATUS)0xC00A0024) -#define STATUS_CTX_CLIENT_QUERY_TIMEOUT ((NTSTATUS)0xC00A0026) -#define STATUS_CTX_CONSOLE_DISCONNECT ((NTSTATUS)0xC00A0027) -#define STATUS_CTX_CONSOLE_CONNECT ((NTSTATUS)0xC00A0028) -#define STATUS_CTX_SHADOW_DENIED ((NTSTATUS)0xC00A002A) -#define STATUS_CTX_WINSTATION_ACCESS_DENIED ((NTSTATUS)0xC00A002B) -#define STATUS_CTX_INVALID_WD ((NTSTATUS)0xC00A002E) -#define STATUS_CTX_WD_NOT_FOUND ((NTSTATUS)0xC00A002F) -#define STATUS_CTX_SHADOW_INVALID ((NTSTATUS)0xC00A0030) -#define STATUS_CTX_SHADOW_DISABLED ((NTSTATUS)0xC00A0031) -#define STATUS_RDP_PROTOCOL_ERROR ((NTSTATUS)0xC00A0032) -#define STATUS_CTX_CLIENT_LICENSE_NOT_SET ((NTSTATUS)0xC00A0033) -#define STATUS_CTX_CLIENT_LICENSE_IN_USE ((NTSTATUS)0xC00A0034) -#define STATUS_CTX_SHADOW_ENDED_BY_MODE_CHANGE ((NTSTATUS)0xC00A0035) -#define STATUS_CTX_SHADOW_NOT_RUNNING ((NTSTATUS)0xC00A0036) +#define STATUS_CTX_WINSTATION_NAME_INVALID ((NTSTATUS)0xC00A0001) +#define STATUS_CTX_INVALID_PD ((NTSTATUS)0xC00A0002) +#define STATUS_CTX_PD_NOT_FOUND ((NTSTATUS)0xC00A0003) +#define STATUS_CTX_CLOSE_PENDING ((NTSTATUS)0xC00A0006) +#define STATUS_CTX_NO_OUTBUF ((NTSTATUS)0xC00A0007) +#define STATUS_CTX_MODEM_INF_NOT_FOUND ((NTSTATUS)0xC00A0008) +#define STATUS_CTX_INVALID_MODEMNAME ((NTSTATUS)0xC00A0009) +#define STATUS_CTX_RESPONSE_ERROR ((NTSTATUS)0xC00A000A) +#define STATUS_CTX_MODEM_RESPONSE_TIMEOUT ((NTSTATUS)0xC00A000B) +#define STATUS_CTX_MODEM_RESPONSE_NO_CARRIER ((NTSTATUS)0xC00A000C) +#define STATUS_CTX_MODEM_RESPONSE_NO_DIALTONE ((NTSTATUS)0xC00A000D) +#define STATUS_CTX_MODEM_RESPONSE_BUSY ((NTSTATUS)0xC00A000E) +#define STATUS_CTX_MODEM_RESPONSE_VOICE ((NTSTATUS)0xC00A000F) +#define STATUS_CTX_TD_ERROR ((NTSTATUS)0xC00A0010) +#define STATUS_CTX_LICENSE_CLIENT_INVALID ((NTSTATUS)0xC00A0012) +#define STATUS_CTX_LICENSE_NOT_AVAILABLE ((NTSTATUS)0xC00A0013) +#define STATUS_CTX_LICENSE_EXPIRED ((NTSTATUS)0xC00A0014) +#define STATUS_CTX_WINSTATION_NOT_FOUND ((NTSTATUS)0xC00A0015) +#define STATUS_CTX_WINSTATION_NAME_COLLISION ((NTSTATUS)0xC00A0016) +#define STATUS_CTX_WINSTATION_BUSY ((NTSTATUS)0xC00A0017) +#define STATUS_CTX_BAD_VIDEO_MODE ((NTSTATUS)0xC00A0018) +#define STATUS_CTX_GRAPHICS_INVALID ((NTSTATUS)0xC00A0022) +#define STATUS_CTX_NOT_CONSOLE ((NTSTATUS)0xC00A0024) +#define STATUS_CTX_CLIENT_QUERY_TIMEOUT ((NTSTATUS)0xC00A0026) +#define STATUS_CTX_CONSOLE_DISCONNECT ((NTSTATUS)0xC00A0027) +#define STATUS_CTX_CONSOLE_CONNECT ((NTSTATUS)0xC00A0028) +#define STATUS_CTX_SHADOW_DENIED ((NTSTATUS)0xC00A002A) +#define STATUS_CTX_WINSTATION_ACCESS_DENIED ((NTSTATUS)0xC00A002B) +#define STATUS_CTX_INVALID_WD ((NTSTATUS)0xC00A002E) +#define STATUS_CTX_WD_NOT_FOUND ((NTSTATUS)0xC00A002F) +#define STATUS_CTX_SHADOW_INVALID ((NTSTATUS)0xC00A0030) +#define STATUS_CTX_SHADOW_DISABLED ((NTSTATUS)0xC00A0031) +#define STATUS_RDP_PROTOCOL_ERROR ((NTSTATUS)0xC00A0032) +#define STATUS_CTX_CLIENT_LICENSE_NOT_SET ((NTSTATUS)0xC00A0033) +#define STATUS_CTX_CLIENT_LICENSE_IN_USE ((NTSTATUS)0xC00A0034) +#define STATUS_CTX_SHADOW_ENDED_BY_MODE_CHANGE ((NTSTATUS)0xC00A0035) +#define STATUS_CTX_SHADOW_NOT_RUNNING ((NTSTATUS)0xC00A0036) -#define STATUS_CLUSTER_INVALID_NODE ((NTSTATUS)0xC0130001) -#define STATUS_CLUSTER_NODE_EXISTS ((NTSTATUS)0xC0130002) -#define STATUS_CLUSTER_JOIN_IN_PROGRESS ((NTSTATUS)0xC0130003) -#define STATUS_CLUSTER_NODE_NOT_FOUND ((NTSTATUS)0xC0130004) -#define STATUS_CLUSTER_LOCAL_NODE_NOT_FOUND ((NTSTATUS)0xC0130005) -#define STATUS_CLUSTER_NETWORK_EXISTS ((NTSTATUS)0xC0130006) -#define STATUS_CLUSTER_NETWORK_NOT_FOUND ((NTSTATUS)0xC0130007) -#define STATUS_CLUSTER_NETINTERFACE_EXISTS ((NTSTATUS)0xC0130008) -#define STATUS_CLUSTER_NETINTERFACE_NOT_FOUND ((NTSTATUS)0xC0130009) -#define STATUS_CLUSTER_INVALID_REQUEST ((NTSTATUS)0xC013000A) -#define STATUS_CLUSTER_INVALID_NETWORK_PROVIDER ((NTSTATUS)0xC013000B) -#define STATUS_CLUSTER_NODE_DOWN ((NTSTATUS)0xC013000C) -#define STATUS_CLUSTER_NODE_UNREACHABLE ((NTSTATUS)0xC013000D) -#define STATUS_CLUSTER_NODE_NOT_MEMBER ((NTSTATUS)0xC013000E) -#define STATUS_CLUSTER_JOIN_NOT_IN_PROGRESS ((NTSTATUS)0xC013000F) -#define STATUS_CLUSTER_INVALID_NETWORK ((NTSTATUS)0xC0130010) -#define STATUS_CLUSTER_NO_NET_ADAPTERS ((NTSTATUS)0xC0130011) -#define STATUS_CLUSTER_NODE_UP ((NTSTATUS)0xC0130012) -#define STATUS_CLUSTER_NODE_PAUSED ((NTSTATUS)0xC0130013) -#define STATUS_CLUSTER_NODE_NOT_PAUSED ((NTSTATUS)0xC0130014) -#define STATUS_CLUSTER_NO_SECURITY_CONTEXT ((NTSTATUS)0xC0130015) -#define STATUS_CLUSTER_NETWORK_NOT_INTERNAL ((NTSTATUS)0xC0130016) -#define STATUS_CLUSTER_POISONED ((NTSTATUS)0xC0130017) +#define STATUS_CLUSTER_INVALID_NODE ((NTSTATUS)0xC0130001) +#define STATUS_CLUSTER_NODE_EXISTS ((NTSTATUS)0xC0130002) +#define STATUS_CLUSTER_JOIN_IN_PROGRESS ((NTSTATUS)0xC0130003) +#define STATUS_CLUSTER_NODE_NOT_FOUND ((NTSTATUS)0xC0130004) +#define STATUS_CLUSTER_LOCAL_NODE_NOT_FOUND ((NTSTATUS)0xC0130005) +#define STATUS_CLUSTER_NETWORK_EXISTS ((NTSTATUS)0xC0130006) +#define STATUS_CLUSTER_NETWORK_NOT_FOUND ((NTSTATUS)0xC0130007) +#define STATUS_CLUSTER_NETINTERFACE_EXISTS ((NTSTATUS)0xC0130008) +#define STATUS_CLUSTER_NETINTERFACE_NOT_FOUND ((NTSTATUS)0xC0130009) +#define STATUS_CLUSTER_INVALID_REQUEST ((NTSTATUS)0xC013000A) +#define STATUS_CLUSTER_INVALID_NETWORK_PROVIDER ((NTSTATUS)0xC013000B) +#define STATUS_CLUSTER_NODE_DOWN ((NTSTATUS)0xC013000C) +#define STATUS_CLUSTER_NODE_UNREACHABLE ((NTSTATUS)0xC013000D) +#define STATUS_CLUSTER_NODE_NOT_MEMBER ((NTSTATUS)0xC013000E) +#define STATUS_CLUSTER_JOIN_NOT_IN_PROGRESS ((NTSTATUS)0xC013000F) +#define STATUS_CLUSTER_INVALID_NETWORK ((NTSTATUS)0xC0130010) +#define STATUS_CLUSTER_NO_NET_ADAPTERS ((NTSTATUS)0xC0130011) +#define STATUS_CLUSTER_NODE_UP ((NTSTATUS)0xC0130012) +#define STATUS_CLUSTER_NODE_PAUSED ((NTSTATUS)0xC0130013) +#define STATUS_CLUSTER_NODE_NOT_PAUSED ((NTSTATUS)0xC0130014) +#define STATUS_CLUSTER_NO_SECURITY_CONTEXT ((NTSTATUS)0xC0130015) +#define STATUS_CLUSTER_NETWORK_NOT_INTERNAL ((NTSTATUS)0xC0130016) +#define STATUS_CLUSTER_POISONED ((NTSTATUS)0xC0130017) -#define STATUS_SXS_SECTION_NOT_FOUND ((NTSTATUS)0xC0150001) -#define STATUS_SXS_CANT_GEN_ACTCTX ((NTSTATUS)0xC0150002) -#define STATUS_SXS_INVALID_ACTCTXDATA_FORMAT ((NTSTATUS)0xC0150003) -#define STATUS_SXS_ASSEMBLY_NOT_FOUND ((NTSTATUS)0xC0150004) -#define STATUS_SXS_MANIFEST_FORMAT_ERROR ((NTSTATUS)0xC0150005) -#define STATUS_SXS_MANIFEST_PARSE_ERROR ((NTSTATUS)0xC0150006) -#define STATUS_SXS_ACTIVATION_CONTEXT_DISABLED ((NTSTATUS)0xC0150007) -#define STATUS_SXS_KEY_NOT_FOUND ((NTSTATUS)0xC0150008) -#define STATUS_SXS_VERSION_CONFLICT ((NTSTATUS)0xC0150009) -#define STATUS_SXS_WRONG_SECTION_TYPE ((NTSTATUS)0xC015000A) -#define STATUS_SXS_THREAD_QUERIES_DISABLED ((NTSTATUS)0xC015000B) -#define STATUS_SXS_ASSEMBLY_MISSING ((NTSTATUS)0xC015000C) -#define STATUS_SXS_PROCESS_DEFAULT_ALREADY_SET ((NTSTATUS)0xC015000E) +#define STATUS_SXS_SECTION_NOT_FOUND ((NTSTATUS)0xC0150001) +#define STATUS_SXS_CANT_GEN_ACTCTX ((NTSTATUS)0xC0150002) +#define STATUS_SXS_INVALID_ACTCTXDATA_FORMAT ((NTSTATUS)0xC0150003) +#define STATUS_SXS_ASSEMBLY_NOT_FOUND ((NTSTATUS)0xC0150004) +#define STATUS_SXS_MANIFEST_FORMAT_ERROR ((NTSTATUS)0xC0150005) +#define STATUS_SXS_MANIFEST_PARSE_ERROR ((NTSTATUS)0xC0150006) +#define STATUS_SXS_ACTIVATION_CONTEXT_DISABLED ((NTSTATUS)0xC0150007) +#define STATUS_SXS_KEY_NOT_FOUND ((NTSTATUS)0xC0150008) +#define STATUS_SXS_VERSION_CONFLICT ((NTSTATUS)0xC0150009) +#define STATUS_SXS_WRONG_SECTION_TYPE ((NTSTATUS)0xC015000A) +#define STATUS_SXS_THREAD_QUERIES_DISABLED ((NTSTATUS)0xC015000B) +#define STATUS_SXS_ASSEMBLY_MISSING ((NTSTATUS)0xC015000C) +#define STATUS_SXS_PROCESS_DEFAULT_ALREADY_SET ((NTSTATUS)0xC015000E) //#define STATUS_SXS_EARLY_DEACTIVATION ((NTSTATUS)0xC015000F) //#define STATUS_SXS_INVALID_DEACTIVATION ((NTSTATUS)0xC0150010) -#define STATUS_SXS_MULTIPLE_DEACTIVATION ((NTSTATUS)0xC0150011) -#define STATUS_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY ((NTSTATUS)0xC0150012) -#define STATUS_SXS_PROCESS_TERMINATION_REQUESTED ((NTSTATUS)0xC0150013) -#define STATUS_SXS_CORRUPT_ACTIVATION_STACK ((NTSTATUS)0xC0150014) -#define STATUS_SXS_CORRUPTION ((NTSTATUS)0xC0150015) -#define STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE ((NTSTATUS)0xC0150016) -#define STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME ((NTSTATUS)0xC0150017) -#define STATUS_SXS_IDENTITY_DUPLICATE_ATTRIBUTE ((NTSTATUS)0xC0150018) -#define STATUS_SXS_IDENTITY_PARSE_ERROR ((NTSTATUS)0xC0150019) -#define STATUS_SXS_COMPONENT_STORE_CORRUPT ((NTSTATUS)0xC015001A) -#define STATUS_SXS_FILE_HASH_MISMATCH ((NTSTATUS)0xC015001B) -#define STATUS_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT ((NTSTATUS)0xC015001C) -#define STATUS_SXS_IDENTITIES_DIFFERENT ((NTSTATUS)0xC015001D) -#define STATUS_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT ((NTSTATUS)0xC015001E) -#define STATUS_SXS_FILE_NOT_PART_OF_ASSEMBLY ((NTSTATUS)0xC015001F) -#define STATUS_ADVANCED_INSTALLER_FAILED ((NTSTATUS)0xC0150020) -#define STATUS_XML_ENCODING_MISMATCH ((NTSTATUS)0xC0150021) -#define STATUS_SXS_MANIFEST_TOO_BIG ((NTSTATUS)0xC0150022) -#define STATUS_SXS_SETTING_NOT_REGISTERED ((NTSTATUS)0xC0150023) -#define STATUS_SXS_TRANSACTION_CLOSURE_INCOMPLETE ((NTSTATUS)0xC0150024) -#define STATUS_SXS_PRIMITIVE_INSTALLER_FAILED ((NTSTATUS)0xC0150025) -#define STATUS_GENERIC_COMMAND_FAILED ((NTSTATUS)0xC0150026) -#define STATUS_SXS_FILE_HASH_MISSING ((NTSTATUS)0xC0150027) +#define STATUS_SXS_MULTIPLE_DEACTIVATION ((NTSTATUS)0xC0150011) +#define STATUS_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY ((NTSTATUS)0xC0150012) +#define STATUS_SXS_PROCESS_TERMINATION_REQUESTED ((NTSTATUS)0xC0150013) +#define STATUS_SXS_CORRUPT_ACTIVATION_STACK ((NTSTATUS)0xC0150014) +#define STATUS_SXS_CORRUPTION ((NTSTATUS)0xC0150015) +#define STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE ((NTSTATUS)0xC0150016) +#define STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME ((NTSTATUS)0xC0150017) +#define STATUS_SXS_IDENTITY_DUPLICATE_ATTRIBUTE ((NTSTATUS)0xC0150018) +#define STATUS_SXS_IDENTITY_PARSE_ERROR ((NTSTATUS)0xC0150019) +#define STATUS_SXS_COMPONENT_STORE_CORRUPT ((NTSTATUS)0xC015001A) +#define STATUS_SXS_FILE_HASH_MISMATCH ((NTSTATUS)0xC015001B) +#define STATUS_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT ((NTSTATUS)0xC015001C) +#define STATUS_SXS_IDENTITIES_DIFFERENT ((NTSTATUS)0xC015001D) +#define STATUS_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT ((NTSTATUS)0xC015001E) +#define STATUS_SXS_FILE_NOT_PART_OF_ASSEMBLY ((NTSTATUS)0xC015001F) +#define STATUS_ADVANCED_INSTALLER_FAILED ((NTSTATUS)0xC0150020) +#define STATUS_XML_ENCODING_MISMATCH ((NTSTATUS)0xC0150021) +#define STATUS_SXS_MANIFEST_TOO_BIG ((NTSTATUS)0xC0150022) +#define STATUS_SXS_SETTING_NOT_REGISTERED ((NTSTATUS)0xC0150023) +#define STATUS_SXS_TRANSACTION_CLOSURE_INCOMPLETE ((NTSTATUS)0xC0150024) +#define STATUS_SXS_PRIMITIVE_INSTALLER_FAILED ((NTSTATUS)0xC0150025) +#define STATUS_GENERIC_COMMAND_FAILED ((NTSTATUS)0xC0150026) +#define STATUS_SXS_FILE_HASH_MISSING ((NTSTATUS)0xC0150027) /* Defined in winternl.h, always define since we do not include this header */ @@ -1263,7 +1263,7 @@ #if !defined(NTSTATUS_FROM_WIN32) && !defined(INLINE_NTSTATUS_FROM_WIN32) static INLINE NTSTATUS NTSTATUS_FROM_WIN32(long x) { - return x <= 0 ? (NTSTATUS)x : (NTSTATUS)(((x) & 0x0000FFFF) | (0x7 << 16) | 0xC0000000); + return x <= 0 ? (NTSTATUS)x : (NTSTATUS)(((x)&0x0000FFFF) | (0x7 << 16) | 0xC0000000); } #endif @@ -1278,9 +1278,9 @@ static INLINE NTSTATUS NTSTATUS_FROM_WIN32(long x) * http://msdn.microsoft.com/en-us/library/cc231987.aspx */ -#define FILE_INFORMATION_CLASS _WINTERNL_FILE_INFORMATION_CLASS -#define _FILE_INFORMATION_CLASS _WINTERNL__FILE_INFORMATION_CLASS -#define FileDirectoryInformation _WINTERNL_FileDirectoryInformation +#define FILE_INFORMATION_CLASS _WINTERNL_FILE_INFORMATION_CLASS +#define _FILE_INFORMATION_CLASS _WINTERNL__FILE_INFORMATION_CLASS +#define FileDirectoryInformation _WINTERNL_FileDirectoryInformation #include @@ -1336,52 +1336,52 @@ typedef enum _FILE_INFORMATION_CLASS #if !defined(_WIN32) || defined(_UWP) -#define FILE_SUPERSEDE 0x00000000 -#define FILE_OPEN 0x00000001 -#define FILE_CREATE 0x00000002 -#define FILE_OPEN_IF 0x00000003 -#define FILE_OVERWRITE 0x00000004 -#define FILE_OVERWRITE_IF 0x00000005 -#define FILE_MAXIMUM_DISPOSITION 0x00000005 +#define FILE_SUPERSEDE 0x00000000 +#define FILE_OPEN 0x00000001 +#define FILE_CREATE 0x00000002 +#define FILE_OPEN_IF 0x00000003 +#define FILE_OVERWRITE 0x00000004 +#define FILE_OVERWRITE_IF 0x00000005 +#define FILE_MAXIMUM_DISPOSITION 0x00000005 -#define FILE_DIRECTORY_FILE 0x00000001 -#define FILE_WRITE_THROUGH 0x00000002 -#define FILE_SEQUENTIAL_ONLY 0x00000004 -#define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008 +#define FILE_DIRECTORY_FILE 0x00000001 +#define FILE_WRITE_THROUGH 0x00000002 +#define FILE_SEQUENTIAL_ONLY 0x00000004 +#define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008 -#define FILE_SYNCHRONOUS_IO_ALERT 0x00000010 -#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020 -#define FILE_NON_DIRECTORY_FILE 0x00000040 -#define FILE_CREATE_TREE_CONNECTION 0x00000080 +#define FILE_SYNCHRONOUS_IO_ALERT 0x00000010 +#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020 +#define FILE_NON_DIRECTORY_FILE 0x00000040 +#define FILE_CREATE_TREE_CONNECTION 0x00000080 -#define FILE_COMPLETE_IF_OPLOCKED 0x00000100 -#define FILE_NO_EA_KNOWLEDGE 0x00000200 -#define FILE_OPEN_REMOTE_INSTANCE 0x00000400 -#define FILE_RANDOM_ACCESS 0x00000800 +#define FILE_COMPLETE_IF_OPLOCKED 0x00000100 +#define FILE_NO_EA_KNOWLEDGE 0x00000200 +#define FILE_OPEN_REMOTE_INSTANCE 0x00000400 +#define FILE_RANDOM_ACCESS 0x00000800 -#define FILE_DELETE_ON_CLOSE 0x00001000 -#define FILE_OPEN_BY_FILE_ID 0x00002000 -#define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000 -#define FILE_NO_COMPRESSION 0x00008000 +#define FILE_DELETE_ON_CLOSE 0x00001000 +#define FILE_OPEN_BY_FILE_ID 0x00002000 +#define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000 +#define FILE_NO_COMPRESSION 0x00008000 -#define FILE_OPEN_REQUIRING_OPLOCK 0x00010000 +#define FILE_OPEN_REQUIRING_OPLOCK 0x00010000 -#define FILE_RESERVE_OPFILTER 0x00100000 -#define FILE_OPEN_REPARSE_POINT 0x00200000 -#define FILE_OPEN_NO_RECALL 0x00400000 -#define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000 +#define FILE_RESERVE_OPFILTER 0x00100000 +#define FILE_OPEN_REPARSE_POINT 0x00200000 +#define FILE_OPEN_NO_RECALL 0x00400000 +#define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000 -#define FILE_VALID_OPTION_FLAGS 0x00FFFFFF -#define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032 -#define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032 -#define FILE_VALID_SET_FLAGS 0x00000036 +#define FILE_VALID_OPTION_FLAGS 0x00FFFFFF +#define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032 +#define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032 +#define FILE_VALID_SET_FLAGS 0x00000036 -#define FILE_SUPERSEDED 0x00000000 -#define FILE_OPENED 0x00000001 -#define FILE_CREATED 0x00000002 -#define FILE_OVERWRITTEN 0x00000003 -#define FILE_EXISTS 0x00000004 -#define FILE_DOES_NOT_EXIST 0x00000005 +#define FILE_SUPERSEDED 0x00000000 +#define FILE_OPENED 0x00000001 +#define FILE_CREATED 0x00000002 +#define FILE_OVERWRITTEN 0x00000003 +#define FILE_EXISTS 0x00000004 +#define FILE_DOES_NOT_EXIST 0x00000005 typedef CONST char* PCSZ; @@ -1408,15 +1408,15 @@ typedef struct _LSA_UNICODE_STRING PWSTR Buffer; } LSA_UNICODE_STRING, *PLSA_UNICODE_STRING, UNICODE_STRING, *PUNICODE_STRING; -#define OBJ_INHERIT 0x00000002L -#define OBJ_PERMANENT 0x00000010L -#define OBJ_EXCLUSIVE 0x00000020L -#define OBJ_CASE_INSENSITIVE 0x00000040L -#define OBJ_OPENIF 0x00000080L -#define OBJ_OPENLINK 0x00000100L -#define OBJ_KERNEL_HANDLE 0x00000200L -#define OBJ_FORCE_ACCESS_CHECK 0x00000400L -#define OBJ_VALID_ATTRIBUTES 0x000007F2L +#define OBJ_INHERIT 0x00000002L +#define OBJ_PERMANENT 0x00000010L +#define OBJ_EXCLUSIVE 0x00000020L +#define OBJ_CASE_INSENSITIVE 0x00000040L +#define OBJ_OPENIF 0x00000080L +#define OBJ_OPENLINK 0x00000100L +#define OBJ_KERNEL_HANDLE 0x00000200L +#define OBJ_FORCE_ACCESS_CHECK 0x00000400L +#define OBJ_VALID_ATTRIBUTES 0x000007F2L typedef struct _OBJECT_ATTRIBUTES { @@ -1431,8 +1431,7 @@ typedef OBJECT_ATTRIBUTES* POBJECT_ATTRIBUTES; typedef struct _IO_STATUS_BLOCK { - union - { + union { #ifdef _WIN32 NTSTATUS Status; #else @@ -1485,57 +1484,62 @@ struct _TEB PVOID TlsSlots[64]; }; -#define GENERIC_READ 0x80000000 -#define GENERIC_WRITE 0x40000000 -#define GENERIC_EXECUTE 0x20000000 -#define GENERIC_ALL 0x10000000 +#define GENERIC_READ 0x80000000 +#define GENERIC_WRITE 0x40000000 +#define GENERIC_EXECUTE 0x20000000 +#define GENERIC_ALL 0x10000000 -#define DELETE 0x00010000 -#define READ_CONTROL 0x00020000 -#define WRITE_DAC 0x00040000 -#define WRITE_OWNER 0x00080000 -#define SYNCHRONIZE 0x00100000 -#define STANDARD_RIGHTS_REQUIRED 0x000F0000 -#define STANDARD_RIGHTS_READ 0x00020000 -#define STANDARD_RIGHTS_WRITE 0x00020000 -#define STANDARD_RIGHTS_EXECUTE 0x00020000 -#define STANDARD_RIGHTS_ALL 0x001F0000 -#define SPECIFIC_RIGHTS_ALL 0x0000FFFF -#define ACCESS_SYSTEM_SECURITY 0x01000000 -#define MAXIMUM_ALLOWED 0x02000000 +#define DELETE 0x00010000 +#define READ_CONTROL 0x00020000 +#define WRITE_DAC 0x00040000 +#define WRITE_OWNER 0x00080000 +#define SYNCHRONIZE 0x00100000 +#define STANDARD_RIGHTS_REQUIRED 0x000F0000 +#define STANDARD_RIGHTS_READ 0x00020000 +#define STANDARD_RIGHTS_WRITE 0x00020000 +#define STANDARD_RIGHTS_EXECUTE 0x00020000 +#define STANDARD_RIGHTS_ALL 0x001F0000 +#define SPECIFIC_RIGHTS_ALL 0x0000FFFF +#define ACCESS_SYSTEM_SECURITY 0x01000000 +#define MAXIMUM_ALLOWED 0x02000000 -#define FILE_READ_DATA 0x0001 -#define FILE_LIST_DIRECTORY 0x0001 -#define FILE_WRITE_DATA 0x0002 -#define FILE_ADD_FILE 0x0002 -#define FILE_APPEND_DATA 0x0004 -#define FILE_ADD_SUBDIRECTORY 0x0004 -#define FILE_CREATE_PIPE_INSTANCE 0x0004 -#define FILE_READ_EA 0x0008 -#define FILE_WRITE_EA 0x0010 -#define FILE_EXECUTE 0x0020 -#define FILE_TRAVERSE 0x0020 -#define FILE_DELETE_CHILD 0x0040 -#define FILE_READ_ATTRIBUTES 0x0080 -#define FILE_WRITE_ATTRIBUTES 0x0100 +#define FILE_READ_DATA 0x0001 +#define FILE_LIST_DIRECTORY 0x0001 +#define FILE_WRITE_DATA 0x0002 +#define FILE_ADD_FILE 0x0002 +#define FILE_APPEND_DATA 0x0004 +#define FILE_ADD_SUBDIRECTORY 0x0004 +#define FILE_CREATE_PIPE_INSTANCE 0x0004 +#define FILE_READ_EA 0x0008 +#define FILE_WRITE_EA 0x0010 +#define FILE_EXECUTE 0x0020 +#define FILE_TRAVERSE 0x0020 +#define FILE_DELETE_CHILD 0x0040 +#define FILE_READ_ATTRIBUTES 0x0080 +#define FILE_WRITE_ATTRIBUTES 0x0100 -#define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF) -#define FILE_GENERIC_READ (STANDARD_RIGHTS_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE) -#define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA | SYNCHRONIZE) -#define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE | FILE_READ_ATTRIBUTES | FILE_EXECUTE | SYNCHRONIZE) +#define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF) +#define FILE_GENERIC_READ \ + (STANDARD_RIGHTS_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE) +#define FILE_GENERIC_WRITE \ + (STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | \ + FILE_APPEND_DATA | SYNCHRONIZE) +#define FILE_GENERIC_EXECUTE \ + (STANDARD_RIGHTS_EXECUTE | FILE_READ_ATTRIBUTES | FILE_EXECUTE | SYNCHRONIZE) -#define FILE_SHARE_READ 0x00000001 -#define FILE_SHARE_WRITE 0x00000002 -#define FILE_SHARE_DELETE 0x00000004 +#define FILE_SHARE_READ 0x00000001 +#define FILE_SHARE_WRITE 0x00000002 +#define FILE_SHARE_DELETE 0x00000004 typedef DWORD ACCESS_MASK; typedef ACCESS_MASK* PACCESS_MASK; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API PTEB NtCurrentTeb(void); + WINPR_API PTEB NtCurrentTeb(void); #ifdef __cplusplus } @@ -1544,49 +1548,57 @@ WINPR_API PTEB NtCurrentTeb(void); #endif #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API VOID _RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString); + WINPR_API VOID _RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString); -WINPR_API VOID _RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString); + WINPR_API VOID _RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString); -WINPR_API NTSTATUS _RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, - PCANSI_STRING SourceString, BOOLEAN AllocateDestinationString); + WINPR_API NTSTATUS _RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PCANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); -WINPR_API VOID _RtlFreeUnicodeString(PUNICODE_STRING UnicodeString); + WINPR_API VOID _RtlFreeUnicodeString(PUNICODE_STRING UnicodeString); -WINPR_API ULONG _RtlNtStatusToDosError(NTSTATUS status); + WINPR_API ULONG _RtlNtStatusToDosError(NTSTATUS status); -WINPR_API VOID _InitializeObjectAttributes(POBJECT_ATTRIBUTES InitializedAttributes, - PUNICODE_STRING ObjectName, ULONG Attributes, HANDLE RootDirectory, - PSECURITY_DESCRIPTOR SecurityDescriptor); + WINPR_API VOID _InitializeObjectAttributes(POBJECT_ATTRIBUTES InitializedAttributes, + PUNICODE_STRING ObjectName, ULONG Attributes, + HANDLE RootDirectory, + PSECURITY_DESCRIPTOR SecurityDescriptor); -WINPR_API NTSTATUS _NtCreateFile(PHANDLE FileHandle, ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES ObjectAttributes, PIO_STATUS_BLOCK IoStatusBlock, - PLARGE_INTEGER AllocationSize, ULONG FileAttributes, ULONG ShareAccess, - ULONG CreateDisposition, ULONG CreateOptions, PVOID EaBuffer, ULONG EaLength); + WINPR_API NTSTATUS _NtCreateFile(PHANDLE FileHandle, ACCESS_MASK DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + PIO_STATUS_BLOCK IoStatusBlock, PLARGE_INTEGER AllocationSize, + ULONG FileAttributes, ULONG ShareAccess, + ULONG CreateDisposition, ULONG CreateOptions, PVOID EaBuffer, + ULONG EaLength); -WINPR_API NTSTATUS _NtOpenFile(PHANDLE FileHandle, ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES ObjectAttributes, PIO_STATUS_BLOCK IoStatusBlock, - ULONG ShareAccess, ULONG OpenOptions); + WINPR_API NTSTATUS _NtOpenFile(PHANDLE FileHandle, ACCESS_MASK DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + PIO_STATUS_BLOCK IoStatusBlock, ULONG ShareAccess, + ULONG OpenOptions); -WINPR_API NTSTATUS _NtReadFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, - PVOID ApcContext, - PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key); + WINPR_API NTSTATUS _NtReadFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, + PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, + ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key); -WINPR_API NTSTATUS _NtWriteFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, - PVOID ApcContext, - PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key); + WINPR_API NTSTATUS _NtWriteFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, + PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, + ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key); -WINPR_API NTSTATUS _NtDeviceIoControlFile(HANDLE FileHandle, HANDLE Event, - PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, - ULONG IoControlCode, PVOID InputBuffer, ULONG InputBufferLength, - PVOID OutputBuffer, ULONG OutputBufferLength); + WINPR_API NTSTATUS _NtDeviceIoControlFile(HANDLE FileHandle, HANDLE Event, + PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, + PIO_STATUS_BLOCK IoStatusBlock, ULONG IoControlCode, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength); -WINPR_API NTSTATUS _NtClose(HANDLE Handle); + WINPR_API NTSTATUS _NtClose(HANDLE Handle); -WINPR_API NTSTATUS _NtWaitForSingleObject(HANDLE Handle, BOOLEAN Alertable, PLARGE_INTEGER Timeout); + WINPR_API NTSTATUS _NtWaitForSingleObject(HANDLE Handle, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); #ifdef __cplusplus } diff --git a/winpr/include/winpr/ntlm.h b/winpr/include/winpr/ntlm.h index c5db0a921..85b3f2989 100644 --- a/winpr/include/winpr/ntlm.h +++ b/winpr/include/winpr/ntlm.h @@ -28,40 +28,41 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef SECURITY_STATUS(*psPeerComputeNtlmHash)(void* client, - const SEC_WINNT_AUTH_IDENTITY* authIdentity, - const SecBuffer* ntproofvalue, const BYTE* randkey, const BYTE* mic, const SecBuffer* micvalue, - BYTE* ntlmhash); + typedef SECURITY_STATUS (*psPeerComputeNtlmHash)(void* client, + const SEC_WINNT_AUTH_IDENTITY* authIdentity, + const SecBuffer* ntproofvalue, + const BYTE* randkey, const BYTE* mic, + const SecBuffer* micvalue, BYTE* ntlmhash); -WINPR_API BOOL NTOWFv1W(LPWSTR Password, UINT32 PasswordLength, BYTE* NtHash); -WINPR_API BOOL NTOWFv1A(LPSTR Password, UINT32 PasswordLength, BYTE* NtHash); + WINPR_API BOOL NTOWFv1W(LPWSTR Password, UINT32 PasswordLength, BYTE* NtHash); + WINPR_API BOOL NTOWFv1A(LPSTR Password, UINT32 PasswordLength, BYTE* NtHash); -WINPR_API BOOL NTOWFv2W(LPWSTR Password, UINT32 PasswordLength, LPWSTR User, - UINT32 UserLength, LPWSTR Domain, UINT32 DomainLength, BYTE* NtHash); -WINPR_API BOOL NTOWFv2A(LPSTR Password, UINT32 PasswordLength, LPSTR User, - UINT32 UserLength, LPSTR Domain, UINT32 DomainLength, BYTE* NtHash); + WINPR_API BOOL NTOWFv2W(LPWSTR Password, UINT32 PasswordLength, LPWSTR User, UINT32 UserLength, + LPWSTR Domain, UINT32 DomainLength, BYTE* NtHash); + WINPR_API BOOL NTOWFv2A(LPSTR Password, UINT32 PasswordLength, LPSTR User, UINT32 UserLength, + LPSTR Domain, UINT32 DomainLength, BYTE* NtHash); -WINPR_API BOOL NTOWFv2FromHashW(BYTE* NtHashV1, LPWSTR User, UINT32 UserLength, - LPWSTR Domain, UINT32 DomainLength, BYTE* NtHash); -WINPR_API BOOL NTOWFv2FromHashA(BYTE* NtHashV1, LPSTR User, UINT32 UserLength, - LPSTR Domain, UINT32 DomainLength, BYTE* NtHash); + WINPR_API BOOL NTOWFv2FromHashW(BYTE* NtHashV1, LPWSTR User, UINT32 UserLength, LPWSTR Domain, + UINT32 DomainLength, BYTE* NtHash); + WINPR_API BOOL NTOWFv2FromHashA(BYTE* NtHashV1, LPSTR User, UINT32 UserLength, LPSTR Domain, + UINT32 DomainLength, BYTE* NtHash); #ifdef __cplusplus } #endif #ifdef UNICODE -#define NTOWFv1 NTOWFv1W -#define NTOWFv2 NTOWFv2W -#define NTOWFv2FromHash NTOWFv2FromHashW +#define NTOWFv1 NTOWFv1W +#define NTOWFv2 NTOWFv2W +#define NTOWFv2FromHash NTOWFv2FromHashW #else -#define NTOWFv1 NTOWFv1A -#define NTOWFv2 NTOWFv2A -#define NTOWFv2FromHash NTOWFv2FromHashA +#define NTOWFv1 NTOWFv1A +#define NTOWFv2 NTOWFv2A +#define NTOWFv2FromHash NTOWFv2FromHashA #endif #endif /* WINPR_UTILS_NTLM_H */ - diff --git a/winpr/include/winpr/pack.h b/winpr/include/winpr/pack.h index 198d26ae9..f97ba9a69 100644 --- a/winpr/include/winpr/pack.h +++ b/winpr/include/winpr/pack.h @@ -31,71 +31,70 @@ */ #if !defined(__APPLE__) - #ifndef WINPR_PRAGMA_PACK_EXT - #define WINPR_PRAGMA_PACK_EXT - #endif +#ifndef WINPR_PRAGMA_PACK_EXT +#define WINPR_PRAGMA_PACK_EXT +#endif #endif #ifdef PRAGMA_PACK_PUSH - #ifndef PRAGMA_PACK_PUSH1 - #define PRAGMA_PACK_PUSH1 - #endif +#ifndef PRAGMA_PACK_PUSH1 +#define PRAGMA_PACK_PUSH1 +#endif #undef PRAGMA_PACK_PUSH #endif #ifdef PRAGMA_PACK_PUSH1 - #ifdef WINPR_PRAGMA_PACK_EXT - #pragma pack(push, 1) - #else - #pragma pack(1) - #endif +#ifdef WINPR_PRAGMA_PACK_EXT +#pragma pack(push, 1) +#else +#pragma pack(1) +#endif #undef PRAGMA_PACK_PUSH1 #endif #ifdef PRAGMA_PACK_PUSH2 - #ifdef WINPR_PRAGMA_PACK_EXT - #pragma pack(push, 2) - #else - #pragma pack(2) - #endif +#ifdef WINPR_PRAGMA_PACK_EXT +#pragma pack(push, 2) +#else +#pragma pack(2) +#endif #undef PRAGMA_PACK_PUSH2 #endif #ifdef PRAGMA_PACK_PUSH4 - #ifdef WINPR_PRAGMA_PACK_EXT - #pragma pack(push, 4) - #else - #pragma pack(4) - #endif +#ifdef WINPR_PRAGMA_PACK_EXT +#pragma pack(push, 4) +#else +#pragma pack(4) +#endif #undef PRAGMA_PACK_PUSH4 #endif #ifdef PRAGMA_PACK_PUSH8 - #ifdef WINPR_PRAGMA_PACK_EXT - #pragma pack(push, 8) - #else - #pragma pack(8) - #endif +#ifdef WINPR_PRAGMA_PACK_EXT +#pragma pack(push, 8) +#else +#pragma pack(8) +#endif #undef PRAGMA_PACK_PUSH8 #endif #ifdef PRAGMA_PACK_PUSH16 - #ifdef WINPR_PRAGMA_PACK_EXT - #pragma pack(push, 16) - #else - #pragma pack(16) - #endif +#ifdef WINPR_PRAGMA_PACK_EXT +#pragma pack(push, 16) +#else +#pragma pack(16) +#endif #undef PRAGMA_PACK_PUSH16 #endif #ifdef PRAGMA_PACK_POP - #ifdef WINPR_PRAGMA_PACK_EXT - #pragma pack(pop) - #else - #pragma pack() - #endif +#ifdef WINPR_PRAGMA_PACK_EXT +#pragma pack(pop) +#else +#pragma pack() +#endif #undef PRAGMA_PACK_POP #endif #undef WINPR_PRAGMA_PACK_EXT - diff --git a/winpr/include/winpr/path.h b/winpr/include/winpr/path.h index ed52b1c6a..bd45d53a7 100644 --- a/winpr/include/winpr/path.h +++ b/winpr/include/winpr/path.h @@ -34,227 +34,253 @@ #else #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -#define PATHCCH_ALLOW_LONG_PATHS 0x00000001 /* Allow building of \\?\ paths if longer than MAX_PATH */ +#define PATHCCH_ALLOW_LONG_PATHS \ + 0x00000001 /* Allow building of \\?\ paths if longer than MAX_PATH */ -#define VOLUME_PREFIX _T("\\\\?\\Volume") -#define VOLUME_PREFIX_LEN ((sizeof(VOLUME_PREFIX) / sizeof(TCHAR)) - 1) +#define VOLUME_PREFIX _T("\\\\?\\Volume") +#define VOLUME_PREFIX_LEN ((sizeof(VOLUME_PREFIX) / sizeof(TCHAR)) - 1) -/* - * Maximum number of characters we support using the "\\?\" syntax - * (0x7FFF + 1 for NULL terminator) - */ + /* + * Maximum number of characters we support using the "\\?\" syntax + * (0x7FFF + 1 for NULL terminator) + */ -#define PATHCCH_MAX_CCH 0x8000 +#define PATHCCH_MAX_CCH 0x8000 -WINPR_API HRESULT PathCchAddBackslashA(PSTR pszPath, size_t cchPath); -WINPR_API HRESULT PathCchAddBackslashW(PWSTR pszPath, size_t cchPath); + WINPR_API HRESULT PathCchAddBackslashA(PSTR pszPath, size_t cchPath); + WINPR_API HRESULT PathCchAddBackslashW(PWSTR pszPath, size_t cchPath); -WINPR_API HRESULT PathCchRemoveBackslashA(PSTR pszPath, size_t cchPath); -WINPR_API HRESULT PathCchRemoveBackslashW(PWSTR pszPath, size_t cchPath); + WINPR_API HRESULT PathCchRemoveBackslashA(PSTR pszPath, size_t cchPath); + WINPR_API HRESULT PathCchRemoveBackslashW(PWSTR pszPath, size_t cchPath); -WINPR_API HRESULT PathCchAddBackslashExA(PSTR pszPath, size_t cchPath, PSTR* ppszEnd, size_t* pcchRemaining); -WINPR_API HRESULT PathCchAddBackslashExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, size_t* pcchRemaining); + WINPR_API HRESULT PathCchAddBackslashExA(PSTR pszPath, size_t cchPath, PSTR* ppszEnd, + size_t* pcchRemaining); + WINPR_API HRESULT PathCchAddBackslashExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, + size_t* pcchRemaining); -WINPR_API HRESULT PathCchRemoveBackslashExA(PSTR pszPath, size_t cchPath, PSTR* ppszEnd, size_t* pcchRemaining); -WINPR_API HRESULT PathCchRemoveBackslashExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, size_t* pcchRemaining); + WINPR_API HRESULT PathCchRemoveBackslashExA(PSTR pszPath, size_t cchPath, PSTR* ppszEnd, + size_t* pcchRemaining); + WINPR_API HRESULT PathCchRemoveBackslashExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, + size_t* pcchRemaining); -WINPR_API HRESULT PathCchAddExtensionA(PSTR pszPath, size_t cchPath, PCSTR pszExt); -WINPR_API HRESULT PathCchAddExtensionW(PWSTR pszPath, size_t cchPath, PCWSTR pszExt); + WINPR_API HRESULT PathCchAddExtensionA(PSTR pszPath, size_t cchPath, PCSTR pszExt); + WINPR_API HRESULT PathCchAddExtensionW(PWSTR pszPath, size_t cchPath, PCWSTR pszExt); -WINPR_API HRESULT PathCchAppendA(PSTR pszPath, size_t cchPath, PCSTR pszMore); -WINPR_API HRESULT PathCchAppendW(PWSTR pszPath, size_t cchPath, PCWSTR pszMore); + WINPR_API HRESULT PathCchAppendA(PSTR pszPath, size_t cchPath, PCSTR pszMore); + WINPR_API HRESULT PathCchAppendW(PWSTR pszPath, size_t cchPath, PCWSTR pszMore); -WINPR_API HRESULT PathCchAppendExA(PSTR pszPath, size_t cchPath, PCSTR pszMore, unsigned long dwFlags); -WINPR_API HRESULT PathCchAppendExW(PWSTR pszPath, size_t cchPath, PCWSTR pszMore, unsigned long dwFlags); + WINPR_API HRESULT PathCchAppendExA(PSTR pszPath, size_t cchPath, PCSTR pszMore, + unsigned long dwFlags); + WINPR_API HRESULT PathCchAppendExW(PWSTR pszPath, size_t cchPath, PCWSTR pszMore, + unsigned long dwFlags); -WINPR_API HRESULT PathCchCanonicalizeA(PSTR pszPathOut, size_t cchPathOut, PCSTR pszPathIn); -WINPR_API HRESULT PathCchCanonicalizeW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn); + WINPR_API HRESULT PathCchCanonicalizeA(PSTR pszPathOut, size_t cchPathOut, PCSTR pszPathIn); + WINPR_API HRESULT PathCchCanonicalizeW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn); -WINPR_API HRESULT PathCchCanonicalizeExA(PSTR pszPathOut, size_t cchPathOut, PCSTR pszPathIn, unsigned long dwFlags); -WINPR_API HRESULT PathCchCanonicalizeExW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, unsigned long dwFlags); + WINPR_API HRESULT PathCchCanonicalizeExA(PSTR pszPathOut, size_t cchPathOut, PCSTR pszPathIn, + unsigned long dwFlags); + WINPR_API HRESULT PathCchCanonicalizeExW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, + unsigned long dwFlags); -WINPR_API HRESULT PathAllocCanonicalizeA(PCSTR pszPathIn, unsigned long dwFlags, PSTR* ppszPathOut); -WINPR_API HRESULT PathAllocCanonicalizeW(PCWSTR pszPathIn, unsigned long dwFlags, PWSTR* ppszPathOut); + WINPR_API HRESULT PathAllocCanonicalizeA(PCSTR pszPathIn, unsigned long dwFlags, + PSTR* ppszPathOut); + WINPR_API HRESULT PathAllocCanonicalizeW(PCWSTR pszPathIn, unsigned long dwFlags, + PWSTR* ppszPathOut); -WINPR_API HRESULT PathCchCombineA(PSTR pszPathOut, size_t cchPathOut, PCSTR pszPathIn, PCSTR pszMore); -WINPR_API HRESULT PathCchCombineW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, PCWSTR pszMore); + WINPR_API HRESULT PathCchCombineA(PSTR pszPathOut, size_t cchPathOut, PCSTR pszPathIn, + PCSTR pszMore); + WINPR_API HRESULT PathCchCombineW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, + PCWSTR pszMore); -WINPR_API HRESULT PathCchCombineExA(PSTR pszPathOut, size_t cchPathOut, PCSTR pszPathIn, PCSTR pszMore, unsigned long dwFlags); -WINPR_API HRESULT PathCchCombineExW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, PCWSTR pszMore, unsigned long dwFlags); + WINPR_API HRESULT PathCchCombineExA(PSTR pszPathOut, size_t cchPathOut, PCSTR pszPathIn, + PCSTR pszMore, unsigned long dwFlags); + WINPR_API HRESULT PathCchCombineExW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, + PCWSTR pszMore, unsigned long dwFlags); -WINPR_API HRESULT PathAllocCombineA(PCSTR pszPathIn, PCSTR pszMore, unsigned long dwFlags, PSTR* ppszPathOut); -WINPR_API HRESULT PathAllocCombineW(PCWSTR pszPathIn, PCWSTR pszMore, unsigned long dwFlags, PWSTR* ppszPathOut); + WINPR_API HRESULT PathAllocCombineA(PCSTR pszPathIn, PCSTR pszMore, unsigned long dwFlags, + PSTR* ppszPathOut); + WINPR_API HRESULT PathAllocCombineW(PCWSTR pszPathIn, PCWSTR pszMore, unsigned long dwFlags, + PWSTR* ppszPathOut); -WINPR_API HRESULT PathCchFindExtensionA(PCSTR pszPath, size_t cchPath, PCSTR* ppszExt); -WINPR_API HRESULT PathCchFindExtensionW(PCWSTR pszPath, size_t cchPath, PCWSTR* ppszExt); + WINPR_API HRESULT PathCchFindExtensionA(PCSTR pszPath, size_t cchPath, PCSTR* ppszExt); + WINPR_API HRESULT PathCchFindExtensionW(PCWSTR pszPath, size_t cchPath, PCWSTR* ppszExt); -WINPR_API HRESULT PathCchRenameExtensionA(PSTR pszPath, size_t cchPath, PCSTR pszExt); -WINPR_API HRESULT PathCchRenameExtensionW(PWSTR pszPath, size_t cchPath, PCWSTR pszExt); + WINPR_API HRESULT PathCchRenameExtensionA(PSTR pszPath, size_t cchPath, PCSTR pszExt); + WINPR_API HRESULT PathCchRenameExtensionW(PWSTR pszPath, size_t cchPath, PCWSTR pszExt); -WINPR_API HRESULT PathCchRemoveExtensionA(PSTR pszPath, size_t cchPath); -WINPR_API HRESULT PathCchRemoveExtensionW(PWSTR pszPath, size_t cchPath); + WINPR_API HRESULT PathCchRemoveExtensionA(PSTR pszPath, size_t cchPath); + WINPR_API HRESULT PathCchRemoveExtensionW(PWSTR pszPath, size_t cchPath); -WINPR_API BOOL PathCchIsRootA(PCSTR pszPath); -WINPR_API BOOL PathCchIsRootW(PCWSTR pszPath); + WINPR_API BOOL PathCchIsRootA(PCSTR pszPath); + WINPR_API BOOL PathCchIsRootW(PCWSTR pszPath); -WINPR_API BOOL PathIsUNCExA(PCSTR pszPath, PCSTR* ppszServer); -WINPR_API BOOL PathIsUNCExW(PCWSTR pszPath, PCWSTR* ppszServer); + WINPR_API BOOL PathIsUNCExA(PCSTR pszPath, PCSTR* ppszServer); + WINPR_API BOOL PathIsUNCExW(PCWSTR pszPath, PCWSTR* ppszServer); -WINPR_API HRESULT PathCchSkipRootA(PCSTR pszPath, PCSTR* ppszRootEnd); -WINPR_API HRESULT PathCchSkipRootW(PCWSTR pszPath, PCWSTR* ppszRootEnd); + WINPR_API HRESULT PathCchSkipRootA(PCSTR pszPath, PCSTR* ppszRootEnd); + WINPR_API HRESULT PathCchSkipRootW(PCWSTR pszPath, PCWSTR* ppszRootEnd); -WINPR_API HRESULT PathCchStripToRootA(PSTR pszPath, size_t cchPath); -WINPR_API HRESULT PathCchStripToRootW(PWSTR pszPath, size_t cchPath); + WINPR_API HRESULT PathCchStripToRootA(PSTR pszPath, size_t cchPath); + WINPR_API HRESULT PathCchStripToRootW(PWSTR pszPath, size_t cchPath); -WINPR_API HRESULT PathCchStripPrefixA(PSTR pszPath, size_t cchPath); -WINPR_API HRESULT PathCchStripPrefixW(PWSTR pszPath, size_t cchPath); + WINPR_API HRESULT PathCchStripPrefixA(PSTR pszPath, size_t cchPath); + WINPR_API HRESULT PathCchStripPrefixW(PWSTR pszPath, size_t cchPath); -WINPR_API HRESULT PathCchRemoveFileSpecA(PSTR pszPath, size_t cchPath); -WINPR_API HRESULT PathCchRemoveFileSpecW(PWSTR pszPath, size_t cchPath); + WINPR_API HRESULT PathCchRemoveFileSpecA(PSTR pszPath, size_t cchPath); + WINPR_API HRESULT PathCchRemoveFileSpecW(PWSTR pszPath, size_t cchPath); #ifdef UNICODE -#define PathCchAddBackslash PathCchAddBackslashW -#define PathCchRemoveBackslash PathCchRemoveBackslashW -#define PathCchAddBackslashEx PathCchAddBackslashExW -#define PathCchRemoveBackslashEx PathCchRemoveBackslashExW -#define PathCchAddExtension PathCchAddExtensionW -#define PathCchAppend PathCchAppendW -#define PathCchAppendEx PathCchAppendExW -#define PathCchCanonicalize PathCchCanonicalizeW -#define PathCchCanonicalizeEx PathCchCanonicalizeExW -#define PathAllocCanonicalize PathAllocCanonicalizeW -#define PathCchCombine PathCchCombineW -#define PathCchCombineEx PathCchCombineExW -#define PathAllocCombine PathAllocCombineW -#define PathCchFindExtension PathCchFindExtensionW -#define PathCchRenameExtension PathCchRenameExtensionW -#define PathCchRemoveExtension PathCchRemoveExtensionW -#define PathCchIsRoot PathCchIsRootW -#define PathIsUNCEx PathIsUNCExW -#define PathCchSkipRoot PathCchSkipRootW -#define PathCchStripToRoot PathCchStripToRootW -#define PathCchStripPrefix PathCchStripPrefixW -#define PathCchRemoveFileSpec PathCchRemoveFileSpecW +#define PathCchAddBackslash PathCchAddBackslashW +#define PathCchRemoveBackslash PathCchRemoveBackslashW +#define PathCchAddBackslashEx PathCchAddBackslashExW +#define PathCchRemoveBackslashEx PathCchRemoveBackslashExW +#define PathCchAddExtension PathCchAddExtensionW +#define PathCchAppend PathCchAppendW +#define PathCchAppendEx PathCchAppendExW +#define PathCchCanonicalize PathCchCanonicalizeW +#define PathCchCanonicalizeEx PathCchCanonicalizeExW +#define PathAllocCanonicalize PathAllocCanonicalizeW +#define PathCchCombine PathCchCombineW +#define PathCchCombineEx PathCchCombineExW +#define PathAllocCombine PathAllocCombineW +#define PathCchFindExtension PathCchFindExtensionW +#define PathCchRenameExtension PathCchRenameExtensionW +#define PathCchRemoveExtension PathCchRemoveExtensionW +#define PathCchIsRoot PathCchIsRootW +#define PathIsUNCEx PathIsUNCExW +#define PathCchSkipRoot PathCchSkipRootW +#define PathCchStripToRoot PathCchStripToRootW +#define PathCchStripPrefix PathCchStripPrefixW +#define PathCchRemoveFileSpec PathCchRemoveFileSpecW #else -#define PathCchAddBackslash PathCchAddBackslashA -#define PathCchRemoveBackslash PathCchRemoveBackslashA -#define PathCchAddBackslashEx PathCchAddBackslashExA -#define PathCchRemoveBackslashEx PathCchRemoveBackslashExA -#define PathCchAddExtension PathCchAddExtensionA -#define PathCchAppend PathCchAppendA -#define PathCchAppendEx PathCchAppendExA -#define PathCchCanonicalize PathCchCanonicalizeA -#define PathCchCanonicalizeEx PathCchCanonicalizeExA -#define PathAllocCanonicalize PathAllocCanonicalizeA -#define PathCchCombine PathCchCombineA -#define PathCchCombineEx PathCchCombineExA -#define PathAllocCombine PathAllocCombineA -#define PathCchFindExtension PathCchFindExtensionA -#define PathCchRenameExtension PathCchRenameExtensionA -#define PathCchRemoveExtension PathCchRemoveExtensionA -#define PathCchIsRoot PathCchIsRootA -#define PathIsUNCEx PathIsUNCExA -#define PathCchSkipRoot PathCchSkipRootA -#define PathCchStripToRoot PathCchStripToRootA -#define PathCchStripPrefix PathCchStripPrefixA -#define PathCchRemoveFileSpec PathCchRemoveFileSpecA +#define PathCchAddBackslash PathCchAddBackslashA +#define PathCchRemoveBackslash PathCchRemoveBackslashA +#define PathCchAddBackslashEx PathCchAddBackslashExA +#define PathCchRemoveBackslashEx PathCchRemoveBackslashExA +#define PathCchAddExtension PathCchAddExtensionA +#define PathCchAppend PathCchAppendA +#define PathCchAppendEx PathCchAppendExA +#define PathCchCanonicalize PathCchCanonicalizeA +#define PathCchCanonicalizeEx PathCchCanonicalizeExA +#define PathAllocCanonicalize PathAllocCanonicalizeA +#define PathCchCombine PathCchCombineA +#define PathCchCombineEx PathCchCombineExA +#define PathAllocCombine PathAllocCombineA +#define PathCchFindExtension PathCchFindExtensionA +#define PathCchRenameExtension PathCchRenameExtensionA +#define PathCchRemoveExtension PathCchRemoveExtensionA +#define PathCchIsRoot PathCchIsRootA +#define PathIsUNCEx PathIsUNCExA +#define PathCchSkipRoot PathCchSkipRootA +#define PathCchStripToRoot PathCchStripToRootA +#define PathCchStripPrefix PathCchStripPrefixA +#define PathCchRemoveFileSpec PathCchRemoveFileSpecA #endif -/* Unix-style Paths */ + /* Unix-style Paths */ -WINPR_API HRESULT PathCchAddSlashA(PSTR pszPath, size_t cchPath); -WINPR_API HRESULT PathCchAddSlashW(PWSTR pszPath, size_t cchPath); + WINPR_API HRESULT PathCchAddSlashA(PSTR pszPath, size_t cchPath); + WINPR_API HRESULT PathCchAddSlashW(PWSTR pszPath, size_t cchPath); -WINPR_API HRESULT PathCchAddSlashExA(PSTR pszPath, size_t cchPath, PSTR* ppszEnd, size_t* pcchRemaining); -WINPR_API HRESULT PathCchAddSlashExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, size_t* pcchRemaining); + WINPR_API HRESULT PathCchAddSlashExA(PSTR pszPath, size_t cchPath, PSTR* ppszEnd, + size_t* pcchRemaining); + WINPR_API HRESULT PathCchAddSlashExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, + size_t* pcchRemaining); -WINPR_API HRESULT UnixPathCchAddExtensionA(PSTR pszPath, size_t cchPath, PCSTR pszExt); -WINPR_API HRESULT UnixPathCchAddExtensionW(PWSTR pszPath, size_t cchPath, PCWSTR pszExt); + WINPR_API HRESULT UnixPathCchAddExtensionA(PSTR pszPath, size_t cchPath, PCSTR pszExt); + WINPR_API HRESULT UnixPathCchAddExtensionW(PWSTR pszPath, size_t cchPath, PCWSTR pszExt); -WINPR_API HRESULT UnixPathCchAppendA(PSTR pszPath, size_t cchPath, PCSTR pszMore); -WINPR_API HRESULT UnixPathCchAppendW(PWSTR pszPath, size_t cchPath, PCWSTR pszMore); + WINPR_API HRESULT UnixPathCchAppendA(PSTR pszPath, size_t cchPath, PCSTR pszMore); + WINPR_API HRESULT UnixPathCchAppendW(PWSTR pszPath, size_t cchPath, PCWSTR pszMore); -WINPR_API HRESULT UnixPathAllocCombineA(PCSTR pszPathIn, PCSTR pszMore, unsigned long dwFlags, PSTR* ppszPathOut); -WINPR_API HRESULT UnixPathAllocCombineW(PCWSTR pszPathIn, PCWSTR pszMore, unsigned long dwFlags, PWSTR* ppszPathOut); + WINPR_API HRESULT UnixPathAllocCombineA(PCSTR pszPathIn, PCSTR pszMore, unsigned long dwFlags, + PSTR* ppszPathOut); + WINPR_API HRESULT UnixPathAllocCombineW(PCWSTR pszPathIn, PCWSTR pszMore, unsigned long dwFlags, + PWSTR* ppszPathOut); #ifdef UNICODE -#define PathCchAddSlash PathCchAddSlashW -#define PathCchAddSlashEx PathCchAddSlashExW -#define UnixPathCchAddExtension UnixPathCchAddExtensionW -#define UnixPathCchAppend UnixPathCchAppendW -#define UnixPathAllocCombine UnixPathAllocCombineW +#define PathCchAddSlash PathCchAddSlashW +#define PathCchAddSlashEx PathCchAddSlashExW +#define UnixPathCchAddExtension UnixPathCchAddExtensionW +#define UnixPathCchAppend UnixPathCchAppendW +#define UnixPathAllocCombine UnixPathAllocCombineW #else -#define PathCchAddSlash PathCchAddSlashA -#define PathCchAddSlashEx PathCchAddSlashExA -#define UnixPathCchAddExtension UnixPathCchAddExtensionA -#define UnixPathCchAppend UnixPathCchAppendA -#define UnixPathAllocCombine UnixPathAllocCombineA +#define PathCchAddSlash PathCchAddSlashA +#define PathCchAddSlashEx PathCchAddSlashExA +#define UnixPathCchAddExtension UnixPathCchAddExtensionA +#define UnixPathCchAppend UnixPathCchAppendA +#define UnixPathAllocCombine UnixPathAllocCombineA #endif -/* Native-style Paths */ + /* Native-style Paths */ -WINPR_API HRESULT PathCchAddSeparatorA(PSTR pszPath, size_t cchPath); -WINPR_API HRESULT PathCchAddSeparatorW(PWSTR pszPath, size_t cchPath); + WINPR_API HRESULT PathCchAddSeparatorA(PSTR pszPath, size_t cchPath); + WINPR_API HRESULT PathCchAddSeparatorW(PWSTR pszPath, size_t cchPath); -WINPR_API HRESULT PathCchAddSeparatorExA(PSTR pszPath, size_t cchPath, PSTR* ppszEnd, size_t* pcchRemaining); -WINPR_API HRESULT PathCchAddSeparatorExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, size_t* pcchRemaining); + WINPR_API HRESULT PathCchAddSeparatorExA(PSTR pszPath, size_t cchPath, PSTR* ppszEnd, + size_t* pcchRemaining); + WINPR_API HRESULT PathCchAddSeparatorExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, + size_t* pcchRemaining); -WINPR_API HRESULT NativePathCchAddExtensionA(PSTR pszPath, size_t cchPath, PCSTR pszExt); -WINPR_API HRESULT NativePathCchAddExtensionW(PWSTR pszPath, size_t cchPath, PCWSTR pszExt); + WINPR_API HRESULT NativePathCchAddExtensionA(PSTR pszPath, size_t cchPath, PCSTR pszExt); + WINPR_API HRESULT NativePathCchAddExtensionW(PWSTR pszPath, size_t cchPath, PCWSTR pszExt); -WINPR_API HRESULT NativePathCchAppendA(PSTR pszPath, size_t cchPath, PCSTR pszMore); -WINPR_API HRESULT NativePathCchAppendW(PWSTR pszPath, size_t cchPath, PCWSTR pszMore); + WINPR_API HRESULT NativePathCchAppendA(PSTR pszPath, size_t cchPath, PCSTR pszMore); + WINPR_API HRESULT NativePathCchAppendW(PWSTR pszPath, size_t cchPath, PCWSTR pszMore); -WINPR_API HRESULT NativePathAllocCombineA(PCSTR pszPathIn, PCSTR pszMore, unsigned long dwFlags, PSTR* ppszPathOut); -WINPR_API HRESULT NativePathAllocCombineW(PCWSTR pszPathIn, PCWSTR pszMore, unsigned long dwFlags, PWSTR* ppszPathOut); + WINPR_API HRESULT NativePathAllocCombineA(PCSTR pszPathIn, PCSTR pszMore, unsigned long dwFlags, + PSTR* ppszPathOut); + WINPR_API HRESULT NativePathAllocCombineW(PCWSTR pszPathIn, PCWSTR pszMore, + unsigned long dwFlags, PWSTR* ppszPathOut); #ifdef UNICODE -#define PathCchAddSeparator PathCchAddSeparatorW -#define PathCchAddSeparatorEx PathCchAddSeparatorExW -#define NativePathCchAddExtension NativePathCchAddExtensionW -#define NativePathCchAppend NativePathCchAppendW -#define NativePathAllocCombine NativePathAllocCombineW +#define PathCchAddSeparator PathCchAddSeparatorW +#define PathCchAddSeparatorEx PathCchAddSeparatorExW +#define NativePathCchAddExtension NativePathCchAddExtensionW +#define NativePathCchAppend NativePathCchAppendW +#define NativePathAllocCombine NativePathAllocCombineW #else -#define PathCchAddSeparator PathCchAddSeparatorA -#define PathCchAddSeparatorEx PathCchAddSeparatorExA -#define NativePathCchAddExtension NativePathCchAddExtensionA -#define NativePathCchAppend NativePathCchAppendA -#define NativePathAllocCombine NativePathAllocCombineA +#define PathCchAddSeparator PathCchAddSeparatorA +#define PathCchAddSeparatorEx PathCchAddSeparatorExA +#define NativePathCchAddExtension NativePathCchAddExtensionA +#define NativePathCchAppend NativePathCchAppendA +#define NativePathAllocCombine NativePathAllocCombineA #endif -/* Path Portability Functions */ + /* Path Portability Functions */ -#define PATH_STYLE_WINDOWS 0x00000001 -#define PATH_STYLE_UNIX 0x00000002 -#define PATH_STYLE_NATIVE 0x00000003 +#define PATH_STYLE_WINDOWS 0x00000001 +#define PATH_STYLE_UNIX 0x00000002 +#define PATH_STYLE_NATIVE 0x00000003 -#define PATH_SHARED_LIB_EXT_WITH_DOT 0x00000001 -#define PATH_SHARED_LIB_EXT_APPLE_SO 0x00000002 -#define PATH_SHARED_LIB_EXT_EXPLICIT 0x80000000 -#define PATH_SHARED_LIB_EXT_EXPLICIT_DLL 0x80000001 -#define PATH_SHARED_LIB_EXT_EXPLICIT_SO 0x80000002 -#define PATH_SHARED_LIB_EXT_EXPLICIT_DYLIB 0x80000003 +#define PATH_SHARED_LIB_EXT_WITH_DOT 0x00000001 +#define PATH_SHARED_LIB_EXT_APPLE_SO 0x00000002 +#define PATH_SHARED_LIB_EXT_EXPLICIT 0x80000000 +#define PATH_SHARED_LIB_EXT_EXPLICIT_DLL 0x80000001 +#define PATH_SHARED_LIB_EXT_EXPLICIT_SO 0x80000002 +#define PATH_SHARED_LIB_EXT_EXPLICIT_DYLIB 0x80000003 -WINPR_API HRESULT PathCchConvertStyleA(PSTR pszPath, size_t cchPath, unsigned long dwFlags); -WINPR_API HRESULT PathCchConvertStyleW(PWSTR pszPath, size_t cchPath, unsigned long dwFlags); + WINPR_API HRESULT PathCchConvertStyleA(PSTR pszPath, size_t cchPath, unsigned long dwFlags); + WINPR_API HRESULT PathCchConvertStyleW(PWSTR pszPath, size_t cchPath, unsigned long dwFlags); -WINPR_API char PathGetSeparatorA(unsigned long dwFlags); -WINPR_API WCHAR PathGetSeparatorW(unsigned long dwFlags); + WINPR_API char PathGetSeparatorA(unsigned long dwFlags); + WINPR_API WCHAR PathGetSeparatorW(unsigned long dwFlags); -WINPR_API PCSTR PathGetSharedLibraryExtensionA(unsigned long dwFlags); -WINPR_API PCWSTR PathGetSharedLibraryExtensionW(unsigned long dwFlags); + WINPR_API PCSTR PathGetSharedLibraryExtensionA(unsigned long dwFlags); + WINPR_API PCWSTR PathGetSharedLibraryExtensionW(unsigned long dwFlags); #ifdef UNICODE -#define PathCchConvertStyle PathCchConvertStyleW -#define PathGetSeparator PathGetSeparatorW -#define PathGetSharedLibraryExtension PathGetSharedLibraryExtensionW +#define PathCchConvertStyle PathCchConvertStyleW +#define PathGetSeparator PathGetSeparatorW +#define PathGetSharedLibraryExtension PathGetSharedLibraryExtensionW #else -#define PathCchConvertStyle PathCchConvertStyleA -#define PathGetSeparator PathGetSeparatorW -#define PathGetSharedLibraryExtension PathGetSharedLibraryExtensionA +#define PathCchConvertStyle PathCchConvertStyleA +#define PathGetSeparator PathGetSeparatorW +#define PathGetSharedLibraryExtension PathGetSharedLibraryExtensionA #endif #ifdef __cplusplus @@ -267,42 +293,43 @@ WINPR_API PCWSTR PathGetSharedLibraryExtensionW(unsigned long dwFlags); * Shell Path Functions */ -#define KNOWN_PATH_HOME 1 -#define KNOWN_PATH_TEMP 2 -#define KNOWN_PATH_XDG_DATA_HOME 3 -#define KNOWN_PATH_XDG_CONFIG_HOME 4 -#define KNOWN_PATH_XDG_CACHE_HOME 5 -#define KNOWN_PATH_XDG_RUNTIME_DIR 6 +#define KNOWN_PATH_HOME 1 +#define KNOWN_PATH_TEMP 2 +#define KNOWN_PATH_XDG_DATA_HOME 3 +#define KNOWN_PATH_XDG_CONFIG_HOME 4 +#define KNOWN_PATH_XDG_CACHE_HOME 5 +#define KNOWN_PATH_XDG_RUNTIME_DIR 6 #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API char* GetKnownPath(int id); -WINPR_API char* GetKnownSubPath(int id, const char* path); -WINPR_API char* GetEnvironmentPath(char* name); -WINPR_API char* GetEnvironmentSubPath(char* name, const char* path); -WINPR_API char* GetCombinedPath(const char* basePath, const char* subPath); + WINPR_API char* GetKnownPath(int id); + WINPR_API char* GetKnownSubPath(int id, const char* path); + WINPR_API char* GetEnvironmentPath(char* name); + WINPR_API char* GetEnvironmentSubPath(char* name, const char* path); + WINPR_API char* GetCombinedPath(const char* basePath, const char* subPath); -WINPR_API BOOL PathMakePathA(LPCSTR path, LPSECURITY_ATTRIBUTES lpAttributes); + WINPR_API BOOL PathMakePathA(LPCSTR path, LPSECURITY_ATTRIBUTES lpAttributes); #if !defined(_WIN32) || defined(_UWP) -WINPR_API BOOL PathIsRelativeA(LPCSTR pszPath); -WINPR_API BOOL PathIsRelativeW(LPCWSTR pszPath); + WINPR_API BOOL PathIsRelativeA(LPCSTR pszPath); + WINPR_API BOOL PathIsRelativeW(LPCWSTR pszPath); -WINPR_API BOOL PathFileExistsA(LPCSTR pszPath); -WINPR_API BOOL PathFileExistsW(LPCWSTR pszPath); + WINPR_API BOOL PathFileExistsA(LPCSTR pszPath); + WINPR_API BOOL PathFileExistsW(LPCWSTR pszPath); -WINPR_API BOOL PathIsDirectoryEmptyA(LPCSTR pszPath); -WINPR_API BOOL PathIsDirectoryEmptyW(LPCWSTR pszPath); + WINPR_API BOOL PathIsDirectoryEmptyA(LPCSTR pszPath); + WINPR_API BOOL PathIsDirectoryEmptyW(LPCWSTR pszPath); #ifdef UNICODE -#define PathFileExists PathFileExistsW -#define PathIsDirectoryEmpty PathIsDirectoryEmptyW +#define PathFileExists PathFileExistsW +#define PathIsDirectoryEmpty PathIsDirectoryEmptyW #else -#define PathFileExists PathFileExistsA -#define PathIsDirectoryEmpty PathIsDirectoryEmptyA +#define PathFileExists PathFileExistsA +#define PathIsDirectoryEmpty PathIsDirectoryEmptyA #endif #endif diff --git a/winpr/include/winpr/pipe.h b/winpr/include/winpr/pipe.h index f5e8ecf16..932fda5b4 100644 --- a/winpr/include/winpr/pipe.h +++ b/winpr/include/winpr/pipe.h @@ -28,82 +28,94 @@ #ifndef _WIN32 -#define PIPE_UNLIMITED_INSTANCES 0xFF +#define PIPE_UNLIMITED_INSTANCES 0xFF -#define PIPE_ACCESS_INBOUND 0x00000001 -#define PIPE_ACCESS_OUTBOUND 0x00000002 -#define PIPE_ACCESS_DUPLEX 0x00000003 +#define PIPE_ACCESS_INBOUND 0x00000001 +#define PIPE_ACCESS_OUTBOUND 0x00000002 +#define PIPE_ACCESS_DUPLEX 0x00000003 -#define FILE_FLAG_FIRST_PIPE_INSTANCE 0x00080000 -#define FILE_FLAG_WRITE_THROUGH 0x80000000 -#define FILE_FLAG_OVERLAPPED 0x40000000 +#define FILE_FLAG_FIRST_PIPE_INSTANCE 0x00080000 +#define FILE_FLAG_WRITE_THROUGH 0x80000000 +#define FILE_FLAG_OVERLAPPED 0x40000000 -#define PIPE_CLIENT_END 0x00000000 -#define PIPE_SERVER_END 0x00000001 +#define PIPE_CLIENT_END 0x00000000 +#define PIPE_SERVER_END 0x00000001 -#define PIPE_TYPE_BYTE 0x00000000 -#define PIPE_TYPE_MESSAGE 0x00000004 +#define PIPE_TYPE_BYTE 0x00000000 +#define PIPE_TYPE_MESSAGE 0x00000004 -#define PIPE_READMODE_BYTE 0x00000000 -#define PIPE_READMODE_MESSAGE 0x00000002 +#define PIPE_READMODE_BYTE 0x00000000 +#define PIPE_READMODE_MESSAGE 0x00000002 -#define PIPE_WAIT 0x00000000 -#define PIPE_NOWAIT 0x00000001 +#define PIPE_WAIT 0x00000000 +#define PIPE_NOWAIT 0x00000001 -#define PIPE_ACCEPT_REMOTE_CLIENTS 0x00000000 -#define PIPE_REJECT_REMOTE_CLIENTS 0x00000008 +#define PIPE_ACCEPT_REMOTE_CLIENTS 0x00000000 +#define PIPE_REJECT_REMOTE_CLIENTS 0x00000008 -#define NMPWAIT_USE_DEFAULT_WAIT 0x00000000 -#define NMPWAIT_NOWAIT 0x00000001 -#define NMPWAIT_WAIT_FOREVER 0xFFFFFFFF +#define NMPWAIT_USE_DEFAULT_WAIT 0x00000000 +#define NMPWAIT_NOWAIT 0x00000001 +#define NMPWAIT_WAIT_FOREVER 0xFFFFFFFF #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/** - * Unnamed pipe - */ + /** + * Unnamed pipe + */ -WINPR_API BOOL CreatePipe(PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES lpPipeAttributes, DWORD nSize); + WINPR_API BOOL CreatePipe(PHANDLE hReadPipe, PHANDLE hWritePipe, + LPSECURITY_ATTRIBUTES lpPipeAttributes, DWORD nSize); -/** - * Named pipe - */ + /** + * Named pipe + */ -WINPR_API HANDLE CreateNamedPipeA(LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, - DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes); -WINPR_API HANDLE CreateNamedPipeW(LPCWSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, - DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes); + WINPR_API HANDLE CreateNamedPipeA(LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, + DWORD nMaxInstances, DWORD nOutBufferSize, + DWORD nInBufferSize, DWORD nDefaultTimeOut, + LPSECURITY_ATTRIBUTES lpSecurityAttributes); + WINPR_API HANDLE CreateNamedPipeW(LPCWSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, + DWORD nMaxInstances, DWORD nOutBufferSize, + DWORD nInBufferSize, DWORD nDefaultTimeOut, + LPSECURITY_ATTRIBUTES lpSecurityAttributes); -WINPR_API BOOL ConnectNamedPipe(HANDLE hNamedPipe, LPOVERLAPPED lpOverlapped); + WINPR_API BOOL ConnectNamedPipe(HANDLE hNamedPipe, LPOVERLAPPED lpOverlapped); -WINPR_API BOOL DisconnectNamedPipe(HANDLE hNamedPipe); + WINPR_API BOOL DisconnectNamedPipe(HANDLE hNamedPipe); -WINPR_API BOOL PeekNamedPipe(HANDLE hNamedPipe, LPVOID lpBuffer, DWORD nBufferSize, - LPDWORD lpBytesRead, LPDWORD lpTotalBytesAvail, LPDWORD lpBytesLeftThisMessage); + WINPR_API BOOL PeekNamedPipe(HANDLE hNamedPipe, LPVOID lpBuffer, DWORD nBufferSize, + LPDWORD lpBytesRead, LPDWORD lpTotalBytesAvail, + LPDWORD lpBytesLeftThisMessage); -WINPR_API BOOL TransactNamedPipe(HANDLE hNamedPipe, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, - DWORD nOutBufferSize, LPDWORD lpBytesRead, LPOVERLAPPED lpOverlapped); + WINPR_API BOOL TransactNamedPipe(HANDLE hNamedPipe, LPVOID lpInBuffer, DWORD nInBufferSize, + LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesRead, + LPOVERLAPPED lpOverlapped); -WINPR_API BOOL WaitNamedPipeA(LPCSTR lpNamedPipeName, DWORD nTimeOut); -WINPR_API BOOL WaitNamedPipeW(LPCWSTR lpNamedPipeName, DWORD nTimeOut); + WINPR_API BOOL WaitNamedPipeA(LPCSTR lpNamedPipeName, DWORD nTimeOut); + WINPR_API BOOL WaitNamedPipeW(LPCWSTR lpNamedPipeName, DWORD nTimeOut); -WINPR_API BOOL SetNamedPipeHandleState(HANDLE hNamedPipe, LPDWORD lpMode, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout); + WINPR_API BOOL SetNamedPipeHandleState(HANDLE hNamedPipe, LPDWORD lpMode, + LPDWORD lpMaxCollectionCount, + LPDWORD lpCollectDataTimeout); -WINPR_API BOOL ImpersonateNamedPipeClient(HANDLE hNamedPipe); + WINPR_API BOOL ImpersonateNamedPipeClient(HANDLE hNamedPipe); -WINPR_API BOOL GetNamedPipeClientComputerNameA(HANDLE Pipe, LPCSTR ClientComputerName, ULONG ClientComputerNameLength); -WINPR_API BOOL GetNamedPipeClientComputerNameW(HANDLE Pipe, LPCWSTR ClientComputerName, ULONG ClientComputerNameLength); + WINPR_API BOOL GetNamedPipeClientComputerNameA(HANDLE Pipe, LPCSTR ClientComputerName, + ULONG ClientComputerNameLength); + WINPR_API BOOL GetNamedPipeClientComputerNameW(HANDLE Pipe, LPCWSTR ClientComputerName, + ULONG ClientComputerNameLength); #ifdef UNICODE -#define CreateNamedPipe CreateNamedPipeW -#define WaitNamedPipe WaitNamedPipeW -#define GetNamedPipeClientComputerName GetNamedPipeClientComputerNameW +#define CreateNamedPipe CreateNamedPipeW +#define WaitNamedPipe WaitNamedPipeW +#define GetNamedPipeClientComputerName GetNamedPipeClientComputerNameW #else -#define CreateNamedPipe CreateNamedPipeA -#define WaitNamedPipe WaitNamedPipeA -#define GetNamedPipeClientComputerName GetNamedPipeClientComputerNameA +#define CreateNamedPipe CreateNamedPipeA +#define WaitNamedPipe WaitNamedPipeA +#define GetNamedPipeClientComputerName GetNamedPipeClientComputerNameA #endif #ifdef __cplusplus diff --git a/winpr/include/winpr/platform.h b/winpr/include/winpr/platform.h index bc1c984cc..f6f3c97d6 100644 --- a/winpr/include/winpr/platform.h +++ b/winpr/include/winpr/platform.h @@ -34,21 +34,20 @@ /* Intel x86 (_M_IX86) */ -#if defined(i386) || defined(__i386) || defined(__i386__) || \ - defined(__i486__) || defined(__i586__) || defined(__i686__) || \ - defined(__X86__) || defined(_X86_) || defined(__I86__) || \ - defined(__IA32__) || defined(__THW_INTEL__) || defined(__INTEL__) +#if defined(i386) || defined(__i386) || defined(__i386__) || defined(__i486__) || \ + defined(__i586__) || defined(__i686__) || defined(__X86__) || defined(_X86_) || \ + defined(__I86__) || defined(__IA32__) || defined(__THW_INTEL__) || defined(__INTEL__) #ifndef _M_IX86 -#define _M_IX86 1 +#define _M_IX86 1 #endif #endif /* AMD64 (_M_AMD64) */ -#if defined(__amd64) || defined(__amd64__) || \ - defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) +#if defined(__amd64) || defined(__amd64__) || defined(__x86_64) || defined(__x86_64__) || \ + defined(_M_X64) #ifndef _M_AMD64 -#define _M_AMD64 1 +#define _M_AMD64 1 #endif #endif @@ -56,16 +55,16 @@ #if defined(_M_IX86) || defined(_M_AMD64) #ifndef _M_IX86_AMD64 -#define _M_IX86_AMD64 1 +#define _M_IX86_AMD64 1 #endif #endif /* ARM (_M_ARM) */ -#if defined(__arm__) || defined(__thumb__) || \ - defined(__TARGET_ARCH_ARM) || defined(__TARGET_ARCH_THUMB) +#if defined(__arm__) || defined(__thumb__) || defined(__TARGET_ARCH_ARM) || \ + defined(__TARGET_ARCH_THUMB) #ifndef _M_ARM -#define _M_ARM 1 +#define _M_ARM 1 #endif #endif @@ -73,43 +72,40 @@ #if defined(__aarch64__) #ifndef _M_ARM64 -#define _M_ARM64 1 +#define _M_ARM64 1 #endif #endif /* MIPS (_M_MIPS) */ -#if defined(mips) || defined(__mips) || \ - defined(__mips__) || defined(__MIPS__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(__MIPS__) #ifndef _M_MIPS -#define _M_MIPS 1 +#define _M_MIPS 1 #endif #endif /* MIPS64 (_M_MIPS64) */ -#if defined(mips64) || defined(__mips64) || \ - defined(__mips64__) || defined(__MIPS64__) +#if defined(mips64) || defined(__mips64) || defined(__mips64__) || defined(__MIPS64__) #ifndef _M_MIPS64 -#define _M_MIPS64 1 +#define _M_MIPS64 1 #endif #endif /* PowerPC (_M_PPC) */ -#if defined(__ppc__) || defined(__powerpc) || \ - defined(__powerpc__) || defined(__POWERPC__) || defined(_ARCH_PPC) +#if defined(__ppc__) || defined(__powerpc) || defined(__powerpc__) || defined(__POWERPC__) || \ + defined(_ARCH_PPC) #ifndef _M_PPC -#define _M_PPC 1 +#define _M_PPC 1 #endif #endif /* Intel Itanium (_M_IA64) */ -#if defined(__ia64) || defined(__ia64__) || \ - defined(_IA64) || defined(__IA64__) +#if defined(__ia64) || defined(__ia64__) || defined(_IA64) || defined(__IA64__) #ifndef _M_IA64 -#define _M_IA64 1 +#define _M_IA64 1 #endif #endif @@ -117,7 +113,7 @@ #if defined(__alpha) || defined(__alpha__) #ifndef _M_ALPHA -#define _M_ALPHA 1 +#define _M_ALPHA 1 #endif #endif @@ -125,7 +121,7 @@ #if defined(__sparc) || defined(__sparc__) #ifndef _M_SPARC -#define _M_SPARC 1 +#define _M_SPARC 1 #endif #endif @@ -141,14 +137,14 @@ #if defined(WINAPI_FAMILY) #if (WINAPI_FAMILY == WINAPI_FAMILY_APP) #ifndef _WINRT -#define _WINRT 1 +#define _WINRT 1 #endif #endif #endif #if defined(__cplusplus_winrt) #ifndef _WINRT -#define _WINRT 1 +#define _WINRT 1 #endif #endif @@ -156,7 +152,7 @@ #if defined(linux) || defined(__linux) #ifndef __linux__ -#define __linux__ 1 +#define __linux__ 1 #endif #endif @@ -173,7 +169,7 @@ /* iOS (__IOS__) */ #ifndef __IOS__ -#define __IOS__ 1 +#define __IOS__ 1 #endif #elif (TARGET_OS_MAC == 1) @@ -181,7 +177,7 @@ /* Mac OS X (__MACOSX__) */ #ifndef __MACOSX__ -#define __MACOSX__ 1 +#define __MACOSX__ 1 #endif #endif @@ -203,7 +199,7 @@ #if defined(sun) #ifndef __sun -#define __sun 1 +#define __sun 1 #endif #endif @@ -211,7 +207,7 @@ #if defined(sgi) #ifndef __sgi -#define __sgi 1 +#define __sgi 1 #endif #endif @@ -219,7 +215,7 @@ #if defined(__TOS_AIX__) #ifndef _AIX -#define _AIX 1 +#define _AIX 1 #endif #endif @@ -227,7 +223,7 @@ #if defined(hpux) || defined(_hpux) #ifndef __hpux -#define __hpux 1 +#define __hpux 1 #endif #endif @@ -244,8 +240,8 @@ #include #endif -#if defined(__FreeBSD__) || defined(__NetBSD__) || \ - defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \ + defined(__DragonFly__) || defined(__APPLE__) #include #endif @@ -255,16 +251,16 @@ #if (__BYTE_ORDER == __BIG_ENDIAN) #ifndef __BIG_ENDIAN__ -#define __BIG_ENDIAN__ 1 +#define __BIG_ENDIAN__ 1 #endif #endif #else -#if defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || \ - defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__) +#if defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || defined(_MIPSEB) || \ + defined(__MIPSEB) || defined(__MIPSEB__) #ifndef __BIG_ENDIAN__ -#define __BIG_ENDIAN__ 1 +#define __BIG_ENDIAN__ 1 #endif #endif @@ -276,16 +272,16 @@ #if (__BYTE_ORDER == __LITTLE_ENDIAN) #ifndef __LITTLE_ENDIAN__ -#define __LITTLE_ENDIAN__ 1 +#define __LITTLE_ENDIAN__ 1 #endif #endif #else -#if defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || \ - defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__) +#if defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(_MIPSEL) || \ + defined(__MIPSEL) || defined(__MIPSEL__) #ifndef __LITTLE_ENDIAN__ -#define __LITTLE_ENDIAN__ 1 +#define __LITTLE_ENDIAN__ 1 #endif #endif diff --git a/winpr/include/winpr/pool.h b/winpr/include/winpr/pool.h index 1d52c969f..62111dcdd 100644 --- a/winpr/include/winpr/pool.h +++ b/winpr/include/winpr/pool.h @@ -56,14 +56,13 @@ typedef struct _TP_CALLBACK_ENVIRON_V1 struct _ACTIVATION_CONTEXT* ActivationContext; PTP_SIMPLE_CALLBACK FinalizationCallback; - union - { + union { DWORD Flags; struct { - DWORD LongFunction: 1; - DWORD Persistent: 1; - DWORD Private: 30; + DWORD LongFunction : 1; + DWORD Persistent : 1; + DWORD Private : 30; } s; } u; } TP_CALLBACK_ENVIRON_V1; @@ -80,7 +79,6 @@ typedef struct _TP_WAIT TP_WAIT, *PTP_WAIT; typedef struct _TP_IO TP_IO, *PTP_IO; - #ifndef _WIN32 typedef VOID (*PTP_WORK_CALLBACK)(PTP_CALLBACK_INSTANCE Instance, PVOID Context, PTP_WORK Work); @@ -107,43 +105,44 @@ logic tries to fix that. #ifndef PTP_WIN32_IO_CALLBACK_DEFINED typedef VOID (*PTP_WIN32_IO_CALLBACK)(PTP_CALLBACK_INSTANCE Instance, PVOID Context, - PVOID Overlapped, - ULONG IoResult, ULONG_PTR NumberOfBytesTransferred, PTP_IO Io); + PVOID Overlapped, ULONG IoResult, + ULONG_PTR NumberOfBytesTransferred, PTP_IO Io); #endif #if (!defined(_WIN32) || ((defined(_WIN32) && (_WIN32_WINNT < 0x0600)))) -#define WINPR_THREAD_POOL 1 +#define WINPR_THREAD_POOL 1 #endif #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Synch */ + /* Synch */ #ifdef WINPR_THREAD_POOL -WINPR_API PTP_WAIT winpr_CreateThreadpoolWait(PTP_WAIT_CALLBACK pfnwa, PVOID pv, - PTP_CALLBACK_ENVIRON pcbe); -WINPR_API VOID winpr_CloseThreadpoolWait(PTP_WAIT pwa); -WINPR_API VOID winpr_SetThreadpoolWait(PTP_WAIT pwa, HANDLE h, PFILETIME pftTimeout); -WINPR_API VOID winpr_WaitForThreadpoolWaitCallbacks(PTP_WAIT pwa, BOOL fCancelPendingCallbacks); + WINPR_API PTP_WAIT winpr_CreateThreadpoolWait(PTP_WAIT_CALLBACK pfnwa, PVOID pv, + PTP_CALLBACK_ENVIRON pcbe); + WINPR_API VOID winpr_CloseThreadpoolWait(PTP_WAIT pwa); + WINPR_API VOID winpr_SetThreadpoolWait(PTP_WAIT pwa, HANDLE h, PFILETIME pftTimeout); + WINPR_API VOID winpr_WaitForThreadpoolWaitCallbacks(PTP_WAIT pwa, BOOL fCancelPendingCallbacks); #define CreateThreadpoolWait winpr_CreateThreadpoolWait #define CloseThreadpoolWait winpr_CloseThreadpoolWait #define SetThreadpoolWait winpr_SetThreadpoolWait #define WaitForThreadpoolWaitCallbacks winpr_WaitForThreadpoolWaitCallbacks -/* Work */ + /* Work */ -WINPR_API PTP_WORK winpr_CreateThreadpoolWork(PTP_WORK_CALLBACK pfnwk, PVOID pv, - PTP_CALLBACK_ENVIRON pcbe); -WINPR_API VOID winpr_CloseThreadpoolWork(PTP_WORK pwk); -WINPR_API VOID winpr_SubmitThreadpoolWork(PTP_WORK pwk); -WINPR_API BOOL winpr_TrySubmitThreadpoolCallback(PTP_SIMPLE_CALLBACK pfns, PVOID pv, - PTP_CALLBACK_ENVIRON pcbe); -WINPR_API VOID winpr_WaitForThreadpoolWorkCallbacks(PTP_WORK pwk, BOOL fCancelPendingCallbacks); + WINPR_API PTP_WORK winpr_CreateThreadpoolWork(PTP_WORK_CALLBACK pfnwk, PVOID pv, + PTP_CALLBACK_ENVIRON pcbe); + WINPR_API VOID winpr_CloseThreadpoolWork(PTP_WORK pwk); + WINPR_API VOID winpr_SubmitThreadpoolWork(PTP_WORK pwk); + WINPR_API BOOL winpr_TrySubmitThreadpoolCallback(PTP_SIMPLE_CALLBACK pfns, PVOID pv, + PTP_CALLBACK_ENVIRON pcbe); + WINPR_API VOID winpr_WaitForThreadpoolWorkCallbacks(PTP_WORK pwk, BOOL fCancelPendingCallbacks); #define CreateThreadpoolWork winpr_CreateThreadpoolWork #define CloseThreadpoolWork winpr_CloseThreadpoolWork @@ -151,15 +150,16 @@ WINPR_API VOID winpr_WaitForThreadpoolWorkCallbacks(PTP_WORK pwk, BOOL fCancelPe #define TrySubmitThreadpoolCallback winpr_TrySubmitThreadpoolCallback #define WaitForThreadpoolWorkCallbacks winpr_WaitForThreadpoolWorkCallbacks -/* Timer */ + /* Timer */ -WINPR_API PTP_TIMER winpr_CreateThreadpoolTimer(PTP_TIMER_CALLBACK pfnti, PVOID pv, - PTP_CALLBACK_ENVIRON pcbe); -WINPR_API VOID winpr_CloseThreadpoolTimer(PTP_TIMER pti); -WINPR_API BOOL winpr_IsThreadpoolTimerSet(PTP_TIMER pti); -WINPR_API VOID winpr_SetThreadpoolTimer(PTP_TIMER pti, PFILETIME pftDueTime, DWORD msPeriod, - DWORD msWindowLength); -WINPR_API VOID winpr_WaitForThreadpoolTimerCallbacks(PTP_TIMER pti, BOOL fCancelPendingCallbacks); + WINPR_API PTP_TIMER winpr_CreateThreadpoolTimer(PTP_TIMER_CALLBACK pfnti, PVOID pv, + PTP_CALLBACK_ENVIRON pcbe); + WINPR_API VOID winpr_CloseThreadpoolTimer(PTP_TIMER pti); + WINPR_API BOOL winpr_IsThreadpoolTimerSet(PTP_TIMER pti); + WINPR_API VOID winpr_SetThreadpoolTimer(PTP_TIMER pti, PFILETIME pftDueTime, DWORD msPeriod, + DWORD msWindowLength); + WINPR_API VOID winpr_WaitForThreadpoolTimerCallbacks(PTP_TIMER pti, + BOOL fCancelPendingCallbacks); #define CreateThreadpoolTimer winpr_CreateThreadpoolTimer #define CloseThreadpoolTimer winpr_CloseThreadpoolTimer @@ -167,14 +167,14 @@ WINPR_API VOID winpr_WaitForThreadpoolTimerCallbacks(PTP_TIMER pti, BOOL fCancel #define SetThreadpoolTimer winpr_SetThreadpoolTimer #define WaitForThreadpoolTimerCallbacks winpr_WaitForThreadpoolTimerCallbacks -/* I/O */ + /* I/O */ -WINPR_API PTP_IO winpr_CreateThreadpoolIo(HANDLE fl, PTP_WIN32_IO_CALLBACK pfnio, PVOID pv, - PTP_CALLBACK_ENVIRON pcbe); -WINPR_API VOID winpr_CloseThreadpoolIo(PTP_IO pio); -WINPR_API VOID winpr_StartThreadpoolIo(PTP_IO pio); -WINPR_API VOID winpr_CancelThreadpoolIo(PTP_IO pio); -WINPR_API VOID winpr_WaitForThreadpoolIoCallbacks(PTP_IO pio, BOOL fCancelPendingCallbacks); + WINPR_API PTP_IO winpr_CreateThreadpoolIo(HANDLE fl, PTP_WIN32_IO_CALLBACK pfnio, PVOID pv, + PTP_CALLBACK_ENVIRON pcbe); + WINPR_API VOID winpr_CloseThreadpoolIo(PTP_IO pio); + WINPR_API VOID winpr_StartThreadpoolIo(PTP_IO pio); + WINPR_API VOID winpr_CancelThreadpoolIo(PTP_IO pio); + WINPR_API VOID winpr_WaitForThreadpoolIoCallbacks(PTP_IO pio, BOOL fCancelPendingCallbacks); #define CreateThreadpoolIo winpr_CreateThreadpoolIo #define CloseThreadpoolIo winpr_CloseThreadpoolIo @@ -182,81 +182,82 @@ WINPR_API VOID winpr_WaitForThreadpoolIoCallbacks(PTP_IO pio, BOOL fCancelPendin #define CancelThreadpoolIo winpr_CancelThreadpoolIo #define WaitForThreadpoolIoCallbacks winpr_WaitForThreadpoolIoCallbacks -/* Clean-up Group */ + /* Clean-up Group */ -WINPR_API VOID winpr_SetThreadpoolCallbackCleanupGroup(PTP_CALLBACK_ENVIRON pcbe, PTP_CLEANUP_GROUP ptpcg, - PTP_CLEANUP_GROUP_CANCEL_CALLBACK pfng); -WINPR_API PTP_CLEANUP_GROUP winpr_CreateThreadpoolCleanupGroup(void); -WINPR_API VOID winpr_CloseThreadpoolCleanupGroupMembers(PTP_CLEANUP_GROUP ptpcg, - BOOL fCancelPendingCallbacks, PVOID pvCleanupContext); -WINPR_API VOID winpr_CloseThreadpoolCleanupGroup(PTP_CLEANUP_GROUP ptpcg); + WINPR_API VOID winpr_SetThreadpoolCallbackCleanupGroup(PTP_CALLBACK_ENVIRON pcbe, + PTP_CLEANUP_GROUP ptpcg, + PTP_CLEANUP_GROUP_CANCEL_CALLBACK pfng); + WINPR_API PTP_CLEANUP_GROUP winpr_CreateThreadpoolCleanupGroup(void); + WINPR_API VOID winpr_CloseThreadpoolCleanupGroupMembers(PTP_CLEANUP_GROUP ptpcg, + BOOL fCancelPendingCallbacks, + PVOID pvCleanupContext); + WINPR_API VOID winpr_CloseThreadpoolCleanupGroup(PTP_CLEANUP_GROUP ptpcg); #define SetThreadpoolCallbackCleanupGroup winpr_SetThreadpoolCallbackCleanupGroup #define CreateThreadpoolCleanupGroup winpr_CreateThreadpoolCleanupGroup #define CloseThreadpoolCleanupGroupMembers winpr_CloseThreadpoolCleanupGroupMembers #define CloseThreadpoolCleanupGroup winpr_CloseThreadpoolCleanupGroup -/* Pool */ + /* Pool */ -WINPR_API PTP_POOL winpr_CreateThreadpool(PVOID reserved); -WINPR_API VOID winpr_CloseThreadpool(PTP_POOL ptpp); -WINPR_API BOOL winpr_SetThreadpoolThreadMinimum(PTP_POOL ptpp, DWORD cthrdMic); -WINPR_API VOID winpr_SetThreadpoolThreadMaximum(PTP_POOL ptpp, DWORD cthrdMost); + WINPR_API PTP_POOL winpr_CreateThreadpool(PVOID reserved); + WINPR_API VOID winpr_CloseThreadpool(PTP_POOL ptpp); + WINPR_API BOOL winpr_SetThreadpoolThreadMinimum(PTP_POOL ptpp, DWORD cthrdMic); + WINPR_API VOID winpr_SetThreadpoolThreadMaximum(PTP_POOL ptpp, DWORD cthrdMost); #define CreateThreadpool winpr_CreateThreadpool #define CloseThreadpool winpr_CloseThreadpool #define SetThreadpoolThreadMinimum winpr_SetThreadpoolThreadMinimum #define SetThreadpoolThreadMaximum winpr_SetThreadpoolThreadMaximum -/* Callback Environment */ + /* Callback Environment */ -static INLINE VOID InitializeThreadpoolEnvironment(PTP_CALLBACK_ENVIRON pcbe) -{ - pcbe->Version = 1; - pcbe->Pool = NULL; - pcbe->CleanupGroup = NULL; - pcbe->CleanupGroupCancelCallback = NULL; - pcbe->RaceDll = NULL; - pcbe->ActivationContext = NULL; - pcbe->FinalizationCallback = NULL; - pcbe->u.Flags = 0; -} + static INLINE VOID InitializeThreadpoolEnvironment(PTP_CALLBACK_ENVIRON pcbe) + { + pcbe->Version = 1; + pcbe->Pool = NULL; + pcbe->CleanupGroup = NULL; + pcbe->CleanupGroupCancelCallback = NULL; + pcbe->RaceDll = NULL; + pcbe->ActivationContext = NULL; + pcbe->FinalizationCallback = NULL; + pcbe->u.Flags = 0; + } -static INLINE VOID DestroyThreadpoolEnvironment(PTP_CALLBACK_ENVIRON pcbe) -{ - /* no actions, this may change in a future release. */ -} + static INLINE VOID DestroyThreadpoolEnvironment(PTP_CALLBACK_ENVIRON pcbe) + { + /* no actions, this may change in a future release. */ + } -static INLINE VOID SetThreadpoolCallbackPool(PTP_CALLBACK_ENVIRON pcbe, PTP_POOL ptpp) -{ - pcbe->Pool = ptpp; -} + static INLINE VOID SetThreadpoolCallbackPool(PTP_CALLBACK_ENVIRON pcbe, PTP_POOL ptpp) + { + pcbe->Pool = ptpp; + } -static INLINE VOID SetThreadpoolCallbackRunsLong(PTP_CALLBACK_ENVIRON pcbe) -{ - pcbe->u.s.LongFunction = 1; -} + static INLINE VOID SetThreadpoolCallbackRunsLong(PTP_CALLBACK_ENVIRON pcbe) + { + pcbe->u.s.LongFunction = 1; + } -static INLINE VOID SetThreadpoolCallbackLibrary(PTP_CALLBACK_ENVIRON pcbe, PVOID mod) -{ - pcbe->RaceDll = mod; -} + static INLINE VOID SetThreadpoolCallbackLibrary(PTP_CALLBACK_ENVIRON pcbe, PVOID mod) + { + pcbe->RaceDll = mod; + } + /* Callback */ -/* Callback */ + WINPR_API BOOL winpr_CallbackMayRunLong(PTP_CALLBACK_INSTANCE pci); -WINPR_API BOOL winpr_CallbackMayRunLong(PTP_CALLBACK_INSTANCE pci); + /* Callback Clean-up */ -/* Callback Clean-up */ - -WINPR_API VOID winpr_SetEventWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, HANDLE evt); -WINPR_API VOID winpr_ReleaseSemaphoreWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, HANDLE sem, - DWORD crel); -WINPR_API VOID winpr_ReleaseMutexWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, HANDLE mut); -WINPR_API VOID winpr_LeaveCriticalSectionWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, - PCRITICAL_SECTION pcs); -WINPR_API VOID winpr_FreeLibraryWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, HMODULE mod); -WINPR_API VOID winpr_DisassociateCurrentThreadFromCallback(PTP_CALLBACK_INSTANCE pci); + WINPR_API VOID winpr_SetEventWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, HANDLE evt); + WINPR_API VOID winpr_ReleaseSemaphoreWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, HANDLE sem, + DWORD crel); + WINPR_API VOID winpr_ReleaseMutexWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, HANDLE mut); + WINPR_API VOID winpr_LeaveCriticalSectionWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, + PCRITICAL_SECTION pcs); + WINPR_API VOID winpr_FreeLibraryWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, HMODULE mod); + WINPR_API VOID winpr_DisassociateCurrentThreadFromCallback(PTP_CALLBACK_INSTANCE pci); #define SetEventWhenCallbackReturns winpr_SetEventWhenCallbackReturns #define ReleaseSemaphoreWhenCallbackReturns winpr_ReleaseSemaphoreWhenCallbackReturns diff --git a/winpr/include/winpr/print.h b/winpr/include/winpr/print.h index 3965765e0..5adf0c445 100644 --- a/winpr/include/winpr/print.h +++ b/winpr/include/winpr/print.h @@ -28,22 +28,23 @@ #include #include -#define WINPR_HEXDUMP_LINE_LENGTH 16 +#define WINPR_HEXDUMP_LINE_LENGTH 16 #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API void winpr_HexDump(const char* tag, UINT32 lvl, const BYTE* data, size_t length); -WINPR_API void winpr_HexLogDump(wLog* log, UINT32 lvl, const BYTE* data, size_t length); -WINPR_API void winpr_CArrayDump(const char* tag, UINT32 lvl, const BYTE* data, int length, - int width); + WINPR_API void winpr_HexDump(const char* tag, UINT32 lvl, const BYTE* data, size_t length); + WINPR_API void winpr_HexLogDump(wLog* log, UINT32 lvl, const BYTE* data, size_t length); + WINPR_API void winpr_CArrayDump(const char* tag, UINT32 lvl, const BYTE* data, int length, + int width); -WINPR_API char* winpr_BinToHexString(const BYTE* data, int length, BOOL space); + WINPR_API char* winpr_BinToHexString(const BYTE* data, int length, BOOL space); -WINPR_API int wprintfx(const char* fmt, ...); -WINPR_API int wvprintfx(const char* fmt, va_list args); -WINPR_API int wvsnprintfx(char* buffer, size_t bufferSize, const char* fmt, va_list args); + WINPR_API int wprintfx(const char* fmt, ...); + WINPR_API int wvprintfx(const char* fmt, va_list args); + WINPR_API int wvsnprintfx(char* buffer, size_t bufferSize, const char* fmt, va_list args); #ifdef __cplusplus } diff --git a/winpr/include/winpr/registry.h b/winpr/include/winpr/registry.h index 1102b044e..c69071011 100644 --- a/winpr/include/winpr/registry.h +++ b/winpr/include/winpr/registry.h @@ -29,7 +29,8 @@ #else #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif #include @@ -41,163 +42,163 @@ extern "C" { #ifndef _WIN32 -#define OWNER_SECURITY_INFORMATION 0x00000001 -#define GROUP_SECURITY_INFORMATION 0x00000002 -#define DACL_SECURITY_INFORMATION 0x00000004 -#define SACL_SECURITY_INFORMATION 0x00000008 +#define OWNER_SECURITY_INFORMATION 0x00000001 +#define GROUP_SECURITY_INFORMATION 0x00000002 +#define DACL_SECURITY_INFORMATION 0x00000004 +#define SACL_SECURITY_INFORMATION 0x00000008 -#define REG_OPTION_RESERVED 0x00000000 -#define REG_OPTION_NON_VOLATILE 0x00000000 -#define REG_OPTION_VOLATILE 0x00000001 -#define REG_OPTION_CREATE_LINK 0x00000002 -#define REG_OPTION_BACKUP_RESTORE 0x00000004 -#define REG_OPTION_OPEN_LINK 0x00000008 +#define REG_OPTION_RESERVED 0x00000000 +#define REG_OPTION_NON_VOLATILE 0x00000000 +#define REG_OPTION_VOLATILE 0x00000001 +#define REG_OPTION_CREATE_LINK 0x00000002 +#define REG_OPTION_BACKUP_RESTORE 0x00000004 +#define REG_OPTION_OPEN_LINK 0x00000008 -#define REG_CREATED_NEW_KEY 0x00000001 -#define REG_OPENED_EXISTING_KEY 0x00000002 +#define REG_CREATED_NEW_KEY 0x00000001 +#define REG_OPENED_EXISTING_KEY 0x00000002 -#define REG_NOTIFY_CHANGE_NAME 0x01 -#define REG_NOTIFY_CHANGE_ATTRIBUTES 0x02 -#define REG_NOTIFY_CHANGE_LAST_SET 0x04 -#define REG_NOTIFY_CHANGE_SECURITY 0x08 +#define REG_NOTIFY_CHANGE_NAME 0x01 +#define REG_NOTIFY_CHANGE_ATTRIBUTES 0x02 +#define REG_NOTIFY_CHANGE_LAST_SET 0x04 +#define REG_NOTIFY_CHANGE_SECURITY 0x08 -#define KEY_QUERY_VALUE 0x00000001 -#define KEY_SET_VALUE 0x00000002 -#define KEY_CREATE_SUB_KEY 0x00000004 -#define KEY_ENUMERATE_SUB_KEYS 0x00000008 -#define KEY_NOTIFY 0x00000010 -#define KEY_CREATE_LINK 0x00000020 -#define KEY_WOW64_64KEY 0x00000100 -#define KEY_WOW64_32KEY 0x00000200 -#define KEY_WOW64_RES 0x00000300 +#define KEY_QUERY_VALUE 0x00000001 +#define KEY_SET_VALUE 0x00000002 +#define KEY_CREATE_SUB_KEY 0x00000004 +#define KEY_ENUMERATE_SUB_KEYS 0x00000008 +#define KEY_NOTIFY 0x00000010 +#define KEY_CREATE_LINK 0x00000020 +#define KEY_WOW64_64KEY 0x00000100 +#define KEY_WOW64_32KEY 0x00000200 +#define KEY_WOW64_RES 0x00000300 -#define REG_WHOLE_HIVE_VOLATILE 0x00000001 -#define REG_REFRESH_HIVE 0x00000002 -#define REG_NO_LAZY_FLUSH 0x00000004 -#define REG_FORCE_RESTORE 0x00000008 +#define REG_WHOLE_HIVE_VOLATILE 0x00000001 +#define REG_REFRESH_HIVE 0x00000002 +#define REG_NO_LAZY_FLUSH 0x00000004 +#define REG_FORCE_RESTORE 0x00000008 -#define KEY_READ ((STANDARD_RIGHTS_READ | KEY_QUERY_VALUE | \ - KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY) & (~SYNCHRONIZE)) +#define KEY_READ \ + ((STANDARD_RIGHTS_READ | KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY) & \ + (~SYNCHRONIZE)) -#define KEY_WRITE ((STANDARD_RIGHTS_WRITE | KEY_SET_VALUE | \ - KEY_CREATE_SUB_KEY) & (~SYNCHRONIZE)) +#define KEY_WRITE ((STANDARD_RIGHTS_WRITE | KEY_SET_VALUE | KEY_CREATE_SUB_KEY) & (~SYNCHRONIZE)) -#define KEY_EXECUTE ((KEY_READ) & (~SYNCHRONIZE)) +#define KEY_EXECUTE ((KEY_READ) & (~SYNCHRONIZE)) -#define KEY_ALL_ACCESS ((STANDARD_RIGHTS_ALL | KEY_QUERY_VALUE | \ - KEY_SET_VALUE | KEY_CREATE_SUB_KEY | \ - KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY | \ - KEY_CREATE_LINK) & (~SYNCHRONIZE)) +#define KEY_ALL_ACCESS \ + ((STANDARD_RIGHTS_ALL | KEY_QUERY_VALUE | KEY_SET_VALUE | KEY_CREATE_SUB_KEY | \ + KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY | KEY_CREATE_LINK) & \ + (~SYNCHRONIZE)) -#define REG_NONE 0 -#define REG_SZ 1 -#define REG_EXPAND_SZ 2 -#define REG_BINARY 3 -#define REG_DWORD 4 -#define REG_DWORD_LITTLE_ENDIAN 4 -#define REG_DWORD_BIG_ENDIAN 5 -#define REG_LINK 6 -#define REG_MULTI_SZ 7 -#define REG_RESOURCE_LIST 8 -#define REG_FULL_RESOURCE_DESCRIPTOR 9 -#define REG_RESOURCE_REQUIREMENTS_LIST 10 -#define REG_QWORD 11 -#define REG_QWORD_LITTLE_ENDIAN 11 +#define REG_NONE 0 +#define REG_SZ 1 +#define REG_EXPAND_SZ 2 +#define REG_BINARY 3 +#define REG_DWORD 4 +#define REG_DWORD_LITTLE_ENDIAN 4 +#define REG_DWORD_BIG_ENDIAN 5 +#define REG_LINK 6 +#define REG_MULTI_SZ 7 +#define REG_RESOURCE_LIST 8 +#define REG_FULL_RESOURCE_DESCRIPTOR 9 +#define REG_RESOURCE_REQUIREMENTS_LIST 10 +#define REG_QWORD 11 +#define REG_QWORD_LITTLE_ENDIAN 11 -typedef HANDLE HKEY; -typedef HANDLE* PHKEY; + typedef HANDLE HKEY; + typedef HANDLE* PHKEY; #endif -typedef ACCESS_MASK REGSAM; + typedef ACCESS_MASK REGSAM; -#define HKEY_CLASSES_ROOT ((HKEY) (LONG_PTR) (LONG) 0x80000000) -#define HKEY_CURRENT_USER ((HKEY) (LONG_PTR) (LONG) 0x80000001) -#define HKEY_LOCAL_MACHINE ((HKEY) (LONG_PTR) (LONG) 0x80000002) -#define HKEY_USERS ((HKEY) (LONG_PTR) (LONG) 0x80000003) -#define HKEY_PERFORMANCE_DATA ((HKEY) (LONG_PTR) (LONG) 0x80000004) -#define HKEY_PERFORMANCE_TEXT ((HKEY) (LONG_PTR) (LONG) 0x80000050) -#define HKEY_PERFORMANCE_NLSTEXT ((HKEY) (LONG_PTR) (LONG) 0x80000060) -#define HKEY_CURRENT_CONFIG ((HKEY) (LONG_PTR) (LONG) 0x80000005) -#define HKEY_DYN_DATA ((HKEY) (LONG_PTR) (LONG) 0x80000006) -#define HKEY_CURRENT_USER_LOCAL_SETTINGS ((HKEY) (LONG_PTR) (LONG) 0x80000007) +#define HKEY_CLASSES_ROOT ((HKEY)(LONG_PTR)(LONG)0x80000000) +#define HKEY_CURRENT_USER ((HKEY)(LONG_PTR)(LONG)0x80000001) +#define HKEY_LOCAL_MACHINE ((HKEY)(LONG_PTR)(LONG)0x80000002) +#define HKEY_USERS ((HKEY)(LONG_PTR)(LONG)0x80000003) +#define HKEY_PERFORMANCE_DATA ((HKEY)(LONG_PTR)(LONG)0x80000004) +#define HKEY_PERFORMANCE_TEXT ((HKEY)(LONG_PTR)(LONG)0x80000050) +#define HKEY_PERFORMANCE_NLSTEXT ((HKEY)(LONG_PTR)(LONG)0x80000060) +#define HKEY_CURRENT_CONFIG ((HKEY)(LONG_PTR)(LONG)0x80000005) +#define HKEY_DYN_DATA ((HKEY)(LONG_PTR)(LONG)0x80000006) +#define HKEY_CURRENT_USER_LOCAL_SETTINGS ((HKEY)(LONG_PTR)(LONG)0x80000007) -#define RRF_RT_REG_NONE 0x00000001 -#define RRF_RT_REG_SZ 0x00000002 -#define RRF_RT_REG_EXPAND_SZ 0x00000004 -#define RRF_RT_REG_BINARY 0x00000008 -#define RRF_RT_REG_DWORD 0x00000010 -#define RRF_RT_REG_MULTI_SZ 0x00000020 -#define RRF_RT_REG_QWORD 0x00000040 +#define RRF_RT_REG_NONE 0x00000001 +#define RRF_RT_REG_SZ 0x00000002 +#define RRF_RT_REG_EXPAND_SZ 0x00000004 +#define RRF_RT_REG_BINARY 0x00000008 +#define RRF_RT_REG_DWORD 0x00000010 +#define RRF_RT_REG_MULTI_SZ 0x00000020 +#define RRF_RT_REG_QWORD 0x00000040 -#define RRF_RT_DWORD (RRF_RT_REG_BINARY | RRF_RT_REG_DWORD) -#define RRF_RT_QWORD (RRF_RT_REG_BINARY | RRF_RT_REG_QWORD) -#define RRF_RT_ANY 0x0000FFFF +#define RRF_RT_DWORD (RRF_RT_REG_BINARY | RRF_RT_REG_DWORD) +#define RRF_RT_QWORD (RRF_RT_REG_BINARY | RRF_RT_REG_QWORD) +#define RRF_RT_ANY 0x0000FFFF -#define RRF_NOEXPAND 0x10000000 -#define RRF_ZEROONFAILURE 0x20000000 +#define RRF_NOEXPAND 0x10000000 +#define RRF_ZEROONFAILURE 0x20000000 -struct val_context -{ - int valuelen; - LPVOID value_context; - LPVOID val_buff_ptr; -}; + struct val_context + { + int valuelen; + LPVOID value_context; + LPVOID val_buff_ptr; + }; -typedef struct val_context *PVALCONTEXT; + typedef struct val_context* PVALCONTEXT; -typedef struct pvalueA -{ - LPSTR pv_valuename; - int pv_valuelen; - LPVOID pv_value_context; - DWORD pv_type; -} PVALUEA, *PPVALUEA; + typedef struct pvalueA + { + LPSTR pv_valuename; + int pv_valuelen; + LPVOID pv_value_context; + DWORD pv_type; + } PVALUEA, *PPVALUEA; -typedef struct pvalueW -{ - LPWSTR pv_valuename; - int pv_valuelen; - LPVOID pv_value_context; - DWORD pv_type; -} PVALUEW, *PPVALUEW; + typedef struct pvalueW + { + LPWSTR pv_valuename; + int pv_valuelen; + LPVOID pv_value_context; + DWORD pv_type; + } PVALUEW, *PPVALUEW; #ifdef UNICODE -typedef PVALUEW PVALUE; -typedef PPVALUEW PPVALUE; + typedef PVALUEW PVALUE; + typedef PPVALUEW PPVALUE; #else typedef PVALUEA PVALUE; typedef PPVALUEA PPVALUE; #endif -typedef struct value_entA -{ - LPSTR ve_valuename; - DWORD ve_valuelen; - DWORD_PTR ve_valueptr; - DWORD ve_type; -} VALENTA, *PVALENTA; + typedef struct value_entA + { + LPSTR ve_valuename; + DWORD ve_valuelen; + DWORD_PTR ve_valueptr; + DWORD ve_type; + } VALENTA, *PVALENTA; -typedef struct value_entW -{ - LPWSTR ve_valuename; - DWORD ve_valuelen; - DWORD_PTR ve_valueptr; - DWORD ve_type; -} VALENTW, *PVALENTW; + typedef struct value_entW + { + LPWSTR ve_valuename; + DWORD ve_valuelen; + DWORD_PTR ve_valueptr; + DWORD ve_type; + } VALENTW, *PVALENTW; #ifdef UNICODE -typedef VALENTW VALENT; -typedef PVALENTW PVALENT; + typedef VALENTW VALENT; + typedef PVALENTW PVALENT; #else typedef VALENTA VALENT; typedef PVALENTA PVALENT; #endif -WINPR_API LONG RegCloseKey(HKEY hKey); + WINPR_API LONG RegCloseKey(HKEY hKey); -WINPR_API LONG RegCopyTreeW(HKEY hKeySrc, LPCWSTR lpSubKey, HKEY hKeyDest); -WINPR_API LONG RegCopyTreeA(HKEY hKeySrc, LPCSTR lpSubKey, HKEY hKeyDest); + WINPR_API LONG RegCopyTreeW(HKEY hKeySrc, LPCWSTR lpSubKey, HKEY hKeyDest); + WINPR_API LONG RegCopyTreeA(HKEY hKeySrc, LPCSTR lpSubKey, HKEY hKeyDest); #ifdef UNICODE #define RegCopyTree RegCopyTreeW @@ -205,10 +206,14 @@ WINPR_API LONG RegCopyTreeA(HKEY hKeySrc, LPCSTR lpSubKey, HKEY hKeyDest); #define RegCopyTree RegCopyTreeA #endif -WINPR_API LONG RegCreateKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD Reserved, LPWSTR lpClass, DWORD dwOptions, - REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition); -WINPR_API LONG RegCreateKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD Reserved, LPSTR lpClass, DWORD dwOptions, - REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition); + WINPR_API LONG RegCreateKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD Reserved, LPWSTR lpClass, + DWORD dwOptions, REGSAM samDesired, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, + LPDWORD lpdwDisposition); + WINPR_API LONG RegCreateKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD Reserved, LPSTR lpClass, + DWORD dwOptions, REGSAM samDesired, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, + LPDWORD lpdwDisposition); #ifdef UNICODE #define RegCreateKeyEx RegCreateKeyExW @@ -216,8 +221,8 @@ WINPR_API LONG RegCreateKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD Reserved, LPSTR #define RegCreateKeyEx RegCreateKeyExA #endif -WINPR_API LONG RegDeleteKeyExW(HKEY hKey, LPCWSTR lpSubKey, REGSAM samDesired, DWORD Reserved); -WINPR_API LONG RegDeleteKeyExA(HKEY hKey, LPCSTR lpSubKey, REGSAM samDesired, DWORD Reserved); + WINPR_API LONG RegDeleteKeyExW(HKEY hKey, LPCWSTR lpSubKey, REGSAM samDesired, DWORD Reserved); + WINPR_API LONG RegDeleteKeyExA(HKEY hKey, LPCSTR lpSubKey, REGSAM samDesired, DWORD Reserved); #ifdef UNICODE #define RegDeleteKeyEx RegDeleteKeyExW @@ -225,8 +230,8 @@ WINPR_API LONG RegDeleteKeyExA(HKEY hKey, LPCSTR lpSubKey, REGSAM samDesired, DW #define RegDeleteKeyEx RegDeleteKeyExA #endif -WINPR_API LONG RegDeleteTreeW(HKEY hKey, LPCWSTR lpSubKey); -WINPR_API LONG RegDeleteTreeA(HKEY hKey, LPCSTR lpSubKey); + WINPR_API LONG RegDeleteTreeW(HKEY hKey, LPCWSTR lpSubKey); + WINPR_API LONG RegDeleteTreeA(HKEY hKey, LPCSTR lpSubKey); #ifdef UNICODE #define RegDeleteTree RegDeleteTreeW @@ -234,8 +239,8 @@ WINPR_API LONG RegDeleteTreeA(HKEY hKey, LPCSTR lpSubKey); #define RegDeleteTree RegDeleteTreeA #endif -WINPR_API LONG RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName); -WINPR_API LONG RegDeleteValueA(HKEY hKey, LPCSTR lpValueName); + WINPR_API LONG RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName); + WINPR_API LONG RegDeleteValueA(HKEY hKey, LPCSTR lpValueName); #ifdef UNICODE #define RegDeleteValue RegDeleteValueW @@ -243,12 +248,14 @@ WINPR_API LONG RegDeleteValueA(HKEY hKey, LPCSTR lpValueName); #define RegDeleteValue RegDeleteValueA #endif -WINPR_API LONG RegDisablePredefinedCacheEx(void); + WINPR_API LONG RegDisablePredefinedCacheEx(void); -WINPR_API LONG RegEnumKeyExW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, LPDWORD lpcName, - LPDWORD lpReserved, LPWSTR lpClass, LPDWORD lpcClass, PFILETIME lpftLastWriteTime); -WINPR_API LONG RegEnumKeyExA(HKEY hKey, DWORD dwIndex, LPSTR lpName, LPDWORD lpcName, - LPDWORD lpReserved, LPSTR lpClass, LPDWORD lpcClass, PFILETIME lpftLastWriteTime); + WINPR_API LONG RegEnumKeyExW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, LPDWORD lpcName, + LPDWORD lpReserved, LPWSTR lpClass, LPDWORD lpcClass, + PFILETIME lpftLastWriteTime); + WINPR_API LONG RegEnumKeyExA(HKEY hKey, DWORD dwIndex, LPSTR lpName, LPDWORD lpcName, + LPDWORD lpReserved, LPSTR lpClass, LPDWORD lpcClass, + PFILETIME lpftLastWriteTime); #ifdef UNICODE #define RegEnumKeyEx RegEnumKeyExW @@ -256,10 +263,12 @@ WINPR_API LONG RegEnumKeyExA(HKEY hKey, DWORD dwIndex, LPSTR lpName, LPDWORD lpc #define RegEnumKeyEx RegEnumKeyExA #endif -WINPR_API LONG RegEnumValueW(HKEY hKey, DWORD dwIndex, LPWSTR lpValueName, - LPDWORD lpcchValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData); -WINPR_API LONG RegEnumValueA(HKEY hKey, DWORD dwIndex, LPSTR lpValueName, - LPDWORD lpcchValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData); + WINPR_API LONG RegEnumValueW(HKEY hKey, DWORD dwIndex, LPWSTR lpValueName, + LPDWORD lpcchValueName, LPDWORD lpReserved, LPDWORD lpType, + LPBYTE lpData, LPDWORD lpcbData); + WINPR_API LONG RegEnumValueA(HKEY hKey, DWORD dwIndex, LPSTR lpValueName, + LPDWORD lpcchValueName, LPDWORD lpReserved, LPDWORD lpType, + LPBYTE lpData, LPDWORD lpcbData); #ifdef UNICODE #define RegEnumValue RegEnumValueW @@ -267,15 +276,16 @@ WINPR_API LONG RegEnumValueA(HKEY hKey, DWORD dwIndex, LPSTR lpValueName, #define RegEnumValue RegEnumValueA #endif -WINPR_API LONG RegFlushKey(HKEY hKey); + WINPR_API LONG RegFlushKey(HKEY hKey); -WINPR_API LONG RegGetKeySecurity(HKEY hKey, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor, LPDWORD lpcbSecurityDescriptor); + WINPR_API LONG RegGetKeySecurity(HKEY hKey, SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor, + LPDWORD lpcbSecurityDescriptor); -WINPR_API LONG RegGetValueW(HKEY hkey, LPCWSTR lpSubKey, LPCWSTR lpValue, - DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData); -WINPR_API LONG RegGetValueA(HKEY hkey, LPCSTR lpSubKey, LPCSTR lpValue, - DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData); + WINPR_API LONG RegGetValueW(HKEY hkey, LPCWSTR lpSubKey, LPCWSTR lpValue, DWORD dwFlags, + LPDWORD pdwType, PVOID pvData, LPDWORD pcbData); + WINPR_API LONG RegGetValueA(HKEY hkey, LPCSTR lpSubKey, LPCSTR lpValue, DWORD dwFlags, + LPDWORD pdwType, PVOID pvData, LPDWORD pcbData); #ifdef UNICODE #define RegGetValue RegGetValueW @@ -283,10 +293,10 @@ WINPR_API LONG RegGetValueA(HKEY hkey, LPCSTR lpSubKey, LPCSTR lpValue, #define RegGetValue RegGetValueA #endif -WINPR_API LONG RegLoadAppKeyW(LPCWSTR lpFile, PHKEY phkResult, - REGSAM samDesired, DWORD dwOptions, DWORD Reserved); -WINPR_API LONG RegLoadAppKeyA(LPCSTR lpFile, PHKEY phkResult, - REGSAM samDesired, DWORD dwOptions, DWORD Reserved); + WINPR_API LONG RegLoadAppKeyW(LPCWSTR lpFile, PHKEY phkResult, REGSAM samDesired, + DWORD dwOptions, DWORD Reserved); + WINPR_API LONG RegLoadAppKeyA(LPCSTR lpFile, PHKEY phkResult, REGSAM samDesired, + DWORD dwOptions, DWORD Reserved); #ifdef UNICODE #define RegLoadAppKey RegLoadAppKeyW @@ -294,8 +304,8 @@ WINPR_API LONG RegLoadAppKeyA(LPCSTR lpFile, PHKEY phkResult, #define RegLoadAppKey RegLoadAppKeyA #endif -WINPR_API LONG RegLoadKeyW(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpFile); -WINPR_API LONG RegLoadKeyA(HKEY hKey, LPCSTR lpSubKey, LPCSTR lpFile); + WINPR_API LONG RegLoadKeyW(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpFile); + WINPR_API LONG RegLoadKeyA(HKEY hKey, LPCSTR lpSubKey, LPCSTR lpFile); #ifdef UNICODE #define RegLoadKey RegLoadKeyW @@ -303,10 +313,10 @@ WINPR_API LONG RegLoadKeyA(HKEY hKey, LPCSTR lpSubKey, LPCSTR lpFile); #define RegLoadKey RegLoadKeyA #endif -WINPR_API LONG RegLoadMUIStringW(HKEY hKey, LPCWSTR pszValue, LPWSTR pszOutBuf, - DWORD cbOutBuf, LPDWORD pcbData, DWORD Flags, LPCWSTR pszDirectory); -WINPR_API LONG RegLoadMUIStringA(HKEY hKey, LPCSTR pszValue, LPSTR pszOutBuf, - DWORD cbOutBuf, LPDWORD pcbData, DWORD Flags, LPCSTR pszDirectory); + WINPR_API LONG RegLoadMUIStringW(HKEY hKey, LPCWSTR pszValue, LPWSTR pszOutBuf, DWORD cbOutBuf, + LPDWORD pcbData, DWORD Flags, LPCWSTR pszDirectory); + WINPR_API LONG RegLoadMUIStringA(HKEY hKey, LPCSTR pszValue, LPSTR pszOutBuf, DWORD cbOutBuf, + LPDWORD pcbData, DWORD Flags, LPCSTR pszDirectory); #ifdef UNICODE #define RegLoadMUIString RegLoadMUIStringW @@ -314,12 +324,15 @@ WINPR_API LONG RegLoadMUIStringA(HKEY hKey, LPCSTR pszValue, LPSTR pszOutBuf, #define RegLoadMUIString RegLoadMUIStringA #endif -WINPR_API LONG RegNotifyChangeKeyValue(HKEY hKey, BOOL bWatchSubtree, DWORD dwNotifyFilter, HANDLE hEvent, BOOL fAsynchronous); + WINPR_API LONG RegNotifyChangeKeyValue(HKEY hKey, BOOL bWatchSubtree, DWORD dwNotifyFilter, + HANDLE hEvent, BOOL fAsynchronous); -WINPR_API LONG RegOpenCurrentUser(REGSAM samDesired, PHKEY phkResult); + WINPR_API LONG RegOpenCurrentUser(REGSAM samDesired, PHKEY phkResult); -WINPR_API LONG RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult); -WINPR_API LONG RegOpenKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult); + WINPR_API LONG RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, + PHKEY phkResult); + WINPR_API LONG RegOpenKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, + PHKEY phkResult); #ifdef UNICODE #define RegOpenKeyEx RegOpenKeyExW @@ -327,16 +340,19 @@ WINPR_API LONG RegOpenKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD ulOptions, REGSAM #define RegOpenKeyEx RegOpenKeyExA #endif -WINPR_API LONG RegOpenUserClassesRoot(HANDLE hToken, DWORD dwOptions, REGSAM samDesired, PHKEY phkResult); + WINPR_API LONG RegOpenUserClassesRoot(HANDLE hToken, DWORD dwOptions, REGSAM samDesired, + PHKEY phkResult); -WINPR_API LONG RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, - LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, - LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, - LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime); -WINPR_API LONG RegQueryInfoKeyA(HKEY hKey, LPSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, - LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, - LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, - LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime); + WINPR_API LONG RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, + LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, + LPDWORD lpcMaxClassLen, LPDWORD lpcValues, + LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, + LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime); + WINPR_API LONG RegQueryInfoKeyA(HKEY hKey, LPSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, + LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, + LPDWORD lpcMaxClassLen, LPDWORD lpcValues, + LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, + LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime); #ifdef UNICODE #define RegQueryInfoKey RegQueryInfoKeyW @@ -344,10 +360,10 @@ WINPR_API LONG RegQueryInfoKeyA(HKEY hKey, LPSTR lpClass, LPDWORD lpcClass, LPDW #define RegQueryInfoKey RegQueryInfoKeyA #endif -WINPR_API LONG RegQueryValueExW(HKEY hKey, LPCWSTR lpValueName, - LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData); -WINPR_API LONG RegQueryValueExA(HKEY hKey, LPCSTR lpValueName, - LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData); + WINPR_API LONG RegQueryValueExW(HKEY hKey, LPCWSTR lpValueName, LPDWORD lpReserved, + LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData); + WINPR_API LONG RegQueryValueExA(HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved, + LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData); #ifdef UNICODE #define RegQueryValueEx RegQueryValueExW @@ -355,8 +371,8 @@ WINPR_API LONG RegQueryValueExA(HKEY hKey, LPCSTR lpValueName, #define RegQueryValueEx RegQueryValueExA #endif -WINPR_API LONG RegRestoreKeyW(HKEY hKey, LPCWSTR lpFile, DWORD dwFlags); -WINPR_API LONG RegRestoreKeyA(HKEY hKey, LPCSTR lpFile, DWORD dwFlags); + WINPR_API LONG RegRestoreKeyW(HKEY hKey, LPCWSTR lpFile, DWORD dwFlags); + WINPR_API LONG RegRestoreKeyA(HKEY hKey, LPCSTR lpFile, DWORD dwFlags); #ifdef UNICODE #define RegRestoreKey RegRestoreKeyW @@ -364,8 +380,10 @@ WINPR_API LONG RegRestoreKeyA(HKEY hKey, LPCSTR lpFile, DWORD dwFlags); #define RegRestoreKey RegRestoreKeyA #endif -WINPR_API LONG RegSaveKeyExW(HKEY hKey, LPCWSTR lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD Flags); -WINPR_API LONG RegSaveKeyExA(HKEY hKey, LPCSTR lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD Flags); + WINPR_API LONG RegSaveKeyExW(HKEY hKey, LPCWSTR lpFile, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD Flags); + WINPR_API LONG RegSaveKeyExA(HKEY hKey, LPCSTR lpFile, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD Flags); #ifdef UNICODE #define RegSaveKeyEx RegSaveKeyExW @@ -373,10 +391,13 @@ WINPR_API LONG RegSaveKeyExA(HKEY hKey, LPCSTR lpFile, LPSECURITY_ATTRIBUTES lpS #define RegSaveKeyEx RegSaveKeyExA #endif -WINPR_API LONG RegSetKeySecurity(HKEY hKey, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor); + WINPR_API LONG RegSetKeySecurity(HKEY hKey, SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor); -WINPR_API LONG RegSetValueExW(HKEY hKey, LPCWSTR lpValueName, DWORD Reserved, DWORD dwType, const BYTE* lpData, DWORD cbData); -WINPR_API LONG RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, const BYTE* lpData, DWORD cbData); + WINPR_API LONG RegSetValueExW(HKEY hKey, LPCWSTR lpValueName, DWORD Reserved, DWORD dwType, + const BYTE* lpData, DWORD cbData); + WINPR_API LONG RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, + const BYTE* lpData, DWORD cbData); #ifdef UNICODE #define RegSetValueEx RegSetValueExW @@ -384,8 +405,8 @@ WINPR_API LONG RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWO #define RegSetValueEx RegSetValueExA #endif -WINPR_API LONG RegUnLoadKeyW(HKEY hKey, LPCWSTR lpSubKey); -WINPR_API LONG RegUnLoadKeyA(HKEY hKey, LPCSTR lpSubKey); + WINPR_API LONG RegUnLoadKeyW(HKEY hKey, LPCWSTR lpSubKey); + WINPR_API LONG RegUnLoadKeyA(HKEY hKey, LPCSTR lpSubKey); #ifdef UNICODE #define RegUnLoadKey RegUnLoadKeyW diff --git a/winpr/include/winpr/rpc.h b/winpr/include/winpr/rpc.h index 187a38008..7f4be9902 100644 --- a/winpr/include/winpr/rpc.h +++ b/winpr/include/winpr/rpc.h @@ -46,29 +46,29 @@ typedef PCONTEXT_HANDLE PCHANNEL_CONTEXT_HANDLE_SERIALIZE; #include #include -#define RPC_S_OK ERROR_SUCCESS -#define RPC_S_INVALID_ARG ERROR_INVALID_PARAMETER -#define RPC_S_OUT_OF_MEMORY ERROR_OUTOFMEMORY -#define RPC_S_OUT_OF_THREADS ERROR_MAX_THRDS_REACHED -#define RPC_S_INVALID_LEVEL ERROR_INVALID_PARAMETER -#define RPC_S_BUFFER_TOO_SMALL ERROR_INSUFFICIENT_BUFFER -#define RPC_S_INVALID_SECURITY_DESC ERROR_INVALID_SECURITY_DESCR -#define RPC_S_ACCESS_DENIED ERROR_ACCESS_DENIED -#define RPC_S_SERVER_OUT_OF_MEMORY ERROR_NOT_ENOUGH_SERVER_MEMORY -#define RPC_S_ASYNC_CALL_PENDING ERROR_IO_PENDING -#define RPC_S_UNKNOWN_PRINCIPAL ERROR_NONE_MAPPED -#define RPC_S_TIMEOUT ERROR_TIMEOUT +#define RPC_S_OK ERROR_SUCCESS +#define RPC_S_INVALID_ARG ERROR_INVALID_PARAMETER +#define RPC_S_OUT_OF_MEMORY ERROR_OUTOFMEMORY +#define RPC_S_OUT_OF_THREADS ERROR_MAX_THRDS_REACHED +#define RPC_S_INVALID_LEVEL ERROR_INVALID_PARAMETER +#define RPC_S_BUFFER_TOO_SMALL ERROR_INSUFFICIENT_BUFFER +#define RPC_S_INVALID_SECURITY_DESC ERROR_INVALID_SECURITY_DESCR +#define RPC_S_ACCESS_DENIED ERROR_ACCESS_DENIED +#define RPC_S_SERVER_OUT_OF_MEMORY ERROR_NOT_ENOUGH_SERVER_MEMORY +#define RPC_S_ASYNC_CALL_PENDING ERROR_IO_PENDING +#define RPC_S_UNKNOWN_PRINCIPAL ERROR_NONE_MAPPED +#define RPC_S_TIMEOUT ERROR_TIMEOUT -#define RPC_X_NO_MEMORY RPC_S_OUT_OF_MEMORY -#define RPC_X_INVALID_BOUND RPC_S_INVALID_BOUND -#define RPC_X_INVALID_TAG RPC_S_INVALID_TAG -#define RPC_X_ENUM_VALUE_TOO_LARGE RPC_X_ENUM_VALUE_OUT_OF_RANGE -#define RPC_X_SS_CONTEXT_MISMATCH ERROR_INVALID_HANDLE -#define RPC_X_INVALID_BUFFER ERROR_INVALID_USER_BUFFER -#define RPC_X_PIPE_APP_MEMORY ERROR_OUTOFMEMORY -#define RPC_X_INVALID_PIPE_OPERATION RPC_X_WRONG_PIPE_ORDER +#define RPC_X_NO_MEMORY RPC_S_OUT_OF_MEMORY +#define RPC_X_INVALID_BOUND RPC_S_INVALID_BOUND +#define RPC_X_INVALID_TAG RPC_S_INVALID_TAG +#define RPC_X_ENUM_VALUE_TOO_LARGE RPC_X_ENUM_VALUE_OUT_OF_RANGE +#define RPC_X_SS_CONTEXT_MISMATCH ERROR_INVALID_HANDLE +#define RPC_X_INVALID_BUFFER ERROR_INVALID_USER_BUFFER +#define RPC_X_PIPE_APP_MEMORY ERROR_OUTOFMEMORY +#define RPC_X_INVALID_PIPE_OPERATION RPC_X_WRONG_PIPE_ORDER -#define RPC_VAR_ENTRY __cdecl +#define RPC_VAR_ENTRY __cdecl typedef long RPC_STATUS; @@ -104,52 +104,52 @@ typedef struct _RPC_IF_ID unsigned short VersMinor; } RPC_IF_ID; -#define RPC_C_BINDING_INFINITE_TIMEOUT 10 -#define RPC_C_BINDING_MIN_TIMEOUT 0 -#define RPC_C_BINDING_DEFAULT_TIMEOUT 5 -#define RPC_C_BINDING_MAX_TIMEOUT 9 +#define RPC_C_BINDING_INFINITE_TIMEOUT 10 +#define RPC_C_BINDING_MIN_TIMEOUT 0 +#define RPC_C_BINDING_DEFAULT_TIMEOUT 5 +#define RPC_C_BINDING_MAX_TIMEOUT 9 -#define RPC_C_CANCEL_INFINITE_TIMEOUT -1 +#define RPC_C_CANCEL_INFINITE_TIMEOUT -1 -#define RPC_C_LISTEN_MAX_CALLS_DEFAULT 1234 -#define RPC_C_PROTSEQ_MAX_REQS_DEFAULT 10 +#define RPC_C_LISTEN_MAX_CALLS_DEFAULT 1234 +#define RPC_C_PROTSEQ_MAX_REQS_DEFAULT 10 -#define RPC_C_BIND_TO_ALL_NICS 1 -#define RPC_C_USE_INTERNET_PORT 0x1 -#define RPC_C_USE_INTRANET_PORT 0x2 -#define RPC_C_DONT_FAIL 0x4 +#define RPC_C_BIND_TO_ALL_NICS 1 +#define RPC_C_USE_INTERNET_PORT 0x1 +#define RPC_C_USE_INTRANET_PORT 0x2 +#define RPC_C_DONT_FAIL 0x4 -#define RPC_C_MQ_TEMPORARY 0x0000 -#define RPC_C_MQ_PERMANENT 0x0001 -#define RPC_C_MQ_CLEAR_ON_OPEN 0x0002 -#define RPC_C_MQ_USE_EXISTING_SECURITY 0x0004 -#define RPC_C_MQ_AUTHN_LEVEL_NONE 0x0000 -#define RPC_C_MQ_AUTHN_LEVEL_PKT_INTEGRITY 0x0008 -#define RPC_C_MQ_AUTHN_LEVEL_PKT_PRIVACY 0x0010 +#define RPC_C_MQ_TEMPORARY 0x0000 +#define RPC_C_MQ_PERMANENT 0x0001 +#define RPC_C_MQ_CLEAR_ON_OPEN 0x0002 +#define RPC_C_MQ_USE_EXISTING_SECURITY 0x0004 +#define RPC_C_MQ_AUTHN_LEVEL_NONE 0x0000 +#define RPC_C_MQ_AUTHN_LEVEL_PKT_INTEGRITY 0x0008 +#define RPC_C_MQ_AUTHN_LEVEL_PKT_PRIVACY 0x0010 -#define RPC_C_OPT_MQ_DELIVERY 1 -#define RPC_C_OPT_MQ_PRIORITY 2 -#define RPC_C_OPT_MQ_JOURNAL 3 -#define RPC_C_OPT_MQ_ACKNOWLEDGE 4 -#define RPC_C_OPT_MQ_AUTHN_SERVICE 5 -#define RPC_C_OPT_MQ_AUTHN_LEVEL 6 -#define RPC_C_OPT_MQ_TIME_TO_REACH_QUEUE 7 -#define RPC_C_OPT_MQ_TIME_TO_BE_RECEIVED 8 -#define RPC_C_OPT_BINDING_NONCAUSAL 9 -#define RPC_C_OPT_SECURITY_CALLBACK 10 -#define RPC_C_OPT_UNIQUE_BINDING 11 -#define RPC_C_OPT_CALL_TIMEOUT 12 -#define RPC_C_OPT_DONT_LINGER 13 -#define RPC_C_OPT_MAX_OPTIONS 14 +#define RPC_C_OPT_MQ_DELIVERY 1 +#define RPC_C_OPT_MQ_PRIORITY 2 +#define RPC_C_OPT_MQ_JOURNAL 3 +#define RPC_C_OPT_MQ_ACKNOWLEDGE 4 +#define RPC_C_OPT_MQ_AUTHN_SERVICE 5 +#define RPC_C_OPT_MQ_AUTHN_LEVEL 6 +#define RPC_C_OPT_MQ_TIME_TO_REACH_QUEUE 7 +#define RPC_C_OPT_MQ_TIME_TO_BE_RECEIVED 8 +#define RPC_C_OPT_BINDING_NONCAUSAL 9 +#define RPC_C_OPT_SECURITY_CALLBACK 10 +#define RPC_C_OPT_UNIQUE_BINDING 11 +#define RPC_C_OPT_CALL_TIMEOUT 12 +#define RPC_C_OPT_DONT_LINGER 13 +#define RPC_C_OPT_MAX_OPTIONS 14 -#define RPC_C_MQ_EXPRESS 0 -#define RPC_C_MQ_RECOVERABLE 1 +#define RPC_C_MQ_EXPRESS 0 +#define RPC_C_MQ_RECOVERABLE 1 -#define RPC_C_MQ_JOURNAL_NONE 0 -#define RPC_C_MQ_JOURNAL_DEADLETTER 1 -#define RPC_C_MQ_JOURNAL_ALWAYS 2 +#define RPC_C_MQ_JOURNAL_NONE 0 +#define RPC_C_MQ_JOURNAL_DEADLETTER 1 +#define RPC_C_MQ_JOURNAL_ALWAYS 2 -#define RPC_C_FULL_CERT_CHAIN 0x0001 +#define RPC_C_FULL_CERT_CHAIN 0x0001 typedef struct _RPC_PROTSEQ_VECTORA { @@ -164,9 +164,9 @@ typedef struct _RPC_PROTSEQ_VECTORW } RPC_PROTSEQ_VECTORW; #ifdef UNICODE -#define RPC_PROTSEQ_VECTOR RPC_PROTSEQ_VECTORW +#define RPC_PROTSEQ_VECTOR RPC_PROTSEQ_VECTORW #else -#define RPC_PROTSEQ_VECTOR RPC_PROTSEQ_VECTORA +#define RPC_PROTSEQ_VECTOR RPC_PROTSEQ_VECTORA #endif typedef struct _RPC_POLICY @@ -176,10 +176,8 @@ typedef struct _RPC_POLICY unsigned long NICFlags; } RPC_POLICY, *PRPC_POLICY; -typedef void RPC_OBJECT_INQ_FN(UUID* ObjectUuid, UUID* TypeUuid, - RPC_STATUS* pStatus); -typedef RPC_STATUS RPC_IF_CALLBACK_FN(RPC_IF_HANDLE InterfaceUuid, - void* Context); +typedef void RPC_OBJECT_INQ_FN(UUID* ObjectUuid, UUID* TypeUuid, RPC_STATUS* pStatus); +typedef RPC_STATUS RPC_IF_CALLBACK_FN(RPC_IF_HANDLE InterfaceUuid, void* Context); typedef void RPC_SECURITY_CALLBACK_FN(void* Context); #define RPC_MGR_EPV void @@ -190,10 +188,10 @@ typedef struct unsigned long Stats[1]; } RPC_STATS_VECTOR; -#define RPC_C_STATS_CALLS_IN 0 -#define RPC_C_STATS_CALLS_OUT 1 -#define RPC_C_STATS_PKTS_IN 2 -#define RPC_C_STATS_PKTS_OUT 3 +#define RPC_C_STATS_CALLS_IN 0 +#define RPC_C_STATS_CALLS_OUT 1 +#define RPC_C_STATS_PKTS_IN 2 +#define RPC_C_STATS_PKTS_OUT 3 typedef struct { @@ -206,56 +204,56 @@ typedef struct typedef void* RPC_AUTH_IDENTITY_HANDLE; typedef void* RPC_AUTHZ_HANDLE; -#define RPC_C_AUTHN_LEVEL_DEFAULT 0 -#define RPC_C_AUTHN_LEVEL_NONE 1 -#define RPC_C_AUTHN_LEVEL_CONNECT 2 -#define RPC_C_AUTHN_LEVEL_CALL 3 -#define RPC_C_AUTHN_LEVEL_PKT 4 -#define RPC_C_AUTHN_LEVEL_PKT_INTEGRITY 5 -#define RPC_C_AUTHN_LEVEL_PKT_PRIVACY 6 +#define RPC_C_AUTHN_LEVEL_DEFAULT 0 +#define RPC_C_AUTHN_LEVEL_NONE 1 +#define RPC_C_AUTHN_LEVEL_CONNECT 2 +#define RPC_C_AUTHN_LEVEL_CALL 3 +#define RPC_C_AUTHN_LEVEL_PKT 4 +#define RPC_C_AUTHN_LEVEL_PKT_INTEGRITY 5 +#define RPC_C_AUTHN_LEVEL_PKT_PRIVACY 6 -#define RPC_C_IMP_LEVEL_DEFAULT 0 -#define RPC_C_IMP_LEVEL_ANONYMOUS 1 -#define RPC_C_IMP_LEVEL_IDENTIFY 2 -#define RPC_C_IMP_LEVEL_IMPERSONATE 3 -#define RPC_C_IMP_LEVEL_DELEGATE 4 +#define RPC_C_IMP_LEVEL_DEFAULT 0 +#define RPC_C_IMP_LEVEL_ANONYMOUS 1 +#define RPC_C_IMP_LEVEL_IDENTIFY 2 +#define RPC_C_IMP_LEVEL_IMPERSONATE 3 +#define RPC_C_IMP_LEVEL_DELEGATE 4 -#define RPC_C_QOS_IDENTITY_STATIC 0 -#define RPC_C_QOS_IDENTITY_DYNAMIC 1 +#define RPC_C_QOS_IDENTITY_STATIC 0 +#define RPC_C_QOS_IDENTITY_DYNAMIC 1 -#define RPC_C_QOS_CAPABILITIES_DEFAULT 0x0 -#define RPC_C_QOS_CAPABILITIES_MUTUAL_AUTH 0x1 -#define RPC_C_QOS_CAPABILITIES_MAKE_FULLSIC 0x2 -#define RPC_C_QOS_CAPABILITIES_ANY_AUTHORITY 0x4 -#define RPC_C_QOS_CAPABILITIES_IGNORE_DELEGATE_FAILURE 0x8 -#define RPC_C_QOS_CAPABILITIES_LOCAL_MA_HINT 0x10 +#define RPC_C_QOS_CAPABILITIES_DEFAULT 0x0 +#define RPC_C_QOS_CAPABILITIES_MUTUAL_AUTH 0x1 +#define RPC_C_QOS_CAPABILITIES_MAKE_FULLSIC 0x2 +#define RPC_C_QOS_CAPABILITIES_ANY_AUTHORITY 0x4 +#define RPC_C_QOS_CAPABILITIES_IGNORE_DELEGATE_FAILURE 0x8 +#define RPC_C_QOS_CAPABILITIES_LOCAL_MA_HINT 0x10 -#define RPC_C_PROTECT_LEVEL_DEFAULT (RPC_C_AUTHN_LEVEL_DEFAULT) -#define RPC_C_PROTECT_LEVEL_NONE (RPC_C_AUTHN_LEVEL_NONE) -#define RPC_C_PROTECT_LEVEL_CONNECT (RPC_C_AUTHN_LEVEL_CONNECT) -#define RPC_C_PROTECT_LEVEL_CALL (RPC_C_AUTHN_LEVEL_CALL) -#define RPC_C_PROTECT_LEVEL_PKT (RPC_C_AUTHN_LEVEL_PKT) -#define RPC_C_PROTECT_LEVEL_PKT_INTEGRITY (RPC_C_AUTHN_LEVEL_PKT_INTEGRITY) -#define RPC_C_PROTECT_LEVEL_PKT_PRIVACY (RPC_C_AUTHN_LEVEL_PKT_PRIVACY) +#define RPC_C_PROTECT_LEVEL_DEFAULT (RPC_C_AUTHN_LEVEL_DEFAULT) +#define RPC_C_PROTECT_LEVEL_NONE (RPC_C_AUTHN_LEVEL_NONE) +#define RPC_C_PROTECT_LEVEL_CONNECT (RPC_C_AUTHN_LEVEL_CONNECT) +#define RPC_C_PROTECT_LEVEL_CALL (RPC_C_AUTHN_LEVEL_CALL) +#define RPC_C_PROTECT_LEVEL_PKT (RPC_C_AUTHN_LEVEL_PKT) +#define RPC_C_PROTECT_LEVEL_PKT_INTEGRITY (RPC_C_AUTHN_LEVEL_PKT_INTEGRITY) +#define RPC_C_PROTECT_LEVEL_PKT_PRIVACY (RPC_C_AUTHN_LEVEL_PKT_PRIVACY) -#define RPC_C_AUTHN_NONE 0 -#define RPC_C_AUTHN_DCE_PRIVATE 1 -#define RPC_C_AUTHN_DCE_PUBLIC 2 -#define RPC_C_AUTHN_DEC_PUBLIC 4 -#define RPC_C_AUTHN_GSS_NEGOTIATE 9 -#define RPC_C_AUTHN_WINNT 10 -#define RPC_C_AUTHN_GSS_SCHANNEL 14 -#define RPC_C_AUTHN_GSS_KERBEROS 16 -#define RPC_C_AUTHN_DPA 17 -#define RPC_C_AUTHN_MSN 18 -#define RPC_C_AUTHN_DIGEST 21 -#define RPC_C_AUTHN_MQ 100 -#define RPC_C_AUTHN_DEFAULT 0xFFFFFFFFL +#define RPC_C_AUTHN_NONE 0 +#define RPC_C_AUTHN_DCE_PRIVATE 1 +#define RPC_C_AUTHN_DCE_PUBLIC 2 +#define RPC_C_AUTHN_DEC_PUBLIC 4 +#define RPC_C_AUTHN_GSS_NEGOTIATE 9 +#define RPC_C_AUTHN_WINNT 10 +#define RPC_C_AUTHN_GSS_SCHANNEL 14 +#define RPC_C_AUTHN_GSS_KERBEROS 16 +#define RPC_C_AUTHN_DPA 17 +#define RPC_C_AUTHN_MSN 18 +#define RPC_C_AUTHN_DIGEST 21 +#define RPC_C_AUTHN_MQ 100 +#define RPC_C_AUTHN_DEFAULT 0xFFFFFFFFL -#define RPC_C_NO_CREDENTIALS ((RPC_AUTH_IDENTITY_HANDLE) MAXUINT_PTR) +#define RPC_C_NO_CREDENTIALS ((RPC_AUTH_IDENTITY_HANDLE)MAXUINT_PTR) -#define RPC_C_SECURITY_QOS_VERSION 1L -#define RPC_C_SECURITY_QOS_VERSION_1 1L +#define RPC_C_SECURITY_QOS_VERSION 1L +#define RPC_C_SECURITY_QOS_VERSION_1 1L typedef struct _RPC_SECURITY_QOS { @@ -265,23 +263,23 @@ typedef struct _RPC_SECURITY_QOS unsigned long ImpersonationType; } RPC_SECURITY_QOS, *PRPC_SECURITY_QOS; -#define RPC_C_SECURITY_QOS_VERSION_2 2L +#define RPC_C_SECURITY_QOS_VERSION_2 2L -#define RPC_C_AUTHN_INFO_TYPE_HTTP 1 +#define RPC_C_AUTHN_INFO_TYPE_HTTP 1 -#define RPC_C_HTTP_AUTHN_TARGET_SERVER 1 -#define RPC_C_HTTP_AUTHN_TARGET_PROXY 2 +#define RPC_C_HTTP_AUTHN_TARGET_SERVER 1 +#define RPC_C_HTTP_AUTHN_TARGET_PROXY 2 -#define RPC_C_HTTP_AUTHN_SCHEME_BASIC 0x00000001 -#define RPC_C_HTTP_AUTHN_SCHEME_NTLM 0x00000002 -#define RPC_C_HTTP_AUTHN_SCHEME_PASSPORT 0x00000004 -#define RPC_C_HTTP_AUTHN_SCHEME_DIGEST 0x00000008 -#define RPC_C_HTTP_AUTHN_SCHEME_NEGOTIATE 0x00000010 -#define RPC_C_HTTP_AUTHN_SCHEME_CERT 0x00010000 +#define RPC_C_HTTP_AUTHN_SCHEME_BASIC 0x00000001 +#define RPC_C_HTTP_AUTHN_SCHEME_NTLM 0x00000002 +#define RPC_C_HTTP_AUTHN_SCHEME_PASSPORT 0x00000004 +#define RPC_C_HTTP_AUTHN_SCHEME_DIGEST 0x00000008 +#define RPC_C_HTTP_AUTHN_SCHEME_NEGOTIATE 0x00000010 +#define RPC_C_HTTP_AUTHN_SCHEME_CERT 0x00010000 -#define RPC_C_HTTP_FLAG_USE_SSL 1 -#define RPC_C_HTTP_FLAG_USE_FIRST_AUTH_SCHEME 2 -#define RPC_C_HTTP_FLAG_IGNORE_CERT_CN_INVALID 8 +#define RPC_C_HTTP_FLAG_USE_SSL 1 +#define RPC_C_HTTP_FLAG_USE_FIRST_AUTH_SCHEME 2 +#define RPC_C_HTTP_FLAG_IGNORE_CERT_CN_INVALID 8 typedef struct _RPC_HTTP_TRANSPORT_CREDENTIALS_W { @@ -310,8 +308,7 @@ typedef struct _RPC_SECURITY_QOS_V2_W unsigned long IdentityTracking; unsigned long ImpersonationType; unsigned long AdditionalSecurityInfoType; - union - { + union { RPC_HTTP_TRANSPORT_CREDENTIALS_W* HttpCredentials; } u; } RPC_SECURITY_QOS_V2_W, *PRPC_SECURITY_QOS_V2_W; @@ -323,8 +320,7 @@ typedef struct _RPC_SECURITY_QOS_V2_A unsigned long IdentityTracking; unsigned long ImpersonationType; unsigned long AdditionalSecurityInfoType; - union - { + union { RPC_HTTP_TRANSPORT_CREDENTIALS_A* HttpCredentials; } u; } RPC_SECURITY_QOS_V2_A, *PRPC_SECURITY_QOS_V2_A; @@ -338,8 +334,7 @@ typedef struct _RPC_SECURITY_QOS_V3_W unsigned long IdentityTracking; unsigned long ImpersonationType; unsigned long AdditionalSecurityInfoType; - union - { + union { RPC_HTTP_TRANSPORT_CREDENTIALS_W* HttpCredentials; } u; void* Sid; @@ -352,8 +347,7 @@ typedef struct _RPC_SECURITY_QOS_V3_A unsigned long IdentityTracking; unsigned long ImpersonationType; unsigned long AdditionalSecurityInfoType; - union - { + union { RPC_HTTP_TRANSPORT_CREDENTIALS_A* HttpCredentials; } u; void* Sid; @@ -368,62 +362,58 @@ typedef enum _RPC_HTTP_REDIRECTOR_STAGE RPCHTTP_RS_INTERFACE } RPC_HTTP_REDIRECTOR_STAGE; -typedef RPC_STATUS(*RPC_NEW_HTTP_PROXY_CHANNEL)(RPC_HTTP_REDIRECTOR_STAGE - RedirectorStage, - unsigned short* ServerName, unsigned short* ServerPort, - unsigned short* RemoteUser, - unsigned short* AuthType, void* ResourceUuid, void* Metadata, void* SessionId, - void* Interface, void* Reserved, unsigned long Flags, - unsigned short** NewServerName, - unsigned short** NewServerPort); +typedef RPC_STATUS (*RPC_NEW_HTTP_PROXY_CHANNEL)( + RPC_HTTP_REDIRECTOR_STAGE RedirectorStage, unsigned short* ServerName, + unsigned short* ServerPort, unsigned short* RemoteUser, unsigned short* AuthType, + void* ResourceUuid, void* Metadata, void* SessionId, void* Interface, void* Reserved, + unsigned long Flags, unsigned short** NewServerName, unsigned short** NewServerPort); typedef void (*RPC_HTTP_PROXY_FREE_STRING)(unsigned short* String); -#define RPC_C_AUTHZ_NONE 0 -#define RPC_C_AUTHZ_NAME 1 -#define RPC_C_AUTHZ_DCE 2 -#define RPC_C_AUTHZ_DEFAULT 0xFFFFFFFF +#define RPC_C_AUTHZ_NONE 0 +#define RPC_C_AUTHZ_NAME 1 +#define RPC_C_AUTHZ_DCE 2 +#define RPC_C_AUTHZ_DEFAULT 0xFFFFFFFF #endif -typedef void (*RPC_AUTH_KEY_RETRIEVAL_FN)(void* Arg, - unsigned short* ServerPrincName, unsigned long KeyVer, void** Key, - RPC_STATUS* pStatus); +typedef void (*RPC_AUTH_KEY_RETRIEVAL_FN)(void* Arg, unsigned short* ServerPrincName, + unsigned long KeyVer, void** Key, RPC_STATUS* pStatus); -#define DCE_C_ERROR_STRING_LEN 256 +#define DCE_C_ERROR_STRING_LEN 256 typedef I_RPC_HANDLE* RPC_EP_INQ_HANDLE; -#define RPC_C_EP_ALL_ELTS 0 -#define RPC_C_EP_MATCH_BY_IF 1 -#define RPC_C_EP_MATCH_BY_OBJ 2 -#define RPC_C_EP_MATCH_BY_BOTH 3 +#define RPC_C_EP_ALL_ELTS 0 +#define RPC_C_EP_MATCH_BY_IF 1 +#define RPC_C_EP_MATCH_BY_OBJ 2 +#define RPC_C_EP_MATCH_BY_BOTH 3 -#define RPC_C_VERS_ALL 1 -#define RPC_C_VERS_COMPATIBLE 2 -#define RPC_C_VERS_EXACT 3 -#define RPC_C_VERS_MAJOR_ONLY 4 -#define RPC_C_VERS_UPTO 5 +#define RPC_C_VERS_ALL 1 +#define RPC_C_VERS_COMPATIBLE 2 +#define RPC_C_VERS_EXACT 3 +#define RPC_C_VERS_MAJOR_ONLY 4 +#define RPC_C_VERS_UPTO 5 typedef int (*RPC_MGMT_AUTHORIZATION_FN)(RPC_BINDING_HANDLE ClientBinding, - unsigned long RequestedMgmtOperation, RPC_STATUS* pStatus); + unsigned long RequestedMgmtOperation, RPC_STATUS* pStatus); -#define RPC_C_MGMT_INQ_IF_IDS 0 -#define RPC_C_MGMT_INQ_PRINC_NAME 1 -#define RPC_C_MGMT_INQ_STATS 2 -#define RPC_C_MGMT_IS_SERVER_LISTEN 3 -#define RPC_C_MGMT_STOP_SERVER_LISTEN 4 +#define RPC_C_MGMT_INQ_IF_IDS 0 +#define RPC_C_MGMT_INQ_PRINC_NAME 1 +#define RPC_C_MGMT_INQ_STATS 2 +#define RPC_C_MGMT_IS_SERVER_LISTEN 3 +#define RPC_C_MGMT_STOP_SERVER_LISTEN 4 -#define RPC_C_PARM_MAX_PACKET_LENGTH 1 -#define RPC_C_PARM_BUFFER_LENGTH 2 +#define RPC_C_PARM_MAX_PACKET_LENGTH 1 +#define RPC_C_PARM_BUFFER_LENGTH 2 -#define RPC_IF_AUTOLISTEN 0x0001 -#define RPC_IF_OLE 0x0002 -#define RPC_IF_ALLOW_UNKNOWN_AUTHORITY 0x0004 -#define RPC_IF_ALLOW_SECURE_ONLY 0x0008 -#define RPC_IF_ALLOW_CALLBACKS_WITH_NO_AUTH 0x0010 -#define RPC_IF_ALLOW_LOCAL_ONLY 0x0020 -#define RPC_IF_SEC_NO_CACHE 0x0040 +#define RPC_IF_AUTOLISTEN 0x0001 +#define RPC_IF_OLE 0x0002 +#define RPC_IF_ALLOW_UNKNOWN_AUTHORITY 0x0004 +#define RPC_IF_ALLOW_SECURE_ONLY 0x0008 +#define RPC_IF_ALLOW_CALLBACKS_WITH_NO_AUTH 0x0010 +#define RPC_IF_ALLOW_LOCAL_ONLY 0x0020 +#define RPC_IF_SEC_NO_CACHE 0x0040 typedef struct _RPC_BINDING_HANDLE_OPTIONS_V1 { @@ -450,278 +440,279 @@ typedef struct _RPC_BINDING_HANDLE_TEMPLATE unsigned long ProtocolSequence; unsigned short* NetworkAddress; unsigned short* StringEndpoint; - union - { + union { unsigned short* Reserved; } u1; UUID ObjectUuid; } RPC_BINDING_HANDLE_TEMPLATE_V1, RPC_BINDING_HANDLE_TEMPLATE; -#define RPC_CALL_STATUS_IN_PROGRESS 0x01 -#define RPC_CALL_STATUS_CANCELLED 0x02 -#define RPC_CALL_STATUS_DISCONNECTED 0x03 +#define RPC_CALL_STATUS_IN_PROGRESS 0x01 +#define RPC_CALL_STATUS_CANCELLED 0x02 +#define RPC_CALL_STATUS_DISCONNECTED 0x03 #include #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API RPC_STATUS RpcBindingCopy(RPC_BINDING_HANDLE SourceBinding, - RPC_BINDING_HANDLE* DestinationBinding); -WINPR_API RPC_STATUS RpcBindingFree(RPC_BINDING_HANDLE* Binding); -WINPR_API RPC_STATUS RpcBindingSetOption(RPC_BINDING_HANDLE hBinding, - unsigned long option, ULONG_PTR optionValue); -WINPR_API RPC_STATUS RpcBindingInqOption(RPC_BINDING_HANDLE hBinding, - unsigned long option, ULONG_PTR* pOptionValue); -WINPR_API RPC_STATUS RpcBindingFromStringBindingA(RPC_CSTR StringBinding, - RPC_BINDING_HANDLE* Binding); -WINPR_API RPC_STATUS RpcBindingFromStringBindingW(RPC_WSTR StringBinding, - RPC_BINDING_HANDLE* Binding); -WINPR_API RPC_STATUS RpcSsGetContextBinding(void* ContextHandle, - RPC_BINDING_HANDLE* Binding); -WINPR_API RPC_STATUS RpcBindingInqObject(RPC_BINDING_HANDLE Binding, - UUID* ObjectUuid); -WINPR_API RPC_STATUS RpcBindingReset(RPC_BINDING_HANDLE Binding); -WINPR_API RPC_STATUS RpcBindingSetObject(RPC_BINDING_HANDLE Binding, - UUID* ObjectUuid); -WINPR_API RPC_STATUS RpcMgmtInqDefaultProtectLevel(unsigned long AuthnSvc, - unsigned long* AuthnLevel); -WINPR_API RPC_STATUS RpcBindingToStringBindingA(RPC_BINDING_HANDLE Binding, - RPC_CSTR* StringBinding); -WINPR_API RPC_STATUS RpcBindingToStringBindingW(RPC_BINDING_HANDLE Binding, - RPC_WSTR* StringBinding); -WINPR_API RPC_STATUS RpcBindingVectorFree(RPC_BINDING_VECTOR** BindingVector); -WINPR_API RPC_STATUS RpcStringBindingComposeA(RPC_CSTR ObjUuid, - RPC_CSTR Protseq, RPC_CSTR NetworkAddr, - RPC_CSTR Endpoint, RPC_CSTR Options, RPC_CSTR* StringBinding); -WINPR_API RPC_STATUS RpcStringBindingComposeW(RPC_WSTR ObjUuid, - RPC_WSTR Protseq, RPC_WSTR NetworkAddr, - RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR* StringBinding); -WINPR_API RPC_STATUS RpcStringBindingParseA(RPC_CSTR StringBinding, - RPC_CSTR* ObjUuid, RPC_CSTR* Protseq, - RPC_CSTR* NetworkAddr, RPC_CSTR* Endpoint, RPC_CSTR* NetworkOptions); -WINPR_API RPC_STATUS RpcStringBindingParseW(RPC_WSTR StringBinding, - RPC_WSTR* ObjUuid, RPC_WSTR* Protseq, - RPC_WSTR* NetworkAddr, RPC_WSTR* Endpoint, RPC_WSTR* NetworkOptions); -WINPR_API RPC_STATUS RpcStringFreeA(RPC_CSTR* String); -WINPR_API RPC_STATUS RpcStringFreeW(RPC_WSTR* String); -WINPR_API RPC_STATUS RpcIfInqId(RPC_IF_HANDLE RpcIfHandle, RPC_IF_ID* RpcIfId); -WINPR_API RPC_STATUS RpcNetworkIsProtseqValidA(RPC_CSTR Protseq); -WINPR_API RPC_STATUS RpcNetworkIsProtseqValidW(RPC_WSTR Protseq); -WINPR_API RPC_STATUS RpcMgmtInqComTimeout(RPC_BINDING_HANDLE Binding, - unsigned int* Timeout); -WINPR_API RPC_STATUS RpcMgmtSetComTimeout(RPC_BINDING_HANDLE Binding, - unsigned int Timeout); -WINPR_API RPC_STATUS RpcMgmtSetCancelTimeout(long Timeout); -WINPR_API RPC_STATUS RpcNetworkInqProtseqsA(RPC_PROTSEQ_VECTORA** - ProtseqVector); -WINPR_API RPC_STATUS RpcNetworkInqProtseqsW(RPC_PROTSEQ_VECTORW** - ProtseqVector); -WINPR_API RPC_STATUS RpcObjectInqType(UUID* ObjUuid, UUID* TypeUuid); -WINPR_API RPC_STATUS RpcObjectSetInqFn(RPC_OBJECT_INQ_FN* InquiryFn); -WINPR_API RPC_STATUS RpcObjectSetType(UUID* ObjUuid, UUID* TypeUuid); -WINPR_API RPC_STATUS RpcProtseqVectorFreeA(RPC_PROTSEQ_VECTORA** ProtseqVector); -WINPR_API RPC_STATUS RpcProtseqVectorFreeW(RPC_PROTSEQ_VECTORW** ProtseqVector); -WINPR_API RPC_STATUS RpcServerInqBindings(RPC_BINDING_VECTOR** BindingVector); -WINPR_API RPC_STATUS RpcServerInqIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, - RPC_MGR_EPV** MgrEpv); -WINPR_API RPC_STATUS RpcServerListen(unsigned int MinimumCallThreads, - unsigned int MaxCalls, unsigned int DontWait); -WINPR_API RPC_STATUS RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, - UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv); -WINPR_API RPC_STATUS RpcServerRegisterIfEx(RPC_IF_HANDLE IfSpec, - UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv, - unsigned int Flags, unsigned int MaxCalls, RPC_IF_CALLBACK_FN* IfCallback); -WINPR_API RPC_STATUS RpcServerRegisterIf2(RPC_IF_HANDLE IfSpec, - UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv, - unsigned int Flags, unsigned int MaxCalls, unsigned int MaxRpcSize, - RPC_IF_CALLBACK_FN* IfCallbackFn); -WINPR_API RPC_STATUS RpcServerUnregisterIf(RPC_IF_HANDLE IfSpec, - UUID* MgrTypeUuid, unsigned int WaitForCallsToComplete); -WINPR_API RPC_STATUS RpcServerUnregisterIfEx(RPC_IF_HANDLE IfSpec, - UUID* MgrTypeUuid, int RundownContextHandles); -WINPR_API RPC_STATUS RpcServerUseAllProtseqs(unsigned int MaxCalls, - void* SecurityDescriptor); -WINPR_API RPC_STATUS RpcServerUseAllProtseqsEx(unsigned int MaxCalls, - void* SecurityDescriptor, PRPC_POLICY Policy); -WINPR_API RPC_STATUS RpcServerUseAllProtseqsIf(unsigned int MaxCalls, - RPC_IF_HANDLE IfSpec, void* SecurityDescriptor); -WINPR_API RPC_STATUS RpcServerUseAllProtseqsIfEx(unsigned int MaxCalls, - RPC_IF_HANDLE IfSpec, void* SecurityDescriptor, PRPC_POLICY Policy); -WINPR_API RPC_STATUS RpcServerUseProtseqA(RPC_CSTR Protseq, - unsigned int MaxCalls, void* SecurityDescriptor); -WINPR_API RPC_STATUS RpcServerUseProtseqExA(RPC_CSTR Protseq, - unsigned int MaxCalls, void* SecurityDescriptor, PRPC_POLICY Policy); -WINPR_API RPC_STATUS RpcServerUseProtseqW(RPC_WSTR Protseq, - unsigned int MaxCalls, void* SecurityDescriptor); -WINPR_API RPC_STATUS RpcServerUseProtseqExW(RPC_WSTR Protseq, - unsigned int MaxCalls, void* SecurityDescriptor, PRPC_POLICY Policy); -WINPR_API RPC_STATUS RpcServerUseProtseqEpA(RPC_CSTR Protseq, - unsigned int MaxCalls, RPC_CSTR Endpoint, void* SecurityDescriptor); -WINPR_API RPC_STATUS RpcServerUseProtseqEpExA(RPC_CSTR Protseq, - unsigned int MaxCalls, RPC_CSTR Endpoint, void* SecurityDescriptor, - PRPC_POLICY Policy); -WINPR_API RPC_STATUS RpcServerUseProtseqEpW(RPC_WSTR Protseq, - unsigned int MaxCalls, RPC_WSTR Endpoint, void* SecurityDescriptor); -WINPR_API RPC_STATUS RpcServerUseProtseqEpExW(RPC_WSTR Protseq, - unsigned int MaxCalls, RPC_WSTR Endpoint, void* SecurityDescriptor, - PRPC_POLICY Policy); -WINPR_API RPC_STATUS RpcServerUseProtseqIfA(RPC_CSTR Protseq, - unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor); -WINPR_API RPC_STATUS RpcServerUseProtseqIfExA(RPC_CSTR Protseq, - unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor, - PRPC_POLICY Policy); -WINPR_API RPC_STATUS RpcServerUseProtseqIfW(RPC_WSTR Protseq, - unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor); -WINPR_API RPC_STATUS RpcServerUseProtseqIfExW(RPC_WSTR Protseq, - unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor, - PRPC_POLICY Policy); -WINPR_API void RpcServerYield(void); -WINPR_API RPC_STATUS RpcMgmtStatsVectorFree(RPC_STATS_VECTOR** StatsVector); -WINPR_API RPC_STATUS RpcMgmtInqStats(RPC_BINDING_HANDLE Binding, - RPC_STATS_VECTOR** Statistics); -WINPR_API RPC_STATUS RpcMgmtIsServerListening(RPC_BINDING_HANDLE Binding); -WINPR_API RPC_STATUS RpcMgmtStopServerListening(RPC_BINDING_HANDLE Binding); -WINPR_API RPC_STATUS RpcMgmtWaitServerListen(void); -WINPR_API RPC_STATUS RpcMgmtSetServerStackSize(unsigned long ThreadStackSize); -WINPR_API void RpcSsDontSerializeContext(void); -WINPR_API RPC_STATUS RpcMgmtEnableIdleCleanup(void); -WINPR_API RPC_STATUS RpcMgmtInqIfIds(RPC_BINDING_HANDLE Binding, - RPC_IF_ID_VECTOR** IfIdVector); -WINPR_API RPC_STATUS RpcIfIdVectorFree(RPC_IF_ID_VECTOR** IfIdVector); -WINPR_API RPC_STATUS RpcMgmtInqServerPrincNameA(RPC_BINDING_HANDLE Binding, - unsigned long AuthnSvc, RPC_CSTR* ServerPrincName); -WINPR_API RPC_STATUS RpcMgmtInqServerPrincNameW(RPC_BINDING_HANDLE Binding, - unsigned long AuthnSvc, RPC_WSTR* ServerPrincName); -WINPR_API RPC_STATUS RpcServerInqDefaultPrincNameA(unsigned long AuthnSvc, - RPC_CSTR* PrincName); -WINPR_API RPC_STATUS RpcServerInqDefaultPrincNameW(unsigned long AuthnSvc, - RPC_WSTR* PrincName); -WINPR_API RPC_STATUS RpcEpResolveBinding(RPC_BINDING_HANDLE Binding, - RPC_IF_HANDLE IfSpec); -WINPR_API RPC_STATUS RpcNsBindingInqEntryNameA(RPC_BINDING_HANDLE Binding, - unsigned long EntryNameSyntax, RPC_CSTR* EntryName); -WINPR_API RPC_STATUS RpcNsBindingInqEntryNameW(RPC_BINDING_HANDLE Binding, - unsigned long EntryNameSyntax, RPC_WSTR* EntryName); + WINPR_API RPC_STATUS RpcBindingCopy(RPC_BINDING_HANDLE SourceBinding, + RPC_BINDING_HANDLE* DestinationBinding); + WINPR_API RPC_STATUS RpcBindingFree(RPC_BINDING_HANDLE* Binding); + WINPR_API RPC_STATUS RpcBindingSetOption(RPC_BINDING_HANDLE hBinding, unsigned long option, + ULONG_PTR optionValue); + WINPR_API RPC_STATUS RpcBindingInqOption(RPC_BINDING_HANDLE hBinding, unsigned long option, + ULONG_PTR* pOptionValue); + WINPR_API RPC_STATUS RpcBindingFromStringBindingA(RPC_CSTR StringBinding, + RPC_BINDING_HANDLE* Binding); + WINPR_API RPC_STATUS RpcBindingFromStringBindingW(RPC_WSTR StringBinding, + RPC_BINDING_HANDLE* Binding); + WINPR_API RPC_STATUS RpcSsGetContextBinding(void* ContextHandle, RPC_BINDING_HANDLE* Binding); + WINPR_API RPC_STATUS RpcBindingInqObject(RPC_BINDING_HANDLE Binding, UUID* ObjectUuid); + WINPR_API RPC_STATUS RpcBindingReset(RPC_BINDING_HANDLE Binding); + WINPR_API RPC_STATUS RpcBindingSetObject(RPC_BINDING_HANDLE Binding, UUID* ObjectUuid); + WINPR_API RPC_STATUS RpcMgmtInqDefaultProtectLevel(unsigned long AuthnSvc, + unsigned long* AuthnLevel); + WINPR_API RPC_STATUS RpcBindingToStringBindingA(RPC_BINDING_HANDLE Binding, + RPC_CSTR* StringBinding); + WINPR_API RPC_STATUS RpcBindingToStringBindingW(RPC_BINDING_HANDLE Binding, + RPC_WSTR* StringBinding); + WINPR_API RPC_STATUS RpcBindingVectorFree(RPC_BINDING_VECTOR** BindingVector); + WINPR_API RPC_STATUS RpcStringBindingComposeA(RPC_CSTR ObjUuid, RPC_CSTR Protseq, + RPC_CSTR NetworkAddr, RPC_CSTR Endpoint, + RPC_CSTR Options, RPC_CSTR* StringBinding); + WINPR_API RPC_STATUS RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, + RPC_WSTR NetworkAddr, RPC_WSTR Endpoint, + RPC_WSTR Options, RPC_WSTR* StringBinding); + WINPR_API RPC_STATUS RpcStringBindingParseA(RPC_CSTR StringBinding, RPC_CSTR* ObjUuid, + RPC_CSTR* Protseq, RPC_CSTR* NetworkAddr, + RPC_CSTR* Endpoint, RPC_CSTR* NetworkOptions); + WINPR_API RPC_STATUS RpcStringBindingParseW(RPC_WSTR StringBinding, RPC_WSTR* ObjUuid, + RPC_WSTR* Protseq, RPC_WSTR* NetworkAddr, + RPC_WSTR* Endpoint, RPC_WSTR* NetworkOptions); + WINPR_API RPC_STATUS RpcStringFreeA(RPC_CSTR* String); + WINPR_API RPC_STATUS RpcStringFreeW(RPC_WSTR* String); + WINPR_API RPC_STATUS RpcIfInqId(RPC_IF_HANDLE RpcIfHandle, RPC_IF_ID* RpcIfId); + WINPR_API RPC_STATUS RpcNetworkIsProtseqValidA(RPC_CSTR Protseq); + WINPR_API RPC_STATUS RpcNetworkIsProtseqValidW(RPC_WSTR Protseq); + WINPR_API RPC_STATUS RpcMgmtInqComTimeout(RPC_BINDING_HANDLE Binding, unsigned int* Timeout); + WINPR_API RPC_STATUS RpcMgmtSetComTimeout(RPC_BINDING_HANDLE Binding, unsigned int Timeout); + WINPR_API RPC_STATUS RpcMgmtSetCancelTimeout(long Timeout); + WINPR_API RPC_STATUS RpcNetworkInqProtseqsA(RPC_PROTSEQ_VECTORA** ProtseqVector); + WINPR_API RPC_STATUS RpcNetworkInqProtseqsW(RPC_PROTSEQ_VECTORW** ProtseqVector); + WINPR_API RPC_STATUS RpcObjectInqType(UUID* ObjUuid, UUID* TypeUuid); + WINPR_API RPC_STATUS RpcObjectSetInqFn(RPC_OBJECT_INQ_FN* InquiryFn); + WINPR_API RPC_STATUS RpcObjectSetType(UUID* ObjUuid, UUID* TypeUuid); + WINPR_API RPC_STATUS RpcProtseqVectorFreeA(RPC_PROTSEQ_VECTORA** ProtseqVector); + WINPR_API RPC_STATUS RpcProtseqVectorFreeW(RPC_PROTSEQ_VECTORW** ProtseqVector); + WINPR_API RPC_STATUS RpcServerInqBindings(RPC_BINDING_VECTOR** BindingVector); + WINPR_API RPC_STATUS RpcServerInqIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, + RPC_MGR_EPV** MgrEpv); + WINPR_API RPC_STATUS RpcServerListen(unsigned int MinimumCallThreads, unsigned int MaxCalls, + unsigned int DontWait); + WINPR_API RPC_STATUS RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, + RPC_MGR_EPV* MgrEpv); + WINPR_API RPC_STATUS RpcServerRegisterIfEx(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, + RPC_MGR_EPV* MgrEpv, unsigned int Flags, + unsigned int MaxCalls, + RPC_IF_CALLBACK_FN* IfCallback); + WINPR_API RPC_STATUS RpcServerRegisterIf2(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, + RPC_MGR_EPV* MgrEpv, unsigned int Flags, + unsigned int MaxCalls, unsigned int MaxRpcSize, + RPC_IF_CALLBACK_FN* IfCallbackFn); + WINPR_API RPC_STATUS RpcServerUnregisterIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, + unsigned int WaitForCallsToComplete); + WINPR_API RPC_STATUS RpcServerUnregisterIfEx(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, + int RundownContextHandles); + WINPR_API RPC_STATUS RpcServerUseAllProtseqs(unsigned int MaxCalls, void* SecurityDescriptor); + WINPR_API RPC_STATUS RpcServerUseAllProtseqsEx(unsigned int MaxCalls, void* SecurityDescriptor, + PRPC_POLICY Policy); + WINPR_API RPC_STATUS RpcServerUseAllProtseqsIf(unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, + void* SecurityDescriptor); + WINPR_API RPC_STATUS RpcServerUseAllProtseqsIfEx(unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, + void* SecurityDescriptor, PRPC_POLICY Policy); + WINPR_API RPC_STATUS RpcServerUseProtseqA(RPC_CSTR Protseq, unsigned int MaxCalls, + void* SecurityDescriptor); + WINPR_API RPC_STATUS RpcServerUseProtseqExA(RPC_CSTR Protseq, unsigned int MaxCalls, + void* SecurityDescriptor, PRPC_POLICY Policy); + WINPR_API RPC_STATUS RpcServerUseProtseqW(RPC_WSTR Protseq, unsigned int MaxCalls, + void* SecurityDescriptor); + WINPR_API RPC_STATUS RpcServerUseProtseqExW(RPC_WSTR Protseq, unsigned int MaxCalls, + void* SecurityDescriptor, PRPC_POLICY Policy); + WINPR_API RPC_STATUS RpcServerUseProtseqEpA(RPC_CSTR Protseq, unsigned int MaxCalls, + RPC_CSTR Endpoint, void* SecurityDescriptor); + WINPR_API RPC_STATUS RpcServerUseProtseqEpExA(RPC_CSTR Protseq, unsigned int MaxCalls, + RPC_CSTR Endpoint, void* SecurityDescriptor, + PRPC_POLICY Policy); + WINPR_API RPC_STATUS RpcServerUseProtseqEpW(RPC_WSTR Protseq, unsigned int MaxCalls, + RPC_WSTR Endpoint, void* SecurityDescriptor); + WINPR_API RPC_STATUS RpcServerUseProtseqEpExW(RPC_WSTR Protseq, unsigned int MaxCalls, + RPC_WSTR Endpoint, void* SecurityDescriptor, + PRPC_POLICY Policy); + WINPR_API RPC_STATUS RpcServerUseProtseqIfA(RPC_CSTR Protseq, unsigned int MaxCalls, + RPC_IF_HANDLE IfSpec, void* SecurityDescriptor); + WINPR_API RPC_STATUS RpcServerUseProtseqIfExA(RPC_CSTR Protseq, unsigned int MaxCalls, + RPC_IF_HANDLE IfSpec, void* SecurityDescriptor, + PRPC_POLICY Policy); + WINPR_API RPC_STATUS RpcServerUseProtseqIfW(RPC_WSTR Protseq, unsigned int MaxCalls, + RPC_IF_HANDLE IfSpec, void* SecurityDescriptor); + WINPR_API RPC_STATUS RpcServerUseProtseqIfExW(RPC_WSTR Protseq, unsigned int MaxCalls, + RPC_IF_HANDLE IfSpec, void* SecurityDescriptor, + PRPC_POLICY Policy); + WINPR_API void RpcServerYield(void); + WINPR_API RPC_STATUS RpcMgmtStatsVectorFree(RPC_STATS_VECTOR** StatsVector); + WINPR_API RPC_STATUS RpcMgmtInqStats(RPC_BINDING_HANDLE Binding, RPC_STATS_VECTOR** Statistics); + WINPR_API RPC_STATUS RpcMgmtIsServerListening(RPC_BINDING_HANDLE Binding); + WINPR_API RPC_STATUS RpcMgmtStopServerListening(RPC_BINDING_HANDLE Binding); + WINPR_API RPC_STATUS RpcMgmtWaitServerListen(void); + WINPR_API RPC_STATUS RpcMgmtSetServerStackSize(unsigned long ThreadStackSize); + WINPR_API void RpcSsDontSerializeContext(void); + WINPR_API RPC_STATUS RpcMgmtEnableIdleCleanup(void); + WINPR_API RPC_STATUS RpcMgmtInqIfIds(RPC_BINDING_HANDLE Binding, RPC_IF_ID_VECTOR** IfIdVector); + WINPR_API RPC_STATUS RpcIfIdVectorFree(RPC_IF_ID_VECTOR** IfIdVector); + WINPR_API RPC_STATUS RpcMgmtInqServerPrincNameA(RPC_BINDING_HANDLE Binding, + unsigned long AuthnSvc, + RPC_CSTR* ServerPrincName); + WINPR_API RPC_STATUS RpcMgmtInqServerPrincNameW(RPC_BINDING_HANDLE Binding, + unsigned long AuthnSvc, + RPC_WSTR* ServerPrincName); + WINPR_API RPC_STATUS RpcServerInqDefaultPrincNameA(unsigned long AuthnSvc, RPC_CSTR* PrincName); + WINPR_API RPC_STATUS RpcServerInqDefaultPrincNameW(unsigned long AuthnSvc, RPC_WSTR* PrincName); + WINPR_API RPC_STATUS RpcEpResolveBinding(RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE IfSpec); + WINPR_API RPC_STATUS RpcNsBindingInqEntryNameA(RPC_BINDING_HANDLE Binding, + unsigned long EntryNameSyntax, + RPC_CSTR* EntryName); + WINPR_API RPC_STATUS RpcNsBindingInqEntryNameW(RPC_BINDING_HANDLE Binding, + unsigned long EntryNameSyntax, + RPC_WSTR* EntryName); -WINPR_API RPC_STATUS RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle); -WINPR_API RPC_STATUS RpcRevertToSelfEx(RPC_BINDING_HANDLE BindingHandle); -WINPR_API RPC_STATUS RpcRevertToSelf(void); -WINPR_API RPC_STATUS RpcBindingInqAuthClientA(RPC_BINDING_HANDLE ClientBinding, - RPC_AUTHZ_HANDLE* Privs, - RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc, - unsigned long* AuthzSvc); -WINPR_API RPC_STATUS RpcBindingInqAuthClientW(RPC_BINDING_HANDLE ClientBinding, - RPC_AUTHZ_HANDLE* Privs, - RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc, - unsigned long* AuthzSvc); -WINPR_API RPC_STATUS RpcBindingInqAuthClientExA(RPC_BINDING_HANDLE - ClientBinding, RPC_AUTHZ_HANDLE* Privs, - RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc, - unsigned long* AuthzSvc, unsigned long Flags); -WINPR_API RPC_STATUS RpcBindingInqAuthClientExW(RPC_BINDING_HANDLE - ClientBinding, RPC_AUTHZ_HANDLE* Privs, - RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc, - unsigned long* AuthzSvc, unsigned long Flags); -WINPR_API RPC_STATUS RpcBindingInqAuthInfoA(RPC_BINDING_HANDLE Binding, - RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel, - unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, - unsigned long* AuthzSvc); -WINPR_API RPC_STATUS RpcBindingInqAuthInfoW(RPC_BINDING_HANDLE Binding, - RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel, - unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, - unsigned long* AuthzSvc); -WINPR_API RPC_STATUS RpcBindingSetAuthInfoA(RPC_BINDING_HANDLE Binding, - RPC_CSTR ServerPrincName, unsigned long AuthnLevel, - unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, - unsigned long AuthzSvc); -WINPR_API RPC_STATUS RpcBindingSetAuthInfoExA(RPC_BINDING_HANDLE Binding, - RPC_CSTR ServerPrincName, unsigned long AuthnLevel, - unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, - unsigned long AuthzSvc, RPC_SECURITY_QOS* SecurityQos); -WINPR_API RPC_STATUS RpcBindingSetAuthInfoW(RPC_BINDING_HANDLE Binding, - RPC_WSTR ServerPrincName, unsigned long AuthnLevel, - unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, - unsigned long AuthzSvc); -WINPR_API RPC_STATUS RpcBindingSetAuthInfoExW(RPC_BINDING_HANDLE Binding, - RPC_WSTR ServerPrincName, unsigned long AuthnLevel, - unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, - unsigned long AuthzSvc, RPC_SECURITY_QOS* SecurityQOS); -WINPR_API RPC_STATUS RpcBindingInqAuthInfoExA(RPC_BINDING_HANDLE Binding, - RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel, - unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, - unsigned long* AuthzSvc, - unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS); -WINPR_API RPC_STATUS RpcBindingInqAuthInfoExW(RPC_BINDING_HANDLE Binding, - RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel, - unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, - unsigned long* AuthzSvc, - unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS); + WINPR_API RPC_STATUS RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle); + WINPR_API RPC_STATUS RpcRevertToSelfEx(RPC_BINDING_HANDLE BindingHandle); + WINPR_API RPC_STATUS RpcRevertToSelf(void); + WINPR_API RPC_STATUS RpcBindingInqAuthClientA(RPC_BINDING_HANDLE ClientBinding, + RPC_AUTHZ_HANDLE* Privs, + RPC_CSTR* ServerPrincName, + unsigned long* AuthnLevel, + unsigned long* AuthnSvc, unsigned long* AuthzSvc); + WINPR_API RPC_STATUS RpcBindingInqAuthClientW(RPC_BINDING_HANDLE ClientBinding, + RPC_AUTHZ_HANDLE* Privs, + RPC_WSTR* ServerPrincName, + unsigned long* AuthnLevel, + unsigned long* AuthnSvc, unsigned long* AuthzSvc); + WINPR_API RPC_STATUS RpcBindingInqAuthClientExA(RPC_BINDING_HANDLE ClientBinding, + RPC_AUTHZ_HANDLE* Privs, + RPC_CSTR* ServerPrincName, + unsigned long* AuthnLevel, + unsigned long* AuthnSvc, + unsigned long* AuthzSvc, unsigned long Flags); + WINPR_API RPC_STATUS RpcBindingInqAuthClientExW(RPC_BINDING_HANDLE ClientBinding, + RPC_AUTHZ_HANDLE* Privs, + RPC_WSTR* ServerPrincName, + unsigned long* AuthnLevel, + unsigned long* AuthnSvc, + unsigned long* AuthzSvc, unsigned long Flags); + WINPR_API RPC_STATUS RpcBindingInqAuthInfoA(RPC_BINDING_HANDLE Binding, + RPC_CSTR* ServerPrincName, + unsigned long* AuthnLevel, unsigned long* AuthnSvc, + RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, + unsigned long* AuthzSvc); + WINPR_API RPC_STATUS RpcBindingInqAuthInfoW(RPC_BINDING_HANDLE Binding, + RPC_WSTR* ServerPrincName, + unsigned long* AuthnLevel, unsigned long* AuthnSvc, + RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, + unsigned long* AuthzSvc); + WINPR_API RPC_STATUS RpcBindingSetAuthInfoA(RPC_BINDING_HANDLE Binding, + RPC_CSTR ServerPrincName, unsigned long AuthnLevel, + unsigned long AuthnSvc, + RPC_AUTH_IDENTITY_HANDLE AuthIdentity, + unsigned long AuthzSvc); + WINPR_API RPC_STATUS RpcBindingSetAuthInfoExA(RPC_BINDING_HANDLE Binding, + RPC_CSTR ServerPrincName, + unsigned long AuthnLevel, unsigned long AuthnSvc, + RPC_AUTH_IDENTITY_HANDLE AuthIdentity, + unsigned long AuthzSvc, + RPC_SECURITY_QOS* SecurityQos); + WINPR_API RPC_STATUS RpcBindingSetAuthInfoW(RPC_BINDING_HANDLE Binding, + RPC_WSTR ServerPrincName, unsigned long AuthnLevel, + unsigned long AuthnSvc, + RPC_AUTH_IDENTITY_HANDLE AuthIdentity, + unsigned long AuthzSvc); + WINPR_API RPC_STATUS RpcBindingSetAuthInfoExW(RPC_BINDING_HANDLE Binding, + RPC_WSTR ServerPrincName, + unsigned long AuthnLevel, unsigned long AuthnSvc, + RPC_AUTH_IDENTITY_HANDLE AuthIdentity, + unsigned long AuthzSvc, + RPC_SECURITY_QOS* SecurityQOS); + WINPR_API RPC_STATUS RpcBindingInqAuthInfoExA( + RPC_BINDING_HANDLE Binding, RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel, + unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc, + unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS); + WINPR_API RPC_STATUS RpcBindingInqAuthInfoExW( + RPC_BINDING_HANDLE Binding, RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel, + unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc, + unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS); -WINPR_API RPC_STATUS RpcServerRegisterAuthInfoA(RPC_CSTR ServerPrincName, - unsigned long AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg); -WINPR_API RPC_STATUS RpcServerRegisterAuthInfoW(RPC_WSTR ServerPrincName, - unsigned long AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg); + WINPR_API RPC_STATUS RpcServerRegisterAuthInfoA(RPC_CSTR ServerPrincName, + unsigned long AuthnSvc, + RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg); + WINPR_API RPC_STATUS RpcServerRegisterAuthInfoW(RPC_WSTR ServerPrincName, + unsigned long AuthnSvc, + RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg); -WINPR_API RPC_STATUS RpcBindingServerFromClient(RPC_BINDING_HANDLE - ClientBinding, RPC_BINDING_HANDLE* ServerBinding); -WINPR_API DECLSPEC_NORETURN void RpcRaiseException(RPC_STATUS exception); -WINPR_API RPC_STATUS RpcTestCancel(void); -WINPR_API RPC_STATUS RpcServerTestCancel(RPC_BINDING_HANDLE BindingHandle); -WINPR_API RPC_STATUS RpcCancelThread(void* Thread); -WINPR_API RPC_STATUS RpcCancelThreadEx(void* Thread, long Timeout); + WINPR_API RPC_STATUS RpcBindingServerFromClient(RPC_BINDING_HANDLE ClientBinding, + RPC_BINDING_HANDLE* ServerBinding); + WINPR_API DECLSPEC_NORETURN void RpcRaiseException(RPC_STATUS exception); + WINPR_API RPC_STATUS RpcTestCancel(void); + WINPR_API RPC_STATUS RpcServerTestCancel(RPC_BINDING_HANDLE BindingHandle); + WINPR_API RPC_STATUS RpcCancelThread(void* Thread); + WINPR_API RPC_STATUS RpcCancelThreadEx(void* Thread, long Timeout); -WINPR_API RPC_STATUS UuidCreate(UUID* Uuid); -WINPR_API RPC_STATUS UuidCreateSequential(UUID* Uuid); -WINPR_API RPC_STATUS UuidToStringA(const UUID* Uuid, RPC_CSTR* StringUuid); -WINPR_API RPC_STATUS UuidFromStringA(RPC_CSTR StringUuid, UUID* Uuid); -WINPR_API RPC_STATUS UuidToStringW(const UUID* Uuid, RPC_WSTR* StringUuid); -WINPR_API RPC_STATUS UuidFromStringW(RPC_WSTR StringUuid, UUID* Uuid); -WINPR_API signed int UuidCompare(const UUID* Uuid1, const UUID* Uuid2, - RPC_STATUS* Status); -WINPR_API RPC_STATUS UuidCreateNil(UUID* NilUuid); -WINPR_API int UuidEqual(const UUID* Uuid1, const UUID* Uuid2, - RPC_STATUS* Status); -WINPR_API unsigned short UuidHash(const UUID* Uuid, RPC_STATUS* Status); -WINPR_API int UuidIsNil(const UUID* Uuid, RPC_STATUS* Status); + WINPR_API RPC_STATUS UuidCreate(UUID* Uuid); + WINPR_API RPC_STATUS UuidCreateSequential(UUID* Uuid); + WINPR_API RPC_STATUS UuidToStringA(const UUID* Uuid, RPC_CSTR* StringUuid); + WINPR_API RPC_STATUS UuidFromStringA(RPC_CSTR StringUuid, UUID* Uuid); + WINPR_API RPC_STATUS UuidToStringW(const UUID* Uuid, RPC_WSTR* StringUuid); + WINPR_API RPC_STATUS UuidFromStringW(RPC_WSTR StringUuid, UUID* Uuid); + WINPR_API signed int UuidCompare(const UUID* Uuid1, const UUID* Uuid2, RPC_STATUS* Status); + WINPR_API RPC_STATUS UuidCreateNil(UUID* NilUuid); + WINPR_API int UuidEqual(const UUID* Uuid1, const UUID* Uuid2, RPC_STATUS* Status); + WINPR_API unsigned short UuidHash(const UUID* Uuid, RPC_STATUS* Status); + WINPR_API int UuidIsNil(const UUID* Uuid, RPC_STATUS* Status); -WINPR_API RPC_STATUS RpcEpRegisterNoReplaceA(RPC_IF_HANDLE IfSpec, - RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, - RPC_CSTR Annotation); -WINPR_API RPC_STATUS RpcEpRegisterNoReplaceW(RPC_IF_HANDLE IfSpec, - RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, - RPC_WSTR Annotation); -WINPR_API RPC_STATUS RpcEpRegisterA(RPC_IF_HANDLE IfSpec, - RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, - RPC_CSTR Annotation); -WINPR_API RPC_STATUS RpcEpRegisterW(RPC_IF_HANDLE IfSpec, - RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, - RPC_WSTR Annotation); -WINPR_API RPC_STATUS RpcEpUnregister(RPC_IF_HANDLE IfSpec, - RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector); + WINPR_API RPC_STATUS RpcEpRegisterNoReplaceA(RPC_IF_HANDLE IfSpec, + RPC_BINDING_VECTOR* BindingVector, + UUID_VECTOR* UuidVector, RPC_CSTR Annotation); + WINPR_API RPC_STATUS RpcEpRegisterNoReplaceW(RPC_IF_HANDLE IfSpec, + RPC_BINDING_VECTOR* BindingVector, + UUID_VECTOR* UuidVector, RPC_WSTR Annotation); + WINPR_API RPC_STATUS RpcEpRegisterA(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, + UUID_VECTOR* UuidVector, RPC_CSTR Annotation); + WINPR_API RPC_STATUS RpcEpRegisterW(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, + UUID_VECTOR* UuidVector, RPC_WSTR Annotation); + WINPR_API RPC_STATUS RpcEpUnregister(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, + UUID_VECTOR* UuidVector); -WINPR_API RPC_STATUS DceErrorInqTextA(RPC_STATUS RpcStatus, RPC_CSTR ErrorText); -WINPR_API RPC_STATUS DceErrorInqTextW(RPC_STATUS RpcStatus, RPC_WSTR ErrorText); + WINPR_API RPC_STATUS DceErrorInqTextA(RPC_STATUS RpcStatus, RPC_CSTR ErrorText); + WINPR_API RPC_STATUS DceErrorInqTextW(RPC_STATUS RpcStatus, RPC_WSTR ErrorText); -WINPR_API RPC_STATUS RpcMgmtEpEltInqBegin(RPC_BINDING_HANDLE EpBinding, - unsigned long InquiryType, RPC_IF_ID* IfId, - unsigned long VersOption, UUID* ObjectUuid, RPC_EP_INQ_HANDLE* InquiryContext); -WINPR_API RPC_STATUS RpcMgmtEpEltInqDone(RPC_EP_INQ_HANDLE* InquiryContext); -WINPR_API RPC_STATUS RpcMgmtEpEltInqNextA(RPC_EP_INQ_HANDLE InquiryContext, - RPC_IF_ID* IfId, - RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid, RPC_CSTR* Annotation); -WINPR_API RPC_STATUS RpcMgmtEpEltInqNextW(RPC_EP_INQ_HANDLE InquiryContext, - RPC_IF_ID* IfId, - RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid, RPC_WSTR* Annotation); -WINPR_API RPC_STATUS RpcMgmtEpUnregister(RPC_BINDING_HANDLE EpBinding, - RPC_IF_ID* IfId, - RPC_BINDING_HANDLE Binding, UUID* ObjectUuid); -WINPR_API RPC_STATUS RpcMgmtSetAuthorizationFn(RPC_MGMT_AUTHORIZATION_FN - AuthorizationFn); + WINPR_API RPC_STATUS RpcMgmtEpEltInqBegin(RPC_BINDING_HANDLE EpBinding, + unsigned long InquiryType, RPC_IF_ID* IfId, + unsigned long VersOption, UUID* ObjectUuid, + RPC_EP_INQ_HANDLE* InquiryContext); + WINPR_API RPC_STATUS RpcMgmtEpEltInqDone(RPC_EP_INQ_HANDLE* InquiryContext); + WINPR_API RPC_STATUS RpcMgmtEpEltInqNextA(RPC_EP_INQ_HANDLE InquiryContext, RPC_IF_ID* IfId, + RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid, + RPC_CSTR* Annotation); + WINPR_API RPC_STATUS RpcMgmtEpEltInqNextW(RPC_EP_INQ_HANDLE InquiryContext, RPC_IF_ID* IfId, + RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid, + RPC_WSTR* Annotation); + WINPR_API RPC_STATUS RpcMgmtEpUnregister(RPC_BINDING_HANDLE EpBinding, RPC_IF_ID* IfId, + RPC_BINDING_HANDLE Binding, UUID* ObjectUuid); + WINPR_API RPC_STATUS RpcMgmtSetAuthorizationFn(RPC_MGMT_AUTHORIZATION_FN AuthorizationFn); -WINPR_API RPC_STATUS RpcServerInqBindingHandle(RPC_BINDING_HANDLE* Binding); + WINPR_API RPC_STATUS RpcServerInqBindingHandle(RPC_BINDING_HANDLE* Binding); #ifdef __cplusplus } diff --git a/winpr/include/winpr/sam.h b/winpr/include/winpr/sam.h index 3740daf20..a11967b12 100644 --- a/winpr/include/winpr/sam.h +++ b/winpr/include/winpr/sam.h @@ -44,21 +44,23 @@ struct winpr_sam_entry typedef struct winpr_sam_entry WINPR_SAM_ENTRY; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API WINPR_SAM_ENTRY* SamLookupUserA(WINPR_SAM* sam, LPSTR User, UINT32 UserLength, LPSTR Domain, UINT32 DomainLength); -WINPR_API WINPR_SAM_ENTRY* SamLookupUserW(WINPR_SAM* sam, LPWSTR User, UINT32 UserLength, LPWSTR Domain, UINT32 DomainLength); + WINPR_API WINPR_SAM_ENTRY* SamLookupUserA(WINPR_SAM* sam, LPSTR User, UINT32 UserLength, + LPSTR Domain, UINT32 DomainLength); + WINPR_API WINPR_SAM_ENTRY* SamLookupUserW(WINPR_SAM* sam, LPWSTR User, UINT32 UserLength, + LPWSTR Domain, UINT32 DomainLength); -WINPR_API void SamResetEntry(WINPR_SAM_ENTRY* entry); -WINPR_API void SamFreeEntry(WINPR_SAM* sam, WINPR_SAM_ENTRY* entry); + WINPR_API void SamResetEntry(WINPR_SAM_ENTRY* entry); + WINPR_API void SamFreeEntry(WINPR_SAM* sam, WINPR_SAM_ENTRY* entry); -WINPR_API WINPR_SAM* SamOpen(const char* filename, BOOL readOnly); -WINPR_API void SamClose(WINPR_SAM* sam); + WINPR_API WINPR_SAM* SamOpen(const char* filename, BOOL readOnly); + WINPR_API void SamClose(WINPR_SAM* sam); #ifdef __cplusplus } #endif #endif /* WINPR_UTILS_SAM_H */ - diff --git a/winpr/include/winpr/schannel.h b/winpr/include/winpr/schannel.h index 118f627bf..d9e2d6525 100644 --- a/winpr/include/winpr/schannel.h +++ b/winpr/include/winpr/schannel.h @@ -29,18 +29,18 @@ #else -#define SCHANNEL_NAME_A "Schannel" -#define SCHANNEL_NAME_W L"Schannel" +#define SCHANNEL_NAME_A "Schannel" +#define SCHANNEL_NAME_W L"Schannel" #ifdef _UNICODE -#define SCHANNEL_NAME SCHANNEL_NAME_W +#define SCHANNEL_NAME SCHANNEL_NAME_W #else -#define SCHANNEL_NAME SCHANNEL_NAME_A +#define SCHANNEL_NAME SCHANNEL_NAME_A #endif -#define SECPKG_ATTR_SUPPORTED_ALGS 86 -#define SECPKG_ATTR_CIPHER_STRENGTHS 87 -#define SECPKG_ATTR_SUPPORTED_PROTOCOLS 88 +#define SECPKG_ATTR_SUPPORTED_ALGS 86 +#define SECPKG_ATTR_CIPHER_STRENGTHS 87 +#define SECPKG_ATTR_SUPPORTED_PROTOCOLS 88 typedef struct _SecPkgCred_SupportedAlgs { @@ -78,11 +78,11 @@ enum eTlsHashAlgorithm TlsHashAlgorithm_Sha512 = 6 }; -#define SCH_CRED_V1 0x00000001 -#define SCH_CRED_V2 0x00000002 -#define SCH_CRED_VERSION 0x00000002 -#define SCH_CRED_V3 0x00000003 -#define SCHANNEL_CRED_VERSION 0x00000004 +#define SCH_CRED_V1 0x00000001 +#define SCH_CRED_V2 0x00000002 +#define SCH_CRED_VERSION 0x00000002 +#define SCH_CRED_V3 0x00000003 +#define SCHANNEL_CRED_VERSION 0x00000004 struct _HMAPPER; @@ -94,7 +94,7 @@ typedef struct _SCHANNEL_CRED HCERTSTORE hRootStore; DWORD cMappers; - struct _HMAPPER **aphMappers; + struct _HMAPPER** aphMappers; DWORD cSupportedAlgs; ALG_ID* palgSupportedAlgs; @@ -107,13 +107,13 @@ typedef struct _SCHANNEL_CRED DWORD dwCredFormat; } SCHANNEL_CRED, *PSCHANNEL_CRED; -#define SCH_CRED_FORMAT_CERT_CONTEXT 0x00000000 -#define SCH_CRED_FORMAT_CERT_HASH 0x00000001 -#define SCH_CRED_FORMAT_CERT_HASH_STORE 0x00000002 +#define SCH_CRED_FORMAT_CERT_CONTEXT 0x00000000 +#define SCH_CRED_FORMAT_CERT_HASH 0x00000001 +#define SCH_CRED_FORMAT_CERT_HASH_STORE 0x00000002 -#define SCH_CRED_MAX_STORE_NAME_SIZE 128 -#define SCH_CRED_MAX_SUPPORTED_ALGS 256 -#define SCH_CRED_MAX_SUPPORTED_CERTS 100 +#define SCH_CRED_MAX_STORE_NAME_SIZE 128 +#define SCH_CRED_MAX_SUPPORTED_ALGS 256 +#define SCH_CRED_MAX_SUPPORTED_CERTS 100 typedef struct _SCHANNEL_CERT_HASH { @@ -125,46 +125,46 @@ typedef struct _SCHANNEL_CERT_HASH typedef struct _SCHANNEL_CERT_HASH_STORE { - DWORD dwLength; - DWORD dwFlags; - HCRYPTPROV hProv; - BYTE ShaHash[20]; - WCHAR pwszStoreName[SCH_CRED_MAX_STORE_NAME_SIZE]; + DWORD dwLength; + DWORD dwFlags; + HCRYPTPROV hProv; + BYTE ShaHash[20]; + WCHAR pwszStoreName[SCH_CRED_MAX_STORE_NAME_SIZE]; } SCHANNEL_CERT_HASH_STORE, *PSCHANNEL_CERT_HASH_STORE; -#define SCH_MACHINE_CERT_HASH 0x00000001 +#define SCH_MACHINE_CERT_HASH 0x00000001 -#define SCH_CRED_NO_SYSTEM_MAPPER 0x00000002 -#define SCH_CRED_NO_SERVERNAME_CHECK 0x00000004 -#define SCH_CRED_MANUAL_CRED_VALIDATION 0x00000008 -#define SCH_CRED_NO_DEFAULT_CREDS 0x00000010 -#define SCH_CRED_AUTO_CRED_VALIDATION 0x00000020 -#define SCH_CRED_USE_DEFAULT_CREDS 0x00000040 -#define SCH_CRED_DISABLE_RECONNECTS 0x00000080 +#define SCH_CRED_NO_SYSTEM_MAPPER 0x00000002 +#define SCH_CRED_NO_SERVERNAME_CHECK 0x00000004 +#define SCH_CRED_MANUAL_CRED_VALIDATION 0x00000008 +#define SCH_CRED_NO_DEFAULT_CREDS 0x00000010 +#define SCH_CRED_AUTO_CRED_VALIDATION 0x00000020 +#define SCH_CRED_USE_DEFAULT_CREDS 0x00000040 +#define SCH_CRED_DISABLE_RECONNECTS 0x00000080 -#define SCH_CRED_REVOCATION_CHECK_END_CERT 0x00000100 -#define SCH_CRED_REVOCATION_CHECK_CHAIN 0x00000200 -#define SCH_CRED_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT 0x00000400 -#define SCH_CRED_IGNORE_NO_REVOCATION_CHECK 0x00000800 -#define SCH_CRED_IGNORE_REVOCATION_OFFLINE 0x00001000 +#define SCH_CRED_REVOCATION_CHECK_END_CERT 0x00000100 +#define SCH_CRED_REVOCATION_CHECK_CHAIN 0x00000200 +#define SCH_CRED_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT 0x00000400 +#define SCH_CRED_IGNORE_NO_REVOCATION_CHECK 0x00000800 +#define SCH_CRED_IGNORE_REVOCATION_OFFLINE 0x00001000 -#define SCH_CRED_RESTRICTED_ROOTS 0x00002000 -#define SCH_CRED_REVOCATION_CHECK_CACHE_ONLY 0x00004000 -#define SCH_CRED_CACHE_ONLY_URL_RETRIEVAL 0x00008000 +#define SCH_CRED_RESTRICTED_ROOTS 0x00002000 +#define SCH_CRED_REVOCATION_CHECK_CACHE_ONLY 0x00004000 +#define SCH_CRED_CACHE_ONLY_URL_RETRIEVAL 0x00008000 -#define SCH_CRED_MEMORY_STORE_CERT 0x00010000 +#define SCH_CRED_MEMORY_STORE_CERT 0x00010000 -#define SCH_CRED_CACHE_ONLY_URL_RETRIEVAL_ON_CREATE 0x00020000 +#define SCH_CRED_CACHE_ONLY_URL_RETRIEVAL_ON_CREATE 0x00020000 -#define SCH_SEND_ROOT_CERT 0x00040000 -#define SCH_CRED_SNI_CREDENTIAL 0x00080000 -#define SCH_CRED_SNI_ENABLE_OCSP 0x00100000 -#define SCH_SEND_AUX_RECORD 0x00200000 +#define SCH_SEND_ROOT_CERT 0x00040000 +#define SCH_CRED_SNI_CREDENTIAL 0x00080000 +#define SCH_CRED_SNI_ENABLE_OCSP 0x00100000 +#define SCH_SEND_AUX_RECORD 0x00200000 -#define SCHANNEL_RENEGOTIATE 0 -#define SCHANNEL_SHUTDOWN 1 -#define SCHANNEL_ALERT 2 -#define SCHANNEL_SESSION 3 +#define SCHANNEL_RENEGOTIATE 0 +#define SCHANNEL_SHUTDOWN 1 +#define SCHANNEL_ALERT 2 +#define SCHANNEL_SESSION 3 typedef struct _SCHANNEL_ALERT_TOKEN { @@ -173,36 +173,36 @@ typedef struct _SCHANNEL_ALERT_TOKEN DWORD dwAlertNumber; } SCHANNEL_ALERT_TOKEN; -#define TLS1_ALERT_WARNING 1 -#define TLS1_ALERT_FATAL 2 +#define TLS1_ALERT_WARNING 1 +#define TLS1_ALERT_FATAL 2 -#define TLS1_ALERT_CLOSE_NOTIFY 0 -#define TLS1_ALERT_UNEXPECTED_MESSAGE 10 -#define TLS1_ALERT_BAD_RECORD_MAC 20 -#define TLS1_ALERT_DECRYPTION_FAILED 21 -#define TLS1_ALERT_RECORD_OVERFLOW 22 -#define TLS1_ALERT_DECOMPRESSION_FAIL 30 -#define TLS1_ALERT_HANDSHAKE_FAILURE 40 -#define TLS1_ALERT_BAD_CERTIFICATE 42 -#define TLS1_ALERT_UNSUPPORTED_CERT 43 -#define TLS1_ALERT_CERTIFICATE_REVOKED 44 -#define TLS1_ALERT_CERTIFICATE_EXPIRED 45 -#define TLS1_ALERT_CERTIFICATE_UNKNOWN 46 -#define TLS1_ALERT_ILLEGAL_PARAMETER 47 -#define TLS1_ALERT_UNKNOWN_CA 48 -#define TLS1_ALERT_ACCESS_DENIED 49 -#define TLS1_ALERT_DECODE_ERROR 50 -#define TLS1_ALERT_DECRYPT_ERROR 51 -#define TLS1_ALERT_EXPORT_RESTRICTION 60 -#define TLS1_ALERT_PROTOCOL_VERSION 70 -#define TLS1_ALERT_INSUFFIENT_SECURITY 71 -#define TLS1_ALERT_INTERNAL_ERROR 80 -#define TLS1_ALERT_USER_CANCELED 90 -#define TLS1_ALERT_NO_RENEGOTIATION 100 -#define TLS1_ALERT_UNSUPPORTED_EXT 110 +#define TLS1_ALERT_CLOSE_NOTIFY 0 +#define TLS1_ALERT_UNEXPECTED_MESSAGE 10 +#define TLS1_ALERT_BAD_RECORD_MAC 20 +#define TLS1_ALERT_DECRYPTION_FAILED 21 +#define TLS1_ALERT_RECORD_OVERFLOW 22 +#define TLS1_ALERT_DECOMPRESSION_FAIL 30 +#define TLS1_ALERT_HANDSHAKE_FAILURE 40 +#define TLS1_ALERT_BAD_CERTIFICATE 42 +#define TLS1_ALERT_UNSUPPORTED_CERT 43 +#define TLS1_ALERT_CERTIFICATE_REVOKED 44 +#define TLS1_ALERT_CERTIFICATE_EXPIRED 45 +#define TLS1_ALERT_CERTIFICATE_UNKNOWN 46 +#define TLS1_ALERT_ILLEGAL_PARAMETER 47 +#define TLS1_ALERT_UNKNOWN_CA 48 +#define TLS1_ALERT_ACCESS_DENIED 49 +#define TLS1_ALERT_DECODE_ERROR 50 +#define TLS1_ALERT_DECRYPT_ERROR 51 +#define TLS1_ALERT_EXPORT_RESTRICTION 60 +#define TLS1_ALERT_PROTOCOL_VERSION 70 +#define TLS1_ALERT_INSUFFIENT_SECURITY 71 +#define TLS1_ALERT_INTERNAL_ERROR 80 +#define TLS1_ALERT_USER_CANCELED 90 +#define TLS1_ALERT_NO_RENEGOTIATION 100 +#define TLS1_ALERT_UNSUPPORTED_EXT 110 -#define SSL_SESSION_ENABLE_RECONNECTS 1 -#define SSL_SESSION_DISABLE_RECONNECTS 2 +#define SSL_SESSION_ENABLE_RECONNECTS 1 +#define SSL_SESSION_DISABLE_RECONNECTS 2 typedef struct _SCHANNEL_SESSION_TOKEN { @@ -219,68 +219,70 @@ typedef struct _SCHANNEL_CLIENT_SIGNATURE BYTE CertThumbprint[20]; } SCHANNEL_CLIENT_SIGNATURE, *PSCHANNEL_CLIENT_SIGNATURE; -#define SP_PROT_SSL3_SERVER 0x00000010 -#define SP_PROT_SSL3_CLIENT 0x00000020 -#define SP_PROT_SSL3 (SP_PROT_SSL3_SERVER | SP_PROT_SSL3_CLIENT) +#define SP_PROT_SSL3_SERVER 0x00000010 +#define SP_PROT_SSL3_CLIENT 0x00000020 +#define SP_PROT_SSL3 (SP_PROT_SSL3_SERVER | SP_PROT_SSL3_CLIENT) -#define SP_PROT_TLS1_SERVER 0x00000040 -#define SP_PROT_TLS1_CLIENT 0x00000080 -#define SP_PROT_TLS1 (SP_PROT_TLS1_SERVER | SP_PROT_TLS1_CLIENT) +#define SP_PROT_TLS1_SERVER 0x00000040 +#define SP_PROT_TLS1_CLIENT 0x00000080 +#define SP_PROT_TLS1 (SP_PROT_TLS1_SERVER | SP_PROT_TLS1_CLIENT) -#define SP_PROT_SSL3TLS1_CLIENTS (SP_PROT_TLS1_CLIENT | SP_PROT_SSL3_CLIENT) -#define SP_PROT_SSL3TLS1_SERVERS (SP_PROT_TLS1_SERVER | SP_PROT_SSL3_SERVER) -#define SP_PROT_SSL3TLS1 (SP_PROT_SSL3 | SP_PROT_TLS1) +#define SP_PROT_SSL3TLS1_CLIENTS (SP_PROT_TLS1_CLIENT | SP_PROT_SSL3_CLIENT) +#define SP_PROT_SSL3TLS1_SERVERS (SP_PROT_TLS1_SERVER | SP_PROT_SSL3_SERVER) +#define SP_PROT_SSL3TLS1 (SP_PROT_SSL3 | SP_PROT_TLS1) -#define SP_PROT_UNI_SERVER 0x40000000 -#define SP_PROT_UNI_CLIENT 0x80000000 -#define SP_PROT_UNI (SP_PROT_UNI_SERVER | SP_PROT_UNI_CLIENT) +#define SP_PROT_UNI_SERVER 0x40000000 +#define SP_PROT_UNI_CLIENT 0x80000000 +#define SP_PROT_UNI (SP_PROT_UNI_SERVER | SP_PROT_UNI_CLIENT) -#define SP_PROT_ALL 0xFFFFFFFF -#define SP_PROT_NONE 0 -#define SP_PROT_CLIENTS (SP_PROT_SSL3_CLIENT | SP_PROT_UNI_CLIENT | SP_PROT_TLS1_CLIENT) -#define SP_PROT_SERVERS (SP_PROT_SSL3_SERVER | SP_PROT_UNI_SERVER | SP_PROT_TLS1_SERVER) +#define SP_PROT_ALL 0xFFFFFFFF +#define SP_PROT_NONE 0 +#define SP_PROT_CLIENTS (SP_PROT_SSL3_CLIENT | SP_PROT_UNI_CLIENT | SP_PROT_TLS1_CLIENT) +#define SP_PROT_SERVERS (SP_PROT_SSL3_SERVER | SP_PROT_UNI_SERVER | SP_PROT_TLS1_SERVER) -#define SP_PROT_TLS1_0_SERVER SP_PROT_TLS1_SERVER -#define SP_PROT_TLS1_0_CLIENT SP_PROT_TLS1_CLIENT -#define SP_PROT_TLS1_0 (SP_PROT_TLS1_0_SERVER | SP_PROT_TLS1_0_CLIENT) +#define SP_PROT_TLS1_0_SERVER SP_PROT_TLS1_SERVER +#define SP_PROT_TLS1_0_CLIENT SP_PROT_TLS1_CLIENT +#define SP_PROT_TLS1_0 (SP_PROT_TLS1_0_SERVER | SP_PROT_TLS1_0_CLIENT) -#define SP_PROT_TLS1_1_SERVER 0x00000100 -#define SP_PROT_TLS1_1_CLIENT 0x00000200 -#define SP_PROT_TLS1_1 (SP_PROT_TLS1_1_SERVER | SP_PROT_TLS1_1_CLIENT) +#define SP_PROT_TLS1_1_SERVER 0x00000100 +#define SP_PROT_TLS1_1_CLIENT 0x00000200 +#define SP_PROT_TLS1_1 (SP_PROT_TLS1_1_SERVER | SP_PROT_TLS1_1_CLIENT) -#define SP_PROT_TLS1_2_SERVER 0x00000400 -#define SP_PROT_TLS1_2_CLIENT 0x00000800 -#define SP_PROT_TLS1_2 (SP_PROT_TLS1_2_SERVER | SP_PROT_TLS1_2_CLIENT) +#define SP_PROT_TLS1_2_SERVER 0x00000400 +#define SP_PROT_TLS1_2_CLIENT 0x00000800 +#define SP_PROT_TLS1_2 (SP_PROT_TLS1_2_SERVER | SP_PROT_TLS1_2_CLIENT) -#define SP_PROT_DTLS_SERVER 0x00010000 -#define SP_PROT_DTLS_CLIENT 0x00020000 -#define SP_PROT_DTLS (SP_PROT_DTLS_SERVER | SP_PROT_DTLS_CLIENT) +#define SP_PROT_DTLS_SERVER 0x00010000 +#define SP_PROT_DTLS_CLIENT 0x00020000 +#define SP_PROT_DTLS (SP_PROT_DTLS_SERVER | SP_PROT_DTLS_CLIENT) -#define SP_PROT_DTLS1_0_SERVER SP_PROT_DTLS_SERVER -#define SP_PROT_DTLS1_0_CLIENT SP_PROT_DTLS_CLIENT -#define SP_PROT_DTLS1_0 (SP_PROT_DTLS1_0_SERVER | SP_PROT_DTLS1_0_CLIENT) +#define SP_PROT_DTLS1_0_SERVER SP_PROT_DTLS_SERVER +#define SP_PROT_DTLS1_0_CLIENT SP_PROT_DTLS_CLIENT +#define SP_PROT_DTLS1_0 (SP_PROT_DTLS1_0_SERVER | SP_PROT_DTLS1_0_CLIENT) -#define SP_PROT_DTLS1_X_SERVER SP_PROT_DTLS1_0_SERVER +#define SP_PROT_DTLS1_X_SERVER SP_PROT_DTLS1_0_SERVER -#define SP_PROT_DTLS1_X_CLIENT SP_PROT_DTLS1_0_CLIENT +#define SP_PROT_DTLS1_X_CLIENT SP_PROT_DTLS1_0_CLIENT -#define SP_PROT_DTLS1_X (SP_PROT_DTLS1_X_SERVER | SP_PROT_DTLS1_X_CLIENT) +#define SP_PROT_DTLS1_X (SP_PROT_DTLS1_X_SERVER | SP_PROT_DTLS1_X_CLIENT) -#define SP_PROT_TLS1_1PLUS_SERVER (SP_PROT_TLS1_1_SERVER | SP_PROT_TLS1_2_SERVER) -#define SP_PROT_TLS1_1PLUS_CLIENT (SP_PROT_TLS1_1_CLIENT | SP_PROT_TLS1_2_CLIENT) +#define SP_PROT_TLS1_1PLUS_SERVER (SP_PROT_TLS1_1_SERVER | SP_PROT_TLS1_2_SERVER) +#define SP_PROT_TLS1_1PLUS_CLIENT (SP_PROT_TLS1_1_CLIENT | SP_PROT_TLS1_2_CLIENT) -#define SP_PROT_TLS1_1PLUS (SP_PROT_TLS1_1PLUS_SERVER | SP_PROT_TLS1_1PLUS_CLIENT) +#define SP_PROT_TLS1_1PLUS (SP_PROT_TLS1_1PLUS_SERVER | SP_PROT_TLS1_1PLUS_CLIENT) -#define SP_PROT_TLS1_X_SERVER (SP_PROT_TLS1_0_SERVER | SP_PROT_TLS1_1_SERVER | SP_PROT_TLS1_2_SERVER) -#define SP_PROT_TLS1_X_CLIENT (SP_PROT_TLS1_0_CLIENT | SP_PROT_TLS1_1_CLIENT | SP_PROT_TLS1_2_CLIENT) -#define SP_PROT_TLS1_X (SP_PROT_TLS1_X_SERVER | SP_PROT_TLS1_X_CLIENT) +#define SP_PROT_TLS1_X_SERVER \ + (SP_PROT_TLS1_0_SERVER | SP_PROT_TLS1_1_SERVER | SP_PROT_TLS1_2_SERVER) +#define SP_PROT_TLS1_X_CLIENT \ + (SP_PROT_TLS1_0_CLIENT | SP_PROT_TLS1_1_CLIENT | SP_PROT_TLS1_2_CLIENT) +#define SP_PROT_TLS1_X (SP_PROT_TLS1_X_SERVER | SP_PROT_TLS1_X_CLIENT) -#define SP_PROT_SSL3TLS1_X_CLIENTS (SP_PROT_TLS1_X_CLIENT | SP_PROT_SSL3_CLIENT) -#define SP_PROT_SSL3TLS1_X_SERVERS (SP_PROT_TLS1_X_SERVER | SP_PROT_SSL3_SERVER) -#define SP_PROT_SSL3TLS1_X (SP_PROT_SSL3 | SP_PROT_TLS1_X) +#define SP_PROT_SSL3TLS1_X_CLIENTS (SP_PROT_TLS1_X_CLIENT | SP_PROT_SSL3_CLIENT) +#define SP_PROT_SSL3TLS1_X_SERVERS (SP_PROT_TLS1_X_SERVER | SP_PROT_SSL3_SERVER) +#define SP_PROT_SSL3TLS1_X (SP_PROT_SSL3 | SP_PROT_TLS1_X) -#define SP_PROT_X_CLIENTS (SP_PROT_CLIENTS | SP_PROT_TLS1_X_CLIENT | SP_PROT_DTLS1_X_CLIENT) -#define SP_PROT_X_SERVERS (SP_PROT_SERVERS | SP_PROT_TLS1_X_SERVER | SP_PROT_DTLS1_X_SERVER ) +#define SP_PROT_X_CLIENTS (SP_PROT_CLIENTS | SP_PROT_TLS1_X_CLIENT | SP_PROT_DTLS1_X_CLIENT) +#define SP_PROT_X_SERVERS (SP_PROT_SERVERS | SP_PROT_TLS1_X_SERVER | SP_PROT_DTLS1_X_SERVER) #endif diff --git a/winpr/include/winpr/security.h b/winpr/include/winpr/security.h index d50a61af0..9dd5748ad 100644 --- a/winpr/include/winpr/security.h +++ b/winpr/include/winpr/security.h @@ -32,7 +32,7 @@ #include -#define ANYSIZE_ARRAY 1 +#define ANYSIZE_ARRAY 1 typedef enum _SECURITY_IMPERSONATION_LEVEL { @@ -40,76 +40,97 @@ typedef enum _SECURITY_IMPERSONATION_LEVEL SecurityIdentification, SecurityImpersonation, SecurityDelegation -} SECURITY_IMPERSONATION_LEVEL, *PSECURITY_IMPERSONATION_LEVEL; +} SECURITY_IMPERSONATION_LEVEL, + *PSECURITY_IMPERSONATION_LEVEL; -#define SECURITY_MAX_IMPERSONATION_LEVEL SecurityDelegation -#define SECURITY_MIN_IMPERSONATION_LEVEL SecurityAnonymous -#define DEFAULT_IMPERSONATION_LEVEL SecurityImpersonation -#define VALID_IMPERSONATION_LEVEL(L) (((L) >= SECURITY_MIN_IMPERSONATION_LEVEL) && ((L) <= SECURITY_MAX_IMPERSONATION_LEVEL)) +#define SECURITY_MAX_IMPERSONATION_LEVEL SecurityDelegation +#define SECURITY_MIN_IMPERSONATION_LEVEL SecurityAnonymous +#define DEFAULT_IMPERSONATION_LEVEL SecurityImpersonation +#define VALID_IMPERSONATION_LEVEL(L) \ + (((L) >= SECURITY_MIN_IMPERSONATION_LEVEL) && ((L) <= SECURITY_MAX_IMPERSONATION_LEVEL)) -#define TOKEN_ASSIGN_PRIMARY (0x0001) -#define TOKEN_DUPLICATE (0x0002) -#define TOKEN_IMPERSONATE (0x0004) -#define TOKEN_QUERY (0x0008) -#define TOKEN_QUERY_SOURCE (0x0010) -#define TOKEN_ADJUST_PRIVILEGES (0x0020) -#define TOKEN_ADJUST_GROUPS (0x0040) -#define TOKEN_ADJUST_DEFAULT (0x0080) -#define TOKEN_ADJUST_SESSIONID (0x0100) +#define TOKEN_ASSIGN_PRIMARY (0x0001) +#define TOKEN_DUPLICATE (0x0002) +#define TOKEN_IMPERSONATE (0x0004) +#define TOKEN_QUERY (0x0008) +#define TOKEN_QUERY_SOURCE (0x0010) +#define TOKEN_ADJUST_PRIVILEGES (0x0020) +#define TOKEN_ADJUST_GROUPS (0x0040) +#define TOKEN_ADJUST_DEFAULT (0x0080) +#define TOKEN_ADJUST_SESSIONID (0x0100) -#define TOKEN_ALL_ACCESS_P (STANDARD_RIGHTS_REQUIRED | TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE | \ - TOKEN_IMPERSONATE | TOKEN_QUERY | TOKEN_QUERY_SOURCE | \ - TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT) +#define TOKEN_ALL_ACCESS_P \ + (STANDARD_RIGHTS_REQUIRED | TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE | TOKEN_IMPERSONATE | \ + TOKEN_QUERY | TOKEN_QUERY_SOURCE | TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | \ + TOKEN_ADJUST_DEFAULT) -#define TOKEN_ALL_ACCESS (TOKEN_ALL_ACCESS_P | TOKEN_ADJUST_SESSIONID) +#define TOKEN_ALL_ACCESS (TOKEN_ALL_ACCESS_P | TOKEN_ADJUST_SESSIONID) -#define TOKEN_READ (STANDARD_RIGHTS_READ | TOKEN_QUERY) +#define TOKEN_READ (STANDARD_RIGHTS_READ | TOKEN_QUERY) -#define TOKEN_WRITE (STANDARD_RIGHTS_WRITE | \ - TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT) +#define TOKEN_WRITE \ + (STANDARD_RIGHTS_WRITE | TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT) -#define TOKEN_EXECUTE (STANDARD_RIGHTS_EXECUTE) +#define TOKEN_EXECUTE (STANDARD_RIGHTS_EXECUTE) -#define TOKEN_MANDATORY_POLICY_OFF 0x0 -#define TOKEN_MANDATORY_POLICY_NO_WRITE_UP 0x1 -#define TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN 0x2 +#define TOKEN_MANDATORY_POLICY_OFF 0x0 +#define TOKEN_MANDATORY_POLICY_NO_WRITE_UP 0x1 +#define TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN 0x2 -#define TOKEN_MANDATORY_POLICY_VALID_MASK (TOKEN_MANDATORY_POLICY_NO_WRITE_UP | \ - TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN) +#define TOKEN_MANDATORY_POLICY_VALID_MASK \ + (TOKEN_MANDATORY_POLICY_NO_WRITE_UP | TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN) -#define POLICY_AUDIT_SUBCATEGORY_COUNT (56) +#define POLICY_AUDIT_SUBCATEGORY_COUNT (56) -#define TOKEN_SOURCE_LENGTH 8 +#define TOKEN_SOURCE_LENGTH 8 -#define SID_REVISION (1) -#define SID_MAX_SUB_AUTHORITIES (15) -#define SID_RECOMMENDED_SUB_AUTHORITIES (1) +#define SID_REVISION (1) +#define SID_MAX_SUB_AUTHORITIES (15) +#define SID_RECOMMENDED_SUB_AUTHORITIES (1) -#define SID_HASH_SIZE 32 +#define SID_HASH_SIZE 32 -#define SECURITY_MANDATORY_UNTRUSTED_RID 0x0000 -#define SECURITY_MANDATORY_LOW_RID 0x1000 -#define SECURITY_MANDATORY_MEDIUM_RID 0x2000 -#define SECURITY_MANDATORY_HIGH_RID 0x3000 -#define SECURITY_MANDATORY_SYSTEM_RID 0x4000 +#define SECURITY_MANDATORY_UNTRUSTED_RID 0x0000 +#define SECURITY_MANDATORY_LOW_RID 0x1000 +#define SECURITY_MANDATORY_MEDIUM_RID 0x2000 +#define SECURITY_MANDATORY_HIGH_RID 0x3000 +#define SECURITY_MANDATORY_SYSTEM_RID 0x4000 -#define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0} -#define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1} -#define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2} -#define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3} -#define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4} -#define SECURITY_RESOURCE_MANAGER_AUTHORITY {0,0,0,0,0,9} +#define SECURITY_NULL_SID_AUTHORITY \ + { \ + 0, 0, 0, 0, 0, 0 \ + } +#define SECURITY_WORLD_SID_AUTHORITY \ + { \ + 0, 0, 0, 0, 0, 1 \ + } +#define SECURITY_LOCAL_SID_AUTHORITY \ + { \ + 0, 0, 0, 0, 0, 2 \ + } +#define SECURITY_CREATOR_SID_AUTHORITY \ + { \ + 0, 0, 0, 0, 0, 3 \ + } +#define SECURITY_NON_UNIQUE_AUTHORITY \ + { \ + 0, 0, 0, 0, 0, 4 \ + } +#define SECURITY_RESOURCE_MANAGER_AUTHORITY \ + { \ + 0, 0, 0, 0, 0, 9 \ + } -#define SECURITY_NULL_RID (0x00000000L) -#define SECURITY_WORLD_RID (0x00000000L) -#define SECURITY_LOCAL_RID (0x00000000L) -#define SECURITY_LOCAL_LOGON_RID (0x00000001L) +#define SECURITY_NULL_RID (0x00000000L) +#define SECURITY_WORLD_RID (0x00000000L) +#define SECURITY_LOCAL_RID (0x00000000L) +#define SECURITY_LOCAL_LOGON_RID (0x00000001L) -#define SECURITY_CREATOR_OWNER_RID (0x00000000L) -#define SECURITY_CREATOR_GROUP_RID (0x00000001L) -#define SECURITY_CREATOR_OWNER_SERVER_RID (0x00000002L) -#define SECURITY_CREATOR_GROUP_SERVER_RID (0x00000003L) -#define SECURITY_CREATOR_OWNER_RIGHTS_RID (0x00000004L) +#define SECURITY_CREATOR_OWNER_RID (0x00000000L) +#define SECURITY_CREATOR_GROUP_RID (0x00000001L) +#define SECURITY_CREATOR_OWNER_SERVER_RID (0x00000002L) +#define SECURITY_CREATOR_GROUP_SERVER_RID (0x00000003L) +#define SECURITY_CREATOR_OWNER_RIGHTS_RID (0x00000004L) typedef PVOID PACCESS_TOKEN; typedef PVOID PCLAIMS_BLOB; @@ -124,13 +145,13 @@ typedef LUID_AND_ATTRIBUTES_ARRAY* PLUID_AND_ATTRIBUTES_ARRAY; typedef struct _SID_IDENTIFIER_AUTHORITY { - BYTE Value[6]; + BYTE Value[6]; } SID_IDENTIFIER_AUTHORITY, *PSID_IDENTIFIER_AUTHORITY; typedef struct _SID { - BYTE Revision; - BYTE SubAuthorityCount; + BYTE Revision; + BYTE SubAuthorityCount; SID_IDENTIFIER_AUTHORITY IdentifierAuthority; DWORD SubAuthority[ANYSIZE_ARRAY]; } SID, *PISID; @@ -147,13 +168,14 @@ typedef enum _SID_NAME_USE SidTypeUnknown, SidTypeComputer, SidTypeLabel -} SID_NAME_USE, *PSID_NAME_USE; +} SID_NAME_USE, + *PSID_NAME_USE; typedef struct _SID_AND_ATTRIBUTES { PSID Sid; DWORD Attributes; -} SID_AND_ATTRIBUTES, * PSID_AND_ATTRIBUTES; +} SID_AND_ATTRIBUTES, *PSID_AND_ATTRIBUTES; typedef SID_AND_ATTRIBUTES SID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY]; typedef SID_AND_ATTRIBUTES_ARRAY* PSID_AND_ATTRIBUTES_ARRAY; @@ -179,7 +201,8 @@ typedef enum _TOKEN_ELEVATION_TYPE TokenElevationTypeDefault = 1, TokenElevationTypeFull, TokenElevationTypeLimited -} TOKEN_ELEVATION_TYPE, *PTOKEN_ELEVATION_TYPE; +} TOKEN_ELEVATION_TYPE, + *PTOKEN_ELEVATION_TYPE; typedef enum _TOKEN_INFORMATION_CLASS { @@ -224,7 +247,8 @@ typedef enum _TOKEN_INFORMATION_CLASS TokenSecurityAttributes, TokenIsRestricted, MaxTokenInfoClass -} TOKEN_INFORMATION_CLASS, *PTOKEN_INFORMATION_CLASS; +} TOKEN_INFORMATION_CLASS, + *PTOKEN_INFORMATION_CLASS; typedef struct _TOKEN_USER { @@ -364,7 +388,8 @@ typedef enum _MANDATORY_LEVEL MandatoryLevelSystem, MandatoryLevelSecureProcess, MandatoryLevelCount -} MANDATORY_LEVEL, *PMANDATORY_LEVEL; +} MANDATORY_LEVEL, + *PMANDATORY_LEVEL; typedef struct _TOKEN_APPCONTAINER_INFORMATION { @@ -372,50 +397,48 @@ typedef struct _TOKEN_APPCONTAINER_INFORMATION } TOKEN_APPCONTAINER_INFORMATION, *PTOKEN_APPCONTAINER_INFORMATION; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API BOOL InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR - pSecurityDescriptor, DWORD dwRevision); -WINPR_API DWORD GetSecurityDescriptorLength(PSECURITY_DESCRIPTOR - pSecurityDescriptor); -WINPR_API BOOL IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR - pSecurityDescriptor); + WINPR_API BOOL InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor, + DWORD dwRevision); + WINPR_API DWORD GetSecurityDescriptorLength(PSECURITY_DESCRIPTOR pSecurityDescriptor); + WINPR_API BOOL IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor); -WINPR_API BOOL GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR - pSecurityDescriptor, - PSECURITY_DESCRIPTOR_CONTROL pControl, LPDWORD lpdwRevision); -WINPR_API BOOL SetSecurityDescriptorControl(PSECURITY_DESCRIPTOR - pSecurityDescriptor, - SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest, - SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet); + WINPR_API BOOL GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR pSecurityDescriptor, + PSECURITY_DESCRIPTOR_CONTROL pControl, + LPDWORD lpdwRevision); + WINPR_API BOOL SetSecurityDescriptorControl(PSECURITY_DESCRIPTOR pSecurityDescriptor, + SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest, + SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet); -WINPR_API BOOL GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR - pSecurityDescriptor, LPBOOL lpbDaclPresent, PACL* pDacl, - LPBOOL lpbDaclDefaulted); -WINPR_API BOOL SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR - pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted); + WINPR_API BOOL GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, + LPBOOL lpbDaclPresent, PACL* pDacl, + LPBOOL lpbDaclDefaulted); + WINPR_API BOOL SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, + BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted); -WINPR_API BOOL GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR - pSecurityDescriptor, PSID* pGroup, LPBOOL lpbGroupDefaulted); -WINPR_API BOOL SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR - pSecurityDescriptor, PSID pGroup, BOOL bGroupDefaulted); + WINPR_API BOOL GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, + PSID* pGroup, LPBOOL lpbGroupDefaulted); + WINPR_API BOOL SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pGroup, + BOOL bGroupDefaulted); -WINPR_API BOOL GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR - pSecurityDescriptor, PSID* pOwner, LPBOOL lpbOwnerDefaulted); -WINPR_API BOOL SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR - pSecurityDescriptor, PSID pOwner, BOOL bOwnerDefaulted); + WINPR_API BOOL GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, + PSID* pOwner, LPBOOL lpbOwnerDefaulted); + WINPR_API BOOL SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pOwner, + BOOL bOwnerDefaulted); -WINPR_API DWORD GetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR - SecurityDescriptor, PUCHAR RMControl); -WINPR_API DWORD SetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR - SecurityDescriptor, PUCHAR RMControl); + WINPR_API DWORD GetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor, + PUCHAR RMControl); + WINPR_API DWORD SetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor, + PUCHAR RMControl); -WINPR_API BOOL GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR - pSecurityDescriptor, LPBOOL lpbSaclPresent, PACL* pSacl, - LPBOOL lpbSaclDefaulted); -WINPR_API BOOL SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR - pSecurityDescriptor, BOOL bSaclPresent, PACL pSacl, BOOL bSaclDefaulted); + WINPR_API BOOL GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, + LPBOOL lpbSaclPresent, PACL* pSacl, + LPBOOL lpbSaclDefaulted); + WINPR_API BOOL SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, + BOOL bSaclPresent, PACL pSacl, BOOL bSaclDefaulted); #ifdef __cplusplus } @@ -424,4 +447,3 @@ WINPR_API BOOL SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR #endif #endif /* WINPR_SECURITY_H */ - diff --git a/winpr/include/winpr/shell.h b/winpr/include/winpr/shell.h index bb3b28ea1..a4f794529 100644 --- a/winpr/include/winpr/shell.h +++ b/winpr/include/winpr/shell.h @@ -36,42 +36,44 @@ /* Shell clipboard formats */ -struct _FILEDESCRIPTOR { - DWORD dwFlags; - BYTE clsid[16]; - BYTE sizel[8]; - BYTE pointl[8]; - DWORD dwFileAttributes; +struct _FILEDESCRIPTOR +{ + DWORD dwFlags; + BYTE clsid[16]; + BYTE sizel[8]; + BYTE pointl[8]; + DWORD dwFileAttributes; FILETIME ftCreationTime; FILETIME ftLastAccessTime; FILETIME ftLastWriteTime; - DWORD nFileSizeHigh; - DWORD nFileSizeLow; - WCHAR cFileName[260]; + DWORD nFileSizeHigh; + DWORD nFileSizeLow; + WCHAR cFileName[260]; }; typedef struct _FILEDESCRIPTOR FILEDESCRIPTOR; /* FILEDESCRIPTOR.dwFlags */ -#define FD_ATTRIBUTES 0x00000004 -#define FD_FILESIZE 0x00000040 -#define FD_WRITESTIME 0x00000020 -#define FD_SHOWPROGRESSUI 0x00004000 +#define FD_ATTRIBUTES 0x00000004 +#define FD_FILESIZE 0x00000040 +#define FD_WRITESTIME 0x00000020 +#define FD_SHOWPROGRESSUI 0x00004000 /* FILEDESCRIPTOR.dwFileAttributes */ -#define FILE_ATTRIBUTE_READONLY 0x00000001 -#define FILE_ATTRIBUTE_HIDDEN 0x00000002 -#define FILE_ATTRIBUTE_SYSTEM 0x00000004 -#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 -#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 -#define FILE_ATTRIBUTE_NORMAL 0x00000080 +#define FILE_ATTRIBUTE_READONLY 0x00000001 +#define FILE_ATTRIBUTE_HIDDEN 0x00000002 +#define FILE_ATTRIBUTE_SYSTEM 0x00000004 +#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 +#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 +#define FILE_ATTRIBUTE_NORMAL 0x00000080 #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API BOOL GetUserProfileDirectoryA(HANDLE hToken, LPSTR lpProfileDir, LPDWORD lpcchSize); + WINPR_API BOOL GetUserProfileDirectoryA(HANDLE hToken, LPSTR lpProfileDir, LPDWORD lpcchSize); -WINPR_API BOOL GetUserProfileDirectoryW(HANDLE hToken, LPWSTR lpProfileDir, LPDWORD lpcchSize); + WINPR_API BOOL GetUserProfileDirectoryW(HANDLE hToken, LPWSTR lpProfileDir, LPDWORD lpcchSize); #ifdef __cplusplus } diff --git a/winpr/include/winpr/smartcard.h b/winpr/include/winpr/smartcard.h index a372ae3ad..fb4aabea1 100644 --- a/winpr/include/winpr/smartcard.h +++ b/winpr/include/winpr/smartcard.h @@ -27,207 +27,208 @@ #include #ifndef _WINSCARD_H_ -#define _WINSCARD_H_ /* do not include winscard.h */ +#define _WINSCARD_H_ /* do not include winscard.h */ #endif #ifndef SCARD_S_SUCCESS -#define SCARD_S_SUCCESS NO_ERROR +#define SCARD_S_SUCCESS NO_ERROR -#define SCARD_F_INTERNAL_ERROR (HRESULT)(0x80100001L) -#define SCARD_E_CANCELLED (HRESULT)(0x80100002L) -#define SCARD_E_INVALID_HANDLE (HRESULT)(0x80100003L) -#define SCARD_E_INVALID_PARAMETER (HRESULT)(0x80100004L) -#define SCARD_E_INVALID_TARGET (HRESULT)(0x80100005L) -#define SCARD_E_NO_MEMORY (HRESULT)(0x80100006L) -#define SCARD_F_WAITED_TOO_LONG (HRESULT)(0x80100007L) -#define SCARD_E_INSUFFICIENT_BUFFER (HRESULT)(0x80100008L) -#define SCARD_E_UNKNOWN_READER (HRESULT)(0x80100009L) -#define SCARD_E_TIMEOUT (HRESULT)(0x8010000AL) -#define SCARD_E_SHARING_VIOLATION (HRESULT)(0x8010000BL) -#define SCARD_E_NO_SMARTCARD (HRESULT)(0x8010000CL) -#define SCARD_E_UNKNOWN_CARD (HRESULT)(0x8010000DL) -#define SCARD_E_CANT_DISPOSE (HRESULT)(0x8010000EL) -#define SCARD_E_PROTO_MISMATCH (HRESULT)(0x8010000FL) -#define SCARD_E_NOT_READY (HRESULT)(0x80100010L) -#define SCARD_E_INVALID_VALUE (HRESULT)(0x80100011L) -#define SCARD_E_SYSTEM_CANCELLED (HRESULT)(0x80100012L) -#define SCARD_F_COMM_ERROR (HRESULT)(0x80100013L) -#define SCARD_F_UNKNOWN_ERROR (HRESULT)(0x80100014L) -#define SCARD_E_INVALID_ATR (HRESULT)(0x80100015L) -#define SCARD_E_NOT_TRANSACTED (HRESULT)(0x80100016L) -#define SCARD_E_READER_UNAVAILABLE (HRESULT)(0x80100017L) -#define SCARD_P_SHUTDOWN (HRESULT)(0x80100018L) -#define SCARD_E_PCI_TOO_SMALL (HRESULT)(0x80100019L) -#define SCARD_E_READER_UNSUPPORTED (HRESULT)(0x8010001AL) -#define SCARD_E_DUPLICATE_READER (HRESULT)(0x8010001BL) -#define SCARD_E_CARD_UNSUPPORTED (HRESULT)(0x8010001CL) -#define SCARD_E_NO_SERVICE (HRESULT)(0x8010001DL) -#define SCARD_E_SERVICE_STOPPED (HRESULT)(0x8010001EL) -#define SCARD_E_UNEXPECTED (HRESULT)(0x8010001FL) -#define SCARD_E_ICC_INSTALLATION (HRESULT)(0x80100020L) -#define SCARD_E_ICC_CREATEORDER (HRESULT)(0x80100021L) -#define SCARD_E_UNSUPPORTED_FEATURE (HRESULT)(0x80100022L) -#define SCARD_E_DIR_NOT_FOUND (HRESULT)(0x80100023L) -#define SCARD_E_FILE_NOT_FOUND (HRESULT)(0x80100024L) -#define SCARD_E_NO_DIR (HRESULT)(0x80100025L) -#define SCARD_E_NO_FILE (HRESULT)(0x80100026L) -#define SCARD_E_NO_ACCESS (HRESULT)(0x80100027L) -#define SCARD_E_WRITE_TOO_MANY (HRESULT)(0x80100028L) -#define SCARD_E_BAD_SEEK (HRESULT)(0x80100029L) -#define SCARD_E_INVALID_CHV (HRESULT)(0x8010002AL) -#define SCARD_E_UNKNOWN_RES_MNG (HRESULT)(0x8010002BL) -#define SCARD_E_NO_SUCH_CERTIFICATE (HRESULT)(0x8010002CL) -#define SCARD_E_CERTIFICATE_UNAVAILABLE (HRESULT)(0x8010002DL) -#define SCARD_E_NO_READERS_AVAILABLE (HRESULT)(0x8010002EL) -#define SCARD_E_COMM_DATA_LOST (HRESULT)(0x8010002FL) -#define SCARD_E_NO_KEY_CONTAINER (HRESULT)(0x80100030L) -#define SCARD_E_SERVER_TOO_BUSY (HRESULT)(0x80100031L) -#define SCARD_E_PIN_CACHE_EXPIRED (HRESULT)(0x80100032L) -#define SCARD_E_NO_PIN_CACHE (HRESULT)(0x80100033L) -#define SCARD_E_READ_ONLY_CARD (HRESULT)(0x80100034L) +#define SCARD_F_INTERNAL_ERROR (HRESULT)(0x80100001L) +#define SCARD_E_CANCELLED (HRESULT)(0x80100002L) +#define SCARD_E_INVALID_HANDLE (HRESULT)(0x80100003L) +#define SCARD_E_INVALID_PARAMETER (HRESULT)(0x80100004L) +#define SCARD_E_INVALID_TARGET (HRESULT)(0x80100005L) +#define SCARD_E_NO_MEMORY (HRESULT)(0x80100006L) +#define SCARD_F_WAITED_TOO_LONG (HRESULT)(0x80100007L) +#define SCARD_E_INSUFFICIENT_BUFFER (HRESULT)(0x80100008L) +#define SCARD_E_UNKNOWN_READER (HRESULT)(0x80100009L) +#define SCARD_E_TIMEOUT (HRESULT)(0x8010000AL) +#define SCARD_E_SHARING_VIOLATION (HRESULT)(0x8010000BL) +#define SCARD_E_NO_SMARTCARD (HRESULT)(0x8010000CL) +#define SCARD_E_UNKNOWN_CARD (HRESULT)(0x8010000DL) +#define SCARD_E_CANT_DISPOSE (HRESULT)(0x8010000EL) +#define SCARD_E_PROTO_MISMATCH (HRESULT)(0x8010000FL) +#define SCARD_E_NOT_READY (HRESULT)(0x80100010L) +#define SCARD_E_INVALID_VALUE (HRESULT)(0x80100011L) +#define SCARD_E_SYSTEM_CANCELLED (HRESULT)(0x80100012L) +#define SCARD_F_COMM_ERROR (HRESULT)(0x80100013L) +#define SCARD_F_UNKNOWN_ERROR (HRESULT)(0x80100014L) +#define SCARD_E_INVALID_ATR (HRESULT)(0x80100015L) +#define SCARD_E_NOT_TRANSACTED (HRESULT)(0x80100016L) +#define SCARD_E_READER_UNAVAILABLE (HRESULT)(0x80100017L) +#define SCARD_P_SHUTDOWN (HRESULT)(0x80100018L) +#define SCARD_E_PCI_TOO_SMALL (HRESULT)(0x80100019L) +#define SCARD_E_READER_UNSUPPORTED (HRESULT)(0x8010001AL) +#define SCARD_E_DUPLICATE_READER (HRESULT)(0x8010001BL) +#define SCARD_E_CARD_UNSUPPORTED (HRESULT)(0x8010001CL) +#define SCARD_E_NO_SERVICE (HRESULT)(0x8010001DL) +#define SCARD_E_SERVICE_STOPPED (HRESULT)(0x8010001EL) +#define SCARD_E_UNEXPECTED (HRESULT)(0x8010001FL) +#define SCARD_E_ICC_INSTALLATION (HRESULT)(0x80100020L) +#define SCARD_E_ICC_CREATEORDER (HRESULT)(0x80100021L) +#define SCARD_E_UNSUPPORTED_FEATURE (HRESULT)(0x80100022L) +#define SCARD_E_DIR_NOT_FOUND (HRESULT)(0x80100023L) +#define SCARD_E_FILE_NOT_FOUND (HRESULT)(0x80100024L) +#define SCARD_E_NO_DIR (HRESULT)(0x80100025L) +#define SCARD_E_NO_FILE (HRESULT)(0x80100026L) +#define SCARD_E_NO_ACCESS (HRESULT)(0x80100027L) +#define SCARD_E_WRITE_TOO_MANY (HRESULT)(0x80100028L) +#define SCARD_E_BAD_SEEK (HRESULT)(0x80100029L) +#define SCARD_E_INVALID_CHV (HRESULT)(0x8010002AL) +#define SCARD_E_UNKNOWN_RES_MNG (HRESULT)(0x8010002BL) +#define SCARD_E_NO_SUCH_CERTIFICATE (HRESULT)(0x8010002CL) +#define SCARD_E_CERTIFICATE_UNAVAILABLE (HRESULT)(0x8010002DL) +#define SCARD_E_NO_READERS_AVAILABLE (HRESULT)(0x8010002EL) +#define SCARD_E_COMM_DATA_LOST (HRESULT)(0x8010002FL) +#define SCARD_E_NO_KEY_CONTAINER (HRESULT)(0x80100030L) +#define SCARD_E_SERVER_TOO_BUSY (HRESULT)(0x80100031L) +#define SCARD_E_PIN_CACHE_EXPIRED (HRESULT)(0x80100032L) +#define SCARD_E_NO_PIN_CACHE (HRESULT)(0x80100033L) +#define SCARD_E_READ_ONLY_CARD (HRESULT)(0x80100034L) -#define SCARD_W_UNSUPPORTED_CARD (HRESULT)(0x80100065L) -#define SCARD_W_UNRESPONSIVE_CARD (HRESULT)(0x80100066L) -#define SCARD_W_UNPOWERED_CARD (HRESULT)(0x80100067L) -#define SCARD_W_RESET_CARD (HRESULT)(0x80100068L) -#define SCARD_W_REMOVED_CARD (HRESULT)(0x80100069L) -#define SCARD_W_SECURITY_VIOLATION (HRESULT)(0x8010006AL) -#define SCARD_W_WRONG_CHV (HRESULT)(0x8010006BL) -#define SCARD_W_CHV_BLOCKED (HRESULT)(0x8010006CL) -#define SCARD_W_EOF (HRESULT)(0x8010006DL) -#define SCARD_W_CANCELLED_BY_USER (HRESULT)(0x8010006EL) -#define SCARD_W_CARD_NOT_AUTHENTICATED (HRESULT)(0x8010006FL) -#define SCARD_W_CACHE_ITEM_NOT_FOUND (HRESULT)(0x80100070L) -#define SCARD_W_CACHE_ITEM_STALE (HRESULT)(0x80100071L) -#define SCARD_W_CACHE_ITEM_TOO_BIG (HRESULT)(0x80100072L) +#define SCARD_W_UNSUPPORTED_CARD (HRESULT)(0x80100065L) +#define SCARD_W_UNRESPONSIVE_CARD (HRESULT)(0x80100066L) +#define SCARD_W_UNPOWERED_CARD (HRESULT)(0x80100067L) +#define SCARD_W_RESET_CARD (HRESULT)(0x80100068L) +#define SCARD_W_REMOVED_CARD (HRESULT)(0x80100069L) +#define SCARD_W_SECURITY_VIOLATION (HRESULT)(0x8010006AL) +#define SCARD_W_WRONG_CHV (HRESULT)(0x8010006BL) +#define SCARD_W_CHV_BLOCKED (HRESULT)(0x8010006CL) +#define SCARD_W_EOF (HRESULT)(0x8010006DL) +#define SCARD_W_CANCELLED_BY_USER (HRESULT)(0x8010006EL) +#define SCARD_W_CARD_NOT_AUTHENTICATED (HRESULT)(0x8010006FL) +#define SCARD_W_CACHE_ITEM_NOT_FOUND (HRESULT)(0x80100070L) +#define SCARD_W_CACHE_ITEM_STALE (HRESULT)(0x80100071L) +#define SCARD_W_CACHE_ITEM_TOO_BIG (HRESULT)(0x80100072L) #endif -#define SCARD_ATR_LENGTH 33 +#define SCARD_ATR_LENGTH 33 -#define SCARD_PROTOCOL_UNDEFINED 0x00000000 -#define SCARD_PROTOCOL_T0 0x00000001 -#define SCARD_PROTOCOL_T1 0x00000002 -#define SCARD_PROTOCOL_RAW 0x00010000 +#define SCARD_PROTOCOL_UNDEFINED 0x00000000 +#define SCARD_PROTOCOL_T0 0x00000001 +#define SCARD_PROTOCOL_T1 0x00000002 +#define SCARD_PROTOCOL_RAW 0x00010000 -#define SCARD_PROTOCOL_Tx (SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1) -#define SCARD_PROTOCOL_DEFAULT 0x80000000 -#define SCARD_PROTOCOL_OPTIMAL 0x00000000 +#define SCARD_PROTOCOL_Tx (SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1) +#define SCARD_PROTOCOL_DEFAULT 0x80000000 +#define SCARD_PROTOCOL_OPTIMAL 0x00000000 -#define SCARD_POWER_DOWN 0 -#define SCARD_COLD_RESET 1 -#define SCARD_WARM_RESET 2 +#define SCARD_POWER_DOWN 0 +#define SCARD_COLD_RESET 1 +#define SCARD_WARM_RESET 2 -#define SCARD_CTL_CODE(code) CTL_CODE(FILE_DEVICE_SMARTCARD, (code), METHOD_BUFFERED, FILE_ANY_ACCESS) +#define SCARD_CTL_CODE(code) \ + CTL_CODE(FILE_DEVICE_SMARTCARD, (code), METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_SMARTCARD_POWER SCARD_CTL_CODE(1) -#define IOCTL_SMARTCARD_GET_ATTRIBUTE SCARD_CTL_CODE(2) -#define IOCTL_SMARTCARD_SET_ATTRIBUTE SCARD_CTL_CODE(3) -#define IOCTL_SMARTCARD_CONFISCATE SCARD_CTL_CODE(4) -#define IOCTL_SMARTCARD_TRANSMIT SCARD_CTL_CODE(5) -#define IOCTL_SMARTCARD_EJECT SCARD_CTL_CODE(6) -#define IOCTL_SMARTCARD_SWALLOW SCARD_CTL_CODE(7) -#define IOCTL_SMARTCARD_IS_PRESENT SCARD_CTL_CODE(10) -#define IOCTL_SMARTCARD_IS_ABSENT SCARD_CTL_CODE(11) -#define IOCTL_SMARTCARD_SET_PROTOCOL SCARD_CTL_CODE(12) -#define IOCTL_SMARTCARD_GET_STATE SCARD_CTL_CODE(14) -#define IOCTL_SMARTCARD_GET_LAST_ERROR SCARD_CTL_CODE(15) -#define IOCTL_SMARTCARD_GET_PERF_CNTR SCARD_CTL_CODE(16) +#define IOCTL_SMARTCARD_POWER SCARD_CTL_CODE(1) +#define IOCTL_SMARTCARD_GET_ATTRIBUTE SCARD_CTL_CODE(2) +#define IOCTL_SMARTCARD_SET_ATTRIBUTE SCARD_CTL_CODE(3) +#define IOCTL_SMARTCARD_CONFISCATE SCARD_CTL_CODE(4) +#define IOCTL_SMARTCARD_TRANSMIT SCARD_CTL_CODE(5) +#define IOCTL_SMARTCARD_EJECT SCARD_CTL_CODE(6) +#define IOCTL_SMARTCARD_SWALLOW SCARD_CTL_CODE(7) +#define IOCTL_SMARTCARD_IS_PRESENT SCARD_CTL_CODE(10) +#define IOCTL_SMARTCARD_IS_ABSENT SCARD_CTL_CODE(11) +#define IOCTL_SMARTCARD_SET_PROTOCOL SCARD_CTL_CODE(12) +#define IOCTL_SMARTCARD_GET_STATE SCARD_CTL_CODE(14) +#define IOCTL_SMARTCARD_GET_LAST_ERROR SCARD_CTL_CODE(15) +#define IOCTL_SMARTCARD_GET_PERF_CNTR SCARD_CTL_CODE(16) -#define IOCTL_SMARTCARD_GET_FEATURE_REQUEST SCARD_CTL_CODE(3400) +#define IOCTL_SMARTCARD_GET_FEATURE_REQUEST SCARD_CTL_CODE(3400) -#define MAXIMUM_ATTR_STRING_LENGTH 32 -#define MAXIMUM_SMARTCARD_READERS 10 +#define MAXIMUM_ATTR_STRING_LENGTH 32 +#define MAXIMUM_SMARTCARD_READERS 10 -#define SCARD_ATTR_VALUE(Class, Tag) ((((ULONG)(Class)) << 16) | ((ULONG)(Tag))) +#define SCARD_ATTR_VALUE(Class, Tag) ((((ULONG)(Class)) << 16) | ((ULONG)(Tag))) -#define SCARD_CLASS_VENDOR_INFO 1 -#define SCARD_CLASS_COMMUNICATIONS 2 -#define SCARD_CLASS_PROTOCOL 3 -#define SCARD_CLASS_POWER_MGMT 4 -#define SCARD_CLASS_SECURITY 5 -#define SCARD_CLASS_MECHANICAL 6 -#define SCARD_CLASS_VENDOR_DEFINED 7 -#define SCARD_CLASS_IFD_PROTOCOL 8 -#define SCARD_CLASS_ICC_STATE 9 -#define SCARD_CLASS_PERF 0x7FFE -#define SCARD_CLASS_SYSTEM 0x7FFF +#define SCARD_CLASS_VENDOR_INFO 1 +#define SCARD_CLASS_COMMUNICATIONS 2 +#define SCARD_CLASS_PROTOCOL 3 +#define SCARD_CLASS_POWER_MGMT 4 +#define SCARD_CLASS_SECURITY 5 +#define SCARD_CLASS_MECHANICAL 6 +#define SCARD_CLASS_VENDOR_DEFINED 7 +#define SCARD_CLASS_IFD_PROTOCOL 8 +#define SCARD_CLASS_ICC_STATE 9 +#define SCARD_CLASS_PERF 0x7FFE +#define SCARD_CLASS_SYSTEM 0x7FFF -#define SCARD_ATTR_VENDOR_NAME SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0100) -#define SCARD_ATTR_VENDOR_IFD_TYPE SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0101) -#define SCARD_ATTR_VENDOR_IFD_VERSION SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0102) -#define SCARD_ATTR_VENDOR_IFD_SERIAL_NO SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0103) -#define SCARD_ATTR_CHANNEL_ID SCARD_ATTR_VALUE(SCARD_CLASS_COMMUNICATIONS, 0x0110) -#define SCARD_ATTR_PROTOCOL_TYPES SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0120) -#define SCARD_ATTR_DEFAULT_CLK SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0121) -#define SCARD_ATTR_MAX_CLK SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0122) -#define SCARD_ATTR_DEFAULT_DATA_RATE SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0123) -#define SCARD_ATTR_MAX_DATA_RATE SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0124) -#define SCARD_ATTR_MAX_IFSD SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0125) -#define SCARD_ATTR_POWER_MGMT_SUPPORT SCARD_ATTR_VALUE(SCARD_CLASS_POWER_MGMT, 0x0131) -#define SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE SCARD_ATTR_VALUE(SCARD_CLASS_SECURITY, 0x0140) -#define SCARD_ATTR_USER_AUTH_INPUT_DEVICE SCARD_ATTR_VALUE(SCARD_CLASS_SECURITY, 0x0142) -#define SCARD_ATTR_CHARACTERISTICS SCARD_ATTR_VALUE(SCARD_CLASS_MECHANICAL, 0x0150) +#define SCARD_ATTR_VENDOR_NAME SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0100) +#define SCARD_ATTR_VENDOR_IFD_TYPE SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0101) +#define SCARD_ATTR_VENDOR_IFD_VERSION SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0102) +#define SCARD_ATTR_VENDOR_IFD_SERIAL_NO SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0103) +#define SCARD_ATTR_CHANNEL_ID SCARD_ATTR_VALUE(SCARD_CLASS_COMMUNICATIONS, 0x0110) +#define SCARD_ATTR_PROTOCOL_TYPES SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0120) +#define SCARD_ATTR_DEFAULT_CLK SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0121) +#define SCARD_ATTR_MAX_CLK SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0122) +#define SCARD_ATTR_DEFAULT_DATA_RATE SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0123) +#define SCARD_ATTR_MAX_DATA_RATE SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0124) +#define SCARD_ATTR_MAX_IFSD SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0125) +#define SCARD_ATTR_POWER_MGMT_SUPPORT SCARD_ATTR_VALUE(SCARD_CLASS_POWER_MGMT, 0x0131) +#define SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE SCARD_ATTR_VALUE(SCARD_CLASS_SECURITY, 0x0140) +#define SCARD_ATTR_USER_AUTH_INPUT_DEVICE SCARD_ATTR_VALUE(SCARD_CLASS_SECURITY, 0x0142) +#define SCARD_ATTR_CHARACTERISTICS SCARD_ATTR_VALUE(SCARD_CLASS_MECHANICAL, 0x0150) -#define SCARD_ATTR_CURRENT_PROTOCOL_TYPE SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0201) -#define SCARD_ATTR_CURRENT_CLK SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0202) -#define SCARD_ATTR_CURRENT_F SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0203) -#define SCARD_ATTR_CURRENT_D SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0204) -#define SCARD_ATTR_CURRENT_N SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0205) -#define SCARD_ATTR_CURRENT_W SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0206) -#define SCARD_ATTR_CURRENT_IFSC SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0207) -#define SCARD_ATTR_CURRENT_IFSD SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0208) -#define SCARD_ATTR_CURRENT_BWT SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0209) -#define SCARD_ATTR_CURRENT_CWT SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x020a) -#define SCARD_ATTR_CURRENT_EBC_ENCODING SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x020b) -#define SCARD_ATTR_EXTENDED_BWT SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x020c) +#define SCARD_ATTR_CURRENT_PROTOCOL_TYPE SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0201) +#define SCARD_ATTR_CURRENT_CLK SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0202) +#define SCARD_ATTR_CURRENT_F SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0203) +#define SCARD_ATTR_CURRENT_D SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0204) +#define SCARD_ATTR_CURRENT_N SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0205) +#define SCARD_ATTR_CURRENT_W SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0206) +#define SCARD_ATTR_CURRENT_IFSC SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0207) +#define SCARD_ATTR_CURRENT_IFSD SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0208) +#define SCARD_ATTR_CURRENT_BWT SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0209) +#define SCARD_ATTR_CURRENT_CWT SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x020a) +#define SCARD_ATTR_CURRENT_EBC_ENCODING SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x020b) +#define SCARD_ATTR_EXTENDED_BWT SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x020c) -#define SCARD_ATTR_ICC_PRESENCE SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0300) -#define SCARD_ATTR_ICC_INTERFACE_STATUS SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0301) -#define SCARD_ATTR_CURRENT_IO_STATE SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0302) -#define SCARD_ATTR_ATR_STRING SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0303) -#define SCARD_ATTR_ICC_TYPE_PER_ATR SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0304) +#define SCARD_ATTR_ICC_PRESENCE SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0300) +#define SCARD_ATTR_ICC_INTERFACE_STATUS SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0301) +#define SCARD_ATTR_CURRENT_IO_STATE SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0302) +#define SCARD_ATTR_ATR_STRING SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0303) +#define SCARD_ATTR_ICC_TYPE_PER_ATR SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0304) -#define SCARD_ATTR_ESC_RESET SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA000) -#define SCARD_ATTR_ESC_CANCEL SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA003) -#define SCARD_ATTR_ESC_AUTHREQUEST SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA005) -#define SCARD_ATTR_MAXINPUT SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA007) +#define SCARD_ATTR_ESC_RESET SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA000) +#define SCARD_ATTR_ESC_CANCEL SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA003) +#define SCARD_ATTR_ESC_AUTHREQUEST SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA005) +#define SCARD_ATTR_MAXINPUT SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA007) -#define SCARD_ATTR_DEVICE_UNIT SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0001) -#define SCARD_ATTR_DEVICE_IN_USE SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0002) -#define SCARD_ATTR_DEVICE_FRIENDLY_NAME_A SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0003) -#define SCARD_ATTR_DEVICE_SYSTEM_NAME_A SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0004) -#define SCARD_ATTR_DEVICE_FRIENDLY_NAME_W SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0005) -#define SCARD_ATTR_DEVICE_SYSTEM_NAME_W SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0006) -#define SCARD_ATTR_SUPRESS_T1_IFS_REQUEST SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0007) +#define SCARD_ATTR_DEVICE_UNIT SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0001) +#define SCARD_ATTR_DEVICE_IN_USE SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0002) +#define SCARD_ATTR_DEVICE_FRIENDLY_NAME_A SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0003) +#define SCARD_ATTR_DEVICE_SYSTEM_NAME_A SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0004) +#define SCARD_ATTR_DEVICE_FRIENDLY_NAME_W SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0005) +#define SCARD_ATTR_DEVICE_SYSTEM_NAME_W SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0006) +#define SCARD_ATTR_SUPRESS_T1_IFS_REQUEST SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0007) -#define SCARD_PERF_NUM_TRANSMISSIONS SCARD_ATTR_VALUE(SCARD_CLASS_PERF, 0x0001) -#define SCARD_PERF_BYTES_TRANSMITTED SCARD_ATTR_VALUE(SCARD_CLASS_PERF, 0x0002) -#define SCARD_PERF_TRANSMISSION_TIME SCARD_ATTR_VALUE(SCARD_CLASS_PERF, 0x0003) +#define SCARD_PERF_NUM_TRANSMISSIONS SCARD_ATTR_VALUE(SCARD_CLASS_PERF, 0x0001) +#define SCARD_PERF_BYTES_TRANSMITTED SCARD_ATTR_VALUE(SCARD_CLASS_PERF, 0x0002) +#define SCARD_PERF_TRANSMISSION_TIME SCARD_ATTR_VALUE(SCARD_CLASS_PERF, 0x0003) #ifdef UNICODE -#define SCARD_ATTR_DEVICE_FRIENDLY_NAME SCARD_ATTR_DEVICE_FRIENDLY_NAME_W -#define SCARD_ATTR_DEVICE_SYSTEM_NAME SCARD_ATTR_DEVICE_SYSTEM_NAME_W +#define SCARD_ATTR_DEVICE_FRIENDLY_NAME SCARD_ATTR_DEVICE_FRIENDLY_NAME_W +#define SCARD_ATTR_DEVICE_SYSTEM_NAME SCARD_ATTR_DEVICE_SYSTEM_NAME_W #else -#define SCARD_ATTR_DEVICE_FRIENDLY_NAME SCARD_ATTR_DEVICE_FRIENDLY_NAME_A -#define SCARD_ATTR_DEVICE_SYSTEM_NAME SCARD_ATTR_DEVICE_SYSTEM_NAME_A +#define SCARD_ATTR_DEVICE_FRIENDLY_NAME SCARD_ATTR_DEVICE_FRIENDLY_NAME_A +#define SCARD_ATTR_DEVICE_SYSTEM_NAME SCARD_ATTR_DEVICE_SYSTEM_NAME_A #endif -#define SCARD_T0_HEADER_LENGTH 7 -#define SCARD_T0_CMD_LENGTH 5 +#define SCARD_T0_HEADER_LENGTH 7 +#define SCARD_T0_CMD_LENGTH 5 -#define SCARD_T1_PROLOGUE_LENGTH 3 -#define SCARD_T1_EPILOGUE_LENGTH 2 -#define SCARD_T1_MAX_IFS 254 +#define SCARD_T1_PROLOGUE_LENGTH 3 +#define SCARD_T1_EPILOGUE_LENGTH 2 +#define SCARD_T1_MAX_IFS 254 -#define SCARD_UNKNOWN 0 -#define SCARD_ABSENT 1 -#define SCARD_PRESENT 2 -#define SCARD_SWALLOWED 3 -#define SCARD_POWERED 4 -#define SCARD_NEGOTIABLE 5 -#define SCARD_SPECIFIC 6 +#define SCARD_UNKNOWN 0 +#define SCARD_ABSENT 1 +#define SCARD_PRESENT 2 +#define SCARD_SWALLOWED 3 +#define SCARD_POWERED 4 +#define SCARD_NEGOTIABLE 5 +#define SCARD_SPECIFIC 6 #pragma pack(push, 1) @@ -240,115 +241,107 @@ typedef const SCARD_IO_REQUEST* LPCSCARD_IO_REQUEST; typedef struct { - BYTE - bCla, - bIns, - bP1, - bP2, - bP3; + BYTE bCla, bIns, bP1, bP2, bP3; } SCARD_T0_COMMAND, *LPSCARD_T0_COMMAND; typedef struct { SCARD_IO_REQUEST ioRequest; - BYTE - bSw1, - bSw2; - union - { + BYTE bSw1, bSw2; + union { SCARD_T0_COMMAND CmdBytes; BYTE rgbHeader[5]; } DUMMYUNIONNAME; } SCARD_T0_REQUEST; -typedef SCARD_T0_REQUEST* PSCARD_T0_REQUEST, *LPSCARD_T0_REQUEST; +typedef SCARD_T0_REQUEST *PSCARD_T0_REQUEST, *LPSCARD_T0_REQUEST; typedef struct { SCARD_IO_REQUEST ioRequest; } SCARD_T1_REQUEST; -typedef SCARD_T1_REQUEST* PSCARD_T1_REQUEST, *LPSCARD_T1_REQUEST; +typedef SCARD_T1_REQUEST *PSCARD_T1_REQUEST, *LPSCARD_T1_REQUEST; -#define SCARD_READER_SWALLOWS 0x00000001 -#define SCARD_READER_EJECTS 0x00000002 -#define SCARD_READER_CONFISCATES 0x00000004 +#define SCARD_READER_SWALLOWS 0x00000001 +#define SCARD_READER_EJECTS 0x00000002 +#define SCARD_READER_CONFISCATES 0x00000004 -#define SCARD_READER_TYPE_SERIAL 0x01 -#define SCARD_READER_TYPE_PARALELL 0x02 -#define SCARD_READER_TYPE_KEYBOARD 0x04 -#define SCARD_READER_TYPE_SCSI 0x08 -#define SCARD_READER_TYPE_IDE 0x10 -#define SCARD_READER_TYPE_USB 0x20 -#define SCARD_READER_TYPE_PCMCIA 0x40 -#define SCARD_READER_TYPE_TPM 0x80 -#define SCARD_READER_TYPE_NFC 0x100 -#define SCARD_READER_TYPE_UICC 0x200 -#define SCARD_READER_TYPE_VENDOR 0xF0 +#define SCARD_READER_TYPE_SERIAL 0x01 +#define SCARD_READER_TYPE_PARALELL 0x02 +#define SCARD_READER_TYPE_KEYBOARD 0x04 +#define SCARD_READER_TYPE_SCSI 0x08 +#define SCARD_READER_TYPE_IDE 0x10 +#define SCARD_READER_TYPE_USB 0x20 +#define SCARD_READER_TYPE_PCMCIA 0x40 +#define SCARD_READER_TYPE_TPM 0x80 +#define SCARD_READER_TYPE_NFC 0x100 +#define SCARD_READER_TYPE_UICC 0x200 +#define SCARD_READER_TYPE_VENDOR 0xF0 #ifndef WINSCARDAPI -#define WINSCARDAPI WINPR_API +#define WINSCARDAPI WINPR_API #endif typedef ULONG_PTR SCARDCONTEXT; -typedef SCARDCONTEXT* PSCARDCONTEXT, *LPSCARDCONTEXT; +typedef SCARDCONTEXT *PSCARDCONTEXT, *LPSCARDCONTEXT; typedef ULONG_PTR SCARDHANDLE; -typedef SCARDHANDLE* PSCARDHANDLE, *LPSCARDHANDLE; +typedef SCARDHANDLE *PSCARDHANDLE, *LPSCARDHANDLE; -#define SCARD_AUTOALLOCATE (DWORD)(-1) +#define SCARD_AUTOALLOCATE (DWORD)(-1) -#define SCARD_SCOPE_USER 0 -#define SCARD_SCOPE_TERMINAL 1 -#define SCARD_SCOPE_SYSTEM 2 +#define SCARD_SCOPE_USER 0 +#define SCARD_SCOPE_TERMINAL 1 +#define SCARD_SCOPE_SYSTEM 2 -#define SCARD_STATE_UNAWARE 0x00000000 -#define SCARD_STATE_IGNORE 0x00000001 -#define SCARD_STATE_CHANGED 0x00000002 -#define SCARD_STATE_UNKNOWN 0x00000004 -#define SCARD_STATE_UNAVAILABLE 0x00000008 -#define SCARD_STATE_EMPTY 0x00000010 -#define SCARD_STATE_PRESENT 0x00000020 -#define SCARD_STATE_ATRMATCH 0x00000040 -#define SCARD_STATE_EXCLUSIVE 0x00000080 -#define SCARD_STATE_INUSE 0x00000100 -#define SCARD_STATE_MUTE 0x00000200 -#define SCARD_STATE_UNPOWERED 0x00000400 +#define SCARD_STATE_UNAWARE 0x00000000 +#define SCARD_STATE_IGNORE 0x00000001 +#define SCARD_STATE_CHANGED 0x00000002 +#define SCARD_STATE_UNKNOWN 0x00000004 +#define SCARD_STATE_UNAVAILABLE 0x00000008 +#define SCARD_STATE_EMPTY 0x00000010 +#define SCARD_STATE_PRESENT 0x00000020 +#define SCARD_STATE_ATRMATCH 0x00000040 +#define SCARD_STATE_EXCLUSIVE 0x00000080 +#define SCARD_STATE_INUSE 0x00000100 +#define SCARD_STATE_MUTE 0x00000200 +#define SCARD_STATE_UNPOWERED 0x00000400 -#define SCARD_SHARE_EXCLUSIVE 1 -#define SCARD_SHARE_SHARED 2 -#define SCARD_SHARE_DIRECT 3 +#define SCARD_SHARE_EXCLUSIVE 1 +#define SCARD_SHARE_SHARED 2 +#define SCARD_SHARE_DIRECT 3 -#define SCARD_LEAVE_CARD 0 -#define SCARD_RESET_CARD 1 -#define SCARD_UNPOWER_CARD 2 -#define SCARD_EJECT_CARD 3 +#define SCARD_LEAVE_CARD 0 +#define SCARD_RESET_CARD 1 +#define SCARD_UNPOWER_CARD 2 +#define SCARD_EJECT_CARD 3 -#define SC_DLG_MINIMAL_UI 0x01 -#define SC_DLG_NO_UI 0x02 -#define SC_DLG_FORCE_UI 0x04 +#define SC_DLG_MINIMAL_UI 0x01 +#define SC_DLG_NO_UI 0x02 +#define SC_DLG_FORCE_UI 0x04 -#define SCERR_NOCARDNAME 0x4000 -#define SCERR_NOGUIDS 0x8000 +#define SCERR_NOCARDNAME 0x4000 +#define SCERR_NOGUIDS 0x8000 typedef SCARDHANDLE(WINAPI* LPOCNCONNPROCA)(SCARDCONTEXT hSCardContext, LPSTR szReader, - LPSTR mszCards, PVOID pvUserData); + LPSTR mszCards, PVOID pvUserData); typedef SCARDHANDLE(WINAPI* LPOCNCONNPROCW)(SCARDCONTEXT hSCardContext, LPWSTR szReader, - LPWSTR mszCards, PVOID pvUserData); + LPWSTR mszCards, PVOID pvUserData); -typedef BOOL (WINAPI* LPOCNCHKPROC)(SCARDCONTEXT hSCardContext, SCARDHANDLE hCard, - PVOID pvUserData); -typedef void (WINAPI* LPOCNDSCPROC)(SCARDCONTEXT hSCardContext, SCARDHANDLE hCard, - PVOID pvUserData); +typedef BOOL(WINAPI* LPOCNCHKPROC)(SCARDCONTEXT hSCardContext, SCARDHANDLE hCard, PVOID pvUserData); +typedef void(WINAPI* LPOCNDSCPROC)(SCARDCONTEXT hSCardContext, SCARDHANDLE hCard, PVOID pvUserData); -#define SCARD_READER_SEL_AUTH_PACKAGE ((DWORD)-629) +#define SCARD_READER_SEL_AUTH_PACKAGE ((DWORD)-629) -#define SCARD_AUDIT_CHV_FAILURE 0x0 -#define SCARD_AUDIT_CHV_SUCCESS 0x1 +#define SCARD_AUDIT_CHV_FAILURE 0x0 +#define SCARD_AUDIT_CHV_SUCCESS 0x1 #define SCardListCardTypes SCardListCards -#define PCSCardIntroduceCardType(hContext, szCardName, pbAtr, pbAtrMask, cbAtrLen, pguidPrimaryProvider, rgguidInterfaces, dwInterfaceCount) \ - SCardIntroduceCardType(hContext, szCardName, pguidPrimaryProvider, rgguidInterfaces, dwInterfaceCount, pbAtr, pbAtrMask, cbAtrLen) +#define PCSCardIntroduceCardType(hContext, szCardName, pbAtr, pbAtrMask, cbAtrLen, \ + pguidPrimaryProvider, rgguidInterfaces, dwInterfaceCount) \ + SCardIntroduceCardType(hContext, szCardName, pguidPrimaryProvider, rgguidInterfaces, \ + dwInterfaceCount, pbAtr, pbAtrMask, cbAtrLen) #define SCardGetReaderCapabilities SCardGetAttrib #define SCardSetReaderCapabilities SCardSetAttrib @@ -467,9 +460,9 @@ typedef struct typedef enum { - RSR_MATCH_TYPE_READER_AND_CONTAINER = 1, - RSR_MATCH_TYPE_SERIAL_NUMBER, - RSR_MATCH_TYPE_ALL_CARDS + RSR_MATCH_TYPE_READER_AND_CONTAINER = 1, + RSR_MATCH_TYPE_SERIAL_NUMBER, + RSR_MATCH_TYPE_ALL_CARDS } READER_SEL_REQUEST_MATCH_TYPE; typedef struct @@ -477,8 +470,7 @@ typedef struct DWORD dwShareMode; DWORD dwPreferredProtocols; READER_SEL_REQUEST_MATCH_TYPE MatchType; - union - { + union { struct { DWORD cbReaderNameOffset; @@ -562,291 +554,318 @@ typedef struct #pragma pack(pop) #ifdef UNICODE -#define LPOCNCONNPROC LPOCNCONNPROCW -#define SCARD_READERSTATE SCARD_READERSTATEW -#define PSCARD_READERSTATE PSCARD_READERSTATEW -#define LPSCARD_READERSTATE LPSCARD_READERSTATEW -#define OPENCARD_SEARCH_CRITERIA OPENCARD_SEARCH_CRITERIAW -#define LOPENCARD_SEARCH_CRITERIA LOPENCARD_SEARCH_CRITERIAW -#define LPOPENCARD_SEARCH_CRITERIA LPOPENCARD_SEARCH_CRITERIAW -#define OPENCARDNAME_EX OPENCARDNAME_EXW -#define LOPENCARDNAME_EX LOPENCARDNAME_EXW -#define LPOPENCARDNAME_EX LPOPENCARDNAME_EXW -#define OPENCARDNAME OPENCARDNAMEW -#define LOPENCARDNAME LOPENCARDNAMEW -#define LPOPENCARDNAME LPOPENCARDNAMEW +#define LPOCNCONNPROC LPOCNCONNPROCW +#define SCARD_READERSTATE SCARD_READERSTATEW +#define PSCARD_READERSTATE PSCARD_READERSTATEW +#define LPSCARD_READERSTATE LPSCARD_READERSTATEW +#define OPENCARD_SEARCH_CRITERIA OPENCARD_SEARCH_CRITERIAW +#define LOPENCARD_SEARCH_CRITERIA LOPENCARD_SEARCH_CRITERIAW +#define LPOPENCARD_SEARCH_CRITERIA LPOPENCARD_SEARCH_CRITERIAW +#define OPENCARDNAME_EX OPENCARDNAME_EXW +#define LOPENCARDNAME_EX LOPENCARDNAME_EXW +#define LPOPENCARDNAME_EX LPOPENCARDNAME_EXW +#define OPENCARDNAME OPENCARDNAMEW +#define LOPENCARDNAME LOPENCARDNAMEW +#define LPOPENCARDNAME LPOPENCARDNAMEW #else -#define LPOCNCONNPROC LPOCNCONNPROCA -#define SCARD_READERSTATE SCARD_READERSTATEA -#define PSCARD_READERSTATE PSCARD_READERSTATEA -#define LPSCARD_READERSTATE LPSCARD_READERSTATEA -#define OPENCARD_SEARCH_CRITERIA OPENCARD_SEARCH_CRITERIAA -#define LOPENCARD_SEARCH_CRITERIA LOPENCARD_SEARCH_CRITERIAA -#define LPOPENCARD_SEARCH_CRITERIA LPOPENCARD_SEARCH_CRITERIAA -#define OPENCARDNAME_EX OPENCARDNAME_EXA -#define LOPENCARDNAME_EX LOPENCARDNAME_EXA -#define LPOPENCARDNAME_EX LPOPENCARDNAME_EXA -#define OPENCARDNAME OPENCARDNAMEA -#define LOPENCARDNAME LOPENCARDNAMEA -#define LPOPENCARDNAME LPOPENCARDNAMEA +#define LPOCNCONNPROC LPOCNCONNPROCA +#define SCARD_READERSTATE SCARD_READERSTATEA +#define PSCARD_READERSTATE PSCARD_READERSTATEA +#define LPSCARD_READERSTATE LPSCARD_READERSTATEA +#define OPENCARD_SEARCH_CRITERIA OPENCARD_SEARCH_CRITERIAA +#define LOPENCARD_SEARCH_CRITERIA LOPENCARD_SEARCH_CRITERIAA +#define LPOPENCARD_SEARCH_CRITERIA LPOPENCARD_SEARCH_CRITERIAA +#define OPENCARDNAME_EX OPENCARDNAME_EXA +#define LOPENCARDNAME_EX LOPENCARDNAME_EXA +#define LPOPENCARDNAME_EX LPOPENCARDNAME_EXA +#define OPENCARDNAME OPENCARDNAMEA +#define LOPENCARDNAME LOPENCARDNAMEA +#define LPOPENCARDNAME LPOPENCARDNAMEA #endif #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -extern const SCARD_IO_REQUEST g_rgSCardT0Pci; -extern const SCARD_IO_REQUEST g_rgSCardT1Pci; -extern const SCARD_IO_REQUEST g_rgSCardRawPci; + extern const SCARD_IO_REQUEST g_rgSCardT0Pci; + extern const SCARD_IO_REQUEST g_rgSCardT1Pci; + extern const SCARD_IO_REQUEST g_rgSCardRawPci; -#define SCARD_PCI_T0 (&g_rgSCardT0Pci) -#define SCARD_PCI_T1 (&g_rgSCardT1Pci) -#define SCARD_PCI_RAW (&g_rgSCardRawPci) +#define SCARD_PCI_T0 (&g_rgSCardT0Pci) +#define SCARD_PCI_T1 (&g_rgSCardT1Pci) +#define SCARD_PCI_RAW (&g_rgSCardRawPci) -WINSCARDAPI LONG WINAPI SCardEstablishContext(DWORD dwScope, - LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext); + WINSCARDAPI LONG WINAPI SCardEstablishContext(DWORD dwScope, LPCVOID pvReserved1, + LPCVOID pvReserved2, LPSCARDCONTEXT phContext); -WINSCARDAPI LONG WINAPI SCardReleaseContext(SCARDCONTEXT hContext); + WINSCARDAPI LONG WINAPI SCardReleaseContext(SCARDCONTEXT hContext); -WINSCARDAPI LONG WINAPI SCardIsValidContext(SCARDCONTEXT hContext); + WINSCARDAPI LONG WINAPI SCardIsValidContext(SCARDCONTEXT hContext); -WINSCARDAPI LONG WINAPI SCardListReaderGroupsA(SCARDCONTEXT hContext, - LPSTR mszGroups, LPDWORD pcchGroups); -WINSCARDAPI LONG WINAPI SCardListReaderGroupsW(SCARDCONTEXT hContext, - LPWSTR mszGroups, LPDWORD pcchGroups); + WINSCARDAPI LONG WINAPI SCardListReaderGroupsA(SCARDCONTEXT hContext, LPSTR mszGroups, + LPDWORD pcchGroups); + WINSCARDAPI LONG WINAPI SCardListReaderGroupsW(SCARDCONTEXT hContext, LPWSTR mszGroups, + LPDWORD pcchGroups); -WINSCARDAPI LONG WINAPI SCardListReadersA(SCARDCONTEXT hContext, - LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders); -WINSCARDAPI LONG WINAPI SCardListReadersW(SCARDCONTEXT hContext, - LPCWSTR mszGroups, LPWSTR mszReaders, LPDWORD pcchReaders); + WINSCARDAPI LONG WINAPI SCardListReadersA(SCARDCONTEXT hContext, LPCSTR mszGroups, + LPSTR mszReaders, LPDWORD pcchReaders); + WINSCARDAPI LONG WINAPI SCardListReadersW(SCARDCONTEXT hContext, LPCWSTR mszGroups, + LPWSTR mszReaders, LPDWORD pcchReaders); -WINSCARDAPI LONG WINAPI SCardListCardsA(SCARDCONTEXT hContext, - LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, CHAR* mszCards, - LPDWORD pcchCards); + WINSCARDAPI LONG WINAPI SCardListCardsA(SCARDCONTEXT hContext, LPCBYTE pbAtr, + LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, + CHAR* mszCards, LPDWORD pcchCards); -WINSCARDAPI LONG WINAPI SCardListCardsW(SCARDCONTEXT hContext, - LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, WCHAR* mszCards, - LPDWORD pcchCards); + WINSCARDAPI LONG WINAPI SCardListCardsW(SCARDCONTEXT hContext, LPCBYTE pbAtr, + LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, + WCHAR* mszCards, LPDWORD pcchCards); -WINSCARDAPI LONG WINAPI SCardListInterfacesA(SCARDCONTEXT hContext, - LPCSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces); -WINSCARDAPI LONG WINAPI SCardListInterfacesW(SCARDCONTEXT hContext, - LPCWSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces); + WINSCARDAPI LONG WINAPI SCardListInterfacesA(SCARDCONTEXT hContext, LPCSTR szCard, + LPGUID pguidInterfaces, LPDWORD pcguidInterfaces); + WINSCARDAPI LONG WINAPI SCardListInterfacesW(SCARDCONTEXT hContext, LPCWSTR szCard, + LPGUID pguidInterfaces, LPDWORD pcguidInterfaces); -WINSCARDAPI LONG WINAPI SCardGetProviderIdA(SCARDCONTEXT hContext, - LPCSTR szCard, LPGUID pguidProviderId); -WINSCARDAPI LONG WINAPI SCardGetProviderIdW(SCARDCONTEXT hContext, - LPCWSTR szCard, LPGUID pguidProviderId); + WINSCARDAPI LONG WINAPI SCardGetProviderIdA(SCARDCONTEXT hContext, LPCSTR szCard, + LPGUID pguidProviderId); + WINSCARDAPI LONG WINAPI SCardGetProviderIdW(SCARDCONTEXT hContext, LPCWSTR szCard, + LPGUID pguidProviderId); -WINSCARDAPI LONG WINAPI SCardGetCardTypeProviderNameA(SCARDCONTEXT hContext, - LPCSTR szCardName, DWORD dwProviderId, CHAR* szProvider, LPDWORD pcchProvider); -WINSCARDAPI LONG WINAPI SCardGetCardTypeProviderNameW(SCARDCONTEXT hContext, - LPCWSTR szCardName, DWORD dwProviderId, WCHAR* szProvider, LPDWORD pcchProvider); + WINSCARDAPI LONG WINAPI SCardGetCardTypeProviderNameA(SCARDCONTEXT hContext, LPCSTR szCardName, + DWORD dwProviderId, CHAR* szProvider, + LPDWORD pcchProvider); + WINSCARDAPI LONG WINAPI SCardGetCardTypeProviderNameW(SCARDCONTEXT hContext, LPCWSTR szCardName, + DWORD dwProviderId, WCHAR* szProvider, + LPDWORD pcchProvider); -WINSCARDAPI LONG WINAPI SCardIntroduceReaderGroupA(SCARDCONTEXT hContext, LPCSTR szGroupName); -WINSCARDAPI LONG WINAPI SCardIntroduceReaderGroupW(SCARDCONTEXT hContext, LPCWSTR szGroupName); + WINSCARDAPI LONG WINAPI SCardIntroduceReaderGroupA(SCARDCONTEXT hContext, LPCSTR szGroupName); + WINSCARDAPI LONG WINAPI SCardIntroduceReaderGroupW(SCARDCONTEXT hContext, LPCWSTR szGroupName); -WINSCARDAPI LONG WINAPI SCardForgetReaderGroupA(SCARDCONTEXT hContext, LPCSTR szGroupName); -WINSCARDAPI LONG WINAPI SCardForgetReaderGroupW(SCARDCONTEXT hContext, LPCWSTR szGroupName); + WINSCARDAPI LONG WINAPI SCardForgetReaderGroupA(SCARDCONTEXT hContext, LPCSTR szGroupName); + WINSCARDAPI LONG WINAPI SCardForgetReaderGroupW(SCARDCONTEXT hContext, LPCWSTR szGroupName); -WINSCARDAPI LONG WINAPI SCardIntroduceReaderA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPCSTR szDeviceName); -WINSCARDAPI LONG WINAPI SCardIntroduceReaderW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPCWSTR szDeviceName); + WINSCARDAPI LONG WINAPI SCardIntroduceReaderA(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPCSTR szDeviceName); + WINSCARDAPI LONG WINAPI SCardIntroduceReaderW(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPCWSTR szDeviceName); -WINSCARDAPI LONG WINAPI SCardForgetReaderA(SCARDCONTEXT hContext, LPCSTR szReaderName); -WINSCARDAPI LONG WINAPI SCardForgetReaderW(SCARDCONTEXT hContext, LPCWSTR szReaderName); + WINSCARDAPI LONG WINAPI SCardForgetReaderA(SCARDCONTEXT hContext, LPCSTR szReaderName); + WINSCARDAPI LONG WINAPI SCardForgetReaderW(SCARDCONTEXT hContext, LPCWSTR szReaderName); -WINSCARDAPI LONG WINAPI SCardAddReaderToGroupA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPCSTR szGroupName); -WINSCARDAPI LONG WINAPI SCardAddReaderToGroupW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPCWSTR szGroupName); + WINSCARDAPI LONG WINAPI SCardAddReaderToGroupA(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPCSTR szGroupName); + WINSCARDAPI LONG WINAPI SCardAddReaderToGroupW(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPCWSTR szGroupName); -WINSCARDAPI LONG WINAPI SCardRemoveReaderFromGroupA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPCSTR szGroupName); -WINSCARDAPI LONG WINAPI SCardRemoveReaderFromGroupW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPCWSTR szGroupName); + WINSCARDAPI LONG WINAPI SCardRemoveReaderFromGroupA(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPCSTR szGroupName); + WINSCARDAPI LONG WINAPI SCardRemoveReaderFromGroupW(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPCWSTR szGroupName); -WINSCARDAPI LONG WINAPI SCardIntroduceCardTypeA(SCARDCONTEXT hContext, - LPCSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, - DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen); -WINSCARDAPI LONG WINAPI SCardIntroduceCardTypeW(SCARDCONTEXT hContext, - LPCWSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, - DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen); + WINSCARDAPI LONG WINAPI SCardIntroduceCardTypeA(SCARDCONTEXT hContext, LPCSTR szCardName, + LPCGUID pguidPrimaryProvider, + LPCGUID rgguidInterfaces, + DWORD dwInterfaceCount, LPCBYTE pbAtr, + LPCBYTE pbAtrMask, DWORD cbAtrLen); + WINSCARDAPI LONG WINAPI SCardIntroduceCardTypeW(SCARDCONTEXT hContext, LPCWSTR szCardName, + LPCGUID pguidPrimaryProvider, + LPCGUID rgguidInterfaces, + DWORD dwInterfaceCount, LPCBYTE pbAtr, + LPCBYTE pbAtrMask, DWORD cbAtrLen); -WINSCARDAPI LONG WINAPI SCardSetCardTypeProviderNameA(SCARDCONTEXT hContext, - LPCSTR szCardName, DWORD dwProviderId, LPCSTR szProvider); -WINSCARDAPI LONG WINAPI SCardSetCardTypeProviderNameW(SCARDCONTEXT hContext, - LPCWSTR szCardName, DWORD dwProviderId, LPCWSTR szProvider); + WINSCARDAPI LONG WINAPI SCardSetCardTypeProviderNameA(SCARDCONTEXT hContext, LPCSTR szCardName, + DWORD dwProviderId, LPCSTR szProvider); + WINSCARDAPI LONG WINAPI SCardSetCardTypeProviderNameW(SCARDCONTEXT hContext, LPCWSTR szCardName, + DWORD dwProviderId, LPCWSTR szProvider); -WINSCARDAPI LONG WINAPI SCardForgetCardTypeA(SCARDCONTEXT hContext, LPCSTR szCardName); -WINSCARDAPI LONG WINAPI SCardForgetCardTypeW(SCARDCONTEXT hContext, LPCWSTR szCardName); + WINSCARDAPI LONG WINAPI SCardForgetCardTypeA(SCARDCONTEXT hContext, LPCSTR szCardName); + WINSCARDAPI LONG WINAPI SCardForgetCardTypeW(SCARDCONTEXT hContext, LPCWSTR szCardName); -WINSCARDAPI LONG WINAPI SCardFreeMemory(SCARDCONTEXT hContext, LPCVOID pvMem); + WINSCARDAPI LONG WINAPI SCardFreeMemory(SCARDCONTEXT hContext, LPCVOID pvMem); -WINSCARDAPI HANDLE WINAPI SCardAccessStartedEvent(void); + WINSCARDAPI HANDLE WINAPI SCardAccessStartedEvent(void); -WINSCARDAPI void WINAPI SCardReleaseStartedEvent(void); + WINSCARDAPI void WINAPI SCardReleaseStartedEvent(void); -WINSCARDAPI LONG WINAPI SCardLocateCardsA(SCARDCONTEXT hContext, - LPCSTR mszCards, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders); -WINSCARDAPI LONG WINAPI SCardLocateCardsW(SCARDCONTEXT hContext, - LPCWSTR mszCards, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders); + WINSCARDAPI LONG WINAPI SCardLocateCardsA(SCARDCONTEXT hContext, LPCSTR mszCards, + LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders); + WINSCARDAPI LONG WINAPI SCardLocateCardsW(SCARDCONTEXT hContext, LPCWSTR mszCards, + LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders); -WINSCARDAPI LONG WINAPI SCardLocateCardsByATRA(SCARDCONTEXT hContext, - LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders); -WINSCARDAPI LONG WINAPI SCardLocateCardsByATRW(SCARDCONTEXT hContext, - LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders); + WINSCARDAPI LONG WINAPI SCardLocateCardsByATRA(SCARDCONTEXT hContext, + LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, + LPSCARD_READERSTATEA rgReaderStates, + DWORD cReaders); + WINSCARDAPI LONG WINAPI SCardLocateCardsByATRW(SCARDCONTEXT hContext, + LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, + LPSCARD_READERSTATEW rgReaderStates, + DWORD cReaders); -WINSCARDAPI LONG WINAPI SCardGetStatusChangeA(SCARDCONTEXT hContext, - DWORD dwTimeout, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders); -WINSCARDAPI LONG WINAPI SCardGetStatusChangeW(SCARDCONTEXT hContext, - DWORD dwTimeout, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders); + WINSCARDAPI LONG WINAPI SCardGetStatusChangeA(SCARDCONTEXT hContext, DWORD dwTimeout, + LPSCARD_READERSTATEA rgReaderStates, + DWORD cReaders); + WINSCARDAPI LONG WINAPI SCardGetStatusChangeW(SCARDCONTEXT hContext, DWORD dwTimeout, + LPSCARD_READERSTATEW rgReaderStates, + DWORD cReaders); -WINSCARDAPI LONG WINAPI SCardCancel(SCARDCONTEXT hContext); + WINSCARDAPI LONG WINAPI SCardCancel(SCARDCONTEXT hContext); -WINSCARDAPI LONG WINAPI SCardConnectA(SCARDCONTEXT hContext, - LPCSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, - LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol); -WINSCARDAPI LONG WINAPI SCardConnectW(SCARDCONTEXT hContext, - LPCWSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, - LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol); + WINSCARDAPI LONG WINAPI SCardConnectA(SCARDCONTEXT hContext, LPCSTR szReader, DWORD dwShareMode, + DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, + LPDWORD pdwActiveProtocol); + WINSCARDAPI LONG WINAPI SCardConnectW(SCARDCONTEXT hContext, LPCWSTR szReader, + DWORD dwShareMode, DWORD dwPreferredProtocols, + LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol); -WINSCARDAPI LONG WINAPI SCardReconnect(SCARDHANDLE hCard, - DWORD dwShareMode, DWORD dwPreferredProtocols, DWORD dwInitialization, LPDWORD pdwActiveProtocol); + WINSCARDAPI LONG WINAPI SCardReconnect(SCARDHANDLE hCard, DWORD dwShareMode, + DWORD dwPreferredProtocols, DWORD dwInitialization, + LPDWORD pdwActiveProtocol); -WINSCARDAPI LONG WINAPI SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition); + WINSCARDAPI LONG WINAPI SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition); -WINSCARDAPI LONG WINAPI SCardBeginTransaction(SCARDHANDLE hCard); + WINSCARDAPI LONG WINAPI SCardBeginTransaction(SCARDHANDLE hCard); -WINSCARDAPI LONG WINAPI SCardEndTransaction(SCARDHANDLE hCard, DWORD dwDisposition); + WINSCARDAPI LONG WINAPI SCardEndTransaction(SCARDHANDLE hCard, DWORD dwDisposition); -WINSCARDAPI LONG WINAPI SCardCancelTransaction(SCARDHANDLE hCard); + WINSCARDAPI LONG WINAPI SCardCancelTransaction(SCARDHANDLE hCard); -WINSCARDAPI LONG WINAPI SCardState(SCARDHANDLE hCard, - LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen); + WINSCARDAPI LONG WINAPI SCardState(SCARDHANDLE hCard, LPDWORD pdwState, LPDWORD pdwProtocol, + LPBYTE pbAtr, LPDWORD pcbAtrLen); -WINSCARDAPI LONG WINAPI SCardStatusA(SCARDHANDLE hCard, - LPSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState, - LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen); -WINSCARDAPI LONG WINAPI SCardStatusW(SCARDHANDLE hCard, - LPWSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState, - LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen); + WINSCARDAPI LONG WINAPI SCardStatusA(SCARDHANDLE hCard, LPSTR mszReaderNames, + LPDWORD pcchReaderLen, LPDWORD pdwState, + LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen); + WINSCARDAPI LONG WINAPI SCardStatusW(SCARDHANDLE hCard, LPWSTR mszReaderNames, + LPDWORD pcchReaderLen, LPDWORD pdwState, + LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen); -WINSCARDAPI LONG WINAPI SCardTransmit(SCARDHANDLE hCard, - LPCSCARD_IO_REQUEST pioSendPci, LPCBYTE pbSendBuffer, DWORD cbSendLength, - LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength); + WINSCARDAPI LONG WINAPI SCardTransmit(SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pioSendPci, + LPCBYTE pbSendBuffer, DWORD cbSendLength, + LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, + LPDWORD pcbRecvLength); -WINSCARDAPI LONG WINAPI SCardGetTransmitCount(SCARDHANDLE hCard, LPDWORD pcTransmitCount); + WINSCARDAPI LONG WINAPI SCardGetTransmitCount(SCARDHANDLE hCard, LPDWORD pcTransmitCount); -WINSCARDAPI LONG WINAPI SCardControl(SCARDHANDLE hCard, - DWORD dwControlCode, LPCVOID lpInBuffer, DWORD cbInBufferSize, - LPVOID lpOutBuffer, DWORD cbOutBufferSize, LPDWORD lpBytesReturned); + WINSCARDAPI LONG WINAPI SCardControl(SCARDHANDLE hCard, DWORD dwControlCode, LPCVOID lpInBuffer, + DWORD cbInBufferSize, LPVOID lpOutBuffer, + DWORD cbOutBufferSize, LPDWORD lpBytesReturned); -WINSCARDAPI LONG WINAPI SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, - LPDWORD pcbAttrLen); + WINSCARDAPI LONG WINAPI SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, + LPDWORD pcbAttrLen); -WINSCARDAPI LONG WINAPI SCardSetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr, - DWORD cbAttrLen); + WINSCARDAPI LONG WINAPI SCardSetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr, + DWORD cbAttrLen); -WINSCARDAPI LONG WINAPI SCardUIDlgSelectCardA(LPOPENCARDNAMEA_EX pDlgStruc); -WINSCARDAPI LONG WINAPI SCardUIDlgSelectCardW(LPOPENCARDNAMEW_EX pDlgStruc); + WINSCARDAPI LONG WINAPI SCardUIDlgSelectCardA(LPOPENCARDNAMEA_EX pDlgStruc); + WINSCARDAPI LONG WINAPI SCardUIDlgSelectCardW(LPOPENCARDNAMEW_EX pDlgStruc); -WINSCARDAPI LONG WINAPI GetOpenCardNameA(LPOPENCARDNAMEA pDlgStruc); -WINSCARDAPI LONG WINAPI GetOpenCardNameW(LPOPENCARDNAMEW pDlgStruc); + WINSCARDAPI LONG WINAPI GetOpenCardNameA(LPOPENCARDNAMEA pDlgStruc); + WINSCARDAPI LONG WINAPI GetOpenCardNameW(LPOPENCARDNAMEW pDlgStruc); -WINSCARDAPI LONG WINAPI SCardDlgExtendedError(void); + WINSCARDAPI LONG WINAPI SCardDlgExtendedError(void); -WINSCARDAPI LONG WINAPI SCardReadCacheA(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, DWORD* DataLen); -WINSCARDAPI LONG WINAPI SCardReadCacheW(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD* DataLen); + WINSCARDAPI LONG WINAPI SCardReadCacheA(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, + DWORD* DataLen); + WINSCARDAPI LONG WINAPI SCardReadCacheW(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, + DWORD* DataLen); -WINSCARDAPI LONG WINAPI SCardWriteCacheA(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, DWORD DataLen); -WINSCARDAPI LONG WINAPI SCardWriteCacheW(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD DataLen); + WINSCARDAPI LONG WINAPI SCardWriteCacheA(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, + DWORD DataLen); + WINSCARDAPI LONG WINAPI SCardWriteCacheW(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, + DWORD DataLen); -WINSCARDAPI LONG WINAPI SCardGetReaderIconA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon); -WINSCARDAPI LONG WINAPI SCardGetReaderIconW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon); + WINSCARDAPI LONG WINAPI SCardGetReaderIconA(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPBYTE pbIcon, LPDWORD pcbIcon); + WINSCARDAPI LONG WINAPI SCardGetReaderIconW(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPBYTE pbIcon, LPDWORD pcbIcon); -WINSCARDAPI LONG WINAPI SCardGetDeviceTypeIdA(SCARDCONTEXT hContext, LPCSTR szReaderName, - LPDWORD pdwDeviceTypeId); -WINSCARDAPI LONG WINAPI SCardGetDeviceTypeIdW(SCARDCONTEXT hContext, LPCWSTR szReaderName, - LPDWORD pdwDeviceTypeId); + WINSCARDAPI LONG WINAPI SCardGetDeviceTypeIdA(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPDWORD pdwDeviceTypeId); + WINSCARDAPI LONG WINAPI SCardGetDeviceTypeIdW(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPDWORD pdwDeviceTypeId); -WINSCARDAPI LONG WINAPI SCardGetReaderDeviceInstanceIdA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId); -WINSCARDAPI LONG WINAPI SCardGetReaderDeviceInstanceIdW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPWSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId); + WINSCARDAPI LONG WINAPI SCardGetReaderDeviceInstanceIdA(SCARDCONTEXT hContext, + LPCSTR szReaderName, + LPSTR szDeviceInstanceId, + LPDWORD pcchDeviceInstanceId); + WINSCARDAPI LONG WINAPI SCardGetReaderDeviceInstanceIdW(SCARDCONTEXT hContext, + LPCWSTR szReaderName, + LPWSTR szDeviceInstanceId, + LPDWORD pcchDeviceInstanceId); -WINSCARDAPI LONG WINAPI SCardListReadersWithDeviceInstanceIdA(SCARDCONTEXT hContext, - LPCSTR szDeviceInstanceId, LPSTR mszReaders, LPDWORD pcchReaders); -WINSCARDAPI LONG WINAPI SCardListReadersWithDeviceInstanceIdW(SCARDCONTEXT hContext, - LPCWSTR szDeviceInstanceId, LPWSTR mszReaders, LPDWORD pcchReaders); + WINSCARDAPI LONG WINAPI SCardListReadersWithDeviceInstanceIdA(SCARDCONTEXT hContext, + LPCSTR szDeviceInstanceId, + LPSTR mszReaders, + LPDWORD pcchReaders); + WINSCARDAPI LONG WINAPI SCardListReadersWithDeviceInstanceIdW(SCARDCONTEXT hContext, + LPCWSTR szDeviceInstanceId, + LPWSTR mszReaders, + LPDWORD pcchReaders); -WINSCARDAPI LONG WINAPI SCardAudit(SCARDCONTEXT hContext, DWORD dwEvent); + WINSCARDAPI LONG WINAPI SCardAudit(SCARDCONTEXT hContext, DWORD dwEvent); #ifdef UNICODE -#define SCardListReaderGroups SCardListReaderGroupsW -#define SCardListReaders SCardListReadersW -#define SCardListCards SCardListCardsW -#define SCardListInterfaces SCardListInterfacesW -#define SCardGetProviderId SCardGetProviderIdW -#define SCardGetCardTypeProviderName SCardGetCardTypeProviderNameW -#define SCardIntroduceReaderGroup SCardIntroduceReaderGroupW -#define SCardForgetReaderGroup SCardForgetReaderGroupW -#define SCardIntroduceReader SCardIntroduceReaderW -#define SCardForgetReader SCardForgetReaderW -#define SCardAddReaderToGroup SCardAddReaderToGroupW -#define SCardRemoveReaderFromGroup SCardRemoveReaderFromGroupW -#define SCardIntroduceCardType SCardIntroduceCardTypeW -#define SCardSetCardTypeProviderName SCardSetCardTypeProviderNameW -#define SCardForgetCardType SCardForgetCardTypeW -#define SCardLocateCards SCardLocateCardsW -#define SCardLocateCardsByATR SCardLocateCardsByATRW -#define SCardGetStatusChange SCardGetStatusChangeW -#define SCardConnect SCardConnectW -#define SCardStatus SCardStatusW -#define SCardUIDlgSelectCard SCardUIDlgSelectCardW -#define GetOpenCardName GetOpenCardNameW -#define SCardReadCache SCardReadCacheW -#define SCardWriteCache SCardWriteCacheW -#define SCardGetReaderIcon SCardGetReaderIconW -#define SCardGetDeviceTypeId SCardGetDeviceTypeIdW -#define SCardGetReaderDeviceInstanceId SCardGetReaderDeviceInstanceIdW -#define SCardListReadersWithDeviceInstanceId SCardListReadersWithDeviceInstanceIdW +#define SCardListReaderGroups SCardListReaderGroupsW +#define SCardListReaders SCardListReadersW +#define SCardListCards SCardListCardsW +#define SCardListInterfaces SCardListInterfacesW +#define SCardGetProviderId SCardGetProviderIdW +#define SCardGetCardTypeProviderName SCardGetCardTypeProviderNameW +#define SCardIntroduceReaderGroup SCardIntroduceReaderGroupW +#define SCardForgetReaderGroup SCardForgetReaderGroupW +#define SCardIntroduceReader SCardIntroduceReaderW +#define SCardForgetReader SCardForgetReaderW +#define SCardAddReaderToGroup SCardAddReaderToGroupW +#define SCardRemoveReaderFromGroup SCardRemoveReaderFromGroupW +#define SCardIntroduceCardType SCardIntroduceCardTypeW +#define SCardSetCardTypeProviderName SCardSetCardTypeProviderNameW +#define SCardForgetCardType SCardForgetCardTypeW +#define SCardLocateCards SCardLocateCardsW +#define SCardLocateCardsByATR SCardLocateCardsByATRW +#define SCardGetStatusChange SCardGetStatusChangeW +#define SCardConnect SCardConnectW +#define SCardStatus SCardStatusW +#define SCardUIDlgSelectCard SCardUIDlgSelectCardW +#define GetOpenCardName GetOpenCardNameW +#define SCardReadCache SCardReadCacheW +#define SCardWriteCache SCardWriteCacheW +#define SCardGetReaderIcon SCardGetReaderIconW +#define SCardGetDeviceTypeId SCardGetDeviceTypeIdW +#define SCardGetReaderDeviceInstanceId SCardGetReaderDeviceInstanceIdW +#define SCardListReadersWithDeviceInstanceId SCardListReadersWithDeviceInstanceIdW #else -#define SCardListReaderGroups SCardListReaderGroupsA -#define SCardListReaders SCardListReadersA -#define SCardListCards SCardListCardsA -#define SCardListInterfaces SCardListInterfacesA -#define SCardGetProviderId SCardGetProviderIdA -#define SCardGetCardTypeProviderName SCardGetCardTypeProviderNameA -#define SCardIntroduceReaderGroup SCardIntroduceReaderGroupA -#define SCardForgetReaderGroup SCardForgetReaderGroupA -#define SCardIntroduceReader SCardIntroduceReaderA -#define SCardForgetReader SCardForgetReaderA -#define SCardAddReaderToGroup SCardAddReaderToGroupA -#define SCardRemoveReaderFromGroup SCardRemoveReaderFromGroupA -#define SCardIntroduceCardType SCardIntroduceCardTypeA -#define SCardSetCardTypeProviderName SCardSetCardTypeProviderNameA -#define SCardForgetCardType SCardForgetCardTypeA -#define SCardLocateCards SCardLocateCardsA -#define SCardLocateCardsByATR SCardLocateCardsByATRA -#define SCardGetStatusChange SCardGetStatusChangeA -#define SCardConnect SCardConnectA -#define SCardStatus SCardStatusA -#define SCardUIDlgSelectCard SCardUIDlgSelectCardA -#define GetOpenCardName GetOpenCardNameA -#define SCardReadCache SCardReadCacheA -#define SCardWriteCache SCardWriteCacheA -#define SCardGetReaderIcon SCardGetReaderIconA -#define SCardGetDeviceTypeId SCardGetDeviceTypeIdA -#define SCardGetReaderDeviceInstanceId SCardGetReaderDeviceInstanceIdA -#define SCardListReadersWithDeviceInstanceId SCardListReadersWithDeviceInstanceIdA +#define SCardListReaderGroups SCardListReaderGroupsA +#define SCardListReaders SCardListReadersA +#define SCardListCards SCardListCardsA +#define SCardListInterfaces SCardListInterfacesA +#define SCardGetProviderId SCardGetProviderIdA +#define SCardGetCardTypeProviderName SCardGetCardTypeProviderNameA +#define SCardIntroduceReaderGroup SCardIntroduceReaderGroupA +#define SCardForgetReaderGroup SCardForgetReaderGroupA +#define SCardIntroduceReader SCardIntroduceReaderA +#define SCardForgetReader SCardForgetReaderA +#define SCardAddReaderToGroup SCardAddReaderToGroupA +#define SCardRemoveReaderFromGroup SCardRemoveReaderFromGroupA +#define SCardIntroduceCardType SCardIntroduceCardTypeA +#define SCardSetCardTypeProviderName SCardSetCardTypeProviderNameA +#define SCardForgetCardType SCardForgetCardTypeA +#define SCardLocateCards SCardLocateCardsA +#define SCardLocateCardsByATR SCardLocateCardsByATRA +#define SCardGetStatusChange SCardGetStatusChangeA +#define SCardConnect SCardConnectA +#define SCardStatus SCardStatusA +#define SCardUIDlgSelectCard SCardUIDlgSelectCardA +#define GetOpenCardName GetOpenCardNameA +#define SCardReadCache SCardReadCacheA +#define SCardWriteCache SCardWriteCacheA +#define SCardGetReaderIcon SCardGetReaderIconA +#define SCardGetDeviceTypeId SCardGetDeviceTypeIdA +#define SCardGetReaderDeviceInstanceId SCardGetReaderDeviceInstanceIdA +#define SCardListReadersWithDeviceInstanceId SCardListReadersWithDeviceInstanceIdA #endif #ifdef __cplusplus @@ -857,45 +876,47 @@ WINSCARDAPI LONG WINAPI SCardAudit(SCARDCONTEXT hContext, DWORD dwEvent); * Extended API */ -typedef LONG(WINAPI* fnSCardEstablishContext)(DWORD dwScope, - LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext); +typedef LONG(WINAPI* fnSCardEstablishContext)(DWORD dwScope, LPCVOID pvReserved1, + LPCVOID pvReserved2, LPSCARDCONTEXT phContext); typedef LONG(WINAPI* fnSCardReleaseContext)(SCARDCONTEXT hContext); typedef LONG(WINAPI* fnSCardIsValidContext)(SCARDCONTEXT hContext); -typedef LONG(WINAPI* fnSCardListReaderGroupsA)(SCARDCONTEXT hContext, - LPSTR mszGroups, LPDWORD pcchGroups); -typedef LONG(WINAPI* fnSCardListReaderGroupsW)(SCARDCONTEXT hContext, - LPWSTR mszGroups, LPDWORD pcchGroups); +typedef LONG(WINAPI* fnSCardListReaderGroupsA)(SCARDCONTEXT hContext, LPSTR mszGroups, + LPDWORD pcchGroups); +typedef LONG(WINAPI* fnSCardListReaderGroupsW)(SCARDCONTEXT hContext, LPWSTR mszGroups, + LPDWORD pcchGroups); -typedef LONG(WINAPI* fnSCardListReadersA)(SCARDCONTEXT hContext, - LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders); -typedef LONG(WINAPI* fnSCardListReadersW)(SCARDCONTEXT hContext, - LPCWSTR mszGroups, LPWSTR mszReaders, LPDWORD pcchReaders); +typedef LONG(WINAPI* fnSCardListReadersA)(SCARDCONTEXT hContext, LPCSTR mszGroups, LPSTR mszReaders, + LPDWORD pcchReaders); +typedef LONG(WINAPI* fnSCardListReadersW)(SCARDCONTEXT hContext, LPCWSTR mszGroups, + LPWSTR mszReaders, LPDWORD pcchReaders); -typedef LONG(WINAPI* fnSCardListCardsA)(SCARDCONTEXT hContext, - LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, CHAR* mszCards, - LPDWORD pcchCards); +typedef LONG(WINAPI* fnSCardListCardsA)(SCARDCONTEXT hContext, LPCBYTE pbAtr, + LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, + CHAR* mszCards, LPDWORD pcchCards); -typedef LONG(WINAPI* fnSCardListCardsW)(SCARDCONTEXT hContext, - LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, WCHAR* mszCards, - LPDWORD pcchCards); +typedef LONG(WINAPI* fnSCardListCardsW)(SCARDCONTEXT hContext, LPCBYTE pbAtr, + LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, + WCHAR* mszCards, LPDWORD pcchCards); -typedef LONG(WINAPI* fnSCardListInterfacesA)(SCARDCONTEXT hContext, - LPCSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces); -typedef LONG(WINAPI* fnSCardListInterfacesW)(SCARDCONTEXT hContext, - LPCWSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces); +typedef LONG(WINAPI* fnSCardListInterfacesA)(SCARDCONTEXT hContext, LPCSTR szCard, + LPGUID pguidInterfaces, LPDWORD pcguidInterfaces); +typedef LONG(WINAPI* fnSCardListInterfacesW)(SCARDCONTEXT hContext, LPCWSTR szCard, + LPGUID pguidInterfaces, LPDWORD pcguidInterfaces); -typedef LONG(WINAPI* fnSCardGetProviderIdA)(SCARDCONTEXT hContext, - LPCSTR szCard, LPGUID pguidProviderId); -typedef LONG(WINAPI* fnSCardGetProviderIdW)(SCARDCONTEXT hContext, - LPCWSTR szCard, LPGUID pguidProviderId); +typedef LONG(WINAPI* fnSCardGetProviderIdA)(SCARDCONTEXT hContext, LPCSTR szCard, + LPGUID pguidProviderId); +typedef LONG(WINAPI* fnSCardGetProviderIdW)(SCARDCONTEXT hContext, LPCWSTR szCard, + LPGUID pguidProviderId); -typedef LONG(WINAPI* fnSCardGetCardTypeProviderNameA)(SCARDCONTEXT hContext, - LPCSTR szCardName, DWORD dwProviderId, CHAR* szProvider, LPDWORD pcchProvider); -typedef LONG(WINAPI* fnSCardGetCardTypeProviderNameW)(SCARDCONTEXT hContext, - LPCWSTR szCardName, DWORD dwProviderId, WCHAR* szProvider, LPDWORD pcchProvider); +typedef LONG(WINAPI* fnSCardGetCardTypeProviderNameA)(SCARDCONTEXT hContext, LPCSTR szCardName, + DWORD dwProviderId, CHAR* szProvider, + LPDWORD pcchProvider); +typedef LONG(WINAPI* fnSCardGetCardTypeProviderNameW)(SCARDCONTEXT hContext, LPCWSTR szCardName, + DWORD dwProviderId, WCHAR* szProvider, + LPDWORD pcchProvider); typedef LONG(WINAPI* fnSCardIntroduceReaderGroupA)(SCARDCONTEXT hContext, LPCSTR szGroupName); typedef LONG(WINAPI* fnSCardIntroduceReaderGroupW)(SCARDCONTEXT hContext, LPCWSTR szGroupName); @@ -903,35 +924,37 @@ typedef LONG(WINAPI* fnSCardIntroduceReaderGroupW)(SCARDCONTEXT hContext, LPCWST typedef LONG(WINAPI* fnSCardForgetReaderGroupA)(SCARDCONTEXT hContext, LPCSTR szGroupName); typedef LONG(WINAPI* fnSCardForgetReaderGroupW)(SCARDCONTEXT hContext, LPCWSTR szGroupName); -typedef LONG(WINAPI* fnSCardIntroduceReaderA)(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPCSTR szDeviceName); -typedef LONG(WINAPI* fnSCardIntroduceReaderW)(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPCWSTR szDeviceName); +typedef LONG(WINAPI* fnSCardIntroduceReaderA)(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPCSTR szDeviceName); +typedef LONG(WINAPI* fnSCardIntroduceReaderW)(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPCWSTR szDeviceName); typedef LONG(WINAPI* fnSCardForgetReaderA)(SCARDCONTEXT hContext, LPCSTR szReaderName); typedef LONG(WINAPI* fnSCardForgetReaderW)(SCARDCONTEXT hContext, LPCWSTR szReaderName); -typedef LONG(WINAPI* fnSCardAddReaderToGroupA)(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPCSTR szGroupName); -typedef LONG(WINAPI* fnSCardAddReaderToGroupW)(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPCWSTR szGroupName); +typedef LONG(WINAPI* fnSCardAddReaderToGroupA)(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPCSTR szGroupName); +typedef LONG(WINAPI* fnSCardAddReaderToGroupW)(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPCWSTR szGroupName); -typedef LONG(WINAPI* fnSCardRemoveReaderFromGroupA)(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPCSTR szGroupName); -typedef LONG(WINAPI* fnSCardRemoveReaderFromGroupW)(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPCWSTR szGroupName); +typedef LONG(WINAPI* fnSCardRemoveReaderFromGroupA)(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPCSTR szGroupName); +typedef LONG(WINAPI* fnSCardRemoveReaderFromGroupW)(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPCWSTR szGroupName); -typedef LONG(WINAPI* fnSCardIntroduceCardTypeA)(SCARDCONTEXT hContext, - LPCSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, - DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen); -typedef LONG(WINAPI* fnSCardIntroduceCardTypeW)(SCARDCONTEXT hContext, - LPCWSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, - DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen); +typedef LONG(WINAPI* fnSCardIntroduceCardTypeA)(SCARDCONTEXT hContext, LPCSTR szCardName, + LPCGUID pguidPrimaryProvider, + LPCGUID rgguidInterfaces, DWORD dwInterfaceCount, + LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen); +typedef LONG(WINAPI* fnSCardIntroduceCardTypeW)(SCARDCONTEXT hContext, LPCWSTR szCardName, + LPCGUID pguidPrimaryProvider, + LPCGUID rgguidInterfaces, DWORD dwInterfaceCount, + LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen); -typedef LONG(WINAPI* fnSCardSetCardTypeProviderNameA)(SCARDCONTEXT hContext, - LPCSTR szCardName, DWORD dwProviderId, LPCSTR szProvider); -typedef LONG(WINAPI* fnSCardSetCardTypeProviderNameW)(SCARDCONTEXT hContext, - LPCWSTR szCardName, DWORD dwProviderId, LPCWSTR szProvider); +typedef LONG(WINAPI* fnSCardSetCardTypeProviderNameA)(SCARDCONTEXT hContext, LPCSTR szCardName, + DWORD dwProviderId, LPCSTR szProvider); +typedef LONG(WINAPI* fnSCardSetCardTypeProviderNameW)(SCARDCONTEXT hContext, LPCWSTR szCardName, + DWORD dwProviderId, LPCWSTR szProvider); typedef LONG(WINAPI* fnSCardForgetCardTypeA)(SCARDCONTEXT hContext, LPCSTR szCardName); typedef LONG(WINAPI* fnSCardForgetCardTypeW)(SCARDCONTEXT hContext, LPCWSTR szCardName); @@ -940,34 +963,37 @@ typedef LONG(WINAPI* fnSCardFreeMemory)(SCARDCONTEXT hContext, LPCVOID pvMem); typedef HANDLE(WINAPI* fnSCardAccessStartedEvent)(void); -typedef void (WINAPI* fnSCardReleaseStartedEvent)(void); +typedef void(WINAPI* fnSCardReleaseStartedEvent)(void); -typedef LONG(WINAPI* fnSCardLocateCardsA)(SCARDCONTEXT hContext, - LPCSTR mszCards, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders); -typedef LONG(WINAPI* fnSCardLocateCardsW)(SCARDCONTEXT hContext, - LPCWSTR mszCards, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders); +typedef LONG(WINAPI* fnSCardLocateCardsA)(SCARDCONTEXT hContext, LPCSTR mszCards, + LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders); +typedef LONG(WINAPI* fnSCardLocateCardsW)(SCARDCONTEXT hContext, LPCWSTR mszCards, + LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders); -typedef LONG(WINAPI* fnSCardLocateCardsByATRA)(SCARDCONTEXT hContext, - LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders); -typedef LONG(WINAPI* fnSCardLocateCardsByATRW)(SCARDCONTEXT hContext, - LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders); +typedef LONG(WINAPI* fnSCardLocateCardsByATRA)(SCARDCONTEXT hContext, LPSCARD_ATRMASK rgAtrMasks, + DWORD cAtrs, LPSCARD_READERSTATEA rgReaderStates, + DWORD cReaders); +typedef LONG(WINAPI* fnSCardLocateCardsByATRW)(SCARDCONTEXT hContext, LPSCARD_ATRMASK rgAtrMasks, + DWORD cAtrs, LPSCARD_READERSTATEW rgReaderStates, + DWORD cReaders); -typedef LONG(WINAPI* fnSCardGetStatusChangeA)(SCARDCONTEXT hContext, - DWORD dwTimeout, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders); -typedef LONG(WINAPI* fnSCardGetStatusChangeW)(SCARDCONTEXT hContext, - DWORD dwTimeout, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders); +typedef LONG(WINAPI* fnSCardGetStatusChangeA)(SCARDCONTEXT hContext, DWORD dwTimeout, + LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders); +typedef LONG(WINAPI* fnSCardGetStatusChangeW)(SCARDCONTEXT hContext, DWORD dwTimeout, + LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders); typedef LONG(WINAPI* fnSCardCancel)(SCARDCONTEXT hContext); -typedef LONG(WINAPI* fnSCardConnectA)(SCARDCONTEXT hContext, - LPCSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, - LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol); -typedef LONG(WINAPI* fnSCardConnectW)(SCARDCONTEXT hContext, - LPCWSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, - LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol); +typedef LONG(WINAPI* fnSCardConnectA)(SCARDCONTEXT hContext, LPCSTR szReader, DWORD dwShareMode, + DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, + LPDWORD pdwActiveProtocol); +typedef LONG(WINAPI* fnSCardConnectW)(SCARDCONTEXT hContext, LPCWSTR szReader, DWORD dwShareMode, + DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, + LPDWORD pdwActiveProtocol); -typedef LONG(WINAPI* fnSCardReconnect)(SCARDHANDLE hCard, - DWORD dwShareMode, DWORD dwPreferredProtocols, DWORD dwInitialization, LPDWORD pdwActiveProtocol); +typedef LONG(WINAPI* fnSCardReconnect)(SCARDHANDLE hCard, DWORD dwShareMode, + DWORD dwPreferredProtocols, DWORD dwInitialization, + LPDWORD pdwActiveProtocol); typedef LONG(WINAPI* fnSCardDisconnect)(SCARDHANDLE hCard, DWORD dwDisposition); @@ -977,25 +1003,26 @@ typedef LONG(WINAPI* fnSCardEndTransaction)(SCARDHANDLE hCard, DWORD dwDispositi typedef LONG(WINAPI* fnSCardCancelTransaction)(SCARDHANDLE hCard); -typedef LONG(WINAPI* fnSCardState)(SCARDHANDLE hCard, - LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen); +typedef LONG(WINAPI* fnSCardState)(SCARDHANDLE hCard, LPDWORD pdwState, LPDWORD pdwProtocol, + LPBYTE pbAtr, LPDWORD pcbAtrLen); -typedef LONG(WINAPI* fnSCardStatusA)(SCARDHANDLE hCard, - LPSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState, - LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen); -typedef LONG(WINAPI* fnSCardStatusW)(SCARDHANDLE hCard, - LPWSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState, - LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen); +typedef LONG(WINAPI* fnSCardStatusA)(SCARDHANDLE hCard, LPSTR mszReaderNames, LPDWORD pcchReaderLen, + LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, + LPDWORD pcbAtrLen); +typedef LONG(WINAPI* fnSCardStatusW)(SCARDHANDLE hCard, LPWSTR mszReaderNames, + LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, + LPBYTE pbAtr, LPDWORD pcbAtrLen); -typedef LONG(WINAPI* fnSCardTransmit)(SCARDHANDLE hCard, - LPCSCARD_IO_REQUEST pioSendPci, LPCBYTE pbSendBuffer, DWORD cbSendLength, - LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength); +typedef LONG(WINAPI* fnSCardTransmit)(SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pioSendPci, + LPCBYTE pbSendBuffer, DWORD cbSendLength, + LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, + LPDWORD pcbRecvLength); typedef LONG(WINAPI* fnSCardGetTransmitCount)(SCARDHANDLE hCard, LPDWORD pcTransmitCount); -typedef LONG(WINAPI* fnSCardControl)(SCARDHANDLE hCard, - DWORD dwControlCode, LPCVOID lpInBuffer, DWORD cbInBufferSize, - LPVOID lpOutBuffer, DWORD cbOutBufferSize, LPDWORD lpBytesReturned); +typedef LONG(WINAPI* fnSCardControl)(SCARDHANDLE hCard, DWORD dwControlCode, LPCVOID lpInBuffer, + DWORD cbInBufferSize, LPVOID lpOutBuffer, + DWORD cbOutBufferSize, LPDWORD lpBytesReturned); typedef LONG(WINAPI* fnSCardGetAttrib)(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, LPDWORD pcbAttrLen); @@ -1011,35 +1038,45 @@ typedef LONG(WINAPI* fnGetOpenCardNameW)(LPOPENCARDNAMEW pDlgStruc); typedef LONG(WINAPI* fnSCardDlgExtendedError)(void); -typedef LONG(WINAPI* fnSCardReadCacheA)(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, DWORD* DataLen); -typedef LONG(WINAPI* fnSCardReadCacheW)(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD* DataLen); +typedef LONG(WINAPI* fnSCardReadCacheA)(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, + DWORD* DataLen); +typedef LONG(WINAPI* fnSCardReadCacheW)(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, + DWORD* DataLen); -typedef LONG(WINAPI* fnSCardWriteCacheA)(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, DWORD DataLen); -typedef LONG(WINAPI* fnSCardWriteCacheW)(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD DataLen); +typedef LONG(WINAPI* fnSCardWriteCacheA)(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, + DWORD DataLen); +typedef LONG(WINAPI* fnSCardWriteCacheW)(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, + DWORD DataLen); -typedef LONG(WINAPI* fnSCardGetReaderIconA)(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon); -typedef LONG(WINAPI* fnSCardGetReaderIconW)(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon); +typedef LONG(WINAPI* fnSCardGetReaderIconA)(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPBYTE pbIcon, LPDWORD pcbIcon); +typedef LONG(WINAPI* fnSCardGetReaderIconW)(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPBYTE pbIcon, LPDWORD pcbIcon); typedef LONG(WINAPI* fnSCardGetDeviceTypeIdA)(SCARDCONTEXT hContext, LPCSTR szReaderName, - LPDWORD pdwDeviceTypeId); + LPDWORD pdwDeviceTypeId); typedef LONG(WINAPI* fnSCardGetDeviceTypeIdW)(SCARDCONTEXT hContext, LPCWSTR szReaderName, - LPDWORD pdwDeviceTypeId); + LPDWORD pdwDeviceTypeId); -typedef LONG(WINAPI* fnSCardGetReaderDeviceInstanceIdA)(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId); -typedef LONG(WINAPI* fnSCardGetReaderDeviceInstanceIdW)(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPWSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId); +typedef LONG(WINAPI* fnSCardGetReaderDeviceInstanceIdA)(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPSTR szDeviceInstanceId, + LPDWORD pcchDeviceInstanceId); +typedef LONG(WINAPI* fnSCardGetReaderDeviceInstanceIdW)(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPWSTR szDeviceInstanceId, + LPDWORD pcchDeviceInstanceId); typedef LONG(WINAPI* fnSCardListReadersWithDeviceInstanceIdA)(SCARDCONTEXT hContext, - LPCSTR szDeviceInstanceId, LPSTR mszReaders, LPDWORD pcchReaders); + LPCSTR szDeviceInstanceId, + LPSTR mszReaders, + LPDWORD pcchReaders); typedef LONG(WINAPI* fnSCardListReadersWithDeviceInstanceIdW)(SCARDCONTEXT hContext, - LPCWSTR szDeviceInstanceId, LPWSTR mszReaders, LPDWORD pcchReaders); + LPCWSTR szDeviceInstanceId, + LPWSTR mszReaders, + LPDWORD pcchReaders); typedef LONG(WINAPI* fnSCardAudit)(SCARDCONTEXT hContext, DWORD dwEvent); @@ -1130,21 +1167,21 @@ typedef struct _SCardApiFunctionTable SCardApiFunctionTable; typedef SCardApiFunctionTable* PSCardApiFunctionTable; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINSCARDAPI const char* WINAPI SCardGetErrorString(LONG errorCode); -WINSCARDAPI const char* WINAPI SCardGetAttributeString(DWORD dwAttrId); -WINSCARDAPI const char* WINAPI SCardGetProtocolString(DWORD dwProtocols); -WINSCARDAPI const char* WINAPI SCardGetShareModeString(DWORD dwShareMode); -WINSCARDAPI const char* WINAPI SCardGetDispositionString(DWORD dwDisposition); -WINSCARDAPI const char* WINAPI SCardGetScopeString(DWORD dwScope); -WINSCARDAPI const char* WINAPI SCardGetCardStateString(DWORD dwCardState); -WINSCARDAPI char* WINAPI SCardGetReaderStateString(DWORD dwReaderState); + WINSCARDAPI const char* WINAPI SCardGetErrorString(LONG errorCode); + WINSCARDAPI const char* WINAPI SCardGetAttributeString(DWORD dwAttrId); + WINSCARDAPI const char* WINAPI SCardGetProtocolString(DWORD dwProtocols); + WINSCARDAPI const char* WINAPI SCardGetShareModeString(DWORD dwShareMode); + WINSCARDAPI const char* WINAPI SCardGetDispositionString(DWORD dwDisposition); + WINSCARDAPI const char* WINAPI SCardGetScopeString(DWORD dwScope); + WINSCARDAPI const char* WINAPI SCardGetCardStateString(DWORD dwCardState); + WINSCARDAPI char* WINAPI SCardGetReaderStateString(DWORD dwReaderState); #ifdef __cplusplus } #endif #endif /* WINPR_SMARTCARD_H */ - diff --git a/winpr/include/winpr/spec.h b/winpr/include/winpr/spec.h index d86d91c7e..d07b77d29 100644 --- a/winpr/include/winpr/spec.h +++ b/winpr/include/winpr/spec.h @@ -32,14 +32,14 @@ #else #define DUMMYUNIONNAME u -#define DUMMYUNIONNAME1 u1 -#define DUMMYUNIONNAME2 u2 -#define DUMMYUNIONNAME3 u3 -#define DUMMYUNIONNAME4 u4 -#define DUMMYUNIONNAME5 u5 -#define DUMMYUNIONNAME6 u6 -#define DUMMYUNIONNAME7 u7 -#define DUMMYUNIONNAME8 u8 +#define DUMMYUNIONNAME1 u1 +#define DUMMYUNIONNAME2 u2 +#define DUMMYUNIONNAME3 u3 +#define DUMMYUNIONNAME4 u4 +#define DUMMYUNIONNAME5 u5 +#define DUMMYUNIONNAME6 u6 +#define DUMMYUNIONNAME7 u7 +#define DUMMYUNIONNAME8 u8 #define DUMMYSTRUCTNAME s #define DUMMYSTRUCTNAME1 s1 @@ -58,7 +58,7 @@ #if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS) #define DECLSPEC_ALIGN(x) __declspec(align(x)) #elif defined(__GNUC__) -#define DECLSPEC_ALIGN(x) __attribute__ ((__aligned__ (x))) +#define DECLSPEC_ALIGN(x) __attribute__((__aligned__(x))) #else #define DECLSPEC_ALIGN(x) #endif @@ -105,8 +105,8 @@ #define __deref_opt_in_opt #define __deref_opt_in_ecount_opt(size) #define __deref_opt_in_bcount_opt(size) -#define __out_awcount(expr,size) -#define __in_awcount(expr,size) +#define __out_awcount(expr, size) +#define __in_awcount(expr, size) #define __nullnullterminated #define __in_data_source(src_sym) #define __kernel_entry @@ -129,7 +129,7 @@ #define _COM_Outptr_result_maybenull_ #define _Const_ #define _Deref_in_bound_ -#define _Deref_in_range_(lb,ub) +#define _Deref_in_range_(lb, ub) #define _Deref_inout_bound_ #define _Deref_inout_z_ #define _Deref_inout_z_bytecap_c_(size) @@ -142,7 +142,7 @@ #define _Deref_out_bound_ #define _Deref_out_opt_ #define _Deref_out_opt_z_ -#define _Deref_out_range_(lb,ub) +#define _Deref_out_range_(lb, ub) #define _Deref_out_z_ #define _Deref_out_z_bytecap_c_(size) #define _Deref_out_z_cap_c_(size) @@ -293,10 +293,10 @@ #define _Deref_prepost_z_cap_(size) #define _Deref_ret_bound_ #define _Deref_ret_opt_z_ -#define _Deref_ret_range_(lb,ub) +#define _Deref_ret_range_(lb, ub) #define _Deref_ret_z_ #define _Deref2_pre_readonly_ -#define _Field_range_(min,max) +#define _Field_range_(min, max) #define _Field_size_(size) #define _Field_size_bytes_(size) #define _Field_size_bytes_full_(size) @@ -335,7 +335,7 @@ #define _In_opt_z_count_(size) #define _In_opt_z_count_c_(size) #define _In_ptrdiff_count_(size) -#define _In_range_(lb,ub) +#define _In_range_(lb, ub) #define _In_reads_(size) #define _In_reads_bytes_(size) #define _In_reads_bytes_opt_(size) @@ -399,12 +399,12 @@ #define _Inout_updates_bytes_all_(size) #define _Inout_updates_bytes_all_opt_(size) #define _Inout_updates_bytes_opt_(size) -#define _Inout_updates_bytes_to_(size,count) -#define _Inout_updates_bytes_to_opt_(size,count) +#define _Inout_updates_bytes_to_(size, count) +#define _Inout_updates_bytes_to_opt_(size, count) #define _Inout_updates_opt_(size) #define _Inout_updates_opt_z_(size) -#define _Inout_updates_to_(size,count) -#define _Inout_updates_to_opt_(size,count) +#define _Inout_updates_to_(size, count) +#define _Inout_updates_to_opt_(size, count) #define _Inout_updates_z_(size) #define _Inout_z_ #define _Inout_z_bytecap_(size) @@ -435,14 +435,14 @@ #define _Out_bound_ #define _Out_bytecap_(size) #define _Out_bytecap_c_(size) -#define _Out_bytecap_post_bytecount_(cap,count) +#define _Out_bytecap_post_bytecount_(cap, count) #define _Out_bytecap_x_(size) #define _Out_bytecapcount_(capcount) #define _Out_bytecapcount_x_(capcount) #define _Out_cap_(size) #define _Out_cap_c_(size) -#define _Out_cap_m_(mult,size) -#define _Out_cap_post_count_(cap,count) +#define _Out_cap_m_(mult, size) +#define _Out_cap_post_count_(cap, count) #define _Out_cap_x_(size) #define _Out_capcount_(capcount) #define _Out_capcount_x_(capcount) @@ -450,31 +450,31 @@ #define _Out_opt_ #define _Out_opt_bytecap_(size) #define _Out_opt_bytecap_c_(size) -#define _Out_opt_bytecap_post_bytecount_(cap,count) +#define _Out_opt_bytecap_post_bytecount_(cap, count) #define _Out_opt_bytecap_x_(size) #define _Out_opt_bytecapcount_(capcount) #define _Out_opt_bytecapcount_x_(capcount) #define _Out_opt_cap_(size) #define _Out_opt_cap_c_(size) -#define _Out_opt_cap_m_(mult,size) -#define _Out_opt_cap_post_count_(cap,count) +#define _Out_opt_cap_m_(mult, size) +#define _Out_opt_cap_post_count_(cap, count) #define _Out_opt_cap_x_(size) #define _Out_opt_capcount_(capcount) #define _Out_opt_capcount_x_(capcount) #define _Out_opt_ptrdiff_cap_(size) #define _Out_opt_z_bytecap_(size) #define _Out_opt_z_bytecap_c_(size) -#define _Out_opt_z_bytecap_post_bytecount_(cap,count) +#define _Out_opt_z_bytecap_post_bytecount_(cap, count) #define _Out_opt_z_bytecap_x_(size) #define _Out_opt_z_bytecapcount_(capcount) #define _Out_opt_z_cap_(size) #define _Out_opt_z_cap_c_(size) -#define _Out_opt_z_cap_m_(mult,size) -#define _Out_opt_z_cap_post_count_(cap,count) +#define _Out_opt_z_cap_m_(mult, size) +#define _Out_opt_z_cap_post_count_(cap, count) #define _Out_opt_z_cap_x_(size) #define _Out_opt_z_capcount_(capcount) #define _Out_ptrdiff_cap_(size) -#define _Out_range_(lb,ub) +#define _Out_range_(lb, ub) #define _Out_writes_(size) #define _Out_writes_all_(size) #define _Out_writes_all_opt_(size) @@ -482,12 +482,12 @@ #define _Out_writes_bytes_all_(size) #define _Out_writes_bytes_all_opt_(size) #define _Out_writes_bytes_opt_(size) -#define _Out_writes_bytes_to_(size,count) -#define _Out_writes_bytes_to_opt_(size,count) +#define _Out_writes_bytes_to_(size, count) +#define _Out_writes_bytes_to_opt_(size, count) #define _Out_writes_opt_(size) #define _Out_writes_opt_z_(size) -#define _Out_writes_to_(size,count) -#define _Out_writes_to_opt_(size,count) +#define _Out_writes_to_(size, count) +#define _Out_writes_to_opt_(size, count) #define _Out_writes_to_ptr_(ptr) #define _Out_writes_to_ptr_opt_(ptr) #define _Out_writes_to_ptr_opt_z_(ptr) @@ -495,13 +495,13 @@ #define _Out_writes_z_(size) #define _Out_z_bytecap_(size) #define _Out_z_bytecap_c_(size) -#define _Out_z_bytecap_post_bytecount_(cap,count) +#define _Out_z_bytecap_post_bytecount_(cap, count) #define _Out_z_bytecap_x_(size) #define _Out_z_bytecapcount_(capcount) #define _Out_z_cap_(size) #define _Out_z_cap_c_(size) -#define _Out_z_cap_m_(mult,size) -#define _Out_z_cap_post_count_(cap,count) +#define _Out_z_cap_m_(mult, size) +#define _Out_z_cap_post_count_(cap, count) #define _Out_z_cap_x_(size) #define _Out_z_capcount_(capcount) #define _Outptr_ @@ -595,7 +595,7 @@ #define _Pre_cap_c_(size) #define _Pre_cap_c_one_ #define _Pre_cap_for_(param) -#define _Pre_cap_m_(mult,size) +#define _Pre_cap_m_(mult, size) #define _Pre_cap_x_(size) #define _Pre_count_(size) #define _Pre_count_c_(size) @@ -616,7 +616,7 @@ #define _Pre_opt_cap_c_(size) #define _Pre_opt_cap_c_one_ #define _Pre_opt_cap_for_(param) -#define _Pre_opt_cap_m_(mult,size) +#define _Pre_opt_cap_m_(mult, size) #define _Pre_opt_cap_x_(size) #define _Pre_opt_count_(size) #define _Pre_opt_count_c_(size) @@ -723,17 +723,17 @@ #define _Ret_opt_z_bytecount_(size) #define _Ret_opt_z_cap_(size) #define _Ret_opt_z_count_(size) -#define _Ret_range_(lb,ub) +#define _Ret_range_(lb, ub) #define _Ret_valid_ #define _Ret_writes_(size) #define _Ret_writes_bytes_(size) #define _Ret_writes_bytes_maybenull_(size) -#define _Ret_writes_bytes_to_(size,count) -#define _Ret_writes_bytes_to_maybenull_(size,count) +#define _Ret_writes_bytes_to_(size, count) +#define _Ret_writes_bytes_to_maybenull_(size, count) #define _Ret_writes_maybenull_(size) #define _Ret_writes_maybenull_z_(size) -#define _Ret_writes_to_(size,count) -#define _Ret_writes_to_maybenull_(size,count) +#define _Ret_writes_to_(size, count) +#define _Ret_writes_to_maybenull_(size, count) #define _Ret_writes_z_(size) #define _Ret_z_ #define _Ret_z_bytecap_(size) @@ -752,7 +752,6 @@ #define _Writable_bytes_(size) #define _Writable_elements_(size) - #define __bcount(size) #define __bcount_opt(size) #define __deref_bcount(size) @@ -770,14 +769,14 @@ #define __deref_inout_bcount_full(size) #define __deref_inout_bcount_full_opt(size) #define __deref_inout_bcount_opt(size) -#define __deref_inout_bcount_part(size,length) -#define __deref_inout_bcount_part_opt(size,length) +#define __deref_inout_bcount_part(size, length) +#define __deref_inout_bcount_part_opt(size, length) #define __deref_inout_ecount(size) #define __deref_inout_ecount_full(size) #define __deref_inout_ecount_full_opt(size) #define __deref_inout_ecount_opt(size) -#define __deref_inout_ecount_part(size,length) -#define __deref_inout_ecount_part_opt(size,length) +#define __deref_inout_ecount_part(size, length) +#define __deref_inout_ecount_part_opt(size, length) #define __deref_inout_opt #define __deref_opt_bcount(size) #define __deref_opt_bcount_opt(size) @@ -794,42 +793,42 @@ #define __deref_opt_inout_bcount_full(size) #define __deref_opt_inout_bcount_full_opt(size) #define __deref_opt_inout_bcount_opt(size) -#define __deref_opt_inout_bcount_part(size,length) -#define __deref_opt_inout_bcount_part_opt(size,length) +#define __deref_opt_inout_bcount_part(size, length) +#define __deref_opt_inout_bcount_part_opt(size, length) #define __deref_opt_inout_ecount(size) #define __deref_opt_inout_ecount_full(size) #define __deref_opt_inout_ecount_full_opt(size) #define __deref_opt_inout_ecount_opt(size) -#define __deref_opt_inout_ecount_part(size,length) -#define __deref_opt_inout_ecount_part_opt(size,length) +#define __deref_opt_inout_ecount_part(size, length) +#define __deref_opt_inout_ecount_part_opt(size, length) #define __deref_opt_inout_opt #define __deref_opt_out #define __deref_opt_out_bcount(size) #define __deref_opt_out_bcount_full(size) #define __deref_opt_out_bcount_full_opt(size) #define __deref_opt_out_bcount_opt(size) -#define __deref_opt_out_bcount_part(size,length) -#define __deref_opt_out_bcount_part_opt(size,length) +#define __deref_opt_out_bcount_part(size, length) +#define __deref_opt_out_bcount_part_opt(size, length) #define __deref_opt_out_ecount(size) #define __deref_opt_out_ecount_full(size) #define __deref_opt_out_ecount_full_opt(size) #define __deref_opt_out_ecount_opt(size) -#define __deref_opt_out_ecount_part(size,length) -#define __deref_opt_out_ecount_part_opt(size,length) +#define __deref_opt_out_ecount_part(size, length) +#define __deref_opt_out_ecount_part_opt(size, length) #define __deref_opt_out_opt #define __deref_out #define __deref_out_bcount(size) #define __deref_out_bcount_full(size) #define __deref_out_bcount_full_opt(size) #define __deref_out_bcount_opt(size) -#define __deref_out_bcount_part(size,length) -#define __deref_out_bcount_part_opt(size,length) +#define __deref_out_bcount_part(size, length) +#define __deref_out_bcount_part_opt(size, length) #define __deref_out_ecount(size) #define __deref_out_ecount_full(size) #define __deref_out_ecount_full_opt(size) #define __deref_out_ecount_opt(size) -#define __deref_out_ecount_part(size,length) -#define __deref_out_ecount_part_opt(size,length) +#define __deref_out_ecount_part(size, length) +#define __deref_out_ecount_part_opt(size, length) #define __deref_out_opt #define __ecount(size) #define __ecount_opt(size) @@ -844,38 +843,38 @@ #define __inout_bcount_full(size) #define __inout_bcount_full_opt(size) #define __inout_bcount_opt(size) -#define __inout_bcount_part(size,length) -#define __inout_bcount_part_opt(size,length) +#define __inout_bcount_part(size, length) +#define __inout_bcount_part_opt(size, length) #define __inout_ecount(size) #define __inout_ecount_full(size) #define __inout_ecount_full_opt(size) #define __inout_ecount_opt(size) -#define __inout_ecount_part(size,length) -#define __inout_ecount_part_opt(size,length) +#define __inout_ecount_part(size, length) +#define __inout_ecount_part_opt(size, length) #define __inout_opt //#define __out /* Conflicts with libstdc++ header macros */ #define __out_bcount(size) #define __out_bcount_full(size) #define __out_bcount_full_opt(size) #define __out_bcount_opt(size) -#define __out_bcount_part(size,length) -#define __out_bcount_part_opt(size,length) +#define __out_bcount_part(size, length) +#define __out_bcount_part_opt(size, length) #define __out_ecount(size) #define __out_ecount_full(size) #define __out_ecount_full_opt(size) #define __out_ecount_opt(size) -#define __out_ecount_part(size,length) -#define __out_ecount_part_opt(size,length) +#define __out_ecount_part(size, length) +#define __out_ecount_part_opt(size, length) #define __out_opt #define __blocksOn(resource) #define __callback #define __checkReturn #define __format_string -#define __in_awcount(expr,size) +#define __in_awcount(expr, size) #define __nullnullterminated #define __nullterminated -#define __out_awcount(expr,size) +#define __out_awcount(expr, size) #define __override //#define __reserved /* Conflicts with header included by CarbonCore.h on OS X */ #define __success(expr) @@ -885,9 +884,10 @@ #ifndef __cplusplus #define _countof(_Array) (sizeof(_Array) / sizeof(_Array[0])) #else -extern "C++" { -template -char (*__countof_helper(_CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray]; +extern "C++" +{ + template + char (*__countof_helper(_CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray]; #define _countof(_Array) sizeof(*__countof_helper(_Array)) } #endif @@ -897,32 +897,32 @@ char (*__countof_helper(_CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray]; * RTL Definitions */ -#define MINCHAR 0x80 -#define MAXCHAR 0x7F +#define MINCHAR 0x80 +#define MAXCHAR 0x7F #ifndef MINSHORT -#define MINSHORT 0x8000 +#define MINSHORT 0x8000 #endif #ifndef MAXSHORT -#define MAXSHORT 0x7FFF +#define MAXSHORT 0x7FFF #endif -#define MINLONG 0x80000000 -#define MAXLONG 0x7FFFFFFF -#define MAXBYTE 0xFF -#define MAXWORD 0xFFFF -#define MAXDWORD 0xFFFFFFFF +#define MINLONG 0x80000000 +#define MAXLONG 0x7FFFFFFF +#define MAXBYTE 0xFF +#define MAXWORD 0xFFFF +#define MAXDWORD 0xFFFFFFFF -#define FIELD_OFFSET(type, field) ((LONG)(LONG_PTR)&(((type *)0)->field)) +#define FIELD_OFFSET(type, field) ((LONG)(LONG_PTR) & (((type*)0)->field)) -#define RTL_FIELD_SIZE(type, field) (sizeof(((type *)0)->field)) +#define RTL_FIELD_SIZE(type, field) (sizeof(((type*)0)->field)) #define RTL_SIZEOF_THROUGH_FIELD(type, field) \ (FIELD_OFFSET(type, field) + RTL_FIELD_SIZE(type, field)) #define RTL_CONTAINS_FIELD(Struct, Size, Field) \ - ((((PCHAR)(&(Struct)->Field)) + sizeof((Struct)->Field)) <= (((PCHAR)(Struct))+(Size))) + ((((PCHAR)(&(Struct)->Field)) + sizeof((Struct)->Field)) <= (((PCHAR)(Struct)) + (Size))) #define RTL_NUMBER_OF_V1(A) (sizeof(A) / sizeof((A)[0])) #define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A) @@ -936,10 +936,10 @@ char (*__countof_helper(_CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray]; #define RTL_NUMBER_OF_FIELD(type, field) (RTL_NUMBER_OF(RTL_FIELD_TYPE(type, field))) -#define RTL_PADDING_BETWEEN_FIELDS(T, F1, F2) \ - ((FIELD_OFFSET(T, F2) > FIELD_OFFSET(T, F1)) \ - ? (FIELD_OFFSET(T, F2) - FIELD_OFFSET(T, F1) - RTL_FIELD_SIZE(T, F1)) \ - : (FIELD_OFFSET(T, F1) - FIELD_OFFSET(T, F2) - RTL_FIELD_SIZE(T, F2))) +#define RTL_PADDING_BETWEEN_FIELDS(T, F1, F2) \ + ((FIELD_OFFSET(T, F2) > FIELD_OFFSET(T, F1)) \ + ? (FIELD_OFFSET(T, F2) - FIELD_OFFSET(T, F1) - RTL_FIELD_SIZE(T, F1)) \ + : (FIELD_OFFSET(T, F1) - FIELD_OFFSET(T, F2) - RTL_FIELD_SIZE(T, F2))) #if defined(__cplusplus) #define RTL_CONST_CAST(type) const_cast @@ -952,27 +952,26 @@ char (*__countof_helper(_CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray]; #define RTL_BITS_OF_FIELD(type, field) (RTL_BITS_OF(RTL_FIELD_TYPE(type, field))) #define CONTAINING_RECORD(address, type, field) \ - ((type *)((PCHAR)(address) - (ULONG_PTR)(&((type *)0)->field))) + ((type*)((PCHAR)(address) - (ULONG_PTR)(&((type*)0)->field))) #endif #if defined(_WIN32) || defined(__CYGWIN__) - #ifdef __GNUC__ - #define DECLSPEC_EXPORT __attribute__((dllexport)) - #define DECLSPEC_IMPORT __attribute__((dllimport)) - #else - #define DECLSPEC_EXPORT __declspec(dllexport) - #define DECLSPEC_IMPORT __declspec(dllimport) - #endif +#ifdef __GNUC__ +#define DECLSPEC_EXPORT __attribute__((dllexport)) +#define DECLSPEC_IMPORT __attribute__((dllimport)) #else - #if defined(__GNUC__) && __GNUC__ >= 4 - #define DECLSPEC_EXPORT __attribute__ ((visibility("default"))) - #define DECLSPEC_IMPORT - #else - #define DECLSPEC_EXPORT - #define DECLSPEC_IMPORT - #endif +#define DECLSPEC_EXPORT __declspec(dllexport) +#define DECLSPEC_IMPORT __declspec(dllimport) +#endif +#else +#if defined(__GNUC__) && __GNUC__ >= 4 +#define DECLSPEC_EXPORT __attribute__((visibility("default"))) +#define DECLSPEC_IMPORT +#else +#define DECLSPEC_EXPORT +#define DECLSPEC_IMPORT +#endif #endif #endif /* WINPR_SPEC_H */ - diff --git a/winpr/include/winpr/ssl.h b/winpr/include/winpr/ssl.h index 0ff6b74c8..942a062ed 100644 --- a/winpr/include/winpr/ssl.h +++ b/winpr/include/winpr/ssl.h @@ -31,18 +31,18 @@ #define WINPR_SSL_CLEANUP_GLOBAL 0x01 #define WINPR_SSL_CLEANUP_THREAD 0x02 -#ifdef __cplusplus -extern "C" { +#ifdef __cplusplus +extern "C" +{ #endif -WINPR_API BOOL winpr_InitializeSSL(DWORD flags); -WINPR_API BOOL winpr_CleanupSSL(DWORD flags); + WINPR_API BOOL winpr_InitializeSSL(DWORD flags); + WINPR_API BOOL winpr_CleanupSSL(DWORD flags); -WINPR_API BOOL winpr_FIPSMode(void); + WINPR_API BOOL winpr_FIPSMode(void); -#ifdef __cplusplus +#ifdef __cplusplus } #endif -#endif /* WINPR_SSL_H */ - +#endif /* WINPR_SSL_H */ diff --git a/winpr/include/winpr/sspi.h b/winpr/include/winpr/sspi.h index b4d1375e0..9c3b55cc3 100644 --- a/winpr/include/winpr/sspi.h +++ b/winpr/include/winpr/sspi.h @@ -94,167 +94,167 @@ typedef SecPkgInfoW* PSecPkgInfoW; #endif -#define NTLM_SSP_NAME _T("NTLM") -#define KERBEROS_SSP_NAME _T("Kerberos") -#define NEGO_SSP_NAME _T("Negotiate") +#define NTLM_SSP_NAME _T("NTLM") +#define KERBEROS_SSP_NAME _T("Kerberos") +#define NEGO_SSP_NAME _T("Negotiate") -#define SECPKG_ID_NONE 0xFFFF +#define SECPKG_ID_NONE 0xFFFF -#define SECPKG_FLAG_INTEGRITY 0x00000001 -#define SECPKG_FLAG_PRIVACY 0x00000002 -#define SECPKG_FLAG_TOKEN_ONLY 0x00000004 -#define SECPKG_FLAG_DATAGRAM 0x00000008 -#define SECPKG_FLAG_CONNECTION 0x00000010 -#define SECPKG_FLAG_MULTI_REQUIRED 0x00000020 -#define SECPKG_FLAG_CLIENT_ONLY 0x00000040 -#define SECPKG_FLAG_EXTENDED_ERROR 0x00000080 -#define SECPKG_FLAG_IMPERSONATION 0x00000100 -#define SECPKG_FLAG_ACCEPT_WIN32_NAME 0x00000200 -#define SECPKG_FLAG_STREAM 0x00000400 -#define SECPKG_FLAG_NEGOTIABLE 0x00000800 -#define SECPKG_FLAG_GSS_COMPATIBLE 0x00001000 -#define SECPKG_FLAG_LOGON 0x00002000 -#define SECPKG_FLAG_ASCII_BUFFERS 0x00004000 -#define SECPKG_FLAG_FRAGMENT 0x00008000 -#define SECPKG_FLAG_MUTUAL_AUTH 0x00010000 -#define SECPKG_FLAG_DELEGATION 0x00020000 -#define SECPKG_FLAG_READONLY_WITH_CHECKSUM 0x00040000 -#define SECPKG_FLAG_RESTRICTED_TOKENS 0x00080000 -#define SECPKG_FLAG_NEGO_EXTENDER 0x00100000 -#define SECPKG_FLAG_NEGOTIABLE2 0x00200000 +#define SECPKG_FLAG_INTEGRITY 0x00000001 +#define SECPKG_FLAG_PRIVACY 0x00000002 +#define SECPKG_FLAG_TOKEN_ONLY 0x00000004 +#define SECPKG_FLAG_DATAGRAM 0x00000008 +#define SECPKG_FLAG_CONNECTION 0x00000010 +#define SECPKG_FLAG_MULTI_REQUIRED 0x00000020 +#define SECPKG_FLAG_CLIENT_ONLY 0x00000040 +#define SECPKG_FLAG_EXTENDED_ERROR 0x00000080 +#define SECPKG_FLAG_IMPERSONATION 0x00000100 +#define SECPKG_FLAG_ACCEPT_WIN32_NAME 0x00000200 +#define SECPKG_FLAG_STREAM 0x00000400 +#define SECPKG_FLAG_NEGOTIABLE 0x00000800 +#define SECPKG_FLAG_GSS_COMPATIBLE 0x00001000 +#define SECPKG_FLAG_LOGON 0x00002000 +#define SECPKG_FLAG_ASCII_BUFFERS 0x00004000 +#define SECPKG_FLAG_FRAGMENT 0x00008000 +#define SECPKG_FLAG_MUTUAL_AUTH 0x00010000 +#define SECPKG_FLAG_DELEGATION 0x00020000 +#define SECPKG_FLAG_READONLY_WITH_CHECKSUM 0x00040000 +#define SECPKG_FLAG_RESTRICTED_TOKENS 0x00080000 +#define SECPKG_FLAG_NEGO_EXTENDER 0x00100000 +#define SECPKG_FLAG_NEGOTIABLE2 0x00200000 #ifndef _WINERROR_ -#define SEC_E_OK (SECURITY_STATUS)0x00000000L -#define SEC_E_INSUFFICIENT_MEMORY (SECURITY_STATUS)0x80090300L -#define SEC_E_INVALID_HANDLE (SECURITY_STATUS)0x80090301L -#define SEC_E_UNSUPPORTED_FUNCTION (SECURITY_STATUS)0x80090302L -#define SEC_E_TARGET_UNKNOWN (SECURITY_STATUS)0x80090303L -#define SEC_E_INTERNAL_ERROR (SECURITY_STATUS)0x80090304L -#define SEC_E_SECPKG_NOT_FOUND (SECURITY_STATUS)0x80090305L -#define SEC_E_NOT_OWNER (SECURITY_STATUS)0x80090306L -#define SEC_E_CANNOT_INSTALL (SECURITY_STATUS)0x80090307L -#define SEC_E_INVALID_TOKEN (SECURITY_STATUS)0x80090308L -#define SEC_E_CANNOT_PACK (SECURITY_STATUS)0x80090309L -#define SEC_E_QOP_NOT_SUPPORTED (SECURITY_STATUS)0x8009030AL -#define SEC_E_NO_IMPERSONATION (SECURITY_STATUS)0x8009030BL -#define SEC_E_LOGON_DENIED (SECURITY_STATUS)0x8009030CL -#define SEC_E_UNKNOWN_CREDENTIALS (SECURITY_STATUS)0x8009030DL -#define SEC_E_NO_CREDENTIALS (SECURITY_STATUS)0x8009030EL -#define SEC_E_MESSAGE_ALTERED (SECURITY_STATUS)0x8009030FL -#define SEC_E_OUT_OF_SEQUENCE (SECURITY_STATUS)0x80090310L -#define SEC_E_NO_AUTHENTICATING_AUTHORITY (SECURITY_STATUS)0x80090311L -#define SEC_E_BAD_PKGID (SECURITY_STATUS)0x80090316L -#define SEC_E_CONTEXT_EXPIRED (SECURITY_STATUS)0x80090317L -#define SEC_E_INCOMPLETE_MESSAGE (SECURITY_STATUS)0x80090318L -#define SEC_E_INCOMPLETE_CREDENTIALS (SECURITY_STATUS)0x80090320L -#define SEC_E_BUFFER_TOO_SMALL (SECURITY_STATUS)0x80090321L -#define SEC_E_WRONG_PRINCIPAL (SECURITY_STATUS)0x80090322L -#define SEC_E_TIME_SKEW (SECURITY_STATUS)0x80090324L -#define SEC_E_UNTRUSTED_ROOT (SECURITY_STATUS)0x80090325L -#define SEC_E_ILLEGAL_MESSAGE (SECURITY_STATUS)0x80090326L -#define SEC_E_CERT_UNKNOWN (SECURITY_STATUS)0x80090327L -#define SEC_E_CERT_EXPIRED (SECURITY_STATUS)0x80090328L -#define SEC_E_ENCRYPT_FAILURE (SECURITY_STATUS)0x80090329L -#define SEC_E_DECRYPT_FAILURE (SECURITY_STATUS)0x80090330L -#define SEC_E_ALGORITHM_MISMATCH (SECURITY_STATUS)0x80090331L -#define SEC_E_SECURITY_QOS_FAILED (SECURITY_STATUS)0x80090332L -#define SEC_E_UNFINISHED_CONTEXT_DELETED (SECURITY_STATUS)0x80090333L -#define SEC_E_NO_TGT_REPLY (SECURITY_STATUS)0x80090334L -#define SEC_E_NO_IP_ADDRESSES (SECURITY_STATUS)0x80090335L -#define SEC_E_WRONG_CREDENTIAL_HANDLE (SECURITY_STATUS)0x80090336L -#define SEC_E_CRYPTO_SYSTEM_INVALID (SECURITY_STATUS)0x80090337L -#define SEC_E_MAX_REFERRALS_EXCEEDED (SECURITY_STATUS)0x80090338L -#define SEC_E_MUST_BE_KDC (SECURITY_STATUS)0x80090339L -#define SEC_E_STRONG_CRYPTO_NOT_SUPPORTED (SECURITY_STATUS)0x8009033AL -#define SEC_E_TOO_MANY_PRINCIPALS (SECURITY_STATUS)0x8009033BL -#define SEC_E_NO_PA_DATA (SECURITY_STATUS)0x8009033CL -#define SEC_E_PKINIT_NAME_MISMATCH (SECURITY_STATUS)0x8009033DL -#define SEC_E_SMARTCARD_LOGON_REQUIRED (SECURITY_STATUS)0x8009033EL -#define SEC_E_SHUTDOWN_IN_PROGRESS (SECURITY_STATUS)0x8009033FL -#define SEC_E_KDC_INVALID_REQUEST (SECURITY_STATUS)0x80090340L -#define SEC_E_KDC_UNABLE_TO_REFER (SECURITY_STATUS)0x80090341L -#define SEC_E_KDC_UNKNOWN_ETYPE (SECURITY_STATUS)0x80090342L -#define SEC_E_UNSUPPORTED_PREAUTH (SECURITY_STATUS)0x80090343L -#define SEC_E_DELEGATION_REQUIRED (SECURITY_STATUS)0x80090345L -#define SEC_E_BAD_BINDINGS (SECURITY_STATUS)0x80090346L -#define SEC_E_MULTIPLE_ACCOUNTS (SECURITY_STATUS)0x80090347L -#define SEC_E_NO_KERB_KEY (SECURITY_STATUS)0x80090348L -#define SEC_E_CERT_WRONG_USAGE (SECURITY_STATUS)0x80090349L -#define SEC_E_DOWNGRADE_DETECTED (SECURITY_STATUS)0x80090350L -#define SEC_E_SMARTCARD_CERT_REVOKED (SECURITY_STATUS)0x80090351L -#define SEC_E_ISSUING_CA_UNTRUSTED (SECURITY_STATUS)0x80090352L -#define SEC_E_REVOCATION_OFFLINE_C (SECURITY_STATUS)0x80090353L -#define SEC_E_PKINIT_CLIENT_FAILURE (SECURITY_STATUS)0x80090354L -#define SEC_E_SMARTCARD_CERT_EXPIRED (SECURITY_STATUS)0x80090355L -#define SEC_E_NO_S4U_PROT_SUPPORT (SECURITY_STATUS)0x80090356L -#define SEC_E_CROSSREALM_DELEGATION_FAILURE (SECURITY_STATUS)0x80090357L -#define SEC_E_REVOCATION_OFFLINE_KDC (SECURITY_STATUS)0x80090358L -#define SEC_E_ISSUING_CA_UNTRUSTED_KDC (SECURITY_STATUS)0x80090359L -#define SEC_E_KDC_CERT_EXPIRED (SECURITY_STATUS)0x8009035AL -#define SEC_E_KDC_CERT_REVOKED (SECURITY_STATUS)0x8009035BL -#define SEC_E_INVALID_PARAMETER (SECURITY_STATUS)0x8009035DL -#define SEC_E_DELEGATION_POLICY (SECURITY_STATUS)0x8009035EL -#define SEC_E_POLICY_NLTM_ONLY (SECURITY_STATUS)0x8009035FL -#define SEC_E_NO_CONTEXT (SECURITY_STATUS)0x80090361L -#define SEC_E_PKU2U_CERT_FAILURE (SECURITY_STATUS)0x80090362L -#define SEC_E_MUTUAL_AUTH_FAILED (SECURITY_STATUS)0x80090363L +#define SEC_E_OK (SECURITY_STATUS)0x00000000L +#define SEC_E_INSUFFICIENT_MEMORY (SECURITY_STATUS)0x80090300L +#define SEC_E_INVALID_HANDLE (SECURITY_STATUS)0x80090301L +#define SEC_E_UNSUPPORTED_FUNCTION (SECURITY_STATUS)0x80090302L +#define SEC_E_TARGET_UNKNOWN (SECURITY_STATUS)0x80090303L +#define SEC_E_INTERNAL_ERROR (SECURITY_STATUS)0x80090304L +#define SEC_E_SECPKG_NOT_FOUND (SECURITY_STATUS)0x80090305L +#define SEC_E_NOT_OWNER (SECURITY_STATUS)0x80090306L +#define SEC_E_CANNOT_INSTALL (SECURITY_STATUS)0x80090307L +#define SEC_E_INVALID_TOKEN (SECURITY_STATUS)0x80090308L +#define SEC_E_CANNOT_PACK (SECURITY_STATUS)0x80090309L +#define SEC_E_QOP_NOT_SUPPORTED (SECURITY_STATUS)0x8009030AL +#define SEC_E_NO_IMPERSONATION (SECURITY_STATUS)0x8009030BL +#define SEC_E_LOGON_DENIED (SECURITY_STATUS)0x8009030CL +#define SEC_E_UNKNOWN_CREDENTIALS (SECURITY_STATUS)0x8009030DL +#define SEC_E_NO_CREDENTIALS (SECURITY_STATUS)0x8009030EL +#define SEC_E_MESSAGE_ALTERED (SECURITY_STATUS)0x8009030FL +#define SEC_E_OUT_OF_SEQUENCE (SECURITY_STATUS)0x80090310L +#define SEC_E_NO_AUTHENTICATING_AUTHORITY (SECURITY_STATUS)0x80090311L +#define SEC_E_BAD_PKGID (SECURITY_STATUS)0x80090316L +#define SEC_E_CONTEXT_EXPIRED (SECURITY_STATUS)0x80090317L +#define SEC_E_INCOMPLETE_MESSAGE (SECURITY_STATUS)0x80090318L +#define SEC_E_INCOMPLETE_CREDENTIALS (SECURITY_STATUS)0x80090320L +#define SEC_E_BUFFER_TOO_SMALL (SECURITY_STATUS)0x80090321L +#define SEC_E_WRONG_PRINCIPAL (SECURITY_STATUS)0x80090322L +#define SEC_E_TIME_SKEW (SECURITY_STATUS)0x80090324L +#define SEC_E_UNTRUSTED_ROOT (SECURITY_STATUS)0x80090325L +#define SEC_E_ILLEGAL_MESSAGE (SECURITY_STATUS)0x80090326L +#define SEC_E_CERT_UNKNOWN (SECURITY_STATUS)0x80090327L +#define SEC_E_CERT_EXPIRED (SECURITY_STATUS)0x80090328L +#define SEC_E_ENCRYPT_FAILURE (SECURITY_STATUS)0x80090329L +#define SEC_E_DECRYPT_FAILURE (SECURITY_STATUS)0x80090330L +#define SEC_E_ALGORITHM_MISMATCH (SECURITY_STATUS)0x80090331L +#define SEC_E_SECURITY_QOS_FAILED (SECURITY_STATUS)0x80090332L +#define SEC_E_UNFINISHED_CONTEXT_DELETED (SECURITY_STATUS)0x80090333L +#define SEC_E_NO_TGT_REPLY (SECURITY_STATUS)0x80090334L +#define SEC_E_NO_IP_ADDRESSES (SECURITY_STATUS)0x80090335L +#define SEC_E_WRONG_CREDENTIAL_HANDLE (SECURITY_STATUS)0x80090336L +#define SEC_E_CRYPTO_SYSTEM_INVALID (SECURITY_STATUS)0x80090337L +#define SEC_E_MAX_REFERRALS_EXCEEDED (SECURITY_STATUS)0x80090338L +#define SEC_E_MUST_BE_KDC (SECURITY_STATUS)0x80090339L +#define SEC_E_STRONG_CRYPTO_NOT_SUPPORTED (SECURITY_STATUS)0x8009033AL +#define SEC_E_TOO_MANY_PRINCIPALS (SECURITY_STATUS)0x8009033BL +#define SEC_E_NO_PA_DATA (SECURITY_STATUS)0x8009033CL +#define SEC_E_PKINIT_NAME_MISMATCH (SECURITY_STATUS)0x8009033DL +#define SEC_E_SMARTCARD_LOGON_REQUIRED (SECURITY_STATUS)0x8009033EL +#define SEC_E_SHUTDOWN_IN_PROGRESS (SECURITY_STATUS)0x8009033FL +#define SEC_E_KDC_INVALID_REQUEST (SECURITY_STATUS)0x80090340L +#define SEC_E_KDC_UNABLE_TO_REFER (SECURITY_STATUS)0x80090341L +#define SEC_E_KDC_UNKNOWN_ETYPE (SECURITY_STATUS)0x80090342L +#define SEC_E_UNSUPPORTED_PREAUTH (SECURITY_STATUS)0x80090343L +#define SEC_E_DELEGATION_REQUIRED (SECURITY_STATUS)0x80090345L +#define SEC_E_BAD_BINDINGS (SECURITY_STATUS)0x80090346L +#define SEC_E_MULTIPLE_ACCOUNTS (SECURITY_STATUS)0x80090347L +#define SEC_E_NO_KERB_KEY (SECURITY_STATUS)0x80090348L +#define SEC_E_CERT_WRONG_USAGE (SECURITY_STATUS)0x80090349L +#define SEC_E_DOWNGRADE_DETECTED (SECURITY_STATUS)0x80090350L +#define SEC_E_SMARTCARD_CERT_REVOKED (SECURITY_STATUS)0x80090351L +#define SEC_E_ISSUING_CA_UNTRUSTED (SECURITY_STATUS)0x80090352L +#define SEC_E_REVOCATION_OFFLINE_C (SECURITY_STATUS)0x80090353L +#define SEC_E_PKINIT_CLIENT_FAILURE (SECURITY_STATUS)0x80090354L +#define SEC_E_SMARTCARD_CERT_EXPIRED (SECURITY_STATUS)0x80090355L +#define SEC_E_NO_S4U_PROT_SUPPORT (SECURITY_STATUS)0x80090356L +#define SEC_E_CROSSREALM_DELEGATION_FAILURE (SECURITY_STATUS)0x80090357L +#define SEC_E_REVOCATION_OFFLINE_KDC (SECURITY_STATUS)0x80090358L +#define SEC_E_ISSUING_CA_UNTRUSTED_KDC (SECURITY_STATUS)0x80090359L +#define SEC_E_KDC_CERT_EXPIRED (SECURITY_STATUS)0x8009035AL +#define SEC_E_KDC_CERT_REVOKED (SECURITY_STATUS)0x8009035BL +#define SEC_E_INVALID_PARAMETER (SECURITY_STATUS)0x8009035DL +#define SEC_E_DELEGATION_POLICY (SECURITY_STATUS)0x8009035EL +#define SEC_E_POLICY_NLTM_ONLY (SECURITY_STATUS)0x8009035FL +#define SEC_E_NO_CONTEXT (SECURITY_STATUS)0x80090361L +#define SEC_E_PKU2U_CERT_FAILURE (SECURITY_STATUS)0x80090362L +#define SEC_E_MUTUAL_AUTH_FAILED (SECURITY_STATUS)0x80090363L -#define SEC_I_CONTINUE_NEEDED (SECURITY_STATUS)0x00090312L -#define SEC_I_COMPLETE_NEEDED (SECURITY_STATUS)0x00090313L -#define SEC_I_COMPLETE_AND_CONTINUE (SECURITY_STATUS)0x00090314L -#define SEC_I_LOCAL_LOGON (SECURITY_STATUS)0x00090315L -#define SEC_I_CONTEXT_EXPIRED (SECURITY_STATUS)0x00090317L -#define SEC_I_INCOMPLETE_CREDENTIALS (SECURITY_STATUS)0x00090320L -#define SEC_I_RENEGOTIATE (SECURITY_STATUS)0x00090321L -#define SEC_I_NO_LSA_CONTEXT (SECURITY_STATUS)0x00090323L -#define SEC_I_SIGNATURE_NEEDED (SECURITY_STATUS)0x0009035CL -#define SEC_I_NO_RENEGOTIATION (SECURITY_STATUS)0x00090360L +#define SEC_I_CONTINUE_NEEDED (SECURITY_STATUS)0x00090312L +#define SEC_I_COMPLETE_NEEDED (SECURITY_STATUS)0x00090313L +#define SEC_I_COMPLETE_AND_CONTINUE (SECURITY_STATUS)0x00090314L +#define SEC_I_LOCAL_LOGON (SECURITY_STATUS)0x00090315L +#define SEC_I_CONTEXT_EXPIRED (SECURITY_STATUS)0x00090317L +#define SEC_I_INCOMPLETE_CREDENTIALS (SECURITY_STATUS)0x00090320L +#define SEC_I_RENEGOTIATE (SECURITY_STATUS)0x00090321L +#define SEC_I_NO_LSA_CONTEXT (SECURITY_STATUS)0x00090323L +#define SEC_I_SIGNATURE_NEEDED (SECURITY_STATUS)0x0009035CL +#define SEC_I_NO_RENEGOTIATION (SECURITY_STATUS)0x00090360L #endif -#define SECURITY_NATIVE_DREP 0x00000010 -#define SECURITY_NETWORK_DREP 0x00000000 +#define SECURITY_NATIVE_DREP 0x00000010 +#define SECURITY_NETWORK_DREP 0x00000000 -#define SECPKG_CRED_INBOUND 0x00000001 -#define SECPKG_CRED_OUTBOUND 0x00000002 -#define SECPKG_CRED_BOTH 0x00000003 -#define SECPKG_CRED_AUTOLOGON_RESTRICTED 0x00000010 -#define SECPKG_CRED_PROCESS_POLICY_ONLY 0x00000020 +#define SECPKG_CRED_INBOUND 0x00000001 +#define SECPKG_CRED_OUTBOUND 0x00000002 +#define SECPKG_CRED_BOTH 0x00000003 +#define SECPKG_CRED_AUTOLOGON_RESTRICTED 0x00000010 +#define SECPKG_CRED_PROCESS_POLICY_ONLY 0x00000020 /* Security Context Attributes */ -#define SECPKG_ATTR_SIZES 0 -#define SECPKG_ATTR_NAMES 1 -#define SECPKG_ATTR_LIFESPAN 2 -#define SECPKG_ATTR_DCE_INFO 3 -#define SECPKG_ATTR_STREAM_SIZES 4 -#define SECPKG_ATTR_KEY_INFO 5 -#define SECPKG_ATTR_AUTHORITY 6 -#define SECPKG_ATTR_PROTO_INFO 7 -#define SECPKG_ATTR_PASSWORD_EXPIRY 8 -#define SECPKG_ATTR_SESSION_KEY 9 -#define SECPKG_ATTR_PACKAGE_INFO 10 -#define SECPKG_ATTR_USER_FLAGS 11 -#define SECPKG_ATTR_NEGOTIATION_INFO 12 -#define SECPKG_ATTR_NATIVE_NAMES 13 -#define SECPKG_ATTR_FLAGS 14 -#define SECPKG_ATTR_USE_VALIDATED 15 -#define SECPKG_ATTR_CREDENTIAL_NAME 16 -#define SECPKG_ATTR_TARGET_INFORMATION 17 -#define SECPKG_ATTR_ACCESS_TOKEN 18 -#define SECPKG_ATTR_TARGET 19 -#define SECPKG_ATTR_AUTHENTICATION_ID 20 -#define SECPKG_ATTR_LOGOFF_TIME 21 -#define SECPKG_ATTR_NEGO_KEYS 22 -#define SECPKG_ATTR_PROMPTING_NEEDED 24 -#define SECPKG_ATTR_UNIQUE_BINDINGS 25 -#define SECPKG_ATTR_ENDPOINT_BINDINGS 26 -#define SECPKG_ATTR_CLIENT_SPECIFIED_TARGET 27 -#define SECPKG_ATTR_LAST_CLIENT_TOKEN_STATUS 30 -#define SECPKG_ATTR_NEGO_PKG_INFO 31 -#define SECPKG_ATTR_NEGO_STATUS 32 -#define SECPKG_ATTR_CONTEXT_DELETED 33 +#define SECPKG_ATTR_SIZES 0 +#define SECPKG_ATTR_NAMES 1 +#define SECPKG_ATTR_LIFESPAN 2 +#define SECPKG_ATTR_DCE_INFO 3 +#define SECPKG_ATTR_STREAM_SIZES 4 +#define SECPKG_ATTR_KEY_INFO 5 +#define SECPKG_ATTR_AUTHORITY 6 +#define SECPKG_ATTR_PROTO_INFO 7 +#define SECPKG_ATTR_PASSWORD_EXPIRY 8 +#define SECPKG_ATTR_SESSION_KEY 9 +#define SECPKG_ATTR_PACKAGE_INFO 10 +#define SECPKG_ATTR_USER_FLAGS 11 +#define SECPKG_ATTR_NEGOTIATION_INFO 12 +#define SECPKG_ATTR_NATIVE_NAMES 13 +#define SECPKG_ATTR_FLAGS 14 +#define SECPKG_ATTR_USE_VALIDATED 15 +#define SECPKG_ATTR_CREDENTIAL_NAME 16 +#define SECPKG_ATTR_TARGET_INFORMATION 17 +#define SECPKG_ATTR_ACCESS_TOKEN 18 +#define SECPKG_ATTR_TARGET 19 +#define SECPKG_ATTR_AUTHENTICATION_ID 20 +#define SECPKG_ATTR_LOGOFF_TIME 21 +#define SECPKG_ATTR_NEGO_KEYS 22 +#define SECPKG_ATTR_PROMPTING_NEEDED 24 +#define SECPKG_ATTR_UNIQUE_BINDINGS 25 +#define SECPKG_ATTR_ENDPOINT_BINDINGS 26 +#define SECPKG_ATTR_CLIENT_SPECIFIED_TARGET 27 +#define SECPKG_ATTR_LAST_CLIENT_TOKEN_STATUS 30 +#define SECPKG_ATTR_NEGO_PKG_INFO 31 +#define SECPKG_ATTR_NEGO_STATUS 32 +#define SECPKG_ATTR_CONTEXT_DELETED 33 #if !defined(_WIN32) || defined(_UWP) @@ -450,7 +450,7 @@ typedef struct _SecPkgContext_TargetInformation SecPkgContext_TargetInformation; /* Security Credentials Attributes */ -#define SECPKG_CRED_ATTR_NAMES 1 +#define SECPKG_CRED_ATTR_NAMES 1 struct _SecPkgCredentials_NamesA { @@ -478,110 +478,110 @@ typedef SecPkgCredentials_NamesW* PSecPkgCredentials_NamesW; /* InitializeSecurityContext Flags */ -#define ISC_REQ_DELEGATE 0x00000001 -#define ISC_REQ_MUTUAL_AUTH 0x00000002 -#define ISC_REQ_REPLAY_DETECT 0x00000004 -#define ISC_REQ_SEQUENCE_DETECT 0x00000008 -#define ISC_REQ_CONFIDENTIALITY 0x00000010 -#define ISC_REQ_USE_SESSION_KEY 0x00000020 -#define ISC_REQ_PROMPT_FOR_CREDS 0x00000040 -#define ISC_REQ_USE_SUPPLIED_CREDS 0x00000080 -#define ISC_REQ_ALLOCATE_MEMORY 0x00000100 -#define ISC_REQ_USE_DCE_STYLE 0x00000200 -#define ISC_REQ_DATAGRAM 0x00000400 -#define ISC_REQ_CONNECTION 0x00000800 -#define ISC_REQ_CALL_LEVEL 0x00001000 -#define ISC_REQ_FRAGMENT_SUPPLIED 0x00002000 -#define ISC_REQ_EXTENDED_ERROR 0x00004000 -#define ISC_REQ_STREAM 0x00008000 -#define ISC_REQ_INTEGRITY 0x00010000 -#define ISC_REQ_IDENTIFY 0x00020000 -#define ISC_REQ_NULL_SESSION 0x00040000 -#define ISC_REQ_MANUAL_CRED_VALIDATION 0x00080000 -#define ISC_REQ_RESERVED1 0x00100000 -#define ISC_REQ_FRAGMENT_TO_FIT 0x00200000 -#define ISC_REQ_FORWARD_CREDENTIALS 0x00400000 -#define ISC_REQ_NO_INTEGRITY 0x00800000 -#define ISC_REQ_USE_HTTP_STYLE 0x01000000 +#define ISC_REQ_DELEGATE 0x00000001 +#define ISC_REQ_MUTUAL_AUTH 0x00000002 +#define ISC_REQ_REPLAY_DETECT 0x00000004 +#define ISC_REQ_SEQUENCE_DETECT 0x00000008 +#define ISC_REQ_CONFIDENTIALITY 0x00000010 +#define ISC_REQ_USE_SESSION_KEY 0x00000020 +#define ISC_REQ_PROMPT_FOR_CREDS 0x00000040 +#define ISC_REQ_USE_SUPPLIED_CREDS 0x00000080 +#define ISC_REQ_ALLOCATE_MEMORY 0x00000100 +#define ISC_REQ_USE_DCE_STYLE 0x00000200 +#define ISC_REQ_DATAGRAM 0x00000400 +#define ISC_REQ_CONNECTION 0x00000800 +#define ISC_REQ_CALL_LEVEL 0x00001000 +#define ISC_REQ_FRAGMENT_SUPPLIED 0x00002000 +#define ISC_REQ_EXTENDED_ERROR 0x00004000 +#define ISC_REQ_STREAM 0x00008000 +#define ISC_REQ_INTEGRITY 0x00010000 +#define ISC_REQ_IDENTIFY 0x00020000 +#define ISC_REQ_NULL_SESSION 0x00040000 +#define ISC_REQ_MANUAL_CRED_VALIDATION 0x00080000 +#define ISC_REQ_RESERVED1 0x00100000 +#define ISC_REQ_FRAGMENT_TO_FIT 0x00200000 +#define ISC_REQ_FORWARD_CREDENTIALS 0x00400000 +#define ISC_REQ_NO_INTEGRITY 0x00800000 +#define ISC_REQ_USE_HTTP_STYLE 0x01000000 -#define ISC_RET_DELEGATE 0x00000001 -#define ISC_RET_MUTUAL_AUTH 0x00000002 -#define ISC_RET_REPLAY_DETECT 0x00000004 -#define ISC_RET_SEQUENCE_DETECT 0x00000008 -#define ISC_RET_CONFIDENTIALITY 0x00000010 -#define ISC_RET_USE_SESSION_KEY 0x00000020 -#define ISC_RET_USED_COLLECTED_CREDS 0x00000040 -#define ISC_RET_USED_SUPPLIED_CREDS 0x00000080 -#define ISC_RET_ALLOCATED_MEMORY 0x00000100 -#define ISC_RET_USED_DCE_STYLE 0x00000200 -#define ISC_RET_DATAGRAM 0x00000400 -#define ISC_RET_CONNECTION 0x00000800 -#define ISC_RET_INTERMEDIATE_RETURN 0x00001000 -#define ISC_RET_CALL_LEVEL 0x00002000 -#define ISC_RET_EXTENDED_ERROR 0x00004000 -#define ISC_RET_STREAM 0x00008000 -#define ISC_RET_INTEGRITY 0x00010000 -#define ISC_RET_IDENTIFY 0x00020000 -#define ISC_RET_NULL_SESSION 0x00040000 -#define ISC_RET_MANUAL_CRED_VALIDATION 0x00080000 -#define ISC_RET_RESERVED1 0x00100000 -#define ISC_RET_FRAGMENT_ONLY 0x00200000 -#define ISC_RET_FORWARD_CREDENTIALS 0x00400000 -#define ISC_RET_USED_HTTP_STYLE 0x01000000 +#define ISC_RET_DELEGATE 0x00000001 +#define ISC_RET_MUTUAL_AUTH 0x00000002 +#define ISC_RET_REPLAY_DETECT 0x00000004 +#define ISC_RET_SEQUENCE_DETECT 0x00000008 +#define ISC_RET_CONFIDENTIALITY 0x00000010 +#define ISC_RET_USE_SESSION_KEY 0x00000020 +#define ISC_RET_USED_COLLECTED_CREDS 0x00000040 +#define ISC_RET_USED_SUPPLIED_CREDS 0x00000080 +#define ISC_RET_ALLOCATED_MEMORY 0x00000100 +#define ISC_RET_USED_DCE_STYLE 0x00000200 +#define ISC_RET_DATAGRAM 0x00000400 +#define ISC_RET_CONNECTION 0x00000800 +#define ISC_RET_INTERMEDIATE_RETURN 0x00001000 +#define ISC_RET_CALL_LEVEL 0x00002000 +#define ISC_RET_EXTENDED_ERROR 0x00004000 +#define ISC_RET_STREAM 0x00008000 +#define ISC_RET_INTEGRITY 0x00010000 +#define ISC_RET_IDENTIFY 0x00020000 +#define ISC_RET_NULL_SESSION 0x00040000 +#define ISC_RET_MANUAL_CRED_VALIDATION 0x00080000 +#define ISC_RET_RESERVED1 0x00100000 +#define ISC_RET_FRAGMENT_ONLY 0x00200000 +#define ISC_RET_FORWARD_CREDENTIALS 0x00400000 +#define ISC_RET_USED_HTTP_STYLE 0x01000000 /* AcceptSecurityContext Flags */ -#define ASC_REQ_DELEGATE 0x00000001 -#define ASC_REQ_MUTUAL_AUTH 0x00000002 -#define ASC_REQ_REPLAY_DETECT 0x00000004 -#define ASC_REQ_SEQUENCE_DETECT 0x00000008 -#define ASC_REQ_CONFIDENTIALITY 0x00000010 -#define ASC_REQ_USE_SESSION_KEY 0x00000020 -#define ASC_REQ_ALLOCATE_MEMORY 0x00000100 -#define ASC_REQ_USE_DCE_STYLE 0x00000200 -#define ASC_REQ_DATAGRAM 0x00000400 -#define ASC_REQ_CONNECTION 0x00000800 -#define ASC_REQ_CALL_LEVEL 0x00001000 -#define ASC_REQ_EXTENDED_ERROR 0x00008000 -#define ASC_REQ_STREAM 0x00010000 -#define ASC_REQ_INTEGRITY 0x00020000 -#define ASC_REQ_LICENSING 0x00040000 -#define ASC_REQ_IDENTIFY 0x00080000 -#define ASC_REQ_ALLOW_NULL_SESSION 0x00100000 -#define ASC_REQ_ALLOW_NON_USER_LOGONS 0x00200000 -#define ASC_REQ_ALLOW_CONTEXT_REPLAY 0x00400000 -#define ASC_REQ_FRAGMENT_TO_FIT 0x00800000 -#define ASC_REQ_FRAGMENT_SUPPLIED 0x00002000 -#define ASC_REQ_NO_TOKEN 0x01000000 -#define ASC_REQ_PROXY_BINDINGS 0x04000000 -#define ASC_REQ_ALLOW_MISSING_BINDINGS 0x10000000 +#define ASC_REQ_DELEGATE 0x00000001 +#define ASC_REQ_MUTUAL_AUTH 0x00000002 +#define ASC_REQ_REPLAY_DETECT 0x00000004 +#define ASC_REQ_SEQUENCE_DETECT 0x00000008 +#define ASC_REQ_CONFIDENTIALITY 0x00000010 +#define ASC_REQ_USE_SESSION_KEY 0x00000020 +#define ASC_REQ_ALLOCATE_MEMORY 0x00000100 +#define ASC_REQ_USE_DCE_STYLE 0x00000200 +#define ASC_REQ_DATAGRAM 0x00000400 +#define ASC_REQ_CONNECTION 0x00000800 +#define ASC_REQ_CALL_LEVEL 0x00001000 +#define ASC_REQ_EXTENDED_ERROR 0x00008000 +#define ASC_REQ_STREAM 0x00010000 +#define ASC_REQ_INTEGRITY 0x00020000 +#define ASC_REQ_LICENSING 0x00040000 +#define ASC_REQ_IDENTIFY 0x00080000 +#define ASC_REQ_ALLOW_NULL_SESSION 0x00100000 +#define ASC_REQ_ALLOW_NON_USER_LOGONS 0x00200000 +#define ASC_REQ_ALLOW_CONTEXT_REPLAY 0x00400000 +#define ASC_REQ_FRAGMENT_TO_FIT 0x00800000 +#define ASC_REQ_FRAGMENT_SUPPLIED 0x00002000 +#define ASC_REQ_NO_TOKEN 0x01000000 +#define ASC_REQ_PROXY_BINDINGS 0x04000000 +#define ASC_REQ_ALLOW_MISSING_BINDINGS 0x10000000 -#define ASC_RET_DELEGATE 0x00000001 -#define ASC_RET_MUTUAL_AUTH 0x00000002 -#define ASC_RET_REPLAY_DETECT 0x00000004 -#define ASC_RET_SEQUENCE_DETECT 0x00000008 -#define ASC_RET_CONFIDENTIALITY 0x00000010 -#define ASC_RET_USE_SESSION_KEY 0x00000020 -#define ASC_RET_ALLOCATED_MEMORY 0x00000100 -#define ASC_RET_USED_DCE_STYLE 0x00000200 -#define ASC_RET_DATAGRAM 0x00000400 -#define ASC_RET_CONNECTION 0x00000800 -#define ASC_RET_CALL_LEVEL 0x00002000 -#define ASC_RET_THIRD_LEG_FAILED 0x00004000 -#define ASC_RET_EXTENDED_ERROR 0x00008000 -#define ASC_RET_STREAM 0x00010000 -#define ASC_RET_INTEGRITY 0x00020000 -#define ASC_RET_LICENSING 0x00040000 -#define ASC_RET_IDENTIFY 0x00080000 -#define ASC_RET_NULL_SESSION 0x00100000 -#define ASC_RET_ALLOW_NON_USER_LOGONS 0x00200000 -#define ASC_RET_FRAGMENT_ONLY 0x00800000 -#define ASC_RET_NO_TOKEN 0x01000000 -#define ASC_RET_NO_PROXY_BINDINGS 0x04000000 -#define ASC_RET_MISSING_BINDINGS 0x10000000 +#define ASC_RET_DELEGATE 0x00000001 +#define ASC_RET_MUTUAL_AUTH 0x00000002 +#define ASC_RET_REPLAY_DETECT 0x00000004 +#define ASC_RET_SEQUENCE_DETECT 0x00000008 +#define ASC_RET_CONFIDENTIALITY 0x00000010 +#define ASC_RET_USE_SESSION_KEY 0x00000020 +#define ASC_RET_ALLOCATED_MEMORY 0x00000100 +#define ASC_RET_USED_DCE_STYLE 0x00000200 +#define ASC_RET_DATAGRAM 0x00000400 +#define ASC_RET_CONNECTION 0x00000800 +#define ASC_RET_CALL_LEVEL 0x00002000 +#define ASC_RET_THIRD_LEG_FAILED 0x00004000 +#define ASC_RET_EXTENDED_ERROR 0x00008000 +#define ASC_RET_STREAM 0x00010000 +#define ASC_RET_INTEGRITY 0x00020000 +#define ASC_RET_LICENSING 0x00040000 +#define ASC_RET_IDENTIFY 0x00080000 +#define ASC_RET_NULL_SESSION 0x00100000 +#define ASC_RET_ALLOW_NON_USER_LOGONS 0x00200000 +#define ASC_RET_FRAGMENT_ONLY 0x00800000 +#define ASC_RET_NO_TOKEN 0x01000000 +#define ASC_RET_NO_PROXY_BINDINGS 0x04000000 +#define ASC_RET_MISSING_BINDINGS 0x10000000 -#define SEC_WINNT_AUTH_IDENTITY_ANSI 0x1 -#define SEC_WINNT_AUTH_IDENTITY_UNICODE 0x2 +#define SEC_WINNT_AUTH_IDENTITY_ANSI 0x1 +#define SEC_WINNT_AUTH_IDENTITY_UNICODE 0x2 #if !defined(_WIN32) || defined(_UWP) @@ -641,41 +641,41 @@ typedef SecHandle CtxtHandle; typedef CtxtHandle* PCtxtHandle; #define SecInvalidateHandle(x) \ - ((PSecHandle)(x))->dwLower = ((PSecHandle)(x))->dwUpper = ((ULONG_PTR)((INT_PTR) - 1)); + ((PSecHandle)(x))->dwLower = ((PSecHandle)(x))->dwUpper = ((ULONG_PTR)((INT_PTR)-1)); -#define SecIsValidHandle(x) \ - ((((PSecHandle)(x))->dwLower != ((ULONG_PTR)((INT_PTR) - 1))) && \ - (((PSecHandle) (x))->dwUpper != ((ULONG_PTR)((INT_PTR) - 1)))) +#define SecIsValidHandle(x) \ + ((((PSecHandle)(x))->dwLower != ((ULONG_PTR)((INT_PTR)-1))) && \ + (((PSecHandle)(x))->dwUpper != ((ULONG_PTR)((INT_PTR)-1)))) #endif -#define SECBUFFER_VERSION 0 +#define SECBUFFER_VERSION 0 /* Buffer Types */ -#define SECBUFFER_EMPTY 0 -#define SECBUFFER_DATA 1 -#define SECBUFFER_TOKEN 2 -#define SECBUFFER_PKG_PARAMS 3 -#define SECBUFFER_MISSING 4 -#define SECBUFFER_EXTRA 5 -#define SECBUFFER_STREAM_TRAILER 6 -#define SECBUFFER_STREAM_HEADER 7 -#define SECBUFFER_NEGOTIATION_INFO 8 -#define SECBUFFER_PADDING 9 -#define SECBUFFER_STREAM 10 -#define SECBUFFER_MECHLIST 11 -#define SECBUFFER_MECHLIST_SIGNATURE 12 -#define SECBUFFER_TARGET 13 -#define SECBUFFER_CHANNEL_BINDINGS 14 -#define SECBUFFER_CHANGE_PASS_RESPONSE 15 -#define SECBUFFER_TARGET_HOST 16 -#define SECBUFFER_ALERT 17 +#define SECBUFFER_EMPTY 0 +#define SECBUFFER_DATA 1 +#define SECBUFFER_TOKEN 2 +#define SECBUFFER_PKG_PARAMS 3 +#define SECBUFFER_MISSING 4 +#define SECBUFFER_EXTRA 5 +#define SECBUFFER_STREAM_TRAILER 6 +#define SECBUFFER_STREAM_HEADER 7 +#define SECBUFFER_NEGOTIATION_INFO 8 +#define SECBUFFER_PADDING 9 +#define SECBUFFER_STREAM 10 +#define SECBUFFER_MECHLIST 11 +#define SECBUFFER_MECHLIST_SIGNATURE 12 +#define SECBUFFER_TARGET 13 +#define SECBUFFER_CHANNEL_BINDINGS 14 +#define SECBUFFER_CHANGE_PASS_RESPONSE 15 +#define SECBUFFER_TARGET_HOST 16 +#define SECBUFFER_ALERT 17 /* Security Buffer Flags */ -#define SECBUFFER_ATTRMASK 0xF0000000 -#define SECBUFFER_READONLY 0x80000000 -#define SECBUFFER_READONLY_WITH_CHECKSUM 0x10000000 -#define SECBUFFER_RESERVED 0x60000000 +#define SECBUFFER_ATTRMASK 0xF0000000 +#define SECBUFFER_READONLY 0x80000000 +#define SECBUFFER_READONLY_WITH_CHECKSUM 0x10000000 +#define SECBUFFER_RESERVED 0x60000000 #if !defined(_WIN32) || defined(_UWP) @@ -697,13 +697,13 @@ struct _SecBufferDesc typedef struct _SecBufferDesc SecBufferDesc; typedef SecBufferDesc* PSecBufferDesc; -typedef void (SEC_ENTRY* SEC_GET_KEY_FN)(void* Arg, void* Principal, UINT32 KeyVer, void** Key, - SECURITY_STATUS* pStatus); +typedef void(SEC_ENTRY* SEC_GET_KEY_FN)(void* Arg, void* Principal, UINT32 KeyVer, void** Key, + SECURITY_STATUS* pStatus); typedef SECURITY_STATUS(SEC_ENTRY* ENUMERATE_SECURITY_PACKAGES_FN_A)(ULONG* pcPackages, - PSecPkgInfoA* ppPackageInfo); + PSecPkgInfoA* ppPackageInfo); typedef SECURITY_STATUS(SEC_ENTRY* ENUMERATE_SECURITY_PACKAGES_FN_W)(ULONG* pcPackages, - PSecPkgInfoW* ppPackageInfo); + PSecPkgInfoW* ppPackageInfo); #ifdef UNICODE #define EnumerateSecurityPackages EnumerateSecurityPackagesW @@ -714,9 +714,11 @@ typedef SECURITY_STATUS(SEC_ENTRY* ENUMERATE_SECURITY_PACKAGES_FN_W)(ULONG* pcPa #endif typedef SECURITY_STATUS(SEC_ENTRY* QUERY_CREDENTIALS_ATTRIBUTES_FN_A)(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer); + ULONG ulAttribute, + void* pBuffer); typedef SECURITY_STATUS(SEC_ENTRY* QUERY_CREDENTIALS_ATTRIBUTES_FN_W)(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer); + ULONG ulAttribute, + void* pBuffer); #ifdef UNICODE #define QueryCredentialsAttributes QueryCredentialsAttributesW @@ -726,14 +728,14 @@ typedef SECURITY_STATUS(SEC_ENTRY* QUERY_CREDENTIALS_ATTRIBUTES_FN_W)(PCredHandl #define QUERY_CREDENTIALS_ATTRIBUTES_FN QUERY_CREDENTIALS_ATTRIBUTES_FN_A #endif -typedef SECURITY_STATUS(SEC_ENTRY* ACQUIRE_CREDENTIALS_HANDLE_FN_A)(LPSTR pszPrincipal, - LPSTR pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, - void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry); -typedef SECURITY_STATUS(SEC_ENTRY* ACQUIRE_CREDENTIALS_HANDLE_FN_W)(LPWSTR pszPrincipal, - LPWSTR pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, - void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry); +typedef SECURITY_STATUS(SEC_ENTRY* ACQUIRE_CREDENTIALS_HANDLE_FN_A)( + LPSTR pszPrincipal, LPSTR pszPackage, ULONG fCredentialUse, void* pvLogonID, void* pAuthData, + SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, + PTimeStamp ptsExpiry); +typedef SECURITY_STATUS(SEC_ENTRY* ACQUIRE_CREDENTIALS_HANDLE_FN_W)( + LPWSTR pszPrincipal, LPWSTR pszPackage, ULONG fCredentialUse, void* pvLogonID, void* pAuthData, + SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, + PTimeStamp ptsExpiry); #ifdef UNICODE #define AcquireCredentialsHandle AcquireCredentialsHandleW @@ -745,16 +747,14 @@ typedef SECURITY_STATUS(SEC_ENTRY* ACQUIRE_CREDENTIALS_HANDLE_FN_W)(LPWSTR pszPr typedef SECURITY_STATUS(SEC_ENTRY* FREE_CREDENTIALS_HANDLE_FN)(PCredHandle phCredential); -typedef SECURITY_STATUS(SEC_ENTRY* INITIALIZE_SECURITY_CONTEXT_FN_A)(PCredHandle phCredential, - PCtxtHandle phContext, - SEC_CHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, - PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry); -typedef SECURITY_STATUS(SEC_ENTRY* INITIALIZE_SECURITY_CONTEXT_FN_W)(PCredHandle phCredential, - PCtxtHandle phContext, - SEC_WCHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, - PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry); +typedef SECURITY_STATUS(SEC_ENTRY* INITIALIZE_SECURITY_CONTEXT_FN_A)( + PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR* pszTargetName, ULONG fContextReq, + ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, + PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry); +typedef SECURITY_STATUS(SEC_ENTRY* INITIALIZE_SECURITY_CONTEXT_FN_W)( + PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR* pszTargetName, ULONG fContextReq, + ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, + PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry); #ifdef UNICODE #define InitializeSecurityContext InitializeSecurityContextW @@ -764,23 +764,23 @@ typedef SECURITY_STATUS(SEC_ENTRY* INITIALIZE_SECURITY_CONTEXT_FN_W)(PCredHandle #define INITIALIZE_SECURITY_CONTEXT_FN INITIALIZE_SECURITY_CONTEXT_FN_A #endif -typedef SECURITY_STATUS(SEC_ENTRY* ACCEPT_SECURITY_CONTEXT_FN)(PCredHandle phCredential, - PCtxtHandle phContext, - PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsTimeStamp); +typedef SECURITY_STATUS(SEC_ENTRY* ACCEPT_SECURITY_CONTEXT_FN)( + PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, ULONG fContextReq, + ULONG TargetDataRep, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, + PTimeStamp ptsTimeStamp); typedef SECURITY_STATUS(SEC_ENTRY* COMPLETE_AUTH_TOKEN_FN)(PCtxtHandle phContext, - PSecBufferDesc pToken); + PSecBufferDesc pToken); typedef SECURITY_STATUS(SEC_ENTRY* DELETE_SECURITY_CONTEXT_FN)(PCtxtHandle phContext); typedef SECURITY_STATUS(SEC_ENTRY* APPLY_CONTROL_TOKEN_FN)(PCtxtHandle phContext, - PSecBufferDesc pInput); + PSecBufferDesc pInput); typedef SECURITY_STATUS(SEC_ENTRY* QUERY_CONTEXT_ATTRIBUTES_FN_A)(PCtxtHandle phContext, - ULONG ulAttribute, void* pBuffer); + ULONG ulAttribute, void* pBuffer); typedef SECURITY_STATUS(SEC_ENTRY* QUERY_CONTEXT_ATTRIBUTES_FN_W)(PCtxtHandle phContext, - ULONG ulAttribute, void* pBuffer); + ULONG ulAttribute, void* pBuffer); #ifdef UNICODE #define QueryContextAttributes QueryContextAttributesW @@ -795,17 +795,18 @@ typedef SECURITY_STATUS(SEC_ENTRY* IMPERSONATE_SECURITY_CONTEXT_FN)(PCtxtHandle typedef SECURITY_STATUS(SEC_ENTRY* REVERT_SECURITY_CONTEXT_FN)(PCtxtHandle phContext); typedef SECURITY_STATUS(SEC_ENTRY* MAKE_SIGNATURE_FN)(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo); + PSecBufferDesc pMessage, ULONG MessageSeqNo); typedef SECURITY_STATUS(SEC_ENTRY* VERIFY_SIGNATURE_FN)(PCtxtHandle phContext, - PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP); + PSecBufferDesc pMessage, ULONG MessageSeqNo, + PULONG pfQOP); typedef SECURITY_STATUS(SEC_ENTRY* FREE_CONTEXT_BUFFER_FN)(void* pvContextBuffer); typedef SECURITY_STATUS(SEC_ENTRY* QUERY_SECURITY_PACKAGE_INFO_FN_A)(SEC_CHAR* pszPackageName, - PSecPkgInfoA* ppPackageInfo); + PSecPkgInfoA* ppPackageInfo); typedef SECURITY_STATUS(SEC_ENTRY* QUERY_SECURITY_PACKAGE_INFO_FN_W)(SEC_WCHAR* pszPackageName, - PSecPkgInfoW* ppPackageInfo); + PSecPkgInfoW* ppPackageInfo); #ifdef UNICODE #define QuerySecurityPackageInfo QuerySecurityPackageInfoW @@ -816,12 +817,17 @@ typedef SECURITY_STATUS(SEC_ENTRY* QUERY_SECURITY_PACKAGE_INFO_FN_W)(SEC_WCHAR* #endif typedef SECURITY_STATUS(SEC_ENTRY* EXPORT_SECURITY_CONTEXT_FN)(PCtxtHandle phContext, ULONG fFlags, - PSecBuffer pPackedContext, HANDLE* pToken); + PSecBuffer pPackedContext, + HANDLE* pToken); typedef SECURITY_STATUS(SEC_ENTRY* IMPORT_SECURITY_CONTEXT_FN_A)(SEC_CHAR* pszPackage, - PSecBuffer pPackedContext, HANDLE pToken, PCtxtHandle phContext); + PSecBuffer pPackedContext, + HANDLE pToken, + PCtxtHandle phContext); typedef SECURITY_STATUS(SEC_ENTRY* IMPORT_SECURITY_CONTEXT_FN_W)(SEC_WCHAR* pszPackage, - PSecBuffer pPackedContext, HANDLE pToken, PCtxtHandle phContext); + PSecBuffer pPackedContext, + HANDLE pToken, + PCtxtHandle phContext); #ifdef UNICODE #define ImportSecurityContext ImportSecurityContextW @@ -831,14 +837,12 @@ typedef SECURITY_STATUS(SEC_ENTRY* IMPORT_SECURITY_CONTEXT_FN_W)(SEC_WCHAR* pszP #define IMPORT_SECURITY_CONTEXT_FN IMPORT_SECURITY_CONTEXT_FN_A #endif -typedef SECURITY_STATUS(SEC_ENTRY* ADD_CREDENTIALS_FN_A)(PCredHandle hCredentials, - SEC_CHAR* pszPrincipal, SEC_CHAR* pszPackage, - UINT32 fCredentialUse, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, - PTimeStamp ptsExpiry); -typedef SECURITY_STATUS(SEC_ENTRY* ADD_CREDENTIALS_FN_W)(PCredHandle hCredentials, - SEC_WCHAR* pszPrincipal, SEC_WCHAR* pszPackage, - UINT32 fCredentialUse, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, - PTimeStamp ptsExpiry); +typedef SECURITY_STATUS(SEC_ENTRY* ADD_CREDENTIALS_FN_A)( + PCredHandle hCredentials, SEC_CHAR* pszPrincipal, SEC_CHAR* pszPackage, UINT32 fCredentialUse, + void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PTimeStamp ptsExpiry); +typedef SECURITY_STATUS(SEC_ENTRY* ADD_CREDENTIALS_FN_W)( + PCredHandle hCredentials, SEC_WCHAR* pszPrincipal, SEC_WCHAR* pszPackage, UINT32 fCredentialUse, + void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PTimeStamp ptsExpiry); #ifdef UNICODE #define AddCredentials AddCredentialsW @@ -849,18 +853,21 @@ typedef SECURITY_STATUS(SEC_ENTRY* ADD_CREDENTIALS_FN_W)(PCredHandle hCredential #endif typedef SECURITY_STATUS(SEC_ENTRY* QUERY_SECURITY_CONTEXT_TOKEN_FN)(PCtxtHandle phContext, - HANDLE* phToken); + HANDLE* phToken); typedef SECURITY_STATUS(SEC_ENTRY* ENCRYPT_MESSAGE_FN)(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo); + PSecBufferDesc pMessage, ULONG MessageSeqNo); typedef SECURITY_STATUS(SEC_ENTRY* DECRYPT_MESSAGE_FN)(PCtxtHandle phContext, - PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP); + PSecBufferDesc pMessage, ULONG MessageSeqNo, + PULONG pfQOP); typedef SECURITY_STATUS(SEC_ENTRY* SET_CONTEXT_ATTRIBUTES_FN_A)(PCtxtHandle phContext, - ULONG ulAttribute, void* pBuffer, ULONG cbBuffer); + ULONG ulAttribute, void* pBuffer, + ULONG cbBuffer); typedef SECURITY_STATUS(SEC_ENTRY* SET_CONTEXT_ATTRIBUTES_FN_W)(PCtxtHandle phContext, - ULONG ulAttribute, void* pBuffer, ULONG cbBuffer); + ULONG ulAttribute, void* pBuffer, + ULONG cbBuffer); #ifdef UNICODE #define SetContextAttributes SetContextAttributesW @@ -870,10 +877,14 @@ typedef SECURITY_STATUS(SEC_ENTRY* SET_CONTEXT_ATTRIBUTES_FN_W)(PCtxtHandle phCo #define SET_CONTEXT_ATTRIBUTES_FN SET_CONTEXT_ATTRIBUTES_FN_A #endif -#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION 1 /* Interface has all routines through DecryptMessage */ -#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_2 2 /* Interface has all routines through SetContextAttributes */ -#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_3 3 /* Interface has all routines through SetCredentialsAttributes */ -#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_4 4 /* Interface has all routines through ChangeAccountPassword */ +#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION \ + 1 /* Interface has all routines through DecryptMessage */ +#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_2 \ + 2 /* Interface has all routines through SetContextAttributes */ +#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_3 \ + 3 /* Interface has all routines through SetCredentialsAttributes */ +#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_4 \ + 4 /* Interface has all routines through ChangeAccountPassword */ struct _SecurityFunctionTableA { @@ -959,91 +970,104 @@ typedef PSecurityFunctionTableW(SEC_ENTRY* INIT_SECURITY_INTERFACE_W)(void); #endif #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Package Management */ + /* Package Management */ -WINPR_API SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesA(ULONG* pcPackages, - PSecPkgInfoA* ppPackageInfo); -WINPR_API SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesW(ULONG* pcPackages, - PSecPkgInfoW* ppPackageInfo); + WINPR_API SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesA(ULONG* pcPackages, + PSecPkgInfoA* ppPackageInfo); + WINPR_API SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesW(ULONG* pcPackages, + PSecPkgInfoW* ppPackageInfo); -WINPR_API PSecurityFunctionTableA SEC_ENTRY InitSecurityInterfaceA(void); -WINPR_API PSecurityFunctionTableW SEC_ENTRY InitSecurityInterfaceW(void); + WINPR_API PSecurityFunctionTableA SEC_ENTRY InitSecurityInterfaceA(void); + WINPR_API PSecurityFunctionTableW SEC_ENTRY InitSecurityInterfaceW(void); -WINPR_API SECURITY_STATUS SEC_ENTRY QuerySecurityPackageInfoA(SEC_CHAR* pszPackageName, - PSecPkgInfoA* ppPackageInfo); -WINPR_API SECURITY_STATUS SEC_ENTRY QuerySecurityPackageInfoW(SEC_WCHAR* pszPackageName, - PSecPkgInfoW* ppPackageInfo); + WINPR_API SECURITY_STATUS SEC_ENTRY QuerySecurityPackageInfoA(SEC_CHAR* pszPackageName, + PSecPkgInfoA* ppPackageInfo); + WINPR_API SECURITY_STATUS SEC_ENTRY QuerySecurityPackageInfoW(SEC_WCHAR* pszPackageName, + PSecPkgInfoW* ppPackageInfo); -/* Credential Management */ + /* Credential Management */ -WINPR_API SECURITY_STATUS SEC_ENTRY AcquireCredentialsHandleA(SEC_CHAR* pszPrincipal, - SEC_CHAR* pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, - void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry); -WINPR_API SECURITY_STATUS SEC_ENTRY AcquireCredentialsHandleW(SEC_WCHAR* pszPrincipal, - SEC_WCHAR* pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, - void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry); + WINPR_API SECURITY_STATUS SEC_ENTRY AcquireCredentialsHandleA( + SEC_CHAR* pszPrincipal, SEC_CHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, + void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, + PTimeStamp ptsExpiry); + WINPR_API SECURITY_STATUS SEC_ENTRY AcquireCredentialsHandleW( + SEC_WCHAR* pszPrincipal, SEC_WCHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, + void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, + PTimeStamp ptsExpiry); -WINPR_API SECURITY_STATUS SEC_ENTRY ExportSecurityContext(PCtxtHandle phContext, ULONG fFlags, - PSecBuffer pPackedContext, HANDLE* pToken); -WINPR_API SECURITY_STATUS SEC_ENTRY FreeCredentialsHandle(PCredHandle phCredential); + WINPR_API SECURITY_STATUS SEC_ENTRY ExportSecurityContext(PCtxtHandle phContext, ULONG fFlags, + PSecBuffer pPackedContext, + HANDLE* pToken); + WINPR_API SECURITY_STATUS SEC_ENTRY FreeCredentialsHandle(PCredHandle phCredential); -WINPR_API SECURITY_STATUS SEC_ENTRY ImportSecurityContextA(SEC_CHAR* pszPackage, - PSecBuffer pPackedContext, HANDLE pToken, PCtxtHandle phContext); -WINPR_API SECURITY_STATUS SEC_ENTRY ImportSecurityContextW(SEC_WCHAR* pszPackage, - PSecBuffer pPackedContext, HANDLE pToken, PCtxtHandle phContext); + WINPR_API SECURITY_STATUS SEC_ENTRY ImportSecurityContextA(SEC_CHAR* pszPackage, + PSecBuffer pPackedContext, + HANDLE pToken, + PCtxtHandle phContext); + WINPR_API SECURITY_STATUS SEC_ENTRY ImportSecurityContextW(SEC_WCHAR* pszPackage, + PSecBuffer pPackedContext, + HANDLE pToken, + PCtxtHandle phContext); -WINPR_API SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesA(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer); -WINPR_API SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesW(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer); + WINPR_API SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesA(PCredHandle phCredential, + ULONG ulAttribute, + void* pBuffer); + WINPR_API SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesW(PCredHandle phCredential, + ULONG ulAttribute, + void* pBuffer); -/* Context Management */ + /* Context Management */ -WINPR_API SECURITY_STATUS SEC_ENTRY AcceptSecurityContext(PCredHandle phCredential, - PCtxtHandle phContext, - PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsTimeStamp); + WINPR_API SECURITY_STATUS SEC_ENTRY + AcceptSecurityContext(PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, + ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, + PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsTimeStamp); -WINPR_API SECURITY_STATUS SEC_ENTRY ApplyControlToken(PCtxtHandle phContext, PSecBufferDesc pInput); -WINPR_API SECURITY_STATUS SEC_ENTRY CompleteAuthToken(PCtxtHandle phContext, PSecBufferDesc pToken); -WINPR_API SECURITY_STATUS SEC_ENTRY DeleteSecurityContext(PCtxtHandle phContext); -WINPR_API SECURITY_STATUS SEC_ENTRY FreeContextBuffer(void* pvContextBuffer); -WINPR_API SECURITY_STATUS SEC_ENTRY ImpersonateSecurityContext(PCtxtHandle phContext); + WINPR_API SECURITY_STATUS SEC_ENTRY ApplyControlToken(PCtxtHandle phContext, + PSecBufferDesc pInput); + WINPR_API SECURITY_STATUS SEC_ENTRY CompleteAuthToken(PCtxtHandle phContext, + PSecBufferDesc pToken); + WINPR_API SECURITY_STATUS SEC_ENTRY DeleteSecurityContext(PCtxtHandle phContext); + WINPR_API SECURITY_STATUS SEC_ENTRY FreeContextBuffer(void* pvContextBuffer); + WINPR_API SECURITY_STATUS SEC_ENTRY ImpersonateSecurityContext(PCtxtHandle phContext); -WINPR_API SECURITY_STATUS SEC_ENTRY InitializeSecurityContextA(PCredHandle phCredential, - PCtxtHandle phContext, - SEC_CHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, - PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry); -WINPR_API SECURITY_STATUS SEC_ENTRY InitializeSecurityContextW(PCredHandle phCredential, - PCtxtHandle phContext, - SEC_WCHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, - PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry); + WINPR_API SECURITY_STATUS SEC_ENTRY InitializeSecurityContextA( + PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR* pszTargetName, ULONG fContextReq, + ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, + PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, + PTimeStamp ptsExpiry); + WINPR_API SECURITY_STATUS SEC_ENTRY InitializeSecurityContextW( + PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR* pszTargetName, + ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, + ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, + PTimeStamp ptsExpiry); -WINPR_API SECURITY_STATUS SEC_ENTRY QueryContextAttributes(PCtxtHandle phContext, ULONG ulAttribute, - void* pBuffer); -WINPR_API SECURITY_STATUS SEC_ENTRY QuerySecurityContextToken(PCtxtHandle phContext, - HANDLE* phToken); -WINPR_API SECURITY_STATUS SEC_ENTRY SetContextAttributes(PCtxtHandle phContext, ULONG ulAttribute, - void* pBuffer, ULONG cbBuffer); -WINPR_API SECURITY_STATUS SEC_ENTRY RevertSecurityContext(PCtxtHandle phContext); + WINPR_API SECURITY_STATUS SEC_ENTRY QueryContextAttributes(PCtxtHandle phContext, + ULONG ulAttribute, void* pBuffer); + WINPR_API SECURITY_STATUS SEC_ENTRY QuerySecurityContextToken(PCtxtHandle phContext, + HANDLE* phToken); + WINPR_API SECURITY_STATUS SEC_ENTRY SetContextAttributes(PCtxtHandle phContext, + ULONG ulAttribute, void* pBuffer, + ULONG cbBuffer); + WINPR_API SECURITY_STATUS SEC_ENTRY RevertSecurityContext(PCtxtHandle phContext); -/* Message Support */ + /* Message Support */ -WINPR_API SECURITY_STATUS SEC_ENTRY DecryptMessage(PCtxtHandle phContext, PSecBufferDesc pMessage, - ULONG MessageSeqNo, PULONG pfQOP); -WINPR_API SECURITY_STATUS SEC_ENTRY EncryptMessage(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo); -WINPR_API SECURITY_STATUS SEC_ENTRY MakeSignature(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo); -WINPR_API SECURITY_STATUS SEC_ENTRY VerifySignature(PCtxtHandle phContext, PSecBufferDesc pMessage, - ULONG MessageSeqNo, PULONG pfQOP); + WINPR_API SECURITY_STATUS SEC_ENTRY DecryptMessage(PCtxtHandle phContext, + PSecBufferDesc pMessage, ULONG MessageSeqNo, + PULONG pfQOP); + WINPR_API SECURITY_STATUS SEC_ENTRY EncryptMessage(PCtxtHandle phContext, ULONG fQOP, + PSecBufferDesc pMessage, ULONG MessageSeqNo); + WINPR_API SECURITY_STATUS SEC_ENTRY MakeSignature(PCtxtHandle phContext, ULONG fQOP, + PSecBufferDesc pMessage, ULONG MessageSeqNo); + WINPR_API SECURITY_STATUS SEC_ENTRY VerifySignature(PCtxtHandle phContext, + PSecBufferDesc pMessage, ULONG MessageSeqNo, + PULONG pfQOP); #ifdef __cplusplus } @@ -1052,98 +1076,98 @@ WINPR_API SECURITY_STATUS SEC_ENTRY VerifySignature(PCtxtHandle phContext, PSecB #endif #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Custom API */ + /* Custom API */ -#define SECPKG_ATTR_AUTH_IDENTITY 1001 -#define SECPKG_ATTR_AUTH_PASSWORD 1002 -#define SECPKG_ATTR_AUTH_NTLM_HASH 1003 -#define SECPKG_ATTR_AUTH_NTLM_SAM_FILE 1004 -#define SECPKG_ATTR_AUTH_NTLM_MESSAGE 1100 -#define SECPKG_ATTR_AUTH_NTLM_TIMESTAMP 1101 -#define SECPKG_ATTR_AUTH_NTLM_CLIENT_CHALLENGE 1102 -#define SECPKG_ATTR_AUTH_NTLM_SERVER_CHALLENGE 1103 -#define SECPKG_ATTR_AUTH_NTLM_NTPROOF_VALUE 1104 -#define SECPKG_ATTR_AUTH_NTLM_RANDKEY 1105 -#define SECPKG_ATTR_AUTH_NTLM_MIC 1106 -#define SECPKG_ATTR_AUTH_NTLM_MIC_VALUE 1107 -#define SECPKG_ATTR_AUTH_NTLM_HASH_CB 1108 -#define SECPKG_ATTR_AUTH_NTLM_HASH_CB_DATA 1109 +#define SECPKG_ATTR_AUTH_IDENTITY 1001 +#define SECPKG_ATTR_AUTH_PASSWORD 1002 +#define SECPKG_ATTR_AUTH_NTLM_HASH 1003 +#define SECPKG_ATTR_AUTH_NTLM_SAM_FILE 1004 +#define SECPKG_ATTR_AUTH_NTLM_MESSAGE 1100 +#define SECPKG_ATTR_AUTH_NTLM_TIMESTAMP 1101 +#define SECPKG_ATTR_AUTH_NTLM_CLIENT_CHALLENGE 1102 +#define SECPKG_ATTR_AUTH_NTLM_SERVER_CHALLENGE 1103 +#define SECPKG_ATTR_AUTH_NTLM_NTPROOF_VALUE 1104 +#define SECPKG_ATTR_AUTH_NTLM_RANDKEY 1105 +#define SECPKG_ATTR_AUTH_NTLM_MIC 1106 +#define SECPKG_ATTR_AUTH_NTLM_MIC_VALUE 1107 +#define SECPKG_ATTR_AUTH_NTLM_HASH_CB 1108 +#define SECPKG_ATTR_AUTH_NTLM_HASH_CB_DATA 1109 + struct _SecPkgContext_AuthIdentity + { + char User[256 + 1]; + char Domain[256 + 1]; + }; + typedef struct _SecPkgContext_AuthIdentity SecPkgContext_AuthIdentity; -struct _SecPkgContext_AuthIdentity -{ - char User[256 + 1]; - char Domain[256 + 1]; -}; -typedef struct _SecPkgContext_AuthIdentity SecPkgContext_AuthIdentity; + struct _SecPkgContext_AuthPassword + { + char Password[256 + 1]; + }; + typedef struct _SecPkgContext_AuthPassword SecPkgContext_AuthPassword; -struct _SecPkgContext_AuthPassword -{ - char Password[256 + 1]; -}; -typedef struct _SecPkgContext_AuthPassword SecPkgContext_AuthPassword; + struct _SecPkgContext_AuthNtlmHash + { + int Version; + BYTE NtlmHash[16]; + }; + typedef struct _SecPkgContext_AuthNtlmHash SecPkgContext_AuthNtlmHash; -struct _SecPkgContext_AuthNtlmHash -{ - int Version; - BYTE NtlmHash[16]; -}; -typedef struct _SecPkgContext_AuthNtlmHash SecPkgContext_AuthNtlmHash; + struct _SecPkgContext_AuthNtlmTimestamp + { + BYTE Timestamp[8]; + BOOL ChallengeOrResponse; + }; + typedef struct _SecPkgContext_AuthNtlmTimestamp SecPkgContext_AuthNtlmTimestamp; -struct _SecPkgContext_AuthNtlmTimestamp -{ - BYTE Timestamp[8]; - BOOL ChallengeOrResponse; -}; -typedef struct _SecPkgContext_AuthNtlmTimestamp SecPkgContext_AuthNtlmTimestamp; + struct _SecPkgContext_AuthNtlmClientChallenge + { + BYTE ClientChallenge[8]; + }; + typedef struct _SecPkgContext_AuthNtlmClientChallenge SecPkgContext_AuthNtlmClientChallenge; -struct _SecPkgContext_AuthNtlmClientChallenge -{ - BYTE ClientChallenge[8]; -}; -typedef struct _SecPkgContext_AuthNtlmClientChallenge SecPkgContext_AuthNtlmClientChallenge; + struct _SecPkgContext_AuthNtlmServerChallenge + { + BYTE ServerChallenge[8]; + }; + typedef struct _SecPkgContext_AuthNtlmServerChallenge SecPkgContext_AuthNtlmServerChallenge; -struct _SecPkgContext_AuthNtlmServerChallenge -{ - BYTE ServerChallenge[8]; -}; -typedef struct _SecPkgContext_AuthNtlmServerChallenge SecPkgContext_AuthNtlmServerChallenge; + struct _SecPkgContext_AuthNtlmMessage + { + UINT32 type; + UINT32 length; + BYTE* buffer; + }; + typedef struct _SecPkgContext_AuthNtlmMessage SecPkgContext_AuthNtlmMessage; -struct _SecPkgContext_AuthNtlmMessage -{ - UINT32 type; - UINT32 length; - BYTE* buffer; -}; -typedef struct _SecPkgContext_AuthNtlmMessage SecPkgContext_AuthNtlmMessage; +#define SSPI_INTERFACE_WINPR 0x00000001 +#define SSPI_INTERFACE_NATIVE 0x00000002 -#define SSPI_INTERFACE_WINPR 0x00000001 -#define SSPI_INTERFACE_NATIVE 0x00000002 + typedef PSecurityFunctionTableA(SEC_ENTRY* INIT_SECURITY_INTERFACE_EX_A)(DWORD flags); + typedef PSecurityFunctionTableW(SEC_ENTRY* INIT_SECURITY_INTERFACE_EX_W)(DWORD flags); -typedef PSecurityFunctionTableA(SEC_ENTRY* INIT_SECURITY_INTERFACE_EX_A)(DWORD flags); -typedef PSecurityFunctionTableW(SEC_ENTRY* INIT_SECURITY_INTERFACE_EX_W)(DWORD flags); + WINPR_API void sspi_GlobalInit(void); + WINPR_API void sspi_GlobalFinish(void); -WINPR_API void sspi_GlobalInit(void); -WINPR_API void sspi_GlobalFinish(void); + WINPR_API void* sspi_SecBufferAlloc(PSecBuffer SecBuffer, ULONG size); + WINPR_API void sspi_SecBufferFree(PSecBuffer SecBuffer); -WINPR_API void* sspi_SecBufferAlloc(PSecBuffer SecBuffer, ULONG size); -WINPR_API void sspi_SecBufferFree(PSecBuffer SecBuffer); + WINPR_API int sspi_SetAuthIdentity(SEC_WINNT_AUTH_IDENTITY* identity, const char* user, + const char* domain, const char* password); + WINPR_API int sspi_SetAuthIdentityWithUnicodePassword(SEC_WINNT_AUTH_IDENTITY* identity, + const char* user, const char* domain, + LPWSTR password, ULONG passwordLength); + WINPR_API int sspi_CopyAuthIdentity(SEC_WINNT_AUTH_IDENTITY* identity, + SEC_WINNT_AUTH_IDENTITY* srcIdentity); -WINPR_API int sspi_SetAuthIdentity(SEC_WINNT_AUTH_IDENTITY* identity, const char* user, - const char* domain, const char* password); -WINPR_API int sspi_SetAuthIdentityWithUnicodePassword(SEC_WINNT_AUTH_IDENTITY* identity, - const char* user, const char* domain, - LPWSTR password, ULONG passwordLength); -WINPR_API int sspi_CopyAuthIdentity(SEC_WINNT_AUTH_IDENTITY* identity, - SEC_WINNT_AUTH_IDENTITY* srcIdentity); + WINPR_API const char* GetSecurityStatusString(SECURITY_STATUS status); -WINPR_API const char* GetSecurityStatusString(SECURITY_STATUS status); - -WINPR_API SecurityFunctionTableW* SEC_ENTRY InitSecurityInterfaceExW(DWORD flags); -WINPR_API SecurityFunctionTableA* SEC_ENTRY InitSecurityInterfaceExA(DWORD flags); + WINPR_API SecurityFunctionTableW* SEC_ENTRY InitSecurityInterfaceExW(DWORD flags); + WINPR_API SecurityFunctionTableA* SEC_ENTRY InitSecurityInterfaceExA(DWORD flags); #ifdef UNICODE #define InitSecurityInterfaceEx InitSecurityInterfaceExW diff --git a/winpr/include/winpr/sspicli.h b/winpr/include/winpr/sspicli.h index 017643dcb..aebd9d7bd 100644 --- a/winpr/include/winpr/sspicli.h +++ b/winpr/include/winpr/sspicli.h @@ -28,19 +28,19 @@ #ifndef _WIN32 -#define LOGON32_LOGON_INTERACTIVE 2 -#define LOGON32_LOGON_NETWORK 3 -#define LOGON32_LOGON_BATCH 4 -#define LOGON32_LOGON_SERVICE 5 -#define LOGON32_LOGON_UNLOCK 7 -#define LOGON32_LOGON_NETWORK_CLEARTEXT 8 -#define LOGON32_LOGON_NEW_CREDENTIALS 9 +#define LOGON32_LOGON_INTERACTIVE 2 +#define LOGON32_LOGON_NETWORK 3 +#define LOGON32_LOGON_BATCH 4 +#define LOGON32_LOGON_SERVICE 5 +#define LOGON32_LOGON_UNLOCK 7 +#define LOGON32_LOGON_NETWORK_CLEARTEXT 8 +#define LOGON32_LOGON_NEW_CREDENTIALS 9 -#define LOGON32_PROVIDER_DEFAULT 0 -#define LOGON32_PROVIDER_WINNT35 1 -#define LOGON32_PROVIDER_WINNT40 2 -#define LOGON32_PROVIDER_WINNT50 3 -#define LOGON32_PROVIDER_VIRTUAL 4 +#define LOGON32_PROVIDER_DEFAULT 0 +#define LOGON32_PROVIDER_WINNT35 1 +#define LOGON32_PROVIDER_WINNT40 2 +#define LOGON32_PROVIDER_WINNT50 3 +#define LOGON32_PROVIDER_VIRTUAL 4 typedef struct _QUOTA_LIMITS { @@ -57,10 +57,11 @@ typedef enum /* An unknown name type */ NameUnknown = 0, - /* The fully qualified distinguished name (for example, CN=Jeff Smith,OU=Users,DC=Engineering,DC=Microsoft,DC=Com) */ + /* The fully qualified distinguished name (for example, CN=Jeff + Smith,OU=Users,DC=Engineering,DC=Microsoft,DC=Com) */ NameFullyQualifiedDN = 1, - /* + /* * A legacy account name (for example, Engineering\JSmith). * The domain-only version includes trailing backslashes (\\) */ @@ -72,10 +73,11 @@ typedef enum */ NameDisplay = 3, - /* A GUID string that the IIDFromString function returns (for example, {4fa050f0-f561-11cf-bdd9-00aa003a77b6}) */ + /* A GUID string that the IIDFromString function returns (for example, + {4fa050f0-f561-11cf-bdd9-00aa003a77b6}) */ NameUniqueId = 6, - /* + /* * The complete canonical name (for example, engineering.microsoft.com/software/someone). * The domain-only version includes a trailing forward slash (/) */ @@ -84,7 +86,7 @@ typedef enum /* The user principal name (for example, someone@example.com) */ NameUserPrincipal = 8, - /* + /* * The same as NameCanonical except that the rightmost forward slash (/) * is replaced with a new line character (\n), even in a domain-only case * (for example, engineering.microsoft.com/software\nJSmith) @@ -97,44 +99,49 @@ typedef enum /* The DNS domain name followed by a backward-slash and the SAM user name */ NameDnsDomain = 12 -} EXTENDED_NAME_FORMAT, *PEXTENDED_NAME_FORMAT; +} EXTENDED_NAME_FORMAT, + *PEXTENDED_NAME_FORMAT; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API BOOL LogonUserA(LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword, - DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken); + WINPR_API BOOL LogonUserA(LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword, + DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken); -WINPR_API BOOL LogonUserW(LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPassword, - DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken); + WINPR_API BOOL LogonUserW(LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPassword, + DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken); -WINPR_API BOOL LogonUserExA(LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword, - DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken, PSID* ppLogonSid, - PVOID* ppProfileBuffer, LPDWORD pdwProfileLength, PQUOTA_LIMITS pQuotaLimits); + WINPR_API BOOL LogonUserExA(LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword, + DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken, + PSID* ppLogonSid, PVOID* ppProfileBuffer, LPDWORD pdwProfileLength, + PQUOTA_LIMITS pQuotaLimits); -WINPR_API BOOL LogonUserExW(LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPassword, - DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken, PSID* ppLogonSid, - PVOID* ppProfileBuffer, LPDWORD pdwProfileLength, PQUOTA_LIMITS pQuotaLimits); + WINPR_API BOOL LogonUserExW(LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPassword, + DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken, + PSID* ppLogonSid, PVOID* ppProfileBuffer, LPDWORD pdwProfileLength, + PQUOTA_LIMITS pQuotaLimits); -WINPR_API BOOL GetUserNameExA(EXTENDED_NAME_FORMAT NameFormat, LPSTR lpNameBuffer, PULONG nSize); -WINPR_API BOOL GetUserNameExW(EXTENDED_NAME_FORMAT NameFormat, LPWSTR lpNameBuffer, PULONG nSize); + WINPR_API BOOL GetUserNameExA(EXTENDED_NAME_FORMAT NameFormat, LPSTR lpNameBuffer, + PULONG nSize); + WINPR_API BOOL GetUserNameExW(EXTENDED_NAME_FORMAT NameFormat, LPWSTR lpNameBuffer, + PULONG nSize); #ifdef __cplusplus } #endif #ifdef UNICODE -#define LogonUser LogonUserW -#define LogonUserEx LogonUserExW -#define GetUserNameEx GetUserNameExW +#define LogonUser LogonUserW +#define LogonUserEx LogonUserExW +#define GetUserNameEx GetUserNameExW #else -#define LogonUser LogonUserA -#define LogonUserEx LogonUserExA -#define GetUserNameEx GetUserNameExA +#define LogonUser LogonUserA +#define LogonUserEx LogonUserExA +#define GetUserNameEx GetUserNameExA #endif #endif #endif /* WINPR_SSPICLI_H */ - diff --git a/winpr/include/winpr/stream.h b/winpr/include/winpr/stream.h index 0f81532a3..90571c3b6 100644 --- a/winpr/include/winpr/stream.h +++ b/winpr/include/winpr/stream.h @@ -29,98 +29,106 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct _wStreamPool wStreamPool; + typedef struct _wStreamPool wStreamPool; -struct _wStream -{ - BYTE* buffer; - BYTE* pointer; - size_t length; - size_t capacity; + struct _wStream + { + BYTE* buffer; + BYTE* pointer; + size_t length; + size_t capacity; - DWORD count; - wStreamPool* pool; - BOOL isAllocatedStream; - BOOL isOwner; -}; -typedef struct _wStream wStream; + DWORD count; + wStreamPool* pool; + BOOL isAllocatedStream; + BOOL isOwner; + }; + typedef struct _wStream wStream; -WINPR_API BOOL Stream_EnsureCapacity(wStream* s, size_t size); -WINPR_API BOOL Stream_EnsureRemainingCapacity(wStream* s, size_t size); + WINPR_API BOOL Stream_EnsureCapacity(wStream* s, size_t size); + WINPR_API BOOL Stream_EnsureRemainingCapacity(wStream* s, size_t size); -WINPR_API wStream* Stream_New(BYTE* buffer, size_t size); -WINPR_API void Stream_StaticInit(wStream* s, BYTE* buffer, size_t size); -WINPR_API void Stream_Free(wStream* s, BOOL bFreeBuffer); + WINPR_API wStream* Stream_New(BYTE* buffer, size_t size); + WINPR_API void Stream_StaticInit(wStream* s, BYTE* buffer, size_t size); + WINPR_API void Stream_Free(wStream* s, BOOL bFreeBuffer); -static INLINE void Stream_Seek(wStream* s, size_t _offset) -{ - s->pointer += (_offset); -} + static INLINE void Stream_Seek(wStream* s, size_t _offset) + { + s->pointer += (_offset); + } -static INLINE void Stream_Rewind(wStream* s, size_t _offset) -{ - s->pointer -= (_offset); -} + static INLINE void Stream_Rewind(wStream* s, size_t _offset) + { + s->pointer -= (_offset); + } -#define _stream_read_n8(_t, _s, _v, _p) do { \ - (_v) = \ - (_t)(*(_s)->pointer); \ - if (_p) Stream_Seek(_s, sizeof(_t)); } while (0) +#define _stream_read_n8(_t, _s, _v, _p) \ + do \ + { \ + (_v) = (_t)(*(_s)->pointer); \ + if (_p) \ + Stream_Seek(_s, sizeof(_t)); \ + } while (0) -#define _stream_read_n16_le(_t, _s, _v, _p) do { \ - (_v) = \ - (_t)(*(_s)->pointer) + \ - (_t)(((_t)(*((_s)->pointer + 1))) << 8); \ - if (_p) Stream_Seek(_s, sizeof(_t)); } while (0) +#define _stream_read_n16_le(_t, _s, _v, _p) \ + do \ + { \ + (_v) = (_t)(*(_s)->pointer) + (_t)(((_t)(*((_s)->pointer + 1))) << 8); \ + if (_p) \ + Stream_Seek(_s, sizeof(_t)); \ + } while (0) -#define _stream_read_n16_be(_t, _s, _v, _p) do { \ - (_v) = \ - (_t)(((_t)(*(_s)->pointer)) << 8) + \ - (_t)(*((_s)->pointer + 1)); \ - if (_p) Stream_Seek(_s, sizeof(_t)); } while (0) +#define _stream_read_n16_be(_t, _s, _v, _p) \ + do \ + { \ + (_v) = (_t)(((_t)(*(_s)->pointer)) << 8) + (_t)(*((_s)->pointer + 1)); \ + if (_p) \ + Stream_Seek(_s, sizeof(_t)); \ + } while (0) -#define _stream_read_n32_le(_t, _s, _v, _p) do { \ - (_v) = \ - (_t)(*(_s)->pointer) + \ - (((_t)(*((_s)->pointer + 1))) << 8) + \ - (((_t)(*((_s)->pointer + 2))) << 16) + \ - (((_t)(*((_s)->pointer + 3))) << 24); \ - if (_p) Stream_Seek(_s, sizeof(_t)); } while (0) +#define _stream_read_n32_le(_t, _s, _v, _p) \ + do \ + { \ + (_v) = (_t)(*(_s)->pointer) + (((_t)(*((_s)->pointer + 1))) << 8) + \ + (((_t)(*((_s)->pointer + 2))) << 16) + (((_t)(*((_s)->pointer + 3))) << 24); \ + if (_p) \ + Stream_Seek(_s, sizeof(_t)); \ + } while (0) -#define _stream_read_n32_be(_t, _s, _v, _p) do { \ - (_v) = \ - (((_t)(*((_s)->pointer))) << 24) + \ - (((_t)(*((_s)->pointer + 1))) << 16) + \ - (((_t)(*((_s)->pointer + 2))) << 8) + \ - (((_t)(*((_s)->pointer + 3)))); \ - if (_p) Stream_Seek(_s, sizeof(_t)); } while (0) +#define _stream_read_n32_be(_t, _s, _v, _p) \ + do \ + { \ + (_v) = (((_t)(*((_s)->pointer))) << 24) + (((_t)(*((_s)->pointer + 1))) << 16) + \ + (((_t)(*((_s)->pointer + 2))) << 8) + (((_t)(*((_s)->pointer + 3)))); \ + if (_p) \ + Stream_Seek(_s, sizeof(_t)); \ + } while (0) -#define _stream_read_n64_le(_t, _s, _v, _p) do { \ - (_v) = \ - (_t)(*(_s)->pointer) + \ - (((_t)(*((_s)->pointer + 1))) << 8) + \ - (((_t)(*((_s)->pointer + 2))) << 16) + \ - (((_t)(*((_s)->pointer + 3))) << 24) + \ - (((_t)(*((_s)->pointer + 4))) << 32) + \ - (((_t)(*((_s)->pointer + 5))) << 40) + \ - (((_t)(*((_s)->pointer + 6))) << 48) + \ - (((_t)(*((_s)->pointer + 7))) << 56); \ - if (_p) Stream_Seek(_s, sizeof(_t)); } while (0) +#define _stream_read_n64_le(_t, _s, _v, _p) \ + do \ + { \ + (_v) = (_t)(*(_s)->pointer) + (((_t)(*((_s)->pointer + 1))) << 8) + \ + (((_t)(*((_s)->pointer + 2))) << 16) + (((_t)(*((_s)->pointer + 3))) << 24) + \ + (((_t)(*((_s)->pointer + 4))) << 32) + (((_t)(*((_s)->pointer + 5))) << 40) + \ + (((_t)(*((_s)->pointer + 6))) << 48) + (((_t)(*((_s)->pointer + 7))) << 56); \ + if (_p) \ + Stream_Seek(_s, sizeof(_t)); \ + } while (0) -#define _stream_read_n64_be(_t, _s, _v, _p) do { \ - (_v) = \ - (((_t)(*((_s)->pointer))) << 56) + \ - (((_t)(*((_s)->pointer + 1))) << 48) + \ - (((_t)(*((_s)->pointer + 2))) << 40) + \ - (((_t)(*((_s)->pointer + 3))) << 32) + \ - (((_t)(*((_s)->pointer + 4))) << 24) + \ - (((_t)(*((_s)->pointer + 5))) << 16) + \ - (((_t)(*((_s)->pointer + 6))) << 8) + \ - (((_t)(*((_s)->pointer + 7)))); \ - if (_p) Stream_Seek(_s, sizeof(_t)); } while (0) +#define _stream_read_n64_be(_t, _s, _v, _p) \ + do \ + { \ + (_v) = (((_t)(*((_s)->pointer))) << 56) + (((_t)(*((_s)->pointer + 1))) << 48) + \ + (((_t)(*((_s)->pointer + 2))) << 40) + (((_t)(*((_s)->pointer + 3))) << 32) + \ + (((_t)(*((_s)->pointer + 4))) << 24) + (((_t)(*((_s)->pointer + 5))) << 16) + \ + (((_t)(*((_s)->pointer + 6))) << 8) + (((_t)(*((_s)->pointer + 7)))); \ + if (_p) \ + Stream_Seek(_s, sizeof(_t)); \ + } while (0) #define Stream_Read_UINT8(_s, _v) _stream_read_n8(UINT8, _s, _v, TRUE) #define Stream_Read_INT8(_s, _v) _stream_read_n8(INT8, _s, _v, TRUE) @@ -143,11 +151,11 @@ static INLINE void Stream_Rewind(wStream* s, size_t _offset) #define Stream_Read_UINT64_BE(_s, _v) _stream_read_n64_be(UINT64, _s, _v, TRUE) #define Stream_Read_INT64_BE(_s, _v) _stream_read_n64_be(INT64, _s, _v, TRUE) -static INLINE void Stream_Read(wStream* _s, void* _b, size_t _n) -{ - memcpy(_b, (_s->pointer), (_n)); - Stream_Seek(_s, _n); -} + static INLINE void Stream_Read(wStream* _s, void* _b, size_t _n) + { + memcpy(_b, (_s->pointer), (_n)); + Stream_Seek(_s, _n); + } #define Stream_Peek_UINT8(_s, _v) _stream_read_n8(UINT8, _s, _v, FALSE) #define Stream_Peek_INT8(_s, _v) _stream_read_n8(INT8, _s, _v, FALSE) @@ -170,243 +178,243 @@ static INLINE void Stream_Read(wStream* _s, void* _b, size_t _n) #define Stream_Peek_UINT64_BE(_s, _v) _stream_read_n64_be(UINT64, _s, _v, FALSE) #define Stream_Peek_INT64_BE(_s, _v) _stream_read_n64_be(INT64, _s, _v, FALSE) -static INLINE void Stream_Peek(wStream* _s, void* _b, size_t _n) -{ - memcpy(_b, (_s->pointer), (_n)); -} - -static INLINE void Stream_Write_UINT8(wStream* _s, UINT8 _v) -{ - *_s->pointer++ = (UINT8)(_v); -} - -static INLINE void Stream_Write_INT16(wStream* _s, INT16 _v) -{ - *_s->pointer++ = (_v) & 0xFF; - *_s->pointer++ = ((_v) >> 8) & 0xFF; -} - -static INLINE void Stream_Write_UINT16(wStream* _s, UINT16 _v) -{ - *_s->pointer++ = (_v) & 0xFF; - *_s->pointer++ = ((_v) >> 8) & 0xFF; -} - -static INLINE void Stream_Write_UINT16_BE(wStream* _s, UINT16 _v) -{ - *_s->pointer++ = ((_v) >> 8) & 0xFF; - *_s->pointer++ = (_v) & 0xFF; -} - -static INLINE void Stream_Write_UINT32(wStream* _s, UINT32 _v) -{ - *_s->pointer++ = (_v) & 0xFF; - *_s->pointer++ = ((_v) >> 8) & 0xFF; - *_s->pointer++ = ((_v) >> 16) & 0xFF; - *_s->pointer++ = ((_v) >> 24) & 0xFF; -} - -static INLINE void Stream_Write_UINT32_BE(wStream* _s, UINT32 _v) -{ - Stream_Write_UINT16_BE(_s, ((_v) >> 16 & 0xFFFF)); - Stream_Write_UINT16_BE(_s, ((_v) & 0xFFFF)); -} - -static INLINE void Stream_Write_UINT64(wStream* _s, UINT64 _v) -{ - *_s->pointer++ = (UINT64)(_v) & 0xFF; - *_s->pointer++ = ((UINT64)(_v) >> 8) & 0xFF; - *_s->pointer++ = ((UINT64)(_v) >> 16) & 0xFF; - *_s->pointer++ = ((UINT64)(_v) >> 24) & 0xFF; - *_s->pointer++ = ((UINT64)(_v) >> 32) & 0xFF; - *_s->pointer++ = ((UINT64)(_v) >> 40) & 0xFF; - *_s->pointer++ = ((UINT64)(_v) >> 48) & 0xFF; - *_s->pointer++ = ((UINT64)(_v) >> 56) & 0xFF; -} -static INLINE void Stream_Write(wStream* _s, const void* _b, size_t _n) -{ - if (_n > 0) + static INLINE void Stream_Peek(wStream* _s, void* _b, size_t _n) { - memcpy(_s->pointer, (_b), (_n)); + memcpy(_b, (_s->pointer), (_n)); + } + + static INLINE void Stream_Write_UINT8(wStream* _s, UINT8 _v) + { + *_s->pointer++ = (UINT8)(_v); + } + + static INLINE void Stream_Write_INT16(wStream* _s, INT16 _v) + { + *_s->pointer++ = (_v)&0xFF; + *_s->pointer++ = ((_v) >> 8) & 0xFF; + } + + static INLINE void Stream_Write_UINT16(wStream* _s, UINT16 _v) + { + *_s->pointer++ = (_v)&0xFF; + *_s->pointer++ = ((_v) >> 8) & 0xFF; + } + + static INLINE void Stream_Write_UINT16_BE(wStream* _s, UINT16 _v) + { + *_s->pointer++ = ((_v) >> 8) & 0xFF; + *_s->pointer++ = (_v)&0xFF; + } + + static INLINE void Stream_Write_UINT32(wStream* _s, UINT32 _v) + { + *_s->pointer++ = (_v)&0xFF; + *_s->pointer++ = ((_v) >> 8) & 0xFF; + *_s->pointer++ = ((_v) >> 16) & 0xFF; + *_s->pointer++ = ((_v) >> 24) & 0xFF; + } + + static INLINE void Stream_Write_UINT32_BE(wStream* _s, UINT32 _v) + { + Stream_Write_UINT16_BE(_s, ((_v) >> 16 & 0xFFFF)); + Stream_Write_UINT16_BE(_s, ((_v)&0xFFFF)); + } + + static INLINE void Stream_Write_UINT64(wStream* _s, UINT64 _v) + { + *_s->pointer++ = (UINT64)(_v)&0xFF; + *_s->pointer++ = ((UINT64)(_v) >> 8) & 0xFF; + *_s->pointer++ = ((UINT64)(_v) >> 16) & 0xFF; + *_s->pointer++ = ((UINT64)(_v) >> 24) & 0xFF; + *_s->pointer++ = ((UINT64)(_v) >> 32) & 0xFF; + *_s->pointer++ = ((UINT64)(_v) >> 40) & 0xFF; + *_s->pointer++ = ((UINT64)(_v) >> 48) & 0xFF; + *_s->pointer++ = ((UINT64)(_v) >> 56) & 0xFF; + } + static INLINE void Stream_Write(wStream* _s, const void* _b, size_t _n) + { + if (_n > 0) + { + memcpy(_s->pointer, (_b), (_n)); + Stream_Seek(_s, _n); + } + } + +#define Stream_Seek_UINT8(_s) Stream_Seek(_s, 1) +#define Stream_Seek_UINT16(_s) Stream_Seek(_s, 2) +#define Stream_Seek_UINT32(_s) Stream_Seek(_s, 4) +#define Stream_Seek_UINT64(_s) Stream_Seek(_s, 8) + +#define Stream_Rewind_UINT8(_s) Stream_Rewind(_s, 1) +#define Stream_Rewind_UINT16(_s) Stream_Rewind(_s, 2) +#define Stream_Rewind_UINT32(_s) Stream_Rewind(_s, 4) +#define Stream_Rewind_UINT64(_s) Stream_Rewind(_s, 8) + + static INLINE void Stream_Zero(wStream* _s, size_t _n) + { + memset(_s->pointer, '\0', (_n)); Stream_Seek(_s, _n); } -} -#define Stream_Seek_UINT8(_s) Stream_Seek(_s, 1) -#define Stream_Seek_UINT16(_s) Stream_Seek(_s, 2) -#define Stream_Seek_UINT32(_s) Stream_Seek(_s, 4) -#define Stream_Seek_UINT64(_s) Stream_Seek(_s, 8) + static INLINE void Stream_Fill(wStream* _s, int _v, size_t _n) + { + memset(_s->pointer, _v, (_n)); + Stream_Seek(_s, _n); + } -#define Stream_Rewind_UINT8(_s) Stream_Rewind(_s, 1) -#define Stream_Rewind_UINT16(_s) Stream_Rewind(_s, 2) -#define Stream_Rewind_UINT32(_s) Stream_Rewind(_s, 4) -#define Stream_Rewind_UINT64(_s) Stream_Rewind(_s, 8) + static INLINE void Stream_Copy(wStream* _src, wStream* _dst, size_t _n) + { + memcpy(_dst->pointer, _src->pointer, _n); + Stream_Seek(_dst, _n); + Stream_Seek(_src, _n); + } -static INLINE void Stream_Zero(wStream* _s, size_t _n) -{ - memset(_s->pointer, '\0', (_n)); - Stream_Seek(_s, _n); -} + static INLINE BYTE* Stream_Buffer(wStream* _s) + { + return _s->buffer; + } -static INLINE void Stream_Fill(wStream* _s, int _v, size_t _n) -{ - memset(_s->pointer, _v, (_n)); - Stream_Seek(_s, _n); -} +#define Stream_GetBuffer(_s, _b) _b = Stream_Buffer(_s) + static INLINE void Stream_SetBuffer(wStream* _s, BYTE* _b) + { + _s->buffer = _b; + } -static INLINE void Stream_Copy(wStream* _src, wStream* _dst, size_t _n) -{ - memcpy(_dst->pointer, _src->pointer, _n); - Stream_Seek(_dst, _n); - Stream_Seek(_src, _n); -} + static INLINE BYTE* Stream_Pointer(wStream* _s) + { + return _s->pointer; + } -static INLINE BYTE* Stream_Buffer(wStream* _s) -{ - return _s->buffer; -} +#define Stream_GetPointer(_s, _p) _p = Stream_Pointer(_s) + static INLINE void Stream_SetPointer(wStream* _s, BYTE* _p) + { + _s->pointer = _p; + } -#define Stream_GetBuffer(_s, _b) _b = Stream_Buffer(_s) -static INLINE void Stream_SetBuffer(wStream* _s, BYTE* _b) -{ - _s->buffer = _b; -} + static INLINE size_t Stream_Length(wStream* _s) + { + return _s->length; + } -static INLINE BYTE* Stream_Pointer(wStream* _s) -{ - return _s->pointer; -} +#define Stream_GetLength(_s, _l) _l = Stream_Length(_s) + static INLINE void Stream_SetLength(wStream* _s, size_t _l) + { + _s->length = _l; + } -#define Stream_GetPointer(_s, _p) _p = Stream_Pointer(_s) -static INLINE void Stream_SetPointer(wStream* _s, BYTE* _p) -{ - _s->pointer = _p; -} + static INLINE size_t Stream_Capacity(wStream* _s) + { + return _s->capacity; + } -static INLINE size_t Stream_Length(wStream* _s) -{ - return _s->length; -} +#define Stream_GetCapacity(_s, _c) _c = Stream_Capacity(_s); + static INLINE void Stream_SetCapacity(wStream* _s, size_t _c) + { + _s->capacity = _c; + } -#define Stream_GetLength(_s, _l) _l = Stream_Length(_s) -static INLINE void Stream_SetLength(wStream* _s, size_t _l) -{ - _s->length = _l; -} + static INLINE size_t Stream_GetPosition(wStream* _s) + { + return (_s->pointer - _s->buffer); + } -static INLINE size_t Stream_Capacity(wStream* _s) -{ - return _s->capacity; -} + static INLINE void Stream_SetPosition(wStream* _s, size_t _p) + { + _s->pointer = _s->buffer + (_p); + } -#define Stream_GetCapacity(_s, _c) _c = Stream_Capacity(_s); -static INLINE void Stream_SetCapacity(wStream* _s, size_t _c) -{ - _s->capacity = _c; -} + static INLINE void Stream_SealLength(wStream* _s) + { + _s->length = (_s->pointer - _s->buffer); + } -static INLINE size_t Stream_GetPosition(wStream* _s) -{ - return (_s->pointer - _s->buffer); -} + static INLINE size_t Stream_GetRemainingCapacity(wStream* _s) + { + return (_s->capacity - (_s->pointer - _s->buffer)); + } -static INLINE void Stream_SetPosition(wStream* _s, size_t _p) -{ - _s->pointer = _s->buffer + (_p); -} + static INLINE size_t Stream_GetRemainingLength(wStream* _s) + { + return (_s->length - (_s->pointer - _s->buffer)); + } -static INLINE void Stream_SealLength(wStream* _s) -{ - _s->length = (_s->pointer - _s->buffer); -} + static INLINE void Stream_Clear(wStream* _s) + { + memset(_s->buffer, 0, _s->capacity); + } -static INLINE size_t Stream_GetRemainingCapacity(wStream* _s) -{ - return (_s->capacity - (_s->pointer - _s->buffer)); -} + static INLINE BOOL Stream_SafeSeek(wStream* s, size_t size) + { + if (Stream_GetRemainingLength(s) < size) + return FALSE; -static INLINE size_t Stream_GetRemainingLength(wStream* _s) -{ - return (_s->length - (_s->pointer - _s->buffer)); -} + Stream_Seek(s, size); + return TRUE; + } -static INLINE void Stream_Clear(wStream* _s) -{ - memset(_s->buffer, 0, _s->capacity); -} + static INLINE BOOL Stream_Read_UTF16_String(wStream* s, WCHAR* dst, size_t length) + { + size_t x; -static INLINE BOOL Stream_SafeSeek(wStream* s, size_t size) -{ - if (Stream_GetRemainingLength(s) < size) - return FALSE; + if (!s || !dst) + return FALSE; - Stream_Seek(s, size); - return TRUE; -} + if (Stream_GetRemainingLength(s) / sizeof(WCHAR) < length) + return FALSE; -static INLINE BOOL Stream_Read_UTF16_String(wStream* s, WCHAR* dst, size_t length) -{ - size_t x; + for (x = 0; x < length; x++) + Stream_Read_UINT16(s, dst[x]); - if (!s || !dst) - return FALSE; + return TRUE; + } - if (Stream_GetRemainingLength(s) / sizeof(WCHAR) < length) - return FALSE; + static INLINE BOOL Stream_Write_UTF16_String(wStream* s, const WCHAR* src, size_t length) + { + size_t x; - for (x = 0; x < length; x++) - Stream_Read_UINT16(s, dst[x]); + if (!s || !src) + return FALSE; - return TRUE; -} + if (Stream_GetRemainingCapacity(s) / sizeof(WCHAR) < length) + return FALSE; -static INLINE BOOL Stream_Write_UTF16_String(wStream* s, const WCHAR* src, size_t length) -{ - size_t x; + for (x = 0; x < length; x++) + Stream_Write_UINT16(s, src[x]); - if (!s || !src) - return FALSE; + return TRUE; + } - if (Stream_GetRemainingCapacity(s) / sizeof(WCHAR) < length) - return FALSE; + /* StreamPool */ - for (x = 0; x < length; x++) - Stream_Write_UINT16(s, src[x]); + struct _wStreamPool + { + int aSize; + int aCapacity; + wStream** aArray; - return TRUE; -} + int uSize; + int uCapacity; + wStream** uArray; -/* StreamPool */ + CRITICAL_SECTION lock; + BOOL synchronized; + size_t defaultSize; + }; -struct _wStreamPool -{ - int aSize; - int aCapacity; - wStream** aArray; + WINPR_API wStream* StreamPool_Take(wStreamPool* pool, size_t size); + WINPR_API void StreamPool_Return(wStreamPool* pool, wStream* s); - int uSize; - int uCapacity; - wStream** uArray; + WINPR_API void Stream_AddRef(wStream* s); + WINPR_API void Stream_Release(wStream* s); - CRITICAL_SECTION lock; - BOOL synchronized; - size_t defaultSize; -}; + WINPR_API wStream* StreamPool_Find(wStreamPool* pool, BYTE* ptr); + WINPR_API void StreamPool_AddRef(wStreamPool* pool, BYTE* ptr); + WINPR_API void StreamPool_Release(wStreamPool* pool, BYTE* ptr); -WINPR_API wStream* StreamPool_Take(wStreamPool* pool, size_t size); -WINPR_API void StreamPool_Return(wStreamPool* pool, wStream* s); + WINPR_API void StreamPool_Clear(wStreamPool* pool); -WINPR_API void Stream_AddRef(wStream* s); -WINPR_API void Stream_Release(wStream* s); - -WINPR_API wStream* StreamPool_Find(wStreamPool* pool, BYTE* ptr); -WINPR_API void StreamPool_AddRef(wStreamPool* pool, BYTE* ptr); -WINPR_API void StreamPool_Release(wStreamPool* pool, BYTE* ptr); - -WINPR_API void StreamPool_Clear(wStreamPool* pool); - -WINPR_API wStreamPool* StreamPool_New(BOOL synchronized, size_t defaultSize); -WINPR_API void StreamPool_Free(wStreamPool* pool); + WINPR_API wStreamPool* StreamPool_New(BOOL synchronized, size_t defaultSize); + WINPR_API void StreamPool_Free(wStreamPool* pool); #ifdef __cplusplus } diff --git a/winpr/include/winpr/string.h b/winpr/include/winpr/string.h index d3cd29dc2..8ce83bc1d 100644 --- a/winpr/include/winpr/string.h +++ b/winpr/include/winpr/string.h @@ -27,191 +27,186 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif #ifndef _WIN32 -#define CSTR_LESS_THAN 1 -#define CSTR_EQUAL 2 -#define CSTR_GREATER_THAN 3 +#define CSTR_LESS_THAN 1 +#define CSTR_EQUAL 2 +#define CSTR_GREATER_THAN 3 -#define CP_ACP 0 -#define CP_OEMCP 1 -#define CP_MACCP 2 -#define CP_THREAD_ACP 3 -#define CP_SYMBOL 42 -#define CP_UTF7 65000 -#define CP_UTF8 65001 +#define CP_ACP 0 +#define CP_OEMCP 1 +#define CP_MACCP 2 +#define CP_THREAD_ACP 3 +#define CP_SYMBOL 42 +#define CP_UTF7 65000 +#define CP_UTF8 65001 -#define MB_PRECOMPOSED 0x00000001 -#define MB_COMPOSITE 0x00000002 -#define MB_USEGLYPHCHARS 0x00000004 -#define MB_ERR_INVALID_CHARS 0x00000008 +#define MB_PRECOMPOSED 0x00000001 +#define MB_COMPOSITE 0x00000002 +#define MB_USEGLYPHCHARS 0x00000004 +#define MB_ERR_INVALID_CHARS 0x00000008 -WINPR_API char* _strdup(const char* strSource); -WINPR_API WCHAR* _wcsdup(const WCHAR* strSource); + WINPR_API char* _strdup(const char* strSource); + WINPR_API WCHAR* _wcsdup(const WCHAR* strSource); -WINPR_API int _stricmp(const char* string1, const char* string2); -WINPR_API int _strnicmp(const char* string1, const char* string2, size_t count); + WINPR_API int _stricmp(const char* string1, const char* string2); + WINPR_API int _strnicmp(const char* string1, const char* string2, size_t count); -WINPR_API int _wcscmp(const WCHAR* string1, const WCHAR* string2); + WINPR_API int _wcscmp(const WCHAR* string1, const WCHAR* string2); -WINPR_API size_t _wcslen(const WCHAR* str); -WINPR_API size_t _wcsnlen(const WCHAR* str, size_t maxNumberOfElements); + WINPR_API size_t _wcslen(const WCHAR* str); + WINPR_API size_t _wcsnlen(const WCHAR* str, size_t maxNumberOfElements); -WINPR_API WCHAR* _wcschr(const WCHAR* str, WCHAR c); -WINPR_API WCHAR* _wcsrchr(const WCHAR* str, WCHAR c); + WINPR_API WCHAR* _wcschr(const WCHAR* str, WCHAR c); + WINPR_API WCHAR* _wcsrchr(const WCHAR* str, WCHAR c); -WINPR_API char* strtok_s(char* strToken, const char* strDelimit, - char** context); -WINPR_API WCHAR* wcstok_s(WCHAR* strToken, const WCHAR* strDelimit, - WCHAR** context); + WINPR_API char* strtok_s(char* strToken, const char* strDelimit, char** context); + WINPR_API WCHAR* wcstok_s(WCHAR* strToken, const WCHAR* strDelimit, WCHAR** context); #else -#define _wcscmp wcscmp -#define _wcslen wcslen -#define _wcsnlen wcsnlen -#define _wcschr wcschr -#define _wcsrchr wcsrchr +#define _wcscmp wcscmp +#define _wcslen wcslen +#define _wcsnlen wcsnlen +#define _wcschr wcschr +#define _wcsrchr wcsrchr #endif #if !defined(_WIN32) || defined(_UWP) -WINPR_API LPSTR CharUpperA(LPSTR lpsz); -WINPR_API LPWSTR CharUpperW(LPWSTR lpsz); + WINPR_API LPSTR CharUpperA(LPSTR lpsz); + WINPR_API LPWSTR CharUpperW(LPWSTR lpsz); #ifdef UNICODE -#define CharUpper CharUpperW +#define CharUpper CharUpperW #else -#define CharUpper CharUpperA +#define CharUpper CharUpperA #endif -WINPR_API DWORD CharUpperBuffA(LPSTR lpsz, DWORD cchLength); -WINPR_API DWORD CharUpperBuffW(LPWSTR lpsz, DWORD cchLength); + WINPR_API DWORD CharUpperBuffA(LPSTR lpsz, DWORD cchLength); + WINPR_API DWORD CharUpperBuffW(LPWSTR lpsz, DWORD cchLength); #ifdef UNICODE -#define CharUpperBuff CharUpperBuffW +#define CharUpperBuff CharUpperBuffW #else -#define CharUpperBuff CharUpperBuffA +#define CharUpperBuff CharUpperBuffA #endif -WINPR_API LPSTR CharLowerA(LPSTR lpsz); -WINPR_API LPWSTR CharLowerW(LPWSTR lpsz); + WINPR_API LPSTR CharLowerA(LPSTR lpsz); + WINPR_API LPWSTR CharLowerW(LPWSTR lpsz); #ifdef UNICODE -#define CharLower CharLowerW +#define CharLower CharLowerW #else -#define CharLower CharLowerA +#define CharLower CharLowerA #endif -WINPR_API DWORD CharLowerBuffA(LPSTR lpsz, DWORD cchLength); -WINPR_API DWORD CharLowerBuffW(LPWSTR lpsz, DWORD cchLength); + WINPR_API DWORD CharLowerBuffA(LPSTR lpsz, DWORD cchLength); + WINPR_API DWORD CharLowerBuffW(LPWSTR lpsz, DWORD cchLength); #ifdef UNICODE -#define CharLowerBuff CharLowerBuffW +#define CharLowerBuff CharLowerBuffW #else -#define CharLowerBuff CharLowerBuffA +#define CharLowerBuff CharLowerBuffA #endif -WINPR_API BOOL IsCharAlphaA(CHAR ch); -WINPR_API BOOL IsCharAlphaW(WCHAR ch); + WINPR_API BOOL IsCharAlphaA(CHAR ch); + WINPR_API BOOL IsCharAlphaW(WCHAR ch); #ifdef UNICODE -#define IsCharAlpha IsCharAlphaW +#define IsCharAlpha IsCharAlphaW #else -#define IsCharAlpha IsCharAlphaA +#define IsCharAlpha IsCharAlphaA #endif -WINPR_API BOOL IsCharAlphaNumericA(CHAR ch); -WINPR_API BOOL IsCharAlphaNumericW(WCHAR ch); + WINPR_API BOOL IsCharAlphaNumericA(CHAR ch); + WINPR_API BOOL IsCharAlphaNumericW(WCHAR ch); #ifdef UNICODE -#define IsCharAlphaNumeric IsCharAlphaNumericW +#define IsCharAlphaNumeric IsCharAlphaNumericW #else -#define IsCharAlphaNumeric IsCharAlphaNumericA +#define IsCharAlphaNumeric IsCharAlphaNumericA #endif -WINPR_API BOOL IsCharUpperA(CHAR ch); -WINPR_API BOOL IsCharUpperW(WCHAR ch); + WINPR_API BOOL IsCharUpperA(CHAR ch); + WINPR_API BOOL IsCharUpperW(WCHAR ch); #ifdef UNICODE -#define IsCharUpper IsCharUpperW +#define IsCharUpper IsCharUpperW #else -#define IsCharUpper IsCharUpperA +#define IsCharUpper IsCharUpperA #endif -WINPR_API BOOL IsCharLowerA(CHAR ch); -WINPR_API BOOL IsCharLowerW(WCHAR ch); + WINPR_API BOOL IsCharLowerA(CHAR ch); + WINPR_API BOOL IsCharLowerW(WCHAR ch); #ifdef UNICODE -#define IsCharLower IsCharLowerW +#define IsCharLower IsCharLowerW #else -#define IsCharLower IsCharLowerA +#define IsCharLower IsCharLowerA #endif -WINPR_API int lstrlenA(LPCSTR lpString); -WINPR_API int lstrlenW(LPCWSTR lpString); + WINPR_API int lstrlenA(LPCSTR lpString); + WINPR_API int lstrlenW(LPCWSTR lpString); #ifdef UNICODE -#define lstrlen lstrlenW +#define lstrlen lstrlenW #else -#define lstrlen lstrlenA +#define lstrlen lstrlenA #endif -WINPR_API int lstrcmpA(LPCSTR lpString1, LPCSTR lpString2); -WINPR_API int lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2); + WINPR_API int lstrcmpA(LPCSTR lpString1, LPCSTR lpString2); + WINPR_API int lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2); #ifdef UNICODE -#define lstrcmp lstrcmpW +#define lstrcmp lstrcmpW #else -#define lstrcmp lstrcmpA +#define lstrcmp lstrcmpA #endif #endif #ifndef _WIN32 -#define sprintf_s snprintf -#define _snprintf snprintf +#define sprintf_s snprintf +#define _snprintf snprintf #define _scprintf(...) snprintf(NULL, 0, __VA_ARGS__) -#define _scprintf(...) snprintf(NULL, 0, __VA_ARGS__) +#define _scprintf(...) snprintf(NULL, 0, __VA_ARGS__) -/* Unicode Conversion */ + /* Unicode Conversion */ -WINPR_API int MultiByteToWideChar(UINT CodePage, DWORD dwFlags, - LPCSTR lpMultiByteStr, - int cbMultiByte, LPWSTR lpWideCharStr, int cchWideChar); + WINPR_API int MultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, + int cbMultiByte, LPWSTR lpWideCharStr, int cchWideChar); -WINPR_API int WideCharToMultiByte(UINT CodePage, DWORD dwFlags, - LPCWSTR lpWideCharStr, int cchWideChar, - LPSTR lpMultiByteStr, int cbMultiByte, LPCSTR lpDefaultChar, - LPBOOL lpUsedDefaultChar); + WINPR_API int WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, + int cchWideChar, LPSTR lpMultiByteStr, int cbMultiByte, + LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar); #endif -/* Extended API */ + /* Extended API */ -WINPR_API int ConvertToUnicode(UINT CodePage, DWORD dwFlags, - LPCSTR lpMultiByteStr, - int cbMultiByte, LPWSTR* lpWideCharStr, int cchWideChar); + WINPR_API int ConvertToUnicode(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, + int cbMultiByte, LPWSTR* lpWideCharStr, int cchWideChar); -WINPR_API int ConvertFromUnicode(UINT CodePage, DWORD dwFlags, - LPCWSTR lpWideCharStr, int cchWideChar, - LPSTR* lpMultiByteStr, int cbMultiByte, LPCSTR lpDefaultChar, - LPBOOL lpUsedDefaultChar); + WINPR_API int ConvertFromUnicode(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, + int cchWideChar, LPSTR* lpMultiByteStr, int cbMultiByte, + LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar); -WINPR_API void ByteSwapUnicode(WCHAR* wstr, int length); + WINPR_API void ByteSwapUnicode(WCHAR* wstr, int length); -WINPR_API int ConvertLineEndingToLF(char* str, int size); -WINPR_API char* ConvertLineEndingToCRLF(const char* str, int* size); + WINPR_API int ConvertLineEndingToLF(char* str, int size); + WINPR_API char* ConvertLineEndingToCRLF(const char* str, int* size); -WINPR_API char* StrSep(char** stringp, const char* delim); + WINPR_API char* StrSep(char** stringp, const char* delim); -WINPR_API INT64 GetLine(char** lineptr, size_t* size, FILE* stream); + WINPR_API INT64 GetLine(char** lineptr, size_t* size, FILE* stream); #ifdef __cplusplus } diff --git a/winpr/include/winpr/strlst.h b/winpr/include/winpr/strlst.h index ccbade55f..346946da1 100644 --- a/winpr/include/winpr/strlst.h +++ b/winpr/include/winpr/strlst.h @@ -25,14 +25,14 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API void string_list_free(char** string_list); -WINPR_API int string_list_length(const char* const* string_list); -WINPR_API char** string_list_copy(const char* const* string_list); -WINPR_API void string_list_print(FILE* out, const char* const* string_list); - + WINPR_API void string_list_free(char** string_list); + WINPR_API int string_list_length(const char* const* string_list); + WINPR_API char** string_list_copy(const char* const* string_list); + WINPR_API void string_list_print(FILE* out, const char* const* string_list); #ifdef __cplusplus } diff --git a/winpr/include/winpr/synch.h b/winpr/include/winpr/synch.h index a94061d48..4921e625b 100644 --- a/winpr/include/winpr/synch.h +++ b/winpr/include/winpr/synch.h @@ -34,7 +34,8 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif #ifndef _WIN32 @@ -42,103 +43,103 @@ extern "C" { /* Mutex */ #define CREATE_MUTEX_INITIAL_OWNER 0x00000001 -WINPR_API HANDLE CreateMutexA(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, - LPCSTR lpName); -WINPR_API HANDLE CreateMutexW(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, - LPCWSTR lpName); + WINPR_API HANDLE CreateMutexA(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, + LPCSTR lpName); + WINPR_API HANDLE CreateMutexW(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, + LPCWSTR lpName); -WINPR_API HANDLE CreateMutexExA(LPSECURITY_ATTRIBUTES lpMutexAttributes, LPCSTR lpName, - DWORD dwFlags, DWORD dwDesiredAccess); -WINPR_API HANDLE CreateMutexExW(LPSECURITY_ATTRIBUTES lpMutexAttributes, LPCWSTR lpName, - DWORD dwFlags, DWORD dwDesiredAccess); + WINPR_API HANDLE CreateMutexExA(LPSECURITY_ATTRIBUTES lpMutexAttributes, LPCSTR lpName, + DWORD dwFlags, DWORD dwDesiredAccess); + WINPR_API HANDLE CreateMutexExW(LPSECURITY_ATTRIBUTES lpMutexAttributes, LPCWSTR lpName, + DWORD dwFlags, DWORD dwDesiredAccess); -WINPR_API HANDLE OpenMutexA(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName); -WINPR_API HANDLE OpenMutexW(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName); + WINPR_API HANDLE OpenMutexA(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName); + WINPR_API HANDLE OpenMutexW(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName); -WINPR_API BOOL ReleaseMutex(HANDLE hMutex); + WINPR_API BOOL ReleaseMutex(HANDLE hMutex); #ifdef UNICODE -#define CreateMutex CreateMutexW -#define CreateMutexEx CreateMutexExW -#define OpenMutex OpenMutexW +#define CreateMutex CreateMutexW +#define CreateMutexEx CreateMutexExW +#define OpenMutex OpenMutexW #else -#define CreateMutex CreateMutexA -#define CreateMutexEx CreateMutexExA -#define OpenMutex OpenMutexA +#define CreateMutex CreateMutexA +#define CreateMutexEx CreateMutexExA +#define OpenMutex OpenMutexA #endif -/* Semaphore */ + /* Semaphore */ -WINPR_API HANDLE CreateSemaphoreA(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, - LONG lMaximumCount, LPCSTR lpName); -WINPR_API HANDLE CreateSemaphoreW(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, - LONG lMaximumCount, LPCWSTR lpName); + WINPR_API HANDLE CreateSemaphoreA(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, + LONG lInitialCount, LONG lMaximumCount, LPCSTR lpName); + WINPR_API HANDLE CreateSemaphoreW(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, + LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName); -WINPR_API HANDLE OpenSemaphoreA(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName); -WINPR_API HANDLE OpenSemaphoreW(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName); + WINPR_API HANDLE OpenSemaphoreA(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName); + WINPR_API HANDLE OpenSemaphoreW(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName); #ifdef UNICODE -#define CreateSemaphore CreateSemaphoreW -#define OpenSemaphore OpenSemaphoreW +#define CreateSemaphore CreateSemaphoreW +#define OpenSemaphore OpenSemaphoreW #else -#define CreateSemaphore CreateSemaphoreA -#define OpenSemaphore OpenSemaphoreA +#define CreateSemaphore CreateSemaphoreA +#define OpenSemaphore OpenSemaphoreA #endif -WINPR_API BOOL ReleaseSemaphore(HANDLE hSemaphore, LONG lReleaseCount, LPLONG lpPreviousCount); + WINPR_API BOOL ReleaseSemaphore(HANDLE hSemaphore, LONG lReleaseCount, LPLONG lpPreviousCount); /* Event */ #define CREATE_EVENT_MANUAL_RESET 0x00000001 -#define CREATE_EVENT_INITIAL_SET 0x00000002 +#define CREATE_EVENT_INITIAL_SET 0x00000002 -WINPR_API HANDLE CreateEventA(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, - BOOL bInitialState, LPCSTR lpName); -WINPR_API HANDLE CreateEventW(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, - BOOL bInitialState, LPCWSTR lpName); + WINPR_API HANDLE CreateEventA(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, + BOOL bInitialState, LPCSTR lpName); + WINPR_API HANDLE CreateEventW(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, + BOOL bInitialState, LPCWSTR lpName); -WINPR_API HANDLE CreateEventExA(LPSECURITY_ATTRIBUTES lpEventAttributes, LPCSTR lpName, - DWORD dwFlags, DWORD dwDesiredAccess); -WINPR_API HANDLE CreateEventExW(LPSECURITY_ATTRIBUTES lpEventAttributes, LPCWSTR lpName, - DWORD dwFlags, DWORD dwDesiredAccess); + WINPR_API HANDLE CreateEventExA(LPSECURITY_ATTRIBUTES lpEventAttributes, LPCSTR lpName, + DWORD dwFlags, DWORD dwDesiredAccess); + WINPR_API HANDLE CreateEventExW(LPSECURITY_ATTRIBUTES lpEventAttributes, LPCWSTR lpName, + DWORD dwFlags, DWORD dwDesiredAccess); -WINPR_API HANDLE OpenEventA(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName); -WINPR_API HANDLE OpenEventW(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName); + WINPR_API HANDLE OpenEventA(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName); + WINPR_API HANDLE OpenEventW(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName); -WINPR_API BOOL SetEvent(HANDLE hEvent); -WINPR_API BOOL ResetEvent(HANDLE hEvent); + WINPR_API BOOL SetEvent(HANDLE hEvent); + WINPR_API BOOL ResetEvent(HANDLE hEvent); #ifdef UNICODE -#define CreateEvent CreateEventW -#define CreateEventEx CreateEventExW -#define OpenEvent OpenEventW +#define CreateEvent CreateEventW +#define CreateEventEx CreateEventExW +#define OpenEvent OpenEventW #else -#define CreateEvent CreateEventA -#define CreateEventEx CreateEventExA -#define OpenEvent OpenEventA +#define CreateEvent CreateEventA +#define CreateEventEx CreateEventExA +#define OpenEvent OpenEventA #endif -/* Slim Reader/Writer (SRW) Lock */ + /* Slim Reader/Writer (SRW) Lock */ -typedef PVOID RTL_SRWLOCK; -typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK; + typedef PVOID RTL_SRWLOCK; + typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK; -WINPR_API VOID InitializeSRWLock(PSRWLOCK SRWLock); + WINPR_API VOID InitializeSRWLock(PSRWLOCK SRWLock); -WINPR_API VOID AcquireSRWLockExclusive(PSRWLOCK SRWLock); -WINPR_API VOID AcquireSRWLockShared(PSRWLOCK SRWLock); + WINPR_API VOID AcquireSRWLockExclusive(PSRWLOCK SRWLock); + WINPR_API VOID AcquireSRWLockShared(PSRWLOCK SRWLock); -WINPR_API BOOL TryAcquireSRWLockExclusive(PSRWLOCK SRWLock); -WINPR_API BOOL TryAcquireSRWLockShared(PSRWLOCK SRWLock); + WINPR_API BOOL TryAcquireSRWLockExclusive(PSRWLOCK SRWLock); + WINPR_API BOOL TryAcquireSRWLockShared(PSRWLOCK SRWLock); -WINPR_API VOID ReleaseSRWLockExclusive(PSRWLOCK SRWLock); -WINPR_API VOID ReleaseSRWLockShared(PSRWLOCK SRWLock); + WINPR_API VOID ReleaseSRWLockExclusive(PSRWLOCK SRWLock); + WINPR_API VOID ReleaseSRWLockShared(PSRWLOCK SRWLock); -/* Condition Variable */ + /* Condition Variable */ -typedef PVOID RTL_CONDITION_VARIABLE; -typedef RTL_CONDITION_VARIABLE CONDITION_VARIABLE, *PCONDITION_VARIABLE; + typedef PVOID RTL_CONDITION_VARIABLE; + typedef RTL_CONDITION_VARIABLE CONDITION_VARIABLE, *PCONDITION_VARIABLE; -/* Critical Section */ + /* Critical Section */ #if defined(__linux__) /** @@ -148,203 +149,214 @@ typedef RTL_CONDITION_VARIABLE CONDITION_VARIABLE, *PCONDITION_VARIABLE; #define WINPR_CRITICAL_SECTION_DISABLE_SPINCOUNT #endif -typedef struct _RTL_CRITICAL_SECTION -{ - PVOID DebugInfo; - LONG LockCount; - LONG RecursionCount; - HANDLE OwningThread; - HANDLE LockSemaphore; - ULONG_PTR SpinCount; -} RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION; + typedef struct _RTL_CRITICAL_SECTION + { + PVOID DebugInfo; + LONG LockCount; + LONG RecursionCount; + HANDLE OwningThread; + HANDLE LockSemaphore; + ULONG_PTR SpinCount; + } RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION; -typedef RTL_CRITICAL_SECTION CRITICAL_SECTION; -typedef PRTL_CRITICAL_SECTION PCRITICAL_SECTION; -typedef PRTL_CRITICAL_SECTION LPCRITICAL_SECTION; + typedef RTL_CRITICAL_SECTION CRITICAL_SECTION; + typedef PRTL_CRITICAL_SECTION PCRITICAL_SECTION; + typedef PRTL_CRITICAL_SECTION LPCRITICAL_SECTION; -WINPR_API VOID InitializeCriticalSection(LPCRITICAL_SECTION lpCriticalSection); -WINPR_API BOOL InitializeCriticalSectionEx(LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount, - DWORD Flags); -WINPR_API BOOL InitializeCriticalSectionAndSpinCount(LPCRITICAL_SECTION lpCriticalSection, - DWORD dwSpinCount); + WINPR_API VOID InitializeCriticalSection(LPCRITICAL_SECTION lpCriticalSection); + WINPR_API BOOL InitializeCriticalSectionEx(LPCRITICAL_SECTION lpCriticalSection, + DWORD dwSpinCount, DWORD Flags); + WINPR_API BOOL InitializeCriticalSectionAndSpinCount(LPCRITICAL_SECTION lpCriticalSection, + DWORD dwSpinCount); -WINPR_API DWORD SetCriticalSectionSpinCount(LPCRITICAL_SECTION lpCriticalSection, - DWORD dwSpinCount); + WINPR_API DWORD SetCriticalSectionSpinCount(LPCRITICAL_SECTION lpCriticalSection, + DWORD dwSpinCount); -WINPR_API VOID EnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection); -WINPR_API BOOL TryEnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection); + WINPR_API VOID EnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection); + WINPR_API BOOL TryEnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection); -WINPR_API VOID LeaveCriticalSection(LPCRITICAL_SECTION lpCriticalSection); + WINPR_API VOID LeaveCriticalSection(LPCRITICAL_SECTION lpCriticalSection); -WINPR_API VOID DeleteCriticalSection(LPCRITICAL_SECTION lpCriticalSection); + WINPR_API VOID DeleteCriticalSection(LPCRITICAL_SECTION lpCriticalSection); -/* Sleep */ + /* Sleep */ -WINPR_API VOID Sleep(DWORD dwMilliseconds); -WINPR_API DWORD SleepEx(DWORD dwMilliseconds, BOOL bAlertable); + WINPR_API VOID Sleep(DWORD dwMilliseconds); + WINPR_API DWORD SleepEx(DWORD dwMilliseconds, BOOL bAlertable); -/* Address */ + /* Address */ -WINPR_API VOID WakeByAddressAll(PVOID Address); -WINPR_API VOID WakeByAddressSingle(PVOID Address); + WINPR_API VOID WakeByAddressAll(PVOID Address); + WINPR_API VOID WakeByAddressSingle(PVOID Address); -WINPR_API BOOL WaitOnAddress(VOID volatile* Address, PVOID CompareAddress, SIZE_T AddressSize, - DWORD dwMilliseconds); + WINPR_API BOOL WaitOnAddress(VOID volatile* Address, PVOID CompareAddress, SIZE_T AddressSize, + DWORD dwMilliseconds); -/* Wait */ + /* Wait */ -#define INFINITE 0xFFFFFFFF +#define INFINITE 0xFFFFFFFF -#define WAIT_OBJECT_0 0x00000000L -#define WAIT_ABANDONED 0x00000080L +#define WAIT_OBJECT_0 0x00000000L +#define WAIT_ABANDONED 0x00000080L #ifndef WAIT_TIMEOUT -#define WAIT_TIMEOUT 0x00000102L +#define WAIT_TIMEOUT 0x00000102L #endif -#define WAIT_FAILED ((DWORD) 0xFFFFFFFF) +#define WAIT_FAILED ((DWORD)0xFFFFFFFF) -#define MAXIMUM_WAIT_OBJECTS 64 +#define MAXIMUM_WAIT_OBJECTS 64 -WINPR_API DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds); -WINPR_API DWORD WaitForSingleObjectEx(HANDLE hHandle, DWORD dwMilliseconds, BOOL bAlertable); -WINPR_API DWORD WaitForMultipleObjects(DWORD nCount, const HANDLE* lpHandles, BOOL bWaitAll, - DWORD dwMilliseconds); -WINPR_API DWORD WaitForMultipleObjectsEx(DWORD nCount, const HANDLE* lpHandles, BOOL bWaitAll, - DWORD dwMilliseconds, BOOL bAlertable); + WINPR_API DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds); + WINPR_API DWORD WaitForSingleObjectEx(HANDLE hHandle, DWORD dwMilliseconds, BOOL bAlertable); + WINPR_API DWORD WaitForMultipleObjects(DWORD nCount, const HANDLE* lpHandles, BOOL bWaitAll, + DWORD dwMilliseconds); + WINPR_API DWORD WaitForMultipleObjectsEx(DWORD nCount, const HANDLE* lpHandles, BOOL bWaitAll, + DWORD dwMilliseconds, BOOL bAlertable); -WINPR_API DWORD SignalObjectAndWait(HANDLE hObjectToSignal, HANDLE hObjectToWaitOn, - DWORD dwMilliseconds, BOOL bAlertable); + WINPR_API DWORD SignalObjectAndWait(HANDLE hObjectToSignal, HANDLE hObjectToWaitOn, + DWORD dwMilliseconds, BOOL bAlertable); -/* Waitable Timer */ + /* Waitable Timer */ -#define CREATE_WAITABLE_TIMER_MANUAL_RESET 0x00000001 +#define CREATE_WAITABLE_TIMER_MANUAL_RESET 0x00000001 -typedef struct _REASON_CONTEXT -{ - ULONG Version; - DWORD Flags; - - union + typedef struct _REASON_CONTEXT { - struct - { - HMODULE LocalizedReasonModule; - ULONG LocalizedReasonId; - ULONG ReasonStringCount; - LPWSTR* ReasonStrings; - } Detailed; + ULONG Version; + DWORD Flags; - LPWSTR SimpleReasonString; - } Reason; -} REASON_CONTEXT, *PREASON_CONTEXT; + union { + struct + { + HMODULE LocalizedReasonModule; + ULONG LocalizedReasonId; + ULONG ReasonStringCount; + LPWSTR* ReasonStrings; + } Detailed; -typedef VOID (*PTIMERAPCROUTINE)(LPVOID lpArgToCompletionRoutine, DWORD dwTimerLowValue, - DWORD dwTimerHighValue); + LPWSTR SimpleReasonString; + } Reason; + } REASON_CONTEXT, *PREASON_CONTEXT; -WINPR_API HANDLE CreateWaitableTimerA(LPSECURITY_ATTRIBUTES lpTimerAttributes, BOOL bManualReset, - LPCSTR lpTimerName); -WINPR_API HANDLE CreateWaitableTimerW(LPSECURITY_ATTRIBUTES lpTimerAttributes, BOOL bManualReset, - LPCWSTR lpTimerName); + typedef VOID (*PTIMERAPCROUTINE)(LPVOID lpArgToCompletionRoutine, DWORD dwTimerLowValue, + DWORD dwTimerHighValue); -WINPR_API HANDLE CreateWaitableTimerExA(LPSECURITY_ATTRIBUTES lpTimerAttributes, LPCSTR lpTimerName, - DWORD dwFlags, DWORD dwDesiredAccess); -WINPR_API HANDLE CreateWaitableTimerExW(LPSECURITY_ATTRIBUTES lpTimerAttributes, - LPCWSTR lpTimerName, DWORD dwFlags, DWORD dwDesiredAccess); + WINPR_API HANDLE CreateWaitableTimerA(LPSECURITY_ATTRIBUTES lpTimerAttributes, + BOOL bManualReset, LPCSTR lpTimerName); + WINPR_API HANDLE CreateWaitableTimerW(LPSECURITY_ATTRIBUTES lpTimerAttributes, + BOOL bManualReset, LPCWSTR lpTimerName); -WINPR_API BOOL SetWaitableTimer(HANDLE hTimer, const LARGE_INTEGER* lpDueTime, LONG lPeriod, - PTIMERAPCROUTINE pfnCompletionRoutine, LPVOID lpArgToCompletionRoutine, BOOL fResume); + WINPR_API HANDLE CreateWaitableTimerExA(LPSECURITY_ATTRIBUTES lpTimerAttributes, + LPCSTR lpTimerName, DWORD dwFlags, + DWORD dwDesiredAccess); + WINPR_API HANDLE CreateWaitableTimerExW(LPSECURITY_ATTRIBUTES lpTimerAttributes, + LPCWSTR lpTimerName, DWORD dwFlags, + DWORD dwDesiredAccess); -WINPR_API BOOL SetWaitableTimerEx(HANDLE hTimer, const LARGE_INTEGER* lpDueTime, LONG lPeriod, - PTIMERAPCROUTINE pfnCompletionRoutine, LPVOID lpArgToCompletionRoutine, PREASON_CONTEXT WakeContext, - ULONG TolerableDelay); + WINPR_API BOOL SetWaitableTimer(HANDLE hTimer, const LARGE_INTEGER* lpDueTime, LONG lPeriod, + PTIMERAPCROUTINE pfnCompletionRoutine, + LPVOID lpArgToCompletionRoutine, BOOL fResume); -WINPR_API HANDLE OpenWaitableTimerA(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpTimerName); -WINPR_API HANDLE OpenWaitableTimerW(DWORD dwDesiredAccess, BOOL bInheritHandle, - LPCWSTR lpTimerName); + WINPR_API BOOL SetWaitableTimerEx(HANDLE hTimer, const LARGE_INTEGER* lpDueTime, LONG lPeriod, + PTIMERAPCROUTINE pfnCompletionRoutine, + LPVOID lpArgToCompletionRoutine, PREASON_CONTEXT WakeContext, + ULONG TolerableDelay); -WINPR_API BOOL CancelWaitableTimer(HANDLE hTimer); + WINPR_API HANDLE OpenWaitableTimerA(DWORD dwDesiredAccess, BOOL bInheritHandle, + LPCSTR lpTimerName); + WINPR_API HANDLE OpenWaitableTimerW(DWORD dwDesiredAccess, BOOL bInheritHandle, + LPCWSTR lpTimerName); + + WINPR_API BOOL CancelWaitableTimer(HANDLE hTimer); #ifdef UNICODE -#define CreateWaitableTimer CreateWaitableTimerW -#define CreateWaitableTimerEx CreateWaitableTimerExW -#define OpenWaitableTimer OpenWaitableTimerW +#define CreateWaitableTimer CreateWaitableTimerW +#define CreateWaitableTimerEx CreateWaitableTimerExW +#define OpenWaitableTimer OpenWaitableTimerW #else -#define CreateWaitableTimer CreateWaitableTimerA -#define CreateWaitableTimerEx CreateWaitableTimerExA -#define OpenWaitableTimer OpenWaitableTimerA +#define CreateWaitableTimer CreateWaitableTimerA +#define CreateWaitableTimerEx CreateWaitableTimerExA +#define OpenWaitableTimer OpenWaitableTimerA #endif -/** - * Timer-Queue Timer - */ + /** + * Timer-Queue Timer + */ -#define WT_EXECUTEDEFAULT 0x00000000 -#define WT_EXECUTEINIOTHREAD 0x00000001 -#define WT_EXECUTEINUITHREAD 0x00000002 -#define WT_EXECUTEINWAITTHREAD 0x00000004 -#define WT_EXECUTEONLYONCE 0x00000008 -#define WT_EXECUTELONGFUNCTION 0x00000010 -#define WT_EXECUTEINTIMERTHREAD 0x00000020 -#define WT_EXECUTEINPERSISTENTIOTHREAD 0x00000040 -#define WT_EXECUTEINPERSISTENTTHREAD 0x00000080 -#define WT_TRANSFER_IMPERSONATION 0x00000100 +#define WT_EXECUTEDEFAULT 0x00000000 +#define WT_EXECUTEINIOTHREAD 0x00000001 +#define WT_EXECUTEINUITHREAD 0x00000002 +#define WT_EXECUTEINWAITTHREAD 0x00000004 +#define WT_EXECUTEONLYONCE 0x00000008 +#define WT_EXECUTELONGFUNCTION 0x00000010 +#define WT_EXECUTEINTIMERTHREAD 0x00000020 +#define WT_EXECUTEINPERSISTENTIOTHREAD 0x00000040 +#define WT_EXECUTEINPERSISTENTTHREAD 0x00000080 +#define WT_TRANSFER_IMPERSONATION 0x00000100 -typedef VOID (*WAITORTIMERCALLBACK)(PVOID lpParameter, BOOLEAN TimerOrWaitFired); + typedef VOID (*WAITORTIMERCALLBACK)(PVOID lpParameter, BOOLEAN TimerOrWaitFired); -WINPR_API HANDLE CreateTimerQueue(void); -WINPR_API BOOL DeleteTimerQueue(HANDLE TimerQueue); -WINPR_API BOOL DeleteTimerQueueEx(HANDLE TimerQueue, HANDLE CompletionEvent); + WINPR_API HANDLE CreateTimerQueue(void); + WINPR_API BOOL DeleteTimerQueue(HANDLE TimerQueue); + WINPR_API BOOL DeleteTimerQueueEx(HANDLE TimerQueue, HANDLE CompletionEvent); -WINPR_API BOOL CreateTimerQueueTimer(PHANDLE phNewTimer, HANDLE TimerQueue, - WAITORTIMERCALLBACK Callback, PVOID Parameter, DWORD DueTime, DWORD Period, ULONG Flags); -WINPR_API BOOL ChangeTimerQueueTimer(HANDLE TimerQueue, HANDLE Timer, ULONG DueTime, ULONG Period); -WINPR_API BOOL DeleteTimerQueueTimer(HANDLE TimerQueue, HANDLE Timer, HANDLE CompletionEvent); + WINPR_API BOOL CreateTimerQueueTimer(PHANDLE phNewTimer, HANDLE TimerQueue, + WAITORTIMERCALLBACK Callback, PVOID Parameter, + DWORD DueTime, DWORD Period, ULONG Flags); + WINPR_API BOOL ChangeTimerQueueTimer(HANDLE TimerQueue, HANDLE Timer, ULONG DueTime, + ULONG Period); + WINPR_API BOOL DeleteTimerQueueTimer(HANDLE TimerQueue, HANDLE Timer, HANDLE CompletionEvent); #endif #if (defined(_WIN32) && (_WIN32_WINNT < 0x0600)) -#define InitializeCriticalSectionEx(lpCriticalSection, dwSpinCount, Flags) InitializeCriticalSectionAndSpinCount(lpCriticalSection, dwSpinCount) +#define InitializeCriticalSectionEx(lpCriticalSection, dwSpinCount, Flags) \ + InitializeCriticalSectionAndSpinCount(lpCriticalSection, dwSpinCount) #endif #ifndef _RTL_RUN_ONCE_DEF #define _RTL_RUN_ONCE_DEF -#define RTL_RUN_ONCE_INIT { 0 } +#define RTL_RUN_ONCE_INIT \ + { \ + 0 \ + } -#define RTL_RUN_ONCE_CHECK_ONLY 0x00000001 -#define RTL_RUN_ONCE_ASYNC 0x00000002 -#define RTL_RUN_ONCE_INIT_FAILED 0x00000004 +#define RTL_RUN_ONCE_CHECK_ONLY 0x00000001 +#define RTL_RUN_ONCE_ASYNC 0x00000002 +#define RTL_RUN_ONCE_INIT_FAILED 0x00000004 -#define RTL_RUN_ONCE_CTX_RESERVED_BITS 2 +#define RTL_RUN_ONCE_CTX_RESERVED_BITS 2 -typedef struct _RTL_RUN_ONCE -{ - PVOID Ptr; -} RTL_RUN_ONCE, *PRTL_RUN_ONCE; + typedef struct _RTL_RUN_ONCE + { + PVOID Ptr; + } RTL_RUN_ONCE, *PRTL_RUN_ONCE; -typedef ULONG CALLBACK RTL_RUN_ONCE_INIT_FN(PRTL_RUN_ONCE RunOnce, PVOID Parameter, PVOID* Context); -typedef RTL_RUN_ONCE_INIT_FN* PRTL_RUN_ONCE_INIT_FN; + typedef ULONG CALLBACK RTL_RUN_ONCE_INIT_FN(PRTL_RUN_ONCE RunOnce, PVOID Parameter, + PVOID* Context); + typedef RTL_RUN_ONCE_INIT_FN* PRTL_RUN_ONCE_INIT_FN; #endif #if (!defined(_WIN32)) || (defined(_WIN32) && (_WIN32_WINNT < 0x0600)) -/* One-Time Initialization */ + /* One-Time Initialization */ -#define INIT_ONCE_STATIC_INIT RTL_RUN_ONCE_INIT +#define INIT_ONCE_STATIC_INIT RTL_RUN_ONCE_INIT -typedef RTL_RUN_ONCE INIT_ONCE; -typedef PRTL_RUN_ONCE PINIT_ONCE; -typedef PRTL_RUN_ONCE LPINIT_ONCE; -typedef BOOL (CALLBACK* PINIT_ONCE_FN)(PINIT_ONCE InitOnce, PVOID Parameter, PVOID* Context); + typedef RTL_RUN_ONCE INIT_ONCE; + typedef PRTL_RUN_ONCE PINIT_ONCE; + typedef PRTL_RUN_ONCE LPINIT_ONCE; + typedef BOOL(CALLBACK* PINIT_ONCE_FN)(PINIT_ONCE InitOnce, PVOID Parameter, PVOID* Context); -WINPR_API BOOL winpr_InitOnceBeginInitialize(LPINIT_ONCE lpInitOnce, DWORD dwFlags, PBOOL fPending, - LPVOID* lpContext); -WINPR_API BOOL winpr_InitOnceComplete(LPINIT_ONCE lpInitOnce, DWORD dwFlags, LPVOID lpContext); -WINPR_API BOOL winpr_InitOnceExecuteOnce(PINIT_ONCE InitOnce, PINIT_ONCE_FN InitFn, PVOID Parameter, - LPVOID* Context); -WINPR_API VOID winpr_InitOnceInitialize(PINIT_ONCE InitOnce); + WINPR_API BOOL winpr_InitOnceBeginInitialize(LPINIT_ONCE lpInitOnce, DWORD dwFlags, + PBOOL fPending, LPVOID* lpContext); + WINPR_API BOOL winpr_InitOnceComplete(LPINIT_ONCE lpInitOnce, DWORD dwFlags, LPVOID lpContext); + WINPR_API BOOL winpr_InitOnceExecuteOnce(PINIT_ONCE InitOnce, PINIT_ONCE_FN InitFn, + PVOID Parameter, LPVOID* Context); + WINPR_API VOID winpr_InitOnceInitialize(PINIT_ONCE InitOnce); #define InitOnceBeginInitialize winpr_InitOnceBeginInitialize #define InitOnceComplete winpr_InitOnceComplete @@ -352,36 +364,36 @@ WINPR_API VOID winpr_InitOnceInitialize(PINIT_ONCE InitOnce); #define InitOnceInitialize winpr_InitOnceInitialize #endif -/* Synchronization Barrier */ + /* Synchronization Barrier */ #if (!defined(_WIN32)) || (defined(_WIN32) && (_WIN32_WINNT < 0x0602) && !defined(_SYNCHAPI_H_)) -#define WINPR_SYNCHRONIZATION_BARRIER 1 +#define WINPR_SYNCHRONIZATION_BARRIER 1 #endif #ifdef WINPR_SYNCHRONIZATION_BARRIER -typedef struct _RTL_BARRIER -{ - DWORD Reserved1; - DWORD Reserved2; - ULONG_PTR Reserved3[2]; - DWORD Reserved4; - DWORD Reserved5; -} RTL_BARRIER, *PRTL_BARRIER; + typedef struct _RTL_BARRIER + { + DWORD Reserved1; + DWORD Reserved2; + ULONG_PTR Reserved3[2]; + DWORD Reserved4; + DWORD Reserved5; + } RTL_BARRIER, *PRTL_BARRIER; -typedef RTL_BARRIER SYNCHRONIZATION_BARRIER; -typedef PRTL_BARRIER PSYNCHRONIZATION_BARRIER; -typedef PRTL_BARRIER LPSYNCHRONIZATION_BARRIER; + typedef RTL_BARRIER SYNCHRONIZATION_BARRIER; + typedef PRTL_BARRIER PSYNCHRONIZATION_BARRIER; + typedef PRTL_BARRIER LPSYNCHRONIZATION_BARRIER; -#define SYNCHRONIZATION_BARRIER_FLAGS_SPIN_ONLY 0x01 -#define SYNCHRONIZATION_BARRIER_FLAGS_BLOCK_ONLY 0x02 -#define SYNCHRONIZATION_BARRIER_FLAGS_NO_DELETE 0x04 +#define SYNCHRONIZATION_BARRIER_FLAGS_SPIN_ONLY 0x01 +#define SYNCHRONIZATION_BARRIER_FLAGS_BLOCK_ONLY 0x02 +#define SYNCHRONIZATION_BARRIER_FLAGS_NO_DELETE 0x04 -WINPR_API BOOL WINAPI winpr_InitializeSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier, - LONG lTotalThreads, LONG lSpinCount); -WINPR_API BOOL WINAPI winpr_EnterSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier, - DWORD dwFlags); -WINPR_API BOOL WINAPI winpr_DeleteSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier); + WINPR_API BOOL WINAPI winpr_InitializeSynchronizationBarrier( + LPSYNCHRONIZATION_BARRIER lpBarrier, LONG lTotalThreads, LONG lSpinCount); + WINPR_API BOOL WINAPI winpr_EnterSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier, + DWORD dwFlags); + WINPR_API BOOL WINAPI winpr_DeleteSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier); #define InitializeSynchronizationBarrier winpr_InitializeSynchronizationBarrier #define EnterSynchronizationBarrier winpr_EnterSynchronizationBarrier @@ -389,32 +401,33 @@ WINPR_API BOOL WINAPI winpr_DeleteSynchronizationBarrier(LPSYNCHRONIZATION_BARRI #endif -/* Extended API */ + /* Extended API */ -WINPR_API VOID USleep(DWORD dwMicroseconds); + WINPR_API VOID USleep(DWORD dwMicroseconds); -WINPR_API HANDLE CreateFileDescriptorEventW(LPSECURITY_ATTRIBUTES lpEventAttributes, - BOOL bManualReset, BOOL bInitialState, int FileDescriptor, ULONG mode); -WINPR_API HANDLE CreateFileDescriptorEventA(LPSECURITY_ATTRIBUTES lpEventAttributes, - BOOL bManualReset, BOOL bInitialState, int FileDescriptor, ULONG mode); + WINPR_API HANDLE CreateFileDescriptorEventW(LPSECURITY_ATTRIBUTES lpEventAttributes, + BOOL bManualReset, BOOL bInitialState, + int FileDescriptor, ULONG mode); + WINPR_API HANDLE CreateFileDescriptorEventA(LPSECURITY_ATTRIBUTES lpEventAttributes, + BOOL bManualReset, BOOL bInitialState, + int FileDescriptor, ULONG mode); -WINPR_API HANDLE CreateWaitObjectEvent(LPSECURITY_ATTRIBUTES lpEventAttributes, - BOOL bManualReset, BOOL bInitialState, void* pObject); + WINPR_API HANDLE CreateWaitObjectEvent(LPSECURITY_ATTRIBUTES lpEventAttributes, + BOOL bManualReset, BOOL bInitialState, void* pObject); #ifdef UNICODE -#define CreateFileDescriptorEvent CreateFileDescriptorEventW +#define CreateFileDescriptorEvent CreateFileDescriptorEventW #else -#define CreateFileDescriptorEvent CreateFileDescriptorEventA +#define CreateFileDescriptorEvent CreateFileDescriptorEventA #endif -WINPR_API int GetEventFileDescriptor(HANDLE hEvent); -WINPR_API int SetEventFileDescriptor(HANDLE hEvent, int FileDescriptor, ULONG mode); + WINPR_API int GetEventFileDescriptor(HANDLE hEvent); + WINPR_API int SetEventFileDescriptor(HANDLE hEvent, int FileDescriptor, ULONG mode); -WINPR_API void* GetEventWaitObject(HANDLE hEvent); + WINPR_API void* GetEventWaitObject(HANDLE hEvent); #ifdef __cplusplus } #endif #endif /* WINPR_SYNCH_H */ - diff --git a/winpr/include/winpr/sysinfo.h b/winpr/include/winpr/sysinfo.h index b04ce9cdb..07e460c9e 100644 --- a/winpr/include/winpr/sysinfo.h +++ b/winpr/include/winpr/sysinfo.h @@ -27,315 +27,317 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif #ifndef _WIN32 -#define PROCESSOR_ARCHITECTURE_INTEL 0 -#define PROCESSOR_ARCHITECTURE_MIPS 1 -#define PROCESSOR_ARCHITECTURE_ALPHA 2 -#define PROCESSOR_ARCHITECTURE_PPC 3 -#define PROCESSOR_ARCHITECTURE_SHX 4 -#define PROCESSOR_ARCHITECTURE_ARM 5 -#define PROCESSOR_ARCHITECTURE_IA64 6 -#define PROCESSOR_ARCHITECTURE_ALPHA64 7 -#define PROCESSOR_ARCHITECTURE_MSIL 8 -#define PROCESSOR_ARCHITECTURE_AMD64 9 -#define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 10 -#define PROCESSOR_ARCHITECTURE_NEUTRAL 11 -#define PROCESSOR_ARCHITECTURE_ARM64 12 -#define PROCESSOR_ARCHITECTURE_MIPS64 13 -#define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF +#define PROCESSOR_ARCHITECTURE_INTEL 0 +#define PROCESSOR_ARCHITECTURE_MIPS 1 +#define PROCESSOR_ARCHITECTURE_ALPHA 2 +#define PROCESSOR_ARCHITECTURE_PPC 3 +#define PROCESSOR_ARCHITECTURE_SHX 4 +#define PROCESSOR_ARCHITECTURE_ARM 5 +#define PROCESSOR_ARCHITECTURE_IA64 6 +#define PROCESSOR_ARCHITECTURE_ALPHA64 7 +#define PROCESSOR_ARCHITECTURE_MSIL 8 +#define PROCESSOR_ARCHITECTURE_AMD64 9 +#define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 10 +#define PROCESSOR_ARCHITECTURE_NEUTRAL 11 +#define PROCESSOR_ARCHITECTURE_ARM64 12 +#define PROCESSOR_ARCHITECTURE_MIPS64 13 +#define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF -#define PROCESSOR_INTEL_386 386 -#define PROCESSOR_INTEL_486 486 -#define PROCESSOR_INTEL_PENTIUM 586 -#define PROCESSOR_INTEL_IA64 2200 -#define PROCESSOR_AMD_X8664 8664 -#define PROCESSOR_MIPS_R4000 4000 -#define PROCESSOR_ALPHA_21064 21064 -#define PROCESSOR_PPC_601 601 -#define PROCESSOR_PPC_603 603 -#define PROCESSOR_PPC_604 604 -#define PROCESSOR_PPC_620 620 -#define PROCESSOR_HITACHI_SH3 10003 -#define PROCESSOR_HITACHI_SH3E 10004 -#define PROCESSOR_HITACHI_SH4 10005 -#define PROCESSOR_MOTOROLA_821 821 -#define PROCESSOR_SHx_SH3 103 -#define PROCESSOR_SHx_SH4 104 -#define PROCESSOR_STRONGARM 2577 -#define PROCESSOR_ARM720 1824 -#define PROCESSOR_ARM820 2080 -#define PROCESSOR_ARM920 2336 -#define PROCESSOR_ARM_7TDMI 70001 -#define PROCESSOR_OPTIL 0x494F +#define PROCESSOR_INTEL_386 386 +#define PROCESSOR_INTEL_486 486 +#define PROCESSOR_INTEL_PENTIUM 586 +#define PROCESSOR_INTEL_IA64 2200 +#define PROCESSOR_AMD_X8664 8664 +#define PROCESSOR_MIPS_R4000 4000 +#define PROCESSOR_ALPHA_21064 21064 +#define PROCESSOR_PPC_601 601 +#define PROCESSOR_PPC_603 603 +#define PROCESSOR_PPC_604 604 +#define PROCESSOR_PPC_620 620 +#define PROCESSOR_HITACHI_SH3 10003 +#define PROCESSOR_HITACHI_SH3E 10004 +#define PROCESSOR_HITACHI_SH4 10005 +#define PROCESSOR_MOTOROLA_821 821 +#define PROCESSOR_SHx_SH3 103 +#define PROCESSOR_SHx_SH4 104 +#define PROCESSOR_STRONGARM 2577 +#define PROCESSOR_ARM720 1824 +#define PROCESSOR_ARM820 2080 +#define PROCESSOR_ARM920 2336 +#define PROCESSOR_ARM_7TDMI 70001 +#define PROCESSOR_OPTIL 0x494F -typedef struct _SYSTEM_INFO -{ - union + typedef struct _SYSTEM_INFO { - DWORD dwOemId; + union { + DWORD dwOemId; - struct - { - WORD wProcessorArchitecture; - WORD wReserved; + struct + { + WORD wProcessorArchitecture; + WORD wReserved; + }; }; - }; - DWORD dwPageSize; - LPVOID lpMinimumApplicationAddress; - LPVOID lpMaximumApplicationAddress; - DWORD_PTR dwActiveProcessorMask; - DWORD dwNumberOfProcessors; - DWORD dwProcessorType; - DWORD dwAllocationGranularity; - WORD wProcessorLevel; - WORD wProcessorRevision; -} SYSTEM_INFO, *LPSYSTEM_INFO; + DWORD dwPageSize; + LPVOID lpMinimumApplicationAddress; + LPVOID lpMaximumApplicationAddress; + DWORD_PTR dwActiveProcessorMask; + DWORD dwNumberOfProcessors; + DWORD dwProcessorType; + DWORD dwAllocationGranularity; + WORD wProcessorLevel; + WORD wProcessorRevision; + } SYSTEM_INFO, *LPSYSTEM_INFO; -WINPR_API void GetSystemInfo(LPSYSTEM_INFO lpSystemInfo); -WINPR_API void GetNativeSystemInfo(LPSYSTEM_INFO lpSystemInfo); + WINPR_API void GetSystemInfo(LPSYSTEM_INFO lpSystemInfo); + WINPR_API void GetNativeSystemInfo(LPSYSTEM_INFO lpSystemInfo); -typedef struct _OSVERSIONINFOA -{ - DWORD dwOSVersionInfoSize; - DWORD dwMajorVersion; - DWORD dwMinorVersion; - DWORD dwBuildNumber; - DWORD dwPlatformId; - CHAR szCSDVersion[128]; -} OSVERSIONINFOA, *POSVERSIONINFOA, *LPOSVERSIONINFOA; + typedef struct _OSVERSIONINFOA + { + DWORD dwOSVersionInfoSize; + DWORD dwMajorVersion; + DWORD dwMinorVersion; + DWORD dwBuildNumber; + DWORD dwPlatformId; + CHAR szCSDVersion[128]; + } OSVERSIONINFOA, *POSVERSIONINFOA, *LPOSVERSIONINFOA; -typedef struct _OSVERSIONINFOW -{ - DWORD dwOSVersionInfoSize; - DWORD dwMajorVersion; - DWORD dwMinorVersion; - DWORD dwBuildNumber; - DWORD dwPlatformId; - WCHAR szCSDVersion[128]; -} OSVERSIONINFOW, *POSVERSIONINFOW, *LPOSVERSIONINFOW; + typedef struct _OSVERSIONINFOW + { + DWORD dwOSVersionInfoSize; + DWORD dwMajorVersion; + DWORD dwMinorVersion; + DWORD dwBuildNumber; + DWORD dwPlatformId; + WCHAR szCSDVersion[128]; + } OSVERSIONINFOW, *POSVERSIONINFOW, *LPOSVERSIONINFOW; -typedef struct _OSVERSIONINFOEXA -{ - DWORD dwOSVersionInfoSize; - DWORD dwMajorVersion; - DWORD dwMinorVersion; - DWORD dwBuildNumber; - DWORD dwPlatformId; - CHAR szCSDVersion[128]; - WORD wServicePackMajor; - WORD wServicePackMinor; - WORD wSuiteMask; - BYTE wProductType; - BYTE wReserved; -} OSVERSIONINFOEXA, *POSVERSIONINFOEXA, *LPOSVERSIONINFOEXA; + typedef struct _OSVERSIONINFOEXA + { + DWORD dwOSVersionInfoSize; + DWORD dwMajorVersion; + DWORD dwMinorVersion; + DWORD dwBuildNumber; + DWORD dwPlatformId; + CHAR szCSDVersion[128]; + WORD wServicePackMajor; + WORD wServicePackMinor; + WORD wSuiteMask; + BYTE wProductType; + BYTE wReserved; + } OSVERSIONINFOEXA, *POSVERSIONINFOEXA, *LPOSVERSIONINFOEXA; -typedef struct _OSVERSIONINFOEXW -{ - DWORD dwOSVersionInfoSize; - DWORD dwMajorVersion; - DWORD dwMinorVersion; - DWORD dwBuildNumber; - DWORD dwPlatformId; - WCHAR szCSDVersion[128]; - WORD wServicePackMajor; - WORD wServicePackMinor; - WORD wSuiteMask; - BYTE wProductType; - BYTE wReserved; -} OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW; + typedef struct _OSVERSIONINFOEXW + { + DWORD dwOSVersionInfoSize; + DWORD dwMajorVersion; + DWORD dwMinorVersion; + DWORD dwBuildNumber; + DWORD dwPlatformId; + WCHAR szCSDVersion[128]; + WORD wServicePackMajor; + WORD wServicePackMinor; + WORD wSuiteMask; + BYTE wProductType; + BYTE wReserved; + } OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW; #ifdef UNICODE -#define OSVERSIONINFO OSVERSIONINFOW -#define OSVERSIONINFOEX OSVERSIONINFOEXW -#define POSVERSIONINFO POSVERSIONINFOW -#define POSVERSIONINFOEX POSVERSIONINFOEXW -#define LPOSVERSIONINFO LPOSVERSIONINFOW -#define LPOSVERSIONINFOEX LPOSVERSIONINFOEXW +#define OSVERSIONINFO OSVERSIONINFOW +#define OSVERSIONINFOEX OSVERSIONINFOEXW +#define POSVERSIONINFO POSVERSIONINFOW +#define POSVERSIONINFOEX POSVERSIONINFOEXW +#define LPOSVERSIONINFO LPOSVERSIONINFOW +#define LPOSVERSIONINFOEX LPOSVERSIONINFOEXW #else -#define OSVERSIONINFO OSVERSIONINFOA -#define OSVERSIONINFOEX OSVERSIONINFOEXA -#define POSVERSIONINFO POSVERSIONINFOA -#define POSVERSIONINFOEX POSVERSIONINFOEXA -#define LPOSVERSIONINFO LPOSVERSIONINFOA -#define LPOSVERSIONINFOEX LPOSVERSIONINFOEXA +#define OSVERSIONINFO OSVERSIONINFOA +#define OSVERSIONINFOEX OSVERSIONINFOEXA +#define POSVERSIONINFO POSVERSIONINFOA +#define POSVERSIONINFOEX POSVERSIONINFOEXA +#define LPOSVERSIONINFO LPOSVERSIONINFOA +#define LPOSVERSIONINFOEX LPOSVERSIONINFOEXA #endif -#define VER_PLATFORM_WIN32_NT 0x00000002 +#define VER_PLATFORM_WIN32_NT 0x00000002 -#define VER_SUITE_BACKOFFICE 0x00000004 -#define VER_SUITE_BLADE 0x00000400 -#define VER_SUITE_COMPUTE_SERVER 0x00004000 -#define VER_SUITE_DATACENTER 0x00000080 -#define VER_SUITE_ENTERPRISE 0x00000002 -#define VER_SUITE_EMBEDDEDNT 0x00000040 -#define VER_SUITE_PERSONAL 0x00000200 -#define VER_SUITE_SINGLEUSERTS 0x00000100 -#define VER_SUITE_SMALLBUSINESS 0x00000001 -#define VER_SUITE_SMALLBUSINESS_RESTRICTED 0x00000020 -#define VER_SUITE_STORAGE_SERVER 0x00002000 -#define VER_SUITE_TERMINAL 0x00000010 -#define VER_SUITE_WH_SERVER 0x00008000 +#define VER_SUITE_BACKOFFICE 0x00000004 +#define VER_SUITE_BLADE 0x00000400 +#define VER_SUITE_COMPUTE_SERVER 0x00004000 +#define VER_SUITE_DATACENTER 0x00000080 +#define VER_SUITE_ENTERPRISE 0x00000002 +#define VER_SUITE_EMBEDDEDNT 0x00000040 +#define VER_SUITE_PERSONAL 0x00000200 +#define VER_SUITE_SINGLEUSERTS 0x00000100 +#define VER_SUITE_SMALLBUSINESS 0x00000001 +#define VER_SUITE_SMALLBUSINESS_RESTRICTED 0x00000020 +#define VER_SUITE_STORAGE_SERVER 0x00002000 +#define VER_SUITE_TERMINAL 0x00000010 +#define VER_SUITE_WH_SERVER 0x00008000 -#define VER_NT_DOMAIN_CONTROLLER 0x0000002 -#define VER_NT_SERVER 0x0000003 -#define VER_NT_WORKSTATION 0x0000001 +#define VER_NT_DOMAIN_CONTROLLER 0x0000002 +#define VER_NT_SERVER 0x0000003 +#define VER_NT_WORKSTATION 0x0000001 -WINPR_API void GetSystemTime(LPSYSTEMTIME lpSystemTime); -WINPR_API BOOL SetSystemTime(CONST SYSTEMTIME* lpSystemTime); -WINPR_API VOID GetLocalTime(LPSYSTEMTIME lpSystemTime); -WINPR_API BOOL SetLocalTime(CONST SYSTEMTIME* lpSystemTime); + WINPR_API void GetSystemTime(LPSYSTEMTIME lpSystemTime); + WINPR_API BOOL SetSystemTime(CONST SYSTEMTIME* lpSystemTime); + WINPR_API VOID GetLocalTime(LPSYSTEMTIME lpSystemTime); + WINPR_API BOOL SetLocalTime(CONST SYSTEMTIME* lpSystemTime); -WINPR_API VOID GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime); -WINPR_API BOOL GetSystemTimeAdjustment(PDWORD lpTimeAdjustment, PDWORD lpTimeIncrement, - PBOOL lpTimeAdjustmentDisabled); + WINPR_API VOID GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime); + WINPR_API BOOL GetSystemTimeAdjustment(PDWORD lpTimeAdjustment, PDWORD lpTimeIncrement, + PBOOL lpTimeAdjustmentDisabled); -WINPR_API BOOL IsProcessorFeaturePresent(DWORD ProcessorFeature); + WINPR_API BOOL IsProcessorFeaturePresent(DWORD ProcessorFeature); -#define PF_FLOATING_POINT_PRECISION_ERRATA 0 -#define PF_FLOATING_POINT_EMULATED 1 -#define PF_COMPARE_EXCHANGE_DOUBLE 2 -#define PF_MMX_INSTRUCTIONS_AVAILABLE 3 -#define PF_PPC_MOVEMEM_64BIT_OK 4 -#define PF_XMMI_INSTRUCTIONS_AVAILABLE 6 /* SSE */ -#define PF_3DNOW_INSTRUCTIONS_AVAILABLE 7 -#define PF_RDTSC_INSTRUCTION_AVAILABLE 8 -#define PF_PAE_ENABLED 9 -#define PF_XMMI64_INSTRUCTIONS_AVAILABLE 10 /* SSE2 */ -#define PF_SSE_DAZ_MODE_AVAILABLE 11 -#define PF_NX_ENABLED 12 -#define PF_SSE3_INSTRUCTIONS_AVAILABLE 13 -#define PF_COMPARE_EXCHANGE128 14 -#define PF_COMPARE64_EXCHANGE128 15 -#define PF_CHANNELS_ENABLED 16 -#define PF_XSAVE_ENABLED 17 -#define PF_ARM_VFP_32_REGISTERS_AVAILABLE 18 -#define PF_ARM_NEON_INSTRUCTIONS_AVAILABLE 19 -#define PF_SECOND_LEVEL_ADDRESS_TRANSLATION 20 -#define PF_VIRT_FIRMWARE_ENABLED 21 -#define PF_RDWRFSGSBASE_AVAILABLE 22 -#define PF_FASTFAIL_AVAILABLE 23 -#define PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE 24 -#define PF_ARM_64BIT_LOADSTORE_ATOMIC 25 -#define PF_ARM_EXTERNAL_CACHE_AVAILABLE 26 -#define PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE 27 +#define PF_FLOATING_POINT_PRECISION_ERRATA 0 +#define PF_FLOATING_POINT_EMULATED 1 +#define PF_COMPARE_EXCHANGE_DOUBLE 2 +#define PF_MMX_INSTRUCTIONS_AVAILABLE 3 +#define PF_PPC_MOVEMEM_64BIT_OK 4 +#define PF_XMMI_INSTRUCTIONS_AVAILABLE 6 /* SSE */ +#define PF_3DNOW_INSTRUCTIONS_AVAILABLE 7 +#define PF_RDTSC_INSTRUCTION_AVAILABLE 8 +#define PF_PAE_ENABLED 9 +#define PF_XMMI64_INSTRUCTIONS_AVAILABLE 10 /* SSE2 */ +#define PF_SSE_DAZ_MODE_AVAILABLE 11 +#define PF_NX_ENABLED 12 +#define PF_SSE3_INSTRUCTIONS_AVAILABLE 13 +#define PF_COMPARE_EXCHANGE128 14 +#define PF_COMPARE64_EXCHANGE128 15 +#define PF_CHANNELS_ENABLED 16 +#define PF_XSAVE_ENABLED 17 +#define PF_ARM_VFP_32_REGISTERS_AVAILABLE 18 +#define PF_ARM_NEON_INSTRUCTIONS_AVAILABLE 19 +#define PF_SECOND_LEVEL_ADDRESS_TRANSLATION 20 +#define PF_VIRT_FIRMWARE_ENABLED 21 +#define PF_RDWRFSGSBASE_AVAILABLE 22 +#define PF_FASTFAIL_AVAILABLE 23 +#define PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE 24 +#define PF_ARM_64BIT_LOADSTORE_ATOMIC 25 +#define PF_ARM_EXTERNAL_CACHE_AVAILABLE 26 +#define PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE 27 -#define PF_ARM_V4 0x80000001 -#define PF_ARM_V5 0x80000002 -#define PF_ARM_V6 0x80000003 -#define PF_ARM_V7 0x80000004 -#define PF_ARM_THUMB 0x80000005 -#define PF_ARM_JAZELLE 0x80000006 -#define PF_ARM_DSP 0x80000007 -#define PF_ARM_MOVE_CP 0x80000008 -#define PF_ARM_VFP10 0x80000009 -#define PF_ARM_MPU 0x8000000A -#define PF_ARM_WRITE_BUFFER 0x8000000B -#define PF_ARM_MBX 0x8000000C -#define PF_ARM_L2CACHE 0x8000000D -#define PF_ARM_PHYSICALLY_TAGGED_CACHE 0x8000000E -#define PF_ARM_VFP_SINGLE_PRECISION 0x8000000F -#define PF_ARM_VFP_DOUBLE_PRECISION 0x80000010 -#define PF_ARM_ITCM 0x80000011 -#define PF_ARM_DTCM 0x80000012 -#define PF_ARM_UNIFIED_CACHE 0x80000013 -#define PF_ARM_WRITE_BACK_CACHE 0x80000014 +#define PF_ARM_V4 0x80000001 +#define PF_ARM_V5 0x80000002 +#define PF_ARM_V6 0x80000003 +#define PF_ARM_V7 0x80000004 +#define PF_ARM_THUMB 0x80000005 +#define PF_ARM_JAZELLE 0x80000006 +#define PF_ARM_DSP 0x80000007 +#define PF_ARM_MOVE_CP 0x80000008 +#define PF_ARM_VFP10 0x80000009 +#define PF_ARM_MPU 0x8000000A +#define PF_ARM_WRITE_BUFFER 0x8000000B +#define PF_ARM_MBX 0x8000000C +#define PF_ARM_L2CACHE 0x8000000D +#define PF_ARM_PHYSICALLY_TAGGED_CACHE 0x8000000E +#define PF_ARM_VFP_SINGLE_PRECISION 0x8000000F +#define PF_ARM_VFP_DOUBLE_PRECISION 0x80000010 +#define PF_ARM_ITCM 0x80000011 +#define PF_ARM_DTCM 0x80000012 +#define PF_ARM_UNIFIED_CACHE 0x80000013 +#define PF_ARM_WRITE_BACK_CACHE 0x80000014 #define PF_ARM_CACHE_CAN_BE_LOCKED_DOWN 0x80000015 -#define PF_ARM_L2CACHE_MEMORY_MAPPED 0x80000016 -#define PF_ARM_L2CACHE_COPROC 0x80000017 -#define PF_ARM_THUMB2 0x80000018 -#define PF_ARM_T2EE 0x80000019 -#define PF_ARM_VFP3 0x8000001A -#define PF_ARM_NEON 0x8000001B -#define PF_ARM_UNALIGNED_ACCESS 0x8000001C +#define PF_ARM_L2CACHE_MEMORY_MAPPED 0x80000016 +#define PF_ARM_L2CACHE_COPROC 0x80000017 +#define PF_ARM_THUMB2 0x80000018 +#define PF_ARM_T2EE 0x80000019 +#define PF_ARM_VFP3 0x8000001A +#define PF_ARM_NEON 0x8000001B +#define PF_ARM_UNALIGNED_ACCESS 0x8000001C -#define PF_ARM_INTEL_XSCALE 0x80010001 -#define PF_ARM_INTEL_PMU 0x80010002 -#define PF_ARM_INTEL_WMMX 0x80010003 +#define PF_ARM_INTEL_XSCALE 0x80010001 +#define PF_ARM_INTEL_PMU 0x80010002 +#define PF_ARM_INTEL_WMMX 0x80010003 #endif #if !defined(_WIN32) || defined(_UWP) -WINPR_API BOOL GetVersionExA(LPOSVERSIONINFOA lpVersionInformation); -WINPR_API BOOL GetVersionExW(LPOSVERSIONINFOW lpVersionInformation); + WINPR_API BOOL GetVersionExA(LPOSVERSIONINFOA lpVersionInformation); + WINPR_API BOOL GetVersionExW(LPOSVERSIONINFOW lpVersionInformation); #ifdef UNICODE -#define GetVersionEx GetVersionExW +#define GetVersionEx GetVersionExW #else -#define GetVersionEx GetVersionExA +#define GetVersionEx GetVersionExA #endif #endif #if !defined(_WIN32) || defined(_UWP) -WINPR_API DWORD GetTickCount(void); + WINPR_API DWORD GetTickCount(void); -typedef enum _COMPUTER_NAME_FORMAT -{ - ComputerNameNetBIOS, - ComputerNameDnsHostname, - ComputerNameDnsDomain, - ComputerNameDnsFullyQualified, - ComputerNamePhysicalNetBIOS, - ComputerNamePhysicalDnsHostname, - ComputerNamePhysicalDnsDomain, - ComputerNamePhysicalDnsFullyQualified, - ComputerNameMax -} COMPUTER_NAME_FORMAT; + typedef enum _COMPUTER_NAME_FORMAT + { + ComputerNameNetBIOS, + ComputerNameDnsHostname, + ComputerNameDnsDomain, + ComputerNameDnsFullyQualified, + ComputerNamePhysicalNetBIOS, + ComputerNamePhysicalDnsHostname, + ComputerNamePhysicalDnsDomain, + ComputerNamePhysicalDnsFullyQualified, + ComputerNameMax + } COMPUTER_NAME_FORMAT; #define MAX_COMPUTERNAME_LENGTH 31 -WINPR_API BOOL GetComputerNameExA(COMPUTER_NAME_FORMAT NameType, LPSTR lpBuffer, LPDWORD lpnSize); -WINPR_API BOOL GetComputerNameExW(COMPUTER_NAME_FORMAT NameType, LPWSTR lpBuffer, LPDWORD lpnSize); + WINPR_API BOOL GetComputerNameExA(COMPUTER_NAME_FORMAT NameType, LPSTR lpBuffer, + LPDWORD lpnSize); + WINPR_API BOOL GetComputerNameExW(COMPUTER_NAME_FORMAT NameType, LPWSTR lpBuffer, + LPDWORD lpnSize); #ifdef UNICODE -#define GetComputerNameEx GetComputerNameExW +#define GetComputerNameEx GetComputerNameExW #else -#define GetComputerNameEx GetComputerNameExA +#define GetComputerNameEx GetComputerNameExA #endif #endif #if (!defined(_WIN32)) || (defined(_WIN32) && (_WIN32_WINNT < 0x0600)) -WINPR_API ULONGLONG winpr_GetTickCount64(void); + WINPR_API ULONGLONG winpr_GetTickCount64(void); #define GetTickCount64 winpr_GetTickCount64 #endif -WINPR_API DWORD GetTickCountPrecise(void); + WINPR_API DWORD GetTickCountPrecise(void); -WINPR_API BOOL IsProcessorFeaturePresentEx(DWORD ProcessorFeature); + WINPR_API BOOL IsProcessorFeaturePresentEx(DWORD ProcessorFeature); /* extended flags */ -#define PF_EX_LZCNT 1 -#define PF_EX_3DNOW_PREFETCH 2 -#define PF_EX_SSSE3 3 -#define PF_EX_SSE41 4 -#define PF_EX_SSE42 5 -#define PF_EX_AVX 6 -#define PF_EX_FMA 7 -#define PF_EX_AVX_AES 8 -#define PF_EX_AVX2 9 -#define PF_EX_ARM_VFP1 10 -#define PF_EX_ARM_VFP3D16 11 -#define PF_EX_ARM_VFP4 12 -#define PF_EX_ARM_IDIVA 13 -#define PF_EX_ARM_IDIVT 14 -#define PF_EX_AVX_PCLMULQDQ 15 +#define PF_EX_LZCNT 1 +#define PF_EX_3DNOW_PREFETCH 2 +#define PF_EX_SSSE3 3 +#define PF_EX_SSE41 4 +#define PF_EX_SSE42 5 +#define PF_EX_AVX 6 +#define PF_EX_FMA 7 +#define PF_EX_AVX_AES 8 +#define PF_EX_AVX2 9 +#define PF_EX_ARM_VFP1 10 +#define PF_EX_ARM_VFP3D16 11 +#define PF_EX_ARM_VFP4 12 +#define PF_EX_ARM_IDIVA 13 +#define PF_EX_ARM_IDIVT 14 +#define PF_EX_AVX_PCLMULQDQ 15 /* * some "aliases" for the standard defines * to be more clear */ -#define PF_SSE_INSTRUCTIONS_AVAILABLE PF_XMMI_INSTRUCTIONS_AVAILABLE -#define PF_SSE2_INSTRUCTIONS_AVAILABLE PF_XMMI64_INSTRUCTIONS_AVAILABLE +#define PF_SSE_INSTRUCTIONS_AVAILABLE PF_XMMI_INSTRUCTIONS_AVAILABLE +#define PF_SSE2_INSTRUCTIONS_AVAILABLE PF_XMMI64_INSTRUCTIONS_AVAILABLE #ifdef __cplusplus } diff --git a/winpr/include/winpr/tchar.h b/winpr/include/winpr/tchar.h index 2129c71ce..80110436b 100644 --- a/winpr/include/winpr/tchar.h +++ b/winpr/include/winpr/tchar.h @@ -36,31 +36,31 @@ typedef CHAR TCHAR; #endif #ifdef UNICODE -#define _tprintf wprintf -#define _tcslen _wcslen -#define _tcsdup _wcsdup -#define _tcscmp wcscmp -#define _tcsncmp wcsncmp -#define _tcscpy wcscpy -#define _tcscat wcscat -#define _tcschr wcschr -#define _tcsrchr wcsrchr -#define _tcsstr wcsstr -#define _stprintf_s swprintf_s -#define _tcsnccmp wcsncmp +#define _tprintf wprintf +#define _tcslen _wcslen +#define _tcsdup _wcsdup +#define _tcscmp wcscmp +#define _tcsncmp wcsncmp +#define _tcscpy wcscpy +#define _tcscat wcscat +#define _tcschr wcschr +#define _tcsrchr wcsrchr +#define _tcsstr wcsstr +#define _stprintf_s swprintf_s +#define _tcsnccmp wcsncmp #else -#define _tprintf printf -#define _tcslen strlen -#define _tcsdup _strdup -#define _tcscmp strcmp -#define _tcsncmp strncmp -#define _tcscpy strcpy -#define _tcscat strcat -#define _tcschr strchr -#define _tcsrchr strrchr -#define _tcsstr strstr -#define _stprintf_s sprintf_s -#define _tcsnccmp strncmp +#define _tprintf printf +#define _tcslen strlen +#define _tcsdup _strdup +#define _tcscmp strcmp +#define _tcsncmp strncmp +#define _tcscpy strcpy +#define _tcscat strcat +#define _tcschr strchr +#define _tcsrchr strrchr +#define _tcsstr strstr +#define _stprintf_s sprintf_s +#define _tcsnccmp strncmp #endif #endif diff --git a/winpr/include/winpr/thread.h b/winpr/include/winpr/thread.h index bc69ed121..ce840ba49 100644 --- a/winpr/include/winpr/thread.h +++ b/winpr/include/winpr/thread.h @@ -27,197 +27,227 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif #ifndef _WIN32 -typedef struct _STARTUPINFOA -{ - DWORD cb; - LPSTR lpReserved; - LPSTR lpDesktop; - LPSTR lpTitle; - DWORD dwX; - DWORD dwY; - DWORD dwXSize; - DWORD dwYSize; - DWORD dwXCountChars; - DWORD dwYCountChars; - DWORD dwFillAttribute; - DWORD dwFlags; - WORD wShowWindow; - WORD cbReserved2; - LPBYTE lpReserved2; - HANDLE hStdInput; - HANDLE hStdOutput; - HANDLE hStdError; -} STARTUPINFOA, *LPSTARTUPINFOA; + typedef struct _STARTUPINFOA + { + DWORD cb; + LPSTR lpReserved; + LPSTR lpDesktop; + LPSTR lpTitle; + DWORD dwX; + DWORD dwY; + DWORD dwXSize; + DWORD dwYSize; + DWORD dwXCountChars; + DWORD dwYCountChars; + DWORD dwFillAttribute; + DWORD dwFlags; + WORD wShowWindow; + WORD cbReserved2; + LPBYTE lpReserved2; + HANDLE hStdInput; + HANDLE hStdOutput; + HANDLE hStdError; + } STARTUPINFOA, *LPSTARTUPINFOA; -typedef struct _STARTUPINFOW -{ - DWORD cb; - LPWSTR lpReserved; - LPWSTR lpDesktop; - LPWSTR lpTitle; - DWORD dwX; - DWORD dwY; - DWORD dwXSize; - DWORD dwYSize; - DWORD dwXCountChars; - DWORD dwYCountChars; - DWORD dwFillAttribute; - DWORD dwFlags; - WORD wShowWindow; - WORD cbReserved2; - LPBYTE lpReserved2; - HANDLE hStdInput; - HANDLE hStdOutput; - HANDLE hStdError; -} STARTUPINFOW, *LPSTARTUPINFOW; + typedef struct _STARTUPINFOW + { + DWORD cb; + LPWSTR lpReserved; + LPWSTR lpDesktop; + LPWSTR lpTitle; + DWORD dwX; + DWORD dwY; + DWORD dwXSize; + DWORD dwYSize; + DWORD dwXCountChars; + DWORD dwYCountChars; + DWORD dwFillAttribute; + DWORD dwFlags; + WORD wShowWindow; + WORD cbReserved2; + LPBYTE lpReserved2; + HANDLE hStdInput; + HANDLE hStdOutput; + HANDLE hStdError; + } STARTUPINFOW, *LPSTARTUPINFOW; #ifdef UNICODE -typedef STARTUPINFOW STARTUPINFO; -typedef LPSTARTUPINFOW LPSTARTUPINFO; + typedef STARTUPINFOW STARTUPINFO; + typedef LPSTARTUPINFOW LPSTARTUPINFO; #else -typedef STARTUPINFOA STARTUPINFO; -typedef LPSTARTUPINFOA LPSTARTUPINFO; + typedef STARTUPINFOA STARTUPINFO; + typedef LPSTARTUPINFOA LPSTARTUPINFO; #endif -#define STARTF_USESHOWWINDOW 0x00000001 -#define STARTF_USESIZE 0x00000002 -#define STARTF_USEPOSITION 0x00000004 -#define STARTF_USECOUNTCHARS 0x00000008 -#define STARTF_USEFILLATTRIBUTE 0x00000010 -#define STARTF_RUNFULLSCREEN 0x00000020 -#define STARTF_FORCEONFEEDBACK 0x00000040 -#define STARTF_FORCEOFFFEEDBACK 0x00000080 -#define STARTF_USESTDHANDLES 0x00000100 -#define STARTF_USEHOTKEY 0x00000200 -#define STARTF_TITLEISLINKNAME 0x00000800 -#define STARTF_TITLEISAPPID 0x00001000 -#define STARTF_PREVENTPINNING 0x00002000 +#define STARTF_USESHOWWINDOW 0x00000001 +#define STARTF_USESIZE 0x00000002 +#define STARTF_USEPOSITION 0x00000004 +#define STARTF_USECOUNTCHARS 0x00000008 +#define STARTF_USEFILLATTRIBUTE 0x00000010 +#define STARTF_RUNFULLSCREEN 0x00000020 +#define STARTF_FORCEONFEEDBACK 0x00000040 +#define STARTF_FORCEOFFFEEDBACK 0x00000080 +#define STARTF_USESTDHANDLES 0x00000100 +#define STARTF_USEHOTKEY 0x00000200 +#define STARTF_TITLEISLINKNAME 0x00000800 +#define STARTF_TITLEISAPPID 0x00001000 +#define STARTF_PREVENTPINNING 0x00002000 -/* Process */ + /* Process */ -#define LOGON_WITH_PROFILE 0x00000001 -#define LOGON_NETCREDENTIALS_ONLY 0x00000002 -#define LOGON_ZERO_PASSWORD_BUFFER 0x80000000 +#define LOGON_WITH_PROFILE 0x00000001 +#define LOGON_NETCREDENTIALS_ONLY 0x00000002 +#define LOGON_ZERO_PASSWORD_BUFFER 0x80000000 -WINPR_API BOOL CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, - LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, - LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation); + WINPR_API BOOL CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, + LPSECURITY_ATTRIBUTES lpProcessAttributes, + LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, + DWORD dwCreationFlags, LPVOID lpEnvironment, + LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation); -WINPR_API BOOL CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, - LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, - LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation); + WINPR_API BOOL CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, + LPSECURITY_ATTRIBUTES lpProcessAttributes, + LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, + DWORD dwCreationFlags, LPVOID lpEnvironment, + LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation); -WINPR_API BOOL CreateProcessAsUserA(HANDLE hToken, LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, - LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, - LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation); + WINPR_API BOOL CreateProcessAsUserA(HANDLE hToken, LPCSTR lpApplicationName, + LPSTR lpCommandLine, + LPSECURITY_ATTRIBUTES lpProcessAttributes, + LPSECURITY_ATTRIBUTES lpThreadAttributes, + BOOL bInheritHandles, DWORD dwCreationFlags, + LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, + LPSTARTUPINFOA lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation); -WINPR_API BOOL CreateProcessAsUserW(HANDLE hToken, LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, - LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, - LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation); + WINPR_API BOOL CreateProcessAsUserW(HANDLE hToken, LPCWSTR lpApplicationName, + LPWSTR lpCommandLine, + LPSECURITY_ATTRIBUTES lpProcessAttributes, + LPSECURITY_ATTRIBUTES lpThreadAttributes, + BOOL bInheritHandles, DWORD dwCreationFlags, + LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, + LPSTARTUPINFOW lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation); -WINPR_API BOOL CreateProcessWithLogonA(LPCSTR lpUsername, LPCSTR lpDomain, LPCSTR lpPassword, DWORD dwLogonFlags, - LPCSTR lpApplicationName, LPSTR lpCommandLine, DWORD dwCreationFlags, LPVOID lpEnvironment, - LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation); + WINPR_API BOOL CreateProcessWithLogonA(LPCSTR lpUsername, LPCSTR lpDomain, LPCSTR lpPassword, + DWORD dwLogonFlags, LPCSTR lpApplicationName, + LPSTR lpCommandLine, DWORD dwCreationFlags, + LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, + LPSTARTUPINFOA lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation); -WINPR_API BOOL CreateProcessWithLogonW(LPCWSTR lpUsername, LPCWSTR lpDomain, LPCWSTR lpPassword, DWORD dwLogonFlags, - LPCWSTR lpApplicationName, LPWSTR lpCommandLine, DWORD dwCreationFlags, LPVOID lpEnvironment, - LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation); + WINPR_API BOOL CreateProcessWithLogonW(LPCWSTR lpUsername, LPCWSTR lpDomain, LPCWSTR lpPassword, + DWORD dwLogonFlags, LPCWSTR lpApplicationName, + LPWSTR lpCommandLine, DWORD dwCreationFlags, + LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, + LPSTARTUPINFOW lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation); -WINPR_API BOOL CreateProcessWithTokenA(HANDLE hToken, DWORD dwLogonFlags, - LPCSTR lpApplicationName, LPSTR lpCommandLine, DWORD dwCreationFlags, LPVOID lpEnvironment, - LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation); + WINPR_API BOOL CreateProcessWithTokenA(HANDLE hToken, DWORD dwLogonFlags, + LPCSTR lpApplicationName, LPSTR lpCommandLine, + DWORD dwCreationFlags, LPVOID lpEnvironment, + LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation); -WINPR_API BOOL CreateProcessWithTokenW(HANDLE hToken, DWORD dwLogonFlags, - LPCWSTR lpApplicationName, LPWSTR lpCommandLine, DWORD dwCreationFlags, LPVOID lpEnvironment, - LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation); + WINPR_API BOOL CreateProcessWithTokenW(HANDLE hToken, DWORD dwLogonFlags, + LPCWSTR lpApplicationName, LPWSTR lpCommandLine, + DWORD dwCreationFlags, LPVOID lpEnvironment, + LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation); #ifdef UNICODE -#define CreateProcess CreateProcessW -#define CreateProcessAsUser CreateProcessAsUserW -#define CreateProcessWithLogon CreateProcessWithLogonW -#define CreateProcessWithToken CreateProcessWithTokenW +#define CreateProcess CreateProcessW +#define CreateProcessAsUser CreateProcessAsUserW +#define CreateProcessWithLogon CreateProcessWithLogonW +#define CreateProcessWithToken CreateProcessWithTokenW #else -#define CreateProcess CreateProcessA -#define CreateProcessAsUser CreateProcessAsUserA -#define CreateProcessWithLogon CreateProcessWithLogonA -#define CreateProcessWithToken CreateProcessWithTokenA +#define CreateProcess CreateProcessA +#define CreateProcessAsUser CreateProcessAsUserA +#define CreateProcessWithLogon CreateProcessWithLogonA +#define CreateProcessWithToken CreateProcessWithTokenA #endif -DECLSPEC_NORETURN WINPR_API VOID ExitProcess(UINT uExitCode); -WINPR_API BOOL GetExitCodeProcess(HANDLE hProcess, LPDWORD lpExitCode); + DECLSPEC_NORETURN WINPR_API VOID ExitProcess(UINT uExitCode); + WINPR_API BOOL GetExitCodeProcess(HANDLE hProcess, LPDWORD lpExitCode); -WINPR_API HANDLE _GetCurrentProcess(void); -WINPR_API DWORD GetCurrentProcessId(void); + WINPR_API HANDLE _GetCurrentProcess(void); + WINPR_API DWORD GetCurrentProcessId(void); -WINPR_API BOOL TerminateProcess(HANDLE hProcess, UINT uExitCode); + WINPR_API BOOL TerminateProcess(HANDLE hProcess, UINT uExitCode); -/* Process Argument Vector Parsing */ + /* Process Argument Vector Parsing */ -WINPR_API LPWSTR* CommandLineToArgvW(LPCWSTR lpCmdLine, int* pNumArgs); + WINPR_API LPWSTR* CommandLineToArgvW(LPCWSTR lpCmdLine, int* pNumArgs); #ifdef UNICODE -#define CommandLineToArgv CommandLineToArgvW +#define CommandLineToArgv CommandLineToArgvW #else -#define CommandLineToArgv CommandLineToArgvA +#define CommandLineToArgv CommandLineToArgvA #endif -/* Thread */ + /* Thread */ -#define CREATE_SUSPENDED 0x00000004 -#define STACK_SIZE_PARAM_IS_A_RESERVATION 0x00010000 +#define CREATE_SUSPENDED 0x00000004 +#define STACK_SIZE_PARAM_IS_A_RESERVATION 0x00010000 -WINPR_API HANDLE CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize, - LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId); + WINPR_API HANDLE CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize, + LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, + DWORD dwCreationFlags, LPDWORD lpThreadId); -WINPR_API HANDLE CreateRemoteThread(HANDLE hProcess, LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize, - LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId); + WINPR_API HANDLE CreateRemoteThread(HANDLE hProcess, LPSECURITY_ATTRIBUTES lpThreadAttributes, + SIZE_T dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, + LPVOID lpParameter, DWORD dwCreationFlags, + LPDWORD lpThreadId); -WINPR_API DECLSPEC_NORETURN VOID ExitThread(DWORD dwExitCode); -WINPR_API BOOL GetExitCodeThread(HANDLE hThread, LPDWORD lpExitCode); + WINPR_API DECLSPEC_NORETURN VOID ExitThread(DWORD dwExitCode); + WINPR_API BOOL GetExitCodeThread(HANDLE hThread, LPDWORD lpExitCode); -WINPR_API HANDLE _GetCurrentThread(void); -WINPR_API DWORD GetCurrentThreadId(void); + WINPR_API HANDLE _GetCurrentThread(void); + WINPR_API DWORD GetCurrentThreadId(void); -WINPR_API DWORD ResumeThread(HANDLE hThread); -WINPR_API DWORD SuspendThread(HANDLE hThread); -WINPR_API BOOL SwitchToThread(void); + WINPR_API DWORD ResumeThread(HANDLE hThread); + WINPR_API DWORD SuspendThread(HANDLE hThread); + WINPR_API BOOL SwitchToThread(void); -WINPR_API BOOL TerminateThread(HANDLE hThread, DWORD dwExitCode); + WINPR_API BOOL TerminateThread(HANDLE hThread, DWORD dwExitCode); -/* Processor */ + /* Processor */ -WINPR_API DWORD GetCurrentProcessorNumber(void); + WINPR_API DWORD GetCurrentProcessorNumber(void); -/* Thread-Local Storage */ + /* Thread-Local Storage */ -#define TLS_OUT_OF_INDEXES ((DWORD) 0xFFFFFFFF) +#define TLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF) -WINPR_API DWORD TlsAlloc(void); -WINPR_API LPVOID TlsGetValue(DWORD dwTlsIndex); -WINPR_API BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue); -WINPR_API BOOL TlsFree(DWORD dwTlsIndex); + WINPR_API DWORD TlsAlloc(void); + WINPR_API LPVOID TlsGetValue(DWORD dwTlsIndex); + WINPR_API BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue); + WINPR_API BOOL TlsFree(DWORD dwTlsIndex); #else /* * GetCurrentProcess / GetCurrentThread cause a conflict on Mac OS X */ -#define _GetCurrentProcess GetCurrentProcess -#define _GetCurrentThread GetCurrentThread +#define _GetCurrentProcess GetCurrentProcess +#define _GetCurrentThread GetCurrentThread #endif -/* CommandLineToArgvA is not present in the original Windows API, WinPR always exports it */ + /* CommandLineToArgvA is not present in the original Windows API, WinPR always exports it */ -WINPR_API LPSTR *CommandLineToArgvA(LPCSTR lpCmdLine, int *pNumArgs); + WINPR_API LPSTR* CommandLineToArgvA(LPCSTR lpCmdLine, int* pNumArgs); #if defined(WITH_DEBUG_THREADS) -WINPR_API VOID DumpThreadHandles(void); + WINPR_API VOID DumpThreadHandles(void); #endif #ifdef __cplusplus @@ -225,4 +255,3 @@ WINPR_API VOID DumpThreadHandles(void); #endif #endif /* WINPR_THREAD_H */ - diff --git a/winpr/include/winpr/timezone.h b/winpr/include/winpr/timezone.h index ce917dc4c..a2bf0aba1 100644 --- a/winpr/include/winpr/timezone.h +++ b/winpr/include/winpr/timezone.h @@ -26,43 +26,47 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif #ifndef _WIN32 -typedef struct _TIME_ZONE_INFORMATION -{ - LONG Bias; - WCHAR StandardName[32]; - SYSTEMTIME StandardDate; - LONG StandardBias; - WCHAR DaylightName[32]; - SYSTEMTIME DaylightDate; - LONG DaylightBias; -} TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION; + typedef struct _TIME_ZONE_INFORMATION + { + LONG Bias; + WCHAR StandardName[32]; + SYSTEMTIME StandardDate; + LONG StandardBias; + WCHAR DaylightName[32]; + SYSTEMTIME DaylightDate; + LONG DaylightBias; + } TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION; -typedef struct _TIME_DYNAMIC_ZONE_INFORMATION -{ - LONG Bias; - WCHAR StandardName[32]; - SYSTEMTIME StandardDate; - LONG StandardBias; - WCHAR DaylightName[32]; - SYSTEMTIME DaylightDate; - LONG DaylightBias; - WCHAR TimeZoneKeyName[128]; - BOOLEAN DynamicDaylightTimeDisabled; -} DYNAMIC_TIME_ZONE_INFORMATION, *PDYNAMIC_TIME_ZONE_INFORMATION, *LPDYNAMIC_TIME_ZONE_INFORMATION; + typedef struct _TIME_DYNAMIC_ZONE_INFORMATION + { + LONG Bias; + WCHAR StandardName[32]; + SYSTEMTIME StandardDate; + LONG StandardBias; + WCHAR DaylightName[32]; + SYSTEMTIME DaylightDate; + LONG DaylightBias; + WCHAR TimeZoneKeyName[128]; + BOOLEAN DynamicDaylightTimeDisabled; + } DYNAMIC_TIME_ZONE_INFORMATION, *PDYNAMIC_TIME_ZONE_INFORMATION, + *LPDYNAMIC_TIME_ZONE_INFORMATION; -WINPR_API DWORD GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation); -WINPR_API BOOL SetTimeZoneInformation(const TIME_ZONE_INFORMATION* lpTimeZoneInformation); -WINPR_API BOOL SystemTimeToFileTime(const SYSTEMTIME* lpSystemTime, LPFILETIME lpFileTime); -WINPR_API BOOL FileTimeToSystemTime(const FILETIME *lpFileTime, LPSYSTEMTIME lpSystemTime); -WINPR_API BOOL SystemTimeToTzSpecificLocalTime(LPTIME_ZONE_INFORMATION lpTimeZone, - LPSYSTEMTIME lpUniversalTime, LPSYSTEMTIME lpLocalTime); -WINPR_API BOOL TzSpecificLocalTimeToSystemTime(LPTIME_ZONE_INFORMATION lpTimeZoneInformation, - LPSYSTEMTIME lpLocalTime, LPSYSTEMTIME lpUniversalTime); + WINPR_API DWORD GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation); + WINPR_API BOOL SetTimeZoneInformation(const TIME_ZONE_INFORMATION* lpTimeZoneInformation); + WINPR_API BOOL SystemTimeToFileTime(const SYSTEMTIME* lpSystemTime, LPFILETIME lpFileTime); + WINPR_API BOOL FileTimeToSystemTime(const FILETIME* lpFileTime, LPSYSTEMTIME lpSystemTime); + WINPR_API BOOL SystemTimeToTzSpecificLocalTime(LPTIME_ZONE_INFORMATION lpTimeZone, + LPSYSTEMTIME lpUniversalTime, + LPSYSTEMTIME lpLocalTime); + WINPR_API BOOL TzSpecificLocalTimeToSystemTime(LPTIME_ZONE_INFORMATION lpTimeZoneInformation, + LPSYSTEMTIME lpLocalTime, + LPSYSTEMTIME lpUniversalTime); #endif @@ -70,28 +74,37 @@ WINPR_API BOOL TzSpecificLocalTimeToSystemTime(LPTIME_ZONE_INFORMATION lpTimeZon * GetDynamicTimeZoneInformation is provided by the SDK if _WIN32_WINNT >= 0x0600 in SDKs above 7.1A * and incorrectly if _WIN32_WINNT >= 0x0501 in older SDKs */ -#if !defined(_WIN32) || (defined(_WIN32) && (defined(NTDDI_WIN8) && _WIN32_WINNT < 0x0600 || !defined(NTDDI_WIN8) && _WIN32_WINNT < 0x0501)) /* Windows Vista */ +#if !defined(_WIN32) || \ + (defined(_WIN32) && (defined(NTDDI_WIN8) && _WIN32_WINNT < 0x0600 || \ + !defined(NTDDI_WIN8) && _WIN32_WINNT < 0x0501)) /* Windows Vista */ -WINPR_API DWORD GetDynamicTimeZoneInformation(PDYNAMIC_TIME_ZONE_INFORMATION pTimeZoneInformation); -WINPR_API BOOL SetDynamicTimeZoneInformation(const DYNAMIC_TIME_ZONE_INFORMATION* lpTimeZoneInformation); -WINPR_API BOOL GetTimeZoneInformationForYear(USHORT wYear, PDYNAMIC_TIME_ZONE_INFORMATION pdtzi, LPTIME_ZONE_INFORMATION ptzi); + WINPR_API DWORD + GetDynamicTimeZoneInformation(PDYNAMIC_TIME_ZONE_INFORMATION pTimeZoneInformation); + WINPR_API BOOL + SetDynamicTimeZoneInformation(const DYNAMIC_TIME_ZONE_INFORMATION* lpTimeZoneInformation); + WINPR_API BOOL GetTimeZoneInformationForYear(USHORT wYear, PDYNAMIC_TIME_ZONE_INFORMATION pdtzi, + LPTIME_ZONE_INFORMATION ptzi); #endif #if !defined(_WIN32) || (defined(_WIN32) && (_WIN32_WINNT < 0x0601)) /* Windows 7 */ -WINPR_API BOOL SystemTimeToTzSpecificLocalTimeEx(const DYNAMIC_TIME_ZONE_INFORMATION* lpTimeZoneInformation, - const SYSTEMTIME* lpUniversalTime, LPSYSTEMTIME lpLocalTime); -WINPR_API BOOL TzSpecificLocalTimeToSystemTimeEx(const DYNAMIC_TIME_ZONE_INFORMATION* lpTimeZoneInformation, - const SYSTEMTIME* lpLocalTime, LPSYSTEMTIME lpUniversalTime); + WINPR_API BOOL + SystemTimeToTzSpecificLocalTimeEx(const DYNAMIC_TIME_ZONE_INFORMATION* lpTimeZoneInformation, + const SYSTEMTIME* lpUniversalTime, LPSYSTEMTIME lpLocalTime); + WINPR_API BOOL + TzSpecificLocalTimeToSystemTimeEx(const DYNAMIC_TIME_ZONE_INFORMATION* lpTimeZoneInformation, + const SYSTEMTIME* lpLocalTime, LPSYSTEMTIME lpUniversalTime); #endif #if !defined(_WIN32) || (defined(_WIN32) && (_WIN32_WINNT < 0x0602)) /* Windows 8 */ -WINPR_API DWORD EnumDynamicTimeZoneInformation(const DWORD dwIndex, PDYNAMIC_TIME_ZONE_INFORMATION lpTimeZoneInformation); -WINPR_API DWORD GetDynamicTimeZoneInformationEffectiveYears(const PDYNAMIC_TIME_ZONE_INFORMATION lpTimeZoneInformation, - LPDWORD FirstYear, LPDWORD LastYear); + WINPR_API DWORD EnumDynamicTimeZoneInformation( + const DWORD dwIndex, PDYNAMIC_TIME_ZONE_INFORMATION lpTimeZoneInformation); + WINPR_API DWORD GetDynamicTimeZoneInformationEffectiveYears( + const PDYNAMIC_TIME_ZONE_INFORMATION lpTimeZoneInformation, LPDWORD FirstYear, + LPDWORD LastYear); #endif @@ -100,4 +113,3 @@ WINPR_API DWORD GetDynamicTimeZoneInformationEffectiveYears(const PDYNAMIC_TIME_ #endif #endif /* WINPR_TIMEZONE_H */ - diff --git a/winpr/include/winpr/tools/makecert.h b/winpr/include/winpr/tools/makecert.h index 4eb0aaf56..dbb71a8b7 100644 --- a/winpr/include/winpr/tools/makecert.h +++ b/winpr/include/winpr/tools/makecert.h @@ -23,19 +23,20 @@ #include #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct _MAKECERT_CONTEXT MAKECERT_CONTEXT; + typedef struct _MAKECERT_CONTEXT MAKECERT_CONTEXT; -WINPR_API int makecert_context_process(MAKECERT_CONTEXT* context, int argc, char** argv); + WINPR_API int makecert_context_process(MAKECERT_CONTEXT* context, int argc, char** argv); -WINPR_API int makecert_context_set_output_file_name(MAKECERT_CONTEXT* context, char* name); -WINPR_API int makecert_context_output_certificate_file(MAKECERT_CONTEXT* context, char* path); -WINPR_API int makecert_context_output_private_key_file(MAKECERT_CONTEXT* context, char* path); + WINPR_API int makecert_context_set_output_file_name(MAKECERT_CONTEXT* context, char* name); + WINPR_API int makecert_context_output_certificate_file(MAKECERT_CONTEXT* context, char* path); + WINPR_API int makecert_context_output_private_key_file(MAKECERT_CONTEXT* context, char* path); -WINPR_API MAKECERT_CONTEXT* makecert_context_new(void); -WINPR_API void makecert_context_free(MAKECERT_CONTEXT* context); + WINPR_API MAKECERT_CONTEXT* makecert_context_new(void); + WINPR_API void makecert_context_free(MAKECERT_CONTEXT* context); #ifdef __cplusplus } diff --git a/winpr/include/winpr/user.h b/winpr/include/winpr/user.h index d0eec5051..558bfdb6f 100644 --- a/winpr/include/winpr/user.h +++ b/winpr/include/winpr/user.h @@ -29,72 +29,72 @@ #ifndef _WIN32 -#define MB_OK 0x00000000L -#define MB_OKCANCEL 0x00000001L -#define MB_ABORTRETRYIGNORE 0x00000002L -#define MB_YESNOCANCEL 0x00000003L -#define MB_YESNO 0x00000004L -#define MB_RETRYCANCEL 0x00000005L -#define MB_CANCELTRYCONTINUE 0x00000006L +#define MB_OK 0x00000000L +#define MB_OKCANCEL 0x00000001L +#define MB_ABORTRETRYIGNORE 0x00000002L +#define MB_YESNOCANCEL 0x00000003L +#define MB_YESNO 0x00000004L +#define MB_RETRYCANCEL 0x00000005L +#define MB_CANCELTRYCONTINUE 0x00000006L -#define IDOK 1 -#define IDCANCEL 2 -#define IDABORT 3 -#define IDRETRY 4 -#define IDIGNORE 5 -#define IDYES 6 -#define IDNO 7 -#define IDTRYAGAIN 10 -#define IDCONTINUE 11 -#define IDTIMEOUT 32000 -#define IDASYNC 32001 +#define IDOK 1 +#define IDCANCEL 2 +#define IDABORT 3 +#define IDRETRY 4 +#define IDIGNORE 5 +#define IDYES 6 +#define IDNO 7 +#define IDTRYAGAIN 10 +#define IDCONTINUE 11 +#define IDTIMEOUT 32000 +#define IDASYNC 32001 -#define CF_RAW 0 -#define CF_TEXT 1 -#define CF_BITMAP 2 -#define CF_METAFILEPICT 3 -#define CF_SYLK 4 -#define CF_DIF 5 -#define CF_TIFF 6 -#define CF_OEMTEXT 7 -#define CF_DIB 8 -#define CF_PALETTE 9 -#define CF_PENDATA 10 -#define CF_RIFF 11 -#define CF_WAVE 12 -#define CF_UNICODETEXT 13 -#define CF_ENHMETAFILE 14 -#define CF_HDROP 15 -#define CF_LOCALE 16 -#define CF_DIBV5 17 -#define CF_MAX 18 +#define CF_RAW 0 +#define CF_TEXT 1 +#define CF_BITMAP 2 +#define CF_METAFILEPICT 3 +#define CF_SYLK 4 +#define CF_DIF 5 +#define CF_TIFF 6 +#define CF_OEMTEXT 7 +#define CF_DIB 8 +#define CF_PALETTE 9 +#define CF_PENDATA 10 +#define CF_RIFF 11 +#define CF_WAVE 12 +#define CF_UNICODETEXT 13 +#define CF_ENHMETAFILE 14 +#define CF_HDROP 15 +#define CF_LOCALE 16 +#define CF_DIBV5 17 +#define CF_MAX 18 -#define CF_OWNERDISPLAY 0x0080 -#define CF_DSPTEXT 0x0081 -#define CF_DSPBITMAP 0x0082 -#define CF_DSPMETAFILEPICT 0x0083 -#define CF_DSPENHMETAFILE 0x008E +#define CF_OWNERDISPLAY 0x0080 +#define CF_DSPTEXT 0x0081 +#define CF_DSPBITMAP 0x0082 +#define CF_DSPMETAFILEPICT 0x0083 +#define CF_DSPENHMETAFILE 0x008E -#define CF_PRIVATEFIRST 0x0200 -#define CF_PRIVATELAST 0x02FF +#define CF_PRIVATEFIRST 0x0200 +#define CF_PRIVATELAST 0x02FF -#define CF_GDIOBJFIRST 0x0300 -#define CF_GDIOBJLAST 0x03FF +#define CF_GDIOBJFIRST 0x0300 +#define CF_GDIOBJLAST 0x03FF /* Windows Metafile Picture Format */ -#define MM_TEXT 1 -#define MM_LOMETRIC 2 -#define MM_HIMETRIC 3 -#define MM_LOENGLISH 4 -#define MM_HIENGLISH 5 -#define MM_TWIPS 6 -#define MM_ISOTROPIC 7 -#define MM_ANISOTROPIC 8 +#define MM_TEXT 1 +#define MM_LOMETRIC 2 +#define MM_HIMETRIC 3 +#define MM_LOENGLISH 4 +#define MM_HIENGLISH 5 +#define MM_TWIPS 6 +#define MM_ISOTROPIC 7 +#define MM_ANISOTROPIC 8 -#define MM_MIN MM_TEXT -#define MM_MAX MM_ANISOTROPIC -#define MM_MAX_FIXEDSCALE MM_TWIPS +#define MM_MIN MM_TEXT +#define MM_MAX MM_ANISOTROPIC +#define MM_MAX_FIXEDSCALE MM_TWIPS #endif @@ -116,7 +116,7 @@ typedef struct tagCIEXYZ FXPT2DOT30 ciexyzZ; } CIEXYZ; -typedef CIEXYZ FAR *LPCIEXYZ; +typedef CIEXYZ FAR* LPCIEXYZ; typedef struct tagICEXYZTRIPLE { @@ -125,7 +125,7 @@ typedef struct tagICEXYZTRIPLE CIEXYZ ciexyzBlue; } CIEXYZTRIPLE; -typedef CIEXYZTRIPLE FAR *LPCIEXYZTRIPLE; +typedef CIEXYZTRIPLE FAR* LPCIEXYZTRIPLE; typedef struct tagBITMAP { @@ -155,15 +155,15 @@ typedef struct tagRGBQUAD typedef RGBQUAD FAR* LPRGBQUAD; -#define BI_RGB 0 -#define BI_RLE8 1 -#define BI_RLE4 2 -#define BI_BITFIELDS 3 -#define BI_JPEG 4 -#define BI_PNG 5 +#define BI_RGB 0 +#define BI_RLE8 1 +#define BI_RLE4 2 +#define BI_BITFIELDS 3 +#define BI_JPEG 4 +#define BI_PNG 5 -#define PROFILE_LINKED 'LINK' -#define PROFILE_EMBEDDED 'MBED' +#define PROFILE_LINKED 'LINK' +#define PROFILE_EMBEDDED 'MBED' typedef struct tagBITMAPINFOHEADER { @@ -191,7 +191,7 @@ typedef enum _ORIENTATION_PREFERENCE ORIENTATION_PREFERENCE_NONE = 0x0, ORIENTATION_PREFERENCE_LANDSCAPE = 0x1, - ORIENTATION_PREFERENCE_PORTRAIT = 0x2, + ORIENTATION_PREFERENCE_PORTRAIT = 0x2, ORIENTATION_PREFERENCE_LANDSCAPE_FLIPPED = 0x4, ORIENTATION_PREFERENCE_PORTRAIT_FLIPPED = 0x8 } ORIENTATION_PREFERENCE; @@ -285,14 +285,12 @@ typedef struct tagBITMAPFILEHEADER #endif #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif - - #ifdef __cplusplus } #endif #endif /* WINPR_USER_H */ - diff --git a/winpr/include/winpr/windows.h b/winpr/include/winpr/windows.h index 75f1839bd..b5313f067 100644 --- a/winpr/include/winpr/windows.h +++ b/winpr/include/winpr/windows.h @@ -37,70 +37,70 @@ /* Client System Parameters Update PDU * defined in winuser.h */ -#define SPI_SETCARETWIDTH 0x00002007 -#define SPI_SETSTICKYKEYS 0x0000003B -#define SPI_SETTOGGLEKEYS 0x00000035 -#define SPI_SETFILTERKEYS 0x00000033 +#define SPI_SETCARETWIDTH 0x00002007 +#define SPI_SETSTICKYKEYS 0x0000003B +#define SPI_SETTOGGLEKEYS 0x00000035 +#define SPI_SETFILTERKEYS 0x00000033 /* Server System Parameters Update PDU */ -#define SPI_SETSCREENSAVEACTIVE 0x00000011 +#define SPI_SETSCREENSAVEACTIVE 0x00000011 /* HIGHCONTRAST flags values */ -#define HCF_HIGHCONTRASTON 0x00000001 -#define HCF_AVAILABLE 0x00000002 -#define HCF_HOTKEYACTIVE 0x00000004 -#define HCF_CONFIRMHOTKEY 0x00000008 -#define HCF_HOTKEYSOUND 0x00000010 -#define HCF_INDICATOR 0x00000020 -#define HCF_HOTKEYAVAILABLE 0x00000040 +#define HCF_HIGHCONTRASTON 0x00000001 +#define HCF_AVAILABLE 0x00000002 +#define HCF_HOTKEYACTIVE 0x00000004 +#define HCF_CONFIRMHOTKEY 0x00000008 +#define HCF_HOTKEYSOUND 0x00000010 +#define HCF_INDICATOR 0x00000020 +#define HCF_HOTKEYAVAILABLE 0x00000040 /* TS_FILTERKEYS */ -#define FKF_FILTERKEYSON 0x00000001 -#define FKF_AVAILABLE 0x00000002 -#define FKF_HOTKEYACTIVE 0x00000004 +#define FKF_FILTERKEYSON 0x00000001 +#define FKF_AVAILABLE 0x00000002 +#define FKF_HOTKEYACTIVE 0x00000004 #define FKF_CONFIRMHOTKEY 0x00000008 -#define FKF_HOTKEYSOUND 0x00000010 -#define FKF_INDICATOR 0x00000020 -#define FKF_CLICKON 0x00000040 +#define FKF_HOTKEYSOUND 0x00000010 +#define FKF_INDICATOR 0x00000020 +#define FKF_CLICKON 0x00000040 /* TS_TOGGLEKEYS */ -#define TKF_TOGGLEKEYSON 0x00000001 -#define TKF_AVAILABLE 0x00000002 -#define TKF_HOTKEYACTIVE 0x00000004 -#define TKF_CONFIRMHOTKEY 0x00000008 -#define TKF_HOTKEYSOUND 0x00000010 +#define TKF_TOGGLEKEYSON 0x00000001 +#define TKF_AVAILABLE 0x00000002 +#define TKF_HOTKEYACTIVE 0x00000004 +#define TKF_CONFIRMHOTKEY 0x00000008 +#define TKF_HOTKEYSOUND 0x00000010 /* TS_STICKYKEYS */ -#define SKF_STICKYKEYSON 0x00000001 -#define SKF_AVAILABLE 0x00000002 -#define SKF_HOTKEYACTIVE 0x00000004 -#define SKF_CONFIRMHOTKEY 0x00000008 -#define SKF_HOTKEYSOUND 0x00000010 -#define SKF_INDICATOR 0x00000020 -#define SKF_AUDIBLEFEEDBACK 0x00000040 -#define SKF_TRISTATE 0x00000080 -#define SKF_TWOKEYSOFF 0x00000100 -#define SKF_LSHIFTLOCKED 0x00010000 -#define SKF_RSHIFTLOCKED 0x00020000 -#define SKF_LCTLLOCKED 0x00040000 -#define SKF_RCTLLOCKED 0x00080000 -#define SKF_LALTLOCKED 0x00100000 -#define SKF_RALTLOCKED 0x00200000 -#define SKF_LWINLOCKED 0x00400000 -#define SKF_RWINLOCKED 0x00800000 -#define SKF_LSHIFTLATCHED 0x01000000 -#define SKF_RSHIFTLATCHED 0x02000000 -#define SKF_LCTLLATCHED 0x04000000 -#define SKF_RCTLLATCHED 0x08000000 -#define SKF_LALTLATCHED 0x10000000 -#define SKF_RALTLATCHED 0x20000000 -#define SKF_LWINLATCHED 0x40000000 -#define SKF_RWINLATCHED 0x80000000 +#define SKF_STICKYKEYSON 0x00000001 +#define SKF_AVAILABLE 0x00000002 +#define SKF_HOTKEYACTIVE 0x00000004 +#define SKF_CONFIRMHOTKEY 0x00000008 +#define SKF_HOTKEYSOUND 0x00000010 +#define SKF_INDICATOR 0x00000020 +#define SKF_AUDIBLEFEEDBACK 0x00000040 +#define SKF_TRISTATE 0x00000080 +#define SKF_TWOKEYSOFF 0x00000100 +#define SKF_LSHIFTLOCKED 0x00010000 +#define SKF_RSHIFTLOCKED 0x00020000 +#define SKF_LCTLLOCKED 0x00040000 +#define SKF_RCTLLOCKED 0x00080000 +#define SKF_LALTLOCKED 0x00100000 +#define SKF_RALTLOCKED 0x00200000 +#define SKF_LWINLOCKED 0x00400000 +#define SKF_RWINLOCKED 0x00800000 +#define SKF_LSHIFTLATCHED 0x01000000 +#define SKF_RSHIFTLATCHED 0x02000000 +#define SKF_LCTLLATCHED 0x04000000 +#define SKF_RCTLLATCHED 0x08000000 +#define SKF_LALTLATCHED 0x10000000 +#define SKF_RALTLATCHED 0x20000000 +#define SKF_LWINLATCHED 0x40000000 +#define SKF_RWINLATCHED 0x80000000 #endif #ifndef SPI_SETSCREENSAVESECURE -#define SPI_SETSCREENSAVESECURE 0x00000077 +#define SPI_SETSCREENSAVESECURE 0x00000077 #endif #endif /* WINPR_WINDOWS_H */ diff --git a/winpr/include/winpr/winhttp.h b/winpr/include/winpr/winhttp.h index 462e91763..9104377f2 100644 --- a/winpr/include/winpr/winhttp.h +++ b/winpr/include/winpr/winhttp.h @@ -36,43 +36,41 @@ typedef HINTERNET* LPHINTERNET; typedef WORD INTERNET_PORT; typedef INTERNET_PORT* LPINTERNET_PORT; -#define INTERNET_DEFAULT_PORT 0 -#define INTERNET_DEFAULT_HTTP_PORT 80 -#define INTERNET_DEFAULT_HTTPS_PORT 443 +#define INTERNET_DEFAULT_PORT 0 +#define INTERNET_DEFAULT_HTTP_PORT 80 +#define INTERNET_DEFAULT_HTTPS_PORT 443 -#define WINHTTP_FLAG_ASYNC 0x10000000 +#define WINHTTP_FLAG_ASYNC 0x10000000 -#define WINHTTP_FLAG_SECURE 0x00800000 -#define WINHTTP_FLAG_ESCAPE_PERCENT 0x00000004 -#define WINHTTP_FLAG_NULL_CODEPAGE 0x00000008 -#define WINHTTP_FLAG_BYPASS_PROXY_CACHE 0x00000100 -#define WINHTTP_FLAG_REFRESH WINHTTP_FLAG_BYPASS_PROXY_CACHE -#define WINHTTP_FLAG_ESCAPE_DISABLE 0x00000040 -#define WINHTTP_FLAG_ESCAPE_DISABLE_QUERY 0x00000080 +#define WINHTTP_FLAG_SECURE 0x00800000 +#define WINHTTP_FLAG_ESCAPE_PERCENT 0x00000004 +#define WINHTTP_FLAG_NULL_CODEPAGE 0x00000008 +#define WINHTTP_FLAG_BYPASS_PROXY_CACHE 0x00000100 +#define WINHTTP_FLAG_REFRESH WINHTTP_FLAG_BYPASS_PROXY_CACHE +#define WINHTTP_FLAG_ESCAPE_DISABLE 0x00000040 +#define WINHTTP_FLAG_ESCAPE_DISABLE_QUERY 0x00000080 -#define SECURITY_FLAG_IGNORE_UNKNOWN_CA 0x00000100 -#define SECURITY_FLAG_IGNORE_CERT_DATE_INVALID 0x00002000 -#define SECURITY_FLAG_IGNORE_CERT_CN_INVALID 0x00001000 -#define SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE 0x00000200 +#define SECURITY_FLAG_IGNORE_UNKNOWN_CA 0x00000100 +#define SECURITY_FLAG_IGNORE_CERT_DATE_INVALID 0x00002000 +#define SECURITY_FLAG_IGNORE_CERT_CN_INVALID 0x00001000 +#define SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE 0x00000200 typedef struct { DWORD_PTR dwResult; DWORD dwError; -} -WINHTTP_ASYNC_RESULT, *LPWINHTTP_ASYNC_RESULT; +} WINHTTP_ASYNC_RESULT, *LPWINHTTP_ASYNC_RESULT; typedef struct { DWORD dwMajorVersion; DWORD dwMinorVersion; -} -HTTP_VERSION_INFO, *LPHTTP_VERSION_INFO; +} HTTP_VERSION_INFO, *LPHTTP_VERSION_INFO; typedef int INTERNET_SCHEME, *LPINTERNET_SCHEME; -#define INTERNET_SCHEME_HTTP (1) -#define INTERNET_SCHEME_HTTPS (2) +#define INTERNET_SCHEME_HTTP (1) +#define INTERNET_SCHEME_HTTPS (2) typedef struct { @@ -91,8 +89,7 @@ typedef struct DWORD dwUrlPathLength; LPWSTR lpszExtraInfo; DWORD dwExtraInfoLength; -} -URL_COMPONENTS, *LPURL_COMPONENTS; +} URL_COMPONENTS, *LPURL_COMPONENTS; typedef URL_COMPONENTS URL_COMPONENTSW; typedef LPURL_COMPONENTS LPURL_COMPONENTSW; @@ -102,8 +99,7 @@ typedef struct DWORD dwAccessType; LPWSTR lpszProxy; LPWSTR lpszProxyBypass; -} -WINHTTP_PROXY_INFO, *LPWINHTTP_PROXY_INFO; +} WINHTTP_PROXY_INFO, *LPWINHTTP_PROXY_INFO; typedef WINHTTP_PROXY_INFO WINHTTP_PROXY_INFOW; typedef LPWINHTTP_PROXY_INFO LPWINHTTP_PROXY_INFOW; @@ -118,15 +114,15 @@ typedef struct BOOL fAutoLogonIfChallenged; } WINHTTP_AUTOPROXY_OPTIONS; -#define WINHTTP_AUTOPROXY_AUTO_DETECT 0x00000001 -#define WINHTTP_AUTOPROXY_CONFIG_URL 0x00000002 -#define WINHTTP_AUTOPROXY_HOST_KEEPCASE 0x00000004 -#define WINHTTP_AUTOPROXY_HOST_LOWERCASE 0x00000008 -#define WINHTTP_AUTOPROXY_RUN_INPROCESS 0x00010000 -#define WINHTTP_AUTOPROXY_RUN_OUTPROCESS_ONLY 0x00020000 +#define WINHTTP_AUTOPROXY_AUTO_DETECT 0x00000001 +#define WINHTTP_AUTOPROXY_CONFIG_URL 0x00000002 +#define WINHTTP_AUTOPROXY_HOST_KEEPCASE 0x00000004 +#define WINHTTP_AUTOPROXY_HOST_LOWERCASE 0x00000008 +#define WINHTTP_AUTOPROXY_RUN_INPROCESS 0x00010000 +#define WINHTTP_AUTOPROXY_RUN_OUTPROCESS_ONLY 0x00020000 -#define WINHTTP_AUTO_DETECT_TYPE_DHCP 0x00000001 -#define WINHTTP_AUTO_DETECT_TYPE_DNS_A 0x00000002 +#define WINHTTP_AUTO_DETECT_TYPE_DHCP 0x00000001 +#define WINHTTP_AUTO_DETECT_TYPE_DNS_A 0x00000002 typedef struct { @@ -147,123 +143,123 @@ typedef struct SOCKADDR_STORAGE RemoteAddress; } WINHTTP_CONNECTION_INFO; -#define WINHTTP_TIME_FORMAT_BUFSIZE 62 +#define WINHTTP_TIME_FORMAT_BUFSIZE 62 -#define ICU_NO_ENCODE 0x20000000 -#define ICU_DECODE 0x10000000 -#define ICU_NO_META 0x08000000 -#define ICU_ENCODE_SPACES_ONLY 0x04000000 -#define ICU_BROWSER_MODE 0x02000000 -#define ICU_ENCODE_PERCENT 0x00001000 +#define ICU_NO_ENCODE 0x20000000 +#define ICU_DECODE 0x10000000 +#define ICU_NO_META 0x08000000 +#define ICU_ENCODE_SPACES_ONLY 0x04000000 +#define ICU_BROWSER_MODE 0x02000000 +#define ICU_ENCODE_PERCENT 0x00001000 -#define ICU_ESCAPE 0x80000000 -#define ICU_ESCAPE_AUTHORITY 0x00002000 -#define ICU_REJECT_USERPWD 0x00004000 +#define ICU_ESCAPE 0x80000000 +#define ICU_ESCAPE_AUTHORITY 0x00002000 +#define ICU_REJECT_USERPWD 0x00004000 -#define WINHTTP_ACCESS_TYPE_DEFAULT_PROXY 0 -#define WINHTTP_ACCESS_TYPE_NO_PROXY 1 -#define WINHTTP_ACCESS_TYPE_NAMED_PROXY 3 +#define WINHTTP_ACCESS_TYPE_DEFAULT_PROXY 0 +#define WINHTTP_ACCESS_TYPE_NO_PROXY 1 +#define WINHTTP_ACCESS_TYPE_NAMED_PROXY 3 -#define WINHTTP_NO_PROXY_NAME NULL -#define WINHTTP_NO_PROXY_BYPASS NULL -#define WINHTTP_NO_CLIENT_CERT_CONTEXT NULL +#define WINHTTP_NO_PROXY_NAME NULL +#define WINHTTP_NO_PROXY_BYPASS NULL +#define WINHTTP_NO_CLIENT_CERT_CONTEXT NULL -#define WINHTTP_FIRST_OPTION WINHTTP_OPTION_CALLBACK +#define WINHTTP_FIRST_OPTION WINHTTP_OPTION_CALLBACK -#define WINHTTP_OPTION_CALLBACK 1 -#define WINHTTP_OPTION_RESOLVE_TIMEOUT 2 -#define WINHTTP_OPTION_CONNECT_TIMEOUT 3 -#define WINHTTP_OPTION_CONNECT_RETRIES 4 -#define WINHTTP_OPTION_SEND_TIMEOUT 5 -#define WINHTTP_OPTION_RECEIVE_TIMEOUT 6 -#define WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT 7 -#define WINHTTP_OPTION_HANDLE_TYPE 9 -#define WINHTTP_OPTION_READ_BUFFER_SIZE 12 -#define WINHTTP_OPTION_WRITE_BUFFER_SIZE 13 -#define WINHTTP_OPTION_PARENT_HANDLE 21 -#define WINHTTP_OPTION_EXTENDED_ERROR 24 -#define WINHTTP_OPTION_SECURITY_FLAGS 31 -#define WINHTTP_OPTION_SECURITY_CERTIFICATE_STRUCT 32 -#define WINHTTP_OPTION_URL 34 -#define WINHTTP_OPTION_SECURITY_KEY_BITNESS 36 -#define WINHTTP_OPTION_PROXY 38 -#define WINHTTP_OPTION_USER_AGENT 41 -#define WINHTTP_OPTION_CONTEXT_VALUE 45 -#define WINHTTP_OPTION_CLIENT_CERT_CONTEXT 47 -#define WINHTTP_OPTION_REQUEST_PRIORITY 58 -#define WINHTTP_OPTION_HTTP_VERSION 59 -#define WINHTTP_OPTION_DISABLE_FEATURE 63 -#define WINHTTP_OPTION_CODEPAGE 68 -#define WINHTTP_OPTION_MAX_CONNS_PER_SERVER 73 -#define WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER 74 -#define WINHTTP_OPTION_AUTOLOGON_POLICY 77 -#define WINHTTP_OPTION_SERVER_CERT_CONTEXT 78 -#define WINHTTP_OPTION_ENABLE_FEATURE 79 -#define WINHTTP_OPTION_WORKER_THREAD_COUNT 80 -#define WINHTTP_OPTION_PASSPORT_COBRANDING_TEXT 81 -#define WINHTTP_OPTION_PASSPORT_COBRANDING_URL 82 -#define WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH 83 -#define WINHTTP_OPTION_SECURE_PROTOCOLS 84 -#define WINHTTP_OPTION_ENABLETRACING 85 -#define WINHTTP_OPTION_PASSPORT_SIGN_OUT 86 -#define WINHTTP_OPTION_PASSPORT_RETURN_URL 87 -#define WINHTTP_OPTION_REDIRECT_POLICY 88 -#define WINHTTP_OPTION_MAX_HTTP_AUTOMATIC_REDIRECTS 89 -#define WINHTTP_OPTION_MAX_HTTP_STATUS_CONTINUE 90 -#define WINHTTP_OPTION_MAX_RESPONSE_HEADER_SIZE 91 -#define WINHTTP_OPTION_MAX_RESPONSE_DRAIN_SIZE 92 -#define WINHTTP_OPTION_CONNECTION_INFO 93 -#define WINHTTP_OPTION_CLIENT_CERT_ISSUER_LIST 94 -#define WINHTTP_OPTION_SPN 96 -#define WINHTTP_OPTION_GLOBAL_PROXY_CREDS 97 -#define WINHTTP_OPTION_GLOBAL_SERVER_CREDS 98 -#define WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT 99 -#define WINHTTP_OPTION_REJECT_USERPWD_IN_URL 100 -#define WINHTTP_OPTION_USE_GLOBAL_SERVER_CREDENTIALS 101 -#define WINHTTP_OPTION_RECEIVE_PROXY_CONNECT_RESPONSE 103 -#define WINHTTP_OPTION_IS_PROXY_CONNECT_RESPONSE 104 -#define WINHTTP_OPTION_SERVER_SPN_USED 106 -#define WINHTTP_OPTION_PROXY_SPN_USED 107 -#define WINHTTP_OPTION_SERVER_CBT 108 +#define WINHTTP_OPTION_CALLBACK 1 +#define WINHTTP_OPTION_RESOLVE_TIMEOUT 2 +#define WINHTTP_OPTION_CONNECT_TIMEOUT 3 +#define WINHTTP_OPTION_CONNECT_RETRIES 4 +#define WINHTTP_OPTION_SEND_TIMEOUT 5 +#define WINHTTP_OPTION_RECEIVE_TIMEOUT 6 +#define WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT 7 +#define WINHTTP_OPTION_HANDLE_TYPE 9 +#define WINHTTP_OPTION_READ_BUFFER_SIZE 12 +#define WINHTTP_OPTION_WRITE_BUFFER_SIZE 13 +#define WINHTTP_OPTION_PARENT_HANDLE 21 +#define WINHTTP_OPTION_EXTENDED_ERROR 24 +#define WINHTTP_OPTION_SECURITY_FLAGS 31 +#define WINHTTP_OPTION_SECURITY_CERTIFICATE_STRUCT 32 +#define WINHTTP_OPTION_URL 34 +#define WINHTTP_OPTION_SECURITY_KEY_BITNESS 36 +#define WINHTTP_OPTION_PROXY 38 +#define WINHTTP_OPTION_USER_AGENT 41 +#define WINHTTP_OPTION_CONTEXT_VALUE 45 +#define WINHTTP_OPTION_CLIENT_CERT_CONTEXT 47 +#define WINHTTP_OPTION_REQUEST_PRIORITY 58 +#define WINHTTP_OPTION_HTTP_VERSION 59 +#define WINHTTP_OPTION_DISABLE_FEATURE 63 +#define WINHTTP_OPTION_CODEPAGE 68 +#define WINHTTP_OPTION_MAX_CONNS_PER_SERVER 73 +#define WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER 74 +#define WINHTTP_OPTION_AUTOLOGON_POLICY 77 +#define WINHTTP_OPTION_SERVER_CERT_CONTEXT 78 +#define WINHTTP_OPTION_ENABLE_FEATURE 79 +#define WINHTTP_OPTION_WORKER_THREAD_COUNT 80 +#define WINHTTP_OPTION_PASSPORT_COBRANDING_TEXT 81 +#define WINHTTP_OPTION_PASSPORT_COBRANDING_URL 82 +#define WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH 83 +#define WINHTTP_OPTION_SECURE_PROTOCOLS 84 +#define WINHTTP_OPTION_ENABLETRACING 85 +#define WINHTTP_OPTION_PASSPORT_SIGN_OUT 86 +#define WINHTTP_OPTION_PASSPORT_RETURN_URL 87 +#define WINHTTP_OPTION_REDIRECT_POLICY 88 +#define WINHTTP_OPTION_MAX_HTTP_AUTOMATIC_REDIRECTS 89 +#define WINHTTP_OPTION_MAX_HTTP_STATUS_CONTINUE 90 +#define WINHTTP_OPTION_MAX_RESPONSE_HEADER_SIZE 91 +#define WINHTTP_OPTION_MAX_RESPONSE_DRAIN_SIZE 92 +#define WINHTTP_OPTION_CONNECTION_INFO 93 +#define WINHTTP_OPTION_CLIENT_CERT_ISSUER_LIST 94 +#define WINHTTP_OPTION_SPN 96 +#define WINHTTP_OPTION_GLOBAL_PROXY_CREDS 97 +#define WINHTTP_OPTION_GLOBAL_SERVER_CREDS 98 +#define WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT 99 +#define WINHTTP_OPTION_REJECT_USERPWD_IN_URL 100 +#define WINHTTP_OPTION_USE_GLOBAL_SERVER_CREDENTIALS 101 +#define WINHTTP_OPTION_RECEIVE_PROXY_CONNECT_RESPONSE 103 +#define WINHTTP_OPTION_IS_PROXY_CONNECT_RESPONSE 104 +#define WINHTTP_OPTION_SERVER_SPN_USED 106 +#define WINHTTP_OPTION_PROXY_SPN_USED 107 +#define WINHTTP_OPTION_SERVER_CBT 108 -#define WINHTTP_LAST_OPTION WINHTTP_OPTION_SERVER_CBT +#define WINHTTP_LAST_OPTION WINHTTP_OPTION_SERVER_CBT -#define WINHTTP_OPTION_USERNAME 0x1000 -#define WINHTTP_OPTION_PASSWORD 0x1001 -#define WINHTTP_OPTION_PROXY_USERNAME 0x1002 -#define WINHTTP_OPTION_PROXY_PASSWORD 0x1003 +#define WINHTTP_OPTION_USERNAME 0x1000 +#define WINHTTP_OPTION_PASSWORD 0x1001 +#define WINHTTP_OPTION_PROXY_USERNAME 0x1002 +#define WINHTTP_OPTION_PROXY_PASSWORD 0x1003 -#define WINHTTP_CONNS_PER_SERVER_UNLIMITED 0xFFFFFFFF +#define WINHTTP_CONNS_PER_SERVER_UNLIMITED 0xFFFFFFFF -#define WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM 0 -#define WINHTTP_AUTOLOGON_SECURITY_LEVEL_LOW 1 -#define WINHTTP_AUTOLOGON_SECURITY_LEVEL_HIGH 2 +#define WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM 0 +#define WINHTTP_AUTOLOGON_SECURITY_LEVEL_LOW 1 +#define WINHTTP_AUTOLOGON_SECURITY_LEVEL_HIGH 2 -#define WINHTTP_AUTOLOGON_SECURITY_LEVEL_DEFAULT WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM +#define WINHTTP_AUTOLOGON_SECURITY_LEVEL_DEFAULT WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM -#define WINHTTP_OPTION_REDIRECT_POLICY_NEVER 0 -#define WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP 1 -#define WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS 2 +#define WINHTTP_OPTION_REDIRECT_POLICY_NEVER 0 +#define WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP 1 +#define WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS 2 -#define WINHTTP_OPTION_REDIRECT_POLICY_LAST WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS -#define WINHTTP_OPTION_REDIRECT_POLICY_DEFAULT WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP +#define WINHTTP_OPTION_REDIRECT_POLICY_LAST WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS +#define WINHTTP_OPTION_REDIRECT_POLICY_DEFAULT WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP -#define WINHTTP_DISABLE_PASSPORT_AUTH 0x00000000 -#define WINHTTP_ENABLE_PASSPORT_AUTH 0x10000000 -#define WINHTTP_DISABLE_PASSPORT_KEYRING 0x20000000 -#define WINHTTP_ENABLE_PASSPORT_KEYRING 0x40000000 +#define WINHTTP_DISABLE_PASSPORT_AUTH 0x00000000 +#define WINHTTP_ENABLE_PASSPORT_AUTH 0x10000000 +#define WINHTTP_DISABLE_PASSPORT_KEYRING 0x20000000 +#define WINHTTP_ENABLE_PASSPORT_KEYRING 0x40000000 -#define WINHTTP_DISABLE_COOKIES 0x00000001 -#define WINHTTP_DISABLE_REDIRECTS 0x00000002 -#define WINHTTP_DISABLE_AUTHENTICATION 0x00000004 -#define WINHTTP_DISABLE_KEEP_ALIVE 0x00000008 +#define WINHTTP_DISABLE_COOKIES 0x00000001 +#define WINHTTP_DISABLE_REDIRECTS 0x00000002 +#define WINHTTP_DISABLE_AUTHENTICATION 0x00000004 +#define WINHTTP_DISABLE_KEEP_ALIVE 0x00000008 -#define WINHTTP_ENABLE_SSL_REVOCATION 0x00000001 -#define WINHTTP_ENABLE_SSL_REVERT_IMPERSONATION 0x00000002 +#define WINHTTP_ENABLE_SSL_REVOCATION 0x00000001 +#define WINHTTP_ENABLE_SSL_REVERT_IMPERSONATION 0x00000002 -#define WINHTTP_DISABLE_SPN_SERVER_PORT 0x00000000 -#define WINHTTP_ENABLE_SPN_SERVER_PORT 0x00000001 -#define WINHTTP_OPTION_SPN_MASK WINHTTP_ENABLE_SPN_SERVER_PORT +#define WINHTTP_DISABLE_SPN_SERVER_PORT 0x00000000 +#define WINHTTP_ENABLE_SPN_SERVER_PORT 0x00000001 +#define WINHTTP_OPTION_SPN_MASK WINHTTP_ENABLE_SPN_SERVER_PORT typedef struct tagWINHTTP_CREDS { @@ -286,252 +282,257 @@ typedef struct tagWINHTTP_CREDS_EX LPSTR lpszUrl; } WINHTTP_CREDS_EX, *PWINHTTP_CREDS_EX; -#define WINHTTP_HANDLE_TYPE_SESSION 1 -#define WINHTTP_HANDLE_TYPE_CONNECT 2 -#define WINHTTP_HANDLE_TYPE_REQUEST 3 +#define WINHTTP_HANDLE_TYPE_SESSION 1 +#define WINHTTP_HANDLE_TYPE_CONNECT 2 +#define WINHTTP_HANDLE_TYPE_REQUEST 3 -#define WINHTTP_AUTH_SCHEME_BASIC 0x00000001 -#define WINHTTP_AUTH_SCHEME_NTLM 0x00000002 -#define WINHTTP_AUTH_SCHEME_PASSPORT 0x00000004 -#define WINHTTP_AUTH_SCHEME_DIGEST 0x00000008 -#define WINHTTP_AUTH_SCHEME_NEGOTIATE 0x00000010 +#define WINHTTP_AUTH_SCHEME_BASIC 0x00000001 +#define WINHTTP_AUTH_SCHEME_NTLM 0x00000002 +#define WINHTTP_AUTH_SCHEME_PASSPORT 0x00000004 +#define WINHTTP_AUTH_SCHEME_DIGEST 0x00000008 +#define WINHTTP_AUTH_SCHEME_NEGOTIATE 0x00000010 #define WINHTTP_AUTH_TARGET_SERVER 0x00000000 -#define WINHTTP_AUTH_TARGET_PROXY 0x00000001 +#define WINHTTP_AUTH_TARGET_PROXY 0x00000001 -#define SECURITY_FLAG_SECURE 0x00000001 -#define SECURITY_FLAG_STRENGTH_WEAK 0x10000000 -#define SECURITY_FLAG_STRENGTH_MEDIUM 0x40000000 -#define SECURITY_FLAG_STRENGTH_STRONG 0x20000000 +#define SECURITY_FLAG_SECURE 0x00000001 +#define SECURITY_FLAG_STRENGTH_WEAK 0x10000000 +#define SECURITY_FLAG_STRENGTH_MEDIUM 0x40000000 +#define SECURITY_FLAG_STRENGTH_STRONG 0x20000000 -#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_REV_FAILED 0x00000001 -#define WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CERT 0x00000002 -#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_REVOKED 0x00000004 -#define WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CA 0x00000008 -#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_CN_INVALID 0x00000010 -#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_DATE_INVALID 0x00000020 -#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_WRONG_USAGE 0x00000040 -#define WINHTTP_CALLBACK_STATUS_FLAG_SECURITY_CHANNEL_ERROR 0x80000000 +#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_REV_FAILED 0x00000001 +#define WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CERT 0x00000002 +#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_REVOKED 0x00000004 +#define WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CA 0x00000008 +#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_CN_INVALID 0x00000010 +#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_DATE_INVALID 0x00000020 +#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_WRONG_USAGE 0x00000040 +#define WINHTTP_CALLBACK_STATUS_FLAG_SECURITY_CHANNEL_ERROR 0x80000000 -#define WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 0x00000008 -#define WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 0x00000020 -#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 0x00000080 -#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 0x00000200 -#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2 0x00000800 -#define WINHTTP_FLAG_SECURE_PROTOCOL_ALL (WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 | \ - WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 | \ - WINHTTP_FLAG_SECURE_PROTOCOL_TLS1) +#define WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 0x00000008 +#define WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 0x00000020 +#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 0x00000080 +#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 0x00000200 +#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2 0x00000800 +#define WINHTTP_FLAG_SECURE_PROTOCOL_ALL \ + (WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 | WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 | \ + WINHTTP_FLAG_SECURE_PROTOCOL_TLS1) -typedef VOID (CALLBACK * WINHTTP_STATUS_CALLBACK)(HINTERNET hInternet, DWORD_PTR dwContext, DWORD dwInternetStatus, - LPVOID lpvStatusInformation, DWORD dwStatusInformationLength); +typedef VOID(CALLBACK* WINHTTP_STATUS_CALLBACK)(HINTERNET hInternet, DWORD_PTR dwContext, + DWORD dwInternetStatus, LPVOID lpvStatusInformation, + DWORD dwStatusInformationLength); -typedef WINHTTP_STATUS_CALLBACK * LPWINHTTP_STATUS_CALLBACK; +typedef WINHTTP_STATUS_CALLBACK* LPWINHTTP_STATUS_CALLBACK; -#define WINHTTP_CALLBACK_STATUS_RESOLVING_NAME 0x00000001 -#define WINHTTP_CALLBACK_STATUS_NAME_RESOLVED 0x00000002 -#define WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER 0x00000004 -#define WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER 0x00000008 -#define WINHTTP_CALLBACK_STATUS_SENDING_REQUEST 0x00000010 -#define WINHTTP_CALLBACK_STATUS_REQUEST_SENT 0x00000020 -#define WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE 0x00000040 -#define WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED 0x00000080 -#define WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION 0x00000100 -#define WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED 0x00000200 -#define WINHTTP_CALLBACK_STATUS_HANDLE_CREATED 0x00000400 -#define WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING 0x00000800 -#define WINHTTP_CALLBACK_STATUS_DETECTING_PROXY 0x00001000 -#define WINHTTP_CALLBACK_STATUS_REDIRECT 0x00004000 -#define WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE 0x00008000 -#define WINHTTP_CALLBACK_STATUS_SECURE_FAILURE 0x00010000 -#define WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE 0x00020000 -#define WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE 0x00040000 -#define WINHTTP_CALLBACK_STATUS_READ_COMPLETE 0x00080000 -#define WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE 0x00100000 -#define WINHTTP_CALLBACK_STATUS_REQUEST_ERROR 0x00200000 -#define WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE 0x00400000 +#define WINHTTP_CALLBACK_STATUS_RESOLVING_NAME 0x00000001 +#define WINHTTP_CALLBACK_STATUS_NAME_RESOLVED 0x00000002 +#define WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER 0x00000004 +#define WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER 0x00000008 +#define WINHTTP_CALLBACK_STATUS_SENDING_REQUEST 0x00000010 +#define WINHTTP_CALLBACK_STATUS_REQUEST_SENT 0x00000020 +#define WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE 0x00000040 +#define WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED 0x00000080 +#define WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION 0x00000100 +#define WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED 0x00000200 +#define WINHTTP_CALLBACK_STATUS_HANDLE_CREATED 0x00000400 +#define WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING 0x00000800 +#define WINHTTP_CALLBACK_STATUS_DETECTING_PROXY 0x00001000 +#define WINHTTP_CALLBACK_STATUS_REDIRECT 0x00004000 +#define WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE 0x00008000 +#define WINHTTP_CALLBACK_STATUS_SECURE_FAILURE 0x00010000 +#define WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE 0x00020000 +#define WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE 0x00040000 +#define WINHTTP_CALLBACK_STATUS_READ_COMPLETE 0x00080000 +#define WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE 0x00100000 +#define WINHTTP_CALLBACK_STATUS_REQUEST_ERROR 0x00200000 +#define WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE 0x00400000 -#define API_RECEIVE_RESPONSE (1) -#define API_QUERY_DATA_AVAILABLE (2) -#define API_READ_DATA (3) -#define API_WRITE_DATA (4) -#define API_SEND_REQUEST (5) +#define API_RECEIVE_RESPONSE (1) +#define API_QUERY_DATA_AVAILABLE (2) +#define API_READ_DATA (3) +#define API_WRITE_DATA (4) +#define API_SEND_REQUEST (5) -#define WINHTTP_CALLBACK_FLAG_RESOLVE_NAME (WINHTTP_CALLBACK_STATUS_RESOLVING_NAME | WINHTTP_CALLBACK_STATUS_NAME_RESOLVED) -#define WINHTTP_CALLBACK_FLAG_CONNECT_TO_SERVER (WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER | WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER) -#define WINHTTP_CALLBACK_FLAG_SEND_REQUEST (WINHTTP_CALLBACK_STATUS_SENDING_REQUEST | WINHTTP_CALLBACK_STATUS_REQUEST_SENT) -#define WINHTTP_CALLBACK_FLAG_RECEIVE_RESPONSE (WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE | WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED) -#define WINHTTP_CALLBACK_FLAG_CLOSE_CONNECTION (WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION | WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED) -#define WINHTTP_CALLBACK_FLAG_HANDLES (WINHTTP_CALLBACK_STATUS_HANDLE_CREATED | WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING) -#define WINHTTP_CALLBACK_FLAG_DETECTING_PROXY WINHTTP_CALLBACK_STATUS_DETECTING_PROXY -#define WINHTTP_CALLBACK_FLAG_REDIRECT WINHTTP_CALLBACK_STATUS_REDIRECT -#define WINHTTP_CALLBACK_FLAG_INTERMEDIATE_RESPONSE WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE -#define WINHTTP_CALLBACK_FLAG_SECURE_FAILURE WINHTTP_CALLBACK_STATUS_SECURE_FAILURE -#define WINHTTP_CALLBACK_FLAG_SENDREQUEST_COMPLETE WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE -#define WINHTTP_CALLBACK_FLAG_HEADERS_AVAILABLE WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE -#define WINHTTP_CALLBACK_FLAG_DATA_AVAILABLE WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE -#define WINHTTP_CALLBACK_FLAG_READ_COMPLETE WINHTTP_CALLBACK_STATUS_READ_COMPLETE -#define WINHTTP_CALLBACK_FLAG_WRITE_COMPLETE WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE -#define WINHTTP_CALLBACK_FLAG_REQUEST_ERROR WINHTTP_CALLBACK_STATUS_REQUEST_ERROR +#define WINHTTP_CALLBACK_FLAG_RESOLVE_NAME \ + (WINHTTP_CALLBACK_STATUS_RESOLVING_NAME | WINHTTP_CALLBACK_STATUS_NAME_RESOLVED) +#define WINHTTP_CALLBACK_FLAG_CONNECT_TO_SERVER \ + (WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER | WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER) +#define WINHTTP_CALLBACK_FLAG_SEND_REQUEST \ + (WINHTTP_CALLBACK_STATUS_SENDING_REQUEST | WINHTTP_CALLBACK_STATUS_REQUEST_SENT) +#define WINHTTP_CALLBACK_FLAG_RECEIVE_RESPONSE \ + (WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE | WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED) +#define WINHTTP_CALLBACK_FLAG_CLOSE_CONNECTION \ + (WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION | WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED) +#define WINHTTP_CALLBACK_FLAG_HANDLES \ + (WINHTTP_CALLBACK_STATUS_HANDLE_CREATED | WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING) +#define WINHTTP_CALLBACK_FLAG_DETECTING_PROXY WINHTTP_CALLBACK_STATUS_DETECTING_PROXY +#define WINHTTP_CALLBACK_FLAG_REDIRECT WINHTTP_CALLBACK_STATUS_REDIRECT +#define WINHTTP_CALLBACK_FLAG_INTERMEDIATE_RESPONSE WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE +#define WINHTTP_CALLBACK_FLAG_SECURE_FAILURE WINHTTP_CALLBACK_STATUS_SECURE_FAILURE +#define WINHTTP_CALLBACK_FLAG_SENDREQUEST_COMPLETE WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE +#define WINHTTP_CALLBACK_FLAG_HEADERS_AVAILABLE WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE +#define WINHTTP_CALLBACK_FLAG_DATA_AVAILABLE WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE +#define WINHTTP_CALLBACK_FLAG_READ_COMPLETE WINHTTP_CALLBACK_STATUS_READ_COMPLETE +#define WINHTTP_CALLBACK_FLAG_WRITE_COMPLETE WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE +#define WINHTTP_CALLBACK_FLAG_REQUEST_ERROR WINHTTP_CALLBACK_STATUS_REQUEST_ERROR -#define WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS (WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE \ - | WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE \ - | WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE \ - | WINHTTP_CALLBACK_STATUS_READ_COMPLETE \ - | WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE \ - | WINHTTP_CALLBACK_STATUS_REQUEST_ERROR) +#define WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS \ + (WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE | WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE | \ + WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE | WINHTTP_CALLBACK_STATUS_READ_COMPLETE | \ + WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE | WINHTTP_CALLBACK_STATUS_REQUEST_ERROR) -#define WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS 0xFFFFFFFF +#define WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS 0xFFFFFFFF -#define WINHTTP_INVALID_STATUS_CALLBACK ((WINHTTP_STATUS_CALLBACK) (-1L)) +#define WINHTTP_INVALID_STATUS_CALLBACK ((WINHTTP_STATUS_CALLBACK)(-1L)) -#define WINHTTP_QUERY_MIME_VERSION 0 -#define WINHTTP_QUERY_CONTENT_TYPE 1 -#define WINHTTP_QUERY_CONTENT_TRANSFER_ENCODING 2 -#define WINHTTP_QUERY_CONTENT_ID 3 -#define WINHTTP_QUERY_CONTENT_DESCRIPTION 4 -#define WINHTTP_QUERY_CONTENT_LENGTH 5 -#define WINHTTP_QUERY_CONTENT_LANGUAGE 6 -#define WINHTTP_QUERY_ALLOW 7 -#define WINHTTP_QUERY_PUBLIC 8 -#define WINHTTP_QUERY_DATE 9 -#define WINHTTP_QUERY_EXPIRES 10 -#define WINHTTP_QUERY_LAST_MODIFIED 11 -#define WINHTTP_QUERY_MESSAGE_ID 12 -#define WINHTTP_QUERY_URI 13 -#define WINHTTP_QUERY_DERIVED_FROM 14 -#define WINHTTP_QUERY_COST 15 -#define WINHTTP_QUERY_LINK 16 -#define WINHTTP_QUERY_PRAGMA 17 -#define WINHTTP_QUERY_VERSION 18 -#define WINHTTP_QUERY_STATUS_CODE 19 -#define WINHTTP_QUERY_STATUS_TEXT 20 -#define WINHTTP_QUERY_RAW_HEADERS 21 -#define WINHTTP_QUERY_RAW_HEADERS_CRLF 22 -#define WINHTTP_QUERY_CONNECTION 23 -#define WINHTTP_QUERY_ACCEPT 24 -#define WINHTTP_QUERY_ACCEPT_CHARSET 25 -#define WINHTTP_QUERY_ACCEPT_ENCODING 26 -#define WINHTTP_QUERY_ACCEPT_LANGUAGE 27 -#define WINHTTP_QUERY_AUTHORIZATION 28 -#define WINHTTP_QUERY_CONTENT_ENCODING 29 -#define WINHTTP_QUERY_FORWARDED 30 -#define WINHTTP_QUERY_FROM 31 -#define WINHTTP_QUERY_IF_MODIFIED_SINCE 32 -#define WINHTTP_QUERY_LOCATION 33 -#define WINHTTP_QUERY_ORIG_URI 34 -#define WINHTTP_QUERY_REFERER 35 -#define WINHTTP_QUERY_RETRY_AFTER 36 -#define WINHTTP_QUERY_SERVER 37 -#define WINHTTP_QUERY_TITLE 38 -#define WINHTTP_QUERY_USER_AGENT 39 -#define WINHTTP_QUERY_WWW_AUTHENTICATE 40 -#define WINHTTP_QUERY_PROXY_AUTHENTICATE 41 -#define WINHTTP_QUERY_ACCEPT_RANGES 42 -#define WINHTTP_QUERY_SET_COOKIE 43 -#define WINHTTP_QUERY_COOKIE 44 -#define WINHTTP_QUERY_REQUEST_METHOD 45 -#define WINHTTP_QUERY_REFRESH 46 -#define WINHTTP_QUERY_CONTENT_DISPOSITION 47 -#define WINHTTP_QUERY_AGE 48 -#define WINHTTP_QUERY_CACHE_CONTROL 49 -#define WINHTTP_QUERY_CONTENT_BASE 50 -#define WINHTTP_QUERY_CONTENT_LOCATION 51 -#define WINHTTP_QUERY_CONTENT_MD5 52 -#define WINHTTP_QUERY_CONTENT_RANGE 53 -#define WINHTTP_QUERY_ETAG 54 -#define WINHTTP_QUERY_HOST 55 -#define WINHTTP_QUERY_IF_MATCH 56 -#define WINHTTP_QUERY_IF_NONE_MATCH 57 -#define WINHTTP_QUERY_IF_RANGE 58 -#define WINHTTP_QUERY_IF_UNMODIFIED_SINCE 59 -#define WINHTTP_QUERY_MAX_FORWARDS 60 -#define WINHTTP_QUERY_PROXY_AUTHORIZATION 61 -#define WINHTTP_QUERY_RANGE 62 -#define WINHTTP_QUERY_TRANSFER_ENCODING 63 -#define WINHTTP_QUERY_UPGRADE 64 -#define WINHTTP_QUERY_VARY 65 -#define WINHTTP_QUERY_VIA 66 -#define WINHTTP_QUERY_WARNING 67 -#define WINHTTP_QUERY_EXPECT 68 -#define WINHTTP_QUERY_PROXY_CONNECTION 69 -#define WINHTTP_QUERY_UNLESS_MODIFIED_SINCE 70 -#define WINHTTP_QUERY_PROXY_SUPPORT 75 -#define WINHTTP_QUERY_AUTHENTICATION_INFO 76 -#define WINHTTP_QUERY_PASSPORT_URLS 77 -#define WINHTTP_QUERY_PASSPORT_CONFIG 78 -#define WINHTTP_QUERY_MAX 78 -#define WINHTTP_QUERY_CUSTOM 65535 -#define WINHTTP_QUERY_FLAG_REQUEST_HEADERS 0x80000000 -#define WINHTTP_QUERY_FLAG_SYSTEMTIME 0x40000000 -#define WINHTTP_QUERY_FLAG_NUMBER 0x20000000 +#define WINHTTP_QUERY_MIME_VERSION 0 +#define WINHTTP_QUERY_CONTENT_TYPE 1 +#define WINHTTP_QUERY_CONTENT_TRANSFER_ENCODING 2 +#define WINHTTP_QUERY_CONTENT_ID 3 +#define WINHTTP_QUERY_CONTENT_DESCRIPTION 4 +#define WINHTTP_QUERY_CONTENT_LENGTH 5 +#define WINHTTP_QUERY_CONTENT_LANGUAGE 6 +#define WINHTTP_QUERY_ALLOW 7 +#define WINHTTP_QUERY_PUBLIC 8 +#define WINHTTP_QUERY_DATE 9 +#define WINHTTP_QUERY_EXPIRES 10 +#define WINHTTP_QUERY_LAST_MODIFIED 11 +#define WINHTTP_QUERY_MESSAGE_ID 12 +#define WINHTTP_QUERY_URI 13 +#define WINHTTP_QUERY_DERIVED_FROM 14 +#define WINHTTP_QUERY_COST 15 +#define WINHTTP_QUERY_LINK 16 +#define WINHTTP_QUERY_PRAGMA 17 +#define WINHTTP_QUERY_VERSION 18 +#define WINHTTP_QUERY_STATUS_CODE 19 +#define WINHTTP_QUERY_STATUS_TEXT 20 +#define WINHTTP_QUERY_RAW_HEADERS 21 +#define WINHTTP_QUERY_RAW_HEADERS_CRLF 22 +#define WINHTTP_QUERY_CONNECTION 23 +#define WINHTTP_QUERY_ACCEPT 24 +#define WINHTTP_QUERY_ACCEPT_CHARSET 25 +#define WINHTTP_QUERY_ACCEPT_ENCODING 26 +#define WINHTTP_QUERY_ACCEPT_LANGUAGE 27 +#define WINHTTP_QUERY_AUTHORIZATION 28 +#define WINHTTP_QUERY_CONTENT_ENCODING 29 +#define WINHTTP_QUERY_FORWARDED 30 +#define WINHTTP_QUERY_FROM 31 +#define WINHTTP_QUERY_IF_MODIFIED_SINCE 32 +#define WINHTTP_QUERY_LOCATION 33 +#define WINHTTP_QUERY_ORIG_URI 34 +#define WINHTTP_QUERY_REFERER 35 +#define WINHTTP_QUERY_RETRY_AFTER 36 +#define WINHTTP_QUERY_SERVER 37 +#define WINHTTP_QUERY_TITLE 38 +#define WINHTTP_QUERY_USER_AGENT 39 +#define WINHTTP_QUERY_WWW_AUTHENTICATE 40 +#define WINHTTP_QUERY_PROXY_AUTHENTICATE 41 +#define WINHTTP_QUERY_ACCEPT_RANGES 42 +#define WINHTTP_QUERY_SET_COOKIE 43 +#define WINHTTP_QUERY_COOKIE 44 +#define WINHTTP_QUERY_REQUEST_METHOD 45 +#define WINHTTP_QUERY_REFRESH 46 +#define WINHTTP_QUERY_CONTENT_DISPOSITION 47 +#define WINHTTP_QUERY_AGE 48 +#define WINHTTP_QUERY_CACHE_CONTROL 49 +#define WINHTTP_QUERY_CONTENT_BASE 50 +#define WINHTTP_QUERY_CONTENT_LOCATION 51 +#define WINHTTP_QUERY_CONTENT_MD5 52 +#define WINHTTP_QUERY_CONTENT_RANGE 53 +#define WINHTTP_QUERY_ETAG 54 +#define WINHTTP_QUERY_HOST 55 +#define WINHTTP_QUERY_IF_MATCH 56 +#define WINHTTP_QUERY_IF_NONE_MATCH 57 +#define WINHTTP_QUERY_IF_RANGE 58 +#define WINHTTP_QUERY_IF_UNMODIFIED_SINCE 59 +#define WINHTTP_QUERY_MAX_FORWARDS 60 +#define WINHTTP_QUERY_PROXY_AUTHORIZATION 61 +#define WINHTTP_QUERY_RANGE 62 +#define WINHTTP_QUERY_TRANSFER_ENCODING 63 +#define WINHTTP_QUERY_UPGRADE 64 +#define WINHTTP_QUERY_VARY 65 +#define WINHTTP_QUERY_VIA 66 +#define WINHTTP_QUERY_WARNING 67 +#define WINHTTP_QUERY_EXPECT 68 +#define WINHTTP_QUERY_PROXY_CONNECTION 69 +#define WINHTTP_QUERY_UNLESS_MODIFIED_SINCE 70 +#define WINHTTP_QUERY_PROXY_SUPPORT 75 +#define WINHTTP_QUERY_AUTHENTICATION_INFO 76 +#define WINHTTP_QUERY_PASSPORT_URLS 77 +#define WINHTTP_QUERY_PASSPORT_CONFIG 78 +#define WINHTTP_QUERY_MAX 78 +#define WINHTTP_QUERY_CUSTOM 65535 +#define WINHTTP_QUERY_FLAG_REQUEST_HEADERS 0x80000000 +#define WINHTTP_QUERY_FLAG_SYSTEMTIME 0x40000000 +#define WINHTTP_QUERY_FLAG_NUMBER 0x20000000 -#define HTTP_STATUS_CONTINUE 100 -#define HTTP_STATUS_SWITCH_PROTOCOLS 101 +#define HTTP_STATUS_CONTINUE 100 +#define HTTP_STATUS_SWITCH_PROTOCOLS 101 -#define HTTP_STATUS_OK 200 -#define HTTP_STATUS_CREATED 201 -#define HTTP_STATUS_ACCEPTED 202 -#define HTTP_STATUS_PARTIAL 203 -#define HTTP_STATUS_NO_CONTENT 204 -#define HTTP_STATUS_RESET_CONTENT 205 -#define HTTP_STATUS_PARTIAL_CONTENT 206 -#define HTTP_STATUS_WEBDAV_MULTI_STATUS 207 +#define HTTP_STATUS_OK 200 +#define HTTP_STATUS_CREATED 201 +#define HTTP_STATUS_ACCEPTED 202 +#define HTTP_STATUS_PARTIAL 203 +#define HTTP_STATUS_NO_CONTENT 204 +#define HTTP_STATUS_RESET_CONTENT 205 +#define HTTP_STATUS_PARTIAL_CONTENT 206 +#define HTTP_STATUS_WEBDAV_MULTI_STATUS 207 -#define HTTP_STATUS_AMBIGUOUS 300 -#define HTTP_STATUS_MOVED 301 -#define HTTP_STATUS_REDIRECT 302 -#define HTTP_STATUS_REDIRECT_METHOD 303 -#define HTTP_STATUS_NOT_MODIFIED 304 -#define HTTP_STATUS_USE_PROXY 305 -#define HTTP_STATUS_REDIRECT_KEEP_VERB 307 +#define HTTP_STATUS_AMBIGUOUS 300 +#define HTTP_STATUS_MOVED 301 +#define HTTP_STATUS_REDIRECT 302 +#define HTTP_STATUS_REDIRECT_METHOD 303 +#define HTTP_STATUS_NOT_MODIFIED 304 +#define HTTP_STATUS_USE_PROXY 305 +#define HTTP_STATUS_REDIRECT_KEEP_VERB 307 -#define HTTP_STATUS_BAD_REQUEST 400 -#define HTTP_STATUS_DENIED 401 -#define HTTP_STATUS_PAYMENT_REQ 402 -#define HTTP_STATUS_FORBIDDEN 403 -#define HTTP_STATUS_NOT_FOUND 404 -#define HTTP_STATUS_BAD_METHOD 405 -#define HTTP_STATUS_NONE_ACCEPTABLE 406 -#define HTTP_STATUS_PROXY_AUTH_REQ 407 -#define HTTP_STATUS_REQUEST_TIMEOUT 408 -#define HTTP_STATUS_CONFLICT 409 -#define HTTP_STATUS_GONE 410 -#define HTTP_STATUS_LENGTH_REQUIRED 411 -#define HTTP_STATUS_PRECOND_FAILED 412 -#define HTTP_STATUS_REQUEST_TOO_LARGE 413 -#define HTTP_STATUS_URI_TOO_LONG 414 -#define HTTP_STATUS_UNSUPPORTED_MEDIA 415 -#define HTTP_STATUS_RETRY_WITH 449 +#define HTTP_STATUS_BAD_REQUEST 400 +#define HTTP_STATUS_DENIED 401 +#define HTTP_STATUS_PAYMENT_REQ 402 +#define HTTP_STATUS_FORBIDDEN 403 +#define HTTP_STATUS_NOT_FOUND 404 +#define HTTP_STATUS_BAD_METHOD 405 +#define HTTP_STATUS_NONE_ACCEPTABLE 406 +#define HTTP_STATUS_PROXY_AUTH_REQ 407 +#define HTTP_STATUS_REQUEST_TIMEOUT 408 +#define HTTP_STATUS_CONFLICT 409 +#define HTTP_STATUS_GONE 410 +#define HTTP_STATUS_LENGTH_REQUIRED 411 +#define HTTP_STATUS_PRECOND_FAILED 412 +#define HTTP_STATUS_REQUEST_TOO_LARGE 413 +#define HTTP_STATUS_URI_TOO_LONG 414 +#define HTTP_STATUS_UNSUPPORTED_MEDIA 415 +#define HTTP_STATUS_RETRY_WITH 449 -#define HTTP_STATUS_SERVER_ERROR 500 -#define HTTP_STATUS_NOT_SUPPORTED 501 -#define HTTP_STATUS_BAD_GATEWAY 502 -#define HTTP_STATUS_SERVICE_UNAVAIL 503 -#define HTTP_STATUS_GATEWAY_TIMEOUT 504 -#define HTTP_STATUS_VERSION_NOT_SUP 505 +#define HTTP_STATUS_SERVER_ERROR 500 +#define HTTP_STATUS_NOT_SUPPORTED 501 +#define HTTP_STATUS_BAD_GATEWAY 502 +#define HTTP_STATUS_SERVICE_UNAVAIL 503 +#define HTTP_STATUS_GATEWAY_TIMEOUT 504 +#define HTTP_STATUS_VERSION_NOT_SUP 505 -#define HTTP_STATUS_FIRST HTTP_STATUS_CONTINUE -#define HTTP_STATUS_LAST HTTP_STATUS_VERSION_NOT_SUP +#define HTTP_STATUS_FIRST HTTP_STATUS_CONTINUE +#define HTTP_STATUS_LAST HTTP_STATUS_VERSION_NOT_SUP -#define WINHTTP_NO_REFERER NULL -#define WINHTTP_DEFAULT_ACCEPT_TYPES NULL +#define WINHTTP_NO_REFERER NULL +#define WINHTTP_DEFAULT_ACCEPT_TYPES NULL -#define WINHTTP_ADDREQ_INDEX_MASK 0x0000FFFF -#define WINHTTP_ADDREQ_FLAGS_MASK 0xFFFF0000 -#define WINHTTP_ADDREQ_FLAG_ADD_IF_NEW 0x10000000 -#define WINHTTP_ADDREQ_FLAG_ADD 0x20000000 -#define WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA 0x40000000 -#define WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON 0x01000000 -#define WINHTTP_ADDREQ_FLAG_COALESCE WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA -#define WINHTTP_ADDREQ_FLAG_REPLACE 0x80000000 -#define WINHTTP_IGNORE_REQUEST_TOTAL_LENGTH 0 +#define WINHTTP_ADDREQ_INDEX_MASK 0x0000FFFF +#define WINHTTP_ADDREQ_FLAGS_MASK 0xFFFF0000 +#define WINHTTP_ADDREQ_FLAG_ADD_IF_NEW 0x10000000 +#define WINHTTP_ADDREQ_FLAG_ADD 0x20000000 +#define WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA 0x40000000 +#define WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON 0x01000000 +#define WINHTTP_ADDREQ_FLAG_COALESCE WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA +#define WINHTTP_ADDREQ_FLAG_REPLACE 0x80000000 +#define WINHTTP_IGNORE_REQUEST_TOTAL_LENGTH 0 -#define WINHTTP_NO_ADDITIONAL_HEADERS NULL -#define WINHTTP_NO_REQUEST_DATA NULL +#define WINHTTP_NO_ADDITIONAL_HEADERS NULL +#define WINHTTP_NO_REQUEST_DATA NULL -#define WINHTTP_HEADER_NAME_BY_INDEX NULL -#define WINHTTP_NO_OUTPUT_BUFFER NULL -#define WINHTTP_NO_HEADER_INDEX NULL +#define WINHTTP_HEADER_NAME_BY_INDEX NULL +#define WINHTTP_NO_OUTPUT_BUFFER NULL +#define WINHTTP_NO_HEADER_INDEX NULL typedef struct { @@ -541,119 +542,144 @@ typedef struct LPWSTR lpszProxyBypass; } WINHTTP_CURRENT_USER_IE_PROXY_CONFIG; -#define WINHTTP_ERROR_BASE 12000 +#define WINHTTP_ERROR_BASE 12000 -#define ERROR_WINHTTP_OUT_OF_HANDLES (WINHTTP_ERROR_BASE + 1) -#define ERROR_WINHTTP_TIMEOUT (WINHTTP_ERROR_BASE + 2) -#define ERROR_WINHTTP_INTERNAL_ERROR (WINHTTP_ERROR_BASE + 4) -#define ERROR_WINHTTP_INVALID_URL (WINHTTP_ERROR_BASE + 5) -#define ERROR_WINHTTP_UNRECOGNIZED_SCHEME (WINHTTP_ERROR_BASE + 6) -#define ERROR_WINHTTP_NAME_NOT_RESOLVED (WINHTTP_ERROR_BASE + 7) -#define ERROR_WINHTTP_INVALID_OPTION (WINHTTP_ERROR_BASE + 9) -#define ERROR_WINHTTP_OPTION_NOT_SETTABLE (WINHTTP_ERROR_BASE + 11) -#define ERROR_WINHTTP_SHUTDOWN (WINHTTP_ERROR_BASE + 12) -#define ERROR_WINHTTP_LOGIN_FAILURE (WINHTTP_ERROR_BASE + 15) -#define ERROR_WINHTTP_OPERATION_CANCELLED (WINHTTP_ERROR_BASE + 17) -#define ERROR_WINHTTP_INCORRECT_HANDLE_TYPE (WINHTTP_ERROR_BASE + 18) -#define ERROR_WINHTTP_INCORRECT_HANDLE_STATE (WINHTTP_ERROR_BASE + 19) -#define ERROR_WINHTTP_CANNOT_CONNECT (WINHTTP_ERROR_BASE + 29) -#define ERROR_WINHTTP_CONNECTION_ERROR (WINHTTP_ERROR_BASE + 30) -#define ERROR_WINHTTP_RESEND_REQUEST (WINHTTP_ERROR_BASE + 32) -#define ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED (WINHTTP_ERROR_BASE + 44) -#define ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN (WINHTTP_ERROR_BASE + 100) -#define ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND (WINHTTP_ERROR_BASE + 101) -#define ERROR_WINHTTP_CANNOT_CALL_AFTER_SEND (WINHTTP_ERROR_BASE + 102) -#define ERROR_WINHTTP_CANNOT_CALL_AFTER_OPEN (WINHTTP_ERROR_BASE + 103) -#define ERROR_WINHTTP_HEADER_NOT_FOUND (WINHTTP_ERROR_BASE + 150) -#define ERROR_WINHTTP_INVALID_SERVER_RESPONSE (WINHTTP_ERROR_BASE + 152) -#define ERROR_WINHTTP_INVALID_HEADER (WINHTTP_ERROR_BASE + 153) -#define ERROR_WINHTTP_INVALID_QUERY_REQUEST (WINHTTP_ERROR_BASE + 154) -#define ERROR_WINHTTP_HEADER_ALREADY_EXISTS (WINHTTP_ERROR_BASE + 155) -#define ERROR_WINHTTP_REDIRECT_FAILED (WINHTTP_ERROR_BASE + 156) -#define ERROR_WINHTTP_AUTO_PROXY_SERVICE_ERROR (WINHTTP_ERROR_BASE + 178) -#define ERROR_WINHTTP_BAD_AUTO_PROXY_SCRIPT (WINHTTP_ERROR_BASE + 166) -#define ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT (WINHTTP_ERROR_BASE + 167) -#define ERROR_WINHTTP_NOT_INITIALIZED (WINHTTP_ERROR_BASE + 172) -#define ERROR_WINHTTP_SECURE_FAILURE (WINHTTP_ERROR_BASE + 175) -#define ERROR_WINHTTP_SECURE_CERT_DATE_INVALID (WINHTTP_ERROR_BASE + 37) -#define ERROR_WINHTTP_SECURE_CERT_CN_INVALID (WINHTTP_ERROR_BASE + 38) -#define ERROR_WINHTTP_SECURE_INVALID_CA (WINHTTP_ERROR_BASE + 45) -#define ERROR_WINHTTP_SECURE_CERT_REV_FAILED (WINHTTP_ERROR_BASE + 57) -#define ERROR_WINHTTP_SECURE_CHANNEL_ERROR (WINHTTP_ERROR_BASE + 157) -#define ERROR_WINHTTP_SECURE_INVALID_CERT (WINHTTP_ERROR_BASE + 169) -#define ERROR_WINHTTP_SECURE_CERT_REVOKED (WINHTTP_ERROR_BASE + 170) -#define ERROR_WINHTTP_SECURE_CERT_WRONG_USAGE (WINHTTP_ERROR_BASE + 179) -#define ERROR_WINHTTP_AUTODETECTION_FAILED (WINHTTP_ERROR_BASE + 180) -#define ERROR_WINHTTP_HEADER_COUNT_EXCEEDED (WINHTTP_ERROR_BASE + 181) -#define ERROR_WINHTTP_HEADER_SIZE_OVERFLOW (WINHTTP_ERROR_BASE + 182) -#define ERROR_WINHTTP_CHUNKED_ENCODING_HEADER_SIZE_OVERFLOW (WINHTTP_ERROR_BASE + 183) -#define ERROR_WINHTTP_RESPONSE_DRAIN_OVERFLOW (WINHTTP_ERROR_BASE + 184) -#define ERROR_WINHTTP_CLIENT_CERT_NO_PRIVATE_KEY (WINHTTP_ERROR_BASE + 185) -#define ERROR_WINHTTP_CLIENT_CERT_NO_ACCESS_PRIVATE_KEY (WINHTTP_ERROR_BASE + 186) +#define ERROR_WINHTTP_OUT_OF_HANDLES (WINHTTP_ERROR_BASE + 1) +#define ERROR_WINHTTP_TIMEOUT (WINHTTP_ERROR_BASE + 2) +#define ERROR_WINHTTP_INTERNAL_ERROR (WINHTTP_ERROR_BASE + 4) +#define ERROR_WINHTTP_INVALID_URL (WINHTTP_ERROR_BASE + 5) +#define ERROR_WINHTTP_UNRECOGNIZED_SCHEME (WINHTTP_ERROR_BASE + 6) +#define ERROR_WINHTTP_NAME_NOT_RESOLVED (WINHTTP_ERROR_BASE + 7) +#define ERROR_WINHTTP_INVALID_OPTION (WINHTTP_ERROR_BASE + 9) +#define ERROR_WINHTTP_OPTION_NOT_SETTABLE (WINHTTP_ERROR_BASE + 11) +#define ERROR_WINHTTP_SHUTDOWN (WINHTTP_ERROR_BASE + 12) +#define ERROR_WINHTTP_LOGIN_FAILURE (WINHTTP_ERROR_BASE + 15) +#define ERROR_WINHTTP_OPERATION_CANCELLED (WINHTTP_ERROR_BASE + 17) +#define ERROR_WINHTTP_INCORRECT_HANDLE_TYPE (WINHTTP_ERROR_BASE + 18) +#define ERROR_WINHTTP_INCORRECT_HANDLE_STATE (WINHTTP_ERROR_BASE + 19) +#define ERROR_WINHTTP_CANNOT_CONNECT (WINHTTP_ERROR_BASE + 29) +#define ERROR_WINHTTP_CONNECTION_ERROR (WINHTTP_ERROR_BASE + 30) +#define ERROR_WINHTTP_RESEND_REQUEST (WINHTTP_ERROR_BASE + 32) +#define ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED (WINHTTP_ERROR_BASE + 44) +#define ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN (WINHTTP_ERROR_BASE + 100) +#define ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND (WINHTTP_ERROR_BASE + 101) +#define ERROR_WINHTTP_CANNOT_CALL_AFTER_SEND (WINHTTP_ERROR_BASE + 102) +#define ERROR_WINHTTP_CANNOT_CALL_AFTER_OPEN (WINHTTP_ERROR_BASE + 103) +#define ERROR_WINHTTP_HEADER_NOT_FOUND (WINHTTP_ERROR_BASE + 150) +#define ERROR_WINHTTP_INVALID_SERVER_RESPONSE (WINHTTP_ERROR_BASE + 152) +#define ERROR_WINHTTP_INVALID_HEADER (WINHTTP_ERROR_BASE + 153) +#define ERROR_WINHTTP_INVALID_QUERY_REQUEST (WINHTTP_ERROR_BASE + 154) +#define ERROR_WINHTTP_HEADER_ALREADY_EXISTS (WINHTTP_ERROR_BASE + 155) +#define ERROR_WINHTTP_REDIRECT_FAILED (WINHTTP_ERROR_BASE + 156) +#define ERROR_WINHTTP_AUTO_PROXY_SERVICE_ERROR (WINHTTP_ERROR_BASE + 178) +#define ERROR_WINHTTP_BAD_AUTO_PROXY_SCRIPT (WINHTTP_ERROR_BASE + 166) +#define ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT (WINHTTP_ERROR_BASE + 167) +#define ERROR_WINHTTP_NOT_INITIALIZED (WINHTTP_ERROR_BASE + 172) +#define ERROR_WINHTTP_SECURE_FAILURE (WINHTTP_ERROR_BASE + 175) +#define ERROR_WINHTTP_SECURE_CERT_DATE_INVALID (WINHTTP_ERROR_BASE + 37) +#define ERROR_WINHTTP_SECURE_CERT_CN_INVALID (WINHTTP_ERROR_BASE + 38) +#define ERROR_WINHTTP_SECURE_INVALID_CA (WINHTTP_ERROR_BASE + 45) +#define ERROR_WINHTTP_SECURE_CERT_REV_FAILED (WINHTTP_ERROR_BASE + 57) +#define ERROR_WINHTTP_SECURE_CHANNEL_ERROR (WINHTTP_ERROR_BASE + 157) +#define ERROR_WINHTTP_SECURE_INVALID_CERT (WINHTTP_ERROR_BASE + 169) +#define ERROR_WINHTTP_SECURE_CERT_REVOKED (WINHTTP_ERROR_BASE + 170) +#define ERROR_WINHTTP_SECURE_CERT_WRONG_USAGE (WINHTTP_ERROR_BASE + 179) +#define ERROR_WINHTTP_AUTODETECTION_FAILED (WINHTTP_ERROR_BASE + 180) +#define ERROR_WINHTTP_HEADER_COUNT_EXCEEDED (WINHTTP_ERROR_BASE + 181) +#define ERROR_WINHTTP_HEADER_SIZE_OVERFLOW (WINHTTP_ERROR_BASE + 182) +#define ERROR_WINHTTP_CHUNKED_ENCODING_HEADER_SIZE_OVERFLOW (WINHTTP_ERROR_BASE + 183) +#define ERROR_WINHTTP_RESPONSE_DRAIN_OVERFLOW (WINHTTP_ERROR_BASE + 184) +#define ERROR_WINHTTP_CLIENT_CERT_NO_PRIVATE_KEY (WINHTTP_ERROR_BASE + 185) +#define ERROR_WINHTTP_CLIENT_CERT_NO_ACCESS_PRIVATE_KEY (WINHTTP_ERROR_BASE + 186) -#define WINHTTP_ERROR_LAST (WINHTTP_ERROR_BASE + 186) +#define WINHTTP_ERROR_LAST (WINHTTP_ERROR_BASE + 186) #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API BOOL WinHttpTimeFromSystemTime(const SYSTEMTIME* pst, LPWSTR pwszTime); -WINPR_API BOOL WinHttpTimeToSystemTime(LPCWSTR pwszTime, SYSTEMTIME* pst); + WINPR_API BOOL WinHttpTimeFromSystemTime(const SYSTEMTIME* pst, LPWSTR pwszTime); + WINPR_API BOOL WinHttpTimeToSystemTime(LPCWSTR pwszTime, SYSTEMTIME* pst); -WINPR_API BOOL WinHttpCrackUrl(LPCWSTR pwszUrl, DWORD dwUrlLength, DWORD dwFlags, LPURL_COMPONENTS lpUrlComponents); -WINPR_API BOOL WinHttpCreateUrl(LPURL_COMPONENTS lpUrlComponents, DWORD dwFlags, LPWSTR pwszUrl, LPDWORD pdwUrlLength); + WINPR_API BOOL WinHttpCrackUrl(LPCWSTR pwszUrl, DWORD dwUrlLength, DWORD dwFlags, + LPURL_COMPONENTS lpUrlComponents); + WINPR_API BOOL WinHttpCreateUrl(LPURL_COMPONENTS lpUrlComponents, DWORD dwFlags, LPWSTR pwszUrl, + LPDWORD pdwUrlLength); -WINPR_API BOOL WinHttpCheckPlatform(void); + WINPR_API BOOL WinHttpCheckPlatform(void); -WINPR_API BOOL WinHttpGetDefaultProxyConfiguration(WINHTTP_PROXY_INFO* pProxyInfo); -WINPR_API BOOL WinHttpSetDefaultProxyConfiguration(WINHTTP_PROXY_INFO* pProxyInfo); + WINPR_API BOOL WinHttpGetDefaultProxyConfiguration(WINHTTP_PROXY_INFO* pProxyInfo); + WINPR_API BOOL WinHttpSetDefaultProxyConfiguration(WINHTTP_PROXY_INFO* pProxyInfo); -WINPR_API HINTERNET WinHttpOpen(LPCWSTR pszAgentW, DWORD dwAccessType, LPCWSTR pszProxyW, LPCWSTR pszProxyBypassW, DWORD dwFlags); + WINPR_API HINTERNET WinHttpOpen(LPCWSTR pszAgentW, DWORD dwAccessType, LPCWSTR pszProxyW, + LPCWSTR pszProxyBypassW, DWORD dwFlags); -WINPR_API BOOL WinHttpCloseHandle(HINTERNET hInternet); + WINPR_API BOOL WinHttpCloseHandle(HINTERNET hInternet); -WINPR_API HINTERNET WinHttpConnect(HINTERNET hSession, LPCWSTR pswzServerName, INTERNET_PORT nServerPort, DWORD dwReserved); + WINPR_API HINTERNET WinHttpConnect(HINTERNET hSession, LPCWSTR pswzServerName, + INTERNET_PORT nServerPort, DWORD dwReserved); -WINPR_API BOOL WinHttpReadData(HINTERNET hRequest, LPVOID lpBuffer, DWORD dwNumberOfBytesToRead, LPDWORD lpdwNumberOfBytesRead); -WINPR_API BOOL WinHttpWriteData(HINTERNET hRequest, LPCVOID lpBuffer, DWORD dwNumberOfBytesToWrite, LPDWORD lpdwNumberOfBytesWritten); + WINPR_API BOOL WinHttpReadData(HINTERNET hRequest, LPVOID lpBuffer, DWORD dwNumberOfBytesToRead, + LPDWORD lpdwNumberOfBytesRead); + WINPR_API BOOL WinHttpWriteData(HINTERNET hRequest, LPCVOID lpBuffer, + DWORD dwNumberOfBytesToWrite, LPDWORD lpdwNumberOfBytesWritten); -WINPR_API BOOL WinHttpQueryDataAvailable(HINTERNET hRequest, LPDWORD lpdwNumberOfBytesAvailable); -WINPR_API BOOL WinHttpQueryOption(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength); + WINPR_API BOOL WinHttpQueryDataAvailable(HINTERNET hRequest, + LPDWORD lpdwNumberOfBytesAvailable); + WINPR_API BOOL WinHttpQueryOption(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, + LPDWORD lpdwBufferLength); -WINPR_API BOOL WinHttpSetOption(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength); -WINPR_API BOOL WinHttpSetTimeouts(HINTERNET hInternet, int nResolveTimeout, int nConnectTimeout, int nSendTimeout, int nReceiveTimeout); + WINPR_API BOOL WinHttpSetOption(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, + DWORD dwBufferLength); + WINPR_API BOOL WinHttpSetTimeouts(HINTERNET hInternet, int nResolveTimeout, int nConnectTimeout, + int nSendTimeout, int nReceiveTimeout); -WINPR_API DWORD WinHttpIsHostInProxyBypassList(const WINHTTP_PROXY_INFO* pProxyInfo, PCWSTR pwszHost, - INTERNET_SCHEME tScheme, INTERNET_PORT nPort, BOOL* pfIsInBypassList); + WINPR_API DWORD WinHttpIsHostInProxyBypassList(const WINHTTP_PROXY_INFO* pProxyInfo, + PCWSTR pwszHost, INTERNET_SCHEME tScheme, + INTERNET_PORT nPort, BOOL* pfIsInBypassList); -WINPR_API WINHTTP_STATUS_CALLBACK WinHttpSetStatusCallback(HINTERNET hInternet, - WINHTTP_STATUS_CALLBACK lpfnInternetCallback, DWORD dwNotificationFlags, DWORD_PTR dwReserved); + WINPR_API WINHTTP_STATUS_CALLBACK + WinHttpSetStatusCallback(HINTERNET hInternet, WINHTTP_STATUS_CALLBACK lpfnInternetCallback, + DWORD dwNotificationFlags, DWORD_PTR dwReserved); -WINPR_API HINTERNET WinHttpOpenRequest(HINTERNET hConnect, LPCWSTR pwszVerb, LPCWSTR pwszObjectName, - LPCWSTR pwszVersion, LPCWSTR pwszReferrer, LPCWSTR* ppwszAcceptTypes, DWORD dwFlags); + WINPR_API HINTERNET WinHttpOpenRequest(HINTERNET hConnect, LPCWSTR pwszVerb, + LPCWSTR pwszObjectName, LPCWSTR pwszVersion, + LPCWSTR pwszReferrer, LPCWSTR* ppwszAcceptTypes, + DWORD dwFlags); -WINPR_API BOOL WinHttpAddRequestHeaders(HINTERNET hRequest, LPCWSTR pwszHeaders, DWORD dwHeadersLength, DWORD dwModifiers); + WINPR_API BOOL WinHttpAddRequestHeaders(HINTERNET hRequest, LPCWSTR pwszHeaders, + DWORD dwHeadersLength, DWORD dwModifiers); -WINPR_API BOOL WinHttpSendRequest(HINTERNET hRequest, LPCWSTR lpszHeaders, DWORD dwHeadersLength, - LPVOID lpOptional, DWORD dwOptionalLength, DWORD dwTotalLength, DWORD_PTR dwContext); + WINPR_API BOOL WinHttpSendRequest(HINTERNET hRequest, LPCWSTR lpszHeaders, + DWORD dwHeadersLength, LPVOID lpOptional, + DWORD dwOptionalLength, DWORD dwTotalLength, + DWORD_PTR dwContext); -WINPR_API BOOL WinHttpSetCredentials(HINTERNET hRequest, DWORD AuthTargets, DWORD AuthScheme, - LPCWSTR pwszUserName, LPCWSTR pwszPassword, LPVOID pAuthParams); + WINPR_API BOOL WinHttpSetCredentials(HINTERNET hRequest, DWORD AuthTargets, DWORD AuthScheme, + LPCWSTR pwszUserName, LPCWSTR pwszPassword, + LPVOID pAuthParams); -WINPR_API BOOL WinHttpQueryAuthSchemes(HINTERNET hRequest, LPDWORD lpdwSupportedSchemes, LPDWORD lpdwFirstScheme, LPDWORD pdwAuthTarget); -WINPR_API BOOL WinHttpQueryAuthParams(HINTERNET hRequest, DWORD AuthScheme, LPVOID* pAuthParams); + WINPR_API BOOL WinHttpQueryAuthSchemes(HINTERNET hRequest, LPDWORD lpdwSupportedSchemes, + LPDWORD lpdwFirstScheme, LPDWORD pdwAuthTarget); + WINPR_API BOOL WinHttpQueryAuthParams(HINTERNET hRequest, DWORD AuthScheme, + LPVOID* pAuthParams); -WINPR_API BOOL WinHttpReceiveResponse(HINTERNET hRequest, LPVOID lpReserved); + WINPR_API BOOL WinHttpReceiveResponse(HINTERNET hRequest, LPVOID lpReserved); -WINPR_API BOOL WinHttpQueryHeaders(HINTERNET hRequest, DWORD dwInfoLevel, LPCWSTR pwszName, - LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex); + WINPR_API BOOL WinHttpQueryHeaders(HINTERNET hRequest, DWORD dwInfoLevel, LPCWSTR pwszName, + LPVOID lpBuffer, LPDWORD lpdwBufferLength, + LPDWORD lpdwIndex); -WINPR_API BOOL WinHttpDetectAutoProxyConfigUrl(DWORD dwAutoDetectFlags, LPWSTR* ppwstrAutoConfigUrl); + WINPR_API BOOL WinHttpDetectAutoProxyConfigUrl(DWORD dwAutoDetectFlags, + LPWSTR* ppwstrAutoConfigUrl); -WINPR_API BOOL WinHttpGetProxyForUrl(HINTERNET hSession, LPCWSTR lpcwszUrl, - WINHTTP_AUTOPROXY_OPTIONS* pAutoProxyOptions, WINHTTP_PROXY_INFO* pProxyInfo); + WINPR_API BOOL WinHttpGetProxyForUrl(HINTERNET hSession, LPCWSTR lpcwszUrl, + WINHTTP_AUTOPROXY_OPTIONS* pAutoProxyOptions, + WINHTTP_PROXY_INFO* pProxyInfo); -WINPR_API BOOL WinHttpGetIEProxyConfigForCurrentUser(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG* pProxyConfig); + WINPR_API BOOL + WinHttpGetIEProxyConfigForCurrentUser(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG* pProxyConfig); #ifdef __cplusplus } @@ -662,4 +688,3 @@ WINPR_API BOOL WinHttpGetIEProxyConfigForCurrentUser(WINHTTP_CURRENT_USER_IE_PRO #endif #endif /* WINPR_WINHTTP_H */ - diff --git a/winpr/include/winpr/winpr.h b/winpr/include/winpr/winpr.h index c98214770..5983d3e5a 100644 --- a/winpr/include/winpr/winpr.h +++ b/winpr/include/winpr/winpr.h @@ -38,19 +38,19 @@ #endif #else #if __GNUC__ >= 4 -#define WINPR_API __attribute__ ((visibility("default"))) +#define WINPR_API __attribute__((visibility("default"))) #else #define WINPR_API #endif #endif #else /* WINPR_DLL */ -#define WINPR_API +#define WINPR_API #endif #if defined(WIN32) && !defined(__CYGWIN__) #define WINPR_DEPRECATED(obj) __declspec(deprecated) obj #elif defined(__GNUC__) -#define WINPR_DEPRECATED(obj) obj __attribute__ ((deprecated)) +#define WINPR_DEPRECATED(obj) obj __attribute__((deprecated)) #else #define WINPR_DEPRECATED(obj) obj #endif @@ -70,11 +70,10 @@ #define WINPR_TLS #endif - #ifdef _WIN32 -#define INLINE __inline +#define INLINE __inline #else -#define INLINE inline +#define INLINE inline #endif WINPR_API void winpr_get_version(int* major, int* minor, int* revision); diff --git a/winpr/include/winpr/winsock.h b/winpr/include/winpr/winsock.h index 5e04418a9..167760920 100644 --- a/winpr/include/winpr/winsock.h +++ b/winpr/include/winpr/winsock.h @@ -26,41 +26,41 @@ #ifdef _WIN32 -#define _accept accept -#define _bind bind -#define _connect connect -#define _ioctlsocket ioctlsocket -#define _getpeername getpeername -#define _getsockname getsockname -#define _getsockopt getsockopt -#define _htonl htonl -#define _htons htons -#define _inet_addr inet_addr -#define _inet_ntoa inet_ntoa -#define _listen listen -#define _ntohl ntohl -#define _ntohs ntohs -#define _recv recv -#define _recvfrom recvfrom -#define _select select -#define _send send -#define _sendto sendto -#define _setsockopt setsockopt -#define _shutdown shutdown -#define _socket socket -#define _gethostbyaddr gethostbyaddr -#define _gethostbyname gethostbyname -#define _gethostname gethostname -#define _getservbyport getservbyport -#define _getservbyname getservbyname -#define _getprotobynumber getprotobynumber -#define _getprotobyname getprotobyname +#define _accept accept +#define _bind bind +#define _connect connect +#define _ioctlsocket ioctlsocket +#define _getpeername getpeername +#define _getsockname getsockname +#define _getsockopt getsockopt +#define _htonl htonl +#define _htons htons +#define _inet_addr inet_addr +#define _inet_ntoa inet_ntoa +#define _listen listen +#define _ntohl ntohl +#define _ntohs ntohs +#define _recv recv +#define _recvfrom recvfrom +#define _select select +#define _send send +#define _sendto sendto +#define _setsockopt setsockopt +#define _shutdown shutdown +#define _socket socket +#define _gethostbyaddr gethostbyaddr +#define _gethostbyname gethostbyname +#define _gethostname gethostname +#define _getservbyport getservbyport +#define _getservbyname getservbyname +#define _getprotobynumber getprotobynumber +#define _getprotobyname getprotobyname -#define _IFF_UP IFF_UP -#define _IFF_BROADCAST IFF_BROADCAST -#define _IFF_LOOPBACK IFF_LOOPBACK -#define _IFF_POINTTOPOINT IFF_POINTTOPOINT -#define _IFF_MULTICAST IFF_MULTICAST +#define _IFF_UP IFF_UP +#define _IFF_BROADCAST IFF_BROADCAST +#define _IFF_LOOPBACK IFF_LOOPBACK +#define _IFF_POINTTOPOINT IFF_POINTTOPOINT +#define _IFF_MULTICAST IFF_MULTICAST #if (_WIN32_WINNT < 0x0600) @@ -70,7 +70,6 @@ WINPR_API INT winpr_inet_pton(INT Family, PCSTR pszAddrString, PVOID pAddrBuf); #define inet_ntop winpr_inet_ntop #define inet_pton winpr_inet_pton - #endif /* (_WIN32_WINNT < 0x0600) */ #else /* _WIN32 */ @@ -89,10 +88,10 @@ WINPR_API INT winpr_inet_pton(INT Family, PCSTR pszAddrString, PVOID pAddrBuf); #include #include -#define WSAEVENT HANDLE -#define LPWSAEVENT LPHANDLE -#define WSAOVERLAPPED OVERLAPPED -typedef OVERLAPPED* LPWSAOVERLAPPED; +#define WSAEVENT HANDLE +#define LPWSAEVENT LPHANDLE +#define WSAOVERLAPPED OVERLAPPED +typedef OVERLAPPED* LPWSAOVERLAPPED; typedef UINT_PTR SOCKET; typedef struct sockaddr_storage SOCKADDR_STORAGE; @@ -101,47 +100,47 @@ typedef struct sockaddr_storage SOCKADDR_STORAGE; #define INVALID_SOCKET (SOCKET)(~0) #endif -#define WSADESCRIPTION_LEN 256 -#define WSASYS_STATUS_LEN 128 +#define WSADESCRIPTION_LEN 256 +#define WSASYS_STATUS_LEN 128 -#define FD_READ_BIT 0 -#define FD_READ (1 << FD_READ_BIT) +#define FD_READ_BIT 0 +#define FD_READ (1 << FD_READ_BIT) -#define FD_WRITE_BIT 1 -#define FD_WRITE (1 << FD_WRITE_BIT) +#define FD_WRITE_BIT 1 +#define FD_WRITE (1 << FD_WRITE_BIT) -#define FD_OOB_BIT 2 -#define FD_OOB (1 << FD_OOB_BIT) +#define FD_OOB_BIT 2 +#define FD_OOB (1 << FD_OOB_BIT) -#define FD_ACCEPT_BIT 3 -#define FD_ACCEPT (1 << FD_ACCEPT_BIT) +#define FD_ACCEPT_BIT 3 +#define FD_ACCEPT (1 << FD_ACCEPT_BIT) -#define FD_CONNECT_BIT 4 -#define FD_CONNECT (1 << FD_CONNECT_BIT) +#define FD_CONNECT_BIT 4 +#define FD_CONNECT (1 << FD_CONNECT_BIT) -#define FD_CLOSE_BIT 5 -#define FD_CLOSE (1 << FD_CLOSE_BIT) +#define FD_CLOSE_BIT 5 +#define FD_CLOSE (1 << FD_CLOSE_BIT) -#define FD_QOS_BIT 6 -#define FD_QOS (1 << FD_QOS_BIT) +#define FD_QOS_BIT 6 +#define FD_QOS (1 << FD_QOS_BIT) -#define FD_GROUP_QOS_BIT 7 -#define FD_GROUP_QOS (1 << FD_GROUP_QOS_BIT) +#define FD_GROUP_QOS_BIT 7 +#define FD_GROUP_QOS (1 << FD_GROUP_QOS_BIT) -#define FD_ROUTING_INTERFACE_CHANGE_BIT 8 -#define FD_ROUTING_INTERFACE_CHANGE (1 << FD_ROUTING_INTERFACE_CHANGE_BIT) +#define FD_ROUTING_INTERFACE_CHANGE_BIT 8 +#define FD_ROUTING_INTERFACE_CHANGE (1 << FD_ROUTING_INTERFACE_CHANGE_BIT) -#define FD_ADDRESS_LIST_CHANGE_BIT 9 -#define FD_ADDRESS_LIST_CHANGE (1 << FD_ADDRESS_LIST_CHANGE_BIT) +#define FD_ADDRESS_LIST_CHANGE_BIT 9 +#define FD_ADDRESS_LIST_CHANGE (1 << FD_ADDRESS_LIST_CHANGE_BIT) -#define FD_MAX_EVENTS 10 -#define FD_ALL_EVENTS ((1 << FD_MAX_EVENTS) - 1) +#define FD_MAX_EVENTS 10 +#define FD_ALL_EVENTS ((1 << FD_MAX_EVENTS) - 1) -#define SD_RECEIVE 0 -#define SD_SEND 1 -#define SD_BOTH 2 +#define SD_RECEIVE 0 +#define SD_SEND 1 +#define SD_BOTH 2 -#define SOCKET_ERROR (-1) +#define SOCKET_ERROR (-1) typedef struct WSAData { @@ -151,11 +150,11 @@ typedef struct WSAData unsigned short iMaxSockets; unsigned short iMaxUdpDg; char* lpVendorInfo; - char szDescription[WSADESCRIPTION_LEN+1]; - char szSystemStatus[WSASYS_STATUS_LEN+1]; + char szDescription[WSADESCRIPTION_LEN + 1]; + char szSystemStatus[WSASYS_STATUS_LEN + 1]; #else - char szDescription[WSADESCRIPTION_LEN+1]; - char szSystemStatus[WSASYS_STATUS_LEN+1]; + char szDescription[WSADESCRIPTION_LEN + 1]; + char szSystemStatus[WSASYS_STATUS_LEN + 1]; unsigned short iMaxSockets; unsigned short iMaxUdpDg; char* lpVendorInfo; @@ -163,7 +162,8 @@ typedef struct WSAData } WSADATA, *LPWSADATA; #ifndef MAKEWORD -#define MAKEWORD(a,b) ((WORD)(((BYTE)((DWORD_PTR)(a) & 0xFF)) | (((WORD)((BYTE)((DWORD_PTR)(b) & 0xFF))) << 8))) +#define MAKEWORD(a, b) \ + ((WORD)(((BYTE)((DWORD_PTR)(a)&0xFF)) | (((WORD)((BYTE)((DWORD_PTR)(b)&0xFF))) << 8))) #endif typedef struct in6_addr IN6_ADDR; @@ -178,18 +178,17 @@ struct sockaddr_in6_old IN6_ADDR sin6_addr; }; -typedef union sockaddr_gen -{ +typedef union sockaddr_gen { struct sockaddr Address; struct sockaddr_in AddressIn; struct sockaddr_in6_old AddressIn6; } sockaddr_gen; -#define _IFF_UP 0x00000001 -#define _IFF_BROADCAST 0x00000002 -#define _IFF_LOOPBACK 0x00000004 -#define _IFF_POINTTOPOINT 0x00000008 -#define _IFF_MULTICAST 0x00000010 +#define _IFF_UP 0x00000001 +#define _IFF_BROADCAST 0x00000002 +#define _IFF_LOOPBACK 0x00000004 +#define _IFF_POINTTOPOINT 0x00000008 +#define _IFF_MULTICAST 0x00000010 struct _INTERFACE_INFO { @@ -201,15 +200,14 @@ struct _INTERFACE_INFO typedef struct _INTERFACE_INFO INTERFACE_INFO; typedef INTERFACE_INFO* LPINTERFACE_INFO; -#define MAX_PROTOCOL_CHAIN 7 -#define WSAPROTOCOL_LEN 255 +#define MAX_PROTOCOL_CHAIN 7 +#define WSAPROTOCOL_LEN 255 typedef struct _WSAPROTOCOLCHAIN { int ChainLen; DWORD ChainEntries[MAX_PROTOCOL_CHAIN]; -} -WSAPROTOCOLCHAIN, *LPWSAPROTOCOLCHAIN; +} WSAPROTOCOLCHAIN, *LPWSAPROTOCOLCHAIN; typedef struct _WSAPROTOCOL_INFOA { @@ -232,9 +230,8 @@ typedef struct _WSAPROTOCOL_INFOA int iSecurityScheme; DWORD dwMessageSize; DWORD dwProviderReserved; - CHAR szProtocol[WSAPROTOCOL_LEN+1]; -} -WSAPROTOCOL_INFOA, *LPWSAPROTOCOL_INFOA; + CHAR szProtocol[WSAPROTOCOL_LEN + 1]; +} WSAPROTOCOL_INFOA, *LPWSAPROTOCOL_INFOA; typedef struct _WSAPROTOCOL_INFOW { @@ -257,102 +254,107 @@ typedef struct _WSAPROTOCOL_INFOW int iSecurityScheme; DWORD dwMessageSize; DWORD dwProviderReserved; - WCHAR szProtocol[WSAPROTOCOL_LEN+1]; -} -WSAPROTOCOL_INFOW, *LPWSAPROTOCOL_INFOW; + WCHAR szProtocol[WSAPROTOCOL_LEN + 1]; +} WSAPROTOCOL_INFOW, *LPWSAPROTOCOL_INFOW; -typedef void (CALLBACK * LPWSAOVERLAPPED_COMPLETION_ROUTINE)(DWORD dwError, - DWORD cbTransferred, LPWSAOVERLAPPED lpOverlapped, DWORD dwFlags); +typedef void(CALLBACK* LPWSAOVERLAPPED_COMPLETION_ROUTINE)(DWORD dwError, DWORD cbTransferred, + LPWSAOVERLAPPED lpOverlapped, + DWORD dwFlags); typedef UINT32 GROUP; -#define SG_UNCONSTRAINED_GROUP 0x01 -#define SG_CONSTRAINED_GROUP 0x02 +#define SG_UNCONSTRAINED_GROUP 0x01 +#define SG_CONSTRAINED_GROUP 0x02 -#define SIO_GET_INTERFACE_LIST _IOR('t', 127, ULONG) -#define SIO_GET_INTERFACE_LIST_EX _IOR('t', 126, ULONG) -#define SIO_SET_MULTICAST_FILTER _IOW('t', 125, ULONG) -#define SIO_GET_MULTICAST_FILTER _IOW('t', 124 | IOC_IN, ULONG) -#define SIOCSIPMSFILTER SIO_SET_MULTICAST_FILTER -#define SIOCGIPMSFILTER SIO_GET_MULTICAST_FILTER +#define SIO_GET_INTERFACE_LIST _IOR('t', 127, ULONG) +#define SIO_GET_INTERFACE_LIST_EX _IOR('t', 126, ULONG) +#define SIO_SET_MULTICAST_FILTER _IOW('t', 125, ULONG) +#define SIO_GET_MULTICAST_FILTER _IOW('t', 124 | IOC_IN, ULONG) +#define SIOCSIPMSFILTER SIO_SET_MULTICAST_FILTER +#define SIOCGIPMSFILTER SIO_GET_MULTICAST_FILTER #ifdef UNICODE -#define WSAPROTOCOL_INFO WSAPROTOCOL_INFOW -#define LPWSAPROTOCOL_INFO LPWSAPROTOCOL_INFOW +#define WSAPROTOCOL_INFO WSAPROTOCOL_INFOW +#define LPWSAPROTOCOL_INFO LPWSAPROTOCOL_INFOW #else -#define WSAPROTOCOL_INFO WSAPROTOCOL_INFOA -#define LPWSAPROTOCOL_INFO LPWSAPROTOCOL_INFOA +#define WSAPROTOCOL_INFO WSAPROTOCOL_INFOA +#define LPWSAPROTOCOL_INFO LPWSAPROTOCOL_INFOA #endif #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API int WSAStartup(WORD wVersionRequired, LPWSADATA lpWSAData); -WINPR_API int WSACleanup(void); + WINPR_API int WSAStartup(WORD wVersionRequired, LPWSADATA lpWSAData); + WINPR_API int WSACleanup(void); -WINPR_API void WSASetLastError(int iError); -WINPR_API int WSAGetLastError(void); + WINPR_API void WSASetLastError(int iError); + WINPR_API int WSAGetLastError(void); -WINPR_API HANDLE WSACreateEvent(void); -WINPR_API BOOL WSASetEvent(HANDLE hEvent); -WINPR_API BOOL WSAResetEvent(HANDLE hEvent); -WINPR_API BOOL WSACloseEvent(HANDLE hEvent); + WINPR_API HANDLE WSACreateEvent(void); + WINPR_API BOOL WSASetEvent(HANDLE hEvent); + WINPR_API BOOL WSAResetEvent(HANDLE hEvent); + WINPR_API BOOL WSACloseEvent(HANDLE hEvent); -WINPR_API int WSAEventSelect(SOCKET s, WSAEVENT hEventObject, LONG lNetworkEvents); + WINPR_API int WSAEventSelect(SOCKET s, WSAEVENT hEventObject, LONG lNetworkEvents); -WINPR_API DWORD WSAWaitForMultipleEvents(DWORD cEvents, - const HANDLE* lphEvents, BOOL fWaitAll, DWORD dwTimeout, BOOL fAlertable); + WINPR_API DWORD WSAWaitForMultipleEvents(DWORD cEvents, const HANDLE* lphEvents, BOOL fWaitAll, + DWORD dwTimeout, BOOL fAlertable); -WINPR_API SOCKET WSASocketA(int af, int type, int protocol, LPWSAPROTOCOL_INFOA lpProtocolInfo, GROUP g, DWORD dwFlags); -WINPR_API SOCKET WSASocketW(int af, int type, int protocol, LPWSAPROTOCOL_INFOW lpProtocolInfo, GROUP g, DWORD dwFlags); + WINPR_API SOCKET WSASocketA(int af, int type, int protocol, LPWSAPROTOCOL_INFOA lpProtocolInfo, + GROUP g, DWORD dwFlags); + WINPR_API SOCKET WSASocketW(int af, int type, int protocol, LPWSAPROTOCOL_INFOW lpProtocolInfo, + GROUP g, DWORD dwFlags); -WINPR_API int WSAIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, - DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, - LPDWORD lpcbBytesReturned, LPWSAOVERLAPPED lpOverlapped, - LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); + WINPR_API int WSAIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, + LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, + LPWSAOVERLAPPED lpOverlapped, + LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); -WINPR_API SOCKET _accept(SOCKET s, struct sockaddr* addr, int* addrlen); -WINPR_API int _bind(SOCKET s, const struct sockaddr* addr, int namelen); -WINPR_API int closesocket(SOCKET s); -WINPR_API int _connect(SOCKET s, const struct sockaddr* name, int namelen); -WINPR_API int _ioctlsocket(SOCKET s, long cmd, u_long* argp); -WINPR_API int _getpeername(SOCKET s, struct sockaddr* name, int* namelen); -WINPR_API int _getsockname(SOCKET s, struct sockaddr* name, int* namelen); -WINPR_API int _getsockopt(SOCKET s, int level, int optname, char* optval, int* optlen); -WINPR_API u_long _htonl(u_long hostlong); -WINPR_API u_short _htons(u_short hostshort); -WINPR_API unsigned long _inet_addr(const char* cp); -WINPR_API char* _inet_ntoa(struct in_addr in); -WINPR_API int _listen(SOCKET s, int backlog); -WINPR_API u_long _ntohl(u_long netlong); -WINPR_API u_short _ntohs(u_short netshort); -WINPR_API int _recv(SOCKET s, char* buf, int len, int flags); -WINPR_API int _recvfrom(SOCKET s, char* buf, int len, int flags, struct sockaddr* from, int* fromlen); -WINPR_API int _select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, const struct timeval* timeout); -WINPR_API int _send(SOCKET s, const char* buf, int len, int flags); -WINPR_API int _sendto(SOCKET s, const char* buf, int len, int flags, const struct sockaddr* to, int tolen); -WINPR_API int _setsockopt(SOCKET s, int level, int optname, const char* optval, int optlen); -WINPR_API int _shutdown(SOCKET s, int how); -WINPR_API SOCKET _socket(int af, int type, int protocol); -WINPR_API struct hostent* _gethostbyaddr(const char* addr, int len, int type); -WINPR_API struct hostent* _gethostbyname(const char* name); -WINPR_API int _gethostname(char* name, int namelen); -WINPR_API struct servent* _getservbyport(int port, const char* proto); -WINPR_API struct servent* _getservbyname(const char* name, const char* proto); -WINPR_API struct protoent* _getprotobynumber(int number); -WINPR_API struct protoent* _getprotobyname(const char* name); + WINPR_API SOCKET _accept(SOCKET s, struct sockaddr* addr, int* addrlen); + WINPR_API int _bind(SOCKET s, const struct sockaddr* addr, int namelen); + WINPR_API int closesocket(SOCKET s); + WINPR_API int _connect(SOCKET s, const struct sockaddr* name, int namelen); + WINPR_API int _ioctlsocket(SOCKET s, long cmd, u_long* argp); + WINPR_API int _getpeername(SOCKET s, struct sockaddr* name, int* namelen); + WINPR_API int _getsockname(SOCKET s, struct sockaddr* name, int* namelen); + WINPR_API int _getsockopt(SOCKET s, int level, int optname, char* optval, int* optlen); + WINPR_API u_long _htonl(u_long hostlong); + WINPR_API u_short _htons(u_short hostshort); + WINPR_API unsigned long _inet_addr(const char* cp); + WINPR_API char* _inet_ntoa(struct in_addr in); + WINPR_API int _listen(SOCKET s, int backlog); + WINPR_API u_long _ntohl(u_long netlong); + WINPR_API u_short _ntohs(u_short netshort); + WINPR_API int _recv(SOCKET s, char* buf, int len, int flags); + WINPR_API int _recvfrom(SOCKET s, char* buf, int len, int flags, struct sockaddr* from, + int* fromlen); + WINPR_API int _select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, + const struct timeval* timeout); + WINPR_API int _send(SOCKET s, const char* buf, int len, int flags); + WINPR_API int _sendto(SOCKET s, const char* buf, int len, int flags, const struct sockaddr* to, + int tolen); + WINPR_API int _setsockopt(SOCKET s, int level, int optname, const char* optval, int optlen); + WINPR_API int _shutdown(SOCKET s, int how); + WINPR_API SOCKET _socket(int af, int type, int protocol); + WINPR_API struct hostent* _gethostbyaddr(const char* addr, int len, int type); + WINPR_API struct hostent* _gethostbyname(const char* name); + WINPR_API int _gethostname(char* name, int namelen); + WINPR_API struct servent* _getservbyport(int port, const char* proto); + WINPR_API struct servent* _getservbyname(const char* name, const char* proto); + WINPR_API struct protoent* _getprotobynumber(int number); + WINPR_API struct protoent* _getprotobyname(const char* name); #ifdef __cplusplus } #endif #ifdef UNICODE -#define WSASocket WSASocketW +#define WSASocket WSASocketW #else -#define WSASocket WSASocketA +#define WSASocket WSASocketA #endif #endif /* _WIN32 */ #endif /* WINPR_WINSOCK_H */ - diff --git a/winpr/include/winpr/wlog.h b/winpr/include/winpr/wlog.h index 1f1c12d98..b2fe8e162 100644 --- a/winpr/include/winpr/wlog.h +++ b/winpr/include/winpr/wlog.h @@ -24,7 +24,8 @@ #define WINPR_LOG_H #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif #include @@ -35,132 +36,142 @@ extern "C" { /** * Log Levels */ -#define WLOG_TRACE 0 -#define WLOG_DEBUG 1 -#define WLOG_INFO 2 -#define WLOG_WARN 3 -#define WLOG_ERROR 4 -#define WLOG_FATAL 5 -#define WLOG_OFF 6 +#define WLOG_TRACE 0 +#define WLOG_DEBUG 1 +#define WLOG_INFO 2 +#define WLOG_WARN 3 +#define WLOG_ERROR 4 +#define WLOG_FATAL 5 +#define WLOG_OFF 6 #define WLOG_LEVEL_INHERIT 0xFFFF /** * Log Message */ -#define WLOG_MESSAGE_TEXT 0 -#define WLOG_MESSAGE_DATA 1 -#define WLOG_MESSAGE_IMAGE 2 -#define WLOG_MESSAGE_PACKET 3 +#define WLOG_MESSAGE_TEXT 0 +#define WLOG_MESSAGE_DATA 1 +#define WLOG_MESSAGE_IMAGE 2 +#define WLOG_MESSAGE_PACKET 3 /** * Log Appenders */ -#define WLOG_APPENDER_CONSOLE 0 -#define WLOG_APPENDER_FILE 1 -#define WLOG_APPENDER_BINARY 2 -#define WLOG_APPENDER_CALLBACK 3 -#define WLOG_APPENDER_SYSLOG 4 -#define WLOG_APPENDER_JOURNALD 5 -#define WLOG_APPENDER_UDP 6 +#define WLOG_APPENDER_CONSOLE 0 +#define WLOG_APPENDER_FILE 1 +#define WLOG_APPENDER_BINARY 2 +#define WLOG_APPENDER_CALLBACK 3 +#define WLOG_APPENDER_SYSLOG 4 +#define WLOG_APPENDER_JOURNALD 5 +#define WLOG_APPENDER_UDP 6 -struct _wLogMessage -{ - DWORD Type; + struct _wLogMessage + { + DWORD Type; - DWORD Level; + DWORD Level; - LPSTR PrefixString; + LPSTR PrefixString; - LPCSTR FormatString; - LPSTR TextString; + LPCSTR FormatString; + LPSTR TextString; - DWORD LineNumber; /* __LINE__ */ - LPCSTR FileName; /* __FILE__ */ - LPCSTR FunctionName; /* __FUNCTION__ */ + DWORD LineNumber; /* __LINE__ */ + LPCSTR FileName; /* __FILE__ */ + LPCSTR FunctionName; /* __FUNCTION__ */ - /* Data Message */ + /* Data Message */ - void* Data; - int Length; + void* Data; + int Length; - /* Image Message */ + /* Image Message */ - void* ImageData; - int ImageWidth; - int ImageHeight; - int ImageBpp; + void* ImageData; + int ImageWidth; + int ImageHeight; + int ImageBpp; - /* Packet Message */ + /* Packet Message */ - void* PacketData; - int PacketLength; - DWORD PacketFlags; -}; -typedef struct _wLogMessage wLogMessage; -typedef struct _wLogLayout wLogLayout; -typedef struct _wLogAppender wLogAppender; -typedef struct _wLog wLog; + void* PacketData; + int PacketLength; + DWORD PacketFlags; + }; + typedef struct _wLogMessage wLogMessage; + typedef struct _wLogLayout wLogLayout; + typedef struct _wLogAppender wLogAppender; + typedef struct _wLog wLog; -#define WLOG_PACKET_INBOUND 1 -#define WLOG_PACKET_OUTBOUND 2 +#define WLOG_PACKET_INBOUND 1 +#define WLOG_PACKET_OUTBOUND 2 -WINPR_API BOOL WLog_PrintMessage(wLog* log, DWORD type, DWORD level, DWORD line, - const char* file, const char* function, ...); -WINPR_API BOOL WLog_PrintMessageVA(wLog* log, DWORD type, DWORD level, - DWORD line, - const char* file, const char* function, va_list args); + WINPR_API BOOL WLog_PrintMessage(wLog* log, DWORD type, DWORD level, DWORD line, + const char* file, const char* function, ...); + WINPR_API BOOL WLog_PrintMessageVA(wLog* log, DWORD type, DWORD level, DWORD line, + const char* file, const char* function, va_list args); -WINPR_API wLog* WLog_GetRoot(void); -WINPR_API wLog* WLog_Get(LPCSTR name); -WINPR_API DWORD WLog_GetLogLevel(wLog* log); -WINPR_API BOOL WLog_IsLevelActive(wLog* _log, DWORD _log_level); + WINPR_API wLog* WLog_GetRoot(void); + WINPR_API wLog* WLog_Get(LPCSTR name); + WINPR_API DWORD WLog_GetLogLevel(wLog* log); + WINPR_API BOOL WLog_IsLevelActive(wLog* _log, DWORD _log_level); -#define WLog_Print(_log, _log_level, ...) \ - do { \ - if (WLog_IsLevelActive(_log, _log_level)) { \ - WLog_PrintMessage(_log, WLOG_MESSAGE_TEXT, _log_level, \ - __LINE__, __FILE__, __FUNCTION__, __VA_ARGS__ ); \ - } \ +#define WLog_Print(_log, _log_level, ...) \ + do \ + { \ + if (WLog_IsLevelActive(_log, _log_level)) \ + { \ + WLog_PrintMessage(_log, WLOG_MESSAGE_TEXT, _log_level, __LINE__, __FILE__, \ + __FUNCTION__, __VA_ARGS__); \ + } \ } while (0) -#define WLog_Print_tag(_tag, _log_level, ...) \ - do { \ - static wLog* _log_cached_ptr = NULL; \ - if (!_log_cached_ptr) \ - _log_cached_ptr = WLog_Get(_tag); \ - WLog_Print(_log_cached_ptr, _log_level, __VA_ARGS__); \ - } while (0) - -#define WLog_PrintVA(_log, _log_level, _args) \ - do { \ - if (WLog_IsLevelActive(_log, _log_level)) { \ - WLog_PrintMessageVA(_log, WLOG_MESSAGE_TEXT, _log_level, \ - __LINE__, __FILE__, __FUNCTION__, _args ); \ - } \ +#define WLog_Print_tag(_tag, _log_level, ...) \ + do \ + { \ + static wLog* _log_cached_ptr = NULL; \ + if (!_log_cached_ptr) \ + _log_cached_ptr = WLog_Get(_tag); \ + WLog_Print(_log_cached_ptr, _log_level, __VA_ARGS__); \ } while (0) -#define WLog_Data(_log, _log_level, ...) \ - do { \ - if (WLog_IsLevelActive(_log, _log_level)) { \ - WLog_PrintMessage(_log, WLOG_MESSAGE_DATA, _log_level, \ - __LINE__, __FILE__, __FUNCTION__, __VA_ARGS__ ); \ - } \ +#define WLog_PrintVA(_log, _log_level, _args) \ + do \ + { \ + if (WLog_IsLevelActive(_log, _log_level)) \ + { \ + WLog_PrintMessageVA(_log, WLOG_MESSAGE_TEXT, _log_level, __LINE__, __FILE__, \ + __FUNCTION__, _args); \ + } \ } while (0) -#define WLog_Image(_log, _log_level, ...) \ - do { \ - if (WLog_IsLevelActive(_log, _log_level)) { \ - WLog_PrintMessage(_log, WLOG_MESSAGE_DATA, _log_level, \ - __LINE__, __FILE__, __FUNCTION__, __VA_ARGS__ ); \ - } \ +#define WLog_Data(_log, _log_level, ...) \ + do \ + { \ + if (WLog_IsLevelActive(_log, _log_level)) \ + { \ + WLog_PrintMessage(_log, WLOG_MESSAGE_DATA, _log_level, __LINE__, __FILE__, \ + __FUNCTION__, __VA_ARGS__); \ + } \ } while (0) -#define WLog_Packet(_log, _log_level, ...) \ - do { \ - if (WLog_IsLevelActive(_log, _log_level)) { \ - WLog_PrintMessage(_log, WLOG_MESSAGE_PACKET, _log_level, \ - __LINE__, __FILE__, __FUNCTION__, __VA_ARGS__ ); \ - } \ +#define WLog_Image(_log, _log_level, ...) \ + do \ + { \ + if (WLog_IsLevelActive(_log, _log_level)) \ + { \ + WLog_PrintMessage(_log, WLOG_MESSAGE_DATA, _log_level, __LINE__, __FILE__, \ + __FUNCTION__, __VA_ARGS__); \ + } \ + } while (0) + +#define WLog_Packet(_log, _log_level, ...) \ + do \ + { \ + if (WLog_IsLevelActive(_log, _log_level)) \ + { \ + WLog_PrintMessage(_log, WLOG_MESSAGE_PACKET, _log_level, __LINE__, __FILE__, \ + __FUNCTION__, __VA_ARGS__); \ + } \ } while (0) #define WLog_LVL(tag, lvl, ...) WLog_Print_tag(tag, lvl, __VA_ARGS__) @@ -171,39 +182,37 @@ WINPR_API BOOL WLog_IsLevelActive(wLog* _log, DWORD _log_level); #define WLog_ERR(tag, ...) WLog_Print_tag(tag, WLOG_ERROR, __VA_ARGS__) #define WLog_FATAL(tag, ...) WLog_Print_tag(tag, WLOG_FATAL, __VA_ARGS__) -WINPR_API BOOL WLog_SetLogLevel(wLog* log, DWORD logLevel); -WINPR_API BOOL WLog_SetStringLogLevel(wLog* log, LPCSTR level); -WINPR_API BOOL WLog_AddStringLogFilters(LPCSTR filter); + WINPR_API BOOL WLog_SetLogLevel(wLog* log, DWORD logLevel); + WINPR_API BOOL WLog_SetStringLogLevel(wLog* log, LPCSTR level); + WINPR_API BOOL WLog_AddStringLogFilters(LPCSTR filter); -WINPR_API BOOL WLog_SetLogAppenderType(wLog* log, DWORD logAppenderType); -WINPR_API wLogAppender* WLog_GetLogAppender(wLog* log); -WINPR_API BOOL WLog_OpenAppender(wLog* log); -WINPR_API BOOL WLog_CloseAppender(wLog* log); -WINPR_API BOOL WLog_ConfigureAppender(wLogAppender* appender, - const char* setting, void* value); + WINPR_API BOOL WLog_SetLogAppenderType(wLog* log, DWORD logAppenderType); + WINPR_API wLogAppender* WLog_GetLogAppender(wLog* log); + WINPR_API BOOL WLog_OpenAppender(wLog* log); + WINPR_API BOOL WLog_CloseAppender(wLog* log); + WINPR_API BOOL WLog_ConfigureAppender(wLogAppender* appender, const char* setting, void* value); -WINPR_API wLogLayout* WLog_GetLogLayout(wLog* log); -WINPR_API BOOL WLog_Layout_SetPrefixFormat(wLog* log, wLogLayout* layout, - const char* format); + WINPR_API wLogLayout* WLog_GetLogLayout(wLog* log); + WINPR_API BOOL WLog_Layout_SetPrefixFormat(wLog* log, wLogLayout* layout, const char* format); -/** Deprecated */ -WINPR_API WINPR_DEPRECATED(BOOL WLog_Init(void)); -/** Deprecated */ -WINPR_API WINPR_DEPRECATED(BOOL WLog_Uninit(void)); + /** Deprecated */ + WINPR_API WINPR_DEPRECATED(BOOL WLog_Init(void)); + /** Deprecated */ + WINPR_API WINPR_DEPRECATED(BOOL WLog_Uninit(void)); -typedef BOOL (*wLogCallbackMessage_t)(const wLogMessage* msg); -typedef BOOL (*wLogCallbackData_t)(const wLogMessage* msg); -typedef BOOL (*wLogCallbackImage_t)(const wLogMessage* msg); -typedef BOOL (*wLogCallbackPackage_t)(const wLogMessage* msg); + typedef BOOL (*wLogCallbackMessage_t)(const wLogMessage* msg); + typedef BOOL (*wLogCallbackData_t)(const wLogMessage* msg); + typedef BOOL (*wLogCallbackImage_t)(const wLogMessage* msg); + typedef BOOL (*wLogCallbackPackage_t)(const wLogMessage* msg); -struct _wLogCallbacks -{ - wLogCallbackData_t data; - wLogCallbackImage_t image; - wLogCallbackMessage_t message; - wLogCallbackPackage_t package; -}; -typedef struct _wLogCallbacks wLogCallbacks; + struct _wLogCallbacks + { + wLogCallbackData_t data; + wLogCallbackImage_t image; + wLogCallbackMessage_t message; + wLogCallbackPackage_t package; + }; + typedef struct _wLogCallbacks wLogCallbacks; #ifdef __cplusplus } diff --git a/winpr/include/winpr/wnd.h b/winpr/include/winpr/wnd.h index 6fc89942a..24a73298d 100644 --- a/winpr/include/winpr/wnd.h +++ b/winpr/include/winpr/wnd.h @@ -27,263 +27,263 @@ #ifndef _WIN32 -#define WM_NULL 0x0000 -#define WM_CREATE 0x0001 -#define WM_DESTROY 0x0002 -#define WM_MOVE 0x0003 -#define WM_SIZE 0x0005 -#define WM_ACTIVATE 0x0006 -#define WM_SETFOCUS 0x0007 -#define WM_KILLFOCUS 0x0008 -#define WM_ENABLE 0x000A -#define WM_SETREDRAW 0x000B -#define WM_SETTEXT 0x000C -#define WM_GETTEXT 0x000D -#define WM_GETTEXTLENGTH 0x000E -#define WM_PAINT 0x000F -#define WM_CLOSE 0x0010 -#define WM_QUERYENDSESSION 0x0011 -#define WM_QUERYOPEN 0x0013 -#define WM_ENDSESSION 0x0016 -#define WM_QUIT 0x0012 -#define WM_ERASEBKGND 0x0014 -#define WM_SYSCOLORCHANGE 0x0015 -#define WM_SHOWWINDOW 0x0018 -#define WM_WININICHANGE 0x001A -#define WM_SETTINGCHANGE 0x001A -#define WM_DEVMODECHANGE 0x001B -#define WM_ACTIVATEAPP 0x001C -#define WM_FONTCHANGE 0x001D -#define WM_TIMECHANGE 0x001E -#define WM_CANCELMODE 0x001F -#define WM_SETCURSOR 0x0020 -#define WM_MOUSEACTIVATE 0x0021 -#define WM_CHILDACTIVATE 0x0022 -#define WM_QUEUESYNC 0x0023 -#define WM_GETMINMAXINFO 0x0024 -#define WM_PAINTICON 0x0026 -#define WM_ICONERASEBKGND 0x0027 -#define WM_NEXTDLGCTL 0x0028 -#define WM_SPOOLERSTATUS 0x002A -#define WM_DRAWITEM 0x002B -#define WM_MEASUREITEM 0x002C -#define WM_DELETEITEM 0x002D -#define WM_VKEYTOITEM 0x002E -#define WM_CHARTOITEM 0x002F -#define WM_SETFONT 0x0030 -#define WM_GETFONT 0x0031 -#define WM_SETHOTKEY 0x0032 -#define WM_GETHOTKEY 0x0033 -#define WM_QUERYDRAGICON 0x0037 -#define WM_COMPAREITEM 0x0039 -#define WM_GETOBJECT 0x003D -#define WM_COMPACTING 0x0041 -#define WM_COMMNOTIFY 0x0044 -#define WM_WINDOWPOSCHANGING 0x0046 -#define WM_WINDOWPOSCHANGED 0x0047 -#define WM_POWER 0x0048 -#define WM_COPYDATA 0x004A -#define WM_CANCELJOURNAL 0x004B -#define WM_NOTIFY 0x004E -#define WM_INPUTLANGCHANGEREQUEST 0x0050 -#define WM_INPUTLANGCHANGE 0x0051 -#define WM_TCARD 0x0052 -#define WM_HELP 0x0053 -#define WM_USERCHANGED 0x0054 -#define WM_NOTIFYFORMAT 0x0055 -#define WM_CONTEXTMENU 0x007B -#define WM_STYLECHANGING 0x007C -#define WM_STYLECHANGED 0x007D -#define WM_DISPLAYCHANGE 0x007E -#define WM_GETICON 0x007F -#define WM_SETICON 0x0080 -#define WM_NCCREATE 0x0081 -#define WM_NCDESTROY 0x0082 -#define WM_NCCALCSIZE 0x0083 -#define WM_NCHITTEST 0x0084 -#define WM_NCPAINT 0x0085 -#define WM_NCACTIVATE 0x0086 -#define WM_GETDLGCODE 0x0087 -#define WM_SYNCPAINT 0x0088 -#define WM_NCMOUSEMOVE 0x00A0 -#define WM_NCLBUTTONDOWN 0x00A1 -#define WM_NCLBUTTONUP 0x00A2 -#define WM_NCLBUTTONDBLCLK 0x00A3 -#define WM_NCRBUTTONDOWN 0x00A4 -#define WM_NCRBUTTONUP 0x00A5 -#define WM_NCRBUTTONDBLCLK 0x00A6 -#define WM_NCMBUTTONDOWN 0x00A7 -#define WM_NCMBUTTONUP 0x00A8 -#define WM_NCMBUTTONDBLCLK 0x00A9 -#define WM_NCXBUTTONDOWN 0x00AB -#define WM_NCXBUTTONUP 0x00AC -#define WM_NCXBUTTONDBLCLK 0x00AD -#define WM_INPUT_DEVICE_CHANGE 0x00FE -#define WM_INPUT 0x00FF -#define WM_KEYFIRST 0x0100 -#define WM_KEYDOWN 0x0100 -#define WM_KEYUP 0x0101 -#define WM_CHAR 0x0102 -#define WM_DEADCHAR 0x0103 -#define WM_SYSKEYDOWN 0x0104 -#define WM_SYSKEYUP 0x0105 -#define WM_SYSCHAR 0x0106 -#define WM_SYSDEADCHAR 0x0107 -#define WM_UNICHAR 0x0109 -#define WM_KEYLAST 0x0109 -#define WM_IME_STARTCOMPOSITION 0x010D -#define WM_IME_ENDCOMPOSITION 0x010E -#define WM_IME_COMPOSITION 0x010F -#define WM_IME_KEYLAST 0x010F -#define WM_INITDIALOG 0x0110 -#define WM_COMMAND 0x0111 -#define WM_SYSCOMMAND 0x0112 -#define WM_TIMER 0x0113 -#define WM_HSCROLL 0x0114 -#define WM_VSCROLL 0x0115 -#define WM_INITMENU 0x0116 -#define WM_INITMENUPOPUP 0x0117 -#define WM_GESTURE 0x0119 -#define WM_GESTURENOTIFY 0x011A -#define WM_MENUSELECT 0x011F -#define WM_MENUCHAR 0x0120 -#define WM_ENTERIDLE 0x0121 -#define WM_MENURBUTTONUP 0x0122 -#define WM_MENUDRAG 0x0123 -#define WM_MENUGETOBJECT 0x0124 -#define WM_UNINITMENUPOPUP 0x0125 -#define WM_MENUCOMMAND 0x0126 -#define WM_CHANGEUISTATE 0x0127 -#define WM_UPDATEUISTATE 0x0128 -#define WM_QUERYUISTATE 0x0129 -#define WM_CTLCOLORMSGBOX 0x0132 -#define WM_CTLCOLOREDIT 0x0133 -#define WM_CTLCOLORLISTBOX 0x0134 -#define WM_CTLCOLORBTN 0x0135 -#define WM_CTLCOLORDLG 0x0136 -#define WM_CTLCOLORSCROLLBAR 0x0137 -#define WM_CTLCOLORSTATIC 0x0138 -#define WM_MOUSEFIRST 0x0200 -#define WM_MOUSEMOVE 0x0200 -#define WM_LBUTTONDOWN 0x0201 -#define WM_LBUTTONUP 0x0202 -#define WM_LBUTTONDBLCLK 0x0203 -#define WM_RBUTTONDOWN 0x0204 -#define WM_RBUTTONUP 0x0205 -#define WM_RBUTTONDBLCLK 0x0206 -#define WM_MBUTTONDOWN 0x0207 -#define WM_MBUTTONUP 0x0208 -#define WM_MBUTTONDBLCLK 0x0209 -#define WM_MOUSEWHEEL 0x020A -#define WM_XBUTTONDOWN 0x020B -#define WM_XBUTTONUP 0x020C -#define WM_XBUTTONDBLCLK 0x020D -#define WM_MOUSEHWHEEL 0x020E -#define WM_MOUSELAST 0x020E -#define WM_PARENTNOTIFY 0x0210 -#define WM_ENTERMENULOOP 0x0211 -#define WM_EXITMENULOOP 0x0212 -#define WM_NEXTMENU 0x0213 -#define WM_SIZING 0x0214 -#define WM_CAPTURECHANGED 0x0215 -#define WM_MOVING 0x0216 -#define WM_POWERBROADCAST 0x0218 -#define WM_DEVICECHANGE 0x0219 -#define WM_MDICREATE 0x0220 -#define WM_MDIDESTROY 0x0221 -#define WM_MDIACTIVATE 0x0222 -#define WM_MDIRESTORE 0x0223 -#define WM_MDINEXT 0x0224 -#define WM_MDIMAXIMIZE 0x0225 -#define WM_MDITILE 0x0226 -#define WM_MDICASCADE 0x0227 -#define WM_MDIICONARRANGE 0x0228 -#define WM_MDIGETACTIVE 0x0229 -#define WM_MDISETMENU 0x0230 -#define WM_ENTERSIZEMOVE 0x0231 -#define WM_EXITSIZEMOVE 0x0232 -#define WM_DROPFILES 0x0233 -#define WM_MDIREFRESHMENU 0x0234 -#define WM_POINTERDEVICECHANGE 0x0238 -#define WM_POINTERDEVICEINRANGE 0x0239 -#define WM_POINTERDEVICEOUTOFRANGE 0x023A -#define WM_TOUCH 0x0240 -#define WM_NCPOINTERUPDATE 0x0241 -#define WM_NCPOINTERDOWN 0x0242 -#define WM_NCPOINTERUP 0x0243 -#define WM_POINTERUPDATE 0x0245 -#define WM_POINTERDOWN 0x0246 -#define WM_POINTERUP 0x0247 -#define WM_POINTERENTER 0x0249 -#define WM_POINTERLEAVE 0x024A -#define WM_POINTERACTIVATE 0x024B -#define WM_POINTERCAPTURECHANGED 0x024C -#define WM_TOUCHHITTESTING 0x024D -#define WM_POINTERWHEEL 0x024E -#define WM_POINTERHWHEEL 0x024F -#define WM_IME_SETCONTEXT 0x0281 -#define WM_IME_NOTIFY 0x0282 -#define WM_IME_CONTROL 0x0283 -#define WM_IME_COMPOSITIONFULL 0x0284 -#define WM_IME_SELECT 0x0285 -#define WM_IME_CHAR 0x0286 -#define WM_IME_REQUEST 0x0288 -#define WM_IME_KEYDOWN 0x0290 -#define WM_IME_KEYUP 0x0291 -#define WM_MOUSEHOVER 0x02A1 -#define WM_MOUSELEAVE 0x02A3 -#define WM_NCMOUSEHOVER 0x02A0 -#define WM_NCMOUSELEAVE 0x02A2 -#define WM_WTSSESSION_CHANGE 0x02B1 -#define WM_TABLET_FIRST 0x02c0 -#define WM_TABLET_LAST 0x02df -#define WM_CUT 0x0300 -#define WM_COPY 0x0301 -#define WM_PASTE 0x0302 -#define WM_CLEAR 0x0303 -#define WM_UNDO 0x0304 -#define WM_RENDERFORMAT 0x0305 -#define WM_RENDERALLFORMATS 0x0306 -#define WM_DESTROYCLIPBOARD 0x0307 -#define WM_DRAWCLIPBOARD 0x0308 -#define WM_PAINTCLIPBOARD 0x0309 -#define WM_VSCROLLCLIPBOARD 0x030A -#define WM_SIZECLIPBOARD 0x030B -#define WM_ASKCBFORMATNAME 0x030C -#define WM_CHANGECBCHAIN 0x030D -#define WM_HSCROLLCLIPBOARD 0x030E -#define WM_QUERYNEWPALETTE 0x030F -#define WM_PALETTEISCHANGING 0x0310 -#define WM_PALETTECHANGED 0x0311 -#define WM_HOTKEY 0x0312 -#define WM_PRINT 0x0317 -#define WM_PRINTCLIENT 0x0318 -#define WM_APPCOMMAND 0x0319 -#define WM_THEMECHANGED 0x031A -#define WM_CLIPBOARDUPDATE 0x031D -#define WM_DWMCOMPOSITIONCHANGED 0x031E -#define WM_DWMNCRENDERINGCHANGED 0x031F -#define WM_DWMCOLORIZATIONCOLORCHANGED 0x0320 -#define WM_DWMWINDOWMAXIMIZEDCHANGE 0x0321 -#define WM_DWMSENDICONICTHUMBNAIL 0x0323 -#define WM_DWMSENDICONICLIVEPREVIEWBITMAP 0x0326 -#define WM_GETTITLEBARINFOEX 0x033F -#define WM_HANDHELDFIRST 0x0358 -#define WM_HANDHELDLAST 0x035F -#define WM_AFXFIRST 0x0360 -#define WM_AFXLAST 0x037F -#define WM_PENWINFIRST 0x0380 -#define WM_PENWINLAST 0x038F -#define WM_APP 0x8000 -#define WM_USER 0x0400 +#define WM_NULL 0x0000 +#define WM_CREATE 0x0001 +#define WM_DESTROY 0x0002 +#define WM_MOVE 0x0003 +#define WM_SIZE 0x0005 +#define WM_ACTIVATE 0x0006 +#define WM_SETFOCUS 0x0007 +#define WM_KILLFOCUS 0x0008 +#define WM_ENABLE 0x000A +#define WM_SETREDRAW 0x000B +#define WM_SETTEXT 0x000C +#define WM_GETTEXT 0x000D +#define WM_GETTEXTLENGTH 0x000E +#define WM_PAINT 0x000F +#define WM_CLOSE 0x0010 +#define WM_QUERYENDSESSION 0x0011 +#define WM_QUERYOPEN 0x0013 +#define WM_ENDSESSION 0x0016 +#define WM_QUIT 0x0012 +#define WM_ERASEBKGND 0x0014 +#define WM_SYSCOLORCHANGE 0x0015 +#define WM_SHOWWINDOW 0x0018 +#define WM_WININICHANGE 0x001A +#define WM_SETTINGCHANGE 0x001A +#define WM_DEVMODECHANGE 0x001B +#define WM_ACTIVATEAPP 0x001C +#define WM_FONTCHANGE 0x001D +#define WM_TIMECHANGE 0x001E +#define WM_CANCELMODE 0x001F +#define WM_SETCURSOR 0x0020 +#define WM_MOUSEACTIVATE 0x0021 +#define WM_CHILDACTIVATE 0x0022 +#define WM_QUEUESYNC 0x0023 +#define WM_GETMINMAXINFO 0x0024 +#define WM_PAINTICON 0x0026 +#define WM_ICONERASEBKGND 0x0027 +#define WM_NEXTDLGCTL 0x0028 +#define WM_SPOOLERSTATUS 0x002A +#define WM_DRAWITEM 0x002B +#define WM_MEASUREITEM 0x002C +#define WM_DELETEITEM 0x002D +#define WM_VKEYTOITEM 0x002E +#define WM_CHARTOITEM 0x002F +#define WM_SETFONT 0x0030 +#define WM_GETFONT 0x0031 +#define WM_SETHOTKEY 0x0032 +#define WM_GETHOTKEY 0x0033 +#define WM_QUERYDRAGICON 0x0037 +#define WM_COMPAREITEM 0x0039 +#define WM_GETOBJECT 0x003D +#define WM_COMPACTING 0x0041 +#define WM_COMMNOTIFY 0x0044 +#define WM_WINDOWPOSCHANGING 0x0046 +#define WM_WINDOWPOSCHANGED 0x0047 +#define WM_POWER 0x0048 +#define WM_COPYDATA 0x004A +#define WM_CANCELJOURNAL 0x004B +#define WM_NOTIFY 0x004E +#define WM_INPUTLANGCHANGEREQUEST 0x0050 +#define WM_INPUTLANGCHANGE 0x0051 +#define WM_TCARD 0x0052 +#define WM_HELP 0x0053 +#define WM_USERCHANGED 0x0054 +#define WM_NOTIFYFORMAT 0x0055 +#define WM_CONTEXTMENU 0x007B +#define WM_STYLECHANGING 0x007C +#define WM_STYLECHANGED 0x007D +#define WM_DISPLAYCHANGE 0x007E +#define WM_GETICON 0x007F +#define WM_SETICON 0x0080 +#define WM_NCCREATE 0x0081 +#define WM_NCDESTROY 0x0082 +#define WM_NCCALCSIZE 0x0083 +#define WM_NCHITTEST 0x0084 +#define WM_NCPAINT 0x0085 +#define WM_NCACTIVATE 0x0086 +#define WM_GETDLGCODE 0x0087 +#define WM_SYNCPAINT 0x0088 +#define WM_NCMOUSEMOVE 0x00A0 +#define WM_NCLBUTTONDOWN 0x00A1 +#define WM_NCLBUTTONUP 0x00A2 +#define WM_NCLBUTTONDBLCLK 0x00A3 +#define WM_NCRBUTTONDOWN 0x00A4 +#define WM_NCRBUTTONUP 0x00A5 +#define WM_NCRBUTTONDBLCLK 0x00A6 +#define WM_NCMBUTTONDOWN 0x00A7 +#define WM_NCMBUTTONUP 0x00A8 +#define WM_NCMBUTTONDBLCLK 0x00A9 +#define WM_NCXBUTTONDOWN 0x00AB +#define WM_NCXBUTTONUP 0x00AC +#define WM_NCXBUTTONDBLCLK 0x00AD +#define WM_INPUT_DEVICE_CHANGE 0x00FE +#define WM_INPUT 0x00FF +#define WM_KEYFIRST 0x0100 +#define WM_KEYDOWN 0x0100 +#define WM_KEYUP 0x0101 +#define WM_CHAR 0x0102 +#define WM_DEADCHAR 0x0103 +#define WM_SYSKEYDOWN 0x0104 +#define WM_SYSKEYUP 0x0105 +#define WM_SYSCHAR 0x0106 +#define WM_SYSDEADCHAR 0x0107 +#define WM_UNICHAR 0x0109 +#define WM_KEYLAST 0x0109 +#define WM_IME_STARTCOMPOSITION 0x010D +#define WM_IME_ENDCOMPOSITION 0x010E +#define WM_IME_COMPOSITION 0x010F +#define WM_IME_KEYLAST 0x010F +#define WM_INITDIALOG 0x0110 +#define WM_COMMAND 0x0111 +#define WM_SYSCOMMAND 0x0112 +#define WM_TIMER 0x0113 +#define WM_HSCROLL 0x0114 +#define WM_VSCROLL 0x0115 +#define WM_INITMENU 0x0116 +#define WM_INITMENUPOPUP 0x0117 +#define WM_GESTURE 0x0119 +#define WM_GESTURENOTIFY 0x011A +#define WM_MENUSELECT 0x011F +#define WM_MENUCHAR 0x0120 +#define WM_ENTERIDLE 0x0121 +#define WM_MENURBUTTONUP 0x0122 +#define WM_MENUDRAG 0x0123 +#define WM_MENUGETOBJECT 0x0124 +#define WM_UNINITMENUPOPUP 0x0125 +#define WM_MENUCOMMAND 0x0126 +#define WM_CHANGEUISTATE 0x0127 +#define WM_UPDATEUISTATE 0x0128 +#define WM_QUERYUISTATE 0x0129 +#define WM_CTLCOLORMSGBOX 0x0132 +#define WM_CTLCOLOREDIT 0x0133 +#define WM_CTLCOLORLISTBOX 0x0134 +#define WM_CTLCOLORBTN 0x0135 +#define WM_CTLCOLORDLG 0x0136 +#define WM_CTLCOLORSCROLLBAR 0x0137 +#define WM_CTLCOLORSTATIC 0x0138 +#define WM_MOUSEFIRST 0x0200 +#define WM_MOUSEMOVE 0x0200 +#define WM_LBUTTONDOWN 0x0201 +#define WM_LBUTTONUP 0x0202 +#define WM_LBUTTONDBLCLK 0x0203 +#define WM_RBUTTONDOWN 0x0204 +#define WM_RBUTTONUP 0x0205 +#define WM_RBUTTONDBLCLK 0x0206 +#define WM_MBUTTONDOWN 0x0207 +#define WM_MBUTTONUP 0x0208 +#define WM_MBUTTONDBLCLK 0x0209 +#define WM_MOUSEWHEEL 0x020A +#define WM_XBUTTONDOWN 0x020B +#define WM_XBUTTONUP 0x020C +#define WM_XBUTTONDBLCLK 0x020D +#define WM_MOUSEHWHEEL 0x020E +#define WM_MOUSELAST 0x020E +#define WM_PARENTNOTIFY 0x0210 +#define WM_ENTERMENULOOP 0x0211 +#define WM_EXITMENULOOP 0x0212 +#define WM_NEXTMENU 0x0213 +#define WM_SIZING 0x0214 +#define WM_CAPTURECHANGED 0x0215 +#define WM_MOVING 0x0216 +#define WM_POWERBROADCAST 0x0218 +#define WM_DEVICECHANGE 0x0219 +#define WM_MDICREATE 0x0220 +#define WM_MDIDESTROY 0x0221 +#define WM_MDIACTIVATE 0x0222 +#define WM_MDIRESTORE 0x0223 +#define WM_MDINEXT 0x0224 +#define WM_MDIMAXIMIZE 0x0225 +#define WM_MDITILE 0x0226 +#define WM_MDICASCADE 0x0227 +#define WM_MDIICONARRANGE 0x0228 +#define WM_MDIGETACTIVE 0x0229 +#define WM_MDISETMENU 0x0230 +#define WM_ENTERSIZEMOVE 0x0231 +#define WM_EXITSIZEMOVE 0x0232 +#define WM_DROPFILES 0x0233 +#define WM_MDIREFRESHMENU 0x0234 +#define WM_POINTERDEVICECHANGE 0x0238 +#define WM_POINTERDEVICEINRANGE 0x0239 +#define WM_POINTERDEVICEOUTOFRANGE 0x023A +#define WM_TOUCH 0x0240 +#define WM_NCPOINTERUPDATE 0x0241 +#define WM_NCPOINTERDOWN 0x0242 +#define WM_NCPOINTERUP 0x0243 +#define WM_POINTERUPDATE 0x0245 +#define WM_POINTERDOWN 0x0246 +#define WM_POINTERUP 0x0247 +#define WM_POINTERENTER 0x0249 +#define WM_POINTERLEAVE 0x024A +#define WM_POINTERACTIVATE 0x024B +#define WM_POINTERCAPTURECHANGED 0x024C +#define WM_TOUCHHITTESTING 0x024D +#define WM_POINTERWHEEL 0x024E +#define WM_POINTERHWHEEL 0x024F +#define WM_IME_SETCONTEXT 0x0281 +#define WM_IME_NOTIFY 0x0282 +#define WM_IME_CONTROL 0x0283 +#define WM_IME_COMPOSITIONFULL 0x0284 +#define WM_IME_SELECT 0x0285 +#define WM_IME_CHAR 0x0286 +#define WM_IME_REQUEST 0x0288 +#define WM_IME_KEYDOWN 0x0290 +#define WM_IME_KEYUP 0x0291 +#define WM_MOUSEHOVER 0x02A1 +#define WM_MOUSELEAVE 0x02A3 +#define WM_NCMOUSEHOVER 0x02A0 +#define WM_NCMOUSELEAVE 0x02A2 +#define WM_WTSSESSION_CHANGE 0x02B1 +#define WM_TABLET_FIRST 0x02c0 +#define WM_TABLET_LAST 0x02df +#define WM_CUT 0x0300 +#define WM_COPY 0x0301 +#define WM_PASTE 0x0302 +#define WM_CLEAR 0x0303 +#define WM_UNDO 0x0304 +#define WM_RENDERFORMAT 0x0305 +#define WM_RENDERALLFORMATS 0x0306 +#define WM_DESTROYCLIPBOARD 0x0307 +#define WM_DRAWCLIPBOARD 0x0308 +#define WM_PAINTCLIPBOARD 0x0309 +#define WM_VSCROLLCLIPBOARD 0x030A +#define WM_SIZECLIPBOARD 0x030B +#define WM_ASKCBFORMATNAME 0x030C +#define WM_CHANGECBCHAIN 0x030D +#define WM_HSCROLLCLIPBOARD 0x030E +#define WM_QUERYNEWPALETTE 0x030F +#define WM_PALETTEISCHANGING 0x0310 +#define WM_PALETTECHANGED 0x0311 +#define WM_HOTKEY 0x0312 +#define WM_PRINT 0x0317 +#define WM_PRINTCLIENT 0x0318 +#define WM_APPCOMMAND 0x0319 +#define WM_THEMECHANGED 0x031A +#define WM_CLIPBOARDUPDATE 0x031D +#define WM_DWMCOMPOSITIONCHANGED 0x031E +#define WM_DWMNCRENDERINGCHANGED 0x031F +#define WM_DWMCOLORIZATIONCOLORCHANGED 0x0320 +#define WM_DWMWINDOWMAXIMIZEDCHANGE 0x0321 +#define WM_DWMSENDICONICTHUMBNAIL 0x0323 +#define WM_DWMSENDICONICLIVEPREVIEWBITMAP 0x0326 +#define WM_GETTITLEBARINFOEX 0x033F +#define WM_HANDHELDFIRST 0x0358 +#define WM_HANDHELDLAST 0x035F +#define WM_AFXFIRST 0x0360 +#define WM_AFXLAST 0x037F +#define WM_PENWINFIRST 0x0380 +#define WM_PENWINLAST 0x038F +#define WM_APP 0x8000 +#define WM_USER 0x0400 -#define HWND_BROADCAST ((HWND)0xFFFF) -#define HWND_MESSAGE ((HWND)-3) -#define HWND_DESKTOP ((HWND)0) -#define HWND_TOP ((HWND)0) -#define HWND_BOTTOM ((HWND)1) -#define HWND_TOPMOST ((HWND)-1) -#define HWND_NOTOPMOST ((HWND)-2) +#define HWND_BROADCAST ((HWND)0xFFFF) +#define HWND_MESSAGE ((HWND)-3) +#define HWND_DESKTOP ((HWND)0) +#define HWND_TOP ((HWND)0) +#define HWND_BOTTOM ((HWND)1) +#define HWND_TOPMOST ((HWND)-1) +#define HWND_NOTOPMOST ((HWND)-2) typedef WORD ATOM; typedef UINT_PTR WPARAM; @@ -291,7 +291,7 @@ typedef LONG_PTR LPARAM; typedef LONG_PTR LRESULT; typedef FARPROC SENDASYNCPROC; -typedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM); +typedef LRESULT(CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM); typedef struct tagWNDCLASSA { @@ -358,19 +358,19 @@ typedef WNDCLASSW WNDCLASS; typedef PWNDCLASSW PWNDCLASS; typedef NPWNDCLASSW NPWNDCLASS; typedef LPWNDCLASSW LPWNDCLASS; -typedef WNDCLASSEXW WNDCLASSEX; -typedef PWNDCLASSEXW PWNDCLASSEX; -typedef NPWNDCLASSEXW NPWNDCLASSEX; -typedef LPWNDCLASSEXW LPWNDCLASSEX; +typedef WNDCLASSEXW WNDCLASSEX; +typedef PWNDCLASSEXW PWNDCLASSEX; +typedef NPWNDCLASSEXW NPWNDCLASSEX; +typedef LPWNDCLASSEXW LPWNDCLASSEX; #else typedef WNDCLASSA WNDCLASS; typedef PWNDCLASSA PWNDCLASS; typedef NPWNDCLASSA NPWNDCLASS; typedef LPWNDCLASSA LPWNDCLASS; -typedef WNDCLASSEXA WNDCLASSEX; -typedef PWNDCLASSEXA PWNDCLASSEX; -typedef NPWNDCLASSEXA NPWNDCLASSEX; -typedef LPWNDCLASSEXA LPWNDCLASSEX; +typedef WNDCLASSEXA WNDCLASSEX; +typedef PWNDCLASSEXA PWNDCLASSEX; +typedef NPWNDCLASSEXA NPWNDCLASSEX; +typedef LPWNDCLASSEXA LPWNDCLASSEX; #endif typedef struct tagPOINT @@ -402,164 +402,181 @@ typedef struct tagWTSSESSION_NOTIFICATION DWORD dwSessionId; } WTSSESSION_NOTIFICATION, *PWTSSESSION_NOTIFICATION; -#define WTS_CONSOLE_CONNECT 0x1 -#define WTS_CONSOLE_DISCONNECT 0x2 -#define WTS_REMOTE_CONNECT 0x3 -#define WTS_REMOTE_DISCONNECT 0x4 -#define WTS_SESSION_LOGON 0x5 -#define WTS_SESSION_LOGOFF 0x6 -#define WTS_SESSION_LOCK 0x7 -#define WTS_SESSION_UNLOCK 0x8 -#define WTS_SESSION_REMOTE_CONTROL 0x9 -#define WTS_SESSION_CREATE 0xA -#define WTS_SESSION_TERMINATE 0xB +#define WTS_CONSOLE_CONNECT 0x1 +#define WTS_CONSOLE_DISCONNECT 0x2 +#define WTS_REMOTE_CONNECT 0x3 +#define WTS_REMOTE_DISCONNECT 0x4 +#define WTS_SESSION_LOGON 0x5 +#define WTS_SESSION_LOGOFF 0x6 +#define WTS_SESSION_LOCK 0x7 +#define WTS_SESSION_UNLOCK 0x8 +#define WTS_SESSION_REMOTE_CONTROL 0x9 +#define WTS_SESSION_CREATE 0xA +#define WTS_SESSION_TERMINATE 0xB #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API WORD WINAPI GetWindowWord(HWND hWnd, int nIndex); + WINPR_API WORD WINAPI GetWindowWord(HWND hWnd, int nIndex); -WINPR_API WORD WINAPI SetWindowWord(HWND hWnd, int nIndex, WORD wNewWord); + WINPR_API WORD WINAPI SetWindowWord(HWND hWnd, int nIndex, WORD wNewWord); -WINPR_API LONG WINAPI GetWindowLongA(HWND hWnd, int nIndex); -WINPR_API LONG WINAPI GetWindowLongW(HWND hWnd, int nIndex); + WINPR_API LONG WINAPI GetWindowLongA(HWND hWnd, int nIndex); + WINPR_API LONG WINAPI GetWindowLongW(HWND hWnd, int nIndex); -WINPR_API LONG WINAPI SetWindowLongA(HWND hWnd, int nIndex, LONG dwNewLong); -WINPR_API LONG WINAPI SetWindowLongW(HWND hWnd, int nIndex, LONG dwNewLong); + WINPR_API LONG WINAPI SetWindowLongA(HWND hWnd, int nIndex, LONG dwNewLong); + WINPR_API LONG WINAPI SetWindowLongW(HWND hWnd, int nIndex, LONG dwNewLong); -WINPR_API LONG_PTR WINAPI GetWindowLongPtrA(HWND hWnd, int nIndex); -WINPR_API LONG_PTR WINAPI GetWindowLongPtrW(HWND hWnd, int nIndex); + WINPR_API LONG_PTR WINAPI GetWindowLongPtrA(HWND hWnd, int nIndex); + WINPR_API LONG_PTR WINAPI GetWindowLongPtrW(HWND hWnd, int nIndex); -WINPR_API LONG_PTR WINAPI SetWindowLongPtrA(HWND hWnd, int nIndex, LONG_PTR dwNewLong); -WINPR_API LONG_PTR WINAPI SetWindowLongPtrW(HWND hWnd, int nIndex, LONG_PTR dwNewLong); + WINPR_API LONG_PTR WINAPI SetWindowLongPtrA(HWND hWnd, int nIndex, LONG_PTR dwNewLong); + WINPR_API LONG_PTR WINAPI SetWindowLongPtrW(HWND hWnd, int nIndex, LONG_PTR dwNewLong); -WINPR_API BOOL WINAPI DestroyWindow(HWND hWnd); + WINPR_API BOOL WINAPI DestroyWindow(HWND hWnd); -WINPR_API VOID WINAPI PostQuitMessage(int nExitCode); + WINPR_API VOID WINAPI PostQuitMessage(int nExitCode); -WINPR_API ATOM WINAPI RegisterClassA(CONST WNDCLASSA* lpWndClass); -WINPR_API ATOM WINAPI RegisterClassW(CONST WNDCLASSW* lpWndClass); + WINPR_API ATOM WINAPI RegisterClassA(CONST WNDCLASSA* lpWndClass); + WINPR_API ATOM WINAPI RegisterClassW(CONST WNDCLASSW* lpWndClass); -WINPR_API ATOM WINAPI RegisterClassExA(CONST WNDCLASSEXA* lpwcx); -WINPR_API ATOM WINAPI RegisterClassExW(CONST WNDCLASSEXW* lpwcx); + WINPR_API ATOM WINAPI RegisterClassExA(CONST WNDCLASSEXA* lpwcx); + WINPR_API ATOM WINAPI RegisterClassExW(CONST WNDCLASSEXW* lpwcx); -WINPR_API BOOL WINAPI UnregisterClassA(LPCSTR lpClassName, HINSTANCE hInstance); -WINPR_API BOOL WINAPI UnregisterClassW(LPCWSTR lpClassName, HINSTANCE hInstance); + WINPR_API BOOL WINAPI UnregisterClassA(LPCSTR lpClassName, HINSTANCE hInstance); + WINPR_API BOOL WINAPI UnregisterClassW(LPCWSTR lpClassName, HINSTANCE hInstance); -WINPR_API HWND WINAPI CreateWindowExA(DWORD dwExStyle, LPCSTR lpClassName, - LPCSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, - HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam); -WINPR_API HWND WINAPI CreateWindowExW(DWORD dwExStyle, LPCWSTR lpClassName, - LPCWSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, - HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam); + WINPR_API HWND WINAPI CreateWindowExA(DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName, + DWORD dwStyle, int X, int Y, int nWidth, int nHeight, + HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, + LPVOID lpParam); + WINPR_API HWND WINAPI CreateWindowExW(DWORD dwExStyle, LPCWSTR lpClassName, + LPCWSTR lpWindowName, DWORD dwStyle, int X, int Y, + int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, + HINSTANCE hInstance, LPVOID lpParam); #ifndef WINPR_NO_CREATE_WINDOW -#define CreateWindowA(lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam) \ - CreateWindowExA(0L, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam) -#define CreateWindowW(lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam) \ - CreateWindowExW(0L, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam) +#define CreateWindowA(lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, \ + hMenu, hInstance, lpParam) \ + CreateWindowExA(0L, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, \ + hMenu, hInstance, lpParam) +#define CreateWindowW(lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, \ + hMenu, hInstance, lpParam) \ + CreateWindowExW(0L, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, \ + hMenu, hInstance, lpParam) #endif -WINPR_API HWND WINAPI FindWindowA(LPCSTR lpClassName, LPCSTR lpWindowName); -WINPR_API HWND WINAPI FindWindowW(LPCWSTR lpClassName, LPCWSTR lpWindowName); + WINPR_API HWND WINAPI FindWindowA(LPCSTR lpClassName, LPCSTR lpWindowName); + WINPR_API HWND WINAPI FindWindowW(LPCWSTR lpClassName, LPCWSTR lpWindowName); -WINPR_API HWND WINAPI FindWindowExA(HWND hWndParent, HWND hWndChildAfter, LPCSTR lpszClass, LPCSTR lpszWindow); -WINPR_API HWND WINAPI FindWindowExW(HWND hWndParent, HWND hWndChildAfter, LPCWSTR lpszClass, LPCWSTR lpszWindow); + WINPR_API HWND WINAPI FindWindowExA(HWND hWndParent, HWND hWndChildAfter, LPCSTR lpszClass, + LPCSTR lpszWindow); + WINPR_API HWND WINAPI FindWindowExW(HWND hWndParent, HWND hWndChildAfter, LPCWSTR lpszClass, + LPCWSTR lpszWindow); -WINPR_API BOOL WINAPI GetMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax); -WINPR_API BOOL WINAPI GetMessageW(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax); + WINPR_API BOOL WINAPI GetMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, + UINT wMsgFilterMax); + WINPR_API BOOL WINAPI GetMessageW(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, + UINT wMsgFilterMax); -WINPR_API DWORD WINAPI GetMessagePos(VOID); + WINPR_API DWORD WINAPI GetMessagePos(VOID); -WINPR_API LONG WINAPI GetMessageTime(VOID); + WINPR_API LONG WINAPI GetMessageTime(VOID); -WINPR_API LPARAM WINAPI GetMessageExtraInfo(VOID); + WINPR_API LPARAM WINAPI GetMessageExtraInfo(VOID); -WINPR_API LPARAM WINAPI SetMessageExtraInfo(LPARAM lParam); + WINPR_API LPARAM WINAPI SetMessageExtraInfo(LPARAM lParam); -WINPR_API BOOL WINAPI SetMessageQueue(int cMessagesMax); + WINPR_API BOOL WINAPI SetMessageQueue(int cMessagesMax); -WINPR_API LRESULT WINAPI SendMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -WINPR_API LRESULT WINAPI SendMessageW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); + WINPR_API LRESULT WINAPI SendMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); + WINPR_API LRESULT WINAPI SendMessageW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -WINPR_API LRESULT WINAPI SendMessageTimeoutA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, - UINT fuFlags, UINT uTimeout, PDWORD_PTR lpdwResult); -WINPR_API LRESULT WINAPI SendMessageTimeoutW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, - UINT fuFlags, UINT uTimeout, PDWORD_PTR lpdwResult); + WINPR_API LRESULT WINAPI SendMessageTimeoutA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, + UINT fuFlags, UINT uTimeout, + PDWORD_PTR lpdwResult); + WINPR_API LRESULT WINAPI SendMessageTimeoutW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, + UINT fuFlags, UINT uTimeout, + PDWORD_PTR lpdwResult); -WINPR_API BOOL WINAPI SendNotifyMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -WINPR_API BOOL WINAPI SendNotifyMessageW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); + WINPR_API BOOL WINAPI SendNotifyMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); + WINPR_API BOOL WINAPI SendNotifyMessageW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -WINPR_API BOOL WINAPI SendMessageCallbackA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, - SENDASYNCPROC lpResultCallBack, ULONG_PTR dwData); -WINPR_API BOOL WINAPI SendMessageCallbackW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, - SENDASYNCPROC lpResultCallBack, ULONG_PTR dwData); + WINPR_API BOOL WINAPI SendMessageCallbackA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, + SENDASYNCPROC lpResultCallBack, ULONG_PTR dwData); + WINPR_API BOOL WINAPI SendMessageCallbackW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, + SENDASYNCPROC lpResultCallBack, ULONG_PTR dwData); -WINPR_API BOOL WINAPI TranslateMessage(CONST MSG* lpMsg); + WINPR_API BOOL WINAPI TranslateMessage(CONST MSG* lpMsg); -WINPR_API LRESULT WINAPI DispatchMessageA(CONST MSG* lpMsg); -WINPR_API LRESULT WINAPI DispatchMessageW(CONST MSG* lpMsg); + WINPR_API LRESULT WINAPI DispatchMessageA(CONST MSG* lpMsg); + WINPR_API LRESULT WINAPI DispatchMessageW(CONST MSG* lpMsg); -WINPR_API BOOL WINAPI PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg); -WINPR_API BOOL WINAPI PeekMessageW(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg); + WINPR_API BOOL WINAPI PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, + UINT wMsgFilterMax, UINT wRemoveMsg); + WINPR_API BOOL WINAPI PeekMessageW(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, + UINT wMsgFilterMax, UINT wRemoveMsg); -WINPR_API BOOL WINAPI ReplyMessage(LRESULT lResult); + WINPR_API BOOL WINAPI ReplyMessage(LRESULT lResult); -WINPR_API BOOL WINAPI WaitMessage(VOID); + WINPR_API BOOL WINAPI WaitMessage(VOID); -WINPR_API LRESULT WINAPI CallWindowProcA(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -WINPR_API LRESULT WINAPI CallWindowProcW(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); + WINPR_API LRESULT WINAPI CallWindowProcA(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, + WPARAM wParam, LPARAM lParam); + WINPR_API LRESULT WINAPI CallWindowProcW(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, + WPARAM wParam, LPARAM lParam); -WINPR_API LRESULT WINAPI DefWindowProcA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -WINPR_API LRESULT WINAPI DefWindowProcW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); + WINPR_API LRESULT WINAPI DefWindowProcA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); + WINPR_API LRESULT WINAPI DefWindowProcW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); #ifdef UNICODE -#define GetWindowLong GetWindowLongW -#define SetWindowLong SetWindowLongW -#define GetWindowLongPtr GetWindowLongPtrW -#define SetWindowLongPtr SetWindowLongPtrW -#define RegisterClass RegisterClassW -#define RegisterClassEx RegisterClassExW -#define UnregisterClass UnregisterClassW +#define GetWindowLong GetWindowLongW +#define SetWindowLong SetWindowLongW +#define GetWindowLongPtr GetWindowLongPtrW +#define SetWindowLongPtr SetWindowLongPtrW +#define RegisterClass RegisterClassW +#define RegisterClassEx RegisterClassExW +#define UnregisterClass UnregisterClassW #ifndef WINPR_NO_CREATE_WINDOW -#define CreateWindow CreateWindowW +#define CreateWindow CreateWindowW #endif -#define CreateWindowEx CreateWindowExW -#define FindWindow FindWindowW -#define FindWindowEx FindWindowExW -#define GetMessage GetMessageW -#define SendMessage SendMessageW -#define SendMessageTimeout SendMessageTimeoutW -#define SendNotifyMessage SendNotifyMessageW -#define SendMessageCallback SendMessageCallbackW -#define DispatchMessage DispatchMessageW -#define PeekMessage PeekMessageW -#define CallWindowProc CallWindowProcW -#define DefWindowProc DefWindowProcW +#define CreateWindowEx CreateWindowExW +#define FindWindow FindWindowW +#define FindWindowEx FindWindowExW +#define GetMessage GetMessageW +#define SendMessage SendMessageW +#define SendMessageTimeout SendMessageTimeoutW +#define SendNotifyMessage SendNotifyMessageW +#define SendMessageCallback SendMessageCallbackW +#define DispatchMessage DispatchMessageW +#define PeekMessage PeekMessageW +#define CallWindowProc CallWindowProcW +#define DefWindowProc DefWindowProcW #else -#define GetWindowLong GetWindowLongA -#define SetWindowLong SetWindowLongA -#define GetWindowLongPtr GetWindowLongPtrA -#define SetWindowLongPtr SetWindowLongPtrA -#define RegisterClass RegisterClassA -#define RegisterClassEx RegisterClassExA -#define UnregisterClass UnregisterClassA +#define GetWindowLong GetWindowLongA +#define SetWindowLong SetWindowLongA +#define GetWindowLongPtr GetWindowLongPtrA +#define SetWindowLongPtr SetWindowLongPtrA +#define RegisterClass RegisterClassA +#define RegisterClassEx RegisterClassExA +#define UnregisterClass UnregisterClassA #ifndef WINPR_NO_CREATE_WINDOW -#define CreateWindow CreateWindowA +#define CreateWindow CreateWindowA #endif -#define CreateWindowEx CreateWindowExA -#define FindWindow FindWindowA -#define FindWindowEx FindWindowExA -#define GetMessage GetMessageA -#define SendMessage SendMessageA -#define SendMessageTimeout SendMessageTimeoutA -#define SendNotifyMessage SendNotifyMessageA -#define SendMessageCallback SendMessageCallbackA -#define DispatchMessage DispatchMessageA -#define PeekMessage PeekMessageA -#define CallWindowProc CallWindowProcA -#define DefWindowProc DefWindowProcA +#define CreateWindowEx CreateWindowExA +#define FindWindow FindWindowA +#define FindWindowEx FindWindowExA +#define GetMessage GetMessageA +#define SendMessage SendMessageA +#define SendMessageTimeout SendMessageTimeoutA +#define SendNotifyMessage SendNotifyMessageA +#define SendMessageCallback SendMessageCallbackA +#define DispatchMessage DispatchMessageA +#define PeekMessage PeekMessageA +#define CallWindowProc CallWindowProcA +#define DefWindowProc DefWindowProcA #endif #ifdef __cplusplus @@ -569,12 +586,11 @@ WINPR_API LRESULT WINAPI DefWindowProcW(HWND hWnd, UINT Msg, WPARAM wParam, LPAR #endif #ifndef WTS_SESSION_CREATE -#define WTS_SESSION_CREATE 0xA +#define WTS_SESSION_CREATE 0xA #endif #ifndef WTS_SESSION_TERMINATE -#define WTS_SESSION_TERMINATE 0xB +#define WTS_SESSION_TERMINATE 0xB #endif #endif /* WINPR_WND_H */ - diff --git a/winpr/include/winpr/wtsapi.h b/winpr/include/winpr/wtsapi.h index dcdf8d381..21d86fef7 100644 --- a/winpr/include/winpr/wtsapi.h +++ b/winpr/include/winpr/wtsapi.h @@ -29,7 +29,7 @@ #ifdef _WIN32 -#define CurrentTime _CurrentTime /* Workaround for X11 "CurrentTime" header conflict */ +#define CurrentTime _CurrentTime /* Workaround for X11 "CurrentTime" header conflict */ #endif @@ -43,31 +43,31 @@ * Virtual Channel Protocol (pchannel.h) */ -#define CHANNEL_CHUNK_LENGTH 1600 +#define CHANNEL_CHUNK_LENGTH 1600 -#define CHANNEL_PDU_LENGTH (CHANNEL_CHUNK_LENGTH + sizeof(CHANNEL_PDU_HEADER)) +#define CHANNEL_PDU_LENGTH (CHANNEL_CHUNK_LENGTH + sizeof(CHANNEL_PDU_HEADER)) -#define CHANNEL_FLAG_FIRST 0x01 -#define CHANNEL_FLAG_LAST 0x02 -#define CHANNEL_FLAG_ONLY (CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST) -#define CHANNEL_FLAG_MIDDLE 0 -#define CHANNEL_FLAG_FAIL 0x100 +#define CHANNEL_FLAG_FIRST 0x01 +#define CHANNEL_FLAG_LAST 0x02 +#define CHANNEL_FLAG_ONLY (CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST) +#define CHANNEL_FLAG_MIDDLE 0 +#define CHANNEL_FLAG_FAIL 0x100 -#define CHANNEL_OPTION_INITIALIZED 0x80000000 +#define CHANNEL_OPTION_INITIALIZED 0x80000000 -#define CHANNEL_OPTION_ENCRYPT_RDP 0x40000000 -#define CHANNEL_OPTION_ENCRYPT_SC 0x20000000 -#define CHANNEL_OPTION_ENCRYPT_CS 0x10000000 -#define CHANNEL_OPTION_PRI_HIGH 0x08000000 -#define CHANNEL_OPTION_PRI_MED 0x04000000 -#define CHANNEL_OPTION_PRI_LOW 0x02000000 -#define CHANNEL_OPTION_COMPRESS_RDP 0x00800000 -#define CHANNEL_OPTION_COMPRESS 0x00400000 -#define CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000 -#define CHANNEL_OPTION_REMOTE_CONTROL_PERSISTENT 0x00100000 +#define CHANNEL_OPTION_ENCRYPT_RDP 0x40000000 +#define CHANNEL_OPTION_ENCRYPT_SC 0x20000000 +#define CHANNEL_OPTION_ENCRYPT_CS 0x10000000 +#define CHANNEL_OPTION_PRI_HIGH 0x08000000 +#define CHANNEL_OPTION_PRI_MED 0x04000000 +#define CHANNEL_OPTION_PRI_LOW 0x02000000 +#define CHANNEL_OPTION_COMPRESS_RDP 0x00800000 +#define CHANNEL_OPTION_COMPRESS 0x00400000 +#define CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000 +#define CHANNEL_OPTION_REMOTE_CONTROL_PERSISTENT 0x00100000 -#define CHANNEL_MAX_COUNT 31 -#define CHANNEL_NAME_LEN 7 +#define CHANNEL_MAX_COUNT 31 +#define CHANNEL_NAME_LEN 7 typedef struct tagCHANNEL_DEF { @@ -90,16 +90,16 @@ typedef struct tagCHANNEL_PDU_HEADER */ #ifndef CHANNEL_FLAG_SHOW_PROTOCOL -#define CHANNEL_FLAG_SHOW_PROTOCOL 0x10 +#define CHANNEL_FLAG_SHOW_PROTOCOL 0x10 #endif #ifndef CHANNEL_FLAG_SUSPEND -#define CHANNEL_FLAG_SUSPEND 0x20 +#define CHANNEL_FLAG_SUSPEND 0x20 #endif #ifndef CHANNEL_FLAG_RESUME -#define CHANNEL_FLAG_RESUME 0x40 +#define CHANNEL_FLAG_RESUME 0x40 #endif #ifndef CHANNEL_FLAG_SHADOW_PERSISTENT -#define CHANNEL_FLAG_SHADOW_PERSISTENT 0x80 +#define CHANNEL_FLAG_SHADOW_PERSISTENT 0x80 #endif #if !defined(_WIN32) || !defined(H_CCHANNEL) @@ -113,90 +113,90 @@ typedef struct tagCHANNEL_PDU_HEADER #define VCEXPORT #else #define VCAPITYPE CALLBACK -#define VCEXPORT __export +#define VCEXPORT __export #endif -typedef VOID VCAPITYPE CHANNEL_INIT_EVENT_FN(LPVOID pInitHandle, - UINT event, LPVOID pData, UINT dataLength); +typedef VOID VCAPITYPE CHANNEL_INIT_EVENT_FN(LPVOID pInitHandle, UINT event, LPVOID pData, + UINT dataLength); typedef CHANNEL_INIT_EVENT_FN* PCHANNEL_INIT_EVENT_FN; -typedef VOID VCAPITYPE CHANNEL_INIT_EVENT_EX_FN(LPVOID lpUserParam, - LPVOID pInitHandle, UINT event, LPVOID pData, UINT dataLength); +typedef VOID VCAPITYPE CHANNEL_INIT_EVENT_EX_FN(LPVOID lpUserParam, LPVOID pInitHandle, UINT event, + LPVOID pData, UINT dataLength); typedef CHANNEL_INIT_EVENT_EX_FN* PCHANNEL_INIT_EVENT_EX_FN; -#define CHANNEL_EVENT_INITIALIZED 0 -#define CHANNEL_EVENT_CONNECTED 1 -#define CHANNEL_EVENT_V1_CONNECTED 2 -#define CHANNEL_EVENT_DISCONNECTED 3 -#define CHANNEL_EVENT_TERMINATED 4 -#define CHANNEL_EVENT_REMOTE_CONTROL_START 5 -#define CHANNEL_EVENT_REMOTE_CONTROL_STOP 6 -#define CHANNEL_EVENT_ATTACHED 7 -#define CHANNEL_EVENT_DETACHED 8 -#define CHANNEL_EVENT_DATA_RECEIVED 10 -#define CHANNEL_EVENT_WRITE_COMPLETE 11 -#define CHANNEL_EVENT_WRITE_CANCELLED 12 +#define CHANNEL_EVENT_INITIALIZED 0 +#define CHANNEL_EVENT_CONNECTED 1 +#define CHANNEL_EVENT_V1_CONNECTED 2 +#define CHANNEL_EVENT_DISCONNECTED 3 +#define CHANNEL_EVENT_TERMINATED 4 +#define CHANNEL_EVENT_REMOTE_CONTROL_START 5 +#define CHANNEL_EVENT_REMOTE_CONTROL_STOP 6 +#define CHANNEL_EVENT_ATTACHED 7 +#define CHANNEL_EVENT_DETACHED 8 +#define CHANNEL_EVENT_DATA_RECEIVED 10 +#define CHANNEL_EVENT_WRITE_COMPLETE 11 +#define CHANNEL_EVENT_WRITE_CANCELLED 12 -typedef VOID VCAPITYPE CHANNEL_OPEN_EVENT_FN(DWORD openHandle, UINT event, - LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags); +typedef VOID VCAPITYPE CHANNEL_OPEN_EVENT_FN(DWORD openHandle, UINT event, LPVOID pData, + UINT32 dataLength, UINT32 totalLength, + UINT32 dataFlags); typedef CHANNEL_OPEN_EVENT_FN* PCHANNEL_OPEN_EVENT_FN; -typedef VOID VCAPITYPE CHANNEL_OPEN_EVENT_EX_FN(LPVOID lpUserParam, - DWORD openHandle, UINT event, - LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags); +typedef VOID VCAPITYPE CHANNEL_OPEN_EVENT_EX_FN(LPVOID lpUserParam, DWORD openHandle, UINT event, + LPVOID pData, UINT32 dataLength, UINT32 totalLength, + UINT32 dataFlags); typedef CHANNEL_OPEN_EVENT_EX_FN* PCHANNEL_OPEN_EVENT_EX_FN; -#define CHANNEL_RC_OK 0 -#define CHANNEL_RC_ALREADY_INITIALIZED 1 -#define CHANNEL_RC_NOT_INITIALIZED 2 -#define CHANNEL_RC_ALREADY_CONNECTED 3 -#define CHANNEL_RC_NOT_CONNECTED 4 -#define CHANNEL_RC_TOO_MANY_CHANNELS 5 -#define CHANNEL_RC_BAD_CHANNEL 6 -#define CHANNEL_RC_BAD_CHANNEL_HANDLE 7 -#define CHANNEL_RC_NO_BUFFER 8 -#define CHANNEL_RC_BAD_INIT_HANDLE 9 -#define CHANNEL_RC_NOT_OPEN 10 -#define CHANNEL_RC_BAD_PROC 11 -#define CHANNEL_RC_NO_MEMORY 12 -#define CHANNEL_RC_UNKNOWN_CHANNEL_NAME 13 -#define CHANNEL_RC_ALREADY_OPEN 14 -#define CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY 15 -#define CHANNEL_RC_NULL_DATA 16 -#define CHANNEL_RC_ZERO_LENGTH 17 -#define CHANNEL_RC_INVALID_INSTANCE 18 -#define CHANNEL_RC_UNSUPPORTED_VERSION 19 -#define CHANNEL_RC_INITIALIZATION_ERROR 20 +#define CHANNEL_RC_OK 0 +#define CHANNEL_RC_ALREADY_INITIALIZED 1 +#define CHANNEL_RC_NOT_INITIALIZED 2 +#define CHANNEL_RC_ALREADY_CONNECTED 3 +#define CHANNEL_RC_NOT_CONNECTED 4 +#define CHANNEL_RC_TOO_MANY_CHANNELS 5 +#define CHANNEL_RC_BAD_CHANNEL 6 +#define CHANNEL_RC_BAD_CHANNEL_HANDLE 7 +#define CHANNEL_RC_NO_BUFFER 8 +#define CHANNEL_RC_BAD_INIT_HANDLE 9 +#define CHANNEL_RC_NOT_OPEN 10 +#define CHANNEL_RC_BAD_PROC 11 +#define CHANNEL_RC_NO_MEMORY 12 +#define CHANNEL_RC_UNKNOWN_CHANNEL_NAME 13 +#define CHANNEL_RC_ALREADY_OPEN 14 +#define CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY 15 +#define CHANNEL_RC_NULL_DATA 16 +#define CHANNEL_RC_ZERO_LENGTH 17 +#define CHANNEL_RC_INVALID_INSTANCE 18 +#define CHANNEL_RC_UNSUPPORTED_VERSION 19 +#define CHANNEL_RC_INITIALIZATION_ERROR 20 -#define VIRTUAL_CHANNEL_VERSION_WIN2000 1 +#define VIRTUAL_CHANNEL_VERSION_WIN2000 1 -typedef UINT VCAPITYPE VIRTUALCHANNELINIT(LPVOID* ppInitHandle, - PCHANNEL_DEF pChannel, - INT channelCount, ULONG versionRequested, - PCHANNEL_INIT_EVENT_FN pChannelInitEventProc); +typedef UINT VCAPITYPE VIRTUALCHANNELINIT(LPVOID* ppInitHandle, PCHANNEL_DEF pChannel, + INT channelCount, ULONG versionRequested, + PCHANNEL_INIT_EVENT_FN pChannelInitEventProc); typedef VIRTUALCHANNELINIT* PVIRTUALCHANNELINIT; typedef UINT VCAPITYPE VIRTUALCHANNELINITEX(LPVOID lpUserParam, LPVOID clientContext, - LPVOID pInitHandle, PCHANNEL_DEF pChannel, - INT channelCount, ULONG versionRequested, - PCHANNEL_INIT_EVENT_EX_FN pChannelInitEventProcEx); + LPVOID pInitHandle, PCHANNEL_DEF pChannel, + INT channelCount, ULONG versionRequested, + PCHANNEL_INIT_EVENT_EX_FN pChannelInitEventProcEx); typedef VIRTUALCHANNELINITEX* PVIRTUALCHANNELINITEX; -typedef UINT VCAPITYPE VIRTUALCHANNELOPEN(LPVOID pInitHandle, - LPDWORD pOpenHandle, - PCHAR pChannelName, PCHANNEL_OPEN_EVENT_FN pChannelOpenEventProc); +typedef UINT VCAPITYPE VIRTUALCHANNELOPEN(LPVOID pInitHandle, LPDWORD pOpenHandle, + PCHAR pChannelName, + PCHANNEL_OPEN_EVENT_FN pChannelOpenEventProc); typedef VIRTUALCHANNELOPEN* PVIRTUALCHANNELOPEN; -typedef UINT VCAPITYPE VIRTUALCHANNELOPENEX(LPVOID pInitHandle, - LPDWORD pOpenHandle, - PCHAR pChannelName, PCHANNEL_OPEN_EVENT_EX_FN pChannelOpenEventProcEx); +typedef UINT VCAPITYPE VIRTUALCHANNELOPENEX(LPVOID pInitHandle, LPDWORD pOpenHandle, + PCHAR pChannelName, + PCHANNEL_OPEN_EVENT_EX_FN pChannelOpenEventProcEx); typedef VIRTUALCHANNELOPENEX* PVIRTUALCHANNELOPENEX; @@ -204,19 +204,17 @@ typedef UINT VCAPITYPE VIRTUALCHANNELCLOSE(DWORD openHandle); typedef VIRTUALCHANNELCLOSE* PVIRTUALCHANNELCLOSE; -typedef UINT VCAPITYPE VIRTUALCHANNELCLOSEEX(LPVOID pInitHandle, - DWORD openHandle); +typedef UINT VCAPITYPE VIRTUALCHANNELCLOSEEX(LPVOID pInitHandle, DWORD openHandle); typedef VIRTUALCHANNELCLOSEEX* PVIRTUALCHANNELCLOSEEX; -typedef UINT VCAPITYPE VIRTUALCHANNELWRITE(DWORD openHandle, - LPVOID pData, ULONG dataLength, LPVOID pUserData); +typedef UINT VCAPITYPE VIRTUALCHANNELWRITE(DWORD openHandle, LPVOID pData, ULONG dataLength, + LPVOID pUserData); typedef VIRTUALCHANNELWRITE* PVIRTUALCHANNELWRITE; -typedef UINT VCAPITYPE VIRTUALCHANNELWRITEEX(LPVOID pInitHandle, - DWORD openHandle, - LPVOID pData, ULONG dataLength, LPVOID pUserData); +typedef UINT VCAPITYPE VIRTUALCHANNELWRITEEX(LPVOID pInitHandle, DWORD openHandle, LPVOID pData, + ULONG dataLength, LPVOID pUserData); typedef VIRTUALCHANNELWRITEEX* PVIRTUALCHANNELWRITEEX; @@ -244,13 +242,12 @@ typedef BOOL VCAPITYPE VIRTUALCHANNELENTRY(PCHANNEL_ENTRY_POINTS pEntryPoints); typedef VIRTUALCHANNELENTRY* PVIRTUALCHANNELENTRY; -typedef BOOL VCAPITYPE VIRTUALCHANNELENTRYEX(PCHANNEL_ENTRY_POINTS_EX - pEntryPointsEx, PVOID pInitHandle); +typedef BOOL VCAPITYPE VIRTUALCHANNELENTRYEX(PCHANNEL_ENTRY_POINTS_EX pEntryPointsEx, + PVOID pInitHandle); typedef VIRTUALCHANNELENTRYEX* PVIRTUALCHANNELENTRYEX; -typedef HRESULT(VCAPITYPE* PFNVCAPIGETINSTANCE)(REFIID refiid, PULONG pNumObjs, - PVOID* ppObjArray); +typedef HRESULT(VCAPITYPE* PFNVCAPIGETINSTANCE)(REFIID refiid, PULONG pNumObjs, PVOID* ppObjArray); #endif @@ -260,65 +257,65 @@ typedef HRESULT(VCAPITYPE* PFNVCAPIGETINSTANCE)(REFIID refiid, PULONG pNumObjs, * Windows Terminal Services API (wtsapi32.h) */ -#define WTS_CURRENT_SERVER ((HANDLE)NULL) -#define WTS_CURRENT_SERVER_HANDLE ((HANDLE)NULL) -#define WTS_CURRENT_SERVER_NAME (NULL) +#define WTS_CURRENT_SERVER ((HANDLE)NULL) +#define WTS_CURRENT_SERVER_HANDLE ((HANDLE)NULL) +#define WTS_CURRENT_SERVER_NAME (NULL) -#define WTS_CURRENT_SESSION ((DWORD)-1) +#define WTS_CURRENT_SESSION ((DWORD)-1) -#define WTS_ANY_SESSION ((DWORD)-2) +#define WTS_ANY_SESSION ((DWORD)-2) -#define IDTIMEOUT 32000 -#define IDASYNC 32001 +#define IDTIMEOUT 32000 +#define IDASYNC 32001 -#define USERNAME_LENGTH 20 -#define CLIENTNAME_LENGTH 20 -#define CLIENTADDRESS_LENGTH 30 +#define USERNAME_LENGTH 20 +#define CLIENTNAME_LENGTH 20 +#define CLIENTADDRESS_LENGTH 30 -#define WTS_WSD_LOGOFF 0x00000001 -#define WTS_WSD_SHUTDOWN 0x00000002 -#define WTS_WSD_REBOOT 0x00000004 -#define WTS_WSD_POWEROFF 0x00000008 -#define WTS_WSD_FASTREBOOT 0x00000010 +#define WTS_WSD_LOGOFF 0x00000001 +#define WTS_WSD_SHUTDOWN 0x00000002 +#define WTS_WSD_REBOOT 0x00000004 +#define WTS_WSD_POWEROFF 0x00000008 +#define WTS_WSD_FASTREBOOT 0x00000010 -#define MAX_ELAPSED_TIME_LENGTH 15 -#define MAX_DATE_TIME_LENGTH 56 -#define WINSTATIONNAME_LENGTH 32 -#define DOMAIN_LENGTH 17 +#define MAX_ELAPSED_TIME_LENGTH 15 +#define MAX_DATE_TIME_LENGTH 56 +#define WINSTATIONNAME_LENGTH 32 +#define DOMAIN_LENGTH 17 -#define WTS_DRIVE_LENGTH 3 -#define WTS_LISTENER_NAME_LENGTH 32 -#define WTS_COMMENT_LENGTH 60 +#define WTS_DRIVE_LENGTH 3 +#define WTS_LISTENER_NAME_LENGTH 32 +#define WTS_COMMENT_LENGTH 60 -#define WTS_LISTENER_CREATE 0x00000001 -#define WTS_LISTENER_UPDATE 0x00000010 +#define WTS_LISTENER_CREATE 0x00000001 +#define WTS_LISTENER_UPDATE 0x00000010 -#define WTS_SECURITY_QUERY_INFORMATION 0x00000001 -#define WTS_SECURITY_SET_INFORMATION 0x00000002 -#define WTS_SECURITY_RESET 0x00000004 -#define WTS_SECURITY_VIRTUAL_CHANNELS 0x00000008 -#define WTS_SECURITY_REMOTE_CONTROL 0x00000010 -#define WTS_SECURITY_LOGON 0x00000020 -#define WTS_SECURITY_LOGOFF 0x00000040 -#define WTS_SECURITY_MESSAGE 0x00000080 -#define WTS_SECURITY_CONNECT 0x00000100 -#define WTS_SECURITY_DISCONNECT 0x00000200 +#define WTS_SECURITY_QUERY_INFORMATION 0x00000001 +#define WTS_SECURITY_SET_INFORMATION 0x00000002 +#define WTS_SECURITY_RESET 0x00000004 +#define WTS_SECURITY_VIRTUAL_CHANNELS 0x00000008 +#define WTS_SECURITY_REMOTE_CONTROL 0x00000010 +#define WTS_SECURITY_LOGON 0x00000020 +#define WTS_SECURITY_LOGOFF 0x00000040 +#define WTS_SECURITY_MESSAGE 0x00000080 +#define WTS_SECURITY_CONNECT 0x00000100 +#define WTS_SECURITY_DISCONNECT 0x00000200 -#define WTS_SECURITY_GUEST_ACCESS (WTS_SECURITY_LOGON) +#define WTS_SECURITY_GUEST_ACCESS (WTS_SECURITY_LOGON) -#define WTS_SECURITY_CURRENT_GUEST_ACCESS (WTS_SECURITY_VIRTUAL_CHANNELS | WTS_SECURITY_LOGOFF) +#define WTS_SECURITY_CURRENT_GUEST_ACCESS (WTS_SECURITY_VIRTUAL_CHANNELS | WTS_SECURITY_LOGOFF) -#define WTS_SECURITY_USER_ACCESS (WTS_SECURITY_CURRENT_GUEST_ACCESS | WTS_SECURITY_QUERY_INFORMATION | WTS_SECURITY_CONNECT) +#define WTS_SECURITY_USER_ACCESS \ + (WTS_SECURITY_CURRENT_GUEST_ACCESS | WTS_SECURITY_QUERY_INFORMATION | WTS_SECURITY_CONNECT) -#define WTS_SECURITY_CURRENT_USER_ACCESS (WTS_SECURITY_SET_INFORMATION | WTS_SECURITY_RESET \ - WTS_SECURITY_VIRTUAL_CHANNELS | WTS_SECURITY_LOGOFF \ - WTS_SECURITY_DISCONNECT) +#define WTS_SECURITY_CURRENT_USER_ACCESS \ + (WTS_SECURITY_SET_INFORMATION | WTS_SECURITY_RESET WTS_SECURITY_VIRTUAL_CHANNELS | \ + WTS_SECURITY_LOGOFF WTS_SECURITY_DISCONNECT) -#define WTS_SECURITY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | WTS_SECURITY_QUERY_INFORMATION | \ - WTS_SECURITY_SET_INFORMATION | WTS_SECURITY_RESET | \ - WTS_SECURITY_VIRTUAL_CHANNELS | WTS_SECURITY_REMOTE_CONTROL | \ - WTS_SECURITY_LOGON | WTS_SECURITY_MESSAGE | \ - WTS_SECURITY_CONNECT | WTS_SECURITY_DISCONNECT) +#define WTS_SECURITY_ALL_ACCESS \ + (STANDARD_RIGHTS_REQUIRED | WTS_SECURITY_QUERY_INFORMATION | WTS_SECURITY_SET_INFORMATION | \ + WTS_SECURITY_RESET | WTS_SECURITY_VIRTUAL_CHANNELS | WTS_SECURITY_REMOTE_CONTROL | \ + WTS_SECURITY_LOGON | WTS_SECURITY_MESSAGE | WTS_SECURITY_CONNECT | WTS_SECURITY_DISCONNECT) typedef enum _WTS_CONNECTSTATE_CLASS { @@ -398,9 +395,9 @@ typedef struct _WTS_PROCESS_INFOA PSID pUserSid; } WTS_PROCESS_INFOA, *PWTS_PROCESS_INFOA; -#define WTS_PROTOCOL_TYPE_CONSOLE 0 -#define WTS_PROTOCOL_TYPE_ICA 1 -#define WTS_PROTOCOL_TYPE_RDP 2 +#define WTS_PROTOCOL_TYPE_CONSOLE 0 +#define WTS_PROTOCOL_TYPE_ICA 1 +#define WTS_PROTOCOL_TYPE_RDP 2 typedef enum _WTS_INFO_CLASS { @@ -436,7 +433,7 @@ typedef enum _WTS_INFO_CLASS WTSIsRemoteSession } WTS_INFO_CLASS; -typedef struct _WTSCONFIGINFOW +typedef struct _WTSCONFIGINFOW { ULONG version; ULONG fConnectClientDrivesAtLogon; @@ -451,7 +448,7 @@ typedef struct _WTSCONFIGINFOW WCHAR ApplicationName[MAX_PATH + 1]; } WTSCONFIGINFOW, *PWTSCONFIGINFOW; -typedef struct _WTSCONFIGINFOA +typedef struct _WTSCONFIGINFOA { ULONG version; ULONG fConnectClientDrivesAtLogon; @@ -506,9 +503,9 @@ typedef struct _WTSINFOA LARGE_INTEGER _CurrentTime; /* Conflicts with X11 headers */ } WTSINFOA, *PWTSINFOA; -#define WTS_SESSIONSTATE_UNKNOWN 0xFFFFFFFF -#define WTS_SESSIONSTATE_LOCK 0x00000000 -#define WTS_SESSIONSTATE_UNLOCK 0x00000001 +#define WTS_SESSIONSTATE_UNKNOWN 0xFFFFFFFF +#define WTS_SESSIONSTATE_LOCK 0x00000000 +#define WTS_SESSIONSTATE_UNLOCK 0x00000001 typedef struct _WTSINFOEX_LEVEL1_W { @@ -552,13 +549,11 @@ typedef struct _WTSINFOEX_LEVEL1_A DWORD OutgoingCompressedBytes; } WTSINFOEX_LEVEL1_A, *PWTSINFOEX_LEVEL1_A; -typedef union _WTSINFOEX_LEVEL_W -{ +typedef union _WTSINFOEX_LEVEL_W { WTSINFOEX_LEVEL1_W WTSInfoExLevel1; } WTSINFOEX_LEVEL_W, *PWTSINFOEX_LEVEL_W; -typedef union _WTSINFOEX_LEVEL_A -{ +typedef union _WTSINFOEX_LEVEL_A { WTSINFOEX_LEVEL1_A WTSInfoExLevel1; } WTSINFOEX_LEVEL_A, *PWTSINFOEX_LEVEL_A; @@ -620,8 +615,8 @@ typedef struct _WTSCLIENTA CHAR DeviceId[MAX_PATH + 1]; } WTSCLIENTA, *PWTSCLIENTA; -#define PRODUCTINFO_COMPANYNAME_LENGTH 256 -#define PRODUCTINFO_PRODUCTID_LENGTH 4 +#define PRODUCTINFO_COMPANYNAME_LENGTH 256 +#define PRODUCTINFO_PRODUCTID_LENGTH 4 typedef struct _WTS_PRODUCT_INFOA { @@ -635,8 +630,8 @@ typedef struct _WTS_PRODUCT_INFOW WCHAR ProductID[PRODUCTINFO_PRODUCTID_LENGTH]; } PRODUCT_INFOW; -#define VALIDATIONINFORMATION_LICENSE_LENGTH 16384 -#define VALIDATIONINFORMATION_HARDWAREID_LENGTH 20 +#define VALIDATIONINFORMATION_LICENSE_LENGTH 16384 +#define VALIDATIONINFORMATION_HARDWAREID_LENGTH 20 typedef struct _WTS_VALIDATION_INFORMATIONA { @@ -742,22 +737,22 @@ typedef struct _WTSUSERCONFIGW WCHAR TerminalServerHomeDirDrive[WTS_DRIVE_LENGTH + 1]; } WTSUSERCONFIGW, *PWTSUSERCONFIGW; -#define WTS_EVENT_NONE 0x00000000 -#define WTS_EVENT_CREATE 0x00000001 -#define WTS_EVENT_DELETE 0x00000002 -#define WTS_EVENT_RENAME 0x00000004 -#define WTS_EVENT_CONNECT 0x00000008 -#define WTS_EVENT_DISCONNECT 0x00000010 -#define WTS_EVENT_LOGON 0x00000020 -#define WTS_EVENT_LOGOFF 0x00000040 -#define WTS_EVENT_STATECHANGE 0x00000080 -#define WTS_EVENT_LICENSE 0x00000100 -#define WTS_EVENT_ALL 0x7FFFFFFF -#define WTS_EVENT_FLUSH 0x80000000 +#define WTS_EVENT_NONE 0x00000000 +#define WTS_EVENT_CREATE 0x00000001 +#define WTS_EVENT_DELETE 0x00000002 +#define WTS_EVENT_RENAME 0x00000004 +#define WTS_EVENT_CONNECT 0x00000008 +#define WTS_EVENT_DISCONNECT 0x00000010 +#define WTS_EVENT_LOGON 0x00000020 +#define WTS_EVENT_LOGOFF 0x00000040 +#define WTS_EVENT_STATECHANGE 0x00000080 +#define WTS_EVENT_LICENSE 0x00000100 +#define WTS_EVENT_ALL 0x7FFFFFFF +#define WTS_EVENT_FLUSH 0x80000000 -#define REMOTECONTROL_KBDSHIFT_HOTKEY 0x1 -#define REMOTECONTROL_KBDCTRL_HOTKEY 0x2 -#define REMOTECONTROL_KBDALT_HOTKEY 0x4 +#define REMOTECONTROL_KBDSHIFT_HOTKEY 0x1 +#define REMOTECONTROL_KBDCTRL_HOTKEY 0x2 +#define REMOTECONTROL_KBDALT_HOTKEY 0x4 typedef enum _WTS_VIRTUAL_CLASS { @@ -773,18 +768,18 @@ typedef struct _WTS_SESSION_ADDRESS BYTE Address[20]; } WTS_SESSION_ADDRESS, *PWTS_SESSION_ADDRESS; -#define WTS_CHANNEL_OPTION_DYNAMIC 0x00000001 -#define WTS_CHANNEL_OPTION_DYNAMIC_PRI_LOW 0x00000000 -#define WTS_CHANNEL_OPTION_DYNAMIC_PRI_MED 0x00000002 -#define WTS_CHANNEL_OPTION_DYNAMIC_PRI_HIGH 0x00000004 -#define WTS_CHANNEL_OPTION_DYNAMIC_PRI_REAL 0x00000006 -#define WTS_CHANNEL_OPTION_DYNAMIC_NO_COMPRESS 0x00000008 +#define WTS_CHANNEL_OPTION_DYNAMIC 0x00000001 +#define WTS_CHANNEL_OPTION_DYNAMIC_PRI_LOW 0x00000000 +#define WTS_CHANNEL_OPTION_DYNAMIC_PRI_MED 0x00000002 +#define WTS_CHANNEL_OPTION_DYNAMIC_PRI_HIGH 0x00000004 +#define WTS_CHANNEL_OPTION_DYNAMIC_PRI_REAL 0x00000006 +#define WTS_CHANNEL_OPTION_DYNAMIC_NO_COMPRESS 0x00000008 -#define NOTIFY_FOR_ALL_SESSIONS 1 -#define NOTIFY_FOR_THIS_SESSION 0 +#define NOTIFY_FOR_ALL_SESSIONS 1 +#define NOTIFY_FOR_THIS_SESSION 0 -#define WTS_PROCESS_INFO_LEVEL_0 0 -#define WTS_PROCESS_INFO_LEVEL_1 1 +#define WTS_PROCESS_INFO_LEVEL_0 0 +#define WTS_PROCESS_INFO_LEVEL_1 1 typedef struct _WTS_PROCESS_INFO_EXW { @@ -901,310 +896,316 @@ typedef struct _WTSLISTENERCONFIGA } WTSLISTENERCONFIGA, *PWTSLISTENERCONFIGA; #ifdef UNICODE -#define WTS_SERVER_INFO WTS_SERVER_INFOW -#define PWTS_SERVER_INFO PWTS_SERVER_INFOW -#define WTS_SESSION_INFO WTS_SESSION_INFOW -#define PWTS_SESSION_INFO PWTS_SESSION_INFOW -#define WTS_SESSION_INFO_1 WTS_SESSION_INFO_1W -#define PWTS_SESSION_INFO_1 PWTS_SESSION_INFO_1W -#define WTS_PROCESS_INFO WTS_PROCESS_INFOW -#define PWTS_PROCESS_INFO PWTS_PROCESS_INFOW -#define WTSCONFIGINFO WTSCONFIGINFOW -#define PWTSCONFIGINFO PWTSCONFIGINFOW -#define WTSINFO WTSINFOW -#define PWTSINFO PWTSINFOW -#define WTSINFOEX WTSINFOEXW -#define PWTSINFOEX PWTSINFOEXW -#define WTSINFOEX_LEVEL WTSINFOEX_LEVEL_W -#define PWTSINFOEX_LEVEL PWTSINFOEX_LEVEL_W -#define WTSINFOEX_LEVEL1 WTSINFOEX_LEVEL1_W -#define PWTSINFOEX_LEVEL1 PWTSINFOEX_LEVEL1_W -#define WTSCLIENT WTSCLIENTW -#define PWTSCLIENT PWTSCLIENTW -#define PRODUCT_INFO PRODUCT_INFOW -#define WTS_VALIDATION_INFORMATION WTS_VALIDATION_INFORMATIONW -#define PWTS_VALIDATION_INFORMATION PWTS_VALIDATION_INFORMATIONW -#define WTSUSERCONFIG WTSUSERCONFIGW -#define PWTSUSERCONFIG PWTSUSERCONFIGW -#define WTS_PROCESS_INFO_EX WTS_PROCESS_INFO_EXW -#define PWTS_PROCESS_INFO_EX PWTS_PROCESS_INFO_EXW -#define WTSLISTENERNAME WTSLISTENERNAMEW -#define PWTSLISTENERNAME PWTSLISTENERNAMEW -#define WTSLISTENERCONFIG WTSLISTENERCONFIGW -#define PWTSLISTENERCONFIG PWTSLISTENERCONFIGW +#define WTS_SERVER_INFO WTS_SERVER_INFOW +#define PWTS_SERVER_INFO PWTS_SERVER_INFOW +#define WTS_SESSION_INFO WTS_SESSION_INFOW +#define PWTS_SESSION_INFO PWTS_SESSION_INFOW +#define WTS_SESSION_INFO_1 WTS_SESSION_INFO_1W +#define PWTS_SESSION_INFO_1 PWTS_SESSION_INFO_1W +#define WTS_PROCESS_INFO WTS_PROCESS_INFOW +#define PWTS_PROCESS_INFO PWTS_PROCESS_INFOW +#define WTSCONFIGINFO WTSCONFIGINFOW +#define PWTSCONFIGINFO PWTSCONFIGINFOW +#define WTSINFO WTSINFOW +#define PWTSINFO PWTSINFOW +#define WTSINFOEX WTSINFOEXW +#define PWTSINFOEX PWTSINFOEXW +#define WTSINFOEX_LEVEL WTSINFOEX_LEVEL_W +#define PWTSINFOEX_LEVEL PWTSINFOEX_LEVEL_W +#define WTSINFOEX_LEVEL1 WTSINFOEX_LEVEL1_W +#define PWTSINFOEX_LEVEL1 PWTSINFOEX_LEVEL1_W +#define WTSCLIENT WTSCLIENTW +#define PWTSCLIENT PWTSCLIENTW +#define PRODUCT_INFO PRODUCT_INFOW +#define WTS_VALIDATION_INFORMATION WTS_VALIDATION_INFORMATIONW +#define PWTS_VALIDATION_INFORMATION PWTS_VALIDATION_INFORMATIONW +#define WTSUSERCONFIG WTSUSERCONFIGW +#define PWTSUSERCONFIG PWTSUSERCONFIGW +#define WTS_PROCESS_INFO_EX WTS_PROCESS_INFO_EXW +#define PWTS_PROCESS_INFO_EX PWTS_PROCESS_INFO_EXW +#define WTSLISTENERNAME WTSLISTENERNAMEW +#define PWTSLISTENERNAME PWTSLISTENERNAMEW +#define WTSLISTENERCONFIG WTSLISTENERCONFIGW +#define PWTSLISTENERCONFIG PWTSLISTENERCONFIGW #else -#define WTS_SERVER_INFO WTS_SERVER_INFOA -#define PWTS_SERVER_INFO PWTS_SERVER_INFOA -#define WTS_SESSION_INFO WTS_SESSION_INFOA -#define PWTS_SESSION_INFO PWTS_SESSION_INFOA -#define WTS_SESSION_INFO_1 WTS_SESSION_INFO_1A -#define PWTS_SESSION_INFO_1 PWTS_SESSION_INFO_1A -#define WTS_PROCESS_INFO WTS_PROCESS_INFOA -#define PWTS_PROCESS_INFO PWTS_PROCESS_INFOA -#define WTSCONFIGINFO WTSCONFIGINFOA -#define PWTSCONFIGINFO PWTSCONFIGINFOA -#define WTSINFO WTSINFOA -#define PWTSINFO PWTSINFOA -#define WTSINFOEX WTSINFOEXA -#define PWTSINFOEX PWTSINFOEXA -#define WTSINFOEX_LEVEL WTSINFOEX_LEVEL_A -#define PWTSINFOEX_LEVEL PWTSINFOEX_LEVEL_A -#define WTSINFOEX_LEVEL1 WTSINFOEX_LEVEL1_A -#define PWTSINFOEX_LEVEL1 PWTSINFOEX_LEVEL1_A -#define WTSCLIENT WTSCLIENTA -#define PWTSCLIENT PWTSCLIENTA -#define PRODUCT_INFO PRODUCT_INFOA -#define WTS_VALIDATION_INFORMATION WTS_VALIDATION_INFORMATIONA -#define PWTS_VALIDATION_INFORMATION PWTS_VALIDATION_INFORMATIONA -#define WTSUSERCONFIG WTSUSERCONFIGA -#define PWTSUSERCONFIG PWTSUSERCONFIGA -#define WTS_PROCESS_INFO_EX WTS_PROCESS_INFO_EXA -#define PWTS_PROCESS_INFO_EX PWTS_PROCESS_INFO_EXA -#define WTSLISTENERNAME WTSLISTENERNAMEA -#define PWTSLISTENERNAME PWTSLISTENERNAMEA -#define WTSLISTENERCONFIG WTSLISTENERCONFIGA -#define PWTSLISTENERCONFIG PWTSLISTENERCONFIGA +#define WTS_SERVER_INFO WTS_SERVER_INFOA +#define PWTS_SERVER_INFO PWTS_SERVER_INFOA +#define WTS_SESSION_INFO WTS_SESSION_INFOA +#define PWTS_SESSION_INFO PWTS_SESSION_INFOA +#define WTS_SESSION_INFO_1 WTS_SESSION_INFO_1A +#define PWTS_SESSION_INFO_1 PWTS_SESSION_INFO_1A +#define WTS_PROCESS_INFO WTS_PROCESS_INFOA +#define PWTS_PROCESS_INFO PWTS_PROCESS_INFOA +#define WTSCONFIGINFO WTSCONFIGINFOA +#define PWTSCONFIGINFO PWTSCONFIGINFOA +#define WTSINFO WTSINFOA +#define PWTSINFO PWTSINFOA +#define WTSINFOEX WTSINFOEXA +#define PWTSINFOEX PWTSINFOEXA +#define WTSINFOEX_LEVEL WTSINFOEX_LEVEL_A +#define PWTSINFOEX_LEVEL PWTSINFOEX_LEVEL_A +#define WTSINFOEX_LEVEL1 WTSINFOEX_LEVEL1_A +#define PWTSINFOEX_LEVEL1 PWTSINFOEX_LEVEL1_A +#define WTSCLIENT WTSCLIENTA +#define PWTSCLIENT PWTSCLIENTA +#define PRODUCT_INFO PRODUCT_INFOA +#define WTS_VALIDATION_INFORMATION WTS_VALIDATION_INFORMATIONA +#define PWTS_VALIDATION_INFORMATION PWTS_VALIDATION_INFORMATIONA +#define WTSUSERCONFIG WTSUSERCONFIGA +#define PWTSUSERCONFIG PWTSUSERCONFIGA +#define WTS_PROCESS_INFO_EX WTS_PROCESS_INFO_EXA +#define PWTS_PROCESS_INFO_EX PWTS_PROCESS_INFO_EXA +#define WTSLISTENERNAME WTSLISTENERNAMEA +#define PWTSLISTENERNAME PWTSLISTENERNAMEA +#define WTSLISTENERCONFIG WTSLISTENERCONFIGA +#define PWTSLISTENERCONFIG PWTSLISTENERCONFIGA #endif -#define REMOTECONTROL_FLAG_DISABLE_KEYBOARD 0x00000001 -#define REMOTECONTROL_FLAG_DISABLE_MOUSE 0x00000002 -#define REMOTECONTROL_FLAG_DISABLE_INPUT REMOTECONTROL_FLAG_DISABLE_KEYBOARD | REMOTECONTROL_FLAG_DISABLE_MOUSE +#define REMOTECONTROL_FLAG_DISABLE_KEYBOARD 0x00000001 +#define REMOTECONTROL_FLAG_DISABLE_MOUSE 0x00000002 +#define REMOTECONTROL_FLAG_DISABLE_INPUT \ + REMOTECONTROL_FLAG_DISABLE_KEYBOARD | REMOTECONTROL_FLAG_DISABLE_MOUSE #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API BOOL WINAPI WTSStopRemoteControlSession(ULONG LogonId); + WINPR_API BOOL WINAPI WTSStopRemoteControlSession(ULONG LogonId); -WINPR_API BOOL WINAPI WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, - ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers); -WINPR_API BOOL WINAPI WTSStartRemoteControlSessionA(LPSTR pTargetServerName, - ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers); + WINPR_API BOOL WINAPI WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, + ULONG TargetLogonId, BYTE HotkeyVk, + USHORT HotkeyModifiers); + WINPR_API BOOL WINAPI WTSStartRemoteControlSessionA(LPSTR pTargetServerName, + ULONG TargetLogonId, BYTE HotkeyVk, + USHORT HotkeyModifiers); -WINPR_API BOOL WINAPI WTSStartRemoteControlSessionExW(LPWSTR pTargetServerName, - ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers, DWORD flags); -WINPR_API BOOL WINAPI WTSStartRemoteControlSessionExA(LPSTR pTargetServerName, - ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers, DWORD flags); + WINPR_API BOOL WINAPI WTSStartRemoteControlSessionExW(LPWSTR pTargetServerName, + ULONG TargetLogonId, BYTE HotkeyVk, + USHORT HotkeyModifiers, DWORD flags); + WINPR_API BOOL WINAPI WTSStartRemoteControlSessionExA(LPSTR pTargetServerName, + ULONG TargetLogonId, BYTE HotkeyVk, + USHORT HotkeyModifiers, DWORD flags); -WINPR_API BOOL WINAPI WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, - PWSTR pPassword, BOOL bWait); -WINPR_API BOOL WINAPI WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, - PSTR pPassword, BOOL bWait); + WINPR_API BOOL WINAPI WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, + BOOL bWait); + WINPR_API BOOL WINAPI WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, + BOOL bWait); -WINPR_API BOOL WINAPI WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, - DWORD Version, PWTS_SERVER_INFOW* ppServerInfo, DWORD* pCount); -WINPR_API BOOL WINAPI WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, - DWORD Version, PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount); + WINPR_API BOOL WINAPI WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, + PWTS_SERVER_INFOW* ppServerInfo, DWORD* pCount); + WINPR_API BOOL WINAPI WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, + PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount); -WINPR_API HANDLE WINAPI WTSOpenServerW(LPWSTR pServerName); -WINPR_API HANDLE WINAPI WTSOpenServerA(LPSTR pServerName); + WINPR_API HANDLE WINAPI WTSOpenServerW(LPWSTR pServerName); + WINPR_API HANDLE WINAPI WTSOpenServerA(LPSTR pServerName); -WINPR_API HANDLE WINAPI WTSOpenServerExW(LPWSTR pServerName); -WINPR_API HANDLE WINAPI WTSOpenServerExA(LPSTR pServerName); + WINPR_API HANDLE WINAPI WTSOpenServerExW(LPWSTR pServerName); + WINPR_API HANDLE WINAPI WTSOpenServerExA(LPSTR pServerName); -WINPR_API VOID WINAPI WTSCloseServer(HANDLE hServer); + WINPR_API VOID WINAPI WTSCloseServer(HANDLE hServer); -WINPR_API BOOL WINAPI WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, - DWORD Version, PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount); -WINPR_API BOOL WINAPI WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, - DWORD Version, PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount); + WINPR_API BOOL WINAPI WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version, + PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount); + WINPR_API BOOL WINAPI WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version, + PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount); -WINPR_API BOOL WINAPI WTSEnumerateSessionsExW(HANDLE hServer, DWORD* pLevel, - DWORD Filter, PWTS_SESSION_INFO_1W* ppSessionInfo, DWORD* pCount); -WINPR_API BOOL WINAPI WTSEnumerateSessionsExA(HANDLE hServer, DWORD* pLevel, - DWORD Filter, PWTS_SESSION_INFO_1A* ppSessionInfo, DWORD* pCount); + WINPR_API BOOL WINAPI WTSEnumerateSessionsExW(HANDLE hServer, DWORD* pLevel, DWORD Filter, + PWTS_SESSION_INFO_1W* ppSessionInfo, + DWORD* pCount); + WINPR_API BOOL WINAPI WTSEnumerateSessionsExA(HANDLE hServer, DWORD* pLevel, DWORD Filter, + PWTS_SESSION_INFO_1A* ppSessionInfo, + DWORD* pCount); -WINPR_API BOOL WINAPI WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, - DWORD Version, PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount); -WINPR_API BOOL WINAPI WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, - DWORD Version, PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount); + WINPR_API BOOL WINAPI WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version, + PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount); + WINPR_API BOOL WINAPI WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version, + PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount); -WINPR_API BOOL WINAPI WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, - DWORD ExitCode); + WINPR_API BOOL WINAPI WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode); -WINPR_API BOOL WINAPI WTSQuerySessionInformationW(HANDLE hServer, - DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPWSTR* ppBuffer, - DWORD* pBytesReturned); -WINPR_API BOOL WINAPI WTSQuerySessionInformationA(HANDLE hServer, - DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPSTR* ppBuffer, - DWORD* pBytesReturned); + WINPR_API BOOL WINAPI WTSQuerySessionInformationW(HANDLE hServer, DWORD SessionId, + WTS_INFO_CLASS WTSInfoClass, LPWSTR* ppBuffer, + DWORD* pBytesReturned); + WINPR_API BOOL WINAPI WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, + WTS_INFO_CLASS WTSInfoClass, LPSTR* ppBuffer, + DWORD* pBytesReturned); -WINPR_API BOOL WINAPI WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, - WTS_CONFIG_CLASS WTSConfigClass, LPWSTR* ppBuffer, DWORD* pBytesReturned); -WINPR_API BOOL WINAPI WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, - WTS_CONFIG_CLASS WTSConfigClass, LPSTR* ppBuffer, DWORD* pBytesReturned); + WINPR_API BOOL WINAPI WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, + WTS_CONFIG_CLASS WTSConfigClass, LPWSTR* ppBuffer, + DWORD* pBytesReturned); + WINPR_API BOOL WINAPI WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, + WTS_CONFIG_CLASS WTSConfigClass, LPSTR* ppBuffer, + DWORD* pBytesReturned); -WINPR_API BOOL WINAPI WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, - WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, DWORD DataLength); -WINPR_API BOOL WINAPI WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, - WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength); + WINPR_API BOOL WINAPI WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, + WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, + DWORD DataLength); + WINPR_API BOOL WINAPI WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, + WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, + DWORD DataLength); -WINPR_API BOOL WINAPI WTSSendMessageW(HANDLE hServer, DWORD SessionId, - LPWSTR pTitle, DWORD TitleLength, - LPWSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, - DWORD* pResponse, BOOL bWait); -WINPR_API BOOL WINAPI WTSSendMessageA(HANDLE hServer, DWORD SessionId, - LPSTR pTitle, DWORD TitleLength, - LPSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, - DWORD* pResponse, BOOL bWait); + WINPR_API BOOL WINAPI WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, + DWORD TitleLength, LPWSTR pMessage, DWORD MessageLength, + DWORD Style, DWORD Timeout, DWORD* pResponse, BOOL bWait); + WINPR_API BOOL WINAPI WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, + DWORD TitleLength, LPSTR pMessage, DWORD MessageLength, + DWORD Style, DWORD Timeout, DWORD* pResponse, BOOL bWait); -WINPR_API BOOL WINAPI WTSDisconnectSession(HANDLE hServer, DWORD SessionId, - BOOL bWait); + WINPR_API BOOL WINAPI WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait); -WINPR_API BOOL WINAPI WTSLogoffSession(HANDLE hServer, DWORD SessionId, - BOOL bWait); + WINPR_API BOOL WINAPI WTSLogoffSession(HANDLE hServer, DWORD SessionId, BOOL bWait); -WINPR_API BOOL WINAPI WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag); + WINPR_API BOOL WINAPI WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag); -WINPR_API BOOL WINAPI WTSWaitSystemEvent(HANDLE hServer, DWORD EventMask, - DWORD* pEventFlags); + WINPR_API BOOL WINAPI WTSWaitSystemEvent(HANDLE hServer, DWORD EventMask, DWORD* pEventFlags); -WINPR_API HANDLE WINAPI WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, - LPSTR pVirtualName); + WINPR_API HANDLE WINAPI WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, + LPSTR pVirtualName); -WINPR_API HANDLE WINAPI WTSVirtualChannelOpenEx(DWORD SessionId, - LPSTR pVirtualName, DWORD flags); + WINPR_API HANDLE WINAPI WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, + DWORD flags); -WINPR_API BOOL WINAPI WTSVirtualChannelClose(HANDLE hChannelHandle); + WINPR_API BOOL WINAPI WTSVirtualChannelClose(HANDLE hChannelHandle); -WINPR_API BOOL WINAPI WTSVirtualChannelRead(HANDLE hChannelHandle, - ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead); + WINPR_API BOOL WINAPI WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, + ULONG BufferSize, PULONG pBytesRead); -WINPR_API BOOL WINAPI WTSVirtualChannelWrite(HANDLE hChannelHandle, - PCHAR Buffer, ULONG Length, PULONG pBytesWritten); + WINPR_API BOOL WINAPI WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, + PULONG pBytesWritten); -WINPR_API BOOL WINAPI WTSVirtualChannelPurgeInput(HANDLE hChannelHandle); + WINPR_API BOOL WINAPI WTSVirtualChannelPurgeInput(HANDLE hChannelHandle); -WINPR_API BOOL WINAPI WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle); + WINPR_API BOOL WINAPI WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle); -WINPR_API BOOL WINAPI WTSVirtualChannelQuery(HANDLE hChannelHandle, - WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned); + WINPR_API BOOL WINAPI WTSVirtualChannelQuery(HANDLE hChannelHandle, + WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, + DWORD* pBytesReturned); -WINPR_API VOID WINAPI WTSFreeMemory(PVOID pMemory); + WINPR_API VOID WINAPI WTSFreeMemory(PVOID pMemory); -WINPR_API BOOL WINAPI WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags); + WINPR_API BOOL WINAPI WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags); -WINPR_API BOOL WINAPI WTSUnRegisterSessionNotification(HWND hWnd); + WINPR_API BOOL WINAPI WTSUnRegisterSessionNotification(HWND hWnd); -WINPR_API BOOL WINAPI WTSRegisterSessionNotificationEx(HANDLE hServer, - HWND hWnd, DWORD dwFlags); + WINPR_API BOOL WINAPI WTSRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd, + DWORD dwFlags); -WINPR_API BOOL WINAPI WTSUnRegisterSessionNotificationEx(HANDLE hServer, - HWND hWnd); + WINPR_API BOOL WINAPI WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd); -WINPR_API BOOL WINAPI WTSQueryUserToken(ULONG SessionId, PHANDLE phToken); + WINPR_API BOOL WINAPI WTSQueryUserToken(ULONG SessionId, PHANDLE phToken); -WINPR_API BOOL WINAPI WTSFreeMemoryExW(WTS_TYPE_CLASS WTSTypeClass, - PVOID pMemory, ULONG NumberOfEntries); -WINPR_API BOOL WINAPI WTSFreeMemoryExA(WTS_TYPE_CLASS WTSTypeClass, - PVOID pMemory, ULONG NumberOfEntries); + WINPR_API BOOL WINAPI WTSFreeMemoryExW(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, + ULONG NumberOfEntries); + WINPR_API BOOL WINAPI WTSFreeMemoryExA(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, + ULONG NumberOfEntries); -WINPR_API BOOL WINAPI WTSEnumerateProcessesExW(HANDLE hServer, DWORD* pLevel, - DWORD SessionId, LPWSTR* ppProcessInfo, DWORD* pCount); -WINPR_API BOOL WINAPI WTSEnumerateProcessesExA(HANDLE hServer, DWORD* pLevel, - DWORD SessionId, LPSTR* ppProcessInfo, DWORD* pCount); + WINPR_API BOOL WINAPI WTSEnumerateProcessesExW(HANDLE hServer, DWORD* pLevel, DWORD SessionId, + LPWSTR* ppProcessInfo, DWORD* pCount); + WINPR_API BOOL WINAPI WTSEnumerateProcessesExA(HANDLE hServer, DWORD* pLevel, DWORD SessionId, + LPSTR* ppProcessInfo, DWORD* pCount); -WINPR_API BOOL WINAPI WTSEnumerateListenersW(HANDLE hServer, PVOID pReserved, - DWORD Reserved, PWTSLISTENERNAMEW pListeners, DWORD* pCount); -WINPR_API BOOL WINAPI WTSEnumerateListenersA(HANDLE hServer, PVOID pReserved, - DWORD Reserved, PWTSLISTENERNAMEA pListeners, DWORD* pCount); + WINPR_API BOOL WINAPI WTSEnumerateListenersW(HANDLE hServer, PVOID pReserved, DWORD Reserved, + PWTSLISTENERNAMEW pListeners, DWORD* pCount); + WINPR_API BOOL WINAPI WTSEnumerateListenersA(HANDLE hServer, PVOID pReserved, DWORD Reserved, + PWTSLISTENERNAMEA pListeners, DWORD* pCount); -WINPR_API BOOL WINAPI WTSQueryListenerConfigW(HANDLE hServer, PVOID pReserved, - DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer); -WINPR_API BOOL WINAPI WTSQueryListenerConfigA(HANDLE hServer, PVOID pReserved, - DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer); + WINPR_API BOOL WINAPI WTSQueryListenerConfigW(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPWSTR pListenerName, + PWTSLISTENERCONFIGW pBuffer); + WINPR_API BOOL WINAPI WTSQueryListenerConfigA(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer); -WINPR_API BOOL WINAPI WTSCreateListenerW(HANDLE hServer, PVOID pReserved, - DWORD Reserved, - LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer, DWORD flag); -WINPR_API BOOL WINAPI WTSCreateListenerA(HANDLE hServer, PVOID pReserved, - DWORD Reserved, - LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer, DWORD flag); + WINPR_API BOOL WINAPI WTSCreateListenerW(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer, + DWORD flag); + WINPR_API BOOL WINAPI WTSCreateListenerA(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer, + DWORD flag); -WINPR_API BOOL WINAPI WTSSetListenerSecurityW(HANDLE hServer, PVOID pReserved, - DWORD Reserved, - LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor); -WINPR_API BOOL WINAPI WTSSetListenerSecurityA(HANDLE hServer, PVOID pReserved, - DWORD Reserved, - LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor); + WINPR_API BOOL WINAPI WTSSetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPWSTR pListenerName, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor); + WINPR_API BOOL WINAPI WTSSetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPSTR pListenerName, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor); -WINPR_API BOOL WINAPI WTSGetListenerSecurityW(HANDLE hServer, PVOID pReserved, - DWORD Reserved, - LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, - LPDWORD lpnLengthNeeded); -WINPR_API BOOL WINAPI WTSGetListenerSecurityA(HANDLE hServer, PVOID pReserved, - DWORD Reserved, - LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, - LPDWORD lpnLengthNeeded); + WINPR_API BOOL WINAPI WTSGetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPWSTR pListenerName, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor, + DWORD nLength, LPDWORD lpnLengthNeeded); + WINPR_API BOOL WINAPI WTSGetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPSTR pListenerName, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor, + DWORD nLength, LPDWORD lpnLengthNeeded); -/** - * WTSEnableChildSessions, WTSIsChildSessionsEnabled and WTSGetChildSessionId - * are not explicitly declared as WINAPI like other WTSAPI functions. - * Since they are declared as extern "C", we explicitly declare them as CDECL. - */ + /** + * WTSEnableChildSessions, WTSIsChildSessionsEnabled and WTSGetChildSessionId + * are not explicitly declared as WINAPI like other WTSAPI functions. + * Since they are declared as extern "C", we explicitly declare them as CDECL. + */ -WINPR_API BOOL CDECL WTSEnableChildSessions(BOOL bEnable); + WINPR_API BOOL CDECL WTSEnableChildSessions(BOOL bEnable); -WINPR_API BOOL CDECL WTSIsChildSessionsEnabled(PBOOL pbEnabled); + WINPR_API BOOL CDECL WTSIsChildSessionsEnabled(PBOOL pbEnabled); -WINPR_API BOOL CDECL WTSGetChildSessionId(PULONG pSessionId); + WINPR_API BOOL CDECL WTSGetChildSessionId(PULONG pSessionId); -WINPR_API BOOL CDECL WTSLogonUser(HANDLE hServer, LPCSTR username, - LPCSTR password, LPCSTR domain); - -WINPR_API BOOL CDECL WTSLogoffUser(HANDLE hServer); + WINPR_API BOOL CDECL WTSLogonUser(HANDLE hServer, LPCSTR username, LPCSTR password, + LPCSTR domain); + WINPR_API BOOL CDECL WTSLogoffUser(HANDLE hServer); #ifdef __cplusplus } #endif #ifdef UNICODE -#define WTSStartRemoteControlSession WTSStartRemoteControlSessionW -#define WTSStartRemoteControlSessionEx WTSStartRemoteControlSessionExW -#define WTSConnectSession WTSConnectSessionW -#define WTSEnumerateServers WTSEnumerateServersW -#define WTSOpenServer WTSOpenServerW -#define WTSOpenServerEx WTSOpenServerExW -#define WTSEnumerateSessions WTSEnumerateSessionsW -#define WTSEnumerateSessionsEx WTSEnumerateSessionsExW -#define WTSEnumerateProcesses WTSEnumerateProcessesW -#define WTSQuerySessionInformation WTSQuerySessionInformationW -#define WTSQueryUserConfig WTSQueryUserConfigW -#define WTSSetUserConfig WTSSetUserConfigW -#define WTSSendMessage WTSSendMessageW -#define WTSFreeMemoryEx WTSFreeMemoryExW -#define WTSEnumerateProcessesEx WTSEnumerateProcessesExW -#define WTSEnumerateListeners WTSEnumerateListenersW -#define WTSQueryListenerConfig WTSQueryListenerConfigW -#define WTSCreateListener WTSCreateListenerW -#define WTSSetListenerSecurity WTSSetListenerSecurityW -#define WTSGetListenerSecurity WTSGetListenerSecurityW +#define WTSStartRemoteControlSession WTSStartRemoteControlSessionW +#define WTSStartRemoteControlSessionEx WTSStartRemoteControlSessionExW +#define WTSConnectSession WTSConnectSessionW +#define WTSEnumerateServers WTSEnumerateServersW +#define WTSOpenServer WTSOpenServerW +#define WTSOpenServerEx WTSOpenServerExW +#define WTSEnumerateSessions WTSEnumerateSessionsW +#define WTSEnumerateSessionsEx WTSEnumerateSessionsExW +#define WTSEnumerateProcesses WTSEnumerateProcessesW +#define WTSQuerySessionInformation WTSQuerySessionInformationW +#define WTSQueryUserConfig WTSQueryUserConfigW +#define WTSSetUserConfig WTSSetUserConfigW +#define WTSSendMessage WTSSendMessageW +#define WTSFreeMemoryEx WTSFreeMemoryExW +#define WTSEnumerateProcessesEx WTSEnumerateProcessesExW +#define WTSEnumerateListeners WTSEnumerateListenersW +#define WTSQueryListenerConfig WTSQueryListenerConfigW +#define WTSCreateListener WTSCreateListenerW +#define WTSSetListenerSecurity WTSSetListenerSecurityW +#define WTSGetListenerSecurity WTSGetListenerSecurityW #else -#define WTSStartRemoteControlSession WTSStartRemoteControlSessionA -#define WTSStartRemoteControlSessionEx WTSStartRemoteControlSessionExA -#define WTSConnectSession WTSConnectSessionA -#define WTSEnumerateServers WTSEnumerateServersA -#define WTSOpenServer WTSOpenServerA -#define WTSOpenServerEx WTSOpenServerExA -#define WTSEnumerateSessions WTSEnumerateSessionsA -#define WTSEnumerateSessionsEx WTSEnumerateSessionsExA -#define WTSEnumerateProcesses WTSEnumerateProcessesA -#define WTSQuerySessionInformation WTSQuerySessionInformationA -#define WTSQueryUserConfig WTSQueryUserConfigA -#define WTSSetUserConfig WTSSetUserConfigA -#define WTSSendMessage WTSSendMessageA -#define WTSFreeMemoryEx WTSFreeMemoryExA -#define WTSEnumerateProcessesEx WTSEnumerateProcessesExA -#define WTSEnumerateListeners WTSEnumerateListenersA -#define WTSQueryListenerConfig WTSQueryListenerConfigA -#define WTSCreateListener WTSCreateListenerA -#define WTSSetListenerSecurity WTSSetListenerSecurityA -#define WTSGetListenerSecurity WTSGetListenerSecurityA +#define WTSStartRemoteControlSession WTSStartRemoteControlSessionA +#define WTSStartRemoteControlSessionEx WTSStartRemoteControlSessionExA +#define WTSConnectSession WTSConnectSessionA +#define WTSEnumerateServers WTSEnumerateServersA +#define WTSOpenServer WTSOpenServerA +#define WTSOpenServerEx WTSOpenServerExA +#define WTSEnumerateSessions WTSEnumerateSessionsA +#define WTSEnumerateSessionsEx WTSEnumerateSessionsExA +#define WTSEnumerateProcesses WTSEnumerateProcessesA +#define WTSQuerySessionInformation WTSQuerySessionInformationA +#define WTSQueryUserConfig WTSQueryUserConfigA +#define WTSSetUserConfig WTSSetUserConfigA +#define WTSSendMessage WTSSendMessageA +#define WTSFreeMemoryEx WTSFreeMemoryExA +#define WTSEnumerateProcessesEx WTSEnumerateProcessesExA +#define WTSEnumerateListeners WTSEnumerateListenersA +#define WTSQueryListenerConfig WTSQueryListenerConfigA +#define WTSCreateListener WTSCreateListenerA +#define WTSSetListenerSecurity WTSSetListenerSecurityA +#define WTSGetListenerSecurity WTSGetListenerSecurityA #endif #endif @@ -1220,31 +1221,31 @@ WINPR_API DWORD WINAPI WTSGetActiveConsoleSessionId(void); #endif -typedef BOOL (WINAPI* WTS_STOP_REMOTE_CONTROL_SESSION_FN)(ULONG LogonId); +typedef BOOL(WINAPI* WTS_STOP_REMOTE_CONTROL_SESSION_FN)(ULONG LogonId); -typedef BOOL (WINAPI* WTS_START_REMOTE_CONTROL_SESSION_FN_W)( - LPWSTR pTargetServerName, - ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers); -typedef BOOL (WINAPI* WTS_START_REMOTE_CONTROL_SESSION_FN_A)( - LPSTR pTargetServerName, - ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers); +typedef BOOL(WINAPI* WTS_START_REMOTE_CONTROL_SESSION_FN_W)(LPWSTR pTargetServerName, + ULONG TargetLogonId, BYTE HotkeyVk, + USHORT HotkeyModifiers); +typedef BOOL(WINAPI* WTS_START_REMOTE_CONTROL_SESSION_FN_A)(LPSTR pTargetServerName, + ULONG TargetLogonId, BYTE HotkeyVk, + USHORT HotkeyModifiers); -typedef BOOL (WINAPI* WTS_START_REMOTE_CONTROL_SESSION_EX_FN_W)( - LPWSTR pTargetServerName, - ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers, DWORD flags); -typedef BOOL (WINAPI* WTS_START_REMOTE_CONTROL_SESSION_EX_FN_A)( - LPSTR pTargetServerName, - ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers, DWORD flags); +typedef BOOL(WINAPI* WTS_START_REMOTE_CONTROL_SESSION_EX_FN_W)(LPWSTR pTargetServerName, + ULONG TargetLogonId, BYTE HotkeyVk, + USHORT HotkeyModifiers, DWORD flags); +typedef BOOL(WINAPI* WTS_START_REMOTE_CONTROL_SESSION_EX_FN_A)(LPSTR pTargetServerName, + ULONG TargetLogonId, BYTE HotkeyVk, + USHORT HotkeyModifiers, DWORD flags); -typedef BOOL (WINAPI* WTS_CONNECT_SESSION_FN_W)(ULONG LogonId, - ULONG TargetLogonId, PWSTR pPassword, BOOL bWait); -typedef BOOL (WINAPI* WTS_CONNECT_SESSION_FN_A)(ULONG LogonId, - ULONG TargetLogonId, PSTR pPassword, BOOL bWait); +typedef BOOL(WINAPI* WTS_CONNECT_SESSION_FN_W)(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, + BOOL bWait); +typedef BOOL(WINAPI* WTS_CONNECT_SESSION_FN_A)(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, + BOOL bWait); -typedef BOOL (WINAPI* WTS_ENUMERATE_SERVERS_FN_W)(LPWSTR pDomainName, - DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW* ppServerInfo, DWORD* pCount); -typedef BOOL (WINAPI* WTS_ENUMERATE_SERVERS_FN_A)(LPSTR pDomainName, - DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount); +typedef BOOL(WINAPI* WTS_ENUMERATE_SERVERS_FN_W)(LPWSTR pDomainName, DWORD Reserved, DWORD Version, + PWTS_SERVER_INFOW* ppServerInfo, DWORD* pCount); +typedef BOOL(WINAPI* WTS_ENUMERATE_SERVERS_FN_A)(LPSTR pDomainName, DWORD Reserved, DWORD Version, + PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount); typedef HANDLE(WINAPI* WTS_OPEN_SERVER_FN_W)(LPWSTR pServerName); typedef HANDLE(WINAPI* WTS_OPEN_SERVER_FN_A)(LPSTR pServerName); @@ -1252,174 +1253,166 @@ typedef HANDLE(WINAPI* WTS_OPEN_SERVER_FN_A)(LPSTR pServerName); typedef HANDLE(WINAPI* WTS_OPEN_SERVER_EX_FN_W)(LPWSTR pServerName); typedef HANDLE(WINAPI* WTS_OPEN_SERVER_EX_FN_A)(LPSTR pServerName); -typedef VOID (WINAPI* WTS_CLOSE_SERVER_FN)(HANDLE hServer); +typedef VOID(WINAPI* WTS_CLOSE_SERVER_FN)(HANDLE hServer); -typedef BOOL (WINAPI* WTS_ENUMERATE_SESSIONS_FN_W)(HANDLE hServer, - DWORD Reserved, DWORD Version, PWTS_SESSION_INFOW* ppSessionInfo, - DWORD* pCount); -typedef BOOL (WINAPI* WTS_ENUMERATE_SESSIONS_FN_A)(HANDLE hServer, - DWORD Reserved, DWORD Version, PWTS_SESSION_INFOA* ppSessionInfo, - DWORD* pCount); +typedef BOOL(WINAPI* WTS_ENUMERATE_SESSIONS_FN_W)(HANDLE hServer, DWORD Reserved, DWORD Version, + PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount); +typedef BOOL(WINAPI* WTS_ENUMERATE_SESSIONS_FN_A)(HANDLE hServer, DWORD Reserved, DWORD Version, + PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount); -typedef BOOL (WINAPI* WTS_ENUMERATE_SESSIONS_EX_FN_W)(HANDLE hServer, - DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1W* ppSessionInfo, - DWORD* pCount); -typedef BOOL (WINAPI* WTS_ENUMERATE_SESSIONS_EX_FN_A)(HANDLE hServer, - DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1A* ppSessionInfo, - DWORD* pCount); +typedef BOOL(WINAPI* WTS_ENUMERATE_SESSIONS_EX_FN_W)(HANDLE hServer, DWORD* pLevel, DWORD Filter, + PWTS_SESSION_INFO_1W* ppSessionInfo, + DWORD* pCount); +typedef BOOL(WINAPI* WTS_ENUMERATE_SESSIONS_EX_FN_A)(HANDLE hServer, DWORD* pLevel, DWORD Filter, + PWTS_SESSION_INFO_1A* ppSessionInfo, + DWORD* pCount); -typedef BOOL (WINAPI* WTS_ENUMERATE_PROCESSES_FN_W)(HANDLE hServer, - DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOW* ppProcessInfo, - DWORD* pCount); -typedef BOOL (WINAPI* WTS_ENUMERATE_PROCESSES_FN_A)(HANDLE hServer, - DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOA* ppProcessInfo, - DWORD* pCount); +typedef BOOL(WINAPI* WTS_ENUMERATE_PROCESSES_FN_W)(HANDLE hServer, DWORD Reserved, DWORD Version, + PWTS_PROCESS_INFOW* ppProcessInfo, + DWORD* pCount); +typedef BOOL(WINAPI* WTS_ENUMERATE_PROCESSES_FN_A)(HANDLE hServer, DWORD Reserved, DWORD Version, + PWTS_PROCESS_INFOA* ppProcessInfo, + DWORD* pCount); -typedef BOOL (WINAPI* WTS_TERMINATE_PROCESS_FN)(HANDLE hServer, DWORD ProcessId, - DWORD ExitCode); +typedef BOOL(WINAPI* WTS_TERMINATE_PROCESS_FN)(HANDLE hServer, DWORD ProcessId, DWORD ExitCode); -typedef BOOL (WINAPI* WTS_QUERY_SESSION_INFORMATION_FN_W)(HANDLE hServer, - DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPWSTR* ppBuffer, - DWORD* pBytesReturned); -typedef BOOL (WINAPI* WTS_QUERY_SESSION_INFORMATION_FN_A)(HANDLE hServer, - DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPSTR* ppBuffer, - DWORD* pBytesReturned); +typedef BOOL(WINAPI* WTS_QUERY_SESSION_INFORMATION_FN_W)(HANDLE hServer, DWORD SessionId, + WTS_INFO_CLASS WTSInfoClass, + LPWSTR* ppBuffer, DWORD* pBytesReturned); +typedef BOOL(WINAPI* WTS_QUERY_SESSION_INFORMATION_FN_A)(HANDLE hServer, DWORD SessionId, + WTS_INFO_CLASS WTSInfoClass, + LPSTR* ppBuffer, DWORD* pBytesReturned); -typedef BOOL (WINAPI* WTS_QUERY_USER_CONFIG_FN_W)(LPWSTR pServerName, - LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR* ppBuffer, - DWORD* pBytesReturned); -typedef BOOL (WINAPI* WTS_QUERY_USER_CONFIG_FN_A)(LPSTR pServerName, - LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR* ppBuffer, - DWORD* pBytesReturned); +typedef BOOL(WINAPI* WTS_QUERY_USER_CONFIG_FN_W)(LPWSTR pServerName, LPWSTR pUserName, + WTS_CONFIG_CLASS WTSConfigClass, LPWSTR* ppBuffer, + DWORD* pBytesReturned); +typedef BOOL(WINAPI* WTS_QUERY_USER_CONFIG_FN_A)(LPSTR pServerName, LPSTR pUserName, + WTS_CONFIG_CLASS WTSConfigClass, LPSTR* ppBuffer, + DWORD* pBytesReturned); -typedef BOOL (WINAPI* WTS_SET_USER_CONFIG_FN_W)(LPWSTR pServerName, - LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, - DWORD DataLength); -typedef BOOL (WINAPI* WTS_SET_USER_CONFIG_FN_A)(LPSTR pServerName, - LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, - DWORD DataLength); +typedef BOOL(WINAPI* WTS_SET_USER_CONFIG_FN_W)(LPWSTR pServerName, LPWSTR pUserName, + WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, + DWORD DataLength); +typedef BOOL(WINAPI* WTS_SET_USER_CONFIG_FN_A)(LPSTR pServerName, LPSTR pUserName, + WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, + DWORD DataLength); -typedef BOOL (WINAPI* WTS_SEND_MESSAGE_FN_W)(HANDLE hServer, DWORD SessionId, - LPWSTR pTitle, DWORD TitleLength, - LPWSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, - DWORD* pResponse, BOOL bWait); -typedef BOOL (WINAPI* WTS_SEND_MESSAGE_FN_A)(HANDLE hServer, DWORD SessionId, - LPSTR pTitle, DWORD TitleLength, - LPSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, - DWORD* pResponse, BOOL bWait); +typedef BOOL(WINAPI* WTS_SEND_MESSAGE_FN_W)(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, + DWORD TitleLength, LPWSTR pMessage, DWORD MessageLength, + DWORD Style, DWORD Timeout, DWORD* pResponse, + BOOL bWait); +typedef BOOL(WINAPI* WTS_SEND_MESSAGE_FN_A)(HANDLE hServer, DWORD SessionId, LPSTR pTitle, + DWORD TitleLength, LPSTR pMessage, DWORD MessageLength, + DWORD Style, DWORD Timeout, DWORD* pResponse, + BOOL bWait); -typedef BOOL (WINAPI* WTS_DISCONNECT_SESSION_FN)(HANDLE hServer, - DWORD SessionId, BOOL bWait); +typedef BOOL(WINAPI* WTS_DISCONNECT_SESSION_FN)(HANDLE hServer, DWORD SessionId, BOOL bWait); -typedef BOOL (WINAPI* WTS_LOGOFF_SESSION_FN)(HANDLE hServer, DWORD SessionId, - BOOL bWait); +typedef BOOL(WINAPI* WTS_LOGOFF_SESSION_FN)(HANDLE hServer, DWORD SessionId, BOOL bWait); -typedef BOOL (WINAPI* WTS_SHUTDOWN_SYSTEM_FN)(HANDLE hServer, - DWORD ShutdownFlag); +typedef BOOL(WINAPI* WTS_SHUTDOWN_SYSTEM_FN)(HANDLE hServer, DWORD ShutdownFlag); -typedef BOOL (WINAPI* WTS_WAIT_SYSTEM_EVENT_FN)(HANDLE hServer, DWORD EventMask, - DWORD* pEventFlags); +typedef BOOL(WINAPI* WTS_WAIT_SYSTEM_EVENT_FN)(HANDLE hServer, DWORD EventMask, DWORD* pEventFlags); -typedef HANDLE(WINAPI* WTS_VIRTUAL_CHANNEL_OPEN_FN)(HANDLE hServer, - DWORD SessionId, LPSTR pVirtualName); +typedef HANDLE(WINAPI* WTS_VIRTUAL_CHANNEL_OPEN_FN)(HANDLE hServer, DWORD SessionId, + LPSTR pVirtualName); -typedef HANDLE(WINAPI* WTS_VIRTUAL_CHANNEL_OPEN_EX_FN)(DWORD SessionId, - LPSTR pVirtualName, DWORD flags); +typedef HANDLE(WINAPI* WTS_VIRTUAL_CHANNEL_OPEN_EX_FN)(DWORD SessionId, LPSTR pVirtualName, + DWORD flags); -typedef BOOL (WINAPI* WTS_VIRTUAL_CHANNEL_CLOSE_FN)(HANDLE hChannelHandle); +typedef BOOL(WINAPI* WTS_VIRTUAL_CHANNEL_CLOSE_FN)(HANDLE hChannelHandle); -typedef BOOL (WINAPI* WTS_VIRTUAL_CHANNEL_READ_FN)(HANDLE hChannelHandle, - ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead); +typedef BOOL(WINAPI* WTS_VIRTUAL_CHANNEL_READ_FN)(HANDLE hChannelHandle, ULONG TimeOut, + PCHAR Buffer, ULONG BufferSize, + PULONG pBytesRead); -typedef BOOL (WINAPI* WTS_VIRTUAL_CHANNEL_WRITE_FN)(HANDLE hChannelHandle, - PCHAR Buffer, ULONG Length, PULONG pBytesWritten); +typedef BOOL(WINAPI* WTS_VIRTUAL_CHANNEL_WRITE_FN)(HANDLE hChannelHandle, PCHAR Buffer, + ULONG Length, PULONG pBytesWritten); -typedef BOOL (WINAPI* WTS_VIRTUAL_CHANNEL_PURGE_INPUT_FN)( - HANDLE hChannelHandle); +typedef BOOL(WINAPI* WTS_VIRTUAL_CHANNEL_PURGE_INPUT_FN)(HANDLE hChannelHandle); -typedef BOOL (WINAPI* WTS_VIRTUAL_CHANNEL_PURGE_OUTPUT_FN)( - HANDLE hChannelHandle); +typedef BOOL(WINAPI* WTS_VIRTUAL_CHANNEL_PURGE_OUTPUT_FN)(HANDLE hChannelHandle); -typedef BOOL (WINAPI* WTS_VIRTUAL_CHANNEL_QUERY_FN)(HANDLE hChannelHandle, - WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned); +typedef BOOL(WINAPI* WTS_VIRTUAL_CHANNEL_QUERY_FN)(HANDLE hChannelHandle, + WTS_VIRTUAL_CLASS WtsVirtualClass, + PVOID* ppBuffer, DWORD* pBytesReturned); -typedef VOID (WINAPI* WTS_FREE_MEMORY_FN)(PVOID pMemory); +typedef VOID(WINAPI* WTS_FREE_MEMORY_FN)(PVOID pMemory); -typedef BOOL (WINAPI* WTS_REGISTER_SESSION_NOTIFICATION_FN)(HWND hWnd, - DWORD dwFlags); +typedef BOOL(WINAPI* WTS_REGISTER_SESSION_NOTIFICATION_FN)(HWND hWnd, DWORD dwFlags); -typedef BOOL (WINAPI* WTS_UNREGISTER_SESSION_NOTIFICATION_FN)(HWND hWnd); +typedef BOOL(WINAPI* WTS_UNREGISTER_SESSION_NOTIFICATION_FN)(HWND hWnd); -typedef BOOL (WINAPI* WTS_REGISTER_SESSION_NOTIFICATION_EX_FN)(HANDLE hServer, - HWND hWnd, DWORD dwFlags); +typedef BOOL(WINAPI* WTS_REGISTER_SESSION_NOTIFICATION_EX_FN)(HANDLE hServer, HWND hWnd, + DWORD dwFlags); -typedef BOOL (WINAPI* WTS_UNREGISTER_SESSION_NOTIFICATION_EX_FN)(HANDLE hServer, - HWND hWnd); +typedef BOOL(WINAPI* WTS_UNREGISTER_SESSION_NOTIFICATION_EX_FN)(HANDLE hServer, HWND hWnd); -typedef BOOL (WINAPI* WTS_QUERY_USER_TOKEN_FN)(ULONG SessionId, - PHANDLE phToken); +typedef BOOL(WINAPI* WTS_QUERY_USER_TOKEN_FN)(ULONG SessionId, PHANDLE phToken); -typedef BOOL (WINAPI* WTS_FREE_MEMORY_EX_FN_W)(WTS_TYPE_CLASS WTSTypeClass, - PVOID pMemory, ULONG NumberOfEntries); -typedef BOOL (WINAPI* WTS_FREE_MEMORY_EX_FN_A)(WTS_TYPE_CLASS WTSTypeClass, - PVOID pMemory, ULONG NumberOfEntries); +typedef BOOL(WINAPI* WTS_FREE_MEMORY_EX_FN_W)(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, + ULONG NumberOfEntries); +typedef BOOL(WINAPI* WTS_FREE_MEMORY_EX_FN_A)(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, + ULONG NumberOfEntries); -typedef BOOL (WINAPI* WTS_ENUMERATE_PROCESSES_EX_FN_W)(HANDLE hServer, - DWORD* pLevel, DWORD SessionId, LPWSTR* ppProcessInfo, DWORD* pCount); -typedef BOOL (WINAPI* WTS_ENUMERATE_PROCESSES_EX_FN_A)(HANDLE hServer, - DWORD* pLevel, DWORD SessionId, LPSTR* ppProcessInfo, DWORD* pCount); +typedef BOOL(WINAPI* WTS_ENUMERATE_PROCESSES_EX_FN_W)(HANDLE hServer, DWORD* pLevel, + DWORD SessionId, LPWSTR* ppProcessInfo, + DWORD* pCount); +typedef BOOL(WINAPI* WTS_ENUMERATE_PROCESSES_EX_FN_A)(HANDLE hServer, DWORD* pLevel, + DWORD SessionId, LPSTR* ppProcessInfo, + DWORD* pCount); -typedef BOOL (WINAPI* WTS_ENUMERATE_LISTENERS_FN_W)(HANDLE hServer, - PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEW pListeners, DWORD* pCount); -typedef BOOL (WINAPI* WTS_ENUMERATE_LISTENERS_FN_A)(HANDLE hServer, - PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEA pListeners, DWORD* pCount); +typedef BOOL(WINAPI* WTS_ENUMERATE_LISTENERS_FN_W)(HANDLE hServer, PVOID pReserved, DWORD Reserved, + PWTSLISTENERNAMEW pListeners, DWORD* pCount); +typedef BOOL(WINAPI* WTS_ENUMERATE_LISTENERS_FN_A)(HANDLE hServer, PVOID pReserved, DWORD Reserved, + PWTSLISTENERNAMEA pListeners, DWORD* pCount); -typedef BOOL (WINAPI* WTS_QUERY_LISTENER_CONFIG_FN_W)(HANDLE hServer, - PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, - PWTSLISTENERCONFIGW pBuffer); -typedef BOOL (WINAPI* WTS_QUERY_LISTENER_CONFIG_FN_A)(HANDLE hServer, - PVOID pReserved, DWORD Reserved, LPSTR pListenerName, - PWTSLISTENERCONFIGA pBuffer); +typedef BOOL(WINAPI* WTS_QUERY_LISTENER_CONFIG_FN_W)(HANDLE hServer, PVOID pReserved, + DWORD Reserved, LPWSTR pListenerName, + PWTSLISTENERCONFIGW pBuffer); +typedef BOOL(WINAPI* WTS_QUERY_LISTENER_CONFIG_FN_A)(HANDLE hServer, PVOID pReserved, + DWORD Reserved, LPSTR pListenerName, + PWTSLISTENERCONFIGA pBuffer); -typedef BOOL (WINAPI* WTS_CREATE_LISTENER_FN_W)(HANDLE hServer, PVOID pReserved, - DWORD Reserved, - LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer, DWORD flag); -typedef BOOL (WINAPI* WTS_CREATE_LISTENER_FN_A)(HANDLE hServer, PVOID pReserved, - DWORD Reserved, - LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer, DWORD flag); +typedef BOOL(WINAPI* WTS_CREATE_LISTENER_FN_W)(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer, + DWORD flag); +typedef BOOL(WINAPI* WTS_CREATE_LISTENER_FN_A)(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer, + DWORD flag); -typedef BOOL (WINAPI* WTS_SET_LISTENER_SECURITY_FN_W)(HANDLE hServer, - PVOID pReserved, DWORD Reserved, - LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor); -typedef BOOL (WINAPI* WTS_SET_LISTENER_SECURITY_FN_A)(HANDLE hServer, - PVOID pReserved, DWORD Reserved, - LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor); +typedef BOOL(WINAPI* WTS_SET_LISTENER_SECURITY_FN_W)(HANDLE hServer, PVOID pReserved, + DWORD Reserved, LPWSTR pListenerName, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor); +typedef BOOL(WINAPI* WTS_SET_LISTENER_SECURITY_FN_A)(HANDLE hServer, PVOID pReserved, + DWORD Reserved, LPSTR pListenerName, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor); -typedef BOOL (WINAPI* WTS_GET_LISTENER_SECURITY_FN_W)(HANDLE hServer, - PVOID pReserved, DWORD Reserved, - LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, - LPDWORD lpnLengthNeeded); -typedef BOOL (WINAPI* WTS_GET_LISTENER_SECURITY_FN_A)(HANDLE hServer, - PVOID pReserved, DWORD Reserved, - LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, - LPDWORD lpnLengthNeeded); +typedef BOOL(WINAPI* WTS_GET_LISTENER_SECURITY_FN_W)(HANDLE hServer, PVOID pReserved, + DWORD Reserved, LPWSTR pListenerName, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor, + DWORD nLength, LPDWORD lpnLengthNeeded); +typedef BOOL(WINAPI* WTS_GET_LISTENER_SECURITY_FN_A)(HANDLE hServer, PVOID pReserved, + DWORD Reserved, LPSTR pListenerName, + SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor, + DWORD nLength, LPDWORD lpnLengthNeeded); -typedef BOOL (CDECL* WTS_ENABLE_CHILD_SESSIONS_FN)(BOOL bEnable); +typedef BOOL(CDECL* WTS_ENABLE_CHILD_SESSIONS_FN)(BOOL bEnable); -typedef BOOL (CDECL* WTS_IS_CHILD_SESSIONS_ENABLED_FN)(PBOOL pbEnabled); +typedef BOOL(CDECL* WTS_IS_CHILD_SESSIONS_ENABLED_FN)(PBOOL pbEnabled); -typedef BOOL (CDECL* WTS_GET_CHILD_SESSION_ID_FN)(PULONG pSessionId); +typedef BOOL(CDECL* WTS_GET_CHILD_SESSION_ID_FN)(PULONG pSessionId); -typedef DWORD (WINAPI* WTS_GET_ACTIVE_CONSOLE_SESSION_ID_FN)(void); +typedef DWORD(WINAPI* WTS_GET_ACTIVE_CONSOLE_SESSION_ID_FN)(void); -typedef BOOL (WINAPI* WTS_LOGON_USER_FN)(HANDLE hServer, LPCSTR username, - LPCSTR password, LPCSTR domain); +typedef BOOL(WINAPI* WTS_LOGON_USER_FN)(HANDLE hServer, LPCSTR username, LPCSTR password, + LPCSTR domain); -typedef BOOL (WINAPI* WTS_LOGOFF_USER_FN)(HANDLE hServer); +typedef BOOL(WINAPI* WTS_LOGOFF_USER_FN)(HANDLE hServer); struct _WtsApiFunctionTable { @@ -1500,16 +1493,16 @@ typedef WtsApiFunctionTable* PWtsApiFunctionTable; typedef PWtsApiFunctionTable(CDECL* INIT_WTSAPI_FN)(void); #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -WINPR_API BOOL WTSRegisterWtsApiFunctionTable(PWtsApiFunctionTable table); -WINPR_API const CHAR* WTSErrorToString(UINT error); -WINPR_API const CHAR* WTSSessionStateToString(WTS_CONNECTSTATE_CLASS state); + WINPR_API BOOL WTSRegisterWtsApiFunctionTable(PWtsApiFunctionTable table); + WINPR_API const CHAR* WTSErrorToString(UINT error); + WINPR_API const CHAR* WTSSessionStateToString(WTS_CONNECTSTATE_CLASS state); #ifdef __cplusplus } #endif #endif /* WINPR_WTSAPI_H */ - diff --git a/winpr/libwinpr/asn1/asn1.c b/winpr/libwinpr/asn1/asn1.c index 2b981b24b..fd1f5ac57 100644 --- a/winpr/libwinpr/asn1/asn1.c +++ b/winpr/libwinpr/asn1/asn1.c @@ -28,16 +28,18 @@ #ifndef _WIN32 ASN1module_t ASN1_CreateModule(ASN1uint32_t nVersion, ASN1encodingrule_e eRule, - ASN1uint32_t dwFlags, ASN1uint32_t cPDU, const ASN1GenericFun_t apfnEncoder[], - const ASN1GenericFun_t apfnDecoder[], const ASN1FreeFun_t apfnFreeMemory[], - const ASN1uint32_t acbStructSize[], ASN1magic_t nModuleName) + ASN1uint32_t dwFlags, ASN1uint32_t cPDU, + const ASN1GenericFun_t apfnEncoder[], + const ASN1GenericFun_t apfnDecoder[], + const ASN1FreeFun_t apfnFreeMemory[], + const ASN1uint32_t acbStructSize[], ASN1magic_t nModuleName) { ASN1module_t module = NULL; if (!((apfnEncoder) && (apfnDecoder) && (apfnFreeMemory) && (acbStructSize))) return NULL; - module = (ASN1module_t) calloc(1, sizeof(struct tagASN1module_t)); + module = (ASN1module_t)calloc(1, sizeof(struct tagASN1module_t)); if (module) { @@ -50,8 +52,8 @@ ASN1module_t ASN1_CreateModule(ASN1uint32_t nVersion, ASN1encodingrule_e eRule, if (eRule & ASN1_BER_RULE) { - module->BER.apfnEncoder = (const ASN1BerEncFun_t*) apfnEncoder; - module->BER.apfnDecoder = (const ASN1BerDecFun_t*) apfnDecoder; + module->BER.apfnEncoder = (const ASN1BerEncFun_t*)apfnEncoder; + module->BER.apfnDecoder = (const ASN1BerDecFun_t*)apfnDecoder; } } @@ -64,7 +66,7 @@ void ASN1_CloseModule(ASN1module_t pModule) } ASN1error_e ASN1_CreateEncoder(ASN1module_t pModule, ASN1encoding_t* ppEncoderInfo, - ASN1octet_t* pbBuf, ASN1uint32_t cbBufSize, ASN1encoding_t pParent) + ASN1octet_t* pbBuf, ASN1uint32_t cbBufSize, ASN1encoding_t pParent) { ASN1error_e status; ASN1encoding_t encoder; @@ -73,7 +75,7 @@ ASN1error_e ASN1_CreateEncoder(ASN1module_t pModule, ASN1encoding_t* ppEncoderIn if (pModule && ppEncoderInfo) { *ppEncoderInfo = 0; - encoder = (ASN1encoding_t) calloc(1, sizeof(struct ASN1encoding_s)); + encoder = (ASN1encoding_t)calloc(1, sizeof(struct ASN1encoding_s)); if (encoder) { @@ -92,12 +94,12 @@ ASN1error_e ASN1_CreateEncoder(ASN1module_t pModule, ASN1encoding_t* ppEncoderIn if (pParent) { - encoder[1].magic = (ASN1magic_t) pParent; + encoder[1].magic = (ASN1magic_t)pParent; rule = pParent->eRule; } else { - encoder[1].magic = (ASN1magic_t) encoder; + encoder[1].magic = (ASN1magic_t)encoder; rule = pModule->eRule; } @@ -108,20 +110,20 @@ ASN1error_e ASN1_CreateEncoder(ASN1module_t pModule, ASN1encoding_t* ppEncoderIn if (!pParent) { -LABEL_ENCODER_COMPLETE: + LABEL_ENCODER_COMPLETE: *ppEncoderInfo = encoder; return ASN1_SUCCESS; } if (rule & ASN1_BER_RULE) { - //if (ASN1BEREncCheck(encoder, 1)) + // if (ASN1BEREncCheck(encoder, 1)) { if (encoder->buf) *encoder->buf = 0; -LABEL_SET_BUFFER: + LABEL_SET_BUFFER: if (pParent) - pParent[1].version = (ASN1uint32_t) encoder; + pParent[1].version = (ASN1uint32_t)encoder; goto LABEL_ENCODER_COMPLETE; } @@ -149,7 +151,7 @@ LABEL_SET_BUFFER: } ASN1error_e ASN1_Encode(ASN1encoding_t pEncoderInfo, void* pDataStruct, ASN1uint32_t nPduNum, - ASN1uint32_t dwFlags, ASN1octet_t* pbBuf, ASN1uint32_t cbBufSize) + ASN1uint32_t dwFlags, ASN1octet_t* pbBuf, ASN1uint32_t cbBufSize) { int flags; ASN1error_e status; @@ -207,14 +209,14 @@ LABEL_MODULE: if (!pfnEncoder) { -LABEL_BAD_PDU: + LABEL_BAD_PDU: status = ASN1_ERR_BADPDU; return ASN1EncSetError(pEncoderInfo, status); } if (pfnEncoder(pEncoderInfo, 0, pDataStruct)) { - //ASN1BEREncFlush(pEncoderInfo); + // ASN1BEREncFlush(pEncoderInfo); } else { @@ -246,7 +248,7 @@ void ASN1_CloseEncoder(ASN1encoding_t pEncoderInfo) { magic = pEncoderInfo[1].magic; - if (pEncoderInfo != (ASN1encoding_t) magic) + if (pEncoderInfo != (ASN1encoding_t)magic) pEncoderInfo[1].version = 0; free(pEncoderInfo); @@ -264,7 +266,7 @@ ASN1error_e ASN1EncSetError(ASN1encoding_t enc, ASN1error_e err) while (encoder) { - nextEncoder = (ASN1encoding_t) &encoder[1]; + nextEncoder = (ASN1encoding_t)&encoder[1]; encoder->err = err; @@ -288,7 +290,7 @@ ASN1error_e ASN1DecSetError(ASN1decoding_t dec, ASN1error_e err) while (decoder) { - nextDecoder = (ASN1decoding_t) &decoder[1]; + nextDecoder = (ASN1decoding_t)&decoder[1]; decoder->err = err; @@ -312,14 +314,15 @@ void ASN1_FreeDecoded(ASN1decoding_t pDecoderInfo, void* pDataStruct, ASN1uint32 } ASN1error_e ASN1_CreateDecoder(ASN1module_t pModule, ASN1decoding_t* ppDecoderInfo, - ASN1octet_t* pbBuf, ASN1uint32_t cbBufSize, ASN1decoding_t pParent) + ASN1octet_t* pbBuf, ASN1uint32_t cbBufSize, ASN1decoding_t pParent) { - return ASN1_ERR_BADARGS; + return ASN1_ERR_BADARGS; } -ASN1error_e ASN1_Decode(ASN1decoding_t pDecoderInfo,void **ppDataStruct,ASN1uint32_t nPduNum,ASN1uint32_t dwFlags,ASN1octet_t *pbBuf,ASN1uint32_t cbBufSize) +ASN1error_e ASN1_Decode(ASN1decoding_t pDecoderInfo, void** ppDataStruct, ASN1uint32_t nPduNum, + ASN1uint32_t dwFlags, ASN1octet_t* pbBuf, ASN1uint32_t cbBufSize) { - return ASN1_ERR_BADARGS; + return ASN1_ERR_BADARGS; } #endif diff --git a/winpr/libwinpr/asn1/test/TestAsn1BerDec.c b/winpr/libwinpr/asn1/test/TestAsn1BerDec.c index d096b3120..98736e478 100644 --- a/winpr/libwinpr/asn1/test/TestAsn1BerDec.c +++ b/winpr/libwinpr/asn1/test/TestAsn1BerDec.c @@ -8,4 +8,3 @@ int TestAsn1BerDec(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/asn1/test/TestAsn1BerEnc.c b/winpr/libwinpr/asn1/test/TestAsn1BerEnc.c index 66568e5e6..5babd74e8 100644 --- a/winpr/libwinpr/asn1/test/TestAsn1BerEnc.c +++ b/winpr/libwinpr/asn1/test/TestAsn1BerEnc.c @@ -8,4 +8,3 @@ int TestAsn1BerEnc(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/asn1/test/TestAsn1Compare.c b/winpr/libwinpr/asn1/test/TestAsn1Compare.c index 407e631a0..e2d5fc254 100644 --- a/winpr/libwinpr/asn1/test/TestAsn1Compare.c +++ b/winpr/libwinpr/asn1/test/TestAsn1Compare.c @@ -8,4 +8,3 @@ int TestAsn1Compare(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/asn1/test/TestAsn1Decode.c b/winpr/libwinpr/asn1/test/TestAsn1Decode.c index 6e604f3d8..d458af97f 100644 --- a/winpr/libwinpr/asn1/test/TestAsn1Decode.c +++ b/winpr/libwinpr/asn1/test/TestAsn1Decode.c @@ -8,4 +8,3 @@ int TestAsn1Decode(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/asn1/test/TestAsn1Decoder.c b/winpr/libwinpr/asn1/test/TestAsn1Decoder.c index a8ff7bc21..6e41d8051 100644 --- a/winpr/libwinpr/asn1/test/TestAsn1Decoder.c +++ b/winpr/libwinpr/asn1/test/TestAsn1Decoder.c @@ -8,4 +8,3 @@ int TestAsn1Decoder(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/asn1/test/TestAsn1DerDec.c b/winpr/libwinpr/asn1/test/TestAsn1DerDec.c index 07ef10749..e1c610fce 100644 --- a/winpr/libwinpr/asn1/test/TestAsn1DerDec.c +++ b/winpr/libwinpr/asn1/test/TestAsn1DerDec.c @@ -8,4 +8,3 @@ int TestAsn1DerDec(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/asn1/test/TestAsn1DerEnc.c b/winpr/libwinpr/asn1/test/TestAsn1DerEnc.c index bfbd872b7..e325ed132 100644 --- a/winpr/libwinpr/asn1/test/TestAsn1DerEnc.c +++ b/winpr/libwinpr/asn1/test/TestAsn1DerEnc.c @@ -8,4 +8,3 @@ int TestAsn1DerEnc(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/asn1/test/TestAsn1Encode.c b/winpr/libwinpr/asn1/test/TestAsn1Encode.c index 9a1e478ea..db8b42891 100644 --- a/winpr/libwinpr/asn1/test/TestAsn1Encode.c +++ b/winpr/libwinpr/asn1/test/TestAsn1Encode.c @@ -8,4 +8,3 @@ int TestAsn1Encode(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/asn1/test/TestAsn1Encoder.c b/winpr/libwinpr/asn1/test/TestAsn1Encoder.c index 6d262cb6a..5d101e9c1 100644 --- a/winpr/libwinpr/asn1/test/TestAsn1Encoder.c +++ b/winpr/libwinpr/asn1/test/TestAsn1Encoder.c @@ -8,4 +8,3 @@ int TestAsn1Encoder(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/asn1/test/TestAsn1Integer.c b/winpr/libwinpr/asn1/test/TestAsn1Integer.c index ffa83cbea..255a28675 100644 --- a/winpr/libwinpr/asn1/test/TestAsn1Integer.c +++ b/winpr/libwinpr/asn1/test/TestAsn1Integer.c @@ -8,4 +8,3 @@ int TestAsn1Integer(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/asn1/test/TestAsn1Module.c b/winpr/libwinpr/asn1/test/TestAsn1Module.c index 3e9d1d400..81085a0bd 100644 --- a/winpr/libwinpr/asn1/test/TestAsn1Module.c +++ b/winpr/libwinpr/asn1/test/TestAsn1Module.c @@ -8,4 +8,3 @@ int TestAsn1Module(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/asn1/test/TestAsn1String.c b/winpr/libwinpr/asn1/test/TestAsn1String.c index c5b057797..bfffbb32a 100644 --- a/winpr/libwinpr/asn1/test/TestAsn1String.c +++ b/winpr/libwinpr/asn1/test/TestAsn1String.c @@ -8,4 +8,3 @@ int TestAsn1String(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/bcrypt/bcrypt.c b/winpr/libwinpr/bcrypt/bcrypt.c index 63840e850..d4240b9e6 100644 --- a/winpr/libwinpr/bcrypt/bcrypt.c +++ b/winpr/libwinpr/bcrypt/bcrypt.c @@ -28,8 +28,8 @@ * http://msdn.microsoft.com/en-us/library/windows/desktop/aa376210/ */ -NTSTATUS BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE* phAlgorithm, - LPCWSTR pszAlgId, LPCWSTR pszImplementation, ULONG dwFlags) +NTSTATUS BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE* phAlgorithm, LPCWSTR pszAlgId, + LPCWSTR pszImplementation, ULONG dwFlags) { return 0; } @@ -39,14 +39,15 @@ NTSTATUS BCryptCloseAlgorithmProvider(BCRYPT_ALG_HANDLE hAlgorithm, ULONG dwFlag return 0; } -NTSTATUS BCryptGetProperty(BCRYPT_HANDLE hObject, LPCWSTR pszProperty, - PUCHAR pbOutput, ULONG cbOutput, ULONG* pcbResult, ULONG dwFlags) +NTSTATUS BCryptGetProperty(BCRYPT_HANDLE hObject, LPCWSTR pszProperty, PUCHAR pbOutput, + ULONG cbOutput, ULONG* pcbResult, ULONG dwFlags) { return 0; } NTSTATUS BCryptCreateHash(BCRYPT_ALG_HANDLE hAlgorithm, BCRYPT_HASH_HANDLE* phHash, - PUCHAR pbHashObject, ULONG cbHashObject, PUCHAR pbSecret, ULONG cbSecret, ULONG dwFlags) + PUCHAR pbHashObject, ULONG cbHashObject, PUCHAR pbSecret, ULONG cbSecret, + ULONG dwFlags) { return 0; } @@ -66,26 +67,28 @@ NTSTATUS BCryptFinishHash(BCRYPT_HASH_HANDLE hHash, PUCHAR pbOutput, ULONG cbOut return 0; } -NTSTATUS BCryptGenRandom(BCRYPT_ALG_HANDLE hAlgorithm, PUCHAR pbBuffer, ULONG cbBuffer, ULONG dwFlags) +NTSTATUS BCryptGenRandom(BCRYPT_ALG_HANDLE hAlgorithm, PUCHAR pbBuffer, ULONG cbBuffer, + ULONG dwFlags) { return 0; } NTSTATUS BCryptGenerateSymmetricKey(BCRYPT_ALG_HANDLE hAlgorithm, BCRYPT_KEY_HANDLE* phKey, - PUCHAR pbKeyObject, ULONG cbKeyObject, PUCHAR pbSecret, ULONG cbSecret, ULONG dwFlags) + PUCHAR pbKeyObject, ULONG cbKeyObject, PUCHAR pbSecret, + ULONG cbSecret, ULONG dwFlags) { return 0; } NTSTATUS BCryptGenerateKeyPair(BCRYPT_ALG_HANDLE hAlgorithm, BCRYPT_KEY_HANDLE* phKey, - ULONG dwLength, ULONG dwFlags) + ULONG dwLength, ULONG dwFlags) { return 0; } NTSTATUS BCryptImportKey(BCRYPT_ALG_HANDLE hAlgorithm, BCRYPT_KEY_HANDLE hImportKey, - LPCWSTR pszBlobType, BCRYPT_KEY_HANDLE *phKey, PUCHAR pbKeyObject, - ULONG cbKeyObject, PUCHAR pbInput, ULONG cbInput, ULONG dwFlags) + LPCWSTR pszBlobType, BCRYPT_KEY_HANDLE* phKey, PUCHAR pbKeyObject, + ULONG cbKeyObject, PUCHAR pbInput, ULONG cbInput, ULONG dwFlags) { return 0; } @@ -95,16 +98,16 @@ NTSTATUS BCryptDestroyKey(BCRYPT_KEY_HANDLE hKey) return 0; } -NTSTATUS BCryptEncrypt(BCRYPT_KEY_HANDLE hKey, PUCHAR pbInput, ULONG cbInput, - VOID* pPaddingInfo, PUCHAR pbIV, ULONG cbIV, PUCHAR pbOutput, - ULONG cbOutput, ULONG* pcbResult, ULONG dwFlags) +NTSTATUS BCryptEncrypt(BCRYPT_KEY_HANDLE hKey, PUCHAR pbInput, ULONG cbInput, VOID* pPaddingInfo, + PUCHAR pbIV, ULONG cbIV, PUCHAR pbOutput, ULONG cbOutput, ULONG* pcbResult, + ULONG dwFlags) { return 0; } -NTSTATUS BCryptDecrypt(BCRYPT_KEY_HANDLE hKey, PUCHAR pbInput, ULONG cbInput, - VOID* pPaddingInfo, PUCHAR pbIV, ULONG cbIV, PUCHAR pbOutput, - ULONG cbOutput, ULONG* pcbResult, ULONG dwFlags) +NTSTATUS BCryptDecrypt(BCRYPT_KEY_HANDLE hKey, PUCHAR pbInput, ULONG cbInput, VOID* pPaddingInfo, + PUCHAR pbIV, ULONG cbIV, PUCHAR pbOutput, ULONG cbOutput, ULONG* pcbResult, + ULONG dwFlags) { return 0; } diff --git a/winpr/libwinpr/clipboard/clipboard.c b/winpr/libwinpr/clipboard/clipboard.c index a851a1ca1..a44028831 100644 --- a/winpr/libwinpr/clipboard/clipboard.c +++ b/winpr/libwinpr/clipboard/clipboard.c @@ -44,30 +44,28 @@ * http://www.w3.org/TR/clipboard-apis/ */ -const char* CF_STANDARD_STRINGS[CF_MAX] = -{ - "CF_RAW", /* 0 */ - "CF_TEXT", /* 1 */ - "CF_BITMAP", /* 2 */ - "CF_METAFILEPICT", /* 3 */ - "CF_SYLK", /* 4 */ - "CF_DIF", /* 5 */ - "CF_TIFF", /* 6 */ - "CF_OEMTEXT", /* 7 */ - "CF_DIB", /* 8 */ - "CF_PALETTE", /* 9 */ - "CF_PENDATA", /* 10 */ - "CF_RIFF", /* 11 */ - "CF_WAVE", /* 12 */ - "CF_UNICODETEXT", /* 13 */ - "CF_ENHMETAFILE", /* 14 */ - "CF_HDROP", /* 15 */ - "CF_LOCALE", /* 16 */ - "CF_DIBV5" /* 17 */ +const char* CF_STANDARD_STRINGS[CF_MAX] = { + "CF_RAW", /* 0 */ + "CF_TEXT", /* 1 */ + "CF_BITMAP", /* 2 */ + "CF_METAFILEPICT", /* 3 */ + "CF_SYLK", /* 4 */ + "CF_DIF", /* 5 */ + "CF_TIFF", /* 6 */ + "CF_OEMTEXT", /* 7 */ + "CF_DIB", /* 8 */ + "CF_PALETTE", /* 9 */ + "CF_PENDATA", /* 10 */ + "CF_RIFF", /* 11 */ + "CF_WAVE", /* 12 */ + "CF_UNICODETEXT", /* 13 */ + "CF_ENHMETAFILE", /* 14 */ + "CF_HDROP", /* 15 */ + "CF_LOCALE", /* 16 */ + "CF_DIBV5" /* 17 */ }; -wClipboardFormat* ClipboardFindFormat(wClipboard* clipboard, UINT32 formatId, - const char* name) +wClipboardFormat* ClipboardFindFormat(wClipboard* clipboard, UINT32 formatId, const char* name) { UINT32 index; wClipboardFormat* format = NULL; @@ -107,8 +105,7 @@ wClipboardFormat* ClipboardFindFormat(wClipboard* clipboard, UINT32 formatId, if (format->formatId) return NULL; - if (!format->formatName - || (strcmp(format->formatName, CF_STANDARD_STRINGS[0]) == 0)) + if (!format->formatName || (strcmp(format->formatName, CF_STANDARD_STRINGS[0]) == 0)) return format; } } @@ -116,8 +113,7 @@ wClipboardFormat* ClipboardFindFormat(wClipboard* clipboard, UINT32 formatId, return format; } -wClipboardSynthesizer* ClipboardFindSynthesizer(wClipboardFormat* format, - UINT32 formatId) +wClipboardSynthesizer* ClipboardFindSynthesizer(wClipboardFormat* format, UINT32 formatId) { UINT32 index; wClipboardSynthesizer* synthesizer; @@ -162,7 +158,7 @@ BOOL ClipboardEmpty(wClipboard* clipboard) if (clipboard->data) { - free((void*) clipboard->data); + free((void*)clipboard->data); clipboard->data = NULL; } @@ -180,8 +176,7 @@ UINT32 ClipboardCountRegisteredFormats(wClipboard* clipboard) return clipboard->numFormats; } -UINT32 ClipboardGetRegisteredFormatIds(wClipboard* clipboard, - UINT32** ppFormatIds) +UINT32 ClipboardGetRegisteredFormatIds(wClipboard* clipboard, UINT32** ppFormatIds) { UINT32 index; UINT32* pFormatIds; @@ -230,13 +225,13 @@ UINT32 ClipboardRegisterFormat(wClipboard* clipboard, const char* name) { UINT32 numFormats = clipboard->maxFormats * 2; wClipboardFormat* tmpFormat; - tmpFormat = (wClipboardFormat*) realloc(clipboard->formats, - numFormats * sizeof(wClipboardFormat)); + tmpFormat = + (wClipboardFormat*)realloc(clipboard->formats, numFormats * sizeof(wClipboardFormat)); if (!tmpFormat) return 0; - clipboard->formats = tmpFormat; + clipboard->formats = tmpFormat; clipboard->maxFormats = numFormats; } @@ -256,8 +251,8 @@ UINT32 ClipboardRegisterFormat(wClipboard* clipboard, const char* name) return format->formatId; } -BOOL ClipboardRegisterSynthesizer(wClipboard* clipboard, UINT32 formatId, - UINT32 syntheticId, CLIPBOARD_SYNTHESIZE_FN pfnSynthesize) +BOOL ClipboardRegisterSynthesizer(wClipboard* clipboard, UINT32 formatId, UINT32 syntheticId, + CLIPBOARD_SYNTHESIZE_FN pfnSynthesize) { UINT32 index; wClipboardFormat* format; @@ -280,13 +275,13 @@ BOOL ClipboardRegisterSynthesizer(wClipboard* clipboard, UINT32 formatId, { wClipboardSynthesizer* tmpSynthesizer; UINT32 numSynthesizers = format->numSynthesizers + 1; - tmpSynthesizer = (wClipboardSynthesizer*) realloc(format->synthesizers, - numSynthesizers * sizeof(wClipboardSynthesizer)); + tmpSynthesizer = (wClipboardSynthesizer*)realloc( + format->synthesizers, numSynthesizers * sizeof(wClipboardSynthesizer)); if (!tmpSynthesizer) return FALSE; - format->synthesizers = tmpSynthesizer; + format->synthesizers = tmpSynthesizer; format->numSynthesizers = numSynthesizers; index = numSynthesizers - 1; synthesizer = &(format->synthesizers[index]); @@ -445,7 +440,7 @@ void* ClipboardGetData(wClipboard* clipboard, UINT32 formatId, UINT32* pSize) return NULL; SrcSize = clipboard->size; - pSrcData = (void*) clipboard->data; + pSrcData = (void*)clipboard->data; if (formatId == format->formatId) { @@ -466,8 +461,7 @@ void* ClipboardGetData(wClipboard* clipboard, UINT32 formatId, UINT32* pSize) return NULL; DstSize = SrcSize; - pDstData = synthesizer->pfnSynthesize(clipboard, format->formatId, pSrcData, - &DstSize); + pDstData = synthesizer->pfnSynthesize(clipboard, format->formatId, pSrcData, &DstSize); if (pDstData) *pSize = DstSize; } @@ -475,8 +469,7 @@ void* ClipboardGetData(wClipboard* clipboard, UINT32 formatId, UINT32* pSize) return pDstData; } -BOOL ClipboardSetData(wClipboard* clipboard, UINT32 formatId, const void* data, - UINT32 size) +BOOL ClipboardSetData(wClipboard* clipboard, UINT32 formatId, const void* data, UINT32 size) { wClipboardFormat* format; @@ -488,7 +481,7 @@ BOOL ClipboardSetData(wClipboard* clipboard, UINT32 formatId, const void* data, if (!format) return FALSE; - free((void*) clipboard->data); + free((void*)clipboard->data); clipboard->data = malloc(size); if (!clipboard->data) @@ -549,7 +542,7 @@ static void ClipboardInitLocalFileSubsystem(wClipboard* clipboard) wClipboard* ClipboardCreate(void) { wClipboard* clipboard; - clipboard = (wClipboard*) calloc(1, sizeof(wClipboard)); + clipboard = (wClipboard*)calloc(1, sizeof(wClipboard)); if (!clipboard) return NULL; @@ -562,8 +555,7 @@ wClipboard* ClipboardCreate(void) clipboard->numFormats = 0; clipboard->maxFormats = 64; - clipboard->formats = (wClipboardFormat*) - calloc(clipboard->maxFormats, sizeof(wClipboardFormat)); + clipboard->formats = (wClipboardFormat*)calloc(clipboard->maxFormats, sizeof(wClipboardFormat)); if (!clipboard->formats) goto error_free_lock; @@ -597,7 +589,7 @@ void ClipboardDestroy(wClipboard* clipboard) for (index = 0; index < clipboard->numFormats; index++) { format = &(clipboard->formats[index]); - free((void*) format->formatName); + free((void*)format->formatName); if (format->synthesizers) { @@ -607,7 +599,7 @@ void ClipboardDestroy(wClipboard* clipboard) } } - free((void*) clipboard->data); + free((void*)clipboard->data); clipboard->data = NULL; clipboard->size = 0; clipboard->numFormats = 0; diff --git a/winpr/libwinpr/clipboard/posix.c b/winpr/libwinpr/clipboard/posix.c index 723fcbbe4..445baf1d3 100644 --- a/winpr/libwinpr/clipboard/posix.c +++ b/winpr/libwinpr/clipboard/posix.c @@ -287,7 +287,7 @@ static BOOL add_directory_entry_to_list(const char* local_dir_name, const WCHAR* } static BOOL do_add_directory_contents_to_list(const char* local_name, const WCHAR* remote_name, - DIR* dirp, wArrayList* files) + DIR* dirp, wArrayList* files) { /* * For some reason POSIX does not require readdir() to be thread-safe. @@ -327,7 +327,7 @@ static BOOL do_add_directory_contents_to_list(const char* local_name, const WCHA } static BOOL add_directory_contents_to_list(const char* local_name, const WCHAR* remote_name, - wArrayList* files) + wArrayList* files) { BOOL result = FALSE; DIR* dirp = NULL; @@ -418,7 +418,7 @@ static BOOL process_file_name(const char* local_name, wArrayList* files) static BOOL process_uri(const char* uri, size_t uri_len, wArrayList* files) { - const char prefix []= "file://"; + const char prefix[] = "file://"; BOOL result = FALSE; char* name = NULL; const size_t prefixLen = strnlen(prefix, sizeof(prefix)); @@ -496,7 +496,7 @@ static BOOL process_uri_list(const char* data, size_t length, wArrayList* files) } static BOOL convert_local_file_to_filedescriptor(const struct posix_file* file, - FILEDESCRIPTOR* descriptor) + FILEDESCRIPTOR* descriptor) { size_t remote_len = 0; descriptor->dwFlags = FD_ATTRIBUTES | FD_FILESIZE | FD_SHOWPROGRESSUI; @@ -518,7 +518,7 @@ static BOOL convert_local_file_to_filedescriptor(const struct posix_file* file, if (remote_len + 1 > ARRAYSIZE(descriptor->cFileName)) { - WLog_ERR(TAG, "file name too long (%"PRIuz" characters)", remote_len); + WLog_ERR(TAG, "file name too long (%" PRIuz " characters)", remote_len); return FALSE; } @@ -552,7 +552,7 @@ error: } static void* convert_uri_list_to_filedescriptors(wClipboard* clipboard, UINT32 formatId, - const void* data, UINT32* pSize) + const void* data, UINT32* pSize) { FILEDESCRIPTOR* descriptors = NULL; @@ -562,7 +562,7 @@ static void* convert_uri_list_to_filedescriptors(wClipboard* clipboard, UINT32 f if (formatId != ClipboardGetFormatId(clipboard, "text/uri-list")) return NULL; - if (!process_uri_list((const char*) data, *pSize, clipboard->localFiles)) + if (!process_uri_list((const char*)data, *pSize, clipboard->localFiles)) return NULL; descriptors = convert_local_file_list_to_filedescriptors(clipboard->localFiles); @@ -576,12 +576,12 @@ static void* convert_uri_list_to_filedescriptors(wClipboard* clipboard, UINT32 f } static void* convert_filedescriptors_to_uri_list(wClipboard* clipboard, UINT32 formatId, - const void* data, UINT32* pSize) + const void* data, UINT32* pSize) { const FILEDESCRIPTOR* descriptors; UINT32 nrDescriptors = 0; size_t count, x, alloc, pos, baseLength = 0; - const char* src = (const char*) data; + const char* src = (const char*)data; char* dst; if (!clipboard || !data || !pSize) @@ -674,13 +674,11 @@ static BOOL register_file_formats_and_synthesizers(wClipboard* clipboard) ArrayList_Object(clipboard->localFiles)->fnObjectFree = free_posix_file; - if (!ClipboardRegisterSynthesizer(clipboard, - local_file_format_id, file_group_format_id, + if (!ClipboardRegisterSynthesizer(clipboard, local_file_format_id, file_group_format_id, convert_uri_list_to_filedescriptors)) goto error_free_local_files; - if (!ClipboardRegisterSynthesizer(clipboard, - file_group_format_id, local_file_format_id, + if (!ClipboardRegisterSynthesizer(clipboard, file_group_format_id, local_file_format_id, convert_filedescriptors_to_uri_list)) goto error_free_local_files; @@ -764,7 +762,7 @@ static UINT posix_file_read_open(struct posix_file* file) file->offset = 0; file->size = statbuf.st_size; WLog_VRB(TAG, "open file %d -> %s", file->fd, file->local_name); - WLog_VRB(TAG, "file %d size: %"PRIu64" bytes", file->fd, file->size); + WLog_VRB(TAG, "file %d size: %" PRIu64 " bytes", file->fd, file->size); return NO_ERROR; } @@ -782,8 +780,8 @@ static UINT posix_file_read_seek(struct posix_file* file, UINT64 offset) if (file->offset == (INT64)offset) return NO_ERROR; - WLog_VRB(TAG, "file %d force seeking to %"PRIu64", current %"PRIu64, file->fd, - offset, file->offset); + WLog_VRB(TAG, "file %d force seeking to %" PRIu64 ", current %" PRIu64, file->fd, offset, + file->offset); if (lseek(file->fd, (off_t)offset, SEEK_SET) < 0) { @@ -795,17 +793,17 @@ static UINT posix_file_read_seek(struct posix_file* file, UINT64 offset) return NO_ERROR; } -static UINT posix_file_read_perform(struct posix_file* file, UINT32 size, - BYTE** actual_data, UINT32* actual_size) +static UINT posix_file_read_perform(struct posix_file* file, UINT32 size, BYTE** actual_data, + UINT32* actual_size) { BYTE* buffer = NULL; ssize_t amount = 0; - WLog_VRB(TAG, "file %d request read %"PRIu32" bytes", file->fd, size); + WLog_VRB(TAG, "file %d request read %" PRIu32 " bytes", file->fd, size); buffer = malloc(size); if (!buffer) { - WLog_ERR(TAG, "failed to allocate %"PRIu32" buffer bytes", size); + WLog_ERR(TAG, "failed to allocate %" PRIu32 " buffer bytes", size); return ERROR_NOT_ENOUGH_MEMORY; } @@ -821,8 +819,8 @@ static UINT posix_file_read_perform(struct posix_file* file, UINT32 size, *actual_data = buffer; *actual_size = amount; file->offset += amount; - WLog_VRB(TAG, "file %d actual read %"PRIu32" bytes (offset %"PRIu64")", file->fd, - amount, file->offset); + WLog_VRB(TAG, "file %d actual read %" PRIu32 " bytes (offset %" PRIu64 ")", file->fd, amount, + file->offset); return NO_ERROR; error: free(buffer); @@ -898,7 +896,7 @@ static UINT posix_file_request_range(wClipboardDelegate* delegate, if (!file) return ERROR_INDEX_ABSENT; - offset = (((UINT64) request->nPositionHigh) << 32) | ((UINT64) request->nPositionLow); + offset = (((UINT64)request->nPositionHigh) << 32) | ((UINT64)request->nPositionLow); error = posix_file_get_range(file, offset, request->cbRequested, &data, &size); if (error) @@ -926,7 +924,8 @@ static UINT dummy_file_size_failure(wClipboardDelegate* delegate, } static UINT dummy_file_range_success(wClipboardDelegate* delegate, - const wClipboardFileRangeRequest* request, const BYTE* data, UINT32 size) + const wClipboardFileRangeRequest* request, const BYTE* data, + UINT32 size) { return ERROR_NOT_SUPPORTED; } diff --git a/winpr/libwinpr/clipboard/synthetic.c b/winpr/libwinpr/clipboard/synthetic.c index a1d97f022..63b515348 100644 --- a/winpr/libwinpr/clipboard/synthetic.c +++ b/winpr/libwinpr/clipboard/synthetic.c @@ -39,7 +39,7 @@ */ static void* clipboard_synthesize_cf_text(wClipboard* clipboard, UINT32 formatId, const void* data, - UINT32* pSize) + UINT32* pSize) { int size; char* pDstData = NULL; @@ -53,13 +53,12 @@ static void* clipboard_synthesize_cf_text(wClipboard* clipboard, UINT32 formatId return NULL; wsize = _wcsnlen(data, (*pSize) / 2); - size = ConvertFromUnicode(CP_UTF8, 0, (LPCWSTR) data, - wsize, (CHAR**) &str, 0, NULL, NULL); + size = ConvertFromUnicode(CP_UTF8, 0, (LPCWSTR)data, wsize, (CHAR**)&str, 0, NULL, NULL); if (!str) return NULL; - pDstData = ConvertLineEndingToCRLF((const char*) str, &size); + pDstData = ConvertLineEndingToCRLF((const char*)str, &size); free(str); *pSize = size; return pDstData; @@ -70,8 +69,8 @@ static void* clipboard_synthesize_cf_text(wClipboard* clipboard, UINT32 formatId (formatId == ClipboardGetFormatId(clipboard, "TEXT")) || (formatId == ClipboardGetFormatId(clipboard, "STRING"))) { - size = (INT64) * pSize; - pDstData = ConvertLineEndingToCRLF((const char*) data, &size); + size = (INT64)*pSize; + pDstData = ConvertLineEndingToCRLF((const char*)data, &size); if (!pDstData) return NULL; @@ -90,7 +89,7 @@ static void* clipboard_synthesize_cf_text(wClipboard* clipboard, UINT32 formatId */ static void* clipboard_synthesize_cf_oemtext(wClipboard* clipboard, UINT32 formatId, - const void* data, UINT32* pSize) + const void* data, UINT32* pSize) { return clipboard_synthesize_cf_text(clipboard, formatId, data, pSize); } @@ -102,16 +101,16 @@ static void* clipboard_synthesize_cf_oemtext(wClipboard* clipboard, UINT32 forma */ static void* clipboard_synthesize_cf_locale(wClipboard* clipboard, UINT32 formatId, - const void* data, UINT32* pSize) + const void* data, UINT32* pSize) { UINT32* pDstData = NULL; - pDstData = (UINT32*) malloc(sizeof(UINT32)); + pDstData = (UINT32*)malloc(sizeof(UINT32)); if (!pDstData) return NULL; *pDstData = 0x0409; /* English - United States */ - return (void*) pDstData; + return (void*)pDstData; } /** @@ -121,7 +120,7 @@ static void* clipboard_synthesize_cf_locale(wClipboard* clipboard, UINT32 format */ static void* clipboard_synthesize_cf_unicodetext(wClipboard* clipboard, UINT32 formatId, - const void* data, UINT32* pSize) + const void* data, UINT32* pSize) { int size; int status; @@ -137,8 +136,8 @@ static void* clipboard_synthesize_cf_unicodetext(wClipboard* clipboard, UINT32 f if (!pSize || (*pSize > INT32_MAX)) return NULL; - size = (int) * pSize; - crlfStr = ConvertLineEndingToCRLF((char*) data, &size); + size = (int)*pSize; + crlfStr = ConvertLineEndingToCRLF((char*)data, &size); if (!crlfStr) return NULL; @@ -152,7 +151,7 @@ static void* clipboard_synthesize_cf_unicodetext(wClipboard* clipboard, UINT32 f *pSize = status * 2; } - return (void*) pDstData; + return (void*)pDstData; } /** @@ -162,7 +161,7 @@ static void* clipboard_synthesize_cf_unicodetext(wClipboard* clipboard, UINT32 f */ static void* clipboard_synthesize_utf8_string(wClipboard* clipboard, UINT32 formatId, - const void* data, UINT32* pSize) + const void* data, UINT32* pSize) { INT64 size; char* pDstData = NULL; @@ -170,8 +169,8 @@ static void* clipboard_synthesize_utf8_string(wClipboard* clipboard, UINT32 form if (formatId == CF_UNICODETEXT) { size_t wsize = _wcsnlen(data, (*pSize) / 2); - size = ConvertFromUnicode(CP_UTF8, 0, (LPWSTR) data, - wsize, (CHAR**) &pDstData, 0, NULL, NULL); + size = + ConvertFromUnicode(CP_UTF8, 0, (LPWSTR)data, wsize, (CHAR**)&pDstData, 0, NULL, NULL); if (!pDstData) return NULL; @@ -185,14 +184,14 @@ static void* clipboard_synthesize_utf8_string(wClipboard* clipboard, UINT32 form (formatId == ClipboardGetFormatId(clipboard, "TEXT")) || (formatId == ClipboardGetFormatId(clipboard, "STRING"))) { - size = (INT64) * pSize; - pDstData = (char*) malloc(size); + size = (INT64)*pSize; + pDstData = (char*)malloc(size); if (!pDstData) return NULL; CopyMemory(pDstData, data, size); - size = ConvertLineEndingToLF((char*) pDstData, size); + size = ConvertLineEndingToLF((char*)pDstData, size); *pSize = size; return pDstData; } @@ -207,7 +206,7 @@ static void* clipboard_synthesize_utf8_string(wClipboard* clipboard, UINT32 form */ static void* clipboard_synthesize_cf_dib(wClipboard* clipboard, UINT32 formatId, const void* data, - UINT32* pSize) + UINT32* pSize) { UINT32 SrcSize; UINT32 DstSize; @@ -224,18 +223,18 @@ static void* clipboard_synthesize_cf_dib(wClipboard* clipboard, UINT32 formatId, if (SrcSize < (sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER))) return NULL; - pFileHeader = (BITMAPFILEHEADER*) data; + pFileHeader = (BITMAPFILEHEADER*)data; if (pFileHeader->bfType != 0x4D42) return NULL; DstSize = SrcSize - sizeof(BITMAPFILEHEADER); - pDstData = (BYTE*) malloc(DstSize); + pDstData = (BYTE*)malloc(DstSize); if (!pDstData) return NULL; - data = (void*) & ((BYTE*) data)[sizeof(BITMAPFILEHEADER)]; + data = (void*)&((BYTE*)data)[sizeof(BITMAPFILEHEADER)]; CopyMemory(pDstData, data, DstSize); *pSize = DstSize; return pDstData; @@ -251,7 +250,7 @@ static void* clipboard_synthesize_cf_dib(wClipboard* clipboard, UINT32 formatId, */ static void* clipboard_synthesize_cf_dibv5(wClipboard* clipboard, UINT32 formatId, const void* data, - UINT32* pSize) + UINT32* pSize) { if (formatId == CF_DIB) { @@ -270,7 +269,7 @@ static void* clipboard_synthesize_cf_dibv5(wClipboard* clipboard, UINT32 formatI */ static void* clipboard_synthesize_image_bmp(wClipboard* clipboard, UINT32 formatId, - const void* data, UINT32* pSize) + const void* data, UINT32* pSize) { UINT32 SrcSize; UINT32 DstSize; @@ -286,18 +285,18 @@ static void* clipboard_synthesize_image_bmp(wClipboard* clipboard, UINT32 format if (SrcSize < sizeof(BITMAPINFOHEADER)) return NULL; - pInfoHeader = (BITMAPINFOHEADER*) data; + pInfoHeader = (BITMAPINFOHEADER*)data; if ((pInfoHeader->biBitCount < 1) || (pInfoHeader->biBitCount > 32)) return NULL; DstSize = sizeof(BITMAPFILEHEADER) + SrcSize; - pDstData = (BYTE*) malloc(DstSize); + pDstData = (BYTE*)malloc(DstSize); if (!pDstData) return NULL; - pFileHeader = (BITMAPFILEHEADER*) pDstData; + pFileHeader = (BITMAPFILEHEADER*)pDstData; pFileHeader->bfType = 0x4D42; pFileHeader->bfSize = DstSize; pFileHeader->bfReserved1 = 0; @@ -322,11 +321,11 @@ static void* clipboard_synthesize_image_bmp(wClipboard* clipboard, UINT32 format */ static void* clipboard_synthesize_html_format(wClipboard* clipboard, UINT32 formatId, - const void* data, UINT32* pSize) + const void* data, UINT32* pSize) { char* pSrcData = NULL; char* pDstData = NULL; - INT64 SrcSize = (INT64) * pSize; + INT64 SrcSize = (INT64)*pSize; if (formatId == ClipboardGetFormatId(clipboard, "text/html")) { @@ -341,20 +340,19 @@ static void* clipboard_synthesize_html_format(wClipboard* clipboard, UINT32 form if ((bom[0] == 0xFE) && (bom[1] == 0xFF)) { - ByteSwapUnicode((WCHAR*) data, SrcSize / 2); + ByteSwapUnicode((WCHAR*)data, SrcSize / 2); } if ((bom[0] == 0xFF) && (bom[1] == 0xFE)) { - wstr = (WCHAR*) & ((BYTE*) data)[2]; - ConvertFromUnicode(CP_UTF8, 0, wstr, - (SrcSize - 2) / 2, &pSrcData, 0, NULL, NULL); + wstr = (WCHAR*)&((BYTE*)data)[2]; + ConvertFromUnicode(CP_UTF8, 0, wstr, (SrcSize - 2) / 2, &pSrcData, 0, NULL, NULL); } } if (!pSrcData) { - pSrcData = (char*) calloc(1, SrcSize + 1); + pSrcData = (char*)calloc(1, SrcSize + 1); if (!pSrcData) return NULL; @@ -362,7 +360,7 @@ static void* clipboard_synthesize_html_format(wClipboard* clipboard, UINT32 form CopyMemory(pSrcData, data, SrcSize); } - pDstData = (char*) calloc(1, SrcSize + 200); + pDstData = (char*)calloc(1, SrcSize + 200); if (!pDstData) { @@ -382,7 +380,7 @@ static void* clipboard_synthesize_html_format(wClipboard* clipboard, UINT32 form body = strstr(pSrcData, ""); /* StartFragment */ - sprintf_s(num, sizeof(num), "%010"PRIuz"", strnlen(pDstData, SrcSize + 200)); + sprintf_s(num, sizeof(num), "%010" PRIuz "", strnlen(pDstData, SrcSize + 200)); CopyMemory(&pDstData[69], num, 10); strcat(pDstData, pSrcData); /* EndFragment */ - sprintf_s(num, sizeof(num), "%010"PRIuz"", strnlen(pDstData, SrcSize + 200)); + sprintf_s(num, sizeof(num), "%010" PRIuz "", strnlen(pDstData, SrcSize + 200)); CopyMemory(&pDstData[93], num, 10); strcat(pDstData, ""); @@ -402,9 +400,9 @@ static void* clipboard_synthesize_html_format(wClipboard* clipboard, UINT32 form strcat(pDstData, ""); /* EndHTML */ - sprintf_s(num, sizeof(num), "%010"PRIuz"", strnlen(pDstData, SrcSize + 200)); + sprintf_s(num, sizeof(num), "%010" PRIuz "", strnlen(pDstData, SrcSize + 200)); CopyMemory(&pDstData[43], num, 10); - *pSize = (UINT32) strlen(pDstData) + 1; + *pSize = (UINT32)strlen(pDstData) + 1; free(pSrcData); } @@ -418,7 +416,7 @@ static void* clipboard_synthesize_html_format(wClipboard* clipboard, UINT32 form */ static void* clipboard_synthesize_text_html(wClipboard* clipboard, UINT32 formatId, - const void* data, UINT32* pSize) + const void* data, UINT32* pSize) { long beg; long end; @@ -431,8 +429,8 @@ static void* clipboard_synthesize_text_html(wClipboard* clipboard, UINT32 format if (formatId == ClipboardGetFormatId(clipboard, "HTML Format")) { - str = (char*) data; - SrcSize = (INT64) * pSize; + str = (char*)data; + SrcSize = (INT64)*pSize; begStr = strstr(str, "StartHTML:"); endStr = strstr(str, "EndHTML:"); @@ -447,21 +445,22 @@ static void* clipboard_synthesize_text_html(wClipboard* clipboard, UINT32 format end = strtol(&endStr[8], NULL, 10); - if (beg < 0 || end < 0 || (beg > SrcSize) || (end > SrcSize) || (beg >= end) || (errno != 0)) + if (beg < 0 || end < 0 || (beg > SrcSize) || (end > SrcSize) || (beg >= end) || + (errno != 0)) return NULL; DstSize = end - beg; - pDstData = (BYTE*) malloc(SrcSize - beg + 1); + pDstData = (BYTE*)malloc(SrcSize - beg + 1); if (!pDstData) return NULL; CopyMemory(pDstData, &str[beg], DstSize); - DstSize = ConvertLineEndingToLF((char*) pDstData, DstSize); - *pSize = (UINT32) DstSize; + DstSize = ConvertLineEndingToLF((char*)pDstData, DstSize); + *pSize = (UINT32)DstSize; } - return (void*) pDstData; + return (void*)pDstData; } BOOL ClipboardInitSynthesizers(wClipboard* clipboard) @@ -471,32 +470,26 @@ BOOL ClipboardInitSynthesizers(wClipboard* clipboard) /** * CF_TEXT */ - ClipboardRegisterSynthesizer(clipboard, CF_TEXT, CF_OEMTEXT, - clipboard_synthesize_cf_oemtext); + ClipboardRegisterSynthesizer(clipboard, CF_TEXT, CF_OEMTEXT, clipboard_synthesize_cf_oemtext); ClipboardRegisterSynthesizer(clipboard, CF_TEXT, CF_UNICODETEXT, clipboard_synthesize_cf_unicodetext); - ClipboardRegisterSynthesizer(clipboard, CF_TEXT, CF_LOCALE, - clipboard_synthesize_cf_locale); + ClipboardRegisterSynthesizer(clipboard, CF_TEXT, CF_LOCALE, clipboard_synthesize_cf_locale); altFormatId = ClipboardRegisterFormat(clipboard, "UTF8_STRING"); - ClipboardRegisterSynthesizer(clipboard, CF_TEXT, altFormatId, - clipboard_synthesize_utf8_string); + ClipboardRegisterSynthesizer(clipboard, CF_TEXT, altFormatId, clipboard_synthesize_utf8_string); /** * CF_OEMTEXT */ - ClipboardRegisterSynthesizer(clipboard, CF_OEMTEXT, CF_TEXT, - clipboard_synthesize_cf_text); + ClipboardRegisterSynthesizer(clipboard, CF_OEMTEXT, CF_TEXT, clipboard_synthesize_cf_text); ClipboardRegisterSynthesizer(clipboard, CF_OEMTEXT, CF_UNICODETEXT, clipboard_synthesize_cf_unicodetext); - ClipboardRegisterSynthesizer(clipboard, CF_OEMTEXT, CF_LOCALE, - clipboard_synthesize_cf_locale); + ClipboardRegisterSynthesizer(clipboard, CF_OEMTEXT, CF_LOCALE, clipboard_synthesize_cf_locale); altFormatId = ClipboardRegisterFormat(clipboard, "UTF8_STRING"); ClipboardRegisterSynthesizer(clipboard, CF_OEMTEXT, altFormatId, clipboard_synthesize_utf8_string); /** * CF_UNICODETEXT */ - ClipboardRegisterSynthesizer(clipboard, CF_UNICODETEXT, CF_TEXT, - clipboard_synthesize_cf_text); + ClipboardRegisterSynthesizer(clipboard, CF_UNICODETEXT, CF_TEXT, clipboard_synthesize_cf_text); ClipboardRegisterSynthesizer(clipboard, CF_UNICODETEXT, CF_OEMTEXT, clipboard_synthesize_cf_oemtext); ClipboardRegisterSynthesizer(clipboard, CF_UNICODETEXT, CF_LOCALE, @@ -511,8 +504,7 @@ BOOL ClipboardInitSynthesizers(wClipboard* clipboard) if (formatId) { - ClipboardRegisterSynthesizer(clipboard, formatId, CF_TEXT, - clipboard_synthesize_cf_text); + ClipboardRegisterSynthesizer(clipboard, formatId, CF_TEXT, clipboard_synthesize_cf_text); ClipboardRegisterSynthesizer(clipboard, formatId, CF_OEMTEXT, clipboard_synthesize_cf_oemtext); ClipboardRegisterSynthesizer(clipboard, formatId, CF_UNICODETEXT, @@ -528,8 +520,7 @@ BOOL ClipboardInitSynthesizers(wClipboard* clipboard) if (formatId) { - ClipboardRegisterSynthesizer(clipboard, formatId, CF_TEXT, - clipboard_synthesize_cf_text); + ClipboardRegisterSynthesizer(clipboard, formatId, CF_TEXT, clipboard_synthesize_cf_text); ClipboardRegisterSynthesizer(clipboard, formatId, CF_OEMTEXT, clipboard_synthesize_cf_oemtext); ClipboardRegisterSynthesizer(clipboard, formatId, CF_UNICODETEXT, @@ -545,8 +536,7 @@ BOOL ClipboardInitSynthesizers(wClipboard* clipboard) if (formatId) { - ClipboardRegisterSynthesizer(clipboard, formatId, CF_TEXT, - clipboard_synthesize_cf_text); + ClipboardRegisterSynthesizer(clipboard, formatId, CF_TEXT, clipboard_synthesize_cf_text); ClipboardRegisterSynthesizer(clipboard, formatId, CF_OEMTEXT, clipboard_synthesize_cf_oemtext); ClipboardRegisterSynthesizer(clipboard, formatId, CF_UNICODETEXT, @@ -562,8 +552,7 @@ BOOL ClipboardInitSynthesizers(wClipboard* clipboard) if (formatId) { - ClipboardRegisterSynthesizer(clipboard, formatId, CF_TEXT, - clipboard_synthesize_cf_text); + ClipboardRegisterSynthesizer(clipboard, formatId, CF_TEXT, clipboard_synthesize_cf_text); ClipboardRegisterSynthesizer(clipboard, formatId, CF_OEMTEXT, clipboard_synthesize_cf_oemtext); ClipboardRegisterSynthesizer(clipboard, formatId, CF_UNICODETEXT, @@ -578,8 +567,7 @@ BOOL ClipboardInitSynthesizers(wClipboard* clipboard) if (formatId) { - ClipboardRegisterSynthesizer(clipboard, CF_DIB, CF_DIBV5, - clipboard_synthesize_cf_dibv5); + ClipboardRegisterSynthesizer(clipboard, CF_DIB, CF_DIBV5, clipboard_synthesize_cf_dibv5); altFormatId = ClipboardRegisterFormat(clipboard, "image/bmp"); ClipboardRegisterSynthesizer(clipboard, CF_DIB, altFormatId, clipboard_synthesize_image_bmp); @@ -591,8 +579,7 @@ BOOL ClipboardInitSynthesizers(wClipboard* clipboard) if (formatId && 0) { - ClipboardRegisterSynthesizer(clipboard, CF_DIBV5, CF_DIB, - clipboard_synthesize_cf_dib); + ClipboardRegisterSynthesizer(clipboard, CF_DIBV5, CF_DIB, clipboard_synthesize_cf_dib); altFormatId = ClipboardRegisterFormat(clipboard, "image/bmp"); ClipboardRegisterSynthesizer(clipboard, CF_DIBV5, altFormatId, clipboard_synthesize_image_bmp); @@ -605,10 +592,8 @@ BOOL ClipboardInitSynthesizers(wClipboard* clipboard) if (formatId) { - ClipboardRegisterSynthesizer(clipboard, formatId, CF_DIB, - clipboard_synthesize_cf_dib); - ClipboardRegisterSynthesizer(clipboard, formatId, CF_DIBV5, - clipboard_synthesize_cf_dibv5); + ClipboardRegisterSynthesizer(clipboard, formatId, CF_DIB, clipboard_synthesize_cf_dib); + ClipboardRegisterSynthesizer(clipboard, formatId, CF_DIBV5, clipboard_synthesize_cf_dibv5); } /** diff --git a/winpr/libwinpr/clipboard/test/TestClipboardFormats.c b/winpr/libwinpr/clipboard/test/TestClipboardFormats.c index 2ecfe68aa..46ca404d2 100644 --- a/winpr/libwinpr/clipboard/test/TestClipboardFormats.c +++ b/winpr/libwinpr/clipboard/test/TestClipboardFormats.c @@ -28,7 +28,7 @@ int TestClipboardFormats(int argc, char* argv[]) { UINT32 formatId = pFormatIds[index]; formatName = ClipboardGetFormatName(clipboard, formatId); - fprintf(stderr, "Format: 0x%08"PRIX32" %s\n", formatId, formatName); + fprintf(stderr, "Format: 0x%08" PRIX32 " %s\n", formatId, formatName); } free(pFormatIds); @@ -48,11 +48,10 @@ int TestClipboardFormats(int argc, char* argv[]) } SrcSize = (UINT32)(strnlen(pSrcData, UINT32_MAX - 1) + 1); - bSuccess = ClipboardSetData(clipboard, utf8StringFormatId, pSrcData, - SrcSize); - fprintf(stderr, "ClipboardSetData: %"PRId32"\n", bSuccess); + bSuccess = ClipboardSetData(clipboard, utf8StringFormatId, pSrcData, SrcSize); + fprintf(stderr, "ClipboardSetData: %" PRId32 "\n", bSuccess); DstSize = 0; - pDstData = (char*) ClipboardGetData(clipboard, utf8StringFormatId, &DstSize); + pDstData = (char*)ClipboardGetData(clipboard, utf8StringFormatId, &DstSize); fprintf(stderr, "ClipboardGetData: %s\n", pDstData); free(pDstData); } @@ -63,7 +62,7 @@ int TestClipboardFormats(int argc, char* argv[]) char* pSrcData; WCHAR* pDstData; DstSize = 0; - pDstData = (WCHAR*) ClipboardGetData(clipboard, CF_UNICODETEXT, &DstSize); + pDstData = (WCHAR*)ClipboardGetData(clipboard, CF_UNICODETEXT, &DstSize); pSrcData = NULL; ConvertFromUnicode(CP_UTF8, 0, pDstData, -1, &pSrcData, 0, NULL, NULL); fprintf(stderr, "ClipboardGetData (synthetic): %s\n", pSrcData); @@ -78,11 +77,10 @@ int TestClipboardFormats(int argc, char* argv[]) { UINT32 formatId = pFormatIds[index]; formatName = ClipboardGetFormatName(clipboard, formatId); - fprintf(stderr, "Format: 0x%08"PRIX32" %s\n", formatId, formatName); + fprintf(stderr, "Format: 0x%08" PRIX32 " %s\n", formatId, formatName); } free(pFormatIds); ClipboardDestroy(clipboard); return 0; } - diff --git a/winpr/libwinpr/com/com.c b/winpr/libwinpr/com/com.c index 367f12b6f..95111e4fc 100644 --- a/winpr/libwinpr/com/com.c +++ b/winpr/libwinpr/com/com.c @@ -118,7 +118,6 @@ HRESULT CoInitializeEx(LPVOID pvReserved, DWORD dwCoInit) void CoUninitialize(void) { - } #endif diff --git a/winpr/libwinpr/com/test/TestComReference.c b/winpr/libwinpr/com/test/TestComReference.c index 4b26f3da3..e527d8031 100644 --- a/winpr/libwinpr/com/test/TestComReference.c +++ b/winpr/libwinpr/com/test/TestComReference.c @@ -5,4 +5,3 @@ int TestComReference(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/comm/comm.c b/winpr/libwinpr/comm/comm.c index 13ab10dd9..2c89de5b0 100644 --- a/winpr/libwinpr/comm/comm.c +++ b/winpr/libwinpr/comm/comm.c @@ -45,7 +45,6 @@ #include "comm_ioctl.h" - /** * Communication Resources: * http://msdn.microsoft.com/en-us/library/windows/desktop/aa363196/ @@ -53,7 +52,6 @@ #include "comm.h" - static wLog* _Log = NULL; struct comm_device @@ -64,10 +62,9 @@ struct comm_device typedef struct comm_device COMM_DEVICE; - /* FIXME: get a clever data structure, see also io.h functions */ /* _CommDevices is a NULL-terminated array with a maximun of COMM_DEVICE_MAX COMM_DEVICE */ -#define COMM_DEVICE_MAX 128 +#define COMM_DEVICE_MAX 128 static COMM_DEVICE** _CommDevices = NULL; static CRITICAL_SECTION _CommDevicesLock; @@ -128,7 +125,6 @@ static BOOL CommInitialized() return TRUE; } - void CommLog_Print(DWORD level, ...) { if (!CommInitialized()) @@ -140,7 +136,6 @@ void CommLog_Print(DWORD level, ...) va_end(ap); } - BOOL BuildCommDCBA(LPCSTR lpDef, LPDCB lpDCB) { if (!CommInitialized()) @@ -163,8 +158,7 @@ BOOL BuildCommDCBW(LPCWSTR lpDef, LPDCB lpDCB) return FALSE; } -BOOL BuildCommDCBAndTimeoutsA(LPCSTR lpDef, LPDCB lpDCB, - LPCOMMTIMEOUTS lpCommTimeouts) +BOOL BuildCommDCBAndTimeoutsA(LPCSTR lpDef, LPDCB lpDCB, LPCOMMTIMEOUTS lpCommTimeouts) { if (!CommInitialized()) return FALSE; @@ -175,8 +169,7 @@ BOOL BuildCommDCBAndTimeoutsA(LPCSTR lpDef, LPDCB lpDCB, return FALSE; } -BOOL BuildCommDCBAndTimeoutsW(LPCWSTR lpDef, LPDCB lpDCB, - LPCOMMTIMEOUTS lpCommTimeouts) +BOOL BuildCommDCBAndTimeoutsW(LPCWSTR lpDef, LPDCB lpDCB, LPCOMMTIMEOUTS lpCommTimeouts) { if (!CommInitialized()) return FALSE; @@ -211,7 +204,7 @@ BOOL CommConfigDialogW(LPCWSTR lpszName, HWND hWnd, LPCOMMCONFIG lpCC) BOOL GetCommConfig(HANDLE hCommDev, LPCOMMCONFIG lpCC, LPDWORD lpdwSize) { - WINPR_COMM* pComm = (WINPR_COMM*) hCommDev; + WINPR_COMM* pComm = (WINPR_COMM*)hCommDev; if (!CommInitialized()) return FALSE; @@ -228,7 +221,7 @@ BOOL GetCommConfig(HANDLE hCommDev, LPCOMMCONFIG lpCC, LPDWORD lpdwSize) BOOL SetCommConfig(HANDLE hCommDev, LPCOMMCONFIG lpCC, DWORD dwSize) { - WINPR_COMM* pComm = (WINPR_COMM*) hCommDev; + WINPR_COMM* pComm = (WINPR_COMM*)hCommDev; if (!CommInitialized()) return FALSE; @@ -245,7 +238,7 @@ BOOL SetCommConfig(HANDLE hCommDev, LPCOMMCONFIG lpCC, DWORD dwSize) BOOL GetCommMask(HANDLE hFile, PDWORD lpEvtMask) { - WINPR_COMM* pComm = (WINPR_COMM*) hFile; + WINPR_COMM* pComm = (WINPR_COMM*)hFile; if (!CommInitialized()) return FALSE; @@ -262,7 +255,7 @@ BOOL GetCommMask(HANDLE hFile, PDWORD lpEvtMask) BOOL SetCommMask(HANDLE hFile, DWORD dwEvtMask) { - WINPR_COMM* pComm = (WINPR_COMM*) hFile; + WINPR_COMM* pComm = (WINPR_COMM*)hFile; if (!CommInitialized()) return FALSE; @@ -279,7 +272,7 @@ BOOL SetCommMask(HANDLE hFile, DWORD dwEvtMask) BOOL GetCommModemStatus(HANDLE hFile, PDWORD lpModemStat) { - WINPR_COMM* pComm = (WINPR_COMM*) hFile; + WINPR_COMM* pComm = (WINPR_COMM*)hFile; if (!CommInitialized()) return FALSE; @@ -301,7 +294,7 @@ BOOL GetCommModemStatus(HANDLE hFile, PDWORD lpModemStat) */ BOOL GetCommProperties(HANDLE hFile, LPCOMMPROP lpCommProp) { - WINPR_COMM* pComm = (WINPR_COMM*) hFile; + WINPR_COMM* pComm = (WINPR_COMM*)hFile; DWORD bytesReturned; if (!CommInitialized()) @@ -313,8 +306,8 @@ BOOL GetCommProperties(HANDLE hFile, LPCOMMPROP lpCommProp) return FALSE; } - if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_GET_PROPERTIES, NULL, 0, - lpCommProp, sizeof(COMMPROP), &bytesReturned, NULL)) + if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_GET_PROPERTIES, NULL, 0, lpCommProp, + sizeof(COMMPROP), &bytesReturned, NULL)) { CommLog_Print(WLOG_WARN, "GetCommProperties failure."); return FALSE; @@ -323,8 +316,6 @@ BOOL GetCommProperties(HANDLE hFile, LPCOMMPROP lpCommProp) return TRUE; } - - /** * * @@ -338,7 +329,7 @@ BOOL GetCommState(HANDLE hFile, LPDCB lpDCB) { DCB* lpLocalDcb; struct termios currentState; - WINPR_COMM* pComm = (WINPR_COMM*) hFile; + WINPR_COMM* pComm = (WINPR_COMM*)hFile; DWORD bytesReturned; if (!CommInitialized()) @@ -392,8 +383,7 @@ BOOL GetCommState(HANDLE hFile, LPDCB lpDCB) if (!lpLocalDcb->fBinary) { - CommLog_Print(WLOG_WARN, - "Unexpected nonbinary mode, consider to unset the ICANON flag."); + CommLog_Print(WLOG_WARN, "Unexpected nonbinary mode, consider to unset the ICANON flag."); } lpLocalDcb->fParity = (currentState.c_iflag & INPCK) != 0; @@ -402,15 +392,12 @@ BOOL GetCommState(HANDLE hFile, LPDCB lpDCB) if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_GET_HANDFLOW, NULL, 0, &handflow, sizeof(SERIAL_HANDFLOW), &bytesReturned, NULL)) { - CommLog_Print(WLOG_WARN, - "GetCommState failure: could not get the handflow settings."); + CommLog_Print(WLOG_WARN, "GetCommState failure: could not get the handflow settings."); goto error_handle; } - lpLocalDcb->fOutxCtsFlow = (handflow.ControlHandShake & SERIAL_CTS_HANDSHAKE) != - 0; - lpLocalDcb->fOutxDsrFlow = (handflow.ControlHandShake & SERIAL_DSR_HANDSHAKE) != - 0; + lpLocalDcb->fOutxCtsFlow = (handflow.ControlHandShake & SERIAL_CTS_HANDSHAKE) != 0; + lpLocalDcb->fOutxDsrFlow = (handflow.ControlHandShake & SERIAL_DSR_HANDSHAKE) != 0; if (handflow.ControlHandShake & SERIAL_DTR_HANDSHAKE) { @@ -445,20 +432,19 @@ BOOL GetCommState(HANDLE hFile, LPDCB lpDCB) lpLocalDcb->fRtsControl = RTS_CONTROL_DISABLE; } - // FIXME: how to get the RTS_CONTROL_TOGGLE state? Does it match the UART 16750's Autoflow Control Enabled bit in its Modem Control Register (MCR) - lpLocalDcb->fAbortOnError = (handflow.ControlHandShake & SERIAL_ERROR_ABORT) != - 0; + // FIXME: how to get the RTS_CONTROL_TOGGLE state? Does it match the UART 16750's Autoflow + // Control Enabled bit in its Modem Control Register (MCR) + lpLocalDcb->fAbortOnError = (handflow.ControlHandShake & SERIAL_ERROR_ABORT) != 0; /* lpLocalDcb->fDummy2 not used */ lpLocalDcb->wReserved = 0; /* must be zero */ lpLocalDcb->XonLim = handflow.XonLimit; lpLocalDcb->XoffLim = handflow.XoffLimit; SERIAL_LINE_CONTROL lineControl; - if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_GET_LINE_CONTROL, NULL, 0, - &lineControl, sizeof(SERIAL_LINE_CONTROL), &bytesReturned, NULL)) + if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_GET_LINE_CONTROL, NULL, 0, &lineControl, + sizeof(SERIAL_LINE_CONTROL), &bytesReturned, NULL)) { - CommLog_Print(WLOG_WARN, - "GetCommState failure: could not get the control settings."); + CommLog_Print(WLOG_WARN, "GetCommState failure: could not get the control settings."); goto error_handle; } @@ -470,8 +456,7 @@ BOOL GetCommState(HANDLE hFile, LPDCB lpDCB) if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_GET_CHARS, NULL, 0, &serialChars, sizeof(SERIAL_CHARS), &bytesReturned, NULL)) { - CommLog_Print(WLOG_WARN, - "GetCommState failure: could not get the serial chars."); + CommLog_Print(WLOG_WARN, "GetCommState failure: could not get the serial chars."); goto error_handle; } @@ -488,7 +473,6 @@ error_handle: return FALSE; } - /** * @return TRUE on success, FALSE otherwise. * @@ -503,7 +487,7 @@ error_handle: BOOL SetCommState(HANDLE hFile, LPDCB lpDCB) { struct termios upcomingTermios; - WINPR_COMM* pComm = (WINPR_COMM*) hFile; + WINPR_COMM* pComm = (WINPR_COMM*)hFile; DWORD bytesReturned; /* FIXME: validate changes according GetCommProperties? */ @@ -529,8 +513,8 @@ BOOL SetCommState(HANDLE hFile, LPDCB lpDCB) SERIAL_BAUD_RATE baudRate; baudRate.BaudRate = lpDCB->BaudRate; - if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_SET_BAUD_RATE, &baudRate, - sizeof(SERIAL_BAUD_RATE), NULL, 0, &bytesReturned, NULL)) + if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_SET_BAUD_RATE, &baudRate, sizeof(SERIAL_BAUD_RATE), + NULL, 0, &bytesReturned, NULL)) { CommLog_Print(WLOG_WARN, "SetCommState failure: could not set the baud rate."); return FALSE; @@ -542,8 +526,7 @@ BOOL SetCommState(HANDLE hFile, LPDCB lpDCB) sizeof(SERIAL_CHARS), &bytesReturned, NULL)) /* as of today, required for BreakChar */ { - CommLog_Print(WLOG_WARN, - "SetCommState failure: could not get the initial serial chars."); + CommLog_Print(WLOG_WARN, "SetCommState failure: could not get the initial serial chars."); return FALSE; } @@ -553,11 +536,10 @@ BOOL SetCommState(HANDLE hFile, LPDCB lpDCB) serialChars.EofChar = lpDCB->EofChar; serialChars.EventChar = lpDCB->EvtChar; - if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_SET_CHARS, &serialChars, - sizeof(SERIAL_CHARS), NULL, 0, &bytesReturned, NULL)) + if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_SET_CHARS, &serialChars, sizeof(SERIAL_CHARS), + NULL, 0, &bytesReturned, NULL)) { - CommLog_Print(WLOG_WARN, - "SetCommState failure: could not set the serial chars."); + CommLog_Print(WLOG_WARN, "SetCommState failure: could not set the serial chars."); return FALSE; } @@ -569,8 +551,7 @@ BOOL SetCommState(HANDLE hFile, LPDCB lpDCB) if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_SET_LINE_CONTROL, &lineControl, sizeof(SERIAL_LINE_CONTROL), NULL, 0, &bytesReturned, NULL)) { - CommLog_Print(WLOG_WARN, - "SetCommState failure: could not set the control settings."); + CommLog_Print(WLOG_WARN, "SetCommState failure: could not set the control settings."); return FALSE; } @@ -602,7 +583,7 @@ BOOL SetCommState(HANDLE hFile, LPDCB lpDCB) break; default: - CommLog_Print(WLOG_WARN, "Unexpected fDtrControl value: %"PRIu32"\n", + CommLog_Print(WLOG_WARN, "Unexpected fDtrControl value: %" PRIu32 "\n", lpDCB->fDtrControl); return FALSE; } @@ -657,7 +638,7 @@ BOOL SetCommState(HANDLE hFile, LPDCB lpDCB) break; default: - CommLog_Print(WLOG_WARN, "Unexpected fRtsControl value: %"PRIu32"\n", + CommLog_Print(WLOG_WARN, "Unexpected fRtsControl value: %" PRIu32 "\n", lpDCB->fRtsControl); return FALSE; } @@ -672,19 +653,17 @@ BOOL SetCommState(HANDLE hFile, LPDCB lpDCB) handflow.XonLimit = lpDCB->XonLim; handflow.XoffLimit = lpDCB->XoffLim; - if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_SET_HANDFLOW, &handflow, - sizeof(SERIAL_HANDFLOW), NULL, 0, &bytesReturned, NULL)) + if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_SET_HANDFLOW, &handflow, sizeof(SERIAL_HANDFLOW), + NULL, 0, &bytesReturned, NULL)) { - CommLog_Print(WLOG_WARN, - "SetCommState failure: could not set the handflow settings."); + CommLog_Print(WLOG_WARN, "SetCommState failure: could not set the handflow settings."); return FALSE; } /** upcomingTermios stage **/ ZeroMemory(&upcomingTermios, sizeof(struct termios)); - if (tcgetattr(pComm->fd, - &upcomingTermios) < + if (tcgetattr(pComm->fd, &upcomingTermios) < 0) /* NB: preserves current settings not directly handled by the Communication Functions */ { SetLastError(ERROR_IO_DEVICE); @@ -698,8 +677,7 @@ BOOL SetCommState(HANDLE hFile, LPDCB lpDCB) else { upcomingTermios.c_lflag |= ICANON; - CommLog_Print(WLOG_WARN, - "Unexpected nonbinary mode, consider to unset the ICANON flag."); + CommLog_Print(WLOG_WARN, "Unexpected nonbinary mode, consider to unset the ICANON flag."); } if (lpDCB->fParity) @@ -737,7 +715,7 @@ BOOL SetCommState(HANDLE hFile, LPDCB lpDCB) */ BOOL GetCommTimeouts(HANDLE hFile, LPCOMMTIMEOUTS lpCommTimeouts) { - WINPR_COMM* pComm = (WINPR_COMM*) hFile; + WINPR_COMM* pComm = (WINPR_COMM*)hFile; DWORD bytesReturned; if (!CommInitialized()) @@ -751,8 +729,8 @@ BOOL GetCommTimeouts(HANDLE hFile, LPCOMMTIMEOUTS lpCommTimeouts) /* as of today, SERIAL_TIMEOUTS and COMMTIMEOUTS structures are identical */ - if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_GET_TIMEOUTS, NULL, 0, - lpCommTimeouts, sizeof(COMMTIMEOUTS), &bytesReturned, NULL)) + if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_GET_TIMEOUTS, NULL, 0, lpCommTimeouts, + sizeof(COMMTIMEOUTS), &bytesReturned, NULL)) { CommLog_Print(WLOG_WARN, "GetCommTimeouts failure."); return FALSE; @@ -761,14 +739,13 @@ BOOL GetCommTimeouts(HANDLE hFile, LPCOMMTIMEOUTS lpCommTimeouts) return TRUE; } - /** * ERRORS: * ERROR_INVALID_HANDLE */ BOOL SetCommTimeouts(HANDLE hFile, LPCOMMTIMEOUTS lpCommTimeouts) { - WINPR_COMM* pComm = (WINPR_COMM*) hFile; + WINPR_COMM* pComm = (WINPR_COMM*)hFile; DWORD bytesReturned; if (!CommInitialized()) @@ -782,8 +759,8 @@ BOOL SetCommTimeouts(HANDLE hFile, LPCOMMTIMEOUTS lpCommTimeouts) /* as of today, SERIAL_TIMEOUTS and COMMTIMEOUTS structures are identical */ - if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_SET_TIMEOUTS, lpCommTimeouts, - sizeof(COMMTIMEOUTS), NULL, 0, &bytesReturned, NULL)) + if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_SET_TIMEOUTS, lpCommTimeouts, sizeof(COMMTIMEOUTS), + NULL, 0, &bytesReturned, NULL)) { CommLog_Print(WLOG_WARN, "SetCommTimeouts failure."); return FALSE; @@ -803,8 +780,7 @@ BOOL GetDefaultCommConfigA(LPCSTR lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize) return FALSE; } -BOOL GetDefaultCommConfigW(LPCWSTR lpszName, LPCOMMCONFIG lpCC, - LPDWORD lpdwSize) +BOOL GetDefaultCommConfigW(LPCWSTR lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize) { if (!CommInitialized()) return FALSE; @@ -839,7 +815,7 @@ BOOL SetDefaultCommConfigW(LPCWSTR lpszName, LPCOMMCONFIG lpCC, DWORD dwSize) BOOL SetCommBreak(HANDLE hFile) { - WINPR_COMM* pComm = (WINPR_COMM*) hFile; + WINPR_COMM* pComm = (WINPR_COMM*)hFile; if (!CommInitialized()) return FALSE; @@ -856,7 +832,7 @@ BOOL SetCommBreak(HANDLE hFile) BOOL ClearCommBreak(HANDLE hFile) { - WINPR_COMM* pComm = (WINPR_COMM*) hFile; + WINPR_COMM* pComm = (WINPR_COMM*)hFile; if (!CommInitialized()) return FALSE; @@ -873,7 +849,7 @@ BOOL ClearCommBreak(HANDLE hFile) BOOL ClearCommError(HANDLE hFile, PDWORD lpErrors, LPCOMSTAT lpStat) { - WINPR_COMM* pComm = (WINPR_COMM*) hFile; + WINPR_COMM* pComm = (WINPR_COMM*)hFile; if (!CommInitialized()) return FALSE; @@ -888,10 +864,9 @@ BOOL ClearCommError(HANDLE hFile, PDWORD lpErrors, LPCOMSTAT lpStat) return FALSE; } - BOOL PurgeComm(HANDLE hFile, DWORD dwFlags) { - WINPR_COMM* pComm = (WINPR_COMM*) hFile; + WINPR_COMM* pComm = (WINPR_COMM*)hFile; DWORD bytesReturned = 0; if (!CommInitialized()) @@ -903,8 +878,8 @@ BOOL PurgeComm(HANDLE hFile, DWORD dwFlags) return FALSE; } - if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_PURGE, &dwFlags, sizeof(DWORD), - NULL, 0, &bytesReturned, NULL)) + if (!CommDeviceIoControl(pComm, IOCTL_SERIAL_PURGE, &dwFlags, sizeof(DWORD), NULL, 0, + &bytesReturned, NULL)) { CommLog_Print(WLOG_WARN, "PurgeComm failure."); return FALSE; @@ -913,10 +888,9 @@ BOOL PurgeComm(HANDLE hFile, DWORD dwFlags) return TRUE; } - BOOL SetupComm(HANDLE hFile, DWORD dwInQueue, DWORD dwOutQueue) { - WINPR_COMM* pComm = (WINPR_COMM*) hFile; + WINPR_COMM* pComm = (WINPR_COMM*)hFile; SERIAL_QUEUE_SIZE queueSize; DWORD bytesReturned = 0; @@ -944,7 +918,7 @@ BOOL SetupComm(HANDLE hFile, DWORD dwInQueue, DWORD dwOutQueue) BOOL EscapeCommFunction(HANDLE hFile, DWORD dwFunc) { - WINPR_COMM* pComm = (WINPR_COMM*) hFile; + WINPR_COMM* pComm = (WINPR_COMM*)hFile; if (!CommInitialized()) return FALSE; @@ -961,7 +935,7 @@ BOOL EscapeCommFunction(HANDLE hFile, DWORD dwFunc) BOOL TransmitCommChar(HANDLE hFile, char cChar) { - WINPR_COMM* pComm = (WINPR_COMM*) hFile; + WINPR_COMM* pComm = (WINPR_COMM*)hFile; if (!CommInitialized()) return FALSE; @@ -978,7 +952,7 @@ BOOL TransmitCommChar(HANDLE hFile, char cChar) BOOL WaitCommEvent(HANDLE hFile, PDWORD lpEvtMask, LPOVERLAPPED lpOverlapped) { - WINPR_COMM* pComm = (WINPR_COMM*) hFile; + WINPR_COMM* pComm = (WINPR_COMM*)hFile; if (!CommInitialized()) return FALSE; @@ -1002,8 +976,7 @@ BOOL WaitCommEvent(HANDLE hFile, PDWORD lpEvtMask, LPOVERLAPPED lpOverlapped) * ERROR_OUTOFMEMORY was not possible to get mappings. * ERROR_INVALID_DATA was not possible to add the device. */ -BOOL DefineCommDevice(/* DWORD dwFlags,*/ LPCTSTR lpDeviceName, - LPCTSTR lpTargetPath) +BOOL DefineCommDevice(/* DWORD dwFlags,*/ LPCTSTR lpDeviceName, LPCTSTR lpTargetPath) { int i = 0; LPTSTR storedDeviceName = NULL; @@ -1082,7 +1055,6 @@ error_handle: return FALSE; } - /** * Returns the number of target paths in the buffer pointed to by * lpTargetPath. @@ -1176,7 +1148,6 @@ BOOL IsCommDevice(LPCTSTR lpDeviceName) return FALSE; } - /** * Sets */ @@ -1199,30 +1170,16 @@ void _comm_setServerSerialDriver(HANDLE hComm, SERIAL_DRIVER_ID driverId) pComm->serverSerialDriverId = driverId; } -static HANDLE_OPS ops = -{ - CommIsHandled, - CommCloseHandle, - CommGetFd, - NULL, /* CleanupHandle */ - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL -}; - +static HANDLE_OPS ops = { CommIsHandled, CommCloseHandle, + CommGetFd, NULL, /* CleanupHandle */ + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL }; /** * http://msdn.microsoft.com/en-us/library/windows/desktop/aa363198%28v=vs.85%29.aspx @@ -1249,9 +1206,9 @@ static HANDLE_OPS ops = * * @return INVALID_HANDLE_VALUE on error. */ -HANDLE CommCreateFileA(LPCSTR lpDeviceName, DWORD dwDesiredAccess, - DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, - DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) +HANDLE CommCreateFileA(LPCSTR lpDeviceName, DWORD dwDesiredAccess, DWORD dwShareMode, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, + DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) { CHAR devicePath[MAX_PATH]; struct stat deviceStat; @@ -1263,7 +1220,7 @@ HANDLE CommCreateFileA(LPCSTR lpDeviceName, DWORD dwDesiredAccess, if (dwDesiredAccess != (GENERIC_READ | GENERIC_WRITE)) { - CommLog_Print(WLOG_WARN, "unexpected access to the device: 0x%08"PRIX32"", + CommLog_Print(WLOG_WARN, "unexpected access to the device: 0x%08" PRIX32 "", dwDesiredAccess); } @@ -1278,7 +1235,7 @@ HANDLE CommCreateFileA(LPCSTR lpDeviceName, DWORD dwDesiredAccess, if (lpSecurityAttributes != NULL) { - CommLog_Print(WLOG_WARN, "unexpected security attributes, nLength=%"PRIu32"", + CommLog_Print(WLOG_WARN, "unexpected security attributes, nLength=%" PRIu32 "", lpSecurityAttributes->nLength); } @@ -1310,7 +1267,7 @@ HANDLE CommCreateFileA(LPCSTR lpDeviceName, DWORD dwDesiredAccess, if (dwFlagsAndAttributes != 0) { - CommLog_Print(WLOG_WARN, "unexpected flags and attributes: 0x%08"PRIX32"", + CommLog_Print(WLOG_WARN, "unexpected flags and attributes: 0x%08" PRIX32 "", dwFlagsAndAttributes); } @@ -1320,7 +1277,7 @@ HANDLE CommCreateFileA(LPCSTR lpDeviceName, DWORD dwDesiredAccess, return INVALID_HANDLE_VALUE; } - pComm = (WINPR_COMM*) calloc(1, sizeof(WINPR_COMM)); + pComm = (WINPR_COMM*)calloc(1, sizeof(WINPR_COMM)); if (pComm == NULL) { @@ -1349,13 +1306,12 @@ HANDLE CommCreateFileA(LPCSTR lpDeviceName, DWORD dwDesiredAccess, goto error_handle; } - pComm->fd_read_event = eventfd(0, - EFD_NONBLOCK); /* EFD_NONBLOCK required because a read() is not always expected */ + pComm->fd_read_event = eventfd( + 0, EFD_NONBLOCK); /* EFD_NONBLOCK required because a read() is not always expected */ if (pComm->fd_read_event < 0) { - CommLog_Print(WLOG_WARN, "failed to open fd_read_event, device: %s", - devicePath); + CommLog_Print(WLOG_WARN, "failed to open fd_read_event, device: %s", devicePath); SetLastError(ERROR_BAD_DEVICE); goto error_handle; } @@ -1370,13 +1326,12 @@ HANDLE CommCreateFileA(LPCSTR lpDeviceName, DWORD dwDesiredAccess, goto error_handle; } - pComm->fd_write_event = eventfd(0, - EFD_NONBLOCK); /* EFD_NONBLOCK required because a read() is not always expected */ + pComm->fd_write_event = eventfd( + 0, EFD_NONBLOCK); /* EFD_NONBLOCK required because a read() is not always expected */ if (pComm->fd_write_event < 0) { - CommLog_Print(WLOG_WARN, "failed to open fd_write_event, device: %s", - devicePath); + CommLog_Print(WLOG_WARN, "failed to open fd_write_event, device: %s", devicePath); SetLastError(ERROR_BAD_DEVICE); goto error_handle; } @@ -1411,11 +1366,10 @@ HANDLE CommCreateFileA(LPCSTR lpDeviceName, DWORD dwDesiredAccess, goto error_handle; } - upcomingTermios.c_iflag &= ~(/*IGNBRK |*/ BRKINT | PARMRK | ISTRIP | INLCR | - IGNCR | ICRNL /*| IXON*/); + upcomingTermios.c_iflag &= + ~(/*IGNBRK |*/ BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL /*| IXON*/); upcomingTermios.c_oflag = 0; /* <=> &= ~OPOST */ - upcomingTermios.c_lflag = - 0; /* <=> &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); */ + upcomingTermios.c_lflag = 0; /* <=> &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); */ /* upcomingTermios.c_cflag &= ~(CSIZE | PARENB); */ /* upcomingTermios.c_cflag |= CS8; */ /* About missing flags recommended by termios(3): @@ -1438,7 +1392,6 @@ error_handle: return INVALID_HANDLE_VALUE; } - BOOL CommIsHandled(HANDLE handle) { WINPR_COMM* pComm; @@ -1448,8 +1401,7 @@ BOOL CommIsHandled(HANDLE handle) pComm = (WINPR_COMM*)handle; - if (!pComm || (pComm->Type != HANDLE_TYPE_COMM) - || (pComm == INVALID_HANDLE_VALUE)) + if (!pComm || (pComm->Type != HANDLE_TYPE_COMM) || (pComm == INVALID_HANDLE_VALUE)) { SetLastError(ERROR_INVALID_HANDLE); return FALSE; @@ -1479,8 +1431,8 @@ BOOL CommCloseHandle(HANDLE handle) DWORD BytesReturned = 0; /* ensures to gracefully stop the WAIT_ON_MASK's loop */ - if (!CommDeviceIoControl(handle, IOCTL_SERIAL_SET_WAIT_MASK, &WaitMask, - sizeof(ULONG), NULL, 0, &BytesReturned, NULL)) + if (!CommDeviceIoControl(handle, IOCTL_SERIAL_SET_WAIT_MASK, &WaitMask, sizeof(ULONG), NULL, + 0, &BytesReturned, NULL)) { CommLog_Print(WLOG_WARN, "failure to WAIT_ON_MASK's loop!"); } diff --git a/winpr/libwinpr/comm/comm.h b/winpr/libwinpr/comm/comm.h index 6686bac01..ed2ea1cb7 100644 --- a/winpr/libwinpr/comm/comm.h +++ b/winpr/libwinpr/comm/comm.h @@ -75,25 +75,24 @@ struct winpr_comm typedef struct winpr_comm WINPR_COMM; -#define SERIAL_EV_RXCHAR 0x0001 -#define SERIAL_EV_RXFLAG 0x0002 -#define SERIAL_EV_TXEMPTY 0x0004 -#define SERIAL_EV_CTS 0x0008 -#define SERIAL_EV_DSR 0x0010 -#define SERIAL_EV_RLSD 0x0020 -#define SERIAL_EV_BREAK 0x0040 -#define SERIAL_EV_ERR 0x0080 -#define SERIAL_EV_RING 0x0100 -#define SERIAL_EV_PERR 0x0200 -#define SERIAL_EV_RX80FULL 0x0400 -#define SERIAL_EV_EVENT1 0x0800 -#define SERIAL_EV_EVENT2 0x1000 -#define SERIAL_EV_FREERDP_WAITING 0x4000 /* bit today unused by other SERIAL_EV_* */ -#define SERIAL_EV_FREERDP_STOP 0x8000 /* bit today unused by other SERIAL_EV_* */ - -#define FREERDP_PURGE_TXABORT 0x00000001 /* abort pending transmission */ -#define FREERDP_PURGE_RXABORT 0x00000002 /* abort pending reception */ +#define SERIAL_EV_RXCHAR 0x0001 +#define SERIAL_EV_RXFLAG 0x0002 +#define SERIAL_EV_TXEMPTY 0x0004 +#define SERIAL_EV_CTS 0x0008 +#define SERIAL_EV_DSR 0x0010 +#define SERIAL_EV_RLSD 0x0020 +#define SERIAL_EV_BREAK 0x0040 +#define SERIAL_EV_ERR 0x0080 +#define SERIAL_EV_RING 0x0100 +#define SERIAL_EV_PERR 0x0200 +#define SERIAL_EV_RX80FULL 0x0400 +#define SERIAL_EV_EVENT1 0x0800 +#define SERIAL_EV_EVENT2 0x1000 +#define SERIAL_EV_FREERDP_WAITING 0x4000 /* bit today unused by other SERIAL_EV_* */ +#define SERIAL_EV_FREERDP_STOP 0x8000 /* bit today unused by other SERIAL_EV_* */ +#define FREERDP_PURGE_TXABORT 0x00000001 /* abort pending transmission */ +#define FREERDP_PURGE_RXABORT 0x00000002 /* abort pending reception */ void CommLog_Print(DWORD wlog_level, ...); diff --git a/winpr/libwinpr/comm/comm_io.c b/winpr/libwinpr/comm/comm_io.c index e401ea27e..cf1339932 100644 --- a/winpr/libwinpr/comm/comm_io.c +++ b/winpr/libwinpr/comm/comm_io.c @@ -36,7 +36,7 @@ BOOL _comm_set_permissive(HANDLE hDevice, BOOL permissive) { - WINPR_COMM* pComm = (WINPR_COMM*) hDevice; + WINPR_COMM* pComm = (WINPR_COMM*)hDevice; if (hDevice == INVALID_HANDLE_VALUE) { @@ -54,7 +54,6 @@ BOOL _comm_set_permissive(HANDLE hDevice, BOOL permissive) return TRUE; } - /* Computes VTIME in deciseconds from Ti in milliseconds */ static UCHAR _vtime(ULONG Ti) { @@ -70,7 +69,6 @@ static UCHAR _vtime(ULONG Ti) return Ti / 100; } - /** * ERRORS: * ERROR_INVALID_HANDLE @@ -83,7 +81,7 @@ static UCHAR _vtime(ULONG Ti) BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped) { - WINPR_COMM* pComm = (WINPR_COMM*) hDevice; + WINPR_COMM* pComm = (WINPR_COMM*)hDevice; int biggestFd = -1; fd_set read_set; int nbFds; @@ -115,8 +113,7 @@ BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, if (lpNumberOfBytesRead == NULL) { - SetLastError( - ERROR_INVALID_PARAMETER); /* since we doesn't suppport lpOverlapped != NULL */ + SetLastError(ERROR_INVALID_PARAMETER); /* since we doesn't suppport lpOverlapped != NULL */ goto return_false; } @@ -135,8 +132,7 @@ BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, if (currentTermios.c_lflag & ICANON) { - CommLog_Print(WLOG_WARN, - "Canonical mode not supported"); /* the timeout could not be set */ + CommLog_Print(WLOG_WARN, "Canonical mode not supported"); /* the timeout could not be set */ SetLastError(ERROR_NOT_SUPPORTED); goto return_false; } @@ -144,33 +140,38 @@ BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, /* http://msdn.microsoft.com/en-us/library/hh439614%28v=vs.85%29.aspx * http://msdn.microsoft.com/en-us/library/windows/hardware/hh439614%28v=vs.85%29.aspx * - * ReadIntervalTimeout | ReadTotalTimeoutMultiplier | ReadTotalTimeoutConstant | VMIN | VTIME | TMAX | - * 0 | 0 | 0 | N | 0 | INDEF | Blocks for N bytes available. - * 0< Ti fd_read_event, O_NONBLOCK) doesn't conflict with above use cases */ + /* FIXME: double check whether open(pComm->fd_read_event, O_NONBLOCK) doesn't conflict with + * above use cases */ pTimeouts = &(pComm->timeouts); - if ((pTimeouts->ReadIntervalTimeout == MAXULONG) - && (pTimeouts->ReadTotalTimeoutConstant == MAXULONG)) + if ((pTimeouts->ReadIntervalTimeout == MAXULONG) && + (pTimeouts->ReadTotalTimeoutConstant == MAXULONG)) { - CommLog_Print(WLOG_WARN, - "ReadIntervalTimeout and ReadTotalTimeoutConstant cannot be both set to MAXULONG"); + CommLog_Print( + WLOG_WARN, + "ReadIntervalTimeout and ReadTotalTimeoutConstant cannot be both set to MAXULONG"); SetLastError(ERROR_INVALID_PARAMETER); goto return_false; } /* VMIN */ - if ((pTimeouts->ReadIntervalTimeout == MAXULONG) - && (pTimeouts->ReadTotalTimeoutMultiplier == 0) - && (pTimeouts->ReadTotalTimeoutConstant == 0)) + if ((pTimeouts->ReadIntervalTimeout == MAXULONG) && + (pTimeouts->ReadTotalTimeoutMultiplier == 0) && (pTimeouts->ReadTotalTimeoutConstant == 0)) { vmin = 0; } @@ -186,8 +187,7 @@ BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, /* VTIME */ - if ((pTimeouts->ReadIntervalTimeout > 0) - && (pTimeouts->ReadIntervalTimeout < MAXULONG)) + if ((pTimeouts->ReadIntervalTimeout > 0) && (pTimeouts->ReadIntervalTimeout < MAXULONG)) { /* Ti */ vtime = _vtime(pTimeouts->ReadIntervalTimeout); @@ -196,8 +196,8 @@ BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, /* TMAX */ pTmaxTimeout = &tmaxTimeout; - if ((pTimeouts->ReadIntervalTimeout == MAXULONG) - && (pTimeouts->ReadTotalTimeoutMultiplier == MAXULONG)) + if ((pTimeouts->ReadIntervalTimeout == MAXULONG) && + (pTimeouts->ReadTotalTimeoutMultiplier == MAXULONG)) { /* Tc */ Tmax = pTimeouts->ReadTotalTimeoutConstant; @@ -209,21 +209,21 @@ BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, pTimeouts->ReadTotalTimeoutConstant; /* INDEFinitely */ - if ((Tmax == 0) && (pTimeouts->ReadIntervalTimeout < MAXULONG) - && (pTimeouts->ReadTotalTimeoutMultiplier == 0)) + if ((Tmax == 0) && (pTimeouts->ReadIntervalTimeout < MAXULONG) && + (pTimeouts->ReadTotalTimeoutMultiplier == 0)) pTmaxTimeout = NULL; } - if ((currentTermios.c_cc[VMIN] != vmin) - || (currentTermios.c_cc[VTIME] != vtime)) + if ((currentTermios.c_cc[VMIN] != vmin) || (currentTermios.c_cc[VTIME] != vtime)) { - currentTermios.c_cc[VMIN] = vmin; + currentTermios.c_cc[VMIN] = vmin; currentTermios.c_cc[VTIME] = vtime; if (tcsetattr(pComm->fd, TCSANOW, ¤tTermios) < 0) { CommLog_Print(WLOG_WARN, - "CommReadFile failure, could not apply new timeout values: VMIN=%"PRIu8", VTIME=%"PRIu8"", + "CommReadFile failure, could not apply new timeout values: VMIN=%" PRIu8 + ", VTIME=%" PRIu8 "", vmin, vtime); SetLastError(ERROR_IO_DEVICE); goto return_false; @@ -238,7 +238,7 @@ BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, if (Tmax > 0) /* return immdiately if Tmax == 0 */ { - pTmaxTimeout->tv_sec = Tmax / 1000; /* s */ + pTmaxTimeout->tv_sec = Tmax / 1000; /* s */ pTmaxTimeout->tv_usec = (Tmax % 1000) * 1000; /* us */ } } @@ -261,8 +261,7 @@ BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, if (nbFds < 0) { - CommLog_Print(WLOG_WARN, "select() failure, errno=[%d] %s\n", errno, - strerror(errno)); + CommLog_Print(WLOG_WARN, "select() failure, errno=[%d] %s\n", errno, strerror(errno)); SetLastError(ERROR_IO_DEVICE); goto return_false; } @@ -285,7 +284,7 @@ BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, if (errno == EAGAIN) { assert(FALSE); /* not quite sure this should ever happen */ - /* keep on */ + /* keep on */ } else { @@ -315,12 +314,14 @@ BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, if (nbRead < 0) { CommLog_Print(WLOG_WARN, - "CommReadFile failed, ReadIntervalTimeout=%"PRIu32", ReadTotalTimeoutMultiplier=%"PRIu32", ReadTotalTimeoutConstant=%"PRIu32" VMIN=%u, VTIME=%u", + "CommReadFile failed, ReadIntervalTimeout=%" PRIu32 + ", ReadTotalTimeoutMultiplier=%" PRIu32 + ", ReadTotalTimeoutConstant=%" PRIu32 " VMIN=%u, VTIME=%u", pTimeouts->ReadIntervalTimeout, pTimeouts->ReadTotalTimeoutMultiplier, - pTimeouts->ReadTotalTimeoutConstant, - currentTermios.c_cc[VMIN], currentTermios.c_cc[VTIME]); + pTimeouts->ReadTotalTimeoutConstant, currentTermios.c_cc[VMIN], + currentTermios.c_cc[VTIME]); CommLog_Print(WLOG_WARN, - "CommReadFile failed, nNumberOfBytesToRead=%"PRIu32", errno=[%d] %s", + "CommReadFile failed, nNumberOfBytesToRead=%" PRIu32 ", errno=[%d] %s", nNumberOfBytesToRead, errno, strerror(errno)); if (errno == EAGAIN) @@ -354,7 +355,7 @@ BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, if (pComm->PendingEvents & SERIAL_EV_FREERDP_WAITING) { if (pComm->eventChar != '\0' && memchr(lpBuffer, pComm->eventChar, nbRead)) - pComm->PendingEvents |= SERIAL_EV_RXCHAR; + pComm->PendingEvents |= SERIAL_EV_RXCHAR; } LeaveCriticalSection(&pComm->EventsLock); goto return_true; @@ -370,7 +371,6 @@ return_true: return TRUE; } - /** * ERRORS: * ERROR_INVALID_HANDLE @@ -378,14 +378,12 @@ return_true: * ERROR_INVALID_PARAMETER * ERROR_BAD_DEVICE */ -BOOL CommWriteFile(HANDLE hDevice, LPCVOID lpBuffer, - DWORD nNumberOfBytesToWrite, +BOOL CommWriteFile(HANDLE hDevice, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped) { - WINPR_COMM* pComm = (WINPR_COMM*) hDevice; + WINPR_COMM* pComm = (WINPR_COMM*)hDevice; struct timeval tmaxTimeout, *pTmaxTimeout; - EnterCriticalSection( - &pComm->WriteLock); /* KISSer by the function's beginning */ + EnterCriticalSection(&pComm->WriteLock); /* KISSer by the function's beginning */ if (hDevice == INVALID_HANDLE_VALUE) { @@ -407,8 +405,7 @@ BOOL CommWriteFile(HANDLE hDevice, LPCVOID lpBuffer, if (lpNumberOfBytesWritten == NULL) { - SetLastError( - ERROR_INVALID_PARAMETER); /* since we doesn't suppport lpOverlapped != NULL */ + SetLastError(ERROR_INVALID_PARAMETER); /* since we doesn't suppport lpOverlapped != NULL */ goto return_false; } @@ -424,8 +421,7 @@ BOOL CommWriteFile(HANDLE hDevice, LPCVOID lpBuffer, /* discard a possible and no more relevant event */ eventfd_read(pComm->fd_write_event, NULL); /* ms */ - ULONGLONG Tmax = nNumberOfBytesToWrite * - pComm->timeouts.WriteTotalTimeoutMultiplier + + ULONGLONG Tmax = nNumberOfBytesToWrite * pComm->timeouts.WriteTotalTimeoutMultiplier + pComm->timeouts.WriteTotalTimeoutConstant; /* NB: select() may update the timeout argument to indicate * how much time was left. Keep the timeout variable out of @@ -435,11 +431,11 @@ BOOL CommWriteFile(HANDLE hDevice, LPCVOID lpBuffer, if (Tmax > 0) { - pTmaxTimeout->tv_sec = Tmax / 1000; /* s */ + pTmaxTimeout->tv_sec = Tmax / 1000; /* s */ pTmaxTimeout->tv_usec = (Tmax % 1000) * 1000; /* us */ } - else if ((pComm->timeouts.WriteTotalTimeoutMultiplier == 0) - && (pComm->timeouts.WriteTotalTimeoutConstant == 0)) + else if ((pComm->timeouts.WriteTotalTimeoutMultiplier == 0) && + (pComm->timeouts.WriteTotalTimeoutConstant == 0)) { pTmaxTimeout = NULL; } @@ -466,8 +462,7 @@ BOOL CommWriteFile(HANDLE hDevice, LPCVOID lpBuffer, if (nbFds < 0) { - CommLog_Print(WLOG_WARN, "select() failure, errno=[%d] %s\n", errno, - strerror(errno)); + CommLog_Print(WLOG_WARN, "select() failure, errno=[%d] %s\n", errno, strerror(errno)); SetLastError(ERROR_IO_DEVICE); goto return_false; } @@ -490,13 +485,13 @@ BOOL CommWriteFile(HANDLE hDevice, LPCVOID lpBuffer, if (errno == EAGAIN) { assert(FALSE); /* not quite sure this should ever happen */ - /* keep on */ + /* keep on */ } else { CommLog_Print(WLOG_WARN, - "unexpected error on reading fd_write_event, errno=[%d] %s\n", errno, - strerror(errno)); + "unexpected error on reading fd_write_event, errno=[%d] %s\n", + errno, strerror(errno)); /* FIXME: goto return_false ? */ } @@ -517,14 +512,14 @@ BOOL CommWriteFile(HANDLE hDevice, LPCVOID lpBuffer, if (FD_ISSET(pComm->fd_write, &write_set)) { ssize_t nbWritten; - nbWritten = write(pComm->fd_write, - ((BYTE*)lpBuffer) + (*lpNumberOfBytesWritten), + nbWritten = write(pComm->fd_write, ((BYTE*)lpBuffer) + (*lpNumberOfBytesWritten), nNumberOfBytesToWrite - (*lpNumberOfBytesWritten)); if (nbWritten < 0) { CommLog_Print(WLOG_WARN, - "CommWriteFile failed after %"PRIu32" bytes written, errno=[%d] %s\n", + "CommWriteFile failed after %" PRIu32 + " bytes written, errno=[%d] %s\n", *lpNumberOfBytesWritten, errno, strerror(errno)); if (errno == EAGAIN) @@ -568,5 +563,4 @@ return_false: return FALSE; } - #endif /* __linux__ */ diff --git a/winpr/libwinpr/comm/comm_ioctl.c b/winpr/libwinpr/comm/comm_ioctl.c index 9ea439d6b..982bc4016 100644 --- a/winpr/libwinpr/comm/comm_ioctl.c +++ b/winpr/libwinpr/comm/comm_ioctl.c @@ -26,7 +26,6 @@ #if defined __linux__ && !defined ANDROID - #include #include @@ -38,7 +37,6 @@ #include "comm_sercx_sys.h" #include "comm_sercx2_sys.h" - /* NB: MS-RDPESP's recommendation: * * <2> Section 3.2.5.1.6: Windows Implementations use IOCTL constants @@ -55,12 +53,11 @@ * Drivers, and in [MSDN-PORTS]. */ - const char* _comm_serial_ioctl_name(ULONG number) { int i; - - for (i=0; _SERIAL_IOCTL_NAMES[i].number != 0; i++) + + for (i = 0; _SERIAL_IOCTL_NAMES[i].number != 0; i++) { if (_SERIAL_IOCTL_NAMES[i].number == number) { @@ -71,20 +68,20 @@ const char* _comm_serial_ioctl_name(ULONG number) return "(unknown ioctl name)"; } - -static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, - LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped) +static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, + DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, + LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped) { - WINPR_COMM* pComm = (WINPR_COMM*) hDevice; + WINPR_COMM* pComm = (WINPR_COMM*)hDevice; SERIAL_DRIVER* pServerSerialDriver = NULL; if (hDevice == INVALID_HANDLE_VALUE) { SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } + return FALSE; + } - if (!pComm || pComm->Type != HANDLE_TYPE_COMM || !pComm->fd ) + if (!pComm || pComm->Type != HANDLE_TYPE_COMM || !pComm->fd) { SetLastError(ERROR_INVALID_HANDLE); return FALSE; @@ -129,7 +126,8 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l case SerialDriverUnknown: default: - CommLog_Print(WLOG_DEBUG, "Unknown remote serial driver (%d), using SerCx2.sys", pComm->serverSerialDriverId); + CommLog_Print(WLOG_DEBUG, "Unknown remote serial driver (%d), using SerCx2.sys", + pComm->serverSerialDriverId); pServerSerialDriver = SerCx2Sys_s(); break; } @@ -140,7 +138,8 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { case IOCTL_USBPRINT_GET_1284_ID: { - /* FIXME: http://msdn.microsoft.com/en-us/library/windows/hardware/ff551803(v=vs.85).aspx */ + /* FIXME: + * http://msdn.microsoft.com/en-us/library/windows/hardware/ff551803(v=vs.85).aspx */ *lpBytesReturned = nOutBufferSize; /* an empty OutputBuffer will be returned */ SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; @@ -149,7 +148,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->set_baud_rate) { - SERIAL_BAUD_RATE *pBaudRate = (SERIAL_BAUD_RATE*)lpInBuffer; + SERIAL_BAUD_RATE* pBaudRate = (SERIAL_BAUD_RATE*)lpInBuffer; assert(nInBufferSize >= sizeof(SERIAL_BAUD_RATE)); if (nInBufferSize < sizeof(SERIAL_BAUD_RATE)) @@ -166,7 +165,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->get_baud_rate) { - SERIAL_BAUD_RATE *pBaudRate = (SERIAL_BAUD_RATE*)lpOutBuffer; + SERIAL_BAUD_RATE* pBaudRate = (SERIAL_BAUD_RATE*)lpOutBuffer; assert(nOutBufferSize >= sizeof(SERIAL_BAUD_RATE)); if (nOutBufferSize < sizeof(SERIAL_BAUD_RATE)) @@ -187,7 +186,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->get_properties) { - COMMPROP *pProperties = (COMMPROP*)lpOutBuffer; + COMMPROP* pProperties = (COMMPROP*)lpOutBuffer; assert(nOutBufferSize >= sizeof(COMMPROP)); if (nOutBufferSize < sizeof(COMMPROP)) @@ -208,7 +207,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->set_serial_chars) { - SERIAL_CHARS *pSerialChars = (SERIAL_CHARS*)lpInBuffer; + SERIAL_CHARS* pSerialChars = (SERIAL_CHARS*)lpInBuffer; assert(nInBufferSize >= sizeof(SERIAL_CHARS)); if (nInBufferSize < sizeof(SERIAL_CHARS)) @@ -225,7 +224,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->get_serial_chars) { - SERIAL_CHARS *pSerialChars = (SERIAL_CHARS*)lpOutBuffer; + SERIAL_CHARS* pSerialChars = (SERIAL_CHARS*)lpOutBuffer; assert(nOutBufferSize >= sizeof(SERIAL_CHARS)); if (nOutBufferSize < sizeof(SERIAL_CHARS)) @@ -246,7 +245,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->set_line_control) { - SERIAL_LINE_CONTROL *pLineControl = (SERIAL_LINE_CONTROL*)lpInBuffer; + SERIAL_LINE_CONTROL* pLineControl = (SERIAL_LINE_CONTROL*)lpInBuffer; assert(nInBufferSize >= sizeof(SERIAL_LINE_CONTROL)); if (nInBufferSize < sizeof(SERIAL_LINE_CONTROL)) @@ -263,7 +262,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->get_line_control) { - SERIAL_LINE_CONTROL *pLineControl = (SERIAL_LINE_CONTROL*)lpOutBuffer; + SERIAL_LINE_CONTROL* pLineControl = (SERIAL_LINE_CONTROL*)lpOutBuffer; assert(nOutBufferSize >= sizeof(SERIAL_LINE_CONTROL)); if (nOutBufferSize < sizeof(SERIAL_LINE_CONTROL)) @@ -284,7 +283,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->set_handflow) { - SERIAL_HANDFLOW *pHandflow = (SERIAL_HANDFLOW*)lpInBuffer; + SERIAL_HANDFLOW* pHandflow = (SERIAL_HANDFLOW*)lpInBuffer; assert(nInBufferSize >= sizeof(SERIAL_HANDFLOW)); if (nInBufferSize < sizeof(SERIAL_HANDFLOW)) @@ -301,7 +300,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->get_handflow) { - SERIAL_HANDFLOW *pHandflow = (SERIAL_HANDFLOW*)lpOutBuffer; + SERIAL_HANDFLOW* pHandflow = (SERIAL_HANDFLOW*)lpOutBuffer; assert(nOutBufferSize >= sizeof(SERIAL_HANDFLOW)); if (nOutBufferSize < sizeof(SERIAL_HANDFLOW)) @@ -322,7 +321,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->set_timeouts) { - SERIAL_TIMEOUTS *pHandflow = (SERIAL_TIMEOUTS*)lpInBuffer; + SERIAL_TIMEOUTS* pHandflow = (SERIAL_TIMEOUTS*)lpInBuffer; assert(nInBufferSize >= sizeof(SERIAL_TIMEOUTS)); if (nInBufferSize < sizeof(SERIAL_TIMEOUTS)) @@ -339,7 +338,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->get_timeouts) { - SERIAL_TIMEOUTS *pHandflow = (SERIAL_TIMEOUTS*)lpOutBuffer; + SERIAL_TIMEOUTS* pHandflow = (SERIAL_TIMEOUTS*)lpOutBuffer; assert(nOutBufferSize >= sizeof(SERIAL_TIMEOUTS)); if (nOutBufferSize < sizeof(SERIAL_TIMEOUTS)) @@ -392,7 +391,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->get_modemstatus) { - ULONG *pRegister = (ULONG*)lpOutBuffer; + ULONG* pRegister = (ULONG*)lpOutBuffer; assert(nOutBufferSize >= sizeof(ULONG)); if (nOutBufferSize < sizeof(ULONG)) @@ -413,7 +412,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->set_wait_mask) { - ULONG *pWaitMask = (ULONG*)lpInBuffer; + ULONG* pWaitMask = (ULONG*)lpInBuffer; assert(nInBufferSize >= sizeof(ULONG)); if (nInBufferSize < sizeof(ULONG)) @@ -430,7 +429,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->get_wait_mask) { - ULONG *pWaitMask = (ULONG*)lpOutBuffer; + ULONG* pWaitMask = (ULONG*)lpOutBuffer; assert(nOutBufferSize >= sizeof(ULONG)); if (nOutBufferSize < sizeof(ULONG)) @@ -451,7 +450,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->wait_on_mask) { - ULONG *pOutputMask = (ULONG*)lpOutBuffer; + ULONG* pOutputMask = (ULONG*)lpOutBuffer; assert(nOutBufferSize >= sizeof(ULONG)); if (nOutBufferSize < sizeof(ULONG)) @@ -475,7 +474,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->set_queue_size) { - SERIAL_QUEUE_SIZE *pQueueSize = (SERIAL_QUEUE_SIZE*)lpInBuffer; + SERIAL_QUEUE_SIZE* pQueueSize = (SERIAL_QUEUE_SIZE*)lpInBuffer; assert(nInBufferSize >= sizeof(SERIAL_QUEUE_SIZE)); if (nInBufferSize < sizeof(SERIAL_QUEUE_SIZE)) @@ -492,7 +491,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->purge) { - ULONG *pPurgeMask = (ULONG*)lpInBuffer; + ULONG* pPurgeMask = (ULONG*)lpInBuffer; assert(nInBufferSize >= sizeof(ULONG)); if (nInBufferSize < sizeof(ULONG)) @@ -509,7 +508,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->get_commstatus) { - SERIAL_STATUS *pCommstatus = (SERIAL_STATUS*)lpOutBuffer; + SERIAL_STATUS* pCommstatus = (SERIAL_STATUS*)lpOutBuffer; assert(nOutBufferSize >= sizeof(SERIAL_STATUS)); if (nOutBufferSize < sizeof(SERIAL_STATUS)) @@ -562,7 +561,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l { if (pServerSerialDriver->get_dtrrts) { - ULONG *pMask = (ULONG*)lpOutBuffer; + ULONG* pMask = (ULONG*)lpOutBuffer; assert(nOutBufferSize >= sizeof(ULONG)); if (nOutBufferSize < sizeof(ULONG)) @@ -578,13 +577,12 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l return TRUE; } break; - } case IOCTL_SERIAL_CONFIG_SIZE: { if (pServerSerialDriver->config_size) { - ULONG *pSize = (ULONG*)lpOutBuffer; + ULONG* pSize = (ULONG*)lpOutBuffer; assert(nOutBufferSize >= sizeof(ULONG)); if (nOutBufferSize < sizeof(ULONG)) @@ -600,13 +598,12 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l return TRUE; } break; - } case IOCTL_SERIAL_IMMEDIATE_CHAR: { if (pServerSerialDriver->immediate_char) { - UCHAR *pChar = (UCHAR*)lpInBuffer; + UCHAR* pChar = (UCHAR*)lpInBuffer; assert(nInBufferSize >= sizeof(UCHAR)); if (nInBufferSize < sizeof(UCHAR)) @@ -629,14 +626,13 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l } } - CommLog_Print(WLOG_WARN, _T("unsupported IoControlCode=[0x%08"PRIX32"] %s (remote serial driver: %s)"), - dwIoControlCode, _comm_serial_ioctl_name(dwIoControlCode), pServerSerialDriver->name); + CommLog_Print( + WLOG_WARN, _T("unsupported IoControlCode=[0x%08" PRIX32 "] %s (remote serial driver: %s)"), + dwIoControlCode, _comm_serial_ioctl_name(dwIoControlCode), pServerSerialDriver->name); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); /* => STATUS_NOT_IMPLEMENTED */ return FALSE; - } - /** * FIXME: to be used through winpr-io's DeviceIoControl * @@ -649,39 +645,45 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l * ERROR_INSUFFICIENT_BUFFER * ERROR_CALL_NOT_IMPLEMENTED unimplemented ioctl */ -BOOL CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, - LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped) +BOOL CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, + DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, + LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped) { - WINPR_COMM* pComm = (WINPR_COMM*) hDevice; + WINPR_COMM* pComm = (WINPR_COMM*)hDevice; BOOL result; if (hDevice == INVALID_HANDLE_VALUE) { SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } + return FALSE; + } - if (!pComm || pComm->Type != HANDLE_TYPE_COMM || !pComm->fd ) + if (!pComm || pComm->Type != HANDLE_TYPE_COMM || !pComm->fd) { SetLastError(ERROR_INVALID_HANDLE); return FALSE; } - result = _CommDeviceIoControl(hDevice, dwIoControlCode, lpInBuffer, nInBufferSize, - lpOutBuffer, nOutBufferSize, lpBytesReturned, lpOverlapped); + result = _CommDeviceIoControl(hDevice, dwIoControlCode, lpInBuffer, nInBufferSize, lpOutBuffer, + nOutBufferSize, lpBytesReturned, lpOverlapped); if (lpBytesReturned && *lpBytesReturned != nOutBufferSize) { /* This might be a hint for a bug, especially when result==TRUE */ - CommLog_Print(WLOG_WARN, "lpBytesReturned=%"PRIu32" and nOutBufferSize=%"PRIu32" are different!", *lpBytesReturned, nOutBufferSize); + CommLog_Print(WLOG_WARN, + "lpBytesReturned=%" PRIu32 " and nOutBufferSize=%" PRIu32 " are different!", + *lpBytesReturned, nOutBufferSize); } if (pComm->permissive) { if (!result) { - CommLog_Print(WLOG_WARN, "[permissive]: whereas it failed, made to succeed IoControlCode=[0x%08"PRIX32"] %s, last-error: 0x%08"PRIX32"", - dwIoControlCode, _comm_serial_ioctl_name(dwIoControlCode), GetLastError()); + CommLog_Print( + WLOG_WARN, + "[permissive]: whereas it failed, made to succeed IoControlCode=[0x%08" PRIX32 + "] %s, last-error: 0x%08" PRIX32 "", + dwIoControlCode, _comm_serial_ioctl_name(dwIoControlCode), GetLastError()); } return TRUE; /* always! */ @@ -690,7 +692,7 @@ BOOL CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffe return result; } -int _comm_ioctl_tcsetattr(int fd, int optional_actions, const struct termios *termios_p) +int _comm_ioctl_tcsetattr(int fd, int optional_actions, const struct termios* termios_p) { int result; struct termios currentState; @@ -711,7 +713,8 @@ int _comm_ioctl_tcsetattr(int fd, int optional_actions, const struct termios *te if (memcmp(¤tState, termios_p, sizeof(struct termios)) != 0) { - CommLog_Print(WLOG_DEBUG, "all termios parameters are not set yet, doing a second attempt..."); + CommLog_Print(WLOG_DEBUG, + "all termios parameters are not set yet, doing a second attempt..."); if ((result = tcsetattr(fd, optional_actions, termios_p)) < 0) { CommLog_Print(WLOG_WARN, "2nd tcsetattr failure, errno: %d", errno); @@ -727,7 +730,8 @@ int _comm_ioctl_tcsetattr(int fd, int optional_actions, const struct termios *te if (memcmp(¤tState, termios_p, sizeof(struct termios)) != 0) { - CommLog_Print(WLOG_WARN, "Failure: all termios parameters are still not set on a second attempt"); + CommLog_Print(WLOG_WARN, + "Failure: all termios parameters are still not set on a second attempt"); return -1; } } @@ -735,5 +739,4 @@ int _comm_ioctl_tcsetattr(int fd, int optional_actions, const struct termios *te return 0; } - #endif /* __linux__ */ diff --git a/winpr/libwinpr/comm/comm_ioctl.h b/winpr/libwinpr/comm/comm_ioctl.h index 01114f57d..955e03419 100644 --- a/winpr/libwinpr/comm/comm_ioctl.h +++ b/winpr/libwinpr/comm/comm_ioctl.h @@ -38,202 +38,194 @@ */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* TODO: defines and types below are very similar to those in comm.h, keep only - * those that differ more than the names */ + /* TODO: defines and types below are very similar to those in comm.h, keep only + * those that differ more than the names */ -#define STOP_BIT_1 0 -#define STOP_BITS_1_5 1 -#define STOP_BITS_2 2 +#define STOP_BIT_1 0 +#define STOP_BITS_1_5 1 +#define STOP_BITS_2 2 -#define NO_PARITY 0 -#define ODD_PARITY 1 -#define EVEN_PARITY 2 -#define MARK_PARITY 3 -#define SPACE_PARITY 4 +#define NO_PARITY 0 +#define ODD_PARITY 1 +#define EVEN_PARITY 2 +#define MARK_PARITY 3 +#define SPACE_PARITY 4 + typedef struct _SERIAL_BAUD_RATE + { + ULONG BaudRate; + } SERIAL_BAUD_RATE, *PSERIAL_BAUD_RATE; -typedef struct _SERIAL_BAUD_RATE -{ - ULONG BaudRate; -} SERIAL_BAUD_RATE, *PSERIAL_BAUD_RATE; + typedef struct _SERIAL_CHARS + { + UCHAR EofChar; + UCHAR ErrorChar; + UCHAR BreakChar; + UCHAR EventChar; + UCHAR XonChar; + UCHAR XoffChar; + } SERIAL_CHARS, *PSERIAL_CHARS; + typedef struct _SERIAL_LINE_CONTROL + { + UCHAR StopBits; + UCHAR Parity; + UCHAR WordLength; + } SERIAL_LINE_CONTROL, *PSERIAL_LINE_CONTROL; -typedef struct _SERIAL_CHARS -{ - UCHAR EofChar; - UCHAR ErrorChar; - UCHAR BreakChar; - UCHAR EventChar; - UCHAR XonChar; - UCHAR XoffChar; -} SERIAL_CHARS, *PSERIAL_CHARS; + typedef struct _SERIAL_HANDFLOW + { + ULONG ControlHandShake; + ULONG FlowReplace; + LONG XonLimit; + LONG XoffLimit; + } SERIAL_HANDFLOW, *PSERIAL_HANDFLOW; +#define SERIAL_DTR_MASK ((ULONG)0x03) +#define SERIAL_DTR_CONTROL ((ULONG)0x01) +#define SERIAL_DTR_HANDSHAKE ((ULONG)0x02) +#define SERIAL_CTS_HANDSHAKE ((ULONG)0x08) +#define SERIAL_DSR_HANDSHAKE ((ULONG)0x10) +#define SERIAL_DCD_HANDSHAKE ((ULONG)0x20) +#define SERIAL_OUT_HANDSHAKEMASK ((ULONG)0x38) +#define SERIAL_DSR_SENSITIVITY ((ULONG)0x40) +#define SERIAL_ERROR_ABORT ((ULONG)0x80000000) +#define SERIAL_CONTROL_INVALID ((ULONG)0x7fffff84) +#define SERIAL_AUTO_TRANSMIT ((ULONG)0x01) +#define SERIAL_AUTO_RECEIVE ((ULONG)0x02) +#define SERIAL_ERROR_CHAR ((ULONG)0x04) +#define SERIAL_NULL_STRIPPING ((ULONG)0x08) +#define SERIAL_BREAK_CHAR ((ULONG)0x10) +#define SERIAL_RTS_MASK ((ULONG)0xc0) +#define SERIAL_RTS_CONTROL ((ULONG)0x40) +#define SERIAL_RTS_HANDSHAKE ((ULONG)0x80) +#define SERIAL_TRANSMIT_TOGGLE ((ULONG)0xc0) +#define SERIAL_XOFF_CONTINUE ((ULONG)0x80000000) +#define SERIAL_FLOW_INVALID ((ULONG)0x7fffff20) -typedef struct _SERIAL_LINE_CONTROL -{ - UCHAR StopBits; - UCHAR Parity; - UCHAR WordLength; -} SERIAL_LINE_CONTROL, *PSERIAL_LINE_CONTROL; +#define SERIAL_SP_SERIALCOMM ((ULONG)0x00000001) +#define SERIAL_SP_UNSPECIFIED ((ULONG)0x00000000) +#define SERIAL_SP_RS232 ((ULONG)0x00000001) +#define SERIAL_SP_PARALLEL ((ULONG)0x00000002) +#define SERIAL_SP_RS422 ((ULONG)0x00000003) +#define SERIAL_SP_RS423 ((ULONG)0x00000004) +#define SERIAL_SP_RS449 ((ULONG)0x00000005) +#define SERIAL_SP_MODEM ((ULONG)0x00000006) +#define SERIAL_SP_FAX ((ULONG)0x00000021) +#define SERIAL_SP_SCANNER ((ULONG)0x00000022) +#define SERIAL_SP_BRIDGE ((ULONG)0x00000100) +#define SERIAL_SP_LAT ((ULONG)0x00000101) +#define SERIAL_SP_TELNET ((ULONG)0x00000102) +#define SERIAL_SP_X25 ((ULONG)0x00000103) -typedef struct _SERIAL_HANDFLOW -{ - ULONG ControlHandShake; - ULONG FlowReplace; - LONG XonLimit; - LONG XoffLimit; -} SERIAL_HANDFLOW, *PSERIAL_HANDFLOW; + typedef struct _SERIAL_TIMEOUTS + { + ULONG ReadIntervalTimeout; + ULONG ReadTotalTimeoutMultiplier; + ULONG ReadTotalTimeoutConstant; + ULONG WriteTotalTimeoutMultiplier; + ULONG WriteTotalTimeoutConstant; + } SERIAL_TIMEOUTS, *PSERIAL_TIMEOUTS; +#define SERIAL_MSR_DCTS 0x01 +#define SERIAL_MSR_DDSR 0x02 +#define SERIAL_MSR_TERI 0x04 +#define SERIAL_MSR_DDCD 0x08 +#define SERIAL_MSR_CTS 0x10 +#define SERIAL_MSR_DSR 0x20 +#define SERIAL_MSR_RI 0x40 +#define SERIAL_MSR_DCD 0x80 -#define SERIAL_DTR_MASK ((ULONG)0x03) -#define SERIAL_DTR_CONTROL ((ULONG)0x01) -#define SERIAL_DTR_HANDSHAKE ((ULONG)0x02) -#define SERIAL_CTS_HANDSHAKE ((ULONG)0x08) -#define SERIAL_DSR_HANDSHAKE ((ULONG)0x10) -#define SERIAL_DCD_HANDSHAKE ((ULONG)0x20) -#define SERIAL_OUT_HANDSHAKEMASK ((ULONG)0x38) -#define SERIAL_DSR_SENSITIVITY ((ULONG)0x40) -#define SERIAL_ERROR_ABORT ((ULONG)0x80000000) -#define SERIAL_CONTROL_INVALID ((ULONG)0x7fffff84) -#define SERIAL_AUTO_TRANSMIT ((ULONG)0x01) -#define SERIAL_AUTO_RECEIVE ((ULONG)0x02) -#define SERIAL_ERROR_CHAR ((ULONG)0x04) -#define SERIAL_NULL_STRIPPING ((ULONG)0x08) -#define SERIAL_BREAK_CHAR ((ULONG)0x10) -#define SERIAL_RTS_MASK ((ULONG)0xc0) -#define SERIAL_RTS_CONTROL ((ULONG)0x40) -#define SERIAL_RTS_HANDSHAKE ((ULONG)0x80) -#define SERIAL_TRANSMIT_TOGGLE ((ULONG)0xc0) -#define SERIAL_XOFF_CONTINUE ((ULONG)0x80000000) -#define SERIAL_FLOW_INVALID ((ULONG)0x7fffff20) - -#define SERIAL_SP_SERIALCOMM ((ULONG)0x00000001) - -#define SERIAL_SP_UNSPECIFIED ((ULONG)0x00000000) -#define SERIAL_SP_RS232 ((ULONG)0x00000001) -#define SERIAL_SP_PARALLEL ((ULONG)0x00000002) -#define SERIAL_SP_RS422 ((ULONG)0x00000003) -#define SERIAL_SP_RS423 ((ULONG)0x00000004) -#define SERIAL_SP_RS449 ((ULONG)0x00000005) -#define SERIAL_SP_MODEM ((ULONG)0x00000006) -#define SERIAL_SP_FAX ((ULONG)0x00000021) -#define SERIAL_SP_SCANNER ((ULONG)0x00000022) -#define SERIAL_SP_BRIDGE ((ULONG)0x00000100) -#define SERIAL_SP_LAT ((ULONG)0x00000101) -#define SERIAL_SP_TELNET ((ULONG)0x00000102) -#define SERIAL_SP_X25 ((ULONG)0x00000103) - - -typedef struct _SERIAL_TIMEOUTS -{ - ULONG ReadIntervalTimeout; - ULONG ReadTotalTimeoutMultiplier; - ULONG ReadTotalTimeoutConstant; - ULONG WriteTotalTimeoutMultiplier; - ULONG WriteTotalTimeoutConstant; -} SERIAL_TIMEOUTS,*PSERIAL_TIMEOUTS; - - -#define SERIAL_MSR_DCTS 0x01 -#define SERIAL_MSR_DDSR 0x02 -#define SERIAL_MSR_TERI 0x04 -#define SERIAL_MSR_DDCD 0x08 -#define SERIAL_MSR_CTS 0x10 -#define SERIAL_MSR_DSR 0x20 -#define SERIAL_MSR_RI 0x40 -#define SERIAL_MSR_DCD 0x80 - -typedef struct _SERIAL_QUEUE_SIZE -{ - ULONG InSize; - ULONG OutSize; -} SERIAL_QUEUE_SIZE, *PSERIAL_QUEUE_SIZE; - + typedef struct _SERIAL_QUEUE_SIZE + { + ULONG InSize; + ULONG OutSize; + } SERIAL_QUEUE_SIZE, *PSERIAL_QUEUE_SIZE; #define SERIAL_PURGE_TXABORT 0x00000001 #define SERIAL_PURGE_RXABORT 0x00000002 #define SERIAL_PURGE_TXCLEAR 0x00000004 #define SERIAL_PURGE_RXCLEAR 0x00000008 -typedef struct _SERIAL_STATUS -{ - ULONG Errors; - ULONG HoldReasons; - ULONG AmountInInQueue; - ULONG AmountInOutQueue; - BOOLEAN EofReceived; - BOOLEAN WaitForImmediate; -} SERIAL_STATUS, *PSERIAL_STATUS; + typedef struct _SERIAL_STATUS + { + ULONG Errors; + ULONG HoldReasons; + ULONG AmountInInQueue; + ULONG AmountInOutQueue; + BOOLEAN EofReceived; + BOOLEAN WaitForImmediate; + } SERIAL_STATUS, *PSERIAL_STATUS; -#define SERIAL_TX_WAITING_FOR_CTS ((ULONG)0x00000001) -#define SERIAL_TX_WAITING_FOR_DSR ((ULONG)0x00000002) -#define SERIAL_TX_WAITING_FOR_DCD ((ULONG)0x00000004) -#define SERIAL_TX_WAITING_FOR_XON ((ULONG)0x00000008) -#define SERIAL_TX_WAITING_XOFF_SENT ((ULONG)0x00000010) -#define SERIAL_TX_WAITING_ON_BREAK ((ULONG)0x00000020) -#define SERIAL_RX_WAITING_FOR_DSR ((ULONG)0x00000040) +#define SERIAL_TX_WAITING_FOR_CTS ((ULONG)0x00000001) +#define SERIAL_TX_WAITING_FOR_DSR ((ULONG)0x00000002) +#define SERIAL_TX_WAITING_FOR_DCD ((ULONG)0x00000004) +#define SERIAL_TX_WAITING_FOR_XON ((ULONG)0x00000008) +#define SERIAL_TX_WAITING_XOFF_SENT ((ULONG)0x00000010) +#define SERIAL_TX_WAITING_ON_BREAK ((ULONG)0x00000020) +#define SERIAL_RX_WAITING_FOR_DSR ((ULONG)0x00000040) -#define SERIAL_ERROR_BREAK ((ULONG)0x00000001) -#define SERIAL_ERROR_FRAMING ((ULONG)0x00000002) -#define SERIAL_ERROR_OVERRUN ((ULONG)0x00000004) -#define SERIAL_ERROR_QUEUEOVERRUN ((ULONG)0x00000008) -#define SERIAL_ERROR_PARITY ((ULONG)0x00000010) +#define SERIAL_ERROR_BREAK ((ULONG)0x00000001) +#define SERIAL_ERROR_FRAMING ((ULONG)0x00000002) +#define SERIAL_ERROR_OVERRUN ((ULONG)0x00000004) +#define SERIAL_ERROR_QUEUEOVERRUN ((ULONG)0x00000008) +#define SERIAL_ERROR_PARITY ((ULONG)0x00000010) -#define SERIAL_DTR_STATE ((ULONG)0x00000001) -#define SERIAL_RTS_STATE ((ULONG)0x00000002) -#define SERIAL_CTS_STATE ((ULONG)0x00000010) -#define SERIAL_DSR_STATE ((ULONG)0x00000020) -#define SERIAL_RI_STATE ((ULONG)0x00000040) -#define SERIAL_DCD_STATE ((ULONG)0x00000080) +#define SERIAL_DTR_STATE ((ULONG)0x00000001) +#define SERIAL_RTS_STATE ((ULONG)0x00000002) +#define SERIAL_CTS_STATE ((ULONG)0x00000010) +#define SERIAL_DSR_STATE ((ULONG)0x00000020) +#define SERIAL_RI_STATE ((ULONG)0x00000040) +#define SERIAL_DCD_STATE ((ULONG)0x00000080) -/** - * A function might be NULL if not supported by the underlying driver. - * - * FIXME: better have to use input and output buffers for all functions? - */ -typedef struct _SERIAL_DRIVER -{ - SERIAL_DRIVER_ID id; - TCHAR *name; - BOOL (*set_baud_rate)(WINPR_COMM *pComm, const SERIAL_BAUD_RATE *pBaudRate); - BOOL (*get_baud_rate)(WINPR_COMM *pComm, SERIAL_BAUD_RATE *pBaudRate); - BOOL (*get_properties)(WINPR_COMM *pComm, COMMPROP *pProperties); - BOOL (*set_serial_chars)(WINPR_COMM *pComm, const SERIAL_CHARS *pSerialChars); - BOOL (*get_serial_chars)(WINPR_COMM *pComm, SERIAL_CHARS *pSerialChars); - BOOL (*set_line_control)(WINPR_COMM *pComm, const SERIAL_LINE_CONTROL *pLineControl); - BOOL (*get_line_control)(WINPR_COMM *pComm, SERIAL_LINE_CONTROL *pLineControl); - BOOL (*set_handflow)(WINPR_COMM *pComm, const SERIAL_HANDFLOW *pHandflow); - BOOL (*get_handflow)(WINPR_COMM *pComm, SERIAL_HANDFLOW *pHandflow); - BOOL (*set_timeouts)(WINPR_COMM *pComm, const SERIAL_TIMEOUTS *pTimeouts); - BOOL (*get_timeouts)(WINPR_COMM *pComm, SERIAL_TIMEOUTS *pTimeouts); - BOOL (*set_dtr)(WINPR_COMM *pComm); - BOOL (*clear_dtr)(WINPR_COMM *pComm); - BOOL (*set_rts)(WINPR_COMM *pComm); - BOOL (*clear_rts)(WINPR_COMM *pComm); - BOOL (*get_modemstatus)(WINPR_COMM *pComm, ULONG *pRegister); - BOOL (*set_wait_mask)(WINPR_COMM *pComm, const ULONG *pWaitMask); - BOOL (*get_wait_mask)(WINPR_COMM *pComm, ULONG *pWaitMask); - BOOL (*wait_on_mask)(WINPR_COMM *pComm, ULONG *pOutputMask); - BOOL (*set_queue_size)(WINPR_COMM *pComm, const SERIAL_QUEUE_SIZE *pQueueSize); - BOOL (*purge)(WINPR_COMM *pComm, const ULONG *pPurgeMask); - BOOL (*get_commstatus)(WINPR_COMM *pComm, SERIAL_STATUS *pCommstatus); - BOOL (*set_break_on)(WINPR_COMM *pComm); - BOOL (*set_break_off)(WINPR_COMM *pComm); - BOOL (*set_xoff)(WINPR_COMM *pComm); - BOOL (*set_xon)(WINPR_COMM *pComm); - BOOL (*get_dtrrts)(WINPR_COMM *pComm, ULONG *pMask); - BOOL (*config_size)(WINPR_COMM *pComm, ULONG *pSize); - BOOL (*immediate_char)(WINPR_COMM *pComm, const UCHAR *pChar); - BOOL (*reset_device)(WINPR_COMM *pComm); + /** + * A function might be NULL if not supported by the underlying driver. + * + * FIXME: better have to use input and output buffers for all functions? + */ + typedef struct _SERIAL_DRIVER + { + SERIAL_DRIVER_ID id; + TCHAR* name; + BOOL (*set_baud_rate)(WINPR_COMM* pComm, const SERIAL_BAUD_RATE* pBaudRate); + BOOL (*get_baud_rate)(WINPR_COMM* pComm, SERIAL_BAUD_RATE* pBaudRate); + BOOL (*get_properties)(WINPR_COMM* pComm, COMMPROP* pProperties); + BOOL (*set_serial_chars)(WINPR_COMM* pComm, const SERIAL_CHARS* pSerialChars); + BOOL (*get_serial_chars)(WINPR_COMM* pComm, SERIAL_CHARS* pSerialChars); + BOOL (*set_line_control)(WINPR_COMM* pComm, const SERIAL_LINE_CONTROL* pLineControl); + BOOL (*get_line_control)(WINPR_COMM* pComm, SERIAL_LINE_CONTROL* pLineControl); + BOOL (*set_handflow)(WINPR_COMM* pComm, const SERIAL_HANDFLOW* pHandflow); + BOOL (*get_handflow)(WINPR_COMM* pComm, SERIAL_HANDFLOW* pHandflow); + BOOL (*set_timeouts)(WINPR_COMM* pComm, const SERIAL_TIMEOUTS* pTimeouts); + BOOL (*get_timeouts)(WINPR_COMM* pComm, SERIAL_TIMEOUTS* pTimeouts); + BOOL (*set_dtr)(WINPR_COMM* pComm); + BOOL (*clear_dtr)(WINPR_COMM* pComm); + BOOL (*set_rts)(WINPR_COMM* pComm); + BOOL (*clear_rts)(WINPR_COMM* pComm); + BOOL (*get_modemstatus)(WINPR_COMM* pComm, ULONG* pRegister); + BOOL (*set_wait_mask)(WINPR_COMM* pComm, const ULONG* pWaitMask); + BOOL (*get_wait_mask)(WINPR_COMM* pComm, ULONG* pWaitMask); + BOOL (*wait_on_mask)(WINPR_COMM* pComm, ULONG* pOutputMask); + BOOL (*set_queue_size)(WINPR_COMM* pComm, const SERIAL_QUEUE_SIZE* pQueueSize); + BOOL (*purge)(WINPR_COMM* pComm, const ULONG* pPurgeMask); + BOOL (*get_commstatus)(WINPR_COMM* pComm, SERIAL_STATUS* pCommstatus); + BOOL (*set_break_on)(WINPR_COMM* pComm); + BOOL (*set_break_off)(WINPR_COMM* pComm); + BOOL (*set_xoff)(WINPR_COMM* pComm); + BOOL (*set_xon)(WINPR_COMM* pComm); + BOOL (*get_dtrrts)(WINPR_COMM* pComm, ULONG* pMask); + BOOL (*config_size)(WINPR_COMM* pComm, ULONG* pSize); + BOOL (*immediate_char)(WINPR_COMM* pComm, const UCHAR* pChar); + BOOL (*reset_device)(WINPR_COMM* pComm); -} SERIAL_DRIVER; + } SERIAL_DRIVER; - -int _comm_ioctl_tcsetattr(int fd, int optional_actions, const struct termios *termios_p); + int _comm_ioctl_tcsetattr(int fd, int optional_actions, const struct termios* termios_p); #ifdef __cplusplus } diff --git a/winpr/libwinpr/comm/comm_sercx2_sys.c b/winpr/libwinpr/comm/comm_sercx2_sys.c index c937f6661..fd0e0c191 100644 --- a/winpr/libwinpr/comm/comm_sercx2_sys.c +++ b/winpr/libwinpr/comm/comm_sercx2_sys.c @@ -29,7 +29,6 @@ #include "comm_sercx2_sys.h" - /* http://msdn.microsoft.com/en-us/library/dn265347%28v=vs.85%29.aspx * * SerCx2 does not support special characters. SerCx2 always completes @@ -46,33 +45,25 @@ static BOOL _set_serial_chars(WINPR_COMM* pComm, const SERIAL_CHARS* pSerialChar return TRUE; } - static BOOL _get_serial_chars(WINPR_COMM* pComm, SERIAL_CHARS* pSerialChars) { ZeroMemory(pSerialChars, sizeof(SERIAL_CHARS)); return TRUE; } - /* http://msdn.microsoft.com/en-us/library/windows/hardware/hh439605%28v=vs.85%29.aspx */ /* FIXME: only using the Serial.sys' events, complete the support of the remaining events */ static const ULONG _SERCX2_SYS_SUPPORTED_EV_MASK = - SERIAL_EV_RXCHAR | - SERIAL_EV_RXFLAG | - SERIAL_EV_TXEMPTY | - SERIAL_EV_CTS | - SERIAL_EV_DSR | - SERIAL_EV_RLSD | - SERIAL_EV_BREAK | - SERIAL_EV_ERR | - SERIAL_EV_RING | - /* SERIAL_EV_PERR | */ - SERIAL_EV_RX80FULL /*| - SERIAL_EV_EVENT1 | - SERIAL_EV_EVENT2*/; + SERIAL_EV_RXCHAR | SERIAL_EV_RXFLAG | SERIAL_EV_TXEMPTY | SERIAL_EV_CTS | SERIAL_EV_DSR | + SERIAL_EV_RLSD | SERIAL_EV_BREAK | SERIAL_EV_ERR | SERIAL_EV_RING | + /* SERIAL_EV_PERR | */ + SERIAL_EV_RX80FULL /*| + SERIAL_EV_EVENT1 | + SERIAL_EV_EVENT2*/ + ; /* use Serial.sys for basis (not SerCx.sys) */ -static BOOL _set_wait_mask(WINPR_COMM *pComm, const ULONG *pWaitMask) +static BOOL _set_wait_mask(WINPR_COMM* pComm, const ULONG* pWaitMask) { ULONG possibleMask; SERIAL_DRIVER* pSerialSys = SerialSys_s(); @@ -81,7 +72,10 @@ static BOOL _set_wait_mask(WINPR_COMM *pComm, const ULONG *pWaitMask) if (possibleMask != *pWaitMask) { - CommLog_Print(WLOG_WARN, "Not all wait events supported (SerCx2.sys), requested events= 0x%08"PRIX32", possible events= 0x%08"PRIX32"", *pWaitMask, possibleMask); + CommLog_Print(WLOG_WARN, + "Not all wait events supported (SerCx2.sys), requested events= 0x%08" PRIX32 + ", possible events= 0x%08" PRIX32 "", + *pWaitMask, possibleMask); /* FIXME: shall we really set the possibleMask and return FALSE? */ pComm->WaitEventMask = possibleMask; @@ -92,8 +86,7 @@ static BOOL _set_wait_mask(WINPR_COMM *pComm, const ULONG *pWaitMask) return pSerialSys->set_wait_mask(pComm, pWaitMask); } - -static BOOL _purge(WINPR_COMM *pComm, const ULONG *pPurgeMask) +static BOOL _purge(WINPR_COMM* pComm, const ULONG* pPurgeMask) { SERIAL_DRIVER* pSerialSys = SerialSys_s(); @@ -101,78 +94,75 @@ static BOOL _purge(WINPR_COMM *pComm, const ULONG *pPurgeMask) if ((*pPurgeMask & SERIAL_PURGE_RXCLEAR) && !(*pPurgeMask & SERIAL_PURGE_RXABORT)) { - CommLog_Print(WLOG_WARN, "Expecting SERIAL_PURGE_RXABORT since SERIAL_PURGE_RXCLEAR is set"); + CommLog_Print(WLOG_WARN, + "Expecting SERIAL_PURGE_RXABORT since SERIAL_PURGE_RXCLEAR is set"); SetLastError(ERROR_INVALID_DEVICE_OBJECT_PARAMETER); return FALSE; } - if ((*pPurgeMask & SERIAL_PURGE_TXCLEAR) && !(*pPurgeMask & SERIAL_PURGE_TXABORT)) { - CommLog_Print(WLOG_WARN, "Expecting SERIAL_PURGE_TXABORT since SERIAL_PURGE_TXCLEAR is set"); + CommLog_Print(WLOG_WARN, + "Expecting SERIAL_PURGE_TXABORT since SERIAL_PURGE_TXCLEAR is set"); SetLastError(ERROR_INVALID_DEVICE_OBJECT_PARAMETER); return FALSE; } - return pSerialSys->purge(pComm, pPurgeMask); } - /* specific functions only */ -static SERIAL_DRIVER _SerCx2Sys = -{ - .id = SerialDriverSerCx2Sys, - .name = _T("SerCx2.sys"), - .set_baud_rate = NULL, - .get_baud_rate = NULL, - .get_properties = NULL, +static SERIAL_DRIVER _SerCx2Sys = { + .id = SerialDriverSerCx2Sys, + .name = _T("SerCx2.sys"), + .set_baud_rate = NULL, + .get_baud_rate = NULL, + .get_properties = NULL, .set_serial_chars = _set_serial_chars, .get_serial_chars = _get_serial_chars, .set_line_control = NULL, .get_line_control = NULL, - .set_handflow = NULL, - .get_handflow = NULL, - .set_timeouts = NULL, - .get_timeouts = NULL, - .set_dtr = NULL, - .clear_dtr = NULL, - .set_rts = NULL, - .clear_rts = NULL, - .get_modemstatus = NULL, - .set_wait_mask = _set_wait_mask, - .get_wait_mask = NULL, - .wait_on_mask = NULL, - .set_queue_size = NULL, - .purge = _purge, - .get_commstatus = NULL, - .set_break_on = NULL, - .set_break_off = NULL, - .set_xoff = NULL, /* not supported by SerCx2.sys */ - .set_xon = NULL, /* not supported by SerCx2.sys */ - .get_dtrrts = NULL, - .config_size = NULL, /* not supported by SerCx2.sys */ - .immediate_char = NULL, /* not supported by SerCx2.sys */ - .reset_device = NULL, /* not supported by SerCx2.sys */ + .set_handflow = NULL, + .get_handflow = NULL, + .set_timeouts = NULL, + .get_timeouts = NULL, + .set_dtr = NULL, + .clear_dtr = NULL, + .set_rts = NULL, + .clear_rts = NULL, + .get_modemstatus = NULL, + .set_wait_mask = _set_wait_mask, + .get_wait_mask = NULL, + .wait_on_mask = NULL, + .set_queue_size = NULL, + .purge = _purge, + .get_commstatus = NULL, + .set_break_on = NULL, + .set_break_off = NULL, + .set_xoff = NULL, /* not supported by SerCx2.sys */ + .set_xon = NULL, /* not supported by SerCx2.sys */ + .get_dtrrts = NULL, + .config_size = NULL, /* not supported by SerCx2.sys */ + .immediate_char = NULL, /* not supported by SerCx2.sys */ + .reset_device = NULL, /* not supported by SerCx2.sys */ }; - SERIAL_DRIVER* SerCx2Sys_s() { /* _SerCx2Sys completed with inherited functions from SerialSys or SerCxSys */ SERIAL_DRIVER* pSerialSys = SerialSys_s(); SERIAL_DRIVER* pSerCxSys = SerCxSys_s(); - _SerCx2Sys.set_baud_rate = pSerialSys->set_baud_rate; - _SerCx2Sys.get_baud_rate = pSerialSys->get_baud_rate; + _SerCx2Sys.set_baud_rate = pSerialSys->set_baud_rate; + _SerCx2Sys.get_baud_rate = pSerialSys->get_baud_rate; - _SerCx2Sys.get_properties = pSerialSys->get_properties; + _SerCx2Sys.get_properties = pSerialSys->get_properties; _SerCx2Sys.set_line_control = pSerCxSys->set_line_control; _SerCx2Sys.get_line_control = pSerCxSys->get_line_control; - /* Only SERIAL_CTS_HANDSHAKE, SERIAL_RTS_CONTROL and SERIAL_RTS_HANDSHAKE flags are really required by SerCx2.sys - * http://msdn.microsoft.com/en-us/library/jj680685%28v=vs.85%29.aspx + /* Only SERIAL_CTS_HANDSHAKE, SERIAL_RTS_CONTROL and SERIAL_RTS_HANDSHAKE flags are really + * required by SerCx2.sys http://msdn.microsoft.com/en-us/library/jj680685%28v=vs.85%29.aspx */ _SerCx2Sys.set_handflow = pSerialSys->set_handflow; _SerCx2Sys.get_handflow = pSerialSys->get_handflow; @@ -180,23 +170,23 @@ SERIAL_DRIVER* SerCx2Sys_s() _SerCx2Sys.set_timeouts = pSerialSys->set_timeouts; _SerCx2Sys.get_timeouts = pSerialSys->get_timeouts; - _SerCx2Sys.set_dtr = pSerialSys->set_dtr; + _SerCx2Sys.set_dtr = pSerialSys->set_dtr; _SerCx2Sys.clear_dtr = pSerialSys->clear_dtr; - _SerCx2Sys.set_rts = pSerialSys->set_rts; + _SerCx2Sys.set_rts = pSerialSys->set_rts; _SerCx2Sys.clear_rts = pSerialSys->clear_rts; _SerCx2Sys.get_modemstatus = pSerialSys->get_modemstatus; _SerCx2Sys.set_wait_mask = pSerialSys->set_wait_mask; _SerCx2Sys.get_wait_mask = pSerialSys->get_wait_mask; - _SerCx2Sys.wait_on_mask = pSerialSys->wait_on_mask; + _SerCx2Sys.wait_on_mask = pSerialSys->wait_on_mask; _SerCx2Sys.set_queue_size = pSerialSys->set_queue_size; _SerCx2Sys.get_commstatus = pSerialSys->get_commstatus; - _SerCx2Sys.set_break_on = pSerialSys->set_break_on; + _SerCx2Sys.set_break_on = pSerialSys->set_break_on; _SerCx2Sys.set_break_off = pSerialSys->set_break_off; _SerCx2Sys.get_dtrrts = pSerialSys->get_dtrrts; diff --git a/winpr/libwinpr/comm/comm_sercx2_sys.h b/winpr/libwinpr/comm/comm_sercx2_sys.h index 49e9da672..162898eba 100644 --- a/winpr/libwinpr/comm/comm_sercx2_sys.h +++ b/winpr/libwinpr/comm/comm_sercx2_sys.h @@ -25,10 +25,11 @@ #include "comm_ioctl.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -SERIAL_DRIVER* SerCx2Sys_s(); + SERIAL_DRIVER* SerCx2Sys_s(); #ifdef __cplusplus } diff --git a/winpr/libwinpr/comm/comm_sercx_sys.c b/winpr/libwinpr/comm/comm_sercx_sys.c index 59c31b9ce..a54675b2b 100644 --- a/winpr/libwinpr/comm/comm_sercx_sys.c +++ b/winpr/libwinpr/comm/comm_sercx_sys.c @@ -29,8 +29,7 @@ #include "comm_serial_sys.h" - -static BOOL _set_handflow(WINPR_COMM *pComm, const SERIAL_HANDFLOW *pHandflow) +static BOOL _set_handflow(WINPR_COMM* pComm, const SERIAL_HANDFLOW* pHandflow) { SERIAL_HANDFLOW SerCxHandflow; BOOL result = TRUE; @@ -43,24 +42,30 @@ static BOOL _set_handflow(WINPR_COMM *pComm, const SERIAL_HANDFLOW *pHandflow) * http://msdn.microsoft.com/en-us/library/windows/hardware/jj680685%28v=vs.85%29.aspx */ - SerCxHandflow.ControlHandShake = pHandflow->ControlHandShake & (SERIAL_DTR_CONTROL | SERIAL_DTR_HANDSHAKE | SERIAL_CTS_HANDSHAKE | SERIAL_DSR_HANDSHAKE); - SerCxHandflow.FlowReplace = pHandflow->FlowReplace & (SERIAL_RTS_CONTROL | SERIAL_RTS_HANDSHAKE); + SerCxHandflow.ControlHandShake = + pHandflow->ControlHandShake & + (SERIAL_DTR_CONTROL | SERIAL_DTR_HANDSHAKE | SERIAL_CTS_HANDSHAKE | SERIAL_DSR_HANDSHAKE); + SerCxHandflow.FlowReplace = + pHandflow->FlowReplace & (SERIAL_RTS_CONTROL | SERIAL_RTS_HANDSHAKE); if (SerCxHandflow.ControlHandShake != pHandflow->ControlHandShake) { if (pHandflow->ControlHandShake & SERIAL_DCD_HANDSHAKE) { - CommLog_Print(WLOG_WARN, "SERIAL_DCD_HANDSHAKE not supposed to be implemented by SerCx.sys"); + CommLog_Print(WLOG_WARN, + "SERIAL_DCD_HANDSHAKE not supposed to be implemented by SerCx.sys"); } if (pHandflow->ControlHandShake & SERIAL_DSR_SENSITIVITY) { - CommLog_Print(WLOG_WARN, "SERIAL_DSR_SENSITIVITY not supposed to be implemented by SerCx.sys"); + CommLog_Print(WLOG_WARN, + "SERIAL_DSR_SENSITIVITY not supposed to be implemented by SerCx.sys"); } if (pHandflow->ControlHandShake & SERIAL_ERROR_ABORT) { - CommLog_Print(WLOG_WARN, "SERIAL_ERROR_ABORT not supposed to be implemented by SerCx.sys"); + CommLog_Print(WLOG_WARN, + "SERIAL_ERROR_ABORT not supposed to be implemented by SerCx.sys"); } SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -71,32 +76,38 @@ static BOOL _set_handflow(WINPR_COMM *pComm, const SERIAL_HANDFLOW *pHandflow) { if (pHandflow->ControlHandShake & SERIAL_AUTO_TRANSMIT) { - CommLog_Print(WLOG_WARN, "SERIAL_AUTO_TRANSMIT not supposed to be implemented by SerCx.sys"); + CommLog_Print(WLOG_WARN, + "SERIAL_AUTO_TRANSMIT not supposed to be implemented by SerCx.sys"); } if (pHandflow->ControlHandShake & SERIAL_AUTO_RECEIVE) { - CommLog_Print(WLOG_WARN, "SERIAL_AUTO_RECEIVE not supposed to be implemented by SerCx.sys"); + CommLog_Print(WLOG_WARN, + "SERIAL_AUTO_RECEIVE not supposed to be implemented by SerCx.sys"); } if (pHandflow->ControlHandShake & SERIAL_ERROR_CHAR) { - CommLog_Print(WLOG_WARN, "SERIAL_ERROR_CHAR not supposed to be implemented by SerCx.sys"); + CommLog_Print(WLOG_WARN, + "SERIAL_ERROR_CHAR not supposed to be implemented by SerCx.sys"); } if (pHandflow->ControlHandShake & SERIAL_NULL_STRIPPING) { - CommLog_Print(WLOG_WARN, "SERIAL_NULL_STRIPPING not supposed to be implemented by SerCx.sys"); + CommLog_Print(WLOG_WARN, + "SERIAL_NULL_STRIPPING not supposed to be implemented by SerCx.sys"); } if (pHandflow->ControlHandShake & SERIAL_BREAK_CHAR) { - CommLog_Print(WLOG_WARN, "SERIAL_BREAK_CHAR not supposed to be implemented by SerCx.sys"); + CommLog_Print(WLOG_WARN, + "SERIAL_BREAK_CHAR not supposed to be implemented by SerCx.sys"); } if (pHandflow->ControlHandShake & SERIAL_XOFF_CONTINUE) { - CommLog_Print(WLOG_WARN, "SERIAL_XOFF_CONTINUE not supposed to be implemented by SerCx.sys"); + CommLog_Print(WLOG_WARN, + "SERIAL_XOFF_CONTINUE not supposed to be implemented by SerCx.sys"); } SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -109,8 +120,7 @@ static BOOL _set_handflow(WINPR_COMM *pComm, const SERIAL_HANDFLOW *pHandflow) return result; } - -static BOOL _get_handflow(WINPR_COMM *pComm, SERIAL_HANDFLOW *pHandflow) +static BOOL _get_handflow(WINPR_COMM* pComm, SERIAL_HANDFLOW* pHandflow) { BOOL result; SERIAL_DRIVER* pSerialSys = SerialSys_s(); @@ -122,31 +132,27 @@ static BOOL _get_handflow(WINPR_COMM *pComm, SERIAL_HANDFLOW *pHandflow) * http://msdn.microsoft.com/en-us/library/windows/hardware/jj680685%28v=vs.85%29.aspx */ - pHandflow->ControlHandShake = pHandflow->ControlHandShake & (SERIAL_DTR_CONTROL | SERIAL_DTR_HANDSHAKE | SERIAL_CTS_HANDSHAKE | SERIAL_DSR_HANDSHAKE); + pHandflow->ControlHandShake = + pHandflow->ControlHandShake & + (SERIAL_DTR_CONTROL | SERIAL_DTR_HANDSHAKE | SERIAL_CTS_HANDSHAKE | SERIAL_DSR_HANDSHAKE); pHandflow->FlowReplace = pHandflow->FlowReplace & (SERIAL_RTS_CONTROL | SERIAL_RTS_HANDSHAKE); return result; } - /* http://msdn.microsoft.com/en-us/library/windows/hardware/hh439605%28v=vs.85%29.aspx */ -static const ULONG _SERCX_SYS_SUPPORTED_EV_MASK = - SERIAL_EV_RXCHAR | - /* SERIAL_EV_RXFLAG | */ - SERIAL_EV_TXEMPTY | - SERIAL_EV_CTS | - SERIAL_EV_DSR | - SERIAL_EV_RLSD | - SERIAL_EV_BREAK | - SERIAL_EV_ERR | - SERIAL_EV_RING /* | - SERIAL_EV_PERR | - SERIAL_EV_RX80FULL | - SERIAL_EV_EVENT1 | - SERIAL_EV_EVENT2*/; +static const ULONG _SERCX_SYS_SUPPORTED_EV_MASK = SERIAL_EV_RXCHAR | + /* SERIAL_EV_RXFLAG | */ + SERIAL_EV_TXEMPTY | SERIAL_EV_CTS | + SERIAL_EV_DSR | SERIAL_EV_RLSD | SERIAL_EV_BREAK | + SERIAL_EV_ERR | SERIAL_EV_RING /* | + SERIAL_EV_PERR | + SERIAL_EV_RX80FULL | + SERIAL_EV_EVENT1 | + SERIAL_EV_EVENT2*/ + ; - -static BOOL _set_wait_mask(WINPR_COMM *pComm, const ULONG *pWaitMask) +static BOOL _set_wait_mask(WINPR_COMM* pComm, const ULONG* pWaitMask) { ULONG possibleMask; SERIAL_DRIVER* pSerialSys = SerialSys_s(); @@ -155,7 +161,10 @@ static BOOL _set_wait_mask(WINPR_COMM *pComm, const ULONG *pWaitMask) if (possibleMask != *pWaitMask) { - CommLog_Print(WLOG_WARN, "Not all wait events supported (SerCx.sys), requested events= 0x%08"PRIX32", possible events= 0x%08"PRIX32"", *pWaitMask, possibleMask); + CommLog_Print(WLOG_WARN, + "Not all wait events supported (SerCx.sys), requested events= 0x%08" PRIX32 + ", possible events= 0x%08" PRIX32 "", + *pWaitMask, possibleMask); /* FIXME: shall we really set the possibleMask and return FALSE? */ pComm->WaitEventMask = possibleMask; @@ -166,53 +175,49 @@ static BOOL _set_wait_mask(WINPR_COMM *pComm, const ULONG *pWaitMask) return pSerialSys->set_wait_mask(pComm, pWaitMask); } - /* specific functions only */ -static SERIAL_DRIVER _SerCxSys = -{ - .id = SerialDriverSerCxSys, - .name = _T("SerCx.sys"), - .set_baud_rate = NULL, - .get_baud_rate = NULL, - .get_properties = NULL, +static SERIAL_DRIVER _SerCxSys = { + .id = SerialDriverSerCxSys, + .name = _T("SerCx.sys"), + .set_baud_rate = NULL, + .get_baud_rate = NULL, + .get_properties = NULL, .set_serial_chars = NULL, .get_serial_chars = NULL, .set_line_control = NULL, .get_line_control = NULL, - .set_handflow = _set_handflow, - .get_handflow = _get_handflow, - .set_timeouts = NULL, - .get_timeouts = NULL, - .set_dtr = NULL, - .clear_dtr = NULL, - .set_rts = NULL, - .clear_rts = NULL, - .get_modemstatus = NULL, - .set_wait_mask = _set_wait_mask, - .get_wait_mask = NULL, - .wait_on_mask = NULL, - .set_queue_size = NULL, - .purge = NULL, - .get_commstatus = NULL, - .set_break_on = NULL, - .set_break_off = NULL, - .set_xoff = NULL, - .set_xon = NULL, - .get_dtrrts = NULL, - .config_size = NULL, /* not supported by SerCx.sys */ - .immediate_char = NULL, - .reset_device = NULL, /* not supported by SerCx.sys */ + .set_handflow = _set_handflow, + .get_handflow = _get_handflow, + .set_timeouts = NULL, + .get_timeouts = NULL, + .set_dtr = NULL, + .clear_dtr = NULL, + .set_rts = NULL, + .clear_rts = NULL, + .get_modemstatus = NULL, + .set_wait_mask = _set_wait_mask, + .get_wait_mask = NULL, + .wait_on_mask = NULL, + .set_queue_size = NULL, + .purge = NULL, + .get_commstatus = NULL, + .set_break_on = NULL, + .set_break_off = NULL, + .set_xoff = NULL, + .set_xon = NULL, + .get_dtrrts = NULL, + .config_size = NULL, /* not supported by SerCx.sys */ + .immediate_char = NULL, + .reset_device = NULL, /* not supported by SerCx.sys */ }; - - SERIAL_DRIVER* SerCxSys_s() { /* _SerCxSys completed with inherited functions from SerialSys */ SERIAL_DRIVER* pSerialSys = SerialSys_s(); - _SerCxSys.set_baud_rate = pSerialSys->set_baud_rate; - _SerCxSys.get_baud_rate = pSerialSys->get_baud_rate; + _SerCxSys.set_baud_rate = pSerialSys->set_baud_rate; + _SerCxSys.get_baud_rate = pSerialSys->get_baud_rate; _SerCxSys.get_properties = pSerialSys->get_properties; @@ -234,7 +239,7 @@ SERIAL_DRIVER* SerCxSys_s() _SerCxSys.set_wait_mask = pSerialSys->set_wait_mask; _SerCxSys.get_wait_mask = pSerialSys->get_wait_mask; - _SerCxSys.wait_on_mask = pSerialSys->wait_on_mask; + _SerCxSys.wait_on_mask = pSerialSys->wait_on_mask; _SerCxSys.set_queue_size = pSerialSys->set_queue_size; @@ -242,14 +247,13 @@ SERIAL_DRIVER* SerCxSys_s() _SerCxSys.get_commstatus = pSerialSys->get_commstatus; - _SerCxSys.set_break_on = pSerialSys->set_break_on; + _SerCxSys.set_break_on = pSerialSys->set_break_on; _SerCxSys.set_break_off = pSerialSys->set_break_off; - _SerCxSys.set_xoff = pSerialSys->set_xoff; - _SerCxSys.set_xon = pSerialSys->set_xon; + _SerCxSys.set_xon = pSerialSys->set_xon; - _SerCxSys.get_dtrrts = pSerialSys->get_dtrrts; + _SerCxSys.get_dtrrts = pSerialSys->get_dtrrts; _SerCxSys.immediate_char = pSerialSys->immediate_char; diff --git a/winpr/libwinpr/comm/comm_sercx_sys.h b/winpr/libwinpr/comm/comm_sercx_sys.h index 2a235743f..ce008e7c9 100644 --- a/winpr/libwinpr/comm/comm_sercx_sys.h +++ b/winpr/libwinpr/comm/comm_sercx_sys.h @@ -25,17 +25,16 @@ #include "comm_ioctl.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -SERIAL_DRIVER* SerCxSys_s(); + SERIAL_DRIVER* SerCxSys_s(); #ifdef __cplusplus } #endif - #endif /* __linux__ */ - #endif /* COMM_SERCX_SYS_H */ diff --git a/winpr/libwinpr/comm/comm_serial_sys.c b/winpr/libwinpr/comm/comm_serial_sys.c index be5443f02..520e28f72 100644 --- a/winpr/libwinpr/comm/comm_serial_sys.c +++ b/winpr/libwinpr/comm/comm_serial_sys.c @@ -44,12 +44,11 @@ #endif /* hard-coded in N_TTY */ -#define TTY_THRESHOLD_THROTTLE 128 /* now based on remaining room */ -#define TTY_THRESHOLD_UNTHROTTLE 128 -#define N_TTY_BUF_SIZE 4096 +#define TTY_THRESHOLD_THROTTLE 128 /* now based on remaining room */ +#define TTY_THRESHOLD_UNTHROTTLE 128 +#define N_TTY_BUF_SIZE 4096 - -#define _BAUD_TABLE_END 0010020 /* __MAX_BAUD + 1 */ +#define _BAUD_TABLE_END 0010020 /* __MAX_BAUD + 1 */ /* 0: B* (Linux termios) * 1: CBR_* or actual baud rate @@ -57,108 +56,107 @@ */ static const speed_t _BAUD_TABLE[][3] = { #ifdef B0 - {B0, 0, 0}, /* hang up */ + { B0, 0, 0 }, /* hang up */ #endif #ifdef B50 - {B50, 50, 0}, + { B50, 50, 0 }, #endif #ifdef B75 - {B75, 75, BAUD_075}, + { B75, 75, BAUD_075 }, #endif #ifdef B110 - {B110, CBR_110, BAUD_110}, + { B110, CBR_110, BAUD_110 }, #endif -#ifdef B134 - {B134, 134, 0 /*BAUD_134_5*/}, +#ifdef B134 + { B134, 134, 0 /*BAUD_134_5*/ }, #endif -#ifdef B150 - {B150, 150, BAUD_150}, +#ifdef B150 + { B150, 150, BAUD_150 }, #endif #ifdef B200 - {B200, 200, 0}, + { B200, 200, 0 }, #endif #ifdef B300 - {B300, CBR_300, BAUD_300}, + { B300, CBR_300, BAUD_300 }, #endif #ifdef B600 - {B600, CBR_600, BAUD_600}, + { B600, CBR_600, BAUD_600 }, #endif #ifdef B1200 - {B1200, CBR_1200, BAUD_1200}, + { B1200, CBR_1200, BAUD_1200 }, #endif #ifdef B1800 - {B1800, 1800, BAUD_1800}, + { B1800, 1800, BAUD_1800 }, #endif #ifdef B2400 - {B2400, CBR_2400, BAUD_2400}, + { B2400, CBR_2400, BAUD_2400 }, #endif #ifdef B4800 - {B4800, CBR_4800, BAUD_4800}, + { B4800, CBR_4800, BAUD_4800 }, #endif - /* {, ,BAUD_7200} */ +/* {, ,BAUD_7200} */ #ifdef B9600 - {B9600, CBR_9600, BAUD_9600}, + { B9600, CBR_9600, BAUD_9600 }, #endif - /* {, CBR_14400, BAUD_14400}, /\* unsupported on Linux *\/ */ +/* {, CBR_14400, BAUD_14400}, /\* unsupported on Linux *\/ */ #ifdef B19200 - {B19200, CBR_19200, BAUD_19200}, + { B19200, CBR_19200, BAUD_19200 }, #endif #ifdef B38400 - {B38400, CBR_38400, BAUD_38400}, + { B38400, CBR_38400, BAUD_38400 }, #endif - /* {, CBR_56000, BAUD_56K}, /\* unsupported on Linux *\/ */ -#ifdef B57600 - {B57600, CBR_57600, BAUD_57600}, +/* {, CBR_56000, BAUD_56K}, /\* unsupported on Linux *\/ */ +#ifdef B57600 + { B57600, CBR_57600, BAUD_57600 }, #endif #ifdef B115200 - {B115200, CBR_115200, BAUD_115200}, + { B115200, CBR_115200, BAUD_115200 }, #endif - /* {, CBR_128000, BAUD_128K}, /\* unsupported on Linux *\/ */ - /* {, CBR_256000, BAUD_USER}, /\* unsupported on Linux *\/ */ +/* {, CBR_128000, BAUD_128K}, /\* unsupported on Linux *\/ */ +/* {, CBR_256000, BAUD_USER}, /\* unsupported on Linux *\/ */ #ifdef B230400 - {B230400, 230400, BAUD_USER}, + { B230400, 230400, BAUD_USER }, #endif #ifdef B460800 - {B460800, 460800, BAUD_USER}, + { B460800, 460800, BAUD_USER }, #endif #ifdef B500000 - {B500000, 500000, BAUD_USER}, + { B500000, 500000, BAUD_USER }, #endif -#ifdef B576000 - {B576000, 576000, BAUD_USER}, +#ifdef B576000 + { B576000, 576000, BAUD_USER }, #endif #ifdef B921600 - {B921600, 921600, BAUD_USER}, + { B921600, 921600, BAUD_USER }, #endif #ifdef B1000000 - {B1000000, 1000000, BAUD_USER}, + { B1000000, 1000000, BAUD_USER }, #endif #ifdef B1152000 - {B1152000, 1152000, BAUD_USER}, + { B1152000, 1152000, BAUD_USER }, #endif #ifdef B1500000 - {B1500000, 1500000, BAUD_USER}, + { B1500000, 1500000, BAUD_USER }, #endif #ifdef B2000000 - {B2000000, 2000000, BAUD_USER}, + { B2000000, 2000000, BAUD_USER }, #endif #ifdef B2500000 - {B2500000, 2500000, BAUD_USER}, + { B2500000, 2500000, BAUD_USER }, #endif #ifdef B3000000 - {B3000000, 3000000, BAUD_USER}, + { B3000000, 3000000, BAUD_USER }, #endif #ifdef B3500000 - {B3500000, 3500000, BAUD_USER}, + { B3500000, 3500000, BAUD_USER }, #endif #ifdef B4000000 - {B4000000, 4000000, BAUD_USER}, /* __MAX_BAUD */ + { B4000000, 4000000, BAUD_USER }, /* __MAX_BAUD */ #endif - {_BAUD_TABLE_END, 0, 0} + { _BAUD_TABLE_END, 0, 0 } }; - -static BOOL _get_properties(WINPR_COMM *pComm, COMMPROP *pProperties) +static BOOL _get_properties(WINPR_COMM* pComm, COMMPROP* pProperties) { int i; @@ -187,28 +185,31 @@ static BOOL _get_properties(WINPR_COMM *pComm, COMMPROP *pProperties) pProperties->dwMaxRxQueue = N_TTY_BUF_SIZE; /* FIXME: to be probe on the device? */ - pProperties->dwMaxBaud = BAUD_USER; + pProperties->dwMaxBaud = BAUD_USER; /* FIXME: what about PST_RS232? see also: serial_struct */ pProperties->dwProvSubType = PST_UNSPECIFIED; /* TODO: to be finalized */ pProperties->dwProvCapabilities = - /*PCF_16BITMODE |*/ PCF_DTRDSR | PCF_INTTIMEOUTS | PCF_PARITY_CHECK | /*PCF_RLSD |*/ - PCF_RTSCTS | PCF_SETXCHAR | /*PCF_SPECIALCHARS |*/ PCF_TOTALTIMEOUTS | PCF_XONXOFF; + /*PCF_16BITMODE |*/ PCF_DTRDSR | PCF_INTTIMEOUTS | PCF_PARITY_CHECK | /*PCF_RLSD |*/ + PCF_RTSCTS | PCF_SETXCHAR | /*PCF_SPECIALCHARS |*/ PCF_TOTALTIMEOUTS | PCF_XONXOFF; /* TODO: double check SP_RLSD */ - pProperties->dwSettableParams = SP_BAUD | SP_DATABITS | SP_HANDSHAKING | SP_PARITY | SP_PARITY_CHECK | /*SP_RLSD |*/ SP_STOPBITS; + pProperties->dwSettableParams = SP_BAUD | SP_DATABITS | SP_HANDSHAKING | SP_PARITY | + SP_PARITY_CHECK | /*SP_RLSD |*/ SP_STOPBITS; pProperties->dwSettableBaud = 0; - for (i=0; _BAUD_TABLE[i][0]<_BAUD_TABLE_END; i++) + for (i = 0; _BAUD_TABLE[i][0] < _BAUD_TABLE_END; i++) { pProperties->dwSettableBaud |= _BAUD_TABLE[i][2]; } - pProperties->wSettableData = DATABITS_5 | DATABITS_6 | DATABITS_7 | DATABITS_8 /*| DATABITS_16 | DATABITS_16X*/; + pProperties->wSettableData = + DATABITS_5 | DATABITS_6 | DATABITS_7 | DATABITS_8 /*| DATABITS_16 | DATABITS_16X*/; - pProperties->wSettableStopParity = STOPBITS_10 | /*STOPBITS_15 |*/ STOPBITS_20 | PARITY_NONE | PARITY_ODD | PARITY_EVEN | PARITY_MARK | PARITY_SPACE; + pProperties->wSettableStopParity = STOPBITS_10 | /*STOPBITS_15 |*/ STOPBITS_20 | PARITY_NONE | + PARITY_ODD | PARITY_EVEN | PARITY_MARK | PARITY_SPACE; /* FIXME: additional input and output buffers could be implemented on top of N_TTY */ pProperties->dwCurrentTxQueue = N_TTY_BUF_SIZE; @@ -221,27 +222,29 @@ static BOOL _get_properties(WINPR_COMM *pComm, COMMPROP *pProperties) return TRUE; } -static BOOL _set_baud_rate(WINPR_COMM *pComm, const SERIAL_BAUD_RATE *pBaudRate) +static BOOL _set_baud_rate(WINPR_COMM* pComm, const SERIAL_BAUD_RATE* pBaudRate) { int i; speed_t newSpeed; struct termios futureState; ZeroMemory(&futureState, sizeof(struct termios)); - if (tcgetattr(pComm->fd, &futureState) < 0) /* NB: preserves current settings not directly handled by the Communication Functions */ + if (tcgetattr(pComm->fd, &futureState) < + 0) /* NB: preserves current settings not directly handled by the Communication Functions */ { SetLastError(ERROR_IO_DEVICE); return FALSE; } - for (i=0; _BAUD_TABLE[i][0]<_BAUD_TABLE_END; i++) + for (i = 0; _BAUD_TABLE[i][0] < _BAUD_TABLE_END; i++) { if (_BAUD_TABLE[i][1] == pBaudRate->BaudRate) { newSpeed = _BAUD_TABLE[i][0]; if (cfsetspeed(&futureState, newSpeed) < 0) { - CommLog_Print(WLOG_WARN, "failed to set speed 0x%x (%"PRIu32")", newSpeed, pBaudRate->BaudRate); + CommLog_Print(WLOG_WARN, "failed to set speed 0x%x (%" PRIu32 ")", newSpeed, + pBaudRate->BaudRate); return FALSE; } @@ -249,7 +252,8 @@ static BOOL _set_baud_rate(WINPR_COMM *pComm, const SERIAL_BAUD_RATE *pBaudRate) if (_comm_ioctl_tcsetattr(pComm->fd, TCSANOW, &futureState) < 0) { - CommLog_Print(WLOG_WARN, "_comm_ioctl_tcsetattr failure: last-error: 0x%"PRIX32"", GetLastError()); + CommLog_Print(WLOG_WARN, "_comm_ioctl_tcsetattr failure: last-error: 0x%" PRIX32 "", + GetLastError()); return FALSE; } @@ -257,13 +261,13 @@ static BOOL _set_baud_rate(WINPR_COMM *pComm, const SERIAL_BAUD_RATE *pBaudRate) } } - CommLog_Print(WLOG_WARN, "could not find a matching speed for the baud rate %"PRIu32"", pBaudRate->BaudRate); + CommLog_Print(WLOG_WARN, "could not find a matching speed for the baud rate %" PRIu32 "", + pBaudRate->BaudRate); SetLastError(ERROR_INVALID_DATA); return FALSE; } - -static BOOL _get_baud_rate(WINPR_COMM *pComm, SERIAL_BAUD_RATE *pBaudRate) +static BOOL _get_baud_rate(WINPR_COMM* pComm, SERIAL_BAUD_RATE* pBaudRate) { int i; speed_t currentSpeed; @@ -278,7 +282,7 @@ static BOOL _get_baud_rate(WINPR_COMM *pComm, SERIAL_BAUD_RATE *pBaudRate) currentSpeed = cfgetispeed(¤tState); - for (i=0; _BAUD_TABLE[i][0]<_BAUD_TABLE_END; i++) + for (i = 0; _BAUD_TABLE[i][0] < _BAUD_TABLE_END; i++) { if (_BAUD_TABLE[i][0] == currentSpeed) { @@ -287,12 +291,12 @@ static BOOL _get_baud_rate(WINPR_COMM *pComm, SERIAL_BAUD_RATE *pBaudRate) } } - CommLog_Print(WLOG_WARN, "could not find a matching baud rate for the speed 0x%x", currentSpeed); + CommLog_Print(WLOG_WARN, "could not find a matching baud rate for the speed 0x%x", + currentSpeed); SetLastError(ERROR_INVALID_DATA); return FALSE; } - /** * NOTE: Only XonChar and XoffChar are plenty supported with the Linux * N_TTY line discipline. @@ -302,7 +306,7 @@ static BOOL _get_baud_rate(WINPR_COMM *pComm, SERIAL_BAUD_RATE *pBaudRate) * ERROR_INVALID_PARAMETER when Xon and Xoff chars are the same; * ERROR_NOT_SUPPORTED */ -static BOOL _set_serial_chars(WINPR_COMM *pComm, const SERIAL_CHARS *pSerialChars) +static BOOL _set_serial_chars(WINPR_COMM* pComm, const SERIAL_CHARS* pSerialChars) { BOOL result = TRUE; struct termios upcomingTermios; @@ -322,10 +326,10 @@ static BOOL _set_serial_chars(WINPR_COMM *pComm, const SERIAL_CHARS *pSerialChar } /* termios(3): (..) above symbolic subscript values are all - * different, except that VTIME, VMIN may have the same value - * as VEOL, VEOF, respectively. In noncanonical mode the - * special character meaning is replaced by the timeout - * meaning. + * different, except that VTIME, VMIN may have the same value + * as VEOL, VEOF, respectively. In noncanonical mode the + * special character meaning is replaced by the timeout + * meaning. * * EofChar and c_cc[VEOF] are not quite the same, prefer to * don't use c_cc[VEOF] at all. @@ -334,7 +338,7 @@ static BOOL _set_serial_chars(WINPR_COMM *pComm, const SERIAL_CHARS *pSerialChar */ if (pSerialChars->EofChar != '\0') { - CommLog_Print(WLOG_WARN, "EofChar %02"PRIX8" cannot be set\n", pSerialChars->EofChar); + CommLog_Print(WLOG_WARN, "EofChar %02" PRIX8 " cannot be set\n", pSerialChars->EofChar); SetLastError(ERROR_NOT_SUPPORTED); result = FALSE; /* but keep on */ } @@ -347,7 +351,8 @@ static BOOL _set_serial_chars(WINPR_COMM *pComm, const SERIAL_CHARS *pSerialChar /* FIXME: see also: _set_handflow() */ if (pSerialChars->ErrorChar != '\0') { - CommLog_Print(WLOG_WARN, "ErrorChar 0x%02"PRIX8" ('%c') cannot be set (unsupported).\n", pSerialChars->ErrorChar, (char) pSerialChars->ErrorChar); + CommLog_Print(WLOG_WARN, "ErrorChar 0x%02" PRIX8 " ('%c') cannot be set (unsupported).\n", + pSerialChars->ErrorChar, (char)pSerialChars->ErrorChar); SetLastError(ERROR_NOT_SUPPORTED); result = FALSE; /* but keep on */ } @@ -355,7 +360,8 @@ static BOOL _set_serial_chars(WINPR_COMM *pComm, const SERIAL_CHARS *pSerialChar /* FIXME: see also: _set_handflow() */ if (pSerialChars->BreakChar != '\0') { - CommLog_Print(WLOG_WARN, "BreakChar 0x%02"PRIX8" ('%c') cannot be set (unsupported).\n", pSerialChars->BreakChar, (char) pSerialChars->BreakChar); + CommLog_Print(WLOG_WARN, "BreakChar 0x%02" PRIX8 " ('%c') cannot be set (unsupported).\n", + pSerialChars->BreakChar, (char)pSerialChars->BreakChar); SetLastError(ERROR_NOT_SUPPORTED); result = FALSE; /* but keep on */ } @@ -369,18 +375,17 @@ static BOOL _set_serial_chars(WINPR_COMM *pComm, const SERIAL_CHARS *pSerialChar upcomingTermios.c_cc[VSTOP] = pSerialChars->XoffChar; - if (_comm_ioctl_tcsetattr(pComm->fd, TCSANOW, &upcomingTermios) < 0) { - CommLog_Print(WLOG_WARN, "_comm_ioctl_tcsetattr failure: last-error: 0x%08"PRIX32"", GetLastError()); + CommLog_Print(WLOG_WARN, "_comm_ioctl_tcsetattr failure: last-error: 0x%08" PRIX32 "", + GetLastError()); return FALSE; } return result; } - -static BOOL _get_serial_chars(WINPR_COMM *pComm, SERIAL_CHARS *pSerialChars) +static BOOL _get_serial_chars(WINPR_COMM* pComm, SERIAL_CHARS* pSerialChars) { struct termios currentTermios; @@ -409,13 +414,11 @@ static BOOL _get_serial_chars(WINPR_COMM *pComm, SERIAL_CHARS *pSerialChars) return TRUE; } - -static BOOL _set_line_control(WINPR_COMM *pComm, const SERIAL_LINE_CONTROL *pLineControl) +static BOOL _set_line_control(WINPR_COMM* pComm, const SERIAL_LINE_CONTROL* pLineControl) { BOOL result = TRUE; struct termios upcomingTermios; - /* http://msdn.microsoft.com/en-us/library/windows/desktop/aa363214%28v=vs.85%29.aspx * * The use of 5 data bits with 2 stop bits is an invalid @@ -425,7 +428,6 @@ static BOOL _set_line_control(WINPR_COMM *pComm, const SERIAL_LINE_CONTROL *pLin * this issue. At least produce a warning message? */ - ZeroMemory(&upcomingTermios, sizeof(struct termios)); if (tcgetattr(pComm->fd, &upcomingTermios) < 0) { @@ -450,12 +452,12 @@ static BOOL _set_line_control(WINPR_COMM *pComm, const SERIAL_LINE_CONTROL *pLin break; default: - CommLog_Print(WLOG_WARN, "unexpected number of stop bits: %"PRIu8"\n", pLineControl->StopBits); + CommLog_Print(WLOG_WARN, "unexpected number of stop bits: %" PRIu8 "\n", + pLineControl->StopBits); result = FALSE; /* but keep on */ break; } - switch (pLineControl->Parity) { case NO_PARITY: @@ -482,7 +484,8 @@ static BOOL _set_line_control(WINPR_COMM *pComm, const SERIAL_LINE_CONTROL *pLin break; default: - CommLog_Print(WLOG_WARN, "unexpected type of parity: %"PRIu8"\n", pLineControl->Parity); + CommLog_Print(WLOG_WARN, "unexpected type of parity: %" PRIu8 "\n", + pLineControl->Parity); result = FALSE; /* but keep on */ break; } @@ -510,22 +513,23 @@ static BOOL _set_line_control(WINPR_COMM *pComm, const SERIAL_LINE_CONTROL *pLin break; default: - CommLog_Print(WLOG_WARN, "unexpected number od data bits per character: %"PRIu8"\n", pLineControl->WordLength); + CommLog_Print(WLOG_WARN, "unexpected number od data bits per character: %" PRIu8 "\n", + pLineControl->WordLength); result = FALSE; /* but keep on */ break; } if (_comm_ioctl_tcsetattr(pComm->fd, TCSANOW, &upcomingTermios) < 0) { - CommLog_Print(WLOG_WARN, "_comm_ioctl_tcsetattr failure: last-error: 0x%08"PRIX32"", GetLastError()); + CommLog_Print(WLOG_WARN, "_comm_ioctl_tcsetattr failure: last-error: 0x%08" PRIX32 "", + GetLastError()); return FALSE; } return result; } - -static BOOL _get_line_control(WINPR_COMM *pComm, SERIAL_LINE_CONTROL *pLineControl) +static BOOL _get_line_control(WINPR_COMM* pComm, SERIAL_LINE_CONTROL* pLineControl) { struct termios currentTermios; @@ -549,7 +553,7 @@ static BOOL _get_line_control(WINPR_COMM *pComm, SERIAL_LINE_CONTROL *pLineContr else { /* PARENB is set */ - pLineControl->Parity = (currentTermios.c_cflag & PARODD) ? ODD_PARITY : EVEN_PARITY; + pLineControl->Parity = (currentTermios.c_cflag & PARODD) ? ODD_PARITY : EVEN_PARITY; } switch (currentTermios.c_cflag & CSIZE) @@ -571,8 +575,7 @@ static BOOL _get_line_control(WINPR_COMM *pComm, SERIAL_LINE_CONTROL *pLineContr return TRUE; } - -static BOOL _set_handflow(WINPR_COMM *pComm, const SERIAL_HANDFLOW *pHandflow) +static BOOL _set_handflow(WINPR_COMM* pComm, const SERIAL_HANDFLOW* pHandflow) { BOOL result = TRUE; struct termios upcomingTermios; @@ -587,15 +590,20 @@ static BOOL _set_handflow(WINPR_COMM *pComm, const SERIAL_HANDFLOW *pHandflow) /* HUPCL */ /* logical XOR */ - if ((!(pHandflow->ControlHandShake & SERIAL_DTR_CONTROL) && (pHandflow->FlowReplace & SERIAL_RTS_CONTROL)) || - ((pHandflow->ControlHandShake & SERIAL_DTR_CONTROL) && !(pHandflow->FlowReplace & SERIAL_RTS_CONTROL))) + if ((!(pHandflow->ControlHandShake & SERIAL_DTR_CONTROL) && + (pHandflow->FlowReplace & SERIAL_RTS_CONTROL)) || + ((pHandflow->ControlHandShake & SERIAL_DTR_CONTROL) && + !(pHandflow->FlowReplace & SERIAL_RTS_CONTROL))) { - CommLog_Print(WLOG_WARN, "SERIAL_DTR_CONTROL:%s and SERIAL_RTS_CONTROL:%s cannot be different, HUPCL will be set since it is claimed for one of the both lines.", - (pHandflow->ControlHandShake & SERIAL_DTR_CONTROL) ? "ON" : "OFF", - (pHandflow->FlowReplace & SERIAL_RTS_CONTROL) ? "ON" : "OFF"); + CommLog_Print(WLOG_WARN, + "SERIAL_DTR_CONTROL:%s and SERIAL_RTS_CONTROL:%s cannot be different, HUPCL " + "will be set since it is claimed for one of the both lines.", + (pHandflow->ControlHandShake & SERIAL_DTR_CONTROL) ? "ON" : "OFF", + (pHandflow->FlowReplace & SERIAL_RTS_CONTROL) ? "ON" : "OFF"); } - if ((pHandflow->ControlHandShake & SERIAL_DTR_CONTROL) || (pHandflow->FlowReplace & SERIAL_RTS_CONTROL)) + if ((pHandflow->ControlHandShake & SERIAL_DTR_CONTROL) || + (pHandflow->FlowReplace & SERIAL_RTS_CONTROL)) { upcomingTermios.c_cflag |= HUPCL; } @@ -603,23 +611,29 @@ static BOOL _set_handflow(WINPR_COMM *pComm, const SERIAL_HANDFLOW *pHandflow) { upcomingTermios.c_cflag &= ~HUPCL; - /* FIXME: is the DTR line also needs to be forced to a disable state according SERIAL_DTR_CONTROL? */ - /* FIXME: is the RTS line also needs to be forced to a disable state according SERIAL_RTS_CONTROL? */ + /* FIXME: is the DTR line also needs to be forced to a disable state according + * SERIAL_DTR_CONTROL? */ + /* FIXME: is the RTS line also needs to be forced to a disable state according + * SERIAL_RTS_CONTROL? */ } - /* CRTSCTS */ /* logical XOR */ - if ((!(pHandflow->ControlHandShake & SERIAL_CTS_HANDSHAKE) && (pHandflow->FlowReplace & SERIAL_RTS_HANDSHAKE)) || - ((pHandflow->ControlHandShake & SERIAL_CTS_HANDSHAKE) && !(pHandflow->FlowReplace & SERIAL_RTS_HANDSHAKE))) + if ((!(pHandflow->ControlHandShake & SERIAL_CTS_HANDSHAKE) && + (pHandflow->FlowReplace & SERIAL_RTS_HANDSHAKE)) || + ((pHandflow->ControlHandShake & SERIAL_CTS_HANDSHAKE) && + !(pHandflow->FlowReplace & SERIAL_RTS_HANDSHAKE))) { - CommLog_Print(WLOG_WARN, "SERIAL_CTS_HANDSHAKE:%s and SERIAL_RTS_HANDSHAKE:%s cannot be different, CRTSCTS will be set since it is claimed for one of the both lines.", - (pHandflow->ControlHandShake & SERIAL_CTS_HANDSHAKE) ? "ON" : "OFF", - (pHandflow->FlowReplace & SERIAL_RTS_HANDSHAKE) ? "ON" : "OFF"); + CommLog_Print(WLOG_WARN, + "SERIAL_CTS_HANDSHAKE:%s and SERIAL_RTS_HANDSHAKE:%s cannot be different, " + "CRTSCTS will be set since it is claimed for one of the both lines.", + (pHandflow->ControlHandShake & SERIAL_CTS_HANDSHAKE) ? "ON" : "OFF", + (pHandflow->FlowReplace & SERIAL_RTS_HANDSHAKE) ? "ON" : "OFF"); } - if ((pHandflow->ControlHandShake & SERIAL_CTS_HANDSHAKE) || (pHandflow->FlowReplace & SERIAL_RTS_HANDSHAKE)) + if ((pHandflow->ControlHandShake & SERIAL_CTS_HANDSHAKE) || + (pHandflow->FlowReplace & SERIAL_RTS_HANDSHAKE)) { upcomingTermios.c_cflag |= CRTSCTS; } @@ -628,7 +642,6 @@ static BOOL _set_handflow(WINPR_COMM *pComm, const SERIAL_HANDFLOW *pHandflow) upcomingTermios.c_cflag &= ~CRTSCTS; } - /* ControlHandShake */ if (pHandflow->ControlHandShake & SERIAL_DTR_HANDSHAKE) @@ -639,7 +652,6 @@ static BOOL _set_handflow(WINPR_COMM *pComm, const SERIAL_HANDFLOW *pHandflow) result = FALSE; /* but keep on */ } - if (pHandflow->ControlHandShake & SERIAL_DSR_HANDSHAKE) { /* DTR/DSR flow control not supported on Linux */ @@ -736,7 +748,8 @@ static BOOL _set_handflow(WINPR_COMM *pComm, const SERIAL_HANDFLOW *pHandflow) // FIXME: could be implemented during read/write I/O if (pHandflow->XonLimit != TTY_THRESHOLD_UNTHROTTLE) { - CommLog_Print(WLOG_WARN, "Attempt to set XonLimit with an unsupported value: %"PRId32"", pHandflow->XonLimit); + CommLog_Print(WLOG_WARN, "Attempt to set XonLimit with an unsupported value: %" PRId32 "", + pHandflow->XonLimit); SetLastError(ERROR_NOT_SUPPORTED); result = FALSE; /* but keep on */ } @@ -746,23 +759,23 @@ static BOOL _set_handflow(WINPR_COMM *pComm, const SERIAL_HANDFLOW *pHandflow) // FIXME: could be implemented during read/write I/O if (pHandflow->XoffLimit != TTY_THRESHOLD_THROTTLE) { - CommLog_Print(WLOG_WARN, "Attempt to set XoffLimit with an unsupported value: %"PRId32"", pHandflow->XoffLimit); + CommLog_Print(WLOG_WARN, "Attempt to set XoffLimit with an unsupported value: %" PRId32 "", + pHandflow->XoffLimit); SetLastError(ERROR_NOT_SUPPORTED); result = FALSE; /* but keep on */ } - if (_comm_ioctl_tcsetattr(pComm->fd, TCSANOW, &upcomingTermios) < 0) { - CommLog_Print(WLOG_WARN, "_comm_ioctl_tcsetattr failure: last-error: 0x%"PRIX32"", GetLastError()); + CommLog_Print(WLOG_WARN, "_comm_ioctl_tcsetattr failure: last-error: 0x%" PRIX32 "", + GetLastError()); return FALSE; } return result; } - -static BOOL _get_handflow(WINPR_COMM *pComm, SERIAL_HANDFLOW *pHandflow) +static BOOL _get_handflow(WINPR_COMM* pComm, SERIAL_HANDFLOW* pHandflow) { struct termios currentTermios; @@ -773,7 +786,6 @@ static BOOL _get_handflow(WINPR_COMM *pComm, SERIAL_HANDFLOW *pHandflow) return FALSE; } - /* ControlHandShake */ pHandflow->ControlHandShake = 0; @@ -794,7 +806,6 @@ static BOOL _get_handflow(WINPR_COMM *pComm, SERIAL_HANDFLOW *pHandflow) /* SERIAL_ERROR_ABORT unsupported */ - /* FlowReplace */ pHandflow->FlowReplace = 0; @@ -821,12 +832,10 @@ static BOOL _get_handflow(WINPR_COMM *pComm, SERIAL_HANDFLOW *pHandflow) /* SERIAL_XOFF_CONTINUE unsupported */ - /* XonLimit */ pHandflow->XonLimit = TTY_THRESHOLD_UNTHROTTLE; - /* XoffLimit */ pHandflow->XoffLimit = TTY_THRESHOLD_THROTTLE; @@ -834,50 +843,58 @@ static BOOL _get_handflow(WINPR_COMM *pComm, SERIAL_HANDFLOW *pHandflow) return TRUE; } -static BOOL _set_timeouts(WINPR_COMM *pComm, const SERIAL_TIMEOUTS *pTimeouts) +static BOOL _set_timeouts(WINPR_COMM* pComm, const SERIAL_TIMEOUTS* pTimeouts) { /* NB: timeouts are applied on system during read/write I/O */ /* http://msdn.microsoft.com/en-us/library/windows/hardware/hh439614%28v=vs.85%29.aspx */ - if ((pTimeouts->ReadIntervalTimeout == MAXULONG) && (pTimeouts->ReadTotalTimeoutConstant == MAXULONG)) + if ((pTimeouts->ReadIntervalTimeout == MAXULONG) && + (pTimeouts->ReadTotalTimeoutConstant == MAXULONG)) { - CommLog_Print(WLOG_WARN, "ReadIntervalTimeout and ReadTotalTimeoutConstant cannot be both set to MAXULONG"); + CommLog_Print( + WLOG_WARN, + "ReadIntervalTimeout and ReadTotalTimeoutConstant cannot be both set to MAXULONG"); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - pComm->timeouts.ReadIntervalTimeout = pTimeouts->ReadIntervalTimeout; - pComm->timeouts.ReadTotalTimeoutMultiplier = pTimeouts->ReadTotalTimeoutMultiplier; - pComm->timeouts.ReadTotalTimeoutConstant = pTimeouts->ReadTotalTimeoutConstant; + pComm->timeouts.ReadIntervalTimeout = pTimeouts->ReadIntervalTimeout; + pComm->timeouts.ReadTotalTimeoutMultiplier = pTimeouts->ReadTotalTimeoutMultiplier; + pComm->timeouts.ReadTotalTimeoutConstant = pTimeouts->ReadTotalTimeoutConstant; pComm->timeouts.WriteTotalTimeoutMultiplier = pTimeouts->WriteTotalTimeoutMultiplier; - pComm->timeouts.WriteTotalTimeoutConstant = pTimeouts->WriteTotalTimeoutConstant; + pComm->timeouts.WriteTotalTimeoutConstant = pTimeouts->WriteTotalTimeoutConstant; - CommLog_Print(WLOG_DEBUG, "ReadIntervalTimeout %"PRIu32"", pComm->timeouts.ReadIntervalTimeout); - CommLog_Print(WLOG_DEBUG, "ReadTotalTimeoutMultiplier %"PRIu32"", pComm->timeouts.ReadTotalTimeoutMultiplier); - CommLog_Print(WLOG_DEBUG, "ReadTotalTimeoutConstant %"PRIu32"", pComm->timeouts.ReadTotalTimeoutConstant); - CommLog_Print(WLOG_DEBUG, "WriteTotalTimeoutMultiplier %"PRIu32"", pComm->timeouts.WriteTotalTimeoutMultiplier); - CommLog_Print(WLOG_DEBUG, "WriteTotalTimeoutConstant %"PRIu32"", pComm->timeouts.WriteTotalTimeoutConstant); + CommLog_Print(WLOG_DEBUG, "ReadIntervalTimeout %" PRIu32 "", + pComm->timeouts.ReadIntervalTimeout); + CommLog_Print(WLOG_DEBUG, "ReadTotalTimeoutMultiplier %" PRIu32 "", + pComm->timeouts.ReadTotalTimeoutMultiplier); + CommLog_Print(WLOG_DEBUG, "ReadTotalTimeoutConstant %" PRIu32 "", + pComm->timeouts.ReadTotalTimeoutConstant); + CommLog_Print(WLOG_DEBUG, "WriteTotalTimeoutMultiplier %" PRIu32 "", + pComm->timeouts.WriteTotalTimeoutMultiplier); + CommLog_Print(WLOG_DEBUG, "WriteTotalTimeoutConstant %" PRIu32 "", + pComm->timeouts.WriteTotalTimeoutConstant); return TRUE; } -static BOOL _get_timeouts(WINPR_COMM *pComm, SERIAL_TIMEOUTS *pTimeouts) +static BOOL _get_timeouts(WINPR_COMM* pComm, SERIAL_TIMEOUTS* pTimeouts) { - pTimeouts->ReadIntervalTimeout = pComm->timeouts.ReadIntervalTimeout; - pTimeouts->ReadTotalTimeoutMultiplier = pComm->timeouts.ReadTotalTimeoutMultiplier; - pTimeouts->ReadTotalTimeoutConstant = pComm->timeouts.ReadTotalTimeoutConstant; + pTimeouts->ReadIntervalTimeout = pComm->timeouts.ReadIntervalTimeout; + pTimeouts->ReadTotalTimeoutMultiplier = pComm->timeouts.ReadTotalTimeoutMultiplier; + pTimeouts->ReadTotalTimeoutConstant = pComm->timeouts.ReadTotalTimeoutConstant; pTimeouts->WriteTotalTimeoutMultiplier = pComm->timeouts.WriteTotalTimeoutMultiplier; - pTimeouts->WriteTotalTimeoutConstant = pComm->timeouts.WriteTotalTimeoutConstant; + pTimeouts->WriteTotalTimeoutConstant = pComm->timeouts.WriteTotalTimeoutConstant; return TRUE; } - -static BOOL _set_lines(WINPR_COMM *pComm, UINT32 lines) +static BOOL _set_lines(WINPR_COMM* pComm, UINT32 lines) { if (ioctl(pComm->fd, TIOCMBIS, &lines) < 0) { - CommLog_Print(WLOG_WARN, "TIOCMBIS ioctl failed, lines=0x%"PRIX32", errno=[%d] %s", lines, errno, strerror(errno)); + CommLog_Print(WLOG_WARN, "TIOCMBIS ioctl failed, lines=0x%" PRIX32 ", errno=[%d] %s", lines, + errno, strerror(errno)); SetLastError(ERROR_IO_DEVICE); return FALSE; } @@ -885,12 +902,12 @@ static BOOL _set_lines(WINPR_COMM *pComm, UINT32 lines) return TRUE; } - -static BOOL _clear_lines(WINPR_COMM *pComm, UINT32 lines) +static BOOL _clear_lines(WINPR_COMM* pComm, UINT32 lines) { if (ioctl(pComm->fd, TIOCMBIC, &lines) < 0) { - CommLog_Print(WLOG_WARN, "TIOCMBIC ioctl failed, lines=0x%"PRIX32", errno=[%d] %s", lines, errno, strerror(errno)); + CommLog_Print(WLOG_WARN, "TIOCMBIC ioctl failed, lines=0x%" PRIX32 ", errno=[%d] %s", lines, + errno, strerror(errno)); SetLastError(ERROR_IO_DEVICE); return FALSE; } @@ -898,8 +915,7 @@ static BOOL _clear_lines(WINPR_COMM *pComm, UINT32 lines) return TRUE; } - -static BOOL _set_dtr(WINPR_COMM *pComm) +static BOOL _set_dtr(WINPR_COMM* pComm) { SERIAL_HANDFLOW handflow; if (!_get_handflow(pComm, &handflow)) @@ -917,7 +933,7 @@ static BOOL _set_dtr(WINPR_COMM *pComm) return _set_lines(pComm, TIOCM_DTR); } -static BOOL _clear_dtr(WINPR_COMM *pComm) +static BOOL _clear_dtr(WINPR_COMM* pComm) { SERIAL_HANDFLOW handflow; if (!_get_handflow(pComm, &handflow)) @@ -935,7 +951,7 @@ static BOOL _clear_dtr(WINPR_COMM *pComm) return _clear_lines(pComm, TIOCM_DTR); } -static BOOL _set_rts(WINPR_COMM *pComm) +static BOOL _set_rts(WINPR_COMM* pComm) { SERIAL_HANDFLOW handflow; if (!_get_handflow(pComm, &handflow)) @@ -950,7 +966,7 @@ static BOOL _set_rts(WINPR_COMM *pComm) return _set_lines(pComm, TIOCM_RTS); } -static BOOL _clear_rts(WINPR_COMM *pComm) +static BOOL _clear_rts(WINPR_COMM* pComm) { SERIAL_HANDFLOW handflow; if (!_get_handflow(pComm, &handflow)) @@ -965,11 +981,9 @@ static BOOL _clear_rts(WINPR_COMM *pComm) return _clear_lines(pComm, TIOCM_RTS); } - - -static BOOL _get_modemstatus(WINPR_COMM *pComm, ULONG *pRegister) +static BOOL _get_modemstatus(WINPR_COMM* pComm, ULONG* pRegister) { - UINT32 lines=0; + UINT32 lines = 0; if (ioctl(pComm->fd, TIOCMGET, &lines) < 0) { CommLog_Print(WLOG_WARN, "TIOCMGET ioctl failed, errno=[%d] %s", errno, strerror(errno)); @@ -1005,26 +1019,18 @@ static BOOL _get_modemstatus(WINPR_COMM *pComm, ULONG *pRegister) /* http://msdn.microsoft.com/en-us/library/windows/hardware/hh439605%28v=vs.85%29.aspx */ static const ULONG _SERIAL_SYS_SUPPORTED_EV_MASK = - SERIAL_EV_RXCHAR | - SERIAL_EV_RXFLAG | - SERIAL_EV_TXEMPTY | - SERIAL_EV_CTS | - SERIAL_EV_DSR | - SERIAL_EV_RLSD | - SERIAL_EV_BREAK | - SERIAL_EV_ERR | - SERIAL_EV_RING | - /* SERIAL_EV_PERR | */ - SERIAL_EV_RX80FULL /*| - SERIAL_EV_EVENT1 | - SERIAL_EV_EVENT2*/; + SERIAL_EV_RXCHAR | SERIAL_EV_RXFLAG | SERIAL_EV_TXEMPTY | SERIAL_EV_CTS | SERIAL_EV_DSR | + SERIAL_EV_RLSD | SERIAL_EV_BREAK | SERIAL_EV_ERR | SERIAL_EV_RING | + /* SERIAL_EV_PERR | */ + SERIAL_EV_RX80FULL /*| + SERIAL_EV_EVENT1 | + SERIAL_EV_EVENT2*/ + ; - -static BOOL _set_wait_mask(WINPR_COMM *pComm, const ULONG *pWaitMask) +static BOOL _set_wait_mask(WINPR_COMM* pComm, const ULONG* pWaitMask) { ULONG possibleMask; - /* Stops pending IOCTL_SERIAL_WAIT_ON_MASK * http://msdn.microsoft.com/en-us/library/ff546805%28v=vs.85%29.aspx */ @@ -1051,8 +1057,9 @@ static BOOL _set_wait_mask(WINPR_COMM *pComm, const ULONG *pWaitMask) if (ioctl(pComm->fd, TIOCGICOUNT, &(pComm->counters)) < 0) { - CommLog_Print(WLOG_WARN, "TIOCGICOUNT ioctl failed, errno=[%d] %s.", errno, strerror(errno)); - + CommLog_Print(WLOG_WARN, "TIOCGICOUNT ioctl failed, errno=[%d] %s.", errno, + strerror(errno)); + if (pComm->permissive) { /* counters could not be reset but keep on */ @@ -1073,8 +1080,10 @@ static BOOL _set_wait_mask(WINPR_COMM *pComm, const ULONG *pWaitMask) if (possibleMask != *pWaitMask) { - CommLog_Print(WLOG_WARN, "Not all wait events supported (Serial.sys), requested events= 0x%08"PRIX32", possible events= 0x%08"PRIX32"", - *pWaitMask, possibleMask); + CommLog_Print(WLOG_WARN, + "Not all wait events supported (Serial.sys), requested events= 0x%08" PRIX32 + ", possible events= 0x%08" PRIX32 "", + *pWaitMask, possibleMask); /* FIXME: shall we really set the possibleMask and return FALSE? */ pComm->WaitEventMask = possibleMask; @@ -1089,16 +1098,13 @@ static BOOL _set_wait_mask(WINPR_COMM *pComm, const ULONG *pWaitMask) return TRUE; } - -static BOOL _get_wait_mask(WINPR_COMM *pComm, ULONG *pWaitMask) +static BOOL _get_wait_mask(WINPR_COMM* pComm, ULONG* pWaitMask) { *pWaitMask = pComm->WaitEventMask; return TRUE; } - - -static BOOL _set_queue_size(WINPR_COMM *pComm, const SERIAL_QUEUE_SIZE *pQueueSize) +static BOOL _set_queue_size(WINPR_COMM* pComm, const SERIAL_QUEUE_SIZE* pQueueSize) { if ((pQueueSize->InSize <= N_TTY_BUF_SIZE) && (pQueueSize->OutSize <= N_TTY_BUF_SIZE)) return TRUE; /* nothing to do */ @@ -1106,21 +1112,27 @@ static BOOL _set_queue_size(WINPR_COMM *pComm, const SERIAL_QUEUE_SIZE *pQueueSi /* FIXME: could be implemented on top of N_TTY */ if (pQueueSize->InSize > N_TTY_BUF_SIZE) - CommLog_Print(WLOG_WARN, "Requested an incompatible input buffer size: %"PRIu32", keeping on with a %"PRIu32" bytes buffer.", pQueueSize->InSize, N_TTY_BUF_SIZE); + CommLog_Print(WLOG_WARN, + "Requested an incompatible input buffer size: %" PRIu32 + ", keeping on with a %" PRIu32 " bytes buffer.", + pQueueSize->InSize, N_TTY_BUF_SIZE); if (pQueueSize->OutSize > N_TTY_BUF_SIZE) - CommLog_Print(WLOG_WARN, "Requested an incompatible output buffer size: %"PRIu32", keeping on with a %"PRIu32" bytes buffer.", pQueueSize->OutSize, N_TTY_BUF_SIZE); + CommLog_Print(WLOG_WARN, + "Requested an incompatible output buffer size: %" PRIu32 + ", keeping on with a %" PRIu32 " bytes buffer.", + pQueueSize->OutSize, N_TTY_BUF_SIZE); SetLastError(ERROR_CANCELLED); return FALSE; } - -static BOOL _purge(WINPR_COMM *pComm, const ULONG *pPurgeMask) +static BOOL _purge(WINPR_COMM* pComm, const ULONG* pPurgeMask) { - if ((*pPurgeMask & ~(SERIAL_PURGE_TXABORT | SERIAL_PURGE_RXABORT | SERIAL_PURGE_TXCLEAR | SERIAL_PURGE_RXCLEAR)) > 0) + if ((*pPurgeMask & ~(SERIAL_PURGE_TXABORT | SERIAL_PURGE_RXABORT | SERIAL_PURGE_TXCLEAR | + SERIAL_PURGE_RXCLEAR)) > 0) { - CommLog_Print(WLOG_WARN, "Invalid purge mask: 0x%"PRIX32"\n", *pPurgeMask); + CommLog_Print(WLOG_WARN, "Invalid purge mask: 0x%" PRIX32 "\n", *pPurgeMask); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } @@ -1138,7 +1150,8 @@ static BOOL _purge(WINPR_COMM *pComm, const ULONG *pPurgeMask) { if (errno != EAGAIN) { - CommLog_Print(WLOG_WARN, "eventfd_write failed, errno=[%d] %s", errno, strerror(errno)); + CommLog_Print(WLOG_WARN, "eventfd_write failed, errno=[%d] %s", errno, + strerror(errno)); } assert(errno == EAGAIN); /* no reader <=> no pending IRP_MJ_WRITE */ @@ -1153,7 +1166,8 @@ static BOOL _purge(WINPR_COMM *pComm, const ULONG *pPurgeMask) { if (errno != EAGAIN) { - CommLog_Print(WLOG_WARN, "eventfd_write failed, errno=[%d] %s", errno, strerror(errno)); + CommLog_Print(WLOG_WARN, "eventfd_write failed, errno=[%d] %s", errno, + strerror(errno)); } assert(errno == EAGAIN); /* no reader <=> no pending IRP_MJ_READ */ @@ -1166,20 +1180,21 @@ static BOOL _purge(WINPR_COMM *pComm, const ULONG *pPurgeMask) if (tcflush(pComm->fd, TCOFLUSH) < 0) { - CommLog_Print(WLOG_WARN, "tcflush(TCOFLUSH) failure, errno=[%d] %s", errno, strerror(errno)); + CommLog_Print(WLOG_WARN, "tcflush(TCOFLUSH) failure, errno=[%d] %s", errno, + strerror(errno)); SetLastError(ERROR_CANCELLED); return FALSE; } } - if (*pPurgeMask & SERIAL_PURGE_RXCLEAR) { /* Purges the receive buffer, if one exists. */ if (tcflush(pComm->fd, TCIFLUSH) < 0) { - CommLog_Print(WLOG_WARN, "tcflush(TCIFLUSH) failure, errno=[%d] %s", errno, strerror(errno)); + CommLog_Print(WLOG_WARN, "tcflush(TCIFLUSH) failure, errno=[%d] %s", errno, + strerror(errno)); SetLastError(ERROR_CANCELLED); return FALSE; } @@ -1192,7 +1207,7 @@ static BOOL _purge(WINPR_COMM *pComm, const ULONG *pPurgeMask) * - SERIAL_EV_RXFLAG: FIXME: once EventChar supported * */ -static BOOL _get_commstatus(WINPR_COMM *pComm, SERIAL_STATUS *pCommstatus) +static BOOL _get_commstatus(WINPR_COMM* pComm, SERIAL_STATUS* pCommstatus) { /* http://msdn.microsoft.com/en-us/library/jj673022%28v=vs.85%29.aspx */ @@ -1206,9 +1221,10 @@ static BOOL _get_commstatus(WINPR_COMM *pComm, SERIAL_STATUS *pCommstatus) ZeroMemory(¤tCounters, sizeof(struct serial_icounter_struct)); if (ioctl(pComm->fd, TIOCGICOUNT, ¤tCounters) < 0) { - CommLog_Print(WLOG_WARN, "TIOCGICOUNT ioctl failed, errno=[%d] %s.", errno, strerror(errno)); + CommLog_Print(WLOG_WARN, "TIOCGICOUNT ioctl failed, errno=[%d] %s.", errno, + strerror(errno)); CommLog_Print(WLOG_WARN, " could not read counters."); - + if (pComm->permissive) { /* Errors and events based on counters could not be @@ -1224,7 +1240,8 @@ static BOOL _get_commstatus(WINPR_COMM *pComm, SERIAL_STATUS *pCommstatus) } } - /* NB: preferred below (currentCounters.* != pComm->counters.*) over (currentCounters.* > pComm->counters.*) thinking the counters can loop */ + /* NB: preferred below (currentCounters.* != pComm->counters.*) over (currentCounters.* > + * pComm->counters.*) thinking the counters can loop */ /* Errors */ @@ -1257,10 +1274,8 @@ static BOOL _get_commstatus(WINPR_COMM *pComm, SERIAL_STATUS *pCommstatus) pComm->PendingEvents |= SERIAL_EV_ERR; } - /* HoldReasons */ - /* TODO: SERIAL_TX_WAITING_FOR_CTS */ /* TODO: SERIAL_TX_WAITING_FOR_DSR */ @@ -1273,8 +1288,6 @@ static BOOL _get_commstatus(WINPR_COMM *pComm, SERIAL_STATUS *pCommstatus) /* TODO: SERIAL_TX_WAITING_XOFF_SENT */ - - /* AmountInInQueue */ if (ioctl(pComm->fd, TIOCINQ, &(pCommstatus->AmountInInQueue)) < 0) @@ -1286,7 +1299,6 @@ static BOOL _get_commstatus(WINPR_COMM *pComm, SERIAL_STATUS *pCommstatus) return FALSE; } - /* AmountInOutQueue */ if (ioctl(pComm->fd, TIOCOUTQ, &(pCommstatus->AmountInOutQueue)) < 0) @@ -1300,10 +1312,8 @@ static BOOL _get_commstatus(WINPR_COMM *pComm, SERIAL_STATUS *pCommstatus) /* BOOLEAN EofReceived; FIXME: once EofChar supported */ - /* BOOLEAN WaitForImmediate; TODO: once IOCTL_SERIAL_IMMEDIATE_CHAR fully supported */ - /* other events based on counters */ if (currentCounters.rx != pComm->counters.rx) @@ -1312,13 +1322,14 @@ static BOOL _get_commstatus(WINPR_COMM *pComm, SERIAL_STATUS *pCommstatus) } if ((currentCounters.tx != pComm->counters.tx) && /* at least a transmission occurred AND ...*/ - (pCommstatus->AmountInOutQueue == 0)) /* output bufer is now empty */ + (pCommstatus->AmountInOutQueue == 0)) /* output bufer is now empty */ { pComm->PendingEvents |= SERIAL_EV_TXEMPTY; } else { - /* FIXME: "now empty" from the specs is ambiguous, need to track previous completed transmission? */ + /* FIXME: "now empty" from the specs is ambiguous, need to track previous completed + * transmission? */ pComm->PendingEvents &= ~SERIAL_EV_TXEMPTY; } @@ -1348,18 +1359,18 @@ static BOOL _get_commstatus(WINPR_COMM *pComm, SERIAL_STATUS *pCommstatus) } else { - /* FIXME: "is 80 percent full" from the specs is ambiguous, need to track when it previously * occurred? */ + /* FIXME: "is 80 percent full" from the specs is ambiguous, need to track when it previously + * * occurred? */ pComm->PendingEvents &= ~SERIAL_EV_RX80FULL; } - pComm->counters = currentCounters; LeaveCriticalSection(&pComm->EventsLock); return TRUE; } -static BOOL _refresh_PendingEvents(WINPR_COMM *pComm) +static BOOL _refresh_PendingEvents(WINPR_COMM* pComm) { SERIAL_STATUS serialStatus; @@ -1373,8 +1384,7 @@ static BOOL _refresh_PendingEvents(WINPR_COMM *pComm) return TRUE; } - -static void _consume_event(WINPR_COMM *pComm, ULONG *pOutputMask, ULONG event) +static void _consume_event(WINPR_COMM* pComm, ULONG* pOutputMask, ULONG event) { if ((pComm->WaitEventMask & event) && (pComm->PendingEvents & event)) { @@ -1386,7 +1396,7 @@ static void _consume_event(WINPR_COMM *pComm, ULONG *pOutputMask, ULONG event) /* * NB: see also: _set_wait_mask() */ -static BOOL _wait_on_mask(WINPR_COMM *pComm, ULONG *pOutputMask) +static BOOL _wait_on_mask(WINPR_COMM* pComm, ULONG* pOutputMask) { assert(*pOutputMask == 0); @@ -1394,7 +1404,6 @@ static BOOL _wait_on_mask(WINPR_COMM *pComm, ULONG *pOutputMask) pComm->PendingEvents |= SERIAL_EV_FREERDP_WAITING; LeaveCriticalSection(&pComm->EventsLock); - while (TRUE) { /* NB: EventsLock also used by _refresh_PendingEvents() */ @@ -1433,7 +1442,7 @@ static BOOL _wait_on_mask(WINPR_COMM *pComm, ULONG *pOutputMask) _consume_event(pComm, pOutputMask, SERIAL_EV_RLSD); _consume_event(pComm, pOutputMask, SERIAL_EV_BREAK); _consume_event(pComm, pOutputMask, SERIAL_EV_ERR); - _consume_event(pComm, pOutputMask, SERIAL_EV_RING ); + _consume_event(pComm, pOutputMask, SERIAL_EV_RING); _consume_event(pComm, pOutputMask, SERIAL_EV_RX80FULL); LeaveCriticalSection(&pComm->EventsLock); @@ -1451,7 +1460,6 @@ static BOOL _wait_on_mask(WINPR_COMM *pComm, ULONG *pOutputMask) return TRUE; } - /* waiting for a modification of PendingEvents. * * NOTE: previously used a semaphore but used @@ -1464,7 +1472,7 @@ static BOOL _wait_on_mask(WINPR_COMM *pComm, ULONG *pOutputMask) } } -static BOOL _set_break_on(WINPR_COMM *pComm) +static BOOL _set_break_on(WINPR_COMM* pComm) { if (ioctl(pComm->fd, TIOCSBRK, NULL) < 0) { @@ -1476,8 +1484,7 @@ static BOOL _set_break_on(WINPR_COMM *pComm) return TRUE; } - -static BOOL _set_break_off(WINPR_COMM *pComm) +static BOOL _set_break_off(WINPR_COMM* pComm) { if (ioctl(pComm->fd, TIOCCBRK, NULL) < 0) { @@ -1489,8 +1496,7 @@ static BOOL _set_break_off(WINPR_COMM *pComm) return TRUE; } - -static BOOL _set_xoff(WINPR_COMM *pComm) +static BOOL _set_xoff(WINPR_COMM* pComm) { if (tcflow(pComm->fd, TCIOFF) < 0) { @@ -1502,8 +1508,7 @@ static BOOL _set_xoff(WINPR_COMM *pComm) return TRUE; } - -static BOOL _set_xon(WINPR_COMM *pComm) +static BOOL _set_xon(WINPR_COMM* pComm) { if (tcflow(pComm->fd, TCION) < 0) { @@ -1515,10 +1520,9 @@ static BOOL _set_xon(WINPR_COMM *pComm) return TRUE; } - -BOOL _get_dtrrts(WINPR_COMM *pComm, ULONG *pMask) +BOOL _get_dtrrts(WINPR_COMM* pComm, ULONG* pMask) { - UINT32 lines=0; + UINT32 lines = 0; if (ioctl(pComm->fd, TIOCMGET, &lines) < 0) { CommLog_Print(WLOG_WARN, "TIOCMGET ioctl failed, errno=[%d] %s", errno, strerror(errno)); @@ -1536,8 +1540,7 @@ BOOL _get_dtrrts(WINPR_COMM *pComm, ULONG *pMask) return TRUE; } - -BOOL _config_size(WINPR_COMM *pComm, ULONG *pSize) +BOOL _config_size(WINPR_COMM* pComm, ULONG* pSize) { /* http://msdn.microsoft.com/en-us/library/ff546548%28v=vs.85%29.aspx */ if (!pSize) @@ -1547,8 +1550,7 @@ BOOL _config_size(WINPR_COMM *pComm, ULONG *pSize) return TRUE; } - -BOOL _immediate_char(WINPR_COMM *pComm, const UCHAR *pChar) +BOOL _immediate_char(WINPR_COMM* pComm, const UCHAR* pChar) { BOOL result; DWORD nbBytesWritten = -1; @@ -1566,50 +1568,47 @@ BOOL _immediate_char(WINPR_COMM *pComm, const UCHAR *pChar) return result; } - -BOOL _reset_device(WINPR_COMM *pComm) +BOOL _reset_device(WINPR_COMM* pComm) { /* http://msdn.microsoft.com/en-us/library/dn265347%28v=vs.85%29.aspx */ return TRUE; } -static SERIAL_DRIVER _SerialSys = -{ - .id = SerialDriverSerialSys, - .name = _T("Serial.sys"), - .set_baud_rate = _set_baud_rate, - .get_baud_rate = _get_baud_rate, - .get_properties = _get_properties, +static SERIAL_DRIVER _SerialSys = { + .id = SerialDriverSerialSys, + .name = _T("Serial.sys"), + .set_baud_rate = _set_baud_rate, + .get_baud_rate = _get_baud_rate, + .get_properties = _get_properties, .set_serial_chars = _set_serial_chars, .get_serial_chars = _get_serial_chars, .set_line_control = _set_line_control, .get_line_control = _get_line_control, - .set_handflow = _set_handflow, - .get_handflow = _get_handflow, - .set_timeouts = _set_timeouts, - .get_timeouts = _get_timeouts, - .set_dtr = _set_dtr, - .clear_dtr = _clear_dtr, - .set_rts = _set_rts, - .clear_rts = _clear_rts, - .get_modemstatus = _get_modemstatus, - .set_wait_mask = _set_wait_mask, - .get_wait_mask = _get_wait_mask, - .wait_on_mask = _wait_on_mask, - .set_queue_size = _set_queue_size, - .purge = _purge, - .get_commstatus = _get_commstatus, - .set_break_on = _set_break_on, - .set_break_off = _set_break_off, - .set_xoff = _set_xoff, - .set_xon = _set_xon, - .get_dtrrts = _get_dtrrts, - .config_size = _config_size, - .immediate_char = _immediate_char, - .reset_device = _reset_device, + .set_handflow = _set_handflow, + .get_handflow = _get_handflow, + .set_timeouts = _set_timeouts, + .get_timeouts = _get_timeouts, + .set_dtr = _set_dtr, + .clear_dtr = _clear_dtr, + .set_rts = _set_rts, + .clear_rts = _clear_rts, + .get_modemstatus = _get_modemstatus, + .set_wait_mask = _set_wait_mask, + .get_wait_mask = _get_wait_mask, + .wait_on_mask = _wait_on_mask, + .set_queue_size = _set_queue_size, + .purge = _purge, + .get_commstatus = _get_commstatus, + .set_break_on = _set_break_on, + .set_break_off = _set_break_off, + .set_xoff = _set_xoff, + .set_xon = _set_xon, + .get_dtrrts = _get_dtrrts, + .config_size = _config_size, + .immediate_char = _immediate_char, + .reset_device = _reset_device, }; - SERIAL_DRIVER* SerialSys_s() { return &_SerialSys; diff --git a/winpr/libwinpr/comm/comm_serial_sys.h b/winpr/libwinpr/comm/comm_serial_sys.h index bef1fbfe9..2ce0d71c1 100644 --- a/winpr/libwinpr/comm/comm_serial_sys.h +++ b/winpr/libwinpr/comm/comm_serial_sys.h @@ -25,16 +25,16 @@ #include "comm_ioctl.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -SERIAL_DRIVER* SerialSys_s(); + SERIAL_DRIVER* SerialSys_s(); #ifdef __cplusplus } #endif - #endif /* __linux__ */ #endif /* COMM_SERIAL_SYS_H */ diff --git a/winpr/libwinpr/comm/test/TestCommConfig.c b/winpr/libwinpr/comm/test/TestCommConfig.c index a76feb111..0d89149d8 100644 --- a/winpr/libwinpr/comm/test/TestCommConfig.c +++ b/winpr/libwinpr/comm/test/TestCommConfig.c @@ -35,13 +35,13 @@ int TestCommConfig(int argc, char* argv[]) COMMPROP commProp; struct stat statbuf; - hComm = CreateFileA(lpFileName, - GENERIC_READ | GENERIC_WRITE, - 0, NULL, OPEN_EXISTING, 0, NULL); + hComm = CreateFileA(lpFileName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (hComm && (hComm != INVALID_HANDLE_VALUE)) { - fprintf(stderr, "CreateFileA failure: could create a handle on a not yet defined device: %s\n", lpFileName); + fprintf(stderr, + "CreateFileA failure: could create a handle on a not yet defined device: %s\n", + lpFileName); return EXIT_FAILURE; } @@ -52,33 +52,30 @@ int TestCommConfig(int argc, char* argv[]) } success = DefineCommDevice(lpFileName, "/dev/ttyS0"); - if(!success) + if (!success) { fprintf(stderr, "DefineCommDevice failure: %s\n", lpFileName); return EXIT_FAILURE; } - hComm = CreateFileA(lpFileName, - GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_WRITE, /* invalid parmaeter */ - NULL, - CREATE_NEW, /* invalid parameter */ - 0, - (HANDLE)1234); /* invalid parmaeter */ + hComm = CreateFileA(lpFileName, GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_WRITE, /* invalid parmaeter */ + NULL, CREATE_NEW, /* invalid parameter */ + 0, (HANDLE)1234); /* invalid parmaeter */ if (hComm != INVALID_HANDLE_VALUE) { - fprintf(stderr, "CreateFileA failure: could create a handle with some invalid parameters %s\n", lpFileName); + fprintf(stderr, + "CreateFileA failure: could create a handle with some invalid parameters %s\n", + lpFileName); return EXIT_FAILURE; } - - hComm = CreateFileA(lpFileName, - GENERIC_READ | GENERIC_WRITE, - 0, NULL, OPEN_EXISTING, 0, NULL); + hComm = CreateFileA(lpFileName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (!hComm || (hComm == INVALID_HANDLE_VALUE)) { - fprintf(stderr, "CreateFileA failure: %s GetLastError() = 0x%08x\n", lpFileName, GetLastError()); + fprintf(stderr, "CreateFileA failure: %s GetLastError() = 0x%08x\n", lpFileName, + GetLastError()); return EXIT_FAILURE; } @@ -94,8 +91,9 @@ int TestCommConfig(int argc, char* argv[]) return EXIT_FAILURE; } - fprintf(stderr, "BaudRate: %"PRIu32" ByteSize: %"PRIu8" Parity: %"PRIu8" StopBits: %"PRIu8"\n", - dcb.BaudRate, dcb.ByteSize, dcb.Parity, dcb.StopBits); + fprintf(stderr, + "BaudRate: %" PRIu32 " ByteSize: %" PRIu8 " Parity: %" PRIu8 " StopBits: %" PRIu8 "\n", + dcb.BaudRate, dcb.ByteSize, dcb.Parity, dcb.StopBits); ZeroMemory(&commProp, sizeof(COMMPROP)); if (!GetCommProperties(hComm, &commProp)) @@ -137,10 +135,13 @@ int TestCommConfig(int argc, char* argv[]) return 0; } - if ((dcb.BaudRate != CBR_57600) || (dcb.ByteSize != 8) || (dcb.Parity != NOPARITY) || (dcb.StopBits != ONESTOPBIT)) + if ((dcb.BaudRate != CBR_57600) || (dcb.ByteSize != 8) || (dcb.Parity != NOPARITY) || + (dcb.StopBits != ONESTOPBIT)) { - fprintf(stderr, "Got an unexpeted value among: BaudRate: %"PRIu32" ByteSize: %"PRIu8" Parity: %"PRIu8" StopBits: %"PRIu8"\n", - dcb.BaudRate, dcb.ByteSize, dcb.Parity, dcb.StopBits); + fprintf(stderr, + "Got an unexpeted value among: BaudRate: %" PRIu32 " ByteSize: %" PRIu8 + " Parity: %" PRIu8 " StopBits: %" PRIu8 "\n", + dcb.BaudRate, dcb.ByteSize, dcb.Parity, dcb.StopBits); } CloseHandle(hComm); diff --git a/winpr/libwinpr/comm/test/TestCommDevice.c b/winpr/libwinpr/comm/test/TestCommDevice.c index 9e9d747d6..09eb1c2e4 100644 --- a/winpr/libwinpr/comm/test/TestCommDevice.c +++ b/winpr/libwinpr/comm/test/TestCommDevice.c @@ -32,9 +32,7 @@ static int test_CommDevice(LPCTSTR lpDeviceName, BOOL expectedResult) if ((!expectedResult && result) || (expectedResult && !result)) /* logical XOR */ { _tprintf(_T("DefineCommDevice failure: device name: %s, expected result: %s, result: %s\n"), - lpDeviceName, - (expectedResult ? "TRUE" : "FALSE"), - (result ? "TRUE" : "FALSE")); + lpDeviceName, (expectedResult ? "TRUE" : "FALSE"), (result ? "TRUE" : "FALSE")); return FALSE; } @@ -43,33 +41,35 @@ static int test_CommDevice(LPCTSTR lpDeviceName, BOOL expectedResult) if ((!expectedResult && result) || (expectedResult && !result)) /* logical XOR */ { _tprintf(_T("IsCommDevice failure: device name: %s, expected result: %s, result: %s\n"), - lpDeviceName, - (expectedResult ? "TRUE" : "FALSE"), - (result ? "TRUE" : "FALSE")); + lpDeviceName, (expectedResult ? "TRUE" : "FALSE"), (result ? "TRUE" : "FALSE")); return FALSE; } - tcslen = (size_t) QueryCommDevice(lpDeviceName, lpTargetPath, MAX_PATH); + tcslen = (size_t)QueryCommDevice(lpDeviceName, lpTargetPath, MAX_PATH); if (expectedResult) { if (tcslen <= _tcslen(lpTargetPath)) /* at least 2 more TCHAR are expected */ { - _tprintf(_T("QueryCommDevice failure: didn't find the device name: %s\n"), lpDeviceName); + _tprintf(_T("QueryCommDevice failure: didn't find the device name: %s\n"), + lpDeviceName); return FALSE; } if (_tcscmp(_T("/dev/test"), lpTargetPath) != 0) { - _tprintf(_T("QueryCommDevice failure: device name: %s, expected result: %s, result: %s\n"), - lpDeviceName, _T("/dev/test"), lpTargetPath); + _tprintf( + _T("QueryCommDevice failure: device name: %s, expected result: %s, result: %s\n"), + lpDeviceName, _T("/dev/test"), lpTargetPath); return FALSE; } if (lpTargetPath[_tcslen(lpTargetPath) + 1] != 0) { - _tprintf(_T("QueryCommDevice failure: device name: %s, the second NULL character is missing at the end of the buffer\n"), lpDeviceName); + _tprintf(_T("QueryCommDevice failure: device name: %s, the second NULL character is ") + _T("missing at the end of the buffer\n"), + lpDeviceName); return FALSE; } } @@ -77,8 +77,9 @@ static int test_CommDevice(LPCTSTR lpDeviceName, BOOL expectedResult) { if (tcslen > 0) { - _tprintf(_T("QueryCommDevice failure: device name: %s, expected result: , result: %")_T(PRIuz)_T(" %s\n"), - lpDeviceName, tcslen, lpTargetPath); + _tprintf(_T("QueryCommDevice failure: device name: %s, expected result: , ") + _T("result: %") _T(PRIuz) _T(" %s\n"), + lpDeviceName, tcslen, lpTargetPath); return FALSE; } @@ -87,7 +88,6 @@ static int test_CommDevice(LPCTSTR lpDeviceName, BOOL expectedResult) return TRUE; } - int TestCommDevice(int argc, char* argv[]) { if (!test_CommDevice(_T("COM0"), FALSE)) diff --git a/winpr/libwinpr/comm/test/TestCommMonitor.c b/winpr/libwinpr/comm/test/TestCommMonitor.c index 69aa6d131..aa295bbfe 100644 --- a/winpr/libwinpr/comm/test/TestCommMonitor.c +++ b/winpr/libwinpr/comm/test/TestCommMonitor.c @@ -14,9 +14,8 @@ int TestCommMonitor(int argc, char* argv[]) OVERLAPPED overlapped; LPCSTR lpFileName = "\\\\.\\COM1"; - hComm = CreateFileA(lpFileName, - GENERIC_READ | GENERIC_WRITE, - 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); + hComm = CreateFileA(lpFileName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, + FILE_FLAG_OVERLAPPED, NULL); if (!hComm || (hComm == INVALID_HANDLE_VALUE)) { @@ -28,14 +27,14 @@ int TestCommMonitor(int argc, char* argv[]) if (!fSuccess) { - printf("SetCommMask failure: GetLastError() = %"PRIu32"\n", GetLastError()); + printf("SetCommMask failure: GetLastError() = %" PRIu32 "\n", GetLastError()); return -1; } ZeroMemory(&overlapped, sizeof(OVERLAPPED)); if (!(overlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL))) { - printf("CreateEvent failed: GetLastError() = %"PRIu32"\n", GetLastError()); + printf("CreateEvent failed: GetLastError() = %" PRIu32 "\n", GetLastError()); return -1; } @@ -61,7 +60,7 @@ int TestCommMonitor(int argc, char* argv[]) } else { - printf("WaitCommEvent failure: GetLastError() = %"PRIu32"\n", dwError); + printf("WaitCommEvent failure: GetLastError() = %" PRIu32 "\n", dwError); return -1; } } @@ -70,4 +69,3 @@ int TestCommMonitor(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/comm/test/TestControlSettings.c b/winpr/libwinpr/comm/test/TestControlSettings.c index 07b70117f..7611dbb0f 100644 --- a/winpr/libwinpr/comm/test/TestControlSettings.c +++ b/winpr/libwinpr/comm/test/TestControlSettings.c @@ -46,17 +46,13 @@ int TestControlSettings(int argc, char* argv[]) return EXIT_FAILURE; } - hComm = CreateFile("COM1", - GENERIC_READ | GENERIC_WRITE, - 0, NULL, OPEN_EXISTING, 0, NULL); + hComm = CreateFile("COM1", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (hComm == INVALID_HANDLE_VALUE) { fprintf(stderr, "CreateFileA failure: 0x%x\n", GetLastError()); return EXIT_FAILURE; } - - ZeroMemory(&dcb, sizeof(DCB)); dcb.DCBlength = sizeof(DCB); if (!GetCommState(hComm, &dcb)) @@ -91,7 +87,6 @@ int TestControlSettings(int argc, char* argv[]) return FALSE; } - /* Test 2 */ dcb.ByteSize = 8; @@ -118,7 +113,6 @@ int TestControlSettings(int argc, char* argv[]) return FALSE; } - if (!CloseHandle(hComm)) { fprintf(stderr, "CloseHandle failure, GetLastError()=%08x\n", GetLastError()); diff --git a/winpr/libwinpr/comm/test/TestGetCommState.c b/winpr/libwinpr/comm/test/TestGetCommState.c index 38619aecb..909e61afb 100644 --- a/winpr/libwinpr/comm/test/TestGetCommState.c +++ b/winpr/libwinpr/comm/test/TestGetCommState.c @@ -34,17 +34,18 @@ static BOOL test_generic(HANDLE hComm) result = GetCommState(hComm, &dcb); if (result) { - printf("GetCommState failure, should have returned false because dcb.DCBlength has been let uninitialized\n"); + printf("GetCommState failure, should have returned false because dcb.DCBlength has been " + "let uninitialized\n"); return FALSE; } - ZeroMemory(&dcb, sizeof(DCB)); dcb.DCBlength = sizeof(DCB) / 2; /* improper value */ result = GetCommState(hComm, &dcb); if (result) { - printf("GetCommState failure, should have return false because dcb.DCBlength was not correctly initialized\n"); + printf("GetCommState failure, should have return false because dcb.DCBlength was not " + "correctly initialized\n"); return FALSE; } @@ -92,9 +93,7 @@ int TestGetCommState(int argc, char* argv[]) return EXIT_FAILURE; } - hComm = CreateFileA("COM1", - GENERIC_READ | GENERIC_WRITE, - 0, NULL, OPEN_EXISTING, 0, NULL); + hComm = CreateFileA("COM1", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (hComm == INVALID_HANDLE_VALUE) { diff --git a/winpr/libwinpr/comm/test/TestHandflow.c b/winpr/libwinpr/comm/test/TestHandflow.c index 10cb20a13..ad7fe3c13 100644 --- a/winpr/libwinpr/comm/test/TestHandflow.c +++ b/winpr/libwinpr/comm/test/TestHandflow.c @@ -35,7 +35,6 @@ static BOOL test_SerialSys(HANDLE hComm) return TRUE; } - int TestHandflow(int argc, char* argv[]) { struct stat statbuf; @@ -55,9 +54,7 @@ int TestHandflow(int argc, char* argv[]) return EXIT_FAILURE; } - hComm = CreateFile("COM1", - GENERIC_READ | GENERIC_WRITE, - 0, NULL, OPEN_EXISTING, 0, NULL); + hComm = CreateFile("COM1", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (hComm == INVALID_HANDLE_VALUE) { fprintf(stderr, "CreateFileA failure: 0x%x\n", GetLastError()); @@ -85,7 +82,6 @@ int TestHandflow(int argc, char* argv[]) /* return EXIT_FAILURE; */ /* } */ - if (!CloseHandle(hComm)) { fprintf(stderr, "CloseHandle failure, GetLastError()=%08x\n", GetLastError()); diff --git a/winpr/libwinpr/comm/test/TestSerialChars.c b/winpr/libwinpr/comm/test/TestSerialChars.c index 50912bb09..f2c605e4a 100644 --- a/winpr/libwinpr/comm/test/TestSerialChars.c +++ b/winpr/libwinpr/comm/test/TestSerialChars.c @@ -43,7 +43,6 @@ static BOOL test_SerCxSys(HANDLE hComm) return FALSE; } - ZeroMemory(&dcb, sizeof(DCB)); dcb.DCBlength = sizeof(DCB); if (!GetCommState(hComm, &dcb)) @@ -58,9 +57,9 @@ static BOOL test_SerCxSys(HANDLE hComm) return FALSE; } - /* retrieve Xon/Xoff chars */ - if ((dcb.XonChar != currentTermios.c_cc[VSTART]) || (dcb.XoffChar != currentTermios.c_cc[VSTOP])) + if ((dcb.XonChar != currentTermios.c_cc[VSTART]) || + (dcb.XoffChar != currentTermios.c_cc[VSTOP])) { fprintf(stderr, "test_SerCxSys failure, could not retrieve XonChar and XoffChar\n"); return FALSE; @@ -68,9 +67,9 @@ static BOOL test_SerCxSys(HANDLE hComm) /* swap XonChar/XoffChar */ - XonChar = dcb.XonChar; + XonChar = dcb.XonChar; XoffChar = dcb.XoffChar; - dcb.XonChar = XoffChar; + dcb.XonChar = XoffChar; dcb.XoffChar = XonChar; if (!SetCommState(hComm, &dcb)) { @@ -96,19 +95,20 @@ static BOOL test_SerCxSys(HANDLE hComm) dcb.XonChar = dcb.XoffChar; if (SetCommState(hComm, &dcb)) { - fprintf(stderr, "test_SerCxSys failure, SetCommState() was supposed to failed because XonChar and XoffChar are the same\n"); + fprintf(stderr, "test_SerCxSys failure, SetCommState() was supposed to failed because " + "XonChar and XoffChar are the same\n"); return FALSE; } if (GetLastError() != ERROR_INVALID_PARAMETER) { - fprintf(stderr, "test_SerCxSys failure, SetCommState() was supposed to failed with GetLastError()=ERROR_INVALID_PARAMETER\n"); + fprintf(stderr, "test_SerCxSys failure, SetCommState() was supposed to failed with " + "GetLastError()=ERROR_INVALID_PARAMETER\n"); return FALSE; } return TRUE; } - static BOOL test_SerCx2Sys(HANDLE hComm) { DCB dcb; @@ -121,7 +121,8 @@ static BOOL test_SerCx2Sys(HANDLE hComm) return FALSE; } - if ((dcb.ErrorChar != '\0') || (dcb.EofChar != '\0') || (dcb.EvtChar != '\0') || (dcb.XonChar != '\0') || (dcb.XoffChar != '\0')) + if ((dcb.ErrorChar != '\0') || (dcb.EofChar != '\0') || (dcb.EvtChar != '\0') || + (dcb.XonChar != '\0') || (dcb.XoffChar != '\0')) { fprintf(stderr, "test_SerCx2Sys failure, expected all characters to be: '\\0'\n"); return FALSE; @@ -149,9 +150,7 @@ int TestSerialChars(int argc, char* argv[]) return EXIT_FAILURE; } - hComm = CreateFile("COM1", - GENERIC_READ | GENERIC_WRITE, - 0, NULL, OPEN_EXISTING, 0, NULL); + hComm = CreateFile("COM1", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (hComm == INVALID_HANDLE_VALUE) { fprintf(stderr, "CreateFileA failure: 0x%x\n", GetLastError()); @@ -172,7 +171,6 @@ int TestSerialChars(int argc, char* argv[]) return EXIT_FAILURE; } - if (!CloseHandle(hComm)) { fprintf(stderr, "CloseHandle failure, GetLastError()=%08x\n", GetLastError()); diff --git a/winpr/libwinpr/comm/test/TestSetCommState.c b/winpr/libwinpr/comm/test/TestSetCommState.c index 0815517cc..53f976477 100644 --- a/winpr/libwinpr/comm/test/TestSetCommState.c +++ b/winpr/libwinpr/comm/test/TestSetCommState.c @@ -25,7 +25,7 @@ #include "../comm.h" -static void init_empty_dcb(DCB *pDcb) +static void init_empty_dcb(DCB* pDcb) { ZeroMemory(pDcb, sizeof(DCB)); pDcb->DCBlength = sizeof(DCB); @@ -42,7 +42,7 @@ static BOOL test_fParity(HANDLE hComm) result = GetCommState(hComm, &dcb); if (!result) { - fprintf(stderr, "GetCommState failure: 0x%08"PRIx32"\n", GetLastError()); + fprintf(stderr, "GetCommState failure: 0x%08" PRIx32 "\n", GetLastError()); return FALSE; } @@ -51,7 +51,7 @@ static BOOL test_fParity(HANDLE hComm) result = SetCommState(hComm, &dcb); if (!result) { - fprintf(stderr, "SetCommState failure: 0x%08"PRIx32"\n", GetLastError()); + fprintf(stderr, "SetCommState failure: 0x%08" PRIx32 "\n", GetLastError()); return FALSE; } @@ -59,13 +59,13 @@ static BOOL test_fParity(HANDLE hComm) result = GetCommState(hComm, &dcb); if (!result) { - fprintf(stderr, "GetCommState failure: 0x%08"PRIx32"\n", GetLastError()); + fprintf(stderr, "GetCommState failure: 0x%08" PRIx32 "\n", GetLastError()); return FALSE; } if (!dcb.fParity) { - fprintf(stderr, "unexpected fParity: %"PRIu32" instead of TRUE\n", dcb.fParity); + fprintf(stderr, "unexpected fParity: %" PRIu32 " instead of TRUE\n", dcb.fParity); return FALSE; } @@ -74,7 +74,7 @@ static BOOL test_fParity(HANDLE hComm) result = SetCommState(hComm, &dcb); if (!result) { - fprintf(stderr, "SetCommState failure: 0x%08"PRIx32"\n", GetLastError()); + fprintf(stderr, "SetCommState failure: 0x%08" PRIx32 "\n", GetLastError()); return FALSE; } @@ -82,13 +82,13 @@ static BOOL test_fParity(HANDLE hComm) result = GetCommState(hComm, &dcb); if (!result) { - fprintf(stderr, "GetCommState failure: 0x%08"PRIx32"\n", GetLastError()); + fprintf(stderr, "GetCommState failure: 0x%08" PRIx32 "\n", GetLastError()); return FALSE; } if (dcb.fParity) { - fprintf(stderr, "unexpected fParity: %"PRIu32" instead of FALSE\n", dcb.fParity); + fprintf(stderr, "unexpected fParity: %" PRIu32 " instead of FALSE\n", dcb.fParity); return FALSE; } @@ -97,7 +97,7 @@ static BOOL test_fParity(HANDLE hComm) result = SetCommState(hComm, &dcb); if (!result) { - fprintf(stderr, "SetCommState failure: 0x%08"PRIx32"\n", GetLastError()); + fprintf(stderr, "SetCommState failure: 0x%08" PRIx32 "\n", GetLastError()); return FALSE; } @@ -105,20 +105,19 @@ static BOOL test_fParity(HANDLE hComm) result = GetCommState(hComm, &dcb); if (!result) { - fprintf(stderr, "GetCommState failure: 0x%08"PRIx32"\n", GetLastError()); + fprintf(stderr, "GetCommState failure: 0x%08" PRIx32 "\n", GetLastError()); return FALSE; } if (!dcb.fParity) { - fprintf(stderr, "unexpected fParity: %"PRIu32" instead of TRUE\n", dcb.fParity); + fprintf(stderr, "unexpected fParity: %" PRIu32 " instead of TRUE\n", dcb.fParity); return FALSE; } return TRUE; } - static BOOL test_SerialSys(HANDLE hComm) { DCB dcb; @@ -150,7 +149,8 @@ static BOOL test_SerialSys(HANDLE hComm) } if (dcb.BaudRate != CBR_115200) { - fprintf(stderr, "SetCommState failure: could not set BaudRate=%d (CBR_115200)\n", CBR_115200); + fprintf(stderr, "SetCommState failure: could not set BaudRate=%d (CBR_115200)\n", + CBR_115200); return FALSE; } @@ -182,7 +182,8 @@ static BOOL test_SerialSys(HANDLE hComm) result = SetCommState(hComm, &dcb); if (result) { - fprintf(stderr, "SetCommState failure: unexpected support of BaudRate=%d (CBR_128000)\n", CBR_128000); + fprintf(stderr, "SetCommState failure: unexpected support of BaudRate=%d (CBR_128000)\n", + CBR_128000); return FALSE; } @@ -232,7 +233,8 @@ static BOOL test_generic(HANDLE hComm) if (memcmp(&dcb, &dcb2, sizeof(DCB)) != 0) { - fprintf(stderr, "DCB is different after SetCommState() whereas it should have not changed\n"); + fprintf(stderr, + "DCB is different after SetCommState() whereas it should have not changed\n"); return FALSE; } @@ -250,7 +252,6 @@ static BOOL test_generic(HANDLE hComm) return TRUE; } - int TestSetCommState(int argc, char* argv[]) { struct stat statbuf; @@ -270,9 +271,7 @@ int TestSetCommState(int argc, char* argv[]) return EXIT_FAILURE; } - hComm = CreateFile("COM1", - GENERIC_READ | GENERIC_WRITE, - 0, NULL, OPEN_EXISTING, 0, NULL); + hComm = CreateFile("COM1", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (hComm == INVALID_HANDLE_VALUE) { fprintf(stderr, "CreateFileA failure: 0x%x\n", GetLastError()); @@ -297,7 +296,6 @@ int TestSetCommState(int argc, char* argv[]) return EXIT_FAILURE; } - _comm_setServerSerialDriver(hComm, SerialDriverSerCxSys); if (!test_generic(hComm)) { diff --git a/winpr/libwinpr/comm/test/TestTimeouts.c b/winpr/libwinpr/comm/test/TestTimeouts.c index 0ddf2775a..06075924a 100644 --- a/winpr/libwinpr/comm/test/TestTimeouts.c +++ b/winpr/libwinpr/comm/test/TestTimeouts.c @@ -33,11 +33,11 @@ static BOOL test_generic(HANDLE hComm) { COMMTIMEOUTS timeouts, timeouts2; - timeouts.ReadIntervalTimeout = 1; - timeouts.ReadTotalTimeoutMultiplier = 2; - timeouts.ReadTotalTimeoutConstant = 3; + timeouts.ReadIntervalTimeout = 1; + timeouts.ReadTotalTimeoutMultiplier = 2; + timeouts.ReadTotalTimeoutConstant = 3; timeouts.WriteTotalTimeoutMultiplier = 4; - timeouts.WriteTotalTimeoutConstant = 5; + timeouts.WriteTotalTimeoutConstant = 5; if (!SetCommTimeouts(hComm, &timeouts)) { @@ -59,24 +59,29 @@ static BOOL test_generic(HANDLE hComm) } /* not supported combination */ - timeouts.ReadIntervalTimeout = MAXULONG; - timeouts.ReadTotalTimeoutConstant = MAXULONG; + timeouts.ReadIntervalTimeout = MAXULONG; + timeouts.ReadTotalTimeoutConstant = MAXULONG; if (SetCommTimeouts(hComm, &timeouts)) { - fprintf(stderr, "SetCommTimeouts succeeded with ReadIntervalTimeout and ReadTotalTimeoutConstant set to MAXULONG. GetLastError: 0x%08x\n", GetLastError()); + fprintf(stderr, + "SetCommTimeouts succeeded with ReadIntervalTimeout and ReadTotalTimeoutConstant " + "set to MAXULONG. GetLastError: 0x%08x\n", + GetLastError()); return FALSE; } if (GetLastError() != ERROR_INVALID_PARAMETER) { - fprintf(stderr, "SetCommTimeouts failure, expected GetLastError to return ERROR_INVALID_PARAMETER and got: 0x%08x\n", GetLastError()); + fprintf(stderr, + "SetCommTimeouts failure, expected GetLastError to return ERROR_INVALID_PARAMETER " + "and got: 0x%08x\n", + GetLastError()); return FALSE; } return TRUE; } - int TestTimeouts(int argc, char* argv[]) { struct stat statbuf; @@ -96,9 +101,7 @@ int TestTimeouts(int argc, char* argv[]) return EXIT_FAILURE; } - hComm = CreateFile("COM1", - GENERIC_READ | GENERIC_WRITE, - 0, NULL, OPEN_EXISTING, 0, NULL); + hComm = CreateFile("COM1", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (hComm == INVALID_HANDLE_VALUE) { fprintf(stderr, "CreateFileA failure: 0x%x\n", GetLastError()); diff --git a/winpr/libwinpr/credentials/credentials.c b/winpr/libwinpr/credentials/credentials.c index bb0ad7b1b..6e5f4757b 100644 --- a/winpr/libwinpr/credentials/credentials.c +++ b/winpr/libwinpr/credentials/credentials.c @@ -62,22 +62,26 @@ BOOL CredEnumerateA(LPCSTR Filter, DWORD Flags, DWORD* Count, PCREDENTIALA** Cre return TRUE; } -BOOL CredWriteDomainCredentialsW(PCREDENTIAL_TARGET_INFORMATIONW TargetInfo, PCREDENTIALW Credential, DWORD Flags) +BOOL CredWriteDomainCredentialsW(PCREDENTIAL_TARGET_INFORMATIONW TargetInfo, + PCREDENTIALW Credential, DWORD Flags) { return TRUE; } -BOOL CredWriteDomainCredentialsA(PCREDENTIAL_TARGET_INFORMATIONA TargetInfo, PCREDENTIALA Credential, DWORD Flags) +BOOL CredWriteDomainCredentialsA(PCREDENTIAL_TARGET_INFORMATIONA TargetInfo, + PCREDENTIALA Credential, DWORD Flags) { return TRUE; } -BOOL CredReadDomainCredentialsW(PCREDENTIAL_TARGET_INFORMATIONW TargetInfo, DWORD Flags, DWORD* Count, PCREDENTIALW** Credential) +BOOL CredReadDomainCredentialsW(PCREDENTIAL_TARGET_INFORMATIONW TargetInfo, DWORD Flags, + DWORD* Count, PCREDENTIALW** Credential) { return TRUE; } -BOOL CredReadDomainCredentialsA(PCREDENTIAL_TARGET_INFORMATIONA TargetInfo, DWORD Flags, DWORD* Count, PCREDENTIALA** Credential) +BOOL CredReadDomainCredentialsA(PCREDENTIAL_TARGET_INFORMATIONA TargetInfo, DWORD Flags, + DWORD* Count, PCREDENTIALA** Credential) { return TRUE; } @@ -102,7 +106,8 @@ BOOL CredRenameA(LPCSTR OldTargetName, LPCSTR NewTargetName, DWORD Type, DWORD F return TRUE; } -BOOL CredGetTargetInfoW(LPCWSTR TargetName, DWORD Flags, PCREDENTIAL_TARGET_INFORMATIONW* TargetInfo) +BOOL CredGetTargetInfoW(LPCWSTR TargetName, DWORD Flags, + PCREDENTIAL_TARGET_INFORMATIONW* TargetInfo) { return TRUE; } @@ -112,22 +117,26 @@ BOOL CredGetTargetInfoA(LPCSTR TargetName, DWORD Flags, PCREDENTIAL_TARGET_INFOR return TRUE; } -BOOL CredMarshalCredentialW(CRED_MARSHAL_TYPE CredType, PVOID Credential, LPWSTR* MarshaledCredential) +BOOL CredMarshalCredentialW(CRED_MARSHAL_TYPE CredType, PVOID Credential, + LPWSTR* MarshaledCredential) { return TRUE; } -BOOL CredMarshalCredentialA(CRED_MARSHAL_TYPE CredType, PVOID Credential, LPSTR* MarshaledCredential) +BOOL CredMarshalCredentialA(CRED_MARSHAL_TYPE CredType, PVOID Credential, + LPSTR* MarshaledCredential) { return TRUE; } -BOOL CredUnmarshalCredentialW(LPCWSTR MarshaledCredential, PCRED_MARSHAL_TYPE CredType, PVOID* Credential) +BOOL CredUnmarshalCredentialW(LPCWSTR MarshaledCredential, PCRED_MARSHAL_TYPE CredType, + PVOID* Credential) { return TRUE; } -BOOL CredUnmarshalCredentialA(LPCSTR MarshaledCredential, PCRED_MARSHAL_TYPE CredType, PVOID* Credential) +BOOL CredUnmarshalCredentialA(LPCSTR MarshaledCredential, PCRED_MARSHAL_TYPE CredType, + PVOID* Credential) { return TRUE; } @@ -143,25 +152,27 @@ BOOL CredIsMarshaledCredentialA(LPCSTR MarshaledCredential) } BOOL CredProtectW(BOOL fAsSelf, LPWSTR pszCredentials, DWORD cchCredentials, - LPWSTR pszProtectedCredentials, DWORD* pcchMaxChars, CRED_PROTECTION_TYPE* ProtectionType) + LPWSTR pszProtectedCredentials, DWORD* pcchMaxChars, + CRED_PROTECTION_TYPE* ProtectionType) { return TRUE; } BOOL CredProtectA(BOOL fAsSelf, LPSTR pszCredentials, DWORD cchCredentials, - LPSTR pszProtectedCredentials, DWORD* pcchMaxChars, CRED_PROTECTION_TYPE* ProtectionType) + LPSTR pszProtectedCredentials, DWORD* pcchMaxChars, + CRED_PROTECTION_TYPE* ProtectionType) { return TRUE; } -BOOL CredUnprotectW(BOOL fAsSelf, LPWSTR pszProtectedCredentials, - DWORD cchCredentials, LPWSTR pszCredentials, DWORD* pcchMaxChars) +BOOL CredUnprotectW(BOOL fAsSelf, LPWSTR pszProtectedCredentials, DWORD cchCredentials, + LPWSTR pszCredentials, DWORD* pcchMaxChars) { return TRUE; } -BOOL CredUnprotectA(BOOL fAsSelf, LPSTR pszProtectedCredentials, - DWORD cchCredentials, LPSTR pszCredentials, DWORD* pcchMaxChars) +BOOL CredUnprotectA(BOOL fAsSelf, LPSTR pszProtectedCredentials, DWORD cchCredentials, + LPSTR pszCredentials, DWORD* pcchMaxChars) { return TRUE; } @@ -193,7 +204,6 @@ BOOL CredGetSessionTypes(DWORD MaximumPersistCount, LPDWORD MaximumPersist) VOID CredFree(PVOID Buffer) { - } #endif diff --git a/winpr/libwinpr/credui/credui.c b/winpr/libwinpr/credui/credui.c index f7b20cbbe..45b02fa60 100644 --- a/winpr/libwinpr/credui/credui.c +++ b/winpr/libwinpr/credui/credui.c @@ -32,40 +32,46 @@ #ifndef _WIN32 -DWORD CredUIPromptForCredentialsW(PCREDUI_INFOW pUiInfo, PCWSTR pszTargetName, - PCtxtHandle pContext, DWORD dwAuthError, PWSTR pszUserName, ULONG ulUserNameBufferSize, - PWSTR pszPassword, ULONG ulPasswordBufferSize, BOOL* save, DWORD dwFlags) +DWORD CredUIPromptForCredentialsW(PCREDUI_INFOW pUiInfo, PCWSTR pszTargetName, PCtxtHandle pContext, + DWORD dwAuthError, PWSTR pszUserName, ULONG ulUserNameBufferSize, + PWSTR pszPassword, ULONG ulPasswordBufferSize, BOOL* save, + DWORD dwFlags) { return 0; } -DWORD CredUIPromptForCredentialsA(PCREDUI_INFOA pUiInfo, PCSTR pszTargetName, - PCtxtHandle pContext, DWORD dwAuthError, PSTR pszUserName, ULONG ulUserNameBufferSize, - PSTR pszPassword, ULONG ulPasswordBufferSize, BOOL* save, DWORD dwFlags) +DWORD CredUIPromptForCredentialsA(PCREDUI_INFOA pUiInfo, PCSTR pszTargetName, PCtxtHandle pContext, + DWORD dwAuthError, PSTR pszUserName, ULONG ulUserNameBufferSize, + PSTR pszPassword, ULONG ulPasswordBufferSize, BOOL* save, + DWORD dwFlags) { return 0; } -DWORD CredUIParseUserNameW(CONST WCHAR* UserName, WCHAR* user, ULONG userBufferSize, WCHAR* domain, ULONG domainBufferSize) +DWORD CredUIParseUserNameW(CONST WCHAR* UserName, WCHAR* user, ULONG userBufferSize, WCHAR* domain, + ULONG domainBufferSize) { return 0; } -DWORD CredUIParseUserNameA(CONST CHAR* userName, CHAR* user, ULONG userBufferSize, CHAR* domain, ULONG domainBufferSize) +DWORD CredUIParseUserNameA(CONST CHAR* userName, CHAR* user, ULONG userBufferSize, CHAR* domain, + ULONG domainBufferSize) { return 0; } DWORD CredUICmdLinePromptForCredentialsW(PCWSTR pszTargetName, PCtxtHandle pContext, - DWORD dwAuthError, PWSTR UserName, ULONG ulUserBufferSize, PWSTR pszPassword, - ULONG ulPasswordBufferSize, PBOOL pfSave, DWORD dwFlags) + DWORD dwAuthError, PWSTR UserName, ULONG ulUserBufferSize, + PWSTR pszPassword, ULONG ulPasswordBufferSize, + PBOOL pfSave, DWORD dwFlags) { return 0; } DWORD CredUICmdLinePromptForCredentialsA(PCSTR pszTargetName, PCtxtHandle pContext, - DWORD dwAuthError, PSTR UserName, ULONG ulUserBufferSize, PSTR pszPassword, - ULONG ulPasswordBufferSize, PBOOL pfSave, DWORD dwFlags) + DWORD dwAuthError, PSTR UserName, ULONG ulUserBufferSize, + PSTR pszPassword, ULONG ulPasswordBufferSize, PBOOL pfSave, + DWORD dwFlags) { return 0; } diff --git a/winpr/libwinpr/credui/test/TestCredUICmdLinePromptForCredentials.c b/winpr/libwinpr/credui/test/TestCredUICmdLinePromptForCredentials.c index e8c72039e..83379ce6e 100644 --- a/winpr/libwinpr/credui/test/TestCredUICmdLinePromptForCredentials.c +++ b/winpr/libwinpr/credui/test/TestCredUICmdLinePromptForCredentials.c @@ -14,19 +14,19 @@ int TestCredUICmdLinePromptForCredentials(int argc, char* argv[]) DWORD dwFlags; TCHAR UserName[CREDUI_MAX_USERNAME_LENGTH]; TCHAR Password[CREDUI_MAX_PASSWORD_LENGTH]; - + fSave = FALSE; ZeroMemory(UserName, sizeof(UserName)); ZeroMemory(Password, sizeof(Password)); dwFlags = CREDUI_FLAGS_DO_NOT_PERSIST | CREDUI_FLAGS_EXCLUDE_CERTIFICATES; - status = CredUICmdLinePromptForCredentials(testTargetName, NULL, 0, - UserName, CREDUI_MAX_USERNAME_LENGTH, - Password, CREDUI_MAX_PASSWORD_LENGTH, &fSave, dwFlags); + status = CredUICmdLinePromptForCredentials(testTargetName, NULL, 0, UserName, + CREDUI_MAX_USERNAME_LENGTH, Password, + CREDUI_MAX_PASSWORD_LENGTH, &fSave, dwFlags); if (status != NO_ERROR) { - printf("CredUIPromptForCredentials unexpected status: 0x%08"PRIX32"\n", status); + printf("CredUIPromptForCredentials unexpected status: 0x%08" PRIX32 "\n", status); return -1; } @@ -34,4 +34,3 @@ int TestCredUICmdLinePromptForCredentials(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/credui/test/TestCredUIConfirmCredentials.c b/winpr/libwinpr/credui/test/TestCredUIConfirmCredentials.c index 7d3b5b418..36e27e487 100644 --- a/winpr/libwinpr/credui/test/TestCredUIConfirmCredentials.c +++ b/winpr/libwinpr/credui/test/TestCredUIConfirmCredentials.c @@ -9,4 +9,3 @@ int TestCredUIConfirmCredentials(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/credui/test/TestCredUIParseUserName.c b/winpr/libwinpr/credui/test/TestCredUIParseUserName.c index 123c677e7..b4452926d 100644 --- a/winpr/libwinpr/credui/test/TestCredUIParseUserName.c +++ b/winpr/libwinpr/credui/test/TestCredUIParseUserName.c @@ -19,10 +19,10 @@ int TestCredUIParseUserName(int argc, char* argv[]) ZeroMemory(User, sizeof(User)); ZeroMemory(Domain, sizeof(Domain)); - status = CredUIParseUserName(testUserName1, User, sizeof(User) / sizeof(TCHAR), - Domain, sizeof(Domain) / sizeof(TCHAR)); + status = CredUIParseUserName(testUserName1, User, sizeof(User) / sizeof(TCHAR), Domain, + sizeof(Domain) / sizeof(TCHAR)); - printf("CredUIParseUserName status: 0x%08"PRIX32"\n", status); + printf("CredUIParseUserName status: 0x%08" PRIX32 "\n", status); _tprintf(_T("UserName: %s -> Domain: %s User: %s\n"), testUserName1, Domain, User); @@ -31,13 +31,12 @@ int TestCredUIParseUserName(int argc, char* argv[]) ZeroMemory(User, sizeof(User)); ZeroMemory(Domain, sizeof(Domain)); - status = CredUIParseUserName(testUserName2, User, sizeof(User) / sizeof(TCHAR), - Domain, sizeof(Domain) / sizeof(TCHAR)); + status = CredUIParseUserName(testUserName2, User, sizeof(User) / sizeof(TCHAR), Domain, + sizeof(Domain) / sizeof(TCHAR)); - printf("CredUIParseUserName status: 0x%08"PRIX32"\n", status); + printf("CredUIParseUserName status: 0x%08" PRIX32 "\n", status); _tprintf(_T("UserName: %s -> Domain: %s User: %s\n"), testUserName2, Domain, User); return 0; } - diff --git a/winpr/libwinpr/credui/test/TestCredUIPromptForCredentials.c b/winpr/libwinpr/credui/test/TestCredUIPromptForCredentials.c index fa8d265a5..63462bde0 100644 --- a/winpr/libwinpr/credui/test/TestCredUIPromptForCredentials.c +++ b/winpr/libwinpr/credui/test/TestCredUIPromptForCredentials.c @@ -7,14 +7,8 @@ static const TCHAR testTargetName[] = _T("TARGET"); -static CREDUI_INFO testUiInfo = -{ - sizeof(CREDUI_INFO), - NULL, - _T("Message Text"), - _T("Caption Text"), - NULL -}; +static CREDUI_INFO testUiInfo = { sizeof(CREDUI_INFO), NULL, _T("Message Text"), _T("Caption Text"), + NULL }; int TestCredUIPromptForCredentials(int argc, char* argv[]) { @@ -23,19 +17,19 @@ int TestCredUIPromptForCredentials(int argc, char* argv[]) DWORD dwFlags; TCHAR UserName[CREDUI_MAX_USERNAME_LENGTH]; TCHAR Password[CREDUI_MAX_PASSWORD_LENGTH]; - + fSave = FALSE; ZeroMemory(UserName, sizeof(UserName)); ZeroMemory(Password, sizeof(Password)); dwFlags = CREDUI_FLAGS_DO_NOT_PERSIST | CREDUI_FLAGS_EXCLUDE_CERTIFICATES; - status = CredUIPromptForCredentials(&testUiInfo, testTargetName, NULL, 0, - UserName, CREDUI_MAX_USERNAME_LENGTH, - Password, CREDUI_MAX_PASSWORD_LENGTH, &fSave, dwFlags); + status = CredUIPromptForCredentials(&testUiInfo, testTargetName, NULL, 0, UserName, + CREDUI_MAX_USERNAME_LENGTH, Password, + CREDUI_MAX_PASSWORD_LENGTH, &fSave, dwFlags); if (status != NO_ERROR) { - printf("CredUIPromptForCredentials unexpected status: 0x%08"PRIX32"\n", status); + printf("CredUIPromptForCredentials unexpected status: 0x%08" PRIX32 "\n", status); return -1; } @@ -43,4 +37,3 @@ int TestCredUIPromptForCredentials(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/crt/alignment.c b/winpr/libwinpr/crt/alignment.c index c1af8edab..6901c52cc 100644 --- a/winpr/libwinpr/crt/alignment.c +++ b/winpr/libwinpr/crt/alignment.c @@ -30,10 +30,10 @@ #include #include -#define WINPR_ALIGNED_MEM_SIGNATURE 0x0BA0BAB +#define WINPR_ALIGNED_MEM_SIGNATURE 0x0BA0BAB #define WINPR_ALIGNED_MEM_STRUCT_FROM_PTR(_memptr) \ - (WINPR_ALIGNED_MEM*) (((size_t)(((BYTE*) _memptr) - sizeof(WINPR_ALIGNED_MEM)))); + (WINPR_ALIGNED_MEM*)(((size_t)(((BYTE*)_memptr) - sizeof(WINPR_ALIGNED_MEM)))); #include @@ -137,7 +137,8 @@ void* _aligned_offset_realloc(void* memblock, size_t size, size_t alignment, siz if (pMem->sig != WINPR_ALIGNED_MEM_SIGNATURE) { - WLog_ERR(TAG, "_aligned_offset_realloc: memory block was not allocated by _aligned_malloc!"); + WLog_ERR(TAG, + "_aligned_offset_realloc: memory block was not allocated by _aligned_malloc!"); return NULL; } @@ -183,7 +184,8 @@ void* _aligned_offset_recalloc(void* memblock, size_t num, size_t size, size_t a if (pMem->sig != WINPR_ALIGNED_MEM_SIGNATURE) { - WLog_ERR(TAG, "_aligned_offset_recalloc: memory block was not allocated by _aligned_malloc!"); + WLog_ERR(TAG, + "_aligned_offset_recalloc: memory block was not allocated by _aligned_malloc!"); return NULL; } diff --git a/winpr/libwinpr/crt/casing.c b/winpr/libwinpr/crt/casing.c index 9f0988f4f..41b26d530 100644 --- a/winpr/libwinpr/crt/casing.c +++ b/winpr/libwinpr/crt/casing.c @@ -4,7 +4,7 @@ * This code is generated by wine's make_unicode script * which downloads data from unicode.org and produces * readily usable conversion tables. - * + * * After asking permission from Alexandre Julliard in May 2011, * it was clarified that no copyright was claimed by the wine * project on the script's generated output. @@ -16,1026 +16,711 @@ #define WINPR_TOUPPERW(_wch) \ (_wch + winpr_casemap_upper[winpr_casemap_upper[_wch >> 8] + (_wch & 0xFF)]); -const WCHAR winpr_casemap_lower[3807] = -{ - /* index */ - 0x01bf, 0x02bf, 0x03bf, 0x044f, 0x054f, 0x064f, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x06af, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x07af, 0x08ae, - 0x0100, 0x09ab, 0x0100, 0x0100, 0x0a2f, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0b2f, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0c22, 0x0d00, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0ddf, - /* defaults */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0x0041 .. 0x00ff */ - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, - 0x0020, 0x0020, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, 0x0020, - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0x0100 .. 0x01ff */ - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0xff39, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, - 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, - 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0xff87, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, - 0x0000, 0x00d2, 0x0001, 0x0000, 0x0001, 0x0000, 0x00ce, 0x0001, - 0x0000, 0x00cd, 0x00cd, 0x0001, 0x0000, 0x0000, 0x004f, 0x00ca, - 0x00cb, 0x0001, 0x0000, 0x00cd, 0x00cf, 0x0000, 0x00d3, 0x00d1, - 0x0001, 0x0000, 0x0000, 0x0000, 0x00d3, 0x00d5, 0x0000, 0x00d6, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x00da, 0x0001, - 0x0000, 0x00da, 0x0000, 0x0000, 0x0001, 0x0000, 0x00da, 0x0001, - 0x0000, 0x00d9, 0x00d9, 0x0001, 0x0000, 0x0001, 0x0000, 0x00db, - 0x0001, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0001, 0x0000, 0x0002, - 0x0001, 0x0000, 0x0002, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, - 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, - 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0000, 0x0002, 0x0001, 0x0000, 0x0001, 0x0000, 0xff9f, 0xffc8, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - /* 0x0200 .. 0x02ff */ - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0xff7e, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x2a2b, 0x0001, 0x0000, 0xff5d, 0x2a28, 0x0000, - 0x0000, 0x0001, 0x0000, 0xff3d, 0x0045, 0x0047, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0x0370 .. 0x03ff */ - 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0026, 0x0000, - 0x0025, 0x0025, 0x0025, 0x0000, 0x0040, 0x0000, 0x003f, 0x003f, - 0x0000, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, - 0x0020, 0x0020, 0x0000, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, - 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xffc4, 0x0000, 0x0000, 0x0001, - 0x0000, 0xfff9, 0x0001, 0x0000, 0x0000, 0xff7e, 0xff7e, 0xff7e, - /* 0x0400 .. 0x04ff */ - 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, - 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x000f, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, - 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - /* 0x0500 .. 0x05ff */ - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, - 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, - 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, - 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, - 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0x10a0 .. 0x10ff */ - 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, - 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, - 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, - 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, - 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x0000, 0x1c60, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1c60, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0x1e00 .. 0x1eff */ - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xe241, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - /* 0x1f01 .. 0x1fff */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, - 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, - 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, - 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, - 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, - 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0xfff8, 0x0000, 0xfff8, 0x0000, 0xfff8, 0x0000, 0xfff8, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, - 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, - 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, - 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, - 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, - 0xfff8, 0xffb6, 0xffb6, 0xfff7, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffaa, - 0xffaa, 0xffaa, 0xffaa, 0xfff7, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, - 0xfff8, 0xff9c, 0xff9c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, - 0xfff8, 0xff90, 0xff90, 0xfff9, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xff80, - 0xff80, 0xff82, 0xff82, 0xfff7, 0x0000, 0x0000, 0x0000, - /* 0x2103 .. 0x21ff */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xe2a3, 0x0000, 0x0000, 0x0000, 0xdf41, - 0xdfba, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x001c, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0010, 0x0010, 0x0010, - 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, - 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0x247c .. 0x24ff */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, - 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, - 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, - 0x001a, 0x001a, 0x001a, 0x001a, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, - /* 0x2c00 .. 0x2cff */ - 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, - 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, - 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, - 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, - 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, - 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0001, 0x0000, 0xd609, 0xf11a, 0xd619, 0x0000, 0x0000, 0x0001, - 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0xd5e4, 0xd603, 0xd5e1, - 0xd5e2, 0x0000, 0x0001, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xd5c1, 0xd5c1, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0xa60d .. 0xa6ff */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, - 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, - 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, - 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, - 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, - 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, - 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, - 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, - 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, - /* 0xa722 .. 0xa7ff */ - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, - 0x0000, 0x0001, 0x0000, 0x75fc, 0x0001, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0001, 0x0000, 0x5ad8, 0x0000, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, - 0x5abc, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0xff21 .. 0xffff */ - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, - 0x0020, 0x0020, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +const WCHAR winpr_casemap_lower[3807] = { + /* index */ + 0x01bf, 0x02bf, 0x03bf, 0x044f, 0x054f, 0x064f, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x06af, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x07af, 0x08ae, 0x0100, 0x09ab, 0x0100, 0x0100, + 0x0a2f, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0b2f, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0c22, 0x0d00, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0ddf, + /* defaults */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + /* 0x0041 .. 0x00ff */ + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 0x0100 .. 0x01ff */ + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0xff39, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, + 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, + 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0xff87, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x00d2, 0x0001, 0x0000, + 0x0001, 0x0000, 0x00ce, 0x0001, 0x0000, 0x00cd, 0x00cd, 0x0001, 0x0000, 0x0000, 0x004f, 0x00ca, + 0x00cb, 0x0001, 0x0000, 0x00cd, 0x00cf, 0x0000, 0x00d3, 0x00d1, 0x0001, 0x0000, 0x0000, 0x0000, + 0x00d3, 0x00d5, 0x0000, 0x00d6, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x00da, 0x0001, + 0x0000, 0x00da, 0x0000, 0x0000, 0x0001, 0x0000, 0x00da, 0x0001, 0x0000, 0x00d9, 0x00d9, 0x0001, + 0x0000, 0x0001, 0x0000, 0x00db, 0x0001, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0001, 0x0000, 0x0002, 0x0001, 0x0000, 0x0002, 0x0001, + 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, + 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0000, 0x0002, 0x0001, 0x0000, 0x0001, 0x0000, 0xff9f, 0xffc8, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, + /* 0x0200 .. 0x02ff */ + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0xff7e, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2a2b, 0x0001, + 0x0000, 0xff5d, 0x2a28, 0x0000, 0x0000, 0x0001, 0x0000, 0xff3d, 0x0045, 0x0047, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + /* 0x0370 .. 0x03ff */ + 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0026, 0x0000, + 0x0025, 0x0025, 0x0025, 0x0000, 0x0040, 0x0000, 0x003f, 0x003f, 0x0000, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0000, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0xffc4, 0x0000, 0x0000, 0x0001, 0x0000, 0xfff9, 0x0001, 0x0000, 0x0000, 0xff7e, 0xff7e, 0xff7e, + /* 0x0400 .. 0x04ff */ + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x000f, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, + 0x0000, 0x0001, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, + /* 0x0500 .. 0x05ff */ + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, + 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, + 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, + 0x0030, 0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + /* 0x10a0 .. 0x10ff */ + 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, + 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, + 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, 0x1c60, + 0x1c60, 0x1c60, 0x0000, 0x1c60, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1c60, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 0x1e00 .. 0x1eff */ + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0xe241, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, + /* 0x1f01 .. 0x1fff */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, + 0xfff8, 0xfff8, 0xfff8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, + 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, + 0xfff8, 0xfff8, 0xfff8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, + 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, 0x0000, 0xfff8, 0x0000, 0xfff8, 0x0000, 0xfff8, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, + 0xfff8, 0xfff8, 0xfff8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, + 0xfff8, 0xfff8, 0xfff8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, + 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xfff8, 0xfff8, 0xffb6, 0xffb6, 0xfff7, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffaa, 0xffaa, 0xffaa, 0xffaa, 0xfff7, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, + 0xfff8, 0xff9c, 0xff9c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xfff8, 0xfff8, 0xff90, 0xff90, 0xfff9, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xff80, 0xff80, 0xff82, 0xff82, 0xfff7, + 0x0000, 0x0000, 0x0000, + /* 0x2103 .. 0x21ff */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xe2a3, + 0x0000, 0x0000, 0x0000, 0xdf41, 0xdfba, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x001c, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0010, 0x0010, 0x0010, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, + 0x0010, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, + /* 0x247c .. 0x24ff */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x001a, 0x001a, + 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, + 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 0x2c00 .. 0x2cff */ + 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, + 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, + 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, + 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0000, 0xd609, 0xf11a, 0xd619, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, + 0x0000, 0xd5e4, 0xd603, 0xd5e1, 0xd5e2, 0x0000, 0x0001, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xd5c1, 0xd5c1, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + /* 0xa60d .. 0xa6ff */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, + 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, + 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, + 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, + 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, + 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, + /* 0xa722 .. 0xa7ff */ + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x75fc, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x5ad8, + 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0000, 0x5abc, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 0xff21 .. 0xffff */ + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; -const WCHAR winpr_casemap_upper[3994] = -{ - /* index */ - 0x019f, 0x029f, 0x039f, 0x045a, 0x0556, 0x0656, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x06dd, 0x07dc, 0x08dc, - 0x0100, 0x09d0, 0x0100, 0x0100, 0x0a55, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0b3f, 0x0c3f, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0cfe, 0x0ddb, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0e9a, - /* defaults */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0x0061 .. 0x00ff */ - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, - 0xffe0, 0xffe0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x02e7, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffe0, - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0x0000, 0xffe0, - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0x0079, - /* 0x0100 .. 0x01ff */ - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xff18, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0xfed4, - 0x00c3, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, - 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0061, 0x0000, 0x0000, - 0x0000, 0xffff, 0x00a3, 0x0000, 0x0000, 0x0000, 0x0082, 0x0000, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, - 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, - 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0038, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xfffe, 0x0000, - 0xffff, 0xfffe, 0x0000, 0xffff, 0xfffe, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0xffb1, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0x0000, 0xffff, 0xfffe, 0x0000, 0xffff, 0x0000, 0x0000, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - /* 0x0200 .. 0x02ff */ - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x2a3f, - 0x2a3f, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x2a1f, 0x2a1c, 0x2a1e, 0xff2e, 0xff32, 0x0000, 0xff33, 0xff33, - 0x0000, 0xff36, 0x0000, 0xff35, 0x0000, 0x0000, 0x0000, 0x0000, - 0xff33, 0x0000, 0x0000, 0xff31, 0x0000, 0xa528, 0xa544, 0x0000, - 0xff2f, 0xff2d, 0x0000, 0x29f7, 0x0000, 0x0000, 0x0000, 0xff2d, - 0x0000, 0x29fd, 0xff2b, 0x0000, 0x0000, 0xff2a, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x29e7, 0x0000, 0x0000, - 0xff26, 0x0000, 0x0000, 0xff26, 0x0000, 0x0000, 0x0000, 0x0000, - 0xff26, 0xffbb, 0xff27, 0xff27, 0xffb9, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0xff25, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0x0345 .. 0x03ff */ - 0x0054, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0082, 0x0082, - 0x0082, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffda, - 0xffdb, 0xffdb, 0xffdb, 0x0000, 0xffe0, 0xffe0, 0xffe0, 0xffe0, - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe1, 0xffe0, 0xffe0, - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffc0, - 0xffc1, 0xffc1, 0x0000, 0xffc2, 0xffc7, 0x0000, 0x0000, 0x0000, - 0xffd1, 0xffca, 0xfff8, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0xffaa, 0xffb0, 0x0007, 0x0000, 0x0000, - 0xffa0, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, - 0x0000, 0x0000, 0x0000, - /* 0x0404 .. 0x04ff */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xffe0, 0xffe0, 0xffe0, 0xffe0, - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, - 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, - 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0xfff1, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, - /* 0x0500 .. 0x05ff */ - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, - 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, - 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, - 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, - 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0x1d79 .. 0x1dff */ - 0x8a04, 0x0000, 0x0000, 0x0000, 0x0ee6, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0x1e01 .. 0x1eff */ - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0xffc5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - /* 0x1f00 .. 0x1fff */ - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0008, 0x0000, 0x0008, 0x0000, 0x0008, 0x0000, 0x0008, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x004a, 0x004a, 0x0056, 0x0056, 0x0056, 0x0056, 0x0064, 0x0064, - 0x0080, 0x0080, 0x0070, 0x0070, 0x007e, 0x007e, 0x0000, 0x0000, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0008, 0x0008, 0x0000, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xe3db, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0007, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0x210c .. 0x21ff */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0xffe4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xfff0, 0xfff0, 0xfff0, 0xfff0, - 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, - 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0x0000, 0x0000, 0x0000, 0x0000, - 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, - /* 0x247b .. 0x24ff */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffe6, 0xffe6, 0xffe6, - 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, - 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, - 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0x2c16 .. 0x2cff */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, - 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, - 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, - 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, - 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, - 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, - 0xffd0, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xd5d5, - 0xd5d8, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, - 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, - /* 0x2d00 .. 0x2dff */ - 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, - 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, - 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, - 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, - 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0x0000, 0xe3a0, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xe3a0, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0xa641 .. 0xa6ff */ - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0xa723 .. 0xa7ff */ - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, - 0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, - 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, - 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0xff41 .. 0xffff */ - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, - 0xffe0, 0xffe0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +const WCHAR winpr_casemap_upper[3994] = { + /* index */ + 0x019f, 0x029f, 0x039f, 0x045a, 0x0556, 0x0656, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x06dd, 0x07dc, 0x08dc, 0x0100, 0x09d0, 0x0100, 0x0100, + 0x0a55, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0b3f, 0x0c3f, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0cfe, 0x0ddb, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0e9a, + /* defaults */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + /* 0x0061 .. 0x00ff */ + 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, + 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, + 0xffe0, 0xffe0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x02e7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, + 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, + 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0x0000, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, + 0xffe0, 0xffe0, 0x0079, + /* 0x0100 .. 0x01ff */ + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xff18, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0xfed4, 0x00c3, 0x0000, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0061, 0x0000, 0x0000, 0x0000, 0xffff, 0x00a3, 0x0000, + 0x0000, 0x0000, 0x0082, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, + 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0038, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xfffe, 0x0000, 0xffff, 0xfffe, 0x0000, 0xffff, + 0xfffe, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0xffb1, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0x0000, 0xffff, 0xfffe, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, + /* 0x0200 .. 0x02ff */ + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0xffff, 0x0000, 0x0000, 0x2a3f, 0x2a3f, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x2a1f, 0x2a1c, 0x2a1e, 0xff2e, + 0xff32, 0x0000, 0xff33, 0xff33, 0x0000, 0xff36, 0x0000, 0xff35, 0x0000, 0x0000, 0x0000, 0x0000, + 0xff33, 0x0000, 0x0000, 0xff31, 0x0000, 0xa528, 0xa544, 0x0000, 0xff2f, 0xff2d, 0x0000, 0x29f7, + 0x0000, 0x0000, 0x0000, 0xff2d, 0x0000, 0x29fd, 0xff2b, 0x0000, 0x0000, 0xff2a, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x29e7, 0x0000, 0x0000, 0xff26, 0x0000, 0x0000, 0xff26, + 0x0000, 0x0000, 0x0000, 0x0000, 0xff26, 0xffbb, 0xff27, 0xff27, 0xffb9, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0xff25, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + /* 0x0345 .. 0x03ff */ + 0x0054, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0082, 0x0082, 0x0082, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffda, 0xffdb, 0xffdb, 0xffdb, 0x0000, + 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, + 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe1, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, + 0xffe0, 0xffe0, 0xffe0, 0xffc0, 0xffc1, 0xffc1, 0x0000, 0xffc2, 0xffc7, 0x0000, 0x0000, 0x0000, + 0xffd1, 0xffca, 0xfff8, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0xffaa, 0xffb0, 0x0007, 0x0000, 0x0000, 0xffa0, 0x0000, 0x0000, 0xffff, + 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, + /* 0x0404 .. 0x04ff */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffe0, 0xffe0, 0xffe0, 0xffe0, + 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, + 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, + 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, + 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0xfff1, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + /* 0x0500 .. 0x05ff */ + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, + 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, + 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, + 0xffd0, 0xffd0, 0xffd0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + /* 0x1d79 .. 0x1dff */ + 0x8a04, 0x0000, 0x0000, 0x0000, 0x0ee6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, + /* 0x1e01 .. 0x1eff */ + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffc5, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, + /* 0x1f00 .. 0x1fff */ + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0000, 0x0008, + 0x0000, 0x0008, 0x0000, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x004a, 0x004a, 0x0056, 0x0056, 0x0056, 0x0056, 0x0064, 0x0064, + 0x0080, 0x0080, 0x0070, 0x0070, 0x007e, 0x007e, 0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0000, 0x0009, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xe3db, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0000, 0x0000, + 0x0000, 0x0007, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + /* 0x210c .. 0x21ff */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffe4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, + 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0x0000, 0x0000, 0x0000, 0x0000, + 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + /* 0x247b .. 0x24ff */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, + 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, + 0xffe6, 0xffe6, 0xffe6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, + /* 0x2c16 .. 0x2cff */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, + 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, + 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, + 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, + 0xffd0, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xd5d5, 0xd5d8, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, + 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, + 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 0x2d00 .. 0x2dff */ + 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, + 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, + 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, 0xe3a0, + 0xe3a0, 0xe3a0, 0x0000, 0xe3a0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xe3a0, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + /* 0xa641 .. 0xa6ff */ + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 0xa723 .. 0xa7ff */ + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, + 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, + 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 0xff41 .. 0xffff */ + 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, + 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, + 0xffe0, 0xffe0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; - diff --git a/winpr/libwinpr/crt/conversion.c b/winpr/libwinpr/crt/conversion.c index ff7c938a1..0ca5a66f3 100644 --- a/winpr/libwinpr/crt/conversion.c +++ b/winpr/libwinpr/crt/conversion.c @@ -46,4 +46,3 @@ errno_t _itoa_s(int value, char* buffer, size_t sizeInCharacters, int radix) } #endif - diff --git a/winpr/libwinpr/crt/string.c b/winpr/libwinpr/crt/string.c index dda8417b0..a25aac4bd 100644 --- a/winpr/libwinpr/crt/string.c +++ b/winpr/libwinpr/crt/string.c @@ -64,7 +64,7 @@ WCHAR* _wcsdup(const WCHAR* strSource) wcscpy((wchar_t*)strDestination, (const wchar_t*)strSource); #else - strDestination = (WCHAR*) wcsdup((wchar_t*) strSource); + strDestination = (WCHAR*)wcsdup((wchar_t*)strSource); #endif if (strDestination == NULL) @@ -104,7 +104,7 @@ int _wcscmp(const WCHAR* string1, const WCHAR* string2) size_t _wcslen(const WCHAR* str) { - const WCHAR* p = (const WCHAR*) str; + const WCHAR* p = (const WCHAR*)str; if (!p) return 0; @@ -133,12 +133,11 @@ size_t _wcsnlen(const WCHAR* str, size_t max) return x; } - /* _wcschr -> wcschr */ WCHAR* _wcschr(const WCHAR* str, WCHAR c) { - WCHAR* p = (WCHAR*) str; + WCHAR* p = (WCHAR*)str; WCHAR value; Data_Write_UINT16(&value, c); @@ -158,9 +157,9 @@ WCHAR* _wcsrchr(const WCHAR* str, WCHAR c) if (!str) return NULL; - for (p = (WCHAR*) 0; (ch = *str); str++) + for (p = (WCHAR*)0; (ch = *str); str++) if (ch == c) - p = (WCHAR*) str; + p = (WCHAR*)str; return p; } @@ -226,7 +225,7 @@ LPSTR CharUpperA(LPSTR lpsz) length = strlen(lpsz); if (length < 1) - return (LPSTR) NULL; + return (LPSTR)NULL; if (length == 1) { @@ -251,7 +250,7 @@ LPSTR CharUpperA(LPSTR lpsz) LPWSTR CharUpperW(LPWSTR lpsz) { WLog_ERR(TAG, "CharUpperW unimplemented!"); - return (LPWSTR) NULL; + return (LPWSTR)NULL; } DWORD CharUpperBuffA(LPSTR lpsz, DWORD cchLength) @@ -291,12 +290,12 @@ LPSTR CharLowerA(LPSTR lpsz) size_t length; if (!lpsz) - return (LPSTR) NULL; + return (LPSTR)NULL; length = strlen(lpsz); if (length < 1) - return (LPSTR) NULL; + return (LPSTR)NULL; if (length == 1) { @@ -321,7 +320,7 @@ LPSTR CharLowerA(LPSTR lpsz) LPWSTR CharLowerW(LPWSTR lpsz) { WLog_ERR(TAG, "CharLowerW unimplemented!"); - return (LPWSTR) NULL; + return (LPWSTR)NULL; } DWORD CharLowerBuffA(LPSTR lpsz, DWORD cchLength) @@ -414,7 +413,7 @@ BOOL IsCharLowerW(WCHAR ch) int lstrlenA(LPCSTR lpString) { - return (int) strlen(lpString); + return (int)strlen(lpString); } int lstrlenW(LPCWSTR lpString) @@ -424,7 +423,7 @@ int lstrlenW(LPCWSTR lpString) if (!lpString) return 0; - p = (LPWSTR) lpString; + p = (LPWSTR)lpString; while (*p) p++; @@ -499,7 +498,7 @@ char* ConvertLineEndingToCRLF(const char* str, int* size) pInput++; } - newStr = (char*) malloc(*size + (count * 2) + 1); + newStr = (char*)malloc(*size + (count * 2) + 1); if (!newStr) return NULL; @@ -576,8 +575,7 @@ INT64 GetLine(char** lineptr, size_t* size, FILE* stream) if (c != EOF) (*lineptr)[used++] = c; - } - while ((c != '\n') && (c != '\r') && (c != EOF)); + } while ((c != '\n') && (c != '\r') && (c != EOF)); (*lineptr)[used] = '\0'; return used; diff --git a/winpr/libwinpr/crt/test/TestAlignment.c b/winpr/libwinpr/crt/test/TestAlignment.c index 37dafd98f..80986478f 100644 --- a/winpr/libwinpr/crt/test/TestAlignment.c +++ b/winpr/libwinpr/crt/test/TestAlignment.c @@ -24,22 +24,22 @@ int TestAlignment(int argc, char* argv[]) return -1; } - if (((size_t) ptr % alignment) != 0) + if (((size_t)ptr % alignment) != 0) { - printf("This pointer, %p, is not aligned on %"PRIuz"\n", ptr, alignment); + printf("This pointer, %p, is not aligned on %" PRIuz "\n", ptr, alignment); return -1; } /* _aligned_realloc */ - + ptr = _aligned_realloc(ptr, 200, alignment); - - if (((size_t) ptr % alignment) != 0) + + if (((size_t)ptr % alignment) != 0) { - printf("This pointer, %p, is not aligned on %"PRIuz"\n", ptr, alignment); + printf("This pointer, %p, is not aligned on %" PRIuz "\n", ptr, alignment); return -1; } - + _aligned_free(ptr); /* _aligned_offset_malloc */ @@ -52,31 +52,33 @@ int TestAlignment(int argc, char* argv[]) return -1; } - if (((((size_t) ptr) + offset) % alignment) != 0) + if (((((size_t)ptr) + offset) % alignment) != 0) { - printf("This pointer, %p, does not satisfy offset %"PRIuz" and alignment %"PRIuz"\n", ptr, offset, alignment); + printf("This pointer, %p, does not satisfy offset %" PRIuz " and alignment %" PRIuz "\n", + ptr, offset, alignment); return -1; } /* _aligned_offset_realloc */ ptr = _aligned_offset_realloc(ptr, 200, alignment, offset); - + if (ptr == NULL) { printf("Error reallocating aligned offset memory."); return -1; } - if (((((size_t) ptr) + offset) % alignment) != 0) + if (((((size_t)ptr) + offset) % alignment) != 0) { - printf("This pointer, %p, does not satisfy offset %"PRIuz" and alignment %"PRIuz"\n", ptr, offset, alignment); + printf("This pointer, %p, does not satisfy offset %" PRIuz " and alignment %" PRIuz "\n", + ptr, offset, alignment); return -1; } - /* _aligned_free works for both _aligned_malloc and _aligned_offset_malloc. free() should not be used. */ + /* _aligned_free works for both _aligned_malloc and _aligned_offset_malloc. free() should not be + * used. */ _aligned_free(ptr); return 0; } - diff --git a/winpr/libwinpr/crt/test/TestFormatSpecifiers.c b/winpr/libwinpr/crt/test/TestFormatSpecifiers.c index 1e325e7d4..7a3da4c1b 100644 --- a/winpr/libwinpr/crt/test/TestFormatSpecifiers.c +++ b/winpr/libwinpr/crt/test/TestFormatSpecifiers.c @@ -2,7 +2,6 @@ #include #include - int TestFormatSpecifiers(int argc, char* argv[]) { unsigned errors = 0; @@ -12,135 +11,148 @@ int TestFormatSpecifiers(int argc, char* argv[]) /* size_t */ { size_t arg = 0xabcd; - const char *chk = "uz:43981 oz:125715 xz:abcd Xz:ABCD"; + const char* chk = "uz:43981 oz:125715 xz:abcd Xz:ABCD"; - sprintf_s(fmt, sizeof(fmt), - "uz:%" PRIuz " oz:%" PRIoz " xz:%" PRIxz " Xz:%" PRIXz"", arg, arg, arg, arg); + sprintf_s(fmt, sizeof(fmt), "uz:%" PRIuz " oz:%" PRIoz " xz:%" PRIxz " Xz:%" PRIXz "", arg, + arg, arg, arg); if (strcmp(fmt, chk)) { - fprintf(stderr, "%s failed size_t test: got [%s] instead of [%s]\n", __FUNCTION__, fmt, chk); - errors ++; + fprintf(stderr, "%s failed size_t test: got [%s] instead of [%s]\n", __FUNCTION__, fmt, + chk); + errors++; } } /* INT8 */ { INT8 arg = -16; - const char *chk = "d8:-16 x8:f0 X8:F0"; + const char* chk = "d8:-16 x8:f0 X8:F0"; - sprintf_s(fmt, sizeof(fmt), - "d8:%" PRId8 " x8:%" PRIx8 " X8:%" PRIX8"", arg, (UINT8) arg, (UINT8) arg); + sprintf_s(fmt, sizeof(fmt), "d8:%" PRId8 " x8:%" PRIx8 " X8:%" PRIX8 "", arg, (UINT8)arg, + (UINT8)arg); if (strcmp(fmt, chk)) { - fprintf(stderr, "%s failed INT8 test: got [%s] instead of [%s]\n", __FUNCTION__, fmt, chk); - errors ++; + fprintf(stderr, "%s failed INT8 test: got [%s] instead of [%s]\n", __FUNCTION__, fmt, + chk); + errors++; } } /* UINT8 */ { UINT8 arg = 0xFE; - const char *chk = "u8:254 o8:376 x8:fe X8:FE"; + const char* chk = "u8:254 o8:376 x8:fe X8:FE"; - sprintf_s(fmt, sizeof(fmt), - "u8:%" PRIu8 " o8:%" PRIo8 " x8:%" PRIx8 " X8:%" PRIX8"", arg, arg, arg, arg); + sprintf_s(fmt, sizeof(fmt), "u8:%" PRIu8 " o8:%" PRIo8 " x8:%" PRIx8 " X8:%" PRIX8 "", arg, + arg, arg, arg); if (strcmp(fmt, chk)) { - fprintf(stderr, "%s failed UINT8 test: got [%s] instead of [%s]\n", __FUNCTION__, fmt, chk); - errors ++; + fprintf(stderr, "%s failed UINT8 test: got [%s] instead of [%s]\n", __FUNCTION__, fmt, + chk); + errors++; } } /* INT16 */ { INT16 arg = -16; - const char *chk = "d16:-16 x16:fff0 X16:FFF0"; + const char* chk = "d16:-16 x16:fff0 X16:FFF0"; - sprintf_s(fmt, sizeof(fmt), - "d16:%" PRId16 " x16:%" PRIx16 " X16:%" PRIX16"", arg, (UINT16) arg, (UINT16) arg); + sprintf_s(fmt, sizeof(fmt), "d16:%" PRId16 " x16:%" PRIx16 " X16:%" PRIX16 "", arg, + (UINT16)arg, (UINT16)arg); if (strcmp(fmt, chk)) { - fprintf(stderr, "%s failed INT16 test: got [%s] instead of [%s]\n", __FUNCTION__, fmt, chk); - errors ++; + fprintf(stderr, "%s failed INT16 test: got [%s] instead of [%s]\n", __FUNCTION__, fmt, + chk); + errors++; } } /* UINT16 */ { UINT16 arg = 0xFFFE; - const char *chk = "u16:65534 o16:177776 x16:fffe X16:FFFE"; + const char* chk = "u16:65534 o16:177776 x16:fffe X16:FFFE"; sprintf_s(fmt, sizeof(fmt), - "u16:%" PRIu16 " o16:%" PRIo16 " x16:%" PRIx16 " X16:%" PRIX16"", arg, arg, arg, arg); + "u16:%" PRIu16 " o16:%" PRIo16 " x16:%" PRIx16 " X16:%" PRIX16 "", arg, arg, arg, + arg); if (strcmp(fmt, chk)) { - fprintf(stderr, "%s failed UINT16 test: got [%s] instead of [%s]\n", __FUNCTION__, fmt, chk); - errors ++; + fprintf(stderr, "%s failed UINT16 test: got [%s] instead of [%s]\n", __FUNCTION__, fmt, + chk); + errors++; } } /* INT32 */ { INT32 arg = -16; - const char *chk = "d32:-16 x32:fffffff0 X32:FFFFFFF0"; + const char* chk = "d32:-16 x32:fffffff0 X32:FFFFFFF0"; - sprintf_s(fmt, sizeof(fmt), - "d32:%" PRId32 " x32:%" PRIx32 " X32:%" PRIX32"", arg, (UINT32) arg, (UINT32) arg); + sprintf_s(fmt, sizeof(fmt), "d32:%" PRId32 " x32:%" PRIx32 " X32:%" PRIX32 "", arg, + (UINT32)arg, (UINT32)arg); if (strcmp(fmt, chk)) { - fprintf(stderr, "%s failed INT32 test: got [%s] instead of [%s]\n", __FUNCTION__, fmt, chk); - errors ++; + fprintf(stderr, "%s failed INT32 test: got [%s] instead of [%s]\n", __FUNCTION__, fmt, + chk); + errors++; } } /* UINT32 */ { UINT32 arg = 0xFFFFFFFE; - const char *chk = "u32:4294967294 o32:37777777776 x32:fffffffe X32:FFFFFFFE"; + const char* chk = "u32:4294967294 o32:37777777776 x32:fffffffe X32:FFFFFFFE"; sprintf_s(fmt, sizeof(fmt), - "u32:%" PRIu32 " o32:%" PRIo32 " x32:%" PRIx32 " X32:%" PRIX32"", arg, arg, arg, arg); + "u32:%" PRIu32 " o32:%" PRIo32 " x32:%" PRIx32 " X32:%" PRIX32 "", arg, arg, arg, + arg); if (strcmp(fmt, chk)) { - fprintf(stderr, "%s failed UINT16 test: got [%s] instead of [%s]\n", __FUNCTION__, fmt, chk); - errors ++; + fprintf(stderr, "%s failed UINT16 test: got [%s] instead of [%s]\n", __FUNCTION__, fmt, + chk); + errors++; } } /* INT64 */ { INT64 arg = -16; - const char *chk = "d64:-16 x64:fffffffffffffff0 X64:FFFFFFFFFFFFFFF0"; + const char* chk = "d64:-16 x64:fffffffffffffff0 X64:FFFFFFFFFFFFFFF0"; - sprintf_s(fmt, sizeof(fmt), - "d64:%" PRId64 " x64:%" PRIx64 " X64:%" PRIX64"", arg, (UINT64) arg, (UINT64) arg); + sprintf_s(fmt, sizeof(fmt), "d64:%" PRId64 " x64:%" PRIx64 " X64:%" PRIX64 "", arg, + (UINT64)arg, (UINT64)arg); if (strcmp(fmt, chk)) { - fprintf(stderr, "%s failed INT64 test: got [%s] instead of [%s]\n", __FUNCTION__, fmt, chk); - errors ++; + fprintf(stderr, "%s failed INT64 test: got [%s] instead of [%s]\n", __FUNCTION__, fmt, + chk); + errors++; } } /* UINT64 */ { UINT64 arg = 0xFFFFFFFFFFFFFFFE; - const char *chk = "u64:18446744073709551614 o64:1777777777777777777776 x64:fffffffffffffffe X64:FFFFFFFFFFFFFFFE"; + const char* chk = "u64:18446744073709551614 o64:1777777777777777777776 " + "x64:fffffffffffffffe X64:FFFFFFFFFFFFFFFE"; sprintf_s(fmt, sizeof(fmt), - "u64:%" PRIu64 " o64:%" PRIo64 " x64:%016" PRIx64 " X64:%016" PRIX64"", arg, arg, arg, arg); + "u64:%" PRIu64 " o64:%" PRIo64 " x64:%016" PRIx64 " X64:%016" PRIX64 "", arg, arg, + arg, arg); if (strcmp(fmt, chk)) { - fprintf(stderr, "%s failed UINT64 test: got [%s] instead of [%s]\n", __FUNCTION__, fmt, chk); - errors ++; + fprintf(stderr, "%s failed UINT64 test: got [%s] instead of [%s]\n", __FUNCTION__, fmt, + chk); + errors++; } } @@ -152,4 +164,3 @@ int TestFormatSpecifiers(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/crt/test/TestString.c b/winpr/libwinpr/crt/test/TestString.c index e4e5b26be..df154fe1c 100644 --- a/winpr/libwinpr/crt/test/TestString.c +++ b/winpr/libwinpr/crt/test/TestString.c @@ -3,35 +3,29 @@ #include #include -static WCHAR testStringW[] = -{ - 'T', 'h', 'e', ' ', 'q', 'u', 'i', 'c', 'k', ' ', 'b', 'r', 'o', 'w', 'n', ' ', - 'f', 'o', 'x', ' ', 'j', 'u', 'm', 'p', 's', ' ', 'o', 'v', 'e', 'r', ' ', - 't', 'h', 'e', ' ', 'l', 'a', 'z', 'y', ' ', 'd', 'o', 'g', '\0' -}; +static WCHAR testStringW[] = { 'T', 'h', 'e', ' ', 'q', 'u', 'i', 'c', 'k', ' ', 'b', + 'r', 'o', 'w', 'n', ' ', 'f', 'o', 'x', ' ', 'j', 'u', + 'm', 'p', 's', ' ', 'o', 'v', 'e', 'r', ' ', 't', 'h', + 'e', ' ', 'l', 'a', 'z', 'y', ' ', 'd', 'o', 'g', '\0' }; -#define testStringW_Length ((sizeof(testStringW) / sizeof(WCHAR)) - 1) +#define testStringW_Length ((sizeof(testStringW) / sizeof(WCHAR)) - 1) -static WCHAR testToken1W[] = { 'q', 'u', 'i', 'c', 'k', '\0' }; -static WCHAR testToken2W[] = { 'b', 'r', 'o', 'w', 'n', '\0' }; +static WCHAR testToken1W[] = { 'q', 'u', 'i', 'c', 'k', '\0' }; +static WCHAR testToken2W[] = { 'b', 'r', 'o', 'w', 'n', '\0' }; static WCHAR testToken3W[] = { 'f', 'o', 'x', '\0' }; -#define testToken1W_Length ((sizeof(testToken1W) / sizeof(WCHAR)) - 1) -#define testToken2W_Length ((sizeof(testToken2W) / sizeof(WCHAR)) - 1) -#define testToken3W_Length ((sizeof(testToken3W) / sizeof(WCHAR)) - 1) +#define testToken1W_Length ((sizeof(testToken1W) / sizeof(WCHAR)) - 1) +#define testToken2W_Length ((sizeof(testToken2W) / sizeof(WCHAR)) - 1) +#define testToken3W_Length ((sizeof(testToken3W) / sizeof(WCHAR)) - 1) -static WCHAR testTokensW[] = -{ - 'q', 'u', 'i', 'c', 'k', '\r', '\n', - 'b', 'r', 'o', 'w', 'n', '\r', '\n', - 'f', 'o', 'x', '\r', '\n', '\0' -}; +static WCHAR testTokensW[] = { 'q', 'u', 'i', 'c', 'k', '\r', '\n', 'b', 'r', 'o', + 'w', 'n', '\r', '\n', 'f', 'o', 'x', '\r', '\n', '\0' }; -#define testTokensW_Length ((sizeof(testTokensW) / sizeof(WCHAR)) - 1) +#define testTokensW_Length ((sizeof(testTokensW) / sizeof(WCHAR)) - 1) static WCHAR testDelimiter[] = { '\r', '\n', '\0' }; -#define testDelimiter_Length ((sizeof(testDelimiter) / sizeof(WCHAR)) - 1) +#define testDelimiter_Length ((sizeof(testDelimiter) / sizeof(WCHAR)) - 1) int TestString(int argc, char* argv[]) { @@ -56,7 +50,8 @@ int TestString(int argc, char* argv[]) if (length != testStringW_Length) { - printf("_wcslen error: length mismatch: Actual: %"PRIuz", Expected: %"PRIuz"\n", length, testStringW_Length); + printf("_wcslen error: length mismatch: Actual: %" PRIuz ", Expected: %" PRIuz "\n", length, + testStringW_Length); return -1; } @@ -67,7 +62,7 @@ int TestString(int argc, char* argv[]) if (pos != 11) { - printf("_wcschr error: position mismatch: Actual: %"PRIuz", Expected: 11\n", pos); + printf("_wcschr error: position mismatch: Actual: %" PRIuz ", Expected: 11\n", pos); return -1; } @@ -76,7 +71,7 @@ int TestString(int argc, char* argv[]) if (pos != 29) { - printf("_wcschr error: position mismatch: Actual: %"PRIuz", Expected: 29\n", pos); + printf("_wcschr error: position mismatch: Actual: %" PRIuz ", Expected: 29\n", pos); return -1; } @@ -84,7 +79,7 @@ int TestString(int argc, char* argv[]) if (p != NULL) { - printf("_wcschr error: return value mismatch: Actual: %p, Expected: NULL\n", (void*) p); + printf("_wcschr error: return value mismatch: Actual: %p, Expected: NULL\n", (void*)p); return -1; } @@ -124,4 +119,3 @@ int TestString(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/crt/test/TestTypes.c b/winpr/libwinpr/crt/test/TestTypes.c index 2ab32fd84..5b73bd0ee 100644 --- a/winpr/libwinpr/crt/test/TestTypes.c +++ b/winpr/libwinpr/crt/test/TestTypes.c @@ -3,51 +3,52 @@ #include #include -#define EXPECTED_SIZEOF_BYTE 1 -#define EXPECTED_SIZEOF_BOOLEAN 1 -#define EXPECTED_SIZEOF_CHAR 1 -#define EXPECTED_SIZEOF_UCHAR 1 -#define EXPECTED_SIZEOF_INT8 1 -#define EXPECTED_SIZEOF_UINT8 1 -#define EXPECTED_SIZEOF_INT16 2 -#define EXPECTED_SIZEOF_UINT16 2 -#define EXPECTED_SIZEOF_WORD 2 -#define EXPECTED_SIZEOF_WCHAR 2 -#define EXPECTED_SIZEOF_SHORT 2 -#define EXPECTED_SIZEOF_USHORT 2 -#define EXPECTED_SIZEOF_BOOL 4 -#define EXPECTED_SIZEOF_INT 4 -#define EXPECTED_SIZEOF_UINT 4 -#define EXPECTED_SIZEOF_INT32 4 -#define EXPECTED_SIZEOF_UINT32 4 -#define EXPECTED_SIZEOF_DWORD 4 -#define EXPECTED_SIZEOF_DWORD32 4 -#define EXPECTED_SIZEOF_LONG 4 -#define EXPECTED_SIZEOF_LONG32 4 -#define EXPECTED_SIZEOF_INT64 8 -#define EXPECTED_SIZEOF_UINT64 8 -#define EXPECTED_SIZEOF_DWORD64 8 -#define EXPECTED_SIZEOF_DWORDLONG 8 -#define EXPECTED_SIZEOF_LONG64 8 -#define EXPECTED_SIZEOF_ULONGLONG 8 -#define EXPECTED_SIZEOF_LUID 8 -#define EXPECTED_SIZEOF_FILETIME 8 -#define EXPECTED_SIZEOF_LARGE_INTEGER 8 -#define EXPECTED_SIZEOF_ULARGE_INTEGER 8 -#define EXPECTED_SIZEOF_GUID 16 -#define EXPECTED_SIZEOF_SYSTEMTIME 16 -#define EXPECTED_SIZEOF_SIZE_T sizeof(void*) -#define EXPECTED_SIZEOF_INT_PTR sizeof(void*) -#define EXPECTED_SIZEOF_UINT_PTR sizeof(void*) -#define EXPECTED_SIZEOF_DWORD_PTR sizeof(void*) -#define EXPECTED_SIZEOF_LONG_PTR sizeof(void*) -#define EXPECTED_SIZEOF_ULONG_PTR sizeof(void*) +#define EXPECTED_SIZEOF_BYTE 1 +#define EXPECTED_SIZEOF_BOOLEAN 1 +#define EXPECTED_SIZEOF_CHAR 1 +#define EXPECTED_SIZEOF_UCHAR 1 +#define EXPECTED_SIZEOF_INT8 1 +#define EXPECTED_SIZEOF_UINT8 1 +#define EXPECTED_SIZEOF_INT16 2 +#define EXPECTED_SIZEOF_UINT16 2 +#define EXPECTED_SIZEOF_WORD 2 +#define EXPECTED_SIZEOF_WCHAR 2 +#define EXPECTED_SIZEOF_SHORT 2 +#define EXPECTED_SIZEOF_USHORT 2 +#define EXPECTED_SIZEOF_BOOL 4 +#define EXPECTED_SIZEOF_INT 4 +#define EXPECTED_SIZEOF_UINT 4 +#define EXPECTED_SIZEOF_INT32 4 +#define EXPECTED_SIZEOF_UINT32 4 +#define EXPECTED_SIZEOF_DWORD 4 +#define EXPECTED_SIZEOF_DWORD32 4 +#define EXPECTED_SIZEOF_LONG 4 +#define EXPECTED_SIZEOF_LONG32 4 +#define EXPECTED_SIZEOF_INT64 8 +#define EXPECTED_SIZEOF_UINT64 8 +#define EXPECTED_SIZEOF_DWORD64 8 +#define EXPECTED_SIZEOF_DWORDLONG 8 +#define EXPECTED_SIZEOF_LONG64 8 +#define EXPECTED_SIZEOF_ULONGLONG 8 +#define EXPECTED_SIZEOF_LUID 8 +#define EXPECTED_SIZEOF_FILETIME 8 +#define EXPECTED_SIZEOF_LARGE_INTEGER 8 +#define EXPECTED_SIZEOF_ULARGE_INTEGER 8 +#define EXPECTED_SIZEOF_GUID 16 +#define EXPECTED_SIZEOF_SYSTEMTIME 16 +#define EXPECTED_SIZEOF_SIZE_T sizeof(void*) +#define EXPECTED_SIZEOF_INT_PTR sizeof(void*) +#define EXPECTED_SIZEOF_UINT_PTR sizeof(void*) +#define EXPECTED_SIZEOF_DWORD_PTR sizeof(void*) +#define EXPECTED_SIZEOF_LONG_PTR sizeof(void*) +#define EXPECTED_SIZEOF_ULONG_PTR sizeof(void*) -#define TEST_SIZEOF_TYPE(_name) \ - if (sizeof(_name) != EXPECTED_SIZEOF_ ##_name) { \ - fprintf(stderr, "sizeof(%s) mismatch: Actual: %"PRIuz", Expected: %"PRIuz"\n", \ - #_name, sizeof(_name), (size_t) EXPECTED_SIZEOF_ ##_name); \ - status = -1; \ +#define TEST_SIZEOF_TYPE(_name) \ + if (sizeof(_name) != EXPECTED_SIZEOF_##_name) \ + { \ + fprintf(stderr, "sizeof(%s) mismatch: Actual: %" PRIuz ", Expected: %" PRIuz "\n", #_name, \ + sizeof(_name), (size_t)EXPECTED_SIZEOF_##_name); \ + status = -1; \ } int TestTypes(int argc, char* argv[]) @@ -71,7 +72,7 @@ int TestTypes(int argc, char* argv[]) TEST_SIZEOF_TYPE(USHORT) /* fails on OS X */ - //TEST_SIZEOF_TYPE(BOOL) + // TEST_SIZEOF_TYPE(BOOL) TEST_SIZEOF_TYPE(INT) TEST_SIZEOF_TYPE(UINT) @@ -109,4 +110,3 @@ int TestTypes(int argc, char* argv[]) return status; } - diff --git a/winpr/libwinpr/crt/test/TestUnicodeConversion.c b/winpr/libwinpr/crt/test/TestUnicodeConversion.c index 6f919998c..5b0f5e478 100644 --- a/winpr/libwinpr/crt/test/TestUnicodeConversion.c +++ b/winpr/libwinpr/crt/test/TestUnicodeConversion.c @@ -19,8 +19,9 @@ static int en_Hello_cchWideChar = 6; static int en_Hello_cbMultiByte = 6; static BYTE en_HowAreYou_UTF8[] = "How are you?\0"; -static BYTE en_HowAreYou_UTF16[] = "\x48\x00\x6F\x00\x77\x00\x20\x00\x61\x00\x72\x00\x65\x00\x20\x00" - "\x79\x00\x6F\x00\x75\x00\x3F\x00\x00\x00"; +static BYTE en_HowAreYou_UTF16[] = + "\x48\x00\x6F\x00\x77\x00\x20\x00\x61\x00\x72\x00\x65\x00\x20\x00" + "\x79\x00\x6F\x00\x75\x00\x3F\x00\x00\x00"; static int en_HowAreYou_cchWideChar = 13; static int en_HowAreYou_cbMultiByte = 13; @@ -31,9 +32,11 @@ static BYTE fr_Hello_UTF16[] = "\x41\x00\x6C\x00\x6C\x00\x6F\x00\x00\x00"; static int fr_Hello_cchWideChar = 5; static int fr_Hello_cbMultiByte = 5; -static BYTE fr_HowAreYou_UTF8[] = "\x43\x6F\x6D\x6D\x65\x6E\x74\x20\xC3\xA7\x61\x20\x76\x61\x3F\x00"; -static BYTE fr_HowAreYou_UTF16[] = "\x43\x00\x6F\x00\x6D\x00\x6D\x00\x65\x00\x6E\x00\x74\x00\x20\x00" - "\xE7\x00\x61\x00\x20\x00\x76\x00\x61\x00\x3F\x00\x00\x00"; +static BYTE fr_HowAreYou_UTF8[] = + "\x43\x6F\x6D\x6D\x65\x6E\x74\x20\xC3\xA7\x61\x20\x76\x61\x3F\x00"; +static BYTE fr_HowAreYou_UTF16[] = + "\x43\x00\x6F\x00\x6D\x00\x6D\x00\x65\x00\x6E\x00\x74\x00\x20\x00" + "\xE7\x00\x61\x00\x20\x00\x76\x00\x61\x00\x3F\x00\x00\x00"; static int fr_HowAreYou_cchWideChar = 15; static int fr_HowAreYou_cbMultiByte = 16; @@ -44,25 +47,28 @@ static BYTE ru_Hello_UTF16[] = "\x17\x04\x34\x04\x3E\x04\x40\x04\x3E\x04\x32\x04 static int ru_Hello_cchWideChar = 8; static int ru_Hello_cbMultiByte = 15; -static BYTE ru_HowAreYou_UTF8[] = "\xD0\x9A\xD0\xB0\xD0\xBA\x20\xD0\xB4\xD0\xB5\xD0\xBB\xD0\xB0\x3F\x00"; -static BYTE ru_HowAreYou_UTF16[] = "\x1A\x04\x30\x04\x3A\x04\x20\x00\x34\x04\x35\x04\x3B\x04\x30\x04" - "\x3F\x00\x00\x00"; +static BYTE ru_HowAreYou_UTF8[] = + "\xD0\x9A\xD0\xB0\xD0\xBA\x20\xD0\xB4\xD0\xB5\xD0\xBB\xD0\xB0\x3F\x00"; +static BYTE ru_HowAreYou_UTF16[] = + "\x1A\x04\x30\x04\x3A\x04\x20\x00\x34\x04\x35\x04\x3B\x04\x30\x04" + "\x3F\x00\x00\x00"; static int ru_HowAreYou_cchWideChar = 10; static int ru_HowAreYou_cbMultiByte = 17; /* Arabic */ static BYTE ar_Hello_UTF8[] = "\xD8\xA7\xD9\x84\xD8\xB3\xD9\x84\xD8\xA7\xD9\x85\x20\xD8\xB9\xD9" - "\x84\xD9\x8A\xD9\x83\xD9\x85\x00"; + "\x84\xD9\x8A\xD9\x83\xD9\x85\x00"; static BYTE ar_Hello_UTF16[] = "\x27\x06\x44\x06\x33\x06\x44\x06\x27\x06\x45\x06\x20\x00\x39\x06" - "\x44\x06\x4A\x06\x43\x06\x45\x06\x00\x00"; + "\x44\x06\x4A\x06\x43\x06\x45\x06\x00\x00"; static int ar_Hello_cchWideChar = 13; static int ar_Hello_cbMultiByte = 24; static BYTE ar_HowAreYou_UTF8[] = "\xD9\x83\xD9\x8A\xD9\x81\x20\xD8\xAD\xD8\xA7\xD9\x84\xD9\x83\xD8" - "\x9F\x00"; -static BYTE ar_HowAreYou_UTF16[] = "\x43\x06\x4A\x06\x41\x06\x20\x00\x2D\x06\x27\x06\x44\x06\x43\x06" - "\x1F\x06\x00\x00"; + "\x9F\x00"; +static BYTE ar_HowAreYou_UTF16[] = + "\x43\x06\x4A\x06\x41\x06\x20\x00\x2D\x06\x27\x06\x44\x06\x43\x06" + "\x1F\x06\x00\x00"; static int ar_HowAreYou_cchWideChar = 10; static int ar_HowAreYou_cbMultiByte = 18; @@ -80,11 +86,11 @@ static int ch_HowAreYou_cbMultiByte = 10; /* Uppercasing */ -static BYTE ru_Administrator_lower[] = - "\xd0\x90\xd0\xb4\xd0\xbc\xd0\xb8\xd0\xbd\xd0\xb8\xd1\x81\xd1\x82\xd1\x80\xd0\xb0\xd1\x82\xd0\xbe\xd1\x80\x00"; +static BYTE ru_Administrator_lower[] = "\xd0\x90\xd0\xb4\xd0\xbc\xd0\xb8\xd0\xbd\xd0\xb8\xd1\x81" + "\xd1\x82\xd1\x80\xd0\xb0\xd1\x82\xd0\xbe\xd1\x80\x00"; -static BYTE ru_Administrator_upper[] = - "\xd0\x90\xd0\x94\xd0\x9c\xd0\x98\xd0\x9d\xd0\x98\xd0\xa1\xd0\xa2\xd0\xa0\xd0\x90\xd0\xa2\xd0\x9e\xd0\xa0\x00"; +static BYTE ru_Administrator_upper[] = "\xd0\x90\xd0\x94\xd0\x9c\xd0\x98\xd0\x9d\xd0\x98\xd0\xa1" + "\xd0\xa2\xd0\xa0\xd0\x90\xd0\xa2\xd0\x9e\xd0\xa0\x00"; static void string_hexdump(const BYTE* data, size_t length) { @@ -93,7 +99,7 @@ static void string_hexdump(const BYTE* data, size_t length) while (offset < length) { - printf("%04"PRIxz" ", offset); + printf("%04" PRIxz " ", offset); line = length - offset; @@ -101,13 +107,13 @@ static void string_hexdump(const BYTE* data, size_t length) line = 16; for (i = 0; i < line; i++) - printf("%02"PRIx8" ", p[i]); + printf("%02" PRIx8 " ", p[i]); for (; i < 16; i++) printf(" "); for (i = 0; i < line; i++) - printf("%c", (p[i] >= 0x20 && p[i] < 0x7F) ? (char) p[i] : '.'); + printf("%c", (p[i] >= 0x20 && p[i] < 0x7F) ? (char)p[i] : '.'); printf("\n"); @@ -116,7 +122,8 @@ static void string_hexdump(const BYTE* data, size_t length) } } -static int convert_utf8_to_utf16(BYTE* lpMultiByteStr, BYTE* expected_lpWideCharStr, int expected_cchWideChar) +static int convert_utf8_to_utf16(BYTE* lpMultiByteStr, BYTE* expected_lpWideCharStr, + int expected_cchWideChar) { int rc = -1; int length; @@ -124,8 +131,8 @@ static int convert_utf8_to_utf16(BYTE* lpMultiByteStr, BYTE* expected_lpWideChar int cchWideChar; LPWSTR lpWideCharStr = NULL; - cbMultiByte = strlen((char*) lpMultiByteStr); - cchWideChar = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR) lpMultiByteStr, -1, NULL, 0); + cbMultiByte = strlen((char*)lpMultiByteStr); + cchWideChar = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)lpMultiByteStr, -1, NULL, 0); printf("MultiByteToWideChar Input UTF8 String:\n"); string_hexdump(lpMultiByteStr, cbMultiByte + 1); @@ -134,37 +141,39 @@ static int convert_utf8_to_utf16(BYTE* lpMultiByteStr, BYTE* expected_lpWideChar if (cchWideChar != expected_cchWideChar) { - printf("MultiByteToWideChar unexpected cchWideChar: actual: %d expected: %d\n", - cchWideChar, expected_cchWideChar); + printf("MultiByteToWideChar unexpected cchWideChar: actual: %d expected: %d\n", cchWideChar, + expected_cchWideChar); goto fail; } - lpWideCharStr = (LPWSTR) calloc((size_t)cchWideChar, sizeof(WCHAR)); + lpWideCharStr = (LPWSTR)calloc((size_t)cchWideChar, sizeof(WCHAR)); if (!lpWideCharStr) { printf("MultiByteToWideChar: unable to allocate memory for test\n"); goto fail; } - lpWideCharStr[cchWideChar - 1] = 0xFFFF; /* should be overwritten if null terminator is inserted properly */ - length = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR) lpMultiByteStr, cbMultiByte + 1, lpWideCharStr, cchWideChar); + lpWideCharStr[cchWideChar - 1] = + 0xFFFF; /* should be overwritten if null terminator is inserted properly */ + length = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)lpMultiByteStr, cbMultiByte + 1, lpWideCharStr, + cchWideChar); printf("MultiByteToWideChar converted length (WCHAR): %d\n", length); if (!length) { DWORD error = GetLastError(); - printf("MultiByteToWideChar error: 0x%08"PRIX32"\n", error); + printf("MultiByteToWideChar error: 0x%08" PRIX32 "\n", error); goto fail; } if (length != expected_cchWideChar) { printf("MultiByteToWideChar unexpected converted length (WCHAR): actual: %d expected: %d\n", - length, expected_cchWideChar); + length, expected_cchWideChar); goto fail; } - if (_wcscmp(lpWideCharStr, (WCHAR*) expected_lpWideCharStr) != 0) + if (_wcscmp(lpWideCharStr, (WCHAR*)expected_lpWideCharStr) != 0) { printf("MultiByteToWideChar unexpected string:\n"); @@ -172,16 +181,16 @@ static int convert_utf8_to_utf16(BYTE* lpMultiByteStr, BYTE* expected_lpWideChar string_hexdump(lpMultiByteStr, cbMultiByte + 1); printf("UTF16 String (actual):\n"); - string_hexdump((BYTE*) lpWideCharStr, length * sizeof(WCHAR)); + string_hexdump((BYTE*)lpWideCharStr, length * sizeof(WCHAR)); printf("UTF16 String (expected):\n"); - string_hexdump((BYTE*) expected_lpWideCharStr, expected_cchWideChar * sizeof(WCHAR)); + string_hexdump((BYTE*)expected_lpWideCharStr, expected_cchWideChar * sizeof(WCHAR)); goto fail; } printf("MultiByteToWideChar Output UTF16 String:\n"); - string_hexdump((BYTE*) lpWideCharStr, length * sizeof(WCHAR)); + string_hexdump((BYTE*)lpWideCharStr, length * sizeof(WCHAR)); printf("\n"); rc = length; @@ -191,7 +200,8 @@ fail: return rc; } -static int convert_utf16_to_utf8(BYTE* lpWideCharStr, BYTE* expected_lpMultiByteStr, int expected_cbMultiByte) +static int convert_utf16_to_utf8(BYTE* lpWideCharStr, BYTE* expected_lpMultiByteStr, + int expected_cbMultiByte) { int rc = -1; int length; @@ -199,8 +209,8 @@ static int convert_utf16_to_utf8(BYTE* lpWideCharStr, BYTE* expected_lpMultiByte int cbMultiByte; LPSTR lpMultiByteStr = NULL; - cchWideChar = _wcslen((WCHAR*) lpWideCharStr); - cbMultiByte = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR) lpWideCharStr, -1, NULL, 0, NULL, NULL); + cchWideChar = _wcslen((WCHAR*)lpWideCharStr); + cbMultiByte = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR)lpWideCharStr, -1, NULL, 0, NULL, NULL); printf("WideCharToMultiByte Input UTF16 String:\n"); string_hexdump(lpWideCharStr, (cchWideChar + 1) * sizeof(WCHAR)); @@ -209,54 +219,56 @@ static int convert_utf16_to_utf8(BYTE* lpWideCharStr, BYTE* expected_lpMultiByte if (cbMultiByte != expected_cbMultiByte) { - printf("WideCharToMultiByte unexpected cbMultiByte: actual: %d expected: %d\n", - cbMultiByte, expected_cbMultiByte); + printf("WideCharToMultiByte unexpected cbMultiByte: actual: %d expected: %d\n", cbMultiByte, + expected_cbMultiByte); goto fail; } - lpMultiByteStr = (LPSTR) malloc(cbMultiByte); + lpMultiByteStr = (LPSTR)malloc(cbMultiByte); if (!lpMultiByteStr) { printf("WideCharToMultiByte: unable to allocate memory for test\n"); goto fail; } - lpMultiByteStr[cbMultiByte - 1] = (CHAR)0xFF; /* should be overwritten if null terminator is inserted properly */ - length = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR) lpWideCharStr, cchWideChar + 1, lpMultiByteStr, cbMultiByte, NULL, NULL); + lpMultiByteStr[cbMultiByte - 1] = + (CHAR)0xFF; /* should be overwritten if null terminator is inserted properly */ + length = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR)lpWideCharStr, cchWideChar + 1, + lpMultiByteStr, cbMultiByte, NULL, NULL); printf("WideCharToMultiByte converted length (BYTE): %d\n", length); if (!length) { DWORD error = GetLastError(); - printf("WideCharToMultiByte error: 0x%08"PRIX32"\n", error); + printf("WideCharToMultiByte error: 0x%08" PRIX32 "\n", error); goto fail; } if (length != expected_cbMultiByte) { printf("WideCharToMultiByte unexpected converted length (BYTE): actual: %d expected: %d\n", - length, expected_cbMultiByte); + length, expected_cbMultiByte); goto fail; } - if (strcmp(lpMultiByteStr, (char*) expected_lpMultiByteStr) != 0) + if (strcmp(lpMultiByteStr, (char*)expected_lpMultiByteStr) != 0) { printf("WideCharToMultiByte unexpected string:\n"); printf("UTF16 String:\n"); - string_hexdump((BYTE*) lpWideCharStr, (cchWideChar + 1) * sizeof(WCHAR)); + string_hexdump((BYTE*)lpWideCharStr, (cchWideChar + 1) * sizeof(WCHAR)); printf("UTF8 String (actual):\n"); - string_hexdump((BYTE*) lpMultiByteStr, cbMultiByte); + string_hexdump((BYTE*)lpMultiByteStr, cbMultiByte); printf("UTF8 String (expected):\n"); - string_hexdump((BYTE*) expected_lpMultiByteStr, expected_cbMultiByte); + string_hexdump((BYTE*)expected_lpMultiByteStr, expected_cbMultiByte); goto fail; } printf("WideCharToMultiByte Output UTF8 String:\n"); - string_hexdump((BYTE*) lpMultiByteStr, cbMultiByte); + string_hexdump((BYTE*)lpMultiByteStr, cbMultiByte); printf("\n"); rc = length; @@ -273,18 +285,18 @@ static BOOL test_unicode_uppercasing(BYTE* lower, BYTE* upper) WCHAR* upperW = NULL; int upperLength; - lowerLength = ConvertToUnicode(CP_UTF8, 0, (LPSTR) lower, -1, &lowerW, 0); - upperLength = ConvertToUnicode(CP_UTF8, 0, (LPSTR) upper, -1, &upperW, 0); + lowerLength = ConvertToUnicode(CP_UTF8, 0, (LPSTR)lower, -1, &lowerW, 0); + upperLength = ConvertToUnicode(CP_UTF8, 0, (LPSTR)upper, -1, &upperW, 0); CharUpperBuffW(lowerW, lowerLength); if (_wcscmp(lowerW, upperW) != 0) { printf("Lowercase String:\n"); - string_hexdump((BYTE*) lowerW, lowerLength * 2); + string_hexdump((BYTE*)lowerW, lowerLength * 2); printf("Uppercase String:\n"); - string_hexdump((BYTE*) upperW, upperLength * 2); + string_hexdump((BYTE*)upperW, upperLength * 2); return FALSE; } @@ -298,10 +310,14 @@ static BOOL test_unicode_uppercasing(BYTE* lower, BYTE* upper) static BOOL test_ConvertFromUnicode_wrapper(void) { - const BYTE src1[] = "\x52\x00\x49\x00\x43\x00\x48\x00\x20\x00\x54\x00\x45\x00\x58\x00\x54\x00\x20\x00\x46\x00\x4f\x00\x52\x00\x4d\x00\x41\x00\x54\x00\x40\x00\x40\x00\x40\x00"; - const BYTE src2[] = "\x52\x00\x49\x00\x43\x00\x48\x00\x20\x00\x54\x00\x45\x00\x58\x00\x54\x00\x20\x00\x46\x00\x4f\x00\x52\x00\x4d\x00\x41\x00\x54\x00\x00\x00"; + const BYTE src1[] = + "\x52\x00\x49\x00\x43\x00\x48\x00\x20\x00\x54\x00\x45\x00\x58\x00\x54\x00\x20\x00\x46\x00" + "\x4f\x00\x52\x00\x4d\x00\x41\x00\x54\x00\x40\x00\x40\x00\x40\x00"; + const BYTE src2[] = "\x52\x00\x49\x00\x43\x00\x48\x00\x20\x00\x54\x00\x45\x00\x58\x00\x54\x00" + "\x20\x00\x46\x00\x4f\x00\x52\x00\x4d\x00\x41\x00\x54\x00\x00\x00"; /* 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 */ - const CHAR cmp0[] = { 'R','I','C','H',' ','T','E','X','T',' ','F','O','R','M','A','T', 0 }; + const CHAR cmp0[] = { 'R', 'I', 'C', 'H', ' ', 'T', 'E', 'X', 'T', + ' ', 'F', 'O', 'R', 'M', 'A', 'T', 0 }; CHAR* dst = NULL; int i; @@ -310,12 +326,13 @@ static BOOL test_ConvertFromUnicode_wrapper(void) */ printf("Input UTF16 String:\n"); - string_hexdump((BYTE*) src1, 19 * sizeof(WCHAR)); + string_hexdump((BYTE*)src1, 19 * sizeof(WCHAR)); i = ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)src1, 16, &dst, 0, NULL, NULL); if (i != 16) { - fprintf(stderr, "ConvertFromUnicode failure A1: unexpectedly returned %d instead of 16\n", i); + fprintf(stderr, "ConvertFromUnicode failure A1: unexpectedly returned %d instead of 16\n", + i); goto fail; } if (dst == NULL) @@ -334,7 +351,7 @@ static BOOL test_ConvertFromUnicode_wrapper(void) goto fail; } printf("Output UTF8 String:\n"); - string_hexdump((BYTE*) dst, i + 1); + string_hexdump((BYTE*)dst, i + 1); free(dst); dst = NULL; @@ -342,12 +359,13 @@ static BOOL test_ConvertFromUnicode_wrapper(void) /* Test null-terminated string */ printf("Input UTF16 String:\n"); - string_hexdump((BYTE*) src2, (_wcslen((WCHAR*)src2) + 1 ) * sizeof(WCHAR)); + string_hexdump((BYTE*)src2, (_wcslen((WCHAR*)src2) + 1) * sizeof(WCHAR)); i = ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)src2, -1, &dst, 0, NULL, NULL); if (i != 17) { - fprintf(stderr, "ConvertFromUnicode failure B1: unexpectedly returned %d instead of 17\n", i); + fprintf(stderr, "ConvertFromUnicode failure B1: unexpectedly returned %d instead of 17\n", + i); goto fail; } if (dst == NULL) @@ -366,7 +384,7 @@ static BOOL test_ConvertFromUnicode_wrapper(void) goto fail; } printf("Output UTF8 String:\n"); - string_hexdump((BYTE*) dst, i + 1); + string_hexdump((BYTE*)dst, i + 1); free(dst); dst = NULL; @@ -383,9 +401,12 @@ fail: static BOOL test_ConvertToUnicode_wrapper(void) { /* 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 */ - const CHAR src1[] = { 'R','I','C','H',' ','T','E','X','T',' ','F','O','R','M','A','T','@','@','@' }; - const CHAR src2[] = { 'R','I','C','H',' ','T','E','X','T',' ','F','O','R','M','A','T', 0 }; - const BYTE cmp0[] = "\x52\x00\x49\x00\x43\x00\x48\x00\x20\x00\x54\x00\x45\x00\x58\x00\x54\x00\x20\x00\x46\x00\x4f\x00\x52\x00\x4d\x00\x41\x00\x54\x00\x00\x00"; + const CHAR src1[] = { 'R', 'I', 'C', 'H', ' ', 'T', 'E', 'X', 'T', ' ', + 'F', 'O', 'R', 'M', 'A', 'T', '@', '@', '@' }; + const CHAR src2[] = { 'R', 'I', 'C', 'H', ' ', 'T', 'E', 'X', 'T', + ' ', 'F', 'O', 'R', 'M', 'A', 'T', 0 }; + const BYTE cmp0[] = "\x52\x00\x49\x00\x43\x00\x48\x00\x20\x00\x54\x00\x45\x00\x58\x00\x54\x00" + "\x20\x00\x46\x00\x4f\x00\x52\x00\x4d\x00\x41\x00\x54\x00\x00\x00"; WCHAR* dst = NULL; int ii; size_t i; @@ -395,12 +416,13 @@ static BOOL test_ConvertToUnicode_wrapper(void) */ printf("Input UTF8 String:\n"); - string_hexdump((const BYTE*) src1, 19); + string_hexdump((const BYTE*)src1, 19); ii = ConvertToUnicode(CP_UTF8, 0, src1, 16, &dst, 0); if (ii != 16) { - fprintf(stderr, "ConvertToUnicode failure A1: unexpectedly returned %d instead of 16\n", ii); + fprintf(stderr, "ConvertToUnicode failure A1: unexpectedly returned %d instead of 16\n", + ii); goto fail; } i = (size_t)ii; @@ -420,7 +442,7 @@ static BOOL test_ConvertToUnicode_wrapper(void) goto fail; } printf("Output UTF16 String:\n"); - string_hexdump((const BYTE*) dst, (i + 1) * sizeof(WCHAR)); + string_hexdump((const BYTE*)dst, (i + 1) * sizeof(WCHAR)); free(dst); dst = NULL; @@ -428,7 +450,7 @@ static BOOL test_ConvertToUnicode_wrapper(void) /* Test null-terminated string */ printf("Input UTF8 String:\n"); - string_hexdump((const BYTE*) src2, strlen(src2) + 1); + string_hexdump((const BYTE*)src2, strlen(src2) + 1); i = ConvertToUnicode(CP_UTF8, 0, src2, -1, &dst, 0); if (i != 17) @@ -452,7 +474,7 @@ static BOOL test_ConvertToUnicode_wrapper(void) goto fail; } printf("Output UTF16 String:\n"); - string_hexdump((BYTE*) dst, (i + 1) * 2); + string_hexdump((BYTE*)dst, (i + 1) * 2); free(dst); dst = NULL; @@ -478,7 +500,6 @@ int TestUnicodeConversion(int argc, char* argv[]) if (convert_utf16_to_utf8(c_cedilla_UTF16, c_cedilla_UTF8, c_cedilla_cbMultiByte) < 1) return -1; - /* English */ printf("English\n"); @@ -569,31 +590,32 @@ int TestUnicodeConversion(int argc, char* argv[]) if (!test_ConvertToUnicode_wrapper()) return -1; -/* + /* - printf("----------------------------------------------------------\n\n"); + printf("----------------------------------------------------------\n\n"); - if (0) - { - BYTE src[] = { 'R',0,'I',0,'C',0,'H',0,' ',0, 'T',0,'E',0,'X',0,'T',0,' ',0,'F',0,'O',0,'R',0,'M',0,'A',0,'T',0,'@',0,'@',0 }; - //BYTE src[] = { 'R',0,'I',0,'C',0,'H',0,' ',0, 0,0, 'T',0,'E',0,'X',0,'T',0,' ',0,'F',0,'O',0,'R',0,'M',0,'A',0,'T',0,'@',0,'@',0 }; - //BYTE src[] = { 0,0,'R',0,'I',0,'C',0,'H',0,' ',0, 'T',0,'E',0,'X',0,'T',0,' ',0,'F',0,'O',0,'R',0,'M',0,'A',0,'T',0,'@',0,'@',0 }; - char* dst = NULL; - int num; - num = ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) src, 16, &dst, 0, NULL, NULL); - printf("ConvertFromUnicode returned %d dst=[%s]\n", num, dst); - string_hexdump((BYTE*)dst, num+1); - } - if (1) - { - char src[] = "RICH TEXT FORMAT@@@@@@"; - WCHAR *dst = NULL; - int num; - num = ConvertToUnicode(CP_UTF8, 0, src, 16, &dst, 0); - printf("ConvertToUnicode returned %d dst=%p\n", num, (void*) dst); - string_hexdump((BYTE*)dst, num * 2 + 2); + if (0) + { + BYTE src[] = { 'R',0,'I',0,'C',0,'H',0,' ',0, 'T',0,'E',0,'X',0,'T',0,' + ',0,'F',0,'O',0,'R',0,'M',0,'A',0,'T',0,'@',0,'@',0 }; + //BYTE src[] = { 'R',0,'I',0,'C',0,'H',0,' ',0, 0,0, 'T',0,'E',0,'X',0,'T',0,' + ',0,'F',0,'O',0,'R',0,'M',0,'A',0,'T',0,'@',0,'@',0 }; + //BYTE src[] = { 0,0,'R',0,'I',0,'C',0,'H',0,' ',0, 'T',0,'E',0,'X',0,'T',0,' + ',0,'F',0,'O',0,'R',0,'M',0,'A',0,'T',0,'@',0,'@',0 }; char* dst = NULL; int num; num = + ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) src, 16, &dst, 0, NULL, NULL); + printf("ConvertFromUnicode returned %d dst=[%s]\n", num, dst); + string_hexdump((BYTE*)dst, num+1); + } + if (1) + { + char src[] = "RICH TEXT FORMAT@@@@@@"; + WCHAR *dst = NULL; + int num; + num = ConvertToUnicode(CP_UTF8, 0, src, 16, &dst, 0); + printf("ConvertToUnicode returned %d dst=%p\n", num, (void*) dst); + string_hexdump((BYTE*)dst, num * 2 + 2); - } -*/ + } + */ return 0; } diff --git a/winpr/libwinpr/crt/unicode.c b/winpr/libwinpr/crt/unicode.c index 8ba80e3e5..e4f7ae66d 100644 --- a/winpr/libwinpr/crt/unicode.c +++ b/winpr/libwinpr/crt/unicode.c @@ -142,15 +142,17 @@ * * Finally, perform the conversion: * - * cchWideChar = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR) lpMultiByteStr, -1, lpWideCharStr, cchWideChar); + * cchWideChar = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR) lpMultiByteStr, -1, lpWideCharStr, + * cchWideChar); * * The value returned by MultiByteToWideChar corresponds to the number of wide characters written - * to the output buffer, and should match the value obtained on the first call to MultiByteToWideChar. + * to the output buffer, and should match the value obtained on the first call to + * MultiByteToWideChar. * */ -int MultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, - int cbMultiByte, LPWSTR lpWideCharStr, int cchWideChar) +int MultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int cbMultiByte, + LPWSTR lpWideCharStr, int cchWideChar) { LPWSTR targetStart; #if !defined(WITH_ICU) @@ -168,7 +170,7 @@ int MultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, if (cbMultiByte == -1) { - size_t len = strnlen((const char*) lpMultiByteStr, INT32_MAX); + size_t len = strnlen((const char*)lpMultiByteStr, INT32_MAX); if (len >= INT32_MAX) return 0; cbMultiByte = (int)len + 1; @@ -201,14 +203,13 @@ int MultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, if (cchWideChar == 0) { - u_strFromUTF8(NULL, 0, &targetLength, - lpMultiByteStr, cbMultiByte, &error); + u_strFromUTF8(NULL, 0, &targetLength, lpMultiByteStr, cbMultiByte, &error); cchWideChar = targetLength; } else { - u_strFromUTF8(targetStart, targetCapacity, &targetLength, - lpMultiByteStr, cbMultiByte, &error); + u_strFromUTF8(targetStart, targetCapacity, &targetLength, lpMultiByteStr, cbMultiByte, + &error); cchWideChar = U_SUCCESS(error) ? targetLength : 0; } } @@ -216,19 +217,19 @@ int MultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, if (cchWideChar == 0) { - sourceStart = (const BYTE*) lpMultiByteStr; - targetStart = (WCHAR*) NULL; - result = ConvertUTF8toUTF16(&sourceStart, &sourceStart[cbMultiByte], - &targetStart, NULL, strictConversion); - length = targetStart - ((WCHAR*) NULL); + sourceStart = (const BYTE*)lpMultiByteStr; + targetStart = (WCHAR*)NULL; + result = ConvertUTF8toUTF16(&sourceStart, &sourceStart[cbMultiByte], &targetStart, NULL, + strictConversion); + length = targetStart - ((WCHAR*)NULL); } else { - sourceStart = (const BYTE*) lpMultiByteStr; + sourceStart = (const BYTE*)lpMultiByteStr; targetStart = lpWideCharStr; - result = ConvertUTF8toUTF16(&sourceStart, &sourceStart[cbMultiByte], - &targetStart, &targetStart[cchWideChar], strictConversion); - length = targetStart - ((WCHAR*) lpWideCharStr); + result = ConvertUTF8toUTF16(&sourceStart, &sourceStart[cbMultiByte], &targetStart, + &targetStart[cchWideChar], strictConversion); + length = targetStart - ((WCHAR*)lpWideCharStr); } cchWideChar = (result == conversionOK) ? length : 0; @@ -264,15 +265,18 @@ int MultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, * * Finally, perform the conversion: * - * cbMultiByte = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR) lpWideCharStr, -1, lpMultiByteStr, cbMultiByte, NULL, NULL); + * cbMultiByte = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR) lpWideCharStr, -1, lpMultiByteStr, + * cbMultiByte, NULL, NULL); * * The value returned by WideCharToMultiByte corresponds to the number of bytes written - * to the output buffer, and should match the value obtained on the first call to WideCharToMultiByte. + * to the output buffer, and should match the value obtained on the first call to + * WideCharToMultiByte. * */ int WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int cchWideChar, - LPSTR lpMultiByteStr, int cbMultiByte, LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar) + LPSTR lpMultiByteStr, int cbMultiByte, LPCSTR lpDefaultChar, + LPBOOL lpUsedDefaultChar) { #if !defined(WITH_ICU) int length; @@ -325,14 +329,13 @@ int WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int if (cbMultiByte == 0) { - u_strToUTF8(NULL, 0, &targetLength, - lpWideCharStr, cchWideChar, &error); + u_strToUTF8(NULL, 0, &targetLength, lpWideCharStr, cchWideChar, &error); cbMultiByte = targetLength; } else { - u_strToUTF8(targetStart, targetCapacity, &targetLength, - lpWideCharStr, cchWideChar, &error); + u_strToUTF8(targetStart, targetCapacity, &targetLength, lpWideCharStr, cchWideChar, + &error); cbMultiByte = U_SUCCESS(error) ? targetLength : 0; } } @@ -340,19 +343,19 @@ int WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int if (cbMultiByte == 0) { - sourceStart = (WCHAR*) lpWideCharStr; - targetStart = (BYTE*) NULL; - result = ConvertUTF16toUTF8(&sourceStart, &sourceStart[cchWideChar], - &targetStart, NULL, strictConversion); - length = targetStart - ((BYTE*) NULL); + sourceStart = (WCHAR*)lpWideCharStr; + targetStart = (BYTE*)NULL; + result = ConvertUTF16toUTF8(&sourceStart, &sourceStart[cchWideChar], &targetStart, NULL, + strictConversion); + length = targetStart - ((BYTE*)NULL); } else { - sourceStart = (WCHAR*) lpWideCharStr; - targetStart = (BYTE*) lpMultiByteStr; - result = ConvertUTF16toUTF8(&sourceStart, &sourceStart[cchWideChar], - &targetStart, &targetStart[cbMultiByte], strictConversion); - length = targetStart - ((BYTE*) lpMultiByteStr); + sourceStart = (WCHAR*)lpWideCharStr; + targetStart = (BYTE*)lpMultiByteStr; + result = ConvertUTF16toUTF8(&sourceStart, &sourceStart[cchWideChar], &targetStart, + &targetStart[cbMultiByte], strictConversion); + length = targetStart - ((BYTE*)lpMultiByteStr); } cbMultiByte = (result == conversionOK) ? length : 0; @@ -375,8 +378,8 @@ int WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int * calculated accordingly. */ -int ConvertToUnicode(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, - int cbMultiByte, LPWSTR* lpWideCharStr, int cchWideChar) +int ConvertToUnicode(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int cbMultiByte, + LPWSTR* lpWideCharStr, int cchWideChar) { int status; BOOL allocate = FALSE; @@ -409,11 +412,11 @@ int ConvertToUnicode(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, if (allocate) { - *lpWideCharStr = (LPWSTR) calloc(cchWideChar + 1, sizeof(WCHAR)); + *lpWideCharStr = (LPWSTR)calloc(cchWideChar + 1, sizeof(WCHAR)); if (!(*lpWideCharStr)) { - //SetLastError(ERROR_INSUFFICIENT_BUFFER); + // SetLastError(ERROR_INSUFFICIENT_BUFFER); return 0; } } @@ -449,7 +452,8 @@ int ConvertToUnicode(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, */ int ConvertFromUnicode(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int cchWideChar, - LPSTR* lpMultiByteStr, int cbMultiByte, LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar) + LPSTR* lpMultiByteStr, int cbMultiByte, LPCSTR lpDefaultChar, + LPBOOL lpUsedDefaultChar) { int status; BOOL allocate = FALSE; @@ -465,8 +469,8 @@ int ConvertFromUnicode(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int if (cbMultiByte == 0) { - cbMultiByte = WideCharToMultiByte(CodePage, dwFlags, lpWideCharStr, cchWideChar, NULL, 0, NULL, - NULL); + cbMultiByte = + WideCharToMultiByte(CodePage, dwFlags, lpWideCharStr, cchWideChar, NULL, 0, NULL, NULL); allocate = TRUE; } @@ -478,17 +482,17 @@ int ConvertFromUnicode(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int if (allocate) { - *lpMultiByteStr = (LPSTR) calloc(1, cbMultiByte + 1); + *lpMultiByteStr = (LPSTR)calloc(1, cbMultiByte + 1); if (!(*lpMultiByteStr)) { - //SetLastError(ERROR_INSUFFICIENT_BUFFER); + // SetLastError(ERROR_INSUFFICIENT_BUFFER); return 0; } } - status = WideCharToMultiByte(CodePage, dwFlags, lpWideCharStr, cchWideChar, - *lpMultiByteStr, cbMultiByte, lpDefaultChar, lpUsedDefaultChar); + status = WideCharToMultiByte(CodePage, dwFlags, lpWideCharStr, cchWideChar, *lpMultiByteStr, + cbMultiByte, lpDefaultChar, lpUsedDefaultChar); if ((status != cbMultiByte) && allocate) { diff --git a/winpr/libwinpr/crt/utf.c b/winpr/libwinpr/crt/utf.c index 9d5dd755c..8ab7e39bb 100644 --- a/winpr/libwinpr/crt/utf.c +++ b/winpr/libwinpr/crt/utf.c @@ -43,21 +43,20 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" -static const int halfShift = 10; /* used for shifting by 10 bits */ +static const int halfShift = 10; /* used for shifting by 10 bits */ static const DWORD halfBase = 0x0010000UL; static const DWORD halfMask = 0x3FFUL; -#define UNI_SUR_HIGH_START (DWORD)0xD800 -#define UNI_SUR_HIGH_END (DWORD)0xDBFF -#define UNI_SUR_LOW_START (DWORD)0xDC00 -#define UNI_SUR_LOW_END (DWORD)0xDFFF +#define UNI_SUR_HIGH_START (DWORD)0xD800 +#define UNI_SUR_HIGH_END (DWORD)0xDBFF +#define UNI_SUR_LOW_START (DWORD)0xDC00 +#define UNI_SUR_LOW_END (DWORD)0xDFFF /* --------------------------------------------------------------------- */ -ConversionResult ConvertUTF32toUTF16( - const DWORD** sourceStart, const DWORD* sourceEnd, - WCHAR** targetStart, WCHAR* targetEnd, ConversionFlags flags) +ConversionResult ConvertUTF32toUTF16(const DWORD** sourceStart, const DWORD* sourceEnd, + WCHAR** targetStart, WCHAR* targetEnd, ConversionFlags flags) { ConversionResult result = conversionOK; const DWORD* source = *sourceStart; @@ -75,9 +74,10 @@ ConversionResult ConvertUTF32toUTF16( ch = *source++; - if (ch <= UNI_MAX_BMP) /* Target is a character <= 0xFFFF */ + if (ch <= UNI_MAX_BMP) /* Target is a character <= 0xFFFF */ { - /* UTF-16 surrogate values are illegal in UTF-32; 0xffff or 0xfffe are both reserved values */ + /* UTF-16 surrogate values are illegal in UTF-32; 0xffff or 0xfffe are both reserved + * values */ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { if (flags == strictConversion) @@ -130,9 +130,8 @@ ConversionResult ConvertUTF32toUTF16( /* --------------------------------------------------------------------- */ -ConversionResult ConvertUTF16toUTF32( - const WCHAR** sourceStart, const WCHAR* sourceEnd, - DWORD** targetStart, DWORD* targetEnd, ConversionFlags flags) +ConversionResult ConvertUTF16toUTF32(const WCHAR** sourceStart, const WCHAR* sourceEnd, + DWORD** targetStart, DWORD* targetEnd, ConversionFlags flags) { ConversionResult result = conversionOK; const WCHAR* source = *sourceStart; @@ -141,7 +140,8 @@ ConversionResult ConvertUTF16toUTF32( while (source < sourceEnd) { - const WCHAR* oldSource = source; /* In case we have to back up because of target overflow. */ + const WCHAR* oldSource = + source; /* In case we have to back up because of target overflow. */ ch = *source++; /* If we have a surrogate pair, convert to UTF32 first. */ @@ -155,18 +155,18 @@ ConversionResult ConvertUTF16toUTF32( /* If it's a low surrogate, convert to UTF32. */ if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) { - ch = ((ch - UNI_SUR_HIGH_START) << halfShift) - + (ch2 - UNI_SUR_LOW_START) + halfBase; + ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + (ch2 - UNI_SUR_LOW_START) + + halfBase; ++source; } - else if (flags == strictConversion) /* it's an unpaired high surrogate */ + else if (flags == strictConversion) /* it's an unpaired high surrogate */ { --source; /* return to the illegal value itself */ result = sourceIllegal; break; } } - else /* We don't have the 16 bits following the high surrogate. */ + else /* We don't have the 16 bits following the high surrogate. */ { --source; /* return to the high surrogate */ result = sourceExhausted; @@ -216,8 +216,7 @@ ConversionResult ConvertUTF16toUTF32( * left as-is for anyone who may want to do such conversion, which was * allowed in earlier algorithms. */ -static const char trailingBytesForUTF8[256] = -{ +static const char trailingBytesForUTF8[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -234,8 +233,7 @@ static const char trailingBytesForUTF8[256] = * in a UTF-8 sequence. */ static const DWORD offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, - 0x03C82080UL, 0xFA082080UL, 0x82082080UL - }; + 0x03C82080UL, 0xFA082080UL, 0x82082080UL }; /* * Once the bits are split out into bytes of UTF-8, this is a mask OR-ed @@ -258,9 +256,8 @@ static const BYTE firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC /* --------------------------------------------------------------------- */ -ConversionResult ConvertUTF16toUTF8( - const WCHAR** sourceStart, const WCHAR* sourceEnd, - BYTE** targetStart, BYTE* targetEnd, ConversionFlags flags) +ConversionResult ConvertUTF16toUTF8(const WCHAR** sourceStart, const WCHAR* sourceEnd, + BYTE** targetStart, BYTE* targetEnd, ConversionFlags flags) { BYTE* target; const WCHAR* source; @@ -277,7 +274,8 @@ ConversionResult ConvertUTF16toUTF8( unsigned short bytesToWrite = 0; const DWORD byteMask = 0xBF; const DWORD byteMark = 0x80; - const WCHAR* oldSource = source; /* In case we have to back up because of target overflow. */ + const WCHAR* oldSource = + source; /* In case we have to back up because of target overflow. */ Data_Read_UINT16(source, ch); source++; @@ -293,8 +291,8 @@ ConversionResult ConvertUTF16toUTF8( /* If it's a low surrogate, convert to UTF32. */ if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) { - ch = ((ch - UNI_SUR_HIGH_START) << halfShift) - + (ch2 - UNI_SUR_LOW_START) + halfBase; + ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + (ch2 - UNI_SUR_LOW_START) + + halfBase; ++source; } else if (flags == strictConversion) @@ -325,19 +323,19 @@ ConversionResult ConvertUTF16toUTF8( } /* Figure out how many bytes the result will require */ - if (ch < (DWORD) 0x80) + if (ch < (DWORD)0x80) { bytesToWrite = 1; } - else if (ch < (DWORD) 0x800) + else if (ch < (DWORD)0x800) { bytesToWrite = 2; } - else if (ch < (DWORD) 0x10000) + else if (ch < (DWORD)0x10000) { bytesToWrite = 3; } - else if (ch < (DWORD) 0x110000) + else if (ch < (DWORD)0x110000) { bytesToWrite = 4; } @@ -430,43 +428,52 @@ static BOOL isLegalUTF8(const BYTE* source, int length) /* Everything else falls through when "TRUE"... */ case 4: - if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return FALSE; + if ((a = (*--srcptr)) < 0x80 || a > 0xBF) + return FALSE; case 3: - if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return FALSE; + if ((a = (*--srcptr)) < 0x80 || a > 0xBF) + return FALSE; case 2: - if ((a = (*--srcptr)) > 0xBF) return FALSE; + if ((a = (*--srcptr)) > 0xBF) + return FALSE; switch (*source) { /* no fall-through in this inner switch */ case 0xE0: - if (a < 0xA0) return FALSE; + if (a < 0xA0) + return FALSE; break; case 0xED: - if (a > 0x9F) return FALSE; + if (a > 0x9F) + return FALSE; break; case 0xF0: - if (a < 0x90) return FALSE; + if (a < 0x90) + return FALSE; break; case 0xF4: - if (a > 0x8F) return FALSE; + if (a > 0x8F) + return FALSE; break; default: - if (a < 0x80) return FALSE; + if (a < 0x80) + return FALSE; } case 1: - if (*source >= 0x80 && *source < 0xC2) return FALSE; + if (*source >= 0x80 && *source < 0xC2) + return FALSE; } if (*source > 0xF4) @@ -493,9 +500,8 @@ BOOL isLegalUTF8Sequence(const BYTE* source, const BYTE* sourceEnd) /* --------------------------------------------------------------------- */ -ConversionResult ConvertUTF8toUTF16( - const BYTE** sourceStart, const BYTE* sourceEnd, - WCHAR** targetStart, WCHAR* targetEnd, ConversionFlags flags) +ConversionResult ConvertUTF8toUTF16(const BYTE** sourceStart, const BYTE* sourceEnd, + WCHAR** targetStart, WCHAR* targetEnd, ConversionFlags flags) { WCHAR* target; const BYTE* source; @@ -602,7 +608,7 @@ ConversionResult ConvertUTF8toUTF16( { result = sourceIllegal; source -= (extraBytesToRead + 1); /* return to the start */ - break; /* Bail out; shouldn't continue */ + break; /* Bail out; shouldn't continue */ } else { @@ -652,9 +658,8 @@ ConversionResult ConvertUTF8toUTF16( /* --------------------------------------------------------------------- */ -ConversionResult ConvertUTF32toUTF8( - const DWORD** sourceStart, const DWORD* sourceEnd, - BYTE** targetStart, BYTE* targetEnd, ConversionFlags flags) +ConversionResult ConvertUTF32toUTF8(const DWORD** sourceStart, const DWORD* sourceEnd, + BYTE** targetStart, BYTE* targetEnd, ConversionFlags flags) { ConversionResult result = conversionOK; const DWORD* source = *sourceStart; @@ -716,7 +721,7 @@ ConversionResult ConvertUTF32toUTF8( break; } - switch (bytesToWrite) /* note: everything falls through. */ + switch (bytesToWrite) /* note: everything falls through. */ { case 4: *--target = (BYTE)((ch | byteMark) & byteMask); @@ -744,9 +749,8 @@ ConversionResult ConvertUTF32toUTF8( /* --------------------------------------------------------------------- */ -ConversionResult ConvertUTF8toUTF32( - const BYTE** sourceStart, const BYTE* sourceEnd, - DWORD** targetStart, DWORD* targetEnd, ConversionFlags flags) +ConversionResult ConvertUTF8toUTF32(const BYTE** sourceStart, const BYTE* sourceEnd, + DWORD** targetStart, DWORD* targetEnd, ConversionFlags flags) { ConversionResult result = conversionOK; const BYTE* source = *sourceStart; @@ -764,7 +768,7 @@ ConversionResult ConvertUTF8toUTF32( } /* Do this check whether lenient or strict */ - if (! isLegalUTF8(source, extraBytesToRead + 1)) + if (!isLegalUTF8(source, extraBytesToRead + 1)) { result = sourceIllegal; break; @@ -832,7 +836,7 @@ ConversionResult ConvertUTF8toUTF32( *target++ = ch; } } - else /* i.e., ch > UNI_MAX_LEGAL_UTF32 */ + else /* i.e., ch > UNI_MAX_LEGAL_UTF32 */ { result = sourceIllegal; *target++ = UNI_REPLACEMENT_CHAR; diff --git a/winpr/libwinpr/crt/utf.h b/winpr/libwinpr/crt/utf.h index ffe161196..70c0bfed3 100644 --- a/winpr/libwinpr/crt/utf.h +++ b/winpr/libwinpr/crt/utf.h @@ -1,8 +1,8 @@ /* * Copyright 2001-2004 Unicode, Inc. - * + * * Disclaimer - * + * * This source code is provided as is by Unicode, Inc. No claims are * made as to fitness for any particular purpose. No warranties of any * kind are expressed or implied. The recipient agrees to determine @@ -10,9 +10,9 @@ * purchased on magnetic or optical media from Unicode, Inc., the * sole remedy for any claim will be exchange of defective media * within 90 days of receipt. - * + * * Limitations on Rights to Redistribute This Code - * + * * Unicode, Inc. hereby grants the right to freely use the information * supplied in this file in the creation of products supporting the * Unicode Standard, and to make copies of this file in any form @@ -33,7 +33,7 @@ Each routine converts the text between *sourceStart and sourceEnd, putting the result into the buffer between *targetStart and - targetEnd. Note: the end pointers are *after* the last item: e.g. + targetEnd. Note: the end pointers are *after* the last item: e.g. *(sourceEnd - 1) is the last item. The return result indicates whether the conversion was successful, @@ -71,7 +71,7 @@ sequence is malformed. When "sourceIllegal" is returned, the source value will point to the illegal value that caused the problem. E.g., in UTF-8 when a sequence is malformed, it points to the start of the - malformed sequence. + malformed sequence. Author: Mark E. Davis, 1994. Rev History: Rick McGowan, fixes & updates May 2001. @@ -93,18 +93,18 @@ */ /* Some fundamental constants */ -#define UNI_REPLACEMENT_CHAR (DWORD)0x0000FFFD -#define UNI_MAX_BMP (DWORD)0x0000FFFF -#define UNI_MAX_UTF16 (DWORD)0x0010FFFF -#define UNI_MAX_UTF32 (DWORD)0x7FFFFFFF -#define UNI_MAX_LEGAL_UTF32 (DWORD)0x0010FFFF +#define UNI_REPLACEMENT_CHAR (DWORD)0x0000FFFD +#define UNI_MAX_BMP (DWORD)0x0000FFFF +#define UNI_MAX_UTF16 (DWORD)0x0010FFFF +#define UNI_MAX_UTF32 (DWORD)0x7FFFFFFF +#define UNI_MAX_LEGAL_UTF32 (DWORD)0x0010FFFF typedef enum { - conversionOK, /* conversion successful */ + conversionOK, /* conversion successful */ sourceExhausted, /* partial character in source, but hit end */ targetExhausted, /* insuff. room in target for conversion */ - sourceIllegal /* source sequence is illegal/malformed */ + sourceIllegal /* source sequence is illegal/malformed */ } ConversionResult; typedef enum @@ -115,38 +115,36 @@ typedef enum /* This is for C++ and does no harm in C */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -ConversionResult ConvertUTF8toUTF16( - const BYTE** sourceStart, const BYTE* sourceEnd, - WCHAR** targetStart, WCHAR* targetEnd, ConversionFlags flags); + ConversionResult ConvertUTF8toUTF16(const BYTE** sourceStart, const BYTE* sourceEnd, + WCHAR** targetStart, WCHAR* targetEnd, + ConversionFlags flags); -ConversionResult ConvertUTF16toUTF8( - const WCHAR** sourceStart, const WCHAR* sourceEnd, - BYTE** targetStart, BYTE* targetEnd, ConversionFlags flags); + ConversionResult ConvertUTF16toUTF8(const WCHAR** sourceStart, const WCHAR* sourceEnd, + BYTE** targetStart, BYTE* targetEnd, ConversionFlags flags); -ConversionResult ConvertUTF8toUTF32( - const BYTE** sourceStart, const BYTE* sourceEnd, - DWORD** targetStart, DWORD* targetEnd, ConversionFlags flags); + ConversionResult ConvertUTF8toUTF32(const BYTE** sourceStart, const BYTE* sourceEnd, + DWORD** targetStart, DWORD* targetEnd, + ConversionFlags flags); -ConversionResult ConvertUTF32toUTF8( - const DWORD** sourceStart, const DWORD* sourceEnd, - BYTE** targetStart, BYTE* targetEnd, ConversionFlags flags); + ConversionResult ConvertUTF32toUTF8(const DWORD** sourceStart, const DWORD* sourceEnd, + BYTE** targetStart, BYTE* targetEnd, ConversionFlags flags); -ConversionResult ConvertUTF16toUTF32( - const WCHAR** sourceStart, const WCHAR* sourceEnd, - DWORD** targetStart, DWORD* targetEnd, ConversionFlags flags); + ConversionResult ConvertUTF16toUTF32(const WCHAR** sourceStart, const WCHAR* sourceEnd, + DWORD** targetStart, DWORD* targetEnd, + ConversionFlags flags); -ConversionResult ConvertUTF32toUTF16( - const DWORD** sourceStart, const DWORD* sourceEnd, - WCHAR** targetStart, WCHAR* targetEnd, ConversionFlags flags); + ConversionResult ConvertUTF32toUTF16(const DWORD** sourceStart, const DWORD* sourceEnd, + WCHAR** targetStart, WCHAR* targetEnd, + ConversionFlags flags); -BOOL isLegalUTF8Sequence(const BYTE *source, const BYTE *sourceEnd); + BOOL isLegalUTF8Sequence(const BYTE* source, const BYTE* sourceEnd); #ifdef __cplusplus } #endif #endif /* FREERDP_UNICODE_CONVERT_UTF_H */ - diff --git a/winpr/libwinpr/crypto/cert.c b/winpr/libwinpr/crypto/cert.c index 820e2507f..c769f563d 100644 --- a/winpr/libwinpr/crypto/cert.c +++ b/winpr/libwinpr/crypto/cert.c @@ -157,11 +157,11 @@ #include "crypto.h" HCERTSTORE CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, - HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void* pvPara) + HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void* pvPara) { WINPR_CERTSTORE* certstore; - certstore = (WINPR_CERTSTORE*) calloc(1, sizeof(WINPR_CERTSTORE)); + certstore = (WINPR_CERTSTORE*)calloc(1, sizeof(WINPR_CERTSTORE)); if (certstore) { @@ -169,7 +169,7 @@ HCERTSTORE CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingTyp certstore->dwMsgAndCertEncodingType = dwMsgAndCertEncodingType; } - return (HCERTSTORE) certstore; + return (HCERTSTORE)certstore; } HCERTSTORE CertOpenSystemStoreW(HCRYPTPROV_LEGACY hProv, LPCWSTR szSubsystemProtocol) @@ -190,7 +190,7 @@ BOOL CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags) { WINPR_CERTSTORE* certstore; - certstore = (WINPR_CERTSTORE*) hCertStore; + certstore = (WINPR_CERTSTORE*)hCertStore; free(certstore); @@ -198,27 +198,27 @@ BOOL CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags) } PCCERT_CONTEXT CertFindCertificateInStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, - DWORD dwFindFlags, DWORD dwFindType, const void* pvFindPara, PCCERT_CONTEXT pPrevCertContext) + DWORD dwFindFlags, DWORD dwFindType, + const void* pvFindPara, PCCERT_CONTEXT pPrevCertContext) { - return (PCCERT_CONTEXT) 1; + return (PCCERT_CONTEXT)1; } PCCERT_CONTEXT CertEnumCertificatesInStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pPrevCertContext) { - return (PCCERT_CONTEXT) NULL; + return (PCCERT_CONTEXT)NULL; } -DWORD CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType, - DWORD dwFlags, void* pvTypePara, LPWSTR pszNameString, DWORD cchNameString) +DWORD CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags, void* pvTypePara, + LPWSTR pszNameString, DWORD cchNameString) { return 0; } -DWORD CertGetNameStringA(PCCERT_CONTEXT pCertContext, DWORD dwType, - DWORD dwFlags, void* pvTypePara, LPSTR pszNameString, DWORD cchNameString) +DWORD CertGetNameStringA(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags, void* pvTypePara, + LPSTR pszNameString, DWORD cchNameString) { return 0; } #endif - diff --git a/winpr/libwinpr/crypto/cipher.c b/winpr/libwinpr/crypto/cipher.c index f1e4290d6..5d49471dc 100644 --- a/winpr/libwinpr/crypto/cipher.c +++ b/winpr/libwinpr/crypto/cipher.c @@ -55,7 +55,7 @@ WINPR_RC4_CTX* winpr_RC4_New_Internal(const BYTE* key, size_t keylen, BOOL overr #if defined(WITH_OPENSSL) - if (!(ctx = (WINPR_RC4_CTX*) EVP_CIPHER_CTX_new())) + if (!(ctx = (WINPR_RC4_CTX*)EVP_CIPHER_CTX_new())) return NULL; evp = EVP_rc4(); @@ -63,24 +63,24 @@ WINPR_RC4_CTX* winpr_RC4_New_Internal(const BYTE* key, size_t keylen, BOOL overr if (!evp) return NULL; - EVP_CIPHER_CTX_init((EVP_CIPHER_CTX*) ctx); - EVP_EncryptInit_ex((EVP_CIPHER_CTX*) ctx, evp, NULL, NULL, NULL); + EVP_CIPHER_CTX_init((EVP_CIPHER_CTX*)ctx); + EVP_EncryptInit_ex((EVP_CIPHER_CTX*)ctx, evp, NULL, NULL, NULL); /* EVP_CIPH_FLAG_NON_FIPS_ALLOW does not exist before openssl 1.0.1 */ #if !(OPENSSL_VERSION_NUMBER < 0x10001000L) if (override_fips == TRUE) - EVP_CIPHER_CTX_set_flags((EVP_CIPHER_CTX*) ctx, EVP_CIPH_FLAG_NON_FIPS_ALLOW); + EVP_CIPHER_CTX_set_flags((EVP_CIPHER_CTX*)ctx, EVP_CIPH_FLAG_NON_FIPS_ALLOW); #endif - EVP_CIPHER_CTX_set_key_length((EVP_CIPHER_CTX*) ctx, keylen); - EVP_EncryptInit_ex((EVP_CIPHER_CTX*) ctx, NULL, NULL, key, NULL); + EVP_CIPHER_CTX_set_key_length((EVP_CIPHER_CTX*)ctx, keylen); + EVP_EncryptInit_ex((EVP_CIPHER_CTX*)ctx, NULL, NULL, key, NULL); #elif defined(WITH_MBEDTLS) && defined(MBEDTLS_ARC4_C) - if (!(ctx = (WINPR_RC4_CTX*) calloc(1, sizeof(mbedtls_arc4_context)))) + if (!(ctx = (WINPR_RC4_CTX*)calloc(1, sizeof(mbedtls_arc4_context)))) return NULL; - mbedtls_arc4_init((mbedtls_arc4_context*) ctx); - mbedtls_arc4_setup((mbedtls_arc4_context*) ctx, key, (unsigned int) keylen); + mbedtls_arc4_init((mbedtls_arc4_context*)ctx); + mbedtls_arc4_setup((mbedtls_arc4_context*)ctx, key, (unsigned int)keylen); #endif return ctx; } @@ -99,11 +99,11 @@ BOOL winpr_RC4_Update(WINPR_RC4_CTX* ctx, size_t length, const BYTE* input, BYTE { #if defined(WITH_OPENSSL) int outputLength; - EVP_CipherUpdate((EVP_CIPHER_CTX*) ctx, output, &outputLength, input, length); + EVP_CipherUpdate((EVP_CIPHER_CTX*)ctx, output, &outputLength, input, length); return TRUE; #elif defined(WITH_MBEDTLS) && defined(MBEDTLS_ARC4_C) - if (mbedtls_arc4_crypt((mbedtls_arc4_context*) ctx, length, input, output) == 0) + if (mbedtls_arc4_crypt((mbedtls_arc4_context*)ctx, length, input, output) == 0) return TRUE; #endif @@ -116,9 +116,9 @@ void winpr_RC4_Free(WINPR_RC4_CTX* ctx) return; #if defined(WITH_OPENSSL) - EVP_CIPHER_CTX_free((EVP_CIPHER_CTX*) ctx); + EVP_CIPHER_CTX_free((EVP_CIPHER_CTX*)ctx); #elif defined(WITH_MBEDTLS) && defined(MBEDTLS_ARC4_C) - mbedtls_arc4_free((mbedtls_arc4_context*) ctx); + mbedtls_arc4_free((mbedtls_arc4_context*)ctx); free(ctx); #endif } @@ -569,7 +569,7 @@ WINPR_CIPHER_CTX* winpr_Cipher_New(int cipher, int op, const BYTE* key, const BY } EVP_CIPHER_CTX_set_padding(octx, 0); - ctx = (WINPR_CIPHER_CTX*) octx; + ctx = (WINPR_CIPHER_CTX*)octx; #elif defined(WITH_MBEDTLS) int key_bitlen; mbedtls_operation_t operation; @@ -580,7 +580,7 @@ WINPR_CIPHER_CTX* winpr_Cipher_New(int cipher, int op, const BYTE* key, const BY if (!cipher_info) return NULL; - if (!(mctx = (mbedtls_cipher_context_t*) calloc(1, sizeof(mbedtls_cipher_context_t)))) + if (!(mctx = (mbedtls_cipher_context_t*)calloc(1, sizeof(mbedtls_cipher_context_t)))) return NULL; operation = (op == WINPR_ENCRYPT) ? MBEDTLS_ENCRYPT : MBEDTLS_DECRYPT; @@ -608,7 +608,7 @@ WINPR_CIPHER_CTX* winpr_Cipher_New(int cipher, int op, const BYTE* key, const BY return NULL; } - ctx = (WINPR_CIPHER_CTX*) mctx; + ctx = (WINPR_CIPHER_CTX*)mctx; #endif return ctx; } @@ -617,17 +617,17 @@ BOOL winpr_Cipher_Update(WINPR_CIPHER_CTX* ctx, const BYTE* input, size_t ilen, size_t* olen) { #if defined(WITH_OPENSSL) - int outl = (int) * olen; + int outl = (int)*olen; - if (EVP_CipherUpdate((EVP_CIPHER_CTX*) ctx, output, &outl, input, ilen) == 1) + if (EVP_CipherUpdate((EVP_CIPHER_CTX*)ctx, output, &outl, input, ilen) == 1) { - *olen = (size_t) outl; + *olen = (size_t)outl; return TRUE; } #elif defined(WITH_MBEDTLS) - if (mbedtls_cipher_update((mbedtls_cipher_context_t*) ctx, input, ilen, output, olen) == 0) + if (mbedtls_cipher_update((mbedtls_cipher_context_t*)ctx, input, ilen, output, olen) == 0) return TRUE; #endif @@ -637,17 +637,17 @@ BOOL winpr_Cipher_Update(WINPR_CIPHER_CTX* ctx, const BYTE* input, size_t ilen, BOOL winpr_Cipher_Final(WINPR_CIPHER_CTX* ctx, BYTE* output, size_t* olen) { #if defined(WITH_OPENSSL) - int outl = (int) * olen; + int outl = (int)*olen; - if (EVP_CipherFinal_ex((EVP_CIPHER_CTX*) ctx, output, &outl) == 1) + if (EVP_CipherFinal_ex((EVP_CIPHER_CTX*)ctx, output, &outl) == 1) { - *olen = (size_t) outl; + *olen = (size_t)outl; return TRUE; } #elif defined(WITH_MBEDTLS) - if (mbedtls_cipher_finish((mbedtls_cipher_context_t*) ctx, output, olen) == 0) + if (mbedtls_cipher_finish((mbedtls_cipher_context_t*)ctx, output, olen) == 0) return TRUE; #endif @@ -660,14 +660,13 @@ void winpr_Cipher_Free(WINPR_CIPHER_CTX* ctx) return; #if defined(WITH_OPENSSL) - EVP_CIPHER_CTX_free((EVP_CIPHER_CTX*) ctx); + EVP_CIPHER_CTX_free((EVP_CIPHER_CTX*)ctx); #elif defined(WITH_MBEDTLS) - mbedtls_cipher_free((mbedtls_cipher_context_t*) ctx); + mbedtls_cipher_free((mbedtls_cipher_context_t*)ctx); free(ctx); #endif } - /** * Key Generation */ @@ -737,7 +736,7 @@ int winpr_Cipher_BytesToKey(int cipher, int md, const BYTE* salt, const BYTE* da mds = mbedtls_md_get_size(md_info); - for (i = 1; i < (unsigned int) count; i++) + for (i = 1; i < (unsigned int)count; i++) { if (mbedtls_md_starts(&ctx) != 0) goto err; diff --git a/winpr/libwinpr/crypto/crypto.c b/winpr/libwinpr/crypto/crypto.c index 2ce6a8625..5c51c1243 100644 --- a/winpr/libwinpr/crypto/crypto.c +++ b/winpr/libwinpr/crypto/crypto.c @@ -165,7 +165,7 @@ BOOL CryptProtectMemory(LPVOID pData, DWORD cbData, DWORD dwFlags) return FALSE; } - pMemBlock = (WINPR_PROTECTED_MEMORY_BLOCK*) calloc(1, sizeof(WINPR_PROTECTED_MEMORY_BLOCK)); + pMemBlock = (WINPR_PROTECTED_MEMORY_BLOCK*)calloc(1, sizeof(WINPR_PROTECTED_MEMORY_BLOCK)); if (!pMemBlock) return FALSE; @@ -177,19 +177,19 @@ BOOL CryptProtectMemory(LPVOID pData, DWORD cbData, DWORD dwFlags) winpr_RAND(pMemBlock->salt, 8); winpr_RAND(randomKey, sizeof(randomKey)); - winpr_Cipher_BytesToKey(WINPR_CIPHER_AES_256_CBC, WINPR_MD_SHA1, - pMemBlock->salt, randomKey, sizeof(randomKey), 4, pMemBlock->key, pMemBlock->iv); + winpr_Cipher_BytesToKey(WINPR_CIPHER_AES_256_CBC, WINPR_MD_SHA1, pMemBlock->salt, randomKey, + sizeof(randomKey), 4, pMemBlock->key, pMemBlock->iv); SecureZeroMemory(randomKey, sizeof(randomKey)); cbOut = pMemBlock->cbData + 16 - 1; - pCipherText = (BYTE*) malloc(cbOut); + pCipherText = (BYTE*)malloc(cbOut); if (!pCipherText) goto out; - if ((enc = winpr_Cipher_New(WINPR_CIPHER_AES_256_CBC, WINPR_ENCRYPT, - pMemBlock->key, pMemBlock->iv)) == NULL) + if ((enc = winpr_Cipher_New(WINPR_CIPHER_AES_256_CBC, WINPR_ENCRYPT, pMemBlock->key, + pMemBlock->iv)) == NULL) goto out; if (!winpr_Cipher_Update(enc, pMemBlock->pData, pMemBlock->cbData, pCipherText, &cbOut)) goto out; @@ -202,8 +202,8 @@ BOOL CryptProtectMemory(LPVOID pData, DWORD cbData, DWORD dwFlags) return ListDictionary_Add(g_ProtectedMemoryBlocks, pData, pMemBlock); out: - free (pMemBlock); - free (pCipherText); + free(pMemBlock); + free(pCipherText); winpr_Cipher_Free(enc); return FALSE; @@ -222,20 +222,21 @@ BOOL CryptUnprotectMemory(LPVOID pData, DWORD cbData, DWORD dwFlags) if (!g_ProtectedMemoryBlocks) return FALSE; - pMemBlock = (WINPR_PROTECTED_MEMORY_BLOCK*) ListDictionary_GetItemValue(g_ProtectedMemoryBlocks, pData); + pMemBlock = + (WINPR_PROTECTED_MEMORY_BLOCK*)ListDictionary_GetItemValue(g_ProtectedMemoryBlocks, pData); if (!pMemBlock) goto out; cbOut = pMemBlock->cbData + 16 - 1; - pPlainText = (BYTE*) malloc(cbOut); + pPlainText = (BYTE*)malloc(cbOut); if (!pPlainText) goto out; - if ((dec = winpr_Cipher_New(WINPR_CIPHER_AES_256_CBC, WINPR_DECRYPT, - pMemBlock->key, pMemBlock->iv)) == NULL) + if ((dec = winpr_Cipher_New(WINPR_CIPHER_AES_256_CBC, WINPR_DECRYPT, pMemBlock->key, + pMemBlock->iv)) == NULL) goto out; if (!winpr_Cipher_Update(dec, pMemBlock->pData, pMemBlock->cbData, pPlainText, &cbOut)) goto out; @@ -261,35 +262,39 @@ out: } BOOL CryptProtectData(DATA_BLOB* pDataIn, LPCWSTR szDataDescr, DATA_BLOB* pOptionalEntropy, - PVOID pvReserved, CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags, DATA_BLOB* pDataOut) + PVOID pvReserved, CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags, + DATA_BLOB* pDataOut) { return TRUE; } BOOL CryptUnprotectData(DATA_BLOB* pDataIn, LPWSTR* ppszDataDescr, DATA_BLOB* pOptionalEntropy, - PVOID pvReserved, CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags, DATA_BLOB* pDataOut) + PVOID pvReserved, CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags, + DATA_BLOB* pDataOut) { return TRUE; } BOOL CryptStringToBinaryW(LPCWSTR pszString, DWORD cchString, DWORD dwFlags, BYTE* pbBinary, - DWORD* pcbBinary, DWORD* pdwSkip, DWORD* pdwFlags) + DWORD* pcbBinary, DWORD* pdwSkip, DWORD* pdwFlags) { return TRUE; } BOOL CryptStringToBinaryA(LPCSTR pszString, DWORD cchString, DWORD dwFlags, BYTE* pbBinary, - DWORD* pcbBinary, DWORD* pdwSkip, DWORD* pdwFlags) + DWORD* pcbBinary, DWORD* pdwSkip, DWORD* pdwFlags) { return TRUE; } -BOOL CryptBinaryToStringW(CONST BYTE* pbBinary, DWORD cbBinary, DWORD dwFlags, LPWSTR pszString, DWORD* pcchString) +BOOL CryptBinaryToStringW(CONST BYTE* pbBinary, DWORD cbBinary, DWORD dwFlags, LPWSTR pszString, + DWORD* pcchString) { return TRUE; } -BOOL CryptBinaryToStringA(CONST BYTE* pbBinary, DWORD cbBinary, DWORD dwFlags, LPSTR pszString, DWORD* pcchString) +BOOL CryptBinaryToStringA(CONST BYTE* pbBinary, DWORD cbBinary, DWORD dwFlags, LPSTR pszString, + DWORD* pcchString) { return TRUE; } diff --git a/winpr/libwinpr/crypto/hash.c b/winpr/libwinpr/crypto/hash.c index 685ee7f05..81a3e859e 100644 --- a/winpr/libwinpr/crypto/hash.c +++ b/winpr/libwinpr/crypto/hash.c @@ -39,7 +39,6 @@ #include #endif - /** * HMAC */ @@ -147,7 +146,7 @@ WINPR_HMAC_CTX* winpr_HMAC_New(void) HMAC_CTX* hmac = NULL; #if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER) - if (!(hmac = (HMAC_CTX*) calloc(1, sizeof(HMAC_CTX)))) + if (!(hmac = (HMAC_CTX*)calloc(1, sizeof(HMAC_CTX)))) return NULL; HMAC_CTX_init(hmac); @@ -157,15 +156,15 @@ WINPR_HMAC_CTX* winpr_HMAC_New(void) return NULL; #endif - ctx = (WINPR_HMAC_CTX*) hmac; + ctx = (WINPR_HMAC_CTX*)hmac; #elif defined(WITH_MBEDTLS) mbedtls_md_context_t* hmac; - if (!(hmac = (mbedtls_md_context_t*) calloc(1, sizeof(mbedtls_md_context_t)))) + if (!(hmac = (mbedtls_md_context_t*)calloc(1, sizeof(mbedtls_md_context_t)))) return NULL; mbedtls_md_init(hmac); - ctx = (WINPR_HMAC_CTX*) hmac; + ctx = (WINPR_HMAC_CTX*)hmac; #endif return ctx; } @@ -173,7 +172,7 @@ WINPR_HMAC_CTX* winpr_HMAC_New(void) BOOL winpr_HMAC_Init(WINPR_HMAC_CTX* ctx, WINPR_MD_TYPE md, const BYTE* key, size_t keylen) { #if defined(WITH_OPENSSL) - HMAC_CTX* hmac = (HMAC_CTX*) ctx; + HMAC_CTX* hmac = (HMAC_CTX*)ctx; const EVP_MD* evp = winpr_openssl_get_evp_md(md); if (!evp || !hmac) @@ -189,7 +188,7 @@ BOOL winpr_HMAC_Init(WINPR_HMAC_CTX* ctx, WINPR_MD_TYPE md, const BYTE* key, siz #endif #elif defined(WITH_MBEDTLS) - mbedtls_md_context_t* hmac = (mbedtls_md_context_t*) ctx; + mbedtls_md_context_t* hmac = (mbedtls_md_context_t*)ctx; mbedtls_md_type_t md_type = winpr_mbedtls_get_md_type(md); const mbedtls_md_info_t* md_info = mbedtls_md_info_from_type(md_type); @@ -214,7 +213,7 @@ BOOL winpr_HMAC_Init(WINPR_HMAC_CTX* ctx, WINPR_MD_TYPE md, const BYTE* key, siz BOOL winpr_HMAC_Update(WINPR_HMAC_CTX* ctx, const BYTE* input, size_t ilen) { #if defined(WITH_OPENSSL) - HMAC_CTX* hmac = (HMAC_CTX*) ctx; + HMAC_CTX* hmac = (HMAC_CTX*)ctx; #if (OPENSSL_VERSION_NUMBER < 0x10000000L) || defined(LIBRESSL_VERSION_NUMBER) HMAC_Update(hmac, input, ilen); /* no return value on OpenSSL 0.9.x */ return TRUE; @@ -225,7 +224,7 @@ BOOL winpr_HMAC_Update(WINPR_HMAC_CTX* ctx, const BYTE* input, size_t ilen) #endif #elif defined(WITH_MBEDTLS) - mbedtls_md_context_t* mdctx = (mbedtls_md_context_t*) ctx; + mbedtls_md_context_t* mdctx = (mbedtls_md_context_t*)ctx; if (mbedtls_md_hmac_update(mdctx, input, ilen) == 0) return TRUE; @@ -246,7 +245,7 @@ BOOL winpr_HMAC_Final(WINPR_HMAC_CTX* ctx, BYTE* output, size_t olen) return FALSE; #if defined(WITH_OPENSSL) - hmac = (HMAC_CTX*) ctx; + hmac = (HMAC_CTX*)ctx; #if (OPENSSL_VERSION_NUMBER < 0x10000000L) || defined(LIBRESSL_VERSION_NUMBER) HMAC_Final(hmac, output, NULL); /* no return value on OpenSSL 0.9.x */ return TRUE; @@ -257,7 +256,7 @@ BOOL winpr_HMAC_Final(WINPR_HMAC_CTX* ctx, BYTE* output, size_t olen) #endif #elif defined(WITH_MBEDTLS) - mdctx = (mbedtls_md_context_t*) ctx; + mdctx = (mbedtls_md_context_t*)ctx; if (mbedtls_md_hmac_finish(mdctx, output) == 0) return TRUE; @@ -269,7 +268,7 @@ BOOL winpr_HMAC_Final(WINPR_HMAC_CTX* ctx, BYTE* output, size_t olen) void winpr_HMAC_Free(WINPR_HMAC_CTX* ctx) { #if defined(WITH_OPENSSL) - HMAC_CTX* hmac = (HMAC_CTX*) ctx; + HMAC_CTX* hmac = (HMAC_CTX*)ctx; if (hmac) { @@ -282,7 +281,7 @@ void winpr_HMAC_Free(WINPR_HMAC_CTX* ctx) } #elif defined(WITH_MBEDTLS) - mbedtls_md_context_t* hmac = (mbedtls_md_context_t*) ctx; + mbedtls_md_context_t* hmac = (mbedtls_md_context_t*)ctx; if (hmac) { @@ -293,8 +292,8 @@ void winpr_HMAC_Free(WINPR_HMAC_CTX* ctx) #endif } -BOOL winpr_HMAC(WINPR_MD_TYPE md, const BYTE* key, size_t keylen, - const BYTE* input, size_t ilen, BYTE* output, size_t olen) +BOOL winpr_HMAC(WINPR_MD_TYPE md, const BYTE* key, size_t keylen, const BYTE* input, size_t ilen, + BYTE* output, size_t olen) { BOOL result = FALSE; WINPR_HMAC_CTX* ctx = winpr_HMAC_New(); @@ -331,15 +330,15 @@ WINPR_DIGEST_CTX* winpr_Digest_New(void) #else mdctx = EVP_MD_CTX_new(); #endif - ctx = (WINPR_DIGEST_CTX*) mdctx; + ctx = (WINPR_DIGEST_CTX*)mdctx; #elif defined(WITH_MBEDTLS) mbedtls_md_context_t* mdctx; - mdctx = (mbedtls_md_context_t*) calloc(1, sizeof(mbedtls_md_context_t)); + mdctx = (mbedtls_md_context_t*)calloc(1, sizeof(mbedtls_md_context_t)); if (mdctx) mbedtls_md_init(mdctx); - ctx = (WINPR_DIGEST_CTX*) mdctx; + ctx = (WINPR_DIGEST_CTX*)mdctx; #endif return ctx; } @@ -347,7 +346,7 @@ WINPR_DIGEST_CTX* winpr_Digest_New(void) #if defined(WITH_OPENSSL) static BOOL winpr_Digest_Init_Internal(WINPR_DIGEST_CTX* ctx, const EVP_MD* evp) { - EVP_MD_CTX* mdctx = (EVP_MD_CTX*) ctx; + EVP_MD_CTX* mdctx = (EVP_MD_CTX*)ctx; if (!mdctx || !evp) return FALSE; @@ -361,7 +360,7 @@ static BOOL winpr_Digest_Init_Internal(WINPR_DIGEST_CTX* ctx, const EVP_MD* evp) #elif defined(WITH_MBEDTLS) static BOOL winpr_Digest_Init_Internal(WINPR_DIGEST_CTX* ctx, WINPR_MD_TYPE md) { - mbedtls_md_context_t* mdctx = (mbedtls_md_context_t*) ctx; + mbedtls_md_context_t* mdctx = (mbedtls_md_context_t*)ctx; mbedtls_md_type_t md_type = winpr_mbedtls_get_md_type(md); const mbedtls_md_info_t* md_info = mbedtls_md_info_from_type(md_type); @@ -386,7 +385,7 @@ static BOOL winpr_Digest_Init_Internal(WINPR_DIGEST_CTX* ctx, WINPR_MD_TYPE md) BOOL winpr_Digest_Init_Allow_FIPS(WINPR_DIGEST_CTX* ctx, WINPR_MD_TYPE md) { #if defined(WITH_OPENSSL) - EVP_MD_CTX* mdctx = (EVP_MD_CTX*) ctx; + EVP_MD_CTX* mdctx = (EVP_MD_CTX*)ctx; const EVP_MD* evp = winpr_openssl_get_evp_md(md); /* Only MD5 is supported for FIPS allow override */ @@ -418,13 +417,13 @@ BOOL winpr_Digest_Init(WINPR_DIGEST_CTX* ctx, WINPR_MD_TYPE md) BOOL winpr_Digest_Update(WINPR_DIGEST_CTX* ctx, const BYTE* input, size_t ilen) { #if defined(WITH_OPENSSL) - EVP_MD_CTX* mdctx = (EVP_MD_CTX*) ctx; + EVP_MD_CTX* mdctx = (EVP_MD_CTX*)ctx; if (EVP_DigestUpdate(mdctx, input, ilen) != 1) return FALSE; #elif defined(WITH_MBEDTLS) - mbedtls_md_context_t* mdctx = (mbedtls_md_context_t*) ctx; + mbedtls_md_context_t* mdctx = (mbedtls_md_context_t*)ctx; if (mbedtls_md_update(mdctx, input, ilen) != 0) return FALSE; @@ -436,13 +435,13 @@ BOOL winpr_Digest_Update(WINPR_DIGEST_CTX* ctx, const BYTE* input, size_t ilen) BOOL winpr_Digest_Final(WINPR_DIGEST_CTX* ctx, BYTE* output, size_t olen) { #if defined(WITH_OPENSSL) - EVP_MD_CTX* mdctx = (EVP_MD_CTX*) ctx; + EVP_MD_CTX* mdctx = (EVP_MD_CTX*)ctx; if (EVP_DigestFinal_ex(mdctx, output, NULL) == 1) return TRUE; #elif defined(WITH_MBEDTLS) - mbedtls_md_context_t* mdctx = (mbedtls_md_context_t*) ctx; + mbedtls_md_context_t* mdctx = (mbedtls_md_context_t*)ctx; if (mbedtls_md_finish(mdctx, output) == 0) return TRUE; @@ -454,7 +453,7 @@ BOOL winpr_Digest_Final(WINPR_DIGEST_CTX* ctx, BYTE* output, size_t olen) void winpr_Digest_Free(WINPR_DIGEST_CTX* ctx) { #if defined(WITH_OPENSSL) - EVP_MD_CTX* mdctx = (EVP_MD_CTX*) ctx; + EVP_MD_CTX* mdctx = (EVP_MD_CTX*)ctx; if (mdctx) { @@ -466,7 +465,7 @@ void winpr_Digest_Free(WINPR_DIGEST_CTX* ctx) } #elif defined(WITH_MBEDTLS) - mbedtls_md_context_t* mdctx = (mbedtls_md_context_t*) ctx; + mbedtls_md_context_t* mdctx = (mbedtls_md_context_t*)ctx; if (mdctx) { @@ -477,7 +476,8 @@ void winpr_Digest_Free(WINPR_DIGEST_CTX* ctx) #endif } -BOOL winpr_Digest_Allow_FIPS(WINPR_MD_TYPE md, const BYTE* input, size_t ilen, BYTE* output, size_t olen) +BOOL winpr_Digest_Allow_FIPS(WINPR_MD_TYPE md, const BYTE* input, size_t ilen, BYTE* output, + size_t olen) { BOOL result = FALSE; WINPR_DIGEST_CTX* ctx = winpr_Digest_New(); diff --git a/winpr/libwinpr/crypto/test/TestCryptoCertEnumCertificatesInStore.c b/winpr/libwinpr/crypto/test/TestCryptoCertEnumCertificatesInStore.c index 837e8ff74..868e9544e 100644 --- a/winpr/libwinpr/crypto/test/TestCryptoCertEnumCertificatesInStore.c +++ b/winpr/libwinpr/crypto/test/TestCryptoCertEnumCertificatesInStore.c @@ -16,7 +16,7 @@ int TestCryptoCertEnumCertificatesInStore(int argc, char* argv[]) { int index; DWORD status; - LPTSTR pszNameString; + LPTSTR pszNameString; HCERTSTORE hCertStore = NULL; PCCERT_CONTEXT pCertContext = NULL; @@ -27,11 +27,13 @@ int TestCryptoCertEnumCertificatesInStore(int argc, char* argv[]) /** * Requires elevated rights: - * hCertStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, (HCRYPTPROV_LEGACY) NULL, CERT_SYSTEM_STORE_LOCAL_MACHINE, _T("Remote Desktop")); + * hCertStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, (HCRYPTPROV_LEGACY) NULL, + * CERT_SYSTEM_STORE_LOCAL_MACHINE, _T("Remote Desktop")); */ - hCertStore = CertOpenSystemStore((HCRYPTPROV_LEGACY) NULL, _T("MY")); - // hCertStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, (HCRYPTPROV_LEGACY) NULL, CERT_SYSTEM_STORE_CURRENT_USER, _T("MY")); + hCertStore = CertOpenSystemStore((HCRYPTPROV_LEGACY)NULL, _T("MY")); + // hCertStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, (HCRYPTPROV_LEGACY) NULL, + // CERT_SYSTEM_STORE_CURRENT_USER, _T("MY")); if (!hCertStore) { @@ -47,17 +49,18 @@ int TestCryptoCertEnumCertificatesInStore(int argc, char* argv[]) if (status == 0) return -1; - pszNameString = (LPTSTR) calloc(status, sizeof(TCHAR)); + pszNameString = (LPTSTR)calloc(status, sizeof(TCHAR)); if (!pszNameString) { printf("Unable to allocate memory\n"); return -1; } - status = CertGetNameString(pCertContext, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0, NULL, pszNameString, status); + status = CertGetNameString(pCertContext, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0, NULL, + pszNameString, status); if (status == 0) { - free (pszNameString); + free(pszNameString); return -1; } @@ -78,4 +81,3 @@ int TestCryptoCertEnumCertificatesInStore(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/crypto/test/TestCryptoCipher.c b/winpr/libwinpr/crypto/test/TestCryptoCipher.c index 77155864e..11f765e6f 100644 --- a/winpr/libwinpr/crypto/test/TestCryptoCipher.c +++ b/winpr/libwinpr/crypto/test/TestCryptoCipher.c @@ -4,8 +4,6 @@ #include #include - - static BOOL test_crypto_cipher_aes_128_cbc() { WINPR_CIPHER_CTX* ctx; @@ -17,7 +15,8 @@ static BOOL test_crypto_cipher_aes_128_cbc() size_t ilen; size_t olen; size_t xlen; - const char plaintext[] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."; + const char plaintext[] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do " + "eiusmod tempor incididunt ut labore et dolore magna aliqua."; /* encrypt */ @@ -37,7 +36,6 @@ static BOOL test_crypto_cipher_aes_128_cbc() olen = 0; xlen = 0; - if (!winpr_Cipher_Update(ctx, ibuf, ilen, obuf, &olen)) { fprintf(stderr, "%s: winpr_Cipher_New (encrypt) failed\n", __FUNCTION__); @@ -54,13 +52,13 @@ static BOOL test_crypto_cipher_aes_128_cbc() if (xlen != ilen) { - fprintf(stderr, "%s: error, xlen (%"PRIuz") != ilen (%"PRIuz") (encrypt)\n", __FUNCTION__, xlen, ilen); + fprintf(stderr, "%s: error, xlen (%" PRIuz ") != ilen (%" PRIuz ") (encrypt)\n", + __FUNCTION__, xlen, ilen); goto out; } winpr_Cipher_Free(ctx); - /* decrypt */ if (!(ctx = winpr_Cipher_New(WINPR_CIPHER_AES_128_CBC, WINPR_DECRYPT, key, iv))) @@ -93,11 +91,12 @@ static BOOL test_crypto_cipher_aes_128_cbc() if (xlen != ilen) { - fprintf(stderr, "%s: error, xlen (%"PRIuz") != ilen (%"PRIuz") (decrypt)\n", __FUNCTION__, xlen, ilen); + fprintf(stderr, "%s: error, xlen (%" PRIuz ") != ilen (%" PRIuz ") (decrypt)\n", + __FUNCTION__, xlen, ilen); goto out; } - if (strcmp((const char*) obuf, plaintext)) + if (strcmp((const char*)obuf, plaintext)) { fprintf(stderr, "%s: error, decrypted data does not match plaintext\n", __FUNCTION__); goto out; @@ -110,9 +109,9 @@ out: return result; } -static const BYTE* TEST_RC4_KEY = (BYTE*) "Key"; +static const BYTE* TEST_RC4_KEY = (BYTE*)"Key"; static const char* TEST_RC4_PLAINTEXT = "Plaintext"; -static const BYTE* TEST_RC4_CIPHERTEXT = (BYTE*) "\xBB\xF3\x16\xE8\xD9\x40\xAF\x0A\xD3"; +static const BYTE* TEST_RC4_CIPHERTEXT = (BYTE*)"\xBB\xF3\x16\xE8\xD9\x40\xAF\x0A\xD3"; static BOOL test_crypto_cipher_rc4() { @@ -123,18 +122,19 @@ static BOOL test_crypto_cipher_rc4() len = strnlen(TEST_RC4_PLAINTEXT, sizeof(TEST_RC4_PLAINTEXT)); - if (!(text = (BYTE*) calloc(1, len))) + if (!(text = (BYTE*)calloc(1, len))) { - fprintf(stderr, "%s: failed to allocate text buffer (len=%"PRIuz")\n", __FUNCTION__, len); + fprintf(stderr, "%s: failed to allocate text buffer (len=%" PRIuz ")\n", __FUNCTION__, len); goto out; } - if ((ctx = winpr_RC4_New(TEST_RC4_KEY, strnlen((const char*)TEST_RC4_KEY, sizeof(TEST_RC4_KEY)))) == NULL) + if ((ctx = winpr_RC4_New(TEST_RC4_KEY, + strnlen((const char*)TEST_RC4_KEY, sizeof(TEST_RC4_KEY)))) == NULL) { fprintf(stderr, "%s: winpr_RC4_New failed\n", __FUNCTION__); goto out; } - rc = winpr_RC4_Update(ctx, len, (const BYTE*) TEST_RC4_PLAINTEXT, text); + rc = winpr_RC4_Update(ctx, len, (const BYTE*)TEST_RC4_PLAINTEXT, text); winpr_RC4_Free(ctx); if (!rc) { @@ -150,7 +150,8 @@ static BOOL test_crypto_cipher_rc4() actual = winpr_BinToHexString(text, len, FALSE); expected = winpr_BinToHexString(TEST_RC4_CIPHERTEXT, len, FALSE); - fprintf(stderr, "%s: unexpected RC4 ciphertext: Actual: %s Expected: %s\n", __FUNCTION__, actual, expected); + fprintf(stderr, "%s: unexpected RC4 ciphertext: Actual: %s Expected: %s\n", __FUNCTION__, + actual, expected); free(actual); free(expected); @@ -164,18 +165,18 @@ out: return rc; } -static const BYTE* TEST_RAND_DATA = (BYTE*) - "\x1F\xC2\xEE\x4C\xA3\x66\x80\xA2\xCE\xFE\x56\xB4\x9E\x08\x30\x96" - "\x33\x6A\xA9\x6D\x36\xFD\x3C\xB7\x83\x04\x4E\x5E\xDC\x22\xCD\xF3" - "\x48\xDF\x3A\x2A\x61\xF1\xA8\xFA\x1F\xC6\xC7\x1B\x81\xB4\xE1\x0E" - "\xCB\xA2\xEF\xA1\x12\x4A\x83\xE5\x1D\x72\x1D\x2D\x26\xA8\x6B\xC0"; +static const BYTE* TEST_RAND_DATA = + (BYTE*)"\x1F\xC2\xEE\x4C\xA3\x66\x80\xA2\xCE\xFE\x56\xB4\x9E\x08\x30\x96" + "\x33\x6A\xA9\x6D\x36\xFD\x3C\xB7\x83\x04\x4E\x5E\xDC\x22\xCD\xF3" + "\x48\xDF\x3A\x2A\x61\xF1\xA8\xFA\x1F\xC6\xC7\x1B\x81\xB4\xE1\x0E" + "\xCB\xA2\xEF\xA1\x12\x4A\x83\xE5\x1D\x72\x1D\x2D\x26\xA8\x6B\xC0"; -static const BYTE* TEST_CIPHER_KEY = (BYTE*) - "\x9D\x7C\xC0\xA1\x94\x3B\x07\x67\x2F\xD3\x83\x10\x51\x83\x38\x0E" - "\x1C\x74\x8C\x4E\x15\x79\xD6\xFF\xE2\xF0\x37\x7F\x8C\xD7\xD2\x13"; +static const BYTE* TEST_CIPHER_KEY = + (BYTE*)"\x9D\x7C\xC0\xA1\x94\x3B\x07\x67\x2F\xD3\x83\x10\x51\x83\x38\x0E" + "\x1C\x74\x8C\x4E\x15\x79\xD6\xFF\xE2\xF0\x37\x7F\x8C\xD7\xD2\x13"; -static const BYTE* TEST_CIPHER_IV = (BYTE*) - "\xFE\xE3\x9F\xF0\xD1\x5E\x37\x0C\xAB\xAB\x9B\x04\xF3\xDB\x99\x15"; +static const BYTE* TEST_CIPHER_IV = + (BYTE*)"\xFE\xE3\x9F\xF0\xD1\x5E\x37\x0C\xAB\xAB\x9B\x04\xF3\xDB\x99\x15"; static BOOL test_crypto_cipher_key() { @@ -187,8 +188,8 @@ static BOOL test_crypto_cipher_key() ZeroMemory(key, sizeof(key)); ZeroMemory(iv, sizeof(iv)); - status = winpr_Cipher_BytesToKey(WINPR_CIPHER_AES_256_CBC, WINPR_MD_SHA1, - salt, TEST_RAND_DATA, 64, 4, key, iv); + status = winpr_Cipher_BytesToKey(WINPR_CIPHER_AES_256_CBC, WINPR_MD_SHA1, salt, TEST_RAND_DATA, + 64, 4, key, iv); if (status != 32 || memcmp(key, TEST_CIPHER_KEY, 32) || memcmp(iv, TEST_CIPHER_IV, 16)) { @@ -204,7 +205,8 @@ static BOOL test_crypto_cipher_key() eivstr = winpr_BinToHexString(TEST_CIPHER_IV, 16, 0); fprintf(stderr, "Unexpected EVP_BytesToKey Key: Actual: %s, Expected: %s\n", akstr, ekstr); - fprintf(stderr, "Unexpected EVP_BytesToKey IV : Actual: %s, Expected: %s\n", aivstr, eivstr); + fprintf(stderr, "Unexpected EVP_BytesToKey IV : Actual: %s, Expected: %s\n", aivstr, + eivstr); free(akstr); free(ekstr); diff --git a/winpr/libwinpr/crypto/test/TestCryptoHash.c b/winpr/libwinpr/crypto/test/TestCryptoHash.c index b1302af6c..8b911866b 100644 --- a/winpr/libwinpr/crypto/test/TestCryptoHash.c +++ b/winpr/libwinpr/crypto/test/TestCryptoHash.c @@ -5,7 +5,8 @@ #include static const char TEST_MD5_DATA[] = "test"; -static const BYTE TEST_MD5_HASH[] = "\x09\x8f\x6b\xcd\x46\x21\xd3\x73\xca\xde\x4e\x83\x26\x27\xb4\xf6"; +static const BYTE TEST_MD5_HASH[] = + "\x09\x8f\x6b\xcd\x46\x21\xd3\x73\xca\xde\x4e\x83\x26\x27\xb4\xf6"; static BOOL test_crypto_hash_md5(void) { @@ -23,7 +24,8 @@ static BOOL test_crypto_hash_md5(void) fprintf(stderr, "%s: winpr_Digest_Init failed\n", __FUNCTION__); goto out; } - if (!winpr_Digest_Update(ctx, (const BYTE*) TEST_MD5_DATA, strnlen(TEST_MD5_DATA, sizeof(TEST_MD5_DATA)))) + if (!winpr_Digest_Update(ctx, (const BYTE*)TEST_MD5_DATA, + strnlen(TEST_MD5_DATA, sizeof(TEST_MD5_DATA)))) { fprintf(stderr, "%s: winpr_Digest_Update failed\n", __FUNCTION__); goto out; @@ -56,7 +58,8 @@ out: } static const char TEST_MD4_DATA[] = "test"; -static const BYTE TEST_MD4_HASH[] = "\xdb\x34\x6d\x69\x1d\x7a\xcc\x4d\xc2\x62\x5d\xb1\x9f\x9e\x3f\x52"; +static const BYTE TEST_MD4_HASH[] = + "\xdb\x34\x6d\x69\x1d\x7a\xcc\x4d\xc2\x62\x5d\xb1\x9f\x9e\x3f\x52"; static BOOL test_crypto_hash_md4(void) { @@ -74,7 +77,8 @@ static BOOL test_crypto_hash_md4(void) fprintf(stderr, "%s: winpr_Digest_Init failed\n", __FUNCTION__); goto out; } - if (!winpr_Digest_Update(ctx, (const BYTE*) TEST_MD4_DATA, strnlen(TEST_MD4_DATA, sizeof(TEST_MD4_DATA)))) + if (!winpr_Digest_Update(ctx, (const BYTE*)TEST_MD4_DATA, + strnlen(TEST_MD4_DATA, sizeof(TEST_MD4_DATA)))) { fprintf(stderr, "%s: winpr_Digest_Update failed\n", __FUNCTION__); goto out; @@ -107,7 +111,8 @@ out: } static const char TEST_SHA1_DATA[] = "test"; -static const BYTE TEST_SHA1_HASH[] = "\xa9\x4a\x8f\xe5\xcc\xb1\x9b\xa6\x1c\x4c\x08\x73\xd3\x91\xe9\x87\x98\x2f\xbb\xd3"; +static const BYTE TEST_SHA1_HASH[] = + "\xa9\x4a\x8f\xe5\xcc\xb1\x9b\xa6\x1c\x4c\x08\x73\xd3\x91\xe9\x87\x98\x2f\xbb\xd3"; static BOOL test_crypto_hash_sha1(void) { @@ -125,7 +130,8 @@ static BOOL test_crypto_hash_sha1(void) fprintf(stderr, "%s: winpr_Digest_Init failed\n", __FUNCTION__); goto out; } - if (!winpr_Digest_Update(ctx, (const BYTE*) TEST_SHA1_DATA, strnlen(TEST_SHA1_DATA, sizeof(TEST_SHA1_DATA)))) + if (!winpr_Digest_Update(ctx, (const BYTE*)TEST_SHA1_DATA, + strnlen(TEST_SHA1_DATA, sizeof(TEST_SHA1_DATA)))) { fprintf(stderr, "%s: winpr_Digest_Update failed\n", __FUNCTION__); goto out; @@ -159,8 +165,10 @@ out: } static const char TEST_HMAC_MD5_DATA[] = "Hi There"; -static const BYTE TEST_HMAC_MD5_KEY[] = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"; -static const BYTE TEST_HMAC_MD5_HASH[] = "\x92\x94\x72\x7a\x36\x38\xbb\x1c\x13\xf4\x8e\xf8\x15\x8b\xfc\x9d"; +static const BYTE TEST_HMAC_MD5_KEY[] = + "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"; +static const BYTE TEST_HMAC_MD5_HASH[] = + "\x92\x94\x72\x7a\x36\x38\xbb\x1c\x13\xf4\x8e\xf8\x15\x8b\xfc\x9d"; static BOOL test_crypto_hash_hmac_md5(void) { @@ -179,7 +187,8 @@ static BOOL test_crypto_hash_hmac_md5(void) fprintf(stderr, "%s: winpr_HMAC_Init failed\n", __FUNCTION__); goto out; } - if (!winpr_HMAC_Update(ctx, (const BYTE*) TEST_HMAC_MD5_DATA, strnlen(TEST_HMAC_MD5_DATA, sizeof(TEST_HMAC_MD5_DATA)))) + if (!winpr_HMAC_Update(ctx, (const BYTE*)TEST_HMAC_MD5_DATA, + strnlen(TEST_HMAC_MD5_DATA, sizeof(TEST_HMAC_MD5_DATA)))) { fprintf(stderr, "%s: winpr_HMAC_Update failed\n", __FUNCTION__); goto out; @@ -213,8 +222,10 @@ out: } static const char TEST_HMAC_SHA1_DATA[] = "Hi There"; -static const BYTE TEST_HMAC_SHA1_KEY[] = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"; -static const BYTE TEST_HMAC_SHA1_HASH[] = "\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"; +static const BYTE TEST_HMAC_SHA1_KEY[] = + "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"; +static const BYTE TEST_HMAC_SHA1_HASH[] = + "\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"; static BOOL test_crypto_hash_hmac_sha1(void) { @@ -233,7 +244,8 @@ static BOOL test_crypto_hash_hmac_sha1(void) fprintf(stderr, "%s: winpr_HMAC_Init failed\n", __FUNCTION__); goto out; } - if (!winpr_HMAC_Update(ctx, (const BYTE*) TEST_HMAC_SHA1_DATA, strnlen(TEST_HMAC_SHA1_DATA, sizeof(TEST_HMAC_SHA1_DATA)))) + if (!winpr_HMAC_Update(ctx, (const BYTE*)TEST_HMAC_SHA1_DATA, + strnlen(TEST_HMAC_SHA1_DATA, sizeof(TEST_HMAC_SHA1_DATA)))) { fprintf(stderr, "%s: winpr_HMAC_Update failed\n", __FUNCTION__); goto out; @@ -290,4 +302,3 @@ int TestCryptoHash(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/crypto/test/TestCryptoProtectData.c b/winpr/libwinpr/crypto/test/TestCryptoProtectData.c index faa24d3c5..45ef3e09d 100644 --- a/winpr/libwinpr/crypto/test/TestCryptoProtectData.c +++ b/winpr/libwinpr/crypto/test/TestCryptoProtectData.c @@ -8,4 +8,3 @@ int TestCryptoProtectData(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/crypto/test/TestCryptoProtectMemory.c b/winpr/libwinpr/crypto/test/TestCryptoProtectMemory.c index 6f7d1e150..f0993ef51 100644 --- a/winpr/libwinpr/crypto/test/TestCryptoProtectMemory.c +++ b/winpr/libwinpr/crypto/test/TestCryptoProtectMemory.c @@ -15,9 +15,10 @@ int TestCryptoProtectMemory(int argc, char* argv[]) BYTE* pCipherText; pPlainText = SECRET_PASSWORD_TEST; cbPlainText = strlen(pPlainText) + 1; - cbCipherText = cbPlainText + (CRYPTPROTECTMEMORY_BLOCK_SIZE - (cbPlainText % CRYPTPROTECTMEMORY_BLOCK_SIZE)); + cbCipherText = cbPlainText + + (CRYPTPROTECTMEMORY_BLOCK_SIZE - (cbPlainText % CRYPTPROTECTMEMORY_BLOCK_SIZE)); printf("cbPlainText: %d cbCipherText: %d\n", cbPlainText, cbCipherText); - pCipherText = (BYTE*) malloc(cbCipherText); + pCipherText = (BYTE*)malloc(cbCipherText); if (!pCipherText) { printf("Unable to allocate memory\n"); @@ -33,7 +34,8 @@ int TestCryptoProtectMemory(int argc, char* argv[]) return -1; } - printf("PlainText: %s (cbPlainText = %d, cbCipherText = %d)\n", pPlainText, cbPlainText, cbCipherText); + printf("PlainText: %s (cbPlainText = %d, cbCipherText = %d)\n", pPlainText, cbPlainText, + cbCipherText); winpr_HexDump("crypto.test", WLOG_DEBUG, pCipherText, cbCipherText); if (!CryptUnprotectMemory(pCipherText, cbCipherText, CRYPTPROTECTMEMORY_SAME_PROCESS)) diff --git a/winpr/libwinpr/crypto/test/TestCryptoRand.c b/winpr/libwinpr/crypto/test/TestCryptoRand.c index 60620f89c..b6c14b1c1 100644 --- a/winpr/libwinpr/crypto/test/TestCryptoRand.c +++ b/winpr/libwinpr/crypto/test/TestCryptoRand.c @@ -13,7 +13,7 @@ int TestCryptoRand(int argc, char* argv[]) winpr_RAND(rnd, sizeof(rnd)); str = winpr_BinToHexString(rnd, sizeof(rnd), FALSE); - //fprintf(stderr, "Rand: %s\n", str); + // fprintf(stderr, "Rand: %s\n", str); free(str); if (memcmp(rnd, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 16) == 0) diff --git a/winpr/libwinpr/dsparse/dsparse.c b/winpr/libwinpr/dsparse/dsparse.c index 0a09bbfe6..12adefe3f 100644 --- a/winpr/libwinpr/dsparse/dsparse.c +++ b/winpr/libwinpr/dsparse/dsparse.c @@ -46,25 +46,27 @@ #if !defined(_WIN32) || defined(_UWP) DWORD DsCrackSpnW(LPCWSTR pszSpn, DWORD* pcServiceClass, LPWSTR ServiceClass, DWORD* pcServiceName, - LPWSTR ServiceName, DWORD* pcInstanceName, LPWSTR InstanceName, USHORT* pInstancePort) + LPWSTR ServiceName, DWORD* pcInstanceName, LPWSTR InstanceName, + USHORT* pInstancePort) { return 0; } DWORD DsCrackSpnA(LPCSTR pszSpn, LPDWORD pcServiceClass, LPSTR ServiceClass, LPDWORD pcServiceName, - LPSTR ServiceName, LPDWORD pcInstanceName, LPSTR InstanceName, USHORT* pInstancePort) + LPSTR ServiceName, LPDWORD pcInstanceName, LPSTR InstanceName, + USHORT* pInstancePort) { return 0; } DWORD DsMakeSpnW(LPCWSTR ServiceClass, LPCWSTR ServiceName, LPCWSTR InstanceName, - USHORT InstancePort, LPCWSTR Referrer, DWORD* pcSpnLength, LPWSTR pszSpn) + USHORT InstancePort, LPCWSTR Referrer, DWORD* pcSpnLength, LPWSTR pszSpn) { return 0; } -DWORD DsMakeSpnA(LPCSTR ServiceClass, LPCSTR ServiceName, LPCSTR InstanceName, - USHORT InstancePort, LPCSTR Referrer, DWORD* pcSpnLength, LPSTR pszSpn) +DWORD DsMakeSpnA(LPCSTR ServiceClass, LPCSTR ServiceName, LPCSTR InstanceName, USHORT InstancePort, + LPCSTR Referrer, DWORD* pcSpnLength, LPSTR pszSpn) { DWORD SpnLength; DWORD ServiceClassLength; @@ -73,8 +75,8 @@ DWORD DsMakeSpnA(LPCSTR ServiceClass, LPCSTR ServiceName, LPCSTR InstanceName, if ((*pcSpnLength != 0) && (pszSpn == NULL)) return ERROR_INVALID_PARAMETER; - ServiceClassLength = (DWORD) strlen(ServiceClass); - ServiceNameLength = (DWORD) strlen(ServiceName); + ServiceClassLength = (DWORD)strlen(ServiceClass); + ServiceNameLength = (DWORD)strlen(ServiceName); SpnLength = ServiceClassLength + 1 + ServiceNameLength + 1; diff --git a/winpr/libwinpr/dsparse/test/TestDsCrackNames.c b/winpr/libwinpr/dsparse/test/TestDsCrackNames.c index 9264499e6..06537a4e7 100644 --- a/winpr/libwinpr/dsparse/test/TestDsCrackNames.c +++ b/winpr/libwinpr/dsparse/test/TestDsCrackNames.c @@ -5,7 +5,7 @@ #include #include -//LPCTSTR testName = _T("LAB1\\JohnDoe"); +// LPCTSTR testName = _T("LAB1\\JohnDoe"); int TestDsCrackNames(int argc, char* argv[]) { @@ -47,4 +47,3 @@ int TestDsCrackNames(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/dsparse/test/TestDsMakeSpn.c b/winpr/libwinpr/dsparse/test/TestDsMakeSpn.c index 07a725bc8..d620516ae 100644 --- a/winpr/libwinpr/dsparse/test/TestDsMakeSpn.c +++ b/winpr/libwinpr/dsparse/test/TestDsMakeSpn.c @@ -35,12 +35,13 @@ int TestDsMakeSpn(int argc, char* argv[]) if (SpnLength != 37) { - _tprintf(_T("DsMakeSpn: SpnLength mismatch: Actual: %")_T(PRIu32)_T(", Expected: 37\n"), SpnLength); + _tprintf(_T("DsMakeSpn: SpnLength mismatch: Actual: %") _T(PRIu32) _T(", Expected: 37\n"), + SpnLength); goto fail; } /* SpnLength includes null terminator */ - Spn = (LPTSTR) calloc(SpnLength, sizeof(TCHAR)); + Spn = (LPTSTR)calloc(SpnLength, sizeof(TCHAR)); if (!Spn) { @@ -68,4 +69,3 @@ fail: free(Spn); return rc; } - diff --git a/winpr/libwinpr/environment/environment.c b/winpr/libwinpr/environment/environment.c index 81a2daf97..b71a23836 100644 --- a/winpr/libwinpr/environment/environment.c +++ b/winpr/libwinpr/environment/environment.c @@ -64,7 +64,7 @@ DWORD GetCurrentDirectoryA(DWORD nBufferLength, LPSTR lpBuffer) { free(cwd); - return (DWORD) length; + return (DWORD)length; } else { @@ -77,7 +77,7 @@ DWORD GetCurrentDirectoryA(DWORD nBufferLength, LPSTR lpBuffer) if ((length + 1) > nBufferLength) { free(cwd); - return (DWORD) (length + 1); + return (DWORD)(length + 1); } memcpy(lpBuffer, cwd, length + 1); @@ -103,12 +103,14 @@ BOOL SetCurrentDirectoryW(LPCWSTR lpPathName) return TRUE; } -DWORD SearchPathA(LPCSTR lpPath, LPCSTR lpFileName, LPCSTR lpExtension, DWORD nBufferLength, LPSTR lpBuffer, LPSTR* lpFilePart) +DWORD SearchPathA(LPCSTR lpPath, LPCSTR lpFileName, LPCSTR lpExtension, DWORD nBufferLength, + LPSTR lpBuffer, LPSTR* lpFilePart) { return 0; } -DWORD SearchPathW(LPCWSTR lpPath, LPCWSTR lpFileName, LPCWSTR lpExtension, DWORD nBufferLength, LPWSTR lpBuffer, LPWSTR* lpFilePart) +DWORD SearchPathW(LPCWSTR lpPath, LPCWSTR lpFileName, LPCWSTR lpExtension, DWORD nBufferLength, + LPWSTR lpBuffer, LPWSTR* lpFilePart) { return 0; } @@ -180,7 +182,7 @@ BOOL SetEnvironmentVariableA(LPCSTR lpName, LPCSTR lpValue) if (lpValue) { - if (0 != setenv(lpName,lpValue,1)) + if (0 != setenv(lpName, lpValue, 1)) return FALSE; } else @@ -232,7 +234,7 @@ LPCH GetEnvironmentStringsA(VOID) envp = environ; cchEnvironmentBlock = 128; - lpszEnvironmentBlock = (LPCH) calloc(cchEnvironmentBlock, sizeof(CHAR)); + lpszEnvironmentBlock = (LPCH)calloc(cchEnvironmentBlock, sizeof(CHAR)); if (!lpszEnvironmentBlock) return NULL; @@ -246,7 +248,7 @@ LPCH GetEnvironmentStringsA(VOID) LPCH new_blk; new_size = cchEnvironmentBlock * 2; - new_blk = (LPCH) realloc(lpszEnvironmentBlock, new_size * sizeof(CHAR)); + new_blk = (LPCH)realloc(lpszEnvironmentBlock, new_size * sizeof(CHAR)); if (!new_blk) { free(lpszEnvironmentBlock); @@ -330,7 +332,7 @@ LPCH MergeEnvironmentStrings(PCSTR original, PCSTR merge) size_t foundMerge; char* foundEquals; - mergeStrings = (LPCSTR*) calloc(mergeArraySize, sizeof(char*)); + mergeStrings = (LPCSTR*)calloc(mergeArraySize, sizeof(char*)); if (!mergeStrings) return NULL; @@ -348,11 +350,11 @@ LPCH MergeEnvironmentStrings(PCSTR original, PCSTR merge) const char** new_str; mergeArraySize += 128; - new_str = (const char**) realloc((void*) mergeStrings, mergeArraySize * sizeof(char*)); + new_str = (const char**)realloc((void*)mergeStrings, mergeArraySize * sizeof(char*)); if (!new_str) { - free((void*) mergeStrings); + free((void*)mergeStrings); return NULL; } mergeStrings = new_str; @@ -366,17 +368,17 @@ LPCH MergeEnvironmentStrings(PCSTR original, PCSTR merge) offset = 0; cchEnvironmentBlock = 128; - lpszEnvironmentBlock = (LPCH) calloc(cchEnvironmentBlock, sizeof(CHAR)); + lpszEnvironmentBlock = (LPCH)calloc(cchEnvironmentBlock, sizeof(CHAR)); if (!lpszEnvironmentBlock) { - free((void*) mergeStrings); + free((void*)mergeStrings); return NULL; } - envp = original; + envp = original; - while ((original != NULL) && (*envp && *(envp+1))) + while ((original != NULL) && (*envp && *(envp + 1))) { size_t old_offset = offset; length = strlen(envp); @@ -385,12 +387,12 @@ LPCH MergeEnvironmentStrings(PCSTR original, PCSTR merge) { LPCH tmp; cchEnvironmentBlock *= 2; - tmp = (LPCH) realloc(lpszEnvironmentBlock, cchEnvironmentBlock * sizeof(CHAR)); + tmp = (LPCH)realloc(lpszEnvironmentBlock, cchEnvironmentBlock * sizeof(CHAR)); if (!tmp) { - free((void*) lpszEnvironmentBlock); - free((void*) mergeStrings); + free((void*)lpszEnvironmentBlock); + free((void*)mergeStrings); return NULL; } lpszEnvironmentBlock = tmp; @@ -400,7 +402,7 @@ LPCH MergeEnvironmentStrings(PCSTR original, PCSTR merge) // check if this value is in the mergeStrings foundMerge = 0; - for (run = 0; run < mergeStringLength; run ++) + for (run = 0; run < mergeStringLength; run++) { if (!mergeStrings[run]) continue; @@ -425,12 +427,13 @@ LPCH MergeEnvironmentStrings(PCSTR original, PCSTR merge) { LPCH tmp; cchEnvironmentBlock *= 2; - tmp = (LPCH) realloc(lpszEnvironmentBlock, cchEnvironmentBlock * sizeof(CHAR)); + tmp = + (LPCH)realloc(lpszEnvironmentBlock, cchEnvironmentBlock * sizeof(CHAR)); if (!tmp) { - free((void*) lpszEnvironmentBlock); - free((void*) mergeStrings); + free((void*)lpszEnvironmentBlock); + free((void*)mergeStrings); return NULL; } lpszEnvironmentBlock = tmp; @@ -453,11 +456,11 @@ LPCH MergeEnvironmentStrings(PCSTR original, PCSTR merge) offset += (length + 1); } - envp += (length +1); + envp += (length + 1); } // now merge the not already merged env - for (run = 0; run < mergeStringLength; run ++) + for (run = 0; run < mergeStringLength; run++) { if (!mergeStrings[run]) continue; @@ -468,12 +471,12 @@ LPCH MergeEnvironmentStrings(PCSTR original, PCSTR merge) { LPCH tmp; cchEnvironmentBlock *= 2; - tmp = (LPCH) realloc(lpszEnvironmentBlock, cchEnvironmentBlock * sizeof(CHAR)); + tmp = (LPCH)realloc(lpszEnvironmentBlock, cchEnvironmentBlock * sizeof(CHAR)); if (!tmp) { - free((void*) lpszEnvironmentBlock); - free((void*) mergeStrings); + free((void*)lpszEnvironmentBlock); + free((void*)mergeStrings); return NULL; } @@ -490,7 +493,7 @@ LPCH MergeEnvironmentStrings(PCSTR original, PCSTR merge) lpszEnvironmentBlock[offset] = '\0'; - free((void*) mergeStrings); + free((void*)mergeStrings); return lpszEnvironmentBlock; } @@ -514,7 +517,7 @@ DWORD GetEnvironmentVariableEBA(LPCSTR envBlock, LPCSTR lpName, LPSTR lpBuffer, while (*penvb && *(penvb + 1)) { fLength = strlen(penvb); - foundEquals = strstr(penvb,"="); + foundEquals = strstr(penvb, "="); if (!foundEquals) { @@ -526,7 +529,7 @@ DWORD GetEnvironmentVariableEBA(LPCSTR envBlock, LPCSTR lpName, LPSTR lpBuffer, if (nLength != lpNameLength) { - penvb += (fLength +1); + penvb += (fLength + 1); continue; } @@ -536,7 +539,7 @@ DWORD GetEnvironmentVariableEBA(LPCSTR envBlock, LPCSTR lpName, LPSTR lpBuffer, break; } - penvb += (fLength +1); + penvb += (fLength + 1); } if (!env) @@ -563,8 +566,8 @@ BOOL SetEnvironmentVariableEBA(LPSTR* envBlock, LPCSTR lpName, LPCSTR lpValue) if (lpValue) { - length = (int) (strlen(lpName) + strlen(lpValue) + 2); /* +2 because of = and \0 */ - envstr = (char*) malloc(length + 1); /* +1 because of closing \0 */ + length = (int)(strlen(lpName) + strlen(lpValue) + 2); /* +2 because of = and \0 */ + envstr = (char*)malloc(length + 1); /* +1 because of closing \0 */ if (!envstr) return FALSE; @@ -573,8 +576,8 @@ BOOL SetEnvironmentVariableEBA(LPSTR* envBlock, LPCSTR lpName, LPCSTR lpValue) } else { - length = (int) strlen(lpName) + 2; /* +2 because of = and \0 */ - envstr = (char*) malloc(length + 1); /* +1 because of closing \0 */ + length = (int)strlen(lpName) + 2; /* +2 because of = and \0 */ + envstr = (char*)malloc(length + 1); /* +1 because of closing \0 */ if (!envstr) return FALSE; @@ -584,7 +587,7 @@ BOOL SetEnvironmentVariableEBA(LPSTR* envBlock, LPCSTR lpName, LPCSTR lpValue) envstr[length] = '\0'; - newEB = MergeEnvironmentStrings((LPCSTR) *envBlock, envstr); + newEB = MergeEnvironmentStrings((LPCSTR)*envBlock, envstr); free(envstr); free(*envBlock); @@ -606,7 +609,7 @@ char** EnvironmentBlockToEnvpA(LPCH lpszEnvironmentBlock) if (!lpszEnvironmentBlock) return NULL; - p = (char*) lpszEnvironmentBlock; + p = (char*)lpszEnvironmentBlock; while (p[0] && p[1]) { @@ -616,9 +619,9 @@ char** EnvironmentBlockToEnvpA(LPCH lpszEnvironmentBlock) } index = 0; - p = (char*) lpszEnvironmentBlock; + p = (char*)lpszEnvironmentBlock; - envp = (char**) calloc(count + 1, sizeof(char*)); + envp = (char**)calloc(count + 1, sizeof(char*)); if (!envp) return NULL; envp[count] = NULL; diff --git a/winpr/libwinpr/environment/test/TestEnvironmentGetEnvironmentStrings.c b/winpr/libwinpr/environment/test/TestEnvironmentGetEnvironmentStrings.c index b037a9d88..cb0c5903a 100644 --- a/winpr/libwinpr/environment/test/TestEnvironmentGetEnvironmentStrings.c +++ b/winpr/libwinpr/environment/test/TestEnvironmentGetEnvironmentStrings.c @@ -16,7 +16,7 @@ int TestEnvironmentGetEnvironmentStrings(int argc, char* argv[]) lpszEnvironmentBlock = GetEnvironmentStrings(); - p = (TCHAR*) lpszEnvironmentBlock; + p = (TCHAR*)lpszEnvironmentBlock; while (p[0] && p[1]) { @@ -35,4 +35,3 @@ fail: return r; } - diff --git a/winpr/libwinpr/environment/test/TestEnvironmentGetSetEB.c b/winpr/libwinpr/environment/test/TestEnvironmentGetSetEB.c index da85d3c2e..17a8cbe28 100644 --- a/winpr/libwinpr/environment/test/TestEnvironmentGetSetEB.c +++ b/winpr/libwinpr/environment/test/TestEnvironmentGetSetEB.c @@ -21,7 +21,7 @@ int TestEnvironmentGetSetEB(int argc, char* argv[]) return -1; /* Get the variable itself */ - p = (LPSTR) malloc(length); + p = (LPSTR)malloc(length); if (!p) goto fail; @@ -100,7 +100,7 @@ int TestEnvironmentGetSetEB(int argc, char* argv[]) } free(lpszEnvironmentBlockNew); - lpszEnvironmentBlockNew = (LPTCH) calloc(1024, sizeof(TCHAR)); + lpszEnvironmentBlockNew = (LPTCH)calloc(1024, sizeof(TCHAR)); if (!lpszEnvironmentBlockNew) goto fail; @@ -132,4 +132,3 @@ fail: #endif return rc; } - diff --git a/winpr/libwinpr/environment/test/TestEnvironmentMergeEnvironmentStrings.c b/winpr/libwinpr/environment/test/TestEnvironmentMergeEnvironmentStrings.c index ee61203c6..944423f3c 100644 --- a/winpr/libwinpr/environment/test/TestEnvironmentMergeEnvironmentStrings.c +++ b/winpr/libwinpr/environment/test/TestEnvironmentMergeEnvironmentStrings.c @@ -14,7 +14,7 @@ int TestEnvironmentMergeEnvironmentStrings(int argc, char* argv[]) LPTCH lpszMergedEnvironmentBlock; lpszEnvironmentBlock = GetEnvironmentStrings(); lpszMergedEnvironmentBlock = MergeEnvironmentStrings(lpszEnvironmentBlock, lpsz2Merge); - p = (TCHAR*) lpszMergedEnvironmentBlock; + p = (TCHAR*)lpszMergedEnvironmentBlock; while (p[0] && p[1]) { @@ -28,4 +28,3 @@ int TestEnvironmentMergeEnvironmentStrings(int argc, char* argv[]) #endif return 0; } - diff --git a/winpr/libwinpr/environment/test/TestEnvironmentSetEnvironmentVariable.c b/winpr/libwinpr/environment/test/TestEnvironmentSetEnvironmentVariable.c index 776a51f33..c6d8b4b41 100644 --- a/winpr/libwinpr/environment/test/TestEnvironmentSetEnvironmentVariable.c +++ b/winpr/libwinpr/environment/test/TestEnvironmentSetEnvironmentVariable.c @@ -23,7 +23,7 @@ int TestEnvironmentSetEnvironmentVariable(int argc, char* argv[]) return -1; } - lpBuffer = (LPSTR) malloc(nSize); + lpBuffer = (LPSTR)malloc(nSize); if (!lpBuffer) return -1; @@ -66,4 +66,3 @@ fail: free(lpBuffer); return rc; } - diff --git a/winpr/libwinpr/error/error.c b/winpr/libwinpr/error/error.c index 621f67d17..65dc65f51 100644 --- a/winpr/libwinpr/error/error.c +++ b/winpr/libwinpr/error/error.c @@ -60,12 +60,11 @@ VOID SetLastError(DWORD dwErrCode) VOID RestoreLastError(DWORD dwErrCode) { - } -VOID RaiseException(DWORD dwExceptionCode, DWORD dwExceptionFlags, DWORD nNumberOfArguments, CONST ULONG_PTR* lpArguments) +VOID RaiseException(DWORD dwExceptionCode, DWORD dwExceptionFlags, DWORD nNumberOfArguments, + CONST ULONG_PTR* lpArguments) { - } LONG UnhandledExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo) @@ -73,7 +72,8 @@ LONG UnhandledExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo) return 0; } -LPTOP_LEVEL_EXCEPTION_FILTER SetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter) +LPTOP_LEVEL_EXCEPTION_FILTER +SetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter) { return NULL; } diff --git a/winpr/libwinpr/error/test/TestErrorSetLastError.c b/winpr/libwinpr/error/test/TestErrorSetLastError.c index 5ddf5cc9d..9cbfcc197 100644 --- a/winpr/libwinpr/error/test/TestErrorSetLastError.c +++ b/winpr/libwinpr/error/test/TestErrorSetLastError.c @@ -28,7 +28,7 @@ static int status = 0; -LONG *pLoopCount = NULL; +LONG* pLoopCount = NULL; BOOL bStopTest = FALSE; static DWORD WINAPI test_error_thread(LPVOID arg) @@ -37,15 +37,17 @@ static DWORD WINAPI test_error_thread(LPVOID arg) DWORD dwErrorSet; DWORD dwErrorGet; - id = (int) (size_t) arg; + id = (int)(size_t)arg; - do { + do + { dwErrorSet = (DWORD)rand(); SetLastError(dwErrorSet); if ((dwErrorGet = GetLastError()) != dwErrorSet) { - printf("GetLastError() failure (thread %d): Expected: 0x%08"PRIX32", Actual: 0x%08"PRIX32"\n", - id, dwErrorSet, dwErrorGet); + printf("GetLastError() failure (thread %d): Expected: 0x%08" PRIX32 + ", Actual: 0x%08" PRIX32 "\n", + id, dwErrorSet, dwErrorGet); if (!status) status = -1; break; @@ -73,8 +75,8 @@ int TestErrorSetLastError(int argc, char* argv[]) if (error != ERROR_ACCESS_DENIED) { - printf("GetLastError() failure: Expected: 0x%08X, Actual: 0x%08"PRIX32"\n", - ERROR_ACCESS_DENIED, error); + printf("GetLastError() failure: Expected: 0x%08X, Actual: 0x%08" PRIX32 "\n", + ERROR_ACCESS_DENIED, error); return -1; } @@ -88,7 +90,7 @@ int TestErrorSetLastError(int argc, char* argv[]) for (i = 0; i < 4; i++) { - if (!(threads[i] = CreateThread(NULL, 0, test_error_thread, (void*) (size_t) 0, 0, NULL))) + if (!(threads[i] = CreateThread(NULL, 0, test_error_thread, (void*)(size_t)0, 0, NULL))) { printf("Failed to create thread #%d\n", i); return -1; @@ -113,8 +115,8 @@ int TestErrorSetLastError(int argc, char* argv[]) if (error != ERROR_ACCESS_DENIED) { - printf("GetLastError() failure: Expected: 0x%08X, Actual: 0x%08"PRIX32"\n", - ERROR_ACCESS_DENIED, error); + printf("GetLastError() failure: Expected: 0x%08X, Actual: 0x%08" PRIX32 "\n", + ERROR_ACCESS_DENIED, error); return -1; } @@ -124,8 +126,7 @@ int TestErrorSetLastError(int argc, char* argv[]) return -1; } - printf("Completed %"PRId32" iterations.\n", *pLoopCount); + printf("Completed %" PRId32 " iterations.\n", *pLoopCount); return status; } - diff --git a/winpr/libwinpr/file/file.c b/winpr/libwinpr/file/file.c index e27c1158c..617aee6c0 100644 --- a/winpr/libwinpr/file/file.c +++ b/winpr/libwinpr/file/file.c @@ -57,10 +57,9 @@ #include #endif - static BOOL FileIsHandled(HANDLE handle) { - WINPR_FILE* pFile = (WINPR_FILE*) handle; + WINPR_FILE* pFile = (WINPR_FILE*)handle; if (!pFile || (pFile->Type != HANDLE_TYPE_FILE)) { @@ -73,7 +72,7 @@ static BOOL FileIsHandled(HANDLE handle) static int FileGetFd(HANDLE handle) { - WINPR_FILE *file= (WINPR_FILE*)handle; + WINPR_FILE* file = (WINPR_FILE*)handle; if (!FileIsHandled(handle)) return -1; @@ -81,8 +80,9 @@ static int FileGetFd(HANDLE handle) return fileno(file->fp); } -static BOOL FileCloseHandle(HANDLE handle) { - WINPR_FILE* file = (WINPR_FILE *)handle; +static BOOL FileCloseHandle(HANDLE handle) +{ + WINPR_FILE* file = (WINPR_FILE*)handle; if (!FileIsHandled(handle)) return FALSE; @@ -104,7 +104,7 @@ static BOOL FileCloseHandle(HANDLE handle) { static BOOL FileSetEndOfFile(HANDLE hFile) { - WINPR_FILE* pFile = (WINPR_FILE*) hFile; + WINPR_FILE* pFile = (WINPR_FILE*)hFile; INT64 size; if (!hFile) @@ -114,8 +114,8 @@ static BOOL FileSetEndOfFile(HANDLE hFile) if (ftruncate(fileno(pFile->fp), size) < 0) { - WLog_ERR(TAG, "ftruncate %s failed with %s [0x%08X]", - pFile->lpFileName, strerror(errno), errno); + WLog_ERR(TAG, "ftruncate %s failed with %s [0x%08X]", pFile->lpFileName, strerror(errno), + errno); SetLastError(map_posix_err(errno)); return FALSE; } @@ -123,11 +123,10 @@ static BOOL FileSetEndOfFile(HANDLE hFile) return TRUE; } - -static DWORD FileSetFilePointer(HANDLE hFile, LONG lDistanceToMove, - PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod) +static DWORD FileSetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, + DWORD dwMoveMethod) { - WINPR_FILE* pFile = (WINPR_FILE*) hFile; + WINPR_FILE* pFile = (WINPR_FILE*)hFile; INT64 offset; int whence; @@ -141,60 +140,61 @@ static DWORD FileSetFilePointer(HANDLE hFile, LONG lDistanceToMove, offset = (INT64)(((UINT64)*lpDistanceToMoveHigh << 32U) | (UINT64)lDistanceToMove); } else - offset = lDistanceToMove; + offset = lDistanceToMove; - switch(dwMoveMethod) + switch (dwMoveMethod) { - case FILE_BEGIN: - whence = SEEK_SET; - break; - case FILE_END: - whence = SEEK_END; - break; - case FILE_CURRENT: - whence = SEEK_CUR; - break; - default: - return INVALID_SET_FILE_POINTER; + case FILE_BEGIN: + whence = SEEK_SET; + break; + case FILE_END: + whence = SEEK_END; + break; + case FILE_CURRENT: + whence = SEEK_CUR; + break; + default: + return INVALID_SET_FILE_POINTER; } if (_fseeki64(pFile->fp, offset, whence)) { - WLog_ERR(TAG, "_fseeki64(%s) failed with %s [0x%08X]", pFile->lpFileName, - strerror(errno), errno); + WLog_ERR(TAG, "_fseeki64(%s) failed with %s [0x%08X]", pFile->lpFileName, strerror(errno), + errno); return INVALID_SET_FILE_POINTER; } return _ftelli64(pFile->fp); } -static BOOL FileSetFilePointerEx(HANDLE hFile, LARGE_INTEGER liDistanceToMove, PLARGE_INTEGER lpNewFilePointer, DWORD dwMoveMethod) +static BOOL FileSetFilePointerEx(HANDLE hFile, LARGE_INTEGER liDistanceToMove, + PLARGE_INTEGER lpNewFilePointer, DWORD dwMoveMethod) { - WINPR_FILE* pFile = (WINPR_FILE*) hFile; + WINPR_FILE* pFile = (WINPR_FILE*)hFile; int whence; if (!hFile) return FALSE; - switch(dwMoveMethod) + switch (dwMoveMethod) { - case FILE_BEGIN: - whence = SEEK_SET; - break; - case FILE_END: - whence = SEEK_END; - break; - case FILE_CURRENT: - whence = SEEK_CUR; - break; - default: - return FALSE; + case FILE_BEGIN: + whence = SEEK_SET; + break; + case FILE_END: + whence = SEEK_END; + break; + case FILE_CURRENT: + whence = SEEK_CUR; + break; + default: + return FALSE; } if (_fseeki64(pFile->fp, liDistanceToMove.QuadPart, whence)) { - WLog_ERR(TAG, "_fseeki64(%s) failed with %s [0x%08X]", pFile->lpFileName, - strerror(errno), errno); + WLog_ERR(TAG, "_fseeki64(%s) failed with %s [0x%08X]", pFile->lpFileName, strerror(errno), + errno); return FALSE; } @@ -205,7 +205,7 @@ static BOOL FileSetFilePointerEx(HANDLE hFile, LARGE_INTEGER liDistanceToMove, P } static BOOL FileRead(PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, - LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped) + LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped) { size_t io_status; WINPR_FILE* file; @@ -221,7 +221,7 @@ static BOOL FileRead(PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, if (!Object) return FALSE; - file = (WINPR_FILE *)Object; + file = (WINPR_FILE*)Object; clearerr(file->fp); io_status = fread(lpBuffer, 1, nNumberOfBytesToRead, file->fp); @@ -246,7 +246,7 @@ static BOOL FileRead(PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, } static BOOL FileWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, - LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped) + LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped) { size_t io_status; WINPR_FILE* file; @@ -261,7 +261,7 @@ static BOOL FileWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrit if (!Object) return FALSE; - file = (WINPR_FILE *)Object; + file = (WINPR_FILE*)Object; clearerr(file->fp); io_status = fwrite(lpBuffer, 1, nNumberOfBytesToWrite, file->fp); @@ -283,21 +283,21 @@ static DWORD FileGetFileSize(HANDLE Object, LPDWORD lpFileSizeHigh) if (!Object) return 0; - file = (WINPR_FILE *)Object; + file = (WINPR_FILE*)Object; cur = _ftelli64(file->fp); if (cur < 0) { - WLog_ERR(TAG, "_ftelli64(%s) failed with %s [0x%08X]", file->lpFileName, - strerror(errno), errno); + WLog_ERR(TAG, "_ftelli64(%s) failed with %s [0x%08X]", file->lpFileName, strerror(errno), + errno); return INVALID_FILE_SIZE; } if (_fseeki64(file->fp, 0, SEEK_END) != 0) { - WLog_ERR(TAG, "_fseeki64(%s) failed with %s [0x%08X]", file->lpFileName, - strerror(errno), errno); + WLog_ERR(TAG, "_fseeki64(%s) failed with %s [0x%08X]", file->lpFileName, strerror(errno), + errno); return INVALID_FILE_SIZE; } @@ -305,15 +305,15 @@ static DWORD FileGetFileSize(HANDLE Object, LPDWORD lpFileSizeHigh) if (size < 0) { - WLog_ERR(TAG, "_ftelli64(%s) failed with %s [0x%08X]", file->lpFileName, - strerror(errno), errno); + WLog_ERR(TAG, "_ftelli64(%s) failed with %s [0x%08X]", file->lpFileName, strerror(errno), + errno); return INVALID_FILE_SIZE; } if (_fseeki64(file->fp, cur, SEEK_SET) != 0) { - WLog_ERR(TAG, "_ftelli64(%s) failed with %s [0x%08X]", file->lpFileName, - strerror(errno), errno); + WLog_ERR(TAG, "_ftelli64(%s) failed with %s [0x%08X]", file->lpFileName, strerror(errno), + errno); return INVALID_FILE_SIZE; } @@ -324,9 +324,9 @@ static DWORD FileGetFileSize(HANDLE Object, LPDWORD lpFileSizeHigh) } static BOOL FileLockFileEx(HANDLE hFile, DWORD dwFlags, DWORD dwReserved, - DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh, - LPOVERLAPPED lpOverlapped) - { + DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh, + LPOVERLAPPED lpOverlapped) +{ #ifdef __sun struct flock lock; int lckcmd; @@ -366,9 +366,9 @@ static BOOL FileLockFileEx(HANDLE hFile, DWORD dwFlags, DWORD dwReserved, else lckcmd = F_SETLKW; - if(fcntl(fileno(pFile->fp), lckcmd, &lock) == -1) { - WLog_ERR(TAG, "F_SETLK failed with %s [0x%08X]", - strerror(errno), errno); + if (fcntl(fileno(pFile->fp), lckcmd, &lock) == -1) + { + WLog_ERR(TAG, "F_SETLK failed with %s [0x%08X]", strerror(errno), errno); return FALSE; } #else @@ -382,8 +382,7 @@ static BOOL FileLockFileEx(HANDLE hFile, DWORD dwFlags, DWORD dwReserved, if (flock(fileno(pFile->fp), lock) < 0) { - WLog_ERR(TAG, "flock failed with %s [0x%08X]", - strerror(errno), errno); + WLog_ERR(TAG, "flock failed with %s [0x%08X]", strerror(errno), errno); return FALSE; } #endif @@ -394,7 +393,7 @@ static BOOL FileLockFileEx(HANDLE hFile, DWORD dwFlags, DWORD dwReserved, } static BOOL FileUnlockFile(HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, - DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh) + DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh) { WINPR_FILE* pFile = (WINPR_FILE*)hFile; #ifdef __sun @@ -417,16 +416,16 @@ static BOOL FileUnlockFile(HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffs lock.l_type = F_UNLCK; if (fcntl(fileno(pFile->fp), F_GETLK, &lock) == -1) { - WLog_ERR(TAG, "F_UNLCK on %s failed with %s [0x%08X]", - pFile->lpFileName, strerror(errno), errno); + WLog_ERR(TAG, "F_UNLCK on %s failed with %s [0x%08X]", pFile->lpFileName, strerror(errno), + errno); return FALSE; } #else if (flock(fileno(pFile->fp), LOCK_UN) < 0) { - WLog_ERR(TAG, "flock(LOCK_UN) %s failed with %s [0x%08X]", - pFile->lpFileName, strerror(errno), errno); + WLog_ERR(TAG, "flock(LOCK_UN) %s failed with %s [0x%08X]", pFile->lpFileName, + strerror(errno), errno); return FALSE; } #endif @@ -435,7 +434,7 @@ static BOOL FileUnlockFile(HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffs } static BOOL FileUnlockFileEx(HANDLE hFile, DWORD dwReserved, DWORD nNumberOfBytesToUnlockLow, - DWORD nNumberOfBytesToUnlockHigh, LPOVERLAPPED lpOverlapped) + DWORD nNumberOfBytesToUnlockHigh, LPOVERLAPPED lpOverlapped) { WINPR_FILE* pFile = (WINPR_FILE*)hFile; #ifdef __sun @@ -465,15 +464,15 @@ static BOOL FileUnlockFileEx(HANDLE hFile, DWORD dwReserved, DWORD nNumberOfByte lock.l_type = F_UNLCK; if (fcntl(fileno(pFile->fp), F_GETLK, &lock) == -1) { - WLog_ERR(TAG, "F_UNLCK on %s failed with %s [0x%08X]", - pFile->lpFileName, strerror(errno), errno); + WLog_ERR(TAG, "F_UNLCK on %s failed with %s [0x%08X]", pFile->lpFileName, strerror(errno), + errno); return FALSE; } #else if (flock(fileno(pFile->fp), LOCK_UN) < 0) { - WLog_ERR(TAG, "flock(LOCK_UN) %s failed with %s [0x%08X]", - pFile->lpFileName, strerror(errno), errno); + WLog_ERR(TAG, "flock(LOCK_UN) %s failed with %s [0x%08X]", pFile->lpFileName, + strerror(errno), errno); return FALSE; } #endif @@ -484,8 +483,7 @@ static BOOL FileUnlockFileEx(HANDLE hFile, DWORD dwReserved, DWORD nNumberOfByte static UINT64 FileTimeToUS(const FILETIME* ft) { const UINT64 EPOCH_DIFF = 11644473600ULL * 1000000ULL; - UINT64 tmp = ((UINT64)ft->dwHighDateTime) << 32 - | ft->dwLowDateTime; + UINT64 tmp = ((UINT64)ft->dwHighDateTime) << 32 | ft->dwLowDateTime; tmp /= 10; /* 100ns steps to 1us step */ tmp -= EPOCH_DIFF; return tmp; @@ -586,77 +584,70 @@ static BOOL FileSetFileTime(HANDLE hFile, const FILETIME* lpCreationTime, return TRUE; } -static HANDLE_OPS fileOps = { - FileIsHandled, - FileCloseHandle, - FileGetFd, - NULL, /* CleanupHandle */ - FileRead, - NULL, /* FileReadEx */ - NULL, /* FileReadScatter */ - FileWrite, - NULL, /* FileWriteEx */ - NULL, /* FileWriteGather */ - FileGetFileSize, - NULL, /* FlushFileBuffers */ - FileSetEndOfFile, - FileSetFilePointer, - FileSetFilePointerEx, - NULL, /* FileLockFile */ - FileLockFileEx, - FileUnlockFile, - FileUnlockFileEx, - FileSetFileTime -}; +static HANDLE_OPS fileOps = { FileIsHandled, + FileCloseHandle, + FileGetFd, + NULL, /* CleanupHandle */ + FileRead, + NULL, /* FileReadEx */ + NULL, /* FileReadScatter */ + FileWrite, + NULL, /* FileWriteEx */ + NULL, /* FileWriteGather */ + FileGetFileSize, + NULL, /* FlushFileBuffers */ + FileSetEndOfFile, + FileSetFilePointer, + FileSetFilePointerEx, + NULL, /* FileLockFile */ + FileLockFileEx, + FileUnlockFile, + FileUnlockFileEx, + FileSetFileTime }; static HANDLE_OPS shmOps = { - FileIsHandled, - FileCloseHandle, - FileGetFd, - NULL, /* CleanupHandle */ - FileRead, - NULL, /* FileReadEx */ - NULL, /* FileReadScatter */ - FileWrite, - NULL, /* FileWriteEx */ - NULL, /* FileWriteGather */ - NULL, /* FileGetFileSize */ - NULL, /* FlushFileBuffers */ - NULL, /* FileSetEndOfFile */ - NULL, /* FileSetFilePointer */ - NULL, /* SetFilePointerEx */ - NULL, /* FileLockFile */ - NULL, /* FileLockFileEx */ - NULL, /* FileUnlockFile */ - NULL, /* FileUnlockFileEx */ - NULL /* FileSetFileTime */ + FileIsHandled, FileCloseHandle, + FileGetFd, NULL, /* CleanupHandle */ + FileRead, NULL, /* FileReadEx */ + NULL, /* FileReadScatter */ + FileWrite, NULL, /* FileWriteEx */ + NULL, /* FileWriteGather */ + NULL, /* FileGetFileSize */ + NULL, /* FlushFileBuffers */ + NULL, /* FileSetEndOfFile */ + NULL, /* FileSetFilePointer */ + NULL, /* SetFilePointerEx */ + NULL, /* FileLockFile */ + NULL, /* FileLockFileEx */ + NULL, /* FileUnlockFile */ + NULL, /* FileUnlockFileEx */ + NULL /* FileSetFileTime */ }; - static const char* FileGetMode(DWORD dwDesiredAccess, DWORD dwCreationDisposition, BOOL* create) { - BOOL writeable = (dwDesiredAccess & (GENERIC_WRITE | FILE_WRITE_DATA | FILE_APPEND_DATA)) != 0; + BOOL writeable = (dwDesiredAccess & (GENERIC_WRITE | FILE_WRITE_DATA | FILE_APPEND_DATA)) != 0; - switch(dwCreationDisposition) + switch (dwCreationDisposition) { - case CREATE_ALWAYS: - *create = TRUE; - return (writeable) ? "wb+" : "rwb"; - case CREATE_NEW: - *create = TRUE; - return "wb+"; - case OPEN_ALWAYS: - *create = TRUE; - return "rb+"; - case OPEN_EXISTING: - *create = FALSE; - return (writeable) ? "rb+" : "rb"; - case TRUNCATE_EXISTING: - *create = FALSE; - return "wb+"; - default: - *create = FALSE; - return ""; + case CREATE_ALWAYS: + *create = TRUE; + return (writeable) ? "wb+" : "rwb"; + case CREATE_NEW: + *create = TRUE; + return "wb+"; + case OPEN_ALWAYS: + *create = TRUE; + return "rb+"; + case OPEN_EXISTING: + *create = FALSE; + return (writeable) ? "rb+" : "rb"; + case TRUNCATE_EXISTING: + *create = FALSE; + return "wb+"; + default: + *create = FALSE; + return ""; } } @@ -694,7 +685,7 @@ UINT32 map_posix_err(int fs_errno) break; case EEXIST: - rc = ERROR_FILE_EXISTS; + rc = ERROR_FILE_EXISTS; break; case EISDIR: @@ -706,17 +697,18 @@ UINT32 map_posix_err(int fs_errno) break; default: - WLog_ERR(TAG, "Missing ERRNO mapping %s [%d]", - strerror(fs_errno), fs_errno); + WLog_ERR(TAG, "Missing ERRNO mapping %s [%d]", strerror(fs_errno), fs_errno); rc = STATUS_UNSUCCESSFUL; break; } - + return rc; } -static HANDLE FileCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, - DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) +static HANDLE FileCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, + DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, + HANDLE hTemplateFile) { WINPR_FILE* pFile; BOOL create; @@ -736,7 +728,7 @@ static HANDLE FileCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dw return INVALID_HANDLE_VALUE; } - pFile = (WINPR_FILE*) calloc(1, sizeof(WINPR_FILE)); + pFile = (WINPR_FILE*)calloc(1, sizeof(WINPR_FILE)); if (!pFile) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); @@ -852,7 +844,7 @@ static HANDLE FileCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dw #else WLog_ERR(TAG, "flock failed with %s [0x%08X]", #endif - strerror(errno), errno); + strerror(errno), errno); SetLastError(map_posix_err(errno)); FileCloseHandle(pFile); return INVALID_HANDLE_VALUE; @@ -861,10 +853,10 @@ static HANDLE FileCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dw pFile->bLocked = TRUE; } - if (fstat(fileno(pFile->fp), &st)==0 && dwFlagsAndAttributes & FILE_ATTRIBUTE_READONLY) + if (fstat(fileno(pFile->fp), &st) == 0 && dwFlagsAndAttributes & FILE_ATTRIBUTE_READONLY) { - st.st_mode &= ~(S_IWUSR|S_IWGRP|S_IWOTH); - fchmod(fileno(pFile->fp), st.st_mode); + st.st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH); + fchmod(fileno(pFile->fp), st.st_mode); } SetLastError(STATUS_SUCCESS); @@ -876,25 +868,20 @@ BOOL IsFileDevice(LPCTSTR lpDeviceName) return TRUE; } -HANDLE_CREATOR _FileHandleCreator = -{ - IsFileDevice, - FileCreateFileA -}; +HANDLE_CREATOR _FileHandleCreator = { IsFileDevice, FileCreateFileA }; -HANDLE_CREATOR *GetFileHandleCreator(void) +HANDLE_CREATOR* GetFileHandleCreator(void) { return &_FileHandleCreator; } - -static WINPR_FILE *FileHandle_New(FILE* fp) +static WINPR_FILE* FileHandle_New(FILE* fp) { - WINPR_FILE *pFile; + WINPR_FILE* pFile; char name[MAX_PATH]; _snprintf(name, sizeof(name), "device_%d", fileno(fp)); - pFile = (WINPR_FILE*) calloc(1, sizeof(WINPR_FILE)); + pFile = (WINPR_FILE*)calloc(1, sizeof(WINPR_FILE)); if (!pFile) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); @@ -911,7 +898,7 @@ static WINPR_FILE *FileHandle_New(FILE* fp) HANDLE GetStdHandle(DWORD nStdHandle) { FILE* fp; - WINPR_FILE *pFile; + WINPR_FILE* pFile; switch (nStdHandle) { @@ -944,8 +931,8 @@ BOOL SetStdHandleEx(DWORD dwStdHandle, HANDLE hNewHandle, HANDLE* phOldHandle) return FALSE; } -BOOL GetDiskFreeSpaceA(LPCSTR lpRootPathName, LPDWORD lpSectorsPerCluster, - LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters) +BOOL GetDiskFreeSpaceA(LPCSTR lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, + LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters) { #if defined(ANDROID) #define STATVFS statfs @@ -963,7 +950,8 @@ BOOL GetDiskFreeSpaceA(LPCSTR lpRootPathName, LPDWORD lpSectorsPerCluster, } BOOL GetDiskFreeSpaceW(LPCWSTR lpwRootPathName, LPDWORD lpSectorsPerCluster, - LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters) + LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, + LPDWORD lpTotalNumberOfClusters) { LPSTR lpRootPathName; BOOL ret; @@ -974,7 +962,7 @@ BOOL GetDiskFreeSpaceW(LPCWSTR lpwRootPathName, LPDWORD lpSectorsPerCluster, return FALSE; } ret = GetDiskFreeSpaceA(lpRootPathName, lpSectorsPerCluster, lpBytesPerSector, - lpNumberOfFreeClusters, lpTotalNumberOfClusters); + lpNumberOfFreeClusters, lpTotalNumberOfClusters); free(lpRootPathName); return ret; } @@ -1051,9 +1039,8 @@ BOOL ValidFileNameComponent(LPCWSTR lpFileName) /* Reserved characters */ for (c = lpFileName; *c; c++) { - if ((*c == L'<') || (*c == L'>') || (*c == L':') || - (*c == L'"') || (*c == L'/') || (*c == L'\\') || - (*c == L'|') || (*c == L'?') || (*c == L'*')) + if ((*c == L'<') || (*c == L'>') || (*c == L':') || (*c == L'"') || (*c == L'/') || + (*c == L'\\') || (*c == L'|') || (*c == L'?') || (*c == L'*')) { return FALSE; } @@ -1066,8 +1053,9 @@ BOOL ValidFileNameComponent(LPCWSTR lpFileName) #ifdef _UWP -HANDLE CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, - DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) +HANDLE CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, + DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) { HANDLE hFile; CREATEFILE2_EXTENDED_PARAMETERS params; @@ -1076,43 +1064,78 @@ HANDLE CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, params.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS); - if (dwFlagsAndAttributes & FILE_FLAG_BACKUP_SEMANTICS) params.dwFileFlags |= FILE_FLAG_BACKUP_SEMANTICS; - if (dwFlagsAndAttributes & FILE_FLAG_DELETE_ON_CLOSE) params.dwFileFlags |= FILE_FLAG_DELETE_ON_CLOSE; - if (dwFlagsAndAttributes & FILE_FLAG_NO_BUFFERING) params.dwFileFlags |= FILE_FLAG_NO_BUFFERING; - if (dwFlagsAndAttributes & FILE_FLAG_OPEN_NO_RECALL) params.dwFileFlags |= FILE_FLAG_OPEN_NO_RECALL; - if (dwFlagsAndAttributes & FILE_FLAG_OPEN_REPARSE_POINT) params.dwFileFlags |= FILE_FLAG_OPEN_REPARSE_POINT; - if (dwFlagsAndAttributes & FILE_FLAG_OPEN_REQUIRING_OPLOCK) params.dwFileFlags |= FILE_FLAG_OPEN_REQUIRING_OPLOCK; - if (dwFlagsAndAttributes & FILE_FLAG_OVERLAPPED) params.dwFileFlags |= FILE_FLAG_OVERLAPPED; - if (dwFlagsAndAttributes & FILE_FLAG_POSIX_SEMANTICS) params.dwFileFlags |= FILE_FLAG_POSIX_SEMANTICS; - if (dwFlagsAndAttributes & FILE_FLAG_RANDOM_ACCESS) params.dwFileFlags |= FILE_FLAG_RANDOM_ACCESS; - if (dwFlagsAndAttributes & FILE_FLAG_SESSION_AWARE) params.dwFileFlags |= FILE_FLAG_SESSION_AWARE; - if (dwFlagsAndAttributes & FILE_FLAG_SEQUENTIAL_SCAN) params.dwFileFlags |= FILE_FLAG_SEQUENTIAL_SCAN; - if (dwFlagsAndAttributes & FILE_FLAG_WRITE_THROUGH) params.dwFileFlags |= FILE_FLAG_WRITE_THROUGH; + if (dwFlagsAndAttributes & FILE_FLAG_BACKUP_SEMANTICS) + params.dwFileFlags |= FILE_FLAG_BACKUP_SEMANTICS; + if (dwFlagsAndAttributes & FILE_FLAG_DELETE_ON_CLOSE) + params.dwFileFlags |= FILE_FLAG_DELETE_ON_CLOSE; + if (dwFlagsAndAttributes & FILE_FLAG_NO_BUFFERING) + params.dwFileFlags |= FILE_FLAG_NO_BUFFERING; + if (dwFlagsAndAttributes & FILE_FLAG_OPEN_NO_RECALL) + params.dwFileFlags |= FILE_FLAG_OPEN_NO_RECALL; + if (dwFlagsAndAttributes & FILE_FLAG_OPEN_REPARSE_POINT) + params.dwFileFlags |= FILE_FLAG_OPEN_REPARSE_POINT; + if (dwFlagsAndAttributes & FILE_FLAG_OPEN_REQUIRING_OPLOCK) + params.dwFileFlags |= FILE_FLAG_OPEN_REQUIRING_OPLOCK; + if (dwFlagsAndAttributes & FILE_FLAG_OVERLAPPED) + params.dwFileFlags |= FILE_FLAG_OVERLAPPED; + if (dwFlagsAndAttributes & FILE_FLAG_POSIX_SEMANTICS) + params.dwFileFlags |= FILE_FLAG_POSIX_SEMANTICS; + if (dwFlagsAndAttributes & FILE_FLAG_RANDOM_ACCESS) + params.dwFileFlags |= FILE_FLAG_RANDOM_ACCESS; + if (dwFlagsAndAttributes & FILE_FLAG_SESSION_AWARE) + params.dwFileFlags |= FILE_FLAG_SESSION_AWARE; + if (dwFlagsAndAttributes & FILE_FLAG_SEQUENTIAL_SCAN) + params.dwFileFlags |= FILE_FLAG_SEQUENTIAL_SCAN; + if (dwFlagsAndAttributes & FILE_FLAG_WRITE_THROUGH) + params.dwFileFlags |= FILE_FLAG_WRITE_THROUGH; - if (dwFlagsAndAttributes & FILE_ATTRIBUTE_ARCHIVE) params.dwFileAttributes |= FILE_ATTRIBUTE_ARCHIVE; - if (dwFlagsAndAttributes & FILE_ATTRIBUTE_COMPRESSED) params.dwFileAttributes |= FILE_ATTRIBUTE_COMPRESSED; - if (dwFlagsAndAttributes & FILE_ATTRIBUTE_DEVICE) params.dwFileAttributes |= FILE_ATTRIBUTE_DEVICE; - if (dwFlagsAndAttributes & FILE_ATTRIBUTE_DIRECTORY) params.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY; - if (dwFlagsAndAttributes & FILE_ATTRIBUTE_ENCRYPTED) params.dwFileAttributes |= FILE_ATTRIBUTE_ENCRYPTED; - if (dwFlagsAndAttributes & FILE_ATTRIBUTE_HIDDEN) params.dwFileAttributes |= FILE_ATTRIBUTE_HIDDEN; - if (dwFlagsAndAttributes & FILE_ATTRIBUTE_INTEGRITY_STREAM) params.dwFileAttributes |= FILE_ATTRIBUTE_INTEGRITY_STREAM; - if (dwFlagsAndAttributes & FILE_ATTRIBUTE_NORMAL) params.dwFileAttributes |= FILE_ATTRIBUTE_NORMAL; - if (dwFlagsAndAttributes & FILE_ATTRIBUTE_NOT_CONTENT_INDEXED) params.dwFileAttributes |= FILE_ATTRIBUTE_NOT_CONTENT_INDEXED; - if (dwFlagsAndAttributes & FILE_ATTRIBUTE_NO_SCRUB_DATA) params.dwFileAttributes |= FILE_ATTRIBUTE_NO_SCRUB_DATA; - if (dwFlagsAndAttributes & FILE_ATTRIBUTE_OFFLINE) params.dwFileAttributes |= FILE_ATTRIBUTE_OFFLINE; - if (dwFlagsAndAttributes & FILE_ATTRIBUTE_READONLY) params.dwFileAttributes |= FILE_ATTRIBUTE_READONLY; - if (dwFlagsAndAttributes & FILE_ATTRIBUTE_REPARSE_POINT) params.dwFileAttributes |= FILE_ATTRIBUTE_REPARSE_POINT; - if (dwFlagsAndAttributes & FILE_ATTRIBUTE_SPARSE_FILE) params.dwFileAttributes |= FILE_ATTRIBUTE_SPARSE_FILE; - if (dwFlagsAndAttributes & FILE_ATTRIBUTE_SYSTEM) params.dwFileAttributes |= FILE_ATTRIBUTE_SYSTEM; - if (dwFlagsAndAttributes & FILE_ATTRIBUTE_TEMPORARY) params.dwFileAttributes |= FILE_ATTRIBUTE_TEMPORARY; - if (dwFlagsAndAttributes & FILE_ATTRIBUTE_VIRTUAL) params.dwFileAttributes |= FILE_ATTRIBUTE_VIRTUAL; + if (dwFlagsAndAttributes & FILE_ATTRIBUTE_ARCHIVE) + params.dwFileAttributes |= FILE_ATTRIBUTE_ARCHIVE; + if (dwFlagsAndAttributes & FILE_ATTRIBUTE_COMPRESSED) + params.dwFileAttributes |= FILE_ATTRIBUTE_COMPRESSED; + if (dwFlagsAndAttributes & FILE_ATTRIBUTE_DEVICE) + params.dwFileAttributes |= FILE_ATTRIBUTE_DEVICE; + if (dwFlagsAndAttributes & FILE_ATTRIBUTE_DIRECTORY) + params.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY; + if (dwFlagsAndAttributes & FILE_ATTRIBUTE_ENCRYPTED) + params.dwFileAttributes |= FILE_ATTRIBUTE_ENCRYPTED; + if (dwFlagsAndAttributes & FILE_ATTRIBUTE_HIDDEN) + params.dwFileAttributes |= FILE_ATTRIBUTE_HIDDEN; + if (dwFlagsAndAttributes & FILE_ATTRIBUTE_INTEGRITY_STREAM) + params.dwFileAttributes |= FILE_ATTRIBUTE_INTEGRITY_STREAM; + if (dwFlagsAndAttributes & FILE_ATTRIBUTE_NORMAL) + params.dwFileAttributes |= FILE_ATTRIBUTE_NORMAL; + if (dwFlagsAndAttributes & FILE_ATTRIBUTE_NOT_CONTENT_INDEXED) + params.dwFileAttributes |= FILE_ATTRIBUTE_NOT_CONTENT_INDEXED; + if (dwFlagsAndAttributes & FILE_ATTRIBUTE_NO_SCRUB_DATA) + params.dwFileAttributes |= FILE_ATTRIBUTE_NO_SCRUB_DATA; + if (dwFlagsAndAttributes & FILE_ATTRIBUTE_OFFLINE) + params.dwFileAttributes |= FILE_ATTRIBUTE_OFFLINE; + if (dwFlagsAndAttributes & FILE_ATTRIBUTE_READONLY) + params.dwFileAttributes |= FILE_ATTRIBUTE_READONLY; + if (dwFlagsAndAttributes & FILE_ATTRIBUTE_REPARSE_POINT) + params.dwFileAttributes |= FILE_ATTRIBUTE_REPARSE_POINT; + if (dwFlagsAndAttributes & FILE_ATTRIBUTE_SPARSE_FILE) + params.dwFileAttributes |= FILE_ATTRIBUTE_SPARSE_FILE; + if (dwFlagsAndAttributes & FILE_ATTRIBUTE_SYSTEM) + params.dwFileAttributes |= FILE_ATTRIBUTE_SYSTEM; + if (dwFlagsAndAttributes & FILE_ATTRIBUTE_TEMPORARY) + params.dwFileAttributes |= FILE_ATTRIBUTE_TEMPORARY; + if (dwFlagsAndAttributes & FILE_ATTRIBUTE_VIRTUAL) + params.dwFileAttributes |= FILE_ATTRIBUTE_VIRTUAL; - if (dwFlagsAndAttributes & SECURITY_ANONYMOUS) params.dwSecurityQosFlags |= SECURITY_ANONYMOUS; - if (dwFlagsAndAttributes & SECURITY_CONTEXT_TRACKING) params.dwSecurityQosFlags |= SECURITY_CONTEXT_TRACKING; - if (dwFlagsAndAttributes & SECURITY_DELEGATION) params.dwSecurityQosFlags |= SECURITY_DELEGATION; - if (dwFlagsAndAttributes & SECURITY_EFFECTIVE_ONLY) params.dwSecurityQosFlags |= SECURITY_EFFECTIVE_ONLY; - if (dwFlagsAndAttributes & SECURITY_IDENTIFICATION) params.dwSecurityQosFlags |= SECURITY_IDENTIFICATION; - if (dwFlagsAndAttributes & SECURITY_IMPERSONATION) params.dwSecurityQosFlags |= SECURITY_IMPERSONATION; + if (dwFlagsAndAttributes & SECURITY_ANONYMOUS) + params.dwSecurityQosFlags |= SECURITY_ANONYMOUS; + if (dwFlagsAndAttributes & SECURITY_CONTEXT_TRACKING) + params.dwSecurityQosFlags |= SECURITY_CONTEXT_TRACKING; + if (dwFlagsAndAttributes & SECURITY_DELEGATION) + params.dwSecurityQosFlags |= SECURITY_DELEGATION; + if (dwFlagsAndAttributes & SECURITY_EFFECTIVE_ONLY) + params.dwSecurityQosFlags |= SECURITY_EFFECTIVE_ONLY; + if (dwFlagsAndAttributes & SECURITY_IDENTIFICATION) + params.dwSecurityQosFlags |= SECURITY_IDENTIFICATION; + if (dwFlagsAndAttributes & SECURITY_IMPERSONATION) + params.dwSecurityQosFlags |= SECURITY_IMPERSONATION; params.lpSecurityAttributes = lpSecurityAttributes; params.hTemplateFile = hTemplateFile; @@ -1122,21 +1145,20 @@ HANDLE CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, return hFile; } -HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, - DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) +HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, + DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) { HANDLE hFile; WCHAR* lpFileNameW = NULL; - - ConvertToUnicode(CP_UTF8, 0, lpFileName, -1, &lpFileNameW, 0); if (!lpFileNameW) return NULL; hFile = CreateFileW(lpFileNameW, dwDesiredAccess, dwShareMode, lpSecurityAttributes, - dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); + dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); free(lpFileNameW); @@ -1161,8 +1183,8 @@ DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh) return fileSize.LowPart; } -DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove, - PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod) +DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, + DWORD dwMoveMethod) { BOOL status; LARGE_INTEGER liDistanceToMove = { 0, 0 }; @@ -1183,12 +1205,14 @@ DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove, HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData) { - return FindFirstFileExA(lpFileName, FindExInfoStandard, lpFindFileData, FindExSearchNameMatch, NULL, 0); + return FindFirstFileExA(lpFileName, FindExInfoStandard, lpFindFileData, FindExSearchNameMatch, + NULL, 0); } HANDLE FindFirstFileW(LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFindFileData) { - return FindFirstFileExW(lpFileName, FindExInfoStandard, lpFindFileData, FindExSearchNameMatch, NULL, 0); + return FindFirstFileExW(lpFileName, FindExInfoStandard, lpFindFileData, FindExSearchNameMatch, + NULL, 0); } DWORD GetFullPathNameA(LPCSTR lpFileName, DWORD nBufferLength, LPSTR lpBuffer, LPSTR* lpFilePart) @@ -1207,7 +1231,7 @@ DWORD GetFullPathNameA(LPCSTR lpFileName, DWORD nBufferLength, LPSTR lpBuffer, L if (!lpFileNameW) return 0; - lpBufferW = (WCHAR*) malloc(nBufferLengthW); + lpBufferW = (WCHAR*)malloc(nBufferLengthW); if (!lpBufferW) return 0; @@ -1225,16 +1249,16 @@ DWORD GetFullPathNameA(LPCSTR lpFileName, DWORD nBufferLength, LPSTR lpBuffer, L return dwStatus * 2; } -BOOL GetDiskFreeSpaceA(LPCSTR lpRootPathName, LPDWORD lpSectorsPerCluster, - LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters) +BOOL GetDiskFreeSpaceA(LPCSTR lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, + LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters) { BOOL status; ULARGE_INTEGER FreeBytesAvailableToCaller = { 0, 0 }; ULARGE_INTEGER TotalNumberOfBytes = { 0, 0 }; ULARGE_INTEGER TotalNumberOfFreeBytes = { 0, 0 }; - status = GetDiskFreeSpaceExA(lpRootPathName, &FreeBytesAvailableToCaller, - &TotalNumberOfBytes, &TotalNumberOfFreeBytes); + status = GetDiskFreeSpaceExA(lpRootPathName, &FreeBytesAvailableToCaller, &TotalNumberOfBytes, + &TotalNumberOfFreeBytes); if (!status) return FALSE; @@ -1248,15 +1272,16 @@ BOOL GetDiskFreeSpaceA(LPCSTR lpRootPathName, LPDWORD lpSectorsPerCluster, } BOOL GetDiskFreeSpaceW(LPCWSTR lpRootPathName, LPDWORD lpSectorsPerCluster, - LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters) + LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, + LPDWORD lpTotalNumberOfClusters) { BOOL status; ULARGE_INTEGER FreeBytesAvailableToCaller = { 0, 0 }; ULARGE_INTEGER TotalNumberOfBytes = { 0, 0 }; ULARGE_INTEGER TotalNumberOfFreeBytes = { 0, 0 }; - status = GetDiskFreeSpaceExW(lpRootPathName, &FreeBytesAvailableToCaller, - &TotalNumberOfBytes, &TotalNumberOfFreeBytes); + status = GetDiskFreeSpaceExW(lpRootPathName, &FreeBytesAvailableToCaller, &TotalNumberOfBytes, + &TotalNumberOfFreeBytes); if (!status) return FALSE; @@ -1303,8 +1328,8 @@ HANDLE GetFileHandleForFileDescriptor(int fd) { #ifdef _WIN32 return (HANDLE)_get_osfhandle(fd); -#else /* _WIN32 */ - WINPR_FILE *pFile; +#else /* _WIN32 */ + WINPR_FILE* pFile; FILE* fp; int flags; @@ -1333,5 +1358,3 @@ HANDLE GetFileHandleForFileDescriptor(int fd) return (HANDLE)pFile; #endif /* _WIN32 */ } - - diff --git a/winpr/libwinpr/file/file.h b/winpr/libwinpr/file/file.h index d7dfe1dc8..f6cf9097a 100644 --- a/winpr/libwinpr/file/file.h +++ b/winpr/libwinpr/file/file.h @@ -54,11 +54,10 @@ struct winpr_file }; typedef struct winpr_file WINPR_FILE; -HANDLE_CREATOR *GetFileHandleCreator(void); +HANDLE_CREATOR* GetFileHandleCreator(void); UINT32 map_posix_err(int fs_errno); #endif /* _WIN32 */ #endif /* WINPR_FILE_PRIV_H */ - diff --git a/winpr/libwinpr/file/generic.c b/winpr/libwinpr/file/generic.c index 0b606f0da..d22e13b01 100644 --- a/winpr/libwinpr/file/generic.c +++ b/winpr/libwinpr/file/generic.c @@ -179,12 +179,10 @@ #define EPOCH_DIFF 11644473600LL #define STAT_TIME_TO_FILETIME(_t) (((UINT64)(_t) + EPOCH_DIFF) * 10000000LL) - static wArrayList* _HandleCreators; static pthread_once_t _HandleCreatorsInitialized = PTHREAD_ONCE_INIT; - HANDLE_CREATOR* GetNamedPipeClientHandleCreator(void); #if defined __linux__ && !defined ANDROID @@ -209,7 +207,6 @@ static void _HandleCreatorsInit() ArrayList_Add(_HandleCreators, GetFileHandleCreator()); } - #ifdef HAVE_AIO_H static BOOL g_AioSignalHandlerInstalled = FALSE; @@ -227,7 +224,7 @@ int InstallAioSignalHandler() sigemptyset(&action.sa_mask); sigaddset(&action.sa_mask, SIGIO); action.sa_flags = SA_SIGINFO; - action.sa_sigaction = (void*) &AioSignalHandler; + action.sa_sigaction = (void*)&AioSignalHandler; sigaction(SIGIO, &action, NULL); g_AioSignalHandlerInstalled = TRUE; } @@ -238,8 +235,8 @@ int InstallAioSignalHandler() #endif /* HAVE_AIO_H */ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, - LPSECURITY_ATTRIBUTES lpSecurityAttributes, - DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) + LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, + DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) { int i; @@ -266,9 +263,9 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, if (creator && creator->IsHandled(lpFileName)) { - HANDLE newHandle = creator->CreateFileA(lpFileName, dwDesiredAccess, - dwShareMode, lpSecurityAttributes, dwCreationDisposition, - dwFlagsAndAttributes, hTemplateFile); + HANDLE newHandle = + creator->CreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, + dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); ArrayList_Unlock(_HandleCreators); return newHandle; } @@ -279,8 +276,8 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, } HANDLE CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, - LPSECURITY_ATTRIBUTES lpSecurityAttributes, - DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) + LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, + DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) { LPSTR lpFileNameA = NULL; HANDLE hdl; @@ -337,8 +334,8 @@ BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, handle = (WINPR_HANDLE*)hFile; if (handle->ops->ReadFile) - return handle->ops->ReadFile(handle, lpBuffer, nNumberOfBytesToRead, - lpNumberOfBytesRead, lpOverlapped); + return handle->ops->ReadFile(handle, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesRead, + lpOverlapped); WLog_ERR(TAG, "ReadFile operation not implemented"); return FALSE; @@ -359,16 +356,16 @@ BOOL ReadFileEx(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, handle = (WINPR_HANDLE*)hFile; if (handle->ops->ReadFileEx) - return handle->ops->ReadFileEx(handle, lpBuffer, nNumberOfBytesToRead, - lpOverlapped, lpCompletionRoutine); + return handle->ops->ReadFileEx(handle, lpBuffer, nNumberOfBytesToRead, lpOverlapped, + lpCompletionRoutine); WLog_ERR(TAG, "ReadFileEx operation not implemented"); return FALSE; return TRUE; } -BOOL ReadFileScatter(HANDLE hFile, FILE_SEGMENT_ELEMENT aSegmentArray[], - DWORD nNumberOfBytesToRead, LPDWORD lpReserved, LPOVERLAPPED lpOverlapped) +BOOL ReadFileScatter(HANDLE hFile, FILE_SEGMENT_ELEMENT aSegmentArray[], DWORD nNumberOfBytesToRead, + LPDWORD lpReserved, LPOVERLAPPED lpOverlapped) { ULONG Type; WINPR_HANDLE* handle; @@ -382,8 +379,8 @@ BOOL ReadFileScatter(HANDLE hFile, FILE_SEGMENT_ELEMENT aSegmentArray[], handle = (WINPR_HANDLE*)hFile; if (handle->ops->ReadFileScatter) - return handle->ops->ReadFileScatter(handle, aSegmentArray, nNumberOfBytesToRead, - lpReserved, lpOverlapped); + return handle->ops->ReadFileScatter(handle, aSegmentArray, nNumberOfBytesToRead, lpReserved, + lpOverlapped); WLog_ERR(TAG, "ReadFileScatter operation not implemented"); return FALSE; @@ -426,8 +423,8 @@ BOOL WriteFileEx(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, handle = (WINPR_HANDLE*)hFile; if (handle->ops->WriteFileEx) - return handle->ops->WriteFileEx(handle, lpBuffer, nNumberOfBytesToWrite, - lpOverlapped, lpCompletionRoutine); + return handle->ops->WriteFileEx(handle, lpBuffer, nNumberOfBytesToWrite, lpOverlapped, + lpCompletionRoutine); WLog_ERR(TAG, "WriteFileEx operation not implemented"); return FALSE; @@ -625,8 +622,8 @@ DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh) return 0; } -DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove, - PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod) +DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, + DWORD dwMoveMethod) { ULONG Type; WINPR_HANDLE* handle; @@ -640,15 +637,15 @@ DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove, handle = (WINPR_HANDLE*)hFile; if (handle->ops->SetFilePointer) - return handle->ops->SetFilePointer(handle, lDistanceToMove, - lpDistanceToMoveHigh, dwMoveMethod); + return handle->ops->SetFilePointer(handle, lDistanceToMove, lpDistanceToMoveHigh, + dwMoveMethod); WLog_ERR(TAG, "SetFilePointer operation not implemented"); return 0; } -BOOL SetFilePointerEx(HANDLE hFile, LARGE_INTEGER liDistanceToMove, - PLARGE_INTEGER lpNewFilePointer, DWORD dwMoveMethod) +BOOL SetFilePointerEx(HANDLE hFile, LARGE_INTEGER liDistanceToMove, PLARGE_INTEGER lpNewFilePointer, + DWORD dwMoveMethod) { ULONG Type; WINPR_HANDLE* handle; @@ -662,8 +659,8 @@ BOOL SetFilePointerEx(HANDLE hFile, LARGE_INTEGER liDistanceToMove, handle = (WINPR_HANDLE*)hFile; if (handle->ops->SetFilePointerEx) - return handle->ops->SetFilePointerEx(handle, liDistanceToMove, - lpNewFilePointer, dwMoveMethod); + return handle->ops->SetFilePointerEx(handle, liDistanceToMove, lpNewFilePointer, + dwMoveMethod); WLog_ERR(TAG, "SetFilePointerEx operation not implemented"); return 0; @@ -691,8 +688,8 @@ BOOL LockFile(HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, return FALSE; } -BOOL LockFileEx(HANDLE hFile, DWORD dwFlags, DWORD dwReserved, - DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh, LPOVERLAPPED lpOverlapped) +BOOL LockFileEx(HANDLE hFile, DWORD dwFlags, DWORD dwReserved, DWORD nNumberOfBytesToLockLow, + DWORD nNumberOfBytesToLockHigh, LPOVERLAPPED lpOverlapped) { ULONG Type; WINPR_HANDLE* handle; @@ -706,8 +703,8 @@ BOOL LockFileEx(HANDLE hFile, DWORD dwFlags, DWORD dwReserved, handle = (WINPR_HANDLE*)hFile; if (handle->ops->LockFileEx) - return handle->ops->LockFileEx(handle, dwFlags, dwReserved, - nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh, lpOverlapped); + return handle->ops->LockFileEx(handle, dwFlags, dwReserved, nNumberOfBytesToLockLow, + nNumberOfBytesToLockHigh, lpOverlapped); WLog_ERR(TAG, "LockFileEx operation not implemented"); return FALSE; @@ -750,8 +747,8 @@ BOOL UnlockFileEx(HANDLE hFile, DWORD dwReserved, DWORD nNumberOfBytesToUnlockLo handle = (WINPR_HANDLE*)hFile; if (handle->ops->UnlockFileEx) - return handle->ops->UnlockFileEx(handle, dwReserved, - nNumberOfBytesToUnlockLow, nNumberOfBytesToUnlockHigh, lpOverlapped); + return handle->ops->UnlockFileEx(handle, dwReserved, nNumberOfBytesToUnlockLow, + nNumberOfBytesToUnlockHigh, lpOverlapped); WLog_ERR(TAG, "UnLockFileEx operation not implemented"); return FALSE; @@ -772,8 +769,7 @@ BOOL WINAPI SetFileTime(HANDLE hFile, const FILETIME* lpCreationTime, handle = (WINPR_HANDLE*)hFile; if (handle->ops->SetFileTime) - return handle->ops->SetFileTime(handle, lpCreationTime, - lpLastAccessTime, lpLastWriteTime); + return handle->ops->SetFileTime(handle, lpCreationTime, lpLastAccessTime, lpLastWriteTime); WLog_ERR(TAG, "%s operation not implemented", __FUNCTION__); return FALSE; @@ -846,7 +842,7 @@ HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData) } ZeroMemory(lpFindFileData, sizeof(WIN32_FIND_DATAA)); - pFileSearch = (WIN32_FILE_SEARCH*) calloc(1, sizeof(WIN32_FILE_SEARCH)); + pFileSearch = (WIN32_FILE_SEARCH*)calloc(1, sizeof(WIN32_FILE_SEARCH)); if (!pFileSearch) { @@ -879,7 +875,7 @@ HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData) index = (p - lpFileName); length = (p - lpFileName) + 1; - pFileSearch->lpPath = (LPSTR) malloc(length + 1); + pFileSearch->lpPath = (LPSTR)malloc(length + 1); if (!pFileSearch->lpPath) { @@ -891,7 +887,7 @@ HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData) CopyMemory(pFileSearch->lpPath, lpFileName, length); pFileSearch->lpPath[length] = '\0'; length = strlen(lpFileName) - index; - pFileSearch->lpPattern = (LPSTR) malloc(length + 1); + pFileSearch->lpPattern = (LPSTR)malloc(length + 1); if (!pFileSearch->lpPattern) { @@ -932,11 +928,11 @@ HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData) return INVALID_HANDLE_VALUE; /* failed to open directory */ } - if (FindNextFileA((HANDLE) pFileSearch, lpFindFileData)) + if (FindNextFileA((HANDLE)pFileSearch, lpFindFileData)) { if (isDir) { - const char* name = strrchr(lpFileName, '/'); + const char* name = strrchr(lpFileName, '/'); if (!name) name = lpFileName; @@ -947,7 +943,7 @@ HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData) sprintf_s(lpFindFileData->cFileName, ARRAYSIZE(lpFindFileData->cFileName), "%s", name); } - return (HANDLE) pFileSearch; + return (HANDLE)pFileSearch; } FindClose(pFileSearch); @@ -982,8 +978,8 @@ static BOOL ConvertFindDataAToW(LPWIN32_FIND_DATAA lpFindFileDataA, CopyMemory(lpFindFileDataW->cFileName, unicodeFileName, length * sizeof(WCHAR)); free(unicodeFileName); - length = ConvertToUnicode(CP_UTF8, 0, lpFindFileDataA->cAlternateFileName, - -1, &unicodeFileName, 0); + length = + ConvertToUnicode(CP_UTF8, 0, lpFindFileDataA->cAlternateFileName, -1, &unicodeFileName, 0); if (length == 0) return TRUE; @@ -1061,7 +1057,7 @@ BOOL FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData) return FALSE; ZeroMemory(lpFindFileData, sizeof(WIN32_FIND_DATAA)); - pFileSearch = (WIN32_FILE_SEARCH*) hFindFile; + pFileSearch = (WIN32_FILE_SEARCH*)hFindFile; while ((pFileSearch->pDirent = readdir(pFileSearch->pDir)) != NULL) { @@ -1082,7 +1078,7 @@ BOOL FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData) memcpy(fullpath, pFileSearch->lpPath, pathlen); /* Ensure path is terminated with a separator, but prevent * duplicate separators */ - if (fullpath[pathlen-1] != '/') + if (fullpath[pathlen - 1] != '/') fullpath[pathlen++] = '/'; memcpy(fullpath + pathlen, pFileSearch->pDirent->d_name, namelen); fullpath[pathlen + namelen] = 0; @@ -1141,7 +1137,7 @@ BOOL FindNextFileW(HANDLE hFindFile, LPWIN32_FIND_DATAW lpFindFileData) BOOL FindClose(HANDLE hFindFile) { - WIN32_FILE_SEARCH* pFileSearch = (WIN32_FILE_SEARCH*) hFindFile; + WIN32_FILE_SEARCH* pFileSearch = (WIN32_FILE_SEARCH*)hFindFile; /* Since INVALID_HANDLE_VALUE != NULL the analyzer guesses that there * is a initialized HANDLE that is not freed properly. diff --git a/winpr/libwinpr/file/namedPipeClient.c b/winpr/libwinpr/file/namedPipeClient.c index 0ff881c23..876d7433f 100644 --- a/winpr/libwinpr/file/namedPipeClient.c +++ b/winpr/libwinpr/file/namedPipeClient.c @@ -36,7 +36,6 @@ #ifndef _WIN32 - #ifdef ANDROID #include #else @@ -51,7 +50,7 @@ static HANDLE_CREATOR _NamedPipeClientHandleCreator; static BOOL NamedPipeClientIsHandled(HANDLE handle) { - WINPR_NAMED_PIPE* pFile = (WINPR_NAMED_PIPE*) handle; + WINPR_NAMED_PIPE* pFile = (WINPR_NAMED_PIPE*)handle; if (!pFile || (pFile->Type != HANDLE_TYPE_NAMED_PIPE) || (pFile == INVALID_HANDLE_VALUE)) { @@ -64,20 +63,20 @@ static BOOL NamedPipeClientIsHandled(HANDLE handle) BOOL NamedPipeClientCloseHandle(HANDLE handle) { - WINPR_NAMED_PIPE* pNamedPipe = (WINPR_NAMED_PIPE*) handle; + WINPR_NAMED_PIPE* pNamedPipe = (WINPR_NAMED_PIPE*)handle; if (!NamedPipeClientIsHandled(handle)) return FALSE; if (pNamedPipe->clientfd != -1) { - //WLOG_DBG(TAG, "closing clientfd %d", pNamedPipe->clientfd); + // WLOG_DBG(TAG, "closing clientfd %d", pNamedPipe->clientfd); close(pNamedPipe->clientfd); } if (pNamedPipe->serverfd != -1) { - //WLOG_DBG(TAG, "closing serverfd %d", pNamedPipe->serverfd); + // WLOG_DBG(TAG, "closing serverfd %d", pNamedPipe->serverfd); close(pNamedPipe->serverfd); } @@ -104,8 +103,7 @@ static int NamedPipeClientGetFd(HANDLE handle) return file->clientfd; } -static HANDLE_OPS ops = -{ +static HANDLE_OPS ops = { NamedPipeClientIsHandled, NamedPipeClientCloseHandle, NamedPipeClientGetFd, @@ -129,8 +127,10 @@ static HANDLE_OPS ops = }; static HANDLE NamedPipeClientCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, - DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, - DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) + DWORD dwShareMode, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, + DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, + HANDLE hTemplateFile) { char* name; int status; @@ -157,7 +157,7 @@ static HANDLE NamedPipeClientCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAcces return INVALID_HANDLE_VALUE; free(name); - pNamedPipe = (WINPR_NAMED_PIPE*) calloc(1, sizeof(WINPR_NAMED_PIPE)); + pNamedPipe = (WINPR_NAMED_PIPE*)calloc(1, sizeof(WINPR_NAMED_PIPE)); if (!pNamedPipe) { @@ -165,7 +165,7 @@ static HANDLE NamedPipeClientCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAcces return INVALID_HANDLE_VALUE; } - hNamedPipe = (HANDLE) pNamedPipe; + hNamedPipe = (HANDLE)pNamedPipe; WINPR_HANDLE_SET_TYPE_AND_MODE(pNamedPipe, HANDLE_TYPE_NAMED_PIPE, WINPR_FD_READ); pNamedPipe->name = _strdup(lpFileName); @@ -208,15 +208,15 @@ static HANDLE NamedPipeClientCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAcces ZeroMemory(&s, sizeof(struct sockaddr_un)); s.sun_family = AF_UNIX; sprintf_s(s.sun_path, ARRAYSIZE(s.sun_path), "%s", pNamedPipe->lpFilePath); - status = connect(pNamedPipe->clientfd, (struct sockaddr*) &s, sizeof(struct sockaddr_un)); + status = connect(pNamedPipe->clientfd, (struct sockaddr*)&s, sizeof(struct sockaddr_un)); pNamedPipe->ops = &ops; if (status != 0) { close(pNamedPipe->clientfd); - free((char*) pNamedPipe->name); - free((char*) pNamedPipe->lpFileName); - free((char*) pNamedPipe->lpFilePath); + free((char*)pNamedPipe->name); + free((char*)pNamedPipe->lpFileName); + free((char*)pNamedPipe->lpFilePath); free(pNamedPipe); return INVALID_HANDLE_VALUE; } @@ -246,7 +246,7 @@ HANDLE_CREATOR* GetNamedPipeClientHandleCreator(void) /* Extended API */ -#define NAMED_PIPE_PREFIX_PATH "\\\\.\\pipe\\" +#define NAMED_PIPE_PREFIX_PATH "\\\\.\\pipe\\" BOOL IsNamedPipeFileNameA(LPCSTR lpName) { @@ -291,7 +291,7 @@ char* GetNamedPipeUnixDomainSocketFilePathA(LPCSTR lpName) char* lpFilePath; lpPipePath = GetNamedPipeUnixDomainSocketBaseFilePathA(); lpFileName = GetNamedPipeNameWithoutPrefixA(lpName); - lpFilePath = GetCombinedPath(lpPipePath, (char*) lpFileName); + lpFilePath = GetCombinedPath(lpPipePath, (char*)lpFileName); free(lpPipePath); free(lpFileName); return lpFilePath; @@ -302,7 +302,7 @@ int GetNamePipeFileDescriptor(HANDLE hNamedPipe) #ifndef _WIN32 int fd; WINPR_NAMED_PIPE* pNamedPipe; - pNamedPipe = (WINPR_NAMED_PIPE*) hNamedPipe; + pNamedPipe = (WINPR_NAMED_PIPE*)hNamedPipe; if (!pNamedPipe || pNamedPipe->Type != HANDLE_TYPE_NAMED_PIPE) return -1; @@ -313,4 +313,3 @@ int GetNamePipeFileDescriptor(HANDLE hNamedPipe) return -1; #endif } - diff --git a/winpr/libwinpr/file/pattern.c b/winpr/libwinpr/file/pattern.c index ec4e18bb1..620490302 100644 --- a/winpr/libwinpr/file/pattern.c +++ b/winpr/libwinpr/file/pattern.c @@ -83,8 +83,8 @@ LPSTR FilePatternFindNextWildcardA(LPCSTR lpPattern, DWORD* pFlags) return NULL; } -BOOL FilePatternMatchSubExpressionA(LPCSTR lpFileName, size_t cchFileName, - LPCSTR lpX, size_t cchX, LPCSTR lpY, size_t cchY, LPCSTR lpWildcard, LPSTR* ppMatchEnd) +BOOL FilePatternMatchSubExpressionA(LPCSTR lpFileName, size_t cchFileName, LPCSTR lpX, size_t cchX, + LPCSTR lpY, size_t cchY, LPCSTR lpWildcard, LPSTR* ppMatchEnd) { LPSTR lpMatch; @@ -129,13 +129,13 @@ BOOL FilePatternMatchSubExpressionA(LPCSTR lpFileName, size_t cchFileName, } else { - lpMatch = (LPSTR) &lpFileName[cchFileName]; + lpMatch = (LPSTR)&lpFileName[cchFileName]; } /** * State 3: final state */ - *ppMatchEnd = (LPSTR) &lpMatch[cchY]; + *ppMatchEnd = (LPSTR)&lpMatch[cchY]; return TRUE; } else if (*lpWildcard == '?') @@ -178,13 +178,13 @@ BOOL FilePatternMatchSubExpressionA(LPCSTR lpFileName, size_t cchFileName, if ((cchX + 1) > cchFileName) return FALSE; - lpMatch = (LPSTR) &lpFileName[cchX + 1]; + lpMatch = (LPSTR)&lpFileName[cchX + 1]; } /** * State 3: final state */ - *ppMatchEnd = (LPSTR) &lpMatch[cchY]; + *ppMatchEnd = (LPSTR)&lpMatch[cchY]; return TRUE; } else if (*lpWildcard == '~') @@ -253,7 +253,7 @@ BOOL FilePatternMatchA(LPCSTR lpFileName, LPCSTR lpPattern) if (lpPattern[0] == '*') { - lpTail = (LPSTR) &lpPattern[1]; + lpTail = (LPSTR)&lpPattern[1]; cchTail = strlen(lpTail); if (!FilePatternFindNextWildcardA(lpTail, &dwFlags)) @@ -318,20 +318,20 @@ BOOL FilePatternMatchA(LPCSTR lpFileName, LPCSTR lpPattern) size_t cchWildcard; size_t cchNextWildcard; cchSubPattern = cchPattern; - lpSubPattern = (LPSTR) lpPattern; + lpSubPattern = (LPSTR)lpPattern; cchSubFileName = cchFileName; - lpSubFileName = (LPSTR) lpFileName; + lpSubFileName = (LPSTR)lpFileName; cchWildcard = ((dwFlags & WILDCARD_DOS) ? 2 : 1); lpNextWildcard = FilePatternFindNextWildcardA(&lpWildcard[cchWildcard], &dwNextFlags); if (!lpNextWildcard) { - lpX = (LPSTR) lpSubPattern; + lpX = (LPSTR)lpSubPattern; cchX = (lpWildcard - lpSubPattern); - lpY = (LPSTR) &lpSubPattern[cchX + cchWildcard]; + lpY = (LPSTR)&lpSubPattern[cchX + cchWildcard]; cchY = (cchSubPattern - (lpY - lpSubPattern)); - match = FilePatternMatchSubExpressionA(lpSubFileName, cchSubFileName, - lpX, cchX, lpY, cchY, lpWildcard, &lpMatchEnd); + match = FilePatternMatchSubExpressionA(lpSubFileName, cchSubFileName, lpX, cchX, lpY, + cchY, lpWildcard, &lpMatchEnd); return match; } else @@ -340,12 +340,12 @@ BOOL FilePatternMatchA(LPCSTR lpFileName, LPCSTR lpPattern) { cchSubFileName = cchFileName - (lpSubFileName - lpFileName); cchNextWildcard = ((dwNextFlags & WILDCARD_DOS) ? 2 : 1); - lpX = (LPSTR) lpSubPattern; + lpX = (LPSTR)lpSubPattern; cchX = (lpWildcard - lpSubPattern); - lpY = (LPSTR) &lpSubPattern[cchX + cchWildcard]; + lpY = (LPSTR)&lpSubPattern[cchX + cchWildcard]; cchY = (lpNextWildcard - lpWildcard) - cchWildcard; - match = FilePatternMatchSubExpressionA(lpSubFileName, cchSubFileName, - lpX, cchX, lpY, cchY, lpWildcard, &lpMatchEnd); + match = FilePatternMatchSubExpressionA(lpSubFileName, cchSubFileName, lpX, cchX, + lpY, cchY, lpWildcard, &lpMatchEnd); if (!match) return FALSE; @@ -354,7 +354,8 @@ BOOL FilePatternMatchA(LPCSTR lpFileName, LPCSTR lpPattern) cchWildcard = cchNextWildcard; lpWildcard = lpNextWildcard; dwFlags = dwNextFlags; - lpNextWildcard = FilePatternFindNextWildcardA(&lpWildcard[cchWildcard], &dwNextFlags); + lpNextWildcard = + FilePatternFindNextWildcardA(&lpWildcard[cchWildcard], &dwNextFlags); } return TRUE; diff --git a/winpr/libwinpr/file/test/TestFileCreateFile.c b/winpr/libwinpr/file/test/TestFileCreateFile.c index e0a776de3..e6656a9cc 100644 --- a/winpr/libwinpr/file/test/TestFileCreateFile.c +++ b/winpr/libwinpr/file/test/TestFileCreateFile.c @@ -20,9 +20,10 @@ int TestFileCreateFile(int argc, char* argv[]) SYSTEMTIME systemTime; GetSystemTime(&systemTime); sprintf_s(sname, sizeof(sname), - "CreateFile-%04"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%04"PRIu16, - systemTime.wYear, systemTime.wMonth, systemTime.wDay, systemTime.wHour, systemTime.wMinute, - systemTime.wSecond, systemTime.wMilliseconds); + "CreateFile-%04" PRIu16 "%02" PRIu16 "%02" PRIu16 "%02" PRIu16 "%02" PRIu16 + "%02" PRIu16 "%04" PRIu16, + systemTime.wYear, systemTime.wMonth, systemTime.wDay, systemTime.wHour, + systemTime.wMinute, systemTime.wSecond, systemTime.wMilliseconds); name = GetKnownSubPath(KNOWN_PATH_TEMP, sname); if (!name) @@ -35,8 +36,8 @@ int TestFileCreateFile(int argc, char* argv[]) if (FAILED(hr)) rc = -1; - handle = CreateFileA(name, GENERIC_READ | GENERIC_WRITE, 0, NULL, - CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); + handle = CreateFileA(name, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_NEW, + FILE_ATTRIBUTE_NORMAL, NULL); if (!handle) { diff --git a/winpr/libwinpr/file/test/TestFileFindFirstFile.c b/winpr/libwinpr/file/test/TestFileFindFirstFile.c index 30a197fbf..2d0a3f29d 100644 --- a/winpr/libwinpr/file/test/TestFileFindFirstFile.c +++ b/winpr/libwinpr/file/test/TestFileFindFirstFile.c @@ -19,7 +19,7 @@ int TestFileFindFirstFile(int argc, char* argv[]) str = argv[1]; #ifdef UNICODE length = MultiByteToWideChar(CP_UTF8, 0, str, strlen(str), NULL, 0); - BasePath = (WCHAR*) calloc((length + 1), sizeof(WCHAR)); + BasePath = (WCHAR*)calloc((length + 1), sizeof(WCHAR)); if (!BasePath) { @@ -27,7 +27,7 @@ int TestFileFindFirstFile(int argc, char* argv[]) return -1; } - MultiByteToWideChar(CP_UTF8, 0, str, length, (LPWSTR) BasePath, length * sizeof(WCHAR)); + MultiByteToWideChar(CP_UTF8, 0, str, length, (LPWSTR)BasePath, length * sizeof(WCHAR)); BasePath[length] = 0; #else BasePath = _strdup(str); @@ -58,8 +58,8 @@ int TestFileFindFirstFile(int argc, char* argv[]) if (_tcscmp(FindData.cFileName, testFile1) != 0) { - _tprintf(_T("FindFirstFile failure: Expected: %s, Actual: %s\n"), - testFile1, FindData.cFileName); + _tprintf(_T("FindFirstFile failure: Expected: %s, Actual: %s\n"), testFile1, + FindData.cFileName); return -1; } diff --git a/winpr/libwinpr/file/test/TestFileFindFirstFileEx.c b/winpr/libwinpr/file/test/TestFileFindFirstFileEx.c index 71193e1c1..b8a7683d4 100644 --- a/winpr/libwinpr/file/test/TestFileFindFirstFileEx.c +++ b/winpr/libwinpr/file/test/TestFileFindFirstFileEx.c @@ -8,4 +8,3 @@ int TestFileFindFirstFileEx(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/file/test/TestFileFindNextFile.c b/winpr/libwinpr/file/test/TestFileFindNextFile.c index 172103a2d..06e4fbff1 100644 --- a/winpr/libwinpr/file/test/TestFileFindNextFile.c +++ b/winpr/libwinpr/file/test/TestFileFindNextFile.c @@ -21,7 +21,7 @@ int TestFileFindNextFile(int argc, char* argv[]) str = argv[1]; #ifdef UNICODE length = MultiByteToWideChar(CP_UTF8, 0, str, strlen(str), NULL, 0); - BasePath = (WCHAR*) calloc((length + 1), sizeof(WCHAR)); + BasePath = (WCHAR*)calloc((length + 1), sizeof(WCHAR)); if (!BasePath) { @@ -29,7 +29,7 @@ int TestFileFindNextFile(int argc, char* argv[]) return -1; } - MultiByteToWideChar(CP_UTF8, 0, str, length, (LPWSTR) BasePath, length * sizeof(WCHAR)); + MultiByteToWideChar(CP_UTF8, 0, str, length, (LPWSTR)BasePath, length * sizeof(WCHAR)); BasePath[length] = 0; #else BasePath = _strdup(str); @@ -67,8 +67,8 @@ int TestFileFindNextFile(int argc, char* argv[]) if ((_tcscmp(FindData.cFileName, testDirectory2File1) != 0) && (_tcscmp(FindData.cFileName, testDirectory2File2) != 0)) { - _tprintf(_T("FindFirstFile failure: Expected: %s, Actual: %s\n"), - testDirectory2File1, FindData.cFileName); + _tprintf(_T("FindFirstFile failure: Expected: %s, Actual: %s\n"), testDirectory2File1, + FindData.cFileName); return -1; } @@ -76,15 +76,15 @@ int TestFileFindNextFile(int argc, char* argv[]) if (!status) { - _tprintf(_T("FindNextFile failure: Expected: TRUE, Actual: %")_T(PRId32)_T("\n"), status); + _tprintf(_T("FindNextFile failure: Expected: TRUE, Actual: %") _T(PRId32) _T("\n"), status); return -1; } if ((_tcscmp(FindData.cFileName, testDirectory2File1) != 0) && (_tcscmp(FindData.cFileName, testDirectory2File2) != 0)) { - _tprintf(_T("FindNextFile failure: Expected: %s, Actual: %s\n"), - testDirectory2File2, FindData.cFileName); + _tprintf(_T("FindNextFile failure: Expected: %s, Actual: %s\n"), testDirectory2File2, + FindData.cFileName); return -1; } @@ -92,11 +92,11 @@ int TestFileFindNextFile(int argc, char* argv[]) if (status) { - _tprintf(_T("FindNextFile failure: Expected: FALSE, Actual: %")_T(PRId32)_T("\n"), status); + _tprintf(_T("FindNextFile failure: Expected: FALSE, Actual: %") _T(PRId32) _T("\n"), + status); return -1; } FindClose(hFind); return 0; } - diff --git a/winpr/libwinpr/file/test/TestFileGetStdHandle.c b/winpr/libwinpr/file/test/TestFileGetStdHandle.c index 0b402b670..5dfd93d7c 100644 --- a/winpr/libwinpr/file/test/TestFileGetStdHandle.c +++ b/winpr/libwinpr/file/test/TestFileGetStdHandle.c @@ -37,7 +37,7 @@ int TestFileGetStdHandle(int argc, char* argv[]) return -1; } WriteFile(so, buf, strnlen(buf, sizeof(buf)), &bytesWritten, FALSE); - if (bytesWritten != strnlen(buf, sizeof (buf))) + if (bytesWritten != strnlen(buf, sizeof(buf))) { fprintf(stderr, "write failed\n"); return -1; diff --git a/winpr/libwinpr/file/test/TestFilePatternMatch.c b/winpr/libwinpr/file/test/TestFilePatternMatch.c index 51e00db50..76bb53391 100644 --- a/winpr/libwinpr/file/test/TestFilePatternMatch.c +++ b/winpr/libwinpr/file/test/TestFilePatternMatch.c @@ -52,13 +52,15 @@ int TestFilePatternMatch(int argc, char* argv[]) if (!FilePatternMatchA("document.docx", "document.doc?")) { - printf("FilePatternMatchA error: FileName: %s Pattern: %s\n", "document.docx", "document.doc?"); + printf("FilePatternMatchA error: FileName: %s Pattern: %s\n", "document.docx", + "document.doc?"); return -1; } if (FilePatternMatchA("document.doc", "document.doc?")) { - printf("FilePatternMatchA error: FileName: %s Pattern: %s\n", "document.doc", "document.doc?"); + printf("FilePatternMatchA error: FileName: %s Pattern: %s\n", "document.doc", + "document.doc?"); return -1; } @@ -66,7 +68,8 @@ int TestFilePatternMatch(int argc, char* argv[]) if (!FilePatternMatchA("document.txt", "document.txt")) { - printf("FilePatternMatchA error: FileName: %s Pattern: %s\n", "document.txt", "document.txt"); + printf("FilePatternMatchA error: FileName: %s Pattern: %s\n", "document.txt", + "document.txt"); return -1; } @@ -174,7 +177,5 @@ int TestFilePatternMatch(int argc, char* argv[]) return -1; } - return 0; } - diff --git a/winpr/libwinpr/handle/handle.c b/winpr/libwinpr/handle/handle.c index b57dacd95..2b846f1a7 100644 --- a/winpr/libwinpr/handle/handle.c +++ b/winpr/libwinpr/handle/handle.c @@ -46,7 +46,7 @@ BOOL CloseHandle(HANDLE hObject) { ULONG Type; - WINPR_HANDLE *Object; + WINPR_HANDLE* Object; if (!winpr_Handle_GetInfo(hObject, &Type, &Object)) return FALSE; @@ -64,9 +64,10 @@ BOOL CloseHandle(HANDLE hObject) } BOOL DuplicateHandle(HANDLE hSourceProcessHandle, HANDLE hSourceHandle, HANDLE hTargetProcessHandle, - LPHANDLE lpTargetHandle, DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwOptions) + LPHANDLE lpTargetHandle, DWORD dwDesiredAccess, BOOL bInheritHandle, + DWORD dwOptions) { - *((ULONG_PTR*) lpTargetHandle) = (ULONG_PTR) hSourceHandle; + *((ULONG_PTR*)lpTargetHandle) = (ULONG_PTR)hSourceHandle; return TRUE; } diff --git a/winpr/libwinpr/handle/handle.h b/winpr/libwinpr/handle/handle.h index 072364346..c97a97441 100644 --- a/winpr/libwinpr/handle/handle.h +++ b/winpr/libwinpr/handle/handle.h @@ -25,60 +25,64 @@ #include #include -#define HANDLE_TYPE_NONE 0 -#define HANDLE_TYPE_PROCESS 1 -#define HANDLE_TYPE_THREAD 2 -#define HANDLE_TYPE_EVENT 3 -#define HANDLE_TYPE_MUTEX 4 -#define HANDLE_TYPE_SEMAPHORE 5 -#define HANDLE_TYPE_TIMER 6 -#define HANDLE_TYPE_NAMED_PIPE 7 -#define HANDLE_TYPE_ANONYMOUS_PIPE 8 -#define HANDLE_TYPE_ACCESS_TOKEN 9 -#define HANDLE_TYPE_FILE 10 -#define HANDLE_TYPE_TIMER_QUEUE 11 -#define HANDLE_TYPE_TIMER_QUEUE_TIMER 12 -#define HANDLE_TYPE_COMM 13 +#define HANDLE_TYPE_NONE 0 +#define HANDLE_TYPE_PROCESS 1 +#define HANDLE_TYPE_THREAD 2 +#define HANDLE_TYPE_EVENT 3 +#define HANDLE_TYPE_MUTEX 4 +#define HANDLE_TYPE_SEMAPHORE 5 +#define HANDLE_TYPE_TIMER 6 +#define HANDLE_TYPE_NAMED_PIPE 7 +#define HANDLE_TYPE_ANONYMOUS_PIPE 8 +#define HANDLE_TYPE_ACCESS_TOKEN 9 +#define HANDLE_TYPE_FILE 10 +#define HANDLE_TYPE_TIMER_QUEUE 11 +#define HANDLE_TYPE_TIMER_QUEUE_TIMER 12 +#define HANDLE_TYPE_COMM 13 #define WINPR_HANDLE_DEF() \ - ULONG Type; \ - ULONG Mode; \ - HANDLE_OPS *ops + ULONG Type; \ + ULONG Mode; \ + HANDLE_OPS* ops typedef BOOL (*pcIsHandled)(HANDLE handle); typedef BOOL (*pcCloseHandle)(HANDLE handle); typedef int (*pcGetFd)(HANDLE handle); typedef DWORD (*pcCleanupHandle)(HANDLE handle); typedef BOOL (*pcReadFile)(PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, - LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped); + LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped); typedef BOOL (*pcReadFileEx)(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, - LPOVERLAPPED lpOverlapped, LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); + LPOVERLAPPED lpOverlapped, + LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); typedef BOOL (*pcReadFileScatter)(HANDLE hFile, FILE_SEGMENT_ELEMENT aSegmentArray[], - DWORD nNumberOfBytesToRead, LPDWORD lpReserved, LPOVERLAPPED lpOverlapped); + DWORD nNumberOfBytesToRead, LPDWORD lpReserved, + LPOVERLAPPED lpOverlapped); typedef BOOL (*pcWriteFile)(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, - LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped); + LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped); typedef BOOL (*pcWriteFileEx)(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, - LPOVERLAPPED lpOverlapped, LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); + LPOVERLAPPED lpOverlapped, + LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); typedef BOOL (*pcWriteFileGather)(HANDLE hFile, FILE_SEGMENT_ELEMENT aSegmentArray[], - DWORD nNumberOfBytesToWrite, LPDWORD lpReserved, LPOVERLAPPED lpOverlapped); + DWORD nNumberOfBytesToWrite, LPDWORD lpReserved, + LPOVERLAPPED lpOverlapped); typedef DWORD (*pcGetFileSize)(HANDLE handle, LPDWORD lpFileSizeHigh); typedef BOOL (*pcFlushFileBuffers)(HANDLE hFile); typedef BOOL (*pcSetEndOfFile)(HANDLE handle); -typedef DWORD(*pcSetFilePointer)(HANDLE handle, LONG lDistanceToMove, - PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod); +typedef DWORD (*pcSetFilePointer)(HANDLE handle, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, + DWORD dwMoveMethod); typedef BOOL (*pcSetFilePointerEx)(HANDLE hFile, LARGE_INTEGER liDistanceToMove, - PLARGE_INTEGER lpNewFilePointer, DWORD dwMoveMethod); + PLARGE_INTEGER lpNewFilePointer, DWORD dwMoveMethod); typedef BOOL (*pcLockFile)(HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, - DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh); + DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh); typedef BOOL (*pcLockFileEx)(HANDLE hFile, DWORD dwFlags, DWORD dwReserved, - DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh, - LPOVERLAPPED lpOverlapped); + DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh, + LPOVERLAPPED lpOverlapped); typedef BOOL (*pcUnlockFile)(HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, - DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh); + DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh); typedef BOOL (*pcUnlockFileEx)(HANDLE hFile, DWORD dwReserved, DWORD nNumberOfBytesToUnlockLow, - DWORD nNumberOfBytesToUnlockHigh, LPOVERLAPPED lpOverlapped); -typedef BOOL (*pcSetFileTime)(HANDLE hFile, const FILETIME *lpCreationTime, - const FILETIME *lpLastAccessTime, const FILETIME *lpLastWriteTime); + DWORD nNumberOfBytesToUnlockHigh, LPOVERLAPPED lpOverlapped); +typedef BOOL (*pcSetFileTime)(HANDLE hFile, const FILETIME* lpCreationTime, + const FILETIME* lpLastAccessTime, const FILETIME* lpLastWriteTime); typedef struct _HANDLE_OPS { @@ -110,8 +114,7 @@ struct winpr_handle }; typedef struct winpr_handle WINPR_HANDLE; -static INLINE void WINPR_HANDLE_SET_TYPE_AND_MODE(void* _handle, - ULONG _type, ULONG _mode) +static INLINE void WINPR_HANDLE_SET_TYPE_AND_MODE(void* _handle, ULONG _type, ULONG _mode) { WINPR_HANDLE* hdl = (WINPR_HANDLE*)_handle; @@ -126,14 +129,14 @@ static INLINE BOOL winpr_Handle_GetInfo(HANDLE handle, ULONG* pType, WINPR_HANDL if (handle == NULL) return FALSE; - /* INVALID_HANDLE_VALUE is an invalid value for every handle, but it - * confuses the clang scanbuild analyzer. */ + /* INVALID_HANDLE_VALUE is an invalid value for every handle, but it + * confuses the clang scanbuild analyzer. */ #ifndef __clang_analyzer__ if (handle == INVALID_HANDLE_VALUE) return FALSE; #endif - wHandle = (WINPR_HANDLE*) handle; + wHandle = (WINPR_HANDLE*)handle; *pType = wHandle->Type; *pObject = handle; @@ -143,7 +146,7 @@ static INLINE BOOL winpr_Handle_GetInfo(HANDLE handle, ULONG* pType, WINPR_HANDL static INLINE int winpr_Handle_getFd(HANDLE handle) { - WINPR_HANDLE *hdl; + WINPR_HANDLE* hdl; ULONG type; if (!winpr_Handle_GetInfo(handle, &type, &hdl)) @@ -157,7 +160,7 @@ static INLINE int winpr_Handle_getFd(HANDLE handle) static INLINE DWORD winpr_Handle_cleanup(HANDLE handle) { - WINPR_HANDLE *hdl; + WINPR_HANDLE* hdl; ULONG type; if (!winpr_Handle_GetInfo(handle, &type, &hdl)) diff --git a/winpr/libwinpr/handle/nonehandle.c b/winpr/libwinpr/handle/nonehandle.c index 557be09aa..ac30ac63d 100644 --- a/winpr/libwinpr/handle/nonehandle.c +++ b/winpr/libwinpr/handle/nonehandle.c @@ -30,14 +30,14 @@ static BOOL NoneHandleCloseHandle(HANDLE handle) { - WINPR_NONE_HANDLE* none = (WINPR_NONE_HANDLE*) handle; + WINPR_NONE_HANDLE* none = (WINPR_NONE_HANDLE*)handle; free(none); return TRUE; } static BOOL NoneHandleIsHandle(HANDLE handle) { - WINPR_NONE_HANDLE* none = (WINPR_NONE_HANDLE*) handle; + WINPR_NONE_HANDLE* none = (WINPR_NONE_HANDLE*)handle; if (!none || none->Type != HANDLE_TYPE_NONE) { @@ -56,34 +56,31 @@ static int NoneHandleGetFd(HANDLE handle) return -1; } -static HANDLE_OPS ops = -{ - NoneHandleIsHandle, - NoneHandleCloseHandle, - NoneHandleGetFd, - NULL, /* CleanupHandle */ - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL -}; +static HANDLE_OPS ops = { NoneHandleIsHandle, + NoneHandleCloseHandle, + NoneHandleGetFd, + NULL, /* CleanupHandle */ + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL }; HANDLE CreateNoneHandle() { WINPR_NONE_HANDLE* none; - none = (WINPR_NONE_HANDLE*) calloc(1, sizeof(WINPR_NONE_HANDLE)); + none = (WINPR_NONE_HANDLE*)calloc(1, sizeof(WINPR_NONE_HANDLE)); if (!none) return NULL; diff --git a/winpr/libwinpr/input/keycode.c b/winpr/libwinpr/input/keycode.c index beec51980..aaa0660c6 100644 --- a/winpr/libwinpr/input/keycode.c +++ b/winpr/libwinpr/input/keycode.c @@ -33,264 +33,263 @@ * Mac OS X */ -DWORD KEYCODE_TO_VKCODE_APPLE[256] = -{ - 0, /* 0 */ - 0, /* 1 */ - 0, /* 2 */ - 0, /* 3 */ - 0, /* 4 */ - 0, /* 5 */ - 0, /* 6 */ - 0, /* 7 */ - VK_KEY_A, /* APPLE_VK_ANSI_A (0x00) */ - VK_KEY_S, /* APPLE_VK_ANSI_S (0x01) */ - VK_KEY_D, /* APPLE_VK_ANSI_D (0x02) */ - VK_KEY_F, /* APPLE_VK_ANSI_F (0x03) */ - VK_KEY_H, /* APPLE_VK_ANSI_H (0x04) */ - VK_KEY_G, /* APPLE_VK_ANSI_G (0x05) */ - VK_KEY_Z, /* APPLE_VK_ANSI_Z (0x06) */ - VK_KEY_X, /* APPLE_VK_ANSI_X (0x07) */ - VK_KEY_C, /* APPLE_VK_ANSI_C (0x08) */ - VK_KEY_V, /* APPLE_VK_ANSI_V (0x09) */ - VK_OEM_102, /* APPLE_VK_ISO_Section (0x0A) */ - VK_KEY_B, /* APPLE_VK_ANSI_B (0x0B) */ - VK_KEY_Q, /* APPLE_VK_ANSI_Q (0x0C) */ - VK_KEY_W, /* APPLE_VK_ANSI_W (0x0D) */ - VK_KEY_E, /* APPLE_VK_ANSI_E (0x0E) */ - VK_KEY_R, /* APPLE_VK_ANSI_R (0x0F) */ - VK_KEY_Y, /* APPLE_VK_ANSI_Y (0x10) */ - VK_KEY_T, /* APPLE_VK_ANSI_T (0x11) */ - VK_KEY_1, /* APPLE_VK_ANSI_1 (0x12) */ - VK_KEY_2, /* APPLE_VK_ANSI_2 (0x13) */ - VK_KEY_3, /* APPLE_VK_ANSI_3 (0x14) */ - VK_KEY_4, /* APPLE_VK_ANSI_4 (0x15) */ - VK_KEY_6, /* APPLE_VK_ANSI_6 (0x16) */ - VK_KEY_5, /* APPLE_VK_ANSI_5 (0x17) */ - VK_OEM_PLUS, /* APPLE_VK_ANSI_Equal (0x18) */ - VK_KEY_9, /* APPLE_VK_ANSI_9 (0x19) */ - VK_KEY_7, /* APPLE_VK_ANSI_7 (0x1A) */ - VK_OEM_MINUS, /* APPLE_VK_ANSI_Minus (0x1B) */ - VK_KEY_8, /* APPLE_VK_ANSI_8 (0x1C) */ - VK_KEY_0, /* APPLE_VK_ANSI_0 (0x1D) */ - VK_OEM_6, /* APPLE_VK_ANSI_RightBracket (0x1E) */ - VK_KEY_O, /* APPLE_VK_ANSI_O (0x1F) */ - VK_KEY_U, /* APPLE_VK_ANSI_U (0x20) */ - VK_OEM_4, /* APPLE_VK_ANSI_LeftBracket (0x21) */ - VK_KEY_I, /* APPLE_VK_ANSI_I (0x22) */ - VK_KEY_P, /* APPLE_VK_ANSI_P (0x23) */ - VK_RETURN, /* APPLE_VK_Return (0x24) */ - VK_KEY_L, /* APPLE_VK_ANSI_L (0x25) */ - VK_KEY_J, /* APPLE_VK_ANSI_J (0x26) */ - VK_OEM_7, /* APPLE_VK_ANSI_Quote (0x27) */ - VK_KEY_K, /* APPLE_VK_ANSI_K (0x28) */ - VK_OEM_1, /* APPLE_VK_ANSI_Semicolon (0x29) */ - VK_OEM_5, /* APPLE_VK_ANSI_Backslash (0x2A) */ - VK_OEM_COMMA, /* APPLE_VK_ANSI_Comma (0x2B) */ - VK_OEM_2, /* APPLE_VK_ANSI_Slash (0x2C) */ - VK_KEY_N, /* APPLE_VK_ANSI_N (0x2D) */ - VK_KEY_M, /* APPLE_VK_ANSI_M (0x2E) */ - VK_OEM_PERIOD, /* APPLE_VK_ANSI_Period (0x2F) */ - VK_TAB, /* APPLE_VK_Tab (0x30) */ - VK_SPACE, /* APPLE_VK_Space (0x31) */ - VK_OEM_3, /* APPLE_VK_ANSI_Grave (0x32) */ - VK_BACK, /* APPLE_VK_Delete (0x33) */ - 0, /* APPLE_VK_0x34 (0x34) */ - VK_ESCAPE, /* APPLE_VK_Escape (0x35) */ - VK_RWIN | KBDEXT, /* APPLE_VK_RightCommand (0x36) */ - VK_LWIN | KBDEXT, /* APPLE_VK_Command (0x37) */ - VK_LSHIFT, /* APPLE_VK_Shift (0x38) */ - VK_CAPITAL, /* APPLE_VK_CapsLock (0x39) */ - VK_LMENU, /* APPLE_VK_Option (0x3A) */ - VK_LCONTROL, /* APPLE_VK_Control (0x3B) */ - VK_RSHIFT, /* APPLE_VK_RightShift (0x3C) */ - VK_RMENU | KBDEXT, /* APPLE_VK_RightOption (0x3D) */ - VK_RWIN | KBDEXT, /* APPLE_VK_RightControl (0x3E) */ - VK_RWIN | KBDEXT, /* APPLE_VK_Function (0x3F) */ - VK_F17, /* APPLE_VK_F17 (0x40) */ - VK_DECIMAL, /* APPLE_VK_ANSI_KeypadDecimal (0x41) */ - 0, /* APPLE_VK_0x42 (0x42) */ - VK_MULTIPLY, /* APPLE_VK_ANSI_KeypadMultiply (0x43) */ - 0, /* APPLE_VK_0x44 (0x44) */ - VK_ADD, /* APPLE_VK_ANSI_KeypadPlus (0x45) */ - 0, /* APPLE_VK_0x46 (0x46) */ - VK_NUMLOCK, /* APPLE_VK_ANSI_KeypadClear (0x47) */ - VK_VOLUME_UP, /* APPLE_VK_VolumeUp (0x48) */ - VK_VOLUME_DOWN, /* APPLE_VK_VolumeDown (0x49) */ - VK_VOLUME_MUTE, /* APPLE_VK_Mute (0x4A) */ - VK_DIVIDE | KBDEXT, /* APPLE_VK_ANSI_KeypadDivide (0x4B) */ - VK_RETURN | KBDEXT, /* APPLE_VK_ANSI_KeypadEnter (0x4C) */ - 0, /* APPLE_VK_0x4D (0x4D) */ - VK_SUBTRACT, /* APPLE_VK_ANSI_KeypadMinus (0x4E) */ - VK_F18, /* APPLE_VK_F18 (0x4F) */ - VK_F19, /* APPLE_VK_F19 (0x50) */ - VK_CLEAR | KBDEXT, /* APPLE_VK_ANSI_KeypadEquals (0x51) */ - VK_NUMPAD0, /* APPLE_VK_ANSI_Keypad0 (0x52) */ - VK_NUMPAD1, /* APPLE_VK_ANSI_Keypad1 (0x53) */ - VK_NUMPAD2, /* APPLE_VK_ANSI_Keypad2 (0x54) */ - VK_NUMPAD3, /* APPLE_VK_ANSI_Keypad3 (0x55) */ - VK_NUMPAD4, /* APPLE_VK_ANSI_Keypad4 (0x56) */ - VK_NUMPAD5, /* APPLE_VK_ANSI_Keypad5 (0x57) */ - VK_NUMPAD6, /* APPLE_VK_ANSI_Keypad6 (0x58) */ - VK_NUMPAD7, /* APPLE_VK_ANSI_Keypad7 (0x59) */ - VK_F20, /* APPLE_VK_F20 (0x5A) */ - VK_NUMPAD8, /* APPLE_VK_ANSI_Keypad8 (0x5B) */ - VK_NUMPAD9, /* APPLE_VK_ANSI_Keypad9 (0x5C) */ - 0, /* APPLE_VK_JIS_Yen (0x5D) */ - 0, /* APPLE_VK_JIS_Underscore (0x5E) */ - VK_DECIMAL, /* APPLE_VK_JIS_KeypadComma (0x5F) */ - VK_F5, /* APPLE_VK_F5 (0x60) */ - VK_F6, /* APPLE_VK_F6 (0x61) */ - VK_F7, /* APPLE_VK_F7 (0x62) */ - VK_F3, /* APPLE_VK_F3 (0x63) */ - VK_F8, /* APPLE_VK_F8 (0x64) */ - VK_F9, /* APPLE_VK_F9 (0x65) */ - 0, /* APPLE_VK_JIS_Eisu (0x66) */ - VK_F11, /* APPLE_VK_F11 (0x67) */ - 0, /* APPLE_VK_JIS_Kana (0x68) */ +DWORD KEYCODE_TO_VKCODE_APPLE[256] = { + 0, /* 0 */ + 0, /* 1 */ + 0, /* 2 */ + 0, /* 3 */ + 0, /* 4 */ + 0, /* 5 */ + 0, /* 6 */ + 0, /* 7 */ + VK_KEY_A, /* APPLE_VK_ANSI_A (0x00) */ + VK_KEY_S, /* APPLE_VK_ANSI_S (0x01) */ + VK_KEY_D, /* APPLE_VK_ANSI_D (0x02) */ + VK_KEY_F, /* APPLE_VK_ANSI_F (0x03) */ + VK_KEY_H, /* APPLE_VK_ANSI_H (0x04) */ + VK_KEY_G, /* APPLE_VK_ANSI_G (0x05) */ + VK_KEY_Z, /* APPLE_VK_ANSI_Z (0x06) */ + VK_KEY_X, /* APPLE_VK_ANSI_X (0x07) */ + VK_KEY_C, /* APPLE_VK_ANSI_C (0x08) */ + VK_KEY_V, /* APPLE_VK_ANSI_V (0x09) */ + VK_OEM_102, /* APPLE_VK_ISO_Section (0x0A) */ + VK_KEY_B, /* APPLE_VK_ANSI_B (0x0B) */ + VK_KEY_Q, /* APPLE_VK_ANSI_Q (0x0C) */ + VK_KEY_W, /* APPLE_VK_ANSI_W (0x0D) */ + VK_KEY_E, /* APPLE_VK_ANSI_E (0x0E) */ + VK_KEY_R, /* APPLE_VK_ANSI_R (0x0F) */ + VK_KEY_Y, /* APPLE_VK_ANSI_Y (0x10) */ + VK_KEY_T, /* APPLE_VK_ANSI_T (0x11) */ + VK_KEY_1, /* APPLE_VK_ANSI_1 (0x12) */ + VK_KEY_2, /* APPLE_VK_ANSI_2 (0x13) */ + VK_KEY_3, /* APPLE_VK_ANSI_3 (0x14) */ + VK_KEY_4, /* APPLE_VK_ANSI_4 (0x15) */ + VK_KEY_6, /* APPLE_VK_ANSI_6 (0x16) */ + VK_KEY_5, /* APPLE_VK_ANSI_5 (0x17) */ + VK_OEM_PLUS, /* APPLE_VK_ANSI_Equal (0x18) */ + VK_KEY_9, /* APPLE_VK_ANSI_9 (0x19) */ + VK_KEY_7, /* APPLE_VK_ANSI_7 (0x1A) */ + VK_OEM_MINUS, /* APPLE_VK_ANSI_Minus (0x1B) */ + VK_KEY_8, /* APPLE_VK_ANSI_8 (0x1C) */ + VK_KEY_0, /* APPLE_VK_ANSI_0 (0x1D) */ + VK_OEM_6, /* APPLE_VK_ANSI_RightBracket (0x1E) */ + VK_KEY_O, /* APPLE_VK_ANSI_O (0x1F) */ + VK_KEY_U, /* APPLE_VK_ANSI_U (0x20) */ + VK_OEM_4, /* APPLE_VK_ANSI_LeftBracket (0x21) */ + VK_KEY_I, /* APPLE_VK_ANSI_I (0x22) */ + VK_KEY_P, /* APPLE_VK_ANSI_P (0x23) */ + VK_RETURN, /* APPLE_VK_Return (0x24) */ + VK_KEY_L, /* APPLE_VK_ANSI_L (0x25) */ + VK_KEY_J, /* APPLE_VK_ANSI_J (0x26) */ + VK_OEM_7, /* APPLE_VK_ANSI_Quote (0x27) */ + VK_KEY_K, /* APPLE_VK_ANSI_K (0x28) */ + VK_OEM_1, /* APPLE_VK_ANSI_Semicolon (0x29) */ + VK_OEM_5, /* APPLE_VK_ANSI_Backslash (0x2A) */ + VK_OEM_COMMA, /* APPLE_VK_ANSI_Comma (0x2B) */ + VK_OEM_2, /* APPLE_VK_ANSI_Slash (0x2C) */ + VK_KEY_N, /* APPLE_VK_ANSI_N (0x2D) */ + VK_KEY_M, /* APPLE_VK_ANSI_M (0x2E) */ + VK_OEM_PERIOD, /* APPLE_VK_ANSI_Period (0x2F) */ + VK_TAB, /* APPLE_VK_Tab (0x30) */ + VK_SPACE, /* APPLE_VK_Space (0x31) */ + VK_OEM_3, /* APPLE_VK_ANSI_Grave (0x32) */ + VK_BACK, /* APPLE_VK_Delete (0x33) */ + 0, /* APPLE_VK_0x34 (0x34) */ + VK_ESCAPE, /* APPLE_VK_Escape (0x35) */ + VK_RWIN | KBDEXT, /* APPLE_VK_RightCommand (0x36) */ + VK_LWIN | KBDEXT, /* APPLE_VK_Command (0x37) */ + VK_LSHIFT, /* APPLE_VK_Shift (0x38) */ + VK_CAPITAL, /* APPLE_VK_CapsLock (0x39) */ + VK_LMENU, /* APPLE_VK_Option (0x3A) */ + VK_LCONTROL, /* APPLE_VK_Control (0x3B) */ + VK_RSHIFT, /* APPLE_VK_RightShift (0x3C) */ + VK_RMENU | KBDEXT, /* APPLE_VK_RightOption (0x3D) */ + VK_RWIN | KBDEXT, /* APPLE_VK_RightControl (0x3E) */ + VK_RWIN | KBDEXT, /* APPLE_VK_Function (0x3F) */ + VK_F17, /* APPLE_VK_F17 (0x40) */ + VK_DECIMAL, /* APPLE_VK_ANSI_KeypadDecimal (0x41) */ + 0, /* APPLE_VK_0x42 (0x42) */ + VK_MULTIPLY, /* APPLE_VK_ANSI_KeypadMultiply (0x43) */ + 0, /* APPLE_VK_0x44 (0x44) */ + VK_ADD, /* APPLE_VK_ANSI_KeypadPlus (0x45) */ + 0, /* APPLE_VK_0x46 (0x46) */ + VK_NUMLOCK, /* APPLE_VK_ANSI_KeypadClear (0x47) */ + VK_VOLUME_UP, /* APPLE_VK_VolumeUp (0x48) */ + VK_VOLUME_DOWN, /* APPLE_VK_VolumeDown (0x49) */ + VK_VOLUME_MUTE, /* APPLE_VK_Mute (0x4A) */ + VK_DIVIDE | KBDEXT, /* APPLE_VK_ANSI_KeypadDivide (0x4B) */ + VK_RETURN | KBDEXT, /* APPLE_VK_ANSI_KeypadEnter (0x4C) */ + 0, /* APPLE_VK_0x4D (0x4D) */ + VK_SUBTRACT, /* APPLE_VK_ANSI_KeypadMinus (0x4E) */ + VK_F18, /* APPLE_VK_F18 (0x4F) */ + VK_F19, /* APPLE_VK_F19 (0x50) */ + VK_CLEAR | KBDEXT, /* APPLE_VK_ANSI_KeypadEquals (0x51) */ + VK_NUMPAD0, /* APPLE_VK_ANSI_Keypad0 (0x52) */ + VK_NUMPAD1, /* APPLE_VK_ANSI_Keypad1 (0x53) */ + VK_NUMPAD2, /* APPLE_VK_ANSI_Keypad2 (0x54) */ + VK_NUMPAD3, /* APPLE_VK_ANSI_Keypad3 (0x55) */ + VK_NUMPAD4, /* APPLE_VK_ANSI_Keypad4 (0x56) */ + VK_NUMPAD5, /* APPLE_VK_ANSI_Keypad5 (0x57) */ + VK_NUMPAD6, /* APPLE_VK_ANSI_Keypad6 (0x58) */ + VK_NUMPAD7, /* APPLE_VK_ANSI_Keypad7 (0x59) */ + VK_F20, /* APPLE_VK_F20 (0x5A) */ + VK_NUMPAD8, /* APPLE_VK_ANSI_Keypad8 (0x5B) */ + VK_NUMPAD9, /* APPLE_VK_ANSI_Keypad9 (0x5C) */ + 0, /* APPLE_VK_JIS_Yen (0x5D) */ + 0, /* APPLE_VK_JIS_Underscore (0x5E) */ + VK_DECIMAL, /* APPLE_VK_JIS_KeypadComma (0x5F) */ + VK_F5, /* APPLE_VK_F5 (0x60) */ + VK_F6, /* APPLE_VK_F6 (0x61) */ + VK_F7, /* APPLE_VK_F7 (0x62) */ + VK_F3, /* APPLE_VK_F3 (0x63) */ + VK_F8, /* APPLE_VK_F8 (0x64) */ + VK_F9, /* APPLE_VK_F9 (0x65) */ + 0, /* APPLE_VK_JIS_Eisu (0x66) */ + VK_F11, /* APPLE_VK_F11 (0x67) */ + 0, /* APPLE_VK_JIS_Kana (0x68) */ VK_SNAPSHOT | KBDEXT, /* APPLE_VK_F13 (0x69) */ - VK_F16, /* APPLE_VK_F16 (0x6A) */ - VK_F14, /* APPLE_VK_F14 (0x6B) */ - 0, /* APPLE_VK_0x6C (0x6C) */ - VK_F10, /* APPLE_VK_F10 (0x6D) */ - 0, /* APPLE_VK_0x6E (0x6E) */ - VK_F12, /* APPLE_VK_F12 (0x6F) */ - 0, /* APPLE_VK_0x70 (0x70) */ - VK_PAUSE | KBDEXT, /* APPLE_VK_F15 (0x71) */ - VK_INSERT | KBDEXT, /* APPLE_VK_Help (0x72) */ - VK_HOME | KBDEXT, /* APPLE_VK_Home (0x73) */ - VK_PRIOR | KBDEXT, /* APPLE_VK_PageUp (0x74) */ - VK_DELETE | KBDEXT, /* APPLE_VK_ForwardDelete (0x75) */ - VK_F4, /* APPLE_VK_F4 (0x76) */ - VK_END | KBDEXT, /* APPLE_VK_End (0x77) */ - VK_F2, /* APPLE_VK_F2 (0x78) */ - VK_NEXT | KBDEXT, /* APPLE_VK_PageDown (0x79) */ - VK_F1, /* APPLE_VK_F1 (0x7A) */ - VK_LEFT | KBDEXT, /* APPLE_VK_LeftArrow (0x7B) */ - VK_RIGHT | KBDEXT, /* APPLE_VK_RightArrow (0x7C) */ - VK_DOWN | KBDEXT, /* APPLE_VK_DownArrow (0x7D) */ - VK_UP | KBDEXT, /* APPLE_VK_UpArrow (0x7E) */ - 0, /* 135 */ - 0, /* 136 */ - 0, /* 137 */ - 0, /* 138 */ - 0, /* 139 */ - 0, /* 140 */ - 0, /* 141 */ - 0, /* 142 */ - 0, /* 143 */ - 0, /* 144 */ - 0, /* 145 */ - 0, /* 146 */ - 0, /* 147 */ - 0, /* 148 */ - 0, /* 149 */ - 0, /* 150 */ - 0, /* 151 */ - 0, /* 152 */ - 0, /* 153 */ - 0, /* 154 */ - 0, /* 155 */ - 0, /* 156 */ - 0, /* 157 */ - 0, /* 158 */ - 0, /* 159 */ - 0, /* 160 */ - 0, /* 161 */ - 0, /* 162 */ - 0, /* 163 */ - 0, /* 164 */ - 0, /* 165 */ - 0, /* 166 */ - 0, /* 167 */ - 0, /* 168 */ - 0, /* 169 */ - 0, /* 170 */ - 0, /* 171 */ - 0, /* 172 */ - 0, /* 173 */ - 0, /* 174 */ - 0, /* 175 */ - 0, /* 176 */ - 0, /* 177 */ - 0, /* 178 */ - 0, /* 179 */ - 0, /* 180 */ - 0, /* 181 */ - 0, /* 182 */ - 0, /* 183 */ - 0, /* 184 */ - 0, /* 185 */ - 0, /* 186 */ - 0, /* 187 */ - 0, /* 188 */ - 0, /* 189 */ - 0, /* 190 */ - 0, /* 191 */ - 0, /* 192 */ - 0, /* 193 */ - 0, /* 194 */ - 0, /* 195 */ - 0, /* 196 */ - 0, /* 197 */ - 0, /* 198 */ - 0, /* 199 */ - 0, /* 200 */ - 0, /* 201 */ - 0, /* 202 */ - 0, /* 203 */ - 0, /* 204 */ - 0, /* 205 */ - 0, /* 206 */ - 0, /* 207 */ - 0, /* 208 */ - 0, /* 209 */ - 0, /* 210 */ - 0, /* 211 */ - 0, /* 212 */ - 0, /* 213 */ - 0, /* 214 */ - 0, /* 215 */ - 0, /* 216 */ - 0, /* 217 */ - 0, /* 218 */ - 0, /* 219 */ - 0, /* 220 */ - 0, /* 221 */ - 0, /* 222 */ - 0, /* 223 */ - 0, /* 224 */ - 0, /* 225 */ - 0, /* 226 */ - 0, /* 227 */ - 0, /* 228 */ - 0, /* 229 */ - 0, /* 230 */ - 0, /* 231 */ - 0, /* 232 */ - 0, /* 233 */ - 0, /* 234 */ - 0, /* 235 */ - 0, /* 236 */ - 0, /* 237 */ - 0, /* 238 */ - 0, /* 239 */ - 0, /* 240 */ - 0, /* 241 */ - 0, /* 242 */ - 0, /* 243 */ - 0, /* 244 */ - 0, /* 245 */ - 0, /* 246 */ - 0, /* 247 */ - 0, /* 248 */ - 0, /* 249 */ - 0, /* 250 */ - 0, /* 251 */ - 0, /* 252 */ - 0, /* 253 */ - 0, /* 254 */ - 0 /* 255 */ + VK_F16, /* APPLE_VK_F16 (0x6A) */ + VK_F14, /* APPLE_VK_F14 (0x6B) */ + 0, /* APPLE_VK_0x6C (0x6C) */ + VK_F10, /* APPLE_VK_F10 (0x6D) */ + 0, /* APPLE_VK_0x6E (0x6E) */ + VK_F12, /* APPLE_VK_F12 (0x6F) */ + 0, /* APPLE_VK_0x70 (0x70) */ + VK_PAUSE | KBDEXT, /* APPLE_VK_F15 (0x71) */ + VK_INSERT | KBDEXT, /* APPLE_VK_Help (0x72) */ + VK_HOME | KBDEXT, /* APPLE_VK_Home (0x73) */ + VK_PRIOR | KBDEXT, /* APPLE_VK_PageUp (0x74) */ + VK_DELETE | KBDEXT, /* APPLE_VK_ForwardDelete (0x75) */ + VK_F4, /* APPLE_VK_F4 (0x76) */ + VK_END | KBDEXT, /* APPLE_VK_End (0x77) */ + VK_F2, /* APPLE_VK_F2 (0x78) */ + VK_NEXT | KBDEXT, /* APPLE_VK_PageDown (0x79) */ + VK_F1, /* APPLE_VK_F1 (0x7A) */ + VK_LEFT | KBDEXT, /* APPLE_VK_LeftArrow (0x7B) */ + VK_RIGHT | KBDEXT, /* APPLE_VK_RightArrow (0x7C) */ + VK_DOWN | KBDEXT, /* APPLE_VK_DownArrow (0x7D) */ + VK_UP | KBDEXT, /* APPLE_VK_UpArrow (0x7E) */ + 0, /* 135 */ + 0, /* 136 */ + 0, /* 137 */ + 0, /* 138 */ + 0, /* 139 */ + 0, /* 140 */ + 0, /* 141 */ + 0, /* 142 */ + 0, /* 143 */ + 0, /* 144 */ + 0, /* 145 */ + 0, /* 146 */ + 0, /* 147 */ + 0, /* 148 */ + 0, /* 149 */ + 0, /* 150 */ + 0, /* 151 */ + 0, /* 152 */ + 0, /* 153 */ + 0, /* 154 */ + 0, /* 155 */ + 0, /* 156 */ + 0, /* 157 */ + 0, /* 158 */ + 0, /* 159 */ + 0, /* 160 */ + 0, /* 161 */ + 0, /* 162 */ + 0, /* 163 */ + 0, /* 164 */ + 0, /* 165 */ + 0, /* 166 */ + 0, /* 167 */ + 0, /* 168 */ + 0, /* 169 */ + 0, /* 170 */ + 0, /* 171 */ + 0, /* 172 */ + 0, /* 173 */ + 0, /* 174 */ + 0, /* 175 */ + 0, /* 176 */ + 0, /* 177 */ + 0, /* 178 */ + 0, /* 179 */ + 0, /* 180 */ + 0, /* 181 */ + 0, /* 182 */ + 0, /* 183 */ + 0, /* 184 */ + 0, /* 185 */ + 0, /* 186 */ + 0, /* 187 */ + 0, /* 188 */ + 0, /* 189 */ + 0, /* 190 */ + 0, /* 191 */ + 0, /* 192 */ + 0, /* 193 */ + 0, /* 194 */ + 0, /* 195 */ + 0, /* 196 */ + 0, /* 197 */ + 0, /* 198 */ + 0, /* 199 */ + 0, /* 200 */ + 0, /* 201 */ + 0, /* 202 */ + 0, /* 203 */ + 0, /* 204 */ + 0, /* 205 */ + 0, /* 206 */ + 0, /* 207 */ + 0, /* 208 */ + 0, /* 209 */ + 0, /* 210 */ + 0, /* 211 */ + 0, /* 212 */ + 0, /* 213 */ + 0, /* 214 */ + 0, /* 215 */ + 0, /* 216 */ + 0, /* 217 */ + 0, /* 218 */ + 0, /* 219 */ + 0, /* 220 */ + 0, /* 221 */ + 0, /* 222 */ + 0, /* 223 */ + 0, /* 224 */ + 0, /* 225 */ + 0, /* 226 */ + 0, /* 227 */ + 0, /* 228 */ + 0, /* 229 */ + 0, /* 230 */ + 0, /* 231 */ + 0, /* 232 */ + 0, /* 233 */ + 0, /* 234 */ + 0, /* 235 */ + 0, /* 236 */ + 0, /* 237 */ + 0, /* 238 */ + 0, /* 239 */ + 0, /* 240 */ + 0, /* 241 */ + 0, /* 242 */ + 0, /* 243 */ + 0, /* 244 */ + 0, /* 245 */ + 0, /* 246 */ + 0, /* 247 */ + 0, /* 248 */ + 0, /* 249 */ + 0, /* 250 */ + 0, /* 251 */ + 0, /* 252 */ + 0, /* 253 */ + 0, /* 254 */ + 0 /* 255 */ }; /** @@ -302,279 +301,278 @@ DWORD KEYCODE_TO_VKCODE_APPLE[256] = /* TODO: Finish Japanese Keyboard */ -DWORD KEYCODE_TO_VKCODE_EVDEV[256] = -{ - 0, /* 0 */ - 0, /* 1 */ - 0, /* 2 */ - 0, /* 3 */ - 0, /* 4 */ - 0, /* 5 */ - 0, /* 6 */ - 0, /* 7 */ - 0, /* 8 */ - VK_ESCAPE, /* 9 */ - VK_KEY_1, /* 10 */ - VK_KEY_2, /* 11 */ - VK_KEY_3, /* 12 */ - VK_KEY_4, /* 13 */ - VK_KEY_5, /* 14 */ - VK_KEY_6, /* 15 */ - VK_KEY_7, /* 16 */ - VK_KEY_8, /* 17 */ - VK_KEY_9, /* 18 */ - VK_KEY_0, /* 19 */ - VK_OEM_MINUS, /* 20 */ - VK_OEM_PLUS, /* 21 */ - VK_BACK, /* 22 */ - VK_TAB, /* 23 */ - VK_KEY_Q, /* 24 */ - VK_KEY_W, /* 25 */ - VK_KEY_E, /* 26 */ - VK_KEY_R, /* 27 */ - VK_KEY_T, /* 28 */ - VK_KEY_Y, /* 29 */ - VK_KEY_U, /* 30 */ - VK_KEY_I, /* 31 */ - VK_KEY_O, /* 32 */ - VK_KEY_P, /* 33 */ - VK_OEM_4, /* 34 */ - VK_OEM_6, /* 35 */ - VK_RETURN, /* 36 */ - VK_LCONTROL, /* 37 */ - VK_KEY_A, /* 38 */ - VK_KEY_S, /* 39 */ - VK_KEY_D, /* 40 */ - VK_KEY_F, /* 41 */ - VK_KEY_G, /* 42 */ - VK_KEY_H, /* 43 */ - VK_KEY_J, /* 44 */ - VK_KEY_K, /* 45 */ - VK_KEY_L, /* 46 */ - VK_OEM_1, /* 47 */ - VK_OEM_7, /* 48 */ - VK_OEM_3, /* 49 */ - VK_LSHIFT, /* 50 */ - VK_OEM_5, /* 51 */ - VK_KEY_Z, /* 52 */ - VK_KEY_X, /* 53 */ - VK_KEY_C, /* 54 */ - VK_KEY_V, /* 55 */ - VK_KEY_B, /* 56 */ - VK_KEY_N, /* 57 */ - VK_KEY_M, /* 58 */ - VK_OEM_COMMA, /* 59 */ +DWORD KEYCODE_TO_VKCODE_EVDEV[256] = { + 0, /* 0 */ + 0, /* 1 */ + 0, /* 2 */ + 0, /* 3 */ + 0, /* 4 */ + 0, /* 5 */ + 0, /* 6 */ + 0, /* 7 */ + 0, /* 8 */ + VK_ESCAPE, /* 9 */ + VK_KEY_1, /* 10 */ + VK_KEY_2, /* 11 */ + VK_KEY_3, /* 12 */ + VK_KEY_4, /* 13 */ + VK_KEY_5, /* 14 */ + VK_KEY_6, /* 15 */ + VK_KEY_7, /* 16 */ + VK_KEY_8, /* 17 */ + VK_KEY_9, /* 18 */ + VK_KEY_0, /* 19 */ + VK_OEM_MINUS, /* 20 */ + VK_OEM_PLUS, /* 21 */ + VK_BACK, /* 22 */ + VK_TAB, /* 23 */ + VK_KEY_Q, /* 24 */ + VK_KEY_W, /* 25 */ + VK_KEY_E, /* 26 */ + VK_KEY_R, /* 27 */ + VK_KEY_T, /* 28 */ + VK_KEY_Y, /* 29 */ + VK_KEY_U, /* 30 */ + VK_KEY_I, /* 31 */ + VK_KEY_O, /* 32 */ + VK_KEY_P, /* 33 */ + VK_OEM_4, /* 34 */ + VK_OEM_6, /* 35 */ + VK_RETURN, /* 36 */ + VK_LCONTROL, /* 37 */ + VK_KEY_A, /* 38 */ + VK_KEY_S, /* 39 */ + VK_KEY_D, /* 40 */ + VK_KEY_F, /* 41 */ + VK_KEY_G, /* 42 */ + VK_KEY_H, /* 43 */ + VK_KEY_J, /* 44 */ + VK_KEY_K, /* 45 */ + VK_KEY_L, /* 46 */ + VK_OEM_1, /* 47 */ + VK_OEM_7, /* 48 */ + VK_OEM_3, /* 49 */ + VK_LSHIFT, /* 50 */ + VK_OEM_5, /* 51 */ + VK_KEY_Z, /* 52 */ + VK_KEY_X, /* 53 */ + VK_KEY_C, /* 54 */ + VK_KEY_V, /* 55 */ + VK_KEY_B, /* 56 */ + VK_KEY_N, /* 57 */ + VK_KEY_M, /* 58 */ + VK_OEM_COMMA, /* 59 */ VK_OEM_PERIOD, /* 60 */ - VK_OEM_2, /* 61 */ - VK_RSHIFT, /* 62 */ - VK_MULTIPLY, /* 63 */ - VK_LMENU, /* 64 */ - VK_SPACE, /* 65 */ - VK_CAPITAL, /* 66 */ - VK_F1, /* 67 */ - VK_F2, /* 68 */ - VK_F3, /* 69 */ - VK_F4, /* 70 */ - VK_F5, /* 71 */ - VK_F6, /* 72 */ - VK_F7, /* 73 */ - VK_F8, /* 74 */ - VK_F9, /* 75 */ - VK_F10, /* 76 */ - VK_NUMLOCK, /* 77 */ - VK_SCROLL, /* 78 */ - VK_NUMPAD7, /* 79 */ - VK_NUMPAD8, /* 80 */ - VK_NUMPAD9, /* 81 */ - VK_SUBTRACT, /* 82 */ - VK_NUMPAD4, /* 83 */ - VK_NUMPAD5, /* 84 */ - VK_NUMPAD6, /* 85 */ - VK_ADD, /* 86 */ - VK_NUMPAD1, /* 87 */ - VK_NUMPAD2, /* 88 */ - VK_NUMPAD3, /* 89 */ - VK_NUMPAD0, /* 90 */ - VK_DECIMAL, /* 91 */ - 0, /* 92 */ - 0, /* 93 */ - VK_OEM_102, /* 94 */ - VK_F11, /* 95 */ - VK_F12, /* 96 */ + VK_OEM_2, /* 61 */ + VK_RSHIFT, /* 62 */ + VK_MULTIPLY, /* 63 */ + VK_LMENU, /* 64 */ + VK_SPACE, /* 65 */ + VK_CAPITAL, /* 66 */ + VK_F1, /* 67 */ + VK_F2, /* 68 */ + VK_F3, /* 69 */ + VK_F4, /* 70 */ + VK_F5, /* 71 */ + VK_F6, /* 72 */ + VK_F7, /* 73 */ + VK_F8, /* 74 */ + VK_F9, /* 75 */ + VK_F10, /* 76 */ + VK_NUMLOCK, /* 77 */ + VK_SCROLL, /* 78 */ + VK_NUMPAD7, /* 79 */ + VK_NUMPAD8, /* 80 */ + VK_NUMPAD9, /* 81 */ + VK_SUBTRACT, /* 82 */ + VK_NUMPAD4, /* 83 */ + VK_NUMPAD5, /* 84 */ + VK_NUMPAD6, /* 85 */ + VK_ADD, /* 86 */ + VK_NUMPAD1, /* 87 */ + VK_NUMPAD2, /* 88 */ + VK_NUMPAD3, /* 89 */ + VK_NUMPAD0, /* 90 */ + VK_DECIMAL, /* 91 */ + 0, /* 92 */ + 0, /* 93 */ + VK_OEM_102, /* 94 */ + VK_F11, /* 95 */ + VK_F12, /* 96 */ #ifdef __sun - VK_HOME | KBDEXT, /* 97 */ - VK_UP | KBDEXT, /* 98 */ - VK_PRIOR | KBDEXT, /* 99 */ - VK_LEFT | KBDEXT, /* 100 */ - VK_HKTG, /* 101 */ - VK_RIGHT | KBDEXT, /* 102 */ - VK_END | KBDEXT, /* 103 */ - VK_DOWN | KBDEXT, /* 104 */ - VK_NEXT | KBDEXT, /* 105 */ + VK_HOME | KBDEXT, /* 97 */ + VK_UP | KBDEXT, /* 98 */ + VK_PRIOR | KBDEXT, /* 99 */ + VK_LEFT | KBDEXT, /* 100 */ + VK_HKTG, /* 101 */ + VK_RIGHT | KBDEXT, /* 102 */ + VK_END | KBDEXT, /* 103 */ + VK_DOWN | KBDEXT, /* 104 */ + VK_NEXT | KBDEXT, /* 105 */ VK_INSERT | KBDEXT, /* 106 */ VK_DELETE | KBDEXT, /* 107 */ VK_RETURN | KBDEXT, /* 108 */ #else - VK_ABNT_C1, /* 97 */ - VK_DBE_KATAKANA, /* 98 */ - VK_DBE_HIRAGANA, /* 99 */ - VK_CONVERT, /* 100 */ - VK_HKTG, /* 101 */ - VK_NONCONVERT, /* 102 */ - 0, /* 103 */ - VK_RETURN | KBDEXT, /* 104 */ + VK_ABNT_C1, /* 97 */ + VK_DBE_KATAKANA, /* 98 */ + VK_DBE_HIRAGANA, /* 99 */ + VK_CONVERT, /* 100 */ + VK_HKTG, /* 101 */ + VK_NONCONVERT, /* 102 */ + 0, /* 103 */ + VK_RETURN | KBDEXT, /* 104 */ VK_RCONTROL | KBDEXT, /* 105 */ - VK_DIVIDE | KBDEXT, /* 106 */ + VK_DIVIDE | KBDEXT, /* 106 */ VK_SNAPSHOT | KBDEXT, /* 107 */ - VK_RMENU | KBDEXT, /* 108 */ + VK_RMENU | KBDEXT, /* 108 */ #endif - 0, /* KEY_LINEFEED 109 */ - VK_HOME | KBDEXT, /* 110 */ - VK_UP | KBDEXT, /* 111 */ - VK_PRIOR | KBDEXT, /* 112 */ - VK_LEFT | KBDEXT, /* 113 */ - VK_RIGHT | KBDEXT, /* 114 */ - VK_END | KBDEXT, /* 115 */ - VK_DOWN | KBDEXT, /* 116 */ - VK_NEXT | KBDEXT, /* 117 */ - VK_INSERT | KBDEXT, /* 118 */ - VK_DELETE | KBDEXT, /* 119 */ - 0, /* KEY_MACRO 120 */ - VK_VOLUME_MUTE | KBDEXT, /* 121 */ - VK_VOLUME_DOWN | KBDEXT, /* 122 */ - VK_VOLUME_UP | KBDEXT, /* 123 */ - 0, /* 124 */ - 0, /* 125 */ - 0, /* KEY_KPPLUSMINUS 126 */ - VK_PAUSE | KBDEXT, /* 127 */ - 0, /* KEY_SCALE 128 */ - VK_ABNT_C2, /* KEY_KPCOMMA 129 */ - VK_HANGUL, /* 130 */ - VK_HANJA, /* 131 */ - VK_OEM_8, /* 132 */ - VK_LWIN | KBDEXT, /* 133 */ - VK_RWIN | KBDEXT, /* 134 */ - VK_APPS | KBDEXT, /*

135 */ - 0, /* 136 */ - 0, /* 137 */ - 0, /* 138 */ - 0, /* 139 */ - 0, /* 140 */ - 0, /* 141 */ - 0, /* 142 */ - 0, /* 143 */ - 0, /* 144 */ - 0, /* 145 */ - VK_HELP, /* 146 */ - VK_APPS | KBDEXT, /* KEY_MENU 147 */ - 0, /* KEY_CALC 148 */ - 0, /* KEY_SETUP 149 */ - VK_SLEEP, /* KEY_SLEEP 150 */ - 0, /* KEY_WAKEUP 151 */ - 0, /* KEY_FILE 152 */ - 0, /* KEY_SEND 153 */ - 0, /* KEY_DELETEFILE 154 */ - VK_CONVERT, /* KEY_XFER 155 */ - VK_LAUNCH_APP1, /* KEY_PROG1 156 */ - VK_LAUNCH_APP2, /* KEY_PROG2 157 */ - 0, /* KEY_WWW 158 */ - 0, /* KEY_MSDOS 159 */ - 0, /* KEY_COFFEE 160 */ - 0, /* KEY_DIRECTION 161 */ - 0, /* KEY_CYCLEWINDOWS 162 */ - VK_LAUNCH_MAIL | KBDEXT, /* KEY_MAIL 163 */ + 0, /* KEY_LINEFEED 109 */ + VK_HOME | KBDEXT, /* 110 */ + VK_UP | KBDEXT, /* 111 */ + VK_PRIOR | KBDEXT, /* 112 */ + VK_LEFT | KBDEXT, /* 113 */ + VK_RIGHT | KBDEXT, /* 114 */ + VK_END | KBDEXT, /* 115 */ + VK_DOWN | KBDEXT, /* 116 */ + VK_NEXT | KBDEXT, /* 117 */ + VK_INSERT | KBDEXT, /* 118 */ + VK_DELETE | KBDEXT, /* 119 */ + 0, /* KEY_MACRO 120 */ + VK_VOLUME_MUTE | KBDEXT, /* 121 */ + VK_VOLUME_DOWN | KBDEXT, /* 122 */ + VK_VOLUME_UP | KBDEXT, /* 123 */ + 0, /* 124 */ + 0, /* 125 */ + 0, /* KEY_KPPLUSMINUS 126 */ + VK_PAUSE | KBDEXT, /* 127 */ + 0, /* KEY_SCALE 128 */ + VK_ABNT_C2, /* KEY_KPCOMMA 129 */ + VK_HANGUL, /* 130 */ + VK_HANJA, /* 131 */ + VK_OEM_8, /* 132 */ + VK_LWIN | KBDEXT, /* 133 */ + VK_RWIN | KBDEXT, /* 134 */ + VK_APPS | KBDEXT, /* 135 */ + 0, /* 136 */ + 0, /* 137 */ + 0, /* 138 */ + 0, /* 139 */ + 0, /* 140 */ + 0, /* 141 */ + 0, /* 142 */ + 0, /* 143 */ + 0, /* 144 */ + 0, /* 145 */ + VK_HELP, /* 146 */ + VK_APPS | KBDEXT, /* KEY_MENU 147 */ + 0, /* KEY_CALC 148 */ + 0, /* KEY_SETUP 149 */ + VK_SLEEP, /* KEY_SLEEP 150 */ + 0, /* KEY_WAKEUP 151 */ + 0, /* KEY_FILE 152 */ + 0, /* KEY_SEND 153 */ + 0, /* KEY_DELETEFILE 154 */ + VK_CONVERT, /* KEY_XFER 155 */ + VK_LAUNCH_APP1, /* KEY_PROG1 156 */ + VK_LAUNCH_APP2, /* KEY_PROG2 157 */ + 0, /* KEY_WWW 158 */ + 0, /* KEY_MSDOS 159 */ + 0, /* KEY_COFFEE 160 */ + 0, /* KEY_DIRECTION 161 */ + 0, /* KEY_CYCLEWINDOWS 162 */ + VK_LAUNCH_MAIL | KBDEXT, /* KEY_MAIL 163 */ VK_BROWSER_FAVORITES | KBDEXT, /* KEY_BOOKMARKS 164 */ - 0, /* KEY_COMPUTER 165 */ - VK_BROWSER_BACK | KBDEXT, /* KEY_BACK 166 */ - VK_BROWSER_FORWARD | KBDEXT, /* KEY_FORWARD 167 */ - 0, /* KEY_CLOSECD 168 */ - 0, /* KEY_EJECTCD 169 */ - 0, /* KEY_EJECTCLOSECD 170 */ - VK_MEDIA_NEXT_TRACK | KBDEXT, /* KEY_NEXTSONG 171 */ - VK_MEDIA_PLAY_PAUSE | KBDEXT, /* KEY_PLAYPAUSE 172 */ - VK_MEDIA_PREV_TRACK | KBDEXT, /* KEY_PREVIOUSSONG 173 */ - VK_MEDIA_STOP | KBDEXT, /* KEY_STOPCD 174 */ - 0, /* KEY_RECORD 175 */ - 0, /* KEY_REWIND 176 */ - 0, /* KEY_PHONE 177 */ - 0, /* KEY_ISO 178 */ - 0, /* KEY_CONFIG 179 */ - VK_BROWSER_HOME | KBDEXT, /* KEY_HOMEPAGE 180 */ - VK_BROWSER_REFRESH | KBDEXT, /* KEY_REFRESH 181 */ - 0, /* KEY_EXIT 182 */ - 0, /* KEY_MOVE 183 */ - 0, /* KEY_EDIT 184 */ - 0, /* KEY_SCROLLUP 185 */ - 0, /* KEY_SCROLLDOWN 186 */ - 0, /* KEY_KPLEFTPAREN 187 */ - 0, /* KEY_KPRIGHTPAREN 188 */ - 0, /* KEY_NEW 189 */ - 0, /* KEY_REDO 190 */ - VK_F13, /* 191 */ - VK_F14, /* 192 */ - VK_F15, /* 193 */ - VK_F16, /* 194 */ - VK_F17, /* 195 */ - VK_F18, /* 196 */ - VK_F19, /* 197 */ - VK_F20, /* 198 */ - VK_F21, /* 199 */ - VK_F22, /* 200 */ - VK_F23, /* 201 */ - VK_F24, /* 202 */ - 0, /* 203 */ - 0, /* 204 */ - 0, /* 205 */ - VK_LWIN, /* 206 */ - 0, /* 207 */ - VK_PLAY, /* KEY_PLAYCD 208 */ - VK_PAUSE, /* KEY_PAUSECD 209 */ - 0, /* KEY_PROG3 210 */ - 0, /* KEY_PROG4 211 */ - 0, /* KEY_DASHBOARD 212 */ - 0, /* KEY_SUSPEND 213 */ - 0, /* KEY_CLOSE 214 */ - VK_PLAY, /* KEY_PLAY 215 */ - 0, /* KEY_FASTFORWARD 216 */ - 0, /* KEY_BASSBOOST 217 */ - VK_PRINT | KBDEXT, /* KEY_PRINT 218 */ - 0, /* KEY_HP 219 */ - 0, /* KEY_CAMERA 220 */ - 0, /* KEY_SOUND 221 */ - 0, /* KEY_QUESTION 222 */ - 0, /* KEY_EMAIL 223 */ - 0, /* KEY_CHAT 224 */ - VK_BROWSER_SEARCH | KBDEXT, /* KEY_SEARCH 225 */ - 0, /* KEY_CONNECT 226 */ - 0, /* KEY_FINANCE 227 */ - 0, /* KEY_SPORT 228 */ - 0, /* KEY_SHOP 229 */ - 0, /* KEY_ALTERASE 230 */ - 0, /* KEY_CANCEL 231 */ - 0, /* KEY_BRIGHTNESSDOWN 232 */ - 0, /* KEY_BRIGHTNESSUP 233 */ - 0, /* KEY_MEDIA 234 */ - 0, /* KEY_SWITCHVIDEOMODE 235 */ - 0, /* KEY_KBDILLUMTOGGLE 236 */ - 0, /* KEY_KBDILLUMDOWN 237 */ - 0, /* KEY_KBDILLUMUP 238 */ - 0, /* KEY_SEND 239 */ - 0, /* KEY_REPLY 240 */ - 0, /* KEY_FORWARDMAIL 241 */ - 0, /* KEY_SAVE 242 */ - 0, /* KEY_DOCUMENTS 243 */ - 0, /* KEY_BATTERY 244 */ - 0, /* KEY_BLUETOOTH 245 */ - 0, /* KEY_WLAN 246 */ - 0, /* KEY_UWB 247 */ - 0, /* KEY_UNKNOWN 248 */ - 0, /* KEY_VIDEO_NEXT 249 */ - 0, /* KEY_VIDEO_PREV 250 */ - 0, /* KEY_BRIGHTNESS_CYCLE 251 */ - 0, /* KEY_BRIGHTNESS_ZERO 252 */ - 0, /* KEY_DISPLAY_OFF 253 */ - 0, /* 254 */ - 0 /* 255 */ + 0, /* KEY_COMPUTER 165 */ + VK_BROWSER_BACK | KBDEXT, /* KEY_BACK 166 */ + VK_BROWSER_FORWARD | KBDEXT, /* KEY_FORWARD 167 */ + 0, /* KEY_CLOSECD 168 */ + 0, /* KEY_EJECTCD 169 */ + 0, /* KEY_EJECTCLOSECD 170 */ + VK_MEDIA_NEXT_TRACK | KBDEXT, /* KEY_NEXTSONG 171 */ + VK_MEDIA_PLAY_PAUSE | KBDEXT, /* KEY_PLAYPAUSE 172 */ + VK_MEDIA_PREV_TRACK | KBDEXT, /* KEY_PREVIOUSSONG 173 */ + VK_MEDIA_STOP | KBDEXT, /* KEY_STOPCD 174 */ + 0, /* KEY_RECORD 175 */ + 0, /* KEY_REWIND 176 */ + 0, /* KEY_PHONE 177 */ + 0, /* KEY_ISO 178 */ + 0, /* KEY_CONFIG 179 */ + VK_BROWSER_HOME | KBDEXT, /* KEY_HOMEPAGE 180 */ + VK_BROWSER_REFRESH | KBDEXT, /* KEY_REFRESH 181 */ + 0, /* KEY_EXIT 182 */ + 0, /* KEY_MOVE 183 */ + 0, /* KEY_EDIT 184 */ + 0, /* KEY_SCROLLUP 185 */ + 0, /* KEY_SCROLLDOWN 186 */ + 0, /* KEY_KPLEFTPAREN 187 */ + 0, /* KEY_KPRIGHTPAREN 188 */ + 0, /* KEY_NEW 189 */ + 0, /* KEY_REDO 190 */ + VK_F13, /* 191 */ + VK_F14, /* 192 */ + VK_F15, /* 193 */ + VK_F16, /* 194 */ + VK_F17, /* 195 */ + VK_F18, /* 196 */ + VK_F19, /* 197 */ + VK_F20, /* 198 */ + VK_F21, /* 199 */ + VK_F22, /* 200 */ + VK_F23, /* 201 */ + VK_F24, /* 202 */ + 0, /* 203 */ + 0, /* 204 */ + 0, /* 205 */ + VK_LWIN, /* 206 */ + 0, /* 207 */ + VK_PLAY, /* KEY_PLAYCD 208 */ + VK_PAUSE, /* KEY_PAUSECD 209 */ + 0, /* KEY_PROG3 210 */ + 0, /* KEY_PROG4 211 */ + 0, /* KEY_DASHBOARD 212 */ + 0, /* KEY_SUSPEND 213 */ + 0, /* KEY_CLOSE 214 */ + VK_PLAY, /* KEY_PLAY 215 */ + 0, /* KEY_FASTFORWARD 216 */ + 0, /* KEY_BASSBOOST 217 */ + VK_PRINT | KBDEXT, /* KEY_PRINT 218 */ + 0, /* KEY_HP 219 */ + 0, /* KEY_CAMERA 220 */ + 0, /* KEY_SOUND 221 */ + 0, /* KEY_QUESTION 222 */ + 0, /* KEY_EMAIL 223 */ + 0, /* KEY_CHAT 224 */ + VK_BROWSER_SEARCH | KBDEXT, /* KEY_SEARCH 225 */ + 0, /* KEY_CONNECT 226 */ + 0, /* KEY_FINANCE 227 */ + 0, /* KEY_SPORT 228 */ + 0, /* KEY_SHOP 229 */ + 0, /* KEY_ALTERASE 230 */ + 0, /* KEY_CANCEL 231 */ + 0, /* KEY_BRIGHTNESSDOWN 232 */ + 0, /* KEY_BRIGHTNESSUP 233 */ + 0, /* KEY_MEDIA 234 */ + 0, /* KEY_SWITCHVIDEOMODE 235 */ + 0, /* KEY_KBDILLUMTOGGLE 236 */ + 0, /* KEY_KBDILLUMDOWN 237 */ + 0, /* KEY_KBDILLUMUP 238 */ + 0, /* KEY_SEND 239 */ + 0, /* KEY_REPLY 240 */ + 0, /* KEY_FORWARDMAIL 241 */ + 0, /* KEY_SAVE 242 */ + 0, /* KEY_DOCUMENTS 243 */ + 0, /* KEY_BATTERY 244 */ + 0, /* KEY_BLUETOOTH 245 */ + 0, /* KEY_WLAN 246 */ + 0, /* KEY_UWB 247 */ + 0, /* KEY_UNKNOWN 248 */ + 0, /* KEY_VIDEO_NEXT 249 */ + 0, /* KEY_VIDEO_PREV 250 */ + 0, /* KEY_BRIGHTNESS_CYCLE 251 */ + 0, /* KEY_BRIGHTNESS_ZERO 252 */ + 0, /* KEY_DISPLAY_OFF 253 */ + 0, /* 254 */ + 0 /* 255 */ }; DWORD GetVirtualKeyCodeFromKeycode(DWORD keycode, DWORD dwFlags) diff --git a/winpr/libwinpr/input/scancode.c b/winpr/libwinpr/input/scancode.c index 578ed387e..9a3b8c781 100644 --- a/winpr/libwinpr/input/scancode.c +++ b/winpr/libwinpr/input/scancode.c @@ -33,536 +33,80 @@ * Keyboard Type 4 */ -static DWORD KBD4T[128] = -{ - KBD4_T00, - KBD4_T01, - KBD4_T02, - KBD4_T03, - KBD4_T04, - KBD4_T05, - KBD4_T06, - KBD4_T07, - KBD4_T08, - KBD4_T09, - KBD4_T0A, - KBD4_T0B, - KBD4_T0C, - KBD4_T0D, - KBD4_T0E, - KBD4_T0F, - KBD4_T10, - KBD4_T11, - KBD4_T12, - KBD4_T13, - KBD4_T14, - KBD4_T15, - KBD4_T16, - KBD4_T17, - KBD4_T18, - KBD4_T19, - KBD4_T1A, - KBD4_T1B, - KBD4_T1C, - KBD4_T1D, - KBD4_T1E, - KBD4_T1F, - KBD4_T20, - KBD4_T21, - KBD4_T22, - KBD4_T23, - KBD4_T24, - KBD4_T25, - KBD4_T26, - KBD4_T27, - KBD4_T28, - KBD4_T29, - KBD4_T2A, - KBD4_T2B, - KBD4_T2C, - KBD4_T2D, - KBD4_T2E, - KBD4_T2F, - KBD4_T30, - KBD4_T31, - KBD4_T32, - KBD4_T33, - KBD4_T34, - KBD4_T35, - KBD4_T36, - KBD4_T37, - KBD4_T38, - KBD4_T39, - KBD4_T3A, - KBD4_T3B, - KBD4_T3C, - KBD4_T3D, - KBD4_T3E, - KBD4_T3F, - KBD4_T40, - KBD4_T41, - KBD4_T42, - KBD4_T43, - KBD4_T44, - KBD4_T45, - KBD4_T46, - KBD4_T47, - KBD4_T48, - KBD4_T49, - KBD4_T4A, - KBD4_T4B, - KBD4_T4C, - KBD4_T4D, - KBD4_T4E, - KBD4_T4F, - KBD4_T50, - KBD4_T51, - KBD4_T52, - KBD4_T53, - KBD4_T54, - KBD4_T55, - KBD4_T56, - KBD4_T57, - KBD4_T58, - KBD4_T59, - KBD4_T5A, - KBD4_T5B, - KBD4_T5C, - KBD4_T5D, - KBD4_T5E, - KBD4_T5F, - KBD4_T60, - KBD4_T61, - KBD4_T62, - KBD4_T63, - KBD4_T64, - KBD4_T65, - KBD4_T66, - KBD4_T67, - KBD4_T68, - KBD4_T69, - KBD4_T6A, - KBD4_T6B, - KBD4_T6C, - KBD4_T6D, - KBD4_T6E, - KBD4_T6F, - KBD4_T70, - KBD4_T71, - KBD4_T72, - KBD4_T73, - KBD4_T74, - KBD4_T75, - KBD4_T76, - KBD4_T77, - KBD4_T78, - KBD4_T79, - KBD4_T7A, - KBD4_T7B, - KBD4_T7C, - KBD4_T7D, - KBD4_T7E, - KBD4_T7F +static DWORD KBD4T[128] = { + KBD4_T00, KBD4_T01, KBD4_T02, KBD4_T03, KBD4_T04, KBD4_T05, KBD4_T06, KBD4_T07, KBD4_T08, + KBD4_T09, KBD4_T0A, KBD4_T0B, KBD4_T0C, KBD4_T0D, KBD4_T0E, KBD4_T0F, KBD4_T10, KBD4_T11, + KBD4_T12, KBD4_T13, KBD4_T14, KBD4_T15, KBD4_T16, KBD4_T17, KBD4_T18, KBD4_T19, KBD4_T1A, + KBD4_T1B, KBD4_T1C, KBD4_T1D, KBD4_T1E, KBD4_T1F, KBD4_T20, KBD4_T21, KBD4_T22, KBD4_T23, + KBD4_T24, KBD4_T25, KBD4_T26, KBD4_T27, KBD4_T28, KBD4_T29, KBD4_T2A, KBD4_T2B, KBD4_T2C, + KBD4_T2D, KBD4_T2E, KBD4_T2F, KBD4_T30, KBD4_T31, KBD4_T32, KBD4_T33, KBD4_T34, KBD4_T35, + KBD4_T36, KBD4_T37, KBD4_T38, KBD4_T39, KBD4_T3A, KBD4_T3B, KBD4_T3C, KBD4_T3D, KBD4_T3E, + KBD4_T3F, KBD4_T40, KBD4_T41, KBD4_T42, KBD4_T43, KBD4_T44, KBD4_T45, KBD4_T46, KBD4_T47, + KBD4_T48, KBD4_T49, KBD4_T4A, KBD4_T4B, KBD4_T4C, KBD4_T4D, KBD4_T4E, KBD4_T4F, KBD4_T50, + KBD4_T51, KBD4_T52, KBD4_T53, KBD4_T54, KBD4_T55, KBD4_T56, KBD4_T57, KBD4_T58, KBD4_T59, + KBD4_T5A, KBD4_T5B, KBD4_T5C, KBD4_T5D, KBD4_T5E, KBD4_T5F, KBD4_T60, KBD4_T61, KBD4_T62, + KBD4_T63, KBD4_T64, KBD4_T65, KBD4_T66, KBD4_T67, KBD4_T68, KBD4_T69, KBD4_T6A, KBD4_T6B, + KBD4_T6C, KBD4_T6D, KBD4_T6E, KBD4_T6F, KBD4_T70, KBD4_T71, KBD4_T72, KBD4_T73, KBD4_T74, + KBD4_T75, KBD4_T76, KBD4_T77, KBD4_T78, KBD4_T79, KBD4_T7A, KBD4_T7B, KBD4_T7C, KBD4_T7D, + KBD4_T7E, KBD4_T7F }; -static DWORD KBD4X[128] = -{ - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - KBD4_X10, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - KBD4_X19, - VK_NONE, - VK_NONE, - KBD4_X1C, - KBD4_X1D, - VK_NONE, - VK_NONE, - KBD4_X20, - KBD4_X21, - KBD4_X22, - VK_NONE, - KBD4_X24, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - KBD4_X2E, - VK_NONE, - KBD4_X30, - VK_NONE, - KBD4_X32, - VK_NONE, - VK_NONE, - KBD4_X35, - VK_NONE, - KBD4_X37, - KBD4_X38, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - KBD4_X46, - KBD4_X47, - KBD4_X48, - KBD4_X49, - VK_NONE, - KBD4_X4B, - VK_NONE, - KBD4_X4D, - VK_NONE, - KBD4_X4F, - KBD4_X50, - KBD4_X51, - KBD4_X52, - KBD4_X53, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - KBD4_X5B, - KBD4_X5C, - KBD4_X5D, - KBD4_X5E, - KBD4_X5F, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - KBD4_X65, - KBD4_X66, - KBD4_X67, - KBD4_X68, - KBD4_X69, - KBD4_X6A, - KBD4_X6B, - KBD4_X6C, - KBD4_X6D, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, +static DWORD KBD4X[128] = { + VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, + VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, KBD4_X10, VK_NONE, + VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, KBD4_X19, VK_NONE, + VK_NONE, KBD4_X1C, KBD4_X1D, VK_NONE, VK_NONE, KBD4_X20, KBD4_X21, KBD4_X22, VK_NONE, + KBD4_X24, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, + VK_NONE, KBD4_X2E, VK_NONE, KBD4_X30, VK_NONE, KBD4_X32, VK_NONE, VK_NONE, KBD4_X35, + VK_NONE, KBD4_X37, KBD4_X38, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, + VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, KBD4_X46, KBD4_X47, + KBD4_X48, KBD4_X49, VK_NONE, KBD4_X4B, VK_NONE, KBD4_X4D, VK_NONE, KBD4_X4F, KBD4_X50, + KBD4_X51, KBD4_X52, KBD4_X53, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, + VK_NONE, KBD4_X5B, KBD4_X5C, KBD4_X5D, KBD4_X5E, KBD4_X5F, VK_NONE, VK_NONE, VK_NONE, + VK_NONE, VK_NONE, KBD4_X65, KBD4_X66, KBD4_X67, KBD4_X68, KBD4_X69, KBD4_X6A, KBD4_X6B, + KBD4_X6C, KBD4_X6D, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, + VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, + VK_NONE, VK_NONE, }; /** * Keyboard Type 7 */ -static DWORD KBD7T[128] = -{ - KBD7_T00, - KBD7_T01, - KBD7_T02, - KBD7_T03, - KBD7_T04, - KBD7_T05, - KBD7_T06, - KBD7_T07, - KBD7_T08, - KBD7_T09, - KBD7_T0A, - KBD7_T0B, - KBD7_T0C, - KBD7_T0D, - KBD7_T0E, - KBD7_T0F, - KBD7_T10, - KBD7_T11, - KBD7_T12, - KBD7_T13, - KBD7_T14, - KBD7_T15, - KBD7_T16, - KBD7_T17, - KBD7_T18, - KBD7_T19, - KBD7_T1A, - KBD7_T1B, - KBD7_T1C, - KBD7_T1D, - KBD7_T1E, - KBD7_T1F, - KBD7_T20, - KBD7_T21, - KBD7_T22, - KBD7_T23, - KBD7_T24, - KBD7_T25, - KBD7_T26, - KBD7_T27, - KBD7_T28, - KBD7_T29, - KBD7_T2A, - KBD7_T2B, - KBD7_T2C, - KBD7_T2D, - KBD7_T2E, - KBD7_T2F, - KBD7_T30, - KBD7_T31, - KBD7_T32, - KBD7_T33, - KBD7_T34, - KBD7_T35, - KBD7_T36, - KBD7_T37, - KBD7_T38, - KBD7_T39, - KBD7_T3A, - KBD7_T3B, - KBD7_T3C, - KBD7_T3D, - KBD7_T3E, - KBD7_T3F, - KBD7_T40, - KBD7_T41, - KBD7_T42, - KBD7_T43, - KBD7_T44, - KBD7_T45, - KBD7_T46, - KBD7_T47, - KBD7_T48, - KBD7_T49, - KBD7_T4A, - KBD7_T4B, - KBD7_T4C, - KBD7_T4D, - KBD7_T4E, - KBD7_T4F, - KBD7_T50, - KBD7_T51, - KBD7_T52, - KBD7_T53, - KBD7_T54, - KBD7_T55, - KBD7_T56, - KBD7_T57, - KBD7_T58, - KBD7_T59, - KBD7_T5A, - KBD7_T5B, - KBD7_T5C, - KBD7_T5D, - KBD7_T5E, - KBD7_T5F, - KBD7_T60, - KBD7_T61, - KBD7_T62, - KBD7_T63, - KBD7_T64, - KBD7_T65, - KBD7_T66, - KBD7_T67, - KBD7_T68, - KBD7_T69, - KBD7_T6A, - KBD7_T6B, - KBD7_T6C, - KBD7_T6D, - KBD7_T6E, - KBD7_T6F, - KBD7_T70, - KBD7_T71, - KBD7_T72, - KBD7_T73, - KBD7_T74, - KBD7_T75, - KBD7_T76, - KBD7_T77, - KBD7_T78, - KBD7_T79, - KBD7_T7A, - KBD7_T7B, - KBD7_T7C, - KBD7_T7D, - KBD7_T7E, - KBD7_T7F +static DWORD KBD7T[128] = { + KBD7_T00, KBD7_T01, KBD7_T02, KBD7_T03, KBD7_T04, KBD7_T05, KBD7_T06, KBD7_T07, KBD7_T08, + KBD7_T09, KBD7_T0A, KBD7_T0B, KBD7_T0C, KBD7_T0D, KBD7_T0E, KBD7_T0F, KBD7_T10, KBD7_T11, + KBD7_T12, KBD7_T13, KBD7_T14, KBD7_T15, KBD7_T16, KBD7_T17, KBD7_T18, KBD7_T19, KBD7_T1A, + KBD7_T1B, KBD7_T1C, KBD7_T1D, KBD7_T1E, KBD7_T1F, KBD7_T20, KBD7_T21, KBD7_T22, KBD7_T23, + KBD7_T24, KBD7_T25, KBD7_T26, KBD7_T27, KBD7_T28, KBD7_T29, KBD7_T2A, KBD7_T2B, KBD7_T2C, + KBD7_T2D, KBD7_T2E, KBD7_T2F, KBD7_T30, KBD7_T31, KBD7_T32, KBD7_T33, KBD7_T34, KBD7_T35, + KBD7_T36, KBD7_T37, KBD7_T38, KBD7_T39, KBD7_T3A, KBD7_T3B, KBD7_T3C, KBD7_T3D, KBD7_T3E, + KBD7_T3F, KBD7_T40, KBD7_T41, KBD7_T42, KBD7_T43, KBD7_T44, KBD7_T45, KBD7_T46, KBD7_T47, + KBD7_T48, KBD7_T49, KBD7_T4A, KBD7_T4B, KBD7_T4C, KBD7_T4D, KBD7_T4E, KBD7_T4F, KBD7_T50, + KBD7_T51, KBD7_T52, KBD7_T53, KBD7_T54, KBD7_T55, KBD7_T56, KBD7_T57, KBD7_T58, KBD7_T59, + KBD7_T5A, KBD7_T5B, KBD7_T5C, KBD7_T5D, KBD7_T5E, KBD7_T5F, KBD7_T60, KBD7_T61, KBD7_T62, + KBD7_T63, KBD7_T64, KBD7_T65, KBD7_T66, KBD7_T67, KBD7_T68, KBD7_T69, KBD7_T6A, KBD7_T6B, + KBD7_T6C, KBD7_T6D, KBD7_T6E, KBD7_T6F, KBD7_T70, KBD7_T71, KBD7_T72, KBD7_T73, KBD7_T74, + KBD7_T75, KBD7_T76, KBD7_T77, KBD7_T78, KBD7_T79, KBD7_T7A, KBD7_T7B, KBD7_T7C, KBD7_T7D, + KBD7_T7E, KBD7_T7F }; -static DWORD KBD7X[128] = -{ - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - KBD7_X10, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - KBD7_X19, - VK_NONE, - VK_NONE, - KBD7_X1C, - KBD7_X1D, - VK_NONE, - VK_NONE, - KBD7_X20, - KBD7_X21, - KBD7_X22, - VK_NONE, - KBD7_X24, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - KBD7_X2E, - VK_NONE, - KBD7_X30, - VK_NONE, - KBD7_X32, - KBD7_X33, - VK_NONE, - KBD7_X35, - VK_NONE, - KBD7_X37, - KBD7_X38, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - KBD7_X42, - KBD7_X43, - KBD7_X44, - VK_NONE, - KBD7_X46, - KBD7_X47, - KBD7_X48, - KBD7_X49, - VK_NONE, - KBD7_X4B, - VK_NONE, - KBD7_X4D, - VK_NONE, - KBD7_X4F, - KBD7_X50, - KBD7_X51, - KBD7_X52, - KBD7_X53, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - KBD7_X5B, - KBD7_X5C, - KBD7_X5D, - KBD7_X5E, - KBD7_X5F, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - KBD7_X65, - KBD7_X66, - KBD7_X67, - KBD7_X68, - KBD7_X69, - KBD7_X6A, - KBD7_X6B, - KBD7_X6C, - KBD7_X6D, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE, - VK_NONE +static DWORD KBD7X[128] = { + VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, + VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, KBD7_X10, VK_NONE, + VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, KBD7_X19, VK_NONE, + VK_NONE, KBD7_X1C, KBD7_X1D, VK_NONE, VK_NONE, KBD7_X20, KBD7_X21, KBD7_X22, VK_NONE, + KBD7_X24, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, + VK_NONE, KBD7_X2E, VK_NONE, KBD7_X30, VK_NONE, KBD7_X32, KBD7_X33, VK_NONE, KBD7_X35, + VK_NONE, KBD7_X37, KBD7_X38, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, + VK_NONE, VK_NONE, VK_NONE, KBD7_X42, KBD7_X43, KBD7_X44, VK_NONE, KBD7_X46, KBD7_X47, + KBD7_X48, KBD7_X49, VK_NONE, KBD7_X4B, VK_NONE, KBD7_X4D, VK_NONE, KBD7_X4F, KBD7_X50, + KBD7_X51, KBD7_X52, KBD7_X53, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, + VK_NONE, KBD7_X5B, KBD7_X5C, KBD7_X5D, KBD7_X5E, KBD7_X5F, VK_NONE, VK_NONE, VK_NONE, + VK_NONE, VK_NONE, KBD7_X65, KBD7_X66, KBD7_X67, KBD7_X68, KBD7_X69, KBD7_X6A, KBD7_X6B, + KBD7_X6C, KBD7_X6D, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, + VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, VK_NONE, + VK_NONE, VK_NONE }; DWORD GetVirtualKeyCodeFromVirtualScanCode(DWORD scancode, DWORD dwKeyboardType) diff --git a/winpr/libwinpr/input/virtualkey.c b/winpr/libwinpr/input/virtualkey.c index 94d20fd4c..9faead3ac 100644 --- a/winpr/libwinpr/input/virtualkey.c +++ b/winpr/libwinpr/input/virtualkey.c @@ -31,13 +31,12 @@ struct _VIRTUAL_KEY_CODE { - DWORD code; /* Windows Virtual Key Code */ + DWORD code; /* Windows Virtual Key Code */ const char* name; /* Virtual Key Code Name */ }; typedef struct _VIRTUAL_KEY_CODE VIRTUAL_KEY_CODE; -static const VIRTUAL_KEY_CODE VIRTUAL_KEY_CODE_TABLE[256] = -{ +static const VIRTUAL_KEY_CODE VIRTUAL_KEY_CODE_TABLE[256] = { { 0, NULL }, { VK_LBUTTON, "VK_LBUTTON" }, { VK_RBUTTON, "VK_RBUTTON" }, @@ -303,124 +302,123 @@ struct _XKB_KEYNAME }; typedef struct _XKB_KEYNAME XKB_KEYNAME; -XKB_KEYNAME XKB_KEYNAME_TABLE[] = -{ - { "BKSP", VK_BACK }, - { "TAB", VK_TAB }, - { "RTRN", VK_RETURN }, - { "LFSH", VK_LSHIFT }, - { "LALT", VK_LMENU }, - { "CAPS", VK_CAPITAL }, - { "ESC", VK_ESCAPE }, - { "SPCE", VK_SPACE }, - { "AE10", VK_KEY_0 }, - { "AE01", VK_KEY_1 }, - { "AE02", VK_KEY_2 }, - { "AE03", VK_KEY_3 }, - { "AE04", VK_KEY_4 }, - { "AE05", VK_KEY_5 }, - { "AE06", VK_KEY_6 }, - { "AE07", VK_KEY_7 }, - { "AE08", VK_KEY_8 }, - { "AE09", VK_KEY_9 }, - { "AC01", VK_KEY_A }, - { "AB05", VK_KEY_B }, - { "AB03", VK_KEY_C }, - { "AC03", VK_KEY_D }, - { "AD03", VK_KEY_E }, - { "AC04", VK_KEY_F }, - { "AC05", VK_KEY_G }, - { "AC06", VK_KEY_H }, - { "AD08", VK_KEY_I }, - { "AC07", VK_KEY_J }, - { "AC08", VK_KEY_K }, - { "AC09", VK_KEY_L }, - { "AB07", VK_KEY_M }, - { "AB06", VK_KEY_N }, - { "AD09", VK_KEY_O }, - { "AD10", VK_KEY_P }, - { "AD01", VK_KEY_Q }, - { "AD04", VK_KEY_R }, - { "AC02", VK_KEY_S }, - { "AD05", VK_KEY_T }, - { "AD07", VK_KEY_U }, - { "AB04", VK_KEY_V }, - { "AD02", VK_KEY_W }, - { "AB02", VK_KEY_X }, - { "AD06", VK_KEY_Y }, - { "AB01", VK_KEY_Z }, - { "KP0", VK_NUMPAD0 }, - { "KP1", VK_NUMPAD1 }, - { "KP2", VK_NUMPAD2 }, - { "KP3", VK_NUMPAD3 }, - { "KP4", VK_NUMPAD4 }, - { "KP5", VK_NUMPAD5 }, - { "KP6", VK_NUMPAD6 }, - { "KP7", VK_NUMPAD7 }, - { "KP8", VK_NUMPAD8 }, - { "KP9", VK_NUMPAD9 }, - { "KPMU", VK_MULTIPLY }, - { "KPAD", VK_ADD }, - { "KPSU", VK_SUBTRACT }, - { "KPDL", VK_DECIMAL }, - { "AB10", VK_OEM_2 }, - { "FK01", VK_F1 }, - { "FK02", VK_F2 }, - { "FK03", VK_F3 }, - { "FK04", VK_F4 }, - { "FK05", VK_F5 }, - { "FK06", VK_F6 }, - { "FK07", VK_F7 }, - { "FK08", VK_F8 }, - { "FK09", VK_F9 }, - { "FK10", VK_F10 }, - { "FK11", VK_F11 }, - { "FK12", VK_F12 }, - { "NMLK", VK_NUMLOCK }, - { "SCLK", VK_SCROLL }, - { "RTSH", VK_RSHIFT }, - { "LCTL", VK_LCONTROL }, - { "AC10", VK_OEM_1 }, - { "AE12", VK_OEM_PLUS }, - { "AB08", VK_OEM_COMMA }, - { "AE11", VK_OEM_MINUS }, - { "AB09", VK_OEM_PERIOD }, - { "TLDE", VK_OEM_3 }, - { "AB11", VK_ABNT_C1 }, - { "I129", VK_ABNT_C2 }, - { "AD11", VK_OEM_4 }, - { "BKSL", VK_OEM_5 }, - { "AD12", VK_OEM_6 }, - { "AC11", VK_OEM_7 }, - { "LSGT", VK_OEM_102 }, - { "KPEN", VK_RETURN | KBDEXT }, - { "PAUS", VK_PAUSE | KBDEXT }, - { "PGUP", VK_PRIOR | KBDEXT }, - { "PGDN", VK_NEXT | KBDEXT }, - { "END", VK_END | KBDEXT }, - { "HOME", VK_HOME | KBDEXT }, - { "LEFT", VK_LEFT | KBDEXT }, - { "UP", VK_UP | KBDEXT }, - { "RGHT", VK_RIGHT | KBDEXT }, - { "DOWN", VK_DOWN | KBDEXT }, - { "PRSC", VK_SNAPSHOT | KBDEXT }, - { "INS", VK_INSERT | KBDEXT }, - { "DELE", VK_DELETE | KBDEXT }, - { "LWIN", VK_LWIN | KBDEXT }, - { "RWIN", VK_RWIN | KBDEXT }, - { "COMP", VK_APPS | KBDEXT }, - { "KPDV", VK_DIVIDE | KBDEXT }, - { "RCTL", VK_RCONTROL | KBDEXT }, - { "RALT", VK_RMENU | KBDEXT }, +XKB_KEYNAME XKB_KEYNAME_TABLE[] = { + { "BKSP", VK_BACK }, + { "TAB", VK_TAB }, + { "RTRN", VK_RETURN }, + { "LFSH", VK_LSHIFT }, + { "LALT", VK_LMENU }, + { "CAPS", VK_CAPITAL }, + { "ESC", VK_ESCAPE }, + { "SPCE", VK_SPACE }, + { "AE10", VK_KEY_0 }, + { "AE01", VK_KEY_1 }, + { "AE02", VK_KEY_2 }, + { "AE03", VK_KEY_3 }, + { "AE04", VK_KEY_4 }, + { "AE05", VK_KEY_5 }, + { "AE06", VK_KEY_6 }, + { "AE07", VK_KEY_7 }, + { "AE08", VK_KEY_8 }, + { "AE09", VK_KEY_9 }, + { "AC01", VK_KEY_A }, + { "AB05", VK_KEY_B }, + { "AB03", VK_KEY_C }, + { "AC03", VK_KEY_D }, + { "AD03", VK_KEY_E }, + { "AC04", VK_KEY_F }, + { "AC05", VK_KEY_G }, + { "AC06", VK_KEY_H }, + { "AD08", VK_KEY_I }, + { "AC07", VK_KEY_J }, + { "AC08", VK_KEY_K }, + { "AC09", VK_KEY_L }, + { "AB07", VK_KEY_M }, + { "AB06", VK_KEY_N }, + { "AD09", VK_KEY_O }, + { "AD10", VK_KEY_P }, + { "AD01", VK_KEY_Q }, + { "AD04", VK_KEY_R }, + { "AC02", VK_KEY_S }, + { "AD05", VK_KEY_T }, + { "AD07", VK_KEY_U }, + { "AB04", VK_KEY_V }, + { "AD02", VK_KEY_W }, + { "AB02", VK_KEY_X }, + { "AD06", VK_KEY_Y }, + { "AB01", VK_KEY_Z }, + { "KP0", VK_NUMPAD0 }, + { "KP1", VK_NUMPAD1 }, + { "KP2", VK_NUMPAD2 }, + { "KP3", VK_NUMPAD3 }, + { "KP4", VK_NUMPAD4 }, + { "KP5", VK_NUMPAD5 }, + { "KP6", VK_NUMPAD6 }, + { "KP7", VK_NUMPAD7 }, + { "KP8", VK_NUMPAD8 }, + { "KP9", VK_NUMPAD9 }, + { "KPMU", VK_MULTIPLY }, + { "KPAD", VK_ADD }, + { "KPSU", VK_SUBTRACT }, + { "KPDL", VK_DECIMAL }, + { "AB10", VK_OEM_2 }, + { "FK01", VK_F1 }, + { "FK02", VK_F2 }, + { "FK03", VK_F3 }, + { "FK04", VK_F4 }, + { "FK05", VK_F5 }, + { "FK06", VK_F6 }, + { "FK07", VK_F7 }, + { "FK08", VK_F8 }, + { "FK09", VK_F9 }, + { "FK10", VK_F10 }, + { "FK11", VK_F11 }, + { "FK12", VK_F12 }, + { "NMLK", VK_NUMLOCK }, + { "SCLK", VK_SCROLL }, + { "RTSH", VK_RSHIFT }, + { "LCTL", VK_LCONTROL }, + { "AC10", VK_OEM_1 }, + { "AE12", VK_OEM_PLUS }, + { "AB08", VK_OEM_COMMA }, + { "AE11", VK_OEM_MINUS }, + { "AB09", VK_OEM_PERIOD }, + { "TLDE", VK_OEM_3 }, + { "AB11", VK_ABNT_C1 }, + { "I129", VK_ABNT_C2 }, + { "AD11", VK_OEM_4 }, + { "BKSL", VK_OEM_5 }, + { "AD12", VK_OEM_6 }, + { "AC11", VK_OEM_7 }, + { "LSGT", VK_OEM_102 }, + { "KPEN", VK_RETURN | KBDEXT }, + { "PAUS", VK_PAUSE | KBDEXT }, + { "PGUP", VK_PRIOR | KBDEXT }, + { "PGDN", VK_NEXT | KBDEXT }, + { "END", VK_END | KBDEXT }, + { "HOME", VK_HOME | KBDEXT }, + { "LEFT", VK_LEFT | KBDEXT }, + { "UP", VK_UP | KBDEXT }, + { "RGHT", VK_RIGHT | KBDEXT }, + { "DOWN", VK_DOWN | KBDEXT }, + { "PRSC", VK_SNAPSHOT | KBDEXT }, + { "INS", VK_INSERT | KBDEXT }, + { "DELE", VK_DELETE | KBDEXT }, + { "LWIN", VK_LWIN | KBDEXT }, + { "RWIN", VK_RWIN | KBDEXT }, + { "COMP", VK_APPS | KBDEXT }, + { "KPDV", VK_DIVIDE | KBDEXT }, + { "RCTL", VK_RCONTROL | KBDEXT }, + { "RALT", VK_RMENU | KBDEXT }, /* Japanese */ - { "HENK", VK_CONVERT }, - { "MUHE", VK_NONCONVERT }, - { "HKTG", VK_HKTG }, + { "HENK", VK_CONVERT }, + { "MUHE", VK_NONCONVERT }, + { "HKTG", VK_HKTG }, -// { "AE13", VK_BACKSLASH_JP }, // JP -// { "LVL3", 0x54} + // { "AE13", VK_BACKSLASH_JP }, // JP + // { "LVL3", 0x54} }; char* GetVirtualKeyName(DWORD vkcode) @@ -428,7 +426,7 @@ char* GetVirtualKeyName(DWORD vkcode) char* vkname = NULL; if (vkcode < ARRAYSIZE(VIRTUAL_KEY_CODE_TABLE)) - vkname = (char*) VIRTUAL_KEY_CODE_TABLE[vkcode].name; + vkname = (char*)VIRTUAL_KEY_CODE_TABLE[vkcode].name; if (!vkname) vkname = "VK_NONE"; diff --git a/winpr/libwinpr/interlocked/interlocked.c b/winpr/libwinpr/interlocked/interlocked.c index 77f6df235..b6bd102fd 100644 --- a/winpr/libwinpr/interlocked/interlocked.c +++ b/winpr/libwinpr/interlocked/interlocked.c @@ -44,31 +44,34 @@ VOID InitializeSListHead(WINPR_PSLIST_HEADER ListHead) #endif } -WINPR_PSLIST_ENTRY InterlockedPushEntrySList(WINPR_PSLIST_HEADER ListHead, WINPR_PSLIST_ENTRY ListEntry) +WINPR_PSLIST_ENTRY InterlockedPushEntrySList(WINPR_PSLIST_HEADER ListHead, + WINPR_PSLIST_ENTRY ListEntry) { - WINPR_SLIST_HEADER old; - WINPR_SLIST_HEADER newHeader; + WINPR_SLIST_HEADER old; + WINPR_SLIST_HEADER newHeader; #ifdef _WIN64 - newHeader.HeaderX64.NextEntry = (((ULONG_PTR) ListEntry) >> 4); + newHeader.HeaderX64.NextEntry = (((ULONG_PTR)ListEntry) >> 4); while (1) { old = *ListHead; - ListEntry->Next = (PSLIST_ENTRY) (((ULONG_PTR) old.HeaderX64.NextEntry) << 4); + ListEntry->Next = (PSLIST_ENTRY)(((ULONG_PTR)old.HeaderX64.NextEntry) << 4); newHeader.HeaderX64.Depth = old.HeaderX64.Depth + 1; newHeader.HeaderX64.Sequence = old.HeaderX64.Sequence + 1; - if (InterlockedCompareExchange64((LONGLONG*) ListHead, newHeader.s.Alignment, old.s.Alignment)) + if (InterlockedCompareExchange64((LONGLONG*)ListHead, newHeader.s.Alignment, + old.s.Alignment)) { - InterlockedCompareExchange64(&((LONGLONG*) ListHead)[1], newHeader.s.Region, old.s.Region); + InterlockedCompareExchange64(&((LONGLONG*)ListHead)[1], newHeader.s.Region, + old.s.Region); break; } } - return (PSLIST_ENTRY) ((ULONG_PTR) old.HeaderX64.NextEntry << 4); + return (PSLIST_ENTRY)((ULONG_PTR)old.HeaderX64.NextEntry << 4); #else newHeader.s.Next.Next = ListEntry; @@ -84,14 +87,16 @@ WINPR_PSLIST_ENTRY InterlockedPushEntrySList(WINPR_PSLIST_HEADER ListHead, WINPR return NULL; if (ListHead->Alignment > INT64_MAX) return NULL; - } - while(InterlockedCompareExchange64((LONGLONG*) &ListHead->Alignment, (LONGLONG)newHeader.Alignment, (LONGLONG)old.Alignment) != (LONGLONG)old.Alignment); + } while (InterlockedCompareExchange64((LONGLONG*)&ListHead->Alignment, + (LONGLONG)newHeader.Alignment, + (LONGLONG)old.Alignment) != (LONGLONG)old.Alignment); return old.s.Next.Next; #endif } -WINPR_PSLIST_ENTRY InterlockedPushListSListEx(WINPR_PSLIST_HEADER ListHead, WINPR_PSLIST_ENTRY List, WINPR_PSLIST_ENTRY ListEnd, ULONG Count) +WINPR_PSLIST_ENTRY InterlockedPushListSListEx(WINPR_PSLIST_HEADER ListHead, WINPR_PSLIST_ENTRY List, + WINPR_PSLIST_ENTRY ListEnd, ULONG Count) { #ifdef _WIN64 @@ -103,27 +108,29 @@ WINPR_PSLIST_ENTRY InterlockedPushListSListEx(WINPR_PSLIST_HEADER ListHead, WINP WINPR_PSLIST_ENTRY InterlockedPopEntrySList(WINPR_PSLIST_HEADER ListHead) { - WINPR_SLIST_HEADER old; - WINPR_SLIST_HEADER newHeader; - WINPR_PSLIST_ENTRY entry; + WINPR_SLIST_HEADER old; + WINPR_SLIST_HEADER newHeader; + WINPR_PSLIST_ENTRY entry; #ifdef _WIN64 while (1) { old = *ListHead; - entry = (PSLIST_ENTRY) (((ULONG_PTR) old.HeaderX64.NextEntry) << 4); + entry = (PSLIST_ENTRY)(((ULONG_PTR)old.HeaderX64.NextEntry) << 4); if (!entry) return NULL; - newHeader.HeaderX64.NextEntry = ((ULONG_PTR) entry->Next) >> 4; + newHeader.HeaderX64.NextEntry = ((ULONG_PTR)entry->Next) >> 4; newHeader.HeaderX64.Depth = old.HeaderX64.Depth - 1; newHeader.HeaderX64.Sequence = old.HeaderX64.Sequence - 1; - if (InterlockedCompareExchange64((LONGLONG*) ListHead, newHeader.s.Alignment, old.s.Alignment)) + if (InterlockedCompareExchange64((LONGLONG*)ListHead, newHeader.s.Alignment, + old.s.Alignment)) { - InterlockedCompareExchange64(&((LONGLONG*) ListHead)[1], newHeader.s.Region, old.s.Region); + InterlockedCompareExchange64(&((LONGLONG*)ListHead)[1], newHeader.s.Region, + old.s.Region); break; } } @@ -147,16 +154,17 @@ WINPR_PSLIST_ENTRY InterlockedPopEntrySList(WINPR_PSLIST_HEADER ListHead) return NULL; if (ListHead->Alignment > INT64_MAX) return NULL; - } - while(InterlockedCompareExchange64((LONGLONG*) &ListHead->Alignment, (LONGLONG)newHeader.Alignment, (LONGLONG)old.Alignment) != (LONGLONG)old.Alignment); + } while (InterlockedCompareExchange64((LONGLONG*)&ListHead->Alignment, + (LONGLONG)newHeader.Alignment, + (LONGLONG)old.Alignment) != (LONGLONG)old.Alignment); #endif return entry; } WINPR_PSLIST_ENTRY InterlockedFlushSList(WINPR_PSLIST_HEADER ListHead) { - WINPR_SLIST_HEADER old; - WINPR_SLIST_HEADER newHeader; + WINPR_SLIST_HEADER old; + WINPR_SLIST_HEADER newHeader; if (!QueryDepthSList(ListHead)) return NULL; @@ -171,14 +179,16 @@ WINPR_PSLIST_ENTRY InterlockedFlushSList(WINPR_PSLIST_HEADER ListHead) old = *ListHead; newHeader.HeaderX64.Sequence = old.HeaderX64.Sequence + 1; - if (InterlockedCompareExchange64((LONGLONG*) ListHead, newHeader.s.Alignment, old.s.Alignment)) + if (InterlockedCompareExchange64((LONGLONG*)ListHead, newHeader.s.Alignment, + old.s.Alignment)) { - InterlockedCompareExchange64(&((LONGLONG*) ListHead)[1], newHeader.s.Region, old.s.Region); + InterlockedCompareExchange64(&((LONGLONG*)ListHead)[1], newHeader.s.Region, + old.s.Region); break; } } - return (PSLIST_ENTRY) (((ULONG_PTR) old.HeaderX64.NextEntry) << 4); + return (PSLIST_ENTRY)(((ULONG_PTR)old.HeaderX64.NextEntry) << 4); #else newHeader.Alignment = 0; @@ -193,8 +203,9 @@ WINPR_PSLIST_ENTRY InterlockedFlushSList(WINPR_PSLIST_HEADER ListHead) return NULL; if (ListHead->Alignment > INT64_MAX) return NULL; - } - while(InterlockedCompareExchange64((LONGLONG*) &ListHead->Alignment, (LONGLONG)newHeader.Alignment, (LONGLONG)old.Alignment) != (LONGLONG)old.Alignment); + } while (InterlockedCompareExchange64((LONGLONG*)&ListHead->Alignment, + (LONGLONG)newHeader.Alignment, + (LONGLONG)old.Alignment) != (LONGLONG)old.Alignment); return old.s.Next.Next; #endif @@ -209,7 +220,7 @@ USHORT QueryDepthSList(WINPR_PSLIST_HEADER ListHead) #endif } -LONG InterlockedIncrement(LONG volatile *Addend) +LONG InterlockedIncrement(LONG volatile* Addend) { #ifdef __GNUC__ return __sync_add_and_fetch(Addend, 1); @@ -218,7 +229,7 @@ LONG InterlockedIncrement(LONG volatile *Addend) #endif } -LONG InterlockedDecrement(LONG volatile *Addend) +LONG InterlockedDecrement(LONG volatile* Addend) { #ifdef __GNUC__ return __sync_sub_and_fetch(Addend, 1); @@ -227,7 +238,7 @@ LONG InterlockedDecrement(LONG volatile *Addend) #endif } -LONG InterlockedExchange(LONG volatile *Target, LONG Value) +LONG InterlockedExchange(LONG volatile* Target, LONG Value) { #ifdef __GNUC__ return __sync_val_compare_and_swap(Target, *Target, Value); @@ -236,7 +247,7 @@ LONG InterlockedExchange(LONG volatile *Target, LONG Value) #endif } -LONG InterlockedExchangeAdd(LONG volatile *Addend, LONG Value) +LONG InterlockedExchangeAdd(LONG volatile* Addend, LONG Value) { #ifdef __GNUC__ return __sync_fetch_and_add(Addend, Value); @@ -245,7 +256,7 @@ LONG InterlockedExchangeAdd(LONG volatile *Addend, LONG Value) #endif } -LONG InterlockedCompareExchange(LONG volatile *Destination, LONG Exchange, LONG Comperand) +LONG InterlockedCompareExchange(LONG volatile* Destination, LONG Exchange, LONG Comperand) { #ifdef __GNUC__ return __sync_val_compare_and_swap(Destination, Comperand, Exchange); @@ -254,7 +265,8 @@ LONG InterlockedCompareExchange(LONG volatile *Destination, LONG Exchange, LONG #endif } -PVOID InterlockedCompareExchangePointer(PVOID volatile *Destination, PVOID Exchange, PVOID Comperand) +PVOID InterlockedCompareExchangePointer(PVOID volatile* Destination, PVOID Exchange, + PVOID Comperand) { #ifdef __GNUC__ return __sync_val_compare_and_swap(Destination, Comperand, Exchange); @@ -282,14 +294,15 @@ BOOL static_mutex_lock(volatile HANDLE* static_mutex) if (!(handle = CreateMutex(NULL, FALSE, NULL))) return FALSE; - if (InterlockedCompareExchangePointer((PVOID*) static_mutex, (PVOID) handle, NULL) != NULL) + if (InterlockedCompareExchangePointer((PVOID*)static_mutex, (PVOID)handle, NULL) != NULL) CloseHandle(handle); } return (WaitForSingleObject(*static_mutex, INFINITE) == WAIT_OBJECT_0); } -LONGLONG InterlockedCompareExchange64(LONGLONG volatile *Destination, LONGLONG Exchange, LONGLONG Comperand) +LONGLONG InterlockedCompareExchange64(LONGLONG volatile* Destination, LONGLONG Exchange, + LONGLONG Comperand) { LONGLONG previousValue = 0; BOOL locked = static_mutex_lock(&mutex); @@ -307,13 +320,15 @@ LONGLONG InterlockedCompareExchange64(LONGLONG volatile *Destination, LONGLONG E return previousValue; } -#elif (defined(ANDROID) && ANDROID) || (defined(__GNUC__) && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)) +#elif (defined(ANDROID) && ANDROID) || \ + (defined(__GNUC__) && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)) #include static pthread_mutex_t mutex; -LONGLONG InterlockedCompareExchange64(LONGLONG volatile *Destination, LONGLONG Exchange, LONGLONG Comperand) +LONGLONG InterlockedCompareExchange64(LONGLONG volatile* Destination, LONGLONG Exchange, + LONGLONG Comperand) { LONGLONG previousValue = 0; @@ -331,7 +346,8 @@ LONGLONG InterlockedCompareExchange64(LONGLONG volatile *Destination, LONGLONG E #else -LONGLONG InterlockedCompareExchange64(LONGLONG volatile *Destination, LONGLONG Exchange, LONGLONG Comperand) +LONGLONG InterlockedCompareExchange64(LONGLONG volatile* Destination, LONGLONG Exchange, + LONGLONG Comperand) { #ifdef __GNUC__ return __sync_val_compare_and_swap(Destination, Comperand, Exchange); @@ -359,25 +375,25 @@ VOID InitializeListHead(WINPR_PLIST_ENTRY ListHead) BOOL IsListEmpty(const WINPR_LIST_ENTRY* ListHead) { - return (BOOL) (ListHead->Flink == ListHead); + return (BOOL)(ListHead->Flink == ListHead); } BOOL RemoveEntryList(WINPR_PLIST_ENTRY Entry) { - WINPR_PLIST_ENTRY OldFlink; - WINPR_PLIST_ENTRY OldBlink; + WINPR_PLIST_ENTRY OldFlink; + WINPR_PLIST_ENTRY OldBlink; OldFlink = Entry->Flink; OldBlink = Entry->Blink; OldFlink->Blink = OldBlink; OldBlink->Flink = OldFlink; - return (BOOL) (OldFlink == OldBlink); + return (BOOL)(OldFlink == OldBlink); } VOID InsertHeadList(WINPR_PLIST_ENTRY ListHead, WINPR_PLIST_ENTRY Entry) { - WINPR_PLIST_ENTRY OldFlink; + WINPR_PLIST_ENTRY OldFlink; OldFlink = ListHead->Flink; Entry->Flink = OldFlink; @@ -388,8 +404,8 @@ VOID InsertHeadList(WINPR_PLIST_ENTRY ListHead, WINPR_PLIST_ENTRY Entry) WINPR_PLIST_ENTRY RemoveHeadList(WINPR_PLIST_ENTRY ListHead) { - WINPR_PLIST_ENTRY Flink; - WINPR_PLIST_ENTRY Entry; + WINPR_PLIST_ENTRY Flink; + WINPR_PLIST_ENTRY Entry; Entry = ListHead->Flink; Flink = Entry->Flink; @@ -401,7 +417,7 @@ WINPR_PLIST_ENTRY RemoveHeadList(WINPR_PLIST_ENTRY ListHead) VOID InsertTailList(WINPR_PLIST_ENTRY ListHead, WINPR_PLIST_ENTRY Entry) { - WINPR_PLIST_ENTRY OldBlink; + WINPR_PLIST_ENTRY OldBlink; OldBlink = ListHead->Blink; Entry->Flink = ListHead; @@ -412,8 +428,8 @@ VOID InsertTailList(WINPR_PLIST_ENTRY ListHead, WINPR_PLIST_ENTRY Entry) WINPR_PLIST_ENTRY RemoveTailList(WINPR_PLIST_ENTRY ListHead) { - WINPR_PLIST_ENTRY Blink; - WINPR_PLIST_ENTRY Entry; + WINPR_PLIST_ENTRY Blink; + WINPR_PLIST_ENTRY Entry; Entry = ListHead->Blink; Blink = Entry->Blink; @@ -425,7 +441,7 @@ WINPR_PLIST_ENTRY RemoveTailList(WINPR_PLIST_ENTRY ListHead) VOID AppendTailList(WINPR_PLIST_ENTRY ListHead, WINPR_PLIST_ENTRY ListToAppend) { - WINPR_PLIST_ENTRY ListEnd = ListHead->Blink; + WINPR_PLIST_ENTRY ListEnd = ListHead->Blink; ListHead->Blink->Flink = ListToAppend; ListHead->Blink = ListToAppend->Blink; @@ -441,7 +457,7 @@ VOID PushEntryList(WINPR_PSINGLE_LIST_ENTRY ListHead, WINPR_PSINGLE_LIST_ENTRY E WINPR_PSINGLE_LIST_ENTRY PopEntryList(WINPR_PSINGLE_LIST_ENTRY ListHead) { - WINPR_PSINGLE_LIST_ENTRY FirstEntry; + WINPR_PSINGLE_LIST_ENTRY FirstEntry; FirstEntry = ListHead->Next; @@ -450,4 +466,3 @@ WINPR_PSINGLE_LIST_ENTRY PopEntryList(WINPR_PSINGLE_LIST_ENTRY ListHead) return FirstEntry; } - diff --git a/winpr/libwinpr/interlocked/test/TestInterlockedAccess.c b/winpr/libwinpr/interlocked/test/TestInterlockedAccess.c index a6ba1ecfc..626d90aae 100644 --- a/winpr/libwinpr/interlocked/test/TestInterlockedAccess.c +++ b/winpr/libwinpr/interlocked/test/TestInterlockedAccess.c @@ -24,23 +24,23 @@ int TestInterlockedAccess(int argc, char* argv[]) *Addend = 0; - for (index = 0; index < 10; index ++) + for (index = 0; index < 10; index++) InterlockedIncrement(Addend); if (*Addend != 10) { - printf("InterlockedIncrement failure: Actual: %"PRId32", Expected: 10\n", *Addend); + printf("InterlockedIncrement failure: Actual: %" PRId32 ", Expected: 10\n", *Addend); return -1; } /* InterlockedDecrement */ - for (index = 0; index < 10; index ++) + for (index = 0; index < 10; index++) InterlockedDecrement(Addend); if (*Addend != 0) { - printf("InterlockedDecrement failure: Actual: %"PRId32", Expected: 0\n", *Addend); + printf("InterlockedDecrement failure: Actual: %" PRId32 ", Expected: 0\n", *Addend); return -1; } @@ -60,13 +60,13 @@ int TestInterlockedAccess(int argc, char* argv[]) if (oldValue != 0xAA) { - printf("InterlockedExchange failure: Actual: 0x%08"PRIX32", Expected: 0xAA\n", oldValue); + printf("InterlockedExchange failure: Actual: 0x%08" PRIX32 ", Expected: 0xAA\n", oldValue); return -1; } if (*Target != 0xFF) { - printf("InterlockedExchange failure: Actual: 0x%08"PRIX32", Expected: 0xFF\n", *Target); + printf("InterlockedExchange failure: Actual: 0x%08" PRIX32 ", Expected: 0xFF\n", *Target); return -1; } @@ -78,13 +78,13 @@ int TestInterlockedAccess(int argc, char* argv[]) if (oldValue != 25) { - printf("InterlockedExchangeAdd failure: Actual: %"PRId32", Expected: 25\n", oldValue); + printf("InterlockedExchangeAdd failure: Actual: %" PRId32 ", Expected: 25\n", oldValue); return -1; } if (*Addend != 125) { - printf("InterlockedExchangeAdd failure: Actual: %"PRId32", Expected: 125\n", *Addend); + printf("InterlockedExchangeAdd failure: Actual: %" PRId32 ", Expected: 125\n", *Addend); return -1; } @@ -103,13 +103,17 @@ int TestInterlockedAccess(int argc, char* argv[]) if (oldValue != (LONG)0xAABBCCDDL) { - printf("InterlockedCompareExchange failure: Actual: 0x%08"PRIX32", Expected: 0xAABBCCDD\n", oldValue); + printf("InterlockedCompareExchange failure: Actual: 0x%08" PRIX32 + ", Expected: 0xAABBCCDD\n", + oldValue); return -1; } if ((*Destination) != (LONG)0xCCDDEEFFL) { - printf("InterlockedCompareExchange failure: Actual: 0x%08"PRIX32", Expected: 0xCCDDEEFF\n", *Destination); + printf("InterlockedCompareExchange failure: Actual: 0x%08" PRIX32 + ", Expected: 0xCCDDEEFF\n", + *Destination); return -1; } @@ -121,13 +125,17 @@ int TestInterlockedAccess(int argc, char* argv[]) if (oldValue != (LONG)0xAABBCCDDL) { - printf("InterlockedCompareExchange failure: Actual: 0x%08"PRIX32", Expected: 0xAABBCCDD\n", oldValue); + printf("InterlockedCompareExchange failure: Actual: 0x%08" PRIX32 + ", Expected: 0xAABBCCDD\n", + oldValue); return -1; } if ((*Destination) != (LONG)0xAABBCCDDL) { - printf("InterlockedCompareExchange failure: Actual: 0x%08"PRIX32", Expected: 0xAABBCCDD\n", *Destination); + printf("InterlockedCompareExchange failure: Actual: 0x%08" PRIX32 + ", Expected: 0xAABBCCDD\n", + *Destination); return -1; } @@ -142,17 +150,22 @@ int TestInterlockedAccess(int argc, char* argv[]) *Destination64 = 0x66778899AABBCCDD; - oldValue64 = InterlockedCompareExchange64(Destination64, 0x8899AABBCCDDEEFF, 0x66778899AABBCCDD); + oldValue64 = + InterlockedCompareExchange64(Destination64, 0x8899AABBCCDDEEFF, 0x66778899AABBCCDD); if (oldValue64 != 0x66778899AABBCCDD) { - printf("InterlockedCompareExchange failure: Actual: 0x%016"PRIX64", Expected: 0x66778899AABBCCDD\n", oldValue64); + printf("InterlockedCompareExchange failure: Actual: 0x%016" PRIX64 + ", Expected: 0x66778899AABBCCDD\n", + oldValue64); return -1; } if ((*Destination64) != (LONGLONG)0x8899AABBCCDDEEFFLL) { - printf("InterlockedCompareExchange failure: Actual: 0x%016"PRIX64", Expected: 0x8899AABBCCDDEEFF\n", *Destination64); + printf("InterlockedCompareExchange failure: Actual: 0x%016" PRIX64 + ", Expected: 0x8899AABBCCDDEEFF\n", + *Destination64); return -1; } @@ -164,13 +177,17 @@ int TestInterlockedAccess(int argc, char* argv[]) if (oldValue64 != 0x66778899AABBCCDDLL) { - printf("InterlockedCompareExchange failure: Actual: 0x%016"PRIX64", Expected: 0x66778899AABBCCDD\n", oldValue64); + printf("InterlockedCompareExchange failure: Actual: 0x%016" PRIX64 + ", Expected: 0x66778899AABBCCDD\n", + oldValue64); return -1; } if (*Destination64 != 0x66778899AABBCCDDLL) { - printf("InterlockedCompareExchange failure: Actual: 0x%016"PRIX64", Expected: 0x66778899AABBCCDD\n", *Destination64); + printf("InterlockedCompareExchange failure: Actual: 0x%016" PRIX64 + ", Expected: 0x66778899AABBCCDD\n", + *Destination64); return -1; } diff --git a/winpr/libwinpr/interlocked/test/TestInterlockedDList.c b/winpr/libwinpr/interlocked/test/TestInterlockedDList.c index 358a12c5d..12f1ef9c2 100644 --- a/winpr/libwinpr/interlocked/test/TestInterlockedDList.c +++ b/winpr/libwinpr/interlocked/test/TestInterlockedDList.c @@ -17,7 +17,8 @@ int TestInterlockedDList(int argc, char* argv[]) WINPR_PLIST_ENTRY pListHead; WINPR_PLIST_ENTRY pListEntry; - pListHead = (WINPR_PLIST_ENTRY) _aligned_malloc(sizeof(WINPR_LIST_ENTRY), MEMORY_ALLOCATION_ALIGNMENT); + pListHead = + (WINPR_PLIST_ENTRY)_aligned_malloc(sizeof(WINPR_LIST_ENTRY), MEMORY_ALLOCATION_ALIGNMENT); if (!pListHead) { @@ -39,7 +40,7 @@ int TestInterlockedDList(int argc, char* argv[]) for (Count = 1; Count <= 10; Count += 1) { - pListItem = (PLIST_ITEM) _aligned_malloc(sizeof(LIST_ITEM), MEMORY_ALLOCATION_ALIGNMENT); + pListItem = (PLIST_ITEM)_aligned_malloc(sizeof(LIST_ITEM), MEMORY_ALLOCATION_ALIGNMENT); pListItem->Signature = Count; InsertHeadList(pListHead, &(pListItem->ItemEntry)); } @@ -47,7 +48,7 @@ int TestInterlockedDList(int argc, char* argv[]) for (Count = 10; Count >= 1; Count -= 1) { pListEntry = RemoveHeadList(pListHead); - pListItem = (PLIST_ITEM) pListEntry; + pListItem = (PLIST_ITEM)pListEntry; _aligned_free(pListItem); } @@ -57,7 +58,7 @@ int TestInterlockedDList(int argc, char* argv[]) for (Count = 1; Count <= 10; Count += 1) { - pListItem = (PLIST_ITEM) _aligned_malloc(sizeof(LIST_ITEM), MEMORY_ALLOCATION_ALIGNMENT); + pListItem = (PLIST_ITEM)_aligned_malloc(sizeof(LIST_ITEM), MEMORY_ALLOCATION_ALIGNMENT); pListItem->Signature = Count; InsertTailList(pListHead, &(pListItem->ItemEntry)); } @@ -65,7 +66,7 @@ int TestInterlockedDList(int argc, char* argv[]) for (Count = 10; Count >= 1; Count -= 1) { pListEntry = RemoveTailList(pListHead); - pListItem = (PLIST_ITEM) pListEntry; + pListItem = (PLIST_ITEM)pListEntry; _aligned_free(pListItem); } @@ -73,4 +74,3 @@ int TestInterlockedDList(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/interlocked/test/TestInterlockedSList.c b/winpr/libwinpr/interlocked/test/TestInterlockedSList.c index 06671e88b..e2c255307 100644 --- a/winpr/libwinpr/interlocked/test/TestInterlockedSList.c +++ b/winpr/libwinpr/interlocked/test/TestInterlockedSList.c @@ -6,7 +6,7 @@ typedef struct _PROGRAM_ITEM { - WINPR_SLIST_ENTRY ItemEntry; + WINPR_SLIST_ENTRY ItemEntry; ULONG Signature; } PROGRAM_ITEM, *PPROGRAM_ITEM; @@ -17,7 +17,8 @@ int TestInterlockedSList(int argc, char* argv[]) WINPR_PSLIST_HEADER pListHead; /* Initialize the list header to a MEMORY_ALLOCATION_ALIGNMENT boundary. */ - pListHead = (WINPR_PSLIST_HEADER) _aligned_malloc(sizeof(WINPR_SLIST_HEADER), MEMORY_ALLOCATION_ALIGNMENT); + pListHead = (WINPR_PSLIST_HEADER)_aligned_malloc(sizeof(WINPR_SLIST_HEADER), + MEMORY_ALLOCATION_ALIGNMENT); if (!pListHead) { @@ -30,7 +31,8 @@ int TestInterlockedSList(int argc, char* argv[]) /* Insert 10 items into the list. */ for (Count = 1; Count <= 10; Count += 1) { - PPROGRAM_ITEM pProgramItem = (PPROGRAM_ITEM) _aligned_malloc(sizeof(PROGRAM_ITEM), MEMORY_ALLOCATION_ALIGNMENT); + PPROGRAM_ITEM pProgramItem = + (PPROGRAM_ITEM)_aligned_malloc(sizeof(PROGRAM_ITEM), MEMORY_ALLOCATION_ALIGNMENT); if (!pProgramItem) { @@ -54,8 +56,8 @@ int TestInterlockedSList(int argc, char* argv[]) return -1; } - pProgramItem = (PPROGRAM_ITEM) pListEntry; - printf("Signature is %"PRIu32"\n", pProgramItem->Signature); + pProgramItem = (PPROGRAM_ITEM)pListEntry; + printf("Signature is %" PRIu32 "\n", pProgramItem->Signature); /* * This example assumes that the SLIST_ENTRY structure is the diff --git a/winpr/libwinpr/io/device.c b/winpr/libwinpr/io/device.c index 5177d514c..b1ac27b76 100644 --- a/winpr/libwinpr/io/device.c +++ b/winpr/libwinpr/io/device.c @@ -62,7 +62,7 @@ * http://www.codeproject.com/Articles/9504/Driver-Development-Part-1-Introduction-to-Drivers/ */ -#define DEVICE_FILE_PREFIX_PATH "\\Device\\" +#define DEVICE_FILE_PREFIX_PATH "\\Device\\" char* GetDeviceFileNameWithoutPrefixA(LPCSTR lpName) { @@ -74,7 +74,8 @@ char* GetDeviceFileNameWithoutPrefixA(LPCSTR lpName) if (strncmp(lpName, DEVICE_FILE_PREFIX_PATH, sizeof(DEVICE_FILE_PREFIX_PATH) - 1) != 0) return NULL; - lpFileName = _strdup(&lpName[strnlen(DEVICE_FILE_PREFIX_PATH, sizeof (DEVICE_FILE_PREFIX_PATH))]); + lpFileName = + _strdup(&lpName[strnlen(DEVICE_FILE_PREFIX_PATH, sizeof(DEVICE_FILE_PREFIX_PATH))]); return lpFileName; } @@ -110,7 +111,7 @@ char* GetDeviceFileUnixDomainSocketFilePathA(LPCSTR lpName) return NULL; } - lpFilePath = GetCombinedPath(lpPipePath, (char*) lpFileName); + lpFilePath = GetCombinedPath(lpPipePath, (char*)lpFileName); free(lpPipePath); free(lpFileName); return lpFilePath; @@ -122,8 +123,8 @@ char* GetDeviceFileUnixDomainSocketFilePathA(LPCSTR lpName) */ NTSTATUS _IoCreateDeviceEx(PDRIVER_OBJECT_EX DriverObject, ULONG DeviceExtensionSize, - PUNICODE_STRING DeviceName, - DEVICE_TYPE DeviceType, ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PUNICODE_STRING DeviceName, DEVICE_TYPE DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, PDEVICE_OBJECT_EX* DeviceObject) { int status; @@ -144,7 +145,7 @@ NTSTATUS _IoCreateDeviceEx(PDRIVER_OBJECT_EX DriverObject, ULONG DeviceExtension } free(DeviceBasePath); - pDeviceObjectEx = (DEVICE_OBJECT_EX*) calloc(1, sizeof(DEVICE_OBJECT_EX)); + pDeviceObjectEx = (DEVICE_OBJECT_EX*)calloc(1, sizeof(DEVICE_OBJECT_EX)); if (!pDeviceObjectEx) return STATUS_NO_MEMORY; @@ -158,8 +159,8 @@ NTSTATUS _IoCreateDeviceEx(PDRIVER_OBJECT_EX DriverObject, ULONG DeviceExtension return STATUS_NO_MEMORY; } - pDeviceObjectEx->DeviceFileName = GetDeviceFileUnixDomainSocketFilePathA( - pDeviceObjectEx->DeviceName); + pDeviceObjectEx->DeviceFileName = + GetDeviceFileUnixDomainSocketFilePathA(pDeviceObjectEx->DeviceName); if (!pDeviceObjectEx->DeviceFileName) { @@ -210,7 +211,7 @@ NTSTATUS _IoCreateDeviceEx(PDRIVER_OBJECT_EX DriverObject, ULONG DeviceExtension } } - *((ULONG_PTR*)(DeviceObject)) = (ULONG_PTR) pDeviceObjectEx; + *((ULONG_PTR*)(DeviceObject)) = (ULONG_PTR)pDeviceObjectEx; return STATUS_SUCCESS; } @@ -222,7 +223,7 @@ NTSTATUS _IoCreateDeviceEx(PDRIVER_OBJECT_EX DriverObject, ULONG DeviceExtension VOID _IoDeleteDeviceEx(PDEVICE_OBJECT_EX DeviceObject) { DEVICE_OBJECT_EX* pDeviceObjectEx; - pDeviceObjectEx = (DEVICE_OBJECT_EX*) DeviceObject; + pDeviceObjectEx = (DEVICE_OBJECT_EX*)DeviceObject; if (!pDeviceObjectEx) return; diff --git a/winpr/libwinpr/io/io.c b/winpr/libwinpr/io/io.c index cac97e9e9..d7bb04f42 100644 --- a/winpr/libwinpr/io/io.c +++ b/winpr/libwinpr/io/io.c @@ -50,7 +50,8 @@ #define TAG WINPR_TAG("io") -BOOL GetOverlappedResult(HANDLE hFile, LPOVERLAPPED lpOverlapped, LPDWORD lpNumberOfBytesTransferred, BOOL bWait) +BOOL GetOverlappedResult(HANDLE hFile, LPOVERLAPPED lpOverlapped, + LPDWORD lpNumberOfBytesTransferred, BOOL bWait) { #if 1 WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); @@ -71,14 +72,14 @@ BOOL GetOverlappedResult(HANDLE hFile, LPOVERLAPPED lpOverlapped, LPDWORD lpNumb DWORD nNumberOfBytes; WINPR_NAMED_PIPE* pipe; - pipe = (WINPR_NAMED_PIPE*) Object; + pipe = (WINPR_NAMED_PIPE*)Object; if (!(pipe->dwFlagsAndAttributes & FILE_FLAG_OVERLAPPED)) return FALSE; lpBuffer = lpOverlapped->Pointer; - request = (DWORD) lpOverlapped->Internal; - nNumberOfBytes = (DWORD) lpOverlapped->InternalHigh; + request = (DWORD)lpOverlapped->Internal; + nNumberOfBytes = (DWORD)lpOverlapped->InternalHigh; if (request == 0) { @@ -105,7 +106,7 @@ BOOL GetOverlappedResult(HANDLE hFile, LPOVERLAPPED lpOverlapped, LPDWORD lpNumb length = sizeof(struct sockaddr_un); ZeroMemory(&s, sizeof(struct sockaddr_un)); - status = accept(pipe->serverfd, (struct sockaddr*) &s, &length); + status = accept(pipe->serverfd, (struct sockaddr*)&s, &length); if (status < 0) return FALSE; @@ -129,7 +130,9 @@ BOOL GetOverlappedResult(HANDLE hFile, LPOVERLAPPED lpOverlapped, LPDWORD lpNumb #endif } -BOOL GetOverlappedResultEx(HANDLE hFile, LPOVERLAPPED lpOverlapped, LPDWORD lpNumberOfBytesTransferred, DWORD dwMilliseconds, BOOL bAlertable) +BOOL GetOverlappedResultEx(HANDLE hFile, LPOVERLAPPED lpOverlapped, + LPDWORD lpNumberOfBytesTransferred, DWORD dwMilliseconds, + BOOL bAlertable) { WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -137,14 +140,16 @@ BOOL GetOverlappedResultEx(HANDLE hFile, LPOVERLAPPED lpOverlapped, LPDWORD lpNu } BOOL DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, - LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped) + LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, + LPOVERLAPPED lpOverlapped) { WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } -HANDLE CreateIoCompletionPort(HANDLE FileHandle, HANDLE ExistingCompletionPort, ULONG_PTR CompletionKey, DWORD NumberOfConcurrentThreads) +HANDLE CreateIoCompletionPort(HANDLE FileHandle, HANDLE ExistingCompletionPort, + ULONG_PTR CompletionKey, DWORD NumberOfConcurrentThreads) { WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -152,7 +157,8 @@ HANDLE CreateIoCompletionPort(HANDLE FileHandle, HANDLE ExistingCompletionPort, } BOOL GetQueuedCompletionStatus(HANDLE CompletionPort, LPDWORD lpNumberOfBytesTransferred, - PULONG_PTR lpCompletionKey, LPOVERLAPPED* lpOverlapped, DWORD dwMilliseconds) + PULONG_PTR lpCompletionKey, LPOVERLAPPED* lpOverlapped, + DWORD dwMilliseconds) { WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -160,14 +166,16 @@ BOOL GetQueuedCompletionStatus(HANDLE CompletionPort, LPDWORD lpNumberOfBytesTra } BOOL GetQueuedCompletionStatusEx(HANDLE CompletionPort, LPOVERLAPPED_ENTRY lpCompletionPortEntries, - ULONG ulCount, PULONG ulNumEntriesRemoved, DWORD dwMilliseconds, BOOL fAlertable) + ULONG ulCount, PULONG ulNumEntriesRemoved, DWORD dwMilliseconds, + BOOL fAlertable) { WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } -BOOL PostQueuedCompletionStatus(HANDLE CompletionPort, DWORD dwNumberOfBytesTransferred, ULONG_PTR dwCompletionKey, LPOVERLAPPED lpOverlapped) +BOOL PostQueuedCompletionStatus(HANDLE CompletionPort, DWORD dwNumberOfBytesTransferred, + ULONG_PTR dwCompletionKey, LPOVERLAPPED lpOverlapped) { WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -206,20 +214,24 @@ BOOL CancelSynchronousIo(HANDLE hThread) #define TAG WINPR_TAG("io") -BOOL GetOverlappedResult(HANDLE hFile, LPOVERLAPPED lpOverlapped, LPDWORD lpNumberOfBytesTransferred, BOOL bWait) +BOOL GetOverlappedResult(HANDLE hFile, LPOVERLAPPED lpOverlapped, + LPDWORD lpNumberOfBytesTransferred, BOOL bWait) { - return GetOverlappedResultEx(hFile, lpOverlapped, lpNumberOfBytesTransferred, bWait ? INFINITE : 0, TRUE); + return GetOverlappedResultEx(hFile, lpOverlapped, lpNumberOfBytesTransferred, + bWait ? INFINITE : 0, TRUE); } BOOL DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, - LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped) + LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, + LPOVERLAPPED lpOverlapped) { WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } -HANDLE CreateIoCompletionPort(HANDLE FileHandle, HANDLE ExistingCompletionPort, ULONG_PTR CompletionKey, DWORD NumberOfConcurrentThreads) +HANDLE CreateIoCompletionPort(HANDLE FileHandle, HANDLE ExistingCompletionPort, + ULONG_PTR CompletionKey, DWORD NumberOfConcurrentThreads) { WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -227,7 +239,8 @@ HANDLE CreateIoCompletionPort(HANDLE FileHandle, HANDLE ExistingCompletionPort, } BOOL GetQueuedCompletionStatus(HANDLE CompletionPort, LPDWORD lpNumberOfBytesTransferred, - PULONG_PTR lpCompletionKey, LPOVERLAPPED* lpOverlapped, DWORD dwMilliseconds) + PULONG_PTR lpCompletionKey, LPOVERLAPPED* lpOverlapped, + DWORD dwMilliseconds) { WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -235,14 +248,16 @@ BOOL GetQueuedCompletionStatus(HANDLE CompletionPort, LPDWORD lpNumberOfBytesTra } BOOL GetQueuedCompletionStatusEx(HANDLE CompletionPort, LPOVERLAPPED_ENTRY lpCompletionPortEntries, - ULONG ulCount, PULONG ulNumEntriesRemoved, DWORD dwMilliseconds, BOOL fAlertable) + ULONG ulCount, PULONG ulNumEntriesRemoved, DWORD dwMilliseconds, + BOOL fAlertable) { WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } -BOOL PostQueuedCompletionStatus(HANDLE CompletionPort, DWORD dwNumberOfBytesTransferred, ULONG_PTR dwCompletionKey, LPOVERLAPPED lpOverlapped) +BOOL PostQueuedCompletionStatus(HANDLE CompletionPort, DWORD dwNumberOfBytesTransferred, + ULONG_PTR dwCompletionKey, LPOVERLAPPED lpOverlapped) { WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); diff --git a/winpr/libwinpr/io/io.h b/winpr/libwinpr/io/io.h index d359bcf94..e077b2c3d 100644 --- a/winpr/libwinpr/io/io.h +++ b/winpr/libwinpr/io/io.h @@ -37,4 +37,3 @@ struct _DEVICE_OBJECT_EX #endif #endif /* WINPR_IO_PRIVATE_H */ - diff --git a/winpr/libwinpr/io/test/TestIoDevice.c b/winpr/libwinpr/io/test/TestIoDevice.c index d6feb633b..357734b8a 100644 --- a/winpr/libwinpr/io/test/TestIoDevice.c +++ b/winpr/libwinpr/io/test/TestIoDevice.c @@ -15,9 +15,7 @@ int TestIoDevice(int argc, char* argv[]) _RtlInitAnsiString(&aString, "\\Device\\Example"); _RtlAnsiStringToUnicodeString(&uString, &aString, TRUE); - NtStatus = _IoCreateDeviceEx(NULL, 0, - &uString, FILE_DEVICE_UNKNOWN, - 0, FALSE, &pDeviceObject); + NtStatus = _IoCreateDeviceEx(NULL, 0, &uString, FILE_DEVICE_UNKNOWN, 0, FALSE, &pDeviceObject); if (NtStatus != STATUS_SUCCESS) return -1; @@ -28,4 +26,3 @@ int TestIoDevice(int argc, char* argv[]) #endif return 0; } - diff --git a/winpr/libwinpr/library/library.c b/winpr/libwinpr/library/library.c index 10cc3ae25..f44a96d27 100644 --- a/winpr/libwinpr/library/library.c +++ b/winpr/libwinpr/library/library.c @@ -158,7 +158,7 @@ HMODULE LoadLibraryW(LPCWSTR lpLibFileName) HMODULE LoadLibraryExA(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags) { if (dwFlags != 0) - WLog_WARN(TAG, "%s does not support dwFlags 0x%08"PRIx32, __FUNCTION__, dwFlags); + WLog_WARN(TAG, "%s does not support dwFlags 0x%08" PRIx32, __FUNCTION__, dwFlags); if (hFile) WLog_WARN(TAG, "%s does not support hFile != NULL", __FUNCTION__); @@ -169,7 +169,7 @@ HMODULE LoadLibraryExA(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags) HMODULE LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags) { if (dwFlags != 0) - WLog_WARN(TAG, "%s does not support dwFlags 0x%08"PRIx32, __FUNCTION__, dwFlags); + WLog_WARN(TAG, "%s does not support dwFlags 0x%08" PRIx32, __FUNCTION__, dwFlags); if (hFile) WLog_WARN(TAG, "%s does not support hFile != NULL", __FUNCTION__); @@ -189,7 +189,7 @@ FARPROC GetProcAddress(HMODULE hModule, LPCSTR lpProcName) if (proc == NULL) { WLog_ERR(TAG, "GetProcAddress: could not find procedure %s: %s", lpProcName, dlerror()); - return (FARPROC) NULL; + return (FARPROC)NULL; } return proc; @@ -343,4 +343,3 @@ DWORD GetModuleFileNameA(HMODULE hModule, LPSTR lpFilename, DWORD nSize) } #endif - diff --git a/winpr/libwinpr/library/test/TestLibraryGetModuleFileName.c b/winpr/libwinpr/library/test/TestLibraryGetModuleFileName.c index 244549a0b..cb413779a 100644 --- a/winpr/libwinpr/library/test/TestLibraryGetModuleFileName.c +++ b/winpr/libwinpr/library/test/TestLibraryGetModuleFileName.c @@ -16,14 +16,15 @@ int TestLibraryGetModuleFileName(int argc, char* argv[]) len = GetModuleFileNameA(NULL, ModuleFileName, 2); if (len != 2) { - printf("%s: GetModuleFileNameA unexpectedly returned %"PRIu32" instead of 2\n", - __FUNCTION__, len); + printf("%s: GetModuleFileNameA unexpectedly returned %" PRIu32 " instead of 2\n", + __FUNCTION__, len); return -1; } if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) { - printf("%s: Invalid last error value: 0x%08"PRIX32". Expected 0x%08X (ERROR_INSUFFICIENT_BUFFER)\n", - __FUNCTION__, GetLastError(), ERROR_INSUFFICIENT_BUFFER); + printf("%s: Invalid last error value: 0x%08" PRIX32 + ". Expected 0x%08X (ERROR_INSUFFICIENT_BUFFER)\n", + __FUNCTION__, GetLastError(), ERROR_INSUFFICIENT_BUFFER); return -1; } @@ -32,20 +33,19 @@ int TestLibraryGetModuleFileName(int argc, char* argv[]) len = GetModuleFileNameA(NULL, ModuleFileName, sizeof(ModuleFileName)); if (len == 0) { - printf("%s: GetModuleFileNameA failed with error 0x%08"PRIX32"\n", - __FUNCTION__, GetLastError()); + printf("%s: GetModuleFileNameA failed with error 0x%08" PRIX32 "\n", __FUNCTION__, + GetLastError()); return -1; } if (len == sizeof(ModuleFileName)) { - printf("%s: GetModuleFileNameA unexpectedly returned nSize\n", - __FUNCTION__); + printf("%s: GetModuleFileNameA unexpectedly returned nSize\n", __FUNCTION__); return -1; } if (GetLastError() != ERROR_SUCCESS) { - printf("%s: Invalid last error value: 0x%08"PRIX32". Expected 0x%08X (ERROR_SUCCESS)\n", - __FUNCTION__, GetLastError(), ERROR_SUCCESS); + printf("%s: Invalid last error value: 0x%08" PRIX32 ". Expected 0x%08X (ERROR_SUCCESS)\n", + __FUNCTION__, GetLastError(), ERROR_SUCCESS); return -1; } diff --git a/winpr/libwinpr/library/test/TestLibraryGetProcAddress.c b/winpr/libwinpr/library/test/TestLibraryGetProcAddress.c index 7a1733cb9..d1eccf982 100644 --- a/winpr/libwinpr/library/test/TestLibraryGetProcAddress.c +++ b/winpr/libwinpr/library/test/TestLibraryGetProcAddress.c @@ -20,7 +20,7 @@ int TestLibraryGetProcAddress(int argc, char* argv[]) if (!GetModuleFileNameA(NULL, LibraryPath, PATHCCH_MAX_CCH)) { - printf("%s: GetModuleFilenameA failed: 0x%08"PRIX32"\n", __FUNCTION__, GetLastError()); + printf("%s: GetModuleFilenameA failed: 0x%08" PRIX32 "\n", __FUNCTION__, GetLastError()); return -1; } @@ -40,17 +40,17 @@ int TestLibraryGetProcAddress(int argc, char* argv[]) if (!(library = LoadLibraryA(LibraryPath))) { - printf("%s: LoadLibraryA failure: 0x%08"PRIX32"\n", __FUNCTION__, GetLastError()); + printf("%s: LoadLibraryA failure: 0x%08" PRIX32 "\n", __FUNCTION__, GetLastError()); return -1; } - if (!(pFunctionA = (TEST_AB_FN) GetProcAddress(library, "FunctionA"))) + if (!(pFunctionA = (TEST_AB_FN)GetProcAddress(library, "FunctionA"))) { printf("%s: GetProcAddress failure (FunctionA)\n", __FUNCTION__); return -1; } - if (!(pFunctionB = (TEST_AB_FN) GetProcAddress(library, "FunctionB"))) + if (!(pFunctionB = (TEST_AB_FN)GetProcAddress(library, "FunctionB"))) { printf("%s: GetProcAddress failure (FunctionB)\n", __FUNCTION__); return -1; @@ -78,7 +78,7 @@ int TestLibraryGetProcAddress(int argc, char* argv[]) if (!FreeLibrary(library)) { - printf("%s: FreeLibrary failure: 0x%08"PRIX32"\n", __FUNCTION__, GetLastError()); + printf("%s: FreeLibrary failure: 0x%08" PRIX32 "\n", __FUNCTION__, GetLastError()); return -1; } diff --git a/winpr/libwinpr/library/test/TestLibraryLoadLibrary.c b/winpr/libwinpr/library/test/TestLibraryLoadLibrary.c index 1c9a58fb4..20fb51647 100644 --- a/winpr/libwinpr/library/test/TestLibraryLoadLibrary.c +++ b/winpr/libwinpr/library/test/TestLibraryLoadLibrary.c @@ -15,7 +15,7 @@ int TestLibraryLoadLibrary(int argc, char* argv[]) if (!GetModuleFileNameA(NULL, LibraryPath, PATHCCH_MAX_CCH)) { - printf("%s: GetModuleFilenameA failed: 0x%08"PRIX32"\n", __FUNCTION__, GetLastError()); + printf("%s: GetModuleFilenameA failed: 0x%08" PRIX32 "\n", __FUNCTION__, GetLastError()); return -1; } @@ -36,13 +36,13 @@ int TestLibraryLoadLibrary(int argc, char* argv[]) if (!(library = LoadLibraryA(LibraryPath))) { - printf("%s: LoadLibraryA failure: 0x%08"PRIX32"\n", __FUNCTION__, GetLastError()); + printf("%s: LoadLibraryA failure: 0x%08" PRIX32 "\n", __FUNCTION__, GetLastError()); return -1; } if (!FreeLibrary(library)) { - printf("%s: FreeLibrary failure: 0x%08"PRIX32"\n", __FUNCTION__, GetLastError()); + printf("%s: FreeLibrary failure: 0x%08" PRIX32 "\n", __FUNCTION__, GetLastError()); return -1; } diff --git a/winpr/libwinpr/locale/locale.c b/winpr/libwinpr/locale/locale.c index 177484b1d..765af0dbb 100644 --- a/winpr/libwinpr/locale/locale.c +++ b/winpr/libwinpr/locale/locale.c @@ -91,16 +91,15 @@ #ifndef _WIN32 DWORD WINAPI FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, - LPSTR lpBuffer, DWORD nSize, va_list* Arguments) + LPSTR lpBuffer, DWORD nSize, va_list* Arguments) { return 0; } DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, - LPWSTR lpBuffer, DWORD nSize, va_list* Arguments) + LPWSTR lpBuffer, DWORD nSize, va_list* Arguments) { return 0; } #endif - diff --git a/winpr/libwinpr/locale/test/TestLocaleFormatMessage.c b/winpr/libwinpr/locale/test/TestLocaleFormatMessage.c index b733872f9..2f47c4af1 100644 --- a/winpr/libwinpr/locale/test/TestLocaleFormatMessage.c +++ b/winpr/libwinpr/locale/test/TestLocaleFormatMessage.c @@ -5,4 +5,3 @@ int TestLocaleFormatMessage(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/memory/memory.c b/winpr/libwinpr/memory/memory.c index ec5cb854b..f3d102360 100644 --- a/winpr/libwinpr/memory/memory.c +++ b/winpr/libwinpr/memory/memory.c @@ -79,7 +79,7 @@ #include "memory.h" HANDLE CreateFileMappingA(HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, DWORD flProtect, - DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCSTR lpName) + DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCSTR lpName) { if (hFile != INVALID_HANDLE_VALUE) { @@ -90,7 +90,7 @@ HANDLE CreateFileMappingA(HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, DWOR } HANDLE CreateFileMappingW(HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, DWORD flProtect, - DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCWSTR lpName) + DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCWSTR lpName) { return NULL; } @@ -106,13 +106,13 @@ HANDLE OpenFileMappingW(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpNa } LPVOID MapViewOfFile(HANDLE hFileMappingObject, DWORD dwDesiredAccess, DWORD dwFileOffsetHigh, - DWORD dwFileOffsetLow, SIZE_T dwNumberOfBytesToMap) + DWORD dwFileOffsetLow, SIZE_T dwNumberOfBytesToMap) { return NULL; } LPVOID MapViewOfFileEx(HANDLE hFileMappingObject, DWORD dwDesiredAccess, DWORD dwFileOffsetHigh, - DWORD dwFileOffsetLow, SIZE_T dwNumberOfBytesToMap, LPVOID lpBaseAddress) + DWORD dwFileOffsetLow, SIZE_T dwNumberOfBytesToMap, LPVOID lpBaseAddress) { return NULL; } @@ -128,4 +128,3 @@ BOOL UnmapViewOfFile(LPCVOID lpBaseAddress) } #endif - diff --git a/winpr/libwinpr/memory/memory.h b/winpr/libwinpr/memory/memory.h index 8071088f4..cc2492e0d 100644 --- a/winpr/libwinpr/memory/memory.h +++ b/winpr/libwinpr/memory/memory.h @@ -25,10 +25,6 @@ #include #include - - #endif #endif /* WINPR_MEMORY_PRIVATE_H */ - - diff --git a/winpr/libwinpr/memory/test/TestMemoryCreateFileMapping.c b/winpr/libwinpr/memory/test/TestMemoryCreateFileMapping.c index 918b4c468..e6e7552e3 100644 --- a/winpr/libwinpr/memory/test/TestMemoryCreateFileMapping.c +++ b/winpr/libwinpr/memory/test/TestMemoryCreateFileMapping.c @@ -6,4 +6,3 @@ int TestMemoryCreateFileMapping(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/nt/nt.c b/winpr/libwinpr/nt/nt.c index f872a3654..59d4dd8f1 100644 --- a/winpr/libwinpr/nt/nt.c +++ b/winpr/libwinpr/nt/nt.c @@ -32,7 +32,6 @@ #include "../log.h" #define TAG WINPR_TAG("nt") - /** * NtXxx Routines: * http://msdn.microsoft.com/en-us/library/windows/hardware/ff557720/ @@ -44,12 +43,12 @@ */ VOID _InitializeObjectAttributes(POBJECT_ATTRIBUTES InitializedAttributes, - PUNICODE_STRING ObjectName, ULONG Attributes, HANDLE RootDirectory, - PSECURITY_DESCRIPTOR SecurityDescriptor) + PUNICODE_STRING ObjectName, ULONG Attributes, HANDLE RootDirectory, + PSECURITY_DESCRIPTOR SecurityDescriptor) { #if defined(_WIN32) && !defined(_UWP) - InitializeObjectAttributes(InitializedAttributes, ObjectName, - Attributes, RootDirectory, SecurityDescriptor); + InitializeObjectAttributes(InitializedAttributes, ObjectName, Attributes, RootDirectory, + SecurityDescriptor); #else InitializedAttributes->Length = sizeof(OBJECT_ATTRIBUTES); InitializedAttributes->ObjectName = ObjectName; @@ -62,7 +61,6 @@ VOID _InitializeObjectAttributes(POBJECT_ATTRIBUTES InitializedAttributes, #ifndef _WIN32 - #include #include @@ -82,9 +80,9 @@ struct winpr_nt_file typedef struct winpr_nt_file WINPR_NT_FILE; static pthread_once_t _TebOnceControl = PTHREAD_ONCE_INIT; -static pthread_key_t _TebKey; +static pthread_key_t _TebKey; -static void _TebDestruct(void *teb) +static void _TebDestruct(void* teb) { free(teb); } @@ -117,7 +115,7 @@ PTEB NtCurrentTeb(void) VOID _RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString) { - DestinationString->Buffer = (PCHAR) SourceString; + DestinationString->Buffer = (PCHAR)SourceString; if (!SourceString) { @@ -126,7 +124,7 @@ VOID _RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString) } else { - USHORT length = (USHORT) strlen(SourceString); + USHORT length = (USHORT)strlen(SourceString); DestinationString->Length = length; DestinationString->MaximumLength = length + 1; } @@ -139,7 +137,7 @@ VOID _RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString) VOID _RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString) { - DestinationString->Buffer = (PWSTR) SourceString; + DestinationString->Buffer = (PWSTR)SourceString; if (!SourceString) { @@ -148,7 +146,7 @@ VOID _RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceStrin } else { - USHORT length = (USHORT) _wcslen(SourceString); + USHORT length = (USHORT)_wcslen(SourceString); DestinationString->Length = length * 2; DestinationString->MaximumLength = (length + 1) * 2; } @@ -160,7 +158,8 @@ VOID _RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceStrin */ NTSTATUS _RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, - PCANSI_STRING SourceString, BOOLEAN AllocateDestinationString) + PCANSI_STRING SourceString, + BOOLEAN AllocateDestinationString) { int index; @@ -173,7 +172,7 @@ NTSTATUS _RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, if (SourceString->MaximumLength) { - if (!(wbuf = (PWSTR) calloc(SourceString->MaximumLength, 2))) + if (!(wbuf = (PWSTR)calloc(SourceString->MaximumLength, 2))) return STATUS_NO_MEMORY; } @@ -228,9 +227,9 @@ ULONG _RtlNtStatusToDosError(NTSTATUS status) */ NTSTATUS _NtCreateFile(PHANDLE FileHandle, ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES ObjectAttributes, PIO_STATUS_BLOCK IoStatusBlock, - PLARGE_INTEGER AllocationSize, ULONG FileAttributes, ULONG ShareAccess, - ULONG CreateDisposition, ULONG CreateOptions, PVOID EaBuffer, ULONG EaLength) + POBJECT_ATTRIBUTES ObjectAttributes, PIO_STATUS_BLOCK IoStatusBlock, + PLARGE_INTEGER AllocationSize, ULONG FileAttributes, ULONG ShareAccess, + ULONG CreateDisposition, ULONG CreateOptions, PVOID EaBuffer, ULONG EaLength) { #if 1 WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); @@ -238,7 +237,7 @@ NTSTATUS _NtCreateFile(PHANDLE FileHandle, ACCESS_MASK DesiredAccess, #else WINPR_NT_FILE* pFileHandle; - pFileHandle = (WINPR_NT_FILE*) calloc(1, sizeof(WINPR_NT_FILE)); + pFileHandle = (WINPR_NT_FILE*)calloc(1, sizeof(WINPR_NT_FILE)); if (!pFileHandle) return STATUS_NO_MEMORY; @@ -248,12 +247,12 @@ NTSTATUS _NtCreateFile(PHANDLE FileHandle, ACCESS_MASK DesiredAccess, pFileHandle->CreateDisposition = CreateDisposition; pFileHandle->CreateOptions = CreateOptions; - *((PULONG_PTR) FileHandle) = (ULONG_PTR) pFileHandle; + *((PULONG_PTR)FileHandle) = (ULONG_PTR)pFileHandle; - //STATUS_ACCESS_DENIED - //STATUS_OBJECT_NAME_INVALID - //STATUS_OBJECT_PATH_NOT_FOUND - //STATUS_OBJECT_NAME_NOT_FOUND + // STATUS_ACCESS_DENIED + // STATUS_OBJECT_NAME_INVALID + // STATUS_OBJECT_PATH_NOT_FOUND + // STATUS_OBJECT_NAME_NOT_FOUND return STATUS_SUCCESS; #endif @@ -265,8 +264,8 @@ NTSTATUS _NtCreateFile(PHANDLE FileHandle, ACCESS_MASK DesiredAccess, */ NTSTATUS _NtOpenFile(PHANDLE FileHandle, ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES ObjectAttributes, PIO_STATUS_BLOCK IoStatusBlock, - ULONG ShareAccess, ULONG OpenOptions) + POBJECT_ATTRIBUTES ObjectAttributes, PIO_STATUS_BLOCK IoStatusBlock, + ULONG ShareAccess, ULONG OpenOptions) { #if 1 WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); @@ -274,7 +273,7 @@ NTSTATUS _NtOpenFile(PHANDLE FileHandle, ACCESS_MASK DesiredAccess, #else WINPR_NT_FILE* pFileHandle; - pFileHandle = (WINPR_NT_FILE*) calloc(1, sizeof(WINPR_NT_FILE)); + pFileHandle = (WINPR_NT_FILE*)calloc(1, sizeof(WINPR_NT_FILE)); if (!pFileHandle) return STATUS_NO_MEMORY; @@ -282,7 +281,7 @@ NTSTATUS _NtOpenFile(PHANDLE FileHandle, ACCESS_MASK DesiredAccess, pFileHandle->DesiredAccess = DesiredAccess; pFileHandle->ShareAccess = ShareAccess; - *((PULONG_PTR) FileHandle) = (ULONG_PTR) pFileHandle; + *((PULONG_PTR)FileHandle) = (ULONG_PTR)pFileHandle; return STATUS_SUCCESS; #endif @@ -294,7 +293,8 @@ NTSTATUS _NtOpenFile(PHANDLE FileHandle, ACCESS_MASK DesiredAccess, */ NTSTATUS _NtReadFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, - PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key) + PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, + PLARGE_INTEGER ByteOffset, PULONG Key) { #if 1 WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); @@ -310,7 +310,8 @@ NTSTATUS _NtReadFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine */ NTSTATUS _NtWriteFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, - PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key) + PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, + PLARGE_INTEGER ByteOffset, PULONG Key) { #if 1 WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); @@ -325,10 +326,10 @@ NTSTATUS _NtWriteFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutin * http://msdn.microsoft.com/en-us/library/ms648411/ */ -NTSTATUS _NtDeviceIoControlFile(HANDLE FileHandle, HANDLE Event, - PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, - ULONG IoControlCode, PVOID InputBuffer, ULONG InputBufferLength, - PVOID OutputBuffer, ULONG OutputBufferLength) +NTSTATUS _NtDeviceIoControlFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, + PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, + ULONG IoControlCode, PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength) { #if 1 WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); @@ -354,7 +355,7 @@ NTSTATUS _NtClose(HANDLE Handle) if (!Handle) return STATUS_SUCCESS; - pFileHandle = (WINPR_NT_FILE*) Handle; + pFileHandle = (WINPR_NT_FILE*)Handle; free(pFileHandle); @@ -381,40 +382,52 @@ NTSTATUS _NtWaitForSingleObject(HANDLE Handle, BOOLEAN Alertable, PLARGE_INTEGER #include -typedef VOID (WINAPI * RTL_INIT_ANSI_STRING_FN)(PANSI_STRING DestinationString, PCSZ SourceString); +typedef VOID(WINAPI* RTL_INIT_ANSI_STRING_FN)(PANSI_STRING DestinationString, PCSZ SourceString); -typedef VOID (WINAPI * RTL_INIT_UNICODE_STRING_FN)(PUNICODE_STRING DestinationString, PCWSTR SourceString); +typedef VOID(WINAPI* RTL_INIT_UNICODE_STRING_FN)(PUNICODE_STRING DestinationString, + PCWSTR SourceString); -typedef NTSTATUS (WINAPI * RTL_ANSI_STRING_TO_UNICODE_STRING_FN)(PUNICODE_STRING DestinationString, - PCANSI_STRING SourceString, BOOLEAN AllocateDestinationString); +typedef NTSTATUS(WINAPI* RTL_ANSI_STRING_TO_UNICODE_STRING_FN)(PUNICODE_STRING DestinationString, + PCANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); -typedef VOID (WINAPI * RTL_FREE_UNICODE_STRING_FN)(PUNICODE_STRING UnicodeString); +typedef VOID(WINAPI* RTL_FREE_UNICODE_STRING_FN)(PUNICODE_STRING UnicodeString); -typedef ULONG (WINAPI * RTL_NT_STATUS_TO_DOS_ERROR_FN)(NTSTATUS status); +typedef ULONG(WINAPI* RTL_NT_STATUS_TO_DOS_ERROR_FN)(NTSTATUS status); -typedef NTSTATUS (WINAPI * NT_CREATE_FILE_FN)(PHANDLE FileHandle, ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES ObjectAttributes, PIO_STATUS_BLOCK IoStatusBlock, - PLARGE_INTEGER AllocationSize, ULONG FileAttributes, ULONG ShareAccess, - ULONG CreateDisposition, ULONG CreateOptions, PVOID EaBuffer, ULONG EaLength); +typedef NTSTATUS(WINAPI* NT_CREATE_FILE_FN)(PHANDLE FileHandle, ACCESS_MASK DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + PIO_STATUS_BLOCK IoStatusBlock, + PLARGE_INTEGER AllocationSize, ULONG FileAttributes, + ULONG ShareAccess, ULONG CreateDisposition, + ULONG CreateOptions, PVOID EaBuffer, ULONG EaLength); -typedef NTSTATUS (WINAPI * NT_OPEN_FILE_FN)(PHANDLE FileHandle, ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES ObjectAttributes, PIO_STATUS_BLOCK IoStatusBlock, - ULONG ShareAccess, ULONG OpenOptions); +typedef NTSTATUS(WINAPI* NT_OPEN_FILE_FN)(PHANDLE FileHandle, ACCESS_MASK DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + PIO_STATUS_BLOCK IoStatusBlock, ULONG ShareAccess, + ULONG OpenOptions); -typedef NTSTATUS (WINAPI * NT_READ_FILE_FN)(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, - PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key); +typedef NTSTATUS(WINAPI* NT_READ_FILE_FN)(HANDLE FileHandle, HANDLE Event, + PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, + PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, + ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key); -typedef NTSTATUS (WINAPI * NT_WRITE_FILE_FN)(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, - PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key); +typedef NTSTATUS(WINAPI* NT_WRITE_FILE_FN)(HANDLE FileHandle, HANDLE Event, + PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, + PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, + ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key); -typedef NTSTATUS (WINAPI * NT_DEVICE_IO_CONTROL_FILE_FN)(HANDLE FileHandle, HANDLE Event, - PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, - ULONG IoControlCode, PVOID InputBuffer, ULONG InputBufferLength, - PVOID OutputBuffer, ULONG OutputBufferLength); +typedef NTSTATUS(WINAPI* NT_DEVICE_IO_CONTROL_FILE_FN)(HANDLE FileHandle, HANDLE Event, + PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, + PIO_STATUS_BLOCK IoStatusBlock, + ULONG IoControlCode, PVOID InputBuffer, + ULONG InputBufferLength, PVOID OutputBuffer, + ULONG OutputBufferLength); -typedef NTSTATUS (WINAPI * NT_CLOSE_FN)(HANDLE Handle); +typedef NTSTATUS(WINAPI* NT_CLOSE_FN)(HANDLE Handle); -typedef NTSTATUS (WINAPI * NT_WAIT_FOR_SINGLE_OBJECT_FN)(HANDLE Handle, BOOLEAN Alertable, PLARGE_INTEGER Timeout); +typedef NTSTATUS(WINAPI* NT_WAIT_FOR_SINGLE_OBJECT_FN)(HANDLE Handle, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); static RTL_INIT_ANSI_STRING_FN pRtlInitAnsiString = NULL; static RTL_INIT_UNICODE_STRING_FN pRtlInitUnicodeString = NULL; @@ -431,24 +444,31 @@ static NT_WAIT_FOR_SINGLE_OBJECT_FN pNtWaitForSingleObject = NULL; static INIT_ONCE ntdllInitOnce = INIT_ONCE_STATIC_INIT; -static BOOL CALLBACK NtdllModuleInit(PINIT_ONCE once, PVOID param, PVOID *context) +static BOOL CALLBACK NtdllModuleInit(PINIT_ONCE once, PVOID param, PVOID* context) { HMODULE NtdllModule = LoadLibraryA("ntdll.dll"); if (NtdllModule) { - pRtlInitAnsiString = (RTL_INIT_ANSI_STRING_FN)GetProcAddress(NtdllModule, "RtlInitAnsiString"); - pRtlInitUnicodeString = (RTL_INIT_UNICODE_STRING_FN)GetProcAddress(NtdllModule, "RtlInitUnicodeString"); - pRtlAnsiStringToUnicodeString = (RTL_ANSI_STRING_TO_UNICODE_STRING_FN)GetProcAddress(NtdllModule, "RtlAnsiStringToUnicodeString"); - pRtlFreeUnicodeString = (RTL_FREE_UNICODE_STRING_FN)GetProcAddress(NtdllModule, "RtlFreeUnicodeString"); - pRtlNtStatusToDosError = (RTL_NT_STATUS_TO_DOS_ERROR_FN)GetProcAddress(NtdllModule, "RtlNtStatusToDosError"); + pRtlInitAnsiString = + (RTL_INIT_ANSI_STRING_FN)GetProcAddress(NtdllModule, "RtlInitAnsiString"); + pRtlInitUnicodeString = + (RTL_INIT_UNICODE_STRING_FN)GetProcAddress(NtdllModule, "RtlInitUnicodeString"); + pRtlAnsiStringToUnicodeString = (RTL_ANSI_STRING_TO_UNICODE_STRING_FN)GetProcAddress( + NtdllModule, "RtlAnsiStringToUnicodeString"); + pRtlFreeUnicodeString = + (RTL_FREE_UNICODE_STRING_FN)GetProcAddress(NtdllModule, "RtlFreeUnicodeString"); + pRtlNtStatusToDosError = + (RTL_NT_STATUS_TO_DOS_ERROR_FN)GetProcAddress(NtdllModule, "RtlNtStatusToDosError"); pNtCreateFile = (NT_CREATE_FILE_FN)GetProcAddress(NtdllModule, "NtCreateFile"); pNtOpenFile = (NT_OPEN_FILE_FN)GetProcAddress(NtdllModule, "NtOpenFile"); pNtReadFile = (NT_READ_FILE_FN)GetProcAddress(NtdllModule, "NtReadFile"); pNtWriteFile = (NT_WRITE_FILE_FN)GetProcAddress(NtdllModule, "NtWriteFile"); - pNtDeviceIoControlFile = (NT_DEVICE_IO_CONTROL_FILE_FN)GetProcAddress(NtdllModule, "NtDeviceIoControlFile"); + pNtDeviceIoControlFile = + (NT_DEVICE_IO_CONTROL_FILE_FN)GetProcAddress(NtdllModule, "NtDeviceIoControlFile"); pNtClose = (NT_CLOSE_FN)GetProcAddress(NtdllModule, "NtClose"); - pNtWaitForSingleObject = (NT_WAIT_FOR_SINGLE_OBJECT_FN)GetProcAddress(NtdllModule, "NtWaitForSingleObject"); + pNtWaitForSingleObject = + (NT_WAIT_FOR_SINGLE_OBJECT_FN)GetProcAddress(NtdllModule, "NtWaitForSingleObject"); } return TRUE; } @@ -474,15 +494,16 @@ VOID _RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceStrin } NTSTATUS _RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, - PCANSI_STRING SourceString, BOOLEAN AllocateDestinationString) + PCANSI_STRING SourceString, + BOOLEAN AllocateDestinationString) { InitOnceExecuteOnce(&ntdllInitOnce, NtdllModuleInit, NULL, NULL); if (!pRtlAnsiStringToUnicodeString) return STATUS_INTERNAL_ERROR; - return pRtlAnsiStringToUnicodeString(DestinationString, - SourceString, AllocateDestinationString); + return pRtlAnsiStringToUnicodeString(DestinationString, SourceString, + AllocateDestinationString); } VOID _RtlFreeUnicodeString(PUNICODE_STRING UnicodeString) @@ -506,70 +527,72 @@ ULONG _RtlNtStatusToDosError(NTSTATUS status) } NTSTATUS _NtCreateFile(PHANDLE FileHandle, ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES ObjectAttributes, PIO_STATUS_BLOCK IoStatusBlock, - PLARGE_INTEGER AllocationSize, ULONG FileAttributes, ULONG ShareAccess, - ULONG CreateDisposition, ULONG CreateOptions, PVOID EaBuffer, ULONG EaLength) + POBJECT_ATTRIBUTES ObjectAttributes, PIO_STATUS_BLOCK IoStatusBlock, + PLARGE_INTEGER AllocationSize, ULONG FileAttributes, ULONG ShareAccess, + ULONG CreateDisposition, ULONG CreateOptions, PVOID EaBuffer, ULONG EaLength) { InitOnceExecuteOnce(&ntdllInitOnce, NtdllModuleInit, NULL, NULL); if (!pNtCreateFile) return STATUS_INTERNAL_ERROR; - return pNtCreateFile(FileHandle, DesiredAccess, ObjectAttributes, - IoStatusBlock, AllocationSize, FileAttributes, ShareAccess, - CreateDisposition, CreateOptions, EaBuffer, EaLength); + return pNtCreateFile(FileHandle, DesiredAccess, ObjectAttributes, IoStatusBlock, AllocationSize, + FileAttributes, ShareAccess, CreateDisposition, CreateOptions, EaBuffer, + EaLength); } NTSTATUS _NtOpenFile(PHANDLE FileHandle, ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES ObjectAttributes, PIO_STATUS_BLOCK IoStatusBlock, - ULONG ShareAccess, ULONG OpenOptions) + POBJECT_ATTRIBUTES ObjectAttributes, PIO_STATUS_BLOCK IoStatusBlock, + ULONG ShareAccess, ULONG OpenOptions) { InitOnceExecuteOnce(&ntdllInitOnce, NtdllModuleInit, NULL, NULL); if (!pNtOpenFile) return STATUS_INTERNAL_ERROR; - return pNtOpenFile(FileHandle, DesiredAccess, ObjectAttributes, - IoStatusBlock, ShareAccess, OpenOptions); + return pNtOpenFile(FileHandle, DesiredAccess, ObjectAttributes, IoStatusBlock, ShareAccess, + OpenOptions); } NTSTATUS _NtReadFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, - PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key) + PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, + PLARGE_INTEGER ByteOffset, PULONG Key) { InitOnceExecuteOnce(&ntdllInitOnce, NtdllModuleInit, NULL, NULL); if (!pNtReadFile) return STATUS_INTERNAL_ERROR; - return pNtReadFile(FileHandle, Event, ApcRoutine, ApcContext, - IoStatusBlock, Buffer, Length, ByteOffset, Key); + return pNtReadFile(FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, Buffer, Length, + ByteOffset, Key); } NTSTATUS _NtWriteFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, - PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key) + PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, + PLARGE_INTEGER ByteOffset, PULONG Key) { InitOnceExecuteOnce(&ntdllInitOnce, NtdllModuleInit, NULL, NULL); if (!pNtWriteFile) return STATUS_INTERNAL_ERROR; - return pNtWriteFile(FileHandle, Event, ApcRoutine, ApcContext, - IoStatusBlock, Buffer, Length, ByteOffset, Key); + return pNtWriteFile(FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, Buffer, Length, + ByteOffset, Key); } -NTSTATUS _NtDeviceIoControlFile(HANDLE FileHandle, HANDLE Event, - PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, - ULONG IoControlCode, PVOID InputBuffer, ULONG InputBufferLength, - PVOID OutputBuffer, ULONG OutputBufferLength) +NTSTATUS _NtDeviceIoControlFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, + PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, + ULONG IoControlCode, PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength) { InitOnceExecuteOnce(&ntdllInitOnce, NtdllModuleInit, NULL, NULL); if (!pNtDeviceIoControlFile) return STATUS_INTERNAL_ERROR; - return pNtDeviceIoControlFile(FileHandle, Event, - ApcRoutine, ApcContext, IoStatusBlock, IoControlCode, - InputBuffer, InputBufferLength, OutputBuffer, OutputBufferLength); + return pNtDeviceIoControlFile(FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, + IoControlCode, InputBuffer, InputBufferLength, OutputBuffer, + OutputBufferLength); } NTSTATUS _NtClose(HANDLE Handle) @@ -593,4 +616,3 @@ NTSTATUS _NtWaitForSingleObject(HANDLE Handle, BOOLEAN Alertable, PLARGE_INTEGER } #endif - diff --git a/winpr/libwinpr/nt/test/TestNtCreateFile.c b/winpr/libwinpr/nt/test/TestNtCreateFile.c index d5e6dada8..f05b550a5 100644 --- a/winpr/libwinpr/nt/test/TestNtCreateFile.c +++ b/winpr/libwinpr/nt/test/TestNtCreateFile.c @@ -26,7 +26,7 @@ int TestNtCreateFile(int argc, char* argv[]) if (ntstatus != STATUS_SUCCESS) { - printf("_RtlAnsiStringToUnicodeString failure: 0x%08"PRIX32"\n", ntstatus); + printf("_RtlAnsiStringToUnicodeString failure: 0x%08" PRIX32 "\n", ntstatus); goto out; } @@ -36,12 +36,12 @@ int TestNtCreateFile(int argc, char* argv[]) DesiredAccess = GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE; CreateOptions = FILE_DIRECTORY_FILE | FILE_WRITE_THROUGH; CreateDisposition = FILE_OVERWRITE_IF; - ntstatus = _NtCreateFile(&handle, DesiredAccess, &attributes, &ioStatusBlock, - 0, 0, CreateDisposition, CreateOptions, 0, 0, 0); + ntstatus = _NtCreateFile(&handle, DesiredAccess, &attributes, &ioStatusBlock, 0, 0, + CreateDisposition, CreateOptions, 0, 0, 0); if (ntstatus != STATUS_SUCCESS) { - printf("_NtCreateFile failure: 0x%08"PRIX32"\n", ntstatus); + printf("_NtCreateFile failure: 0x%08" PRIX32 "\n", ntstatus); goto out; } @@ -49,7 +49,7 @@ int TestNtCreateFile(int argc, char* argv[]) if (ntstatus != STATUS_SUCCESS) { - printf("_NtClose failure: 0x%08"PRIX32"\n", ntstatus); + printf("_NtClose failure: 0x%08" PRIX32 "\n", ntstatus); goto out; } @@ -66,8 +66,7 @@ out: } else { - printf("%s: This test is currently expected to fail on this platform.\n", - __FUNCTION__); + printf("%s: This test is currently expected to fail on this platform.\n", __FUNCTION__); result = 0; } diff --git a/winpr/libwinpr/nt/test/TestNtCurrentTeb.c b/winpr/libwinpr/nt/test/TestNtCurrentTeb.c index 719042c70..565354d33 100644 --- a/winpr/libwinpr/nt/test/TestNtCurrentTeb.c +++ b/winpr/libwinpr/nt/test/TestNtCurrentTeb.c @@ -18,4 +18,3 @@ int TestNtCurrentTeb(int argc, char* argv[]) #endif return 0; } - diff --git a/winpr/libwinpr/path/include/PathAllocCombine.c b/winpr/libwinpr/path/include/PathAllocCombine.c index aa90876e6..da430a647 100644 --- a/winpr/libwinpr/path/include/PathAllocCombine.c +++ b/winpr/libwinpr/path/include/PathAllocCombine.c @@ -42,7 +42,7 @@ HRESULT PATH_ALLOC_COMBINE(PCWSTR pszPathIn, PCWSTR pszMore, unsigned long dwFla return E_FAIL; /* valid but not implemented, see top comment */ if (!pszPathIn) - return E_FAIL; /* valid but not implemented, see top comment */ + return E_FAIL; /* valid but not implemented, see top comment */ pszPathInLength = wcslen(pszPathIn); pszMoreLength = wcslen(pszMore); @@ -61,7 +61,7 @@ HRESULT PATH_ALLOC_COMBINE(PCWSTR pszPathIn, PCWSTR pszMore, unsigned long dwFla size_t sizeOfBuffer; pszPathOutLength = 2 + pszMoreLength; sizeOfBuffer = (pszPathOutLength + 1) * 2; - pszPathOut = (PWSTR) HeapAlloc(GetProcessHeap(), 0, sizeOfBuffer * 2); + pszPathOut = (PWSTR)HeapAlloc(GetProcessHeap(), 0, sizeOfBuffer * 2); if (!pszPathOut) return E_OUTOFMEMORY; @@ -76,7 +76,7 @@ HRESULT PATH_ALLOC_COMBINE(PCWSTR pszPathIn, PCWSTR pszMore, unsigned long dwFla size_t sizeOfBuffer; pszPathOutLength = pszPathInLength + pszMoreLength; sizeOfBuffer = (pszPathOutLength + 1) * 2; - pszPathOut = (PWSTR) HeapAlloc(GetProcessHeap(), 0, sizeOfBuffer * 2); + pszPathOut = (PWSTR)HeapAlloc(GetProcessHeap(), 0, sizeOfBuffer * 2); if (!pszPathOut) return E_OUTOFMEMORY; @@ -84,7 +84,8 @@ HRESULT PATH_ALLOC_COMBINE(PCWSTR pszPathIn, PCWSTR pszMore, unsigned long dwFla if (backslashIn) swprintf_s(pszPathOut, sizeOfBuffer, L"%s%s", pszPathIn, pszMore); else - swprintf_s(pszPathOut, sizeOfBuffer, L"%s" _PATH_SEPARATOR_STR L"%s", pszPathIn, pszMore); + swprintf_s(pszPathOut, sizeOfBuffer, L"%s" _PATH_SEPARATOR_STR L"%s", pszPathIn, + pszMore); *ppszPathOut = pszPathOut; return S_OK; @@ -116,7 +117,7 @@ HRESULT PATH_ALLOC_COMBINE(PCSTR pszPathIn, PCSTR pszMore, unsigned long dwFlags return E_FAIL; /* valid but not implemented, see top comment */ if (!pszPathIn) - return E_FAIL; /* valid but not implemented, see top comment */ + return E_FAIL; /* valid but not implemented, see top comment */ pszPathInLength = lstrlenA(pszPathIn); pszMoreLength = lstrlenA(pszMore); @@ -135,7 +136,7 @@ HRESULT PATH_ALLOC_COMBINE(PCSTR pszPathIn, PCSTR pszMore, unsigned long dwFlags size_t sizeOfBuffer; pszPathOutLength = 2 + pszMoreLength; sizeOfBuffer = (pszPathOutLength + 1) * 2; - pszPathOut = (PSTR) HeapAlloc(GetProcessHeap(), 0, sizeOfBuffer * 2); + pszPathOut = (PSTR)HeapAlloc(GetProcessHeap(), 0, sizeOfBuffer * 2); if (!pszPathOut) return E_OUTOFMEMORY; @@ -150,7 +151,7 @@ HRESULT PATH_ALLOC_COMBINE(PCSTR pszPathIn, PCSTR pszMore, unsigned long dwFlags size_t sizeOfBuffer; pszPathOutLength = pszPathInLength + pszMoreLength; sizeOfBuffer = (pszPathOutLength + 1) * 2; - pszPathOut = (PSTR) HeapAlloc(GetProcessHeap(), 0, sizeOfBuffer * 2); + pszPathOut = (PSTR)HeapAlloc(GetProcessHeap(), 0, sizeOfBuffer * 2); if (!pszPathOut) return E_OUTOFMEMORY; @@ -175,4 +176,3 @@ HRESULT PATH_ALLOC_COMBINE(PCSTR pszPathIn, PCSTR pszMore, unsigned long dwFlags #undef _PATH_SEPARATOR_STR #undef PATH_ALLOC_COMBINE */ - diff --git a/winpr/libwinpr/path/include/PathCchAddExtension.c b/winpr/libwinpr/path/include/PathCchAddExtension.c index b51716e3e..fc385ae0b 100644 --- a/winpr/libwinpr/path/include/PathCchAddExtension.c +++ b/winpr/libwinpr/path/include/PathCchAddExtension.c @@ -97,4 +97,3 @@ HRESULT PATH_CCH_ADD_EXTENSION(PSTR pszPath, size_t cchPath, PCSTR pszExt) #undef _PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_EXTENSION */ - diff --git a/winpr/libwinpr/path/include/PathCchAddSeparator.c b/winpr/libwinpr/path/include/PathCchAddSeparator.c index cf2b269f7..4a4f6be49 100644 --- a/winpr/libwinpr/path/include/PathCchAddSeparator.c +++ b/winpr/libwinpr/path/include/PathCchAddSeparator.c @@ -62,4 +62,3 @@ HRESULT PATH_CCH_ADD_SEPARATOR(PSTR pszPath, size_t cchPath) #undef _PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR */ - diff --git a/winpr/libwinpr/path/include/PathCchAddSeparatorEx.c b/winpr/libwinpr/path/include/PathCchAddSeparatorEx.c index d21ba5b21..154cff6e2 100644 --- a/winpr/libwinpr/path/include/PathCchAddSeparatorEx.c +++ b/winpr/libwinpr/path/include/PathCchAddSeparatorEx.c @@ -7,7 +7,8 @@ #if DEFINE_UNICODE -HRESULT PATH_CCH_ADD_SEPARATOR_EX(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, size_t* pcchRemaining) +HRESULT PATH_CCH_ADD_SEPARATOR_EX(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, + size_t* pcchRemaining) { size_t pszPathLength; @@ -32,7 +33,8 @@ HRESULT PATH_CCH_ADD_SEPARATOR_EX(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, #else -HRESULT PATH_CCH_ADD_SEPARATOR_EX(PSTR pszPath, size_t cchPath, PSTR* ppszEnd, size_t* pcchRemaining) +HRESULT PATH_CCH_ADD_SEPARATOR_EX(PSTR pszPath, size_t cchPath, PSTR* ppszEnd, + size_t* pcchRemaining) { size_t pszPathLength; @@ -62,4 +64,3 @@ HRESULT PATH_CCH_ADD_SEPARATOR_EX(PSTR pszPath, size_t cchPath, PSTR* ppszEnd, s #undef _PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR_EX */ - diff --git a/winpr/libwinpr/path/include/PathCchAppend.c b/winpr/libwinpr/path/include/PathCchAppend.c index bd371f352..4d7045acf 100644 --- a/winpr/libwinpr/path/include/PathCchAppend.c +++ b/winpr/libwinpr/path/include/PathCchAppend.c @@ -51,7 +51,8 @@ HRESULT PATH_CCH_APPEND(PWSTR pszPath, size_t cchPath, PCWSTR pszMore) { if ((pszPathLength + pszMoreLength + 1) < cchPath) { - swprintf_s(&pszPath[pszPathLength], cchPath - pszPathLength, _PATH_SEPARATOR_STR L"%s", pszMore); + swprintf_s(&pszPath[pszPathLength], cchPath - pszPathLength, _PATH_SEPARATOR_STR L"%s", + pszMore); return S_OK; } } @@ -104,7 +105,8 @@ HRESULT PATH_CCH_APPEND(PSTR pszPath, size_t cchPath, PCSTR pszMore) { if ((pszPathLength + pszMoreLength + 1) < cchPath) { - sprintf_s(&pszPath[pszPathLength], cchPath - pszPathLength, _PATH_SEPARATOR_STR "%s", pszMore); + sprintf_s(&pszPath[pszPathLength], cchPath - pszPathLength, _PATH_SEPARATOR_STR "%s", + pszMore); return S_OK; } } @@ -115,9 +117,8 @@ HRESULT PATH_CCH_APPEND(PSTR pszPath, size_t cchPath, PCSTR pszMore) #endif /* -#undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR -#undef _PATH_SEPARATOR_STR -#undef PATH_CCH_APPEND +#undef DEFINE_UNICODE +#undef _PATH_SEPARATOR_CHR +#undef _PATH_SEPARATOR_STR +#undef PATH_CCH_APPEND */ - diff --git a/winpr/libwinpr/path/path.c b/winpr/libwinpr/path/path.c index 6c8477a30..547132c0d 100644 --- a/winpr/libwinpr/path/path.c +++ b/winpr/libwinpr/path/path.c @@ -27,40 +27,40 @@ #include -#define PATH_SLASH_CHR '/' -#define PATH_SLASH_STR "/" +#define PATH_SLASH_CHR '/' +#define PATH_SLASH_STR "/" -#define PATH_BACKSLASH_CHR '\\' -#define PATH_BACKSLASH_STR "\\" +#define PATH_BACKSLASH_CHR '\\' +#define PATH_BACKSLASH_STR "\\" #ifdef _WIN32 -#define PATH_SLASH_STR_W L"/" -#define PATH_BACKSLASH_STR_W L"\\" +#define PATH_SLASH_STR_W L"/" +#define PATH_BACKSLASH_STR_W L"\\" #else -#define PATH_SLASH_STR_W "/" -#define PATH_BACKSLASH_STR_W "\\" +#define PATH_SLASH_STR_W "/" +#define PATH_BACKSLASH_STR_W "\\" #endif #ifdef _WIN32 -#define PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR -#define PATH_SEPARATOR_STR PATH_BACKSLASH_STR -#define PATH_SEPARATOR_STR_W PATH_BACKSLASH_STR_W +#define PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR +#define PATH_SEPARATOR_STR PATH_BACKSLASH_STR +#define PATH_SEPARATOR_STR_W PATH_BACKSLASH_STR_W #else -#define PATH_SEPARATOR_CHR PATH_SLASH_CHR -#define PATH_SEPARATOR_STR PATH_SLASH_STR -#define PATH_SEPARATOR_STR_W PATH_SLASH_STR_W +#define PATH_SEPARATOR_CHR PATH_SLASH_CHR +#define PATH_SEPARATOR_STR PATH_SLASH_STR +#define PATH_SEPARATOR_STR_W PATH_SLASH_STR_W #endif -#define SHARED_LIBRARY_EXT_DLL "dll" -#define SHARED_LIBRARY_EXT_SO "so" -#define SHARED_LIBRARY_EXT_DYLIB "dylib" +#define SHARED_LIBRARY_EXT_DLL "dll" +#define SHARED_LIBRARY_EXT_SO "so" +#define SHARED_LIBRARY_EXT_DYLIB "dylib" #ifdef _WIN32 -#define SHARED_LIBRARY_EXT SHARED_LIBRARY_EXT_DLL +#define SHARED_LIBRARY_EXT SHARED_LIBRARY_EXT_DLL #elif defined(__APPLE__) -#define SHARED_LIBRARY_EXT SHARED_LIBRARY_EXT_DYLIB +#define SHARED_LIBRARY_EXT SHARED_LIBRARY_EXT_DYLIB #else -#define SHARED_LIBRARY_EXT SHARED_LIBRARY_EXT_SO +#define SHARED_LIBRARY_EXT SHARED_LIBRARY_EXT_SO #endif #include "../log.h" @@ -72,17 +72,17 @@ /* Windows-style Paths */ -#define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR -#define PATH_CCH_ADD_SEPARATOR PathCchAddBackslashA +#define DEFINE_UNICODE FALSE +#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR +#define PATH_CCH_ADD_SEPARATOR PathCchAddBackslashA #include "include/PathCchAddSeparator.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR -#define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR -#define PATH_CCH_ADD_SEPARATOR PathCchAddBackslashW +#define DEFINE_UNICODE TRUE +#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR +#define PATH_CCH_ADD_SEPARATOR PathCchAddBackslashW #include "include/PathCchAddSeparator.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR @@ -90,17 +90,17 @@ /* Unix-style Paths */ -#define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR -#define PATH_CCH_ADD_SEPARATOR PathCchAddSlashA +#define DEFINE_UNICODE FALSE +#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR +#define PATH_CCH_ADD_SEPARATOR PathCchAddSlashA #include "include/PathCchAddSeparator.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR -#define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR -#define PATH_CCH_ADD_SEPARATOR PathCchAddSlashW +#define DEFINE_UNICODE TRUE +#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR +#define PATH_CCH_ADD_SEPARATOR PathCchAddSlashW #include "include/PathCchAddSeparator.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR @@ -108,17 +108,17 @@ /* Native-style Paths */ -#define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR -#define PATH_CCH_ADD_SEPARATOR PathCchAddSeparatorA +#define DEFINE_UNICODE FALSE +#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR +#define PATH_CCH_ADD_SEPARATOR PathCchAddSeparatorA #include "include/PathCchAddSeparator.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR -#define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR -#define PATH_CCH_ADD_SEPARATOR PathCchAddSeparatorW +#define DEFINE_UNICODE TRUE +#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR +#define PATH_CCH_ADD_SEPARATOR PathCchAddSeparatorW #include "include/PathCchAddSeparator.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR @@ -146,17 +146,17 @@ HRESULT PathCchRemoveBackslashW(PWSTR pszPath, size_t cchPath) /* Windows-style Paths */ -#define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR -#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddBackslashExA +#define DEFINE_UNICODE FALSE +#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR +#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddBackslashExA #include "include/PathCchAddSeparatorEx.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR_EX -#define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR -#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddBackslashExW +#define DEFINE_UNICODE TRUE +#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR +#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddBackslashExW #include "include/PathCchAddSeparatorEx.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR @@ -164,17 +164,17 @@ HRESULT PathCchRemoveBackslashW(PWSTR pszPath, size_t cchPath) /* Unix-style Paths */ -#define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR -#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddSlashExA +#define DEFINE_UNICODE FALSE +#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR +#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddSlashExA #include "include/PathCchAddSeparatorEx.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR_EX -#define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR -#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddSlashExW +#define DEFINE_UNICODE TRUE +#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR +#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddSlashExW #include "include/PathCchAddSeparatorEx.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR @@ -182,29 +182,31 @@ HRESULT PathCchRemoveBackslashW(PWSTR pszPath, size_t cchPath) /* Native-style Paths */ -#define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR -#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddSeparatorExA +#define DEFINE_UNICODE FALSE +#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR +#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddSeparatorExA #include "include/PathCchAddSeparatorEx.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR_EX -#define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR -#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddSeparatorExW +#define DEFINE_UNICODE TRUE +#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR +#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddSeparatorExW #include "include/PathCchAddSeparatorEx.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR_EX -HRESULT PathCchRemoveBackslashExA(PSTR pszPath, size_t cchPath, PSTR* ppszEnd, size_t* pcchRemaining) +HRESULT PathCchRemoveBackslashExA(PSTR pszPath, size_t cchPath, PSTR* ppszEnd, + size_t* pcchRemaining) { WLog_ERR(TAG, "%s: not implemented", __FUNCTION__); return E_NOTIMPL; } -HRESULT PathCchRemoveBackslashExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, size_t* pcchRemaining) +HRESULT PathCchRemoveBackslashExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, + size_t* pcchRemaining) { WLog_ERR(TAG, "%s: not implemented", __FUNCTION__); return E_NOTIMPL; @@ -216,17 +218,17 @@ HRESULT PathCchRemoveBackslashExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, /* Windows-style Paths */ -#define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR -#define PATH_CCH_ADD_EXTENSION PathCchAddExtensionA +#define DEFINE_UNICODE FALSE +#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR +#define PATH_CCH_ADD_EXTENSION PathCchAddExtensionA #include "include/PathCchAddExtension.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_EXTENSION -#define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR -#define PATH_CCH_ADD_EXTENSION PathCchAddExtensionW +#define DEFINE_UNICODE TRUE +#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR +#define PATH_CCH_ADD_EXTENSION PathCchAddExtensionW #include "include/PathCchAddExtension.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR @@ -234,17 +236,17 @@ HRESULT PathCchRemoveBackslashExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, /* Unix-style Paths */ -#define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR -#define PATH_CCH_ADD_EXTENSION UnixPathCchAddExtensionA +#define DEFINE_UNICODE FALSE +#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR +#define PATH_CCH_ADD_EXTENSION UnixPathCchAddExtensionA #include "include/PathCchAddExtension.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_EXTENSION -#define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR -#define PATH_CCH_ADD_EXTENSION UnixPathCchAddExtensionW +#define DEFINE_UNICODE TRUE +#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR +#define PATH_CCH_ADD_EXTENSION UnixPathCchAddExtensionW #include "include/PathCchAddExtension.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR @@ -252,17 +254,17 @@ HRESULT PathCchRemoveBackslashExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, /* Native-style Paths */ -#define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR -#define PATH_CCH_ADD_EXTENSION NativePathCchAddExtensionA +#define DEFINE_UNICODE FALSE +#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR +#define PATH_CCH_ADD_EXTENSION NativePathCchAddExtensionA #include "include/PathCchAddExtension.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_EXTENSION -#define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR -#define PATH_CCH_ADD_EXTENSION NativePathCchAddExtensionW +#define DEFINE_UNICODE TRUE +#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR +#define PATH_CCH_ADD_EXTENSION NativePathCchAddExtensionW #include "include/PathCchAddExtension.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR @@ -274,20 +276,20 @@ HRESULT PathCchRemoveBackslashExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, /* Windows-style Paths */ -#define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR -#define _PATH_SEPARATOR_STR PATH_BACKSLASH_STR -#define PATH_CCH_APPEND PathCchAppendA +#define DEFINE_UNICODE FALSE +#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR +#define _PATH_SEPARATOR_STR PATH_BACKSLASH_STR +#define PATH_CCH_APPEND PathCchAppendA #include "include/PathCchAppend.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR #undef _PATH_SEPARATOR_STR #undef PATH_CCH_APPEND -#define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR -#define _PATH_SEPARATOR_STR PATH_BACKSLASH_STR_W -#define PATH_CCH_APPEND PathCchAppendW +#define DEFINE_UNICODE TRUE +#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR +#define _PATH_SEPARATOR_STR PATH_BACKSLASH_STR_W +#define PATH_CCH_APPEND PathCchAppendW #include "include/PathCchAppend.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR @@ -296,20 +298,20 @@ HRESULT PathCchRemoveBackslashExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, /* Unix-style Paths */ -#define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR -#define _PATH_SEPARATOR_STR PATH_SLASH_STR -#define PATH_CCH_APPEND UnixPathCchAppendA +#define DEFINE_UNICODE FALSE +#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR +#define _PATH_SEPARATOR_STR PATH_SLASH_STR +#define PATH_CCH_APPEND UnixPathCchAppendA #include "include/PathCchAppend.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR #undef _PATH_SEPARATOR_STR #undef PATH_CCH_APPEND -#define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR -#define _PATH_SEPARATOR_STR PATH_SLASH_STR_W -#define PATH_CCH_APPEND UnixPathCchAppendW +#define DEFINE_UNICODE TRUE +#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR +#define _PATH_SEPARATOR_STR PATH_SLASH_STR_W +#define PATH_CCH_APPEND UnixPathCchAppendW #include "include/PathCchAppend.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR @@ -318,20 +320,20 @@ HRESULT PathCchRemoveBackslashExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, /* Native-style Paths */ -#define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR -#define _PATH_SEPARATOR_STR PATH_SEPARATOR_STR -#define PATH_CCH_APPEND NativePathCchAppendA +#define DEFINE_UNICODE FALSE +#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR +#define _PATH_SEPARATOR_STR PATH_SEPARATOR_STR +#define PATH_CCH_APPEND NativePathCchAppendA #include "include/PathCchAppend.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR #undef _PATH_SEPARATOR_STR #undef PATH_CCH_APPEND -#define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR -#define _PATH_SEPARATOR_STR PATH_SEPARATOR_STR_W -#define PATH_CCH_APPEND NativePathCchAppendW +#define DEFINE_UNICODE TRUE +#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR +#define _PATH_SEPARATOR_STR PATH_SEPARATOR_STR_W +#define PATH_CCH_APPEND NativePathCchAppendW #include "include/PathCchAppend.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR @@ -374,13 +376,15 @@ HRESULT PathCchCanonicalizeW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPath * PathCchCanonicalizeEx */ -HRESULT PathCchCanonicalizeExA(PSTR pszPathOut, size_t cchPathOut, PCSTR pszPathIn, unsigned long dwFlags) +HRESULT PathCchCanonicalizeExA(PSTR pszPathOut, size_t cchPathOut, PCSTR pszPathIn, + unsigned long dwFlags) { WLog_ERR(TAG, "%s: not implemented", __FUNCTION__); return E_NOTIMPL; } -HRESULT PathCchCanonicalizeExW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, unsigned long dwFlags) +HRESULT PathCchCanonicalizeExW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, + unsigned long dwFlags) { WLog_ERR(TAG, "%s: not implemented", __FUNCTION__); return E_NOTIMPL; @@ -422,13 +426,15 @@ HRESULT PathCchCombineW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, P * PathCchCombineEx */ -HRESULT PathCchCombineExA(PSTR pszPathOut, size_t cchPathOut, PCSTR pszPathIn, PCSTR pszMore, unsigned long dwFlags) +HRESULT PathCchCombineExA(PSTR pszPathOut, size_t cchPathOut, PCSTR pszPathIn, PCSTR pszMore, + unsigned long dwFlags) { WLog_ERR(TAG, "%s: not implemented", __FUNCTION__); return E_NOTIMPL; } -HRESULT PathCchCombineExW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, PCWSTR pszMore, unsigned long dwFlags) +HRESULT PathCchCombineExW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, PCWSTR pszMore, + unsigned long dwFlags) { WLog_ERR(TAG, "%s: not implemented", __FUNCTION__); return E_NOTIMPL; @@ -440,20 +446,20 @@ HRESULT PathCchCombineExW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, /* Windows-style Paths */ -#define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR -#define _PATH_SEPARATOR_STR PATH_BACKSLASH_STR -#define PATH_ALLOC_COMBINE PathAllocCombineA +#define DEFINE_UNICODE FALSE +#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR +#define _PATH_SEPARATOR_STR PATH_BACKSLASH_STR +#define PATH_ALLOC_COMBINE PathAllocCombineA #include "include/PathAllocCombine.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR #undef _PATH_SEPARATOR_STR #undef PATH_ALLOC_COMBINE -#define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR -#define _PATH_SEPARATOR_STR PATH_BACKSLASH_STR_W -#define PATH_ALLOC_COMBINE PathAllocCombineW +#define DEFINE_UNICODE TRUE +#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR +#define _PATH_SEPARATOR_STR PATH_BACKSLASH_STR_W +#define PATH_ALLOC_COMBINE PathAllocCombineW #include "include/PathAllocCombine.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR @@ -462,20 +468,20 @@ HRESULT PathCchCombineExW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, /* Unix-style Paths */ -#define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR -#define _PATH_SEPARATOR_STR PATH_SLASH_STR -#define PATH_ALLOC_COMBINE UnixPathAllocCombineA +#define DEFINE_UNICODE FALSE +#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR +#define _PATH_SEPARATOR_STR PATH_SLASH_STR +#define PATH_ALLOC_COMBINE UnixPathAllocCombineA #include "include/PathAllocCombine.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR #undef _PATH_SEPARATOR_STR #undef PATH_ALLOC_COMBINE -#define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR -#define _PATH_SEPARATOR_STR PATH_SLASH_STR_W -#define PATH_ALLOC_COMBINE UnixPathAllocCombineW +#define DEFINE_UNICODE TRUE +#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR +#define _PATH_SEPARATOR_STR PATH_SLASH_STR_W +#define PATH_ALLOC_COMBINE UnixPathAllocCombineW #include "include/PathAllocCombine.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR @@ -484,20 +490,20 @@ HRESULT PathCchCombineExW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, /* Native-style Paths */ -#define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR -#define _PATH_SEPARATOR_STR PATH_SEPARATOR_STR -#define PATH_ALLOC_COMBINE NativePathAllocCombineA +#define DEFINE_UNICODE FALSE +#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR +#define _PATH_SEPARATOR_STR PATH_SEPARATOR_STR +#define PATH_ALLOC_COMBINE NativePathAllocCombineA #include "include/PathAllocCombine.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR #undef _PATH_SEPARATOR_STR #undef PATH_ALLOC_COMBINE -#define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR -#define _PATH_SEPARATOR_STR PATH_SEPARATOR_STR_W -#define PATH_ALLOC_COMBINE NativePathAllocCombineW +#define DEFINE_UNICODE TRUE +#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR +#define _PATH_SEPARATOR_STR PATH_SEPARATOR_STR_W +#define PATH_ALLOC_COMBINE NativePathAllocCombineW #include "include/PathAllocCombine.c" #undef DEFINE_UNICODE #undef _PATH_SEPARATOR_CHR @@ -510,7 +516,7 @@ HRESULT PathCchCombineExW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, HRESULT PathCchFindExtensionA(PCSTR pszPath, size_t cchPath, PCSTR* ppszExt) { - char* p = (char*) pszPath; + char* p = (char*)pszPath; if (!pszPath || !cchPath || !ppszExt) return E_INVALIDARG; @@ -537,7 +543,7 @@ HRESULT PathCchFindExtensionA(PCSTR pszPath, size_t cchPath, PCSTR* ppszExt) { if (*p == '.') { - *ppszExt = (PCSTR) p; + *ppszExt = (PCSTR)p; break; } @@ -682,8 +688,10 @@ HRESULT PathCchStripPrefixA(PSTR pszPath, size_t cchPath) if (cchPath < 4 || cchPath > PATHCCH_MAX_CCH) return E_INVALIDARG; - hasPrefix = ((pszPath[0] == '\\') && (pszPath[1] == '\\') && - (pszPath[2] == '?') && (pszPath[3] == '\\')) ? TRUE : FALSE; + hasPrefix = ((pszPath[0] == '\\') && (pszPath[1] == '\\') && (pszPath[2] == '?') && + (pszPath[3] == '\\')) + ? TRUE + : FALSE; if (hasPrefix) { @@ -715,8 +723,10 @@ HRESULT PathCchStripPrefixW(PWSTR pszPath, size_t cchPath) if (cchPath < 4 || cchPath > PATHCCH_MAX_CCH) return E_INVALIDARG; - hasPrefix = ((pszPath[0] == '\\') && (pszPath[1] == '\\') && - (pszPath[2] == '?') && (pszPath[3] == '\\')) ? TRUE : FALSE; + hasPrefix = ((pszPath[0] == '\\') && (pszPath[1] == '\\') && (pszPath[2] == '?') && + (pszPath[3] == '\\')) + ? TRUE + : FALSE; if (hasPrefix) { @@ -927,17 +937,17 @@ static const CHAR SharedLibraryExtensionDllA[] = "dll"; static const CHAR SharedLibraryExtensionSoA[] = "so"; static const CHAR SharedLibraryExtensionDylibA[] = "dylib"; -static const WCHAR SharedLibraryExtensionDllW[] = { 'd','l','l','\0' }; -static const WCHAR SharedLibraryExtensionSoW[] = { 's','o','\0' }; -static const WCHAR SharedLibraryExtensionDylibW[] = { 'd','y','l','i','b','\0' }; +static const WCHAR SharedLibraryExtensionDllW[] = { 'd', 'l', 'l', '\0' }; +static const WCHAR SharedLibraryExtensionSoW[] = { 's', 'o', '\0' }; +static const WCHAR SharedLibraryExtensionDylibW[] = { 'd', 'y', 'l', 'i', 'b', '\0' }; static const CHAR SharedLibraryExtensionDotDllA[] = ".dll"; static const CHAR SharedLibraryExtensionDotSoA[] = ".so"; static const CHAR SharedLibraryExtensionDotDylibA[] = ".dylib"; -static const WCHAR SharedLibraryExtensionDotDllW[] = { '.','d','l','l','\0' }; -static const WCHAR SharedLibraryExtensionDotSoW[] = { '.','s','o','\0' }; -static const WCHAR SharedLibraryExtensionDotDylibW[] = { '.','d','y','l','i','b','\0' }; +static const WCHAR SharedLibraryExtensionDotDllW[] = { '.', 'd', 'l', 'l', '\0' }; +static const WCHAR SharedLibraryExtensionDotSoW[] = { '.', 's', 'o', '\0' }; +static const WCHAR SharedLibraryExtensionDotDylibW[] = { '.', 'd', 'y', 'l', 'i', 'b', '\0' }; PCSTR PathGetSharedLibraryExtensionA(unsigned long dwFlags) { diff --git a/winpr/libwinpr/path/shell.c b/winpr/libwinpr/path/shell.c index 513b81759..2db02f134 100644 --- a/winpr/libwinpr/path/shell.c +++ b/winpr/libwinpr/path/shell.c @@ -122,11 +122,12 @@ static char* GetPath_XDG_DATA_HOME(void) size_t size; char* home = NULL; /** - * There is a single base directory relative to which user-specific data files should be written. - * This directory is defined by the environment variable $XDG_DATA_HOME. + * There is a single base directory relative to which user-specific data files should be + * written. This directory is defined by the environment variable $XDG_DATA_HOME. * - * $XDG_DATA_HOME defines the base directory relative to which user specific data files should be stored. - * If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used. + * $XDG_DATA_HOME defines the base directory relative to which user specific data files should + * be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to + * $HOME/.local/share should be used. */ path = GetEnvAlloc("XDG_DATA_HOME"); @@ -139,7 +140,7 @@ static char* GetPath_XDG_DATA_HOME(void) return NULL; size = strlen(home) + strlen("/.local/share") + 1; - path = (char*) malloc(size); + path = (char*)malloc(size); if (!path) { @@ -174,11 +175,12 @@ static char* GetPath_XDG_CONFIG_HOME(void) size_t size; char* home = NULL; /** - * There is a single base directory relative to which user-specific configuration files should be written. - * This directory is defined by the environment variable $XDG_CONFIG_HOME. + * There is a single base directory relative to which user-specific configuration files should + * be written. This directory is defined by the environment variable $XDG_CONFIG_HOME. * - * $XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored. - * If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used. + * $XDG_CONFIG_HOME defines the base directory relative to which user specific configuration + * files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to + * $HOME/.config should be used. */ path = GetEnvAlloc("XDG_CONFIG_HOME"); @@ -194,7 +196,7 @@ static char* GetPath_XDG_CONFIG_HOME(void) return NULL; size = strlen(home) + strlen("/.config") + 1; - path = (char*) malloc(size); + path = (char*)malloc(size); if (!path) { @@ -230,11 +232,12 @@ static char* GetPath_XDG_CACHE_HOME(void) #else size_t size; /** - * There is a single base directory relative to which user-specific non-essential (cached) data should be written. - * This directory is defined by the environment variable $XDG_CACHE_HOME. + * There is a single base directory relative to which user-specific non-essential (cached) data + * should be written. This directory is defined by the environment variable $XDG_CACHE_HOME. * - * $XDG_CACHE_HOME defines the base directory relative to which user specific non-essential data files should be stored. - * If $XDG_CACHE_HOME is either not set or empty, a default equal to $HOME/.cache should be used. + * $XDG_CACHE_HOME defines the base directory relative to which user specific non-essential data + * files should be stored. If $XDG_CACHE_HOME is either not set or empty, a default equal to + * $HOME/.cache should be used. */ path = GetEnvAlloc("XDG_CACHE_HOME"); @@ -247,7 +250,7 @@ static char* GetPath_XDG_CACHE_HOME(void) return NULL; size = strlen(home) + strlen("/.cache") + 1; - path = (char*) malloc(size); + path = (char*)malloc(size); if (!path) { @@ -270,8 +273,7 @@ char* GetPath_XDG_RUNTIME_DIR(void) if (!path) return NULL; - if (FAILED(SHGetFolderPathA(0, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, - path))) + if (FAILED(SHGetFolderPathA(0, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, path))) { free(path); return NULL; @@ -279,30 +281,35 @@ char* GetPath_XDG_RUNTIME_DIR(void) #else /** - * There is a single base directory relative to which user-specific runtime files and other file objects should be placed. - * This directory is defined by the environment variable $XDG_RUNTIME_DIR. + * There is a single base directory relative to which user-specific runtime files and other file + * objects should be placed. This directory is defined by the environment variable + * $XDG_RUNTIME_DIR. * - * $XDG_RUNTIME_DIR defines the base directory relative to which user-specific non-essential runtime files and other - * file objects (such as sockets, named pipes, ...) should be stored. The directory MUST be owned by the user, - * and he MUST be the only one having read and write access to it. Its Unix access mode MUST be 0700. + * $XDG_RUNTIME_DIR defines the base directory relative to which user-specific non-essential + * runtime files and other file objects (such as sockets, named pipes, ...) should be stored. + * The directory MUST be owned by the user, and he MUST be the only one having read and write + * access to it. Its Unix access mode MUST be 0700. * - * The lifetime of the directory MUST be bound to the user being logged in. It MUST be created when the user first - * logs in and if the user fully logs out the directory MUST be removed. If the user logs in more than once he should - * get pointed to the same directory, and it is mandatory that the directory continues to exist from his first login - * to his last logout on the system, and not removed in between. Files in the directory MUST not survive reboot or a + * The lifetime of the directory MUST be bound to the user being logged in. It MUST be created + * when the user first logs in and if the user fully logs out the directory MUST be removed. If + * the user logs in more than once he should get pointed to the same directory, and it is + * mandatory that the directory continues to exist from his first login to his last logout on + * the system, and not removed in between. Files in the directory MUST not survive reboot or a * full logout/login cycle. * - * The directory MUST be on a local file system and not shared with any other system. The directory MUST by fully-featured - * by the standards of the operating system. More specifically, on Unix-like operating systems AF_UNIX sockets, - * symbolic links, hard links, proper permissions, file locking, sparse files, memory mapping, file change notifications, - * a reliable hard link count must be supported, and no restrictions on the file name character set should be imposed. - * Files in this directory MAY be subjected to periodic clean-up. To ensure that your files are not removed, they should - * have their access time timestamp modified at least once every 6 hours of monotonic time or the 'sticky' bit should be - * set on the file. + * The directory MUST be on a local file system and not shared with any other system. The + * directory MUST by fully-featured by the standards of the operating system. More specifically, + * on Unix-like operating systems AF_UNIX sockets, symbolic links, hard links, proper + * permissions, file locking, sparse files, memory mapping, file change notifications, a + * reliable hard link count must be supported, and no restrictions on the file name character + * set should be imposed. Files in this directory MAY be subjected to periodic clean-up. To + * ensure that your files are not removed, they should have their access time timestamp modified + * at least once every 6 hours of monotonic time or the 'sticky' bit should be set on the file. * - * If $XDG_RUNTIME_DIR is not set applications should fall back to a replacement directory with similar capabilities and - * print a warning message. Applications should use this directory for communication and synchronization purposes and - * should not place larger files in it, since it might reside in runtime memory and cannot necessarily be swapped out to disk. + * If $XDG_RUNTIME_DIR is not set applications should fall back to a replacement directory with + * similar capabilities and print a warning message. Applications should use this directory for + * communication and synchronization purposes and should not place larger files in it, since it + * might reside in runtime memory and cannot necessarily be swapped out to disk. */ path = GetEnvAlloc("XDG_RUNTIME_DIR"); #endif @@ -374,7 +381,7 @@ char* GetEnvironmentPath(char* name) if (nSize) { - env = (LPSTR) malloc(nSize); + env = (LPSTR)malloc(nSize); if (!env) return NULL; @@ -413,13 +420,13 @@ char* GetCombinedPath(const char* basePath, const char* subPath) int subPathLength = 0; if (basePath) - basePathLength = (int) strlen(basePath); + basePathLength = (int)strlen(basePath); if (subPath) - subPathLength = (int) strlen(subPath); + subPathLength = (int)strlen(subPath); length = basePathLength + subPathLength + 1; - path = (char*) malloc(length + 1); + path = (char*)malloc(length + 1); if (!path) return NULL; @@ -499,9 +506,9 @@ BOOL PathMakePathA(LPCSTR path, LPSECURITY_ATTRIBUTES lpAttributes) #else for (p = dup; p;) #endif -{ - if ((p = strchr(p + 1, delim))) - * p = '\0'; + { + if ((p = strchr(p + 1, delim))) + *p = '\0'; if (mkdir(dup, 0777) != 0) if (errno != EEXIST) @@ -577,7 +584,7 @@ BOOL PathIsDirectoryEmptyA(LPCSTR pszPath) while ((dp = readdir(dir)) != NULL) { if (strcmp(dp->d_name, ".") == 0 || strcmp(dp->d_name, "..") == 0) - continue; /* Skip . and .. */ + continue; /* Skip . and .. */ empty = 0; break; @@ -587,7 +594,6 @@ BOOL PathIsDirectoryEmptyA(LPCSTR pszPath) return empty; } - BOOL PathIsDirectoryEmptyW(LPCWSTR pszPath) { LPSTR lpFileNameA = NULL; @@ -601,7 +607,6 @@ BOOL PathIsDirectoryEmptyW(LPCWSTR pszPath) return ret; } - #else #ifdef _WIN32 diff --git a/winpr/libwinpr/path/shell_ios.h b/winpr/libwinpr/path/shell_ios.h index ee6fd2837..3144d8dd0 100644 --- a/winpr/libwinpr/path/shell_ios.h +++ b/winpr/libwinpr/path/shell_ios.h @@ -7,4 +7,3 @@ char* ios_get_data(void); char* ios_get_cache(void); #endif - diff --git a/winpr/libwinpr/path/shell_ios.m b/winpr/libwinpr/path/shell_ios.m index 7d8e01b85..7a6f78bf1 100644 --- a/winpr/libwinpr/path/shell_ios.m +++ b/winpr/libwinpr/path/shell_ios.m @@ -26,32 +26,31 @@ #include "shell_ios.h" -NSString* ios_get_directory_for_search_path(NSString* searchPath) +NSString *ios_get_directory_for_search_path(NSString *searchPath) { - return [NSSearchPathForDirectoriesInDomains(searchPath, - NSUserDomainMask, YES) lastObject]; + return [NSSearchPathForDirectoriesInDomains(searchPath, NSUserDomainMask, YES) lastObject]; } -char* ios_get_home(void) +char *ios_get_home(void) { - NSString* path = ios_get_directory_for_search_path(NSDocumentDirectory); + NSString *path = ios_get_directory_for_search_path(NSDocumentDirectory); return strdup([path UTF8String]); } -char* ios_get_temp(void) +char *ios_get_temp(void) { - NSString* tmp_path = NSTemporaryDirectory(); + NSString *tmp_path = NSTemporaryDirectory(); return strdup([tmp_path UTF8String]); } -char* ios_get_data(void) +char *ios_get_data(void) { - NSString* path = ios_get_directory_for_search_path(NSApplicationSupportDirectory); + NSString *path = ios_get_directory_for_search_path(NSApplicationSupportDirectory); return strdup([path UTF8String]); } -char* ios_get_cache(void) +char *ios_get_cache(void) { - NSString* path = ios_get_directory_for_search_path(NSCachesDirectory); + NSString *path = ios_get_directory_for_search_path(NSCachesDirectory); return strdup([path UTF8String]); } diff --git a/winpr/libwinpr/path/test/TestPathAllocCanonicalize.c b/winpr/libwinpr/path/test/TestPathAllocCanonicalize.c index cb812c48d..a451c3fa6 100644 --- a/winpr/libwinpr/path/test/TestPathAllocCanonicalize.c +++ b/winpr/libwinpr/path/test/TestPathAllocCanonicalize.c @@ -10,4 +10,3 @@ int TestPathAllocCanonicalize(int argc, char* argv[]) printf("Warning: %s is not implemented!\n", __FUNCTION__); return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathAllocCombine.c b/winpr/libwinpr/path/test/TestPathAllocCombine.c index b315a8623..396c178cf 100644 --- a/winpr/libwinpr/path/test/TestPathAllocCombine.c +++ b/winpr/libwinpr/path/test/TestPathAllocCombine.c @@ -23,7 +23,7 @@ int TestPathAllocCombine(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathAllocCombine status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathAllocCombine status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } @@ -41,13 +41,14 @@ int TestPathAllocCombine(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathAllocCombine status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathAllocCombine status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } if (_tcscmp(PathOut, testPathOutMorePathBackslash) != 0) { - _tprintf(_T("Path Mismatch 2: Actual: %s, Expected: %s\n"), PathOut, testPathOutMorePathBackslash); + _tprintf(_T("Path Mismatch 2: Actual: %s, Expected: %s\n"), PathOut, + testPathOutMorePathBackslash); return -1; } @@ -59,13 +60,14 @@ int TestPathAllocCombine(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathAllocCombine status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathAllocCombine status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } if (_tcscmp(PathOut, testPathOutMorePathBackslash) != 0) { - _tprintf(_T("Path Mismatch 3: Actual: %s, Expected: %s\n"), PathOut, testPathOutMorePathBackslash); + _tprintf(_T("Path Mismatch 3: Actual: %s, Expected: %s\n"), PathOut, + testPathOutMorePathBackslash); return -1; } @@ -77,7 +79,7 @@ int TestPathAllocCombine(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathAllocCombine status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathAllocCombine status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } @@ -91,4 +93,3 @@ int TestPathAllocCombine(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchAddBackslash.c b/winpr/libwinpr/path/test/TestPathCchAddBackslash.c index dcde5eb61..c594ef292 100644 --- a/winpr/libwinpr/path/test/TestPathCchAddBackslash.c +++ b/winpr/libwinpr/path/test/TestPathCchAddBackslash.c @@ -27,7 +27,7 @@ int TestPathCchAddBackslash(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchAddBackslash status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAddBackslash status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } @@ -45,7 +45,7 @@ int TestPathCchAddBackslash(int argc, char* argv[]) if (status != S_FALSE) { - _tprintf(_T("PathCchAddBackslash status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAddBackslash status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } @@ -61,7 +61,9 @@ int TestPathCchAddBackslash(int argc, char* argv[]) if (SUCCEEDED(status)) { - _tprintf(_T("PathCchAddBackslash unexpectedly succeded with null buffer. Status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAddBackslash unexpectedly succeded with null buffer. Status: 0x%08") _T( + PRIX32) _T("\n"), + status); return -1; } @@ -73,7 +75,9 @@ int TestPathCchAddBackslash(int argc, char* argv[]) if (SUCCEEDED(status)) { - _tprintf(_T("PathCchAddBackslash unexpectedly succeded with insufficient buffer size. Status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAddBackslash unexpectedly succeded with insufficient buffer size. ") + _T("Status: 0x%08") _T(PRIX32) _T("\n"), + status); return -1; } @@ -85,10 +89,9 @@ int TestPathCchAddBackslash(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchAddBackslash failed with status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAddBackslash failed with status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchAddBackslashEx.c b/winpr/libwinpr/path/test/TestPathCchAddBackslashEx.c index f1bf35598..eaf2a53e3 100644 --- a/winpr/libwinpr/path/test/TestPathCchAddBackslashEx.c +++ b/winpr/libwinpr/path/test/TestPathCchAddBackslashEx.c @@ -29,7 +29,7 @@ int TestPathCchAddBackslashEx(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchAddBackslash status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAddBackslash status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } @@ -47,7 +47,7 @@ int TestPathCchAddBackslashEx(int argc, char* argv[]) if (status != S_FALSE) { - _tprintf(_T("PathCchAddBackslash status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAddBackslash status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } @@ -63,7 +63,10 @@ int TestPathCchAddBackslashEx(int argc, char* argv[]) if (SUCCEEDED(status)) { - _tprintf(_T("PathCchAddBackslashEx unexpectedly succeded with null buffer. Status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf( + _T("PathCchAddBackslashEx unexpectedly succeded with null buffer. Status: 0x%08") _T( + PRIX32) _T("\n"), + status); return -1; } @@ -75,7 +78,9 @@ int TestPathCchAddBackslashEx(int argc, char* argv[]) if (SUCCEEDED(status)) { - _tprintf(_T("PathCchAddBackslashEx unexpectedly succeded with insufficient buffer size. Status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAddBackslashEx unexpectedly succeded with insufficient buffer size. ") + _T("Status: 0x%08") _T(PRIX32) _T("\n"), + status); return -1; } @@ -87,11 +92,9 @@ int TestPathCchAddBackslashEx(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchAddBackslashEx failed with status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAddBackslashEx failed with status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } - return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchAddExtension.c b/winpr/libwinpr/path/test/TestPathCchAddExtension.c index 87d91f21d..213c41059 100644 --- a/winpr/libwinpr/path/test/TestPathCchAddExtension.c +++ b/winpr/libwinpr/path/test/TestPathCchAddExtension.c @@ -20,10 +20,10 @@ int TestPathCchAddExtension(int argc, char* argv[]) _tcscpy(Path, testPathNoExtension); status = PathCchAddExtension(Path, PATHCCH_MAX_CCH, testExtDot); - + if (status != S_OK) { - _tprintf(_T("PathCchAddExtension status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAddExtension status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } @@ -38,10 +38,10 @@ int TestPathCchAddExtension(int argc, char* argv[]) _tcscpy(Path, testPathNoExtension); status = PathCchAddExtension(Path, PATHCCH_MAX_CCH, testExtNoDot); - + if (status != S_OK) { - _tprintf(_T("PathCchAddExtension status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAddExtension status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } @@ -56,10 +56,10 @@ int TestPathCchAddExtension(int argc, char* argv[]) _tcscpy(Path, testPathExtension); status = PathCchAddExtension(Path, PATHCCH_MAX_CCH, testExtDot); - + if (status != S_FALSE) { - _tprintf(_T("PathCchAddExtension status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAddExtension status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } @@ -74,10 +74,10 @@ int TestPathCchAddExtension(int argc, char* argv[]) _tcscpy(Path, testPathExtension); status = PathCchAddExtension(Path, PATHCCH_MAX_CCH, testExtDot); - + if (status != S_FALSE) { - _tprintf(_T("PathCchAddExtension status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAddExtension status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } @@ -92,7 +92,9 @@ int TestPathCchAddExtension(int argc, char* argv[]) status = PathCchAddExtension(NULL, PATHCCH_MAX_CCH, testExtDot); if (status != E_INVALIDARG) { - _tprintf(_T("PathCchAddExtension with null buffer returned status: 0x%08")_T(PRIX32)_T(" (expected E_INVALIDARG)\n"), status); + _tprintf(_T("PathCchAddExtension with null buffer returned status: 0x%08") _T( + PRIX32) _T(" (expected E_INVALIDARG)\n"), + status); return -1; } @@ -101,7 +103,9 @@ int TestPathCchAddExtension(int argc, char* argv[]) status = PathCchAddExtension(Path, PATHCCH_MAX_CCH, NULL); if (status != E_INVALIDARG) { - _tprintf(_T("PathCchAddExtension with null extension returned status: 0x%08")_T(PRIX32)_T(" (expected E_INVALIDARG)\n"), status); + _tprintf(_T("PathCchAddExtension with null extension returned status: 0x%08") _T( + PRIX32) _T(" (expected E_INVALIDARG)\n"), + status); return -1; } @@ -111,7 +115,9 @@ int TestPathCchAddExtension(int argc, char* argv[]) status = PathCchAddExtension(Path, 9 + 4, _T(".jpg")); if (SUCCEEDED(status)) { - _tprintf(_T("PathCchAddExtension with insufficient buffer unexpectedly succeeded with status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAddExtension with insufficient buffer unexpectedly succeeded with ") + _T("status: 0x%08") _T(PRIX32) _T("\n"), + status); return -1; } @@ -121,11 +127,11 @@ int TestPathCchAddExtension(int argc, char* argv[]) status = PathCchAddExtension(Path, 9 + 4 + 1, _T(".jpg")); if (FAILED(status)) { - _tprintf(_T("PathCchAddExtension with sufficient buffer unexpectedly failed with status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAddExtension with sufficient buffer unexpectedly failed with status: ") + _T("0x%08") _T(PRIX32) _T("\n"), + status); return -1; } - return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchAppend.c b/winpr/libwinpr/path/test/TestPathCchAppend.c index 7492721fb..c833fdee0 100644 --- a/winpr/libwinpr/path/test/TestPathCchAppend.c +++ b/winpr/libwinpr/path/test/TestPathCchAppend.c @@ -25,7 +25,7 @@ int TestPathCchAppend(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchAppend status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAppend status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } @@ -43,7 +43,7 @@ int TestPathCchAppend(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchAppend status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAppend status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } @@ -61,7 +61,7 @@ int TestPathCchAppend(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchAppend status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAppend status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } @@ -79,7 +79,7 @@ int TestPathCchAppend(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchAppend status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAppend status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } @@ -93,7 +93,9 @@ int TestPathCchAppend(int argc, char* argv[]) status = PathCchAppend(NULL, PATHCCH_MAX_CCH, testMorePathNoBackslash); if (status != E_INVALIDARG) { - _tprintf(_T("PathCchAppend with NULL path unexpectedly returned status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAppend with NULL path unexpectedly returned status: 0x%08") _T( + PRIX32) _T("\n"), + status); return -1; } @@ -102,7 +104,9 @@ int TestPathCchAppend(int argc, char* argv[]) status = PathCchAppend(Path, PATHCCH_MAX_CCH, NULL); if (status != E_INVALIDARG) { - _tprintf(_T("PathCchAppend with NULL pszMore unexpectedly returned status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAppend with NULL pszMore unexpectedly returned status: 0x%08") _T( + PRIX32) _T("\n"), + status); return -1; } @@ -111,14 +115,18 @@ int TestPathCchAppend(int argc, char* argv[]) status = PathCchAppend(Path, 0, testMorePathNoBackslash); if (status != E_INVALIDARG) { - _tprintf(_T("PathCchAppend with cchPath value 0 unexpectedly returned status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAppend with cchPath value 0 unexpectedly returned status: 0x%08") _T( + PRIX32) _T("\n"), + status); return -1; } _tcscpy(Path, testBasePathNoBackslash); status = PathCchAppend(Path, PATHCCH_MAX_CCH + 1, testMorePathNoBackslash); if (status != E_INVALIDARG) { - _tprintf(_T("PathCchAppend with cchPath value > PATHCCH_MAX_CCH unexpectedly returned status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAppend with cchPath value > PATHCCH_MAX_CCH unexpectedly returned ") + _T("status: 0x%08") _T(PRIX32) _T("\n"), + status); return -1; } @@ -132,10 +140,10 @@ int TestPathCchAppend(int argc, char* argv[]) status = PathCchAppend(Path, PATHCCH_MAX_CCH, _T("\\This cannot be appended to Path")); if (SUCCEEDED(status)) { - _tprintf(_T("PathCchAppend unexepectedly succeeded with status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchAppend unexepectedly succeeded with status: 0x%08") _T(PRIX32) _T("\n"), + status); return -1; } return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchAppendEx.c b/winpr/libwinpr/path/test/TestPathCchAppendEx.c index 563bccba1..1e8c1a709 100644 --- a/winpr/libwinpr/path/test/TestPathCchAppendEx.c +++ b/winpr/libwinpr/path/test/TestPathCchAppendEx.c @@ -10,4 +10,3 @@ int TestPathCchAppendEx(int argc, char* argv[]) printf("Warning: %s is not implemented!\n", __FUNCTION__); return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchCanonicalize.c b/winpr/libwinpr/path/test/TestPathCchCanonicalize.c index a5b1ec051..6a8114b06 100644 --- a/winpr/libwinpr/path/test/TestPathCchCanonicalize.c +++ b/winpr/libwinpr/path/test/TestPathCchCanonicalize.c @@ -10,4 +10,3 @@ int TestPathCchCanonicalize(int argc, char* argv[]) printf("Warning: %s is not implemented!\n", __FUNCTION__); return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchCanonicalizeEx.c b/winpr/libwinpr/path/test/TestPathCchCanonicalizeEx.c index dd0ae1da0..c3500cd8b 100644 --- a/winpr/libwinpr/path/test/TestPathCchCanonicalizeEx.c +++ b/winpr/libwinpr/path/test/TestPathCchCanonicalizeEx.c @@ -10,4 +10,3 @@ int TestPathCchCanonicalizeEx(int argc, char* argv[]) printf("Warning: %s is not implemented!\n", __FUNCTION__); return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchCombine.c b/winpr/libwinpr/path/test/TestPathCchCombine.c index 0d7cd4707..bd01fa0a8 100644 --- a/winpr/libwinpr/path/test/TestPathCchCombine.c +++ b/winpr/libwinpr/path/test/TestPathCchCombine.c @@ -10,4 +10,3 @@ int TestPathCchCombine(int argc, char* argv[]) printf("Warning: %s is not implemented!\n", __FUNCTION__); return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchCombineEx.c b/winpr/libwinpr/path/test/TestPathCchCombineEx.c index 725bc8f91..050e36798 100644 --- a/winpr/libwinpr/path/test/TestPathCchCombineEx.c +++ b/winpr/libwinpr/path/test/TestPathCchCombineEx.c @@ -10,4 +10,3 @@ int TestPathCchCombineEx(int argc, char* argv[]) printf("Warning: %s is not implemented!\n", __FUNCTION__); return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchFindExtension.c b/winpr/libwinpr/path/test/TestPathCchFindExtension.c index c30c072f4..7f2bd4879 100644 --- a/winpr/libwinpr/path/test/TestPathCchFindExtension.c +++ b/winpr/libwinpr/path/test/TestPathCchFindExtension.c @@ -17,35 +17,43 @@ int TestPathCchFindExtension(int argc, char* argv[]) hr = PathCchFindExtensionA(NULL, sizeof(testPathExtension), &pszExt); if (SUCCEEDED(hr)) { - printf("PathCchFindExtensionA unexpectedly succeeded with pszPath = NULL. result: 0x%08"PRIX32"\n", hr); + printf( + "PathCchFindExtensionA unexpectedly succeeded with pszPath = NULL. result: 0x%08" PRIX32 + "\n", + hr); return -1; } hr = PathCchFindExtensionA(testPathExtension, 0, &pszExt); if (SUCCEEDED(hr)) { - printf("PathCchFindExtensionA unexpectedly succeeded with cchPath = 0. result: 0x%08"PRIX32"\n", hr); + printf("PathCchFindExtensionA unexpectedly succeeded with cchPath = 0. result: 0x%08" PRIX32 + "\n", + hr); return -1; } hr = PathCchFindExtensionA(testPathExtension, sizeof(testPathExtension), NULL); if (SUCCEEDED(hr)) { - printf("PathCchFindExtensionA unexpectedly succeeded with ppszExt = NULL. result: 0x%08"PRIX32"\n", hr); + printf( + "PathCchFindExtensionA unexpectedly succeeded with ppszExt = NULL. result: 0x%08" PRIX32 + "\n", + hr); return -1; } - /* Test missing null-termination of pszPath */ hr = PathCchFindExtensionA("c:\\45.789", 9, &pszExt); /* nb: correct would be 10 */ if (SUCCEEDED(hr)) { - printf("PathCchFindExtensionA unexpectedly succeeded with unterminated pszPath. result: 0x%08"PRIX32"\n", hr); + printf("PathCchFindExtensionA unexpectedly succeeded with unterminated pszPath. result: " + "0x%08" PRIX32 "\n", + hr); return -1; } - /* Test passing of an empty terminated string (must succeed) */ pszExt = NULL; @@ -53,17 +61,19 @@ int TestPathCchFindExtension(int argc, char* argv[]) hr = PathCchFindExtensionA(pszTmp, 1, &pszExt); if (hr != S_OK) { - printf("PathCchFindExtensionA failed with an empty terminated string. result: 0x%08"PRIX32"\n", hr); + printf("PathCchFindExtensionA failed with an empty terminated string. result: 0x%08" PRIX32 + "\n", + hr); return -1; } /* pszExt must point to the strings terminating 0 now */ if (pszExt != pszTmp) { - printf("PathCchFindExtensionA failed with an empty terminated string: pszExt pointer mismatch\n"); + printf("PathCchFindExtensionA failed with an empty terminated string: pszExt pointer " + "mismatch\n"); return -1; } - /* Test a path without file extension (must succeed) */ pszExt = NULL; @@ -71,7 +81,7 @@ int TestPathCchFindExtension(int argc, char* argv[]) hr = PathCchFindExtensionA(pszTmp, 10, &pszExt); if (hr != S_OK) { - printf("PathCchFindExtensionA failed with a directory path. result: 0x%08"PRIX32"\n", hr); + printf("PathCchFindExtensionA failed with a directory path. result: 0x%08" PRIX32 "\n", hr); return -1; } /* The extension must not have been found and pszExt must point to the @@ -82,7 +92,6 @@ int TestPathCchFindExtension(int argc, char* argv[]) return -1; } - /* Non-special tests */ pszExt = NULL; @@ -102,4 +111,3 @@ int TestPathCchFindExtension(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchIsRoot.c b/winpr/libwinpr/path/test/TestPathCchIsRoot.c index 878328d11..156c7dbc9 100644 --- a/winpr/libwinpr/path/test/TestPathCchIsRoot.c +++ b/winpr/libwinpr/path/test/TestPathCchIsRoot.c @@ -10,4 +10,3 @@ int TestPathCchIsRoot(int argc, char* argv[]) printf("Warning: %s is not implemented!\n", __FUNCTION__); return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchRemoveBackslash.c b/winpr/libwinpr/path/test/TestPathCchRemoveBackslash.c index 489d313cd..41972c22b 100644 --- a/winpr/libwinpr/path/test/TestPathCchRemoveBackslash.c +++ b/winpr/libwinpr/path/test/TestPathCchRemoveBackslash.c @@ -10,4 +10,3 @@ int TestPathCchRemoveBackslash(int argc, char* argv[]) printf("Warning: %s is not implemented!\n", __FUNCTION__); return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchRemoveBackslashEx.c b/winpr/libwinpr/path/test/TestPathCchRemoveBackslashEx.c index eaf863f26..bfa305f31 100644 --- a/winpr/libwinpr/path/test/TestPathCchRemoveBackslashEx.c +++ b/winpr/libwinpr/path/test/TestPathCchRemoveBackslashEx.c @@ -10,4 +10,3 @@ int TestPathCchRemoveBackslashEx(int argc, char* argv[]) printf("Warning: %s is not implemented!\n", __FUNCTION__); return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchRemoveExtension.c b/winpr/libwinpr/path/test/TestPathCchRemoveExtension.c index 700c21758..c96f41ab7 100644 --- a/winpr/libwinpr/path/test/TestPathCchRemoveExtension.c +++ b/winpr/libwinpr/path/test/TestPathCchRemoveExtension.c @@ -10,4 +10,3 @@ int TestPathCchRemoveExtension(int argc, char* argv[]) printf("Warning: %s is not implemented!\n", __FUNCTION__); return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchRemoveFileSpec.c b/winpr/libwinpr/path/test/TestPathCchRemoveFileSpec.c index 3754cb309..a2484e0e0 100644 --- a/winpr/libwinpr/path/test/TestPathCchRemoveFileSpec.c +++ b/winpr/libwinpr/path/test/TestPathCchRemoveFileSpec.c @@ -10,4 +10,3 @@ int TestPathCchRemoveFileSpec(int argc, char* argv[]) printf("Warning: %s is not implemented!\n", __FUNCTION__); return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchRenameExtension.c b/winpr/libwinpr/path/test/TestPathCchRenameExtension.c index 5b86c3651..d83ef67be 100644 --- a/winpr/libwinpr/path/test/TestPathCchRenameExtension.c +++ b/winpr/libwinpr/path/test/TestPathCchRenameExtension.c @@ -10,4 +10,3 @@ int TestPathCchRenameExtension(int argc, char* argv[]) printf("Warning: %s is not implemented!\n", __FUNCTION__); return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchSkipRoot.c b/winpr/libwinpr/path/test/TestPathCchSkipRoot.c index a2821e70c..24782055f 100644 --- a/winpr/libwinpr/path/test/TestPathCchSkipRoot.c +++ b/winpr/libwinpr/path/test/TestPathCchSkipRoot.c @@ -10,4 +10,3 @@ int TestPathCchSkipRoot(int argc, char* argv[]) printf("Warning: %s is not implemented!\n", __FUNCTION__); return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchStripPrefix.c b/winpr/libwinpr/path/test/TestPathCchStripPrefix.c index 57c14987d..ac4580ce6 100644 --- a/winpr/libwinpr/path/test/TestPathCchStripPrefix.c +++ b/winpr/libwinpr/path/test/TestPathCchStripPrefix.c @@ -28,7 +28,6 @@ int TestPathCchStripPrefix(int argc, char* argv[]) * the path did not have a prefix to remove, or an HRESULT failure code. */ - /* Path with prefix (File Namespace) */ _tcscpy(Path, testPathPrefixFileNamespace); @@ -37,13 +36,14 @@ int TestPathCchStripPrefix(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchStripPrefix status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchStripPrefix status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } if (_tcscmp(Path, testPathNoPrefixFileNamespace) != 0) { - _tprintf(_T("Path Mismatch: Actual: %s, Expected: %s\n"), Path, testPathNoPrefixFileNamespace); + _tprintf(_T("Path Mismatch: Actual: %s, Expected: %s\n"), Path, + testPathNoPrefixFileNamespace); return -1; } @@ -55,13 +55,14 @@ int TestPathCchStripPrefix(int argc, char* argv[]) if (status != S_FALSE) { - _tprintf(_T("PathCchStripPrefix status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchStripPrefix status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } if (_tcscmp(Path, testPathPrefixDeviceNamespace) != 0) { - _tprintf(_T("Path Mismatch: Actual: %s, Expected: %s\n"), Path, testPathPrefixDeviceNamespace); + _tprintf(_T("Path Mismatch: Actual: %s, Expected: %s\n"), Path, + testPathPrefixDeviceNamespace); return -1; } @@ -69,7 +70,10 @@ int TestPathCchStripPrefix(int argc, char* argv[]) status = PathCchStripPrefix(NULL, PATHCCH_MAX_CCH); if (status != E_INVALIDARG) { - _tprintf(_T("PathCchStripPrefix with null path unexpectedly succeeded with status 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf( + _T("PathCchStripPrefix with null path unexpectedly succeeded with status 0x%08") _T( + PRIX32) _T("\n"), + status); return -1; } @@ -82,7 +86,9 @@ int TestPathCchStripPrefix(int argc, char* argv[]) status = PathCchStripPrefix(Path, i); if (status != E_INVALIDARG) { - _tprintf(_T("PathCchStripPrefix with invalid cchPath value %d unexpectedly succeeded with status 0x%08")_T(PRIX32)_T("\n"), i, status); + _tprintf(_T("PathCchStripPrefix with invalid cchPath value %d unexpectedly succeeded ") + _T("with status 0x%08") _T(PRIX32) _T("\n"), + i, status); return -1; } } @@ -94,12 +100,15 @@ int TestPathCchStripPrefix(int argc, char* argv[]) status = PathCchStripPrefix(Path, i); if (status != S_OK) { - _tprintf(_T("PathCchStripPrefix with minimum valid strippable path length unexpectedly returned status 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathCchStripPrefix with minimum valid strippable path length unexpectedly ") + _T("returned status 0x%08") _T(PRIX32) _T("\n"), + status); return -1; } if (_tcscmp(Path, testPathNoPrefixFileNamespaceMinimum)) { - _tprintf(_T("Path Mismatch: Actual: %s, Expected: %s\n"), Path, testPathNoPrefixFileNamespaceMinimum); + _tprintf(_T("Path Mismatch: Actual: %s, Expected: %s\n"), Path, + testPathNoPrefixFileNamespaceMinimum); return -1; } @@ -108,10 +117,10 @@ int TestPathCchStripPrefix(int argc, char* argv[]) status = PathCchStripPrefix(Path, 6); if (status == S_OK) { - _tprintf(_T("PathCchStripPrefix with invalid drive letter symbol unexpectedly succeeded\n")); + _tprintf( + _T("PathCchStripPrefix with invalid drive letter symbol unexpectedly succeeded\n")); return -1; } return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathCchStripToRoot.c b/winpr/libwinpr/path/test/TestPathCchStripToRoot.c index 6192549cf..dea70c204 100644 --- a/winpr/libwinpr/path/test/TestPathCchStripToRoot.c +++ b/winpr/libwinpr/path/test/TestPathCchStripToRoot.c @@ -10,4 +10,3 @@ int TestPathCchStripToRoot(int argc, char* argv[]) printf("Warning: %s is not implemented!\n", __FUNCTION__); return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathIsUNCEx.c b/winpr/libwinpr/path/test/TestPathIsUNCEx.c index 20688f32b..f94037900 100644 --- a/winpr/libwinpr/path/test/TestPathIsUNCEx.c +++ b/winpr/libwinpr/path/test/TestPathIsUNCEx.c @@ -19,11 +19,11 @@ int TestPathIsUNCEx(int argc, char* argv[]) _tcscpy(Path, testPathUNC); - status = PathIsUNCEx(Path, (LPCTSTR*) &Server); + status = PathIsUNCEx(Path, (LPCTSTR*)&Server); if (!status) { - _tprintf(_T("PathIsUNCEx status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathIsUNCEx status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } @@ -37,14 +37,13 @@ int TestPathIsUNCEx(int argc, char* argv[]) _tcscpy(Path, testPathNotUNC); - status = PathIsUNCEx(Path, (LPCTSTR*) &Server); + status = PathIsUNCEx(Path, (LPCTSTR*)&Server); if (status) { - _tprintf(_T("PathIsUNCEx status: 0x%08")_T(PRIX32)_T("\n"), status); + _tprintf(_T("PathIsUNCEx status: 0x%08") _T(PRIX32) _T("\n"), status); return -1; } return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathMakePath.c b/winpr/libwinpr/path/test/TestPathMakePath.c index 9727407ee..a82e10e4f 100644 --- a/winpr/libwinpr/path/test/TestPathMakePath.c +++ b/winpr/libwinpr/path/test/TestPathMakePath.c @@ -79,4 +79,3 @@ int TestPathMakePath(int argc, char* argv[]) printf("%s success!\n", __FUNCTION__); return 0; } - diff --git a/winpr/libwinpr/path/test/TestPathShell.c b/winpr/libwinpr/path/test/TestPathShell.c index 1e2781dee..8d354ffbe 100644 --- a/winpr/libwinpr/path/test/TestPathShell.c +++ b/winpr/libwinpr/path/test/TestPathShell.c @@ -7,26 +7,14 @@ int TestPathShell(int argc, char* argv[]) { - const int paths[] = - { - KNOWN_PATH_HOME, - KNOWN_PATH_TEMP, - KNOWN_PATH_XDG_DATA_HOME, - KNOWN_PATH_XDG_CONFIG_HOME, - KNOWN_PATH_XDG_CACHE_HOME, - KNOWN_PATH_XDG_RUNTIME_DIR, - KNOWN_PATH_XDG_CONFIG_HOME - }; - const char* names[] = - { - "KNOWN_PATH_HOME", - "KNOWN_PATH_TEMP", - "KNOWN_PATH_XDG_DATA_HOME", - "KNOWN_PATH_XDG_CONFIG_HOME", - "KNOWN_PATH_XDG_CACHE_HOME", - "KNOWN_PATH_XDG_RUNTIME_DIR", - "KNOWN_PATH_XDG_CONFIG_HOME" - }; + const int paths[] = { KNOWN_PATH_HOME, KNOWN_PATH_TEMP, + KNOWN_PATH_XDG_DATA_HOME, KNOWN_PATH_XDG_CONFIG_HOME, + KNOWN_PATH_XDG_CACHE_HOME, KNOWN_PATH_XDG_RUNTIME_DIR, + KNOWN_PATH_XDG_CONFIG_HOME }; + const char* names[] = { "KNOWN_PATH_HOME", "KNOWN_PATH_TEMP", + "KNOWN_PATH_XDG_DATA_HOME", "KNOWN_PATH_XDG_CONFIG_HOME", + "KNOWN_PATH_XDG_CACHE_HOME", "KNOWN_PATH_XDG_RUNTIME_DIR", + "KNOWN_PATH_XDG_CONFIG_HOME" }; int rc = 0; size_t x; @@ -64,4 +52,3 @@ int TestPathShell(int argc, char* argv[]) return rc; } - diff --git a/winpr/libwinpr/pipe/pipe.c b/winpr/libwinpr/pipe/pipe.c index 34f6adc42..9e3f61978 100644 --- a/winpr/libwinpr/pipe/pipe.c +++ b/winpr/libwinpr/pipe/pipe.c @@ -80,10 +80,9 @@ typedef struct _NamedPipeServerSocketEntry int references; } NamedPipeServerSocketEntry; - static BOOL PipeIsHandled(HANDLE handle) { - WINPR_PIPE* pPipe = (WINPR_PIPE*) handle; + WINPR_PIPE* pPipe = (WINPR_PIPE*)handle; if (!pPipe || (pPipe->Type != HANDLE_TYPE_ANONYMOUS_PIPE)) { @@ -140,8 +139,7 @@ static BOOL PipeRead(PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, do { io_status = read(pipe->fd, lpBuffer, nNumberOfBytesToRead); - } - while ((io_status < 0) && (errno == EINTR)); + } while ((io_status < 0) && (errno == EINTR)); if (io_status < 0) { @@ -179,8 +177,7 @@ static BOOL PipeWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrit do { io_status = write(pipe->fd, lpBuffer, nNumberOfBytesToWrite); - } - while ((io_status < 0) && (errno == EINTR)); + } while ((io_status < 0) && (errno == EINTR)); if ((io_status < 0) && (errno == EWOULDBLOCK)) io_status = 0; @@ -189,36 +186,28 @@ static BOOL PipeWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrit return TRUE; } - -static HANDLE_OPS ops = -{ - PipeIsHandled, - PipeCloseHandle, - PipeGetFd, - NULL, /* CleanupHandle */ - PipeRead, - NULL, /* FileReadEx */ - NULL, /* FileReadScatter */ - PipeWrite, - NULL, /* FileWriteEx */ - NULL, /* FileWriteGather */ - NULL, /* FileGetFileSize */ - NULL, /* FlushFileBuffers */ - NULL, /* FileSetEndOfFile */ - NULL, /* FileSetFilePointer */ - NULL, /* SetFilePointerEx */ - NULL, /* FileLockFile */ - NULL, /* FileLockFileEx */ - NULL, /* FileUnlockFile */ - NULL, /* FileUnlockFileEx */ - NULL /* SetFileTime */ +static HANDLE_OPS ops = { + PipeIsHandled, PipeCloseHandle, + PipeGetFd, NULL, /* CleanupHandle */ + PipeRead, NULL, /* FileReadEx */ + NULL, /* FileReadScatter */ + PipeWrite, NULL, /* FileWriteEx */ + NULL, /* FileWriteGather */ + NULL, /* FileGetFileSize */ + NULL, /* FlushFileBuffers */ + NULL, /* FileSetEndOfFile */ + NULL, /* FileSetFilePointer */ + NULL, /* SetFilePointerEx */ + NULL, /* FileLockFile */ + NULL, /* FileLockFileEx */ + NULL, /* FileUnlockFile */ + NULL, /* FileUnlockFileEx */ + NULL /* SetFileTime */ }; - - static BOOL NamedPipeIsHandled(HANDLE handle) { - WINPR_NAMED_PIPE* pPipe = (WINPR_NAMED_PIPE*) handle; + WINPR_NAMED_PIPE* pPipe = (WINPR_NAMED_PIPE*)handle; if (!pPipe || (pPipe->Type != HANDLE_TYPE_NAMED_PIPE) || (pPipe == INVALID_HANDLE_VALUE)) { @@ -295,8 +284,7 @@ BOOL NamedPipeRead(PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, do { io_status = read(pipe->clientfd, lpBuffer, nNumberOfBytesToRead); - } - while ((io_status < 0) && (errno == EINTR)); + } while ((io_status < 0) && (errno == EINTR)); if (io_status == 0) { @@ -343,7 +331,7 @@ BOOL NamedPipeRead(PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, cb.aio_offset = lpOverlapped->Offset; cb.aio_sigevent.sigev_notify = SIGEV_SIGNAL; cb.aio_sigevent.sigev_signo = SIGIO; - cb.aio_sigevent.sigev_value.sival_ptr = (void*) lpOverlapped; + cb.aio_sigevent.sigev_value.sival_ptr = (void*)lpOverlapped; InstallAioSignalHandler(); aio_status = aio_read(&cb); WLog_DBG(TAG, "aio_read status: %d", aio_status); @@ -356,8 +344,8 @@ BOOL NamedPipeRead(PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, #else /* synchronous behavior */ lpOverlapped->Internal = 0; - lpOverlapped->InternalHigh = (ULONG_PTR) nNumberOfBytesToRead; - lpOverlapped->Pointer = (PVOID) lpBuffer; + lpOverlapped->InternalHigh = (ULONG_PTR)nNumberOfBytesToRead; + lpOverlapped->Pointer = (PVOID)lpBuffer; SetEvent(lpOverlapped->hEvent); #endif } @@ -379,7 +367,7 @@ BOOL NamedPipeWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, return FALSE; } - pipe = (WINPR_NAMED_PIPE*) Object; + pipe = (WINPR_NAMED_PIPE*)Object; if (!(pipe->dwFlagsAndAttributes & FILE_FLAG_OVERLAPPED)) { @@ -389,8 +377,7 @@ BOOL NamedPipeWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, do { io_status = write(pipe->clientfd, lpBuffer, nNumberOfBytesToWrite); - } - while ((io_status < 0) && (errno == EINTR)); + } while ((io_status < 0) && (errno == EINTR)); if (io_status < 0) { @@ -426,12 +413,12 @@ BOOL NamedPipeWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, struct aiocb cb; ZeroMemory(&cb, sizeof(struct aiocb)); cb.aio_fildes = pipe->clientfd; - cb.aio_buf = (void*) lpBuffer; + cb.aio_buf = (void*)lpBuffer; cb.aio_nbytes = nNumberOfBytesToWrite; cb.aio_offset = lpOverlapped->Offset; cb.aio_sigevent.sigev_notify = SIGEV_SIGNAL; cb.aio_sigevent.sigev_signo = SIGIO; - cb.aio_sigevent.sigev_value.sival_ptr = (void*) lpOverlapped; + cb.aio_sigevent.sigev_value.sival_ptr = (void*)lpOverlapped; InstallAioSignalHandler(); io_status = aio_write(&cb); WLog_DBG("aio_write status: %d", io_status); @@ -444,8 +431,8 @@ BOOL NamedPipeWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, #else /* synchronous behavior */ lpOverlapped->Internal = 1; - lpOverlapped->InternalHigh = (ULONG_PTR) nNumberOfBytesToWrite; - lpOverlapped->Pointer = (PVOID) lpBuffer; + lpOverlapped->InternalHigh = (ULONG_PTR)nNumberOfBytesToWrite; + lpOverlapped->Pointer = (PVOID)lpBuffer; SetEvent(lpOverlapped->hEvent); #endif } @@ -453,29 +440,26 @@ BOOL NamedPipeWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, return TRUE; } -static HANDLE_OPS namedOps = -{ - NamedPipeIsHandled, - NamedPipeCloseHandle, - NamedPipeGetFd, - NULL, /* CleanupHandle */ - NamedPipeRead, - NULL, - NULL, - NamedPipeWrite, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL -}; +static HANDLE_OPS namedOps = { NamedPipeIsHandled, + NamedPipeCloseHandle, + NamedPipeGetFd, + NULL, /* CleanupHandle */ + NamedPipeRead, + NULL, + NULL, + NamedPipeWrite, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL }; static BOOL InitWinPRPipeModule() { @@ -505,8 +489,8 @@ BOOL CreatePipe(PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES lpP return FALSE; } - pReadPipe = (WINPR_PIPE*) calloc(1, sizeof(WINPR_PIPE)); - pWritePipe = (WINPR_PIPE*) calloc(1, sizeof(WINPR_PIPE)); + pReadPipe = (WINPR_PIPE*)calloc(1, sizeof(WINPR_PIPE)); + pWritePipe = (WINPR_PIPE*)calloc(1, sizeof(WINPR_PIPE)); if (!pReadPipe || !pWritePipe) { @@ -519,10 +503,10 @@ BOOL CreatePipe(PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES lpP pWritePipe->fd = pipe_fd[1]; WINPR_HANDLE_SET_TYPE_AND_MODE(pReadPipe, HANDLE_TYPE_ANONYMOUS_PIPE, WINPR_FD_READ); pReadPipe->ops = &ops; - *((ULONG_PTR*) hReadPipe) = (ULONG_PTR) pReadPipe; + *((ULONG_PTR*)hReadPipe) = (ULONG_PTR)pReadPipe; WINPR_HANDLE_SET_TYPE_AND_MODE(pWritePipe, HANDLE_TYPE_ANONYMOUS_PIPE, WINPR_FD_READ); pWritePipe->ops = &ops; - *((ULONG_PTR*) hWritePipe) = (ULONG_PTR) pWritePipe; + *((ULONG_PTR*)hWritePipe) = (ULONG_PTR)pWritePipe; return TRUE; } @@ -540,13 +524,13 @@ static void winpr_unref_named_pipe(WINPR_NAMED_PIPE* pNamedPipe) assert(pNamedPipe->name); assert(g_NamedPipeServerSockets); - //WLog_VRB(TAG, "%p (%s)", (void*) pNamedPipe, pNamedPipe->name); + // WLog_VRB(TAG, "%p (%s)", (void*) pNamedPipe, pNamedPipe->name); ArrayList_Lock(g_NamedPipeServerSockets); for (index = 0; index < ArrayList_Count(g_NamedPipeServerSockets); index++) { - baseSocket = (NamedPipeServerSocketEntry*) ArrayList_GetItem( - g_NamedPipeServerSockets, index); + baseSocket = + (NamedPipeServerSocketEntry*)ArrayList_GetItem(g_NamedPipeServerSockets, index); assert(baseSocket->name); if (!strcmp(baseSocket->name, pNamedPipe->name)) @@ -556,8 +540,8 @@ static void winpr_unref_named_pipe(WINPR_NAMED_PIPE* pNamedPipe) if (--baseSocket->references == 0) { - //WLog_DBG(TAG, "removing shared server socked resource"); - //WLog_DBG(TAG, "closing shared serverfd %d", baseSocket->serverfd); + // WLog_DBG(TAG, "removing shared server socked resource"); + // WLog_DBG(TAG, "closing shared serverfd %d", baseSocket->serverfd); ArrayList_Remove(g_NamedPipeServerSockets, baseSocket); close(baseSocket->serverfd); free(baseSocket->name); @@ -571,7 +555,6 @@ static void winpr_unref_named_pipe(WINPR_NAMED_PIPE* pNamedPipe) ArrayList_Unlock(g_NamedPipeServerSockets); } - HANDLE CreateNamedPipeA(LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes) @@ -596,7 +579,7 @@ HANDLE CreateNamedPipeA(LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD if (!InitWinPRPipeModule()) return INVALID_HANDLE_VALUE; - pNamedPipe = (WINPR_NAMED_PIPE*) calloc(1, sizeof(WINPR_NAMED_PIPE)); + pNamedPipe = (WINPR_NAMED_PIPE*)calloc(1, sizeof(WINPR_NAMED_PIPE)); if (!pNamedPipe) return INVALID_HANDLE_VALUE; @@ -628,13 +611,14 @@ HANDLE CreateNamedPipeA(LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD for (index = 0; index < ArrayList_Count(g_NamedPipeServerSockets); index++) { - baseSocket = (NamedPipeServerSocketEntry*) ArrayList_GetItem( - g_NamedPipeServerSockets, index); + baseSocket = + (NamedPipeServerSocketEntry*)ArrayList_GetItem(g_NamedPipeServerSockets, index); if (!strcmp(baseSocket->name, lpName)) { serverfd = baseSocket->serverfd; - //WLog_DBG(TAG, "using shared socked resource for pipe %p (%s)", (void*) pNamedPipe, lpName); + // WLog_DBG(TAG, "using shared socked resource for pipe %p (%s)", (void*) pNamedPipe, + // lpName); break; } } @@ -672,7 +656,7 @@ HANDLE CreateNamedPipeA(LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD s.sun_family = AF_UNIX; sprintf_s(s.sun_path, ARRAYSIZE(s.sun_path), "%s", pNamedPipe->lpFilePath); - if (bind(serverfd, (struct sockaddr*) &s, sizeof(struct sockaddr_un)) == -1) + if (bind(serverfd, (struct sockaddr*)&s, sizeof(struct sockaddr_un)) == -1) { WLog_ERR(TAG, "CreateNamedPipeA: bind error, %s", strerror(errno)); goto out; @@ -686,7 +670,7 @@ HANDLE CreateNamedPipeA(LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD UnixChangeFileMode(pNamedPipe->lpFilePath, 0xFFFF); - if (!(baseSocket = (NamedPipeServerSocketEntry*) malloc(sizeof(NamedPipeServerSocketEntry)))) + if (!(baseSocket = (NamedPipeServerSocketEntry*)malloc(sizeof(NamedPipeServerSocketEntry)))) goto out; if (!(baseSocket->name = _strdup(lpName))) @@ -704,11 +688,13 @@ HANDLE CreateNamedPipeA(LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD goto out; } - //WLog_DBG(TAG, "created shared socked resource for pipe %p (%s). base serverfd = %d", (void*) pNamedPipe, lpName, serverfd); + // WLog_DBG(TAG, "created shared socked resource for pipe %p (%s). base serverfd = %d", + // (void*) pNamedPipe, lpName, serverfd); } pNamedPipe->serverfd = dup(baseSocket->serverfd); - //WLog_DBG(TAG, "using serverfd %d (duplicated from %d)", pNamedPipe->serverfd, baseSocket->serverfd); + // WLog_DBG(TAG, "using serverfd %d (duplicated from %d)", pNamedPipe->serverfd, + // baseSocket->serverfd); pNamedPipe->pfnUnrefNamedPipe = winpr_unref_named_pipe; baseSocket->references++; @@ -761,13 +747,13 @@ BOOL ConnectNamedPipe(HANDLE hNamedPipe, LPOVERLAPPED lpOverlapped) if (!hNamedPipe) return FALSE; - pNamedPipe = (WINPR_NAMED_PIPE*) hNamedPipe; + pNamedPipe = (WINPR_NAMED_PIPE*)hNamedPipe; if (!(pNamedPipe->dwFlagsAndAttributes & FILE_FLAG_OVERLAPPED)) { length = sizeof(struct sockaddr_un); ZeroMemory(&s, sizeof(struct sockaddr_un)); - status = accept(pNamedPipe->serverfd, (struct sockaddr*) &s, &length); + status = accept(pNamedPipe->serverfd, (struct sockaddr*)&s, &length); if (status < 0) { @@ -789,8 +775,8 @@ BOOL ConnectNamedPipe(HANDLE hNamedPipe, LPOVERLAPPED lpOverlapped) pNamedPipe->lpOverlapped = lpOverlapped; /* synchronous behavior */ lpOverlapped->Internal = 2; - lpOverlapped->InternalHigh = (ULONG_PTR) 0; - lpOverlapped->Pointer = (PVOID) NULL; + lpOverlapped->InternalHigh = (ULONG_PTR)0; + lpOverlapped->Pointer = (PVOID)NULL; SetEvent(lpOverlapped->hEvent); } @@ -800,7 +786,7 @@ BOOL ConnectNamedPipe(HANDLE hNamedPipe, LPOVERLAPPED lpOverlapped) BOOL DisconnectNamedPipe(HANDLE hNamedPipe) { WINPR_NAMED_PIPE* pNamedPipe; - pNamedPipe = (WINPR_NAMED_PIPE*) hNamedPipe; + pNamedPipe = (WINPR_NAMED_PIPE*)hNamedPipe; if (pNamedPipe->clientfd != -1) { @@ -811,8 +797,8 @@ BOOL DisconnectNamedPipe(HANDLE hNamedPipe) return TRUE; } -BOOL PeekNamedPipe(HANDLE hNamedPipe, LPVOID lpBuffer, DWORD nBufferSize, - LPDWORD lpBytesRead, LPDWORD lpTotalBytesAvail, LPDWORD lpBytesLeftThisMessage) +BOOL PeekNamedPipe(HANDLE hNamedPipe, LPVOID lpBuffer, DWORD nBufferSize, LPDWORD lpBytesRead, + LPDWORD lpTotalBytesAvail, LPDWORD lpBytesLeftThisMessage) { WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -820,8 +806,8 @@ BOOL PeekNamedPipe(HANDLE hNamedPipe, LPVOID lpBuffer, DWORD nBufferSize, } BOOL TransactNamedPipe(HANDLE hNamedPipe, LPVOID lpInBuffer, DWORD nInBufferSize, - LPVOID lpOutBuffer, - DWORD nOutBufferSize, LPDWORD lpBytesRead, LPOVERLAPPED lpOverlapped) + LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesRead, + LPOVERLAPPED lpOverlapped) { WLog_ERR(TAG, "%s: Not implemented", __FUNCTION__); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -879,7 +865,7 @@ BOOL SetNamedPipeHandleState(HANDLE hNamedPipe, LPDWORD lpMode, LPDWORD lpMaxCol int fd; int flags; WINPR_NAMED_PIPE* pNamedPipe; - pNamedPipe = (WINPR_NAMED_PIPE*) hNamedPipe; + pNamedPipe = (WINPR_NAMED_PIPE*)hNamedPipe; if (lpMode) { diff --git a/winpr/libwinpr/pipe/pipe.h b/winpr/libwinpr/pipe/pipe.h index dca562fca..ddbfa3217 100644 --- a/winpr/libwinpr/pipe/pipe.h +++ b/winpr/libwinpr/pipe/pipe.h @@ -27,7 +27,6 @@ #include "../handle/handle.h" - struct winpr_pipe { WINPR_HANDLE_DEF(); @@ -38,7 +37,7 @@ typedef struct winpr_pipe WINPR_PIPE; typedef struct winpr_named_pipe WINPR_NAMED_PIPE; -typedef void(*fnUnrefNamedPipe)(WINPR_NAMED_PIPE* pNamedPipe); +typedef void (*fnUnrefNamedPipe)(WINPR_NAMED_PIPE* pNamedPipe); struct winpr_named_pipe { @@ -67,12 +66,10 @@ struct winpr_named_pipe BOOL winpr_destroy_named_pipe(WINPR_NAMED_PIPE* pNamedPipe); BOOL NamedPipeRead(PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, - LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped); + LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped); BOOL NamedPipeWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, - LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped); + LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped); #endif #endif /* WINPR_PIPE_PRIVATE_H */ - - diff --git a/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipe.c b/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipe.c index e89e9afff..9f813de44 100644 --- a/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipe.c +++ b/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipe.c @@ -14,7 +14,7 @@ #endif #include "../pipe.h" -#define PIPE_BUFFER_SIZE 32 +#define PIPE_BUFFER_SIZE 32 static HANDLE ReadyEvent; @@ -34,7 +34,8 @@ static DWORD WINAPI named_pipe_client_thread(LPVOID arg) DWORD lpNumberOfBytesRead; DWORD lpNumberOfBytesWritten; WaitForSingleObject(ReadyEvent, INFINITE); - hNamedPipe = CreateFile(lpszPipeNameMt, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); + hNamedPipe = + CreateFile(lpszPipeNameMt, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (hNamedPipe == INVALID_HANDLE_VALUE) { @@ -42,13 +43,13 @@ static DWORD WINAPI named_pipe_client_thread(LPVOID arg) goto out; } - if (!(lpReadBuffer = (BYTE*) malloc(PIPE_BUFFER_SIZE))) + if (!(lpReadBuffer = (BYTE*)malloc(PIPE_BUFFER_SIZE))) { printf("%s: Error allocating read buffer\n", __FUNCTION__); goto out; } - if (!(lpWriteBuffer = (BYTE*) malloc(PIPE_BUFFER_SIZE))) + if (!(lpWriteBuffer = (BYTE*)malloc(PIPE_BUFFER_SIZE))) { printf("%s: Error allocating write buffer\n", __FUNCTION__); goto out; @@ -58,8 +59,9 @@ static DWORD WINAPI named_pipe_client_thread(LPVOID arg) nNumberOfBytesToWrite = PIPE_BUFFER_SIZE; FillMemory(lpWriteBuffer, PIPE_BUFFER_SIZE, 0x59); - if (!WriteFile(hNamedPipe, lpWriteBuffer, nNumberOfBytesToWrite, &lpNumberOfBytesWritten, NULL) || - lpNumberOfBytesWritten != nNumberOfBytesToWrite) + if (!WriteFile(hNamedPipe, lpWriteBuffer, nNumberOfBytesToWrite, &lpNumberOfBytesWritten, + NULL) || + lpNumberOfBytesWritten != nNumberOfBytesToWrite) { printf("%s: Client NamedPipe WriteFile failure\n", __FUNCTION__); goto out; @@ -70,13 +72,13 @@ static DWORD WINAPI named_pipe_client_thread(LPVOID arg) ZeroMemory(lpReadBuffer, PIPE_BUFFER_SIZE); if (!ReadFile(hNamedPipe, lpReadBuffer, nNumberOfBytesToRead, &lpNumberOfBytesRead, NULL) || - lpNumberOfBytesRead != nNumberOfBytesToRead) + lpNumberOfBytesRead != nNumberOfBytesToRead) { printf("%s: Client NamedPipe ReadFile failure\n", __FUNCTION__); goto out; } - printf("Client ReadFile: %"PRIu32" bytes\n", lpNumberOfBytesRead); + printf("Client ReadFile: %" PRIu32 " bytes\n", lpNumberOfBytesRead); winpr_HexDump("pipe.test", WLOG_DEBUG, lpReadBuffer, lpNumberOfBytesRead); fSuccess = TRUE; out: @@ -102,9 +104,9 @@ static DWORD WINAPI named_pipe_server_thread(LPVOID arg) DWORD nNumberOfBytesToWrite; DWORD lpNumberOfBytesRead; DWORD lpNumberOfBytesWritten; - hNamedPipe = CreateNamedPipe(lpszPipeNameMt, - PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, - PIPE_UNLIMITED_INSTANCES, PIPE_BUFFER_SIZE, PIPE_BUFFER_SIZE, 0, NULL); + hNamedPipe = CreateNamedPipe( + lpszPipeNameMt, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, + PIPE_UNLIMITED_INSTANCES, PIPE_BUFFER_SIZE, PIPE_BUFFER_SIZE, 0, NULL); if (!hNamedPipe) { @@ -128,7 +130,8 @@ static DWORD WINAPI named_pipe_server_thread(LPVOID arg) * In this situation, there is a good connection between client and server, even though * the function returns zero. */ - fConnected = ConnectNamedPipe(hNamedPipe, NULL) ? TRUE : (GetLastError() == ERROR_PIPE_CONNECTED); + fConnected = + ConnectNamedPipe(hNamedPipe, NULL) ? TRUE : (GetLastError() == ERROR_PIPE_CONNECTED); if (!fConnected) { @@ -136,13 +139,13 @@ static DWORD WINAPI named_pipe_server_thread(LPVOID arg) goto out; } - if (!(lpReadBuffer = (BYTE*) calloc(1, PIPE_BUFFER_SIZE))) + if (!(lpReadBuffer = (BYTE*)calloc(1, PIPE_BUFFER_SIZE))) { printf("%s: Error allocating read buffer\n", __FUNCTION__); goto out; } - if (!(lpWriteBuffer = (BYTE*) malloc(PIPE_BUFFER_SIZE))) + if (!(lpWriteBuffer = (BYTE*)malloc(PIPE_BUFFER_SIZE))) { printf("%s: Error allocating write buffer\n", __FUNCTION__); goto out; @@ -152,20 +155,21 @@ static DWORD WINAPI named_pipe_server_thread(LPVOID arg) nNumberOfBytesToRead = PIPE_BUFFER_SIZE; if (!ReadFile(hNamedPipe, lpReadBuffer, nNumberOfBytesToRead, &lpNumberOfBytesRead, NULL) || - lpNumberOfBytesRead != nNumberOfBytesToRead) + lpNumberOfBytesRead != nNumberOfBytesToRead) { printf("%s: Server NamedPipe ReadFile failure\n", __FUNCTION__); goto out; } - printf("Server ReadFile: %"PRIu32" bytes\n", lpNumberOfBytesRead); + printf("Server ReadFile: %" PRIu32 " bytes\n", lpNumberOfBytesRead); winpr_HexDump("pipe.test", WLOG_DEBUG, lpReadBuffer, lpNumberOfBytesRead); lpNumberOfBytesWritten = 0; nNumberOfBytesToWrite = PIPE_BUFFER_SIZE; FillMemory(lpWriteBuffer, PIPE_BUFFER_SIZE, 0x45); - if (!WriteFile(hNamedPipe, lpWriteBuffer, nNumberOfBytesToWrite, &lpNumberOfBytesWritten, NULL) || - lpNumberOfBytesWritten != nNumberOfBytesToWrite) + if (!WriteFile(hNamedPipe, lpWriteBuffer, nNumberOfBytesToWrite, &lpNumberOfBytesWritten, + NULL) || + lpNumberOfBytesWritten != nNumberOfBytesToWrite) { printf("%s: Server NamedPipe WriteFile failure\n", __FUNCTION__); goto out; @@ -203,9 +207,10 @@ static DWORD WINAPI named_pipe_single_thread(LPVOID arg) for (i = 0; i < numPipes; i++) { - if (!(servers[i] = CreateNamedPipe(lpszPipeNameSt, - PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, - PIPE_UNLIMITED_INSTANCES, PIPE_BUFFER_SIZE, PIPE_BUFFER_SIZE, 0, NULL))) + if (!(servers[i] = CreateNamedPipe(lpszPipeNameSt, PIPE_ACCESS_DUPLEX, + PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, + PIPE_UNLIMITED_INSTANCES, PIPE_BUFFER_SIZE, + PIPE_BUFFER_SIZE, 0, NULL))) { printf("%s: CreateNamedPipe #%d failed\n", __FUNCTION__, i); goto out; @@ -220,29 +225,29 @@ static DWORD WINAPI named_pipe_single_thread(LPVOID arg) if (strcmp(lpszPipeNameSt, p->name)) { - printf("%s: Pipe name mismatch for pipe #%d ([%s] instead of [%s])\n", - __FUNCTION__, i, p->name, lpszPipeNameSt); + printf("%s: Pipe name mismatch for pipe #%d ([%s] instead of [%s])\n", __FUNCTION__, i, + p->name, lpszPipeNameSt); goto out; } if (p->clientfd != -1) { - printf("%s: Unexpected client fd value for pipe #%d (%d instead of -1)\n", - __FUNCTION__, i, p->clientfd); + printf("%s: Unexpected client fd value for pipe #%d (%d instead of -1)\n", __FUNCTION__, + i, p->clientfd); goto out; } if (p->serverfd < 1) { - printf("%s: Unexpected server fd value for pipe #%d (%d is not > 0)\n", - __FUNCTION__, i, p->serverfd); + printf("%s: Unexpected server fd value for pipe #%d (%d is not > 0)\n", __FUNCTION__, i, + p->serverfd); goto out; } if (p->ServerMode == FALSE) { - printf("%s: Unexpected ServerMode value for pipe #%d (0 instead of 1)\n", - __FUNCTION__, i); + printf("%s: Unexpected ServerMode value for pipe #%d (0 instead of 1)\n", __FUNCTION__, + i); goto out; } } @@ -252,8 +257,8 @@ static DWORD WINAPI named_pipe_single_thread(LPVOID arg) for (i = 0; i < numPipes; i++) { BOOL fConnected; - if ((clients[i] = CreateFile(lpszPipeNameSt, GENERIC_READ | GENERIC_WRITE, - 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE) + if ((clients[i] = CreateFile(lpszPipeNameSt, GENERIC_READ | GENERIC_WRITE, 0, NULL, + OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE) { printf("%s: CreateFile #%d failed\n", __FUNCTION__, i); goto out; @@ -267,11 +272,13 @@ static DWORD WINAPI named_pipe_single_thread(LPVOID arg) * In this situation, there is a good connection between client and server, even though * the function returns zero. */ - fConnected = ConnectNamedPipe(servers[i], NULL) ? TRUE : (GetLastError() == ERROR_PIPE_CONNECTED); + fConnected = + ConnectNamedPipe(servers[i], NULL) ? TRUE : (GetLastError() == ERROR_PIPE_CONNECTED); if (!fConnected) { - printf("%s: ConnectNamedPipe #%d failed. (%"PRIu32")\n", __FUNCTION__, i, GetLastError()); + printf("%s: ConnectNamedPipe #%d failed. (%" PRIu32 ")\n", __FUNCTION__, i, + GetLastError()); goto out; } } @@ -284,15 +291,15 @@ static DWORD WINAPI named_pipe_single_thread(LPVOID arg) if (p->clientfd < 1) { - printf("%s: Unexpected client fd value for pipe #%d (%d is not > 0)\n", - __FUNCTION__, i, p->clientfd); + printf("%s: Unexpected client fd value for pipe #%d (%d is not > 0)\n", __FUNCTION__, i, + p->clientfd); goto out; } if (p->ServerMode) { - printf("%s: Unexpected ServerMode value for pipe #%d (1 instead of 0)\n", - __FUNCTION__, i); + printf("%s: Unexpected ServerMode value for pipe #%d (1 instead of 0)\n", __FUNCTION__, + i); goto out; } } @@ -305,14 +312,13 @@ static DWORD WINAPI named_pipe_single_thread(LPVOID arg) sprintf_s(sndbuf, sizeof(sndbuf), "CLIENT->SERVER ON PIPE #%05d", i); if (!WriteFile(clients[i], sndbuf, sizeof(sndbuf), &dwWritten, NULL) || - dwWritten != sizeof(sndbuf)) + dwWritten != sizeof(sndbuf)) { - printf("%s: Error writing to client end of pipe #%d\n", __FUNCTION__, i); + printf("%s: Error writing to client end of pipe #%d\n", __FUNCTION__, i); goto out; } - if (!ReadFile(servers[i], rcvbuf, dwWritten, &dwRead, NULL) || - dwRead != dwWritten) + if (!ReadFile(servers[i], rcvbuf, dwWritten, &dwRead, NULL) || dwRead != dwWritten) { printf("%s: Error reading on server end of pipe #%d\n", __FUNCTION__, i); goto out; @@ -320,8 +326,7 @@ static DWORD WINAPI named_pipe_single_thread(LPVOID arg) if (memcmp(sndbuf, rcvbuf, sizeof(sndbuf))) { - printf("%s: Error data read on server end of pipe #%d is corrupted\n", - __FUNCTION__, i); + printf("%s: Error data read on server end of pipe #%d is corrupted\n", __FUNCTION__, i); goto out; } @@ -331,14 +336,13 @@ static DWORD WINAPI named_pipe_single_thread(LPVOID arg) sprintf_s(sndbuf, sizeof(sndbuf), "SERVER->CLIENT ON PIPE #%05d", i); if (!WriteFile(servers[i], sndbuf, sizeof(sndbuf), &dwWritten, NULL) || - dwWritten != sizeof(sndbuf)) + dwWritten != sizeof(sndbuf)) { printf("%s: Error writing to server end of pipe #%d\n", __FUNCTION__, i); goto out; } - if (!ReadFile(clients[i], rcvbuf, dwWritten, &dwRead, NULL) || - dwRead != dwWritten) + if (!ReadFile(clients[i], rcvbuf, dwWritten, &dwRead, NULL) || dwRead != dwWritten) { printf("%s: Error reading on client end of pipe #%d\n", __FUNCTION__, i); goto out; @@ -346,8 +350,7 @@ static DWORD WINAPI named_pipe_single_thread(LPVOID arg) if (memcmp(sndbuf, rcvbuf, sizeof(sndbuf))) { - printf("%s: Error data read on client end of pipe #%d is corrupted\n", - __FUNCTION__, i); + printf("%s: Error data read on client end of pipe #%d is corrupted\n", __FUNCTION__, i); goto out; } } @@ -362,13 +365,17 @@ static DWORD WINAPI named_pipe_single_thread(LPVOID arg) if (ReadFile(clients[i], rcvbuf, sizeof(rcvbuf), &dwRead, NULL)) { - printf("%s: Error ReadFile on client should have failed after DisconnectNamedPipe on server\n", __FUNCTION__); + printf( + "%s: Error ReadFile on client should have failed after DisconnectNamedPipe on server\n", + __FUNCTION__); goto out; } if (WriteFile(clients[i], sndbuf, sizeof(sndbuf), &dwWritten, NULL)) { - printf("%s: Error WriteFile on client end should have failed after DisconnectNamedPipe on server\n", __FUNCTION__); + printf("%s: Error WriteFile on client end should have failed after DisconnectNamedPipe on " + "server\n", + __FUNCTION__); goto out; } @@ -384,13 +391,15 @@ static DWORD WINAPI named_pipe_single_thread(LPVOID arg) if (ReadFile(clients[i], rcvbuf, sizeof(rcvbuf), &dwRead, NULL)) { - printf("%s: Error ReadFile on client end should have failed after CloseHandle on server\n", __FUNCTION__); + printf("%s: Error ReadFile on client end should have failed after CloseHandle on server\n", + __FUNCTION__); goto out; } if (WriteFile(clients[i], sndbuf, sizeof(sndbuf), &dwWritten, NULL)) { - printf("%s: Error WriteFile on client end should have failed after CloseHandle on server\n", __FUNCTION__); + printf("%s: Error WriteFile on client end should have failed after CloseHandle on server\n", + __FUNCTION__); goto out; } @@ -405,13 +414,15 @@ static DWORD WINAPI named_pipe_single_thread(LPVOID arg) if (ReadFile(servers[i], rcvbuf, sizeof(rcvbuf), &dwRead, NULL)) { - printf("%s: Error ReadFile on server end should have failed after CloseHandle on client\n", __FUNCTION__); + printf("%s: Error ReadFile on server end should have failed after CloseHandle on client\n", + __FUNCTION__); goto out; } if (WriteFile(servers[i], sndbuf, sizeof(sndbuf), &dwWritten, NULL)) { - printf("%s: Error WriteFile on server end should have failed after CloseHandle on client\n", __FUNCTION__); + printf("%s: Error WriteFile on server end should have failed after CloseHandle on client\n", + __FUNCTION__); goto out; } @@ -436,7 +447,6 @@ out: return 0; } - int TestPipeCreateNamedPipe(int argc, char* argv[]) { HANDLE SingleThread; @@ -449,7 +459,7 @@ int TestPipeCreateNamedPipe(int argc, char* argv[]) if (hPipe != INVALID_HANDLE_VALUE) { printf("CreateNamedPipe unexpectedly returned %p instead of INVALID_HANDLE_VALUE (%p)\n", - hPipe, INVALID_HANDLE_VALUE); + hPipe, INVALID_HANDLE_VALUE); return -1; } @@ -458,22 +468,22 @@ int TestPipeCreateNamedPipe(int argc, char* argv[]) #endif if (!(ReadyEvent = CreateEvent(NULL, TRUE, FALSE, NULL))) { - printf("CreateEvent failure: (%"PRIu32")\n", GetLastError()); + printf("CreateEvent failure: (%" PRIu32 ")\n", GetLastError()); return -1; } if (!(SingleThread = CreateThread(NULL, 0, named_pipe_single_thread, NULL, 0, NULL))) { - printf("CreateThread (SingleThread) failure: (%"PRIu32")\n", GetLastError()); + printf("CreateThread (SingleThread) failure: (%" PRIu32 ")\n", GetLastError()); return -1; } if (!(ClientThread = CreateThread(NULL, 0, named_pipe_client_thread, NULL, 0, NULL))) { - printf("CreateThread (ClientThread) failure: (%"PRIu32")\n", GetLastError()); + printf("CreateThread (ClientThread) failure: (%" PRIu32 ")\n", GetLastError()); return -1; } if (!(ServerThread = CreateThread(NULL, 0, named_pipe_server_thread, NULL, 0, NULL))) { - printf("CreateThread (ServerThread) failure: (%"PRIu32")\n", GetLastError()); + printf("CreateThread (ServerThread) failure: (%" PRIu32 ")\n", GetLastError()); return -1; } WaitForSingleObject(SingleThread, INFINITE); diff --git a/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipeOverlapped.c b/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipeOverlapped.c index 821889880..6c8d3be2e 100644 --- a/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipeOverlapped.c +++ b/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipeOverlapped.c @@ -10,8 +10,8 @@ #include #include -#define PIPE_BUFFER_SIZE 32 -#define PIPE_TIMEOUT_MS 20000 // 20 seconds +#define PIPE_BUFFER_SIZE 32 +#define PIPE_TIMEOUT_MS 20000 // 20 seconds static BYTE SERVER_MESSAGE[PIPE_BUFFER_SIZE]; static BYTE CLIENT_MESSAGE[PIPE_BUFFER_SIZE]; @@ -38,34 +38,31 @@ static DWORD WINAPI named_pipe_client_thread(LPVOID arg) status = WaitForSingleObject(serverReadyEvent, PIPE_TIMEOUT_MS); if (status != WAIT_OBJECT_0) { - printf("client: failed to wait for server ready event: %"PRIu32"\n", status); + printf("client: failed to wait for server ready event: %" PRIu32 "\n", status); goto finish; } - /* 1: initialize overlapped structure */ ZeroMemory(&overlapped, sizeof(OVERLAPPED)); if (!(hEvent = CreateEvent(NULL, TRUE, FALSE, NULL))) { - printf("client: CreateEvent failure: %"PRIu32"\n", GetLastError()); + printf("client: CreateEvent failure: %" PRIu32 "\n", GetLastError()); goto finish; } overlapped.hEvent = hEvent; - /* 2: connect to server named pipe */ - hNamedPipe = CreateFile(lpszPipeName, GENERIC_READ | GENERIC_WRITE, - 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); + hNamedPipe = CreateFile(lpszPipeName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, + FILE_FLAG_OVERLAPPED, NULL); if (hNamedPipe == INVALID_HANDLE_VALUE) { - printf("client: Named Pipe CreateFile failure: %"PRIu32"\n", GetLastError()); + printf("client: Named Pipe CreateFile failure: %" PRIu32 "\n", GetLastError()); goto finish; } - /* 3: write to named pipe */ nNumberOfBytesToWrite = PIPE_BUFFER_SIZE; @@ -78,25 +75,24 @@ static DWORD WINAPI named_pipe_client_thread(LPVOID arg) if (!fSuccess) { - printf("client: NamedPipe WriteFile failure (initial): %"PRIu32"\n", GetLastError()); + printf("client: NamedPipe WriteFile failure (initial): %" PRIu32 "\n", GetLastError()); goto finish; } status = WaitForSingleObject(hEvent, PIPE_TIMEOUT_MS); if (status != WAIT_OBJECT_0) { - printf("client: failed to wait for overlapped event (write): %"PRIu32"\n", status); + printf("client: failed to wait for overlapped event (write): %" PRIu32 "\n", status); goto finish; } fSuccess = GetOverlappedResult(hNamedPipe, &overlapped, &NumberOfBytesTransferred, FALSE); if (!fSuccess) { - printf("client: NamedPipe WriteFile failure (final): %"PRIu32"\n", GetLastError()); + printf("client: NamedPipe WriteFile failure (final): %" PRIu32 "\n", GetLastError()); goto finish; } - printf("client: WriteFile transferred %"PRIu32" bytes:\n", NumberOfBytesTransferred); - + printf("client: WriteFile transferred %" PRIu32 " bytes:\n", NumberOfBytesTransferred); /* 4: read from named pipe */ @@ -116,28 +112,29 @@ static DWORD WINAPI named_pipe_client_thread(LPVOID arg) if (!fSuccess) { - printf("client: NamedPipe ReadFile failure (initial): %"PRIu32"\n", GetLastError()); + printf("client: NamedPipe ReadFile failure (initial): %" PRIu32 "\n", GetLastError()); goto finish; } status = WaitForMultipleObjects(1, &hEvent, FALSE, PIPE_TIMEOUT_MS); if (status != WAIT_OBJECT_0) { - printf("client: failed to wait for overlapped event (read): %"PRIu32"\n", status); + printf("client: failed to wait for overlapped event (read): %" PRIu32 "\n", status); goto finish; } fSuccess = GetOverlappedResult(hNamedPipe, &overlapped, &NumberOfBytesTransferred, TRUE); if (!fSuccess) { - printf("client: NamedPipe ReadFile failure (final): %"PRIu32"\n", GetLastError()); + printf("client: NamedPipe ReadFile failure (final): %" PRIu32 "\n", GetLastError()); goto finish; } - printf("client: ReadFile transferred %"PRIu32" bytes:\n", NumberOfBytesTransferred); + printf("client: ReadFile transferred %" PRIu32 " bytes:\n", NumberOfBytesTransferred); winpr_HexDump("pipe.test", WLOG_DEBUG, lpReadBuffer, NumberOfBytesTransferred); - if (NumberOfBytesTransferred != PIPE_BUFFER_SIZE || memcmp(lpReadBuffer, SERVER_MESSAGE, PIPE_BUFFER_SIZE)) + if (NumberOfBytesTransferred != PIPE_BUFFER_SIZE || + memcmp(lpReadBuffer, SERVER_MESSAGE, PIPE_BUFFER_SIZE)) { printf("client: received unexpected data from server\n"); goto finish; @@ -174,22 +171,22 @@ static DWORD WINAPI named_pipe_server_thread(LPVOID arg) ZeroMemory(&overlapped, sizeof(OVERLAPPED)); if (!(hEvent = CreateEvent(NULL, TRUE, FALSE, NULL))) { - printf("server: CreateEvent failure: %"PRIu32"\n", GetLastError()); + printf("server: CreateEvent failure: %" PRIu32 "\n", GetLastError()); SetEvent(serverReadyEvent); /* unblock client thread */ goto finish; } overlapped.hEvent = hEvent; - /* 2: create named pipe and set ready event */ - hNamedPipe = CreateNamedPipe(lpszPipeName, - PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, - PIPE_UNLIMITED_INSTANCES, PIPE_BUFFER_SIZE, PIPE_BUFFER_SIZE, 0, NULL); + hNamedPipe = + CreateNamedPipe(lpszPipeName, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, + PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, + PIPE_BUFFER_SIZE, PIPE_BUFFER_SIZE, 0, NULL); if (hNamedPipe == INVALID_HANDLE_VALUE) { - printf("server: CreateNamedPipe failure: %"PRIu32"\n", GetLastError()); + printf("server: CreateNamedPipe failure: %" PRIu32 "\n", GetLastError()); SetEvent(serverReadyEvent); /* unblock client thread */ goto finish; } @@ -223,7 +220,7 @@ static DWORD WINAPI named_pipe_server_thread(LPVOID arg) if (!fConnected) fConnected = (status == ERROR_PIPE_CONNECTED); - printf("server: ConnectNamedPipe status: %"PRIu32"\n", status); + printf("server: ConnectNamedPipe status: %" PRIu32 "\n", status); if (!fConnected && status == ERROR_IO_PENDING) { @@ -233,18 +230,17 @@ static DWORD WINAPI named_pipe_server_thread(LPVOID arg) if (status == WAIT_OBJECT_0) fConnected = GetOverlappedResult(hNamedPipe, &overlapped, &dwDummy, FALSE); else - printf("server: failed to wait for overlapped event (connect): %"PRIu32"\n", status); + printf("server: failed to wait for overlapped event (connect): %" PRIu32 "\n", status); } if (!fConnected) { - printf("server: ConnectNamedPipe failed: %"PRIu32"\n", status); + printf("server: ConnectNamedPipe failed: %" PRIu32 "\n", status); goto finish; } printf("server: named pipe successfully connected\n"); - /* 4: read from named pipe */ if (!(lpReadBuffer = (BYTE*)calloc(1, PIPE_BUFFER_SIZE))) @@ -263,34 +259,34 @@ static DWORD WINAPI named_pipe_server_thread(LPVOID arg) if (!fSuccess) { - printf("server: NamedPipe ReadFile failure (initial): %"PRIu32"\n", GetLastError()); + printf("server: NamedPipe ReadFile failure (initial): %" PRIu32 "\n", GetLastError()); goto finish; } status = WaitForSingleObject(hEvent, PIPE_TIMEOUT_MS); if (status != WAIT_OBJECT_0) { - printf("server: failed to wait for overlapped event (read): %"PRIu32"\n", status); + printf("server: failed to wait for overlapped event (read): %" PRIu32 "\n", status); goto finish; } fSuccess = GetOverlappedResult(hNamedPipe, &overlapped, &NumberOfBytesTransferred, FALSE); if (!fSuccess) { - printf("server: NamedPipe ReadFile failure (final): %"PRIu32"\n", GetLastError()); + printf("server: NamedPipe ReadFile failure (final): %" PRIu32 "\n", GetLastError()); goto finish; } - printf("server: ReadFile transferred %"PRIu32" bytes:\n", NumberOfBytesTransferred); + printf("server: ReadFile transferred %" PRIu32 " bytes:\n", NumberOfBytesTransferred); winpr_HexDump("pipe.test", WLOG_DEBUG, lpReadBuffer, NumberOfBytesTransferred); - if (NumberOfBytesTransferred != PIPE_BUFFER_SIZE || memcmp(lpReadBuffer, CLIENT_MESSAGE, PIPE_BUFFER_SIZE)) + if (NumberOfBytesTransferred != PIPE_BUFFER_SIZE || + memcmp(lpReadBuffer, CLIENT_MESSAGE, PIPE_BUFFER_SIZE)) { printf("server: received unexpected data from client\n"); goto finish; } - /* 5: write to named pipe */ nNumberOfBytesToWrite = PIPE_BUFFER_SIZE; @@ -303,26 +299,26 @@ static DWORD WINAPI named_pipe_server_thread(LPVOID arg) if (!fSuccess) { - printf("server: NamedPipe WriteFile failure (initial): %"PRIu32"\n", GetLastError()); + printf("server: NamedPipe WriteFile failure (initial): %" PRIu32 "\n", GetLastError()); goto finish; } status = WaitForSingleObject(hEvent, PIPE_TIMEOUT_MS); if (status != WAIT_OBJECT_0) { - printf("server: failed to wait for overlapped event (write): %"PRIu32"\n", status); + printf("server: failed to wait for overlapped event (write): %" PRIu32 "\n", status); goto finish; } fSuccess = GetOverlappedResult(hNamedPipe, &overlapped, &NumberOfBytesTransferred, FALSE); if (!fSuccess) { - printf("server: NamedPipe WriteFile failure (final): %"PRIu32"\n", GetLastError()); + printf("server: NamedPipe WriteFile failure (final): %" PRIu32 "\n", GetLastError()); goto finish; } - printf("server: WriteFile transferred %"PRIu32" bytes:\n", NumberOfBytesTransferred); - //winpr_HexDump("pipe.test", WLOG_DEBUG, lpWriteBuffer, NumberOfBytesTransferred); + printf("server: WriteFile transferred %" PRIu32 " bytes:\n", NumberOfBytesTransferred); + // winpr_HexDump("pipe.test", WLOG_DEBUG, lpWriteBuffer, NumberOfBytesTransferred); bServerSuccess = TRUE; printf("server: finished successfully\n"); @@ -345,30 +341,29 @@ int TestPipeCreateNamedPipeOverlapped(int argc, char* argv[]) if (!(serverReadyEvent = CreateEvent(NULL, TRUE, FALSE, NULL))) { - printf("CreateEvent failed: %"PRIu32"\n", GetLastError()); + printf("CreateEvent failed: %" PRIu32 "\n", GetLastError()); goto out; } if (!(ClientThread = CreateThread(NULL, 0, named_pipe_client_thread, NULL, 0, NULL))) { - printf("CreateThread (client) failed: %"PRIu32"\n", GetLastError()); + printf("CreateThread (client) failed: %" PRIu32 "\n", GetLastError()); goto out; } - if (!(ServerThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) named_pipe_server_thread, NULL, 0, NULL))) + if (!(ServerThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)named_pipe_server_thread, + NULL, 0, NULL))) { - printf("CreateThread (server) failed: %"PRIu32"\n", GetLastError()); + printf("CreateThread (server) failed: %" PRIu32 "\n", GetLastError()); goto out; } if (WAIT_OBJECT_0 != WaitForSingleObject(ClientThread, INFINITE)) { - printf("%s: Failed to wait for client thread: %"PRIu32"\n", - __FUNCTION__, GetLastError()); + printf("%s: Failed to wait for client thread: %" PRIu32 "\n", __FUNCTION__, GetLastError()); goto out; } if (WAIT_OBJECT_0 != WaitForSingleObject(ServerThread, INFINITE)) { - printf("%s: Failed to wait for server thread: %"PRIu32"\n", - __FUNCTION__, GetLastError()); + printf("%s: Failed to wait for server thread: %" PRIu32 "\n", __FUNCTION__, GetLastError()); goto out; } @@ -381,13 +376,12 @@ out: if (result == 0) { printf("%s: Error, this test is currently expected not to succeed on this platform.\n", - __FUNCTION__); + __FUNCTION__); result = -1; } else { - printf("%s: This test is currently expected to fail on this platform.\n", - __FUNCTION__); + printf("%s: This test is currently expected to fail on this platform.\n", __FUNCTION__); result = 0; } #endif diff --git a/winpr/libwinpr/pipe/test/TestPipeCreatePipe.c b/winpr/libwinpr/pipe/test/TestPipeCreatePipe.c index 91af3e85a..a54e192e9 100644 --- a/winpr/libwinpr/pipe/test/TestPipeCreatePipe.c +++ b/winpr/libwinpr/pipe/test/TestPipeCreatePipe.c @@ -5,7 +5,7 @@ #include #include -#define BUFFER_SIZE 16 +#define BUFFER_SIZE 16 int TestPipeCreatePipe(int argc, char* argv[]) { @@ -36,8 +36,9 @@ int TestPipeCreatePipe(int argc, char* argv[]) if (dwWrite != sizeof(writeBuffer)) { - _tprintf(_T("WriteFile: unexpected number of bytes written: Actual: %")_T(PRIu32)_T(", Expected: %")_T(PRIuz)_T("\n"), - dwWrite, sizeof(writeBuffer)); + _tprintf(_T("WriteFile: unexpected number of bytes written: Actual: %") _T( + PRIu32) _T(", Expected: %") _T(PRIuz) _T("\n"), + dwWrite, sizeof(writeBuffer)); return -1; } @@ -52,8 +53,9 @@ int TestPipeCreatePipe(int argc, char* argv[]) if (dwRead != sizeof(readBuffer)) { - _tprintf(_T("ReadFile: unexpected number of bytes read: Actual: %")_T(PRIu32)_T(", Expected: %")_T(PRIuz)_T("\n"), - dwWrite, sizeof(readBuffer)); + _tprintf(_T("ReadFile: unexpected number of bytes read: Actual: %") _T( + PRIu32) _T(", Expected: %") _T(PRIuz) _T("\n"), + dwWrite, sizeof(readBuffer)); return -1; } diff --git a/winpr/libwinpr/pool/callback.c b/winpr/libwinpr/pool/callback.c index 630a78cec..2093149ac 100644 --- a/winpr/libwinpr/pool/callback.c +++ b/winpr/libwinpr/pool/callback.c @@ -29,9 +29,9 @@ #ifdef _WIN32 static INIT_ONCE init_once_module = INIT_ONCE_STATIC_INIT; -static BOOL (WINAPI * pCallbackMayRunLong)(PTP_CALLBACK_INSTANCE pci); +static BOOL(WINAPI* pCallbackMayRunLong)(PTP_CALLBACK_INSTANCE pci); -static BOOL CALLBACK init_module(PINIT_ONCE once, PVOID param, PVOID *context) +static BOOL CALLBACK init_module(PINIT_ONCE once, PVOID param, PVOID* context) { HMODULE kernel32 = LoadLibraryA("kernel32.dll"); if (kernel32) diff --git a/winpr/libwinpr/pool/callback_cleanup.c b/winpr/libwinpr/pool/callback_cleanup.c index 520b8ce12..d49a9e6bf 100644 --- a/winpr/libwinpr/pool/callback_cleanup.c +++ b/winpr/libwinpr/pool/callback_cleanup.c @@ -31,24 +31,32 @@ #ifdef _WIN32 static INIT_ONCE init_once_module = INIT_ONCE_STATIC_INIT; -static VOID (WINAPI * pSetEventWhenCallbackReturns)(PTP_CALLBACK_INSTANCE pci, HANDLE evt); -static VOID (WINAPI * pReleaseSemaphoreWhenCallbackReturns)(PTP_CALLBACK_INSTANCE pci, HANDLE sem, DWORD crel); -static VOID (WINAPI * pReleaseMutexWhenCallbackReturns)(PTP_CALLBACK_INSTANCE pci, HANDLE mut); -static VOID (WINAPI * pLeaveCriticalSectionWhenCallbackReturns)(PTP_CALLBACK_INSTANCE pci, PCRITICAL_SECTION pcs); -static VOID (WINAPI * pFreeLibraryWhenCallbackReturns)(PTP_CALLBACK_INSTANCE pci, HMODULE mod); -static VOID (WINAPI * pDisassociateCurrentThreadFromCallback)(PTP_CALLBACK_INSTANCE pci); +static VOID(WINAPI* pSetEventWhenCallbackReturns)(PTP_CALLBACK_INSTANCE pci, HANDLE evt); +static VOID(WINAPI* pReleaseSemaphoreWhenCallbackReturns)(PTP_CALLBACK_INSTANCE pci, HANDLE sem, + DWORD crel); +static VOID(WINAPI* pReleaseMutexWhenCallbackReturns)(PTP_CALLBACK_INSTANCE pci, HANDLE mut); +static VOID(WINAPI* pLeaveCriticalSectionWhenCallbackReturns)(PTP_CALLBACK_INSTANCE pci, + PCRITICAL_SECTION pcs); +static VOID(WINAPI* pFreeLibraryWhenCallbackReturns)(PTP_CALLBACK_INSTANCE pci, HMODULE mod); +static VOID(WINAPI* pDisassociateCurrentThreadFromCallback)(PTP_CALLBACK_INSTANCE pci); -static BOOL CALLBACK init_module(PINIT_ONCE once, PVOID param, PVOID *context) +static BOOL CALLBACK init_module(PINIT_ONCE once, PVOID param, PVOID* context) { HMODULE kernel32 = LoadLibraryA("kernel32.dll"); if (kernel32) { - pSetEventWhenCallbackReturns = (void*)GetProcAddress(kernel32, "SetEventWhenCallbackReturns"); - pReleaseSemaphoreWhenCallbackReturns = (void*)GetProcAddress(kernel32, "ReleaseSemaphoreWhenCallbackReturns"); - pReleaseMutexWhenCallbackReturns = (void*)GetProcAddress(kernel32, "ReleaseMutexWhenCallbackReturns"); - pLeaveCriticalSectionWhenCallbackReturns = (void*)GetProcAddress(kernel32, "LeaveCriticalSectionWhenCallbackReturns"); - pFreeLibraryWhenCallbackReturns = (void*)GetProcAddress(kernel32, "FreeLibraryWhenCallbackReturns"); - pDisassociateCurrentThreadFromCallback = (void*)GetProcAddress(kernel32, "DisassociateCurrentThreadFromCallback"); + pSetEventWhenCallbackReturns = + (void*)GetProcAddress(kernel32, "SetEventWhenCallbackReturns"); + pReleaseSemaphoreWhenCallbackReturns = + (void*)GetProcAddress(kernel32, "ReleaseSemaphoreWhenCallbackReturns"); + pReleaseMutexWhenCallbackReturns = + (void*)GetProcAddress(kernel32, "ReleaseMutexWhenCallbackReturns"); + pLeaveCriticalSectionWhenCallbackReturns = + (void*)GetProcAddress(kernel32, "LeaveCriticalSectionWhenCallbackReturns"); + pFreeLibraryWhenCallbackReturns = + (void*)GetProcAddress(kernel32, "FreeLibraryWhenCallbackReturns"); + pDisassociateCurrentThreadFromCallback = + (void*)GetProcAddress(kernel32, "DisassociateCurrentThreadFromCallback"); } return TRUE; } @@ -132,4 +140,3 @@ VOID DisassociateCurrentThreadFromCallback(PTP_CALLBACK_INSTANCE pci) } #endif /* WINPR_THREAD_POOL defined */ - diff --git a/winpr/libwinpr/pool/cleanup_group.c b/winpr/libwinpr/pool/cleanup_group.c index cf8eb2d79..86ab8f717 100644 --- a/winpr/libwinpr/pool/cleanup_group.c +++ b/winpr/libwinpr/pool/cleanup_group.c @@ -32,9 +32,10 @@ #ifdef _WIN32 static INIT_ONCE init_once_module = INIT_ONCE_STATIC_INIT; static PTP_CLEANUP_GROUP(WINAPI* pCreateThreadpoolCleanupGroup)(); -static VOID (WINAPI* pCloseThreadpoolCleanupGroupMembers)(PTP_CLEANUP_GROUP ptpcg, - BOOL fCancelPendingCallbacks, PVOID pvCleanupContext); -static VOID (WINAPI* pCloseThreadpoolCleanupGroup)(PTP_CLEANUP_GROUP ptpcg); +static VOID(WINAPI* pCloseThreadpoolCleanupGroupMembers)(PTP_CLEANUP_GROUP ptpcg, + BOOL fCancelPendingCallbacks, + PVOID pvCleanupContext); +static VOID(WINAPI* pCloseThreadpoolCleanupGroup)(PTP_CLEANUP_GROUP ptpcg); static BOOL CALLBACK init_module(PINIT_ONCE once, PVOID param, PVOID* context) { @@ -42,10 +43,12 @@ static BOOL CALLBACK init_module(PINIT_ONCE once, PVOID param, PVOID* context) if (kernel32) { - pCreateThreadpoolCleanupGroup = (void*)GetProcAddress(kernel32, "CreateThreadpoolCleanupGroup"); - pCloseThreadpoolCleanupGroupMembers = (void*)GetProcAddress(kernel32, - "CloseThreadpoolCleanupGroupMembers"); - pCloseThreadpoolCleanupGroup = (void*)GetProcAddress(kernel32, "CloseThreadpoolCleanupGroup"); + pCreateThreadpoolCleanupGroup = + (void*)GetProcAddress(kernel32, "CreateThreadpoolCleanupGroup"); + pCloseThreadpoolCleanupGroupMembers = + (void*)GetProcAddress(kernel32, "CloseThreadpoolCleanupGroupMembers"); + pCloseThreadpoolCleanupGroup = + (void*)GetProcAddress(kernel32, "CloseThreadpoolCleanupGroup"); } return TRUE; @@ -63,7 +66,7 @@ PTP_CLEANUP_GROUP winpr_CreateThreadpoolCleanupGroup(void) return cleanupGroup; #else - cleanupGroup = (PTP_CLEANUP_GROUP) calloc(1, sizeof(TP_CLEANUP_GROUP)); + cleanupGroup = (PTP_CLEANUP_GROUP)calloc(1, sizeof(TP_CLEANUP_GROUP)); if (!cleanupGroup) return NULL; @@ -81,7 +84,7 @@ PTP_CLEANUP_GROUP winpr_CreateThreadpoolCleanupGroup(void) } VOID winpr_SetThreadpoolCallbackCleanupGroup(PTP_CALLBACK_ENVIRON pcbe, PTP_CLEANUP_GROUP ptpcg, - PTP_CLEANUP_GROUP_CANCEL_CALLBACK pfng) + PTP_CLEANUP_GROUP_CANCEL_CALLBACK pfng) { pcbe->CleanupGroup = ptpcg; pcbe->CleanupGroupCancelCallback = pfng; @@ -91,7 +94,7 @@ VOID winpr_SetThreadpoolCallbackCleanupGroup(PTP_CALLBACK_ENVIRON pcbe, PTP_CLEA } VOID winpr_CloseThreadpoolCleanupGroupMembers(PTP_CLEANUP_GROUP ptpcg, BOOL fCancelPendingCallbacks, - PVOID pvCleanupContext) + PVOID pvCleanupContext) { #ifdef _WIN32 InitOnceExecuteOnce(&init_once_module, init_module, NULL, NULL); @@ -137,4 +140,3 @@ VOID winpr_CloseThreadpoolCleanupGroup(PTP_CLEANUP_GROUP ptpcg) } #endif /* WINPR_THREAD_POOL defined */ - diff --git a/winpr/libwinpr/pool/io.c b/winpr/libwinpr/pool/io.c index bb5e02a81..5ff259849 100644 --- a/winpr/libwinpr/pool/io.c +++ b/winpr/libwinpr/pool/io.c @@ -26,29 +26,26 @@ #ifdef WINPR_THREAD_POOL -PTP_IO winpr_CreateThreadpoolIo(HANDLE fl, PTP_WIN32_IO_CALLBACK pfnio, PVOID pv, PTP_CALLBACK_ENVIRON pcbe) +PTP_IO winpr_CreateThreadpoolIo(HANDLE fl, PTP_WIN32_IO_CALLBACK pfnio, PVOID pv, + PTP_CALLBACK_ENVIRON pcbe) { return NULL; } VOID winpr_CloseThreadpoolIo(PTP_IO pio) { - } VOID winpr_StartThreadpoolIo(PTP_IO pio) { - } VOID winpr_CancelThreadpoolIo(PTP_IO pio) { - } VOID winpr_WaitForThreadpoolIoCallbacks(PTP_IO pio, BOOL fCancelPendingCallbacks) { - } #endif diff --git a/winpr/libwinpr/pool/pool.c b/winpr/libwinpr/pool/pool.c index ac2df8922..e6c648554 100644 --- a/winpr/libwinpr/pool/pool.c +++ b/winpr/libwinpr/pool/pool.c @@ -31,12 +31,12 @@ #ifdef _WIN32 static INIT_ONCE init_once_module = INIT_ONCE_STATIC_INIT; -static PTP_POOL (WINAPI * pCreateThreadpool)(PVOID reserved); -static VOID (WINAPI * pCloseThreadpool)(PTP_POOL ptpp); -static BOOL (WINAPI * pSetThreadpoolThreadMinimum)(PTP_POOL ptpp, DWORD cthrdMic); -static VOID (WINAPI * pSetThreadpoolThreadMaximum)(PTP_POOL ptpp, DWORD cthrdMost); +static PTP_POOL(WINAPI* pCreateThreadpool)(PVOID reserved); +static VOID(WINAPI* pCloseThreadpool)(PTP_POOL ptpp); +static BOOL(WINAPI* pSetThreadpoolThreadMinimum)(PTP_POOL ptpp, DWORD cthrdMic); +static VOID(WINAPI* pSetThreadpoolThreadMaximum)(PTP_POOL ptpp, DWORD cthrdMost); -static BOOL CALLBACK init_module(PINIT_ONCE once, PVOID param, PVOID *context) +static BOOL CALLBACK init_module(PINIT_ONCE once, PVOID param, PVOID* context) { HMODULE kernel32 = LoadLibraryA("kernel32.dll"); if (kernel32) @@ -50,8 +50,7 @@ static BOOL CALLBACK init_module(PINIT_ONCE once, PVOID param, PVOID *context) } #endif -static TP_POOL DEFAULT_POOL = -{ +static TP_POOL DEFAULT_POOL = { 0, /* DWORD Minimum */ 500, /* DWORD Maximum */ NULL, /* wArrayList* Threads */ @@ -68,7 +67,7 @@ static DWORD WINAPI thread_pool_work_func(LPVOID arg) HANDLE events[2]; PTP_CALLBACK_INSTANCE callbackInstance; - pool = (PTP_POOL) arg; + pool = (PTP_POOL)arg; events[0] = pool->TerminateEvent; events[1] = Queue_Event(pool->PendingQueue); @@ -83,7 +82,7 @@ static DWORD WINAPI thread_pool_work_func(LPVOID arg) if (status != (WAIT_OBJECT_0 + 1)) break; - callbackInstance = (PTP_CALLBACK_INSTANCE) Queue_Dequeue(pool->PendingQueue); + callbackInstance = (PTP_CALLBACK_INSTANCE)Queue_Dequeue(pool->PendingQueue); if (callbackInstance) { @@ -98,7 +97,7 @@ static DWORD WINAPI thread_pool_work_func(LPVOID arg) return 0; } -static void threads_close(void *thread) +static void threads_close(void* thread) { WaitForSingleObject(thread, INFINITE); CloseHandle(thread); @@ -131,9 +130,7 @@ static BOOL InitializeThreadpool(PTP_POOL pool) for (index = 0; index < 4; index++) { - if (!(thread = CreateThread(NULL, 0, - thread_pool_work_func, - (void*) pool, 0, NULL))) + if (!(thread = CreateThread(NULL, 0, thread_pool_work_func, (void*)pool, 0, NULL))) { goto fail_create_threads; } @@ -182,7 +179,7 @@ PTP_POOL winpr_CreateThreadpool(PVOID reserved) if (pCreateThreadpool) return pCreateThreadpool(reserved); #endif - if (!(pool = (PTP_POOL) calloc(1, sizeof(TP_POOL)))) + if (!(pool = (PTP_POOL)calloc(1, sizeof(TP_POOL)))) return NULL; if (!InitializeThreadpool(pool)) @@ -236,9 +233,7 @@ BOOL winpr_SetThreadpoolThreadMinimum(PTP_POOL ptpp, DWORD cthrdMic) while (ArrayList_Count(ptpp->Threads) < (INT64)ptpp->Minimum) { - if (!(thread = CreateThread(NULL, 0, - thread_pool_work_func, - (void*) ptpp, 0, NULL))) + if (!(thread = CreateThread(NULL, 0, thread_pool_work_func, (void*)ptpp, 0, NULL))) { return FALSE; } diff --git a/winpr/libwinpr/pool/pool.h b/winpr/libwinpr/pool/pool.h index 6bf715391..af8641164 100644 --- a/winpr/libwinpr/pool/pool.h +++ b/winpr/libwinpr/pool/pool.h @@ -75,4 +75,3 @@ struct _TP_CLEANUP_GROUP PTP_POOL GetDefaultThreadpool(void); #endif /* WINPR_POOL_PRIVATE_H */ - diff --git a/winpr/libwinpr/pool/synch.c b/winpr/libwinpr/pool/synch.c index dc3f137ac..8fdb4d184 100644 --- a/winpr/libwinpr/pool/synch.c +++ b/winpr/libwinpr/pool/synch.c @@ -33,17 +33,14 @@ PTP_WAIT winpr_CreateThreadpoolWait(PTP_WAIT_CALLBACK pfnwa, PVOID pv, PTP_CALLB VOID winpr_CloseThreadpoolWait(PTP_WAIT pwa) { - } VOID winpr_SetThreadpoolWait(PTP_WAIT pwa, HANDLE h, PFILETIME pftTimeout) { - } VOID winpr_WaitForThreadpoolWaitCallbacks(PTP_WAIT pwa, BOOL fCancelPendingCallbacks) { - } #endif diff --git a/winpr/libwinpr/pool/test/TestPoolIO.c b/winpr/libwinpr/pool/test/TestPoolIO.c index 5e8d0b210..d68586ede 100644 --- a/winpr/libwinpr/pool/test/TestPoolIO.c +++ b/winpr/libwinpr/pool/test/TestPoolIO.c @@ -6,4 +6,3 @@ int TestPoolIO(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/pool/test/TestPoolSynch.c b/winpr/libwinpr/pool/test/TestPoolSynch.c index c0e9bc3e2..4d6f38199 100644 --- a/winpr/libwinpr/pool/test/TestPoolSynch.c +++ b/winpr/libwinpr/pool/test/TestPoolSynch.c @@ -6,4 +6,3 @@ int TestPoolSynch(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/pool/test/TestPoolTimer.c b/winpr/libwinpr/pool/test/TestPoolTimer.c index bfd5550d1..c749bc734 100644 --- a/winpr/libwinpr/pool/test/TestPoolTimer.c +++ b/winpr/libwinpr/pool/test/TestPoolTimer.c @@ -6,4 +6,3 @@ int TestPoolTimer(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/pool/test/TestPoolWork.c b/winpr/libwinpr/pool/test/TestPoolWork.c index 74ef711d3..05720b272 100644 --- a/winpr/libwinpr/pool/test/TestPoolWork.c +++ b/winpr/libwinpr/pool/test/TestPoolWork.c @@ -11,7 +11,7 @@ static void CALLBACK test_WorkCallback(PTP_CALLBACK_INSTANCE instance, void* con BYTE a[1024]; BYTE b[1024]; BYTE c[1024]; - printf("Hello %s: %03"PRId32" (thread: 0x%08"PRIX32")\n", (char*) context, + printf("Hello %s: %03" PRId32 " (thread: 0x%08" PRIX32 ")\n", (char*)context, InterlockedIncrement(&count), GetCurrentThreadId()); for (index = 0; index < 100; index++) @@ -40,8 +40,9 @@ static BOOL test1(void) } /** - * You can post a work object one or more times (up to MAXULONG) without waiting for prior callbacks to complete. - * The callbacks will execute in parallel. To improve efficiency, the thread pool may throttle the threads. + * You can post a work object one or more times (up to MAXULONG) without waiting for prior + * callbacks to complete. The callbacks will execute in parallel. To improve efficiency, the + * thread pool may throttle the threads. */ for (index = 0; index < 10; index++) @@ -107,11 +108,11 @@ fail: CloseThreadpoolCleanupGroup(cleanupGroup); DestroyThreadpoolEnvironment(&environment); /** - * See Remarks at https://msdn.microsoft.com/en-us/library/windows/desktop/ms682043(v=vs.85).aspx - * If there is a cleanup group associated with the work object, - * it is not necessary to call CloseThreadpoolWork ! - * calling the CloseThreadpoolCleanupGroupMembers function releases the work, wait, - * and timer objects associated with the cleanup group. + * See Remarks at + * https://msdn.microsoft.com/en-us/library/windows/desktop/ms682043(v=vs.85).aspx If there + * is a cleanup group associated with the work object, it is not necessary to call + * CloseThreadpoolWork ! calling the CloseThreadpoolCleanupGroupMembers function releases + * the work, wait, and timer objects associated with the cleanup group. */ #if 0 CloseThreadpoolWork(work); // this would segfault, see comment above. */ diff --git a/winpr/libwinpr/pool/timer.c b/winpr/libwinpr/pool/timer.c index 6e874ca9e..bdbaca6a2 100644 --- a/winpr/libwinpr/pool/timer.c +++ b/winpr/libwinpr/pool/timer.c @@ -33,7 +33,6 @@ PTP_TIMER winpr_CreateThreadpoolTimer(PTP_TIMER_CALLBACK pfnti, PVOID pv, PTP_CA VOID winpr_CloseThreadpoolTimer(PTP_TIMER pti) { - } BOOL winpr_IsThreadpoolTimerSet(PTP_TIMER pti) @@ -41,14 +40,13 @@ BOOL winpr_IsThreadpoolTimerSet(PTP_TIMER pti) return FALSE; } -VOID winpr_SetThreadpoolTimer(PTP_TIMER pti, PFILETIME pftDueTime, DWORD msPeriod, DWORD msWindowLength) +VOID winpr_SetThreadpoolTimer(PTP_TIMER pti, PFILETIME pftDueTime, DWORD msPeriod, + DWORD msWindowLength) { - } VOID winpr_WaitForThreadpoolTimerCallbacks(PTP_TIMER pti, BOOL fCancelPendingCallbacks) { - } #endif diff --git a/winpr/libwinpr/pool/work.c b/winpr/libwinpr/pool/work.c index 2cf53b48b..15d83ea8d 100644 --- a/winpr/libwinpr/pool/work.c +++ b/winpr/libwinpr/pool/work.c @@ -34,12 +34,12 @@ #ifdef _WIN32 static INIT_ONCE init_once_module = INIT_ONCE_STATIC_INIT; static PTP_WORK(WINAPI* pCreateThreadpoolWork)(PTP_WORK_CALLBACK pfnwk, PVOID pv, - PTP_CALLBACK_ENVIRON pcbe); -static VOID (WINAPI* pCloseThreadpoolWork)(PTP_WORK pwk); -static VOID (WINAPI* pSubmitThreadpoolWork)(PTP_WORK pwk); -static BOOL (WINAPI* pTrySubmitThreadpoolCallback)(PTP_SIMPLE_CALLBACK pfns, PVOID pv, - PTP_CALLBACK_ENVIRON pcbe); -static VOID (WINAPI* pWaitForThreadpoolWorkCallbacks)(PTP_WORK pwk, BOOL fCancelPendingCallbacks); + PTP_CALLBACK_ENVIRON pcbe); +static VOID(WINAPI* pCloseThreadpoolWork)(PTP_WORK pwk); +static VOID(WINAPI* pSubmitThreadpoolWork)(PTP_WORK pwk); +static BOOL(WINAPI* pTrySubmitThreadpoolCallback)(PTP_SIMPLE_CALLBACK pfns, PVOID pv, + PTP_CALLBACK_ENVIRON pcbe); +static VOID(WINAPI* pWaitForThreadpoolWorkCallbacks)(PTP_WORK pwk, BOOL fCancelPendingCallbacks); static BOOL CALLBACK init_module(PINIT_ONCE once, PVOID param, PVOID* context) { @@ -50,17 +50,18 @@ static BOOL CALLBACK init_module(PINIT_ONCE once, PVOID param, PVOID* context) pCreateThreadpoolWork = (void*)GetProcAddress(kernel32, "CreateThreadpoolWork"); pCloseThreadpoolWork = (void*)GetProcAddress(kernel32, "CloseThreadpoolWork"); pSubmitThreadpoolWork = (void*)GetProcAddress(kernel32, "SubmitThreadpoolWork"); - pTrySubmitThreadpoolCallback = (void*)GetProcAddress(kernel32, "TrySubmitThreadpoolCallback"); - pWaitForThreadpoolWorkCallbacks = (void*)GetProcAddress(kernel32, "WaitForThreadpoolWorkCallbacks"); + pTrySubmitThreadpoolCallback = + (void*)GetProcAddress(kernel32, "TrySubmitThreadpoolCallback"); + pWaitForThreadpoolWorkCallbacks = + (void*)GetProcAddress(kernel32, "WaitForThreadpoolWorkCallbacks"); } return TRUE; } #endif -static TP_CALLBACK_ENVIRON DEFAULT_CALLBACK_ENVIRONMENT = -{ - 1, /* Version */ +static TP_CALLBACK_ENVIRON DEFAULT_CALLBACK_ENVIRONMENT = { + 1, /* Version */ NULL, /* Pool */ NULL, /* CleanupGroup */ NULL, /* CleanupGroupCancelCallback */ @@ -80,7 +81,7 @@ PTP_WORK winpr_CreateThreadpoolWork(PTP_WORK_CALLBACK pfnwk, PVOID pv, PTP_CALLB return pCreateThreadpoolWork(pfnwk, pv, pcbe); #endif - work = (PTP_WORK) calloc(1, sizeof(TP_WORK)); + work = (PTP_WORK)calloc(1, sizeof(TP_WORK)); if (work) { @@ -139,7 +140,7 @@ VOID winpr_SubmitThreadpoolWork(PTP_WORK pwk) #endif pool = pwk->CallbackEnvironment->Pool; - callbackInstance = (PTP_CALLBACK_INSTANCE) calloc(1, sizeof(TP_CALLBACK_INSTANCE)); + callbackInstance = (PTP_CALLBACK_INSTANCE)calloc(1, sizeof(TP_CALLBACK_INSTANCE)); if (callbackInstance) { diff --git a/winpr/libwinpr/registry/registry.c b/winpr/libwinpr/registry/registry.c index 2583b0ccd..18331ee44 100644 --- a/winpr/libwinpr/registry/registry.c +++ b/winpr/libwinpr/registry/registry.c @@ -66,13 +66,15 @@ LONG RegCopyTreeA(HKEY hKeySrc, LPCSTR lpSubKey, HKEY hKeyDest) } LONG RegCreateKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD Reserved, LPWSTR lpClass, DWORD dwOptions, - REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition) + REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, + LPDWORD lpdwDisposition) { return 0; } LONG RegCreateKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD Reserved, LPSTR lpClass, DWORD dwOptions, - REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition) + REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, + LPDWORD lpdwDisposition) { return 0; } @@ -112,26 +114,26 @@ LONG RegDisablePredefinedCacheEx(void) return 0; } -LONG RegEnumKeyExW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, LPDWORD lpcName, - LPDWORD lpReserved, LPWSTR lpClass, LPDWORD lpcClass, PFILETIME lpftLastWriteTime) +LONG RegEnumKeyExW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, LPDWORD lpcName, LPDWORD lpReserved, + LPWSTR lpClass, LPDWORD lpcClass, PFILETIME lpftLastWriteTime) { return 0; } -LONG RegEnumKeyExA(HKEY hKey, DWORD dwIndex, LPSTR lpName, LPDWORD lpcName, - LPDWORD lpReserved, LPSTR lpClass, LPDWORD lpcClass, PFILETIME lpftLastWriteTime) +LONG RegEnumKeyExA(HKEY hKey, DWORD dwIndex, LPSTR lpName, LPDWORD lpcName, LPDWORD lpReserved, + LPSTR lpClass, LPDWORD lpcClass, PFILETIME lpftLastWriteTime) { return 0; } -LONG RegEnumValueW(HKEY hKey, DWORD dwIndex, LPWSTR lpValueName, - LPDWORD lpcchValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData) +LONG RegEnumValueW(HKEY hKey, DWORD dwIndex, LPWSTR lpValueName, LPDWORD lpcchValueName, + LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData) { return 0; } -LONG RegEnumValueA(HKEY hKey, DWORD dwIndex, LPSTR lpValueName, - LPDWORD lpcchValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData) +LONG RegEnumValueA(HKEY hKey, DWORD dwIndex, LPSTR lpValueName, LPDWORD lpcchValueName, + LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData) { return 0; } @@ -142,31 +144,31 @@ LONG RegFlushKey(HKEY hKey) } LONG RegGetKeySecurity(HKEY hKey, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor, LPDWORD lpcbSecurityDescriptor) + PSECURITY_DESCRIPTOR pSecurityDescriptor, LPDWORD lpcbSecurityDescriptor) { return 0; } -LONG RegGetValueW(HKEY hkey, LPCWSTR lpSubKey, LPCWSTR lpValue, - DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData) +LONG RegGetValueW(HKEY hkey, LPCWSTR lpSubKey, LPCWSTR lpValue, DWORD dwFlags, LPDWORD pdwType, + PVOID pvData, LPDWORD pcbData) { return 0; } -LONG RegGetValueA(HKEY hkey, LPCSTR lpSubKey, LPCSTR lpValue, - DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData) +LONG RegGetValueA(HKEY hkey, LPCSTR lpSubKey, LPCSTR lpValue, DWORD dwFlags, LPDWORD pdwType, + PVOID pvData, LPDWORD pcbData) { return 0; } -LONG RegLoadAppKeyW(LPCWSTR lpFile, PHKEY phkResult, - REGSAM samDesired, DWORD dwOptions, DWORD Reserved) +LONG RegLoadAppKeyW(LPCWSTR lpFile, PHKEY phkResult, REGSAM samDesired, DWORD dwOptions, + DWORD Reserved) { return 0; } -LONG RegLoadAppKeyA(LPCSTR lpFile, PHKEY phkResult, - REGSAM samDesired, DWORD dwOptions, DWORD Reserved) +LONG RegLoadAppKeyA(LPCSTR lpFile, PHKEY phkResult, REGSAM samDesired, DWORD dwOptions, + DWORD Reserved) { return 0; } @@ -181,19 +183,20 @@ LONG RegLoadKeyA(HKEY hKey, LPCSTR lpSubKey, LPCSTR lpFile) return 0; } -LONG RegLoadMUIStringW(HKEY hKey, LPCWSTR pszValue, LPWSTR pszOutBuf, - DWORD cbOutBuf, LPDWORD pcbData, DWORD Flags, LPCWSTR pszDirectory) +LONG RegLoadMUIStringW(HKEY hKey, LPCWSTR pszValue, LPWSTR pszOutBuf, DWORD cbOutBuf, + LPDWORD pcbData, DWORD Flags, LPCWSTR pszDirectory) { return 0; } -LONG RegLoadMUIStringA(HKEY hKey, LPCSTR pszValue, LPSTR pszOutBuf, - DWORD cbOutBuf, LPDWORD pcbData, DWORD Flags, LPCSTR pszDirectory) +LONG RegLoadMUIStringA(HKEY hKey, LPCSTR pszValue, LPSTR pszOutBuf, DWORD cbOutBuf, LPDWORD pcbData, + DWORD Flags, LPCSTR pszDirectory) { return 0; } -LONG RegNotifyChangeKeyValue(HKEY hKey, BOOL bWatchSubtree, DWORD dwNotifyFilter, HANDLE hEvent, BOOL fAsynchronous) +LONG RegNotifyChangeKeyValue(HKEY hKey, BOOL bWatchSubtree, DWORD dwNotifyFilter, HANDLE hEvent, + BOOL fAsynchronous) { return 0; } @@ -224,7 +227,7 @@ LONG RegOpenKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD ulOptions, REGSAM samDesire { if (_stricmp(pKey->subname, lpSubKey) == 0) { - *phkResult = (HKEY) pKey; + *phkResult = (HKEY)pKey; return ERROR_SUCCESS; } @@ -242,34 +245,34 @@ LONG RegOpenUserClassesRoot(HANDLE hToken, DWORD dwOptions, REGSAM samDesired, P } LONG RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, - LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, - LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, - LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime) + LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, + LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, + LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime) { return 0; } LONG RegQueryInfoKeyA(HKEY hKey, LPSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, - LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, - LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, - LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime) + LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, + LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, + LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime) { return 0; } -LONG RegQueryValueExW(HKEY hKey, LPCWSTR lpValueName, - LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData) +LONG RegQueryValueExW(HKEY hKey, LPCWSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, + LPBYTE lpData, LPDWORD lpcbData) { return ERROR_FILE_NOT_FOUND; } -LONG RegQueryValueExA(HKEY hKey, LPCSTR lpValueName, - LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData) +LONG RegQueryValueExA(HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, + LPBYTE lpData, LPDWORD lpcbData) { RegKey* key; RegVal* pValue; - key = (RegKey*) hKey; + key = (RegKey*)hKey; pValue = key->values; while (pValue != NULL) @@ -278,7 +281,7 @@ LONG RegQueryValueExA(HKEY hKey, LPCSTR lpValueName, { if (pValue->type == REG_DWORD) { - DWORD* pData = (DWORD*) lpData; + DWORD* pData = (DWORD*)lpData; if (pData != NULL) { @@ -292,7 +295,7 @@ LONG RegQueryValueExA(HKEY hKey, LPCSTR lpValueName, else if (pValue->type == REG_SZ) { size_t length; - char* pData = (char*) lpData; + char* pData = (char*)lpData; length = strnlen(pValue->data.string, UINT32_MAX); @@ -324,27 +327,32 @@ LONG RegRestoreKeyA(HKEY hKey, LPCSTR lpFile, DWORD dwFlags) return 0; } -LONG RegSaveKeyExW(HKEY hKey, LPCWSTR lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD Flags) +LONG RegSaveKeyExW(HKEY hKey, LPCWSTR lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes, + DWORD Flags) { return 0; } -LONG RegSaveKeyExA(HKEY hKey, LPCSTR lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD Flags) +LONG RegSaveKeyExA(HKEY hKey, LPCSTR lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes, + DWORD Flags) { return 0; } -LONG RegSetKeySecurity(HKEY hKey, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor) +LONG RegSetKeySecurity(HKEY hKey, SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor) { return 0; } -LONG RegSetValueExW(HKEY hKey, LPCWSTR lpValueName, DWORD Reserved, DWORD dwType, const BYTE* lpData, DWORD cbData) +LONG RegSetValueExW(HKEY hKey, LPCWSTR lpValueName, DWORD Reserved, DWORD dwType, + const BYTE* lpData, DWORD cbData) { return 0; } -LONG RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, const BYTE* lpData, DWORD cbData) +LONG RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, const BYTE* lpData, + DWORD cbData) { return 0; } diff --git a/winpr/libwinpr/registry/registry_reg.c b/winpr/libwinpr/registry/registry_reg.c index 498a44939..401cf399f 100644 --- a/winpr/libwinpr/registry/registry_reg.c +++ b/winpr/libwinpr/registry/registry_reg.c @@ -34,7 +34,7 @@ #include "../log.h" #define TAG WINPR_TAG("registry") -#define WINPR_HKLM_HIVE "/etc/winpr/HKLM.reg" +#define WINPR_HKLM_HIVE "/etc/winpr/HKLM.reg" static void reg_print_key(Reg* reg, RegKey* key); static void reg_print_value(Reg* reg, RegVal* value); @@ -46,35 +46,29 @@ struct reg_data_type DWORD type; }; -static struct reg_data_type REG_DATA_TYPE_TABLE[] = -{ - { "\"", 1, REG_SZ }, - { "dword:", 6, REG_DWORD }, - { "str:\"", 5, REG_SZ }, - { "str(2):\"", 8, REG_EXPAND_SZ }, - { "str(7):\"", 8, REG_MULTI_SZ }, - { "hex:", 4, REG_BINARY }, - { "hex(2):\"", 8, REG_EXPAND_SZ }, - { "hex(7):\"", 8, REG_MULTI_SZ }, - { "hex(b):\"", 8, REG_QWORD }, - { NULL, 0, 0 } -}; +static struct reg_data_type REG_DATA_TYPE_TABLE[] = { { "\"", 1, REG_SZ }, + { "dword:", 6, REG_DWORD }, + { "str:\"", 5, REG_SZ }, + { "str(2):\"", 8, REG_EXPAND_SZ }, + { "str(7):\"", 8, REG_MULTI_SZ }, + { "hex:", 4, REG_BINARY }, + { "hex(2):\"", 8, REG_EXPAND_SZ }, + { "hex(7):\"", 8, REG_MULTI_SZ }, + { "hex(b):\"", 8, REG_QWORD }, + { NULL, 0, 0 } }; -static char* REG_DATA_TYPE_STRINGS[] = -{ - "REG_NONE", - "REG_SZ", - "REG_EXPAND_SZ", - "REG_BINARY", - "REG_DWORD", - "REG_DWORD_BIG_ENDIAN", - "REG_LINK", - "REG_MULTI_SZ", - "REG_RESOURCE_LIST", - "REG_FULL_RESOURCE_DESCRIPTOR", - "REG_RESOURCE_REQUIREMENTS_LIST", - "REG_QWORD" -}; +static char* REG_DATA_TYPE_STRINGS[] = { "REG_NONE", + "REG_SZ", + "REG_EXPAND_SZ", + "REG_BINARY", + "REG_DWORD", + "REG_DWORD_BIG_ENDIAN", + "REG_LINK", + "REG_MULTI_SZ", + "REG_RESOURCE_LIST", + "REG_FULL_RESOURCE_DESCRIPTOR", + "REG_RESOURCE_REQUIREMENTS_LIST", + "REG_QWORD" }; static void reg_load_start(Reg* reg) { @@ -89,10 +83,10 @@ static void reg_load_start(Reg* reg) if (file_size < 1) return; - reg->buffer = (char*) malloc(file_size + 2); + reg->buffer = (char*)malloc(file_size + 2); if (!reg->buffer) - return ; + return; if (fread(reg->buffer, file_size, 1, reg->fp) != 1) { @@ -139,14 +133,14 @@ static RegVal* reg_load_value(Reg* reg, RegKey* key) data = p[3] + 1; length = p[1] - p[0]; - name = (char*) malloc(length + 1); + name = (char*)malloc(length + 1); if (!name) return NULL; memcpy(name, p[0], length); name[length] = '\0'; - value = (RegVal*) malloc(sizeof(RegVal)); + value = (RegVal*)malloc(sizeof(RegVal)); if (!value) { @@ -287,7 +281,7 @@ static RegKey* reg_load_key(Reg* reg, RegKey* key) RegKey* subkey; p[0] = reg->line + 1; p[1] = strrchr(p[0], ']'); - subkey = (RegKey*) malloc(sizeof(RegKey)); + subkey = (RegKey*)malloc(sizeof(RegKey)); if (!subkey) return NULL; @@ -295,7 +289,7 @@ static RegKey* reg_load_key(Reg* reg, RegKey* key) subkey->values = NULL; subkey->prev = subkey->next = NULL; length = p[1] - p[0]; - subkey->name = (char*) malloc(length + 1); + subkey->name = (char*)malloc(length + 1); if (!subkey->name) { @@ -413,7 +407,7 @@ void reg_unload(Reg* reg) Reg* reg_open(BOOL read_only) { Reg* reg; - reg = (Reg*) malloc(sizeof(Reg)); + reg = (Reg*)malloc(sizeof(Reg)); if (!reg) return NULL; @@ -439,7 +433,7 @@ Reg* reg_open(BOOL read_only) return NULL; } - reg->root_key = (RegKey*) malloc(sizeof(RegKey)); + reg->root_key = (RegKey*)malloc(sizeof(RegKey)); if (!reg->root_key) { @@ -471,7 +465,7 @@ void reg_print_value(Reg* reg, RegVal* value) if (value->type == REG_DWORD) { - WLog_INFO(TAG, "dword:%08"PRIX32"", value->data.dword); + WLog_INFO(TAG, "dword:%08" PRIX32 "", value->data.dword); } else if (value->type == REG_SZ) { diff --git a/winpr/libwinpr/registry/registry_reg.h b/winpr/libwinpr/registry/registry_reg.h index 0c07e5c7a..90db136b4 100644 --- a/winpr/libwinpr/registry/registry_reg.h +++ b/winpr/libwinpr/registry/registry_reg.h @@ -44,8 +44,7 @@ struct _reg_val RegVal* prev; RegVal* next; - union reg_data - { + union reg_data { DWORD dword; char* string; } data; @@ -64,6 +63,6 @@ struct _reg_key }; Reg* reg_open(BOOL read_only); -void reg_close(Reg *reg); +void reg_close(Reg* reg); #endif diff --git a/winpr/libwinpr/rpc/midl.c b/winpr/libwinpr/rpc/midl.c index 51116a68b..6ff8e8979 100644 --- a/winpr/libwinpr/rpc/midl.c +++ b/winpr/libwinpr/rpc/midl.c @@ -30,7 +30,7 @@ void* MIDL_user_allocate(size_t cBytes) { - return (malloc(cBytes)); + return (malloc(cBytes)); } void MIDL_user_free(void* p) diff --git a/winpr/libwinpr/rpc/ndr.c b/winpr/libwinpr/rpc/ndr.c index f68c8c234..6108cee42 100644 --- a/winpr/libwinpr/rpc/ndr.c +++ b/winpr/libwinpr/rpc/ndr.c @@ -86,7 +86,8 @@ void NdrPrintParamAttributes(PARAM_ATTRIBUTES attributes) WLog_INFO(TAG, "MustSize, "); } -void NdrProcessParam(PMIDL_STUB_MESSAGE pStubMsg, NDR_PHASE phase, unsigned char* pMemory, NDR_PARAM* param) +void NdrProcessParam(PMIDL_STUB_MESSAGE pStubMsg, NDR_PHASE phase, unsigned char* pMemory, + NDR_PARAM* param) { unsigned char type; PFORMAT_STRING pFormat; @@ -98,14 +99,14 @@ void NdrProcessParam(PMIDL_STUB_MESSAGE pStubMsg, NDR_PHASE phase, unsigned char pFormat = ¶m->Type.FormatChar; if (param->Attributes.IsSimpleRef) - pMemory = *(unsigned char**) pMemory; + pMemory = *(unsigned char**)pMemory; } else { pFormat = &pStubMsg->StubDesc->pFormatTypes[param->Type.Offset]; if (!(param->Attributes.IsByValue)) - pMemory = *(unsigned char**) pMemory; + pMemory = *(unsigned char**)pMemory; } type = (pFormat[0] & 0x7F); @@ -143,14 +144,15 @@ void NdrProcessParam(PMIDL_STUB_MESSAGE pStubMsg, NDR_PHASE phase, unsigned char } } -void NdrProcessParams(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, NDR_PHASE phase, void** fpuArgs, unsigned short numberParams) +void NdrProcessParams(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, NDR_PHASE phase, + void** fpuArgs, unsigned short numberParams) { unsigned int i; NDR_PARAM* params; PFORMAT_STRING fmt; unsigned char* arg; unsigned char type; - params = (NDR_PARAM*) pFormat; + params = (NDR_PARAM*)pFormat; WLog_INFO(TAG, "Params = "); for (i = 0; i < numberParams; i++) @@ -159,15 +161,14 @@ void NdrProcessParams(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, NDR_P float tmp; #endif arg = pStubMsg->StackTop + params[i].StackOffset; - fmt = (PFORMAT_STRING) &pStubMsg->StubDesc->pFormatTypes[params[i].Type.Offset]; + fmt = (PFORMAT_STRING)&pStubMsg->StubDesc->pFormatTypes[params[i].Type.Offset]; #ifdef __x86_64__ - if ((params[i].Attributes.IsBasetype) && - !(params[i].Attributes.IsSimpleRef) && - ((params[i].Type.FormatChar) == FC_FLOAT) && !fpuArgs) + if ((params[i].Attributes.IsBasetype) && !(params[i].Attributes.IsSimpleRef) && + ((params[i].Type.FormatChar) == FC_FLOAT) && !fpuArgs) { - tmp = *(double*) arg; - arg = (unsigned char*) &tmp; + tmp = *(double*)arg; + arg = (unsigned char*)&tmp; } #endif @@ -183,7 +184,7 @@ void NdrProcessParams(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, NDR_P } void NdrClientInitializeNew(PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE pStubMsg, - PMIDL_STUB_DESC pStubDesc, unsigned int ProcNum) + PMIDL_STUB_DESC pStubDesc, unsigned int ProcNum) { pRpcMessage->Handle = NULL; pRpcMessage->RpcFlags = 0; @@ -243,7 +244,8 @@ void NdrPrintExtFlags(INTERPRETER_OPT_FLAGS2 extFlags) WLog_INFO(TAG, "HasNotify2, "); } -CLIENT_CALL_RETURN NdrClientCall(PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, void** stackTop, void** fpuStack) +CLIENT_CALL_RETURN NdrClientCall(PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, + void** stackTop, void** fpuStack) { RPC_MESSAGE rpcMsg; unsigned short procNum; @@ -257,7 +259,7 @@ CLIENT_CALL_RETURN NdrClientCall(PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING NDR_OI2_PROC_HEADER* oi2ProcHeader; CLIENT_CALL_RETURN client_call_return; procNum = stackSize = numberParams = 0; - procHeader = (NDR_PROC_HEADER*) &pFormat[0]; + procHeader = (NDR_PROC_HEADER*)&pFormat[0]; client_call_return.Pointer = NULL; handleType = procHeader->HandleType; flags = procHeader->OldOiFlags; @@ -265,34 +267,34 @@ CLIENT_CALL_RETURN NdrClientCall(PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING stackSize = procHeader->StackSize; pFormat += sizeof(NDR_PROC_HEADER); /* The Header: http://msdn.microsoft.com/en-us/library/windows/desktop/aa378707/ */ - /* Procedure Header Descriptor: http://msdn.microsoft.com/en-us/library/windows/desktop/aa374387/ */ + /* Procedure Header Descriptor: + * http://msdn.microsoft.com/en-us/library/windows/desktop/aa374387/ */ /* Handles: http://msdn.microsoft.com/en-us/library/windows/desktop/aa373932/ */ WLog_DBG(TAG, "Oi Header: HandleType: 0x%02X OiFlags: 0x%02X ProcNum: %hu StackSize: 0x%04X", - handleType, *((unsigned char*) &flags), - procNum, stackSize); + handleType, *((unsigned char*)&flags), procNum, stackSize); if (handleType > 0) { /* implicit handle */ WLog_INFO(TAG, "Implicit Handle"); - oi2ProcHeader = (NDR_OI2_PROC_HEADER*) &pFormat[0]; + oi2ProcHeader = (NDR_OI2_PROC_HEADER*)&pFormat[0]; pFormat += sizeof(NDR_OI2_PROC_HEADER); } else { /* explicit handle */ WLog_INFO(TAG, "Explicit Handle"); - oi2ProcHeader = (NDR_OI2_PROC_HEADER*) &pFormat[6]; + oi2ProcHeader = (NDR_OI2_PROC_HEADER*)&pFormat[6]; pFormat += sizeof(NDR_OI2_PROC_HEADER) + 6; } optFlags = oi2ProcHeader->Oi2Flags; numberParams = oi2ProcHeader->NumberParams; - WLog_DBG(TAG, "Oi2 Header: Oi2Flags: 0x%02X, NumberParams: %u ClientBufferSize: %hu ServerBufferSize: %hu", - *((unsigned char*) &optFlags), - numberParams, - oi2ProcHeader->ClientBufferSize, - oi2ProcHeader->ServerBufferSize); + WLog_DBG(TAG, + "Oi2 Header: Oi2Flags: 0x%02X, NumberParams: %u ClientBufferSize: %hu " + "ServerBufferSize: %hu", + *((unsigned char*)&optFlags), numberParams, oi2ProcHeader->ClientBufferSize, + oi2ProcHeader->ServerBufferSize); WLog_INFO(TAG, "Oi2Flags: "); NdrPrintOptFlags(optFlags); NdrClientInitializeNew(&rpcMsg, &stubMsg, pStubDescriptor, procNum); @@ -300,11 +302,11 @@ CLIENT_CALL_RETURN NdrClientCall(PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING if (optFlags.HasExtensions) { INTERPRETER_OPT_FLAGS2 extFlags; - NDR_PROC_HEADER_EXTS* extensions = (NDR_PROC_HEADER_EXTS*) pFormat; + NDR_PROC_HEADER_EXTS* extensions = (NDR_PROC_HEADER_EXTS*)pFormat; pFormat += extensions->Size; extFlags = extensions->Flags2; - WLog_DBG(TAG, "Extensions: Size: %hhu, flags2: 0x%02X", - extensions->Size, *((unsigned char*) &extensions->Flags2)); + WLog_DBG(TAG, "Extensions: Size: %hhu, flags2: 0x%02X", extensions->Size, + *((unsigned char*)&extensions->Flags2)); #ifdef __x86_64__ if (extensions->Size > sizeof(*extensions) && fpuStack) @@ -317,11 +319,11 @@ CLIENT_CALL_RETURN NdrClientCall(PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING switch (fpuMask & 3) { case 1: - *(float*) &stackTop[i] = *(float*) &fpuStack[i]; + *(float*)&stackTop[i] = *(float*)&fpuStack[i]; break; case 2: - *(double*) &stackTop[i] = *(double*) &fpuStack[i]; + *(double*)&stackTop[i] = *(double*)&fpuStack[i]; break; } } @@ -332,9 +334,9 @@ CLIENT_CALL_RETURN NdrClientCall(PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING NdrPrintExtFlags(extFlags); } - stubMsg.StackTop = (unsigned char*) stackTop; + stubMsg.StackTop = (unsigned char*)stackTop; NdrProcessParams(&stubMsg, pFormat, NDR_PHASE_SIZE, fpuStack, numberParams); - WLog_DBG(TAG, "stubMsg BufferLength: %"PRIu32"", stubMsg.BufferLength); + WLog_DBG(TAG, "stubMsg BufferLength: %" PRIu32 "", stubMsg.BufferLength); return client_call_return; } diff --git a/winpr/libwinpr/rpc/ndr_array.c b/winpr/libwinpr/rpc/ndr_array.c index 496726189..df00b8ee6 100644 --- a/winpr/libwinpr/rpc/ndr_array.c +++ b/winpr/libwinpr/rpc/ndr_array.c @@ -31,7 +31,8 @@ #ifndef _WIN32 -void NdrConformantArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +void NdrConformantArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { /** * FC_CARRAY @@ -47,7 +48,7 @@ void NdrConformantArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pM unsigned short element_size; type = pFormat[0]; alignment = pFormat[1] + 1; - element_size = *(unsigned short*) &pFormat[2]; + element_size = *(unsigned short*)&pFormat[2]; if (type != FC_CARRAY) { @@ -58,7 +59,8 @@ void NdrConformantArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pM WLog_ERR(TAG, "warning: NdrConformantArrayBufferSize unimplemented"); } -void NdrConformantVaryingArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +void NdrConformantVaryingArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { /** * FC_CVARRAY @@ -73,7 +75,8 @@ void NdrConformantVaryingArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned c WLog_ERR(TAG, "warning: NdrConformantVaryingArrayBufferSize unimplemented"); } -void NdrFixedArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +void NdrFixedArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { /** * FC_SMFARRAY @@ -94,7 +97,8 @@ void NdrFixedArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory WLog_ERR(TAG, "warning: NdrFixedArrayBufferSize unimplemented"); } -void NdrVaryingArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +void NdrVaryingArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { /** * FC_SMVARRAY @@ -121,7 +125,8 @@ void NdrVaryingArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemo WLog_ERR(TAG, "warning: NdrVaryingArrayBufferSize unimplemented"); } -void NdrComplexArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +void NdrComplexArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { /** * FC_BOGUS_ARRAY diff --git a/winpr/libwinpr/rpc/ndr_array.h b/winpr/libwinpr/rpc/ndr_array.h index e29629717..be092c97b 100644 --- a/winpr/libwinpr/rpc/ndr_array.h +++ b/winpr/libwinpr/rpc/ndr_array.h @@ -24,11 +24,16 @@ #ifndef _WIN32 -void NdrConformantArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); -void NdrConformantVaryingArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); -void NdrFixedArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); -void NdrVaryingArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); -void NdrComplexArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); +void NdrConformantArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); +void NdrConformantVaryingArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); +void NdrFixedArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); +void NdrVaryingArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); +void NdrComplexArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); #endif diff --git a/winpr/libwinpr/rpc/ndr_context.c b/winpr/libwinpr/rpc/ndr_context.c index 4a33abc63..101013879 100644 --- a/winpr/libwinpr/rpc/ndr_context.c +++ b/winpr/libwinpr/rpc/ndr_context.c @@ -34,7 +34,8 @@ #include "../log.h" #define TAG WINPR_TAG("rpc") -void NdrContextHandleBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +void NdrContextHandleBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { unsigned char type = *pFormat; diff --git a/winpr/libwinpr/rpc/ndr_context.h b/winpr/libwinpr/rpc/ndr_context.h index 95b74b290..cfad5bd6e 100644 --- a/winpr/libwinpr/rpc/ndr_context.h +++ b/winpr/libwinpr/rpc/ndr_context.h @@ -24,7 +24,8 @@ #ifndef _WIN32 -void NdrContextHandleBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); +void NdrContextHandleBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); #endif diff --git a/winpr/libwinpr/rpc/ndr_correlation.c b/winpr/libwinpr/rpc/ndr_correlation.c index 1fb4f71e5..1330a0dfa 100644 --- a/winpr/libwinpr/rpc/ndr_correlation.c +++ b/winpr/libwinpr/rpc/ndr_correlation.c @@ -41,7 +41,8 @@ * */ -PFORMAT_STRING NdrpComputeCount(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat, ULONG_PTR* pCount) +PFORMAT_STRING NdrpComputeCount(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat, ULONG_PTR* pCount) { LPVOID ptr = NULL; ULONG_PTR data = 0; @@ -54,7 +55,7 @@ PFORMAT_STRING NdrpComputeCount(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMem type = correlation_type & 0x0F; conformance = correlation_type & 0xF0; correlation_operator = pFormat[1]; - offset = *(unsigned short*) & pFormat[2]; + offset = *(unsigned short*)&pFormat[2]; if (conformance == FC_NORMAL_CONFORMANCE) { @@ -70,7 +71,7 @@ PFORMAT_STRING NdrpComputeCount(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMem } else if (conformance == FC_CONSTANT_CONFORMANCE) { - data = offset | ((DWORD) pFormat[1] << 16); + data = offset | ((DWORD)pFormat[1] << 16); *pCount = data; } else if (conformance == FC_TOP_LEVEL_MULTID_CONFORMANCE) @@ -87,30 +88,30 @@ PFORMAT_STRING NdrpComputeCount(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMem if (!ptr) return pFormat; - ptr = *(LPVOID*)((char*) ptr + offset); + ptr = *(LPVOID*)((char*)ptr + offset); break; case FC_DIV_2: - ptr = (char*) ptr + offset; + ptr = (char*)ptr + offset; break; case FC_MULT_2: - ptr = (char*) ptr + offset; + ptr = (char*)ptr + offset; break; case FC_SUB_1: - ptr = (char*) ptr + offset; + ptr = (char*)ptr + offset; break; case FC_ADD_1: - ptr = (char*) ptr + offset; + ptr = (char*)ptr + offset; break; case FC_CALLBACK: - { - WLog_ERR(TAG, "warning: NdrpComputeConformance FC_CALLBACK unimplemented"); - } - break; + { + WLog_ERR(TAG, "warning: NdrpComputeConformance FC_CALLBACK unimplemented"); + } + break; } if (!ptr) @@ -119,33 +120,33 @@ PFORMAT_STRING NdrpComputeCount(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMem switch (type) { case FC_LONG: - data = *(LONG*) ptr; + data = *(LONG*)ptr; break; case FC_ULONG: - data = *(ULONG*) ptr; + data = *(ULONG*)ptr; break; case FC_SHORT: - data = *(SHORT*) ptr; + data = *(SHORT*)ptr; break; case FC_USHORT: - data = *(USHORT*) ptr; + data = *(USHORT*)ptr; break; case FC_CHAR: case FC_SMALL: - data = *(CHAR*) ptr; + data = *(CHAR*)ptr; break; case FC_BYTE: case FC_USMALL: - data = *(BYTE*) ptr; + data = *(BYTE*)ptr; break; case FC_HYPER: - data = (ULONG_PTR) *(ULONGLONG*) ptr; + data = (ULONG_PTR) * (ULONGLONG*)ptr; break; } @@ -184,16 +185,18 @@ PFORMAT_STRING NdrpComputeCount(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMem return pFormat; } -PFORMAT_STRING NdrpComputeConformance(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +PFORMAT_STRING NdrpComputeConformance(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { return NdrpComputeCount(pStubMsg, pMemory, pFormat, &pStubMsg->MaxCount); } -PFORMAT_STRING NdrpComputeVariance(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +PFORMAT_STRING NdrpComputeVariance(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { ULONG_PTR ActualCount = pStubMsg->ActualCount; pFormat = NdrpComputeCount(pStubMsg, pMemory, pFormat, &ActualCount); - pStubMsg->ActualCount = (ULONG) ActualCount; + pStubMsg->ActualCount = (ULONG)ActualCount; return pFormat; } diff --git a/winpr/libwinpr/rpc/ndr_correlation.h b/winpr/libwinpr/rpc/ndr_correlation.h index 03f47b88f..701ae8a4b 100644 --- a/winpr/libwinpr/rpc/ndr_correlation.h +++ b/winpr/libwinpr/rpc/ndr_correlation.h @@ -24,9 +24,12 @@ #ifndef _WIN32 -PFORMAT_STRING NdrpComputeCount(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat, ULONG_PTR* pCount); -PFORMAT_STRING NdrpComputeConformance(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); -PFORMAT_STRING NdrpComputeVariance(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); +PFORMAT_STRING NdrpComputeCount(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat, ULONG_PTR* pCount); +PFORMAT_STRING NdrpComputeConformance(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); +PFORMAT_STRING NdrpComputeVariance(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); #endif diff --git a/winpr/libwinpr/rpc/ndr_pointer.c b/winpr/libwinpr/rpc/ndr_pointer.c index dbfdaee03..0c3c0c0ef 100644 --- a/winpr/libwinpr/rpc/ndr_pointer.c +++ b/winpr/libwinpr/rpc/ndr_pointer.c @@ -77,7 +77,7 @@ PFORMAT_STRING NdrpSkipPointerLayout(PFORMAT_STRING pFormat) * { pointer_instance<8> }* */ pFormat += 8; - number_of_pointers = *(unsigned short*) pFormat; + number_of_pointers = *(unsigned short*)pFormat; pFormat += 2 + (number_of_pointers * 8); } else if (*pFormat == FC_VARIABLE_REPEAT) @@ -92,7 +92,7 @@ PFORMAT_STRING NdrpSkipPointerLayout(PFORMAT_STRING pFormat) * { pointer_instance<8> }* */ pFormat += 6; - number_of_pointers = *(unsigned short*) pFormat; + number_of_pointers = *(unsigned short*)pFormat; pFormat += 2 + (number_of_pointers * 8); } else @@ -120,7 +120,8 @@ PFORMAT_STRING NdrpSkipPointerLayout(PFORMAT_STRING pFormat) * offset_to_complex_description<2> */ -void NdrpPointerBufferSize(unsigned char* pMemory, PFORMAT_STRING pFormat, PMIDL_STUB_MESSAGE pStubMsg) +void NdrpPointerBufferSize(unsigned char* pMemory, PFORMAT_STRING pFormat, + PMIDL_STUB_MESSAGE pStubMsg) { unsigned char type; unsigned char attributes; @@ -133,7 +134,7 @@ void NdrpPointerBufferSize(unsigned char* pMemory, PFORMAT_STRING pFormat, PMIDL if (attributes & FC_SIMPLE_POINTER) pNextFormat = pFormat; else - pNextFormat = pFormat + *(SHORT*) pFormat; + pNextFormat = pFormat + *(SHORT*)pFormat; switch (type) { @@ -152,7 +153,7 @@ void NdrpPointerBufferSize(unsigned char* pMemory, PFORMAT_STRING pFormat, PMIDL } if ((attributes & FC_POINTER_DEREF) && pMemory) - pMemory = *(unsigned char**) pMemory; + pMemory = *(unsigned char**)pMemory; pfnSizeRoutine = pfnSizeRoutines[*pNextFormat]; @@ -160,7 +161,9 @@ void NdrpPointerBufferSize(unsigned char* pMemory, PFORMAT_STRING pFormat, PMIDL pfnSizeRoutine(pStubMsg, pMemory, pNextFormat); } -PFORMAT_STRING NdrpEmbeddedRepeatPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat, unsigned char** ppMemory) +PFORMAT_STRING NdrpEmbeddedRepeatPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, + unsigned char* pMemory, PFORMAT_STRING pFormat, + unsigned char** ppMemory) { ULONG_PTR MaxCount; unsigned char* Memory; @@ -178,7 +181,7 @@ PFORMAT_STRING NdrpEmbeddedRepeatPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, if (*pFormat == FC_FIXED_REPEAT) { pFormat += 2; - MaxCount = *(unsigned short*) pFormat; + MaxCount = *(unsigned short*)pFormat; } else { @@ -192,17 +195,17 @@ PFORMAT_STRING NdrpEmbeddedRepeatPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, if (pFormat[1] == FC_VARIABLE_OFFSET) { - pMemory += pStubMsg->Offset * (*(unsigned short*) &pFormat[1]); + pMemory += pStubMsg->Offset * (*(unsigned short*)&pFormat[1]); } } pFormat += 2; - increment = *(unsigned short*) pFormat; + increment = *(unsigned short*)pFormat; pFormat += 2; - offset_to_array = *(unsigned short*) pFormat; + offset_to_array = *(unsigned short*)pFormat; pStubMsg->Memory = Memory + offset_to_array; pFormat += 2; - number_of_pointers = *(unsigned short*) pFormat; + number_of_pointers = *(unsigned short*)pFormat; pFormat += 2; pFormatPointers = pFormat; @@ -219,17 +222,15 @@ PFORMAT_STRING NdrpEmbeddedRepeatPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, do { pointer_count--; - MemoryPointer = &pMemory[*(unsigned short*) pFormatNext]; + MemoryPointer = &pMemory[*(unsigned short*)pFormatNext]; NdrpPointerBufferSize(MemoryPointer, pFormatNext + 4, pStubMsg); pFormatNext += 8; - } - while (pointer_count); + } while (pointer_count); } pMemory += increment; pStubMsg->Memory += increment; - } - while (MaxCount); + } while (MaxCount); Memory = MemoryCopy; } @@ -239,7 +240,8 @@ PFORMAT_STRING NdrpEmbeddedRepeatPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, return pFormat; } -PFORMAT_STRING NdrpEmbeddedPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +PFORMAT_STRING NdrpEmbeddedPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { ULONG_PTR MaxCount; unsigned long Offset; @@ -296,7 +298,8 @@ PFORMAT_STRING NdrpEmbeddedPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsign return pFormat; } -void NdrPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +void NdrPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { if (*pFormat != FC_RP) { @@ -307,7 +310,8 @@ void NdrPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, P NdrpPointerBufferSize(pMemory, pFormat, pStubMsg); } -void NdrByteCountPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +void NdrByteCountPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { WLog_ERR(TAG, "warning: NdrByteCountPointerBufferSize unimplemented"); } diff --git a/winpr/libwinpr/rpc/ndr_pointer.h b/winpr/libwinpr/rpc/ndr_pointer.h index 292bafa5c..440ccc4cf 100644 --- a/winpr/libwinpr/rpc/ndr_pointer.h +++ b/winpr/libwinpr/rpc/ndr_pointer.h @@ -26,15 +26,20 @@ PFORMAT_STRING NdrpSkipPointerLayout(PFORMAT_STRING pFormat); -void NdrpPointerBufferSize(unsigned char* pMemory, PFORMAT_STRING pFormat, PMIDL_STUB_MESSAGE pStubMsg); +void NdrpPointerBufferSize(unsigned char* pMemory, PFORMAT_STRING pFormat, + PMIDL_STUB_MESSAGE pStubMsg); PFORMAT_STRING NdrpEmbeddedRepeatPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, - unsigned char* pMemory, PFORMAT_STRING pFormat, unsigned char** ppMemory); + unsigned char* pMemory, PFORMAT_STRING pFormat, + unsigned char** ppMemory); -PFORMAT_STRING NdrpEmbeddedPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); +PFORMAT_STRING NdrpEmbeddedPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); -void NdrPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); -void NdrByteCountPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); +void NdrPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); +void NdrByteCountPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); #endif diff --git a/winpr/libwinpr/rpc/ndr_private.c b/winpr/libwinpr/rpc/ndr_private.c index b7ef2335a..842083441 100644 --- a/winpr/libwinpr/rpc/ndr_private.c +++ b/winpr/libwinpr/rpc/ndr_private.c @@ -48,8 +48,7 @@ void NdrpIncrementLength(ULONG* length, unsigned int size) *length += size; } -const char* FC_TYPE_STRINGS[] = -{ +const char* FC_TYPE_STRINGS[] = { "FC_ZERO", "FC_BYTE", "FC_CHAR", @@ -143,20 +142,92 @@ const char* FC_TYPE_STRINGS[] = "FC_CONSTANT_IID", "FC_END", "FC_PAD", - "", "", "", "", "", "", - "", "", "", "", "", "", - "", "", "", "", "", "", - "", "", "", "", "", "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", "FC_SPLIT_DEREFERENCE", "FC_SPLIT_DIV_2", "FC_SPLIT_MULT_2", "FC_SPLIT_ADD_1", "FC_SPLIT_SUB_1", "FC_SPLIT_CALLBACK", - "", "", "", "", "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", "FC_HARD_STRUCT", "FC_TRANSMIT_AS_PTR", "FC_REPRESENT_AS_PTR", @@ -169,106 +240,104 @@ const char* FC_TYPE_STRINGS[] = "FC_END_OF_UNIVERSE", }; -const NDR_TYPE_SIZE_ROUTINE pfnSizeRoutines[] = -{ - NULL, /* FC_ZERO */ - NdrSimpleTypeBufferSize, /* FC_BYTE */ - NdrSimpleTypeBufferSize, /* FC_CHAR */ - NdrSimpleTypeBufferSize, /* FC_SMALL */ - NdrSimpleTypeBufferSize, /* FC_USMALL */ - NdrSimpleTypeBufferSize, /* FC_WCHAR */ - NdrSimpleTypeBufferSize, /* FC_SHORT */ - NdrSimpleTypeBufferSize, /* FC_USHORT */ - NdrSimpleTypeBufferSize, /* FC_LONG */ - NdrSimpleTypeBufferSize, /* FC_ULONG */ - NdrSimpleTypeBufferSize, /* FC_FLOAT */ - NdrSimpleTypeBufferSize, /* FC_HYPER */ - NdrSimpleTypeBufferSize, /* FC_DOUBLE */ - NdrSimpleTypeBufferSize, /* FC_ENUM16 */ - NdrSimpleTypeBufferSize, /* FC_ENUM32 */ - NdrSimpleTypeBufferSize, /* FC_IGNORE */ - NdrSimpleTypeBufferSize, /* FC_ERROR_STATUS_T */ - NdrPointerBufferSize, /* FC_RP */ - NdrPointerBufferSize, /* FC_UP */ - NdrPointerBufferSize, /* FC_OP */ - NdrPointerBufferSize, /* FC_FP */ - NdrSimpleStructBufferSize, /* FC_STRUCT */ - NdrSimpleStructBufferSize, /* FC_PSTRUCT */ - NdrConformantStructBufferSize, /* FC_CSTRUCT */ - NdrConformantStructBufferSize, /* FC_CPSTRUCT */ +const NDR_TYPE_SIZE_ROUTINE pfnSizeRoutines[] = { + NULL, /* FC_ZERO */ + NdrSimpleTypeBufferSize, /* FC_BYTE */ + NdrSimpleTypeBufferSize, /* FC_CHAR */ + NdrSimpleTypeBufferSize, /* FC_SMALL */ + NdrSimpleTypeBufferSize, /* FC_USMALL */ + NdrSimpleTypeBufferSize, /* FC_WCHAR */ + NdrSimpleTypeBufferSize, /* FC_SHORT */ + NdrSimpleTypeBufferSize, /* FC_USHORT */ + NdrSimpleTypeBufferSize, /* FC_LONG */ + NdrSimpleTypeBufferSize, /* FC_ULONG */ + NdrSimpleTypeBufferSize, /* FC_FLOAT */ + NdrSimpleTypeBufferSize, /* FC_HYPER */ + NdrSimpleTypeBufferSize, /* FC_DOUBLE */ + NdrSimpleTypeBufferSize, /* FC_ENUM16 */ + NdrSimpleTypeBufferSize, /* FC_ENUM32 */ + NdrSimpleTypeBufferSize, /* FC_IGNORE */ + NdrSimpleTypeBufferSize, /* FC_ERROR_STATUS_T */ + NdrPointerBufferSize, /* FC_RP */ + NdrPointerBufferSize, /* FC_UP */ + NdrPointerBufferSize, /* FC_OP */ + NdrPointerBufferSize, /* FC_FP */ + NdrSimpleStructBufferSize, /* FC_STRUCT */ + NdrSimpleStructBufferSize, /* FC_PSTRUCT */ + NdrConformantStructBufferSize, /* FC_CSTRUCT */ + NdrConformantStructBufferSize, /* FC_CPSTRUCT */ NdrConformantVaryingStructBufferSize, /* FC_CVSTRUCT */ - NdrComplexStructBufferSize, /* FC_BOGUS_STRUCT */ - NdrConformantArrayBufferSize, /* FC_CARRAY */ - NdrConformantVaryingArrayBufferSize, /* FC_CVARRAY */ - NdrFixedArrayBufferSize, /* FC_SMFARRAY */ - NdrFixedArrayBufferSize, /* FC_LGFARRAY */ - NdrVaryingArrayBufferSize, /* FC_SMVARRAY */ - NdrVaryingArrayBufferSize, /* FC_LGVARRAY */ - NdrComplexArrayBufferSize, /* FC_BOGUS_ARRAY */ - NdrConformantStringBufferSize, /* FC_C_CSTRING */ - NULL, /* FC_C_BSTRING */ - NULL, /* FC_C_SSTRING */ - NdrConformantStringBufferSize, /* FC_C_WSTRING */ - NdrNonConformantStringBufferSize, /* FC_CSTRING */ - NULL, /* FC_BSTRING */ - NULL, /* FC_SSTRING */ - NULL, /* FC_WSTRING */ - NdrEncapsulatedUnionBufferSize, /* FC_ENCAPSULATED_UNION */ - NdrNonEncapsulatedUnionBufferSize, /* FC_NON_ENCAPSULATED_UNION */ - NdrByteCountPointerBufferSize, /* FC_BYTE_COUNT_POINTER */ - NULL, /* FC_TRANSMIT_AS */ - NULL, /* FC_REPRESENT_AS */ - NULL, /* FC_IP */ - NdrContextHandleBufferSize, /* FC_BIND_CONTEXT */ - NULL, /* FC_BIND_GENERIC */ - NULL, /* FC_BIND_PRIMITIVE */ - NULL, /* FC_AUTO_HANDLE */ - NULL, /* FC_CALLBACK_HANDLE */ - NULL, /* FC_UNUSED1 */ - NULL, /* FC_POINTER */ - NULL, /* FC_ALIGNM2 */ - NULL, /* FC_ALIGNM4 */ - NULL, /* FC_ALIGNM8 */ - NULL, /* FC_UNUSED2 */ - NULL, /* FC_UNUSED3 */ - NULL, /* FC_UNUSED4 */ - NULL, /* FC_STRUCTPAD1 */ - NULL, /* FC_STRUCTPAD2 */ - NULL, /* FC_STRUCTPAD3 */ - NULL, /* FC_STRUCTPAD4 */ - NULL, /* FC_STRUCTPAD5 */ - NULL, /* FC_STRUCTPAD6 */ - NULL, /* FC_STRUCTPAD7 */ - NULL, /* FC_STRING_SIZED */ - NULL, /* FC_UNUSED5 */ - NULL, /* FC_NO_REPEAT */ - NULL, /* FC_FIXED_REPEAT */ - NULL, /* FC_VARIABLE_REPEAT */ - NULL, /* FC_FIXED_OFFSET */ - NULL, /* FC_VARIABLE_OFFSET */ - NULL, /* FC_PP */ - NULL, /* FC_EMBEDDED_COMPLEX */ - NULL, /* FC_IN_PARAM */ - NULL, /* FC_IN_PARAM_BASETYPE */ - NULL, /* FC_IN_PARAM_NO_FREE_INST */ - NULL, /* FC_IN_OUT_PARAM */ - NULL, /* FC_OUT_PARAM */ - NULL, /* FC_RETURN_PARAM */ - NULL, /* FC_RETURN_PARAM_BASETYPE */ - NULL, /* FC_DEREFERENCE */ - NULL, /* FC_DIV_2 */ - NULL, /* FC_MULT_2 */ - NULL, /* FC_ADD_1 */ - NULL, /* FC_SUB_1 */ - NULL, /* FC_CALLBACK */ - NULL, /* FC_CONSTANT_IID */ - NULL, /* FC_END */ - NULL, /* FC_PAD */ + NdrComplexStructBufferSize, /* FC_BOGUS_STRUCT */ + NdrConformantArrayBufferSize, /* FC_CARRAY */ + NdrConformantVaryingArrayBufferSize, /* FC_CVARRAY */ + NdrFixedArrayBufferSize, /* FC_SMFARRAY */ + NdrFixedArrayBufferSize, /* FC_LGFARRAY */ + NdrVaryingArrayBufferSize, /* FC_SMVARRAY */ + NdrVaryingArrayBufferSize, /* FC_LGVARRAY */ + NdrComplexArrayBufferSize, /* FC_BOGUS_ARRAY */ + NdrConformantStringBufferSize, /* FC_C_CSTRING */ + NULL, /* FC_C_BSTRING */ + NULL, /* FC_C_SSTRING */ + NdrConformantStringBufferSize, /* FC_C_WSTRING */ + NdrNonConformantStringBufferSize, /* FC_CSTRING */ + NULL, /* FC_BSTRING */ + NULL, /* FC_SSTRING */ + NULL, /* FC_WSTRING */ + NdrEncapsulatedUnionBufferSize, /* FC_ENCAPSULATED_UNION */ + NdrNonEncapsulatedUnionBufferSize, /* FC_NON_ENCAPSULATED_UNION */ + NdrByteCountPointerBufferSize, /* FC_BYTE_COUNT_POINTER */ + NULL, /* FC_TRANSMIT_AS */ + NULL, /* FC_REPRESENT_AS */ + NULL, /* FC_IP */ + NdrContextHandleBufferSize, /* FC_BIND_CONTEXT */ + NULL, /* FC_BIND_GENERIC */ + NULL, /* FC_BIND_PRIMITIVE */ + NULL, /* FC_AUTO_HANDLE */ + NULL, /* FC_CALLBACK_HANDLE */ + NULL, /* FC_UNUSED1 */ + NULL, /* FC_POINTER */ + NULL, /* FC_ALIGNM2 */ + NULL, /* FC_ALIGNM4 */ + NULL, /* FC_ALIGNM8 */ + NULL, /* FC_UNUSED2 */ + NULL, /* FC_UNUSED3 */ + NULL, /* FC_UNUSED4 */ + NULL, /* FC_STRUCTPAD1 */ + NULL, /* FC_STRUCTPAD2 */ + NULL, /* FC_STRUCTPAD3 */ + NULL, /* FC_STRUCTPAD4 */ + NULL, /* FC_STRUCTPAD5 */ + NULL, /* FC_STRUCTPAD6 */ + NULL, /* FC_STRUCTPAD7 */ + NULL, /* FC_STRING_SIZED */ + NULL, /* FC_UNUSED5 */ + NULL, /* FC_NO_REPEAT */ + NULL, /* FC_FIXED_REPEAT */ + NULL, /* FC_VARIABLE_REPEAT */ + NULL, /* FC_FIXED_OFFSET */ + NULL, /* FC_VARIABLE_OFFSET */ + NULL, /* FC_PP */ + NULL, /* FC_EMBEDDED_COMPLEX */ + NULL, /* FC_IN_PARAM */ + NULL, /* FC_IN_PARAM_BASETYPE */ + NULL, /* FC_IN_PARAM_NO_FREE_INST */ + NULL, /* FC_IN_OUT_PARAM */ + NULL, /* FC_OUT_PARAM */ + NULL, /* FC_RETURN_PARAM */ + NULL, /* FC_RETURN_PARAM_BASETYPE */ + NULL, /* FC_DEREFERENCE */ + NULL, /* FC_DIV_2 */ + NULL, /* FC_MULT_2 */ + NULL, /* FC_ADD_1 */ + NULL, /* FC_SUB_1 */ + NULL, /* FC_CALLBACK */ + NULL, /* FC_CONSTANT_IID */ + NULL, /* FC_END */ + NULL, /* FC_PAD */ }; -const NDR_TYPE_MARSHALL_ROUTINE pfnMarshallRoutines[] = -{ - NULL, /* FC_ZERO */ +const NDR_TYPE_MARSHALL_ROUTINE pfnMarshallRoutines[] = { + NULL, /* FC_ZERO */ NdrSimpleTypeMarshall, /* FC_BYTE */ NdrSimpleTypeMarshall, /* FC_CHAR */ NdrSimpleTypeMarshall, /* FC_SMALL */ @@ -284,88 +353,87 @@ const NDR_TYPE_MARSHALL_ROUTINE pfnMarshallRoutines[] = NdrSimpleTypeMarshall, /* FC_ENUM16 */ NdrSimpleTypeMarshall, /* FC_ENUM32 */ NdrSimpleTypeMarshall, /* FC_IGNORE */ - NULL, /* FC_ERROR_STATUS_T */ - NULL, /* FC_RP */ - NULL, /* FC_UP */ - NULL, /* FC_OP */ - NULL, /* FC_FP */ - NULL, /* FC_STRUCT */ - NULL, /* FC_PSTRUCT */ - NULL, /* FC_CSTRUCT */ - NULL, /* FC_CPSTRUCT */ - NULL, /* FC_CVSTRUCT */ - NULL, /* FC_BOGUS_STRUCT */ - NULL, /* FC_CARRAY */ - NULL, /* FC_CVARRAY */ - NULL, /* FC_SMFARRAY */ - NULL, /* FC_LGFARRAY */ - NULL, /* FC_SMVARRAY */ - NULL, /* FC_LGVARRAY */ - NULL, /* FC_BOGUS_ARRAY */ - NULL, /* FC_C_CSTRING */ - NULL, /* FC_C_BSTRING */ - NULL, /* FC_C_SSTRING */ - NULL, /* FC_C_WSTRING */ - NULL, /* FC_CSTRING */ - NULL, /* FC_BSTRING */ - NULL, /* FC_SSTRING */ - NULL, /* FC_WSTRING */ - NULL, /* FC_ENCAPSULATED_UNION */ - NULL, /* FC_NON_ENCAPSULATED_UNION */ - NULL, /* FC_BYTE_COUNT_POINTER */ - NULL, /* FC_TRANSMIT_AS */ - NULL, /* FC_REPRESENT_AS */ - NULL, /* FC_IP */ - NULL, /* FC_BIND_CONTEXT */ - NULL, /* FC_BIND_GENERIC */ - NULL, /* FC_BIND_PRIMITIVE */ - NULL, /* FC_AUTO_HANDLE */ - NULL, /* FC_CALLBACK_HANDLE */ - NULL, /* FC_UNUSED1 */ - NULL, /* FC_POINTER */ - NULL, /* FC_ALIGNM2 */ - NULL, /* FC_ALIGNM4 */ - NULL, /* FC_ALIGNM8 */ - NULL, /* FC_UNUSED2 */ - NULL, /* FC_UNUSED3 */ - NULL, /* FC_UNUSED4 */ - NULL, /* FC_STRUCTPAD1 */ - NULL, /* FC_STRUCTPAD2 */ - NULL, /* FC_STRUCTPAD3 */ - NULL, /* FC_STRUCTPAD4 */ - NULL, /* FC_STRUCTPAD5 */ - NULL, /* FC_STRUCTPAD6 */ - NULL, /* FC_STRUCTPAD7 */ - NULL, /* FC_STRING_SIZED */ - NULL, /* FC_UNUSED5 */ - NULL, /* FC_NO_REPEAT */ - NULL, /* FC_FIXED_REPEAT */ - NULL, /* FC_VARIABLE_REPEAT */ - NULL, /* FC_FIXED_OFFSET */ - NULL, /* FC_VARIABLE_OFFSET */ - NULL, /* FC_PP */ - NULL, /* FC_EMBEDDED_COMPLEX */ - NULL, /* FC_IN_PARAM */ - NULL, /* FC_IN_PARAM_BASETYPE */ - NULL, /* FC_IN_PARAM_NO_FREE_INST */ - NULL, /* FC_IN_OUT_PARAM */ - NULL, /* FC_OUT_PARAM */ - NULL, /* FC_RETURN_PARAM */ - NULL, /* FC_RETURN_PARAM_BASETYPE */ - NULL, /* FC_DEREFERENCE */ - NULL, /* FC_DIV_2 */ - NULL, /* FC_MULT_2 */ - NULL, /* FC_ADD_1 */ - NULL, /* FC_SUB_1 */ - NULL, /* FC_CALLBACK */ - NULL, /* FC_CONSTANT_IID */ - NULL, /* FC_END */ - NULL, /* FC_PAD */ + NULL, /* FC_ERROR_STATUS_T */ + NULL, /* FC_RP */ + NULL, /* FC_UP */ + NULL, /* FC_OP */ + NULL, /* FC_FP */ + NULL, /* FC_STRUCT */ + NULL, /* FC_PSTRUCT */ + NULL, /* FC_CSTRUCT */ + NULL, /* FC_CPSTRUCT */ + NULL, /* FC_CVSTRUCT */ + NULL, /* FC_BOGUS_STRUCT */ + NULL, /* FC_CARRAY */ + NULL, /* FC_CVARRAY */ + NULL, /* FC_SMFARRAY */ + NULL, /* FC_LGFARRAY */ + NULL, /* FC_SMVARRAY */ + NULL, /* FC_LGVARRAY */ + NULL, /* FC_BOGUS_ARRAY */ + NULL, /* FC_C_CSTRING */ + NULL, /* FC_C_BSTRING */ + NULL, /* FC_C_SSTRING */ + NULL, /* FC_C_WSTRING */ + NULL, /* FC_CSTRING */ + NULL, /* FC_BSTRING */ + NULL, /* FC_SSTRING */ + NULL, /* FC_WSTRING */ + NULL, /* FC_ENCAPSULATED_UNION */ + NULL, /* FC_NON_ENCAPSULATED_UNION */ + NULL, /* FC_BYTE_COUNT_POINTER */ + NULL, /* FC_TRANSMIT_AS */ + NULL, /* FC_REPRESENT_AS */ + NULL, /* FC_IP */ + NULL, /* FC_BIND_CONTEXT */ + NULL, /* FC_BIND_GENERIC */ + NULL, /* FC_BIND_PRIMITIVE */ + NULL, /* FC_AUTO_HANDLE */ + NULL, /* FC_CALLBACK_HANDLE */ + NULL, /* FC_UNUSED1 */ + NULL, /* FC_POINTER */ + NULL, /* FC_ALIGNM2 */ + NULL, /* FC_ALIGNM4 */ + NULL, /* FC_ALIGNM8 */ + NULL, /* FC_UNUSED2 */ + NULL, /* FC_UNUSED3 */ + NULL, /* FC_UNUSED4 */ + NULL, /* FC_STRUCTPAD1 */ + NULL, /* FC_STRUCTPAD2 */ + NULL, /* FC_STRUCTPAD3 */ + NULL, /* FC_STRUCTPAD4 */ + NULL, /* FC_STRUCTPAD5 */ + NULL, /* FC_STRUCTPAD6 */ + NULL, /* FC_STRUCTPAD7 */ + NULL, /* FC_STRING_SIZED */ + NULL, /* FC_UNUSED5 */ + NULL, /* FC_NO_REPEAT */ + NULL, /* FC_FIXED_REPEAT */ + NULL, /* FC_VARIABLE_REPEAT */ + NULL, /* FC_FIXED_OFFSET */ + NULL, /* FC_VARIABLE_OFFSET */ + NULL, /* FC_PP */ + NULL, /* FC_EMBEDDED_COMPLEX */ + NULL, /* FC_IN_PARAM */ + NULL, /* FC_IN_PARAM_BASETYPE */ + NULL, /* FC_IN_PARAM_NO_FREE_INST */ + NULL, /* FC_IN_OUT_PARAM */ + NULL, /* FC_OUT_PARAM */ + NULL, /* FC_RETURN_PARAM */ + NULL, /* FC_RETURN_PARAM_BASETYPE */ + NULL, /* FC_DEREFERENCE */ + NULL, /* FC_DIV_2 */ + NULL, /* FC_MULT_2 */ + NULL, /* FC_ADD_1 */ + NULL, /* FC_SUB_1 */ + NULL, /* FC_CALLBACK */ + NULL, /* FC_CONSTANT_IID */ + NULL, /* FC_END */ + NULL, /* FC_PAD */ }; -const NDR_TYPE_UNMARSHALL_ROUTINE pfnUnmarshallRoutines[] = -{ - NULL, /* FC_ZERO */ +const NDR_TYPE_UNMARSHALL_ROUTINE pfnUnmarshallRoutines[] = { + NULL, /* FC_ZERO */ NdrSimpleTypeUnmarshall, /* FC_BYTE */ NdrSimpleTypeUnmarshall, /* FC_CHAR */ NdrSimpleTypeUnmarshall, /* FC_SMALL */ @@ -381,88 +449,87 @@ const NDR_TYPE_UNMARSHALL_ROUTINE pfnUnmarshallRoutines[] = NdrSimpleTypeUnmarshall, /* FC_ENUM16 */ NdrSimpleTypeUnmarshall, /* FC_ENUM32 */ NdrSimpleTypeUnmarshall, /* FC_IGNORE */ - NULL, /* FC_ERROR_STATUS_T */ - NULL, /* FC_RP */ - NULL, /* FC_UP */ - NULL, /* FC_OP */ - NULL, /* FC_FP */ - NULL, /* FC_STRUCT */ - NULL, /* FC_PSTRUCT */ - NULL, /* FC_CSTRUCT */ - NULL, /* FC_CPSTRUCT */ - NULL, /* FC_CVSTRUCT */ - NULL, /* FC_BOGUS_STRUCT */ - NULL, /* FC_CARRAY */ - NULL, /* FC_CVARRAY */ - NULL, /* FC_SMFARRAY */ - NULL, /* FC_LGFARRAY */ - NULL, /* FC_SMVARRAY */ - NULL, /* FC_LGVARRAY */ - NULL, /* FC_BOGUS_ARRAY */ - NULL, /* FC_C_CSTRING */ - NULL, /* FC_C_BSTRING */ - NULL, /* FC_C_SSTRING */ - NULL, /* FC_C_WSTRING */ - NULL, /* FC_CSTRING */ - NULL, /* FC_BSTRING */ - NULL, /* FC_SSTRING */ - NULL, /* FC_WSTRING */ - NULL, /* FC_ENCAPSULATED_UNION */ - NULL, /* FC_NON_ENCAPSULATED_UNION */ - NULL, /* FC_BYTE_COUNT_POINTER */ - NULL, /* FC_TRANSMIT_AS */ - NULL, /* FC_REPRESENT_AS */ - NULL, /* FC_IP */ - NULL, /* FC_BIND_CONTEXT */ - NULL, /* FC_BIND_GENERIC */ - NULL, /* FC_BIND_PRIMITIVE */ - NULL, /* FC_AUTO_HANDLE */ - NULL, /* FC_CALLBACK_HANDLE */ - NULL, /* FC_UNUSED1 */ - NULL, /* FC_POINTER */ - NULL, /* FC_ALIGNM2 */ - NULL, /* FC_ALIGNM4 */ - NULL, /* FC_ALIGNM8 */ - NULL, /* FC_UNUSED2 */ - NULL, /* FC_UNUSED3 */ - NULL, /* FC_UNUSED4 */ - NULL, /* FC_STRUCTPAD1 */ - NULL, /* FC_STRUCTPAD2 */ - NULL, /* FC_STRUCTPAD3 */ - NULL, /* FC_STRUCTPAD4 */ - NULL, /* FC_STRUCTPAD5 */ - NULL, /* FC_STRUCTPAD6 */ - NULL, /* FC_STRUCTPAD7 */ - NULL, /* FC_STRING_SIZED */ - NULL, /* FC_UNUSED5 */ - NULL, /* FC_NO_REPEAT */ - NULL, /* FC_FIXED_REPEAT */ - NULL, /* FC_VARIABLE_REPEAT */ - NULL, /* FC_FIXED_OFFSET */ - NULL, /* FC_VARIABLE_OFFSET */ - NULL, /* FC_PP */ - NULL, /* FC_EMBEDDED_COMPLEX */ - NULL, /* FC_IN_PARAM */ - NULL, /* FC_IN_PARAM_BASETYPE */ - NULL, /* FC_IN_PARAM_NO_FREE_INST */ - NULL, /* FC_IN_OUT_PARAM */ - NULL, /* FC_OUT_PARAM */ - NULL, /* FC_RETURN_PARAM */ - NULL, /* FC_RETURN_PARAM_BASETYPE */ - NULL, /* FC_DEREFERENCE */ - NULL, /* FC_DIV_2 */ - NULL, /* FC_MULT_2 */ - NULL, /* FC_ADD_1 */ - NULL, /* FC_SUB_1 */ - NULL, /* FC_CALLBACK */ - NULL, /* FC_CONSTANT_IID */ - NULL, /* FC_END */ - NULL, /* FC_PAD */ + NULL, /* FC_ERROR_STATUS_T */ + NULL, /* FC_RP */ + NULL, /* FC_UP */ + NULL, /* FC_OP */ + NULL, /* FC_FP */ + NULL, /* FC_STRUCT */ + NULL, /* FC_PSTRUCT */ + NULL, /* FC_CSTRUCT */ + NULL, /* FC_CPSTRUCT */ + NULL, /* FC_CVSTRUCT */ + NULL, /* FC_BOGUS_STRUCT */ + NULL, /* FC_CARRAY */ + NULL, /* FC_CVARRAY */ + NULL, /* FC_SMFARRAY */ + NULL, /* FC_LGFARRAY */ + NULL, /* FC_SMVARRAY */ + NULL, /* FC_LGVARRAY */ + NULL, /* FC_BOGUS_ARRAY */ + NULL, /* FC_C_CSTRING */ + NULL, /* FC_C_BSTRING */ + NULL, /* FC_C_SSTRING */ + NULL, /* FC_C_WSTRING */ + NULL, /* FC_CSTRING */ + NULL, /* FC_BSTRING */ + NULL, /* FC_SSTRING */ + NULL, /* FC_WSTRING */ + NULL, /* FC_ENCAPSULATED_UNION */ + NULL, /* FC_NON_ENCAPSULATED_UNION */ + NULL, /* FC_BYTE_COUNT_POINTER */ + NULL, /* FC_TRANSMIT_AS */ + NULL, /* FC_REPRESENT_AS */ + NULL, /* FC_IP */ + NULL, /* FC_BIND_CONTEXT */ + NULL, /* FC_BIND_GENERIC */ + NULL, /* FC_BIND_PRIMITIVE */ + NULL, /* FC_AUTO_HANDLE */ + NULL, /* FC_CALLBACK_HANDLE */ + NULL, /* FC_UNUSED1 */ + NULL, /* FC_POINTER */ + NULL, /* FC_ALIGNM2 */ + NULL, /* FC_ALIGNM4 */ + NULL, /* FC_ALIGNM8 */ + NULL, /* FC_UNUSED2 */ + NULL, /* FC_UNUSED3 */ + NULL, /* FC_UNUSED4 */ + NULL, /* FC_STRUCTPAD1 */ + NULL, /* FC_STRUCTPAD2 */ + NULL, /* FC_STRUCTPAD3 */ + NULL, /* FC_STRUCTPAD4 */ + NULL, /* FC_STRUCTPAD5 */ + NULL, /* FC_STRUCTPAD6 */ + NULL, /* FC_STRUCTPAD7 */ + NULL, /* FC_STRING_SIZED */ + NULL, /* FC_UNUSED5 */ + NULL, /* FC_NO_REPEAT */ + NULL, /* FC_FIXED_REPEAT */ + NULL, /* FC_VARIABLE_REPEAT */ + NULL, /* FC_FIXED_OFFSET */ + NULL, /* FC_VARIABLE_OFFSET */ + NULL, /* FC_PP */ + NULL, /* FC_EMBEDDED_COMPLEX */ + NULL, /* FC_IN_PARAM */ + NULL, /* FC_IN_PARAM_BASETYPE */ + NULL, /* FC_IN_PARAM_NO_FREE_INST */ + NULL, /* FC_IN_OUT_PARAM */ + NULL, /* FC_OUT_PARAM */ + NULL, /* FC_RETURN_PARAM */ + NULL, /* FC_RETURN_PARAM_BASETYPE */ + NULL, /* FC_DEREFERENCE */ + NULL, /* FC_DIV_2 */ + NULL, /* FC_MULT_2 */ + NULL, /* FC_ADD_1 */ + NULL, /* FC_SUB_1 */ + NULL, /* FC_CALLBACK */ + NULL, /* FC_CONSTANT_IID */ + NULL, /* FC_END */ + NULL, /* FC_PAD */ }; -const NDR_TYPE_FREE_ROUTINE pfnFreeRoutines[] = -{ - NULL, /* FC_ZERO */ +const NDR_TYPE_FREE_ROUTINE pfnFreeRoutines[] = { + NULL, /* FC_ZERO */ NdrSimpleTypeFree, /* FC_BYTE */ NdrSimpleTypeFree, /* FC_CHAR */ NdrSimpleTypeFree, /* FC_SMALL */ @@ -478,83 +545,83 @@ const NDR_TYPE_FREE_ROUTINE pfnFreeRoutines[] = NdrSimpleTypeFree, /* FC_ENUM16 */ NdrSimpleTypeFree, /* FC_ENUM32 */ NdrSimpleTypeFree, /* FC_IGNORE */ - NULL, /* FC_ERROR_STATUS_T */ - NULL, /* FC_RP */ - NULL, /* FC_UP */ - NULL, /* FC_OP */ - NULL, /* FC_FP */ - NULL, /* FC_STRUCT */ - NULL, /* FC_PSTRUCT */ - NULL, /* FC_CSTRUCT */ - NULL, /* FC_CPSTRUCT */ - NULL, /* FC_CVSTRUCT */ - NULL, /* FC_BOGUS_STRUCT */ - NULL, /* FC_CARRAY */ - NULL, /* FC_CVARRAY */ - NULL, /* FC_SMFARRAY */ - NULL, /* FC_LGFARRAY */ - NULL, /* FC_SMVARRAY */ - NULL, /* FC_LGVARRAY */ - NULL, /* FC_BOGUS_ARRAY */ - NULL, /* FC_C_CSTRING */ - NULL, /* FC_C_BSTRING */ - NULL, /* FC_C_SSTRING */ - NULL, /* FC_C_WSTRING */ - NULL, /* FC_CSTRING */ - NULL, /* FC_BSTRING */ - NULL, /* FC_SSTRING */ - NULL, /* FC_WSTRING */ - NULL, /* FC_ENCAPSULATED_UNION */ - NULL, /* FC_NON_ENCAPSULATED_UNION */ - NULL, /* FC_BYTE_COUNT_POINTER */ - NULL, /* FC_TRANSMIT_AS */ - NULL, /* FC_REPRESENT_AS */ - NULL, /* FC_IP */ - NULL, /* FC_BIND_CONTEXT */ - NULL, /* FC_BIND_GENERIC */ - NULL, /* FC_BIND_PRIMITIVE */ - NULL, /* FC_AUTO_HANDLE */ - NULL, /* FC_CALLBACK_HANDLE */ - NULL, /* FC_UNUSED1 */ - NULL, /* FC_POINTER */ - NULL, /* FC_ALIGNM2 */ - NULL, /* FC_ALIGNM4 */ - NULL, /* FC_ALIGNM8 */ - NULL, /* FC_UNUSED2 */ - NULL, /* FC_UNUSED3 */ - NULL, /* FC_UNUSED4 */ - NULL, /* FC_STRUCTPAD1 */ - NULL, /* FC_STRUCTPAD2 */ - NULL, /* FC_STRUCTPAD3 */ - NULL, /* FC_STRUCTPAD4 */ - NULL, /* FC_STRUCTPAD5 */ - NULL, /* FC_STRUCTPAD6 */ - NULL, /* FC_STRUCTPAD7 */ - NULL, /* FC_STRING_SIZED */ - NULL, /* FC_UNUSED5 */ - NULL, /* FC_NO_REPEAT */ - NULL, /* FC_FIXED_REPEAT */ - NULL, /* FC_VARIABLE_REPEAT */ - NULL, /* FC_FIXED_OFFSET */ - NULL, /* FC_VARIABLE_OFFSET */ - NULL, /* FC_PP */ - NULL, /* FC_EMBEDDED_COMPLEX */ - NULL, /* FC_IN_PARAM */ - NULL, /* FC_IN_PARAM_BASETYPE */ - NULL, /* FC_IN_PARAM_NO_FREE_INST */ - NULL, /* FC_IN_OUT_PARAM */ - NULL, /* FC_OUT_PARAM */ - NULL, /* FC_RETURN_PARAM */ - NULL, /* FC_RETURN_PARAM_BASETYPE */ - NULL, /* FC_DEREFERENCE */ - NULL, /* FC_DIV_2 */ - NULL, /* FC_MULT_2 */ - NULL, /* FC_ADD_1 */ - NULL, /* FC_SUB_1 */ - NULL, /* FC_CALLBACK */ - NULL, /* FC_CONSTANT_IID */ - NULL, /* FC_END */ - NULL, /* FC_PAD */ + NULL, /* FC_ERROR_STATUS_T */ + NULL, /* FC_RP */ + NULL, /* FC_UP */ + NULL, /* FC_OP */ + NULL, /* FC_FP */ + NULL, /* FC_STRUCT */ + NULL, /* FC_PSTRUCT */ + NULL, /* FC_CSTRUCT */ + NULL, /* FC_CPSTRUCT */ + NULL, /* FC_CVSTRUCT */ + NULL, /* FC_BOGUS_STRUCT */ + NULL, /* FC_CARRAY */ + NULL, /* FC_CVARRAY */ + NULL, /* FC_SMFARRAY */ + NULL, /* FC_LGFARRAY */ + NULL, /* FC_SMVARRAY */ + NULL, /* FC_LGVARRAY */ + NULL, /* FC_BOGUS_ARRAY */ + NULL, /* FC_C_CSTRING */ + NULL, /* FC_C_BSTRING */ + NULL, /* FC_C_SSTRING */ + NULL, /* FC_C_WSTRING */ + NULL, /* FC_CSTRING */ + NULL, /* FC_BSTRING */ + NULL, /* FC_SSTRING */ + NULL, /* FC_WSTRING */ + NULL, /* FC_ENCAPSULATED_UNION */ + NULL, /* FC_NON_ENCAPSULATED_UNION */ + NULL, /* FC_BYTE_COUNT_POINTER */ + NULL, /* FC_TRANSMIT_AS */ + NULL, /* FC_REPRESENT_AS */ + NULL, /* FC_IP */ + NULL, /* FC_BIND_CONTEXT */ + NULL, /* FC_BIND_GENERIC */ + NULL, /* FC_BIND_PRIMITIVE */ + NULL, /* FC_AUTO_HANDLE */ + NULL, /* FC_CALLBACK_HANDLE */ + NULL, /* FC_UNUSED1 */ + NULL, /* FC_POINTER */ + NULL, /* FC_ALIGNM2 */ + NULL, /* FC_ALIGNM4 */ + NULL, /* FC_ALIGNM8 */ + NULL, /* FC_UNUSED2 */ + NULL, /* FC_UNUSED3 */ + NULL, /* FC_UNUSED4 */ + NULL, /* FC_STRUCTPAD1 */ + NULL, /* FC_STRUCTPAD2 */ + NULL, /* FC_STRUCTPAD3 */ + NULL, /* FC_STRUCTPAD4 */ + NULL, /* FC_STRUCTPAD5 */ + NULL, /* FC_STRUCTPAD6 */ + NULL, /* FC_STRUCTPAD7 */ + NULL, /* FC_STRING_SIZED */ + NULL, /* FC_UNUSED5 */ + NULL, /* FC_NO_REPEAT */ + NULL, /* FC_FIXED_REPEAT */ + NULL, /* FC_VARIABLE_REPEAT */ + NULL, /* FC_FIXED_OFFSET */ + NULL, /* FC_VARIABLE_OFFSET */ + NULL, /* FC_PP */ + NULL, /* FC_EMBEDDED_COMPLEX */ + NULL, /* FC_IN_PARAM */ + NULL, /* FC_IN_PARAM_BASETYPE */ + NULL, /* FC_IN_PARAM_NO_FREE_INST */ + NULL, /* FC_IN_OUT_PARAM */ + NULL, /* FC_OUT_PARAM */ + NULL, /* FC_RETURN_PARAM */ + NULL, /* FC_RETURN_PARAM_BASETYPE */ + NULL, /* FC_DEREFERENCE */ + NULL, /* FC_DIV_2 */ + NULL, /* FC_MULT_2 */ + NULL, /* FC_ADD_1 */ + NULL, /* FC_SUB_1 */ + NULL, /* FC_CALLBACK */ + NULL, /* FC_CONSTANT_IID */ + NULL, /* FC_END */ + NULL, /* FC_PAD */ }; #endif diff --git a/winpr/libwinpr/rpc/ndr_simple.c b/winpr/libwinpr/rpc/ndr_simple.c index 7fdff8c21..821d9a72c 100644 --- a/winpr/libwinpr/rpc/ndr_simple.c +++ b/winpr/libwinpr/rpc/ndr_simple.c @@ -31,8 +31,7 @@ #include "ndr_simple.h" #include "ndr_private.h" -const unsigned char SimpleTypeAlignment[] = -{ +const unsigned char SimpleTypeAlignment[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x03, 0x03, 0x03, 0x07, 0x07, 0x01, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -51,8 +50,7 @@ const unsigned char SimpleTypeAlignment[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -const unsigned char SimpleTypeBufferSize[] = -{ +const unsigned char SimpleTypeBufferSize[] = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x04, 0x04, 0x04, 0x08, 0x08, 0x02, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -71,8 +69,7 @@ const unsigned char SimpleTypeBufferSize[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -const unsigned char SimpleTypeMemorySize[] = -{ +const unsigned char SimpleTypeMemorySize[] = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x04, 0x04, 0x04, 0x08, 0x08, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -91,8 +88,7 @@ const unsigned char SimpleTypeMemorySize[] = 0x92, 0x9D, 0x3A, 0x75, 0x92, 0x9D, 0x3A, 0x75, 0x92, 0x9D, 0x3A, 0x75, 0x92, 0x9D, 0x3A, 0x75, }; -const unsigned char NdrTypeFlags[] = -{ +const unsigned char NdrTypeFlags[] = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xA0, 0xA0, 0x00, 0xC0, 0xC0, 0x02, @@ -131,8 +127,8 @@ int NdrGetTypeFlags(unsigned char FormatChar) return NdrTypeFlags[FormatChar]; } -void NdrSimpleTypeBufferSize(PMIDL_STUB_MESSAGE pStubMsg, - unsigned char* pMemory, PFORMAT_STRING pFormat) +void NdrSimpleTypeBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { switch (*pFormat) { @@ -190,13 +186,12 @@ void NdrSimpleTypeMarshall(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, { } -void NdrSimpleTypeUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, - unsigned char* pMemory, unsigned char FormatChar) +void NdrSimpleTypeUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + unsigned char FormatChar) { } -void NdrSimpleTypeFree(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, - PFORMAT_STRING pFormat) +void NdrSimpleTypeFree(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) { } diff --git a/winpr/libwinpr/rpc/ndr_simple.h b/winpr/libwinpr/rpc/ndr_simple.h index ceb3ec655..335947539 100644 --- a/winpr/libwinpr/rpc/ndr_simple.h +++ b/winpr/libwinpr/rpc/ndr_simple.h @@ -24,14 +24,13 @@ #ifndef _WIN32 -void NdrSimpleTypeBufferSize(PMIDL_STUB_MESSAGE pStubMsg, - unsigned char* pMemory, PFORMAT_STRING pFormat); +void NdrSimpleTypeBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); void NdrSimpleTypeMarshall(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, unsigned char FormatChar); -void NdrSimpleTypeUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, - unsigned char* pMemory, unsigned char FormatChar); -void NdrSimpleTypeFree(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, - PFORMAT_STRING pFormat); +void NdrSimpleTypeUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + unsigned char FormatChar); +void NdrSimpleTypeFree(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); unsigned char NdrGetSimpleTypeBufferAlignment(unsigned char FormatChar); unsigned char NdrGetSimpleTypeBufferSize(unsigned char FormatChar); diff --git a/winpr/libwinpr/rpc/ndr_string.c b/winpr/libwinpr/rpc/ndr_string.c index 5c0451691..049935d3d 100644 --- a/winpr/libwinpr/rpc/ndr_string.c +++ b/winpr/libwinpr/rpc/ndr_string.c @@ -31,15 +31,16 @@ #include "ndr_string.h" #include "ndr_private.h" -void NdrConformantStringBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +void NdrConformantStringBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { WLog_ERR(TAG, "warning: NdrConformantStringBufferSize unimplemented"); } -void NdrNonConformantStringBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +void NdrNonConformantStringBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { WLog_ERR(TAG, "warning: NdrNonConformantStringBufferSize unimplemented"); } #endif - diff --git a/winpr/libwinpr/rpc/ndr_string.h b/winpr/libwinpr/rpc/ndr_string.h index fe91a9313..f327c2f0d 100644 --- a/winpr/libwinpr/rpc/ndr_string.h +++ b/winpr/libwinpr/rpc/ndr_string.h @@ -24,8 +24,10 @@ #ifndef _WIN32 -void NdrConformantStringBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); -void NdrNonConformantStringBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); +void NdrConformantStringBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); +void NdrNonConformantStringBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); #endif diff --git a/winpr/libwinpr/rpc/ndr_structure.c b/winpr/libwinpr/rpc/ndr_structure.c index bc9fe3a67..fdce9aeed 100644 --- a/winpr/libwinpr/rpc/ndr_structure.c +++ b/winpr/libwinpr/rpc/ndr_structure.c @@ -34,7 +34,8 @@ /* Structures: http://msdn.microsoft.com/en-us/library/windows/desktop/aa378695/ */ -void NdrSimpleStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +void NdrSimpleStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { /** * FC_STRUCT @@ -56,7 +57,7 @@ void NdrSimpleStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemo unsigned short memory_size; type = pFormat[0]; alignment = pFormat[1] + 1; - memory_size = *(unsigned short*) &pFormat[2]; + memory_size = *(unsigned short*)&pFormat[2]; NdrpAlignLength(&(pStubMsg->BufferLength), alignment); NdrpIncrementLength(&(pStubMsg->BufferLength), memory_size); pFormat += 4; @@ -67,7 +68,8 @@ void NdrSimpleStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemo WLog_ERR(TAG, "warning: NdrSimpleStructBufferSize unimplemented"); } -void NdrConformantStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +void NdrConformantStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { /** * FC_CSTRUCT alignment<1> @@ -86,7 +88,8 @@ void NdrConformantStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* p WLog_ERR(TAG, "warning: NdrConformantStructBufferSize unimplemented"); } -void NdrConformantVaryingStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +void NdrConformantVaryingStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { /** * FC_CVSTRUCT alignment<1> @@ -189,7 +192,8 @@ ULONG NdrComplexStructMemberSize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFo break; case FC_EMBEDDED_COMPLEX: - WLog_ERR(TAG, "warning: NdrComplexStructMemberSize FC_EMBEDDED_COMPLEX unimplemented"); + WLog_ERR(TAG, + "warning: NdrComplexStructMemberSize FC_EMBEDDED_COMPLEX unimplemented"); break; default: @@ -203,7 +207,8 @@ ULONG NdrComplexStructMemberSize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFo return size; } -void NdrComplexStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +void NdrComplexStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { /** * FC_BOGUS_STRUCT @@ -237,7 +242,7 @@ void NdrComplexStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMem } alignment = pFormat[1] + 1; - memory_size = *(unsigned short*) &pFormat[2]; + memory_size = *(unsigned short*)&pFormat[2]; NdrpAlignLength(&(pStubMsg->BufferLength), alignment); if (!pStubMsg->IgnoreEmbeddedPointers && !pStubMsg->PointerLength) @@ -252,16 +257,17 @@ void NdrComplexStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMem } pFormat += 4; - offset_to_conformant_array_description = *(unsigned short*) &pFormat[0]; + offset_to_conformant_array_description = *(unsigned short*)&pFormat[0]; if (offset_to_conformant_array_description) - conformant_array_description = (unsigned char*) pFormat + offset_to_conformant_array_description; + conformant_array_description = + (unsigned char*)pFormat + offset_to_conformant_array_description; pFormat += 2; - offset_to_pointer_layout = *(unsigned short*) &pFormat[0]; + offset_to_pointer_layout = *(unsigned short*)&pFormat[0]; if (offset_to_pointer_layout) - pointer_layout = (unsigned char*) pFormat + offset_to_pointer_layout; + pointer_layout = (unsigned char*)pFormat + offset_to_pointer_layout; pFormat += 2; pStubMsg->Memory = pMemory; @@ -272,7 +278,8 @@ void NdrComplexStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMem unsigned char array_type; array_type = conformant_array_description[0]; size = NdrComplexStructMemberSize(pStubMsg, pFormat); - WLog_ERR(TAG, "warning: NdrComplexStructBufferSize array_type: 0x%02X unimplemented", array_type); + WLog_ERR(TAG, "warning: NdrComplexStructBufferSize array_type: 0x%02X unimplemented", + array_type); NdrpComputeConformance(pStubMsg, pMemory + size, conformant_array_description); NdrpComputeVariance(pStubMsg, pMemory + size, conformant_array_description); MaxCount = pStubMsg->MaxCount; @@ -287,7 +294,8 @@ void NdrComplexStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMem pStubMsg->MaxCount = MaxCount; pStubMsg->ActualCount = ActualCount; pStubMsg->Offset = Offset; - WLog_ERR(TAG, "warning: NdrComplexStructBufferSize array_type: 0x%02X unimplemented", array_type); + WLog_ERR(TAG, "warning: NdrComplexStructBufferSize array_type: 0x%02X unimplemented", + array_type); } pStubMsg->Memory = pMemoryCopy; diff --git a/winpr/libwinpr/rpc/ndr_structure.h b/winpr/libwinpr/rpc/ndr_structure.h index f4a02bd0d..9630ee3fc 100644 --- a/winpr/libwinpr/rpc/ndr_structure.h +++ b/winpr/libwinpr/rpc/ndr_structure.h @@ -24,10 +24,14 @@ #ifndef _WIN32 -void NdrSimpleStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); -void NdrConformantStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); -void NdrConformantVaryingStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); -void NdrComplexStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); +void NdrSimpleStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); +void NdrConformantStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); +void NdrConformantVaryingStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); +void NdrComplexStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); #endif diff --git a/winpr/libwinpr/rpc/ndr_union.c b/winpr/libwinpr/rpc/ndr_union.c index 788464ad4..11c219384 100644 --- a/winpr/libwinpr/rpc/ndr_union.c +++ b/winpr/libwinpr/rpc/ndr_union.c @@ -31,12 +31,14 @@ #include "ndr_union.h" #include "ndr_private.h" -void NdrEncapsulatedUnionBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +void NdrEncapsulatedUnionBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { WLog_ERR(TAG, "warning: NdrEncapsulatedUnionBufferSize unimplemented"); } -void NdrNonEncapsulatedUnionBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat) +void NdrNonEncapsulatedUnionBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat) { WLog_ERR(TAG, "warning: NdrNonEncapsulatedUnionBufferSize unimplemented"); } diff --git a/winpr/libwinpr/rpc/ndr_union.h b/winpr/libwinpr/rpc/ndr_union.h index 5a6e2cd55..f80feee48 100644 --- a/winpr/libwinpr/rpc/ndr_union.h +++ b/winpr/libwinpr/rpc/ndr_union.h @@ -24,8 +24,10 @@ #ifndef _WIN32 -void NdrEncapsulatedUnionBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); -void NdrNonEncapsulatedUnionBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat); +void NdrEncapsulatedUnionBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); +void NdrNonEncapsulatedUnionBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, + PFORMAT_STRING pFormat); #endif diff --git a/winpr/libwinpr/rpc/rpc.c b/winpr/libwinpr/rpc/rpc.c index 8976f3787..1695934ce 100644 --- a/winpr/libwinpr/rpc/rpc.c +++ b/winpr/libwinpr/rpc/rpc.c @@ -30,8 +30,7 @@ #include "../log.h" #define TAG WINPR_TAG("rpc") -RPC_STATUS RpcBindingCopy(RPC_BINDING_HANDLE SourceBinding, - RPC_BINDING_HANDLE* DestinationBinding) +RPC_STATUS RpcBindingCopy(RPC_BINDING_HANDLE SourceBinding, RPC_BINDING_HANDLE* DestinationBinding) { WLog_ERR(TAG, "Not implemented"); return 0; @@ -43,36 +42,33 @@ RPC_STATUS RpcBindingFree(RPC_BINDING_HANDLE* Binding) return 0; } -RPC_STATUS RpcBindingSetOption(RPC_BINDING_HANDLE hBinding, - unsigned long option, ULONG_PTR optionValue) +RPC_STATUS RpcBindingSetOption(RPC_BINDING_HANDLE hBinding, unsigned long option, + ULONG_PTR optionValue) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcBindingInqOption(RPC_BINDING_HANDLE hBinding, - unsigned long option, ULONG_PTR* pOptionValue) +RPC_STATUS RpcBindingInqOption(RPC_BINDING_HANDLE hBinding, unsigned long option, + ULONG_PTR* pOptionValue) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcBindingFromStringBindingA(RPC_CSTR StringBinding, - RPC_BINDING_HANDLE* Binding) +RPC_STATUS RpcBindingFromStringBindingA(RPC_CSTR StringBinding, RPC_BINDING_HANDLE* Binding) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcBindingFromStringBindingW(RPC_WSTR StringBinding, - RPC_BINDING_HANDLE* Binding) +RPC_STATUS RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE* Binding) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcSsGetContextBinding(void* ContextHandle, - RPC_BINDING_HANDLE* Binding) +RPC_STATUS RpcSsGetContextBinding(void* ContextHandle, RPC_BINDING_HANDLE* Binding) { WLog_ERR(TAG, "Not implemented"); return 0; @@ -96,22 +92,19 @@ RPC_STATUS RpcBindingSetObject(RPC_BINDING_HANDLE Binding, UUID* ObjectUuid) return 0; } -RPC_STATUS RpcMgmtInqDefaultProtectLevel(unsigned long AuthnSvc, - unsigned long* AuthnLevel) +RPC_STATUS RpcMgmtInqDefaultProtectLevel(unsigned long AuthnSvc, unsigned long* AuthnLevel) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcBindingToStringBindingA(RPC_BINDING_HANDLE Binding, - RPC_CSTR* StringBinding) +RPC_STATUS RpcBindingToStringBindingA(RPC_BINDING_HANDLE Binding, RPC_CSTR* StringBinding) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcBindingToStringBindingW(RPC_BINDING_HANDLE Binding, - RPC_WSTR* StringBinding) +RPC_STATUS RpcBindingToStringBindingW(RPC_BINDING_HANDLE Binding, RPC_WSTR* StringBinding) { WLog_ERR(TAG, "Not implemented"); return 0; @@ -123,33 +116,31 @@ RPC_STATUS RpcBindingVectorFree(RPC_BINDING_VECTOR** BindingVector) return 0; } -RPC_STATUS RpcStringBindingComposeA(RPC_CSTR ObjUuid, RPC_CSTR Protseq, - RPC_CSTR NetworkAddr, +RPC_STATUS RpcStringBindingComposeA(RPC_CSTR ObjUuid, RPC_CSTR Protseq, RPC_CSTR NetworkAddr, RPC_CSTR Endpoint, RPC_CSTR Options, RPC_CSTR* StringBinding) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, - RPC_WSTR NetworkAddr, +RPC_STATUS RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr, RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR* StringBinding) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcStringBindingParseA(RPC_CSTR StringBinding, RPC_CSTR* ObjUuid, - RPC_CSTR* Protseq, - RPC_CSTR* NetworkAddr, RPC_CSTR* Endpoint, RPC_CSTR* NetworkOptions) +RPC_STATUS RpcStringBindingParseA(RPC_CSTR StringBinding, RPC_CSTR* ObjUuid, RPC_CSTR* Protseq, + RPC_CSTR* NetworkAddr, RPC_CSTR* Endpoint, + RPC_CSTR* NetworkOptions) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcStringBindingParseW(RPC_WSTR StringBinding, RPC_WSTR* ObjUuid, - RPC_WSTR* Protseq, - RPC_WSTR* NetworkAddr, RPC_WSTR* Endpoint, RPC_WSTR* NetworkOptions) +RPC_STATUS RpcStringBindingParseW(RPC_WSTR StringBinding, RPC_WSTR* ObjUuid, RPC_WSTR* Protseq, + RPC_WSTR* NetworkAddr, RPC_WSTR* Endpoint, + RPC_WSTR* NetworkOptions) { WLog_ERR(TAG, "Not implemented"); return 0; @@ -189,15 +180,13 @@ RPC_STATUS RpcNetworkIsProtseqValidW(RPC_WSTR Protseq) return 0; } -RPC_STATUS RpcMgmtInqComTimeout(RPC_BINDING_HANDLE Binding, - unsigned int* Timeout) +RPC_STATUS RpcMgmtInqComTimeout(RPC_BINDING_HANDLE Binding, unsigned int* Timeout) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcMgmtSetComTimeout(RPC_BINDING_HANDLE Binding, - unsigned int Timeout) +RPC_STATUS RpcMgmtSetComTimeout(RPC_BINDING_HANDLE Binding, unsigned int Timeout) { WLog_ERR(TAG, "Not implemented"); return 0; @@ -257,37 +246,34 @@ RPC_STATUS RpcServerInqBindings(RPC_BINDING_VECTOR** BindingVector) return 0; } -RPC_STATUS RpcServerInqIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, - RPC_MGR_EPV** MgrEpv) +RPC_STATUS RpcServerInqIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV** MgrEpv) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerListen(unsigned int MinimumCallThreads, - unsigned int MaxCalls, unsigned int DontWait) +RPC_STATUS RpcServerListen(unsigned int MinimumCallThreads, unsigned int MaxCalls, + unsigned int DontWait) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, - RPC_MGR_EPV* MgrEpv) +RPC_STATUS RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerRegisterIfEx(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, - RPC_MGR_EPV* MgrEpv, - unsigned int Flags, unsigned int MaxCalls, RPC_IF_CALLBACK_FN* IfCallback) +RPC_STATUS RpcServerRegisterIfEx(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv, + unsigned int Flags, unsigned int MaxCalls, + RPC_IF_CALLBACK_FN* IfCallback) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerRegisterIf2(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, - RPC_MGR_EPV* MgrEpv, +RPC_STATUS RpcServerRegisterIf2(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv, unsigned int Flags, unsigned int MaxCalls, unsigned int MaxRpcSize, RPC_IF_CALLBACK_FN* IfCallbackFn) { @@ -309,113 +295,110 @@ RPC_STATUS RpcServerUnregisterIfEx(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, return 0; } -RPC_STATUS RpcServerUseAllProtseqs(unsigned int MaxCalls, - void* SecurityDescriptor) +RPC_STATUS RpcServerUseAllProtseqs(unsigned int MaxCalls, void* SecurityDescriptor) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerUseAllProtseqsEx(unsigned int MaxCalls, - void* SecurityDescriptor, PRPC_POLICY Policy) +RPC_STATUS RpcServerUseAllProtseqsEx(unsigned int MaxCalls, void* SecurityDescriptor, + PRPC_POLICY Policy) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerUseAllProtseqsIf(unsigned int MaxCalls, - RPC_IF_HANDLE IfSpec, void* SecurityDescriptor) +RPC_STATUS RpcServerUseAllProtseqsIf(unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, + void* SecurityDescriptor) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerUseAllProtseqsIfEx(unsigned int MaxCalls, - RPC_IF_HANDLE IfSpec, void* SecurityDescriptor, PRPC_POLICY Policy) +RPC_STATUS RpcServerUseAllProtseqsIfEx(unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, + void* SecurityDescriptor, PRPC_POLICY Policy) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerUseProtseqA(RPC_CSTR Protseq, unsigned int MaxCalls, - void* SecurityDescriptor) +RPC_STATUS RpcServerUseProtseqA(RPC_CSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerUseProtseqExA(RPC_CSTR Protseq, unsigned int MaxCalls, - void* SecurityDescriptor, PRPC_POLICY Policy) +RPC_STATUS RpcServerUseProtseqExA(RPC_CSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor, + PRPC_POLICY Policy) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerUseProtseqW(RPC_WSTR Protseq, unsigned int MaxCalls, - void* SecurityDescriptor) +RPC_STATUS RpcServerUseProtseqW(RPC_WSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerUseProtseqExW(RPC_WSTR Protseq, unsigned int MaxCalls, - void* SecurityDescriptor, PRPC_POLICY Policy) +RPC_STATUS RpcServerUseProtseqExW(RPC_WSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor, + PRPC_POLICY Policy) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerUseProtseqEpA(RPC_CSTR Protseq, unsigned int MaxCalls, - RPC_CSTR Endpoint, void* SecurityDescriptor) +RPC_STATUS RpcServerUseProtseqEpA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_CSTR Endpoint, + void* SecurityDescriptor) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerUseProtseqEpExA(RPC_CSTR Protseq, unsigned int MaxCalls, - RPC_CSTR Endpoint, void* SecurityDescriptor, PRPC_POLICY Policy) +RPC_STATUS RpcServerUseProtseqEpExA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_CSTR Endpoint, + void* SecurityDescriptor, PRPC_POLICY Policy) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerUseProtseqEpW(RPC_WSTR Protseq, unsigned int MaxCalls, - RPC_WSTR Endpoint, void* SecurityDescriptor) +RPC_STATUS RpcServerUseProtseqEpW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_WSTR Endpoint, + void* SecurityDescriptor) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerUseProtseqEpExW(RPC_WSTR Protseq, unsigned int MaxCalls, - RPC_WSTR Endpoint, void* SecurityDescriptor, PRPC_POLICY Policy) +RPC_STATUS RpcServerUseProtseqEpExW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_WSTR Endpoint, + void* SecurityDescriptor, PRPC_POLICY Policy) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerUseProtseqIfA(RPC_CSTR Protseq, unsigned int MaxCalls, - RPC_IF_HANDLE IfSpec, void* SecurityDescriptor) +RPC_STATUS RpcServerUseProtseqIfA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, + void* SecurityDescriptor) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerUseProtseqIfExA(RPC_CSTR Protseq, unsigned int MaxCalls, - RPC_IF_HANDLE IfSpec, void* SecurityDescriptor, PRPC_POLICY Policy) +RPC_STATUS RpcServerUseProtseqIfExA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, + void* SecurityDescriptor, PRPC_POLICY Policy) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerUseProtseqIfW(RPC_WSTR Protseq, unsigned int MaxCalls, - RPC_IF_HANDLE IfSpec, void* SecurityDescriptor) +RPC_STATUS RpcServerUseProtseqIfW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, + void* SecurityDescriptor) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerUseProtseqIfExW(RPC_WSTR Protseq, unsigned int MaxCalls, - RPC_IF_HANDLE IfSpec, void* SecurityDescriptor, PRPC_POLICY Policy) +RPC_STATUS RpcServerUseProtseqIfExW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, + void* SecurityDescriptor, PRPC_POLICY Policy) { WLog_ERR(TAG, "Not implemented"); return 0; @@ -432,8 +415,7 @@ RPC_STATUS RpcMgmtStatsVectorFree(RPC_STATS_VECTOR** StatsVector) return 0; } -RPC_STATUS RpcMgmtInqStats(RPC_BINDING_HANDLE Binding, - RPC_STATS_VECTOR** Statistics) +RPC_STATUS RpcMgmtInqStats(RPC_BINDING_HANDLE Binding, RPC_STATS_VECTOR** Statistics) { WLog_ERR(TAG, "Not implemented"); return 0; @@ -474,8 +456,7 @@ RPC_STATUS RpcMgmtEnableIdleCleanup(void) return 0; } -RPC_STATUS RpcMgmtInqIfIds(RPC_BINDING_HANDLE Binding, - RPC_IF_ID_VECTOR** IfIdVector) +RPC_STATUS RpcMgmtInqIfIds(RPC_BINDING_HANDLE Binding, RPC_IF_ID_VECTOR** IfIdVector) { WLog_ERR(TAG, "Not implemented"); return 0; @@ -487,29 +468,27 @@ RPC_STATUS RpcIfIdVectorFree(RPC_IF_ID_VECTOR** IfIdVector) return 0; } -RPC_STATUS RpcMgmtInqServerPrincNameA(RPC_BINDING_HANDLE Binding, - unsigned long AuthnSvc, RPC_CSTR* ServerPrincName) +RPC_STATUS RpcMgmtInqServerPrincNameA(RPC_BINDING_HANDLE Binding, unsigned long AuthnSvc, + RPC_CSTR* ServerPrincName) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcMgmtInqServerPrincNameW(RPC_BINDING_HANDLE Binding, - unsigned long AuthnSvc, RPC_WSTR* ServerPrincName) +RPC_STATUS RpcMgmtInqServerPrincNameW(RPC_BINDING_HANDLE Binding, unsigned long AuthnSvc, + RPC_WSTR* ServerPrincName) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerInqDefaultPrincNameA(unsigned long AuthnSvc, - RPC_CSTR* PrincName) +RPC_STATUS RpcServerInqDefaultPrincNameA(unsigned long AuthnSvc, RPC_CSTR* PrincName) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerInqDefaultPrincNameW(unsigned long AuthnSvc, - RPC_WSTR* PrincName) +RPC_STATUS RpcServerInqDefaultPrincNameW(unsigned long AuthnSvc, RPC_WSTR* PrincName) { WLog_ERR(TAG, "Not implemented"); return 0; @@ -521,21 +500,20 @@ RPC_STATUS RpcEpResolveBinding(RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE IfSpec) return 0; } -RPC_STATUS RpcNsBindingInqEntryNameA(RPC_BINDING_HANDLE Binding, - unsigned long EntryNameSyntax, RPC_CSTR* EntryName) +RPC_STATUS RpcNsBindingInqEntryNameA(RPC_BINDING_HANDLE Binding, unsigned long EntryNameSyntax, + RPC_CSTR* EntryName) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcNsBindingInqEntryNameW(RPC_BINDING_HANDLE Binding, - unsigned long EntryNameSyntax, RPC_WSTR* EntryName) +RPC_STATUS RpcNsBindingInqEntryNameW(RPC_BINDING_HANDLE Binding, unsigned long EntryNameSyntax, + RPC_WSTR* EntryName) { WLog_ERR(TAG, "Not implemented"); return 0; } - RPC_STATUS RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle) { WLog_ERR(TAG, "Not implemented"); @@ -554,131 +532,121 @@ RPC_STATUS RpcRevertToSelf() return 0; } -RPC_STATUS RpcBindingInqAuthClientA(RPC_BINDING_HANDLE ClientBinding, - RPC_AUTHZ_HANDLE* Privs, - RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc, - unsigned long* AuthzSvc) -{ - WLog_ERR(TAG, "Not implemented"); - return 0; -} - -RPC_STATUS RpcBindingInqAuthClientW(RPC_BINDING_HANDLE ClientBinding, - RPC_AUTHZ_HANDLE* Privs, - RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc, - unsigned long* AuthzSvc) -{ - WLog_ERR(TAG, "Not implemented"); - return 0; -} - -RPC_STATUS RpcBindingInqAuthClientExA(RPC_BINDING_HANDLE ClientBinding, - RPC_AUTHZ_HANDLE* Privs, - RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc, - unsigned long* AuthzSvc, unsigned long Flags) -{ - WLog_ERR(TAG, "Not implemented"); - return 0; -} - -RPC_STATUS RpcBindingInqAuthClientExW(RPC_BINDING_HANDLE ClientBinding, - RPC_AUTHZ_HANDLE* Privs, - RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc, - unsigned long* AuthzSvc, unsigned long Flags) -{ - WLog_ERR(TAG, "Not implemented"); - return 0; -} - -RPC_STATUS RpcBindingInqAuthInfoA(RPC_BINDING_HANDLE Binding, - RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel, - unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, - unsigned long* AuthzSvc) -{ - WLog_ERR(TAG, "Not implemented"); - return 0; -} - -RPC_STATUS RpcBindingInqAuthInfoW(RPC_BINDING_HANDLE Binding, - RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel, - unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, - unsigned long* AuthzSvc) -{ - WLog_ERR(TAG, "Not implemented"); - return 0; -} - -RPC_STATUS RpcBindingSetAuthInfoA(RPC_BINDING_HANDLE Binding, - RPC_CSTR ServerPrincName, unsigned long AuthnLevel, - unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, - unsigned long AuthzSvc) -{ - WLog_ERR(TAG, "Not implemented"); - return 0; -} - -RPC_STATUS RpcBindingSetAuthInfoExA(RPC_BINDING_HANDLE Binding, - RPC_CSTR ServerPrincName, unsigned long AuthnLevel, - unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, - unsigned long AuthzSvc, RPC_SECURITY_QOS* SecurityQos) -{ - WLog_ERR(TAG, "Not implemented"); - return 0; -} - -RPC_STATUS RpcBindingSetAuthInfoW(RPC_BINDING_HANDLE Binding, - RPC_WSTR ServerPrincName, unsigned long AuthnLevel, - unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, - unsigned long AuthzSvc) -{ - WLog_ERR(TAG, "Not implemented"); - return 0; -} - -RPC_STATUS RpcBindingSetAuthInfoExW(RPC_BINDING_HANDLE Binding, - RPC_WSTR ServerPrincName, unsigned long AuthnLevel, - unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, - unsigned long AuthzSvc, RPC_SECURITY_QOS* SecurityQOS) -{ - WLog_ERR(TAG, "Not implemented"); - return 0; -} - -RPC_STATUS RpcBindingInqAuthInfoExA(RPC_BINDING_HANDLE Binding, +RPC_STATUS RpcBindingInqAuthClientA(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs, RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel, - unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, - unsigned long* AuthzSvc, - unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS) + unsigned long* AuthnSvc, unsigned long* AuthzSvc) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcBindingInqAuthInfoExW(RPC_BINDING_HANDLE Binding, +RPC_STATUS RpcBindingInqAuthClientW(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs, RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel, - unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, - unsigned long* AuthzSvc, + unsigned long* AuthnSvc, unsigned long* AuthzSvc) +{ + WLog_ERR(TAG, "Not implemented"); + return 0; +} + +RPC_STATUS RpcBindingInqAuthClientExA(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs, + RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel, + unsigned long* AuthnSvc, unsigned long* AuthzSvc, + unsigned long Flags) +{ + WLog_ERR(TAG, "Not implemented"); + return 0; +} + +RPC_STATUS RpcBindingInqAuthClientExW(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs, + RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel, + unsigned long* AuthnSvc, unsigned long* AuthzSvc, + unsigned long Flags) +{ + WLog_ERR(TAG, "Not implemented"); + return 0; +} + +RPC_STATUS RpcBindingInqAuthInfoA(RPC_BINDING_HANDLE Binding, RPC_CSTR* ServerPrincName, + unsigned long* AuthnLevel, unsigned long* AuthnSvc, + RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc) +{ + WLog_ERR(TAG, "Not implemented"); + return 0; +} + +RPC_STATUS RpcBindingInqAuthInfoW(RPC_BINDING_HANDLE Binding, RPC_WSTR* ServerPrincName, + unsigned long* AuthnLevel, unsigned long* AuthnSvc, + RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc) +{ + WLog_ERR(TAG, "Not implemented"); + return 0; +} + +RPC_STATUS RpcBindingSetAuthInfoA(RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, + unsigned long AuthnLevel, unsigned long AuthnSvc, + RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc) +{ + WLog_ERR(TAG, "Not implemented"); + return 0; +} + +RPC_STATUS RpcBindingSetAuthInfoExA(RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, + unsigned long AuthnLevel, unsigned long AuthnSvc, + RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc, + RPC_SECURITY_QOS* SecurityQos) +{ + WLog_ERR(TAG, "Not implemented"); + return 0; +} + +RPC_STATUS RpcBindingSetAuthInfoW(RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, + unsigned long AuthnLevel, unsigned long AuthnSvc, + RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc) +{ + WLog_ERR(TAG, "Not implemented"); + return 0; +} + +RPC_STATUS RpcBindingSetAuthInfoExW(RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, + unsigned long AuthnLevel, unsigned long AuthnSvc, + RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc, + RPC_SECURITY_QOS* SecurityQOS) +{ + WLog_ERR(TAG, "Not implemented"); + return 0; +} + +RPC_STATUS RpcBindingInqAuthInfoExA(RPC_BINDING_HANDLE Binding, RPC_CSTR* ServerPrincName, + unsigned long* AuthnLevel, unsigned long* AuthnSvc, + RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc, unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS) { WLog_ERR(TAG, "Not implemented"); return 0; } - -RPC_STATUS RpcServerRegisterAuthInfoA(RPC_CSTR ServerPrincName, - unsigned long AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg) +RPC_STATUS RpcBindingInqAuthInfoExW(RPC_BINDING_HANDLE Binding, RPC_WSTR* ServerPrincName, + unsigned long* AuthnLevel, unsigned long* AuthnSvc, + RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc, + unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcServerRegisterAuthInfoW(RPC_WSTR ServerPrincName, - unsigned long AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg) +RPC_STATUS RpcServerRegisterAuthInfoA(RPC_CSTR ServerPrincName, unsigned long AuthnSvc, + RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg) { WLog_ERR(TAG, "Not implemented"); return 0; } +RPC_STATUS RpcServerRegisterAuthInfoW(RPC_WSTR ServerPrincName, unsigned long AuthnSvc, + RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg) +{ + WLog_ERR(TAG, "Not implemented"); + return 0; +} RPC_STATUS RpcBindingServerFromClient(RPC_BINDING_HANDLE ClientBinding, RPC_BINDING_HANDLE* ServerBinding) @@ -690,7 +658,7 @@ RPC_STATUS RpcBindingServerFromClient(RPC_BINDING_HANDLE ClientBinding, void RpcRaiseException(RPC_STATUS exception) { WLog_ERR(TAG, "RpcRaiseException: 0x%08luX", exception); - exit((int) exception); + exit((int)exception); } RPC_STATUS RpcTestCancel() @@ -721,27 +689,25 @@ RPC_STATUS RpcCancelThreadEx(void* Thread, long Timeout) * UUID Functions */ -static UUID UUID_NIL = -{ - 0x00000000, 0x0000, 0x0000, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } +static UUID UUID_NIL = { + 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }; RPC_STATUS UuidCreate(UUID* Uuid) { - winpr_RAND_pseudo((BYTE*) Uuid, 16); + winpr_RAND_pseudo((BYTE*)Uuid, 16); return RPC_S_OK; } RPC_STATUS UuidCreateSequential(UUID* Uuid) { - winpr_RAND_pseudo((BYTE*) Uuid, 16); + winpr_RAND_pseudo((BYTE*)Uuid, 16); return RPC_S_OK; } RPC_STATUS UuidToStringA(const UUID* Uuid, RPC_CSTR* StringUuid) { - *StringUuid = (RPC_CSTR) malloc(36 + 1); + *StringUuid = (RPC_CSTR)malloc(36 + 1); if (!(*StringUuid)) return RPC_S_OUT_OF_MEMORY; @@ -753,12 +719,9 @@ RPC_STATUS UuidToStringA(const UUID* Uuid, RPC_CSTR* StringUuid) * Format is 32 hex digits partitioned in 5 groups: * xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx */ - sprintf_s((char*) *StringUuid, 36 + 1, - "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", - Uuid->Data1, Uuid->Data2, Uuid->Data3, - Uuid->Data4[0], Uuid->Data4[1], - Uuid->Data4[2], Uuid->Data4[3], Uuid->Data4[4], - Uuid->Data4[5], Uuid->Data4[6], Uuid->Data4[7]); + sprintf_s((char*)*StringUuid, 36 + 1, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", + Uuid->Data1, Uuid->Data2, Uuid->Data3, Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2], + Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5], Uuid->Data4[6], Uuid->Data4[7]); return RPC_S_OK; } @@ -776,11 +739,11 @@ RPC_STATUS UuidFromStringA(RPC_CSTR StringUuid, UUID* Uuid) if (!StringUuid) return UuidCreateNil(Uuid); - if (strlen((char*) StringUuid) != 36) + if (strlen((char*)StringUuid) != 36) return RPC_S_INVALID_STRING_UUID; - if ((StringUuid[8] != '-') || (StringUuid[13] != '-') || - (StringUuid[18] != '-') || (StringUuid[23] != '-')) + if ((StringUuid[8] != '-') || (StringUuid[13] != '-') || (StringUuid[18] != '-') || + (StringUuid[23] != '-')) { return RPC_S_INVALID_STRING_UUID; } @@ -800,8 +763,7 @@ RPC_STATUS UuidFromStringA(RPC_CSTR StringUuid, UUID* Uuid) return RPC_S_INVALID_STRING_UUID; } - Uuid->Data1 = ((bin[0] << 28) | (bin[1] << 24) | (bin[2] << 20) | - (bin[3] << 16) | + Uuid->Data1 = ((bin[0] << 28) | (bin[1] << 24) | (bin[2] << 20) | (bin[3] << 16) | (bin[4] << 12) | (bin[5] << 8) | (bin[6] << 4) | bin[7]); Uuid->Data2 = ((bin[9] << 12) | (bin[10] << 8) | (bin[11] << 4) | bin[12]); Uuid->Data3 = ((bin[14] << 12) | (bin[15] << 8) | (bin[16] << 4) | bin[17]); @@ -853,7 +815,7 @@ signed int UuidCompare(const UUID* Uuid1, const UUID* Uuid2, RPC_STATUS* Status) RPC_STATUS UuidCreateNil(UUID* NilUuid) { - CopyMemory((void*) NilUuid, (void*) &UUID_NIL, 16); + CopyMemory((void*)NilUuid, (void*)&UUID_NIL, 16); return RPC_S_OK; } @@ -873,42 +835,41 @@ int UuidIsNil(const UUID* Uuid, RPC_STATUS* Status) return UuidEqual(Uuid, &UUID_NIL, Status); } -RPC_STATUS RpcEpRegisterNoReplaceA(RPC_IF_HANDLE IfSpec, - RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, RPC_CSTR Annotation) +RPC_STATUS RpcEpRegisterNoReplaceA(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, + UUID_VECTOR* UuidVector, RPC_CSTR Annotation) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcEpRegisterNoReplaceW(RPC_IF_HANDLE IfSpec, - RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, RPC_WSTR Annotation) +RPC_STATUS RpcEpRegisterNoReplaceW(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, + UUID_VECTOR* UuidVector, RPC_WSTR Annotation) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcEpRegisterA(RPC_IF_HANDLE IfSpec, - RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, RPC_CSTR Annotation) +RPC_STATUS RpcEpRegisterA(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, + UUID_VECTOR* UuidVector, RPC_CSTR Annotation) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcEpRegisterW(RPC_IF_HANDLE IfSpec, - RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, RPC_WSTR Annotation) +RPC_STATUS RpcEpRegisterW(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, + UUID_VECTOR* UuidVector, RPC_WSTR Annotation) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcEpUnregister(RPC_IF_HANDLE IfSpec, - RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector) +RPC_STATUS RpcEpUnregister(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, + UUID_VECTOR* UuidVector) { WLog_ERR(TAG, "Not implemented"); return 0; } - RPC_STATUS DceErrorInqTextA(RPC_STATUS RpcStatus, RPC_CSTR ErrorText) { WLog_ERR(TAG, "Not implemented"); @@ -921,10 +882,9 @@ RPC_STATUS DceErrorInqTextW(RPC_STATUS RpcStatus, RPC_WSTR ErrorText) return 0; } - -RPC_STATUS RpcMgmtEpEltInqBegin(RPC_BINDING_HANDLE EpBinding, - unsigned long InquiryType, RPC_IF_ID* IfId, - unsigned long VersOption, UUID* ObjectUuid, RPC_EP_INQ_HANDLE* InquiryContext) +RPC_STATUS RpcMgmtEpEltInqBegin(RPC_BINDING_HANDLE EpBinding, unsigned long InquiryType, + RPC_IF_ID* IfId, unsigned long VersOption, UUID* ObjectUuid, + RPC_EP_INQ_HANDLE* InquiryContext) { WLog_ERR(TAG, "Not implemented"); return 0; @@ -936,16 +896,14 @@ RPC_STATUS RpcMgmtEpEltInqDone(RPC_EP_INQ_HANDLE* InquiryContext) return 0; } -RPC_STATUS RpcMgmtEpEltInqNextA(RPC_EP_INQ_HANDLE InquiryContext, - RPC_IF_ID* IfId, +RPC_STATUS RpcMgmtEpEltInqNextA(RPC_EP_INQ_HANDLE InquiryContext, RPC_IF_ID* IfId, RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid, RPC_CSTR* Annotation) { WLog_ERR(TAG, "Not implemented"); return 0; } -RPC_STATUS RpcMgmtEpEltInqNextW(RPC_EP_INQ_HANDLE InquiryContext, - RPC_IF_ID* IfId, +RPC_STATUS RpcMgmtEpEltInqNextW(RPC_EP_INQ_HANDLE InquiryContext, RPC_IF_ID* IfId, RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid, RPC_WSTR* Annotation) { WLog_ERR(TAG, "Not implemented"); @@ -965,7 +923,6 @@ RPC_STATUS RpcMgmtSetAuthorizationFn(RPC_MGMT_AUTHORIZATION_FN AuthorizationFn) return 0; } - RPC_STATUS RpcServerInqBindingHandle(RPC_BINDING_HANDLE* Binding) { WLog_ERR(TAG, "Not implemented"); diff --git a/winpr/libwinpr/security/security.c b/winpr/libwinpr/security/security.c index b7f39d281..e79fb7af8 100644 --- a/winpr/libwinpr/security/security.c +++ b/winpr/libwinpr/security/security.c @@ -141,43 +141,50 @@ BOOL IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor) } BOOL GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR pSecurityDescriptor, - PSECURITY_DESCRIPTOR_CONTROL pControl, LPDWORD lpdwRevision) + PSECURITY_DESCRIPTOR_CONTROL pControl, LPDWORD lpdwRevision) { return TRUE; } BOOL SetSecurityDescriptorControl(PSECURITY_DESCRIPTOR pSecurityDescriptor, - SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest, SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet) + SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest, + SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet) { return TRUE; } -BOOL GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbDaclPresent, PACL* pDacl, LPBOOL lpbDaclDefaulted) +BOOL GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbDaclPresent, + PACL* pDacl, LPBOOL lpbDaclDefaulted) { return TRUE; } -BOOL SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted) +BOOL SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, + PACL pDacl, BOOL bDaclDefaulted) { return TRUE; } -BOOL GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID* pGroup, LPBOOL lpbGroupDefaulted) +BOOL GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID* pGroup, + LPBOOL lpbGroupDefaulted) { return TRUE; } -BOOL SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pGroup, BOOL bGroupDefaulted) +BOOL SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pGroup, + BOOL bGroupDefaulted) { return TRUE; } -BOOL GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID* pOwner, LPBOOL lpbOwnerDefaulted) +BOOL GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID* pOwner, + LPBOOL lpbOwnerDefaulted) { return TRUE; } -BOOL SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pOwner, BOOL bOwnerDefaulted) +BOOL SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pOwner, + BOOL bOwnerDefaulted) { return TRUE; } @@ -192,15 +199,16 @@ DWORD SetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor, PU return 0; } -BOOL GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbSaclPresent, PACL* pSacl, LPBOOL lpbSaclDefaulted) +BOOL GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbSaclPresent, + PACL* pSacl, LPBOOL lpbSaclDefaulted) { return TRUE; } -BOOL SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bSaclPresent, PACL pSacl, BOOL bSaclDefaulted) +BOOL SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bSaclPresent, + PACL pSacl, BOOL bSaclDefaulted) { return TRUE; } #endif - diff --git a/winpr/libwinpr/security/test/TestSecurityToken.c b/winpr/libwinpr/security/test/TestSecurityToken.c index ccddf72ba..0d877b677 100644 --- a/winpr/libwinpr/security/test/TestSecurityToken.c +++ b/winpr/libwinpr/security/test/TestSecurityToken.c @@ -7,4 +7,3 @@ int TestSecurityToken(int argc, char* argv[]) { return 0; } - diff --git a/winpr/libwinpr/shell/shell.c b/winpr/libwinpr/shell/shell.c index f921b4c7d..88590d90c 100644 --- a/winpr/libwinpr/shell/shell.c +++ b/winpr/libwinpr/shell/shell.c @@ -54,7 +54,7 @@ BOOL GetUserProfileDirectoryA(HANDLE hToken, LPSTR lpProfileDir, LPDWORD lpcchSi struct passwd pwd; struct passwd* pw = NULL; WINPR_ACCESS_TOKEN* token; - token = (WINPR_ACCESS_TOKEN*) hToken; + token = (WINPR_ACCESS_TOKEN*)hToken; if (!token || (token->Type != HANDLE_TYPE_ACCESS_TOKEN) || !lpcchSize) { @@ -67,7 +67,7 @@ BOOL GetUserProfileDirectoryA(HANDLE hToken, LPSTR lpProfileDir, LPDWORD lpcchSi if (buflen == -1) buflen = 8196; - buf = (char*) malloc(buflen); + buf = (char*)malloc(buflen); if (!buf) return FALSE; @@ -115,7 +115,7 @@ BOOL GetUserProfileDirectoryW(HANDLE hToken, LPWSTR lpProfileDir, LPDWORD lpcchS if (lpProfileDir) { - lpProfileDirA = (LPSTR) malloc(cchSizeA); + lpProfileDirA = (LPSTR)malloc(cchSizeA); if (lpProfileDirA == NULL) { @@ -141,4 +141,3 @@ BOOL GetUserProfileDirectoryW(HANDLE hToken, LPWSTR lpProfileDir, LPDWORD lpcchS } #endif - diff --git a/winpr/libwinpr/smartcard/smartcard.c b/winpr/libwinpr/smartcard/smartcard.c index 6f9acb856..78710dd8b 100644 --- a/winpr/libwinpr/smartcard/smartcard.c +++ b/winpr/libwinpr/smartcard/smartcard.c @@ -33,23 +33,23 @@ static INIT_ONCE g_Initialized = INIT_ONCE_STATIC_INIT; static PSCardApiFunctionTable g_SCardApi = NULL; -#define SCARDAPI_STUB_CALL_LONG(_name, ...) \ +#define SCARDAPI_STUB_CALL_LONG(_name, ...) \ InitOnceExecuteOnce(&g_Initialized, InitializeSCardApiStubs, NULL, NULL); \ - if (!g_SCardApi || !g_SCardApi->pfn ## _name) \ - return SCARD_E_NO_SERVICE; \ - return g_SCardApi->pfn ## _name ( __VA_ARGS__ ) + if (!g_SCardApi || !g_SCardApi->pfn##_name) \ + return SCARD_E_NO_SERVICE; \ + return g_SCardApi->pfn##_name(__VA_ARGS__) -#define SCARDAPI_STUB_CALL_HANDLE(_name, ...) \ +#define SCARDAPI_STUB_CALL_HANDLE(_name, ...) \ InitOnceExecuteOnce(&g_Initialized, InitializeSCardApiStubs, NULL, NULL); \ - if (!g_SCardApi || !g_SCardApi->pfn ## _name) \ - return NULL; \ - return g_SCardApi->pfn ## _name ( __VA_ARGS__ ) + if (!g_SCardApi || !g_SCardApi->pfn##_name) \ + return NULL; \ + return g_SCardApi->pfn##_name(__VA_ARGS__) -#define SCARDAPI_STUB_CALL_VOID(_name, ...) \ +#define SCARDAPI_STUB_CALL_VOID(_name, ...) \ InitOnceExecuteOnce(&g_Initialized, InitializeSCardApiStubs, NULL, NULL); \ - if (!g_SCardApi || !g_SCardApi->pfn ## _name) \ - return; \ - g_SCardApi->pfn ## _name ( __VA_ARGS__ ) + if (!g_SCardApi || !g_SCardApi->pfn##_name) \ + return; \ + g_SCardApi->pfn##_name(__VA_ARGS__) /** * Standard Windows Smart Card API @@ -78,11 +78,10 @@ static BOOL CALLBACK InitializeSCardApiStubs(PINIT_ONCE once, PVOID param, PVOID return TRUE; } -WINSCARDAPI LONG WINAPI SCardEstablishContext(DWORD dwScope, - LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext) +WINSCARDAPI LONG WINAPI SCardEstablishContext(DWORD dwScope, LPCVOID pvReserved1, + LPCVOID pvReserved2, LPSCARDCONTEXT phContext) { - SCARDAPI_STUB_CALL_LONG(SCardEstablishContext, - dwScope, pvReserved1, pvReserved2, phContext); + SCARDAPI_STUB_CALL_LONG(SCardEstablishContext, dwScope, pvReserved1, pvReserved2, phContext); } WINSCARDAPI LONG WINAPI SCardReleaseContext(SCARDCONTEXT hContext) @@ -95,82 +94,86 @@ WINSCARDAPI LONG WINAPI SCardIsValidContext(SCARDCONTEXT hContext) SCARDAPI_STUB_CALL_LONG(SCardIsValidContext, hContext); } -WINSCARDAPI LONG WINAPI SCardListReaderGroupsA(SCARDCONTEXT hContext, - LPSTR mszGroups, LPDWORD pcchGroups) +WINSCARDAPI LONG WINAPI SCardListReaderGroupsA(SCARDCONTEXT hContext, LPSTR mszGroups, + LPDWORD pcchGroups) { SCARDAPI_STUB_CALL_LONG(SCardListReaderGroupsA, hContext, mszGroups, pcchGroups); } -WINSCARDAPI LONG WINAPI SCardListReaderGroupsW(SCARDCONTEXT hContext, - LPWSTR mszGroups, LPDWORD pcchGroups) +WINSCARDAPI LONG WINAPI SCardListReaderGroupsW(SCARDCONTEXT hContext, LPWSTR mszGroups, + LPDWORD pcchGroups) { SCARDAPI_STUB_CALL_LONG(SCardListReaderGroupsW, hContext, mszGroups, pcchGroups); } -WINSCARDAPI LONG WINAPI SCardListReadersA(SCARDCONTEXT hContext, - LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders) +WINSCARDAPI LONG WINAPI SCardListReadersA(SCARDCONTEXT hContext, LPCSTR mszGroups, LPSTR mszReaders, + LPDWORD pcchReaders) { SCARDAPI_STUB_CALL_LONG(SCardListReadersA, hContext, mszGroups, mszReaders, pcchReaders); } -WINSCARDAPI LONG WINAPI SCardListReadersW(SCARDCONTEXT hContext, - LPCWSTR mszGroups, LPWSTR mszReaders, LPDWORD pcchReaders) +WINSCARDAPI LONG WINAPI SCardListReadersW(SCARDCONTEXT hContext, LPCWSTR mszGroups, + LPWSTR mszReaders, LPDWORD pcchReaders) { SCARDAPI_STUB_CALL_LONG(SCardListReadersW, hContext, mszGroups, mszReaders, pcchReaders); } -WINSCARDAPI LONG WINAPI SCardListCardsA(SCARDCONTEXT hContext, - LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, CHAR* mszCards, - LPDWORD pcchCards) +WINSCARDAPI LONG WINAPI SCardListCardsA(SCARDCONTEXT hContext, LPCBYTE pbAtr, + LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, + CHAR* mszCards, LPDWORD pcchCards) { - SCARDAPI_STUB_CALL_LONG(SCardListCardsA, hContext, pbAtr, - rgquidInterfaces, cguidInterfaceCount, mszCards, pcchCards); + SCARDAPI_STUB_CALL_LONG(SCardListCardsA, hContext, pbAtr, rgquidInterfaces, cguidInterfaceCount, + mszCards, pcchCards); } -WINSCARDAPI LONG WINAPI SCardListCardsW(SCARDCONTEXT hContext, - LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, WCHAR* mszCards, - LPDWORD pcchCards) +WINSCARDAPI LONG WINAPI SCardListCardsW(SCARDCONTEXT hContext, LPCBYTE pbAtr, + LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, + WCHAR* mszCards, LPDWORD pcchCards) { - SCARDAPI_STUB_CALL_LONG(SCardListCardsW, hContext, pbAtr, - rgquidInterfaces, cguidInterfaceCount, mszCards, pcchCards); + SCARDAPI_STUB_CALL_LONG(SCardListCardsW, hContext, pbAtr, rgquidInterfaces, cguidInterfaceCount, + mszCards, pcchCards); } -WINSCARDAPI LONG WINAPI SCardListInterfacesA(SCARDCONTEXT hContext, - LPCSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces) +WINSCARDAPI LONG WINAPI SCardListInterfacesA(SCARDCONTEXT hContext, LPCSTR szCard, + LPGUID pguidInterfaces, LPDWORD pcguidInterfaces) { - SCARDAPI_STUB_CALL_LONG(SCardListInterfacesA, hContext, szCard, pguidInterfaces, pcguidInterfaces); + SCARDAPI_STUB_CALL_LONG(SCardListInterfacesA, hContext, szCard, pguidInterfaces, + pcguidInterfaces); } -WINSCARDAPI LONG WINAPI SCardListInterfacesW(SCARDCONTEXT hContext, - LPCWSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces) +WINSCARDAPI LONG WINAPI SCardListInterfacesW(SCARDCONTEXT hContext, LPCWSTR szCard, + LPGUID pguidInterfaces, LPDWORD pcguidInterfaces) { - SCARDAPI_STUB_CALL_LONG(SCardListInterfacesW, hContext, szCard, pguidInterfaces, pcguidInterfaces); + SCARDAPI_STUB_CALL_LONG(SCardListInterfacesW, hContext, szCard, pguidInterfaces, + pcguidInterfaces); } -WINSCARDAPI LONG WINAPI SCardGetProviderIdA(SCARDCONTEXT hContext, - LPCSTR szCard, LPGUID pguidProviderId) +WINSCARDAPI LONG WINAPI SCardGetProviderIdA(SCARDCONTEXT hContext, LPCSTR szCard, + LPGUID pguidProviderId) { SCARDAPI_STUB_CALL_LONG(SCardGetProviderIdA, hContext, szCard, pguidProviderId); } -WINSCARDAPI LONG WINAPI SCardGetProviderIdW(SCARDCONTEXT hContext, - LPCWSTR szCard, LPGUID pguidProviderId) +WINSCARDAPI LONG WINAPI SCardGetProviderIdW(SCARDCONTEXT hContext, LPCWSTR szCard, + LPGUID pguidProviderId) { SCARDAPI_STUB_CALL_LONG(SCardGetProviderIdW, hContext, szCard, pguidProviderId); } -WINSCARDAPI LONG WINAPI SCardGetCardTypeProviderNameA(SCARDCONTEXT hContext, - LPCSTR szCardName, DWORD dwProviderId, CHAR* szProvider, LPDWORD pcchProvider) +WINSCARDAPI LONG WINAPI SCardGetCardTypeProviderNameA(SCARDCONTEXT hContext, LPCSTR szCardName, + DWORD dwProviderId, CHAR* szProvider, + LPDWORD pcchProvider) { - SCARDAPI_STUB_CALL_LONG(SCardGetCardTypeProviderNameA, hContext, szCardName, - dwProviderId, szProvider, pcchProvider); + SCARDAPI_STUB_CALL_LONG(SCardGetCardTypeProviderNameA, hContext, szCardName, dwProviderId, + szProvider, pcchProvider); } -WINSCARDAPI LONG WINAPI SCardGetCardTypeProviderNameW(SCARDCONTEXT hContext, - LPCWSTR szCardName, DWORD dwProviderId, WCHAR* szProvider, LPDWORD pcchProvider) +WINSCARDAPI LONG WINAPI SCardGetCardTypeProviderNameW(SCARDCONTEXT hContext, LPCWSTR szCardName, + DWORD dwProviderId, WCHAR* szProvider, + LPDWORD pcchProvider) { - SCARDAPI_STUB_CALL_LONG(SCardGetCardTypeProviderNameW, hContext, szCardName, - dwProviderId, szProvider, pcchProvider); + SCARDAPI_STUB_CALL_LONG(SCardGetCardTypeProviderNameW, hContext, szCardName, dwProviderId, + szProvider, pcchProvider); } WINSCARDAPI LONG WINAPI SCardIntroduceReaderGroupA(SCARDCONTEXT hContext, LPCSTR szGroupName) @@ -193,14 +196,14 @@ WINSCARDAPI LONG WINAPI SCardForgetReaderGroupW(SCARDCONTEXT hContext, LPCWSTR s SCARDAPI_STUB_CALL_LONG(SCardForgetReaderGroupW, hContext, szGroupName); } -WINSCARDAPI LONG WINAPI SCardIntroduceReaderA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPCSTR szDeviceName) +WINSCARDAPI LONG WINAPI SCardIntroduceReaderA(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPCSTR szDeviceName) { SCARDAPI_STUB_CALL_LONG(SCardIntroduceReaderA, hContext, szReaderName, szDeviceName); } -WINSCARDAPI LONG WINAPI SCardIntroduceReaderW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPCWSTR szDeviceName) +WINSCARDAPI LONG WINAPI SCardIntroduceReaderW(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPCWSTR szDeviceName) { SCARDAPI_STUB_CALL_LONG(SCardIntroduceReaderW, hContext, szReaderName, szDeviceName); } @@ -215,55 +218,57 @@ WINSCARDAPI LONG WINAPI SCardForgetReaderW(SCARDCONTEXT hContext, LPCWSTR szRead SCARDAPI_STUB_CALL_LONG(SCardForgetReaderW, hContext, szReaderName); } -WINSCARDAPI LONG WINAPI SCardAddReaderToGroupA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPCSTR szGroupName) +WINSCARDAPI LONG WINAPI SCardAddReaderToGroupA(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPCSTR szGroupName) { SCARDAPI_STUB_CALL_LONG(SCardAddReaderToGroupA, hContext, szReaderName, szGroupName); } -WINSCARDAPI LONG WINAPI SCardAddReaderToGroupW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPCWSTR szGroupName) +WINSCARDAPI LONG WINAPI SCardAddReaderToGroupW(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPCWSTR szGroupName) { SCARDAPI_STUB_CALL_LONG(SCardAddReaderToGroupW, hContext, szReaderName, szGroupName); } -WINSCARDAPI LONG WINAPI SCardRemoveReaderFromGroupA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPCSTR szGroupName) +WINSCARDAPI LONG WINAPI SCardRemoveReaderFromGroupA(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPCSTR szGroupName) { SCARDAPI_STUB_CALL_LONG(SCardRemoveReaderFromGroupA, hContext, szReaderName, szGroupName); } -WINSCARDAPI LONG WINAPI SCardRemoveReaderFromGroupW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPCWSTR szGroupName) +WINSCARDAPI LONG WINAPI SCardRemoveReaderFromGroupW(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPCWSTR szGroupName) { SCARDAPI_STUB_CALL_LONG(SCardRemoveReaderFromGroupW, hContext, szReaderName, szGroupName); } -WINSCARDAPI LONG WINAPI SCardIntroduceCardTypeA(SCARDCONTEXT hContext, - LPCSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, - DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen) +WINSCARDAPI LONG WINAPI SCardIntroduceCardTypeA(SCARDCONTEXT hContext, LPCSTR szCardName, + LPCGUID pguidPrimaryProvider, + LPCGUID rgguidInterfaces, DWORD dwInterfaceCount, + LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen) { SCARDAPI_STUB_CALL_LONG(SCardIntroduceCardTypeA, hContext, szCardName, pguidPrimaryProvider, rgguidInterfaces, dwInterfaceCount, pbAtr, pbAtrMask, cbAtrLen); } -WINSCARDAPI LONG WINAPI SCardIntroduceCardTypeW(SCARDCONTEXT hContext, - LPCWSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, - DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen) +WINSCARDAPI LONG WINAPI SCardIntroduceCardTypeW(SCARDCONTEXT hContext, LPCWSTR szCardName, + LPCGUID pguidPrimaryProvider, + LPCGUID rgguidInterfaces, DWORD dwInterfaceCount, + LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen) { SCARDAPI_STUB_CALL_LONG(SCardIntroduceCardTypeW, hContext, szCardName, pguidPrimaryProvider, rgguidInterfaces, dwInterfaceCount, pbAtr, pbAtrMask, cbAtrLen); } -WINSCARDAPI LONG WINAPI SCardSetCardTypeProviderNameA(SCARDCONTEXT hContext, - LPCSTR szCardName, DWORD dwProviderId, LPCSTR szProvider) +WINSCARDAPI LONG WINAPI SCardSetCardTypeProviderNameA(SCARDCONTEXT hContext, LPCSTR szCardName, + DWORD dwProviderId, LPCSTR szProvider) { SCARDAPI_STUB_CALL_LONG(SCardSetCardTypeProviderNameA, hContext, szCardName, dwProviderId, szProvider); } -WINSCARDAPI LONG WINAPI SCardSetCardTypeProviderNameW(SCARDCONTEXT hContext, - LPCWSTR szCardName, DWORD dwProviderId, LPCWSTR szProvider) +WINSCARDAPI LONG WINAPI SCardSetCardTypeProviderNameW(SCARDCONTEXT hContext, LPCWSTR szCardName, + DWORD dwProviderId, LPCWSTR szProvider) { SCARDAPI_STUB_CALL_LONG(SCardSetCardTypeProviderNameW, hContext, szCardName, dwProviderId, szProvider); @@ -294,40 +299,42 @@ WINSCARDAPI void WINAPI SCardReleaseStartedEvent(void) SCARDAPI_STUB_CALL_VOID(SCardReleaseStartedEvent); } -WINSCARDAPI LONG WINAPI SCardLocateCardsA(SCARDCONTEXT hContext, - LPCSTR mszCards, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders) +WINSCARDAPI LONG WINAPI SCardLocateCardsA(SCARDCONTEXT hContext, LPCSTR mszCards, + LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders) { SCARDAPI_STUB_CALL_LONG(SCardLocateCardsA, hContext, mszCards, rgReaderStates, cReaders); } -WINSCARDAPI LONG WINAPI SCardLocateCardsW(SCARDCONTEXT hContext, - LPCWSTR mszCards, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders) +WINSCARDAPI LONG WINAPI SCardLocateCardsW(SCARDCONTEXT hContext, LPCWSTR mszCards, + LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders) { SCARDAPI_STUB_CALL_LONG(SCardLocateCardsW, hContext, mszCards, rgReaderStates, cReaders); } -WINSCARDAPI LONG WINAPI SCardLocateCardsByATRA(SCARDCONTEXT hContext, - LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders) +WINSCARDAPI LONG WINAPI SCardLocateCardsByATRA(SCARDCONTEXT hContext, LPSCARD_ATRMASK rgAtrMasks, + DWORD cAtrs, LPSCARD_READERSTATEA rgReaderStates, + DWORD cReaders) { SCARDAPI_STUB_CALL_LONG(SCardLocateCardsByATRA, hContext, rgAtrMasks, cAtrs, rgReaderStates, cReaders); } -WINSCARDAPI LONG WINAPI SCardLocateCardsByATRW(SCARDCONTEXT hContext, - LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders) +WINSCARDAPI LONG WINAPI SCardLocateCardsByATRW(SCARDCONTEXT hContext, LPSCARD_ATRMASK rgAtrMasks, + DWORD cAtrs, LPSCARD_READERSTATEW rgReaderStates, + DWORD cReaders) { SCARDAPI_STUB_CALL_LONG(SCardLocateCardsByATRW, hContext, rgAtrMasks, cAtrs, rgReaderStates, cReaders); } -WINSCARDAPI LONG WINAPI SCardGetStatusChangeA(SCARDCONTEXT hContext, - DWORD dwTimeout, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders) +WINSCARDAPI LONG WINAPI SCardGetStatusChangeA(SCARDCONTEXT hContext, DWORD dwTimeout, + LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders) { SCARDAPI_STUB_CALL_LONG(SCardGetStatusChangeA, hContext, dwTimeout, rgReaderStates, cReaders); } -WINSCARDAPI LONG WINAPI SCardGetStatusChangeW(SCARDCONTEXT hContext, - DWORD dwTimeout, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders) +WINSCARDAPI LONG WINAPI SCardGetStatusChangeW(SCARDCONTEXT hContext, DWORD dwTimeout, + LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders) { SCARDAPI_STUB_CALL_LONG(SCardGetStatusChangeW, hContext, dwTimeout, rgReaderStates, cReaders); } @@ -337,27 +344,28 @@ WINSCARDAPI LONG WINAPI SCardCancel(SCARDCONTEXT hContext) SCARDAPI_STUB_CALL_LONG(SCardCancel, hContext); } -WINSCARDAPI LONG WINAPI SCardConnectA(SCARDCONTEXT hContext, - LPCSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, - LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol) +WINSCARDAPI LONG WINAPI SCardConnectA(SCARDCONTEXT hContext, LPCSTR szReader, DWORD dwShareMode, + DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, + LPDWORD pdwActiveProtocol) { - SCARDAPI_STUB_CALL_LONG(SCardConnectA, hContext, szReader, dwShareMode, - dwPreferredProtocols, phCard, pdwActiveProtocol); + SCARDAPI_STUB_CALL_LONG(SCardConnectA, hContext, szReader, dwShareMode, dwPreferredProtocols, + phCard, pdwActiveProtocol); } -WINSCARDAPI LONG WINAPI SCardConnectW(SCARDCONTEXT hContext, - LPCWSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, - LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol) +WINSCARDAPI LONG WINAPI SCardConnectW(SCARDCONTEXT hContext, LPCWSTR szReader, DWORD dwShareMode, + DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, + LPDWORD pdwActiveProtocol) { - SCARDAPI_STUB_CALL_LONG(SCardConnectW, hContext, szReader, dwShareMode, - dwPreferredProtocols, phCard, pdwActiveProtocol); + SCARDAPI_STUB_CALL_LONG(SCardConnectW, hContext, szReader, dwShareMode, dwPreferredProtocols, + phCard, pdwActiveProtocol); } -WINSCARDAPI LONG WINAPI SCardReconnect(SCARDHANDLE hCard, - DWORD dwShareMode, DWORD dwPreferredProtocols, DWORD dwInitialization, LPDWORD pdwActiveProtocol) +WINSCARDAPI LONG WINAPI SCardReconnect(SCARDHANDLE hCard, DWORD dwShareMode, + DWORD dwPreferredProtocols, DWORD dwInitialization, + LPDWORD pdwActiveProtocol) { - SCARDAPI_STUB_CALL_LONG(SCardReconnect, hCard, dwShareMode, - dwPreferredProtocols, dwInitialization, pdwActiveProtocol); + SCARDAPI_STUB_CALL_LONG(SCardReconnect, hCard, dwShareMode, dwPreferredProtocols, + dwInitialization, pdwActiveProtocol); } WINSCARDAPI LONG WINAPI SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition) @@ -380,31 +388,32 @@ WINSCARDAPI LONG WINAPI SCardCancelTransaction(SCARDHANDLE hCard) SCARDAPI_STUB_CALL_LONG(SCardCancelTransaction, hCard); } -WINSCARDAPI LONG WINAPI SCardState(SCARDHANDLE hCard, - LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen) +WINSCARDAPI LONG WINAPI SCardState(SCARDHANDLE hCard, LPDWORD pdwState, LPDWORD pdwProtocol, + LPBYTE pbAtr, LPDWORD pcbAtrLen) { SCARDAPI_STUB_CALL_LONG(SCardState, hCard, pdwState, pdwProtocol, pbAtr, pcbAtrLen); } -WINSCARDAPI LONG WINAPI SCardStatusA(SCARDHANDLE hCard, - LPSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState, - LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen) +WINSCARDAPI LONG WINAPI SCardStatusA(SCARDHANDLE hCard, LPSTR mszReaderNames, LPDWORD pcchReaderLen, + LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, + LPDWORD pcbAtrLen) { - SCARDAPI_STUB_CALL_LONG(SCardStatusA, hCard, mszReaderNames, pcchReaderLen, - pdwState, pdwProtocol, pbAtr, pcbAtrLen); + SCARDAPI_STUB_CALL_LONG(SCardStatusA, hCard, mszReaderNames, pcchReaderLen, pdwState, + pdwProtocol, pbAtr, pcbAtrLen); } -WINSCARDAPI LONG WINAPI SCardStatusW(SCARDHANDLE hCard, - LPWSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState, - LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen) +WINSCARDAPI LONG WINAPI SCardStatusW(SCARDHANDLE hCard, LPWSTR mszReaderNames, + LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, + LPBYTE pbAtr, LPDWORD pcbAtrLen) { - SCARDAPI_STUB_CALL_LONG(SCardStatusW, hCard, mszReaderNames, pcchReaderLen, - pdwState, pdwProtocol, pbAtr, pcbAtrLen); + SCARDAPI_STUB_CALL_LONG(SCardStatusW, hCard, mszReaderNames, pcchReaderLen, pdwState, + pdwProtocol, pbAtr, pcbAtrLen); } -WINSCARDAPI LONG WINAPI SCardTransmit(SCARDHANDLE hCard, - LPCSCARD_IO_REQUEST pioSendPci, LPCBYTE pbSendBuffer, DWORD cbSendLength, - LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength) +WINSCARDAPI LONG WINAPI SCardTransmit(SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pioSendPci, + LPCBYTE pbSendBuffer, DWORD cbSendLength, + LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, + LPDWORD pcbRecvLength) { SCARDAPI_STUB_CALL_LONG(SCardTransmit, hCard, pioSendPci, pbSendBuffer, cbSendLength, pioRecvPci, pbRecvBuffer, pcbRecvLength); @@ -415,9 +424,9 @@ WINSCARDAPI LONG WINAPI SCardGetTransmitCount(SCARDHANDLE hCard, LPDWORD pcTrans SCARDAPI_STUB_CALL_LONG(SCardGetTransmitCount, hCard, pcTransmitCount); } -WINSCARDAPI LONG WINAPI SCardControl(SCARDHANDLE hCard, - DWORD dwControlCode, LPCVOID lpInBuffer, DWORD cbInBufferSize, - LPVOID lpOutBuffer, DWORD cbOutBufferSize, LPDWORD lpBytesReturned) +WINSCARDAPI LONG WINAPI SCardControl(SCARDHANDLE hCard, DWORD dwControlCode, LPCVOID lpInBuffer, + DWORD cbInBufferSize, LPVOID lpOutBuffer, + DWORD cbOutBufferSize, LPDWORD lpBytesReturned) { SCARDAPI_STUB_CALL_LONG(SCardControl, hCard, dwControlCode, lpInBuffer, cbInBufferSize, lpOutBuffer, cbOutBufferSize, lpBytesReturned); @@ -460,84 +469,93 @@ WINSCARDAPI LONG WINAPI SCardDlgExtendedError(void) SCARDAPI_STUB_CALL_LONG(SCardDlgExtendedError); } -WINSCARDAPI LONG WINAPI SCardReadCacheA(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, DWORD* DataLen) +WINSCARDAPI LONG WINAPI SCardReadCacheA(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, + DWORD* DataLen) { - SCARDAPI_STUB_CALL_LONG(SCardReadCacheA, hContext, CardIdentifier, - FreshnessCounter, LookupName, Data, DataLen); + SCARDAPI_STUB_CALL_LONG(SCardReadCacheA, hContext, CardIdentifier, FreshnessCounter, LookupName, + Data, DataLen); } -WINSCARDAPI LONG WINAPI SCardReadCacheW(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD* DataLen) +WINSCARDAPI LONG WINAPI SCardReadCacheW(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, + DWORD* DataLen) { - SCARDAPI_STUB_CALL_LONG(SCardReadCacheW, hContext, CardIdentifier, - FreshnessCounter, LookupName, Data, DataLen); + SCARDAPI_STUB_CALL_LONG(SCardReadCacheW, hContext, CardIdentifier, FreshnessCounter, LookupName, + Data, DataLen); } -WINSCARDAPI LONG WINAPI SCardWriteCacheA(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, DWORD DataLen) +WINSCARDAPI LONG WINAPI SCardWriteCacheA(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, + DWORD DataLen) { - SCARDAPI_STUB_CALL_LONG(SCardWriteCacheA, hContext, CardIdentifier, - FreshnessCounter, LookupName, Data, DataLen); + SCARDAPI_STUB_CALL_LONG(SCardWriteCacheA, hContext, CardIdentifier, FreshnessCounter, + LookupName, Data, DataLen); } -WINSCARDAPI LONG WINAPI SCardWriteCacheW(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD DataLen) +WINSCARDAPI LONG WINAPI SCardWriteCacheW(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, + DWORD DataLen) { - SCARDAPI_STUB_CALL_LONG(SCardWriteCacheW, hContext, CardIdentifier, - FreshnessCounter, LookupName, Data, DataLen); + SCARDAPI_STUB_CALL_LONG(SCardWriteCacheW, hContext, CardIdentifier, FreshnessCounter, + LookupName, Data, DataLen); } -WINSCARDAPI LONG WINAPI SCardGetReaderIconA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon) +WINSCARDAPI LONG WINAPI SCardGetReaderIconA(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPBYTE pbIcon, LPDWORD pcbIcon) { SCARDAPI_STUB_CALL_LONG(SCardGetReaderIconA, hContext, szReaderName, pbIcon, pcbIcon); } -WINSCARDAPI LONG WINAPI SCardGetReaderIconW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon) +WINSCARDAPI LONG WINAPI SCardGetReaderIconW(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPBYTE pbIcon, LPDWORD pcbIcon) { SCARDAPI_STUB_CALL_LONG(SCardGetReaderIconW, hContext, szReaderName, pbIcon, pcbIcon); } WINSCARDAPI LONG WINAPI SCardGetDeviceTypeIdA(SCARDCONTEXT hContext, LPCSTR szReaderName, - LPDWORD pdwDeviceTypeId) + LPDWORD pdwDeviceTypeId) { SCARDAPI_STUB_CALL_LONG(SCardGetDeviceTypeIdA, hContext, szReaderName, pdwDeviceTypeId); } WINSCARDAPI LONG WINAPI SCardGetDeviceTypeIdW(SCARDCONTEXT hContext, LPCWSTR szReaderName, - LPDWORD pdwDeviceTypeId) + LPDWORD pdwDeviceTypeId) { SCARDAPI_STUB_CALL_LONG(SCardGetDeviceTypeIdW, hContext, szReaderName, pdwDeviceTypeId); } -WINSCARDAPI LONG WINAPI SCardGetReaderDeviceInstanceIdA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId) +WINSCARDAPI LONG WINAPI SCardGetReaderDeviceInstanceIdA(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPSTR szDeviceInstanceId, + LPDWORD pcchDeviceInstanceId) { SCARDAPI_STUB_CALL_LONG(SCardGetReaderDeviceInstanceIdA, hContext, szReaderName, szDeviceInstanceId, pcchDeviceInstanceId); } -WINSCARDAPI LONG WINAPI SCardGetReaderDeviceInstanceIdW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPWSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId) +WINSCARDAPI LONG WINAPI SCardGetReaderDeviceInstanceIdW(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPWSTR szDeviceInstanceId, + LPDWORD pcchDeviceInstanceId) { SCARDAPI_STUB_CALL_LONG(SCardGetReaderDeviceInstanceIdW, hContext, szReaderName, szDeviceInstanceId, pcchDeviceInstanceId); } WINSCARDAPI LONG WINAPI SCardListReadersWithDeviceInstanceIdA(SCARDCONTEXT hContext, - LPCSTR szDeviceInstanceId, LPSTR mszReaders, LPDWORD pcchReaders) + LPCSTR szDeviceInstanceId, + LPSTR mszReaders, LPDWORD pcchReaders) { - SCARDAPI_STUB_CALL_LONG(SCardListReadersWithDeviceInstanceIdA, - hContext, szDeviceInstanceId, mszReaders, pcchReaders); + SCARDAPI_STUB_CALL_LONG(SCardListReadersWithDeviceInstanceIdA, hContext, szDeviceInstanceId, + mszReaders, pcchReaders); } WINSCARDAPI LONG WINAPI SCardListReadersWithDeviceInstanceIdW(SCARDCONTEXT hContext, - LPCWSTR szDeviceInstanceId, LPWSTR mszReaders, LPDWORD pcchReaders) + LPCWSTR szDeviceInstanceId, + LPWSTR mszReaders, + LPDWORD pcchReaders) { - SCARDAPI_STUB_CALL_LONG(SCardListReadersWithDeviceInstanceIdW, - hContext, szDeviceInstanceId, mszReaders, pcchReaders); + SCARDAPI_STUB_CALL_LONG(SCardListReadersWithDeviceInstanceIdW, hContext, szDeviceInstanceId, + mszReaders, pcchReaders); } WINSCARDAPI LONG WINAPI SCardAudit(SCARDCONTEXT hContext, DWORD dwEvent) diff --git a/winpr/libwinpr/smartcard/smartcard_inspect.c b/winpr/libwinpr/smartcard/smartcard_inspect.c index 7fa838843..75fc08abc 100644 --- a/winpr/libwinpr/smartcard/smartcard_inspect.c +++ b/winpr/libwinpr/smartcard/smartcard_inspect.c @@ -38,18 +38,18 @@ static PSCardApiFunctionTable g_SCardApi = NULL; * Standard Windows Smart Card API */ -WINSCARDAPI LONG WINAPI Inspect_SCardEstablishContext(DWORD dwScope, - LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext) +WINSCARDAPI LONG WINAPI Inspect_SCardEstablishContext(DWORD dwScope, LPCVOID pvReserved1, + LPCVOID pvReserved2, LPSCARDCONTEXT phContext) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardEstablishContext { dwScope: %s (0x%08"PRIX32")", - SCardGetScopeString(dwScope), dwScope); + WLog_Print(g_Log, WLOG_DEBUG, "SCardEstablishContext { dwScope: %s (0x%08" PRIX32 ")", + SCardGetScopeString(dwScope), dwScope); status = g_SCardApi->pfnSCardEstablishContext(dwScope, pvReserved1, pvReserved2, phContext); - WLog_Print(g_Log, WLOG_DEBUG, "SCardEstablishContext } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardEstablishContext } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -58,12 +58,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardReleaseContext(SCARDCONTEXT hContext) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardReleaseContext { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardReleaseContext { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardReleaseContext(hContext); - WLog_Print(g_Log, WLOG_DEBUG, "SCardReleaseContext } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardReleaseContext } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -72,224 +72,236 @@ WINSCARDAPI LONG WINAPI Inspect_SCardIsValidContext(SCARDCONTEXT hContext) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardIsValidContext { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIsValidContext { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardIsValidContext(hContext); - WLog_Print(g_Log, WLOG_DEBUG, "SCardIsValidContext } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIsValidContext } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardListReaderGroupsA(SCARDCONTEXT hContext, - LPSTR mszGroups, LPDWORD pcchGroups) +WINSCARDAPI LONG WINAPI Inspect_SCardListReaderGroupsA(SCARDCONTEXT hContext, LPSTR mszGroups, + LPDWORD pcchGroups) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReaderGroupsA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReaderGroupsA { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardListReaderGroupsA(hContext, mszGroups, pcchGroups); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReaderGroupsA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReaderGroupsA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardListReaderGroupsW(SCARDCONTEXT hContext, - LPWSTR mszGroups, LPDWORD pcchGroups) +WINSCARDAPI LONG WINAPI Inspect_SCardListReaderGroupsW(SCARDCONTEXT hContext, LPWSTR mszGroups, + LPDWORD pcchGroups) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReaderGroupsW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReaderGroupsW { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardListReaderGroupsW(hContext, mszGroups, pcchGroups); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReaderGroupsW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReaderGroupsW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardListReadersA(SCARDCONTEXT hContext, - LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders) +WINSCARDAPI LONG WINAPI Inspect_SCardListReadersA(SCARDCONTEXT hContext, LPCSTR mszGroups, + LPSTR mszReaders, LPDWORD pcchReaders) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersA { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardListReadersA(hContext, mszGroups, mszReaders, pcchReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardListReadersW(SCARDCONTEXT hContext, - LPCWSTR mszGroups, LPWSTR mszReaders, LPDWORD pcchReaders) +WINSCARDAPI LONG WINAPI Inspect_SCardListReadersW(SCARDCONTEXT hContext, LPCWSTR mszGroups, + LPWSTR mszReaders, LPDWORD pcchReaders) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersW { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardListReadersW(hContext, mszGroups, mszReaders, pcchReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardListCardsA(SCARDCONTEXT hContext, - LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, CHAR* mszCards, LPDWORD pcchCards) +WINSCARDAPI LONG WINAPI Inspect_SCardListCardsA(SCARDCONTEXT hContext, LPCBYTE pbAtr, + LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, + CHAR* mszCards, LPDWORD pcchCards) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListCardsA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListCardsA { hContext: %p", (void*)hContext); - status = g_SCardApi->pfnSCardListCardsA(hContext, pbAtr, - rgquidInterfaces, cguidInterfaceCount, mszCards, pcchCards); + status = g_SCardApi->pfnSCardListCardsA(hContext, pbAtr, rgquidInterfaces, cguidInterfaceCount, + mszCards, pcchCards); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListCardsA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListCardsA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardListCardsW(SCARDCONTEXT hContext, - LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, WCHAR* mszCards, LPDWORD pcchCards) +WINSCARDAPI LONG WINAPI Inspect_SCardListCardsW(SCARDCONTEXT hContext, LPCBYTE pbAtr, + LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, + WCHAR* mszCards, LPDWORD pcchCards) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListCardsW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListCardsW { hContext: %p", (void*)hContext); - status = g_SCardApi->pfnSCardListCardsW(hContext, pbAtr, - rgquidInterfaces, cguidInterfaceCount, mszCards, pcchCards); + status = g_SCardApi->pfnSCardListCardsW(hContext, pbAtr, rgquidInterfaces, cguidInterfaceCount, + mszCards, pcchCards); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListCardsW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListCardsW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardListInterfacesA(SCARDCONTEXT hContext, - LPCSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces) +WINSCARDAPI LONG WINAPI Inspect_SCardListInterfacesA(SCARDCONTEXT hContext, LPCSTR szCard, + LPGUID pguidInterfaces, + LPDWORD pcguidInterfaces) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListInterfacesA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListInterfacesA { hContext: %p", (void*)hContext); - status = g_SCardApi->pfnSCardListInterfacesA(hContext, szCard, pguidInterfaces, pcguidInterfaces); + status = + g_SCardApi->pfnSCardListInterfacesA(hContext, szCard, pguidInterfaces, pcguidInterfaces); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListInterfacesA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListInterfacesA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardListInterfacesW(SCARDCONTEXT hContext, - LPCWSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces) +WINSCARDAPI LONG WINAPI Inspect_SCardListInterfacesW(SCARDCONTEXT hContext, LPCWSTR szCard, + LPGUID pguidInterfaces, + LPDWORD pcguidInterfaces) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListInterfacesW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListInterfacesW { hContext: %p", (void*)hContext); - status = g_SCardApi->pfnSCardListInterfacesW(hContext, szCard, pguidInterfaces, pcguidInterfaces); + status = + g_SCardApi->pfnSCardListInterfacesW(hContext, szCard, pguidInterfaces, pcguidInterfaces); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListInterfacesW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListInterfacesW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardGetProviderIdA(SCARDCONTEXT hContext, - LPCSTR szCard, LPGUID pguidProviderId) +WINSCARDAPI LONG WINAPI Inspect_SCardGetProviderIdA(SCARDCONTEXT hContext, LPCSTR szCard, + LPGUID pguidProviderId) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetProviderIdA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetProviderIdA { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardGetProviderIdA(hContext, szCard, pguidProviderId); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetProviderIdA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetProviderIdA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardGetProviderIdW(SCARDCONTEXT hContext, - LPCWSTR szCard, LPGUID pguidProviderId) +WINSCARDAPI LONG WINAPI Inspect_SCardGetProviderIdW(SCARDCONTEXT hContext, LPCWSTR szCard, + LPGUID pguidProviderId) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetProviderIdW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetProviderIdW { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardGetProviderIdW(hContext, szCard, pguidProviderId); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetProviderIdW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetProviderIdW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } WINSCARDAPI LONG WINAPI Inspect_SCardGetCardTypeProviderNameA(SCARDCONTEXT hContext, - LPCSTR szCardName, DWORD dwProviderId, CHAR* szProvider, LPDWORD pcchProvider) + LPCSTR szCardName, DWORD dwProviderId, + CHAR* szProvider, + LPDWORD pcchProvider) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetCardTypeProviderNameA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetCardTypeProviderNameA { hContext: %p", (void*)hContext); - status = g_SCardApi->pfnSCardGetCardTypeProviderNameA(hContext, szCardName, - dwProviderId, szProvider, pcchProvider); + status = g_SCardApi->pfnSCardGetCardTypeProviderNameA(hContext, szCardName, dwProviderId, + szProvider, pcchProvider); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetCardTypeProviderNameA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetCardTypeProviderNameA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } WINSCARDAPI LONG WINAPI Inspect_SCardGetCardTypeProviderNameW(SCARDCONTEXT hContext, - LPCWSTR szCardName, DWORD dwProviderId, WCHAR* szProvider, LPDWORD pcchProvider) + LPCWSTR szCardName, + DWORD dwProviderId, WCHAR* szProvider, + LPDWORD pcchProvider) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetCardTypeProviderNameW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetCardTypeProviderNameW { hContext: %p", (void*)hContext); - status = g_SCardApi->pfnSCardGetCardTypeProviderNameW(hContext, szCardName, - dwProviderId, szProvider, pcchProvider); + status = g_SCardApi->pfnSCardGetCardTypeProviderNameW(hContext, szCardName, dwProviderId, + szProvider, pcchProvider); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetCardTypeProviderNameW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetCardTypeProviderNameW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardIntroduceReaderGroupA(SCARDCONTEXT hContext, LPCSTR szGroupName) +WINSCARDAPI LONG WINAPI Inspect_SCardIntroduceReaderGroupA(SCARDCONTEXT hContext, + LPCSTR szGroupName) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderGroupA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderGroupA { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardIntroduceReaderGroupA(hContext, szGroupName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderGroupA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderGroupA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardIntroduceReaderGroupW(SCARDCONTEXT hContext, LPCWSTR szGroupName) +WINSCARDAPI LONG WINAPI Inspect_SCardIntroduceReaderGroupW(SCARDCONTEXT hContext, + LPCWSTR szGroupName) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderGroupW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderGroupW { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardIntroduceReaderGroupW(hContext, szGroupName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderGroupW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderGroupW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -298,12 +310,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardForgetReaderGroupA(SCARDCONTEXT hContext, L { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderGroupA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderGroupA { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardForgetReaderGroupA(hContext, szGroupName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderGroupA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderGroupA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -312,42 +324,42 @@ WINSCARDAPI LONG WINAPI Inspect_SCardForgetReaderGroupW(SCARDCONTEXT hContext, L { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderGroupW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderGroupW { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardForgetReaderGroupW(hContext, szGroupName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderGroupW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderGroupW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardIntroduceReaderA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPCSTR szDeviceName) +WINSCARDAPI LONG WINAPI Inspect_SCardIntroduceReaderA(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPCSTR szDeviceName) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderA { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardIntroduceReaderA(hContext, szReaderName, szDeviceName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardIntroduceReaderW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPCWSTR szDeviceName) +WINSCARDAPI LONG WINAPI Inspect_SCardIntroduceReaderW(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPCWSTR szDeviceName) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderW { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardIntroduceReaderW(hContext, szReaderName, szDeviceName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -356,12 +368,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardForgetReaderA(SCARDCONTEXT hContext, LPCSTR { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderA { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardForgetReaderA(hContext, szReaderName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -370,136 +382,148 @@ WINSCARDAPI LONG WINAPI Inspect_SCardForgetReaderW(SCARDCONTEXT hContext, LPCWST { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderW { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardForgetReaderW(hContext, szReaderName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardAddReaderToGroupA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPCSTR szGroupName) +WINSCARDAPI LONG WINAPI Inspect_SCardAddReaderToGroupA(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPCSTR szGroupName) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardAddReaderToGroupA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardAddReaderToGroupA { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardAddReaderToGroupA(hContext, szReaderName, szGroupName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardAddReaderToGroupA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardAddReaderToGroupA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardAddReaderToGroupW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPCWSTR szGroupName) +WINSCARDAPI LONG WINAPI Inspect_SCardAddReaderToGroupW(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPCWSTR szGroupName) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardAddReaderToGroupW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardAddReaderToGroupW { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardAddReaderToGroupW(hContext, szReaderName, szGroupName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardAddReaderToGroupW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardAddReaderToGroupW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } WINSCARDAPI LONG WINAPI Inspect_SCardRemoveReaderFromGroupA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPCSTR szGroupName) + LPCSTR szReaderName, LPCSTR szGroupName) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardRemoveReaderFromGroupA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardRemoveReaderFromGroupA { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardRemoveReaderFromGroupA(hContext, szReaderName, szGroupName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardRemoveReaderFromGroupA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardRemoveReaderFromGroupA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } WINSCARDAPI LONG WINAPI Inspect_SCardRemoveReaderFromGroupW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPCWSTR szGroupName) + LPCWSTR szReaderName, + LPCWSTR szGroupName) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardRemoveReaderFromGroupW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardRemoveReaderFromGroupW { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardRemoveReaderFromGroupW(hContext, szReaderName, szGroupName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardRemoveReaderFromGroupW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardRemoveReaderFromGroupW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardIntroduceCardTypeA(SCARDCONTEXT hContext, - LPCSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, - DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen) +WINSCARDAPI LONG WINAPI Inspect_SCardIntroduceCardTypeA(SCARDCONTEXT hContext, LPCSTR szCardName, + LPCGUID pguidPrimaryProvider, + LPCGUID rgguidInterfaces, + DWORD dwInterfaceCount, LPCBYTE pbAtr, + LPCBYTE pbAtrMask, DWORD cbAtrLen) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceCardTypeA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceCardTypeA { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardIntroduceCardTypeA(hContext, szCardName, pguidPrimaryProvider, - rgguidInterfaces, dwInterfaceCount, pbAtr, pbAtrMask, cbAtrLen); + rgguidInterfaces, dwInterfaceCount, pbAtr, + pbAtrMask, cbAtrLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceCardTypeA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceCardTypeA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardIntroduceCardTypeW(SCARDCONTEXT hContext, - LPCWSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, - DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen) +WINSCARDAPI LONG WINAPI Inspect_SCardIntroduceCardTypeW(SCARDCONTEXT hContext, LPCWSTR szCardName, + LPCGUID pguidPrimaryProvider, + LPCGUID rgguidInterfaces, + DWORD dwInterfaceCount, LPCBYTE pbAtr, + LPCBYTE pbAtrMask, DWORD cbAtrLen) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceCardTypeW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceCardTypeW { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardIntroduceCardTypeW(hContext, szCardName, pguidPrimaryProvider, - rgguidInterfaces, dwInterfaceCount, pbAtr, pbAtrMask, cbAtrLen); + rgguidInterfaces, dwInterfaceCount, pbAtr, + pbAtrMask, cbAtrLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceCardTypeW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceCardTypeW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } WINSCARDAPI LONG WINAPI Inspect_SCardSetCardTypeProviderNameA(SCARDCONTEXT hContext, - LPCSTR szCardName, DWORD dwProviderId, LPCSTR szProvider) + LPCSTR szCardName, DWORD dwProviderId, + LPCSTR szProvider) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardSetCardTypeProviderNameA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardSetCardTypeProviderNameA { hContext: %p", (void*)hContext); - status = g_SCardApi->pfnSCardSetCardTypeProviderNameA(hContext, szCardName, dwProviderId, szProvider); + status = g_SCardApi->pfnSCardSetCardTypeProviderNameA(hContext, szCardName, dwProviderId, + szProvider); - WLog_Print(g_Log, WLOG_DEBUG, "SCardSetCardTypeProviderNameA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardSetCardTypeProviderNameA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } WINSCARDAPI LONG WINAPI Inspect_SCardSetCardTypeProviderNameW(SCARDCONTEXT hContext, - LPCWSTR szCardName, DWORD dwProviderId, LPCWSTR szProvider) + LPCWSTR szCardName, + DWORD dwProviderId, + LPCWSTR szProvider) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardSetCardTypeProviderNameA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardSetCardTypeProviderNameA { hContext: %p", (void*)hContext); - status = g_SCardApi->pfnSCardSetCardTypeProviderNameW(hContext, szCardName, dwProviderId, szProvider); + status = g_SCardApi->pfnSCardSetCardTypeProviderNameW(hContext, szCardName, dwProviderId, + szProvider); - WLog_Print(g_Log, WLOG_DEBUG, "SCardSetCardTypeProviderNameW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardSetCardTypeProviderNameW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -508,12 +532,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardForgetCardTypeA(SCARDCONTEXT hContext, LPCS { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetCardTypeA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetCardTypeA { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardForgetCardTypeA(hContext, szCardName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetCardTypeA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetCardTypeA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -522,12 +546,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardForgetCardTypeW(SCARDCONTEXT hContext, LPCW { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetCardTypeW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetCardTypeW { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardForgetCardTypeW(hContext, szCardName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetCardTypeW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetCardTypeW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -536,12 +560,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardFreeMemory(SCARDCONTEXT hContext, LPCVOID p { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardFreeMemory { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardFreeMemory { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardFreeMemory(hContext, pvMem); - WLog_Print(g_Log, WLOG_DEBUG, "SCardFreeMemory } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardFreeMemory } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -568,92 +592,102 @@ WINSCARDAPI void WINAPI Inspect_SCardReleaseStartedEvent(void) WLog_Print(g_Log, WLOG_DEBUG, "SCardReleaseStartedEvent }"); } -WINSCARDAPI LONG WINAPI Inspect_SCardLocateCardsA(SCARDCONTEXT hContext, - LPCSTR mszCards, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders) +WINSCARDAPI LONG WINAPI Inspect_SCardLocateCardsA(SCARDCONTEXT hContext, LPCSTR mszCards, + LPSCARD_READERSTATEA rgReaderStates, + DWORD cReaders) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsA { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardLocateCardsA(hContext, mszCards, rgReaderStates, cReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardLocateCardsW(SCARDCONTEXT hContext, - LPCWSTR mszCards, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders) +WINSCARDAPI LONG WINAPI Inspect_SCardLocateCardsW(SCARDCONTEXT hContext, LPCWSTR mszCards, + LPSCARD_READERSTATEW rgReaderStates, + DWORD cReaders) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsW { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardLocateCardsW(hContext, mszCards, rgReaderStates, cReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } WINSCARDAPI LONG WINAPI Inspect_SCardLocateCardsByATRA(SCARDCONTEXT hContext, - LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders) + LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, + LPSCARD_READERSTATEA rgReaderStates, + DWORD cReaders) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsByATRA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsByATRA { hContext: %p", (void*)hContext); - status = g_SCardApi->pfnSCardLocateCardsByATRA(hContext, rgAtrMasks, cAtrs, rgReaderStates, cReaders); + status = g_SCardApi->pfnSCardLocateCardsByATRA(hContext, rgAtrMasks, cAtrs, rgReaderStates, + cReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsByATRA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsByATRA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } WINSCARDAPI LONG WINAPI Inspect_SCardLocateCardsByATRW(SCARDCONTEXT hContext, - LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders) + LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, + LPSCARD_READERSTATEW rgReaderStates, + DWORD cReaders) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsByATRW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsByATRW { hContext: %p", (void*)hContext); - status = g_SCardApi->pfnSCardLocateCardsByATRW(hContext, rgAtrMasks, cAtrs, rgReaderStates, cReaders); + status = g_SCardApi->pfnSCardLocateCardsByATRW(hContext, rgAtrMasks, cAtrs, rgReaderStates, + cReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsByATRW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsByATRW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardGetStatusChangeA(SCARDCONTEXT hContext, - DWORD dwTimeout, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders) +WINSCARDAPI LONG WINAPI Inspect_SCardGetStatusChangeA(SCARDCONTEXT hContext, DWORD dwTimeout, + LPSCARD_READERSTATEA rgReaderStates, + DWORD cReaders) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetStatusChangeA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetStatusChangeA { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardGetStatusChangeA(hContext, dwTimeout, rgReaderStates, cReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetStatusChangeA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetStatusChangeA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardGetStatusChangeW(SCARDCONTEXT hContext, - DWORD dwTimeout, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders) +WINSCARDAPI LONG WINAPI Inspect_SCardGetStatusChangeW(SCARDCONTEXT hContext, DWORD dwTimeout, + LPSCARD_READERSTATEW rgReaderStates, + DWORD cReaders) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetStatusChangeW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetStatusChangeW { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardGetStatusChangeW(hContext, dwTimeout, rgReaderStates, cReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetStatusChangeW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetStatusChangeW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -662,62 +696,63 @@ WINSCARDAPI LONG WINAPI Inspect_SCardCancel(SCARDCONTEXT hContext) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardCancel { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardCancel { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardCancel(hContext); - WLog_Print(g_Log, WLOG_DEBUG, "SCardCancel } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardCancel } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardConnectA(SCARDCONTEXT hContext, - LPCSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, - LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol) +WINSCARDAPI LONG WINAPI Inspect_SCardConnectA(SCARDCONTEXT hContext, LPCSTR szReader, + DWORD dwShareMode, DWORD dwPreferredProtocols, + LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardConnectA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardConnectA { hContext: %p", (void*)hContext); - status = g_SCardApi->pfnSCardConnectA(hContext, szReader, dwShareMode, - dwPreferredProtocols, phCard, pdwActiveProtocol); + status = g_SCardApi->pfnSCardConnectA(hContext, szReader, dwShareMode, dwPreferredProtocols, + phCard, pdwActiveProtocol); - WLog_Print(g_Log, WLOG_DEBUG, "SCardConnectA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardConnectA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardConnectW(SCARDCONTEXT hContext, - LPCWSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, - LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol) +WINSCARDAPI LONG WINAPI Inspect_SCardConnectW(SCARDCONTEXT hContext, LPCWSTR szReader, + DWORD dwShareMode, DWORD dwPreferredProtocols, + LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardConnectW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardConnectW { hContext: %p", (void*)hContext); - status = g_SCardApi->pfnSCardConnectW(hContext, szReader, dwShareMode, - dwPreferredProtocols, phCard, pdwActiveProtocol); + status = g_SCardApi->pfnSCardConnectW(hContext, szReader, dwShareMode, dwPreferredProtocols, + phCard, pdwActiveProtocol); - WLog_Print(g_Log, WLOG_DEBUG, "SCardConnectW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardConnectW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardReconnect(SCARDHANDLE hCard, - DWORD dwShareMode, DWORD dwPreferredProtocols, DWORD dwInitialization, LPDWORD pdwActiveProtocol) +WINSCARDAPI LONG WINAPI Inspect_SCardReconnect(SCARDHANDLE hCard, DWORD dwShareMode, + DWORD dwPreferredProtocols, DWORD dwInitialization, + LPDWORD pdwActiveProtocol) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardReconnect { hCard: %p", (void*) hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardReconnect { hCard: %p", (void*)hCard); - status = g_SCardApi->pfnSCardReconnect(hCard, dwShareMode, - dwPreferredProtocols, dwInitialization, pdwActiveProtocol); + status = g_SCardApi->pfnSCardReconnect(hCard, dwShareMode, dwPreferredProtocols, + dwInitialization, pdwActiveProtocol); - WLog_Print(g_Log, WLOG_DEBUG, "SCardReconnect } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardReconnect } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -726,12 +761,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardDisconnect(SCARDHANDLE hCard, DWORD dwDispo { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardDisconnect { hCard: %p", (void*) hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardDisconnect { hCard: %p", (void*)hCard); status = g_SCardApi->pfnSCardDisconnect(hCard, dwDisposition); - WLog_Print(g_Log, WLOG_DEBUG, "SCardDisconnect } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardDisconnect } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -740,12 +775,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardBeginTransaction(SCARDHANDLE hCard) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardBeginTransaction { hCard: %p", (void*) hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardBeginTransaction { hCard: %p", (void*)hCard); status = g_SCardApi->pfnSCardBeginTransaction(hCard); - WLog_Print(g_Log, WLOG_DEBUG, "SCardBeginTransaction } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardBeginTransaction } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -754,12 +789,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardEndTransaction(SCARDHANDLE hCard, DWORD dwD { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardEndTransaction { hCard: %p", (void*) hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardEndTransaction { hCard: %p", (void*)hCard); status = g_SCardApi->pfnSCardEndTransaction(hCard, dwDisposition); - WLog_Print(g_Log, WLOG_DEBUG, "SCardEndTransaction } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardEndTransaction } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -768,78 +803,79 @@ WINSCARDAPI LONG WINAPI Inspect_SCardCancelTransaction(SCARDHANDLE hCard) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardCancelTransaction { hCard: %p", (void*) hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardCancelTransaction { hCard: %p", (void*)hCard); status = g_SCardApi->pfnSCardCancelTransaction(hCard); - WLog_Print(g_Log, WLOG_DEBUG, "SCardCancelTransaction } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardCancelTransaction } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardState(SCARDHANDLE hCard, - LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen) +WINSCARDAPI LONG WINAPI Inspect_SCardState(SCARDHANDLE hCard, LPDWORD pdwState, LPDWORD pdwProtocol, + LPBYTE pbAtr, LPDWORD pcbAtrLen) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardState { hCard: %p", (void*) hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardState { hCard: %p", (void*)hCard); status = g_SCardApi->pfnSCardState(hCard, pdwState, pdwProtocol, pbAtr, pcbAtrLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardState } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardState } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardStatusA(SCARDHANDLE hCard, - LPSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState, - LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen) +WINSCARDAPI LONG WINAPI Inspect_SCardStatusA(SCARDHANDLE hCard, LPSTR mszReaderNames, + LPDWORD pcchReaderLen, LPDWORD pdwState, + LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardStatusA { hCard: %p", (void*) hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardStatusA { hCard: %p", (void*)hCard); - status = g_SCardApi->pfnSCardStatusA(hCard, mszReaderNames, pcchReaderLen, - pdwState, pdwProtocol, pbAtr, pcbAtrLen); + status = g_SCardApi->pfnSCardStatusA(hCard, mszReaderNames, pcchReaderLen, pdwState, + pdwProtocol, pbAtr, pcbAtrLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardStatusA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardStatusA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardStatusW(SCARDHANDLE hCard, - LPWSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState, - LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen) +WINSCARDAPI LONG WINAPI Inspect_SCardStatusW(SCARDHANDLE hCard, LPWSTR mszReaderNames, + LPDWORD pcchReaderLen, LPDWORD pdwState, + LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardStatusW { hCard: %p", (void*) hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardStatusW { hCard: %p", (void*)hCard); - status = g_SCardApi->pfnSCardStatusW(hCard, mszReaderNames, pcchReaderLen, - pdwState, pdwProtocol, pbAtr, pcbAtrLen); + status = g_SCardApi->pfnSCardStatusW(hCard, mszReaderNames, pcchReaderLen, pdwState, + pdwProtocol, pbAtr, pcbAtrLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardStatusW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardStatusW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardTransmit(SCARDHANDLE hCard, - LPCSCARD_IO_REQUEST pioSendPci, LPCBYTE pbSendBuffer, DWORD cbSendLength, - LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength) +WINSCARDAPI LONG WINAPI Inspect_SCardTransmit(SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pioSendPci, + LPCBYTE pbSendBuffer, DWORD cbSendLength, + LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, + LPDWORD pcbRecvLength) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardTransmit { hCard: %p", (void*) hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardTransmit { hCard: %p", (void*)hCard); - status = g_SCardApi->pfnSCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength, - pioRecvPci, pbRecvBuffer, pcbRecvLength); + status = g_SCardApi->pfnSCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength, pioRecvPci, + pbRecvBuffer, pcbRecvLength); - WLog_Print(g_Log, WLOG_DEBUG, "SCardTransmit } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardTransmit } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -848,57 +884,60 @@ WINSCARDAPI LONG WINAPI Inspect_SCardGetTransmitCount(SCARDHANDLE hCard, LPDWORD { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetTransmitCount { hCard: %p", (void*) hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetTransmitCount { hCard: %p", (void*)hCard); status = g_SCardApi->pfnSCardGetTransmitCount(hCard, pcTransmitCount); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetTransmitCount } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetTransmitCount } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardControl(SCARDHANDLE hCard, - DWORD dwControlCode, LPCVOID lpInBuffer, DWORD cbInBufferSize, - LPVOID lpOutBuffer, DWORD cbOutBufferSize, LPDWORD lpBytesReturned) +WINSCARDAPI LONG WINAPI Inspect_SCardControl(SCARDHANDLE hCard, DWORD dwControlCode, + LPCVOID lpInBuffer, DWORD cbInBufferSize, + LPVOID lpOutBuffer, DWORD cbOutBufferSize, + LPDWORD lpBytesReturned) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardControl { hCard: %p", (void*) hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardControl { hCard: %p", (void*)hCard); status = g_SCardApi->pfnSCardControl(hCard, dwControlCode, lpInBuffer, cbInBufferSize, - lpOutBuffer, cbOutBufferSize, lpBytesReturned); + lpOutBuffer, cbOutBufferSize, lpBytesReturned); - WLog_Print(g_Log, WLOG_DEBUG, "SCardControl } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardControl } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, LPDWORD pcbAttrLen) +WINSCARDAPI LONG WINAPI Inspect_SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, + LPDWORD pcbAttrLen) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetAttrib { hCard: %p", (void*) hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetAttrib { hCard: %p", (void*)hCard); status = g_SCardApi->pfnSCardGetAttrib(hCard, dwAttrId, pbAttr, pcbAttrLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetAttrib } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetAttrib } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardSetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr, DWORD cbAttrLen) +WINSCARDAPI LONG WINAPI Inspect_SCardSetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr, + DWORD cbAttrLen) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardSetAttrib { hCard: %p", (void*) hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardSetAttrib { hCard: %p", (void*)hCard); status = g_SCardApi->pfnSCardSetAttrib(hCard, dwAttrId, pbAttr, cbAttrLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardSetAttrib } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardSetAttrib } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -911,8 +950,8 @@ WINSCARDAPI LONG WINAPI Inspect_SCardUIDlgSelectCardA(LPOPENCARDNAMEA_EX pDlgStr status = g_SCardApi->pfnSCardUIDlgSelectCardA(pDlgStruc); - WLog_Print(g_Log, WLOG_DEBUG, "SCardUIDlgSelectCardA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardUIDlgSelectCardA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -925,8 +964,8 @@ WINSCARDAPI LONG WINAPI Inspect_SCardUIDlgSelectCardW(LPOPENCARDNAMEW_EX pDlgStr status = g_SCardApi->pfnSCardUIDlgSelectCardW(pDlgStruc); - WLog_Print(g_Log, WLOG_DEBUG, "SCardUIDlgSelectCardW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardUIDlgSelectCardW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -939,8 +978,8 @@ WINSCARDAPI LONG WINAPI Inspect_GetOpenCardNameA(LPOPENCARDNAMEA pDlgStruc) status = g_SCardApi->pfnGetOpenCardNameA(pDlgStruc); - WLog_Print(g_Log, WLOG_DEBUG, "GetOpenCardNameA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "GetOpenCardNameA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -953,8 +992,8 @@ WINSCARDAPI LONG WINAPI Inspect_GetOpenCardNameW(LPOPENCARDNAMEW pDlgStruc) status = g_SCardApi->pfnGetOpenCardNameW(pDlgStruc); - WLog_Print(g_Log, WLOG_DEBUG, "GetOpenCardNameW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "GetOpenCardNameW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -967,194 +1006,214 @@ WINSCARDAPI LONG WINAPI Inspect_SCardDlgExtendedError(void) status = g_SCardApi->pfnSCardDlgExtendedError(); - WLog_Print(g_Log, WLOG_DEBUG, "SCardDlgExtendedError } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardDlgExtendedError } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardReadCacheA(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, DWORD* DataLen) +WINSCARDAPI LONG WINAPI Inspect_SCardReadCacheA(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPSTR LookupName, + PBYTE Data, DWORD* DataLen) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardReadCacheA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardReadCacheA { hContext: %p", (void*)hContext); - status = g_SCardApi->pfnSCardReadCacheA(hContext, CardIdentifier, - FreshnessCounter, LookupName, Data, DataLen); + status = g_SCardApi->pfnSCardReadCacheA(hContext, CardIdentifier, FreshnessCounter, LookupName, + Data, DataLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardReadCacheA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardReadCacheA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardReadCacheW(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD* DataLen) +WINSCARDAPI LONG WINAPI Inspect_SCardReadCacheW(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPWSTR LookupName, + PBYTE Data, DWORD* DataLen) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardReadCacheW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardReadCacheW { hContext: %p", (void*)hContext); - status = g_SCardApi->pfnSCardReadCacheW(hContext, CardIdentifier, - FreshnessCounter, LookupName, Data, DataLen); + status = g_SCardApi->pfnSCardReadCacheW(hContext, CardIdentifier, FreshnessCounter, LookupName, + Data, DataLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardReadCacheW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardReadCacheW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardWriteCacheA(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, DWORD DataLen) +WINSCARDAPI LONG WINAPI Inspect_SCardWriteCacheA(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPSTR LookupName, + PBYTE Data, DWORD DataLen) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardWriteCacheA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardWriteCacheA { hContext: %p", (void*)hContext); - status = g_SCardApi->pfnSCardWriteCacheA(hContext, CardIdentifier, - FreshnessCounter, LookupName, Data, DataLen); + status = g_SCardApi->pfnSCardWriteCacheA(hContext, CardIdentifier, FreshnessCounter, LookupName, + Data, DataLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardWriteCacheA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardWriteCacheA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardWriteCacheW(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD DataLen) +WINSCARDAPI LONG WINAPI Inspect_SCardWriteCacheW(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPWSTR LookupName, + PBYTE Data, DWORD DataLen) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardWriteCacheW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardWriteCacheW { hContext: %p", (void*)hContext); - status = g_SCardApi->pfnSCardWriteCacheW(hContext, CardIdentifier, - FreshnessCounter, LookupName, Data, DataLen); + status = g_SCardApi->pfnSCardWriteCacheW(hContext, CardIdentifier, FreshnessCounter, LookupName, + Data, DataLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardWriteCacheW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardWriteCacheW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardGetReaderIconA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon) +WINSCARDAPI LONG WINAPI Inspect_SCardGetReaderIconA(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPBYTE pbIcon, LPDWORD pcbIcon) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderIconA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderIconA { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardGetReaderIconA(hContext, szReaderName, pbIcon, pcbIcon); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderIconA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderIconA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardGetReaderIconW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon) +WINSCARDAPI LONG WINAPI Inspect_SCardGetReaderIconW(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPBYTE pbIcon, LPDWORD pcbIcon) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderIconW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderIconW { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardGetReaderIconW(hContext, szReaderName, pbIcon, pcbIcon); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderIconW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderIconW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardGetDeviceTypeIdA(SCARDCONTEXT hContext, LPCSTR szReaderName, LPDWORD pdwDeviceTypeId) +WINSCARDAPI LONG WINAPI Inspect_SCardGetDeviceTypeIdA(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPDWORD pdwDeviceTypeId) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetDeviceTypeIdA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetDeviceTypeIdA { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardGetDeviceTypeIdA(hContext, szReaderName, pdwDeviceTypeId); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetDeviceTypeIdA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetDeviceTypeIdA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } -WINSCARDAPI LONG WINAPI Inspect_SCardGetDeviceTypeIdW(SCARDCONTEXT hContext, LPCWSTR szReaderName, LPDWORD pdwDeviceTypeId) +WINSCARDAPI LONG WINAPI Inspect_SCardGetDeviceTypeIdW(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPDWORD pdwDeviceTypeId) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetDeviceTypeIdW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetDeviceTypeIdW { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardGetDeviceTypeIdW(hContext, szReaderName, pdwDeviceTypeId); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetDeviceTypeIdW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetDeviceTypeIdW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } WINSCARDAPI LONG WINAPI Inspect_SCardGetReaderDeviceInstanceIdA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId) + LPCSTR szReaderName, + LPSTR szDeviceInstanceId, + LPDWORD pcchDeviceInstanceId) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderDeviceInstanceIdA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderDeviceInstanceIdA { hContext: %p", + (void*)hContext); - status = g_SCardApi->pfnSCardGetReaderDeviceInstanceIdA(hContext, szReaderName, - szDeviceInstanceId, pcchDeviceInstanceId); + status = g_SCardApi->pfnSCardGetReaderDeviceInstanceIdA( + hContext, szReaderName, szDeviceInstanceId, pcchDeviceInstanceId); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderDeviceInstanceIdA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderDeviceInstanceIdA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } WINSCARDAPI LONG WINAPI Inspect_SCardGetReaderDeviceInstanceIdW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPWSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId) + LPCWSTR szReaderName, + LPWSTR szDeviceInstanceId, + LPDWORD pcchDeviceInstanceId) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderDeviceInstanceIdW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderDeviceInstanceIdW { hContext: %p", + (void*)hContext); - status = g_SCardApi->pfnSCardGetReaderDeviceInstanceIdW(hContext, szReaderName, - szDeviceInstanceId, pcchDeviceInstanceId); + status = g_SCardApi->pfnSCardGetReaderDeviceInstanceIdW( + hContext, szReaderName, szDeviceInstanceId, pcchDeviceInstanceId); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderDeviceInstanceIdW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderDeviceInstanceIdW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } WINSCARDAPI LONG WINAPI Inspect_SCardListReadersWithDeviceInstanceIdA(SCARDCONTEXT hContext, - LPCSTR szDeviceInstanceId, LPSTR mszReaders, LPDWORD pcchReaders) + LPCSTR szDeviceInstanceId, + LPSTR mszReaders, + LPDWORD pcchReaders) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersWithDeviceInstanceIdA { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersWithDeviceInstanceIdA { hContext: %p", + (void*)hContext); - status = g_SCardApi->pfnSCardListReadersWithDeviceInstanceIdA(hContext, - szDeviceInstanceId, mszReaders, pcchReaders); + status = g_SCardApi->pfnSCardListReadersWithDeviceInstanceIdA(hContext, szDeviceInstanceId, + mszReaders, pcchReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersWithDeviceInstanceIdA } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, + "SCardListReadersWithDeviceInstanceIdA } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } WINSCARDAPI LONG WINAPI Inspect_SCardListReadersWithDeviceInstanceIdW(SCARDCONTEXT hContext, - LPCWSTR szDeviceInstanceId, LPWSTR mszReaders, LPDWORD pcchReaders) + LPCWSTR szDeviceInstanceId, + LPWSTR mszReaders, + LPDWORD pcchReaders) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersWithDeviceInstanceIdW { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersWithDeviceInstanceIdW { hContext: %p", + (void*)hContext); - status = g_SCardApi->pfnSCardListReadersWithDeviceInstanceIdW(hContext, - szDeviceInstanceId, mszReaders, pcchReaders); + status = g_SCardApi->pfnSCardListReadersWithDeviceInstanceIdW(hContext, szDeviceInstanceId, + mszReaders, pcchReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersWithDeviceInstanceIdW } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, + "SCardListReadersWithDeviceInstanceIdW } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -1163,12 +1222,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardAudit(SCARDCONTEXT hContext, DWORD dwEvent) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardAudit { hContext: %p", (void*) hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardAudit { hContext: %p", (void*)hContext); status = g_SCardApi->pfnSCardAudit(hContext, dwEvent); - WLog_Print(g_Log, WLOG_DEBUG, "SCardAudit } status: %s (0x%08"PRIX32")", - SCardGetErrorString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SCardAudit } status: %s (0x%08" PRIX32 ")", + SCardGetErrorString(status), status); return status; } @@ -1177,87 +1236,86 @@ WINSCARDAPI LONG WINAPI Inspect_SCardAudit(SCARDCONTEXT hContext, DWORD dwEvent) * Extended API */ -SCardApiFunctionTable Inspect_SCardApiFunctionTable = -{ +SCardApiFunctionTable Inspect_SCardApiFunctionTable = { 0, /* dwVersion */ 0, /* dwFlags */ - Inspect_SCardEstablishContext, /* SCardEstablishContext */ - Inspect_SCardReleaseContext, /* SCardReleaseContext */ - Inspect_SCardIsValidContext, /* SCardIsValidContext */ - Inspect_SCardListReaderGroupsA, /* SCardListReaderGroupsA */ - Inspect_SCardListReaderGroupsW, /* SCardListReaderGroupsW */ - Inspect_SCardListReadersA, /* SCardListReadersA */ - Inspect_SCardListReadersW, /* SCardListReadersW */ - Inspect_SCardListCardsA, /* SCardListCardsA */ - Inspect_SCardListCardsW, /* SCardListCardsW */ - Inspect_SCardListInterfacesA, /* SCardListInterfacesA */ - Inspect_SCardListInterfacesW, /* SCardListInterfacesW */ - Inspect_SCardGetProviderIdA, /* SCardGetProviderIdA */ - Inspect_SCardGetProviderIdW, /* SCardGetProviderIdW */ - Inspect_SCardGetCardTypeProviderNameA, /* SCardGetCardTypeProviderNameA */ - Inspect_SCardGetCardTypeProviderNameW, /* SCardGetCardTypeProviderNameW */ - Inspect_SCardIntroduceReaderGroupA, /* SCardIntroduceReaderGroupA */ - Inspect_SCardIntroduceReaderGroupW, /* SCardIntroduceReaderGroupW */ - Inspect_SCardForgetReaderGroupA, /* SCardForgetReaderGroupA */ - Inspect_SCardForgetReaderGroupW, /* SCardForgetReaderGroupW */ - Inspect_SCardIntroduceReaderA, /* SCardIntroduceReaderA */ - Inspect_SCardIntroduceReaderW, /* SCardIntroduceReaderW */ - Inspect_SCardForgetReaderA, /* SCardForgetReaderA */ - Inspect_SCardForgetReaderW, /* SCardForgetReaderW */ - Inspect_SCardAddReaderToGroupA, /* SCardAddReaderToGroupA */ - Inspect_SCardAddReaderToGroupW, /* SCardAddReaderToGroupW */ - Inspect_SCardRemoveReaderFromGroupA, /* SCardRemoveReaderFromGroupA */ - Inspect_SCardRemoveReaderFromGroupW, /* SCardRemoveReaderFromGroupW */ - Inspect_SCardIntroduceCardTypeA, /* SCardIntroduceCardTypeA */ - Inspect_SCardIntroduceCardTypeW, /* SCardIntroduceCardTypeW */ - Inspect_SCardSetCardTypeProviderNameA, /* SCardSetCardTypeProviderNameA */ - Inspect_SCardSetCardTypeProviderNameW, /* SCardSetCardTypeProviderNameW */ - Inspect_SCardForgetCardTypeA, /* SCardForgetCardTypeA */ - Inspect_SCardForgetCardTypeW, /* SCardForgetCardTypeW */ - Inspect_SCardFreeMemory, /* SCardFreeMemory */ - Inspect_SCardAccessStartedEvent, /* SCardAccessStartedEvent */ - Inspect_SCardReleaseStartedEvent, /* SCardReleaseStartedEvent */ - Inspect_SCardLocateCardsA, /* SCardLocateCardsA */ - Inspect_SCardLocateCardsW, /* SCardLocateCardsW */ - Inspect_SCardLocateCardsByATRA, /* SCardLocateCardsByATRA */ - Inspect_SCardLocateCardsByATRW, /* SCardLocateCardsByATRW */ - Inspect_SCardGetStatusChangeA, /* SCardGetStatusChangeA */ - Inspect_SCardGetStatusChangeW, /* SCardGetStatusChangeW */ - Inspect_SCardCancel, /* SCardCancel */ - Inspect_SCardConnectA, /* SCardConnectA */ - Inspect_SCardConnectW, /* SCardConnectW */ - Inspect_SCardReconnect, /* SCardReconnect */ - Inspect_SCardDisconnect, /* SCardDisconnect */ - Inspect_SCardBeginTransaction, /* SCardBeginTransaction */ - Inspect_SCardEndTransaction, /* SCardEndTransaction */ - Inspect_SCardCancelTransaction, /* SCardCancelTransaction */ - Inspect_SCardState, /* SCardState */ - Inspect_SCardStatusA, /* SCardStatusA */ - Inspect_SCardStatusW, /* SCardStatusW */ - Inspect_SCardTransmit, /* SCardTransmit */ - Inspect_SCardGetTransmitCount, /* SCardGetTransmitCount */ - Inspect_SCardControl, /* SCardControl */ - Inspect_SCardGetAttrib, /* SCardGetAttrib */ - Inspect_SCardSetAttrib, /* SCardSetAttrib */ - Inspect_SCardUIDlgSelectCardA, /* SCardUIDlgSelectCardA */ - Inspect_SCardUIDlgSelectCardW, /* SCardUIDlgSelectCardW */ - Inspect_GetOpenCardNameA, /* GetOpenCardNameA */ - Inspect_GetOpenCardNameW, /* GetOpenCardNameW */ - Inspect_SCardDlgExtendedError, /* SCardDlgExtendedError */ - Inspect_SCardReadCacheA, /* SCardReadCacheA */ - Inspect_SCardReadCacheW, /* SCardReadCacheW */ - Inspect_SCardWriteCacheA, /* SCardWriteCacheA */ - Inspect_SCardWriteCacheW, /* SCardWriteCacheW */ - Inspect_SCardGetReaderIconA, /* SCardGetReaderIconA */ - Inspect_SCardGetReaderIconW, /* SCardGetReaderIconW */ - Inspect_SCardGetDeviceTypeIdA, /* SCardGetDeviceTypeIdA */ - Inspect_SCardGetDeviceTypeIdW, /* SCardGetDeviceTypeIdW */ - Inspect_SCardGetReaderDeviceInstanceIdA, /* SCardGetReaderDeviceInstanceIdA */ - Inspect_SCardGetReaderDeviceInstanceIdW, /* SCardGetReaderDeviceInstanceIdW */ + Inspect_SCardEstablishContext, /* SCardEstablishContext */ + Inspect_SCardReleaseContext, /* SCardReleaseContext */ + Inspect_SCardIsValidContext, /* SCardIsValidContext */ + Inspect_SCardListReaderGroupsA, /* SCardListReaderGroupsA */ + Inspect_SCardListReaderGroupsW, /* SCardListReaderGroupsW */ + Inspect_SCardListReadersA, /* SCardListReadersA */ + Inspect_SCardListReadersW, /* SCardListReadersW */ + Inspect_SCardListCardsA, /* SCardListCardsA */ + Inspect_SCardListCardsW, /* SCardListCardsW */ + Inspect_SCardListInterfacesA, /* SCardListInterfacesA */ + Inspect_SCardListInterfacesW, /* SCardListInterfacesW */ + Inspect_SCardGetProviderIdA, /* SCardGetProviderIdA */ + Inspect_SCardGetProviderIdW, /* SCardGetProviderIdW */ + Inspect_SCardGetCardTypeProviderNameA, /* SCardGetCardTypeProviderNameA */ + Inspect_SCardGetCardTypeProviderNameW, /* SCardGetCardTypeProviderNameW */ + Inspect_SCardIntroduceReaderGroupA, /* SCardIntroduceReaderGroupA */ + Inspect_SCardIntroduceReaderGroupW, /* SCardIntroduceReaderGroupW */ + Inspect_SCardForgetReaderGroupA, /* SCardForgetReaderGroupA */ + Inspect_SCardForgetReaderGroupW, /* SCardForgetReaderGroupW */ + Inspect_SCardIntroduceReaderA, /* SCardIntroduceReaderA */ + Inspect_SCardIntroduceReaderW, /* SCardIntroduceReaderW */ + Inspect_SCardForgetReaderA, /* SCardForgetReaderA */ + Inspect_SCardForgetReaderW, /* SCardForgetReaderW */ + Inspect_SCardAddReaderToGroupA, /* SCardAddReaderToGroupA */ + Inspect_SCardAddReaderToGroupW, /* SCardAddReaderToGroupW */ + Inspect_SCardRemoveReaderFromGroupA, /* SCardRemoveReaderFromGroupA */ + Inspect_SCardRemoveReaderFromGroupW, /* SCardRemoveReaderFromGroupW */ + Inspect_SCardIntroduceCardTypeA, /* SCardIntroduceCardTypeA */ + Inspect_SCardIntroduceCardTypeW, /* SCardIntroduceCardTypeW */ + Inspect_SCardSetCardTypeProviderNameA, /* SCardSetCardTypeProviderNameA */ + Inspect_SCardSetCardTypeProviderNameW, /* SCardSetCardTypeProviderNameW */ + Inspect_SCardForgetCardTypeA, /* SCardForgetCardTypeA */ + Inspect_SCardForgetCardTypeW, /* SCardForgetCardTypeW */ + Inspect_SCardFreeMemory, /* SCardFreeMemory */ + Inspect_SCardAccessStartedEvent, /* SCardAccessStartedEvent */ + Inspect_SCardReleaseStartedEvent, /* SCardReleaseStartedEvent */ + Inspect_SCardLocateCardsA, /* SCardLocateCardsA */ + Inspect_SCardLocateCardsW, /* SCardLocateCardsW */ + Inspect_SCardLocateCardsByATRA, /* SCardLocateCardsByATRA */ + Inspect_SCardLocateCardsByATRW, /* SCardLocateCardsByATRW */ + Inspect_SCardGetStatusChangeA, /* SCardGetStatusChangeA */ + Inspect_SCardGetStatusChangeW, /* SCardGetStatusChangeW */ + Inspect_SCardCancel, /* SCardCancel */ + Inspect_SCardConnectA, /* SCardConnectA */ + Inspect_SCardConnectW, /* SCardConnectW */ + Inspect_SCardReconnect, /* SCardReconnect */ + Inspect_SCardDisconnect, /* SCardDisconnect */ + Inspect_SCardBeginTransaction, /* SCardBeginTransaction */ + Inspect_SCardEndTransaction, /* SCardEndTransaction */ + Inspect_SCardCancelTransaction, /* SCardCancelTransaction */ + Inspect_SCardState, /* SCardState */ + Inspect_SCardStatusA, /* SCardStatusA */ + Inspect_SCardStatusW, /* SCardStatusW */ + Inspect_SCardTransmit, /* SCardTransmit */ + Inspect_SCardGetTransmitCount, /* SCardGetTransmitCount */ + Inspect_SCardControl, /* SCardControl */ + Inspect_SCardGetAttrib, /* SCardGetAttrib */ + Inspect_SCardSetAttrib, /* SCardSetAttrib */ + Inspect_SCardUIDlgSelectCardA, /* SCardUIDlgSelectCardA */ + Inspect_SCardUIDlgSelectCardW, /* SCardUIDlgSelectCardW */ + Inspect_GetOpenCardNameA, /* GetOpenCardNameA */ + Inspect_GetOpenCardNameW, /* GetOpenCardNameW */ + Inspect_SCardDlgExtendedError, /* SCardDlgExtendedError */ + Inspect_SCardReadCacheA, /* SCardReadCacheA */ + Inspect_SCardReadCacheW, /* SCardReadCacheW */ + Inspect_SCardWriteCacheA, /* SCardWriteCacheA */ + Inspect_SCardWriteCacheW, /* SCardWriteCacheW */ + Inspect_SCardGetReaderIconA, /* SCardGetReaderIconA */ + Inspect_SCardGetReaderIconW, /* SCardGetReaderIconW */ + Inspect_SCardGetDeviceTypeIdA, /* SCardGetDeviceTypeIdA */ + Inspect_SCardGetDeviceTypeIdW, /* SCardGetDeviceTypeIdW */ + Inspect_SCardGetReaderDeviceInstanceIdA, /* SCardGetReaderDeviceInstanceIdA */ + Inspect_SCardGetReaderDeviceInstanceIdW, /* SCardGetReaderDeviceInstanceIdW */ Inspect_SCardListReadersWithDeviceInstanceIdA, /* SCardListReadersWithDeviceInstanceIdA */ Inspect_SCardListReadersWithDeviceInstanceIdW, /* SCardListReadersWithDeviceInstanceIdW */ - Inspect_SCardAudit /* SCardAudit */ + Inspect_SCardAudit /* SCardAudit */ }; #ifndef _WIN32 @@ -1289,7 +1347,7 @@ void Inspect_InitLog() return; WLog_ConfigureAppender(appender, "outputfilename", "WinSCard.txt"); - WLog_ConfigureAppender(appender, "outputfilepath", (void *)filepath); + WLog_ConfigureAppender(appender, "outputfilepath", (void*)filepath); layout = WLog_GetLogLayout(g_Log); WLog_Layout_SetPrefixFormat(g_Log, layout, "[%mn] "); diff --git a/winpr/libwinpr/smartcard/smartcard_pcsc.c b/winpr/libwinpr/smartcard/smartcard_pcsc.c index 9ecf194e4..9eac57f96 100644 --- a/winpr/libwinpr/smartcard/smartcard_pcsc.c +++ b/winpr/libwinpr/smartcard/smartcard_pcsc.c @@ -142,21 +142,23 @@ static BOOL g_PnP_Notification = TRUE; static unsigned int OSXVersion = 0; #endif - - static wListDictionary* g_CardHandles = NULL; static wListDictionary* g_CardContexts = NULL; static wListDictionary* g_MemoryBlocks = NULL; char SMARTCARD_PNP_NOTIFICATION_A[] = "\\\\?PnP?\\Notification"; -const PCSC_SCARD_IO_REQUEST g_PCSC_rgSCardT0Pci = { SCARD_PROTOCOL_T0, sizeof(PCSC_SCARD_IO_REQUEST) }; -const PCSC_SCARD_IO_REQUEST g_PCSC_rgSCardT1Pci = { SCARD_PROTOCOL_T1, sizeof(PCSC_SCARD_IO_REQUEST) }; -const PCSC_SCARD_IO_REQUEST g_PCSC_rgSCardRawPci = { PCSC_SCARD_PROTOCOL_RAW, sizeof(PCSC_SCARD_IO_REQUEST) }; +const PCSC_SCARD_IO_REQUEST g_PCSC_rgSCardT0Pci = { SCARD_PROTOCOL_T0, + sizeof(PCSC_SCARD_IO_REQUEST) }; +const PCSC_SCARD_IO_REQUEST g_PCSC_rgSCardT1Pci = { SCARD_PROTOCOL_T1, + sizeof(PCSC_SCARD_IO_REQUEST) }; +const PCSC_SCARD_IO_REQUEST g_PCSC_rgSCardRawPci = { PCSC_SCARD_PROTOCOL_RAW, + sizeof(PCSC_SCARD_IO_REQUEST) }; WINSCARDAPI LONG WINAPI PCSC_SCardFreeMemory_Internal(SCARDCONTEXT hContext, LPCVOID pvMem); -WINSCARDAPI LONG WINAPI PCSC_SCardEstablishContext_Internal(DWORD dwScope, - LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext); +WINSCARDAPI LONG WINAPI PCSC_SCardEstablishContext_Internal(DWORD dwScope, LPCVOID pvReserved1, + LPCVOID pvReserved2, + LPSCARDCONTEXT phContext); WINSCARDAPI LONG WINAPI PCSC_SCardReleaseContext_Internal(SCARDCONTEXT hContext); static LONG PCSC_MapErrorCodeToWinSCard(LONG errorCode) @@ -275,7 +277,7 @@ static PCSC_SCARDCONTEXT* PCSC_GetCardContextData(SCARDCONTEXT hContext) if (!g_CardContexts) return NULL; - pContext = (PCSC_SCARDCONTEXT*) ListDictionary_GetItemValue(g_CardContexts, (void*) hContext); + pContext = (PCSC_SCARDCONTEXT*)ListDictionary_GetItemValue(g_CardContexts, (void*)hContext); if (!pContext) return NULL; @@ -286,7 +288,7 @@ static PCSC_SCARDCONTEXT* PCSC_GetCardContextData(SCARDCONTEXT hContext) static PCSC_SCARDCONTEXT* PCSC_EstablishCardContext(SCARDCONTEXT hContext) { PCSC_SCARDCONTEXT* pContext; - pContext = (PCSC_SCARDCONTEXT*) calloc(1, sizeof(PCSC_SCARDCONTEXT)); + pContext = (PCSC_SCARDCONTEXT*)calloc(1, sizeof(PCSC_SCARDCONTEXT)); if (!pContext) return NULL; @@ -304,7 +306,7 @@ static PCSC_SCARDCONTEXT* PCSC_EstablishCardContext(SCARDCONTEXT hContext) goto errors; } - if (!ListDictionary_Add(g_CardContexts, (void*) hContext, (void*) pContext)) + if (!ListDictionary_Add(g_CardContexts, (void*)hContext, (void*)pContext)) goto errors; return pContext; @@ -332,7 +334,7 @@ static void PCSC_ReleaseCardContext(SCARDCONTEXT hContext) if (!g_CardContexts) return; - ListDictionary_Remove(g_CardContexts, (void*) hContext); + ListDictionary_Remove(g_CardContexts, (void*)hContext); } static BOOL PCSC_LockCardContext(SCARDCONTEXT hContext) @@ -342,7 +344,7 @@ static BOOL PCSC_LockCardContext(SCARDCONTEXT hContext) if (!pContext) { - WLog_ERR(TAG, "PCSC_LockCardContext: invalid context (%p)", (void*) hContext); + WLog_ERR(TAG, "PCSC_LockCardContext: invalid context (%p)", (void*)hContext); return FALSE; } @@ -357,7 +359,7 @@ static BOOL PCSC_UnlockCardContext(SCARDCONTEXT hContext) if (!pContext) { - WLog_ERR(TAG, "PCSC_UnlockCardContext: invalid context (%p)", (void*) hContext); + WLog_ERR(TAG, "PCSC_UnlockCardContext: invalid context (%p)", (void*)hContext); return FALSE; } @@ -372,7 +374,7 @@ static PCSC_SCARDHANDLE* PCSC_GetCardHandleData(SCARDHANDLE hCard) if (!g_CardHandles) return NULL; - pCard = (PCSC_SCARDHANDLE*) ListDictionary_GetItemValue(g_CardHandles, (void*) hCard); + pCard = (PCSC_SCARDHANDLE*)ListDictionary_GetItemValue(g_CardHandles, (void*)hCard); if (!pCard) return NULL; @@ -505,7 +507,7 @@ static PCSC_SCARDHANDLE* PCSC_ConnectCardHandle(SCARDCONTEXT hSharedContext, SCA return NULL; } - pCard = (PCSC_SCARDHANDLE*) calloc(1, sizeof(PCSC_SCARDHANDLE)); + pCard = (PCSC_SCARDHANDLE*)calloc(1, sizeof(PCSC_SCARDHANDLE)); if (!pCard) return NULL; @@ -520,7 +522,7 @@ static PCSC_SCARDHANDLE* PCSC_ConnectCardHandle(SCARDCONTEXT hSharedContext, SCA goto error; } - if (!ListDictionary_Add(g_CardHandles, (void*) hCard, (void*) pCard)) + if (!ListDictionary_Add(g_CardHandles, (void*)hCard, (void*)pCard)) goto error; pContext->dwCardHandleCount++; @@ -545,7 +547,7 @@ static void PCSC_DisconnectCardHandle(SCARDHANDLE hCard) if (!g_CardHandles) return; - ListDictionary_Remove(g_CardHandles, (void*) hCard); + ListDictionary_Remove(g_CardHandles, (void*)hCard); if (!pContext) { @@ -566,7 +568,7 @@ static BOOL PCSC_AddMemoryBlock(SCARDCONTEXT hContext, void* pvMem) return FALSE; } - return ListDictionary_Add(g_MemoryBlocks, pvMem, (void*) hContext); + return ListDictionary_Add(g_MemoryBlocks, pvMem, (void*)hContext); } static void* PCSC_RemoveMemoryBlock(SCARDCONTEXT hContext, void* pvMem) @@ -583,8 +585,9 @@ static void* PCSC_RemoveMemoryBlock(SCARDCONTEXT hContext, void* pvMem) * Standard Windows Smart Card API (PCSC) */ -WINSCARDAPI LONG WINAPI PCSC_SCardEstablishContext_Internal(DWORD dwScope, - LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext) +WINSCARDAPI LONG WINAPI PCSC_SCardEstablishContext_Internal(DWORD dwScope, LPCVOID pvReserved1, + LPCVOID pvReserved2, + LPSCARDCONTEXT phContext) { WINPR_UNUSED(dwScope); /* SCARD_SCOPE_SYSTEM is the only scope supported by pcsc-lite */ LONG status = SCARD_S_SUCCESS; @@ -592,14 +595,14 @@ WINSCARDAPI LONG WINAPI PCSC_SCardEstablishContext_Internal(DWORD dwScope, if (!g_PCSC.pfnSCardEstablishContext) return SCARD_E_NO_SERVICE; - status = (LONG) g_PCSC.pfnSCardEstablishContext(SCARD_SCOPE_SYSTEM, pvReserved1, pvReserved2, - phContext); + status = (LONG)g_PCSC.pfnSCardEstablishContext(SCARD_SCOPE_SYSTEM, pvReserved1, pvReserved2, + phContext); status = PCSC_MapErrorCodeToWinSCard(status); return status; } -WINSCARDAPI LONG WINAPI PCSC_SCardEstablishContext(DWORD dwScope, - LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext) +WINSCARDAPI LONG WINAPI PCSC_SCardEstablishContext(DWORD dwScope, LPCVOID pvReserved1, + LPCVOID pvReserved2, LPSCARDCONTEXT phContext) { LONG status; status = PCSC_SCardEstablishContext_Internal(dwScope, pvReserved1, pvReserved2, phContext); @@ -623,7 +626,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardReleaseContext_Internal(SCARDCONTEXT hContext) return status; } - status = (LONG) g_PCSC.pfnSCardReleaseContext(hContext); + status = (LONG)g_PCSC.pfnSCardReleaseContext(hContext); status = PCSC_MapErrorCodeToWinSCard(status); return status; } @@ -646,17 +649,17 @@ WINSCARDAPI LONG WINAPI PCSC_SCardIsValidContext(SCARDCONTEXT hContext) if (!g_PCSC.pfnSCardIsValidContext) return SCARD_E_NO_SERVICE; - status = (LONG) g_PCSC.pfnSCardIsValidContext(hContext); + status = (LONG)g_PCSC.pfnSCardIsValidContext(hContext); status = PCSC_MapErrorCodeToWinSCard(status); return status; } -WINSCARDAPI LONG WINAPI PCSC_SCardListReaderGroups_Internal(SCARDCONTEXT hContext, - LPSTR mszGroups, LPDWORD pcchGroups) +WINSCARDAPI LONG WINAPI PCSC_SCardListReaderGroups_Internal(SCARDCONTEXT hContext, LPSTR mszGroups, + LPDWORD pcchGroups) { LONG status = SCARD_S_SUCCESS; BOOL pcchGroupsAlloc = FALSE; - LPSTR* pMszGroups = (LPSTR*) mszGroups; + LPSTR* pMszGroups = (LPSTR*)mszGroups; PCSC_DWORD pcsc_cchGroups = 0; if (!pcchGroups) @@ -668,12 +671,12 @@ WINSCARDAPI LONG WINAPI PCSC_SCardListReaderGroups_Internal(SCARDCONTEXT hContex if (*pcchGroups == SCARD_AUTOALLOCATE) pcchGroupsAlloc = TRUE; - pcsc_cchGroups = pcchGroupsAlloc ? PCSC_SCARD_AUTOALLOCATE : (PCSC_DWORD) * pcchGroups; + pcsc_cchGroups = pcchGroupsAlloc ? PCSC_SCARD_AUTOALLOCATE : (PCSC_DWORD)*pcchGroups; if (pcchGroupsAlloc && !g_SCardAutoAllocate) { pcsc_cchGroups = 0; - status = (LONG) g_PCSC.pfnSCardListReaderGroups(hContext, NULL, &pcsc_cchGroups); + status = (LONG)g_PCSC.pfnSCardListReaderGroups(hContext, NULL, &pcsc_cchGroups); if (status == SCARD_S_SUCCESS) { @@ -682,7 +685,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardListReaderGroups_Internal(SCARDCONTEXT hContex if (!*pMszGroups) return SCARD_E_NO_MEMORY; - status = (LONG) g_PCSC.pfnSCardListReaderGroups(hContext, *pMszGroups, &pcsc_cchGroups); + status = (LONG)g_PCSC.pfnSCardListReaderGroups(hContext, *pMszGroups, &pcsc_cchGroups); if (status != SCARD_S_SUCCESS) free(*pMszGroups); @@ -692,16 +695,16 @@ WINSCARDAPI LONG WINAPI PCSC_SCardListReaderGroups_Internal(SCARDCONTEXT hContex } else { - status = (LONG) g_PCSC.pfnSCardListReaderGroups(hContext, mszGroups, &pcsc_cchGroups); + status = (LONG)g_PCSC.pfnSCardListReaderGroups(hContext, mszGroups, &pcsc_cchGroups); } status = PCSC_MapErrorCodeToWinSCard(status); - *pcchGroups = (DWORD) pcsc_cchGroups; + *pcchGroups = (DWORD)pcsc_cchGroups; return status; } -WINSCARDAPI LONG WINAPI PCSC_SCardListReaderGroupsA(SCARDCONTEXT hContext, - LPSTR mszGroups, LPDWORD pcchGroups) +WINSCARDAPI LONG WINAPI PCSC_SCardListReaderGroupsA(SCARDCONTEXT hContext, LPSTR mszGroups, + LPDWORD pcchGroups) { LONG status = SCARD_S_SUCCESS; @@ -719,8 +722,8 @@ WINSCARDAPI LONG WINAPI PCSC_SCardListReaderGroupsA(SCARDCONTEXT hContext, return status; } -WINSCARDAPI LONG WINAPI PCSC_SCardListReaderGroupsW(SCARDCONTEXT hContext, - LPWSTR mszGroups, LPDWORD pcchGroups) +WINSCARDAPI LONG WINAPI PCSC_SCardListReaderGroupsW(SCARDCONTEXT hContext, LPWSTR mszGroups, + LPDWORD pcchGroups) { LPSTR mszGroupsA = NULL; LPSTR* pMszGroupsA = &mszGroupsA; @@ -732,11 +735,12 @@ WINSCARDAPI LONG WINAPI PCSC_SCardListReaderGroupsW(SCARDCONTEXT hContext, if (!PCSC_LockCardContext(hContext)) return SCARD_E_INVALID_HANDLE; - status = PCSC_SCardListReaderGroups_Internal(hContext, (LPSTR) &mszGroupsA, pcchGroups); + status = PCSC_SCardListReaderGroups_Internal(hContext, (LPSTR)&mszGroupsA, pcchGroups); if (status == SCARD_S_SUCCESS) { - *pcchGroups = ConvertToUnicode(CP_UTF8, 0, *pMszGroupsA, *pcchGroups, (WCHAR**) mszGroups, 0); + *pcchGroups = + ConvertToUnicode(CP_UTF8, 0, *pMszGroupsA, *pcchGroups, (WCHAR**)mszGroups, 0); PCSC_AddMemoryBlock(hContext, mszGroups); PCSC_SCardFreeMemory_Internal(hContext, *pMszGroupsA); } @@ -747,12 +751,12 @@ WINSCARDAPI LONG WINAPI PCSC_SCardListReaderGroupsW(SCARDCONTEXT hContext, return status; } -WINSCARDAPI LONG WINAPI PCSC_SCardListReaders_Internal(SCARDCONTEXT hContext, - LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders) +WINSCARDAPI LONG WINAPI PCSC_SCardListReaders_Internal(SCARDCONTEXT hContext, LPCSTR mszGroups, + LPSTR mszReaders, LPDWORD pcchReaders) { LONG status = SCARD_S_SUCCESS; BOOL pcchReadersAlloc = FALSE; - LPSTR* pMszReaders = (LPSTR*) mszReaders; + LPSTR* pMszReaders = (LPSTR*)mszReaders; PCSC_DWORD pcsc_cchReaders = 0; if (!pcchReaders) @@ -766,12 +770,12 @@ WINSCARDAPI LONG WINAPI PCSC_SCardListReaders_Internal(SCARDCONTEXT hContext, if (*pcchReaders == SCARD_AUTOALLOCATE) pcchReadersAlloc = TRUE; - pcsc_cchReaders = pcchReadersAlloc ? PCSC_SCARD_AUTOALLOCATE : (PCSC_DWORD) * pcchReaders; + pcsc_cchReaders = pcchReadersAlloc ? PCSC_SCARD_AUTOALLOCATE : (PCSC_DWORD)*pcchReaders; if (pcchReadersAlloc && !g_SCardAutoAllocate) { pcsc_cchReaders = 0; - status = (LONG) g_PCSC.pfnSCardListReaders(hContext, mszGroups, NULL, &pcsc_cchReaders); + status = (LONG)g_PCSC.pfnSCardListReaders(hContext, mszGroups, NULL, &pcsc_cchReaders); if (status == SCARD_S_SUCCESS) { @@ -780,7 +784,8 @@ WINSCARDAPI LONG WINAPI PCSC_SCardListReaders_Internal(SCARDCONTEXT hContext, if (!*pMszReaders) return SCARD_E_NO_MEMORY; - status = (LONG) g_PCSC.pfnSCardListReaders(hContext, mszGroups, *pMszReaders, &pcsc_cchReaders); + status = (LONG)g_PCSC.pfnSCardListReaders(hContext, mszGroups, *pMszReaders, + &pcsc_cchReaders); if (status != SCARD_S_SUCCESS) free(*pMszReaders); @@ -790,16 +795,17 @@ WINSCARDAPI LONG WINAPI PCSC_SCardListReaders_Internal(SCARDCONTEXT hContext, } else { - status = (LONG) g_PCSC.pfnSCardListReaders(hContext, mszGroups, mszReaders, &pcsc_cchReaders); + status = + (LONG)g_PCSC.pfnSCardListReaders(hContext, mszGroups, mszReaders, &pcsc_cchReaders); } status = PCSC_MapErrorCodeToWinSCard(status); - *pcchReaders = (DWORD) pcsc_cchReaders; + *pcchReaders = (DWORD)pcsc_cchReaders; return status; } -WINSCARDAPI LONG WINAPI PCSC_SCardListReadersA(SCARDCONTEXT hContext, - LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders) +WINSCARDAPI LONG WINAPI PCSC_SCardListReadersA(SCARDCONTEXT hContext, LPCSTR mszGroups, + LPSTR mszReaders, LPDWORD pcchReaders) { BOOL nullCardContext = FALSE; LONG status = SCARD_S_SUCCESS; @@ -833,8 +839,8 @@ WINSCARDAPI LONG WINAPI PCSC_SCardListReadersA(SCARDCONTEXT hContext, return status; } -WINSCARDAPI LONG WINAPI PCSC_SCardListReadersW(SCARDCONTEXT hContext, - LPCWSTR mszGroups, LPWSTR mszReaders, LPDWORD pcchReaders) +WINSCARDAPI LONG WINAPI PCSC_SCardListReadersW(SCARDCONTEXT hContext, LPCWSTR mszGroups, + LPWSTR mszReaders, LPDWORD pcchReaders) { LPSTR mszGroupsA = NULL; LPSTR mszReadersA = NULL; @@ -861,13 +867,14 @@ WINSCARDAPI LONG WINAPI PCSC_SCardListReadersW(SCARDCONTEXT hContext, mszGroups = NULL; /* mszGroups is not supported by pcsc-lite */ if (mszGroups) - ConvertFromUnicode(CP_UTF8, 0, mszGroups, -1, (char**) &mszGroupsA, 0, NULL, NULL); + ConvertFromUnicode(CP_UTF8, 0, mszGroups, -1, (char**)&mszGroupsA, 0, NULL, NULL); - status = PCSC_SCardListReaders_Internal(hContext, mszGroupsA, (LPSTR) &mszReadersA, pcchReaders); + status = PCSC_SCardListReaders_Internal(hContext, mszGroupsA, (LPSTR)&mszReadersA, pcchReaders); if (status == SCARD_S_SUCCESS) { - *pcchReaders = ConvertToUnicode(CP_UTF8, 0, *pMszReadersA, *pcchReaders, (WCHAR**) mszReaders, 0); + *pcchReaders = + ConvertToUnicode(CP_UTF8, 0, *pMszReadersA, *pcchReaders, (WCHAR**)mszReaders, 0); PCSC_AddMemoryBlock(hContext, mszReaders); PCSC_SCardFreeMemory_Internal(hContext, *pMszReadersA); } @@ -885,52 +892,54 @@ WINSCARDAPI LONG WINAPI PCSC_SCardListReadersW(SCARDCONTEXT hContext, return status; } -WINSCARDAPI LONG WINAPI PCSC_SCardListCardsA(SCARDCONTEXT hContext, - LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, CHAR* mszCards, - LPDWORD pcchCards) +WINSCARDAPI LONG WINAPI PCSC_SCardListCardsA(SCARDCONTEXT hContext, LPCBYTE pbAtr, + LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, + CHAR* mszCards, LPDWORD pcchCards) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardListCardsW(SCARDCONTEXT hContext, - LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, WCHAR* mszCards, - LPDWORD pcchCards) +WINSCARDAPI LONG WINAPI PCSC_SCardListCardsW(SCARDCONTEXT hContext, LPCBYTE pbAtr, + LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, + WCHAR* mszCards, LPDWORD pcchCards) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardListInterfacesA(SCARDCONTEXT hContext, - LPCSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces) +WINSCARDAPI LONG WINAPI PCSC_SCardListInterfacesA(SCARDCONTEXT hContext, LPCSTR szCard, + LPGUID pguidInterfaces, LPDWORD pcguidInterfaces) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardListInterfacesW(SCARDCONTEXT hContext, - LPCWSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces) +WINSCARDAPI LONG WINAPI PCSC_SCardListInterfacesW(SCARDCONTEXT hContext, LPCWSTR szCard, + LPGUID pguidInterfaces, LPDWORD pcguidInterfaces) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardGetProviderIdA(SCARDCONTEXT hContext, - LPCSTR szCard, LPGUID pguidProviderId) +WINSCARDAPI LONG WINAPI PCSC_SCardGetProviderIdA(SCARDCONTEXT hContext, LPCSTR szCard, + LPGUID pguidProviderId) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardGetProviderIdW(SCARDCONTEXT hContext, - LPCWSTR szCard, LPGUID pguidProviderId) +WINSCARDAPI LONG WINAPI PCSC_SCardGetProviderIdW(SCARDCONTEXT hContext, LPCWSTR szCard, + LPGUID pguidProviderId) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardGetCardTypeProviderNameA(SCARDCONTEXT hContext, - LPCSTR szCardName, DWORD dwProviderId, CHAR* szProvider, LPDWORD pcchProvider) +WINSCARDAPI LONG WINAPI PCSC_SCardGetCardTypeProviderNameA(SCARDCONTEXT hContext, LPCSTR szCardName, + DWORD dwProviderId, CHAR* szProvider, + LPDWORD pcchProvider) { return 0; } WINSCARDAPI LONG WINAPI PCSC_SCardGetCardTypeProviderNameW(SCARDCONTEXT hContext, - LPCWSTR szCardName, DWORD dwProviderId, WCHAR* szProvider, LPDWORD pcchProvider) + LPCWSTR szCardName, DWORD dwProviderId, + WCHAR* szProvider, LPDWORD pcchProvider) { return 0; } @@ -955,14 +964,14 @@ WINSCARDAPI LONG WINAPI PCSC_SCardForgetReaderGroupW(SCARDCONTEXT hContext, LPCW return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceReaderA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPCSTR szDeviceName) +WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceReaderA(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPCSTR szDeviceName) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceReaderW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPCWSTR szDeviceName) +WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceReaderW(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPCWSTR szDeviceName) { return 0; } @@ -977,52 +986,57 @@ WINSCARDAPI LONG WINAPI PCSC_SCardForgetReaderW(SCARDCONTEXT hContext, LPCWSTR s return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardAddReaderToGroupA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPCSTR szGroupName) +WINSCARDAPI LONG WINAPI PCSC_SCardAddReaderToGroupA(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPCSTR szGroupName) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardAddReaderToGroupW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPCWSTR szGroupName) +WINSCARDAPI LONG WINAPI PCSC_SCardAddReaderToGroupW(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPCWSTR szGroupName) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardRemoveReaderFromGroupA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPCSTR szGroupName) +WINSCARDAPI LONG WINAPI PCSC_SCardRemoveReaderFromGroupA(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPCSTR szGroupName) { return 0; } WINSCARDAPI LONG WINAPI PCSC_SCardRemoveReaderFromGroupW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPCWSTR szGroupName) + LPCWSTR szReaderName, LPCWSTR szGroupName) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceCardTypeA(SCARDCONTEXT hContext, - LPCSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, - DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen) +WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceCardTypeA(SCARDCONTEXT hContext, LPCSTR szCardName, + LPCGUID pguidPrimaryProvider, + LPCGUID rgguidInterfaces, + DWORD dwInterfaceCount, LPCBYTE pbAtr, + LPCBYTE pbAtrMask, DWORD cbAtrLen) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceCardTypeW(SCARDCONTEXT hContext, - LPCWSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, - DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen) +WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceCardTypeW(SCARDCONTEXT hContext, LPCWSTR szCardName, + LPCGUID pguidPrimaryProvider, + LPCGUID rgguidInterfaces, + DWORD dwInterfaceCount, LPCBYTE pbAtr, + LPCBYTE pbAtrMask, DWORD cbAtrLen) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardSetCardTypeProviderNameA(SCARDCONTEXT hContext, - LPCSTR szCardName, DWORD dwProviderId, LPCSTR szProvider) +WINSCARDAPI LONG WINAPI PCSC_SCardSetCardTypeProviderNameA(SCARDCONTEXT hContext, LPCSTR szCardName, + DWORD dwProviderId, LPCSTR szProvider) { return 0; } WINSCARDAPI LONG WINAPI PCSC_SCardSetCardTypeProviderNameW(SCARDCONTEXT hContext, - LPCWSTR szCardName, DWORD dwProviderId, LPCWSTR szProvider) + LPCWSTR szCardName, DWORD dwProviderId, + LPCWSTR szProvider) { return 0; } @@ -1041,16 +1055,16 @@ WINSCARDAPI LONG WINAPI PCSC_SCardFreeMemory_Internal(SCARDCONTEXT hContext, LPC { LONG status = SCARD_S_SUCCESS; - if (PCSC_RemoveMemoryBlock(hContext, (void*) pvMem)) + if (PCSC_RemoveMemoryBlock(hContext, (void*)pvMem)) { - free((void*) pvMem); + free((void*)pvMem); status = SCARD_S_SUCCESS; } else { if (g_PCSC.pfnSCardFreeMemory) { - status = (LONG) g_PCSC.pfnSCardFreeMemory(hContext, pvMem); + status = (LONG)g_PCSC.pfnSCardFreeMemory(hContext, pvMem); status = PCSC_MapErrorCodeToWinSCard(status); } } @@ -1123,40 +1137,45 @@ WINSCARDAPI void WINAPI PCSC_SCardReleaseStartedEvent(void) } } -WINSCARDAPI LONG WINAPI PCSC_SCardLocateCardsA(SCARDCONTEXT hContext, - LPCSTR mszCards, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders) +WINSCARDAPI LONG WINAPI PCSC_SCardLocateCardsA(SCARDCONTEXT hContext, LPCSTR mszCards, + LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardLocateCardsW(SCARDCONTEXT hContext, - LPCWSTR mszCards, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders) +WINSCARDAPI LONG WINAPI PCSC_SCardLocateCardsW(SCARDCONTEXT hContext, LPCWSTR mszCards, + LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders) { return 0; } WINSCARDAPI LONG WINAPI PCSC_SCardLocateCardsByATRA(SCARDCONTEXT hContext, - LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders) + LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, + LPSCARD_READERSTATEA rgReaderStates, + DWORD cReaders) { return 0; } WINSCARDAPI LONG WINAPI PCSC_SCardLocateCardsByATRW(SCARDCONTEXT hContext, - LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders) + LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, + LPSCARD_READERSTATEW rgReaderStates, + DWORD cReaders) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardGetStatusChange_Internal(SCARDCONTEXT hContext, - DWORD dwTimeout, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders) +WINSCARDAPI LONG WINAPI PCSC_SCardGetStatusChange_Internal(SCARDCONTEXT hContext, DWORD dwTimeout, + LPSCARD_READERSTATEA rgReaderStates, + DWORD cReaders) { PCSC_DWORD i, j; int* map; PCSC_DWORD cMappedReaders; PCSC_SCARD_READERSTATE* states; LONG status = SCARD_S_SUCCESS; - PCSC_DWORD pcsc_dwTimeout = (PCSC_DWORD) dwTimeout; - PCSC_DWORD pcsc_cReaders = (PCSC_DWORD) cReaders; + PCSC_DWORD pcsc_dwTimeout = (PCSC_DWORD)dwTimeout; + PCSC_DWORD pcsc_cReaders = (PCSC_DWORD)cReaders; if (!g_PCSC.pfnSCardGetStatusChange) return SCARD_E_NO_SERVICE; @@ -1179,12 +1198,12 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetStatusChange_Internal(SCARDCONTEXT hContext * To work around this apparent lack of "\\\\?PnP?\\Notification" support, * we have to filter rgReaderStates to exclude the special PnP reader name. */ - map = (int*) calloc(pcsc_cReaders, sizeof(int)); + map = (int*)calloc(pcsc_cReaders, sizeof(int)); if (!map) return SCARD_E_NO_MEMORY; - states = (PCSC_SCARD_READERSTATE*) calloc(pcsc_cReaders, sizeof(PCSC_SCARD_READERSTATE)); + states = (PCSC_SCARD_READERSTATE*)calloc(pcsc_cReaders, sizeof(PCSC_SCARD_READERSTATE)); if (!states) { @@ -1217,8 +1236,8 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetStatusChange_Internal(SCARDCONTEXT hContext if (cMappedReaders > 0) { - status = (LONG) g_PCSC.pfnSCardGetStatusChange(hContext, - pcsc_dwTimeout, states, cMappedReaders); + status = + (LONG)g_PCSC.pfnSCardGetStatusChange(hContext, pcsc_dwTimeout, states, cMappedReaders); status = PCSC_MapErrorCodeToWinSCard(status); } else @@ -1243,8 +1262,9 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetStatusChange_Internal(SCARDCONTEXT hContext return status; } -WINSCARDAPI LONG WINAPI PCSC_SCardGetStatusChangeA(SCARDCONTEXT hContext, - DWORD dwTimeout, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders) +WINSCARDAPI LONG WINAPI PCSC_SCardGetStatusChangeA(SCARDCONTEXT hContext, DWORD dwTimeout, + LPSCARD_READERSTATEA rgReaderStates, + DWORD cReaders) { LONG status = SCARD_S_SUCCESS; @@ -1259,8 +1279,9 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetStatusChangeA(SCARDCONTEXT hContext, return status; } -WINSCARDAPI LONG WINAPI PCSC_SCardGetStatusChangeW(SCARDCONTEXT hContext, - DWORD dwTimeout, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders) +WINSCARDAPI LONG WINAPI PCSC_SCardGetStatusChangeW(SCARDCONTEXT hContext, DWORD dwTimeout, + LPSCARD_READERSTATEW rgReaderStates, + DWORD cReaders) { DWORD index; LPSCARD_READERSTATEA states; @@ -1272,7 +1293,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetStatusChangeW(SCARDCONTEXT hContext, if (!PCSC_LockCardContext(hContext)) return SCARD_E_INVALID_HANDLE; - states = (LPSCARD_READERSTATEA) calloc(cReaders, sizeof(SCARD_READERSTATEA)); + states = (LPSCARD_READERSTATEA)calloc(cReaders, sizeof(SCARD_READERSTATEA)); if (!states) { @@ -1284,7 +1305,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetStatusChangeW(SCARDCONTEXT hContext, { states[index].szReader = NULL; ConvertFromUnicode(CP_UTF8, 0, rgReaderStates[index].szReader, -1, - (char**) & (states[index].szReader), 0, NULL, NULL); + (char**)&(states[index].szReader), 0, NULL, NULL); states[index].pvUserData = rgReaderStates[index].pvUserData; states[index].dwCurrentState = rgReaderStates[index].dwCurrentState; states[index].dwEventState = rgReaderStates[index].dwEventState; @@ -1296,7 +1317,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetStatusChangeW(SCARDCONTEXT hContext, for (index = 0; index < cReaders; index++) { - free((void*) states[index].szReader); + free((void*)states[index].szReader); rgReaderStates[index].pvUserData = states[index].pvUserData; rgReaderStates[index].dwCurrentState = states[index].dwCurrentState; rgReaderStates[index].dwEventState = states[index].dwEventState; @@ -1319,20 +1340,20 @@ WINSCARDAPI LONG WINAPI PCSC_SCardCancel(SCARDCONTEXT hContext) if (!g_PCSC.pfnSCardCancel) return SCARD_E_NO_SERVICE; - status = (LONG) g_PCSC.pfnSCardCancel(hContext); + status = (LONG)g_PCSC.pfnSCardCancel(hContext); status = PCSC_MapErrorCodeToWinSCard(status); return status; } -WINSCARDAPI LONG WINAPI PCSC_SCardConnect_Internal(SCARDCONTEXT hContext, - LPCSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, - LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol) +WINSCARDAPI LONG WINAPI PCSC_SCardConnect_Internal(SCARDCONTEXT hContext, LPCSTR szReader, + DWORD dwShareMode, DWORD dwPreferredProtocols, + LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol) { BOOL shared; char* szReaderPCSC; LONG status = SCARD_S_SUCCESS; PCSC_SCARDHANDLE* pCard = NULL; - PCSC_DWORD pcsc_dwShareMode = (PCSC_DWORD) dwShareMode; + PCSC_DWORD pcsc_dwShareMode = (PCSC_DWORD)dwShareMode; PCSC_DWORD pcsc_dwPreferredProtocols = 0; PCSC_DWORD pcsc_dwActiveProtocol = 0; @@ -1341,26 +1362,30 @@ WINSCARDAPI LONG WINAPI PCSC_SCardConnect_Internal(SCARDCONTEXT hContext, shared = (dwShareMode == SCARD_SHARE_DIRECT) ? TRUE : FALSE; PCSC_WaitForCardAccess(hContext, 0, shared); - szReaderPCSC = (char*) szReader; + szReaderPCSC = (char*)szReader; /** - * As stated here : https://pcsclite.alioth.debian.org/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5 - * SCARD_PROTOCOL_UNDEFINED is valid for dwPreferredProtocols (only) if dwShareMode == SCARD_SHARE_DIRECT - * and allows to send control commands to the reader (with SCardControl()) even if a card is not present in the reader + * As stated here : + * https://pcsclite.alioth.debian.org/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5 + * SCARD_PROTOCOL_UNDEFINED is valid for dwPreferredProtocols (only) if dwShareMode == + * SCARD_SHARE_DIRECT and allows to send control commands to the reader (with SCardControl()) + * even if a card is not present in the reader */ if (pcsc_dwShareMode == SCARD_SHARE_DIRECT && dwPreferredProtocols == SCARD_PROTOCOL_UNDEFINED) pcsc_dwPreferredProtocols = SCARD_PROTOCOL_UNDEFINED; else - pcsc_dwPreferredProtocols = (PCSC_DWORD) PCSC_ConvertProtocolsFromWinSCard(dwPreferredProtocols); + pcsc_dwPreferredProtocols = + (PCSC_DWORD)PCSC_ConvertProtocolsFromWinSCard(dwPreferredProtocols); - status = (LONG) g_PCSC.pfnSCardConnect(hContext, szReaderPCSC, - pcsc_dwShareMode, pcsc_dwPreferredProtocols, phCard, &pcsc_dwActiveProtocol); + status = + (LONG)g_PCSC.pfnSCardConnect(hContext, szReaderPCSC, pcsc_dwShareMode, + pcsc_dwPreferredProtocols, phCard, &pcsc_dwActiveProtocol); status = PCSC_MapErrorCodeToWinSCard(status); if (status == SCARD_S_SUCCESS) { pCard = PCSC_ConnectCardHandle(hContext, *phCard); - *pdwActiveProtocol = PCSC_ConvertProtocolsToWinSCard((DWORD) pcsc_dwActiveProtocol); + *pdwActiveProtocol = PCSC_ConvertProtocolsToWinSCard((DWORD)pcsc_dwActiveProtocol); pCard->shared = shared; PCSC_WaitForCardAccess(hContext, pCard->hSharedContext, shared); } @@ -1368,17 +1393,17 @@ WINSCARDAPI LONG WINAPI PCSC_SCardConnect_Internal(SCARDCONTEXT hContext, return status; } -WINSCARDAPI LONG WINAPI PCSC_SCardConnectA(SCARDCONTEXT hContext, - LPCSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, - LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol) +WINSCARDAPI LONG WINAPI PCSC_SCardConnectA(SCARDCONTEXT hContext, LPCSTR szReader, + DWORD dwShareMode, DWORD dwPreferredProtocols, + LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol) { LONG status = SCARD_S_SUCCESS; if (!PCSC_LockCardContext(hContext)) return SCARD_E_INVALID_HANDLE; - status = PCSC_SCardConnect_Internal(hContext, szReader, dwShareMode, - dwPreferredProtocols, phCard, pdwActiveProtocol); + status = PCSC_SCardConnect_Internal(hContext, szReader, dwShareMode, dwPreferredProtocols, + phCard, pdwActiveProtocol); if (!PCSC_UnlockCardContext(hContext)) return SCARD_E_INVALID_HANDLE; @@ -1386,9 +1411,9 @@ WINSCARDAPI LONG WINAPI PCSC_SCardConnectA(SCARDCONTEXT hContext, return status; } -WINSCARDAPI LONG WINAPI PCSC_SCardConnectW(SCARDCONTEXT hContext, - LPCWSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, - LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol) +WINSCARDAPI LONG WINAPI PCSC_SCardConnectW(SCARDCONTEXT hContext, LPCWSTR szReader, + DWORD dwShareMode, DWORD dwPreferredProtocols, + LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol) { LPSTR szReaderA = NULL; LONG status = SCARD_S_SUCCESS; @@ -1399,8 +1424,8 @@ WINSCARDAPI LONG WINAPI PCSC_SCardConnectW(SCARDCONTEXT hContext, if (szReader) ConvertFromUnicode(CP_UTF8, 0, szReader, -1, &szReaderA, 0, NULL, NULL); - status = PCSC_SCardConnect_Internal(hContext, szReaderA, dwShareMode, - dwPreferredProtocols, phCard, pdwActiveProtocol); + status = PCSC_SCardConnect_Internal(hContext, szReaderA, dwShareMode, dwPreferredProtocols, + phCard, pdwActiveProtocol); free(szReaderA); if (!PCSC_UnlockCardContext(hContext)) @@ -1409,14 +1434,15 @@ WINSCARDAPI LONG WINAPI PCSC_SCardConnectW(SCARDCONTEXT hContext, return status; } -WINSCARDAPI LONG WINAPI PCSC_SCardReconnect(SCARDHANDLE hCard, - DWORD dwShareMode, DWORD dwPreferredProtocols, DWORD dwInitialization, LPDWORD pdwActiveProtocol) +WINSCARDAPI LONG WINAPI PCSC_SCardReconnect(SCARDHANDLE hCard, DWORD dwShareMode, + DWORD dwPreferredProtocols, DWORD dwInitialization, + LPDWORD pdwActiveProtocol) { BOOL shared; LONG status = SCARD_S_SUCCESS; - PCSC_DWORD pcsc_dwShareMode = (PCSC_DWORD) dwShareMode; + PCSC_DWORD pcsc_dwShareMode = (PCSC_DWORD)dwShareMode; PCSC_DWORD pcsc_dwPreferredProtocols = 0; - PCSC_DWORD pcsc_dwInitialization = (PCSC_DWORD) dwInitialization; + PCSC_DWORD pcsc_dwInitialization = (PCSC_DWORD)dwInitialization; PCSC_DWORD pcsc_dwActiveProtocol = 0; if (!g_PCSC.pfnSCardReconnect) @@ -1424,23 +1450,23 @@ WINSCARDAPI LONG WINAPI PCSC_SCardReconnect(SCARDHANDLE hCard, shared = (dwShareMode == SCARD_SHARE_DIRECT) ? TRUE : FALSE; PCSC_WaitForCardAccess(0, hCard, shared); - pcsc_dwPreferredProtocols = (PCSC_DWORD) PCSC_ConvertProtocolsFromWinSCard(dwPreferredProtocols); - status = (LONG) g_PCSC.pfnSCardReconnect(hCard, pcsc_dwShareMode, - pcsc_dwPreferredProtocols, pcsc_dwInitialization, &pcsc_dwActiveProtocol); + pcsc_dwPreferredProtocols = (PCSC_DWORD)PCSC_ConvertProtocolsFromWinSCard(dwPreferredProtocols); + status = (LONG)g_PCSC.pfnSCardReconnect(hCard, pcsc_dwShareMode, pcsc_dwPreferredProtocols, + pcsc_dwInitialization, &pcsc_dwActiveProtocol); status = PCSC_MapErrorCodeToWinSCard(status); - *pdwActiveProtocol = PCSC_ConvertProtocolsToWinSCard((DWORD) pcsc_dwActiveProtocol); + *pdwActiveProtocol = PCSC_ConvertProtocolsToWinSCard((DWORD)pcsc_dwActiveProtocol); return status; } WINSCARDAPI LONG WINAPI PCSC_SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition) { LONG status = SCARD_S_SUCCESS; - PCSC_DWORD pcsc_dwDisposition = (PCSC_DWORD) dwDisposition; + PCSC_DWORD pcsc_dwDisposition = (PCSC_DWORD)dwDisposition; if (!g_PCSC.pfnSCardDisconnect) return SCARD_E_NO_SERVICE; - status = (LONG) g_PCSC.pfnSCardDisconnect(hCard, pcsc_dwDisposition); + status = (LONG)g_PCSC.pfnSCardDisconnect(hCard, pcsc_dwDisposition); status = PCSC_MapErrorCodeToWinSCard(status); if (status == SCARD_S_SUCCESS) @@ -1474,7 +1500,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardBeginTransaction(SCARDHANDLE hCard) if (pContext->isTransactionLocked) return SCARD_S_SUCCESS; /* disable nested transactions */ - status = (LONG) g_PCSC.pfnSCardBeginTransaction(hCard); + status = (LONG)g_PCSC.pfnSCardBeginTransaction(hCard); status = PCSC_MapErrorCodeToWinSCard(status); pContext->isTransactionLocked = TRUE; return status; @@ -1485,7 +1511,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardEndTransaction(SCARDHANDLE hCard, DWORD dwDisp LONG status = SCARD_S_SUCCESS; PCSC_SCARDHANDLE* pCard = NULL; PCSC_SCARDCONTEXT* pContext = NULL; - PCSC_DWORD pcsc_dwDisposition = (PCSC_DWORD) dwDisposition; + PCSC_DWORD pcsc_dwDisposition = (PCSC_DWORD)dwDisposition; if (!g_PCSC.pfnSCardEndTransaction) return SCARD_E_NO_SERVICE; @@ -1505,7 +1531,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardEndTransaction(SCARDHANDLE hCard, DWORD dwDisp if (!pContext->isTransactionLocked) return SCARD_S_SUCCESS; /* disable nested transactions */ - status = (LONG) g_PCSC.pfnSCardEndTransaction(hCard, pcsc_dwDisposition); + status = (LONG)g_PCSC.pfnSCardEndTransaction(hCard, pcsc_dwDisposition); status = PCSC_MapErrorCodeToWinSCard(status); pContext->isTransactionLocked = FALSE; return status; @@ -1516,8 +1542,8 @@ WINSCARDAPI LONG WINAPI PCSC_SCardCancelTransaction(SCARDHANDLE hCard) return SCARD_S_SUCCESS; } -WINSCARDAPI LONG WINAPI PCSC_SCardState(SCARDHANDLE hCard, - LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen) +WINSCARDAPI LONG WINAPI PCSC_SCardState(SCARDHANDLE hCard, LPDWORD pdwState, LPDWORD pdwProtocol, + LPBYTE pbAtr, LPDWORD pcbAtrLen) { PCSC_DWORD cchReaderLen; SCARDCONTEXT hContext = 0; @@ -1526,7 +1552,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardState(SCARDHANDLE hCard, PCSC_SCARDHANDLE* pCard = NULL; PCSC_DWORD pcsc_dwState = 0; PCSC_DWORD pcsc_dwProtocol = 0; - PCSC_DWORD pcsc_cbAtrLen = (PCSC_DWORD) * pcbAtrLen; + PCSC_DWORD pcsc_cbAtrLen = (PCSC_DWORD)*pcbAtrLen; if (!g_PCSC.pfnSCardStatus) return SCARD_E_NO_SERVICE; @@ -1543,16 +1569,16 @@ WINSCARDAPI LONG WINAPI PCSC_SCardState(SCARDHANDLE hCard, return SCARD_E_INVALID_VALUE; cchReaderLen = SCARD_AUTOALLOCATE; - status = (LONG) g_PCSC.pfnSCardStatus(hCard, (LPSTR) &mszReaderNames, &cchReaderLen, - &pcsc_dwState, &pcsc_dwProtocol, pbAtr, &pcsc_cbAtrLen); + status = (LONG)g_PCSC.pfnSCardStatus(hCard, (LPSTR)&mszReaderNames, &cchReaderLen, + &pcsc_dwState, &pcsc_dwProtocol, pbAtr, &pcsc_cbAtrLen); status = PCSC_MapErrorCodeToWinSCard(status); if (mszReaderNames) PCSC_SCardFreeMemory_Internal(hContext, mszReaderNames); - *pdwState = (DWORD) pcsc_dwState; - *pdwProtocol = PCSC_ConvertProtocolsToWinSCard((DWORD) pcsc_dwProtocol); - *pcbAtrLen = (DWORD) pcsc_cbAtrLen; + *pdwState = (DWORD)pcsc_dwState; + *pdwProtocol = PCSC_ConvertProtocolsToWinSCard((DWORD)pcsc_dwProtocol); + *pcbAtrLen = (DWORD)pcsc_cbAtrLen; return status; } @@ -1560,9 +1586,10 @@ WINSCARDAPI LONG WINAPI PCSC_SCardState(SCARDHANDLE hCard, * PCSC returns a string but Windows SCardStatus requires the return to be a multi string. * Therefore extra length checks and additional buffer allocation is required */ -WINSCARDAPI LONG WINAPI PCSC_SCardStatus_Internal(SCARDHANDLE hCard, - LPSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState, - LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen, BOOL unicode) +WINSCARDAPI LONG WINAPI PCSC_SCardStatus_Internal(SCARDHANDLE hCard, LPSTR mszReaderNames, + LPDWORD pcchReaderLen, LPDWORD pdwState, + LPDWORD pdwProtocol, LPBYTE pbAtr, + LPDWORD pcbAtrLen, BOOL unicode) { PCSC_SCARDHANDLE* pCard = NULL; SCARDCONTEXT hContext; @@ -1592,8 +1619,8 @@ WINSCARDAPI LONG WINAPI PCSC_SCardStatus_Internal(SCARDHANDLE hCard, if (!hContext) return SCARD_E_INVALID_VALUE; - status = (LONG) g_PCSC.pfnSCardStatus(hCard, NULL, &pcsc_cchReaderLen, NULL, NULL, NULL, - &pcsc_cbAtrLen); + status = (LONG)g_PCSC.pfnSCardStatus(hCard, NULL, &pcsc_cchReaderLen, NULL, NULL, NULL, + &pcsc_cbAtrLen); if (status != STATUS_SUCCESS) return PCSC_MapErrorCodeToWinSCard(status); @@ -1628,8 +1655,8 @@ WINSCARDAPI LONG WINAPI PCSC_SCardStatus_Internal(SCARDHANDLE hCard, #ifdef __MACOSX__ /** - * Workaround for SCardStatus Bug in MAC OS X Yosemite - */ + * Workaround for SCardStatus Bug in MAC OS X Yosemite + */ if (OSXVersion == 0x10100000) pcsc_cchReaderLen++; @@ -1658,9 +1685,8 @@ WINSCARDAPI LONG WINAPI PCSC_SCardStatus_Internal(SCARDHANDLE hCard, atr = tATR; } - status = (LONG) g_PCSC.pfnSCardStatus(hCard, readerNames, &pcsc_cchReaderLen, &pcsc_dwState, - &pcsc_dwProtocol, atr, - &pcsc_cbAtrLen); + status = (LONG)g_PCSC.pfnSCardStatus(hCard, readerNames, &pcsc_cchReaderLen, &pcsc_dwState, + &pcsc_dwProtocol, atr, &pcsc_cbAtrLen); if (status != STATUS_SUCCESS) goto out_fail; @@ -1677,8 +1703,8 @@ WINSCARDAPI LONG WINAPI PCSC_SCardStatus_Internal(SCARDHANDLE hCard, { LPSTR mszReaderNamesW = NULL; int pcsc_cchReaderLenW = 0; - pcsc_cchReaderLenW = ConvertToUnicode(CP_UTF8, 0, tReader, *pcchReaderLen, - (WCHAR**) &mszReaderNamesW, 0); + pcsc_cchReaderLenW = + ConvertToUnicode(CP_UTF8, 0, tReader, *pcchReaderLen, (WCHAR**)&mszReaderNamesW, 0); if (pcsc_cchReaderLenW <= 0 || mszReaderNamesW == NULL) { @@ -1689,25 +1715,25 @@ WINSCARDAPI LONG WINAPI PCSC_SCardStatus_Internal(SCARDHANDLE hCard, readerNames = mszReaderNamesW; free(tReader); PCSC_AddMemoryBlock(hContext, mszReaderNamesW); - *(LPSTR*) mszReaderNames = mszReaderNamesW; + *(LPSTR*)mszReaderNames = mszReaderNamesW; } else { PCSC_AddMemoryBlock(hContext, tReader); - *(LPSTR*) mszReaderNames = tReader; + *(LPSTR*)mszReaderNames = tReader; } } pcsc_dwState &= 0xFFFF; if (pdwState) - *pdwState = PCSC_ConvertCardStateToWinSCard((DWORD) pcsc_dwState, status); + *pdwState = PCSC_ConvertCardStateToWinSCard((DWORD)pcsc_dwState, status); if (pdwProtocol) - *pdwProtocol = PCSC_ConvertProtocolsToWinSCard((DWORD) pcsc_dwProtocol); + *pdwProtocol = PCSC_ConvertProtocolsToWinSCard((DWORD)pcsc_dwProtocol); if (pcbAtrLen) - *pcbAtrLen = (DWORD) pcsc_cbAtrLen; + *pcbAtrLen = (DWORD)pcsc_cbAtrLen; if (pcchReaderLen) { @@ -1736,25 +1762,26 @@ out_fail: return status; } -WINSCARDAPI LONG WINAPI PCSC_SCardStatusA(SCARDHANDLE hCard, - LPSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState, - LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen) +WINSCARDAPI LONG WINAPI PCSC_SCardStatusA(SCARDHANDLE hCard, LPSTR mszReaderNames, + LPDWORD pcchReaderLen, LPDWORD pdwState, + LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen) { return PCSC_SCardStatus_Internal(hCard, mszReaderNames, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen, FALSE); } -WINSCARDAPI LONG WINAPI PCSC_SCardStatusW(SCARDHANDLE hCard, - LPWSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState, - LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen) +WINSCARDAPI LONG WINAPI PCSC_SCardStatusW(SCARDHANDLE hCard, LPWSTR mszReaderNames, + LPDWORD pcchReaderLen, LPDWORD pdwState, + LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen) { - return PCSC_SCardStatus_Internal(hCard, (LPSTR) mszReaderNames, pcchReaderLen, pdwState, + return PCSC_SCardStatus_Internal(hCard, (LPSTR)mszReaderNames, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen, TRUE); } -WINSCARDAPI LONG WINAPI PCSC_SCardTransmit(SCARDHANDLE hCard, - LPCSCARD_IO_REQUEST pioSendPci, LPCBYTE pbSendBuffer, DWORD cbSendLength, - LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength) +WINSCARDAPI LONG WINAPI PCSC_SCardTransmit(SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pioSendPci, + LPCBYTE pbSendBuffer, DWORD cbSendLength, + LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, + LPDWORD pcbRecvLength) { LONG status = SCARD_S_SUCCESS; PCSC_SCARDHANDLE* pCard = NULL; @@ -1763,7 +1790,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardTransmit(SCARDHANDLE hCard, BYTE* pcsc_pbExtraBytes = NULL; PCSC_SCARD_IO_REQUEST* pcsc_pioSendPci = NULL; PCSC_SCARD_IO_REQUEST* pcsc_pioRecvPci = NULL; - PCSC_DWORD pcsc_cbSendLength = (PCSC_DWORD) cbSendLength; + PCSC_DWORD pcsc_cbSendLength = (PCSC_DWORD)cbSendLength; PCSC_DWORD pcsc_cbRecvLength = 0; if (!g_PCSC.pfnSCardTransmit) @@ -1782,7 +1809,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardTransmit(SCARDHANDLE hCard, if (*pcbRecvLength == SCARD_AUTOALLOCATE) return SCARD_E_INVALID_PARAMETER; - pcsc_cbRecvLength = (PCSC_DWORD) * pcbRecvLength; + pcsc_cbRecvLength = (PCSC_DWORD)*pcbRecvLength; if (!pioSendPci) { @@ -1794,38 +1821,40 @@ WINSCARDAPI LONG WINAPI PCSC_SCardTransmit(SCARDHANDLE hCard, * pcsc-lite cannot have a null pioSendPci parameter, unlike WinSCard. * Query the current protocol and use default SCARD_IO_REQUEST for it. */ - status = (LONG) g_PCSC.pfnSCardStatus(hCard, NULL, &cchReaderLen, &dwState, &dwProtocol, NULL, - &cbAtrLen); + status = (LONG)g_PCSC.pfnSCardStatus(hCard, NULL, &cchReaderLen, &dwState, &dwProtocol, + NULL, &cbAtrLen); if (status == SCARD_S_SUCCESS) { if (dwProtocol == SCARD_PROTOCOL_T0) - pcsc_pioSendPci = (PCSC_SCARD_IO_REQUEST*) PCSC_SCARD_PCI_T0; + pcsc_pioSendPci = (PCSC_SCARD_IO_REQUEST*)PCSC_SCARD_PCI_T0; else if (dwProtocol == SCARD_PROTOCOL_T1) - pcsc_pioSendPci = (PCSC_SCARD_IO_REQUEST*) PCSC_SCARD_PCI_T1; + pcsc_pioSendPci = (PCSC_SCARD_IO_REQUEST*)PCSC_SCARD_PCI_T1; else if (dwProtocol == PCSC_SCARD_PROTOCOL_RAW) - pcsc_pioSendPci = (PCSC_SCARD_IO_REQUEST*) PCSC_SCARD_PCI_RAW; + pcsc_pioSendPci = (PCSC_SCARD_IO_REQUEST*)PCSC_SCARD_PCI_RAW; } } else { cbExtraBytes = pioSendPci->cbPciLength - sizeof(SCARD_IO_REQUEST); - pcsc_pioSendPci = (PCSC_SCARD_IO_REQUEST*) malloc(sizeof(PCSC_SCARD_IO_REQUEST) + cbExtraBytes); + pcsc_pioSendPci = + (PCSC_SCARD_IO_REQUEST*)malloc(sizeof(PCSC_SCARD_IO_REQUEST) + cbExtraBytes); if (!pcsc_pioSendPci) return SCARD_E_NO_MEMORY; - pcsc_pioSendPci->dwProtocol = (PCSC_DWORD) pioSendPci->dwProtocol; + pcsc_pioSendPci->dwProtocol = (PCSC_DWORD)pioSendPci->dwProtocol; pcsc_pioSendPci->cbPciLength = sizeof(PCSC_SCARD_IO_REQUEST) + cbExtraBytes; - pbExtraBytes = &((BYTE*) pioSendPci)[sizeof(SCARD_IO_REQUEST)]; - pcsc_pbExtraBytes = &((BYTE*) pcsc_pioSendPci)[sizeof(PCSC_SCARD_IO_REQUEST)]; + pbExtraBytes = &((BYTE*)pioSendPci)[sizeof(SCARD_IO_REQUEST)]; + pcsc_pbExtraBytes = &((BYTE*)pcsc_pioSendPci)[sizeof(PCSC_SCARD_IO_REQUEST)]; CopyMemory(pcsc_pbExtraBytes, pbExtraBytes, cbExtraBytes); } if (pioRecvPci) { cbExtraBytes = pioRecvPci->cbPciLength - sizeof(SCARD_IO_REQUEST); - pcsc_pioRecvPci = (PCSC_SCARD_IO_REQUEST*) malloc(sizeof(PCSC_SCARD_IO_REQUEST) + cbExtraBytes); + pcsc_pioRecvPci = + (PCSC_SCARD_IO_REQUEST*)malloc(sizeof(PCSC_SCARD_IO_REQUEST) + cbExtraBytes); if (!pcsc_pioRecvPci) { @@ -1835,28 +1864,30 @@ WINSCARDAPI LONG WINAPI PCSC_SCardTransmit(SCARDHANDLE hCard, return SCARD_E_NO_MEMORY; } - pcsc_pioRecvPci->dwProtocol = (PCSC_DWORD) pioRecvPci->dwProtocol; + pcsc_pioRecvPci->dwProtocol = (PCSC_DWORD)pioRecvPci->dwProtocol; pcsc_pioRecvPci->cbPciLength = sizeof(PCSC_SCARD_IO_REQUEST) + cbExtraBytes; - pbExtraBytes = &((BYTE*) pioRecvPci)[sizeof(SCARD_IO_REQUEST)]; - pcsc_pbExtraBytes = &((BYTE*) pcsc_pioRecvPci)[sizeof(PCSC_SCARD_IO_REQUEST)]; + pbExtraBytes = &((BYTE*)pioRecvPci)[sizeof(SCARD_IO_REQUEST)]; + pcsc_pbExtraBytes = &((BYTE*)pcsc_pioRecvPci)[sizeof(PCSC_SCARD_IO_REQUEST)]; CopyMemory(pcsc_pbExtraBytes, pbExtraBytes, cbExtraBytes); } - status = (LONG) g_PCSC.pfnSCardTransmit(hCard, pcsc_pioSendPci, pbSendBuffer, - pcsc_cbSendLength, pcsc_pioRecvPci, pbRecvBuffer, &pcsc_cbRecvLength); + status = (LONG)g_PCSC.pfnSCardTransmit(hCard, pcsc_pioSendPci, pbSendBuffer, pcsc_cbSendLength, + pcsc_pioRecvPci, pbRecvBuffer, &pcsc_cbRecvLength); status = PCSC_MapErrorCodeToWinSCard(status); - *pcbRecvLength = (DWORD) pcsc_cbRecvLength; + *pcbRecvLength = (DWORD)pcsc_cbRecvLength; if (pioSendPci) - free(pcsc_pioSendPci); /* pcsc_pioSendPci is dynamically allocated only when pioSendPci is non null */ + free(pcsc_pioSendPci); /* pcsc_pioSendPci is dynamically allocated only when pioSendPci is + non null */ if (pioRecvPci) { cbExtraBytes = pioRecvPci->cbPciLength - sizeof(SCARD_IO_REQUEST); - pbExtraBytes = &((BYTE*) pioRecvPci)[sizeof(SCARD_IO_REQUEST)]; - pcsc_pbExtraBytes = &((BYTE*) pcsc_pioRecvPci)[sizeof(PCSC_SCARD_IO_REQUEST)]; + pbExtraBytes = &((BYTE*)pioRecvPci)[sizeof(SCARD_IO_REQUEST)]; + pcsc_pbExtraBytes = &((BYTE*)pcsc_pioRecvPci)[sizeof(PCSC_SCARD_IO_REQUEST)]; CopyMemory(pbExtraBytes, pcsc_pbExtraBytes, cbExtraBytes); /* copy extra bytes */ - free(pcsc_pioRecvPci); /* pcsc_pioRecvPci is dynamically allocated only when pioRecvPci is non null */ + free(pcsc_pioRecvPci); /* pcsc_pioRecvPci is dynamically allocated only when pioRecvPci is + non null */ } return status; @@ -1875,9 +1906,10 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetTransmitCount(SCARDHANDLE hCard, LPDWORD pc return SCARD_S_SUCCESS; } -WINSCARDAPI LONG WINAPI PCSC_SCardControl(SCARDHANDLE hCard, - DWORD dwControlCode, LPCVOID lpInBuffer, DWORD cbInBufferSize, - LPVOID lpOutBuffer, DWORD cbOutBufferSize, LPDWORD lpBytesReturned) +WINSCARDAPI LONG WINAPI PCSC_SCardControl(SCARDHANDLE hCard, DWORD dwControlCode, + LPCVOID lpInBuffer, DWORD cbInBufferSize, + LPVOID lpOutBuffer, DWORD cbOutBufferSize, + LPDWORD lpBytesReturned) { DWORD IoCtlMethod = 0; DWORD IoCtlFunction = 0; @@ -1887,8 +1919,8 @@ WINSCARDAPI LONG WINAPI PCSC_SCardControl(SCARDHANDLE hCard, LONG status = SCARD_S_SUCCESS; PCSC_SCARDHANDLE* pCard = NULL; PCSC_DWORD pcsc_dwControlCode = 0; - PCSC_DWORD pcsc_cbInBufferSize = (PCSC_DWORD) cbInBufferSize; - PCSC_DWORD pcsc_cbOutBufferSize = (PCSC_DWORD) cbOutBufferSize; + PCSC_DWORD pcsc_cbInBufferSize = (PCSC_DWORD)cbInBufferSize; + PCSC_DWORD pcsc_cbOutBufferSize = (PCSC_DWORD)cbOutBufferSize; PCSC_DWORD pcsc_BytesReturned = 0; if (!g_PCSC.pfnSCardControl) @@ -1921,18 +1953,18 @@ WINSCARDAPI LONG WINAPI PCSC_SCardControl(SCARDHANDLE hCard, if (IoCtlDeviceType == FILE_DEVICE_SMARTCARD) dwControlCode = PCSC_SCARD_CTL_CODE(IoCtlFunction); - pcsc_dwControlCode = (PCSC_DWORD) dwControlCode; - status = (LONG) g_PCSC.pfnSCardControl(hCard, - pcsc_dwControlCode, lpInBuffer, pcsc_cbInBufferSize, - lpOutBuffer, pcsc_cbOutBufferSize, &pcsc_BytesReturned); + pcsc_dwControlCode = (PCSC_DWORD)dwControlCode; + status = + (LONG)g_PCSC.pfnSCardControl(hCard, pcsc_dwControlCode, lpInBuffer, pcsc_cbInBufferSize, + lpOutBuffer, pcsc_cbOutBufferSize, &pcsc_BytesReturned); status = PCSC_MapErrorCodeToWinSCard(status); - *lpBytesReturned = (DWORD) pcsc_BytesReturned; + *lpBytesReturned = (DWORD)pcsc_BytesReturned; if (getFeatureRequest) { UINT32 index; UINT32 count; - PCSC_TLV_STRUCTURE* tlv = (PCSC_TLV_STRUCTURE*) lpOutBuffer; + PCSC_TLV_STRUCTURE* tlv = (PCSC_TLV_STRUCTURE*)lpOutBuffer; if ((*lpBytesReturned % sizeof(PCSC_TLV_STRUCTURE)) != 0) return SCARD_E_UNEXPECTED; @@ -1950,14 +1982,14 @@ WINSCARDAPI LONG WINAPI PCSC_SCardControl(SCARDHANDLE hCard, } WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib_Internal(SCARDHANDLE hCard, DWORD dwAttrId, - LPBYTE pbAttr, LPDWORD pcbAttrLen) + LPBYTE pbAttr, LPDWORD pcbAttrLen) { SCARDCONTEXT hContext = 0; BOOL pcbAttrLenAlloc = FALSE; - LPBYTE* pPbAttr = (LPBYTE*) pbAttr; + LPBYTE* pPbAttr = (LPBYTE*)pbAttr; LONG status = SCARD_S_SUCCESS; PCSC_SCARDHANDLE* pCard = NULL; - PCSC_DWORD pcsc_dwAttrId = (PCSC_DWORD) dwAttrId; + PCSC_DWORD pcsc_dwAttrId = (PCSC_DWORD)dwAttrId; PCSC_DWORD pcsc_cbAttrLen = 0; if (!g_PCSC.pfnSCardGetAttrib) @@ -1980,21 +2012,22 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib_Internal(SCARDHANDLE hCard, DWORD dw if (*pcbAttrLen == SCARD_AUTOALLOCATE) pcbAttrLenAlloc = TRUE; - pcsc_cbAttrLen = pcbAttrLenAlloc ? PCSC_SCARD_AUTOALLOCATE : (PCSC_DWORD) * pcbAttrLen; + pcsc_cbAttrLen = pcbAttrLenAlloc ? PCSC_SCARD_AUTOALLOCATE : (PCSC_DWORD)*pcbAttrLen; if (pcbAttrLenAlloc && !g_SCardAutoAllocate) { pcsc_cbAttrLen = 0; - status = (LONG) g_PCSC.pfnSCardGetAttrib(hCard, pcsc_dwAttrId, NULL, &pcsc_cbAttrLen); + status = (LONG)g_PCSC.pfnSCardGetAttrib(hCard, pcsc_dwAttrId, NULL, &pcsc_cbAttrLen); if (status == SCARD_S_SUCCESS) { - *pPbAttr = (BYTE*) calloc(1, pcsc_cbAttrLen); + *pPbAttr = (BYTE*)calloc(1, pcsc_cbAttrLen); if (!*pPbAttr) return SCARD_E_NO_MEMORY; - status = (LONG) g_PCSC.pfnSCardGetAttrib(hCard, pcsc_dwAttrId, *pPbAttr, &pcsc_cbAttrLen); + status = + (LONG)g_PCSC.pfnSCardGetAttrib(hCard, pcsc_dwAttrId, *pPbAttr, &pcsc_cbAttrLen); if (status != SCARD_S_SUCCESS) free(*pPbAttr); @@ -2004,19 +2037,19 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib_Internal(SCARDHANDLE hCard, DWORD dw } else { - status = (LONG) g_PCSC.pfnSCardGetAttrib(hCard, pcsc_dwAttrId, pbAttr, &pcsc_cbAttrLen); + status = (LONG)g_PCSC.pfnSCardGetAttrib(hCard, pcsc_dwAttrId, pbAttr, &pcsc_cbAttrLen); } status = PCSC_MapErrorCodeToWinSCard(status); if (status == SCARD_S_SUCCESS) - *pcbAttrLen = (DWORD) pcsc_cbAttrLen; + *pcbAttrLen = (DWORD)pcsc_cbAttrLen; return status; } WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib_FriendlyName(SCARDHANDLE hCard, DWORD dwAttrId, - LPBYTE pbAttr, LPDWORD pcbAttrLen) + LPBYTE pbAttr, LPDWORD pcbAttrLen) { size_t length = 0; char* namePCSC = NULL; @@ -2027,7 +2060,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib_FriendlyName(SCARDHANDLE hCard, DWOR char* friendlyNameA = NULL; WCHAR* friendlyNameW = NULL; LONG status = SCARD_S_SUCCESS; - LPBYTE* pPbAttr = (LPBYTE*) pbAttr; + LPBYTE* pPbAttr = (LPBYTE*)pbAttr; hContext = PCSC_GetCardContextFromHandle(hCard); if (!hContext) @@ -2035,20 +2068,20 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib_FriendlyName(SCARDHANDLE hCard, DWOR cbAttrLen = *pcbAttrLen; *pcbAttrLen = SCARD_AUTOALLOCATE; - status = PCSC_SCardGetAttrib_Internal(hCard, SCARD_ATTR_DEVICE_FRIENDLY_NAME_A, (LPBYTE) &pbAttrA, - pcbAttrLen); + status = PCSC_SCardGetAttrib_Internal(hCard, SCARD_ATTR_DEVICE_FRIENDLY_NAME_A, + (LPBYTE)&pbAttrA, pcbAttrLen); if (status != SCARD_S_SUCCESS) { pbAttrA = NULL; *pcbAttrLen = SCARD_AUTOALLOCATE; - status = PCSC_SCardGetAttrib_Internal(hCard, SCARD_ATTR_DEVICE_FRIENDLY_NAME_W, (LPBYTE) &pbAttrW, - pcbAttrLen); + status = PCSC_SCardGetAttrib_Internal(hCard, SCARD_ATTR_DEVICE_FRIENDLY_NAME_W, + (LPBYTE)&pbAttrW, pcbAttrLen); if (status != SCARD_S_SUCCESS) return status; - ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) pbAttrW, *pcbAttrLen, (char**) &pbAttrA, 0, NULL, + ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)pbAttrW, *pcbAttrLen, (char**)&pbAttrA, 0, NULL, NULL); namePCSC = pbAttrA; PCSC_SCardFreeMemory_Internal(hContext, pbAttrW); @@ -2070,7 +2103,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib_FriendlyName(SCARDHANDLE hCard, DWOR if (dwAttrId == SCARD_ATTR_DEVICE_FRIENDLY_NAME_W) { /* length here includes null terminator */ - length = ConvertToUnicode(CP_UTF8, 0, (char*) friendlyNameA, -1, &friendlyNameW, 0); + length = ConvertToUnicode(CP_UTF8, 0, (char*)friendlyNameA, -1, &friendlyNameW, 0); free(friendlyNameA); if (!friendlyNameW) @@ -2081,7 +2114,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib_FriendlyName(SCARDHANDLE hCard, DWOR if (cbAttrLen == SCARD_AUTOALLOCATE) { - *pPbAttr = (BYTE*) friendlyNameW; + *pPbAttr = (BYTE*)friendlyNameW; *pcbAttrLen = length * 2; PCSC_AddMemoryBlock(hContext, *pPbAttr); } @@ -2095,7 +2128,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib_FriendlyName(SCARDHANDLE hCard, DWOR } else { - CopyMemory(pbAttr, (BYTE*) friendlyNameW, (length * 2)); + CopyMemory(pbAttr, (BYTE*)friendlyNameW, (length * 2)); *pcbAttrLen = length * 2; free(friendlyNameW); } @@ -2105,7 +2138,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib_FriendlyName(SCARDHANDLE hCard, DWOR { if (cbAttrLen == SCARD_AUTOALLOCATE) { - *pPbAttr = (BYTE*) friendlyNameA; + *pPbAttr = (BYTE*)friendlyNameA; *pcbAttrLen = length; PCSC_AddMemoryBlock(hContext, *pPbAttr); } @@ -2119,7 +2152,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib_FriendlyName(SCARDHANDLE hCard, DWOR } else { - CopyMemory(pbAttr, (BYTE*) friendlyNameA, length + 1); + CopyMemory(pbAttr, (BYTE*)friendlyNameA, length + 1); *pcbAttrLen = length; free(friendlyNameA); } @@ -2131,13 +2164,13 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib_FriendlyName(SCARDHANDLE hCard, DWOR } WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, - LPDWORD pcbAttrLen) + LPDWORD pcbAttrLen) { DWORD cbAttrLen; SCARDCONTEXT hContext; BOOL pcbAttrLenAlloc = FALSE; LONG status = SCARD_S_SUCCESS; - LPBYTE* pPbAttr = (LPBYTE*) pbAttr; + LPBYTE* pPbAttr = (LPBYTE*)pbAttr; cbAttrLen = *pcbAttrLen; if (*pcbAttrLen == SCARD_AUTOALLOCATE) @@ -2181,9 +2214,9 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, L */ if (pcbAttrLenAlloc) - vendorName = (char*) *pPbAttr; + vendorName = (char*)*pPbAttr; else - vendorName = (char*) pbAttr; + vendorName = (char*)pbAttr; if (vendorName) *pcbAttrLen = strlen(vendorName); @@ -2201,12 +2234,12 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, L PCSC_DWORD cbAtrLen = 0; PCSC_DWORD dwProtocol = 0; PCSC_DWORD cchReaderLen = 0; - status = (LONG) g_PCSC.pfnSCardStatus(hCard, NULL, &cchReaderLen, &dwState, &dwProtocol, NULL, - &cbAtrLen); + status = (LONG)g_PCSC.pfnSCardStatus(hCard, NULL, &cchReaderLen, &dwState, + &dwProtocol, NULL, &cbAtrLen); if (status == SCARD_S_SUCCESS) { - LPDWORD pdwProtocol = (LPDWORD) pbAttr; + LPDWORD pdwProtocol = (LPDWORD)pbAttr; if (cbAttrLen < sizeof(DWORD)) return SCARD_E_INSUFFICIENT_BUFFER; @@ -2227,7 +2260,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, L return SCARD_E_INSUFFICIENT_BUFFER; status = SCARD_S_SUCCESS; - *((DWORD*) pbAttr) = (channelType << 16) | channelNumber; + *((DWORD*)pbAttr) = (channelType << 16) | channelNumber; *pcbAttrLen = sizeof(DWORD); } } @@ -2297,12 +2330,12 @@ WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, L } WINSCARDAPI LONG WINAPI PCSC_SCardSetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr, - DWORD cbAttrLen) + DWORD cbAttrLen) { LONG status = SCARD_S_SUCCESS; PCSC_SCARDHANDLE* pCard = NULL; - PCSC_DWORD pcsc_dwAttrId = (PCSC_DWORD) dwAttrId; - PCSC_DWORD pcsc_cbAttrLen = (PCSC_DWORD) cbAttrLen; + PCSC_DWORD pcsc_dwAttrId = (PCSC_DWORD)dwAttrId; + PCSC_DWORD pcsc_cbAttrLen = (PCSC_DWORD)cbAttrLen; if (!g_PCSC.pfnSCardSetAttrib) return SCARD_E_NO_SERVICE; @@ -2313,7 +2346,7 @@ WINSCARDAPI LONG WINAPI PCSC_SCardSetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, L return SCARD_E_INVALID_VALUE; PCSC_WaitForCardAccess(0, hCard, pCard->shared); - status = (LONG) g_PCSC.pfnSCardSetAttrib(hCard, pcsc_dwAttrId, pbAttr, pcsc_cbAttrLen); + status = (LONG)g_PCSC.pfnSCardSetAttrib(hCard, pcsc_dwAttrId, pbAttr, pcsc_cbAttrLen); status = PCSC_MapErrorCodeToWinSCard(status); return status; } @@ -2343,74 +2376,86 @@ WINSCARDAPI LONG WINAPI PCSC_SCardDlgExtendedError(void) return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardReadCacheA(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, DWORD* DataLen) +WINSCARDAPI LONG WINAPI PCSC_SCardReadCacheA(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, + DWORD* DataLen) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardReadCacheW(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD* DataLen) +WINSCARDAPI LONG WINAPI PCSC_SCardReadCacheW(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, + DWORD* DataLen) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardWriteCacheA(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, DWORD DataLen) +WINSCARDAPI LONG WINAPI PCSC_SCardWriteCacheA(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, + DWORD DataLen) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardWriteCacheW(SCARDCONTEXT hContext, - UUID* CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD DataLen) +WINSCARDAPI LONG WINAPI PCSC_SCardWriteCacheW(SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, + DWORD DataLen) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardGetReaderIconA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon) +WINSCARDAPI LONG WINAPI PCSC_SCardGetReaderIconA(SCARDCONTEXT hContext, LPCSTR szReaderName, + LPBYTE pbIcon, LPDWORD pcbIcon) { return 0; } -WINSCARDAPI LONG WINAPI PCSC_SCardGetReaderIconW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon) +WINSCARDAPI LONG WINAPI PCSC_SCardGetReaderIconW(SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPBYTE pbIcon, LPDWORD pcbIcon) { return 0; } WINSCARDAPI LONG WINAPI PCSC_SCardGetDeviceTypeIdA(SCARDCONTEXT hContext, LPCSTR szReaderName, - LPDWORD pdwDeviceTypeId) + LPDWORD pdwDeviceTypeId) { return 0; } WINSCARDAPI LONG WINAPI PCSC_SCardGetDeviceTypeIdW(SCARDCONTEXT hContext, LPCWSTR szReaderName, - LPDWORD pdwDeviceTypeId) + LPDWORD pdwDeviceTypeId) { return 0; } WINSCARDAPI LONG WINAPI PCSC_SCardGetReaderDeviceInstanceIdA(SCARDCONTEXT hContext, - LPCSTR szReaderName, LPSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId) + LPCSTR szReaderName, + LPSTR szDeviceInstanceId, + LPDWORD pcchDeviceInstanceId) { return 0; } WINSCARDAPI LONG WINAPI PCSC_SCardGetReaderDeviceInstanceIdW(SCARDCONTEXT hContext, - LPCWSTR szReaderName, LPWSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId) + LPCWSTR szReaderName, + LPWSTR szDeviceInstanceId, + LPDWORD pcchDeviceInstanceId) { return 0; } WINSCARDAPI LONG WINAPI PCSC_SCardListReadersWithDeviceInstanceIdA(SCARDCONTEXT hContext, - LPCSTR szDeviceInstanceId, LPSTR mszReaders, LPDWORD pcchReaders) + LPCSTR szDeviceInstanceId, + LPSTR mszReaders, + LPDWORD pcchReaders) { return 0; } WINSCARDAPI LONG WINAPI PCSC_SCardListReadersWithDeviceInstanceIdW(SCARDCONTEXT hContext, - LPCWSTR szDeviceInstanceId, LPWSTR mszReaders, LPDWORD pcchReaders) + LPCWSTR szDeviceInstanceId, + LPWSTR mszReaders, + LPDWORD pcchReaders) { return 0; } @@ -2549,87 +2594,86 @@ fail: } #endif -SCardApiFunctionTable PCSC_SCardApiFunctionTable = -{ +SCardApiFunctionTable PCSC_SCardApiFunctionTable = { 0, /* dwVersion */ 0, /* dwFlags */ - PCSC_SCardEstablishContext, /* SCardEstablishContext */ - PCSC_SCardReleaseContext, /* SCardReleaseContext */ - PCSC_SCardIsValidContext, /* SCardIsValidContext */ - PCSC_SCardListReaderGroupsA, /* SCardListReaderGroupsA */ - PCSC_SCardListReaderGroupsW, /* SCardListReaderGroupsW */ - PCSC_SCardListReadersA, /* SCardListReadersA */ - PCSC_SCardListReadersW, /* SCardListReadersW */ - PCSC_SCardListCardsA, /* SCardListCardsA */ - PCSC_SCardListCardsW, /* SCardListCardsW */ - PCSC_SCardListInterfacesA, /* SCardListInterfacesA */ - PCSC_SCardListInterfacesW, /* SCardListInterfacesW */ - PCSC_SCardGetProviderIdA, /* SCardGetProviderIdA */ - PCSC_SCardGetProviderIdW, /* SCardGetProviderIdW */ - PCSC_SCardGetCardTypeProviderNameA, /* SCardGetCardTypeProviderNameA */ - PCSC_SCardGetCardTypeProviderNameW, /* SCardGetCardTypeProviderNameW */ - PCSC_SCardIntroduceReaderGroupA, /* SCardIntroduceReaderGroupA */ - PCSC_SCardIntroduceReaderGroupW, /* SCardIntroduceReaderGroupW */ - PCSC_SCardForgetReaderGroupA, /* SCardForgetReaderGroupA */ - PCSC_SCardForgetReaderGroupW, /* SCardForgetReaderGroupW */ - PCSC_SCardIntroduceReaderA, /* SCardIntroduceReaderA */ - PCSC_SCardIntroduceReaderW, /* SCardIntroduceReaderW */ - PCSC_SCardForgetReaderA, /* SCardForgetReaderA */ - PCSC_SCardForgetReaderW, /* SCardForgetReaderW */ - PCSC_SCardAddReaderToGroupA, /* SCardAddReaderToGroupA */ - PCSC_SCardAddReaderToGroupW, /* SCardAddReaderToGroupW */ - PCSC_SCardRemoveReaderFromGroupA, /* SCardRemoveReaderFromGroupA */ - PCSC_SCardRemoveReaderFromGroupW, /* SCardRemoveReaderFromGroupW */ - PCSC_SCardIntroduceCardTypeA, /* SCardIntroduceCardTypeA */ - PCSC_SCardIntroduceCardTypeW, /* SCardIntroduceCardTypeW */ - PCSC_SCardSetCardTypeProviderNameA, /* SCardSetCardTypeProviderNameA */ - PCSC_SCardSetCardTypeProviderNameW, /* SCardSetCardTypeProviderNameW */ - PCSC_SCardForgetCardTypeA, /* SCardForgetCardTypeA */ - PCSC_SCardForgetCardTypeW, /* SCardForgetCardTypeW */ - PCSC_SCardFreeMemory, /* SCardFreeMemory */ - PCSC_SCardAccessStartedEvent, /* SCardAccessStartedEvent */ - PCSC_SCardReleaseStartedEvent, /* SCardReleaseStartedEvent */ - PCSC_SCardLocateCardsA, /* SCardLocateCardsA */ - PCSC_SCardLocateCardsW, /* SCardLocateCardsW */ - PCSC_SCardLocateCardsByATRA, /* SCardLocateCardsByATRA */ - PCSC_SCardLocateCardsByATRW, /* SCardLocateCardsByATRW */ - PCSC_SCardGetStatusChangeA, /* SCardGetStatusChangeA */ - PCSC_SCardGetStatusChangeW, /* SCardGetStatusChangeW */ - PCSC_SCardCancel, /* SCardCancel */ - PCSC_SCardConnectA, /* SCardConnectA */ - PCSC_SCardConnectW, /* SCardConnectW */ - PCSC_SCardReconnect, /* SCardReconnect */ - PCSC_SCardDisconnect, /* SCardDisconnect */ - PCSC_SCardBeginTransaction, /* SCardBeginTransaction */ - PCSC_SCardEndTransaction, /* SCardEndTransaction */ - PCSC_SCardCancelTransaction, /* SCardCancelTransaction */ - PCSC_SCardState, /* SCardState */ - PCSC_SCardStatusA, /* SCardStatusA */ - PCSC_SCardStatusW, /* SCardStatusW */ - PCSC_SCardTransmit, /* SCardTransmit */ - PCSC_SCardGetTransmitCount, /* SCardGetTransmitCount */ - PCSC_SCardControl, /* SCardControl */ - PCSC_SCardGetAttrib, /* SCardGetAttrib */ - PCSC_SCardSetAttrib, /* SCardSetAttrib */ - PCSC_SCardUIDlgSelectCardA, /* SCardUIDlgSelectCardA */ - PCSC_SCardUIDlgSelectCardW, /* SCardUIDlgSelectCardW */ - PCSC_GetOpenCardNameA, /* GetOpenCardNameA */ - PCSC_GetOpenCardNameW, /* GetOpenCardNameW */ - PCSC_SCardDlgExtendedError, /* SCardDlgExtendedError */ - PCSC_SCardReadCacheA, /* SCardReadCacheA */ - PCSC_SCardReadCacheW, /* SCardReadCacheW */ - PCSC_SCardWriteCacheA, /* SCardWriteCacheA */ - PCSC_SCardWriteCacheW, /* SCardWriteCacheW */ - PCSC_SCardGetReaderIconA, /* SCardGetReaderIconA */ - PCSC_SCardGetReaderIconW, /* SCardGetReaderIconW */ - PCSC_SCardGetDeviceTypeIdA, /* SCardGetDeviceTypeIdA */ - PCSC_SCardGetDeviceTypeIdW, /* SCardGetDeviceTypeIdW */ - PCSC_SCardGetReaderDeviceInstanceIdA, /* SCardGetReaderDeviceInstanceIdA */ - PCSC_SCardGetReaderDeviceInstanceIdW, /* SCardGetReaderDeviceInstanceIdW */ + PCSC_SCardEstablishContext, /* SCardEstablishContext */ + PCSC_SCardReleaseContext, /* SCardReleaseContext */ + PCSC_SCardIsValidContext, /* SCardIsValidContext */ + PCSC_SCardListReaderGroupsA, /* SCardListReaderGroupsA */ + PCSC_SCardListReaderGroupsW, /* SCardListReaderGroupsW */ + PCSC_SCardListReadersA, /* SCardListReadersA */ + PCSC_SCardListReadersW, /* SCardListReadersW */ + PCSC_SCardListCardsA, /* SCardListCardsA */ + PCSC_SCardListCardsW, /* SCardListCardsW */ + PCSC_SCardListInterfacesA, /* SCardListInterfacesA */ + PCSC_SCardListInterfacesW, /* SCardListInterfacesW */ + PCSC_SCardGetProviderIdA, /* SCardGetProviderIdA */ + PCSC_SCardGetProviderIdW, /* SCardGetProviderIdW */ + PCSC_SCardGetCardTypeProviderNameA, /* SCardGetCardTypeProviderNameA */ + PCSC_SCardGetCardTypeProviderNameW, /* SCardGetCardTypeProviderNameW */ + PCSC_SCardIntroduceReaderGroupA, /* SCardIntroduceReaderGroupA */ + PCSC_SCardIntroduceReaderGroupW, /* SCardIntroduceReaderGroupW */ + PCSC_SCardForgetReaderGroupA, /* SCardForgetReaderGroupA */ + PCSC_SCardForgetReaderGroupW, /* SCardForgetReaderGroupW */ + PCSC_SCardIntroduceReaderA, /* SCardIntroduceReaderA */ + PCSC_SCardIntroduceReaderW, /* SCardIntroduceReaderW */ + PCSC_SCardForgetReaderA, /* SCardForgetReaderA */ + PCSC_SCardForgetReaderW, /* SCardForgetReaderW */ + PCSC_SCardAddReaderToGroupA, /* SCardAddReaderToGroupA */ + PCSC_SCardAddReaderToGroupW, /* SCardAddReaderToGroupW */ + PCSC_SCardRemoveReaderFromGroupA, /* SCardRemoveReaderFromGroupA */ + PCSC_SCardRemoveReaderFromGroupW, /* SCardRemoveReaderFromGroupW */ + PCSC_SCardIntroduceCardTypeA, /* SCardIntroduceCardTypeA */ + PCSC_SCardIntroduceCardTypeW, /* SCardIntroduceCardTypeW */ + PCSC_SCardSetCardTypeProviderNameA, /* SCardSetCardTypeProviderNameA */ + PCSC_SCardSetCardTypeProviderNameW, /* SCardSetCardTypeProviderNameW */ + PCSC_SCardForgetCardTypeA, /* SCardForgetCardTypeA */ + PCSC_SCardForgetCardTypeW, /* SCardForgetCardTypeW */ + PCSC_SCardFreeMemory, /* SCardFreeMemory */ + PCSC_SCardAccessStartedEvent, /* SCardAccessStartedEvent */ + PCSC_SCardReleaseStartedEvent, /* SCardReleaseStartedEvent */ + PCSC_SCardLocateCardsA, /* SCardLocateCardsA */ + PCSC_SCardLocateCardsW, /* SCardLocateCardsW */ + PCSC_SCardLocateCardsByATRA, /* SCardLocateCardsByATRA */ + PCSC_SCardLocateCardsByATRW, /* SCardLocateCardsByATRW */ + PCSC_SCardGetStatusChangeA, /* SCardGetStatusChangeA */ + PCSC_SCardGetStatusChangeW, /* SCardGetStatusChangeW */ + PCSC_SCardCancel, /* SCardCancel */ + PCSC_SCardConnectA, /* SCardConnectA */ + PCSC_SCardConnectW, /* SCardConnectW */ + PCSC_SCardReconnect, /* SCardReconnect */ + PCSC_SCardDisconnect, /* SCardDisconnect */ + PCSC_SCardBeginTransaction, /* SCardBeginTransaction */ + PCSC_SCardEndTransaction, /* SCardEndTransaction */ + PCSC_SCardCancelTransaction, /* SCardCancelTransaction */ + PCSC_SCardState, /* SCardState */ + PCSC_SCardStatusA, /* SCardStatusA */ + PCSC_SCardStatusW, /* SCardStatusW */ + PCSC_SCardTransmit, /* SCardTransmit */ + PCSC_SCardGetTransmitCount, /* SCardGetTransmitCount */ + PCSC_SCardControl, /* SCardControl */ + PCSC_SCardGetAttrib, /* SCardGetAttrib */ + PCSC_SCardSetAttrib, /* SCardSetAttrib */ + PCSC_SCardUIDlgSelectCardA, /* SCardUIDlgSelectCardA */ + PCSC_SCardUIDlgSelectCardW, /* SCardUIDlgSelectCardW */ + PCSC_GetOpenCardNameA, /* GetOpenCardNameA */ + PCSC_GetOpenCardNameW, /* GetOpenCardNameW */ + PCSC_SCardDlgExtendedError, /* SCardDlgExtendedError */ + PCSC_SCardReadCacheA, /* SCardReadCacheA */ + PCSC_SCardReadCacheW, /* SCardReadCacheW */ + PCSC_SCardWriteCacheA, /* SCardWriteCacheA */ + PCSC_SCardWriteCacheW, /* SCardWriteCacheW */ + PCSC_SCardGetReaderIconA, /* SCardGetReaderIconA */ + PCSC_SCardGetReaderIconW, /* SCardGetReaderIconW */ + PCSC_SCardGetDeviceTypeIdA, /* SCardGetDeviceTypeIdA */ + PCSC_SCardGetDeviceTypeIdW, /* SCardGetDeviceTypeIdW */ + PCSC_SCardGetReaderDeviceInstanceIdA, /* SCardGetReaderDeviceInstanceIdA */ + PCSC_SCardGetReaderDeviceInstanceIdW, /* SCardGetReaderDeviceInstanceIdW */ PCSC_SCardListReadersWithDeviceInstanceIdA, /* SCardListReadersWithDeviceInstanceIdA */ PCSC_SCardListReadersWithDeviceInstanceIdW, /* SCardListReadersWithDeviceInstanceIdW */ - PCSC_SCardAudit /* SCardAudit */ + PCSC_SCardAudit /* SCardAudit */ }; PSCardApiFunctionTable PCSC_GetSCardApiFunctionTable(void) @@ -2659,35 +2703,35 @@ int PCSC_InitializeSCardApi(void) if (!g_PCSCModule) return -1; - g_PCSC.pfnSCardEstablishContext = (void*) GetProcAddress(g_PCSCModule, "SCardEstablishContext"); - g_PCSC.pfnSCardReleaseContext = (void*) GetProcAddress(g_PCSCModule, "SCardReleaseContext"); - g_PCSC.pfnSCardIsValidContext = (void*) GetProcAddress(g_PCSCModule, "SCardIsValidContext"); - g_PCSC.pfnSCardConnect = (void*) GetProcAddress(g_PCSCModule, "SCardConnect"); - g_PCSC.pfnSCardReconnect = (void*) GetProcAddress(g_PCSCModule, "SCardReconnect"); - g_PCSC.pfnSCardDisconnect = (void*) GetProcAddress(g_PCSCModule, "SCardDisconnect"); - g_PCSC.pfnSCardBeginTransaction = (void*) GetProcAddress(g_PCSCModule, "SCardBeginTransaction"); - g_PCSC.pfnSCardEndTransaction = (void*) GetProcAddress(g_PCSCModule, "SCardEndTransaction"); - g_PCSC.pfnSCardStatus = (void*) GetProcAddress(g_PCSCModule, "SCardStatus"); - g_PCSC.pfnSCardGetStatusChange = (void*) GetProcAddress(g_PCSCModule, "SCardGetStatusChange"); + g_PCSC.pfnSCardEstablishContext = (void*)GetProcAddress(g_PCSCModule, "SCardEstablishContext"); + g_PCSC.pfnSCardReleaseContext = (void*)GetProcAddress(g_PCSCModule, "SCardReleaseContext"); + g_PCSC.pfnSCardIsValidContext = (void*)GetProcAddress(g_PCSCModule, "SCardIsValidContext"); + g_PCSC.pfnSCardConnect = (void*)GetProcAddress(g_PCSCModule, "SCardConnect"); + g_PCSC.pfnSCardReconnect = (void*)GetProcAddress(g_PCSCModule, "SCardReconnect"); + g_PCSC.pfnSCardDisconnect = (void*)GetProcAddress(g_PCSCModule, "SCardDisconnect"); + g_PCSC.pfnSCardBeginTransaction = (void*)GetProcAddress(g_PCSCModule, "SCardBeginTransaction"); + g_PCSC.pfnSCardEndTransaction = (void*)GetProcAddress(g_PCSCModule, "SCardEndTransaction"); + g_PCSC.pfnSCardStatus = (void*)GetProcAddress(g_PCSCModule, "SCardStatus"); + g_PCSC.pfnSCardGetStatusChange = (void*)GetProcAddress(g_PCSCModule, "SCardGetStatusChange"); #ifdef __MACOSX__ if (OSXVersion >= 0x10050600) - g_PCSC.pfnSCardControl = (void*) GetProcAddress(g_PCSCModule, "SCardControl132"); + g_PCSC.pfnSCardControl = (void*)GetProcAddress(g_PCSCModule, "SCardControl132"); else - g_PCSC.pfnSCardControl = (void*) GetProcAddress(g_PCSCModule, "SCardControl"); + g_PCSC.pfnSCardControl = (void*)GetProcAddress(g_PCSCModule, "SCardControl"); #else - g_PCSC.pfnSCardControl = (void*) GetProcAddress(g_PCSCModule, "SCardControl"); + g_PCSC.pfnSCardControl = (void*)GetProcAddress(g_PCSCModule, "SCardControl"); #endif - g_PCSC.pfnSCardTransmit = (void*) GetProcAddress(g_PCSCModule, "SCardTransmit"); - g_PCSC.pfnSCardListReaderGroups = (void*) GetProcAddress(g_PCSCModule, "SCardListReaderGroups"); - g_PCSC.pfnSCardListReaders = (void*) GetProcAddress(g_PCSCModule, "SCardListReaders"); - g_PCSC.pfnSCardCancel = (void*) GetProcAddress(g_PCSCModule, "SCardCancel"); - g_PCSC.pfnSCardGetAttrib = (void*) GetProcAddress(g_PCSCModule, "SCardGetAttrib"); - g_PCSC.pfnSCardSetAttrib = (void*) GetProcAddress(g_PCSCModule, "SCardSetAttrib"); + g_PCSC.pfnSCardTransmit = (void*)GetProcAddress(g_PCSCModule, "SCardTransmit"); + g_PCSC.pfnSCardListReaderGroups = (void*)GetProcAddress(g_PCSCModule, "SCardListReaderGroups"); + g_PCSC.pfnSCardListReaders = (void*)GetProcAddress(g_PCSCModule, "SCardListReaders"); + g_PCSC.pfnSCardCancel = (void*)GetProcAddress(g_PCSCModule, "SCardCancel"); + g_PCSC.pfnSCardGetAttrib = (void*)GetProcAddress(g_PCSCModule, "SCardGetAttrib"); + g_PCSC.pfnSCardSetAttrib = (void*)GetProcAddress(g_PCSCModule, "SCardSetAttrib"); g_PCSC.pfnSCardFreeMemory = NULL; #ifndef __APPLE__ - g_PCSC.pfnSCardFreeMemory = (void*) GetProcAddress(g_PCSCModule, "SCardFreeMemory"); + g_PCSC.pfnSCardFreeMemory = (void*)GetProcAddress(g_PCSCModule, "SCardFreeMemory"); #endif if (g_PCSC.pfnSCardFreeMemory) @@ -2703,5 +2747,4 @@ int PCSC_InitializeSCardApi(void) return 1; } - #endif diff --git a/winpr/libwinpr/smartcard/smartcard_pcsc.h b/winpr/libwinpr/smartcard/smartcard_pcsc.h index 1d85d2567..55df1cb23 100644 --- a/winpr/libwinpr/smartcard/smartcard_pcsc.h +++ b/winpr/libwinpr/smartcard/smartcard_pcsc.h @@ -41,42 +41,42 @@ #ifdef __APPLE__ typedef unsigned int PCSC_DWORD; -typedef PCSC_DWORD* PCSC_PDWORD, *PCSC_LPDWORD; +typedef PCSC_DWORD *PCSC_PDWORD, *PCSC_LPDWORD; typedef unsigned int PCSC_ULONG; typedef PCSC_ULONG* PCSC_PULONG; typedef int PCSC_LONG; #else typedef unsigned long PCSC_DWORD; -typedef PCSC_DWORD* PCSC_PDWORD, *PCSC_LPDWORD; +typedef PCSC_DWORD *PCSC_PDWORD, *PCSC_LPDWORD; typedef unsigned long PCSC_ULONG; typedef PCSC_ULONG* PCSC_PULONG; typedef long PCSC_LONG; #endif -#define PCSC_SCARD_UNKNOWN 0x0001 -#define PCSC_SCARD_ABSENT 0x0002 -#define PCSC_SCARD_PRESENT 0x0004 -#define PCSC_SCARD_SWALLOWED 0x0008 -#define PCSC_SCARD_POWERED 0x0010 -#define PCSC_SCARD_NEGOTIABLE 0x0020 -#define PCSC_SCARD_SPECIFIC 0x0040 +#define PCSC_SCARD_UNKNOWN 0x0001 +#define PCSC_SCARD_ABSENT 0x0002 +#define PCSC_SCARD_PRESENT 0x0004 +#define PCSC_SCARD_SWALLOWED 0x0008 +#define PCSC_SCARD_POWERED 0x0010 +#define PCSC_SCARD_NEGOTIABLE 0x0020 +#define PCSC_SCARD_SPECIFIC 0x0040 -#define PCSC_SCARD_PROTOCOL_RAW 0x00000004 -#define PCSC_SCARD_PROTOCOL_T15 0x00000008 +#define PCSC_SCARD_PROTOCOL_RAW 0x00000004 +#define PCSC_SCARD_PROTOCOL_T15 0x00000008 -#define PCSC_MAX_BUFFER_SIZE 264 -#define PCSC_MAX_BUFFER_SIZE_EXTENDED (4 + 3 + (1 << 16) + 3 + 2) +#define PCSC_MAX_BUFFER_SIZE 264 +#define PCSC_MAX_BUFFER_SIZE_EXTENDED (4 + 3 + (1 << 16) + 3 + 2) -#define PCSC_MAX_ATR_SIZE 33 +#define PCSC_MAX_ATR_SIZE 33 -#define PCSC_SCARD_AUTOALLOCATE (PCSC_DWORD)(-1) +#define PCSC_SCARD_AUTOALLOCATE (PCSC_DWORD)(-1) -#define PCSC_SCARD_PCI_T0 (&g_PCSC_rgSCardT0Pci) -#define PCSC_SCARD_PCI_T1 (&g_PCSC_rgSCardT1Pci) -#define PCSC_SCARD_PCI_RAW (&g_PCSC_rgSCardRawPci) +#define PCSC_SCARD_PCI_T0 (&g_PCSC_rgSCardT0Pci) +#define PCSC_SCARD_PCI_T1 (&g_PCSC_rgSCardT1Pci) +#define PCSC_SCARD_PCI_RAW (&g_PCSC_rgSCardRawPci) -#define PCSC_SCARD_CTL_CODE(code) (0x42000000 + (code)) -#define PCSC_CM_IOCTL_GET_FEATURE_REQUEST PCSC_SCARD_CTL_CODE(3400) +#define PCSC_SCARD_CTL_CODE(code) (0x42000000 + (code)) +#define PCSC_CM_IOCTL_GET_FEATURE_REQUEST PCSC_SCARD_CTL_CODE(3400) /** * pcsc-lite defines SCARD_READERSTATE, SCARD_IO_REQUEST as packed @@ -95,8 +95,7 @@ typedef struct PCSC_DWORD dwEventState; PCSC_DWORD cbAtr; BYTE rgbAtr[PCSC_MAX_ATR_SIZE]; /* WinSCard: 36, PCSC: 33 */ -} -PCSC_SCARD_READERSTATE; +} PCSC_SCARD_READERSTATE; typedef struct { @@ -121,40 +120,42 @@ typedef struct struct _PCSCFunctionTable { - PCSC_LONG(* pfnSCardEstablishContext)(PCSC_DWORD dwScope, - LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext); - PCSC_LONG(* pfnSCardReleaseContext)(SCARDCONTEXT hContext); - PCSC_LONG(* pfnSCardIsValidContext)(SCARDCONTEXT hContext); - PCSC_LONG(* pfnSCardConnect)(SCARDCONTEXT hContext, - LPCSTR szReader, PCSC_DWORD dwShareMode, PCSC_DWORD dwPreferredProtocols, - LPSCARDHANDLE phCard, PCSC_LPDWORD pdwActiveProtocol); - PCSC_LONG(* pfnSCardReconnect)(SCARDHANDLE hCard, - PCSC_DWORD dwShareMode, PCSC_DWORD dwPreferredProtocols, - PCSC_DWORD dwInitialization, PCSC_LPDWORD pdwActiveProtocol); - PCSC_LONG(* pfnSCardDisconnect)(SCARDHANDLE hCard, PCSC_DWORD dwDisposition); - PCSC_LONG(* pfnSCardBeginTransaction)(SCARDHANDLE hCard); - PCSC_LONG(* pfnSCardEndTransaction)(SCARDHANDLE hCard, PCSC_DWORD dwDisposition); - PCSC_LONG(* pfnSCardStatus)(SCARDHANDLE hCard, - LPSTR mszReaderName, PCSC_LPDWORD pcchReaderLen, PCSC_LPDWORD pdwState, - PCSC_LPDWORD pdwProtocol, LPBYTE pbAtr, PCSC_LPDWORD pcbAtrLen); - PCSC_LONG(* pfnSCardGetStatusChange)(SCARDCONTEXT hContext, - PCSC_DWORD dwTimeout, PCSC_SCARD_READERSTATE* rgReaderStates, PCSC_DWORD cReaders); - PCSC_LONG(* pfnSCardControl)(SCARDHANDLE hCard, - PCSC_DWORD dwControlCode, LPCVOID pbSendBuffer, PCSC_DWORD cbSendLength, - LPVOID pbRecvBuffer, PCSC_DWORD cbRecvLength, PCSC_LPDWORD lpBytesReturned); - PCSC_LONG(* pfnSCardTransmit)(SCARDHANDLE hCard, - const PCSC_SCARD_IO_REQUEST* pioSendPci, LPCBYTE pbSendBuffer, PCSC_DWORD cbSendLength, - PCSC_SCARD_IO_REQUEST* pioRecvPci, LPBYTE pbRecvBuffer, PCSC_LPDWORD pcbRecvLength); - PCSC_LONG(* pfnSCardListReaderGroups)(SCARDCONTEXT hContext, LPSTR mszGroups, - PCSC_LPDWORD pcchGroups); - PCSC_LONG(* pfnSCardListReaders)(SCARDCONTEXT hContext, - LPCSTR mszGroups, LPSTR mszReaders, PCSC_LPDWORD pcchReaders); - PCSC_LONG(* pfnSCardFreeMemory)(SCARDCONTEXT hContext, LPCVOID pvMem); - PCSC_LONG(* pfnSCardCancel)(SCARDCONTEXT hContext); - PCSC_LONG(* pfnSCardGetAttrib)(SCARDHANDLE hCard, PCSC_DWORD dwAttrId, LPBYTE pbAttr, - PCSC_LPDWORD pcbAttrLen); - PCSC_LONG(* pfnSCardSetAttrib)(SCARDHANDLE hCard, PCSC_DWORD dwAttrId, LPCBYTE pbAttr, - PCSC_DWORD cbAttrLen); + PCSC_LONG(*pfnSCardEstablishContext) + (PCSC_DWORD dwScope, LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext); + PCSC_LONG (*pfnSCardReleaseContext)(SCARDCONTEXT hContext); + PCSC_LONG (*pfnSCardIsValidContext)(SCARDCONTEXT hContext); + PCSC_LONG(*pfnSCardConnect) + (SCARDCONTEXT hContext, LPCSTR szReader, PCSC_DWORD dwShareMode, + PCSC_DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, PCSC_LPDWORD pdwActiveProtocol); + PCSC_LONG(*pfnSCardReconnect) + (SCARDHANDLE hCard, PCSC_DWORD dwShareMode, PCSC_DWORD dwPreferredProtocols, + PCSC_DWORD dwInitialization, PCSC_LPDWORD pdwActiveProtocol); + PCSC_LONG (*pfnSCardDisconnect)(SCARDHANDLE hCard, PCSC_DWORD dwDisposition); + PCSC_LONG (*pfnSCardBeginTransaction)(SCARDHANDLE hCard); + PCSC_LONG (*pfnSCardEndTransaction)(SCARDHANDLE hCard, PCSC_DWORD dwDisposition); + PCSC_LONG(*pfnSCardStatus) + (SCARDHANDLE hCard, LPSTR mszReaderName, PCSC_LPDWORD pcchReaderLen, PCSC_LPDWORD pdwState, + PCSC_LPDWORD pdwProtocol, LPBYTE pbAtr, PCSC_LPDWORD pcbAtrLen); + PCSC_LONG(*pfnSCardGetStatusChange) + (SCARDCONTEXT hContext, PCSC_DWORD dwTimeout, PCSC_SCARD_READERSTATE* rgReaderStates, + PCSC_DWORD cReaders); + PCSC_LONG(*pfnSCardControl) + (SCARDHANDLE hCard, PCSC_DWORD dwControlCode, LPCVOID pbSendBuffer, PCSC_DWORD cbSendLength, + LPVOID pbRecvBuffer, PCSC_DWORD cbRecvLength, PCSC_LPDWORD lpBytesReturned); + PCSC_LONG(*pfnSCardTransmit) + (SCARDHANDLE hCard, const PCSC_SCARD_IO_REQUEST* pioSendPci, LPCBYTE pbSendBuffer, + PCSC_DWORD cbSendLength, PCSC_SCARD_IO_REQUEST* pioRecvPci, LPBYTE pbRecvBuffer, + PCSC_LPDWORD pcbRecvLength); + PCSC_LONG(*pfnSCardListReaderGroups) + (SCARDCONTEXT hContext, LPSTR mszGroups, PCSC_LPDWORD pcchGroups); + PCSC_LONG(*pfnSCardListReaders) + (SCARDCONTEXT hContext, LPCSTR mszGroups, LPSTR mszReaders, PCSC_LPDWORD pcchReaders); + PCSC_LONG (*pfnSCardFreeMemory)(SCARDCONTEXT hContext, LPCVOID pvMem); + PCSC_LONG (*pfnSCardCancel)(SCARDCONTEXT hContext); + PCSC_LONG(*pfnSCardGetAttrib) + (SCARDHANDLE hCard, PCSC_DWORD dwAttrId, LPBYTE pbAttr, PCSC_LPDWORD pcbAttrLen); + PCSC_LONG(*pfnSCardSetAttrib) + (SCARDHANDLE hCard, PCSC_DWORD dwAttrId, LPCBYTE pbAttr, PCSC_DWORD cbAttrLen); }; typedef struct _PCSCFunctionTable PCSCFunctionTable; diff --git a/winpr/libwinpr/smartcard/smartcard_winscard.c b/winpr/libwinpr/smartcard/smartcard_winscard.c index 29f1002aa..c2bf19526 100644 --- a/winpr/libwinpr/smartcard/smartcard_winscard.c +++ b/winpr/libwinpr/smartcard/smartcard_winscard.c @@ -31,8 +31,7 @@ static HMODULE g_WinSCardModule = NULL; -SCardApiFunctionTable WinSCard_SCardApiFunctionTable = -{ +SCardApiFunctionTable WinSCard_SCardApiFunctionTable = { 0, /* dwVersion */ 0, /* dwFlags */ @@ -111,7 +110,7 @@ SCardApiFunctionTable WinSCard_SCardApiFunctionTable = NULL, /* SCardGetReaderDeviceInstanceIdW */ NULL, /* SCardListReadersWithDeviceInstanceIdA */ NULL, /* SCardListReadersWithDeviceInstanceIdW */ - NULL /* SCardAudit */ + NULL /* SCardAudit */ }; PSCardApiFunctionTable WinSCard_GetSCardApiFunctionTable(void) diff --git a/winpr/libwinpr/smartcard/smartcard_winscard.h b/winpr/libwinpr/smartcard/smartcard_winscard.h index aacc9f268..82eeb8fbe 100644 --- a/winpr/libwinpr/smartcard/smartcard_winscard.h +++ b/winpr/libwinpr/smartcard/smartcard_winscard.h @@ -25,7 +25,7 @@ #include #define WINSCARD_LOAD_PROC(_name, ...) \ - WinSCard_SCardApiFunctionTable.pfn ## _name = (fn ## _name) GetProcAddress(g_WinSCardModule, #_name); + WinSCard_SCardApiFunctionTable.pfn##_name = (fn##_name)GetProcAddress(g_WinSCardModule, #_name); int WinSCard_InitializeSCardApi(void); PSCardApiFunctionTable WinSCard_GetSCardApiFunctionTable(void); diff --git a/winpr/libwinpr/smartcard/test/TestSmartCardListReaders.c b/winpr/libwinpr/smartcard/test/TestSmartCardListReaders.c index 1b0cb2a3a..379d6b5b6 100644 --- a/winpr/libwinpr/smartcard/test/TestSmartCardListReaders.c +++ b/winpr/libwinpr/smartcard/test/TestSmartCardListReaders.c @@ -14,12 +14,12 @@ int TestSmartCardListReaders(int argc, char* argv[]) if (lStatus != SCARD_S_SUCCESS) { - printf("SCardEstablishContext failure: %s (0x%08"PRIX32")\n", - SCardGetErrorString(lStatus), lStatus); + printf("SCardEstablishContext failure: %s (0x%08" PRIX32 ")\n", + SCardGetErrorString(lStatus), lStatus); return 0; } - lStatus = SCardListReadersA(hSC, NULL, (LPSTR) &mszReaders, &cchReaders); + lStatus = SCardListReadersA(hSC, NULL, (LPSTR)&mszReaders, &cchReaders); if (lStatus != SCARD_S_SUCCESS) { @@ -35,7 +35,7 @@ int TestSmartCardListReaders(int argc, char* argv[]) while (*pReader) { printf("Reader: %s\n", pReader); - pReader = pReader + strlen((CHAR*) pReader) + 1; + pReader = pReader + strlen((CHAR*)pReader) + 1; } lStatus = SCardFreeMemory(hSC, mszReaders); @@ -48,4 +48,3 @@ int TestSmartCardListReaders(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/smartcard/test/TestSmartCardStatus.c b/winpr/libwinpr/smartcard/test/TestSmartCardStatus.c index a830685e1..011f0cec8 100644 --- a/winpr/libwinpr/smartcard/test/TestSmartCardStatus.c +++ b/winpr/libwinpr/smartcard/test/TestSmartCardStatus.c @@ -1,11 +1,12 @@ -// compile against PCSC gcc -o scardtest TestSmartCardStatus.c -DPCSC=1 -I /usr/include/PCSC -lpcsclite +// compile against PCSC gcc -o scardtest TestSmartCardStatus.c -DPCSC=1 -I /usr/include/PCSC +// -lpcsclite #include #include #include #if defined(__APPLE__) || defined(PCSC) #include #include -#elif defined (__linux__) +#elif defined(__linux__) #include #include #include @@ -66,8 +67,8 @@ int TestSmartCardStatus(int argc, char* argv[]) } printf("Reader: %s\n", mszReaders); - err = SCardConnect(hContext, mszReaders, SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1, - &hCard, &dwActiveProtocol); + err = SCardConnect(hContext, mszReaders, SCARD_SHARE_SHARED, + SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1, &hCard, &dwActiveProtocol); if (err != SCARD_S_SUCCESS) { @@ -77,7 +78,6 @@ int TestSmartCardStatus(int argc, char* argv[]) free(mszReaders); - printf("# test 1 - get reader length\n"); err = SCardStatus(hCard, NULL, &len, NULL, NULL, NULL, NULL); if (err != SCARD_S_SUCCESS) @@ -87,7 +87,6 @@ int TestSmartCardStatus(int argc, char* argv[]) } printf("reader name length: %u\n", len); - printf("# test 2 - get reader name value\n"); err = SCardStatus(hCard, name, &len, NULL, NULL, NULL, NULL); if (err != SCARD_S_SUCCESS) @@ -97,7 +96,6 @@ int TestSmartCardStatus(int argc, char* argv[]) } printf("Reader name: %s (%ld)\n", name, strlen(name)); - printf("# test 3 - get all values - pre allocated\n"); err = SCardStatus(hCard, name, &len, &status, &protocol, atr, &atrlen); if (err != SCARD_S_SUCCESS) @@ -110,7 +108,6 @@ int TestSmartCardStatus(int argc, char* argv[]) printf("proto: 0x%08X\n", protocol); printf("atrlen: %u\n", atrlen); - printf("# test 4 - get all values - auto allocate\n"); len = atrlen = SCARD_AUTOALLOCATE; err = SCardStatus(hCard, (LPSTR)&aname, &len, &status, &protocol, (LPBYTE)&aatr, &atrlen); @@ -126,7 +123,6 @@ int TestSmartCardStatus(int argc, char* argv[]) SCardFreeMemory(hContext, aname); SCardFreeMemory(hContext, aatr); - printf("# test 5 - get status and protocol only\n"); err = SCardStatus(hCard, NULL, NULL, &status, &protocol, NULL, NULL); if (err != SCARD_S_SUCCESS) @@ -137,7 +133,6 @@ int TestSmartCardStatus(int argc, char* argv[]) printf("status: 0x%08X\n", status); printf("proto: 0x%08X\n", protocol); - printf("# test 6 - get atr only auto allocated\n"); atrlen = SCARD_AUTOALLOCATE; err = SCardStatus(hCard, NULL, NULL, NULL, NULL, (LPBYTE)&aatr, &atrlen); @@ -149,7 +144,6 @@ int TestSmartCardStatus(int argc, char* argv[]) printf("atrlen: %u\n", atrlen); SCardFreeMemory(hContext, aatr); - printf("# test 7 - get atr only pre allocated\n"); atrlen = 32; err = SCardStatus(hCard, NULL, NULL, NULL, NULL, atr, &atrlen); diff --git a/winpr/libwinpr/sspi/CredSSP/credssp.c b/winpr/libwinpr/sspi/CredSSP/credssp.c index 091f6d9e7..a2fb23413 100644 --- a/winpr/libwinpr/sspi/CredSSP/credssp.c +++ b/winpr/libwinpr/sspi/CredSSP/credssp.c @@ -30,24 +30,22 @@ static const char* CREDSSP_PACKAGE_NAME = "CredSSP"; -static SECURITY_STATUS SEC_ENTRY credssp_InitializeSecurityContextW(PCredHandle phCredential, - PCtxtHandle phContext, - SEC_WCHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, - PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY credssp_InitializeSecurityContextW( + PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR* pszTargetName, ULONG fContextReq, + ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, + PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) { return SEC_E_UNSUPPORTED_FUNCTION; } -static SECURITY_STATUS SEC_ENTRY credssp_InitializeSecurityContextA(PCredHandle phCredential, - PCtxtHandle phContext, - SEC_CHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, - PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY credssp_InitializeSecurityContextA( + PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR* pszTargetName, ULONG fContextReq, + ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, + PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) { CREDSSP_CONTEXT* context; SSPI_CREDENTIALS* credentials; - context = (CREDSSP_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (CREDSSP_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!context) { @@ -56,7 +54,7 @@ static SECURITY_STATUS SEC_ENTRY credssp_InitializeSecurityContextA(PCredHandle if (!context) return SEC_E_INSUFFICIENT_MEMORY; - credentials = (SSPI_CREDENTIALS*) sspi_SecureHandleGetLowerPointer(phCredential); + credentials = (SSPI_CREDENTIALS*)sspi_SecureHandleGetLowerPointer(phCredential); if (!credentials) { @@ -65,7 +63,7 @@ static SECURITY_STATUS SEC_ENTRY credssp_InitializeSecurityContextA(PCredHandle } sspi_SecureHandleSetLowerPointer(phNewContext, context); - sspi_SecureHandleSetUpperPointer(phNewContext, (void*) CREDSSP_PACKAGE_NAME); + sspi_SecureHandleSetUpperPointer(phNewContext, (void*)CREDSSP_PACKAGE_NAME); } return SEC_E_OK; @@ -74,7 +72,7 @@ static SECURITY_STATUS SEC_ENTRY credssp_InitializeSecurityContextA(PCredHandle CREDSSP_CONTEXT* credssp_ContextNew(void) { CREDSSP_CONTEXT* context; - context = (CREDSSP_CONTEXT*) calloc(1, sizeof(CREDSSP_CONTEXT)); + context = (CREDSSP_CONTEXT*)calloc(1, sizeof(CREDSSP_CONTEXT)); if (!context) return NULL; @@ -88,8 +86,7 @@ void credssp_ContextFree(CREDSSP_CONTEXT* context) } static SECURITY_STATUS SEC_ENTRY credssp_QueryContextAttributes(PCtxtHandle phContext, - ULONG ulAttribute, - void* pBuffer) + ULONG ulAttribute, void* pBuffer) { if (!phContext) return SEC_E_INVALID_HANDLE; @@ -100,18 +97,18 @@ static SECURITY_STATUS SEC_ENTRY credssp_QueryContextAttributes(PCtxtHandle phCo return SEC_E_UNSUPPORTED_FUNCTION; } -SECURITY_STATUS SEC_ENTRY credssp_AcquireCredentialsHandleW(SEC_WCHAR* pszPrincipal, - SEC_WCHAR* pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, - void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry) +SECURITY_STATUS SEC_ENTRY credssp_AcquireCredentialsHandleW( + SEC_WCHAR* pszPrincipal, SEC_WCHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, + void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, + PTimeStamp ptsExpiry) { return SEC_E_UNSUPPORTED_FUNCTION; } -static SECURITY_STATUS SEC_ENTRY credssp_AcquireCredentialsHandleA(SEC_CHAR* pszPrincipal, - SEC_CHAR* pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, - void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY credssp_AcquireCredentialsHandleA( + SEC_CHAR* pszPrincipal, SEC_CHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, + void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, + PTimeStamp ptsExpiry) { SSPI_CREDENTIALS* credentials; SEC_WINNT_AUTH_IDENTITY* identity; @@ -123,10 +120,10 @@ static SECURITY_STATUS SEC_ENTRY credssp_AcquireCredentialsHandleA(SEC_CHAR* psz if (!credentials) return SEC_E_INSUFFICIENT_MEMORY; - identity = (SEC_WINNT_AUTH_IDENTITY*) pAuthData; + identity = (SEC_WINNT_AUTH_IDENTITY*)pAuthData; CopyMemory(&(credentials->identity), identity, sizeof(SEC_WINNT_AUTH_IDENTITY)); - sspi_SecureHandleSetLowerPointer(phCredential, (void*) credentials); - sspi_SecureHandleSetUpperPointer(phCredential, (void*) CREDSSP_PACKAGE_NAME); + sspi_SecureHandleSetLowerPointer(phCredential, (void*)credentials); + sspi_SecureHandleSetUpperPointer(phCredential, (void*)CREDSSP_PACKAGE_NAME); return SEC_E_OK; } @@ -134,17 +131,20 @@ static SECURITY_STATUS SEC_ENTRY credssp_AcquireCredentialsHandleA(SEC_CHAR* psz } static SECURITY_STATUS SEC_ENTRY credssp_QueryCredentialsAttributesW(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer) + ULONG ulAttribute, + void* pBuffer) { return SEC_E_UNSUPPORTED_FUNCTION; } static SECURITY_STATUS SEC_ENTRY credssp_QueryCredentialsAttributesA(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer) + ULONG ulAttribute, + void* pBuffer) { if (ulAttribute == SECPKG_CRED_ATTR_NAMES) { - SSPI_CREDENTIALS* credentials = (SSPI_CREDENTIALS*) sspi_SecureHandleGetLowerPointer(phCredential); + SSPI_CREDENTIALS* credentials = + (SSPI_CREDENTIALS*)sspi_SecureHandleGetLowerPointer(phCredential); if (!credentials) return SEC_E_INVALID_HANDLE; @@ -162,7 +162,7 @@ static SECURITY_STATUS SEC_ENTRY credssp_FreeCredentialsHandle(PCredHandle phCre if (!phCredential) return SEC_E_INVALID_HANDLE; - credentials = (SSPI_CREDENTIALS*) sspi_SecureHandleGetLowerPointer(phCredential); + credentials = (SSPI_CREDENTIALS*)sspi_SecureHandleGetLowerPointer(phCredential); if (!credentials) return SEC_E_INVALID_HANDLE; @@ -172,121 +172,114 @@ static SECURITY_STATUS SEC_ENTRY credssp_FreeCredentialsHandle(PCredHandle phCre } static SECURITY_STATUS SEC_ENTRY credssp_EncryptMessage(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo) + PSecBufferDesc pMessage, ULONG MessageSeqNo) { return SEC_E_UNSUPPORTED_FUNCTION; } static SECURITY_STATUS SEC_ENTRY credssp_DecryptMessage(PCtxtHandle phContext, - PSecBufferDesc pMessage, - ULONG MessageSeqNo, ULONG* pfQOP) + PSecBufferDesc pMessage, ULONG MessageSeqNo, + ULONG* pfQOP) { return SEC_E_UNSUPPORTED_FUNCTION; } static SECURITY_STATUS SEC_ENTRY credssp_MakeSignature(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo) + PSecBufferDesc pMessage, ULONG MessageSeqNo) { return SEC_E_UNSUPPORTED_FUNCTION; } static SECURITY_STATUS SEC_ENTRY credssp_VerifySignature(PCtxtHandle phContext, - PSecBufferDesc pMessage, - ULONG MessageSeqNo, ULONG* pfQOP) + PSecBufferDesc pMessage, + ULONG MessageSeqNo, ULONG* pfQOP) { return SEC_E_UNSUPPORTED_FUNCTION; } -const SecurityFunctionTableA CREDSSP_SecurityFunctionTableA = -{ - 1, /* dwVersion */ - NULL, /* EnumerateSecurityPackages */ +const SecurityFunctionTableA CREDSSP_SecurityFunctionTableA = { + 1, /* dwVersion */ + NULL, /* EnumerateSecurityPackages */ credssp_QueryCredentialsAttributesA, /* QueryCredentialsAttributes */ - credssp_AcquireCredentialsHandleA, /* AcquireCredentialsHandle */ - credssp_FreeCredentialsHandle, /* FreeCredentialsHandle */ - NULL, /* Reserved2 */ - credssp_InitializeSecurityContextA, /* InitializeSecurityContext */ - NULL, /* AcceptSecurityContext */ - NULL, /* CompleteAuthToken */ - NULL, /* DeleteSecurityContext */ - NULL, /* ApplyControlToken */ - credssp_QueryContextAttributes, /* QueryContextAttributes */ - NULL, /* ImpersonateSecurityContext */ - NULL, /* RevertSecurityContext */ - credssp_MakeSignature, /* MakeSignature */ - credssp_VerifySignature, /* VerifySignature */ - NULL, /* FreeContextBuffer */ - NULL, /* QuerySecurityPackageInfo */ - NULL, /* Reserved3 */ - NULL, /* Reserved4 */ - NULL, /* ExportSecurityContext */ - NULL, /* ImportSecurityContext */ - NULL, /* AddCredentials */ - NULL, /* Reserved8 */ - NULL, /* QuerySecurityContextToken */ - credssp_EncryptMessage, /* EncryptMessage */ - credssp_DecryptMessage, /* DecryptMessage */ - NULL, /* SetContextAttributes */ + credssp_AcquireCredentialsHandleA, /* AcquireCredentialsHandle */ + credssp_FreeCredentialsHandle, /* FreeCredentialsHandle */ + NULL, /* Reserved2 */ + credssp_InitializeSecurityContextA, /* InitializeSecurityContext */ + NULL, /* AcceptSecurityContext */ + NULL, /* CompleteAuthToken */ + NULL, /* DeleteSecurityContext */ + NULL, /* ApplyControlToken */ + credssp_QueryContextAttributes, /* QueryContextAttributes */ + NULL, /* ImpersonateSecurityContext */ + NULL, /* RevertSecurityContext */ + credssp_MakeSignature, /* MakeSignature */ + credssp_VerifySignature, /* VerifySignature */ + NULL, /* FreeContextBuffer */ + NULL, /* QuerySecurityPackageInfo */ + NULL, /* Reserved3 */ + NULL, /* Reserved4 */ + NULL, /* ExportSecurityContext */ + NULL, /* ImportSecurityContext */ + NULL, /* AddCredentials */ + NULL, /* Reserved8 */ + NULL, /* QuerySecurityContextToken */ + credssp_EncryptMessage, /* EncryptMessage */ + credssp_DecryptMessage, /* DecryptMessage */ + NULL, /* SetContextAttributes */ }; -const SecurityFunctionTableW CREDSSP_SecurityFunctionTableW = -{ - 1, /* dwVersion */ - NULL, /* EnumerateSecurityPackages */ +const SecurityFunctionTableW CREDSSP_SecurityFunctionTableW = { + 1, /* dwVersion */ + NULL, /* EnumerateSecurityPackages */ credssp_QueryCredentialsAttributesW, /* QueryCredentialsAttributes */ - credssp_AcquireCredentialsHandleW, /* AcquireCredentialsHandle */ - credssp_FreeCredentialsHandle, /* FreeCredentialsHandle */ - NULL, /* Reserved2 */ - credssp_InitializeSecurityContextW, /* InitializeSecurityContext */ - NULL, /* AcceptSecurityContext */ - NULL, /* CompleteAuthToken */ - NULL, /* DeleteSecurityContext */ - NULL, /* ApplyControlToken */ - credssp_QueryContextAttributes, /* QueryContextAttributes */ - NULL, /* ImpersonateSecurityContext */ - NULL, /* RevertSecurityContext */ - credssp_MakeSignature, /* MakeSignature */ - credssp_VerifySignature, /* VerifySignature */ - NULL, /* FreeContextBuffer */ - NULL, /* QuerySecurityPackageInfo */ - NULL, /* Reserved3 */ - NULL, /* Reserved4 */ - NULL, /* ExportSecurityContext */ - NULL, /* ImportSecurityContext */ - NULL, /* AddCredentials */ - NULL, /* Reserved8 */ - NULL, /* QuerySecurityContextToken */ - credssp_EncryptMessage, /* EncryptMessage */ - credssp_DecryptMessage, /* DecryptMessage */ - NULL, /* SetContextAttributes */ + credssp_AcquireCredentialsHandleW, /* AcquireCredentialsHandle */ + credssp_FreeCredentialsHandle, /* FreeCredentialsHandle */ + NULL, /* Reserved2 */ + credssp_InitializeSecurityContextW, /* InitializeSecurityContext */ + NULL, /* AcceptSecurityContext */ + NULL, /* CompleteAuthToken */ + NULL, /* DeleteSecurityContext */ + NULL, /* ApplyControlToken */ + credssp_QueryContextAttributes, /* QueryContextAttributes */ + NULL, /* ImpersonateSecurityContext */ + NULL, /* RevertSecurityContext */ + credssp_MakeSignature, /* MakeSignature */ + credssp_VerifySignature, /* VerifySignature */ + NULL, /* FreeContextBuffer */ + NULL, /* QuerySecurityPackageInfo */ + NULL, /* Reserved3 */ + NULL, /* Reserved4 */ + NULL, /* ExportSecurityContext */ + NULL, /* ImportSecurityContext */ + NULL, /* AddCredentials */ + NULL, /* Reserved8 */ + NULL, /* QuerySecurityContextToken */ + credssp_EncryptMessage, /* EncryptMessage */ + credssp_DecryptMessage, /* DecryptMessage */ + NULL, /* SetContextAttributes */ }; -const SecPkgInfoA CREDSSP_SecPkgInfoA = -{ - 0x000110733, /* fCapabilities */ - 1, /* wVersion */ - 0xFFFF, /* wRPCID */ - 0x000090A8, /* cbMaxToken */ - "CREDSSP", /* Name */ +const SecPkgInfoA CREDSSP_SecPkgInfoA = { + 0x000110733, /* fCapabilities */ + 1, /* wVersion */ + 0xFFFF, /* wRPCID */ + 0x000090A8, /* cbMaxToken */ + "CREDSSP", /* Name */ "Microsoft CredSSP Security Provider" /* Comment */ }; static WCHAR CREDSSP_SecPkgInfoW_Name[] = { 'C', 'R', 'E', 'D', 'S', 'S', 'P', '\0' }; -static WCHAR CREDSSP_SecPkgInfoW_Comment[] = -{ - 'M', 'i', 'c', 'r', 'o', 's', 'o', 'f', 't', ' ', - 'C', 'r', 'e', 'd', 'S', 'S', 'P', ' ', - 'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', ' ', - 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\0' -}; +static WCHAR CREDSSP_SecPkgInfoW_Comment[] = { 'M', 'i', 'c', 'r', 'o', 's', 'o', 'f', 't', + ' ', 'C', 'r', 'e', 'd', 'S', 'S', 'P', ' ', + 'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', ' ', + 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\0' }; -const SecPkgInfoW CREDSSP_SecPkgInfoW = -{ - 0x000110733, /* fCapabilities */ - 1, /* wVersion */ - 0xFFFF, /* wRPCID */ - 0x000090A8, /* cbMaxToken */ - CREDSSP_SecPkgInfoW_Name, /* Name */ +const SecPkgInfoW CREDSSP_SecPkgInfoW = { + 0x000110733, /* fCapabilities */ + 1, /* wVersion */ + 0xFFFF, /* wRPCID */ + 0x000090A8, /* cbMaxToken */ + CREDSSP_SecPkgInfoW_Name, /* Name */ CREDSSP_SecPkgInfoW_Comment /* Comment */ }; diff --git a/winpr/libwinpr/sspi/CredSSP/credssp.h b/winpr/libwinpr/sspi/CredSSP/credssp.h index 0badddd88..4db2fa3ca 100644 --- a/winpr/libwinpr/sspi/CredSSP/credssp.h +++ b/winpr/libwinpr/sspi/CredSSP/credssp.h @@ -34,4 +34,3 @@ CREDSSP_CONTEXT* credssp_ContextNew(void); void credssp_ContextFree(CREDSSP_CONTEXT* context); #endif /* WINPR_SSPI_CREDSSP_PRIVATE_H */ - diff --git a/winpr/libwinpr/sspi/Kerberos/kerberos.c b/winpr/libwinpr/sspi/Kerberos/kerberos.c index 28d6f2b47..81eb72d13 100644 --- a/winpr/libwinpr/sspi/Kerberos/kerberos.c +++ b/winpr/libwinpr/sspi/Kerberos/kerberos.c @@ -61,42 +61,39 @@ struct _KRB_CONTEXT static const char* KRB_PACKAGE_NAME = "Kerberos"; -const SecPkgInfoA KERBEROS_SecPkgInfoA = -{ - 0x000F3BBF, /* fCapabilities */ - 1, /* wVersion */ - 0x0010, /* wRPCID */ - 0x0000BB80, /* cbMaxToken : 48k bytes maximum for Windows Server 2012 */ - "Kerberos", /* Name */ +const SecPkgInfoA KERBEROS_SecPkgInfoA = { + 0x000F3BBF, /* fCapabilities */ + 1, /* wVersion */ + 0x0010, /* wRPCID */ + 0x0000BB80, /* cbMaxToken : 48k bytes maximum for Windows Server 2012 */ + "Kerberos", /* Name */ "Kerberos Security Package" /* Comment */ }; static WCHAR KERBEROS_SecPkgInfoW_Name[] = { 'K', 'e', 'r', 'b', 'e', 'r', 'o', 's', '\0' }; -static WCHAR KERBEROS_SecPkgInfoW_Comment[] = -{ - 'K', 'e', 'r', 'b', 'e', 'r', 'o', 's', ' ', - 'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', ' ', - 'P', 'a', 'c', 'k', 'a', 'g', 'e', '\0' +static WCHAR KERBEROS_SecPkgInfoW_Comment[] = { 'K', 'e', 'r', 'b', 'e', 'r', 'o', 's', ' ', + 'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', ' ', + 'P', 'a', 'c', 'k', 'a', 'g', 'e', '\0' }; + +const SecPkgInfoW KERBEROS_SecPkgInfoW = { + 0x000F3BBF, /* fCapabilities */ + 1, /* wVersion */ + 0x0010, /* wRPCID */ + 0x0000BB80, /* cbMaxToken : 48k bytes maximum for Windows Server 2012 */ + KERBEROS_SecPkgInfoW_Name, /* Name */ + KERBEROS_SecPkgInfoW_Comment /* Comment */ }; -const SecPkgInfoW KERBEROS_SecPkgInfoW = -{ - 0x000F3BBF, /* fCapabilities */ - 1, /* wVersion */ - 0x0010, /* wRPCID */ - 0x0000BB80, /* cbMaxToken : 48k bytes maximum for Windows Server 2012 */ - KERBEROS_SecPkgInfoW_Name, /* Name */ - KERBEROS_SecPkgInfoW_Comment /* Comment */ +static sspi_gss_OID_desc g_SSPI_GSS_C_SPNEGO_KRB5 = { + 9, (void*)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x02" }; - -static sspi_gss_OID_desc g_SSPI_GSS_C_SPNEGO_KRB5 = { 9, (void*) "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02" }; static sspi_gss_OID SSPI_GSS_C_SPNEGO_KRB5 = &g_SSPI_GSS_C_SPNEGO_KRB5; static KRB_CONTEXT* kerberos_ContextNew(void) { KRB_CONTEXT* context; - context = (KRB_CONTEXT*) calloc(1, sizeof(KRB_CONTEXT)); + context = (KRB_CONTEXT*)calloc(1, sizeof(KRB_CONTEXT)); if (!context) return NULL; @@ -130,20 +127,18 @@ static void kerberos_ContextFree(KRB_CONTEXT* context) free(context); } -static SECURITY_STATUS SEC_ENTRY kerberos_AcquireCredentialsHandleW(SEC_WCHAR* pszPrincipal, - SEC_WCHAR* pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, - SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, - PCredHandle phCredential, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY kerberos_AcquireCredentialsHandleW( + SEC_WCHAR* pszPrincipal, SEC_WCHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, + void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, + PTimeStamp ptsExpiry) { return SEC_E_OK; } -static SECURITY_STATUS SEC_ENTRY kerberos_AcquireCredentialsHandleA(SEC_CHAR* pszPrincipal, - SEC_CHAR* pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, - SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, - PCredHandle phCredential, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY kerberos_AcquireCredentialsHandleA( + SEC_CHAR* pszPrincipal, SEC_CHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, + void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, + PTimeStamp ptsExpiry) { return SEC_E_OK; } @@ -155,7 +150,7 @@ static SECURITY_STATUS SEC_ENTRY kerberos_FreeCredentialsHandle(PCredHandle phCr if (!phCredential) return SEC_E_INVALID_HANDLE; - credentials = (SSPI_CREDENTIALS*) sspi_SecureHandleGetLowerPointer(phCredential); + credentials = (SSPI_CREDENTIALS*)sspi_SecureHandleGetLowerPointer(phCredential); if (!credentials) return SEC_E_INVALID_HANDLE; @@ -165,7 +160,8 @@ static SECURITY_STATUS SEC_ENTRY kerberos_FreeCredentialsHandle(PCredHandle phCr } static SECURITY_STATUS SEC_ENTRY kerberos_QueryCredentialsAttributesW(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer) + ULONG ulAttribute, + void* pBuffer) { if (ulAttribute == SECPKG_CRED_ATTR_NAMES) { @@ -176,23 +172,22 @@ static SECURITY_STATUS SEC_ENTRY kerberos_QueryCredentialsAttributesW(PCredHandl } static SECURITY_STATUS SEC_ENTRY kerberos_QueryCredentialsAttributesA(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer) + ULONG ulAttribute, + void* pBuffer) { return kerberos_QueryCredentialsAttributesW(phCredential, ulAttribute, pBuffer); } -static SECURITY_STATUS SEC_ENTRY kerberos_InitializeSecurityContextW(PCredHandle phCredential, - PCtxtHandle phContext, - SEC_WCHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, - ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, - PCtxtHandle phNewContext, PSecBufferDesc pOutput, - ULONG* pfContextAttr, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY kerberos_InitializeSecurityContextW( + PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR* pszTargetName, ULONG fContextReq, + ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, + PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG* pfContextAttr, PTimeStamp ptsExpiry) { return SEC_E_UNSUPPORTED_FUNCTION; } static int kerberos_SetContextServicePrincipalNameA(KRB_CONTEXT* context, - SEC_CHAR* ServicePrincipalName) + SEC_CHAR* ServicePrincipalName) { char* p; UINT32 major_status; @@ -233,8 +228,8 @@ static int kerberos_SetContextServicePrincipalNameA(KRB_CONTEXT* context, } #ifdef WITH_GSSAPI -static krb5_error_code KRB5_CALLCONV -acquire_cred(krb5_context ctx, krb5_principal client, const char* password) +static krb5_error_code KRB5_CALLCONV acquire_cred(krb5_context ctx, krb5_principal client, + const char* password) { krb5_error_code ret; krb5_creds creds; @@ -350,8 +345,7 @@ static int init_creds(LPCWSTR username, size_t username_len, LPCWSTR password, s size_t lrealm_len = 0; size_t lusername_len = 0; int status = 0; - status = ConvertFromUnicode(CP_UTF8, 0, username, - username_len, &lusername, 0, NULL, NULL); + status = ConvertFromUnicode(CP_UTF8, 0, username, username_len, &lusername, 0, NULL, NULL); if (status <= 0) { @@ -359,8 +353,7 @@ static int init_creds(LPCWSTR username, size_t username_len, LPCWSTR password, s goto cleanup; } - status = ConvertFromUnicode(CP_UTF8, 0, password, - password_len, &lpassword, 0, NULL, NULL); + status = ConvertFromUnicode(CP_UTF8, 0, password, password_len, &lpassword, 0, NULL, NULL); if (status <= 0) { @@ -408,8 +401,7 @@ static int init_creds(LPCWSTR username, size_t username_len, LPCWSTR password, s flags = KRB5_PRINCIPAL_PARSE_ENTERPRISE; /* Use the specified principal name. */ - ret = krb5_parse_name_flags(ctx, krb_name, flags, - &principal); + ret = krb5_parse_name_flags(ctx, krb_name, flags, &principal); if (ret) { @@ -445,12 +437,10 @@ cleanup: } #endif -static SECURITY_STATUS SEC_ENTRY kerberos_InitializeSecurityContextA(PCredHandle phCredential, - PCtxtHandle phContext, - SEC_CHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, - ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, - PCtxtHandle phNewContext, PSecBufferDesc pOutput, - ULONG* pfContextAttr, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY kerberos_InitializeSecurityContextA( + PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR* pszTargetName, ULONG fContextReq, + ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, + PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG* pfContextAttr, PTimeStamp ptsExpiry) { KRB_CONTEXT* context; SSPI_CREDENTIALS* credentials; @@ -464,7 +454,7 @@ static SECURITY_STATUS SEC_ENTRY kerberos_InitializeSecurityContextA(PCredHandle input_tok.length = 0; output_tok.length = 0; desired_mech = SSPI_GSS_C_SPNEGO_KRB5; - context = (KRB_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (KRB_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!context) { @@ -473,7 +463,7 @@ static SECURITY_STATUS SEC_ENTRY kerberos_InitializeSecurityContextA(PCredHandle if (!context) return SEC_E_INSUFFICIENT_MEMORY; - credentials = (SSPI_CREDENTIALS*) sspi_SecureHandleGetLowerPointer(phCredential); + credentials = (SSPI_CREDENTIALS*)sspi_SecureHandleGetLowerPointer(phCredential); context->credentials = credentials; if (kerberos_SetContextServicePrincipalNameA(context, pszTargetName) < 0) @@ -483,17 +473,17 @@ static SECURITY_STATUS SEC_ENTRY kerberos_InitializeSecurityContextA(PCredHandle } sspi_SecureHandleSetLowerPointer(phNewContext, context); - sspi_SecureHandleSetUpperPointer(phNewContext, (void*) KRB_PACKAGE_NAME); + sspi_SecureHandleSetUpperPointer(phNewContext, (void*)KRB_PACKAGE_NAME); } if (!pInput) { #if defined(WITH_GSSAPI) - context->major_status = sspi_gss_init_sec_context(&(context->minor_status), - context->cred, &(context->gss_ctx), context->target_name, - desired_mech, SSPI_GSS_C_MUTUAL_FLAG | SSPI_GSS_C_DELEG_FLAG, - SSPI_GSS_C_INDEFINITE, SSPI_GSS_C_NO_CHANNEL_BINDINGS, - &input_tok, &actual_mech, &output_tok, &actual_services, &(context->actual_time)); + context->major_status = sspi_gss_init_sec_context( + &(context->minor_status), context->cred, &(context->gss_ctx), context->target_name, + desired_mech, SSPI_GSS_C_MUTUAL_FLAG | SSPI_GSS_C_DELEG_FLAG, SSPI_GSS_C_INDEFINITE, + SSPI_GSS_C_NO_CHANNEL_BINDINGS, &input_tok, &actual_mech, &output_tok, &actual_services, + &(context->actual_time)); if (SSPI_GSS_ERROR(context->major_status)) { @@ -513,11 +503,12 @@ static SECURITY_STATUS SEC_ENTRY kerberos_InitializeSecurityContextA(PCredHandle WLog_INFO(TAG, "Authenticated to Kerberos v5 via login/password"); /* retry GSSAPI call */ - context->major_status = sspi_gss_init_sec_context(&(context->minor_status), - context->cred, &(context->gss_ctx), context->target_name, - desired_mech, SSPI_GSS_C_MUTUAL_FLAG | SSPI_GSS_C_DELEG_FLAG, - SSPI_GSS_C_INDEFINITE, SSPI_GSS_C_NO_CHANNEL_BINDINGS, - &input_tok, &actual_mech, &output_tok, &actual_services, &(context->actual_time)); + context->major_status = sspi_gss_init_sec_context( + &(context->minor_status), context->cred, &(context->gss_ctx), + context->target_name, desired_mech, + SSPI_GSS_C_MUTUAL_FLAG | SSPI_GSS_C_DELEG_FLAG, SSPI_GSS_C_INDEFINITE, + SSPI_GSS_C_NO_CHANNEL_BINDINGS, &input_tok, &actual_mech, &output_tok, + &actual_services, &(context->actual_time)); if (SSPI_GSS_ERROR(context->major_status)) { @@ -567,11 +558,11 @@ static SECURITY_STATUS SEC_ENTRY kerberos_InitializeSecurityContextA(PCredHandle input_tok.value = input_buffer->pvBuffer; input_tok.length = input_buffer->cbBuffer; - context->major_status = sspi_gss_init_sec_context(&(context->minor_status), - context->cred, &(context->gss_ctx), context->target_name, - desired_mech, SSPI_GSS_C_MUTUAL_FLAG | SSPI_GSS_C_DELEG_FLAG, - SSPI_GSS_C_INDEFINITE, SSPI_GSS_C_NO_CHANNEL_BINDINGS, - &input_tok, &actual_mech, &output_tok, &actual_services, &(context->actual_time)); + context->major_status = sspi_gss_init_sec_context( + &(context->minor_status), context->cred, &(context->gss_ctx), context->target_name, + desired_mech, SSPI_GSS_C_MUTUAL_FLAG | SSPI_GSS_C_DELEG_FLAG, SSPI_GSS_C_INDEFINITE, + SSPI_GSS_C_NO_CHANNEL_BINDINGS, &input_tok, &actual_mech, &output_tok, &actual_services, + &(context->actual_time)); if (SSPI_GSS_ERROR(context->major_status)) return SEC_E_INTERNAL_ERROR; @@ -595,7 +586,7 @@ static SECURITY_STATUS SEC_ENTRY kerberos_InitializeSecurityContextA(PCredHandle static SECURITY_STATUS SEC_ENTRY kerberos_DeleteSecurityContext(PCtxtHandle phContext) { KRB_CONTEXT* context; - context = (KRB_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (KRB_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!context) return SEC_E_INVALID_HANDLE; @@ -605,15 +596,13 @@ static SECURITY_STATUS SEC_ENTRY kerberos_DeleteSecurityContext(PCtxtHandle phCo } static SECURITY_STATUS SEC_ENTRY kerberos_QueryContextAttributesW(PCtxtHandle phContext, - ULONG ulAttribute, - void* pBuffer) + ULONG ulAttribute, void* pBuffer) { return SEC_E_OK; } static SECURITY_STATUS SEC_ENTRY kerberos_QueryContextAttributesA(PCtxtHandle phContext, - ULONG ulAttribute, - void* pBuffer) + ULONG ulAttribute, void* pBuffer) { if (!phContext) return SEC_E_INVALID_HANDLE; @@ -623,15 +612,16 @@ static SECURITY_STATUS SEC_ENTRY kerberos_QueryContextAttributesA(PCtxtHandle ph if (ulAttribute == SECPKG_ATTR_SIZES) { - SecPkgContext_Sizes* ContextSizes = (SecPkgContext_Sizes*) pBuffer; + SecPkgContext_Sizes* ContextSizes = (SecPkgContext_Sizes*)pBuffer; /* The MaxTokenSize by default is 12,000 bytes. This has been the default value * since Windows 2000 SP2 and still remains in Windows 7 and Windows 2008 R2. * For Windows Server 2012, the default value of the MaxTokenSize registry * entry is 48,000 bytes.*/ ContextSizes->cbMaxToken = KERBEROS_SecPkgInfoA.cbMaxToken; ContextSizes->cbMaxSignature = 0; /* means verify not supported */ - ContextSizes->cbBlockSize = 0; /* padding not used */ - ContextSizes->cbSecurityTrailer = 60; /* gss_wrap adds additional 60 bytes for encrypt message */ + ContextSizes->cbBlockSize = 0; /* padding not used */ + ContextSizes->cbSecurityTrailer = + 60; /* gss_wrap adds additional 60 bytes for encrypt message */ return SEC_E_OK; } @@ -639,7 +629,8 @@ static SECURITY_STATUS SEC_ENTRY kerberos_QueryContextAttributesA(PCtxtHandle ph } static SECURITY_STATUS SEC_ENTRY kerberos_EncryptMessage(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo) + PSecBufferDesc pMessage, + ULONG MessageSeqNo) { int index; int conf_state; @@ -649,12 +640,12 @@ static SECURITY_STATUS SEC_ENTRY kerberos_EncryptMessage(PCtxtHandle phContext, sspi_gss_buffer_desc input; sspi_gss_buffer_desc output; PSecBuffer data_buffer = NULL; - context = (KRB_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (KRB_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!context) return SEC_E_INVALID_HANDLE; - for (index = 0; index < (int) pMessage->cBuffers; index++) + for (index = 0; index < (int)pMessage->cBuffers; index++) { if (pMessage->pBuffers[index].BufferType == SECBUFFER_DATA) data_buffer = &pMessage->pBuffers[index]; @@ -665,8 +656,8 @@ static SECURITY_STATUS SEC_ENTRY kerberos_EncryptMessage(PCtxtHandle phContext, input.value = data_buffer->pvBuffer; input.length = data_buffer->cbBuffer; - major_status = sspi_gss_wrap(&minor_status, context->gss_ctx, TRUE, - SSPI_GSS_C_QOP_DEFAULT, &input, &conf_state, &output); + major_status = sspi_gss_wrap(&minor_status, context->gss_ctx, TRUE, SSPI_GSS_C_QOP_DEFAULT, + &input, &conf_state, &output); if (SSPI_GSS_ERROR(major_status)) return SEC_E_INTERNAL_ERROR; @@ -684,7 +675,8 @@ static SECURITY_STATUS SEC_ENTRY kerberos_EncryptMessage(PCtxtHandle phContext, } static SECURITY_STATUS SEC_ENTRY kerberos_DecryptMessage(PCtxtHandle phContext, - PSecBufferDesc pMessage, ULONG MessageSeqNo, ULONG* pfQOP) + PSecBufferDesc pMessage, + ULONG MessageSeqNo, ULONG* pfQOP) { int index; int conf_state; @@ -694,12 +686,12 @@ static SECURITY_STATUS SEC_ENTRY kerberos_DecryptMessage(PCtxtHandle phContext, sspi_gss_buffer_desc input_data; sspi_gss_buffer_desc output; PSecBuffer data_buffer_to_unwrap = NULL; - context = (KRB_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (KRB_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!context) return SEC_E_INVALID_HANDLE; - for (index = 0; index < (int) pMessage->cBuffers; index++) + for (index = 0; index < (int)pMessage->cBuffers; index++) { if (pMessage->pBuffers[index].BufferType == SECBUFFER_DATA) data_buffer_to_unwrap = &pMessage->pBuffers[index]; @@ -711,8 +703,8 @@ static SECURITY_STATUS SEC_ENTRY kerberos_DecryptMessage(PCtxtHandle phContext, /* unwrap encrypted TLS key AND its signature */ input_data.value = data_buffer_to_unwrap->pvBuffer; input_data.length = data_buffer_to_unwrap->cbBuffer; - major_status = sspi_gss_unwrap(&minor_status, context->gss_ctx, &input_data, &output, &conf_state, - NULL); + major_status = + sspi_gss_unwrap(&minor_status, context->gss_ctx, &input_data, &output, &conf_state, NULL); if (SSPI_GSS_ERROR(major_status)) return SEC_E_INTERNAL_ERROR; @@ -729,79 +721,77 @@ static SECURITY_STATUS SEC_ENTRY kerberos_DecryptMessage(PCtxtHandle phContext, return SEC_E_OK; } -static SECURITY_STATUS SEC_ENTRY kerberos_MakeSignature(PCtxtHandle phContext, - ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo) +static SECURITY_STATUS SEC_ENTRY kerberos_MakeSignature(PCtxtHandle phContext, ULONG fQOP, + PSecBufferDesc pMessage, ULONG MessageSeqNo) { return SEC_E_OK; } static SECURITY_STATUS SEC_ENTRY kerberos_VerifySignature(PCtxtHandle phContext, - PSecBufferDesc pMessage, ULONG MessageSeqNo, ULONG* pfQOP) + PSecBufferDesc pMessage, + ULONG MessageSeqNo, ULONG* pfQOP) { return SEC_E_OK; } - -const SecurityFunctionTableA KERBEROS_SecurityFunctionTableA = -{ - 1, /* dwVersion */ - NULL, /* EnumerateSecurityPackages */ - kerberos_QueryCredentialsAttributesA, /* QueryCredentialsAttributes */ - kerberos_AcquireCredentialsHandleA, /* AcquireCredentialsHandle */ - kerberos_FreeCredentialsHandle, /* FreeCredentialsHandle */ - NULL, /* Reserved2 */ - kerberos_InitializeSecurityContextA, /* InitializeSecurityContext */ - NULL, /* AcceptSecurityContext */ - NULL, /* CompleteAuthToken */ - kerberos_DeleteSecurityContext, /* DeleteSecurityContext */ - NULL, /* ApplyControlToken */ - kerberos_QueryContextAttributesA, /* QueryContextAttributes */ - NULL, /* ImpersonateSecurityContext */ - NULL, /* RevertSecurityContext */ - kerberos_MakeSignature, /* MakeSignature */ - kerberos_VerifySignature, /* VerifySignature */ - NULL, /* FreeContextBuffer */ - NULL, /* QuerySecurityPackageInfo */ - NULL, /* Reserved3 */ - NULL, /* Reserved4 */ - NULL, /* ExportSecurityContext */ - NULL, /* ImportSecurityContext */ - NULL, /* AddCredentials */ - NULL, /* Reserved8 */ - NULL, /* QuerySecurityContextToken */ - kerberos_EncryptMessage, /* EncryptMessage */ - kerberos_DecryptMessage, /* DecryptMessage */ - NULL, /* SetContextAttributes */ +const SecurityFunctionTableA KERBEROS_SecurityFunctionTableA = { + 1, /* dwVersion */ + NULL, /* EnumerateSecurityPackages */ + kerberos_QueryCredentialsAttributesA, /* QueryCredentialsAttributes */ + kerberos_AcquireCredentialsHandleA, /* AcquireCredentialsHandle */ + kerberos_FreeCredentialsHandle, /* FreeCredentialsHandle */ + NULL, /* Reserved2 */ + kerberos_InitializeSecurityContextA, /* InitializeSecurityContext */ + NULL, /* AcceptSecurityContext */ + NULL, /* CompleteAuthToken */ + kerberos_DeleteSecurityContext, /* DeleteSecurityContext */ + NULL, /* ApplyControlToken */ + kerberos_QueryContextAttributesA, /* QueryContextAttributes */ + NULL, /* ImpersonateSecurityContext */ + NULL, /* RevertSecurityContext */ + kerberos_MakeSignature, /* MakeSignature */ + kerberos_VerifySignature, /* VerifySignature */ + NULL, /* FreeContextBuffer */ + NULL, /* QuerySecurityPackageInfo */ + NULL, /* Reserved3 */ + NULL, /* Reserved4 */ + NULL, /* ExportSecurityContext */ + NULL, /* ImportSecurityContext */ + NULL, /* AddCredentials */ + NULL, /* Reserved8 */ + NULL, /* QuerySecurityContextToken */ + kerberos_EncryptMessage, /* EncryptMessage */ + kerberos_DecryptMessage, /* DecryptMessage */ + NULL, /* SetContextAttributes */ }; -const SecurityFunctionTableW KERBEROS_SecurityFunctionTableW = -{ - 1, /* dwVersion */ - NULL, /* EnumerateSecurityPackages */ - kerberos_QueryCredentialsAttributesW, /* QueryCredentialsAttributes */ - kerberos_AcquireCredentialsHandleW, /* AcquireCredentialsHandle */ - kerberos_FreeCredentialsHandle, /* FreeCredentialsHandle */ - NULL, /* Reserved2 */ - kerberos_InitializeSecurityContextW, /* InitializeSecurityContext */ - NULL, /* AcceptSecurityContext */ - NULL, /* CompleteAuthToken */ - kerberos_DeleteSecurityContext, /* DeleteSecurityContext */ - NULL, /* ApplyControlToken */ - kerberos_QueryContextAttributesW, /* QueryContextAttributes */ - NULL, /* ImpersonateSecurityContext */ - NULL, /* RevertSecurityContext */ - kerberos_MakeSignature, /* MakeSignature */ - kerberos_VerifySignature, /* VerifySignature */ - NULL, /* FreeContextBuffer */ - NULL, /* QuerySecurityPackageInfo */ - NULL, /* Reserved3 */ - NULL, /* Reserved4 */ - NULL, /* ExportSecurityContext */ - NULL, /* ImportSecurityContext */ - NULL, /* AddCredentials */ - NULL, /* Reserved8 */ - NULL, /* QuerySecurityContextToken */ - kerberos_EncryptMessage, /* EncryptMessage */ - kerberos_DecryptMessage, /* DecryptMessage */ - NULL, /* SetContextAttributes */ +const SecurityFunctionTableW KERBEROS_SecurityFunctionTableW = { + 1, /* dwVersion */ + NULL, /* EnumerateSecurityPackages */ + kerberos_QueryCredentialsAttributesW, /* QueryCredentialsAttributes */ + kerberos_AcquireCredentialsHandleW, /* AcquireCredentialsHandle */ + kerberos_FreeCredentialsHandle, /* FreeCredentialsHandle */ + NULL, /* Reserved2 */ + kerberos_InitializeSecurityContextW, /* InitializeSecurityContext */ + NULL, /* AcceptSecurityContext */ + NULL, /* CompleteAuthToken */ + kerberos_DeleteSecurityContext, /* DeleteSecurityContext */ + NULL, /* ApplyControlToken */ + kerberos_QueryContextAttributesW, /* QueryContextAttributes */ + NULL, /* ImpersonateSecurityContext */ + NULL, /* RevertSecurityContext */ + kerberos_MakeSignature, /* MakeSignature */ + kerberos_VerifySignature, /* VerifySignature */ + NULL, /* FreeContextBuffer */ + NULL, /* QuerySecurityPackageInfo */ + NULL, /* Reserved3 */ + NULL, /* Reserved4 */ + NULL, /* ExportSecurityContext */ + NULL, /* ImportSecurityContext */ + NULL, /* AddCredentials */ + NULL, /* Reserved8 */ + NULL, /* QuerySecurityContextToken */ + kerberos_EncryptMessage, /* EncryptMessage */ + kerberos_DecryptMessage, /* DecryptMessage */ + NULL, /* SetContextAttributes */ }; diff --git a/winpr/libwinpr/sspi/NTLM/ntlm.c b/winpr/libwinpr/sspi/NTLM/ntlm.c index e1bb0d279..65a5f692f 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm.c +++ b/winpr/libwinpr/sspi/NTLM/ntlm.c @@ -38,8 +38,7 @@ #include "../../log.h" #define TAG WINPR_TAG("sspi.NTLM") -#define WINPR_KEY "Software\\"FREERDP_VENDOR_STRING \ - "\\"FREERDP_PRODUCT_STRING"\\WinPR\\NTLM" +#define WINPR_KEY "Software\\" FREERDP_VENDOR_STRING "\\" FREERDP_PRODUCT_STRING "\\WinPR\\NTLM" static const char* NTLM_PACKAGE_NAME = "NTLM"; @@ -52,7 +51,8 @@ static int ntlm_SetContextWorkstation(NTLM_CONTEXT* context, char* Workstation) if (!Workstation) { - if (GetComputerNameExA(ComputerNameNetBIOS, NULL, &nSize) || GetLastError() != ERROR_MORE_DATA) + if (GetComputerNameExA(ComputerNameNetBIOS, NULL, &nSize) || + GetLastError() != ERROR_MORE_DATA) return -1; computerName = calloc(nSize, sizeof(CHAR)); @@ -99,7 +99,7 @@ static int ntlm_SetContextServicePrincipalNameW(NTLM_CONTEXT* context, LPWSTR Se } context->ServicePrincipalName.Length = (USHORT)(_wcslen(ServicePrincipalName) * 2); - context->ServicePrincipalName.Buffer = (PWSTR) malloc(context->ServicePrincipalName.Length + 2); + context->ServicePrincipalName.Buffer = (PWSTR)malloc(context->ServicePrincipalName.Length + 2); if (!context->ServicePrincipalName.Buffer) return -1; @@ -132,7 +132,8 @@ static int ntlm_SetContextTargetName(NTLM_CONTEXT* context, char* TargetName) if (!name) { - if (GetComputerNameExA(ComputerNameNetBIOS, NULL, &nSize) || GetLastError() != ERROR_MORE_DATA) + if (GetComputerNameExA(ComputerNameNetBIOS, NULL, &nSize) || + GetLastError() != ERROR_MORE_DATA) return -1; computerName = calloc(nSize, sizeof(CHAR)); @@ -158,7 +159,7 @@ static int ntlm_SetContextTargetName(NTLM_CONTEXT* context, char* TargetName) } context->TargetName.pvBuffer = NULL; - status = ConvertToUnicode(CP_UTF8, 0, name, -1, (LPWSTR*) &context->TargetName.pvBuffer, 0); + status = ConvertToUnicode(CP_UTF8, 0, name, -1, (LPWSTR*)&context->TargetName.pvBuffer, 0); if (status <= 0) { @@ -184,7 +185,7 @@ static NTLM_CONTEXT* ntlm_ContextNew(void) DWORD dwSize; DWORD dwValue; NTLM_CONTEXT* context; - context = (NTLM_CONTEXT*) calloc(1, sizeof(NTLM_CONTEXT)); + context = (NTLM_CONTEXT*)calloc(1, sizeof(NTLM_CONTEXT)); if (!context) return NULL; @@ -200,27 +201,30 @@ static NTLM_CONTEXT* ntlm_ContextNew(void) if (status == ERROR_SUCCESS) { - if (RegQueryValueEx(hKey, _T("NTLMv2"), NULL, &dwType, (BYTE*) &dwValue, &dwSize) == ERROR_SUCCESS) + if (RegQueryValueEx(hKey, _T("NTLMv2"), NULL, &dwType, (BYTE*)&dwValue, &dwSize) == + ERROR_SUCCESS) context->NTLMv2 = dwValue ? 1 : 0; - if (RegQueryValueEx(hKey, _T("UseMIC"), NULL, &dwType, (BYTE*) &dwValue, &dwSize) == ERROR_SUCCESS) + if (RegQueryValueEx(hKey, _T("UseMIC"), NULL, &dwType, (BYTE*)&dwValue, &dwSize) == + ERROR_SUCCESS) context->UseMIC = dwValue ? 1 : 0; - if (RegQueryValueEx(hKey, _T("SendVersionInfo"), NULL, &dwType, (BYTE*) &dwValue, - &dwSize) == ERROR_SUCCESS) + if (RegQueryValueEx(hKey, _T("SendVersionInfo"), NULL, &dwType, (BYTE*)&dwValue, &dwSize) == + ERROR_SUCCESS) context->SendVersionInfo = dwValue ? 1 : 0; - if (RegQueryValueEx(hKey, _T("SendSingleHostData"), NULL, &dwType, (BYTE*) &dwValue, + if (RegQueryValueEx(hKey, _T("SendSingleHostData"), NULL, &dwType, (BYTE*)&dwValue, &dwSize) == ERROR_SUCCESS) context->SendSingleHostData = dwValue ? 1 : 0; - if (RegQueryValueEx(hKey, _T("SendWorkstationName"), NULL, &dwType, (BYTE*) &dwValue, + if (RegQueryValueEx(hKey, _T("SendWorkstationName"), NULL, &dwType, (BYTE*)&dwValue, &dwSize) == ERROR_SUCCESS) context->SendWorkstationName = dwValue ? 1 : 0; - if (RegQueryValueEx(hKey, _T("WorkstationName"), NULL, &dwType, NULL, &dwSize) == ERROR_SUCCESS) + if (RegQueryValueEx(hKey, _T("WorkstationName"), NULL, &dwType, NULL, &dwSize) == + ERROR_SUCCESS) { - char* workstation = (char*) malloc(dwSize + 1); + char* workstation = (char*)malloc(dwSize + 1); if (!workstation) { @@ -228,7 +232,8 @@ static NTLM_CONTEXT* ntlm_ContextNew(void) return NULL; } - status = RegQueryValueExA(hKey, "WorkstationName", NULL, &dwType, (BYTE*) workstation, &dwSize); + status = RegQueryValueExA(hKey, "WorkstationName", NULL, &dwType, (BYTE*)workstation, + &dwSize); workstation[dwSize] = '\0'; if (ntlm_SetContextWorkstation(context, workstation) < 0) @@ -254,7 +259,7 @@ static NTLM_CONTEXT* ntlm_ContextNew(void) if (status == ERROR_SUCCESS) { - if (RegQueryValueEx(hKey, _T("SuppressExtendedProtection"), NULL, &dwType, (BYTE*) &dwValue, + if (RegQueryValueEx(hKey, _T("SuppressExtendedProtection"), NULL, &dwType, (BYTE*)&dwValue, &dwSize) == ERROR_SUCCESS) context->SuppressExtendedProtection = dwValue ? 1 : 0; @@ -291,16 +296,15 @@ static void ntlm_ContextFree(NTLM_CONTEXT* context) free(context); } -static SECURITY_STATUS SEC_ENTRY ntlm_AcquireCredentialsHandleW(SEC_WCHAR* pszPrincipal, - SEC_WCHAR* pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, - void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY ntlm_AcquireCredentialsHandleW( + SEC_WCHAR* pszPrincipal, SEC_WCHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, + void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, + PTimeStamp ptsExpiry) { SSPI_CREDENTIALS* credentials; SEC_WINNT_AUTH_IDENTITY* identity; - if ((fCredentialUse != SECPKG_CRED_OUTBOUND) && - (fCredentialUse != SECPKG_CRED_INBOUND) && + if ((fCredentialUse != SECPKG_CRED_OUTBOUND) && (fCredentialUse != SECPKG_CRED_INBOUND) && (fCredentialUse != SECPKG_CRED_BOTH)) { return SEC_E_INVALID_PARAMETER; @@ -314,26 +318,25 @@ static SECURITY_STATUS SEC_ENTRY ntlm_AcquireCredentialsHandleW(SEC_WCHAR* pszPr credentials->fCredentialUse = fCredentialUse; credentials->pGetKeyFn = pGetKeyFn; credentials->pvGetKeyArgument = pvGetKeyArgument; - identity = (SEC_WINNT_AUTH_IDENTITY*) pAuthData; + identity = (SEC_WINNT_AUTH_IDENTITY*)pAuthData; if (identity) sspi_CopyAuthIdentity(&(credentials->identity), identity); - sspi_SecureHandleSetLowerPointer(phCredential, (void*) credentials); - sspi_SecureHandleSetUpperPointer(phCredential, (void*) NTLM_PACKAGE_NAME); + sspi_SecureHandleSetLowerPointer(phCredential, (void*)credentials); + sspi_SecureHandleSetUpperPointer(phCredential, (void*)NTLM_PACKAGE_NAME); return SEC_E_OK; } -static SECURITY_STATUS SEC_ENTRY ntlm_AcquireCredentialsHandleA(SEC_CHAR* pszPrincipal, - SEC_CHAR* pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, - void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY ntlm_AcquireCredentialsHandleA( + SEC_CHAR* pszPrincipal, SEC_CHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, + void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, + PTimeStamp ptsExpiry) { SSPI_CREDENTIALS* credentials; SEC_WINNT_AUTH_IDENTITY* identity; - if ((fCredentialUse != SECPKG_CRED_OUTBOUND) && - (fCredentialUse != SECPKG_CRED_INBOUND) && + if ((fCredentialUse != SECPKG_CRED_OUTBOUND) && (fCredentialUse != SECPKG_CRED_INBOUND) && (fCredentialUse != SECPKG_CRED_BOTH)) { return SEC_E_INVALID_PARAMETER; @@ -347,13 +350,13 @@ static SECURITY_STATUS SEC_ENTRY ntlm_AcquireCredentialsHandleA(SEC_CHAR* pszPri credentials->fCredentialUse = fCredentialUse; credentials->pGetKeyFn = pGetKeyFn; credentials->pvGetKeyArgument = pvGetKeyArgument; - identity = (SEC_WINNT_AUTH_IDENTITY*) pAuthData; + identity = (SEC_WINNT_AUTH_IDENTITY*)pAuthData; if (identity) sspi_CopyAuthIdentity(&(credentials->identity), identity); - sspi_SecureHandleSetLowerPointer(phCredential, (void*) credentials); - sspi_SecureHandleSetUpperPointer(phCredential, (void*) NTLM_PACKAGE_NAME); + sspi_SecureHandleSetLowerPointer(phCredential, (void*)credentials); + sspi_SecureHandleSetUpperPointer(phCredential, (void*)NTLM_PACKAGE_NAME); return SEC_E_OK; } @@ -364,7 +367,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_FreeCredentialsHandle(PCredHandle phCreden if (!phCredential) return SEC_E_INVALID_HANDLE; - credentials = (SSPI_CREDENTIALS*) sspi_SecureHandleGetLowerPointer(phCredential); + credentials = (SSPI_CREDENTIALS*)sspi_SecureHandleGetLowerPointer(phCredential); if (!credentials) return SEC_E_INVALID_HANDLE; @@ -374,7 +377,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_FreeCredentialsHandle(PCredHandle phCreden } static SECURITY_STATUS SEC_ENTRY ntlm_QueryCredentialsAttributesW(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer) + ULONG ulAttribute, void* pBuffer) { if (ulAttribute == SECPKG_CRED_ATTR_NAMES) { @@ -385,7 +388,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_QueryCredentialsAttributesW(PCredHandle ph } static SECURITY_STATUS SEC_ENTRY ntlm_QueryCredentialsAttributesA(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer) + ULONG ulAttribute, void* pBuffer) { return ntlm_QueryCredentialsAttributesW(phCredential, ulAttribute, pBuffer); } @@ -393,17 +396,17 @@ static SECURITY_STATUS SEC_ENTRY ntlm_QueryCredentialsAttributesA(PCredHandle ph /** * @see http://msdn.microsoft.com/en-us/library/windows/desktop/aa374707 */ -static SECURITY_STATUS SEC_ENTRY ntlm_AcceptSecurityContext(PCredHandle phCredential, - PCtxtHandle phContext, - PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsTimeStamp) +static SECURITY_STATUS SEC_ENTRY +ntlm_AcceptSecurityContext(PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, + ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, + PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsTimeStamp) { NTLM_CONTEXT* context; SECURITY_STATUS status; SSPI_CREDENTIALS* credentials; PSecBuffer input_buffer; PSecBuffer output_buffer; - context = (NTLM_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NTLM_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!context) { @@ -417,11 +420,11 @@ static SECURITY_STATUS SEC_ENTRY ntlm_AcceptSecurityContext(PCredHandle phCreden if (fContextReq & ASC_REQ_CONFIDENTIALITY) context->confidentiality = TRUE; - credentials = (SSPI_CREDENTIALS*) sspi_SecureHandleGetLowerPointer(phCredential); + credentials = (SSPI_CREDENTIALS*)sspi_SecureHandleGetLowerPointer(phCredential); context->credentials = credentials; ntlm_SetContextTargetName(context, NULL); sspi_SecureHandleSetLowerPointer(phNewContext, context); - sspi_SecureHandleSetUpperPointer(phNewContext, (void*) NTLM_PACKAGE_NAME); + sspi_SecureHandleSetUpperPointer(phNewContext, (void*)NTLM_PACKAGE_NAME); } if (context->state == NTLM_STATE_INITIAL) @@ -505,11 +508,10 @@ static SECURITY_STATUS SEC_ENTRY ntlm_ImpersonateSecurityContext(PCtxtHandle phC return SEC_E_OK; } -static SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextW(PCredHandle phCredential, - PCtxtHandle phContext, - SEC_WCHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, - PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextW( + PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR* pszTargetName, ULONG fContextReq, + ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, + PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) { NTLM_CONTEXT* context; SECURITY_STATUS status; @@ -517,7 +519,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextW(PCredHandle phC PSecBuffer input_buffer = NULL; PSecBuffer output_buffer = NULL; PSecBuffer channel_bindings = NULL; - context = (NTLM_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NTLM_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!context) { @@ -529,7 +531,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextW(PCredHandle phC if (fContextReq & ISC_REQ_CONFIDENTIALITY) context->confidentiality = TRUE; - credentials = (SSPI_CREDENTIALS*) sspi_SecureHandleGetLowerPointer(phCredential); + credentials = (SSPI_CREDENTIALS*)sspi_SecureHandleGetLowerPointer(phCredential); context->credentials = credentials; if (context->Workstation.Length < 1) @@ -548,7 +550,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextW(PCredHandle phC } sspi_SecureHandleSetLowerPointer(phNewContext, context); - sspi_SecureHandleSetUpperPointer(phNewContext, (void*) NTLM_PACKAGE_NAME); + sspi_SecureHandleSetUpperPointer(phNewContext, (void*)NTLM_PACKAGE_NAME); } if ((!pInput) || (context->state == NTLM_STATE_AUTHENTICATE)) @@ -593,7 +595,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextW(PCredHandle phC if (channel_bindings) { context->Bindings.BindingsLength = channel_bindings->cbBuffer; - context->Bindings.Bindings = (SEC_CHANNEL_BINDINGS*) channel_bindings->pvBuffer; + context->Bindings.Bindings = (SEC_CHANNEL_BINDINGS*)channel_bindings->pvBuffer; } if (context->state == NTLM_STATE_CHALLENGE) @@ -627,11 +629,10 @@ static SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextW(PCredHandle phC /** * @see http://msdn.microsoft.com/en-us/library/windows/desktop/aa375512%28v=vs.85%29.aspx */ -static SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextA(PCredHandle phCredential, - PCtxtHandle phContext, - SEC_CHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, - PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextA( + PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR* pszTargetName, ULONG fContextReq, + ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, + PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) { SECURITY_STATUS status; SEC_WCHAR* pszTargetNameW = NULL; @@ -643,17 +644,18 @@ static SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextA(PCredHandle phC } status = ntlm_InitializeSecurityContextW(phCredential, phContext, pszTargetNameW, fContextReq, - Reserved1, TargetDataRep, pInput, Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry); + Reserved1, TargetDataRep, pInput, Reserved2, + phNewContext, pOutput, pfContextAttr, ptsExpiry); free(pszTargetNameW); return status; } static SECURITY_STATUS SEC_ENTRY ntlm_CompleteAuthToken(PCtxtHandle phContext, - PSecBufferDesc pToken) + PSecBufferDesc pToken) { NTLM_CONTEXT* context; SECURITY_STATUS status = SEC_E_OK; - context = (NTLM_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NTLM_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!context) return SEC_E_INVALID_HANDLE; @@ -671,7 +673,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_CompleteAuthToken(PCtxtHandle phContext, static SECURITY_STATUS SEC_ENTRY ntlm_DeleteSecurityContext(PCtxtHandle phContext) { NTLM_CONTEXT* context; - context = (NTLM_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NTLM_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!context) return SEC_E_INVALID_HANDLE; @@ -690,10 +692,10 @@ SECURITY_STATUS ntlm_computeProofValue(NTLM_CONTEXT* ntlm, SecBuffer* ntproof) blob = (BYTE*)ntproof->pvBuffer; CopyMemory(blob, ntlm->ServerChallenge, 8); /* Server challenge. */ - blob[8] = 1; /* Response version. */ + blob[8] = 1; /* Response version. */ blob[9] = 1; /* Highest response version understood by the client. */ /* Reserved 6B. */ - CopyMemory(&blob[16], ntlm->Timestamp, 8); /* Time. */ + CopyMemory(&blob[16], ntlm->Timestamp, 8); /* Time. */ CopyMemory(&blob[24], ntlm->ClientChallenge, 8); /* Client challenge. */ /* Reserved 4B. */ /* Server name. */ @@ -710,7 +712,7 @@ SECURITY_STATUS ntlm_computeMicValue(NTLM_CONTEXT* ntlm, SecBuffer* micvalue) if (!sspi_SecBufferAlloc(micvalue, msgSize)) return SEC_E_INSUFFICIENT_MEMORY; - blob = (BYTE*) micvalue->pvBuffer; + blob = (BYTE*)micvalue->pvBuffer; CopyMemory(blob, ntlm->NegotiateMessage.pvBuffer, ntlm->NegotiateMessage.cbBuffer); blob += ntlm->NegotiateMessage.cbBuffer; CopyMemory(blob, ntlm->ChallengeMessage.pvBuffer, ntlm->ChallengeMessage.cbBuffer); @@ -721,12 +723,10 @@ SECURITY_STATUS ntlm_computeMicValue(NTLM_CONTEXT* ntlm, SecBuffer* micvalue) return SEC_E_OK; } - /* http://msdn.microsoft.com/en-us/library/windows/desktop/aa379337/ */ static SECURITY_STATUS SEC_ENTRY ntlm_QueryContextAttributesW(PCtxtHandle phContext, - ULONG ulAttribute, - void* pBuffer) + ULONG ulAttribute, void* pBuffer) { NTLM_CONTEXT* context; @@ -736,16 +736,16 @@ static SECURITY_STATUS SEC_ENTRY ntlm_QueryContextAttributesW(PCtxtHandle phCont if (!pBuffer) return SEC_E_INSUFFICIENT_MEMORY; - context = (NTLM_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NTLM_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (ulAttribute == SECPKG_ATTR_SIZES) { - SecPkgContext_Sizes* ContextSizes = (SecPkgContext_Sizes*) pBuffer; + SecPkgContext_Sizes* ContextSizes = (SecPkgContext_Sizes*)pBuffer; ContextSizes->cbMaxToken = 2010; - ContextSizes->cbMaxSignature = 16; /* the size of expected signature is 16 bytes */ - ContextSizes->cbBlockSize = 0; /* no padding */ + ContextSizes->cbMaxSignature = 16; /* the size of expected signature is 16 bytes */ + ContextSizes->cbBlockSize = 0; /* no padding */ ContextSizes->cbSecurityTrailer = 16; /* no security trailer appended in NTLM - contrary to Kerberos */ + contrary to Kerberos */ return SEC_E_OK; } else if (ulAttribute == SECPKG_ATTR_AUTH_IDENTITY) @@ -754,7 +754,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_QueryContextAttributesW(PCtxtHandle phCont char* UserA = NULL; char* DomainA = NULL; SSPI_CREDENTIALS* credentials; - SecPkgContext_AuthIdentity* AuthIdentity = (SecPkgContext_AuthIdentity*) pBuffer; + SecPkgContext_AuthIdentity* AuthIdentity = (SecPkgContext_AuthIdentity*)pBuffer; context->UseSamFileDatabase = FALSE; credentials = context->credentials; ZeroMemory(AuthIdentity, sizeof(SecPkgContext_AuthIdentity)); @@ -762,10 +762,8 @@ static SECURITY_STATUS SEC_ENTRY ntlm_QueryContextAttributesW(PCtxtHandle phCont if (credentials->identity.UserLength > 0) { - status = ConvertFromUnicode(CP_UTF8, 0, - (WCHAR*)credentials->identity.User, - credentials->identity.UserLength, &UserA, 256, NULL, - NULL); + status = ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)credentials->identity.User, + credentials->identity.UserLength, &UserA, 256, NULL, NULL); if (status <= 0) return SEC_E_INTERNAL_ERROR; @@ -775,10 +773,9 @@ static SECURITY_STATUS SEC_ENTRY ntlm_QueryContextAttributesW(PCtxtHandle phCont if (credentials->identity.DomainLength > 0) { - status = ConvertFromUnicode(CP_UTF8, 0, - (WCHAR*)credentials->identity.Domain, - credentials->identity.DomainLength, &DomainA, 256, - NULL, NULL); + status = + ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)credentials->identity.Domain, + credentials->identity.DomainLength, &DomainA, 256, NULL, NULL); if (status <= 0) return SEC_E_INTERNAL_ERROR; @@ -793,7 +790,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_QueryContextAttributesW(PCtxtHandle phCont else if (ulAttribute == SECPKG_ATTR_AUTH_NTLM_RANDKEY) { SecBuffer* randkey; - randkey = (SecBuffer*) pBuffer; + randkey = (SecBuffer*)pBuffer; if (!sspi_SecBufferAlloc(randkey, 16)) return (SEC_E_INSUFFICIENT_MEMORY); @@ -805,7 +802,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_QueryContextAttributesW(PCtxtHandle phCont { SecBuffer* mic; NTLM_AUTHENTICATE_MESSAGE* message; - mic = (SecBuffer*) pBuffer; + mic = (SecBuffer*)pBuffer; message = &context->AUTHENTICATE_MESSAGE; if (!sspi_SecBufferAlloc(mic, 16)) @@ -816,22 +813,21 @@ static SECURITY_STATUS SEC_ENTRY ntlm_QueryContextAttributesW(PCtxtHandle phCont } else if (ulAttribute == SECPKG_ATTR_AUTH_NTLM_MIC_VALUE) { - return ntlm_computeMicValue(context, (SecBuffer*) pBuffer); + return ntlm_computeMicValue(context, (SecBuffer*)pBuffer); } return SEC_E_UNSUPPORTED_FUNCTION; } static SECURITY_STATUS SEC_ENTRY ntlm_QueryContextAttributesA(PCtxtHandle phContext, - ULONG ulAttribute, - void* pBuffer) + ULONG ulAttribute, void* pBuffer) { return ntlm_QueryContextAttributesW(phContext, ulAttribute, pBuffer); } static SECURITY_STATUS SEC_ENTRY ntlm_SetContextAttributesW(PCtxtHandle phContext, - ULONG ulAttribute, - void* pBuffer, ULONG cbBuffer) + ULONG ulAttribute, void* pBuffer, + ULONG cbBuffer) { NTLM_CONTEXT* context; @@ -841,11 +837,11 @@ static SECURITY_STATUS SEC_ENTRY ntlm_SetContextAttributesW(PCtxtHandle phContex if (!pBuffer) return SEC_E_INVALID_PARAMETER; - context = (NTLM_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NTLM_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (ulAttribute == SECPKG_ATTR_AUTH_NTLM_HASH) { - SecPkgContext_AuthNtlmHash* AuthNtlmHash = (SecPkgContext_AuthNtlmHash*) pBuffer; + SecPkgContext_AuthNtlmHash* AuthNtlmHash = (SecPkgContext_AuthNtlmHash*)pBuffer; if (cbBuffer < sizeof(SecPkgContext_AuthNtlmHash)) return SEC_E_INVALID_PARAMETER; @@ -859,7 +855,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_SetContextAttributesW(PCtxtHandle phContex } else if (ulAttribute == SECPKG_ATTR_AUTH_NTLM_SAM_FILE) { - const char* filename = (char*) pBuffer; + const char* filename = (char*)pBuffer; free(context->SamFile); context->SamFile = NULL; @@ -875,7 +871,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_SetContextAttributesW(PCtxtHandle phContex } else if (ulAttribute == SECPKG_ATTR_AUTH_NTLM_MESSAGE) { - SecPkgContext_AuthNtlmMessage* AuthNtlmMessage = (SecPkgContext_AuthNtlmMessage*) pBuffer; + SecPkgContext_AuthNtlmMessage* AuthNtlmMessage = (SecPkgContext_AuthNtlmMessage*)pBuffer; if (cbBuffer < sizeof(SecPkgContext_AuthNtlmMessage)) return SEC_E_INVALID_PARAMETER; @@ -887,7 +883,8 @@ static SECURITY_STATUS SEC_ENTRY ntlm_SetContextAttributesW(PCtxtHandle phContex if (!sspi_SecBufferAlloc(&context->NegotiateMessage, AuthNtlmMessage->length)) return SEC_E_INSUFFICIENT_MEMORY; - CopyMemory(context->NegotiateMessage.pvBuffer, AuthNtlmMessage->buffer, AuthNtlmMessage->length); + CopyMemory(context->NegotiateMessage.pvBuffer, AuthNtlmMessage->buffer, + AuthNtlmMessage->length); } else if (AuthNtlmMessage->type == 2) { @@ -896,7 +893,8 @@ static SECURITY_STATUS SEC_ENTRY ntlm_SetContextAttributesW(PCtxtHandle phContex if (!sspi_SecBufferAlloc(&context->ChallengeMessage, AuthNtlmMessage->length)) return SEC_E_INSUFFICIENT_MEMORY; - CopyMemory(context->ChallengeMessage.pvBuffer, AuthNtlmMessage->buffer, AuthNtlmMessage->length); + CopyMemory(context->ChallengeMessage.pvBuffer, AuthNtlmMessage->buffer, + AuthNtlmMessage->length); } else if (AuthNtlmMessage->type == 3) { @@ -905,14 +903,16 @@ static SECURITY_STATUS SEC_ENTRY ntlm_SetContextAttributesW(PCtxtHandle phContex if (!sspi_SecBufferAlloc(&context->AuthenticateMessage, AuthNtlmMessage->length)) return SEC_E_INSUFFICIENT_MEMORY; - CopyMemory(context->AuthenticateMessage.pvBuffer, AuthNtlmMessage->buffer, AuthNtlmMessage->length); + CopyMemory(context->AuthenticateMessage.pvBuffer, AuthNtlmMessage->buffer, + AuthNtlmMessage->length); } return SEC_E_OK; } else if (ulAttribute == SECPKG_ATTR_AUTH_NTLM_TIMESTAMP) { - SecPkgContext_AuthNtlmTimestamp* AuthNtlmTimestamp = (SecPkgContext_AuthNtlmTimestamp*) pBuffer; + SecPkgContext_AuthNtlmTimestamp* AuthNtlmTimestamp = + (SecPkgContext_AuthNtlmTimestamp*)pBuffer; if (cbBuffer < sizeof(SecPkgContext_AuthNtlmTimestamp)) return SEC_E_INVALID_PARAMETER; @@ -927,7 +927,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_SetContextAttributesW(PCtxtHandle phContex else if (ulAttribute == SECPKG_ATTR_AUTH_NTLM_CLIENT_CHALLENGE) { SecPkgContext_AuthNtlmClientChallenge* AuthNtlmClientChallenge = - (SecPkgContext_AuthNtlmClientChallenge*) pBuffer; + (SecPkgContext_AuthNtlmClientChallenge*)pBuffer; if (cbBuffer < sizeof(SecPkgContext_AuthNtlmClientChallenge)) return SEC_E_INVALID_PARAMETER; @@ -938,7 +938,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_SetContextAttributesW(PCtxtHandle phContex else if (ulAttribute == SECPKG_ATTR_AUTH_NTLM_SERVER_CHALLENGE) { SecPkgContext_AuthNtlmServerChallenge* AuthNtlmServerChallenge = - (SecPkgContext_AuthNtlmServerChallenge*) pBuffer; + (SecPkgContext_AuthNtlmServerChallenge*)pBuffer; if (cbBuffer < sizeof(SecPkgContext_AuthNtlmServerChallenge)) return SEC_E_INVALID_PARAMETER; @@ -961,8 +961,8 @@ static SECURITY_STATUS SEC_ENTRY ntlm_SetContextAttributesW(PCtxtHandle phContex } static SECURITY_STATUS SEC_ENTRY ntlm_SetContextAttributesA(PCtxtHandle phContext, - ULONG ulAttribute, - void* pBuffer, ULONG cbBuffer) + ULONG ulAttribute, void* pBuffer, + ULONG cbBuffer) { return ntlm_SetContextAttributesW(phContext, ulAttribute, pBuffer, cbBuffer); } @@ -973,7 +973,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_RevertSecurityContext(PCtxtHandle phContex } static SECURITY_STATUS SEC_ENTRY ntlm_EncryptMessage(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo) + PSecBufferDesc pMessage, ULONG MessageSeqNo) { int index; int length; @@ -989,9 +989,9 @@ static SECURITY_STATUS SEC_ENTRY ntlm_EncryptMessage(PCtxtHandle phContext, ULON PSecBuffer data_buffer = NULL; PSecBuffer signature_buffer = NULL; SeqNo = MessageSeqNo; - context = (NTLM_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NTLM_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); - for (index = 0; index < (int) pMessage->cBuffers; index++) + for (index = 0; index < (int)pMessage->cBuffers; index++) { if (pMessage->pBuffers[index].BufferType == SECBUFFER_DATA) data_buffer = &pMessage->pBuffers[index]; @@ -1016,11 +1016,12 @@ static SECURITY_STATUS SEC_ENTRY ntlm_EncryptMessage(PCtxtHandle phContext, ULON /* Compute the HMAC-MD5 hash of ConcatenationOf(seq_num,data) using the client signing key */ hmac = winpr_HMAC_New(); - if (hmac && winpr_HMAC_Init(hmac, WINPR_MD_MD5, context->SendSigningKey, WINPR_MD5_DIGEST_LENGTH)) + if (hmac && + winpr_HMAC_Init(hmac, WINPR_MD_MD5, context->SendSigningKey, WINPR_MD5_DIGEST_LENGTH)) { Data_Write_UINT32(&value, SeqNo); - winpr_HMAC_Update(hmac, (void*) &value, 4); - winpr_HMAC_Update(hmac, (void*) data, length); + winpr_HMAC_Update(hmac, (void*)&value, 4); + winpr_HMAC_Update(hmac, (void*)data, length); winpr_HMAC_Final(hmac, digest, WINPR_MD5_DIGEST_LENGTH); winpr_HMAC_Free(hmac); } @@ -1034,34 +1035,34 @@ static SECURITY_STATUS SEC_ENTRY ntlm_EncryptMessage(PCtxtHandle phContext, ULON /* Encrypt message using with RC4, result overwrites original buffer */ if (context->confidentiality) - winpr_RC4_Update(context->SendRc4Seal, length, (BYTE*) data, (BYTE*) data_buffer->pvBuffer); + winpr_RC4_Update(context->SendRc4Seal, length, (BYTE*)data, (BYTE*)data_buffer->pvBuffer); else CopyMemory(data_buffer->pvBuffer, data, length); #ifdef WITH_DEBUG_NTLM WLog_DBG(TAG, "Data Buffer (length = %d)", length); winpr_HexDump(TAG, WLOG_DEBUG, data, length); - WLog_DBG(TAG, "Encrypted Data Buffer (length = %"PRIu32")", data_buffer->cbBuffer); + WLog_DBG(TAG, "Encrypted Data Buffer (length = %" PRIu32 ")", data_buffer->cbBuffer); winpr_HexDump(TAG, WLOG_DEBUG, data_buffer->pvBuffer, data_buffer->cbBuffer); #endif free(data); /* RC4-encrypt first 8 bytes of digest */ winpr_RC4_Update(context->SendRc4Seal, 8, digest, checksum); - signature = (BYTE*) signature_buffer->pvBuffer; + signature = (BYTE*)signature_buffer->pvBuffer; /* Concatenate version, ciphertext and sequence number to build signature */ Data_Write_UINT32(signature, version); - CopyMemory(&signature[4], (void*) checksum, 8); + CopyMemory(&signature[4], (void*)checksum, 8); Data_Write_UINT32(&signature[12], SeqNo); context->SendSeqNum++; #ifdef WITH_DEBUG_NTLM - WLog_DBG(TAG, "Signature (length = %"PRIu32")", signature_buffer->cbBuffer); + WLog_DBG(TAG, "Signature (length = %" PRIu32 ")", signature_buffer->cbBuffer); winpr_HexDump(TAG, WLOG_DEBUG, signature_buffer->pvBuffer, signature_buffer->cbBuffer); #endif return SEC_E_OK; } static SECURITY_STATUS SEC_ENTRY ntlm_DecryptMessage(PCtxtHandle phContext, PSecBufferDesc pMessage, - ULONG MessageSeqNo, PULONG pfQOP) + ULONG MessageSeqNo, PULONG pfQOP) { int index; int length; @@ -1076,10 +1077,10 @@ static SECURITY_STATUS SEC_ENTRY ntlm_DecryptMessage(PCtxtHandle phContext, PSec BYTE expected_signature[WINPR_MD5_DIGEST_LENGTH]; PSecBuffer data_buffer = NULL; PSecBuffer signature_buffer = NULL; - SeqNo = (UINT32) MessageSeqNo; - context = (NTLM_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + SeqNo = (UINT32)MessageSeqNo; + context = (NTLM_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); - for (index = 0; index < (int) pMessage->cBuffers; index++) + for (index = 0; index < (int)pMessage->cBuffers; index++) { if (pMessage->pBuffers[index].BufferType == SECBUFFER_DATA) data_buffer = &pMessage->pBuffers[index]; @@ -1105,18 +1106,19 @@ static SECURITY_STATUS SEC_ENTRY ntlm_DecryptMessage(PCtxtHandle phContext, PSec /* Decrypt message using with RC4, result overwrites original buffer */ if (context->confidentiality) - winpr_RC4_Update(context->RecvRc4Seal, length, (BYTE*) data, (BYTE*) data_buffer->pvBuffer); + winpr_RC4_Update(context->RecvRc4Seal, length, (BYTE*)data, (BYTE*)data_buffer->pvBuffer); else CopyMemory(data_buffer->pvBuffer, data, length); /* Compute the HMAC-MD5 hash of ConcatenationOf(seq_num,data) using the client signing key */ hmac = winpr_HMAC_New(); - if (hmac && winpr_HMAC_Init(hmac, WINPR_MD_MD5, context->RecvSigningKey, WINPR_MD5_DIGEST_LENGTH)) + if (hmac && + winpr_HMAC_Init(hmac, WINPR_MD_MD5, context->RecvSigningKey, WINPR_MD5_DIGEST_LENGTH)) { Data_Write_UINT32(&value, SeqNo); - winpr_HMAC_Update(hmac, (void*) &value, 4); - winpr_HMAC_Update(hmac, (void*) data_buffer->pvBuffer, data_buffer->cbBuffer); + winpr_HMAC_Update(hmac, (void*)&value, 4); + winpr_HMAC_Update(hmac, (void*)data_buffer->pvBuffer, data_buffer->cbBuffer); winpr_HMAC_Final(hmac, digest, WINPR_MD5_DIGEST_LENGTH); winpr_HMAC_Free(hmac); } @@ -1130,7 +1132,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_DecryptMessage(PCtxtHandle phContext, PSec #ifdef WITH_DEBUG_NTLM WLog_DBG(TAG, "Encrypted Data Buffer (length = %d)", length); winpr_HexDump(TAG, WLOG_DEBUG, data, length); - WLog_DBG(TAG, "Data Buffer (length = %"PRIu32")", data_buffer->cbBuffer); + WLog_DBG(TAG, "Data Buffer (length = %" PRIu32 ")", data_buffer->cbBuffer); winpr_HexDump(TAG, WLOG_DEBUG, data_buffer->pvBuffer, data_buffer->cbBuffer); #endif free(data); @@ -1138,7 +1140,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_DecryptMessage(PCtxtHandle phContext, PSec winpr_RC4_Update(context->RecvRc4Seal, 8, digest, checksum); /* Concatenate version, ciphertext and sequence number to build signature */ Data_Write_UINT32(expected_signature, version); - CopyMemory(&expected_signature[4], (void*) checksum, 8); + CopyMemory(&expected_signature[4], (void*)checksum, 8); Data_Write_UINT32(&expected_signature[12], SeqNo); context->RecvSeqNum++; @@ -1150,7 +1152,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_DecryptMessage(PCtxtHandle phContext, PSec WLog_ERR(TAG, "Expected Signature:"); winpr_HexDump(TAG, WLOG_ERROR, expected_signature, 16); WLog_ERR(TAG, "Actual Signature:"); - winpr_HexDump(TAG, WLOG_ERROR, (BYTE*) signature_buffer->pvBuffer, 16); + winpr_HexDump(TAG, WLOG_ERROR, (BYTE*)signature_buffer->pvBuffer, 16); #endif return SEC_E_MESSAGE_ALTERED; } @@ -1159,107 +1161,101 @@ static SECURITY_STATUS SEC_ENTRY ntlm_DecryptMessage(PCtxtHandle phContext, PSec } static SECURITY_STATUS SEC_ENTRY ntlm_MakeSignature(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo) + PSecBufferDesc pMessage, ULONG MessageSeqNo) { return SEC_E_UNSUPPORTED_FUNCTION; } static SECURITY_STATUS SEC_ENTRY ntlm_VerifySignature(PCtxtHandle phContext, - PSecBufferDesc pMessage, - ULONG MessageSeqNo, PULONG pfQOP) + PSecBufferDesc pMessage, ULONG MessageSeqNo, + PULONG pfQOP) { return SEC_E_UNSUPPORTED_FUNCTION; } -const SecurityFunctionTableA NTLM_SecurityFunctionTableA = -{ - 1, /* dwVersion */ - NULL, /* EnumerateSecurityPackages */ +const SecurityFunctionTableA NTLM_SecurityFunctionTableA = { + 1, /* dwVersion */ + NULL, /* EnumerateSecurityPackages */ ntlm_QueryCredentialsAttributesA, /* QueryCredentialsAttributes */ - ntlm_AcquireCredentialsHandleA, /* AcquireCredentialsHandle */ - ntlm_FreeCredentialsHandle, /* FreeCredentialsHandle */ - NULL, /* Reserved2 */ - ntlm_InitializeSecurityContextA, /* InitializeSecurityContext */ - ntlm_AcceptSecurityContext, /* AcceptSecurityContext */ - ntlm_CompleteAuthToken, /* CompleteAuthToken */ - ntlm_DeleteSecurityContext, /* DeleteSecurityContext */ - NULL, /* ApplyControlToken */ - ntlm_QueryContextAttributesA, /* QueryContextAttributes */ - ntlm_ImpersonateSecurityContext, /* ImpersonateSecurityContext */ - ntlm_RevertSecurityContext, /* RevertSecurityContext */ - ntlm_MakeSignature, /* MakeSignature */ - ntlm_VerifySignature, /* VerifySignature */ - NULL, /* FreeContextBuffer */ - NULL, /* QuerySecurityPackageInfo */ - NULL, /* Reserved3 */ - NULL, /* Reserved4 */ - NULL, /* ExportSecurityContext */ - NULL, /* ImportSecurityContext */ - NULL, /* AddCredentials */ - NULL, /* Reserved8 */ - NULL, /* QuerySecurityContextToken */ - ntlm_EncryptMessage, /* EncryptMessage */ - ntlm_DecryptMessage, /* DecryptMessage */ - ntlm_SetContextAttributesA, /* SetContextAttributes */ + ntlm_AcquireCredentialsHandleA, /* AcquireCredentialsHandle */ + ntlm_FreeCredentialsHandle, /* FreeCredentialsHandle */ + NULL, /* Reserved2 */ + ntlm_InitializeSecurityContextA, /* InitializeSecurityContext */ + ntlm_AcceptSecurityContext, /* AcceptSecurityContext */ + ntlm_CompleteAuthToken, /* CompleteAuthToken */ + ntlm_DeleteSecurityContext, /* DeleteSecurityContext */ + NULL, /* ApplyControlToken */ + ntlm_QueryContextAttributesA, /* QueryContextAttributes */ + ntlm_ImpersonateSecurityContext, /* ImpersonateSecurityContext */ + ntlm_RevertSecurityContext, /* RevertSecurityContext */ + ntlm_MakeSignature, /* MakeSignature */ + ntlm_VerifySignature, /* VerifySignature */ + NULL, /* FreeContextBuffer */ + NULL, /* QuerySecurityPackageInfo */ + NULL, /* Reserved3 */ + NULL, /* Reserved4 */ + NULL, /* ExportSecurityContext */ + NULL, /* ImportSecurityContext */ + NULL, /* AddCredentials */ + NULL, /* Reserved8 */ + NULL, /* QuerySecurityContextToken */ + ntlm_EncryptMessage, /* EncryptMessage */ + ntlm_DecryptMessage, /* DecryptMessage */ + ntlm_SetContextAttributesA, /* SetContextAttributes */ }; -const SecurityFunctionTableW NTLM_SecurityFunctionTableW = -{ - 1, /* dwVersion */ - NULL, /* EnumerateSecurityPackages */ +const SecurityFunctionTableW NTLM_SecurityFunctionTableW = { + 1, /* dwVersion */ + NULL, /* EnumerateSecurityPackages */ ntlm_QueryCredentialsAttributesW, /* QueryCredentialsAttributes */ - ntlm_AcquireCredentialsHandleW, /* AcquireCredentialsHandle */ - ntlm_FreeCredentialsHandle, /* FreeCredentialsHandle */ - NULL, /* Reserved2 */ - ntlm_InitializeSecurityContextW, /* InitializeSecurityContext */ - ntlm_AcceptSecurityContext, /* AcceptSecurityContext */ - ntlm_CompleteAuthToken, /* CompleteAuthToken */ - ntlm_DeleteSecurityContext, /* DeleteSecurityContext */ - NULL, /* ApplyControlToken */ - ntlm_QueryContextAttributesW, /* QueryContextAttributes */ - ntlm_ImpersonateSecurityContext, /* ImpersonateSecurityContext */ - ntlm_RevertSecurityContext, /* RevertSecurityContext */ - ntlm_MakeSignature, /* MakeSignature */ - ntlm_VerifySignature, /* VerifySignature */ - NULL, /* FreeContextBuffer */ - NULL, /* QuerySecurityPackageInfo */ - NULL, /* Reserved3 */ - NULL, /* Reserved4 */ - NULL, /* ExportSecurityContext */ - NULL, /* ImportSecurityContext */ - NULL, /* AddCredentials */ - NULL, /* Reserved8 */ - NULL, /* QuerySecurityContextToken */ - ntlm_EncryptMessage, /* EncryptMessage */ - ntlm_DecryptMessage, /* DecryptMessage */ - ntlm_SetContextAttributesA, /* SetContextAttributes */ + ntlm_AcquireCredentialsHandleW, /* AcquireCredentialsHandle */ + ntlm_FreeCredentialsHandle, /* FreeCredentialsHandle */ + NULL, /* Reserved2 */ + ntlm_InitializeSecurityContextW, /* InitializeSecurityContext */ + ntlm_AcceptSecurityContext, /* AcceptSecurityContext */ + ntlm_CompleteAuthToken, /* CompleteAuthToken */ + ntlm_DeleteSecurityContext, /* DeleteSecurityContext */ + NULL, /* ApplyControlToken */ + ntlm_QueryContextAttributesW, /* QueryContextAttributes */ + ntlm_ImpersonateSecurityContext, /* ImpersonateSecurityContext */ + ntlm_RevertSecurityContext, /* RevertSecurityContext */ + ntlm_MakeSignature, /* MakeSignature */ + ntlm_VerifySignature, /* VerifySignature */ + NULL, /* FreeContextBuffer */ + NULL, /* QuerySecurityPackageInfo */ + NULL, /* Reserved3 */ + NULL, /* Reserved4 */ + NULL, /* ExportSecurityContext */ + NULL, /* ImportSecurityContext */ + NULL, /* AddCredentials */ + NULL, /* Reserved8 */ + NULL, /* QuerySecurityContextToken */ + ntlm_EncryptMessage, /* EncryptMessage */ + ntlm_DecryptMessage, /* DecryptMessage */ + ntlm_SetContextAttributesA, /* SetContextAttributes */ }; -const SecPkgInfoA NTLM_SecPkgInfoA = -{ - 0x00082B37, /* fCapabilities */ - 1, /* wVersion */ - 0x000A, /* wRPCID */ - 0x00000B48, /* cbMaxToken */ - "NTLM", /* Name */ +const SecPkgInfoA NTLM_SecPkgInfoA = { + 0x00082B37, /* fCapabilities */ + 1, /* wVersion */ + 0x000A, /* wRPCID */ + 0x00000B48, /* cbMaxToken */ + "NTLM", /* Name */ "NTLM Security Package" /* Comment */ }; static WCHAR NTLM_SecPkgInfoW_Name[] = { 'N', 'T', 'L', 'M', '\0' }; -static WCHAR NTLM_SecPkgInfoW_Comment[] = -{ - 'N', 'T', 'L', 'M', ' ', - 'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', ' ', - 'P', 'a', 'c', 'k', 'a', 'g', 'e', '\0' +static WCHAR NTLM_SecPkgInfoW_Comment[] = { + 'N', 'T', 'L', 'M', ' ', 'S', 'e', 'c', 'u', 'r', 'i', + 't', 'y', ' ', 'P', 'a', 'c', 'k', 'a', 'g', 'e', '\0' }; -const SecPkgInfoW NTLM_SecPkgInfoW = -{ - 0x00082B37, /* fCapabilities */ - 1, /* wVersion */ - 0x000A, /* wRPCID */ - 0x00000B48, /* cbMaxToken */ - NTLM_SecPkgInfoW_Name, /* Name */ +const SecPkgInfoW NTLM_SecPkgInfoW = { + 0x00082B37, /* fCapabilities */ + 1, /* wVersion */ + 0x000A, /* wRPCID */ + 0x00000B48, /* cbMaxToken */ + NTLM_SecPkgInfoW_Name, /* Name */ NTLM_SecPkgInfoW_Comment /* Comment */ }; diff --git a/winpr/libwinpr/sspi/NTLM/ntlm.h b/winpr/libwinpr/sspi/NTLM/ntlm.h index 4f0024880..48bd33cc9 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm.h +++ b/winpr/libwinpr/sspi/NTLM/ntlm.h @@ -29,42 +29,42 @@ #include "../sspi.h" -#define MESSAGE_TYPE_NEGOTIATE 1 -#define MESSAGE_TYPE_CHALLENGE 2 -#define MESSAGE_TYPE_AUTHENTICATE 3 +#define MESSAGE_TYPE_NEGOTIATE 1 +#define MESSAGE_TYPE_CHALLENGE 2 +#define MESSAGE_TYPE_AUTHENTICATE 3 -#define NTLMSSP_NEGOTIATE_56 0x80000000 /* W (0) */ -#define NTLMSSP_NEGOTIATE_KEY_EXCH 0x40000000 /* V (1) */ -#define NTLMSSP_NEGOTIATE_128 0x20000000 /* U (2) */ -#define NTLMSSP_RESERVED1 0x10000000 /* r1 (3) */ -#define NTLMSSP_RESERVED2 0x08000000 /* r2 (4) */ -#define NTLMSSP_RESERVED3 0x04000000 /* r3 (5) */ -#define NTLMSSP_NEGOTIATE_VERSION 0x02000000 /* T (6) */ -#define NTLMSSP_RESERVED4 0x01000000 /* r4 (7) */ -#define NTLMSSP_NEGOTIATE_TARGET_INFO 0x00800000 /* S (8) */ -#define NTLMSSP_REQUEST_NON_NT_SESSION_KEY 0x00400000 /* R (9) */ -#define NTLMSSP_RESERVED5 0x00200000 /* r5 (10) */ -#define NTLMSSP_NEGOTIATE_IDENTIFY 0x00100000 /* Q (11) */ -#define NTLMSSP_NEGOTIATE_EXTENDED_SESSION_SECURITY 0x00080000 /* P (12) */ -#define NTLMSSP_RESERVED6 0x00040000 /* r6 (13) */ -#define NTLMSSP_TARGET_TYPE_SERVER 0x00020000 /* O (14) */ -#define NTLMSSP_TARGET_TYPE_DOMAIN 0x00010000 /* N (15) */ -#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN 0x00008000 /* M (16) */ -#define NTLMSSP_RESERVED7 0x00004000 /* r7 (17) */ -#define NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED 0x00002000 /* L (18) */ -#define NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED 0x00001000 /* K (19) */ -#define NTLMSSP_NEGOTIATE_ANONYMOUS 0x00000800 /* J (20) */ -#define NTLMSSP_RESERVED8 0x00000400 /* r8 (21) */ -#define NTLMSSP_NEGOTIATE_NTLM 0x00000200 /* H (22) */ -#define NTLMSSP_RESERVED9 0x00000100 /* r9 (23) */ -#define NTLMSSP_NEGOTIATE_LM_KEY 0x00000080 /* G (24) */ -#define NTLMSSP_NEGOTIATE_DATAGRAM 0x00000040 /* F (25) */ -#define NTLMSSP_NEGOTIATE_SEAL 0x00000020 /* E (26) */ -#define NTLMSSP_NEGOTIATE_SIGN 0x00000010 /* D (27) */ -#define NTLMSSP_RESERVED10 0x00000008 /* r10 (28) */ -#define NTLMSSP_REQUEST_TARGET 0x00000004 /* C (29) */ -#define NTLMSSP_NEGOTIATE_OEM 0x00000002 /* B (30) */ -#define NTLMSSP_NEGOTIATE_UNICODE 0x00000001 /* A (31) */ +#define NTLMSSP_NEGOTIATE_56 0x80000000 /* W (0) */ +#define NTLMSSP_NEGOTIATE_KEY_EXCH 0x40000000 /* V (1) */ +#define NTLMSSP_NEGOTIATE_128 0x20000000 /* U (2) */ +#define NTLMSSP_RESERVED1 0x10000000 /* r1 (3) */ +#define NTLMSSP_RESERVED2 0x08000000 /* r2 (4) */ +#define NTLMSSP_RESERVED3 0x04000000 /* r3 (5) */ +#define NTLMSSP_NEGOTIATE_VERSION 0x02000000 /* T (6) */ +#define NTLMSSP_RESERVED4 0x01000000 /* r4 (7) */ +#define NTLMSSP_NEGOTIATE_TARGET_INFO 0x00800000 /* S (8) */ +#define NTLMSSP_REQUEST_NON_NT_SESSION_KEY 0x00400000 /* R (9) */ +#define NTLMSSP_RESERVED5 0x00200000 /* r5 (10) */ +#define NTLMSSP_NEGOTIATE_IDENTIFY 0x00100000 /* Q (11) */ +#define NTLMSSP_NEGOTIATE_EXTENDED_SESSION_SECURITY 0x00080000 /* P (12) */ +#define NTLMSSP_RESERVED6 0x00040000 /* r6 (13) */ +#define NTLMSSP_TARGET_TYPE_SERVER 0x00020000 /* O (14) */ +#define NTLMSSP_TARGET_TYPE_DOMAIN 0x00010000 /* N (15) */ +#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN 0x00008000 /* M (16) */ +#define NTLMSSP_RESERVED7 0x00004000 /* r7 (17) */ +#define NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED 0x00002000 /* L (18) */ +#define NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED 0x00001000 /* K (19) */ +#define NTLMSSP_NEGOTIATE_ANONYMOUS 0x00000800 /* J (20) */ +#define NTLMSSP_RESERVED8 0x00000400 /* r8 (21) */ +#define NTLMSSP_NEGOTIATE_NTLM 0x00000200 /* H (22) */ +#define NTLMSSP_RESERVED9 0x00000100 /* r9 (23) */ +#define NTLMSSP_NEGOTIATE_LM_KEY 0x00000080 /* G (24) */ +#define NTLMSSP_NEGOTIATE_DATAGRAM 0x00000040 /* F (25) */ +#define NTLMSSP_NEGOTIATE_SEAL 0x00000020 /* E (26) */ +#define NTLMSSP_NEGOTIATE_SIGN 0x00000010 /* D (27) */ +#define NTLMSSP_RESERVED10 0x00000008 /* r10 (28) */ +#define NTLMSSP_REQUEST_TARGET 0x00000004 /* C (29) */ +#define NTLMSSP_NEGOTIATE_OEM 0x00000002 /* B (30) */ +#define NTLMSSP_NEGOTIATE_UNICODE 0x00000001 /* A (31) */ enum _NTLM_STATE { @@ -100,16 +100,16 @@ struct _NTLM_AV_PAIR }; typedef struct _NTLM_AV_PAIR NTLM_AV_PAIR; -#define MSV_AV_FLAGS_AUTHENTICATION_CONSTRAINED 0x00000001 -#define MSV_AV_FLAGS_MESSAGE_INTEGRITY_CHECK 0x00000002 -#define MSV_AV_FLAGS_TARGET_SPN_UNTRUSTED_SOURCE 0x00000004 +#define MSV_AV_FLAGS_AUTHENTICATION_CONSTRAINED 0x00000001 +#define MSV_AV_FLAGS_MESSAGE_INTEGRITY_CHECK 0x00000002 +#define MSV_AV_FLAGS_TARGET_SPN_UNTRUSTED_SOURCE 0x00000004 -#define WINDOWS_MAJOR_VERSION_5 0x05 -#define WINDOWS_MAJOR_VERSION_6 0x06 -#define WINDOWS_MINOR_VERSION_0 0x00 -#define WINDOWS_MINOR_VERSION_1 0x01 -#define WINDOWS_MINOR_VERSION_2 0x02 -#define NTLMSSP_REVISION_W2K3 0x0F +#define WINDOWS_MAJOR_VERSION_5 0x05 +#define WINDOWS_MAJOR_VERSION_6 0x06 +#define WINDOWS_MINOR_VERSION_0 0x00 +#define WINDOWS_MINOR_VERSION_1 0x01 +#define WINDOWS_MINOR_VERSION_2 0x02 +#define NTLMSSP_REVISION_W2K3 0x0F struct _NTLM_VERSION_INFO { diff --git a/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.c b/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.c index 87f50fe28..7b6eabdc4 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.c +++ b/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.c @@ -39,19 +39,10 @@ #include "../../log.h" #define TAG WINPR_TAG("sspi.NTLM") -static const char* const AV_PAIR_STRINGS[] = -{ - "MsvAvEOL", - "MsvAvNbComputerName", - "MsvAvNbDomainName", - "MsvAvDnsComputerName", - "MsvAvDnsDomainName", - "MsvAvDnsTreeName", - "MsvAvFlags", - "MsvAvTimestamp", - "MsvAvRestrictions", - "MsvAvTargetName", - "MsvChannelBindings" +static const char* const AV_PAIR_STRINGS[] = { + "MsvAvEOL", "MsvAvNbComputerName", "MsvAvNbDomainName", "MsvAvDnsComputerName", + "MsvAvDnsDomainName", "MsvAvDnsTreeName", "MsvAvFlags", "MsvAvTimestamp", + "MsvAvRestrictions", "MsvAvTargetName", "MsvChannelBindings" }; static BOOL ntlm_av_pair_check(NTLM_AV_PAIR* pAvPair, size_t cbAvPair); @@ -97,7 +88,7 @@ ULONG ntlm_av_pair_list_length(NTLM_AV_PAIR* pAvPairList, size_t cbAvPairList) if (!pAvPair) return 0; - return ((PBYTE) pAvPair - (PBYTE) pAvPairList) + sizeof(NTLM_AV_PAIR); + return ((PBYTE)pAvPair - (PBYTE)pAvPairList) + sizeof(NTLM_AV_PAIR); } static INLINE SIZE_T ntlm_av_pair_get_len(const NTLM_AV_PAIR* pAvPair) @@ -121,12 +112,10 @@ void ntlm_print_av_pair_list(NTLM_AV_PAIR* pAvPairList, size_t cbAvPairList) while (pAvPair && ntlm_av_pair_get_id(pAvPair) != MsvAvEOL) { - WLog_INFO(TAG, "\t%s AvId: %"PRIu16" AvLen: %"PRIu16"", - AV_PAIR_STRINGS[ntlm_av_pair_get_id(pAvPair)], - ntlm_av_pair_get_id(pAvPair), + WLog_INFO(TAG, "\t%s AvId: %" PRIu16 " AvLen: %" PRIu16 "", + AV_PAIR_STRINGS[ntlm_av_pair_get_id(pAvPair)], ntlm_av_pair_get_id(pAvPair), ntlm_av_pair_get_len(pAvPair)); - winpr_HexDump(TAG, WLOG_INFO, - ntlm_av_pair_get_value_pointer(pAvPair), + winpr_HexDump(TAG, WLOG_INFO, ntlm_av_pair_get_value_pointer(pAvPair), ntlm_av_pair_get_len(pAvPair)); pAvPair = ntlm_av_pair_next(pAvPair, &cbAvPair); @@ -141,7 +130,7 @@ static ULONG ntlm_av_pair_list_size(ULONG AvPairsCount, ULONG AvPairsValueLength PBYTE ntlm_av_pair_get_value_pointer(NTLM_AV_PAIR* pAvPair) { - return (PBYTE) pAvPair + sizeof(NTLM_AV_PAIR); + return (PBYTE)pAvPair + sizeof(NTLM_AV_PAIR); } static size_t ntlm_av_pair_get_next_offset(NTLM_AV_PAIR* pAvPair) @@ -167,11 +156,11 @@ static NTLM_AV_PAIR* ntlm_av_pair_next(NTLM_AV_PAIR* pAvPair, size_t* pcbAvPair) offset = ntlm_av_pair_get_next_offset(pAvPair); *pcbAvPair -= offset; - return (NTLM_AV_PAIR*)((PBYTE) pAvPair + offset); + return (NTLM_AV_PAIR*)((PBYTE)pAvPair + offset); } -NTLM_AV_PAIR* ntlm_av_pair_get(NTLM_AV_PAIR* pAvPairList, size_t cbAvPairList, - NTLM_AV_ID AvId, size_t* pcbAvPairListRemaining) +NTLM_AV_PAIR* ntlm_av_pair_get(NTLM_AV_PAIR* pAvPairList, size_t cbAvPairList, NTLM_AV_ID AvId, + size_t* pcbAvPairListRemaining) { size_t cbAvPair = cbAvPairList; NTLM_AV_PAIR* pAvPair = pAvPairList; @@ -202,8 +191,8 @@ NTLM_AV_PAIR* ntlm_av_pair_get(NTLM_AV_PAIR* pAvPairList, size_t cbAvPairList, return pAvPair; } -static BOOL ntlm_av_pair_add(NTLM_AV_PAIR* pAvPairList, size_t cbAvPairList, - NTLM_AV_ID AvId, PBYTE Value, UINT16 AvLen) +static BOOL ntlm_av_pair_add(NTLM_AV_PAIR* pAvPairList, size_t cbAvPairList, NTLM_AV_ID AvId, + PBYTE Value, UINT16 AvLen) { size_t cbAvPair; NTLM_AV_PAIR* pAvPair; @@ -232,10 +221,8 @@ static BOOL ntlm_av_pair_add_copy(NTLM_AV_PAIR* pAvPairList, size_t cbAvPairList if (!ntlm_av_pair_check(pAvPair, cbAvPair)) return FALSE; - return ntlm_av_pair_add(pAvPairList, cbAvPairList, - ntlm_av_pair_get_id(pAvPair), - ntlm_av_pair_get_value_pointer(pAvPair), - ntlm_av_pair_get_len(pAvPair)); + return ntlm_av_pair_add(pAvPairList, cbAvPairList, ntlm_av_pair_get_id(pAvPair), + ntlm_av_pair_get_value_pointer(pAvPair), ntlm_av_pair_get_len(pAvPair)); } static int ntlm_get_target_computer_name(PUNICODE_STRING pName, COMPUTER_NAME_FORMAT type) @@ -318,11 +305,11 @@ static void ntlm_free_unicode_string(PUNICODE_STRING string) /* typedef struct gss_channel_bindings_struct { - OM_uint32 initiator_addrtype; - gss_buffer_desc initiator_address; - OM_uint32 acceptor_addrtype; - gss_buffer_desc acceptor_address; - gss_buffer_desc application_data; + OM_uint32 initiator_addrtype; + gss_buffer_desc initiator_address; + OM_uint32 acceptor_addrtype; + gss_buffer_desc acceptor_address; + gss_buffer_desc application_data; } *gss_channel_bindings_t; */ @@ -355,7 +342,7 @@ static void ntlm_compute_channel_bindings(NTLM_CONTEXT* context) goto out; ChannelBindingTokenLength = context->Bindings.BindingsLength - sizeof(SEC_CHANNEL_BINDINGS); - ChannelBindingToken = &((BYTE*) ChannelBindings)[ChannelBindings->dwApplicationDataOffset]; + ChannelBindingToken = &((BYTE*)ChannelBindings)[ChannelBindings->dwApplicationDataOffset]; if (!ntlm_md5_update_uint32_be(md5, ChannelBindings->dwInitiatorAddrType)) goto out; @@ -372,7 +359,7 @@ static void ntlm_compute_channel_bindings(NTLM_CONTEXT* context) if (!ntlm_md5_update_uint32_be(md5, ChannelBindings->cbApplicationDataLength)) goto out; - if (!winpr_Digest_Update(md5, (void*) ChannelBindingToken, ChannelBindingTokenLength)) + if (!winpr_Digest_Update(md5, (void*)ChannelBindingToken, ChannelBindingTokenLength)) goto out; if (!winpr_Digest_Final(md5, context->ChannelBindingsHash, WINPR_MD5_DIGEST_LENGTH)) @@ -431,34 +418,33 @@ int ntlm_construct_challenge_target_info(NTLM_CONTEXT* context) goto fail; AvPairsCount = 5; - AvPairsLength = NbDomainName.Length + NbComputerName.Length + - DnsDomainName.Length + DnsComputerName.Length + 8; + AvPairsLength = NbDomainName.Length + NbComputerName.Length + DnsDomainName.Length + + DnsComputerName.Length + 8; length = ntlm_av_pair_list_size(AvPairsCount, AvPairsLength); if (!sspi_SecBufferAlloc(&context->ChallengeTargetInfo, length)) goto fail; - pAvPairList = (NTLM_AV_PAIR*) context->ChallengeTargetInfo.pvBuffer; + pAvPairList = (NTLM_AV_PAIR*)context->ChallengeTargetInfo.pvBuffer; cbAvPairList = context->ChallengeTargetInfo.cbBuffer; if (!ntlm_av_pair_list_init(pAvPairList, cbAvPairList)) goto fail; - if (!ntlm_av_pair_add(pAvPairList, cbAvPairList, MsvAvNbDomainName, (PBYTE) NbDomainName.Buffer, + if (!ntlm_av_pair_add(pAvPairList, cbAvPairList, MsvAvNbDomainName, (PBYTE)NbDomainName.Buffer, NbDomainName.Length)) goto fail; - if (!ntlm_av_pair_add(pAvPairList, cbAvPairList, MsvAvNbComputerName, (PBYTE) NbComputerName.Buffer, - NbComputerName.Length)) + if (!ntlm_av_pair_add(pAvPairList, cbAvPairList, MsvAvNbComputerName, + (PBYTE)NbComputerName.Buffer, NbComputerName.Length)) goto fail; - if (!ntlm_av_pair_add(pAvPairList, cbAvPairList, MsvAvDnsDomainName, (PBYTE) DnsDomainName.Buffer, - DnsDomainName.Length)) + if (!ntlm_av_pair_add(pAvPairList, cbAvPairList, MsvAvDnsDomainName, + (PBYTE)DnsDomainName.Buffer, DnsDomainName.Length)) goto fail; if (!ntlm_av_pair_add(pAvPairList, cbAvPairList, MsvAvDnsComputerName, - (PBYTE) DnsComputerName.Buffer, - DnsComputerName.Length)) + (PBYTE)DnsComputerName.Buffer, DnsComputerName.Length)) goto fail; if (!ntlm_av_pair_add(pAvPairList, cbAvPairList, MsvAvTimestamp, context->Timestamp, @@ -497,17 +483,16 @@ int ntlm_construct_authenticate_target_info(NTLM_CONTEXT* context) size_t cbAuthenticateTargetInfo; AvPairsCount = 1; AvPairsValueLength = 0; - ChallengeTargetInfo = (NTLM_AV_PAIR*) context->ChallengeTargetInfo.pvBuffer; + ChallengeTargetInfo = (NTLM_AV_PAIR*)context->ChallengeTargetInfo.pvBuffer; cbChallengeTargetInfo = context->ChallengeTargetInfo.cbBuffer; AvNbDomainName = ntlm_av_pair_get(ChallengeTargetInfo, cbChallengeTargetInfo, MsvAvNbDomainName, &cbAvNbDomainName); - AvNbComputerName = ntlm_av_pair_get(ChallengeTargetInfo, cbChallengeTargetInfo, MsvAvNbComputerName, - &cbAvNbComputerName); - AvDnsDomainName = ntlm_av_pair_get(ChallengeTargetInfo, cbChallengeTargetInfo, MsvAvDnsDomainName, - &cbAvDnsDomainName); + AvNbComputerName = ntlm_av_pair_get(ChallengeTargetInfo, cbChallengeTargetInfo, + MsvAvNbComputerName, &cbAvNbComputerName); + AvDnsDomainName = ntlm_av_pair_get(ChallengeTargetInfo, cbChallengeTargetInfo, + MsvAvDnsDomainName, &cbAvDnsDomainName); AvDnsComputerName = ntlm_av_pair_get(ChallengeTargetInfo, cbChallengeTargetInfo, - MsvAvDnsComputerName, - &cbAvDnsComputerName); + MsvAvDnsComputerName, &cbAvDnsComputerName); AvDnsTreeName = ntlm_av_pair_get(ChallengeTargetInfo, cbChallengeTargetInfo, MsvAvDnsTreeName, &cbAvDnsTreeName); AvTimestamp = ntlm_av_pair_get(ChallengeTargetInfo, cbChallengeTargetInfo, MsvAvTimestamp, @@ -589,7 +574,7 @@ int ntlm_construct_authenticate_target_info(NTLM_CONTEXT* context) if (!sspi_SecBufferAlloc(&context->AuthenticateTargetInfo, size)) return -1; - AuthenticateTargetInfo = (NTLM_AV_PAIR*) context->AuthenticateTargetInfo.pvBuffer; + AuthenticateTargetInfo = (NTLM_AV_PAIR*)context->AuthenticateTargetInfo.pvBuffer; cbAuthenticateTargetInfo = context->AuthenticateTargetInfo.cbBuffer; if (!ntlm_av_pair_list_init(AuthenticateTargetInfo, cbAuthenticateTargetInfo)) @@ -597,8 +582,8 @@ int ntlm_construct_authenticate_target_info(NTLM_CONTEXT* context) if (AvNbDomainName) { - if (!ntlm_av_pair_add_copy(AuthenticateTargetInfo, cbAuthenticateTargetInfo, - AvNbDomainName, cbAvNbDomainName)) + if (!ntlm_av_pair_add_copy(AuthenticateTargetInfo, cbAuthenticateTargetInfo, AvNbDomainName, + cbAvNbDomainName)) return -1; } @@ -625,15 +610,15 @@ int ntlm_construct_authenticate_target_info(NTLM_CONTEXT* context) if (AvDnsTreeName) { - if (!ntlm_av_pair_add_copy(AuthenticateTargetInfo, cbAuthenticateTargetInfo, - AvDnsTreeName, cbAvDnsTreeName)) + if (!ntlm_av_pair_add_copy(AuthenticateTargetInfo, cbAuthenticateTargetInfo, AvDnsTreeName, + cbAvDnsTreeName)) return -1; } if (AvTimestamp) { - if (!ntlm_av_pair_add_copy(AuthenticateTargetInfo, cbAuthenticateTargetInfo, - AvTimestamp, cbAvTimestamp)) + if (!ntlm_av_pair_add_copy(AuthenticateTargetInfo, cbAuthenticateTargetInfo, AvTimestamp, + cbAvTimestamp)) return -1; } @@ -643,14 +628,14 @@ int ntlm_construct_authenticate_target_info(NTLM_CONTEXT* context) Data_Write_UINT32(&flags, MSV_AV_FLAGS_MESSAGE_INTEGRITY_CHECK); if (!ntlm_av_pair_add(AuthenticateTargetInfo, cbAuthenticateTargetInfo, MsvAvFlags, - (PBYTE) &flags, 4)) + (PBYTE)&flags, 4)) return -1; } if (context->SendSingleHostData) { if (!ntlm_av_pair_add(AuthenticateTargetInfo, cbAuthenticateTargetInfo, MsvAvSingleHost, - (PBYTE) &context->SingleHostData, context->SingleHostData.Size)) + (PBYTE)&context->SingleHostData, context->SingleHostData.Size)) return -1; } @@ -662,10 +647,8 @@ int ntlm_construct_authenticate_target_info(NTLM_CONTEXT* context) if (context->ServicePrincipalName.Length > 0) { - if (!ntlm_av_pair_add(AuthenticateTargetInfo, - cbAuthenticateTargetInfo, - MsvAvTargetName, - (PBYTE) context->ServicePrincipalName.Buffer, + if (!ntlm_av_pair_add(AuthenticateTargetInfo, cbAuthenticateTargetInfo, MsvAvTargetName, + (PBYTE)context->ServicePrincipalName.Buffer, context->ServicePrincipalName.Length)) return -1; } diff --git a/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.h b/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.h index 6b219d111..ac228a869 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.h +++ b/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.h @@ -27,8 +27,8 @@ ULONG ntlm_av_pair_list_length(NTLM_AV_PAIR* pAvPairList, size_t cbAvPairList); void ntlm_print_av_pair_list(NTLM_AV_PAIR* pAvPairList, size_t cbAvPairList); PBYTE ntlm_av_pair_get_value_pointer(NTLM_AV_PAIR* pAvPair); -NTLM_AV_PAIR* ntlm_av_pair_get(NTLM_AV_PAIR* pAvPairList, size_t cbAvPairList, - NTLM_AV_ID AvId, size_t* pcbAvPairListRemaining); +NTLM_AV_PAIR* ntlm_av_pair_get(NTLM_AV_PAIR* pAvPairList, size_t cbAvPairList, NTLM_AV_ID AvId, + size_t* pcbAvPairListRemaining); int ntlm_construct_challenge_target_info(NTLM_CONTEXT* context); int ntlm_construct_authenticate_target_info(NTLM_CONTEXT* context); diff --git a/winpr/libwinpr/sspi/NTLM/ntlm_compute.c b/winpr/libwinpr/sspi/NTLM/ntlm_compute.c index e9e2e5b4e..60526467f 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm_compute.c +++ b/winpr/libwinpr/sspi/NTLM/ntlm_compute.c @@ -49,8 +49,8 @@ static const char NTLM_CLIENT_SEAL_MAGIC[] = static const char NTLM_SERVER_SEAL_MAGIC[] = "session key to server-to-client sealing key magic constant"; -static const BYTE NTLM_NULL_BUFFER[16] = -{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static const BYTE NTLM_NULL_BUFFER[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /** * Populate VERSION structure. @@ -63,9 +63,9 @@ void ntlm_get_version_info(NTLM_VERSION_INFO* versionInfo) OSVERSIONINFOA osVersionInfo; osVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA); GetVersionExA(&osVersionInfo); - versionInfo->ProductMajorVersion = (UINT8) osVersionInfo.dwMajorVersion; - versionInfo->ProductMinorVersion = (UINT8) osVersionInfo.dwMinorVersion; - versionInfo->ProductBuild = (UINT16) osVersionInfo.dwBuildNumber; + versionInfo->ProductMajorVersion = (UINT8)osVersionInfo.dwMajorVersion; + versionInfo->ProductMinorVersion = (UINT8)osVersionInfo.dwMinorVersion; + versionInfo->ProductBuild = (UINT16)osVersionInfo.dwBuildNumber; ZeroMemory(versionInfo->Reserved, sizeof(versionInfo->Reserved)); versionInfo->NTLMRevisionCurrent = NTLMSSP_REVISION_W2K3; } @@ -83,7 +83,7 @@ int ntlm_read_version_info(wStream* s, NTLM_VERSION_INFO* versionInfo) Stream_Read_UINT8(s, versionInfo->ProductMajorVersion); /* ProductMajorVersion (1 byte) */ Stream_Read_UINT8(s, versionInfo->ProductMinorVersion); /* ProductMinorVersion (1 byte) */ - Stream_Read_UINT16(s, versionInfo->ProductBuild); /* ProductBuild (2 bytes) */ + Stream_Read_UINT16(s, versionInfo->ProductBuild); /* ProductBuild (2 bytes) */ Stream_Read(s, versionInfo->Reserved, sizeof(versionInfo->Reserved)); /* Reserved (3 bytes) */ Stream_Read_UINT8(s, versionInfo->NTLMRevisionCurrent); /* NTLMRevisionCurrent (1 byte) */ return 1; @@ -99,7 +99,7 @@ void ntlm_write_version_info(wStream* s, NTLM_VERSION_INFO* versionInfo) { Stream_Write_UINT8(s, versionInfo->ProductMajorVersion); /* ProductMajorVersion (1 byte) */ Stream_Write_UINT8(s, versionInfo->ProductMinorVersion); /* ProductMinorVersion (1 byte) */ - Stream_Write_UINT16(s, versionInfo->ProductBuild); /* ProductBuild (2 bytes) */ + Stream_Write_UINT16(s, versionInfo->ProductBuild); /* ProductBuild (2 bytes) */ Stream_Write(s, versionInfo->Reserved, sizeof(versionInfo->Reserved)); /* Reserved (3 bytes) */ Stream_Write_UINT8(s, versionInfo->NTLMRevisionCurrent); /* NTLMRevisionCurrent (1 byte) */ } @@ -113,12 +113,12 @@ void ntlm_write_version_info(wStream* s, NTLM_VERSION_INFO* versionInfo) void ntlm_print_version_info(NTLM_VERSION_INFO* versionInfo) { WLog_INFO(TAG, "VERSION ={"); - WLog_INFO(TAG, "\tProductMajorVersion: %"PRIu8"", versionInfo->ProductMajorVersion); - WLog_INFO(TAG, "\tProductMinorVersion: %"PRIu8"", versionInfo->ProductMinorVersion); - WLog_INFO(TAG, "\tProductBuild: %"PRIu16"", versionInfo->ProductBuild); - WLog_INFO(TAG, "\tReserved: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"", versionInfo->Reserved[0], + WLog_INFO(TAG, "\tProductMajorVersion: %" PRIu8 "", versionInfo->ProductMajorVersion); + WLog_INFO(TAG, "\tProductMinorVersion: %" PRIu8 "", versionInfo->ProductMinorVersion); + WLog_INFO(TAG, "\tProductBuild: %" PRIu16 "", versionInfo->ProductBuild); + WLog_INFO(TAG, "\tReserved: 0x%02" PRIX8 "%02" PRIX8 "%02" PRIX8 "", versionInfo->Reserved[0], versionInfo->Reserved[1], versionInfo->Reserved[2]); - WLog_INFO(TAG, "\tNTLMRevisionCurrent: 0x%02"PRIX8"", versionInfo->NTLMRevisionCurrent); + WLog_INFO(TAG, "\tNTLMRevisionCurrent: 0x%02" PRIX8 "", versionInfo->NTLMRevisionCurrent); } int ntlm_read_ntlm_v2_client_challenge(wStream* s, NTLMv2_CLIENT_CHALLENGE* challenge) @@ -137,7 +137,7 @@ int ntlm_read_ntlm_v2_client_challenge(wStream* s, NTLMv2_CLIENT_CHALLENGE* chal return -1; challenge->cbAvPairs = size; - challenge->AvPairs = (NTLM_AV_PAIR*) malloc(challenge->cbAvPairs); + challenge->AvPairs = (NTLM_AV_PAIR*)malloc(challenge->cbAvPairs); if (!challenge->AvPairs) return -1; @@ -211,9 +211,9 @@ int ntlm_fetch_ntlm_v2_hash(NTLM_CONTEXT* context, BYTE* hash) if (!sam) return -1; - entry = SamLookupUserW(sam, (LPWSTR) credentials->identity.User, - credentials->identity.UserLength * 2, - (LPWSTR) credentials->identity.Domain, credentials->identity.DomainLength * 2); + entry = SamLookupUserW( + sam, (LPWSTR)credentials->identity.User, credentials->identity.UserLength * 2, + (LPWSTR)credentials->identity.Domain, credentials->identity.DomainLength * 2); if (entry) { @@ -221,16 +221,15 @@ int ntlm_fetch_ntlm_v2_hash(NTLM_CONTEXT* context, BYTE* hash) WLog_DBG(TAG, "NTLM Hash:"); winpr_HexDump(TAG, WLOG_DEBUG, entry->NtHash, 16); #endif - NTOWFv2FromHashW(entry->NtHash, - (LPWSTR) credentials->identity.User, credentials->identity.UserLength * 2, - (LPWSTR) credentials->identity.Domain, credentials->identity.DomainLength * 2, - (BYTE*) hash); + NTOWFv2FromHashW(entry->NtHash, (LPWSTR)credentials->identity.User, + credentials->identity.UserLength * 2, (LPWSTR)credentials->identity.Domain, + credentials->identity.DomainLength * 2, (BYTE*)hash); SamFreeEntry(sam, entry); SamClose(sam); return 1; } - entry = SamLookupUserW(sam, (LPWSTR) credentials->identity.User, + entry = SamLookupUserW(sam, (LPWSTR)credentials->identity.User, credentials->identity.UserLength * 2, NULL, 0); if (entry) @@ -239,10 +238,9 @@ int ntlm_fetch_ntlm_v2_hash(NTLM_CONTEXT* context, BYTE* hash) WLog_DBG(TAG, "NTLM Hash:"); winpr_HexDump(TAG, WLOG_DEBUG, entry->NtHash, 16); #endif - NTOWFv2FromHashW(entry->NtHash, - (LPWSTR) credentials->identity.User, credentials->identity.UserLength * 2, - (LPWSTR) credentials->identity.Domain, credentials->identity.DomainLength * 2, - (BYTE*) hash); + NTOWFv2FromHashW(entry->NtHash, (LPWSTR)credentials->identity.User, + credentials->identity.UserLength * 2, (LPWSTR)credentials->identity.Domain, + credentials->identity.DomainLength * 2, (BYTE*)hash); SamFreeEntry(sam, entry); SamClose(sam); return 1; @@ -265,9 +263,10 @@ int ntlm_convert_password_hash(NTLM_CONTEXT* context, BYTE* hash) char* PasswordHash = NULL; UINT32 PasswordHashLength = 0; SSPI_CREDENTIALS* credentials = context->credentials; - /* Password contains a password hash of length (PasswordLength - SSPI_CREDENTIALS_HASH_LENGTH_OFFSET) */ + /* Password contains a password hash of length (PasswordLength - + * SSPI_CREDENTIALS_HASH_LENGTH_OFFSET) */ PasswordHashLength = credentials->identity.PasswordLength - SSPI_CREDENTIALS_HASH_LENGTH_OFFSET; - status = ConvertFromUnicode(CP_UTF8, 0, (LPCWSTR) credentials->identity.Password, + status = ConvertFromUnicode(CP_UTF8, 0, (LPCWSTR)credentials->identity.Password, PasswordHashLength, &PasswordHash, 0, NULL, NULL); if (status <= 0) @@ -293,21 +292,21 @@ static int ntlm_compute_ntlm_v2_hash(NTLM_CONTEXT* context, BYTE* hash) if (credentials) { - WLog_DBG(TAG, "Password (length = %"PRIu32")", credentials->identity.PasswordLength * 2); - winpr_HexDump(TAG, WLOG_DEBUG, (BYTE*) credentials->identity.Password, + WLog_DBG(TAG, "Password (length = %" PRIu32 ")", credentials->identity.PasswordLength * 2); + winpr_HexDump(TAG, WLOG_DEBUG, (BYTE*)credentials->identity.Password, credentials->identity.PasswordLength * 2); - WLog_DBG(TAG, "Username (length = %"PRIu32")", credentials->identity.UserLength * 2); - winpr_HexDump(TAG, WLOG_DEBUG, (BYTE*) credentials->identity.User, + WLog_DBG(TAG, "Username (length = %" PRIu32 ")", credentials->identity.UserLength * 2); + winpr_HexDump(TAG, WLOG_DEBUG, (BYTE*)credentials->identity.User, credentials->identity.UserLength * 2); - WLog_DBG(TAG, "Domain (length = %"PRIu32")", credentials->identity.DomainLength * 2); - winpr_HexDump(TAG, WLOG_DEBUG, (BYTE*) credentials->identity.Domain, + WLog_DBG(TAG, "Domain (length = %" PRIu32 ")", credentials->identity.DomainLength * 2); + winpr_HexDump(TAG, WLOG_DEBUG, (BYTE*)credentials->identity.Domain, credentials->identity.DomainLength * 2); } else WLog_DBG(TAG, "Strange, NTLM_CONTEXT is missing valid credentials..."); - WLog_DBG(TAG, "Workstation (length = %"PRIu16")", context->Workstation.Length); - winpr_HexDump(TAG, WLOG_DEBUG, (BYTE*) context->Workstation.Buffer, context->Workstation.Length); + WLog_DBG(TAG, "Workstation (length = %" PRIu16 ")", context->Workstation.Length); + winpr_HexDump(TAG, WLOG_DEBUG, (BYTE*)context->Workstation.Buffer, context->Workstation.Length); WLog_DBG(TAG, "NTOWFv2, NTLMv2 Hash"); winpr_HexDump(TAG, WLOG_DEBUG, context->NtlmV2Hash, WINPR_MD5_DIGEST_LENGTH); #endif @@ -317,10 +316,9 @@ static int ntlm_compute_ntlm_v2_hash(NTLM_CONTEXT* context, BYTE* hash) if (memcmp(context->NtlmHash, NTLM_NULL_BUFFER, 16) != 0) { - NTOWFv2FromHashW(context->NtlmHash, - (LPWSTR) credentials->identity.User, credentials->identity.UserLength * 2, - (LPWSTR) credentials->identity.Domain, credentials->identity.DomainLength * 2, - (BYTE*) hash); + NTOWFv2FromHashW(context->NtlmHash, (LPWSTR)credentials->identity.User, + credentials->identity.UserLength * 2, (LPWSTR)credentials->identity.Domain, + credentials->identity.DomainLength * 2, (BYTE*)hash); } else if (credentials->identity.PasswordLength > SSPI_CREDENTIALS_HASH_LENGTH_OFFSET) { @@ -328,16 +326,16 @@ static int ntlm_compute_ntlm_v2_hash(NTLM_CONTEXT* context, BYTE* hash) if (ntlm_convert_password_hash(context, context->NtlmHash) < 0) return -1; - NTOWFv2FromHashW(context->NtlmHash, - (LPWSTR) credentials->identity.User, credentials->identity.UserLength * 2, - (LPWSTR) credentials->identity.Domain, credentials->identity.DomainLength * 2, - (BYTE*) hash); + NTOWFv2FromHashW(context->NtlmHash, (LPWSTR)credentials->identity.User, + credentials->identity.UserLength * 2, (LPWSTR)credentials->identity.Domain, + credentials->identity.DomainLength * 2, (BYTE*)hash); } else if (credentials->identity.Password) { - NTOWFv2W((LPWSTR) credentials->identity.Password, credentials->identity.PasswordLength * 2, - (LPWSTR) credentials->identity.User, credentials->identity.UserLength * 2, - (LPWSTR) credentials->identity.Domain, credentials->identity.DomainLength * 2, (BYTE*) hash); + NTOWFv2W((LPWSTR)credentials->identity.Password, credentials->identity.PasswordLength * 2, + (LPWSTR)credentials->identity.User, credentials->identity.UserLength * 2, + (LPWSTR)credentials->identity.Domain, credentials->identity.DomainLength * 2, + (BYTE*)hash); } else if (context->HashCallback) { @@ -395,12 +393,12 @@ int ntlm_compute_lm_v2_response(NTLM_CONTEXT* context) if (!sspi_SecBufferAlloc(&context->LmChallengeResponse, 24)) return -1; - response = (BYTE*) context->LmChallengeResponse.pvBuffer; + response = (BYTE*)context->LmChallengeResponse.pvBuffer; /* Compute the HMAC-MD5 hash of the resulting value using the NTLMv2 hash as the key */ - winpr_HMAC(WINPR_MD_MD5, (void*) context->NtlmV2Hash, WINPR_MD5_DIGEST_LENGTH, - (BYTE*) value, WINPR_MD5_DIGEST_LENGTH, - (BYTE*) response, WINPR_MD5_DIGEST_LENGTH); - /* Concatenate the resulting HMAC-MD5 hash and the client challenge, giving us the LMv2 response (24 bytes) */ + winpr_HMAC(WINPR_MD_MD5, (void*)context->NtlmV2Hash, WINPR_MD5_DIGEST_LENGTH, (BYTE*)value, + WINPR_MD5_DIGEST_LENGTH, (BYTE*)response, WINPR_MD5_DIGEST_LENGTH); + /* Concatenate the resulting HMAC-MD5 hash and the client challenge, giving us the LMv2 response + * (24 bytes) */ CopyMemory(&response[16], context->ClientChallenge, 8); return 1; } @@ -425,10 +423,10 @@ int ntlm_compute_ntlm_v2_response(NTLM_CONTEXT* context) return -1; ZeroMemory(ntlm_v2_temp.pvBuffer, ntlm_v2_temp.cbBuffer); - blob = (BYTE*) ntlm_v2_temp.pvBuffer; + blob = (BYTE*)ntlm_v2_temp.pvBuffer; /* Compute the NTLMv2 hash */ - if (ntlm_compute_ntlm_v2_hash(context, (BYTE*) context->NtlmV2Hash) < 0) + if (ntlm_compute_ntlm_v2_hash(context, (BYTE*)context->NtlmV2Hash) < 0) return -1; /* Construct temp */ @@ -436,7 +434,7 @@ int ntlm_compute_ntlm_v2_response(NTLM_CONTEXT* context) blob[1] = 1; /* HighRespType (1 byte) */ /* Reserved1 (2 bytes) */ /* Reserved2 (4 bytes) */ - CopyMemory(&blob[8], context->Timestamp, 8); /* Timestamp (8 bytes) */ + CopyMemory(&blob[8], context->Timestamp, 8); /* Timestamp (8 bytes) */ CopyMemory(&blob[16], context->ClientChallenge, 8); /* ClientChallenge (8 bytes) */ /* Reserved3 (4 bytes) */ CopyMemory(&blob[28], TargetInfo->pvBuffer, TargetInfo->cbBuffer); @@ -450,25 +448,25 @@ int ntlm_compute_ntlm_v2_response(NTLM_CONTEXT* context) if (!sspi_SecBufferAlloc(&ntlm_v2_temp_chal, ntlm_v2_temp.cbBuffer + 8)) return -1; - blob = (BYTE*) ntlm_v2_temp_chal.pvBuffer; + blob = (BYTE*)ntlm_v2_temp_chal.pvBuffer; CopyMemory(blob, context->ServerChallenge, 8); CopyMemory(&blob[8], ntlm_v2_temp.pvBuffer, ntlm_v2_temp.cbBuffer); - winpr_HMAC(WINPR_MD_MD5, (BYTE*) context->NtlmV2Hash, WINPR_MD5_DIGEST_LENGTH, - (BYTE*) ntlm_v2_temp_chal.pvBuffer, ntlm_v2_temp_chal.cbBuffer, - (BYTE*) nt_proof_str, WINPR_MD5_DIGEST_LENGTH); + winpr_HMAC(WINPR_MD_MD5, (BYTE*)context->NtlmV2Hash, WINPR_MD5_DIGEST_LENGTH, + (BYTE*)ntlm_v2_temp_chal.pvBuffer, ntlm_v2_temp_chal.cbBuffer, (BYTE*)nt_proof_str, + WINPR_MD5_DIGEST_LENGTH); /* NtChallengeResponse, Concatenate NTProofStr with temp */ if (!sspi_SecBufferAlloc(&context->NtChallengeResponse, ntlm_v2_temp.cbBuffer + 16)) return -1; - blob = (BYTE*) context->NtChallengeResponse.pvBuffer; + blob = (BYTE*)context->NtChallengeResponse.pvBuffer; CopyMemory(blob, nt_proof_str, 16); CopyMemory(&blob[16], ntlm_v2_temp.pvBuffer, ntlm_v2_temp.cbBuffer); /* Compute SessionBaseKey, the HMAC-MD5 hash of NTProofStr using the NTLMv2 hash as the key */ - winpr_HMAC(WINPR_MD_MD5, (BYTE*) context->NtlmV2Hash, WINPR_MD5_DIGEST_LENGTH, - (BYTE*) nt_proof_str, WINPR_MD5_DIGEST_LENGTH, - (BYTE*) context->SessionBaseKey, WINPR_MD5_DIGEST_LENGTH); + winpr_HMAC(WINPR_MD_MD5, (BYTE*)context->NtlmV2Hash, WINPR_MD5_DIGEST_LENGTH, + (BYTE*)nt_proof_str, WINPR_MD5_DIGEST_LENGTH, (BYTE*)context->SessionBaseKey, + WINPR_MD5_DIGEST_LENGTH); sspi_SecBufferFree(&ntlm_v2_temp); sspi_SecBufferFree(&ntlm_v2_temp_chal); return 1; @@ -555,7 +553,8 @@ void ntlm_generate_exported_session_key(NTLM_CONTEXT* context) void ntlm_encrypt_random_session_key(NTLM_CONTEXT* context) { - /* In NTLMv2, EncryptedRandomSessionKey is the ExportedSessionKey RC4-encrypted with the KeyExchangeKey */ + /* In NTLMv2, EncryptedRandomSessionKey is the ExportedSessionKey RC4-encrypted with the + * KeyExchangeKey */ ntlm_rc4k(context->KeyExchangeKey, 16, context->RandomSessionKey, context->EncryptedRandomSessionKey); } @@ -567,13 +566,13 @@ void ntlm_encrypt_random_session_key(NTLM_CONTEXT* context) void ntlm_decrypt_random_session_key(NTLM_CONTEXT* context) { - /* In NTLMv2, EncryptedRandomSessionKey is the ExportedSessionKey RC4-encrypted with the KeyExchangeKey */ + /* In NTLMv2, EncryptedRandomSessionKey is the ExportedSessionKey RC4-encrypted with the + * KeyExchangeKey */ /** * if (NegotiateFlags & NTLMSSP_NEGOTIATE_KEY_EXCH) - * Set RandomSessionKey to RC4K(KeyExchangeKey, AUTHENTICATE_MESSAGE.EncryptedRandomSessionKey) - * else - * Set RandomSessionKey to KeyExchangeKey + * Set RandomSessionKey to RC4K(KeyExchangeKey, + * AUTHENTICATE_MESSAGE.EncryptedRandomSessionKey) else Set RandomSessionKey to KeyExchangeKey */ if (context->NegotiateKeyExchange) ntlm_rc4k(context->KeyExchangeKey, 16, context->EncryptedRandomSessionKey, @@ -595,7 +594,7 @@ int ntlm_generate_signing_key(BYTE* exported_session_key, PSecBuffer sign_magic, int length; BYTE* value; length = WINPR_MD5_DIGEST_LENGTH + sign_magic->cbBuffer; - value = (BYTE*) malloc(length); + value = (BYTE*)malloc(length); if (!value) return -1; @@ -623,7 +622,7 @@ int ntlm_generate_signing_key(BYTE* exported_session_key, PSecBuffer sign_magic, void ntlm_generate_client_signing_key(NTLM_CONTEXT* context) { SecBuffer signMagic; - signMagic.pvBuffer = (void*) NTLM_CLIENT_SIGN_MAGIC; + signMagic.pvBuffer = (void*)NTLM_CLIENT_SIGN_MAGIC; signMagic.cbBuffer = sizeof(NTLM_CLIENT_SIGN_MAGIC); ntlm_generate_signing_key(context->ExportedSessionKey, &signMagic, context->ClientSigningKey); } @@ -637,7 +636,7 @@ void ntlm_generate_client_signing_key(NTLM_CONTEXT* context) void ntlm_generate_server_signing_key(NTLM_CONTEXT* context) { SecBuffer signMagic; - signMagic.pvBuffer = (void*) NTLM_SERVER_SIGN_MAGIC; + signMagic.pvBuffer = (void*)NTLM_SERVER_SIGN_MAGIC; signMagic.cbBuffer = sizeof(NTLM_SERVER_SIGN_MAGIC); ntlm_generate_signing_key(context->ExportedSessionKey, &signMagic, context->ServerSigningKey); } @@ -658,7 +657,7 @@ int ntlm_generate_sealing_key(BYTE* exported_session_key, PSecBuffer seal_magic, if (!sspi_SecBufferAlloc(&buffer, WINPR_MD5_DIGEST_LENGTH + seal_magic->cbBuffer)) return -1; - p = (BYTE*) buffer.pvBuffer; + p = (BYTE*)buffer.pvBuffer; /* Concatenate ExportedSessionKey with seal magic */ CopyMemory(p, exported_session_key, WINPR_MD5_DIGEST_LENGTH); CopyMemory(&p[WINPR_MD5_DIGEST_LENGTH], seal_magic->pvBuffer, seal_magic->cbBuffer); @@ -683,7 +682,7 @@ int ntlm_generate_sealing_key(BYTE* exported_session_key, PSecBuffer seal_magic, void ntlm_generate_client_sealing_key(NTLM_CONTEXT* context) { SecBuffer sealMagic; - sealMagic.pvBuffer = (void*) NTLM_CLIENT_SEAL_MAGIC; + sealMagic.pvBuffer = (void*)NTLM_CLIENT_SEAL_MAGIC; sealMagic.cbBuffer = sizeof(NTLM_CLIENT_SEAL_MAGIC); ntlm_generate_signing_key(context->ExportedSessionKey, &sealMagic, context->ClientSealingKey); } @@ -697,7 +696,7 @@ void ntlm_generate_client_sealing_key(NTLM_CONTEXT* context) void ntlm_generate_server_sealing_key(NTLM_CONTEXT* context) { SecBuffer sealMagic; - sealMagic.pvBuffer = (void*) NTLM_SERVER_SEAL_MAGIC; + sealMagic.pvBuffer = (void*)NTLM_SERVER_SEAL_MAGIC; sealMagic.cbBuffer = sizeof(NTLM_SERVER_SEAL_MAGIC); ntlm_generate_signing_key(context->ExportedSessionKey, &sealMagic, context->ServerSealingKey); } @@ -743,11 +742,11 @@ void ntlm_compute_message_integrity_check(NTLM_CONTEXT* context, BYTE* mic, UINT if (winpr_HMAC_Init(hmac, WINPR_MD_MD5, context->ExportedSessionKey, WINPR_MD5_DIGEST_LENGTH)) { - winpr_HMAC_Update(hmac, (BYTE*) context->NegotiateMessage.pvBuffer, + winpr_HMAC_Update(hmac, (BYTE*)context->NegotiateMessage.pvBuffer, context->NegotiateMessage.cbBuffer); - winpr_HMAC_Update(hmac, (BYTE*) context->ChallengeMessage.pvBuffer, + winpr_HMAC_Update(hmac, (BYTE*)context->ChallengeMessage.pvBuffer, context->ChallengeMessage.cbBuffer); - winpr_HMAC_Update(hmac, (BYTE*) context->AuthenticateMessage.pvBuffer, + winpr_HMAC_Update(hmac, (BYTE*)context->AuthenticateMessage.pvBuffer, context->AuthenticateMessage.cbBuffer); winpr_HMAC_Final(hmac, mic, WINPR_MD5_DIGEST_LENGTH); } diff --git a/winpr/libwinpr/sspi/NTLM/ntlm_message.c b/winpr/libwinpr/sspi/NTLM/ntlm_message.c index 68ed9f77b..4ed6f33e1 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm_message.c +++ b/winpr/libwinpr/sspi/NTLM/ntlm_message.c @@ -38,47 +38,44 @@ static const char NTLM_SIGNATURE[8] = { 'N', 'T', 'L', 'M', 'S', 'S', 'P', '\0' }; -static const char* const NTLM_NEGOTIATE_STRINGS[] = -{ - "NTLMSSP_NEGOTIATE_56", - "NTLMSSP_NEGOTIATE_KEY_EXCH", - "NTLMSSP_NEGOTIATE_128", - "NTLMSSP_RESERVED1", - "NTLMSSP_RESERVED2", - "NTLMSSP_RESERVED3", - "NTLMSSP_NEGOTIATE_VERSION", - "NTLMSSP_RESERVED4", - "NTLMSSP_NEGOTIATE_TARGET_INFO", - "NTLMSSP_REQUEST_NON_NT_SESSION_KEY", - "NTLMSSP_RESERVED5", - "NTLMSSP_NEGOTIATE_IDENTIFY", - "NTLMSSP_NEGOTIATE_EXTENDED_SESSION_SECURITY", - "NTLMSSP_RESERVED6", - "NTLMSSP_TARGET_TYPE_SERVER", - "NTLMSSP_TARGET_TYPE_DOMAIN", - "NTLMSSP_NEGOTIATE_ALWAYS_SIGN", - "NTLMSSP_RESERVED7", - "NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED", - "NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED", - "NTLMSSP_NEGOTIATE_ANONYMOUS", - "NTLMSSP_RESERVED8", - "NTLMSSP_NEGOTIATE_NTLM", - "NTLMSSP_RESERVED9", - "NTLMSSP_NEGOTIATE_LM_KEY", - "NTLMSSP_NEGOTIATE_DATAGRAM", - "NTLMSSP_NEGOTIATE_SEAL", - "NTLMSSP_NEGOTIATE_SIGN", - "NTLMSSP_RESERVED10", - "NTLMSSP_REQUEST_TARGET", - "NTLMSSP_NEGOTIATE_OEM", - "NTLMSSP_NEGOTIATE_UNICODE" -}; +static const char* const NTLM_NEGOTIATE_STRINGS[] = { "NTLMSSP_NEGOTIATE_56", + "NTLMSSP_NEGOTIATE_KEY_EXCH", + "NTLMSSP_NEGOTIATE_128", + "NTLMSSP_RESERVED1", + "NTLMSSP_RESERVED2", + "NTLMSSP_RESERVED3", + "NTLMSSP_NEGOTIATE_VERSION", + "NTLMSSP_RESERVED4", + "NTLMSSP_NEGOTIATE_TARGET_INFO", + "NTLMSSP_REQUEST_NON_NT_SESSION_KEY", + "NTLMSSP_RESERVED5", + "NTLMSSP_NEGOTIATE_IDENTIFY", + "NTLMSSP_NEGOTIATE_EXTENDED_SESSION_SECURITY", + "NTLMSSP_RESERVED6", + "NTLMSSP_TARGET_TYPE_SERVER", + "NTLMSSP_TARGET_TYPE_DOMAIN", + "NTLMSSP_NEGOTIATE_ALWAYS_SIGN", + "NTLMSSP_RESERVED7", + "NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED", + "NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED", + "NTLMSSP_NEGOTIATE_ANONYMOUS", + "NTLMSSP_RESERVED8", + "NTLMSSP_NEGOTIATE_NTLM", + "NTLMSSP_RESERVED9", + "NTLMSSP_NEGOTIATE_LM_KEY", + "NTLMSSP_NEGOTIATE_DATAGRAM", + "NTLMSSP_NEGOTIATE_SEAL", + "NTLMSSP_NEGOTIATE_SIGN", + "NTLMSSP_RESERVED10", + "NTLMSSP_REQUEST_TARGET", + "NTLMSSP_NEGOTIATE_OEM", + "NTLMSSP_NEGOTIATE_UNICODE" }; static void ntlm_print_negotiate_flags(UINT32 flags) { int i; const char* str; - WLog_INFO(TAG, "negotiateFlags \"0x%08"PRIX32"\"", flags); + WLog_INFO(TAG, "negotiateFlags \"0x%08" PRIX32 "\"", flags); for (i = 31; i >= 0; i--) { @@ -98,7 +95,7 @@ static int ntlm_read_message_header(wStream* s, NTLM_MESSAGE_HEADER* header) Stream_Read(s, header->Signature, 8); Stream_Read_UINT32(s, header->MessageType); - if (strncmp((char*) header->Signature, NTLM_SIGNATURE, 8) != 0) + if (strncmp((char*)header->Signature, NTLM_SIGNATURE, 8) != 0) return -1; return 1; @@ -121,8 +118,8 @@ static int ntlm_read_message_fields(wStream* s, NTLM_MESSAGE_FIELDS* fields) if (Stream_GetRemainingLength(s) < 8) return -1; - Stream_Read_UINT16(s, fields->Len); /* Len (2 bytes) */ - Stream_Read_UINT16(s, fields->MaxLen); /* MaxLen (2 bytes) */ + Stream_Read_UINT16(s, fields->Len); /* Len (2 bytes) */ + Stream_Read_UINT16(s, fields->MaxLen); /* MaxLen (2 bytes) */ Stream_Read_UINT32(s, fields->BufferOffset); /* BufferOffset (4 bytes) */ return 1; } @@ -132,8 +129,8 @@ static void ntlm_write_message_fields(wStream* s, NTLM_MESSAGE_FIELDS* fields) if (fields->MaxLen < 1) fields->MaxLen = fields->Len; - Stream_Write_UINT16(s, fields->Len); /* Len (2 bytes) */ - Stream_Write_UINT16(s, fields->MaxLen); /* MaxLen (2 bytes) */ + Stream_Write_UINT16(s, fields->Len); /* Len (2 bytes) */ + Stream_Write_UINT16(s, fields->MaxLen); /* MaxLen (2 bytes) */ Stream_Write_UINT32(s, fields->BufferOffset); /* BufferOffset (4 bytes) */ } @@ -149,7 +146,7 @@ static int ntlm_read_message_fields_buffer(wStream* s, NTLM_MESSAGE_FIELDS* fiel if (offset > Stream_Length(s)) return -1; - fields->Buffer = (PBYTE) malloc(fields->Len); + fields->Buffer = (PBYTE)malloc(fields->Len); if (!fields->Buffer) return -1; @@ -188,8 +185,8 @@ static void ntlm_free_message_fields_buffer(NTLM_MESSAGE_FIELDS* fields) #ifdef WITH_DEBUG_NTLM static void ntlm_print_message_fields(NTLM_MESSAGE_FIELDS* fields, const char* name) { - WLog_DBG(TAG, "%s (Len: %"PRIu16" MaxLen: %"PRIu16" BufferOffset: %"PRIu32")", - name, fields->Len, fields->MaxLen, fields->BufferOffset); + WLog_DBG(TAG, "%s (Len: %" PRIu16 " MaxLen: %" PRIu16 " BufferOffset: %" PRIu32 ")", name, + fields->Len, fields->MaxLen, fields->BufferOffset); if (fields->Len > 0) winpr_HexDump(TAG, WLOG_DEBUG, fields->Buffer, fields->Len); @@ -203,12 +200,12 @@ SECURITY_STATUS ntlm_read_NegotiateMessage(NTLM_CONTEXT* context, PSecBuffer buf NTLM_NEGOTIATE_MESSAGE* message; message = &context->NEGOTIATE_MESSAGE; ZeroMemory(message, sizeof(NTLM_NEGOTIATE_MESSAGE)); - s = Stream_New((BYTE*) buffer->pvBuffer, buffer->cbBuffer); + s = Stream_New((BYTE*)buffer->pvBuffer, buffer->cbBuffer); if (!s) return SEC_E_INTERNAL_ERROR; - if (ntlm_read_message_header(s, (NTLM_MESSAGE_HEADER*) message) < 0) + if (ntlm_read_message_header(s, (NTLM_MESSAGE_HEADER*)message) < 0) { Stream_Free(s, FALSE); return SEC_E_INVALID_TOKEN; @@ -269,7 +266,7 @@ SECURITY_STATUS ntlm_read_NegotiateMessage(NTLM_CONTEXT* context, PSecBuffer buf CopyMemory(context->NegotiateMessage.pvBuffer, buffer->pvBuffer, buffer->cbBuffer); context->NegotiateMessage.BufferType = buffer->BufferType; #ifdef WITH_DEBUG_NTLM - WLog_DBG(TAG, "NEGOTIATE_MESSAGE (length = %"PRIu32")", context->NegotiateMessage.cbBuffer); + WLog_DBG(TAG, "NEGOTIATE_MESSAGE (length = %" PRIu32 ")", context->NegotiateMessage.cbBuffer); winpr_HexDump(TAG, WLOG_DEBUG, context->NegotiateMessage.pvBuffer, context->NegotiateMessage.cbBuffer); ntlm_print_negotiate_flags(message->NegotiateFlags); @@ -290,12 +287,12 @@ SECURITY_STATUS ntlm_write_NegotiateMessage(NTLM_CONTEXT* context, PSecBuffer bu NTLM_NEGOTIATE_MESSAGE* message; message = &context->NEGOTIATE_MESSAGE; ZeroMemory(message, sizeof(NTLM_NEGOTIATE_MESSAGE)); - s = Stream_New((BYTE*) buffer->pvBuffer, buffer->cbBuffer); + s = Stream_New((BYTE*)buffer->pvBuffer, buffer->cbBuffer); if (!s) return SEC_E_INTERNAL_ERROR; - ntlm_populate_message_header((NTLM_MESSAGE_HEADER*) message, MESSAGE_TYPE_NEGOTIATE); + ntlm_populate_message_header((NTLM_MESSAGE_HEADER*)message, MESSAGE_TYPE_NEGOTIATE); if (context->NTLMv2) { @@ -325,7 +322,7 @@ SECURITY_STATUS ntlm_write_NegotiateMessage(NTLM_CONTEXT* context, PSecBuffer bu context->NegotiateFlags = message->NegotiateFlags; /* Message Header (12 bytes) */ - ntlm_write_message_header(s, (NTLM_MESSAGE_HEADER*) message); + ntlm_write_message_header(s, (NTLM_MESSAGE_HEADER*)message); Stream_Write_UINT32(s, message->NegotiateFlags); /* NegotiateFlags (4 bytes) */ /* only set if NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED is set */ /* DomainNameFields (8 bytes) */ @@ -372,14 +369,14 @@ SECURITY_STATUS ntlm_read_ChallengeMessage(NTLM_CONTEXT* context, PSecBuffer buf ntlm_generate_client_challenge(context); message = &context->CHALLENGE_MESSAGE; ZeroMemory(message, sizeof(NTLM_CHALLENGE_MESSAGE)); - s = Stream_New((BYTE*) buffer->pvBuffer, buffer->cbBuffer); + s = Stream_New((BYTE*)buffer->pvBuffer, buffer->cbBuffer); if (!s) return SEC_E_INTERNAL_ERROR; StartOffset = Stream_Pointer(s); - if (ntlm_read_message_header(s, (NTLM_MESSAGE_HEADER*) message) < 0) + if (ntlm_read_message_header(s, (NTLM_MESSAGE_HEADER*)message) < 0) { Stream_Free(s, FALSE); return SEC_E_INVALID_TOKEN; @@ -463,8 +460,7 @@ SECURITY_STATUS ntlm_read_ChallengeMessage(NTLM_CONTEXT* context, PSecBuffer buf context->ChallengeTargetInfo.pvBuffer = message->TargetInfo.Buffer; context->ChallengeTargetInfo.cbBuffer = message->TargetInfo.Len; AvTimestamp = ntlm_av_pair_get((NTLM_AV_PAIR*)message->TargetInfo.Buffer, - message->TargetInfo.Len, - MsvAvTimestamp, &cbAvTimestamp); + message->TargetInfo.Len, MsvAvTimestamp, &cbAvTimestamp); if (AvTimestamp) { @@ -503,7 +499,7 @@ SECURITY_STATUS ntlm_read_ChallengeMessage(NTLM_CONTEXT* context, PSecBuffer buf if (context->ChallengeTargetInfo.cbBuffer > 0) { - WLog_DBG(TAG, "ChallengeTargetInfo (%"PRIu32"):", context->ChallengeTargetInfo.cbBuffer); + WLog_DBG(TAG, "ChallengeTargetInfo (%" PRIu32 "):", context->ChallengeTargetInfo.cbBuffer); ntlm_print_av_pair_list(context->ChallengeTargetInfo.pvBuffer, context->ChallengeTargetInfo.cbBuffer); } @@ -538,10 +534,10 @@ SECURITY_STATUS ntlm_read_ChallengeMessage(NTLM_CONTEXT* context, PSecBuffer buf return SEC_E_INTERNAL_ERROR; } - ntlm_generate_key_exchange_key(context); /* KeyExchangeKey */ - ntlm_generate_random_session_key(context); /* RandomSessionKey */ + ntlm_generate_key_exchange_key(context); /* KeyExchangeKey */ + ntlm_generate_random_session_key(context); /* RandomSessionKey */ ntlm_generate_exported_session_key(context); /* ExportedSessionKey */ - ntlm_encrypt_random_session_key(context); /* EncryptedRandomSessionKey */ + ntlm_encrypt_random_session_key(context); /* EncryptedRandomSessionKey */ /* Generate signing keys */ ntlm_generate_client_signing_key(context); ntlm_generate_server_signing_key(context); @@ -588,14 +584,14 @@ SECURITY_STATUS ntlm_write_ChallengeMessage(NTLM_CONTEXT* context, PSecBuffer bu NTLM_CHALLENGE_MESSAGE* message; message = &context->CHALLENGE_MESSAGE; ZeroMemory(message, sizeof(NTLM_CHALLENGE_MESSAGE)); - s = Stream_New((BYTE*) buffer->pvBuffer, buffer->cbBuffer); + s = Stream_New((BYTE*)buffer->pvBuffer, buffer->cbBuffer); if (!s) return SEC_E_INTERNAL_ERROR; ntlm_get_version_info(&(message->Version)); /* Version */ - ntlm_generate_server_challenge(context); /* Server Challenge */ - ntlm_generate_timestamp(context); /* Timestamp */ + ntlm_generate_server_challenge(context); /* Server Challenge */ + ntlm_generate_timestamp(context); /* Timestamp */ if (ntlm_construct_challenge_target_info(context) < 0) /* TargetInfo */ { @@ -605,22 +601,22 @@ SECURITY_STATUS ntlm_write_ChallengeMessage(NTLM_CONTEXT* context, PSecBuffer bu CopyMemory(message->ServerChallenge, context->ServerChallenge, 8); /* ServerChallenge */ message->NegotiateFlags = context->NegotiateFlags; - ntlm_populate_message_header((NTLM_MESSAGE_HEADER*) message, MESSAGE_TYPE_CHALLENGE); + ntlm_populate_message_header((NTLM_MESSAGE_HEADER*)message, MESSAGE_TYPE_CHALLENGE); /* Message Header (12 bytes) */ - ntlm_write_message_header(s, (NTLM_MESSAGE_HEADER*) message); + ntlm_write_message_header(s, (NTLM_MESSAGE_HEADER*)message); if (message->NegotiateFlags & NTLMSSP_REQUEST_TARGET) { - message->TargetName.Len = (UINT16) context->TargetName.cbBuffer; - message->TargetName.Buffer = (PBYTE) context->TargetName.pvBuffer; + message->TargetName.Len = (UINT16)context->TargetName.cbBuffer; + message->TargetName.Buffer = (PBYTE)context->TargetName.pvBuffer; } message->NegotiateFlags |= NTLMSSP_NEGOTIATE_TARGET_INFO; if (message->NegotiateFlags & NTLMSSP_NEGOTIATE_TARGET_INFO) { - message->TargetInfo.Len = (UINT16) context->ChallengeTargetInfo.cbBuffer; - message->TargetInfo.Buffer = (PBYTE) context->ChallengeTargetInfo.pvBuffer; + message->TargetInfo.Len = (UINT16)context->ChallengeTargetInfo.cbBuffer; + message->TargetInfo.Buffer = (PBYTE)context->ChallengeTargetInfo.pvBuffer; } PayloadOffset = 48; @@ -633,8 +629,8 @@ SECURITY_STATUS ntlm_write_ChallengeMessage(NTLM_CONTEXT* context, PSecBuffer bu /* TargetNameFields (8 bytes) */ ntlm_write_message_fields(s, &(message->TargetName)); Stream_Write_UINT32(s, message->NegotiateFlags); /* NegotiateFlags (4 bytes) */ - Stream_Write(s, message->ServerChallenge, 8); /* ServerChallenge (8 bytes) */ - Stream_Write(s, message->Reserved, 8); /* Reserved (8 bytes), should be ignored */ + Stream_Write(s, message->ServerChallenge, 8); /* ServerChallenge (8 bytes) */ + Stream_Write(s, message->Reserved, 8); /* Reserved (8 bytes), should be ignored */ /* TargetInfoFields (8 bytes) */ ntlm_write_message_fields(s, &(message->TargetInfo)); @@ -689,12 +685,12 @@ SECURITY_STATUS ntlm_read_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer AvFlags = NULL; message = &context->AUTHENTICATE_MESSAGE; ZeroMemory(message, sizeof(NTLM_AUTHENTICATE_MESSAGE)); - s = Stream_New((BYTE*) buffer->pvBuffer, buffer->cbBuffer); + s = Stream_New((BYTE*)buffer->pvBuffer, buffer->cbBuffer); if (!s) return SEC_E_INTERNAL_ERROR; - if (ntlm_read_message_header(s, (NTLM_MESSAGE_HEADER*) message) < 0) + if (ntlm_read_message_header(s, (NTLM_MESSAGE_HEADER*)message) < 0) { Stream_Free(s, FALSE); return SEC_E_INVALID_TOKEN; @@ -706,15 +702,15 @@ SECURITY_STATUS ntlm_read_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer return SEC_E_INVALID_TOKEN; } - if (ntlm_read_message_fields(s, - &(message->LmChallengeResponse)) < 0) /* LmChallengeResponseFields (8 bytes) */ + if (ntlm_read_message_fields(s, &(message->LmChallengeResponse)) < + 0) /* LmChallengeResponseFields (8 bytes) */ { Stream_Free(s, FALSE); return SEC_E_INVALID_TOKEN; } - if (ntlm_read_message_fields(s, - &(message->NtChallengeResponse)) < 0) /* NtChallengeResponseFields (8 bytes) */ + if (ntlm_read_message_fields(s, &(message->NtChallengeResponse)) < + 0) /* NtChallengeResponseFields (8 bytes) */ { Stream_Free(s, FALSE); return SEC_E_INVALID_TOKEN; @@ -738,16 +734,16 @@ SECURITY_STATUS ntlm_read_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer return SEC_E_INVALID_TOKEN; } - if (ntlm_read_message_fields(s, - &(message->EncryptedRandomSessionKey)) < 0) /* EncryptedRandomSessionKeyFields (8 bytes) */ + if (ntlm_read_message_fields(s, &(message->EncryptedRandomSessionKey)) < + 0) /* EncryptedRandomSessionKeyFields (8 bytes) */ { Stream_Free(s, FALSE); return SEC_E_INVALID_TOKEN; } Stream_Read_UINT32(s, message->NegotiateFlags); /* NegotiateFlags (4 bytes) */ - context->NegotiateKeyExchange = (message->NegotiateFlags & NTLMSSP_NEGOTIATE_KEY_EXCH) ? TRUE : - FALSE; + context->NegotiateKeyExchange = + (message->NegotiateFlags & NTLMSSP_NEGOTIATE_KEY_EXCH) ? TRUE : FALSE; if ((context->NegotiateKeyExchange && !message->EncryptedRandomSessionKey.Len) || (!context->NegotiateKeyExchange && message->EncryptedRandomSessionKey.Len)) @@ -785,15 +781,15 @@ SECURITY_STATUS ntlm_read_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer return SEC_E_INTERNAL_ERROR; } - if (ntlm_read_message_fields_buffer(s, - &(message->LmChallengeResponse)) < 0) /* LmChallengeResponse */ + if (ntlm_read_message_fields_buffer(s, &(message->LmChallengeResponse)) < + 0) /* LmChallengeResponse */ { Stream_Free(s, FALSE); return SEC_E_INTERNAL_ERROR; } - if (ntlm_read_message_fields_buffer(s, - &(message->NtChallengeResponse)) < 0) /* NtChallengeResponse */ + if (ntlm_read_message_fields_buffer(s, &(message->NtChallengeResponse)) < + 0) /* NtChallengeResponse */ { Stream_Free(s, FALSE); return SEC_E_INTERNAL_ERROR; @@ -802,7 +798,8 @@ SECURITY_STATUS ntlm_read_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer if (message->NtChallengeResponse.Len > 0) { size_t cbAvFlags; - wStream* snt = Stream_New(message->NtChallengeResponse.Buffer, message->NtChallengeResponse.Len); + wStream* snt = + Stream_New(message->NtChallengeResponse.Buffer, message->NtChallengeResponse.Len); if (!snt) { @@ -821,19 +818,19 @@ SECURITY_STATUS ntlm_read_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer context->NtChallengeResponse.pvBuffer = message->NtChallengeResponse.Buffer; context->NtChallengeResponse.cbBuffer = message->NtChallengeResponse.Len; sspi_SecBufferFree(&(context->ChallengeTargetInfo)); - context->ChallengeTargetInfo.pvBuffer = (void*) context->NTLMv2Response.Challenge.AvPairs; + context->ChallengeTargetInfo.pvBuffer = (void*)context->NTLMv2Response.Challenge.AvPairs; context->ChallengeTargetInfo.cbBuffer = message->NtChallengeResponse.Len - (28 + 16); CopyMemory(context->ClientChallenge, context->NTLMv2Response.Challenge.ClientChallenge, 8); - AvFlags = ntlm_av_pair_get(context->NTLMv2Response.Challenge.AvPairs, - context->NTLMv2Response.Challenge.cbAvPairs, - MsvAvFlags, &cbAvFlags); + AvFlags = + ntlm_av_pair_get(context->NTLMv2Response.Challenge.AvPairs, + context->NTLMv2Response.Challenge.cbAvPairs, MsvAvFlags, &cbAvFlags); if (AvFlags) Data_Read_UINT32(ntlm_av_pair_get_value_pointer(AvFlags), flags); } - if (ntlm_read_message_fields_buffer(s, - &(message->EncryptedRandomSessionKey)) < 0) /* EncryptedRandomSessionKey */ + if (ntlm_read_message_fields_buffer(s, &(message->EncryptedRandomSessionKey)) < + 0) /* EncryptedRandomSessionKey */ { Stream_Free(s, FALSE); return SEC_E_INTERNAL_ERROR; @@ -847,7 +844,8 @@ SECURITY_STATUS ntlm_read_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer return SEC_E_INVALID_TOKEN; } - CopyMemory(context->EncryptedRandomSessionKey, message->EncryptedRandomSessionKey.Buffer, 16); + CopyMemory(context->EncryptedRandomSessionKey, message->EncryptedRandomSessionKey.Buffer, + 16); } length = Stream_GetPosition(s); @@ -864,7 +862,7 @@ SECURITY_STATUS ntlm_read_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer if (flags & MSV_AV_FLAGS_MESSAGE_INTEGRITY_CHECK) { - context->MessageIntegrityCheckOffset = (UINT32) Stream_GetPosition(s); + context->MessageIntegrityCheckOffset = (UINT32)Stream_GetPosition(s); if (Stream_GetRemainingLength(s) < 16) { @@ -876,7 +874,8 @@ SECURITY_STATUS ntlm_read_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer } #ifdef WITH_DEBUG_NTLM - WLog_DBG(TAG, "AUTHENTICATE_MESSAGE (length = %"PRIu32")", context->AuthenticateMessage.cbBuffer); + WLog_DBG(TAG, "AUTHENTICATE_MESSAGE (length = %" PRIu32 ")", + context->AuthenticateMessage.cbBuffer); winpr_HexDump(TAG, WLOG_DEBUG, context->AuthenticateMessage.pvBuffer, context->AuthenticateMessage.cbBuffer); @@ -902,7 +901,7 @@ SECURITY_STATUS ntlm_read_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer if (message->UserName.Len > 0) { - credentials->identity.User = (UINT16*) malloc(message->UserName.Len); + credentials->identity.User = (UINT16*)malloc(message->UserName.Len); if (!credentials->identity.User) { @@ -916,7 +915,7 @@ SECURITY_STATUS ntlm_read_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer if (message->DomainName.Len > 0) { - credentials->identity.Domain = (UINT16*) malloc(message->DomainName.Len); + credentials->identity.Domain = (UINT16*)malloc(message->DomainName.Len); if (!credentials->identity.Domain) { @@ -924,7 +923,8 @@ SECURITY_STATUS ntlm_read_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer return SEC_E_INTERNAL_ERROR; } - CopyMemory(credentials->identity.Domain, message->DomainName.Buffer, message->DomainName.Len); + CopyMemory(credentials->identity.Domain, message->DomainName.Buffer, + message->DomainName.Len); credentials->identity.DomainLength = message->DomainName.Len / 2; } @@ -950,7 +950,7 @@ SECURITY_STATUS ntlm_write_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer SSPI_CREDENTIALS* credentials = context->credentials; message = &context->AUTHENTICATE_MESSAGE; ZeroMemory(message, sizeof(NTLM_AUTHENTICATE_MESSAGE)); - s = Stream_New((BYTE*) buffer->pvBuffer, buffer->cbBuffer); + s = Stream_New((BYTE*)buffer->pvBuffer, buffer->cbBuffer); if (!s) return SEC_E_INTERNAL_ERROR; @@ -989,22 +989,22 @@ SECURITY_STATUS ntlm_write_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer if (message->NegotiateFlags & NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED) { message->Workstation.Len = context->Workstation.Length; - message->Workstation.Buffer = (BYTE*) context->Workstation.Buffer; + message->Workstation.Buffer = (BYTE*)context->Workstation.Buffer; } if (credentials->identity.DomainLength > 0) { message->NegotiateFlags |= NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED; - message->DomainName.Len = (UINT16) credentials->identity.DomainLength * 2; - message->DomainName.Buffer = (BYTE*) credentials->identity.Domain; + message->DomainName.Len = (UINT16)credentials->identity.DomainLength * 2; + message->DomainName.Buffer = (BYTE*)credentials->identity.Domain; } - message->UserName.Len = (UINT16) credentials->identity.UserLength * 2; - message->UserName.Buffer = (BYTE*) credentials->identity.User; - message->LmChallengeResponse.Len = (UINT16) context->LmChallengeResponse.cbBuffer; - message->LmChallengeResponse.Buffer = (BYTE*) context->LmChallengeResponse.pvBuffer; - message->NtChallengeResponse.Len = (UINT16) context->NtChallengeResponse.cbBuffer; - message->NtChallengeResponse.Buffer = (BYTE*) context->NtChallengeResponse.pvBuffer; + message->UserName.Len = (UINT16)credentials->identity.UserLength * 2; + message->UserName.Buffer = (BYTE*)credentials->identity.User; + message->LmChallengeResponse.Len = (UINT16)context->LmChallengeResponse.cbBuffer; + message->LmChallengeResponse.Buffer = (BYTE*)context->LmChallengeResponse.pvBuffer; + message->NtChallengeResponse.Len = (UINT16)context->NtChallengeResponse.cbBuffer; + message->NtChallengeResponse.Buffer = (BYTE*)context->NtChallengeResponse.pvBuffer; if (message->NegotiateFlags & NTLMSSP_NEGOTIATE_KEY_EXCH) { @@ -1023,23 +1023,23 @@ SECURITY_STATUS ntlm_write_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer message->DomainName.BufferOffset = PayloadBufferOffset; message->UserName.BufferOffset = message->DomainName.BufferOffset + message->DomainName.Len; message->Workstation.BufferOffset = message->UserName.BufferOffset + message->UserName.Len; - message->LmChallengeResponse.BufferOffset = message->Workstation.BufferOffset + - message->Workstation.Len; - message->NtChallengeResponse.BufferOffset = message->LmChallengeResponse.BufferOffset + - message->LmChallengeResponse.Len; - message->EncryptedRandomSessionKey.BufferOffset = message->NtChallengeResponse.BufferOffset + - message->NtChallengeResponse.Len; - ntlm_populate_message_header((NTLM_MESSAGE_HEADER*) message, MESSAGE_TYPE_AUTHENTICATE); - ntlm_write_message_header(s, (NTLM_MESSAGE_HEADER*) message); /* Message Header (12 bytes) */ - ntlm_write_message_fields(s, & - (message->LmChallengeResponse)); /* LmChallengeResponseFields (8 bytes) */ - ntlm_write_message_fields(s, & - (message->NtChallengeResponse)); /* NtChallengeResponseFields (8 bytes) */ - ntlm_write_message_fields(s, &(message->DomainName)); /* DomainNameFields (8 bytes) */ - ntlm_write_message_fields(s, &(message->UserName)); /* UserNameFields (8 bytes) */ + message->LmChallengeResponse.BufferOffset = + message->Workstation.BufferOffset + message->Workstation.Len; + message->NtChallengeResponse.BufferOffset = + message->LmChallengeResponse.BufferOffset + message->LmChallengeResponse.Len; + message->EncryptedRandomSessionKey.BufferOffset = + message->NtChallengeResponse.BufferOffset + message->NtChallengeResponse.Len; + ntlm_populate_message_header((NTLM_MESSAGE_HEADER*)message, MESSAGE_TYPE_AUTHENTICATE); + ntlm_write_message_header(s, (NTLM_MESSAGE_HEADER*)message); /* Message Header (12 bytes) */ + ntlm_write_message_fields( + s, &(message->LmChallengeResponse)); /* LmChallengeResponseFields (8 bytes) */ + ntlm_write_message_fields( + s, &(message->NtChallengeResponse)); /* NtChallengeResponseFields (8 bytes) */ + ntlm_write_message_fields(s, &(message->DomainName)); /* DomainNameFields (8 bytes) */ + ntlm_write_message_fields(s, &(message->UserName)); /* UserNameFields (8 bytes) */ ntlm_write_message_fields(s, &(message->Workstation)); /* WorkstationFields (8 bytes) */ - ntlm_write_message_fields(s, & - (message->EncryptedRandomSessionKey)); /* EncryptedRandomSessionKeyFields (8 bytes) */ + ntlm_write_message_fields( + s, &(message->EncryptedRandomSessionKey)); /* EncryptedRandomSessionKeyFields (8 bytes) */ Stream_Write_UINT32(s, message->NegotiateFlags); /* NegotiateFlags (4 bytes) */ if (message->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION) @@ -1047,7 +1047,7 @@ SECURITY_STATUS ntlm_write_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer if (context->UseMIC) { - context->MessageIntegrityCheckOffset = (UINT32) Stream_GetPosition(s); + context->MessageIntegrityCheckOffset = (UINT32)Stream_GetPosition(s); Stream_Zero(s, 16); /* Message Integrity Check (16 bytes) */ } @@ -1063,8 +1063,8 @@ SECURITY_STATUS ntlm_write_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer ntlm_write_message_fields_buffer(s, &(message->NtChallengeResponse)); /* NtChallengeResponse */ if (message->NegotiateFlags & NTLMSSP_NEGOTIATE_KEY_EXCH) - ntlm_write_message_fields_buffer(s, - &(message->EncryptedRandomSessionKey)); /* EncryptedRandomSessionKey */ + ntlm_write_message_fields_buffer( + s, &(message->EncryptedRandomSessionKey)); /* EncryptedRandomSessionKey */ length = Stream_GetPosition(s); @@ -1096,7 +1096,8 @@ SECURITY_STATUS ntlm_write_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer if (context->AuthenticateTargetInfo.cbBuffer > 0) { - WLog_DBG(TAG, "AuthenticateTargetInfo (%"PRIu32"):", context->AuthenticateTargetInfo.cbBuffer); + WLog_DBG(TAG, + "AuthenticateTargetInfo (%" PRIu32 "):", context->AuthenticateTargetInfo.cbBuffer); ntlm_print_av_pair_list(context->AuthenticateTargetInfo.pvBuffer, context->AuthenticateTargetInfo.cbBuffer); } @@ -1136,8 +1137,7 @@ SECURITY_STATUS ntlm_server_AuthenticateComplete(NTLM_CONTEXT* context) message = &context->AUTHENTICATE_MESSAGE; AvFlags = ntlm_av_pair_get(context->NTLMv2Response.Challenge.AvPairs, - context->NTLMv2Response.Challenge.cbAvPairs, - MsvAvFlags, &cbAvFlags); + context->NTLMv2Response.Challenge.cbAvPairs, MsvAvFlags, &cbAvFlags); if (AvFlags) Data_Read_UINT32(ntlm_av_pair_get_value_pointer(AvFlags), flags); @@ -1157,11 +1157,14 @@ SECURITY_STATUS ntlm_server_AuthenticateComplete(NTLM_CONTEXT* context) if (flags & MSV_AV_FLAGS_MESSAGE_INTEGRITY_CHECK) { - ZeroMemory(&((PBYTE) context->AuthenticateMessage.pvBuffer)[context->MessageIntegrityCheckOffset], - 16); - ntlm_compute_message_integrity_check(context, messageIntegrityCheck, sizeof(messageIntegrityCheck)); - CopyMemory(&((PBYTE) context->AuthenticateMessage.pvBuffer)[context->MessageIntegrityCheckOffset], - message->MessageIntegrityCheck, 16); + ZeroMemory( + &((PBYTE)context->AuthenticateMessage.pvBuffer)[context->MessageIntegrityCheckOffset], + 16); + ntlm_compute_message_integrity_check(context, messageIntegrityCheck, + sizeof(messageIntegrityCheck)); + CopyMemory( + &((PBYTE)context->AuthenticateMessage.pvBuffer)[context->MessageIntegrityCheckOffset], + message->MessageIntegrityCheck, 16); if (memcmp(messageIntegrityCheck, message->MessageIntegrityCheck, 16) != 0) { diff --git a/winpr/libwinpr/sspi/Negotiate/negotiate.c b/winpr/libwinpr/sspi/Negotiate/negotiate.c index ff5288082..3a9990bb8 100644 --- a/winpr/libwinpr/sspi/Negotiate/negotiate.c +++ b/winpr/libwinpr/sspi/Negotiate/negotiate.c @@ -44,32 +44,27 @@ static BOOL ErrorInitContextKerberos = FALSE; static BOOL ErrorInitContextKerberos = TRUE; #endif -const SecPkgInfoA NEGOTIATE_SecPkgInfoA = -{ - 0x00083BB3, /* fCapabilities */ - 1, /* wVersion */ - 0x0009, /* wRPCID */ - 0x00002FE0, /* cbMaxToken */ - "Negotiate", /* Name */ +const SecPkgInfoA NEGOTIATE_SecPkgInfoA = { + 0x00083BB3, /* fCapabilities */ + 1, /* wVersion */ + 0x0009, /* wRPCID */ + 0x00002FE0, /* cbMaxToken */ + "Negotiate", /* Name */ "Microsoft Package Negotiator" /* Comment */ }; static WCHAR NEGOTIATE_SecPkgInfoW_Name[] = { 'N', 'e', 'g', 'o', 't', 'i', 'a', 't', 'e', '\0' }; -static WCHAR NEGOTIATE_SecPkgInfoW_Comment[] = -{ - 'M', 'i', 'c', 'r', 'o', 's', 'o', 'f', 't', ' ', - 'P', 'a', 'c', 'k', 'a', 'g', 'e', ' ', - 'N', 'e', 'g', 'o', 't', 'i', 'a', 't', 'o', 'r', '\0' -}; +static WCHAR NEGOTIATE_SecPkgInfoW_Comment[] = { 'M', 'i', 'c', 'r', 'o', 's', 'o', 'f', 't', ' ', + 'P', 'a', 'c', 'k', 'a', 'g', 'e', ' ', 'N', 'e', + 'g', 'o', 't', 'i', 'a', 't', 'o', 'r', '\0' }; -const SecPkgInfoW NEGOTIATE_SecPkgInfoW = -{ - 0x00083BB3, /* fCapabilities */ - 1, /* wVersion */ - 0x0009, /* wRPCID */ - 0x00002FE0, /* cbMaxToken */ - NEGOTIATE_SecPkgInfoW_Name, /* Name */ +const SecPkgInfoW NEGOTIATE_SecPkgInfoW = { + 0x00083BB3, /* fCapabilities */ + 1, /* wVersion */ + 0x0009, /* wRPCID */ + 0x00002FE0, /* cbMaxToken */ + NEGOTIATE_SecPkgInfoW_Name, /* Name */ NEGOTIATE_SecPkgInfoW_Comment /* Comment */ }; @@ -77,14 +72,14 @@ static void negotiate_SetSubPackage(NEGOTIATE_CONTEXT* context, const TCHAR* nam { if (_tcsnccmp(name, KERBEROS_SSP_NAME, ARRAYSIZE(KERBEROS_SSP_NAME)) == 0) { - context->sspiA = (SecurityFunctionTableA*) &KERBEROS_SecurityFunctionTableA; - context->sspiW = (SecurityFunctionTableW*) &KERBEROS_SecurityFunctionTableW; + context->sspiA = (SecurityFunctionTableA*)&KERBEROS_SecurityFunctionTableA; + context->sspiW = (SecurityFunctionTableW*)&KERBEROS_SecurityFunctionTableW; context->kerberos = TRUE; } else { - context->sspiA = (SecurityFunctionTableA*) &NTLM_SecurityFunctionTableA; - context->sspiW = (SecurityFunctionTableW*) &NTLM_SecurityFunctionTableW; + context->sspiA = (SecurityFunctionTableA*)&NTLM_SecurityFunctionTableA; + context->sspiW = (SecurityFunctionTableW*)&NTLM_SecurityFunctionTableW; context->kerberos = FALSE; } } @@ -92,7 +87,7 @@ static void negotiate_SetSubPackage(NEGOTIATE_CONTEXT* context, const TCHAR* nam static NEGOTIATE_CONTEXT* negotiate_ContextNew(void) { NEGOTIATE_CONTEXT* context; - context = (NEGOTIATE_CONTEXT*) calloc(1, sizeof(NEGOTIATE_CONTEXT)); + context = (NEGOTIATE_CONTEXT*)calloc(1, sizeof(NEGOTIATE_CONTEXT)); if (!context) return NULL; @@ -109,15 +104,14 @@ static void negotiate_ContextFree(NEGOTIATE_CONTEXT* context) free(context); } -static SECURITY_STATUS SEC_ENTRY negotiate_InitializeSecurityContextW(PCredHandle phCredential, - PCtxtHandle phContext, - SEC_WCHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, - PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY negotiate_InitializeSecurityContextW( + PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR* pszTargetName, ULONG fContextReq, + ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, + PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) { SECURITY_STATUS status; NEGOTIATE_CONTEXT* context; - context = (NEGOTIATE_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NEGOTIATE_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!context) { @@ -127,7 +121,7 @@ static SECURITY_STATUS SEC_ENTRY negotiate_InitializeSecurityContextW(PCredHandl return SEC_E_INTERNAL_ERROR; sspi_SecureHandleSetLowerPointer(phNewContext, context); - sspi_SecureHandleSetUpperPointer(phNewContext, (void*) NEGO_SSP_NAME); + sspi_SecureHandleSetUpperPointer(phNewContext, (void*)NEGO_SSP_NAME); } /* if Kerberos has previously failed or WITH_GSSAPI is not defined, we use NTLM directly */ @@ -138,9 +132,10 @@ static SECURITY_STATUS SEC_ENTRY negotiate_InitializeSecurityContextW(PCredHandl negotiate_SetSubPackage(context, KERBEROS_SSP_NAME); } - status = context->sspiW->InitializeSecurityContextW(phCredential, &(context->SubContext), - pszTargetName, fContextReq, Reserved1, TargetDataRep, pInput, Reserved2, &(context->SubContext), - pOutput, pfContextAttr, ptsExpiry); + status = context->sspiW->InitializeSecurityContextW( + phCredential, &(context->SubContext), pszTargetName, fContextReq, Reserved1, + TargetDataRep, pInput, Reserved2, &(context->SubContext), pOutput, pfContextAttr, + ptsExpiry); if (status == SEC_E_NO_CREDENTIALS) { @@ -159,23 +154,23 @@ static SECURITY_STATUS SEC_ENTRY negotiate_InitializeSecurityContextW(PCredHandl negotiate_SetSubPackage(context, NTLM_SSP_NAME); } - status = context->sspiW->InitializeSecurityContextW(phCredential, &(context->SubContext), - pszTargetName, fContextReq, Reserved1, TargetDataRep, pInput, Reserved2, &(context->SubContext), - pOutput, pfContextAttr, ptsExpiry); + status = context->sspiW->InitializeSecurityContextW( + phCredential, &(context->SubContext), pszTargetName, fContextReq, Reserved1, + TargetDataRep, pInput, Reserved2, &(context->SubContext), pOutput, pfContextAttr, + ptsExpiry); } return status; } -static SECURITY_STATUS SEC_ENTRY negotiate_InitializeSecurityContextA(PCredHandle phCredential, - PCtxtHandle phContext, - SEC_CHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, - PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY negotiate_InitializeSecurityContextA( + PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR* pszTargetName, ULONG fContextReq, + ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, + PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) { SECURITY_STATUS status; NEGOTIATE_CONTEXT* context; - context = (NEGOTIATE_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NEGOTIATE_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!context) { @@ -185,7 +180,7 @@ static SECURITY_STATUS SEC_ENTRY negotiate_InitializeSecurityContextA(PCredHandl return SEC_E_INTERNAL_ERROR; sspi_SecureHandleSetLowerPointer(phNewContext, context); - sspi_SecureHandleSetUpperPointer(phNewContext, (void*) NEGO_SSP_NAME); + sspi_SecureHandleSetUpperPointer(phNewContext, (void*)NEGO_SSP_NAME); } /* if Kerberos has previously failed or WITH_GSSAPI is not defined, we use NTLM directly */ @@ -196,9 +191,10 @@ static SECURITY_STATUS SEC_ENTRY negotiate_InitializeSecurityContextA(PCredHandl negotiate_SetSubPackage(context, KERBEROS_SSP_NAME); } - status = context->sspiA->InitializeSecurityContextA(phCredential, &(context->SubContext), - pszTargetName, fContextReq, Reserved1, TargetDataRep, pInput, Reserved2, &(context->SubContext), - pOutput, pfContextAttr, ptsExpiry); + status = context->sspiA->InitializeSecurityContextA( + phCredential, &(context->SubContext), pszTargetName, fContextReq, Reserved1, + TargetDataRep, pInput, Reserved2, &(context->SubContext), pOutput, pfContextAttr, + ptsExpiry); if (status == SEC_E_NO_CREDENTIALS) { @@ -217,22 +213,23 @@ static SECURITY_STATUS SEC_ENTRY negotiate_InitializeSecurityContextA(PCredHandl negotiate_SetSubPackage(context, NTLM_SSP_NAME); } - status = context->sspiA->InitializeSecurityContextA(phCredential, &(context->SubContext), - pszTargetName, fContextReq, Reserved1, TargetDataRep, pInput, Reserved2, &(context->SubContext), - pOutput, pfContextAttr, ptsExpiry); + status = context->sspiA->InitializeSecurityContextA( + phCredential, &(context->SubContext), pszTargetName, fContextReq, Reserved1, + TargetDataRep, pInput, Reserved2, &(context->SubContext), pOutput, pfContextAttr, + ptsExpiry); } return status; } -static SECURITY_STATUS SEC_ENTRY negotiate_AcceptSecurityContext(PCredHandle phCredential, - PCtxtHandle phContext, - PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsTimeStamp) +static SECURITY_STATUS SEC_ENTRY negotiate_AcceptSecurityContext( + PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, ULONG fContextReq, + ULONG TargetDataRep, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, + PTimeStamp ptsTimeStamp) { SECURITY_STATUS status; NEGOTIATE_CONTEXT* context; - context = (NEGOTIATE_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NEGOTIATE_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!context) { @@ -242,17 +239,17 @@ static SECURITY_STATUS SEC_ENTRY negotiate_AcceptSecurityContext(PCredHandle phC return SEC_E_INTERNAL_ERROR; sspi_SecureHandleSetLowerPointer(phNewContext, context); - sspi_SecureHandleSetUpperPointer(phNewContext, (void*) NEGO_SSP_NAME); + sspi_SecureHandleSetUpperPointer(phNewContext, (void*)NEGO_SSP_NAME); } negotiate_SetSubPackage(context, NTLM_SSP_NAME); /* server-side Kerberos not yet implemented */ - status = context->sspiA->AcceptSecurityContext(phCredential, &(context->SubContext), - pInput, fContextReq, TargetDataRep, &(context->SubContext), - pOutput, pfContextAttr, ptsTimeStamp); + status = context->sspiA->AcceptSecurityContext( + phCredential, &(context->SubContext), pInput, fContextReq, TargetDataRep, + &(context->SubContext), pOutput, pfContextAttr, ptsTimeStamp); if (status != SEC_E_OK) { - WLog_WARN(TAG, "AcceptSecurityContext status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "AcceptSecurityContext status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -260,11 +257,11 @@ static SECURITY_STATUS SEC_ENTRY negotiate_AcceptSecurityContext(PCredHandle phC } static SECURITY_STATUS SEC_ENTRY negotiate_CompleteAuthToken(PCtxtHandle phContext, - PSecBufferDesc pToken) + PSecBufferDesc pToken) { NEGOTIATE_CONTEXT* context; SECURITY_STATUS status = SEC_E_OK; - context = (NEGOTIATE_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NEGOTIATE_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!context) return SEC_E_INVALID_HANDLE; @@ -279,7 +276,7 @@ static SECURITY_STATUS SEC_ENTRY negotiate_DeleteSecurityContext(PCtxtHandle phC { NEGOTIATE_CONTEXT* context; SECURITY_STATUS status = SEC_E_OK; - context = (NEGOTIATE_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NEGOTIATE_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!context) return SEC_E_INVALID_HANDLE; @@ -295,7 +292,7 @@ static SECURITY_STATUS SEC_ENTRY negotiate_ImpersonateSecurityContext(PCtxtHandl { NEGOTIATE_CONTEXT* context; SECURITY_STATUS status = SEC_E_OK; - context = (NEGOTIATE_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NEGOTIATE_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!phContext) return SEC_E_INVALID_HANDLE; @@ -310,7 +307,7 @@ static SECURITY_STATUS SEC_ENTRY negotiate_RevertSecurityContext(PCtxtHandle phC { NEGOTIATE_CONTEXT* context; SECURITY_STATUS status = SEC_E_OK; - context = (NEGOTIATE_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NEGOTIATE_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!phContext) return SEC_E_INVALID_HANDLE; @@ -322,11 +319,11 @@ static SECURITY_STATUS SEC_ENTRY negotiate_RevertSecurityContext(PCtxtHandle phC } static SECURITY_STATUS SEC_ENTRY negotiate_QueryContextAttributesW(PCtxtHandle phContext, - ULONG ulAttribute, void* pBuffer) + ULONG ulAttribute, void* pBuffer) { NEGOTIATE_CONTEXT* context; SECURITY_STATUS status = SEC_E_OK; - context = (NEGOTIATE_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NEGOTIATE_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!phContext) return SEC_E_INVALID_HANDLE; @@ -335,17 +332,18 @@ static SECURITY_STATUS SEC_ENTRY negotiate_QueryContextAttributesW(PCtxtHandle p return SEC_E_INSUFFICIENT_MEMORY; if (context->sspiW->QueryContextAttributesW) - status = context->sspiW->QueryContextAttributesW(&(context->SubContext), ulAttribute, pBuffer); + status = + context->sspiW->QueryContextAttributesW(&(context->SubContext), ulAttribute, pBuffer); return status; } static SECURITY_STATUS SEC_ENTRY negotiate_QueryContextAttributesA(PCtxtHandle phContext, - ULONG ulAttribute, void* pBuffer) + ULONG ulAttribute, void* pBuffer) { NEGOTIATE_CONTEXT* context; SECURITY_STATUS status = SEC_E_OK; - context = (NEGOTIATE_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NEGOTIATE_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!phContext) return SEC_E_INVALID_HANDLE; @@ -354,18 +352,19 @@ static SECURITY_STATUS SEC_ENTRY negotiate_QueryContextAttributesA(PCtxtHandle p return SEC_E_INSUFFICIENT_MEMORY; if (context->sspiA->QueryContextAttributesA) - status = context->sspiA->QueryContextAttributesA(&(context->SubContext), ulAttribute, pBuffer); + status = + context->sspiA->QueryContextAttributesA(&(context->SubContext), ulAttribute, pBuffer); return status; } static SECURITY_STATUS SEC_ENTRY negotiate_SetContextAttributesW(PCtxtHandle phContext, - ULONG ulAttribute, - void* pBuffer, ULONG cbBuffer) + ULONG ulAttribute, void* pBuffer, + ULONG cbBuffer) { NEGOTIATE_CONTEXT* context; SECURITY_STATUS status = SEC_E_OK; - context = (NEGOTIATE_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NEGOTIATE_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!phContext) return SEC_E_INVALID_HANDLE; @@ -375,18 +374,18 @@ static SECURITY_STATUS SEC_ENTRY negotiate_SetContextAttributesW(PCtxtHandle phC if (context->sspiW->SetContextAttributesW) status = context->sspiW->SetContextAttributesW(&(context->SubContext), ulAttribute, pBuffer, - cbBuffer); + cbBuffer); return status; } static SECURITY_STATUS SEC_ENTRY negotiate_SetContextAttributesA(PCtxtHandle phContext, - ULONG ulAttribute, - void* pBuffer, ULONG cbBuffer) + ULONG ulAttribute, void* pBuffer, + ULONG cbBuffer) { NEGOTIATE_CONTEXT* context; SECURITY_STATUS status = SEC_E_OK; - context = (NEGOTIATE_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NEGOTIATE_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!phContext) return SEC_E_INVALID_HANDLE; @@ -396,21 +395,20 @@ static SECURITY_STATUS SEC_ENTRY negotiate_SetContextAttributesA(PCtxtHandle phC if (context->sspiA->SetContextAttributesA) status = context->sspiA->SetContextAttributesA(&(context->SubContext), ulAttribute, pBuffer, - cbBuffer); + cbBuffer); return status; } -static SECURITY_STATUS SEC_ENTRY negotiate_AcquireCredentialsHandleW(SEC_WCHAR* pszPrincipal, - SEC_WCHAR* pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, - void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY negotiate_AcquireCredentialsHandleW( + SEC_WCHAR* pszPrincipal, SEC_WCHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, + void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, + PTimeStamp ptsExpiry) { SSPI_CREDENTIALS* credentials; SEC_WINNT_AUTH_IDENTITY* identity; - if ((fCredentialUse != SECPKG_CRED_OUTBOUND) && - (fCredentialUse != SECPKG_CRED_INBOUND) && + if ((fCredentialUse != SECPKG_CRED_OUTBOUND) && (fCredentialUse != SECPKG_CRED_INBOUND) && (fCredentialUse != SECPKG_CRED_BOTH)) { return SEC_E_INVALID_PARAMETER; @@ -424,26 +422,25 @@ static SECURITY_STATUS SEC_ENTRY negotiate_AcquireCredentialsHandleW(SEC_WCHAR* credentials->fCredentialUse = fCredentialUse; credentials->pGetKeyFn = pGetKeyFn; credentials->pvGetKeyArgument = pvGetKeyArgument; - identity = (SEC_WINNT_AUTH_IDENTITY*) pAuthData; + identity = (SEC_WINNT_AUTH_IDENTITY*)pAuthData; if (identity) sspi_CopyAuthIdentity(&(credentials->identity), identity); - sspi_SecureHandleSetLowerPointer(phCredential, (void*) credentials); - sspi_SecureHandleSetUpperPointer(phCredential, (void*) NEGO_SSP_NAME); + sspi_SecureHandleSetLowerPointer(phCredential, (void*)credentials); + sspi_SecureHandleSetUpperPointer(phCredential, (void*)NEGO_SSP_NAME); return SEC_E_OK; } -static SECURITY_STATUS SEC_ENTRY negotiate_AcquireCredentialsHandleA(SEC_CHAR* pszPrincipal, - SEC_CHAR* pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, - void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY negotiate_AcquireCredentialsHandleA( + SEC_CHAR* pszPrincipal, SEC_CHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, + void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, + PTimeStamp ptsExpiry) { SSPI_CREDENTIALS* credentials; SEC_WINNT_AUTH_IDENTITY* identity; - if ((fCredentialUse != SECPKG_CRED_OUTBOUND) && - (fCredentialUse != SECPKG_CRED_INBOUND) && + if ((fCredentialUse != SECPKG_CRED_OUTBOUND) && (fCredentialUse != SECPKG_CRED_INBOUND) && (fCredentialUse != SECPKG_CRED_BOTH)) { return SEC_E_INVALID_PARAMETER; @@ -457,24 +454,26 @@ static SECURITY_STATUS SEC_ENTRY negotiate_AcquireCredentialsHandleA(SEC_CHAR* p credentials->fCredentialUse = fCredentialUse; credentials->pGetKeyFn = pGetKeyFn; credentials->pvGetKeyArgument = pvGetKeyArgument; - identity = (SEC_WINNT_AUTH_IDENTITY*) pAuthData; + identity = (SEC_WINNT_AUTH_IDENTITY*)pAuthData; if (identity) sspi_CopyAuthIdentity(&(credentials->identity), identity); - sspi_SecureHandleSetLowerPointer(phCredential, (void*) credentials); - sspi_SecureHandleSetUpperPointer(phCredential, (void*) NEGO_SSP_NAME); + sspi_SecureHandleSetLowerPointer(phCredential, (void*)credentials); + sspi_SecureHandleSetUpperPointer(phCredential, (void*)NEGO_SSP_NAME); return SEC_E_OK; } static SECURITY_STATUS SEC_ENTRY negotiate_QueryCredentialsAttributesW(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer) + ULONG ulAttribute, + void* pBuffer) { return SEC_E_UNSUPPORTED_FUNCTION; } static SECURITY_STATUS SEC_ENTRY negotiate_QueryCredentialsAttributesA(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer) + ULONG ulAttribute, + void* pBuffer) { return SEC_E_UNSUPPORTED_FUNCTION; } @@ -486,7 +485,7 @@ static SECURITY_STATUS SEC_ENTRY negotiate_FreeCredentialsHandle(PCredHandle phC if (!phCredential) return SEC_E_INVALID_HANDLE; - credentials = (SSPI_CREDENTIALS*) sspi_SecureHandleGetLowerPointer(phCredential); + credentials = (SSPI_CREDENTIALS*)sspi_SecureHandleGetLowerPointer(phCredential); if (!credentials) return SEC_E_INVALID_HANDLE; @@ -497,120 +496,123 @@ static SECURITY_STATUS SEC_ENTRY negotiate_FreeCredentialsHandle(PCredHandle phC } static SECURITY_STATUS SEC_ENTRY negotiate_EncryptMessage(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo) + PSecBufferDesc pMessage, + ULONG MessageSeqNo) { NEGOTIATE_CONTEXT* context; SECURITY_STATUS status = SEC_E_UNSUPPORTED_FUNCTION; - context = (NEGOTIATE_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NEGOTIATE_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (context->sspiW->EncryptMessage) - status = context->sspiW->EncryptMessage(&(context->SubContext), fQOP, pMessage, MessageSeqNo); + status = + context->sspiW->EncryptMessage(&(context->SubContext), fQOP, pMessage, MessageSeqNo); return status; } static SECURITY_STATUS SEC_ENTRY negotiate_DecryptMessage(PCtxtHandle phContext, - PSecBufferDesc pMessage, - ULONG MessageSeqNo, ULONG* pfQOP) + PSecBufferDesc pMessage, + ULONG MessageSeqNo, ULONG* pfQOP) { NEGOTIATE_CONTEXT* context; SECURITY_STATUS status = SEC_E_UNSUPPORTED_FUNCTION; - context = (NEGOTIATE_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NEGOTIATE_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (context->sspiW->DecryptMessage) - status = context->sspiW->DecryptMessage(&(context->SubContext), pMessage, MessageSeqNo, pfQOP); + status = + context->sspiW->DecryptMessage(&(context->SubContext), pMessage, MessageSeqNo, pfQOP); return status; } static SECURITY_STATUS SEC_ENTRY negotiate_MakeSignature(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo) + PSecBufferDesc pMessage, + ULONG MessageSeqNo) { NEGOTIATE_CONTEXT* context; SECURITY_STATUS status = SEC_E_UNSUPPORTED_FUNCTION; - context = (NEGOTIATE_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NEGOTIATE_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (context->sspiW->MakeSignature) - status = context->sspiW->MakeSignature(&(context->SubContext), fQOP, pMessage, MessageSeqNo); + status = + context->sspiW->MakeSignature(&(context->SubContext), fQOP, pMessage, MessageSeqNo); return status; } static SECURITY_STATUS SEC_ENTRY negotiate_VerifySignature(PCtxtHandle phContext, - PSecBufferDesc pMessage, - ULONG MessageSeqNo, ULONG* pfQOP) + PSecBufferDesc pMessage, + ULONG MessageSeqNo, ULONG* pfQOP) { NEGOTIATE_CONTEXT* context; SECURITY_STATUS status = SEC_E_UNSUPPORTED_FUNCTION; - context = (NEGOTIATE_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (NEGOTIATE_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (context->sspiW->VerifySignature) - status = context->sspiW->VerifySignature(&(context->SubContext), pMessage, MessageSeqNo, pfQOP); + status = + context->sspiW->VerifySignature(&(context->SubContext), pMessage, MessageSeqNo, pfQOP); return status; } -const SecurityFunctionTableA NEGOTIATE_SecurityFunctionTableA = -{ - 1, /* dwVersion */ - NULL, /* EnumerateSecurityPackages */ +const SecurityFunctionTableA NEGOTIATE_SecurityFunctionTableA = { + 1, /* dwVersion */ + NULL, /* EnumerateSecurityPackages */ negotiate_QueryCredentialsAttributesA, /* QueryCredentialsAttributes */ - negotiate_AcquireCredentialsHandleA, /* AcquireCredentialsHandle */ - negotiate_FreeCredentialsHandle, /* FreeCredentialsHandle */ - NULL, /* Reserved2 */ - negotiate_InitializeSecurityContextA, /* InitializeSecurityContext */ - negotiate_AcceptSecurityContext, /* AcceptSecurityContext */ - negotiate_CompleteAuthToken, /* CompleteAuthToken */ - negotiate_DeleteSecurityContext, /* DeleteSecurityContext */ - NULL, /* ApplyControlToken */ - negotiate_QueryContextAttributesA, /* QueryContextAttributes */ - negotiate_ImpersonateSecurityContext, /* ImpersonateSecurityContext */ - negotiate_RevertSecurityContext, /* RevertSecurityContext */ - negotiate_MakeSignature, /* MakeSignature */ - negotiate_VerifySignature, /* VerifySignature */ - NULL, /* FreeContextBuffer */ - NULL, /* QuerySecurityPackageInfo */ - NULL, /* Reserved3 */ - NULL, /* Reserved4 */ - NULL, /* ExportSecurityContext */ - NULL, /* ImportSecurityContext */ - NULL, /* AddCredentials */ - NULL, /* Reserved8 */ - NULL, /* QuerySecurityContextToken */ - negotiate_EncryptMessage, /* EncryptMessage */ - negotiate_DecryptMessage, /* DecryptMessage */ - negotiate_SetContextAttributesA, /* SetContextAttributes */ + negotiate_AcquireCredentialsHandleA, /* AcquireCredentialsHandle */ + negotiate_FreeCredentialsHandle, /* FreeCredentialsHandle */ + NULL, /* Reserved2 */ + negotiate_InitializeSecurityContextA, /* InitializeSecurityContext */ + negotiate_AcceptSecurityContext, /* AcceptSecurityContext */ + negotiate_CompleteAuthToken, /* CompleteAuthToken */ + negotiate_DeleteSecurityContext, /* DeleteSecurityContext */ + NULL, /* ApplyControlToken */ + negotiate_QueryContextAttributesA, /* QueryContextAttributes */ + negotiate_ImpersonateSecurityContext, /* ImpersonateSecurityContext */ + negotiate_RevertSecurityContext, /* RevertSecurityContext */ + negotiate_MakeSignature, /* MakeSignature */ + negotiate_VerifySignature, /* VerifySignature */ + NULL, /* FreeContextBuffer */ + NULL, /* QuerySecurityPackageInfo */ + NULL, /* Reserved3 */ + NULL, /* Reserved4 */ + NULL, /* ExportSecurityContext */ + NULL, /* ImportSecurityContext */ + NULL, /* AddCredentials */ + NULL, /* Reserved8 */ + NULL, /* QuerySecurityContextToken */ + negotiate_EncryptMessage, /* EncryptMessage */ + negotiate_DecryptMessage, /* DecryptMessage */ + negotiate_SetContextAttributesA, /* SetContextAttributes */ }; -const SecurityFunctionTableW NEGOTIATE_SecurityFunctionTableW = -{ - 1, /* dwVersion */ - NULL, /* EnumerateSecurityPackages */ +const SecurityFunctionTableW NEGOTIATE_SecurityFunctionTableW = { + 1, /* dwVersion */ + NULL, /* EnumerateSecurityPackages */ negotiate_QueryCredentialsAttributesW, /* QueryCredentialsAttributes */ - negotiate_AcquireCredentialsHandleW, /* AcquireCredentialsHandle */ - negotiate_FreeCredentialsHandle, /* FreeCredentialsHandle */ - NULL, /* Reserved2 */ - negotiate_InitializeSecurityContextW, /* InitializeSecurityContext */ - negotiate_AcceptSecurityContext, /* AcceptSecurityContext */ - negotiate_CompleteAuthToken, /* CompleteAuthToken */ - negotiate_DeleteSecurityContext, /* DeleteSecurityContext */ - NULL, /* ApplyControlToken */ - negotiate_QueryContextAttributesW, /* QueryContextAttributes */ - negotiate_ImpersonateSecurityContext, /* ImpersonateSecurityContext */ - negotiate_RevertSecurityContext, /* RevertSecurityContext */ - negotiate_MakeSignature, /* MakeSignature */ - negotiate_VerifySignature, /* VerifySignature */ - NULL, /* FreeContextBuffer */ - NULL, /* QuerySecurityPackageInfo */ - NULL, /* Reserved3 */ - NULL, /* Reserved4 */ - NULL, /* ExportSecurityContext */ - NULL, /* ImportSecurityContext */ - NULL, /* AddCredentials */ - NULL, /* Reserved8 */ - NULL, /* QuerySecurityContextToken */ - negotiate_EncryptMessage, /* EncryptMessage */ - negotiate_DecryptMessage, /* DecryptMessage */ - negotiate_SetContextAttributesW, /* SetContextAttributes */ + negotiate_AcquireCredentialsHandleW, /* AcquireCredentialsHandle */ + negotiate_FreeCredentialsHandle, /* FreeCredentialsHandle */ + NULL, /* Reserved2 */ + negotiate_InitializeSecurityContextW, /* InitializeSecurityContext */ + negotiate_AcceptSecurityContext, /* AcceptSecurityContext */ + negotiate_CompleteAuthToken, /* CompleteAuthToken */ + negotiate_DeleteSecurityContext, /* DeleteSecurityContext */ + NULL, /* ApplyControlToken */ + negotiate_QueryContextAttributesW, /* QueryContextAttributes */ + negotiate_ImpersonateSecurityContext, /* ImpersonateSecurityContext */ + negotiate_RevertSecurityContext, /* RevertSecurityContext */ + negotiate_MakeSignature, /* MakeSignature */ + negotiate_VerifySignature, /* VerifySignature */ + NULL, /* FreeContextBuffer */ + NULL, /* QuerySecurityPackageInfo */ + NULL, /* Reserved3 */ + NULL, /* Reserved4 */ + NULL, /* ExportSecurityContext */ + NULL, /* ImportSecurityContext */ + NULL, /* AddCredentials */ + NULL, /* Reserved8 */ + NULL, /* QuerySecurityContextToken */ + negotiate_EncryptMessage, /* EncryptMessage */ + negotiate_DecryptMessage, /* DecryptMessage */ + negotiate_SetContextAttributesW, /* SetContextAttributes */ }; - diff --git a/winpr/libwinpr/sspi/Negotiate/negotiate.h b/winpr/libwinpr/sspi/Negotiate/negotiate.h index b18c0e7dc..3f775ffed 100644 --- a/winpr/libwinpr/sspi/Negotiate/negotiate.h +++ b/winpr/libwinpr/sspi/Negotiate/negotiate.h @@ -24,7 +24,7 @@ #include "../sspi.h" -#define NTLM_OID "1.3.6.1.4.1.311.2.2.10" +#define NTLM_OID "1.3.6.1.4.1.311.2.2.10" enum _NEGOTIATE_STATE { @@ -51,4 +51,3 @@ struct _NEGOTIATE_CONTEXT typedef struct _NEGOTIATE_CONTEXT NEGOTIATE_CONTEXT; #endif /* WINPR_SSPI_NEGOTIATE_PRIVATE_H */ - diff --git a/winpr/libwinpr/sspi/Schannel/schannel.c b/winpr/libwinpr/sspi/Schannel/schannel.c index a916b6933..a00841874 100644 --- a/winpr/libwinpr/sspi/Schannel/schannel.c +++ b/winpr/libwinpr/sspi/Schannel/schannel.c @@ -33,7 +33,7 @@ char* SCHANNEL_PACKAGE_NAME = "Schannel"; SCHANNEL_CONTEXT* schannel_ContextNew() { SCHANNEL_CONTEXT* context; - context = (SCHANNEL_CONTEXT*) calloc(1, sizeof(SCHANNEL_CONTEXT)); + context = (SCHANNEL_CONTEXT*)calloc(1, sizeof(SCHANNEL_CONTEXT)); if (!context) return NULL; @@ -61,7 +61,7 @@ void schannel_ContextFree(SCHANNEL_CONTEXT* context) SCHANNEL_CREDENTIALS* schannel_CredentialsNew() { SCHANNEL_CREDENTIALS* credentials; - credentials = (SCHANNEL_CREDENTIALS*) calloc(1, sizeof(SCHANNEL_CREDENTIALS)); + credentials = (SCHANNEL_CREDENTIALS*)calloc(1, sizeof(SCHANNEL_CREDENTIALS)); return credentials; } @@ -70,35 +70,43 @@ void schannel_CredentialsFree(SCHANNEL_CREDENTIALS* credentials) free(credentials); } -static ALG_ID schannel_SupportedAlgs[] = -{ - CALG_AES_128, CALG_AES_256, CALG_RC4, CALG_DES, CALG_3DES, - CALG_MD5, CALG_SHA1, CALG_SHA_256, CALG_SHA_384, CALG_SHA_512, - CALG_RSA_SIGN, CALG_DH_EPHEM, - (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RESERVED7 | 6), /* what is this? */ - CALG_DSS_SIGN, CALG_ECDSA -}; +static ALG_ID schannel_SupportedAlgs[] = { CALG_AES_128, + CALG_AES_256, + CALG_RC4, + CALG_DES, + CALG_3DES, + CALG_MD5, + CALG_SHA1, + CALG_SHA_256, + CALG_SHA_384, + CALG_SHA_512, + CALG_RSA_SIGN, + CALG_DH_EPHEM, + (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RESERVED7 | + 6), /* what is this? */ + CALG_DSS_SIGN, + CALG_ECDSA }; SECURITY_STATUS SEC_ENTRY schannel_QueryCredentialsAttributesW(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer) + ULONG ulAttribute, void* pBuffer) { if (ulAttribute == SECPKG_ATTR_SUPPORTED_ALGS) { - PSecPkgCred_SupportedAlgs SupportedAlgs = (PSecPkgCred_SupportedAlgs) pBuffer; + PSecPkgCred_SupportedAlgs SupportedAlgs = (PSecPkgCred_SupportedAlgs)pBuffer; SupportedAlgs->cSupportedAlgs = sizeof(schannel_SupportedAlgs) / sizeof(ALG_ID); - SupportedAlgs->palgSupportedAlgs = (ALG_ID*) schannel_SupportedAlgs; + SupportedAlgs->palgSupportedAlgs = (ALG_ID*)schannel_SupportedAlgs; return SEC_E_OK; } else if (ulAttribute == SECPKG_ATTR_CIPHER_STRENGTHS) { - PSecPkgCred_CipherStrengths CipherStrengths = (PSecPkgCred_CipherStrengths) pBuffer; + PSecPkgCred_CipherStrengths CipherStrengths = (PSecPkgCred_CipherStrengths)pBuffer; CipherStrengths->dwMinimumCipherStrength = 40; CipherStrengths->dwMaximumCipherStrength = 256; return SEC_E_OK; } else if (ulAttribute == SECPKG_ATTR_SUPPORTED_PROTOCOLS) { - PSecPkgCred_SupportedProtocols SupportedProtocols = (PSecPkgCred_SupportedProtocols) pBuffer; + PSecPkgCred_SupportedProtocols SupportedProtocols = (PSecPkgCred_SupportedProtocols)pBuffer; /* Observed SupportedProtocols: 0x208A0 */ SupportedProtocols->grbitProtocol = (SP_PROT_CLIENTS | SP_PROT_SERVERS); return SEC_E_OK; @@ -108,15 +116,15 @@ SECURITY_STATUS SEC_ENTRY schannel_QueryCredentialsAttributesW(PCredHandle phCre } SECURITY_STATUS SEC_ENTRY schannel_QueryCredentialsAttributesA(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer) + ULONG ulAttribute, void* pBuffer) { return schannel_QueryCredentialsAttributesW(phCredential, ulAttribute, pBuffer); } -SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleW(SEC_WCHAR* pszPrincipal, - SEC_WCHAR* pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, - void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry) +SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleW( + SEC_WCHAR* pszPrincipal, SEC_WCHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, + void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, + PTimeStamp ptsExpiry) { SCHANNEL_CREDENTIALS* credentials; @@ -125,41 +133,42 @@ SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleW(SEC_WCHAR* pszPrinc SCHANNEL_CRED* cred; credentials = schannel_CredentialsNew(); credentials->fCredentialUse = fCredentialUse; - cred = (SCHANNEL_CRED*) pAuthData; + cred = (SCHANNEL_CRED*)pAuthData; if (cred) { CopyMemory(&credentials->cred, cred, sizeof(SCHANNEL_CRED)); } - sspi_SecureHandleSetLowerPointer(phCredential, (void*) credentials); - sspi_SecureHandleSetUpperPointer(phCredential, (void*) SCHANNEL_PACKAGE_NAME); + sspi_SecureHandleSetLowerPointer(phCredential, (void*)credentials); + sspi_SecureHandleSetUpperPointer(phCredential, (void*)SCHANNEL_PACKAGE_NAME); return SEC_E_OK; } else if (fCredentialUse == SECPKG_CRED_INBOUND) { credentials = schannel_CredentialsNew(); credentials->fCredentialUse = fCredentialUse; - sspi_SecureHandleSetLowerPointer(phCredential, (void*) credentials); - sspi_SecureHandleSetUpperPointer(phCredential, (void*) SCHANNEL_PACKAGE_NAME); + sspi_SecureHandleSetLowerPointer(phCredential, (void*)credentials); + sspi_SecureHandleSetUpperPointer(phCredential, (void*)SCHANNEL_PACKAGE_NAME); return SEC_E_OK; } return SEC_E_OK; } -SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleA(SEC_CHAR* pszPrincipal, - SEC_CHAR* pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, - void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry) +SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleA( + SEC_CHAR* pszPrincipal, SEC_CHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, + void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, + PTimeStamp ptsExpiry) { SECURITY_STATUS status; SEC_WCHAR* pszPrincipalW = NULL; SEC_WCHAR* pszPackageW = NULL; ConvertToUnicode(CP_UTF8, 0, pszPrincipal, -1, &pszPrincipalW, 0); ConvertToUnicode(CP_UTF8, 0, pszPackage, -1, &pszPackageW, 0); - status = schannel_AcquireCredentialsHandleW(pszPrincipalW, pszPackageW, fCredentialUse, pvLogonID, - pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential, ptsExpiry); + status = schannel_AcquireCredentialsHandleW(pszPrincipalW, pszPackageW, fCredentialUse, + pvLogonID, pAuthData, pGetKeyFn, pvGetKeyArgument, + phCredential, ptsExpiry); free(pszPrincipalW); free(pszPackageW); return status; @@ -172,7 +181,7 @@ SECURITY_STATUS SEC_ENTRY schannel_FreeCredentialsHandle(PCredHandle phCredentia if (!phCredential) return SEC_E_INVALID_HANDLE; - credentials = (SCHANNEL_CREDENTIALS*) sspi_SecureHandleGetLowerPointer(phCredential); + credentials = (SCHANNEL_CREDENTIALS*)sspi_SecureHandleGetLowerPointer(phCredential); if (!credentials) return SEC_E_INVALID_HANDLE; @@ -181,11 +190,10 @@ SECURITY_STATUS SEC_ENTRY schannel_FreeCredentialsHandle(PCredHandle phCredentia return SEC_E_OK; } -SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextW(PCredHandle phCredential, - PCtxtHandle phContext, - SEC_WCHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, - PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) +SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextW( + PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR* pszTargetName, ULONG fContextReq, + ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, + PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) { SECURITY_STATUS status; SCHANNEL_CONTEXT* context; @@ -199,11 +207,11 @@ SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextW(PCredHandle phCred if (!context) return SEC_E_INSUFFICIENT_MEMORY; - credentials = (SCHANNEL_CREDENTIALS*) sspi_SecureHandleGetLowerPointer(phCredential); + credentials = (SCHANNEL_CREDENTIALS*)sspi_SecureHandleGetLowerPointer(phCredential); context->server = FALSE; CopyMemory(&context->cred, &credentials->cred, sizeof(SCHANNEL_CRED)); sspi_SecureHandleSetLowerPointer(phNewContext, context); - sspi_SecureHandleSetUpperPointer(phNewContext, (void*) SCHANNEL_PACKAGE_NAME); + sspi_SecureHandleSetUpperPointer(phNewContext, (void*)SCHANNEL_PACKAGE_NAME); schannel_openssl_client_init(context->openssl); } @@ -211,11 +219,10 @@ SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextW(PCredHandle phCred return status; } -SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextA(PCredHandle phCredential, - PCtxtHandle phContext, - SEC_CHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, - PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) +SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextA( + PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR* pszTargetName, ULONG fContextReq, + ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, + PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) { SECURITY_STATUS status; SEC_WCHAR* pszTargetNameW = NULL; @@ -225,20 +232,21 @@ SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextA(PCredHandle phCred ConvertToUnicode(CP_UTF8, 0, pszTargetName, -1, &pszTargetNameW, 0); } - status = schannel_InitializeSecurityContextW(phCredential, phContext, pszTargetNameW, fContextReq, - Reserved1, TargetDataRep, pInput, Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry); + status = schannel_InitializeSecurityContextW( + phCredential, phContext, pszTargetNameW, fContextReq, Reserved1, TargetDataRep, pInput, + Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry); free(pszTargetNameW); return status; } -SECURITY_STATUS SEC_ENTRY schannel_AcceptSecurityContext(PCredHandle phCredential, - PCtxtHandle phContext, - PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsTimeStamp) +SECURITY_STATUS SEC_ENTRY schannel_AcceptSecurityContext( + PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, ULONG fContextReq, + ULONG TargetDataRep, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, + PTimeStamp ptsTimeStamp) { SECURITY_STATUS status; SCHANNEL_CONTEXT* context; - context = (SCHANNEL_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (SCHANNEL_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!context) { @@ -249,7 +257,7 @@ SECURITY_STATUS SEC_ENTRY schannel_AcceptSecurityContext(PCredHandle phCredentia context->server = TRUE; sspi_SecureHandleSetLowerPointer(phNewContext, context); - sspi_SecureHandleSetUpperPointer(phNewContext, (void*) SCHANNEL_PACKAGE_NAME); + sspi_SecureHandleSetUpperPointer(phNewContext, (void*)SCHANNEL_PACKAGE_NAME); schannel_openssl_server_init(context->openssl); } @@ -260,7 +268,7 @@ SECURITY_STATUS SEC_ENTRY schannel_AcceptSecurityContext(PCredHandle phCredentia SECURITY_STATUS SEC_ENTRY schannel_DeleteSecurityContext(PCtxtHandle phContext) { SCHANNEL_CONTEXT* context; - context = (SCHANNEL_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (SCHANNEL_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!context) return SEC_E_INVALID_HANDLE; @@ -270,7 +278,7 @@ SECURITY_STATUS SEC_ENTRY schannel_DeleteSecurityContext(PCtxtHandle phContext) } SECURITY_STATUS SEC_ENTRY schannel_QueryContextAttributes(PCtxtHandle phContext, ULONG ulAttribute, - void* pBuffer) + void* pBuffer) { if (!phContext) return SEC_E_INVALID_HANDLE; @@ -280,7 +288,7 @@ SECURITY_STATUS SEC_ENTRY schannel_QueryContextAttributes(PCtxtHandle phContext, if (ulAttribute == SECPKG_ATTR_SIZES) { - SecPkgContext_Sizes* Sizes = (SecPkgContext_Sizes*) pBuffer; + SecPkgContext_Sizes* Sizes = (SecPkgContext_Sizes*)pBuffer; Sizes->cbMaxToken = 0x6000; Sizes->cbMaxSignature = 16; Sizes->cbBlockSize = 0; @@ -289,7 +297,7 @@ SECURITY_STATUS SEC_ENTRY schannel_QueryContextAttributes(PCtxtHandle phContext, } else if (ulAttribute == SECPKG_ATTR_STREAM_SIZES) { - SecPkgContext_StreamSizes* StreamSizes = (SecPkgContext_StreamSizes*) pBuffer; + SecPkgContext_StreamSizes* StreamSizes = (SecPkgContext_StreamSizes*)pBuffer; StreamSizes->cbHeader = 5; StreamSizes->cbTrailer = 36; StreamSizes->cbMaximumMessage = 0x4000; @@ -302,23 +310,23 @@ SECURITY_STATUS SEC_ENTRY schannel_QueryContextAttributes(PCtxtHandle phContext, } SECURITY_STATUS SEC_ENTRY schannel_MakeSignature(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo) + PSecBufferDesc pMessage, ULONG MessageSeqNo) { return SEC_E_OK; } SECURITY_STATUS SEC_ENTRY schannel_VerifySignature(PCtxtHandle phContext, PSecBufferDesc pMessage, - ULONG MessageSeqNo, ULONG* pfQOP) + ULONG MessageSeqNo, ULONG* pfQOP) { return SEC_E_OK; } SECURITY_STATUS SEC_ENTRY schannel_EncryptMessage(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo) + PSecBufferDesc pMessage, ULONG MessageSeqNo) { SECURITY_STATUS status; SCHANNEL_CONTEXT* context; - context = (SCHANNEL_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (SCHANNEL_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!context) return SEC_E_INVALID_HANDLE; @@ -328,11 +336,11 @@ SECURITY_STATUS SEC_ENTRY schannel_EncryptMessage(PCtxtHandle phContext, ULONG f } SECURITY_STATUS SEC_ENTRY schannel_DecryptMessage(PCtxtHandle phContext, PSecBufferDesc pMessage, - ULONG MessageSeqNo, ULONG* pfQOP) + ULONG MessageSeqNo, ULONG* pfQOP) { SECURITY_STATUS status; SCHANNEL_CONTEXT* context; - context = (SCHANNEL_CONTEXT*) sspi_SecureHandleGetLowerPointer(phContext); + context = (SCHANNEL_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); if (!context) return SEC_E_INVALID_HANDLE; @@ -341,95 +349,88 @@ SECURITY_STATUS SEC_ENTRY schannel_DecryptMessage(PCtxtHandle phContext, PSecBuf return status; } -const SecurityFunctionTableA SCHANNEL_SecurityFunctionTableA = -{ - 1, /* dwVersion */ - NULL, /* EnumerateSecurityPackages */ +const SecurityFunctionTableA SCHANNEL_SecurityFunctionTableA = { + 1, /* dwVersion */ + NULL, /* EnumerateSecurityPackages */ schannel_QueryCredentialsAttributesA, /* QueryCredentialsAttributes */ - schannel_AcquireCredentialsHandleA, /* AcquireCredentialsHandle */ - schannel_FreeCredentialsHandle, /* FreeCredentialsHandle */ - NULL, /* Reserved2 */ - schannel_InitializeSecurityContextA, /* InitializeSecurityContext */ - schannel_AcceptSecurityContext, /* AcceptSecurityContext */ - NULL, /* CompleteAuthToken */ - schannel_DeleteSecurityContext, /* DeleteSecurityContext */ - NULL, /* ApplyControlToken */ - schannel_QueryContextAttributes, /* QueryContextAttributes */ - NULL, /* ImpersonateSecurityContext */ - NULL, /* RevertSecurityContext */ - schannel_MakeSignature, /* MakeSignature */ - schannel_VerifySignature, /* VerifySignature */ - NULL, /* FreeContextBuffer */ - NULL, /* QuerySecurityPackageInfo */ - NULL, /* Reserved3 */ - NULL, /* Reserved4 */ - NULL, /* ExportSecurityContext */ - NULL, /* ImportSecurityContext */ - NULL, /* AddCredentials */ - NULL, /* Reserved8 */ - NULL, /* QuerySecurityContextToken */ - schannel_EncryptMessage, /* EncryptMessage */ - schannel_DecryptMessage, /* DecryptMessage */ - NULL, /* SetContextAttributes */ + schannel_AcquireCredentialsHandleA, /* AcquireCredentialsHandle */ + schannel_FreeCredentialsHandle, /* FreeCredentialsHandle */ + NULL, /* Reserved2 */ + schannel_InitializeSecurityContextA, /* InitializeSecurityContext */ + schannel_AcceptSecurityContext, /* AcceptSecurityContext */ + NULL, /* CompleteAuthToken */ + schannel_DeleteSecurityContext, /* DeleteSecurityContext */ + NULL, /* ApplyControlToken */ + schannel_QueryContextAttributes, /* QueryContextAttributes */ + NULL, /* ImpersonateSecurityContext */ + NULL, /* RevertSecurityContext */ + schannel_MakeSignature, /* MakeSignature */ + schannel_VerifySignature, /* VerifySignature */ + NULL, /* FreeContextBuffer */ + NULL, /* QuerySecurityPackageInfo */ + NULL, /* Reserved3 */ + NULL, /* Reserved4 */ + NULL, /* ExportSecurityContext */ + NULL, /* ImportSecurityContext */ + NULL, /* AddCredentials */ + NULL, /* Reserved8 */ + NULL, /* QuerySecurityContextToken */ + schannel_EncryptMessage, /* EncryptMessage */ + schannel_DecryptMessage, /* DecryptMessage */ + NULL, /* SetContextAttributes */ }; -const SecurityFunctionTableW SCHANNEL_SecurityFunctionTableW = -{ - 1, /* dwVersion */ - NULL, /* EnumerateSecurityPackages */ +const SecurityFunctionTableW SCHANNEL_SecurityFunctionTableW = { + 1, /* dwVersion */ + NULL, /* EnumerateSecurityPackages */ schannel_QueryCredentialsAttributesW, /* QueryCredentialsAttributes */ - schannel_AcquireCredentialsHandleW, /* AcquireCredentialsHandle */ - schannel_FreeCredentialsHandle, /* FreeCredentialsHandle */ - NULL, /* Reserved2 */ - schannel_InitializeSecurityContextW, /* InitializeSecurityContext */ - schannel_AcceptSecurityContext, /* AcceptSecurityContext */ - NULL, /* CompleteAuthToken */ - schannel_DeleteSecurityContext, /* DeleteSecurityContext */ - NULL, /* ApplyControlToken */ - schannel_QueryContextAttributes, /* QueryContextAttributes */ - NULL, /* ImpersonateSecurityContext */ - NULL, /* RevertSecurityContext */ - schannel_MakeSignature, /* MakeSignature */ - schannel_VerifySignature, /* VerifySignature */ - NULL, /* FreeContextBuffer */ - NULL, /* QuerySecurityPackageInfo */ - NULL, /* Reserved3 */ - NULL, /* Reserved4 */ - NULL, /* ExportSecurityContext */ - NULL, /* ImportSecurityContext */ - NULL, /* AddCredentials */ - NULL, /* Reserved8 */ - NULL, /* QuerySecurityContextToken */ - schannel_EncryptMessage, /* EncryptMessage */ - schannel_DecryptMessage, /* DecryptMessage */ - NULL, /* SetContextAttributes */ + schannel_AcquireCredentialsHandleW, /* AcquireCredentialsHandle */ + schannel_FreeCredentialsHandle, /* FreeCredentialsHandle */ + NULL, /* Reserved2 */ + schannel_InitializeSecurityContextW, /* InitializeSecurityContext */ + schannel_AcceptSecurityContext, /* AcceptSecurityContext */ + NULL, /* CompleteAuthToken */ + schannel_DeleteSecurityContext, /* DeleteSecurityContext */ + NULL, /* ApplyControlToken */ + schannel_QueryContextAttributes, /* QueryContextAttributes */ + NULL, /* ImpersonateSecurityContext */ + NULL, /* RevertSecurityContext */ + schannel_MakeSignature, /* MakeSignature */ + schannel_VerifySignature, /* VerifySignature */ + NULL, /* FreeContextBuffer */ + NULL, /* QuerySecurityPackageInfo */ + NULL, /* Reserved3 */ + NULL, /* Reserved4 */ + NULL, /* ExportSecurityContext */ + NULL, /* ImportSecurityContext */ + NULL, /* AddCredentials */ + NULL, /* Reserved8 */ + NULL, /* QuerySecurityContextToken */ + schannel_EncryptMessage, /* EncryptMessage */ + schannel_DecryptMessage, /* DecryptMessage */ + NULL, /* SetContextAttributes */ }; -const SecPkgInfoA SCHANNEL_SecPkgInfoA = -{ - 0x000107B3, /* fCapabilities */ - 1, /* wVersion */ - 0x000E, /* wRPCID */ - SCHANNEL_CB_MAX_TOKEN, /* cbMaxToken */ - "Schannel", /* Name */ +const SecPkgInfoA SCHANNEL_SecPkgInfoA = { + 0x000107B3, /* fCapabilities */ + 1, /* wVersion */ + 0x000E, /* wRPCID */ + SCHANNEL_CB_MAX_TOKEN, /* cbMaxToken */ + "Schannel", /* Name */ "Schannel Security Package" /* Comment */ }; WCHAR SCHANNEL_SecPkgInfoW_Name[] = { 'S', 'c', 'h', 'a', 'n', 'n', 'e', 'l', '\0' }; -WCHAR SCHANNEL_SecPkgInfoW_Comment[] = -{ - 'S', 'c', 'h', 'a', 'n', 'n', 'e', 'l', ' ', - 'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', ' ', - 'P', 'a', 'c', 'k', 'a', 'g', 'e', '\0' -}; +WCHAR SCHANNEL_SecPkgInfoW_Comment[] = { 'S', 'c', 'h', 'a', 'n', 'n', 'e', 'l', ' ', + 'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', ' ', + 'P', 'a', 'c', 'k', 'a', 'g', 'e', '\0' }; -const SecPkgInfoW SCHANNEL_SecPkgInfoW = -{ - 0x000107B3, /* fCapabilities */ - 1, /* wVersion */ - 0x000E, /* wRPCID */ - SCHANNEL_CB_MAX_TOKEN, /* cbMaxToken */ - SCHANNEL_SecPkgInfoW_Name, /* Name */ +const SecPkgInfoW SCHANNEL_SecPkgInfoW = { + 0x000107B3, /* fCapabilities */ + 1, /* wVersion */ + 0x000E, /* wRPCID */ + SCHANNEL_CB_MAX_TOKEN, /* cbMaxToken */ + SCHANNEL_SecPkgInfoW_Name, /* Name */ SCHANNEL_SecPkgInfoW_Comment /* Comment */ }; diff --git a/winpr/libwinpr/sspi/Schannel/schannel.h b/winpr/libwinpr/sspi/Schannel/schannel.h index a4e480a64..fb886a28f 100644 --- a/winpr/libwinpr/sspi/Schannel/schannel.h +++ b/winpr/libwinpr/sspi/Schannel/schannel.h @@ -46,4 +46,3 @@ SCHANNEL_CONTEXT* schannel_ContextNew(void); void schannel_ContextFree(SCHANNEL_CONTEXT* context); #endif /* WINPR_SSPI_SCHANNEL_PRIVATE_H */ - diff --git a/winpr/libwinpr/sspi/Schannel/schannel_openssl.c b/winpr/libwinpr/sspi/Schannel/schannel_openssl.c index fab32e6ee..9641e358a 100644 --- a/winpr/libwinpr/sspi/Schannel/schannel_openssl.c +++ b/winpr/libwinpr/sspi/Schannel/schannel_openssl.c @@ -160,7 +160,7 @@ int schannel_openssl_client_init(SCHANNEL_OPENSSL* context) } SSL_set_bio(context->ssl, context->bioRead, context->bioWrite); - context->ReadBuffer = (BYTE*) malloc(SCHANNEL_CB_MAX_TOKEN); + context->ReadBuffer = (BYTE*)malloc(SCHANNEL_CB_MAX_TOKEN); if (!context->ReadBuffer) { @@ -168,7 +168,7 @@ int schannel_openssl_client_init(SCHANNEL_OPENSSL* context) goto out_read_alloc; } - context->WriteBuffer = (BYTE*) malloc(SCHANNEL_CB_MAX_TOKEN); + context->WriteBuffer = (BYTE*)malloc(SCHANNEL_CB_MAX_TOKEN); if (!context->WriteBuffer) { @@ -301,7 +301,7 @@ int schannel_openssl_server_init(SCHANNEL_OPENSSL* context) } SSL_set_bio(context->ssl, context->bioRead, context->bioWrite); - context->ReadBuffer = (BYTE*) malloc(SCHANNEL_CB_MAX_TOKEN); + context->ReadBuffer = (BYTE*)malloc(SCHANNEL_CB_MAX_TOKEN); if (!context->ReadBuffer) { @@ -309,7 +309,7 @@ int schannel_openssl_server_init(SCHANNEL_OPENSSL* context) goto out_read_buffer; } - context->WriteBuffer = (BYTE*) malloc(SCHANNEL_CB_MAX_TOKEN); + context->WriteBuffer = (BYTE*)malloc(SCHANNEL_CB_MAX_TOKEN); if (!context->WriteBuffer) { @@ -337,7 +337,8 @@ out_rsa_key: } SECURITY_STATUS schannel_openssl_client_process_tokens(SCHANNEL_OPENSSL* context, - PSecBufferDesc pInput, PSecBufferDesc pOutput) + PSecBufferDesc pInput, + PSecBufferDesc pOutput) { int status; int ssl_error; @@ -381,7 +382,7 @@ SECURITY_STATUS schannel_openssl_client_process_tokens(SCHANNEL_OPENSSL* context if (status > 0) { - if (pBuffer->cbBuffer < (unsigned long) status) + if (pBuffer->cbBuffer < (unsigned long)status) return SEC_E_INSUFFICIENT_MEMORY; CopyMemory(pBuffer->pvBuffer, context->ReadBuffer, status); @@ -399,7 +400,8 @@ SECURITY_STATUS schannel_openssl_client_process_tokens(SCHANNEL_OPENSSL* context } SECURITY_STATUS schannel_openssl_server_process_tokens(SCHANNEL_OPENSSL* context, - PSecBufferDesc pInput, PSecBufferDesc pOutput) + PSecBufferDesc pInput, + PSecBufferDesc pOutput) { int status; int ssl_error; @@ -439,7 +441,7 @@ SECURITY_STATUS schannel_openssl_server_process_tokens(SCHANNEL_OPENSSL* context if (status > 0) { - if (pBuffer->cbBuffer < (unsigned long) status) + if (pBuffer->cbBuffer < (unsigned long)status) return SEC_E_INSUFFICIENT_MEMORY; CopyMemory(pBuffer->pvBuffer, context->ReadBuffer, status); @@ -486,18 +488,17 @@ SECURITY_STATUS schannel_openssl_encrypt_message(SCHANNEL_OPENSSL* context, PSec size_t length; size_t offset = 0; - length = (pStreamHeaderBuffer->cbBuffer > ustatus) ? ustatus : - pStreamHeaderBuffer->cbBuffer; + length = + (pStreamHeaderBuffer->cbBuffer > ustatus) ? ustatus : pStreamHeaderBuffer->cbBuffer; CopyMemory(pStreamHeaderBuffer->pvBuffer, &context->ReadBuffer[offset], length); ustatus -= length; offset += length; - length = (pStreamBodyBuffer->cbBuffer > ustatus) ? ustatus : - pStreamBodyBuffer->cbBuffer; + length = (pStreamBodyBuffer->cbBuffer > ustatus) ? ustatus : pStreamBodyBuffer->cbBuffer; CopyMemory(pStreamBodyBuffer->pvBuffer, &context->ReadBuffer[offset], length); ustatus -= length; offset += length; - length = (pStreamTrailerBuffer->cbBuffer > ustatus) ? ustatus : - pStreamTrailerBuffer->cbBuffer; + length = + (pStreamTrailerBuffer->cbBuffer > ustatus) ? ustatus : pStreamTrailerBuffer->cbBuffer; CopyMemory(pStreamTrailerBuffer->pvBuffer, &context->ReadBuffer[offset], length); } @@ -542,7 +543,7 @@ SECURITY_STATUS schannel_openssl_decrypt_message(SCHANNEL_OPENSSL* context, PSec SCHANNEL_OPENSSL* schannel_openssl_new() { SCHANNEL_OPENSSL* context; - context = (SCHANNEL_OPENSSL*) calloc(1, sizeof(SCHANNEL_OPENSSL)); + context = (SCHANNEL_OPENSSL*)calloc(1, sizeof(SCHANNEL_OPENSSL)); if (context != NULL) { @@ -576,13 +577,15 @@ int schannel_openssl_server_init(SCHANNEL_OPENSSL* context) } SECURITY_STATUS schannel_openssl_client_process_tokens(SCHANNEL_OPENSSL* context, - PSecBufferDesc pInput, PSecBufferDesc pOutput) + PSecBufferDesc pInput, + PSecBufferDesc pOutput) { return SEC_E_OK; } SECURITY_STATUS schannel_openssl_server_process_tokens(SCHANNEL_OPENSSL* context, - PSecBufferDesc pInput, PSecBufferDesc pOutput) + PSecBufferDesc pInput, + PSecBufferDesc pOutput) { return SEC_E_OK; } diff --git a/winpr/libwinpr/sspi/Schannel/schannel_openssl.h b/winpr/libwinpr/sspi/Schannel/schannel_openssl.h index 46fb19cda..ac6207cd9 100644 --- a/winpr/libwinpr/sspi/Schannel/schannel_openssl.h +++ b/winpr/libwinpr/sspi/Schannel/schannel_openssl.h @@ -3,7 +3,7 @@ * Schannel Security Package (OpenSSL) * * Copyright 2012 Marc-Andre Moreau - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -32,11 +32,17 @@ typedef struct _SCHANNEL_OPENSSL SCHANNEL_OPENSSL; int schannel_openssl_client_init(SCHANNEL_OPENSSL* context); int schannel_openssl_server_init(SCHANNEL_OPENSSL* context); -SECURITY_STATUS schannel_openssl_client_process_tokens(SCHANNEL_OPENSSL* context, PSecBufferDesc pInput, PSecBufferDesc pOutput); -SECURITY_STATUS schannel_openssl_server_process_tokens(SCHANNEL_OPENSSL* context, PSecBufferDesc pInput, PSecBufferDesc pOutput); +SECURITY_STATUS schannel_openssl_client_process_tokens(SCHANNEL_OPENSSL* context, + PSecBufferDesc pInput, + PSecBufferDesc pOutput); +SECURITY_STATUS schannel_openssl_server_process_tokens(SCHANNEL_OPENSSL* context, + PSecBufferDesc pInput, + PSecBufferDesc pOutput); -SECURITY_STATUS schannel_openssl_encrypt_message(SCHANNEL_OPENSSL* context, PSecBufferDesc pMessage); -SECURITY_STATUS schannel_openssl_decrypt_message(SCHANNEL_OPENSSL* context, PSecBufferDesc pMessage); +SECURITY_STATUS schannel_openssl_encrypt_message(SCHANNEL_OPENSSL* context, + PSecBufferDesc pMessage); +SECURITY_STATUS schannel_openssl_decrypt_message(SCHANNEL_OPENSSL* context, + PSecBufferDesc pMessage); SCHANNEL_OPENSSL* schannel_openssl_new(void); void schannel_openssl_free(SCHANNEL_OPENSSL* context); diff --git a/winpr/libwinpr/sspi/sspi.c b/winpr/libwinpr/sspi/sspi.c index e1ac00d01..75c69ff33 100644 --- a/winpr/libwinpr/sspi/sspi.c +++ b/winpr/libwinpr/sspi/sspi.c @@ -21,7 +21,7 @@ #include "config.h" #endif -#define _NO_KSECDD_IMPORT_ 1 +#define _NO_KSECDD_IMPORT_ 1 #include @@ -61,7 +61,7 @@ BOOL ShouldUseNativeSspi(void) if (!nSize) return TRUE; - env = (LPSTR) malloc(nSize); + env = (LPSTR)malloc(nSize); if (!env) return TRUE; @@ -96,10 +96,10 @@ BOOL InitializeSspiModule_Native(void) if (!g_SspiModule) return FALSE; - pInitSecurityInterfaceW = (INIT_SECURITY_INTERFACE_W) GetProcAddress(g_SspiModule, - "InitSecurityInterfaceW"); - pInitSecurityInterfaceA = (INIT_SECURITY_INTERFACE_A) GetProcAddress(g_SspiModule, - "InitSecurityInterfaceA"); + pInitSecurityInterfaceW = + (INIT_SECURITY_INTERFACE_W)GetProcAddress(g_SspiModule, "InitSecurityInterfaceW"); + pInitSecurityInterfaceA = + (INIT_SECURITY_INTERFACE_A)GetProcAddress(g_SspiModule, "InitSecurityInterfaceA"); if (pInitSecurityInterfaceW) g_SspiW = pInitSecurityInterfaceW(); @@ -457,7 +457,7 @@ SecurityFunctionTableA* SEC_ENTRY InitSecurityInterfaceExA(DWORD flags) /* Package Management */ SECURITY_STATUS SEC_ENTRY sspi_EnumerateSecurityPackagesW(ULONG* pcPackages, - PSecPkgInfoW* ppPackageInfo) + PSecPkgInfoW* ppPackageInfo) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -466,13 +466,13 @@ SECURITY_STATUS SEC_ENTRY sspi_EnumerateSecurityPackagesW(ULONG* pcPackages, return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->EnumerateSecurityPackagesW(pcPackages, ppPackageInfo); - WLog_Print(g_Log, WLOG_DEBUG, "EnumerateSecurityPackagesW: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "EnumerateSecurityPackagesW: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } SECURITY_STATUS SEC_ENTRY sspi_EnumerateSecurityPackagesA(ULONG* pcPackages, - PSecPkgInfoA* ppPackageInfo) + PSecPkgInfoA* ppPackageInfo) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -481,7 +481,7 @@ SECURITY_STATUS SEC_ENTRY sspi_EnumerateSecurityPackagesA(ULONG* pcPackages, return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiA->EnumerateSecurityPackagesA(pcPackages, ppPackageInfo); - WLog_Print(g_Log, WLOG_DEBUG, "EnumerateSecurityPackagesA: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "EnumerateSecurityPackagesA: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } @@ -501,7 +501,7 @@ SecurityFunctionTableA* SEC_ENTRY sspi_InitSecurityInterfaceA(void) } SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityPackageInfoW(SEC_WCHAR* pszPackageName, - PSecPkgInfoW* ppPackageInfo) + PSecPkgInfoW* ppPackageInfo) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -510,13 +510,13 @@ SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityPackageInfoW(SEC_WCHAR* pszPackageNa return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->QuerySecurityPackageInfoW(pszPackageName, ppPackageInfo); - WLog_Print(g_Log, WLOG_DEBUG, "QuerySecurityPackageInfoW: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "QuerySecurityPackageInfoW: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityPackageInfoA(SEC_CHAR* pszPackageName, - PSecPkgInfoA* ppPackageInfo) + PSecPkgInfoA* ppPackageInfo) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -525,17 +525,17 @@ SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityPackageInfoA(SEC_CHAR* pszPackageNam return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiA->QuerySecurityPackageInfoA(pszPackageName, ppPackageInfo); - WLog_Print(g_Log, WLOG_DEBUG, "QuerySecurityPackageInfoA: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "QuerySecurityPackageInfoA: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } /* Credential Management */ -SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleW(SEC_WCHAR* pszPrincipal, - SEC_WCHAR* pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, - void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry) +SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleW( + SEC_WCHAR* pszPrincipal, SEC_WCHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, + void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, + PTimeStamp ptsExpiry) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -543,17 +543,18 @@ SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleW(SEC_WCHAR* pszPrincipal if (!(g_SspiW && g_SspiW->AcquireCredentialsHandleW)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_SspiW->AcquireCredentialsHandleW(pszPrincipal, pszPackage, fCredentialUse, - pvLogonID, pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential, ptsExpiry); - WLog_Print(g_Log, WLOG_DEBUG, "AcquireCredentialsHandleW: %s (0x%08"PRIX32")", + status = g_SspiW->AcquireCredentialsHandleW(pszPrincipal, pszPackage, fCredentialUse, pvLogonID, + pAuthData, pGetKeyFn, pvGetKeyArgument, + phCredential, ptsExpiry); + WLog_Print(g_Log, WLOG_DEBUG, "AcquireCredentialsHandleW: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleA(SEC_CHAR* pszPrincipal, - SEC_CHAR* pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, - void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry) +SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleA( + SEC_CHAR* pszPrincipal, SEC_CHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, + void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, + PTimeStamp ptsExpiry) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -561,15 +562,16 @@ SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleA(SEC_CHAR* pszPrincipal, if (!(g_SspiA && g_SspiA->AcquireCredentialsHandleA)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_SspiA->AcquireCredentialsHandleA(pszPrincipal, pszPackage, fCredentialUse, - pvLogonID, pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential, ptsExpiry); - WLog_Print(g_Log, WLOG_DEBUG, "AcquireCredentialsHandleA: %s (0x%08"PRIX32")", + status = g_SspiA->AcquireCredentialsHandleA(pszPrincipal, pszPackage, fCredentialUse, pvLogonID, + pAuthData, pGetKeyFn, pvGetKeyArgument, + phCredential, ptsExpiry); + WLog_Print(g_Log, WLOG_DEBUG, "AcquireCredentialsHandleA: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } SECURITY_STATUS SEC_ENTRY sspi_ExportSecurityContext(PCtxtHandle phContext, ULONG fFlags, - PSecBuffer pPackedContext, HANDLE* pToken) + PSecBuffer pPackedContext, HANDLE* pToken) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -578,7 +580,7 @@ SECURITY_STATUS SEC_ENTRY sspi_ExportSecurityContext(PCtxtHandle phContext, ULON return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->ExportSecurityContext(phContext, fFlags, pPackedContext, pToken); - WLog_Print(g_Log, WLOG_DEBUG, "ExportSecurityContext: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "ExportSecurityContext: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } @@ -592,13 +594,14 @@ SECURITY_STATUS SEC_ENTRY sspi_FreeCredentialsHandle(PCredHandle phCredential) return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->FreeCredentialsHandle(phCredential); - WLog_Print(g_Log, WLOG_DEBUG, "FreeCredentialsHandle: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "FreeCredentialsHandle: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } SECURITY_STATUS SEC_ENTRY sspi_ImportSecurityContextW(SEC_WCHAR* pszPackage, - PSecBuffer pPackedContext, HANDLE pToken, PCtxtHandle phContext) + PSecBuffer pPackedContext, HANDLE pToken, + PCtxtHandle phContext) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -607,13 +610,14 @@ SECURITY_STATUS SEC_ENTRY sspi_ImportSecurityContextW(SEC_WCHAR* pszPackage, return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->ImportSecurityContextW(pszPackage, pPackedContext, pToken, phContext); - WLog_Print(g_Log, WLOG_DEBUG, "ImportSecurityContextW: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "ImportSecurityContextW: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } SECURITY_STATUS SEC_ENTRY sspi_ImportSecurityContextA(SEC_CHAR* pszPackage, - PSecBuffer pPackedContext, HANDLE pToken, PCtxtHandle phContext) + PSecBuffer pPackedContext, HANDLE pToken, + PCtxtHandle phContext) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -622,13 +626,13 @@ SECURITY_STATUS SEC_ENTRY sspi_ImportSecurityContextA(SEC_CHAR* pszPackage, return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiA->ImportSecurityContextA(pszPackage, pPackedContext, pToken, phContext); - WLog_Print(g_Log, WLOG_DEBUG, "ImportSecurityContextA: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "ImportSecurityContextA: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } SECURITY_STATUS SEC_ENTRY sspi_QueryCredentialsAttributesW(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer) + ULONG ulAttribute, void* pBuffer) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -637,13 +641,13 @@ SECURITY_STATUS SEC_ENTRY sspi_QueryCredentialsAttributesW(PCredHandle phCredent return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->QueryCredentialsAttributesW(phCredential, ulAttribute, pBuffer); - WLog_Print(g_Log, WLOG_DEBUG, "QueryCredentialsAttributesW: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "QueryCredentialsAttributesW: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } SECURITY_STATUS SEC_ENTRY sspi_QueryCredentialsAttributesA(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer) + ULONG ulAttribute, void* pBuffer) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -652,7 +656,7 @@ SECURITY_STATUS SEC_ENTRY sspi_QueryCredentialsAttributesA(PCredHandle phCredent return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiA->QueryCredentialsAttributesA(phCredential, ulAttribute, pBuffer); - WLog_Print(g_Log, WLOG_DEBUG, "QueryCredentialsAttributesA: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "QueryCredentialsAttributesA: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } @@ -660,9 +664,11 @@ SECURITY_STATUS SEC_ENTRY sspi_QueryCredentialsAttributesA(PCredHandle phCredent /* Context Management */ SECURITY_STATUS SEC_ENTRY sspi_AcceptSecurityContext(PCredHandle phCredential, - PCtxtHandle phContext, - PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsTimeStamp) + PCtxtHandle phContext, PSecBufferDesc pInput, + ULONG fContextReq, ULONG TargetDataRep, + PCtxtHandle phNewContext, + PSecBufferDesc pOutput, PULONG pfContextAttr, + PTimeStamp ptsTimeStamp) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -670,9 +676,10 @@ SECURITY_STATUS SEC_ENTRY sspi_AcceptSecurityContext(PCredHandle phCredential, if (!(g_SspiW && g_SspiW->AcceptSecurityContext)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_SspiW->AcceptSecurityContext(phCredential, phContext, pInput, fContextReq, - TargetDataRep, phNewContext, pOutput, pfContextAttr, ptsTimeStamp); - WLog_Print(g_Log, WLOG_DEBUG, "AcceptSecurityContext: %s (0x%08"PRIX32")", + status = + g_SspiW->AcceptSecurityContext(phCredential, phContext, pInput, fContextReq, TargetDataRep, + phNewContext, pOutput, pfContextAttr, ptsTimeStamp); + WLog_Print(g_Log, WLOG_DEBUG, "AcceptSecurityContext: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } @@ -686,7 +693,7 @@ SECURITY_STATUS SEC_ENTRY sspi_ApplyControlToken(PCtxtHandle phContext, PSecBuff return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->ApplyControlToken(phContext, pInput); - WLog_Print(g_Log, WLOG_DEBUG, "ApplyControlToken: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "ApplyControlToken: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } @@ -700,7 +707,7 @@ SECURITY_STATUS SEC_ENTRY sspi_CompleteAuthToken(PCtxtHandle phContext, PSecBuff return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->CompleteAuthToken(phContext, pToken); - WLog_Print(g_Log, WLOG_DEBUG, "CompleteAuthToken: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "CompleteAuthToken: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } @@ -714,7 +721,7 @@ SECURITY_STATUS SEC_ENTRY sspi_DeleteSecurityContext(PCtxtHandle phContext) return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->DeleteSecurityContext(phContext); - WLog_Print(g_Log, WLOG_DEBUG, "DeleteSecurityContext: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "DeleteSecurityContext: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } @@ -728,7 +735,7 @@ SECURITY_STATUS SEC_ENTRY sspi_FreeContextBuffer(void* pvContextBuffer) return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->FreeContextBuffer(pvContextBuffer); - WLog_Print(g_Log, WLOG_DEBUG, "FreeContextBuffer: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "FreeContextBuffer: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } @@ -742,16 +749,15 @@ SECURITY_STATUS SEC_ENTRY sspi_ImpersonateSecurityContext(PCtxtHandle phContext) return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->ImpersonateSecurityContext(phContext); - WLog_Print(g_Log, WLOG_DEBUG, "ImpersonateSecurityContext: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "ImpersonateSecurityContext: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextW(PCredHandle phCredential, - PCtxtHandle phContext, - SEC_WCHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, - PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) +SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextW( + PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR* pszTargetName, ULONG fContextReq, + ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, + PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -759,19 +765,18 @@ SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextW(PCredHandle phCredenti if (!(g_SspiW && g_SspiW->InitializeSecurityContextW)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_SspiW->InitializeSecurityContextW(phCredential, phContext, - pszTargetName, fContextReq, Reserved1, TargetDataRep, pInput, - Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry); - WLog_Print(g_Log, WLOG_DEBUG, "InitializeSecurityContextW: %s (0x%08"PRIX32")", + status = g_SspiW->InitializeSecurityContextW( + phCredential, phContext, pszTargetName, fContextReq, Reserved1, TargetDataRep, pInput, + Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry); + WLog_Print(g_Log, WLOG_DEBUG, "InitializeSecurityContextW: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextA(PCredHandle phCredential, - PCtxtHandle phContext, - SEC_CHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, - PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) +SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextA( + PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR* pszTargetName, ULONG fContextReq, + ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, + PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -779,16 +784,16 @@ SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextA(PCredHandle phCredenti if (!(g_SspiA && g_SspiA->InitializeSecurityContextA)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_SspiA->InitializeSecurityContextA(phCredential, phContext, - pszTargetName, fContextReq, Reserved1, TargetDataRep, pInput, - Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry); - WLog_Print(g_Log, WLOG_DEBUG, "InitializeSecurityContextA: %s (0x%08"PRIX32")", + status = g_SspiA->InitializeSecurityContextA( + phCredential, phContext, pszTargetName, fContextReq, Reserved1, TargetDataRep, pInput, + Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry); + WLog_Print(g_Log, WLOG_DEBUG, "InitializeSecurityContextA: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } SECURITY_STATUS SEC_ENTRY sspi_QueryContextAttributesW(PCtxtHandle phContext, ULONG ulAttribute, - void* pBuffer) + void* pBuffer) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -797,13 +802,13 @@ SECURITY_STATUS SEC_ENTRY sspi_QueryContextAttributesW(PCtxtHandle phContext, UL return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->QueryContextAttributesW(phContext, ulAttribute, pBuffer); - WLog_Print(g_Log, WLOG_DEBUG, "QueryContextAttributesW: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "QueryContextAttributesW: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } SECURITY_STATUS SEC_ENTRY sspi_QueryContextAttributesA(PCtxtHandle phContext, ULONG ulAttribute, - void* pBuffer) + void* pBuffer) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -812,7 +817,7 @@ SECURITY_STATUS SEC_ENTRY sspi_QueryContextAttributesA(PCtxtHandle phContext, UL return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiA->QueryContextAttributesA(phContext, ulAttribute, pBuffer); - WLog_Print(g_Log, WLOG_DEBUG, "QueryContextAttributesA: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "QueryContextAttributesA: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } @@ -826,13 +831,13 @@ SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityContextToken(PCtxtHandle phContext, return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->QuerySecurityContextToken(phContext, phToken); - WLog_Print(g_Log, WLOG_DEBUG, "QuerySecurityContextToken: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "QuerySecurityContextToken: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } SECURITY_STATUS SEC_ENTRY sspi_SetContextAttributesW(PCtxtHandle phContext, ULONG ulAttribute, - void* pBuffer, ULONG cbBuffer) + void* pBuffer, ULONG cbBuffer) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -841,13 +846,13 @@ SECURITY_STATUS SEC_ENTRY sspi_SetContextAttributesW(PCtxtHandle phContext, ULON return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->SetContextAttributesW(phContext, ulAttribute, pBuffer, cbBuffer); - WLog_Print(g_Log, WLOG_DEBUG, "SetContextAttributesW: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "SetContextAttributesW: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } SECURITY_STATUS SEC_ENTRY sspi_SetContextAttributesA(PCtxtHandle phContext, ULONG ulAttribute, - void* pBuffer, ULONG cbBuffer) + void* pBuffer, ULONG cbBuffer) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -856,7 +861,7 @@ SECURITY_STATUS SEC_ENTRY sspi_SetContextAttributesA(PCtxtHandle phContext, ULON return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiA->SetContextAttributesA(phContext, ulAttribute, pBuffer, cbBuffer); - WLog_Print(g_Log, WLOG_DEBUG, "SetContextAttributesA: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "SetContextAttributesA: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } @@ -870,7 +875,7 @@ SECURITY_STATUS SEC_ENTRY sspi_RevertSecurityContext(PCtxtHandle phContext) return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->RevertSecurityContext(phContext); - WLog_Print(g_Log, WLOG_DEBUG, "RevertSecurityContext: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "RevertSecurityContext: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } @@ -878,7 +883,7 @@ SECURITY_STATUS SEC_ENTRY sspi_RevertSecurityContext(PCtxtHandle phContext) /* Message Support */ SECURITY_STATUS SEC_ENTRY sspi_DecryptMessage(PCtxtHandle phContext, PSecBufferDesc pMessage, - ULONG MessageSeqNo, PULONG pfQOP) + ULONG MessageSeqNo, PULONG pfQOP) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -887,13 +892,13 @@ SECURITY_STATUS SEC_ENTRY sspi_DecryptMessage(PCtxtHandle phContext, PSecBufferD return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->DecryptMessage(phContext, pMessage, MessageSeqNo, pfQOP); - WLog_Print(g_Log, WLOG_DEBUG, "DecryptMessage: %s (0x%08"PRIX32")", GetSecurityStatusString(status), - status); + WLog_Print(g_Log, WLOG_DEBUG, "DecryptMessage: %s (0x%08" PRIX32 ")", + GetSecurityStatusString(status), status); return status; } SECURITY_STATUS SEC_ENTRY sspi_EncryptMessage(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo) + PSecBufferDesc pMessage, ULONG MessageSeqNo) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -902,13 +907,13 @@ SECURITY_STATUS SEC_ENTRY sspi_EncryptMessage(PCtxtHandle phContext, ULONG fQOP, return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->EncryptMessage(phContext, fQOP, pMessage, MessageSeqNo); - WLog_Print(g_Log, WLOG_DEBUG, "EncryptMessage: %s (0x%08"PRIX32")", GetSecurityStatusString(status), - status); + WLog_Print(g_Log, WLOG_DEBUG, "EncryptMessage: %s (0x%08" PRIX32 ")", + GetSecurityStatusString(status), status); return status; } SECURITY_STATUS SEC_ENTRY sspi_MakeSignature(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo) + PSecBufferDesc pMessage, ULONG MessageSeqNo) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -917,13 +922,13 @@ SECURITY_STATUS SEC_ENTRY sspi_MakeSignature(PCtxtHandle phContext, ULONG fQOP, return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->MakeSignature(phContext, fQOP, pMessage, MessageSeqNo); - WLog_Print(g_Log, WLOG_DEBUG, "MakeSignature: %s (0x%08"PRIX32")", GetSecurityStatusString(status), - status); + WLog_Print(g_Log, WLOG_DEBUG, "MakeSignature: %s (0x%08" PRIX32 ")", + GetSecurityStatusString(status), status); return status; } SECURITY_STATUS SEC_ENTRY sspi_VerifySignature(PCtxtHandle phContext, PSecBufferDesc pMessage, - ULONG MessageSeqNo, PULONG pfQOP) + ULONG MessageSeqNo, PULONG pfQOP) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, InitializeSspiModuleInt, NULL, NULL); @@ -932,71 +937,69 @@ SECURITY_STATUS SEC_ENTRY sspi_VerifySignature(PCtxtHandle phContext, PSecBuffer return SEC_E_UNSUPPORTED_FUNCTION; status = g_SspiW->VerifySignature(phContext, pMessage, MessageSeqNo, pfQOP); - WLog_Print(g_Log, WLOG_DEBUG, "VerifySignature: %s (0x%08"PRIX32")", + WLog_Print(g_Log, WLOG_DEBUG, "VerifySignature: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -SecurityFunctionTableA sspi_SecurityFunctionTableA = -{ - 1, /* dwVersion */ - sspi_EnumerateSecurityPackagesA, /* EnumerateSecurityPackages */ +SecurityFunctionTableA sspi_SecurityFunctionTableA = { + 1, /* dwVersion */ + sspi_EnumerateSecurityPackagesA, /* EnumerateSecurityPackages */ sspi_QueryCredentialsAttributesA, /* QueryCredentialsAttributes */ - sspi_AcquireCredentialsHandleA, /* AcquireCredentialsHandle */ - sspi_FreeCredentialsHandle, /* FreeCredentialsHandle */ - NULL, /* Reserved2 */ - sspi_InitializeSecurityContextA, /* InitializeSecurityContext */ - sspi_AcceptSecurityContext, /* AcceptSecurityContext */ - sspi_CompleteAuthToken, /* CompleteAuthToken */ - sspi_DeleteSecurityContext, /* DeleteSecurityContext */ - sspi_ApplyControlToken, /* ApplyControlToken */ - sspi_QueryContextAttributesA, /* QueryContextAttributes */ - sspi_ImpersonateSecurityContext, /* ImpersonateSecurityContext */ - sspi_RevertSecurityContext, /* RevertSecurityContext */ - sspi_MakeSignature, /* MakeSignature */ - sspi_VerifySignature, /* VerifySignature */ - sspi_FreeContextBuffer, /* FreeContextBuffer */ - sspi_QuerySecurityPackageInfoA, /* QuerySecurityPackageInfo */ - NULL, /* Reserved3 */ - NULL, /* Reserved4 */ - sspi_ExportSecurityContext, /* ExportSecurityContext */ - sspi_ImportSecurityContextA, /* ImportSecurityContext */ - NULL, /* AddCredentials */ - NULL, /* Reserved8 */ - sspi_QuerySecurityContextToken, /* QuerySecurityContextToken */ - sspi_EncryptMessage, /* EncryptMessage */ - sspi_DecryptMessage, /* DecryptMessage */ - sspi_SetContextAttributesA, /* SetContextAttributes */ + sspi_AcquireCredentialsHandleA, /* AcquireCredentialsHandle */ + sspi_FreeCredentialsHandle, /* FreeCredentialsHandle */ + NULL, /* Reserved2 */ + sspi_InitializeSecurityContextA, /* InitializeSecurityContext */ + sspi_AcceptSecurityContext, /* AcceptSecurityContext */ + sspi_CompleteAuthToken, /* CompleteAuthToken */ + sspi_DeleteSecurityContext, /* DeleteSecurityContext */ + sspi_ApplyControlToken, /* ApplyControlToken */ + sspi_QueryContextAttributesA, /* QueryContextAttributes */ + sspi_ImpersonateSecurityContext, /* ImpersonateSecurityContext */ + sspi_RevertSecurityContext, /* RevertSecurityContext */ + sspi_MakeSignature, /* MakeSignature */ + sspi_VerifySignature, /* VerifySignature */ + sspi_FreeContextBuffer, /* FreeContextBuffer */ + sspi_QuerySecurityPackageInfoA, /* QuerySecurityPackageInfo */ + NULL, /* Reserved3 */ + NULL, /* Reserved4 */ + sspi_ExportSecurityContext, /* ExportSecurityContext */ + sspi_ImportSecurityContextA, /* ImportSecurityContext */ + NULL, /* AddCredentials */ + NULL, /* Reserved8 */ + sspi_QuerySecurityContextToken, /* QuerySecurityContextToken */ + sspi_EncryptMessage, /* EncryptMessage */ + sspi_DecryptMessage, /* DecryptMessage */ + sspi_SetContextAttributesA, /* SetContextAttributes */ }; -SecurityFunctionTableW sspi_SecurityFunctionTableW = -{ - 1, /* dwVersion */ - sspi_EnumerateSecurityPackagesW, /* EnumerateSecurityPackages */ +SecurityFunctionTableW sspi_SecurityFunctionTableW = { + 1, /* dwVersion */ + sspi_EnumerateSecurityPackagesW, /* EnumerateSecurityPackages */ sspi_QueryCredentialsAttributesW, /* QueryCredentialsAttributes */ - sspi_AcquireCredentialsHandleW, /* AcquireCredentialsHandle */ - sspi_FreeCredentialsHandle, /* FreeCredentialsHandle */ - NULL, /* Reserved2 */ - sspi_InitializeSecurityContextW, /* InitializeSecurityContext */ - sspi_AcceptSecurityContext, /* AcceptSecurityContext */ - sspi_CompleteAuthToken, /* CompleteAuthToken */ - sspi_DeleteSecurityContext, /* DeleteSecurityContext */ - sspi_ApplyControlToken, /* ApplyControlToken */ - sspi_QueryContextAttributesW, /* QueryContextAttributes */ - sspi_ImpersonateSecurityContext, /* ImpersonateSecurityContext */ - sspi_RevertSecurityContext, /* RevertSecurityContext */ - sspi_MakeSignature, /* MakeSignature */ - sspi_VerifySignature, /* VerifySignature */ - sspi_FreeContextBuffer, /* FreeContextBuffer */ - sspi_QuerySecurityPackageInfoW, /* QuerySecurityPackageInfo */ - NULL, /* Reserved3 */ - NULL, /* Reserved4 */ - sspi_ExportSecurityContext, /* ExportSecurityContext */ - sspi_ImportSecurityContextW, /* ImportSecurityContext */ - NULL, /* AddCredentials */ - NULL, /* Reserved8 */ - sspi_QuerySecurityContextToken, /* QuerySecurityContextToken */ - sspi_EncryptMessage, /* EncryptMessage */ - sspi_DecryptMessage, /* DecryptMessage */ - sspi_SetContextAttributesW, /* SetContextAttributes */ + sspi_AcquireCredentialsHandleW, /* AcquireCredentialsHandle */ + sspi_FreeCredentialsHandle, /* FreeCredentialsHandle */ + NULL, /* Reserved2 */ + sspi_InitializeSecurityContextW, /* InitializeSecurityContext */ + sspi_AcceptSecurityContext, /* AcceptSecurityContext */ + sspi_CompleteAuthToken, /* CompleteAuthToken */ + sspi_DeleteSecurityContext, /* DeleteSecurityContext */ + sspi_ApplyControlToken, /* ApplyControlToken */ + sspi_QueryContextAttributesW, /* QueryContextAttributes */ + sspi_ImpersonateSecurityContext, /* ImpersonateSecurityContext */ + sspi_RevertSecurityContext, /* RevertSecurityContext */ + sspi_MakeSignature, /* MakeSignature */ + sspi_VerifySignature, /* VerifySignature */ + sspi_FreeContextBuffer, /* FreeContextBuffer */ + sspi_QuerySecurityPackageInfoW, /* QuerySecurityPackageInfo */ + NULL, /* Reserved3 */ + NULL, /* Reserved4 */ + sspi_ExportSecurityContext, /* ExportSecurityContext */ + sspi_ImportSecurityContextW, /* ImportSecurityContext */ + NULL, /* AddCredentials */ + NULL, /* Reserved8 */ + sspi_QuerySecurityContextToken, /* QuerySecurityContextToken */ + sspi_EncryptMessage, /* EncryptMessage */ + sspi_DecryptMessage, /* DecryptMessage */ + sspi_SetContextAttributesW, /* SetContextAttributes */ }; diff --git a/winpr/libwinpr/sspi/sspi.h b/winpr/libwinpr/sspi/sspi.h index bf08cc65e..81c4b60a1 100644 --- a/winpr/libwinpr/sspi/sspi.h +++ b/winpr/libwinpr/sspi/sspi.h @@ -22,11 +22,11 @@ #include -#define SCHANNEL_CB_MAX_TOKEN 0x00006000 +#define SCHANNEL_CB_MAX_TOKEN 0x00006000 -#define SSPI_CREDENTIALS_PASSWORD_HASH 0x00000001 +#define SSPI_CREDENTIALS_PASSWORD_HASH 0x00000001 -#define SSPI_CREDENTIALS_HASH_LENGTH_OFFSET 512 +#define SSPI_CREDENTIALS_HASH_LENGTH_OFFSET 512 struct _SSPI_CREDENTIALS { @@ -53,34 +53,34 @@ void sspi_SecureHandleFree(SecHandle* handle); enum SecurityFunctionTableIndex { - EnumerateSecurityPackagesIndex = 1, - Reserved1Index = 2, - QueryCredentialsAttributesIndex = 3, - AcquireCredentialsHandleIndex = 4, - FreeCredentialsHandleIndex = 5, - Reserved2Index = 6, - InitializeSecurityContextIndex = 7, - AcceptSecurityContextIndex = 8, - CompleteAuthTokenIndex = 9, - DeleteSecurityContextIndex = 10, - ApplyControlTokenIndex = 11, - QueryContextAttributesIndex = 12, - ImpersonateSecurityContextIndex = 13, - RevertSecurityContextIndex = 14, - MakeSignatureIndex = 15, - VerifySignatureIndex = 16, - FreeContextBufferIndex = 17, - QuerySecurityPackageInfoIndex = 18, - Reserved3Index = 19, - Reserved4Index = 20, - ExportSecurityContextIndex = 21, - ImportSecurityContextIndex = 22, - AddCredentialsIndex = 23, - Reserved8Index = 24, - QuerySecurityContextTokenIndex = 25, - EncryptMessageIndex = 26, - DecryptMessageIndex = 27, - SetContextAttributesIndex = 28 + EnumerateSecurityPackagesIndex = 1, + Reserved1Index = 2, + QueryCredentialsAttributesIndex = 3, + AcquireCredentialsHandleIndex = 4, + FreeCredentialsHandleIndex = 5, + Reserved2Index = 6, + InitializeSecurityContextIndex = 7, + AcceptSecurityContextIndex = 8, + CompleteAuthTokenIndex = 9, + DeleteSecurityContextIndex = 10, + ApplyControlTokenIndex = 11, + QueryContextAttributesIndex = 12, + ImpersonateSecurityContextIndex = 13, + RevertSecurityContextIndex = 14, + MakeSignatureIndex = 15, + VerifySignatureIndex = 16, + FreeContextBufferIndex = 17, + QuerySecurityPackageInfoIndex = 18, + Reserved3Index = 19, + Reserved4Index = 20, + ExportSecurityContextIndex = 21, + ImportSecurityContextIndex = 22, + AddCredentialsIndex = 23, + Reserved8Index = 24, + QuerySecurityContextTokenIndex = 25, + EncryptMessageIndex = 26, + DecryptMessageIndex = 27, + SetContextAttributesIndex = 28 }; BOOL IsSecurityStatusError(SECURITY_STATUS status); diff --git a/winpr/libwinpr/sspi/sspi_export.c b/winpr/libwinpr/sspi/sspi_export.c index ea4f69a2d..9cc81f7b0 100644 --- a/winpr/libwinpr/sspi/sspi_export.c +++ b/winpr/libwinpr/sspi/sspi_export.c @@ -23,7 +23,7 @@ #ifdef _WIN32 #define SEC_ENTRY __stdcall -#define SSPI_EXPORT __declspec(dllexport) +#define SSPI_EXPORT __declspec(dllexport) #else #include #define SEC_ENTRY @@ -44,14 +44,16 @@ typedef LONG SECURITY_STATUS; extern SECURITY_STATUS SEC_ENTRY sspi_EnumerateSecurityPackagesW(void*, void*); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesW(void* pcPackages, void* ppPackageInfo) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesW(void* pcPackages, + void* ppPackageInfo) { return sspi_EnumerateSecurityPackagesW(pcPackages, ppPackageInfo); } extern SECURITY_STATUS SEC_ENTRY sspi_EnumerateSecurityPackagesA(void*, void*); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesA(void* pcPackages, void* ppPackageInfo) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesA(void* pcPackages, + void* ppPackageInfo) { return sspi_EnumerateSecurityPackagesA(pcPackages, ppPackageInfo); } @@ -72,43 +74,50 @@ SSPI_EXPORT void* SEC_ENTRY InitSecurityInterfaceA(void) extern SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityPackageInfoW(void*, void*); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QuerySecurityPackageInfoW(void* pszPackageName, void* ppPackageInfo) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QuerySecurityPackageInfoW(void* pszPackageName, + void* ppPackageInfo) { return sspi_QuerySecurityPackageInfoW(pszPackageName, ppPackageInfo); } extern SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityPackageInfoA(void*, void*); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QuerySecurityPackageInfoA(void* pszPackageName, void* ppPackageInfo) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QuerySecurityPackageInfoA(void* pszPackageName, + void* ppPackageInfo) { return sspi_QuerySecurityPackageInfoA(pszPackageName, ppPackageInfo); } /* Credential Management */ -extern SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleW(void*, void*, ULONG, void*, void*, void*, void*, void*, void*); +extern SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleW(void*, void*, ULONG, void*, void*, + void*, void*, void*, void*); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY AcquireCredentialsHandleW(void* pszPrincipal, void* pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, void* pGetKeyFn, - void* pvGetKeyArgument, void* phCredential, void* ptsExpiry) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY AcquireCredentialsHandleW( + void* pszPrincipal, void* pszPackage, ULONG fCredentialUse, void* pvLogonID, void* pAuthData, + void* pGetKeyFn, void* pvGetKeyArgument, void* phCredential, void* ptsExpiry) { - return sspi_AcquireCredentialsHandleW(pszPrincipal, pszPackage, fCredentialUse, - pvLogonID, pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential, ptsExpiry); + return sspi_AcquireCredentialsHandleW(pszPrincipal, pszPackage, fCredentialUse, pvLogonID, + pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential, + ptsExpiry); } -extern SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleA(void*, void*, ULONG, void*, void*, void*, void*, void*, void*); +extern SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleA(void*, void*, ULONG, void*, void*, + void*, void*, void*, void*); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY AcquireCredentialsHandleA(void* pszPrincipal, void* pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, void* pGetKeyFn, - void* pvGetKeyArgument, void* phCredential, void* ptsExpiry) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY AcquireCredentialsHandleA( + void* pszPrincipal, void* pszPackage, ULONG fCredentialUse, void* pvLogonID, void* pAuthData, + void* pGetKeyFn, void* pvGetKeyArgument, void* phCredential, void* ptsExpiry) { - return sspi_AcquireCredentialsHandleA(pszPrincipal, pszPackage, fCredentialUse, - pvLogonID, pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential, ptsExpiry); + return sspi_AcquireCredentialsHandleA(pszPrincipal, pszPackage, fCredentialUse, pvLogonID, + pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential, + ptsExpiry); } extern SECURITY_STATUS SEC_ENTRY sspi_ExportSecurityContext(void*, ULONG, void*, void**); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY ExportSecurityContext(void* phContext, ULONG fFlags, void* pPackedContext, void** pToken) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY ExportSecurityContext(void* phContext, ULONG fFlags, + void* pPackedContext, void** pToken) { return sspi_ExportSecurityContext(phContext, fFlags, pPackedContext, pToken); } @@ -122,42 +131,49 @@ SSPI_EXPORT SECURITY_STATUS SEC_ENTRY FreeCredentialsHandle(void* phCredential) extern SECURITY_STATUS SEC_ENTRY sspi_ImportSecurityContextW(void*, void*, void*, void*); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY ImportSecurityContextW(void* pszPackage, void* pPackedContext, void* pToken, void* phContext) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY ImportSecurityContextW(void* pszPackage, void* pPackedContext, + void* pToken, void* phContext) { return sspi_ImportSecurityContextW(pszPackage, pPackedContext, pToken, phContext); } extern SECURITY_STATUS SEC_ENTRY sspi_ImportSecurityContextA(void*, void*, void*, void*); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY ImportSecurityContextA(void* pszPackage, void* pPackedContext, void* pToken, void* phContext) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY ImportSecurityContextA(void* pszPackage, void* pPackedContext, + void* pToken, void* phContext) { return sspi_ImportSecurityContextA(pszPackage, pPackedContext, pToken, phContext); } extern SECURITY_STATUS SEC_ENTRY sspi_QueryCredentialsAttributesW(void*, ULONG, void*); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesW(void* phCredential, ULONG ulAttribute, void* pBuffer) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesW(void* phCredential, + ULONG ulAttribute, void* pBuffer) { return sspi_QueryCredentialsAttributesW(phCredential, ulAttribute, pBuffer); } extern SECURITY_STATUS SEC_ENTRY sspi_QueryCredentialsAttributesA(void*, ULONG, void*); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesA(void* phCredential, ULONG ulAttribute, void* pBuffer) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesA(void* phCredential, + ULONG ulAttribute, void* pBuffer) { return sspi_QueryCredentialsAttributesA(phCredential, ulAttribute, pBuffer); } /* Context Management */ -extern SECURITY_STATUS SEC_ENTRY sspi_AcceptSecurityContext(void*, void*, void*, ULONG, ULONG, void*, void*, void*, void*); +extern SECURITY_STATUS SEC_ENTRY sspi_AcceptSecurityContext(void*, void*, void*, ULONG, ULONG, + void*, void*, void*, void*); SSPI_EXPORT SECURITY_STATUS SEC_ENTRY AcceptSecurityContext(void* phCredential, void* phContext, - void* pInput, ULONG fContextReq, ULONG TargetDataRep, void* phNewContext, - void* pOutput, void* pfContextAttr, void* ptsTimeStamp) + void* pInput, ULONG fContextReq, + ULONG TargetDataRep, void* phNewContext, + void* pOutput, void* pfContextAttr, + void* ptsTimeStamp) { - return sspi_AcceptSecurityContext(phCredential, phContext, pInput, fContextReq, - TargetDataRep, phNewContext, pOutput, pfContextAttr, ptsTimeStamp); + return sspi_AcceptSecurityContext(phCredential, phContext, pInput, fContextReq, TargetDataRep, + phNewContext, pOutput, pfContextAttr, ptsTimeStamp); } extern SECURITY_STATUS SEC_ENTRY sspi_ApplyControlToken(void*, void*); @@ -195,40 +211,46 @@ SSPI_EXPORT SECURITY_STATUS SEC_ENTRY ImpersonateSecurityContext(void* phContext return sspi_ImpersonateSecurityContext(phContext); } -extern SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextW(void*, void*, void*, ULONG, ULONG, ULONG, - void*, ULONG, void*, void*, void*, void*); +extern SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextW(void*, void*, void*, ULONG, ULONG, + ULONG, void*, ULONG, void*, void*, + void*, void*); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY InitializeSecurityContextW(void* phCredential, void* phContext, - void* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, - void* pInput, ULONG Reserved2, void* phNewContext, - void* pOutput, void* pfContextAttr, void* ptsExpiry) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY InitializeSecurityContextW( + void* phCredential, void* phContext, void* pszTargetName, ULONG fContextReq, ULONG Reserved1, + ULONG TargetDataRep, void* pInput, ULONG Reserved2, void* phNewContext, void* pOutput, + void* pfContextAttr, void* ptsExpiry) { - return sspi_InitializeSecurityContextW(phCredential, phContext, pszTargetName, fContextReq, Reserved1, - TargetDataRep, pInput, Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry); + return sspi_InitializeSecurityContextW(phCredential, phContext, pszTargetName, fContextReq, + Reserved1, TargetDataRep, pInput, Reserved2, + phNewContext, pOutput, pfContextAttr, ptsExpiry); } -extern SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextA(void*, void*, void*, ULONG, ULONG, ULONG, - void*, ULONG, void*, void*, void*, void*); +extern SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextA(void*, void*, void*, ULONG, ULONG, + ULONG, void*, ULONG, void*, void*, + void*, void*); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY InitializeSecurityContextA(void* phCredential, void* phContext, - void* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, - void* pInput, ULONG Reserved2, void* phNewContext, - void* pOutput, void* pfContextAttr, void* ptsExpiry) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY InitializeSecurityContextA( + void* phCredential, void* phContext, void* pszTargetName, ULONG fContextReq, ULONG Reserved1, + ULONG TargetDataRep, void* pInput, ULONG Reserved2, void* phNewContext, void* pOutput, + void* pfContextAttr, void* ptsExpiry) { - return sspi_InitializeSecurityContextA(phCredential, phContext, pszTargetName, fContextReq, Reserved1, - TargetDataRep, pInput, Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry); + return sspi_InitializeSecurityContextA(phCredential, phContext, pszTargetName, fContextReq, + Reserved1, TargetDataRep, pInput, Reserved2, + phNewContext, pOutput, pfContextAttr, ptsExpiry); } extern SECURITY_STATUS SEC_ENTRY sspi_QueryContextAttributesW(void*, ULONG, void*); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QueryContextAttributesW(void* phContext, ULONG ulAttribute, void* pBuffer) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QueryContextAttributesW(void* phContext, ULONG ulAttribute, + void* pBuffer) { return sspi_QueryContextAttributesW(phContext, ulAttribute, pBuffer); } extern SECURITY_STATUS SEC_ENTRY sspi_QueryContextAttributesA(void*, ULONG, void*); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QueryContextAttributesA(void* phContext, ULONG ulAttribute, void* pBuffer) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QueryContextAttributesA(void* phContext, ULONG ulAttribute, + void* pBuffer) { return sspi_QueryContextAttributesA(phContext, ulAttribute, pBuffer); } @@ -242,14 +264,16 @@ SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QuerySecurityContextToken(void* phContext, extern SECURITY_STATUS SEC_ENTRY sspi_SetContextAttributesW(void*, ULONG, void*, ULONG); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY SetContextAttributesW(void* phContext, ULONG ulAttribute, void* pBuffer, ULONG cbBuffer) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY SetContextAttributesW(void* phContext, ULONG ulAttribute, + void* pBuffer, ULONG cbBuffer) { return sspi_SetContextAttributesW(phContext, ulAttribute, pBuffer, cbBuffer); } extern SECURITY_STATUS SEC_ENTRY sspi_SetContextAttributesA(void*, ULONG, void*, ULONG); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY SetContextAttributesA(void* phContext, ULONG ulAttribute, void* pBuffer, ULONG cbBuffer) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY SetContextAttributesA(void* phContext, ULONG ulAttribute, + void* pBuffer, ULONG cbBuffer) { return sspi_SetContextAttributesA(phContext, ulAttribute, pBuffer, cbBuffer); } @@ -265,28 +289,32 @@ SSPI_EXPORT SECURITY_STATUS SEC_ENTRY RevertSecurityContext(void* phContext) extern SECURITY_STATUS SEC_ENTRY sspi_DecryptMessage(void*, void*, ULONG, void*); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY DecryptMessage(void* phContext, void* pMessage, ULONG MessageSeqNo, void* pfQOP) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY DecryptMessage(void* phContext, void* pMessage, + ULONG MessageSeqNo, void* pfQOP) { return sspi_DecryptMessage(phContext, pMessage, MessageSeqNo, pfQOP); } extern SECURITY_STATUS SEC_ENTRY sspi_EncryptMessage(void*, ULONG, void*, ULONG); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY EncryptMessage(void* phContext, ULONG fQOP, void* pMessage, ULONG MessageSeqNo) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY EncryptMessage(void* phContext, ULONG fQOP, void* pMessage, + ULONG MessageSeqNo) { return sspi_EncryptMessage(phContext, fQOP, pMessage, MessageSeqNo); } extern SECURITY_STATUS SEC_ENTRY sspi_MakeSignature(void*, ULONG, void*, ULONG); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY MakeSignature(void* phContext, ULONG fQOP, void* pMessage, ULONG MessageSeqNo) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY MakeSignature(void* phContext, ULONG fQOP, void* pMessage, + ULONG MessageSeqNo) { return sspi_MakeSignature(phContext, fQOP, pMessage, MessageSeqNo); } extern SECURITY_STATUS SEC_ENTRY sspi_VerifySignature(void*, void*, ULONG, void*); -SSPI_EXPORT SECURITY_STATUS SEC_ENTRY VerifySignature(void* phContext, void* pMessage, ULONG MessageSeqNo, void* pfQOP) +SSPI_EXPORT SECURITY_STATUS SEC_ENTRY VerifySignature(void* phContext, void* pMessage, + ULONG MessageSeqNo, void* pfQOP) { return sspi_VerifySignature(phContext, pMessage, MessageSeqNo, pfQOP); } diff --git a/winpr/libwinpr/sspi/sspi_gss.c b/winpr/libwinpr/sspi/sspi_gss.c index b0794ce58..1b1d71642 100644 --- a/winpr/libwinpr/sspi/sspi_gss.c +++ b/winpr/libwinpr/sspi/sspi_gss.c @@ -38,66 +38,65 @@ static INIT_ONCE g_Initialized = INIT_ONCE_STATIC_INIT; #include -GSSAPI_FUNCTION_TABLE g_GssApiLink = -{ - (fn_sspi_gss_acquire_cred) gss_acquire_cred, /* gss_acquire_cred */ - (fn_sspi_gss_release_cred) gss_release_cred, /* gss_release_cred */ - (fn_sspi_gss_init_sec_context) gss_init_sec_context, /* gss_init_sec_context */ - (fn_sspi_gss_accept_sec_context) gss_accept_sec_context, /* gss_accept_sec_context */ - (fn_sspi_gss_process_context_token) gss_process_context_token, /* gss_process_context_token */ - (fn_sspi_gss_delete_sec_context) gss_delete_sec_context, /* gss_delete_sec_context */ - (fn_sspi_gss_context_time) gss_context_time, /* gss_context_time */ - (fn_sspi_gss_get_mic) gss_get_mic, /* gss_get_mic */ - (fn_sspi_gss_verify_mic) gss_verify_mic, /* gss_verify_mic */ - (fn_sspi_gss_wrap) gss_wrap, /* gss_wrap */ - (fn_sspi_gss_unwrap) gss_unwrap, /* gss_unwrap */ - (fn_sspi_gss_display_status) gss_display_status, /* gss_display_status */ - (fn_sspi_gss_indicate_mechs) gss_indicate_mechs, /* gss_indicate_mechs */ - (fn_sspi_gss_compare_name) gss_compare_name, /* gss_compare_name */ - (fn_sspi_gss_display_name) gss_display_name, /* gss_display_name */ - (fn_sspi_gss_import_name) gss_import_name, /* gss_import_name */ - (fn_sspi_gss_release_name) gss_release_name, /* gss_release_name */ - (fn_sspi_gss_release_buffer) gss_release_buffer, /* gss_release_buffer */ - (fn_sspi_gss_release_oid_set) gss_release_oid_set, /* gss_release_oid_set */ - (fn_sspi_gss_inquire_cred) gss_inquire_cred, /* gss_inquire_cred */ - (fn_sspi_gss_inquire_context) gss_inquire_context, /* gss_inquire_context */ - (fn_sspi_gss_wrap_size_limit) gss_wrap_size_limit, /* gss_wrap_size_limit */ +GSSAPI_FUNCTION_TABLE g_GssApiLink = { + (fn_sspi_gss_acquire_cred)gss_acquire_cred, /* gss_acquire_cred */ + (fn_sspi_gss_release_cred)gss_release_cred, /* gss_release_cred */ + (fn_sspi_gss_init_sec_context)gss_init_sec_context, /* gss_init_sec_context */ + (fn_sspi_gss_accept_sec_context)gss_accept_sec_context, /* gss_accept_sec_context */ + (fn_sspi_gss_process_context_token)gss_process_context_token, /* gss_process_context_token */ + (fn_sspi_gss_delete_sec_context)gss_delete_sec_context, /* gss_delete_sec_context */ + (fn_sspi_gss_context_time)gss_context_time, /* gss_context_time */ + (fn_sspi_gss_get_mic)gss_get_mic, /* gss_get_mic */ + (fn_sspi_gss_verify_mic)gss_verify_mic, /* gss_verify_mic */ + (fn_sspi_gss_wrap)gss_wrap, /* gss_wrap */ + (fn_sspi_gss_unwrap)gss_unwrap, /* gss_unwrap */ + (fn_sspi_gss_display_status)gss_display_status, /* gss_display_status */ + (fn_sspi_gss_indicate_mechs)gss_indicate_mechs, /* gss_indicate_mechs */ + (fn_sspi_gss_compare_name)gss_compare_name, /* gss_compare_name */ + (fn_sspi_gss_display_name)gss_display_name, /* gss_display_name */ + (fn_sspi_gss_import_name)gss_import_name, /* gss_import_name */ + (fn_sspi_gss_release_name)gss_release_name, /* gss_release_name */ + (fn_sspi_gss_release_buffer)gss_release_buffer, /* gss_release_buffer */ + (fn_sspi_gss_release_oid_set)gss_release_oid_set, /* gss_release_oid_set */ + (fn_sspi_gss_inquire_cred)gss_inquire_cred, /* gss_inquire_cred */ + (fn_sspi_gss_inquire_context)gss_inquire_context, /* gss_inquire_context */ + (fn_sspi_gss_wrap_size_limit)gss_wrap_size_limit, /* gss_wrap_size_limit */ #if 0 (fn_sspi_gss_import_name_object) gss_import_name_object, /* gss_import_name_object */ (fn_sspi_gss_export_name_object) gss_export_name_object, /* gss_export_name_object */ #else - (fn_sspi_gss_import_name_object) NULL, /* gss_import_name_object */ - (fn_sspi_gss_export_name_object) NULL, /* gss_export_name_object */ + (fn_sspi_gss_import_name_object)NULL, /* gss_import_name_object */ + (fn_sspi_gss_export_name_object)NULL, /* gss_export_name_object */ #endif - (fn_sspi_gss_add_cred) gss_add_cred, /* gss_add_cred */ - (fn_sspi_gss_inquire_cred_by_mech) gss_inquire_cred_by_mech, /* gss_inquire_cred_by_mech */ - (fn_sspi_gss_export_sec_context) gss_export_sec_context, /* gss_export_sec_context */ - (fn_sspi_gss_import_sec_context) gss_import_sec_context, /* gss_import_sec_context */ - (fn_sspi_gss_release_oid) gss_release_oid, /* gss_release_oid */ - (fn_sspi_gss_create_empty_oid_set) gss_create_empty_oid_set, /* gss_create_empty_oid_set */ - (fn_sspi_gss_add_oid_set_member) gss_add_oid_set_member, /* gss_add_oid_set_member */ - (fn_sspi_gss_test_oid_set_member) gss_test_oid_set_member, /* gss_test_oid_set_member */ + (fn_sspi_gss_add_cred)gss_add_cred, /* gss_add_cred */ + (fn_sspi_gss_inquire_cred_by_mech)gss_inquire_cred_by_mech, /* gss_inquire_cred_by_mech */ + (fn_sspi_gss_export_sec_context)gss_export_sec_context, /* gss_export_sec_context */ + (fn_sspi_gss_import_sec_context)gss_import_sec_context, /* gss_import_sec_context */ + (fn_sspi_gss_release_oid)gss_release_oid, /* gss_release_oid */ + (fn_sspi_gss_create_empty_oid_set)gss_create_empty_oid_set, /* gss_create_empty_oid_set */ + (fn_sspi_gss_add_oid_set_member)gss_add_oid_set_member, /* gss_add_oid_set_member */ + (fn_sspi_gss_test_oid_set_member)gss_test_oid_set_member, /* gss_test_oid_set_member */ #if 0 (fn_sspi_gss_str_to_oid) gss_str_to_oid, /* gss_str_to_oid */ #else - (fn_sspi_gss_str_to_oid) NULL, /* gss_str_to_oid */ + (fn_sspi_gss_str_to_oid)NULL, /* gss_str_to_oid */ #endif - (fn_sspi_gss_oid_to_str) gss_oid_to_str, /* gss_oid_to_str */ - (fn_sspi_gss_inquire_names_for_mech) gss_inquire_names_for_mech, /* gss_inquire_names_for_mech */ - (fn_sspi_gss_inquire_mechs_for_name) gss_inquire_mechs_for_name, /* gss_inquire_mechs_for_name */ - (fn_sspi_gss_sign) gss_sign, /* gss_sign */ - (fn_sspi_gss_verify) gss_verify, /* gss_verify */ - (fn_sspi_gss_seal) gss_seal, /* gss_seal */ - (fn_sspi_gss_unseal) gss_unseal, /* gss_unseal */ - (fn_sspi_gss_export_name) gss_export_name, /* gss_export_name */ - (fn_sspi_gss_duplicate_name) gss_duplicate_name, /* gss_duplicate_name */ - (fn_sspi_gss_canonicalize_name) gss_canonicalize_name, /* gss_canonicalize_name */ - (fn_sspi_gss_pseudo_random) gss_pseudo_random, /* gss_pseudo_random */ - (fn_sspi_gss_store_cred) gss_store_cred, /* gss_store_cred */ + (fn_sspi_gss_oid_to_str)gss_oid_to_str, /* gss_oid_to_str */ + (fn_sspi_gss_inquire_names_for_mech)gss_inquire_names_for_mech, /* gss_inquire_names_for_mech */ + (fn_sspi_gss_inquire_mechs_for_name)gss_inquire_mechs_for_name, /* gss_inquire_mechs_for_name */ + (fn_sspi_gss_sign)gss_sign, /* gss_sign */ + (fn_sspi_gss_verify)gss_verify, /* gss_verify */ + (fn_sspi_gss_seal)gss_seal, /* gss_seal */ + (fn_sspi_gss_unseal)gss_unseal, /* gss_unseal */ + (fn_sspi_gss_export_name)gss_export_name, /* gss_export_name */ + (fn_sspi_gss_duplicate_name)gss_duplicate_name, /* gss_duplicate_name */ + (fn_sspi_gss_canonicalize_name)gss_canonicalize_name, /* gss_canonicalize_name */ + (fn_sspi_gss_pseudo_random)gss_pseudo_random, /* gss_pseudo_random */ + (fn_sspi_gss_store_cred)gss_store_cred, /* gss_store_cred */ #if 0 (fn_sspi_gss_set_neg_mechs) gss_set_neg_mechs, /* gss_set_neg_mechs */ #else - (fn_sspi_gss_set_neg_mechs) NULL, /* gss_set_neg_mechs */ + (fn_sspi_gss_set_neg_mechs)NULL, /* gss_set_neg_mechs */ #endif }; @@ -126,13 +125,23 @@ static BOOL CALLBACK sspi_GssApiInit(PINIT_ONCE once, PVOID param, PVOID* contex * SSPI GSSAPI OIDs */ -static sspi_gss_OID_desc g_SSPI_GSS_C_NT_USER_NAME = { 10, (void*) "\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01" }; -static sspi_gss_OID_desc g_SSPI_GSS_C_NT_MACHINE_UID_NAME = { 10, (void*) "\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02" }; -static sspi_gss_OID_desc g_SSPI_GSS_C_NT_STRING_UID_NAME = { 10, (void*) "\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03" }; -static sspi_gss_OID_desc g_SSPI_GSS_C_NT_HOSTBASED_SERVICE_X = { 6, (void*) "\x2b\x06\x01\x05\x06\x02" }; -static sspi_gss_OID_desc g_SSPI_GSS_C_NT_HOSTBASED_SERVICE = { 10, (void*) "\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x04" }; -static sspi_gss_OID_desc g_SSPI_GSS_C_NT_ANONYMOUS = { 6, (void*) "\x2b\x06\01\x05\x06\x03" }; -static sspi_gss_OID_desc g_SSPI_GSS_C_NT_EXPORT_NAME = { 6, (void*) "\x2b\x06\x01\x05\x06\x04" }; +static sspi_gss_OID_desc g_SSPI_GSS_C_NT_USER_NAME = { + 10, (void*)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01" +}; +static sspi_gss_OID_desc g_SSPI_GSS_C_NT_MACHINE_UID_NAME = { + 10, (void*)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02" +}; +static sspi_gss_OID_desc g_SSPI_GSS_C_NT_STRING_UID_NAME = { + 10, (void*)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03" +}; +static sspi_gss_OID_desc g_SSPI_GSS_C_NT_HOSTBASED_SERVICE_X = { + 6, (void*)"\x2b\x06\x01\x05\x06\x02" +}; +static sspi_gss_OID_desc g_SSPI_GSS_C_NT_HOSTBASED_SERVICE = { + 10, (void*)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x04" +}; +static sspi_gss_OID_desc g_SSPI_GSS_C_NT_ANONYMOUS = { 6, (void*)"\x2b\x06\01\x05\x06\x03" }; +static sspi_gss_OID_desc g_SSPI_GSS_C_NT_EXPORT_NAME = { 6, (void*)"\x2b\x06\x01\x05\x06\x04" }; sspi_gss_OID SSPI_GSS_C_NT_USER_NAME = &g_SSPI_GSS_C_NT_USER_NAME; sspi_gss_OID SSPI_GSS_C_NT_MACHINE_UID_NAME = &g_SSPI_GSS_C_NT_MACHINE_UID_NAME; @@ -142,20 +151,15 @@ sspi_gss_OID SSPI_GSS_C_NT_HOSTBASED_SERVICE = &g_SSPI_GSS_C_NT_HOSTBASED_SERVIC sspi_gss_OID SSPI_GSS_C_NT_ANONYMOUS = &g_SSPI_GSS_C_NT_ANONYMOUS; sspi_gss_OID SSPI_GSS_C_NT_EXPORT_NAME = &g_SSPI_GSS_C_NT_EXPORT_NAME; - /** * SSPI GSSAPI */ -UINT32 SSPI_GSSAPI sspi_gss_acquire_cred( - UINT32* minor_status, - sspi_gss_name_t desired_name, - UINT32 time_req, - sspi_gss_OID_set desired_mechs, - sspi_gss_cred_usage_t cred_usage, - sspi_gss_cred_id_t* output_cred_handle, - sspi_gss_OID_set* actual_mechs, - UINT32* time_rec) +UINT32 SSPI_GSSAPI sspi_gss_acquire_cred(UINT32* minor_status, sspi_gss_name_t desired_name, + UINT32 time_req, sspi_gss_OID_set desired_mechs, + sspi_gss_cred_usage_t cred_usage, + sspi_gss_cred_id_t* output_cred_handle, + sspi_gss_OID_set* actual_mechs, UINT32* time_rec) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -163,16 +167,14 @@ UINT32 SSPI_GSSAPI sspi_gss_acquire_cred( if (!(g_GssApi && g_GssApi->gss_acquire_cred)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_GssApi->gss_acquire_cred(minor_status, desired_name, time_req, - desired_mechs, cred_usage, output_cred_handle, actual_mechs, time_rec); - WLog_DBG(TAG, "gss_acquire_cred: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + status = g_GssApi->gss_acquire_cred(minor_status, desired_name, time_req, desired_mechs, + cred_usage, output_cred_handle, actual_mechs, time_rec); + WLog_DBG(TAG, "gss_acquire_cred: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_release_cred( - UINT32* minor_status, - sspi_gss_cred_id_t* cred_handle) +UINT32 SSPI_GSSAPI sspi_gss_release_cred(UINT32* minor_status, sspi_gss_cred_id_t* cred_handle) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -181,25 +183,17 @@ UINT32 SSPI_GSSAPI sspi_gss_release_cred( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_release_cred(minor_status, cred_handle); - WLog_DBG(TAG, "gss_release_cred: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_release_cred: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } UINT32 SSPI_GSSAPI sspi_gss_init_sec_context( - UINT32* minor_status, - sspi_gss_cred_id_t claimant_cred_handle, - sspi_gss_ctx_id_t* context_handle, - sspi_gss_name_t target_name, - sspi_gss_OID mech_type, - UINT32 req_flags, - UINT32 time_req, - sspi_gss_channel_bindings_t input_chan_bindings, - sspi_gss_buffer_t input_token, - sspi_gss_OID* actual_mech_type, - sspi_gss_buffer_t output_token, - UINT32* ret_flags, - UINT32* time_rec) + UINT32* minor_status, sspi_gss_cred_id_t claimant_cred_handle, + sspi_gss_ctx_id_t* context_handle, sspi_gss_name_t target_name, sspi_gss_OID mech_type, + UINT32 req_flags, UINT32 time_req, sspi_gss_channel_bindings_t input_chan_bindings, + sspi_gss_buffer_t input_token, sspi_gss_OID* actual_mech_type, sspi_gss_buffer_t output_token, + UINT32* ret_flags, UINT32* time_rec) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -208,24 +202,19 @@ UINT32 SSPI_GSSAPI sspi_gss_init_sec_context( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_init_sec_context(minor_status, claimant_cred_handle, context_handle, - target_name, mech_type, req_flags, time_req, input_chan_bindings, - input_token, actual_mech_type, output_token, ret_flags, time_rec); - WLog_DBG(TAG, "gss_init_sec_context: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + target_name, mech_type, req_flags, time_req, + input_chan_bindings, input_token, actual_mech_type, + output_token, ret_flags, time_rec); + WLog_DBG(TAG, "gss_init_sec_context: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } UINT32 SSPI_GSSAPI sspi_gss_accept_sec_context( - UINT32* minor_status, - sspi_gss_ctx_id_t* context_handle, - sspi_gss_cred_id_t acceptor_cred_handle, - sspi_gss_buffer_t input_token_buffer, - sspi_gss_channel_bindings_t input_chan_bindings, - sspi_gss_name_t* src_name, - sspi_gss_OID* mech_type, - sspi_gss_buffer_t output_token, - UINT32* ret_flags, - UINT32* time_rec, + UINT32* minor_status, sspi_gss_ctx_id_t* context_handle, + sspi_gss_cred_id_t acceptor_cred_handle, sspi_gss_buffer_t input_token_buffer, + sspi_gss_channel_bindings_t input_chan_bindings, sspi_gss_name_t* src_name, + sspi_gss_OID* mech_type, sspi_gss_buffer_t output_token, UINT32* ret_flags, UINT32* time_rec, sspi_gss_cred_id_t* delegated_cred_handle) { SECURITY_STATUS status; @@ -234,18 +223,17 @@ UINT32 SSPI_GSSAPI sspi_gss_accept_sec_context( if (!(g_GssApi && g_GssApi->gss_accept_sec_context)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_GssApi->gss_accept_sec_context(minor_status, context_handle, acceptor_cred_handle, - input_token_buffer, input_chan_bindings, src_name, mech_type, output_token, - ret_flags, time_rec, delegated_cred_handle); - WLog_DBG(TAG, "gss_accept_sec_context: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + status = g_GssApi->gss_accept_sec_context( + minor_status, context_handle, acceptor_cred_handle, input_token_buffer, input_chan_bindings, + src_name, mech_type, output_token, ret_flags, time_rec, delegated_cred_handle); + WLog_DBG(TAG, "gss_accept_sec_context: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_process_context_token( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_buffer_t token_buffer) +UINT32 SSPI_GSSAPI sspi_gss_process_context_token(UINT32* minor_status, + sspi_gss_ctx_id_t context_handle, + sspi_gss_buffer_t token_buffer) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -254,15 +242,14 @@ UINT32 SSPI_GSSAPI sspi_gss_process_context_token( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_process_context_token(minor_status, context_handle, token_buffer); - WLog_DBG(TAG, "gss_process_context_token: %s (0x%08"PRIX32")", + WLog_DBG(TAG, "gss_process_context_token: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_delete_sec_context( - UINT32* minor_status, - sspi_gss_ctx_id_t* context_handle, - sspi_gss_buffer_t output_token) +UINT32 SSPI_GSSAPI sspi_gss_delete_sec_context(UINT32* minor_status, + sspi_gss_ctx_id_t* context_handle, + sspi_gss_buffer_t output_token) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -271,15 +258,13 @@ UINT32 SSPI_GSSAPI sspi_gss_delete_sec_context( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_delete_sec_context(minor_status, context_handle, output_token); - WLog_DBG(TAG, "gss_delete_sec_context: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_delete_sec_context: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_context_time( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - UINT32* time_rec) +UINT32 SSPI_GSSAPI sspi_gss_context_time(UINT32* minor_status, sspi_gss_ctx_id_t context_handle, + UINT32* time_rec) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -288,17 +273,14 @@ UINT32 SSPI_GSSAPI sspi_gss_context_time( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_context_time(minor_status, context_handle, time_rec); - WLog_DBG(TAG, "gss_context_time: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_context_time: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_get_mic( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_qop_t qop_req, - sspi_gss_buffer_t message_buffer, - sspi_gss_buffer_t message_token) +UINT32 SSPI_GSSAPI sspi_gss_get_mic(UINT32* minor_status, sspi_gss_ctx_id_t context_handle, + sspi_gss_qop_t qop_req, sspi_gss_buffer_t message_buffer, + sspi_gss_buffer_t message_token) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -306,19 +288,15 @@ UINT32 SSPI_GSSAPI sspi_gss_get_mic( if (!(g_GssApi && g_GssApi->gss_get_mic)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_GssApi->gss_get_mic(minor_status, context_handle, qop_req, message_buffer, - message_token); - WLog_DBG(TAG, "gss_get_mic: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + status = + g_GssApi->gss_get_mic(minor_status, context_handle, qop_req, message_buffer, message_token); + WLog_DBG(TAG, "gss_get_mic: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_verify_mic( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_buffer_t message_buffer, - sspi_gss_buffer_t message_token, - sspi_gss_qop_t* qop_state) +UINT32 SSPI_GSSAPI sspi_gss_verify_mic(UINT32* minor_status, sspi_gss_ctx_id_t context_handle, + sspi_gss_buffer_t message_buffer, + sspi_gss_buffer_t message_token, sspi_gss_qop_t* qop_state) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -328,19 +306,14 @@ UINT32 SSPI_GSSAPI sspi_gss_verify_mic( status = g_GssApi->gss_verify_mic(minor_status, context_handle, message_buffer, message_token, qop_state); - WLog_DBG(TAG, "gss_verify_mic: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_verify_mic: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_wrap( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - int conf_req_flag, - sspi_gss_qop_t qop_req, - sspi_gss_buffer_t input_message_buffer, - int* conf_state, - sspi_gss_buffer_t output_message_buffer) +UINT32 SSPI_GSSAPI sspi_gss_wrap(UINT32* minor_status, sspi_gss_ctx_id_t context_handle, + int conf_req_flag, sspi_gss_qop_t qop_req, + sspi_gss_buffer_t input_message_buffer, int* conf_state, + sspi_gss_buffer_t output_message_buffer) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -348,20 +321,17 @@ UINT32 SSPI_GSSAPI sspi_gss_wrap( if (!(g_GssApi && g_GssApi->gss_wrap)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_GssApi->gss_wrap(minor_status, context_handle, conf_req_flag, - qop_req, input_message_buffer, conf_state, output_message_buffer); - WLog_DBG(TAG, "gss_acquire_cred: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + status = g_GssApi->gss_wrap(minor_status, context_handle, conf_req_flag, qop_req, + input_message_buffer, conf_state, output_message_buffer); + WLog_DBG(TAG, "gss_acquire_cred: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_unwrap( - UINT32* minor_status, - const sspi_gss_ctx_id_t context_handle, - const sspi_gss_buffer_t input_message_buffer, - sspi_gss_buffer_t output_message_buffer, - int* conf_state, - sspi_gss_qop_t* qop_state) +UINT32 SSPI_GSSAPI sspi_gss_unwrap(UINT32* minor_status, const sspi_gss_ctx_id_t context_handle, + const sspi_gss_buffer_t input_message_buffer, + sspi_gss_buffer_t output_message_buffer, int* conf_state, + sspi_gss_qop_t* qop_state) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -371,18 +341,13 @@ UINT32 SSPI_GSSAPI sspi_gss_unwrap( status = g_GssApi->gss_unwrap(minor_status, context_handle, input_message_buffer, output_message_buffer, conf_state, qop_state); - WLog_DBG(TAG, "gss_unwrap: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_unwrap: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_display_status( - UINT32* minor_status, - UINT32 status_value, - int status_type, - sspi_gss_OID mech_type, - UINT32* message_context, - sspi_gss_buffer_t status_string) +UINT32 SSPI_GSSAPI sspi_gss_display_status(UINT32* minor_status, UINT32 status_value, + int status_type, sspi_gss_OID mech_type, + UINT32* message_context, sspi_gss_buffer_t status_string) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -390,16 +355,14 @@ UINT32 SSPI_GSSAPI sspi_gss_display_status( if (!(g_GssApi && g_GssApi->gss_display_status)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_GssApi->gss_display_status(minor_status, status_value, status_type, - mech_type, message_context, status_string); - WLog_DBG(TAG, "gss_display_status: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + status = g_GssApi->gss_display_status(minor_status, status_value, status_type, mech_type, + message_context, status_string); + WLog_DBG(TAG, "gss_display_status: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_indicate_mechs( - UINT32* minor_status, - sspi_gss_OID_set* mech_set) +UINT32 SSPI_GSSAPI sspi_gss_indicate_mechs(UINT32* minor_status, sspi_gss_OID_set* mech_set) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -408,16 +371,13 @@ UINT32 SSPI_GSSAPI sspi_gss_indicate_mechs( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_indicate_mechs(minor_status, mech_set); - WLog_DBG(TAG, "gss_indicate_mechs: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_indicate_mechs: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_compare_name( - UINT32* minor_status, - sspi_gss_name_t name1, - sspi_gss_name_t name2, - int* name_equal) +UINT32 SSPI_GSSAPI sspi_gss_compare_name(UINT32* minor_status, sspi_gss_name_t name1, + sspi_gss_name_t name2, int* name_equal) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -426,16 +386,14 @@ UINT32 SSPI_GSSAPI sspi_gss_compare_name( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_compare_name(minor_status, name1, name2, name_equal); - WLog_DBG(TAG, "gss_compare_name: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_compare_name: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_display_name( - UINT32* minor_status, - sspi_gss_name_t input_name, - sspi_gss_buffer_t output_name_buffer, - sspi_gss_OID* output_name_type) +UINT32 SSPI_GSSAPI sspi_gss_display_name(UINT32* minor_status, sspi_gss_name_t input_name, + sspi_gss_buffer_t output_name_buffer, + sspi_gss_OID* output_name_type) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -443,17 +401,15 @@ UINT32 SSPI_GSSAPI sspi_gss_display_name( if (!(g_GssApi && g_GssApi->gss_display_name)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_GssApi->gss_display_name(minor_status, input_name, output_name_buffer, output_name_type); - WLog_DBG(TAG, "gss_display_name: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + status = + g_GssApi->gss_display_name(minor_status, input_name, output_name_buffer, output_name_type); + WLog_DBG(TAG, "gss_display_name: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_import_name( - UINT32* minor_status, - sspi_gss_buffer_t input_name_buffer, - sspi_gss_OID input_name_type, - sspi_gss_name_t* output_name) +UINT32 SSPI_GSSAPI sspi_gss_import_name(UINT32* minor_status, sspi_gss_buffer_t input_name_buffer, + sspi_gss_OID input_name_type, sspi_gss_name_t* output_name) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -461,15 +417,13 @@ UINT32 SSPI_GSSAPI sspi_gss_import_name( if (!(g_GssApi && g_GssApi->gss_import_name)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_GssApi->gss_import_name(minor_status, input_name_buffer, input_name_type, output_name); - WLog_DBG(TAG, "gss_import_name: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + status = + g_GssApi->gss_import_name(minor_status, input_name_buffer, input_name_type, output_name); + WLog_DBG(TAG, "gss_import_name: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_release_name( - UINT32* minor_status, - sspi_gss_name_t* input_name) +UINT32 SSPI_GSSAPI sspi_gss_release_name(UINT32* minor_status, sspi_gss_name_t* input_name) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -478,14 +432,12 @@ UINT32 SSPI_GSSAPI sspi_gss_release_name( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_release_name(minor_status, input_name); - WLog_DBG(TAG, "gss_release_name: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_release_name: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_release_buffer( - UINT32* minor_status, - sspi_gss_buffer_t buffer) +UINT32 SSPI_GSSAPI sspi_gss_release_buffer(UINT32* minor_status, sspi_gss_buffer_t buffer) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -494,14 +446,12 @@ UINT32 SSPI_GSSAPI sspi_gss_release_buffer( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_release_buffer(minor_status, buffer); - WLog_DBG(TAG, "gss_release_buffer: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_release_buffer: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_release_oid_set( - UINT32* minor_status, - sspi_gss_OID_set* set) +UINT32 SSPI_GSSAPI sspi_gss_release_oid_set(UINT32* minor_status, sspi_gss_OID_set* set) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -510,18 +460,15 @@ UINT32 SSPI_GSSAPI sspi_gss_release_oid_set( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_release_oid_set(minor_status, set); - WLog_DBG(TAG, "gss_release_oid_set: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_release_oid_set: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_inquire_cred( - UINT32* minor_status, - sspi_gss_cred_id_t cred_handle, - sspi_gss_name_t* name, - UINT32* lifetime, - sspi_gss_cred_usage_t* cred_usage, - sspi_gss_OID_set* mechanisms) +UINT32 SSPI_GSSAPI sspi_gss_inquire_cred(UINT32* minor_status, sspi_gss_cred_id_t cred_handle, + sspi_gss_name_t* name, UINT32* lifetime, + sspi_gss_cred_usage_t* cred_usage, + sspi_gss_OID_set* mechanisms) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -531,21 +478,15 @@ UINT32 SSPI_GSSAPI sspi_gss_inquire_cred( status = g_GssApi->gss_inquire_cred(minor_status, cred_handle, name, lifetime, cred_usage, mechanisms); - WLog_DBG(TAG, "gss_inquire_cred: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_inquire_cred: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_inquire_context( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_name_t* src_name, - sspi_gss_name_t* targ_name, - UINT32* lifetime_rec, - sspi_gss_OID* mech_type, - UINT32* ctx_flags, - int* locally_initiated, - int* open) +UINT32 SSPI_GSSAPI sspi_gss_inquire_context(UINT32* minor_status, sspi_gss_ctx_id_t context_handle, + sspi_gss_name_t* src_name, sspi_gss_name_t* targ_name, + UINT32* lifetime_rec, sspi_gss_OID* mech_type, + UINT32* ctx_flags, int* locally_initiated, int* open) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -553,20 +494,17 @@ UINT32 SSPI_GSSAPI sspi_gss_inquire_context( if (!(g_GssApi && g_GssApi->gss_inquire_context)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_GssApi->gss_inquire_context(minor_status, context_handle, src_name, targ_name, - lifetime_rec, mech_type, ctx_flags, locally_initiated, open); - WLog_DBG(TAG, "gss_inquire_context: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + status = + g_GssApi->gss_inquire_context(minor_status, context_handle, src_name, targ_name, + lifetime_rec, mech_type, ctx_flags, locally_initiated, open); + WLog_DBG(TAG, "gss_inquire_context: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_wrap_size_limit( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - int conf_req_flag, - sspi_gss_qop_t qop_req, - UINT32 req_output_size, - UINT32* max_input_size) +UINT32 SSPI_GSSAPI sspi_gss_wrap_size_limit(UINT32* minor_status, sspi_gss_ctx_id_t context_handle, + int conf_req_flag, sspi_gss_qop_t qop_req, + UINT32 req_output_size, UINT32* max_input_size) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -574,18 +512,16 @@ UINT32 SSPI_GSSAPI sspi_gss_wrap_size_limit( if (!(g_GssApi && g_GssApi->gss_wrap_size_limit)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_GssApi->gss_wrap_size_limit(minor_status, context_handle, - conf_req_flag, qop_req, req_output_size, max_input_size); - WLog_DBG(TAG, "gss_wrap_size_limit: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + status = g_GssApi->gss_wrap_size_limit(minor_status, context_handle, conf_req_flag, qop_req, + req_output_size, max_input_size); + WLog_DBG(TAG, "gss_wrap_size_limit: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_import_name_object( - UINT32* minor_status, - void* input_name, - sspi_gss_OID input_name_type, - sspi_gss_name_t* output_name) +UINT32 SSPI_GSSAPI sspi_gss_import_name_object(UINT32* minor_status, void* input_name, + sspi_gss_OID input_name_type, + sspi_gss_name_t* output_name) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -593,17 +529,15 @@ UINT32 SSPI_GSSAPI sspi_gss_import_name_object( if (!(g_GssApi && g_GssApi->gss_import_name_object)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_GssApi->gss_import_name_object(minor_status, input_name, input_name_type, output_name); - WLog_DBG(TAG, "gss_import_name_object: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + status = + g_GssApi->gss_import_name_object(minor_status, input_name, input_name_type, output_name); + WLog_DBG(TAG, "gss_import_name_object: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_export_name_object( - UINT32* minor_status, - sspi_gss_name_t input_name, - sspi_gss_OID desired_name_type, - void** output_name) +UINT32 SSPI_GSSAPI sspi_gss_export_name_object(UINT32* minor_status, sspi_gss_name_t input_name, + sspi_gss_OID desired_name_type, void** output_name) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -611,24 +545,20 @@ UINT32 SSPI_GSSAPI sspi_gss_export_name_object( if (!(g_GssApi && g_GssApi->gss_export_name_object)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_GssApi->gss_export_name_object(minor_status, input_name, desired_name_type, output_name); - WLog_DBG(TAG, "gss_export_name_object: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + status = + g_GssApi->gss_export_name_object(minor_status, input_name, desired_name_type, output_name); + WLog_DBG(TAG, "gss_export_name_object: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_add_cred( - UINT32* minor_status, - sspi_gss_cred_id_t input_cred_handle, - sspi_gss_name_t desired_name, - sspi_gss_OID desired_mech, - sspi_gss_cred_usage_t cred_usage, - UINT32 initiator_time_req, - UINT32 acceptor_time_req, - sspi_gss_cred_id_t* output_cred_handle, - sspi_gss_OID_set* actual_mechs, - UINT32* initiator_time_rec, - UINT32* acceptor_time_rec) +UINT32 SSPI_GSSAPI sspi_gss_add_cred(UINT32* minor_status, sspi_gss_cred_id_t input_cred_handle, + sspi_gss_name_t desired_name, sspi_gss_OID desired_mech, + sspi_gss_cred_usage_t cred_usage, UINT32 initiator_time_req, + UINT32 acceptor_time_req, + sspi_gss_cred_id_t* output_cred_handle, + sspi_gss_OID_set* actual_mechs, UINT32* initiator_time_rec, + UINT32* acceptor_time_rec) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -636,23 +566,19 @@ UINT32 SSPI_GSSAPI sspi_gss_add_cred( if (!(g_GssApi && g_GssApi->gss_add_cred)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_GssApi->gss_add_cred(minor_status, input_cred_handle, desired_name, desired_mech, - cred_usage, - initiator_time_req, acceptor_time_req, output_cred_handle, actual_mechs, initiator_time_rec, - acceptor_time_rec); - WLog_DBG(TAG, "gss_add_cred: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + status = g_GssApi->gss_add_cred( + minor_status, input_cred_handle, desired_name, desired_mech, cred_usage, initiator_time_req, + acceptor_time_req, output_cred_handle, actual_mechs, initiator_time_rec, acceptor_time_rec); + WLog_DBG(TAG, "gss_add_cred: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_inquire_cred_by_mech( - UINT32* minor_status, - sspi_gss_cred_id_t cred_handle, - sspi_gss_OID mech_type, - sspi_gss_name_t* name, - UINT32* initiator_lifetime, - UINT32* acceptor_lifetime, - sspi_gss_cred_usage_t* cred_usage) +UINT32 SSPI_GSSAPI sspi_gss_inquire_cred_by_mech(UINT32* minor_status, + sspi_gss_cred_id_t cred_handle, + sspi_gss_OID mech_type, sspi_gss_name_t* name, + UINT32* initiator_lifetime, + UINT32* acceptor_lifetime, + sspi_gss_cred_usage_t* cred_usage) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -661,16 +587,15 @@ UINT32 SSPI_GSSAPI sspi_gss_inquire_cred_by_mech( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_inquire_cred_by_mech(minor_status, cred_handle, mech_type, name, - initiator_lifetime, acceptor_lifetime, cred_usage); - WLog_DBG(TAG, "gss_inquire_cred_by_mech: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + initiator_lifetime, acceptor_lifetime, cred_usage); + WLog_DBG(TAG, "gss_inquire_cred_by_mech: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_export_sec_context( - UINT32* minor_status, - sspi_gss_ctx_id_t* context_handle, - sspi_gss_buffer_t interprocess_token) +UINT32 SSPI_GSSAPI sspi_gss_export_sec_context(UINT32* minor_status, + sspi_gss_ctx_id_t* context_handle, + sspi_gss_buffer_t interprocess_token) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -679,15 +604,14 @@ UINT32 SSPI_GSSAPI sspi_gss_export_sec_context( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_export_sec_context(minor_status, context_handle, interprocess_token); - WLog_DBG(TAG, "gss_export_sec_context: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_export_sec_context: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_import_sec_context( - UINT32* minor_status, - sspi_gss_buffer_t interprocess_token, - sspi_gss_ctx_id_t* context_handle) +UINT32 SSPI_GSSAPI sspi_gss_import_sec_context(UINT32* minor_status, + sspi_gss_buffer_t interprocess_token, + sspi_gss_ctx_id_t* context_handle) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -696,14 +620,12 @@ UINT32 SSPI_GSSAPI sspi_gss_import_sec_context( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_import_sec_context(minor_status, interprocess_token, context_handle); - WLog_DBG(TAG, "gss_import_sec_context: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_import_sec_context: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_release_oid( - UINT32* minor_status, - sspi_gss_OID* oid) +UINT32 SSPI_GSSAPI sspi_gss_release_oid(UINT32* minor_status, sspi_gss_OID* oid) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -712,14 +634,11 @@ UINT32 SSPI_GSSAPI sspi_gss_release_oid( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_release_oid(minor_status, oid); - WLog_DBG(TAG, "gss_release_oid: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_release_oid: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_create_empty_oid_set( - UINT32* minor_status, - sspi_gss_OID_set* oid_set) +UINT32 SSPI_GSSAPI sspi_gss_create_empty_oid_set(UINT32* minor_status, sspi_gss_OID_set* oid_set) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -728,15 +647,13 @@ UINT32 SSPI_GSSAPI sspi_gss_create_empty_oid_set( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_create_empty_oid_set(minor_status, oid_set); - WLog_DBG(TAG, "gss_create_empty_oid_set: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_create_empty_oid_set: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_add_oid_set_member( - UINT32* minor_status, - sspi_gss_OID member_oid, - sspi_gss_OID_set* oid_set) +UINT32 SSPI_GSSAPI sspi_gss_add_oid_set_member(UINT32* minor_status, sspi_gss_OID member_oid, + sspi_gss_OID_set* oid_set) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -745,16 +662,13 @@ UINT32 SSPI_GSSAPI sspi_gss_add_oid_set_member( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_add_oid_set_member(minor_status, member_oid, oid_set); - WLog_DBG(TAG, "gss_add_oid_set_member: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_add_oid_set_member: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_test_oid_set_member( - UINT32* minor_status, - sspi_gss_OID member, - sspi_gss_OID_set set, - int* present) +UINT32 SSPI_GSSAPI sspi_gss_test_oid_set_member(UINT32* minor_status, sspi_gss_OID member, + sspi_gss_OID_set set, int* present) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -763,15 +677,13 @@ UINT32 SSPI_GSSAPI sspi_gss_test_oid_set_member( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_test_oid_set_member(minor_status, member, set, present); - WLog_DBG(TAG, "gss_test_oid_set_member: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_test_oid_set_member: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_str_to_oid( - UINT32* minor_status, - sspi_gss_buffer_t oid_str, - sspi_gss_OID* oid) +UINT32 SSPI_GSSAPI sspi_gss_str_to_oid(UINT32* minor_status, sspi_gss_buffer_t oid_str, + sspi_gss_OID* oid) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -780,15 +692,12 @@ UINT32 SSPI_GSSAPI sspi_gss_str_to_oid( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_str_to_oid(minor_status, oid_str, oid); - WLog_DBG(TAG, "gss_str_to_oid: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_str_to_oid: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_oid_to_str( - UINT32* minor_status, - sspi_gss_OID oid, - sspi_gss_buffer_t oid_str) +UINT32 SSPI_GSSAPI sspi_gss_oid_to_str(UINT32* minor_status, sspi_gss_OID oid, + sspi_gss_buffer_t oid_str) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -797,15 +706,12 @@ UINT32 SSPI_GSSAPI sspi_gss_oid_to_str( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_oid_to_str(minor_status, oid, oid_str); - WLog_DBG(TAG, "gss_oid_to_str: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_oid_to_str: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_inquire_names_for_mech( - UINT32* minor_status, - sspi_gss_OID mechanism, - sspi_gss_OID_set* name_types) +UINT32 SSPI_GSSAPI sspi_gss_inquire_names_for_mech(UINT32* minor_status, sspi_gss_OID mechanism, + sspi_gss_OID_set* name_types) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -814,15 +720,14 @@ UINT32 SSPI_GSSAPI sspi_gss_inquire_names_for_mech( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_inquire_names_for_mech(minor_status, mechanism, name_types); - WLog_DBG(TAG, "gss_inquire_names_for_mech: %s (0x%08"PRIX32")", + WLog_DBG(TAG, "gss_inquire_names_for_mech: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_inquire_mechs_for_name( - UINT32* minor_status, - const sspi_gss_name_t input_name, - sspi_gss_OID_set* mech_types) +UINT32 SSPI_GSSAPI sspi_gss_inquire_mechs_for_name(UINT32* minor_status, + const sspi_gss_name_t input_name, + sspi_gss_OID_set* mech_types) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -831,17 +736,14 @@ UINT32 SSPI_GSSAPI sspi_gss_inquire_mechs_for_name( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_inquire_mechs_for_name(minor_status, input_name, mech_types); - WLog_DBG(TAG, "gss_inquire_mechs_for_name: %s (0x%08"PRIX32")", + WLog_DBG(TAG, "gss_inquire_mechs_for_name: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_sign( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - int qop_req, - sspi_gss_buffer_t message_buffer, - sspi_gss_buffer_t message_token) +UINT32 SSPI_GSSAPI sspi_gss_sign(UINT32* minor_status, sspi_gss_ctx_id_t context_handle, + int qop_req, sspi_gss_buffer_t message_buffer, + sspi_gss_buffer_t message_token) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -849,18 +751,15 @@ UINT32 SSPI_GSSAPI sspi_gss_sign( if (!(g_GssApi && g_GssApi->gss_sign)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_GssApi->gss_sign(minor_status, context_handle, qop_req, message_buffer, message_token); - WLog_DBG(TAG, "gss_sign: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + status = + g_GssApi->gss_sign(minor_status, context_handle, qop_req, message_buffer, message_token); + WLog_DBG(TAG, "gss_sign: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_verify( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_buffer_t message_buffer, - sspi_gss_buffer_t token_buffer, - int* qop_state) +UINT32 SSPI_GSSAPI sspi_gss_verify(UINT32* minor_status, sspi_gss_ctx_id_t context_handle, + sspi_gss_buffer_t message_buffer, sspi_gss_buffer_t token_buffer, + int* qop_state) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -868,21 +767,16 @@ UINT32 SSPI_GSSAPI sspi_gss_verify( if (!(g_GssApi && g_GssApi->gss_verify)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_GssApi->gss_verify(minor_status, context_handle, message_buffer, token_buffer, - qop_state); - WLog_DBG(TAG, "gss_verify: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + status = + g_GssApi->gss_verify(minor_status, context_handle, message_buffer, token_buffer, qop_state); + WLog_DBG(TAG, "gss_verify: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_seal( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - int conf_req_flag, - int qop_req, - sspi_gss_buffer_t input_message_buffer, - int* conf_state, - sspi_gss_buffer_t output_message_buffer) +UINT32 SSPI_GSSAPI sspi_gss_seal(UINT32* minor_status, sspi_gss_ctx_id_t context_handle, + int conf_req_flag, int qop_req, + sspi_gss_buffer_t input_message_buffer, int* conf_state, + sspi_gss_buffer_t output_message_buffer) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -892,18 +786,14 @@ UINT32 SSPI_GSSAPI sspi_gss_seal( status = g_GssApi->gss_seal(minor_status, context_handle, conf_req_flag, qop_req, input_message_buffer, conf_state, output_message_buffer); - WLog_DBG(TAG, "gss_seal: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_seal: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_unseal( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_buffer_t input_message_buffer, - sspi_gss_buffer_t output_message_buffer, - int* conf_state, - int* qop_state) +UINT32 SSPI_GSSAPI sspi_gss_unseal(UINT32* minor_status, sspi_gss_ctx_id_t context_handle, + sspi_gss_buffer_t input_message_buffer, + sspi_gss_buffer_t output_message_buffer, int* conf_state, + int* qop_state) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -912,17 +802,13 @@ UINT32 SSPI_GSSAPI sspi_gss_unseal( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_unseal(minor_status, context_handle, input_message_buffer, - output_message_buffer, - conf_state, qop_state); - WLog_DBG(TAG, "gss_unseal: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + output_message_buffer, conf_state, qop_state); + WLog_DBG(TAG, "gss_unseal: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_export_name( - UINT32* minor_status, - const sspi_gss_name_t input_name, - sspi_gss_buffer_t exported_name) +UINT32 SSPI_GSSAPI sspi_gss_export_name(UINT32* minor_status, const sspi_gss_name_t input_name, + sspi_gss_buffer_t exported_name) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -931,15 +817,12 @@ UINT32 SSPI_GSSAPI sspi_gss_export_name( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_export_name(minor_status, input_name, exported_name); - WLog_DBG(TAG, "gss_export_name: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_export_name: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_duplicate_name( - UINT32* minor_status, - const sspi_gss_name_t input_name, - sspi_gss_name_t* dest_name) +UINT32 SSPI_GSSAPI sspi_gss_duplicate_name(UINT32* minor_status, const sspi_gss_name_t input_name, + sspi_gss_name_t* dest_name) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -948,16 +831,15 @@ UINT32 SSPI_GSSAPI sspi_gss_duplicate_name( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_duplicate_name(minor_status, input_name, dest_name); - WLog_DBG(TAG, "gss_duplicate_name: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_duplicate_name: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_canonicalize_name( - UINT32* minor_status, - const sspi_gss_name_t input_name, - const sspi_gss_OID mech_type, - sspi_gss_name_t* output_name) +UINT32 SSPI_GSSAPI sspi_gss_canonicalize_name(UINT32* minor_status, + const sspi_gss_name_t input_name, + const sspi_gss_OID mech_type, + sspi_gss_name_t* output_name) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -966,18 +848,14 @@ UINT32 SSPI_GSSAPI sspi_gss_canonicalize_name( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_canonicalize_name(minor_status, input_name, mech_type, output_name); - WLog_DBG(TAG, "gss_canonicalize_name: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_canonicalize_name: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_pseudo_random( - UINT32* minor_status, - sspi_gss_ctx_id_t context, - int prf_key, - const sspi_gss_buffer_t prf_in, - SSIZE_T desired_output_len, - sspi_gss_buffer_t prf_out) +UINT32 SSPI_GSSAPI sspi_gss_pseudo_random(UINT32* minor_status, sspi_gss_ctx_id_t context, + int prf_key, const sspi_gss_buffer_t prf_in, + SSIZE_T desired_output_len, sspi_gss_buffer_t prf_out) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -987,20 +865,17 @@ UINT32 SSPI_GSSAPI sspi_gss_pseudo_random( status = g_GssApi->gss_pseudo_random(minor_status, context, prf_key, prf_in, desired_output_len, prf_out); - WLog_DBG(TAG, "gss_pseudo_random: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_pseudo_random: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_store_cred( - UINT32* minor_status, - const sspi_gss_cred_id_t input_cred_handle, - sspi_gss_cred_usage_t input_usage, - const sspi_gss_OID desired_mech, - UINT32 overwrite_cred, - UINT32 default_cred, - sspi_gss_OID_set* elements_stored, - sspi_gss_cred_usage_t* cred_usage_stored) +UINT32 SSPI_GSSAPI sspi_gss_store_cred(UINT32* minor_status, + const sspi_gss_cred_id_t input_cred_handle, + sspi_gss_cred_usage_t input_usage, + const sspi_gss_OID desired_mech, UINT32 overwrite_cred, + UINT32 default_cred, sspi_gss_OID_set* elements_stored, + sspi_gss_cred_usage_t* cred_usage_stored) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -1008,17 +883,15 @@ UINT32 SSPI_GSSAPI sspi_gss_store_cred( if (!(g_GssApi && g_GssApi->gss_store_cred)) return SEC_E_UNSUPPORTED_FUNCTION; - status = g_GssApi->gss_store_cred(minor_status, input_cred_handle, input_usage, desired_mech, - overwrite_cred, default_cred, elements_stored, cred_usage_stored); - WLog_DBG(TAG, "gss_store_cred: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + status = + g_GssApi->gss_store_cred(minor_status, input_cred_handle, input_usage, desired_mech, + overwrite_cred, default_cred, elements_stored, cred_usage_stored); + WLog_DBG(TAG, "gss_store_cred: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), status); return status; } -UINT32 SSPI_GSSAPI sspi_gss_set_neg_mechs( - UINT32* minor_status, - sspi_gss_cred_id_t cred_handle, - const sspi_gss_OID_set mech_set) +UINT32 SSPI_GSSAPI sspi_gss_set_neg_mechs(UINT32* minor_status, sspi_gss_cred_id_t cred_handle, + const sspi_gss_OID_set mech_set) { SECURITY_STATUS status; InitOnceExecuteOnce(&g_Initialized, sspi_GssApiInit, NULL, NULL); @@ -1027,7 +900,7 @@ UINT32 SSPI_GSSAPI sspi_gss_set_neg_mechs( return SEC_E_UNSUPPORTED_FUNCTION; status = g_GssApi->gss_set_neg_mechs(minor_status, cred_handle, mech_set); - WLog_DBG(TAG, "gss_set_neg_mechs: %s (0x%08"PRIX32")", - GetSecurityStatusString(status), status); + WLog_DBG(TAG, "gss_set_neg_mechs: %s (0x%08" PRIX32 ")", GetSecurityStatusString(status), + status); return status; } diff --git a/winpr/libwinpr/sspi/sspi_gss.h b/winpr/libwinpr/sspi/sspi_gss.h index 2ab3988e4..42016786f 100644 --- a/winpr/libwinpr/sspi/sspi_gss.h +++ b/winpr/libwinpr/sspi/sspi_gss.h @@ -69,77 +69,80 @@ typedef struct sspi_gss_channel_bindings_struct UINT32 acceptor_addrtype; sspi_gss_buffer_desc acceptor_address; sspi_gss_buffer_desc application_data; -}* sspi_gss_channel_bindings_t; +} * sspi_gss_channel_bindings_t; typedef UINT32 sspi_gss_qop_t; typedef int sspi_gss_cred_usage_t; -#define SSPI_GSS_C_DELEG_FLAG 1 -#define SSPI_GSS_C_MUTUAL_FLAG 2 -#define SSPI_GSS_C_REPLAY_FLAG 4 -#define SSPI_GSS_C_SEQUENCE_FLAG 8 -#define SSPI_GSS_C_CONF_FLAG 16 -#define SSPI_GSS_C_INTEG_FLAG 32 -#define SSPI_GSS_C_ANON_FLAG 64 -#define SSPI_GSS_C_PROT_READY_FLAG 128 -#define SSPI_GSS_C_TRANS_FLAG 256 -#define SSPI_GSS_C_DELEG_POLICY_FLAG 32768 +#define SSPI_GSS_C_DELEG_FLAG 1 +#define SSPI_GSS_C_MUTUAL_FLAG 2 +#define SSPI_GSS_C_REPLAY_FLAG 4 +#define SSPI_GSS_C_SEQUENCE_FLAG 8 +#define SSPI_GSS_C_CONF_FLAG 16 +#define SSPI_GSS_C_INTEG_FLAG 32 +#define SSPI_GSS_C_ANON_FLAG 64 +#define SSPI_GSS_C_PROT_READY_FLAG 128 +#define SSPI_GSS_C_TRANS_FLAG 256 +#define SSPI_GSS_C_DELEG_POLICY_FLAG 32768 -#define SSPI_GSS_C_BOTH 0 -#define SSPI_GSS_C_INITIATE 1 -#define SSPI_GSS_C_ACCEPT 2 +#define SSPI_GSS_C_BOTH 0 +#define SSPI_GSS_C_INITIATE 1 +#define SSPI_GSS_C_ACCEPT 2 -#define SSPI_GSS_C_GSS_CODE 1 -#define SSPI_GSS_C_MECH_CODE 2 +#define SSPI_GSS_C_GSS_CODE 1 +#define SSPI_GSS_C_MECH_CODE 2 -#define SSPI_GSS_C_AF_UNSPEC 0 -#define SSPI_GSS_C_AF_LOCAL 1 -#define SSPI_GSS_C_AF_INET 2 -#define SSPI_GSS_C_AF_IMPLINK 3 -#define SSPI_GSS_C_AF_PUP 4 -#define SSPI_GSS_C_AF_CHAOS 5 -#define SSPI_GSS_C_AF_NS 6 -#define SSPI_GSS_C_AF_NBS 7 -#define SSPI_GSS_C_AF_ECMA 8 -#define SSPI_GSS_C_AF_DATAKIT 9 -#define SSPI_GSS_C_AF_CCITT 10 -#define SSPI_GSS_C_AF_SNA 11 -#define SSPI_GSS_C_AF_DECnet 12 -#define SSPI_GSS_C_AF_DLI 13 -#define SSPI_GSS_C_AF_LAT 14 -#define SSPI_GSS_C_AF_HYLINK 15 -#define SSPI_GSS_C_AF_APPLETALK 16 -#define SSPI_GSS_C_AF_BSC 17 -#define SSPI_GSS_C_AF_DSS 18 -#define SSPI_GSS_C_AF_OSI 19 -#define SSPI_GSS_C_AF_NETBIOS 20 -#define SSPI_GSS_C_AF_X25 21 -#define SSPI_GSS_C_AF_NULLADDR 255 +#define SSPI_GSS_C_AF_UNSPEC 0 +#define SSPI_GSS_C_AF_LOCAL 1 +#define SSPI_GSS_C_AF_INET 2 +#define SSPI_GSS_C_AF_IMPLINK 3 +#define SSPI_GSS_C_AF_PUP 4 +#define SSPI_GSS_C_AF_CHAOS 5 +#define SSPI_GSS_C_AF_NS 6 +#define SSPI_GSS_C_AF_NBS 7 +#define SSPI_GSS_C_AF_ECMA 8 +#define SSPI_GSS_C_AF_DATAKIT 9 +#define SSPI_GSS_C_AF_CCITT 10 +#define SSPI_GSS_C_AF_SNA 11 +#define SSPI_GSS_C_AF_DECnet 12 +#define SSPI_GSS_C_AF_DLI 13 +#define SSPI_GSS_C_AF_LAT 14 +#define SSPI_GSS_C_AF_HYLINK 15 +#define SSPI_GSS_C_AF_APPLETALK 16 +#define SSPI_GSS_C_AF_BSC 17 +#define SSPI_GSS_C_AF_DSS 18 +#define SSPI_GSS_C_AF_OSI 19 +#define SSPI_GSS_C_AF_NETBIOS 20 +#define SSPI_GSS_C_AF_X25 21 +#define SSPI_GSS_C_AF_NULLADDR 255 -#define SSPI_GSS_C_NO_NAME ((sspi_gss_name_t) 0) -#define SSPI_GSS_C_NO_BUFFER ((sspi_gss_buffer_t) 0) -#define SSPI_GSS_C_NO_OID ((sspi_gss_OID) 0) -#define SSPI_GSS_C_NO_OID_SET ((sspi_gss_OID_set) 0) -#define SSPI_GSS_C_NO_CONTEXT ((sspi_gss_ctx_id_t) 0) -#define SSPI_GSS_C_NO_CREDENTIAL ((sspi_gss_cred_id_t) 0) -#define SSPI_GSS_C_NO_CHANNEL_BINDINGS ((sspi_gss_channel_bindings_t) 0) -#define SSPI_GSS_C_EMPTY_BUFFER {0, NULL} +#define SSPI_GSS_C_NO_NAME ((sspi_gss_name_t)0) +#define SSPI_GSS_C_NO_BUFFER ((sspi_gss_buffer_t)0) +#define SSPI_GSS_C_NO_OID ((sspi_gss_OID)0) +#define SSPI_GSS_C_NO_OID_SET ((sspi_gss_OID_set)0) +#define SSPI_GSS_C_NO_CONTEXT ((sspi_gss_ctx_id_t)0) +#define SSPI_GSS_C_NO_CREDENTIAL ((sspi_gss_cred_id_t)0) +#define SSPI_GSS_C_NO_CHANNEL_BINDINGS ((sspi_gss_channel_bindings_t)0) +#define SSPI_GSS_C_EMPTY_BUFFER \ + { \ + 0, NULL \ + } -#define SSPI_GSS_C_NULL_OID SSPI_GSS_C_NO_OID -#define SSPI_GSS_C_NULL_OID_SET SSPI_GSS_C_NO_OID_SET +#define SSPI_GSS_C_NULL_OID SSPI_GSS_C_NO_OID +#define SSPI_GSS_C_NULL_OID_SET SSPI_GSS_C_NO_OID_SET -#define SSPI_GSS_C_QOP_DEFAULT 0 +#define SSPI_GSS_C_QOP_DEFAULT 0 -#define SSPI_GSS_C_INDEFINITE ((UINT32) 0xFFFFFFFF) +#define SSPI_GSS_C_INDEFINITE ((UINT32)0xFFFFFFFF) -#define SSPI_GSS_S_COMPLETE 0 +#define SSPI_GSS_S_COMPLETE 0 -#define SSPI_GSS_C_CALLING_ERROR_OFFSET 24 -#define SSPI_GSS_C_ROUTINE_ERROR_OFFSET 16 -#define SSPI_GSS_C_SUPPLEMENTARY_OFFSET 0 -#define SSPI_GSS_C_CALLING_ERROR_MASK ((UINT32) 0377) -#define SSPI_GSS_C_ROUTINE_ERROR_MASK ((UINT32) 0377) -#define SSPI_GSS_C_SUPPLEMENTARY_MASK ((UINT32) 0177777) +#define SSPI_GSS_C_CALLING_ERROR_OFFSET 24 +#define SSPI_GSS_C_ROUTINE_ERROR_OFFSET 16 +#define SSPI_GSS_C_SUPPLEMENTARY_OFFSET 0 +#define SSPI_GSS_C_CALLING_ERROR_MASK ((UINT32)0377) +#define SSPI_GSS_C_ROUTINE_ERROR_MASK ((UINT32)0377) +#define SSPI_GSS_C_SUPPLEMENTARY_MASK ((UINT32)0177777) #define SSPI_GSS_CALLING_ERROR(_x) \ ((_x) & (SSPI_GSS_C_CALLING_ERROR_MASK << SSPI_GSS_C_CALLING_ERROR_OFFSET)) @@ -147,674 +150,466 @@ typedef int sspi_gss_cred_usage_t; ((_x) & (SSPI_GSS_C_ROUTINE_ERROR_MASK << SSPI_GSS_C_ROUTINE_ERROR_OFFSET)) #define SSPI_GSS_SUPPLEMENTARY_INFO(_x) \ ((_x) & (SSPI_GSS_C_SUPPLEMENTARY_MASK << SSPI_GSS_C_SUPPLEMENTARY_OFFSET)) -#define SSPI_GSS_ERROR(_x) \ +#define SSPI_GSS_ERROR(_x) \ ((_x) & ((SSPI_GSS_C_CALLING_ERROR_MASK << SSPI_GSS_C_CALLING_ERROR_OFFSET) | \ (SSPI_GSS_C_ROUTINE_ERROR_MASK << SSPI_GSS_C_ROUTINE_ERROR_OFFSET))) -#define SSPI_GSS_S_CALL_INACCESSIBLE_READ (((UINT32) 1) << SSPI_GSS_C_CALLING_ERROR_OFFSET) -#define SSPI_GSS_S_CALL_INACCESSIBLE_WRITE (((UINT32) 2) << SSPI_GSS_C_CALLING_ERROR_OFFSET) -#define SSPI_GSS_S_CALL_BAD_STRUCTURE (((UINT32) 3) << SSPI_GSS_C_CALLING_ERROR_OFFSET) +#define SSPI_GSS_S_CALL_INACCESSIBLE_READ (((UINT32)1) << SSPI_GSS_C_CALLING_ERROR_OFFSET) +#define SSPI_GSS_S_CALL_INACCESSIBLE_WRITE (((UINT32)2) << SSPI_GSS_C_CALLING_ERROR_OFFSET) +#define SSPI_GSS_S_CALL_BAD_STRUCTURE (((UINT32)3) << SSPI_GSS_C_CALLING_ERROR_OFFSET) -#define SSPI_GSS_S_BAD_MECH (((UINT32) 1) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_BAD_NAME (((UINT32) 2) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_BAD_NAMETYPE (((UINT32) 3) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_BAD_BINDINGS (((UINT32) 4) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_BAD_STATUS (((UINT32) 5) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_BAD_SIG (((UINT32) 6) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_NO_CRED (((UINT32) 7) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_NO_CONTEXT (((UINT32) 8) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_DEFECTIVE_TOKEN (((UINT32) 9) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_DEFECTIVE_CREDENTIAL (((UINT32) 10) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_CREDENTIALS_EXPIRED (((UINT32) 11) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_CONTEXT_EXPIRED (((UINT32) 12) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_FAILURE (((UINT32) 13) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_BAD_QOP (((UINT32) 14) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_UNAUTHORIZED (((UINT32) 15) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_UNAVAILABLE (((UINT32) 16) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_DUPLICATE_ELEMENT (((UINT32) 17) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_NAME_NOT_MN (((UINT32) 18) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_BAD_MECH_ATTR (((UINT32) 19) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_BAD_MECH (((UINT32)1) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_BAD_NAME (((UINT32)2) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_BAD_NAMETYPE (((UINT32)3) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_BAD_BINDINGS (((UINT32)4) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_BAD_STATUS (((UINT32)5) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_BAD_SIG (((UINT32)6) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_NO_CRED (((UINT32)7) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_NO_CONTEXT (((UINT32)8) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_DEFECTIVE_TOKEN (((UINT32)9) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_DEFECTIVE_CREDENTIAL (((UINT32)10) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_CREDENTIALS_EXPIRED (((UINT32)11) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_CONTEXT_EXPIRED (((UINT32)12) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_FAILURE (((UINT32)13) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_BAD_QOP (((UINT32)14) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_UNAUTHORIZED (((UINT32)15) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_UNAVAILABLE (((UINT32)16) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_DUPLICATE_ELEMENT (((UINT32)17) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_NAME_NOT_MN (((UINT32)18) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) +#define SSPI_GSS_S_BAD_MECH_ATTR (((UINT32)19) << SSPI_GSS_C_ROUTINE_ERROR_OFFSET) -#define SSPI_GSS_S_CONTINUE_NEEDED (1 << (SSPI_GSS_C_SUPPLEMENTARY_OFFSET + 0)) -#define SSPI_GSS_S_DUPLICATE_TOKEN (1 << (SSPI_GSS_C_SUPPLEMENTARY_OFFSET + 1)) -#define SSPI_GSS_S_OLD_TOKEN (1 << (SSPI_GSS_C_SUPPLEMENTARY_OFFSET + 2)) -#define SSPI_GSS_S_UNSEQ_TOKEN (1 << (SSPI_GSS_C_SUPPLEMENTARY_OFFSET + 3)) -#define SSPI_GSS_S_GAP_TOKEN (1 << (SSPI_GSS_C_SUPPLEMENTARY_OFFSET + 4)) +#define SSPI_GSS_S_CONTINUE_NEEDED (1 << (SSPI_GSS_C_SUPPLEMENTARY_OFFSET + 0)) +#define SSPI_GSS_S_DUPLICATE_TOKEN (1 << (SSPI_GSS_C_SUPPLEMENTARY_OFFSET + 1)) +#define SSPI_GSS_S_OLD_TOKEN (1 << (SSPI_GSS_C_SUPPLEMENTARY_OFFSET + 2)) +#define SSPI_GSS_S_UNSEQ_TOKEN (1 << (SSPI_GSS_C_SUPPLEMENTARY_OFFSET + 3)) +#define SSPI_GSS_S_GAP_TOKEN (1 << (SSPI_GSS_C_SUPPLEMENTARY_OFFSET + 4)) -#define SSPI_GSS_C_PRF_KEY_FULL 0 -#define SSPI_GSS_C_PRF_KEY_PARTIAL 1 +#define SSPI_GSS_C_PRF_KEY_FULL 0 +#define SSPI_GSS_C_PRF_KEY_PARTIAL 1 #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -SSPI_GSSOID extern sspi_gss_OID SSPI_GSS_C_NT_USER_NAME; -SSPI_GSSOID extern sspi_gss_OID SSPI_GSS_C_NT_MACHINE_UID_NAME; -SSPI_GSSOID extern sspi_gss_OID SSPI_GSS_C_NT_STRING_UID_NAME; -SSPI_GSSOID extern sspi_gss_OID SSPI_GSS_C_NT_HOSTBASED_SERVICE_X; -SSPI_GSSOID extern sspi_gss_OID SSPI_GSS_C_NT_HOSTBASED_SERVICE; -SSPI_GSSOID extern sspi_gss_OID SSPI_GSS_C_NT_ANONYMOUS; -SSPI_GSSOID extern sspi_gss_OID SSPI_GSS_C_NT_EXPORT_NAME; - -UINT32 SSPI_GSSAPI sspi_gss_acquire_cred( - UINT32* minor_status, - sspi_gss_name_t desired_name, - UINT32 time_req, - sspi_gss_OID_set desired_mechs, - sspi_gss_cred_usage_t cred_usage, - sspi_gss_cred_id_t* output_cred_handle, - sspi_gss_OID_set* actual_mechs, - UINT32* time_rec); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_acquire_cred)( - UINT32* minor_status, - sspi_gss_name_t desired_name, - UINT32 time_req, - sspi_gss_OID_set desired_mechs, - sspi_gss_cred_usage_t cred_usage, - sspi_gss_cred_id_t* output_cred_handle, - sspi_gss_OID_set* actual_mechs, - UINT32* time_rec); - -UINT32 SSPI_GSSAPI sspi_gss_release_cred( - UINT32* minor_status, - sspi_gss_cred_id_t* cred_handle); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_release_cred)( - UINT32* minor_status, - sspi_gss_cred_id_t* cred_handle); - -UINT32 SSPI_GSSAPI sspi_gss_init_sec_context( - UINT32* minor_status, - sspi_gss_cred_id_t claimant_cred_handle, - sspi_gss_ctx_id_t* context_handle, - sspi_gss_name_t target_name, - sspi_gss_OID mech_type, - UINT32 req_flags, - UINT32 time_req, - sspi_gss_channel_bindings_t input_chan_bindings, - sspi_gss_buffer_t input_token, - sspi_gss_OID* actual_mech_type, - sspi_gss_buffer_t output_token, - UINT32* ret_flags, - UINT32* time_rec); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_init_sec_context)( - UINT32* minor_status, - sspi_gss_cred_id_t claimant_cred_handle, - sspi_gss_ctx_id_t* context_handle, - sspi_gss_name_t target_name, - sspi_gss_OID mech_type, - UINT32 req_flags, - UINT32 time_req, - sspi_gss_channel_bindings_t input_chan_bindings, - sspi_gss_buffer_t input_token, - sspi_gss_OID* actual_mech_type, - sspi_gss_buffer_t output_token, - UINT32* ret_flags, - UINT32* time_rec); - -UINT32 SSPI_GSSAPI sspi_gss_accept_sec_context( - UINT32* minor_status, - sspi_gss_ctx_id_t* context_handle, - sspi_gss_cred_id_t acceptor_cred_handle, - sspi_gss_buffer_t input_token_buffer, - sspi_gss_channel_bindings_t input_chan_bindings, - sspi_gss_name_t* src_name, - sspi_gss_OID* mech_type, - sspi_gss_buffer_t output_token, - UINT32* ret_flags, - UINT32* time_rec, - sspi_gss_cred_id_t* delegated_cred_handle); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_accept_sec_context)( - UINT32* minor_status, - sspi_gss_ctx_id_t* context_handle, - sspi_gss_cred_id_t acceptor_cred_handle, - sspi_gss_buffer_t input_token_buffer, - sspi_gss_channel_bindings_t input_chan_bindings, - sspi_gss_name_t* src_name, - sspi_gss_OID* mech_type, - sspi_gss_buffer_t output_token, - UINT32* ret_flags, - UINT32* time_rec, - sspi_gss_cred_id_t* delegated_cred_handle); - -UINT32 SSPI_GSSAPI sspi_gss_process_context_token( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_buffer_t token_buffer); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_process_context_token)( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_buffer_t token_buffer); - -UINT32 SSPI_GSSAPI sspi_gss_delete_sec_context( - UINT32* minor_status, - sspi_gss_ctx_id_t* context_handle, - sspi_gss_buffer_t output_token); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_delete_sec_context)( - UINT32* minor_status, - sspi_gss_ctx_id_t* context_handle, - sspi_gss_buffer_t output_token); - -UINT32 SSPI_GSSAPI sspi_gss_context_time( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - UINT32* time_rec); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_context_time)( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - UINT32* time_rec); - -UINT32 SSPI_GSSAPI sspi_gss_get_mic( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_qop_t qop_req, - sspi_gss_buffer_t message_buffer, - sspi_gss_buffer_t message_token); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_get_mic)( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_qop_t qop_req, - sspi_gss_buffer_t message_buffer, - sspi_gss_buffer_t message_token); - -UINT32 SSPI_GSSAPI sspi_gss_verify_mic( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_buffer_t message_buffer, - sspi_gss_buffer_t message_token, - sspi_gss_qop_t* qop_state); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_verify_mic)( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_buffer_t message_buffer, - sspi_gss_buffer_t message_token, - sspi_gss_qop_t* qop_state); - -UINT32 SSPI_GSSAPI sspi_gss_wrap( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - int conf_req_flag, - sspi_gss_qop_t qop_req, - sspi_gss_buffer_t input_message_buffer, - int* conf_state, - sspi_gss_buffer_t output_message_buffer); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_wrap)( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - int conf_req_flag, - sspi_gss_qop_t qop_req, - sspi_gss_buffer_t input_message_buffer, - int* conf_state, - sspi_gss_buffer_t output_message_buffer); - -UINT32 SSPI_GSSAPI sspi_gss_unwrap( - UINT32* minor_status, - const sspi_gss_ctx_id_t context_handle, - const sspi_gss_buffer_t input_message_buffer, - sspi_gss_buffer_t output_message_buffer, - int* conf_state, - sspi_gss_qop_t* qop_state); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_unwrap)( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_buffer_t input_message_buffer, - sspi_gss_buffer_t output_message_buffer, - int* conf_state, - sspi_gss_qop_t* qop_state); - -UINT32 SSPI_GSSAPI sspi_gss_display_status( - UINT32* minor_status, - UINT32 status_value, - int status_type, - sspi_gss_OID mech_type, - UINT32* message_context, - sspi_gss_buffer_t status_string); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_display_status)( - UINT32* minor_status, - UINT32 status_value, - int status_type, - sspi_gss_OID mech_type, - UINT32* message_context, - sspi_gss_buffer_t status_string); - -UINT32 SSPI_GSSAPI sspi_gss_indicate_mechs( - UINT32* minor_status, - sspi_gss_OID_set* mech_set); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_indicate_mechs)( - UINT32* minor_status, - sspi_gss_OID_set* mech_set); - -UINT32 SSPI_GSSAPI sspi_gss_compare_name( - UINT32* minor_status, - sspi_gss_name_t name1, - sspi_gss_name_t name2, - int* name_equal); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_compare_name)( - UINT32* minor_status, - sspi_gss_name_t name1, - sspi_gss_name_t name2, - int* name_equal); - -UINT32 SSPI_GSSAPI sspi_gss_display_name( - UINT32* minor_status, - sspi_gss_name_t input_name, - sspi_gss_buffer_t output_name_buffer, - sspi_gss_OID* output_name_type); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_display_name)( - UINT32* minor_status, - sspi_gss_name_t input_name, - sspi_gss_buffer_t output_name_buffer, - sspi_gss_OID* output_name_type); - -UINT32 SSPI_GSSAPI sspi_gss_import_name( - UINT32* minor_status, - sspi_gss_buffer_t input_name_buffer, - sspi_gss_OID input_name_type, - sspi_gss_name_t* output_name); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_import_name)( - UINT32* minor_status, - sspi_gss_buffer_t input_name_buffer, - sspi_gss_OID input_name_type, - sspi_gss_name_t* output_name); - -UINT32 SSPI_GSSAPI sspi_gss_release_name( - UINT32* minor_status, - sspi_gss_name_t* input_name); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_release_name)( - UINT32* minor_status, - sspi_gss_name_t* input_name); - -UINT32 SSPI_GSSAPI sspi_gss_release_buffer( - UINT32* minor_status, - sspi_gss_buffer_t buffer); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_release_buffer)( - UINT32* minor_status, - sspi_gss_buffer_t buffer); - -UINT32 SSPI_GSSAPI sspi_gss_release_oid_set( - UINT32* minor_status, - sspi_gss_OID_set* set); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_release_oid_set)( - UINT32* minor_status, - sspi_gss_OID_set* set); - -UINT32 SSPI_GSSAPI sspi_gss_inquire_cred( - UINT32* minor_status, - sspi_gss_cred_id_t cred_handle, - sspi_gss_name_t* name, - UINT32* lifetime, - sspi_gss_cred_usage_t* cred_usage, - sspi_gss_OID_set* mechanisms); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_inquire_cred)( - UINT32* minor_status, - sspi_gss_cred_id_t cred_handle, - sspi_gss_name_t* name, - UINT32* lifetime, - sspi_gss_cred_usage_t* cred_usage, - sspi_gss_OID_set* mechanisms); - -UINT32 SSPI_GSSAPI sspi_gss_inquire_context( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_name_t* src_name, - sspi_gss_name_t* targ_name, - UINT32* lifetime_rec, - sspi_gss_OID* mech_type, - UINT32* ctx_flags, - int* locally_initiated, - int* open); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_inquire_context)( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_name_t* src_name, - sspi_gss_name_t* targ_name, - UINT32* lifetime_rec, - sspi_gss_OID* mech_type, - UINT32* ctx_flags, - int* locally_initiated, - int* open); - -UINT32 SSPI_GSSAPI sspi_gss_wrap_size_limit( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - int conf_req_flag, - sspi_gss_qop_t qop_req, - UINT32 req_output_size, - UINT32* max_input_size); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_wrap_size_limit)( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - int conf_req_flag, - sspi_gss_qop_t qop_req, - UINT32 req_output_size, - UINT32* max_input_size); - -UINT32 SSPI_GSSAPI sspi_gss_import_name_object( - UINT32* minor_status, - void* input_name, - sspi_gss_OID input_name_type, - sspi_gss_name_t* output_name); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_import_name_object)( - UINT32* minor_status, - void* input_name, - sspi_gss_OID input_name_type, - sspi_gss_name_t* output_name); - -UINT32 SSPI_GSSAPI sspi_gss_export_name_object( - UINT32* minor_status, - sspi_gss_name_t input_name, - sspi_gss_OID desired_name_type, - void** output_name); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_export_name_object)( - UINT32* minor_status, - sspi_gss_name_t input_name, - sspi_gss_OID desired_name_type, - void** output_name); - -UINT32 SSPI_GSSAPI sspi_gss_add_cred( - UINT32* minor_status, - sspi_gss_cred_id_t input_cred_handle, - sspi_gss_name_t desired_name, - sspi_gss_OID desired_mech, - sspi_gss_cred_usage_t cred_usage, - UINT32 initiator_time_req, - UINT32 acceptor_time_req, - sspi_gss_cred_id_t* output_cred_handle, - sspi_gss_OID_set* actual_mechs, - UINT32* initiator_time_rec, - UINT32* acceptor_time_rec); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_add_cred)( - UINT32* minor_status, - sspi_gss_cred_id_t input_cred_handle, - sspi_gss_name_t desired_name, - sspi_gss_OID desired_mech, - sspi_gss_cred_usage_t cred_usage, - UINT32 initiator_time_req, - UINT32 acceptor_time_req, - sspi_gss_cred_id_t* output_cred_handle, - sspi_gss_OID_set* actual_mechs, - UINT32* initiator_time_rec, - UINT32* acceptor_time_rec); - -UINT32 SSPI_GSSAPI sspi_gss_inquire_cred_by_mech( - UINT32* minor_status, - sspi_gss_cred_id_t cred_handle, - sspi_gss_OID mech_type, - sspi_gss_name_t* name, - UINT32* initiator_lifetime, - UINT32* acceptor_lifetime, - sspi_gss_cred_usage_t* cred_usage); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_inquire_cred_by_mech)( - UINT32* minor_status, - sspi_gss_cred_id_t cred_handle, - sspi_gss_OID mech_type, - sspi_gss_name_t* name, - UINT32* initiator_lifetime, - UINT32* acceptor_lifetime, - sspi_gss_cred_usage_t* cred_usage); - -UINT32 SSPI_GSSAPI sspi_gss_export_sec_context( - UINT32* minor_status, - sspi_gss_ctx_id_t* context_handle, - sspi_gss_buffer_t interprocess_token); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_export_sec_context)( - UINT32* minor_status, - sspi_gss_ctx_id_t* context_handle, - sspi_gss_buffer_t interprocess_token); - -UINT32 SSPI_GSSAPI sspi_gss_import_sec_context( - UINT32* minor_status, - sspi_gss_buffer_t interprocess_token, - sspi_gss_ctx_id_t* context_handle); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_import_sec_context)( - UINT32* minor_status, - sspi_gss_buffer_t interprocess_token, - sspi_gss_ctx_id_t* context_handle); - -UINT32 SSPI_GSSAPI sspi_gss_release_oid( - UINT32* minor_status, - sspi_gss_OID* oid); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_release_oid)( - UINT32* minor_status, - sspi_gss_OID* oid); - -UINT32 SSPI_GSSAPI sspi_gss_create_empty_oid_set( - UINT32* minor_status, - sspi_gss_OID_set* oid_set); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_create_empty_oid_set)( - UINT32* minor_status, - sspi_gss_OID_set* oid_set); - -UINT32 SSPI_GSSAPI sspi_gss_add_oid_set_member( - UINT32* minor_status, - sspi_gss_OID member_oid, - sspi_gss_OID_set* oid_set); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_add_oid_set_member)( - UINT32* minor_status, - sspi_gss_OID member_oid, - sspi_gss_OID_set* oid_set); - -UINT32 SSPI_GSSAPI sspi_gss_test_oid_set_member( - UINT32* minor_status, - sspi_gss_OID member, - sspi_gss_OID_set set, - int* present); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_test_oid_set_member)( - UINT32* minor_status, - sspi_gss_OID member, - sspi_gss_OID_set set, - int* present); - -UINT32 SSPI_GSSAPI sspi_gss_str_to_oid( - UINT32* minor_status, - sspi_gss_buffer_t oid_str, - sspi_gss_OID* oid); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_str_to_oid)( - UINT32* minor_status, - sspi_gss_buffer_t oid_str, - sspi_gss_OID* oid); - -UINT32 SSPI_GSSAPI sspi_gss_oid_to_str( - UINT32* minor_status, - sspi_gss_OID oid, - sspi_gss_buffer_t oid_str); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_oid_to_str)( - UINT32* minor_status, - sspi_gss_OID oid, - sspi_gss_buffer_t oid_str); - -UINT32 SSPI_GSSAPI sspi_gss_inquire_names_for_mech( - UINT32* minor_status, - sspi_gss_OID mechanism, - sspi_gss_OID_set* name_types); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_inquire_names_for_mech)( - UINT32* minor_status, - sspi_gss_OID mechanism, - sspi_gss_OID_set* name_types); - -UINT32 SSPI_GSSAPI sspi_gss_inquire_mechs_for_name( - UINT32* minor_status, - const sspi_gss_name_t input_name, - sspi_gss_OID_set* mech_types); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_inquire_mechs_for_name)( - UINT32* minor_status, - const sspi_gss_name_t input_name, - sspi_gss_OID_set* mech_types); - -UINT32 SSPI_GSSAPI sspi_gss_sign( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - int qop_req, - sspi_gss_buffer_t message_buffer, - sspi_gss_buffer_t message_token); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_sign)( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - int qop_req, - sspi_gss_buffer_t message_buffer, - sspi_gss_buffer_t message_token); - -UINT32 SSPI_GSSAPI sspi_gss_verify( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_buffer_t message_buffer, - sspi_gss_buffer_t token_buffer, - int* qop_state); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_verify)( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_buffer_t message_buffer, - sspi_gss_buffer_t token_buffer, - int* qop_state); - -UINT32 SSPI_GSSAPI sspi_gss_seal( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - int conf_req_flag, - int qop_req, - sspi_gss_buffer_t input_message_buffer, - int* conf_state, - sspi_gss_buffer_t output_message_buffer); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_seal)( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - int conf_req_flag, - int qop_req, - sspi_gss_buffer_t input_message_buffer, - int* conf_state, - sspi_gss_buffer_t output_message_buffer); - -UINT32 SSPI_GSSAPI sspi_gss_unseal( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_buffer_t input_message_buffer, - sspi_gss_buffer_t output_message_buffer, - int* conf_state, - int* qop_state); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_unseal)( - UINT32* minor_status, - sspi_gss_ctx_id_t context_handle, - sspi_gss_buffer_t input_message_buffer, - sspi_gss_buffer_t output_message_buffer, - int* conf_state, - int* qop_state); - -UINT32 SSPI_GSSAPI sspi_gss_export_name( - UINT32* minor_status, - const sspi_gss_name_t input_name, - sspi_gss_buffer_t exported_name); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_export_name)( - UINT32* minor_status, - const sspi_gss_name_t input_name, - sspi_gss_buffer_t exported_name); - -UINT32 SSPI_GSSAPI sspi_gss_duplicate_name( - UINT32* minor_status, - const sspi_gss_name_t input_name, - sspi_gss_name_t* dest_name); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_duplicate_name)( - UINT32* minor_status, - const sspi_gss_name_t input_name, - sspi_gss_name_t* dest_name); - -UINT32 SSPI_GSSAPI sspi_gss_canonicalize_name( - UINT32* minor_status, - const sspi_gss_name_t input_name, - const sspi_gss_OID mech_type, - sspi_gss_name_t* output_name); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_canonicalize_name)( - UINT32* minor_status, - const sspi_gss_name_t input_name, - const sspi_gss_OID mech_type, - sspi_gss_name_t* output_name); - -UINT32 SSPI_GSSAPI sspi_gss_pseudo_random( - UINT32* minor_status, - sspi_gss_ctx_id_t context, - int prf_key, - const sspi_gss_buffer_t prf_in, - SSIZE_T desired_output_len, - sspi_gss_buffer_t prf_out); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_pseudo_random)( - UINT32* minor_status, - sspi_gss_ctx_id_t context, - int prf_key, - const sspi_gss_buffer_t prf_in, - SSIZE_T desired_output_len, - sspi_gss_buffer_t prf_out); - -UINT32 SSPI_GSSAPI sspi_gss_store_cred( - UINT32* minor_status, - const sspi_gss_cred_id_t input_cred_handle, - sspi_gss_cred_usage_t input_usage, - const sspi_gss_OID desired_mech, - UINT32 overwrite_cred, - UINT32 default_cred, - sspi_gss_OID_set* elements_stored, - sspi_gss_cred_usage_t* cred_usage_stored); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_store_cred)( - UINT32* minor_status, - const sspi_gss_cred_id_t input_cred_handle, - sspi_gss_cred_usage_t input_usage, - const sspi_gss_OID desired_mech, - UINT32 overwrite_cred, - UINT32 default_cred, - sspi_gss_OID_set* elements_stored, - sspi_gss_cred_usage_t* cred_usage_stored); - -UINT32 SSPI_GSSAPI sspi_gss_set_neg_mechs( - UINT32* minor_status, - sspi_gss_cred_id_t cred_handle, - const sspi_gss_OID_set mech_set); - -typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_set_neg_mechs)( - UINT32* minor_status, - sspi_gss_cred_id_t cred_handle, - const sspi_gss_OID_set mech_set); + SSPI_GSSOID extern sspi_gss_OID SSPI_GSS_C_NT_USER_NAME; + SSPI_GSSOID extern sspi_gss_OID SSPI_GSS_C_NT_MACHINE_UID_NAME; + SSPI_GSSOID extern sspi_gss_OID SSPI_GSS_C_NT_STRING_UID_NAME; + SSPI_GSSOID extern sspi_gss_OID SSPI_GSS_C_NT_HOSTBASED_SERVICE_X; + SSPI_GSSOID extern sspi_gss_OID SSPI_GSS_C_NT_HOSTBASED_SERVICE; + SSPI_GSSOID extern sspi_gss_OID SSPI_GSS_C_NT_ANONYMOUS; + SSPI_GSSOID extern sspi_gss_OID SSPI_GSS_C_NT_EXPORT_NAME; + + UINT32 SSPI_GSSAPI sspi_gss_acquire_cred(UINT32* minor_status, sspi_gss_name_t desired_name, + UINT32 time_req, sspi_gss_OID_set desired_mechs, + sspi_gss_cred_usage_t cred_usage, + sspi_gss_cred_id_t* output_cred_handle, + sspi_gss_OID_set* actual_mechs, UINT32* time_rec); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_acquire_cred)( + UINT32* minor_status, sspi_gss_name_t desired_name, UINT32 time_req, + sspi_gss_OID_set desired_mechs, sspi_gss_cred_usage_t cred_usage, + sspi_gss_cred_id_t* output_cred_handle, sspi_gss_OID_set* actual_mechs, UINT32* time_rec); + + UINT32 SSPI_GSSAPI sspi_gss_release_cred(UINT32* minor_status, sspi_gss_cred_id_t* cred_handle); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_release_cred)(UINT32* minor_status, + sspi_gss_cred_id_t* cred_handle); + + UINT32 SSPI_GSSAPI sspi_gss_init_sec_context( + UINT32* minor_status, sspi_gss_cred_id_t claimant_cred_handle, + sspi_gss_ctx_id_t* context_handle, sspi_gss_name_t target_name, sspi_gss_OID mech_type, + UINT32 req_flags, UINT32 time_req, sspi_gss_channel_bindings_t input_chan_bindings, + sspi_gss_buffer_t input_token, sspi_gss_OID* actual_mech_type, + sspi_gss_buffer_t output_token, UINT32* ret_flags, UINT32* time_rec); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_init_sec_context)( + UINT32* minor_status, sspi_gss_cred_id_t claimant_cred_handle, + sspi_gss_ctx_id_t* context_handle, sspi_gss_name_t target_name, sspi_gss_OID mech_type, + UINT32 req_flags, UINT32 time_req, sspi_gss_channel_bindings_t input_chan_bindings, + sspi_gss_buffer_t input_token, sspi_gss_OID* actual_mech_type, + sspi_gss_buffer_t output_token, UINT32* ret_flags, UINT32* time_rec); + + UINT32 SSPI_GSSAPI sspi_gss_accept_sec_context( + UINT32* minor_status, sspi_gss_ctx_id_t* context_handle, + sspi_gss_cred_id_t acceptor_cred_handle, sspi_gss_buffer_t input_token_buffer, + sspi_gss_channel_bindings_t input_chan_bindings, sspi_gss_name_t* src_name, + sspi_gss_OID* mech_type, sspi_gss_buffer_t output_token, UINT32* ret_flags, + UINT32* time_rec, sspi_gss_cred_id_t* delegated_cred_handle); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_accept_sec_context)( + UINT32* minor_status, sspi_gss_ctx_id_t* context_handle, + sspi_gss_cred_id_t acceptor_cred_handle, sspi_gss_buffer_t input_token_buffer, + sspi_gss_channel_bindings_t input_chan_bindings, sspi_gss_name_t* src_name, + sspi_gss_OID* mech_type, sspi_gss_buffer_t output_token, UINT32* ret_flags, + UINT32* time_rec, sspi_gss_cred_id_t* delegated_cred_handle); + + UINT32 SSPI_GSSAPI sspi_gss_process_context_token(UINT32* minor_status, + sspi_gss_ctx_id_t context_handle, + sspi_gss_buffer_t token_buffer); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_process_context_token)(UINT32* minor_status, + sspi_gss_ctx_id_t context_handle, + sspi_gss_buffer_t token_buffer); + + UINT32 SSPI_GSSAPI sspi_gss_delete_sec_context(UINT32* minor_status, + sspi_gss_ctx_id_t* context_handle, + sspi_gss_buffer_t output_token); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_delete_sec_context)(UINT32* minor_status, + sspi_gss_ctx_id_t* context_handle, + sspi_gss_buffer_t output_token); + + UINT32 SSPI_GSSAPI sspi_gss_context_time(UINT32* minor_status, sspi_gss_ctx_id_t context_handle, + UINT32* time_rec); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_context_time)(UINT32* minor_status, + sspi_gss_ctx_id_t context_handle, + UINT32* time_rec); + + UINT32 SSPI_GSSAPI sspi_gss_get_mic(UINT32* minor_status, sspi_gss_ctx_id_t context_handle, + sspi_gss_qop_t qop_req, sspi_gss_buffer_t message_buffer, + sspi_gss_buffer_t message_token); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_get_mic)(UINT32* minor_status, + sspi_gss_ctx_id_t context_handle, + sspi_gss_qop_t qop_req, + sspi_gss_buffer_t message_buffer, + sspi_gss_buffer_t message_token); + + UINT32 SSPI_GSSAPI sspi_gss_verify_mic(UINT32* minor_status, sspi_gss_ctx_id_t context_handle, + sspi_gss_buffer_t message_buffer, + sspi_gss_buffer_t message_token, + sspi_gss_qop_t* qop_state); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_verify_mic)(UINT32* minor_status, + sspi_gss_ctx_id_t context_handle, + sspi_gss_buffer_t message_buffer, + sspi_gss_buffer_t message_token, + sspi_gss_qop_t* qop_state); + + UINT32 SSPI_GSSAPI sspi_gss_wrap(UINT32* minor_status, sspi_gss_ctx_id_t context_handle, + int conf_req_flag, sspi_gss_qop_t qop_req, + sspi_gss_buffer_t input_message_buffer, int* conf_state, + sspi_gss_buffer_t output_message_buffer); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_wrap)(UINT32* minor_status, + sspi_gss_ctx_id_t context_handle, + int conf_req_flag, sspi_gss_qop_t qop_req, + sspi_gss_buffer_t input_message_buffer, + int* conf_state, + sspi_gss_buffer_t output_message_buffer); + + UINT32 SSPI_GSSAPI sspi_gss_unwrap(UINT32* minor_status, const sspi_gss_ctx_id_t context_handle, + const sspi_gss_buffer_t input_message_buffer, + sspi_gss_buffer_t output_message_buffer, int* conf_state, + sspi_gss_qop_t* qop_state); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_unwrap)(UINT32* minor_status, + sspi_gss_ctx_id_t context_handle, + sspi_gss_buffer_t input_message_buffer, + sspi_gss_buffer_t output_message_buffer, + int* conf_state, sspi_gss_qop_t* qop_state); + + UINT32 SSPI_GSSAPI sspi_gss_display_status(UINT32* minor_status, UINT32 status_value, + int status_type, sspi_gss_OID mech_type, + UINT32* message_context, + sspi_gss_buffer_t status_string); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_display_status)(UINT32* minor_status, + UINT32 status_value, int status_type, + sspi_gss_OID mech_type, + UINT32* message_context, + sspi_gss_buffer_t status_string); + + UINT32 SSPI_GSSAPI sspi_gss_indicate_mechs(UINT32* minor_status, sspi_gss_OID_set* mech_set); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_indicate_mechs)(UINT32* minor_status, + sspi_gss_OID_set* mech_set); + + UINT32 SSPI_GSSAPI sspi_gss_compare_name(UINT32* minor_status, sspi_gss_name_t name1, + sspi_gss_name_t name2, int* name_equal); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_compare_name)(UINT32* minor_status, + sspi_gss_name_t name1, + sspi_gss_name_t name2, int* name_equal); + + UINT32 SSPI_GSSAPI sspi_gss_display_name(UINT32* minor_status, sspi_gss_name_t input_name, + sspi_gss_buffer_t output_name_buffer, + sspi_gss_OID* output_name_type); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_display_name)(UINT32* minor_status, + sspi_gss_name_t input_name, + sspi_gss_buffer_t output_name_buffer, + sspi_gss_OID* output_name_type); + + UINT32 SSPI_GSSAPI sspi_gss_import_name(UINT32* minor_status, + sspi_gss_buffer_t input_name_buffer, + sspi_gss_OID input_name_type, + sspi_gss_name_t* output_name); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_import_name)(UINT32* minor_status, + sspi_gss_buffer_t input_name_buffer, + sspi_gss_OID input_name_type, + sspi_gss_name_t* output_name); + + UINT32 SSPI_GSSAPI sspi_gss_release_name(UINT32* minor_status, sspi_gss_name_t* input_name); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_release_name)(UINT32* minor_status, + sspi_gss_name_t* input_name); + + UINT32 SSPI_GSSAPI sspi_gss_release_buffer(UINT32* minor_status, sspi_gss_buffer_t buffer); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_release_buffer)(UINT32* minor_status, + sspi_gss_buffer_t buffer); + + UINT32 SSPI_GSSAPI sspi_gss_release_oid_set(UINT32* minor_status, sspi_gss_OID_set* set); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_release_oid_set)(UINT32* minor_status, + sspi_gss_OID_set* set); + + UINT32 SSPI_GSSAPI sspi_gss_inquire_cred(UINT32* minor_status, sspi_gss_cred_id_t cred_handle, + sspi_gss_name_t* name, UINT32* lifetime, + sspi_gss_cred_usage_t* cred_usage, + sspi_gss_OID_set* mechanisms); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_inquire_cred)(UINT32* minor_status, + sspi_gss_cred_id_t cred_handle, + sspi_gss_name_t* name, UINT32* lifetime, + sspi_gss_cred_usage_t* cred_usage, + sspi_gss_OID_set* mechanisms); + + UINT32 SSPI_GSSAPI sspi_gss_inquire_context(UINT32* minor_status, + sspi_gss_ctx_id_t context_handle, + sspi_gss_name_t* src_name, + sspi_gss_name_t* targ_name, UINT32* lifetime_rec, + sspi_gss_OID* mech_type, UINT32* ctx_flags, + int* locally_initiated, int* open); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_inquire_context)( + UINT32* minor_status, sspi_gss_ctx_id_t context_handle, sspi_gss_name_t* src_name, + sspi_gss_name_t* targ_name, UINT32* lifetime_rec, sspi_gss_OID* mech_type, + UINT32* ctx_flags, int* locally_initiated, int* open); + + UINT32 SSPI_GSSAPI sspi_gss_wrap_size_limit(UINT32* minor_status, + sspi_gss_ctx_id_t context_handle, int conf_req_flag, + sspi_gss_qop_t qop_req, UINT32 req_output_size, + UINT32* max_input_size); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_wrap_size_limit)( + UINT32* minor_status, sspi_gss_ctx_id_t context_handle, int conf_req_flag, + sspi_gss_qop_t qop_req, UINT32 req_output_size, UINT32* max_input_size); + + UINT32 SSPI_GSSAPI sspi_gss_import_name_object(UINT32* minor_status, void* input_name, + sspi_gss_OID input_name_type, + sspi_gss_name_t* output_name); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_import_name_object)(UINT32* minor_status, + void* input_name, + sspi_gss_OID input_name_type, + sspi_gss_name_t* output_name); + + UINT32 SSPI_GSSAPI sspi_gss_export_name_object(UINT32* minor_status, sspi_gss_name_t input_name, + sspi_gss_OID desired_name_type, + void** output_name); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_export_name_object)(UINT32* minor_status, + sspi_gss_name_t input_name, + sspi_gss_OID desired_name_type, + void** output_name); + + UINT32 SSPI_GSSAPI sspi_gss_add_cred(UINT32* minor_status, sspi_gss_cred_id_t input_cred_handle, + sspi_gss_name_t desired_name, sspi_gss_OID desired_mech, + sspi_gss_cred_usage_t cred_usage, + UINT32 initiator_time_req, UINT32 acceptor_time_req, + sspi_gss_cred_id_t* output_cred_handle, + sspi_gss_OID_set* actual_mechs, UINT32* initiator_time_rec, + UINT32* acceptor_time_rec); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_add_cred)( + UINT32* minor_status, sspi_gss_cred_id_t input_cred_handle, sspi_gss_name_t desired_name, + sspi_gss_OID desired_mech, sspi_gss_cred_usage_t cred_usage, UINT32 initiator_time_req, + UINT32 acceptor_time_req, sspi_gss_cred_id_t* output_cred_handle, + sspi_gss_OID_set* actual_mechs, UINT32* initiator_time_rec, UINT32* acceptor_time_rec); + + UINT32 SSPI_GSSAPI sspi_gss_inquire_cred_by_mech(UINT32* minor_status, + sspi_gss_cred_id_t cred_handle, + sspi_gss_OID mech_type, sspi_gss_name_t* name, + UINT32* initiator_lifetime, + UINT32* acceptor_lifetime, + sspi_gss_cred_usage_t* cred_usage); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_inquire_cred_by_mech)( + UINT32* minor_status, sspi_gss_cred_id_t cred_handle, sspi_gss_OID mech_type, + sspi_gss_name_t* name, UINT32* initiator_lifetime, UINT32* acceptor_lifetime, + sspi_gss_cred_usage_t* cred_usage); + + UINT32 SSPI_GSSAPI sspi_gss_export_sec_context(UINT32* minor_status, + sspi_gss_ctx_id_t* context_handle, + sspi_gss_buffer_t interprocess_token); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_export_sec_context)( + UINT32* minor_status, sspi_gss_ctx_id_t* context_handle, + sspi_gss_buffer_t interprocess_token); + + UINT32 SSPI_GSSAPI sspi_gss_import_sec_context(UINT32* minor_status, + sspi_gss_buffer_t interprocess_token, + sspi_gss_ctx_id_t* context_handle); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_import_sec_context)( + UINT32* minor_status, sspi_gss_buffer_t interprocess_token, + sspi_gss_ctx_id_t* context_handle); + + UINT32 SSPI_GSSAPI sspi_gss_release_oid(UINT32* minor_status, sspi_gss_OID* oid); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_release_oid)(UINT32* minor_status, sspi_gss_OID* oid); + + UINT32 SSPI_GSSAPI sspi_gss_create_empty_oid_set(UINT32* minor_status, + sspi_gss_OID_set* oid_set); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_create_empty_oid_set)(UINT32* minor_status, + sspi_gss_OID_set* oid_set); + + UINT32 SSPI_GSSAPI sspi_gss_add_oid_set_member(UINT32* minor_status, sspi_gss_OID member_oid, + sspi_gss_OID_set* oid_set); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_add_oid_set_member)(UINT32* minor_status, + sspi_gss_OID member_oid, + sspi_gss_OID_set* oid_set); + + UINT32 SSPI_GSSAPI sspi_gss_test_oid_set_member(UINT32* minor_status, sspi_gss_OID member, + sspi_gss_OID_set set, int* present); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_test_oid_set_member)(UINT32* minor_status, + sspi_gss_OID member, + sspi_gss_OID_set set, + int* present); + + UINT32 SSPI_GSSAPI sspi_gss_str_to_oid(UINT32* minor_status, sspi_gss_buffer_t oid_str, + sspi_gss_OID* oid); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_str_to_oid)(UINT32* minor_status, + sspi_gss_buffer_t oid_str, + sspi_gss_OID* oid); + + UINT32 SSPI_GSSAPI sspi_gss_oid_to_str(UINT32* minor_status, sspi_gss_OID oid, + sspi_gss_buffer_t oid_str); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_oid_to_str)(UINT32* minor_status, sspi_gss_OID oid, + sspi_gss_buffer_t oid_str); + + UINT32 SSPI_GSSAPI sspi_gss_inquire_names_for_mech(UINT32* minor_status, sspi_gss_OID mechanism, + sspi_gss_OID_set* name_types); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_inquire_names_for_mech)(UINT32* minor_status, + sspi_gss_OID mechanism, + sspi_gss_OID_set* name_types); + + UINT32 SSPI_GSSAPI sspi_gss_inquire_mechs_for_name(UINT32* minor_status, + const sspi_gss_name_t input_name, + sspi_gss_OID_set* mech_types); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_inquire_mechs_for_name)( + UINT32* minor_status, const sspi_gss_name_t input_name, sspi_gss_OID_set* mech_types); + + UINT32 SSPI_GSSAPI sspi_gss_sign(UINT32* minor_status, sspi_gss_ctx_id_t context_handle, + int qop_req, sspi_gss_buffer_t message_buffer, + sspi_gss_buffer_t message_token); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_sign)(UINT32* minor_status, + sspi_gss_ctx_id_t context_handle, int qop_req, + sspi_gss_buffer_t message_buffer, + sspi_gss_buffer_t message_token); + + UINT32 SSPI_GSSAPI sspi_gss_verify(UINT32* minor_status, sspi_gss_ctx_id_t context_handle, + sspi_gss_buffer_t message_buffer, + sspi_gss_buffer_t token_buffer, int* qop_state); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_verify)(UINT32* minor_status, + sspi_gss_ctx_id_t context_handle, + sspi_gss_buffer_t message_buffer, + sspi_gss_buffer_t token_buffer, int* qop_state); + + UINT32 SSPI_GSSAPI sspi_gss_seal(UINT32* minor_status, sspi_gss_ctx_id_t context_handle, + int conf_req_flag, int qop_req, + sspi_gss_buffer_t input_message_buffer, int* conf_state, + sspi_gss_buffer_t output_message_buffer); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_seal)(UINT32* minor_status, + sspi_gss_ctx_id_t context_handle, + int conf_req_flag, int qop_req, + sspi_gss_buffer_t input_message_buffer, + int* conf_state, + sspi_gss_buffer_t output_message_buffer); + + UINT32 SSPI_GSSAPI sspi_gss_unseal(UINT32* minor_status, sspi_gss_ctx_id_t context_handle, + sspi_gss_buffer_t input_message_buffer, + sspi_gss_buffer_t output_message_buffer, int* conf_state, + int* qop_state); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_unseal)(UINT32* minor_status, + sspi_gss_ctx_id_t context_handle, + sspi_gss_buffer_t input_message_buffer, + sspi_gss_buffer_t output_message_buffer, + int* conf_state, int* qop_state); + + UINT32 SSPI_GSSAPI sspi_gss_export_name(UINT32* minor_status, const sspi_gss_name_t input_name, + sspi_gss_buffer_t exported_name); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_export_name)(UINT32* minor_status, + const sspi_gss_name_t input_name, + sspi_gss_buffer_t exported_name); + + UINT32 SSPI_GSSAPI sspi_gss_duplicate_name(UINT32* minor_status, + const sspi_gss_name_t input_name, + sspi_gss_name_t* dest_name); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_duplicate_name)(UINT32* minor_status, + const sspi_gss_name_t input_name, + sspi_gss_name_t* dest_name); + + UINT32 SSPI_GSSAPI sspi_gss_canonicalize_name(UINT32* minor_status, + const sspi_gss_name_t input_name, + const sspi_gss_OID mech_type, + sspi_gss_name_t* output_name); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_canonicalize_name)(UINT32* minor_status, + const sspi_gss_name_t input_name, + const sspi_gss_OID mech_type, + sspi_gss_name_t* output_name); + + UINT32 SSPI_GSSAPI sspi_gss_pseudo_random(UINT32* minor_status, sspi_gss_ctx_id_t context, + int prf_key, const sspi_gss_buffer_t prf_in, + SSIZE_T desired_output_len, + sspi_gss_buffer_t prf_out); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_pseudo_random)(UINT32* minor_status, + sspi_gss_ctx_id_t context, int prf_key, + const sspi_gss_buffer_t prf_in, + SSIZE_T desired_output_len, + sspi_gss_buffer_t prf_out); + + UINT32 SSPI_GSSAPI sspi_gss_store_cred(UINT32* minor_status, + const sspi_gss_cred_id_t input_cred_handle, + sspi_gss_cred_usage_t input_usage, + const sspi_gss_OID desired_mech, UINT32 overwrite_cred, + UINT32 default_cred, sspi_gss_OID_set* elements_stored, + sspi_gss_cred_usage_t* cred_usage_stored); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_store_cred)(UINT32* minor_status, + const sspi_gss_cred_id_t input_cred_handle, + sspi_gss_cred_usage_t input_usage, + const sspi_gss_OID desired_mech, + UINT32 overwrite_cred, UINT32 default_cred, + sspi_gss_OID_set* elements_stored, + sspi_gss_cred_usage_t* cred_usage_stored); + + UINT32 SSPI_GSSAPI sspi_gss_set_neg_mechs(UINT32* minor_status, sspi_gss_cred_id_t cred_handle, + const sspi_gss_OID_set mech_set); + + typedef UINT32(SSPI_GSSAPI* fn_sspi_gss_set_neg_mechs)(UINT32* minor_status, + sspi_gss_cred_id_t cred_handle, + const sspi_gss_OID_set mech_set); #ifdef __cplusplus } @@ -874,11 +669,10 @@ typedef struct _GSSAPI_FUNCTION_TABLE GSSAPI_FUNCTION_TABLE; GSSAPI_FUNCTION_TABLE* SEC_ENTRY gssApi_InitSecurityInterface(void); #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif - - #ifdef __cplusplus } #endif diff --git a/winpr/libwinpr/sspi/sspi_winpr.c b/winpr/libwinpr/sspi/sspi_winpr.c index 625727c05..5bd897d02 100644 --- a/winpr/libwinpr/sspi/sspi_winpr.c +++ b/winpr/libwinpr/sspi/sspi_winpr.c @@ -63,23 +63,13 @@ extern const SecPkgInfoW SCHANNEL_SecPkgInfoW; extern const SecurityFunctionTableA SCHANNEL_SecurityFunctionTableA; extern const SecurityFunctionTableW SCHANNEL_SecurityFunctionTableW; -static const SecPkgInfoA* SecPkgInfoA_LIST[] = -{ - &NTLM_SecPkgInfoA, - &KERBEROS_SecPkgInfoA, - &NEGOTIATE_SecPkgInfoA, - &CREDSSP_SecPkgInfoA, - &SCHANNEL_SecPkgInfoA -}; +static const SecPkgInfoA* SecPkgInfoA_LIST[] = { &NTLM_SecPkgInfoA, &KERBEROS_SecPkgInfoA, + &NEGOTIATE_SecPkgInfoA, &CREDSSP_SecPkgInfoA, + &SCHANNEL_SecPkgInfoA }; -static const SecPkgInfoW* SecPkgInfoW_LIST[] = -{ - &NTLM_SecPkgInfoW, - &KERBEROS_SecPkgInfoW, - &NEGOTIATE_SecPkgInfoW, - &CREDSSP_SecPkgInfoW, - &SCHANNEL_SecPkgInfoW -}; +static const SecPkgInfoW* SecPkgInfoW_LIST[] = { &NTLM_SecPkgInfoW, &KERBEROS_SecPkgInfoW, + &NEGOTIATE_SecPkgInfoW, &CREDSSP_SecPkgInfoW, + &SCHANNEL_SecPkgInfoW }; static SecurityFunctionTableA winpr_SecurityFunctionTableA; static SecurityFunctionTableW winpr_SecurityFunctionTableW; @@ -98,8 +88,7 @@ struct _SecurityFunctionTableW_NAME }; typedef struct _SecurityFunctionTableW_NAME SecurityFunctionTableW_NAME; -static const SecurityFunctionTableA_NAME SecurityFunctionTableA_NAME_LIST[] = -{ +static const SecurityFunctionTableA_NAME SecurityFunctionTableA_NAME_LIST[] = { { "NTLM", &NTLM_SecurityFunctionTableA }, { "Kerberos", &KERBEROS_SecurityFunctionTableA }, { "Negotiate", &NEGOTIATE_SecurityFunctionTableA }, @@ -113,8 +102,7 @@ static const WCHAR NEGOTIATE_NAME_W[] = { 'N', 'e', 'g', 'o', 't', 'i', 'a', 't' static const WCHAR CREDSSP_NAME_W[] = { 'C', 'r', 'e', 'd', 'S', 'S', 'P', '\0' }; static const WCHAR SCHANNEL_NAME_W[] = { 'S', 'c', 'h', 'a', 'n', 'n', 'e', 'l', '\0' }; -static const SecurityFunctionTableW_NAME SecurityFunctionTableW_NAME_LIST[] = -{ +static const SecurityFunctionTableW_NAME SecurityFunctionTableW_NAME_LIST[] = { { NTLM_NAME_W, &NTLM_SecurityFunctionTableW }, { KERBEROS_NAME_W, &KERBEROS_SecurityFunctionTableW }, { NEGOTIATE_NAME_W, &NEGOTIATE_SecurityFunctionTableW }, @@ -122,8 +110,8 @@ static const SecurityFunctionTableW_NAME SecurityFunctionTableW_NAME_LIST[] = { SCHANNEL_NAME_W, &SCHANNEL_SecurityFunctionTableW } }; -#define SecHandle_LOWER_MAX 0xFFFFFFFF -#define SecHandle_UPPER_MAX 0xFFFFFFFE +#define SecHandle_LOWER_MAX 0xFFFFFFFF +#define SecHandle_UPPER_MAX 0xFFFFFFFE struct _CONTEXT_BUFFER_ALLOC_ENTRY { @@ -149,7 +137,7 @@ static int sspi_ContextBufferAllocTableNew(void) ContextBufferAllocTable.cEntries = 0; ContextBufferAllocTable.cMaxEntries = 4; size = sizeof(CONTEXT_BUFFER_ALLOC_ENTRY) * ContextBufferAllocTable.cMaxEntries; - ContextBufferAllocTable.entries = (CONTEXT_BUFFER_ALLOC_ENTRY*) calloc(1, size); + ContextBufferAllocTable.entries = (CONTEXT_BUFFER_ALLOC_ENTRY*)calloc(1, size); if (!ContextBufferAllocTable.entries) return -1; @@ -168,7 +156,7 @@ static int sspi_ContextBufferAllocTableGrow(void) if (!size) return -1; - entries = (CONTEXT_BUFFER_ALLOC_ENTRY*) realloc(ContextBufferAllocTable.entries, size); + entries = (CONTEXT_BUFFER_ALLOC_ENTRY*)realloc(ContextBufferAllocTable.entries, size); if (!entries) { @@ -177,7 +165,7 @@ static int sspi_ContextBufferAllocTableGrow(void) } ContextBufferAllocTable.entries = entries; - ZeroMemory((void*) &ContextBufferAllocTable.entries[ContextBufferAllocTable.cMaxEntries / 2], + ZeroMemory((void*)&ContextBufferAllocTable.entries[ContextBufferAllocTable.cMaxEntries / 2], size / 2); return 1; } @@ -185,7 +173,8 @@ static int sspi_ContextBufferAllocTableGrow(void) static void sspi_ContextBufferAllocTableFree(void) { if (ContextBufferAllocTable.cEntries != 0) - WLog_ERR(TAG, "ContextBufferAllocTable.entries == %"PRIu32, ContextBufferAllocTable.cEntries); + WLog_ERR(TAG, "ContextBufferAllocTable.entries == %" PRIu32, + ContextBufferAllocTable.cEntries); ContextBufferAllocTable.cEntries = ContextBufferAllocTable.cMaxEntries = 0; free(ContextBufferAllocTable.entries); @@ -225,7 +214,7 @@ static void* sspi_ContextBufferAlloc(UINT32 allocatorIndex, size_t size) SSPI_CREDENTIALS* sspi_CredentialsNew(void) { SSPI_CREDENTIALS* credentials; - credentials = (SSPI_CREDENTIALS*) calloc(1, sizeof(SSPI_CREDENTIALS)); + credentials = (SSPI_CREDENTIALS*)calloc(1, sizeof(SSPI_CREDENTIALS)); return credentials; } @@ -290,7 +279,7 @@ void sspi_SecBufferFree(PSecBuffer SecBuffer) SecHandle* sspi_SecureHandleAlloc(void) { - SecHandle* handle = (SecHandle*) calloc(1, sizeof(SecHandle)); + SecHandle* handle = (SecHandle*)calloc(1, sizeof(SecHandle)); if (!handle) return NULL; @@ -306,7 +295,7 @@ void* sspi_SecureHandleGetLowerPointer(SecHandle* handle) if (!handle || !SecIsValidHandle(handle) || !handle->dwLower) return NULL; - pointer = (void*) ~((size_t) handle->dwLower); + pointer = (void*)~((size_t)handle->dwLower); return pointer; } @@ -324,7 +313,7 @@ void sspi_SecureHandleSetLowerPointer(SecHandle* handle, void* pointer) if (!handle) return; - handle->dwLower = (ULONG_PTR)(~((size_t) pointer)); + handle->dwLower = (ULONG_PTR)(~((size_t)pointer)); } void* sspi_SecureHandleGetUpperPointer(SecHandle* handle) @@ -334,7 +323,7 @@ void* sspi_SecureHandleGetUpperPointer(SecHandle* handle) if (!handle || !SecIsValidHandle(handle) || !handle->dwUpper) return NULL; - pointer = (void*) ~((size_t) handle->dwUpper); + pointer = (void*)~((size_t)handle->dwUpper); return pointer; } @@ -343,7 +332,7 @@ void sspi_SecureHandleSetUpperPointer(SecHandle* handle, void* pointer) if (!handle) return; - handle->dwUpper = (ULONG_PTR)(~((size_t) pointer)); + handle->dwUpper = (ULONG_PTR)(~((size_t)pointer)); } void sspi_SecureHandleFree(SecHandle* handle) @@ -363,23 +352,24 @@ int sspi_SetAuthIdentity(SEC_WINNT_AUTH_IDENTITY* identity, const char* user, co return -1; rc = sspi_SetAuthIdentityWithUnicodePassword(identity, user, domain, unicodePassword, - (ULONG)(unicodePasswordLenW - 1)); + (ULONG)(unicodePasswordLenW - 1)); free(unicodePassword); return rc; } int sspi_SetAuthIdentityWithUnicodePassword(SEC_WINNT_AUTH_IDENTITY* identity, const char* user, - const char* domain, LPWSTR password, ULONG passwordLength) + const char* domain, LPWSTR password, + ULONG passwordLength) { int status; identity->Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE; free(identity->User); - identity->User = (UINT16*) NULL; + identity->User = (UINT16*)NULL; identity->UserLength = 0; if (user) { - status = ConvertToUnicode(CP_UTF8, 0, user, -1, (LPWSTR*) & (identity->User), 0); + status = ConvertToUnicode(CP_UTF8, 0, user, -1, (LPWSTR*)&(identity->User), 0); if (status <= 0) return -1; @@ -388,12 +378,12 @@ int sspi_SetAuthIdentityWithUnicodePassword(SEC_WINNT_AUTH_IDENTITY* identity, c } free(identity->Domain); - identity->Domain = (UINT16*) NULL; + identity->Domain = (UINT16*)NULL; identity->DomainLength = 0; if (domain) { - status = ConvertToUnicode(CP_UTF8, 0, domain, -1, (LPWSTR*) & (identity->Domain), 0); + status = ConvertToUnicode(CP_UTF8, 0, domain, -1, (LPWSTR*)&(identity->Domain), 0); if (status <= 0) return -1; @@ -402,7 +392,7 @@ int sspi_SetAuthIdentityWithUnicodePassword(SEC_WINNT_AUTH_IDENTITY* identity, c } free(identity->Password); - identity->Password = (UINT16*) calloc(1, (passwordLength + 1) * sizeof(WCHAR)); + identity->Password = (UINT16*)calloc(1, (passwordLength + 1) * sizeof(WCHAR)); if (!identity->Password) return -1; @@ -418,8 +408,8 @@ int sspi_CopyAuthIdentity(SEC_WINNT_AUTH_IDENTITY* identity, SEC_WINNT_AUTH_IDEN if (srcIdentity->Flags & SEC_WINNT_AUTH_IDENTITY_ANSI) { - status = sspi_SetAuthIdentity(identity, (char*) srcIdentity->User, - (char*) srcIdentity->Domain, (char*) srcIdentity->Password); + status = sspi_SetAuthIdentity(identity, (char*)srcIdentity->User, + (char*)srcIdentity->Domain, (char*)srcIdentity->Password); if (status <= 0) return -1; @@ -436,7 +426,7 @@ int sspi_CopyAuthIdentity(SEC_WINNT_AUTH_IDENTITY* identity, SEC_WINNT_AUTH_IDEN if (identity->UserLength > 0) { - identity->User = (UINT16*) calloc((identity->UserLength + 1), sizeof(WCHAR)); + identity->User = (UINT16*)calloc((identity->UserLength + 1), sizeof(WCHAR)); if (!identity->User) return -1; @@ -449,7 +439,7 @@ int sspi_CopyAuthIdentity(SEC_WINNT_AUTH_IDENTITY* identity, SEC_WINNT_AUTH_IDEN if (identity->DomainLength > 0) { - identity->Domain = (UINT16*) calloc((identity->DomainLength + 1), sizeof(WCHAR)); + identity->Domain = (UINT16*)calloc((identity->DomainLength + 1), sizeof(WCHAR)); if (!identity->Domain) return -1; @@ -465,12 +455,13 @@ int sspi_CopyAuthIdentity(SEC_WINNT_AUTH_IDENTITY* identity, SEC_WINNT_AUTH_IDEN if (srcIdentity->Password) { - identity->Password = (UINT16*) calloc((identity->PasswordLength + 1), sizeof(WCHAR)); + identity->Password = (UINT16*)calloc((identity->PasswordLength + 1), sizeof(WCHAR)); if (!identity->Password) return -1; - CopyMemory(identity->Password, srcIdentity->Password, identity->PasswordLength * sizeof(WCHAR)); + CopyMemory(identity->Password, srcIdentity->Password, + identity->PasswordLength * sizeof(WCHAR)); identity->Password[identity->PasswordLength] = 0; } @@ -521,11 +512,12 @@ static SecurityFunctionTableA* sspi_GetSecurityFunctionTableAByNameA(const SEC_C UINT32 cPackages; cPackages = sizeof(SecPkgInfoA_LIST) / sizeof(*(SecPkgInfoA_LIST)); - for (index = 0; index < (int) cPackages; index++) + for (index = 0; index < (int)cPackages; index++) { if (strcmp(Name, SecurityFunctionTableA_NAME_LIST[index].Name) == 0) { - return (SecurityFunctionTableA*) SecurityFunctionTableA_NAME_LIST[index].SecurityFunctionTable; + return (SecurityFunctionTableA*)SecurityFunctionTableA_NAME_LIST[index] + .SecurityFunctionTable; } } @@ -538,11 +530,12 @@ static SecurityFunctionTableW* sspi_GetSecurityFunctionTableWByNameW(const SEC_W UINT32 cPackages; cPackages = sizeof(SecPkgInfoW_LIST) / sizeof(*(SecPkgInfoW_LIST)); - for (index = 0; index < (int) cPackages; index++) + for (index = 0; index < (int)cPackages; index++) { if (lstrcmpW(Name, SecurityFunctionTableW_NAME_LIST[index].Name) == 0) { - return (SecurityFunctionTableW*) SecurityFunctionTableW_NAME_LIST[index].SecurityFunctionTable; + return (SecurityFunctionTableW*)SecurityFunctionTableW_NAME_LIST[index] + .SecurityFunctionTable; } } @@ -603,7 +596,7 @@ static void sspi_ContextBufferFree(void* contextBuffer) /* Package Management */ static SECURITY_STATUS SEC_ENTRY winpr_EnumerateSecurityPackagesW(ULONG* pcPackages, - PSecPkgInfoW* ppPackageInfo) + PSecPkgInfoW* ppPackageInfo) { int index; size_t size; @@ -611,12 +604,12 @@ static SECURITY_STATUS SEC_ENTRY winpr_EnumerateSecurityPackagesW(ULONG* pcPacka SecPkgInfoW* pPackageInfo; cPackages = sizeof(SecPkgInfoW_LIST) / sizeof(*(SecPkgInfoW_LIST)); size = sizeof(SecPkgInfoW) * cPackages; - pPackageInfo = (SecPkgInfoW*) sspi_ContextBufferAlloc(EnumerateSecurityPackagesIndex, size); + pPackageInfo = (SecPkgInfoW*)sspi_ContextBufferAlloc(EnumerateSecurityPackagesIndex, size); if (!pPackageInfo) return SEC_E_INSUFFICIENT_MEMORY; - for (index = 0; index < (int) cPackages; index++) + for (index = 0; index < (int)cPackages; index++) { pPackageInfo[index].fCapabilities = SecPkgInfoW_LIST[index]->fCapabilities; pPackageInfo[index].wVersion = SecPkgInfoW_LIST[index]->wVersion; @@ -632,7 +625,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_EnumerateSecurityPackagesW(ULONG* pcPacka } static SECURITY_STATUS SEC_ENTRY winpr_EnumerateSecurityPackagesA(ULONG* pcPackages, - PSecPkgInfoA* ppPackageInfo) + PSecPkgInfoA* ppPackageInfo) { int index; size_t size; @@ -640,12 +633,12 @@ static SECURITY_STATUS SEC_ENTRY winpr_EnumerateSecurityPackagesA(ULONG* pcPacka SecPkgInfoA* pPackageInfo; cPackages = sizeof(SecPkgInfoA_LIST) / sizeof(*(SecPkgInfoA_LIST)); size = sizeof(SecPkgInfoA) * cPackages; - pPackageInfo = (SecPkgInfoA*) sspi_ContextBufferAlloc(EnumerateSecurityPackagesIndex, size); + pPackageInfo = (SecPkgInfoA*)sspi_ContextBufferAlloc(EnumerateSecurityPackagesIndex, size); if (!pPackageInfo) return SEC_E_INSUFFICIENT_MEMORY; - for (index = 0; index < (int) cPackages; index++) + for (index = 0; index < (int)cPackages; index++) { pPackageInfo[index].fCapabilities = SecPkgInfoA_LIST[index]->fCapabilities; pPackageInfo[index].wVersion = SecPkgInfoA_LIST[index]->wVersion; @@ -670,13 +663,13 @@ static void FreeContextBuffer_EnumerateSecurityPackages(void* contextBuffer) { int index; UINT32 cPackages; - SecPkgInfoA* pPackageInfo = (SecPkgInfoA*) contextBuffer; + SecPkgInfoA* pPackageInfo = (SecPkgInfoA*)contextBuffer; cPackages = sizeof(SecPkgInfoA_LIST) / sizeof(*(SecPkgInfoA_LIST)); if (!pPackageInfo) return; - for (index = 0; index < (int) cPackages; index++) + for (index = 0; index < (int)cPackages; index++) { free(pPackageInfo[index].Name); free(pPackageInfo[index].Comment); @@ -696,7 +689,7 @@ SecurityFunctionTableA* SEC_ENTRY winpr_InitSecurityInterfaceA(void) } static SECURITY_STATUS SEC_ENTRY winpr_QuerySecurityPackageInfoW(SEC_WCHAR* pszPackageName, - PSecPkgInfoW* ppPackageInfo) + PSecPkgInfoW* ppPackageInfo) { int index; size_t size; @@ -704,12 +697,13 @@ static SECURITY_STATUS SEC_ENTRY winpr_QuerySecurityPackageInfoW(SEC_WCHAR* pszP SecPkgInfoW* pPackageInfo; cPackages = sizeof(SecPkgInfoW_LIST) / sizeof(*(SecPkgInfoW_LIST)); - for (index = 0; index < (int) cPackages; index++) + for (index = 0; index < (int)cPackages; index++) { if (lstrcmpW(pszPackageName, SecPkgInfoW_LIST[index]->Name) == 0) { size = sizeof(SecPkgInfoW); - pPackageInfo = (SecPkgInfoW*) sspi_ContextBufferAlloc(QuerySecurityPackageInfoIndex, size); + pPackageInfo = + (SecPkgInfoW*)sspi_ContextBufferAlloc(QuerySecurityPackageInfoIndex, size); if (!pPackageInfo) return SEC_E_INSUFFICIENT_MEMORY; @@ -730,7 +724,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_QuerySecurityPackageInfoW(SEC_WCHAR* pszP } static SECURITY_STATUS SEC_ENTRY winpr_QuerySecurityPackageInfoA(SEC_CHAR* pszPackageName, - PSecPkgInfoA* ppPackageInfo) + PSecPkgInfoA* ppPackageInfo) { int index; size_t size; @@ -738,12 +732,13 @@ static SECURITY_STATUS SEC_ENTRY winpr_QuerySecurityPackageInfoA(SEC_CHAR* pszPa SecPkgInfoA* pPackageInfo; cPackages = sizeof(SecPkgInfoA_LIST) / sizeof(*(SecPkgInfoA_LIST)); - for (index = 0; index < (int) cPackages; index++) + for (index = 0; index < (int)cPackages; index++) { if (strcmp(pszPackageName, SecPkgInfoA_LIST[index]->Name) == 0) { size = sizeof(SecPkgInfoA); - pPackageInfo = (SecPkgInfoA*) sspi_ContextBufferAlloc(QuerySecurityPackageInfoIndex, size); + pPackageInfo = + (SecPkgInfoA*)sspi_ContextBufferAlloc(QuerySecurityPackageInfoIndex, size); if (!pPackageInfo) return SEC_E_INSUFFICIENT_MEMORY; @@ -772,7 +767,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_QuerySecurityPackageInfoA(SEC_CHAR* pszPa void FreeContextBuffer_QuerySecurityPackageInfo(void* contextBuffer) { - SecPkgInfo* pPackageInfo = (SecPkgInfo*) contextBuffer; + SecPkgInfo* pPackageInfo = (SecPkgInfo*)contextBuffer; if (!pPackageInfo) return; @@ -784,10 +779,10 @@ void FreeContextBuffer_QuerySecurityPackageInfo(void* contextBuffer) /* Credential Management */ -static SECURITY_STATUS SEC_ENTRY winpr_AcquireCredentialsHandleW(SEC_WCHAR* pszPrincipal, - SEC_WCHAR* pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, - void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY winpr_AcquireCredentialsHandleW( + SEC_WCHAR* pszPrincipal, SEC_WCHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, + void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, + PTimeStamp ptsExpiry) { SECURITY_STATUS status; SecurityFunctionTableW* table = sspi_GetSecurityFunctionTableWByNameW(pszPackage); @@ -798,22 +793,23 @@ static SECURITY_STATUS SEC_ENTRY winpr_AcquireCredentialsHandleW(SEC_WCHAR* pszP if (!table->AcquireCredentialsHandleW) return SEC_E_UNSUPPORTED_FUNCTION; - status = table->AcquireCredentialsHandleW(pszPrincipal, pszPackage, fCredentialUse, - pvLogonID, pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential, ptsExpiry); + status = table->AcquireCredentialsHandleW(pszPrincipal, pszPackage, fCredentialUse, pvLogonID, + pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential, + ptsExpiry); if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "AcquireCredentialsHandleW status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "AcquireCredentialsHandleW status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } return status; } -static SECURITY_STATUS SEC_ENTRY winpr_AcquireCredentialsHandleA(SEC_CHAR* pszPrincipal, - SEC_CHAR* pszPackage, - ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, - void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY winpr_AcquireCredentialsHandleA( + SEC_CHAR* pszPrincipal, SEC_CHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, + void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, + PTimeStamp ptsExpiry) { SECURITY_STATUS status; SecurityFunctionTableA* table = sspi_GetSecurityFunctionTableAByNameA(pszPackage); @@ -824,12 +820,13 @@ static SECURITY_STATUS SEC_ENTRY winpr_AcquireCredentialsHandleA(SEC_CHAR* pszPr if (!table->AcquireCredentialsHandleA) return SEC_E_UNSUPPORTED_FUNCTION; - status = table->AcquireCredentialsHandleA(pszPrincipal, pszPackage, fCredentialUse, - pvLogonID, pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential, ptsExpiry); + status = table->AcquireCredentialsHandleA(pszPrincipal, pszPackage, fCredentialUse, pvLogonID, + pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential, + ptsExpiry); if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "AcquireCredentialsHandleA status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "AcquireCredentialsHandleA status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -837,12 +834,13 @@ static SECURITY_STATUS SEC_ENTRY winpr_AcquireCredentialsHandleA(SEC_CHAR* pszPr } static SECURITY_STATUS SEC_ENTRY winpr_ExportSecurityContext(PCtxtHandle phContext, ULONG fFlags, - PSecBuffer pPackedContext, HANDLE* pToken) + PSecBuffer pPackedContext, + HANDLE* pToken) { SEC_CHAR* Name; SECURITY_STATUS status; SecurityFunctionTableW* table; - Name = (SEC_CHAR*) sspi_SecureHandleGetUpperPointer(phContext); + Name = (SEC_CHAR*)sspi_SecureHandleGetUpperPointer(phContext); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -859,7 +857,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_ExportSecurityContext(PCtxtHandle phConte if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "ExportSecurityContext status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "ExportSecurityContext status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -871,7 +869,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_FreeCredentialsHandle(PCredHandle phCrede char* Name; SECURITY_STATUS status; SecurityFunctionTableA* table; - Name = (char*) sspi_SecureHandleGetUpperPointer(phCredential); + Name = (char*)sspi_SecureHandleGetUpperPointer(phCredential); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -888,7 +886,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_FreeCredentialsHandle(PCredHandle phCrede if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "FreeCredentialsHandle status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "FreeCredentialsHandle status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -896,12 +894,13 @@ static SECURITY_STATUS SEC_ENTRY winpr_FreeCredentialsHandle(PCredHandle phCrede } static SECURITY_STATUS SEC_ENTRY winpr_ImportSecurityContextW(SEC_WCHAR* pszPackage, - PSecBuffer pPackedContext, HANDLE pToken, PCtxtHandle phContext) + PSecBuffer pPackedContext, + HANDLE pToken, PCtxtHandle phContext) { SEC_CHAR* Name; SECURITY_STATUS status; SecurityFunctionTableW* table; - Name = (SEC_CHAR*) sspi_SecureHandleGetUpperPointer(phContext); + Name = (SEC_CHAR*)sspi_SecureHandleGetUpperPointer(phContext); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -918,7 +917,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_ImportSecurityContextW(SEC_WCHAR* pszPack if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "ImportSecurityContextW status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "ImportSecurityContextW status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -926,12 +925,13 @@ static SECURITY_STATUS SEC_ENTRY winpr_ImportSecurityContextW(SEC_WCHAR* pszPack } static SECURITY_STATUS SEC_ENTRY winpr_ImportSecurityContextA(SEC_CHAR* pszPackage, - PSecBuffer pPackedContext, HANDLE pToken, PCtxtHandle phContext) + PSecBuffer pPackedContext, + HANDLE pToken, PCtxtHandle phContext) { char* Name = NULL; SECURITY_STATUS status; SecurityFunctionTableA* table; - Name = (char*) sspi_SecureHandleGetUpperPointer(phContext); + Name = (char*)sspi_SecureHandleGetUpperPointer(phContext); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -948,7 +948,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_ImportSecurityContextA(SEC_CHAR* pszPacka if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "ImportSecurityContextA status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "ImportSecurityContextA status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -956,12 +956,12 @@ static SECURITY_STATUS SEC_ENTRY winpr_ImportSecurityContextA(SEC_CHAR* pszPacka } static SECURITY_STATUS SEC_ENTRY winpr_QueryCredentialsAttributesW(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer) + ULONG ulAttribute, void* pBuffer) { SEC_WCHAR* Name; SECURITY_STATUS status; SecurityFunctionTableW* table; - Name = (SEC_WCHAR*) sspi_SecureHandleGetUpperPointer(phCredential); + Name = (SEC_WCHAR*)sspi_SecureHandleGetUpperPointer(phCredential); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -978,7 +978,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_QueryCredentialsAttributesW(PCredHandle p if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "QueryCredentialsAttributesW status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "QueryCredentialsAttributesW status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -986,12 +986,12 @@ static SECURITY_STATUS SEC_ENTRY winpr_QueryCredentialsAttributesW(PCredHandle p } static SECURITY_STATUS SEC_ENTRY winpr_QueryCredentialsAttributesA(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer) + ULONG ulAttribute, void* pBuffer) { char* Name; SECURITY_STATUS status; SecurityFunctionTableA* table; - Name = (char*) sspi_SecureHandleGetUpperPointer(phCredential); + Name = (char*)sspi_SecureHandleGetUpperPointer(phCredential); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -1008,7 +1008,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_QueryCredentialsAttributesA(PCredHandle p if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "QueryCredentialsAttributesA status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "QueryCredentialsAttributesA status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -1017,15 +1017,15 @@ static SECURITY_STATUS SEC_ENTRY winpr_QueryCredentialsAttributesA(PCredHandle p /* Context Management */ -static SECURITY_STATUS SEC_ENTRY winpr_AcceptSecurityContext(PCredHandle phCredential, - PCtxtHandle phContext, - PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsTimeStamp) +static SECURITY_STATUS SEC_ENTRY +winpr_AcceptSecurityContext(PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, + ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, + PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsTimeStamp) { char* Name; SECURITY_STATUS status; SecurityFunctionTableA* table; - Name = (char*) sspi_SecureHandleGetUpperPointer(phCredential); + Name = (char*)sspi_SecureHandleGetUpperPointer(phCredential); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -1038,12 +1038,13 @@ static SECURITY_STATUS SEC_ENTRY winpr_AcceptSecurityContext(PCredHandle phCrede if (!table->AcceptSecurityContext) return SEC_E_UNSUPPORTED_FUNCTION; - status = table->AcceptSecurityContext(phCredential, phContext, pInput, fContextReq, - TargetDataRep, phNewContext, pOutput, pfContextAttr, ptsTimeStamp); + status = + table->AcceptSecurityContext(phCredential, phContext, pInput, fContextReq, TargetDataRep, + phNewContext, pOutput, pfContextAttr, ptsTimeStamp); if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "AcceptSecurityContext status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "AcceptSecurityContext status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -1051,12 +1052,12 @@ static SECURITY_STATUS SEC_ENTRY winpr_AcceptSecurityContext(PCredHandle phCrede } static SECURITY_STATUS SEC_ENTRY winpr_ApplyControlToken(PCtxtHandle phContext, - PSecBufferDesc pInput) + PSecBufferDesc pInput) { char* Name = NULL; SECURITY_STATUS status; SecurityFunctionTableA* table; - Name = (char*) sspi_SecureHandleGetUpperPointer(phContext); + Name = (char*)sspi_SecureHandleGetUpperPointer(phContext); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -1073,7 +1074,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_ApplyControlToken(PCtxtHandle phContext, if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "ApplyControlToken status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "ApplyControlToken status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -1081,12 +1082,12 @@ static SECURITY_STATUS SEC_ENTRY winpr_ApplyControlToken(PCtxtHandle phContext, } static SECURITY_STATUS SEC_ENTRY winpr_CompleteAuthToken(PCtxtHandle phContext, - PSecBufferDesc pToken) + PSecBufferDesc pToken) { char* Name = NULL; SECURITY_STATUS status; SecurityFunctionTableA* table; - Name = (char*) sspi_SecureHandleGetUpperPointer(phContext); + Name = (char*)sspi_SecureHandleGetUpperPointer(phContext); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -1103,7 +1104,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_CompleteAuthToken(PCtxtHandle phContext, if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "CompleteAuthToken status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "CompleteAuthToken status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -1115,7 +1116,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_DeleteSecurityContext(PCtxtHandle phConte char* Name = NULL; SECURITY_STATUS status; SecurityFunctionTableA* table; - Name = (char*) sspi_SecureHandleGetUpperPointer(phContext); + Name = (char*)sspi_SecureHandleGetUpperPointer(phContext); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -1132,7 +1133,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_DeleteSecurityContext(PCtxtHandle phConte if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "DeleteSecurityContext status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "DeleteSecurityContext status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -1153,7 +1154,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_ImpersonateSecurityContext(PCtxtHandle ph SEC_CHAR* Name; SECURITY_STATUS status; SecurityFunctionTableW* table; - Name = (SEC_CHAR*) sspi_SecureHandleGetUpperPointer(phContext); + Name = (SEC_CHAR*)sspi_SecureHandleGetUpperPointer(phContext); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -1170,23 +1171,22 @@ static SECURITY_STATUS SEC_ENTRY winpr_ImpersonateSecurityContext(PCtxtHandle ph if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "ImpersonateSecurityContext status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "ImpersonateSecurityContext status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } return status; } -static SECURITY_STATUS SEC_ENTRY winpr_InitializeSecurityContextW(PCredHandle phCredential, - PCtxtHandle phContext, - SEC_WCHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, - PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY winpr_InitializeSecurityContextW( + PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR* pszTargetName, ULONG fContextReq, + ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, + PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) { SEC_CHAR* Name; SECURITY_STATUS status; SecurityFunctionTableW* table; - Name = (SEC_CHAR*) sspi_SecureHandleGetUpperPointer(phCredential); + Name = (SEC_CHAR*)sspi_SecureHandleGetUpperPointer(phCredential); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -1199,29 +1199,28 @@ static SECURITY_STATUS SEC_ENTRY winpr_InitializeSecurityContextW(PCredHandle ph if (!table->InitializeSecurityContextW) return SEC_E_UNSUPPORTED_FUNCTION; - status = table->InitializeSecurityContextW(phCredential, phContext, - pszTargetName, fContextReq, Reserved1, TargetDataRep, - pInput, Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry); + status = table->InitializeSecurityContextW(phCredential, phContext, pszTargetName, fContextReq, + Reserved1, TargetDataRep, pInput, Reserved2, + phNewContext, pOutput, pfContextAttr, ptsExpiry); if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "InitializeSecurityContextW status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "InitializeSecurityContextW status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } return status; } -static SECURITY_STATUS SEC_ENTRY winpr_InitializeSecurityContextA(PCredHandle phCredential, - PCtxtHandle phContext, - SEC_CHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, - PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, - PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) +static SECURITY_STATUS SEC_ENTRY winpr_InitializeSecurityContextA( + PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR* pszTargetName, ULONG fContextReq, + ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, + PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) { SEC_CHAR* Name; SECURITY_STATUS status; SecurityFunctionTableA* table; - Name = (SEC_CHAR*) sspi_SecureHandleGetUpperPointer(phCredential); + Name = (SEC_CHAR*)sspi_SecureHandleGetUpperPointer(phCredential); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -1234,13 +1233,13 @@ static SECURITY_STATUS SEC_ENTRY winpr_InitializeSecurityContextA(PCredHandle ph if (!table->InitializeSecurityContextA) return SEC_E_UNSUPPORTED_FUNCTION; - status = table->InitializeSecurityContextA(phCredential, phContext, - pszTargetName, fContextReq, Reserved1, TargetDataRep, - pInput, Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry); + status = table->InitializeSecurityContextA(phCredential, phContext, pszTargetName, fContextReq, + Reserved1, TargetDataRep, pInput, Reserved2, + phNewContext, pOutput, pfContextAttr, ptsExpiry); if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "InitializeSecurityContextA status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "InitializeSecurityContextA status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -1248,13 +1247,12 @@ static SECURITY_STATUS SEC_ENTRY winpr_InitializeSecurityContextA(PCredHandle ph } static SECURITY_STATUS SEC_ENTRY winpr_QueryContextAttributesW(PCtxtHandle phContext, - ULONG ulAttribute, - void* pBuffer) + ULONG ulAttribute, void* pBuffer) { SEC_CHAR* Name; SECURITY_STATUS status; SecurityFunctionTableW* table; - Name = (SEC_CHAR*) sspi_SecureHandleGetUpperPointer(phContext); + Name = (SEC_CHAR*)sspi_SecureHandleGetUpperPointer(phContext); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -1271,7 +1269,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_QueryContextAttributesW(PCtxtHandle phCon if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "QueryContextAttributesW status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "QueryContextAttributesW status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -1279,13 +1277,12 @@ static SECURITY_STATUS SEC_ENTRY winpr_QueryContextAttributesW(PCtxtHandle phCon } static SECURITY_STATUS SEC_ENTRY winpr_QueryContextAttributesA(PCtxtHandle phContext, - ULONG ulAttribute, - void* pBuffer) + ULONG ulAttribute, void* pBuffer) { SEC_CHAR* Name; SECURITY_STATUS status; SecurityFunctionTableA* table; - Name = (SEC_CHAR*) sspi_SecureHandleGetUpperPointer(phContext); + Name = (SEC_CHAR*)sspi_SecureHandleGetUpperPointer(phContext); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -1302,7 +1299,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_QueryContextAttributesA(PCtxtHandle phCon if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "QueryContextAttributesA status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "QueryContextAttributesA status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -1310,12 +1307,12 @@ static SECURITY_STATUS SEC_ENTRY winpr_QueryContextAttributesA(PCtxtHandle phCon } static SECURITY_STATUS SEC_ENTRY winpr_QuerySecurityContextToken(PCtxtHandle phContext, - HANDLE* phToken) + HANDLE* phToken) { SEC_CHAR* Name; SECURITY_STATUS status; SecurityFunctionTableW* table; - Name = (SEC_CHAR*) sspi_SecureHandleGetUpperPointer(phContext); + Name = (SEC_CHAR*)sspi_SecureHandleGetUpperPointer(phContext); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -1332,7 +1329,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_QuerySecurityContextToken(PCtxtHandle phC if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "QuerySecurityContextToken status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "QuerySecurityContextToken status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -1340,13 +1337,13 @@ static SECURITY_STATUS SEC_ENTRY winpr_QuerySecurityContextToken(PCtxtHandle phC } static SECURITY_STATUS SEC_ENTRY winpr_SetContextAttributesW(PCtxtHandle phContext, - ULONG ulAttribute, - void* pBuffer, ULONG cbBuffer) + ULONG ulAttribute, void* pBuffer, + ULONG cbBuffer) { SEC_CHAR* Name; SECURITY_STATUS status; SecurityFunctionTableW* table; - Name = (SEC_CHAR*) sspi_SecureHandleGetUpperPointer(phContext); + Name = (SEC_CHAR*)sspi_SecureHandleGetUpperPointer(phContext); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -1363,7 +1360,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_SetContextAttributesW(PCtxtHandle phConte if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "SetContextAttributesW status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "SetContextAttributesW status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -1371,13 +1368,13 @@ static SECURITY_STATUS SEC_ENTRY winpr_SetContextAttributesW(PCtxtHandle phConte } static SECURITY_STATUS SEC_ENTRY winpr_SetContextAttributesA(PCtxtHandle phContext, - ULONG ulAttribute, - void* pBuffer, ULONG cbBuffer) + ULONG ulAttribute, void* pBuffer, + ULONG cbBuffer) { char* Name; SECURITY_STATUS status; SecurityFunctionTableA* table; - Name = (char*) sspi_SecureHandleGetUpperPointer(phContext); + Name = (char*)sspi_SecureHandleGetUpperPointer(phContext); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -1394,7 +1391,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_SetContextAttributesA(PCtxtHandle phConte if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "SetContextAttributesA status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "SetContextAttributesA status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -1406,7 +1403,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_RevertSecurityContext(PCtxtHandle phConte SEC_CHAR* Name; SECURITY_STATUS status; SecurityFunctionTableW* table; - Name = (SEC_CHAR*) sspi_SecureHandleGetUpperPointer(phContext); + Name = (SEC_CHAR*)sspi_SecureHandleGetUpperPointer(phContext); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -1423,7 +1420,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_RevertSecurityContext(PCtxtHandle phConte if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "RevertSecurityContext status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "RevertSecurityContext status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -1433,13 +1430,13 @@ static SECURITY_STATUS SEC_ENTRY winpr_RevertSecurityContext(PCtxtHandle phConte /* Message Support */ static SECURITY_STATUS SEC_ENTRY winpr_DecryptMessage(PCtxtHandle phContext, - PSecBufferDesc pMessage, - ULONG MessageSeqNo, PULONG pfQOP) + PSecBufferDesc pMessage, ULONG MessageSeqNo, + PULONG pfQOP) { char* Name; SECURITY_STATUS status; SecurityFunctionTableA* table; - Name = (char*) sspi_SecureHandleGetUpperPointer(phContext); + Name = (char*)sspi_SecureHandleGetUpperPointer(phContext); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -1456,7 +1453,7 @@ static SECURITY_STATUS SEC_ENTRY winpr_DecryptMessage(PCtxtHandle phContext, if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "DecryptMessage status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "DecryptMessage status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } @@ -1464,12 +1461,12 @@ static SECURITY_STATUS SEC_ENTRY winpr_DecryptMessage(PCtxtHandle phContext, } static SECURITY_STATUS SEC_ENTRY winpr_EncryptMessage(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo) + PSecBufferDesc pMessage, ULONG MessageSeqNo) { char* Name; SECURITY_STATUS status; SecurityFunctionTableA* table; - Name = (char*) sspi_SecureHandleGetUpperPointer(phContext); + Name = (char*)sspi_SecureHandleGetUpperPointer(phContext); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -1486,20 +1483,20 @@ static SECURITY_STATUS SEC_ENTRY winpr_EncryptMessage(PCtxtHandle phContext, ULO if (status != SEC_E_OK) { - WLog_ERR(TAG, "EncryptMessage status %s [0x%08"PRIX32"]", - GetSecurityStatusString(status), status); + WLog_ERR(TAG, "EncryptMessage status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), + status); } return status; } static SECURITY_STATUS SEC_ENTRY winpr_MakeSignature(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo) + PSecBufferDesc pMessage, ULONG MessageSeqNo) { char* Name; SECURITY_STATUS status; SecurityFunctionTableA* table; - Name = (char*) sspi_SecureHandleGetUpperPointer(phContext); + Name = (char*)sspi_SecureHandleGetUpperPointer(phContext); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -1516,21 +1513,21 @@ static SECURITY_STATUS SEC_ENTRY winpr_MakeSignature(PCtxtHandle phContext, ULON if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "MakeSignature status %s [0x%08"PRIX32"]", - GetSecurityStatusString(status), status); + WLog_WARN(TAG, "MakeSignature status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), + status); } return status; } static SECURITY_STATUS SEC_ENTRY winpr_VerifySignature(PCtxtHandle phContext, - PSecBufferDesc pMessage, - ULONG MessageSeqNo, PULONG pfQOP) + PSecBufferDesc pMessage, ULONG MessageSeqNo, + PULONG pfQOP) { char* Name; SECURITY_STATUS status; SecurityFunctionTableA* table; - Name = (char*) sspi_SecureHandleGetUpperPointer(phContext); + Name = (char*)sspi_SecureHandleGetUpperPointer(phContext); if (!Name) return SEC_E_SECPKG_NOT_FOUND; @@ -1547,73 +1544,71 @@ static SECURITY_STATUS SEC_ENTRY winpr_VerifySignature(PCtxtHandle phContext, if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "VerifySignature status %s [0x%08"PRIX32"]", + WLog_WARN(TAG, "VerifySignature status %s [0x%08" PRIX32 "]", GetSecurityStatusString(status), status); } return status; } -static SecurityFunctionTableA winpr_SecurityFunctionTableA = -{ - 1, /* dwVersion */ - winpr_EnumerateSecurityPackagesA, /* EnumerateSecurityPackages */ +static SecurityFunctionTableA winpr_SecurityFunctionTableA = { + 1, /* dwVersion */ + winpr_EnumerateSecurityPackagesA, /* EnumerateSecurityPackages */ winpr_QueryCredentialsAttributesA, /* QueryCredentialsAttributes */ - winpr_AcquireCredentialsHandleA, /* AcquireCredentialsHandle */ - winpr_FreeCredentialsHandle, /* FreeCredentialsHandle */ - NULL, /* Reserved2 */ - winpr_InitializeSecurityContextA, /* InitializeSecurityContext */ - winpr_AcceptSecurityContext, /* AcceptSecurityContext */ - winpr_CompleteAuthToken, /* CompleteAuthToken */ - winpr_DeleteSecurityContext, /* DeleteSecurityContext */ - winpr_ApplyControlToken, /* ApplyControlToken */ - winpr_QueryContextAttributesA, /* QueryContextAttributes */ - winpr_ImpersonateSecurityContext, /* ImpersonateSecurityContext */ - winpr_RevertSecurityContext, /* RevertSecurityContext */ - winpr_MakeSignature, /* MakeSignature */ - winpr_VerifySignature, /* VerifySignature */ - winpr_FreeContextBuffer, /* FreeContextBuffer */ - winpr_QuerySecurityPackageInfoA, /* QuerySecurityPackageInfo */ - NULL, /* Reserved3 */ - NULL, /* Reserved4 */ - winpr_ExportSecurityContext, /* ExportSecurityContext */ - winpr_ImportSecurityContextA, /* ImportSecurityContext */ - NULL, /* AddCredentials */ - NULL, /* Reserved8 */ - winpr_QuerySecurityContextToken, /* QuerySecurityContextToken */ - winpr_EncryptMessage, /* EncryptMessage */ - winpr_DecryptMessage, /* DecryptMessage */ - winpr_SetContextAttributesA, /* SetContextAttributes */ + winpr_AcquireCredentialsHandleA, /* AcquireCredentialsHandle */ + winpr_FreeCredentialsHandle, /* FreeCredentialsHandle */ + NULL, /* Reserved2 */ + winpr_InitializeSecurityContextA, /* InitializeSecurityContext */ + winpr_AcceptSecurityContext, /* AcceptSecurityContext */ + winpr_CompleteAuthToken, /* CompleteAuthToken */ + winpr_DeleteSecurityContext, /* DeleteSecurityContext */ + winpr_ApplyControlToken, /* ApplyControlToken */ + winpr_QueryContextAttributesA, /* QueryContextAttributes */ + winpr_ImpersonateSecurityContext, /* ImpersonateSecurityContext */ + winpr_RevertSecurityContext, /* RevertSecurityContext */ + winpr_MakeSignature, /* MakeSignature */ + winpr_VerifySignature, /* VerifySignature */ + winpr_FreeContextBuffer, /* FreeContextBuffer */ + winpr_QuerySecurityPackageInfoA, /* QuerySecurityPackageInfo */ + NULL, /* Reserved3 */ + NULL, /* Reserved4 */ + winpr_ExportSecurityContext, /* ExportSecurityContext */ + winpr_ImportSecurityContextA, /* ImportSecurityContext */ + NULL, /* AddCredentials */ + NULL, /* Reserved8 */ + winpr_QuerySecurityContextToken, /* QuerySecurityContextToken */ + winpr_EncryptMessage, /* EncryptMessage */ + winpr_DecryptMessage, /* DecryptMessage */ + winpr_SetContextAttributesA, /* SetContextAttributes */ }; -static SecurityFunctionTableW winpr_SecurityFunctionTableW = -{ - 1, /* dwVersion */ - winpr_EnumerateSecurityPackagesW, /* EnumerateSecurityPackages */ +static SecurityFunctionTableW winpr_SecurityFunctionTableW = { + 1, /* dwVersion */ + winpr_EnumerateSecurityPackagesW, /* EnumerateSecurityPackages */ winpr_QueryCredentialsAttributesW, /* QueryCredentialsAttributes */ - winpr_AcquireCredentialsHandleW, /* AcquireCredentialsHandle */ - winpr_FreeCredentialsHandle, /* FreeCredentialsHandle */ - NULL, /* Reserved2 */ - winpr_InitializeSecurityContextW, /* InitializeSecurityContext */ - winpr_AcceptSecurityContext, /* AcceptSecurityContext */ - winpr_CompleteAuthToken, /* CompleteAuthToken */ - winpr_DeleteSecurityContext, /* DeleteSecurityContext */ - winpr_ApplyControlToken, /* ApplyControlToken */ - winpr_QueryContextAttributesW, /* QueryContextAttributes */ - winpr_ImpersonateSecurityContext, /* ImpersonateSecurityContext */ - winpr_RevertSecurityContext, /* RevertSecurityContext */ - winpr_MakeSignature, /* MakeSignature */ - winpr_VerifySignature, /* VerifySignature */ - winpr_FreeContextBuffer, /* FreeContextBuffer */ - winpr_QuerySecurityPackageInfoW, /* QuerySecurityPackageInfo */ - NULL, /* Reserved3 */ - NULL, /* Reserved4 */ - winpr_ExportSecurityContext, /* ExportSecurityContext */ - winpr_ImportSecurityContextW, /* ImportSecurityContext */ - NULL, /* AddCredentials */ - NULL, /* Reserved8 */ - winpr_QuerySecurityContextToken, /* QuerySecurityContextToken */ - winpr_EncryptMessage, /* EncryptMessage */ - winpr_DecryptMessage, /* DecryptMessage */ - winpr_SetContextAttributesW, /* SetContextAttributes */ + winpr_AcquireCredentialsHandleW, /* AcquireCredentialsHandle */ + winpr_FreeCredentialsHandle, /* FreeCredentialsHandle */ + NULL, /* Reserved2 */ + winpr_InitializeSecurityContextW, /* InitializeSecurityContext */ + winpr_AcceptSecurityContext, /* AcceptSecurityContext */ + winpr_CompleteAuthToken, /* CompleteAuthToken */ + winpr_DeleteSecurityContext, /* DeleteSecurityContext */ + winpr_ApplyControlToken, /* ApplyControlToken */ + winpr_QueryContextAttributesW, /* QueryContextAttributes */ + winpr_ImpersonateSecurityContext, /* ImpersonateSecurityContext */ + winpr_RevertSecurityContext, /* RevertSecurityContext */ + winpr_MakeSignature, /* MakeSignature */ + winpr_VerifySignature, /* VerifySignature */ + winpr_FreeContextBuffer, /* FreeContextBuffer */ + winpr_QuerySecurityPackageInfoW, /* QuerySecurityPackageInfo */ + NULL, /* Reserved3 */ + NULL, /* Reserved4 */ + winpr_ExportSecurityContext, /* ExportSecurityContext */ + winpr_ImportSecurityContextW, /* ImportSecurityContext */ + NULL, /* AddCredentials */ + NULL, /* Reserved8 */ + winpr_QuerySecurityContextToken, /* QuerySecurityContextToken */ + winpr_EncryptMessage, /* EncryptMessage */ + winpr_DecryptMessage, /* DecryptMessage */ + winpr_SetContextAttributesW, /* SetContextAttributes */ }; diff --git a/winpr/libwinpr/sspi/test/TestAcquireCredentialsHandle.c b/winpr/libwinpr/sspi/test/TestAcquireCredentialsHandle.c index 626b6a8ea..90b55421a 100644 --- a/winpr/libwinpr/sspi/test/TestAcquireCredentialsHandle.c +++ b/winpr/libwinpr/sspi/test/TestAcquireCredentialsHandle.c @@ -19,9 +19,9 @@ int TestAcquireCredentialsHandle(int argc, char* argv[]) SecPkgCredentials_Names credential_names; sspi_GlobalInit(); table = InitSecurityInterface(); - identity.User = (UINT16*) _strdup(test_User); - identity.Domain = (UINT16*) _strdup(test_Domain); - identity.Password = (UINT16*) _strdup(test_Password); + identity.User = (UINT16*)_strdup(test_User); + identity.Domain = (UINT16*)_strdup(test_Domain); + identity.Password = (UINT16*)_strdup(test_Password); if (!identity.User || !identity.Domain || !identity.Password) goto fail; @@ -30,13 +30,14 @@ int TestAcquireCredentialsHandle(int argc, char* argv[]) identity.DomainLength = strlen(test_Domain); identity.PasswordLength = strlen(test_Password); identity.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI; - status = table->AcquireCredentialsHandle(NULL, NTLM_SSP_NAME, - SECPKG_CRED_OUTBOUND, NULL, &identity, NULL, NULL, &credentials, &expiration); + status = table->AcquireCredentialsHandle(NULL, NTLM_SSP_NAME, SECPKG_CRED_OUTBOUND, NULL, + &identity, NULL, NULL, &credentials, &expiration); if (status != SEC_E_OK) goto fail; - status = table->QueryCredentialsAttributes(&credentials, SECPKG_CRED_ATTR_NAMES, &credential_names); + status = + table->QueryCredentialsAttributes(&credentials, SECPKG_CRED_ATTR_NAMES, &credential_names); if (status != SEC_E_OK) goto fail; @@ -53,4 +54,3 @@ fail: sspi_GlobalFinish(); return rc; } - diff --git a/winpr/libwinpr/sspi/test/TestEnumerateSecurityPackages.c b/winpr/libwinpr/sspi/test/TestEnumerateSecurityPackages.c index 6bf2fec68..e4ef1813b 100644 --- a/winpr/libwinpr/sspi/test/TestEnumerateSecurityPackages.c +++ b/winpr/libwinpr/sspi/test/TestEnumerateSecurityPackages.c @@ -19,12 +19,12 @@ int TestEnumerateSecurityPackages(int argc, char* argv[]) if (status != SEC_E_OK) { sspi_GlobalFinish(); - return -1; + return -1; } - _tprintf(_T("\nEnumerateSecurityPackages (%")_T(PRIu32)_T("):\n"), cPackages); + _tprintf(_T("\nEnumerateSecurityPackages (%") _T(PRIu32) _T("):\n"), cPackages); - for (index = 0; index < (int) cPackages; index++) + for (index = 0; index < (int)cPackages; index++) { _tprintf(_T("\"%s\", \"%s\"\n"), pPackageInfo[index].Name, pPackageInfo[index].Comment); } @@ -34,4 +34,3 @@ int TestEnumerateSecurityPackages(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/sspi/test/TestInitializeSecurityContext.c b/winpr/libwinpr/sspi/test/TestInitializeSecurityContext.c index 92261f43e..7465831c0 100644 --- a/winpr/libwinpr/sspi/test/TestInitializeSecurityContext.c +++ b/winpr/libwinpr/sspi/test/TestInitializeSecurityContext.c @@ -31,14 +31,14 @@ int TestInitializeSecurityContext(int argc, char* argv[]) if (status != SEC_E_OK) { - printf("QuerySecurityPackageInfo status: 0x%08"PRIX32"\n", status); + printf("QuerySecurityPackageInfo status: 0x%08" PRIX32 "\n", status); goto fail; } cbMaxLen = pPackageInfo->cbMaxToken; - identity.User = (UINT16*) _strdup(test_User); - identity.Domain = (UINT16*) _strdup(test_Domain); - identity.Password = (UINT16*) _strdup(test_Password); + identity.User = (UINT16*)_strdup(test_User); + identity.Domain = (UINT16*)_strdup(test_Domain); + identity.Password = (UINT16*)_strdup(test_Password); if (!identity.User || !identity.Domain || !identity.Password) goto fail; @@ -47,12 +47,12 @@ int TestInitializeSecurityContext(int argc, char* argv[]) identity.DomainLength = strlen(test_Domain); identity.PasswordLength = strlen(test_Password); identity.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI; - status = table->AcquireCredentialsHandle(NULL, NTLM_SSP_NAME, - SECPKG_CRED_OUTBOUND, NULL, &identity, NULL, NULL, &credentials, &expiration); + status = table->AcquireCredentialsHandle(NULL, NTLM_SSP_NAME, SECPKG_CRED_OUTBOUND, NULL, + &identity, NULL, NULL, &credentials, &expiration); if (status != SEC_E_OK) { - printf("AcquireCredentialsHandle status: 0x%08"PRIX32"\n", status); + printf("AcquireCredentialsHandle status: 0x%08" PRIX32 "\n", status); goto fail; } @@ -73,24 +73,25 @@ int TestInitializeSecurityContext(int argc, char* argv[]) output_SecBuffer.BufferType = SECBUFFER_TOKEN; output_SecBuffer.pvBuffer = output_buffer; status = table->InitializeSecurityContext(&credentials, NULL, NULL, fContextReq, 0, 0, NULL, 0, - &context, &output_SecBuffer_desc, &pfContextAttr, &expiration); + &context, &output_SecBuffer_desc, &pfContextAttr, + &expiration); if (status != SEC_I_CONTINUE_NEEDED) { - printf("InitializeSecurityContext status: 0x%08"PRIX32"\n", status); + printf("InitializeSecurityContext status: 0x%08" PRIX32 "\n", status); goto fail; } - printf("cBuffers: %"PRIu32" ulVersion: %"PRIu32"\n", output_SecBuffer_desc.cBuffers, + printf("cBuffers: %" PRIu32 " ulVersion: %" PRIu32 "\n", output_SecBuffer_desc.cBuffers, output_SecBuffer_desc.ulVersion); p_SecBuffer = &output_SecBuffer_desc.pBuffers[0]; - printf("BufferType: 0x%08"PRIX32" cbBuffer: %"PRIu32"\n", p_SecBuffer->BufferType, + printf("BufferType: 0x%08" PRIX32 " cbBuffer: %" PRIu32 "\n", p_SecBuffer->BufferType, p_SecBuffer->cbBuffer); status = table->DeleteSecurityContext(&context); if (status != SEC_E_OK) { - printf("DeleteSecurityContext status: 0x%08"PRIX32"\n", status); + printf("DeleteSecurityContext status: 0x%08" PRIX32 "\n", status); goto fail; } @@ -108,4 +109,3 @@ fail: sspi_GlobalFinish(); return rc; } - diff --git a/winpr/libwinpr/sspi/test/TestNTLM.c b/winpr/libwinpr/sspi/test/TestNTLM.c index 539d993cf..83abe70db 100644 --- a/winpr/libwinpr/sspi/test/TestNTLM.c +++ b/winpr/libwinpr/sspi/test/TestNTLM.c @@ -62,17 +62,17 @@ static const char* TEST_NTLM_USER = "Username"; static const char* TEST_NTLM_DOMAIN = "Domain"; static const char* TEST_NTLM_PASSWORD = "P4ss123!"; -//static const char* TEST_NTLM_HASH_STRING = "d5922a65c4d5c082ca444af1be0001db"; +// static const char* TEST_NTLM_HASH_STRING = "d5922a65c4d5c082ca444af1be0001db"; -static const BYTE TEST_NTLM_HASH[16] = -{ 0xd5, 0x92, 0x2a, 0x65, 0xc4, 0xd5, 0xc0, 0x82, 0xca, 0x44, 0x4a, 0xf1, 0xbe, 0x00, 0x01, 0xdb }; +static const BYTE TEST_NTLM_HASH[16] = { 0xd5, 0x92, 0x2a, 0x65, 0xc4, 0xd5, 0xc0, 0x82, + 0xca, 0x44, 0x4a, 0xf1, 0xbe, 0x00, 0x01, 0xdb }; -//static const char* TEST_NTLM_HASH_V2_STRING = "4c7f706f7dde05a9d1a0f4e7ffe3bfb8"; +// static const char* TEST_NTLM_HASH_V2_STRING = "4c7f706f7dde05a9d1a0f4e7ffe3bfb8"; -static const BYTE TEST_NTLM_V2_HASH[16] = -{ 0x4c, 0x7f, 0x70, 0x6f, 0x7d, 0xde, 0x05, 0xa9, 0xd1, 0xa0, 0xf4, 0xe7, 0xff, 0xe3, 0xbf, 0xb8 }; +static const BYTE TEST_NTLM_V2_HASH[16] = { 0x4c, 0x7f, 0x70, 0x6f, 0x7d, 0xde, 0x05, 0xa9, + 0xd1, 0xa0, 0xf4, 0xe7, 0xff, 0xe3, 0xbf, 0xb8 }; -#define NTLM_PACKAGE_NAME NTLM_SSP_NAME +#define NTLM_PACKAGE_NAME NTLM_SSP_NAME struct _TEST_NTLM_CLIENT { @@ -108,18 +108,19 @@ int test_ntlm_client_init(TEST_NTLM_CLIENT* ntlm, const char* user, const char* if (status != SEC_E_OK) { - fprintf(stderr, "QuerySecurityPackageInfo status: %s (0x%08"PRIX32")\n", + fprintf(stderr, "QuerySecurityPackageInfo status: %s (0x%08" PRIX32 ")\n", GetSecurityStatusString(status), status); return -1; } ntlm->cbMaxToken = ntlm->pPackageInfo->cbMaxToken; - status = ntlm->table->AcquireCredentialsHandle(NULL, NTLM_PACKAGE_NAME, - SECPKG_CRED_OUTBOUND, NULL, &ntlm->identity, NULL, NULL, &ntlm->credentials, &ntlm->expiration); + status = ntlm->table->AcquireCredentialsHandle(NULL, NTLM_PACKAGE_NAME, SECPKG_CRED_OUTBOUND, + NULL, &ntlm->identity, NULL, NULL, + &ntlm->credentials, &ntlm->expiration); if (status != SEC_E_OK) { - fprintf(stderr, "AcquireCredentialsHandle status: %s (0x%08"PRIX32")\n", + fprintf(stderr, "AcquireCredentialsHandle status: %s (0x%08" PRIX32 ")\n", GetSecurityStatusString(status), status); return -1; } @@ -236,13 +237,11 @@ int test_ntlm_client_authenticate(TEST_NTLM_CLIENT* ntlm) return -1; } - status = ntlm->table->InitializeSecurityContext(&ntlm->credentials, - (ntlm->haveContext) ? &ntlm->context : NULL, - (ntlm->ServicePrincipalName) ? ntlm->ServicePrincipalName : NULL, - ntlm->fContextReq, 0, SECURITY_NATIVE_DREP, - (ntlm->haveInputBuffer) ? &ntlm->inputBufferDesc : NULL, - 0, &ntlm->context, &ntlm->outputBufferDesc, - &ntlm->pfContextAttr, &ntlm->expiration); + status = ntlm->table->InitializeSecurityContext( + &ntlm->credentials, (ntlm->haveContext) ? &ntlm->context : NULL, + (ntlm->ServicePrincipalName) ? ntlm->ServicePrincipalName : NULL, ntlm->fContextReq, 0, + SECURITY_NATIVE_DREP, (ntlm->haveInputBuffer) ? &ntlm->inputBufferDesc : NULL, 0, + &ntlm->context, &ntlm->outputBufferDesc, &ntlm->pfContextAttr, &ntlm->expiration); if ((status == SEC_I_COMPLETE_AND_CONTINUE) || (status == SEC_I_COMPLETE_NEEDED)) { @@ -268,7 +267,7 @@ int test_ntlm_client_authenticate(TEST_NTLM_CLIENT* ntlm) TEST_NTLM_CLIENT* test_ntlm_client_new() { TEST_NTLM_CLIENT* ntlm; - ntlm = (TEST_NTLM_CLIENT*) calloc(1, sizeof(TEST_NTLM_CLIENT)); + ntlm = (TEST_NTLM_CLIENT*)calloc(1, sizeof(TEST_NTLM_CLIENT)); if (!ntlm) return NULL; @@ -319,19 +318,19 @@ int test_ntlm_server_init(TEST_NTLM_SERVER* ntlm) if (status != SEC_E_OK) { - fprintf(stderr, "QuerySecurityPackageInfo status: %s (0x%08"PRIX32")\n", + fprintf(stderr, "QuerySecurityPackageInfo status: %s (0x%08" PRIX32 ")\n", GetSecurityStatusString(status), status); return -1; } ntlm->cbMaxToken = ntlm->pPackageInfo->cbMaxToken; - status = ntlm->table->AcquireCredentialsHandle(NULL, NTLM_PACKAGE_NAME, - SECPKG_CRED_INBOUND, NULL, NULL, NULL, NULL, - &ntlm->credentials, &ntlm->expiration); + status = ntlm->table->AcquireCredentialsHandle(NULL, NTLM_PACKAGE_NAME, SECPKG_CRED_INBOUND, + NULL, NULL, NULL, NULL, &ntlm->credentials, + &ntlm->expiration); if (status != SEC_E_OK) { - fprintf(stderr, "AcquireCredentialsHandle status: %s (0x%08"PRIX32")\n", + fprintf(stderr, "AcquireCredentialsHandle status: %s (0x%08" PRIX32 ")\n", GetSecurityStatusString(status), status); return -1; } @@ -393,10 +392,10 @@ int test_ntlm_server_authenticate(TEST_NTLM_SERVER* ntlm) if (!ntlm->outputBuffer[0].pvBuffer) return -1; - status = ntlm->table->AcceptSecurityContext(&ntlm->credentials, - ntlm->haveContext ? &ntlm->context : NULL, - &ntlm->inputBufferDesc, ntlm->fContextReq, SECURITY_NATIVE_DREP, &ntlm->context, - &ntlm->outputBufferDesc, &ntlm->pfContextAttr, &ntlm->expiration); + status = ntlm->table->AcceptSecurityContext( + &ntlm->credentials, ntlm->haveContext ? &ntlm->context : NULL, &ntlm->inputBufferDesc, + ntlm->fContextReq, SECURITY_NATIVE_DREP, &ntlm->context, &ntlm->outputBufferDesc, + &ntlm->pfContextAttr, &ntlm->expiration); if ((status == SEC_I_COMPLETE_AND_CONTINUE) || (status == SEC_I_COMPLETE_NEEDED)) { @@ -405,7 +404,7 @@ int test_ntlm_server_authenticate(TEST_NTLM_SERVER* ntlm) ZeroMemory(&AuthIdentity, sizeof(SecPkgContext_AuthIdentity)); ZeroMemory(&AuthNtlmHash, sizeof(SecPkgContext_AuthNtlmHash)); status = ntlm->table->QueryContextAttributes(&ntlm->context, SECPKG_ATTR_AUTH_IDENTITY, - &AuthIdentity); + &AuthIdentity); if (status == SEC_E_OK) { @@ -422,8 +421,9 @@ int test_ntlm_server_authenticate(TEST_NTLM_SERVER* ntlm) CopyMemory(AuthNtlmHash.NtlmHash, TEST_NTLM_HASH, 16); } - status = ntlm->table->SetContextAttributes(&ntlm->context, - SECPKG_ATTR_AUTH_NTLM_HASH, &AuthNtlmHash, sizeof(SecPkgContext_AuthNtlmHash)); + status = ntlm->table->SetContextAttributes( + &ntlm->context, SECPKG_ATTR_AUTH_NTLM_HASH, &AuthNtlmHash, + sizeof(SecPkgContext_AuthNtlmHash)); } } @@ -438,7 +438,7 @@ int test_ntlm_server_authenticate(TEST_NTLM_SERVER* ntlm) if ((status != SEC_E_OK) && (status != SEC_I_CONTINUE_NEEDED)) { - fprintf(stderr, "AcceptSecurityContext status: %s (0x%08"PRIX32")\n", + fprintf(stderr, "AcceptSecurityContext status: %s (0x%08" PRIX32 ")\n", GetSecurityStatusString(status), status); return -1; /* Access Denied */ } @@ -450,7 +450,7 @@ int test_ntlm_server_authenticate(TEST_NTLM_SERVER* ntlm) TEST_NTLM_SERVER* test_ntlm_server_new() { TEST_NTLM_SERVER* ntlm; - ntlm = (TEST_NTLM_SERVER*) calloc(1, sizeof(TEST_NTLM_SERVER)); + ntlm = (TEST_NTLM_SERVER*)calloc(1, sizeof(TEST_NTLM_SERVER)); if (!ntlm) return NULL; @@ -531,16 +531,20 @@ int TestNTLM(int argc, char* argv[]) CopyMemory(AuthNtlmTimestamp.Timestamp, TEST_NTLM_TIMESTAMP, 8); AuthNtlmTimestamp.ChallengeOrResponse = TRUE; client->table->SetContextAttributes(&client->context, SECPKG_ATTR_AUTH_NTLM_TIMESTAMP, - &AuthNtlmTimestamp, sizeof(SecPkgContext_AuthNtlmTimestamp)); + &AuthNtlmTimestamp, + sizeof(SecPkgContext_AuthNtlmTimestamp)); AuthNtlmTimestamp.ChallengeOrResponse = FALSE; client->table->SetContextAttributes(&client->context, SECPKG_ATTR_AUTH_NTLM_TIMESTAMP, - &AuthNtlmTimestamp, sizeof(SecPkgContext_AuthNtlmTimestamp)); + &AuthNtlmTimestamp, + sizeof(SecPkgContext_AuthNtlmTimestamp)); CopyMemory(AuthNtlmClientChallenge.ClientChallenge, TEST_NTLM_CLIENT_CHALLENGE, 8); CopyMemory(AuthNtlmServerChallenge.ServerChallenge, TEST_NTLM_SERVER_CHALLENGE, 8); - client->table->SetContextAttributes(&client->context, SECPKG_ATTR_AUTH_NTLM_CLIENT_CHALLENGE, - &AuthNtlmClientChallenge, sizeof(SecPkgContext_AuthNtlmClientChallenge)); - client->table->SetContextAttributes(&client->context, SECPKG_ATTR_AUTH_NTLM_SERVER_CHALLENGE, - &AuthNtlmServerChallenge, sizeof(SecPkgContext_AuthNtlmServerChallenge)); + client->table->SetContextAttributes( + &client->context, SECPKG_ATTR_AUTH_NTLM_CLIENT_CHALLENGE, &AuthNtlmClientChallenge, + sizeof(SecPkgContext_AuthNtlmClientChallenge)); + client->table->SetContextAttributes( + &client->context, SECPKG_ATTR_AUTH_NTLM_SERVER_CHALLENGE, &AuthNtlmServerChallenge, + sizeof(SecPkgContext_AuthNtlmServerChallenge)); } pSecBuffer = &(client->outputBuffer[0]); @@ -548,7 +552,7 @@ int TestNTLM(int argc, char* argv[]) if (!DynamicTest) { pSecBuffer->cbBuffer = sizeof(TEST_NTLM_NEGOTIATE) - 1; - pSecBuffer->pvBuffer = (void*) malloc(pSecBuffer->cbBuffer); + pSecBuffer->pvBuffer = (void*)malloc(pSecBuffer->cbBuffer); if (!pSecBuffer->pvBuffer) { @@ -559,8 +563,8 @@ int TestNTLM(int argc, char* argv[]) CopyMemory(pSecBuffer->pvBuffer, TEST_NTLM_NEGOTIATE, pSecBuffer->cbBuffer); } - fprintf(stderr, "NTLM_NEGOTIATE (length = %"PRIu32"):\n", pSecBuffer->cbBuffer); - winpr_HexDump("sspi.test", WLOG_DEBUG, (BYTE*) pSecBuffer->pvBuffer, pSecBuffer->cbBuffer); + fprintf(stderr, "NTLM_NEGOTIATE (length = %" PRIu32 "):\n", pSecBuffer->cbBuffer); + winpr_HexDump("sspi.test", WLOG_DEBUG, (BYTE*)pSecBuffer->pvBuffer, pSecBuffer->cbBuffer); /** * Server <- Negotiate Message * Server -> Challenge Message @@ -585,16 +589,20 @@ int TestNTLM(int argc, char* argv[]) CopyMemory(AuthNtlmTimestamp.Timestamp, TEST_NTLM_TIMESTAMP, 8); AuthNtlmTimestamp.ChallengeOrResponse = TRUE; client->table->SetContextAttributes(&server->context, SECPKG_ATTR_AUTH_NTLM_TIMESTAMP, - &AuthNtlmTimestamp, sizeof(SecPkgContext_AuthNtlmTimestamp)); + &AuthNtlmTimestamp, + sizeof(SecPkgContext_AuthNtlmTimestamp)); AuthNtlmTimestamp.ChallengeOrResponse = FALSE; client->table->SetContextAttributes(&server->context, SECPKG_ATTR_AUTH_NTLM_TIMESTAMP, - &AuthNtlmTimestamp, sizeof(SecPkgContext_AuthNtlmTimestamp)); + &AuthNtlmTimestamp, + sizeof(SecPkgContext_AuthNtlmTimestamp)); CopyMemory(AuthNtlmClientChallenge.ClientChallenge, TEST_NTLM_CLIENT_CHALLENGE, 8); CopyMemory(AuthNtlmServerChallenge.ServerChallenge, TEST_NTLM_SERVER_CHALLENGE, 8); - server->table->SetContextAttributes(&server->context, SECPKG_ATTR_AUTH_NTLM_CLIENT_CHALLENGE, - &AuthNtlmClientChallenge, sizeof(SecPkgContext_AuthNtlmClientChallenge)); - server->table->SetContextAttributes(&server->context, SECPKG_ATTR_AUTH_NTLM_SERVER_CHALLENGE, - &AuthNtlmServerChallenge, sizeof(SecPkgContext_AuthNtlmServerChallenge)); + server->table->SetContextAttributes( + &server->context, SECPKG_ATTR_AUTH_NTLM_CLIENT_CHALLENGE, &AuthNtlmClientChallenge, + sizeof(SecPkgContext_AuthNtlmClientChallenge)); + server->table->SetContextAttributes( + &server->context, SECPKG_ATTR_AUTH_NTLM_SERVER_CHALLENGE, &AuthNtlmServerChallenge, + sizeof(SecPkgContext_AuthNtlmServerChallenge)); } pSecBuffer = &(server->outputBuffer[0]); @@ -603,7 +611,7 @@ int TestNTLM(int argc, char* argv[]) { SecPkgContext_AuthNtlmMessage AuthNtlmMessage; pSecBuffer->cbBuffer = sizeof(TEST_NTLM_CHALLENGE) - 1; - pSecBuffer->pvBuffer = (void*) malloc(pSecBuffer->cbBuffer); + pSecBuffer->pvBuffer = (void*)malloc(pSecBuffer->cbBuffer); if (!pSecBuffer->pvBuffer) { @@ -614,13 +622,14 @@ int TestNTLM(int argc, char* argv[]) CopyMemory(pSecBuffer->pvBuffer, TEST_NTLM_CHALLENGE, pSecBuffer->cbBuffer); AuthNtlmMessage.type = 2; AuthNtlmMessage.length = pSecBuffer->cbBuffer; - AuthNtlmMessage.buffer = (BYTE*) pSecBuffer->pvBuffer; + AuthNtlmMessage.buffer = (BYTE*)pSecBuffer->pvBuffer; server->table->SetContextAttributes(&server->context, SECPKG_ATTR_AUTH_NTLM_MESSAGE, - &AuthNtlmMessage, sizeof(SecPkgContext_AuthNtlmMessage)); + &AuthNtlmMessage, + sizeof(SecPkgContext_AuthNtlmMessage)); } - fprintf(stderr, "NTLM_CHALLENGE (length = %"PRIu32"):\n", pSecBuffer->cbBuffer); - winpr_HexDump("sspi.test", WLOG_DEBUG, (BYTE*) pSecBuffer->pvBuffer, pSecBuffer->cbBuffer); + fprintf(stderr, "NTLM_CHALLENGE (length = %" PRIu32 "):\n", pSecBuffer->cbBuffer); + winpr_HexDump("sspi.test", WLOG_DEBUG, (BYTE*)pSecBuffer->pvBuffer, pSecBuffer->cbBuffer); /** * Client <- Challenge Message * Client -> Authenticate Message @@ -642,7 +651,7 @@ int TestNTLM(int argc, char* argv[]) if (!DynamicTest) { pSecBuffer->cbBuffer = sizeof(TEST_NTLM_AUTHENTICATE) - 1; - pSecBuffer->pvBuffer = (void*) malloc(pSecBuffer->cbBuffer); + pSecBuffer->pvBuffer = (void*)malloc(pSecBuffer->cbBuffer); if (!pSecBuffer->pvBuffer) { @@ -653,8 +662,8 @@ int TestNTLM(int argc, char* argv[]) CopyMemory(pSecBuffer->pvBuffer, TEST_NTLM_AUTHENTICATE, pSecBuffer->cbBuffer); } - fprintf(stderr, "NTLM_AUTHENTICATE (length = %"PRIu32"):\n", pSecBuffer->cbBuffer); - winpr_HexDump("sspi.test", WLOG_DEBUG, (BYTE*) pSecBuffer->pvBuffer, pSecBuffer->cbBuffer); + fprintf(stderr, "NTLM_AUTHENTICATE (length = %" PRIu32 "):\n", pSecBuffer->cbBuffer); + winpr_HexDump("sspi.test", WLOG_DEBUG, (BYTE*)pSecBuffer->pvBuffer, pSecBuffer->cbBuffer); /** * Server <- Authenticate Message */ diff --git a/winpr/libwinpr/sspi/test/TestQuerySecurityPackageInfo.c b/winpr/libwinpr/sspi/test/TestQuerySecurityPackageInfo.c index 8f5b621c9..8467d92a1 100644 --- a/winpr/libwinpr/sspi/test/TestQuerySecurityPackageInfo.c +++ b/winpr/libwinpr/sspi/test/TestQuerySecurityPackageInfo.c @@ -25,4 +25,3 @@ int TestQuerySecurityPackageInfo(int argc, char* argv[]) sspi_GlobalFinish(); return rc; } - diff --git a/winpr/libwinpr/sspi/test/TestSchannel.c b/winpr/libwinpr/sspi/test/TestSchannel.c index 18cdde7ff..b7ead9c2a 100644 --- a/winpr/libwinpr/sspi/test/TestSchannel.c +++ b/winpr/libwinpr/sspi/test/TestSchannel.c @@ -20,214 +20,200 @@ static HANDLE g_ClientWritePipe = NULL; static HANDLE g_ServerReadPipe = NULL; static HANDLE g_ServerWritePipe = NULL; -static const BYTE test_localhost_crt[1029] = -{ - 0x2D,0x2D,0x2D,0x2D,0x2D,0x42,0x45,0x47,0x49,0x4E,0x20,0x43,0x45,0x52,0x54, - 0x49,0x46,0x49,0x43,0x41,0x54,0x45,0x2D,0x2D,0x2D,0x2D,0x2D,0x0A,0x4D,0x49, - 0x49,0x43,0x79,0x6A,0x43,0x43,0x41,0x62,0x4B,0x67,0x41,0x77,0x49,0x42,0x41, - 0x67,0x49,0x45,0x63,0x61,0x64,0x63,0x72,0x7A,0x41,0x4E,0x42,0x67,0x6B,0x71, - 0x68,0x6B,0x69,0x47,0x39,0x77,0x30,0x42,0x41,0x51,0x55,0x46,0x41,0x44,0x41, - 0x55,0x4D,0x52,0x49,0x77,0x45,0x41,0x59,0x44,0x56,0x51,0x51,0x44,0x45,0x77, - 0x6C,0x73,0x0A,0x62,0x32,0x4E,0x68,0x62,0x47,0x68,0x76,0x63,0x33,0x51,0x77, - 0x48,0x68,0x63,0x4E,0x4D,0x54,0x4D,0x78,0x4D,0x44,0x45,0x78,0x4D,0x44,0x59, - 0x78,0x4E,0x7A,0x55,0x31,0x57,0x68,0x63,0x4E,0x4D,0x54,0x51,0x78,0x4D,0x44, - 0x45,0x78,0x4D,0x44,0x59,0x78,0x4E,0x7A,0x55,0x31,0x57,0x6A,0x41,0x55,0x4D, - 0x52,0x49,0x77,0x45,0x41,0x59,0x44,0x0A,0x56,0x51,0x51,0x44,0x45,0x77,0x6C, - 0x73,0x62,0x32,0x4E,0x68,0x62,0x47,0x68,0x76,0x63,0x33,0x51,0x77,0x67,0x67, - 0x45,0x69,0x4D,0x41,0x30,0x47,0x43,0x53,0x71,0x47,0x53,0x49,0x62,0x33,0x44, - 0x51,0x45,0x42,0x41,0x51,0x55,0x41,0x41,0x34,0x49,0x42,0x44,0x77,0x41,0x77, - 0x67,0x67,0x45,0x4B,0x41,0x6F,0x49,0x42,0x41,0x51,0x43,0x33,0x0A,0x65,0x6E, - 0x33,0x68,0x5A,0x4F,0x53,0x33,0x6B,0x51,0x2F,0x55,0x54,0x30,0x53,0x45,0x6C, - 0x30,0x48,0x6E,0x50,0x79,0x64,0x48,0x75,0x35,0x39,0x61,0x69,0x71,0x64,0x73, - 0x64,0x53,0x55,0x74,0x6E,0x43,0x41,0x37,0x46,0x66,0x74,0x30,0x4F,0x36,0x51, - 0x79,0x68,0x49,0x71,0x58,0x7A,0x30,0x47,0x32,0x53,0x76,0x77,0x4C,0x54,0x62, - 0x79,0x68,0x0A,0x59,0x54,0x68,0x31,0x36,0x78,0x31,0x72,0x45,0x48,0x68,0x31, - 0x57,0x47,0x5A,0x6D,0x36,0x77,0x64,0x2B,0x4B,0x76,0x38,0x6B,0x31,0x6B,0x2F, - 0x36,0x6F,0x41,0x2F,0x4F,0x51,0x76,0x65,0x61,0x38,0x6B,0x63,0x45,0x64,0x53, - 0x72,0x54,0x64,0x75,0x71,0x4A,0x33,0x65,0x66,0x74,0x48,0x4A,0x4A,0x6E,0x43, - 0x4B,0x30,0x41,0x62,0x68,0x34,0x39,0x0A,0x41,0x47,0x41,0x50,0x39,0x79,0x58, - 0x77,0x77,0x59,0x41,0x6A,0x51,0x49,0x52,0x6E,0x38,0x2B,0x4F,0x63,0x63,0x48, - 0x74,0x6F,0x4E,0x75,0x75,0x79,0x52,0x63,0x6B,0x49,0x50,0x71,0x75,0x70,0x78, - 0x79,0x31,0x4A,0x5A,0x4B,0x39,0x64,0x76,0x76,0x62,0x34,0x79,0x53,0x6B,0x49, - 0x75,0x7A,0x62,0x79,0x50,0x6F,0x54,0x41,0x79,0x61,0x55,0x2B,0x0A,0x51,0x72, - 0x70,0x34,0x78,0x67,0x64,0x4B,0x46,0x54,0x70,0x6B,0x50,0x46,0x34,0x33,0x6A, - 0x32,0x4D,0x6D,0x5A,0x72,0x46,0x63,0x42,0x76,0x79,0x6A,0x69,0x35,0x6A,0x4F, - 0x37,0x74,0x66,0x6F,0x56,0x61,0x6B,0x59,0x47,0x53,0x2F,0x4C,0x63,0x78,0x77, - 0x47,0x2B,0x77,0x51,0x77,0x63,0x4F,0x43,0x54,0x42,0x45,0x78,0x2F,0x7A,0x31, - 0x53,0x30,0x0A,0x37,0x49,0x2F,0x6A,0x62,0x44,0x79,0x53,0x4E,0x68,0x44,0x35, - 0x63,0x61,0x63,0x54,0x75,0x4E,0x36,0x50,0x68,0x33,0x58,0x30,0x71,0x70,0x47, - 0x73,0x37,0x79,0x50,0x6B,0x4E,0x79,0x69,0x4A,0x33,0x57,0x52,0x69,0x6C,0x35, - 0x75,0x57,0x73,0x4B,0x65,0x79,0x63,0x64,0x71,0x42,0x4E,0x72,0x34,0x75,0x32, - 0x62,0x49,0x52,0x6E,0x63,0x54,0x51,0x0A,0x46,0x72,0x68,0x73,0x58,0x39,0x69, - 0x77,0x37,0x35,0x76,0x75,0x53,0x64,0x35,0x46,0x39,0x37,0x56,0x70,0x41,0x67, - 0x4D,0x42,0x41,0x41,0x47,0x6A,0x4A,0x44,0x41,0x69,0x4D,0x42,0x4D,0x47,0x41, - 0x31,0x55,0x64,0x4A,0x51,0x51,0x4D,0x4D,0x41,0x6F,0x47,0x43,0x43,0x73,0x47, - 0x41,0x51,0x55,0x46,0x42,0x77,0x4D,0x42,0x4D,0x41,0x73,0x47,0x0A,0x41,0x31, - 0x55,0x64,0x44,0x77,0x51,0x45,0x41,0x77,0x49,0x45,0x4D,0x44,0x41,0x4E,0x42, - 0x67,0x6B,0x71,0x68,0x6B,0x69,0x47,0x39,0x77,0x30,0x42,0x41,0x51,0x55,0x46, - 0x41,0x41,0x4F,0x43,0x41,0x51,0x45,0x41,0x49,0x51,0x66,0x75,0x2F,0x77,0x39, - 0x45,0x34,0x4C,0x6F,0x67,0x30,0x71,0x35,0x4B,0x53,0x38,0x71,0x46,0x78,0x62, - 0x36,0x6F,0x0A,0x36,0x31,0x62,0x35,0x37,0x6F,0x6D,0x6E,0x46,0x59,0x52,0x34, - 0x47,0x43,0x67,0x33,0x6F,0x6A,0x4F,0x4C,0x54,0x66,0x38,0x7A,0x6A,0x4D,0x43, - 0x52,0x6D,0x75,0x59,0x32,0x76,0x30,0x4E,0x34,0x78,0x66,0x68,0x69,0x35,0x4B, - 0x69,0x59,0x67,0x64,0x76,0x4E,0x4C,0x4F,0x33,0x52,0x42,0x6D,0x4E,0x50,0x76, - 0x59,0x58,0x50,0x52,0x46,0x41,0x76,0x0A,0x66,0x61,0x76,0x66,0x57,0x75,0x6C, - 0x44,0x31,0x64,0x50,0x36,0x31,0x69,0x35,0x62,0x36,0x59,0x66,0x56,0x6C,0x78, - 0x62,0x31,0x61,0x57,0x46,0x37,0x4C,0x5A,0x44,0x32,0x55,0x6E,0x63,0x41,0x6A, - 0x37,0x4E,0x38,0x78,0x38,0x2B,0x36,0x58,0x6B,0x30,0x6B,0x63,0x70,0x58,0x46, - 0x38,0x6C,0x77,0x58,0x48,0x55,0x57,0x57,0x55,0x6D,0x73,0x2B,0x0A,0x4B,0x56, - 0x44,0x34,0x34,0x39,0x68,0x6F,0x4D,0x2B,0x77,0x4E,0x4A,0x49,0x61,0x4F,0x52, - 0x39,0x4C,0x46,0x2B,0x6B,0x6F,0x32,0x32,0x37,0x7A,0x74,0x37,0x54,0x41,0x47, - 0x64,0x56,0x35,0x4A,0x75,0x7A,0x71,0x38,0x32,0x2F,0x6B,0x75,0x73,0x6F,0x65, - 0x32,0x69,0x75,0x57,0x77,0x54,0x65,0x42,0x6C,0x53,0x5A,0x6E,0x6B,0x42,0x38, - 0x63,0x64,0x0A,0x77,0x4D,0x30,0x5A,0x42,0x58,0x6D,0x34,0x35,0x48,0x38,0x6F, - 0x79,0x75,0x36,0x4A,0x71,0x59,0x71,0x45,0x6D,0x75,0x4A,0x51,0x64,0x67,0x79, - 0x52,0x2B,0x63,0x53,0x53,0x41,0x7A,0x2B,0x4F,0x32,0x6D,0x61,0x62,0x68,0x50, - 0x5A,0x65,0x49,0x76,0x78,0x65,0x67,0x6A,0x6A,0x61,0x5A,0x61,0x46,0x4F,0x71, - 0x74,0x73,0x2B,0x64,0x33,0x72,0x39,0x0A,0x79,0x71,0x4A,0x78,0x67,0x75,0x39, - 0x43,0x38,0x39,0x5A,0x69,0x33,0x39,0x57,0x34,0x38,0x46,0x66,0x46,0x63,0x49, - 0x58,0x4A,0x4F,0x6B,0x39,0x43,0x4E,0x46,0x41,0x2F,0x69,0x70,0x54,0x57,0x6A, - 0x74,0x74,0x4E,0x2F,0x6B,0x4F,0x6B,0x5A,0x42,0x70,0x6F,0x6A,0x2F,0x32,0x6A, - 0x4E,0x45,0x62,0x4F,0x59,0x7A,0x7A,0x6E,0x4B,0x77,0x3D,0x3D,0x0A,0x2D,0x2D, - 0x2D,0x2D,0x2D,0x45,0x4E,0x44,0x20,0x43,0x45,0x52,0x54,0x49,0x46,0x49,0x43, - 0x41,0x54,0x45,0x2D,0x2D,0x2D,0x2D,0x2D,0x0A +static const BYTE test_localhost_crt[1029] = { + 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x42, 0x45, 0x47, 0x49, 0x4E, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x0A, 0x4D, 0x49, 0x49, 0x43, + 0x79, 0x6A, 0x43, 0x43, 0x41, 0x62, 0x4B, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x45, + 0x63, 0x61, 0x64, 0x63, 0x72, 0x7A, 0x41, 0x4E, 0x42, 0x67, 0x6B, 0x71, 0x68, 0x6B, 0x69, 0x47, + 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x44, 0x41, 0x55, 0x4D, 0x52, 0x49, 0x77, + 0x45, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x77, 0x6C, 0x73, 0x0A, 0x62, 0x32, 0x4E, + 0x68, 0x62, 0x47, 0x68, 0x76, 0x63, 0x33, 0x51, 0x77, 0x48, 0x68, 0x63, 0x4E, 0x4D, 0x54, 0x4D, + 0x78, 0x4D, 0x44, 0x45, 0x78, 0x4D, 0x44, 0x59, 0x78, 0x4E, 0x7A, 0x55, 0x31, 0x57, 0x68, 0x63, + 0x4E, 0x4D, 0x54, 0x51, 0x78, 0x4D, 0x44, 0x45, 0x78, 0x4D, 0x44, 0x59, 0x78, 0x4E, 0x7A, 0x55, + 0x31, 0x57, 0x6A, 0x41, 0x55, 0x4D, 0x52, 0x49, 0x77, 0x45, 0x41, 0x59, 0x44, 0x0A, 0x56, 0x51, + 0x51, 0x44, 0x45, 0x77, 0x6C, 0x73, 0x62, 0x32, 0x4E, 0x68, 0x62, 0x47, 0x68, 0x76, 0x63, 0x33, + 0x51, 0x77, 0x67, 0x67, 0x45, 0x69, 0x4D, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, + 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x44, 0x77, + 0x41, 0x77, 0x67, 0x67, 0x45, 0x4B, 0x41, 0x6F, 0x49, 0x42, 0x41, 0x51, 0x43, 0x33, 0x0A, 0x65, + 0x6E, 0x33, 0x68, 0x5A, 0x4F, 0x53, 0x33, 0x6B, 0x51, 0x2F, 0x55, 0x54, 0x30, 0x53, 0x45, 0x6C, + 0x30, 0x48, 0x6E, 0x50, 0x79, 0x64, 0x48, 0x75, 0x35, 0x39, 0x61, 0x69, 0x71, 0x64, 0x73, 0x64, + 0x53, 0x55, 0x74, 0x6E, 0x43, 0x41, 0x37, 0x46, 0x66, 0x74, 0x30, 0x4F, 0x36, 0x51, 0x79, 0x68, + 0x49, 0x71, 0x58, 0x7A, 0x30, 0x47, 0x32, 0x53, 0x76, 0x77, 0x4C, 0x54, 0x62, 0x79, 0x68, 0x0A, + 0x59, 0x54, 0x68, 0x31, 0x36, 0x78, 0x31, 0x72, 0x45, 0x48, 0x68, 0x31, 0x57, 0x47, 0x5A, 0x6D, + 0x36, 0x77, 0x64, 0x2B, 0x4B, 0x76, 0x38, 0x6B, 0x31, 0x6B, 0x2F, 0x36, 0x6F, 0x41, 0x2F, 0x4F, + 0x51, 0x76, 0x65, 0x61, 0x38, 0x6B, 0x63, 0x45, 0x64, 0x53, 0x72, 0x54, 0x64, 0x75, 0x71, 0x4A, + 0x33, 0x65, 0x66, 0x74, 0x48, 0x4A, 0x4A, 0x6E, 0x43, 0x4B, 0x30, 0x41, 0x62, 0x68, 0x34, 0x39, + 0x0A, 0x41, 0x47, 0x41, 0x50, 0x39, 0x79, 0x58, 0x77, 0x77, 0x59, 0x41, 0x6A, 0x51, 0x49, 0x52, + 0x6E, 0x38, 0x2B, 0x4F, 0x63, 0x63, 0x48, 0x74, 0x6F, 0x4E, 0x75, 0x75, 0x79, 0x52, 0x63, 0x6B, + 0x49, 0x50, 0x71, 0x75, 0x70, 0x78, 0x79, 0x31, 0x4A, 0x5A, 0x4B, 0x39, 0x64, 0x76, 0x76, 0x62, + 0x34, 0x79, 0x53, 0x6B, 0x49, 0x75, 0x7A, 0x62, 0x79, 0x50, 0x6F, 0x54, 0x41, 0x79, 0x61, 0x55, + 0x2B, 0x0A, 0x51, 0x72, 0x70, 0x34, 0x78, 0x67, 0x64, 0x4B, 0x46, 0x54, 0x70, 0x6B, 0x50, 0x46, + 0x34, 0x33, 0x6A, 0x32, 0x4D, 0x6D, 0x5A, 0x72, 0x46, 0x63, 0x42, 0x76, 0x79, 0x6A, 0x69, 0x35, + 0x6A, 0x4F, 0x37, 0x74, 0x66, 0x6F, 0x56, 0x61, 0x6B, 0x59, 0x47, 0x53, 0x2F, 0x4C, 0x63, 0x78, + 0x77, 0x47, 0x2B, 0x77, 0x51, 0x77, 0x63, 0x4F, 0x43, 0x54, 0x42, 0x45, 0x78, 0x2F, 0x7A, 0x31, + 0x53, 0x30, 0x0A, 0x37, 0x49, 0x2F, 0x6A, 0x62, 0x44, 0x79, 0x53, 0x4E, 0x68, 0x44, 0x35, 0x63, + 0x61, 0x63, 0x54, 0x75, 0x4E, 0x36, 0x50, 0x68, 0x33, 0x58, 0x30, 0x71, 0x70, 0x47, 0x73, 0x37, + 0x79, 0x50, 0x6B, 0x4E, 0x79, 0x69, 0x4A, 0x33, 0x57, 0x52, 0x69, 0x6C, 0x35, 0x75, 0x57, 0x73, + 0x4B, 0x65, 0x79, 0x63, 0x64, 0x71, 0x42, 0x4E, 0x72, 0x34, 0x75, 0x32, 0x62, 0x49, 0x52, 0x6E, + 0x63, 0x54, 0x51, 0x0A, 0x46, 0x72, 0x68, 0x73, 0x58, 0x39, 0x69, 0x77, 0x37, 0x35, 0x76, 0x75, + 0x53, 0x64, 0x35, 0x46, 0x39, 0x37, 0x56, 0x70, 0x41, 0x67, 0x4D, 0x42, 0x41, 0x41, 0x47, 0x6A, + 0x4A, 0x44, 0x41, 0x69, 0x4D, 0x42, 0x4D, 0x47, 0x41, 0x31, 0x55, 0x64, 0x4A, 0x51, 0x51, 0x4D, + 0x4D, 0x41, 0x6F, 0x47, 0x43, 0x43, 0x73, 0x47, 0x41, 0x51, 0x55, 0x46, 0x42, 0x77, 0x4D, 0x42, + 0x4D, 0x41, 0x73, 0x47, 0x0A, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, + 0x45, 0x4D, 0x44, 0x41, 0x4E, 0x42, 0x67, 0x6B, 0x71, 0x68, 0x6B, 0x69, 0x47, 0x39, 0x77, 0x30, + 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x41, 0x4F, 0x43, 0x41, 0x51, 0x45, 0x41, 0x49, 0x51, 0x66, + 0x75, 0x2F, 0x77, 0x39, 0x45, 0x34, 0x4C, 0x6F, 0x67, 0x30, 0x71, 0x35, 0x4B, 0x53, 0x38, 0x71, + 0x46, 0x78, 0x62, 0x36, 0x6F, 0x0A, 0x36, 0x31, 0x62, 0x35, 0x37, 0x6F, 0x6D, 0x6E, 0x46, 0x59, + 0x52, 0x34, 0x47, 0x43, 0x67, 0x33, 0x6F, 0x6A, 0x4F, 0x4C, 0x54, 0x66, 0x38, 0x7A, 0x6A, 0x4D, + 0x43, 0x52, 0x6D, 0x75, 0x59, 0x32, 0x76, 0x30, 0x4E, 0x34, 0x78, 0x66, 0x68, 0x69, 0x35, 0x4B, + 0x69, 0x59, 0x67, 0x64, 0x76, 0x4E, 0x4C, 0x4F, 0x33, 0x52, 0x42, 0x6D, 0x4E, 0x50, 0x76, 0x59, + 0x58, 0x50, 0x52, 0x46, 0x41, 0x76, 0x0A, 0x66, 0x61, 0x76, 0x66, 0x57, 0x75, 0x6C, 0x44, 0x31, + 0x64, 0x50, 0x36, 0x31, 0x69, 0x35, 0x62, 0x36, 0x59, 0x66, 0x56, 0x6C, 0x78, 0x62, 0x31, 0x61, + 0x57, 0x46, 0x37, 0x4C, 0x5A, 0x44, 0x32, 0x55, 0x6E, 0x63, 0x41, 0x6A, 0x37, 0x4E, 0x38, 0x78, + 0x38, 0x2B, 0x36, 0x58, 0x6B, 0x30, 0x6B, 0x63, 0x70, 0x58, 0x46, 0x38, 0x6C, 0x77, 0x58, 0x48, + 0x55, 0x57, 0x57, 0x55, 0x6D, 0x73, 0x2B, 0x0A, 0x4B, 0x56, 0x44, 0x34, 0x34, 0x39, 0x68, 0x6F, + 0x4D, 0x2B, 0x77, 0x4E, 0x4A, 0x49, 0x61, 0x4F, 0x52, 0x39, 0x4C, 0x46, 0x2B, 0x6B, 0x6F, 0x32, + 0x32, 0x37, 0x7A, 0x74, 0x37, 0x54, 0x41, 0x47, 0x64, 0x56, 0x35, 0x4A, 0x75, 0x7A, 0x71, 0x38, + 0x32, 0x2F, 0x6B, 0x75, 0x73, 0x6F, 0x65, 0x32, 0x69, 0x75, 0x57, 0x77, 0x54, 0x65, 0x42, 0x6C, + 0x53, 0x5A, 0x6E, 0x6B, 0x42, 0x38, 0x63, 0x64, 0x0A, 0x77, 0x4D, 0x30, 0x5A, 0x42, 0x58, 0x6D, + 0x34, 0x35, 0x48, 0x38, 0x6F, 0x79, 0x75, 0x36, 0x4A, 0x71, 0x59, 0x71, 0x45, 0x6D, 0x75, 0x4A, + 0x51, 0x64, 0x67, 0x79, 0x52, 0x2B, 0x63, 0x53, 0x53, 0x41, 0x7A, 0x2B, 0x4F, 0x32, 0x6D, 0x61, + 0x62, 0x68, 0x50, 0x5A, 0x65, 0x49, 0x76, 0x78, 0x65, 0x67, 0x6A, 0x6A, 0x61, 0x5A, 0x61, 0x46, + 0x4F, 0x71, 0x74, 0x73, 0x2B, 0x64, 0x33, 0x72, 0x39, 0x0A, 0x79, 0x71, 0x4A, 0x78, 0x67, 0x75, + 0x39, 0x43, 0x38, 0x39, 0x5A, 0x69, 0x33, 0x39, 0x57, 0x34, 0x38, 0x46, 0x66, 0x46, 0x63, 0x49, + 0x58, 0x4A, 0x4F, 0x6B, 0x39, 0x43, 0x4E, 0x46, 0x41, 0x2F, 0x69, 0x70, 0x54, 0x57, 0x6A, 0x74, + 0x74, 0x4E, 0x2F, 0x6B, 0x4F, 0x6B, 0x5A, 0x42, 0x70, 0x6F, 0x6A, 0x2F, 0x32, 0x6A, 0x4E, 0x45, + 0x62, 0x4F, 0x59, 0x7A, 0x7A, 0x6E, 0x4B, 0x77, 0x3D, 0x3D, 0x0A, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, + 0x45, 0x4E, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2D, + 0x2D, 0x2D, 0x2D, 0x2D, 0x0A }; -static const BYTE test_localhost_key[1704] = -{ - 0x2D,0x2D,0x2D,0x2D,0x2D,0x42,0x45,0x47,0x49,0x4E,0x20,0x50,0x52,0x49,0x56, - 0x41,0x54,0x45,0x20,0x4B,0x45,0x59,0x2D,0x2D,0x2D,0x2D,0x2D,0x0A,0x4D,0x49, - 0x49,0x45,0x76,0x51,0x49,0x42,0x41,0x44,0x41,0x4E,0x42,0x67,0x6B,0x71,0x68, - 0x6B,0x69,0x47,0x39,0x77,0x30,0x42,0x41,0x51,0x45,0x46,0x41,0x41,0x53,0x43, - 0x42,0x4B,0x63,0x77,0x67,0x67,0x53,0x6A,0x41,0x67,0x45,0x41,0x41,0x6F,0x49, - 0x42,0x41,0x51,0x43,0x33,0x65,0x6E,0x33,0x68,0x5A,0x4F,0x53,0x33,0x6B,0x51, - 0x2F,0x55,0x0A,0x54,0x30,0x53,0x45,0x6C,0x30,0x48,0x6E,0x50,0x79,0x64,0x48, - 0x75,0x35,0x39,0x61,0x69,0x71,0x64,0x73,0x64,0x53,0x55,0x74,0x6E,0x43,0x41, - 0x37,0x46,0x66,0x74,0x30,0x4F,0x36,0x51,0x79,0x68,0x49,0x71,0x58,0x7A,0x30, - 0x47,0x32,0x53,0x76,0x77,0x4C,0x54,0x62,0x79,0x68,0x59,0x54,0x68,0x31,0x36, - 0x78,0x31,0x72,0x45,0x48,0x68,0x31,0x0A,0x57,0x47,0x5A,0x6D,0x36,0x77,0x64, - 0x2B,0x4B,0x76,0x38,0x6B,0x31,0x6B,0x2F,0x36,0x6F,0x41,0x2F,0x4F,0x51,0x76, - 0x65,0x61,0x38,0x6B,0x63,0x45,0x64,0x53,0x72,0x54,0x64,0x75,0x71,0x4A,0x33, - 0x65,0x66,0x74,0x48,0x4A,0x4A,0x6E,0x43,0x4B,0x30,0x41,0x62,0x68,0x34,0x39, - 0x41,0x47,0x41,0x50,0x39,0x79,0x58,0x77,0x77,0x59,0x41,0x6A,0x0A,0x51,0x49, - 0x52,0x6E,0x38,0x2B,0x4F,0x63,0x63,0x48,0x74,0x6F,0x4E,0x75,0x75,0x79,0x52, - 0x63,0x6B,0x49,0x50,0x71,0x75,0x70,0x78,0x79,0x31,0x4A,0x5A,0x4B,0x39,0x64, - 0x76,0x76,0x62,0x34,0x79,0x53,0x6B,0x49,0x75,0x7A,0x62,0x79,0x50,0x6F,0x54, - 0x41,0x79,0x61,0x55,0x2B,0x51,0x72,0x70,0x34,0x78,0x67,0x64,0x4B,0x46,0x54, - 0x70,0x6B,0x0A,0x50,0x46,0x34,0x33,0x6A,0x32,0x4D,0x6D,0x5A,0x72,0x46,0x63, - 0x42,0x76,0x79,0x6A,0x69,0x35,0x6A,0x4F,0x37,0x74,0x66,0x6F,0x56,0x61,0x6B, - 0x59,0x47,0x53,0x2F,0x4C,0x63,0x78,0x77,0x47,0x2B,0x77,0x51,0x77,0x63,0x4F, - 0x43,0x54,0x42,0x45,0x78,0x2F,0x7A,0x31,0x53,0x30,0x37,0x49,0x2F,0x6A,0x62, - 0x44,0x79,0x53,0x4E,0x68,0x44,0x35,0x0A,0x63,0x61,0x63,0x54,0x75,0x4E,0x36, - 0x50,0x68,0x33,0x58,0x30,0x71,0x70,0x47,0x73,0x37,0x79,0x50,0x6B,0x4E,0x79, - 0x69,0x4A,0x33,0x57,0x52,0x69,0x6C,0x35,0x75,0x57,0x73,0x4B,0x65,0x79,0x63, - 0x64,0x71,0x42,0x4E,0x72,0x34,0x75,0x32,0x62,0x49,0x52,0x6E,0x63,0x54,0x51, - 0x46,0x72,0x68,0x73,0x58,0x39,0x69,0x77,0x37,0x35,0x76,0x75,0x0A,0x53,0x64, - 0x35,0x46,0x39,0x37,0x56,0x70,0x41,0x67,0x4D,0x42,0x41,0x41,0x45,0x43,0x67, - 0x67,0x45,0x41,0x42,0x36,0x6A,0x6C,0x65,0x48,0x4E,0x74,0x32,0x50,0x77,0x46, - 0x58,0x53,0x65,0x79,0x42,0x4A,0x63,0x4C,0x2B,0x55,0x74,0x35,0x71,0x46,0x54, - 0x38,0x34,0x68,0x72,0x48,0x77,0x6F,0x39,0x68,0x62,0x66,0x59,0x47,0x6F,0x6E, - 0x44,0x59,0x0A,0x66,0x70,0x47,0x2B,0x32,0x52,0x30,0x50,0x62,0x43,0x63,0x4B, - 0x35,0x30,0x46,0x61,0x4A,0x46,0x36,0x71,0x63,0x56,0x4A,0x4E,0x75,0x52,0x36, - 0x48,0x71,0x2B,0x43,0x55,0x4A,0x74,0x48,0x35,0x39,0x48,0x48,0x37,0x62,0x68, - 0x6A,0x39,0x62,0x64,0x78,0x45,0x6D,0x6F,0x48,0x30,0x4A,0x76,0x68,0x45,0x76, - 0x67,0x4D,0x2F,0x55,0x38,0x42,0x51,0x0A,0x65,0x57,0x4F,0x4E,0x68,0x78,0x50, - 0x73,0x69,0x73,0x6D,0x57,0x6B,0x78,0x61,0x5A,0x6F,0x6C,0x72,0x32,0x69,0x44, - 0x56,0x72,0x7A,0x54,0x37,0x55,0x4A,0x71,0x6A,0x74,0x59,0x49,0x74,0x67,0x2B, - 0x37,0x59,0x43,0x32,0x70,0x55,0x58,0x6B,0x64,0x49,0x35,0x4A,0x4D,0x67,0x6C, - 0x44,0x47,0x4D,0x52,0x5A,0x35,0x55,0x5A,0x48,0x75,0x63,0x7A,0x0A,0x41,0x56, - 0x2B,0x71,0x77,0x77,0x33,0x65,0x45,0x52,0x74,0x78,0x44,0x50,0x61,0x61,0x61, - 0x34,0x54,0x39,0x50,0x64,0x33,0x44,0x31,0x6D,0x62,0x71,0x58,0x66,0x75,0x45, - 0x68,0x42,0x6D,0x33,0x51,0x6F,0x2B,0x75,0x7A,0x51,0x32,0x36,0x76,0x73,0x66, - 0x48,0x75,0x56,0x76,0x61,0x39,0x38,0x32,0x4F,0x6A,0x41,0x55,0x6A,0x6E,0x64, - 0x30,0x70,0x0A,0x77,0x43,0x53,0x6E,0x42,0x49,0x48,0x67,0x70,0x73,0x30,0x79, - 0x61,0x45,0x50,0x63,0x37,0x46,0x78,0x39,0x71,0x45,0x63,0x6D,0x33,0x70,0x7A, - 0x41,0x56,0x31,0x69,0x72,0x31,0x4E,0x4E,0x63,0x51,0x47,0x55,0x45,0x75,0x45, - 0x6C,0x4A,0x78,0x76,0x2B,0x69,0x57,0x34,0x6D,0x35,0x70,0x7A,0x4C,0x6A,0x64, - 0x53,0x63,0x49,0x30,0x59,0x45,0x73,0x0A,0x4D,0x61,0x33,0x78,0x32,0x79,0x48, - 0x74,0x6E,0x77,0x79,0x65,0x4C,0x4D,0x54,0x4B,0x6C,0x72,0x46,0x4B,0x70,0x55, - 0x4E,0x4A,0x62,0x78,0x73,0x35,0x32,0x62,0x5A,0x4B,0x71,0x49,0x56,0x33,0x33, - 0x4A,0x53,0x34,0x41,0x51,0x4B,0x42,0x67,0x51,0x44,0x73,0x4C,0x54,0x49,0x68, - 0x35,0x59,0x38,0x4C,0x2F,0x48,0x33,0x64,0x74,0x68,0x63,0x62,0x0A,0x53,0x43, - 0x45,0x77,0x32,0x64,0x42,0x49,0x76,0x49,0x79,0x54,0x7A,0x39,0x53,0x72,0x62, - 0x33,0x58,0x37,0x37,0x41,0x77,0x57,0x45,0x4C,0x53,0x4D,0x49,0x57,0x53,0x50, - 0x55,0x43,0x4B,0x54,0x49,0x70,0x6A,0x4D,0x73,0x6E,0x7A,0x6B,0x46,0x67,0x32, - 0x32,0x59,0x32,0x53,0x75,0x47,0x38,0x4C,0x72,0x50,0x6D,0x76,0x73,0x46,0x4A, - 0x34,0x30,0x0A,0x32,0x67,0x35,0x44,0x55,0x6C,0x59,0x33,0x59,0x6D,0x53,0x4F, - 0x46,0x61,0x45,0x4A,0x54,0x70,0x55,0x47,0x44,0x4D,0x79,0x65,0x33,0x74,0x36, - 0x4F,0x30,0x6C,0x63,0x51,0x41,0x66,0x79,0x6D,0x58,0x66,0x41,0x38,0x74,0x50, - 0x42,0x48,0x6A,0x5A,0x78,0x56,0x61,0x38,0x78,0x78,0x52,0x5A,0x6E,0x56,0x43, - 0x31,0x41,0x62,0x75,0x49,0x49,0x52,0x0A,0x6E,0x77,0x72,0x4E,0x46,0x2B,0x42, - 0x6F,0x53,0x4B,0x55,0x41,0x73,0x78,0x2B,0x46,0x75,0x35,0x5A,0x4A,0x4B,0x4F, - 0x66,0x79,0x4D,0x51,0x4B,0x42,0x67,0x51,0x44,0x47,0x34,0x50,0x52,0x39,0x2F, - 0x58,0x58,0x6B,0x51,0x54,0x36,0x6B,0x7A,0x4B,0x64,0x34,0x50,0x6C,0x50,0x4D, - 0x63,0x2B,0x4B,0x51,0x79,0x4C,0x45,0x6C,0x4B,0x39,0x71,0x47,0x0A,0x41,0x6D, - 0x6E,0x2F,0x31,0x68,0x64,0x69,0x57,0x57,0x4F,0x52,0x57,0x46,0x62,0x32,0x38, - 0x30,0x4D,0x77,0x76,0x77,0x41,0x64,0x78,0x72,0x66,0x65,0x4C,0x57,0x4D,0x57, - 0x32,0x66,0x76,0x4C,0x59,0x4B,0x66,0x6C,0x4F,0x35,0x50,0x51,0x44,0x59,0x67, - 0x4B,0x4A,0x78,0x35,0x79,0x50,0x37,0x52,0x64,0x38,0x2F,0x64,0x50,0x79,0x5A, - 0x59,0x36,0x0A,0x7A,0x56,0x37,0x47,0x47,0x6B,0x51,0x5A,0x42,0x4B,0x36,0x79, - 0x74,0x61,0x66,0x32,0x35,0x44,0x50,0x67,0x50,0x72,0x32,0x77,0x73,0x59,0x4D, - 0x43,0x6C,0x53,0x74,0x6C,0x56,0x74,0x72,0x6D,0x4F,0x78,0x59,0x55,0x56,0x77, - 0x42,0x59,0x4F,0x69,0x36,0x45,0x62,0x50,0x69,0x6B,0x78,0x47,0x48,0x5A,0x70, - 0x59,0x6F,0x5A,0x5A,0x70,0x68,0x4A,0x0A,0x4E,0x61,0x38,0x4F,0x4C,0x31,0x69, - 0x77,0x75,0x51,0x4B,0x42,0x67,0x51,0x44,0x42,0x55,0x55,0x31,0x54,0x79,0x5A, - 0x2B,0x4A,0x5A,0x43,0x64,0x79,0x72,0x33,0x58,0x43,0x63,0x77,0x77,0x58,0x2F, - 0x48,0x49,0x73,0x31,0x34,0x6B,0x4B,0x42,0x48,0x68,0x44,0x79,0x33,0x78,0x37, - 0x74,0x50,0x38,0x2F,0x6F,0x48,0x54,0x6F,0x72,0x76,0x79,0x74,0x0A,0x41,0x68, - 0x38,0x4B,0x36,0x4B,0x72,0x43,0x41,0x75,0x65,0x50,0x6D,0x79,0x32,0x6D,0x4F, - 0x54,0x31,0x54,0x39,0x6F,0x31,0x61,0x47,0x55,0x49,0x6C,0x66,0x38,0x72,0x76, - 0x33,0x2F,0x30,0x45,0x78,0x67,0x53,0x6B,0x57,0x50,0x6D,0x4F,0x41,0x38,0x35, - 0x49,0x32,0x2F,0x58,0x48,0x65,0x66,0x71,0x54,0x6F,0x45,0x48,0x30,0x44,0x65, - 0x41,0x4E,0x0A,0x7A,0x6C,0x4B,0x4C,0x71,0x79,0x44,0x56,0x30,0x42,0x56,0x4E, - 0x76,0x48,0x42,0x57,0x79,0x32,0x49,0x51,0x35,0x62,0x50,0x42,0x57,0x76,0x30, - 0x37,0x63,0x34,0x2B,0x6A,0x39,0x4E,0x62,0x57,0x67,0x64,0x44,0x43,0x43,0x35, - 0x52,0x6B,0x4F,0x6A,0x70,0x33,0x4D,0x4E,0x45,0x58,0x47,0x56,0x43,0x69,0x51, - 0x51,0x4B,0x42,0x67,0x43,0x7A,0x4D,0x0A,0x77,0x65,0x61,0x62,0x73,0x50,0x48, - 0x68,0x44,0x4B,0x5A,0x38,0x2F,0x34,0x43,0x6A,0x73,0x61,0x62,0x4E,0x75,0x41, - 0x7A,0x62,0x57,0x4B,0x52,0x42,0x38,0x37,0x44,0x61,0x58,0x46,0x78,0x6F,0x4D, - 0x73,0x35,0x52,0x79,0x6F,0x38,0x55,0x4D,0x6B,0x72,0x67,0x30,0x35,0x4C,0x6F, - 0x67,0x37,0x4D,0x78,0x62,0x33,0x76,0x61,0x42,0x34,0x63,0x2F,0x0A,0x52,0x57, - 0x77,0x7A,0x38,0x72,0x34,0x39,0x70,0x48,0x64,0x71,0x68,0x4F,0x6D,0x63,0x6C, - 0x45,0x77,0x79,0x4D,0x34,0x51,0x79,0x6A,0x39,0x52,0x6D,0x57,0x62,0x51,0x58, - 0x54,0x54,0x45,0x63,0x2B,0x35,0x67,0x54,0x4B,0x50,0x4E,0x53,0x33,0x6D,0x70, - 0x4D,0x54,0x36,0x39,0x46,0x45,0x74,0x2F,0x35,0x72,0x4D,0x52,0x70,0x4B,0x2B, - 0x52,0x68,0x0A,0x49,0x32,0x42,0x58,0x6B,0x51,0x71,0x31,0x36,0x6E,0x72,0x31, - 0x61,0x45,0x4D,0x6D,0x64,0x51,0x42,0x51,0x79,0x4B,0x59,0x4A,0x6C,0x30,0x6C, - 0x50,0x68,0x69,0x42,0x2F,0x75,0x6C,0x5A,0x63,0x72,0x67,0x4C,0x70,0x41,0x6F, - 0x47,0x41,0x65,0x30,0x65,0x74,0x50,0x4A,0x77,0x6D,0x51,0x46,0x6B,0x6A,0x4D, - 0x70,0x66,0x4D,0x44,0x61,0x4E,0x34,0x0A,0x70,0x7A,0x71,0x45,0x51,0x72,0x52, - 0x35,0x4B,0x35,0x4D,0x6E,0x54,0x48,0x76,0x47,0x67,0x2F,0x70,0x6A,0x57,0x6A, - 0x43,0x57,0x58,0x56,0x48,0x67,0x35,0x76,0x36,0x46,0x6F,0x5A,0x48,0x35,0x6E, - 0x59,0x2B,0x56,0x2F,0x57,0x75,0x57,0x38,0x38,0x6A,0x6C,0x4B,0x53,0x50,0x6C, - 0x77,0x6A,0x50,0x7A,0x41,0x67,0x7A,0x47,0x33,0x45,0x41,0x55,0x0A,0x71,0x57, - 0x6B,0x42,0x67,0x30,0x71,0x75,0x50,0x4D,0x72,0x54,0x6B,0x73,0x69,0x6E,0x58, - 0x50,0x2B,0x58,0x6B,0x51,0x65,0x46,0x66,0x58,0x61,0x33,0x38,0x6A,0x72,0x70, - 0x62,0x4B,0x46,0x4F,0x72,0x7A,0x49,0x6F,0x6A,0x69,0x65,0x6C,0x4B,0x55,0x4D, - 0x50,0x4D,0x78,0x2F,0x78,0x70,0x53,0x6A,0x63,0x55,0x42,0x68,0x62,0x4E,0x34, - 0x45,0x54,0x0A,0x4F,0x30,0x66,0x63,0x57,0x47,0x6F,0x61,0x56,0x50,0x72,0x63, - 0x6E,0x38,0x62,0x58,0x4D,0x54,0x45,0x4E,0x53,0x31,0x41,0x3D,0x0A,0x2D,0x2D, - 0x2D,0x2D,0x2D,0x45,0x4E,0x44,0x20,0x50,0x52,0x49,0x56,0x41,0x54,0x45,0x20, - 0x4B,0x45,0x59,0x2D,0x2D,0x2D,0x2D,0x2D,0x0A +static const BYTE test_localhost_key[1704] = { + 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x42, 0x45, 0x47, 0x49, 0x4E, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, + 0x54, 0x45, 0x20, 0x4B, 0x45, 0x59, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x0A, 0x4D, 0x49, 0x49, 0x45, + 0x76, 0x51, 0x49, 0x42, 0x41, 0x44, 0x41, 0x4E, 0x42, 0x67, 0x6B, 0x71, 0x68, 0x6B, 0x69, 0x47, + 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x53, 0x43, 0x42, 0x4B, 0x63, 0x77, + 0x67, 0x67, 0x53, 0x6A, 0x41, 0x67, 0x45, 0x41, 0x41, 0x6F, 0x49, 0x42, 0x41, 0x51, 0x43, 0x33, + 0x65, 0x6E, 0x33, 0x68, 0x5A, 0x4F, 0x53, 0x33, 0x6B, 0x51, 0x2F, 0x55, 0x0A, 0x54, 0x30, 0x53, + 0x45, 0x6C, 0x30, 0x48, 0x6E, 0x50, 0x79, 0x64, 0x48, 0x75, 0x35, 0x39, 0x61, 0x69, 0x71, 0x64, + 0x73, 0x64, 0x53, 0x55, 0x74, 0x6E, 0x43, 0x41, 0x37, 0x46, 0x66, 0x74, 0x30, 0x4F, 0x36, 0x51, + 0x79, 0x68, 0x49, 0x71, 0x58, 0x7A, 0x30, 0x47, 0x32, 0x53, 0x76, 0x77, 0x4C, 0x54, 0x62, 0x79, + 0x68, 0x59, 0x54, 0x68, 0x31, 0x36, 0x78, 0x31, 0x72, 0x45, 0x48, 0x68, 0x31, 0x0A, 0x57, 0x47, + 0x5A, 0x6D, 0x36, 0x77, 0x64, 0x2B, 0x4B, 0x76, 0x38, 0x6B, 0x31, 0x6B, 0x2F, 0x36, 0x6F, 0x41, + 0x2F, 0x4F, 0x51, 0x76, 0x65, 0x61, 0x38, 0x6B, 0x63, 0x45, 0x64, 0x53, 0x72, 0x54, 0x64, 0x75, + 0x71, 0x4A, 0x33, 0x65, 0x66, 0x74, 0x48, 0x4A, 0x4A, 0x6E, 0x43, 0x4B, 0x30, 0x41, 0x62, 0x68, + 0x34, 0x39, 0x41, 0x47, 0x41, 0x50, 0x39, 0x79, 0x58, 0x77, 0x77, 0x59, 0x41, 0x6A, 0x0A, 0x51, + 0x49, 0x52, 0x6E, 0x38, 0x2B, 0x4F, 0x63, 0x63, 0x48, 0x74, 0x6F, 0x4E, 0x75, 0x75, 0x79, 0x52, + 0x63, 0x6B, 0x49, 0x50, 0x71, 0x75, 0x70, 0x78, 0x79, 0x31, 0x4A, 0x5A, 0x4B, 0x39, 0x64, 0x76, + 0x76, 0x62, 0x34, 0x79, 0x53, 0x6B, 0x49, 0x75, 0x7A, 0x62, 0x79, 0x50, 0x6F, 0x54, 0x41, 0x79, + 0x61, 0x55, 0x2B, 0x51, 0x72, 0x70, 0x34, 0x78, 0x67, 0x64, 0x4B, 0x46, 0x54, 0x70, 0x6B, 0x0A, + 0x50, 0x46, 0x34, 0x33, 0x6A, 0x32, 0x4D, 0x6D, 0x5A, 0x72, 0x46, 0x63, 0x42, 0x76, 0x79, 0x6A, + 0x69, 0x35, 0x6A, 0x4F, 0x37, 0x74, 0x66, 0x6F, 0x56, 0x61, 0x6B, 0x59, 0x47, 0x53, 0x2F, 0x4C, + 0x63, 0x78, 0x77, 0x47, 0x2B, 0x77, 0x51, 0x77, 0x63, 0x4F, 0x43, 0x54, 0x42, 0x45, 0x78, 0x2F, + 0x7A, 0x31, 0x53, 0x30, 0x37, 0x49, 0x2F, 0x6A, 0x62, 0x44, 0x79, 0x53, 0x4E, 0x68, 0x44, 0x35, + 0x0A, 0x63, 0x61, 0x63, 0x54, 0x75, 0x4E, 0x36, 0x50, 0x68, 0x33, 0x58, 0x30, 0x71, 0x70, 0x47, + 0x73, 0x37, 0x79, 0x50, 0x6B, 0x4E, 0x79, 0x69, 0x4A, 0x33, 0x57, 0x52, 0x69, 0x6C, 0x35, 0x75, + 0x57, 0x73, 0x4B, 0x65, 0x79, 0x63, 0x64, 0x71, 0x42, 0x4E, 0x72, 0x34, 0x75, 0x32, 0x62, 0x49, + 0x52, 0x6E, 0x63, 0x54, 0x51, 0x46, 0x72, 0x68, 0x73, 0x58, 0x39, 0x69, 0x77, 0x37, 0x35, 0x76, + 0x75, 0x0A, 0x53, 0x64, 0x35, 0x46, 0x39, 0x37, 0x56, 0x70, 0x41, 0x67, 0x4D, 0x42, 0x41, 0x41, + 0x45, 0x43, 0x67, 0x67, 0x45, 0x41, 0x42, 0x36, 0x6A, 0x6C, 0x65, 0x48, 0x4E, 0x74, 0x32, 0x50, + 0x77, 0x46, 0x58, 0x53, 0x65, 0x79, 0x42, 0x4A, 0x63, 0x4C, 0x2B, 0x55, 0x74, 0x35, 0x71, 0x46, + 0x54, 0x38, 0x34, 0x68, 0x72, 0x48, 0x77, 0x6F, 0x39, 0x68, 0x62, 0x66, 0x59, 0x47, 0x6F, 0x6E, + 0x44, 0x59, 0x0A, 0x66, 0x70, 0x47, 0x2B, 0x32, 0x52, 0x30, 0x50, 0x62, 0x43, 0x63, 0x4B, 0x35, + 0x30, 0x46, 0x61, 0x4A, 0x46, 0x36, 0x71, 0x63, 0x56, 0x4A, 0x4E, 0x75, 0x52, 0x36, 0x48, 0x71, + 0x2B, 0x43, 0x55, 0x4A, 0x74, 0x48, 0x35, 0x39, 0x48, 0x48, 0x37, 0x62, 0x68, 0x6A, 0x39, 0x62, + 0x64, 0x78, 0x45, 0x6D, 0x6F, 0x48, 0x30, 0x4A, 0x76, 0x68, 0x45, 0x76, 0x67, 0x4D, 0x2F, 0x55, + 0x38, 0x42, 0x51, 0x0A, 0x65, 0x57, 0x4F, 0x4E, 0x68, 0x78, 0x50, 0x73, 0x69, 0x73, 0x6D, 0x57, + 0x6B, 0x78, 0x61, 0x5A, 0x6F, 0x6C, 0x72, 0x32, 0x69, 0x44, 0x56, 0x72, 0x7A, 0x54, 0x37, 0x55, + 0x4A, 0x71, 0x6A, 0x74, 0x59, 0x49, 0x74, 0x67, 0x2B, 0x37, 0x59, 0x43, 0x32, 0x70, 0x55, 0x58, + 0x6B, 0x64, 0x49, 0x35, 0x4A, 0x4D, 0x67, 0x6C, 0x44, 0x47, 0x4D, 0x52, 0x5A, 0x35, 0x55, 0x5A, + 0x48, 0x75, 0x63, 0x7A, 0x0A, 0x41, 0x56, 0x2B, 0x71, 0x77, 0x77, 0x33, 0x65, 0x45, 0x52, 0x74, + 0x78, 0x44, 0x50, 0x61, 0x61, 0x61, 0x34, 0x54, 0x39, 0x50, 0x64, 0x33, 0x44, 0x31, 0x6D, 0x62, + 0x71, 0x58, 0x66, 0x75, 0x45, 0x68, 0x42, 0x6D, 0x33, 0x51, 0x6F, 0x2B, 0x75, 0x7A, 0x51, 0x32, + 0x36, 0x76, 0x73, 0x66, 0x48, 0x75, 0x56, 0x76, 0x61, 0x39, 0x38, 0x32, 0x4F, 0x6A, 0x41, 0x55, + 0x6A, 0x6E, 0x64, 0x30, 0x70, 0x0A, 0x77, 0x43, 0x53, 0x6E, 0x42, 0x49, 0x48, 0x67, 0x70, 0x73, + 0x30, 0x79, 0x61, 0x45, 0x50, 0x63, 0x37, 0x46, 0x78, 0x39, 0x71, 0x45, 0x63, 0x6D, 0x33, 0x70, + 0x7A, 0x41, 0x56, 0x31, 0x69, 0x72, 0x31, 0x4E, 0x4E, 0x63, 0x51, 0x47, 0x55, 0x45, 0x75, 0x45, + 0x6C, 0x4A, 0x78, 0x76, 0x2B, 0x69, 0x57, 0x34, 0x6D, 0x35, 0x70, 0x7A, 0x4C, 0x6A, 0x64, 0x53, + 0x63, 0x49, 0x30, 0x59, 0x45, 0x73, 0x0A, 0x4D, 0x61, 0x33, 0x78, 0x32, 0x79, 0x48, 0x74, 0x6E, + 0x77, 0x79, 0x65, 0x4C, 0x4D, 0x54, 0x4B, 0x6C, 0x72, 0x46, 0x4B, 0x70, 0x55, 0x4E, 0x4A, 0x62, + 0x78, 0x73, 0x35, 0x32, 0x62, 0x5A, 0x4B, 0x71, 0x49, 0x56, 0x33, 0x33, 0x4A, 0x53, 0x34, 0x41, + 0x51, 0x4B, 0x42, 0x67, 0x51, 0x44, 0x73, 0x4C, 0x54, 0x49, 0x68, 0x35, 0x59, 0x38, 0x4C, 0x2F, + 0x48, 0x33, 0x64, 0x74, 0x68, 0x63, 0x62, 0x0A, 0x53, 0x43, 0x45, 0x77, 0x32, 0x64, 0x42, 0x49, + 0x76, 0x49, 0x79, 0x54, 0x7A, 0x39, 0x53, 0x72, 0x62, 0x33, 0x58, 0x37, 0x37, 0x41, 0x77, 0x57, + 0x45, 0x4C, 0x53, 0x4D, 0x49, 0x57, 0x53, 0x50, 0x55, 0x43, 0x4B, 0x54, 0x49, 0x70, 0x6A, 0x4D, + 0x73, 0x6E, 0x7A, 0x6B, 0x46, 0x67, 0x32, 0x32, 0x59, 0x32, 0x53, 0x75, 0x47, 0x38, 0x4C, 0x72, + 0x50, 0x6D, 0x76, 0x73, 0x46, 0x4A, 0x34, 0x30, 0x0A, 0x32, 0x67, 0x35, 0x44, 0x55, 0x6C, 0x59, + 0x33, 0x59, 0x6D, 0x53, 0x4F, 0x46, 0x61, 0x45, 0x4A, 0x54, 0x70, 0x55, 0x47, 0x44, 0x4D, 0x79, + 0x65, 0x33, 0x74, 0x36, 0x4F, 0x30, 0x6C, 0x63, 0x51, 0x41, 0x66, 0x79, 0x6D, 0x58, 0x66, 0x41, + 0x38, 0x74, 0x50, 0x42, 0x48, 0x6A, 0x5A, 0x78, 0x56, 0x61, 0x38, 0x78, 0x78, 0x52, 0x5A, 0x6E, + 0x56, 0x43, 0x31, 0x41, 0x62, 0x75, 0x49, 0x49, 0x52, 0x0A, 0x6E, 0x77, 0x72, 0x4E, 0x46, 0x2B, + 0x42, 0x6F, 0x53, 0x4B, 0x55, 0x41, 0x73, 0x78, 0x2B, 0x46, 0x75, 0x35, 0x5A, 0x4A, 0x4B, 0x4F, + 0x66, 0x79, 0x4D, 0x51, 0x4B, 0x42, 0x67, 0x51, 0x44, 0x47, 0x34, 0x50, 0x52, 0x39, 0x2F, 0x58, + 0x58, 0x6B, 0x51, 0x54, 0x36, 0x6B, 0x7A, 0x4B, 0x64, 0x34, 0x50, 0x6C, 0x50, 0x4D, 0x63, 0x2B, + 0x4B, 0x51, 0x79, 0x4C, 0x45, 0x6C, 0x4B, 0x39, 0x71, 0x47, 0x0A, 0x41, 0x6D, 0x6E, 0x2F, 0x31, + 0x68, 0x64, 0x69, 0x57, 0x57, 0x4F, 0x52, 0x57, 0x46, 0x62, 0x32, 0x38, 0x30, 0x4D, 0x77, 0x76, + 0x77, 0x41, 0x64, 0x78, 0x72, 0x66, 0x65, 0x4C, 0x57, 0x4D, 0x57, 0x32, 0x66, 0x76, 0x4C, 0x59, + 0x4B, 0x66, 0x6C, 0x4F, 0x35, 0x50, 0x51, 0x44, 0x59, 0x67, 0x4B, 0x4A, 0x78, 0x35, 0x79, 0x50, + 0x37, 0x52, 0x64, 0x38, 0x2F, 0x64, 0x50, 0x79, 0x5A, 0x59, 0x36, 0x0A, 0x7A, 0x56, 0x37, 0x47, + 0x47, 0x6B, 0x51, 0x5A, 0x42, 0x4B, 0x36, 0x79, 0x74, 0x61, 0x66, 0x32, 0x35, 0x44, 0x50, 0x67, + 0x50, 0x72, 0x32, 0x77, 0x73, 0x59, 0x4D, 0x43, 0x6C, 0x53, 0x74, 0x6C, 0x56, 0x74, 0x72, 0x6D, + 0x4F, 0x78, 0x59, 0x55, 0x56, 0x77, 0x42, 0x59, 0x4F, 0x69, 0x36, 0x45, 0x62, 0x50, 0x69, 0x6B, + 0x78, 0x47, 0x48, 0x5A, 0x70, 0x59, 0x6F, 0x5A, 0x5A, 0x70, 0x68, 0x4A, 0x0A, 0x4E, 0x61, 0x38, + 0x4F, 0x4C, 0x31, 0x69, 0x77, 0x75, 0x51, 0x4B, 0x42, 0x67, 0x51, 0x44, 0x42, 0x55, 0x55, 0x31, + 0x54, 0x79, 0x5A, 0x2B, 0x4A, 0x5A, 0x43, 0x64, 0x79, 0x72, 0x33, 0x58, 0x43, 0x63, 0x77, 0x77, + 0x58, 0x2F, 0x48, 0x49, 0x73, 0x31, 0x34, 0x6B, 0x4B, 0x42, 0x48, 0x68, 0x44, 0x79, 0x33, 0x78, + 0x37, 0x74, 0x50, 0x38, 0x2F, 0x6F, 0x48, 0x54, 0x6F, 0x72, 0x76, 0x79, 0x74, 0x0A, 0x41, 0x68, + 0x38, 0x4B, 0x36, 0x4B, 0x72, 0x43, 0x41, 0x75, 0x65, 0x50, 0x6D, 0x79, 0x32, 0x6D, 0x4F, 0x54, + 0x31, 0x54, 0x39, 0x6F, 0x31, 0x61, 0x47, 0x55, 0x49, 0x6C, 0x66, 0x38, 0x72, 0x76, 0x33, 0x2F, + 0x30, 0x45, 0x78, 0x67, 0x53, 0x6B, 0x57, 0x50, 0x6D, 0x4F, 0x41, 0x38, 0x35, 0x49, 0x32, 0x2F, + 0x58, 0x48, 0x65, 0x66, 0x71, 0x54, 0x6F, 0x45, 0x48, 0x30, 0x44, 0x65, 0x41, 0x4E, 0x0A, 0x7A, + 0x6C, 0x4B, 0x4C, 0x71, 0x79, 0x44, 0x56, 0x30, 0x42, 0x56, 0x4E, 0x76, 0x48, 0x42, 0x57, 0x79, + 0x32, 0x49, 0x51, 0x35, 0x62, 0x50, 0x42, 0x57, 0x76, 0x30, 0x37, 0x63, 0x34, 0x2B, 0x6A, 0x39, + 0x4E, 0x62, 0x57, 0x67, 0x64, 0x44, 0x43, 0x43, 0x35, 0x52, 0x6B, 0x4F, 0x6A, 0x70, 0x33, 0x4D, + 0x4E, 0x45, 0x58, 0x47, 0x56, 0x43, 0x69, 0x51, 0x51, 0x4B, 0x42, 0x67, 0x43, 0x7A, 0x4D, 0x0A, + 0x77, 0x65, 0x61, 0x62, 0x73, 0x50, 0x48, 0x68, 0x44, 0x4B, 0x5A, 0x38, 0x2F, 0x34, 0x43, 0x6A, + 0x73, 0x61, 0x62, 0x4E, 0x75, 0x41, 0x7A, 0x62, 0x57, 0x4B, 0x52, 0x42, 0x38, 0x37, 0x44, 0x61, + 0x58, 0x46, 0x78, 0x6F, 0x4D, 0x73, 0x35, 0x52, 0x79, 0x6F, 0x38, 0x55, 0x4D, 0x6B, 0x72, 0x67, + 0x30, 0x35, 0x4C, 0x6F, 0x67, 0x37, 0x4D, 0x78, 0x62, 0x33, 0x76, 0x61, 0x42, 0x34, 0x63, 0x2F, + 0x0A, 0x52, 0x57, 0x77, 0x7A, 0x38, 0x72, 0x34, 0x39, 0x70, 0x48, 0x64, 0x71, 0x68, 0x4F, 0x6D, + 0x63, 0x6C, 0x45, 0x77, 0x79, 0x4D, 0x34, 0x51, 0x79, 0x6A, 0x39, 0x52, 0x6D, 0x57, 0x62, 0x51, + 0x58, 0x54, 0x54, 0x45, 0x63, 0x2B, 0x35, 0x67, 0x54, 0x4B, 0x50, 0x4E, 0x53, 0x33, 0x6D, 0x70, + 0x4D, 0x54, 0x36, 0x39, 0x46, 0x45, 0x74, 0x2F, 0x35, 0x72, 0x4D, 0x52, 0x70, 0x4B, 0x2B, 0x52, + 0x68, 0x0A, 0x49, 0x32, 0x42, 0x58, 0x6B, 0x51, 0x71, 0x31, 0x36, 0x6E, 0x72, 0x31, 0x61, 0x45, + 0x4D, 0x6D, 0x64, 0x51, 0x42, 0x51, 0x79, 0x4B, 0x59, 0x4A, 0x6C, 0x30, 0x6C, 0x50, 0x68, 0x69, + 0x42, 0x2F, 0x75, 0x6C, 0x5A, 0x63, 0x72, 0x67, 0x4C, 0x70, 0x41, 0x6F, 0x47, 0x41, 0x65, 0x30, + 0x65, 0x74, 0x50, 0x4A, 0x77, 0x6D, 0x51, 0x46, 0x6B, 0x6A, 0x4D, 0x70, 0x66, 0x4D, 0x44, 0x61, + 0x4E, 0x34, 0x0A, 0x70, 0x7A, 0x71, 0x45, 0x51, 0x72, 0x52, 0x35, 0x4B, 0x35, 0x4D, 0x6E, 0x54, + 0x48, 0x76, 0x47, 0x67, 0x2F, 0x70, 0x6A, 0x57, 0x6A, 0x43, 0x57, 0x58, 0x56, 0x48, 0x67, 0x35, + 0x76, 0x36, 0x46, 0x6F, 0x5A, 0x48, 0x35, 0x6E, 0x59, 0x2B, 0x56, 0x2F, 0x57, 0x75, 0x57, 0x38, + 0x38, 0x6A, 0x6C, 0x4B, 0x53, 0x50, 0x6C, 0x77, 0x6A, 0x50, 0x7A, 0x41, 0x67, 0x7A, 0x47, 0x33, + 0x45, 0x41, 0x55, 0x0A, 0x71, 0x57, 0x6B, 0x42, 0x67, 0x30, 0x71, 0x75, 0x50, 0x4D, 0x72, 0x54, + 0x6B, 0x73, 0x69, 0x6E, 0x58, 0x50, 0x2B, 0x58, 0x6B, 0x51, 0x65, 0x46, 0x66, 0x58, 0x61, 0x33, + 0x38, 0x6A, 0x72, 0x70, 0x62, 0x4B, 0x46, 0x4F, 0x72, 0x7A, 0x49, 0x6F, 0x6A, 0x69, 0x65, 0x6C, + 0x4B, 0x55, 0x4D, 0x50, 0x4D, 0x78, 0x2F, 0x78, 0x70, 0x53, 0x6A, 0x63, 0x55, 0x42, 0x68, 0x62, + 0x4E, 0x34, 0x45, 0x54, 0x0A, 0x4F, 0x30, 0x66, 0x63, 0x57, 0x47, 0x6F, 0x61, 0x56, 0x50, 0x72, + 0x63, 0x6E, 0x38, 0x62, 0x58, 0x4D, 0x54, 0x45, 0x4E, 0x53, 0x31, 0x41, 0x3D, 0x0A, 0x2D, 0x2D, + 0x2D, 0x2D, 0x2D, 0x45, 0x4E, 0x44, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4B, + 0x45, 0x59, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x0A }; -static const BYTE test_DummyMessage[64] = -{ +static const BYTE test_DummyMessage[64] = { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD }; -static const BYTE test_LastDummyMessage[64] = -{ +static const BYTE test_LastDummyMessage[64] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static int schannel_send(PSecurityFunctionTable table, HANDLE hPipe, PCtxtHandle phContext, BYTE* buffer, UINT32 length) +static int schannel_send(PSecurityFunctionTable table, HANDLE hPipe, PCtxtHandle phContext, + BYTE* buffer, UINT32 length) { BYTE* ioBuffer; UINT32 ioBufferLength; @@ -240,7 +226,7 @@ static int schannel_send(PSecurityFunctionTable table, HANDLE hPipe, PCtxtHandle ZeroMemory(&StreamSizes, sizeof(SecPkgContext_StreamSizes)); status = table->QueryContextAttributes(phContext, SECPKG_ATTR_STREAM_SIZES, &StreamSizes); ioBufferLength = StreamSizes.cbHeader + StreamSizes.cbMaximumMessage + StreamSizes.cbTrailer; - ioBuffer = (BYTE*) calloc(1, ioBufferLength); + ioBuffer = (BYTE*)calloc(1, ioBufferLength); if (!ioBuffer) return -1; pMessageBuffer = ioBuffer + StreamSizes.cbHeader; @@ -260,19 +246,22 @@ static int schannel_send(PSecurityFunctionTable table, HANDLE hPipe, PCtxtHandle Message.ulVersion = SECBUFFER_VERSION; Message.cBuffers = 4; Message.pBuffers = Buffers; - ioBufferLength = Message.pBuffers[0].cbBuffer + Message.pBuffers[1].cbBuffer + Message.pBuffers[2].cbBuffer; + ioBufferLength = + Message.pBuffers[0].cbBuffer + Message.pBuffers[1].cbBuffer + Message.pBuffers[2].cbBuffer; status = table->EncryptMessage(phContext, 0, &Message, 0); - printf("EncryptMessage status: 0x%08"PRIX32"\n", status); - printf("EncryptMessage output: cBuffers: %"PRIu32" [0]: %"PRIu32" / %"PRIu32" [1]: %"PRIu32" / %"PRIu32" [2]: %"PRIu32" / %"PRIu32" [3]: %"PRIu32" / %"PRIu32"\n", Message.cBuffers, - Message.pBuffers[0].cbBuffer, Message.pBuffers[0].BufferType, - Message.pBuffers[1].cbBuffer, Message.pBuffers[1].BufferType, - Message.pBuffers[2].cbBuffer, Message.pBuffers[2].BufferType, - Message.pBuffers[3].cbBuffer, Message.pBuffers[3].BufferType); + printf("EncryptMessage status: 0x%08" PRIX32 "\n", status); + printf("EncryptMessage output: cBuffers: %" PRIu32 " [0]: %" PRIu32 " / %" PRIu32 + " [1]: %" PRIu32 " / %" PRIu32 " [2]: %" PRIu32 " / %" PRIu32 " [3]: %" PRIu32 + " / %" PRIu32 "\n", + Message.cBuffers, Message.pBuffers[0].cbBuffer, Message.pBuffers[0].BufferType, + Message.pBuffers[1].cbBuffer, Message.pBuffers[1].BufferType, + Message.pBuffers[2].cbBuffer, Message.pBuffers[2].BufferType, + Message.pBuffers[3].cbBuffer, Message.pBuffers[3].BufferType); if (status != SEC_E_OK) return -1; - printf("Client > Server (%"PRIu32")\n", ioBufferLength); + printf("Client > Server (%" PRIu32 ")\n", ioBufferLength); winpr_HexDump("sspi.test", WLOG_DEBUG, ioBuffer, ioBufferLength); if (!WriteFile(hPipe, ioBuffer, ioBufferLength, &NumberOfBytesWritten, NULL)) @@ -288,7 +277,7 @@ static int schannel_recv(PSecurityFunctionTable table, HANDLE hPipe, PCtxtHandle { BYTE* ioBuffer; UINT32 ioBufferLength; - //BYTE* pMessageBuffer; + // BYTE* pMessageBuffer; SecBuffer Buffers[4]; SecBufferDesc Message; SECURITY_STATUS status; @@ -297,7 +286,7 @@ static int schannel_recv(PSecurityFunctionTable table, HANDLE hPipe, PCtxtHandle ZeroMemory(&StreamSizes, sizeof(SecPkgContext_StreamSizes)); status = table->QueryContextAttributes(phContext, SECPKG_ATTR_STREAM_SIZES, &StreamSizes); ioBufferLength = StreamSizes.cbHeader + StreamSizes.cbMaximumMessage + StreamSizes.cbTrailer; - ioBuffer = (BYTE*) calloc(1, ioBufferLength); + ioBuffer = (BYTE*)calloc(1, ioBufferLength); if (!ioBuffer) return -1; @@ -323,20 +312,24 @@ static int schannel_recv(PSecurityFunctionTable table, HANDLE hPipe, PCtxtHandle Message.cBuffers = 4; Message.pBuffers = Buffers; status = table->DecryptMessage(phContext, &Message, 0, NULL); - printf("DecryptMessage status: 0x%08"PRIX32"\n", status); - printf("DecryptMessage output: cBuffers: %"PRIu32" [0]: %"PRIu32" / %"PRIu32" [1]: %"PRIu32" / %"PRIu32" [2]: %"PRIu32" / %"PRIu32" [3]: %"PRIu32" / %"PRIu32"\n", Message.cBuffers, - Message.pBuffers[0].cbBuffer, Message.pBuffers[0].BufferType, - Message.pBuffers[1].cbBuffer, Message.pBuffers[1].BufferType, - Message.pBuffers[2].cbBuffer, Message.pBuffers[2].BufferType, - Message.pBuffers[3].cbBuffer, Message.pBuffers[3].BufferType); + printf("DecryptMessage status: 0x%08" PRIX32 "\n", status); + printf("DecryptMessage output: cBuffers: %" PRIu32 " [0]: %" PRIu32 " / %" PRIu32 + " [1]: %" PRIu32 " / %" PRIu32 " [2]: %" PRIu32 " / %" PRIu32 " [3]: %" PRIu32 + " / %" PRIu32 "\n", + Message.cBuffers, Message.pBuffers[0].cbBuffer, Message.pBuffers[0].BufferType, + Message.pBuffers[1].cbBuffer, Message.pBuffers[1].BufferType, + Message.pBuffers[2].cbBuffer, Message.pBuffers[2].BufferType, + Message.pBuffers[3].cbBuffer, Message.pBuffers[3].BufferType); if (status != SEC_E_OK) return -1; - printf("Decrypted Message (%"PRIu32")\n", Message.pBuffers[1].cbBuffer); - winpr_HexDump("sspi.test", WLOG_DEBUG, (BYTE*) Message.pBuffers[1].pvBuffer, Message.pBuffers[1].cbBuffer); + printf("Decrypted Message (%" PRIu32 ")\n", Message.pBuffers[1].cbBuffer); + winpr_HexDump("sspi.test", WLOG_DEBUG, (BYTE*)Message.pBuffers[1].pvBuffer, + Message.pBuffers[1].cbBuffer); - if (memcmp(Message.pBuffers[1].pvBuffer, test_LastDummyMessage, sizeof(test_LastDummyMessage)) == 0) + if (memcmp(Message.pBuffers[1].pvBuffer, test_LastDummyMessage, + sizeof(test_LastDummyMessage)) == 0) return -1; return 0; @@ -376,7 +369,7 @@ static DWORD WINAPI schannel_test_server_thread(LPVOID arg) if (status != SEC_E_OK) { - printf("QuerySecurityPackageInfo failure: 0x%08"PRIX32"\n", status); + printf("QuerySecurityPackageInfo failure: 0x%08" PRIX32 "\n", status); return 0; } @@ -386,29 +379,33 @@ static DWORD WINAPI schannel_test_server_thread(LPVOID arg) if (!hCertStore) { printf("Error opening system store\n"); - //return NULL; + // return NULL; } #ifdef CERT_FIND_HAS_PRIVATE_KEY - pCertContext = CertFindCertificateInStore(hCertStore, X509_ASN_ENCODING, 0, CERT_FIND_HAS_PRIVATE_KEY, NULL, NULL); + pCertContext = CertFindCertificateInStore(hCertStore, X509_ASN_ENCODING, 0, + CERT_FIND_HAS_PRIVATE_KEY, NULL, NULL); #else - pCertContext = CertFindCertificateInStore(hCertStore, X509_ASN_ENCODING, 0, CERT_FIND_ANY, NULL, NULL); + pCertContext = + CertFindCertificateInStore(hCertStore, X509_ASN_ENCODING, 0, CERT_FIND_ANY, NULL, NULL); #endif if (!pCertContext) { printf("Error finding certificate in store\n"); - //return NULL; + // return NULL; } - cchNameString = CertGetNameString(pCertContext, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0, NULL, NULL, 0); - pszNameString = (LPTSTR) malloc(cchNameString * sizeof(TCHAR)); + cchNameString = + CertGetNameString(pCertContext, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0, NULL, NULL, 0); + pszNameString = (LPTSTR)malloc(cchNameString * sizeof(TCHAR)); if (!pszNameString) { printf("Memory allocation failed\n"); return 0; } - cchNameString = CertGetNameString(pCertContext, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0, NULL, pszNameString, cchNameString); + cchNameString = CertGetNameString(pCertContext, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0, NULL, + pszNameString, cchNameString); _tprintf(_T("Certificate Name: %s\n"), pszNameString); ZeroMemory(&cred, sizeof(SCHANNEL_CRED)); cred.dwVersion = SCHANNEL_CRED_VERSION; @@ -418,31 +415,30 @@ static DWORD WINAPI schannel_test_server_thread(LPVOID arg) cred.palgSupportedAlgs = NULL; cred.grbitEnabledProtocols = SP_PROT_TLS1_SERVER; cred.dwFlags = SCH_CRED_NO_SYSTEM_MAPPER; - status = table->AcquireCredentialsHandle(NULL, SCHANNEL_NAME, - SECPKG_CRED_INBOUND, NULL, &cred, NULL, NULL, &credentials, NULL); + status = table->AcquireCredentialsHandle(NULL, SCHANNEL_NAME, SECPKG_CRED_INBOUND, NULL, &cred, + NULL, NULL, &credentials, NULL); if (status != SEC_E_OK) { - printf("AcquireCredentialsHandle failure: 0x%08"PRIX32"\n", status); + printf("AcquireCredentialsHandle failure: 0x%08" PRIX32 "\n", status); return 0; } extraData = FALSE; g_ServerWait = TRUE; - if (!(lpTokenIn = (BYTE*) malloc(cbMaxToken))) + if (!(lpTokenIn = (BYTE*)malloc(cbMaxToken))) { printf("Memory allocation failed\n"); return 0; } - if (!(lpTokenOut = (BYTE*) malloc(cbMaxToken))) + if (!(lpTokenOut = (BYTE*)malloc(cbMaxToken))) { printf("Memory allocation failed\n"); free(lpTokenIn); return 0; } - fContextReq = ASC_REQ_STREAM | - ASC_REQ_SEQUENCE_DETECT | ASC_REQ_REPLAY_DETECT | - ASC_REQ_CONFIDENTIALITY | ASC_REQ_EXTENDED_ERROR; + fContextReq = ASC_REQ_STREAM | ASC_REQ_SEQUENCE_DETECT | ASC_REQ_REPLAY_DETECT | + ASC_REQ_CONFIDENTIALITY | ASC_REQ_EXTENDED_ERROR; do { @@ -479,12 +475,14 @@ static DWORD WINAPI schannel_test_server_thread(LPVOID arg) SecBufferDesc_out.ulVersion = SECBUFFER_VERSION; SecBufferDesc_out.cBuffers = 1; SecBufferDesc_out.pBuffers = SecBuffer_out; - status = table->AcceptSecurityContext(&credentials, SecIsValidHandle(&context) ? &context : NULL, - &SecBufferDesc_in, fContextReq, 0, &context, &SecBufferDesc_out, &fContextAttr, &expiry); + status = table->AcceptSecurityContext( + &credentials, SecIsValidHandle(&context) ? &context : NULL, &SecBufferDesc_in, + fContextReq, 0, &context, &SecBufferDesc_out, &fContextAttr, &expiry); - if ((status != SEC_E_OK) && (status != SEC_I_CONTINUE_NEEDED) && (status != SEC_E_INCOMPLETE_MESSAGE)) + if ((status != SEC_E_OK) && (status != SEC_I_CONTINUE_NEEDED) && + (status != SEC_E_INCOMPLETE_MESSAGE)) { - printf("AcceptSecurityContext unexpected status: 0x%08"PRIX32"\n", status); + printf("AcceptSecurityContext unexpected status: 0x%08" PRIX32 "\n", status); return NULL; } @@ -497,17 +495,21 @@ static DWORD WINAPI schannel_test_server_thread(LPVOID arg) else if (status == SEC_E_INCOMPLETE_MESSAGE) printf("AcceptSecurityContext status: SEC_E_INCOMPLETE_MESSAGE\n"); - printf("Server cBuffers: %"PRIu32" pBuffers[0]: %"PRIu32" type: %"PRIu32"\n", - SecBufferDesc_out.cBuffers, SecBufferDesc_out.pBuffers[0].cbBuffer, SecBufferDesc_out.pBuffers[0].BufferType); - printf("Server Input cBuffers: %"PRIu32" pBuffers[0]: %"PRIu32" type: %"PRIu32" pBuffers[1]: %"PRIu32" type: %"PRIu32"\n", SecBufferDesc_in.cBuffers, - SecBufferDesc_in.pBuffers[0].cbBuffer, SecBufferDesc_in.pBuffers[0].BufferType, - SecBufferDesc_in.pBuffers[1].cbBuffer, SecBufferDesc_in.pBuffers[1].BufferType); + printf("Server cBuffers: %" PRIu32 " pBuffers[0]: %" PRIu32 " type: %" PRIu32 "\n", + SecBufferDesc_out.cBuffers, SecBufferDesc_out.pBuffers[0].cbBuffer, + SecBufferDesc_out.pBuffers[0].BufferType); + printf("Server Input cBuffers: %" PRIu32 " pBuffers[0]: %" PRIu32 " type: %" PRIu32 + " pBuffers[1]: %" PRIu32 " type: %" PRIu32 "\n", + SecBufferDesc_in.cBuffers, SecBufferDesc_in.pBuffers[0].cbBuffer, + SecBufferDesc_in.pBuffers[0].BufferType, SecBufferDesc_in.pBuffers[1].cbBuffer, + SecBufferDesc_in.pBuffers[1].BufferType); if (SecBufferDesc_in.pBuffers[1].BufferType == SECBUFFER_EXTRA) { printf("AcceptSecurityContext SECBUFFER_EXTRA\n"); pSecBuffer = &SecBufferDesc_in.pBuffers[1]; - CopyMemory(lpTokenIn, &lpTokenIn[NumberOfBytesRead - pSecBuffer->cbBuffer], pSecBuffer->cbBuffer); + CopyMemory(lpTokenIn, &lpTokenIn[NumberOfBytesRead - pSecBuffer->cbBuffer], + pSecBuffer->cbBuffer); NumberOfBytesRead = pSecBuffer->cbBuffer; continue; } @@ -518,10 +520,12 @@ static DWORD WINAPI schannel_test_server_thread(LPVOID arg) if (pSecBuffer->cbBuffer > 0) { - printf("Server > Client (%"PRIu32")\n", pSecBuffer->cbBuffer); - winpr_HexDump("sspi.test", WLOG_DEBUG, (BYTE*) pSecBuffer->pvBuffer, pSecBuffer->cbBuffer); + printf("Server > Client (%" PRIu32 ")\n", pSecBuffer->cbBuffer); + winpr_HexDump("sspi.test", WLOG_DEBUG, (BYTE*)pSecBuffer->pvBuffer, + pSecBuffer->cbBuffer); - if (!WriteFile(g_ClientWritePipe, pSecBuffer->pvBuffer, pSecBuffer->cbBuffer, &NumberOfBytesWritten, NULL)) + if (!WriteFile(g_ClientWritePipe, pSecBuffer->pvBuffer, pSecBuffer->cbBuffer, + &NumberOfBytesWritten, NULL)) { printf("failed to write to client pipe\n"); return NULL; @@ -534,15 +538,13 @@ static DWORD WINAPI schannel_test_server_thread(LPVOID arg) printf("Server Handshake Complete\n"); break; } - } - while (1); + } while (1); do { if (schannel_recv(table, g_ServerReadPipe, &context) < 0) break; - } - while (1); + } while (1); return 0; } @@ -563,7 +565,7 @@ static int dump_test_certificate_files(void) fp = fopen(fullpath, "w+"); if (fp) { - if (fwrite((void*) test_localhost_crt, sizeof(test_localhost_crt), 1, fp) != 1) + if (fwrite((void*)test_localhost_crt, sizeof(test_localhost_crt), 1, fp) != 1) goto out_fail; fclose(fp); fp = NULL; @@ -577,8 +579,8 @@ static int dump_test_certificate_files(void) if (!fullpath) return -1; fp = fopen(fullpath, "w+"); - if (fp && fwrite((void*) test_localhost_key, sizeof(test_localhost_key), 1, fp) != 1) - goto out_fail; + if (fp && fwrite((void*)test_localhost_key, sizeof(test_localhost_key), 1, fp) != 1) + goto out_fail; ret = 1; out_fail: @@ -645,7 +647,7 @@ int TestSchannel(int argc, char* argv[]) if (status != SEC_E_OK) { - printf("QuerySecurityPackageInfo failure: 0x%08"PRIX32"\n", status); + printf("QuerySecurityPackageInfo failure: 0x%08" PRIX32 "\n", status); return -1; } @@ -660,21 +662,23 @@ int TestSchannel(int argc, char* argv[]) cred.dwFlags = SCH_CRED_NO_DEFAULT_CREDS; cred.dwFlags |= SCH_CRED_MANUAL_CRED_VALIDATION; cred.dwFlags |= SCH_CRED_NO_SERVERNAME_CHECK; - status = table->AcquireCredentialsHandle(NULL, SCHANNEL_NAME, - SECPKG_CRED_OUTBOUND, NULL, &cred, NULL, NULL, &credentials, NULL); + status = table->AcquireCredentialsHandle(NULL, SCHANNEL_NAME, SECPKG_CRED_OUTBOUND, NULL, &cred, + NULL, NULL, &credentials, NULL); if (status != SEC_E_OK) { - printf("AcquireCredentialsHandle failure: 0x%08"PRIX32"\n", status); + printf("AcquireCredentialsHandle failure: 0x%08" PRIX32 "\n", status); return -1; } ZeroMemory(&SupportedAlgs, sizeof(SecPkgCred_SupportedAlgs)); - status = table->QueryCredentialsAttributes(&credentials, SECPKG_ATTR_SUPPORTED_ALGS, &SupportedAlgs); + status = + table->QueryCredentialsAttributes(&credentials, SECPKG_ATTR_SUPPORTED_ALGS, &SupportedAlgs); if (status != SEC_E_OK) { - printf("QueryCredentialsAttributes SECPKG_ATTR_SUPPORTED_ALGS failure: 0x%08"PRIX32"\n", status); + printf("QueryCredentialsAttributes SECPKG_ATTR_SUPPORTED_ALGS failure: 0x%08" PRIX32 "\n", + status); return -1; } @@ -683,49 +687,53 @@ int TestSchannel(int argc, char* argv[]) * 0x660E 0x6610 0x6801 0x6603 0x6601 0x8003 0x8004 * 0x800C 0x800D 0x800E 0x2400 0xAA02 0xAE06 0x2200 0x2203 */ - printf("SupportedAlgs: %"PRIu32"\n", SupportedAlgs.cSupportedAlgs); + printf("SupportedAlgs: %" PRIu32 "\n", SupportedAlgs.cSupportedAlgs); for (index = 0; index < SupportedAlgs.cSupportedAlgs; index++) { algId = SupportedAlgs.palgSupportedAlgs[index]; - printf("\t0x%08"PRIX32" CLASS: %"PRIu32" TYPE: %"PRIu32" SID: %"PRIu32"\n", algId, - ((GET_ALG_CLASS(algId)) >> 13), ((GET_ALG_TYPE(algId)) >> 9), GET_ALG_SID(algId)); + printf("\t0x%08" PRIX32 " CLASS: %" PRIu32 " TYPE: %" PRIu32 " SID: %" PRIu32 "\n", algId, + ((GET_ALG_CLASS(algId)) >> 13), ((GET_ALG_TYPE(algId)) >> 9), GET_ALG_SID(algId)); } printf("\n"); ZeroMemory(&CipherStrengths, sizeof(SecPkgCred_CipherStrengths)); - status = table->QueryCredentialsAttributes(&credentials, SECPKG_ATTR_CIPHER_STRENGTHS, &CipherStrengths); + status = table->QueryCredentialsAttributes(&credentials, SECPKG_ATTR_CIPHER_STRENGTHS, + &CipherStrengths); if (status != SEC_E_OK) { - printf("QueryCredentialsAttributes SECPKG_ATTR_CIPHER_STRENGTHS failure: 0x%08"PRIX32"\n", status); + printf("QueryCredentialsAttributes SECPKG_ATTR_CIPHER_STRENGTHS failure: 0x%08" PRIX32 "\n", + status); return -1; } /* CipherStrengths: Minimum: 40 Maximum: 256 */ - printf("CipherStrengths: Minimum: %"PRIu32" Maximum: %"PRIu32"\n", - CipherStrengths.dwMinimumCipherStrength, CipherStrengths.dwMaximumCipherStrength); + printf("CipherStrengths: Minimum: %" PRIu32 " Maximum: %" PRIu32 "\n", + CipherStrengths.dwMinimumCipherStrength, CipherStrengths.dwMaximumCipherStrength); ZeroMemory(&SupportedProtocols, sizeof(SecPkgCred_SupportedProtocols)); - status = table->QueryCredentialsAttributes(&credentials, SECPKG_ATTR_SUPPORTED_PROTOCOLS, &SupportedProtocols); + status = table->QueryCredentialsAttributes(&credentials, SECPKG_ATTR_SUPPORTED_PROTOCOLS, + &SupportedProtocols); if (status != SEC_E_OK) { - printf("QueryCredentialsAttributes SECPKG_ATTR_SUPPORTED_PROTOCOLS failure: 0x%08"PRIX32"\n", status); + printf("QueryCredentialsAttributes SECPKG_ATTR_SUPPORTED_PROTOCOLS failure: 0x%08" PRIX32 + "\n", + status); return -1; } /* SupportedProtocols: 0x208A0 */ - printf("SupportedProtocols: 0x%08"PRIX32"\n", SupportedProtocols.grbitProtocol); - fContextReq = ISC_REQ_STREAM | - ISC_REQ_SEQUENCE_DETECT | ISC_REQ_REPLAY_DETECT | - ISC_REQ_CONFIDENTIALITY | ISC_RET_EXTENDED_ERROR | - ISC_REQ_MANUAL_CRED_VALIDATION | ISC_REQ_INTEGRITY; - if (!(lpTokenIn = (BYTE*) malloc(cbMaxToken))) + printf("SupportedProtocols: 0x%08" PRIX32 "\n", SupportedProtocols.grbitProtocol); + fContextReq = ISC_REQ_STREAM | ISC_REQ_SEQUENCE_DETECT | ISC_REQ_REPLAY_DETECT | + ISC_REQ_CONFIDENTIALITY | ISC_RET_EXTENDED_ERROR | + ISC_REQ_MANUAL_CRED_VALIDATION | ISC_REQ_INTEGRITY; + if (!(lpTokenIn = (BYTE*)malloc(cbMaxToken))) { printf("Memory allocation failed\n"); return -1; } - if (!(lpTokenOut = (BYTE*) malloc(cbMaxToken))) + if (!(lpTokenOut = (BYTE*)malloc(cbMaxToken))) { printf("Memory allocation failed\n"); return -1; @@ -752,12 +760,12 @@ int TestSchannel(int argc, char* argv[]) } g_ClientWait = TRUE; - printf("NumberOfBytesRead: %"PRIu32"\n", NumberOfBytesRead); + printf("NumberOfBytesRead: %" PRIu32 "\n", NumberOfBytesRead); SecBuffer_in[0].BufferType = SECBUFFER_TOKEN; SecBuffer_in[0].pvBuffer = lpTokenIn; SecBuffer_in[0].cbBuffer = NumberOfBytesRead; - SecBuffer_in[1].pvBuffer = NULL; - SecBuffer_in[1].cbBuffer = 0; + SecBuffer_in[1].pvBuffer = NULL; + SecBuffer_in[1].cbBuffer = 0; SecBuffer_in[1].BufferType = SECBUFFER_EMPTY; SecBufferDesc_in.ulVersion = SECBUFFER_VERSION; SecBufferDesc_in.cBuffers = 2; @@ -768,12 +776,15 @@ int TestSchannel(int argc, char* argv[]) SecBufferDesc_out.ulVersion = SECBUFFER_VERSION; SecBufferDesc_out.cBuffers = 1; SecBufferDesc_out.pBuffers = SecBuffer_out; - status = table->InitializeSecurityContext(&credentials, SecIsValidHandle(&context) ? &context : NULL, _T("localhost"), - fContextReq, 0, 0, &SecBufferDesc_in, 0, &context, &SecBufferDesc_out, &fContextAttr, &expiry); + status = table->InitializeSecurityContext( + &credentials, SecIsValidHandle(&context) ? &context : NULL, _T("localhost"), + fContextReq, 0, 0, &SecBufferDesc_in, 0, &context, &SecBufferDesc_out, &fContextAttr, + &expiry); - if ((status != SEC_E_OK) && (status != SEC_I_CONTINUE_NEEDED) && (status != SEC_E_INCOMPLETE_MESSAGE)) + if ((status != SEC_E_OK) && (status != SEC_I_CONTINUE_NEEDED) && + (status != SEC_E_INCOMPLETE_MESSAGE)) { - printf("InitializeSecurityContext unexpected status: 0x%08"PRIX32"\n", status); + printf("InitializeSecurityContext unexpected status: 0x%08" PRIX32 "\n", status); return -1; } @@ -786,11 +797,14 @@ int TestSchannel(int argc, char* argv[]) else if (status == SEC_E_INCOMPLETE_MESSAGE) printf("InitializeSecurityContext status: SEC_E_INCOMPLETE_MESSAGE\n"); - printf("Client Output cBuffers: %"PRIu32" pBuffers[0]: %"PRIu32" type: %"PRIu32"\n", - SecBufferDesc_out.cBuffers, SecBufferDesc_out.pBuffers[0].cbBuffer, SecBufferDesc_out.pBuffers[0].BufferType); - printf("Client Input cBuffers: %"PRIu32" pBuffers[0]: %"PRIu32" type: %"PRIu32" pBuffers[1]: %"PRIu32" type: %"PRIu32"\n", SecBufferDesc_in.cBuffers, - SecBufferDesc_in.pBuffers[0].cbBuffer, SecBufferDesc_in.pBuffers[0].BufferType, - SecBufferDesc_in.pBuffers[1].cbBuffer, SecBufferDesc_in.pBuffers[1].BufferType); + printf("Client Output cBuffers: %" PRIu32 " pBuffers[0]: %" PRIu32 " type: %" PRIu32 "\n", + SecBufferDesc_out.cBuffers, SecBufferDesc_out.pBuffers[0].cbBuffer, + SecBufferDesc_out.pBuffers[0].BufferType); + printf("Client Input cBuffers: %" PRIu32 " pBuffers[0]: %" PRIu32 " type: %" PRIu32 + " pBuffers[1]: %" PRIu32 " type: %" PRIu32 "\n", + SecBufferDesc_in.cBuffers, SecBufferDesc_in.pBuffers[0].cbBuffer, + SecBufferDesc_in.pBuffers[0].BufferType, SecBufferDesc_in.pBuffers[1].cbBuffer, + SecBufferDesc_in.pBuffers[1].BufferType); if (status != SEC_E_INCOMPLETE_MESSAGE) { @@ -798,10 +812,12 @@ int TestSchannel(int argc, char* argv[]) if (pSecBuffer->cbBuffer > 0) { - printf("Client > Server (%"PRIu32")\n", pSecBuffer->cbBuffer); - winpr_HexDump("sspi.test", WLOG_DEBUG, (BYTE*) pSecBuffer->pvBuffer, pSecBuffer->cbBuffer); + printf("Client > Server (%" PRIu32 ")\n", pSecBuffer->cbBuffer); + winpr_HexDump("sspi.test", WLOG_DEBUG, (BYTE*)pSecBuffer->pvBuffer, + pSecBuffer->cbBuffer); - if (!WriteFile(g_ServerWritePipe, pSecBuffer->pvBuffer, pSecBuffer->cbBuffer, &NumberOfBytesWritten, NULL)) + if (!WriteFile(g_ServerWritePipe, pSecBuffer->pvBuffer, pSecBuffer->cbBuffer, + &NumberOfBytesWritten, NULL)) { printf("failed to write to server pipe\n"); return -1; @@ -814,14 +830,14 @@ int TestSchannel(int argc, char* argv[]) printf("Client Handshake Complete\n"); break; } - } - while (1); + } while (1); count = 0; do { - if (schannel_send(table, g_ServerWritePipe, &context, test_DummyMessage, sizeof(test_DummyMessage)) < 0) + if (schannel_send(table, g_ServerWritePipe, &context, test_DummyMessage, + sizeof(test_DummyMessage)) < 0) break; for (index = 0; index < sizeof(test_DummyMessage); index++) @@ -838,10 +854,10 @@ int TestSchannel(int argc, char* argv[]) Sleep(100); count++; - } - while (count < 3); + } while (count < 3); - schannel_send(table, g_ServerWritePipe, &context, test_LastDummyMessage, sizeof(test_LastDummyMessage)); + schannel_send(table, g_ServerWritePipe, &context, test_LastDummyMessage, + sizeof(test_LastDummyMessage)); WaitForSingleObject(thread, INFINITE); sspi_GlobalFinish(); return 0; diff --git a/winpr/libwinpr/sspicli/sspicli.c b/winpr/libwinpr/sspicli/sspicli.c index 66e8a6f1e..e88b53d48 100644 --- a/winpr/libwinpr/sspicli/sspicli.c +++ b/winpr/libwinpr/sspicli/sspicli.c @@ -73,7 +73,7 @@ static BOOL LogonUserCloseHandle(HANDLE handle); static BOOL LogonUserIsHandled(HANDLE handle) { - WINPR_ACCESS_TOKEN* pLogonUser = (WINPR_ACCESS_TOKEN*) handle; + WINPR_ACCESS_TOKEN* pLogonUser = (WINPR_ACCESS_TOKEN*)handle; if (!pLogonUser || (pLogonUser->Type != HANDLE_TYPE_ACCESS_TOKEN)) { @@ -98,7 +98,7 @@ static int LogonUserGetFd(HANDLE handle) BOOL LogonUserCloseHandle(HANDLE handle) { - WINPR_ACCESS_TOKEN* token = (WINPR_ACCESS_TOKEN*) handle; + WINPR_ACCESS_TOKEN* token = (WINPR_ACCESS_TOKEN*)handle; if (!handle || !LogonUserIsHandled(handle)) return FALSE; @@ -109,32 +109,29 @@ BOOL LogonUserCloseHandle(HANDLE handle) return TRUE; } -static HANDLE_OPS ops = -{ - LogonUserIsHandled, - LogonUserCloseHandle, - LogonUserGetFd, - NULL, /* CleanupHandle */ - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL -}; +static HANDLE_OPS ops = { LogonUserIsHandled, + LogonUserCloseHandle, + LogonUserGetFd, + NULL, /* CleanupHandle */ + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL }; -BOOL LogonUserA(LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword, - DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken) +BOOL LogonUserA(LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword, DWORD dwLogonType, + DWORD dwLogonProvider, PHANDLE phToken) { struct passwd* pw; WINPR_ACCESS_TOKEN* token; @@ -142,7 +139,7 @@ BOOL LogonUserA(LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword, if (!lpszUsername) return FALSE; - token = (WINPR_ACCESS_TOKEN*) calloc(1, sizeof(WINPR_ACCESS_TOKEN)); + token = (WINPR_ACCESS_TOKEN*)calloc(1, sizeof(WINPR_ACCESS_TOKEN)); if (!token) return FALSE; @@ -173,30 +170,30 @@ BOOL LogonUserA(LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword, if (pw) { - token->UserId = (DWORD) pw->pw_uid; - token->GroupId = (DWORD) pw->pw_gid; + token->UserId = (DWORD)pw->pw_uid; + token->GroupId = (DWORD)pw->pw_gid; } - *((ULONG_PTR*) phToken) = (ULONG_PTR) token; + *((ULONG_PTR*)phToken) = (ULONG_PTR)token; return TRUE; } -BOOL LogonUserW(LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPassword, - DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken) +BOOL LogonUserW(LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPassword, DWORD dwLogonType, + DWORD dwLogonProvider, PHANDLE phToken) { return TRUE; } -BOOL LogonUserExA(LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword, - DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken, PSID* ppLogonSid, - PVOID* ppProfileBuffer, LPDWORD pdwProfileLength, PQUOTA_LIMITS pQuotaLimits) +BOOL LogonUserExA(LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword, DWORD dwLogonType, + DWORD dwLogonProvider, PHANDLE phToken, PSID* ppLogonSid, PVOID* ppProfileBuffer, + LPDWORD pdwProfileLength, PQUOTA_LIMITS pQuotaLimits) { return TRUE; } -BOOL LogonUserExW(LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPassword, - DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken, PSID* ppLogonSid, - PVOID* ppProfileBuffer, LPDWORD pdwProfileLength, PQUOTA_LIMITS pQuotaLimits) +BOOL LogonUserExW(LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPassword, DWORD dwLogonType, + DWORD dwLogonProvider, PHANDLE phToken, PSID* ppLogonSid, PVOID* ppProfileBuffer, + LPDWORD pdwProfileLength, PQUOTA_LIMITS pQuotaLimits) { return TRUE; } @@ -247,4 +244,3 @@ BOOL GetUserNameExW(EXTENDED_NAME_FORMAT NameFormat, LPWSTR lpNameBuffer, PULONG } #endif - diff --git a/winpr/libwinpr/synch/address.c b/winpr/libwinpr/synch/address.c index 61d4acadb..0298652a7 100644 --- a/winpr/libwinpr/synch/address.c +++ b/winpr/libwinpr/synch/address.c @@ -33,15 +33,14 @@ VOID WakeByAddressAll(PVOID Address) { - } VOID WakeByAddressSingle(PVOID Address) { - } -BOOL WaitOnAddress(VOID volatile *Address, PVOID CompareAddress, SIZE_T AddressSize, DWORD dwMilliseconds) +BOOL WaitOnAddress(VOID volatile* Address, PVOID CompareAddress, SIZE_T AddressSize, + DWORD dwMilliseconds) { return TRUE; } diff --git a/winpr/libwinpr/synch/barrier.c b/winpr/libwinpr/synch/barrier.c index 5e43a9276..1c57217d2 100644 --- a/winpr/libwinpr/synch/barrier.c +++ b/winpr/libwinpr/synch/barrier.c @@ -52,32 +52,34 @@ static HMODULE g_Kernel32 = NULL; static BOOL g_NativeBarrier = FALSE; static INIT_ONCE g_InitOnce = INIT_ONCE_STATIC_INIT; -typedef BOOL (WINAPI * fnInitializeSynchronizationBarrier)(LPSYNCHRONIZATION_BARRIER lpBarrier, LONG lTotalThreads, LONG lSpinCount); -typedef BOOL (WINAPI * fnEnterSynchronizationBarrier)(LPSYNCHRONIZATION_BARRIER lpBarrier, DWORD dwFlags); -typedef BOOL (WINAPI * fnDeleteSynchronizationBarrier)(LPSYNCHRONIZATION_BARRIER lpBarrier); +typedef BOOL(WINAPI* fnInitializeSynchronizationBarrier)(LPSYNCHRONIZATION_BARRIER lpBarrier, + LONG lTotalThreads, LONG lSpinCount); +typedef BOOL(WINAPI* fnEnterSynchronizationBarrier)(LPSYNCHRONIZATION_BARRIER lpBarrier, + DWORD dwFlags); +typedef BOOL(WINAPI* fnDeleteSynchronizationBarrier)(LPSYNCHRONIZATION_BARRIER lpBarrier); static fnInitializeSynchronizationBarrier pfnInitializeSynchronizationBarrier = NULL; static fnEnterSynchronizationBarrier pfnEnterSynchronizationBarrier = NULL; static fnDeleteSynchronizationBarrier pfnDeleteSynchronizationBarrier = NULL; -static BOOL CALLBACK InitOnce_Barrier(PINIT_ONCE once, PVOID param, PVOID *context) +static BOOL CALLBACK InitOnce_Barrier(PINIT_ONCE once, PVOID param, PVOID* context) { g_Kernel32 = LoadLibraryA("kernel32.dll"); if (!g_Kernel32) return TRUE; - pfnInitializeSynchronizationBarrier = (fnInitializeSynchronizationBarrier) - GetProcAddress(g_Kernel32, "InitializeSynchronizationBarrier"); + pfnInitializeSynchronizationBarrier = (fnInitializeSynchronizationBarrier)GetProcAddress( + g_Kernel32, "InitializeSynchronizationBarrier"); - pfnEnterSynchronizationBarrier = (fnEnterSynchronizationBarrier) - GetProcAddress(g_Kernel32, "EnterSynchronizationBarrier"); + pfnEnterSynchronizationBarrier = + (fnEnterSynchronizationBarrier)GetProcAddress(g_Kernel32, "EnterSynchronizationBarrier"); - pfnDeleteSynchronizationBarrier = (fnDeleteSynchronizationBarrier) - GetProcAddress(g_Kernel32, "DeleteSynchronizationBarrier"); + pfnDeleteSynchronizationBarrier = + (fnDeleteSynchronizationBarrier)GetProcAddress(g_Kernel32, "DeleteSynchronizationBarrier"); - if (pfnInitializeSynchronizationBarrier && pfnEnterSynchronizationBarrier - && pfnDeleteSynchronizationBarrier) + if (pfnInitializeSynchronizationBarrier && pfnEnterSynchronizationBarrier && + pfnDeleteSynchronizationBarrier) { g_NativeBarrier = TRUE; } @@ -87,7 +89,8 @@ static BOOL CALLBACK InitOnce_Barrier(PINIT_ONCE once, PVOID param, PVOID *conte #endif -BOOL WINAPI winpr_InitializeSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier, LONG lTotalThreads, LONG lSpinCount) +BOOL WINAPI winpr_InitializeSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier, + LONG lTotalThreads, LONG lSpinCount) { SYSTEM_INFO sysinfo; HANDLE hEvent0; @@ -147,7 +150,8 @@ BOOL WINAPI winpr_EnterSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrie return FALSE; /** - * dwFlags according to https://msdn.microsoft.com/en-us/library/windows/desktop/hh706889(v=vs.85).aspx + * dwFlags according to + * https://msdn.microsoft.com/en-us/library/windows/desktop/hh706889(v=vs.85).aspx * * SYNCHRONIZATION_BARRIER_FLAGS_BLOCK_ONLY (0x01) * Specifies that the thread entering the barrier should block diff --git a/winpr/libwinpr/synch/condition.c b/winpr/libwinpr/synch/condition.c index c41a093e1..ca347e5f1 100644 --- a/winpr/libwinpr/synch/condition.c +++ b/winpr/libwinpr/synch/condition.c @@ -37,27 +37,26 @@ VOID InitializeConditionVariable(PCONDITION_VARIABLE ConditionVariable) { - } -BOOL SleepConditionVariableCS(PCONDITION_VARIABLE ConditionVariable, PCRITICAL_SECTION CriticalSection, DWORD dwMilliseconds) +BOOL SleepConditionVariableCS(PCONDITION_VARIABLE ConditionVariable, + PCRITICAL_SECTION CriticalSection, DWORD dwMilliseconds) { return TRUE; } -BOOL SleepConditionVariableSRW(PCONDITION_VARIABLE ConditionVariable, PSRWLOCK SRWLock, DWORD dwMilliseconds, ULONG Flags) +BOOL SleepConditionVariableSRW(PCONDITION_VARIABLE ConditionVariable, PSRWLOCK SRWLock, + DWORD dwMilliseconds, ULONG Flags) { return TRUE; } VOID WakeAllConditionVariable(PCONDITION_VARIABLE ConditionVariable) { - } VOID WakeConditionVariable(PCONDITION_VARIABLE ConditionVariable) { - } #endif diff --git a/winpr/libwinpr/synch/critical.c b/winpr/libwinpr/synch/critical.c index 610072bf5..8b2b609b7 100644 --- a/winpr/libwinpr/synch/critical.c +++ b/winpr/libwinpr/synch/critical.c @@ -73,15 +73,15 @@ BOOL InitializeCriticalSectionEx(LPCRITICAL_SECTION lpCriticalSection, DWORD dwS lpCriticalSection->SpinCount = 0; lpCriticalSection->RecursionCount = 0; lpCriticalSection->OwningThread = NULL; - lpCriticalSection->LockSemaphore = (winpr_sem_t*) malloc(sizeof(winpr_sem_t)); + lpCriticalSection->LockSemaphore = (winpr_sem_t*)malloc(sizeof(winpr_sem_t)); if (!lpCriticalSection->LockSemaphore) return FALSE; #if defined(__APPLE__) - if (semaphore_create(mach_task_self(), lpCriticalSection->LockSemaphore, SYNC_POLICY_FIFO, - 0) != KERN_SUCCESS) + if (semaphore_create(mach_task_self(), lpCriticalSection->LockSemaphore, SYNC_POLICY_FIFO, 0) != + KERN_SUCCESS) goto out_fail; #else @@ -127,18 +127,18 @@ DWORD SetCriticalSectionSpinCount(LPCRITICAL_SECTION lpCriticalSection, DWORD dw static VOID _WaitForCriticalSection(LPCRITICAL_SECTION lpCriticalSection) { #if defined(__APPLE__) - semaphore_wait(*((winpr_sem_t*) lpCriticalSection->LockSemaphore)); + semaphore_wait(*((winpr_sem_t*)lpCriticalSection->LockSemaphore)); #else - sem_wait((winpr_sem_t*) lpCriticalSection->LockSemaphore); + sem_wait((winpr_sem_t*)lpCriticalSection->LockSemaphore); #endif } static VOID _UnWaitCriticalSection(LPCRITICAL_SECTION lpCriticalSection) { #if defined __APPLE__ - semaphore_signal(*((winpr_sem_t*) lpCriticalSection->LockSemaphore)); + semaphore_signal(*((winpr_sem_t*)lpCriticalSection->LockSemaphore)); #else - sem_post((winpr_sem_t*) lpCriticalSection->LockSemaphore); + sem_post((winpr_sem_t*)lpCriticalSection->LockSemaphore); #endif } @@ -158,7 +158,7 @@ VOID EnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection) if (InterlockedCompareExchange(&lpCriticalSection->LockCount, 0, -1) == -1) { lpCriticalSection->RecursionCount = 1; - lpCriticalSection->OwningThread = (HANDLE)(ULONG_PTR) GetCurrentThreadId(); + lpCriticalSection->OwningThread = (HANDLE)(ULONG_PTR)GetCurrentThreadId(); return; } @@ -180,7 +180,7 @@ VOID EnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection) if (InterlockedIncrement(&lpCriticalSection->LockCount)) { /* Section is already locked. Check if it is owned by the current thread. */ - if (lpCriticalSection->OwningThread == (HANDLE)(ULONG_PTR) GetCurrentThreadId()) + if (lpCriticalSection->OwningThread == (HANDLE)(ULONG_PTR)GetCurrentThreadId()) { /* Recursion. No need to wait. */ lpCriticalSection->RecursionCount++; @@ -193,12 +193,12 @@ VOID EnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection) /* We got the lock. Own it ... */ lpCriticalSection->RecursionCount = 1; - lpCriticalSection->OwningThread = (HANDLE)(ULONG_PTR) GetCurrentThreadId(); + lpCriticalSection->OwningThread = (HANDLE)(ULONG_PTR)GetCurrentThreadId(); } BOOL TryEnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection) { - HANDLE current_thread = (HANDLE)(ULONG_PTR) GetCurrentThreadId(); + HANDLE current_thread = (HANDLE)(ULONG_PTR)GetCurrentThreadId(); /* Atomically acquire the the lock if the section is free. */ if (InterlockedCompareExchange(&lpCriticalSection->LockCount, 0, -1) == -1) @@ -250,9 +250,9 @@ VOID DeleteCriticalSection(LPCRITICAL_SECTION lpCriticalSection) if (lpCriticalSection->LockSemaphore != NULL) { #if defined __APPLE__ - semaphore_destroy(mach_task_self(), *((winpr_sem_t*) lpCriticalSection->LockSemaphore)); + semaphore_destroy(mach_task_self(), *((winpr_sem_t*)lpCriticalSection->LockSemaphore)); #else - sem_destroy((winpr_sem_t*) lpCriticalSection->LockSemaphore); + sem_destroy((winpr_sem_t*)lpCriticalSection->LockSemaphore); #endif free(lpCriticalSection->LockSemaphore); lpCriticalSection->LockSemaphore = NULL; diff --git a/winpr/libwinpr/synch/event.c b/winpr/libwinpr/synch/event.c index ac412732e..ca00349b7 100644 --- a/winpr/libwinpr/synch/event.c +++ b/winpr/libwinpr/synch/event.c @@ -53,7 +53,7 @@ static BOOL EventCloseHandle(HANDLE handle); static BOOL EventIsHandled(HANDLE handle) { - WINPR_TIMER* pEvent = (WINPR_TIMER*) handle; + WINPR_TIMER* pEvent = (WINPR_TIMER*)handle; if (!pEvent || (pEvent->Type != HANDLE_TYPE_EVENT)) { @@ -101,7 +101,7 @@ static BOOL EventCloseHandle_(WINPR_EVENT* event) static BOOL EventCloseHandle(HANDLE handle) { - WINPR_EVENT* event = (WINPR_EVENT*) handle; + WINPR_EVENT* event = (WINPR_EVENT*)handle; if (!EventIsHandled(handle)) return FALSE; @@ -109,29 +109,16 @@ static BOOL EventCloseHandle(HANDLE handle) return EventCloseHandle_(event); } -static HANDLE_OPS ops = -{ - EventIsHandled, - EventCloseHandle, - EventGetFd, - NULL, /* CleanupHandle */ - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL -}; +static HANDLE_OPS ops = { EventIsHandled, EventCloseHandle, + EventGetFd, NULL, /* CleanupHandle */ + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL }; HANDLE CreateEventW(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCWSTR lpName) @@ -155,7 +142,7 @@ HANDLE CreateEventW(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, HANDLE CreateEventA(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName) { - WINPR_EVENT* event = (WINPR_EVENT*) calloc(1, sizeof(WINPR_EVENT)); + WINPR_EVENT* event = (WINPR_EVENT*)calloc(1, sizeof(WINPR_EVENT)); if (lpEventAttributes) WLog_WARN(TAG, "%s [%s] does not support lpEventAttributes", __FUNCTION__, lpName); @@ -214,8 +201,8 @@ HANDLE CreateEventExW(LPSECURITY_ATTRIBUTES lpEventAttributes, LPCWSTR lpName, D manual = TRUE; if (dwDesiredAccess != 0) - WLog_WARN(TAG, "%s [%s] does not support dwDesiredAccess 0x%08"PRIx32, __FUNCTION__, lpName, - dwDesiredAccess); + WLog_WARN(TAG, "%s [%s] does not support dwDesiredAccess 0x%08" PRIx32, __FUNCTION__, + lpName, dwDesiredAccess); return CreateEventW(lpEventAttributes, manual, initial, lpName); } @@ -233,8 +220,8 @@ HANDLE CreateEventExA(LPSECURITY_ATTRIBUTES lpEventAttributes, LPCSTR lpName, DW manual = TRUE; if (dwDesiredAccess != 0) - WLog_WARN(TAG, "%s [%s] does not support dwDesiredAccess 0x%08"PRIx32, __FUNCTION__, lpName, - dwDesiredAccess); + WLog_WARN(TAG, "%s [%s] does not support dwDesiredAccess 0x%08" PRIx32, __FUNCTION__, + lpName, dwDesiredAccess); return CreateEventA(lpEventAttributes, manual, initial, lpName); } @@ -284,7 +271,7 @@ BOOL SetEvent(HANDLE hEvent) if (winpr_Handle_GetInfo(hEvent, &Type, &Object)) { - event = (WINPR_EVENT*) Object; + event = (WINPR_EVENT*)Object; #ifdef HAVE_SYS_EVENTFD_H eventfd_t val = 1; @@ -292,8 +279,7 @@ BOOL SetEvent(HANDLE hEvent) do { length = eventfd_write(event->pipe_fd[0], val); - } - while ((length < 0) && (errno == EINTR)); + } while ((length < 0) && (errno == EINTR)); status = (length == 0) ? TRUE : FALSE; #else @@ -311,7 +297,6 @@ BOOL SetEvent(HANDLE hEvent) } #endif - } return status; @@ -328,7 +313,7 @@ BOOL ResetEvent(HANDLE hEvent) if (!winpr_Handle_GetInfo(hEvent, &Type, &Object)) return FALSE; - event = (WINPR_EVENT*) Object; + event = (WINPR_EVENT*)Object; while (status && WaitForSingleObject(hEvent, 0) == WAIT_OBJECT_0) { @@ -340,8 +325,7 @@ BOOL ResetEvent(HANDLE hEvent) #else length = read(event->pipe_fd[0], &length, 1); #endif - } - while ((length < 0) && (errno == EINTR)); + } while ((length < 0) && (errno == EINTR)); if (length < 0) status = FALSE; @@ -352,15 +336,13 @@ BOOL ResetEvent(HANDLE hEvent) #endif - -HANDLE CreateFileDescriptorEventW(LPSECURITY_ATTRIBUTES lpEventAttributes, - BOOL bManualReset, BOOL bInitialState, - int FileDescriptor, ULONG mode) +HANDLE CreateFileDescriptorEventW(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, + BOOL bInitialState, int FileDescriptor, ULONG mode) { #ifndef _WIN32 WINPR_EVENT* event; HANDLE handle = NULL; - event = (WINPR_EVENT*) calloc(1, sizeof(WINPR_EVENT)); + event = (WINPR_EVENT*)calloc(1, sizeof(WINPR_EVENT)); if (event) { @@ -370,7 +352,7 @@ HANDLE CreateFileDescriptorEventW(LPSECURITY_ATTRIBUTES lpEventAttributes, event->pipe_fd[1] = -1; event->ops = &ops; WINPR_HANDLE_SET_TYPE_AND_MODE(event, HANDLE_TYPE_EVENT, mode); - handle = (HANDLE) event; + handle = (HANDLE)event; } return handle; @@ -379,23 +361,22 @@ HANDLE CreateFileDescriptorEventW(LPSECURITY_ATTRIBUTES lpEventAttributes, #endif } -HANDLE CreateFileDescriptorEventA(LPSECURITY_ATTRIBUTES lpEventAttributes, - BOOL bManualReset, BOOL bInitialState, - int FileDescriptor, ULONG mode) +HANDLE CreateFileDescriptorEventA(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, + BOOL bInitialState, int FileDescriptor, ULONG mode) { - return CreateFileDescriptorEventW(lpEventAttributes, bManualReset, - bInitialState, FileDescriptor, mode); + return CreateFileDescriptorEventW(lpEventAttributes, bManualReset, bInitialState, + FileDescriptor, mode); } /** * Returns an event based on the handle returned by GetEventWaitObject() */ -HANDLE CreateWaitObjectEvent(LPSECURITY_ATTRIBUTES lpEventAttributes, - BOOL bManualReset, BOOL bInitialState, void* pObject) +HANDLE CreateWaitObjectEvent(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, + BOOL bInitialState, void* pObject) { #ifndef _WIN32 - return CreateFileDescriptorEventW(lpEventAttributes, bManualReset, - bInitialState, (int)(ULONG_PTR) pObject, WINPR_FD_READ); + return CreateFileDescriptorEventW(lpEventAttributes, bManualReset, bInitialState, + (int)(ULONG_PTR)pObject, WINPR_FD_READ); #else HANDLE hEvent = NULL; DuplicateHandle(GetCurrentProcess(), pObject, GetCurrentProcess(), &hEvent, 0, FALSE, @@ -433,7 +414,7 @@ int SetEventFileDescriptor(HANDLE hEvent, int FileDescriptor, ULONG mode) if (!winpr_Handle_GetInfo(hEvent, &Type, &Object)) return -1; - event = (WINPR_EVENT*) Object; + event = (WINPR_EVENT*)Object; if (!event->bAttached && event->pipe_fd[0] >= 0) close(event->pipe_fd[0]); @@ -463,10 +444,9 @@ void* GetEventWaitObject(HANDLE hEvent) int fd; void* obj; fd = GetEventFileDescriptor(hEvent); - obj = ((void*)(long) fd); + obj = ((void*)(long)fd); return obj; #else return hEvent; #endif } - diff --git a/winpr/libwinpr/synch/init.c b/winpr/libwinpr/synch/init.c index e9eb75585..e3978a31f 100644 --- a/winpr/libwinpr/synch/init.c +++ b/winpr/libwinpr/synch/init.c @@ -31,7 +31,8 @@ #if (!defined(_WIN32)) || (defined(_WIN32) && (_WIN32_WINNT < 0x0600)) -BOOL winpr_InitOnceBeginInitialize(LPINIT_ONCE lpInitOnce, DWORD dwFlags, PBOOL fPending, LPVOID* lpContext) +BOOL winpr_InitOnceBeginInitialize(LPINIT_ONCE lpInitOnce, DWORD dwFlags, PBOOL fPending, + LPVOID* lpContext) { WLog_ERR(TAG, "not implemented"); return FALSE; @@ -48,7 +49,8 @@ VOID winpr_InitOnceInitialize(PINIT_ONCE InitOnce) WLog_ERR(TAG, "not implemented"); } -BOOL winpr_InitOnceExecuteOnce(PINIT_ONCE InitOnce, PINIT_ONCE_FN InitFn, PVOID Parameter, LPVOID* Context) +BOOL winpr_InitOnceExecuteOnce(PINIT_ONCE InitOnce, PINIT_ONCE_FN InitFn, PVOID Parameter, + LPVOID* Context) { for (;;) { @@ -61,7 +63,8 @@ BOOL winpr_InitOnceExecuteOnce(PINIT_ONCE InitOnce, PINIT_ONCE_FN InitFn, PVOID case 0: /* first time */ - if (InterlockedCompareExchangePointer(&InitOnce->Ptr, (PVOID)1, (PVOID)0) != (PVOID)0) + if (InterlockedCompareExchangePointer(&InitOnce->Ptr, (PVOID)1, (PVOID)0) != + (PVOID)0) { /* some other thread was faster */ break; diff --git a/winpr/libwinpr/synch/mutex.c b/winpr/libwinpr/synch/mutex.c index c576753af..dcff2d66a 100644 --- a/winpr/libwinpr/synch/mutex.c +++ b/winpr/libwinpr/synch/mutex.c @@ -41,7 +41,7 @@ static BOOL MutexCloseHandle(HANDLE handle); static BOOL MutexIsHandled(HANDLE handle) { - WINPR_TIMER* pMutex = (WINPR_TIMER*) handle; + WINPR_TIMER* pMutex = (WINPR_TIMER*)handle; if (!pMutex || (pMutex->Type != HANDLE_TYPE_MUTEX)) { @@ -66,7 +66,7 @@ static int MutexGetFd(HANDLE handle) BOOL MutexCloseHandle(HANDLE handle) { - WINPR_MUTEX* mutex = (WINPR_MUTEX*) handle; + WINPR_MUTEX* mutex = (WINPR_MUTEX*)handle; int rc; if (!MutexIsHandled(handle)) @@ -87,7 +87,7 @@ BOOL MutexCloseHandle(HANDLE handle) if (msg) { for (i = 0; i < used; i++) - WLog_ERR(TAG, "%2"PRIdz": %s", i, msg[i]); + WLog_ERR(TAG, "%2" PRIdz ": %s", i, msg[i]); } free(msg); @@ -105,29 +105,16 @@ BOOL MutexCloseHandle(HANDLE handle) return TRUE; } -static HANDLE_OPS ops = -{ - MutexIsHandled, - MutexCloseHandle, - MutexGetFd, - NULL, /* CleanupHandle */ - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL -}; +static HANDLE_OPS ops = { MutexIsHandled, MutexCloseHandle, + MutexGetFd, NULL, /* CleanupHandle */ + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL }; HANDLE CreateMutexW(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCWSTR lpName) { @@ -151,7 +138,7 @@ HANDLE CreateMutexA(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, { HANDLE handle = NULL; WINPR_MUTEX* mutex; - mutex = (WINPR_MUTEX*) calloc(1, sizeof(WINPR_MUTEX)); + mutex = (WINPR_MUTEX*)calloc(1, sizeof(WINPR_MUTEX)); if (lpMutexAttributes) WLog_WARN(TAG, "%s [%s] does not support lpMutexAttributes", __FUNCTION__, lpName); @@ -164,7 +151,7 @@ HANDLE CreateMutexA(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, pthread_mutex_init(&mutex->mutex, &attr); WINPR_HANDLE_SET_TYPE_AND_MODE(mutex, HANDLE_TYPE_MUTEX, WINPR_FD_READ); mutex->ops = &ops; - handle = (HANDLE) mutex; + handle = (HANDLE)mutex; if (bInitialOwner) pthread_mutex_lock(&mutex->mutex); @@ -183,8 +170,8 @@ HANDLE CreateMutexExA(LPSECURITY_ATTRIBUTES lpMutexAttributes, LPCSTR lpName, DW /* TODO: support access modes */ if (dwDesiredAccess != 0) - WLog_WARN(TAG, "%s [%s] does not support dwDesiredAccess 0x%08"PRIx32, __FUNCTION__, lpName, - dwDesiredAccess); + WLog_WARN(TAG, "%s [%s] does not support dwDesiredAccess 0x%08" PRIx32, __FUNCTION__, + lpName, dwDesiredAccess); if (dwFlags & CREATE_MUTEX_INITIAL_OWNER) initial = TRUE; @@ -199,8 +186,8 @@ HANDLE CreateMutexExW(LPSECURITY_ATTRIBUTES lpMutexAttributes, LPCWSTR lpName, D /* TODO: support access modes */ if (dwDesiredAccess != 0) - WLog_WARN(TAG, "%s [%s] does not support dwDesiredAccess 0x%08"PRIx32, __FUNCTION__, lpName, - dwDesiredAccess); + WLog_WARN(TAG, "%s [%s] does not support dwDesiredAccess 0x%08" PRIx32, __FUNCTION__, + lpName, dwDesiredAccess); if (dwFlags & CREATE_MUTEX_INITIAL_OWNER) initial = TRUE; @@ -238,7 +225,7 @@ BOOL ReleaseMutex(HANDLE hMutex) if (Type == HANDLE_TYPE_MUTEX) { - WINPR_MUTEX* mutex = (WINPR_MUTEX*) Object; + WINPR_MUTEX* mutex = (WINPR_MUTEX*)Object; int rc = pthread_mutex_unlock(&mutex->mutex); if (rc) diff --git a/winpr/libwinpr/synch/semaphore.c b/winpr/libwinpr/synch/semaphore.c index f3068b59d..795457f47 100644 --- a/winpr/libwinpr/synch/semaphore.c +++ b/winpr/libwinpr/synch/semaphore.c @@ -40,7 +40,7 @@ static BOOL SemaphoreCloseHandle(HANDLE handle); static BOOL SemaphoreIsHandled(HANDLE handle) { - WINPR_TIMER* pSemaphore = (WINPR_TIMER*) handle; + WINPR_TIMER* pSemaphore = (WINPR_TIMER*)handle; if (!pSemaphore || (pSemaphore->Type != HANDLE_TYPE_SEMAPHORE)) { @@ -82,7 +82,7 @@ static DWORD SemaphoreCleanupHandle(HANDLE handle) BOOL SemaphoreCloseHandle(HANDLE handle) { - WINPR_SEMAPHORE* semaphore = (WINPR_SEMAPHORE*) handle; + WINPR_SEMAPHORE* semaphore = (WINPR_SEMAPHORE*)handle; if (!SemaphoreIsHandled(handle)) return FALSE; @@ -103,52 +103,49 @@ BOOL SemaphoreCloseHandle(HANDLE handle) #else #if defined __APPLE__ - semaphore_destroy(mach_task_self(), *((winpr_sem_t*) semaphore->sem)); + semaphore_destroy(mach_task_self(), *((winpr_sem_t*)semaphore->sem)); #else - sem_destroy((winpr_sem_t*) semaphore->sem); + sem_destroy((winpr_sem_t*)semaphore->sem); #endif #endif free(semaphore); return TRUE; } -static HANDLE_OPS ops = -{ - SemaphoreIsHandled, - SemaphoreCloseHandle, - SemaphoreGetFd, - SemaphoreCleanupHandle, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL -}; +static HANDLE_OPS ops = { SemaphoreIsHandled, + SemaphoreCloseHandle, + SemaphoreGetFd, + SemaphoreCleanupHandle, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL }; HANDLE CreateSemaphoreW(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName) { HANDLE handle; WINPR_SEMAPHORE* semaphore; - semaphore = (WINPR_SEMAPHORE*) calloc(1, sizeof(WINPR_SEMAPHORE)); + semaphore = (WINPR_SEMAPHORE*)calloc(1, sizeof(WINPR_SEMAPHORE)); if (!semaphore) return NULL; semaphore->pipe_fd[0] = -1; semaphore->pipe_fd[1] = -1; - semaphore->sem = (winpr_sem_t*) NULL; + semaphore->sem = (winpr_sem_t*)NULL; semaphore->ops = &ops; #ifdef WINPR_PIPE_SEMAPHORE @@ -173,7 +170,7 @@ HANDLE CreateSemaphoreW(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lIniti } #else - semaphore->sem = (winpr_sem_t*) malloc(sizeof(winpr_sem_t)); + semaphore->sem = (winpr_sem_t*)malloc(sizeof(winpr_sem_t)); if (!semaphore->sem) { @@ -184,8 +181,8 @@ HANDLE CreateSemaphoreW(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lIniti #if defined __APPLE__ - if (semaphore_create(mach_task_self(), semaphore->sem, SYNC_POLICY_FIFO, - lMaximumCount) != KERN_SUCCESS) + if (semaphore_create(mach_task_self(), semaphore->sem, SYNC_POLICY_FIFO, lMaximumCount) != + KERN_SUCCESS) #else if (sem_init(semaphore->sem, 0, lMaximumCount) == -1) #endif @@ -198,7 +195,7 @@ HANDLE CreateSemaphoreW(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lIniti #endif WINPR_HANDLE_SET_TYPE_AND_MODE(semaphore, HANDLE_TYPE_SEMAPHORE, WINPR_FD_READ); - handle = (HANDLE) semaphore; + handle = (HANDLE)semaphore; return handle; } @@ -231,7 +228,7 @@ BOOL ReleaseSemaphore(HANDLE hSemaphore, LONG lReleaseCount, LPLONG lpPreviousCo if (Type == HANDLE_TYPE_SEMAPHORE) { - semaphore = (WINPR_SEMAPHORE*) Object; + semaphore = (WINPR_SEMAPHORE*)Object; #ifdef WINPR_PIPE_SEMAPHORE if (semaphore->pipe_fd[0] != -1) @@ -250,9 +247,9 @@ BOOL ReleaseSemaphore(HANDLE hSemaphore, LONG lReleaseCount, LPLONG lpPreviousCo while (lReleaseCount > 0) { #if defined __APPLE__ - semaphore_signal(*((winpr_sem_t*) semaphore->sem)); + semaphore_signal(*((winpr_sem_t*)semaphore->sem)); #else - sem_post((winpr_sem_t*) semaphore->sem); + sem_post((winpr_sem_t*)semaphore->sem); #endif } diff --git a/winpr/libwinpr/synch/sleep.c b/winpr/libwinpr/synch/sleep.c index 60a456ef7..23c819521 100644 --- a/winpr/libwinpr/synch/sleep.c +++ b/winpr/libwinpr/synch/sleep.c @@ -34,9 +34,9 @@ #include #ifdef HAVE_UNISTD_H - #ifndef _XOPEN_SOURCE - #define _XOPEN_SOURCE 500 - #endif +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE 500 +#endif #include #endif @@ -67,17 +67,20 @@ VOID USleep(DWORD dwMicroseconds) QueryPerformanceCounter(&t1); - if (freq.QuadPart == 0) { + if (freq.QuadPart == 0) + { QueryPerformanceFrequency(&freq); } // in order to save cpu cyles we use Sleep() for the large share ... - if (dwMicroseconds >= 1000) { - Sleep(dwMicroseconds/1000); + if (dwMicroseconds >= 1000) + { + Sleep(dwMicroseconds / 1000); } // ... and busy loop until all the requested micro seconds have passed - do { + do + { QueryPerformanceCounter(&t2); - } while (((t2.QuadPart - t1.QuadPart)*1000000)/freq.QuadPart < dwMicroseconds); + } while (((t2.QuadPart - t1.QuadPart) * 1000000) / freq.QuadPart < dwMicroseconds); #endif } diff --git a/winpr/libwinpr/synch/srw.c b/winpr/libwinpr/synch/srw.c index 67bd27c81..5def4e564 100644 --- a/winpr/libwinpr/synch/srw.c +++ b/winpr/libwinpr/synch/srw.c @@ -37,17 +37,14 @@ VOID InitializeSRWLock(PSRWLOCK SRWLock) { - } VOID AcquireSRWLockExclusive(PSRWLOCK SRWLock) { - } VOID AcquireSRWLockShared(PSRWLOCK SRWLock) { - } BOOL TryAcquireSRWLockExclusive(PSRWLOCK SRWLock) @@ -62,12 +59,10 @@ BOOL TryAcquireSRWLockShared(PSRWLOCK SRWLock) VOID ReleaseSRWLockExclusive(PSRWLOCK SRWLock) { - } VOID ReleaseSRWLockShared(PSRWLOCK SRWLock) { - } #endif diff --git a/winpr/libwinpr/synch/synch.h b/winpr/libwinpr/synch/synch.h index 26c598fa8..5bb64ea93 100644 --- a/winpr/libwinpr/synch/synch.h +++ b/winpr/libwinpr/synch/synch.h @@ -32,7 +32,7 @@ #ifndef _WIN32 -#define WINPR_PIPE_SEMAPHORE 1 +#define WINPR_PIPE_SEMAPHORE 1 #if defined __APPLE__ #include diff --git a/winpr/libwinpr/synch/test/TestSynchBarrier.c b/winpr/libwinpr/synch/test/TestSynchBarrier.c index 13922c70b..d5f7edf68 100644 --- a/winpr/libwinpr/synch/test/TestSynchBarrier.c +++ b/winpr/libwinpr/synch/test/TestSynchBarrier.c @@ -9,9 +9,9 @@ static SYNCHRONIZATION_BARRIER gBarrier; static HANDLE gStartEvent = NULL; -static LONG gErrorCount = 0; +static LONG gErrorCount = 0; -#define MAX_SLEEP_MS 32 +#define MAX_SLEEP_MS 32 struct test_params { @@ -22,7 +22,6 @@ struct test_params DWORD flags; }; - static DWORD WINAPI test_synch_barrier_thread(LPVOID lpParam) { BOOL status = FALSE; @@ -31,7 +30,7 @@ static DWORD WINAPI test_synch_barrier_thread(LPVOID lpParam) InterlockedIncrement(&p->threadCount); - //printf("Thread #%03u entered.\n", tnum); + // printf("Thread #%03u entered.\n", tnum); /* wait for start event from main */ if (WaitForSingleObject(gStartEvent, INFINITE) != WAIT_OBJECT_0) @@ -40,7 +39,7 @@ static DWORD WINAPI test_synch_barrier_thread(LPVOID lpParam) goto out; } - //printf("Thread #%03u unblocked.\n", tnum); + // printf("Thread #%03u unblocked.\n", tnum); for (i = 0; i < p->loops && gErrorCount == 0; i++) { @@ -48,7 +47,7 @@ static DWORD WINAPI test_synch_barrier_thread(LPVOID lpParam) Sleep(rand() % MAX_SLEEP_MS); status = EnterSynchronizationBarrier(&gBarrier, p->flags); - //printf("Thread #%03u status: %s\n", tnum, status ? "TRUE" : "FALSE"); + // printf("Thread #%03u status: %s\n", tnum, status ? "TRUE" : "FALSE"); if (status) InterlockedIncrement(&p->trueCount); else @@ -56,11 +55,10 @@ static DWORD WINAPI test_synch_barrier_thread(LPVOID lpParam) } out: - //printf("Thread #%03u leaving.\n", tnum); + // printf("Thread #%03u leaving.\n", tnum); return 0; } - static BOOL TestSynchBarrierWithFlags(DWORD dwFlags, DWORD dwThreads, DWORD dwLoops) { HANDLE* threads; @@ -68,13 +66,14 @@ static BOOL TestSynchBarrierWithFlags(DWORD dwFlags, DWORD dwThreads, DWORD dwLo DWORD dwStatus, expectedTrueCount, expectedFalseCount; DWORD i; p.threadCount = 0; - p.trueCount = 0; - p.falseCount = 0; + p.trueCount = 0; + p.falseCount = 0; p.loops = dwLoops; p.flags = dwFlags; expectedTrueCount = dwLoops; expectedFalseCount = dwLoops * (dwThreads - 1); - printf("%s: >> Testing with flags 0x%08"PRIx32". Using %"PRIu32" threads performing %"PRIu32" loops\n", + printf("%s: >> Testing with flags 0x%08" PRIx32 ". Using %" PRIu32 + " threads performing %" PRIu32 " loops\n", __FUNCTION__, dwFlags, dwThreads, dwLoops); if (!(threads = calloc(dwThreads, sizeof(HANDLE)))) @@ -85,8 +84,8 @@ static BOOL TestSynchBarrierWithFlags(DWORD dwFlags, DWORD dwThreads, DWORD dwLo if (!InitializeSynchronizationBarrier(&gBarrier, dwThreads, -1)) { - printf("%s: InitializeSynchronizationBarrier failed. GetLastError() = 0x%08x", - __FUNCTION__, GetLastError()); + printf("%s: InitializeSynchronizationBarrier failed. GetLastError() = 0x%08x", __FUNCTION__, + GetLastError()); free(threads); DeleteSynchronizationBarrier(&gBarrier); return FALSE; @@ -94,8 +93,7 @@ static BOOL TestSynchBarrierWithFlags(DWORD dwFlags, DWORD dwThreads, DWORD dwLo if (!(gStartEvent = CreateEvent(NULL, TRUE, FALSE, NULL))) { - printf("%s: CreateEvent failed with error 0x%08x", __FUNCTION__, - GetLastError()); + printf("%s: CreateEvent failed with error 0x%08x", __FUNCTION__, GetLastError()); free(threads); DeleteSynchronizationBarrier(&gBarrier); return FALSE; @@ -103,10 +101,9 @@ static BOOL TestSynchBarrierWithFlags(DWORD dwFlags, DWORD dwThreads, DWORD dwLo for (i = 0; i < dwThreads; i++) { - if (!(threads[i] = CreateThread(NULL, 0, test_synch_barrier_thread, &p, 0, - NULL))) + if (!(threads[i] = CreateThread(NULL, 0, test_synch_barrier_thread, &p, 0, NULL))) { - printf("%s: CreateThread failed for thread #%"PRIu32" with error 0x%08x\n", + printf("%s: CreateThread failed for thread #%" PRIu32 " with error 0x%08x\n", __FUNCTION__, i, GetLastError()); InterlockedIncrement(&gErrorCount); break; @@ -117,8 +114,8 @@ static BOOL TestSynchBarrierWithFlags(DWORD dwFlags, DWORD dwThreads, DWORD dwLo { if (!SetEvent(gStartEvent)) { - printf("%s: SetEvent(gStartEvent) failed with error = 0x%08x)\n", - __FUNCTION__, GetLastError()); + printf("%s: SetEvent(gStartEvent) failed with error = 0x%08x)\n", __FUNCTION__, + GetLastError()); InterlockedIncrement(&gErrorCount); } @@ -126,14 +123,15 @@ static BOOL TestSynchBarrierWithFlags(DWORD dwFlags, DWORD dwThreads, DWORD dwLo { if (WAIT_OBJECT_0 != (dwStatus = WaitForSingleObject(threads[i], INFINITE))) { - printf("%s: WaitForSingleObject(thread[%"PRIu32"] unexpectedly returned %"PRIu32" (error = 0x%08x)\n", + printf("%s: WaitForSingleObject(thread[%" PRIu32 "] unexpectedly returned %" PRIu32 + " (error = 0x%08x)\n", __FUNCTION__, i, dwStatus, GetLastError()); InterlockedIncrement(&gErrorCount); } if (!CloseHandle(threads[i])) { - printf("%s: CloseHandle(thread[%"PRIu32"]) failed with error = 0x%08x)\n", + printf("%s: CloseHandle(thread[%" PRIu32 "]) failed with error = 0x%08x)\n", __FUNCTION__, i, GetLastError()); InterlockedIncrement(&gErrorCount); } @@ -144,8 +142,8 @@ static BOOL TestSynchBarrierWithFlags(DWORD dwFlags, DWORD dwThreads, DWORD dwLo if (!CloseHandle(gStartEvent)) { - printf("%s: CloseHandle(gStartEvent) failed with error = 0x%08x)\n", - __FUNCTION__, GetLastError()); + printf("%s: CloseHandle(gStartEvent) failed with error = 0x%08x)\n", __FUNCTION__, + GetLastError()); InterlockedIncrement(&gErrorCount); } @@ -160,17 +158,17 @@ static BOOL TestSynchBarrierWithFlags(DWORD dwFlags, DWORD dwThreads, DWORD dwLo if (p.falseCount != (INT64)expectedFalseCount) InterlockedIncrement(&gErrorCount); - printf("%s: error count: %"PRId32"\n", __FUNCTION__, gErrorCount); - printf("%s: thread count: %"PRId32" (expected %"PRIu32")\n", __FUNCTION__, p.threadCount, + printf("%s: error count: %" PRId32 "\n", __FUNCTION__, gErrorCount); + printf("%s: thread count: %" PRId32 " (expected %" PRIu32 ")\n", __FUNCTION__, p.threadCount, dwThreads); - printf("%s: true count: %"PRId32" (expected %"PRIu32")\n", __FUNCTION__, p.trueCount, + printf("%s: true count: %" PRId32 " (expected %" PRIu32 ")\n", __FUNCTION__, p.trueCount, expectedTrueCount); - printf("%s: false count: %"PRId32" (expected %"PRIu32")\n", __FUNCTION__, p.falseCount, + printf("%s: false count: %" PRId32 " (expected %" PRIu32 ")\n", __FUNCTION__, p.falseCount, expectedFalseCount); if (gErrorCount > 0) { - printf("%s: Error test failed with %"PRId32" reported errors\n", __FUNCTION__, + printf("%s: Error test failed with %" PRId32 " reported errors\n", __FUNCTION__, gErrorCount); return FALSE; } @@ -178,7 +176,6 @@ static BOOL TestSynchBarrierWithFlags(DWORD dwFlags, DWORD dwThreads, DWORD dwLo return TRUE; } - int TestSynchBarrier(int argc, char* argv[]) { SYSTEM_INFO sysinfo; @@ -186,8 +183,7 @@ int TestSynchBarrier(int argc, char* argv[]) DWORD dwMinThreads; DWORD dwNumLoops = 200; GetNativeSystemInfo(&sysinfo); - printf("%s: Number of processors: %"PRIu32"\n", __FUNCTION__, - sysinfo.dwNumberOfProcessors); + printf("%s: Number of processors: %" PRIu32 "\n", __FUNCTION__, sysinfo.dwNumberOfProcessors); dwMinThreads = sysinfo.dwNumberOfProcessors; dwMaxThreads = sysinfo.dwNumberOfProcessors * 4; @@ -197,15 +193,17 @@ int TestSynchBarrier(int argc, char* argv[]) /* Test invalid parameters */ if (InitializeSynchronizationBarrier(&gBarrier, 0, -1)) { - printf("%s: InitializeSynchronizationBarrier unecpectedly succeeded with lTotalThreads = 0\n", - __FUNCTION__); + printf( + "%s: InitializeSynchronizationBarrier unecpectedly succeeded with lTotalThreads = 0\n", + __FUNCTION__); return -1; } if (InitializeSynchronizationBarrier(&gBarrier, -1, -1)) { - printf("%s: InitializeSynchronizationBarrier unecpectedly succeeded with lTotalThreads = -1\n", - __FUNCTION__); + printf( + "%s: InitializeSynchronizationBarrier unecpectedly succeeded with lTotalThreads = -1\n", + __FUNCTION__); return -1; } @@ -221,12 +219,12 @@ int TestSynchBarrier(int argc, char* argv[]) if (!TestSynchBarrierWithFlags(0, dwMaxThreads, dwNumLoops)) return -1; - if (!TestSynchBarrierWithFlags(SYNCHRONIZATION_BARRIER_FLAGS_SPIN_ONLY, - dwMinThreads, dwNumLoops)) + if (!TestSynchBarrierWithFlags(SYNCHRONIZATION_BARRIER_FLAGS_SPIN_ONLY, dwMinThreads, + dwNumLoops)) return -1; - if (!TestSynchBarrierWithFlags(SYNCHRONIZATION_BARRIER_FLAGS_BLOCK_ONLY, - dwMaxThreads, dwNumLoops)) + if (!TestSynchBarrierWithFlags(SYNCHRONIZATION_BARRIER_FLAGS_BLOCK_ONLY, dwMaxThreads, + dwNumLoops)) return -1; printf("%s: Test successfully completed\n", __FUNCTION__); diff --git a/winpr/libwinpr/synch/test/TestSynchCritical.c b/winpr/libwinpr/synch/test/TestSynchCritical.c index 3c1ab0ec4..f33ebd06c 100644 --- a/winpr/libwinpr/synch/test/TestSynchCritical.c +++ b/winpr/libwinpr/synch/test/TestSynchCritical.c @@ -40,15 +40,16 @@ static BOOL TestSynchCritical_TriggerAndCheckRaceCondition(HANDLE OwningThread, return TRUE; } -/* this thread function shall increment the global dwTestValue until the PBOOL passsed in arg is FALSE */ +/* this thread function shall increment the global dwTestValue until the PBOOL passsed in arg is + * FALSE */ static DWORD WINAPI TestSynchCritical_Test1(LPVOID arg) { int i, j, rc; - HANDLE hThread = (HANDLE) (ULONG_PTR) GetCurrentThreadId(); + HANDLE hThread = (HANDLE)(ULONG_PTR)GetCurrentThreadId(); PBOOL pbContinueRunning = (PBOOL)arg; - while(*pbContinueRunning) + while (*pbContinueRunning) { EnterCriticalSection(&critical); @@ -58,14 +59,14 @@ static DWORD WINAPI TestSynchCritical_Test1(LPVOID arg) return 1; /* add some random recursion level */ - j = rand()%5; - for (i=0; i 1) - dwSpinCountExpected = dwSpinCount+1; + dwSpinCountExpected = dwSpinCount + 1; #endif if (dwPreviousSpinCount != dwSpinCountExpected) { - printf("CriticalSection failure: SetCriticalSectionSpinCount returned %"PRIu32" (expected: %"PRIu32")\n", dwPreviousSpinCount, dwSpinCountExpected); + printf("CriticalSection failure: SetCriticalSectionSpinCount returned %" PRIu32 + " (expected: %" PRIu32 ")\n", + dwPreviousSpinCount, dwSpinCountExpected); goto fail; } DeleteCriticalSection(&critical); - if (dwSpinCount%2==0) + if (dwSpinCount % 2 == 0) InitializeCriticalSectionAndSpinCount(&critical, dwSpinCount); else InitializeCriticalSectionEx(&critical, dwSpinCount, 0); } DeleteCriticalSection(&critical); - /** - * Test single-threaded recursive TryEnterCriticalSection/EnterCriticalSection/LeaveCriticalSection + * Test single-threaded recursive + * TryEnterCriticalSection/EnterCriticalSection/LeaveCriticalSection * */ @@ -155,10 +159,11 @@ static DWORD WINAPI TestSynchCritical_Main(LPVOID arg) { if (critical.RecursionCount != i) { - printf("CriticalSection failure: RecursionCount field is %"PRId32" instead of %d.\n", critical.RecursionCount, i); + printf("CriticalSection failure: RecursionCount field is %" PRId32 " instead of %d.\n", + critical.RecursionCount, i); goto fail; } - if (i%2==0) + if (i % 2 == 0) { EnterCriticalSection(&critical); } @@ -166,13 +171,15 @@ static DWORD WINAPI TestSynchCritical_Main(LPVOID arg) { if (TryEnterCriticalSection(&critical) == FALSE) { - printf("CriticalSection failure: TryEnterCriticalSection failed where it should not.\n"); + printf("CriticalSection failure: TryEnterCriticalSection failed where it should " + "not.\n"); goto fail; } } if (critical.OwningThread != hMainThread) { - printf("CriticalSection failure: Could not verify section ownership (loop index=%d).\n", i); + printf("CriticalSection failure: Could not verify section ownership (loop index=%d).\n", + i); goto fail; } } @@ -181,25 +188,26 @@ static DWORD WINAPI TestSynchCritical_Main(LPVOID arg) LeaveCriticalSection(&critical); if (critical.RecursionCount != i) { - printf("CriticalSection failure: RecursionCount field is %"PRId32" instead of %d.\n", critical.RecursionCount, i); + printf("CriticalSection failure: RecursionCount field is %" PRId32 " instead of %d.\n", + critical.RecursionCount, i); goto fail; } if (critical.OwningThread != (HANDLE)(i ? hMainThread : NULL)) { - printf("CriticalSection failure: Could not verify section ownership (loop index=%d).\n", i); + printf("CriticalSection failure: Could not verify section ownership (loop index=%d).\n", + i); goto fail; } } DeleteCriticalSection(&critical); - /** * Test using multiple threads modifying the same value */ dwThreadCount = sysinfo.dwNumberOfProcessors > 1 ? sysinfo.dwNumberOfProcessors : 2; - hThreads = (HANDLE*) calloc(dwThreadCount, sizeof(HANDLE)); + hThreads = (HANDLE*)calloc(dwThreadCount, sizeof(HANDLE)); if (!hThreads) { printf("Problem allocating memory\n"); @@ -216,9 +224,10 @@ static DWORD WINAPI TestSynchCritical_Main(LPVOID arg) /* the TestSynchCritical_Test1 threads shall run until bTest1Running is FALSE */ bTest1Running = TRUE; - for (i = 0; i < (int) dwThreadCount; i++) + for (i = 0; i < (int)dwThreadCount; i++) { - if (!(hThreads[i] = CreateThread(NULL, 0, TestSynchCritical_Test1, &bTest1Running, 0, NULL))) + if (!(hThreads[i] = + CreateThread(NULL, 0, TestSynchCritical_Test1, &bTest1Running, 0, NULL))) { printf("CriticalSection failure: Failed to create test_1 thread #%d\n", i); goto fail; @@ -229,7 +238,7 @@ static DWORD WINAPI TestSynchCritical_Main(LPVOID arg) Sleep(TEST_SYNC_CRITICAL_TEST1_RUNTIME_MS); bTest1Running = FALSE; - for (i = 0; i < (int) dwThreadCount; i++) + for (i = 0; i < (int)dwThreadCount; i++) { if (WaitForSingleObject(hThreads[i], INFINITE) != WAIT_OBJECT_0) { @@ -237,9 +246,10 @@ static DWORD WINAPI TestSynchCritical_Main(LPVOID arg) goto fail; } GetExitCodeThread(hThreads[i], &dwThreadExitCode); - if(dwThreadExitCode != 0) + if (dwThreadExitCode != 0) { - printf("CriticalSection failure: Thread #%d returned error code %"PRIu32"\n", i, dwThreadExitCode); + printf("CriticalSection failure: Thread #%d returned error code %" PRIu32 "\n", i, + dwThreadExitCode); goto fail; } CloseHandle(hThreads[i]); @@ -247,7 +257,9 @@ static DWORD WINAPI TestSynchCritical_Main(LPVOID arg) if (gTestValueVulnerable != gTestValueSerialized) { - printf("CriticalSection failure: unexpected test value %"PRId32" (expected %"PRId32")\n", gTestValueVulnerable, gTestValueSerialized); + printf("CriticalSection failure: unexpected test value %" PRId32 " (expected %" PRId32 + ")\n", + gTestValueVulnerable, gTestValueSerialized); goto fail; } @@ -256,7 +268,6 @@ static DWORD WINAPI TestSynchCritical_Main(LPVOID arg) free(hThreads); - /** * TryEnterCriticalSection in thread must fail if we hold the lock in the main thread */ @@ -269,7 +280,7 @@ static DWORD WINAPI TestSynchCritical_Main(LPVOID arg) goto fail; } /* This thread tries to call TryEnterCriticalSection which must fail */ - if (!(hThread = CreateThread(NULL, 0, TestSynchCritical_Test2, NULL, 0, NULL))) + if (!(hThread = CreateThread(NULL, 0, TestSynchCritical_Test2, NULL, 0, NULL))) { printf("CriticalSection failure: Failed to create test_2 thread\n"); goto fail; @@ -280,9 +291,10 @@ static DWORD WINAPI TestSynchCritical_Main(LPVOID arg) goto fail; } GetExitCodeThread(hThread, &dwThreadExitCode); - if(dwThreadExitCode != 0) + if (dwThreadExitCode != 0) { - printf("CriticalSection failure: Thread returned error code %"PRIu32"\n", dwThreadExitCode); + printf("CriticalSection failure: Thread returned error code %" PRIu32 "\n", + dwThreadExitCode); goto fail; } CloseHandle(hThread); @@ -295,7 +307,6 @@ fail: return 1; } - int TestSynchCritical(int argc, char* argv[]) { BOOL bThreadTerminated = FALSE; @@ -304,9 +315,10 @@ int TestSynchCritical(int argc, char* argv[]) DWORD dwDeadLockDetectionTimeMs; DWORD i; - dwDeadLockDetectionTimeMs = 2 * TEST_SYNC_CRITICAL_TEST1_RUNTIME_MS * TEST_SYNC_CRITICAL_TEST1_RUNS; + dwDeadLockDetectionTimeMs = + 2 * TEST_SYNC_CRITICAL_TEST1_RUNTIME_MS * TEST_SYNC_CRITICAL_TEST1_RUNS; - printf("Deadlock will be assumed after %"PRIu32" ms.\n", dwDeadLockDetectionTimeMs); + printf("Deadlock will be assumed after %" PRIu32 " ms.\n", dwDeadLockDetectionTimeMs); if (!(hThread = CreateThread(NULL, 0, TestSynchCritical_Main, &bThreadTerminated, 0, NULL))) { @@ -316,7 +328,8 @@ int TestSynchCritical(int argc, char* argv[]) /** * We have to be able to detect dead locks in this test. - * At the time of writing winpr's WaitForSingleObject has not implemented timeout for thread wait + * At the time of writing winpr's WaitForSingleObject has not implemented timeout for thread + * wait * * Workaround checking the value of bThreadTerminated which is passed in the thread arg */ diff --git a/winpr/libwinpr/synch/test/TestSynchInit.c b/winpr/libwinpr/synch/test/TestSynchInit.c index 59e17a92f..d7f109a1c 100644 --- a/winpr/libwinpr/synch/test/TestSynchInit.c +++ b/winpr/libwinpr/synch/test/TestSynchInit.c @@ -4,19 +4,18 @@ #include #include -#define TEST_NUM_THREADS 100 -#define TEST_NUM_FAILURES 10 +#define TEST_NUM_THREADS 100 +#define TEST_NUM_FAILURES 10 static INIT_ONCE initOnceTest = INIT_ONCE_STATIC_INIT; static HANDLE hStartEvent = NULL; -static LONG *pErrors = NULL; -static LONG *pTestThreadFunctionCalls = NULL; -static LONG *pTestOnceFunctionCalls = NULL; -static LONG *pInitOnceExecuteOnceCalls = NULL; +static LONG* pErrors = NULL; +static LONG* pTestThreadFunctionCalls = NULL; +static LONG* pTestOnceFunctionCalls = NULL; +static LONG* pInitOnceExecuteOnceCalls = NULL; - -static BOOL CALLBACK TestOnceFunction(PINIT_ONCE once, PVOID param, PVOID *context) +static BOOL CALLBACK TestOnceFunction(PINIT_ONCE once, PVOID param, PVOID* context) { LONG calls = InterlockedIncrement(pTestOnceFunctionCalls) - 1; @@ -71,7 +70,8 @@ int TestSynchInit(int argc, char* argv[]) pTestOnceFunctionCalls = _aligned_malloc(sizeof(LONG), sizeof(LONG)); pInitOnceExecuteOnceCalls = _aligned_malloc(sizeof(LONG), sizeof(LONG)); - if (!pErrors || !pTestThreadFunctionCalls || !pTestOnceFunctionCalls || !pInitOnceExecuteOnceCalls) + if (!pErrors || !pTestThreadFunctionCalls || !pTestOnceFunctionCalls || + !pInitOnceExecuteOnceCalls) { fprintf(stderr, "error: _aligned_malloc failed\n"); goto out; @@ -93,7 +93,7 @@ int TestSynchInit(int argc, char* argv[]) { if (!(hThreads[i] = CreateThread(NULL, 0, TestThreadFunction, NULL, 0, NULL))) { - fprintf(stderr, "error creating thread #%"PRIu32"\n", i); + fprintf(stderr, "error creating thread #%" PRIu32 "\n", i); InterlockedIncrement(pErrors); goto out; } @@ -107,27 +107,29 @@ int TestSynchInit(int argc, char* argv[]) { if (WaitForSingleObject(hThreads[i], INFINITE) != WAIT_OBJECT_0) { - fprintf(stderr, "error: error waiting for thread #%"PRIu32"\n", i); + fprintf(stderr, "error: error waiting for thread #%" PRIu32 "\n", i); InterlockedIncrement(pErrors); goto out; } } - if (*pErrors == 0 && - *pTestThreadFunctionCalls == TEST_NUM_THREADS && - *pInitOnceExecuteOnceCalls == TEST_NUM_THREADS && - *pTestOnceFunctionCalls == TEST_NUM_FAILURES + 1) + if (*pErrors == 0 && *pTestThreadFunctionCalls == TEST_NUM_THREADS && + *pInitOnceExecuteOnceCalls == TEST_NUM_THREADS && + *pTestOnceFunctionCalls == TEST_NUM_FAILURES + 1) { result = TRUE; } out: fprintf(stderr, "Test result: %s\n", result ? "OK" : "ERROR"); - fprintf(stderr, "Error count: %"PRId32"\n", pErrors ? *pErrors : -1); - fprintf(stderr, "Threads created: %"PRIu32"\n", dwCreatedThreads); - fprintf(stderr, "TestThreadFunctionCalls: %"PRId32"\n", pTestThreadFunctionCalls ? *pTestThreadFunctionCalls : -1); - fprintf(stderr, "InitOnceExecuteOnceCalls: %"PRId32"\n", pInitOnceExecuteOnceCalls ? *pInitOnceExecuteOnceCalls : -1); - fprintf(stderr, "TestOnceFunctionCalls: %"PRId32"\n", pTestOnceFunctionCalls ? *pTestOnceFunctionCalls : -1); + fprintf(stderr, "Error count: %" PRId32 "\n", pErrors ? *pErrors : -1); + fprintf(stderr, "Threads created: %" PRIu32 "\n", dwCreatedThreads); + fprintf(stderr, "TestThreadFunctionCalls: %" PRId32 "\n", + pTestThreadFunctionCalls ? *pTestThreadFunctionCalls : -1); + fprintf(stderr, "InitOnceExecuteOnceCalls: %" PRId32 "\n", + pInitOnceExecuteOnceCalls ? *pInitOnceExecuteOnceCalls : -1); + fprintf(stderr, "TestOnceFunctionCalls: %" PRId32 "\n", + pTestOnceFunctionCalls ? *pTestOnceFunctionCalls : -1); _aligned_free(pErrors); _aligned_free(pTestThreadFunctionCalls); @@ -136,7 +138,6 @@ out: CloseHandle(hStartEvent); - for (i = 0; i < dwCreatedThreads; i++) { CloseHandle(hThreads[i]); diff --git a/winpr/libwinpr/synch/test/TestSynchMultipleThreads.c b/winpr/libwinpr/synch/test/TestSynchMultipleThreads.c index cfe53d80e..0fa567d74 100644 --- a/winpr/libwinpr/synch/test/TestSynchMultipleThreads.c +++ b/winpr/libwinpr/synch/test/TestSynchMultipleThreads.c @@ -15,17 +15,17 @@ static DWORD WINAPI test_thread(LPVOID arg) return 0; } -static int start_threads(DWORD count, HANDLE *threads) +static int start_threads(DWORD count, HANDLE* threads) { DWORD i; - for (i=0; i #include - static BOOL test_mutex_basic(void) { HANDLE mutex; @@ -19,7 +18,7 @@ static BOOL test_mutex_basic(void) if (rc != WAIT_OBJECT_0) { - printf("%s: WaitForSingleObject on mutex failed with %"PRIu32"\n", __FUNCTION__, rc); + printf("%s: WaitForSingleObject on mutex failed with %" PRIu32 "\n", __FUNCTION__, rc); return FALSE; } @@ -61,7 +60,8 @@ static BOOL test_mutex_recursive(void) if (rc != WAIT_OBJECT_0) { - printf("%s: WaitForSingleObject #%"PRIu32" on mutex failed with %"PRIu32"\n", __FUNCTION__, i, rc); + printf("%s: WaitForSingleObject #%" PRIu32 " on mutex failed with %" PRIu32 "\n", + __FUNCTION__, i, rc); return FALSE; } } @@ -70,7 +70,7 @@ static BOOL test_mutex_recursive(void) { if (!ReleaseMutex(mutex)) { - printf("%s: ReleaseMutex #%"PRIu32" failed\n", __FUNCTION__, i); + printf("%s: ReleaseMutex #%" PRIu32 " failed\n", __FUNCTION__, i); return FALSE; } } @@ -99,7 +99,7 @@ static BOOL test_mutex_recursive(void) static HANDLE thread1_mutex1 = NULL; static HANDLE thread1_mutex2 = NULL; -static BOOL thread1_failed = TRUE; +static BOOL thread1_failed = TRUE; static DWORD WINAPI test_mutex_thread1(LPVOID lpParam) { @@ -125,7 +125,8 @@ static DWORD WINAPI test_mutex_thread1(LPVOID lpParam) if (rc != WAIT_TIMEOUT) { fprintf(stderr, - "%s: WaitForSingleObject on thread1_mutex1 unexpectedly returned %"PRIu32" instead of WAIT_TIMEOUT (%u)\n", + "%s: WaitForSingleObject on thread1_mutex1 unexpectedly returned %" PRIu32 + " instead of WAIT_TIMEOUT (%u)\n", __FUNCTION__, rc, WAIT_TIMEOUT); return 0; } @@ -135,14 +136,15 @@ static DWORD WINAPI test_mutex_thread1(LPVOID lpParam) if (rc != WAIT_OBJECT_0) { fprintf(stderr, - "%s: WaitForSingleObject on thread1_mutex2 unexpectedly returned %"PRIu32" instead of WAIT_OBJECT_0\n", + "%s: WaitForSingleObject on thread1_mutex2 unexpectedly returned %" PRIu32 + " instead of WAIT_OBJECT_0\n", __FUNCTION__, rc); return 0; } if (!ReleaseMutex(thread1_mutex2)) { - fprintf(stderr, "%s: ReleaseMutex failed on thread1_mutex2\n", __FUNCTION__); + fprintf(stderr, "%s: ReleaseMutex failed on thread1_mutex2\n", __FUNCTION__); return 0; } diff --git a/winpr/libwinpr/synch/test/TestSynchSemaphore.c b/winpr/libwinpr/synch/test/TestSynchSemaphore.c index 3a9fa161c..572e1bbb7 100644 --- a/winpr/libwinpr/synch/test/TestSynchSemaphore.c +++ b/winpr/libwinpr/synch/test/TestSynchSemaphore.c @@ -18,4 +18,3 @@ int TestSynchSemaphore(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/synch/test/TestSynchThread.c b/winpr/libwinpr/synch/test/TestSynchThread.c index 50a0927a1..e480530dd 100644 --- a/winpr/libwinpr/synch/test/TestSynchThread.c +++ b/winpr/libwinpr/synch/test/TestSynchThread.c @@ -10,7 +10,7 @@ static DWORD WINAPI test_thread(LPVOID arg) return 0; } -int TestSynchThread(int argc, char *argv[]) +int TestSynchThread(int argc, char* argv[]) { DWORD rc; HANDLE thread; @@ -27,7 +27,7 @@ int TestSynchThread(int argc, char *argv[]) if (WAIT_TIMEOUT != rc) { - printf("Timed WaitForSingleObject on running thread failed with %"PRIu32"\n", rc); + printf("Timed WaitForSingleObject on running thread failed with %" PRIu32 "\n", rc); return -3; } @@ -36,7 +36,7 @@ int TestSynchThread(int argc, char *argv[]) if (WAIT_OBJECT_0 != rc) { - printf("WaitForSingleObject on thread failed with %"PRIu32"\n", rc); + printf("WaitForSingleObject on thread failed with %" PRIu32 "\n", rc); return -2; } @@ -45,7 +45,7 @@ int TestSynchThread(int argc, char *argv[]) if (WAIT_OBJECT_0 != rc) { - printf("Timed WaitForSingleObject on dead thread failed with %"PRIu32"\n", rc); + printf("Timed WaitForSingleObject on dead thread failed with %" PRIu32 "\n", rc); return -5; } @@ -68,7 +68,7 @@ int TestSynchThread(int argc, char *argv[]) if (WAIT_TIMEOUT != rc) { - printf("Timed WaitForSingleObject on running thread failed with %"PRIu32"\n", rc); + printf("Timed WaitForSingleObject on running thread failed with %" PRIu32 "\n", rc); return -3; } @@ -77,7 +77,7 @@ int TestSynchThread(int argc, char *argv[]) if (WAIT_OBJECT_0 != rc) { - printf("WaitForSingleObject on thread failed with %"PRIu32"\n", rc); + printf("WaitForSingleObject on thread failed with %" PRIu32 "\n", rc); return -2; } @@ -86,7 +86,7 @@ int TestSynchThread(int argc, char *argv[]) if (WAIT_OBJECT_0 != rc) { - printf("Timed WaitForSingleObject on dead thread failed with %"PRIu32"\n", rc); + printf("Timed WaitForSingleObject on dead thread failed with %" PRIu32 "\n", rc); return -5; } @@ -113,4 +113,3 @@ int TestSynchThread(int argc, char *argv[]) return 0; } - diff --git a/winpr/libwinpr/synch/test/TestSynchTimerQueue.c b/winpr/libwinpr/synch/test/TestSynchTimerQueue.c index 44b511620..67525f891 100644 --- a/winpr/libwinpr/synch/test/TestSynchTimerQueue.c +++ b/winpr/libwinpr/synch/test/TestSynchTimerQueue.c @@ -4,8 +4,8 @@ #include #include -#define FIRE_COUNT 5 -#define TIMER_COUNT 5 +#define FIRE_COUNT 5 +#define TIMER_COUNT 5 struct apc_data { @@ -29,15 +29,16 @@ VOID CALLBACK TimerRoutine(PVOID lpParam, BOOLEAN TimerOrWaitFired) if (!lpParam) return; - apcData = (APC_DATA*) lpParam; + apcData = (APC_DATA*)lpParam; TimerTime = CurrentTime - apcData->StartTime; expectedTime = apcData->DueTime + (apcData->Period * apcData->FireCount); apcData->FireCount++; - printf("TimerRoutine: TimerId: %"PRIu32" FireCount: %"PRIu32" ActualTime: %"PRIu32" ExpectedTime: %"PRIu32" Discrepancy: %"PRIu32"\n", - apcData->TimerId, apcData->FireCount, TimerTime, expectedTime, TimerTime - expectedTime); + printf("TimerRoutine: TimerId: %" PRIu32 " FireCount: %" PRIu32 " ActualTime: %" PRIu32 + " ExpectedTime: %" PRIu32 " Discrepancy: %" PRIu32 "\n", + apcData->TimerId, apcData->FireCount, TimerTime, expectedTime, TimerTime - expectedTime); Sleep(50); @@ -58,7 +59,7 @@ int TestSynchTimerQueue(int argc, char* argv[]) if (!hTimerQueue) { - printf("CreateTimerQueue failed (%"PRIu32")\n", GetLastError()); + printf("CreateTimerQueue failed (%" PRIu32 ")\n", GetLastError()); return -1; } @@ -73,14 +74,16 @@ int TestSynchTimerQueue(int argc, char* argv[]) if (!(apcData[index].CompletionEvent = CreateEvent(NULL, TRUE, FALSE, NULL))) { - printf("Failed to create apcData[%"PRIu32"] event (%"PRIu32")\n", index, GetLastError()); + printf("Failed to create apcData[%" PRIu32 "] event (%" PRIu32 ")\n", index, + GetLastError()); return -1; } - if (!CreateTimerQueueTimer(&hTimers[index], hTimerQueue, (WAITORTIMERCALLBACK) TimerRoutine, - &apcData[index], apcData[index].DueTime, apcData[index].Period, 0)) + if (!CreateTimerQueueTimer(&hTimers[index], hTimerQueue, (WAITORTIMERCALLBACK)TimerRoutine, + &apcData[index], apcData[index].DueTime, apcData[index].Period, + 0)) { - printf("CreateTimerQueueTimer failed (%"PRIu32")\n", GetLastError()); + printf("CreateTimerQueueTimer failed (%" PRIu32 ")\n", GetLastError()); return -1; } } @@ -89,7 +92,8 @@ int TestSynchTimerQueue(int argc, char* argv[]) { if (WaitForSingleObject(apcData[index].CompletionEvent, 20000) != WAIT_OBJECT_0) { - printf("Failed to wait for timer queue timer #%"PRIu32" (%"PRIu32")\n", index, GetLastError()); + printf("Failed to wait for timer queue timer #%" PRIu32 " (%" PRIu32 ")\n", index, + GetLastError()); return -1; } } @@ -102,7 +106,7 @@ int TestSynchTimerQueue(int argc, char* argv[]) */ if (!DeleteTimerQueueTimer(hTimerQueue, hTimers[index], INVALID_HANDLE_VALUE)) { - printf("DeleteTimerQueueTimer failed (%"PRIu32")\n", GetLastError()); + printf("DeleteTimerQueueTimer failed (%" PRIu32 ")\n", GetLastError()); return -1; } CloseHandle(apcData[index].CompletionEvent); @@ -110,7 +114,7 @@ int TestSynchTimerQueue(int argc, char* argv[]) if (!DeleteTimerQueue(hTimerQueue)) { - printf("DeleteTimerQueue failed (%"PRIu32")\n", GetLastError()); + printf("DeleteTimerQueue failed (%" PRIu32 ")\n", GetLastError()); return -1; } diff --git a/winpr/libwinpr/synch/test/TestSynchWaitableTimer.c b/winpr/libwinpr/synch/test/TestSynchWaitableTimer.c index 3d801d461..3c1abcc34 100644 --- a/winpr/libwinpr/synch/test/TestSynchWaitableTimer.c +++ b/winpr/libwinpr/synch/test/TestSynchWaitableTimer.c @@ -40,7 +40,8 @@ int TestSynchWaitableTimer(int argc, char* argv[]) if (status != WAIT_TIMEOUT) { - printf("WaitForSingleObject(timer, 2000) failure: Actual: 0x%08"PRIX32", Expected: 0x%08X\n", + printf("WaitForSingleObject(timer, 2000) failure: Actual: 0x%08" PRIX32 + ", Expected: 0x%08X\n", status, WAIT_TIMEOUT); goto out; } @@ -80,4 +81,3 @@ out: CloseHandle(timer); return result; } - diff --git a/winpr/libwinpr/synch/test/TestSynchWaitableTimerAPC.c b/winpr/libwinpr/synch/test/TestSynchWaitableTimerAPC.c index 19f90c60f..a91331390 100644 --- a/winpr/libwinpr/synch/test/TestSynchWaitableTimerAPC.c +++ b/winpr/libwinpr/synch/test/TestSynchWaitableTimerAPC.c @@ -22,8 +22,8 @@ static VOID CALLBACK TimerAPCProc(LPVOID lpArg, DWORD dwTimerLowValue, DWORD dwT if (!lpArg) return; - apcData = (APC_DATA*) lpArg; - printf("TimerAPCProc: time: %"PRIu32"\n", CurrentTime - apcData->StartTime); + apcData = (APC_DATA*)lpArg; + printf("TimerAPCProc: time: %" PRIu32 "\n", CurrentTime - apcData->StartTime); g_Count++; if (g_Count >= 5) @@ -62,16 +62,17 @@ int TestSynchWaitableTimerAPC(int argc, char* argv[]) goto cleanup; /** - * See Remarks at https://msdn.microsoft.com/en-us/library/windows/desktop/ms686786(v=vs.85).aspx - * The SetWaitableTimer completion routine is executed by the thread that activates the timer - * using SetWaitableTimer. However, the thread must be in an ALERTABLE state. + * See Remarks at + * https://msdn.microsoft.com/en-us/library/windows/desktop/ms686786(v=vs.85).aspx The + * SetWaitableTimer completion routine is executed by the thread that activates the timer using + * SetWaitableTimer. However, the thread must be in an ALERTABLE state. */ /** * Note: On WIN32 we need to use WaitForSingleObjectEx with parameter bAlertable = TRUE - * However, WinPR currently (May 2016) does not have a working WaitForSingleObjectEx implementation - * but its non-WIN32 WaitForSingleObject implementations seem to be alertable by WinPR's - * timer implementations. + * However, WinPR currently (May 2016) does not have a working WaitForSingleObjectEx + *implementation but its non-WIN32 WaitForSingleObject implementations seem to be alertable by + *WinPR's timer implementations. **/ for (;;) @@ -89,7 +90,7 @@ int TestSynchWaitableTimerAPC(int argc, char* argv[]) if (rc == 0x000000C0L) /* WAIT_IO_COMPLETION */ continue; - printf("Failed to wait for completion event (%"PRIu32")\n", GetLastError()); + printf("Failed to wait for completion event (%" PRIu32 ")\n", GetLastError()); goto cleanup; } @@ -104,4 +105,3 @@ cleanup: return status; } - diff --git a/winpr/libwinpr/synch/timer.c b/winpr/libwinpr/synch/timer.c index 0d453d6e0..255d7f954 100644 --- a/winpr/libwinpr/synch/timer.c +++ b/winpr/libwinpr/synch/timer.c @@ -47,7 +47,7 @@ static BOOL TimerCloseHandle(HANDLE handle); static BOOL TimerIsHandled(HANDLE handle) { - WINPR_TIMER* pTimer = (WINPR_TIMER*) handle; + WINPR_TIMER* pTimer = (WINPR_TIMER*)handle; if (!pTimer || (pTimer->Type != HANDLE_TYPE_TIMER)) { @@ -68,7 +68,7 @@ static int TimerGetFd(HANDLE handle) return timer->fd; } -static DWORD TimerCleanupHandle(HANDLE handle) +static DWORD TimerCleanupHandle(HANDLE handle) { int length; UINT64 expirations; @@ -80,7 +80,7 @@ static DWORD TimerCleanupHandle(HANDLE handle) if (timer->bManualReset) return WAIT_OBJECT_0; - length = read(timer->fd, (void*) &expirations, sizeof(UINT64)); + length = read(timer->fd, (void*)&expirations, sizeof(UINT64)); if (length != 8) { @@ -112,7 +112,7 @@ static DWORD TimerCleanupHandle(HANDLE handle) BOOL TimerCloseHandle(HANDLE handle) { WINPR_TIMER* timer; - timer = (WINPR_TIMER*) handle; + timer = (WINPR_TIMER*)handle; if (!TimerIsHandled(handle)) return FALSE; @@ -167,7 +167,8 @@ static void WaitableTimerHandler(void* arg) if (timer->lPeriod) { timer->timeout.it_interval.tv_sec = (timer->lPeriod / 1000); /* seconds */ - timer->timeout.it_interval.tv_nsec = ((timer->lPeriod % 1000) * 1000000); /* nanoseconds */ + timer->timeout.it_interval.tv_nsec = + ((timer->lPeriod % 1000) * 1000000); /* nanoseconds */ if ((timer_settime(timer->tid, 0, &(timer->timeout), NULL)) != 0) { @@ -259,7 +260,7 @@ static int InitializeWaitableTimer(WINPR_TIMER* timer) ZeroMemory(&sigev, sizeof(struct sigevent)); sigev.sigev_notify = SIGEV_SIGNAL; sigev.sigev_signo = SIGALRM; - sigev.sigev_value.sival_ptr = (void*) timer; + sigev.sigev_value.sival_ptr = (void*)timer; if ((timer_create(CLOCK_MONOTONIC, &sigev, &(timer->tid))) != 0) { @@ -278,30 +279,16 @@ static int InitializeWaitableTimer(WINPR_TIMER* timer) return result; } - -static HANDLE_OPS ops = -{ - TimerIsHandled, - TimerCloseHandle, - TimerGetFd, - TimerCleanupHandle, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL -}; +static HANDLE_OPS ops = { TimerIsHandled, TimerCloseHandle, + TimerGetFd, TimerCleanupHandle, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL }; /** * Waitable Timer @@ -316,12 +303,12 @@ HANDLE CreateWaitableTimerA(LPSECURITY_ATTRIBUTES lpTimerAttributes, BOOL bManua if (lpTimerAttributes) WLog_WARN(TAG, "%s [%s] does not support lpTimerAttributes", __FUNCTION__, lpTimerName); - timer = (WINPR_TIMER*) calloc(1, sizeof(WINPR_TIMER)); + timer = (WINPR_TIMER*)calloc(1, sizeof(WINPR_TIMER)); if (timer) { WINPR_HANDLE_SET_TYPE_AND_MODE(timer, HANDLE_TYPE_TIMER, WINPR_FD_READ); - handle = (HANDLE) timer; + handle = (HANDLE)timer; timer->fd = -1; timer->lPeriod = 0; timer->bManualReset = bManualReset; @@ -388,8 +375,8 @@ HANDLE CreateWaitableTimerExA(LPSECURITY_ATTRIBUTES lpTimerAttributes, LPCSTR lp BOOL bManualReset = (dwFlags & CREATE_WAITABLE_TIMER_MANUAL_RESET) ? TRUE : FALSE; if (dwDesiredAccess != 0) - WLog_WARN(TAG, "%s [%s] does not support dwDesiredAccess 0x%08"PRIx32, __FUNCTION__, lpTimerName, - dwDesiredAccess); + WLog_WARN(TAG, "%s [%s] does not support dwDesiredAccess 0x%08" PRIx32, __FUNCTION__, + lpTimerName, dwDesiredAccess); return CreateWaitableTimerA(lpTimerAttributes, bManualReset, lpTimerName); } @@ -411,7 +398,8 @@ HANDLE CreateWaitableTimerExW(LPSECURITY_ATTRIBUTES lpTimerAttributes, LPCWSTR l } BOOL SetWaitableTimer(HANDLE hTimer, const LARGE_INTEGER* lpDueTime, LONG lPeriod, - PTIMERAPCROUTINE pfnCompletionRoutine, LPVOID lpArgToCompletionRoutine, BOOL fResume) + PTIMERAPCROUTINE pfnCompletionRoutine, LPVOID lpArgToCompletionRoutine, + BOOL fResume) { ULONG Type; WINPR_HANDLE* Object; @@ -442,7 +430,7 @@ BOOL SetWaitableTimer(HANDLE hTimer, const LARGE_INTEGER* lpDueTime, LONG lPerio return FALSE; } - timer = (WINPR_TIMER*) Object; + timer = (WINPR_TIMER*)Object; timer->lPeriod = lPeriod; /* milliseconds */ timer->pfnCompletionRoutine = pfnCompletionRoutine; timer->lpArgToCompletionRoutine = lpArgToCompletionRoutine; @@ -475,18 +463,18 @@ BOOL SetWaitableTimer(HANDLE hTimer, const LARGE_INTEGER* lpDueTime, LONG lPerio if (lPeriod > 0) { - timer->timeout.it_interval.tv_sec = (lPeriod / 1000); /* seconds */ + timer->timeout.it_interval.tv_sec = (lPeriod / 1000); /* seconds */ timer->timeout.it_interval.tv_nsec = ((lPeriod % 1000) * 1000000); /* nanoseconds */ } if (lpDueTime->QuadPart != 0) { - timer->timeout.it_value.tv_sec = seconds; /* seconds */ + timer->timeout.it_value.tv_sec = seconds; /* seconds */ timer->timeout.it_value.tv_nsec = nanoseconds; /* nanoseconds */ } else { - timer->timeout.it_value.tv_sec = timer->timeout.it_interval.tv_sec; /* seconds */ + timer->timeout.it_value.tv_sec = timer->timeout.it_interval.tv_sec; /* seconds */ timer->timeout.it_value.tv_nsec = timer->timeout.it_interval.tv_nsec; /* nanoseconds */ } @@ -535,7 +523,8 @@ BOOL SetWaitableTimer(HANDLE hTimer, const LARGE_INTEGER* lpDueTime, LONG lPerio /* Clean out old data from FD */ BYTE buffer[32]; - while (read(timer->fd, buffer, sizeof(buffer)) > 0); + while (read(timer->fd, buffer, sizeof(buffer)) > 0) + ; } { @@ -558,11 +547,11 @@ BOOL SetWaitableTimer(HANDLE hTimer, const LARGE_INTEGER* lpDueTime, LONG lPerio } BOOL SetWaitableTimerEx(HANDLE hTimer, const LARGE_INTEGER* lpDueTime, LONG lPeriod, - PTIMERAPCROUTINE pfnCompletionRoutine, LPVOID lpArgToCompletionRoutine, PREASON_CONTEXT WakeContext, - ULONG TolerableDelay) + PTIMERAPCROUTINE pfnCompletionRoutine, LPVOID lpArgToCompletionRoutine, + PREASON_CONTEXT WakeContext, ULONG TolerableDelay) { - return SetWaitableTimer(hTimer, lpDueTime, lPeriod, pfnCompletionRoutine, lpArgToCompletionRoutine, - FALSE); + return SetWaitableTimer(hTimer, lpDueTime, lPeriod, pfnCompletionRoutine, + lpArgToCompletionRoutine, FALSE); } HANDLE OpenWaitableTimerA(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpTimerName) @@ -768,7 +757,7 @@ static void* TimerQueueThread(void* arg) { int status; struct timespec timeout; - WINPR_TIMER_QUEUE* timerQueue = (WINPR_TIMER_QUEUE*) arg; + WINPR_TIMER_QUEUE* timerQueue = (WINPR_TIMER_QUEUE*)arg; while (1) { @@ -818,12 +807,12 @@ HANDLE CreateTimerQueue(void) { HANDLE handle = NULL; WINPR_TIMER_QUEUE* timerQueue; - timerQueue = (WINPR_TIMER_QUEUE*) calloc(1, sizeof(WINPR_TIMER_QUEUE)); + timerQueue = (WINPR_TIMER_QUEUE*)calloc(1, sizeof(WINPR_TIMER_QUEUE)); if (timerQueue) { WINPR_HANDLE_SET_TYPE_AND_MODE(timerQueue, HANDLE_TYPE_TIMER_QUEUE, WINPR_FD_READ); - handle = (HANDLE) timerQueue; + handle = (HANDLE)timerQueue; timerQueue->activeHead = NULL; timerQueue->inactiveHead = NULL; timerQueue->bCancelled = FALSE; @@ -843,7 +832,7 @@ BOOL DeleteTimerQueueEx(HANDLE TimerQueue, HANDLE CompletionEvent) if (!TimerQueue) return FALSE; - timerQueue = (WINPR_TIMER_QUEUE*) TimerQueue; + timerQueue = (WINPR_TIMER_QUEUE*)TimerQueue; /* Cancel and delete timer queue timers */ pthread_mutex_lock(&(timerQueue->cond_mutex)); timerQueue->bCancelled = TRUE; @@ -901,8 +890,8 @@ BOOL DeleteTimerQueue(HANDLE TimerQueue) return DeleteTimerQueueEx(TimerQueue, NULL); } -BOOL CreateTimerQueueTimer(PHANDLE phNewTimer, HANDLE TimerQueue, - WAITORTIMERCALLBACK Callback, PVOID Parameter, DWORD DueTime, DWORD Period, ULONG Flags) +BOOL CreateTimerQueueTimer(PHANDLE phNewTimer, HANDLE TimerQueue, WAITORTIMERCALLBACK Callback, + PVOID Parameter, DWORD DueTime, DWORD Period, ULONG Flags) { struct timespec CurrentTime; WINPR_TIMER_QUEUE* timerQueue; @@ -912,14 +901,14 @@ BOOL CreateTimerQueueTimer(PHANDLE phNewTimer, HANDLE TimerQueue, return FALSE; timespec_gettimeofday(&CurrentTime); - timerQueue = (WINPR_TIMER_QUEUE*) TimerQueue; - timer = (WINPR_TIMER_QUEUE_TIMER*) malloc(sizeof(WINPR_TIMER_QUEUE_TIMER)); + timerQueue = (WINPR_TIMER_QUEUE*)TimerQueue; + timer = (WINPR_TIMER_QUEUE_TIMER*)malloc(sizeof(WINPR_TIMER_QUEUE_TIMER)); if (!timer) return FALSE; WINPR_HANDLE_SET_TYPE_AND_MODE(timer, HANDLE_TYPE_TIMER_QUEUE_TIMER, WINPR_FD_READ); - *((UINT_PTR*) phNewTimer) = (UINT_PTR)(HANDLE) timer; + *((UINT_PTR*)phNewTimer) = (UINT_PTR)(HANDLE)timer; timespec_copy(&(timer->StartTime), &CurrentTime); timespec_add_ms(&(timer->StartTime), DueTime); timespec_copy(&(timer->ExpirationTime), &(timer->StartTime)); @@ -928,7 +917,7 @@ BOOL CreateTimerQueueTimer(PHANDLE phNewTimer, HANDLE TimerQueue, timer->Period = Period; timer->Callback = Callback; timer->Parameter = Parameter; - timer->timerQueue = (WINPR_TIMER_QUEUE*) TimerQueue; + timer->timerQueue = (WINPR_TIMER_QUEUE*)TimerQueue; timer->FireCount = 0; timer->next = NULL; pthread_mutex_lock(&(timerQueue->cond_mutex)); @@ -948,8 +937,8 @@ BOOL ChangeTimerQueueTimer(HANDLE TimerQueue, HANDLE Timer, ULONG DueTime, ULONG return FALSE; timespec_gettimeofday(&CurrentTime); - timerQueue = (WINPR_TIMER_QUEUE*) TimerQueue; - timer = (WINPR_TIMER_QUEUE_TIMER*) Timer; + timerQueue = (WINPR_TIMER_QUEUE*)TimerQueue; + timer = (WINPR_TIMER_QUEUE_TIMER*)Timer; pthread_mutex_lock(&(timerQueue->cond_mutex)); RemoveTimerQueueTimer(&(timerQueue->activeHead), timer); RemoveTimerQueueTimer(&(timerQueue->inactiveHead), timer); @@ -973,8 +962,8 @@ BOOL DeleteTimerQueueTimer(HANDLE TimerQueue, HANDLE Timer, HANDLE CompletionEve if (!TimerQueue || !Timer) return FALSE; - timerQueue = (WINPR_TIMER_QUEUE*) TimerQueue; - timer = (WINPR_TIMER_QUEUE_TIMER*) Timer; + timerQueue = (WINPR_TIMER_QUEUE*)TimerQueue; + timer = (WINPR_TIMER_QUEUE_TIMER*)Timer; pthread_mutex_lock(&(timerQueue->cond_mutex)); /** * Quote from MSDN regarding CompletionEvent: diff --git a/winpr/libwinpr/synch/wait.c b/winpr/libwinpr/synch/wait.c index efefce53c..f4362ac39 100644 --- a/winpr/libwinpr/synch/wait.c +++ b/winpr/libwinpr/synch/wait.c @@ -83,8 +83,7 @@ /* clock_gettime is not implemented on OSX prior to 10.12 */ int _mach_clock_gettime(int clk_id, struct timespec* t); -int -_mach_clock_gettime(int clk_id, struct timespec* t) +int _mach_clock_gettime(int clk_id, struct timespec* t) { UINT64 time; double seconds; @@ -92,8 +91,8 @@ _mach_clock_gettime(int clk_id, struct timespec* t) mach_timebase_info_data_t timebase; mach_timebase_info(&timebase); time = mach_absolute_time(); - nseconds = ((double) time * (double) timebase.numer) / ((double) timebase.denom); - seconds = ((double) time * (double) timebase.numer) / ((double) timebase.denom * 1e9); + nseconds = ((double)time * (double)timebase.numer) / ((double)timebase.denom); + seconds = ((double)time * (double)timebase.numer) / ((double)timebase.denom * 1e9); t->tv_sec = seconds; t->tv_nsec = nseconds; return 0; @@ -105,8 +104,7 @@ _mach_clock_gettime(int clk_id, struct timespec* t) * * but it may be NULL at runtime. So we need to check before using it. */ int _mach_safe_clock_gettime(int clk_id, struct timespec* t); -int -_mach_safe_clock_gettime(int clk_id, struct timespec* t) +int _mach_safe_clock_gettime(int clk_id, struct timespec* t) { if (clock_gettime) { @@ -123,9 +121,7 @@ _mach_safe_clock_gettime(int clk_id, struct timespec* t) #endif - -static long long ts_difftime(const struct timespec* o, - const struct timespec* n) +static long long ts_difftime(const struct timespec* o, const struct timespec* n) { long long oldValue = o->tv_sec * 1000000000LL + o->tv_nsec; long long newValue = n->tv_sec * 1000000000LL + n->tv_nsec; @@ -200,8 +196,7 @@ static int waitOnFd(int fd, ULONG mode, DWORD dwMilliseconds) do { status = poll(&pollfds, 1, dwMilliseconds); - } - while ((status < 0) && (errno == EINTR)); + } while ((status < 0) && (errno == EINTR)); #else struct timeval timeout; @@ -229,9 +224,9 @@ static int waitOnFd(int fd, ULONG mode, DWORD dwMilliseconds) do { - status = select(fd + 1, prfds, pwfds, pefds, (dwMilliseconds == INFINITE) ? NULL : &timeout); - } - while (status < 0 && (errno == EINTR)); + status = + select(fd + 1, prfds, pwfds, pefds, (dwMilliseconds == INFINITE) ? NULL : &timeout); + } while (status < 0 && (errno == EINTR)); #endif return status; @@ -252,7 +247,7 @@ DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds) if (Type == HANDLE_TYPE_PROCESS) { WINPR_PROCESS* process; - process = (WINPR_PROCESS*) Object; + process = (WINPR_PROCESS*)Object; if (process->pid != waitpid(process->pid, &(process->status), 0)) { @@ -261,13 +256,13 @@ DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds) return WAIT_FAILED; } - process->dwExitCode = (DWORD) process->status; + process->dwExitCode = (DWORD)process->status; return WAIT_OBJECT_0; } else if (Type == HANDLE_TYPE_MUTEX) { WINPR_MUTEX* mutex; - mutex = (WINPR_MUTEX*) Object; + mutex = (WINPR_MUTEX*)Object; if (dwMilliseconds != INFINITE) { @@ -356,7 +351,7 @@ DWORD WaitForMultipleObjects(DWORD nCount, const HANDLE* lpHandles, BOOL bWaitAl if (!nCount || (nCount > MAXIMUM_WAIT_OBJECTS)) { - WLog_ERR(TAG, "invalid handles count(%"PRIu32")", nCount); + WLog_ERR(TAG, "invalid handles count(%" PRIu32 ")", nCount); return WAIT_FAILED; } @@ -441,8 +436,7 @@ DWORD WaitForMultipleObjects(DWORD nCount, const HANDLE* lpHandles, BOOL bWaitAl do { status = poll(pollfds, polled, dwMilliseconds); - } - while (status < 0 && errno == EINTR); + } while (status < 0 && errno == EINTR); #else @@ -454,20 +448,19 @@ DWORD WaitForMultipleObjects(DWORD nCount, const HANDLE* lpHandles, BOOL bWaitAl do { - status = select(maxfd + 1, prfds, pwfds, 0, - (dwMilliseconds == INFINITE) ? NULL : &timeout); - } - while (status < 0 && errno == EINTR); + status = + select(maxfd + 1, prfds, pwfds, 0, (dwMilliseconds == INFINITE) ? NULL : &timeout); + } while (status < 0 && errno == EINTR); #endif if (status < 0) { #ifdef HAVE_POLL_H - WLog_ERR(TAG, "poll() handle %d (%"PRIu32") failure [%d] %s", index, nCount, errno, + WLog_ERR(TAG, "poll() handle %d (%" PRIu32 ") failure [%d] %s", index, nCount, errno, strerror(errno)); #else - WLog_ERR(TAG, "select() handle %d (%"PRIu32") failure [%d] %s", index, nCount, errno, + WLog_ERR(TAG, "select() handle %d (%" PRIu32 ") failure [%d] %s", index, nCount, errno, strerror(errno)); #endif winpr_log_backtrace(TAG, WLOG_ERROR, 20); @@ -557,8 +550,7 @@ DWORD WaitForMultipleObjects(DWORD nCount, const HANDLE* lpHandles, BOOL bWaitAl signal_handled = TRUE; } } - } - while (bWaitAll || !signal_handled); + } while (bWaitAll || !signal_handled); WLog_ERR(TAG, "failed (unknown error)"); SetLastError(ERROR_INTERNAL_ERROR); @@ -587,4 +579,3 @@ DWORD SignalObjectAndWait(HANDLE hObjectToSignal, HANDLE hObjectToWaitOn, DWORD } #endif - diff --git a/winpr/libwinpr/sysinfo/cpufeatures/cpu-features.c b/winpr/libwinpr/sysinfo/cpufeatures/cpu-features.c index acdfa3417..a5a0bf19a 100644 --- a/winpr/libwinpr/sysinfo/cpufeatures/cpu-features.c +++ b/winpr/libwinpr/sysinfo/cpufeatures/cpu-features.c @@ -73,23 +73,26 @@ #include #include -static pthread_once_t g_once; -static int g_inited; -static AndroidCpuFamily g_cpuFamily; -static uint64_t g_cpuFeatures; -static int g_cpuCount; +static pthread_once_t g_once; +static int g_inited; +static AndroidCpuFamily g_cpuFamily; +static uint64_t g_cpuFeatures; +static int g_cpuCount; #ifdef __arm__ -static uint32_t g_cpuIdArm; +static uint32_t g_cpuIdArm; #endif static const int android_cpufeatures_debug = 0; -#define D(...) \ - do { \ - if (android_cpufeatures_debug) { \ - printf(__VA_ARGS__); fflush(stdout); \ - } \ +#define D(...) \ + do \ + { \ + if (android_cpufeatures_debug) \ + { \ + printf(__VA_ARGS__); \ + fflush(stdout); \ + } \ } while (0) #ifdef __i386__ @@ -98,14 +101,12 @@ static __inline__ void x86_cpuid(int func, int values[4]) int a, b, c, d; /* We need to preserve ebx since we're compiling PIC code */ /* this means we can't use "=b" for the second output register */ - __asm__ __volatile__(\ - "push %%ebx\n" - "cpuid\n" \ + __asm__ __volatile__("push %%ebx\n" + "cpuid\n" "mov %%ebx, %1\n" "pop %%ebx\n" - : "=a"(a), "=r"(b), "=c"(c), "=d"(d) \ - : "a"(func) \ - ); + : "=a"(a), "=r"(b), "=c"(c), "=d"(d) + : "a"(func)); values[0] = a; values[1] = b; values[2] = c; @@ -117,14 +118,12 @@ static __inline__ void x86_cpuid(int func, int values[4]) int64_t a, b, c, d; /* We need to preserve ebx since we're compiling PIC code */ /* this means we can't use "=b" for the second output register */ - __asm__ __volatile__(\ - "push %%rbx\n" - "cpuid\n" \ + __asm__ __volatile__("push %%rbx\n" + "cpuid\n" "mov %%rbx, %1\n" "pop %%rbx\n" - : "=a"(a), "=r"(b), "=c"(c), "=d"(d) \ - : "a"(func) \ - ); + : "=a"(a), "=r"(b), "=c"(c), "=d"(d) + : "a"(func)); values[0] = a; values[1] = b; values[2] = c; @@ -136,8 +135,7 @@ static __inline__ void x86_cpuid(int func, int values[4]) * because files under /proc do not always return a valid size when * using fseek(0, SEEK_END) + ftell(). Nor can they be mmap()-ed. */ -static int -get_file_size(const char* pathname) +static int get_file_size(const char* pathname) { int fd, result = 0; char buffer[256]; @@ -177,10 +175,9 @@ get_file_size(const char* pathname) * zero-terminate the content. Will not read more * than 'buffsize' bytes. */ -static int -read_file(const char* pathname, char* buffer, size_t buffsize) +static int read_file(const char* pathname, char* buffer, size_t buffsize) { - int fd, count; + int fd, count; fd = open(pathname, O_RDONLY); if (fd < 0) @@ -225,14 +222,13 @@ read_file(const char* pathname, char* buffer, size_t buffsize) * * Return NULL if not found */ -static char* -extract_cpuinfo_field(const char* buffer, int buflen, const char* field) +static char* extract_cpuinfo_field(const char* buffer, int buflen, const char* field) { - int fieldlen = strlen(field); + int fieldlen = strlen(field); const char* bufend = buffer + buflen; char* result = NULL; int len; - const char* p, *q; + const char *p, *q; /* Look for first field occurence, and ensures it starts the line. */ p = buffer; @@ -251,7 +247,7 @@ extract_cpuinfo_field(const char* buffer, int buflen, const char* field) /* Skip to the first column followed by a space */ p += fieldlen; - p = memchr(p, ':', bufend - p); + p = memchr(p, ':', bufend - p); if (p == NULL || p[1] != ' ') goto EXIT; @@ -279,10 +275,9 @@ EXIT: /* Checks that a space-separated list of items contains one given 'item'. * Returns 1 if found, 0 otherwise. */ -static int -has_list_item(const char* list, const char* item) +static int has_list_item(const char* list, const char* item) { - const char* p = list; + const char* p = list; int itemlen = strlen(item); if (list == NULL) @@ -290,7 +285,7 @@ has_list_item(const char* list, const char* item) while (*p) { - const char* q; + const char* q; /* skip spaces */ while (*p == ' ' || *p == '\t') @@ -323,8 +318,7 @@ has_list_item(const char* list, const char* item) * position after the decimal number in case of success (which will always * be <= 'limit'). */ -static const char* -parse_number(const char* input, const char* limit, int base, int* result) +static const char* parse_number(const char* input, const char* limit, int base, int* result) { const char* p = input; int val = 0; @@ -360,15 +354,13 @@ parse_number(const char* input, const char* limit, int base, int* result) return p; } -static const char* -parse_decimal(const char* input, const char* limit, int* result) +static const char* parse_decimal(const char* input, const char* limit, int* result) { return parse_number(input, limit, 10, result); } #ifdef __arm__ -static const char* -parse_hexadecimal(const char* input, const char* limit, int* result) +static const char* parse_hexadecimal(const char* input, const char* limit, int* result) { return parse_number(input, limit, 16, result); } @@ -385,20 +377,17 @@ typedef struct uint32_t mask; } CpuList; -static __inline__ void -cpulist_init(CpuList* list) +static __inline__ void cpulist_init(CpuList* list) { list->mask = 0; } -static __inline__ void -cpulist_and(CpuList* list1, CpuList* list2) +static __inline__ void cpulist_and(CpuList* list1, CpuList* list2) { list1->mask &= list2->mask; } -static __inline__ void -cpulist_set(CpuList* list, int index) +static __inline__ void cpulist_set(CpuList* list, int index) { if ((unsigned)index < 32) { @@ -406,8 +395,7 @@ cpulist_set(CpuList* list, int index) } } -static __inline__ int -cpulist_count(CpuList* list) +static __inline__ int cpulist_count(CpuList* list) { return __builtin_popcount(list->mask); } @@ -422,8 +410,7 @@ cpulist_count(CpuList* list) * 2,4-127,128-143 * 0-1 */ -static void -cpulist_parse(CpuList* list, const char* line, int line_len) +static void cpulist_parse(CpuList* list, const char* line, int line_len) { const char* p = line; const char* end = p + line_len; @@ -475,16 +462,14 @@ cpulist_parse(CpuList* list, const char* line, int line_len) p++; } -BAD_FORMAT: - ; +BAD_FORMAT:; } /* Read a CPU list from one sysfs file */ -static void -cpulist_read_from(CpuList* list, const char* filename) +static void cpulist_read_from(CpuList* list, const char* filename) { - char file[64]; - int filelen; + char file[64]; + int filelen; cpulist_init(list); filelen = read_file(filename, file, sizeof file); @@ -498,50 +483,45 @@ cpulist_read_from(CpuList* list, const char* filename) } #if defined(__aarch64__) // see kernel header -#define HWCAP_FP (1 << 0) -#define HWCAP_ASIMD (1 << 1) -#define HWCAP_AES (1 << 3) -#define HWCAP_PMULL (1 << 4) -#define HWCAP_SHA1 (1 << 5) -#define HWCAP_SHA2 (1 << 6) -#define HWCAP_CRC32 (1 << 7) +#define HWCAP_FP (1 << 0) +#define HWCAP_ASIMD (1 << 1) +#define HWCAP_AES (1 << 3) +#define HWCAP_PMULL (1 << 4) +#define HWCAP_SHA1 (1 << 5) +#define HWCAP_SHA2 (1 << 6) +#define HWCAP_CRC32 (1 << 7) #endif #if defined(__arm__) // See kernel header. -#define HWCAP_VFP (1 << 6) -#define HWCAP_IWMMXT (1 << 9) -#define HWCAP_NEON (1 << 12) -#define HWCAP_VFPv3 (1 << 13) -#define HWCAP_VFPv3D16 (1 << 14) -#define HWCAP_VFPv4 (1 << 16) -#define HWCAP_IDIVA (1 << 17) -#define HWCAP_IDIVT (1 << 18) +#define HWCAP_VFP (1 << 6) +#define HWCAP_IWMMXT (1 << 9) +#define HWCAP_NEON (1 << 12) +#define HWCAP_VFPv3 (1 << 13) +#define HWCAP_VFPv3D16 (1 << 14) +#define HWCAP_VFPv4 (1 << 16) +#define HWCAP_IDIVA (1 << 17) +#define HWCAP_IDIVT (1 << 18) // see kernel header -#define HWCAP2_AES (1 << 0) -#define HWCAP2_PMULL (1 << 1) -#define HWCAP2_SHA1 (1 << 2) -#define HWCAP2_SHA2 (1 << 3) -#define HWCAP2_CRC32 (1 << 4) +#define HWCAP2_AES (1 << 0) +#define HWCAP2_PMULL (1 << 1) +#define HWCAP2_SHA1 (1 << 2) +#define HWCAP2_SHA2 (1 << 3) +#define HWCAP2_CRC32 (1 << 4) // This is the list of 32-bit ARMv7 optional features that are _always_ // supported by ARMv8 CPUs, as mandated by the ARM Architecture Reference // Manual. -#define HWCAP_SET_FOR_ARMV8 \ - ( HWCAP_VFP | \ - HWCAP_NEON | \ - HWCAP_VFPv3 | \ - HWCAP_VFPv4 | \ - HWCAP_IDIVA | \ - HWCAP_IDIVT ) +#define HWCAP_SET_FOR_ARMV8 \ + (HWCAP_VFP | HWCAP_NEON | HWCAP_VFPv3 | HWCAP_VFPv4 | HWCAP_IDIVA | HWCAP_IDIVT) #endif #if defined(__mips__) // see kernel header -#define HWCAP_MIPS_R6 (1 << 0) -#define HWCAP_MIPS_MSA (1 << 1) +#define HWCAP_MIPS_R6 (1 << 0) +#define HWCAP_MIPS_MSA (1 << 1) #endif #if defined(__arm__) || defined(__aarch64__) || defined(__mips__) @@ -563,8 +543,7 @@ cpulist_read_from(CpuList* list, const char* filename) // its implementation does not parse /proc/self/auxv. Instead it depends // on values that are passed by the kernel at process-init time to the // C runtime initialization layer. -static uint32_t -get_elf_hwcap_from_getauxval(int hwcap_type) +static uint32_t get_elf_hwcap_from_getauxval(int hwcap_type) { typedef unsigned long getauxval_func_t(unsigned long); dlerror(); @@ -577,8 +556,7 @@ get_elf_hwcap_from_getauxval(int hwcap_type) } uint32_t ret = 0; - getauxval_func_t* func = (getauxval_func_t*) - dlsym(libc_handle, "getauxval"); + getauxval_func_t* func = (getauxval_func_t*)dlsym(libc_handle, "getauxval"); if (!func) { @@ -600,8 +578,7 @@ get_elf_hwcap_from_getauxval(int hwcap_type) // current CPU. Note that this file is not accessible from regular // application processes on some Android platform releases. // On success, return new ELF hwcaps, or 0 on failure. -static uint32_t -get_elf_hwcap_from_proc_self_auxv(void) +static uint32_t get_elf_hwcap_from_proc_self_auxv(void) { const char filepath[] = "/proc/self/auxv"; int fd = TEMP_FAILURE_RETRY(open(filepath, O_RDONLY)); @@ -650,8 +627,7 @@ get_elf_hwcap_from_proc_self_auxv(void) * features the device's CPU supports, on top of its reference * architecture. */ -static uint32_t -get_elf_hwcap_from_proc_cpuinfo(const char* cpuinfo, int cpuinfo_len) +static uint32_t get_elf_hwcap_from_proc_cpuinfo(const char* cpuinfo, int cpuinfo_len) { uint32_t hwcaps = 0; long architecture = 0; @@ -711,7 +687,7 @@ get_elf_hwcap_from_proc_cpuinfo(const char* cpuinfo, int cpuinfo_len) return hwcaps; } -#endif /* __arm__ */ +#endif /* __arm__ */ /* Return the number of cpus present on a given device. * @@ -719,8 +695,7 @@ get_elf_hwcap_from_proc_cpuinfo(const char* cpuinfo, int cpuinfo_len) * intersection of the 'present' and 'possible' CPU lists and count * the result. */ -static int -get_cpu_count(void) +static int get_cpu_count(void) { CpuList cpus_present[1]; CpuList cpus_possible[1]; @@ -733,8 +708,7 @@ get_cpu_count(void) return cpulist_count(cpus_present); } -static void -android_cpuInitFamily(void) +static void android_cpuInitFamily(void) { #if defined(__arm__) g_cpuFamily = ANDROID_CPU_FAMILY_ARM; @@ -754,15 +728,14 @@ android_cpuInitFamily(void) #endif } -static void -android_cpuInit(void) +static void android_cpuInit(void) { char* cpuinfo = NULL; - int cpuinfo_len; + int cpuinfo_len; android_cpuInitFamily(); g_cpuFeatures = 0; - g_cpuCount = 1; - g_inited = 1; + g_cpuCount = 1; + g_inited = 1; cpuinfo_len = get_file_size("/proc/cpuinfo"); if (cpuinfo_len < 0) @@ -780,10 +753,9 @@ android_cpuInit(void) } cpuinfo_len = read_file("/proc/cpuinfo", cpuinfo, cpuinfo_len); - D("cpuinfo_len is (%d):\n%.*s\n", cpuinfo_len, - cpuinfo_len >= 0 ? cpuinfo_len : 0, cpuinfo); + D("cpuinfo_len is (%d):\n%.*s\n", cpuinfo_len, cpuinfo_len >= 0 ? cpuinfo_len : 0, cpuinfo); - if (cpuinfo_len < 0) /* should not happen */ + if (cpuinfo_len < 0) /* should not happen */ { free(cpuinfo); return; @@ -812,9 +784,9 @@ android_cpuInit(void) if (cpuArch != NULL) { - char* end; - long archNumber; - int hasARMv7 = 0; + char* end; + long archNumber; + int hasARMv7 = 0; D("found cpuArch = '%s'\n", cpuArch); /* read the initial decimal number, ignore the rest */ archNumber = strtol(cpuArch, &end, 10); @@ -837,8 +809,7 @@ android_cpuInit(void) */ if (hasARMv7) { - char* cpuProc = extract_cpuinfo_field(cpuinfo, cpuinfo_len, - "Processor"); + char* cpuProc = extract_cpuinfo_field(cpuinfo, cpuinfo_len, "Processor"); if (cpuProc != NULL) { @@ -903,8 +874,7 @@ android_cpuInit(void) // 'vfpv4' implies VFPv3|VFP_FMA|FP16 if (has_vfpv4) - g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_VFPv3 | - ANDROID_CPU_ARM_FEATURE_VFP_FP16 | + g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_VFPv3 | ANDROID_CPU_ARM_FEATURE_VFP_FP16 | ANDROID_CPU_ARM_FEATURE_VFP_FMA; // 'vfpv3' or 'vfpv3d16' imply VFPv3. Note that unlike GCC, @@ -928,8 +898,7 @@ android_cpuInit(void) // Neon implies VFPv3|D32, and if vfpv4 is detected, NEON_FMA if (has_neon) { - g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_VFPv3 | - ANDROID_CPU_ARM_FEATURE_NEON | + g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_VFPv3 | ANDROID_CPU_ARM_FEATURE_NEON | ANDROID_CPU_ARM_FEATURE_VFP_D32; if (has_vfpv4) @@ -938,8 +907,7 @@ android_cpuInit(void) // VFPv3 implies VFPv2 and ARMv7 if (g_cpuFeatures & ANDROID_CPU_ARM_FEATURE_VFPv3) - g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_VFPv2 | - ANDROID_CPU_ARM_FEATURE_ARMv7; + g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_VFPv2 | ANDROID_CPU_ARM_FEATURE_ARMv7; if (has_idiva) g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_IDIV_ARM; @@ -957,11 +925,11 @@ android_cpuInit(void) if (hwcaps2 != 0) { - int has_aes = (hwcaps2 & HWCAP2_AES); - int has_pmull = (hwcaps2 & HWCAP2_PMULL); - int has_sha1 = (hwcaps2 & HWCAP2_SHA1); - int has_sha2 = (hwcaps2 & HWCAP2_SHA2); - int has_crc32 = (hwcaps2 & HWCAP2_CRC32); + int has_aes = (hwcaps2 & HWCAP2_AES); + int has_pmull = (hwcaps2 & HWCAP2_PMULL); + int has_sha1 = (hwcaps2 & HWCAP2_SHA1); + int has_sha2 = (hwcaps2 & HWCAP2_SHA2); + int has_crc32 = (hwcaps2 & HWCAP2_CRC32); if (has_aes) g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_AES; @@ -985,11 +953,10 @@ android_cpuInit(void) static const struct CpuIdEntry { const char* field; - char format; - char bit_lshift; - char bit_length; - } cpu_id_entries[] = - { + char format; + char bit_lshift; + char bit_length; + } cpu_id_entries[] = { { "CPU implementer", 'x', 24, 8 }, { "CPU variant", 'x', 20, 4 }, { "CPU part", 'x', 4, 12 }, @@ -998,14 +965,10 @@ android_cpuInit(void) size_t i; D("Parsing /proc/cpuinfo to recover CPUID\n"); - for (i = 0; - i < sizeof(cpu_id_entries) / sizeof(cpu_id_entries[0]); - ++i) + for (i = 0; i < sizeof(cpu_id_entries) / sizeof(cpu_id_entries[0]); ++i) { const struct CpuIdEntry* entry = &cpu_id_entries[i]; - char* value = extract_cpuinfo_field(cpuinfo, - cpuinfo_len, - entry->field); + char* value = extract_cpuinfo_field(cpuinfo, cpuinfo_len, entry->field); if (value == NULL) continue; @@ -1030,7 +993,7 @@ android_cpuInit(void) { val &= ((1 << entry->bit_length) - 1); val <<= entry->bit_lshift; - g_cpuIdArm |= (uint32_t) val; + g_cpuIdArm |= (uint32_t)val; } free(value); @@ -1040,20 +1003,13 @@ android_cpuInit(void) // reporting of CPU features. static const struct CpuFix { - uint32_t cpuid; - uint64_t or_flags; - } cpu_fixes[] = - { + uint32_t cpuid; + uint64_t or_flags; + } cpu_fixes[] = { /* The Nexus 4 (Qualcomm Krait) kernel configuration * forgets to report IDIV support. */ - { - 0x510006f2, ANDROID_CPU_ARM_FEATURE_IDIV_ARM | - ANDROID_CPU_ARM_FEATURE_IDIV_THUMB2 - }, - { - 0x510006f3, ANDROID_CPU_ARM_FEATURE_IDIV_ARM | - ANDROID_CPU_ARM_FEATURE_IDIV_THUMB2 - }, + { 0x510006f2, ANDROID_CPU_ARM_FEATURE_IDIV_ARM | ANDROID_CPU_ARM_FEATURE_IDIV_THUMB2 }, + { 0x510006f3, ANDROID_CPU_ARM_FEATURE_IDIV_ARM | ANDROID_CPU_ARM_FEATURE_IDIV_THUMB2 }, }; size_t n; @@ -1070,14 +1026,11 @@ android_cpuInit(void) // Technically, this is a feature of the virtual CPU implemented // by the emulator. Note that it could also support Thumb IDIV // in the future, and this will have to be slightly updated. - char* hardware = extract_cpuinfo_field(cpuinfo, - cpuinfo_len, - "Hardware"); + char* hardware = extract_cpuinfo_field(cpuinfo, cpuinfo_len, "Hardware"); if (hardware) { - if (!strcmp(hardware, "Goldfish") && - g_cpuIdArm == 0x4100c080 && + if (!strcmp(hardware, "Goldfish") && g_cpuIdArm == 0x4100c080 && (g_cpuFamily & ANDROID_CPU_ARM_FEATURE_ARMv7) != 0) { g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_IDIV_ARM; @@ -1095,17 +1048,18 @@ android_cpuInit(void) if (hwcaps != 0) { - int has_fp = (hwcaps & HWCAP_FP); - int has_asimd = (hwcaps & HWCAP_ASIMD); - int has_aes = (hwcaps & HWCAP_AES); - int has_pmull = (hwcaps & HWCAP_PMULL); - int has_sha1 = (hwcaps & HWCAP_SHA1); - int has_sha2 = (hwcaps & HWCAP_SHA2); - int has_crc32 = (hwcaps & HWCAP_CRC32); + int has_fp = (hwcaps & HWCAP_FP); + int has_asimd = (hwcaps & HWCAP_ASIMD); + int has_aes = (hwcaps & HWCAP_AES); + int has_pmull = (hwcaps & HWCAP_PMULL); + int has_sha1 = (hwcaps & HWCAP_SHA1); + int has_sha2 = (hwcaps & HWCAP_SHA2); + int has_crc32 = (hwcaps & HWCAP_CRC32); if (has_fp == 0) { - D("ERROR: Floating-point unit missing, but is required by Android on AArch64 CPUs\n"); + D("ERROR: Floating-point unit missing, but is required by Android on AArch64 " + "CPUs\n"); } if (has_asimd == 0) @@ -1139,13 +1093,12 @@ android_cpuInit(void) #if defined(__i386__) || defined(__x86_64__) int regs[4]; /* According to http://en.wikipedia.org/wiki/CPUID */ -#define VENDOR_INTEL_b 0x756e6547 -#define VENDOR_INTEL_c 0x6c65746e -#define VENDOR_INTEL_d 0x49656e69 +#define VENDOR_INTEL_b 0x756e6547 +#define VENDOR_INTEL_c 0x6c65746e +#define VENDOR_INTEL_d 0x49656e69 x86_cpuid(0, regs); - int vendorIsIntel = (regs[1] == VENDOR_INTEL_b && - regs[2] == VENDOR_INTEL_c && - regs[3] == VENDOR_INTEL_d); + int vendorIsIntel = + (regs[1] == VENDOR_INTEL_b && regs[2] == VENDOR_INTEL_c && regs[3] == VENDOR_INTEL_d); x86_cpuid(1, regs); if ((regs[2] & (1 << 9)) != 0) @@ -1201,7 +1154,7 @@ android_cpuInit(void) } #endif -#if defined( __mips__) +#if defined(__mips__) { /* MIPS and MIPS64 */ /* Extract the list of CPU features from ELF hwcaps */ @@ -1210,8 +1163,8 @@ android_cpuInit(void) if (hwcaps != 0) { - int has_r6 = (hwcaps & HWCAP_MIPS_R6); - int has_msa = (hwcaps & HWCAP_MIPS_MSA); + int has_r6 = (hwcaps & HWCAP_MIPS_R6); + int has_msa = (hwcaps & HWCAP_MIPS_MSA); if (has_r6) g_cpuFeatures |= ANDROID_CPU_MIPS_FEATURE_R6; @@ -1224,38 +1177,30 @@ android_cpuInit(void) free(cpuinfo); } - -AndroidCpuFamily -android_getCpuFamily(void) +AndroidCpuFamily android_getCpuFamily(void) { pthread_once(&g_once, android_cpuInit); return g_cpuFamily; } - -uint64_t -android_getCpuFeatures(void) +uint64_t android_getCpuFeatures(void) { pthread_once(&g_once, android_cpuInit); return g_cpuFeatures; } - -int -android_getCpuCount(void) +int android_getCpuCount(void) { pthread_once(&g_once, android_cpuInit); return g_cpuCount; } -static void -android_cpuInitDummy(void) +static void android_cpuInitDummy(void) { g_inited = 1; } -int -android_setCpu(int cpu_count, uint64_t cpu_features) +int android_setCpu(int cpu_count, uint64_t cpu_features) { /* Fail if the library was already initialized. */ if (g_inited) @@ -1269,15 +1214,13 @@ android_setCpu(int cpu_count, uint64_t cpu_features) } #ifdef __arm__ -uint32_t -android_getCpuIdArm(void) +uint32_t android_getCpuIdArm(void) { pthread_once(&g_once, android_cpuInit); return g_cpuIdArm; } -int -android_setCpuArm(int cpu_count, uint64_t cpu_features, uint32_t cpu_id) +int android_setCpuArm(int cpu_count, uint64_t cpu_features, uint32_t cpu_id) { if (!android_setCpu(cpu_count, cpu_features)) return 0; @@ -1285,7 +1228,7 @@ android_setCpuArm(int cpu_count, uint64_t cpu_features, uint32_t cpu_id) g_cpuIdArm = cpu_id; return 1; } -#endif /* __arm__ */ +#endif /* __arm__ */ /* * Technical note: Making sense of ARM's FPU architecture versions. diff --git a/winpr/libwinpr/sysinfo/cpufeatures/cpu-features.h b/winpr/libwinpr/sysinfo/cpufeatures/cpu-features.h index e95ed9dc6..9520c8ac1 100644 --- a/winpr/libwinpr/sysinfo/cpufeatures/cpu-features.h +++ b/winpr/libwinpr/sysinfo/cpufeatures/cpu-features.h @@ -46,7 +46,7 @@ typedef enum ANDROID_CPU_FAMILY_X86_64, ANDROID_CPU_FAMILY_MIPS64, - ANDROID_CPU_FAMILY_MAX /* do not remove */ + ANDROID_CPU_FAMILY_MAX /* do not remove */ } AndroidCpuFamily; @@ -201,23 +201,23 @@ extern uint64_t android_getCpuFeatures(void); */ enum { - ANDROID_CPU_ARM_FEATURE_ARMv7 = (1 << 0), - ANDROID_CPU_ARM_FEATURE_VFPv3 = (1 << 1), - ANDROID_CPU_ARM_FEATURE_NEON = (1 << 2), + ANDROID_CPU_ARM_FEATURE_ARMv7 = (1 << 0), + ANDROID_CPU_ARM_FEATURE_VFPv3 = (1 << 1), + ANDROID_CPU_ARM_FEATURE_NEON = (1 << 2), ANDROID_CPU_ARM_FEATURE_LDREX_STREX = (1 << 3), - ANDROID_CPU_ARM_FEATURE_VFPv2 = (1 << 4), - ANDROID_CPU_ARM_FEATURE_VFP_D32 = (1 << 5), - ANDROID_CPU_ARM_FEATURE_VFP_FP16 = (1 << 6), - ANDROID_CPU_ARM_FEATURE_VFP_FMA = (1 << 7), - ANDROID_CPU_ARM_FEATURE_NEON_FMA = (1 << 8), - ANDROID_CPU_ARM_FEATURE_IDIV_ARM = (1 << 9), + ANDROID_CPU_ARM_FEATURE_VFPv2 = (1 << 4), + ANDROID_CPU_ARM_FEATURE_VFP_D32 = (1 << 5), + ANDROID_CPU_ARM_FEATURE_VFP_FP16 = (1 << 6), + ANDROID_CPU_ARM_FEATURE_VFP_FMA = (1 << 7), + ANDROID_CPU_ARM_FEATURE_NEON_FMA = (1 << 8), + ANDROID_CPU_ARM_FEATURE_IDIV_ARM = (1 << 9), ANDROID_CPU_ARM_FEATURE_IDIV_THUMB2 = (1 << 10), - ANDROID_CPU_ARM_FEATURE_iWMMXt = (1 << 11), - ANDROID_CPU_ARM_FEATURE_AES = (1 << 12), - ANDROID_CPU_ARM_FEATURE_PMULL = (1 << 13), - ANDROID_CPU_ARM_FEATURE_SHA1 = (1 << 14), - ANDROID_CPU_ARM_FEATURE_SHA2 = (1 << 15), - ANDROID_CPU_ARM_FEATURE_CRC32 = (1 << 16), + ANDROID_CPU_ARM_FEATURE_iWMMXt = (1 << 11), + ANDROID_CPU_ARM_FEATURE_AES = (1 << 12), + ANDROID_CPU_ARM_FEATURE_PMULL = (1 << 13), + ANDROID_CPU_ARM_FEATURE_SHA1 = (1 << 14), + ANDROID_CPU_ARM_FEATURE_SHA2 = (1 << 15), + ANDROID_CPU_ARM_FEATURE_CRC32 = (1 << 16), }; /* The bit flags corresponding to the output of android_getCpuFeatures() @@ -247,13 +247,13 @@ enum */ enum { - ANDROID_CPU_ARM64_FEATURE_FP = (1 << 0), - ANDROID_CPU_ARM64_FEATURE_ASIMD = (1 << 1), - ANDROID_CPU_ARM64_FEATURE_AES = (1 << 2), - ANDROID_CPU_ARM64_FEATURE_PMULL = (1 << 3), - ANDROID_CPU_ARM64_FEATURE_SHA1 = (1 << 4), - ANDROID_CPU_ARM64_FEATURE_SHA2 = (1 << 5), - ANDROID_CPU_ARM64_FEATURE_CRC32 = (1 << 6), + ANDROID_CPU_ARM64_FEATURE_FP = (1 << 0), + ANDROID_CPU_ARM64_FEATURE_ASIMD = (1 << 1), + ANDROID_CPU_ARM64_FEATURE_AES = (1 << 2), + ANDROID_CPU_ARM64_FEATURE_PMULL = (1 << 3), + ANDROID_CPU_ARM64_FEATURE_SHA1 = (1 << 4), + ANDROID_CPU_ARM64_FEATURE_SHA2 = (1 << 5), + ANDROID_CPU_ARM64_FEATURE_CRC32 = (1 << 6), }; /* The bit flags corresponding to the output of android_getCpuFeatures() @@ -262,9 +262,9 @@ enum */ enum { - ANDROID_CPU_X86_FEATURE_SSSE3 = (1 << 0), + ANDROID_CPU_X86_FEATURE_SSSE3 = (1 << 0), ANDROID_CPU_X86_FEATURE_POPCNT = (1 << 1), - ANDROID_CPU_X86_FEATURE_MOVBE = (1 << 2), + ANDROID_CPU_X86_FEATURE_MOVBE = (1 << 2), ANDROID_CPU_X86_FEATURE_SSE4_1 = (1 << 3), ANDROID_CPU_X86_FEATURE_SSE4_2 = (1 << 4), ANDROID_CPU_X86_FEATURE_AES_NI = (1 << 5), @@ -287,11 +287,10 @@ enum */ enum { - ANDROID_CPU_MIPS_FEATURE_R6 = (1 << 0), - ANDROID_CPU_MIPS_FEATURE_MSA = (1 << 1), + ANDROID_CPU_MIPS_FEATURE_R6 = (1 << 0), + ANDROID_CPU_MIPS_FEATURE_MSA = (1 << 1), }; - /* Return the number of CPU cores detected on this device. */ extern int android_getCpuCount(void); @@ -305,8 +304,7 @@ extern int android_getCpuCount(void); * * This function return 1 on success, and 0 on failure. */ -extern int android_setCpu(int cpu_count, - uint64_t cpu_features); +extern int android_setCpu(int cpu_count, uint64_t cpu_features); #ifdef __arm__ /* Retrieve the ARM 32-bit CPUID value from the kernel. @@ -318,9 +316,7 @@ extern uint32_t android_getCpuIdArm(void); /* An ARM-specific variant of android_setCpu() that also allows you * to set the ARM CPUID field. */ -extern int android_setCpuArm(int cpu_count, - uint64_t cpu_features, - uint32_t cpu_id); +extern int android_setCpuArm(int cpu_count, uint64_t cpu_features, uint32_t cpu_id); #endif __END_DECLS diff --git a/winpr/libwinpr/sysinfo/sysinfo.c b/winpr/libwinpr/sysinfo/sysinfo.c index 42c3096f7..9ee66acdc 100644 --- a/winpr/libwinpr/sysinfo/sysinfo.c +++ b/winpr/libwinpr/sysinfo/sysinfo.c @@ -70,9 +70,8 @@ #include #include -#if defined(__MACOSX__) || defined(__IOS__) || \ -defined(__FreeBSD__) || defined(__NetBSD__) || \ -defined(__OpenBSD__) || defined(__DragonFly__) +#if defined(__MACOSX__) || defined(__IOS__) || defined(__FreeBSD__) || defined(__NetBSD__) || \ + defined(__OpenBSD__) || defined(__DragonFly__) #include #endif @@ -84,26 +83,26 @@ static DWORD GetProcessorArchitecture(void) switch (family) { - case ANDROID_CPU_FAMILY_ARM: - return PROCESSOR_ARCHITECTURE_ARM; + case ANDROID_CPU_FAMILY_ARM: + return PROCESSOR_ARCHITECTURE_ARM; - case ANDROID_CPU_FAMILY_X86: - return PROCESSOR_ARCHITECTURE_INTEL; + case ANDROID_CPU_FAMILY_X86: + return PROCESSOR_ARCHITECTURE_INTEL; - case ANDROID_CPU_FAMILY_MIPS: - return PROCESSOR_ARCHITECTURE_MIPS; + case ANDROID_CPU_FAMILY_MIPS: + return PROCESSOR_ARCHITECTURE_MIPS; - case ANDROID_CPU_FAMILY_ARM64: - return PROCESSOR_ARCHITECTURE_ARM64; + case ANDROID_CPU_FAMILY_ARM64: + return PROCESSOR_ARCHITECTURE_ARM64; - case ANDROID_CPU_FAMILY_X86_64: - return PROCESSOR_ARCHITECTURE_AMD64; + case ANDROID_CPU_FAMILY_X86_64: + return PROCESSOR_ARCHITECTURE_AMD64; - case ANDROID_CPU_FAMILY_MIPS64: - return PROCESSOR_ARCHITECTURE_MIPS64; + case ANDROID_CPU_FAMILY_MIPS64: + return PROCESSOR_ARCHITECTURE_MIPS64; - default: - return PROCESSOR_ARCHITECTURE_UNKNOWN; + default: + return PROCESSOR_ARCHITECTURE_UNKNOWN; } #elif defined(_M_ARM) @@ -134,10 +133,9 @@ static DWORD GetNumberOfProcessors(void) return android_getCpuCount(); /* TODO: iOS */ #elif defined(__linux__) || defined(__sun) || defined(_AIX) - numCPUs = (DWORD) sysconf(_SC_NPROCESSORS_ONLN); -#elif defined(__MACOSX__) || \ - defined(__FreeBSD__) || defined(__NetBSD__) || \ - defined(__OpenBSD__) || defined(__DragonFly__) + numCPUs = (DWORD)sysconf(_SC_NPROCESSORS_ONLN); +#elif defined(__MACOSX__) || defined(__FreeBSD__) || defined(__NetBSD__) || \ + defined(__OpenBSD__) || defined(__DragonFly__) { int mib[4]; size_t length = sizeof(numCPUs); @@ -159,9 +157,9 @@ static DWORD GetNumberOfProcessors(void) } } #elif defined(__hpux) - numCPUs = (DWORD) mpctl(MPC_GETNUMSPUS, NULL, NULL); + numCPUs = (DWORD)mpctl(MPC_GETNUMSPUS, NULL, NULL); #elif defined(__sgi) - numCPUs = (DWORD) sysconf(_SC_NPROC_ONLN); + numCPUs = (DWORD)sysconf(_SC_NPROC_ONLN); #endif return numCPUs; } @@ -184,7 +182,7 @@ static DWORD GetSystemPageSize(void) #endif if (sc_page_size > 0) - dwPageSize = (DWORD) sc_page_size; + dwPageSize = (DWORD)sc_page_size; if (dwPageSize < 4096) dwPageSize = 4096; @@ -226,11 +224,11 @@ void GetSystemTime(LPSYSTEMTIME lpSystemTime) { lpSystemTime->wYear = (WORD)(stm->tm_year + 1900); lpSystemTime->wMonth = (WORD)(stm->tm_mon + 1); - lpSystemTime->wDayOfWeek = (WORD) stm->tm_wday; - lpSystemTime->wDay = (WORD) stm->tm_mday; - lpSystemTime->wHour = (WORD) stm->tm_hour; - lpSystemTime->wMinute = (WORD) stm->tm_min; - lpSystemTime->wSecond = (WORD) stm->tm_sec; + lpSystemTime->wDayOfWeek = (WORD)stm->tm_wday; + lpSystemTime->wDay = (WORD)stm->tm_mday; + lpSystemTime->wHour = (WORD)stm->tm_hour; + lpSystemTime->wMinute = (WORD)stm->tm_min; + lpSystemTime->wSecond = (WORD)stm->tm_sec; lpSystemTime->wMilliseconds = wMilliseconds; } } @@ -255,11 +253,11 @@ VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) { lpSystemTime->wYear = (WORD)(ltm->tm_year + 1900); lpSystemTime->wMonth = (WORD)(ltm->tm_mon + 1); - lpSystemTime->wDayOfWeek = (WORD) ltm->tm_wday; - lpSystemTime->wDay = (WORD) ltm->tm_mday; - lpSystemTime->wHour = (WORD) ltm->tm_hour; - lpSystemTime->wMinute = (WORD) ltm->tm_min; - lpSystemTime->wSecond = (WORD) ltm->tm_sec; + lpSystemTime->wDayOfWeek = (WORD)ltm->tm_wday; + lpSystemTime->wDay = (WORD)ltm->tm_mday; + lpSystemTime->wHour = (WORD)ltm->tm_hour; + lpSystemTime->wMinute = (WORD)ltm->tm_min; + lpSystemTime->wSecond = (WORD)ltm->tm_sec; lpSystemTime->wMilliseconds = wMilliseconds; } } @@ -276,7 +274,7 @@ VOID GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime) time64.u.HighPart = 0; /* time represented in tenths of microseconds since midnight of January 1, 1601 */ time64.QuadPart = time(NULL) + 11644473600LL; /* Seconds since January 1, 1601 */ - time64.QuadPart *= 10000000; /* Convert timestamp to tenths of a microsecond */ + time64.QuadPart *= 10000000; /* Convert timestamp to tenths of a microsecond */ lpSystemTimeAsFileTime->dwLowDateTime = time64.LowPart; lpSystemTimeAsFileTime->dwHighDateTime = time64.HighPart; } @@ -289,7 +287,7 @@ BOOL GetSystemTimeAdjustment(PDWORD lpTimeAdjustment, PDWORD lpTimeIncrement, } #ifndef CLOCK_MONOTONIC_RAW -#define CLOCK_MONOTONIC_RAW 4 +#define CLOCK_MONOTONIC_RAW 4 #endif DWORD GetTickCount(void) @@ -319,8 +317,8 @@ DWORD GetTickCount(void) #if !defined(_WIN32) || defined(_UWP) /* OSVERSIONINFOEX Structure: -* http://msdn.microsoft.com/en-us/library/windows/desktop/ms724833 -*/ + * http://msdn.microsoft.com/en-us/library/windows/desktop/ms724833 + */ BOOL GetVersionExA(LPOSVERSIONINFOA lpVersionInformation) { @@ -381,7 +379,7 @@ BOOL GetVersionExA(LPOSVERSIONINFOA lpVersionInformation) BOOL GetVersionExW(LPOSVERSIONINFOW lpVersionInformation) { ZeroMemory(lpVersionInformation->szCSDVersion, sizeof(lpVersionInformation->szCSDVersion)); - return GetVersionExA((LPOSVERSIONINFOA) lpVersionInformation); + return GetVersionExA((LPOSVERSIONINFOA)lpVersionInformation); } #endif @@ -409,7 +407,7 @@ BOOL GetComputerNameA(LPSTR lpBuffer, LPDWORD lpnSize) if (dot) length = (dot - hostname); - if ((*lpnSize <= (DWORD) length) || !lpBuffer) + if ((*lpnSize <= (DWORD)length) || !lpBuffer) { SetLastError(ERROR_BUFFER_OVERFLOW); *lpnSize = (DWORD)(length + 1); @@ -453,13 +451,13 @@ BOOL GetComputerNameExA(COMPUTER_NAME_FORMAT NameType, LPSTR lpBuffer, LPDWORD l switch (NameType) { - case ComputerNameDnsHostname: - case ComputerNameDnsDomain: - case ComputerNameDnsFullyQualified: - case ComputerNamePhysicalDnsHostname: - case ComputerNamePhysicalDnsDomain: - case ComputerNamePhysicalDnsFullyQualified: - if ((*lpnSize <= (DWORD) length) || !lpBuffer) + case ComputerNameDnsHostname: + case ComputerNameDnsDomain: + case ComputerNameDnsFullyQualified: + case ComputerNamePhysicalDnsHostname: + case ComputerNamePhysicalDnsDomain: + case ComputerNamePhysicalDnsFullyQualified: + if ((*lpnSize <= (DWORD)length) || !lpBuffer) { *lpnSize = (DWORD)(length + 1); SetLastError(ERROR_MORE_DATA); @@ -469,10 +467,10 @@ BOOL GetComputerNameExA(COMPUTER_NAME_FORMAT NameType, LPSTR lpBuffer, LPDWORD l CopyMemory(lpBuffer, hostname, length); lpBuffer[length] = '\0'; *lpnSize = (DWORD)length; - break; + break; - default: - return FALSE; + default: + return FALSE; } return TRUE; @@ -512,7 +510,7 @@ BOOL GetComputerNameExW(COMPUTER_NAME_FORMAT NameType, LPWSTR lpBuffer, LPDWORD DWORD GetTickCount(void) { - return (DWORD) GetTickCount64(); + return (DWORD)GetTickCount64(); } #endif @@ -556,44 +554,38 @@ ULONGLONG winpr_GetTickCount64(void) #if defined(__GNUC__) && defined(__AVX__) #define xgetbv(_func_, _lo_, _hi_) \ - __asm__ __volatile__ ("xgetbv" : "=a" (_lo_), "=d" (_hi_) : "c" (_func_)) + __asm__ __volatile__("xgetbv" : "=a"(_lo_), "=d"(_hi_) : "c"(_func_)) #endif -#define D_BIT_MMX (1<<23) -#define D_BIT_SSE (1<<25) -#define D_BIT_SSE2 (1<<26) -#define D_BIT_3DN (1<<30) -#define C_BIT_SSE3 (1<<0) -#define C_BIT_PCLMULQDQ (1<<1) -#define C81_BIT_LZCNT (1<<5) -#define C_BIT_3DNP (1<<8) -#define C_BIT_3DNP (1<<8) -#define C_BIT_SSSE3 (1<<9) -#define C_BIT_SSE41 (1<<19) -#define C_BIT_SSE42 (1<<20) -#define C_BIT_FMA (1<<12) -#define C_BIT_AES (1<<25) -#define C_BIT_XGETBV (1<<27) -#define C_BIT_AVX (1<<28) -#define C_BITS_AVX (C_BIT_XGETBV|C_BIT_AVX) -#define E_BIT_XMM (1<<1) -#define E_BIT_YMM (1<<2) -#define E_BITS_AVX (E_BIT_XMM|E_BIT_YMM) +#define D_BIT_MMX (1 << 23) +#define D_BIT_SSE (1 << 25) +#define D_BIT_SSE2 (1 << 26) +#define D_BIT_3DN (1 << 30) +#define C_BIT_SSE3 (1 << 0) +#define C_BIT_PCLMULQDQ (1 << 1) +#define C81_BIT_LZCNT (1 << 5) +#define C_BIT_3DNP (1 << 8) +#define C_BIT_3DNP (1 << 8) +#define C_BIT_SSSE3 (1 << 9) +#define C_BIT_SSE41 (1 << 19) +#define C_BIT_SSE42 (1 << 20) +#define C_BIT_FMA (1 << 12) +#define C_BIT_AES (1 << 25) +#define C_BIT_XGETBV (1 << 27) +#define C_BIT_AVX (1 << 28) +#define C_BITS_AVX (C_BIT_XGETBV | C_BIT_AVX) +#define E_BIT_XMM (1 << 1) +#define E_BIT_YMM (1 << 2) +#define E_BITS_AVX (E_BIT_XMM | E_BIT_YMM) -static void cpuid( - unsigned info, - unsigned* eax, - unsigned* ebx, - unsigned* ecx, - unsigned* edx) +static void cpuid(unsigned info, unsigned* eax, unsigned* ebx, unsigned* ecx, unsigned* edx) { #ifdef __GNUC__ *eax = *ebx = *ecx = *edx = 0; - __asm volatile - ( - /* The EBX (or RBX register on x86_64) is used for the PIC base address - * and must not be corrupted by our inline assembly. - */ + __asm volatile( + /* The EBX (or RBX register on x86_64) is used for the PIC base address + * and must not be corrupted by our inline assembly. + */ #ifdef _M_IX86 "mov %%ebx, %%esi;" "cpuid;" @@ -604,8 +596,7 @@ static void cpuid( "xchg %%rbx, %%rsi;" #endif : "=a"(*eax), "=S"(*ebx), "=c"(*ecx), "=d"(*edx) - : "0"(info) - ); + : "0"(info)); #elif defined(_MSC_VER) int a[4]; __cpuid(a, info); @@ -619,26 +610,26 @@ static void cpuid( #if defined(__linux__) // HWCAP flags from linux kernel - uapi/asm/hwcap.h #define HWCAP_SWP (1 << 0) -#define HWCAP_HALF (1 << 1) +#define HWCAP_HALF (1 << 1) #define HWCAP_THUMB (1 << 2) -#define HWCAP_26BIT (1 << 3) /* Play it safe */ +#define HWCAP_26BIT (1 << 3) /* Play it safe */ #define HWCAP_FAST_MULT (1 << 4) #define HWCAP_FPA (1 << 5) #define HWCAP_VFP (1 << 6) -#define HWCAP_EDSP (1 << 7) -#define HWCAP_JAVA (1 << 8) -#define HWCAP_IWMMXT (1 << 9) -#define HWCAP_CRUNCH (1 << 10) +#define HWCAP_EDSP (1 << 7) +#define HWCAP_JAVA (1 << 8) +#define HWCAP_IWMMXT (1 << 9) +#define HWCAP_CRUNCH (1 << 10) #define HWCAP_THUMBEE (1 << 11) -#define HWCAP_NEON (1 << 12) +#define HWCAP_NEON (1 << 12) #define HWCAP_VFPv3 (1 << 13) -#define HWCAP_VFPv3D16 (1 << 14) /* also set for VFPv4-D16 */ +#define HWCAP_VFPv3D16 (1 << 14) /* also set for VFPv4-D16 */ #define HWCAP_TLS (1 << 15) #define HWCAP_VFPv4 (1 << 16) #define HWCAP_IDIVA (1 << 17) #define HWCAP_IDIVT (1 << 18) -#define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */ -#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT) +#define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */ +#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT) // From linux kernel uapi/linux/auxvec.h #define AT_HWCAP 16 @@ -653,8 +644,8 @@ static unsigned GetARMCPUCaps(void) static struct { - unsigned a_type; /* Entry type */ - unsigned a_val; /* Integer value */ + unsigned a_type; /* Entry type */ + unsigned a_val; /* Integer value */ } auxvec; while (1) @@ -688,12 +679,12 @@ BOOL IsProcessorFeaturePresent(DWORD ProcessorFeature) switch (ProcessorFeature) { - case PF_ARM_NEON_INSTRUCTIONS_AVAILABLE: - case PF_ARM_NEON: - return features & ANDROID_CPU_ARM_FEATURE_NEON; + case PF_ARM_NEON_INSTRUCTIONS_AVAILABLE: + case PF_ARM_NEON: + return features & ANDROID_CPU_ARM_FEATURE_NEON; - default: - return FALSE; + default: + return FALSE; } #elif defined(_M_ARM) @@ -702,79 +693,79 @@ BOOL IsProcessorFeaturePresent(DWORD ProcessorFeature) switch (ProcessorFeature) { - case PF_ARM_NEON_INSTRUCTIONS_AVAILABLE: - case PF_ARM_NEON: - if (caps & HWCAP_NEON) + case PF_ARM_NEON_INSTRUCTIONS_AVAILABLE: + case PF_ARM_NEON: + if (caps & HWCAP_NEON) ret = TRUE; - break; + break; - case PF_ARM_THUMB: - if (caps & HWCAP_THUMB) + case PF_ARM_THUMB: + if (caps & HWCAP_THUMB) ret = TRUE; - case PF_ARM_VFP_32_REGISTERS_AVAILABLE: - if (caps & HWCAP_VFPD32) + case PF_ARM_VFP_32_REGISTERS_AVAILABLE: + if (caps & HWCAP_VFPD32) ret = TRUE; - case PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE: - if ((caps & HWCAP_IDIVA) || (caps & HWCAP_IDIVT)) + case PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE: + if ((caps & HWCAP_IDIVA) || (caps & HWCAP_IDIVT)) ret = TRUE; - case PF_ARM_VFP3: - if (caps & HWCAP_VFPv3) + case PF_ARM_VFP3: + if (caps & HWCAP_VFPv3) ret = TRUE; - break; + break; - case PF_ARM_JAZELLE: - if (caps & HWCAP_JAVA) + case PF_ARM_JAZELLE: + if (caps & HWCAP_JAVA) ret = TRUE; - break; + break; - case PF_ARM_DSP: - if (caps & HWCAP_EDSP) + case PF_ARM_DSP: + if (caps & HWCAP_EDSP) ret = TRUE; - break; + break; - case PF_ARM_MPU: - if (caps & HWCAP_EDSP) + case PF_ARM_MPU: + if (caps & HWCAP_EDSP) ret = TRUE; - break; + break; - case PF_ARM_THUMB2: - if ((caps & HWCAP_IDIVT) || (caps & HWCAP_VFPv4)) + case PF_ARM_THUMB2: + if ((caps & HWCAP_IDIVT) || (caps & HWCAP_VFPv4)) ret = TRUE; - break; + break; - case PF_ARM_T2EE: - if (caps & HWCAP_THUMBEE) + case PF_ARM_T2EE: + if (caps & HWCAP_THUMBEE) ret = TRUE; - break; + break; - case PF_ARM_INTEL_WMMX: - if (caps & HWCAP_IWMMXT) + case PF_ARM_INTEL_WMMX: + if (caps & HWCAP_IWMMXT) ret = TRUE; - break; + break; - default: - break; + default: + break; } #elif defined(__APPLE__) // __linux__ switch (ProcessorFeature) { - case PF_ARM_NEON_INSTRUCTIONS_AVAILABLE: - case PF_ARM_NEON: - ret = TRUE; - break; + case PF_ARM_NEON_INSTRUCTIONS_AVAILABLE: + case PF_ARM_NEON: + ret = TRUE; + break; } #endif // __linux__ @@ -785,38 +776,38 @@ BOOL IsProcessorFeaturePresent(DWORD ProcessorFeature) switch (ProcessorFeature) { - case PF_MMX_INSTRUCTIONS_AVAILABLE: - if (d & D_BIT_MMX) + case PF_MMX_INSTRUCTIONS_AVAILABLE: + if (d & D_BIT_MMX) ret = TRUE; - break; + break; - case PF_XMMI_INSTRUCTIONS_AVAILABLE: - if (d & D_BIT_SSE) + case PF_XMMI_INSTRUCTIONS_AVAILABLE: + if (d & D_BIT_SSE) ret = TRUE; - break; + break; - case PF_XMMI64_INSTRUCTIONS_AVAILABLE: - if (d & D_BIT_SSE2) + case PF_XMMI64_INSTRUCTIONS_AVAILABLE: + if (d & D_BIT_SSE2) ret = TRUE; - break; + break; - case PF_3DNOW_INSTRUCTIONS_AVAILABLE: - if (d & D_BIT_3DN) + case PF_3DNOW_INSTRUCTIONS_AVAILABLE: + if (d & D_BIT_3DN) ret = TRUE; - break; + break; - case PF_SSE3_INSTRUCTIONS_AVAILABLE: - if (c & C_BIT_SSE3) + case PF_SSE3_INSTRUCTIONS_AVAILABLE: + if (c & C_BIT_SSE3) ret = TRUE; - break; + break; - default: - break; + default: + break; } #endif // __GNUC__ @@ -849,35 +840,35 @@ BOOL IsProcessorFeaturePresentEx(DWORD ProcessorFeature) switch (ProcessorFeature) { - case PF_EX_ARM_VFP1: - if (caps & HWCAP_VFP) + case PF_EX_ARM_VFP1: + if (caps & HWCAP_VFP) ret = TRUE; - break; + break; - case PF_EX_ARM_VFP3D16: - if (caps & HWCAP_VFPv3D16) + case PF_EX_ARM_VFP3D16: + if (caps & HWCAP_VFPv3D16) ret = TRUE; - break; + break; - case PF_EX_ARM_VFP4: - if (caps & HWCAP_VFPv4) + case PF_EX_ARM_VFP4: + if (caps & HWCAP_VFPv4) ret = TRUE; - break; + break; - case PF_EX_ARM_IDIVA: - if (caps & HWCAP_IDIVA) + case PF_EX_ARM_IDIVA: + if (caps & HWCAP_IDIVA) ret = TRUE; - break; + break; - case PF_EX_ARM_IDIVT: - if (caps & HWCAP_IDIVT) + case PF_EX_ARM_IDIVT: + if (caps & HWCAP_IDIVT) ret = TRUE; - break; + break; } #endif // __linux__ @@ -887,87 +878,87 @@ BOOL IsProcessorFeaturePresentEx(DWORD ProcessorFeature) switch (ProcessorFeature) { - case PF_EX_LZCNT: - { - unsigned a81, b81, c81, d81; - cpuid(0x80000001, &a81, &b81, &c81, &d81); + case PF_EX_LZCNT: + { + unsigned a81, b81, c81, d81; + cpuid(0x80000001, &a81, &b81, &c81, &d81); - if (c81 & C81_BIT_LZCNT) - ret = TRUE; - } - break; + if (c81 & C81_BIT_LZCNT) + ret = TRUE; + } + break; - case PF_EX_3DNOW_PREFETCH: - if (c & C_BIT_3DNP) + case PF_EX_3DNOW_PREFETCH: + if (c & C_BIT_3DNP) ret = TRUE; - break; + break; - case PF_EX_SSSE3: - if (c & C_BIT_SSSE3) + case PF_EX_SSSE3: + if (c & C_BIT_SSSE3) ret = TRUE; - break; + break; - case PF_EX_SSE41: - if (c & C_BIT_SSE41) + case PF_EX_SSE41: + if (c & C_BIT_SSE41) ret = TRUE; - break; + break; - case PF_EX_SSE42: - if (c & C_BIT_SSE42) + case PF_EX_SSE42: + if (c & C_BIT_SSE42) ret = TRUE; - break; + break; #if defined(__GNUC__) && defined(__AVX__) - case PF_EX_AVX: - case PF_EX_FMA: - case PF_EX_AVX_AES: - case PF_EX_AVX_PCLMULQDQ: - { - /* Check for general AVX support */ - if ((c & C_BITS_AVX) != C_BITS_AVX) - break; + case PF_EX_AVX: + case PF_EX_FMA: + case PF_EX_AVX_AES: + case PF_EX_AVX_PCLMULQDQ: + { + /* Check for general AVX support */ + if ((c & C_BITS_AVX) != C_BITS_AVX) + break; - int e, f; - xgetbv(0, e, f); + int e, f; + xgetbv(0, e, f); - /* XGETBV enabled for applications and XMM/YMM states enabled */ - if ((e & E_BITS_AVX) == E_BITS_AVX) + /* XGETBV enabled for applications and XMM/YMM states enabled */ + if ((e & E_BITS_AVX) == E_BITS_AVX) + { + switch (ProcessorFeature) { - switch (ProcessorFeature) - { - case PF_EX_AVX: - ret = TRUE; - break; + case PF_EX_AVX: + ret = TRUE; + break; - case PF_EX_FMA: - if (c & C_BIT_FMA) - ret = TRUE; + case PF_EX_FMA: + if (c & C_BIT_FMA) + ret = TRUE; - break; + break; - case PF_EX_AVX_AES: - if (c & C_BIT_AES) - ret = TRUE; + case PF_EX_AVX_AES: + if (c & C_BIT_AES) + ret = TRUE; - break; + break; - case PF_EX_AVX_PCLMULQDQ: - if (c & C_BIT_PCLMULQDQ) - ret = TRUE; + case PF_EX_AVX_PCLMULQDQ: + if (c & C_BIT_PCLMULQDQ) + ret = TRUE; - break; - } + break; } - } - break; + } + } + break; #endif //__AVX__ - default: - break; + default: + break; } #endif diff --git a/winpr/libwinpr/sysinfo/test/TestCPUFeatures.c b/winpr/libwinpr/sysinfo/test/TestCPUFeatures.c index 5f90a63f6..c1b3f65cb 100644 --- a/winpr/libwinpr/sysinfo/test/TestCPUFeatures.c +++ b/winpr/libwinpr/sysinfo/test/TestCPUFeatures.c @@ -3,8 +3,10 @@ #include #include -#define TEST_FEATURE(feature) printf("\t" #feature ": %s\n", IsProcessorFeaturePresent(feature) ? "yes" : "no") -#define TEST_FEATURE_EX(feature) printf("\t" #feature ": %s\n", IsProcessorFeaturePresentEx(feature) ? "yes" : "no") +#define TEST_FEATURE(feature) \ + printf("\t" #feature ": %s\n", IsProcessorFeaturePresent(feature) ? "yes" : "no") +#define TEST_FEATURE_EX(feature) \ + printf("\t" #feature ": %s\n", IsProcessorFeaturePresentEx(feature) ? "yes" : "no") int TestCPUFeatures(int argc, char* argv[]) { printf("Base CPU Flags:\n"); diff --git a/winpr/libwinpr/sysinfo/test/TestGetComputerName.c b/winpr/libwinpr/sysinfo/test/TestGetComputerName.c index ceffbfac0..866a1b1c7 100644 --- a/winpr/libwinpr/sysinfo/test/TestGetComputerName.c +++ b/winpr/libwinpr/sysinfo/test/TestGetComputerName.c @@ -4,7 +4,6 @@ #include #include - /* FreeRDP does not seem to export this function */ #ifndef _WIN32 BOOL GetComputerNameA(LPSTR lpBuffer, LPDWORD lpnSize); @@ -23,9 +22,10 @@ BOOL Test_GetComputerName(void) * * lpnSize [in, out] * On input, specifies the size of the buffer, in TCHARs. - * On output, the number of TCHARs copied to the destination buffer, not including the terminating null character. - * If the buffer is too small, the function fails and GetLastError returns ERROR_BUFFER_OVERFLOW. - * The lpnSize parameter specifies the size of the buffer required, including the terminating null character + * On output, the number of TCHARs copied to the destination buffer, not including the + * terminating null character. If the buffer is too small, the function fails and GetLastError + * returns ERROR_BUFFER_OVERFLOW. The lpnSize parameter specifies the size of the buffer + * required, including the terminating null character * */ @@ -44,13 +44,14 @@ BOOL Test_GetComputerName(void) if (GetComputerNameA(NULL, &dwSize) == TRUE) { fprintf(stderr, "%s: (1) GetComputerNameA unexpectedly succeeded with null buffer\n", - __FUNCTION__); + __FUNCTION__); return FALSE; } if ((dwError = GetLastError()) != ERROR_BUFFER_OVERFLOW) { - fprintf(stderr, "%s: (2) GetLastError returned 0x%08"PRIX32" (expected ERROR_BUFFER_OVERFLOW)\n", - __FUNCTION__, dwError); + fprintf(stderr, + "%s: (2) GetLastError returned 0x%08" PRIX32 " (expected ERROR_BUFFER_OVERFLOW)\n", + __FUNCTION__, dwError); return FALSE; } @@ -58,21 +59,26 @@ BOOL Test_GetComputerName(void) dwSize = 0; if (GetComputerNameA(netbiosName1, &dwSize) == TRUE) { - fprintf(stderr, "%s: (3) GetComputerNameA unexpectedly succeeded with zero size parameter\n", - __FUNCTION__); + fprintf(stderr, + "%s: (3) GetComputerNameA unexpectedly succeeded with zero size parameter\n", + __FUNCTION__); return FALSE; } if ((dwError = GetLastError()) != ERROR_BUFFER_OVERFLOW) { - fprintf(stderr, "%s: (4) GetLastError returned 0x%08"PRIX32" (expected ERROR_BUFFER_OVERFLOW)\n", - __FUNCTION__, dwError); + fprintf(stderr, + "%s: (4) GetLastError returned 0x%08" PRIX32 " (expected ERROR_BUFFER_OVERFLOW)\n", + __FUNCTION__, dwError); return FALSE; } - /* check if returned size is valid: must be the size of the buffer required, including the terminating null character in this case */ + /* check if returned size is valid: must be the size of the buffer required, including the + * terminating null character in this case */ if (dwSize < 2 || dwSize > netbiosBufferSize) { - fprintf(stderr, "%s: (5) GetComputerNameA returned wrong size %"PRIu32" (expected something in the range from 2 to %"PRIu32")\n", - __FUNCTION__, dwSize, netbiosBufferSize); + fprintf(stderr, + "%s: (5) GetComputerNameA returned wrong size %" PRIu32 + " (expected something in the range from 2 to %" PRIu32 ")\n", + __FUNCTION__, dwSize, netbiosBufferSize); return FALSE; } dwNameLength = dwSize - 1; @@ -80,15 +86,16 @@ BOOL Test_GetComputerName(void) /* test with returned size */ if (GetComputerNameA(netbiosName1, &dwSize) == FALSE) { - fprintf(stderr, "%s: (6) GetComputerNameA failed with error: 0x%08"PRIX32"\n", - __FUNCTION__, GetLastError()); + fprintf(stderr, "%s: (6) GetComputerNameA failed with error: 0x%08" PRIX32 "\n", + __FUNCTION__, GetLastError()); return FALSE; } /* check if returned size is valid */ if (dwSize != dwNameLength) { - fprintf(stderr, "%s: (7) GetComputerNameA returned wrong size %"PRIu32" (expected %"PRIu32")\n", - __FUNCTION__, dwSize, dwNameLength); + fprintf(stderr, + "%s: (7) GetComputerNameA returned wrong size %" PRIu32 " (expected %" PRIu32 ")\n", + __FUNCTION__, dwSize, dwNameLength); return FALSE; } /* check if string is correctly terminated */ @@ -102,15 +109,17 @@ BOOL Test_GetComputerName(void) dwSize = netbiosBufferSize; if (GetComputerNameA(netbiosName2, &dwSize) == FALSE) { - fprintf(stderr, "%s: (9) GetComputerNameA failed with error: 0x%08"PRIX32"\n", - __FUNCTION__, GetLastError()); + fprintf(stderr, "%s: (9) GetComputerNameA failed with error: 0x%08" PRIX32 "\n", + __FUNCTION__, GetLastError()); return FALSE; } /* check if returned size is valid */ if (dwSize != dwNameLength) { - fprintf(stderr, "%s: (10) GetComputerNameA returned wrong size %"PRIu32" (expected %"PRIu32")\n", - __FUNCTION__, dwSize, dwNameLength); + fprintf(stderr, + "%s: (10) GetComputerNameA returned wrong size %" PRIu32 " (expected %" PRIu32 + ")\n", + __FUNCTION__, dwSize, dwNameLength); return FALSE; } /* check if string is correctly terminated */ @@ -131,26 +140,29 @@ BOOL Test_GetComputerName(void) dwSize = dwNameLength; if (GetComputerNameA(netbiosName1, &dwSize) == TRUE) { - fprintf(stderr, "%s: (13) GetComputerNameA unexpectedly succeeded with limited buffer size\n", - __FUNCTION__); + fprintf(stderr, + "%s: (13) GetComputerNameA unexpectedly succeeded with limited buffer size\n", + __FUNCTION__); return FALSE; } /* check if returned size is valid */ if (dwSize != dwNameLength + 1) { - fprintf(stderr, "%s: (14) GetComputerNameA returned wrong size %"PRIu32" (expected %"PRIu32")\n", - __FUNCTION__, dwSize, dwNameLength + 1); + fprintf(stderr, + "%s: (14) GetComputerNameA returned wrong size %" PRIu32 " (expected %" PRIu32 + ")\n", + __FUNCTION__, dwSize, dwNameLength + 1); return FALSE; } return TRUE; } - BOOL Test_GetComputerNameEx_Format(COMPUTER_NAME_FORMAT format) { /** - * BOOL WINAPI GetComputerNameEx(COMPUTER_NAME_FORMAT NameType, LPTSTR lpBuffer, LPDWORD lpnSize); + * BOOL WINAPI GetComputerNameEx(COMPUTER_NAME_FORMAT NameType, LPTSTR lpBuffer, LPDWORD + * lpnSize); * * Retrieves a NetBIOS or DNS name associated with the local computer. * @@ -166,15 +178,16 @@ BOOL Test_GetComputerNameEx_Format(COMPUTER_NAME_FORMAT format) * * lpBuffer [out] * A pointer to a buffer that receives the computer name or the cluster virtual server name. - * The length of the name may be greater than MAX_COMPUTERNAME_LENGTH characters because DNS allows longer names. - * To ensure that this buffer is large enough, set this parameter to NULL and use the required buffer size returned in the lpnSize parameter. + * The length of the name may be greater than MAX_COMPUTERNAME_LENGTH characters because DNS + * allows longer names. To ensure that this buffer is large enough, set this parameter to NULL + * and use the required buffer size returned in the lpnSize parameter. * * lpnSize [in, out] * On input, specifies the size of the buffer, in TCHARs. - * On output, receives the number of TCHARs copied to the destination buffer, not including the terminating null character. - * If the buffer is too small, the function fails and GetLastError returns ERROR_MORE_DATA. - * This parameter receives the size of the buffer required, including the terminating null character. - * If lpBuffer is NULL, this parameter must be zero. + * On output, receives the number of TCHARs copied to the destination buffer, not including the + * terminating null character. If the buffer is too small, the function fails and GetLastError + * returns ERROR_MORE_DATA. This parameter receives the size of the buffer required, including + * the terminating null character. If lpBuffer is NULL, this parameter must be zero. * */ @@ -190,7 +203,6 @@ BOOL Test_GetComputerNameEx_Format(COMPUTER_NAME_FORMAT format) memset(computerName1, 0xAA, nameBufferSize); memset(computerName2, 0xBB, nameBufferSize); - if (format == ComputerNameDnsDomain || format == ComputerNamePhysicalDnsDomain) { /* domain names may be empty, terminating null only */ @@ -202,19 +214,19 @@ BOOL Test_GetComputerNameEx_Format(COMPUTER_NAME_FORMAT format) dwMinSize = 2; } - /* test with null buffer and zero size (required if buffer is null) */ dwSize = 0; if (GetComputerNameExA(format, NULL, &dwSize) == TRUE) { fprintf(stderr, "%s: (1/%d) GetComputerNameExA unexpectedly succeeded with null buffer\n", - __FUNCTION__, format); + __FUNCTION__, format); return FALSE; } if ((dwError = GetLastError()) != ERROR_MORE_DATA) { - fprintf(stderr, "%s: (2/%d) GetLastError returned 0x%08"PRIX32" (expected ERROR_MORE_DATA)\n", - __FUNCTION__, format, dwError); + fprintf(stderr, + "%s: (2/%d) GetLastError returned 0x%08" PRIX32 " (expected ERROR_MORE_DATA)\n", + __FUNCTION__, format, dwError); return FALSE; } @@ -222,21 +234,26 @@ BOOL Test_GetComputerNameEx_Format(COMPUTER_NAME_FORMAT format) dwSize = 0; if (GetComputerNameExA(format, computerName1, &dwSize) == TRUE) { - fprintf(stderr, "%s: (3/%d) GetComputerNameExA unexpectedly succeeded with zero size parameter\n", - __FUNCTION__, format); + fprintf(stderr, + "%s: (3/%d) GetComputerNameExA unexpectedly succeeded with zero size parameter\n", + __FUNCTION__, format); return FALSE; } if ((dwError = GetLastError()) != ERROR_MORE_DATA) { - fprintf(stderr, "%s: (4/%d) GetLastError returned 0x%08"PRIX32" (expected ERROR_MORE_DATA)\n", - __FUNCTION__, format, dwError); + fprintf(stderr, + "%s: (4/%d) GetLastError returned 0x%08" PRIX32 " (expected ERROR_MORE_DATA)\n", + __FUNCTION__, format, dwError); return FALSE; } - /* check if returned size is valid: must be the size of the buffer required, including the terminating null character in this case */ + /* check if returned size is valid: must be the size of the buffer required, including the + * terminating null character in this case */ if (dwSize < dwMinSize || dwSize > nameBufferSize) { - fprintf(stderr, "%s: (5/%d) GetComputerNameExA returned wrong size %"PRIu32" (expected something in the range from %"PRIu32" to %"PRIu32")\n", - __FUNCTION__, format, dwSize, dwMinSize, nameBufferSize); + fprintf(stderr, + "%s: (5/%d) GetComputerNameExA returned wrong size %" PRIu32 + " (expected something in the range from %" PRIu32 " to %" PRIu32 ")\n", + __FUNCTION__, format, dwSize, dwMinSize, nameBufferSize); return FALSE; } dwNameLength = dwSize - 1; @@ -244,15 +261,17 @@ BOOL Test_GetComputerNameEx_Format(COMPUTER_NAME_FORMAT format) /* test with returned size */ if (GetComputerNameExA(format, computerName1, &dwSize) == FALSE) { - fprintf(stderr, "%s: (6/%d) GetComputerNameExA failed with error: 0x%08"PRIX32"\n", - __FUNCTION__, format, GetLastError()); + fprintf(stderr, "%s: (6/%d) GetComputerNameExA failed with error: 0x%08" PRIX32 "\n", + __FUNCTION__, format, GetLastError()); return FALSE; } /* check if returned size is valid */ if (dwSize != dwNameLength) { - fprintf(stderr, "%s: (7/%d) GetComputerNameExA returned wrong size %"PRIu32" (expected %"PRIu32")\n", - __FUNCTION__, format, dwSize, dwNameLength); + fprintf(stderr, + "%s: (7/%d) GetComputerNameExA returned wrong size %" PRIu32 " (expected %" PRIu32 + ")\n", + __FUNCTION__, format, dwSize, dwNameLength); return FALSE; } /* check if string is correctly terminated */ @@ -266,15 +285,17 @@ BOOL Test_GetComputerNameEx_Format(COMPUTER_NAME_FORMAT format) dwSize = nameBufferSize; if (GetComputerNameExA(format, computerName2, &dwSize) == FALSE) { - fprintf(stderr, "%s: (9/%d) GetComputerNameExA failed with error: 0x%08"PRIX32"\n", - __FUNCTION__, format, GetLastError()); + fprintf(stderr, "%s: (9/%d) GetComputerNameExA failed with error: 0x%08" PRIX32 "\n", + __FUNCTION__, format, GetLastError()); return FALSE; } /* check if returned size is valid */ if (dwSize != dwNameLength) { - fprintf(stderr, "%s: (10/%d) GetComputerNameExA returned wrong size %"PRIu32" (expected %"PRIu32")\n", - __FUNCTION__, format, dwSize, dwNameLength); + fprintf(stderr, + "%s: (10/%d) GetComputerNameExA returned wrong size %" PRIu32 " (expected %" PRIu32 + ")\n", + __FUNCTION__, format, dwSize, dwNameLength); return FALSE; } /* check if string is correctly terminated */ @@ -295,22 +316,24 @@ BOOL Test_GetComputerNameEx_Format(COMPUTER_NAME_FORMAT format) dwSize = dwNameLength; if (GetComputerNameExA(format, computerName1, &dwSize) == TRUE) { - fprintf(stderr, "%s: (13/%d) GetComputerNameExA unexpectedly succeeded with limited buffer size\n", - __FUNCTION__, format); + fprintf(stderr, + "%s: (13/%d) GetComputerNameExA unexpectedly succeeded with limited buffer size\n", + __FUNCTION__, format); return FALSE; } /* check if returned size is valid */ if (dwSize != dwNameLength + 1) { - fprintf(stderr, "%s: (14/%d) GetComputerNameExA returned wrong size %"PRIu32" (expected %"PRIu32")\n", - __FUNCTION__, format, dwSize, dwNameLength + 1); + fprintf(stderr, + "%s: (14/%d) GetComputerNameExA returned wrong size %" PRIu32 " (expected %" PRIu32 + ")\n", + __FUNCTION__, format, dwSize, dwNameLength + 1); return FALSE; } return TRUE; } - int TestGetComputerName(int argc, char* argv[]) { if (!Test_GetComputerName()) diff --git a/winpr/libwinpr/sysinfo/test/TestGetNativeSystemInfo.c b/winpr/libwinpr/sysinfo/test/TestGetNativeSystemInfo.c index 49fb4f720..f249a1562 100644 --- a/winpr/libwinpr/sysinfo/test/TestGetNativeSystemInfo.c +++ b/winpr/libwinpr/sysinfo/test/TestGetNativeSystemInfo.c @@ -9,17 +9,17 @@ int TestGetNativeSystemInfo(int argc, char* argv[]) GetNativeSystemInfo(&sysinfo); printf("SystemInfo:\n"); - printf("\twProcessorArchitecture: %"PRIu16"\n", sysinfo.wProcessorArchitecture); - printf("\twReserved: %"PRIu16"\n", sysinfo.wReserved); - printf("\tdwPageSize: 0x%08"PRIX32"\n", sysinfo.dwPageSize); + printf("\twProcessorArchitecture: %" PRIu16 "\n", sysinfo.wProcessorArchitecture); + printf("\twReserved: %" PRIu16 "\n", sysinfo.wReserved); + printf("\tdwPageSize: 0x%08" PRIX32 "\n", sysinfo.dwPageSize); printf("\tlpMinimumApplicationAddress: %p\n", sysinfo.lpMinimumApplicationAddress); printf("\tlpMaximumApplicationAddress: %p\n", sysinfo.lpMaximumApplicationAddress); - printf("\tdwActiveProcessorMask: %p\n", (void*) sysinfo.dwActiveProcessorMask); - printf("\tdwNumberOfProcessors: %"PRIu32"\n", sysinfo.dwNumberOfProcessors); - printf("\tdwProcessorType: %"PRIu32"\n", sysinfo.dwProcessorType); - printf("\tdwAllocationGranularity: %"PRIu32"\n", sysinfo.dwAllocationGranularity); - printf("\twProcessorLevel: %"PRIu16"\n", sysinfo.wProcessorLevel); - printf("\twProcessorRevision: %"PRIu16"\n", sysinfo.wProcessorRevision); + printf("\tdwActiveProcessorMask: %p\n", (void*)sysinfo.dwActiveProcessorMask); + printf("\tdwNumberOfProcessors: %" PRIu32 "\n", sysinfo.dwNumberOfProcessors); + printf("\tdwProcessorType: %" PRIu32 "\n", sysinfo.dwProcessorType); + printf("\tdwAllocationGranularity: %" PRIu32 "\n", sysinfo.dwAllocationGranularity); + printf("\twProcessorLevel: %" PRIu16 "\n", sysinfo.wProcessorLevel); + printf("\twProcessorRevision: %" PRIu16 "\n", sysinfo.wProcessorRevision); printf("\n"); return 0; diff --git a/winpr/libwinpr/sysinfo/test/TestLocalTime.c b/winpr/libwinpr/sysinfo/test/TestLocalTime.c index a1642d1e5..ea8ae7c16 100644 --- a/winpr/libwinpr/sysinfo/test/TestLocalTime.c +++ b/winpr/libwinpr/sysinfo/test/TestLocalTime.c @@ -8,8 +8,11 @@ int TestLocalTime(int argc, char* argv[]) GetLocalTime(&lTime); - printf("GetLocalTime: wYear: %"PRIu16" wMonth: %"PRIu16" wDayOfWeek: %"PRIu16" wDay: %"PRIu16" wHour: %"PRIu16" wMinute: %"PRIu16" wSecond: %"PRIu16" wMilliseconds: %"PRIu16"\n", - lTime.wYear, lTime.wMonth, lTime.wDayOfWeek, lTime.wDay, lTime.wHour, lTime.wMinute, lTime.wSecond, lTime.wMilliseconds); + printf("GetLocalTime: wYear: %" PRIu16 " wMonth: %" PRIu16 " wDayOfWeek: %" PRIu16 + " wDay: %" PRIu16 " wHour: %" PRIu16 " wMinute: %" PRIu16 " wSecond: %" PRIu16 + " wMilliseconds: %" PRIu16 "\n", + lTime.wYear, lTime.wMonth, lTime.wDayOfWeek, lTime.wDay, lTime.wHour, lTime.wMinute, + lTime.wSecond, lTime.wMilliseconds); return 0; } diff --git a/winpr/libwinpr/sysinfo/test/TestSystemTime.c b/winpr/libwinpr/sysinfo/test/TestSystemTime.c index b07194d3a..465e84680 100644 --- a/winpr/libwinpr/sysinfo/test/TestSystemTime.c +++ b/winpr/libwinpr/sysinfo/test/TestSystemTime.c @@ -8,9 +8,11 @@ int TestSystemTime(int argc, char* argv[]) GetSystemTime(&sTime); - printf("GetSystemTime: wYear: %"PRIu16" wMonth: %"PRIu16" wDayOfWeek: %"PRIu16" wDay: %"PRIu16" wHour: %"PRIu16" wMinute: %"PRIu16" wSecond: %"PRIu16" wMilliseconds: %"PRIu16"\n", - sTime.wYear, sTime.wMonth, sTime.wDayOfWeek, sTime.wDay, sTime.wHour, sTime.wMinute, sTime.wSecond, sTime.wMilliseconds); + printf("GetSystemTime: wYear: %" PRIu16 " wMonth: %" PRIu16 " wDayOfWeek: %" PRIu16 + " wDay: %" PRIu16 " wHour: %" PRIu16 " wMinute: %" PRIu16 " wSecond: %" PRIu16 + " wMilliseconds: %" PRIu16 "\n", + sTime.wYear, sTime.wMonth, sTime.wDayOfWeek, sTime.wDay, sTime.wHour, sTime.wMinute, + sTime.wSecond, sTime.wMilliseconds); return 0; } - diff --git a/winpr/libwinpr/thread/argv.c b/winpr/libwinpr/thread/argv.c index a255bfa39..b5921d000 100644 --- a/winpr/libwinpr/thread/argv.c +++ b/winpr/libwinpr/thread/argv.c @@ -42,16 +42,17 @@ * when they are followed by a quotation mark character ("), as follows: * * 2n backslashes followed by a quotation mark produce n backslashes followed by a quotation mark. - * (2n) + 1 backslashes followed by a quotation mark again produce n backslashes followed by a quotation mark. - * n backslashes not followed by a quotation mark simply produce n backslashes. + * (2n) + 1 backslashes followed by a quotation mark again produce n backslashes followed by a + * quotation mark. n backslashes not followed by a quotation mark simply produce n backslashes. * - * The address returned by CommandLineToArgvW is the address of the first element in an array of LPWSTR values; - * the number of pointers in this array is indicated by pNumArgs. Each pointer to a null-terminated Unicode - * string represents an individual argument found on the command line. + * The address returned by CommandLineToArgvW is the address of the first element in an array of + * LPWSTR values; the number of pointers in this array is indicated by pNumArgs. Each pointer to a + * null-terminated Unicode string represents an individual argument found on the command line. * * CommandLineToArgvW allocates a block of contiguous memory for pointers to the argument strings, * and for the argument strings themselves; the calling application must free the memory used by the - * argument list when it is no longer needed. To free the memory, use a single call to the LocalFree function. + * argument list when it is no longer needed. To free the memory, use a single call to the LocalFree + * function. */ /** @@ -113,7 +114,7 @@ LPSTR* CommandLineToArgvA(LPCSTR lpCmdLine, int* pNumArgs) pArgs = NULL; lpEscapedCmdLine = NULL; cmdLineLength = strlen(lpCmdLine); - lpEscapedChars = (BOOL*) calloc(cmdLineLength + 1, sizeof(BOOL)); + lpEscapedChars = (BOOL*)calloc(cmdLineLength + 1, sizeof(BOOL)); if (!lpEscapedChars) return NULL; @@ -123,7 +124,7 @@ LPSTR* CommandLineToArgvA(LPCSTR lpCmdLine, int* pNumArgs) size_t i; size_t n; char* pLastEnd = NULL; - lpEscapedCmdLine = (char*) calloc(cmdLineLength + 1, sizeof(char)); + lpEscapedCmdLine = (char*)calloc(cmdLineLength + 1, sizeof(char)); if (!lpEscapedCmdLine) { @@ -131,9 +132,9 @@ LPSTR* CommandLineToArgvA(LPCSTR lpCmdLine, int* pNumArgs) return NULL; } - p = (char*) lpCmdLine; - pLastEnd = (char*) lpCmdLine; - pOutput = (char*) lpEscapedCmdLine; + p = (char*)lpCmdLine; + pLastEnd = (char*)lpCmdLine; + pOutput = (char*)lpEscapedCmdLine; while (p < &lpCmdLine[cmdLineLength]) { @@ -179,12 +180,12 @@ LPSTR* CommandLineToArgvA(LPCSTR lpCmdLine, int* pNumArgs) } *pOutput++ = '\0'; - lpCmdLine = (LPCSTR) lpEscapedCmdLine; + lpCmdLine = (LPCSTR)lpEscapedCmdLine; cmdLineLength = strlen(lpCmdLine); } maxNumArgs = 2; - p = (char*) lpCmdLine; + p = (char*)lpCmdLine; while (p < lpCmdLine + cmdLineLength) { @@ -194,7 +195,7 @@ LPSTR* CommandLineToArgvA(LPCSTR lpCmdLine, int* pNumArgs) } maxBufferSize = (maxNumArgs * (sizeof(char*))) + (cmdLineLength + 1); - buffer = (char*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, maxBufferSize); + buffer = (char*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, maxBufferSize); if (!buffer) { @@ -203,9 +204,9 @@ LPSTR* CommandLineToArgvA(LPCSTR lpCmdLine, int* pNumArgs) return NULL; } - pArgs = (LPSTR*) buffer; - pOutput = (char*) &buffer[maxNumArgs * (sizeof(char*))]; - p = (char*) lpCmdLine; + pArgs = (LPSTR*)buffer; + pOutput = (char*)&buffer[maxNumArgs * (sizeof(char*))]; + p = (char*)lpCmdLine; while (p < lpCmdLine + cmdLineLength) { diff --git a/winpr/libwinpr/thread/process.c b/winpr/libwinpr/thread/process.c index d97eac3fb..25ef1aa95 100644 --- a/winpr/libwinpr/thread/process.c +++ b/winpr/libwinpr/thread/process.c @@ -74,17 +74,18 @@ #endif /** - * If the file name does not contain a directory path, the system searches for the executable file in the following sequence: + * If the file name does not contain a directory path, the system searches for the executable file + * in the following sequence: * * 1) The directory from which the application loaded. * 2) The current directory for the parent process. - * 3) The 32-bit Windows system directory. Use the GetSystemDirectory function to get the path of this directory. - * 4) The 16-bit Windows system directory. There is no function that obtains the path of this directory, - * but it is searched. The name of this directory is System. - * 5) The Windows directory. Use the GetWindowsDirectory function to get the path of this directory. - * 6) The directories that are listed in the PATH environment variable. Note that this function - * does not search the per-application path specified by the App Paths registry key. To include - * this per-application path in the search sequence, use the ShellExecute function. + * 3) The 32-bit Windows system directory. Use the GetSystemDirectory function to get the path of + * this directory. 4) The 16-bit Windows system directory. There is no function that obtains the + * path of this directory, but it is searched. The name of this directory is System. 5) The Windows + * directory. Use the GetWindowsDirectory function to get the path of this directory. 6) The + * directories that are listed in the PATH environment variable. Note that this function does not + * search the per-application path specified by the App Paths registry key. To include this + * per-application path in the search sequence, use the ShellExecute function. */ static char* FindApplicationPath(char* application) @@ -107,7 +108,7 @@ static char* FindApplicationPath(char* application) if (!nSize) return _strdup(application); - lpSystemPath = (LPSTR) malloc(nSize); + lpSystemPath = (LPSTR)malloc(nSize); if (!lpSystemPath) return NULL; @@ -142,11 +143,11 @@ static char* FindApplicationPath(char* application) static HANDLE CreateProcessHandle(pid_t pid); static BOOL ProcessHandleCloseHandle(HANDLE handle); -BOOL _CreateProcessExA(HANDLE hToken, DWORD dwLogonFlags, - LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, - LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, - LPVOID lpEnvironment, - LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) +BOOL _CreateProcessExA(HANDLE hToken, DWORD dwLogonFlags, LPCSTR lpApplicationName, + LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, + LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, + DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, + LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { pid_t pid; int numArgs; @@ -168,7 +169,7 @@ BOOL _CreateProcessExA(HANDLE hToken, DWORD dwLogonFlags, if (!pArgs) return FALSE; - token = (WINPR_ACCESS_TOKEN*) hToken; + token = (WINPR_ACCESS_TOKEN*)hToken; if (lpEnvironment) { @@ -264,19 +265,19 @@ BOOL _CreateProcessExA(HANDLE hToken, DWORD dwLogonFlags, { if (token->GroupId) { - int rc = setgid((gid_t) token->GroupId); + int rc = setgid((gid_t)token->GroupId); if (rc < 0) { } else { - initgroups(token->Username, (gid_t) token->GroupId); + initgroups(token->Username, (gid_t)token->GroupId); } } if (token->UserId) - setuid((uid_t) token->UserId); + setuid((uid_t)token->UserId); } /* TODO: add better cwd handling and error checking */ @@ -311,8 +312,8 @@ BOOL _CreateProcessExA(HANDLE hToken, DWORD dwLogonFlags, lpProcessInformation->hProcess = process; lpProcessInformation->hThread = thread; - lpProcessInformation->dwProcessId = (DWORD) pid; - lpProcessInformation->dwThreadId = (DWORD) pid; + lpProcessInformation->dwProcessId = (DWORD)pid; + lpProcessInformation->dwThreadId = (DWORD)pid; ret = TRUE; finish: @@ -348,77 +349,74 @@ finish: BOOL CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, - LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, - LPVOID lpEnvironment, - LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) + LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, + DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, + LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { - return _CreateProcessExA(NULL, 0, - lpApplicationName, lpCommandLine, lpProcessAttributes, + return _CreateProcessExA(NULL, 0, lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); } BOOL CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, - LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, - LPVOID lpEnvironment, - LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, - LPPROCESS_INFORMATION lpProcessInformation) + LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, + DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, + LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { return TRUE; } BOOL CreateProcessAsUserA(HANDLE hToken, LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, - LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, - LPVOID lpEnvironment, - LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) + LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, + DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, + LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { - return _CreateProcessExA(hToken, 0, - lpApplicationName, lpCommandLine, lpProcessAttributes, + return _CreateProcessExA(hToken, 0, lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); } BOOL CreateProcessAsUserW(HANDLE hToken, LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, - LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, - LPVOID lpEnvironment, - LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, - LPPROCESS_INFORMATION lpProcessInformation) + LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, + DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, + LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { return TRUE; } BOOL CreateProcessWithLogonA(LPCSTR lpUsername, LPCSTR lpDomain, LPCSTR lpPassword, - DWORD dwLogonFlags, - LPCSTR lpApplicationName, LPSTR lpCommandLine, DWORD dwCreationFlags, LPVOID lpEnvironment, - LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) + DWORD dwLogonFlags, LPCSTR lpApplicationName, LPSTR lpCommandLine, + DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, + LPSTARTUPINFOA lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation) { return TRUE; } BOOL CreateProcessWithLogonW(LPCWSTR lpUsername, LPCWSTR lpDomain, LPCWSTR lpPassword, - DWORD dwLogonFlags, - LPCWSTR lpApplicationName, LPWSTR lpCommandLine, DWORD dwCreationFlags, LPVOID lpEnvironment, + DWORD dwLogonFlags, LPCWSTR lpApplicationName, LPWSTR lpCommandLine, + DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { return TRUE; } -BOOL CreateProcessWithTokenA(HANDLE hToken, DWORD dwLogonFlags, - LPCSTR lpApplicationName, LPSTR lpCommandLine, DWORD dwCreationFlags, LPVOID lpEnvironment, - LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) +BOOL CreateProcessWithTokenA(HANDLE hToken, DWORD dwLogonFlags, LPCSTR lpApplicationName, + LPSTR lpCommandLine, DWORD dwCreationFlags, LPVOID lpEnvironment, + LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation) { - return _CreateProcessExA(NULL, 0, - lpApplicationName, lpCommandLine, NULL, - NULL, FALSE, dwCreationFlags, lpEnvironment, - lpCurrentDirectory, lpStartupInfo, lpProcessInformation); + return _CreateProcessExA(NULL, 0, lpApplicationName, lpCommandLine, NULL, NULL, FALSE, + dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, + lpProcessInformation); } -BOOL CreateProcessWithTokenW(HANDLE hToken, DWORD dwLogonFlags, - LPCWSTR lpApplicationName, LPWSTR lpCommandLine, DWORD dwCreationFlags, LPVOID lpEnvironment, +BOOL CreateProcessWithTokenW(HANDLE hToken, DWORD dwLogonFlags, LPCWSTR lpApplicationName, + LPWSTR lpCommandLine, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { @@ -427,7 +425,7 @@ BOOL CreateProcessWithTokenW(HANDLE hToken, DWORD dwLogonFlags, VOID ExitProcess(UINT uExitCode) { - exit((int) uExitCode); + exit((int)uExitCode); } BOOL GetExitCodeProcess(HANDLE hProcess, LPDWORD lpExitCode) @@ -440,7 +438,7 @@ BOOL GetExitCodeProcess(HANDLE hProcess, LPDWORD lpExitCode) if (!lpExitCode) return FALSE; - process = (WINPR_PROCESS*) hProcess; + process = (WINPR_PROCESS*)hProcess; *lpExitCode = process->dwExitCode; return TRUE; } @@ -452,24 +450,24 @@ HANDLE _GetCurrentProcess(VOID) DWORD GetCurrentProcessId(VOID) { - return ((DWORD) getpid()); + return ((DWORD)getpid()); } DWORD GetProcessId(HANDLE Process) { WINPR_PROCESS* process; - process = (WINPR_PROCESS*) Process; + process = (WINPR_PROCESS*)Process; if (!process) return 0; - return (DWORD) process->pid; + return (DWORD)process->pid; } BOOL TerminateProcess(HANDLE hProcess, UINT uExitCode) { WINPR_PROCESS* process; - process = (WINPR_PROCESS*) hProcess; + process = (WINPR_PROCESS*)hProcess; if (!process || (process->pid <= 0)) return FALSE; @@ -480,17 +478,16 @@ BOOL TerminateProcess(HANDLE hProcess, UINT uExitCode) return TRUE; } - static BOOL ProcessHandleCloseHandle(HANDLE handle) { - WINPR_PROCESS* process = (WINPR_PROCESS*) handle; + WINPR_PROCESS* process = (WINPR_PROCESS*)handle; free(process); return TRUE; } static BOOL ProcessHandleIsHandle(HANDLE handle) { - WINPR_PROCESS* process = (WINPR_PROCESS*) handle; + WINPR_PROCESS* process = (WINPR_PROCESS*)handle; if (!process || process->Type != HANDLE_TYPE_PROCESS) { @@ -513,34 +510,31 @@ static int ProcessGetFd(HANDLE handle) return -1; } -static HANDLE_OPS ops = -{ - ProcessHandleIsHandle, - ProcessHandleCloseHandle, - ProcessGetFd, - NULL, /* CleanupHandle */ - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL -}; +static HANDLE_OPS ops = { ProcessHandleIsHandle, + ProcessHandleCloseHandle, + ProcessGetFd, + NULL, /* CleanupHandle */ + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL }; HANDLE CreateProcessHandle(pid_t pid) { WINPR_PROCESS* process; - process = (WINPR_PROCESS*) calloc(1, sizeof(WINPR_PROCESS)); + process = (WINPR_PROCESS*)calloc(1, sizeof(WINPR_PROCESS)); if (!process) return NULL; @@ -552,4 +546,3 @@ HANDLE CreateProcessHandle(pid_t pid) } #endif - diff --git a/winpr/libwinpr/thread/processor.c b/winpr/libwinpr/thread/processor.c index 9383cc208..0d992fa22 100644 --- a/winpr/libwinpr/thread/processor.c +++ b/winpr/libwinpr/thread/processor.c @@ -41,4 +41,3 @@ DWORD GetCurrentProcessorNumber(VOID) } #endif - diff --git a/winpr/libwinpr/thread/test/TestThreadCommandLineToArgv.c b/winpr/libwinpr/thread/test/TestThreadCommandLineToArgv.c index d863ba59b..abe99b864 100644 --- a/winpr/libwinpr/thread/test/TestThreadCommandLineToArgv.c +++ b/winpr/libwinpr/thread/test/TestThreadCommandLineToArgv.c @@ -5,82 +5,31 @@ const char* test_args_line_1 = "app.exe abc d e"; -const char* test_args_list_1[] = -{ - "app.exe", - "abc", - "d", - "e", - NULL -}; +const char* test_args_list_1[] = { "app.exe", "abc", "d", "e", NULL }; const char* test_args_line_2 = "app.exe abc \t def"; -const char* test_args_list_2[] = -{ - "app.exe", - "abc", - "def", - NULL -}; +const char* test_args_list_2[] = { "app.exe", "abc", "def", NULL }; const char* test_args_line_3 = "app.exe \"abc\" d e"; -const char* test_args_list_3[] = -{ - "app.exe", - "abc", - "d", - "e", - NULL -}; +const char* test_args_list_3[] = { "app.exe", "abc", "d", "e", NULL }; const char* test_args_line_4 = "app.exe a\\\\b d\"e f\"g h"; -const char* test_args_list_4[] = -{ - "app.exe", - "a\\\\b", - "de fg", - "h", - NULL -}; +const char* test_args_list_4[] = { "app.exe", "a\\\\b", "de fg", "h", NULL }; const char* test_args_line_5 = "app.exe a\\\\\\\"b c d"; -const char* test_args_list_5[] = -{ - "app.exe", - "a\\\"b", - "c", - "d", - NULL -}; +const char* test_args_list_5[] = { "app.exe", "a\\\"b", "c", "d", NULL }; const char* test_args_line_6 = "app.exe a\\\\\\\\\"b c\" d e"; -const char* test_args_list_6[] = -{ - "app.exe", - "a\\\\b c", - "d", - "e", - NULL -}; +const char* test_args_list_6[] = { "app.exe", "a\\\\b c", "d", "e", NULL }; const char* test_args_line_7 = "app.exe a\\\\\\\\\"b c\" d e f\\\\\\\\\"g h\" i j"; -const char* test_args_list_7[] = -{ - "app.exe", - "a\\\\b c", - "d", - "e", - "f\\\\g h", - "i", - "j", - NULL -}; +const char* test_args_list_7[] = { "app.exe", "a\\\\b c", "d", "e", "f\\\\g h", "i", "j", NULL }; static int test_command_line_parsing_case(const char* line, const char** list) { @@ -119,4 +68,3 @@ int TestThreadCommandLineToArgv(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/thread/test/TestThreadCreateProcess.c b/winpr/libwinpr/thread/test/TestThreadCreateProcess.c index ecfcd456f..61659fe70 100644 --- a/winpr/libwinpr/thread/test/TestThreadCreateProcess.c +++ b/winpr/libwinpr/thread/test/TestThreadCreateProcess.c @@ -55,40 +55,32 @@ int TestThreadCreateProcess(int argc, char* argv[]) StartupInfo.cb = sizeof(STARTUPINFO); ZeroMemory(&ProcessInformation, sizeof(PROCESS_INFORMATION)); - status = CreateProcess(lpApplicationName, - lpCommandLine, - lpProcessAttributes, - lpThreadAttributes, - bInheritHandles, - dwCreationFlags, - lpEnvironment, - lpCurrentDirectory, - &StartupInfo, - &ProcessInformation); + status = CreateProcess(lpApplicationName, lpCommandLine, lpProcessAttributes, + lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, + lpCurrentDirectory, &StartupInfo, &ProcessInformation); if (!status) { - printf("CreateProcess failed. error=%"PRIu32"\n", GetLastError()); + printf("CreateProcess failed. error=%" PRIu32 "\n", GetLastError()); return 1; } if (WaitForSingleObject(ProcessInformation.hProcess, 5000) != WAIT_OBJECT_0) { - printf("Failed to wait for first process. error=%"PRIu32"\n", GetLastError()); + printf("Failed to wait for first process. error=%" PRIu32 "\n", GetLastError()); return 1; } exitCode = 0; status = GetExitCodeProcess(ProcessInformation.hProcess, &exitCode); - printf("GetExitCodeProcess status: %"PRId32"\n", status); - printf("Process exited with code: 0x%08"PRIX32"\n", exitCode); + printf("GetExitCodeProcess status: %" PRId32 "\n", status); + printf("Process exited with code: 0x%08" PRIX32 "\n", exitCode); CloseHandle(ProcessInformation.hProcess); CloseHandle(ProcessInformation.hThread); FreeEnvironmentStrings(lpszEnvironmentBlock); - /* Test stdin,stdout,stderr redirection */ saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); @@ -97,7 +89,7 @@ int TestThreadCreateProcess(int argc, char* argv[]) if (!CreatePipe(&pipe_read, &pipe_write, &saAttr, 0)) { - printf("Pipe creation failed. error=%"PRIu32"\n", GetLastError()); + printf("Pipe creation failed. error=%" PRIu32 "\n", GetLastError()); return 1; } @@ -113,22 +105,14 @@ int TestThreadCreateProcess(int argc, char* argv[]) if (!(lpEnvironment = calloc(1, sizeof(TESTENV_T) + sizeof(TCHAR)))) { - printf("Failed to allocate environment buffer. error=%"PRIu32"\n", GetLastError()); + printf("Failed to allocate environment buffer. error=%" PRIu32 "\n", GetLastError()); return 1; } memcpy(lpEnvironment, (void*)TESTENV_T, sizeof(TESTENV_T)); - - status = CreateProcess(lpApplicationName, - lpCommandLine, - lpProcessAttributes, - lpThreadAttributes, - bInheritHandles, - dwCreationFlags, - lpEnvironment, - lpCurrentDirectory, - &StartupInfo, - &ProcessInformation); + status = CreateProcess(lpApplicationName, lpCommandLine, lpProcessAttributes, + lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, + lpCurrentDirectory, &StartupInfo, &ProcessInformation); free(lpEnvironment); @@ -136,18 +120,18 @@ int TestThreadCreateProcess(int argc, char* argv[]) { CloseHandle(pipe_read); CloseHandle(pipe_write); - printf("CreateProcess failed. error=%"PRIu32"\n", GetLastError()); + printf("CreateProcess failed. error=%" PRIu32 "\n", GetLastError()); return 1; } if (WaitForSingleObject(ProcessInformation.hProcess, 5000) != WAIT_OBJECT_0) { - printf("Failed to wait for second process. error=%"PRIu32"\n", GetLastError()); + printf("Failed to wait for second process. error=%" PRIu32 "\n", GetLastError()); return 1; } ZeroMemory(buf, sizeof(buf)); - ReadFile(pipe_read, buf, sizeof(buf)-1, &read_bytes, NULL); + ReadFile(pipe_read, buf, sizeof(buf) - 1, &read_bytes, NULL); if (!strstr((const char*)buf, TESTENV_A)) { printf("No or unexpected data read from pipe\n"); @@ -160,12 +144,11 @@ int TestThreadCreateProcess(int argc, char* argv[]) exitCode = 0; status = GetExitCodeProcess(ProcessInformation.hProcess, &exitCode); - printf("GetExitCodeProcess status: %"PRId32"\n", status); - printf("Process exited with code: 0x%08"PRIX32"\n", exitCode); + printf("GetExitCodeProcess status: %" PRId32 "\n", status); + printf("Process exited with code: 0x%08" PRIX32 "\n", exitCode); CloseHandle(ProcessInformation.hProcess); CloseHandle(ProcessInformation.hThread); return ret; } - diff --git a/winpr/libwinpr/thread/test/TestThreadExitThread.c b/winpr/libwinpr/thread/test/TestThreadExitThread.c index c9760cc8a..a5aca7d71 100644 --- a/winpr/libwinpr/thread/test/TestThreadExitThread.c +++ b/winpr/libwinpr/thread/test/TestThreadExitThread.c @@ -13,20 +13,15 @@ static DWORD WINAPI thread_func(LPVOID arg) int TestThreadExitThread(int argc, char* argv[]) { - HANDLE thread; + HANDLE thread; DWORD waitResult; int i; /* FIXME: create some noise to better guaranty the test validity and - * decrease the number of loops */ - for (i=0; i<50000; i++) + * decrease the number of loops */ + for (i = 0; i < 50000; i++) { - thread = CreateThread(NULL, - 0, - thread_func, - NULL, - 0, - NULL); + thread = CreateThread(NULL, 0, thread_func, NULL, 0, NULL); if (thread == INVALID_HANDLE_VALUE) { @@ -43,7 +38,8 @@ int TestThreadExitThread(int argc, char* argv[]) * the end of the thread. Therefore WaitForSingleObject * never get the signal. */ - fprintf(stderr, "1 second should have been enough for the thread to be in a signaled state\n"); + fprintf(stderr, + "1 second should have been enough for the thread to be in a signaled state\n"); return -1; } diff --git a/winpr/libwinpr/thread/thread.c b/winpr/libwinpr/thread/thread.c index 404db8faa..a67d2bc5e 100644 --- a/winpr/libwinpr/thread/thread.c +++ b/winpr/libwinpr/thread/thread.c @@ -101,7 +101,7 @@ static void cleanup_handle(void* obj); static BOOL ThreadIsHandled(HANDLE handle) { - WINPR_THREAD* pThread = (WINPR_THREAD*) handle; + WINPR_THREAD* pThread = (WINPR_THREAD*)handle; if (!pThread || (pThread->Type != HANDLE_TYPE_THREAD)) { @@ -114,7 +114,7 @@ static BOOL ThreadIsHandled(HANDLE handle) static int ThreadGetFd(HANDLE handle) { - WINPR_THREAD* pThread = (WINPR_THREAD*) handle; + WINPR_THREAD* pThread = (WINPR_THREAD*)handle; if (!ThreadIsHandled(handle)) return -1; @@ -124,7 +124,7 @@ static int ThreadGetFd(HANDLE handle) static DWORD ThreadCleanupHandle(HANDLE handle) { - WINPR_THREAD* thread = (WINPR_THREAD*) handle; + WINPR_THREAD* thread = (WINPR_THREAD*)handle; if (!ThreadIsHandled(handle)) return WAIT_FAILED; @@ -139,8 +139,7 @@ static DWORD ThreadCleanupHandle(HANDLE handle) if (status != 0) { - WLog_ERR(TAG, "pthread_join failure: [%d] %s", - status, strerror(status)); + WLog_ERR(TAG, "pthread_join failure: [%d] %s", status, strerror(status)); pthread_mutex_unlock(&thread->mutex); return WAIT_FAILED; } @@ -154,30 +153,26 @@ static DWORD ThreadCleanupHandle(HANDLE handle) return WAIT_OBJECT_0; } -static HANDLE_OPS ops = -{ - ThreadIsHandled, - ThreadCloseHandle, - ThreadGetFd, - ThreadCleanupHandle, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL -}; - +static HANDLE_OPS ops = { ThreadIsHandled, + ThreadCloseHandle, + ThreadGetFd, + ThreadCleanupHandle, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL }; static void dump_thread(WINPR_THREAD* thread) { @@ -189,7 +184,7 @@ static void dump_thread(WINPR_THREAD* thread) msg = winpr_backtrace_symbols(stack, &used); for (i = 0; i < used; i++) - WLog_DBG(TAG, "[%"PRIdz"]: %s", i, msg[i]); + WLog_DBG(TAG, "[%" PRIdz "]: %s", i, msg[i]); free(msg); winpr_backtrace_free(stack); @@ -197,7 +192,7 @@ static void dump_thread(WINPR_THREAD* thread) msg = winpr_backtrace_symbols(thread->create_stack, &used); for (i = 0; i < used; i++) - WLog_DBG(TAG, "[%"PRIdz"]: %s", i, msg[i]); + WLog_DBG(TAG, "[%" PRIdz "]: %s", i, msg[i]); free(msg); @@ -215,7 +210,7 @@ static void dump_thread(WINPR_THREAD* thread) msg = winpr_backtrace_symbols(thread->exit_stack, &used); for (i = 0; i < used; i++) - WLog_DBG(TAG, "[%"PRIdz"]: %s", i, msg[i]); + WLog_DBG(TAG, "[%" PRIdz "]: %s", i, msg[i]); free(msg); } @@ -237,8 +232,7 @@ static BOOL set_event(WINPR_THREAD* thread) do { length = eventfd_write(thread->pipe_fd[0], val); - } - while ((length < 0) && (errno == EINTR)); + } while ((length < 0) && (errno == EINTR)); status = (length == 0) ? TRUE : FALSE; #else @@ -269,8 +263,7 @@ static BOOL reset_event(WINPR_THREAD* thread) do { length = eventfd_read(thread->pipe_fd[0], &value); - } - while ((length < 0) && (errno == EINTR)); + } while ((length < 0) && (errno == EINTR)); if ((length > 0) && (!status)) status = TRUE; @@ -299,7 +292,7 @@ static BOOL thread_compare(const void* a, const void* b) static void* thread_launcher(void* arg) { DWORD rc = 0; - WINPR_THREAD* thread = (WINPR_THREAD*) arg; + WINPR_THREAD* thread = (WINPR_THREAD*)arg; LPTHREAD_START_ROUTINE fkt; if (!thread) @@ -355,7 +348,7 @@ static BOOL winpr_StartThread(WINPR_THREAD* thread) pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); if (thread->dwStackSize > 0) - pthread_attr_setstacksize(&attr, (size_t) thread->dwStackSize); + pthread_attr_setstacksize(&attr, (size_t)thread->dwStackSize); thread->started = TRUE; reset_event(thread); @@ -391,14 +384,13 @@ error: return FALSE; } -HANDLE CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes, - SIZE_T dwStackSize, +HANDLE CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId) { HANDLE handle; WINPR_THREAD* thread; - thread = (WINPR_THREAD*) calloc(1, sizeof(WINPR_THREAD)); + thread = (WINPR_THREAD*)calloc(1, sizeof(WINPR_THREAD)); if (!thread) return NULL; @@ -457,7 +449,7 @@ HANDLE CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes, } WINPR_HANDLE_SET_TYPE_AND_MODE(thread, HANDLE_TYPE_THREAD, WINPR_FD_READ); - handle = (HANDLE) thread; + handle = (HANDLE)thread; if (!thread_list) { @@ -506,24 +498,23 @@ error_pipefd0: void cleanup_handle(void* obj) { int rc; - WINPR_THREAD* thread = (WINPR_THREAD*) obj; + WINPR_THREAD* thread = (WINPR_THREAD*)obj; rc = pthread_cond_destroy(&thread->threadIsReady); if (rc) - WLog_ERR(TAG, "failed to destroy a condition variable [%d] %s (%d)", - rc, strerror(errno), errno); + WLog_ERR(TAG, "failed to destroy a condition variable [%d] %s (%d)", rc, strerror(errno), + errno); rc = pthread_mutex_destroy(&thread->threadIsReadyMutex); if (rc) - WLog_ERR(TAG, "failed to destroy a condition variable mutex [%d] %s (%d)", - rc, strerror(errno), errno); + WLog_ERR(TAG, "failed to destroy a condition variable mutex [%d] %s (%d)", rc, + strerror(errno), errno); rc = pthread_mutex_destroy(&thread->mutex); if (rc) - WLog_ERR(TAG, "failed to destroy mutex [%d] %s (%d)", - rc, strerror(errno), errno); + WLog_ERR(TAG, "failed to destroy mutex [%d] %s (%d)", rc, strerror(errno), errno); if (thread->pipe_fd[0] >= 0) close(thread->pipe_fd[0]); @@ -548,7 +539,7 @@ void cleanup_handle(void* obj) BOOL ThreadCloseHandle(HANDLE handle) { - WINPR_THREAD* thread = (WINPR_THREAD*) handle; + WINPR_THREAD* thread = (WINPR_THREAD*)handle; if (!thread_list) { @@ -588,10 +579,9 @@ BOOL ThreadCloseHandle(HANDLE handle) return TRUE; } -HANDLE CreateRemoteThread(HANDLE hProcess, - LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize, - LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, - DWORD dwCreationFlags, LPDWORD lpThreadId) +HANDLE CreateRemoteThread(HANDLE hProcess, LPSECURITY_ATTRIBUTES lpThreadAttributes, + SIZE_T dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, + LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId) { WLog_ERR(TAG, "%s: not implemented", __FUNCTION__); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -637,7 +627,7 @@ VOID ExitThread(DWORD dwExitCode) if (thread->detached || !thread->started) cleanup_handle(thread); - pthread_exit((void*)(size_t) rc); + pthread_exit((void*)(size_t)rc); } } @@ -650,7 +640,7 @@ BOOL GetExitCodeThread(HANDLE hThread, LPDWORD lpExitCode) if (!winpr_Handle_GetInfo(hThread, &Type, &Object)) return FALSE; - thread = (WINPR_THREAD*) Object; + thread = (WINPR_THREAD*)Object; *lpExitCode = thread->dwExitCode; return TRUE; } @@ -698,26 +688,26 @@ DWORD ResumeThread(HANDLE hThread) WINPR_THREAD* thread; if (!winpr_Handle_GetInfo(hThread, &Type, &Object)) - return (DWORD) - 1; + return (DWORD)-1; - thread = (WINPR_THREAD*) Object; + thread = (WINPR_THREAD*)Object; if (pthread_mutex_lock(&thread->mutex)) - return (DWORD) - 1; + return (DWORD)-1; if (!thread->started) { if (!winpr_StartThread(thread)) { pthread_mutex_unlock(&thread->mutex); - return (DWORD) - 1; + return (DWORD)-1; } } else WLog_WARN(TAG, "Thread already started!"); if (pthread_mutex_unlock(&thread->mutex)) - return (DWORD) - 1; + return (DWORD)-1; return 0; } @@ -726,7 +716,7 @@ DWORD SuspendThread(HANDLE hThread) { WLog_ERR(TAG, "%s: not implemented", __FUNCTION__); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return (DWORD) - 1; + return (DWORD)-1; } BOOL SwitchToThread(VOID) @@ -750,7 +740,7 @@ BOOL TerminateThread(HANDLE hThread, DWORD dwExitCode) if (!winpr_Handle_GetInfo(hThread, &Type, &Object)) return FALSE; - thread = (WINPR_THREAD*) Object; + thread = (WINPR_THREAD*)Object; thread->exited = TRUE; thread->dwExitCode = dwExitCode; @@ -781,7 +771,7 @@ VOID DumpThreadHandles(void) for (i = 0; i < used; i++) { - WLog_DBG(TAG, "[%"PRIdz"]: %s", i, msg[i]); + WLog_DBG(TAG, "[%" PRIdz "]: %s", i, msg[i]); } free(msg); @@ -801,21 +791,20 @@ VOID DumpThreadHandles(void) for (x = 0; x < count; x++) { - WINPR_THREAD* thread = ListDictionary_GetItemValue(thread_list, - (void*) keys[x]); + WINPR_THREAD* thread = ListDictionary_GetItemValue(thread_list, (void*)keys[x]); WLog_DBG(TAG, "Thread [%d] handle created still not closed!", x); msg = winpr_backtrace_symbols(thread->create_stack, &used); for (i = 0; i < used; i++) { - WLog_DBG(TAG, "[%"PRIdz"]: %s", i, msg[i]); + WLog_DBG(TAG, "[%" PRIdz "]: %s", i, msg[i]); } free(msg); if (thread->started) { - WLog_DBG(TAG, "Thread [%d] still running!", x); + WLog_DBG(TAG, "Thread [%d] still running!", x); } else { @@ -823,7 +812,7 @@ VOID DumpThreadHandles(void) msg = winpr_backtrace_symbols(thread->exit_stack, &used); for (i = 0; i < used; i++) - WLog_DBG(TAG, "[%"PRIdz"]: %s", i, msg[i]); + WLog_DBG(TAG, "[%" PRIdz "]: %s", i, msg[i]); free(msg); } @@ -837,4 +826,3 @@ VOID DumpThreadHandles(void) } #endif #endif - diff --git a/winpr/libwinpr/thread/thread.h b/winpr/libwinpr/thread/thread.h index 6d32d70e2..97eb99695 100644 --- a/winpr/libwinpr/thread/thread.h +++ b/winpr/libwinpr/thread/thread.h @@ -29,7 +29,7 @@ #include "../handle/handle.h" -typedef void *(*pthread_start_routine)(void *); +typedef void* (*pthread_start_routine)(void*); struct winpr_thread { @@ -51,8 +51,8 @@ struct winpr_thread LPTHREAD_START_ROUTINE lpStartAddress; LPSECURITY_ATTRIBUTES lpThreadAttributes; #if defined(WITH_DEBUG_THREADS) - void *create_stack; - void *exit_stack; + void* create_stack; + void* exit_stack; #endif }; typedef struct winpr_thread WINPR_THREAD; @@ -70,4 +70,3 @@ typedef struct winpr_process WINPR_PROCESS; #endif #endif /* WINPR_THREAD_PRIVATE_H */ - diff --git a/winpr/libwinpr/thread/tls.c b/winpr/libwinpr/thread/tls.c index f11aeade3..fabcf0dca 100644 --- a/winpr/libwinpr/thread/tls.c +++ b/winpr/libwinpr/thread/tls.c @@ -50,15 +50,15 @@ LPVOID TlsGetValue(DWORD dwTlsIndex) { LPVOID value; pthread_key_t key; - key = (pthread_key_t) dwTlsIndex; - value = (LPVOID) pthread_getspecific(key); + key = (pthread_key_t)dwTlsIndex; + value = (LPVOID)pthread_getspecific(key); return value; } BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue) { pthread_key_t key; - key = (pthread_key_t) dwTlsIndex; + key = (pthread_key_t)dwTlsIndex; pthread_setspecific(key, lpTlsValue); return TRUE; } @@ -66,10 +66,9 @@ BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue) BOOL TlsFree(DWORD dwTlsIndex) { pthread_key_t key; - key = (pthread_key_t) dwTlsIndex; + key = (pthread_key_t)dwTlsIndex; pthread_key_delete(key); return TRUE; } #endif - diff --git a/winpr/libwinpr/timezone/TimeZones.c b/winpr/libwinpr/timezone/TimeZones.c index e7a390eb7..934ec2557 100644 --- a/winpr/libwinpr/timezone/TimeZones.c +++ b/winpr/libwinpr/timezone/TimeZones.c @@ -27,1558 +27,3809 @@ struct _TIME_ZONE_ENTRY typedef struct _TIME_ZONE_ENTRY TIME_ZONE_ENTRY; #pragma pack(pop) -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_2[] = -{ - { 633031164000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 4, 0, 1, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 633032028000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, } +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_2[] = { { + 633031164000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 4, 0, 1, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 633032028000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_5[] = { { + 633031164000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 4, 0, 1, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 633032028000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_7[] = { { + 633978108000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 4, 0, 1, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 633978972000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_9[] = { { + 633031164000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 4, 0, 1, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 633032028000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_11[] = { { + 3155378076000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 4, 0, 1, 2, 0, 0, 0 }, +} }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_12[] = { { + 633031164000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 4, 0, 1, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 633032028000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_14[] = { { + 633031164000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 4, 0, 1, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 633032028000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_15[] = { { + 633346524000000000ULL, + 0ULL, + 60, + { 0, 3, 6, 2, 22, 0, 0, 0 }, + { 0, 10, 6, 2, 22, 0, 0, 0 }, + }, + { + 633662748000000000ULL, + 633347388000000000ULL, + 60, + { 0, 3, 6, 5, 22, 0, 0, 0 }, + { 0, 10, 6, 2, 22, 0, 0, 0 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 3, 6, 2, 22, 0, 0, 0 }, + { 0, 10, 6, 2, 22, 0, 0, 0 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 4, 6, 1, 22, 0, 0, 0 }, + { 0, 10, 6, 2, 22, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 5, 6, 1, 22, 0, 0, 0 }, + { 0, 8, 6, 3, 22, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 4, 6, 5, 22, 0, 0, 0 }, + { 0, 9, 6, 1, 22, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 4, 6, 5, 22, 0, 0, 0 }, + { 0, 9, 6, 1, 22, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 4, 6, 5, 22, 0, 0, 0 }, + { 0, 9, 6, 1, 22, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 635871996000000000ULL, + 60, + { 0, 5, 6, 2, 22, 0, 0, 0 }, + { 0, 8, 6, 2, 22, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_16[] = { { + 3155378076000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 4, 0, 1, 2, 0, 0, 0 }, +} }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_19[] = { { + 635555772000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 4, 0, 1, 2, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 60, + { 0, 1, 4, 1, 0, 0, 0, 0 }, + { 0, 2, 0, 1, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_20[] = { { + 633031164000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 4, 0, 1, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 633032028000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_21[] = { { + 633031164000000000ULL, + 0ULL, + 60, + { 0, 10, 6, 5, 23, 59, 59, 999 }, + { 0, 4, 6, 1, 23, 59, 59, 999 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 636188220000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_22[] = { { + 632084220000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 1, 0, 0, 0 }, + { 0, 4, 0, 1, 0, 0, 0, 0 }, + }, + { + 632400444000000000ULL, + 632085084000000000ULL, + 60, + { 0, 1, 4, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 0, 0, 0, 0 }, + }, + { + 632715804000000000ULL, + 632401308000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 633031164000000000ULL, + 632716668000000000ULL, + 60, + { 0, 10, 0, 5, 1, 0, 0, 0 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 633346524000000000ULL, + 633032028000000000ULL, + 60, + { 0, 10, 0, 5, 1, 0, 0, 0 }, + { 0, 3, 0, 2, 0, 0, 0, 0 }, + }, + { + 633662748000000000ULL, + 633347388000000000ULL, + 60, + { 0, 10, 0, 5, 1, 0, 0, 0 }, + { 0, 3, 0, 3, 0, 0, 0, 0 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 10, 0, 5, 1, 0, 0, 0 }, + { 0, 3, 0, 2, 0, 0, 0, 0 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 10, 0, 5, 1, 0, 0, 0 }, + { 0, 3, 0, 2, 0, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 11, 0, 2, 1, 0, 0, 0 }, + { 0, 3, 0, 3, 0, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 11, 0, 1, 1, 0, 0, 0 }, + { 0, 4, 0, 1, 0, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 634925916000000000ULL, + 60, + { 0, 11, 0, 1, 1, 0, 0, 0 }, + { 0, 3, 0, 2, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_23[] = { { + 633031164000000000ULL, + 632716668000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 4, 0, 1, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 633032028000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_24[] = { { + 635555772000000000ULL, + 0ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 60, + { 0, 1, 4, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 636502716000000000ULL, + 636188220000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 636818076000000000ULL, + 636503580000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 1, 1, 1, 0, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 636818940000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_25[] = { { + 633662748000000000ULL, + 0ULL, + 60, + { 0, 3, 6, 2, 23, 59, 59, 999 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 3, 6, 1, 23, 59, 59, 999 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 4, 6, 2, 23, 59, 59, 999 }, + { 0, 10, 6, 1, 23, 59, 59, 999 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 4, 6, 2, 23, 59, 59, 999 }, + { 0, 10, 6, 1, 23, 59, 59, 999 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 4, 6, 1, 23, 59, 59, 999 }, + { 0, 10, 6, 1, 23, 59, 59, 999 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 3, 6, 4, 23, 59, 59, 999 }, + { 0, 10, 6, 1, 23, 59, 59, 999 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 3, 6, 4, 23, 59, 59, 999 }, + { 0, 10, 6, 1, 23, 59, 59, 999 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 60, + { 0, 3, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 1, 23, 59, 59, 999 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + 60, + { 0, 3, 6, 5, 23, 59, 59, 999 }, + { 0, 10, 6, 1, 23, 59, 59, 999 }, + }, + { + 636502716000000000ULL, + 636188220000000000ULL, + 60, + { 0, 3, 6, 5, 23, 59, 59, 999 }, + { 0, 9, 6, 5, 23, 59, 59, 999 }, + }, + { + 636818076000000000ULL, + 636503580000000000ULL, + 60, + { 0, 3, 6, 4, 23, 59, 59, 999 }, + { 0, 10, 6, 1, 23, 59, 59, 999 }, + }, + { + 637133436000000000ULL, + 636818940000000000ULL, + 60, + { 0, 3, 6, 4, 23, 59, 59, 999 }, + { 0, 10, 6, 1, 23, 59, 59, 999 }, + }, + { + 637449660000000000ULL, + 637134300000000000ULL, + 60, + { 0, 3, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 1, 23, 59, 59, 999 }, + }, + { + 3155378076000000000ULL, + 637450524000000000ULL, + 60, + { 0, 3, 6, 5, 23, 59, 59, 999 }, + { 0, 10, 6, 1, 23, 59, 59, 999 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_26[] = { { + 633031164000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 4, 0, 1, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 633032028000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_27[] = { { + 633346524000000000ULL, + 633032028000000000ULL, + 30, + { 0, 12, 0, 2, 3, 0, 0, 0 }, + { 0, 1, 1, 1, 0, 0, 0, 0 }, + }, + { + 633662748000000000ULL, + 633347388000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + -30, + { 0, 5, 0, 1, 2, 30, 0, 0 }, + { 0, 1, 5, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_28[] = { { + 632400444000000000ULL, + 0ULL, + 60, + { 0, 1, 4, 1, 0, 0, 0, 0 }, + { 0, 11, 2, 1, 0, 0, 0, 0 }, + }, + { + 632715804000000000ULL, + 632401308000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 0, 3, 0, 0, 0, 0 }, + }, + { + 633031164000000000ULL, + 632716668000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 0, 1, 0, 0, 0, 0 }, + }, + { + 633346524000000000ULL, + 633032028000000000ULL, + 60, + { 0, 2, 6, 5, 23, 59, 59, 999 }, + { 0, 10, 0, 2, 0, 0, 0, 0 }, + }, + { + 633662748000000000ULL, + 633347388000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 0, 3, 0, 0, 0, 0 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 2, 6, 2, 23, 59, 59, 999 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 2, 6, 4, 23, 59, 59, 999 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 636502716000000000ULL, + 636188220000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 2, 23, 59, 59, 999 }, + }, + { + 636818076000000000ULL, + 636503580000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 637133436000000000ULL, + 636818940000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 637449660000000000ULL, + 637134300000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 5, 23, 59, 59, 999 }, + }, + { + 637765020000000000ULL, + 637450524000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 638080380000000000ULL, + 637765884000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 638395740000000000ULL, + 638081244000000000ULL, + 60, + { 0, 2, 6, 5, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 638711964000000000ULL, + 638396604000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 639027324000000000ULL, + 638712828000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 639342684000000000ULL, + 639028188000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 5, 23, 59, 59, 999 }, + }, + { + 639658044000000000ULL, + 639343548000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 639974268000000000ULL, + 639658908000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 640289628000000000ULL, + 639975132000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 640604988000000000ULL, + 640290492000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 640920348000000000ULL, + 640605852000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 641236572000000000ULL, + 640921212000000000ULL, + 60, + { 0, 2, 6, 2, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 641551932000000000ULL, + 641237436000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 641867292000000000ULL, + 641552796000000000ULL, + 60, + { 0, 2, 6, 5, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 642182652000000000ULL, + 641868156000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 642498876000000000ULL, + 642183516000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 642814236000000000ULL, + 642499740000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 5, 23, 59, 59, 999 }, + }, + { + 643129596000000000ULL, + 642815100000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 643444956000000000ULL, + 643130460000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 3155378076000000000ULL, + 643445820000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_30[] = { { + 633346524000000000ULL, + 0ULL, + 60, + { 0, 3, 6, 2, 23, 59, 59, 999 }, + { 0, 10, 6, 2, 23, 59, 59, 999 }, + }, + { + 633662748000000000ULL, + 633347388000000000ULL, + 60, + { 0, 3, 6, 5, 23, 59, 59, 999 }, + { 0, 10, 6, 2, 23, 59, 59, 999 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 3, 6, 2, 23, 59, 59, 999 }, + { 0, 10, 6, 2, 23, 59, 59, 999 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 4, 6, 1, 23, 59, 59, 999 }, + { 0, 10, 6, 2, 23, 59, 59, 999 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 5, 6, 1, 23, 59, 59, 999 }, + { 0, 8, 6, 3, 23, 59, 59, 999 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 4, 6, 5, 23, 59, 59, 999 }, + { 0, 9, 6, 1, 23, 59, 59, 999 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 4, 6, 5, 23, 59, 59, 999 }, + { 0, 9, 6, 1, 23, 59, 59, 999 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 4, 6, 5, 23, 59, 59, 999 }, + { 0, 9, 6, 1, 23, 59, 59, 999 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 635871996000000000ULL, + 60, + { 0, 5, 6, 2, 23, 59, 59, 999 }, + { 0, 8, 6, 2, 23, 59, 59, 999 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_31[] = { { + 633031164000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 0, 1, 0, 0 }, + { 0, 4, 0, 1, 0, 1, 0, 0 }, + }, + { + 633346524000000000ULL, + 633032028000000000ULL, + 60, + { 0, 11, 0, 1, 0, 1, 0, 0 }, + { 0, 3, 0, 2, 0, 1, 0, 0 }, + }, + { + 633662748000000000ULL, + 633347388000000000ULL, + 60, + { 0, 11, 0, 1, 0, 1, 0, 0 }, + { 0, 3, 0, 2, 0, 1, 0, 0 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 11, 0, 1, 0, 1, 0, 0 }, + { 0, 3, 0, 2, 0, 1, 0, 0 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 11, 0, 1, 0, 1, 0, 0 }, + { 0, 3, 0, 2, 0, 1, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 0, 1, 0, 0 }, + }, + { + 3155378076000000000ULL, + 634609692000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_32[] = { { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + { 0, 10, 0, 3, 0, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 1, 2, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_33[] = { { + 632400444000000000ULL, + 0ULL, + 60, + { 0, 2, 6, 2, 23, 59, 59, 999 }, + { 0, 11, 2, 1, 0, 0, 0, 0 }, + }, + { + 632715804000000000ULL, + 632401308000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 0, 3, 0, 0, 0, 0 }, + }, + { + 633031164000000000ULL, + 632716668000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 0, 1, 0, 0, 0, 0 }, + }, + { + 633346524000000000ULL, + 633032028000000000ULL, + 60, + { 0, 2, 6, 5, 23, 59, 59, 999 }, + { 0, 10, 0, 2, 0, 0, 0, 0 }, + }, + { + 633662748000000000ULL, + 633347388000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 0, 3, 0, 0, 0, 0 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 2, 6, 2, 23, 59, 59, 999 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 2, 6, 4, 23, 59, 59, 999 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 636502716000000000ULL, + 636188220000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 2, 23, 59, 59, 999 }, + }, + { + 636818076000000000ULL, + 636503580000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 637133436000000000ULL, + 636818940000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 637449660000000000ULL, + 637134300000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 5, 23, 59, 59, 999 }, + }, + { + 637765020000000000ULL, + 637450524000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 638080380000000000ULL, + 637765884000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 638395740000000000ULL, + 638081244000000000ULL, + 60, + { 0, 2, 6, 5, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 638711964000000000ULL, + 638396604000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 639027324000000000ULL, + 638712828000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 639342684000000000ULL, + 639028188000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 5, 23, 59, 59, 999 }, + }, + { + 639658044000000000ULL, + 639343548000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 639974268000000000ULL, + 639658908000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 640289628000000000ULL, + 639975132000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 640604988000000000ULL, + 640290492000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 640920348000000000ULL, + 640605852000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 641236572000000000ULL, + 640921212000000000ULL, + 60, + { 0, 2, 6, 2, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 641551932000000000ULL, + 641237436000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 641867292000000000ULL, + 641552796000000000ULL, + 60, + { 0, 2, 6, 5, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 642182652000000000ULL, + 641868156000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 642498876000000000ULL, + 642183516000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 642814236000000000ULL, + 642499740000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 10, 6, 5, 23, 59, 59, 999 }, + }, + { + 643129596000000000ULL, + 642815100000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 643444956000000000ULL, + 643130460000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + }, + { + 3155378076000000000ULL, + 643445820000000000ULL, + 60, + { 0, 2, 6, 3, 23, 59, 59, 999 }, + { 0, 11, 6, 1, 23, 59, 59, 999 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_35[] = { { + 633346524000000000ULL, + 633032028000000000ULL, + 60, + { 0, 1, 1, 1, 0, 0, 0, 0 }, + { 0, 12, 0, 5, 0, 0, 0, 0 }, + }, + { + 633662748000000000ULL, + 633347388000000000ULL, + 60, + { 0, 3, 0, 3, 0, 0, 0, 0 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 3, 6, 2, 23, 59, 59, 999 }, + { 0, 1, 4, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_36[] = { { + 632400444000000000ULL, + 0ULL, + 60, + { 0, 10, 6, 5, 23, 0, 0, 0 }, + { 0, 3, 6, 5, 22, 0, 0, 0 }, + }, + { + 632715804000000000ULL, + 632401308000000000ULL, + 60, + { 0, 10, 6, 5, 23, 0, 0, 0 }, + { 0, 3, 6, 5, 22, 0, 0, 0 }, + }, + { + 633031164000000000ULL, + 632716668000000000ULL, + 60, + { 0, 10, 6, 5, 23, 0, 0, 0 }, + { 0, 3, 6, 5, 22, 0, 0, 0 }, + }, + { + 633346524000000000ULL, + 633032028000000000ULL, + 60, + { 0, 10, 6, 5, 23, 0, 0, 0 }, + { 0, 3, 6, 4, 22, 0, 0, 0 }, + }, + { + 633662748000000000ULL, + 633347388000000000ULL, + 60, + { 0, 10, 6, 5, 23, 0, 0, 0 }, + { 0, 3, 6, 5, 22, 0, 0, 0 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 10, 6, 4, 23, 0, 0, 0 }, + { 0, 3, 6, 5, 22, 0, 0, 0 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 10, 6, 5, 23, 0, 0, 0 }, + { 0, 3, 6, 5, 22, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 10, 6, 5, 23, 0, 0, 0 }, + { 0, 3, 6, 5, 22, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 10, 6, 5, 23, 0, 0, 0 }, + { 0, 3, 6, 4, 22, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 10, 6, 5, 23, 0, 0, 0 }, + { 0, 3, 6, 5, 22, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 6, 5, 23, 0, 0, 0 }, + { 0, 3, 6, 5, 22, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 60, + { 0, 10, 6, 4, 23, 0, 0, 0 }, + { 0, 3, 6, 5, 22, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + 60, + { 0, 10, 6, 5, 23, 0, 0, 0 }, + { 0, 3, 6, 5, 22, 0, 0, 0 }, + }, + { + 636502716000000000ULL, + 636188220000000000ULL, + 60, + { 0, 10, 6, 5, 23, 0, 0, 0 }, + { 0, 3, 6, 5, 22, 0, 0, 0 }, + }, + { + 636818076000000000ULL, + 636503580000000000ULL, + 60, + { 0, 10, 6, 5, 23, 0, 0, 0 }, + { 0, 3, 6, 4, 22, 0, 0, 0 }, + }, + { + 637133436000000000ULL, + 636818940000000000ULL, + 60, + { 0, 10, 6, 5, 23, 0, 0, 0 }, + { 0, 3, 6, 5, 22, 0, 0, 0 }, + }, + { + 637449660000000000ULL, + 637134300000000000ULL, + 60, + { 0, 10, 6, 4, 23, 0, 0, 0 }, + { 0, 3, 6, 5, 22, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 637450524000000000ULL, + 60, + { 0, 10, 6, 5, 23, 0, 0, 0 }, + { 0, 3, 6, 5, 22, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_37[] = { { + 635555772000000000ULL, + 0ULL, + 60, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + { 0, 10, 0, 1, 2, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 60, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + { 0, 1, 4, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_38[] = { { + 633346524000000000ULL, + 0ULL, + 60, + { 0, 3, 6, 2, 23, 59, 59, 999 }, + { 0, 10, 6, 2, 23, 59, 59, 999 }, + }, + { + 633662748000000000ULL, + 633347388000000000ULL, + 60, + { 0, 3, 6, 5, 23, 59, 59, 999 }, + { 0, 10, 6, 2, 23, 59, 59, 999 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 3, 6, 2, 23, 59, 59, 999 }, + { 0, 10, 6, 2, 23, 59, 59, 999 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 4, 6, 1, 23, 59, 59, 999 }, + { 0, 10, 6, 2, 23, 59, 59, 999 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 5, 6, 1, 23, 59, 59, 999 }, + { 0, 8, 6, 3, 23, 59, 59, 999 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 4, 6, 5, 23, 59, 59, 999 }, + { 0, 9, 6, 1, 23, 59, 59, 999 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 4, 6, 5, 23, 59, 59, 999 }, + { 0, 9, 6, 1, 23, 59, 59, 999 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 4, 6, 5, 23, 59, 59, 999 }, + { 0, 9, 6, 1, 23, 59, 59, 999 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + 60, + { 0, 5, 6, 2, 23, 59, 59, 999 }, + { 0, 8, 6, 2, 23, 59, 59, 999 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_39[] = { { + 633031164000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 4, 0, 1, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 633032028000000000ULL, + 60, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 0, 2, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_40[] = { { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 10, 6, 3, 23, 59, 59, 999 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 2, 6, 4, 23, 59, 59, 999 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_42[] = { { + 3155378076000000000ULL, + 0ULL, + 60, + { 0, 9, 0, 5, 2, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, +} }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_43[] = { { + 3155378076000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 1, 0, 0, 0 }, + { 0, 3, 0, 5, 0, 0, 0, 0 }, +} }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_46[] = { { + 633662748000000000ULL, + 633347388000000000ULL, + 60, + { 0, 8, 0, 5, 23, 59, 59, 999 }, + { 0, 5, 6, 5, 23, 59, 59, 999 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 8, 4, 3, 23, 59, 59, 999 }, + { 0, 5, 0, 5, 23, 59, 59, 999 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 8, 6, 1, 23, 59, 59, 999 }, + { 0, 5, 6, 1, 23, 59, 59, 999 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 7, 6, 5, 23, 59, 59, 999 }, + { 0, 4, 6, 1, 23, 59, 59, 999 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 9, 0, 5, 3, 0, 0, 0 }, + { 0, 4, 0, 5, 2, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 4, 0, 5, 2, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 636502716000000000ULL, + 636188220000000000ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 636818076000000000ULL, + 636503580000000000ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 636818940000000000ULL, + 60, + { 0, 10, 0, 4, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_47[] = { { + 3155378076000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 3, 0, 5, 1, 0, 0, 0 }, +} }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_49[] = { { + 3155378076000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, +} }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_50[] = { { + 3155378076000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, +} }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_51[] = { { + 3155378076000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, +} }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_52[] = { { + 636502716000000000ULL, + 0ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 636818076000000000ULL, + 636503580000000000ULL, + -60, + { 0, 1, 1, 1, 1, 0, 0, 0 }, + { 0, 1, 1, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_53[] = { { + 3155378076000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, +} }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_55[] = { { + 634608828000000000ULL, + 0ULL, + 60, + { 0, 10, 5, 5, 1, 0, 0, 0 }, + { 0, 3, 4, 5, 23, 59, 59, 999 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + { 0, 3, 4, 5, 23, 59, 59, 999 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 12, 5, 3, 0, 0, 0, 0 }, + { 0, 1, 2, 1, 0, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 5, 5, 1, 0, 0, 0 }, + { 0, 3, 4, 5, 23, 59, 59, 999 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_56[] = { { + 3155378076000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 4, 0, 0, 0 }, + { 0, 3, 0, 5, 3, 0, 0, 0 }, +} }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_57[] = { { + 633978108000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 0, 0, 0, 0 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 10, 6, 5, 23, 59, 59, 999 }, + { 0, 3, 6, 5, 23, 59, 59, 999 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 10, 6, 5, 23, 59, 59, 999 }, + { 0, 3, 6, 5, 23, 59, 59, 999 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 10, 6, 5, 23, 59, 59, 999 }, + { 0, 3, 6, 4, 23, 59, 59, 999 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 10, 6, 5, 23, 59, 59, 999 }, + { 0, 3, 6, 5, 23, 59, 59, 999 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 6, 5, 23, 59, 59, 999 }, + { 0, 3, 6, 5, 23, 59, 59, 999 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 60, + { 0, 10, 6, 4, 23, 59, 59, 999 }, + { 0, 3, 6, 5, 23, 59, 59, 999 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + 60, + { 0, 10, 6, 5, 23, 59, 59, 999 }, + { 0, 3, 6, 5, 23, 59, 59, 999 }, + }, + { + 636502716000000000ULL, + 636188220000000000ULL, + 60, + { 0, 10, 6, 5, 23, 59, 59, 999 }, + { 0, 3, 6, 5, 23, 59, 59, 999 }, + }, + { + 636818076000000000ULL, + 636503580000000000ULL, + 60, + { 0, 10, 6, 5, 23, 59, 59, 999 }, + { 0, 3, 6, 4, 23, 59, 59, 999 }, + }, + { + 637133436000000000ULL, + 636818940000000000ULL, + 60, + { 0, 10, 6, 5, 23, 59, 59, 999 }, + { 0, 3, 6, 5, 23, 59, 59, 999 }, + }, + { + 637449660000000000ULL, + 637134300000000000ULL, + 60, + { 0, 10, 6, 4, 23, 59, 59, 999 }, + { 0, 3, 6, 5, 23, 59, 59, 999 }, + }, + { + 3155378076000000000ULL, + 637450524000000000ULL, + 60, + { 0, 10, 6, 5, 23, 59, 59, 999 }, + { 0, 3, 6, 5, 23, 59, 59, 999 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_58[] = { { + 632715804000000000ULL, + 0ULL, + 60, + { 0, 9, 4, 5, 23, 59, 59, 999 }, + { 0, 4, 5, 5, 0, 0, 0, 0 }, + }, + { + 633031164000000000ULL, + 632716668000000000ULL, + 60, + { 0, 9, 4, 3, 23, 59, 59, 999 }, + { 0, 4, 5, 5, 0, 0, 0, 0 }, + }, + { + 633346524000000000ULL, + 633032028000000000ULL, + 60, + { 0, 9, 4, 1, 23, 59, 59, 999 }, + { 0, 4, 4, 5, 23, 59, 59, 999 }, + }, + { + 633662748000000000ULL, + 633347388000000000ULL, + 60, + { 0, 8, 4, 5, 23, 59, 59, 999 }, + { 0, 4, 4, 5, 23, 59, 59, 999 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 8, 4, 3, 23, 59, 59, 999 }, + { 0, 4, 4, 4, 23, 59, 59, 999 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 9, 4, 5, 23, 59, 59, 999 }, + { 0, 4, 4, 5, 23, 59, 59, 999 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 9, 4, 5, 23, 59, 59, 999 }, + { 0, 5, 4, 3, 23, 59, 59, 999 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_59[] = { { + 3155378076000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, +} }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_60[] = { { + 632400444000000000ULL, + 0ULL, + 60, + { 0, 9, 4, 5, 23, 59, 59, 999 }, + { 0, 4, 4, 1, 0, 0, 0, 0 }, + }, + { + 632715804000000000ULL, + 632401308000000000ULL, + 60, + { 0, 9, 5, 5, 23, 59, 59, 999 }, + { 0, 4, 5, 1, 0, 0, 0, 0 }, + }, + { + 633031164000000000ULL, + 632716668000000000ULL, + 60, + { 0, 9, 4, 3, 23, 59, 59, 999 }, + { 0, 4, 6, 1, 0, 0, 0, 0 }, + }, + { + 633346524000000000ULL, + 633032028000000000ULL, + 60, + { 0, 11, 4, 1, 23, 59, 59, 999 }, + { 0, 3, 5, 5, 0, 0, 0, 0 }, + }, + { + 633662748000000000ULL, + 633347388000000000ULL, + 60, + { 0, 10, 5, 5, 23, 59, 59, 999 }, + { 0, 4, 5, 1, 0, 0, 0, 0 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 10, 4, 5, 23, 59, 59, 999 }, + { 0, 3, 5, 5, 0, 0, 0, 0 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 10, 4, 5, 23, 59, 59, 999 }, + { 0, 4, 5, 1, 0, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 10, 4, 5, 23, 59, 59, 999 }, + { 0, 4, 5, 1, 0, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 10, 4, 5, 23, 59, 59, 999 }, + { 0, 3, 5, 5, 0, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 10, 4, 4, 23, 59, 59, 999 }, + { 0, 3, 5, 5, 0, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 4, 5, 23, 59, 59, 999 }, + { 0, 3, 5, 5, 0, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 60, + { 0, 10, 4, 5, 23, 59, 59, 999 }, + { 0, 3, 5, 5, 0, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + 60, + { 0, 10, 4, 5, 23, 59, 59, 999 }, + { 0, 3, 5, 5, 0, 0, 0, 0 }, + }, + { + 636502716000000000ULL, + 636188220000000000ULL, + 60, + { 0, 10, 4, 5, 23, 59, 59, 999 }, + { 0, 3, 5, 5, 0, 0, 0, 0 }, + }, + { + 636818076000000000ULL, + 636503580000000000ULL, + 60, + { 0, 10, 4, 5, 23, 59, 59, 999 }, + { 0, 3, 5, 5, 0, 0, 0, 0 }, + }, + { + 637133436000000000ULL, + 636818940000000000ULL, + 60, + { 0, 10, 4, 4, 23, 59, 59, 999 }, + { 0, 3, 5, 5, 0, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 637134300000000000ULL, + 60, + { 0, 10, 4, 5, 23, 59, 59, 999 }, + { 0, 3, 5, 5, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_61[] = { { + 634925052000000000ULL, + 0ULL, + 60, + { 0, 9, 5, 3, 1, 0, 0, 0 }, + { 0, 3, 4, 5, 23, 59, 59, 999 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 9, 4, 5, 23, 59, 59, 999 }, + { 0, 3, 4, 5, 23, 59, 59, 999 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 4, 4, 23, 59, 59, 999 }, + { 0, 3, 4, 5, 23, 59, 59, 999 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 60, + { 0, 10, 4, 4, 23, 59, 59, 999 }, + { 0, 3, 5, 5, 23, 59, 59, 999 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + 60, + { 0, 10, 6, 5, 1, 0, 0, 0 }, + { 0, 3, 6, 5, 1, 0, 0, 0 }, + }, + { + 636502716000000000ULL, + 636188220000000000ULL, + 60, + { 0, 10, 6, 5, 1, 0, 0, 0 }, + { 0, 3, 6, 5, 1, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 636503580000000000ULL, + 60, + { 0, 10, 6, 5, 1, 0, 0, 0 }, + { 0, 3, 6, 4, 1, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_63[] = { { + 3155378076000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 4, 0, 0, 0 }, + { 0, 3, 0, 5, 3, 0, 0, 0 }, +} }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_64[] = { { + 632400444000000000ULL, + 0ULL, + 60, + { 0, 9, 3, 4, 1, 0, 0, 0 }, + { 0, 4, 3, 1, 1, 0, 0, 0 }, + }, + { + 632715804000000000ULL, + 632401308000000000ULL, + 60, + { 0, 10, 0, 2, 2, 0, 0, 0 }, + { 0, 4, 5, 1, 2, 0, 0, 0 }, + }, + { + 633031164000000000ULL, + 632716668000000000ULL, + 60, + { 0, 10, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 5, 5, 2, 0, 0, 0 }, + }, + { + 633346524000000000ULL, + 633032028000000000ULL, + 60, + { 0, 9, 0, 3, 2, 0, 0, 0 }, + { 0, 3, 5, 5, 2, 0, 0, 0 }, + }, + { + 633662748000000000ULL, + 633347388000000000ULL, + 60, + { 0, 10, 0, 1, 2, 0, 0, 0 }, + { 0, 3, 5, 5, 2, 0, 0, 0 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 9, 0, 5, 2, 0, 0, 0 }, + { 0, 3, 5, 5, 2, 0, 0, 0 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 9, 0, 2, 2, 0, 0, 0 }, + { 0, 3, 5, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 10, 0, 1, 2, 0, 0, 0 }, + { 0, 4, 5, 1, 2, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 9, 0, 4, 2, 0, 0, 0 }, + { 0, 3, 5, 5, 2, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 3, 5, 5, 2, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 3, 5, 5, 2, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 3, 5, 5, 2, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 3, 5, 5, 2, 0, 0, 0 }, + }, + { + 636502716000000000ULL, + 636188220000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 3, 5, 4, 2, 0, 0, 0 }, + }, + { + 636818076000000000ULL, + 636503580000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 3, 5, 4, 2, 0, 0, 0 }, + }, + { + 637133436000000000ULL, + 636818940000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 3, 5, 5, 2, 0, 0, 0 }, + }, + { + 637449660000000000ULL, + 637134300000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 3, 5, 5, 2, 0, 0, 0 }, + }, + { + 637765020000000000ULL, + 637450524000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 3, 5, 5, 2, 0, 0, 0 }, + }, + { + 638080380000000000ULL, + 637765884000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 3, 5, 5, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 638081244000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 3, 5, 4, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_65[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 3, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_66[] = { { + 636187356000000000ULL, + 0ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 636502716000000000ULL, + 636188220000000000ULL, + 60, + { 0, 10, 2, 5, 23, 59, 59, 999 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_67[] = { { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 11, 6, 2, 2, 0, 0, 0 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 1, 2, 1, 0, 0, 0, 0 }, + { 0, 3, 5, 5, 1, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_68[] = { { + 636502716000000000ULL, + 0ULL, + 60, + { 0, 4, 0, 1, 2, 0, 0, 0 }, + { 0, 9, 0, 1, 2, 0, 0, 0 }, +} }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_69[] = { { + 632400444000000000ULL, + 0ULL, + 60, + { 0, 10, 5, 1, 4, 0, 0, 0 }, + { 0, 4, 4, 1, 3, 0, 0, 0 }, + }, + { + 632715804000000000ULL, + 632401308000000000ULL, + 60, + { 0, 10, 6, 1, 4, 0, 0, 0 }, + { 0, 4, 5, 1, 3, 0, 0, 0 }, + }, + { + 633031164000000000ULL, + 632716668000000000ULL, + 60, + { 0, 10, 0, 1, 4, 0, 0, 0 }, + { 0, 4, 6, 1, 3, 0, 0, 0 }, + }, + { + 633346524000000000ULL, + 633032028000000000ULL, + 60, + { 0, 10, 1, 1, 4, 0, 0, 0 }, + { 0, 4, 0, 1, 3, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_70[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 4, 0, 0, 0 }, + { 0, 3, 0, 5, 3, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 10, 0, 5, 4, 0, 0, 0 }, + { 0, 3, 1, 5, 3, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 10, 0, 5, 4, 0, 0, 0 }, + { 0, 3, 0, 5, 3, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 10, 0, 5, 4, 0, 0, 0 }, + { 0, 3, 0, 5, 3, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 0, 5, 4, 0, 0, 0 }, + { 0, 3, 1, 5, 3, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 60, + { 0, 11, 0, 2, 4, 0, 0, 0 }, + { 0, 3, 0, 5, 3, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + -60, + { 0, 3, 0, 5, 3, 0, 0, 0 }, + { 0, 1, 5, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_72[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_73[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 3, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_75[] = { { + 632400444000000000ULL, + 0ULL, + 60, + { 0, 9, 1, 3, 23, 59, 59, 999 }, + { 0, 3, 0, 3, 0, 0, 0, 0 }, + }, + { + 632715804000000000ULL, + 632401308000000000ULL, + 60, + { 0, 9, 3, 3, 23, 59, 59, 999 }, + { 0, 3, 2, 4, 0, 0, 0, 0 }, + }, + { + 633662748000000000ULL, + 633347388000000000ULL, + 60, + { 0, 9, 6, 3, 23, 59, 59, 999 }, + { 0, 3, 5, 3, 0, 0, 0, 0 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 9, 1, 3, 23, 59, 59, 999 }, + { 0, 3, 0, 4, 0, 0, 0, 0 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 9, 2, 3, 23, 59, 59, 999 }, + { 0, 3, 1, 4, 0, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 9, 3, 3, 23, 59, 59, 999 }, + { 0, 3, 2, 4, 0, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 9, 4, 3, 23, 59, 59, 999 }, + { 0, 3, 3, 3, 0, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 9, 6, 3, 23, 59, 59, 999 }, + { 0, 3, 5, 4, 0, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 9, 0, 3, 23, 59, 59, 999 }, + { 0, 3, 6, 4, 0, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 60, + { 0, 9, 1, 3, 23, 59, 59, 999 }, + { 0, 3, 0, 4, 0, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + 60, + { 0, 9, 2, 3, 23, 59, 59, 999 }, + { 0, 3, 1, 3, 0, 0, 0, 0 }, + }, + { + 636502716000000000ULL, + 636188220000000000ULL, + 60, + { 0, 9, 4, 3, 23, 59, 59, 999 }, + { 0, 3, 3, 4, 0, 0, 0, 0 }, + }, + { + 636818076000000000ULL, + 636503580000000000ULL, + 60, + { 0, 9, 5, 3, 23, 59, 59, 999 }, + { 0, 3, 4, 4, 0, 0, 0, 0 }, + }, + { + 637133436000000000ULL, + 636818940000000000ULL, + 60, + { 0, 9, 6, 3, 23, 59, 59, 999 }, + { 0, 3, 5, 4, 0, 0, 0, 0 }, + }, + { + 637449660000000000ULL, + 637134300000000000ULL, + 60, + { 0, 9, 0, 3, 23, 59, 59, 999 }, + { 0, 3, 6, 3, 0, 0, 0, 0 }, + }, + { + 637765020000000000ULL, + 637450524000000000ULL, + 60, + { 0, 9, 2, 3, 23, 59, 59, 999 }, + { 0, 3, 1, 4, 0, 0, 0, 0 }, + }, + { + 638080380000000000ULL, + 637765884000000000ULL, + 60, + { 0, 9, 3, 3, 23, 59, 59, 999 }, + { 0, 3, 2, 4, 0, 0, 0, 0 }, + }, + { + 638395740000000000ULL, + 638081244000000000ULL, + 60, + { 0, 9, 4, 3, 23, 59, 59, 999 }, + { 0, 3, 3, 4, 0, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 638396604000000000ULL, + 60, + { 0, 9, 5, 3, 23, 59, 59, 999 }, + { 0, 3, 4, 3, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_77[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 3, 1, 0, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + -60, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 5, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_78[] = { { + 635871132000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 5, 0, 0, 0 }, + { 0, 3, 0, 5, 4, 0, 0, 0 }, +} }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_79[] = { { + 633978108000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 1, 5, 1, 0, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_80[] = { { + 633662748000000000ULL, + 633347388000000000ULL, + 60, + { 0, 1, 2, 1, 0, 0, 0, 0 }, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 4, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_81[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 3, 1, 0, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + -60, + { 0, 12, 0, 1, 2, 0, 0, 0 }, + { 0, 1, 5, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_83[] = { { + 634608828000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, +} }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_86[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 3, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_87[] = { { + 633662748000000000ULL, + 633347388000000000ULL, + 60, + { 0, 10, 5, 5, 23, 59, 59, 999 }, + { 0, 5, 6, 5, 23, 59, 59, 999 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 10, 6, 5, 23, 59, 59, 999 }, + { 0, 4, 2, 2, 23, 59, 59, 999 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_92[] = { { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 12, 4, 5, 23, 59, 59, 999 }, + { 0, 6, 5, 3, 23, 0, 0, 0 }, +} }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_93[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 3, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_96[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 3, 1, 0, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + -60, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 5, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_97[] = { { + 633031164000000000ULL, + 0ULL, + 60, + { 0, 9, 6, 5, 2, 0, 0, 0 }, + { 0, 3, 6, 5, 2, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 60, + { 0, 9, 5, 5, 23, 59, 59, 999 }, + { 0, 3, 6, 5, 2, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + 60, + { 0, 9, 5, 4, 23, 59, 59, 999 }, + { 0, 3, 6, 5, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_98[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 3, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_99[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 3, 1, 0, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + -60, + { 0, 7, 0, 4, 2, 0, 0, 0 }, + { 0, 1, 5, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_100[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 3, 1, 0, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + -60, + { 0, 5, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 5, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_102[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 3, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_104[] = { { + 633031164000000000ULL, + 632716668000000000ULL, + 60, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + { 0, 12, 0, 1, 2, 0, 0, 0 }, + }, + { + 633346524000000000ULL, + 633032028000000000ULL, + 60, + { 0, 3, 0, 5, 3, 0, 0, 0 }, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + }, + { + 633662748000000000ULL, + 633347388000000000ULL, + 60, + { 0, 3, 0, 5, 3, 0, 0, 0 }, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + }, + { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 3, 0, 5, 3, 0, 0, 0 }, + { 0, 1, 4, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_106[] = { { + 635871132000000000ULL, + 635556636000000000ULL, + 60, + { 0, 9, 5, 5, 23, 59, 59, 999 }, + { 0, 3, 6, 5, 2, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + 60, + { 0, 9, 5, 4, 23, 59, 59, 999 }, + { 0, 3, 6, 5, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_108[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 120, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 3, 1, 0, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + -60, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 5, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_110[] = { { + 635871132000000000ULL, + 635556636000000000ULL, + 30, + { 0, 8, 5, 2, 23, 59, 59, 999 }, + { 0, 1, 4, 1, 0, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 636502716000000000ULL, + 636188220000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 636818076000000000ULL, + 636503580000000000ULL, + -30, + { 0, 5, 5, 1, 23, 30, 0, 0 }, + { 0, 1, 1, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_112[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 3, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_113[] = { { + 633346524000000000ULL, + 0ULL, + 60, + { 0, 3, 0, 5, 3, 0, 0, 0 }, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 633347388000000000ULL, + 60, + { 0, 4, 0, 1, 3, 0, 0, 0 }, + { 0, 10, 0, 1, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_116[] = { { + 633346524000000000ULL, + 0ULL, + 60, + { 0, 3, 0, 5, 3, 0, 0, 0 }, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 633347388000000000ULL, + 60, + { 0, 4, 0, 1, 3, 0, 0, 0 }, + { 0, 10, 0, 1, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_118[] = { { + 633346524000000000ULL, + 0ULL, + 60, + { 0, 3, 0, 5, 3, 0, 0, 0 }, + { 0, 10, 0, 1, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 633347388000000000ULL, + 60, + { 0, 4, 0, 1, 3, 0, 0, 0 }, + { 0, 10, 0, 1, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_119[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 3, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_120[] = { { + 632715804000000000ULL, + 0ULL, + 30, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + }, + { + 633031164000000000ULL, + 632716668000000000ULL, + 30, + { 0, 4, 0, 1, 2, 0, 0, 0 }, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + }, + { + 633346524000000000ULL, + 633032028000000000ULL, + 30, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 633347388000000000ULL, + 30, + { 0, 4, 0, 1, 2, 0, 0, 0 }, + { 0, 10, 0, 1, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_121[] = { { + 635240412000000000ULL, + 0ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 1, 3, 1, 0, 0, 0, 0 }, + { 0, 12, 0, 5, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_122[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 3, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_123[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 120, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 3, 1, 0, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + -60, + { 0, 4, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 5, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_124[] = { { + 635555772000000000ULL, + 0ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 30, + { 0, 10, 0, 1, 2, 0, 0, 0 }, + { 0, 1, 4, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_125[] = { { + 634293468000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 10, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 3, 1, 0, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + -60, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + { 0, 1, 5, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_127[] = { { + 633978108000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 1, 5, 1, 0, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 1, 6, 1, 0, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_128[] = { { + 633031164000000000ULL, + 0ULL, + 60, + { 0, 3, 0, 3, 3, 0, 0, 0 }, + { 0, 10, 0, 1, 2, 0, 0, 0 }, + }, + { + 633346524000000000ULL, + 633032028000000000ULL, + 60, + { 0, 3, 0, 3, 3, 0, 0, 0 }, + { 0, 9, 0, 5, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 633347388000000000ULL, + 60, + { 0, 4, 0, 1, 3, 0, 0, 0 }, + { 0, 9, 0, 5, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_130[] = { { + 633978108000000000ULL, + 633663612000000000ULL, + 60, + { 0, 1, 4, 1, 0, 0, 0, 0 }, + { 0, 11, 0, 5, 2, 0, 0, 0 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 3, 0, 5, 3, 0, 0, 0 }, + { 0, 10, 0, 4, 2, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 3, 0, 1, 3, 0, 0, 0 }, + { 0, 10, 0, 4, 2, 0, 0, 0 }, + }, + { + 634925052000000000ULL, + 634609692000000000ULL, + 60, + { 0, 1, 0, 4, 3, 0, 0, 0 }, + { 0, 10, 0, 3, 2, 0, 0, 0 }, + }, + { + 635240412000000000ULL, + 634925916000000000ULL, + 60, + { 0, 1, 0, 3, 3, 0, 0, 0 }, + { 0, 10, 0, 4, 2, 0, 0, 0 }, + }, + { + 635555772000000000ULL, + 635241276000000000ULL, + 60, + { 0, 1, 0, 3, 2, 0, 0, 0 }, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + }, + { + 635871132000000000ULL, + 635556636000000000ULL, + 60, + { 0, 1, 0, 3, 3, 0, 0, 0 }, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + }, + { + 636187356000000000ULL, + 635871996000000000ULL, + 60, + { 0, 1, 0, 3, 3, 0, 0, 0 }, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + }, + { + 636502716000000000ULL, + 636188220000000000ULL, + 60, + { 0, 1, 0, 3, 3, 0, 0, 0 }, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + }, + { + 636818076000000000ULL, + 636503580000000000ULL, + 60, + { 0, 1, 0, 2, 3, 0, 0, 0 }, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 636818940000000000ULL, + 60, + { 0, 1, 0, 3, 3, 0, 0, 0 }, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_131[] = { { + 3155378076000000000ULL, + 0ULL, + 60, + { 0, 10, 0, 5, 3, 0, 0, 0 }, + { 0, 3, 0, 5, 2, 0, 0, 0 }, +} }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_132[] = { { + 633031164000000000ULL, + 0ULL, + 60, + { 0, 3, 0, 3, 3, 45, 0, 0 }, + { 0, 10, 0, 1, 2, 45, 0, 0 }, + }, + { + 633346524000000000ULL, + 633032028000000000ULL, + 60, + { 0, 3, 0, 3, 3, 45, 0, 0 }, + { 0, 9, 0, 5, 2, 45, 0, 0 }, + }, + { + 3155378076000000000ULL, + 633347388000000000ULL, + 60, + { 0, 4, 0, 1, 3, 45, 0, 0 }, + { 0, 9, 0, 5, 2, 45, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_134[] = { { + 636187356000000000ULL, + 635871996000000000ULL, + 60, + { 0, 1, 5, 1, 0, 0, 0, 0 }, + { 0, 11, 0, 1, 2, 0, 0, 0 }, + }, + { + 636502716000000000ULL, + 636188220000000000ULL, + 60, + { 0, 1, 0, 3, 3, 0, 0, 0 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + } }; + +static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_135[] = { { + 633978108000000000ULL, + 0ULL, + 0, + { 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 0, 0, 0 }, + }, + { + 634293468000000000ULL, + 633978972000000000ULL, + 60, + { 0, 1, 5, 1, 0, 0, 0, 0 }, + { 0, 9, 0, 5, 0, 0, 0, 0 }, + }, + { + 634608828000000000ULL, + 634294332000000000ULL, + 60, + { 0, 4, 6, 1, 4, 0, 0, 0 }, + { 0, 9, 6, 4, 3, 0, 0, 0 }, + }, + { + 3155378076000000000ULL, + 634609692000000000ULL, + 60, + { 0, 4, 0, 1, 4, 0, 0, 0 }, + { 0, 9, 0, 5, 3, 0, 0, 0 }, + } }; + +static const TIME_ZONE_ENTRY TimeZoneTable[] = { + { "Dateline Standard Time", 720, FALSE, "(UTC-12:00) International Date Line West", + "Dateline Standard Time", "Dateline Daylight Time", NULL, 0 }, + { "UTC-11", 660, FALSE, "(UTC-11:00) Coordinated Universal Time-11", "UTC-11", "UTC-11", NULL, + 0 }, + { "Aleutian Standard Time", 600, TRUE, "(UTC-10:00) Aleutian Islands", "Aleutian Standard Time", + "Aleutian Daylight Time", TimeZoneRuleTable_2, 2 }, + { "Hawaiian Standard Time", 600, FALSE, "(UTC-10:00) Hawaii", "Hawaiian Standard Time", + "Hawaiian Daylight Time", NULL, 0 }, + { "Marquesas Standard Time", 570, FALSE, "(UTC-09:30) Marquesas Islands", + "Marquesas Standard Time", "Marquesas Daylight Time", NULL, 0 }, + { "Alaskan Standard Time", 540, TRUE, "(UTC-09:00) Alaska", "Alaskan Standard Time", + "Alaskan Daylight Time", TimeZoneRuleTable_5, 2 }, + { "UTC-09", 540, FALSE, "(UTC-09:00) Coordinated Universal Time-09", "UTC-09", "UTC-09", NULL, + 0 }, + { "Pacific Standard Time (Mexico)", 480, TRUE, "(UTC-08:00) Baja California", + "Pacific Standard Time (Mexico)", "Pacific Daylight Time (Mexico)", TimeZoneRuleTable_7, 2 }, + { "UTC-08", 480, FALSE, "(UTC-08:00) Coordinated Universal Time-08", "UTC-08", "UTC-08", NULL, + 0 }, + { "Pacific Standard Time", 480, TRUE, "(UTC-08:00) Pacific Time (US & Canada)", + "Pacific Standard Time", "Pacific Daylight Time", TimeZoneRuleTable_9, 2 }, + { "US Mountain Standard Time", 420, FALSE, "(UTC-07:00) Arizona", "US Mountain Standard Time", + "US Mountain Daylight Time", NULL, 0 }, + { "Mountain Standard Time (Mexico)", 420, TRUE, "(UTC-07:00) Chihuahua, La Paz, Mazatlan", + "Mountain Standard Time (Mexico)", "Mountain Daylight Time (Mexico)", TimeZoneRuleTable_11, + 1 }, + { "Mountain Standard Time", 420, TRUE, "(UTC-07:00) Mountain Time (US & Canada)", + "Mountain Standard Time", "Mountain Daylight Time", TimeZoneRuleTable_12, 2 }, + { "Central America Standard Time", 360, FALSE, "(UTC-06:00) Central America", + "Central America Standard Time", "Central America Daylight Time", NULL, 0 }, + { "Central Standard Time", 360, TRUE, "(UTC-06:00) Central Time (US & Canada)", + "Central Standard Time", "Central Daylight Time", TimeZoneRuleTable_14, 2 }, + { "Easter Island Standard Time", 360, TRUE, "(UTC-06:00) Easter Island", + "Easter Island Standard Time", "Easter Island Daylight Time", TimeZoneRuleTable_15, 10 }, + { "Central Standard Time (Mexico)", 360, TRUE, + "(UTC-06:00) Guadalajara, Mexico City, Monterrey", "Central Standard Time (Mexico)", + "Central Daylight Time (Mexico)", TimeZoneRuleTable_16, 1 }, + { "Canada Central Standard Time", 360, FALSE, "(UTC-06:00) Saskatchewan", + "Canada Central Standard Time", "Canada Central Daylight Time", NULL, 0 }, + { "SA Pacific Standard Time", 300, FALSE, "(UTC-05:00) Bogota, Lima, Quito, Rio Branco", + "SA Pacific Standard Time", "SA Pacific Daylight Time", NULL, 0 }, + { "Eastern Standard Time (Mexico)", 300, TRUE, "(UTC-05:00) Chetumal", + "Eastern Standard Time (Mexico)", "Eastern Daylight Time (Mexico)", TimeZoneRuleTable_19, 2 }, + { "Eastern Standard Time", 300, TRUE, "(UTC-05:00) Eastern Time (US & Canada)", + "Eastern Standard Time", "Eastern Daylight Time", TimeZoneRuleTable_20, 2 }, + { "Haiti Standard Time", 300, TRUE, "(UTC-05:00) Haiti", "Haiti Standard Time", + "Haiti Daylight Time", TimeZoneRuleTable_21, 6 }, + { "Cuba Standard Time", 300, TRUE, "(UTC-05:00) Havana", "Cuba Standard Time", + "Cuba Daylight Time", TimeZoneRuleTable_22, 11 }, + { "US Eastern Standard Time", 300, TRUE, "(UTC-05:00) Indiana (East)", + "US Eastern Standard Time", "US Eastern Daylight Time", TimeZoneRuleTable_23, 2 }, + { "Turks And Caicos Standard Time", 300, TRUE, "(UTC-05:00) Turks and Caicos", + "Turks and Caicos Standard Time", "Turks and Caicos Daylight Time", TimeZoneRuleTable_24, 6 }, + { "Paraguay Standard Time", 240, TRUE, "(UTC-04:00) Asuncion", "Paraguay Standard Time", + "Paraguay Daylight Time", TimeZoneRuleTable_25, 14 }, + { "Atlantic Standard Time", 240, TRUE, "(UTC-04:00) Atlantic Time (Canada)", + "Atlantic Standard Time", "Atlantic Daylight Time", TimeZoneRuleTable_26, 2 }, + { "Venezuela Standard Time", 240, TRUE, "(UTC-04:00) Caracas", "Venezuela Standard Time", + "Venezuela Daylight Time", TimeZoneRuleTable_27, 10 }, + { "Central Brazilian Standard Time", 240, TRUE, "(UTC-04:00) Cuiaba", + "Central Brazilian Standard Time", "Central Brazilian Daylight Time", TimeZoneRuleTable_28, + 37 }, + { "SA Western Standard Time", 240, FALSE, "(UTC-04:00) Georgetown, La Paz, Manaus, San Juan", + "SA Western Standard Time", "SA Western Daylight Time", NULL, 0 }, + { "Pacific SA Standard Time", 240, TRUE, "(UTC-04:00) Santiago", "Pacific SA Standard Time", + "Pacific SA Daylight Time", TimeZoneRuleTable_30, 10 }, + { "Newfoundland Standard Time", 210, TRUE, "(UTC-03:30) Newfoundland", + "Newfoundland Standard Time", "Newfoundland Daylight Time", TimeZoneRuleTable_31, 7 }, + { "Tocantins Standard Time", 180, TRUE, "(UTC-03:00) Araguaina", "Tocantins Standard Time", + "Tocantins Daylight Time", TimeZoneRuleTable_32, 2 }, + { "E. South America Standard Time", 180, TRUE, "(UTC-03:00) Brasilia", + "E. South America Standard Time", "E. South America Daylight Time", TimeZoneRuleTable_33, + 37 }, + { "SA Eastern Standard Time", 180, FALSE, "(UTC-03:00) Cayenne, Fortaleza", + "SA Eastern Standard Time", "SA Eastern Daylight Time", NULL, 0 }, + { "Argentina Standard Time", 180, TRUE, "(UTC-03:00) City of Buenos Aires", + "Argentina Standard Time", "Argentina Daylight Time", TimeZoneRuleTable_35, 3 }, + { "Greenland Standard Time", 180, TRUE, "(UTC-03:00) Greenland", "Greenland Standard Time", + "Greenland Daylight Time", TimeZoneRuleTable_36, 18 }, + { "Montevideo Standard Time", 180, TRUE, "(UTC-03:00) Montevideo", "Montevideo Standard Time", + "Montevideo Daylight Time", TimeZoneRuleTable_37, 2 }, + { "Magallanes Standard Time", 180, TRUE, "(UTC-03:00) Punta Arenas", "Magallanes Standard Time", + "Magallanes Daylight Time", TimeZoneRuleTable_38, 9 }, + { "Saint Pierre Standard Time", 180, TRUE, "(UTC-03:00) Saint Pierre and Miquelon", + "Saint Pierre Standard Time", "Saint Pierre Daylight Time", TimeZoneRuleTable_39, 2 }, + { "Bahia Standard Time", 180, TRUE, "(UTC-03:00) Salvador", "Bahia Standard Time", + "Bahia Daylight Time", TimeZoneRuleTable_40, 2 }, + { "UTC-02", 120, FALSE, "(UTC-02:00) Coordinated Universal Time-02", "UTC-02", "UTC-02", NULL, + 0 }, + { "Mid-Atlantic Standard Time", 120, TRUE, "(UTC-02:00) Mid-Atlantic - Old", + "Mid-Atlantic Standard Time", "Mid-Atlantic Daylight Time", TimeZoneRuleTable_42, 1 }, + { "Azores Standard Time", 60, TRUE, "(UTC-01:00) Azores", "Azores Standard Time", + "Azores Daylight Time", TimeZoneRuleTable_43, 1 }, + { "Cape Verde Standard Time", 60, FALSE, "(UTC-01:00) Cabo Verde Is.", + "Cabo Verde Standard Time", "Cabo Verde Daylight Time", NULL, 0 }, + { "UTC", 0, FALSE, "(UTC) Coordinated Universal Time", "Coordinated Universal Time", + "Coordinated Universal Time", NULL, 0 }, + { "Morocco Standard Time", 0, TRUE, "(UTC+00:00) Casablanca", "Morocco Standard Time", + "Morocco Daylight Time", TimeZoneRuleTable_46, 12 }, + { "GMT Standard Time", 0, TRUE, "(UTC+00:00) Dublin, Edinburgh, Lisbon, London", + "GMT Standard Time", "GMT Daylight Time", TimeZoneRuleTable_47, 1 }, + { "Greenwich Standard Time", 0, FALSE, "(UTC+00:00) Monrovia, Reykjavik", + "Greenwich Standard Time", "Greenwich Daylight Time", NULL, 0 }, + { "W. Europe Standard Time", -60, TRUE, + "(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna", "W. Europe Standard Time", + "W. Europe Daylight Time", TimeZoneRuleTable_49, 1 }, + { "Central Europe Standard Time", -60, TRUE, + "(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague", + "Central Europe Standard Time", "Central Europe Daylight Time", TimeZoneRuleTable_50, 1 }, + { "Romance Standard Time", -60, TRUE, "(UTC+01:00) Brussels, Copenhagen, Madrid, Paris", + "Romance Standard Time", "Romance Daylight Time", TimeZoneRuleTable_51, 1 }, + { "Sao Tome Standard Time", -60, TRUE, "(UTC+01:00) Sao Tome", "Sao Tome Standard Time", + "Sao Tome Daylight Time", TimeZoneRuleTable_52, 2 }, + { "Central European Standard Time", -60, TRUE, "(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb", + "Central European Standard Time", "Central European Daylight Time", TimeZoneRuleTable_53, 1 }, + { "W. Central Africa Standard Time", -60, FALSE, "(UTC+01:00) West Central Africa", + "W. Central Africa Standard Time", "W. Central Africa Daylight Time", NULL, 0 }, + { "Jordan Standard Time", -120, TRUE, "(UTC+02:00) Amman", "Jordan Standard Time", + "Jordan Daylight Time", TimeZoneRuleTable_55, 4 }, + { "GTB Standard Time", -120, TRUE, "(UTC+02:00) Athens, Bucharest", "GTB Standard Time", + "GTB Daylight Time", TimeZoneRuleTable_56, 1 }, + { "Middle East Standard Time", -120, TRUE, "(UTC+02:00) Beirut", "Middle East Standard Time", + "Middle East Daylight Time", TimeZoneRuleTable_57, 13 }, + { "Egypt Standard Time", -120, TRUE, "(UTC+02:00) Cairo", "Egypt Standard Time", + "Egypt Daylight Time", TimeZoneRuleTable_58, 7 }, + { "E. Europe Standard Time", -120, TRUE, "(UTC+02:00) Chisinau", "E. Europe Standard Time", + "E. Europe Daylight Time", TimeZoneRuleTable_59, 1 }, + { "Syria Standard Time", -120, TRUE, "(UTC+02:00) Damascus", "Syria Standard Time", + "Syria Daylight Time", TimeZoneRuleTable_60, 17 }, + { "West Bank Standard Time", -120, TRUE, "(UTC+02:00) Gaza, Hebron", + "West Bank Gaza Standard Time", "West Bank Gaza Daylight Time", TimeZoneRuleTable_61, 7 }, + { "South Africa Standard Time", -120, FALSE, "(UTC+02:00) Harare, Pretoria", + "South Africa Standard Time", "South Africa Daylight Time", NULL, 0 }, + { "FLE Standard Time", -120, TRUE, "(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius", + "FLE Standard Time", "FLE Daylight Time", TimeZoneRuleTable_63, 1 }, + { "Israel Standard Time", -120, TRUE, "(UTC+02:00) Jerusalem", "Jerusalem Standard Time", + "Jerusalem Daylight Time", TimeZoneRuleTable_64, 20 }, + { "Kaliningrad Standard Time", -120, TRUE, "(UTC+02:00) Kaliningrad", + "Russia TZ 1 Standard Time", "Russia TZ 1 Daylight Time", TimeZoneRuleTable_65, 5 }, + { "Sudan Standard Time", -120, TRUE, "(UTC+02:00) Khartoum", "Sudan Standard Time", + "Sudan Daylight Time", TimeZoneRuleTable_66, 2 }, + { "Libya Standard Time", -120, TRUE, "(UTC+02:00) Tripoli", "Libya Standard Time", + "Libya Daylight Time", TimeZoneRuleTable_67, 2 }, + { "Namibia Standard Time", -120, TRUE, "(UTC+02:00) Windhoek", "Namibia Standard Time", + "Namibia Daylight Time", TimeZoneRuleTable_68, 1 }, + { "Arabic Standard Time", -180, TRUE, "(UTC+03:00) Baghdad", "Arabic Standard Time", + "Arabic Daylight Time", TimeZoneRuleTable_69, 4 }, + { "Turkey Standard Time", -180, TRUE, "(UTC+03:00) Istanbul", "Turkey Standard Time", + "Turkey Daylight Time", TimeZoneRuleTable_70, 7 }, + { "Arab Standard Time", -180, FALSE, "(UTC+03:00) Kuwait, Riyadh", "Arab Standard Time", + "Arab Daylight Time", NULL, 0 }, + { "Belarus Standard Time", -180, TRUE, "(UTC+03:00) Minsk", "Belarus Standard Time", + "Belarus Daylight Time", TimeZoneRuleTable_72, 2 }, + { "Russian Standard Time", -180, TRUE, "(UTC+03:00) Moscow, St. Petersburg, Volgograd", + "Russia TZ 2 Standard Time", "Russia TZ 2 Daylight Time", TimeZoneRuleTable_73, 5 }, + { "E. Africa Standard Time", -180, FALSE, "(UTC+03:00) Nairobi", "E. Africa Standard Time", + "E. Africa Daylight Time", NULL, 0 }, + { "Iran Standard Time", -210, TRUE, "(UTC+03:30) Tehran", "Iran Standard Time", + "Iran Daylight Time", TimeZoneRuleTable_75, 19 }, + { "Arabian Standard Time", -240, FALSE, "(UTC+04:00) Abu Dhabi, Muscat", + "Arabian Standard Time", "Arabian Daylight Time", NULL, 0 }, + { "Astrakhan Standard Time", -240, TRUE, "(UTC+04:00) Astrakhan, Ulyanovsk", + "Astrakhan Standard Time", "Astrakhan Daylight Time", TimeZoneRuleTable_77, 5 }, + { "Azerbaijan Standard Time", -240, TRUE, "(UTC+04:00) Baku", "Azerbaijan Standard Time", + "Azerbaijan Daylight Time", TimeZoneRuleTable_78, 1 }, + { "Russia Time Zone 3", -240, TRUE, "(UTC+04:00) Izhevsk, Samara", "Russia TZ 3 Standard Time", + "Russia TZ 3 Daylight Time", TimeZoneRuleTable_79, 3 }, + { "Mauritius Standard Time", -240, TRUE, "(UTC+04:00) Port Louis", "Mauritius Standard Time", + "Mauritius Daylight Time", TimeZoneRuleTable_80, 2 }, + { "Saratov Standard Time", -240, TRUE, "(UTC+04:00) Saratov", "Saratov Standard Time", + "Saratov Daylight Time", TimeZoneRuleTable_81, 5 }, + { "Georgian Standard Time", -240, FALSE, "(UTC+04:00) Tbilisi", "Georgian Standard Time", + "Georgian Daylight Time", NULL, 0 }, + { "Caucasus Standard Time", -240, TRUE, "(UTC+04:00) Yerevan", "Caucasus Standard Time", + "Caucasus Daylight Time", TimeZoneRuleTable_83, 1 }, + { "Afghanistan Standard Time", -270, FALSE, "(UTC+04:30) Kabul", "Afghanistan Standard Time", + "Afghanistan Daylight Time", NULL, 0 }, + { "West Asia Standard Time", -300, FALSE, "(UTC+05:00) Ashgabat, Tashkent", + "West Asia Standard Time", "West Asia Daylight Time", NULL, 0 }, + { "Ekaterinburg Standard Time", -300, TRUE, "(UTC+05:00) Ekaterinburg", + "Russia TZ 4 Standard Time", "Russia TZ 4 Daylight Time", TimeZoneRuleTable_86, 5 }, + { "Pakistan Standard Time", -300, TRUE, "(UTC+05:00) Islamabad, Karachi", + "Pakistan Standard Time", "Pakistan Daylight Time", TimeZoneRuleTable_87, 2 }, + { "India Standard Time", -330, FALSE, "(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi", + "India Standard Time", "India Daylight Time", NULL, 0 }, + { "Sri Lanka Standard Time", -330, FALSE, "(UTC+05:30) Sri Jayawardenepura", + "Sri Lanka Standard Time", "Sri Lanka Daylight Time", NULL, 0 }, + { "Nepal Standard Time", -345, FALSE, "(UTC+05:45) Kathmandu", "Nepal Standard Time", + "Nepal Daylight Time", NULL, 0 }, + { "Central Asia Standard Time", -360, FALSE, "(UTC+06:00) Astana", "Central Asia Standard Time", + "Central Asia Daylight Time", NULL, 0 }, + { "Bangladesh Standard Time", -360, TRUE, "(UTC+06:00) Dhaka", "Bangladesh Standard Time", + "Bangladesh Daylight Time", TimeZoneRuleTable_92, 1 }, + { "Omsk Standard Time", -360, TRUE, "(UTC+06:00) Omsk", "Omsk Standard Time", + "Omsk Daylight Time", TimeZoneRuleTable_93, 5 }, + { "Myanmar Standard Time", -390, FALSE, "(UTC+06:30) Yangon (Rangoon)", "Myanmar Standard Time", + "Myanmar Daylight Time", NULL, 0 }, + { "SE Asia Standard Time", -420, FALSE, "(UTC+07:00) Bangkok, Hanoi, Jakarta", + "SE Asia Standard Time", "SE Asia Daylight Time", NULL, 0 }, + { "Altai Standard Time", -420, TRUE, "(UTC+07:00) Barnaul, Gorno-Altaysk", + "Altai Standard Time", "Altai Daylight Time", TimeZoneRuleTable_96, 5 }, + { "W. Mongolia Standard Time", -420, TRUE, "(UTC+07:00) Hovd", "W. Mongolia Standard Time", + "W. Mongolia Daylight Time", TimeZoneRuleTable_97, 3 }, + { "North Asia Standard Time", -420, TRUE, "(UTC+07:00) Krasnoyarsk", + "Russia TZ 6 Standard Time", "Russia TZ 6 Daylight Time", TimeZoneRuleTable_98, 5 }, + { "N. Central Asia Standard Time", -420, TRUE, "(UTC+07:00) Novosibirsk", + "Novosibirsk Standard Time", "Novosibirsk Daylight Time", TimeZoneRuleTable_99, 5 }, + { "Tomsk Standard Time", -420, TRUE, "(UTC+07:00) Tomsk", "Tomsk Standard Time", + "Tomsk Daylight Time", TimeZoneRuleTable_100, 5 }, + { "China Standard Time", -480, FALSE, "(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi", + "China Standard Time", "China Daylight Time", NULL, 0 }, + { "North Asia East Standard Time", -480, TRUE, "(UTC+08:00) Irkutsk", + "Russia TZ 7 Standard Time", "Russia TZ 7 Daylight Time", TimeZoneRuleTable_102, 5 }, + { "Singapore Standard Time", -480, FALSE, "(UTC+08:00) Kuala Lumpur, Singapore", + "Malay Peninsula Standard Time", "Malay Peninsula Daylight Time", NULL, 0 }, + { "W. Australia Standard Time", -480, TRUE, "(UTC+08:00) Perth", "W. Australia Standard Time", + "W. Australia Daylight Time", TimeZoneRuleTable_104, 4 }, + { "Taipei Standard Time", -480, FALSE, "(UTC+08:00) Taipei", "Taipei Standard Time", + "Taipei Daylight Time", NULL, 0 }, + { "Ulaanbaatar Standard Time", -480, TRUE, "(UTC+08:00) Ulaanbaatar", + "Ulaanbaatar Standard Time", "Ulaanbaatar Daylight Time", TimeZoneRuleTable_106, 2 }, + { "Aus Central W. Standard Time", -525, FALSE, "(UTC+08:45) Eucla", + "Aus Central W. Standard Time", "Aus Central W. Daylight Time", NULL, 0 }, + { "Transbaikal Standard Time", -540, TRUE, "(UTC+09:00) Chita", "Transbaikal Standard Time", + "Transbaikal Daylight Time", TimeZoneRuleTable_108, 7 }, + { "Tokyo Standard Time", -540, FALSE, "(UTC+09:00) Osaka, Sapporo, Tokyo", + "Tokyo Standard Time", "Tokyo Daylight Time", NULL, 0 }, + { "North Korea Standard Time", -540, TRUE, "(UTC+09:00) Pyongyang", "North Korea Standard Time", + "North Korea Daylight Time", TimeZoneRuleTable_110, 4 }, + { "Korea Standard Time", -540, FALSE, "(UTC+09:00) Seoul", "Korea Standard Time", + "Korea Daylight Time", NULL, 0 }, + { "Yakutsk Standard Time", -540, TRUE, "(UTC+09:00) Yakutsk", "Russia TZ 8 Standard Time", + "Russia TZ 8 Daylight Time", TimeZoneRuleTable_112, 5 }, + { "Cen. Australia Standard Time", -570, TRUE, "(UTC+09:30) Adelaide", + "Cen. Australia Standard Time", "Cen. Australia Daylight Time", TimeZoneRuleTable_113, 2 }, + { "AUS Central Standard Time", -570, FALSE, "(UTC+09:30) Darwin", "AUS Central Standard Time", + "AUS Central Daylight Time", NULL, 0 }, + { "E. Australia Standard Time", -600, FALSE, "(UTC+10:00) Brisbane", + "E. Australia Standard Time", "E. Australia Daylight Time", NULL, 0 }, + { "AUS Eastern Standard Time", -600, TRUE, "(UTC+10:00) Canberra, Melbourne, Sydney", + "AUS Eastern Standard Time", "AUS Eastern Daylight Time", TimeZoneRuleTable_116, 2 }, + { "West Pacific Standard Time", -600, FALSE, "(UTC+10:00) Guam, Port Moresby", + "West Pacific Standard Time", "West Pacific Daylight Time", NULL, 0 }, + { "Tasmania Standard Time", -600, TRUE, "(UTC+10:00) Hobart", "Tasmania Standard Time", + "Tasmania Daylight Time", TimeZoneRuleTable_118, 2 }, + { "Vladivostok Standard Time", -600, TRUE, "(UTC+10:00) Vladivostok", + "Russia TZ 9 Standard Time", "Russia TZ 9 Daylight Time", TimeZoneRuleTable_119, 5 }, + { "Lord Howe Standard Time", -630, TRUE, "(UTC+10:30) Lord Howe Island", + "Lord Howe Standard Time", "Lord Howe Daylight Time", TimeZoneRuleTable_120, 4 }, + { "Bougainville Standard Time", -660, TRUE, "(UTC+11:00) Bougainville Island", + "Bougainville Standard Time", "Bougainville Daylight Time", TimeZoneRuleTable_121, 2 }, + { "Russia Time Zone 10", -660, TRUE, "(UTC+11:00) Chokurdakh", "Russia TZ 10 Standard Time", + "Russia TZ 10 Daylight Time", TimeZoneRuleTable_122, 5 }, + { "Magadan Standard Time", -660, TRUE, "(UTC+11:00) Magadan", "Magadan Standard Time", + "Magadan Daylight Time", TimeZoneRuleTable_123, 7 }, + { "Norfolk Standard Time", -660, TRUE, "(UTC+11:00) Norfolk Island", "Norfolk Standard Time", + "Norfolk Daylight Time", TimeZoneRuleTable_124, 2 }, + { "Sakhalin Standard Time", -660, TRUE, "(UTC+11:00) Sakhalin", "Sakhalin Standard Time", + "Sakhalin Daylight Time", TimeZoneRuleTable_125, 5 }, + { "Central Pacific Standard Time", -660, FALSE, "(UTC+11:00) Solomon Is., New Caledonia", + "Central Pacific Standard Time", "Central Pacific Daylight Time", NULL, 0 }, + { "Russia Time Zone 11", -720, TRUE, "(UTC+12:00) Anadyr, Petropavlovsk-Kamchatsky", + "Russia TZ 11 Standard Time", "Russia TZ 11 Daylight Time", TimeZoneRuleTable_127, 3 }, + { "New Zealand Standard Time", -720, TRUE, "(UTC+12:00) Auckland, Wellington", + "New Zealand Standard Time", "New Zealand Daylight Time", TimeZoneRuleTable_128, 3 }, + { "UTC+12", -720, FALSE, "(UTC+12:00) Coordinated Universal Time+12", "UTC+12", "UTC+12", NULL, + 0 }, + { "Fiji Standard Time", -720, TRUE, "(UTC+12:00) Fiji", "Fiji Standard Time", + "Fiji Daylight Time", TimeZoneRuleTable_130, 11 }, + { "Kamchatka Standard Time", -720, TRUE, "(UTC+12:00) Petropavlovsk-Kamchatsky - Old", + "Kamchatka Standard Time", "Kamchatka Daylight Time", TimeZoneRuleTable_131, 1 }, + { "Chatham Islands Standard Time", -765, TRUE, "(UTC+12:45) Chatham Islands", + "Chatham Islands Standard Time", "Chatham Islands Daylight Time", TimeZoneRuleTable_132, 3 }, + { "UTC+13", -780, FALSE, "(UTC+13:00) Coordinated Universal Time+13", "UTC+13", "UTC+13", NULL, + 0 }, + { "Tonga Standard Time", -780, TRUE, "(UTC+13:00) Nuku'alofa", "Tonga Standard Time", + "Tonga Daylight Time", TimeZoneRuleTable_134, 2 }, + { "Samoa Standard Time", -780, TRUE, "(UTC+13:00) Samoa", "Samoa Standard Time", + "Samoa Daylight Time", TimeZoneRuleTable_135, 4 }, + { "Line Islands Standard Time", -840, FALSE, "(UTC+14:00) Kiritimati Island", + "Line Islands Standard Time", "Line Islands Daylight Time", NULL, 0 } }; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_5[] = -{ - { 633031164000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 4, 0, 1, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 633032028000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_7[] = -{ - { 633978108000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 4, 0, 1, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 633978972000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_9[] = -{ - { 633031164000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 4, 0, 1, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 633032028000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_11[] = -{ - { 3155378076000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 4, 0, 1, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_12[] = -{ - { 633031164000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 4, 0, 1, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 633032028000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_14[] = -{ - { 633031164000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 4, 0, 1, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 633032028000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_15[] = -{ - { 633346524000000000ULL, 0ULL, 60, { 0, 3, 6, 2, 22, 0, 0, 0 }, { 0, 10, 6, 2, 22, 0, 0, 0 }, }, - { 633662748000000000ULL, 633347388000000000ULL, 60, { 0, 3, 6, 5, 22, 0, 0, 0 }, { 0, 10, 6, 2, 22, 0, 0, 0 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 3, 6, 2, 22, 0, 0, 0 }, { 0, 10, 6, 2, 22, 0, 0, 0 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 4, 6, 1, 22, 0, 0, 0 }, { 0, 10, 6, 2, 22, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 5, 6, 1, 22, 0, 0, 0 }, { 0, 8, 6, 3, 22, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 4, 6, 5, 22, 0, 0, 0 }, { 0, 9, 6, 1, 22, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 4, 6, 5, 22, 0, 0, 0 }, { 0, 9, 6, 1, 22, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 4, 6, 5, 22, 0, 0, 0 }, { 0, 9, 6, 1, 22, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 3155378076000000000ULL, 635871996000000000ULL, 60, { 0, 5, 6, 2, 22, 0, 0, 0 }, { 0, 8, 6, 2, 22, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_16[] = -{ - { 3155378076000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 4, 0, 1, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_19[] = -{ - { 635555772000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 4, 0, 1, 2, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 60, { 0, 1, 4, 1, 0, 0, 0, 0 }, { 0, 2, 0, 1, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_20[] = -{ - { 633031164000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 4, 0, 1, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 633032028000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_21[] = -{ - { 633031164000000000ULL, 0ULL, 60, { 0, 10, 6, 5, 23, 59, 59, 999 }, { 0, 4, 6, 1, 23, 59, 59, 999 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 636188220000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_22[] = -{ - { 632084220000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 1, 0, 0, 0 }, { 0, 4, 0, 1, 0, 0, 0, 0 }, }, - { 632400444000000000ULL, 632085084000000000ULL, 60, { 0, 1, 4, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 0, 0, 0, 0 }, }, - { 632715804000000000ULL, 632401308000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 633031164000000000ULL, 632716668000000000ULL, 60, { 0, 10, 0, 5, 1, 0, 0, 0 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 633346524000000000ULL, 633032028000000000ULL, 60, { 0, 10, 0, 5, 1, 0, 0, 0 }, { 0, 3, 0, 2, 0, 0, 0, 0 }, }, - { 633662748000000000ULL, 633347388000000000ULL, 60, { 0, 10, 0, 5, 1, 0, 0, 0 }, { 0, 3, 0, 3, 0, 0, 0, 0 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 10, 0, 5, 1, 0, 0, 0 }, { 0, 3, 0, 2, 0, 0, 0, 0 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 10, 0, 5, 1, 0, 0, 0 }, { 0, 3, 0, 2, 0, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 11, 0, 2, 1, 0, 0, 0 }, { 0, 3, 0, 3, 0, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 11, 0, 1, 1, 0, 0, 0 }, { 0, 4, 0, 1, 0, 0, 0, 0 }, }, - { 3155378076000000000ULL, 634925916000000000ULL, 60, { 0, 11, 0, 1, 1, 0, 0, 0 }, { 0, 3, 0, 2, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_23[] = -{ - { 633031164000000000ULL, 632716668000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 4, 0, 1, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 633032028000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_24[] = -{ - { 635555772000000000ULL, 0ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 60, { 0, 1, 4, 1, 0, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 636502716000000000ULL, 636188220000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 636818076000000000ULL, 636503580000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 1, 1, 1, 0, 0, 0, 0 }, }, - { 3155378076000000000ULL, 636818940000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_25[] = -{ - { 633662748000000000ULL, 0ULL, 60, { 0, 3, 6, 2, 23, 59, 59, 999 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 3, 6, 1, 23, 59, 59, 999 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 4, 6, 2, 23, 59, 59, 999 }, { 0, 10, 6, 1, 23, 59, 59, 999 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 4, 6, 2, 23, 59, 59, 999 }, { 0, 10, 6, 1, 23, 59, 59, 999 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 4, 6, 1, 23, 59, 59, 999 }, { 0, 10, 6, 1, 23, 59, 59, 999 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 3, 6, 4, 23, 59, 59, 999 }, { 0, 10, 6, 1, 23, 59, 59, 999 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 3, 6, 4, 23, 59, 59, 999 }, { 0, 10, 6, 1, 23, 59, 59, 999 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 60, { 0, 3, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 1, 23, 59, 59, 999 }, }, - { 636187356000000000ULL, 635871996000000000ULL, 60, { 0, 3, 6, 5, 23, 59, 59, 999 }, { 0, 10, 6, 1, 23, 59, 59, 999 }, }, - { 636502716000000000ULL, 636188220000000000ULL, 60, { 0, 3, 6, 5, 23, 59, 59, 999 }, { 0, 9, 6, 5, 23, 59, 59, 999 }, }, - { 636818076000000000ULL, 636503580000000000ULL, 60, { 0, 3, 6, 4, 23, 59, 59, 999 }, { 0, 10, 6, 1, 23, 59, 59, 999 }, }, - { 637133436000000000ULL, 636818940000000000ULL, 60, { 0, 3, 6, 4, 23, 59, 59, 999 }, { 0, 10, 6, 1, 23, 59, 59, 999 }, }, - { 637449660000000000ULL, 637134300000000000ULL, 60, { 0, 3, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 1, 23, 59, 59, 999 }, }, - { 3155378076000000000ULL, 637450524000000000ULL, 60, { 0, 3, 6, 5, 23, 59, 59, 999 }, { 0, 10, 6, 1, 23, 59, 59, 999 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_26[] = -{ - { 633031164000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 4, 0, 1, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 633032028000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_27[] = -{ - { 633346524000000000ULL, 633032028000000000ULL, 30, { 0, 12, 0, 2, 3, 0, 0, 0 }, { 0, 1, 1, 1, 0, 0, 0, 0 }, }, - { 633662748000000000ULL, 633347388000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, -30, { 0, 5, 0, 1, 2, 30, 0, 0 }, { 0, 1, 5, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_28[] = -{ - { 632400444000000000ULL, 0ULL, 60, { 0, 1, 4, 1, 0, 0, 0, 0 }, { 0, 11, 2, 1, 0, 0, 0, 0 }, }, - { 632715804000000000ULL, 632401308000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 0, 3, 0, 0, 0, 0 }, }, - { 633031164000000000ULL, 632716668000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 0, 1, 0, 0, 0, 0 }, }, - { 633346524000000000ULL, 633032028000000000ULL, 60, { 0, 2, 6, 5, 23, 59, 59, 999 }, { 0, 10, 0, 2, 0, 0, 0, 0 }, }, - { 633662748000000000ULL, 633347388000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 0, 3, 0, 0, 0, 0 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 2, 6, 2, 23, 59, 59, 999 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 2, 6, 4, 23, 59, 59, 999 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 636187356000000000ULL, 635871996000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 636502716000000000ULL, 636188220000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 2, 23, 59, 59, 999 }, }, - { 636818076000000000ULL, 636503580000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 637133436000000000ULL, 636818940000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 637449660000000000ULL, 637134300000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 5, 23, 59, 59, 999 }, }, - { 637765020000000000ULL, 637450524000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 638080380000000000ULL, 637765884000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 638395740000000000ULL, 638081244000000000ULL, 60, { 0, 2, 6, 5, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 638711964000000000ULL, 638396604000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 639027324000000000ULL, 638712828000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 639342684000000000ULL, 639028188000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 5, 23, 59, 59, 999 }, }, - { 639658044000000000ULL, 639343548000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 639974268000000000ULL, 639658908000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 640289628000000000ULL, 639975132000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 640604988000000000ULL, 640290492000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 640920348000000000ULL, 640605852000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 641236572000000000ULL, 640921212000000000ULL, 60, { 0, 2, 6, 2, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 641551932000000000ULL, 641237436000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 641867292000000000ULL, 641552796000000000ULL, 60, { 0, 2, 6, 5, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 642182652000000000ULL, 641868156000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 642498876000000000ULL, 642183516000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 642814236000000000ULL, 642499740000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 5, 23, 59, 59, 999 }, }, - { 643129596000000000ULL, 642815100000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 643444956000000000ULL, 643130460000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 3155378076000000000ULL, 643445820000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_30[] = -{ - { 633346524000000000ULL, 0ULL, 60, { 0, 3, 6, 2, 23, 59, 59, 999 }, { 0, 10, 6, 2, 23, 59, 59, 999 }, }, - { 633662748000000000ULL, 633347388000000000ULL, 60, { 0, 3, 6, 5, 23, 59, 59, 999 }, { 0, 10, 6, 2, 23, 59, 59, 999 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 3, 6, 2, 23, 59, 59, 999 }, { 0, 10, 6, 2, 23, 59, 59, 999 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 4, 6, 1, 23, 59, 59, 999 }, { 0, 10, 6, 2, 23, 59, 59, 999 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 5, 6, 1, 23, 59, 59, 999 }, { 0, 8, 6, 3, 23, 59, 59, 999 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 4, 6, 5, 23, 59, 59, 999 }, { 0, 9, 6, 1, 23, 59, 59, 999 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 4, 6, 5, 23, 59, 59, 999 }, { 0, 9, 6, 1, 23, 59, 59, 999 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 4, 6, 5, 23, 59, 59, 999 }, { 0, 9, 6, 1, 23, 59, 59, 999 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 3155378076000000000ULL, 635871996000000000ULL, 60, { 0, 5, 6, 2, 23, 59, 59, 999 }, { 0, 8, 6, 2, 23, 59, 59, 999 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_31[] = -{ - { 633031164000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 0, 1, 0, 0 }, { 0, 4, 0, 1, 0, 1, 0, 0 }, }, - { 633346524000000000ULL, 633032028000000000ULL, 60, { 0, 11, 0, 1, 0, 1, 0, 0 }, { 0, 3, 0, 2, 0, 1, 0, 0 }, }, - { 633662748000000000ULL, 633347388000000000ULL, 60, { 0, 11, 0, 1, 0, 1, 0, 0 }, { 0, 3, 0, 2, 0, 1, 0, 0 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 11, 0, 1, 0, 1, 0, 0 }, { 0, 3, 0, 2, 0, 1, 0, 0 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 11, 0, 1, 0, 1, 0, 0 }, { 0, 3, 0, 2, 0, 1, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 0, 1, 0, 0 }, }, - { 3155378076000000000ULL, 634609692000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_32[] = -{ - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 1, 0, 1, 0, 0, 0, 0 }, { 0, 10, 0, 3, 0, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 1, 2, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_33[] = -{ - { 632400444000000000ULL, 0ULL, 60, { 0, 2, 6, 2, 23, 59, 59, 999 }, { 0, 11, 2, 1, 0, 0, 0, 0 }, }, - { 632715804000000000ULL, 632401308000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 0, 3, 0, 0, 0, 0 }, }, - { 633031164000000000ULL, 632716668000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 0, 1, 0, 0, 0, 0 }, }, - { 633346524000000000ULL, 633032028000000000ULL, 60, { 0, 2, 6, 5, 23, 59, 59, 999 }, { 0, 10, 0, 2, 0, 0, 0, 0 }, }, - { 633662748000000000ULL, 633347388000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 0, 3, 0, 0, 0, 0 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 2, 6, 2, 23, 59, 59, 999 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 2, 6, 4, 23, 59, 59, 999 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 636187356000000000ULL, 635871996000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 636502716000000000ULL, 636188220000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 2, 23, 59, 59, 999 }, }, - { 636818076000000000ULL, 636503580000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 637133436000000000ULL, 636818940000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 637449660000000000ULL, 637134300000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 5, 23, 59, 59, 999 }, }, - { 637765020000000000ULL, 637450524000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 638080380000000000ULL, 637765884000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 638395740000000000ULL, 638081244000000000ULL, 60, { 0, 2, 6, 5, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 638711964000000000ULL, 638396604000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 639027324000000000ULL, 638712828000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 639342684000000000ULL, 639028188000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 5, 23, 59, 59, 999 }, }, - { 639658044000000000ULL, 639343548000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 639974268000000000ULL, 639658908000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 640289628000000000ULL, 639975132000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 640604988000000000ULL, 640290492000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 640920348000000000ULL, 640605852000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 641236572000000000ULL, 640921212000000000ULL, 60, { 0, 2, 6, 2, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 641551932000000000ULL, 641237436000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 641867292000000000ULL, 641552796000000000ULL, 60, { 0, 2, 6, 5, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 642182652000000000ULL, 641868156000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 642498876000000000ULL, 642183516000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 642814236000000000ULL, 642499740000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 10, 6, 5, 23, 59, 59, 999 }, }, - { 643129596000000000ULL, 642815100000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 643444956000000000ULL, 643130460000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, }, - { 3155378076000000000ULL, 643445820000000000ULL, 60, { 0, 2, 6, 3, 23, 59, 59, 999 }, { 0, 11, 6, 1, 23, 59, 59, 999 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_35[] = -{ - { 633346524000000000ULL, 633032028000000000ULL, 60, { 0, 1, 1, 1, 0, 0, 0, 0 }, { 0, 12, 0, 5, 0, 0, 0, 0 }, }, - { 633662748000000000ULL, 633347388000000000ULL, 60, { 0, 3, 0, 3, 0, 0, 0, 0 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 3, 6, 2, 23, 59, 59, 999 }, { 0, 1, 4, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_36[] = -{ - { 632400444000000000ULL, 0ULL, 60, { 0, 10, 6, 5, 23, 0, 0, 0 }, { 0, 3, 6, 5, 22, 0, 0, 0 }, }, - { 632715804000000000ULL, 632401308000000000ULL, 60, { 0, 10, 6, 5, 23, 0, 0, 0 }, { 0, 3, 6, 5, 22, 0, 0, 0 }, }, - { 633031164000000000ULL, 632716668000000000ULL, 60, { 0, 10, 6, 5, 23, 0, 0, 0 }, { 0, 3, 6, 5, 22, 0, 0, 0 }, }, - { 633346524000000000ULL, 633032028000000000ULL, 60, { 0, 10, 6, 5, 23, 0, 0, 0 }, { 0, 3, 6, 4, 22, 0, 0, 0 }, }, - { 633662748000000000ULL, 633347388000000000ULL, 60, { 0, 10, 6, 5, 23, 0, 0, 0 }, { 0, 3, 6, 5, 22, 0, 0, 0 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 10, 6, 4, 23, 0, 0, 0 }, { 0, 3, 6, 5, 22, 0, 0, 0 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 10, 6, 5, 23, 0, 0, 0 }, { 0, 3, 6, 5, 22, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 10, 6, 5, 23, 0, 0, 0 }, { 0, 3, 6, 5, 22, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 10, 6, 5, 23, 0, 0, 0 }, { 0, 3, 6, 4, 22, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 10, 6, 5, 23, 0, 0, 0 }, { 0, 3, 6, 5, 22, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 6, 5, 23, 0, 0, 0 }, { 0, 3, 6, 5, 22, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 60, { 0, 10, 6, 4, 23, 0, 0, 0 }, { 0, 3, 6, 5, 22, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, 60, { 0, 10, 6, 5, 23, 0, 0, 0 }, { 0, 3, 6, 5, 22, 0, 0, 0 }, }, - { 636502716000000000ULL, 636188220000000000ULL, 60, { 0, 10, 6, 5, 23, 0, 0, 0 }, { 0, 3, 6, 5, 22, 0, 0, 0 }, }, - { 636818076000000000ULL, 636503580000000000ULL, 60, { 0, 10, 6, 5, 23, 0, 0, 0 }, { 0, 3, 6, 4, 22, 0, 0, 0 }, }, - { 637133436000000000ULL, 636818940000000000ULL, 60, { 0, 10, 6, 5, 23, 0, 0, 0 }, { 0, 3, 6, 5, 22, 0, 0, 0 }, }, - { 637449660000000000ULL, 637134300000000000ULL, 60, { 0, 10, 6, 4, 23, 0, 0, 0 }, { 0, 3, 6, 5, 22, 0, 0, 0 }, }, - { 3155378076000000000ULL, 637450524000000000ULL, 60, { 0, 10, 6, 5, 23, 0, 0, 0 }, { 0, 3, 6, 5, 22, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_37[] = -{ - { 635555772000000000ULL, 0ULL, 60, { 0, 3, 0, 2, 2, 0, 0, 0 }, { 0, 10, 0, 1, 2, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 60, { 0, 3, 0, 2, 2, 0, 0, 0 }, { 0, 1, 4, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_38[] = -{ - { 633346524000000000ULL, 0ULL, 60, { 0, 3, 6, 2, 23, 59, 59, 999 }, { 0, 10, 6, 2, 23, 59, 59, 999 }, }, - { 633662748000000000ULL, 633347388000000000ULL, 60, { 0, 3, 6, 5, 23, 59, 59, 999 }, { 0, 10, 6, 2, 23, 59, 59, 999 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 3, 6, 2, 23, 59, 59, 999 }, { 0, 10, 6, 2, 23, 59, 59, 999 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 4, 6, 1, 23, 59, 59, 999 }, { 0, 10, 6, 2, 23, 59, 59, 999 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 5, 6, 1, 23, 59, 59, 999 }, { 0, 8, 6, 3, 23, 59, 59, 999 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 4, 6, 5, 23, 59, 59, 999 }, { 0, 9, 6, 1, 23, 59, 59, 999 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 4, 6, 5, 23, 59, 59, 999 }, { 0, 9, 6, 1, 23, 59, 59, 999 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 4, 6, 5, 23, 59, 59, 999 }, { 0, 9, 6, 1, 23, 59, 59, 999 }, }, - { 636187356000000000ULL, 635871996000000000ULL, 60, { 0, 5, 6, 2, 23, 59, 59, 999 }, { 0, 8, 6, 2, 23, 59, 59, 999 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_39[] = -{ - { 633031164000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 4, 0, 1, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 633032028000000000ULL, 60, { 0, 11, 0, 1, 2, 0, 0, 0 }, { 0, 3, 0, 2, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_40[] = -{ - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 10, 6, 3, 23, 59, 59, 999 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 2, 6, 4, 23, 59, 59, 999 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_42[] = -{ - { 3155378076000000000ULL, 0ULL, 60, { 0, 9, 0, 5, 2, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_43[] = -{ - { 3155378076000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 1, 0, 0, 0 }, { 0, 3, 0, 5, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_46[] = -{ - { 633662748000000000ULL, 633347388000000000ULL, 60, { 0, 8, 0, 5, 23, 59, 59, 999 }, { 0, 5, 6, 5, 23, 59, 59, 999 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 8, 4, 3, 23, 59, 59, 999 }, { 0, 5, 0, 5, 23, 59, 59, 999 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 8, 6, 1, 23, 59, 59, 999 }, { 0, 5, 6, 1, 23, 59, 59, 999 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 7, 6, 5, 23, 59, 59, 999 }, { 0, 4, 6, 1, 23, 59, 59, 999 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 9, 0, 5, 3, 0, 0, 0 }, { 0, 4, 0, 5, 2, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 4, 0, 5, 2, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 636502716000000000ULL, 636188220000000000ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 636818076000000000ULL, 636503580000000000ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 636818940000000000ULL, 60, { 0, 10, 0, 4, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_47[] = -{ - { 3155378076000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 3, 0, 5, 1, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_49[] = -{ - { 3155378076000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_50[] = -{ - { 3155378076000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_51[] = -{ - { 3155378076000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_52[] = -{ - { 636502716000000000ULL, 0ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 636818076000000000ULL, 636503580000000000ULL, -60, { 0, 1, 1, 1, 1, 0, 0, 0 }, { 0, 1, 1, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_53[] = -{ - { 3155378076000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_55[] = -{ - { 634608828000000000ULL, 0ULL, 60, { 0, 10, 5, 5, 1, 0, 0, 0 }, { 0, 3, 4, 5, 23, 59, 59, 999 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 1, 0, 1, 0, 0, 0, 0 }, { 0, 3, 4, 5, 23, 59, 59, 999 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 12, 5, 3, 0, 0, 0, 0 }, { 0, 1, 2, 1, 0, 0, 0, 0 }, }, - { 3155378076000000000ULL, 635241276000000000ULL, 60, { 0, 10, 5, 5, 1, 0, 0, 0 }, { 0, 3, 4, 5, 23, 59, 59, 999 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_56[] = -{ - { 3155378076000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 4, 0, 0, 0 }, { 0, 3, 0, 5, 3, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_57[] = -{ - { 633978108000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 0, 0, 0, 0 }, { 0, 3, 0, 5, 0, 0, 0, 0 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 10, 6, 5, 23, 59, 59, 999 }, { 0, 3, 6, 5, 23, 59, 59, 999 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 10, 6, 5, 23, 59, 59, 999 }, { 0, 3, 6, 5, 23, 59, 59, 999 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 10, 6, 5, 23, 59, 59, 999 }, { 0, 3, 6, 4, 23, 59, 59, 999 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 10, 6, 5, 23, 59, 59, 999 }, { 0, 3, 6, 5, 23, 59, 59, 999 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 6, 5, 23, 59, 59, 999 }, { 0, 3, 6, 5, 23, 59, 59, 999 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 60, { 0, 10, 6, 4, 23, 59, 59, 999 }, { 0, 3, 6, 5, 23, 59, 59, 999 }, }, - { 636187356000000000ULL, 635871996000000000ULL, 60, { 0, 10, 6, 5, 23, 59, 59, 999 }, { 0, 3, 6, 5, 23, 59, 59, 999 }, }, - { 636502716000000000ULL, 636188220000000000ULL, 60, { 0, 10, 6, 5, 23, 59, 59, 999 }, { 0, 3, 6, 5, 23, 59, 59, 999 }, }, - { 636818076000000000ULL, 636503580000000000ULL, 60, { 0, 10, 6, 5, 23, 59, 59, 999 }, { 0, 3, 6, 4, 23, 59, 59, 999 }, }, - { 637133436000000000ULL, 636818940000000000ULL, 60, { 0, 10, 6, 5, 23, 59, 59, 999 }, { 0, 3, 6, 5, 23, 59, 59, 999 }, }, - { 637449660000000000ULL, 637134300000000000ULL, 60, { 0, 10, 6, 4, 23, 59, 59, 999 }, { 0, 3, 6, 5, 23, 59, 59, 999 }, }, - { 3155378076000000000ULL, 637450524000000000ULL, 60, { 0, 10, 6, 5, 23, 59, 59, 999 }, { 0, 3, 6, 5, 23, 59, 59, 999 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_58[] = -{ - { 632715804000000000ULL, 0ULL, 60, { 0, 9, 4, 5, 23, 59, 59, 999 }, { 0, 4, 5, 5, 0, 0, 0, 0 }, }, - { 633031164000000000ULL, 632716668000000000ULL, 60, { 0, 9, 4, 3, 23, 59, 59, 999 }, { 0, 4, 5, 5, 0, 0, 0, 0 }, }, - { 633346524000000000ULL, 633032028000000000ULL, 60, { 0, 9, 4, 1, 23, 59, 59, 999 }, { 0, 4, 4, 5, 23, 59, 59, 999 }, }, - { 633662748000000000ULL, 633347388000000000ULL, 60, { 0, 8, 4, 5, 23, 59, 59, 999 }, { 0, 4, 4, 5, 23, 59, 59, 999 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 8, 4, 3, 23, 59, 59, 999 }, { 0, 4, 4, 4, 23, 59, 59, 999 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 9, 4, 5, 23, 59, 59, 999 }, { 0, 4, 4, 5, 23, 59, 59, 999 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 9, 4, 5, 23, 59, 59, 999 }, { 0, 5, 4, 3, 23, 59, 59, 999 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_59[] = -{ - { 3155378076000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_60[] = -{ - { 632400444000000000ULL, 0ULL, 60, { 0, 9, 4, 5, 23, 59, 59, 999 }, { 0, 4, 4, 1, 0, 0, 0, 0 }, }, - { 632715804000000000ULL, 632401308000000000ULL, 60, { 0, 9, 5, 5, 23, 59, 59, 999 }, { 0, 4, 5, 1, 0, 0, 0, 0 }, }, - { 633031164000000000ULL, 632716668000000000ULL, 60, { 0, 9, 4, 3, 23, 59, 59, 999 }, { 0, 4, 6, 1, 0, 0, 0, 0 }, }, - { 633346524000000000ULL, 633032028000000000ULL, 60, { 0, 11, 4, 1, 23, 59, 59, 999 }, { 0, 3, 5, 5, 0, 0, 0, 0 }, }, - { 633662748000000000ULL, 633347388000000000ULL, 60, { 0, 10, 5, 5, 23, 59, 59, 999 }, { 0, 4, 5, 1, 0, 0, 0, 0 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 10, 4, 5, 23, 59, 59, 999 }, { 0, 3, 5, 5, 0, 0, 0, 0 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 10, 4, 5, 23, 59, 59, 999 }, { 0, 4, 5, 1, 0, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 10, 4, 5, 23, 59, 59, 999 }, { 0, 4, 5, 1, 0, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 10, 4, 5, 23, 59, 59, 999 }, { 0, 3, 5, 5, 0, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 10, 4, 4, 23, 59, 59, 999 }, { 0, 3, 5, 5, 0, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 4, 5, 23, 59, 59, 999 }, { 0, 3, 5, 5, 0, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 60, { 0, 10, 4, 5, 23, 59, 59, 999 }, { 0, 3, 5, 5, 0, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, 60, { 0, 10, 4, 5, 23, 59, 59, 999 }, { 0, 3, 5, 5, 0, 0, 0, 0 }, }, - { 636502716000000000ULL, 636188220000000000ULL, 60, { 0, 10, 4, 5, 23, 59, 59, 999 }, { 0, 3, 5, 5, 0, 0, 0, 0 }, }, - { 636818076000000000ULL, 636503580000000000ULL, 60, { 0, 10, 4, 5, 23, 59, 59, 999 }, { 0, 3, 5, 5, 0, 0, 0, 0 }, }, - { 637133436000000000ULL, 636818940000000000ULL, 60, { 0, 10, 4, 4, 23, 59, 59, 999 }, { 0, 3, 5, 5, 0, 0, 0, 0 }, }, - { 3155378076000000000ULL, 637134300000000000ULL, 60, { 0, 10, 4, 5, 23, 59, 59, 999 }, { 0, 3, 5, 5, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_61[] = -{ - { 634925052000000000ULL, 0ULL, 60, { 0, 9, 5, 3, 1, 0, 0, 0 }, { 0, 3, 4, 5, 23, 59, 59, 999 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 9, 4, 5, 23, 59, 59, 999 }, { 0, 3, 4, 5, 23, 59, 59, 999 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 4, 4, 23, 59, 59, 999 }, { 0, 3, 4, 5, 23, 59, 59, 999 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 60, { 0, 10, 4, 4, 23, 59, 59, 999 }, { 0, 3, 5, 5, 23, 59, 59, 999 }, }, - { 636187356000000000ULL, 635871996000000000ULL, 60, { 0, 10, 6, 5, 1, 0, 0, 0 }, { 0, 3, 6, 5, 1, 0, 0, 0 }, }, - { 636502716000000000ULL, 636188220000000000ULL, 60, { 0, 10, 6, 5, 1, 0, 0, 0 }, { 0, 3, 6, 5, 1, 0, 0, 0 }, }, - { 3155378076000000000ULL, 636503580000000000ULL, 60, { 0, 10, 6, 5, 1, 0, 0, 0 }, { 0, 3, 6, 4, 1, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_63[] = -{ - { 3155378076000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 4, 0, 0, 0 }, { 0, 3, 0, 5, 3, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_64[] = -{ - { 632400444000000000ULL, 0ULL, 60, { 0, 9, 3, 4, 1, 0, 0, 0 }, { 0, 4, 3, 1, 1, 0, 0, 0 }, }, - { 632715804000000000ULL, 632401308000000000ULL, 60, { 0, 10, 0, 2, 2, 0, 0, 0 }, { 0, 4, 5, 1, 2, 0, 0, 0 }, }, - { 633031164000000000ULL, 632716668000000000ULL, 60, { 0, 10, 0, 1, 2, 0, 0, 0 }, { 0, 3, 5, 5, 2, 0, 0, 0 }, }, - { 633346524000000000ULL, 633032028000000000ULL, 60, { 0, 9, 0, 3, 2, 0, 0, 0 }, { 0, 3, 5, 5, 2, 0, 0, 0 }, }, - { 633662748000000000ULL, 633347388000000000ULL, 60, { 0, 10, 0, 1, 2, 0, 0, 0 }, { 0, 3, 5, 5, 2, 0, 0, 0 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 9, 0, 5, 2, 0, 0, 0 }, { 0, 3, 5, 5, 2, 0, 0, 0 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 9, 0, 2, 2, 0, 0, 0 }, { 0, 3, 5, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 10, 0, 1, 2, 0, 0, 0 }, { 0, 4, 5, 1, 2, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 9, 0, 4, 2, 0, 0, 0 }, { 0, 3, 5, 5, 2, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 3, 5, 5, 2, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 3, 5, 5, 2, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 3, 5, 5, 2, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 3, 5, 5, 2, 0, 0, 0 }, }, - { 636502716000000000ULL, 636188220000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 3, 5, 4, 2, 0, 0, 0 }, }, - { 636818076000000000ULL, 636503580000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 3, 5, 4, 2, 0, 0, 0 }, }, - { 637133436000000000ULL, 636818940000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 3, 5, 5, 2, 0, 0, 0 }, }, - { 637449660000000000ULL, 637134300000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 3, 5, 5, 2, 0, 0, 0 }, }, - { 637765020000000000ULL, 637450524000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 3, 5, 5, 2, 0, 0, 0 }, }, - { 638080380000000000ULL, 637765884000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 3, 5, 5, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 638081244000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 3, 5, 4, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_65[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 1, 3, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_66[] = -{ - { 636187356000000000ULL, 0ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 636502716000000000ULL, 636188220000000000ULL, 60, { 0, 10, 2, 5, 23, 59, 59, 999 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_67[] = -{ - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 11, 6, 2, 2, 0, 0, 0 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 1, 2, 1, 0, 0, 0, 0 }, { 0, 3, 5, 5, 1, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_68[] = -{ - { 636502716000000000ULL, 0ULL, 60, { 0, 4, 0, 1, 2, 0, 0, 0 }, { 0, 9, 0, 1, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_69[] = -{ - { 632400444000000000ULL, 0ULL, 60, { 0, 10, 5, 1, 4, 0, 0, 0 }, { 0, 4, 4, 1, 3, 0, 0, 0 }, }, - { 632715804000000000ULL, 632401308000000000ULL, 60, { 0, 10, 6, 1, 4, 0, 0, 0 }, { 0, 4, 5, 1, 3, 0, 0, 0 }, }, - { 633031164000000000ULL, 632716668000000000ULL, 60, { 0, 10, 0, 1, 4, 0, 0, 0 }, { 0, 4, 6, 1, 3, 0, 0, 0 }, }, - { 633346524000000000ULL, 633032028000000000ULL, 60, { 0, 10, 1, 1, 4, 0, 0, 0 }, { 0, 4, 0, 1, 3, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_70[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 4, 0, 0, 0 }, { 0, 3, 0, 5, 3, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 10, 0, 5, 4, 0, 0, 0 }, { 0, 3, 1, 5, 3, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 10, 0, 5, 4, 0, 0, 0 }, { 0, 3, 0, 5, 3, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 10, 0, 5, 4, 0, 0, 0 }, { 0, 3, 0, 5, 3, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 0, 5, 4, 0, 0, 0 }, { 0, 3, 1, 5, 3, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 60, { 0, 11, 0, 2, 4, 0, 0, 0 }, { 0, 3, 0, 5, 3, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, -60, { 0, 3, 0, 5, 3, 0, 0, 0 }, { 0, 1, 5, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_72[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_73[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 1, 3, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_75[] = -{ - { 632400444000000000ULL, 0ULL, 60, { 0, 9, 1, 3, 23, 59, 59, 999 }, { 0, 3, 0, 3, 0, 0, 0, 0 }, }, - { 632715804000000000ULL, 632401308000000000ULL, 60, { 0, 9, 3, 3, 23, 59, 59, 999 }, { 0, 3, 2, 4, 0, 0, 0, 0 }, }, - { 633662748000000000ULL, 633347388000000000ULL, 60, { 0, 9, 6, 3, 23, 59, 59, 999 }, { 0, 3, 5, 3, 0, 0, 0, 0 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 9, 1, 3, 23, 59, 59, 999 }, { 0, 3, 0, 4, 0, 0, 0, 0 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 9, 2, 3, 23, 59, 59, 999 }, { 0, 3, 1, 4, 0, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 9, 3, 3, 23, 59, 59, 999 }, { 0, 3, 2, 4, 0, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 9, 4, 3, 23, 59, 59, 999 }, { 0, 3, 3, 3, 0, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 9, 6, 3, 23, 59, 59, 999 }, { 0, 3, 5, 4, 0, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 9, 0, 3, 23, 59, 59, 999 }, { 0, 3, 6, 4, 0, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 60, { 0, 9, 1, 3, 23, 59, 59, 999 }, { 0, 3, 0, 4, 0, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, 60, { 0, 9, 2, 3, 23, 59, 59, 999 }, { 0, 3, 1, 3, 0, 0, 0, 0 }, }, - { 636502716000000000ULL, 636188220000000000ULL, 60, { 0, 9, 4, 3, 23, 59, 59, 999 }, { 0, 3, 3, 4, 0, 0, 0, 0 }, }, - { 636818076000000000ULL, 636503580000000000ULL, 60, { 0, 9, 5, 3, 23, 59, 59, 999 }, { 0, 3, 4, 4, 0, 0, 0, 0 }, }, - { 637133436000000000ULL, 636818940000000000ULL, 60, { 0, 9, 6, 3, 23, 59, 59, 999 }, { 0, 3, 5, 4, 0, 0, 0, 0 }, }, - { 637449660000000000ULL, 637134300000000000ULL, 60, { 0, 9, 0, 3, 23, 59, 59, 999 }, { 0, 3, 6, 3, 0, 0, 0, 0 }, }, - { 637765020000000000ULL, 637450524000000000ULL, 60, { 0, 9, 2, 3, 23, 59, 59, 999 }, { 0, 3, 1, 4, 0, 0, 0, 0 }, }, - { 638080380000000000ULL, 637765884000000000ULL, 60, { 0, 9, 3, 3, 23, 59, 59, 999 }, { 0, 3, 2, 4, 0, 0, 0, 0 }, }, - { 638395740000000000ULL, 638081244000000000ULL, 60, { 0, 9, 4, 3, 23, 59, 59, 999 }, { 0, 3, 3, 4, 0, 0, 0, 0 }, }, - { 3155378076000000000ULL, 638396604000000000ULL, 60, { 0, 9, 5, 3, 23, 59, 59, 999 }, { 0, 3, 4, 3, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_77[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 1, 3, 1, 0, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, -60, { 0, 3, 0, 5, 2, 0, 0, 0 }, { 0, 1, 5, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_78[] = -{ - { 635871132000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 5, 0, 0, 0 }, { 0, 3, 0, 5, 4, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_79[] = -{ - { 633978108000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 1, 5, 1, 0, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_80[] = -{ - { 633662748000000000ULL, 633347388000000000ULL, 60, { 0, 1, 2, 1, 0, 0, 0, 0 }, { 0, 10, 0, 5, 2, 0, 0, 0 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 3, 0, 5, 2, 0, 0, 0 }, { 0, 1, 4, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_81[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 1, 3, 1, 0, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, -60, { 0, 12, 0, 1, 2, 0, 0, 0 }, { 0, 1, 5, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_83[] = -{ - { 634608828000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_86[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 1, 3, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_87[] = -{ - { 633662748000000000ULL, 633347388000000000ULL, 60, { 0, 10, 5, 5, 23, 59, 59, 999 }, { 0, 5, 6, 5, 23, 59, 59, 999 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 10, 6, 5, 23, 59, 59, 999 }, { 0, 4, 2, 2, 23, 59, 59, 999 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_92[] = -{ - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 12, 4, 5, 23, 59, 59, 999 }, { 0, 6, 5, 3, 23, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_93[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 1, 3, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_96[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 1, 3, 1, 0, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, -60, { 0, 3, 0, 5, 2, 0, 0, 0 }, { 0, 1, 5, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_97[] = -{ - { 633031164000000000ULL, 0ULL, 60, { 0, 9, 6, 5, 2, 0, 0, 0 }, { 0, 3, 6, 5, 2, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 60, { 0, 9, 5, 5, 23, 59, 59, 999 }, { 0, 3, 6, 5, 2, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, 60, { 0, 9, 5, 4, 23, 59, 59, 999 }, { 0, 3, 6, 5, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_98[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 1, 3, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_99[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 1, 3, 1, 0, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, -60, { 0, 7, 0, 4, 2, 0, 0, 0 }, { 0, 1, 5, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_100[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 1, 3, 1, 0, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, -60, { 0, 5, 0, 5, 2, 0, 0, 0 }, { 0, 1, 5, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_102[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 1, 3, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_104[] = -{ - { 633031164000000000ULL, 632716668000000000ULL, 60, { 0, 1, 0, 1, 0, 0, 0, 0 }, { 0, 12, 0, 1, 2, 0, 0, 0 }, }, - { 633346524000000000ULL, 633032028000000000ULL, 60, { 0, 3, 0, 5, 3, 0, 0, 0 }, { 0, 10, 0, 5, 2, 0, 0, 0 }, }, - { 633662748000000000ULL, 633347388000000000ULL, 60, { 0, 3, 0, 5, 3, 0, 0, 0 }, { 0, 10, 0, 5, 2, 0, 0, 0 }, }, - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 3, 0, 5, 3, 0, 0, 0 }, { 0, 1, 4, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_106[] = -{ - { 635871132000000000ULL, 635556636000000000ULL, 60, { 0, 9, 5, 5, 23, 59, 59, 999 }, { 0, 3, 6, 5, 2, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, 60, { 0, 9, 5, 4, 23, 59, 59, 999 }, { 0, 3, 6, 5, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_108[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 120, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 1, 3, 1, 0, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, -60, { 0, 3, 0, 5, 2, 0, 0, 0 }, { 0, 1, 5, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_110[] = -{ - { 635871132000000000ULL, 635556636000000000ULL, 30, { 0, 8, 5, 2, 23, 59, 59, 999 }, { 0, 1, 4, 1, 0, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 636502716000000000ULL, 636188220000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 636818076000000000ULL, 636503580000000000ULL, -30, { 0, 5, 5, 1, 23, 30, 0, 0 }, { 0, 1, 1, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_112[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 1, 3, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_113[] = -{ - { 633346524000000000ULL, 0ULL, 60, { 0, 3, 0, 5, 3, 0, 0, 0 }, { 0, 10, 0, 5, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 633347388000000000ULL, 60, { 0, 4, 0, 1, 3, 0, 0, 0 }, { 0, 10, 0, 1, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_116[] = -{ - { 633346524000000000ULL, 0ULL, 60, { 0, 3, 0, 5, 3, 0, 0, 0 }, { 0, 10, 0, 5, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 633347388000000000ULL, 60, { 0, 4, 0, 1, 3, 0, 0, 0 }, { 0, 10, 0, 1, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_118[] = -{ - { 633346524000000000ULL, 0ULL, 60, { 0, 3, 0, 5, 3, 0, 0, 0 }, { 0, 10, 0, 1, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 633347388000000000ULL, 60, { 0, 4, 0, 1, 3, 0, 0, 0 }, { 0, 10, 0, 1, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_119[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 1, 3, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_120[] = -{ - { 632715804000000000ULL, 0ULL, 30, { 0, 3, 0, 5, 2, 0, 0, 0 }, { 0, 10, 0, 5, 2, 0, 0, 0 }, }, - { 633031164000000000ULL, 632716668000000000ULL, 30, { 0, 4, 0, 1, 2, 0, 0, 0 }, { 0, 10, 0, 5, 2, 0, 0, 0 }, }, - { 633346524000000000ULL, 633032028000000000ULL, 30, { 0, 3, 0, 5, 2, 0, 0, 0 }, { 0, 10, 0, 5, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 633347388000000000ULL, 30, { 0, 4, 0, 1, 2, 0, 0, 0 }, { 0, 10, 0, 1, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_121[] = -{ - { 635240412000000000ULL, 0ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 1, 3, 1, 0, 0, 0, 0 }, { 0, 12, 0, 5, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_122[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 1, 3, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_123[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 120, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 1, 3, 1, 0, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, -60, { 0, 4, 0, 5, 2, 0, 0, 0 }, { 0, 1, 5, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_124[] = -{ - { 635555772000000000ULL, 0ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 30, { 0, 10, 0, 1, 2, 0, 0, 0 }, { 0, 1, 4, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_125[] = -{ - { 634293468000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 10, 0, 5, 2, 0, 0, 0 }, { 0, 1, 3, 1, 0, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, -60, { 0, 3, 0, 5, 2, 0, 0, 0 }, { 0, 1, 5, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_127[] = -{ - { 633978108000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 1, 5, 1, 0, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 1, 6, 1, 0, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_128[] = -{ - { 633031164000000000ULL, 0ULL, 60, { 0, 3, 0, 3, 3, 0, 0, 0 }, { 0, 10, 0, 1, 2, 0, 0, 0 }, }, - { 633346524000000000ULL, 633032028000000000ULL, 60, { 0, 3, 0, 3, 3, 0, 0, 0 }, { 0, 9, 0, 5, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 633347388000000000ULL, 60, { 0, 4, 0, 1, 3, 0, 0, 0 }, { 0, 9, 0, 5, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_130[] = -{ - { 633978108000000000ULL, 633663612000000000ULL, 60, { 0, 1, 4, 1, 0, 0, 0, 0 }, { 0, 11, 0, 5, 2, 0, 0, 0 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 3, 0, 5, 3, 0, 0, 0 }, { 0, 10, 0, 4, 2, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 3, 0, 1, 3, 0, 0, 0 }, { 0, 10, 0, 4, 2, 0, 0, 0 }, }, - { 634925052000000000ULL, 634609692000000000ULL, 60, { 0, 1, 0, 4, 3, 0, 0, 0 }, { 0, 10, 0, 3, 2, 0, 0, 0 }, }, - { 635240412000000000ULL, 634925916000000000ULL, 60, { 0, 1, 0, 3, 3, 0, 0, 0 }, { 0, 10, 0, 4, 2, 0, 0, 0 }, }, - { 635555772000000000ULL, 635241276000000000ULL, 60, { 0, 1, 0, 3, 2, 0, 0, 0 }, { 0, 11, 0, 1, 2, 0, 0, 0 }, }, - { 635871132000000000ULL, 635556636000000000ULL, 60, { 0, 1, 0, 3, 3, 0, 0, 0 }, { 0, 11, 0, 1, 2, 0, 0, 0 }, }, - { 636187356000000000ULL, 635871996000000000ULL, 60, { 0, 1, 0, 3, 3, 0, 0, 0 }, { 0, 11, 0, 1, 2, 0, 0, 0 }, }, - { 636502716000000000ULL, 636188220000000000ULL, 60, { 0, 1, 0, 3, 3, 0, 0, 0 }, { 0, 11, 0, 1, 2, 0, 0, 0 }, }, - { 636818076000000000ULL, 636503580000000000ULL, 60, { 0, 1, 0, 2, 3, 0, 0, 0 }, { 0, 11, 0, 1, 2, 0, 0, 0 }, }, - { 3155378076000000000ULL, 636818940000000000ULL, 60, { 0, 1, 0, 3, 3, 0, 0, 0 }, { 0, 11, 0, 1, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_131[] = -{ - { 3155378076000000000ULL, 0ULL, 60, { 0, 10, 0, 5, 3, 0, 0, 0 }, { 0, 3, 0, 5, 2, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_132[] = -{ - { 633031164000000000ULL, 0ULL, 60, { 0, 3, 0, 3, 3, 45, 0, 0 }, { 0, 10, 0, 1, 2, 45, 0, 0 }, }, - { 633346524000000000ULL, 633032028000000000ULL, 60, { 0, 3, 0, 3, 3, 45, 0, 0 }, { 0, 9, 0, 5, 2, 45, 0, 0 }, }, - { 3155378076000000000ULL, 633347388000000000ULL, 60, { 0, 4, 0, 1, 3, 45, 0, 0 }, { 0, 9, 0, 5, 2, 45, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_134[] = -{ - { 636187356000000000ULL, 635871996000000000ULL, 60, { 0, 1, 5, 1, 0, 0, 0, 0 }, { 0, 11, 0, 1, 2, 0, 0, 0 }, }, - { 636502716000000000ULL, 636188220000000000ULL, 60, { 0, 1, 0, 3, 3, 0, 0, 0 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, } -}; - -static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_135[] = -{ - { 633978108000000000ULL, 0ULL, 0, { 0, 1, 0, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0, 0, 0, 0 }, }, - { 634293468000000000ULL, 633978972000000000ULL, 60, { 0, 1, 5, 1, 0, 0, 0, 0 }, { 0, 9, 0, 5, 0, 0, 0, 0 }, }, - { 634608828000000000ULL, 634294332000000000ULL, 60, { 0, 4, 6, 1, 4, 0, 0, 0 }, { 0, 9, 6, 4, 3, 0, 0, 0 }, }, - { 3155378076000000000ULL, 634609692000000000ULL, 60, { 0, 4, 0, 1, 4, 0, 0, 0 }, { 0, 9, 0, 5, 3, 0, 0, 0 }, } -}; - -static const TIME_ZONE_ENTRY TimeZoneTable[] = -{ - { - "Dateline Standard Time", 720, FALSE, "(UTC-12:00) International Date Line West", - "Dateline Standard Time", "Dateline Daylight Time", - NULL, 0 - }, - { - "UTC-11", 660, FALSE, "(UTC-11:00) Coordinated Universal Time-11", - "UTC-11", "UTC-11", - NULL, 0 - }, - { - "Aleutian Standard Time", 600, TRUE, "(UTC-10:00) Aleutian Islands", - "Aleutian Standard Time", "Aleutian Daylight Time", - TimeZoneRuleTable_2, 2 - }, - { - "Hawaiian Standard Time", 600, FALSE, "(UTC-10:00) Hawaii", - "Hawaiian Standard Time", "Hawaiian Daylight Time", - NULL, 0 - }, - { - "Marquesas Standard Time", 570, FALSE, "(UTC-09:30) Marquesas Islands", - "Marquesas Standard Time", "Marquesas Daylight Time", - NULL, 0 - }, - { - "Alaskan Standard Time", 540, TRUE, "(UTC-09:00) Alaska", - "Alaskan Standard Time", "Alaskan Daylight Time", - TimeZoneRuleTable_5, 2 - }, - { - "UTC-09", 540, FALSE, "(UTC-09:00) Coordinated Universal Time-09", - "UTC-09", "UTC-09", - NULL, 0 - }, - { - "Pacific Standard Time (Mexico)", 480, TRUE, "(UTC-08:00) Baja California", - "Pacific Standard Time (Mexico)", "Pacific Daylight Time (Mexico)", - TimeZoneRuleTable_7, 2 - }, - { - "UTC-08", 480, FALSE, "(UTC-08:00) Coordinated Universal Time-08", - "UTC-08", "UTC-08", - NULL, 0 - }, - { - "Pacific Standard Time", 480, TRUE, "(UTC-08:00) Pacific Time (US & Canada)", - "Pacific Standard Time", "Pacific Daylight Time", - TimeZoneRuleTable_9, 2 - }, - { - "US Mountain Standard Time", 420, FALSE, "(UTC-07:00) Arizona", - "US Mountain Standard Time", "US Mountain Daylight Time", - NULL, 0 - }, - { - "Mountain Standard Time (Mexico)", 420, TRUE, "(UTC-07:00) Chihuahua, La Paz, Mazatlan", - "Mountain Standard Time (Mexico)", "Mountain Daylight Time (Mexico)", - TimeZoneRuleTable_11, 1 - }, - { - "Mountain Standard Time", 420, TRUE, "(UTC-07:00) Mountain Time (US & Canada)", - "Mountain Standard Time", "Mountain Daylight Time", - TimeZoneRuleTable_12, 2 - }, - { - "Central America Standard Time", 360, FALSE, "(UTC-06:00) Central America", - "Central America Standard Time", "Central America Daylight Time", - NULL, 0 - }, - { - "Central Standard Time", 360, TRUE, "(UTC-06:00) Central Time (US & Canada)", - "Central Standard Time", "Central Daylight Time", - TimeZoneRuleTable_14, 2 - }, - { - "Easter Island Standard Time", 360, TRUE, "(UTC-06:00) Easter Island", - "Easter Island Standard Time", "Easter Island Daylight Time", - TimeZoneRuleTable_15, 10 - }, - { - "Central Standard Time (Mexico)", 360, TRUE, "(UTC-06:00) Guadalajara, Mexico City, Monterrey", - "Central Standard Time (Mexico)", "Central Daylight Time (Mexico)", - TimeZoneRuleTable_16, 1 - }, - { - "Canada Central Standard Time", 360, FALSE, "(UTC-06:00) Saskatchewan", - "Canada Central Standard Time", "Canada Central Daylight Time", - NULL, 0 - }, - { - "SA Pacific Standard Time", 300, FALSE, "(UTC-05:00) Bogota, Lima, Quito, Rio Branco", - "SA Pacific Standard Time", "SA Pacific Daylight Time", - NULL, 0 - }, - { - "Eastern Standard Time (Mexico)", 300, TRUE, "(UTC-05:00) Chetumal", - "Eastern Standard Time (Mexico)", "Eastern Daylight Time (Mexico)", - TimeZoneRuleTable_19, 2 - }, - { - "Eastern Standard Time", 300, TRUE, "(UTC-05:00) Eastern Time (US & Canada)", - "Eastern Standard Time", "Eastern Daylight Time", - TimeZoneRuleTable_20, 2 - }, - { - "Haiti Standard Time", 300, TRUE, "(UTC-05:00) Haiti", - "Haiti Standard Time", "Haiti Daylight Time", - TimeZoneRuleTable_21, 6 - }, - { - "Cuba Standard Time", 300, TRUE, "(UTC-05:00) Havana", - "Cuba Standard Time", "Cuba Daylight Time", - TimeZoneRuleTable_22, 11 - }, - { - "US Eastern Standard Time", 300, TRUE, "(UTC-05:00) Indiana (East)", - "US Eastern Standard Time", "US Eastern Daylight Time", - TimeZoneRuleTable_23, 2 - }, - { - "Turks And Caicos Standard Time", 300, TRUE, "(UTC-05:00) Turks and Caicos", - "Turks and Caicos Standard Time", "Turks and Caicos Daylight Time", - TimeZoneRuleTable_24, 6 - }, - { - "Paraguay Standard Time", 240, TRUE, "(UTC-04:00) Asuncion", - "Paraguay Standard Time", "Paraguay Daylight Time", - TimeZoneRuleTable_25, 14 - }, - { - "Atlantic Standard Time", 240, TRUE, "(UTC-04:00) Atlantic Time (Canada)", - "Atlantic Standard Time", "Atlantic Daylight Time", - TimeZoneRuleTable_26, 2 - }, - { - "Venezuela Standard Time", 240, TRUE, "(UTC-04:00) Caracas", - "Venezuela Standard Time", "Venezuela Daylight Time", - TimeZoneRuleTable_27, 10 - }, - { - "Central Brazilian Standard Time", 240, TRUE, "(UTC-04:00) Cuiaba", - "Central Brazilian Standard Time", "Central Brazilian Daylight Time", - TimeZoneRuleTable_28, 37 - }, - { - "SA Western Standard Time", 240, FALSE, "(UTC-04:00) Georgetown, La Paz, Manaus, San Juan", - "SA Western Standard Time", "SA Western Daylight Time", - NULL, 0 - }, - { - "Pacific SA Standard Time", 240, TRUE, "(UTC-04:00) Santiago", - "Pacific SA Standard Time", "Pacific SA Daylight Time", - TimeZoneRuleTable_30, 10 - }, - { - "Newfoundland Standard Time", 210, TRUE, "(UTC-03:30) Newfoundland", - "Newfoundland Standard Time", "Newfoundland Daylight Time", - TimeZoneRuleTable_31, 7 - }, - { - "Tocantins Standard Time", 180, TRUE, "(UTC-03:00) Araguaina", - "Tocantins Standard Time", "Tocantins Daylight Time", - TimeZoneRuleTable_32, 2 - }, - { - "E. South America Standard Time", 180, TRUE, "(UTC-03:00) Brasilia", - "E. South America Standard Time", "E. South America Daylight Time", - TimeZoneRuleTable_33, 37 - }, - { - "SA Eastern Standard Time", 180, FALSE, "(UTC-03:00) Cayenne, Fortaleza", - "SA Eastern Standard Time", "SA Eastern Daylight Time", - NULL, 0 - }, - { - "Argentina Standard Time", 180, TRUE, "(UTC-03:00) City of Buenos Aires", - "Argentina Standard Time", "Argentina Daylight Time", - TimeZoneRuleTable_35, 3 - }, - { - "Greenland Standard Time", 180, TRUE, "(UTC-03:00) Greenland", - "Greenland Standard Time", "Greenland Daylight Time", - TimeZoneRuleTable_36, 18 - }, - { - "Montevideo Standard Time", 180, TRUE, "(UTC-03:00) Montevideo", - "Montevideo Standard Time", "Montevideo Daylight Time", - TimeZoneRuleTable_37, 2 - }, - { - "Magallanes Standard Time", 180, TRUE, "(UTC-03:00) Punta Arenas", - "Magallanes Standard Time", "Magallanes Daylight Time", - TimeZoneRuleTable_38, 9 - }, - { - "Saint Pierre Standard Time", 180, TRUE, "(UTC-03:00) Saint Pierre and Miquelon", - "Saint Pierre Standard Time", "Saint Pierre Daylight Time", - TimeZoneRuleTable_39, 2 - }, - { - "Bahia Standard Time", 180, TRUE, "(UTC-03:00) Salvador", - "Bahia Standard Time", "Bahia Daylight Time", - TimeZoneRuleTable_40, 2 - }, - { - "UTC-02", 120, FALSE, "(UTC-02:00) Coordinated Universal Time-02", - "UTC-02", "UTC-02", - NULL, 0 - }, - { - "Mid-Atlantic Standard Time", 120, TRUE, "(UTC-02:00) Mid-Atlantic - Old", - "Mid-Atlantic Standard Time", "Mid-Atlantic Daylight Time", - TimeZoneRuleTable_42, 1 - }, - { - "Azores Standard Time", 60, TRUE, "(UTC-01:00) Azores", - "Azores Standard Time", "Azores Daylight Time", - TimeZoneRuleTable_43, 1 - }, - { - "Cape Verde Standard Time", 60, FALSE, "(UTC-01:00) Cabo Verde Is.", - "Cabo Verde Standard Time", "Cabo Verde Daylight Time", - NULL, 0 - }, - { - "UTC", 0, FALSE, "(UTC) Coordinated Universal Time", - "Coordinated Universal Time", "Coordinated Universal Time", - NULL, 0 - }, - { - "Morocco Standard Time", 0, TRUE, "(UTC+00:00) Casablanca", - "Morocco Standard Time", "Morocco Daylight Time", - TimeZoneRuleTable_46, 12 - }, - { - "GMT Standard Time", 0, TRUE, "(UTC+00:00) Dublin, Edinburgh, Lisbon, London", - "GMT Standard Time", "GMT Daylight Time", - TimeZoneRuleTable_47, 1 - }, - { - "Greenwich Standard Time", 0, FALSE, "(UTC+00:00) Monrovia, Reykjavik", - "Greenwich Standard Time", "Greenwich Daylight Time", - NULL, 0 - }, - { - "W. Europe Standard Time", -60, TRUE, "(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna", - "W. Europe Standard Time", "W. Europe Daylight Time", - TimeZoneRuleTable_49, 1 - }, - { - "Central Europe Standard Time", -60, TRUE, "(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague", - "Central Europe Standard Time", "Central Europe Daylight Time", - TimeZoneRuleTable_50, 1 - }, - { - "Romance Standard Time", -60, TRUE, "(UTC+01:00) Brussels, Copenhagen, Madrid, Paris", - "Romance Standard Time", "Romance Daylight Time", - TimeZoneRuleTable_51, 1 - }, - { - "Sao Tome Standard Time", -60, TRUE, "(UTC+01:00) Sao Tome", - "Sao Tome Standard Time", "Sao Tome Daylight Time", - TimeZoneRuleTable_52, 2 - }, - { - "Central European Standard Time", -60, TRUE, "(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb", - "Central European Standard Time", "Central European Daylight Time", - TimeZoneRuleTable_53, 1 - }, - { - "W. Central Africa Standard Time", -60, FALSE, "(UTC+01:00) West Central Africa", - "W. Central Africa Standard Time", "W. Central Africa Daylight Time", - NULL, 0 - }, - { - "Jordan Standard Time", -120, TRUE, "(UTC+02:00) Amman", - "Jordan Standard Time", "Jordan Daylight Time", - TimeZoneRuleTable_55, 4 - }, - { - "GTB Standard Time", -120, TRUE, "(UTC+02:00) Athens, Bucharest", - "GTB Standard Time", "GTB Daylight Time", - TimeZoneRuleTable_56, 1 - }, - { - "Middle East Standard Time", -120, TRUE, "(UTC+02:00) Beirut", - "Middle East Standard Time", "Middle East Daylight Time", - TimeZoneRuleTable_57, 13 - }, - { - "Egypt Standard Time", -120, TRUE, "(UTC+02:00) Cairo", - "Egypt Standard Time", "Egypt Daylight Time", - TimeZoneRuleTable_58, 7 - }, - { - "E. Europe Standard Time", -120, TRUE, "(UTC+02:00) Chisinau", - "E. Europe Standard Time", "E. Europe Daylight Time", - TimeZoneRuleTable_59, 1 - }, - { - "Syria Standard Time", -120, TRUE, "(UTC+02:00) Damascus", - "Syria Standard Time", "Syria Daylight Time", - TimeZoneRuleTable_60, 17 - }, - { - "West Bank Standard Time", -120, TRUE, "(UTC+02:00) Gaza, Hebron", - "West Bank Gaza Standard Time", "West Bank Gaza Daylight Time", - TimeZoneRuleTable_61, 7 - }, - { - "South Africa Standard Time", -120, FALSE, "(UTC+02:00) Harare, Pretoria", - "South Africa Standard Time", "South Africa Daylight Time", - NULL, 0 - }, - { - "FLE Standard Time", -120, TRUE, "(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius", - "FLE Standard Time", "FLE Daylight Time", - TimeZoneRuleTable_63, 1 - }, - { - "Israel Standard Time", -120, TRUE, "(UTC+02:00) Jerusalem", - "Jerusalem Standard Time", "Jerusalem Daylight Time", - TimeZoneRuleTable_64, 20 - }, - { - "Kaliningrad Standard Time", -120, TRUE, "(UTC+02:00) Kaliningrad", - "Russia TZ 1 Standard Time", "Russia TZ 1 Daylight Time", - TimeZoneRuleTable_65, 5 - }, - { - "Sudan Standard Time", -120, TRUE, "(UTC+02:00) Khartoum", - "Sudan Standard Time", "Sudan Daylight Time", - TimeZoneRuleTable_66, 2 - }, - { - "Libya Standard Time", -120, TRUE, "(UTC+02:00) Tripoli", - "Libya Standard Time", "Libya Daylight Time", - TimeZoneRuleTable_67, 2 - }, - { - "Namibia Standard Time", -120, TRUE, "(UTC+02:00) Windhoek", - "Namibia Standard Time", "Namibia Daylight Time", - TimeZoneRuleTable_68, 1 - }, - { - "Arabic Standard Time", -180, TRUE, "(UTC+03:00) Baghdad", - "Arabic Standard Time", "Arabic Daylight Time", - TimeZoneRuleTable_69, 4 - }, - { - "Turkey Standard Time", -180, TRUE, "(UTC+03:00) Istanbul", - "Turkey Standard Time", "Turkey Daylight Time", - TimeZoneRuleTable_70, 7 - }, - { - "Arab Standard Time", -180, FALSE, "(UTC+03:00) Kuwait, Riyadh", - "Arab Standard Time", "Arab Daylight Time", - NULL, 0 - }, - { - "Belarus Standard Time", -180, TRUE, "(UTC+03:00) Minsk", - "Belarus Standard Time", "Belarus Daylight Time", - TimeZoneRuleTable_72, 2 - }, - { - "Russian Standard Time", -180, TRUE, "(UTC+03:00) Moscow, St. Petersburg, Volgograd", - "Russia TZ 2 Standard Time", "Russia TZ 2 Daylight Time", - TimeZoneRuleTable_73, 5 - }, - { - "E. Africa Standard Time", -180, FALSE, "(UTC+03:00) Nairobi", - "E. Africa Standard Time", "E. Africa Daylight Time", - NULL, 0 - }, - { - "Iran Standard Time", -210, TRUE, "(UTC+03:30) Tehran", - "Iran Standard Time", "Iran Daylight Time", - TimeZoneRuleTable_75, 19 - }, - { - "Arabian Standard Time", -240, FALSE, "(UTC+04:00) Abu Dhabi, Muscat", - "Arabian Standard Time", "Arabian Daylight Time", - NULL, 0 - }, - { - "Astrakhan Standard Time", -240, TRUE, "(UTC+04:00) Astrakhan, Ulyanovsk", - "Astrakhan Standard Time", "Astrakhan Daylight Time", - TimeZoneRuleTable_77, 5 - }, - { - "Azerbaijan Standard Time", -240, TRUE, "(UTC+04:00) Baku", - "Azerbaijan Standard Time", "Azerbaijan Daylight Time", - TimeZoneRuleTable_78, 1 - }, - { - "Russia Time Zone 3", -240, TRUE, "(UTC+04:00) Izhevsk, Samara", - "Russia TZ 3 Standard Time", "Russia TZ 3 Daylight Time", - TimeZoneRuleTable_79, 3 - }, - { - "Mauritius Standard Time", -240, TRUE, "(UTC+04:00) Port Louis", - "Mauritius Standard Time", "Mauritius Daylight Time", - TimeZoneRuleTable_80, 2 - }, - { - "Saratov Standard Time", -240, TRUE, "(UTC+04:00) Saratov", - "Saratov Standard Time", "Saratov Daylight Time", - TimeZoneRuleTable_81, 5 - }, - { - "Georgian Standard Time", -240, FALSE, "(UTC+04:00) Tbilisi", - "Georgian Standard Time", "Georgian Daylight Time", - NULL, 0 - }, - { - "Caucasus Standard Time", -240, TRUE, "(UTC+04:00) Yerevan", - "Caucasus Standard Time", "Caucasus Daylight Time", - TimeZoneRuleTable_83, 1 - }, - { - "Afghanistan Standard Time", -270, FALSE, "(UTC+04:30) Kabul", - "Afghanistan Standard Time", "Afghanistan Daylight Time", - NULL, 0 - }, - { - "West Asia Standard Time", -300, FALSE, "(UTC+05:00) Ashgabat, Tashkent", - "West Asia Standard Time", "West Asia Daylight Time", - NULL, 0 - }, - { - "Ekaterinburg Standard Time", -300, TRUE, "(UTC+05:00) Ekaterinburg", - "Russia TZ 4 Standard Time", "Russia TZ 4 Daylight Time", - TimeZoneRuleTable_86, 5 - }, - { - "Pakistan Standard Time", -300, TRUE, "(UTC+05:00) Islamabad, Karachi", - "Pakistan Standard Time", "Pakistan Daylight Time", - TimeZoneRuleTable_87, 2 - }, - { - "India Standard Time", -330, FALSE, "(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi", - "India Standard Time", "India Daylight Time", - NULL, 0 - }, - { - "Sri Lanka Standard Time", -330, FALSE, "(UTC+05:30) Sri Jayawardenepura", - "Sri Lanka Standard Time", "Sri Lanka Daylight Time", - NULL, 0 - }, - { - "Nepal Standard Time", -345, FALSE, "(UTC+05:45) Kathmandu", - "Nepal Standard Time", "Nepal Daylight Time", - NULL, 0 - }, - { - "Central Asia Standard Time", -360, FALSE, "(UTC+06:00) Astana", - "Central Asia Standard Time", "Central Asia Daylight Time", - NULL, 0 - }, - { - "Bangladesh Standard Time", -360, TRUE, "(UTC+06:00) Dhaka", - "Bangladesh Standard Time", "Bangladesh Daylight Time", - TimeZoneRuleTable_92, 1 - }, - { - "Omsk Standard Time", -360, TRUE, "(UTC+06:00) Omsk", - "Omsk Standard Time", "Omsk Daylight Time", - TimeZoneRuleTable_93, 5 - }, - { - "Myanmar Standard Time", -390, FALSE, "(UTC+06:30) Yangon (Rangoon)", - "Myanmar Standard Time", "Myanmar Daylight Time", - NULL, 0 - }, - { - "SE Asia Standard Time", -420, FALSE, "(UTC+07:00) Bangkok, Hanoi, Jakarta", - "SE Asia Standard Time", "SE Asia Daylight Time", - NULL, 0 - }, - { - "Altai Standard Time", -420, TRUE, "(UTC+07:00) Barnaul, Gorno-Altaysk", - "Altai Standard Time", "Altai Daylight Time", - TimeZoneRuleTable_96, 5 - }, - { - "W. Mongolia Standard Time", -420, TRUE, "(UTC+07:00) Hovd", - "W. Mongolia Standard Time", "W. Mongolia Daylight Time", - TimeZoneRuleTable_97, 3 - }, - { - "North Asia Standard Time", -420, TRUE, "(UTC+07:00) Krasnoyarsk", - "Russia TZ 6 Standard Time", "Russia TZ 6 Daylight Time", - TimeZoneRuleTable_98, 5 - }, - { - "N. Central Asia Standard Time", -420, TRUE, "(UTC+07:00) Novosibirsk", - "Novosibirsk Standard Time", "Novosibirsk Daylight Time", - TimeZoneRuleTable_99, 5 - }, - { - "Tomsk Standard Time", -420, TRUE, "(UTC+07:00) Tomsk", - "Tomsk Standard Time", "Tomsk Daylight Time", - TimeZoneRuleTable_100, 5 - }, - { - "China Standard Time", -480, FALSE, "(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi", - "China Standard Time", "China Daylight Time", - NULL, 0 - }, - { - "North Asia East Standard Time", -480, TRUE, "(UTC+08:00) Irkutsk", - "Russia TZ 7 Standard Time", "Russia TZ 7 Daylight Time", - TimeZoneRuleTable_102, 5 - }, - { - "Singapore Standard Time", -480, FALSE, "(UTC+08:00) Kuala Lumpur, Singapore", - "Malay Peninsula Standard Time", "Malay Peninsula Daylight Time", - NULL, 0 - }, - { - "W. Australia Standard Time", -480, TRUE, "(UTC+08:00) Perth", - "W. Australia Standard Time", "W. Australia Daylight Time", - TimeZoneRuleTable_104, 4 - }, - { - "Taipei Standard Time", -480, FALSE, "(UTC+08:00) Taipei", - "Taipei Standard Time", "Taipei Daylight Time", - NULL, 0 - }, - { - "Ulaanbaatar Standard Time", -480, TRUE, "(UTC+08:00) Ulaanbaatar", - "Ulaanbaatar Standard Time", "Ulaanbaatar Daylight Time", - TimeZoneRuleTable_106, 2 - }, - { - "Aus Central W. Standard Time", -525, FALSE, "(UTC+08:45) Eucla", - "Aus Central W. Standard Time", "Aus Central W. Daylight Time", - NULL, 0 - }, - { - "Transbaikal Standard Time", -540, TRUE, "(UTC+09:00) Chita", - "Transbaikal Standard Time", "Transbaikal Daylight Time", - TimeZoneRuleTable_108, 7 - }, - { - "Tokyo Standard Time", -540, FALSE, "(UTC+09:00) Osaka, Sapporo, Tokyo", - "Tokyo Standard Time", "Tokyo Daylight Time", - NULL, 0 - }, - { - "North Korea Standard Time", -540, TRUE, "(UTC+09:00) Pyongyang", - "North Korea Standard Time", "North Korea Daylight Time", - TimeZoneRuleTable_110, 4 - }, - { - "Korea Standard Time", -540, FALSE, "(UTC+09:00) Seoul", - "Korea Standard Time", "Korea Daylight Time", - NULL, 0 - }, - { - "Yakutsk Standard Time", -540, TRUE, "(UTC+09:00) Yakutsk", - "Russia TZ 8 Standard Time", "Russia TZ 8 Daylight Time", - TimeZoneRuleTable_112, 5 - }, - { - "Cen. Australia Standard Time", -570, TRUE, "(UTC+09:30) Adelaide", - "Cen. Australia Standard Time", "Cen. Australia Daylight Time", - TimeZoneRuleTable_113, 2 - }, - { - "AUS Central Standard Time", -570, FALSE, "(UTC+09:30) Darwin", - "AUS Central Standard Time", "AUS Central Daylight Time", - NULL, 0 - }, - { - "E. Australia Standard Time", -600, FALSE, "(UTC+10:00) Brisbane", - "E. Australia Standard Time", "E. Australia Daylight Time", - NULL, 0 - }, - { - "AUS Eastern Standard Time", -600, TRUE, "(UTC+10:00) Canberra, Melbourne, Sydney", - "AUS Eastern Standard Time", "AUS Eastern Daylight Time", - TimeZoneRuleTable_116, 2 - }, - { - "West Pacific Standard Time", -600, FALSE, "(UTC+10:00) Guam, Port Moresby", - "West Pacific Standard Time", "West Pacific Daylight Time", - NULL, 0 - }, - { - "Tasmania Standard Time", -600, TRUE, "(UTC+10:00) Hobart", - "Tasmania Standard Time", "Tasmania Daylight Time", - TimeZoneRuleTable_118, 2 - }, - { - "Vladivostok Standard Time", -600, TRUE, "(UTC+10:00) Vladivostok", - "Russia TZ 9 Standard Time", "Russia TZ 9 Daylight Time", - TimeZoneRuleTable_119, 5 - }, - { - "Lord Howe Standard Time", -630, TRUE, "(UTC+10:30) Lord Howe Island", - "Lord Howe Standard Time", "Lord Howe Daylight Time", - TimeZoneRuleTable_120, 4 - }, - { - "Bougainville Standard Time", -660, TRUE, "(UTC+11:00) Bougainville Island", - "Bougainville Standard Time", "Bougainville Daylight Time", - TimeZoneRuleTable_121, 2 - }, - { - "Russia Time Zone 10", -660, TRUE, "(UTC+11:00) Chokurdakh", - "Russia TZ 10 Standard Time", "Russia TZ 10 Daylight Time", - TimeZoneRuleTable_122, 5 - }, - { - "Magadan Standard Time", -660, TRUE, "(UTC+11:00) Magadan", - "Magadan Standard Time", "Magadan Daylight Time", - TimeZoneRuleTable_123, 7 - }, - { - "Norfolk Standard Time", -660, TRUE, "(UTC+11:00) Norfolk Island", - "Norfolk Standard Time", "Norfolk Daylight Time", - TimeZoneRuleTable_124, 2 - }, - { - "Sakhalin Standard Time", -660, TRUE, "(UTC+11:00) Sakhalin", - "Sakhalin Standard Time", "Sakhalin Daylight Time", - TimeZoneRuleTable_125, 5 - }, - { - "Central Pacific Standard Time", -660, FALSE, "(UTC+11:00) Solomon Is., New Caledonia", - "Central Pacific Standard Time", "Central Pacific Daylight Time", - NULL, 0 - }, - { - "Russia Time Zone 11", -720, TRUE, "(UTC+12:00) Anadyr, Petropavlovsk-Kamchatsky", - "Russia TZ 11 Standard Time", "Russia TZ 11 Daylight Time", - TimeZoneRuleTable_127, 3 - }, - { - "New Zealand Standard Time", -720, TRUE, "(UTC+12:00) Auckland, Wellington", - "New Zealand Standard Time", "New Zealand Daylight Time", - TimeZoneRuleTable_128, 3 - }, - { - "UTC+12", -720, FALSE, "(UTC+12:00) Coordinated Universal Time+12", - "UTC+12", "UTC+12", - NULL, 0 - }, - { - "Fiji Standard Time", -720, TRUE, "(UTC+12:00) Fiji", - "Fiji Standard Time", "Fiji Daylight Time", - TimeZoneRuleTable_130, 11 - }, - { - "Kamchatka Standard Time", -720, TRUE, "(UTC+12:00) Petropavlovsk-Kamchatsky - Old", - "Kamchatka Standard Time", "Kamchatka Daylight Time", - TimeZoneRuleTable_131, 1 - }, - { - "Chatham Islands Standard Time", -765, TRUE, "(UTC+12:45) Chatham Islands", - "Chatham Islands Standard Time", "Chatham Islands Daylight Time", - TimeZoneRuleTable_132, 3 - }, - { - "UTC+13", -780, FALSE, "(UTC+13:00) Coordinated Universal Time+13", - "UTC+13", "UTC+13", - NULL, 0 - }, - { - "Tonga Standard Time", -780, TRUE, "(UTC+13:00) Nuku'alofa", - "Tonga Standard Time", "Tonga Daylight Time", - TimeZoneRuleTable_134, 2 - }, - { - "Samoa Standard Time", -780, TRUE, "(UTC+13:00) Samoa", - "Samoa Standard Time", "Samoa Daylight Time", - TimeZoneRuleTable_135, 4 - }, - { - "Line Islands Standard Time", -840, FALSE, "(UTC+14:00) Kiritimati Island", - "Line Islands Standard Time", "Line Islands Daylight Time", - NULL, 0 - } -}; - diff --git a/winpr/libwinpr/timezone/WindowsZones.c b/winpr/libwinpr/timezone/WindowsZones.c index cf08bbad9..6b7843160 100644 --- a/winpr/libwinpr/timezone/WindowsZones.c +++ b/winpr/libwinpr/timezone/WindowsZones.c @@ -9,10 +9,10 @@ struct _WINDOWS_TZID_ENTRY }; typedef struct _WINDOWS_TZID_ENTRY WINDOWS_TZID_ENTRY; -const WINDOWS_TZID_ENTRY WindowsTimeZoneIdTable[] = -{ +const WINDOWS_TZID_ENTRY WindowsTimeZoneIdTable[] = { { "Afghanistan Standard Time", "Asia/Kabul" }, - { "Alaskan Standard Time", "America/Anchorage America/Juneau America/Metlakatla America/Nome America/Sitka America/Yakutat" }, + { "Alaskan Standard Time", "America/Anchorage America/Juneau America/Metlakatla America/Nome " + "America/Sitka America/Yakutat" }, { "Alaskan Standard Time", "America/Anchorage" }, { "Aleutian Standard Time", "America/Adak" }, { "Altai Standard Time", "Asia/Barnaul" }, @@ -25,11 +25,16 @@ const WINDOWS_TZID_ENTRY WindowsTimeZoneIdTable[] = { "Arabian Standard Time", "Asia/Muscat" }, { "Arabian Standard Time", "Etc/GMT-4" }, { "Arabic Standard Time", "Asia/Baghdad" }, - { "Argentina Standard Time", "America/Buenos_Aires America/Argentina/La_Rioja America/Argentina/Rio_Gallegos America/Argentina/Salta America/Argentina/San_Juan America/Argentina/San_Luis America/Argentina/Tucuman America/Argentina/Ushuaia America/Catamarca America/Cordoba America/Jujuy America/Mendoza" }, + { "Argentina Standard Time", + "America/Buenos_Aires America/Argentina/La_Rioja America/Argentina/Rio_Gallegos " + "America/Argentina/Salta America/Argentina/San_Juan America/Argentina/San_Luis " + "America/Argentina/Tucuman America/Argentina/Ushuaia America/Catamarca America/Cordoba " + "America/Jujuy America/Mendoza" }, { "Argentina Standard Time", "America/Buenos_Aires" }, { "Astrakhan Standard Time", "Europe/Astrakhan Europe/Ulyanovsk" }, { "Astrakhan Standard Time", "Europe/Astrakhan" }, - { "Atlantic Standard Time", "America/Halifax America/Glace_Bay America/Goose_Bay America/Moncton" }, + { "Atlantic Standard Time", + "America/Halifax America/Glace_Bay America/Goose_Bay America/Moncton" }, { "Atlantic Standard Time", "America/Halifax" }, { "Atlantic Standard Time", "America/Thule" }, { "Atlantic Standard Time", "Atlantic/Bermuda" }, @@ -86,12 +91,16 @@ const WINDOWS_TZID_ENTRY WindowsTimeZoneIdTable[] = { "Central Pacific Standard Time", "Pacific/Guadalcanal" }, { "Central Pacific Standard Time", "Pacific/Noumea" }, { "Central Pacific Standard Time", "Pacific/Ponape Pacific/Kosrae" }, - { "Central Standard Time (Mexico)", "America/Mexico_City America/Bahia_Banderas America/Merida America/Monterrey" }, + { "Central Standard Time (Mexico)", + "America/Mexico_City America/Bahia_Banderas America/Merida America/Monterrey" }, { "Central Standard Time (Mexico)", "America/Mexico_City" }, - { "Central Standard Time", "America/Chicago America/Indiana/Knox America/Indiana/Tell_City America/Menominee America/North_Dakota/Beulah America/North_Dakota/Center America/North_Dakota/New_Salem" }, + { "Central Standard Time", + "America/Chicago America/Indiana/Knox America/Indiana/Tell_City America/Menominee " + "America/North_Dakota/Beulah America/North_Dakota/Center America/North_Dakota/New_Salem" }, { "Central Standard Time", "America/Chicago" }, { "Central Standard Time", "America/Matamoros" }, - { "Central Standard Time", "America/Winnipeg America/Rainy_River America/Rankin_Inlet America/Resolute" }, + { "Central Standard Time", + "America/Winnipeg America/Rainy_River America/Rankin_Inlet America/Resolute" }, { "Central Standard Time", "CST6CDT" }, { "Chatham Islands Standard Time", "Pacific/Chatham" }, { "China Standard Time", "Asia/Hong_Kong" }, @@ -119,9 +128,12 @@ const WINDOWS_TZID_ENTRY WindowsTimeZoneIdTable[] = { "Easter Island Standard Time", "Pacific/Easter" }, { "Eastern Standard Time (Mexico)", "America/Cancun" }, { "Eastern Standard Time", "America/Nassau" }, - { "Eastern Standard Time", "America/New_York America/Detroit America/Indiana/Petersburg America/Indiana/Vincennes America/Indiana/Winamac America/Kentucky/Monticello America/Louisville" }, + { "Eastern Standard Time", + "America/New_York America/Detroit America/Indiana/Petersburg America/Indiana/Vincennes " + "America/Indiana/Winamac America/Kentucky/Monticello America/Louisville" }, { "Eastern Standard Time", "America/New_York" }, - { "Eastern Standard Time", "America/Toronto America/Iqaluit America/Montreal America/Nipigon America/Pangnirtung America/Thunder_Bay" }, + { "Eastern Standard Time", "America/Toronto America/Iqaluit America/Montreal America/Nipigon " + "America/Pangnirtung America/Thunder_Bay" }, { "Eastern Standard Time", "EST5EDT" }, { "Egypt Standard Time", "Africa/Cairo" }, { "Ekaterinburg Standard Time", "Asia/Yekaterinburg" }, @@ -192,7 +204,8 @@ const WINDOWS_TZID_ENTRY WindowsTimeZoneIdTable[] = { "Mountain Standard Time (Mexico)", "America/Chihuahua" }, { "Mountain Standard Time", "America/Denver America/Boise" }, { "Mountain Standard Time", "America/Denver" }, - { "Mountain Standard Time", "America/Edmonton America/Cambridge_Bay America/Inuvik America/Yellowknife" }, + { "Mountain Standard Time", + "America/Edmonton America/Cambridge_Bay America/Inuvik America/Yellowknife" }, { "Mountain Standard Time", "America/Ojinaga" }, { "Mountain Standard Time", "MST7MDT" }, { "Myanmar Standard Time", "Asia/Rangoon" }, @@ -229,7 +242,8 @@ const WINDOWS_TZID_ENTRY WindowsTimeZoneIdTable[] = { "Russian Standard Time", "Europe/Moscow" }, { "Russian Standard Time", "Europe/Simferopol" }, { "SA Eastern Standard Time", "America/Cayenne" }, - { "SA Eastern Standard Time", "America/Fortaleza America/Belem America/Maceio America/Recife America/Santarem" }, + { "SA Eastern Standard Time", + "America/Fortaleza America/Belem America/Maceio America/Recife America/Santarem" }, { "SA Eastern Standard Time", "America/Paramaribo" }, { "SA Eastern Standard Time", "Antarctica/Rothera" }, { "SA Eastern Standard Time", "Atlantic/Stanley" }, @@ -320,7 +334,8 @@ const WINDOWS_TZID_ENTRY WindowsTimeZoneIdTable[] = { "Turks And Caicos Standard Time", "America/Grand_Turk" }, { "Ulaanbaatar Standard Time", "Asia/Ulaanbaatar Asia/Choibalsan" }, { "Ulaanbaatar Standard Time", "Asia/Ulaanbaatar" }, - { "US Eastern Standard Time", "America/Indianapolis America/Indiana/Marengo America/Indiana/Vevay" }, + { "US Eastern Standard Time", + "America/Indianapolis America/Indiana/Marengo America/Indiana/Vevay" }, { "US Eastern Standard Time", "America/Indianapolis" }, { "US Mountain Standard Time", "America/Dawson_Creek America/Creston America/Fort_Nelson" }, { "US Mountain Standard Time", "America/Hermosillo" }, diff --git a/winpr/libwinpr/timezone/timezone.c b/winpr/libwinpr/timezone/timezone.c index 5a79a5246..8a07c795a 100644 --- a/winpr/libwinpr/timezone/timezone.c +++ b/winpr/libwinpr/timezone/timezone.c @@ -70,7 +70,7 @@ static char* winpr_read_unix_timezone_identifier_from_file(FILE* fp) if (length < 2) return NULL; - tzid = (char*) malloc((size_t)length + 1); + tzid = (char*)malloc((size_t)length + 1); if (!tzid) return NULL; @@ -91,11 +91,7 @@ static char* winpr_read_unix_timezone_identifier_from_file(FILE* fp) static char* winpr_get_timezone_from_link(void) { - const char* links[] = - { - "/etc/localtime", - "/etc/TZ" - }; + const char* links[] = { "/etc/localtime", "/etc/TZ" }; size_t x; ssize_t len; char buf[1024]; @@ -136,7 +132,7 @@ static char* winpr_get_timezone_from_link(void) return NULL; alloc = (size_t)len - (size_t)pos; - tzid = (char*) malloc(alloc + 1); + tzid = (char*)malloc(alloc + 1); if (!tzid) return NULL; @@ -179,8 +175,8 @@ static char* winpr_get_android_timezone_identifier(void) if (!jObjClass) goto fail; - jDefaultTimezone = (*jniEnv)->GetStaticMethodID(jniEnv, jObjClass, "getDefault", - "()Ljava/util/TimeZone;"); + jDefaultTimezone = + (*jniEnv)->GetStaticMethodID(jniEnv, jObjClass, "getDefault", "()Ljava/util/TimeZone;"); if (!jDefaultTimezone) goto fail; @@ -190,7 +186,8 @@ static char* winpr_get_android_timezone_identifier(void) if (!jObj) goto fail; - jTimezoneIdentifier = (*jniEnv)->GetMethodID(jniEnv, jObjClass, "getID", "()Ljava/lang/String;"); + jTimezoneIdentifier = + (*jniEnv)->GetMethodID(jniEnv, jObjClass, "getID", "()Ljava/lang/String;"); if (!jTimezoneIdentifier) goto fail; @@ -245,7 +242,7 @@ static char* winpr_get_unix_timezone_identifier_from_file(void) return NULL; tzid = winpr_read_unix_timezone_identifier_from_file(fp); - fclose(fp) ; + fclose(fp); return tzid; #endif } @@ -296,10 +293,11 @@ static TIME_ZONE_ENTRY* winpr_detect_windows_time_zone(void) if (strcmp(TimeZoneTable[i].Id, WindowsTimeZoneIdTable[j].windows) != 0) continue; - if (winpr_match_unix_timezone_identifier_with_list(tzid, WindowsTimeZoneIdTable[j].tzid)) + if (winpr_match_unix_timezone_identifier_with_list(tzid, + WindowsTimeZoneIdTable[j].tzid)) { free(tzid); - timezone = (TIME_ZONE_ENTRY*) malloc(sizeof(TIME_ZONE_ENTRY)); + timezone = (TIME_ZONE_ENTRY*)malloc(sizeof(TIME_ZONE_ENTRY)); if (!timezone) return NULL; @@ -310,13 +308,13 @@ static TIME_ZONE_ENTRY* winpr_detect_windows_time_zone(void) } } - WLog_ERR(TAG, "Unable to find a match for unix timezone: %s", tzid); + WLog_ERR(TAG, "Unable to find a match for unix timezone: %s", tzid); free(tzid); return NULL; } -static const TIME_ZONE_RULE_ENTRY* winpr_get_current_time_zone_rule(const TIME_ZONE_RULE_ENTRY* - rules, UINT32 count) +static const TIME_ZONE_RULE_ENTRY* +winpr_get_current_time_zone_rule(const TIME_ZONE_RULE_ENTRY* rules, UINT32 count) { UINT32 i; UINT64 windows_time; @@ -326,12 +324,13 @@ static const TIME_ZONE_RULE_ENTRY* winpr_get_current_time_zone_rule(const TIME_Z { if ((rules[i].TicksStart >= windows_time) && (windows_time >= rules[i].TicksEnd)) { - /*WLog_ERR(TAG, "Got rule %d from table at %p with count %"PRIu32"", i, (void*) rules, count);*/ + /*WLog_ERR(TAG, "Got rule %d from table at %p with count %"PRIu32"", i, (void*) rules, + * count);*/ return &rules[i]; } } - WLog_ERR(TAG, "Unable to get current timezone rule"); + WLog_ERR(TAG, "Unable to get current timezone rule"); return NULL; } @@ -362,8 +361,8 @@ DWORD GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation) if (dtz != NULL) { int status; - WLog_DBG(TAG, "tz: Bias=%"PRId32" sn='%s' dln='%s'", - dtz->Bias, dtz->StandardName, dtz->DaylightName); + WLog_DBG(TAG, "tz: Bias=%" PRId32 " sn='%s' dln='%s'", dtz->Bias, dtz->StandardName, + dtz->DaylightName); tz->Bias = dtz->Bias; tz->StandardBias = 0; tz->DaylightBias = 0; @@ -389,8 +388,8 @@ DWORD GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation) if ((dtz->SupportsDST) && (dtz->RuleTableCount > 0)) { - const TIME_ZONE_RULE_ENTRY* rule = winpr_get_current_time_zone_rule(dtz->RuleTable, - dtz->RuleTableCount); + const TIME_ZONE_RULE_ENTRY* rule = + winpr_get_current_time_zone_rule(dtz->RuleTable, dtz->RuleTableCount); if (rule != NULL) { @@ -407,7 +406,7 @@ DWORD GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation) } /* could not detect timezone, use computed bias from tm_gmtoff */ - WLog_DBG(TAG, "tz not found, using computed bias %"PRId32".", tz->Bias); + WLog_DBG(TAG, "tz not found, using computed bias %" PRId32 ".", tz->Bias); out_error: free(dtz); memcpy(tz->StandardName, L"Client Local Time", sizeof(tz->StandardName)); @@ -459,7 +458,9 @@ BOOL TzSpecificLocalTimeToSystemTime(LPTIME_ZONE_INFORMATION lpTimeZoneInformati * GetDynamicTimeZoneInformation is provided by the SDK if _WIN32_WINNT >= 0x0600 in SDKs above 7.1A * and incorrectly if _WIN32_WINNT >= 0x0501 in older SDKs */ -#if !defined(_WIN32) || (defined(_WIN32) && (defined(NTDDI_WIN8) && _WIN32_WINNT < 0x0600 || !defined(NTDDI_WIN8) && _WIN32_WINNT < 0x0501)) /* Windows Vista */ +#if !defined(_WIN32) || \ + (defined(_WIN32) && (defined(NTDDI_WIN8) && _WIN32_WINNT < 0x0600 || \ + !defined(NTDDI_WIN8) && _WIN32_WINNT < 0x0501)) /* Windows Vista */ DWORD GetDynamicTimeZoneInformation(PDYNAMIC_TIME_ZONE_INFORMATION pTimeZoneInformation) { @@ -516,9 +517,8 @@ DWORD EnumDynamicTimeZoneInformation(const DWORD dwIndex, return 0; } -DWORD GetDynamicTimeZoneInformationEffectiveYears(const PDYNAMIC_TIME_ZONE_INFORMATION - lpTimeZoneInformation, - LPDWORD FirstYear, LPDWORD LastYear) +DWORD GetDynamicTimeZoneInformationEffectiveYears( + const PDYNAMIC_TIME_ZONE_INFORMATION lpTimeZoneInformation, LPDWORD FirstYear, LPDWORD LastYear) { WINPR_UNUSED(lpTimeZoneInformation); WINPR_UNUSED(FirstYear); diff --git a/winpr/libwinpr/utils/cmdline.c b/winpr/libwinpr/utils/cmdline.c index ec43b74dc..a6b36336c 100644 --- a/winpr/libwinpr/utils/cmdline.c +++ b/winpr/libwinpr/utils/cmdline.c @@ -55,9 +55,9 @@ static void log_error(DWORD flags, LPCSTR message, int index, LPCSTR argv) WLog_ERR(TAG, message, index, argv); } -int CommandLineParseArgumentsA(int argc, LPSTR* argv, COMMAND_LINE_ARGUMENT_A* options, - DWORD flags, - void* context, COMMAND_LINE_PRE_FILTER_FN_A preFilter, COMMAND_LINE_POST_FILTER_FN_A postFilter) +int CommandLineParseArgumentsA(int argc, LPSTR* argv, COMMAND_LINE_ARGUMENT_A* options, DWORD flags, + void* context, COMMAND_LINE_PRE_FILTER_FN_A preFilter, + COMMAND_LINE_POST_FILTER_FN_A postFilter) { int i, j; int status; @@ -99,7 +99,8 @@ int CommandLineParseArgumentsA(int argc, LPSTR* argv, COMMAND_LINE_ARGUMENT_A* o if (count < 0) { - log_error(flags, "Failed for index %d [%s]: PreFilter rule could not be applied", i, argv[i]); + log_error(flags, "Failed for index %d [%s]: PreFilter rule could not be applied", i, + argv[i]); status = COMMAND_LINE_ERROR; return status; } @@ -324,7 +325,7 @@ int CommandLineParseArgumentsA(int argc, LPSTR* argv, COMMAND_LINE_ARGUMENT_A* o { if (options[j].Flags & COMMAND_LINE_VALUE_FLAG) { - options[j].Value = (LPSTR) 1; + options[j].Value = (LPSTR)1; options[j].Flags |= COMMAND_LINE_VALUE_PRESENT; } else if (options[j].Flags & COMMAND_LINE_VALUE_BOOL) @@ -358,7 +359,9 @@ int CommandLineParseArgumentsA(int argc, LPSTR* argv, COMMAND_LINE_ARGUMENT_A* o if (count < 0) { - log_error(flags, "Failed at index %d [%s]: PostFilter rule could not be applied", i, argv[i]); + log_error(flags, + "Failed at index %d [%s]: PostFilter rule could not be applied", + i, argv[i]); status = COMMAND_LINE_ERROR; return status; } @@ -386,8 +389,8 @@ int CommandLineParseArgumentsA(int argc, LPSTR* argv, COMMAND_LINE_ARGUMENT_A* o } int CommandLineParseArgumentsW(int argc, LPWSTR* argv, COMMAND_LINE_ARGUMENT_W* options, - DWORD flags, - void* context, COMMAND_LINE_PRE_FILTER_FN_W preFilter, COMMAND_LINE_POST_FILTER_FN_W postFilter) + DWORD flags, void* context, COMMAND_LINE_PRE_FILTER_FN_W preFilter, + COMMAND_LINE_POST_FILTER_FN_W postFilter) { return 0; } diff --git a/winpr/libwinpr/utils/collections/ArrayList.c b/winpr/libwinpr/utils/collections/ArrayList.c index 6260550b1..64dca5384 100644 --- a/winpr/libwinpr/utils/collections/ArrayList.c +++ b/winpr/libwinpr/utils/collections/ArrayList.c @@ -58,7 +58,7 @@ int ArrayList_Count(wArrayList* arrayList) int ArrayList_Items(wArrayList* arrayList, ULONG_PTR** ppItems) { - *ppItems = (ULONG_PTR*) arrayList->array; + *ppItems = (ULONG_PTR*)arrayList->array; return arrayList->size; } @@ -169,7 +169,8 @@ BOOL ArrayList_Shift(wArrayList* arrayList, int index, int count) int chunk = arrayList->size - index + count; if (chunk > 0) - MoveMemory(&arrayList->array[index], &arrayList->array[index - count], chunk * sizeof(void*)); + MoveMemory(&arrayList->array[index], &arrayList->array[index - count], + chunk * sizeof(void*)); arrayList->size += count; } @@ -353,13 +354,16 @@ BOOL ArrayList_RemoveAt(wArrayList* arrayList, int index) } /** - * Searches for the specified Object and returns the zero-based index of the first occurrence within the entire ArrayList. + * Searches for the specified Object and returns the zero-based index of the first occurrence within + * the entire ArrayList. * - * Searches for the specified Object and returns the zero-based index of the last occurrence within the range of elements - * in the ArrayList that extends from the first element to the specified index. + * Searches for the specified Object and returns the zero-based index of the last occurrence within + * the range of elements in the ArrayList that extends from the first element to the specified + * index. * - * Searches for the specified Object and returns the zero-based index of the last occurrence within the range of elements - * in the ArrayList that contains the specified number of elements and ends at the specified index. + * Searches for the specified Object and returns the zero-based index of the last occurrence within + * the range of elements in the ArrayList that contains the specified number of elements and ends at + * the specified index. */ int ArrayList_IndexOf(wArrayList* arrayList, void* obj, int startIndex, int count) @@ -395,13 +399,16 @@ int ArrayList_IndexOf(wArrayList* arrayList, void* obj, int startIndex, int coun } /** - * Searches for the specified Object and returns the zero-based index of the last occurrence within the entire ArrayList. + * Searches for the specified Object and returns the zero-based index of the last occurrence within + * the entire ArrayList. * - * Searches for the specified Object and returns the zero-based index of the last occurrence within the range of elements - * in the ArrayList that extends from the first element to the specified index. + * Searches for the specified Object and returns the zero-based index of the last occurrence within + * the range of elements in the ArrayList that extends from the first element to the specified + * index. * - * Searches for the specified Object and returns the zero-based index of the last occurrence within the range of elements - * in the ArrayList that contains the specified number of elements and ends at the specified index. + * Searches for the specified Object and returns the zero-based index of the last occurrence within + * the range of elements in the ArrayList that contains the specified number of elements and ends at + * the specified index. */ int ArrayList_LastIndexOf(wArrayList* arrayList, void* obj, int startIndex, int count) diff --git a/winpr/libwinpr/utils/collections/BipBuffer.c b/winpr/libwinpr/utils/collections/BipBuffer.c index 5a6f00597..bf679ef46 100644 --- a/winpr/libwinpr/utils/collections/BipBuffer.c +++ b/winpr/libwinpr/utils/collections/BipBuffer.c @@ -32,11 +32,10 @@ * http://www.codeproject.com/Articles/3479/The-Bip-Buffer-The-Circular-Buffer-with-a-Twist */ -#define BipBlock_Clear(_bbl) \ - _bbl.index = _bbl.size = 0 +#define BipBlock_Clear(_bbl) _bbl.index = _bbl.size = 0 #define BipBlock_Copy(_dst, _src) \ - _dst.index = _src.index; \ + _dst.index = _src.index; \ _dst.size = _src.size void BipBuffer_Clear(wBipBuffer* bb) @@ -53,7 +52,7 @@ BOOL BipBuffer_AllocBuffer(wBipBuffer* bb, size_t size) return FALSE; size += size % bb->pageSize; - bb->buffer = (BYTE*) malloc(size); + bb->buffer = (BYTE*)malloc(size); if (!bb->buffer) return FALSE; @@ -73,7 +72,7 @@ BOOL BipBuffer_Grow(wBipBuffer* bb, size_t size) if (size <= bb->size) return TRUE; - buffer = (BYTE*) malloc(size); + buffer = (BYTE*)malloc(size); if (!buffer) return FALSE; @@ -403,13 +402,13 @@ SSIZE_T BipBuffer_Read(wBipBuffer* bb, BYTE* data, size_t size) wBipBuffer* BipBuffer_New(size_t size) { wBipBuffer* bb; - bb = (wBipBuffer*) calloc(1, sizeof(wBipBuffer)); + bb = (wBipBuffer*)calloc(1, sizeof(wBipBuffer)); if (bb) { SYSTEM_INFO si; GetSystemInfo(&si); - bb->pageSize = (size_t) si.dwPageSize; + bb->pageSize = (size_t)si.dwPageSize; if (bb->pageSize < 4096) bb->pageSize = 4096; diff --git a/winpr/libwinpr/utils/collections/BitStream.c b/winpr/libwinpr/utils/collections/BitStream.c index 1bd897169..f5a24a69c 100644 --- a/winpr/libwinpr/utils/collections/BitStream.c +++ b/winpr/libwinpr/utils/collections/BitStream.c @@ -25,140 +25,74 @@ #include #include "../trio/trio.h" -const char* BYTE_BIT_STRINGS_LSB[256] = -{ - "00000000", "00000001", "00000010", "00000011", - "00000100", "00000101", "00000110", "00000111", - "00001000", "00001001", "00001010", "00001011", - "00001100", "00001101", "00001110", "00001111", - "00010000", "00010001", "00010010", "00010011", - "00010100", "00010101", "00010110", "00010111", - "00011000", "00011001", "00011010", "00011011", - "00011100", "00011101", "00011110", "00011111", - "00100000", "00100001", "00100010", "00100011", - "00100100", "00100101", "00100110", "00100111", - "00101000", "00101001", "00101010", "00101011", - "00101100", "00101101", "00101110", "00101111", - "00110000", "00110001", "00110010", "00110011", - "00110100", "00110101", "00110110", "00110111", - "00111000", "00111001", "00111010", "00111011", - "00111100", "00111101", "00111110", "00111111", - "01000000", "01000001", "01000010", "01000011", - "01000100", "01000101", "01000110", "01000111", - "01001000", "01001001", "01001010", "01001011", - "01001100", "01001101", "01001110", "01001111", - "01010000", "01010001", "01010010", "01010011", - "01010100", "01010101", "01010110", "01010111", - "01011000", "01011001", "01011010", "01011011", - "01011100", "01011101", "01011110", "01011111", - "01100000", "01100001", "01100010", "01100011", - "01100100", "01100101", "01100110", "01100111", - "01101000", "01101001", "01101010", "01101011", - "01101100", "01101101", "01101110", "01101111", - "01110000", "01110001", "01110010", "01110011", - "01110100", "01110101", "01110110", "01110111", - "01111000", "01111001", "01111010", "01111011", - "01111100", "01111101", "01111110", "01111111", - "10000000", "10000001", "10000010", "10000011", - "10000100", "10000101", "10000110", "10000111", - "10001000", "10001001", "10001010", "10001011", - "10001100", "10001101", "10001110", "10001111", - "10010000", "10010001", "10010010", "10010011", - "10010100", "10010101", "10010110", "10010111", - "10011000", "10011001", "10011010", "10011011", - "10011100", "10011101", "10011110", "10011111", - "10100000", "10100001", "10100010", "10100011", - "10100100", "10100101", "10100110", "10100111", - "10101000", "10101001", "10101010", "10101011", - "10101100", "10101101", "10101110", "10101111", - "10110000", "10110001", "10110010", "10110011", - "10110100", "10110101", "10110110", "10110111", - "10111000", "10111001", "10111010", "10111011", - "10111100", "10111101", "10111110", "10111111", - "11000000", "11000001", "11000010", "11000011", - "11000100", "11000101", "11000110", "11000111", - "11001000", "11001001", "11001010", "11001011", - "11001100", "11001101", "11001110", "11001111", - "11010000", "11010001", "11010010", "11010011", - "11010100", "11010101", "11010110", "11010111", - "11011000", "11011001", "11011010", "11011011", - "11011100", "11011101", "11011110", "11011111", - "11100000", "11100001", "11100010", "11100011", - "11100100", "11100101", "11100110", "11100111", - "11101000", "11101001", "11101010", "11101011", - "11101100", "11101101", "11101110", "11101111", - "11110000", "11110001", "11110010", "11110011", - "11110100", "11110101", "11110110", "11110111", - "11111000", "11111001", "11111010", "11111011", - "11111100", "11111101", "11111110", "11111111" +const char* BYTE_BIT_STRINGS_LSB[256] = { + "00000000", "00000001", "00000010", "00000011", "00000100", "00000101", "00000110", "00000111", + "00001000", "00001001", "00001010", "00001011", "00001100", "00001101", "00001110", "00001111", + "00010000", "00010001", "00010010", "00010011", "00010100", "00010101", "00010110", "00010111", + "00011000", "00011001", "00011010", "00011011", "00011100", "00011101", "00011110", "00011111", + "00100000", "00100001", "00100010", "00100011", "00100100", "00100101", "00100110", "00100111", + "00101000", "00101001", "00101010", "00101011", "00101100", "00101101", "00101110", "00101111", + "00110000", "00110001", "00110010", "00110011", "00110100", "00110101", "00110110", "00110111", + "00111000", "00111001", "00111010", "00111011", "00111100", "00111101", "00111110", "00111111", + "01000000", "01000001", "01000010", "01000011", "01000100", "01000101", "01000110", "01000111", + "01001000", "01001001", "01001010", "01001011", "01001100", "01001101", "01001110", "01001111", + "01010000", "01010001", "01010010", "01010011", "01010100", "01010101", "01010110", "01010111", + "01011000", "01011001", "01011010", "01011011", "01011100", "01011101", "01011110", "01011111", + "01100000", "01100001", "01100010", "01100011", "01100100", "01100101", "01100110", "01100111", + "01101000", "01101001", "01101010", "01101011", "01101100", "01101101", "01101110", "01101111", + "01110000", "01110001", "01110010", "01110011", "01110100", "01110101", "01110110", "01110111", + "01111000", "01111001", "01111010", "01111011", "01111100", "01111101", "01111110", "01111111", + "10000000", "10000001", "10000010", "10000011", "10000100", "10000101", "10000110", "10000111", + "10001000", "10001001", "10001010", "10001011", "10001100", "10001101", "10001110", "10001111", + "10010000", "10010001", "10010010", "10010011", "10010100", "10010101", "10010110", "10010111", + "10011000", "10011001", "10011010", "10011011", "10011100", "10011101", "10011110", "10011111", + "10100000", "10100001", "10100010", "10100011", "10100100", "10100101", "10100110", "10100111", + "10101000", "10101001", "10101010", "10101011", "10101100", "10101101", "10101110", "10101111", + "10110000", "10110001", "10110010", "10110011", "10110100", "10110101", "10110110", "10110111", + "10111000", "10111001", "10111010", "10111011", "10111100", "10111101", "10111110", "10111111", + "11000000", "11000001", "11000010", "11000011", "11000100", "11000101", "11000110", "11000111", + "11001000", "11001001", "11001010", "11001011", "11001100", "11001101", "11001110", "11001111", + "11010000", "11010001", "11010010", "11010011", "11010100", "11010101", "11010110", "11010111", + "11011000", "11011001", "11011010", "11011011", "11011100", "11011101", "11011110", "11011111", + "11100000", "11100001", "11100010", "11100011", "11100100", "11100101", "11100110", "11100111", + "11101000", "11101001", "11101010", "11101011", "11101100", "11101101", "11101110", "11101111", + "11110000", "11110001", "11110010", "11110011", "11110100", "11110101", "11110110", "11110111", + "11111000", "11111001", "11111010", "11111011", "11111100", "11111101", "11111110", "11111111" }; -const char* BYTE_BIT_STRINGS_MSB[256] = -{ - "00000000", "10000000", "01000000", "11000000", - "00100000", "10100000", "01100000", "11100000", - "00010000", "10010000", "01010000", "11010000", - "00110000", "10110000", "01110000", "11110000", - "00001000", "10001000", "01001000", "11001000", - "00101000", "10101000", "01101000", "11101000", - "00011000", "10011000", "01011000", "11011000", - "00111000", "10111000", "01111000", "11111000", - "00000100", "10000100", "01000100", "11000100", - "00100100", "10100100", "01100100", "11100100", - "00010100", "10010100", "01010100", "11010100", - "00110100", "10110100", "01110100", "11110100", - "00001100", "10001100", "01001100", "11001100", - "00101100", "10101100", "01101100", "11101100", - "00011100", "10011100", "01011100", "11011100", - "00111100", "10111100", "01111100", "11111100", - "00000010", "10000010", "01000010", "11000010", - "00100010", "10100010", "01100010", "11100010", - "00010010", "10010010", "01010010", "11010010", - "00110010", "10110010", "01110010", "11110010", - "00001010", "10001010", "01001010", "11001010", - "00101010", "10101010", "01101010", "11101010", - "00011010", "10011010", "01011010", "11011010", - "00111010", "10111010", "01111010", "11111010", - "00000110", "10000110", "01000110", "11000110", - "00100110", "10100110", "01100110", "11100110", - "00010110", "10010110", "01010110", "11010110", - "00110110", "10110110", "01110110", "11110110", - "00001110", "10001110", "01001110", "11001110", - "00101110", "10101110", "01101110", "11101110", - "00011110", "10011110", "01011110", "11011110", - "00111110", "10111110", "01111110", "11111110", - "00000001", "10000001", "01000001", "11000001", - "00100001", "10100001", "01100001", "11100001", - "00010001", "10010001", "01010001", "11010001", - "00110001", "10110001", "01110001", "11110001", - "00001001", "10001001", "01001001", "11001001", - "00101001", "10101001", "01101001", "11101001", - "00011001", "10011001", "01011001", "11011001", - "00111001", "10111001", "01111001", "11111001", - "00000101", "10000101", "01000101", "11000101", - "00100101", "10100101", "01100101", "11100101", - "00010101", "10010101", "01010101", "11010101", - "00110101", "10110101", "01110101", "11110101", - "00001101", "10001101", "01001101", "11001101", - "00101101", "10101101", "01101101", "11101101", - "00011101", "10011101", "01011101", "11011101", - "00111101", "10111101", "01111101", "11111101", - "00000011", "10000011", "01000011", "11000011", - "00100011", "10100011", "01100011", "11100011", - "00010011", "10010011", "01010011", "11010011", - "00110011", "10110011", "01110011", "11110011", - "00001011", "10001011", "01001011", "11001011", - "00101011", "10101011", "01101011", "11101011", - "00011011", "10011011", "01011011", "11011011", - "00111011", "10111011", "01111011", "11111011", - "00000111", "10000111", "01000111", "11000111", - "00100111", "10100111", "01100111", "11100111", - "00010111", "10010111", "01010111", "11010111", - "00110111", "10110111", "01110111", "11110111", - "00001111", "10001111", "01001111", "11001111", - "00101111", "10101111", "01101111", "11101111", - "00011111", "10011111", "01011111", "11011111", - "00111111", "10111111", "01111111", "11111111" +const char* BYTE_BIT_STRINGS_MSB[256] = { + "00000000", "10000000", "01000000", "11000000", "00100000", "10100000", "01100000", "11100000", + "00010000", "10010000", "01010000", "11010000", "00110000", "10110000", "01110000", "11110000", + "00001000", "10001000", "01001000", "11001000", "00101000", "10101000", "01101000", "11101000", + "00011000", "10011000", "01011000", "11011000", "00111000", "10111000", "01111000", "11111000", + "00000100", "10000100", "01000100", "11000100", "00100100", "10100100", "01100100", "11100100", + "00010100", "10010100", "01010100", "11010100", "00110100", "10110100", "01110100", "11110100", + "00001100", "10001100", "01001100", "11001100", "00101100", "10101100", "01101100", "11101100", + "00011100", "10011100", "01011100", "11011100", "00111100", "10111100", "01111100", "11111100", + "00000010", "10000010", "01000010", "11000010", "00100010", "10100010", "01100010", "11100010", + "00010010", "10010010", "01010010", "11010010", "00110010", "10110010", "01110010", "11110010", + "00001010", "10001010", "01001010", "11001010", "00101010", "10101010", "01101010", "11101010", + "00011010", "10011010", "01011010", "11011010", "00111010", "10111010", "01111010", "11111010", + "00000110", "10000110", "01000110", "11000110", "00100110", "10100110", "01100110", "11100110", + "00010110", "10010110", "01010110", "11010110", "00110110", "10110110", "01110110", "11110110", + "00001110", "10001110", "01001110", "11001110", "00101110", "10101110", "01101110", "11101110", + "00011110", "10011110", "01011110", "11011110", "00111110", "10111110", "01111110", "11111110", + "00000001", "10000001", "01000001", "11000001", "00100001", "10100001", "01100001", "11100001", + "00010001", "10010001", "01010001", "11010001", "00110001", "10110001", "01110001", "11110001", + "00001001", "10001001", "01001001", "11001001", "00101001", "10101001", "01101001", "11101001", + "00011001", "10011001", "01011001", "11011001", "00111001", "10111001", "01111001", "11111001", + "00000101", "10000101", "01000101", "11000101", "00100101", "10100101", "01100101", "11100101", + "00010101", "10010101", "01010101", "11010101", "00110101", "10110101", "01110101", "11110101", + "00001101", "10001101", "01001101", "11001101", "00101101", "10101101", "01101101", "11101101", + "00011101", "10011101", "01011101", "11011101", "00111101", "10111101", "01111101", "11111101", + "00000011", "10000011", "01000011", "11000011", "00100011", "10100011", "01100011", "11100011", + "00010011", "10010011", "01010011", "11010011", "00110011", "10110011", "01110011", "11110011", + "00001011", "10001011", "01001011", "11001011", "00101011", "10101011", "01101011", "11101011", + "00011011", "10011011", "01011011", "11011011", "00111011", "10111011", "01111011", "11111011", + "00000111", "10000111", "01000111", "11000111", "00100111", "10100111", "01100111", "11100111", + "00010111", "10010111", "01010111", "11010111", "00110111", "10110111", "01110111", "11110111", + "00001111", "10001111", "01001111", "11001111", "00101111", "10101111", "01101111", "11101111", + "00011111", "10011111", "01011111", "11011111", "00111111", "10111111", "01111111", "11111111" }; void BitDump(const char* tag, UINT32 level, const BYTE* buffer, UINT32 length, UINT32 flags) @@ -197,8 +131,7 @@ UINT32 ReverseBits32(UINT32 bits, UINT32 nbits) rbits = (rbits | (bits & 1)) << 1; bits >>= 1; nbits--; - } - while (nbits > 0); + } while (nbits > 0); rbits >>= 1; return rbits; @@ -333,7 +266,7 @@ void BitStream_Attach(wBitStream* bs, const BYTE* buffer, UINT32 capacity) bs->buffer = buffer; bs->offset = 0; bs->accumulator = 0; - bs->pointer = (BYTE*) bs->buffer; + bs->pointer = (BYTE*)bs->buffer; bs->capacity = capacity; bs->length = bs->capacity * 8; } @@ -341,7 +274,7 @@ void BitStream_Attach(wBitStream* bs, const BYTE* buffer, UINT32 capacity) wBitStream* BitStream_New() { wBitStream* bs = NULL; - bs = (wBitStream*) calloc(1, sizeof(wBitStream)); + bs = (wBitStream*)calloc(1, sizeof(wBitStream)); return bs; } diff --git a/winpr/libwinpr/utils/collections/BufferPool.c b/winpr/libwinpr/utils/collections/BufferPool.c index 1e805c5c8..5120a9106 100644 --- a/winpr/libwinpr/utils/collections/BufferPool.c +++ b/winpr/libwinpr/utils/collections/BufferPool.c @@ -40,22 +40,25 @@ static BOOL BufferPool_ShiftAvailable(wBufferPool* pool, int index, int count) { if (pool->aSize + count > pool->aCapacity) { - wBufferPoolItem *newArray; + wBufferPoolItem* newArray; int newCapacity = pool->aCapacity * 2; - newArray = (wBufferPoolItem*) realloc(pool->aArray, sizeof(wBufferPoolItem) * newCapacity); + newArray = + (wBufferPoolItem*)realloc(pool->aArray, sizeof(wBufferPoolItem) * newCapacity); if (!newArray) return FALSE; pool->aArray = newArray; pool->aCapacity = newCapacity; } - MoveMemory(&pool->aArray[index + count], &pool->aArray[index], (pool->aSize - index) * sizeof(wBufferPoolItem)); + MoveMemory(&pool->aArray[index + count], &pool->aArray[index], + (pool->aSize - index) * sizeof(wBufferPoolItem)); pool->aSize += count; } else if (count < 0) { - MoveMemory(&pool->aArray[index], &pool->aArray[index - count], (pool->aSize - index) * sizeof(wBufferPoolItem)); + MoveMemory(&pool->aArray[index], &pool->aArray[index - count], + (pool->aSize - index) * sizeof(wBufferPoolItem)); pool->aSize += count; } return TRUE; @@ -68,19 +71,22 @@ static BOOL BufferPool_ShiftUsed(wBufferPool* pool, int index, int count) if (pool->uSize + count > pool->uCapacity) { int newUCapacity = pool->uCapacity * 2; - wBufferPoolItem *newUArray = (wBufferPoolItem *)realloc(pool->uArray, sizeof(wBufferPoolItem) *newUCapacity); + wBufferPoolItem* newUArray = + (wBufferPoolItem*)realloc(pool->uArray, sizeof(wBufferPoolItem) * newUCapacity); if (!newUArray) return FALSE; pool->uCapacity = newUCapacity; pool->uArray = newUArray; } - MoveMemory(&pool->uArray[index + count], &pool->uArray[index], (pool->uSize - index) * sizeof(wBufferPoolItem)); + MoveMemory(&pool->uArray[index + count], &pool->uArray[index], + (pool->uSize - index) * sizeof(wBufferPoolItem)); pool->uSize += count; } else if (count < 0) { - MoveMemory(&pool->uArray[index], &pool->uArray[index - count], (pool->uSize - index) * sizeof(wBufferPoolItem)); + MoveMemory(&pool->uArray[index], &pool->uArray[index - count], + (pool->uSize - index) * sizeof(wBufferPoolItem)); pool->uSize += count; } return TRUE; @@ -241,7 +247,7 @@ void* BufferPool_Take(wBufferPool* pool, int size) if (maxSize < size) { - void *newBuffer; + void* newBuffer; if (pool->alignment) newBuffer = _aligned_realloc(buffer, size, pool->alignment); else @@ -263,7 +269,8 @@ void* BufferPool_Take(wBufferPool* pool, int size) if (pool->uSize + 1 > pool->uCapacity) { int newUCapacity = pool->uCapacity * 2; - wBufferPoolItem *newUArray = (wBufferPoolItem *)realloc(pool->uArray, sizeof(wBufferPoolItem) * newUCapacity); + wBufferPoolItem* newUArray = + (wBufferPoolItem*)realloc(pool->uArray, sizeof(wBufferPoolItem) * newUCapacity); if (!newUArray) goto out_error; @@ -312,7 +319,7 @@ BOOL BufferPool_Return(wBufferPool* pool, void* buffer) if ((pool->size + 1) >= pool->capacity) { int newCapacity = pool->capacity * 2; - void **newArray = (void **)realloc(pool->array, sizeof(void*) * newCapacity); + void** newArray = (void**)realloc(pool->array, sizeof(void*) * newCapacity); if (!newArray) goto out_error; @@ -347,7 +354,8 @@ BOOL BufferPool_Return(wBufferPool* pool, void* buffer) if ((pool->aSize + 1) >= pool->aCapacity) { int newCapacity = pool->aCapacity * 2; - wBufferPoolItem *newArray = (wBufferPoolItem*) realloc(pool->aArray, sizeof(wBufferPoolItem) * newCapacity); + wBufferPoolItem* newArray = + (wBufferPoolItem*)realloc(pool->aArray, sizeof(wBufferPoolItem) * newCapacity); if (!newArray) goto out_error; @@ -431,7 +439,7 @@ wBufferPool* BufferPool_New(BOOL synchronized, int fixedSize, DWORD alignment) { wBufferPool* pool = NULL; - pool = (wBufferPool*) malloc(sizeof(wBufferPool)); + pool = (wBufferPool*)malloc(sizeof(wBufferPool)); if (pool) { @@ -452,7 +460,7 @@ wBufferPool* BufferPool_New(BOOL synchronized, int fixedSize, DWORD alignment) pool->size = 0; pool->capacity = 32; - pool->array = (void**) calloc(pool->capacity, sizeof(void*)); + pool->array = (void**)calloc(pool->capacity, sizeof(void*)); if (!pool->array) goto out_error; } @@ -462,13 +470,13 @@ wBufferPool* BufferPool_New(BOOL synchronized, int fixedSize, DWORD alignment) pool->aSize = 0; pool->aCapacity = 32; - pool->aArray = (wBufferPoolItem*) calloc(pool->aCapacity, sizeof(wBufferPoolItem)); + pool->aArray = (wBufferPoolItem*)calloc(pool->aCapacity, sizeof(wBufferPoolItem)); if (!pool->aArray) goto out_error; pool->uSize = 0; pool->uCapacity = 32; - pool->uArray = (wBufferPoolItem*) calloc(pool->uCapacity, sizeof(wBufferPoolItem)); + pool->uArray = (wBufferPoolItem*)calloc(pool->uCapacity, sizeof(wBufferPoolItem)); if (!pool->uArray) { free(pool->aArray); diff --git a/winpr/libwinpr/utils/collections/CountdownEvent.c b/winpr/libwinpr/utils/collections/CountdownEvent.c index fabaa8d3d..bf9a736fa 100644 --- a/winpr/libwinpr/utils/collections/CountdownEvent.c +++ b/winpr/libwinpr/utils/collections/CountdownEvent.c @@ -100,7 +100,8 @@ void CountdownEvent_AddCount(wCountdownEvent* countdown, DWORD signalCount) } /** - * Registers multiple signals with the CountdownEvent, decrementing the value of CurrentCount by the specified amount. + * Registers multiple signals with the CountdownEvent, decrementing the value of CurrentCount by the + * specified amount. */ BOOL CountdownEvent_Signal(wCountdownEvent* countdown, DWORD signalCount) @@ -152,7 +153,7 @@ wCountdownEvent* CountdownEvent_New(DWORD initialCount) { wCountdownEvent* countdown = NULL; - if (!(countdown = (wCountdownEvent*) calloc(1, sizeof(wCountdownEvent)))) + if (!(countdown = (wCountdownEvent*)calloc(1, sizeof(wCountdownEvent)))) return NULL; countdown->count = initialCount; diff --git a/winpr/libwinpr/utils/collections/Dictionary.c b/winpr/libwinpr/utils/collections/Dictionary.c index 8f932782c..62f2b64eb 100644 --- a/winpr/libwinpr/utils/collections/Dictionary.c +++ b/winpr/libwinpr/utils/collections/Dictionary.c @@ -78,7 +78,6 @@ BOOL Dictionary_IsSynchronized(wDictionary* dictionary) void Dictionary_Add(wDictionary* dictionary, void* key, void* value) { - } /** @@ -87,7 +86,6 @@ void Dictionary_Add(wDictionary* dictionary, void* key, void* value) void Dictionary_Clear(wDictionary* dictionary) { - } /** @@ -105,7 +103,6 @@ BOOL Dictionary_Contains(wDictionary* dictionary, void* key) void Dictionary_Remove(wDictionary* dictionary, void* key) { - } /** @@ -116,7 +113,7 @@ wDictionary* Dictionary_New(BOOL synchronized) { wDictionary* dictionary = NULL; - dictionary = (wDictionary*) malloc(sizeof(wDictionary)); + dictionary = (wDictionary*)malloc(sizeof(wDictionary)); if (dictionary) { @@ -133,4 +130,3 @@ void Dictionary_Free(wDictionary* dictionary) free(dictionary); } - diff --git a/winpr/libwinpr/utils/collections/HashTable.c b/winpr/libwinpr/utils/collections/HashTable.c index edbf97126..68cb4417b 100644 --- a/winpr/libwinpr/utils/collections/HashTable.c +++ b/winpr/libwinpr/utils/collections/HashTable.c @@ -40,7 +40,7 @@ BOOL HashTable_PointerCompare(void* pointer1, void* pointer2) UINT32 HashTable_PointerHash(void* pointer) { - return ((UINT32)(UINT_PTR) pointer) >> 4; + return ((UINT32)(UINT_PTR)pointer) >> 4; } BOOL HashTable_StringCompare(void* string1, void* string2) @@ -48,14 +48,14 @@ BOOL HashTable_StringCompare(void* string1, void* string2) if (!string1 || !string2) return (string1 == string2); - return (strcmp((char*) string1, (char*) string2) == 0); + return (strcmp((char*)string1, (char*)string2) == 0); } UINT32 HashTable_StringHash(void* key) { UINT32 c; UINT32 hash = 5381; - BYTE* str = (BYTE*) key; + BYTE* str = (BYTE*)key; /* djb2 algorithm */ while ((c = *str++) != '\0') @@ -66,7 +66,7 @@ UINT32 HashTable_StringHash(void* key) void* HashTable_StringClone(void* str) { - return _strdup((char*) str); + return _strdup((char*)str); } void HashTable_StringFree(void* str) @@ -91,7 +91,7 @@ static int HashTable_IsProbablePrime(int oddNumber) static long HashTable_CalculateIdealNumOfBuckets(wHashTable* table) { - int idealNumOfBuckets = table->numOfElements / ((int) table->idealRatio); + int idealNumOfBuckets = table->numOfElements / ((int)table->idealRatio); if (idealNumOfBuckets < 5) idealNumOfBuckets = 5; @@ -118,7 +118,7 @@ void HashTable_Rehash(wHashTable* table, int numOfBuckets) if (numOfBuckets == table->numOfBuckets) return; /* already the right size! */ - newBucketArray = (wKeyValuePair**) calloc(numOfBuckets, sizeof(wKeyValuePair*)); + newBucketArray = (wKeyValuePair**)calloc(numOfBuckets, sizeof(wKeyValuePair*)); if (!newBucketArray) { @@ -148,8 +148,8 @@ void HashTable_Rehash(wHashTable* table, int numOfBuckets) table->numOfBuckets = numOfBuckets; } -void HashTable_SetIdealRatio(wHashTable* table, float idealRatio, - float lowerRehashThreshold, float upperRehashThreshold) +void HashTable_SetIdealRatio(wHashTable* table, float idealRatio, float lowerRehashThreshold, + float upperRehashThreshold) { table->idealRatio = idealRatio; table->lowerRehashThreshold = lowerRehashThreshold; @@ -250,7 +250,7 @@ int HashTable_Add(wHashTable* table, void* key, void* value) } else { - newPair = (wKeyValuePair*) malloc(sizeof(wKeyValuePair)); + newPair = (wKeyValuePair*)malloc(sizeof(wKeyValuePair)); if (!newPair) { @@ -266,7 +266,8 @@ int HashTable_Add(wHashTable* table, void* key, void* value) if (table->upperRehashThreshold > table->idealRatio) { - float elementToBucketRatio = (float) table->numOfElements / (float) table->numOfBuckets; + float elementToBucketRatio = + (float)table->numOfElements / (float)table->numOfBuckets; if (elementToBucketRatio > table->upperRehashThreshold) HashTable_Rehash(table, 0); @@ -325,7 +326,7 @@ BOOL HashTable_Remove(wHashTable* table, void* key) if (table->lowerRehashThreshold > 0.0) { - float elementToBucketRatio = (float) table->numOfElements / (float) table->numOfBuckets; + float elementToBucketRatio = (float)table->numOfElements / (float)table->numOfBuckets; if (elementToBucketRatio < table->lowerRehashThreshold) HashTable_Rehash(table, 0); @@ -468,7 +469,7 @@ int HashTable_GetKeys(wHashTable* table, ULONG_PTR** ppKeys) return 0; } - pKeys = (ULONG_PTR*) calloc(count, sizeof(ULONG_PTR)); + pKeys = (ULONG_PTR*)calloc(count, sizeof(ULONG_PTR)); if (!pKeys) { @@ -485,7 +486,7 @@ int HashTable_GetKeys(wHashTable* table, ULONG_PTR** ppKeys) while (pair) { nextPair = pair->next; - pKeys[iKey++] = (ULONG_PTR) pair->key; + pKeys[iKey++] = (ULONG_PTR)pair->key; pair = nextPair; } } @@ -580,7 +581,7 @@ BOOL HashTable_ContainsValue(wHashTable* table, void* value) wHashTable* HashTable_New(BOOL synchronized) { wHashTable* table; - table = (wHashTable*) calloc(1, sizeof(wHashTable)); + table = (wHashTable*)calloc(1, sizeof(wHashTable)); if (table) { @@ -588,7 +589,7 @@ wHashTable* HashTable_New(BOOL synchronized) InitializeCriticalSectionAndSpinCount(&(table->lock), 4000); table->numOfBuckets = 64; table->numOfElements = 0; - table->bucketArray = (wKeyValuePair**) calloc(table->numOfBuckets, sizeof(wKeyValuePair*)); + table->bucketArray = (wKeyValuePair**)calloc(table->numOfBuckets, sizeof(wKeyValuePair*)); if (!table->bucketArray) { diff --git a/winpr/libwinpr/utils/collections/KeyValuePair.c b/winpr/libwinpr/utils/collections/KeyValuePair.c index 19a211e73..bb4799c56 100644 --- a/winpr/libwinpr/utils/collections/KeyValuePair.c +++ b/winpr/libwinpr/utils/collections/KeyValuePair.c @@ -34,7 +34,7 @@ wKeyValuePair* KeyValuePair_New(void* key, void* value) { wKeyValuePair* keyValuePair; - keyValuePair = (wKeyValuePair*) malloc(sizeof(wKeyValuePair)); + keyValuePair = (wKeyValuePair*)malloc(sizeof(wKeyValuePair)); if (!keyValuePair) return NULL; diff --git a/winpr/libwinpr/utils/collections/LinkedList.c b/winpr/libwinpr/utils/collections/LinkedList.c index 03dbe7c45..fa3d1f99d 100644 --- a/winpr/libwinpr/utils/collections/LinkedList.c +++ b/winpr/libwinpr/utils/collections/LinkedList.c @@ -166,7 +166,7 @@ void LinkedList_Clear(wLinkedList* list) static wLinkedListNode* LinkedList_Create(wLinkedList* list, void* value) { - wLinkedListNode* node = (wLinkedListNode*) calloc(1, sizeof(wLinkedListNode)); + wLinkedListNode* node = (wLinkedListNode*)calloc(1, sizeof(wLinkedListNode)); if (!node) return NULL; @@ -332,7 +332,7 @@ static BOOL default_equal_function(const void* objA, const void* objB) wLinkedList* LinkedList_New(void) { wLinkedList* list = NULL; - list = (wLinkedList*) calloc(1, sizeof(wLinkedList)); + list = (wLinkedList*)calloc(1, sizeof(wLinkedList)); if (list) { diff --git a/winpr/libwinpr/utils/collections/ListDictionary.c b/winpr/libwinpr/utils/collections/ListDictionary.c index 818d5133e..b71267f88 100644 --- a/winpr/libwinpr/utils/collections/ListDictionary.c +++ b/winpr/libwinpr/utils/collections/ListDictionary.c @@ -155,7 +155,7 @@ int ListDictionary_GetKeys(wListDictionary* listDictionary, ULONG_PTR** ppKeys) if (count) { - pKeys = (ULONG_PTR*) calloc(count, sizeof(ULONG_PTR)); + pKeys = (ULONG_PTR*)calloc(count, sizeof(ULONG_PTR)); if (!pKeys) { @@ -174,7 +174,7 @@ int ListDictionary_GetKeys(wListDictionary* listDictionary, ULONG_PTR** ppKeys) while (item) { - pKeys[index++] = (ULONG_PTR) item->key; + pKeys[index++] = (ULONG_PTR)item->key; item = item->next; } } @@ -203,7 +203,7 @@ BOOL ListDictionary_Add(wListDictionary* listDictionary, const void* key, void* if (listDictionary->synchronized) EnterCriticalSection(&listDictionary->lock); - item = (wListDictionaryItem*) malloc(sizeof(wListDictionaryItem)); + item = (wListDictionaryItem*)malloc(sizeof(wListDictionaryItem)); if (!item) goto out_error; @@ -478,7 +478,7 @@ static BOOL default_equal_function(const void* obj1, const void* obj2) wListDictionary* ListDictionary_New(BOOL synchronized) { wListDictionary* listDictionary = NULL; - listDictionary = (wListDictionary*) calloc(1, sizeof(wListDictionary)); + listDictionary = (wListDictionary*)calloc(1, sizeof(wListDictionary)); if (!listDictionary) return NULL; @@ -505,4 +505,3 @@ void ListDictionary_Free(wListDictionary* listDictionary) free(listDictionary); } } - diff --git a/winpr/libwinpr/utils/collections/MessagePipe.c b/winpr/libwinpr/utils/collections/MessagePipe.c index bccea7b30..c593bc542 100644 --- a/winpr/libwinpr/utils/collections/MessagePipe.c +++ b/winpr/libwinpr/utils/collections/MessagePipe.c @@ -30,8 +30,6 @@ * Properties */ - - /** * Methods */ @@ -50,7 +48,7 @@ wMessagePipe* MessagePipe_New() { wMessagePipe* pipe = NULL; - pipe = (wMessagePipe*) malloc(sizeof(wMessagePipe)); + pipe = (wMessagePipe*)malloc(sizeof(wMessagePipe)); if (!pipe) return NULL; diff --git a/winpr/libwinpr/utils/collections/MessageQueue.c b/winpr/libwinpr/utils/collections/MessageQueue.c index 3e269a796..d288c544f 100644 --- a/winpr/libwinpr/utils/collections/MessageQueue.c +++ b/winpr/libwinpr/utils/collections/MessageQueue.c @@ -84,7 +84,7 @@ BOOL MessageQueue_Dispatch(wMessageQueue* queue, wMessage* message) old_capacity = queue->capacity; new_capacity = queue->capacity * 2; - new_arr = (wMessage*) realloc(queue->array, sizeof(wMessage) * new_capacity); + new_arr = (wMessage*)realloc(queue->array, sizeof(wMessage) * new_capacity); if (!new_arr) goto out; queue->array = new_arr; @@ -130,7 +130,7 @@ BOOL MessageQueue_Post(wMessageQueue* queue, void* context, UINT32 type, void* w BOOL MessageQueue_PostQuit(wMessageQueue* queue, int nExitCode) { - return MessageQueue_Post(queue, NULL, WMQ_QUIT, (void*) (size_t) nExitCode, NULL); + return MessageQueue_Post(queue, NULL, WMQ_QUIT, (void*)(size_t)nExitCode, NULL); } int MessageQueue_Get(wMessageQueue* queue, wMessage* message) @@ -191,16 +191,16 @@ int MessageQueue_Peek(wMessageQueue* queue, wMessage* message, BOOL remove) * Construction, Destruction */ -wMessageQueue* MessageQueue_New(const wObject *callback) +wMessageQueue* MessageQueue_New(const wObject* callback) { wMessageQueue* queue = NULL; - queue = (wMessageQueue*) calloc(1, sizeof(wMessageQueue)); + queue = (wMessageQueue*)calloc(1, sizeof(wMessageQueue)); if (!queue) return NULL; queue->capacity = 32; - queue->array = (wMessage*) calloc(queue->capacity, sizeof(wMessage)); + queue->array = (wMessage*)calloc(queue->capacity, sizeof(wMessage)); if (!queue->array) goto error_array; @@ -239,15 +239,15 @@ void MessageQueue_Free(wMessageQueue* queue) free(queue); } -int MessageQueue_Clear(wMessageQueue *queue) +int MessageQueue_Clear(wMessageQueue* queue) { int status = 0; EnterCriticalSection(&queue->lock); - while(queue->size > 0) + while (queue->size > 0) { - wMessage *msg = &(queue->array[queue->head]); + wMessage* msg = &(queue->array[queue->head]); /* Free resources of message. */ if (queue->object.fnObjectUninit) @@ -266,4 +266,3 @@ int MessageQueue_Clear(wMessageQueue *queue) return status; } - diff --git a/winpr/libwinpr/utils/collections/ObjectPool.c b/winpr/libwinpr/utils/collections/ObjectPool.c index f31f17def..5f80a31bb 100644 --- a/winpr/libwinpr/utils/collections/ObjectPool.c +++ b/winpr/libwinpr/utils/collections/ObjectPool.c @@ -75,10 +75,10 @@ void ObjectPool_Return(wObjectPool* pool, void* obj) if ((pool->size + 1) >= pool->capacity) { size_t new_cap; - void **new_arr; + void** new_arr; new_cap = pool->capacity * 2; - new_arr = (void**) realloc(pool->array, sizeof(void*) * new_cap); + new_arr = (void**)realloc(pool->array, sizeof(void*) * new_cap); if (!new_arr) goto out; @@ -125,13 +125,13 @@ wObjectPool* ObjectPool_New(BOOL synchronized) { wObjectPool* pool = NULL; - pool = (wObjectPool*) calloc(1, sizeof(wObjectPool)); + pool = (wObjectPool*)calloc(1, sizeof(wObjectPool)); if (pool) { pool->capacity = 32; pool->size = 0; - pool->array = (void**) calloc(pool->capacity, sizeof(void*)); + pool->array = (void**)calloc(pool->capacity, sizeof(void*)); if (!pool->array) { free(pool); @@ -141,7 +141,6 @@ wObjectPool* ObjectPool_New(BOOL synchronized) if (pool->synchronized) InitializeCriticalSectionAndSpinCount(&pool->lock, 4000); - } return pool; diff --git a/winpr/libwinpr/utils/collections/PubSub.c b/winpr/libwinpr/utils/collections/PubSub.c index 932628479..f0a19485f 100644 --- a/winpr/libwinpr/utils/collections/PubSub.c +++ b/winpr/libwinpr/utils/collections/PubSub.c @@ -81,10 +81,10 @@ void PubSub_AddEventTypes(wPubSub* pubSub, wEventType* events, int count) while (pubSub->count + count >= pubSub->size) { int new_size; - wEventType *new_event; + wEventType* new_event; new_size = pubSub->size * 2; - new_event = (wEventType*) realloc(pubSub->events, new_size * sizeof(wEventType)); + new_event = (wEventType*)realloc(pubSub->events, new_size * sizeof(wEventType)); if (!new_event) return; pubSub->size = new_size; @@ -151,7 +151,7 @@ int PubSub_Unsubscribe(wPubSub* pubSub, const char* EventName, pEventHandler Eve event->EventHandlers[index] = NULL; event->EventHandlerCount--; MoveMemory(&event->EventHandlers[index], &event->EventHandlers[index + 1], - (MAX_EVENT_HANDLERS - index - 1) * sizeof(pEventHandler)); + (MAX_EVENT_HANDLERS - index - 1) * sizeof(pEventHandler)); status = 1; } } @@ -202,7 +202,7 @@ wPubSub* PubSub_New(BOOL synchronized) { wPubSub* pubSub = NULL; - pubSub = (wPubSub*) malloc(sizeof(wPubSub)); + pubSub = (wPubSub*)malloc(sizeof(wPubSub)); if (!pubSub) return NULL; @@ -218,7 +218,7 @@ wPubSub* PubSub_New(BOOL synchronized) pubSub->count = 0; pubSub->size = 64; - pubSub->events = (wEventType*) calloc(pubSub->size, sizeof(wEventType)); + pubSub->events = (wEventType*)calloc(pubSub->size, sizeof(wEventType)); if (!pubSub->events) { if (pubSub->synchronized) diff --git a/winpr/libwinpr/utils/collections/Reference.c b/winpr/libwinpr/utils/collections/Reference.c index 0ca4e6a63..f9b6d6bbb 100644 --- a/winpr/libwinpr/utils/collections/Reference.c +++ b/winpr/libwinpr/utils/collections/Reference.c @@ -71,7 +71,7 @@ wReference* ReferenceTable_GetFreeEntry(wReferenceTable* referenceTable) if (!found) { UINT32 new_size; - wReference *new_ref; + wReference* new_ref; if (!referenceTable->size) { @@ -81,15 +81,14 @@ wReference* ReferenceTable_GetFreeEntry(wReferenceTable* referenceTable) } new_size = referenceTable->size * 2; - new_ref = (wReference*) realloc(referenceTable->array, - sizeof(wReference) * new_size); + new_ref = (wReference*)realloc(referenceTable->array, sizeof(wReference) * new_size); if (!new_ref) return NULL; referenceTable->size = new_size; referenceTable->array = new_ref; ZeroMemory(&referenceTable->array[(referenceTable->size / 2)], - sizeof(wReference) * (referenceTable->size / 2)); + sizeof(wReference) * (referenceTable->size / 2)); return ReferenceTable_GetFreeEntry(referenceTable); } @@ -157,7 +156,7 @@ wReferenceTable* ReferenceTable_New(BOOL synchronized, void* context, REFERENCE_ { wReferenceTable* referenceTable; - referenceTable = (wReferenceTable*) calloc(1, sizeof(wReferenceTable)); + referenceTable = (wReferenceTable*)calloc(1, sizeof(wReferenceTable)); if (!referenceTable) return NULL; @@ -166,7 +165,7 @@ wReferenceTable* ReferenceTable_New(BOOL synchronized, void* context, REFERENCE_ referenceTable->size = 32; - referenceTable->array = (wReference*) calloc(referenceTable->size, sizeof(wReference)); + referenceTable->array = (wReference*)calloc(referenceTable->size, sizeof(wReference)); if (!referenceTable->array) goto error_array; diff --git a/winpr/libwinpr/utils/collections/Stack.c b/winpr/libwinpr/utils/collections/Stack.c index a47ab170d..d7b43ebd0 100644 --- a/winpr/libwinpr/utils/collections/Stack.c +++ b/winpr/libwinpr/utils/collections/Stack.c @@ -130,7 +130,7 @@ void Stack_Push(wStack* stack, void* obj) int new_cap; void** new_arr; new_cap = stack->capacity * 2; - new_arr = (void**) realloc(stack->array, sizeof(void*) * new_cap); + new_arr = (void**)realloc(stack->array, sizeof(void*) * new_cap); if (!new_arr) return; @@ -185,7 +185,6 @@ void* Stack_Peek(wStack* stack) return obj; } - static BOOL default_stack_equals(const void* obj1, const void* obj2) { return (obj1 == obj2); @@ -206,7 +205,7 @@ wStack* Stack_New(BOOL synchronized) stack->object.fnObjectEquals = default_stack_equals; stack->synchronized = synchronized; stack->capacity = 32; - stack->array = (void**) calloc(stack->capacity, sizeof(void*)); + stack->array = (void**)calloc(stack->capacity, sizeof(void*)); if (!stack->array) goto out_free; diff --git a/winpr/libwinpr/utils/collections/StreamPool.c b/winpr/libwinpr/utils/collections/StreamPool.c index 6e33cdfa0..46892a019 100644 --- a/winpr/libwinpr/utils/collections/StreamPool.c +++ b/winpr/libwinpr/utils/collections/StreamPool.c @@ -36,17 +36,18 @@ void StreamPool_ShiftUsed(wStreamPool* pool, int index, int count) if (pool->uSize + count > pool->uCapacity) { int new_cap; - wStream **new_arr; + wStream** new_arr; new_cap = pool->uCapacity * 2; - new_arr = (wStream**) realloc(pool->uArray, sizeof(wStream*) * new_cap); + new_arr = (wStream**)realloc(pool->uArray, sizeof(wStream*) * new_cap); if (!new_arr) return; pool->uCapacity = new_cap; pool->uArray = new_arr; } - MoveMemory(&pool->uArray[index + count], &pool->uArray[index], (pool->uSize - index) * sizeof(wStream*)); + MoveMemory(&pool->uArray[index + count], &pool->uArray[index], + (pool->uSize - index) * sizeof(wStream*)); pool->uSize += count; } else if (count < 0) @@ -54,7 +55,7 @@ void StreamPool_ShiftUsed(wStreamPool* pool, int index, int count) if (pool->uSize - index + count > 0) { MoveMemory(&pool->uArray[index], &pool->uArray[index - count], - (pool->uSize - index + count) * sizeof(wStream*)); + (pool->uSize - index + count) * sizeof(wStream*)); } pool->uSize += count; @@ -70,10 +71,10 @@ void StreamPool_AddUsed(wStreamPool* pool, wStream* s) if ((pool->uSize + 1) >= pool->uCapacity) { int new_cap; - wStream **new_arr; + wStream** new_arr; new_cap = pool->uCapacity * 2; - new_arr = (wStream**) realloc(pool->uArray, sizeof(wStream*) * new_cap); + new_arr = (wStream**)realloc(pool->uArray, sizeof(wStream*) * new_cap); if (!new_arr) return; pool->uCapacity = new_cap; @@ -112,17 +113,18 @@ void StreamPool_ShiftAvailable(wStreamPool* pool, int index, int count) if (pool->aSize + count > pool->aCapacity) { int new_cap; - wStream **new_arr; + wStream** new_arr; new_cap = pool->aCapacity * 2; - new_arr = (wStream**) realloc(pool->aArray, sizeof(wStream*) * new_cap); + new_arr = (wStream**)realloc(pool->aArray, sizeof(wStream*) * new_cap); if (!new_arr) return; pool->aCapacity = new_cap; pool->aArray = new_arr; } - MoveMemory(&pool->aArray[index + count], &pool->aArray[index], (pool->aSize - index) * sizeof(wStream*)); + MoveMemory(&pool->aArray[index + count], &pool->aArray[index], + (pool->aSize - index) * sizeof(wStream*)); pool->aSize += count; } else if (count < 0) @@ -130,7 +132,7 @@ void StreamPool_ShiftAvailable(wStreamPool* pool, int index, int count) if (pool->aSize - index + count > 0) { MoveMemory(&pool->aArray[index], &pool->aArray[index - count], - (pool->aSize - index + count) * sizeof(wStream*)); + (pool->aSize - index + count) * sizeof(wStream*)); } pool->aSize += count; @@ -205,10 +207,10 @@ void StreamPool_Return(wStreamPool* pool, wStream* s) if ((pool->aSize + 1) >= pool->aCapacity) { int new_cap; - wStream **new_arr; + wStream** new_arr; new_cap = pool->aCapacity * 2; - new_arr = (wStream**) realloc(pool->aArray, sizeof(wStream*) * new_cap); + new_arr = (wStream**)realloc(pool->aArray, sizeof(wStream*) * new_cap); if (!new_arr) goto out_fail; pool->aCapacity = new_cap; @@ -217,10 +219,10 @@ void StreamPool_Return(wStreamPool* pool, wStream* s) else if ((pool->aSize + 1) * 3 < pool->aCapacity) { int new_cap; - wStream **new_arr; + wStream** new_arr; new_cap = pool->aCapacity / 2; - new_arr = (wStream**) realloc(pool->aArray, sizeof(wStream*) * new_cap); + new_arr = (wStream**)realloc(pool->aArray, sizeof(wStream*) * new_cap); if (!new_arr) goto out_fail; pool->aCapacity = new_cap; @@ -369,7 +371,7 @@ wStreamPool* StreamPool_New(BOOL synchronized, size_t defaultSize) { wStreamPool* pool = NULL; - pool = (wStreamPool*) calloc(1, sizeof(wStreamPool)); + pool = (wStreamPool*)calloc(1, sizeof(wStreamPool)); if (pool) { @@ -378,7 +380,7 @@ wStreamPool* StreamPool_New(BOOL synchronized, size_t defaultSize) pool->aSize = 0; pool->aCapacity = 32; - pool->aArray = (wStream**) calloc(pool->aCapacity, sizeof(wStream*)); + pool->aArray = (wStream**)calloc(pool->aCapacity, sizeof(wStream*)); if (!pool->aArray) { @@ -388,7 +390,7 @@ wStreamPool* StreamPool_New(BOOL synchronized, size_t defaultSize) pool->uSize = 0; pool->uCapacity = 32; - pool->uArray = (wStream**) calloc(pool->uCapacity, sizeof(wStream*)); + pool->uArray = (wStream**)calloc(pool->uCapacity, sizeof(wStream*)); if (!pool->uArray) { diff --git a/winpr/libwinpr/utils/corkscrew/backtrace.h b/winpr/libwinpr/utils/corkscrew/backtrace.h index a24ac21aa..408f9880e 100644 --- a/winpr/libwinpr/utils/corkscrew/backtrace.h +++ b/winpr/libwinpr/utils/corkscrew/backtrace.h @@ -20,7 +20,8 @@ #define _CORKSCREW_BACKTRACE_H #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif #include @@ -33,9 +34,9 @@ extern "C" { */ typedef struct { - uintptr_t absolute_pc; /* absolute PC offset */ - uintptr_t stack_top; /* top of stack for this frame */ - size_t stack_size; /* size of this stack frame */ + uintptr_t absolute_pc; /* absolute PC offset */ + uintptr_t stack_top; /* top of stack for this frame */ + size_t stack_size; /* size of this stack frame */ } backtrace_frame_t; /* @@ -43,13 +44,13 @@ extern "C" { */ typedef struct { - uintptr_t relative_pc; /* relative frame PC offset from the start of the library, - or the absolute PC if the library is unknown */ + uintptr_t relative_pc; /* relative frame PC offset from the start of the library, + or the absolute PC if the library is unknown */ uintptr_t relative_symbol_addr; /* relative offset of the symbol from the start of the - library or 0 if the library is unknown */ - char *map_name; /* executable or library name, or NULL if unknown */ - char *symbol_name; /* symbol name, or NULL if unknown */ - char *demangled_name; /* demangled symbol name, or NULL if unknown */ + library or 0 if the library is unknown */ + char* map_name; /* executable or library name, or NULL if unknown */ + char* symbol_name; /* symbol name, or NULL if unknown */ + char* demangled_name; /* demangled symbol name, or NULL if unknown */ } backtrace_symbol_t; /* @@ -57,7 +58,7 @@ extern "C" { * Populates the backtrace array with the program counters from the call stack. * Returns the number of frames collected, or -1 if an error occurred. */ - ssize_t unwind_backtrace(backtrace_frame_t *backtrace, size_t ignore_depth, size_t max_depth); + ssize_t unwind_backtrace(backtrace_frame_t* backtrace, size_t ignore_depth, size_t max_depth); /* * Unwinds the call stack for a thread within this process. @@ -66,38 +67,39 @@ extern "C" { * * The task is briefly suspended while the backtrace is being collected. */ - ssize_t unwind_backtrace_thread(pid_t tid, backtrace_frame_t *backtrace, - size_t ignore_depth, size_t max_depth); + ssize_t unwind_backtrace_thread(pid_t tid, backtrace_frame_t* backtrace, size_t ignore_depth, + size_t max_depth); /* * Unwinds the call stack of a task within a remote process using ptrace(). * Populates the backtrace array with the program counters from the call stack. * Returns the number of frames collected, or -1 if an error occurred. */ - ssize_t unwind_backtrace_ptrace(pid_t tid, const ptrace_context_t *context, - backtrace_frame_t *backtrace, size_t ignore_depth, size_t max_depth); + ssize_t unwind_backtrace_ptrace(pid_t tid, const ptrace_context_t* context, + backtrace_frame_t* backtrace, size_t ignore_depth, + size_t max_depth); /* * Gets the symbols for each frame of a backtrace. * The symbols array must be big enough to hold one symbol record per frame. * The symbols must later be freed using free_backtrace_symbols. */ - void get_backtrace_symbols(const backtrace_frame_t *backtrace, size_t frames, - backtrace_symbol_t *backtrace_symbols); + void get_backtrace_symbols(const backtrace_frame_t* backtrace, size_t frames, + backtrace_symbol_t* backtrace_symbols); /* * Gets the symbols for each frame of a backtrace from a remote process. * The symbols array must be big enough to hold one symbol record per frame. * The symbols must later be freed using free_backtrace_symbols. */ - void get_backtrace_symbols_ptrace(const ptrace_context_t *context, - const backtrace_frame_t *backtrace, size_t frames, - backtrace_symbol_t *backtrace_symbols); + void get_backtrace_symbols_ptrace(const ptrace_context_t* context, + const backtrace_frame_t* backtrace, size_t frames, + backtrace_symbol_t* backtrace_symbols); /* * Frees the storage associated with backtrace symbols. */ - void free_backtrace_symbols(backtrace_symbol_t *backtrace_symbols, size_t frames); + void free_backtrace_symbols(backtrace_symbol_t* backtrace_symbols, size_t frames); enum { @@ -108,8 +110,8 @@ extern "C" { /** * Formats a line from a backtrace as a zero-terminated string into the specified buffer. */ - void format_backtrace_line(unsigned frameNumber, const backtrace_frame_t *frame, - const backtrace_symbol_t *symbol, char *buffer, size_t bufferSize); + void format_backtrace_line(unsigned frameNumber, const backtrace_frame_t* frame, + const backtrace_symbol_t* symbol, char* buffer, size_t bufferSize); #ifdef __cplusplus } diff --git a/winpr/libwinpr/utils/corkscrew/demangle.h b/winpr/libwinpr/utils/corkscrew/demangle.h index 04b022554..75c01d7bf 100644 --- a/winpr/libwinpr/utils/corkscrew/demangle.h +++ b/winpr/libwinpr/utils/corkscrew/demangle.h @@ -23,17 +23,18 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* - * Demangles a C++ symbol name. - * If name is NULL or if the name cannot be demangled, returns NULL. - * Otherwise, returns a newly allocated string that contains the demangled name. - * - * The caller must free the returned string using free(). - */ -char* demangle_symbol_name(const char* name); + /* + * Demangles a C++ symbol name. + * If name is NULL or if the name cannot be demangled, returns NULL. + * Otherwise, returns a newly allocated string that contains the demangled name. + * + * The caller must free the returned string using free(). + */ + char* demangle_symbol_name(const char* name); #ifdef __cplusplus } diff --git a/winpr/libwinpr/utils/corkscrew/map_info.h b/winpr/libwinpr/utils/corkscrew/map_info.h index 14bfad67d..5ad6ebe16 100644 --- a/winpr/libwinpr/utils/corkscrew/map_info.h +++ b/winpr/libwinpr/utils/corkscrew/map_info.h @@ -24,48 +24,50 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct map_info { - struct map_info* next; - uintptr_t start; - uintptr_t end; - bool is_readable; - bool is_writable; - bool is_executable; - void* data; // arbitrary data associated with the map by the user, initially NULL - char name[]; -} map_info_t; + typedef struct map_info + { + struct map_info* next; + uintptr_t start; + uintptr_t end; + bool is_readable; + bool is_writable; + bool is_executable; + void* data; // arbitrary data associated with the map by the user, initially NULL + char name[]; + } map_info_t; -/* Loads memory map from /proc//maps. */ -map_info_t* load_map_info_list(pid_t tid); + /* Loads memory map from /proc//maps. */ + map_info_t* load_map_info_list(pid_t tid); -/* Frees memory map. */ -void free_map_info_list(map_info_t* milist); + /* Frees memory map. */ + void free_map_info_list(map_info_t* milist); -/* Finds the memory map that contains the specified address. */ -const map_info_t* find_map_info(const map_info_t* milist, uintptr_t addr); + /* Finds the memory map that contains the specified address. */ + const map_info_t* find_map_info(const map_info_t* milist, uintptr_t addr); -/* Returns true if the addr is in a readable map. */ -bool is_readable_map(const map_info_t* milist, uintptr_t addr); -/* Returns true if the addr is in a writable map. */ -bool is_writable_map(const map_info_t* milist, uintptr_t addr); -/* Returns true if the addr is in an executable map. */ -bool is_executable_map(const map_info_t* milist, uintptr_t addr); + /* Returns true if the addr is in a readable map. */ + bool is_readable_map(const map_info_t* milist, uintptr_t addr); + /* Returns true if the addr is in a writable map. */ + bool is_writable_map(const map_info_t* milist, uintptr_t addr); + /* Returns true if the addr is in an executable map. */ + bool is_executable_map(const map_info_t* milist, uintptr_t addr); -/* Acquires a reference to the memory map for this process. - * The result is cached and refreshed automatically. - * Make sure to release the map info when done. */ -map_info_t* acquire_my_map_info_list(); + /* Acquires a reference to the memory map for this process. + * The result is cached and refreshed automatically. + * Make sure to release the map info when done. */ + map_info_t* acquire_my_map_info_list(); -/* Releases a reference to the map info for this process that was - * previous acquired using acquire_my_map_info_list(). */ -void release_my_map_info_list(map_info_t* milist); + /* Releases a reference to the map info for this process that was + * previous acquired using acquire_my_map_info_list(). */ + void release_my_map_info_list(map_info_t* milist); -/* Flushes the cached memory map so the next call to - * acquire_my_map_info_list() gets fresh data. */ -void flush_my_map_info_list(); + /* Flushes the cached memory map so the next call to + * acquire_my_map_info_list() gets fresh data. */ + void flush_my_map_info_list(); #ifdef __cplusplus } diff --git a/winpr/libwinpr/utils/corkscrew/ptrace.h b/winpr/libwinpr/utils/corkscrew/ptrace.h index 76276d89a..5f981a64c 100644 --- a/winpr/libwinpr/utils/corkscrew/ptrace.h +++ b/winpr/libwinpr/utils/corkscrew/ptrace.h @@ -27,105 +27,110 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* Stores information about a process that is used for several different - * ptrace() based operations. */ -typedef struct { - map_info_t* map_info_list; -} ptrace_context_t; + /* Stores information about a process that is used for several different + * ptrace() based operations. */ + typedef struct + { + map_info_t* map_info_list; + } ptrace_context_t; -/* Describes how to access memory from a process. */ -typedef struct { - pid_t tid; - const map_info_t* map_info_list; -} memory_t; + /* Describes how to access memory from a process. */ + typedef struct + { + pid_t tid; + const map_info_t* map_info_list; + } memory_t; #if __i386__ -/* ptrace() register context. */ -typedef struct pt_regs_x86 { - uint32_t ebx; - uint32_t ecx; - uint32_t edx; - uint32_t esi; - uint32_t edi; - uint32_t ebp; - uint32_t eax; - uint32_t xds; - uint32_t xes; - uint32_t xfs; - uint32_t xgs; - uint32_t orig_eax; - uint32_t eip; - uint32_t xcs; - uint32_t eflags; - uint32_t esp; - uint32_t xss; -} pt_regs_x86_t; + /* ptrace() register context. */ + typedef struct pt_regs_x86 + { + uint32_t ebx; + uint32_t ecx; + uint32_t edx; + uint32_t esi; + uint32_t edi; + uint32_t ebp; + uint32_t eax; + uint32_t xds; + uint32_t xes; + uint32_t xfs; + uint32_t xgs; + uint32_t orig_eax; + uint32_t eip; + uint32_t xcs; + uint32_t eflags; + uint32_t esp; + uint32_t xss; + } pt_regs_x86_t; #endif #if __mips__ -/* ptrace() GET_REGS context. */ -typedef struct pt_regs_mips { - uint64_t regs[32]; - uint64_t lo; - uint64_t hi; - uint64_t cp0_epc; - uint64_t cp0_badvaddr; - uint64_t cp0_status; - uint64_t cp0_cause; -} pt_regs_mips_t; + /* ptrace() GET_REGS context. */ + typedef struct pt_regs_mips + { + uint64_t regs[32]; + uint64_t lo; + uint64_t hi; + uint64_t cp0_epc; + uint64_t cp0_badvaddr; + uint64_t cp0_status; + uint64_t cp0_cause; + } pt_regs_mips_t; #endif -/* - * Initializes a memory structure for accessing memory from this process. - */ -void init_memory(memory_t* memory, const map_info_t* map_info_list); + /* + * Initializes a memory structure for accessing memory from this process. + */ + void init_memory(memory_t* memory, const map_info_t* map_info_list); -/* - * Initializes a memory structure for accessing memory from another process - * using ptrace(). - */ -void init_memory_ptrace(memory_t* memory, pid_t tid); + /* + * Initializes a memory structure for accessing memory from another process + * using ptrace(). + */ + void init_memory_ptrace(memory_t* memory, pid_t tid); -/* - * Reads a word of memory safely. - * If the memory is local, ensures that the address is readable before dereferencing it. - * Returns false and a value of 0xffffffff if the word could not be read. - */ -bool try_get_word(const memory_t* memory, uintptr_t ptr, uint32_t* out_value); + /* + * Reads a word of memory safely. + * If the memory is local, ensures that the address is readable before dereferencing it. + * Returns false and a value of 0xffffffff if the word could not be read. + */ + bool try_get_word(const memory_t* memory, uintptr_t ptr, uint32_t* out_value); -/* - * Reads a word of memory safely using ptrace(). - * Returns false and a value of 0xffffffff if the word could not be read. - */ -bool try_get_word_ptrace(pid_t tid, uintptr_t ptr, uint32_t* out_value); + /* + * Reads a word of memory safely using ptrace(). + * Returns false and a value of 0xffffffff if the word could not be read. + */ + bool try_get_word_ptrace(pid_t tid, uintptr_t ptr, uint32_t* out_value); -/* - * Loads information needed for examining a remote process using ptrace(). - * The caller must already have successfully attached to the process - * using ptrace(). - * - * The context can be used for any threads belonging to that process - * assuming ptrace() is attached to them before performing the actual - * unwinding. The context can continue to be used to decode backtraces - * even after ptrace() has been detached from the process. - */ -ptrace_context_t* load_ptrace_context(pid_t pid); + /* + * Loads information needed for examining a remote process using ptrace(). + * The caller must already have successfully attached to the process + * using ptrace(). + * + * The context can be used for any threads belonging to that process + * assuming ptrace() is attached to them before performing the actual + * unwinding. The context can continue to be used to decode backtraces + * even after ptrace() has been detached from the process. + */ + ptrace_context_t* load_ptrace_context(pid_t pid); -/* - * Frees a ptrace context. - */ -void free_ptrace_context(ptrace_context_t* context); + /* + * Frees a ptrace context. + */ + void free_ptrace_context(ptrace_context_t* context); -/* - * Finds a symbol using ptrace. - * Returns the containing map and information about the symbol, or - * NULL if one or the other is not available. - */ -void find_symbol_ptrace(const ptrace_context_t* context, - uintptr_t addr, const map_info_t** out_map_info, const symbol_t** out_symbol); + /* + * Finds a symbol using ptrace. + * Returns the containing map and information about the symbol, or + * NULL if one or the other is not available. + */ + void find_symbol_ptrace(const ptrace_context_t* context, uintptr_t addr, + const map_info_t** out_map_info, const symbol_t** out_symbol); #ifdef __cplusplus } diff --git a/winpr/libwinpr/utils/corkscrew/symbol_table.h b/winpr/libwinpr/utils/corkscrew/symbol_table.h index 4998750bf..380e17dce 100644 --- a/winpr/libwinpr/utils/corkscrew/symbol_table.h +++ b/winpr/libwinpr/utils/corkscrew/symbol_table.h @@ -21,36 +21,39 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -typedef struct { - uintptr_t start; - uintptr_t end; - char* name; -} symbol_t; + typedef struct + { + uintptr_t start; + uintptr_t end; + char* name; + } symbol_t; -typedef struct { - symbol_t* symbols; - size_t num_symbols; -} symbol_table_t; + typedef struct + { + symbol_t* symbols; + size_t num_symbols; + } symbol_table_t; -/* - * Loads a symbol table from a given file. - * Returns NULL on error. - */ -symbol_table_t* load_symbol_table(const char* filename); + /* + * Loads a symbol table from a given file. + * Returns NULL on error. + */ + symbol_table_t* load_symbol_table(const char* filename); -/* - * Frees a symbol table. - */ -void free_symbol_table(symbol_table_t* table); + /* + * Frees a symbol table. + */ + void free_symbol_table(symbol_table_t* table); -/* - * Finds a symbol associated with an address in the symbol table. - * Returns NULL if not found. - */ -const symbol_t* find_symbol(const symbol_table_t* table, uintptr_t addr); + /* + * Finds a symbol associated with an address in the symbol table. + * Returns NULL if not found. + */ + const symbol_t* find_symbol(const symbol_table_t* table, uintptr_t addr); #ifdef __cplusplus } diff --git a/winpr/libwinpr/utils/debug.c b/winpr/libwinpr/utils/debug.c index e344e3aef..503f4afe1 100644 --- a/winpr/libwinpr/utils/debug.c +++ b/winpr/libwinpr/utils/debug.c @@ -46,12 +46,36 @@ #include #define TAG "com.winpr.utils.debug" -#define LOGT(...) do { WLog_Print(WLog_Get(TAG), WLOG_TRACE, __VA_ARGS__); } while(0) -#define LOGD(...) do { WLog_Print(WLog_Get(TAG), WLOG_DEBUG, __VA_ARGS__); } while(0) -#define LOGI(...) do { WLog_Print(WLog_Get(TAG), WLOG_INFO, __VA_ARGS__); } while(0) -#define LOGW(...) do { WLog_Print(WLog_Get(TAG), WLOG_WARN, __VA_ARGS__); } while(0) -#define LOGE(...) do { WLog_Print(WLog_Get(TAG), WLOG_ERROR, __VA_ARGS__); } while(0) -#define LOGF(...) do { WLog_Print(WLog_Get(TAG), WLOG_FATAL, __VA_ARGS__); } while(0) +#define LOGT(...) \ + do \ + { \ + WLog_Print(WLog_Get(TAG), WLOG_TRACE, __VA_ARGS__); \ + } while (0) +#define LOGD(...) \ + do \ + { \ + WLog_Print(WLog_Get(TAG), WLOG_DEBUG, __VA_ARGS__); \ + } while (0) +#define LOGI(...) \ + do \ + { \ + WLog_Print(WLog_Get(TAG), WLOG_INFO, __VA_ARGS__); \ + } while (0) +#define LOGW(...) \ + do \ + { \ + WLog_Print(WLog_Get(TAG), WLOG_WARN, __VA_ARGS__); \ + } while (0) +#define LOGE(...) \ + do \ + { \ + WLog_Print(WLog_Get(TAG), WLOG_ERROR, __VA_ARGS__); \ + } while (0) +#define LOGF(...) \ + do \ + { \ + WLog_Print(WLog_Get(TAG), WLOG_FATAL, __VA_ARGS__); \ + } while (0) static const char* support_msg = "Invalid stacktrace buffer! check if platform is supported!"; @@ -88,11 +112,13 @@ typedef struct typedef struct { void* hdl; - ssize_t (*unwind_backtrace)(backtrace_frame_t* backtrace, size_t ignore_depth, size_t max_depth); - ssize_t (*unwind_backtrace_thread)(pid_t tid, backtrace_frame_t* backtrace, - size_t ignore_depth, size_t max_depth); + ssize_t (*unwind_backtrace)(backtrace_frame_t* backtrace, size_t ignore_depth, + size_t max_depth); + ssize_t (*unwind_backtrace_thread)(pid_t tid, backtrace_frame_t* backtrace, size_t ignore_depth, + size_t max_depth); ssize_t (*unwind_backtrace_ptrace)(pid_t tid, const ptrace_context_t* context, - backtrace_frame_t* backtrace, size_t ignore_depth, size_t max_depth); + backtrace_frame_t* backtrace, size_t ignore_depth, + size_t max_depth); void (*get_backtrace_symbols)(const backtrace_frame_t* backtrace, size_t frames, backtrace_symbol_t* backtrace_symbols); void (*get_backtrace_symbols_ptrace)(const ptrace_context_t* context, @@ -100,7 +126,8 @@ typedef struct backtrace_symbol_t* backtrace_symbols); void (*free_backtrace_symbols)(backtrace_symbol_t* backtrace_symbols, size_t frames); void (*format_backtrace_line)(unsigned frameNumber, const backtrace_frame_t* frame, - const backtrace_symbol_t* symbol, char* buffer, size_t bufferSize); + const backtrace_symbol_t* symbol, char* buffer, + size_t bufferSize); } t_corkscrew; static pthread_once_t initialized = PTHREAD_ONCE_INIT; @@ -178,19 +205,19 @@ void load_library(void) return; } fail: - { - if (lib.hdl) - dlclose(lib.hdl); +{ + if (lib.hdl) + dlclose(lib.hdl); - fkt = NULL; - } + fkt = NULL; +} } #endif #if defined(_WIN32) && (NTDDI_VERSION <= NTDDI_WINXP) typedef USHORT(WINAPI* PRTL_CAPTURE_STACK_BACK_TRACE_FN)(ULONG FramesToSkip, ULONG FramesToCapture, - PVOID* BackTrace, PULONG BackTraceHash); + PVOID* BackTrace, PULONG BackTraceHash); static HMODULE g_NTDLL_Library = NULL; static BOOL g_RtlCaptureStackBackTrace_Detected = FALSE; @@ -206,8 +233,8 @@ USHORT RtlCaptureStackBackTrace(ULONG FramesToSkip, ULONG FramesToCapture, PVOID if (g_NTDLL_Library) { - g_pRtlCaptureStackBackTrace = (PRTL_CAPTURE_STACK_BACK_TRACE_FN) GetProcAddress(g_NTDLL_Library, - "RtlCaptureStackBackTrace"); + g_pRtlCaptureStackBackTrace = (PRTL_CAPTURE_STACK_BACK_TRACE_FN)GetProcAddress( + g_NTDLL_Library, "RtlCaptureStackBackTrace"); g_RtlCaptureStackBackTrace_Available = (g_pRtlCaptureStackBackTrace) ? TRUE : FALSE; } else @@ -220,7 +247,8 @@ USHORT RtlCaptureStackBackTrace(ULONG FramesToSkip, ULONG FramesToCapture, PVOID if (g_RtlCaptureStackBackTrace_Available) { - return (*g_pRtlCaptureStackBackTrace)(FramesToSkip, FramesToCapture, BackTrace, BackTraceHash); + return (*g_pRtlCaptureStackBackTrace)(FramesToSkip, FramesToCapture, BackTrace, + BackTraceHash); } return 0; @@ -237,7 +265,7 @@ void winpr_backtrace_free(void* buffer) } #if defined(HAVE_EXECINFO_H) - t_execinfo* data = (t_execinfo*) buffer; + t_execinfo* data = (t_execinfo*)buffer; free(data->buffer); free(data); #elif defined(ANDROID) @@ -329,7 +357,7 @@ char** winpr_backtrace_symbols(void* buffer, size_t* used) } #if defined(HAVE_EXECINFO_H) - t_execinfo* data = (t_execinfo*) buffer; + t_execinfo* data = (t_execinfo*)buffer; if (!data) return NULL; @@ -339,7 +367,7 @@ char** winpr_backtrace_symbols(void* buffer, size_t* used) return backtrace_symbols(data->buffer, data->used); #elif defined(ANDROID) - t_corkscrew_data* data = (t_corkscrew_data*) buffer; + t_corkscrew_data* data = (t_corkscrew_data*)buffer; if (!data) return NULL; @@ -390,12 +418,12 @@ char** winpr_backtrace_symbols(void* buffer, size_t* used) size_t i; size_t line_len = 1024; HANDLE process = GetCurrentProcess(); - t_win_stack* data = (t_win_stack*) buffer; + t_win_stack* data = (t_win_stack*)buffer; size_t array_size = data->used * sizeof(char*); size_t lines_size = data->used * line_len; char** vlines = calloc(1, array_size + lines_size); SYMBOL_INFO* symbol = calloc(1, sizeof(SYMBOL_INFO) + line_len * sizeof(char)); - IMAGEHLP_LINE64* line = (IMAGEHLP_LINE64*) calloc(1, sizeof(IMAGEHLP_LINE64)); + IMAGEHLP_LINE64* line = (IMAGEHLP_LINE64*)calloc(1, sizeof(IMAGEHLP_LINE64)); if (!vlines || !symbol || !line) { @@ -421,11 +449,11 @@ char** winpr_backtrace_symbols(void* buffer, size_t* used) if (SymGetLineFromAddr64(process, address, &displacement, line)) { - sprintf_s(vlines[i], line_len, "%016"PRIx64": %s in %s:%"PRIu32, symbol->Address, symbol->Name, - line->FileName, line->LineNumber); + sprintf_s(vlines[i], line_len, "%016" PRIx64 ": %s in %s:%" PRIu32, symbol->Address, + symbol->Name, line->FileName, line->LineNumber); } else - sprintf_s(vlines[i], line_len, "%016"PRIx64": %s", symbol->Address, symbol->Name); + sprintf_s(vlines[i], line_len, "%016" PRIx64 ": %s", symbol->Address, symbol->Name); } if (used) @@ -450,7 +478,7 @@ void winpr_backtrace_symbols_fd(void* buffer, int fd) } #if defined(HAVE_EXECINFO_H) - t_execinfo* data = (t_execinfo*) buffer; + t_execinfo* data = (t_execinfo*)buffer; if (!data) return; @@ -497,7 +525,7 @@ void winpr_log_backtrace_ex(wLog* log, DWORD level, DWORD size) if (msg) { for (x = 0; x < used; x++) - WLog_Print(log, level, "%"PRIuz": %s\n", x, msg[x]); + WLog_Print(log, level, "%" PRIuz ": %s\n", x, msg[x]); } winpr_backtrace_free(stack); @@ -517,15 +545,15 @@ char* winpr_strerror(DWORD dw, char* dmsg, size_t size) dwFlags |= FORMAT_MESSAGE_ALLOCATE_BUFFER; #else nSize = (DWORD)(size * 2); - msg = (LPTSTR) calloc(nSize, sizeof(TCHAR)); + msg = (LPTSTR)calloc(nSize, sizeof(TCHAR)); #endif - rc = FormatMessage(dwFlags, NULL, dw, 0, alloc ? (LPTSTR) &msg : msg, nSize, NULL); + rc = FormatMessage(dwFlags, NULL, dw, 0, alloc ? (LPTSTR)&msg : msg, nSize, NULL); if (rc) { #if defined(UNICODE) WideCharToMultiByte(CP_ACP, 0, msg, rc, dmsg, size - 1, NULL, NULL); -#else /* defined(UNICODE) */ +#else /* defined(UNICODE) */ memcpy(dmsg, msg, min(rc, size - 1)); #endif /* defined(UNICODE) */ dmsg[min(rc, size - 1)] = 0; @@ -537,10 +565,10 @@ char* winpr_strerror(DWORD dw, char* dmsg, size_t size) } else { - _snprintf(dmsg, size, "FAILURE: 0x%08"PRIX32"", GetLastError()); + _snprintf(dmsg, size, "FAILURE: 0x%08" PRIX32 "", GetLastError()); } -#else /* defined(_WIN32) */ +#else /* defined(_WIN32) */ _snprintf(dmsg, size, "%s", strerror(dw)); #endif /* defined(_WIN32) */ return dmsg; diff --git a/winpr/libwinpr/utils/image.c b/winpr/libwinpr/utils/image.c index cb60d814e..990b4e1c4 100644 --- a/winpr/libwinpr/utils/image.c +++ b/winpr/libwinpr/utils/image.c @@ -150,7 +150,7 @@ int winpr_bitmap_write(const char* filename, const BYTE* data, int width, int he Stream_SealLength(s); if (fwrite(Stream_Buffer(s), Stream_Length(s), 1, fp) != 1 || - fwrite((void*) data, bi.biSizeImage, 1, fp) != 1) + fwrite((void*)data, bi.biSizeImage, 1, fp) != 1) goto fail; ret = 1; @@ -189,12 +189,12 @@ static int winpr_image_png_read_fp(wImage* image, FILE* fp) _fseeki64(fp, 0, SEEK_END); size = _ftelli64(fp); _fseeki64(fp, 0, SEEK_SET); - data = (BYTE*) malloc(size); + data = (BYTE*)malloc(size); if (!data) return -1; - if (fread((void*) data, size, 1, fp) != 1) + if (fread((void*)data, size, 1, fp) != 1) { free(data); return -1; @@ -282,14 +282,14 @@ static int winpr_image_bitmap_read_fp(wImage* image, FILE* fp) image->bitsPerPixel = bi.biBitCount; image->bytesPerPixel = (image->bitsPerPixel / 8); image->scanline = (bi.biSizeImage / image->height); - image->data = (BYTE*) malloc(bi.biSizeImage); + image->data = (BYTE*)malloc(bi.biSizeImage); if (!image->data) goto fail; if (!vFlip) { - if (fread((void*) image->data, bi.biSizeImage, 1, fp) != 1) + if (fread((void*)image->data, bi.biSizeImage, 1, fp) != 1) goto fail; } else @@ -298,7 +298,7 @@ static int winpr_image_bitmap_read_fp(wImage* image, FILE* fp) for (index = 0; index < image->height; index++) { - if (fread((void*) pDstData, image->scanline, 1, fp) != 1) + if (fread((void*)pDstData, image->scanline, 1, fp) != 1) goto fail; pDstData -= image->scanline; @@ -326,7 +326,7 @@ static int winpr_image_bitmap_read_buffer(wImage* image, const BYTE* buffer, siz BYTE* pDstData; WINPR_BITMAP_FILE_HEADER bf; WINPR_BITMAP_INFO_HEADER bi; - wStream* s = Stream_New((BYTE*) buffer, size); + wStream* s = Stream_New((BYTE*)buffer, size); if (!s) return -1; @@ -359,7 +359,7 @@ static int winpr_image_bitmap_read_buffer(wImage* image, const BYTE* buffer, siz image->bitsPerPixel = bi.biBitCount; image->bytesPerPixel = (image->bitsPerPixel / 8); image->scanline = (bi.biSizeImage / image->height); - image->data = (BYTE*) malloc(bi.biSizeImage); + image->data = (BYTE*)malloc(bi.biSizeImage); if (!image->data) goto fail; @@ -403,7 +403,7 @@ int winpr_image_read(wImage* image, const char* filename) return -1; } - if (fread((void*) &sig, sizeof(sig), 1, fp) != 1 || _fseeki64(fp, 0, SEEK_SET) < 0) + if (fread((void*)&sig, sizeof(sig), 1, fp) != 1 || _fseeki64(fp, 0, SEEK_SET) < 0) { fclose(fp); return -1; @@ -453,7 +453,7 @@ int winpr_image_read_buffer(wImage* image, const BYTE* buffer, int size) wImage* winpr_image_new(void) { wImage* image; - image = (wImage*) calloc(1, sizeof(wImage)); + image = (wImage*)calloc(1, sizeof(wImage)); if (!image) return NULL; diff --git a/winpr/libwinpr/utils/ini.c b/winpr/libwinpr/utils/ini.c index 828488c22..e1a20e716 100644 --- a/winpr/libwinpr/utils/ini.c +++ b/winpr/libwinpr/utils/ini.c @@ -99,7 +99,7 @@ static BOOL IniFile_Load_String(wIniFile* ini, const char* iniString) if (fileSize < 1) return FALSE; - ini->buffer = (char*) malloc(fileSize + 2); + ini->buffer = (char*)malloc(fileSize + 2); if (!ini->buffer) return FALSE; @@ -152,7 +152,7 @@ static BOOL IniFile_Load_File(wIniFile* ini, const char* filename) if (fileSize < 1) goto out_file; - ini->buffer = (char*) malloc((size_t)fileSize + 2); + ini->buffer = (char*)malloc((size_t)fileSize + 2); if (!ini->buffer) goto out_file; @@ -264,7 +264,7 @@ static wIniFileSection* IniFile_Section_New(const char* name) section->nKeys = 0; section->cKeys = 64; - section->keys = (wIniFileKey**) calloc(section->cKeys, sizeof(wIniFileKey*)); + section->keys = (wIniFileKey**)calloc(section->cKeys, sizeof(wIniFileKey*)); if (!section->keys) { @@ -330,7 +330,8 @@ static wIniFileSection* IniFile_AddSection(wIniFile* ini, const char* name) size_t new_size; wIniFileSection** new_sect; new_size = ini->cSections * 2; - new_sect = (wIniFileSection**) realloc(ini->sections, sizeof(wIniFileSection*) * new_size); + new_sect = + (wIniFileSection**)realloc(ini->sections, sizeof(wIniFileSection*) * new_size); if (!new_sect) return NULL; @@ -368,7 +369,7 @@ static wIniFileKey* IniFile_GetKey(wIniFile* ini, wIniFileSection* section, cons } static wIniFileKey* IniFile_AddKey(wIniFile* ini, wIniFileSection* section, const char* name, - const char* value) + const char* value) { wIniFileKey* key; @@ -384,7 +385,7 @@ static wIniFileKey* IniFile_AddKey(wIniFile* ini, wIniFileSection* section, cons size_t new_size; wIniFileKey** new_key; new_size = section->cKeys * 2; - new_key = (wIniFileKey**) realloc(section->keys, sizeof(wIniFileKey*) * new_size); + new_key = (wIniFileKey**)realloc(section->keys, sizeof(wIniFileKey*) * new_size); if (!new_key) return NULL; @@ -419,7 +420,7 @@ static int IniFile_Load(wIniFile* ini) char* name; char* value; char* separator; - char* beg, *end; + char *beg, *end; wIniFileSection* section = NULL; if (!ini) @@ -540,12 +541,12 @@ char** IniFile_GetSectionNames(wIniFile* ini, int* count) length += (nameLength + 1); } - sectionNames = (char**) malloc(length); + sectionNames = (char**)malloc(length); if (!sectionNames) return NULL; - p = (char*) & ((BYTE*) sectionNames)[sizeof(char*) * ini->nSections]; + p = (char*)&((BYTE*)sectionNames)[sizeof(char*) * ini->nSections]; for (index = 0; index < ini->nSections; index++) { @@ -591,12 +592,12 @@ char** IniFile_GetSectionKeyNames(wIniFile* ini, const char* section, int* count length += (nameLength + 1); } - keyNames = (char**) malloc(length); + keyNames = (char**)malloc(length); if (!keyNames) return NULL; - p = (char*) & ((BYTE*) keyNames)[sizeof(char*) * pSection->nKeys]; + p = (char*)&((BYTE*)keyNames)[sizeof(char*) * pSection->nKeys]; for (index = 0; index < pSection->nKeys; index++) { @@ -627,7 +628,7 @@ const char* IniFile_GetKeyValueString(wIniFile* ini, const char* section, const if (!pKey) return NULL; - value = (const char*) pKey->value; + value = (const char*)pKey->value; return value; } @@ -779,7 +780,7 @@ int IniFile_WriteFile(wIniFile* ini, const char* filename) return -1; } - if (fwrite((void*) buffer, length, 1, ini->fp) != 1) + if (fwrite((void*)buffer, length, 1, ini->fp) != 1) ret = -1; fclose(ini->fp); @@ -789,13 +790,13 @@ int IniFile_WriteFile(wIniFile* ini, const char* filename) wIniFile* IniFile_New(void) { - wIniFile* ini = (wIniFile*) calloc(1, sizeof(wIniFile)); + wIniFile* ini = (wIniFile*)calloc(1, sizeof(wIniFile)); if (ini) { ini->nSections = 0; ini->cSections = 64; - ini->sections = (wIniFileSection**) calloc(ini->cSections, sizeof(wIniFileSection*)); + ini->sections = (wIniFileSection**)calloc(ini->cSections, sizeof(wIniFileSection*)); if (!ini->sections) { diff --git a/winpr/libwinpr/utils/lodepng/lodepng.c b/winpr/libwinpr/utils/lodepng/lodepng.c index b48c881a2..c9aaf22a0 100644 --- a/winpr/libwinpr/utils/lodepng/lodepng.c +++ b/winpr/libwinpr/utils/lodepng/lodepng.c @@ -33,10 +33,13 @@ freely, subject to the following restrictions: #define VERSION_STRING "20140823" -#if defined(_MSC_VER) && (_MSC_VER >= 1310) /*Visual Studio: A few warning types are not desired here.*/ -#pragma warning( disable : 4244 ) /*implicit conversions: not warned by gcc -Wall -Wextra and requires too much casts*/ -#pragma warning( disable : 4996 ) /*VS does not like fopen, but fopen_s is not standard C so unusable here*/ -#endif /*_MSC_VER */ +#if defined(_MSC_VER) && \ + (_MSC_VER >= 1310) /*Visual Studio: A few warning types are not desired here.*/ +#pragma warning(disable : 4244) /*implicit conversions: not warned by gcc -Wall -Wextra and \ + requires too much casts*/ +#pragma warning( \ + disable : 4996) /*VS does not like fopen, but fopen_s is not standard C so unusable here*/ +#endif /*_MSC_VER */ /* This source file is built up in the following large parts. The code sections @@ -60,115 +63,123 @@ It makes the error handling code shorter and more readable. Example: if(!uivector_resizev(&frequencies_ll, 286, 0)) ERROR_BREAK(83); */ -#define CERROR_BREAK(errorvar, code)\ -{\ - errorvar = code;\ - break;\ -} +#define CERROR_BREAK(errorvar, code) \ + { \ + errorvar = code; \ + break; \ + } /*version of CERROR_BREAK that assumes the common case where the error variable is named "error"*/ #define ERROR_BREAK(code) CERROR_BREAK(error, code) /*Set error var to the error code, and return it.*/ -#define CERROR_RETURN_ERROR(errorvar, code)\ -{\ - errorvar = code;\ - return code;\ -} +#define CERROR_RETURN_ERROR(errorvar, code) \ + { \ + errorvar = code; \ + return code; \ + } /*Try the code, if it returns error, also return the error.*/ -#define CERROR_TRY_RETURN(call)\ -{\ - unsigned error = call;\ - if(error) return error;\ -} +#define CERROR_TRY_RETURN(call) \ + { \ + unsigned error = call; \ + if (error) \ + return error; \ + } /* About uivector, ucvector and string: -All of them wrap dynamic arrays or text strings in a similar way. --LodePNG was originally written in C++. The vectors replace the std::vectors that were used in the C++ version. --The string tools are made to avoid problems with compilers that declare things like strncat as deprecated. --They're not used in the interface, only internally in this file as static functions. --As with many other structs in this file, the init and cleanup functions serve as ctor and dtor. +-LodePNG was originally written in C++. The vectors replace the std::vectors that were used in the +C++ version. -The string tools are made to avoid problems with compilers that declare things like +strncat as deprecated. -They're not used in the interface, only internally in this file as static +functions. -As with many other structs in this file, the init and cleanup functions serve as ctor +and dtor. */ #ifdef LODEPNG_COMPILE_ZLIB /*dynamic vector of unsigned ints*/ typedef struct uivector { - unsigned* data; - size_t size; /*size in number of unsigned longs*/ - size_t allocsize; /*allocated size in bytes*/ + unsigned* data; + size_t size; /*size in number of unsigned longs*/ + size_t allocsize; /*allocated size in bytes*/ } uivector; static void uivector_cleanup(void* p) { - ((uivector*)p)->size = ((uivector*)p)->allocsize = 0; - free(((uivector*)p)->data); - ((uivector*)p)->data = NULL; + ((uivector*)p)->size = ((uivector*)p)->allocsize = 0; + free(((uivector*)p)->data); + ((uivector*)p)->data = NULL; } /*returns 1 if success, 0 if failure ==> nothing done*/ static unsigned uivector_reserve(uivector* p, size_t allocsize) { - if(allocsize > p->allocsize) - { - size_t newsize = (allocsize > p->allocsize * 2) ? allocsize : (allocsize * 3 / 2); - void* data = realloc(p->data, newsize); - if(data) - { - memset(&((char*)data)[p->allocsize], 0, newsize - p->allocsize); - p->allocsize = newsize; - p->data = (unsigned*)data; - } - else - { - uivector_cleanup(p); - return 0; /*error: not enough memory*/ - } - } - return 1; + if (allocsize > p->allocsize) + { + size_t newsize = (allocsize > p->allocsize * 2) ? allocsize : (allocsize * 3 / 2); + void* data = realloc(p->data, newsize); + if (data) + { + memset(&((char*)data)[p->allocsize], 0, newsize - p->allocsize); + p->allocsize = newsize; + p->data = (unsigned*)data; + } + else + { + uivector_cleanup(p); + return 0; /*error: not enough memory*/ + } + } + return 1; } /*returns 1 if success, 0 if failure ==> nothing done*/ static unsigned uivector_resize(uivector* p, size_t size) { - if(!uivector_reserve(p, size * sizeof(unsigned))) return 0; - p->size = size; - return 1; /*success*/ + if (!uivector_reserve(p, size * sizeof(unsigned))) + return 0; + p->size = size; + return 1; /*success*/ } /*resize and give all new elements the value*/ static unsigned uivector_resizev(uivector* p, size_t size, unsigned value) { - size_t oldsize = p->size, i; - if(!uivector_resize(p, size)) return 0; - for(i = oldsize; i < size; i++) p->data[i] = value; - return 1; + size_t oldsize = p->size, i; + if (!uivector_resize(p, size)) + return 0; + for (i = oldsize; i < size; i++) + p->data[i] = value; + return 1; } static void uivector_init(uivector* p) { - p->data = NULL; - p->size = p->allocsize = 0; + p->data = NULL; + p->size = p->allocsize = 0; } #ifdef LODEPNG_COMPILE_ENCODER /*returns 1 if success, 0 if failure ==> nothing done*/ static unsigned uivector_push_back(uivector* p, unsigned c) { - if(!uivector_resize(p, p->size + 1)) return 0; - p->data[p->size - 1] = c; - return 1; + if (!uivector_resize(p, p->size + 1)) + return 0; + p->data[p->size - 1] = c; + return 1; } /*copy q to p, returns 1 if success, 0 if failure ==> nothing done*/ static unsigned uivector_copy(uivector* p, const uivector* q) { - size_t i; - if(!uivector_resize(p, q->size)) return 0; - for(i = 0; i < q->size; i++) p->data[i] = q->data[i]; - return 1; + size_t i; + if (!uivector_resize(p, q->size)) + return 0; + for (i = 0; i < q->size; i++) + p->data[i] = q->data[i]; + return 1; } #endif /*LODEPNG_COMPILE_ENCODER*/ #endif /*LODEPNG_COMPILE_ZLIB*/ @@ -178,63 +189,66 @@ static unsigned uivector_copy(uivector* p, const uivector* q) /*dynamic vector of unsigned chars*/ typedef struct ucvector { - unsigned char* data; - size_t size; /*used size*/ - size_t allocsize; /*allocated size*/ + unsigned char* data; + size_t size; /*used size*/ + size_t allocsize; /*allocated size*/ } ucvector; static void ucvector_cleanup(void* p) { - ((ucvector*)p)->size = ((ucvector*)p)->allocsize = 0; - free(((ucvector*)p)->data); - ((ucvector*)p)->data = NULL; + ((ucvector*)p)->size = ((ucvector*)p)->allocsize = 0; + free(((ucvector*)p)->data); + ((ucvector*)p)->data = NULL; } /*returns 1 if success, 0 if failure ==> nothing done*/ static unsigned ucvector_reserve(ucvector* p, size_t allocsize) { - if(allocsize > p->allocsize) - { - size_t newsize = (allocsize > p->allocsize * 2) ? allocsize : (allocsize * 3 / 2); - void* data = realloc(p->data, newsize); - if(data) - { - p->allocsize = newsize; - p->data = (unsigned char*)data; - } - else - { - ucvector_cleanup(p); - return 0; /*error: not enough memory*/ - } - } - return 1; + if (allocsize > p->allocsize) + { + size_t newsize = (allocsize > p->allocsize * 2) ? allocsize : (allocsize * 3 / 2); + void* data = realloc(p->data, newsize); + if (data) + { + p->allocsize = newsize; + p->data = (unsigned char*)data; + } + else + { + ucvector_cleanup(p); + return 0; /*error: not enough memory*/ + } + } + return 1; } /*returns 1 if success, 0 if failure ==> nothing done*/ static unsigned ucvector_resize(ucvector* p, size_t size) { - if(!ucvector_reserve(p, size * sizeof(unsigned char))) return 0; - p->size = size; - return 1; /*success*/ + if (!ucvector_reserve(p, size * sizeof(unsigned char))) + return 0; + p->size = size; + return 1; /*success*/ } #ifdef LODEPNG_COMPILE_PNG static void ucvector_init(ucvector* p) { - p->data = NULL; - p->size = p->allocsize = 0; + p->data = NULL; + p->size = p->allocsize = 0; } #ifdef LODEPNG_COMPILE_DECODER /*resize and give all new elements the value*/ static unsigned ucvector_resizev(ucvector* p, size_t size, unsigned char value) { - size_t oldsize = p->size, i; - if(!ucvector_resize(p, size)) return 0; - for(i = oldsize; i < size; i++) p->data[i] = value; - return 1; + size_t oldsize = p->size, i; + if (!ucvector_resize(p, size)) + return 0; + for (i = oldsize; i < size; i++) + p->data[i] = value; + return 1; } #endif /*LODEPNG_COMPILE_DECODER*/ #endif /*LODEPNG_COMPILE_PNG*/ @@ -244,22 +258,23 @@ static unsigned ucvector_resizev(ucvector* p, size_t size, unsigned char value) init_buffer to take over a buffer and size, it is not needed to use cleanup*/ static void ucvector_init_buffer(ucvector* p, unsigned char* buffer, size_t size) { - p->data = buffer; - p->allocsize = p->size = size; + p->data = buffer; + p->allocsize = p->size = size; } #endif /*LODEPNG_COMPILE_ZLIB*/ -#if (defined(LODEPNG_COMPILE_PNG) && defined(LODEPNG_COMPILE_ANCILLARY_CHUNKS)) || defined(LODEPNG_COMPILE_ENCODER) +#if (defined(LODEPNG_COMPILE_PNG) && defined(LODEPNG_COMPILE_ANCILLARY_CHUNKS)) || \ + defined(LODEPNG_COMPILE_ENCODER) /*returns 1 if success, 0 if failure ==> nothing done*/ static unsigned ucvector_push_back(ucvector* p, unsigned char c) { - if(!ucvector_resize(p, p->size + 1)) return 0; - p->data[p->size - 1] = c; - return 1; + if (!ucvector_resize(p, p->size + 1)) + return 0; + p->data[p->size - 1] = c; + return 1; } #endif /*defined(LODEPNG_COMPILE_PNG) || defined(LODEPNG_COMPILE_ENCODER)*/ - /* ////////////////////////////////////////////////////////////////////////// */ #ifdef LODEPNG_COMPILE_PNG @@ -268,42 +283,42 @@ static unsigned ucvector_push_back(ucvector* p, unsigned char c) /*free the above pair again*/ static void string_cleanup(char** out) { - free(*out); - *out = NULL; + free(*out); + *out = NULL; } /*returns 1 if success, 0 if failure ==> nothing done*/ static unsigned string_resize(char** out, size_t size) { - char* data = (char*)realloc(*out, size + 1); - if(data) - { - data[size] = 0; /*null termination char*/ - *out = data; - } - else - string_cleanup(out); - - return data != 0; + char* data = (char*)realloc(*out, size + 1); + if (data) + { + data[size] = 0; /*null termination char*/ + *out = data; + } + else + string_cleanup(out); + + return data != 0; } /*init a {char*, size_t} pair for use as string*/ static void string_init(char** out) { - *out = NULL; - string_resize(out, 0); + *out = NULL; + string_resize(out, 0); } static void string_set(char** out, const char* in) { - size_t insize = strlen(in), i = 0; - if(string_resize(out, insize)) - { - for(i = 0; i < insize; i++) - { - (*out)[i] = in[i]; - } - } + size_t insize = strlen(in), i = 0; + if (string_resize(out, insize)) + { + for (i = 0; i < insize; i++) + { + (*out)[i] = in[i]; + } + } } #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ #endif /*LODEPNG_COMPILE_PNG*/ @@ -312,26 +327,27 @@ static void string_set(char** out, const char* in) unsigned lodepng_read32bitInt(const unsigned char* buffer) { - return (unsigned)((buffer[0] << 24) | (buffer[1] << 16) | (buffer[2] << 8) | buffer[3]); + return (unsigned)((buffer[0] << 24) | (buffer[1] << 16) | (buffer[2] << 8) | buffer[3]); } #if defined(LODEPNG_COMPILE_PNG) || defined(LODEPNG_COMPILE_ENCODER) /*buffer must have at least 4 allocated bytes available*/ static void lodepng_set32bitInt(unsigned char* buffer, unsigned value) { - buffer[0] = (unsigned char)((value >> 24) & 0xff); - buffer[1] = (unsigned char)((value >> 16) & 0xff); - buffer[2] = (unsigned char)((value >> 8) & 0xff); - buffer[3] = (unsigned char)((value ) & 0xff); + buffer[0] = (unsigned char)((value >> 24) & 0xff); + buffer[1] = (unsigned char)((value >> 16) & 0xff); + buffer[2] = (unsigned char)((value >> 8) & 0xff); + buffer[3] = (unsigned char)((value)&0xff); } #endif /*defined(LODEPNG_COMPILE_PNG) || defined(LODEPNG_COMPILE_ENCODER)*/ #ifdef LODEPNG_COMPILE_ENCODER static int lodepng_add32bitInt(ucvector* buffer, unsigned value) { - if (!ucvector_resize(buffer, buffer->size + 4)) return 0; - lodepng_set32bitInt(&buffer->data[buffer->size - 4], value); - return 1; + if (!ucvector_resize(buffer, buffer->size + 4)) + return 0; + lodepng_set32bitInt(&buffer->data[buffer->size - 4], value); + return 1; } #endif /*LODEPNG_COMPILE_ENCODER*/ @@ -343,44 +359,50 @@ static int lodepng_add32bitInt(ucvector* buffer, unsigned value) unsigned lodepng_load_file(unsigned char** out, size_t* outsize, const char* filename) { - FILE* file; - INT64 size; + FILE* file; + INT64 size; - /*provide some proper output values if error will happen*/ - *out = 0; - *outsize = 0; + /*provide some proper output values if error will happen*/ + *out = 0; + *outsize = 0; - file = fopen(filename, "rb"); - if(!file) return 78; + file = fopen(filename, "rb"); + if (!file) + return 78; - /*get filesize:*/ - _fseeki64(file , 0 , SEEK_END); - size = _ftelli64(file); - rewind(file); + /*get filesize:*/ + _fseeki64(file, 0, SEEK_END); + size = _ftelli64(file); + rewind(file); - /*read contents of the file into the vector*/ - *outsize = 0; - *out = (unsigned char*)malloc((size_t)size); - if(size && (*out)) (*outsize) = fread(*out, 1, (size_t)size, file); + /*read contents of the file into the vector*/ + *outsize = 0; + *out = (unsigned char*)malloc((size_t)size); + if (size && (*out)) + (*outsize) = fread(*out, 1, (size_t)size, file); - fclose(file); - if (size < 0) return 91; - if (*outsize != (size_t)size) return 91; - if(!(*out) && size) return 83; /*the above malloc failed*/ - return 0; + fclose(file); + if (size < 0) + return 91; + if (*outsize != (size_t)size) + return 91; + if (!(*out) && size) + return 83; /*the above malloc failed*/ + return 0; } /*write given buffer to the file, overwriting the file, it doesn't append to it.*/ unsigned lodepng_save_file(const unsigned char* buffer, size_t buffersize, const char* filename) { - FILE* file; - int ret = 0; - file = fopen(filename, "wb" ); - if(!file) return 79; - if (fwrite((char*)buffer , 1 , buffersize, file) != buffersize) - ret = 91; - fclose(file); - return ret; + FILE* file; + int ret = 0; + file = fopen(filename, "wb"); + if (!file) + return 79; + if (fwrite((char*)buffer, 1, buffersize, file) != buffersize) + ret = 91; + fclose(file); + return ret; } #endif /*LODEPNG_COMPILE_DISK*/ @@ -396,52 +418,57 @@ unsigned lodepng_save_file(const unsigned char* buffer, size_t buffersize, const /*TODO: this ignores potential out of memory errors*/ static int addBitToStream(size_t* bitpointer, ucvector* bitstream, unsigned char bit) { - /*add a new byte at the end*/ - if(((*bitpointer) & 7) == 0) - { - if (!ucvector_push_back(bitstream, (unsigned char)0)) return 83; - } + /*add a new byte at the end*/ + if (((*bitpointer) & 7) == 0) + { + if (!ucvector_push_back(bitstream, (unsigned char)0)) + return 83; + } - /*earlier bit of huffman code is in a lesser significant bit of an earlier byte*/ - (bitstream->data[bitstream->size - 1]) |= (bit << ((*bitpointer) & 0x7)); - (*bitpointer)++; + /*earlier bit of huffman code is in a lesser significant bit of an earlier byte*/ + (bitstream->data[bitstream->size - 1]) |= (bit << ((*bitpointer) & 0x7)); + (*bitpointer)++; - return 0; + return 0; } static void addBitsToStream(size_t* bitpointer, ucvector* bitstream, unsigned value, size_t nbits) { - size_t i; - for(i = 0; i < nbits; i++) addBitToStream(bitpointer, bitstream, (unsigned char)((value >> i) & 1)); + size_t i; + for (i = 0; i < nbits; i++) + addBitToStream(bitpointer, bitstream, (unsigned char)((value >> i) & 1)); } -static void addBitsToStreamReversed(size_t* bitpointer, ucvector* bitstream, unsigned value, size_t nbits) +static void addBitsToStreamReversed(size_t* bitpointer, ucvector* bitstream, unsigned value, + size_t nbits) { - size_t i; - for(i = 0; i < nbits; i++) addBitToStream(bitpointer, bitstream, (unsigned char)((value >> (nbits - 1 - i)) & 1)); + size_t i; + for (i = 0; i < nbits; i++) + addBitToStream(bitpointer, bitstream, (unsigned char)((value >> (nbits - 1 - i)) & 1)); } #endif /*LODEPNG_COMPILE_ENCODER*/ #ifdef LODEPNG_COMPILE_DECODER -#define READBIT(bitpointer, bitstream) ((bitstream[bitpointer >> 3] >> (bitpointer & 0x7)) & (unsigned char)1) +#define READBIT(bitpointer, bitstream) \ + ((bitstream[bitpointer >> 3] >> (bitpointer & 0x7)) & (unsigned char)1) static unsigned char readBitFromStream(size_t* bitpointer, const unsigned char* bitstream) { - unsigned char result = (unsigned char)(READBIT(*bitpointer, bitstream)); - (*bitpointer)++; - return result; + unsigned char result = (unsigned char)(READBIT(*bitpointer, bitstream)); + (*bitpointer)++; + return result; } static unsigned readBitsFromStream(size_t* bitpointer, const unsigned char* bitstream, size_t nbits) { - unsigned result = 0, i; - for(i = 0; i < nbits; i++) - { - result += ((unsigned)READBIT(*bitpointer, bitstream)) << i; - (*bitpointer)++; - } - return result; + unsigned result = 0, i; + for (i = 0; i < nbits; i++) + { + result += ((unsigned)READBIT(*bitpointer, bitstream)) << i; + (*bitpointer)++; + } + return result; } #endif /*LODEPNG_COMPILE_DECODER*/ @@ -455,33 +482,34 @@ static unsigned readBitsFromStream(size_t* bitpointer, const unsigned char* bits #define NUM_DEFLATE_CODE_SYMBOLS 288 /*the distance codes have their own symbols, 30 used, 2 unused*/ #define NUM_DISTANCE_SYMBOLS 32 -/*the code length codes. 0-15: code lengths, 16: copy previous 3-6 times, 17: 3-10 zeros, 18: 11-138 zeros*/ +/*the code length codes. 0-15: code lengths, 16: copy previous 3-6 times, 17: 3-10 zeros, 18: 11-138 + * zeros*/ #define NUM_CODE_LENGTH_CODES 19 /*the base lengths represented by codes 257-285*/ -static const unsigned LENGTHBASE[29] - = {3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, - 67, 83, 99, 115, 131, 163, 195, 227, 258}; +static const unsigned LENGTHBASE[29] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, + 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, + 67, 83, 99, 115, 131, 163, 195, 227, 258 }; /*the extra bits used by codes 257-285 (added to base length)*/ -static const unsigned LENGTHEXTRA[29] - = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, - 4, 4, 4, 4, 5, 5, 5, 5, 0}; +static const unsigned LENGTHEXTRA[29] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, + 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 }; -/*the base backwards distances (the bits of distance codes appear after length codes and use their own huffman tree)*/ -static const unsigned DISTANCEBASE[30] - = {1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, - 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; +/*the base backwards distances (the bits of distance codes appear after length codes and use their + * own huffman tree)*/ +static const unsigned DISTANCEBASE[30] = { 1, 2, 3, 4, 5, 7, 9, 13, + 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, + 4097, 6145, 8193, 12289, 16385, 24577 }; /*the extra bits of backwards distances (added to base)*/ -static const unsigned DISTANCEEXTRA[30] - = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, - 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; +static const unsigned DISTANCEEXTRA[30] = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, + 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13 }; /*the order in which "code length alphabet code lengths" are stored, out of this the huffman tree of the dynamic huffman tree lengths is generated*/ -static const unsigned CLCL_ORDER[NUM_CODE_LENGTH_CODES] - = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; +static const unsigned CLCL_ORDER[NUM_CODE_LENGTH_CODES] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, + 11, 4, 12, 3, 13, 2, 14, 1, 15 }; /* ////////////////////////////////////////////////////////////////////////// */ @@ -490,11 +518,11 @@ Huffman tree struct, containing multiple representations of the tree */ typedef struct HuffmanTree { - unsigned* tree2d; - unsigned* tree1d; - unsigned* lengths; /*the lengths of the codes of the 1d-tree*/ - unsigned maxbitlen; /*maximum number of bits a single code can get*/ - unsigned numcodes; /*number of symbols in the alphabet = number of codes*/ + unsigned* tree2d; + unsigned* tree1d; + unsigned* lengths; /*the lengths of the codes of the 1d-tree*/ + unsigned maxbitlen; /*maximum number of bits a single code can get*/ + unsigned numcodes; /*number of symbols in the alphabet = number of codes*/ } HuffmanTree; /*function used for debug purposes to draw the tree in ascii art with C++*/ @@ -512,78 +540,83 @@ static void HuffmanTree_draw(HuffmanTree* tree) static void HuffmanTree_init(HuffmanTree* tree) { - tree->tree2d = 0; - tree->tree1d = 0; - tree->lengths = 0; - tree->maxbitlen = 0; - tree->numcodes = 0; + tree->tree2d = 0; + tree->tree1d = 0; + tree->lengths = 0; + tree->maxbitlen = 0; + tree->numcodes = 0; } static void HuffmanTree_cleanup(HuffmanTree* tree) { - free(tree->tree2d); - free(tree->tree1d); - free(tree->lengths); + free(tree->tree2d); + free(tree->tree1d); + free(tree->lengths); } /*the tree representation used by the decoder. return value is error*/ static unsigned HuffmanTree_make2DTree(HuffmanTree* tree) { - unsigned nodefilled = 0; /*up to which node it is filled*/ - unsigned treepos = 0; /*position in the tree (1 of the numcodes columns)*/ - unsigned n, i; + unsigned nodefilled = 0; /*up to which node it is filled*/ + unsigned treepos = 0; /*position in the tree (1 of the numcodes columns)*/ + unsigned n, i; - tree->tree2d = (unsigned*)calloc(tree->numcodes * 2, sizeof(unsigned)); - if(!tree->tree2d) return 83; /*alloc fail*/ + tree->tree2d = (unsigned*)calloc(tree->numcodes * 2, sizeof(unsigned)); + if (!tree->tree2d) + return 83; /*alloc fail*/ - /* - convert tree1d[] to tree2d[][]. In the 2D array, a value of 32767 means - uninited, a value >= numcodes is an address to another bit, a value < numcodes - is a code. The 2 rows are the 2 possible bit values (0 or 1), there are as - many columns as codes - 1. - A good huffmann tree has N * 2 - 1 nodes, of which N - 1 are internal nodes. - Here, the internal nodes are stored (what their 0 and 1 option point to). - There is only memory for such good tree currently, if there are more nodes - (due to too long length codes), error 55 will happen - */ - for(n = 0; n < tree->numcodes * 2; n++) - { - tree->tree2d[n] = 32767; /*32767 here means the tree2d isn't filled there yet*/ - } + /* + convert tree1d[] to tree2d[][]. In the 2D array, a value of 32767 means + uninited, a value >= numcodes is an address to another bit, a value < numcodes + is a code. The 2 rows are the 2 possible bit values (0 or 1), there are as + many columns as codes - 1. + A good huffmann tree has N * 2 - 1 nodes, of which N - 1 are internal nodes. + Here, the internal nodes are stored (what their 0 and 1 option point to). + There is only memory for such good tree currently, if there are more nodes + (due to too long length codes), error 55 will happen + */ + for (n = 0; n < tree->numcodes * 2; n++) + { + tree->tree2d[n] = 32767; /*32767 here means the tree2d isn't filled there yet*/ + } - for(n = 0; n < tree->numcodes; n++) /*the codes*/ - { - for(i = 0; i < tree->lengths[n]; i++) /*the bits for this code*/ - { - unsigned char bit = (unsigned char)((tree->tree1d[n] >> (tree->lengths[n] - i - 1)) & 1); - if(treepos > tree->numcodes - 2) return 55; /*oversubscribed, see comment in lodepng_error_text*/ - if(tree->tree2d[2 * treepos + bit] == 32767) /*not yet filled in*/ - { - if(i + 1 == tree->lengths[n]) /*last bit*/ - { - tree->tree2d[2 * treepos + bit] = n; /*put the current code in it*/ - treepos = 0; - } - else - { - /*put address of the next step in here, first that address has to be found of course - (it's just nodefilled + 1)...*/ - nodefilled++; - /*addresses encoded with numcodes added to it*/ - tree->tree2d[2 * treepos + bit] = nodefilled + tree->numcodes; - treepos = nodefilled; - } - } - else treepos = tree->tree2d[2 * treepos + bit] - tree->numcodes; - } - } + for (n = 0; n < tree->numcodes; n++) /*the codes*/ + { + for (i = 0; i < tree->lengths[n]; i++) /*the bits for this code*/ + { + unsigned char bit = + (unsigned char)((tree->tree1d[n] >> (tree->lengths[n] - i - 1)) & 1); + if (treepos > tree->numcodes - 2) + return 55; /*oversubscribed, see comment in lodepng_error_text*/ + if (tree->tree2d[2 * treepos + bit] == 32767) /*not yet filled in*/ + { + if (i + 1 == tree->lengths[n]) /*last bit*/ + { + tree->tree2d[2 * treepos + bit] = n; /*put the current code in it*/ + treepos = 0; + } + else + { + /*put address of the next step in here, first that address has to be found of + course (it's just nodefilled + 1)...*/ + nodefilled++; + /*addresses encoded with numcodes added to it*/ + tree->tree2d[2 * treepos + bit] = nodefilled + tree->numcodes; + treepos = nodefilled; + } + } + else + treepos = tree->tree2d[2 * treepos + bit] - tree->numcodes; + } + } - for(n = 0; n < tree->numcodes * 2; n++) - { - if(tree->tree2d[n] == 32767) tree->tree2d[n] = 0; /*remove possible remaining 32767's*/ - } + for (n = 0; n < tree->numcodes * 2; n++) + { + if (tree->tree2d[n] == 32767) + tree->tree2d[n] = 0; /*remove possible remaining 32767's*/ + } - return 0; + return 0; } /* @@ -593,41 +626,46 @@ value is error. */ static unsigned HuffmanTree_makeFromLengths2(HuffmanTree* tree) { - uivector blcount; - uivector nextcode; - unsigned bits, n, error = 0; + uivector blcount; + uivector nextcode; + unsigned bits, n, error = 0; - uivector_init(&blcount); - uivector_init(&nextcode); + uivector_init(&blcount); + uivector_init(&nextcode); - tree->tree1d = (unsigned*)calloc(tree->numcodes, sizeof(unsigned)); - if(!tree->tree1d) error = 83; /*alloc fail*/ + tree->tree1d = (unsigned*)calloc(tree->numcodes, sizeof(unsigned)); + if (!tree->tree1d) + error = 83; /*alloc fail*/ - if(!uivector_resizev(&blcount, tree->maxbitlen + 1, 0) - || !uivector_resizev(&nextcode, tree->maxbitlen + 1, 0)) - error = 83; /*alloc fail*/ + if (!uivector_resizev(&blcount, tree->maxbitlen + 1, 0) || + !uivector_resizev(&nextcode, tree->maxbitlen + 1, 0)) + error = 83; /*alloc fail*/ - if(!error) - { - /*step 1: count number of instances of each code length*/ - for(bits = 0; bits < tree->numcodes; bits++) blcount.data[tree->lengths[bits]]++; - /*step 2: generate the nextcode values*/ - for(bits = 1; bits <= tree->maxbitlen; bits++) - { - nextcode.data[bits] = (nextcode.data[bits - 1] + blcount.data[bits - 1]) << 1; - } - /*step 3: generate all the codes*/ - for(n = 0; n < tree->numcodes; n++) - { - if(tree->lengths[n] != 0) tree->tree1d[n] = nextcode.data[tree->lengths[n]]++; - } - } + if (!error) + { + /*step 1: count number of instances of each code length*/ + for (bits = 0; bits < tree->numcodes; bits++) + blcount.data[tree->lengths[bits]]++; + /*step 2: generate the nextcode values*/ + for (bits = 1; bits <= tree->maxbitlen; bits++) + { + nextcode.data[bits] = (nextcode.data[bits - 1] + blcount.data[bits - 1]) << 1; + } + /*step 3: generate all the codes*/ + for (n = 0; n < tree->numcodes; n++) + { + if (tree->lengths[n] != 0) + tree->tree1d[n] = nextcode.data[tree->lengths[n]]++; + } + } - uivector_cleanup(&blcount); - uivector_cleanup(&nextcode); + uivector_cleanup(&blcount); + uivector_cleanup(&nextcode); - if(!error) return HuffmanTree_make2DTree(tree); - else return error; + if (!error) + return HuffmanTree_make2DTree(tree); + else + return error; } /* @@ -638,13 +676,15 @@ return value is error. static unsigned HuffmanTree_makeFromLengths(HuffmanTree* tree, const unsigned* bitlen, size_t numcodes, unsigned maxbitlen) { - unsigned i; - tree->lengths = (unsigned*)calloc(numcodes, sizeof(unsigned)); - if(!tree->lengths) return 83; /*alloc fail*/ - for(i = 0; i < numcodes; i++) tree->lengths[i] = bitlen[i]; - tree->numcodes = (unsigned)numcodes; /*number of symbols*/ - tree->maxbitlen = maxbitlen; - return HuffmanTree_makeFromLengths2(tree); + unsigned i; + tree->lengths = (unsigned*)calloc(numcodes, sizeof(unsigned)); + if (!tree->lengths) + return 83; /*alloc fail*/ + for (i = 0; i < numcodes; i++) + tree->lengths[i] = bitlen[i]; + tree->numcodes = (unsigned)numcodes; /*number of symbols*/ + tree->maxbitlen = maxbitlen; + return HuffmanTree_makeFromLengths2(tree); } #ifdef LODEPNG_COMPILE_ENCODER @@ -656,252 +696,280 @@ A coin can be multiple coins (when they're merged) */ typedef struct Coin { - uivector symbols; - float weight; /*the sum of all weights in this coin*/ + uivector symbols; + float weight; /*the sum of all weights in this coin*/ } Coin; static void coin_init(Coin* c) { - uivector_init(&c->symbols); + uivector_init(&c->symbols); } -/*argument c is void* so that this dtor can be given as function pointer to the vector resize function*/ +/*argument c is void* so that this dtor can be given as function pointer to the vector resize + * function*/ static void coin_cleanup(void* c) { - uivector_cleanup(&((Coin*)c)->symbols); + uivector_cleanup(&((Coin*)c)->symbols); } static void coin_copy(Coin* c1, const Coin* c2) { - c1->weight = c2->weight; - uivector_copy(&c1->symbols, &c2->symbols); + c1->weight = c2->weight; + uivector_copy(&c1->symbols, &c2->symbols); } static void add_coins(Coin* c1, const Coin* c2) { - size_t i; - for(i = 0; i < c2->symbols.size; i++) uivector_push_back(&c1->symbols, c2->symbols.data[i]); - c1->weight += c2->weight; + size_t i; + for (i = 0; i < c2->symbols.size; i++) + uivector_push_back(&c1->symbols, c2->symbols.data[i]); + c1->weight += c2->weight; } static void init_coins(Coin* coins, size_t num) { - size_t i; - for(i = 0; i < num; i++) coin_init(&coins[i]); + size_t i; + for (i = 0; i < num; i++) + coin_init(&coins[i]); } static void cleanup_coins(Coin* coins, size_t num) { - size_t i; - for(i = 0; i < num; i++) coin_cleanup(&coins[i]); + size_t i; + for (i = 0; i < num; i++) + coin_cleanup(&coins[i]); } -static int coin_compare(const void* a, const void* b) { - float wa = ((const Coin*)a)->weight; - float wb = ((const Coin*)b)->weight; - return wa > wb ? 1 : wa < wb ? -1 : 0; -} - -static unsigned append_symbol_coins(Coin* coins, const unsigned* frequencies, unsigned numcodes, size_t sum) +static int coin_compare(const void* a, const void* b) { - unsigned i; - unsigned j = 0; /*index of present symbols*/ - for(i = 0; i < numcodes; i++) - { - if(frequencies[i] != 0) /*only include symbols that are present*/ - { - coins[j].weight = frequencies[i] / (float)sum; - uivector_push_back(&coins[j].symbols, i); - j++; - } - } - return 0; + float wa = ((const Coin*)a)->weight; + float wb = ((const Coin*)b)->weight; + return wa > wb ? 1 : wa < wb ? -1 : 0; +} + +static unsigned append_symbol_coins(Coin* coins, const unsigned* frequencies, unsigned numcodes, + size_t sum) +{ + unsigned i; + unsigned j = 0; /*index of present symbols*/ + for (i = 0; i < numcodes; i++) + { + if (frequencies[i] != 0) /*only include symbols that are present*/ + { + coins[j].weight = frequencies[i] / (float)sum; + uivector_push_back(&coins[j].symbols, i); + j++; + } + } + return 0; } unsigned lodepng_huffman_code_lengths(unsigned* lengths, const unsigned* frequencies, size_t numcodes, unsigned maxbitlen) { - unsigned i, j; - size_t sum = 0, numpresent = 0; - unsigned error = 0; - Coin* coins; /*the coins of the currently calculated row*/ - Coin* prev_row; /*the previous row of coins*/ - size_t numcoins; - size_t coinmem; + unsigned i, j; + size_t sum = 0, numpresent = 0; + unsigned error = 0; + Coin* coins; /*the coins of the currently calculated row*/ + Coin* prev_row; /*the previous row of coins*/ + size_t numcoins; + size_t coinmem; - if(numcodes == 0) return 80; /*error: a tree of 0 symbols is not supposed to be made*/ + if (numcodes == 0) + return 80; /*error: a tree of 0 symbols is not supposed to be made*/ - for(i = 0; i < numcodes; i++) - { - if(frequencies[i] > 0) - { - numpresent++; - sum += frequencies[i]; - } - } + for (i = 0; i < numcodes; i++) + { + if (frequencies[i] > 0) + { + numpresent++; + sum += frequencies[i]; + } + } - for(i = 0; i < numcodes; i++) lengths[i] = 0; + for (i = 0; i < numcodes; i++) + lengths[i] = 0; - /*ensure at least two present symbols. There should be at least one symbol - according to RFC 1951 section 3.2.7. To decoders incorrectly require two. To - make these work as well ensure there are at least two symbols. The - Package-Merge code below also doesn't work correctly if there's only one - symbol, it'd give it the theoritical 0 bits but in practice zlib wants 1 bit*/ - if(numpresent == 0) - { - lengths[0] = lengths[1] = 1; /*note that for RFC 1951 section 3.2.7, only lengths[0] = 1 is needed*/ - } - else if(numpresent == 1) - { - for(i = 0; i < numcodes; i++) - { - if(frequencies[i]) - { - lengths[i] = 1; - lengths[i == 0 ? 1 : 0] = 1; - break; - } - } - } - else - { - /*Package-Merge algorithm represented by coin collector's problem - For every symbol, maxbitlen coins will be created*/ + /*ensure at least two present symbols. There should be at least one symbol + according to RFC 1951 section 3.2.7. To decoders incorrectly require two. To + make these work as well ensure there are at least two symbols. The + Package-Merge code below also doesn't work correctly if there's only one + symbol, it'd give it the theoritical 0 bits but in practice zlib wants 1 bit*/ + if (numpresent == 0) + { + lengths[0] = lengths[1] = + 1; /*note that for RFC 1951 section 3.2.7, only lengths[0] = 1 is needed*/ + } + else if (numpresent == 1) + { + for (i = 0; i < numcodes; i++) + { + if (frequencies[i]) + { + lengths[i] = 1; + lengths[i == 0 ? 1 : 0] = 1; + break; + } + } + } + else + { + /*Package-Merge algorithm represented by coin collector's problem + For every symbol, maxbitlen coins will be created*/ - coinmem = numpresent * 2; /*max amount of coins needed with the current algo*/ - coins = (Coin*)calloc(sizeof(Coin), coinmem); - prev_row = (Coin*)calloc(sizeof(Coin), coinmem); - if(!coins || !prev_row) - { - free(coins); - free(prev_row); - return 83; /*alloc fail*/ - } - init_coins(coins, coinmem); - init_coins(prev_row, coinmem); + coinmem = numpresent * 2; /*max amount of coins needed with the current algo*/ + coins = (Coin*)calloc(sizeof(Coin), coinmem); + prev_row = (Coin*)calloc(sizeof(Coin), coinmem); + if (!coins || !prev_row) + { + free(coins); + free(prev_row); + return 83; /*alloc fail*/ + } + init_coins(coins, coinmem); + init_coins(prev_row, coinmem); - /*first row, lowest denominator*/ - error = append_symbol_coins(coins, frequencies, numcodes, sum); - numcoins = numpresent; - qsort(coins, numcoins, sizeof(Coin), coin_compare); - if(!error) - { - unsigned numprev = 0; - for(j = 1; j <= maxbitlen && !error; j++) /*each of the remaining rows*/ - { - unsigned tempnum; - Coin* tempcoins; - /*swap prev_row and coins, and their amounts*/ - tempcoins = prev_row; prev_row = coins; coins = tempcoins; - tempnum = numprev; numprev = numcoins; numcoins = tempnum; + /*first row, lowest denominator*/ + error = append_symbol_coins(coins, frequencies, numcodes, sum); + numcoins = numpresent; + qsort(coins, numcoins, sizeof(Coin), coin_compare); + if (!error) + { + unsigned numprev = 0; + for (j = 1; j <= maxbitlen && !error; j++) /*each of the remaining rows*/ + { + unsigned tempnum; + Coin* tempcoins; + /*swap prev_row and coins, and their amounts*/ + tempcoins = prev_row; + prev_row = coins; + coins = tempcoins; + tempnum = numprev; + numprev = numcoins; + numcoins = tempnum; - cleanup_coins(coins, numcoins); - init_coins(coins, numcoins); + cleanup_coins(coins, numcoins); + init_coins(coins, numcoins); - numcoins = 0; + numcoins = 0; - /*fill in the merged coins of the previous row*/ - for(i = 0; i + 1 < numprev; i += 2) - { - /*merge prev_row[i] and prev_row[i + 1] into new coin*/ - Coin* coin = &coins[numcoins++]; - coin_copy(coin, &prev_row[i]); - add_coins(coin, &prev_row[i + 1]); - } - /*fill in all the original symbols again*/ - if(j < maxbitlen) - { - error = append_symbol_coins(coins + numcoins, frequencies, numcodes, sum); - numcoins += numpresent; - } - qsort(coins, numcoins, sizeof(Coin), coin_compare); - } - } + /*fill in the merged coins of the previous row*/ + for (i = 0; i + 1 < numprev; i += 2) + { + /*merge prev_row[i] and prev_row[i + 1] into new coin*/ + Coin* coin = &coins[numcoins++]; + coin_copy(coin, &prev_row[i]); + add_coins(coin, &prev_row[i + 1]); + } + /*fill in all the original symbols again*/ + if (j < maxbitlen) + { + error = append_symbol_coins(coins + numcoins, frequencies, numcodes, sum); + numcoins += numpresent; + } + qsort(coins, numcoins, sizeof(Coin), coin_compare); + } + } - if(!error) - { - /*calculate the lenghts of each symbol, as the amount of times a coin of each symbol is used*/ - for(i = 0; i < numpresent - 1; i++) - { - Coin* coin = &coins[i]; - for(j = 0; j < coin->symbols.size; j++) lengths[coin->symbols.data[j]]++; - } - } + if (!error) + { + /*calculate the lenghts of each symbol, as the amount of times a coin of each symbol is + * used*/ + for (i = 0; i < numpresent - 1; i++) + { + Coin* coin = &coins[i]; + for (j = 0; j < coin->symbols.size; j++) + lengths[coin->symbols.data[j]]++; + } + } - cleanup_coins(coins, coinmem); - free(coins); - cleanup_coins(prev_row, coinmem); - free(prev_row); - } + cleanup_coins(coins, coinmem); + free(coins); + cleanup_coins(prev_row, coinmem); + free(prev_row); + } - return error; + return error; } /*Create the Huffman tree given the symbol frequencies*/ static unsigned HuffmanTree_makeFromFrequencies(HuffmanTree* tree, const unsigned* frequencies, - size_t mincodes, size_t numcodes, unsigned maxbitlen) + size_t mincodes, size_t numcodes, + unsigned maxbitlen) { unsigned* lengths; - unsigned error = 0; - while(!frequencies[numcodes - 1] && numcodes > mincodes) numcodes--; /*trim zeroes*/ - tree->maxbitlen = maxbitlen; - tree->numcodes = (unsigned)numcodes; /*number of symbols*/ - lengths = (unsigned*)realloc(tree->lengths, numcodes * sizeof(unsigned)); + unsigned error = 0; + while (!frequencies[numcodes - 1] && numcodes > mincodes) + numcodes--; /*trim zeroes*/ + tree->maxbitlen = maxbitlen; + tree->numcodes = (unsigned)numcodes; /*number of symbols*/ + lengths = (unsigned*)realloc(tree->lengths, numcodes * sizeof(unsigned)); if (!lengths) free(tree->lengths); tree->lengths = lengths; - if(!tree->lengths) return 83; /*alloc fail*/ - /*initialize all lengths to 0*/ - memset(tree->lengths, 0, numcodes * sizeof(unsigned)); + if (!tree->lengths) + return 83; /*alloc fail*/ + /*initialize all lengths to 0*/ + memset(tree->lengths, 0, numcodes * sizeof(unsigned)); - error = lodepng_huffman_code_lengths(tree->lengths, frequencies, numcodes, maxbitlen); - if(!error) error = HuffmanTree_makeFromLengths2(tree); - return error; + error = lodepng_huffman_code_lengths(tree->lengths, frequencies, numcodes, maxbitlen); + if (!error) + error = HuffmanTree_makeFromLengths2(tree); + return error; } static unsigned HuffmanTree_getCode(const HuffmanTree* tree, unsigned index) { - return tree->tree1d[index]; + return tree->tree1d[index]; } static unsigned HuffmanTree_getLength(const HuffmanTree* tree, unsigned index) { - return tree->lengths[index]; + return tree->lengths[index]; } #endif /*LODEPNG_COMPILE_ENCODER*/ -/*get the literal and length code tree of a deflated block with fixed tree, as per the deflate specification*/ +/*get the literal and length code tree of a deflated block with fixed tree, as per the deflate + * specification*/ static unsigned generateFixedLitLenTree(HuffmanTree* tree) { - unsigned i, error = 0; - unsigned* bitlen = (unsigned*)calloc(NUM_DEFLATE_CODE_SYMBOLS, sizeof(unsigned)); - if(!bitlen) return 83; /*alloc fail*/ + unsigned i, error = 0; + unsigned* bitlen = (unsigned*)calloc(NUM_DEFLATE_CODE_SYMBOLS, sizeof(unsigned)); + if (!bitlen) + return 83; /*alloc fail*/ - /*288 possible codes: 0-255=literals, 256=endcode, 257-285=lengthcodes, 286-287=unused*/ - for(i = 0; i <= 143; i++) bitlen[i] = 8; - for(i = 144; i <= 255; i++) bitlen[i] = 9; - for(i = 256; i <= 279; i++) bitlen[i] = 7; - for(i = 280; i <= 287; i++) bitlen[i] = 8; + /*288 possible codes: 0-255=literals, 256=endcode, 257-285=lengthcodes, 286-287=unused*/ + for (i = 0; i <= 143; i++) + bitlen[i] = 8; + for (i = 144; i <= 255; i++) + bitlen[i] = 9; + for (i = 256; i <= 279; i++) + bitlen[i] = 7; + for (i = 280; i <= 287; i++) + bitlen[i] = 8; - error = HuffmanTree_makeFromLengths(tree, bitlen, NUM_DEFLATE_CODE_SYMBOLS, 15); + error = HuffmanTree_makeFromLengths(tree, bitlen, NUM_DEFLATE_CODE_SYMBOLS, 15); - free(bitlen); - return error; + free(bitlen); + return error; } -/*get the distance code tree of a deflated block with fixed tree, as specified in the deflate specification*/ +/*get the distance code tree of a deflated block with fixed tree, as specified in the deflate + * specification*/ static unsigned generateFixedDistanceTree(HuffmanTree* tree) { - unsigned i, error = 0; - unsigned* bitlen = (unsigned*)malloc(NUM_DISTANCE_SYMBOLS * sizeof(unsigned)); - if(!bitlen) return 83; /*alloc fail*/ + unsigned i, error = 0; + unsigned* bitlen = (unsigned*)malloc(NUM_DISTANCE_SYMBOLS * sizeof(unsigned)); + if (!bitlen) + return 83; /*alloc fail*/ - /*there are 32 distance codes, but 30-31 are unused*/ - for(i = 0; i < NUM_DISTANCE_SYMBOLS; i++) bitlen[i] = 5; - error = HuffmanTree_makeFromLengths(tree, bitlen, NUM_DISTANCE_SYMBOLS, 15); + /*there are 32 distance codes, but 30-31 are unused*/ + for (i = 0; i < NUM_DISTANCE_SYMBOLS; i++) + bitlen[i] = 5; + error = HuffmanTree_makeFromLengths(tree, bitlen, NUM_DISTANCE_SYMBOLS, 15); - free(bitlen); - return error; + free(bitlen); + return error; } #ifdef LODEPNG_COMPILE_DECODER @@ -913,24 +981,29 @@ inbitlength is the length of the complete buffer, in bits (so its byte length ti static unsigned huffmanDecodeSymbol(const unsigned char* in, size_t* bp, const HuffmanTree* codetree, size_t inbitlength) { - unsigned treepos = 0, ct; - if (!codetree || !codetree->tree2d) - return 0; + unsigned treepos = 0, ct; + if (!codetree || !codetree->tree2d) + return 0; - for(;;) - { - if(*bp >= inbitlength) return (unsigned)(-1); /*error: end of input memory reached without endcode*/ - /* - decode the symbol from the tree. The "readBitFromStream" code is inlined in - the expression below because this is the biggest bottleneck while decoding - */ - ct = codetree->tree2d[(treepos << 1) + READBIT(*bp, in)]; - (*bp)++; - if(ct < codetree->numcodes) return ct; /*the symbol is decoded, return it*/ - else treepos = ct - codetree->numcodes; /*symbol not yet decoded, instead move tree position*/ + for (;;) + { + if (*bp >= inbitlength) + return (unsigned)(-1); /*error: end of input memory reached without endcode*/ + /* + decode the symbol from the tree. The "readBitFromStream" code is inlined in + the expression below because this is the biggest bottleneck while decoding + */ + ct = codetree->tree2d[(treepos << 1) + READBIT(*bp, in)]; + (*bp)++; + if (ct < codetree->numcodes) + return ct; /*the symbol is decoded, return it*/ + else + treepos = + ct - codetree->numcodes; /*symbol not yet decoded, instead move tree position*/ - if(treepos >= codetree->numcodes) return (unsigned)(-1); /*error: it appeared outside the codetree*/ - } + if (treepos >= codetree->numcodes) + return (unsigned)(-1); /*error: it appeared outside the codetree*/ + } } #endif /*LODEPNG_COMPILE_DECODER*/ @@ -943,346 +1016,410 @@ static unsigned huffmanDecodeSymbol(const unsigned char* in, size_t* bp, /*get the tree of a deflated block with fixed tree, as specified in the deflate specification*/ static int getTreeInflateFixed(HuffmanTree* tree_ll, HuffmanTree* tree_d) { - int rc; + int rc; - rc = generateFixedLitLenTree(tree_ll); - if (rc) return rc; - return generateFixedDistanceTree(tree_d); + rc = generateFixedLitLenTree(tree_ll); + if (rc) + return rc; + return generateFixedDistanceTree(tree_d); } -/*get the tree of a deflated block with dynamic tree, the tree itself is also Huffman compressed with a known tree*/ +/*get the tree of a deflated block with dynamic tree, the tree itself is also Huffman compressed + * with a known tree*/ static unsigned getTreeInflateDynamic(HuffmanTree* tree_ll, HuffmanTree* tree_d, const unsigned char* in, size_t* bp, size_t inlength) { - /*make sure that length values that aren't filled in will be 0, or a wrong tree will be generated*/ - unsigned error = 0; - unsigned n, HLIT, HDIST, HCLEN, i; - size_t inbitlength = inlength * 8; + /*make sure that length values that aren't filled in will be 0, or a wrong tree will be + * generated*/ + unsigned error = 0; + unsigned n, HLIT, HDIST, HCLEN, i; + size_t inbitlength = inlength * 8; - /*see comments in deflateDynamic for explanation of the context and these variables, it is analogous*/ - unsigned* bitlen_ll = 0; /*lit,len code lengths*/ - unsigned* bitlen_d = 0; /*dist code lengths*/ - /*code length code lengths ("clcl"), the bit lengths of the huffman tree used to compress bitlen_ll and bitlen_d*/ - unsigned* bitlen_cl = 0; - HuffmanTree tree_cl; /*the code tree for code length codes (the huffman tree for compressed huffman trees)*/ + /*see comments in deflateDynamic for explanation of the context and these variables, it is + * analogous*/ + unsigned* bitlen_ll = 0; /*lit,len code lengths*/ + unsigned* bitlen_d = 0; /*dist code lengths*/ + /*code length code lengths ("clcl"), the bit lengths of the huffman tree used to compress + * bitlen_ll and bitlen_d*/ + unsigned* bitlen_cl = 0; + HuffmanTree tree_cl; /*the code tree for code length codes (the huffman tree for compressed + huffman trees)*/ - if((*bp) >> 3 >= inlength - 2) return 49; /*error: the bit pointer is or will go past the memory*/ + if ((*bp) >> 3 >= inlength - 2) + return 49; /*error: the bit pointer is or will go past the memory*/ - /*number of literal/length codes + 257. Unlike the spec, the value 257 is added to it here already*/ - HLIT = readBitsFromStream(bp, in, 5) + 257; - /*number of distance codes. Unlike the spec, the value 1 is added to it here already*/ - HDIST = readBitsFromStream(bp, in, 5) + 1; - /*number of code length codes. Unlike the spec, the value 4 is added to it here already*/ - HCLEN = readBitsFromStream(bp, in, 4) + 4; + /*number of literal/length codes + 257. Unlike the spec, the value 257 is added to it here + * already*/ + HLIT = readBitsFromStream(bp, in, 5) + 257; + /*number of distance codes. Unlike the spec, the value 1 is added to it here already*/ + HDIST = readBitsFromStream(bp, in, 5) + 1; + /*number of code length codes. Unlike the spec, the value 4 is added to it here already*/ + HCLEN = readBitsFromStream(bp, in, 4) + 4; - HuffmanTree_init(&tree_cl); + HuffmanTree_init(&tree_cl); - while(!error) - { - /*read the code length codes out of 3 * (amount of code length codes) bits*/ + while (!error) + { + /*read the code length codes out of 3 * (amount of code length codes) bits*/ - bitlen_cl = (unsigned*)malloc(NUM_CODE_LENGTH_CODES * sizeof(unsigned)); - if(!bitlen_cl) ERROR_BREAK(83 /*alloc fail*/); + bitlen_cl = (unsigned*)malloc(NUM_CODE_LENGTH_CODES * sizeof(unsigned)); + if (!bitlen_cl) + ERROR_BREAK(83 /*alloc fail*/); - for(i = 0; i < NUM_CODE_LENGTH_CODES; i++) - { - if(i < HCLEN) bitlen_cl[CLCL_ORDER[i]] = readBitsFromStream(bp, in, 3); - else bitlen_cl[CLCL_ORDER[i]] = 0; /*if not, it must stay 0*/ - } + for (i = 0; i < NUM_CODE_LENGTH_CODES; i++) + { + if (i < HCLEN) + bitlen_cl[CLCL_ORDER[i]] = readBitsFromStream(bp, in, 3); + else + bitlen_cl[CLCL_ORDER[i]] = 0; /*if not, it must stay 0*/ + } - error = HuffmanTree_makeFromLengths(&tree_cl, bitlen_cl, NUM_CODE_LENGTH_CODES, 7); - if(error) break; + error = HuffmanTree_makeFromLengths(&tree_cl, bitlen_cl, NUM_CODE_LENGTH_CODES, 7); + if (error) + break; - /*now we can use this tree to read the lengths for the tree that this function will return*/ - bitlen_ll = (unsigned*)malloc(NUM_DEFLATE_CODE_SYMBOLS * sizeof(unsigned)); - bitlen_d = (unsigned*)malloc(NUM_DISTANCE_SYMBOLS * sizeof(unsigned)); - if(!bitlen_ll || !bitlen_d) ERROR_BREAK(83 /*alloc fail*/); - for(i = 0; i < NUM_DEFLATE_CODE_SYMBOLS; i++) bitlen_ll[i] = 0; - for(i = 0; i < NUM_DISTANCE_SYMBOLS; i++) bitlen_d[i] = 0; + /*now we can use this tree to read the lengths for the tree that this function will return*/ + bitlen_ll = (unsigned*)malloc(NUM_DEFLATE_CODE_SYMBOLS * sizeof(unsigned)); + bitlen_d = (unsigned*)malloc(NUM_DISTANCE_SYMBOLS * sizeof(unsigned)); + if (!bitlen_ll || !bitlen_d) + ERROR_BREAK(83 /*alloc fail*/); + for (i = 0; i < NUM_DEFLATE_CODE_SYMBOLS; i++) + bitlen_ll[i] = 0; + for (i = 0; i < NUM_DISTANCE_SYMBOLS; i++) + bitlen_d[i] = 0; - /*i is the current symbol we're reading in the part that contains the code lengths of lit/len and dist codes*/ - i = 0; - while(i < HLIT + HDIST) - { - unsigned code = huffmanDecodeSymbol(in, bp, &tree_cl, inbitlength); - if(code <= 15) /*a length code*/ - { - if(i < HLIT) bitlen_ll[i] = code; - else bitlen_d[i - HLIT] = code; - i++; - } - else if(code == 16) /*repeat previous*/ - { - unsigned replength = 3; /*read in the 2 bits that indicate repeat length (3-6)*/ - unsigned value; /*set value to the previous code*/ + /*i is the current symbol we're reading in the part that contains the code lengths of + * lit/len and dist codes*/ + i = 0; + while (i < HLIT + HDIST) + { + unsigned code = huffmanDecodeSymbol(in, bp, &tree_cl, inbitlength); + if (code <= 15) /*a length code*/ + { + if (i < HLIT) + bitlen_ll[i] = code; + else + bitlen_d[i - HLIT] = code; + i++; + } + else if (code == 16) /*repeat previous*/ + { + unsigned replength = 3; /*read in the 2 bits that indicate repeat length (3-6)*/ + unsigned value; /*set value to the previous code*/ - if(*bp >= inbitlength) ERROR_BREAK(50); /*error, bit pointer jumps past memory*/ - if (i == 0) ERROR_BREAK(54); /*can't repeat previous if i is 0*/ + if (*bp >= inbitlength) + ERROR_BREAK(50); /*error, bit pointer jumps past memory*/ + if (i == 0) + ERROR_BREAK(54); /*can't repeat previous if i is 0*/ - replength += readBitsFromStream(bp, in, 2); + replength += readBitsFromStream(bp, in, 2); - if(i < HLIT + 1) value = bitlen_ll[i - 1]; - else value = bitlen_d[i - HLIT - 1]; - /*repeat this value in the next lengths*/ - for(n = 0; n < replength; n++) - { - if(i >= HLIT + HDIST) ERROR_BREAK(13); /*error: i is larger than the amount of codes*/ - if(i < HLIT) bitlen_ll[i] = value; - else bitlen_d[i - HLIT] = value; - i++; - } - } - else if(code == 17) /*repeat "0" 3-10 times*/ - { - unsigned replength = 3; /*read in the bits that indicate repeat length*/ - if(*bp >= inbitlength) ERROR_BREAK(50); /*error, bit pointer jumps past memory*/ + if (i < HLIT + 1) + value = bitlen_ll[i - 1]; + else + value = bitlen_d[i - HLIT - 1]; + /*repeat this value in the next lengths*/ + for (n = 0; n < replength; n++) + { + if (i >= HLIT + HDIST) + ERROR_BREAK(13); /*error: i is larger than the amount of codes*/ + if (i < HLIT) + bitlen_ll[i] = value; + else + bitlen_d[i - HLIT] = value; + i++; + } + } + else if (code == 17) /*repeat "0" 3-10 times*/ + { + unsigned replength = 3; /*read in the bits that indicate repeat length*/ + if (*bp >= inbitlength) + ERROR_BREAK(50); /*error, bit pointer jumps past memory*/ - replength += readBitsFromStream(bp, in, 3); + replength += readBitsFromStream(bp, in, 3); - /*repeat this value in the next lengths*/ - for(n = 0; n < replength; n++) - { - if(i >= HLIT + HDIST) ERROR_BREAK(14); /*error: i is larger than the amount of codes*/ + /*repeat this value in the next lengths*/ + for (n = 0; n < replength; n++) + { + if (i >= HLIT + HDIST) + ERROR_BREAK(14); /*error: i is larger than the amount of codes*/ - if(i < HLIT) bitlen_ll[i] = 0; - else bitlen_d[i - HLIT] = 0; - i++; - } - } - else if(code == 18) /*repeat "0" 11-138 times*/ - { - unsigned replength = 11; /*read in the bits that indicate repeat length*/ - if(*bp >= inbitlength) ERROR_BREAK(50); /*error, bit pointer jumps past memory*/ + if (i < HLIT) + bitlen_ll[i] = 0; + else + bitlen_d[i - HLIT] = 0; + i++; + } + } + else if (code == 18) /*repeat "0" 11-138 times*/ + { + unsigned replength = 11; /*read in the bits that indicate repeat length*/ + if (*bp >= inbitlength) + ERROR_BREAK(50); /*error, bit pointer jumps past memory*/ - replength += readBitsFromStream(bp, in, 7); + replength += readBitsFromStream(bp, in, 7); - /*repeat this value in the next lengths*/ - for(n = 0; n < replength; n++) - { - if(i >= HLIT + HDIST) ERROR_BREAK(15); /*error: i is larger than the amount of codes*/ + /*repeat this value in the next lengths*/ + for (n = 0; n < replength; n++) + { + if (i >= HLIT + HDIST) + ERROR_BREAK(15); /*error: i is larger than the amount of codes*/ - if(i < HLIT) bitlen_ll[i] = 0; - else bitlen_d[i - HLIT] = 0; - i++; - } - } - else /*if(code == (unsigned)(-1))*/ /*huffmanDecodeSymbol returns (unsigned)(-1) in case of error*/ - { - if(code == (unsigned)(-1)) - { - /*return error code 10 or 11 depending on the situation that happened in huffmanDecodeSymbol - (10=no endcode, 11=wrong jump outside of tree)*/ - error = (*bp) > inbitlength ? 10 : 11; - } - else error = 16; /*unexisting code, this can never happen*/ - break; - } - } - if(error) break; + if (i < HLIT) + bitlen_ll[i] = 0; + else + bitlen_d[i - HLIT] = 0; + i++; + } + } + else /*if(code == (unsigned)(-1))*/ /*huffmanDecodeSymbol returns (unsigned)(-1) in case + of error*/ + { + if (code == (unsigned)(-1)) + { + /*return error code 10 or 11 depending on the situation that happened in + huffmanDecodeSymbol (10=no endcode, 11=wrong jump outside of tree)*/ + error = (*bp) > inbitlength ? 10 : 11; + } + else + error = 16; /*unexisting code, this can never happen*/ + break; + } + } + if (error) + break; - if(bitlen_ll[256] == 0) ERROR_BREAK(64); /*the length of the end code 256 must be larger than 0*/ + if (bitlen_ll[256] == 0) + ERROR_BREAK(64); /*the length of the end code 256 must be larger than 0*/ - /*now we've finally got HLIT and HDIST, so generate the code trees, and the function is done*/ - error = HuffmanTree_makeFromLengths(tree_ll, bitlen_ll, NUM_DEFLATE_CODE_SYMBOLS, 15); - if(error) break; - error = HuffmanTree_makeFromLengths(tree_d, bitlen_d, NUM_DISTANCE_SYMBOLS, 15); + /*now we've finally got HLIT and HDIST, so generate the code trees, and the function is + * done*/ + error = HuffmanTree_makeFromLengths(tree_ll, bitlen_ll, NUM_DEFLATE_CODE_SYMBOLS, 15); + if (error) + break; + error = HuffmanTree_makeFromLengths(tree_d, bitlen_d, NUM_DISTANCE_SYMBOLS, 15); - break; /*end of error-while*/ - } + break; /*end of error-while*/ + } - free(bitlen_cl); - free(bitlen_ll); - free(bitlen_d); - HuffmanTree_cleanup(&tree_cl); + free(bitlen_cl); + free(bitlen_ll); + free(bitlen_d); + HuffmanTree_cleanup(&tree_cl); - return error; + return error; } /*inflate a block with dynamic of fixed Huffman tree*/ -static unsigned inflateHuffmanBlock(ucvector* out, const unsigned char* in, size_t* bp, - size_t* pos, size_t inlength, unsigned btype) +static unsigned inflateHuffmanBlock(ucvector* out, const unsigned char* in, size_t* bp, size_t* pos, + size_t inlength, unsigned btype) { - unsigned error = 0; - HuffmanTree tree_ll; /*the huffman tree for literal and length codes*/ - HuffmanTree tree_d; /*the huffman tree for distance codes*/ - size_t inbitlength = inlength * 8; + unsigned error = 0; + HuffmanTree tree_ll; /*the huffman tree for literal and length codes*/ + HuffmanTree tree_d; /*the huffman tree for distance codes*/ + size_t inbitlength = inlength * 8; - HuffmanTree_init(&tree_ll); - HuffmanTree_init(&tree_d); + HuffmanTree_init(&tree_ll); + HuffmanTree_init(&tree_d); - if(btype == 1) - { - error = getTreeInflateFixed(&tree_ll, &tree_d); - if (error) - { - HuffmanTree_cleanup(&tree_ll); - HuffmanTree_cleanup(&tree_d); - return error; - } - } - else if(btype == 2) error = getTreeInflateDynamic(&tree_ll, &tree_d, in, bp, inlength); + if (btype == 1) + { + error = getTreeInflateFixed(&tree_ll, &tree_d); + if (error) + { + HuffmanTree_cleanup(&tree_ll); + HuffmanTree_cleanup(&tree_d); + return error; + } + } + else if (btype == 2) + error = getTreeInflateDynamic(&tree_ll, &tree_d, in, bp, inlength); - while(!error) /*decode all symbols until end reached, breaks at end code*/ - { - /*code_ll is literal, length or end code*/ - unsigned code_ll = huffmanDecodeSymbol(in, bp, &tree_ll, inbitlength); - if(code_ll <= 255) /*literal symbol*/ - { - /*ucvector_push_back would do the same, but for some reason the two lines below run 10% faster*/ - if(!ucvector_resize(out, (*pos) + 1)) ERROR_BREAK(83 /*alloc fail*/); - out->data[*pos] = (unsigned char)code_ll; - (*pos)++; - } - else if(code_ll >= FIRST_LENGTH_CODE_INDEX && code_ll <= LAST_LENGTH_CODE_INDEX) /*length code*/ - { - unsigned code_d, distance; - unsigned numextrabits_l, numextrabits_d; /*extra bits for length and distance*/ - size_t start, forward, backward, length; + while (!error) /*decode all symbols until end reached, breaks at end code*/ + { + /*code_ll is literal, length or end code*/ + unsigned code_ll = huffmanDecodeSymbol(in, bp, &tree_ll, inbitlength); + if (code_ll <= 255) /*literal symbol*/ + { + /*ucvector_push_back would do the same, but for some reason the two lines below run 10% + * faster*/ + if (!ucvector_resize(out, (*pos) + 1)) + ERROR_BREAK(83 /*alloc fail*/); + out->data[*pos] = (unsigned char)code_ll; + (*pos)++; + } + else if (code_ll >= FIRST_LENGTH_CODE_INDEX && + code_ll <= LAST_LENGTH_CODE_INDEX) /*length code*/ + { + unsigned code_d, distance; + unsigned numextrabits_l, numextrabits_d; /*extra bits for length and distance*/ + size_t start, forward, backward, length; - /*part 1: get length base*/ - length = LENGTHBASE[code_ll - FIRST_LENGTH_CODE_INDEX]; + /*part 1: get length base*/ + length = LENGTHBASE[code_ll - FIRST_LENGTH_CODE_INDEX]; - /*part 2: get extra bits and add the value of that to length*/ - numextrabits_l = LENGTHEXTRA[code_ll - FIRST_LENGTH_CODE_INDEX]; - if(*bp >= inbitlength) ERROR_BREAK(51); /*error, bit pointer will jump past memory*/ - length += readBitsFromStream(bp, in, numextrabits_l); + /*part 2: get extra bits and add the value of that to length*/ + numextrabits_l = LENGTHEXTRA[code_ll - FIRST_LENGTH_CODE_INDEX]; + if (*bp >= inbitlength) + ERROR_BREAK(51); /*error, bit pointer will jump past memory*/ + length += readBitsFromStream(bp, in, numextrabits_l); - /*part 3: get distance code*/ - code_d = huffmanDecodeSymbol(in, bp, &tree_d, inbitlength); - if(code_d > 29) - { - if(code_ll == (unsigned)(-1)) /*huffmanDecodeSymbol returns (unsigned)(-1) in case of error*/ - { - /*return error code 10 or 11 depending on the situation that happened in huffmanDecodeSymbol - (10=no endcode, 11=wrong jump outside of tree)*/ - error = (*bp) > inlength * 8 ? 10 : 11; - } - else error = 18; /*error: invalid distance code (30-31 are never used)*/ - break; - } - distance = DISTANCEBASE[code_d]; + /*part 3: get distance code*/ + code_d = huffmanDecodeSymbol(in, bp, &tree_d, inbitlength); + if (code_d > 29) + { + if (code_ll == + (unsigned)(-1)) /*huffmanDecodeSymbol returns (unsigned)(-1) in case of error*/ + { + /*return error code 10 or 11 depending on the situation that happened in + huffmanDecodeSymbol (10=no endcode, 11=wrong jump outside of tree)*/ + error = (*bp) > inlength * 8 ? 10 : 11; + } + else + error = 18; /*error: invalid distance code (30-31 are never used)*/ + break; + } + distance = DISTANCEBASE[code_d]; - /*part 4: get extra bits from distance*/ - numextrabits_d = DISTANCEEXTRA[code_d]; - if(*bp >= inbitlength) ERROR_BREAK(51); /*error, bit pointer will jump past memory*/ + /*part 4: get extra bits from distance*/ + numextrabits_d = DISTANCEEXTRA[code_d]; + if (*bp >= inbitlength) + ERROR_BREAK(51); /*error, bit pointer will jump past memory*/ - distance += readBitsFromStream(bp, in, numextrabits_d); + distance += readBitsFromStream(bp, in, numextrabits_d); - /*part 5: fill in all the out[n] values based on the length and dist*/ - start = (*pos); - if(distance > start) ERROR_BREAK(52); /*too long backward distance*/ - backward = start - distance; + /*part 5: fill in all the out[n] values based on the length and dist*/ + start = (*pos); + if (distance > start) + ERROR_BREAK(52); /*too long backward distance*/ + backward = start - distance; - if(!ucvector_resize(out, (*pos) + length)) ERROR_BREAK(83 /*alloc fail*/); - for(forward = 0; forward < length; forward++) - { - out->data[(*pos)] = out->data[backward]; - (*pos)++; - backward++; - if(backward >= start) backward = start - distance; - } - } - else if(code_ll == 256) - { - break; /*end code, break the loop*/ - } - else /*if(code == (unsigned)(-1))*/ /*huffmanDecodeSymbol returns (unsigned)(-1) in case of error*/ - { - /*return error code 10 or 11 depending on the situation that happened in huffmanDecodeSymbol - (10=no endcode, 11=wrong jump outside of tree)*/ - error = (*bp) > inlength * 8 ? 10 : 11; - break; - } - } + if (!ucvector_resize(out, (*pos) + length)) + ERROR_BREAK(83 /*alloc fail*/); + for (forward = 0; forward < length; forward++) + { + out->data[(*pos)] = out->data[backward]; + (*pos)++; + backward++; + if (backward >= start) + backward = start - distance; + } + } + else if (code_ll == 256) + { + break; /*end code, break the loop*/ + } + else /*if(code == (unsigned)(-1))*/ /*huffmanDecodeSymbol returns (unsigned)(-1) in case of + error*/ + { + /*return error code 10 or 11 depending on the situation that happened in + huffmanDecodeSymbol (10=no endcode, 11=wrong jump outside of tree)*/ + error = (*bp) > inlength * 8 ? 10 : 11; + break; + } + } - HuffmanTree_cleanup(&tree_ll); - HuffmanTree_cleanup(&tree_d); + HuffmanTree_cleanup(&tree_ll); + HuffmanTree_cleanup(&tree_d); - return error; + return error; } -static unsigned inflateNoCompression(ucvector* out, const unsigned char* in, size_t* bp, size_t* pos, size_t inlength) +static unsigned inflateNoCompression(ucvector* out, const unsigned char* in, size_t* bp, + size_t* pos, size_t inlength) { - /*go to first boundary of byte*/ - size_t p; - unsigned LEN, NLEN, n, error = 0; - while(((*bp) & 0x7) != 0) (*bp)++; - p = (*bp) / 8; /*byte position*/ + /*go to first boundary of byte*/ + size_t p; + unsigned LEN, NLEN, n, error = 0; + while (((*bp) & 0x7) != 0) + (*bp)++; + p = (*bp) / 8; /*byte position*/ - /*read LEN (2 bytes) and NLEN (2 bytes)*/ - if(p >= inlength - 4) return 52; /*error, bit pointer will jump past memory*/ - LEN = in[p] + 256u * in[p + 1]; p += 2; - NLEN = in[p] + 256u * in[p + 1]; p += 2; + /*read LEN (2 bytes) and NLEN (2 bytes)*/ + if (p >= inlength - 4) + return 52; /*error, bit pointer will jump past memory*/ + LEN = in[p] + 256u * in[p + 1]; + p += 2; + NLEN = in[p] + 256u * in[p + 1]; + p += 2; - /*check if 16-bit NLEN is really the one's complement of LEN*/ - if(LEN + NLEN != 65535) return 21; /*error: NLEN is not one's complement of LEN*/ + /*check if 16-bit NLEN is really the one's complement of LEN*/ + if (LEN + NLEN != 65535) + return 21; /*error: NLEN is not one's complement of LEN*/ - if(!ucvector_resize(out, (*pos) + LEN)) return 83; /*alloc fail*/ + if (!ucvector_resize(out, (*pos) + LEN)) + return 83; /*alloc fail*/ - /*read the literal data: LEN bytes are now stored in the out buffer*/ - if(p + LEN > inlength) return 23; /*error: reading outside of in buffer*/ - for(n = 0; n < LEN; n++) out->data[(*pos)++] = in[p++]; + /*read the literal data: LEN bytes are now stored in the out buffer*/ + if (p + LEN > inlength) + return 23; /*error: reading outside of in buffer*/ + for (n = 0; n < LEN; n++) + out->data[(*pos)++] = in[p++]; - (*bp) = p * 8; + (*bp) = p * 8; - return error; + return error; } -static unsigned lodepng_inflatev(ucvector* out, - const unsigned char* in, size_t insize, +static unsigned lodepng_inflatev(ucvector* out, const unsigned char* in, size_t insize, const LodePNGDecompressSettings* settings) { - /*bit pointer in the "in" data, current byte is bp >> 3, current bit is bp & 0x7 (from lsb to msb of the byte)*/ - size_t bp = 0; - unsigned BFINAL = 0; - size_t pos = 0; /*byte position in the out buffer*/ - unsigned error = 0; + /*bit pointer in the "in" data, current byte is bp >> 3, current bit is bp & 0x7 (from lsb to + * msb of the byte)*/ + size_t bp = 0; + unsigned BFINAL = 0; + size_t pos = 0; /*byte position in the out buffer*/ + unsigned error = 0; - (void)settings; + (void)settings; - while(!BFINAL) - { - unsigned BTYPE; - if(bp + 2 >= insize * 8) return 52; /*error, bit pointer will jump past memory*/ - BFINAL = readBitFromStream(&bp, in); - BTYPE = 1u * readBitFromStream(&bp, in); - BTYPE += 2u * readBitFromStream(&bp, in); + while (!BFINAL) + { + unsigned BTYPE; + if (bp + 2 >= insize * 8) + return 52; /*error, bit pointer will jump past memory*/ + BFINAL = readBitFromStream(&bp, in); + BTYPE = 1u * readBitFromStream(&bp, in); + BTYPE += 2u * readBitFromStream(&bp, in); - if(BTYPE == 3) return 20; /*error: invalid BTYPE*/ - else if(BTYPE == 0) error = inflateNoCompression(out, in, &bp, &pos, insize); /*no compression*/ - else error = inflateHuffmanBlock(out, in, &bp, &pos, insize, BTYPE); /*compression, BTYPE 01 or 10*/ + if (BTYPE == 3) + return 20; /*error: invalid BTYPE*/ + else if (BTYPE == 0) + error = inflateNoCompression(out, in, &bp, &pos, insize); /*no compression*/ + else + error = inflateHuffmanBlock(out, in, &bp, &pos, insize, + BTYPE); /*compression, BTYPE 01 or 10*/ - if(error) return error; - } + if (error) + return error; + } - return error; + return error; } -unsigned lodepng_inflate(unsigned char** out, size_t* outsize, - const unsigned char* in, size_t insize, - const LodePNGDecompressSettings* settings) +unsigned lodepng_inflate(unsigned char** out, size_t* outsize, const unsigned char* in, + size_t insize, const LodePNGDecompressSettings* settings) { - unsigned error; - ucvector v; - ucvector_init_buffer(&v, *out, *outsize); - error = lodepng_inflatev(&v, in, insize, settings); - *out = v.data; - *outsize = v.size; - return error; + unsigned error; + ucvector v; + ucvector_init_buffer(&v, *out, *outsize); + error = lodepng_inflatev(&v, in, insize, settings); + *out = v.data; + *outsize = v.size; + return error; } -static unsigned inflate(unsigned char** out, size_t* outsize, - const unsigned char* in, size_t insize, - const LodePNGDecompressSettings* settings) +static unsigned inflate(unsigned char** out, size_t* outsize, const unsigned char* in, + size_t insize, const LodePNGDecompressSettings* settings) { - if(settings->custom_inflate) - { - return settings->custom_inflate(out, outsize, in, insize, settings); - } - else - { - return lodepng_inflate(out, outsize, in, insize, settings); - } + if (settings->custom_inflate) + { + return settings->custom_inflate(out, outsize, in, insize, settings); + } + else + { + return lodepng_inflate(out, outsize, in, insize, settings); + } } #endif /*LODEPNG_COMPILE_DECODER*/ @@ -1298,150 +1435,166 @@ static const size_t MAX_SUPPORTED_DEFLATE_LENGTH = 258; /*bitlen is the size in bits of the code*/ static void addHuffmanSymbol(size_t* bp, ucvector* compressed, unsigned code, unsigned bitlen) { - addBitsToStreamReversed(bp, compressed, code, bitlen); + addBitsToStreamReversed(bp, compressed, code, bitlen); } -/*search the index in the array, that has the largest value smaller than or equal to the given value, -given array must be sorted (if no value is smaller, it returns the size of the given array)*/ +/*search the index in the array, that has the largest value smaller than or equal to the given +value, given array must be sorted (if no value is smaller, it returns the size of the given array)*/ static size_t searchCodeIndex(const unsigned* array, size_t array_size, size_t value) { - /*linear search implementation*/ - /*for(size_t i = 1; i < array_size; i++) if(array[i] > value) return i - 1; - return array_size - 1;*/ + /*linear search implementation*/ + /*for(size_t i = 1; i < array_size; i++) if(array[i] > value) return i - 1; + return array_size - 1;*/ - /*binary search implementation (not that much faster) (precondition: array_size > 0)*/ - size_t left = 1; - size_t right = array_size - 1; - while(left <= right) - { - size_t mid = (left + right) / 2; - if(array[mid] <= value) left = mid + 1; /*the value to find is more to the right*/ - else if(array[mid - 1] > value) right = mid - 1; /*the value to find is more to the left*/ - else return mid - 1; - } - return array_size - 1; + /*binary search implementation (not that much faster) (precondition: array_size > 0)*/ + size_t left = 1; + size_t right = array_size - 1; + while (left <= right) + { + size_t mid = (left + right) / 2; + if (array[mid] <= value) + left = mid + 1; /*the value to find is more to the right*/ + else if (array[mid - 1] > value) + right = mid - 1; /*the value to find is more to the left*/ + else + return mid - 1; + } + return array_size - 1; } static void addLengthDistance(uivector* values, size_t length, size_t distance) { - /*values in encoded vector are those used by deflate: - 0-255: literal bytes - 256: end - 257-285: length/distance pair (length code, followed by extra length bits, distance code, extra distance bits) - 286-287: invalid*/ + /*values in encoded vector are those used by deflate: + 0-255: literal bytes + 256: end + 257-285: length/distance pair (length code, followed by extra length bits, distance code, extra + distance bits) 286-287: invalid*/ - unsigned length_code = (unsigned)searchCodeIndex(LENGTHBASE, 29, length); - unsigned extra_length = (unsigned)(length - LENGTHBASE[length_code]); - unsigned dist_code = (unsigned)searchCodeIndex(DISTANCEBASE, 30, distance); - unsigned extra_distance = (unsigned)(distance - DISTANCEBASE[dist_code]); + unsigned length_code = (unsigned)searchCodeIndex(LENGTHBASE, 29, length); + unsigned extra_length = (unsigned)(length - LENGTHBASE[length_code]); + unsigned dist_code = (unsigned)searchCodeIndex(DISTANCEBASE, 30, distance); + unsigned extra_distance = (unsigned)(distance - DISTANCEBASE[dist_code]); - uivector_push_back(values, length_code + FIRST_LENGTH_CODE_INDEX); - uivector_push_back(values, extra_length); - uivector_push_back(values, dist_code); - uivector_push_back(values, extra_distance); + uivector_push_back(values, length_code + FIRST_LENGTH_CODE_INDEX); + uivector_push_back(values, extra_length); + uivector_push_back(values, dist_code); + uivector_push_back(values, extra_distance); } /*3 bytes of data get encoded into two bytes. The hash cannot use more than 3 bytes as input because 3 is the minimum match length for deflate*/ static const unsigned HASH_NUM_VALUES = 65536; -static const unsigned HASH_BIT_MASK = 65535; /*HASH_NUM_VALUES - 1, but C90 does not like that as initializer*/ +static const unsigned HASH_BIT_MASK = + 65535; /*HASH_NUM_VALUES - 1, but C90 does not like that as initializer*/ typedef struct Hash { - int* head; /*hash value to head circular pos - can be outdated if went around window*/ - /*circular pos to prev circular pos*/ - unsigned short* chain; - int* val; /*circular pos to hash value*/ + int* head; /*hash value to head circular pos - can be outdated if went around window*/ + /*circular pos to prev circular pos*/ + unsigned short* chain; + int* val; /*circular pos to hash value*/ - /*TODO: do this not only for zeros but for any repeated byte. However for PNG - it's always going to be the zeros that dominate, so not important for PNG*/ - int* headz; /*similar to head, but for chainz*/ - unsigned short* chainz; /*those with same amount of zeros*/ - unsigned short* zeros; /*length of zeros streak, used as a second hash chain*/ + /*TODO: do this not only for zeros but for any repeated byte. However for PNG + it's always going to be the zeros that dominate, so not important for PNG*/ + int* headz; /*similar to head, but for chainz*/ + unsigned short* chainz; /*those with same amount of zeros*/ + unsigned short* zeros; /*length of zeros streak, used as a second hash chain*/ } Hash; static unsigned hash_init(Hash* hash, unsigned windowsize) { - unsigned i; - hash->head = (int*)calloc(sizeof(int), HASH_NUM_VALUES); - hash->val = (int*)calloc(sizeof(int), windowsize); - hash->chain = (unsigned short*)calloc(sizeof(unsigned short), windowsize); + unsigned i; + hash->head = (int*)calloc(sizeof(int), HASH_NUM_VALUES); + hash->val = (int*)calloc(sizeof(int), windowsize); + hash->chain = (unsigned short*)calloc(sizeof(unsigned short), windowsize); - hash->zeros = (unsigned short*)calloc(sizeof(unsigned short), windowsize); - hash->headz = (int*)calloc(sizeof(int), (MAX_SUPPORTED_DEFLATE_LENGTH + 1)); - hash->chainz = (unsigned short*)calloc(sizeof(unsigned short), windowsize); + hash->zeros = (unsigned short*)calloc(sizeof(unsigned short), windowsize); + hash->headz = (int*)calloc(sizeof(int), (MAX_SUPPORTED_DEFLATE_LENGTH + 1)); + hash->chainz = (unsigned short*)calloc(sizeof(unsigned short), windowsize); - if(!hash->head || !hash->chain || !hash->val || !hash->headz|| !hash->chainz || !hash->zeros) - { - return 83; /*alloc fail*/ - } + if (!hash->head || !hash->chain || !hash->val || !hash->headz || !hash->chainz || !hash->zeros) + { + return 83; /*alloc fail*/ + } - /*initialize hash table*/ - for(i = 0; i < HASH_NUM_VALUES; i++) hash->head[i] = -1; - for(i = 0; i < windowsize; i++) hash->val[i] = -1; - for(i = 0; i < windowsize; i++) hash->chain[i] = i; /*same value as index indicates uninitialized*/ + /*initialize hash table*/ + for (i = 0; i < HASH_NUM_VALUES; i++) + hash->head[i] = -1; + for (i = 0; i < windowsize; i++) + hash->val[i] = -1; + for (i = 0; i < windowsize; i++) + hash->chain[i] = i; /*same value as index indicates uninitialized*/ - for(i = 0; i <= MAX_SUPPORTED_DEFLATE_LENGTH; i++) hash->headz[i] = -1; - for(i = 0; i < windowsize; i++) hash->chainz[i] = i; /*same value as index indicates uninitialized*/ + for (i = 0; i <= MAX_SUPPORTED_DEFLATE_LENGTH; i++) + hash->headz[i] = -1; + for (i = 0; i < windowsize; i++) + hash->chainz[i] = i; /*same value as index indicates uninitialized*/ - return 0; + return 0; } static void hash_cleanup(Hash* hash) { - free(hash->head); - free(hash->val); - free(hash->chain); + free(hash->head); + free(hash->val); + free(hash->chain); - free(hash->zeros); - free(hash->headz); - free(hash->chainz); + free(hash->zeros); + free(hash->headz); + free(hash->chainz); } - - static unsigned getHash(const unsigned char* data, size_t size, size_t pos) { - unsigned result = 0; - if (pos + 2 < size) - { - /*A simple shift and xor hash is used. Since the data of PNGs is dominated - by zeroes due to the filters, a better hash does not have a significant - effect on speed in traversing the chain, and causes more time spend on - calculating the hash.*/ - result ^= (unsigned)(data[pos + 0] << 0u); - result ^= (unsigned)(data[pos + 1] << 4u); - result ^= (unsigned)(data[pos + 2] << 8u); - } else { - size_t amount, i; - if(pos >= size) return 0; - amount = size - pos; - for(i = 0; i < amount; i++) result ^= (unsigned)(data[pos + i] << (i * 8u)); - } - return result & HASH_BIT_MASK; + unsigned result = 0; + if (pos + 2 < size) + { + /*A simple shift and xor hash is used. Since the data of PNGs is dominated + by zeroes due to the filters, a better hash does not have a significant + effect on speed in traversing the chain, and causes more time spend on + calculating the hash.*/ + result ^= (unsigned)(data[pos + 0] << 0u); + result ^= (unsigned)(data[pos + 1] << 4u); + result ^= (unsigned)(data[pos + 2] << 8u); + } + else + { + size_t amount, i; + if (pos >= size) + return 0; + amount = size - pos; + for (i = 0; i < amount; i++) + result ^= (unsigned)(data[pos + i] << (i * 8u)); + } + return result & HASH_BIT_MASK; } static unsigned countZeros(const unsigned char* data, size_t size, size_t pos) { - const unsigned char* start = data + pos; - const unsigned char* end = start + MAX_SUPPORTED_DEFLATE_LENGTH; - if(end > data + size) end = data + size; - data = start; - while (data != end && *data == 0) data++; - /*subtracting two addresses returned as 32-bit number (max value is MAX_SUPPORTED_DEFLATE_LENGTH)*/ - return (unsigned)(data - start); + const unsigned char* start = data + pos; + const unsigned char* end = start + MAX_SUPPORTED_DEFLATE_LENGTH; + if (end > data + size) + end = data + size; + data = start; + while (data != end && *data == 0) + data++; + /*subtracting two addresses returned as 32-bit number (max value is + * MAX_SUPPORTED_DEFLATE_LENGTH)*/ + return (unsigned)(data - start); } /*wpos = pos & (windowsize - 1)*/ static void updateHashChain(Hash* hash, size_t wpos, unsigned hashval, unsigned short numzeros) { - hash->val[wpos] = (int)hashval; - if(hash->head[hashval] != -1) hash->chain[wpos] = hash->head[hashval]; - hash->head[hashval] = wpos; + hash->val[wpos] = (int)hashval; + if (hash->head[hashval] != -1) + hash->chain[wpos] = hash->head[hashval]; + hash->head[hashval] = wpos; - hash->zeros[wpos] = numzeros; - if(hash->headz[numzeros] != -1) hash->chainz[wpos] = hash->headz[numzeros]; - hash->headz[numzeros] = wpos; + hash->zeros[wpos] = numzeros; + if (hash->headz[numzeros] != -1) + hash->chainz[wpos] = hash->headz[numzeros]; + hash->headz[numzeros] = wpos; } /* @@ -1453,632 +1606,714 @@ sliding window (of windowsize) is used, and all past bytes in that window can be the "dictionary". A brute force search through all possible distances would be slow, and this hash technique is one out of several ways to speed this up. */ -static unsigned encodeLZ77(uivector* out, Hash* hash, - const unsigned char* in, size_t inpos, size_t insize, unsigned windowsize, - unsigned minmatch, unsigned nicematch, unsigned lazymatching) +static unsigned encodeLZ77(uivector* out, Hash* hash, const unsigned char* in, size_t inpos, + size_t insize, unsigned windowsize, unsigned minmatch, + unsigned nicematch, unsigned lazymatching) { - size_t pos; - unsigned i, error = 0; - /*for large window lengths, assume the user wants no compression loss. Otherwise, max hash chain length speedup.*/ - unsigned maxchainlength = windowsize >= 8192 ? windowsize : windowsize / 8; - unsigned maxlazymatch = windowsize >= 8192 ? MAX_SUPPORTED_DEFLATE_LENGTH : 64; + size_t pos; + unsigned i, error = 0; + /*for large window lengths, assume the user wants no compression loss. Otherwise, max hash chain + * length speedup.*/ + unsigned maxchainlength = windowsize >= 8192 ? windowsize : windowsize / 8; + unsigned maxlazymatch = windowsize >= 8192 ? MAX_SUPPORTED_DEFLATE_LENGTH : 64; - unsigned usezeros = 1; /*not sure if setting it to false for windowsize < 8192 is better or worse*/ - unsigned numzeros = 0; + unsigned usezeros = + 1; /*not sure if setting it to false for windowsize < 8192 is better or worse*/ + unsigned numzeros = 0; - unsigned offset; /*the offset represents the distance in LZ77 terminology*/ - unsigned length; - unsigned lazy = 0; - unsigned lazylength = 0, lazyoffset = 0; - unsigned hashval; - unsigned current_offset, current_length; - unsigned prev_offset; - const unsigned char *lastptr, *foreptr, *backptr; - unsigned hashpos; + unsigned offset; /*the offset represents the distance in LZ77 terminology*/ + unsigned length; + unsigned lazy = 0; + unsigned lazylength = 0, lazyoffset = 0; + unsigned hashval; + unsigned current_offset, current_length; + unsigned prev_offset; + const unsigned char *lastptr, *foreptr, *backptr; + unsigned hashpos; - if(windowsize <= 0 || windowsize > 32768) return 60; /*error: windowsize smaller/larger than allowed*/ - if((windowsize & (windowsize - 1)) != 0) return 90; /*error: must be power of two*/ + if (windowsize <= 0 || windowsize > 32768) + return 60; /*error: windowsize smaller/larger than allowed*/ + if ((windowsize & (windowsize - 1)) != 0) + return 90; /*error: must be power of two*/ - if(nicematch > MAX_SUPPORTED_DEFLATE_LENGTH) nicematch = MAX_SUPPORTED_DEFLATE_LENGTH; + if (nicematch > MAX_SUPPORTED_DEFLATE_LENGTH) + nicematch = MAX_SUPPORTED_DEFLATE_LENGTH; - for(pos = inpos; pos < insize; pos++) - { - size_t wpos = pos & (windowsize - 1); /*position for in 'circular' hash buffers*/ - unsigned chainlength = 0; + for (pos = inpos; pos < insize; pos++) + { + size_t wpos = pos & (windowsize - 1); /*position for in 'circular' hash buffers*/ + unsigned chainlength = 0; - hashval = getHash(in, insize, pos); + hashval = getHash(in, insize, pos); - if(usezeros && hashval == 0) - { - if (numzeros == 0) numzeros = countZeros(in, insize, pos); - else if (pos + numzeros > insize || in[pos + numzeros - 1] != 0) numzeros--; - } - else - { - numzeros = 0; - } + if (usezeros && hashval == 0) + { + if (numzeros == 0) + numzeros = countZeros(in, insize, pos); + else if (pos + numzeros > insize || in[pos + numzeros - 1] != 0) + numzeros--; + } + else + { + numzeros = 0; + } - updateHashChain(hash, wpos, hashval, numzeros); + updateHashChain(hash, wpos, hashval, numzeros); - /*the length and offset found for the current position*/ - length = 0; - offset = 0; + /*the length and offset found for the current position*/ + length = 0; + offset = 0; - hashpos = hash->chain[wpos]; + hashpos = hash->chain[wpos]; - lastptr = &in[insize < pos + MAX_SUPPORTED_DEFLATE_LENGTH ? insize : pos + MAX_SUPPORTED_DEFLATE_LENGTH]; + lastptr = + &in[insize < pos + MAX_SUPPORTED_DEFLATE_LENGTH ? insize + : pos + MAX_SUPPORTED_DEFLATE_LENGTH]; - /*search for the longest string*/ - prev_offset = 0; - for(;;) - { - if(chainlength++ >= maxchainlength) break; - current_offset = hashpos <= wpos ? wpos - hashpos : wpos - hashpos + windowsize; + /*search for the longest string*/ + prev_offset = 0; + for (;;) + { + if (chainlength++ >= maxchainlength) + break; + current_offset = hashpos <= wpos ? wpos - hashpos : wpos - hashpos + windowsize; - if(current_offset < prev_offset) break; /*stop when went completely around the circular buffer*/ - prev_offset = current_offset; - if(current_offset > 0) - { - /*test the next characters*/ - foreptr = &in[pos]; - backptr = &in[pos - current_offset]; + if (current_offset < prev_offset) + break; /*stop when went completely around the circular buffer*/ + prev_offset = current_offset; + if (current_offset > 0) + { + /*test the next characters*/ + foreptr = &in[pos]; + backptr = &in[pos - current_offset]; - /*common case in PNGs is lots of zeros. Quickly skip over them as a speedup*/ - if(numzeros >= 3) - { - unsigned skip = hash->zeros[hashpos]; - if(skip > numzeros) skip = numzeros; - backptr += skip; - foreptr += skip; - } + /*common case in PNGs is lots of zeros. Quickly skip over them as a speedup*/ + if (numzeros >= 3) + { + unsigned skip = hash->zeros[hashpos]; + if (skip > numzeros) + skip = numzeros; + backptr += skip; + foreptr += skip; + } - while(foreptr != lastptr && *backptr == *foreptr) /*maximum supported length by deflate is max length*/ - { - ++backptr; - ++foreptr; - } - current_length = (unsigned)(foreptr - &in[pos]); + while (foreptr != lastptr && + *backptr == *foreptr) /*maximum supported length by deflate is max length*/ + { + ++backptr; + ++foreptr; + } + current_length = (unsigned)(foreptr - &in[pos]); - if(current_length > length) - { - length = current_length; /*the longest length*/ - offset = current_offset; /*the offset that is related to this longest length*/ - /*jump out once a length of max length is found (speed gain). This also jumps - out if length is MAX_SUPPORTED_DEFLATE_LENGTH*/ - if(current_length >= nicematch) break; - } - } + if (current_length > length) + { + length = current_length; /*the longest length*/ + offset = current_offset; /*the offset that is related to this longest length*/ + /*jump out once a length of max length is found (speed gain). This also jumps + out if length is MAX_SUPPORTED_DEFLATE_LENGTH*/ + if (current_length >= nicematch) + break; + } + } - if(hashpos == hash->chain[hashpos]) break; - - if(numzeros >= 3 && length > numzeros) { - hashpos = hash->chainz[hashpos]; - if(hash->zeros[hashpos] != numzeros) break; - } else { - hashpos = hash->chain[hashpos]; - /*outdated hash value, happens if particular value was not encountered in whole last window*/ - if(hash->val[hashpos] != (int)hashval) break; - } - } + if (hashpos == hash->chain[hashpos]) + break; - if(lazymatching) - { - if(!lazy && length >= 3 && length <= maxlazymatch && length < MAX_SUPPORTED_DEFLATE_LENGTH) - { - lazy = 1; - lazylength = length; - lazyoffset = offset; - continue; /*try the next byte*/ - } - if(lazy) - { - lazy = 0; - if(pos == 0) ERROR_BREAK(81); - if(length > lazylength + 1) - { - /*push the previous character as literal*/ - if(!uivector_push_back(out, in[pos - 1])) ERROR_BREAK(83 /*alloc fail*/); - } - else - { - length = lazylength; - offset = lazyoffset; - hash->head[hashval] = -1; /*the same hashchain update will be done, this ensures no wrong alteration*/ - hash->headz[numzeros] = -1; /*idem*/ - pos--; - } - } - } - if(length >= 3 && offset > windowsize) ERROR_BREAK(86 /*too big (or overflown negative) offset*/); + if (numzeros >= 3 && length > numzeros) + { + hashpos = hash->chainz[hashpos]; + if (hash->zeros[hashpos] != numzeros) + break; + } + else + { + hashpos = hash->chain[hashpos]; + /*outdated hash value, happens if particular value was not encountered in whole last + * window*/ + if (hash->val[hashpos] != (int)hashval) + break; + } + } - /*encode it as length/distance pair or literal value*/ - if(length < 3) /*only lengths of 3 or higher are supported as length/distance pair*/ - { - if(!uivector_push_back(out, in[pos])) ERROR_BREAK(83 /*alloc fail*/); - } - else if(length < minmatch || (length == 3 && offset > 4096)) - { - /*compensate for the fact that longer offsets have more extra bits, a - length of only 3 may be not worth it then*/ - if(!uivector_push_back(out, in[pos])) ERROR_BREAK(83 /*alloc fail*/); - } - else - { - addLengthDistance(out, length, offset); - for(i = 1; i < length; i++) - { - pos++; - wpos = pos & (windowsize - 1); - hashval = getHash(in, insize, pos); - if(usezeros && hashval == 0) - { - if (numzeros == 0) numzeros = countZeros(in, insize, pos); - else if (pos + numzeros > insize || in[pos + numzeros - 1] != 0) numzeros--; - } - else - { - numzeros = 0; - } - updateHashChain(hash, wpos, hashval, numzeros); - } - } - } /*end of the loop through each character of input*/ + if (lazymatching) + { + if (!lazy && length >= 3 && length <= maxlazymatch && + length < MAX_SUPPORTED_DEFLATE_LENGTH) + { + lazy = 1; + lazylength = length; + lazyoffset = offset; + continue; /*try the next byte*/ + } + if (lazy) + { + lazy = 0; + if (pos == 0) + ERROR_BREAK(81); + if (length > lazylength + 1) + { + /*push the previous character as literal*/ + if (!uivector_push_back(out, in[pos - 1])) + ERROR_BREAK(83 /*alloc fail*/); + } + else + { + length = lazylength; + offset = lazyoffset; + hash->head[hashval] = -1; /*the same hashchain update will be done, this ensures + no wrong alteration*/ + hash->headz[numzeros] = -1; /*idem*/ + pos--; + } + } + } + if (length >= 3 && offset > windowsize) + ERROR_BREAK(86 /*too big (or overflown negative) offset*/); - return error; + /*encode it as length/distance pair or literal value*/ + if (length < 3) /*only lengths of 3 or higher are supported as length/distance pair*/ + { + if (!uivector_push_back(out, in[pos])) + ERROR_BREAK(83 /*alloc fail*/); + } + else if (length < minmatch || (length == 3 && offset > 4096)) + { + /*compensate for the fact that longer offsets have more extra bits, a + length of only 3 may be not worth it then*/ + if (!uivector_push_back(out, in[pos])) + ERROR_BREAK(83 /*alloc fail*/); + } + else + { + addLengthDistance(out, length, offset); + for (i = 1; i < length; i++) + { + pos++; + wpos = pos & (windowsize - 1); + hashval = getHash(in, insize, pos); + if (usezeros && hashval == 0) + { + if (numzeros == 0) + numzeros = countZeros(in, insize, pos); + else if (pos + numzeros > insize || in[pos + numzeros - 1] != 0) + numzeros--; + } + else + { + numzeros = 0; + } + updateHashChain(hash, wpos, hashval, numzeros); + } + } + } /*end of the loop through each character of input*/ + + return error; } /* /////////////////////////////////////////////////////////////////////////// */ static unsigned deflateNoCompression(ucvector* out, const unsigned char* data, size_t datasize) { - /*non compressed deflate block data: 1 bit BFINAL,2 bits BTYPE,(5 bits): it jumps to start of next byte, - 2 bytes LEN, 2 bytes NLEN, LEN bytes literal DATA*/ + /*non compressed deflate block data: 1 bit BFINAL,2 bits BTYPE,(5 bits): it jumps to start of + next byte, 2 bytes LEN, 2 bytes NLEN, LEN bytes literal DATA*/ - size_t i, j, numdeflateblocks = (datasize + 65534) / 65535; - unsigned datapos = 0; - for(i = 0; i < numdeflateblocks; i++) - { - unsigned BFINAL, BTYPE, LEN, NLEN; - unsigned char firstbyte; + size_t i, j, numdeflateblocks = (datasize + 65534) / 65535; + unsigned datapos = 0; + for (i = 0; i < numdeflateblocks; i++) + { + unsigned BFINAL, BTYPE, LEN, NLEN; + unsigned char firstbyte; - BFINAL = (i == numdeflateblocks - 1); - BTYPE = 0; + BFINAL = (i == numdeflateblocks - 1); + BTYPE = 0; - firstbyte = (unsigned char)(BFINAL + ((BTYPE & 1) << 1) + ((BTYPE & 2) << 1)); - if (!ucvector_push_back(out, firstbyte)) return 83; + firstbyte = (unsigned char)(BFINAL + ((BTYPE & 1) << 1) + ((BTYPE & 2) << 1)); + if (!ucvector_push_back(out, firstbyte)) + return 83; - LEN = 65535; - if(datasize - datapos < 65535) LEN = (unsigned)datasize - datapos; - NLEN = 65535 - LEN; + LEN = 65535; + if (datasize - datapos < 65535) + LEN = (unsigned)datasize - datapos; + NLEN = 65535 - LEN; - if (!ucvector_push_back(out, (unsigned char)(LEN % 256))) return 83; - if (!ucvector_push_back(out, (unsigned char)(LEN / 256))) return 83; - if (!ucvector_push_back(out, (unsigned char)(NLEN % 256))) return 83; - if (!ucvector_push_back(out, (unsigned char)(NLEN / 256))) return 83; + if (!ucvector_push_back(out, (unsigned char)(LEN % 256))) + return 83; + if (!ucvector_push_back(out, (unsigned char)(LEN / 256))) + return 83; + if (!ucvector_push_back(out, (unsigned char)(NLEN % 256))) + return 83; + if (!ucvector_push_back(out, (unsigned char)(NLEN / 256))) + return 83; - /*Decompressed data*/ - for(j = 0; j < 65535 && datapos < datasize; j++) - { - if (!ucvector_push_back(out, data[datapos++])) return 83; - } - } + /*Decompressed data*/ + for (j = 0; j < 65535 && datapos < datasize; j++) + { + if (!ucvector_push_back(out, data[datapos++])) + return 83; + } + } - return 0; + return 0; } /* -write the lz77-encoded data, which has lit, len and dist codes, to compressed stream using huffman trees. -tree_ll: the tree for lit and len codes. -tree_d: the tree for distance codes. +write the lz77-encoded data, which has lit, len and dist codes, to compressed stream using huffman +trees. tree_ll: the tree for lit and len codes. tree_d: the tree for distance codes. */ static void writeLZ77data(size_t* bp, ucvector* out, const uivector* lz77_encoded, const HuffmanTree* tree_ll, const HuffmanTree* tree_d) { - size_t i = 0; - for(i = 0; i < lz77_encoded->size; i++) - { - unsigned val = lz77_encoded->data[i]; - addHuffmanSymbol(bp, out, HuffmanTree_getCode(tree_ll, val), HuffmanTree_getLength(tree_ll, val)); - if(val > 256) /*for a length code, 3 more things have to be added*/ - { - unsigned length_index = val - FIRST_LENGTH_CODE_INDEX; - unsigned n_length_extra_bits = LENGTHEXTRA[length_index]; - unsigned length_extra_bits = lz77_encoded->data[++i]; + size_t i = 0; + for (i = 0; i < lz77_encoded->size; i++) + { + unsigned val = lz77_encoded->data[i]; + addHuffmanSymbol(bp, out, HuffmanTree_getCode(tree_ll, val), + HuffmanTree_getLength(tree_ll, val)); + if (val > 256) /*for a length code, 3 more things have to be added*/ + { + unsigned length_index = val - FIRST_LENGTH_CODE_INDEX; + unsigned n_length_extra_bits = LENGTHEXTRA[length_index]; + unsigned length_extra_bits = lz77_encoded->data[++i]; - unsigned distance_code = lz77_encoded->data[++i]; + unsigned distance_code = lz77_encoded->data[++i]; - unsigned distance_index = distance_code; - unsigned n_distance_extra_bits = DISTANCEEXTRA[distance_index]; - unsigned distance_extra_bits = lz77_encoded->data[++i]; + unsigned distance_index = distance_code; + unsigned n_distance_extra_bits = DISTANCEEXTRA[distance_index]; + unsigned distance_extra_bits = lz77_encoded->data[++i]; - addBitsToStream(bp, out, length_extra_bits, n_length_extra_bits); - addHuffmanSymbol(bp, out, HuffmanTree_getCode(tree_d, distance_code), - HuffmanTree_getLength(tree_d, distance_code)); - addBitsToStream(bp, out, distance_extra_bits, n_distance_extra_bits); - } - } + addBitsToStream(bp, out, length_extra_bits, n_length_extra_bits); + addHuffmanSymbol(bp, out, HuffmanTree_getCode(tree_d, distance_code), + HuffmanTree_getLength(tree_d, distance_code)); + addBitsToStream(bp, out, distance_extra_bits, n_distance_extra_bits); + } + } } /*Deflate for a block of type "dynamic", that is, with freely, optimally, created huffman trees*/ -static unsigned deflateDynamic(ucvector* out, size_t* bp, Hash* hash, - const unsigned char* data, size_t datapos, size_t dataend, +static unsigned deflateDynamic(ucvector* out, size_t* bp, Hash* hash, const unsigned char* data, + size_t datapos, size_t dataend, const LodePNGCompressSettings* settings, unsigned final) { - unsigned error = 0; + unsigned error = 0; - /* - A block is compressed as follows: The PNG data is lz77 encoded, resulting in - literal bytes and length/distance pairs. This is then huffman compressed with - two huffman trees. One huffman tree is used for the lit and len values ("ll"), - another huffman tree is used for the dist values ("d"). These two trees are - stored using their code lengths, and to compress even more these code lengths - are also run-length encoded and huffman compressed. This gives a huffman tree - of code lengths "cl". The code lenghts used to describe this third tree are - the code length code lengths ("clcl"). - */ + /* + A block is compressed as follows: The PNG data is lz77 encoded, resulting in + literal bytes and length/distance pairs. This is then huffman compressed with + two huffman trees. One huffman tree is used for the lit and len values ("ll"), + another huffman tree is used for the dist values ("d"). These two trees are + stored using their code lengths, and to compress even more these code lengths + are also run-length encoded and huffman compressed. This gives a huffman tree + of code lengths "cl". The code lenghts used to describe this third tree are + the code length code lengths ("clcl"). + */ - /*The lz77 encoded data, represented with integers since there will also be length and distance codes in it*/ - uivector lz77_encoded; - HuffmanTree tree_ll; /*tree for lit,len values*/ - HuffmanTree tree_d; /*tree for distance codes*/ - HuffmanTree tree_cl; /*tree for encoding the code lengths representing tree_ll and tree_d*/ - uivector frequencies_ll; /*frequency of lit,len codes*/ - uivector frequencies_d; /*frequency of dist codes*/ - uivector frequencies_cl; /*frequency of code length codes*/ - uivector bitlen_lld; /*lit,len,dist code lenghts (int bits), literally (without repeat codes).*/ - uivector bitlen_lld_e; /*bitlen_lld encoded with repeat codes (this is a rudemtary run length compression)*/ - /*bitlen_cl is the code length code lengths ("clcl"). The bit lengths of codes to represent tree_cl - (these are written as is in the file, it would be crazy to compress these using yet another huffman - tree that needs to be represented by yet another set of code lengths)*/ - uivector bitlen_cl; - size_t datasize = dataend - datapos; + /*The lz77 encoded data, represented with integers since there will also be length and distance + * codes in it*/ + uivector lz77_encoded; + HuffmanTree tree_ll; /*tree for lit,len values*/ + HuffmanTree tree_d; /*tree for distance codes*/ + HuffmanTree tree_cl; /*tree for encoding the code lengths representing tree_ll and tree_d*/ + uivector frequencies_ll; /*frequency of lit,len codes*/ + uivector frequencies_d; /*frequency of dist codes*/ + uivector frequencies_cl; /*frequency of code length codes*/ + uivector bitlen_lld; /*lit,len,dist code lenghts (int bits), literally (without repeat codes).*/ + uivector bitlen_lld_e; /*bitlen_lld encoded with repeat codes (this is a rudemtary run length + compression)*/ + /*bitlen_cl is the code length code lengths ("clcl"). The bit lengths of codes to represent + tree_cl (these are written as is in the file, it would be crazy to compress these using yet + another huffman tree that needs to be represented by yet another set of code lengths)*/ + uivector bitlen_cl; + size_t datasize = dataend - datapos; - /* - Due to the huffman compression of huffman tree representations ("two levels"), there are some anologies: - bitlen_lld is to tree_cl what data is to tree_ll and tree_d. - bitlen_lld_e is to bitlen_lld what lz77_encoded is to data. - bitlen_cl is to bitlen_lld_e what bitlen_lld is to lz77_encoded. - */ + /* + Due to the huffman compression of huffman tree representations ("two levels"), there are some + anologies: bitlen_lld is to tree_cl what data is to tree_ll and tree_d. bitlen_lld_e is to + bitlen_lld what lz77_encoded is to data. bitlen_cl is to bitlen_lld_e what bitlen_lld is to + lz77_encoded. + */ - unsigned BFINAL = final; - size_t numcodes_ll, numcodes_d, i; - unsigned HLIT, HDIST, HCLEN; + unsigned BFINAL = final; + size_t numcodes_ll, numcodes_d, i; + unsigned HLIT, HDIST, HCLEN; - uivector_init(&lz77_encoded); - HuffmanTree_init(&tree_ll); - HuffmanTree_init(&tree_d); - HuffmanTree_init(&tree_cl); - uivector_init(&frequencies_ll); - uivector_init(&frequencies_d); - uivector_init(&frequencies_cl); - uivector_init(&bitlen_lld); - uivector_init(&bitlen_lld_e); - uivector_init(&bitlen_cl); + uivector_init(&lz77_encoded); + HuffmanTree_init(&tree_ll); + HuffmanTree_init(&tree_d); + HuffmanTree_init(&tree_cl); + uivector_init(&frequencies_ll); + uivector_init(&frequencies_d); + uivector_init(&frequencies_cl); + uivector_init(&bitlen_lld); + uivector_init(&bitlen_lld_e); + uivector_init(&bitlen_cl); - /*This while loop never loops due to a break at the end, it is here to - allow breaking out of it to the cleanup phase on error conditions.*/ - while(!error) - { - if(settings->use_lz77) - { - error = encodeLZ77(&lz77_encoded, hash, data, datapos, dataend, settings->windowsize, - settings->minmatch, settings->nicematch, settings->lazymatching); - if(error) break; - } - else - { - if(!uivector_resize(&lz77_encoded, datasize)) ERROR_BREAK(83 /*alloc fail*/); - if (!lz77_encoded.data) - ERROR_BREAK(83 /* alloc fail */); + /*This while loop never loops due to a break at the end, it is here to + allow breaking out of it to the cleanup phase on error conditions.*/ + while (!error) + { + if (settings->use_lz77) + { + error = encodeLZ77(&lz77_encoded, hash, data, datapos, dataend, settings->windowsize, + settings->minmatch, settings->nicematch, settings->lazymatching); + if (error) + break; + } + else + { + if (!uivector_resize(&lz77_encoded, datasize)) + ERROR_BREAK(83 /*alloc fail*/); + if (!lz77_encoded.data) + ERROR_BREAK(83 /* alloc fail */); - for(i = datapos; i < dataend; i++) lz77_encoded.data[i] = data[i]; /*no LZ77, but still will be Huffman compressed*/ - } + for (i = datapos; i < dataend; i++) + lz77_encoded.data[i] = data[i]; /*no LZ77, but still will be Huffman compressed*/ + } - if(!uivector_resizev(&frequencies_ll, 286, 0)) ERROR_BREAK(83 /*alloc fail*/); - if(!uivector_resizev(&frequencies_d, 30, 0)) ERROR_BREAK(83 /*alloc fail*/); + if (!uivector_resizev(&frequencies_ll, 286, 0)) + ERROR_BREAK(83 /*alloc fail*/); + if (!uivector_resizev(&frequencies_d, 30, 0)) + ERROR_BREAK(83 /*alloc fail*/); - /*Count the frequencies of lit, len and dist codes*/ - for(i = 0; i < lz77_encoded.size; i++) - { - unsigned symbol; + /*Count the frequencies of lit, len and dist codes*/ + for (i = 0; i < lz77_encoded.size; i++) + { + unsigned symbol; - if (!lz77_encoded.data) - ERROR_BREAK(83 /* alloc fail */); + if (!lz77_encoded.data) + ERROR_BREAK(83 /* alloc fail */); - symbol = lz77_encoded.data[i]; - frequencies_ll.data[symbol]++; - if(symbol > 256) - { - unsigned dist = lz77_encoded.data[i + 2]; - frequencies_d.data[dist]++; - i += 3; - } - } - frequencies_ll.data[256] = 1; /*there will be exactly 1 end code, at the end of the block*/ + symbol = lz77_encoded.data[i]; + frequencies_ll.data[symbol]++; + if (symbol > 256) + { + unsigned dist = lz77_encoded.data[i + 2]; + frequencies_d.data[dist]++; + i += 3; + } + } + frequencies_ll.data[256] = 1; /*there will be exactly 1 end code, at the end of the block*/ - /*Make both huffman trees, one for the lit and len codes, one for the dist codes*/ - error = HuffmanTree_makeFromFrequencies(&tree_ll, frequencies_ll.data, 257, frequencies_ll.size, 15); - if(error) break; - /*2, not 1, is chosen for mincodes: some buggy PNG decoders require at least 2 symbols in the dist tree*/ - error = HuffmanTree_makeFromFrequencies(&tree_d, frequencies_d.data, 2, frequencies_d.size, 15); - if(error) break; + /*Make both huffman trees, one for the lit and len codes, one for the dist codes*/ + error = HuffmanTree_makeFromFrequencies(&tree_ll, frequencies_ll.data, 257, + frequencies_ll.size, 15); + if (error) + break; + /*2, not 1, is chosen for mincodes: some buggy PNG decoders require at least 2 symbols in + * the dist tree*/ + error = + HuffmanTree_makeFromFrequencies(&tree_d, frequencies_d.data, 2, frequencies_d.size, 15); + if (error) + break; - numcodes_ll = tree_ll.numcodes; if(numcodes_ll > 286) numcodes_ll = 286; - numcodes_d = tree_d.numcodes; if(numcodes_d > 30) numcodes_d = 30; - /*store the code lengths of both generated trees in bitlen_lld*/ - for(i = 0; i < numcodes_ll; i++) uivector_push_back(&bitlen_lld, HuffmanTree_getLength(&tree_ll, (unsigned)i)); - for(i = 0; i < numcodes_d; i++) uivector_push_back(&bitlen_lld, HuffmanTree_getLength(&tree_d, (unsigned)i)); + numcodes_ll = tree_ll.numcodes; + if (numcodes_ll > 286) + numcodes_ll = 286; + numcodes_d = tree_d.numcodes; + if (numcodes_d > 30) + numcodes_d = 30; + /*store the code lengths of both generated trees in bitlen_lld*/ + for (i = 0; i < numcodes_ll; i++) + uivector_push_back(&bitlen_lld, HuffmanTree_getLength(&tree_ll, (unsigned)i)); + for (i = 0; i < numcodes_d; i++) + uivector_push_back(&bitlen_lld, HuffmanTree_getLength(&tree_d, (unsigned)i)); - /*run-length compress bitlen_ldd into bitlen_lld_e by using repeat codes 16 (copy length 3-6 times), - 17 (3-10 zeroes), 18 (11-138 zeroes)*/ - for(i = 0; i < (unsigned)bitlen_lld.size; i++) - { - unsigned j = 0; /*amount of repititions*/ - while(i + j + 1 < (unsigned)bitlen_lld.size && bitlen_lld.data[i + j + 1] == bitlen_lld.data[i]) j++; + /*run-length compress bitlen_ldd into bitlen_lld_e by using repeat codes 16 (copy length 3-6 + times), 17 (3-10 zeroes), 18 (11-138 zeroes)*/ + for (i = 0; i < (unsigned)bitlen_lld.size; i++) + { + unsigned j = 0; /*amount of repititions*/ + while (i + j + 1 < (unsigned)bitlen_lld.size && + bitlen_lld.data[i + j + 1] == bitlen_lld.data[i]) + j++; - if(bitlen_lld.data[i] == 0 && j >= 2) /*repeat code for zeroes*/ - { - j++; /*include the first zero*/ - if(j <= 10) /*repeat code 17 supports max 10 zeroes*/ - { - uivector_push_back(&bitlen_lld_e, 17); - uivector_push_back(&bitlen_lld_e, j - 3); - } - else /*repeat code 18 supports max 138 zeroes*/ - { - if(j > 138) j = 138; - uivector_push_back(&bitlen_lld_e, 18); - uivector_push_back(&bitlen_lld_e, j - 11); - } - i += (j - 1); - } - else if(j >= 3) /*repeat code for value other than zero*/ - { - size_t k; - unsigned num = j / 6, rest = j % 6; - uivector_push_back(&bitlen_lld_e, bitlen_lld.data[i]); - for(k = 0; k < num; k++) - { - uivector_push_back(&bitlen_lld_e, 16); - uivector_push_back(&bitlen_lld_e, 6 - 3); - } - if(rest >= 3) - { - uivector_push_back(&bitlen_lld_e, 16); - uivector_push_back(&bitlen_lld_e, rest - 3); - } - else j -= rest; - i += j; - } - else /*too short to benefit from repeat code*/ - { - uivector_push_back(&bitlen_lld_e, bitlen_lld.data[i]); - } - } + if (bitlen_lld.data[i] == 0 && j >= 2) /*repeat code for zeroes*/ + { + j++; /*include the first zero*/ + if (j <= 10) /*repeat code 17 supports max 10 zeroes*/ + { + uivector_push_back(&bitlen_lld_e, 17); + uivector_push_back(&bitlen_lld_e, j - 3); + } + else /*repeat code 18 supports max 138 zeroes*/ + { + if (j > 138) + j = 138; + uivector_push_back(&bitlen_lld_e, 18); + uivector_push_back(&bitlen_lld_e, j - 11); + } + i += (j - 1); + } + else if (j >= 3) /*repeat code for value other than zero*/ + { + size_t k; + unsigned num = j / 6, rest = j % 6; + uivector_push_back(&bitlen_lld_e, bitlen_lld.data[i]); + for (k = 0; k < num; k++) + { + uivector_push_back(&bitlen_lld_e, 16); + uivector_push_back(&bitlen_lld_e, 6 - 3); + } + if (rest >= 3) + { + uivector_push_back(&bitlen_lld_e, 16); + uivector_push_back(&bitlen_lld_e, rest - 3); + } + else + j -= rest; + i += j; + } + else /*too short to benefit from repeat code*/ + { + uivector_push_back(&bitlen_lld_e, bitlen_lld.data[i]); + } + } - /*generate tree_cl, the huffmantree of huffmantrees*/ + /*generate tree_cl, the huffmantree of huffmantrees*/ - if(!uivector_resizev(&frequencies_cl, NUM_CODE_LENGTH_CODES, 0)) ERROR_BREAK(83 /*alloc fail*/); - for(i = 0; i < bitlen_lld_e.size; i++) - { - frequencies_cl.data[bitlen_lld_e.data[i]]++; - /*after a repeat code come the bits that specify the number of repetitions, - those don't need to be in the frequencies_cl calculation*/ - if(bitlen_lld_e.data[i] >= 16) i++; - } + if (!uivector_resizev(&frequencies_cl, NUM_CODE_LENGTH_CODES, 0)) + ERROR_BREAK(83 /*alloc fail*/); + for (i = 0; i < bitlen_lld_e.size; i++) + { + frequencies_cl.data[bitlen_lld_e.data[i]]++; + /*after a repeat code come the bits that specify the number of repetitions, + those don't need to be in the frequencies_cl calculation*/ + if (bitlen_lld_e.data[i] >= 16) + i++; + } - error = HuffmanTree_makeFromFrequencies(&tree_cl, frequencies_cl.data, - frequencies_cl.size, frequencies_cl.size, 7); - if(error) break; + error = HuffmanTree_makeFromFrequencies(&tree_cl, frequencies_cl.data, frequencies_cl.size, + frequencies_cl.size, 7); + if (error) + break; - if(!uivector_resize(&bitlen_cl, tree_cl.numcodes)) ERROR_BREAK(83 /*alloc fail*/); - for(i = 0; i < tree_cl.numcodes && bitlen_cl.data; i++) - { - /*lenghts of code length tree is in the order as specified by deflate*/ - bitlen_cl.data[i] = HuffmanTree_getLength(&tree_cl, CLCL_ORDER[i]); - } - while(bitlen_cl.data && bitlen_cl.size > 4 && bitlen_cl.data[bitlen_cl.size - 1] == 0) - { - /*remove zeros at the end, but minimum size must be 4*/ - if(!uivector_resize(&bitlen_cl, bitlen_cl.size - 1)) ERROR_BREAK(83 /*alloc fail*/); - } - if(error || !bitlen_cl.data) break; + if (!uivector_resize(&bitlen_cl, tree_cl.numcodes)) + ERROR_BREAK(83 /*alloc fail*/); + for (i = 0; i < tree_cl.numcodes && bitlen_cl.data; i++) + { + /*lenghts of code length tree is in the order as specified by deflate*/ + bitlen_cl.data[i] = HuffmanTree_getLength(&tree_cl, CLCL_ORDER[i]); + } + while (bitlen_cl.data && bitlen_cl.size > 4 && bitlen_cl.data[bitlen_cl.size - 1] == 0) + { + /*remove zeros at the end, but minimum size must be 4*/ + if (!uivector_resize(&bitlen_cl, bitlen_cl.size - 1)) + ERROR_BREAK(83 /*alloc fail*/); + } + if (error || !bitlen_cl.data) + break; - /* - Write everything into the output + /* + Write everything into the output - After the BFINAL and BTYPE, the dynamic block consists out of the following: - - 5 bits HLIT, 5 bits HDIST, 4 bits HCLEN - - (HCLEN+4)*3 bits code lengths of code length alphabet - - HLIT + 257 code lenghts of lit/length alphabet (encoded using the code length - alphabet, + possible repetition codes 16, 17, 18) - - HDIST + 1 code lengths of distance alphabet (encoded using the code length - alphabet, + possible repetition codes 16, 17, 18) - - compressed data - - 256 (end code) - */ + After the BFINAL and BTYPE, the dynamic block consists out of the following: + - 5 bits HLIT, 5 bits HDIST, 4 bits HCLEN + - (HCLEN+4)*3 bits code lengths of code length alphabet + - HLIT + 257 code lenghts of lit/length alphabet (encoded using the code length + alphabet, + possible repetition codes 16, 17, 18) + - HDIST + 1 code lengths of distance alphabet (encoded using the code length + alphabet, + possible repetition codes 16, 17, 18) + - compressed data + - 256 (end code) + */ - /*Write block type*/ - addBitToStream(bp, out, BFINAL); - addBitToStream(bp, out, 0); /*first bit of BTYPE "dynamic"*/ - addBitToStream(bp, out, 1); /*second bit of BTYPE "dynamic"*/ + /*Write block type*/ + addBitToStream(bp, out, BFINAL); + addBitToStream(bp, out, 0); /*first bit of BTYPE "dynamic"*/ + addBitToStream(bp, out, 1); /*second bit of BTYPE "dynamic"*/ - /*write the HLIT, HDIST and HCLEN values*/ - HLIT = (unsigned)(numcodes_ll - 257); - HDIST = (unsigned)(numcodes_d - 1); - HCLEN = 0; - if (bitlen_cl.size > 4) - HCLEN = (unsigned)bitlen_cl.size - 4; - /*trim zeroes for HCLEN. HLIT and HDIST were already trimmed at tree creation*/ - while(HCLEN > 0 && !bitlen_cl.data[HCLEN + 4 - 1]) HCLEN--; - addBitsToStream(bp, out, HLIT, 5); - addBitsToStream(bp, out, HDIST, 5); - addBitsToStream(bp, out, HCLEN, 4); + /*write the HLIT, HDIST and HCLEN values*/ + HLIT = (unsigned)(numcodes_ll - 257); + HDIST = (unsigned)(numcodes_d - 1); + HCLEN = 0; + if (bitlen_cl.size > 4) + HCLEN = (unsigned)bitlen_cl.size - 4; + /*trim zeroes for HCLEN. HLIT and HDIST were already trimmed at tree creation*/ + while (HCLEN > 0 && !bitlen_cl.data[HCLEN + 4 - 1]) + HCLEN--; + addBitsToStream(bp, out, HLIT, 5); + addBitsToStream(bp, out, HDIST, 5); + addBitsToStream(bp, out, HCLEN, 4); - /*write the code lenghts of the code length alphabet*/ - if (bitlen_cl.size > 4) - { - for(i = 0; i < HCLEN + 4; i++) addBitsToStream(bp, out, bitlen_cl.data[i], 3); - } + /*write the code lenghts of the code length alphabet*/ + if (bitlen_cl.size > 4) + { + for (i = 0; i < HCLEN + 4; i++) + addBitsToStream(bp, out, bitlen_cl.data[i], 3); + } - /*write the lenghts of the lit/len AND the dist alphabet*/ - for(i = 0; i < bitlen_lld_e.size; i++) - { - addHuffmanSymbol(bp, out, HuffmanTree_getCode(&tree_cl, bitlen_lld_e.data[i]), - HuffmanTree_getLength(&tree_cl, bitlen_lld_e.data[i])); - /*extra bits of repeat codes*/ - if(bitlen_lld_e.data[i] == 16) addBitsToStream(bp, out, bitlen_lld_e.data[++i], 2); - else if(bitlen_lld_e.data[i] == 17) addBitsToStream(bp, out, bitlen_lld_e.data[++i], 3); - else if(bitlen_lld_e.data[i] == 18) addBitsToStream(bp, out, bitlen_lld_e.data[++i], 7); - } + /*write the lenghts of the lit/len AND the dist alphabet*/ + for (i = 0; i < bitlen_lld_e.size; i++) + { + addHuffmanSymbol(bp, out, HuffmanTree_getCode(&tree_cl, bitlen_lld_e.data[i]), + HuffmanTree_getLength(&tree_cl, bitlen_lld_e.data[i])); + /*extra bits of repeat codes*/ + if (bitlen_lld_e.data[i] == 16) + addBitsToStream(bp, out, bitlen_lld_e.data[++i], 2); + else if (bitlen_lld_e.data[i] == 17) + addBitsToStream(bp, out, bitlen_lld_e.data[++i], 3); + else if (bitlen_lld_e.data[i] == 18) + addBitsToStream(bp, out, bitlen_lld_e.data[++i], 7); + } - /*write the compressed data symbols*/ - writeLZ77data(bp, out, &lz77_encoded, &tree_ll, &tree_d); - /*error: the length of the end code 256 must be larger than 0*/ - if(HuffmanTree_getLength(&tree_ll, 256) == 0) ERROR_BREAK(64); + /*write the compressed data symbols*/ + writeLZ77data(bp, out, &lz77_encoded, &tree_ll, &tree_d); + /*error: the length of the end code 256 must be larger than 0*/ + if (HuffmanTree_getLength(&tree_ll, 256) == 0) + ERROR_BREAK(64); - /*write the end code*/ - addHuffmanSymbol(bp, out, HuffmanTree_getCode(&tree_ll, 256), HuffmanTree_getLength(&tree_ll, 256)); + /*write the end code*/ + addHuffmanSymbol(bp, out, HuffmanTree_getCode(&tree_ll, 256), + HuffmanTree_getLength(&tree_ll, 256)); - break; /*end of error-while*/ - } + break; /*end of error-while*/ + } - /*cleanup*/ - uivector_cleanup(&lz77_encoded); - HuffmanTree_cleanup(&tree_ll); - HuffmanTree_cleanup(&tree_d); - HuffmanTree_cleanup(&tree_cl); - uivector_cleanup(&frequencies_ll); - uivector_cleanup(&frequencies_d); - uivector_cleanup(&frequencies_cl); - uivector_cleanup(&bitlen_lld_e); - uivector_cleanup(&bitlen_lld); - uivector_cleanup(&bitlen_cl); + /*cleanup*/ + uivector_cleanup(&lz77_encoded); + HuffmanTree_cleanup(&tree_ll); + HuffmanTree_cleanup(&tree_d); + HuffmanTree_cleanup(&tree_cl); + uivector_cleanup(&frequencies_ll); + uivector_cleanup(&frequencies_d); + uivector_cleanup(&frequencies_cl); + uivector_cleanup(&bitlen_lld_e); + uivector_cleanup(&bitlen_lld); + uivector_cleanup(&bitlen_cl); - return error; + return error; } -static unsigned deflateFixed(ucvector* out, size_t* bp, Hash* hash, - const unsigned char* data, +static unsigned deflateFixed(ucvector* out, size_t* bp, Hash* hash, const unsigned char* data, size_t datapos, size_t dataend, const LodePNGCompressSettings* settings, unsigned final) { - HuffmanTree tree_ll; /*tree for literal values and length codes*/ - HuffmanTree tree_d; /*tree for distance codes*/ + HuffmanTree tree_ll; /*tree for literal values and length codes*/ + HuffmanTree tree_d; /*tree for distance codes*/ - unsigned BFINAL = final; - unsigned error = 0; - size_t i; + unsigned BFINAL = final; + unsigned error = 0; + size_t i; - HuffmanTree_init(&tree_ll); - HuffmanTree_init(&tree_d); + HuffmanTree_init(&tree_ll); + HuffmanTree_init(&tree_d); - error = generateFixedLitLenTree(&tree_ll); - if (error) return error; + error = generateFixedLitLenTree(&tree_ll); + if (error) + return error; - error = generateFixedDistanceTree(&tree_d); - if (error) - { - HuffmanTree_cleanup(&tree_ll); - return error; - } + error = generateFixedDistanceTree(&tree_d); + if (error) + { + HuffmanTree_cleanup(&tree_ll); + return error; + } - addBitToStream(bp, out, BFINAL); - addBitToStream(bp, out, 1); /*first bit of BTYPE*/ - addBitToStream(bp, out, 0); /*second bit of BTYPE*/ + addBitToStream(bp, out, BFINAL); + addBitToStream(bp, out, 1); /*first bit of BTYPE*/ + addBitToStream(bp, out, 0); /*second bit of BTYPE*/ - if(settings->use_lz77) /*LZ77 encoded*/ - { - uivector lz77_encoded; - uivector_init(&lz77_encoded); - error = encodeLZ77(&lz77_encoded, hash, data, datapos, dataend, settings->windowsize, - settings->minmatch, settings->nicematch, settings->lazymatching); - if(!error) writeLZ77data(bp, out, &lz77_encoded, &tree_ll, &tree_d); - uivector_cleanup(&lz77_encoded); - } - else /*no LZ77, but still will be Huffman compressed*/ - { - for(i = datapos; i < dataend; i++) - { - addHuffmanSymbol(bp, out, HuffmanTree_getCode(&tree_ll, data[i]), HuffmanTree_getLength(&tree_ll, data[i])); - } - } - /*add END code*/ - if(!error) addHuffmanSymbol(bp, out, HuffmanTree_getCode(&tree_ll, 256), HuffmanTree_getLength(&tree_ll, 256)); + if (settings->use_lz77) /*LZ77 encoded*/ + { + uivector lz77_encoded; + uivector_init(&lz77_encoded); + error = encodeLZ77(&lz77_encoded, hash, data, datapos, dataend, settings->windowsize, + settings->minmatch, settings->nicematch, settings->lazymatching); + if (!error) + writeLZ77data(bp, out, &lz77_encoded, &tree_ll, &tree_d); + uivector_cleanup(&lz77_encoded); + } + else /*no LZ77, but still will be Huffman compressed*/ + { + for (i = datapos; i < dataend; i++) + { + addHuffmanSymbol(bp, out, HuffmanTree_getCode(&tree_ll, data[i]), + HuffmanTree_getLength(&tree_ll, data[i])); + } + } + /*add END code*/ + if (!error) + addHuffmanSymbol(bp, out, HuffmanTree_getCode(&tree_ll, 256), + HuffmanTree_getLength(&tree_ll, 256)); - /*cleanup*/ - HuffmanTree_cleanup(&tree_ll); - HuffmanTree_cleanup(&tree_d); + /*cleanup*/ + HuffmanTree_cleanup(&tree_ll); + HuffmanTree_cleanup(&tree_d); - return error; + return error; } static unsigned lodepng_deflatev(ucvector* out, const unsigned char* in, size_t insize, const LodePNGCompressSettings* settings) { - unsigned error = 0; - size_t i, blocksize, numdeflateblocks; - size_t bp = 0; /*the bit pointer*/ - Hash hash; + unsigned error = 0; + size_t i, blocksize, numdeflateblocks; + size_t bp = 0; /*the bit pointer*/ + Hash hash; - if(settings->btype > 2) return 61; - else if(settings->btype == 0) return deflateNoCompression(out, in, insize); - else if(settings->btype == 1) blocksize = insize; - else /*if(settings->btype == 2)*/ - { - blocksize = insize / 8 + 8; - if(blocksize < 65535) blocksize = 65535; - } + if (settings->btype > 2) + return 61; + else if (settings->btype == 0) + return deflateNoCompression(out, in, insize); + else if (settings->btype == 1) + blocksize = insize; + else /*if(settings->btype == 2)*/ + { + blocksize = insize / 8 + 8; + if (blocksize < 65535) + blocksize = 65535; + } - numdeflateblocks = (insize + blocksize - 1) / blocksize; - if(numdeflateblocks == 0) numdeflateblocks = 1; + numdeflateblocks = (insize + blocksize - 1) / blocksize; + if (numdeflateblocks == 0) + numdeflateblocks = 1; - error = hash_init(&hash, settings->windowsize); - if(error) + error = hash_init(&hash, settings->windowsize); + if (error) goto fail; - for(i = 0; i < numdeflateblocks && !error; i++) - { - unsigned final = (i == numdeflateblocks - 1); - size_t start = i * blocksize; - size_t end = start + blocksize; - if(end > insize) end = insize; + for (i = 0; i < numdeflateblocks && !error; i++) + { + unsigned final = (i == numdeflateblocks - 1); + size_t start = i * blocksize; + size_t end = start + blocksize; + if (end > insize) + end = insize; - if(settings->btype == 1) error = deflateFixed(out, &bp, &hash, in, start, end, settings, final); - else if(settings->btype == 2) error = deflateDynamic(out, &bp, &hash, in, start, end, settings, final); - } + if (settings->btype == 1) + error = deflateFixed(out, &bp, &hash, in, start, end, settings, final); + else if (settings->btype == 2) + error = deflateDynamic(out, &bp, &hash, in, start, end, settings, final); + } fail: - hash_cleanup(&hash); + hash_cleanup(&hash); - return error; + return error; } -unsigned lodepng_deflate(unsigned char** out, size_t* outsize, - const unsigned char* in, size_t insize, - const LodePNGCompressSettings* settings) +unsigned lodepng_deflate(unsigned char** out, size_t* outsize, const unsigned char* in, + size_t insize, const LodePNGCompressSettings* settings) { - unsigned error; - ucvector v; - ucvector_init_buffer(&v, *out, *outsize); - error = lodepng_deflatev(&v, in, insize, settings); - *out = v.data; - *outsize = v.size; - return error; + unsigned error; + ucvector v; + ucvector_init_buffer(&v, *out, *outsize); + error = lodepng_deflatev(&v, in, insize, settings); + *out = v.data; + *outsize = v.size; + return error; } -static unsigned deflate(unsigned char** out, size_t* outsize, - const unsigned char* in, size_t insize, - const LodePNGCompressSettings* settings) +static unsigned deflate(unsigned char** out, size_t* outsize, const unsigned char* in, + size_t insize, const LodePNGCompressSettings* settings) { - if(settings->custom_deflate) - { - return settings->custom_deflate(out, outsize, in, insize, settings); - } - else - { - return lodepng_deflate(out, outsize, in, insize, settings); - } + if (settings->custom_deflate) + { + return settings->custom_deflate(out, outsize, in, insize, settings); + } + else + { + return lodepng_deflate(out, outsize, in, insize, settings); + } } #endif /*LODEPNG_COMPILE_DECODER*/ @@ -2089,31 +2324,32 @@ static unsigned deflate(unsigned char** out, size_t* outsize, static unsigned update_adler32(unsigned adler, const unsigned char* data, unsigned len) { - unsigned s1 = adler & 0xffff; - unsigned s2 = (adler >> 16) & 0xffff; + unsigned s1 = adler & 0xffff; + unsigned s2 = (adler >> 16) & 0xffff; - while(len > 0) - { - /*at least 5550 sums can be done before the sums overflow, saving a lot of module divisions*/ - unsigned amount = len > 5550 ? 5550 : len; - len -= amount; - while(amount > 0) - { - s1 += (*data++); - s2 += s1; - amount--; - } - s1 %= 65521; - s2 %= 65521; - } + while (len > 0) + { + /*at least 5550 sums can be done before the sums overflow, saving a lot of module + * divisions*/ + unsigned amount = len > 5550 ? 5550 : len; + len -= amount; + while (amount > 0) + { + s1 += (*data++); + s2 += s1; + amount--; + } + s1 %= 65521; + s2 %= 65521; + } - return (s2 << 16) | s1; + return (s2 << 16) | s1; } /*Return the adler32 of the bytes data[0..len-1]*/ static unsigned adler32(const unsigned char* data, unsigned len) { - return update_adler32(1L, data, len); + return update_adler32(1L, data, len); } /* ////////////////////////////////////////////////////////////////////////// */ @@ -2125,59 +2361,64 @@ static unsigned adler32(const unsigned char* data, unsigned len) unsigned lodepng_zlib_decompress(unsigned char** out, size_t* outsize, const unsigned char* in, size_t insize, const LodePNGDecompressSettings* settings) { - unsigned error = 0; - unsigned CM, CINFO, FDICT; + unsigned error = 0; + unsigned CM, CINFO, FDICT; - if(insize < 2) return 53; /*error, size of zlib data too small*/ - /*read information from zlib header*/ - if((in[0] * 256 + in[1]) % 31 != 0) - { - /*error: 256 * in[0] + in[1] must be a multiple of 31, the FCHECK value is supposed to be made that way*/ - return 24; - } + if (insize < 2) + return 53; /*error, size of zlib data too small*/ + /*read information from zlib header*/ + if ((in[0] * 256 + in[1]) % 31 != 0) + { + /*error: 256 * in[0] + in[1] must be a multiple of 31, the FCHECK value is supposed to be + * made that way*/ + return 24; + } - CM = in[0] & 15; - CINFO = (in[0] >> 4) & 15; - /*FCHECK = in[1] & 31;*/ /*FCHECK is already tested above*/ - FDICT = (in[1] >> 5) & 1; - /*FLEVEL = (in[1] >> 6) & 3;*/ /*FLEVEL is not used here*/ + CM = in[0] & 15; + CINFO = (in[0] >> 4) & 15; + /*FCHECK = in[1] & 31;*/ /*FCHECK is already tested above*/ + FDICT = (in[1] >> 5) & 1; + /*FLEVEL = (in[1] >> 6) & 3;*/ /*FLEVEL is not used here*/ - if(CM != 8 || CINFO > 7) - { - /*error: only compression method 8: inflate with sliding window of 32k is supported by the PNG spec*/ - return 25; - } - if(FDICT != 0) - { - /*error: the specification of PNG says about the zlib stream: - "The additional flags shall not specify a preset dictionary."*/ - return 26; - } + if (CM != 8 || CINFO > 7) + { + /*error: only compression method 8: inflate with sliding window of 32k is supported by the + * PNG spec*/ + return 25; + } + if (FDICT != 0) + { + /*error: the specification of PNG says about the zlib stream: + "The additional flags shall not specify a preset dictionary."*/ + return 26; + } - error = inflate(out, outsize, in + 2, insize - 2, settings); - if(error) return error; + error = inflate(out, outsize, in + 2, insize - 2, settings); + if (error) + return error; - if(!settings->ignore_adler32) - { - unsigned ADLER32 = lodepng_read32bitInt(&in[insize - 4]); - unsigned checksum = adler32(*out, (unsigned)(*outsize)); - if(checksum != ADLER32) return 58; /*error, adler checksum not correct, data must be corrupted*/ - } + if (!settings->ignore_adler32) + { + unsigned ADLER32 = lodepng_read32bitInt(&in[insize - 4]); + unsigned checksum = adler32(*out, (unsigned)(*outsize)); + if (checksum != ADLER32) + return 58; /*error, adler checksum not correct, data must be corrupted*/ + } - return 0; /*no error*/ + return 0; /*no error*/ } static unsigned zlib_decompress(unsigned char** out, size_t* outsize, const unsigned char* in, size_t insize, const LodePNGDecompressSettings* settings) { - if(settings->custom_zlib) - { - return settings->custom_zlib(out, outsize, in, insize, settings); - } - else - { - return lodepng_zlib_decompress(out, outsize, in, insize, settings); - } + if (settings->custom_zlib) + { + return settings->custom_zlib(out, outsize, in, insize, settings); + } + else + { + return lodepng_zlib_decompress(out, outsize, in, insize, settings); + } } #endif /*LODEPNG_COMPILE_DECODER*/ @@ -2187,69 +2428,74 @@ static unsigned zlib_decompress(unsigned char** out, size_t* outsize, const unsi unsigned lodepng_zlib_compress(unsigned char** out, size_t* outsize, const unsigned char* in, size_t insize, const LodePNGCompressSettings* settings) { - /*initially, *out must be NULL and outsize 0, if you just give some random *out - that's pointing to a non allocated buffer, this'll crash*/ - ucvector outv; - size_t i; - unsigned error; - unsigned char* deflatedata = 0; - size_t deflatesize = 0; + /*initially, *out must be NULL and outsize 0, if you just give some random *out + that's pointing to a non allocated buffer, this'll crash*/ + ucvector outv; + size_t i; + unsigned error; + unsigned char* deflatedata = 0; + size_t deflatesize = 0; - unsigned ADLER32; - /*zlib data: 1 byte CMF (CM+CINFO), 1 byte FLG, deflate data, 4 byte ADLER32 checksum of the Decompressed data*/ - unsigned CMF = 120; /*0b01111000: CM 8, CINFO 7. With CINFO 7, any window size up to 32768 can be used.*/ - unsigned FLEVEL = 0; - unsigned FDICT = 0; - unsigned CMFFLG = 256 * CMF + FDICT * 32 + FLEVEL * 64; - unsigned FCHECK = 31 - CMFFLG % 31; - CMFFLG += FCHECK; + unsigned ADLER32; + /*zlib data: 1 byte CMF (CM+CINFO), 1 byte FLG, deflate data, 4 byte ADLER32 checksum of the + * Decompressed data*/ + unsigned CMF = + 120; /*0b01111000: CM 8, CINFO 7. With CINFO 7, any window size up to 32768 can be used.*/ + unsigned FLEVEL = 0; + unsigned FDICT = 0; + unsigned CMFFLG = 256 * CMF + FDICT * 32 + FLEVEL * 64; + unsigned FCHECK = 31 - CMFFLG % 31; + CMFFLG += FCHECK; - /*ucvector-controlled version of the output buffer, for dynamic array*/ - ucvector_init_buffer(&outv, *out, *outsize); + /*ucvector-controlled version of the output buffer, for dynamic array*/ + ucvector_init_buffer(&outv, *out, *outsize); - if (!ucvector_push_back(&outv, (unsigned char)(CMFFLG / 256))) return 83; - if (!ucvector_push_back(&outv, (unsigned char)(CMFFLG % 256))) return 83; + if (!ucvector_push_back(&outv, (unsigned char)(CMFFLG / 256))) + return 83; + if (!ucvector_push_back(&outv, (unsigned char)(CMFFLG % 256))) + return 83; - error = deflate(&deflatedata, &deflatesize, in, insize, settings); + error = deflate(&deflatedata, &deflatesize, in, insize, settings); - if(!error) - { - ADLER32 = adler32(in, (unsigned)insize); - for(i = 0; i < deflatesize; i++) - { - if (!ucvector_push_back(&outv, deflatedata[i])) return 83; - } - free(deflatedata); - error = !lodepng_add32bitInt(&outv, ADLER32); - } + if (!error) + { + ADLER32 = adler32(in, (unsigned)insize); + for (i = 0; i < deflatesize; i++) + { + if (!ucvector_push_back(&outv, deflatedata[i])) + return 83; + } + free(deflatedata); + error = !lodepng_add32bitInt(&outv, ADLER32); + } - if (!error) - { - *out = outv.data; - *outsize = outv.size; - } - else - { - *out = NULL; - *outsize = 0; - ucvector_cleanup(&outv); - } + if (!error) + { + *out = outv.data; + *outsize = outv.size; + } + else + { + *out = NULL; + *outsize = 0; + ucvector_cleanup(&outv); + } - return error; + return error; } /* compress using the default or custom zlib function */ static unsigned zlib_compress(unsigned char** out, size_t* outsize, const unsigned char* in, size_t insize, const LodePNGCompressSettings* settings) { - if(settings->custom_zlib) - { - return settings->custom_zlib(out, outsize, in, insize, settings); - } - else - { - return lodepng_zlib_compress(out, outsize, in, insize, settings); - } + if (settings->custom_zlib) + { + return settings->custom_zlib(out, outsize, in, insize, settings); + } + else + { + return lodepng_zlib_compress(out, outsize, in, insize, settings); + } } #endif /*LODEPNG_COMPILE_ENCODER*/ @@ -2260,16 +2506,18 @@ static unsigned zlib_compress(unsigned char** out, size_t* outsize, const unsign static unsigned zlib_decompress(unsigned char** out, size_t* outsize, const unsigned char* in, size_t insize, const LodePNGDecompressSettings* settings) { - if (!settings->custom_zlib) return 87; /*no custom zlib function provided */ - return settings->custom_zlib(out, outsize, in, insize, settings); + if (!settings->custom_zlib) + return 87; /*no custom zlib function provided */ + return settings->custom_zlib(out, outsize, in, insize, settings); } #endif /*LODEPNG_COMPILE_DECODER*/ #ifdef LODEPNG_COMPILE_ENCODER static unsigned zlib_compress(unsigned char** out, size_t* outsize, const unsigned char* in, size_t insize, const LodePNGCompressSettings* settings) { - if (!settings->custom_zlib) return 87; /*no custom zlib function provided */ - return settings->custom_zlib(out, outsize, in, insize, settings); + if (!settings->custom_zlib) + return 87; /*no custom zlib function provided */ + return settings->custom_zlib(out, outsize, in, insize, settings); } #endif /*LODEPNG_COMPILE_ENCODER*/ @@ -2284,21 +2532,23 @@ static unsigned zlib_compress(unsigned char** out, size_t* outsize, const unsign void lodepng_compress_settings_init(LodePNGCompressSettings* settings) { - /*compress with dynamic huffman tree (not in the mathematical sense, just not the predefined one)*/ - settings->btype = 2; - settings->use_lz77 = 1; - settings->windowsize = DEFAULT_WINDOWSIZE; - settings->minmatch = 3; - settings->nicematch = 128; - settings->lazymatching = 1; + /*compress with dynamic huffman tree (not in the mathematical sense, just not the predefined + * one)*/ + settings->btype = 2; + settings->use_lz77 = 1; + settings->windowsize = DEFAULT_WINDOWSIZE; + settings->minmatch = 3; + settings->nicematch = 128; + settings->lazymatching = 1; - settings->custom_zlib = 0; - settings->custom_deflate = 0; - settings->custom_context = 0; + settings->custom_zlib = 0; + settings->custom_deflate = 0; + settings->custom_context = 0; } -const LodePNGCompressSettings lodepng_default_compress_settings = {2, 1, DEFAULT_WINDOWSIZE, 3, 128, 1, 0, 0, 0}; - +const LodePNGCompressSettings lodepng_default_compress_settings = { 2, 1, DEFAULT_WINDOWSIZE, + 3, 128, 1, + 0, 0, 0 }; #endif /*LODEPNG_COMPILE_ENCODER*/ @@ -2306,14 +2556,14 @@ const LodePNGCompressSettings lodepng_default_compress_settings = {2, 1, DEFAULT void lodepng_decompress_settings_init(LodePNGDecompressSettings* settings) { - settings->ignore_adler32 = 0; + settings->ignore_adler32 = 0; - settings->custom_zlib = 0; - settings->custom_inflate = 0; - settings->custom_context = 0; + settings->custom_zlib = 0; + settings->custom_inflate = 0; + settings->custom_context = 0; } -const LodePNGDecompressSettings lodepng_default_decompress_settings = {0, 0, 0, 0}; +const LodePNGDecompressSettings lodepng_default_decompress_settings = { 0, 0, 0, 0 }; #endif /*LODEPNG_COMPILE_DECODER*/ @@ -2331,51 +2581,56 @@ const LodePNGDecompressSettings lodepng_default_decompress_settings = {0, 0, 0, /* CRC polynomial: 0xedb88320 */ static unsigned lodepng_crc32_table[256] = { - 0u, 1996959894u, 3993919788u, 2567524794u, 124634137u, 1886057615u, 3915621685u, 2657392035u, - 249268274u, 2044508324u, 3772115230u, 2547177864u, 162941995u, 2125561021u, 3887607047u, 2428444049u, - 498536548u, 1789927666u, 4089016648u, 2227061214u, 450548861u, 1843258603u, 4107580753u, 2211677639u, - 325883990u, 1684777152u, 4251122042u, 2321926636u, 335633487u, 1661365465u, 4195302755u, 2366115317u, - 997073096u, 1281953886u, 3579855332u, 2724688242u, 1006888145u, 1258607687u, 3524101629u, 2768942443u, - 901097722u, 1119000684u, 3686517206u, 2898065728u, 853044451u, 1172266101u, 3705015759u, 2882616665u, - 651767980u, 1373503546u, 3369554304u, 3218104598u, 565507253u, 1454621731u, 3485111705u, 3099436303u, - 671266974u, 1594198024u, 3322730930u, 2970347812u, 795835527u, 1483230225u, 3244367275u, 3060149565u, - 1994146192u, 31158534u, 2563907772u, 4023717930u, 1907459465u, 112637215u, 2680153253u, 3904427059u, - 2013776290u, 251722036u, 2517215374u, 3775830040u, 2137656763u, 141376813u, 2439277719u, 3865271297u, - 1802195444u, 476864866u, 2238001368u, 4066508878u, 1812370925u, 453092731u, 2181625025u, 4111451223u, - 1706088902u, 314042704u, 2344532202u, 4240017532u, 1658658271u, 366619977u, 2362670323u, 4224994405u, - 1303535960u, 984961486u, 2747007092u, 3569037538u, 1256170817u, 1037604311u, 2765210733u, 3554079995u, - 1131014506u, 879679996u, 2909243462u, 3663771856u, 1141124467u, 855842277u, 2852801631u, 3708648649u, - 1342533948u, 654459306u, 3188396048u, 3373015174u, 1466479909u, 544179635u, 3110523913u, 3462522015u, - 1591671054u, 702138776u, 2966460450u, 3352799412u, 1504918807u, 783551873u, 3082640443u, 3233442989u, - 3988292384u, 2596254646u, 62317068u, 1957810842u, 3939845945u, 2647816111u, 81470997u, 1943803523u, - 3814918930u, 2489596804u, 225274430u, 2053790376u, 3826175755u, 2466906013u, 167816743u, 2097651377u, - 4027552580u, 2265490386u, 503444072u, 1762050814u, 4150417245u, 2154129355u, 426522225u, 1852507879u, - 4275313526u, 2312317920u, 282753626u, 1742555852u, 4189708143u, 2394877945u, 397917763u, 1622183637u, - 3604390888u, 2714866558u, 953729732u, 1340076626u, 3518719985u, 2797360999u, 1068828381u, 1219638859u, - 3624741850u, 2936675148u, 906185462u, 1090812512u, 3747672003u, 2825379669u, 829329135u, 1181335161u, - 3412177804u, 3160834842u, 628085408u, 1382605366u, 3423369109u, 3138078467u, 570562233u, 1426400815u, - 3317316542u, 2998733608u, 733239954u, 1555261956u, 3268935591u, 3050360625u, 752459403u, 1541320221u, - 2607071920u, 3965973030u, 1969922972u, 40735498u, 2617837225u, 3943577151u, 1913087877u, 83908371u, - 2512341634u, 3803740692u, 2075208622u, 213261112u, 2463272603u, 3855990285u, 2094854071u, 198958881u, - 2262029012u, 4057260610u, 1759359992u, 534414190u, 2176718541u, 4139329115u, 1873836001u, 414664567u, - 2282248934u, 4279200368u, 1711684554u, 285281116u, 2405801727u, 4167216745u, 1634467795u, 376229701u, - 2685067896u, 3608007406u, 1308918612u, 956543938u, 2808555105u, 3495958263u, 1231636301u, 1047427035u, - 2932959818u, 3654703836u, 1088359270u, 936918000u, 2847714899u, 3736837829u, 1202900863u, 817233897u, - 3183342108u, 3401237130u, 1404277552u, 615818150u, 3134207493u, 3453421203u, 1423857449u, 601450431u, - 3009837614u, 3294710456u, 1567103746u, 711928724u, 3020668471u, 3272380065u, 1510334235u, 755167117u + 0u, 1996959894u, 3993919788u, 2567524794u, 124634137u, 1886057615u, 3915621685u, + 2657392035u, 249268274u, 2044508324u, 3772115230u, 2547177864u, 162941995u, 2125561021u, + 3887607047u, 2428444049u, 498536548u, 1789927666u, 4089016648u, 2227061214u, 450548861u, + 1843258603u, 4107580753u, 2211677639u, 325883990u, 1684777152u, 4251122042u, 2321926636u, + 335633487u, 1661365465u, 4195302755u, 2366115317u, 997073096u, 1281953886u, 3579855332u, + 2724688242u, 1006888145u, 1258607687u, 3524101629u, 2768942443u, 901097722u, 1119000684u, + 3686517206u, 2898065728u, 853044451u, 1172266101u, 3705015759u, 2882616665u, 651767980u, + 1373503546u, 3369554304u, 3218104598u, 565507253u, 1454621731u, 3485111705u, 3099436303u, + 671266974u, 1594198024u, 3322730930u, 2970347812u, 795835527u, 1483230225u, 3244367275u, + 3060149565u, 1994146192u, 31158534u, 2563907772u, 4023717930u, 1907459465u, 112637215u, + 2680153253u, 3904427059u, 2013776290u, 251722036u, 2517215374u, 3775830040u, 2137656763u, + 141376813u, 2439277719u, 3865271297u, 1802195444u, 476864866u, 2238001368u, 4066508878u, + 1812370925u, 453092731u, 2181625025u, 4111451223u, 1706088902u, 314042704u, 2344532202u, + 4240017532u, 1658658271u, 366619977u, 2362670323u, 4224994405u, 1303535960u, 984961486u, + 2747007092u, 3569037538u, 1256170817u, 1037604311u, 2765210733u, 3554079995u, 1131014506u, + 879679996u, 2909243462u, 3663771856u, 1141124467u, 855842277u, 2852801631u, 3708648649u, + 1342533948u, 654459306u, 3188396048u, 3373015174u, 1466479909u, 544179635u, 3110523913u, + 3462522015u, 1591671054u, 702138776u, 2966460450u, 3352799412u, 1504918807u, 783551873u, + 3082640443u, 3233442989u, 3988292384u, 2596254646u, 62317068u, 1957810842u, 3939845945u, + 2647816111u, 81470997u, 1943803523u, 3814918930u, 2489596804u, 225274430u, 2053790376u, + 3826175755u, 2466906013u, 167816743u, 2097651377u, 4027552580u, 2265490386u, 503444072u, + 1762050814u, 4150417245u, 2154129355u, 426522225u, 1852507879u, 4275313526u, 2312317920u, + 282753626u, 1742555852u, 4189708143u, 2394877945u, 397917763u, 1622183637u, 3604390888u, + 2714866558u, 953729732u, 1340076626u, 3518719985u, 2797360999u, 1068828381u, 1219638859u, + 3624741850u, 2936675148u, 906185462u, 1090812512u, 3747672003u, 2825379669u, 829329135u, + 1181335161u, 3412177804u, 3160834842u, 628085408u, 1382605366u, 3423369109u, 3138078467u, + 570562233u, 1426400815u, 3317316542u, 2998733608u, 733239954u, 1555261956u, 3268935591u, + 3050360625u, 752459403u, 1541320221u, 2607071920u, 3965973030u, 1969922972u, 40735498u, + 2617837225u, 3943577151u, 1913087877u, 83908371u, 2512341634u, 3803740692u, 2075208622u, + 213261112u, 2463272603u, 3855990285u, 2094854071u, 198958881u, 2262029012u, 4057260610u, + 1759359992u, 534414190u, 2176718541u, 4139329115u, 1873836001u, 414664567u, 2282248934u, + 4279200368u, 1711684554u, 285281116u, 2405801727u, 4167216745u, 1634467795u, 376229701u, + 2685067896u, 3608007406u, 1308918612u, 956543938u, 2808555105u, 3495958263u, 1231636301u, + 1047427035u, 2932959818u, 3654703836u, 1088359270u, 936918000u, 2847714899u, 3736837829u, + 1202900863u, 817233897u, 3183342108u, 3401237130u, 1404277552u, 615818150u, 3134207493u, + 3453421203u, 1423857449u, 601450431u, 3009837614u, 3294710456u, 1567103746u, 711928724u, + 3020668471u, 3272380065u, 1510334235u, 755167117u }; /*Return the CRC of the bytes buf[0..len-1].*/ unsigned lodepng_crc32(const unsigned char* buf, size_t len) { - unsigned c = 0xffffffffL; - size_t n; + unsigned c = 0xffffffffL; + size_t n; - for(n = 0; n < len; n++) - { - c = lodepng_crc32_table[(c ^ buf[n]) & 0xff] ^ (c >> 8); - } - return c ^ 0xffffffffL; + for (n = 0; n < len; n++) + { + c = lodepng_crc32_table[(c ^ buf[n]) & 0xff] ^ (c >> 8); + } + return c ^ 0xffffffffL; } /* ////////////////////////////////////////////////////////////////////////// */ @@ -2384,49 +2639,51 @@ unsigned lodepng_crc32(const unsigned char* buf, size_t len) static unsigned char readBitFromReversedStream(size_t* bitpointer, const unsigned char* bitstream) { - unsigned char result = (unsigned char)((bitstream[(*bitpointer) >> 3] >> (7 - ((*bitpointer) & 0x7))) & 1); - (*bitpointer)++; - return result; + unsigned char result = + (unsigned char)((bitstream[(*bitpointer) >> 3] >> (7 - ((*bitpointer) & 0x7))) & 1); + (*bitpointer)++; + return result; } -static unsigned readBitsFromReversedStream(size_t* bitpointer, const unsigned char* bitstream, size_t nbits) +static unsigned readBitsFromReversedStream(size_t* bitpointer, const unsigned char* bitstream, + size_t nbits) { - unsigned result = 0; - size_t i; - for(i = nbits - 1; i < nbits; i--) - { - result += (unsigned)readBitFromReversedStream(bitpointer, bitstream) << i; - } - return result; + unsigned result = 0; + size_t i; + for (i = nbits - 1; i < nbits; i--) + { + result += (unsigned)readBitFromReversedStream(bitpointer, bitstream) << i; + } + return result; } #ifdef LODEPNG_COMPILE_DECODER static void setBitOfReversedStream0(size_t* bitpointer, unsigned char* bitstream, unsigned char bit) { - /*the current bit in bitstream must be 0 for this to work*/ - if(bit) - { - /*earlier bit of huffman code is in a lesser significant bit of an earlier byte*/ - bitstream[(*bitpointer) >> 3] |= (bit << (7 - ((*bitpointer) & 0x7))); - } - (*bitpointer)++; + /*the current bit in bitstream must be 0 for this to work*/ + if (bit) + { + /*earlier bit of huffman code is in a lesser significant bit of an earlier byte*/ + bitstream[(*bitpointer) >> 3] |= (bit << (7 - ((*bitpointer) & 0x7))); + } + (*bitpointer)++; } #endif /*LODEPNG_COMPILE_DECODER*/ static void setBitOfReversedStream(size_t* bitpointer, unsigned char* bitstream, unsigned char bit) { - /*the current bit in bitstream may be 0 or 1 for this to work*/ - if(bit == 0) - { - size_t pos = (*bitpointer) >> 3; - bitstream[pos] &= (unsigned char)(~(1 << (7 - ((*bitpointer) & 0x7)))); - } - else - { - size_t pos = (*bitpointer) >> 3; - bitstream[pos] |= (1 << (7 - ((*bitpointer) & 0x7))); - } - (*bitpointer)++; + /*the current bit in bitstream may be 0 or 1 for this to work*/ + if (bit == 0) + { + size_t pos = (*bitpointer) >> 3; + bitstream[pos] &= (unsigned char)(~(1 << (7 - ((*bitpointer) & 0x7)))); + } + else + { + size_t pos = (*bitpointer) >> 3; + bitstream[pos] |= (1 << (7 - ((*bitpointer) & 0x7))); + } + (*bitpointer)++; } /* ////////////////////////////////////////////////////////////////////////// */ @@ -2435,124 +2692,135 @@ static void setBitOfReversedStream(size_t* bitpointer, unsigned char* bitstream, unsigned lodepng_chunk_length(const unsigned char* chunk) { - return lodepng_read32bitInt(&chunk[0]); + return lodepng_read32bitInt(&chunk[0]); } void lodepng_chunk_type(char type[5], const unsigned char* chunk) { - unsigned i; - for(i = 0; i < 4; i++) type[i] = (char)chunk[4 + i]; - type[4] = 0; /*null termination char*/ + unsigned i; + for (i = 0; i < 4; i++) + type[i] = (char)chunk[4 + i]; + type[4] = 0; /*null termination char*/ } unsigned char lodepng_chunk_type_equals(const unsigned char* chunk, const char* type) { - if(strlen(type) != 4) return 0; - return (chunk[4] == type[0] && chunk[5] == type[1] && chunk[6] == type[2] && chunk[7] == type[3]); + if (strlen(type) != 4) + return 0; + return (chunk[4] == type[0] && chunk[5] == type[1] && chunk[6] == type[2] && + chunk[7] == type[3]); } unsigned char lodepng_chunk_ancillary(const unsigned char* chunk) { - return((chunk[4] & 32) != 0); + return ((chunk[4] & 32) != 0); } unsigned char lodepng_chunk_private(const unsigned char* chunk) { - return((chunk[6] & 32) != 0); + return ((chunk[6] & 32) != 0); } unsigned char lodepng_chunk_safetocopy(const unsigned char* chunk) { - return((chunk[7] & 32) != 0); + return ((chunk[7] & 32) != 0); } unsigned char* lodepng_chunk_data(unsigned char* chunk) { - return &chunk[8]; + return &chunk[8]; } const unsigned char* lodepng_chunk_data_const(const unsigned char* chunk) { - return &chunk[8]; + return &chunk[8]; } unsigned lodepng_chunk_check_crc(const unsigned char* chunk) { - unsigned length = lodepng_chunk_length(chunk); - unsigned CRC = lodepng_read32bitInt(&chunk[length + 8]); - /*the CRC is taken of the data and the 4 chunk type letters, not the length*/ - unsigned checksum = lodepng_crc32(&chunk[4], length + 4); - if(CRC != checksum) return 1; - else return 0; + unsigned length = lodepng_chunk_length(chunk); + unsigned CRC = lodepng_read32bitInt(&chunk[length + 8]); + /*the CRC is taken of the data and the 4 chunk type letters, not the length*/ + unsigned checksum = lodepng_crc32(&chunk[4], length + 4); + if (CRC != checksum) + return 1; + else + return 0; } void lodepng_chunk_generate_crc(unsigned char* chunk) { - unsigned length = lodepng_chunk_length(chunk); - unsigned CRC = lodepng_crc32(&chunk[4], length + 4); - lodepng_set32bitInt(chunk + 8 + length, CRC); + unsigned length = lodepng_chunk_length(chunk); + unsigned CRC = lodepng_crc32(&chunk[4], length + 4); + lodepng_set32bitInt(chunk + 8 + length, CRC); } unsigned char* lodepng_chunk_next(unsigned char* chunk) { - unsigned total_chunk_length = lodepng_chunk_length(chunk) + 12; - return &chunk[total_chunk_length]; + unsigned total_chunk_length = lodepng_chunk_length(chunk) + 12; + return &chunk[total_chunk_length]; } const unsigned char* lodepng_chunk_next_const(const unsigned char* chunk) { - unsigned total_chunk_length = lodepng_chunk_length(chunk) + 12; - return &chunk[total_chunk_length]; + unsigned total_chunk_length = lodepng_chunk_length(chunk) + 12; + return &chunk[total_chunk_length]; } unsigned lodepng_chunk_append(unsigned char** out, size_t* outlength, const unsigned char* chunk) { - unsigned i; - unsigned total_chunk_length = lodepng_chunk_length(chunk) + 12; - unsigned char *chunk_start, *new_buffer; - size_t new_length = (*outlength) + total_chunk_length; - if(new_length < total_chunk_length || new_length < (*outlength)) return 77; /*integer overflow happened*/ + unsigned i; + unsigned total_chunk_length = lodepng_chunk_length(chunk) + 12; + unsigned char *chunk_start, *new_buffer; + size_t new_length = (*outlength) + total_chunk_length; + if (new_length < total_chunk_length || new_length < (*outlength)) + return 77; /*integer overflow happened*/ - new_buffer = (unsigned char*)realloc(*out, new_length); - if(!new_buffer) return 83; /*alloc fail*/ - (*out) = new_buffer; - (*outlength) = new_length; - chunk_start = &(*out)[new_length - total_chunk_length]; + new_buffer = (unsigned char*)realloc(*out, new_length); + if (!new_buffer) + return 83; /*alloc fail*/ + (*out) = new_buffer; + (*outlength) = new_length; + chunk_start = &(*out)[new_length - total_chunk_length]; - for(i = 0; i < total_chunk_length; i++) chunk_start[i] = chunk[i]; + for (i = 0; i < total_chunk_length; i++) + chunk_start[i] = chunk[i]; - return 0; + return 0; } unsigned lodepng_chunk_create(unsigned char** out, size_t* outlength, unsigned length, const char* type, const unsigned char* data) { - unsigned i; - unsigned char *chunk, *new_buffer; - size_t new_length = (*outlength) + length + 12; - if(new_length < length + 12 || new_length < (*outlength)) return 77; /*integer overflow happened*/ - new_buffer = (unsigned char*)realloc(*out, new_length); - if(!new_buffer) return 83; /*alloc fail*/ - (*out) = new_buffer; - (*outlength) = new_length; - chunk = &(*out)[(*outlength) - length - 12]; + unsigned i; + unsigned char *chunk, *new_buffer; + size_t new_length = (*outlength) + length + 12; + if (new_length < length + 12 || new_length < (*outlength)) + return 77; /*integer overflow happened*/ + new_buffer = (unsigned char*)realloc(*out, new_length); + if (!new_buffer) + return 83; /*alloc fail*/ + (*out) = new_buffer; + (*outlength) = new_length; + chunk = &(*out)[(*outlength) - length - 12]; - /*1: length*/ - lodepng_set32bitInt(chunk, (unsigned)length); + /*1: length*/ + lodepng_set32bitInt(chunk, (unsigned)length); - /*2: chunk name (4 letters)*/ - chunk[4] = (unsigned char)type[0]; - chunk[5] = (unsigned char)type[1]; - chunk[6] = (unsigned char)type[2]; - chunk[7] = (unsigned char)type[3]; + /*2: chunk name (4 letters)*/ + chunk[4] = (unsigned char)type[0]; + chunk[5] = (unsigned char)type[1]; + chunk[6] = (unsigned char)type[2]; + chunk[7] = (unsigned char)type[3]; - /*3: the data*/ - for(i = 0; i < length; i++) chunk[8 + i] = data[i]; + /*3: the data*/ + for (i = 0; i < length; i++) + chunk[8 + i] = data[i]; - /*4: CRC (of the chunkname characters and the data)*/ - lodepng_chunk_generate_crc(chunk); + /*4: CRC (of the chunkname characters and the data)*/ + lodepng_chunk_generate_crc(chunk); - return 0; + return 0; } /* ////////////////////////////////////////////////////////////////////////// */ @@ -2562,176 +2830,208 @@ unsigned lodepng_chunk_create(unsigned char** out, size_t* outlength, unsigned l /*return type is a LodePNG error code*/ static unsigned checkColorValidity(LodePNGColorType colortype, unsigned bd) /*bd = bitdepth*/ { - switch(colortype) - { - case 0: if(!(bd == 1 || bd == 2 || bd == 4 || bd == 8 || bd == 16)) return 37; break; /*grey*/ - case 2: if(!( bd == 8 || bd == 16)) return 37; break; /*RGB*/ - case 3: if(!(bd == 1 || bd == 2 || bd == 4 || bd == 8 )) return 37; break; /*palette*/ - case 4: if(!( bd == 8 || bd == 16)) return 37; break; /*grey + alpha*/ - case 6: if(!( bd == 8 || bd == 16)) return 37; break; /*RGBA*/ - default: return 31; - } - return 0; /*allowed color type / bits combination*/ + switch (colortype) + { + case 0: + if (!(bd == 1 || bd == 2 || bd == 4 || bd == 8 || bd == 16)) + return 37; + break; /*grey*/ + case 2: + if (!(bd == 8 || bd == 16)) + return 37; + break; /*RGB*/ + case 3: + if (!(bd == 1 || bd == 2 || bd == 4 || bd == 8)) + return 37; + break; /*palette*/ + case 4: + if (!(bd == 8 || bd == 16)) + return 37; + break; /*grey + alpha*/ + case 6: + if (!(bd == 8 || bd == 16)) + return 37; + break; /*RGBA*/ + default: + return 31; + } + return 0; /*allowed color type / bits combination*/ } static unsigned getNumColorChannels(LodePNGColorType colortype) { - switch(colortype) - { - case 0: return 1; /*grey*/ - case 2: return 3; /*RGB*/ - case 3: return 1; /*palette*/ - case 4: return 2; /*grey + alpha*/ - case 6: return 4; /*RGBA*/ - } - return 0; /*unexisting color type*/ + switch (colortype) + { + case 0: + return 1; /*grey*/ + case 2: + return 3; /*RGB*/ + case 3: + return 1; /*palette*/ + case 4: + return 2; /*grey + alpha*/ + case 6: + return 4; /*RGBA*/ + } + return 0; /*unexisting color type*/ } static unsigned lodepng_get_bpp_lct(LodePNGColorType colortype, unsigned bitdepth) { - /*bits per pixel is amount of channels * bits per channel*/ - return getNumColorChannels(colortype) * bitdepth; + /*bits per pixel is amount of channels * bits per channel*/ + return getNumColorChannels(colortype) * bitdepth; } /* ////////////////////////////////////////////////////////////////////////// */ void lodepng_color_mode_init(LodePNGColorMode* info) { - info->key_defined = 0; - info->key_r = info->key_g = info->key_b = 0; - info->colortype = LCT_RGBA; - info->bitdepth = 8; - info->palette = 0; - info->palettesize = 0; + info->key_defined = 0; + info->key_r = info->key_g = info->key_b = 0; + info->colortype = LCT_RGBA; + info->bitdepth = 8; + info->palette = 0; + info->palettesize = 0; } void lodepng_color_mode_cleanup(LodePNGColorMode* info) { - lodepng_palette_clear(info); + lodepng_palette_clear(info); } unsigned lodepng_color_mode_copy(LodePNGColorMode* dest, const LodePNGColorMode* source) { - size_t i; - lodepng_color_mode_cleanup(dest); - *dest = *source; - if(source->palette) - { - dest->palette = (unsigned char*)malloc(1024); - if(!dest->palette && source->palettesize) return 83; /*alloc fail*/ - for(i = 0; i < source->palettesize * 4; i++) dest->palette[i] = source->palette[i]; - } - return 0; + size_t i; + lodepng_color_mode_cleanup(dest); + *dest = *source; + if (source->palette) + { + dest->palette = (unsigned char*)malloc(1024); + if (!dest->palette && source->palettesize) + return 83; /*alloc fail*/ + for (i = 0; i < source->palettesize * 4; i++) + dest->palette[i] = source->palette[i]; + } + return 0; } static int lodepng_color_mode_equal(const LodePNGColorMode* a, const LodePNGColorMode* b) { - size_t i; - if(a->colortype != b->colortype) return 0; - if(a->bitdepth != b->bitdepth) return 0; - if(a->key_defined != b->key_defined) return 0; - if(a->key_defined) - { - if(a->key_r != b->key_r) return 0; - if(a->key_g != b->key_g) return 0; - if(a->key_b != b->key_b) return 0; - } - if(a->palettesize != b->palettesize) return 0; - for(i = 0; i < a->palettesize * 4; i++) - { - if(a->palette[i] != b->palette[i]) return 0; - } - return 1; + size_t i; + if (a->colortype != b->colortype) + return 0; + if (a->bitdepth != b->bitdepth) + return 0; + if (a->key_defined != b->key_defined) + return 0; + if (a->key_defined) + { + if (a->key_r != b->key_r) + return 0; + if (a->key_g != b->key_g) + return 0; + if (a->key_b != b->key_b) + return 0; + } + if (a->palettesize != b->palettesize) + return 0; + for (i = 0; i < a->palettesize * 4; i++) + { + if (a->palette[i] != b->palette[i]) + return 0; + } + return 1; } void lodepng_palette_clear(LodePNGColorMode* info) { - free(info->palette); - info->palette = 0; - info->palettesize = 0; + free(info->palette); + info->palette = 0; + info->palettesize = 0; } -unsigned lodepng_palette_add(LodePNGColorMode* info, - unsigned char r, unsigned char g, unsigned char b, unsigned char a) +unsigned lodepng_palette_add(LodePNGColorMode* info, unsigned char r, unsigned char g, + unsigned char b, unsigned char a) { - unsigned char* data; - /*the same resize technique as C++ std::vectors is used, and here it's made so that for a palette with - the max of 256 colors, it'll have the exact alloc size*/ - if(!info->palette) /*allocate palette if empty*/ - { - /*room for 256 colors with 4 bytes each*/ - data = (unsigned char*)realloc(info->palette, 1024); - if(!data) return 83; /*alloc fail*/ - else info->palette = data; - } - info->palette[4 * info->palettesize + 0] = r; - info->palette[4 * info->palettesize + 1] = g; - info->palette[4 * info->palettesize + 2] = b; - info->palette[4 * info->palettesize + 3] = a; - info->palettesize++; - return 0; + unsigned char* data; + /*the same resize technique as C++ std::vectors is used, and here it's made so that for a + palette with the max of 256 colors, it'll have the exact alloc size*/ + if (!info->palette) /*allocate palette if empty*/ + { + /*room for 256 colors with 4 bytes each*/ + data = (unsigned char*)realloc(info->palette, 1024); + if (!data) + return 83; /*alloc fail*/ + else + info->palette = data; + } + info->palette[4 * info->palettesize + 0] = r; + info->palette[4 * info->palettesize + 1] = g; + info->palette[4 * info->palettesize + 2] = b; + info->palette[4 * info->palettesize + 3] = a; + info->palettesize++; + return 0; } unsigned lodepng_get_bpp(const LodePNGColorMode* info) { - /*calculate bits per pixel out of colortype and bitdepth*/ - return lodepng_get_bpp_lct(info->colortype, info->bitdepth); + /*calculate bits per pixel out of colortype and bitdepth*/ + return lodepng_get_bpp_lct(info->colortype, info->bitdepth); } unsigned lodepng_get_channels(const LodePNGColorMode* info) { - return getNumColorChannels(info->colortype); + return getNumColorChannels(info->colortype); } unsigned lodepng_is_greyscale_type(const LodePNGColorMode* info) { - return info->colortype == LCT_GREY || info->colortype == LCT_GREY_ALPHA; + return info->colortype == LCT_GREY || info->colortype == LCT_GREY_ALPHA; } unsigned lodepng_is_alpha_type(const LodePNGColorMode* info) { - return (info->colortype & 4) != 0; /*4 or 6*/ + return (info->colortype & 4) != 0; /*4 or 6*/ } unsigned lodepng_is_palette_type(const LodePNGColorMode* info) { - return info->colortype == LCT_PALETTE; + return info->colortype == LCT_PALETTE; } unsigned lodepng_has_palette_alpha(const LodePNGColorMode* info) { - size_t i; - for(i = 0; i < info->palettesize; i++) - { - if(info->palette[i * 4 + 3] < 255) return 1; - } - return 0; + size_t i; + for (i = 0; i < info->palettesize; i++) + { + if (info->palette[i * 4 + 3] < 255) + return 1; + } + return 0; } unsigned lodepng_can_have_alpha(const LodePNGColorMode* info) { - return info->key_defined - || lodepng_is_alpha_type(info) - || lodepng_has_palette_alpha(info); + return info->key_defined || lodepng_is_alpha_type(info) || lodepng_has_palette_alpha(info); } size_t lodepng_get_raw_size(unsigned w, unsigned h, const LodePNGColorMode* color) { - return (w * h * lodepng_get_bpp(color) + 7) / 8; + return (w * h * lodepng_get_bpp(color) + 7) / 8; } -size_t lodepng_get_raw_size_lct(unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth) +size_t lodepng_get_raw_size_lct(unsigned w, unsigned h, LodePNGColorType colortype, + unsigned bitdepth) { - return (w * h * lodepng_get_bpp_lct(colortype, bitdepth) + 7) / 8; + return (w * h * lodepng_get_bpp_lct(colortype, bitdepth) + 7) / 8; } - #ifdef LODEPNG_COMPILE_PNG #ifdef LODEPNG_COMPILE_DECODER /*in an idat chunk, each scanline is a multiple of 8 bits, unlike the lodepng output buffer*/ static size_t lodepng_get_raw_size_idat(unsigned w, unsigned h, const LodePNGColorMode* color) { - return h * ((w * lodepng_get_bpp(color) + 7) / 8); + return h * ((w * lodepng_get_bpp(color) + 7) / 8); } #endif /*LODEPNG_COMPILE_DECODER*/ #endif /*LODEPNG_COMPILE_PNG*/ @@ -2740,254 +3040,266 @@ static size_t lodepng_get_raw_size_idat(unsigned w, unsigned h, const LodePNGCol static void LodePNGUnknownChunks_init(LodePNGInfo* info) { - unsigned i; - for(i = 0; i < 3; i++) info->unknown_chunks_data[i] = 0; - for(i = 0; i < 3; i++) info->unknown_chunks_size[i] = 0; + unsigned i; + for (i = 0; i < 3; i++) + info->unknown_chunks_data[i] = 0; + for (i = 0; i < 3; i++) + info->unknown_chunks_size[i] = 0; } static void LodePNGUnknownChunks_cleanup(LodePNGInfo* info) { - unsigned i; - for(i = 0; i < 3; i++) free(info->unknown_chunks_data[i]); + unsigned i; + for (i = 0; i < 3; i++) + free(info->unknown_chunks_data[i]); } static unsigned LodePNGUnknownChunks_copy(LodePNGInfo* dest, const LodePNGInfo* src) { - unsigned i; + unsigned i; - LodePNGUnknownChunks_cleanup(dest); + LodePNGUnknownChunks_cleanup(dest); - for(i = 0; i < 3; i++) - { - size_t j; - dest->unknown_chunks_size[i] = src->unknown_chunks_size[i]; - dest->unknown_chunks_data[i] = (unsigned char*)malloc(src->unknown_chunks_size[i]); - if(!dest->unknown_chunks_data[i] && dest->unknown_chunks_size[i]) return 83; /*alloc fail*/ - for(j = 0; j < src->unknown_chunks_size[i]; j++) - { - dest->unknown_chunks_data[i][j] = src->unknown_chunks_data[i][j]; - } - } + for (i = 0; i < 3; i++) + { + size_t j; + dest->unknown_chunks_size[i] = src->unknown_chunks_size[i]; + dest->unknown_chunks_data[i] = (unsigned char*)malloc(src->unknown_chunks_size[i]); + if (!dest->unknown_chunks_data[i] && dest->unknown_chunks_size[i]) + return 83; /*alloc fail*/ + for (j = 0; j < src->unknown_chunks_size[i]; j++) + { + dest->unknown_chunks_data[i][j] = src->unknown_chunks_data[i][j]; + } + } - return 0; + return 0; } /******************************************************************************/ static void LodePNGText_init(LodePNGInfo* info) { - info->text_num = 0; - info->text_keys = NULL; - info->text_strings = NULL; + info->text_num = 0; + info->text_keys = NULL; + info->text_strings = NULL; } static void LodePNGText_cleanup(LodePNGInfo* info) { - size_t i; - for(i = 0; i < info->text_num; i++) - { - string_cleanup(&info->text_keys[i]); - string_cleanup(&info->text_strings[i]); - } - free(info->text_keys); - free(info->text_strings); + size_t i; + for (i = 0; i < info->text_num; i++) + { + string_cleanup(&info->text_keys[i]); + string_cleanup(&info->text_strings[i]); + } + free(info->text_keys); + free(info->text_strings); } static unsigned LodePNGText_copy(LodePNGInfo* dest, const LodePNGInfo* source) { - size_t i = 0; - dest->text_keys = 0; - dest->text_strings = 0; - dest->text_num = 0; - for(i = 0; i < source->text_num; i++) - { - CERROR_TRY_RETURN(lodepng_add_text(dest, source->text_keys[i], source->text_strings[i])); - } - return 0; + size_t i = 0; + dest->text_keys = 0; + dest->text_strings = 0; + dest->text_num = 0; + for (i = 0; i < source->text_num; i++) + { + CERROR_TRY_RETURN(lodepng_add_text(dest, source->text_keys[i], source->text_strings[i])); + } + return 0; } void lodepng_clear_text(LodePNGInfo* info) { - LodePNGText_cleanup(info); + LodePNGText_cleanup(info); } unsigned lodepng_add_text(LodePNGInfo* info, const char* key, const char* str) { - char** new_keys = (char**)(realloc(info->text_keys, sizeof(char*) * (info->text_num + 1))); - char** new_strings = (char**)(realloc(info->text_strings, sizeof(char*) * (info->text_num + 1))); - if(!new_keys || !new_strings) - { - free(new_keys); - free(new_strings); - return 83; /*alloc fail*/ - } + char** new_keys = (char**)(realloc(info->text_keys, sizeof(char*) * (info->text_num + 1))); + char** new_strings = + (char**)(realloc(info->text_strings, sizeof(char*) * (info->text_num + 1))); + if (!new_keys || !new_strings) + { + free(new_keys); + free(new_strings); + return 83; /*alloc fail*/ + } - info->text_num++; - info->text_keys = new_keys; - info->text_strings = new_strings; + info->text_num++; + info->text_keys = new_keys; + info->text_strings = new_strings; - string_init(&info->text_keys[info->text_num - 1]); - string_set(&info->text_keys[info->text_num - 1], key); + string_init(&info->text_keys[info->text_num - 1]); + string_set(&info->text_keys[info->text_num - 1], key); - string_init(&info->text_strings[info->text_num - 1]); - string_set(&info->text_strings[info->text_num - 1], str); + string_init(&info->text_strings[info->text_num - 1]); + string_set(&info->text_strings[info->text_num - 1], str); - return 0; + return 0; } /******************************************************************************/ static void LodePNGIText_init(LodePNGInfo* info) { - info->itext_num = 0; - info->itext_keys = NULL; - info->itext_langtags = NULL; - info->itext_transkeys = NULL; - info->itext_strings = NULL; + info->itext_num = 0; + info->itext_keys = NULL; + info->itext_langtags = NULL; + info->itext_transkeys = NULL; + info->itext_strings = NULL; } static void LodePNGIText_cleanup(LodePNGInfo* info) { - size_t i; - for(i = 0; i < info->itext_num; i++) - { - string_cleanup(&info->itext_keys[i]); - string_cleanup(&info->itext_langtags[i]); - string_cleanup(&info->itext_transkeys[i]); - string_cleanup(&info->itext_strings[i]); - } - free(info->itext_keys); - free(info->itext_langtags); - free(info->itext_transkeys); - free(info->itext_strings); + size_t i; + for (i = 0; i < info->itext_num; i++) + { + string_cleanup(&info->itext_keys[i]); + string_cleanup(&info->itext_langtags[i]); + string_cleanup(&info->itext_transkeys[i]); + string_cleanup(&info->itext_strings[i]); + } + free(info->itext_keys); + free(info->itext_langtags); + free(info->itext_transkeys); + free(info->itext_strings); } static unsigned LodePNGIText_copy(LodePNGInfo* dest, const LodePNGInfo* source) { - size_t i = 0; - dest->itext_keys = 0; - dest->itext_langtags = 0; - dest->itext_transkeys = 0; - dest->itext_strings = 0; - dest->itext_num = 0; - for(i = 0; i < source->itext_num; i++) - { - CERROR_TRY_RETURN(lodepng_add_itext(dest, source->itext_keys[i], source->itext_langtags[i], - source->itext_transkeys[i], source->itext_strings[i])); - } - return 0; + size_t i = 0; + dest->itext_keys = 0; + dest->itext_langtags = 0; + dest->itext_transkeys = 0; + dest->itext_strings = 0; + dest->itext_num = 0; + for (i = 0; i < source->itext_num; i++) + { + CERROR_TRY_RETURN(lodepng_add_itext(dest, source->itext_keys[i], source->itext_langtags[i], + source->itext_transkeys[i], source->itext_strings[i])); + } + return 0; } void lodepng_clear_itext(LodePNGInfo* info) { - LodePNGIText_cleanup(info); + LodePNGIText_cleanup(info); } unsigned lodepng_add_itext(LodePNGInfo* info, const char* key, const char* langtag, const char* transkey, const char* str) { - char** new_keys = (char**)(realloc(info->itext_keys, sizeof(char*) * (info->itext_num + 1))); - char** new_langtags = (char**)(realloc(info->itext_langtags, sizeof(char*) * (info->itext_num + 1))); - char** new_transkeys = (char**)(realloc(info->itext_transkeys, sizeof(char*) * (info->itext_num + 1))); - char** new_strings = (char**)(realloc(info->itext_strings, sizeof(char*) * (info->itext_num + 1))); - if(!new_keys || !new_langtags || !new_transkeys || !new_strings) - { - free(new_keys); - free(new_langtags); - free(new_transkeys); - free(new_strings); - return 83; /*alloc fail*/ - } + char** new_keys = (char**)(realloc(info->itext_keys, sizeof(char*) * (info->itext_num + 1))); + char** new_langtags = + (char**)(realloc(info->itext_langtags, sizeof(char*) * (info->itext_num + 1))); + char** new_transkeys = + (char**)(realloc(info->itext_transkeys, sizeof(char*) * (info->itext_num + 1))); + char** new_strings = + (char**)(realloc(info->itext_strings, sizeof(char*) * (info->itext_num + 1))); + if (!new_keys || !new_langtags || !new_transkeys || !new_strings) + { + free(new_keys); + free(new_langtags); + free(new_transkeys); + free(new_strings); + return 83; /*alloc fail*/ + } - info->itext_num++; - info->itext_keys = new_keys; - info->itext_langtags = new_langtags; - info->itext_transkeys = new_transkeys; - info->itext_strings = new_strings; + info->itext_num++; + info->itext_keys = new_keys; + info->itext_langtags = new_langtags; + info->itext_transkeys = new_transkeys; + info->itext_strings = new_strings; - string_init(&info->itext_keys[info->itext_num - 1]); - string_set(&info->itext_keys[info->itext_num - 1], key); + string_init(&info->itext_keys[info->itext_num - 1]); + string_set(&info->itext_keys[info->itext_num - 1], key); - string_init(&info->itext_langtags[info->itext_num - 1]); - string_set(&info->itext_langtags[info->itext_num - 1], langtag); + string_init(&info->itext_langtags[info->itext_num - 1]); + string_set(&info->itext_langtags[info->itext_num - 1], langtag); - string_init(&info->itext_transkeys[info->itext_num - 1]); - string_set(&info->itext_transkeys[info->itext_num - 1], transkey); + string_init(&info->itext_transkeys[info->itext_num - 1]); + string_set(&info->itext_transkeys[info->itext_num - 1], transkey); - string_init(&info->itext_strings[info->itext_num - 1]); - string_set(&info->itext_strings[info->itext_num - 1], str); + string_init(&info->itext_strings[info->itext_num - 1]); + string_set(&info->itext_strings[info->itext_num - 1], str); - return 0; + return 0; } #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ void lodepng_info_init(LodePNGInfo* info) { - lodepng_color_mode_init(&info->color); - info->interlace_method = 0; - info->compression_method = 0; - info->filter_method = 0; + lodepng_color_mode_init(&info->color); + info->interlace_method = 0; + info->compression_method = 0; + info->filter_method = 0; #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - info->background_defined = 0; - info->background_r = info->background_g = info->background_b = 0; + info->background_defined = 0; + info->background_r = info->background_g = info->background_b = 0; - LodePNGText_init(info); - LodePNGIText_init(info); + LodePNGText_init(info); + LodePNGIText_init(info); - info->time_defined = 0; - info->phys_defined = 0; + info->time_defined = 0; + info->phys_defined = 0; - LodePNGUnknownChunks_init(info); + LodePNGUnknownChunks_init(info); #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ } void lodepng_info_cleanup(LodePNGInfo* info) { - lodepng_color_mode_cleanup(&info->color); + lodepng_color_mode_cleanup(&info->color); #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - LodePNGText_cleanup(info); - LodePNGIText_cleanup(info); + LodePNGText_cleanup(info); + LodePNGIText_cleanup(info); - LodePNGUnknownChunks_cleanup(info); + LodePNGUnknownChunks_cleanup(info); #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ } unsigned lodepng_info_copy(LodePNGInfo* dest, const LodePNGInfo* source) { - lodepng_info_cleanup(dest); - *dest = *source; - lodepng_color_mode_init(&dest->color); - CERROR_TRY_RETURN(lodepng_color_mode_copy(&dest->color, &source->color)); + lodepng_info_cleanup(dest); + *dest = *source; + lodepng_color_mode_init(&dest->color); + CERROR_TRY_RETURN(lodepng_color_mode_copy(&dest->color, &source->color)); #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - CERROR_TRY_RETURN(LodePNGText_copy(dest, source)); - CERROR_TRY_RETURN(LodePNGIText_copy(dest, source)); + CERROR_TRY_RETURN(LodePNGText_copy(dest, source)); + CERROR_TRY_RETURN(LodePNGIText_copy(dest, source)); - LodePNGUnknownChunks_init(dest); - CERROR_TRY_RETURN(LodePNGUnknownChunks_copy(dest, source)); + LodePNGUnknownChunks_init(dest); + CERROR_TRY_RETURN(LodePNGUnknownChunks_copy(dest, source)); #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - return 0; + return 0; } void lodepng_info_swap(LodePNGInfo* a, LodePNGInfo* b) { - LodePNGInfo temp = *a; - *a = *b; - *b = temp; + LodePNGInfo temp = *a; + *a = *b; + *b = temp; } /* ////////////////////////////////////////////////////////////////////////// */ -/*index: bitgroup index, bits: bitgroup size(1, 2 or 4), in: bitgroup value, out: octet array to add bits to*/ +/*index: bitgroup index, bits: bitgroup size(1, 2 or 4), in: bitgroup value, out: octet array to add + * bits to*/ static void addColorBits(unsigned char* out, size_t index, unsigned bits, unsigned in) { - unsigned m = bits == 1 ? 7 : bits == 2 ? 3 : 1; /*8 / bits - 1*/ - /*p = the partial index in the byte, e.g. with 4 palettebits it is 0 for first half or 1 for second half*/ - unsigned p = index & m; - in &= (1u << bits) - 1u; /*filter out any other bits of the input value*/ - in = in << (bits * (m - p)); - if(p == 0) out[index * bits / 8] = in; - else out[index * bits / 8] |= in; + unsigned m = bits == 1 ? 7 : bits == 2 ? 3 : 1; /*8 / bits - 1*/ + /*p = the partial index in the byte, e.g. with 4 palettebits it is 0 for first half or 1 for + * second half*/ + unsigned p = index & m; + in &= (1u << bits) - 1u; /*filter out any other bits of the input value*/ + in = in << (bits * (m - p)); + if (p == 0) + out[index * bits / 8] = in; + else + out[index * bits / 8] |= in; } typedef struct ColorTree ColorTree; @@ -3000,288 +3312,316 @@ node has 16 instead of 8 children. */ struct ColorTree { - ColorTree* children[16]; /*up to 16 pointers to ColorTree of next level*/ - int index; /*the payload. Only has a meaningful value if this is in the last level*/ + ColorTree* children[16]; /*up to 16 pointers to ColorTree of next level*/ + int index; /*the payload. Only has a meaningful value if this is in the last level*/ }; static void color_tree_init(ColorTree* tree) { - int i; - for(i = 0; i < 16; i++) tree->children[i] = 0; - tree->index = -1; + int i; + for (i = 0; i < 16; i++) + tree->children[i] = 0; + tree->index = -1; } static void color_tree_cleanup(ColorTree* tree) { - int i; - for(i = 0; i < 16; i++) - { - if(tree->children[i]) - { - color_tree_cleanup(tree->children[i]); - free(tree->children[i]); - } - } + int i; + for (i = 0; i < 16; i++) + { + if (tree->children[i]) + { + color_tree_cleanup(tree->children[i]); + free(tree->children[i]); + } + } } /*returns -1 if color not present, its index otherwise*/ -static int color_tree_get(ColorTree* tree, unsigned char r, unsigned char g, unsigned char b, unsigned char a) +static int color_tree_get(ColorTree* tree, unsigned char r, unsigned char g, unsigned char b, + unsigned char a) { - int bit = 0; - for(bit = 0; bit < 8; bit++) - { - int i = 8 * ((r >> bit) & 1) + 4 * ((g >> bit) & 1) + 2 * ((b >> bit) & 1) + 1 * ((a >> bit) & 1); - if(!tree->children[i]) return -1; - else tree = tree->children[i]; - } - return tree ? tree->index : -1; + int bit = 0; + for (bit = 0; bit < 8; bit++) + { + int i = 8 * ((r >> bit) & 1) + 4 * ((g >> bit) & 1) + 2 * ((b >> bit) & 1) + + 1 * ((a >> bit) & 1); + if (!tree->children[i]) + return -1; + else + tree = tree->children[i]; + } + return tree ? tree->index : -1; } #ifdef LODEPNG_COMPILE_ENCODER -static int color_tree_has(ColorTree* tree, unsigned char r, unsigned char g, unsigned char b, unsigned char a) +static int color_tree_has(ColorTree* tree, unsigned char r, unsigned char g, unsigned char b, + unsigned char a) { - return color_tree_get(tree, r, g, b, a) >= 0; + return color_tree_get(tree, r, g, b, a) >= 0; } #endif /*LODEPNG_COMPILE_ENCODER*/ /*color is not allowed to already exist. Index should be >= 0 (it's signed to be compatible with using -1 for "doesn't exist")*/ -static void color_tree_add(ColorTree* tree, - unsigned char r, unsigned char g, unsigned char b, unsigned char a, unsigned index) +static void color_tree_add(ColorTree* tree, unsigned char r, unsigned char g, unsigned char b, + unsigned char a, unsigned index) { - int bit; - for(bit = 0; bit < 8; bit++) - { - int i = 8 * ((r >> bit) & 1) + 4 * ((g >> bit) & 1) + 2 * ((b >> bit) & 1) + 1 * ((a >> bit) & 1); - if(!tree->children[i]) - { - tree->children[i] = (ColorTree*)malloc(sizeof(ColorTree)); - color_tree_init(tree->children[i]); - } - tree = tree->children[i]; - } - tree->index = (int)index; + int bit; + for (bit = 0; bit < 8; bit++) + { + int i = 8 * ((r >> bit) & 1) + 4 * ((g >> bit) & 1) + 2 * ((b >> bit) & 1) + + 1 * ((a >> bit) & 1); + if (!tree->children[i]) + { + tree->children[i] = (ColorTree*)malloc(sizeof(ColorTree)); + color_tree_init(tree->children[i]); + } + tree = tree->children[i]; + } + tree->index = (int)index; } /*put a pixel, given its RGBA color, into image of any color type*/ -static unsigned rgba8ToPixel(unsigned char* out, size_t i, - const LodePNGColorMode* mode, ColorTree* tree /*for palette*/, - unsigned char r, unsigned char g, unsigned char b, unsigned char a) +static unsigned rgba8ToPixel(unsigned char* out, size_t i, const LodePNGColorMode* mode, + ColorTree* tree /*for palette*/, unsigned char r, unsigned char g, + unsigned char b, unsigned char a) { - if(mode->colortype == LCT_GREY) - { - unsigned char grey = r; /*((unsigned short)r + g + b) / 3*/; - if(mode->bitdepth == 8) out[i] = grey; - else if(mode->bitdepth == 16) out[i * 2 + 0] = out[i * 2 + 1] = grey; - else - { - /*take the most significant bits of grey*/ - grey = (grey >> (8 - mode->bitdepth)) & ((1 << mode->bitdepth) - 1); - addColorBits(out, i, mode->bitdepth, grey); - } - } - else if(mode->colortype == LCT_RGB) - { - if(mode->bitdepth == 8) - { - out[i * 3 + 0] = r; - out[i * 3 + 1] = g; - out[i * 3 + 2] = b; - } - else - { - out[i * 6 + 0] = out[i * 6 + 1] = r; - out[i * 6 + 2] = out[i * 6 + 3] = g; - out[i * 6 + 4] = out[i * 6 + 5] = b; - } - } - else if(mode->colortype == LCT_PALETTE) - { - int index = color_tree_get(tree, r, g, b, a); - if(index < 0) return 82; /*color not in palette*/ - if(mode->bitdepth == 8) out[i] = index; - else addColorBits(out, i, mode->bitdepth, (unsigned)index); - } - else if(mode->colortype == LCT_GREY_ALPHA) - { - unsigned char grey = r; /*((unsigned short)r + g + b) / 3*/; - if(mode->bitdepth == 8) - { - out[i * 2 + 0] = grey; - out[i * 2 + 1] = a; - } - else if(mode->bitdepth == 16) - { - out[i * 4 + 0] = out[i * 4 + 1] = grey; - out[i * 4 + 2] = out[i * 4 + 3] = a; - } - } - else if(mode->colortype == LCT_RGBA) - { - if(mode->bitdepth == 8) - { - out[i * 4 + 0] = r; - out[i * 4 + 1] = g; - out[i * 4 + 2] = b; - out[i * 4 + 3] = a; - } - else - { - out[i * 8 + 0] = out[i * 8 + 1] = r; - out[i * 8 + 2] = out[i * 8 + 3] = g; - out[i * 8 + 4] = out[i * 8 + 5] = b; - out[i * 8 + 6] = out[i * 8 + 7] = a; - } - } + if (mode->colortype == LCT_GREY) + { + unsigned char grey = r; /*((unsigned short)r + g + b) / 3*/ + ; + if (mode->bitdepth == 8) + out[i] = grey; + else if (mode->bitdepth == 16) + out[i * 2 + 0] = out[i * 2 + 1] = grey; + else + { + /*take the most significant bits of grey*/ + grey = (grey >> (8 - mode->bitdepth)) & ((1 << mode->bitdepth) - 1); + addColorBits(out, i, mode->bitdepth, grey); + } + } + else if (mode->colortype == LCT_RGB) + { + if (mode->bitdepth == 8) + { + out[i * 3 + 0] = r; + out[i * 3 + 1] = g; + out[i * 3 + 2] = b; + } + else + { + out[i * 6 + 0] = out[i * 6 + 1] = r; + out[i * 6 + 2] = out[i * 6 + 3] = g; + out[i * 6 + 4] = out[i * 6 + 5] = b; + } + } + else if (mode->colortype == LCT_PALETTE) + { + int index = color_tree_get(tree, r, g, b, a); + if (index < 0) + return 82; /*color not in palette*/ + if (mode->bitdepth == 8) + out[i] = index; + else + addColorBits(out, i, mode->bitdepth, (unsigned)index); + } + else if (mode->colortype == LCT_GREY_ALPHA) + { + unsigned char grey = r; /*((unsigned short)r + g + b) / 3*/ + ; + if (mode->bitdepth == 8) + { + out[i * 2 + 0] = grey; + out[i * 2 + 1] = a; + } + else if (mode->bitdepth == 16) + { + out[i * 4 + 0] = out[i * 4 + 1] = grey; + out[i * 4 + 2] = out[i * 4 + 3] = a; + } + } + else if (mode->colortype == LCT_RGBA) + { + if (mode->bitdepth == 8) + { + out[i * 4 + 0] = r; + out[i * 4 + 1] = g; + out[i * 4 + 2] = b; + out[i * 4 + 3] = a; + } + else + { + out[i * 8 + 0] = out[i * 8 + 1] = r; + out[i * 8 + 2] = out[i * 8 + 3] = g; + out[i * 8 + 4] = out[i * 8 + 5] = b; + out[i * 8 + 6] = out[i * 8 + 7] = a; + } + } - return 0; /*no error*/ + return 0; /*no error*/ } /*put a pixel, given its RGBA16 color, into image of any color 16-bitdepth type*/ -static void rgba16ToPixel(unsigned char* out, size_t i, - const LodePNGColorMode* mode, - unsigned short r, unsigned short g, unsigned short b, unsigned short a) +static void rgba16ToPixel(unsigned char* out, size_t i, const LodePNGColorMode* mode, + unsigned short r, unsigned short g, unsigned short b, unsigned short a) { - if(mode->colortype == LCT_GREY) - { - unsigned short grey = r; /*((unsigned)r + g + b) / 3*/; - out[i * 2 + 0] = (grey >> 8) & 255; - out[i * 2 + 1] = grey & 255; - } - else if(mode->colortype == LCT_RGB) - { - out[i * 6 + 0] = (r >> 8) & 255; - out[i * 6 + 1] = r & 255; - out[i * 6 + 2] = (g >> 8) & 255; - out[i * 6 + 3] = g & 255; - out[i * 6 + 4] = (b >> 8) & 255; - out[i * 6 + 5] = b & 255; - } - else if(mode->colortype == LCT_GREY_ALPHA) - { - unsigned short grey = r; /*((unsigned)r + g + b) / 3*/; - out[i * 4 + 0] = (grey >> 8) & 255; - out[i * 4 + 1] = grey & 255; - out[i * 4 + 2] = (a >> 8) & 255; - out[i * 4 + 3] = a & 255; - } - else if(mode->colortype == LCT_RGBA) - { - out[i * 8 + 0] = (r >> 8) & 255; - out[i * 8 + 1] = r & 255; - out[i * 8 + 2] = (g >> 8) & 255; - out[i * 8 + 3] = g & 255; - out[i * 8 + 4] = (b >> 8) & 255; - out[i * 8 + 5] = b & 255; - out[i * 8 + 6] = (a >> 8) & 255; - out[i * 8 + 7] = a & 255; - } + if (mode->colortype == LCT_GREY) + { + unsigned short grey = r; /*((unsigned)r + g + b) / 3*/ + ; + out[i * 2 + 0] = (grey >> 8) & 255; + out[i * 2 + 1] = grey & 255; + } + else if (mode->colortype == LCT_RGB) + { + out[i * 6 + 0] = (r >> 8) & 255; + out[i * 6 + 1] = r & 255; + out[i * 6 + 2] = (g >> 8) & 255; + out[i * 6 + 3] = g & 255; + out[i * 6 + 4] = (b >> 8) & 255; + out[i * 6 + 5] = b & 255; + } + else if (mode->colortype == LCT_GREY_ALPHA) + { + unsigned short grey = r; /*((unsigned)r + g + b) / 3*/ + ; + out[i * 4 + 0] = (grey >> 8) & 255; + out[i * 4 + 1] = grey & 255; + out[i * 4 + 2] = (a >> 8) & 255; + out[i * 4 + 3] = a & 255; + } + else if (mode->colortype == LCT_RGBA) + { + out[i * 8 + 0] = (r >> 8) & 255; + out[i * 8 + 1] = r & 255; + out[i * 8 + 2] = (g >> 8) & 255; + out[i * 8 + 3] = g & 255; + out[i * 8 + 4] = (b >> 8) & 255; + out[i * 8 + 5] = b & 255; + out[i * 8 + 6] = (a >> 8) & 255; + out[i * 8 + 7] = a & 255; + } } /*Get RGBA8 color of pixel with index i (y * width + x) from the raw image with given color type.*/ -static void getPixelColorRGBA8(unsigned char* r, unsigned char* g, - unsigned char* b, unsigned char* a, - const unsigned char* in, size_t i, +static void getPixelColorRGBA8(unsigned char* r, unsigned char* g, unsigned char* b, + unsigned char* a, const unsigned char* in, size_t i, const LodePNGColorMode* mode) { - if(mode->colortype == LCT_GREY) - { - if(mode->bitdepth == 8) - { - *r = *g = *b = in[i]; - if(mode->key_defined && *r == mode->key_r) *a = 0; - else *a = 255; - } - else if(mode->bitdepth == 16) - { - *r = *g = *b = in[i * 2 + 0]; - if(mode->key_defined && 256U * in[i * 2 + 0] + in[i * 2 + 1] == mode->key_r) *a = 0; - else *a = 255; - } - else - { - unsigned highest = ((1U << mode->bitdepth) - 1U); /*highest possible value for this bit depth*/ - size_t j = i * mode->bitdepth; - unsigned value = readBitsFromReversedStream(&j, in, mode->bitdepth); - *r = *g = *b = (value * 255) / highest; - if(mode->key_defined && value == mode->key_r) *a = 0; - else *a = 255; - } - } - else if(mode->colortype == LCT_RGB) - { - if(mode->bitdepth == 8) - { - *r = in[i * 3 + 0]; *g = in[i * 3 + 1]; *b = in[i * 3 + 2]; - if(mode->key_defined && *r == mode->key_r && *g == mode->key_g && *b == mode->key_b) *a = 0; - else *a = 255; - } - else - { - *r = in[i * 6 + 0]; - *g = in[i * 6 + 2]; - *b = in[i * 6 + 4]; - if(mode->key_defined && 256U * in[i * 6 + 0] + in[i * 6 + 1] == mode->key_r - && 256U * in[i * 6 + 2] + in[i * 6 + 3] == mode->key_g - && 256U * in[i * 6 + 4] + in[i * 6 + 5] == mode->key_b) *a = 0; - else *a = 255; - } - } - else if(mode->colortype == LCT_PALETTE) - { - unsigned index; - if(mode->bitdepth == 8) index = in[i]; - else - { - size_t j = i * mode->bitdepth; - index = readBitsFromReversedStream(&j, in, mode->bitdepth); - } + if (mode->colortype == LCT_GREY) + { + if (mode->bitdepth == 8) + { + *r = *g = *b = in[i]; + if (mode->key_defined && *r == mode->key_r) + *a = 0; + else + *a = 255; + } + else if (mode->bitdepth == 16) + { + *r = *g = *b = in[i * 2 + 0]; + if (mode->key_defined && 256U * in[i * 2 + 0] + in[i * 2 + 1] == mode->key_r) + *a = 0; + else + *a = 255; + } + else + { + unsigned highest = + ((1U << mode->bitdepth) - 1U); /*highest possible value for this bit depth*/ + size_t j = i * mode->bitdepth; + unsigned value = readBitsFromReversedStream(&j, in, mode->bitdepth); + *r = *g = *b = (value * 255) / highest; + if (mode->key_defined && value == mode->key_r) + *a = 0; + else + *a = 255; + } + } + else if (mode->colortype == LCT_RGB) + { + if (mode->bitdepth == 8) + { + *r = in[i * 3 + 0]; + *g = in[i * 3 + 1]; + *b = in[i * 3 + 2]; + if (mode->key_defined && *r == mode->key_r && *g == mode->key_g && *b == mode->key_b) + *a = 0; + else + *a = 255; + } + else + { + *r = in[i * 6 + 0]; + *g = in[i * 6 + 2]; + *b = in[i * 6 + 4]; + if (mode->key_defined && 256U * in[i * 6 + 0] + in[i * 6 + 1] == mode->key_r && + 256U * in[i * 6 + 2] + in[i * 6 + 3] == mode->key_g && + 256U * in[i * 6 + 4] + in[i * 6 + 5] == mode->key_b) + *a = 0; + else + *a = 255; + } + } + else if (mode->colortype == LCT_PALETTE) + { + unsigned index; + if (mode->bitdepth == 8) + index = in[i]; + else + { + size_t j = i * mode->bitdepth; + index = readBitsFromReversedStream(&j, in, mode->bitdepth); + } - if(index >= mode->palettesize) - { - /*This is an error according to the PNG spec, but common PNG decoders make it black instead. - Done here too, slightly faster due to no error handling needed.*/ - *r = *g = *b = 0; - *a = 255; - } - else - { - *r = mode->palette[index * 4 + 0]; - *g = mode->palette[index * 4 + 1]; - *b = mode->palette[index * 4 + 2]; - *a = mode->palette[index * 4 + 3]; - } - } - else if(mode->colortype == LCT_GREY_ALPHA) - { - if(mode->bitdepth == 8) - { - *r = *g = *b = in[i * 2 + 0]; - *a = in[i * 2 + 1]; - } - else - { - *r = *g = *b = in[i * 4 + 0]; - *a = in[i * 4 + 2]; - } - } - else if(mode->colortype == LCT_RGBA) - { - if(mode->bitdepth == 8) - { - *r = in[i * 4 + 0]; - *g = in[i * 4 + 1]; - *b = in[i * 4 + 2]; - *a = in[i * 4 + 3]; - } - else - { - *r = in[i * 8 + 0]; - *g = in[i * 8 + 2]; - *b = in[i * 8 + 4]; - *a = in[i * 8 + 6]; - } - } + if (index >= mode->palettesize) + { + /*This is an error according to the PNG spec, but common PNG decoders make it black + instead. Done here too, slightly faster due to no error handling needed.*/ + *r = *g = *b = 0; + *a = 255; + } + else + { + *r = mode->palette[index * 4 + 0]; + *g = mode->palette[index * 4 + 1]; + *b = mode->palette[index * 4 + 2]; + *a = mode->palette[index * 4 + 3]; + } + } + else if (mode->colortype == LCT_GREY_ALPHA) + { + if (mode->bitdepth == 8) + { + *r = *g = *b = in[i * 2 + 0]; + *a = in[i * 2 + 1]; + } + else + { + *r = *g = *b = in[i * 4 + 0]; + *a = in[i * 4 + 2]; + } + } + else if (mode->colortype == LCT_RGBA) + { + if (mode->bitdepth == 8) + { + *r = in[i * 4 + 0]; + *g = in[i * 4 + 1]; + *b = in[i * 4 + 2]; + *a = in[i * 4 + 3]; + } + else + { + *r = in[i * 8 + 0]; + *g = in[i * 8 + 2]; + *b = in[i * 8 + 4]; + *a = in[i * 8 + 6]; + } + } } /*Similar to getPixelColorRGBA8, but with all the for loops inside of the color @@ -3289,245 +3629,272 @@ mode test cases, optimized to convert the colors much faster, when converting to RGBA or RGB with 8 bit per cannel. buffer must be RGBA or RGB output with enough memory, if has_alpha is true the output is RGBA. mode has the color mode of the input buffer.*/ -static void getPixelColorsRGBA8(unsigned char* buffer, size_t numpixels, - unsigned has_alpha, const unsigned char* in, - const LodePNGColorMode* mode) +static void getPixelColorsRGBA8(unsigned char* buffer, size_t numpixels, unsigned has_alpha, + const unsigned char* in, const LodePNGColorMode* mode) { - unsigned num_channels = has_alpha ? 4 : 3; - size_t i; - if(mode->colortype == LCT_GREY) - { - if(mode->bitdepth == 8) - { - for(i = 0; i < numpixels; i++, buffer += num_channels) - { - buffer[0] = buffer[1] = buffer[2] = in[i]; - if(has_alpha) buffer[3] = mode->key_defined && in[i] == mode->key_r ? 0 : 255; - } - } - else if(mode->bitdepth == 16) - { - for(i = 0; i < numpixels; i++, buffer += num_channels) - { - buffer[0] = buffer[1] = buffer[2] = in[i * 2]; - if(has_alpha) buffer[3] = mode->key_defined && 256U * in[i * 2 + 0] + in[i * 2 + 1] == mode->key_r ? 0 : 255; - } - } - else - { - unsigned highest = ((1U << mode->bitdepth) - 1U); /*highest possible value for this bit depth*/ - size_t j = 0; - for(i = 0; i < numpixels; i++, buffer += num_channels) - { - unsigned value = readBitsFromReversedStream(&j, in, mode->bitdepth); - buffer[0] = buffer[1] = buffer[2] = (value * 255) / highest; - if(has_alpha) buffer[3] = mode->key_defined && value == mode->key_r ? 0 : 255; - } - } - } - else if(mode->colortype == LCT_RGB) - { - if(mode->bitdepth == 8) - { - for(i = 0; i < numpixels; i++, buffer += num_channels) - { - buffer[0] = in[i * 3 + 0]; - buffer[1] = in[i * 3 + 1]; - buffer[2] = in[i * 3 + 2]; - if(has_alpha) buffer[3] = mode->key_defined && buffer[0] == mode->key_r - && buffer[1]== mode->key_g && buffer[2] == mode->key_b ? 0 : 255; - } - } - else - { - for(i = 0; i < numpixels; i++, buffer += num_channels) - { - buffer[0] = in[i * 6 + 0]; - buffer[1] = in[i * 6 + 2]; - buffer[2] = in[i * 6 + 4]; - if(has_alpha) buffer[3] = mode->key_defined - && 256U * in[i * 6 + 0] + in[i * 6 + 1] == mode->key_r - && 256U * in[i * 6 + 2] + in[i * 6 + 3] == mode->key_g - && 256U * in[i * 6 + 4] + in[i * 6 + 5] == mode->key_b ? 0 : 255; - } - } - } - else if(mode->colortype == LCT_PALETTE) - { - unsigned index; - size_t j = 0; - for(i = 0; i < numpixels; i++, buffer += num_channels) - { - if(mode->bitdepth == 8) index = in[i]; - else index = readBitsFromReversedStream(&j, in, mode->bitdepth); + unsigned num_channels = has_alpha ? 4 : 3; + size_t i; + if (mode->colortype == LCT_GREY) + { + if (mode->bitdepth == 8) + { + for (i = 0; i < numpixels; i++, buffer += num_channels) + { + buffer[0] = buffer[1] = buffer[2] = in[i]; + if (has_alpha) + buffer[3] = mode->key_defined && in[i] == mode->key_r ? 0 : 255; + } + } + else if (mode->bitdepth == 16) + { + for (i = 0; i < numpixels; i++, buffer += num_channels) + { + buffer[0] = buffer[1] = buffer[2] = in[i * 2]; + if (has_alpha) + buffer[3] = + mode->key_defined && 256U * in[i * 2 + 0] + in[i * 2 + 1] == mode->key_r + ? 0 + : 255; + } + } + else + { + unsigned highest = + ((1U << mode->bitdepth) - 1U); /*highest possible value for this bit depth*/ + size_t j = 0; + for (i = 0; i < numpixels; i++, buffer += num_channels) + { + unsigned value = readBitsFromReversedStream(&j, in, mode->bitdepth); + buffer[0] = buffer[1] = buffer[2] = (value * 255) / highest; + if (has_alpha) + buffer[3] = mode->key_defined && value == mode->key_r ? 0 : 255; + } + } + } + else if (mode->colortype == LCT_RGB) + { + if (mode->bitdepth == 8) + { + for (i = 0; i < numpixels; i++, buffer += num_channels) + { + buffer[0] = in[i * 3 + 0]; + buffer[1] = in[i * 3 + 1]; + buffer[2] = in[i * 3 + 2]; + if (has_alpha) + buffer[3] = mode->key_defined && buffer[0] == mode->key_r && + buffer[1] == mode->key_g && buffer[2] == mode->key_b + ? 0 + : 255; + } + } + else + { + for (i = 0; i < numpixels; i++, buffer += num_channels) + { + buffer[0] = in[i * 6 + 0]; + buffer[1] = in[i * 6 + 2]; + buffer[2] = in[i * 6 + 4]; + if (has_alpha) + buffer[3] = mode->key_defined && + 256U * in[i * 6 + 0] + in[i * 6 + 1] == mode->key_r && + 256U * in[i * 6 + 2] + in[i * 6 + 3] == mode->key_g && + 256U * in[i * 6 + 4] + in[i * 6 + 5] == mode->key_b + ? 0 + : 255; + } + } + } + else if (mode->colortype == LCT_PALETTE) + { + unsigned index; + size_t j = 0; + for (i = 0; i < numpixels; i++, buffer += num_channels) + { + if (mode->bitdepth == 8) + index = in[i]; + else + index = readBitsFromReversedStream(&j, in, mode->bitdepth); - if(index >= mode->palettesize) - { - /*This is an error according to the PNG spec, but most PNG decoders make it black instead. - Done here too, slightly faster due to no error handling needed.*/ - buffer[0] = buffer[1] = buffer[2] = 0; - if(has_alpha) buffer[3] = 255; - } - else - { - buffer[0] = mode->palette[index * 4 + 0]; - buffer[1] = mode->palette[index * 4 + 1]; - buffer[2] = mode->palette[index * 4 + 2]; - if(has_alpha) buffer[3] = mode->palette[index * 4 + 3]; - } - } - } - else if(mode->colortype == LCT_GREY_ALPHA) - { - if(mode->bitdepth == 8) - { - for(i = 0; i < numpixels; i++, buffer += num_channels) - { - buffer[0] = buffer[1] = buffer[2] = in[i * 2 + 0]; - if(has_alpha) buffer[3] = in[i * 2 + 1]; - } - } - else - { - for(i = 0; i < numpixels; i++, buffer += num_channels) - { - buffer[0] = buffer[1] = buffer[2] = in[i * 4 + 0]; - if(has_alpha) buffer[3] = in[i * 4 + 2]; - } - } - } - else if(mode->colortype == LCT_RGBA) - { - if(mode->bitdepth == 8) - { - for(i = 0; i < numpixels; i++, buffer += num_channels) - { - buffer[0] = in[i * 4 + 0]; - buffer[1] = in[i * 4 + 1]; - buffer[2] = in[i * 4 + 2]; - if(has_alpha) buffer[3] = in[i * 4 + 3]; - } - } - else - { - for(i = 0; i < numpixels; i++, buffer += num_channels) - { - buffer[0] = in[i * 8 + 0]; - buffer[1] = in[i * 8 + 2]; - buffer[2] = in[i * 8 + 4]; - if(has_alpha) buffer[3] = in[i * 8 + 6]; - } - } - } + if (index >= mode->palettesize) + { + /*This is an error according to the PNG spec, but most PNG decoders make it black + instead. Done here too, slightly faster due to no error handling needed.*/ + buffer[0] = buffer[1] = buffer[2] = 0; + if (has_alpha) + buffer[3] = 255; + } + else + { + buffer[0] = mode->palette[index * 4 + 0]; + buffer[1] = mode->palette[index * 4 + 1]; + buffer[2] = mode->palette[index * 4 + 2]; + if (has_alpha) + buffer[3] = mode->palette[index * 4 + 3]; + } + } + } + else if (mode->colortype == LCT_GREY_ALPHA) + { + if (mode->bitdepth == 8) + { + for (i = 0; i < numpixels; i++, buffer += num_channels) + { + buffer[0] = buffer[1] = buffer[2] = in[i * 2 + 0]; + if (has_alpha) + buffer[3] = in[i * 2 + 1]; + } + } + else + { + for (i = 0; i < numpixels; i++, buffer += num_channels) + { + buffer[0] = buffer[1] = buffer[2] = in[i * 4 + 0]; + if (has_alpha) + buffer[3] = in[i * 4 + 2]; + } + } + } + else if (mode->colortype == LCT_RGBA) + { + if (mode->bitdepth == 8) + { + for (i = 0; i < numpixels; i++, buffer += num_channels) + { + buffer[0] = in[i * 4 + 0]; + buffer[1] = in[i * 4 + 1]; + buffer[2] = in[i * 4 + 2]; + if (has_alpha) + buffer[3] = in[i * 4 + 3]; + } + } + else + { + for (i = 0; i < numpixels; i++, buffer += num_channels) + { + buffer[0] = in[i * 8 + 0]; + buffer[1] = in[i * 8 + 2]; + buffer[2] = in[i * 8 + 4]; + if (has_alpha) + buffer[3] = in[i * 8 + 6]; + } + } + } } /*Get RGBA16 color of pixel with index i (y * width + x) from the raw image with given color type, but the given color type must be 16-bit itself.*/ -static void getPixelColorRGBA16(unsigned short* r, unsigned short* g, unsigned short* b, unsigned short* a, - const unsigned char* in, size_t i, const LodePNGColorMode* mode) +static void getPixelColorRGBA16(unsigned short* r, unsigned short* g, unsigned short* b, + unsigned short* a, const unsigned char* in, size_t i, + const LodePNGColorMode* mode) { - if(mode->colortype == LCT_GREY) - { - *r = *g = *b = 256 * in[i * 2 + 0] + in[i * 2 + 1]; - if(mode->key_defined && 256U * in[i * 2 + 0] + in[i * 2 + 1] == mode->key_r) *a = 0; - else *a = 65535; - } - else if(mode->colortype == LCT_RGB) - { - *r = 256 * in[i * 6 + 0] + in[i * 6 + 1]; - *g = 256 * in[i * 6 + 2] + in[i * 6 + 3]; - *b = 256 * in[i * 6 + 4] + in[i * 6 + 5]; - if(mode->key_defined && 256U * in[i * 6 + 0] + in[i * 6 + 1] == mode->key_r - && 256U * in[i * 6 + 2] + in[i * 6 + 3] == mode->key_g - && 256U * in[i * 6 + 4] + in[i * 6 + 5] == mode->key_b) *a = 0; - else *a = 65535; - } - else if(mode->colortype == LCT_GREY_ALPHA) - { - *r = *g = *b = 256 * in[i * 4 + 0] + in[i * 4 + 1]; - *a = 256 * in[i * 4 + 2] + in[i * 4 + 3]; - } - else if(mode->colortype == LCT_RGBA) - { - *r = 256 * in[i * 8 + 0] + in[i * 8 + 1]; - *g = 256 * in[i * 8 + 2] + in[i * 8 + 3]; - *b = 256 * in[i * 8 + 4] + in[i * 8 + 5]; - *a = 256 * in[i * 8 + 6] + in[i * 8 + 7]; - } + if (mode->colortype == LCT_GREY) + { + *r = *g = *b = 256 * in[i * 2 + 0] + in[i * 2 + 1]; + if (mode->key_defined && 256U * in[i * 2 + 0] + in[i * 2 + 1] == mode->key_r) + *a = 0; + else + *a = 65535; + } + else if (mode->colortype == LCT_RGB) + { + *r = 256 * in[i * 6 + 0] + in[i * 6 + 1]; + *g = 256 * in[i * 6 + 2] + in[i * 6 + 3]; + *b = 256 * in[i * 6 + 4] + in[i * 6 + 5]; + if (mode->key_defined && 256U * in[i * 6 + 0] + in[i * 6 + 1] == mode->key_r && + 256U * in[i * 6 + 2] + in[i * 6 + 3] == mode->key_g && + 256U * in[i * 6 + 4] + in[i * 6 + 5] == mode->key_b) + *a = 0; + else + *a = 65535; + } + else if (mode->colortype == LCT_GREY_ALPHA) + { + *r = *g = *b = 256 * in[i * 4 + 0] + in[i * 4 + 1]; + *a = 256 * in[i * 4 + 2] + in[i * 4 + 3]; + } + else if (mode->colortype == LCT_RGBA) + { + *r = 256 * in[i * 8 + 0] + in[i * 8 + 1]; + *g = 256 * in[i * 8 + 2] + in[i * 8 + 3]; + *b = 256 * in[i * 8 + 4] + in[i * 8 + 5]; + *a = 256 * in[i * 8 + 6] + in[i * 8 + 7]; + } } -unsigned lodepng_convert(unsigned char* out, const unsigned char* in, - LodePNGColorMode* mode_out, const LodePNGColorMode* mode_in, - unsigned w, unsigned h) +unsigned lodepng_convert(unsigned char* out, const unsigned char* in, LodePNGColorMode* mode_out, + const LodePNGColorMode* mode_in, unsigned w, unsigned h) { - size_t i; - ColorTree tree; - size_t numpixels = w * h; + size_t i; + ColorTree tree; + size_t numpixels = w * h; - if(lodepng_color_mode_equal(mode_out, mode_in)) - { - size_t numbytes = lodepng_get_raw_size(w, h, mode_in); - for(i = 0; i < numbytes; i++) out[i] = in[i]; - return 0; - } + if (lodepng_color_mode_equal(mode_out, mode_in)) + { + size_t numbytes = lodepng_get_raw_size(w, h, mode_in); + for (i = 0; i < numbytes; i++) + out[i] = in[i]; + return 0; + } - if(mode_out->colortype == LCT_PALETTE) - { - size_t palsize = 1u << mode_out->bitdepth; - if(mode_out->palettesize < palsize) palsize = mode_out->palettesize; - color_tree_init(&tree); - for(i = 0; i < palsize; i++) - { - unsigned char* p = &mode_out->palette[i * 4]; - color_tree_add(&tree, p[0], p[1], p[2], p[3], i); - } - } + if (mode_out->colortype == LCT_PALETTE) + { + size_t palsize = 1u << mode_out->bitdepth; + if (mode_out->palettesize < palsize) + palsize = mode_out->palettesize; + color_tree_init(&tree); + for (i = 0; i < palsize; i++) + { + unsigned char* p = &mode_out->palette[i * 4]; + color_tree_add(&tree, p[0], p[1], p[2], p[3], i); + } + } - if(mode_in->bitdepth == 16 && mode_out->bitdepth == 16) - { - for(i = 0; i < numpixels; i++) - { - unsigned short r = 0, g = 0, b = 0, a = 0; - getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in); - rgba16ToPixel(out, i, mode_out, r, g, b, a); - } - } - else if(mode_out->bitdepth == 8 && mode_out->colortype == LCT_RGBA) - { - getPixelColorsRGBA8(out, numpixels, 1, in, mode_in); - } - else if(mode_out->bitdepth == 8 && mode_out->colortype == LCT_RGB) - { - getPixelColorsRGBA8(out, numpixels, 0, in, mode_in); - } - else - { - unsigned char r = 0, g = 0, b = 0, a = 0; - for(i = 0; i < numpixels; i++) - { - getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode_in); - rgba8ToPixel(out, i, mode_out, &tree, r, g, b, a); - } - } + if (mode_in->bitdepth == 16 && mode_out->bitdepth == 16) + { + for (i = 0; i < numpixels; i++) + { + unsigned short r = 0, g = 0, b = 0, a = 0; + getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in); + rgba16ToPixel(out, i, mode_out, r, g, b, a); + } + } + else if (mode_out->bitdepth == 8 && mode_out->colortype == LCT_RGBA) + { + getPixelColorsRGBA8(out, numpixels, 1, in, mode_in); + } + else if (mode_out->bitdepth == 8 && mode_out->colortype == LCT_RGB) + { + getPixelColorsRGBA8(out, numpixels, 0, in, mode_in); + } + else + { + unsigned char r = 0, g = 0, b = 0, a = 0; + for (i = 0; i < numpixels; i++) + { + getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode_in); + rgba8ToPixel(out, i, mode_out, &tree, r, g, b, a); + } + } - if(mode_out->colortype == LCT_PALETTE) - { - color_tree_cleanup(&tree); - } + if (mode_out->colortype == LCT_PALETTE) + { + color_tree_cleanup(&tree); + } - return 0; /*no error (this function currently never has one, but maybe OOM detection added later.)*/ + return 0; /*no error (this function currently never has one, but maybe OOM detection added + later.)*/ } #ifdef LODEPNG_COMPILE_ENCODER void lodepng_color_profile_init(LodePNGColorProfile* profile) { - profile->colored = 0; - profile->key = 0; - profile->alpha = 0; - profile->key_r = profile->key_g = profile->key_b = 0; - profile->numcolors = 0; - profile->bits = 1; + profile->colored = 0; + profile->key = 0; + profile->alpha = 0; + profile->key_r = profile->key_g = profile->key_b = 0; + profile->numcolors = 0; + profile->bits = 1; } /*function used for debug purposes with C++*/ @@ -3546,169 +3913,185 @@ void lodepng_color_profile_init(LodePNGColorProfile* profile) /*Returns how many bits needed to represent given value (max 8 bit)*/ unsigned getValueRequiredBits(unsigned char value) { - if(value == 0 || value == 255) return 1; - /*The scaling of 2-bit and 4-bit values uses multiples of 85 and 17*/ - if(value % 17 == 0) return value % 85 == 0 ? 2 : 4; - return 8; + if (value == 0 || value == 255) + return 1; + /*The scaling of 2-bit and 4-bit values uses multiples of 85 and 17*/ + if (value % 17 == 0) + return value % 85 == 0 ? 2 : 4; + return 8; } /*profile must already have been inited with mode. It's ok to set some parameters of profile to done already.*/ -unsigned get_color_profile(LodePNGColorProfile* profile, - const unsigned char* in, unsigned w, unsigned h, - const LodePNGColorMode* mode) +unsigned get_color_profile(LodePNGColorProfile* profile, const unsigned char* in, unsigned w, + unsigned h, const LodePNGColorMode* mode) { - unsigned error = 0; - size_t i; - ColorTree tree; - size_t numpixels = w * h; + unsigned error = 0; + size_t i; + ColorTree tree; + size_t numpixels = w * h; - unsigned colored_done = lodepng_is_greyscale_type(mode) ? 1 : 0; - unsigned alpha_done = lodepng_can_have_alpha(mode) ? 0 : 1; - unsigned numcolors_done = 0; - unsigned bpp = lodepng_get_bpp(mode); - unsigned bits_done = bpp == 1 ? 1 : 0; - unsigned maxnumcolors = 257; - unsigned sixteen = 0; - if(bpp <= 8) maxnumcolors = bpp == 1 ? 2 : (bpp == 2 ? 4 : (bpp == 4 ? 16 : 256)); + unsigned colored_done = lodepng_is_greyscale_type(mode) ? 1 : 0; + unsigned alpha_done = lodepng_can_have_alpha(mode) ? 0 : 1; + unsigned numcolors_done = 0; + unsigned bpp = lodepng_get_bpp(mode); + unsigned bits_done = bpp == 1 ? 1 : 0; + unsigned maxnumcolors = 257; + unsigned sixteen = 0; + if (bpp <= 8) + maxnumcolors = bpp == 1 ? 2 : (bpp == 2 ? 4 : (bpp == 4 ? 16 : 256)); - color_tree_init(&tree); + color_tree_init(&tree); - /*Check if the 16-bit input is truly 16-bit*/ - if(mode->bitdepth == 16) - { - unsigned short r, g, b, a; - for(i = 0; i < numpixels; i++) - { - getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode); - if(r % 257u != 0 || g % 257u != 0 || b % 257u != 0 || a % 257u != 0) /*first and second byte differ*/ - { - sixteen = 1; - break; - } - } - } + /*Check if the 16-bit input is truly 16-bit*/ + if (mode->bitdepth == 16) + { + unsigned short r, g, b, a; + for (i = 0; i < numpixels; i++) + { + getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode); + if (r % 257u != 0 || g % 257u != 0 || b % 257u != 0 || + a % 257u != 0) /*first and second byte differ*/ + { + sixteen = 1; + break; + } + } + } - if(sixteen) - { - unsigned short r = 0, g = 0, b = 0, a = 0; - profile->bits = 16; - bits_done = numcolors_done = 1; /*counting colors no longer useful, palette doesn't support 16-bit*/ + if (sixteen) + { + unsigned short r = 0, g = 0, b = 0, a = 0; + profile->bits = 16; + bits_done = numcolors_done = + 1; /*counting colors no longer useful, palette doesn't support 16-bit*/ - for(i = 0; i < numpixels; i++) - { - getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode); - - if(!colored_done && (r != g || r != b)) - { - profile->colored = 1; - colored_done = 1; - } + for (i = 0; i < numpixels; i++) + { + getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode); - if(!alpha_done) - { - unsigned matchkey = (r == profile->key_r && g == profile->key_g && b == profile->key_b); - if(a != 65535 && (a != 0 || (profile->key && !matchkey))) - { - profile->alpha = 1; - alpha_done = 1; - if(profile->bits < 8) profile->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ - } - else if(a == 0 && !profile->alpha && !profile->key) - { - profile->key = 1; - profile->key_r = r; - profile->key_g = g; - profile->key_b = b; - } - else if(a == 65535 && profile->key && matchkey) - { - /* Color key cannot be used if an opaque pixel also has that RGB color. */ - profile->alpha = 1; - alpha_done = 1; - } - } + if (!colored_done && (r != g || r != b)) + { + profile->colored = 1; + colored_done = 1; + } - if(alpha_done && numcolors_done && colored_done && bits_done) break; - } - } - else /* < 16-bit */ - { - for(i = 0; i < numpixels; i++) - { - unsigned char r = 0, g = 0, b = 0, a = 0; - getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode); + if (!alpha_done) + { + unsigned matchkey = + (r == profile->key_r && g == profile->key_g && b == profile->key_b); + if (a != 65535 && (a != 0 || (profile->key && !matchkey))) + { + profile->alpha = 1; + alpha_done = 1; + if (profile->bits < 8) + profile->bits = + 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ + } + else if (a == 0 && !profile->alpha && !profile->key) + { + profile->key = 1; + profile->key_r = r; + profile->key_g = g; + profile->key_b = b; + } + else if (a == 65535 && profile->key && matchkey) + { + /* Color key cannot be used if an opaque pixel also has that RGB color. */ + profile->alpha = 1; + alpha_done = 1; + } + } - if(!bits_done && profile->bits < 8) - { - /*only r is checked, < 8 bits is only relevant for greyscale*/ - unsigned bits = getValueRequiredBits(r); - if(bits > profile->bits) profile->bits = bits; - } - bits_done = (profile->bits >= bpp); + if (alpha_done && numcolors_done && colored_done && bits_done) + break; + } + } + else /* < 16-bit */ + { + for (i = 0; i < numpixels; i++) + { + unsigned char r = 0, g = 0, b = 0, a = 0; + getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode); - if(!colored_done && (r != g || r != b)) - { - profile->colored = 1; - colored_done = 1; - if(profile->bits < 8) profile->bits = 8; /*PNG has no colored modes with less than 8-bit per channel*/ - } + if (!bits_done && profile->bits < 8) + { + /*only r is checked, < 8 bits is only relevant for greyscale*/ + unsigned bits = getValueRequiredBits(r); + if (bits > profile->bits) + profile->bits = bits; + } + bits_done = (profile->bits >= bpp); - if(!alpha_done) - { - unsigned matchkey = (r == profile->key_r && g == profile->key_g && b == profile->key_b); - if(a != 255 && (a != 0 || (profile->key && !matchkey))) - { - profile->alpha = 1; - alpha_done = 1; - if(profile->bits < 8) profile->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ - } - else if(a == 0 && !profile->alpha && !profile->key) - { - profile->key = 1; - profile->key_r = r; - profile->key_g = g; - profile->key_b = b; - } - else if(a == 255 && profile->key && matchkey) - { - /* Color key cannot be used if an opaque pixel also has that RGB color. */ - profile->alpha = 1; - alpha_done = 1; - if(profile->bits < 8) profile->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ - } - } + if (!colored_done && (r != g || r != b)) + { + profile->colored = 1; + colored_done = 1; + if (profile->bits < 8) + profile->bits = 8; /*PNG has no colored modes with less than 8-bit per channel*/ + } - if(!numcolors_done) - { - if(!color_tree_has(&tree, r, g, b, a)) - { - color_tree_add(&tree, r, g, b, a, profile->numcolors); - if(profile->numcolors < 256) - { - unsigned char* p = profile->palette; - unsigned n = profile->numcolors; - p[n * 4 + 0] = r; - p[n * 4 + 1] = g; - p[n * 4 + 2] = b; - p[n * 4 + 3] = a; - } - profile->numcolors++; - numcolors_done = profile->numcolors >= maxnumcolors; - } - } + if (!alpha_done) + { + unsigned matchkey = + (r == profile->key_r && g == profile->key_g && b == profile->key_b); + if (a != 255 && (a != 0 || (profile->key && !matchkey))) + { + profile->alpha = 1; + alpha_done = 1; + if (profile->bits < 8) + profile->bits = + 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ + } + else if (a == 0 && !profile->alpha && !profile->key) + { + profile->key = 1; + profile->key_r = r; + profile->key_g = g; + profile->key_b = b; + } + else if (a == 255 && profile->key && matchkey) + { + /* Color key cannot be used if an opaque pixel also has that RGB color. */ + profile->alpha = 1; + alpha_done = 1; + if (profile->bits < 8) + profile->bits = + 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ + } + } - if(alpha_done && numcolors_done && colored_done && bits_done) break; - } + if (!numcolors_done) + { + if (!color_tree_has(&tree, r, g, b, a)) + { + color_tree_add(&tree, r, g, b, a, profile->numcolors); + if (profile->numcolors < 256) + { + unsigned char* p = profile->palette; + unsigned n = profile->numcolors; + p[n * 4 + 0] = r; + p[n * 4 + 1] = g; + p[n * 4 + 2] = b; + p[n * 4 + 3] = a; + } + profile->numcolors++; + numcolors_done = profile->numcolors >= maxnumcolors; + } + } - /*make the profile's key always 16-bit for consistency - repeat each byte twice*/ - profile->key_r *= 257; - profile->key_g *= 257; - profile->key_b *= 257; - } + if (alpha_done && numcolors_done && colored_done && bits_done) + break; + } - color_tree_cleanup(&tree); - return error; + /*make the profile's key always 16-bit for consistency - repeat each byte twice*/ + profile->key_r *= 257; + profile->key_g *= 257; + profile->key_b *= 257; + } + + color_tree_cleanup(&tree); + return error; } /*Automatically chooses color type that gives smallest amount of bits in the @@ -3716,65 +4099,72 @@ output image, e.g. grey if there are only greyscale pixels, palette if there are less than 256 colors, ... Updates values of mode with a potentially smaller color model. mode_out should contain the user chosen color model, but will be overwritten with the new chosen one.*/ -unsigned lodepng_auto_choose_color(LodePNGColorMode* mode_out, - const unsigned char* image, unsigned w, unsigned h, - const LodePNGColorMode* mode_in) +unsigned lodepng_auto_choose_color(LodePNGColorMode* mode_out, const unsigned char* image, + unsigned w, unsigned h, const LodePNGColorMode* mode_in) { - LodePNGColorProfile prof; - unsigned error = 0; - unsigned i, n, palettebits, grey_ok, palette_ok; + LodePNGColorProfile prof; + unsigned error = 0; + unsigned i, n, palettebits, grey_ok, palette_ok; - lodepng_color_profile_init(&prof); - error = get_color_profile(&prof, image, w, h, mode_in); - if(error) return error; - mode_out->key_defined = 0; + lodepng_color_profile_init(&prof); + error = get_color_profile(&prof, image, w, h, mode_in); + if (error) + return error; + mode_out->key_defined = 0; - if(prof.key && w * h <= 16) prof.alpha = 1; /*too few pixels to justify tRNS chunk overhead*/ - grey_ok = !prof.colored && !prof.alpha; /*grey without alpha, with potentially low bits*/ - n = prof.numcolors; - palettebits = n <= 2 ? 1 : (n <= 4 ? 2 : (n <= 16 ? 4 : 8)); - palette_ok = n <= 256 && (n * 2 < w * h) && prof.bits <= 8; - if(w * h < n * 2) palette_ok = 0; /*don't add palette overhead if image has only a few pixels*/ - if(grey_ok && prof.bits <= palettebits) palette_ok = 0; /*grey is less overhead*/ + if (prof.key && w * h <= 16) + prof.alpha = 1; /*too few pixels to justify tRNS chunk overhead*/ + grey_ok = !prof.colored && !prof.alpha; /*grey without alpha, with potentially low bits*/ + n = prof.numcolors; + palettebits = n <= 2 ? 1 : (n <= 4 ? 2 : (n <= 16 ? 4 : 8)); + palette_ok = n <= 256 && (n * 2 < w * h) && prof.bits <= 8; + if (w * h < n * 2) + palette_ok = 0; /*don't add palette overhead if image has only a few pixels*/ + if (grey_ok && prof.bits <= palettebits) + palette_ok = 0; /*grey is less overhead*/ - if(palette_ok) - { - unsigned char* p = prof.palette; - lodepng_palette_clear(mode_out); /*remove potential earlier palette*/ - for(i = 0; i < prof.numcolors; i++) - { - error = lodepng_palette_add(mode_out, p[i * 4 + 0], p[i * 4 + 1], p[i * 4 + 2], p[i * 4 + 3]); - if(error) break; - } + if (palette_ok) + { + unsigned char* p = prof.palette; + lodepng_palette_clear(mode_out); /*remove potential earlier palette*/ + for (i = 0; i < prof.numcolors; i++) + { + error = lodepng_palette_add(mode_out, p[i * 4 + 0], p[i * 4 + 1], p[i * 4 + 2], + p[i * 4 + 3]); + if (error) + break; + } - mode_out->colortype = LCT_PALETTE; - mode_out->bitdepth = palettebits; + mode_out->colortype = LCT_PALETTE; + mode_out->bitdepth = palettebits; - if(mode_in->colortype == LCT_PALETTE && mode_in->palettesize >= mode_out->palettesize - && mode_in->bitdepth == mode_out->bitdepth) - { - /*If input should have same palette colors, keep original to preserve its order and prevent conversion*/ - lodepng_color_mode_cleanup(mode_out); - lodepng_color_mode_copy(mode_out, mode_in); - } - } - else /*8-bit or 16-bit per channel*/ - { - mode_out->bitdepth = prof.bits; - mode_out->colortype = prof.alpha ? (prof.colored ? LCT_RGBA : LCT_GREY_ALPHA) - : (prof.colored ? LCT_RGB : LCT_GREY); + if (mode_in->colortype == LCT_PALETTE && mode_in->palettesize >= mode_out->palettesize && + mode_in->bitdepth == mode_out->bitdepth) + { + /*If input should have same palette colors, keep original to preserve its order and + * prevent conversion*/ + lodepng_color_mode_cleanup(mode_out); + lodepng_color_mode_copy(mode_out, mode_in); + } + } + else /*8-bit or 16-bit per channel*/ + { + mode_out->bitdepth = prof.bits; + mode_out->colortype = prof.alpha ? (prof.colored ? LCT_RGBA : LCT_GREY_ALPHA) + : (prof.colored ? LCT_RGB : LCT_GREY); - if(prof.key && !prof.alpha) - { - unsigned mask = (1u << mode_out->bitdepth) - 1u; /*profile always uses 16-bit, mask converts it*/ - mode_out->key_r = prof.key_r & mask; - mode_out->key_g = prof.key_g & mask; - mode_out->key_b = prof.key_b & mask; - mode_out->key_defined = 1; - } - } + if (prof.key && !prof.alpha) + { + unsigned mask = + (1u << mode_out->bitdepth) - 1u; /*profile always uses 16-bit, mask converts it*/ + mode_out->key_r = prof.key_r & mask; + mode_out->key_g = prof.key_g & mask; + mode_out->key_b = prof.key_b & mask; + mode_out->key_defined = 1; + } + } - return error; + return error; } #endif /* #ifdef LODEPNG_COMPILE_ENCODER */ @@ -3786,13 +4176,16 @@ are only needed to make the paeth calculation correct. */ static unsigned char paethPredictor(short a, short b, short c) { - short pa = abs(b - c); - short pb = abs(a - c); - short pc = abs(a + b - c - c); + short pa = abs(b - c); + short pb = abs(a - c); + short pc = abs(a + b - c - c); - if(pc < pa && pc < pb) return (unsigned char)c; - else if(pb < pa) return (unsigned char)b; - else return (unsigned char)a; + if (pc < pa && pc < pb) + return (unsigned char)c; + else if (pb < pa) + return (unsigned char)b; + else + return (unsigned char)a; } /*shared values used by multiple Adam7 related functions*/ @@ -3818,31 +4211,36 @@ bpp: bits per pixel end at a full byte */ static void Adam7_getpassvalues(unsigned passw[7], unsigned passh[7], size_t filter_passstart[8], - size_t padded_passstart[8], size_t passstart[8], unsigned w, unsigned h, unsigned bpp) + size_t padded_passstart[8], size_t passstart[8], unsigned w, + unsigned h, unsigned bpp) { - /*the passstart values have 8 values: the 8th one indicates the byte after the end of the 7th (= last) pass*/ - unsigned i; + /*the passstart values have 8 values: the 8th one indicates the byte after the end of the 7th (= + * last) pass*/ + unsigned i; - /*calculate width and height in pixels of each pass*/ - for(i = 0; i < 7; i++) - { - passw[i] = (w + ADAM7_DX[i] - ADAM7_IX[i] - 1) / ADAM7_DX[i]; - passh[i] = (h + ADAM7_DY[i] - ADAM7_IY[i] - 1) / ADAM7_DY[i]; - if(passw[i] == 0) passh[i] = 0; - if(passh[i] == 0) passw[i] = 0; - } + /*calculate width and height in pixels of each pass*/ + for (i = 0; i < 7; i++) + { + passw[i] = (w + ADAM7_DX[i] - ADAM7_IX[i] - 1) / ADAM7_DX[i]; + passh[i] = (h + ADAM7_DY[i] - ADAM7_IY[i] - 1) / ADAM7_DY[i]; + if (passw[i] == 0) + passh[i] = 0; + if (passh[i] == 0) + passw[i] = 0; + } - filter_passstart[0] = padded_passstart[0] = passstart[0] = 0; - for(i = 0; i < 7; i++) - { - /*if passw[i] is 0, it's 0 bytes, not 1 (no filtertype-byte)*/ - filter_passstart[i + 1] = filter_passstart[i] - + ((passw[i] && passh[i]) ? passh[i] * (1 + (passw[i] * bpp + 7) / 8) : 0); - /*bits padded if needed to fill full byte at end of each scanline*/ - padded_passstart[i + 1] = padded_passstart[i] + passh[i] * ((passw[i] * bpp + 7) / 8); - /*only padded at end of reduced image*/ - passstart[i + 1] = passstart[i] + (passh[i] * passw[i] * bpp + 7) / 8; - } + filter_passstart[0] = padded_passstart[0] = passstart[0] = 0; + for (i = 0; i < 7; i++) + { + /*if passw[i] is 0, it's 0 bytes, not 1 (no filtertype-byte)*/ + filter_passstart[i + 1] = + filter_passstart[i] + + ((passw[i] && passh[i]) ? passh[i] * (1 + (passw[i] * bpp + 7) / 8) : 0); + /*bits padded if needed to fill full byte at end of each scanline*/ + padded_passstart[i + 1] = padded_passstart[i] + passh[i] * ((passw[i] * bpp + 7) / 8); + /*only padded at end of reduced image*/ + passstart[i + 1] = passstart[i] + (passh[i] * passw[i] * bpp + 7) / 8; + } } #ifdef LODEPNG_COMPILE_DECODER @@ -3852,166 +4250,188 @@ static void Adam7_getpassvalues(unsigned passw[7], unsigned passh[7], size_t fil /* ////////////////////////////////////////////////////////////////////////// */ /*read the information from the header and store it in the LodePNGInfo. return value is error*/ -unsigned lodepng_inspect(unsigned* w, unsigned* h, LodePNGState* state, - const unsigned char* in, size_t insize) +unsigned lodepng_inspect(unsigned* w, unsigned* h, LodePNGState* state, const unsigned char* in, + size_t insize) { - LodePNGInfo* info = &state->info_png; - if(insize == 0 || in == 0) - { - CERROR_RETURN_ERROR(state->error, 48); /*error: the given data is empty*/ - } - if(insize < 29) - { - CERROR_RETURN_ERROR(state->error, 27); /*error: the data length is smaller than the length of a PNG header*/ - } + LodePNGInfo* info = &state->info_png; + if (insize == 0 || in == 0) + { + CERROR_RETURN_ERROR(state->error, 48); /*error: the given data is empty*/ + } + if (insize < 29) + { + CERROR_RETURN_ERROR( + state->error, 27); /*error: the data length is smaller than the length of a PNG header*/ + } - /*when decoding a new PNG image, make sure all parameters created after previous decoding are reset*/ - lodepng_info_cleanup(info); - lodepng_info_init(info); + /*when decoding a new PNG image, make sure all parameters created after previous decoding are + * reset*/ + lodepng_info_cleanup(info); + lodepng_info_init(info); - if(in[0] != 137 || in[1] != 80 || in[2] != 78 || in[3] != 71 - || in[4] != 13 || in[5] != 10 || in[6] != 26 || in[7] != 10) - { - CERROR_RETURN_ERROR(state->error, 28); /*error: the first 8 bytes are not the correct PNG signature*/ - } - if(in[12] != 'I' || in[13] != 'H' || in[14] != 'D' || in[15] != 'R') - { - CERROR_RETURN_ERROR(state->error, 29); /*error: it doesn't start with a IHDR chunk!*/ - } + if (in[0] != 137 || in[1] != 80 || in[2] != 78 || in[3] != 71 || in[4] != 13 || in[5] != 10 || + in[6] != 26 || in[7] != 10) + { + CERROR_RETURN_ERROR(state->error, + 28); /*error: the first 8 bytes are not the correct PNG signature*/ + } + if (in[12] != 'I' || in[13] != 'H' || in[14] != 'D' || in[15] != 'R') + { + CERROR_RETURN_ERROR(state->error, 29); /*error: it doesn't start with a IHDR chunk!*/ + } - /*read the values given in the header*/ - *w = lodepng_read32bitInt(&in[16]); - *h = lodepng_read32bitInt(&in[20]); - info->color.bitdepth = in[24]; - info->color.colortype = (LodePNGColorType)in[25]; - info->compression_method = in[26]; - info->filter_method = in[27]; - info->interlace_method = in[28]; + /*read the values given in the header*/ + *w = lodepng_read32bitInt(&in[16]); + *h = lodepng_read32bitInt(&in[20]); + info->color.bitdepth = in[24]; + info->color.colortype = (LodePNGColorType)in[25]; + info->compression_method = in[26]; + info->filter_method = in[27]; + info->interlace_method = in[28]; - if(!state->decoder.ignore_crc) - { - unsigned CRC = lodepng_read32bitInt(&in[29]); - unsigned checksum = lodepng_crc32(&in[12], 17); - if(CRC != checksum) - { - CERROR_RETURN_ERROR(state->error, 57); /*invalid CRC*/ - } - } + if (!state->decoder.ignore_crc) + { + unsigned CRC = lodepng_read32bitInt(&in[29]); + unsigned checksum = lodepng_crc32(&in[12], 17); + if (CRC != checksum) + { + CERROR_RETURN_ERROR(state->error, 57); /*invalid CRC*/ + } + } - /*error: only compression method 0 is allowed in the specification*/ - if(info->compression_method != 0) CERROR_RETURN_ERROR(state->error, 32); - /*error: only filter method 0 is allowed in the specification*/ - if(info->filter_method != 0) CERROR_RETURN_ERROR(state->error, 33); - /*error: only interlace methods 0 and 1 exist in the specification*/ - if(info->interlace_method > 1) CERROR_RETURN_ERROR(state->error, 34); + /*error: only compression method 0 is allowed in the specification*/ + if (info->compression_method != 0) + CERROR_RETURN_ERROR(state->error, 32); + /*error: only filter method 0 is allowed in the specification*/ + if (info->filter_method != 0) + CERROR_RETURN_ERROR(state->error, 33); + /*error: only interlace methods 0 and 1 exist in the specification*/ + if (info->interlace_method > 1) + CERROR_RETURN_ERROR(state->error, 34); - state->error = checkColorValidity(info->color.colortype, info->color.bitdepth); - return state->error; + state->error = checkColorValidity(info->color.colortype, info->color.bitdepth); + return state->error; } -static unsigned unfilterScanline(unsigned char* recon, const unsigned char* scanline, const unsigned char* precon, - size_t bytewidth, unsigned char filterType, size_t length) +static unsigned unfilterScanline(unsigned char* recon, const unsigned char* scanline, + const unsigned char* precon, size_t bytewidth, + unsigned char filterType, size_t length) { - /* - For PNG filter method 0 - unfilter a PNG image scanline by scanline. when the pixels are smaller than 1 byte, - the filter works byte per byte (bytewidth = 1) - precon is the previous unfiltered scanline, recon the result, scanline the current one - the incoming scanlines do NOT include the filtertype byte, that one is given in the parameter filterType instead - recon and scanline MAY be the same memory address! precon must be disjoint. - */ + /* + For PNG filter method 0 + unfilter a PNG image scanline by scanline. when the pixels are smaller than 1 byte, + the filter works byte per byte (bytewidth = 1) + precon is the previous unfiltered scanline, recon the result, scanline the current one + the incoming scanlines do NOT include the filtertype byte, that one is given in the parameter + filterType instead recon and scanline MAY be the same memory address! precon must be disjoint. + */ - size_t i; - switch(filterType) - { - case 0: - for(i = 0; i < length; i++) recon[i] = scanline[i]; - break; - case 1: - for(i = 0; i < bytewidth; i++) recon[i] = scanline[i]; - for(i = bytewidth; i < length; i++) recon[i] = scanline[i] + recon[i - bytewidth]; - break; - case 2: - if(precon) - { - for(i = 0; i < length; i++) recon[i] = scanline[i] + precon[i]; - } - else - { - for(i = 0; i < length; i++) recon[i] = scanline[i]; - } - break; - case 3: - if(precon) - { - for(i = 0; i < bytewidth; i++) recon[i] = scanline[i] + precon[i] / 2; - for(i = bytewidth; i < length; i++) recon[i] = scanline[i] + ((recon[i - bytewidth] + precon[i]) / 2); - } - else - { - for(i = 0; i < bytewidth; i++) recon[i] = scanline[i]; - for(i = bytewidth; i < length; i++) recon[i] = scanline[i] + recon[i - bytewidth] / 2; - } - break; - case 4: - if(precon) - { - for(i = 0; i < bytewidth; i++) - { - recon[i] = (scanline[i] + precon[i]); /*paethPredictor(0, precon[i], 0) is always precon[i]*/ - } - for(i = bytewidth; i < length; i++) - { - recon[i] = (scanline[i] + paethPredictor(recon[i - bytewidth], precon[i], precon[i - bytewidth])); - } - } - else - { - for(i = 0; i < bytewidth; i++) - { - recon[i] = scanline[i]; - } - for(i = bytewidth; i < length; i++) - { - /*paethPredictor(recon[i - bytewidth], 0, 0) is always recon[i - bytewidth]*/ - recon[i] = (scanline[i] + recon[i - bytewidth]); - } - } - break; - default: return 36; /*error: unexisting filter type given*/ - } - return 0; + size_t i; + switch (filterType) + { + case 0: + for (i = 0; i < length; i++) + recon[i] = scanline[i]; + break; + case 1: + for (i = 0; i < bytewidth; i++) + recon[i] = scanline[i]; + for (i = bytewidth; i < length; i++) + recon[i] = scanline[i] + recon[i - bytewidth]; + break; + case 2: + if (precon) + { + for (i = 0; i < length; i++) + recon[i] = scanline[i] + precon[i]; + } + else + { + for (i = 0; i < length; i++) + recon[i] = scanline[i]; + } + break; + case 3: + if (precon) + { + for (i = 0; i < bytewidth; i++) + recon[i] = scanline[i] + precon[i] / 2; + for (i = bytewidth; i < length; i++) + recon[i] = scanline[i] + ((recon[i - bytewidth] + precon[i]) / 2); + } + else + { + for (i = 0; i < bytewidth; i++) + recon[i] = scanline[i]; + for (i = bytewidth; i < length; i++) + recon[i] = scanline[i] + recon[i - bytewidth] / 2; + } + break; + case 4: + if (precon) + { + for (i = 0; i < bytewidth; i++) + { + recon[i] = (scanline[i] + + precon[i]); /*paethPredictor(0, precon[i], 0) is always precon[i]*/ + } + for (i = bytewidth; i < length; i++) + { + recon[i] = (scanline[i] + paethPredictor(recon[i - bytewidth], precon[i], + precon[i - bytewidth])); + } + } + else + { + for (i = 0; i < bytewidth; i++) + { + recon[i] = scanline[i]; + } + for (i = bytewidth; i < length; i++) + { + /*paethPredictor(recon[i - bytewidth], 0, 0) is always recon[i - bytewidth]*/ + recon[i] = (scanline[i] + recon[i - bytewidth]); + } + } + break; + default: + return 36; /*error: unexisting filter type given*/ + } + return 0; } -static unsigned unfilter(unsigned char* out, const unsigned char* in, unsigned w, unsigned h, unsigned bpp) +static unsigned unfilter(unsigned char* out, const unsigned char* in, unsigned w, unsigned h, + unsigned bpp) { - /* - For PNG filter method 0 - this function unfilters a single image (e.g. without interlacing this is called once, with Adam7 seven times) - out must have enough bytes allocated already, in must have the scanlines + 1 filtertype byte per scanline - w and h are image dimensions or dimensions of reduced image, bpp is bits per pixel - in and out are allowed to be the same memory address (but aren't the same size since in has the extra filter bytes) - */ + /* + For PNG filter method 0 + this function unfilters a single image (e.g. without interlacing this is called once, with Adam7 + seven times) out must have enough bytes allocated already, in must have the scanlines + 1 + filtertype byte per scanline w and h are image dimensions or dimensions of reduced image, bpp is + bits per pixel in and out are allowed to be the same memory address (but aren't the same size + since in has the extra filter bytes) + */ - unsigned y; - unsigned char* prevline = 0; + unsigned y; + unsigned char* prevline = 0; - /*bytewidth is used for filtering, is 1 when bpp < 8, number of bytes per pixel otherwise*/ - size_t bytewidth = (bpp + 7) / 8; - size_t linebytes = (w * bpp + 7) / 8; + /*bytewidth is used for filtering, is 1 when bpp < 8, number of bytes per pixel otherwise*/ + size_t bytewidth = (bpp + 7) / 8; + size_t linebytes = (w * bpp + 7) / 8; - for(y = 0; y < h; y++) - { - size_t outindex = linebytes * y; - size_t inindex = (1 + linebytes) * y; /*the extra filterbyte added to each row*/ - unsigned char filterType = in[inindex]; + for (y = 0; y < h; y++) + { + size_t outindex = linebytes * y; + size_t inindex = (1 + linebytes) * y; /*the extra filterbyte added to each row*/ + unsigned char filterType = in[inindex]; - CERROR_TRY_RETURN(unfilterScanline(&out[outindex], &in[inindex + 1], prevline, bytewidth, filterType, linebytes)); + CERROR_TRY_RETURN(unfilterScanline(&out[outindex], &in[inindex + 1], prevline, bytewidth, + filterType, linebytes)); - prevline = &out[outindex]; - } + prevline = &out[outindex]; + } - return 0; + return 0; } /* @@ -4025,715 +4445,802 @@ out must be big enough AND must be 0 everywhere if bpp < 8 in the current implem (because that's likely a little bit faster) NOTE: comments about padding bits are only relevant if bpp < 8 */ -static void Adam7_deinterlace(unsigned char* out, const unsigned char* in, unsigned w, unsigned h, unsigned bpp) +static void Adam7_deinterlace(unsigned char* out, const unsigned char* in, unsigned w, unsigned h, + unsigned bpp) { - unsigned passw[7], passh[7]; - size_t filter_passstart[8], padded_passstart[8], passstart[8]; - unsigned i; + unsigned passw[7], passh[7]; + size_t filter_passstart[8], padded_passstart[8], passstart[8]; + unsigned i; - Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); + Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); - if(bpp >= 8) - { - for(i = 0; i < 7; i++) - { - unsigned x, y, b; - size_t bytewidth = bpp / 8; - for(y = 0; y < passh[i]; y++) - for(x = 0; x < passw[i]; x++) - { - size_t pixelinstart = passstart[i] + (y * passw[i] + x) * bytewidth; - size_t pixeloutstart = ((ADAM7_IY[i] + y * ADAM7_DY[i]) * w + ADAM7_IX[i] + x * ADAM7_DX[i]) * bytewidth; - for(b = 0; b < bytewidth; b++) - { - out[pixeloutstart + b] = in[pixelinstart + b]; - } - } - } - } - else /*bpp < 8: Adam7 with pixels < 8 bit is a bit trickier: with bit pointers*/ - { - for(i = 0; i < 7; i++) - { - unsigned x, y, b; - unsigned ilinebits = bpp * passw[i]; - unsigned olinebits = bpp * w; - size_t obp, ibp; /*bit pointers (for out and in buffer)*/ - for(y = 0; y < passh[i]; y++) - for(x = 0; x < passw[i]; x++) - { - ibp = (8 * passstart[i]) + (y * ilinebits + x * bpp); - obp = (ADAM7_IY[i] + y * ADAM7_DY[i]) * olinebits + (ADAM7_IX[i] + x * ADAM7_DX[i]) * bpp; - for(b = 0; b < bpp; b++) - { - unsigned char bit = readBitFromReversedStream(&ibp, in); - /*note that this function assumes the out buffer is completely 0, use setBitOfReversedStream otherwise*/ - setBitOfReversedStream0(&obp, out, bit); - } - } - } - } + if (bpp >= 8) + { + for (i = 0; i < 7; i++) + { + unsigned x, y, b; + size_t bytewidth = bpp / 8; + for (y = 0; y < passh[i]; y++) + for (x = 0; x < passw[i]; x++) + { + size_t pixelinstart = passstart[i] + (y * passw[i] + x) * bytewidth; + size_t pixeloutstart = + ((ADAM7_IY[i] + y * ADAM7_DY[i]) * w + ADAM7_IX[i] + x * ADAM7_DX[i]) * + bytewidth; + for (b = 0; b < bytewidth; b++) + { + out[pixeloutstart + b] = in[pixelinstart + b]; + } + } + } + } + else /*bpp < 8: Adam7 with pixels < 8 bit is a bit trickier: with bit pointers*/ + { + for (i = 0; i < 7; i++) + { + unsigned x, y, b; + unsigned ilinebits = bpp * passw[i]; + unsigned olinebits = bpp * w; + size_t obp, ibp; /*bit pointers (for out and in buffer)*/ + for (y = 0; y < passh[i]; y++) + for (x = 0; x < passw[i]; x++) + { + ibp = (8 * passstart[i]) + (y * ilinebits + x * bpp); + obp = (ADAM7_IY[i] + y * ADAM7_DY[i]) * olinebits + + (ADAM7_IX[i] + x * ADAM7_DX[i]) * bpp; + for (b = 0; b < bpp; b++) + { + unsigned char bit = readBitFromReversedStream(&ibp, in); + /*note that this function assumes the out buffer is completely 0, use + * setBitOfReversedStream otherwise*/ + setBitOfReversedStream0(&obp, out, bit); + } + } + } + } } -static void removePaddingBits(unsigned char* out, const unsigned char* in, - size_t olinebits, size_t ilinebits, unsigned h) +static void removePaddingBits(unsigned char* out, const unsigned char* in, size_t olinebits, + size_t ilinebits, unsigned h) { - /* - After filtering there are still padding bits if scanlines have non multiple of 8 bit amounts. They need - to be removed (except at last scanline of (Adam7-reduced) image) before working with pure image buffers - for the Adam7 code, the color convert code and the output to the user. - in and out are allowed to be the same buffer, in may also be higher but still overlapping; in must - have >= ilinebits*h bits, out must have >= olinebits*h bits, olinebits must be <= ilinebits - also used to move bits after earlier such operations happened, e.g. in a sequence of reduced images from Adam7 - only useful if (ilinebits - olinebits) is a value in the range 1..7 - */ - unsigned y; - size_t diff = ilinebits - olinebits; - size_t ibp = 0, obp = 0; /*input and output bit pointers*/ - for(y = 0; y < h; y++) - { - size_t x; - for(x = 0; x < olinebits; x++) - { - unsigned char bit = readBitFromReversedStream(&ibp, in); - setBitOfReversedStream(&obp, out, bit); - } - ibp += diff; - } + /* + After filtering there are still padding bits if scanlines have non multiple of 8 bit amounts. + They need to be removed (except at last scanline of (Adam7-reduced) image) before working with + pure image buffers for the Adam7 code, the color convert code and the output to the user. in and + out are allowed to be the same buffer, in may also be higher but still overlapping; in must have + >= ilinebits*h bits, out must have >= olinebits*h bits, olinebits must be <= ilinebits also used + to move bits after earlier such operations happened, e.g. in a sequence of reduced images from + Adam7 only useful if (ilinebits - olinebits) is a value in the range 1..7 + */ + unsigned y; + size_t diff = ilinebits - olinebits; + size_t ibp = 0, obp = 0; /*input and output bit pointers*/ + for (y = 0; y < h; y++) + { + size_t x; + for (x = 0; x < olinebits; x++) + { + unsigned char bit = readBitFromReversedStream(&ibp, in); + setBitOfReversedStream(&obp, out, bit); + } + ibp += diff; + } } -/*out must be buffer big enough to contain full image, and in must contain the full decompressed data from -the IDAT chunks (with filter index bytes and possible padding bits) -return value is error*/ -static unsigned postProcessScanlines(unsigned char* out, unsigned char* in, - unsigned w, unsigned h, const LodePNGInfo* info_png) +/*out must be buffer big enough to contain full image, and in must contain the full decompressed +data from the IDAT chunks (with filter index bytes and possible padding bits) return value is +error*/ +static unsigned postProcessScanlines(unsigned char* out, unsigned char* in, unsigned w, unsigned h, + const LodePNGInfo* info_png) { - /* - This function converts the filtered-padded-interlaced data into pure 2D image buffer with the PNG's colortype. - Steps: - *) if no Adam7: 1) unfilter 2) remove padding bits (= posible extra bits per scanline if bpp < 8) - *) if adam7: 1) 7x unfilter 2) 7x remove padding bits 3) Adam7_deinterlace - NOTE: the in buffer will be overwritten with intermediate data! - */ - unsigned bpp = lodepng_get_bpp(&info_png->color); - if(bpp == 0) return 31; /*error: invalid colortype*/ + /* + This function converts the filtered-padded-interlaced data into pure 2D image buffer with the + PNG's colortype. Steps: + *) if no Adam7: 1) unfilter 2) remove padding bits (= posible extra bits per scanline if bpp < + 8) + *) if adam7: 1) 7x unfilter 2) 7x remove padding bits 3) Adam7_deinterlace + NOTE: the in buffer will be overwritten with intermediate data! + */ + unsigned bpp = lodepng_get_bpp(&info_png->color); + if (bpp == 0) + return 31; /*error: invalid colortype*/ - if(info_png->interlace_method == 0) - { - if(bpp < 8 && w * bpp != ((w * bpp + 7) / 8) * 8) - { - CERROR_TRY_RETURN(unfilter(in, in, w, h, bpp)); - removePaddingBits(out, in, w * bpp, ((w * bpp + 7) / 8) * 8, h); - } - /*we can immediatly filter into the out buffer, no other steps needed*/ - else CERROR_TRY_RETURN(unfilter(out, in, w, h, bpp)); - } - else /*interlace_method is 1 (Adam7)*/ - { - unsigned passw[7], passh[7]; size_t filter_passstart[8], padded_passstart[8], passstart[8]; - unsigned i; + if (info_png->interlace_method == 0) + { + if (bpp < 8 && w * bpp != ((w * bpp + 7) / 8) * 8) + { + CERROR_TRY_RETURN(unfilter(in, in, w, h, bpp)); + removePaddingBits(out, in, w * bpp, ((w * bpp + 7) / 8) * 8, h); + } + /*we can immediatly filter into the out buffer, no other steps needed*/ + else + CERROR_TRY_RETURN(unfilter(out, in, w, h, bpp)); + } + else /*interlace_method is 1 (Adam7)*/ + { + unsigned passw[7], passh[7]; + size_t filter_passstart[8], padded_passstart[8], passstart[8]; + unsigned i; - Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); + Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); - for(i = 0; i < 7; i++) - { - CERROR_TRY_RETURN(unfilter(&in[padded_passstart[i]], &in[filter_passstart[i]], passw[i], passh[i], bpp)); - /*TODO: possible efficiency improvement: if in this reduced image the bits fit nicely in 1 scanline, - move bytes instead of bits or move not at all*/ - if(bpp < 8) - { - /*remove padding bits in scanlines; after this there still may be padding - bits between the different reduced images: each reduced image still starts nicely at a byte*/ - removePaddingBits(&in[passstart[i]], &in[padded_passstart[i]], passw[i] * bpp, - ((passw[i] * bpp + 7) / 8) * 8, passh[i]); - } - } + for (i = 0; i < 7; i++) + { + CERROR_TRY_RETURN(unfilter(&in[padded_passstart[i]], &in[filter_passstart[i]], passw[i], + passh[i], bpp)); + /*TODO: possible efficiency improvement: if in this reduced image the bits fit nicely in + 1 scanline, move bytes instead of bits or move not at all*/ + if (bpp < 8) + { + /*remove padding bits in scanlines; after this there still may be padding + bits between the different reduced images: each reduced image still starts nicely at + a byte*/ + removePaddingBits(&in[passstart[i]], &in[padded_passstart[i]], passw[i] * bpp, + ((passw[i] * bpp + 7) / 8) * 8, passh[i]); + } + } - Adam7_deinterlace(out, in, w, h, bpp); - } + Adam7_deinterlace(out, in, w, h, bpp); + } - return 0; + return 0; } -static unsigned readChunk_PLTE(LodePNGColorMode* color, const unsigned char* data, size_t chunkLength) +static unsigned readChunk_PLTE(LodePNGColorMode* color, const unsigned char* data, + size_t chunkLength) { - unsigned pos = 0, i; - free(color->palette); - color->palettesize = chunkLength / 3; - color->palette = (unsigned char*)malloc(4 * color->palettesize); - if(!color->palette && color->palettesize) - { - color->palettesize = 0; - return 83; /*alloc fail*/ - } - if(color->palettesize > 256) return 38; /*error: palette too big*/ + unsigned pos = 0, i; + free(color->palette); + color->palettesize = chunkLength / 3; + color->palette = (unsigned char*)malloc(4 * color->palettesize); + if (!color->palette && color->palettesize) + { + color->palettesize = 0; + return 83; /*alloc fail*/ + } + if (color->palettesize > 256) + return 38; /*error: palette too big*/ - for(i = 0; i < color->palettesize; i++) - { - color->palette[4 * i + 0] = data[pos++]; /*R*/ - color->palette[4 * i + 1] = data[pos++]; /*G*/ - color->palette[4 * i + 2] = data[pos++]; /*B*/ - color->palette[4 * i + 3] = 255; /*alpha*/ - } + for (i = 0; i < color->palettesize; i++) + { + color->palette[4 * i + 0] = data[pos++]; /*R*/ + color->palette[4 * i + 1] = data[pos++]; /*G*/ + color->palette[4 * i + 2] = data[pos++]; /*B*/ + color->palette[4 * i + 3] = 255; /*alpha*/ + } - return 0; /* OK */ + return 0; /* OK */ } -static unsigned readChunk_tRNS(LodePNGColorMode* color, const unsigned char* data, size_t chunkLength) +static unsigned readChunk_tRNS(LodePNGColorMode* color, const unsigned char* data, + size_t chunkLength) { - unsigned i; - if(color->colortype == LCT_PALETTE) - { - /*error: more alpha values given than there are palette entries*/ - if(chunkLength > color->palettesize) return 38; + unsigned i; + if (color->colortype == LCT_PALETTE) + { + /*error: more alpha values given than there are palette entries*/ + if (chunkLength > color->palettesize) + return 38; - for(i = 0; i < chunkLength; i++) color->palette[4 * i + 3] = data[i]; - } - else if(color->colortype == LCT_GREY) - { - /*error: this chunk must be 2 bytes for greyscale image*/ - if(chunkLength != 2) return 30; + for (i = 0; i < chunkLength; i++) + color->palette[4 * i + 3] = data[i]; + } + else if (color->colortype == LCT_GREY) + { + /*error: this chunk must be 2 bytes for greyscale image*/ + if (chunkLength != 2) + return 30; - color->key_defined = 1; - color->key_r = color->key_g = color->key_b = 256u * data[0] + data[1]; - } - else if(color->colortype == LCT_RGB) - { - /*error: this chunk must be 6 bytes for RGB image*/ - if(chunkLength != 6) return 41; + color->key_defined = 1; + color->key_r = color->key_g = color->key_b = 256u * data[0] + data[1]; + } + else if (color->colortype == LCT_RGB) + { + /*error: this chunk must be 6 bytes for RGB image*/ + if (chunkLength != 6) + return 41; - color->key_defined = 1; - color->key_r = 256u * data[0] + data[1]; - color->key_g = 256u * data[2] + data[3]; - color->key_b = 256u * data[4] + data[5]; - } - else return 42; /*error: tRNS chunk not allowed for other color models*/ + color->key_defined = 1; + color->key_r = 256u * data[0] + data[1]; + color->key_g = 256u * data[2] + data[3]; + color->key_b = 256u * data[4] + data[5]; + } + else + return 42; /*error: tRNS chunk not allowed for other color models*/ - return 0; /* OK */ + return 0; /* OK */ } - #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS /*background color chunk (bKGD)*/ static unsigned readChunk_bKGD(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) { - if(info->color.colortype == LCT_PALETTE) - { - /*error: this chunk must be 1 byte for indexed color image*/ - if(chunkLength != 1) return 43; + if (info->color.colortype == LCT_PALETTE) + { + /*error: this chunk must be 1 byte for indexed color image*/ + if (chunkLength != 1) + return 43; - info->background_defined = 1; - info->background_r = info->background_g = info->background_b = data[0]; - } - else if(info->color.colortype == LCT_GREY || info->color.colortype == LCT_GREY_ALPHA) - { - /*error: this chunk must be 2 bytes for greyscale image*/ - if(chunkLength != 2) return 44; + info->background_defined = 1; + info->background_r = info->background_g = info->background_b = data[0]; + } + else if (info->color.colortype == LCT_GREY || info->color.colortype == LCT_GREY_ALPHA) + { + /*error: this chunk must be 2 bytes for greyscale image*/ + if (chunkLength != 2) + return 44; - info->background_defined = 1; - info->background_r = info->background_g = info->background_b = 256u * data[0] + data[1]; - } - else if(info->color.colortype == LCT_RGB || info->color.colortype == LCT_RGBA) - { - /*error: this chunk must be 6 bytes for greyscale image*/ - if(chunkLength != 6) return 45; + info->background_defined = 1; + info->background_r = info->background_g = info->background_b = 256u * data[0] + data[1]; + } + else if (info->color.colortype == LCT_RGB || info->color.colortype == LCT_RGBA) + { + /*error: this chunk must be 6 bytes for greyscale image*/ + if (chunkLength != 6) + return 45; - info->background_defined = 1; - info->background_r = 256u * data[0] + data[1]; - info->background_g = 256u * data[2] + data[3]; - info->background_b = 256u * data[4] + data[5]; - } + info->background_defined = 1; + info->background_r = 256u * data[0] + data[1]; + info->background_g = 256u * data[2] + data[3]; + info->background_b = 256u * data[4] + data[5]; + } - return 0; /* OK */ + return 0; /* OK */ } /*text chunk (tEXt)*/ static unsigned readChunk_tEXt(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) { - unsigned error = 0; - char *key = 0, *str = 0; - unsigned i; + unsigned error = 0; + char *key = 0, *str = 0; + unsigned i; - while(!error) /*not really a while loop, only used to break on error*/ - { - unsigned length, string2_begin; + while (!error) /*not really a while loop, only used to break on error*/ + { + unsigned length, string2_begin; - length = 0; - while(length < chunkLength && data[length] != 0) length++; - /*even though it's not allowed by the standard, no error is thrown if - there's no null termination char, if the text is empty*/ - if(length < 1 || length > 79) CERROR_BREAK(error, 89); /*keyword too short or long*/ + length = 0; + while (length < chunkLength && data[length] != 0) + length++; + /*even though it's not allowed by the standard, no error is thrown if + there's no null termination char, if the text is empty*/ + if (length < 1 || length > 79) + CERROR_BREAK(error, 89); /*keyword too short or long*/ - key = (char*)malloc(length + 1); - if(!key) CERROR_BREAK(error, 83); /*alloc fail*/ + key = (char*)malloc(length + 1); + if (!key) + CERROR_BREAK(error, 83); /*alloc fail*/ - key[length] = 0; - for(i = 0; i < length; i++) key[i] = (char)data[i]; + key[length] = 0; + for (i = 0; i < length; i++) + key[i] = (char)data[i]; - string2_begin = length + 1; /*skip keyword null terminator*/ + string2_begin = length + 1; /*skip keyword null terminator*/ - length = chunkLength < string2_begin ? 0 : chunkLength - string2_begin; - str = (char*)malloc(length + 1); - if(!str) CERROR_BREAK(error, 83); /*alloc fail*/ + length = chunkLength < string2_begin ? 0 : chunkLength - string2_begin; + str = (char*)malloc(length + 1); + if (!str) + CERROR_BREAK(error, 83); /*alloc fail*/ - str[length] = 0; - for(i = 0; i < length; i++) str[i] = (char)data[string2_begin + i]; + str[length] = 0; + for (i = 0; i < length; i++) + str[i] = (char)data[string2_begin + i]; - error = lodepng_add_text(info, key, str); + error = lodepng_add_text(info, key, str); - break; - } + break; + } - free(key); - free(str); + free(key); + free(str); - return error; + return error; } /*compressed text chunk (zTXt)*/ static unsigned readChunk_zTXt(LodePNGInfo* info, const LodePNGDecompressSettings* zlibsettings, const unsigned char* data, size_t chunkLength) { - unsigned error = 0; - unsigned i; + unsigned error = 0; + unsigned i; - unsigned length, string2_begin; - char *key = 0; - ucvector decoded; + unsigned length, string2_begin; + char* key = 0; + ucvector decoded; - ucvector_init(&decoded); + ucvector_init(&decoded); - while(!error) /*not really a while loop, only used to break on error*/ - { - for(length = 0; length < chunkLength && data[length] != 0; length++) ; - if(length + 2 >= chunkLength) CERROR_BREAK(error, 75); /*no null termination, corrupt?*/ - if(length < 1 || length > 79) CERROR_BREAK(error, 89); /*keyword too short or long*/ + while (!error) /*not really a while loop, only used to break on error*/ + { + for (length = 0; length < chunkLength && data[length] != 0; length++) + ; + if (length + 2 >= chunkLength) + CERROR_BREAK(error, 75); /*no null termination, corrupt?*/ + if (length < 1 || length > 79) + CERROR_BREAK(error, 89); /*keyword too short or long*/ - key = (char*)malloc(length + 1); - if(!key) CERROR_BREAK(error, 83); /*alloc fail*/ + key = (char*)malloc(length + 1); + if (!key) + CERROR_BREAK(error, 83); /*alloc fail*/ - key[length] = 0; - for(i = 0; i < length; i++) key[i] = (char)data[i]; + key[length] = 0; + for (i = 0; i < length; i++) + key[i] = (char)data[i]; - if(data[length + 1] != 0) CERROR_BREAK(error, 72); /*the 0 byte indicating compression must be 0*/ + if (data[length + 1] != 0) + CERROR_BREAK(error, 72); /*the 0 byte indicating compression must be 0*/ - string2_begin = length + 2; - if(string2_begin > chunkLength) CERROR_BREAK(error, 75); /*no null termination, corrupt?*/ + string2_begin = length + 2; + if (string2_begin > chunkLength) + CERROR_BREAK(error, 75); /*no null termination, corrupt?*/ - length = chunkLength - string2_begin; - /*will fail if zlib error, e.g. if length is too small*/ - error = zlib_decompress(&decoded.data, &decoded.size, - (unsigned char*)(&data[string2_begin]), - length, zlibsettings); - if(error) break; - if (!ucvector_push_back(&decoded, 0)) ERROR_BREAK(83); + length = chunkLength - string2_begin; + /*will fail if zlib error, e.g. if length is too small*/ + error = zlib_decompress(&decoded.data, &decoded.size, + (unsigned char*)(&data[string2_begin]), length, zlibsettings); + if (error) + break; + if (!ucvector_push_back(&decoded, 0)) + ERROR_BREAK(83); - error = lodepng_add_text(info, key, (char*)decoded.data); + error = lodepng_add_text(info, key, (char*)decoded.data); - break; - } + break; + } - free(key); - ucvector_cleanup(&decoded); + free(key); + ucvector_cleanup(&decoded); - return error; + return error; } /*international text chunk (iTXt)*/ static unsigned readChunk_iTXt(LodePNGInfo* info, const LodePNGDecompressSettings* zlibsettings, const unsigned char* data, size_t chunkLength) { - unsigned error = 0; - unsigned i; + unsigned error = 0; + unsigned i; - unsigned length, begin, compressed; - char *key = 0, *langtag = 0, *transkey = 0; - ucvector decoded; - ucvector_init(&decoded); + unsigned length, begin, compressed; + char *key = 0, *langtag = 0, *transkey = 0; + ucvector decoded; + ucvector_init(&decoded); - while(!error) /*not really a while loop, only used to break on error*/ - { - /*Quick check if the chunk length isn't too small. Even without check - it'd still fail with other error checks below if it's too short. This just gives a different error code.*/ - if(chunkLength < 5) CERROR_BREAK(error, 30); /*iTXt chunk too short*/ + while (!error) /*not really a while loop, only used to break on error*/ + { + /*Quick check if the chunk length isn't too small. Even without check + it'd still fail with other error checks below if it's too short. This just gives a different + error code.*/ + if (chunkLength < 5) + CERROR_BREAK(error, 30); /*iTXt chunk too short*/ - /*read the key*/ - for(length = 0; length < chunkLength && data[length] != 0; length++) ; - if(length + 3 >= chunkLength) CERROR_BREAK(error, 75); /*no null termination char, corrupt?*/ - if(length < 1 || length > 79) CERROR_BREAK(error, 89); /*keyword too short or long*/ + /*read the key*/ + for (length = 0; length < chunkLength && data[length] != 0; length++) + ; + if (length + 3 >= chunkLength) + CERROR_BREAK(error, 75); /*no null termination char, corrupt?*/ + if (length < 1 || length > 79) + CERROR_BREAK(error, 89); /*keyword too short or long*/ - key = (char*)malloc(length + 1); - if(!key) CERROR_BREAK(error, 83); /*alloc fail*/ + key = (char*)malloc(length + 1); + if (!key) + CERROR_BREAK(error, 83); /*alloc fail*/ - key[length] = 0; - for(i = 0; i < length; i++) key[i] = (char)data[i]; + key[length] = 0; + for (i = 0; i < length; i++) + key[i] = (char)data[i]; - /*read the compression method*/ - compressed = data[length + 1]; - if(data[length + 2] != 0) CERROR_BREAK(error, 72); /*the 0 byte indicating compression must be 0*/ + /*read the compression method*/ + compressed = data[length + 1]; + if (data[length + 2] != 0) + CERROR_BREAK(error, 72); /*the 0 byte indicating compression must be 0*/ - /*even though it's not allowed by the standard, no error is thrown if - there's no null termination char, if the text is empty for the next 3 texts*/ + /*even though it's not allowed by the standard, no error is thrown if + there's no null termination char, if the text is empty for the next 3 texts*/ - /*read the langtag*/ - begin = length + 3; - length = 0; - for(i = begin; i < chunkLength && data[i] != 0; i++) length++; + /*read the langtag*/ + begin = length + 3; + length = 0; + for (i = begin; i < chunkLength && data[i] != 0; i++) + length++; - langtag = (char*)malloc(length + 1); - if(!langtag) CERROR_BREAK(error, 83); /*alloc fail*/ + langtag = (char*)malloc(length + 1); + if (!langtag) + CERROR_BREAK(error, 83); /*alloc fail*/ - langtag[length] = 0; - for(i = 0; i < length; i++) langtag[i] = (char)data[begin + i]; + langtag[length] = 0; + for (i = 0; i < length; i++) + langtag[i] = (char)data[begin + i]; - /*read the transkey*/ - begin += length + 1; - length = 0; - for(i = begin; i < chunkLength && data[i] != 0; i++) length++; + /*read the transkey*/ + begin += length + 1; + length = 0; + for (i = begin; i < chunkLength && data[i] != 0; i++) + length++; - transkey = (char*)malloc(length + 1); - if(!transkey) CERROR_BREAK(error, 83); /*alloc fail*/ + transkey = (char*)malloc(length + 1); + if (!transkey) + CERROR_BREAK(error, 83); /*alloc fail*/ - transkey[length] = 0; - for(i = 0; i < length; i++) transkey[i] = (char)data[begin + i]; + transkey[length] = 0; + for (i = 0; i < length; i++) + transkey[i] = (char)data[begin + i]; - /*read the actual text*/ - begin += length + 1; + /*read the actual text*/ + begin += length + 1; - length = chunkLength < begin ? 0 : chunkLength - begin; + length = chunkLength < begin ? 0 : chunkLength - begin; - if(compressed) - { - /*will fail if zlib error, e.g. if length is too small*/ - error = zlib_decompress(&decoded.data, &decoded.size, - (unsigned char*)(&data[begin]), - length, zlibsettings); - if(error) break; - if(decoded.allocsize < decoded.size) decoded.allocsize = decoded.size; - if (!ucvector_push_back(&decoded, 0)) CERROR_BREAK(error, 83 /*alloc fail*/); - } - else - { - if(!ucvector_resize(&decoded, length + 1)) CERROR_BREAK(error, 83 /*alloc fail*/); + if (compressed) + { + /*will fail if zlib error, e.g. if length is too small*/ + error = zlib_decompress(&decoded.data, &decoded.size, (unsigned char*)(&data[begin]), + length, zlibsettings); + if (error) + break; + if (decoded.allocsize < decoded.size) + decoded.allocsize = decoded.size; + if (!ucvector_push_back(&decoded, 0)) + CERROR_BREAK(error, 83 /*alloc fail*/); + } + else + { + if (!ucvector_resize(&decoded, length + 1)) + CERROR_BREAK(error, 83 /*alloc fail*/); - decoded.data[length] = 0; - for(i = 0; i < length; i++) decoded.data[i] = data[begin + i]; - } + decoded.data[length] = 0; + for (i = 0; i < length; i++) + decoded.data[i] = data[begin + i]; + } - error = lodepng_add_itext(info, key, langtag, transkey, (char*)decoded.data); + error = lodepng_add_itext(info, key, langtag, transkey, (char*)decoded.data); - break; - } + break; + } - free(key); - free(langtag); - free(transkey); - ucvector_cleanup(&decoded); + free(key); + free(langtag); + free(transkey); + ucvector_cleanup(&decoded); - return error; + return error; } static unsigned readChunk_tIME(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) { - if(chunkLength != 7) return 73; /*invalid tIME chunk size*/ + if (chunkLength != 7) + return 73; /*invalid tIME chunk size*/ - info->time_defined = 1; - info->time.year = 256u * data[0] + data[1]; - info->time.month = data[2]; - info->time.day = data[3]; - info->time.hour = data[4]; - info->time.minute = data[5]; - info->time.second = data[6]; + info->time_defined = 1; + info->time.year = 256u * data[0] + data[1]; + info->time.month = data[2]; + info->time.day = data[3]; + info->time.hour = data[4]; + info->time.minute = data[5]; + info->time.second = data[6]; - return 0; /* OK */ + return 0; /* OK */ } static unsigned readChunk_pHYs(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) { - if(chunkLength != 9) return 74; /*invalid pHYs chunk size*/ + if (chunkLength != 9) + return 74; /*invalid pHYs chunk size*/ - info->phys_defined = 1; - info->phys_x = 16777216u * data[0] + 65536u * data[1] + 256u * data[2] + data[3]; - info->phys_y = 16777216u * data[4] + 65536u * data[5] + 256u * data[6] + data[7]; - info->phys_unit = data[8]; + info->phys_defined = 1; + info->phys_x = 16777216u * data[0] + 65536u * data[1] + 256u * data[2] + data[3]; + info->phys_y = 16777216u * data[4] + 65536u * data[5] + 256u * data[6] + data[7]; + info->phys_unit = data[8]; - return 0; /* OK */ + return 0; /* OK */ } #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ /*read a PNG, the result will be in the same color type as the PNG (hence "generic")*/ -static void decodeGeneric(unsigned char** out, unsigned* w, unsigned* h, - LodePNGState* state, +static void decodeGeneric(unsigned char** out, unsigned* w, unsigned* h, LodePNGState* state, const unsigned char* in, size_t insize) { - unsigned char IEND = 0; - const unsigned char* chunk; - size_t i; - ucvector idat; /*the data from idat chunks*/ - ucvector scanlines; - size_t predict; + unsigned char IEND = 0; + const unsigned char* chunk; + size_t i; + ucvector idat; /*the data from idat chunks*/ + ucvector scanlines; + size_t predict; - /*for unknown chunk order*/ - unsigned unknown = 0; + /*for unknown chunk order*/ + unsigned unknown = 0; #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - unsigned critical_pos = 1; /*1 = after IHDR, 2 = after PLTE, 3 = after IDAT*/ -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + unsigned critical_pos = 1; /*1 = after IHDR, 2 = after PLTE, 3 = after IDAT*/ +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - /*provide some proper output values if error will happen*/ - *out = 0; + /*provide some proper output values if error will happen*/ + *out = 0; - state->error = lodepng_inspect(w, h, state, in, insize); /*reads header and resets other parameters in state->info_png*/ - if(state->error) return; + state->error = lodepng_inspect( + w, h, state, in, insize); /*reads header and resets other parameters in state->info_png*/ + if (state->error) + return; - ucvector_init(&idat); - chunk = &in[33]; /*first byte of the first chunk after the header*/ + ucvector_init(&idat); + chunk = &in[33]; /*first byte of the first chunk after the header*/ - /*loop through the chunks, ignoring unknown chunks and stopping at IEND chunk. - IDAT data is put at the start of the in buffer*/ - while(!IEND && !state->error) - { - unsigned chunkLength; - const unsigned char* data; /*the data in the chunk*/ + /*loop through the chunks, ignoring unknown chunks and stopping at IEND chunk. + IDAT data is put at the start of the in buffer*/ + while (!IEND && !state->error) + { + unsigned chunkLength; + const unsigned char* data; /*the data in the chunk*/ - /*error: size of the in buffer too small to contain next chunk*/ - if((size_t)((chunk - in) + 12) > insize || chunk < in) CERROR_BREAK(state->error, 30); + /*error: size of the in buffer too small to contain next chunk*/ + if ((size_t)((chunk - in) + 12) > insize || chunk < in) + CERROR_BREAK(state->error, 30); - /*length of the data of the chunk, excluding the length bytes, chunk type and CRC bytes*/ - chunkLength = lodepng_chunk_length(chunk); - /*error: chunk length larger than the max PNG chunk size*/ - if(chunkLength > 2147483647) CERROR_BREAK(state->error, 63); + /*length of the data of the chunk, excluding the length bytes, chunk type and CRC bytes*/ + chunkLength = lodepng_chunk_length(chunk); + /*error: chunk length larger than the max PNG chunk size*/ + if (chunkLength > 2147483647) + CERROR_BREAK(state->error, 63); - if((size_t)((chunk - in) + chunkLength + 12) > insize || (chunk + chunkLength + 12) < in) - { - CERROR_BREAK(state->error, 64); /*error: size of the in buffer too small to contain next chunk*/ - } + if ((size_t)((chunk - in) + chunkLength + 12) > insize || (chunk + chunkLength + 12) < in) + { + CERROR_BREAK(state->error, + 64); /*error: size of the in buffer too small to contain next chunk*/ + } - data = lodepng_chunk_data_const(chunk); + data = lodepng_chunk_data_const(chunk); - /*IDAT chunk, containing compressed image data*/ - if(lodepng_chunk_type_equals(chunk, "IDAT")) - { - size_t oldsize = idat.size; - if(!ucvector_resize(&idat, oldsize + chunkLength)) CERROR_BREAK(state->error, 83 /*alloc fail*/); - for(i = 0; i < chunkLength; i++) idat.data[oldsize + i] = data[i]; + /*IDAT chunk, containing compressed image data*/ + if (lodepng_chunk_type_equals(chunk, "IDAT")) + { + size_t oldsize = idat.size; + if (!ucvector_resize(&idat, oldsize + chunkLength)) + CERROR_BREAK(state->error, 83 /*alloc fail*/); + for (i = 0; i < chunkLength; i++) + idat.data[oldsize + i] = data[i]; #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - critical_pos = 3; + critical_pos = 3; #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - } - /*IEND chunk*/ - else if(lodepng_chunk_type_equals(chunk, "IEND")) - { - IEND = 1; - } - /*palette chunk (PLTE)*/ - else if(lodepng_chunk_type_equals(chunk, "PLTE")) - { - state->error = readChunk_PLTE(&state->info_png.color, data, chunkLength); - if(state->error) break; + } + /*IEND chunk*/ + else if (lodepng_chunk_type_equals(chunk, "IEND")) + { + IEND = 1; + } + /*palette chunk (PLTE)*/ + else if (lodepng_chunk_type_equals(chunk, "PLTE")) + { + state->error = readChunk_PLTE(&state->info_png.color, data, chunkLength); + if (state->error) + break; #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - critical_pos = 2; + critical_pos = 2; #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - } - /*palette transparency chunk (tRNS)*/ - else if(lodepng_chunk_type_equals(chunk, "tRNS")) - { - state->error = readChunk_tRNS(&state->info_png.color, data, chunkLength); - if(state->error) break; - } + } + /*palette transparency chunk (tRNS)*/ + else if (lodepng_chunk_type_equals(chunk, "tRNS")) + { + state->error = readChunk_tRNS(&state->info_png.color, data, chunkLength); + if (state->error) + break; + } #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - /*background color chunk (bKGD)*/ - else if(lodepng_chunk_type_equals(chunk, "bKGD")) - { - state->error = readChunk_bKGD(&state->info_png, data, chunkLength); - if(state->error) break; - } - /*text chunk (tEXt)*/ - else if(lodepng_chunk_type_equals(chunk, "tEXt")) - { - if(state->decoder.read_text_chunks) - { - state->error = readChunk_tEXt(&state->info_png, data, chunkLength); - if(state->error) break; - } - } - /*compressed text chunk (zTXt)*/ - else if(lodepng_chunk_type_equals(chunk, "zTXt")) - { - if(state->decoder.read_text_chunks) - { - state->error = readChunk_zTXt(&state->info_png, &state->decoder.zlibsettings, data, chunkLength); - if(state->error) break; - } - } - /*international text chunk (iTXt)*/ - else if(lodepng_chunk_type_equals(chunk, "iTXt")) - { - if(state->decoder.read_text_chunks) - { - state->error = readChunk_iTXt(&state->info_png, &state->decoder.zlibsettings, data, chunkLength); - if(state->error) break; - } - } - else if(lodepng_chunk_type_equals(chunk, "tIME")) - { - state->error = readChunk_tIME(&state->info_png, data, chunkLength); - if(state->error) break; - } - else if(lodepng_chunk_type_equals(chunk, "pHYs")) - { - state->error = readChunk_pHYs(&state->info_png, data, chunkLength); - if(state->error) break; - } -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - else /*it's not an implemented chunk type, so ignore it: skip over the data*/ - { - /*error: unknown critical chunk (5th bit of first byte of chunk type is 0)*/ - if(!lodepng_chunk_ancillary(chunk)) CERROR_BREAK(state->error, 69); + /*background color chunk (bKGD)*/ + else if (lodepng_chunk_type_equals(chunk, "bKGD")) + { + state->error = readChunk_bKGD(&state->info_png, data, chunkLength); + if (state->error) + break; + } + /*text chunk (tEXt)*/ + else if (lodepng_chunk_type_equals(chunk, "tEXt")) + { + if (state->decoder.read_text_chunks) + { + state->error = readChunk_tEXt(&state->info_png, data, chunkLength); + if (state->error) + break; + } + } + /*compressed text chunk (zTXt)*/ + else if (lodepng_chunk_type_equals(chunk, "zTXt")) + { + if (state->decoder.read_text_chunks) + { + state->error = readChunk_zTXt(&state->info_png, &state->decoder.zlibsettings, data, + chunkLength); + if (state->error) + break; + } + } + /*international text chunk (iTXt)*/ + else if (lodepng_chunk_type_equals(chunk, "iTXt")) + { + if (state->decoder.read_text_chunks) + { + state->error = readChunk_iTXt(&state->info_png, &state->decoder.zlibsettings, data, + chunkLength); + if (state->error) + break; + } + } + else if (lodepng_chunk_type_equals(chunk, "tIME")) + { + state->error = readChunk_tIME(&state->info_png, data, chunkLength); + if (state->error) + break; + } + else if (lodepng_chunk_type_equals(chunk, "pHYs")) + { + state->error = readChunk_pHYs(&state->info_png, data, chunkLength); + if (state->error) + break; + } +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + else /*it's not an implemented chunk type, so ignore it: skip over the data*/ + { + /*error: unknown critical chunk (5th bit of first byte of chunk type is 0)*/ + if (!lodepng_chunk_ancillary(chunk)) + CERROR_BREAK(state->error, 69); - unknown = 1; + unknown = 1; #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - if(state->decoder.remember_unknown_chunks) - { - state->error = lodepng_chunk_append(&state->info_png.unknown_chunks_data[critical_pos - 1], - &state->info_png.unknown_chunks_size[critical_pos - 1], chunk); - if(state->error) break; - } + if (state->decoder.remember_unknown_chunks) + { + state->error = lodepng_chunk_append( + &state->info_png.unknown_chunks_data[critical_pos - 1], + &state->info_png.unknown_chunks_size[critical_pos - 1], chunk); + if (state->error) + break; + } #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - } + } - if(!state->decoder.ignore_crc && !unknown) /*check CRC if wanted, only on known chunk types*/ - { - if(lodepng_chunk_check_crc(chunk)) CERROR_BREAK(state->error, 57); /*invalid CRC*/ - } + if (!state->decoder.ignore_crc && + !unknown) /*check CRC if wanted, only on known chunk types*/ + { + if (lodepng_chunk_check_crc(chunk)) + CERROR_BREAK(state->error, 57); /*invalid CRC*/ + } - if(!IEND) chunk = lodepng_chunk_next_const(chunk); - } + if (!IEND) + chunk = lodepng_chunk_next_const(chunk); + } - ucvector_init(&scanlines); - /*predict output size, to allocate exact size for output buffer to avoid more dynamic allocation. - The prediction is currently not correct for interlaced PNG images.*/ - predict = lodepng_get_raw_size_idat(*w, *h, &state->info_png.color) + *h; - if(!state->error && !ucvector_reserve(&scanlines, predict)) state->error = 83; /*alloc fail*/ - if(!state->error) - { - state->error = zlib_decompress(&scanlines.data, &scanlines.size, idat.data, - idat.size, &state->decoder.zlibsettings); - } - ucvector_cleanup(&idat); + ucvector_init(&scanlines); + /*predict output size, to allocate exact size for output buffer to avoid more dynamic + allocation. The prediction is currently not correct for interlaced PNG images.*/ + predict = lodepng_get_raw_size_idat(*w, *h, &state->info_png.color) + *h; + if (!state->error && !ucvector_reserve(&scanlines, predict)) + state->error = 83; /*alloc fail*/ + if (!state->error) + { + state->error = zlib_decompress(&scanlines.data, &scanlines.size, idat.data, idat.size, + &state->decoder.zlibsettings); + } + ucvector_cleanup(&idat); - if(!state->error) - { - ucvector outv; - ucvector_init(&outv); - if(!ucvector_resizev(&outv, - lodepng_get_raw_size(*w, *h, &state->info_png.color), 0)) state->error = 83; /*alloc fail*/ - if(!state->error) state->error = postProcessScanlines(outv.data, scanlines.data, *w, *h, &state->info_png); - *out = outv.data; - } - ucvector_cleanup(&scanlines); + if (!state->error) + { + ucvector outv; + ucvector_init(&outv); + if (!ucvector_resizev(&outv, lodepng_get_raw_size(*w, *h, &state->info_png.color), 0)) + state->error = 83; /*alloc fail*/ + if (!state->error) + state->error = + postProcessScanlines(outv.data, scanlines.data, *w, *h, &state->info_png); + *out = outv.data; + } + ucvector_cleanup(&scanlines); } -unsigned lodepng_decode(unsigned char** out, unsigned* w, unsigned* h, - LodePNGState* state, +unsigned lodepng_decode(unsigned char** out, unsigned* w, unsigned* h, LodePNGState* state, const unsigned char* in, size_t insize) { - *out = 0; - decodeGeneric(out, w, h, state, in, insize); - if(state->error) return state->error; - if(!state->decoder.color_convert || lodepng_color_mode_equal(&state->info_raw, &state->info_png.color)) - { - /*same color type, no copying or converting of data needed*/ - /*store the info_png color settings on the info_raw so that the info_raw still reflects what colortype - the raw image has to the end user*/ - if(!state->decoder.color_convert) - { - state->error = lodepng_color_mode_copy(&state->info_raw, &state->info_png.color); - if(state->error) return state->error; - } - } - else - { - /*color conversion needed; sort of copy of the data*/ - unsigned char* data = *out; - size_t outsize; + *out = 0; + decodeGeneric(out, w, h, state, in, insize); + if (state->error) + return state->error; + if (!state->decoder.color_convert || + lodepng_color_mode_equal(&state->info_raw, &state->info_png.color)) + { + /*same color type, no copying or converting of data needed*/ + /*store the info_png color settings on the info_raw so that the info_raw still reflects what + colortype the raw image has to the end user*/ + if (!state->decoder.color_convert) + { + state->error = lodepng_color_mode_copy(&state->info_raw, &state->info_png.color); + if (state->error) + return state->error; + } + } + else + { + /*color conversion needed; sort of copy of the data*/ + unsigned char* data = *out; + size_t outsize; - /*TODO: check if this works according to the statement in the documentation: "The converter can convert - from greyscale input color type, to 8-bit greyscale or greyscale with alpha"*/ - if(!(state->info_raw.colortype == LCT_RGB || state->info_raw.colortype == LCT_RGBA) - && !(state->info_raw.bitdepth == 8)) - { - return 56; /*unsupported color mode conversion*/ - } + /*TODO: check if this works according to the statement in the documentation: "The converter + can convert from greyscale input color type, to 8-bit greyscale or greyscale with alpha"*/ + if (!(state->info_raw.colortype == LCT_RGB || state->info_raw.colortype == LCT_RGBA) && + !(state->info_raw.bitdepth == 8)) + { + return 56; /*unsupported color mode conversion*/ + } - outsize = lodepng_get_raw_size(*w, *h, &state->info_raw); - *out = (unsigned char*)calloc(outsize, sizeof(unsigned char)); - if(!(*out)) - { - state->error = 83; /*alloc fail*/ - } - else state->error = lodepng_convert(*out, data, &state->info_raw, - &state->info_png.color, *w, *h); - free(data); - } - return state->error; + outsize = lodepng_get_raw_size(*w, *h, &state->info_raw); + *out = (unsigned char*)calloc(outsize, sizeof(unsigned char)); + if (!(*out)) + { + state->error = 83; /*alloc fail*/ + } + else + state->error = + lodepng_convert(*out, data, &state->info_raw, &state->info_png.color, *w, *h); + free(data); + } + return state->error; } -unsigned lodepng_decode_memory(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in, - size_t insize, LodePNGColorType colortype, unsigned bitdepth) +unsigned lodepng_decode_memory(unsigned char** out, unsigned* w, unsigned* h, + const unsigned char* in, size_t insize, LodePNGColorType colortype, + unsigned bitdepth) { - unsigned error; - LodePNGState state; - lodepng_state_init(&state); - state.info_raw.colortype = colortype; - state.info_raw.bitdepth = bitdepth; - error = lodepng_decode(out, w, h, &state, in, insize); - lodepng_state_cleanup(&state); - return error; + unsigned error; + LodePNGState state; + lodepng_state_init(&state); + state.info_raw.colortype = colortype; + state.info_raw.bitdepth = bitdepth; + error = lodepng_decode(out, w, h, &state, in, insize); + lodepng_state_cleanup(&state); + return error; } -unsigned lodepng_decode32(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in, size_t insize) +unsigned lodepng_decode32(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in, + size_t insize) { - return lodepng_decode_memory(out, w, h, in, insize, LCT_RGBA, 8); + return lodepng_decode_memory(out, w, h, in, insize, LCT_RGBA, 8); } -unsigned lodepng_decode24(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in, size_t insize) +unsigned lodepng_decode24(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in, + size_t insize) { - return lodepng_decode_memory(out, w, h, in, insize, LCT_RGB, 8); + return lodepng_decode_memory(out, w, h, in, insize, LCT_RGB, 8); } #ifdef LODEPNG_COMPILE_DISK unsigned lodepng_decode_file(unsigned char** out, unsigned* w, unsigned* h, const char* filename, LodePNGColorType colortype, unsigned bitdepth) { - unsigned char* buffer; - size_t buffersize; - unsigned error; - error = lodepng_load_file(&buffer, &buffersize, filename); - if(!error) error = lodepng_decode_memory(out, w, h, buffer, buffersize, colortype, bitdepth); - free(buffer); - return error; + unsigned char* buffer; + size_t buffersize; + unsigned error; + error = lodepng_load_file(&buffer, &buffersize, filename); + if (!error) + error = lodepng_decode_memory(out, w, h, buffer, buffersize, colortype, bitdepth); + free(buffer); + return error; } unsigned lodepng_decode32_file(unsigned char** out, unsigned* w, unsigned* h, const char* filename) { - return lodepng_decode_file(out, w, h, filename, LCT_RGBA, 8); + return lodepng_decode_file(out, w, h, filename, LCT_RGBA, 8); } unsigned lodepng_decode24_file(unsigned char** out, unsigned* w, unsigned* h, const char* filename) { - return lodepng_decode_file(out, w, h, filename, LCT_RGB, 8); + return lodepng_decode_file(out, w, h, filename, LCT_RGB, 8); } #endif /*LODEPNG_COMPILE_DISK*/ void lodepng_decoder_settings_init(LodePNGDecoderSettings* settings) { - settings->color_convert = 1; + settings->color_convert = 1; #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - settings->read_text_chunks = 1; - settings->remember_unknown_chunks = 0; + settings->read_text_chunks = 1; + settings->remember_unknown_chunks = 0; #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - settings->ignore_crc = 0; - lodepng_decompress_settings_init(&settings->zlibsettings); + settings->ignore_crc = 0; + lodepng_decompress_settings_init(&settings->zlibsettings); } #endif /*LODEPNG_COMPILE_DECODER*/ @@ -4743,30 +5250,34 @@ void lodepng_decoder_settings_init(LodePNGDecoderSettings* settings) void lodepng_state_init(LodePNGState* state) { #ifdef LODEPNG_COMPILE_DECODER - lodepng_decoder_settings_init(&state->decoder); + lodepng_decoder_settings_init(&state->decoder); #endif /*LODEPNG_COMPILE_DECODER*/ #ifdef LODEPNG_COMPILE_ENCODER - lodepng_encoder_settings_init(&state->encoder); + lodepng_encoder_settings_init(&state->encoder); #endif /*LODEPNG_COMPILE_ENCODER*/ - lodepng_color_mode_init(&state->info_raw); - lodepng_info_init(&state->info_png); - state->error = 1; + lodepng_color_mode_init(&state->info_raw); + lodepng_info_init(&state->info_png); + state->error = 1; } void lodepng_state_cleanup(LodePNGState* state) { - lodepng_color_mode_cleanup(&state->info_raw); - lodepng_info_cleanup(&state->info_png); + lodepng_color_mode_cleanup(&state->info_raw); + lodepng_info_cleanup(&state->info_png); } void lodepng_state_copy(LodePNGState* dest, const LodePNGState* source) { - lodepng_state_cleanup(dest); - *dest = *source; - lodepng_color_mode_init(&dest->info_raw); - lodepng_info_init(&dest->info_png); - dest->error = lodepng_color_mode_copy(&dest->info_raw, &source->info_raw); if(dest->error) return; - dest->error = lodepng_info_copy(&dest->info_png, &source->info_png); if(dest->error) return; + lodepng_state_cleanup(dest); + *dest = *source; + lodepng_color_mode_init(&dest->info_raw); + lodepng_info_init(&dest->info_png); + dest->error = lodepng_color_mode_copy(&dest->info_raw, &source->info_raw); + if (dest->error) + return; + dest->error = lodepng_info_copy(&dest->info_png, &source->info_png); + if (dest->error) + return; } #endif /* defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_ENCODER) */ @@ -4778,602 +5289,683 @@ void lodepng_state_copy(LodePNGState* dest, const LodePNGState* source) /* ////////////////////////////////////////////////////////////////////////// */ /*chunkName must be string of 4 characters*/ -static unsigned addChunk(ucvector* out, const char* chunkName, const unsigned char* data, size_t length) +static unsigned addChunk(ucvector* out, const char* chunkName, const unsigned char* data, + size_t length) { - CERROR_TRY_RETURN(lodepng_chunk_create(&out->data, &out->size, (unsigned)length, chunkName, data)); - out->allocsize = out->size; /*fix the allocsize again*/ - return 0; + CERROR_TRY_RETURN( + lodepng_chunk_create(&out->data, &out->size, (unsigned)length, chunkName, data)); + out->allocsize = out->size; /*fix the allocsize again*/ + return 0; } static unsigned writeSignature(ucvector* out) { - /*8 bytes PNG signature, aka the magic bytes*/ - if (!ucvector_push_back(out, 137)) return 83; - if (!ucvector_push_back(out, 80)) return 83; - if (!ucvector_push_back(out, 78)) return 83; - if (!ucvector_push_back(out, 71)) return 83; - if (!ucvector_push_back(out, 13)) return 83; - if (!ucvector_push_back(out, 10)) return 83; - if (!ucvector_push_back(out, 26)) return 83; - if (!ucvector_push_back(out, 10)) return 83; + /*8 bytes PNG signature, aka the magic bytes*/ + if (!ucvector_push_back(out, 137)) + return 83; + if (!ucvector_push_back(out, 80)) + return 83; + if (!ucvector_push_back(out, 78)) + return 83; + if (!ucvector_push_back(out, 71)) + return 83; + if (!ucvector_push_back(out, 13)) + return 83; + if (!ucvector_push_back(out, 10)) + return 83; + if (!ucvector_push_back(out, 26)) + return 83; + if (!ucvector_push_back(out, 10)) + return 83; - return 0; + return 0; } -static unsigned addChunk_IHDR(ucvector* out, unsigned w, unsigned h, - LodePNGColorType colortype, unsigned bitdepth, unsigned interlace_method) +static unsigned addChunk_IHDR(ucvector* out, unsigned w, unsigned h, LodePNGColorType colortype, + unsigned bitdepth, unsigned interlace_method) { - unsigned error = 0; - ucvector header; - ucvector_init(&header); + unsigned error = 0; + ucvector header; + ucvector_init(&header); - if (!lodepng_add32bitInt(&header, w)) /*width*/ - return 1; - if (!lodepng_add32bitInt(&header, h)) /*height*/ - return 1; - ucvector_push_back(&header, (unsigned char)bitdepth); /*bit depth*/ - ucvector_push_back(&header, (unsigned char)colortype); /*color type*/ - ucvector_push_back(&header, 0); /*compression method*/ - ucvector_push_back(&header, 0); /*filter method*/ - ucvector_push_back(&header, interlace_method); /*interlace method*/ + if (!lodepng_add32bitInt(&header, w)) /*width*/ + return 1; + if (!lodepng_add32bitInt(&header, h)) /*height*/ + return 1; + ucvector_push_back(&header, (unsigned char)bitdepth); /*bit depth*/ + ucvector_push_back(&header, (unsigned char)colortype); /*color type*/ + ucvector_push_back(&header, 0); /*compression method*/ + ucvector_push_back(&header, 0); /*filter method*/ + ucvector_push_back(&header, interlace_method); /*interlace method*/ - error = addChunk(out, "IHDR", header.data, header.size); - ucvector_cleanup(&header); + error = addChunk(out, "IHDR", header.data, header.size); + ucvector_cleanup(&header); - return error; + return error; } static unsigned addChunk_PLTE(ucvector* out, const LodePNGColorMode* info) { - unsigned error = 0; - size_t i; - ucvector PLTE; - ucvector_init(&PLTE); - for(i = 0; i < info->palettesize * 4; i++) - { - /*add all channels except alpha channel*/ - if(i % 4 != 3) ucvector_push_back(&PLTE, info->palette[i]); - } - error = addChunk(out, "PLTE", PLTE.data, PLTE.size); - ucvector_cleanup(&PLTE); + unsigned error = 0; + size_t i; + ucvector PLTE; + ucvector_init(&PLTE); + for (i = 0; i < info->palettesize * 4; i++) + { + /*add all channels except alpha channel*/ + if (i % 4 != 3) + ucvector_push_back(&PLTE, info->palette[i]); + } + error = addChunk(out, "PLTE", PLTE.data, PLTE.size); + ucvector_cleanup(&PLTE); - return error; + return error; } static unsigned addChunk_tRNS(ucvector* out, const LodePNGColorMode* info) { - unsigned error = 0; - size_t i; - ucvector tRNS; - ucvector_init(&tRNS); - if(info->colortype == LCT_PALETTE) - { - size_t amount = info->palettesize; - /*the tail of palette values that all have 255 as alpha, does not have to be encoded*/ - for(i = info->palettesize; i > 0; i--) - { - if(info->palette[4 * (i - 1) + 3] == 255) amount--; - else break; - } - /*add only alpha channel*/ - for(i = 0; i < amount; i++) ucvector_push_back(&tRNS, info->palette[4 * i + 3]); - } - else if(info->colortype == LCT_GREY) - { - if(info->key_defined) - { - ucvector_push_back(&tRNS, (unsigned char)(info->key_r / 256)); - ucvector_push_back(&tRNS, (unsigned char)(info->key_r % 256)); - } - } - else if(info->colortype == LCT_RGB) - { - if(info->key_defined) - { - ucvector_push_back(&tRNS, (unsigned char)(info->key_r / 256)); - ucvector_push_back(&tRNS, (unsigned char)(info->key_r % 256)); - ucvector_push_back(&tRNS, (unsigned char)(info->key_g / 256)); - ucvector_push_back(&tRNS, (unsigned char)(info->key_g % 256)); - ucvector_push_back(&tRNS, (unsigned char)(info->key_b / 256)); - ucvector_push_back(&tRNS, (unsigned char)(info->key_b % 256)); - } - } + unsigned error = 0; + size_t i; + ucvector tRNS; + ucvector_init(&tRNS); + if (info->colortype == LCT_PALETTE) + { + size_t amount = info->palettesize; + /*the tail of palette values that all have 255 as alpha, does not have to be encoded*/ + for (i = info->palettesize; i > 0; i--) + { + if (info->palette[4 * (i - 1) + 3] == 255) + amount--; + else + break; + } + /*add only alpha channel*/ + for (i = 0; i < amount; i++) + ucvector_push_back(&tRNS, info->palette[4 * i + 3]); + } + else if (info->colortype == LCT_GREY) + { + if (info->key_defined) + { + ucvector_push_back(&tRNS, (unsigned char)(info->key_r / 256)); + ucvector_push_back(&tRNS, (unsigned char)(info->key_r % 256)); + } + } + else if (info->colortype == LCT_RGB) + { + if (info->key_defined) + { + ucvector_push_back(&tRNS, (unsigned char)(info->key_r / 256)); + ucvector_push_back(&tRNS, (unsigned char)(info->key_r % 256)); + ucvector_push_back(&tRNS, (unsigned char)(info->key_g / 256)); + ucvector_push_back(&tRNS, (unsigned char)(info->key_g % 256)); + ucvector_push_back(&tRNS, (unsigned char)(info->key_b / 256)); + ucvector_push_back(&tRNS, (unsigned char)(info->key_b % 256)); + } + } - error = addChunk(out, "tRNS", tRNS.data, tRNS.size); - ucvector_cleanup(&tRNS); + error = addChunk(out, "tRNS", tRNS.data, tRNS.size); + ucvector_cleanup(&tRNS); - return error; + return error; } static unsigned addChunk_IDAT(ucvector* out, const unsigned char* data, size_t datasize, LodePNGCompressSettings* zlibsettings) { - ucvector zlibdata; - unsigned error = 0; + ucvector zlibdata; + unsigned error = 0; - /*compress with the Zlib compressor*/ - ucvector_init(&zlibdata); - error = zlib_compress(&zlibdata.data, &zlibdata.size, data, datasize, zlibsettings); - if(!error) error = addChunk(out, "IDAT", zlibdata.data, zlibdata.size); - ucvector_cleanup(&zlibdata); + /*compress with the Zlib compressor*/ + ucvector_init(&zlibdata); + error = zlib_compress(&zlibdata.data, &zlibdata.size, data, datasize, zlibsettings); + if (!error) + error = addChunk(out, "IDAT", zlibdata.data, zlibdata.size); + ucvector_cleanup(&zlibdata); - return error; + return error; } static unsigned addChunk_IEND(ucvector* out) { - unsigned error = 0; - error = addChunk(out, "IEND", 0, 0); - return error; + unsigned error = 0; + error = addChunk(out, "IEND", 0, 0); + return error; } #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS static unsigned addChunk_tEXt(ucvector* out, const char* keyword, const char* textstring) { - unsigned error = 0; - size_t i; - ucvector text; - ucvector_init(&text); - for(i = 0; keyword[i] != 0; i++) ucvector_push_back(&text, (unsigned char)keyword[i]); - if(i < 1 || i > 79) return 89; /*error: invalid keyword size*/ - ucvector_push_back(&text, 0); /*0 termination char*/ - for(i = 0; textstring[i] != 0; i++) ucvector_push_back(&text, (unsigned char)textstring[i]); - error = addChunk(out, "tEXt", text.data, text.size); - ucvector_cleanup(&text); + unsigned error = 0; + size_t i; + ucvector text; + ucvector_init(&text); + for (i = 0; keyword[i] != 0; i++) + ucvector_push_back(&text, (unsigned char)keyword[i]); + if (i < 1 || i > 79) + return 89; /*error: invalid keyword size*/ + ucvector_push_back(&text, 0); /*0 termination char*/ + for (i = 0; textstring[i] != 0; i++) + ucvector_push_back(&text, (unsigned char)textstring[i]); + error = addChunk(out, "tEXt", text.data, text.size); + ucvector_cleanup(&text); - return error; + return error; } static unsigned addChunk_zTXt(ucvector* out, const char* keyword, const char* textstring, LodePNGCompressSettings* zlibsettings) { - unsigned error = 0; - ucvector data, compressed; - size_t i, textsize = strlen(textstring); + unsigned error = 0; + ucvector data, compressed; + size_t i, textsize = strlen(textstring); - ucvector_init(&data); - ucvector_init(&compressed); - for(i = 0; keyword[i] != 0; i++) ucvector_push_back(&data, (unsigned char)keyword[i]); - if(i < 1 || i > 79) return 89; /*error: invalid keyword size*/ - ucvector_push_back(&data, 0); /*0 termination char*/ - ucvector_push_back(&data, 0); /*compression method: 0*/ + ucvector_init(&data); + ucvector_init(&compressed); + for (i = 0; keyword[i] != 0; i++) + ucvector_push_back(&data, (unsigned char)keyword[i]); + if (i < 1 || i > 79) + return 89; /*error: invalid keyword size*/ + ucvector_push_back(&data, 0); /*0 termination char*/ + ucvector_push_back(&data, 0); /*compression method: 0*/ - error = zlib_compress(&compressed.data, &compressed.size, - (unsigned char*)textstring, textsize, zlibsettings); - if(!error) - { - for(i = 0; i < compressed.size; i++) ucvector_push_back(&data, compressed.data[i]); - error = addChunk(out, "zTXt", data.data, data.size); - } + error = zlib_compress(&compressed.data, &compressed.size, (unsigned char*)textstring, textsize, + zlibsettings); + if (!error) + { + for (i = 0; i < compressed.size; i++) + ucvector_push_back(&data, compressed.data[i]); + error = addChunk(out, "zTXt", data.data, data.size); + } - ucvector_cleanup(&compressed); - ucvector_cleanup(&data); - return error; + ucvector_cleanup(&compressed); + ucvector_cleanup(&data); + return error; } -static unsigned addChunk_iTXt(ucvector* out, unsigned compressed, const char* keyword, const char* langtag, - const char* transkey, const char* textstring, LodePNGCompressSettings* zlibsettings) +static unsigned addChunk_iTXt(ucvector* out, unsigned compressed, const char* keyword, + const char* langtag, const char* transkey, const char* textstring, + LodePNGCompressSettings* zlibsettings) { - unsigned error = 0; - ucvector data; - size_t i, textsize = strlen(textstring); + unsigned error = 0; + ucvector data; + size_t i, textsize = strlen(textstring); - ucvector_init(&data); + ucvector_init(&data); - for(i = 0; keyword[i] != 0; i++) ucvector_push_back(&data, (unsigned char)keyword[i]); - if(i < 1 || i > 79) return 89; /*error: invalid keyword size*/ - ucvector_push_back(&data, 0); /*null termination char*/ - ucvector_push_back(&data, compressed ? 1 : 0); /*compression flag*/ - ucvector_push_back(&data, 0); /*compression method*/ - for(i = 0; langtag[i] != 0; i++) ucvector_push_back(&data, (unsigned char)langtag[i]); - ucvector_push_back(&data, 0); /*null termination char*/ - for(i = 0; transkey[i] != 0; i++) ucvector_push_back(&data, (unsigned char)transkey[i]); - ucvector_push_back(&data, 0); /*null termination char*/ + for (i = 0; keyword[i] != 0; i++) + ucvector_push_back(&data, (unsigned char)keyword[i]); + if (i < 1 || i > 79) + return 89; /*error: invalid keyword size*/ + ucvector_push_back(&data, 0); /*null termination char*/ + ucvector_push_back(&data, compressed ? 1 : 0); /*compression flag*/ + ucvector_push_back(&data, 0); /*compression method*/ + for (i = 0; langtag[i] != 0; i++) + ucvector_push_back(&data, (unsigned char)langtag[i]); + ucvector_push_back(&data, 0); /*null termination char*/ + for (i = 0; transkey[i] != 0; i++) + ucvector_push_back(&data, (unsigned char)transkey[i]); + ucvector_push_back(&data, 0); /*null termination char*/ - if(compressed) - { - ucvector compressed_data; - ucvector_init(&compressed_data); - error = zlib_compress(&compressed_data.data, &compressed_data.size, - (unsigned char*)textstring, textsize, zlibsettings); - if(!error) - { - for(i = 0; i < compressed_data.size; i++) ucvector_push_back(&data, compressed_data.data[i]); - } - ucvector_cleanup(&compressed_data); - } - else /*not compressed*/ - { - for(i = 0; textstring[i] != 0; i++) ucvector_push_back(&data, (unsigned char)textstring[i]); - } + if (compressed) + { + ucvector compressed_data; + ucvector_init(&compressed_data); + error = zlib_compress(&compressed_data.data, &compressed_data.size, + (unsigned char*)textstring, textsize, zlibsettings); + if (!error) + { + for (i = 0; i < compressed_data.size; i++) + ucvector_push_back(&data, compressed_data.data[i]); + } + ucvector_cleanup(&compressed_data); + } + else /*not compressed*/ + { + for (i = 0; textstring[i] != 0; i++) + ucvector_push_back(&data, (unsigned char)textstring[i]); + } - if(!error) error = addChunk(out, "iTXt", data.data, data.size); - ucvector_cleanup(&data); - return error; + if (!error) + error = addChunk(out, "iTXt", data.data, data.size); + ucvector_cleanup(&data); + return error; } static unsigned addChunk_bKGD(ucvector* out, const LodePNGInfo* info) { - unsigned error = 0; - ucvector bKGD; - ucvector_init(&bKGD); - if(info->color.colortype == LCT_GREY || info->color.colortype == LCT_GREY_ALPHA) - { - ucvector_push_back(&bKGD, (unsigned char)(info->background_r / 256)); - ucvector_push_back(&bKGD, (unsigned char)(info->background_r % 256)); - } - else if(info->color.colortype == LCT_RGB || info->color.colortype == LCT_RGBA) - { - ucvector_push_back(&bKGD, (unsigned char)(info->background_r / 256)); - ucvector_push_back(&bKGD, (unsigned char)(info->background_r % 256)); - ucvector_push_back(&bKGD, (unsigned char)(info->background_g / 256)); - ucvector_push_back(&bKGD, (unsigned char)(info->background_g % 256)); - ucvector_push_back(&bKGD, (unsigned char)(info->background_b / 256)); - ucvector_push_back(&bKGD, (unsigned char)(info->background_b % 256)); - } - else if(info->color.colortype == LCT_PALETTE) - { - ucvector_push_back(&bKGD, (unsigned char)(info->background_r % 256)); /*palette index*/ - } + unsigned error = 0; + ucvector bKGD; + ucvector_init(&bKGD); + if (info->color.colortype == LCT_GREY || info->color.colortype == LCT_GREY_ALPHA) + { + ucvector_push_back(&bKGD, (unsigned char)(info->background_r / 256)); + ucvector_push_back(&bKGD, (unsigned char)(info->background_r % 256)); + } + else if (info->color.colortype == LCT_RGB || info->color.colortype == LCT_RGBA) + { + ucvector_push_back(&bKGD, (unsigned char)(info->background_r / 256)); + ucvector_push_back(&bKGD, (unsigned char)(info->background_r % 256)); + ucvector_push_back(&bKGD, (unsigned char)(info->background_g / 256)); + ucvector_push_back(&bKGD, (unsigned char)(info->background_g % 256)); + ucvector_push_back(&bKGD, (unsigned char)(info->background_b / 256)); + ucvector_push_back(&bKGD, (unsigned char)(info->background_b % 256)); + } + else if (info->color.colortype == LCT_PALETTE) + { + ucvector_push_back(&bKGD, (unsigned char)(info->background_r % 256)); /*palette index*/ + } - error = addChunk(out, "bKGD", bKGD.data, bKGD.size); - ucvector_cleanup(&bKGD); + error = addChunk(out, "bKGD", bKGD.data, bKGD.size); + ucvector_cleanup(&bKGD); - return error; + return error; } static unsigned addChunk_tIME(ucvector* out, const LodePNGTime* time) { - unsigned error = 0; - unsigned char* data = (unsigned char*)malloc(7); - if(!data) return 83; /*alloc fail*/ - data[0] = (unsigned char)(time->year / 256); - data[1] = (unsigned char)(time->year % 256); - data[2] = (unsigned char)time->month; - data[3] = (unsigned char)time->day; - data[4] = (unsigned char)time->hour; - data[5] = (unsigned char)time->minute; - data[6] = (unsigned char)time->second; - error = addChunk(out, "tIME", data, 7); - free(data); - return error; + unsigned error = 0; + unsigned char* data = (unsigned char*)malloc(7); + if (!data) + return 83; /*alloc fail*/ + data[0] = (unsigned char)(time->year / 256); + data[1] = (unsigned char)(time->year % 256); + data[2] = (unsigned char)time->month; + data[3] = (unsigned char)time->day; + data[4] = (unsigned char)time->hour; + data[5] = (unsigned char)time->minute; + data[6] = (unsigned char)time->second; + error = addChunk(out, "tIME", data, 7); + free(data); + return error; } static unsigned addChunk_pHYs(ucvector* out, const LodePNGInfo* info) { - unsigned error = 0; - ucvector data; - ucvector_init(&data); + unsigned error = 0; + ucvector data; + ucvector_init(&data); - if (!lodepng_add32bitInt(&data, info->phys_x)) - return 1; - if (!lodepng_add32bitInt(&data, info->phys_y)) - return 1; - if (!ucvector_push_back(&data, info->phys_unit)) - return 1; + if (!lodepng_add32bitInt(&data, info->phys_x)) + return 1; + if (!lodepng_add32bitInt(&data, info->phys_y)) + return 1; + if (!ucvector_push_back(&data, info->phys_unit)) + return 1; - error = addChunk(out, "pHYs", data.data, data.size); - ucvector_cleanup(&data); + error = addChunk(out, "pHYs", data.data, data.size); + ucvector_cleanup(&data); - return error; + return error; } #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ -static void filterScanline(unsigned char* out, const unsigned char* scanline, const unsigned char* prevline, - size_t length, size_t bytewidth, unsigned char filterType) +static void filterScanline(unsigned char* out, const unsigned char* scanline, + const unsigned char* prevline, size_t length, size_t bytewidth, + unsigned char filterType) { - size_t i; - switch(filterType) - { - case 0: /*None*/ - for(i = 0; i < length; i++) out[i] = scanline[i]; - break; - case 1: /*Sub*/ - for(i = 0; i < bytewidth; i++) out[i] = scanline[i]; - for(i = bytewidth; i < length; i++) out[i] = scanline[i] - scanline[i - bytewidth]; - break; - case 2: /*Up*/ - if(prevline) - { - for(i = 0; i < length; i++) out[i] = scanline[i] - prevline[i]; - } - else - { - for(i = 0; i < length; i++) out[i] = scanline[i]; - } - break; - case 3: /*Average*/ - if(prevline) - { - for(i = 0; i < bytewidth; i++) out[i] = scanline[i] - prevline[i] / 2; - for(i = bytewidth; i < length; i++) out[i] = scanline[i] - ((scanline[i - bytewidth] + prevline[i]) / 2); - } - else - { - for(i = 0; i < bytewidth; i++) out[i] = scanline[i]; - for(i = bytewidth; i < length; i++) out[i] = scanline[i] - scanline[i - bytewidth] / 2; - } - break; - case 4: /*Paeth*/ - if(prevline) - { - /*paethPredictor(0, prevline[i], 0) is always prevline[i]*/ - for(i = 0; i < bytewidth; i++) out[i] = (scanline[i] - prevline[i]); - for(i = bytewidth; i < length; i++) - { - out[i] = (scanline[i] - paethPredictor(scanline[i - bytewidth], prevline[i], prevline[i - bytewidth])); - } - } - else - { - for(i = 0; i < bytewidth; i++) out[i] = scanline[i]; - /*paethPredictor(scanline[i - bytewidth], 0, 0) is always scanline[i - bytewidth]*/ - for(i = bytewidth; i < length; i++) out[i] = (scanline[i] - scanline[i - bytewidth]); - } - break; - default: return; /*unexisting filter type given*/ - } + size_t i; + switch (filterType) + { + case 0: /*None*/ + for (i = 0; i < length; i++) + out[i] = scanline[i]; + break; + case 1: /*Sub*/ + for (i = 0; i < bytewidth; i++) + out[i] = scanline[i]; + for (i = bytewidth; i < length; i++) + out[i] = scanline[i] - scanline[i - bytewidth]; + break; + case 2: /*Up*/ + if (prevline) + { + for (i = 0; i < length; i++) + out[i] = scanline[i] - prevline[i]; + } + else + { + for (i = 0; i < length; i++) + out[i] = scanline[i]; + } + break; + case 3: /*Average*/ + if (prevline) + { + for (i = 0; i < bytewidth; i++) + out[i] = scanline[i] - prevline[i] / 2; + for (i = bytewidth; i < length; i++) + out[i] = scanline[i] - ((scanline[i - bytewidth] + prevline[i]) / 2); + } + else + { + for (i = 0; i < bytewidth; i++) + out[i] = scanline[i]; + for (i = bytewidth; i < length; i++) + out[i] = scanline[i] - scanline[i - bytewidth] / 2; + } + break; + case 4: /*Paeth*/ + if (prevline) + { + /*paethPredictor(0, prevline[i], 0) is always prevline[i]*/ + for (i = 0; i < bytewidth; i++) + out[i] = (scanline[i] - prevline[i]); + for (i = bytewidth; i < length; i++) + { + out[i] = (scanline[i] - paethPredictor(scanline[i - bytewidth], prevline[i], + prevline[i - bytewidth])); + } + } + else + { + for (i = 0; i < bytewidth; i++) + out[i] = scanline[i]; + /*paethPredictor(scanline[i - bytewidth], 0, 0) is always scanline[i - bytewidth]*/ + for (i = bytewidth; i < length; i++) + out[i] = (scanline[i] - scanline[i - bytewidth]); + } + break; + default: + return; /*unexisting filter type given*/ + } } /* log2 approximation. A slight bit faster than std::log. */ static float flog2(float f) { - float result = 0; - while(f > 32) { result += 4; f /= 16; } - while(f > 2) { result++; f /= 2; } - return result + 1.442695f * (f * f * f / 3 - 3 * f * f / 2 + 3 * f - 1.83333f); + float result = 0; + while (f > 32) + { + result += 4; + f /= 16; + } + while (f > 2) + { + result++; + f /= 2; + } + return result + 1.442695f * (f * f * f / 3 - 3 * f * f / 2 + 3 * f - 1.83333f); } static unsigned filter(unsigned char* out, const unsigned char* in, unsigned w, unsigned h, const LodePNGColorMode* info, const LodePNGEncoderSettings* settings) { - /* - For PNG filter method 0 - out must be a buffer with as size: h + (w * h * bpp + 7) / 8, because there are - the scanlines with 1 extra byte per scanline - */ + /* + For PNG filter method 0 + out must be a buffer with as size: h + (w * h * bpp + 7) / 8, because there are + the scanlines with 1 extra byte per scanline + */ - unsigned bpp = lodepng_get_bpp(info); - /*the width of a scanline in bytes, not including the filter type*/ - size_t linebytes = (w * bpp + 7) / 8; - /*bytewidth is used for filtering, is 1 when bpp < 8, number of bytes per pixel otherwise*/ - size_t bytewidth = (bpp + 7) / 8; - const unsigned char* prevline = 0; - unsigned x, y; - unsigned error = 0; - LodePNGFilterStrategy strategy = settings->filter_strategy; + unsigned bpp = lodepng_get_bpp(info); + /*the width of a scanline in bytes, not including the filter type*/ + size_t linebytes = (w * bpp + 7) / 8; + /*bytewidth is used for filtering, is 1 when bpp < 8, number of bytes per pixel otherwise*/ + size_t bytewidth = (bpp + 7) / 8; + const unsigned char* prevline = 0; + unsigned x, y; + unsigned error = 0; + LodePNGFilterStrategy strategy = settings->filter_strategy; - /* - There is a heuristic called the minimum sum of absolute differences heuristic, suggested by the PNG standard: - * If the image type is Palette, or the bit depth is smaller than 8, then do not filter the image (i.e. - use fixed filtering, with the filter None). - * (The other case) If the image type is Grayscale or RGB (with or without Alpha), and the bit depth is - not smaller than 8, then use adaptive filtering heuristic as follows: independently for each row, apply - all five filters and select the filter that produces the smallest sum of absolute values per row. - This heuristic is used if filter strategy is LFS_MINSUM and filter_palette_zero is true. + /* + There is a heuristic called the minimum sum of absolute differences heuristic, suggested by the + PNG standard: + * If the image type is Palette, or the bit depth is smaller than 8, then do not filter the + image (i.e. use fixed filtering, with the filter None). + * (The other case) If the image type is Grayscale or RGB (with or without Alpha), and the bit + depth is not smaller than 8, then use adaptive filtering heuristic as follows: independently for + each row, apply all five filters and select the filter that produces the smallest sum of + absolute values per row. This heuristic is used if filter strategy is LFS_MINSUM and + filter_palette_zero is true. - If filter_palette_zero is true and filter_strategy is not LFS_MINSUM, the above heuristic is followed, - but for "the other case", whatever strategy filter_strategy is set to instead of the minimum sum - heuristic is used. - */ - if(settings->filter_palette_zero && - (info->colortype == LCT_PALETTE || info->bitdepth < 8)) strategy = LFS_ZERO; + If filter_palette_zero is true and filter_strategy is not LFS_MINSUM, the above heuristic is + followed, but for "the other case", whatever strategy filter_strategy is set to instead of the + minimum sum heuristic is used. + */ + if (settings->filter_palette_zero && (info->colortype == LCT_PALETTE || info->bitdepth < 8)) + strategy = LFS_ZERO; - if(bpp == 0) return 31; /*error: invalid color type*/ + if (bpp == 0) + return 31; /*error: invalid color type*/ - if(strategy == LFS_ZERO) - { - for(y = 0; y < h; y++) - { - size_t outindex = (1 + linebytes) * y; /*the extra filterbyte added to each row*/ - size_t inindex = linebytes * y; - out[outindex] = 0; /*filter type byte*/ - filterScanline(&out[outindex + 1], &in[inindex], prevline, linebytes, bytewidth, 0); - prevline = &in[inindex]; - } - } - else if(strategy == LFS_MINSUM) - { - /*adaptive filtering*/ - size_t sum[5]; - ucvector attempt[5]; /*five filtering attempts, one for each filter type*/ - size_t smallest = 0; - unsigned char type, i, bestType = 0; + if (strategy == LFS_ZERO) + { + for (y = 0; y < h; y++) + { + size_t outindex = (1 + linebytes) * y; /*the extra filterbyte added to each row*/ + size_t inindex = linebytes * y; + out[outindex] = 0; /*filter type byte*/ + filterScanline(&out[outindex + 1], &in[inindex], prevline, linebytes, bytewidth, 0); + prevline = &in[inindex]; + } + } + else if (strategy == LFS_MINSUM) + { + /*adaptive filtering*/ + size_t sum[5]; + ucvector attempt[5]; /*five filtering attempts, one for each filter type*/ + size_t smallest = 0; + unsigned char type, i, bestType = 0; - for(type = 0; type < 5; type++) - { - ucvector_init(&attempt[type]); - if(!ucvector_resize(&attempt[type], linebytes)) - { - for(i=0; ipredefined_filters[y]; - out[outindex] = type; /*filter type byte*/ - filterScanline(&out[outindex + 1], &in[inindex], prevline, linebytes, bytewidth, type); - prevline = &in[inindex]; - } - } - else if(strategy == LFS_BRUTE_FORCE) - { - /*brute force filter chooser. - deflate the scanline after every filter attempt to see which one deflates best. - This is very slow and gives only slightly smaller, sometimes even larger, result*/ - size_t size[5]; - ucvector attempt[5]; /*five filtering attempts, one for each filter type*/ - size_t smallest = 0; - unsigned type = 0, bestType = 0; - unsigned char* dummy; - LodePNGCompressSettings zlibsettings = settings->zlibsettings; - /*use fixed tree on the attempts so that the tree is not adapted to the filtertype on purpose, - to simulate the true case where the tree is the same for the whole image. Sometimes it gives - better result with dynamic tree anyway. Using the fixed tree sometimes gives worse, but in rare - cases better compression. It does make this a bit less slow, so it's worth doing this.*/ - zlibsettings.btype = 1; - /*a custom encoder likely doesn't read the btype setting and is optimized for complete PNG - images only, so disable it*/ - zlibsettings.custom_zlib = 0; - zlibsettings.custom_deflate = 0; - for(type = 0; type < 5; type++) - { - ucvector_init(&attempt[type]); - ucvector_resize(&attempt[type], linebytes); /*todo: give error if resize failed*/ - } - for(y = 0; y < h; y++) /*try the 5 filter types*/ - { - for(type = 0; type < 5; type++) - { - unsigned testsize = attempt[type].size; - /*if(testsize > 8) testsize /= 8;*/ /*it already works good enough by testing a part of the row*/ + for (type = 0; type < 5; type++) + ucvector_cleanup(&attempt[type]); + } + else if (strategy == LFS_PREDEFINED) + { + for (y = 0; y < h; y++) + { + size_t outindex = (1 + linebytes) * y; /*the extra filterbyte added to each row*/ + size_t inindex = linebytes * y; + unsigned char type = settings->predefined_filters[y]; + out[outindex] = type; /*filter type byte*/ + filterScanline(&out[outindex + 1], &in[inindex], prevline, linebytes, bytewidth, type); + prevline = &in[inindex]; + } + } + else if (strategy == LFS_BRUTE_FORCE) + { + /*brute force filter chooser. + deflate the scanline after every filter attempt to see which one deflates best. + This is very slow and gives only slightly smaller, sometimes even larger, result*/ + size_t size[5]; + ucvector attempt[5]; /*five filtering attempts, one for each filter type*/ + size_t smallest = 0; + unsigned type = 0, bestType = 0; + unsigned char* dummy; + LodePNGCompressSettings zlibsettings = settings->zlibsettings; + /*use fixed tree on the attempts so that the tree is not adapted to the filtertype on + purpose, to simulate the true case where the tree is the same for the whole image. Sometimes + it gives better result with dynamic tree anyway. Using the fixed tree sometimes gives worse, + but in rare + cases better compression. It does make this a bit less slow, so it's worth doing this.*/ + zlibsettings.btype = 1; + /*a custom encoder likely doesn't read the btype setting and is optimized for complete PNG + images only, so disable it*/ + zlibsettings.custom_zlib = 0; + zlibsettings.custom_deflate = 0; + for (type = 0; type < 5; type++) + { + ucvector_init(&attempt[type]); + ucvector_resize(&attempt[type], linebytes); /*todo: give error if resize failed*/ + } + for (y = 0; y < h; y++) /*try the 5 filter types*/ + { + for (type = 0; type < 5; type++) + { + unsigned testsize = attempt[type].size; + /*if(testsize > 8) testsize /= 8;*/ /*it already works good enough by testing a part + of the row*/ - filterScanline(attempt[type].data, &in[y * linebytes], prevline, linebytes, bytewidth, type); - size[type] = 0; - dummy = 0; - zlib_compress(&dummy, &size[type], attempt[type].data, testsize, &zlibsettings); - free(dummy); - /*check if this is smallest size (or if type == 0 it's the first case so always store the values)*/ - if(type == 0 || size[type] < smallest) - { - bestType = type; - smallest = size[type]; - } - } - prevline = &in[y * linebytes]; - out[y * (linebytes + 1)] = bestType; /*the first byte of a scanline will be the filter type*/ - for(x = 0; x < linebytes; x++) out[y * (linebytes + 1) + 1 + x] = attempt[bestType].data[x]; - } - for(type = 0; type < 5; type++) ucvector_cleanup(&attempt[type]); - } - else return 88; /* unknown filter strategy */ + filterScanline(attempt[type].data, &in[y * linebytes], prevline, linebytes, + bytewidth, type); + size[type] = 0; + dummy = 0; + zlib_compress(&dummy, &size[type], attempt[type].data, testsize, &zlibsettings); + free(dummy); + /*check if this is smallest size (or if type == 0 it's the first case so always + * store the values)*/ + if (type == 0 || size[type] < smallest) + { + bestType = type; + smallest = size[type]; + } + } + prevline = &in[y * linebytes]; + out[y * (linebytes + 1)] = + bestType; /*the first byte of a scanline will be the filter type*/ + for (x = 0; x < linebytes; x++) + out[y * (linebytes + 1) + 1 + x] = attempt[bestType].data[x]; + } + for (type = 0; type < 5; type++) + ucvector_cleanup(&attempt[type]); + } + else + return 88; /* unknown filter strategy */ - return error; + return error; } -static void addPaddingBits(unsigned char* out, const unsigned char* in, - size_t olinebits, size_t ilinebits, unsigned h) +static void addPaddingBits(unsigned char* out, const unsigned char* in, size_t olinebits, + size_t ilinebits, unsigned h) { - /*The opposite of the removePaddingBits function - olinebits must be >= ilinebits*/ - unsigned y; - size_t diff = olinebits - ilinebits; - size_t obp = 0, ibp = 0; /*bit pointers*/ - for(y = 0; y < h; y++) - { - size_t x; - for(x = 0; x < ilinebits; x++) - { - unsigned char bit = readBitFromReversedStream(&ibp, in); - setBitOfReversedStream(&obp, out, bit); - } - /*obp += diff; --> no, fill in some value in the padding bits too, to avoid - "Use of uninitialised value of size ###" warning from valgrind*/ - for(x = 0; x < diff; x++) setBitOfReversedStream(&obp, out, 0); - } + /*The opposite of the removePaddingBits function + olinebits must be >= ilinebits*/ + unsigned y; + size_t diff = olinebits - ilinebits; + size_t obp = 0, ibp = 0; /*bit pointers*/ + for (y = 0; y < h; y++) + { + size_t x; + for (x = 0; x < ilinebits; x++) + { + unsigned char bit = readBitFromReversedStream(&ibp, in); + setBitOfReversedStream(&obp, out, bit); + } + /*obp += diff; --> no, fill in some value in the padding bits too, to avoid + "Use of uninitialised value of size ###" warning from valgrind*/ + for (x = 0; x < diff; x++) + setBitOfReversedStream(&obp, out, 0); + } } /* @@ -5387,142 +5979,157 @@ in has the following size in bits: w * h * bpp. out is possibly bigger due to padding bits between reduced images NOTE: comments about padding bits are only relevant if bpp < 8 */ -static void Adam7_interlace(unsigned char* out, const unsigned char* in, unsigned w, unsigned h, unsigned bpp) +static void Adam7_interlace(unsigned char* out, const unsigned char* in, unsigned w, unsigned h, + unsigned bpp) { - unsigned passw[7], passh[7]; - size_t filter_passstart[8], padded_passstart[8], passstart[8]; - unsigned i; + unsigned passw[7], passh[7]; + size_t filter_passstart[8], padded_passstart[8], passstart[8]; + unsigned i; - Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); + Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); - if(bpp >= 8) - { - for(i = 0; i < 7; i++) - { - unsigned x, y, b; - size_t bytewidth = bpp / 8; - for(y = 0; y < passh[i]; y++) - for(x = 0; x < passw[i]; x++) - { - size_t pixelinstart = ((ADAM7_IY[i] + y * ADAM7_DY[i]) * w + ADAM7_IX[i] + x * ADAM7_DX[i]) * bytewidth; - size_t pixeloutstart = passstart[i] + (y * passw[i] + x) * bytewidth; - for(b = 0; b < bytewidth; b++) - { - out[pixeloutstart + b] = in[pixelinstart + b]; - } - } - } - } - else /*bpp < 8: Adam7 with pixels < 8 bit is a bit trickier: with bit pointers*/ - { - for(i = 0; i < 7; i++) - { - unsigned x, y, b; - unsigned ilinebits = bpp * passw[i]; - unsigned olinebits = bpp * w; - size_t obp, ibp; /*bit pointers (for out and in buffer)*/ - for(y = 0; y < passh[i]; y++) - for(x = 0; x < passw[i]; x++) - { - ibp = (ADAM7_IY[i] + y * ADAM7_DY[i]) * olinebits + (ADAM7_IX[i] + x * ADAM7_DX[i]) * bpp; - obp = (8 * passstart[i]) + (y * ilinebits + x * bpp); - for(b = 0; b < bpp; b++) - { - unsigned char bit = readBitFromReversedStream(&ibp, in); - setBitOfReversedStream(&obp, out, bit); - } - } - } - } + if (bpp >= 8) + { + for (i = 0; i < 7; i++) + { + unsigned x, y, b; + size_t bytewidth = bpp / 8; + for (y = 0; y < passh[i]; y++) + for (x = 0; x < passw[i]; x++) + { + size_t pixelinstart = + ((ADAM7_IY[i] + y * ADAM7_DY[i]) * w + ADAM7_IX[i] + x * ADAM7_DX[i]) * + bytewidth; + size_t pixeloutstart = passstart[i] + (y * passw[i] + x) * bytewidth; + for (b = 0; b < bytewidth; b++) + { + out[pixeloutstart + b] = in[pixelinstart + b]; + } + } + } + } + else /*bpp < 8: Adam7 with pixels < 8 bit is a bit trickier: with bit pointers*/ + { + for (i = 0; i < 7; i++) + { + unsigned x, y, b; + unsigned ilinebits = bpp * passw[i]; + unsigned olinebits = bpp * w; + size_t obp, ibp; /*bit pointers (for out and in buffer)*/ + for (y = 0; y < passh[i]; y++) + for (x = 0; x < passw[i]; x++) + { + ibp = (ADAM7_IY[i] + y * ADAM7_DY[i]) * olinebits + + (ADAM7_IX[i] + x * ADAM7_DX[i]) * bpp; + obp = (8 * passstart[i]) + (y * ilinebits + x * bpp); + for (b = 0; b < bpp; b++) + { + unsigned char bit = readBitFromReversedStream(&ibp, in); + setBitOfReversedStream(&obp, out, bit); + } + } + } + } } -/*out must be buffer big enough to contain uncompressed IDAT chunk data, and in must contain the full image. -return value is error**/ +/*out must be buffer big enough to contain uncompressed IDAT chunk data, and in must contain the +full image. return value is error**/ static unsigned preProcessScanlines(unsigned char** out, size_t* outsize, const unsigned char* in, - unsigned w, unsigned h, - const LodePNGInfo* info_png, const LodePNGEncoderSettings* settings) + unsigned w, unsigned h, const LodePNGInfo* info_png, + const LodePNGEncoderSettings* settings) { - /* - This function converts the pure 2D image with the PNG's colortype, into filtered-padded-interlaced data. Steps: - *) if no Adam7: 1) add padding bits (= posible extra bits per scanline if bpp < 8) 2) filter - *) if adam7: 1) Adam7_interlace 2) 7x add padding bits 3) 7x filter - */ - unsigned bpp = lodepng_get_bpp(&info_png->color); - unsigned error = 0; + /* + This function converts the pure 2D image with the PNG's colortype, into + filtered-padded-interlaced data. Steps: + *) if no Adam7: 1) add padding bits (= posible extra bits per scanline if bpp < 8) 2) filter + *) if adam7: 1) Adam7_interlace 2) 7x add padding bits 3) 7x filter + */ + unsigned bpp = lodepng_get_bpp(&info_png->color); + unsigned error = 0; - if(info_png->interlace_method == 0) - { - *outsize = h + (h * ((w * bpp + 7) / 8)); /*image size plus an extra byte per scanline + possible padding bits*/ - *out = (unsigned char*)calloc(*outsize, 1); - if(!(*out) && (*outsize)) error = 83; /*alloc fail*/ + if (info_png->interlace_method == 0) + { + *outsize = + h + (h * ((w * bpp + 7) / + 8)); /*image size plus an extra byte per scanline + possible padding bits*/ + *out = (unsigned char*)calloc(*outsize, 1); + if (!(*out) && (*outsize)) + error = 83; /*alloc fail*/ - if(!error) - { - /*non multiple of 8 bits per scanline, padding bits needed per scanline*/ - if(bpp < 8 && w * bpp != ((w * bpp + 7) / 8) * 8) - { - unsigned char* padded = (unsigned char*)calloc(h * ((w * bpp + 7) / 8), 1); - if(!padded) error = 83; /*alloc fail*/ - if(!error) - { - addPaddingBits(padded, in, ((w * bpp + 7) / 8) * 8, w * bpp, h); - error = filter(*out, padded, w, h, &info_png->color, settings); - } - free(padded); - } - else - { - /*we can immediatly filter into the out buffer, no other steps needed*/ - error = filter(*out, in, w, h, &info_png->color, settings); - } - } - } - else /*interlace_method is 1 (Adam7)*/ - { - unsigned passw[7], passh[7]; - size_t filter_passstart[8], padded_passstart[8], passstart[8]; - unsigned char* adam7; + if (!error) + { + /*non multiple of 8 bits per scanline, padding bits needed per scanline*/ + if (bpp < 8 && w * bpp != ((w * bpp + 7) / 8) * 8) + { + unsigned char* padded = (unsigned char*)calloc(h * ((w * bpp + 7) / 8), 1); + if (!padded) + error = 83; /*alloc fail*/ + if (!error) + { + addPaddingBits(padded, in, ((w * bpp + 7) / 8) * 8, w * bpp, h); + error = filter(*out, padded, w, h, &info_png->color, settings); + } + free(padded); + } + else + { + /*we can immediatly filter into the out buffer, no other steps needed*/ + error = filter(*out, in, w, h, &info_png->color, settings); + } + } + } + else /*interlace_method is 1 (Adam7)*/ + { + unsigned passw[7], passh[7]; + size_t filter_passstart[8], padded_passstart[8], passstart[8]; + unsigned char* adam7; - Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); + Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); - *outsize = filter_passstart[7]; /*image size plus an extra byte per scanline + possible padding bits*/ - *out = (unsigned char*)calloc(*outsize, 1); - if(!(*out)) error = 83; /*alloc fail*/ + *outsize = filter_passstart[7]; /*image size plus an extra byte per scanline + possible + padding bits*/ + *out = (unsigned char*)calloc(*outsize, 1); + if (!(*out)) + error = 83; /*alloc fail*/ - adam7 = (unsigned char*)calloc(passstart[7], sizeof(unsigned char)); - if(!adam7 && passstart[7]) error = 83; /*alloc fail*/ + adam7 = (unsigned char*)calloc(passstart[7], sizeof(unsigned char)); + if (!adam7 && passstart[7]) + error = 83; /*alloc fail*/ - if(!error) - { - unsigned i; + if (!error) + { + unsigned i; - Adam7_interlace(adam7, in, w, h, bpp); - for(i = 0; i < 7; i++) - { - if(bpp < 8) - { - unsigned char* padded = (unsigned char*)calloc(padded_passstart[i + 1] - padded_passstart[i], sizeof(unsigned char)); - if(!padded) ERROR_BREAK(83); /*alloc fail*/ - addPaddingBits(padded, &adam7[passstart[i]], - ((passw[i] * bpp + 7) / 8) * 8, passw[i] * bpp, passh[i]); - error = filter(&(*out)[filter_passstart[i]], padded, - passw[i], passh[i], &info_png->color, settings); - free(padded); - } - else - { - error = filter(&(*out)[filter_passstart[i]], &adam7[padded_passstart[i]], - passw[i], passh[i], &info_png->color, settings); - } + Adam7_interlace(adam7, in, w, h, bpp); + for (i = 0; i < 7; i++) + { + if (bpp < 8) + { + unsigned char* padded = (unsigned char*)calloc( + padded_passstart[i + 1] - padded_passstart[i], sizeof(unsigned char)); + if (!padded) + ERROR_BREAK(83); /*alloc fail*/ + addPaddingBits(padded, &adam7[passstart[i]], ((passw[i] * bpp + 7) / 8) * 8, + passw[i] * bpp, passh[i]); + error = filter(&(*out)[filter_passstart[i]], padded, passw[i], passh[i], + &info_png->color, settings); + free(padded); + } + else + { + error = filter(&(*out)[filter_passstart[i]], &adam7[padded_passstart[i]], + passw[i], passh[i], &info_png->color, settings); + } - if(error) break; - } - } + if (error) + break; + } + } - free(adam7); - } + free(adam7); + } - return error; + return error; } /* @@ -5533,297 +6140,328 @@ returns 2 if the palette is semi-translucent. */ static unsigned getPaletteTranslucency(const unsigned char* palette, size_t palettesize) { - size_t i; - unsigned key = 0; - unsigned r = 0, g = 0, b = 0; /*the value of the color with alpha 0, so long as color keying is possible*/ - for(i = 0; i < palettesize; i++) - { - if(!key && palette[4 * i + 3] == 0) - { - r = palette[4 * i + 0]; g = palette[4 * i + 1]; b = palette[4 * i + 2]; - key = 1; - i = (size_t)(-1); /*restart from beginning, to detect earlier opaque colors with key's value*/ - } - else if(palette[4 * i + 3] != 255) return 2; - /*when key, no opaque RGB may have key's RGB*/ - else if(key && r == palette[i * 4 + 0] && g == palette[i * 4 + 1] && b == palette[i * 4 + 2]) return 2; - } - return key; + size_t i; + unsigned key = 0; + unsigned r = 0, g = 0, + b = 0; /*the value of the color with alpha 0, so long as color keying is possible*/ + for (i = 0; i < palettesize; i++) + { + if (!key && palette[4 * i + 3] == 0) + { + r = palette[4 * i + 0]; + g = palette[4 * i + 1]; + b = palette[4 * i + 2]; + key = 1; + i = (size_t)( + -1); /*restart from beginning, to detect earlier opaque colors with key's value*/ + } + else if (palette[4 * i + 3] != 255) + return 2; + /*when key, no opaque RGB may have key's RGB*/ + else if (key && r == palette[i * 4 + 0] && g == palette[i * 4 + 1] && + b == palette[i * 4 + 2]) + return 2; + } + return key; } #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS static unsigned addUnknownChunks(ucvector* out, unsigned char* data, size_t datasize) { - unsigned char* inchunk = data; - while((size_t)(inchunk - data) < datasize) - { - CERROR_TRY_RETURN(lodepng_chunk_append(&out->data, &out->size, inchunk)); - out->allocsize = out->size; /*fix the allocsize again*/ - inchunk = lodepng_chunk_next(inchunk); - } - return 0; + unsigned char* inchunk = data; + while ((size_t)(inchunk - data) < datasize) + { + CERROR_TRY_RETURN(lodepng_chunk_append(&out->data, &out->size, inchunk)); + out->allocsize = out->size; /*fix the allocsize again*/ + inchunk = lodepng_chunk_next(inchunk); + } + return 0; } #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ -unsigned lodepng_encode(unsigned char** out, size_t* outsize, - const unsigned char* image, unsigned w, unsigned h, - LodePNGState* state) +unsigned lodepng_encode(unsigned char** out, size_t* outsize, const unsigned char* image, + unsigned w, unsigned h, LodePNGState* state) { - LodePNGInfo info; - ucvector outv; - unsigned char* data = 0; /*uncompressed version of the IDAT chunk data*/ - size_t datasize = 0; + LodePNGInfo info; + ucvector outv; + unsigned char* data = 0; /*uncompressed version of the IDAT chunk data*/ + size_t datasize = 0; - /*provide some proper output values if error will happen*/ - *out = 0; - *outsize = 0; - state->error = 0; + /*provide some proper output values if error will happen*/ + *out = 0; + *outsize = 0; + state->error = 0; - lodepng_info_init(&info); - lodepng_info_copy(&info, &state->info_png); + lodepng_info_init(&info); + lodepng_info_copy(&info, &state->info_png); - if((info.color.colortype == LCT_PALETTE || state->encoder.force_palette) - && (info.color.palettesize == 0 || info.color.palettesize > 256)) - { - state->error = 68; /*invalid palette size, it is only allowed to be 1-256*/ - goto fail; - } + if ((info.color.colortype == LCT_PALETTE || state->encoder.force_palette) && + (info.color.palettesize == 0 || info.color.palettesize > 256)) + { + state->error = 68; /*invalid palette size, it is only allowed to be 1-256*/ + goto fail; + } - if(state->encoder.auto_convert) - { - state->error = lodepng_auto_choose_color(&info.color, image, w, h, &state->info_raw); - } - if(state->error) - goto fail; + if (state->encoder.auto_convert) + { + state->error = lodepng_auto_choose_color(&info.color, image, w, h, &state->info_raw); + } + if (state->error) + goto fail; - if(state->encoder.zlibsettings.btype > 2) - { - state->error = 61; /*error: unexisting btype*/ - goto fail; - } - if(state->info_png.interlace_method > 1) - { - state->error = 71; /*error: unexisting interlace mode*/ - goto fail; - } + if (state->encoder.zlibsettings.btype > 2) + { + state->error = 61; /*error: unexisting btype*/ + goto fail; + } + if (state->info_png.interlace_method > 1) + { + state->error = 71; /*error: unexisting interlace mode*/ + goto fail; + } - state->error = checkColorValidity(info.color.colortype, info.color.bitdepth); - if(state->error) - goto fail; /*error: unexisting color type given*/ - state->error = checkColorValidity(state->info_raw.colortype, state->info_raw.bitdepth); - if(state->error) - goto fail; /*error: unexisting color type given*/ + state->error = checkColorValidity(info.color.colortype, info.color.bitdepth); + if (state->error) + goto fail; /*error: unexisting color type given*/ + state->error = checkColorValidity(state->info_raw.colortype, state->info_raw.bitdepth); + if (state->error) + goto fail; /*error: unexisting color type given*/ - if(!lodepng_color_mode_equal(&state->info_raw, &info.color)) - { - unsigned char* converted; - size_t size = (w * h * lodepng_get_bpp(&info.color) + 7) / 8; + if (!lodepng_color_mode_equal(&state->info_raw, &info.color)) + { + unsigned char* converted; + size_t size = (w * h * lodepng_get_bpp(&info.color) + 7) / 8; - converted = (unsigned char*)calloc(size, 1); - if(!converted && size) state->error = 83; /*alloc fail*/ - if(!state->error) - { - state->error = lodepng_convert(converted, image, &info.color, &state->info_raw, w, h); - } - if(!state->error) preProcessScanlines(&data, &datasize, converted, w, h, &info, &state->encoder); - free(converted); - } - else preProcessScanlines(&data, &datasize, image, w, h, &info, &state->encoder); + converted = (unsigned char*)calloc(size, 1); + if (!converted && size) + state->error = 83; /*alloc fail*/ + if (!state->error) + { + state->error = lodepng_convert(converted, image, &info.color, &state->info_raw, w, h); + } + if (!state->error) + preProcessScanlines(&data, &datasize, converted, w, h, &info, &state->encoder); + free(converted); + } + else + preProcessScanlines(&data, &datasize, image, w, h, &info, &state->encoder); - ucvector_init(&outv); - while(!state->error) /*while only executed once, to break on error*/ - { + ucvector_init(&outv); + while (!state->error) /*while only executed once, to break on error*/ + { #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - size_t i; + size_t i; #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - /*write signature and chunks*/ - writeSignature(&outv); - /*IHDR*/ - addChunk_IHDR(&outv, w, h, info.color.colortype, info.color.bitdepth, info.interlace_method); + /*write signature and chunks*/ + writeSignature(&outv); + /*IHDR*/ + addChunk_IHDR(&outv, w, h, info.color.colortype, info.color.bitdepth, + info.interlace_method); #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - /*unknown chunks between IHDR and PLTE*/ - if(info.unknown_chunks_data[0]) - { - state->error = addUnknownChunks(&outv, info.unknown_chunks_data[0], info.unknown_chunks_size[0]); - if(state->error) break; - } + /*unknown chunks between IHDR and PLTE*/ + if (info.unknown_chunks_data[0]) + { + state->error = + addUnknownChunks(&outv, info.unknown_chunks_data[0], info.unknown_chunks_size[0]); + if (state->error) + break; + } #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - /*PLTE*/ - if(info.color.colortype == LCT_PALETTE) - { - addChunk_PLTE(&outv, &info.color); - } - if(state->encoder.force_palette && (info.color.colortype == LCT_RGB || info.color.colortype == LCT_RGBA)) - { - addChunk_PLTE(&outv, &info.color); - } - /*tRNS*/ - if(info.color.colortype == LCT_PALETTE && getPaletteTranslucency(info.color.palette, info.color.palettesize) != 0) - { - addChunk_tRNS(&outv, &info.color); - } - if((info.color.colortype == LCT_GREY || info.color.colortype == LCT_RGB) && info.color.key_defined) - { - addChunk_tRNS(&outv, &info.color); - } + /*PLTE*/ + if (info.color.colortype == LCT_PALETTE) + { + addChunk_PLTE(&outv, &info.color); + } + if (state->encoder.force_palette && + (info.color.colortype == LCT_RGB || info.color.colortype == LCT_RGBA)) + { + addChunk_PLTE(&outv, &info.color); + } + /*tRNS*/ + if (info.color.colortype == LCT_PALETTE && + getPaletteTranslucency(info.color.palette, info.color.palettesize) != 0) + { + addChunk_tRNS(&outv, &info.color); + } + if ((info.color.colortype == LCT_GREY || info.color.colortype == LCT_RGB) && + info.color.key_defined) + { + addChunk_tRNS(&outv, &info.color); + } #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - /*bKGD (must come between PLTE and the IDAt chunks*/ - if(info.background_defined) addChunk_bKGD(&outv, &info); - /*pHYs (must come before the IDAT chunks)*/ - if(info.phys_defined) addChunk_pHYs(&outv, &info); + /*bKGD (must come between PLTE and the IDAt chunks*/ + if (info.background_defined) + addChunk_bKGD(&outv, &info); + /*pHYs (must come before the IDAT chunks)*/ + if (info.phys_defined) + addChunk_pHYs(&outv, &info); - /*unknown chunks between PLTE and IDAT*/ - if(info.unknown_chunks_data[1]) - { - state->error = addUnknownChunks(&outv, info.unknown_chunks_data[1], info.unknown_chunks_size[1]); - if(state->error) break; - } + /*unknown chunks between PLTE and IDAT*/ + if (info.unknown_chunks_data[1]) + { + state->error = + addUnknownChunks(&outv, info.unknown_chunks_data[1], info.unknown_chunks_size[1]); + if (state->error) + break; + } #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - /*IDAT (multiple IDAT chunks must be consecutive)*/ - state->error = addChunk_IDAT(&outv, data, datasize, &state->encoder.zlibsettings); - if(state->error) break; + /*IDAT (multiple IDAT chunks must be consecutive)*/ + state->error = addChunk_IDAT(&outv, data, datasize, &state->encoder.zlibsettings); + if (state->error) + break; #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - /*tIME*/ - if(info.time_defined) addChunk_tIME(&outv, &info.time); - /*tEXt and/or zTXt*/ - for(i = 0; i < info.text_num; i++) - { - if(strlen(info.text_keys[i]) > 79) - { - state->error = 66; /*text chunk too large*/ - break; - } - if(strlen(info.text_keys[i]) < 1) - { - state->error = 67; /*text chunk too small*/ - break; - } - if(state->encoder.text_compression) - { - addChunk_zTXt(&outv, info.text_keys[i], info.text_strings[i], &state->encoder.zlibsettings); - } - else - { - addChunk_tEXt(&outv, info.text_keys[i], info.text_strings[i]); - } - } - /*LodePNG version id in text chunk*/ - if(state->encoder.add_id) - { - unsigned alread_added_id_text = 0; - for(i = 0; i < info.text_num; i++) - { - if(!strcmp(info.text_keys[i], "LodePNG")) - { - alread_added_id_text = 1; - break; - } - } - if(alread_added_id_text == 0) - { - addChunk_tEXt(&outv, "LodePNG", VERSION_STRING); /*it's shorter as tEXt than as zTXt chunk*/ - } - } - /*iTXt*/ - for(i = 0; i < info.itext_num; i++) - { - if(strlen(info.itext_keys[i]) > 79) - { - state->error = 66; /*text chunk too large*/ - break; - } - if(strlen(info.itext_keys[i]) < 1) - { - state->error = 67; /*text chunk too small*/ - break; - } - addChunk_iTXt(&outv, state->encoder.text_compression, - info.itext_keys[i], info.itext_langtags[i], info.itext_transkeys[i], info.itext_strings[i], - &state->encoder.zlibsettings); - } + /*tIME*/ + if (info.time_defined) + addChunk_tIME(&outv, &info.time); + /*tEXt and/or zTXt*/ + for (i = 0; i < info.text_num; i++) + { + if (strlen(info.text_keys[i]) > 79) + { + state->error = 66; /*text chunk too large*/ + break; + } + if (strlen(info.text_keys[i]) < 1) + { + state->error = 67; /*text chunk too small*/ + break; + } + if (state->encoder.text_compression) + { + addChunk_zTXt(&outv, info.text_keys[i], info.text_strings[i], + &state->encoder.zlibsettings); + } + else + { + addChunk_tEXt(&outv, info.text_keys[i], info.text_strings[i]); + } + } + /*LodePNG version id in text chunk*/ + if (state->encoder.add_id) + { + unsigned alread_added_id_text = 0; + for (i = 0; i < info.text_num; i++) + { + if (!strcmp(info.text_keys[i], "LodePNG")) + { + alread_added_id_text = 1; + break; + } + } + if (alread_added_id_text == 0) + { + addChunk_tEXt(&outv, "LodePNG", + VERSION_STRING); /*it's shorter as tEXt than as zTXt chunk*/ + } + } + /*iTXt*/ + for (i = 0; i < info.itext_num; i++) + { + if (strlen(info.itext_keys[i]) > 79) + { + state->error = 66; /*text chunk too large*/ + break; + } + if (strlen(info.itext_keys[i]) < 1) + { + state->error = 67; /*text chunk too small*/ + break; + } + addChunk_iTXt(&outv, state->encoder.text_compression, info.itext_keys[i], + info.itext_langtags[i], info.itext_transkeys[i], info.itext_strings[i], + &state->encoder.zlibsettings); + } - /*unknown chunks between IDAT and IEND*/ - if(info.unknown_chunks_data[2]) - { - state->error = addUnknownChunks(&outv, info.unknown_chunks_data[2], info.unknown_chunks_size[2]); - if(state->error) break; - } + /*unknown chunks between IDAT and IEND*/ + if (info.unknown_chunks_data[2]) + { + state->error = + addUnknownChunks(&outv, info.unknown_chunks_data[2], info.unknown_chunks_size[2]); + if (state->error) + break; + } #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - addChunk_IEND(&outv); + addChunk_IEND(&outv); - break; /*this isn't really a while loop; no error happened so break out now!*/ - } + break; /*this isn't really a while loop; no error happened so break out now!*/ + } - /*instead of cleaning the vector up, give it to the output*/ - *out = outv.data; - *outsize = outv.size; + /*instead of cleaning the vector up, give it to the output*/ + *out = outv.data; + *outsize = outv.size; - fail: - lodepng_info_cleanup(&info); - free(data); - return state->error; +fail: + lodepng_info_cleanup(&info); + free(data); + return state->error; } unsigned lodepng_encode_memory(unsigned char** out, size_t* outsize, const unsigned char* image, - unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth) + unsigned w, unsigned h, LodePNGColorType colortype, + unsigned bitdepth) { - unsigned error; - LodePNGState state; - lodepng_state_init(&state); - state.info_raw.colortype = colortype; - state.info_raw.bitdepth = bitdepth; - state.info_png.color.colortype = colortype; - state.info_png.color.bitdepth = bitdepth; - lodepng_encode(out, outsize, image, w, h, &state); - error = state.error; - lodepng_state_cleanup(&state); - return error; + unsigned error; + LodePNGState state; + lodepng_state_init(&state); + state.info_raw.colortype = colortype; + state.info_raw.bitdepth = bitdepth; + state.info_png.color.colortype = colortype; + state.info_png.color.bitdepth = bitdepth; + lodepng_encode(out, outsize, image, w, h, &state); + error = state.error; + lodepng_state_cleanup(&state); + return error; } -unsigned lodepng_encode32(unsigned char** out, size_t* outsize, const unsigned char* image, unsigned w, unsigned h) +unsigned lodepng_encode32(unsigned char** out, size_t* outsize, const unsigned char* image, + unsigned w, unsigned h) { - return lodepng_encode_memory(out, outsize, image, w, h, LCT_RGBA, 8); + return lodepng_encode_memory(out, outsize, image, w, h, LCT_RGBA, 8); } -unsigned lodepng_encode24(unsigned char** out, size_t* outsize, const unsigned char* image, unsigned w, unsigned h) +unsigned lodepng_encode24(unsigned char** out, size_t* outsize, const unsigned char* image, + unsigned w, unsigned h) { - return lodepng_encode_memory(out, outsize, image, w, h, LCT_RGB, 8); + return lodepng_encode_memory(out, outsize, image, w, h, LCT_RGB, 8); } #ifdef LODEPNG_COMPILE_DISK -unsigned lodepng_encode_file(const char* filename, const unsigned char* image, unsigned w, unsigned h, - LodePNGColorType colortype, unsigned bitdepth) +unsigned lodepng_encode_file(const char* filename, const unsigned char* image, unsigned w, + unsigned h, LodePNGColorType colortype, unsigned bitdepth) { - unsigned char* buffer = NULL; - size_t buffersize = 0; - unsigned error = lodepng_encode_memory(&buffer, &buffersize, image, w, h, colortype, bitdepth); - if(!error) error = lodepng_save_file(buffer, buffersize, filename); - free(buffer); - return error; + unsigned char* buffer = NULL; + size_t buffersize = 0; + unsigned error = lodepng_encode_memory(&buffer, &buffersize, image, w, h, colortype, bitdepth); + if (!error) + error = lodepng_save_file(buffer, buffersize, filename); + free(buffer); + return error; } -unsigned lodepng_encode32_file(const char* filename, const unsigned char* image, unsigned w, unsigned h) +unsigned lodepng_encode32_file(const char* filename, const unsigned char* image, unsigned w, + unsigned h) { - return lodepng_encode_file(filename, image, w, h, LCT_RGBA, 8); + return lodepng_encode_file(filename, image, w, h, LCT_RGBA, 8); } -unsigned lodepng_encode24_file(const char* filename, const unsigned char* image, unsigned w, unsigned h) +unsigned lodepng_encode24_file(const char* filename, const unsigned char* image, unsigned w, + unsigned h) { - return lodepng_encode_file(filename, image, w, h, LCT_RGB, 8); + return lodepng_encode_file(filename, image, w, h, LCT_RGB, 8); } #endif /*LODEPNG_COMPILE_DISK*/ void lodepng_encoder_settings_init(LodePNGEncoderSettings* settings) { - lodepng_compress_settings_init(&settings->zlibsettings); - settings->filter_palette_zero = 1; - settings->filter_strategy = LFS_MINSUM; - settings->auto_convert = 1; - settings->force_palette = 0; - settings->predefined_filters = 0; + lodepng_compress_settings_init(&settings->zlibsettings); + settings->filter_palette_zero = 1; + settings->filter_strategy = LFS_MINSUM; + settings->auto_convert = 1; + settings->force_palette = 0; + settings->predefined_filters = 0; #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - settings->add_id = 0; - settings->text_compression = 1; + settings->add_id = 0; + settings->text_compression = 1; #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ } @@ -5837,101 +6475,194 @@ the documentation of all the error codes. */ const char* lodepng_error_text(unsigned code) { - switch(code) - { - case 0: return "no error, everything went ok"; - case 1: return "nothing done yet"; /*the Encoder/Decoder has done nothing yet, error checking makes no sense yet*/ - case 10: return "end of input memory reached without huffman end code"; /*while huffman decoding*/ - case 11: return "error in code tree made it jump outside of huffman tree"; /*while huffman decoding*/ - case 13: return "problem while processing dynamic deflate block"; - case 14: return "problem while processing dynamic deflate block"; - case 15: return "problem while processing dynamic deflate block"; - case 16: return "unexisting code while processing dynamic deflate block"; - case 17: return "end of out buffer memory reached while inflating"; - case 18: return "invalid distance code while inflating"; - case 19: return "end of out buffer memory reached while inflating"; - case 20: return "invalid deflate block BTYPE encountered while decoding"; - case 21: return "NLEN is not ones complement of LEN in a deflate block"; - /*end of out buffer memory reached while inflating: - This can happen if the inflated deflate data is longer than the amount of bytes required to fill up - all the pixels of the image, given the color depth and image dimensions. Something that doesn't - happen in a normal, well encoded, PNG image.*/ - case 22: return "end of out buffer memory reached while inflating"; - case 23: return "end of in buffer memory reached while inflating"; - case 24: return "invalid FCHECK in zlib header"; - case 25: return "invalid compression method in zlib header"; - case 26: return "FDICT encountered in zlib header while it's not used for PNG"; - case 27: return "PNG file is smaller than a PNG header"; - /*Checks the magic file header, the first 8 bytes of the PNG file*/ - case 28: return "incorrect PNG signature, it's no PNG or corrupted"; - case 29: return "first chunk is not the header chunk"; - case 30: return "chunk length too large, chunk broken off at end of file"; - case 31: return "illegal PNG color type or bpp"; - case 32: return "illegal PNG compression method"; - case 33: return "illegal PNG filter method"; - case 34: return "illegal PNG interlace method"; - case 35: return "chunk length of a chunk is too large or the chunk too small"; - case 36: return "illegal PNG filter type encountered"; - case 37: return "illegal bit depth for this color type given"; - case 38: return "the palette is too big"; /*more than 256 colors*/ - case 39: return "more palette alpha values given in tRNS chunk than there are colors in the palette"; - case 40: return "tRNS chunk has wrong size for greyscale image"; - case 41: return "tRNS chunk has wrong size for RGB image"; - case 42: return "tRNS chunk appeared while it was not allowed for this color type"; - case 43: return "bKGD chunk has wrong size for palette image"; - case 44: return "bKGD chunk has wrong size for greyscale image"; - case 45: return "bKGD chunk has wrong size for RGB image"; - /*the input data is empty, maybe a PNG file doesn't exist or is in the wrong path*/ - case 48: return "empty input or file doesn't exist"; - case 49: return "jumped past memory while generating dynamic huffman tree"; - case 50: return "jumped past memory while generating dynamic huffman tree"; - case 51: return "jumped past memory while inflating huffman block"; - case 52: return "jumped past memory while inflating"; - case 53: return "size of zlib data too small"; - case 54: return "repeat symbol in tree while there was no value symbol yet"; - /*jumped past tree while generating huffman tree, this could be when the - tree will have more leaves than symbols after generating it out of the - given lenghts. They call this an oversubscribed dynamic bit lengths tree in zlib.*/ - case 55: return "jumped past tree while generating huffman tree"; - case 56: return "given output image colortype or bitdepth not supported for color conversion"; - case 57: return "invalid CRC encountered (checking CRC can be disabled)"; - case 58: return "invalid ADLER32 encountered (checking ADLER32 can be disabled)"; - case 59: return "requested color conversion not supported"; - case 60: return "invalid window size given in the settings of the encoder (must be 0-32768)"; - case 61: return "invalid BTYPE given in the settings of the encoder (only 0, 1 and 2 are allowed)"; - /*LodePNG leaves the choice of RGB to greyscale conversion formula to the user.*/ - case 62: return "conversion from color to greyscale not supported"; - case 63: return "length of a chunk too long, max allowed for PNG is 2147483647 bytes per chunk"; /*(2^31-1)*/ - /*this would result in the inability of a deflated block to ever contain an end code. It must be at least 1.*/ - case 64: return "the length of the END symbol 256 in the Huffman tree is 0"; - case 66: return "the length of a text chunk keyword given to the encoder is longer than the maximum of 79 bytes"; - case 67: return "the length of a text chunk keyword given to the encoder is smaller than the minimum of 1 byte"; - case 68: return "tried to encode a PLTE chunk with a palette that has less than 1 or more than 256 colors"; - case 69: return "unknown chunk type with 'critical' flag encountered by the decoder"; - case 71: return "unexisting interlace mode given to encoder (must be 0 or 1)"; - case 72: return "while decoding, unexisting compression method encountering in zTXt or iTXt chunk (it must be 0)"; - case 73: return "invalid tIME chunk size"; - case 74: return "invalid pHYs chunk size"; - /*length could be wrong, or data chopped off*/ - case 75: return "no null termination char found while decoding text chunk"; - case 76: return "iTXt chunk too short to contain required bytes"; - case 77: return "integer overflow in buffer size"; - case 78: return "failed to open file for reading"; /*file doesn't exist or couldn't be opened for reading*/ - case 79: return "failed to open file for writing"; - case 80: return "tried creating a tree of 0 symbols"; - case 81: return "lazy matching at pos 0 is impossible"; - case 82: return "color conversion to palette requested while a color isn't in palette"; - case 83: return "memory allocation failed"; - case 84: return "given image too small to contain all pixels to be encoded"; - case 86: return "impossible offset in lz77 encoding (internal bug)"; - case 87: return "must provide custom zlib function pointer if LODEPNG_COMPILE_ZLIB is not defined"; - case 88: return "invalid filter strategy given for LodePNGEncoderSettings.filter_strategy"; - case 89: return "text chunk keyword too short or long: must have size 1-79"; - /*the windowsize in the LodePNGCompressSettings. Requiring POT(==> & instead of %) makes encoding 12% faster.*/ - case 90: return "windowsize must be a power of two"; - case 91: return "fwrite failed"; - } - return "unknown error code"; + switch (code) + { + case 0: + return "no error, everything went ok"; + case 1: + return "nothing done yet"; /*the Encoder/Decoder has done nothing yet, error checking + makes no sense yet*/ + case 10: + return "end of input memory reached without huffman end code"; /*while huffman + decoding*/ + case 11: + return "error in code tree made it jump outside of huffman tree"; /*while huffman + decoding*/ + case 13: + return "problem while processing dynamic deflate block"; + case 14: + return "problem while processing dynamic deflate block"; + case 15: + return "problem while processing dynamic deflate block"; + case 16: + return "unexisting code while processing dynamic deflate block"; + case 17: + return "end of out buffer memory reached while inflating"; + case 18: + return "invalid distance code while inflating"; + case 19: + return "end of out buffer memory reached while inflating"; + case 20: + return "invalid deflate block BTYPE encountered while decoding"; + case 21: + return "NLEN is not ones complement of LEN in a deflate block"; + /*end of out buffer memory reached while inflating: + This can happen if the inflated deflate data is longer than the amount of bytes required + to fill up all the pixels of the image, given the color depth and image dimensions. + Something that doesn't happen in a normal, well encoded, PNG image.*/ + case 22: + return "end of out buffer memory reached while inflating"; + case 23: + return "end of in buffer memory reached while inflating"; + case 24: + return "invalid FCHECK in zlib header"; + case 25: + return "invalid compression method in zlib header"; + case 26: + return "FDICT encountered in zlib header while it's not used for PNG"; + case 27: + return "PNG file is smaller than a PNG header"; + /*Checks the magic file header, the first 8 bytes of the PNG file*/ + case 28: + return "incorrect PNG signature, it's no PNG or corrupted"; + case 29: + return "first chunk is not the header chunk"; + case 30: + return "chunk length too large, chunk broken off at end of file"; + case 31: + return "illegal PNG color type or bpp"; + case 32: + return "illegal PNG compression method"; + case 33: + return "illegal PNG filter method"; + case 34: + return "illegal PNG interlace method"; + case 35: + return "chunk length of a chunk is too large or the chunk too small"; + case 36: + return "illegal PNG filter type encountered"; + case 37: + return "illegal bit depth for this color type given"; + case 38: + return "the palette is too big"; /*more than 256 colors*/ + case 39: + return "more palette alpha values given in tRNS chunk than there are colors in the " + "palette"; + case 40: + return "tRNS chunk has wrong size for greyscale image"; + case 41: + return "tRNS chunk has wrong size for RGB image"; + case 42: + return "tRNS chunk appeared while it was not allowed for this color type"; + case 43: + return "bKGD chunk has wrong size for palette image"; + case 44: + return "bKGD chunk has wrong size for greyscale image"; + case 45: + return "bKGD chunk has wrong size for RGB image"; + /*the input data is empty, maybe a PNG file doesn't exist or is in the wrong path*/ + case 48: + return "empty input or file doesn't exist"; + case 49: + return "jumped past memory while generating dynamic huffman tree"; + case 50: + return "jumped past memory while generating dynamic huffman tree"; + case 51: + return "jumped past memory while inflating huffman block"; + case 52: + return "jumped past memory while inflating"; + case 53: + return "size of zlib data too small"; + case 54: + return "repeat symbol in tree while there was no value symbol yet"; + /*jumped past tree while generating huffman tree, this could be when the + tree will have more leaves than symbols after generating it out of the + given lenghts. They call this an oversubscribed dynamic bit lengths tree in zlib.*/ + case 55: + return "jumped past tree while generating huffman tree"; + case 56: + return "given output image colortype or bitdepth not supported for color conversion"; + case 57: + return "invalid CRC encountered (checking CRC can be disabled)"; + case 58: + return "invalid ADLER32 encountered (checking ADLER32 can be disabled)"; + case 59: + return "requested color conversion not supported"; + case 60: + return "invalid window size given in the settings of the encoder (must be 0-32768)"; + case 61: + return "invalid BTYPE given in the settings of the encoder (only 0, 1 and 2 are " + "allowed)"; + /*LodePNG leaves the choice of RGB to greyscale conversion formula to the user.*/ + case 62: + return "conversion from color to greyscale not supported"; + case 63: + return "length of a chunk too long, max allowed for PNG is 2147483647 bytes per chunk"; /*(2^31-1)*/ + /*this would result in the inability of a deflated block to ever contain an end code. It + * must be at least 1.*/ + case 64: + return "the length of the END symbol 256 in the Huffman tree is 0"; + case 66: + return "the length of a text chunk keyword given to the encoder is longer than the " + "maximum " + "of 79 bytes"; + case 67: + return "the length of a text chunk keyword given to the encoder is smaller than the " + "minimum of 1 byte"; + case 68: + return "tried to encode a PLTE chunk with a palette that has less than 1 or more than " + "256 " + "colors"; + case 69: + return "unknown chunk type with 'critical' flag encountered by the decoder"; + case 71: + return "unexisting interlace mode given to encoder (must be 0 or 1)"; + case 72: + return "while decoding, unexisting compression method encountering in zTXt or iTXt " + "chunk " + "(it must be 0)"; + case 73: + return "invalid tIME chunk size"; + case 74: + return "invalid pHYs chunk size"; + /*length could be wrong, or data chopped off*/ + case 75: + return "no null termination char found while decoding text chunk"; + case 76: + return "iTXt chunk too short to contain required bytes"; + case 77: + return "integer overflow in buffer size"; + case 78: + return "failed to open file for reading"; /*file doesn't exist or couldn't be opened for + reading*/ + case 79: + return "failed to open file for writing"; + case 80: + return "tried creating a tree of 0 symbols"; + case 81: + return "lazy matching at pos 0 is impossible"; + case 82: + return "color conversion to palette requested while a color isn't in palette"; + case 83: + return "memory allocation failed"; + case 84: + return "given image too small to contain all pixels to be encoded"; + case 86: + return "impossible offset in lz77 encoding (internal bug)"; + case 87: + return "must provide custom zlib function pointer if LODEPNG_COMPILE_ZLIB is not " + "defined"; + case 88: + return "invalid filter strategy given for LodePNGEncoderSettings.filter_strategy"; + case 89: + return "text chunk keyword too short or long: must have size 1-79"; + /*the windowsize in the LodePNGCompressSettings. Requiring POT(==> & instead of %) makes + * encoding 12% faster.*/ + case 90: + return "windowsize must be a power of two"; + case 91: + return "fwrite failed"; + } + return "unknown error code"; } #endif /*LODEPNG_COMPILE_ERROR_TEXT*/ - diff --git a/winpr/libwinpr/utils/lodepng/lodepng.h b/winpr/libwinpr/utils/lodepng/lodepng.h index 141eddf34..ef700aedc 100644 --- a/winpr/libwinpr/utils/lodepng/lodepng.h +++ b/winpr/libwinpr/utils/lodepng/lodepng.h @@ -74,11 +74,11 @@ the custom_zlib field of the compress and decompress settings*/ /*The PNG color types (also used for raw).*/ typedef enum LodePNGColorType { - LCT_GREY = 0, /*greyscale: 1,2,4,8,16 bit*/ - LCT_RGB = 2, /*RGB: 8,16 bit*/ - LCT_PALETTE = 3, /*palette: 1,2,4,8 bit*/ - LCT_GREY_ALPHA = 4, /*greyscale with alpha: 8,16 bit*/ - LCT_RGBA = 6 /*RGB with alpha: 8,16 bit*/ + LCT_GREY = 0, /*greyscale: 1,2,4,8,16 bit*/ + LCT_RGB = 2, /*RGB: 8,16 bit*/ + LCT_PALETTE = 3, /*palette: 1,2,4,8 bit*/ + LCT_GREY_ALPHA = 4, /*greyscale with alpha: 8,16 bit*/ + LCT_RGBA = 6 /*RGB with alpha: 8,16 bit*/ } LodePNGColorType; #ifdef LODEPNG_COMPILE_DECODER @@ -98,37 +98,33 @@ bitdepth: the desired bit depth for the raw output image. See explanation on PNG Return value: LodePNG error code (0 means no error). */ unsigned lodepng_decode_memory(unsigned char** out, unsigned* w, unsigned* h, - const unsigned char* in, size_t insize, - LodePNGColorType colortype, unsigned bitdepth); + const unsigned char* in, size_t insize, LodePNGColorType colortype, + unsigned bitdepth); /*Same as lodepng_decode_memory, but always decodes to 32-bit RGBA raw image*/ -unsigned lodepng_decode32(unsigned char** out, unsigned* w, unsigned* h, - const unsigned char* in, size_t insize); +unsigned lodepng_decode32(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in, + size_t insize); /*Same as lodepng_decode_memory, but always decodes to 24-bit RGB raw image*/ -unsigned lodepng_decode24(unsigned char** out, unsigned* w, unsigned* h, - const unsigned char* in, size_t insize); +unsigned lodepng_decode24(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in, + size_t insize); #ifdef LODEPNG_COMPILE_DISK /* Load PNG from disk, from file with given name. Same as the other decode functions, but instead takes a filename as input. */ -unsigned lodepng_decode_file(unsigned char** out, unsigned* w, unsigned* h, - const char* filename, +unsigned lodepng_decode_file(unsigned char** out, unsigned* w, unsigned* h, const char* filename, LodePNGColorType colortype, unsigned bitdepth); /*Same as lodepng_decode_file, but always decodes to 32-bit RGBA raw image.*/ -unsigned lodepng_decode32_file(unsigned char** out, unsigned* w, unsigned* h, - const char* filename); +unsigned lodepng_decode32_file(unsigned char** out, unsigned* w, unsigned* h, const char* filename); /*Same as lodepng_decode_file, but always decodes to 24-bit RGB raw image.*/ -unsigned lodepng_decode24_file(unsigned char** out, unsigned* w, unsigned* h, - const char* filename); +unsigned lodepng_decode24_file(unsigned char** out, unsigned* w, unsigned* h, const char* filename); #endif /*LODEPNG_COMPILE_DISK*/ #endif /*LODEPNG_COMPILE_DECODER*/ - #ifdef LODEPNG_COMPILE_ENCODER /* Converts raw pixel data into a PNG image in memory. The colortype and bitdepth @@ -146,17 +142,17 @@ colortype: the color type of the raw input image. See explanation on PNG color t bitdepth: the bit depth of the raw input image. See explanation on PNG color types. Return value: LodePNG error code (0 means no error). */ -unsigned lodepng_encode_memory(unsigned char** out, size_t* outsize, - const unsigned char* image, unsigned w, unsigned h, - LodePNGColorType colortype, unsigned bitdepth); +unsigned lodepng_encode_memory(unsigned char** out, size_t* outsize, const unsigned char* image, + unsigned w, unsigned h, LodePNGColorType colortype, + unsigned bitdepth); /*Same as lodepng_encode_memory, but always encodes from 32-bit RGBA raw image.*/ -unsigned lodepng_encode32(unsigned char** out, size_t* outsize, - const unsigned char* image, unsigned w, unsigned h); +unsigned lodepng_encode32(unsigned char** out, size_t* outsize, const unsigned char* image, + unsigned w, unsigned h); /*Same as lodepng_encode_memory, but always encodes from 24-bit RGB raw image.*/ -unsigned lodepng_encode24(unsigned char** out, size_t* outsize, - const unsigned char* image, unsigned w, unsigned h); +unsigned lodepng_encode24(unsigned char** out, size_t* outsize, const unsigned char* image, + unsigned w, unsigned h); #ifdef LODEPNG_COMPILE_DISK /* @@ -164,17 +160,16 @@ Converts raw pixel data into a PNG file on disk. Same as the other encode functions, but instead takes a filename as output. NOTE: This overwrites existing files without warning! */ -unsigned lodepng_encode_file(const char* filename, - const unsigned char* image, unsigned w, unsigned h, - LodePNGColorType colortype, unsigned bitdepth); +unsigned lodepng_encode_file(const char* filename, const unsigned char* image, unsigned w, + unsigned h, LodePNGColorType colortype, unsigned bitdepth); /*Same as lodepng_encode_file, but always encodes from 32-bit RGBA raw image.*/ -unsigned lodepng_encode32_file(const char* filename, - const unsigned char* image, unsigned w, unsigned h); +unsigned lodepng_encode32_file(const char* filename, const unsigned char* image, unsigned w, + unsigned h); /*Same as lodepng_encode_file, but always encodes from 24-bit RGB raw image.*/ -unsigned lodepng_encode24_file(const char* filename, - const unsigned char* image, unsigned w, unsigned h); +unsigned lodepng_encode24_file(const char* filename, const unsigned char* image, unsigned w, + unsigned h); #endif /*LODEPNG_COMPILE_DISK*/ #endif /*LODEPNG_COMPILE_ENCODER*/ #endif /*LODEPNG_COMPILE_PNG*/ @@ -189,20 +184,19 @@ const char* lodepng_error_text(unsigned code); typedef struct LodePNGDecompressSettings LodePNGDecompressSettings; struct LodePNGDecompressSettings { - unsigned ignore_adler32; /*if 1, continue and don't give an error message if the Adler32 checksum is corrupted*/ + unsigned ignore_adler32; /*if 1, continue and don't give an error message if the Adler32 + checksum is corrupted*/ - /*use custom zlib decoder instead of built in one (default: null)*/ - unsigned (*custom_zlib)(unsigned char**, size_t*, - const unsigned char*, size_t, - const LodePNGDecompressSettings*); - /*use custom deflate decoder instead of built in one (default: null) - if custom_zlib is used, custom_deflate is ignored since only the built in - zlib function will call custom_deflate*/ - unsigned (*custom_inflate)(unsigned char**, size_t*, - const unsigned char*, size_t, - const LodePNGDecompressSettings*); + /*use custom zlib decoder instead of built in one (default: null)*/ + unsigned (*custom_zlib)(unsigned char**, size_t*, const unsigned char*, size_t, + const LodePNGDecompressSettings*); + /*use custom deflate decoder instead of built in one (default: null) + if custom_zlib is used, custom_deflate is ignored since only the built in + zlib function will call custom_deflate*/ + unsigned (*custom_inflate)(unsigned char**, size_t*, const unsigned char*, size_t, + const LodePNGDecompressSettings*); - const void* custom_context; /*optional custom settings for custom functions*/ + const void* custom_context; /*optional custom settings for custom functions*/ }; extern const LodePNGDecompressSettings lodepng_default_decompress_settings; @@ -217,26 +211,28 @@ between speed and compression ratio. typedef struct LodePNGCompressSettings LodePNGCompressSettings; struct LodePNGCompressSettings /*deflate = compress*/ { - /*LZ77 related settings*/ - unsigned btype; /*the block type for LZ (0, 1, 2 or 3, see zlib standard). Should be 2 for proper compression.*/ - unsigned use_lz77; /*whether or not to use LZ77. Should be 1 for proper compression.*/ - unsigned windowsize; /*must be a power of two <= 32768. higher compresses more but is slower. Default value: 2048.*/ - unsigned minmatch; /*mininum lz77 length. 3 is normally best, 6 can be better for some PNGs. Default: 0*/ - unsigned nicematch; /*stop searching if >= this length found. Set to 258 for best compression. Default: 128*/ - unsigned lazymatching; /*use lazy matching: better compression but a bit slower. Default: true*/ + /*LZ77 related settings*/ + unsigned btype; /*the block type for LZ (0, 1, 2 or 3, see zlib standard). Should be 2 for + proper compression.*/ + unsigned use_lz77; /*whether or not to use LZ77. Should be 1 for proper compression.*/ + unsigned windowsize; /*must be a power of two <= 32768. higher compresses more but is slower. + Default value: 2048.*/ + unsigned minmatch; /*mininum lz77 length. 3 is normally best, 6 can be better for some PNGs. + Default: 0*/ + unsigned nicematch; /*stop searching if >= this length found. Set to 258 for best compression. + Default: 128*/ + unsigned lazymatching; /*use lazy matching: better compression but a bit slower. Default: true*/ - /*use custom zlib encoder instead of built in one (default: null)*/ - unsigned (*custom_zlib)(unsigned char**, size_t*, - const unsigned char*, size_t, - const LodePNGCompressSettings*); - /*use custom deflate encoder instead of built in one (default: null) - if custom_zlib is used, custom_deflate is ignored since only the built in - zlib function will call custom_deflate*/ - unsigned (*custom_deflate)(unsigned char**, size_t*, - const unsigned char*, size_t, - const LodePNGCompressSettings*); + /*use custom zlib encoder instead of built in one (default: null)*/ + unsigned (*custom_zlib)(unsigned char**, size_t*, const unsigned char*, size_t, + const LodePNGCompressSettings*); + /*use custom deflate encoder instead of built in one (default: null) + if custom_zlib is used, custom_deflate is ignored since only the built in + zlib function will call custom_deflate*/ + unsigned (*custom_deflate)(unsigned char**, size_t*, const unsigned char*, size_t, + const LodePNGCompressSettings*); - const void* custom_context; /*optional custom settings for custom functions*/ + const void* custom_context; /*optional custom settings for custom functions*/ }; extern const LodePNGCompressSettings lodepng_default_compress_settings; @@ -251,41 +247,45 @@ format, and is used both for PNG and raw image data in LodePNG. */ typedef struct LodePNGColorMode { - /*header (IHDR)*/ - LodePNGColorType colortype; /*color type, see PNG standard or documentation further in this header file*/ - unsigned bitdepth; /*bits per sample, see PNG standard or documentation further in this header file*/ + /*header (IHDR)*/ + LodePNGColorType + colortype; /*color type, see PNG standard or documentation further in this header file*/ + unsigned + bitdepth; /*bits per sample, see PNG standard or documentation further in this header file*/ - /* - palette (PLTE and tRNS) + /* + palette (PLTE and tRNS) - Dynamically allocated with the colors of the palette, including alpha. - When encoding a PNG, to store your colors in the palette of the LodePNGColorMode, first use - lodepng_palette_clear, then for each color use lodepng_palette_add. - If you encode an image without alpha with palette, don't forget to put value 255 in each A byte of the palette. + Dynamically allocated with the colors of the palette, including alpha. + When encoding a PNG, to store your colors in the palette of the LodePNGColorMode, first use + lodepng_palette_clear, then for each color use lodepng_palette_add. + If you encode an image without alpha with palette, don't forget to put value 255 in each A byte + of the palette. - When decoding, by default you can ignore this palette, since LodePNG already - fills the palette colors in the pixels of the raw RGBA output. + When decoding, by default you can ignore this palette, since LodePNG already + fills the palette colors in the pixels of the raw RGBA output. - The palette is only supported for color type 3. - */ - unsigned char* palette; /*palette in RGBARGBA... order. When allocated, must be either 0, or have size 1024*/ - size_t palettesize; /*palette size in number of colors (amount of bytes is 4 * palettesize)*/ + The palette is only supported for color type 3. + */ + unsigned char* palette; /*palette in RGBARGBA... order. When allocated, must be either 0, or + have size 1024*/ + size_t palettesize; /*palette size in number of colors (amount of bytes is 4 * palettesize)*/ - /* - transparent color key (tRNS) + /* + transparent color key (tRNS) - This color uses the same bit depth as the bitdepth value in this struct, which can be 1-bit to 16-bit. - For greyscale PNGs, r, g and b will all 3 be set to the same. + This color uses the same bit depth as the bitdepth value in this struct, which can be 1-bit to + 16-bit. For greyscale PNGs, r, g and b will all 3 be set to the same. - When decoding, by default you can ignore this information, since LodePNG sets - pixels with this key to transparent already in the raw RGBA output. + When decoding, by default you can ignore this information, since LodePNG sets + pixels with this key to transparent already in the raw RGBA output. - The color key is only supported for color types 0 and 2. - */ - unsigned key_defined; /*is a transparent color key given? 0 = false, 1 = true*/ - unsigned key_r; /*red/greyscale component of color key*/ - unsigned key_g; /*green component of color key*/ - unsigned key_b; /*blue component of color key*/ + The color key is only supported for color types 0 and 2. + */ + unsigned key_defined; /*is a transparent color key given? 0 = false, 1 = true*/ + unsigned key_r; /*red/greyscale component of color key*/ + unsigned key_g; /*green component of color key*/ + unsigned key_b; /*blue component of color key*/ } LodePNGColorMode; /*init, cleanup and copy functions to use with this struct*/ @@ -296,8 +296,8 @@ unsigned lodepng_color_mode_copy(LodePNGColorMode* dest, const LodePNGColorMode* void lodepng_palette_clear(LodePNGColorMode* info); /*add 1 color to the palette*/ -unsigned lodepng_palette_add(LodePNGColorMode* info, - unsigned char r, unsigned char g, unsigned char b, unsigned char a); +unsigned lodepng_palette_add(LodePNGColorMode* info, unsigned char r, unsigned char g, + unsigned char b, unsigned char a); /*get the total amount of bits per pixel, based on colortype and bitdepth in the struct*/ unsigned lodepng_get_bpp(const LodePNGColorMode* info); @@ -314,11 +314,11 @@ unsigned lodepng_is_palette_type(const LodePNGColorMode* info); Loops through the palette to check this.*/ unsigned lodepng_has_palette_alpha(const LodePNGColorMode* info); /* -Check if the given color info indicates the possibility of having non-opaque pixels in the PNG image. -Returns true if the image can have translucent or invisible pixels (it still be opaque if it doesn't use such pixels). -Returns false if the image can only have opaque pixels. -In detail, it returns true only if it's a color type with alpha, or has a palette with non-opaque values, -or if "key_defined" is true. +Check if the given color info indicates the possibility of having non-opaque pixels in the PNG +image. Returns true if the image can have translucent or invisible pixels (it still be opaque if it +doesn't use such pixels). Returns false if the image can only have opaque pixels. In detail, it +returns true only if it's a color type with alpha, or has a palette with non-opaque values, or if +"key_defined" is true. */ unsigned lodepng_can_have_alpha(const LodePNGColorMode* info); /*Returns the byte size of a raw image buffer with given width, height and color mode*/ @@ -328,91 +328,95 @@ size_t lodepng_get_raw_size(unsigned w, unsigned h, const LodePNGColorMode* colo /*The information of a Time chunk in PNG.*/ typedef struct LodePNGTime { - unsigned year; /*2 bytes used (0-65535)*/ - unsigned month; /*1-12*/ - unsigned day; /*1-31*/ - unsigned hour; /*0-23*/ - unsigned minute; /*0-59*/ - unsigned second; /*0-60 (to allow for leap seconds)*/ + unsigned year; /*2 bytes used (0-65535)*/ + unsigned month; /*1-12*/ + unsigned day; /*1-31*/ + unsigned hour; /*0-23*/ + unsigned minute; /*0-59*/ + unsigned second; /*0-60 (to allow for leap seconds)*/ } LodePNGTime; #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ /*Information about the PNG image, except pixels, width and height.*/ typedef struct LodePNGInfo { - /*header (IHDR), palette (PLTE) and transparency (tRNS) chunks*/ - unsigned compression_method;/*compression method of the original file. Always 0.*/ - unsigned filter_method; /*filter method of the original file*/ - unsigned interlace_method; /*interlace method of the original file*/ - LodePNGColorMode color; /*color type and bits, palette and transparency of the PNG file*/ + /*header (IHDR), palette (PLTE) and transparency (tRNS) chunks*/ + unsigned compression_method; /*compression method of the original file. Always 0.*/ + unsigned filter_method; /*filter method of the original file*/ + unsigned interlace_method; /*interlace method of the original file*/ + LodePNGColorMode color; /*color type and bits, palette and transparency of the PNG file*/ #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - /* - suggested background color chunk (bKGD) - This color uses the same color mode as the PNG (except alpha channel), which can be 1-bit to 16-bit. + /* + suggested background color chunk (bKGD) + This color uses the same color mode as the PNG (except alpha channel), which can be 1-bit to + 16-bit. - For greyscale PNGs, r, g and b will all 3 be set to the same. When encoding - the encoder writes the red one. For palette PNGs: When decoding, the RGB value - will be stored, not a palette index. But when encoding, specify the index of - the palette in background_r, the other two are then ignored. + For greyscale PNGs, r, g and b will all 3 be set to the same. When encoding + the encoder writes the red one. For palette PNGs: When decoding, the RGB value + will be stored, not a palette index. But when encoding, specify the index of + the palette in background_r, the other two are then ignored. - The decoder does not use this background color to edit the color of pixels. - */ - unsigned background_defined; /*is a suggested background color given?*/ - unsigned background_r; /*red component of suggested background color*/ - unsigned background_g; /*green component of suggested background color*/ - unsigned background_b; /*blue component of suggested background color*/ + The decoder does not use this background color to edit the color of pixels. + */ + unsigned background_defined; /*is a suggested background color given?*/ + unsigned background_r; /*red component of suggested background color*/ + unsigned background_g; /*green component of suggested background color*/ + unsigned background_b; /*blue component of suggested background color*/ - /* - non-international text chunks (tEXt and zTXt) + /* + non-international text chunks (tEXt and zTXt) - The char** arrays each contain num strings. The actual messages are in - text_strings, while text_keys are keywords that give a short description what - the actual text represents, e.g. Title, Author, Description, or anything else. + The char** arrays each contain num strings. The actual messages are in + text_strings, while text_keys are keywords that give a short description what + the actual text represents, e.g. Title, Author, Description, or anything else. - A keyword is minimum 1 character and maximum 79 characters long. It's - discouraged to use a single line length longer than 79 characters for texts. + A keyword is minimum 1 character and maximum 79 characters long. It's + discouraged to use a single line length longer than 79 characters for texts. - Don't allocate these text buffers yourself. Use the init/cleanup functions - correctly and use lodepng_add_text and lodepng_clear_text. - */ - size_t text_num; /*the amount of texts in these char** buffers (there may be more texts in itext)*/ - char** text_keys; /*the keyword of a text chunk (e.g. "Comment")*/ - char** text_strings; /*the actual text*/ + Don't allocate these text buffers yourself. Use the init/cleanup functions + correctly and use lodepng_add_text and lodepng_clear_text. + */ + size_t + text_num; /*the amount of texts in these char** buffers (there may be more texts in itext)*/ + char** text_keys; /*the keyword of a text chunk (e.g. "Comment")*/ + char** text_strings; /*the actual text*/ - /* - international text chunks (iTXt) - Similar to the non-international text chunks, but with additional strings - "langtags" and "transkeys". - */ - size_t itext_num; /*the amount of international texts in this PNG*/ - char** itext_keys; /*the English keyword of the text chunk (e.g. "Comment")*/ - char** itext_langtags; /*language tag for this text's language, ISO/IEC 646 string, e.g. ISO 639 language tag*/ - char** itext_transkeys; /*keyword translated to the international language - UTF-8 string*/ - char** itext_strings; /*the actual international text - UTF-8 string*/ + /* + international text chunks (iTXt) + Similar to the non-international text chunks, but with additional strings + "langtags" and "transkeys". + */ + size_t itext_num; /*the amount of international texts in this PNG*/ + char** itext_keys; /*the English keyword of the text chunk (e.g. "Comment")*/ + char** itext_langtags; /*language tag for this text's language, ISO/IEC 646 string, e.g. ISO 639 + language tag*/ + char** itext_transkeys; /*keyword translated to the international language - UTF-8 string*/ + char** itext_strings; /*the actual international text - UTF-8 string*/ - /*time chunk (tIME)*/ - unsigned time_defined; /*set to 1 to make the encoder generate a tIME chunk*/ - LodePNGTime time; + /*time chunk (tIME)*/ + unsigned time_defined; /*set to 1 to make the encoder generate a tIME chunk*/ + LodePNGTime time; - /*phys chunk (pHYs)*/ - unsigned phys_defined; /*if 0, there is no pHYs chunk and the values below are undefined, if 1 else there is one*/ - unsigned phys_x; /*pixels per unit in x direction*/ - unsigned phys_y; /*pixels per unit in y direction*/ - unsigned phys_unit; /*may be 0 (unknown unit) or 1 (metre)*/ + /*phys chunk (pHYs)*/ + unsigned phys_defined; /*if 0, there is no pHYs chunk and the values below are undefined, if 1 + else there is one*/ + unsigned phys_x; /*pixels per unit in x direction*/ + unsigned phys_y; /*pixels per unit in y direction*/ + unsigned phys_unit; /*may be 0 (unknown unit) or 1 (metre)*/ - /* - unknown chunks - There are 3 buffers, one for each position in the PNG where unknown chunks can appear - each buffer contains all unknown chunks for that position consecutively - The 3 buffers are the unknown chunks between certain critical chunks: - 0: IHDR-PLTE, 1: PLTE-IDAT, 2: IDAT-IEND - Do not allocate or traverse this data yourself. Use the chunk traversing functions declared - later, such as lodepng_chunk_next and lodepng_chunk_append, to read/write this struct. - */ - unsigned char* unknown_chunks_data[3]; - size_t unknown_chunks_size[3]; /*size in bytes of the unknown chunks, given for protection*/ -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + /* + unknown chunks + There are 3 buffers, one for each position in the PNG where unknown chunks can appear + each buffer contains all unknown chunks for that position consecutively + The 3 buffers are the unknown chunks between certain critical chunks: + 0: IHDR-PLTE, 1: PLTE-IDAT, 2: IDAT-IEND + Do not allocate or traverse this data yourself. Use the chunk traversing functions declared + later, such as lodepng_chunk_next and lodepng_chunk_append, to read/write this struct. + */ + unsigned char* unknown_chunks_data[3]; + size_t unknown_chunks_size[3]; /*size in bytes of the unknown chunks, given for protection*/ +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ } LodePNGInfo; /*init, cleanup and copy functions to use with this struct*/ @@ -422,28 +426,30 @@ void lodepng_info_cleanup(LodePNGInfo* info); unsigned lodepng_info_copy(LodePNGInfo* dest, const LodePNGInfo* source); #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS -void lodepng_clear_text(LodePNGInfo* info); /*use this to clear the texts again after you filled them in*/ -unsigned lodepng_add_text(LodePNGInfo* info, const char* key, const char* str); /*push back both texts at once*/ +void lodepng_clear_text( + LodePNGInfo* info); /*use this to clear the texts again after you filled them in*/ +unsigned lodepng_add_text(LodePNGInfo* info, const char* key, + const char* str); /*push back both texts at once*/ -void lodepng_clear_itext(LodePNGInfo* info); /*use this to clear the itexts again after you filled them in*/ +void lodepng_clear_itext( + LodePNGInfo* info); /*use this to clear the itexts again after you filled them in*/ unsigned lodepng_add_itext(LodePNGInfo* info, const char* key, const char* langtag, - const char* transkey, const char* str); /*push back the 4 texts of 1 chunk at once*/ -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + const char* transkey, + const char* str); /*push back the 4 texts of 1 chunk at once*/ +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ /* Converts raw buffer from one color type to another color type, based on LodePNGColorMode structs to describe the input and output color type. -See the reference manual at the end of this header file to see which color conversions are supported. -return value = LodePNG error code (0 if all went ok, an error if the conversion isn't supported) -The out buffer must have size (w * h * bpp + 7) / 8, where bpp is the bits per pixel -of the output color type (lodepng_get_bpp). -For < 8 bpp images, there should not be padding bits at the end of scanlines. -For 16-bit per channel colors, uses big endian format like PNG does. -Return value is LodePNG error code +See the reference manual at the end of this header file to see which color conversions are +supported. return value = LodePNG error code (0 if all went ok, an error if the conversion isn't +supported) The out buffer must have size (w * h * bpp + 7) / 8, where bpp is the bits per pixel of +the output color type (lodepng_get_bpp). For < 8 bpp images, there should not be padding bits at the +end of scanlines. For 16-bit per channel colors, uses big endian format like PNG does. Return value +is LodePNG error code */ -unsigned lodepng_convert(unsigned char* out, const unsigned char* in, - LodePNGColorMode* mode_out, const LodePNGColorMode* mode_in, - unsigned w, unsigned h); +unsigned lodepng_convert(unsigned char* out, const unsigned char* in, LodePNGColorMode* mode_out, + const LodePNGColorMode* mode_in, unsigned w, unsigned h); #ifdef LODEPNG_COMPILE_DECODER /* @@ -452,16 +458,18 @@ decoder, but not the Info settings from the Info structs. */ typedef struct LodePNGDecoderSettings { - LodePNGDecompressSettings zlibsettings; /*in here is the setting to ignore Adler32 checksums*/ + LodePNGDecompressSettings zlibsettings; /*in here is the setting to ignore Adler32 checksums*/ - unsigned ignore_crc; /*ignore CRC checksums*/ + unsigned ignore_crc; /*ignore CRC checksums*/ - unsigned color_convert; /*whether to convert the PNG to the color type you want. Default: yes*/ + unsigned color_convert; /*whether to convert the PNG to the color type you want. Default: yes*/ #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - unsigned read_text_chunks; /*if false but remember_unknown_chunks is true, they're stored in the unknown chunks*/ - /*store all bytes from unknown chunks in the LodePNGInfo (off by default, useful for a png editor)*/ - unsigned remember_unknown_chunks; + unsigned read_text_chunks; /*if false but remember_unknown_chunks is true, they're stored in the + unknown chunks*/ + /*store all bytes from unknown chunks in the LodePNGInfo (off by default, useful for a png + * editor)*/ + unsigned remember_unknown_chunks; #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ } LodePNGDecoderSettings; @@ -472,98 +480,101 @@ void lodepng_decoder_settings_init(LodePNGDecoderSettings* settings); /*automatically use color type with less bits per pixel if losslessly possible. Default: AUTO*/ typedef enum LodePNGFilterStrategy { - /*every filter at zero*/ - LFS_ZERO, - /*Use filter that gives minumum sum, as described in the official PNG filter heuristic.*/ - LFS_MINSUM, - /*Use the filter type that gives smallest Shannon entropy for this scanline. Depending - on the image, this is better or worse than minsum.*/ - LFS_ENTROPY, - /* - Brute-force-search PNG filters by compressing each filter for each scanline. - Experimental, very slow, and only rarely gives better compression than MINSUM. - */ - LFS_BRUTE_FORCE, - /*use predefined_filters buffer: you specify the filter type for each scanline*/ - LFS_PREDEFINED + /*every filter at zero*/ + LFS_ZERO, + /*Use filter that gives minumum sum, as described in the official PNG filter heuristic.*/ + LFS_MINSUM, + /*Use the filter type that gives smallest Shannon entropy for this scanline. Depending + on the image, this is better or worse than minsum.*/ + LFS_ENTROPY, + /* + Brute-force-search PNG filters by compressing each filter for each scanline. + Experimental, very slow, and only rarely gives better compression than MINSUM. + */ + LFS_BRUTE_FORCE, + /*use predefined_filters buffer: you specify the filter type for each scanline*/ + LFS_PREDEFINED } LodePNGFilterStrategy; -/*Gives characteristics about the colors of the image, which helps decide which color model to use for encoding. -Used internally by default if "auto_convert" is enabled. Public because it's useful for custom algorithms.*/ +/*Gives characteristics about the colors of the image, which helps decide which color model to use +for encoding. Used internally by default if "auto_convert" is enabled. Public because it's useful +for custom algorithms.*/ typedef struct LodePNGColorProfile { - unsigned colored; /*not greyscale*/ - unsigned key; /*if true, image is not opaque. Only if true and alpha is false, color key is possible.*/ - unsigned short key_r; /*these values are always in 16-bit bitdepth in the profile*/ - unsigned short key_g; - unsigned short key_b; - unsigned alpha; /*alpha channel or alpha palette required*/ - unsigned numcolors; /*amount of colors, up to 257. Not valid if bits == 16.*/ - unsigned char palette[1024]; /*Remembers up to the first 256 RGBA colors, in no particular order*/ - unsigned bits; /*bits per channel (not for palette). 1,2 or 4 for greyscale only. 16 if 16-bit per channel required.*/ + unsigned colored; /*not greyscale*/ + unsigned key; /*if true, image is not opaque. Only if true and alpha is false, color key is + possible.*/ + unsigned short key_r; /*these values are always in 16-bit bitdepth in the profile*/ + unsigned short key_g; + unsigned short key_b; + unsigned alpha; /*alpha channel or alpha palette required*/ + unsigned numcolors; /*amount of colors, up to 257. Not valid if bits == 16.*/ + unsigned char + palette[1024]; /*Remembers up to the first 256 RGBA colors, in no particular order*/ + unsigned bits; /*bits per channel (not for palette). 1,2 or 4 for greyscale only. 16 if 16-bit + per channel required.*/ } LodePNGColorProfile; void lodepng_color_profile_init(LodePNGColorProfile* profile); /*Get a LodePNGColorProfile of the image.*/ -unsigned get_color_profile(LodePNGColorProfile* profile, - const unsigned char* image, unsigned w, unsigned h, - const LodePNGColorMode* mode_in); +unsigned get_color_profile(LodePNGColorProfile* profile, const unsigned char* image, unsigned w, + unsigned h, const LodePNGColorMode* mode_in); /*The function LodePNG uses internally to decide the PNG color with auto_convert. Chooses an optimal color model, e.g. grey if only grey pixels, palette if < 256 colors, ...*/ -unsigned lodepng_auto_choose_color(LodePNGColorMode* mode_out, - const unsigned char* image, unsigned w, unsigned h, - const LodePNGColorMode* mode_in); +unsigned lodepng_auto_choose_color(LodePNGColorMode* mode_out, const unsigned char* image, + unsigned w, unsigned h, const LodePNGColorMode* mode_in); /*Settings for the encoder.*/ typedef struct LodePNGEncoderSettings { - LodePNGCompressSettings zlibsettings; /*settings for the zlib encoder, such as window size, ...*/ + LodePNGCompressSettings + zlibsettings; /*settings for the zlib encoder, such as window size, ...*/ - unsigned auto_convert; /*automatically choose output PNG color type. Default: true*/ + unsigned auto_convert; /*automatically choose output PNG color type. Default: true*/ - /*If true, follows the official PNG heuristic: if the PNG uses a palette or lower than - 8 bit depth, set all filters to zero. Otherwise use the filter_strategy. Note that to - completely follow the official PNG heuristic, filter_palette_zero must be true and - filter_strategy must be LFS_MINSUM*/ - unsigned filter_palette_zero; - /*Which filter strategy to use when not using zeroes due to filter_palette_zero. - Set filter_palette_zero to 0 to ensure always using your chosen strategy. Default: LFS_MINSUM*/ - LodePNGFilterStrategy filter_strategy; - /*used if filter_strategy is LFS_PREDEFINED. In that case, this must point to a buffer with - the same length as the amount of scanlines in the image, and each value must <= 5. You - have to cleanup this buffer, LodePNG will never free it. Don't forget that filter_palette_zero - must be set to 0 to ensure this is also used on palette or low bitdepth images.*/ - const unsigned char* predefined_filters; + /*If true, follows the official PNG heuristic: if the PNG uses a palette or lower than + 8 bit depth, set all filters to zero. Otherwise use the filter_strategy. Note that to + completely follow the official PNG heuristic, filter_palette_zero must be true and + filter_strategy must be LFS_MINSUM*/ + unsigned filter_palette_zero; + /*Which filter strategy to use when not using zeroes due to filter_palette_zero. + Set filter_palette_zero to 0 to ensure always using your chosen strategy. Default: LFS_MINSUM*/ + LodePNGFilterStrategy filter_strategy; + /*used if filter_strategy is LFS_PREDEFINED. In that case, this must point to a buffer with + the same length as the amount of scanlines in the image, and each value must <= 5. You + have to cleanup this buffer, LodePNG will never free it. Don't forget that filter_palette_zero + must be set to 0 to ensure this is also used on palette or low bitdepth images.*/ + const unsigned char* predefined_filters; - /*force creating a PLTE chunk if colortype is 2 or 6 (= a suggested palette). - If colortype is 3, PLTE is _always_ created.*/ - unsigned force_palette; + /*force creating a PLTE chunk if colortype is 2 or 6 (= a suggested palette). + If colortype is 3, PLTE is _always_ created.*/ + unsigned force_palette; #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - /*add LodePNG identifier and version as a text chunk, for debugging*/ - unsigned add_id; - /*encode text chunks as zTXt chunks instead of tEXt chunks, and use compression in iTXt chunks*/ - unsigned text_compression; + /*add LodePNG identifier and version as a text chunk, for debugging*/ + unsigned add_id; + /*encode text chunks as zTXt chunks instead of tEXt chunks, and use compression in iTXt chunks*/ + unsigned text_compression; #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ } LodePNGEncoderSettings; void lodepng_encoder_settings_init(LodePNGEncoderSettings* settings); #endif /*LODEPNG_COMPILE_ENCODER*/ - #if defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_ENCODER) /*The settings, state and information for extended encoding and decoding.*/ typedef struct LodePNGState { #ifdef LODEPNG_COMPILE_DECODER - LodePNGDecoderSettings decoder; /*the decoding settings*/ -#endif /*LODEPNG_COMPILE_DECODER*/ + LodePNGDecoderSettings decoder; /*the decoding settings*/ +#endif /*LODEPNG_COMPILE_DECODER*/ #ifdef LODEPNG_COMPILE_ENCODER - LodePNGEncoderSettings encoder; /*the encoding settings*/ -#endif /*LODEPNG_COMPILE_ENCODER*/ - LodePNGColorMode info_raw; /*specifies the format in which you would like to get the raw pixel buffer*/ - LodePNGInfo info_png; /*info of the PNG image obtained after decoding*/ - unsigned error; + LodePNGEncoderSettings encoder; /*the encoding settings*/ +#endif /*LODEPNG_COMPILE_ENCODER*/ + LodePNGColorMode + info_raw; /*specifies the format in which you would like to get the raw pixel buffer*/ + LodePNGInfo info_png; /*info of the PNG image obtained after decoding*/ + unsigned error; } LodePNGState; /*init, cleanup and copy functions to use with this struct*/ @@ -577,8 +588,7 @@ void lodepng_state_copy(LodePNGState* dest, const LodePNGState* source); Same as lodepng_decode_memory, but uses a LodePNGState to allow custom settings and getting much more information about the PNG image and color mode. */ -unsigned lodepng_decode(unsigned char** out, unsigned* w, unsigned* h, - LodePNGState* state, +unsigned lodepng_decode(unsigned char** out, unsigned* w, unsigned* h, LodePNGState* state, const unsigned char* in, size_t insize); /* @@ -586,17 +596,14 @@ Read the PNG header, but not the actual data. This returns only the information that is in the header chunk of the PNG, such as width, height and color type. The information is placed in the info_png field of the LodePNGState. */ -unsigned lodepng_inspect(unsigned* w, unsigned* h, - LodePNGState* state, - const unsigned char* in, size_t insize); +unsigned lodepng_inspect(unsigned* w, unsigned* h, LodePNGState* state, const unsigned char* in, + size_t insize); #endif /*LODEPNG_COMPILE_DECODER*/ - #ifdef LODEPNG_COMPILE_ENCODER /*This function allocates the out buffer with standard malloc and stores the size in *outsize.*/ -unsigned lodepng_encode(unsigned char** out, size_t* outsize, - const unsigned char* image, unsigned w, unsigned h, - LodePNGState* state); +unsigned lodepng_encode(unsigned char** out, size_t* outsize, const unsigned char* image, + unsigned w, unsigned h, LodePNGState* state); #endif /*LODEPNG_COMPILE_ENCODER*/ /* @@ -659,12 +666,10 @@ Returne error code (0 if it went ok) unsigned lodepng_chunk_create(unsigned char** out, size_t* outlength, unsigned length, const char* type, const unsigned char* data); - /*Calculate CRC32 of buffer*/ unsigned lodepng_crc32(const unsigned char* buf, size_t len); #endif /*LODEPNG_COMPILE_PNG*/ - #ifdef LODEPNG_COMPILE_ZLIB /* This zlib part can be used independently to zlib compress and decompress a @@ -673,10 +678,10 @@ part of zlib that is required for PNG, it does not support dictionaries. */ #ifdef LODEPNG_COMPILE_DECODER -/*Inflate a buffer. Inflate is the decompression step of deflate. Out buffer must be freed after use.*/ -unsigned lodepng_inflate(unsigned char** out, size_t* outsize, - const unsigned char* in, size_t insize, - const LodePNGDecompressSettings* settings); +/*Inflate a buffer. Inflate is the decompression step of deflate. Out buffer must be freed after + * use.*/ +unsigned lodepng_inflate(unsigned char** out, size_t* outsize, const unsigned char* in, + size_t insize, const LodePNGDecompressSettings* settings); /* Decompresses Zlib data. Reallocates the out buffer and appends the data. The @@ -684,9 +689,8 @@ data must be according to the zlib specification. Either, *out must be NULL and *outsize must be 0, or, *out must be a valid buffer and *outsize its size in bytes. out must be freed by user after usage. */ -unsigned lodepng_zlib_decompress(unsigned char** out, size_t* outsize, - const unsigned char* in, size_t insize, - const LodePNGDecompressSettings* settings); +unsigned lodepng_zlib_decompress(unsigned char** out, size_t* outsize, const unsigned char* in, + size_t insize, const LodePNGDecompressSettings* settings); #endif /*LODEPNG_COMPILE_DECODER*/ #ifdef LODEPNG_COMPILE_ENCODER @@ -697,9 +701,8 @@ The data is output in the format of the zlib specification. Either, *out must be NULL and *outsize must be 0, or, *out must be a valid buffer and *outsize its size in bytes. out must be freed by user after usage. */ -unsigned lodepng_zlib_compress(unsigned char** out, size_t* outsize, - const unsigned char* in, size_t insize, - const LodePNGCompressSettings* settings); +unsigned lodepng_zlib_compress(unsigned char** out, size_t* outsize, const unsigned char* in, + size_t insize, const LodePNGCompressSettings* settings); /* Find length-limited Huffman code for given frequencies. This function is in the @@ -709,9 +712,8 @@ unsigned lodepng_huffman_code_lengths(unsigned* lengths, const unsigned* frequen size_t numcodes, unsigned maxbitlen); /*Compress a buffer with deflate. See RFC 1951. Out buffer must be freed after use.*/ -unsigned lodepng_deflate(unsigned char** out, size_t* outsize, - const unsigned char* in, size_t insize, - const LodePNGCompressSettings* settings); +unsigned lodepng_deflate(unsigned char** out, size_t* outsize, const unsigned char* in, + size_t insize, const LodePNGCompressSettings* settings); #endif /*LODEPNG_COMPILE_ENCODER*/ #endif /*LODEPNG_COMPILE_ZLIB*/ @@ -740,17 +742,17 @@ unsigned lodepng_save_file(const unsigned char* buffer, size_t buffersize, const /* TODO: -[.] test if there are no memory leaks or security exploits - done a lot but needs to be checked often -[.] check compatibility with vareous compilers - done but needs to be redone for every newer version -[X] converting color to 16-bit per channel types -[ ] read all public PNG chunk types (but never let the color profile and gamma ones touch RGB values) -[ ] make sure encoder generates no chunks with size > (2^31)-1 -[ ] partial decoding (stream processing) -[X] let the "isFullyOpaque" function check color keys and transparent palettes too -[X] better name for the variables "codes", "codesD", "codelengthcodes", "clcl" and "lldl" -[ ] don't stop decoding on errors like 69, 57, 58 (make warnings) -[ ] make option to choose if the raw image with non multiple of 8 bits per scanline should have padding bits or not -[ ] let the C++ wrapper catch exceptions coming from the standard library and return LodePNG error codes +[.] test if there are no memory leaks or security exploits - done a lot but needs to be checked +often +[.] check compatibility with vareous compilers - done but needs to be redone for every newer +version [X] converting color to 16-bit per channel types [ ] read all public PNG chunk types (but +never let the color profile and gamma ones touch RGB values) [ ] make sure encoder generates no +chunks with size > (2^31)-1 [ ] partial decoding (stream processing) [X] let the "isFullyOpaque" +function check color keys and transparent palettes too [X] better name for the variables "codes", +"codesD", "codelengthcodes", "clcl" and "lldl" [ ] don't stop decoding on errors like 69, 57, 58 +(make warnings) [ ] make option to choose if the raw image with non multiple of 8 bits per scanline +should have padding bits or not [ ] let the C++ wrapper catch exceptions coming from the standard +library and return LodePNG error codes */ #endif /*LODEPNG_H inclusion guard*/ @@ -835,9 +837,10 @@ begin), life-critical systems, ... The following features are supported by the decoder: -*) decoding of PNGs with any color type, bit depth and interlace mode, to a 24- or 32-bit color raw image, - or the same color type as the PNG -*) encoding of PNGs, from any raw image to 24- or 32-bit color, or the same color type as the raw image +*) decoding of PNGs with any color type, bit depth and interlace mode, to a 24- or 32-bit color raw +image, or the same color type as the PNG +*) encoding of PNGs, from any raw image to 24- or 32-bit color, or the same color type as the raw +image *) Adam7 interlace and deinterlace for any color type *) loading the image from harddisk or decoding it from a buffer from other sources than harddisk *) support for alpha channels, including RGBA color model, translucent palettes and color keying @@ -903,8 +906,8 @@ as the C-style structs when working with C++. The following conventions are used for all C-style structs: -if a struct has a corresponding init function, always call the init function when making a new one --if a struct has a corresponding cleanup function, call it before the struct disappears to avoid memory leaks --if a struct has a corresponding copy function, use the copy function instead of "=". +-if a struct has a corresponding cleanup function, call it before the struct disappears to avoid +memory leaks -if a struct has a corresponding copy function, use the copy function instead of "=". The destination must also be inited already. @@ -922,7 +925,8 @@ features. When using the LodePNGState, it uses the following fields for decoding: *) LodePNGInfo info_png: it stores extra information about the PNG (the input) in here -*) LodePNGColorMode info_raw: here you can say what color mode of the raw image (the output) you want to get +*) LodePNGColorMode info_raw: here you can say what color mode of the raw image (the output) you +want to get *) LodePNGDecoderSettings decoder: you can specify a few extra settings for the decoder to use LodePNGInfo info_png @@ -1380,9 +1384,11 @@ int main(int argc, char *argv[]) unsigned error = lodepng::decode(image, width, height, filename); //if there's an error, display it - if(error) std::cout << "decoder error " << error << ": " << lodepng_error_text(error) << std::endl; + if(error) std::cout << "decoder error " << error << ": " << lodepng_error_text(error) << +std::endl; - //the pixels are now in the vector "image", 4 bytes per pixel, ordered RGBARGBA..., use it as texture, draw it, ... + //the pixels are now in the vector "image", 4 bytes per pixel, ordered RGBARGBA..., use it as +texture, draw it, ... } 10.2. decoder C example diff --git a/winpr/libwinpr/utils/ntlm.c b/winpr/libwinpr/utils/ntlm.c index bdfb696af..9baf9e536 100644 --- a/winpr/libwinpr/utils/ntlm.c +++ b/winpr/libwinpr/utils/ntlm.c @@ -37,7 +37,7 @@ BOOL NTOWFv1W(LPWSTR Password, UINT32 PasswordLength, BYTE* NtHash) if (!Password || !NtHash) return FALSE; - if (!winpr_Digest(WINPR_MD_MD4, (BYTE*) Password, (size_t) PasswordLength, NtHash, + if (!winpr_Digest(WINPR_MD_MD4, (BYTE*)Password, (size_t)PasswordLength, NtHash, WINPR_MD4_DIGEST_LENGTH)) return FALSE; @@ -52,7 +52,7 @@ BOOL NTOWFv1A(LPSTR Password, UINT32 PasswordLength, BYTE* NtHash) if (!NtHash) return FALSE; - if (!(PasswordW = (LPWSTR) calloc(PasswordLength, 2))) + if (!(PasswordW = (LPWSTR)calloc(PasswordLength, 2))) return FALSE; MultiByteToWideChar(CP_ACP, 0, Password, PasswordLength, PasswordW, PasswordLength); @@ -73,8 +73,8 @@ out_fail: * EndDefine */ -BOOL NTOWFv2W(LPWSTR Password, UINT32 PasswordLength, LPWSTR User, - UINT32 UserLength, LPWSTR Domain, UINT32 DomainLength, BYTE* NtHash) +BOOL NTOWFv2W(LPWSTR Password, UINT32 PasswordLength, LPWSTR User, UINT32 UserLength, LPWSTR Domain, + UINT32 DomainLength, BYTE* NtHash) { BYTE* buffer; BYTE NtHashV1[16]; @@ -86,15 +86,16 @@ BOOL NTOWFv2W(LPWSTR Password, UINT32 PasswordLength, LPWSTR User, if (!NTOWFv1W(Password, PasswordLength, NtHashV1)) return FALSE; - if (!(buffer = (BYTE*) malloc(UserLength + DomainLength))) + if (!(buffer = (BYTE*)malloc(UserLength + DomainLength))) return FALSE; /* Concatenate(UpperCase(User), Domain) */ CopyMemory(buffer, User, UserLength); - CharUpperBuffW((LPWSTR) buffer, UserLength / 2); + CharUpperBuffW((LPWSTR)buffer, UserLength / 2); CopyMemory(&buffer[UserLength], Domain, DomainLength); - /* Compute the HMAC-MD5 hash of the above value using the NTLMv1 hash as the key, the result is the NTLMv2 hash */ + /* Compute the HMAC-MD5 hash of the above value using the NTLMv1 hash as the key, the result is + * the NTLMv2 hash */ if (!winpr_HMAC(WINPR_MD_MD5, NtHashV1, 16, buffer, UserLength + DomainLength, NtHash, WINPR_MD4_DIGEST_LENGTH)) goto out_fail; @@ -105,8 +106,8 @@ out_fail: return result; } -BOOL NTOWFv2A(LPSTR Password, UINT32 PasswordLength, LPSTR User, - UINT32 UserLength, LPSTR Domain, UINT32 DomainLength, BYTE* NtHash) +BOOL NTOWFv2A(LPSTR Password, UINT32 PasswordLength, LPSTR User, UINT32 UserLength, LPSTR Domain, + UINT32 DomainLength, BYTE* NtHash) { LPWSTR UserW = NULL; LPWSTR DomainW = NULL; @@ -116,9 +117,9 @@ BOOL NTOWFv2A(LPSTR Password, UINT32 PasswordLength, LPSTR User, if (!NtHash) return FALSE; - UserW = (LPWSTR) calloc(UserLength, 2); - DomainW = (LPWSTR) calloc(DomainLength, 2); - PasswordW = (LPWSTR) calloc(PasswordLength, 2); + UserW = (LPWSTR)calloc(UserLength, 2); + DomainW = (LPWSTR)calloc(DomainLength, 2); + PasswordW = (LPWSTR)calloc(PasswordLength, 2); if (!UserW || !DomainW || !PasswordW) goto out_fail; @@ -148,19 +149,20 @@ BOOL NTOWFv2FromHashW(BYTE* NtHashV1, LPWSTR User, UINT32 UserLength, LPWSTR Dom if (!User || !NtHash) return FALSE; - if (!(buffer = (BYTE*) malloc(UserLength + DomainLength))) + if (!(buffer = (BYTE*)malloc(UserLength + DomainLength))) return FALSE; /* Concatenate(UpperCase(User), Domain) */ CopyMemory(buffer, User, UserLength); - CharUpperBuffW((LPWSTR) buffer, UserLength / 2); + CharUpperBuffW((LPWSTR)buffer, UserLength / 2); if (DomainLength > 0) { CopyMemory(&buffer[UserLength], Domain, DomainLength); } - /* Compute the HMAC-MD5 hash of the above value using the NTLMv1 hash as the key, the result is the NTLMv2 hash */ + /* Compute the HMAC-MD5 hash of the above value using the NTLMv1 hash as the key, the result is + * the NTLMv2 hash */ if (!winpr_HMAC(WINPR_MD_MD5, NtHashV1, 16, buffer, UserLength + DomainLength, NtHash, WINPR_MD4_DIGEST_LENGTH)) goto out_fail; @@ -181,8 +183,8 @@ BOOL NTOWFv2FromHashA(BYTE* NtHashV1, LPSTR User, UINT32 UserLength, LPSTR Domai if (!NtHash) return FALSE; - UserW = (LPWSTR) calloc(UserLength, 2); - DomainW = (LPWSTR) calloc(DomainLength, 2); + UserW = (LPWSTR)calloc(UserLength, 2); + DomainW = (LPWSTR)calloc(DomainLength, 2); if (!UserW || !DomainW) goto out_fail; diff --git a/winpr/libwinpr/utils/print.c b/winpr/libwinpr/utils/print.c index 32b428cc1..c56cf5f6f 100644 --- a/winpr/libwinpr/utils/print.c +++ b/winpr/libwinpr/utils/print.c @@ -51,10 +51,10 @@ void winpr_HexLogDump(wLog* log, UINT32 lvl, const BYTE* data, size_t length) * ASIC line 'ab..cd' * zero terminator '\0' */ - const size_t blen = ((size_t)maxlen + 3) + (WINPR_HEXDUMP_LINE_LENGTH * 3) + 3 + WINPR_HEXDUMP_LINE_LENGTH + 1; + const size_t blen = + ((size_t)maxlen + 3) + (WINPR_HEXDUMP_LINE_LENGTH * 3) + 3 + WINPR_HEXDUMP_LINE_LENGTH + 1; size_t pos = 0; - char* buffer; if (!log || (maxlen < 0)) @@ -64,14 +64,14 @@ void winpr_HexLogDump(wLog* log, UINT32 lvl, const BYTE* data, size_t length) if (!buffer) { - WLog_Print(log, WLOG_ERROR, "malloc(%"PRIuz") failed with [%"PRIuz"] %s", blen, errno, + WLog_Print(log, WLOG_ERROR, "malloc(%" PRIuz ") failed with [%" PRIuz "] %s", blen, errno, strerror(errno)); return; } while (offset < length) { - int rc = trio_snprintf(&buffer[pos], blen - pos, "%04"PRIuz" ", offset); + int rc = trio_snprintf(&buffer[pos], blen - pos, "%04" PRIuz " ", offset); if (rc < 0) goto fail; @@ -84,7 +84,7 @@ void winpr_HexLogDump(wLog* log, UINT32 lvl, const BYTE* data, size_t length) for (i = 0; i < line; i++) { - rc = trio_snprintf(&buffer[pos], blen - pos, "%02"PRIx8" ", p[i]); + rc = trio_snprintf(&buffer[pos], blen - pos, "%02" PRIx8 " ", p[i]); if (rc < 0) goto fail; @@ -105,7 +105,7 @@ void winpr_HexLogDump(wLog* log, UINT32 lvl, const BYTE* data, size_t length) for (i = 0; i < line; i++) { rc = trio_snprintf(&buffer[pos], blen - pos, "%c", - (p[i] >= 0x20 && p[i] < 0x7F) ? (char) p[i] : '.'); + (p[i] >= 0x20 && p[i] < 0x7F) ? (char)p[i] : '.'); if (rc < 0) goto fail; @@ -119,7 +119,7 @@ void winpr_HexLogDump(wLog* log, UINT32 lvl, const BYTE* data, size_t length) pos = 0; } - WLog_Print(log, lvl, "[length=%"PRIuz"] ", length); + WLog_Print(log, lvl, "[length=%" PRIuz "] ", length); fail: free(buffer); } @@ -134,7 +134,7 @@ void winpr_CArrayDump(const char* tag, UINT32 level, const BYTE* data, int lengt if (!buffer) { - WLog_ERR(tag, "malloc(%"PRIuz") failed with [%d] %s", llen, errno, strerror(errno)); + WLog_ERR(tag, "malloc(%" PRIuz ") failed with [%d] %s", llen, errno, strerror(errno)); return; } @@ -148,7 +148,7 @@ void winpr_CArrayDump(const char* tag, UINT32 level, const BYTE* data, int lengt pos = 0; for (i = 0; i < line; i++) - pos += trio_snprintf(&buffer[pos], llen - pos, "\\x%02"PRIX8"", p[i]); + pos += trio_snprintf(&buffer[pos], llen - pos, "\\x%02" PRIX8 "", p[i]); WLog_LVL(tag, level, "%s", buffer); offset += line; @@ -166,7 +166,7 @@ char* winpr_BinToHexString(const BYTE* data, int length, BOOL space) int ln, hn; char bin2hex[] = "0123456789ABCDEF"; n = space ? 3 : 2; - p = (char*) malloc((length + 1) * n); + p = (char*)malloc((length + 1) * n); if (!p) return NULL; diff --git a/winpr/libwinpr/utils/sam.c b/winpr/libwinpr/utils/sam.c index 05831c227..39ebd36c8 100644 --- a/winpr/libwinpr/utils/sam.c +++ b/winpr/libwinpr/utils/sam.c @@ -37,9 +37,9 @@ #endif #ifdef _WIN32 -#define WINPR_SAM_FILE "C:\\SAM" +#define WINPR_SAM_FILE "C:\\SAM" #else -#define WINPR_SAM_FILE "/etc/winpr/SAM" +#define WINPR_SAM_FILE "/etc/winpr/SAM" #endif #define TAG WINPR_TAG("utils") @@ -63,7 +63,7 @@ WINPR_SAM* SamOpen(const char* filename, BOOL readOnly) if (fp) { - sam = (WINPR_SAM*) malloc(sizeof(WINPR_SAM)); + sam = (WINPR_SAM*)malloc(sizeof(WINPR_SAM)); if (!sam) { @@ -98,7 +98,7 @@ static BOOL SamLookupStart(WINPR_SAM* sam) if (fileSize < 1) return FALSE; - sam->buffer = (char*) malloc(fileSize + 2); + sam->buffer = (char*)malloc(fileSize + 2); if (!sam->buffer) return FALSE; @@ -191,7 +191,7 @@ BOOL SamReadEntry(WINPR_SAM* sam, WINPR_SAM_ENTRY* entry) return FALSE; entry->UserLength = (UINT32)(p[1] - p[0] - 1); - entry->User = (LPSTR) malloc(entry->UserLength + 1); + entry->User = (LPSTR)malloc(entry->UserLength + 1); if (!entry->User) return FALSE; @@ -202,7 +202,7 @@ BOOL SamReadEntry(WINPR_SAM* sam, WINPR_SAM_ENTRY* entry) if (entry->DomainLength > 0) { - entry->Domain = (LPSTR) malloc(entry->DomainLength + 1); + entry->Domain = (LPSTR)malloc(entry->DomainLength + 1); if (!entry->Domain) { @@ -218,10 +218,10 @@ BOOL SamReadEntry(WINPR_SAM* sam, WINPR_SAM_ENTRY* entry) entry->Domain = NULL; if (LmHashLength == 32) - HexStrToBin(p[2], (BYTE*) entry->LmHash, 16); + HexStrToBin(p[2], (BYTE*)entry->LmHash, 16); if (NtHashLength == 32) - HexStrToBin(p[3], (BYTE*) entry->NtHash, 16); + HexStrToBin(p[3], (BYTE*)entry->NtHash, 16); return TRUE; } @@ -267,7 +267,7 @@ WINPR_SAM_ENTRY* SamLookupUserA(WINPR_SAM* sam, LPSTR User, UINT32 UserLength, L size_t length; BOOL found = FALSE; WINPR_SAM_ENTRY* entry; - entry = (WINPR_SAM_ENTRY*) calloc(1, sizeof(WINPR_SAM_ENTRY)); + entry = (WINPR_SAM_ENTRY*)calloc(1, sizeof(WINPR_SAM_ENTRY)); if (!entry) return NULL; @@ -328,7 +328,7 @@ WINPR_SAM_ENTRY* SamLookupUserW(WINPR_SAM* sam, LPWSTR User, UINT32 UserLength, UINT32 EntryDomainLength; WINPR_SAM_ENTRY* entry; - if (!(entry = (WINPR_SAM_ENTRY*) calloc(1, sizeof(WINPR_SAM_ENTRY)))) + if (!(entry = (WINPR_SAM_ENTRY*)calloc(1, sizeof(WINPR_SAM_ENTRY)))) return NULL; if (!SamLookupStart(sam)) @@ -355,14 +355,14 @@ WINPR_SAM_ENTRY* SamLookupUserW(WINPR_SAM* sam, LPWSTR User, UINT32 UserLength, { if (entry->DomainLength > 0) { - EntryDomainLength = (UINT32) strlen(entry->Domain) * 2; - EntryDomain = (LPWSTR) malloc(EntryDomainLength + 2); + EntryDomainLength = (UINT32)strlen(entry->Domain) * 2; + EntryDomain = (LPWSTR)malloc(EntryDomainLength + 2); if (!EntryDomain) goto out_fail; MultiByteToWideChar(CP_ACP, 0, entry->Domain, EntryDomainLength / 2, - (LPWSTR) EntryDomain, EntryDomainLength / 2); + (LPWSTR)EntryDomain, EntryDomainLength / 2); if (DomainLength == EntryDomainLength) { @@ -386,14 +386,14 @@ WINPR_SAM_ENTRY* SamLookupUserW(WINPR_SAM* sam, LPWSTR User, UINT32 UserLength, if (DomainMatch) { - EntryUserLength = (UINT32) strlen(entry->User) * 2; - EntryUser = (LPWSTR) malloc(EntryUserLength + 2); + EntryUserLength = (UINT32)strlen(entry->User) * 2; + EntryUser = (LPWSTR)malloc(EntryUserLength + 2); if (!EntryUser) goto out_fail; MultiByteToWideChar(CP_ACP, 0, entry->User, EntryUserLength / 2, - (LPWSTR) EntryUser, EntryUserLength / 2); + (LPWSTR)EntryUser, EntryUserLength / 2); if (UserLength == EntryUserLength) { diff --git a/winpr/libwinpr/utils/ssl.c b/winpr/libwinpr/utils/ssl.c index 1880ea898..3a8590390 100644 --- a/winpr/libwinpr/utils/ssl.c +++ b/winpr/libwinpr/utils/ssl.c @@ -38,7 +38,6 @@ static BOOL g_winpr_openssl_initialized_by_winpr = FALSE; - /** * Note from OpenSSL 1.1.0 "CHANGES": * OpenSSL now uses a new threading API. It is no longer necessary to @@ -57,7 +56,6 @@ struct CRYPTO_dynlock_value HANDLE mutex; }; - #if (OPENSSL_VERSION_NUMBER < 0x10000000L) || defined(LIBRESSL_VERSION_NUMBER) static unsigned long _winpr_openssl_id(void) { @@ -81,7 +79,7 @@ static struct CRYPTO_dynlock_value* _winpr_openssl_dynlock_create(const char* fi { struct CRYPTO_dynlock_value* dynlock; - if (!(dynlock = (struct CRYPTO_dynlock_value*) malloc(sizeof(struct CRYPTO_dynlock_value)))) + if (!(dynlock = (struct CRYPTO_dynlock_value*)malloc(sizeof(struct CRYPTO_dynlock_value)))) return NULL; if (!(dynlock->mutex = CreateMutex(NULL, FALSE, NULL))) @@ -107,7 +105,7 @@ static void _winpr_openssl_dynlock_lock(int mode, struct CRYPTO_dynlock_value* d } static void _winpr_openssl_dynlock_destroy(struct CRYPTO_dynlock_value* dynlock, const char* file, - int line) + int line) { CloseHandle(dynlock->mutex); free(dynlock); @@ -160,8 +158,7 @@ static BOOL _winpr_openssl_initialize_locking(void) /* OpenSSL dynamic locking */ - if (CRYPTO_get_dynlock_create_callback() || - CRYPTO_get_dynlock_lock_callback() || + if (CRYPTO_get_dynlock_create_callback() || CRYPTO_get_dynlock_lock_callback() || CRYPTO_get_dynlock_destroy_callback()) { WLog_WARN(TAG, "dynamic locking callbacks are already set"); @@ -293,11 +290,10 @@ static BOOL CALLBACK _winpr_openssl_initialize(PINIT_ONCE once, PVOID param, PVO OpenSSL_add_all_ciphers(); #else - if (OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS | - OPENSSL_INIT_LOAD_CRYPTO_STRINGS | - OPENSSL_INIT_ADD_ALL_CIPHERS | - OPENSSL_INIT_ADD_ALL_DIGESTS | - OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL) != 1) + if (OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_LOAD_CRYPTO_STRINGS | + OPENSSL_INIT_ADD_ALL_CIPHERS | OPENSSL_INIT_ADD_ALL_DIGESTS | + OPENSSL_INIT_ENGINE_ALL_BUILTIN, + NULL) != 1) return FALSE; #endif @@ -305,7 +301,6 @@ static BOOL CALLBACK _winpr_openssl_initialize(PINIT_ONCE once, PVOID param, PVO return winpr_enable_fips(flags); } - /* exported functions */ BOOL winpr_InitializeSSL(DWORD flags) diff --git a/winpr/libwinpr/utils/stream.c b/winpr/libwinpr/utils/stream.c index 9034d3d40..1271981b7 100644 --- a/winpr/libwinpr/utils/stream.c +++ b/winpr/libwinpr/utils/stream.c @@ -41,21 +41,19 @@ BOOL Stream_EnsureCapacity(wStream* s, size_t size) do { new_capacity *= 2; - } - while (new_capacity < size); - + } while (new_capacity < size); position = Stream_GetPosition(s); if (!s->isOwner) { - new_buf = (BYTE *)malloc(new_capacity); + new_buf = (BYTE*)malloc(new_capacity); CopyMemory(new_buf, s->buffer, s->capacity); s->isOwner = TRUE; } else { - new_buf = (BYTE*) realloc(s->buffer, new_capacity); + new_buf = (BYTE*)realloc(s->buffer, new_capacity); } if (!new_buf) @@ -91,7 +89,7 @@ wStream* Stream_New(BYTE* buffer, size_t size) if (buffer) s->buffer = buffer; else - s->buffer = (BYTE*) malloc(size); + s->buffer = (BYTE*)malloc(size); if (!s->buffer) { @@ -110,7 +108,7 @@ wStream* Stream_New(BYTE* buffer, size_t size) return s; } -void Stream_StaticInit(wStream *s, BYTE *buffer, size_t size) +void Stream_StaticInit(wStream* s, BYTE* buffer, size_t size) { assert(s); assert(buffer); diff --git a/winpr/libwinpr/utils/strlst.c b/winpr/libwinpr/utils/strlst.c index da0b7a15c..b6b82d0df 100644 --- a/winpr/libwinpr/utils/strlst.c +++ b/winpr/libwinpr/utils/strlst.c @@ -27,12 +27,11 @@ #include #include - void string_list_free(char** string_list) { int i; - for (i = 0; string_list[i]; i ++) + for (i = 0; string_list[i]; i++) { free(string_list[i]); } @@ -44,23 +43,24 @@ int string_list_length(const char* const* string_list) { int i; - for (i = 0; string_list[i]; i ++); + for (i = 0; string_list[i]; i++) + ; return i; } -char** string_list_copy(const char* const* string_list) +char** string_list_copy(const char* const* string_list) { int i; int length = string_list_length(string_list); - char** copy = calloc(length + 1, sizeof(char*)); + char** copy = calloc(length + 1, sizeof(char*)); if (!copy) { return 0; } - for (i = 0; i < length; i ++) + for (i = 0; i < length; i++) { copy[i] = _strdup(string_list[i]); } @@ -73,11 +73,10 @@ void string_list_print(FILE* out, const char* const* string_list) { int j; - for (j = 0; string_list[j]; j ++) + for (j = 0; string_list[j]; j++) { fprintf(out, "[%2d]: %s\n", j, string_list[j]); } fflush(out); } - diff --git a/winpr/libwinpr/utils/test/TestArrayList.c b/winpr/libwinpr/utils/test/TestArrayList.c index 15266e0bf..0060fd34d 100644 --- a/winpr/libwinpr/utils/test/TestArrayList.c +++ b/winpr/libwinpr/utils/test/TestArrayList.c @@ -18,7 +18,7 @@ int TestArrayList(int argc, char* argv[]) for (index = 0; index < elemsToInsert; index++) { - if (ArrayList_Add(arrayList, (void*) index) < 0) + if (ArrayList_Add(arrayList, (void*)index) < 0) return -1; } @@ -26,41 +26,44 @@ int TestArrayList(int argc, char* argv[]) printf("ArrayList count: %d\n", count); - index = ArrayList_IndexOf(arrayList, (void*) (size_t) 6, -1, -1); + index = ArrayList_IndexOf(arrayList, (void*)(size_t)6, -1, -1); - printf("ArrayList index: %"PRIdz"\n", index); + printf("ArrayList index: %" PRIdz "\n", index); if (index != 6) return -1; - ArrayList_Insert(arrayList, 5, (void*) (size_t) 100); + ArrayList_Insert(arrayList, 5, (void*)(size_t)100); - index = ArrayList_IndexOf(arrayList, (void*) (size_t) 6, -1, -1); - printf("ArrayList index: %"PRIdz"\n", index); + index = ArrayList_IndexOf(arrayList, (void*)(size_t)6, -1, -1); + printf("ArrayList index: %" PRIdz "\n", index); if (index != 7) return -1; - ArrayList_Remove(arrayList, (void*) (size_t) 100); + ArrayList_Remove(arrayList, (void*)(size_t)100); - rc = ArrayList_IndexOf(arrayList, (void*) (size_t) 6, -1, -1); + rc = ArrayList_IndexOf(arrayList, (void*)(size_t)6, -1, -1); printf("ArrayList index: %d\n", rc); if (rc != 6) return -1; - for (index = 0; index < elemsToInsert; index++) { + for (index = 0; index < elemsToInsert; index++) + { val = (size_t)ArrayList_GetItem(arrayList, 0); if (!ArrayList_RemoveAt(arrayList, 0)) return -1; if (val != index) { - printf("ArrayList: shifted %"PRIdz" entries, expected value %"PRIdz", got %"PRIdz"\n", index, index, val); + printf("ArrayList: shifted %" PRIdz " entries, expected value %" PRIdz ", got %" PRIdz + "\n", + index, index, val); return -1; } } - rc = ArrayList_IndexOf(arrayList, (void*) (size_t) elemsToInsert, -1, -1); + rc = ArrayList_IndexOf(arrayList, (void*)(size_t)elemsToInsert, -1, -1); printf("ArrayList index: %d\n", rc); if (rc != -1) return -1; diff --git a/winpr/libwinpr/utils/test/TestBacktrace.c b/winpr/libwinpr/utils/test/TestBacktrace.c index 5df0cdd6d..547b7c4e2 100644 --- a/winpr/libwinpr/utils/test/TestBacktrace.c +++ b/winpr/libwinpr/utils/test/TestBacktrace.c @@ -19,7 +19,7 @@ int TestBacktrace(int argc, char* argv[]) if (msg) { for (x = 0; x < used; x++) - printf("%"PRIuz": %s\n", x, msg[x]); + printf("%" PRIuz ": %s\n", x, msg[x]); rc = 0; } diff --git a/winpr/libwinpr/utils/test/TestBipBuffer.c b/winpr/libwinpr/utils/test/TestBipBuffer.c index 03bc5dad7..e7b38787f 100644 --- a/winpr/libwinpr/utils/test/TestBipBuffer.c +++ b/winpr/libwinpr/utils/test/TestBipBuffer.c @@ -17,7 +17,7 @@ int TestBipBuffer(int argc, char* argv[]) if (data) rc = 0; - fprintf(stderr, "BipBuffer_BufferSize: %"PRIuz"\n", BipBuffer_BufferSize(bb)); + fprintf(stderr, "BipBuffer_BufferSize: %" PRIuz "\n", BipBuffer_BufferSize(bb)); BipBuffer_Free(bb); return rc; } diff --git a/winpr/libwinpr/utils/test/TestBitStream.c b/winpr/libwinpr/utils/test/TestBitStream.c index 7df24a02f..9c5fc8cfd 100644 --- a/winpr/libwinpr/utils/test/TestBitStream.c +++ b/winpr/libwinpr/utils/test/TestBitStream.c @@ -60,20 +60,20 @@ int TestBitStream(int argc, char* argv[]) return 1; BitStream_Attach(bs, buffer, sizeof(buffer)); BitStream_Write_Bits(bs, 0xAF, 8); /* 11110101 */ - BitStream_Write_Bits(bs, 0xF, 4); /* 1111 */ - BitStream_Write_Bits(bs, 0xA, 4); /* 0101 */ + BitStream_Write_Bits(bs, 0xF, 4); /* 1111 */ + BitStream_Write_Bits(bs, 0xA, 4); /* 0101 */ BitStream_Flush(bs); BitDump(__FUNCTION__, WLOG_INFO, buffer, bs->position, BITDUMP_MSB_FIRST); - BitStream_Write_Bits(bs, 3, 2); /* 11 */ - BitStream_Write_Bits(bs, 0, 3); /* 000 */ + BitStream_Write_Bits(bs, 3, 2); /* 11 */ + BitStream_Write_Bits(bs, 0, 3); /* 000 */ BitStream_Write_Bits(bs, 0x2D, 6); /* 101101 */ BitStream_Write_Bits(bs, 0x19, 5); /* 11001 */ - //BitStream_Flush(bs); /* flush should be done automatically here (32 bits written) */ + // BitStream_Flush(bs); /* flush should be done automatically here (32 bits written) */ BitDump(__FUNCTION__, WLOG_INFO, buffer, bs->position, BITDUMP_MSB_FIRST); BitStream_Write_Bits(bs, 3, 2); /* 11 */ BitStream_Flush(bs); BitDump(__FUNCTION__, WLOG_INFO, buffer, bs->position, BITDUMP_MSB_FIRST); - BitStream_Write_Bits(bs, 00, 2); /* 00 */ + BitStream_Write_Bits(bs, 00, 2); /* 00 */ BitStream_Write_Bits(bs, 0xF, 4); /* 1111 */ BitStream_Write_Bits(bs, 0, 20); BitStream_Write_Bits(bs, 0xAFF, 12); /* 111111110101 */ @@ -82,4 +82,3 @@ int TestBitStream(int argc, char* argv[]) BitStream_Free(bs); return 0; } - diff --git a/winpr/libwinpr/utils/test/TestBufferPool.c b/winpr/libwinpr/utils/test/TestBufferPool.c index 046b8d713..ca8411f64 100644 --- a/winpr/libwinpr/utils/test/TestBufferPool.c +++ b/winpr/libwinpr/utils/test/TestBufferPool.c @@ -25,7 +25,8 @@ int TestBufferPool(int argc, char* argv[]) if (BufferSize != DefaultSize) { - printf("BufferPool_GetBufferSize failure: Actual: %d Expected: %"PRIu32"\n", BufferSize, DefaultSize); + printf("BufferPool_GetBufferSize failure: Actual: %d Expected: %" PRIu32 "\n", BufferSize, + DefaultSize); return -1; } @@ -33,7 +34,8 @@ int TestBufferPool(int argc, char* argv[]) if (BufferSize != DefaultSize) { - printf("BufferPool_GetBufferSize failure: Actual: %d Expected: %"PRIu32"\n", BufferSize, DefaultSize); + printf("BufferPool_GetBufferSize failure: Actual: %d Expected: %" PRIu32 "\n", BufferSize, + DefaultSize); return -1; } @@ -51,7 +53,7 @@ int TestBufferPool(int argc, char* argv[]) if (PoolSize != 2) { - printf("BufferPool_GetPoolSize failure: Actual: %"PRIu32" Expected: 2\n", PoolSize); + printf("BufferPool_GetPoolSize failure: Actual: %" PRIu32 " Expected: 2\n", PoolSize); return -1; } @@ -61,4 +63,3 @@ int TestBufferPool(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/utils/test/TestCmdLine.c b/winpr/libwinpr/utils/test/TestCmdLine.c index 4ed536901..e906d4c7b 100644 --- a/winpr/libwinpr/utils/test/TestCmdLine.c +++ b/winpr/libwinpr/utils/test/TestCmdLine.c @@ -4,19 +4,9 @@ #include #include -static const char* testArgv[] = -{ - "mstsc.exe", - "+z", - "/w:1024", - "/h:768", - "/bpp:32", - "/admin", - "/multimon", - "+fonts", - "-wallpaper", - "/v:localhost:3389", - 0 +static const char* testArgv[] = { + "mstsc.exe", "+z", "/w:1024", "/h:768", "/bpp:32", "/admin", "/multimon", + "+fonts", "-wallpaper", "/v:localhost:3389", 0 }; int TestCmdLine(int argc, char* argv[]) @@ -27,47 +17,62 @@ int TestCmdLine(int argc, char* argv[]) long width = 0; long height = 0; COMMAND_LINE_ARGUMENT_A* arg; - int testArgc; - char** command_line; - COMMAND_LINE_ARGUMENT_A args[] = - { - { "v", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "destination server" }, - { "port", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "server port" }, - { "w", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "width" }, - { "h", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "height" }, - { "f", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "fullscreen" }, - { "bpp", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "session bpp (color depth)" }, - { "admin", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, "console", "admin (or console) session" }, - { "multimon", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "multi-monitor" }, - { "a", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, "addin", "addin" }, - { "u", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "username" }, - { "p", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "password" }, - { "d", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "domain" }, - { "z", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "compression" }, - { "audio", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "audio output mode" }, - { "mic", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "audio input (microphone)" }, - { "fonts", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "smooth fonts (cleartype)" }, - { "aero", COMMAND_LINE_VALUE_BOOL, NULL, NULL, BoolValueFalse, -1, NULL, "desktop composition" }, - { "window-drag", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "full window drag" }, - { "menu-anims", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "menu animations" }, - { "themes", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "themes" }, - { "wallpaper", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "wallpaper" }, - { "codec", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "codec" }, - { "nego", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "protocol security negotiation" }, - { "sec", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "force specific protocol security" }, - { "sec-rdp", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "rdp protocol security" }, - { "sec-tls", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "tls protocol security" }, - { "sec-nla", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "nla protocol security" }, - { "sec-ext", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "nla extended protocol security" }, - { "cert-name", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "certificate name" }, - { "cert-ignore", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "ignore certificate" }, - { "version", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_VERSION, NULL, NULL, NULL, -1, NULL, "print version" }, - { "help", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_HELP, NULL, NULL, NULL, -1, "?", "print help" }, - { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } - }; + int testArgc; + char** command_line; + COMMAND_LINE_ARGUMENT_A args[] = { + { "v", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "destination server" }, + { "port", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "server port" }, + { "w", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "width" }, + { "h", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "height" }, + { "f", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "fullscreen" }, + { "bpp", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, + "session bpp (color depth)" }, + { "admin", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, "console", + "admin (or console) session" }, + { "multimon", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "multi-monitor" }, + { "a", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, "addin", "addin" }, + { "u", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "username" }, + { "p", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "password" }, + { "d", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "domain" }, + { "z", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "compression" }, + { "audio", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "audio output mode" }, + { "mic", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "audio input (microphone)" }, + { "fonts", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, + "smooth fonts (cleartype)" }, + { "aero", COMMAND_LINE_VALUE_BOOL, NULL, NULL, BoolValueFalse, -1, NULL, + "desktop composition" }, + { "window-drag", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, + "full window drag" }, + { "menu-anims", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, + "menu animations" }, + { "themes", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "themes" }, + { "wallpaper", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "wallpaper" }, + { "codec", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "codec" }, + { "nego", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, + "protocol security negotiation" }, + { "sec", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, + "force specific protocol security" }, + { "sec-rdp", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, + "rdp protocol security" }, + { "sec-tls", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, + "tls protocol security" }, + { "sec-nla", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, + "nla protocol security" }, + { "sec-ext", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, + "nla extended protocol security" }, + { "cert-name", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, + "certificate name" }, + { "cert-ignore", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "ignore certificate" }, + { "version", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_VERSION, NULL, NULL, NULL, -1, + NULL, "print version" }, + { "help", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_HELP, NULL, NULL, NULL, -1, "?", + "print help" }, + { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } + }; flags = COMMAND_LINE_SIGIL_SLASH | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_SIGIL_PLUS_MINUS; - testArgc = string_list_length(testArgv); + testArgc = string_list_length(testArgv); command_line = string_list_copy(testArgv); if (!command_line) @@ -165,8 +170,7 @@ int TestCmdLine(int argc, char* argv[]) continue; printf("Argument: %s\n", arg->Name); - CommandLineSwitchStart(arg) - CommandLineSwitchCase(arg, "v") + CommandLineSwitchStart(arg) CommandLineSwitchCase(arg, "v") { } CommandLineSwitchCase(arg, "w") @@ -187,17 +191,17 @@ int TestCmdLine(int argc, char* argv[]) { } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); if ((width != 1024) || (height != 768)) { - printf("Unexpected width and height: Actual: (%ldx%ld), Expected: (1024x768)\n", width, height); + printf("Unexpected width and height: Actual: (%ldx%ld), Expected: (1024x768)\n", width, + height); goto out; } ret = 0; out: - string_list_free(command_line); - return ret; + string_list_free(command_line); + return ret; } diff --git a/winpr/libwinpr/utils/test/TestHashTable.c b/winpr/libwinpr/utils/test/TestHashTable.c index 199b46a14..4dcde581f 100644 --- a/winpr/libwinpr/utils/test/TestHashTable.c +++ b/winpr/libwinpr/utils/test/TestHashTable.c @@ -71,7 +71,7 @@ static int test_hash_table_pointer(void) goto fail; } - value = (char*) HashTable_GetItemValue(table, key1); + value = (char*)HashTable_GetItemValue(table, key1); if (strcmp(value, val1) != 0) { @@ -79,7 +79,7 @@ static int test_hash_table_pointer(void) goto fail; } - value = (char*) HashTable_GetItemValue(table, key2); + value = (char*)HashTable_GetItemValue(table, key2); if (strcmp(value, val2) != 0) { @@ -87,7 +87,7 @@ static int test_hash_table_pointer(void) goto fail; } - value = (char*) HashTable_GetItemValue(table, key3); + value = (char*)HashTable_GetItemValue(table, key3); if (strcmp(value, val3) != 0) { @@ -96,7 +96,7 @@ static int test_hash_table_pointer(void) } HashTable_SetItemValue(table, key2, "apple"); - value = (char*) HashTable_GetItemValue(table, key2); + value = (char*)HashTable_GetItemValue(table, key2); if (strcmp(value, "apple") != 0) { @@ -204,7 +204,7 @@ static int test_hash_table_string(void) goto fail; } - value = (char*) HashTable_GetItemValue(table, key1); + value = (char*)HashTable_GetItemValue(table, key1); if (strcmp(value, val1) != 0) { @@ -212,7 +212,7 @@ static int test_hash_table_string(void) goto fail; } - value = (char*) HashTable_GetItemValue(table, key2); + value = (char*)HashTable_GetItemValue(table, key2); if (strcmp(value, val2) != 0) { @@ -220,7 +220,7 @@ static int test_hash_table_string(void) goto fail; } - value = (char*) HashTable_GetItemValue(table, key3); + value = (char*)HashTable_GetItemValue(table, key3); if (strcmp(value, val3) != 0) { @@ -229,7 +229,7 @@ static int test_hash_table_string(void) } HashTable_SetItemValue(table, key2, "apple"); - value = (char*) HashTable_GetItemValue(table, key2); + value = (char*)HashTable_GetItemValue(table, key2); if (strcmp(value, "apple") != 0) { diff --git a/winpr/libwinpr/utils/test/TestImage.c b/winpr/libwinpr/utils/test/TestImage.c index 52f2390fa..e606641ce 100644 --- a/winpr/libwinpr/utils/test/TestImage.c +++ b/winpr/libwinpr/utils/test/TestImage.c @@ -31,7 +31,7 @@ static void* read_image(const char* src, size_t* size) src_size = _ftelli64(fsrc); if (src_size < 0) { - fprintf(stderr, "Invalid file position %"PRId64"\n", src_size); + fprintf(stderr, "Invalid file position %" PRId64 "\n", src_size); goto cleanup; } if (_fseeki64(fsrc, 0, SEEK_SET)) @@ -44,13 +44,13 @@ static void* read_image(const char* src, size_t* size) if (!a) { - fprintf(stderr, "Failed malloc %"PRId64" bytes\n", src_size); + fprintf(stderr, "Failed malloc %" PRId64 " bytes\n", src_size); goto cleanup; } if (fread(a, sizeof(char), (size_t)src_size, fsrc) != (size_t)src_size) { - fprintf(stderr, "Failed read %"PRId64" bytes\n", src_size); + fprintf(stderr, "Failed read %" PRId64 " bytes\n", src_size); goto cleanup; } @@ -100,7 +100,8 @@ static int img_compare(wImage* image, wImage* image2, BOOL ignoreType) if (image->bitsPerPixel != image2->bitsPerPixel) { - fprintf(stderr, "Image bitsPerPixel mismatch %d:%d\n", image->bitsPerPixel, image2->bitsPerPixel); + fprintf(stderr, "Image bitsPerPixel mismatch %d:%d\n", image->bitsPerPixel, + image2->bitsPerPixel); goto cleanup; } @@ -152,7 +153,7 @@ static int create_test(const char* src, const char* dst_png, const char* dst_bmp int status; size_t bsize; void* buffer = NULL; - wImage* image = NULL, *image2 = NULL, *image3 = NULL, *image4 = NULL; + wImage *image = NULL, *image2 = NULL, *image3 = NULL, *image4 = NULL; if (!PathFileExistsA(src)) { @@ -296,4 +297,3 @@ int TestImage(int argc, char* argv[]) int rc = test_image_png_to_bmp(); return rc; } - diff --git a/winpr/libwinpr/utils/test/TestIni.c b/winpr/libwinpr/utils/test/TestIni.c index 307f7fbbc..9734072fd 100644 --- a/winpr/libwinpr/utils/test/TestIni.c +++ b/winpr/libwinpr/utils/test/TestIni.c @@ -2,42 +2,39 @@ #include #include -const char TEST_INI_01[] = - "; This is a sample .ini config file\n" - "\n" - "[first_section]\n" - "one = 1\n" - "five = 5\n" - "animal = BIRD\n" - "\n" - "[second_section]\n" - "path = \"/usr/local/bin\"\n" - "URL = \"http://www.example.com/~username\"\n" - "\n"; +const char TEST_INI_01[] = "; This is a sample .ini config file\n" + "\n" + "[first_section]\n" + "one = 1\n" + "five = 5\n" + "animal = BIRD\n" + "\n" + "[second_section]\n" + "path = \"/usr/local/bin\"\n" + "URL = \"http://www.example.com/~username\"\n" + "\n"; -const char TEST_INI_02[] = - "[FreeRDS]\n" - "prefix=\"/usr/local\"\n" - "bindir=\"bin\"\n" - "sbindir=\"sbin\"\n" - "libdir=\"lib\"\n" - "datarootdir=\"share\"\n" - "localstatedir=\"var\"\n" - "sysconfdir=\"etc\"\n" - "\n"; +const char TEST_INI_02[] = "[FreeRDS]\n" + "prefix=\"/usr/local\"\n" + "bindir=\"bin\"\n" + "sbindir=\"sbin\"\n" + "libdir=\"lib\"\n" + "datarootdir=\"share\"\n" + "localstatedir=\"var\"\n" + "sysconfdir=\"etc\"\n" + "\n"; -const char TEST_INI_03[] = - "[FreeRDS]\n" - "prefix=\"/usr/local\"\n" - "bindir=\"bin\"\n" - "# some illegal string\n" - "sbindir=\"sbin\"\n" - "libdir=\"lib\"\n" - "invalid key-value pair\n" - "datarootdir=\"share\"\n" - "localstatedir=\"var\"\n" - "sysconfdir=\"etc\"\n" - "\n"; +const char TEST_INI_03[] = "[FreeRDS]\n" + "prefix=\"/usr/local\"\n" + "bindir=\"bin\"\n" + "# some illegal string\n" + "sbindir=\"sbin\"\n" + "libdir=\"lib\"\n" + "invalid key-value pair\n" + "datarootdir=\"share\"\n" + "localstatedir=\"var\"\n" + "sysconfdir=\"etc\"\n" + "\n"; int TestIni(int argc, char* argv[]) { @@ -143,4 +140,3 @@ int TestIni(int argc, char* argv[]) IniFile_Free(ini); return 0; } - diff --git a/winpr/libwinpr/utils/test/TestLinkedList.c b/winpr/libwinpr/utils/test/TestLinkedList.c index fe2f72b62..9848bfcb7 100644 --- a/winpr/libwinpr/utils/test/TestLinkedList.c +++ b/winpr/libwinpr/utils/test/TestLinkedList.c @@ -8,9 +8,9 @@ int TestLinkedList(int argc, char* argv[]) int count; wLinkedList* list; list = LinkedList_New(); - LinkedList_AddFirst(list, (void*)(size_t) 1); - LinkedList_AddLast(list, (void*)(size_t) 2); - LinkedList_AddLast(list, (void*)(size_t) 3); + LinkedList_AddFirst(list, (void*)(size_t)1); + LinkedList_AddLast(list, (void*)(size_t)2); + LinkedList_AddLast(list, (void*)(size_t)3); count = LinkedList_Count(list); if (count != 3) @@ -23,12 +23,12 @@ int TestLinkedList(int argc, char* argv[]) while (LinkedList_Enumerator_MoveNext(list)) { - printf("\t%"PRIuz"\n", (size_t) LinkedList_Enumerator_Current(list)); + printf("\t%" PRIuz "\n", (size_t)LinkedList_Enumerator_Current(list)); } printf("\n"); - printf("LinkedList First: %"PRIuz" Last: %"PRIuz"\n", - (size_t) LinkedList_First(list), (size_t) LinkedList_Last(list)); + printf("LinkedList First: %" PRIuz " Last: %" PRIuz "\n", (size_t)LinkedList_First(list), + (size_t)LinkedList_Last(list)); LinkedList_RemoveFirst(list); LinkedList_RemoveLast(list); count = LinkedList_Count(list); @@ -43,12 +43,12 @@ int TestLinkedList(int argc, char* argv[]) while (LinkedList_Enumerator_MoveNext(list)) { - printf("\t%"PRIuz"\n", (size_t) LinkedList_Enumerator_Current(list)); + printf("\t%" PRIuz "\n", (size_t)LinkedList_Enumerator_Current(list)); } printf("\n"); - printf("LinkedList First: %"PRIuz" Last: %"PRIuz"\n", - (size_t) LinkedList_First(list), (size_t) LinkedList_Last(list)); + printf("LinkedList First: %" PRIuz " Last: %" PRIuz "\n", (size_t)LinkedList_First(list), + (size_t)LinkedList_Last(list)); LinkedList_RemoveFirst(list); LinkedList_RemoveLast(list); count = LinkedList_Count(list); @@ -59,9 +59,9 @@ int TestLinkedList(int argc, char* argv[]) return -1; } - LinkedList_AddFirst(list, (void*)(size_t) 4); - LinkedList_AddLast(list, (void*)(size_t) 5); - LinkedList_AddLast(list, (void*)(size_t) 6); + LinkedList_AddFirst(list, (void*)(size_t)4); + LinkedList_AddLast(list, (void*)(size_t)5); + LinkedList_AddLast(list, (void*)(size_t)6); count = LinkedList_Count(list); if (count != 3) @@ -74,23 +74,23 @@ int TestLinkedList(int argc, char* argv[]) while (LinkedList_Enumerator_MoveNext(list)) { - printf("\t%"PRIuz"\n", (size_t) LinkedList_Enumerator_Current(list)); + printf("\t%" PRIuz "\n", (size_t)LinkedList_Enumerator_Current(list)); } printf("\n"); - printf("LinkedList First: %"PRIuz" Last: %"PRIuz"\n", - (size_t) LinkedList_First(list), (size_t) LinkedList_Last(list)); - LinkedList_Remove(list, (void*)(size_t) 5); + printf("LinkedList First: %" PRIuz " Last: %" PRIuz "\n", (size_t)LinkedList_First(list), + (size_t)LinkedList_Last(list)); + LinkedList_Remove(list, (void*)(size_t)5); LinkedList_Enumerator_Reset(list); while (LinkedList_Enumerator_MoveNext(list)) { - printf("\t%"PRIuz"\n", (size_t) LinkedList_Enumerator_Current(list)); + printf("\t%" PRIuz "\n", (size_t)LinkedList_Enumerator_Current(list)); } printf("\n"); - printf("LinkedList First: %"PRIuz" Last: %"PRIuz"\n", - (size_t) LinkedList_First(list), (size_t) LinkedList_Last(list)); + printf("LinkedList First: %" PRIuz " Last: %" PRIuz "\n", (size_t)LinkedList_First(list), + (size_t)LinkedList_Last(list)); LinkedList_Free(list); /* Test enumerator robustness */ /* enumerator on an empty list */ @@ -99,24 +99,23 @@ int TestLinkedList(int argc, char* argv[]) while (LinkedList_Enumerator_MoveNext(list)) { - printf("\terror: %"PRIuz"\n", (size_t) LinkedList_Enumerator_Current(list)); + printf("\terror: %" PRIuz "\n", (size_t)LinkedList_Enumerator_Current(list)); } printf("\n"); LinkedList_Free(list); /* Use an enumerator without reset */ list = LinkedList_New(); - LinkedList_AddFirst(list, (void*)(size_t) 4); - LinkedList_AddLast(list, (void*)(size_t) 5); - LinkedList_AddLast(list, (void*)(size_t) 6); + LinkedList_AddFirst(list, (void*)(size_t)4); + LinkedList_AddLast(list, (void*)(size_t)5); + LinkedList_AddLast(list, (void*)(size_t)6); while (LinkedList_Enumerator_MoveNext(list)) { - printf("\t%"PRIuz"\n", (size_t) LinkedList_Enumerator_Current(list)); + printf("\t%" PRIuz "\n", (size_t)LinkedList_Enumerator_Current(list)); } printf("\n"); LinkedList_Free(list); return 0; } - diff --git a/winpr/libwinpr/utils/test/TestListDictionary.c b/winpr/libwinpr/utils/test/TestListDictionary.c index d0b5545f1..cae264afa 100644 --- a/winpr/libwinpr/utils/test/TestListDictionary.c +++ b/winpr/libwinpr/utils/test/TestListDictionary.c @@ -21,9 +21,8 @@ int TestListDictionary(int argc, char* argv[]) if (!list) return -1; - if (!ListDictionary_Add(list, key1, val1) || - !ListDictionary_Add(list, key2, val2) || - !ListDictionary_Add(list, key3, val3) ) + if (!ListDictionary_Add(list, key1, val1) || !ListDictionary_Add(list, key2, val2) || + !ListDictionary_Add(list, key3, val3)) return -1; count = ListDictionary_Count(list); @@ -64,9 +63,8 @@ int TestListDictionary(int argc, char* argv[]) return -1; } - if (!ListDictionary_Add(list, key1, val1) || - !ListDictionary_Add(list, key2, val2) || - !ListDictionary_Add(list, key3, val3)) + if (!ListDictionary_Add(list, key1, val1) || !ListDictionary_Add(list, key2, val2) || + !ListDictionary_Add(list, key3, val3)) return -1; count = ListDictionary_Count(list); @@ -77,36 +75,36 @@ int TestListDictionary(int argc, char* argv[]) return -1; } - value = (char*) ListDictionary_GetItemValue(list, key1); + value = (char*)ListDictionary_GetItemValue(list, key1); if (strcmp(value, val1) != 0) { - printf("ListDictionary_GetItemValue: Expected : %"PRIuz", Actual: %"PRIuz"\n", - (size_t) val1, (size_t) value); + printf("ListDictionary_GetItemValue: Expected : %" PRIuz ", Actual: %" PRIuz "\n", + (size_t)val1, (size_t)value); return -1; } - value = (char*) ListDictionary_GetItemValue(list, key2); + value = (char*)ListDictionary_GetItemValue(list, key2); if (strcmp(value, val2) != 0) { - printf("ListDictionary_GetItemValue: Expected : %"PRIuz", Actual: %"PRIuz"\n", - (size_t) val2, (size_t) value); + printf("ListDictionary_GetItemValue: Expected : %" PRIuz ", Actual: %" PRIuz "\n", + (size_t)val2, (size_t)value); return -1; } - value = (char*) ListDictionary_GetItemValue(list, key3); + value = (char*)ListDictionary_GetItemValue(list, key3); if (strcmp(value, val3) != 0) { - printf("ListDictionary_GetItemValue: Expected : %"PRIuz", Actual: %"PRIuz"\n", - (size_t) val3, (size_t) value); + printf("ListDictionary_GetItemValue: Expected : %" PRIuz ", Actual: %" PRIuz "\n", + (size_t)val3, (size_t)value); return -1; } ListDictionary_SetItemValue(list, key2, "apple"); - value = (char*) ListDictionary_GetItemValue(list, key2); + value = (char*)ListDictionary_GetItemValue(list, key2); if (strcmp(value, "apple") != 0) { @@ -136,7 +134,8 @@ int TestListDictionary(int argc, char* argv[]) count = ListDictionary_Count(list); if (strncmp(value, val1, 4) || count != 1) { - printf("ListDictionary_Remove_Head: Expected : %s, Actual: %s Count: %d\n", val1, value, count); + printf("ListDictionary_Remove_Head: Expected : %s, Actual: %s Count: %d\n", val1, value, + count); return -1; } @@ -144,7 +143,8 @@ int TestListDictionary(int argc, char* argv[]) count = ListDictionary_Count(list); if (strncmp(value, val3, 4) || count != 0) { - printf("ListDictionary_Remove_Head: Expected : %s, Actual: %s Count: %d\n", val3, value, count); + printf("ListDictionary_Remove_Head: Expected : %s, Actual: %s Count: %d\n", val3, value, + count); return -1; } @@ -156,7 +156,7 @@ int TestListDictionary(int argc, char* argv[]) } if (!ListDictionary_Add(list, key1, val1) || !ListDictionary_Add(list, key2, val2) || - !ListDictionary_Add(list, key3, val3)) + !ListDictionary_Add(list, key3, val3)) return -1; ListDictionary_Clear(list); @@ -173,4 +173,3 @@ int TestListDictionary(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/utils/test/TestMessagePipe.c b/winpr/libwinpr/utils/test/TestMessagePipe.c index fc6b5bc6a..5a0b0ff23 100644 --- a/winpr/libwinpr/utils/test/TestMessagePipe.c +++ b/winpr/libwinpr/utils/test/TestMessagePipe.c @@ -6,14 +6,14 @@ static DWORD WINAPI message_echo_pipe_client_thread(LPVOID arg) { int index = 0; - wMessagePipe* pipe = (wMessagePipe*) arg; + wMessagePipe* pipe = (wMessagePipe*)arg; while (index < 100) { wMessage message; int count; - if (!MessageQueue_Post(pipe->In, NULL, 0, (void*) (size_t) index, NULL)) + if (!MessageQueue_Post(pipe->In, NULL, 0, (void*)(size_t)index, NULL)) break; if (!MessageQueue_Wait(pipe->Out)) @@ -25,7 +25,7 @@ static DWORD WINAPI message_echo_pipe_client_thread(LPVOID arg) if (message.id == WMQ_QUIT) break; - count = (int) (size_t) message.wParam; + count = (int)(size_t)message.wParam; if (count != index) printf("Echo count mismatch: Actual: %d, Expected: %d\n", count, index); @@ -43,7 +43,7 @@ static DWORD WINAPI message_echo_pipe_server_thread(LPVOID arg) wMessage message; wMessagePipe* pipe; - pipe = (wMessagePipe*) arg; + pipe = (wMessagePipe*)arg; while (MessageQueue_Wait(pipe->In)) { @@ -73,13 +73,15 @@ int TestMessagePipe(int argc, char* argv[]) goto out; } - if (!(ClientThread = CreateThread(NULL, 0, message_echo_pipe_client_thread, (void*) EchoPipe, 0, NULL))) + if (!(ClientThread = + CreateThread(NULL, 0, message_echo_pipe_client_thread, (void*)EchoPipe, 0, NULL))) { printf("failed to create client thread\n"); goto out; } - if (!(ServerThread = CreateThread(NULL, 0, message_echo_pipe_server_thread, (void*) EchoPipe, 0, NULL))) + if (!(ServerThread = + CreateThread(NULL, 0, message_echo_pipe_server_thread, (void*)EchoPipe, 0, NULL))) { printf("failed to create server thread\n"); goto out; diff --git a/winpr/libwinpr/utils/test/TestMessageQueue.c b/winpr/libwinpr/utils/test/TestMessageQueue.c index 5825bad36..7b97419e8 100644 --- a/winpr/libwinpr/utils/test/TestMessageQueue.c +++ b/winpr/libwinpr/utils/test/TestMessageQueue.c @@ -8,7 +8,7 @@ static DWORD WINAPI message_queue_consumer_thread(LPVOID arg) wMessage message; wMessageQueue* queue; - queue = (wMessageQueue*) arg; + queue = (wMessageQueue*)arg; while (MessageQueue_Wait(queue)) { @@ -17,7 +17,7 @@ static DWORD WINAPI message_queue_consumer_thread(LPVOID arg) if (message.id == WMQ_QUIT) break; - printf("Message.Type: %"PRIu32"\n", message.id); + printf("Message.Type: %" PRIu32 "\n", message.id); } } @@ -35,7 +35,7 @@ int TestMessageQueue(int argc, char* argv[]) return 1; } - if (!(thread = CreateThread(NULL, 0, message_queue_consumer_thread, (void*) queue, 0, NULL))) + if (!(thread = CreateThread(NULL, 0, message_queue_consumer_thread, (void*)queue, 0, NULL))) { printf("failed to create thread\n"); MessageQueue_Free(queue); @@ -43,10 +43,9 @@ int TestMessageQueue(int argc, char* argv[]) } if (!MessageQueue_Post(queue, NULL, 123, NULL, NULL) || - !MessageQueue_Post(queue, NULL, 456, NULL, NULL) || - !MessageQueue_Post(queue, NULL, 789, NULL, NULL) || - !MessageQueue_PostQuit(queue, 0) || - WaitForSingleObject(thread, INFINITE) != WAIT_OBJECT_0) + !MessageQueue_Post(queue, NULL, 456, NULL, NULL) || + !MessageQueue_Post(queue, NULL, 789, NULL, NULL) || !MessageQueue_PostQuit(queue, 0) || + WaitForSingleObject(thread, INFINITE) != WAIT_OBJECT_0) return -1; MessageQueue_Free(queue); diff --git a/winpr/libwinpr/utils/test/TestPrint.c b/winpr/libwinpr/utils/test/TestPrint.c index 0d35518e7..1073fc95c 100644 --- a/winpr/libwinpr/utils/test/TestPrint.c +++ b/winpr/libwinpr/utils/test/TestPrint.c @@ -34,11 +34,12 @@ int TestPrint(int argc, char* argv[]) a = 15; b = a / 2; - _printf("%d\n",b); - _printf("%3d\n",b); - _printf("%03d\n",b); - c = 15.3f; d = c / 3; - _printf("%3.2f\n",d); + _printf("%d\n", b); + _printf("%3d\n", b); + _printf("%03d\n", b); + c = 15.3f; + d = c / 3; + _printf("%3.2f\n", d); /** * 0 -17.778 diff --git a/winpr/libwinpr/utils/test/TestPubSub.c b/winpr/libwinpr/utils/test/TestPubSub.c index 2156ff0d5..ea3afc557 100644 --- a/winpr/libwinpr/utils/test/TestPubSub.c +++ b/winpr/libwinpr/utils/test/TestPubSub.c @@ -4,15 +4,15 @@ #include DEFINE_EVENT_BEGIN(MouseMotion) - int x; - int y; +int x; +int y; DEFINE_EVENT_END(MouseMotion) DEFINE_EVENT_BEGIN(MouseButton) - int x; - int y; - int flags; - int button; +int x; +int y; +int flags; +int button; DEFINE_EVENT_END(MouseButton) void MouseMotionEventHandler(void* context, MouseMotionEventArgs* e) @@ -25,11 +25,8 @@ void MouseButtonEventHandler(void* context, MouseButtonEventArgs* e) printf("MouseButtonEvent: x: %d y: %d flags: %d button: %d\n", e->x, e->y, e->flags, e->button); } -static wEventType Node_Events[] = -{ - DEFINE_EVENT_ENTRY(MouseMotion) - DEFINE_EVENT_ENTRY(MouseButton) -}; +static wEventType Node_Events[] = { DEFINE_EVENT_ENTRY(MouseMotion) + DEFINE_EVENT_ENTRY(MouseButton) }; #define NODE_EVENT_COUNT (sizeof(Node_Events) / sizeof(wEventType)) @@ -71,4 +68,3 @@ int TestPubSub(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/utils/test/TestQueue.c b/winpr/libwinpr/utils/test/TestQueue.c index 347447e57..c0f9a2012 100644 --- a/winpr/libwinpr/utils/test/TestQueue.c +++ b/winpr/libwinpr/utils/test/TestQueue.c @@ -16,7 +16,7 @@ int TestQueue(int argc, char* argv[]) for (index = 1; index <= 10; index++) { - Queue_Enqueue(queue, (void*) (size_t) index); + Queue_Enqueue(queue, (void*)(size_t)index); } count = Queue_Count(queue); @@ -24,7 +24,7 @@ int TestQueue(int argc, char* argv[]) for (index = 1; index <= 10; index++) { - item = (int) (size_t) Queue_Dequeue(queue); + item = (int)(size_t)Queue_Dequeue(queue); if (item != index) return -1; @@ -33,16 +33,16 @@ int TestQueue(int argc, char* argv[]) count = Queue_Count(queue); printf("queue count: %d\n", count); - Queue_Enqueue(queue, (void*) (size_t) 1); - Queue_Enqueue(queue, (void*) (size_t) 2); - Queue_Enqueue(queue, (void*) (size_t) 3); + Queue_Enqueue(queue, (void*)(size_t)1); + Queue_Enqueue(queue, (void*)(size_t)2); + Queue_Enqueue(queue, (void*)(size_t)3); Queue_Dequeue(queue); Queue_Dequeue(queue); - Queue_Enqueue(queue, (void*) (size_t) 4); - Queue_Enqueue(queue, (void*) (size_t) 5); - Queue_Enqueue(queue, (void*) (size_t) 6); + Queue_Enqueue(queue, (void*)(size_t)4); + Queue_Enqueue(queue, (void*)(size_t)5); + Queue_Enqueue(queue, (void*)(size_t)6); Queue_Dequeue(queue); Queue_Dequeue(queue); diff --git a/winpr/libwinpr/utils/test/TestStream.c b/winpr/libwinpr/utils/test/TestStream.c index 86927ef74..43fa1de8c 100644 --- a/winpr/libwinpr/utils/test/TestStream.c +++ b/winpr/libwinpr/utils/test/TestStream.c @@ -18,56 +18,56 @@ static BOOL TestStream_Verify(wStream* s, size_t mincap, size_t len, size_t pos) if (Stream_Pointer(s) < Stream_Buffer(s)) { - printf("stream pointer (%p) or buffer (%p) is invalid\n", - (void*) Stream_Pointer(s), (void*) Stream_Buffer(s)); + printf("stream pointer (%p) or buffer (%p) is invalid\n", (void*)Stream_Pointer(s), + (void*)Stream_Buffer(s)); return FALSE; } if (Stream_Capacity(s) < mincap) { - printf("stream capacity is %"PRIuz" but minimum expected value is %"PRIuz"\n", + printf("stream capacity is %" PRIuz " but minimum expected value is %" PRIuz "\n", Stream_Capacity(s), mincap); return FALSE; } if (Stream_Length(s) != len) { - printf("stream has unexpected length (%"PRIuz" instead of %"PRIuz")\n", + printf("stream has unexpected length (%" PRIuz " instead of %" PRIuz ")\n", Stream_Length(s), len); return FALSE; } if (Stream_GetPosition(s) != pos) { - printf("stream has unexpected position (%"PRIuz" instead of %"PRIuz")\n", + printf("stream has unexpected position (%" PRIuz " instead of %" PRIuz ")\n", Stream_GetPosition(s), pos); return FALSE; } if (Stream_GetPosition(s) > Stream_Length(s)) { - printf("stream position (%"PRIuz") exceeds length (%"PRIuz")\n", - Stream_GetPosition(s), Stream_Length(s)); + printf("stream position (%" PRIuz ") exceeds length (%" PRIuz ")\n", Stream_GetPosition(s), + Stream_Length(s)); return FALSE; } if (Stream_GetPosition(s) > Stream_Capacity(s)) { - printf("stream position (%"PRIuz") exceeds capacity (%"PRIuz")\n", + printf("stream position (%" PRIuz ") exceeds capacity (%" PRIuz ")\n", Stream_GetPosition(s), Stream_Capacity(s)); return FALSE; } if (Stream_Length(s) > Stream_Capacity(s)) { - printf("stream length (%"PRIuz") exceeds capacity (%"PRIuz")\n", - Stream_Length(s), Stream_Capacity(s)); + printf("stream length (%" PRIuz ") exceeds capacity (%" PRIuz ")\n", Stream_Length(s), + Stream_Capacity(s)); return FALSE; } if (Stream_GetRemainingLength(s) != len - pos) { - printf("stream remaining length (%"PRIuz" instead of %"PRIuz")\n", + printf("stream remaining length (%" PRIuz " instead of %" PRIuz ")\n", Stream_GetRemainingLength(s), len - pos); return FALSE; } @@ -142,14 +142,14 @@ static BOOL TestStream_Create(size_t count, BOOL selfAlloc) { if (!(buffer = malloc(cap))) { - printf("%s: failed to allocate buffer of size %"PRIuz"\n", __FUNCTION__, cap); + printf("%s: failed to allocate buffer of size %" PRIuz "\n", __FUNCTION__, cap); goto fail; } } if (!(s = Stream_New(selfAlloc ? buffer : NULL, len))) { - printf("%s: Stream_New failed for stream #%"PRIuz"\n", __FUNCTION__, i); + printf("%s: Stream_New failed for stream #%" PRIuz "\n", __FUNCTION__, i); goto fail; } @@ -226,7 +226,7 @@ static BOOL TestStream_Extent(UINT32 maxSize) if (!TestStream_Verify(s, i, i, i)) { - printf("%s: failed to verify stream in iteration %"PRIu32"\n", __FUNCTION__, i); + printf("%s: failed to verify stream in iteration %" PRIu32 "\n", __FUNCTION__, i); goto fail; } } @@ -242,51 +242,55 @@ fail: return result; } -#define Stream_Peek_UINT8_BE Stream_Peek_UINT8 -#define Stream_Read_UINT8_BE Stream_Read_UINT8 -#define Stream_Peek_INT8_BE Stream_Peek_INT8 -#define Stream_Read_INT8_BE Stream_Read_INT8 +#define Stream_Peek_UINT8_BE Stream_Peek_UINT8 +#define Stream_Read_UINT8_BE Stream_Read_UINT8 +#define Stream_Peek_INT8_BE Stream_Peek_INT8 +#define Stream_Read_INT8_BE Stream_Read_INT8 -#define TestStream_PeekAndRead(_s, _r, _t) do \ - { \ - _t _a, _b; \ - size_t _i; \ - BYTE* _p = Stream_Buffer(_s); \ - Stream_SetPosition(_s, 0); \ - Stream_Peek_ ## _t(_s, _a); \ - Stream_Read_ ## _t(_s, _b); \ - if (_a != _b) \ - { \ - printf("%s: test1 " #_t "_LE failed\n", __FUNCTION__); \ - _r = FALSE; \ - } \ - for (_i=0; _i> (_i * 8)) & 0xFF) != _p[_i]) { \ - printf("%s: test2 " #_t "_LE failed\n", __FUNCTION__); \ - _r = FALSE; \ - break; \ - } \ - } \ - /* printf("a: 0x%016llX\n", a); */ \ - Stream_SetPosition(_s, 0); \ - Stream_Peek_ ## _t ## _BE(_s, _a); \ - Stream_Read_ ## _t ## _BE(_s, _b); \ - if (_a != _b) \ - { \ - printf("%s: test1 " #_t "_BE failed\n", __FUNCTION__); \ - _r = FALSE; \ - } \ - for (_i=0; _i> (_i * 8)) & 0xFF) != _p[sizeof(_t)-_i-1]) { \ - printf("%s: test2 " #_t "_BE failed\n", __FUNCTION__); \ - _r = FALSE; \ - break; \ - } \ - } \ - /* printf("a: 0x%016llX\n", a); */ \ +#define TestStream_PeekAndRead(_s, _r, _t) \ + do \ + { \ + _t _a, _b; \ + size_t _i; \ + BYTE* _p = Stream_Buffer(_s); \ + Stream_SetPosition(_s, 0); \ + Stream_Peek_##_t(_s, _a); \ + Stream_Read_##_t(_s, _b); \ + if (_a != _b) \ + { \ + printf("%s: test1 " #_t "_LE failed\n", __FUNCTION__); \ + _r = FALSE; \ + } \ + for (_i = 0; _i < sizeof(_t); _i++) \ + { \ + if (((_a >> (_i * 8)) & 0xFF) != _p[_i]) \ + { \ + printf("%s: test2 " #_t "_LE failed\n", __FUNCTION__); \ + _r = FALSE; \ + break; \ + } \ + } \ + /* printf("a: 0x%016llX\n", a); */ \ + Stream_SetPosition(_s, 0); \ + Stream_Peek_##_t##_BE(_s, _a); \ + Stream_Read_##_t##_BE(_s, _b); \ + if (_a != _b) \ + { \ + printf("%s: test1 " #_t "_BE failed\n", __FUNCTION__); \ + _r = FALSE; \ + } \ + for (_i = 0; _i < sizeof(_t); _i++) \ + { \ + if (((_a >> (_i * 8)) & 0xFF) != _p[sizeof(_t) - _i - 1]) \ + { \ + printf("%s: test2 " #_t "_BE failed\n", __FUNCTION__); \ + _r = FALSE; \ + break; \ + } \ + } \ + /* printf("a: 0x%016llX\n", a); */ \ } while (0) - static BOOL TestStream_Reading(void) { BYTE src[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; @@ -677,4 +681,3 @@ int TestStream(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/utils/test/TestStreamPool.c b/winpr/libwinpr/utils/test/TestStreamPool.c index ab8a371e4..45c96e3dc 100644 --- a/winpr/libwinpr/utils/test/TestStreamPool.c +++ b/winpr/libwinpr/utils/test/TestStreamPool.c @@ -98,4 +98,3 @@ int TestStreamPool(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/utils/test/TestVersion.c b/winpr/libwinpr/utils/test/TestVersion.c index 1bd33f345..ed18274a0 100644 --- a/winpr/libwinpr/utils/test/TestVersion.c +++ b/winpr/libwinpr/utils/test/TestVersion.c @@ -48,4 +48,3 @@ int TestVersion(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/utils/test/TestWLog.c b/winpr/libwinpr/utils/test/TestWLog.c index e3fc86d51..bd2d3c608 100644 --- a/winpr/libwinpr/utils/test/TestWLog.c +++ b/winpr/libwinpr/utils/test/TestWLog.c @@ -15,20 +15,20 @@ int TestWLog(int argc, char* argv[]) char* wlog_file = NULL; int result = 1; - if (!(tmp_path = GetKnownPath(KNOWN_PATH_TEMP))) - { - fprintf(stderr, "Failed to get temporary directory!\n"); + if (!(tmp_path = GetKnownPath(KNOWN_PATH_TEMP))) + { + fprintf(stderr, "Failed to get temporary directory!\n"); goto out; - } + } root = WLog_GetRoot(); WLog_SetLogAppenderType(root, WLOG_APPENDER_BINARY); appender = WLog_GetLogAppender(root); - if(!WLog_ConfigureAppender(appender, "outputfilename", "test_w.log")) + if (!WLog_ConfigureAppender(appender, "outputfilename", "test_w.log")) goto out; - if(!WLog_ConfigureAppender(appender, "outputfilepath", tmp_path)) + if (!WLog_ConfigureAppender(appender, "outputfilepath", tmp_path)) goto out; layout = WLog_GetLogLayout(root); diff --git a/winpr/libwinpr/utils/test/TestWLogCallback.c b/winpr/libwinpr/utils/test/TestWLogCallback.c index 378f312cf..f4f4dcbf3 100644 --- a/winpr/libwinpr/utils/test/TestWLogCallback.c +++ b/winpr/libwinpr/utils/test/TestWLogCallback.c @@ -3,37 +3,29 @@ #include #include -typedef struct +typedef struct { UINT32 level; - char *msg; - char *channel; + char* msg; + char* channel; } test_t; +static const char* function = NULL; +static const char* channels[] = { "com.test.channelA", "com.test.channelB" }; -static const char *function = NULL; -static const char *channels[] = -{ - "com.test.channelA", - "com.test.channelB" -}; - -static const test_t messages[] = -{ - {WLOG_INFO, "this is a test", "com.test.channelA"}, - {WLOG_INFO, "Just some info", "com.test.channelB"}, - {WLOG_WARN, "this is a %dnd %s", "com.test.channelA"}, - {WLOG_WARN, "we're warning a %dnd %s", "com.test.channelB"}, - {WLOG_ERROR, "this is an error", "com.test.channelA"}, - {WLOG_ERROR, "we've got an error", "com.test.channelB"}, - {WLOG_TRACE, "this is a trace output", "com.test.channelA"}, - {WLOG_TRACE, "leaving a trace behind", "com.test.channelB"} -}; +static const test_t messages[] = { { WLOG_INFO, "this is a test", "com.test.channelA" }, + { WLOG_INFO, "Just some info", "com.test.channelB" }, + { WLOG_WARN, "this is a %dnd %s", "com.test.channelA" }, + { WLOG_WARN, "we're warning a %dnd %s", "com.test.channelB" }, + { WLOG_ERROR, "this is an error", "com.test.channelA" }, + { WLOG_ERROR, "we've got an error", "com.test.channelB" }, + { WLOG_TRACE, "this is a trace output", "com.test.channelA" }, + { WLOG_TRACE, "leaving a trace behind", "com.test.channelB" } }; static BOOL success = TRUE; static int pos = 0; -static BOOL check(const wLogMessage *msg) +static BOOL check(const wLogMessage* msg) { BOOL rc = TRUE; if (!msg) @@ -58,25 +50,25 @@ static BOOL check(const wLogMessage *msg) return rc; } -BOOL CallbackAppenderMessage(const wLogMessage *msg) +BOOL CallbackAppenderMessage(const wLogMessage* msg) { check(msg); return TRUE; } -BOOL CallbackAppenderData(const wLogMessage *msg) +BOOL CallbackAppenderData(const wLogMessage* msg) { fprintf(stdout, "%s\n", __FUNCTION__); return TRUE; } -BOOL CallbackAppenderImage(const wLogMessage *msg) +BOOL CallbackAppenderImage(const wLogMessage* msg) { fprintf(stdout, "%s\n", __FUNCTION__); return TRUE; } -BOOL CallbackAppenderPackage(const wLogMessage *msg) +BOOL CallbackAppenderPackage(const wLogMessage* msg) { fprintf(stdout, "%s\n", __FUNCTION__); return TRUE; @@ -104,7 +96,7 @@ int TestWLogCallback(int argc, char* argv[]) callbacks.message = CallbackAppenderMessage; callbacks.package = CallbackAppenderPackage; - if (!WLog_ConfigureAppender(appender, "callbacks", (void *)&callbacks)) + if (!WLog_ConfigureAppender(appender, "callbacks", (void*)&callbacks)) return -1; layout = WLog_GetLogLayout(root); @@ -131,4 +123,3 @@ int TestWLogCallback(int argc, char* argv[]) return success ? 0 : -1; } - diff --git a/winpr/libwinpr/utils/trio/strio.h b/winpr/libwinpr/utils/trio/strio.h index d90cfcfd8..4eedf6aa5 100644 --- a/winpr/libwinpr/utils/trio/strio.h +++ b/winpr/libwinpr/utils/trio/strio.h @@ -23,51 +23,52 @@ #define TRIO_STRIO_H #if !(defined(DEBUG) || defined(NDEBUG)) -# define NDEBUG +#define NDEBUG #endif #include "triostr.h" -enum { - STRIO_HASH_NONE = TRIO_HASH_NONE, - STRIO_HASH_PLAIN = TRIO_HASH_PLAIN, - STRIO_HASH_TWOSIGNED = TRIO_HASH_TWOSIGNED +enum +{ + STRIO_HASH_NONE = TRIO_HASH_NONE, + STRIO_HASH_PLAIN = TRIO_HASH_PLAIN, + STRIO_HASH_TWOSIGNED = TRIO_HASH_TWOSIGNED }; #define StrAlloc(n) trio_create(n) -#define StrAppend(x,y) ((void)trio_append((x),(y)),(x)) -#define StrAppendMax(x,n,y) ((void)trio_append_max((x),(n),(y)),(x)) -#define StrContains(x,y) trio_contains((x),(y)) -#define StrCopy(x,y) ((void)trio_copy((x),(y)),(x)) -#define StrCopyMax(x,n,y) ((void)trio_copy_max((x),(n),(y)),(x)) +#define StrAppend(x, y) ((void)trio_append((x), (y)), (x)) +#define StrAppendMax(x, n, y) ((void)trio_append_max((x), (n), (y)), (x)) +#define StrContains(x, y) trio_contains((x), (y)) +#define StrCopy(x, y) ((void)trio_copy((x), (y)), (x)) +#define StrCopyMax(x, n, y) ((void)trio_copy_max((x), (n), (y)), (x)) #define StrDuplicate(x) trio_duplicate(x) -#define StrDuplicateMax(x,n) trio_duplicate((x),(n)) -#define StrEqual(x,y) trio_equal((x),(y)) -#define StrEqualCase(x,y) trio_equal_case((x),(y)) -#define StrEqualCaseMax(x,n,y) trio_equal_case_max((x),(n),(y)) -#define StrEqualLocale(x,y) trio_equal_locale((x),(y)) -#define StrEqualMax(x,n,y) trio_equal_max((x),(n),(y)) +#define StrDuplicateMax(x, n) trio_duplicate((x), (n)) +#define StrEqual(x, y) trio_equal((x), (y)) +#define StrEqualCase(x, y) trio_equal_case((x), (y)) +#define StrEqualCaseMax(x, n, y) trio_equal_case_max((x), (n), (y)) +#define StrEqualLocale(x, y) trio_equal_locale((x), (y)) +#define StrEqualMax(x, n, y) trio_equal_max((x), (n), (y)) #define StrError(n) trio_error(n) #define StrFree(x) trio_destroy(x) #define StrFormat trio_sprintf #define StrFormatAlloc trio_aprintf #define StrFormatAppendMax trio_snprintfcat -#define StrFormatDateMax(x,n,y,t) trio_format_date_max((x),(n),(y),(t)) +#define StrFormatDateMax(x, n, y, t) trio_format_date_max((x), (n), (y), (t)) #define StrFormatMax trio_snprintf -#define StrHash(x,n) trio_hash((x),(n)) -#define StrIndex(x,y) trio_index((x),(y)) -#define StrIndexLast(x,y) trio_index_last((x),(y)) +#define StrHash(x, n) trio_hash((x), (n)) +#define StrIndex(x, y) trio_index((x), (y)) +#define StrIndexLast(x, y) trio_index_last((x), (y)) #define StrLength(x) trio_length((x)) -#define StrMatch(x,y) trio_match((x),(y)) -#define StrMatchCase(x,y) trio_match_case((x),(y)) +#define StrMatch(x, y) trio_match((x), (y)) +#define StrMatchCase(x, y) trio_match_case((x), (y)) #define StrScan trio_sscanf -#define StrSpanFunction(x,f) trio_span_function((x),(f)) -#define StrSubstring(x,y) trio_substring((x),(y)) -#define StrSubstringMax(x,n,y) trio_substring_max((x),(n),(y)) -#define StrToDouble(x,y) trio_to_double((x),(y)) -#define StrToFloat(x,y) trio_to_float((x),(y)) -#define StrTokenize(x,y) trio_tokenize((x),(y)) -#define StrToLong(x,y,n) trio_to_long((x),(y),(n)) -#define StrToUnsignedLong(x,y,n) trio_to_unsigned_long((x),(n),(y)) +#define StrSpanFunction(x, f) trio_span_function((x), (f)) +#define StrSubstring(x, y) trio_substring((x), (y)) +#define StrSubstringMax(x, n, y) trio_substring_max((x), (n), (y)) +#define StrToDouble(x, y) trio_to_double((x), (y)) +#define StrToFloat(x, y) trio_to_float((x), (y)) +#define StrTokenize(x, y) trio_tokenize((x), (y)) +#define StrToLong(x, y, n) trio_to_long((x), (y), (n)) +#define StrToUnsignedLong(x, y, n) trio_to_unsigned_long((x), (n), (y)) #define StrToUpper(x) trio_upper(x) #endif /* TRIO_STRIO_H */ diff --git a/winpr/libwinpr/utils/trio/trio.c b/winpr/libwinpr/utils/trio/trio.c index 2e1bca5cb..58b66613b 100644 --- a/winpr/libwinpr/utils/trio/trio.c +++ b/winpr/libwinpr/utils/trio/trio.c @@ -49,67 +49,67 @@ #include "triop.h" #if defined(TRIO_EMBED_NAN) -# define TRIO_PUBLIC_NAN static -# if TRIO_FEATURE_FLOAT -# define TRIO_FUNC_NAN -# define TRIO_FUNC_NINF -# define TRIO_FUNC_PINF -# define TRIO_FUNC_FPCLASSIFY_AND_SIGNBIT -# define TRIO_FUNC_ISINF -# endif +#define TRIO_PUBLIC_NAN static +#if TRIO_FEATURE_FLOAT +#define TRIO_FUNC_NAN +#define TRIO_FUNC_NINF +#define TRIO_FUNC_PINF +#define TRIO_FUNC_FPCLASSIFY_AND_SIGNBIT +#define TRIO_FUNC_ISINF +#endif #endif #include "trionan.h" #if defined(TRIO_EMBED_STRING) -# define TRIO_PUBLIC_STRING static -# define TRIO_FUNC_LENGTH -# define TRIO_FUNC_LENGTH_MAX -# define TRIO_FUNC_TO_LONG -# if TRIO_FEATURE_LOCALE -# define TRIO_FUNC_COPY_MAX -# endif -# if TRIO_FEATURE_DYNAMICSTRING -# define TRIO_FUNC_XSTRING_DUPLICATE -# endif -# if TRIO_EXTENSION && TRIO_FEATURE_SCANF -# define TRIO_FUNC_EQUAL_LOCALE -# endif -# if TRIO_FEATURE_ERRNO -# define TRIO_FUNC_ERROR -# endif -# if TRIO_FEATURE_FLOAT && TRIO_FEATURE_SCANF -# define TRIO_FUNC_TO_DOUBLE -# endif -# if TRIO_FEATURE_DYNAMICSTRING -# define TRIO_FUNC_STRING_EXTRACT -# endif -# if TRIO_FEATURE_DYNAMICSTRING -# define TRIO_FUNC_STRING_TERMINATE -# endif -# if TRIO_FEATURE_USER_DEFINED -# define TRIO_FUNC_DUPLICATE -# endif -# if TRIO_FEATURE_DYNAMICSTRING -# define TRIO_FUNC_STRING_DESTROY -# endif -# if TRIO_FEATURE_USER_DEFINED -# define TRIO_FUNC_DESTROY -# endif -# if TRIO_FEATURE_USER_DEFINED || (TRIO_FEATURE_FLOAT && TRIO_FEATURE_SCANF) -# define TRIO_FUNC_EQUAL -# endif -# if TRIO_FEATURE_USER_DEFINED || TRIO_FEATURE_SCANF -# define TRIO_FUNC_EQUAL_CASE -# endif -# if (TRIO_EXTENSION && TRIO_FEATURE_SCANF) -# define TRIO_FUNC_EQUAL_MAX -# endif -# if TRIO_FEATURE_SCANF -# define TRIO_FUNC_TO_UPPER -# endif -# if TRIO_FEATURE_DYNAMICSTRING -# define TRIO_FUNC_XSTRING_APPEND_CHAR -# endif +#define TRIO_PUBLIC_STRING static +#define TRIO_FUNC_LENGTH +#define TRIO_FUNC_LENGTH_MAX +#define TRIO_FUNC_TO_LONG +#if TRIO_FEATURE_LOCALE +#define TRIO_FUNC_COPY_MAX +#endif +#if TRIO_FEATURE_DYNAMICSTRING +#define TRIO_FUNC_XSTRING_DUPLICATE +#endif +#if TRIO_EXTENSION && TRIO_FEATURE_SCANF +#define TRIO_FUNC_EQUAL_LOCALE +#endif +#if TRIO_FEATURE_ERRNO +#define TRIO_FUNC_ERROR +#endif +#if TRIO_FEATURE_FLOAT && TRIO_FEATURE_SCANF +#define TRIO_FUNC_TO_DOUBLE +#endif +#if TRIO_FEATURE_DYNAMICSTRING +#define TRIO_FUNC_STRING_EXTRACT +#endif +#if TRIO_FEATURE_DYNAMICSTRING +#define TRIO_FUNC_STRING_TERMINATE +#endif +#if TRIO_FEATURE_USER_DEFINED +#define TRIO_FUNC_DUPLICATE +#endif +#if TRIO_FEATURE_DYNAMICSTRING +#define TRIO_FUNC_STRING_DESTROY +#endif +#if TRIO_FEATURE_USER_DEFINED +#define TRIO_FUNC_DESTROY +#endif +#if TRIO_FEATURE_USER_DEFINED || (TRIO_FEATURE_FLOAT && TRIO_FEATURE_SCANF) +#define TRIO_FUNC_EQUAL +#endif +#if TRIO_FEATURE_USER_DEFINED || TRIO_FEATURE_SCANF +#define TRIO_FUNC_EQUAL_CASE +#endif +#if (TRIO_EXTENSION && TRIO_FEATURE_SCANF) +#define TRIO_FUNC_EQUAL_MAX +#endif +#if TRIO_FEATURE_SCANF +#define TRIO_FUNC_TO_UPPER +#endif +#if TRIO_FEATURE_DYNAMICSTRING +#define TRIO_FUNC_XSTRING_APPEND_CHAR +#endif #endif #include "triostr.h" @@ -121,59 +121,59 @@ #include #if TRIO_FEATURE_FLOAT -# include -# include +#include +#include #endif -#if defined(__STDC_ISO_10646__) || defined(MB_LEN_MAX) || defined(USE_MULTIBYTE) || TRIO_FEATURE_WIDECHAR -# if (!defined(TRIO_PLATFORM_WINCE) && !defined(ANDROID)) -# define TRIO_COMPILER_SUPPORTS_MULTIBYTE -# if !defined(MB_LEN_MAX) -# define MB_LEN_MAX 6 -# endif -# endif +#if defined(__STDC_ISO_10646__) || defined(MB_LEN_MAX) || defined(USE_MULTIBYTE) || \ + TRIO_FEATURE_WIDECHAR +#if (!defined(TRIO_PLATFORM_WINCE) && !defined(ANDROID)) +#define TRIO_COMPILER_SUPPORTS_MULTIBYTE +#if !defined(MB_LEN_MAX) +#define MB_LEN_MAX 6 +#endif +#endif #endif #if (TRIO_COMPILER_VISUALC - 0 >= 1100) || defined(TRIO_COMPILER_BORLAND) -# define TRIO_COMPILER_SUPPORTS_VISUALC_INT +#define TRIO_COMPILER_SUPPORTS_VISUALC_INT #endif #if TRIO_FEATURE_FLOAT -# if defined(PREDEF_STANDARD_C99) \ - || defined(PREDEF_STANDARD_UNIX03) -# if !defined(HAVE_FLOORL) && !defined(TRIO_NO_FLOORL) -# define HAVE_FLOORL -# endif -# if !defined(HAVE_CEILL) && !defined(TRIO_NO_CEILL) -# define HAVE_CEILL -# endif -# if !defined(HAVE_POWL) && !defined(TRIO_NO_POWL) -# define HAVE_POWL -# endif -# if !defined(HAVE_FMODL) && !defined(TRIO_NO_FMODL) -# define HAVE_FMODL -# endif -# if !defined(HAVE_LOG10L) && !defined(TRIO_NO_LOG10L) -# define HAVE_LOG10L -# endif -# endif -# if defined(TRIO_COMPILER_VISUALC) -# if defined(floorl) -# define HAVE_FLOORL -# endif -# if defined(ceill) -# define HAVE_CEILL -# endif -# if defined(powl) -# define HAVE_POWL -# endif -# if defined(fmodl) -# define HAVE_FMODL -# endif -# if defined(log10l) -# define HAVE_LOG10L -# endif -# endif +#if defined(PREDEF_STANDARD_C99) || defined(PREDEF_STANDARD_UNIX03) +#if !defined(HAVE_FLOORL) && !defined(TRIO_NO_FLOORL) +#define HAVE_FLOORL +#endif +#if !defined(HAVE_CEILL) && !defined(TRIO_NO_CEILL) +#define HAVE_CEILL +#endif +#if !defined(HAVE_POWL) && !defined(TRIO_NO_POWL) +#define HAVE_POWL +#endif +#if !defined(HAVE_FMODL) && !defined(TRIO_NO_FMODL) +#define HAVE_FMODL +#endif +#if !defined(HAVE_LOG10L) && !defined(TRIO_NO_LOG10L) +#define HAVE_LOG10L +#endif +#endif +#if defined(TRIO_COMPILER_VISUALC) +#if defined(floorl) +#define HAVE_FLOORL +#endif +#if defined(ceill) +#define HAVE_CEILL +#endif +#if defined(powl) +#define HAVE_POWL +#endif +#if defined(fmodl) +#define HAVE_FMODL +#endif +#if defined(log10l) +#define HAVE_LOG10L +#endif +#endif #endif /************************************************************************* @@ -181,33 +181,33 @@ */ #if !(defined(DEBUG) || defined(NDEBUG)) -# define NDEBUG +#define NDEBUG #endif #include #include #if defined(PREDEF_STANDARD_C99) && !defined(isascii) -# define isascii(x) ((x) & 0x7F) +#define isascii(x) ((x)&0x7F) #endif #if defined(TRIO_COMPILER_ANCIENT) -# include +#include #else -# include +#include #endif #include #if defined(TRIO_PLATFORM_WINCE) extern int errno; #else -# include +#include #endif #ifndef NULL -# define NULL 0 +#define NULL 0 #endif #define NIL ((char)0) #ifndef FALSE -# define FALSE (1 == 0) -# define TRUE (! FALSE) +#define FALSE (1 == 0) +#define TRUE (!FALSE) #endif #define BOOLEAN_T int @@ -215,68 +215,66 @@ extern int errno; #define VALID(x) (NULL != (x)) #if TRIO_FEATURE_ERRORCODE - /* - * Encode the error code and the position. This is decoded - * with TRIO_ERROR_CODE and TRIO_ERROR_POSITION. - */ -# define TRIO_ERROR_RETURN(x,y) (- ((x) + ((y) << 8))) +/* + * Encode the error code and the position. This is decoded + * with TRIO_ERROR_CODE and TRIO_ERROR_POSITION. + */ +#define TRIO_ERROR_RETURN(x, y) (-((x) + ((y) << 8))) #else -# define TRIO_ERROR_RETURN(x,y) (-1) +#define TRIO_ERROR_RETURN(x, y) (-1) #endif typedef unsigned long trio_flags_t; - /************************************************************************* * Platform specific definitions */ #if defined(TRIO_PLATFORM_UNIX) -# include -# include -# include -# if !defined(TRIO_FEATURE_LOCALE) -# define USE_LOCALE -# endif +#include +#include +#include +#if !defined(TRIO_FEATURE_LOCALE) +#define USE_LOCALE +#endif #endif /* TRIO_PLATFORM_UNIX */ #if defined(TRIO_PLATFORM_VMS) -# include +#include #endif #if defined(TRIO_PLATFORM_WIN32) -# if defined(TRIO_PLATFORM_WINCE) -int read(int handle, char *buffer, unsigned int length); -int write(int handle, const char *buffer, unsigned int length); -# else -# include -# define read _read -# define write _write -# endif +#if defined(TRIO_PLATFORM_WINCE) +int read(int handle, char* buffer, unsigned int length); +int write(int handle, const char* buffer, unsigned int length); +#else +#include +#define read _read +#define write _write +#endif #endif /* TRIO_PLATFORM_WIN32 */ #if TRIO_FEATURE_WIDECHAR -# if defined(PREDEF_STANDARD_C94) -# include -# include +#if defined(PREDEF_STANDARD_C94) +#include +#include typedef wchar_t trio_wchar_t; typedef wint_t trio_wint_t; -# else +#else typedef char trio_wchar_t; typedef int trio_wint_t; -# define WCONST(x) L ## x -# define WEOF EOF -# define iswalnum(x) isalnum(x) -# define iswalpha(x) isalpha(x) -# define iswcntrl(x) iscntrl(x) -# define iswdigit(x) isdigit(x) -# define iswgraph(x) isgraph(x) -# define iswlower(x) islower(x) -# define iswprint(x) isprint(x) -# define iswpunct(x) ispunct(x) -# define iswspace(x) isspace(x) -# define iswupper(x) isupper(x) -# define iswxdigit(x) isxdigit(x) -# endif +#define WCONST(x) L##x +#define WEOF EOF +#define iswalnum(x) isalnum(x) +#define iswalpha(x) isalpha(x) +#define iswcntrl(x) iscntrl(x) +#define iswdigit(x) isdigit(x) +#define iswgraph(x) isgraph(x) +#define iswlower(x) islower(x) +#define iswprint(x) isprint(x) +#define iswpunct(x) ispunct(x) +#define iswspace(x) isspace(x) +#define iswupper(x) isupper(x) +#define iswxdigit(x) isxdigit(x) +#endif #endif - /************************************************************************* * Compiler dependent definitions @@ -284,23 +282,23 @@ typedef int trio_wint_t; /* Support for long long */ #ifndef __cplusplus -# if !defined(USE_LONGLONG) -# if defined(TRIO_COMPILER_GCC) && !defined(__STRICT_ANSI__) -# define USE_LONGLONG -# else -# if defined(TRIO_COMPILER_SUNPRO) -# define USE_LONGLONG -# else -# if defined(TRIO_COMPILER_MSVC) && (_MSC_VER >= 1400) -# define USE_LONGLONG -# else -# if defined(_LONG_LONG) || defined(_LONGLONG) -# define USE_LONGLONG -# endif -# endif -# endif -# endif -# endif +#if !defined(USE_LONGLONG) +#if defined(TRIO_COMPILER_GCC) && !defined(__STRICT_ANSI__) +#define USE_LONGLONG +#else +#if defined(TRIO_COMPILER_SUNPRO) +#define USE_LONGLONG +#else +#if defined(TRIO_COMPILER_MSVC) && (_MSC_VER >= 1400) +#define USE_LONGLONG +#else +#if defined(_LONG_LONG) || defined(_LONGLONG) +#define USE_LONGLONG +#endif +#endif +#endif +#endif +#endif #endif /* The extra long numbers */ @@ -308,18 +306,18 @@ typedef int trio_wint_t; typedef signed long long int trio_longlong_t; typedef unsigned long long int trio_ulonglong_t; #else -# if defined(TRIO_COMPILER_SUPPORTS_VISUALC_INT) +#if defined(TRIO_COMPILER_SUPPORTS_VISUALC_INT) typedef signed __int64 trio_longlong_t; typedef unsigned __int64 trio_ulonglong_t; -# else +#else typedef TRIO_SIGNED long int trio_longlong_t; typedef unsigned long int trio_ulonglong_t; -# endif +#endif #endif /* Maximal and fixed integer types */ #if defined(PREDEF_STANDARD_C99) -# include +#include typedef intmax_t trio_intmax_t; typedef uintmax_t trio_uintmax_t; typedef int8_t trio_int8_t; @@ -327,81 +325,81 @@ typedef int16_t trio_int16_t; typedef int32_t trio_int32_t; typedef int64_t trio_int64_t; #else -# if defined(PREDEF_STANDARD_UNIX98) -# include +#if defined(PREDEF_STANDARD_UNIX98) +#include typedef intmax_t trio_intmax_t; typedef uintmax_t trio_uintmax_t; typedef int8_t trio_int8_t; typedef int16_t trio_int16_t; typedef int32_t trio_int32_t; typedef int64_t trio_int64_t; -# else -# if defined(TRIO_COMPILER_SUPPORTS_VISUALC_INT) +#else +#if defined(TRIO_COMPILER_SUPPORTS_VISUALC_INT) typedef trio_longlong_t trio_intmax_t; typedef trio_ulonglong_t trio_uintmax_t; typedef __int8 trio_int8_t; typedef __int16 trio_int16_t; typedef __int32 trio_int32_t; typedef __int64 trio_int64_t; -# else +#else typedef trio_longlong_t trio_intmax_t; typedef trio_ulonglong_t trio_uintmax_t; -# if defined(TRIO_INT8_T) +#if defined(TRIO_INT8_T) typedef TRIO_INT8_T trio_int8_t; -# else +#else typedef TRIO_SIGNED char trio_int8_t; -# endif -# if defined(TRIO_INT16_T) +#endif +#if defined(TRIO_INT16_T) typedef TRIO_INT16_T trio_int16_t; -# else +#else typedef TRIO_SIGNED short trio_int16_t; -# endif -# if defined(TRIO_INT32_T) +#endif +#if defined(TRIO_INT32_T) typedef TRIO_INT32_T trio_int32_t; -# else +#else typedef TRIO_SIGNED int trio_int32_t; -# endif -# if defined(TRIO_INT64_T) +#endif +#if defined(TRIO_INT64_T) typedef TRIO_INT64_T trio_int64_t; -# else +#else typedef trio_longlong_t trio_int64_t; -# endif -# endif -# endif +#endif +#endif +#endif #endif #if defined(HAVE_FLOORL) -# define trio_floor(x) floorl((x)) +#define trio_floor(x) floorl((x)) #else -# define trio_floor(x) floor((double)(x)) +#define trio_floor(x) floor((double)(x)) #endif #if defined(HAVE_CEILL) -# define trio_ceil(x) ceill((x)) +#define trio_ceil(x) ceill((x)) #else -# define trio_ceil(x) ceil((double)(x)) +#define trio_ceil(x) ceil((double)(x)) #endif #if defined(HAVE_FMODL) -# define trio_fmod(x,y) fmodl((x),(y)) +#define trio_fmod(x, y) fmodl((x), (y)) #else -# define trio_fmod(x,y) fmod((double)(x),(double)(y)) +#define trio_fmod(x, y) fmod((double)(x), (double)(y)) #endif #if defined(HAVE_POWL) -# define trio_pow(x,y) powl((x),(y)) +#define trio_pow(x, y) powl((x), (y)) #else -# define trio_pow(x,y) pow((double)(x),(double)(y)) +#define trio_pow(x, y) pow((double)(x), (double)(y)) #endif #if defined(HAVE_LOG10L) -# define trio_log10(x) log10l((x)) +#define trio_log10(x) log10l((x)) #else -# define trio_log10(x) log10((double)(x)) +#define trio_log10(x) log10((double)(x)) #endif #if TRIO_FEATURE_FLOAT -# define TRIO_FABS(x) (((x) < 0.0) ? -(x) : (x)) +#define TRIO_FABS(x) (((x) < 0.0) ? -(x) : (x)) #endif /************************************************************************* @@ -410,34 +408,34 @@ typedef trio_longlong_t trio_int64_t; #ifdef _WIN32 #pragma warning(push) -#pragma warning(disable: 4244) +#pragma warning(disable : 4244) #endif #if TRIO_FEATURE_FLOAT -# if !defined(DECIMAL_DIG) -# define DECIMAL_DIG DBL_DIG -# endif +#if !defined(DECIMAL_DIG) +#define DECIMAL_DIG DBL_DIG +#endif /* Long double sizes */ -# ifdef LDBL_DIG -# define MAX_MANTISSA_DIGITS LDBL_DIG -# define MAX_EXPONENT_DIGITS 4 -# define MAX_DOUBLE_DIGITS LDBL_MAX_10_EXP -# else -# define MAX_MANTISSA_DIGITS DECIMAL_DIG -# define MAX_EXPONENT_DIGITS 3 -# define MAX_DOUBLE_DIGITS DBL_MAX_10_EXP -# endif +#ifdef LDBL_DIG +#define MAX_MANTISSA_DIGITS LDBL_DIG +#define MAX_EXPONENT_DIGITS 4 +#define MAX_DOUBLE_DIGITS LDBL_MAX_10_EXP +#else +#define MAX_MANTISSA_DIGITS DECIMAL_DIG +#define MAX_EXPONENT_DIGITS 3 +#define MAX_DOUBLE_DIGITS DBL_MAX_10_EXP +#endif -# if defined(TRIO_COMPILER_ANCIENT) || !defined(LDBL_DIG) -# undef LDBL_DIG -# undef LDBL_MANT_DIG -# undef LDBL_EPSILON -# define LDBL_DIG DBL_DIG -# define LDBL_MANT_DIG DBL_MANT_DIG -# define LDBL_EPSILON DBL_EPSILON -# endif +#if defined(TRIO_COMPILER_ANCIENT) || !defined(LDBL_DIG) +#undef LDBL_DIG +#undef LDBL_MANT_DIG +#undef LDBL_EPSILON +#define LDBL_DIG DBL_DIG +#define LDBL_MANT_DIG DBL_MANT_DIG +#define LDBL_EPSILON DBL_EPSILON +#endif #endif /* TRIO_FEATURE_FLOAT */ @@ -448,108 +446,109 @@ typedef trio_longlong_t trio_int64_t; #if TRIO_FEATURE_FLOAT /* Infinite and Not-A-Number for floating-point */ -# define INFINITE_LOWER "inf" -# define INFINITE_UPPER "INF" -# define LONG_INFINITE_LOWER "infinite" -# define LONG_INFINITE_UPPER "INFINITE" -# define NAN_LOWER "nan" -# define NAN_UPPER "NAN" +#define INFINITE_LOWER "inf" +#define INFINITE_UPPER "INF" +#define LONG_INFINITE_LOWER "infinite" +#define LONG_INFINITE_UPPER "INFINITE" +#define NAN_LOWER "nan" +#define NAN_UPPER "NAN" #endif /* Various constants */ -enum { - TYPE_PRINT = 1, +enum +{ + TYPE_PRINT = 1, #if TRIO_FEATURE_SCANF - TYPE_SCAN = 2, + TYPE_SCAN = 2, #endif - /* Flags. FLAGS_LAST must be less than ULONG_MAX */ - FLAGS_NEW = 0, - FLAGS_STICKY = 1, - FLAGS_SPACE = 2 * FLAGS_STICKY, - FLAGS_SHOWSIGN = 2 * FLAGS_SPACE, - FLAGS_LEFTADJUST = 2 * FLAGS_SHOWSIGN, - FLAGS_ALTERNATIVE = 2 * FLAGS_LEFTADJUST, - FLAGS_SHORT = 2 * FLAGS_ALTERNATIVE, - FLAGS_SHORTSHORT = 2 * FLAGS_SHORT, - FLAGS_LONG = 2 * FLAGS_SHORTSHORT, - FLAGS_QUAD = 2 * FLAGS_LONG, - FLAGS_LONGDOUBLE = 2 * FLAGS_QUAD, - FLAGS_SIZE_T = 2 * FLAGS_LONGDOUBLE, - FLAGS_PTRDIFF_T = 2 * FLAGS_SIZE_T, - FLAGS_INTMAX_T = 2 * FLAGS_PTRDIFF_T, - FLAGS_NILPADDING = 2 * FLAGS_INTMAX_T, - FLAGS_UNSIGNED = 2 * FLAGS_NILPADDING, - FLAGS_UPPER = 2 * FLAGS_UNSIGNED, - FLAGS_WIDTH = 2 * FLAGS_UPPER, - FLAGS_WIDTH_PARAMETER = 2 * FLAGS_WIDTH, - FLAGS_PRECISION = 2 * FLAGS_WIDTH_PARAMETER, - FLAGS_PRECISION_PARAMETER = 2 * FLAGS_PRECISION, - FLAGS_BASE = 2 * FLAGS_PRECISION_PARAMETER, - FLAGS_BASE_PARAMETER = 2 * FLAGS_BASE, - FLAGS_FLOAT_E = 2 * FLAGS_BASE_PARAMETER, - FLAGS_FLOAT_G = 2 * FLAGS_FLOAT_E, - FLAGS_QUOTE = 2 * FLAGS_FLOAT_G, - FLAGS_WIDECHAR = 2 * FLAGS_QUOTE, - FLAGS_IGNORE = 2 * FLAGS_WIDECHAR, - FLAGS_IGNORE_PARAMETER = 2 * FLAGS_IGNORE, - FLAGS_VARSIZE_PARAMETER = 2 * FLAGS_IGNORE_PARAMETER, - FLAGS_FIXED_SIZE = 2 * FLAGS_VARSIZE_PARAMETER, - FLAGS_LAST = FLAGS_FIXED_SIZE, - /* Reused flags */ - FLAGS_EXCLUDE = FLAGS_SHORT, - FLAGS_USER_DEFINED = FLAGS_IGNORE, - FLAGS_USER_DEFINED_PARAMETER = FLAGS_IGNORE_PARAMETER, - FLAGS_ROUNDING = FLAGS_INTMAX_T, - /* Compounded flags */ - FLAGS_ALL_VARSIZES = FLAGS_LONG | FLAGS_QUAD | FLAGS_INTMAX_T | FLAGS_PTRDIFF_T | FLAGS_SIZE_T, - FLAGS_ALL_SIZES = FLAGS_ALL_VARSIZES | FLAGS_SHORTSHORT | FLAGS_SHORT, + /* Flags. FLAGS_LAST must be less than ULONG_MAX */ + FLAGS_NEW = 0, + FLAGS_STICKY = 1, + FLAGS_SPACE = 2 * FLAGS_STICKY, + FLAGS_SHOWSIGN = 2 * FLAGS_SPACE, + FLAGS_LEFTADJUST = 2 * FLAGS_SHOWSIGN, + FLAGS_ALTERNATIVE = 2 * FLAGS_LEFTADJUST, + FLAGS_SHORT = 2 * FLAGS_ALTERNATIVE, + FLAGS_SHORTSHORT = 2 * FLAGS_SHORT, + FLAGS_LONG = 2 * FLAGS_SHORTSHORT, + FLAGS_QUAD = 2 * FLAGS_LONG, + FLAGS_LONGDOUBLE = 2 * FLAGS_QUAD, + FLAGS_SIZE_T = 2 * FLAGS_LONGDOUBLE, + FLAGS_PTRDIFF_T = 2 * FLAGS_SIZE_T, + FLAGS_INTMAX_T = 2 * FLAGS_PTRDIFF_T, + FLAGS_NILPADDING = 2 * FLAGS_INTMAX_T, + FLAGS_UNSIGNED = 2 * FLAGS_NILPADDING, + FLAGS_UPPER = 2 * FLAGS_UNSIGNED, + FLAGS_WIDTH = 2 * FLAGS_UPPER, + FLAGS_WIDTH_PARAMETER = 2 * FLAGS_WIDTH, + FLAGS_PRECISION = 2 * FLAGS_WIDTH_PARAMETER, + FLAGS_PRECISION_PARAMETER = 2 * FLAGS_PRECISION, + FLAGS_BASE = 2 * FLAGS_PRECISION_PARAMETER, + FLAGS_BASE_PARAMETER = 2 * FLAGS_BASE, + FLAGS_FLOAT_E = 2 * FLAGS_BASE_PARAMETER, + FLAGS_FLOAT_G = 2 * FLAGS_FLOAT_E, + FLAGS_QUOTE = 2 * FLAGS_FLOAT_G, + FLAGS_WIDECHAR = 2 * FLAGS_QUOTE, + FLAGS_IGNORE = 2 * FLAGS_WIDECHAR, + FLAGS_IGNORE_PARAMETER = 2 * FLAGS_IGNORE, + FLAGS_VARSIZE_PARAMETER = 2 * FLAGS_IGNORE_PARAMETER, + FLAGS_FIXED_SIZE = 2 * FLAGS_VARSIZE_PARAMETER, + FLAGS_LAST = FLAGS_FIXED_SIZE, + /* Reused flags */ + FLAGS_EXCLUDE = FLAGS_SHORT, + FLAGS_USER_DEFINED = FLAGS_IGNORE, + FLAGS_USER_DEFINED_PARAMETER = FLAGS_IGNORE_PARAMETER, + FLAGS_ROUNDING = FLAGS_INTMAX_T, + /* Compounded flags */ + FLAGS_ALL_VARSIZES = FLAGS_LONG | FLAGS_QUAD | FLAGS_INTMAX_T | FLAGS_PTRDIFF_T | FLAGS_SIZE_T, + FLAGS_ALL_SIZES = FLAGS_ALL_VARSIZES | FLAGS_SHORTSHORT | FLAGS_SHORT, - NO_POSITION = -1, - NO_WIDTH = 0, - NO_PRECISION = -1, - NO_SIZE = -1, + NO_POSITION = -1, + NO_WIDTH = 0, + NO_PRECISION = -1, + NO_SIZE = -1, - /* Do not change these */ - NO_BASE = -1, - MIN_BASE = 2, - MAX_BASE = 36, - BASE_BINARY = 2, - BASE_OCTAL = 8, - BASE_DECIMAL = 10, - BASE_HEX = 16, + /* Do not change these */ + NO_BASE = -1, + MIN_BASE = 2, + MAX_BASE = 36, + BASE_BINARY = 2, + BASE_OCTAL = 8, + BASE_DECIMAL = 10, + BASE_HEX = 16, - /* Maximal number of allowed parameters */ - MAX_PARAMETERS = 64, - /* Maximal number of characters in class */ - MAX_CHARACTER_CLASS = UCHAR_MAX + 1, + /* Maximal number of allowed parameters */ + MAX_PARAMETERS = 64, + /* Maximal number of characters in class */ + MAX_CHARACTER_CLASS = UCHAR_MAX + 1, #if TRIO_FEATURE_USER_DEFINED - /* Maximal string lengths for user-defined specifiers */ - MAX_USER_NAME = 64, - MAX_USER_DATA = 256, + /* Maximal string lengths for user-defined specifiers */ + MAX_USER_NAME = 64, + MAX_USER_DATA = 256, #endif - - /* Maximal length of locale separator strings */ - MAX_LOCALE_SEPARATOR_LENGTH = MB_LEN_MAX, - /* Maximal number of integers in grouping */ - MAX_LOCALE_GROUPS = 64 + + /* Maximal length of locale separator strings */ + MAX_LOCALE_SEPARATOR_LENGTH = MB_LEN_MAX, + /* Maximal number of integers in grouping */ + MAX_LOCALE_GROUPS = 64 }; #define NO_GROUPING ((int)CHAR_MAX) /* Fundamental formatting parameter types */ -#define FORMAT_SENTINEL -1 /* marks end of parameters array */ -#define FORMAT_UNKNOWN 0 -#define FORMAT_INT 1 -#define FORMAT_DOUBLE 2 -#define FORMAT_CHAR 3 -#define FORMAT_STRING 4 -#define FORMAT_POINTER 5 -#define FORMAT_COUNT 6 +#define FORMAT_SENTINEL -1 /* marks end of parameters array */ +#define FORMAT_UNKNOWN 0 +#define FORMAT_INT 1 +#define FORMAT_DOUBLE 2 +#define FORMAT_CHAR 3 +#define FORMAT_STRING 4 +#define FORMAT_POINTER 5 +#define FORMAT_COUNT 6 #define FORMAT_PARAMETER 7 -#define FORMAT_GROUP 8 -#define FORMAT_ERRNO 9 +#define FORMAT_GROUP 8 +#define FORMAT_ERRNO 9 #define FORMAT_USER_DEFINED 10 /* Character constants */ @@ -561,18 +560,18 @@ enum { #if TRIO_EXTENSION /* Character class expressions */ -# define CLASS_ALNUM "[:alnum:]" -# define CLASS_ALPHA "[:alpha:]" -# define CLASS_BLANK "[:blank:]" -# define CLASS_CNTRL "[:cntrl:]" -# define CLASS_DIGIT "[:digit:]" -# define CLASS_GRAPH "[:graph:]" -# define CLASS_LOWER "[:lower:]" -# define CLASS_PRINT "[:print:]" -# define CLASS_PUNCT "[:punct:]" -# define CLASS_SPACE "[:space:]" -# define CLASS_UPPER "[:upper:]" -# define CLASS_XDIGIT "[:xdigit:]" +#define CLASS_ALNUM "[:alnum:]" +#define CLASS_ALPHA "[:alpha:]" +#define CLASS_BLANK "[:blank:]" +#define CLASS_CNTRL "[:cntrl:]" +#define CLASS_DIGIT "[:digit:]" +#define CLASS_GRAPH "[:graph:]" +#define CLASS_LOWER "[:lower:]" +#define CLASS_PRINT "[:print:]" +#define CLASS_PUNCT "[:punct:]" +#define CLASS_SPACE "[:space:]" +#define CLASS_UPPER "[:upper:]" +#define CLASS_XDIGIT "[:xdigit:]" #endif /* @@ -616,35 +615,35 @@ enum { #define SPECIFIER_HEX 'x' #define SPECIFIER_HEX_UPPER 'X' #if TRIO_FEATURE_FLOAT -# define SPECIFIER_FLOAT_E 'e' -# define SPECIFIER_FLOAT_E_UPPER 'E' -# define SPECIFIER_FLOAT_F 'f' -# define SPECIFIER_FLOAT_F_UPPER 'F' -# define SPECIFIER_FLOAT_G 'g' -# define SPECIFIER_FLOAT_G_UPPER 'G' +#define SPECIFIER_FLOAT_E 'e' +#define SPECIFIER_FLOAT_E_UPPER 'E' +#define SPECIFIER_FLOAT_F 'f' +#define SPECIFIER_FLOAT_F_UPPER 'F' +#define SPECIFIER_FLOAT_G 'g' +#define SPECIFIER_FLOAT_G_UPPER 'G' #endif #define SPECIFIER_POINTER 'p' #if TRIO_FEATURE_SCANF -# define SPECIFIER_GROUP '[' -# define SPECIFIER_UNGROUP ']' +#define SPECIFIER_GROUP '[' +#define SPECIFIER_UNGROUP ']' #endif #define SPECIFIER_COUNT 'n' #if TRIO_UNIX98 -# define SPECIFIER_CHAR_UPPER 'C' -# define SPECIFIER_STRING_UPPER 'S' +#define SPECIFIER_CHAR_UPPER 'C' +#define SPECIFIER_STRING_UPPER 'S' #endif #define SPECIFIER_HEXFLOAT 'a' #define SPECIFIER_HEXFLOAT_UPPER 'A' #define SPECIFIER_ERRNO 'm' #if TRIO_FEATURE_BINARY -# define SPECIFIER_BINARY 'b' -# define SPECIFIER_BINARY_UPPER 'B' +#define SPECIFIER_BINARY 'b' +#define SPECIFIER_BINARY_UPPER 'B' #endif #if TRIO_FEATURE_USER_DEFINED -# define SPECIFIER_USER_DEFINED_BEGIN '<' -# define SPECIFIER_USER_DEFINED_END '>' -# define SPECIFIER_USER_DEFINED_SEPARATOR ':' -# define SPECIFIER_USER_DEFINED_EXTRA '|' +#define SPECIFIER_USER_DEFINED_BEGIN '<' +#define SPECIFIER_USER_DEFINED_END '>' +#define SPECIFIER_USER_DEFINED_SEPARATOR ':' +#define SPECIFIER_USER_DEFINED_EXTRA '|' #endif /* @@ -753,7 +752,7 @@ enum { #define QUALIFIER_QUAD 'q' #define QUALIFIER_SIZE_T_UPPER 'Z' #if TRIO_MISC -# define QUALIFIER_WIDECHAR 'w' +#define QUALIFIER_WIDECHAR 'w' #endif #define QUALIFIER_FIXED_SIZE 'I' #define QUALIFIER_QUOTE '\'' @@ -761,12 +760,11 @@ enum { #define QUALIFIER_VARSIZE '&' /* This should remain undocumented */ #define QUALIFIER_ROUNDING_UPPER 'R' #if TRIO_EXTENSION -# define QUALIFIER_PARAM '@' /* Experimental */ -# define QUALIFIER_COLON ':' /* For scanlists */ -# define QUALIFIER_EQUAL '=' /* For scanlists */ +#define QUALIFIER_PARAM '@' /* Experimental */ +#define QUALIFIER_COLON ':' /* For scanlists */ +#define QUALIFIER_EQUAL '=' /* For scanlists */ #endif - /************************************************************************* * * Internal Structures @@ -774,125 +772,130 @@ enum { *************************************************************************/ /* Parameters */ -typedef struct { - /* An indication of which entry in the data union is used */ - int type; - /* The flags */ - trio_flags_t flags; - /* The width qualifier */ - int width; - /* The precision qualifier */ - int precision; - /* The base qualifier */ - int base; - /* Base from specifier */ - int baseSpecifier; - /* The size for the variable size qualifier */ - int varsize; - /* Offset of the first character of the specifier */ - int beginOffset; - /* Offset of the first character after the specifier */ - int endOffset; - /* Position in the argument list that this parameter refers to */ - int position; - /* The data from the argument list */ - union { - char *string; +typedef struct +{ + /* An indication of which entry in the data union is used */ + int type; + /* The flags */ + trio_flags_t flags; + /* The width qualifier */ + int width; + /* The precision qualifier */ + int precision; + /* The base qualifier */ + int base; + /* Base from specifier */ + int baseSpecifier; + /* The size for the variable size qualifier */ + int varsize; + /* Offset of the first character of the specifier */ + int beginOffset; + /* Offset of the first character after the specifier */ + int endOffset; + /* Position in the argument list that this parameter refers to */ + int position; + /* The data from the argument list */ + union { + char* string; #if TRIO_FEATURE_WIDECHAR - trio_wchar_t *wstring; + trio_wchar_t* wstring; #endif - trio_pointer_t pointer; - union { - trio_intmax_t as_signed; - trio_uintmax_t as_unsigned; - } number; + trio_pointer_t pointer; + union { + trio_intmax_t as_signed; + trio_uintmax_t as_unsigned; + } number; #if TRIO_FEATURE_FLOAT - double doubleNumber; - double *doublePointer; - trio_long_double_t longdoubleNumber; - trio_long_double_t *longdoublePointer; + double doubleNumber; + double* doublePointer; + trio_long_double_t longdoubleNumber; + trio_long_double_t* longdoublePointer; #endif - int errorNumber; - } data; + int errorNumber; + } data; #if TRIO_FEATURE_USER_DEFINED - /* For the user-defined specifier */ - union { - char namespace[MAX_USER_NAME]; - int handler; /* if flags & FLAGS_USER_DEFINED_PARAMETER */ - } user_defined; - char user_data[MAX_USER_DATA]; + /* For the user-defined specifier */ + union { + char namespace[MAX_USER_NAME]; + int handler; /* if flags & FLAGS_USER_DEFINED_PARAMETER */ + } user_defined; + char user_data[MAX_USER_DATA]; #endif } trio_parameter_t; /* Container for customized functions */ -typedef struct { - union { - trio_outstream_t out; - trio_instream_t in; - } stream; - trio_pointer_t closure; +typedef struct +{ + union { + trio_outstream_t out; + trio_instream_t in; + } stream; + trio_pointer_t closure; } trio_custom_t; /* General trio "class" */ -typedef struct _trio_class_t { - /* - * The function to write characters to a stream. - */ - void (*OutStream) TRIO_PROTO((struct _trio_class_t *, int)); - /* - * The function to read characters from a stream. - */ - void (*InStream) TRIO_PROTO((struct _trio_class_t *, int *)); - /* - * The function to undo read characters from a stream. - */ - void (*UndoStream) TRIO_PROTO((struct _trio_class_t *)); - /* - * The current location in the stream. - */ - trio_pointer_t location; - /* - * The character currently being processed. - */ - int current; - /* - * The number of characters that would have been written/read - * if there had been sufficient space. - */ - int processed; - union { - /* - * The number of characters that are actually written. Processed and - * committed will only differ for the *nprintf functions. - */ - int committed; - /* - * The number of look-ahead characters read. - */ - int cached; - } actually; - /* - * The upper limit of characters that may be written/read. - */ - int max; - /* - * The last output error that was detected. - */ - int error; +typedef struct _trio_class_t +{ + /* + * The function to write characters to a stream. + */ + void(*OutStream) TRIO_PROTO((struct _trio_class_t*, int)); + /* + * The function to read characters from a stream. + */ + void(*InStream) TRIO_PROTO((struct _trio_class_t*, int*)); + /* + * The function to undo read characters from a stream. + */ + void(*UndoStream) TRIO_PROTO((struct _trio_class_t*)); + /* + * The current location in the stream. + */ + trio_pointer_t location; + /* + * The character currently being processed. + */ + int current; + /* + * The number of characters that would have been written/read + * if there had been sufficient space. + */ + int processed; + union { + /* + * The number of characters that are actually written. Processed and + * committed will only differ for the *nprintf functions. + */ + int committed; + /* + * The number of look-ahead characters read. + */ + int cached; + } actually; + /* + * The upper limit of characters that may be written/read. + */ + int max; + /* + * The last output error that was detected. + */ + int error; } trio_class_t; /* References (for user-defined callbacks) */ -typedef struct _trio_reference_t { - trio_class_t *data; - trio_parameter_t *parameter; +typedef struct _trio_reference_t +{ + trio_class_t* data; + trio_parameter_t* parameter; } trio_reference_t; #if TRIO_FEATURE_USER_DEFINED /* Registered entries (for user-defined callbacks) */ -typedef struct _trio_userdef_t { - struct _trio_userdef_t *next; - trio_callback_t callback; - char *name; +typedef struct _trio_userdef_t +{ + struct _trio_userdef_t* next; + trio_callback_t callback; + char* name; } trio_userdef_t; #endif @@ -910,15 +913,15 @@ typedef struct _trio_userdef_t { * to resolves macro definitions that includes type 'long double', * e.g: va_arg(arg_ptr, long double) */ -# if defined(TRIO_PLATFORM_MPEIX) +#if defined(TRIO_PLATFORM_MPEIX) static TRIO_CONST trio_long_double_t ___dummy_long_double = 0; -# endif +#endif #endif static TRIO_CONST char internalNullString[] = "(nil)"; #if defined(USE_LOCALE) -static struct lconv *internalLocaleValues = NULL; +static struct lconv* internalLocaleValues = NULL; #endif /* @@ -941,19 +944,18 @@ static TRIO_CONST char internalDigitsUpper[] = "0123456789ABCDEFGHIJKLMNOPQRSTUV #if TRIO_FEATURE_SCANF static BOOLEAN_T internalDigitsUnconverted = TRUE; static int internalDigitArray[128]; -# if TRIO_EXTENSION +#if TRIO_EXTENSION static BOOLEAN_T internalCollationUnconverted = TRUE; static char internalCollationArray[MAX_CHARACTER_CLASS][MAX_CHARACTER_CLASS]; -# endif +#endif #endif #if TRIO_FEATURE_USER_DEFINED static TRIO_VOLATILE trio_callback_t internalEnterCriticalRegion = NULL; static TRIO_VOLATILE trio_callback_t internalLeaveCriticalRegion = NULL; -static trio_userdef_t *internalUserDef = NULL; +static trio_userdef_t* internalUserDef = NULL; #endif - /************************************************************************* * * Internal Functions @@ -961,11 +963,11 @@ static trio_userdef_t *internalUserDef = NULL; ************************************************************************/ #if defined(TRIO_EMBED_NAN) -# include "trionan.c" +#include "trionan.c" #endif #if defined(TRIO_EMBED_STRING) -# include "triostr.c" +#include "triostr.c" #endif /************************************************************************* @@ -974,25 +976,22 @@ static trio_userdef_t *internalUserDef = NULL; * Description: * Initialize a trio_parameter_t struct. */ -TRIO_PRIVATE void -TrioInitializeParameter -TRIO_ARGS1((parameter), - trio_parameter_t *parameter) +TRIO_PRIVATE void TrioInitializeParameter TRIO_ARGS1((parameter), trio_parameter_t* parameter) { - parameter->type = FORMAT_UNKNOWN; - parameter->flags = 0; - parameter->width = 0; - parameter->precision = 0; - parameter->base = 0; - parameter->baseSpecifier = 0; - parameter->varsize = 0; - parameter->beginOffset = 0; - parameter->endOffset = 0; - parameter->position = 0; - parameter->data.pointer = 0; + parameter->type = FORMAT_UNKNOWN; + parameter->flags = 0; + parameter->width = 0; + parameter->precision = 0; + parameter->base = 0; + parameter->baseSpecifier = 0; + parameter->varsize = 0; + parameter->beginOffset = 0; + parameter->endOffset = 0; + parameter->position = 0; + parameter->data.pointer = 0; #if TRIO_FEATURE_USER_DEFINED - parameter->user_defined.handler = 0; - parameter->user_data[0] = 0; + parameter->user_defined.handler = 0; + parameter->user_data[0] = 0; #endif } @@ -1002,36 +1001,33 @@ TRIO_ARGS1((parameter), * Description: * Copies one trio_parameter_t struct to another. */ -TRIO_PRIVATE void -TrioCopyParameter -TRIO_ARGS2((target, source), - trio_parameter_t *target, - TRIO_CONST trio_parameter_t *source) +TRIO_PRIVATE void TrioCopyParameter TRIO_ARGS2((target, source), trio_parameter_t* target, + TRIO_CONST trio_parameter_t* source) { #if TRIO_FEATURE_USER_DEFINED - size_t i; + size_t i; #endif - target->type = source->type; - target->flags = source->flags; - target->width = source->width; - target->precision = source->precision; - target->base = source->base; - target->baseSpecifier = source->baseSpecifier; - target->varsize = source->varsize; - target->beginOffset = source->beginOffset; - target->endOffset = source->endOffset; - target->position = source->position; - target->data = source->data; + target->type = source->type; + target->flags = source->flags; + target->width = source->width; + target->precision = source->precision; + target->base = source->base; + target->baseSpecifier = source->baseSpecifier; + target->varsize = source->varsize; + target->beginOffset = source->beginOffset; + target->endOffset = source->endOffset; + target->position = source->position; + target->data = source->data; #if TRIO_FEATURE_USER_DEFINED - target->user_defined = source->user_defined; + target->user_defined = source->user_defined; - for (i = 0U; i < sizeof(target->user_data); ++i) - { - if ((target->user_data[i] = source->user_data[i]) == NIL) - break; - } + for (i = 0U; i < sizeof(target->user_data); ++i) + { + if ((target->user_data[i] = source->user_data[i]) == NIL) + break; + } #endif } @@ -1042,163 +1038,157 @@ TRIO_ARGS2((target, source), * Remember to add all new qualifiers to this function. * QUALIFIER_POSITION must not be added. */ -TRIO_PRIVATE BOOLEAN_T -TrioIsQualifier -TRIO_ARGS1((character), - TRIO_CONST char character) +TRIO_PRIVATE BOOLEAN_T TrioIsQualifier TRIO_ARGS1((character), TRIO_CONST char character) { - /* QUALIFIER_POSITION is not included */ - switch (character) - { - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - case QUALIFIER_PLUS: - case QUALIFIER_MINUS: - case QUALIFIER_SPACE: - case QUALIFIER_DOT: - case QUALIFIER_STAR: - case QUALIFIER_ALTERNATIVE: - case QUALIFIER_SHORT: - case QUALIFIER_LONG: - case QUALIFIER_CIRCUMFLEX: - case QUALIFIER_LONG_UPPER: - case QUALIFIER_SIZE_T: - case QUALIFIER_PTRDIFF_T: - case QUALIFIER_INTMAX_T: - case QUALIFIER_QUAD: - case QUALIFIER_SIZE_T_UPPER: + /* QUALIFIER_POSITION is not included */ + switch (character) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case QUALIFIER_PLUS: + case QUALIFIER_MINUS: + case QUALIFIER_SPACE: + case QUALIFIER_DOT: + case QUALIFIER_STAR: + case QUALIFIER_ALTERNATIVE: + case QUALIFIER_SHORT: + case QUALIFIER_LONG: + case QUALIFIER_CIRCUMFLEX: + case QUALIFIER_LONG_UPPER: + case QUALIFIER_SIZE_T: + case QUALIFIER_PTRDIFF_T: + case QUALIFIER_INTMAX_T: + case QUALIFIER_QUAD: + case QUALIFIER_SIZE_T_UPPER: #if defined(QUALIFIER_WIDECHAR) - case QUALIFIER_WIDECHAR: + case QUALIFIER_WIDECHAR: #endif - case QUALIFIER_QUOTE: - case QUALIFIER_STICKY: - case QUALIFIER_VARSIZE: + case QUALIFIER_QUOTE: + case QUALIFIER_STICKY: + case QUALIFIER_VARSIZE: #if defined(QUALIFIER_PARAM) - case QUALIFIER_PARAM: + case QUALIFIER_PARAM: #endif - case QUALIFIER_FIXED_SIZE: - case QUALIFIER_ROUNDING_UPPER: - return TRUE; - default: - return FALSE; - } + case QUALIFIER_FIXED_SIZE: + case QUALIFIER_ROUNDING_UPPER: + return TRUE; + default: + return FALSE; + } } /************************************************************************* * TrioSetLocale */ #if defined(USE_LOCALE) -TRIO_PRIVATE void -TrioSetLocale(TRIO_NOARGS) +TRIO_PRIVATE void TrioSetLocale(TRIO_NOARGS) { - internalLocaleValues = (struct lconv *)localeconv(); - if (internalLocaleValues) - { - if ((internalLocaleValues->decimal_point) && - (internalLocaleValues->decimal_point[0] != NIL)) + internalLocaleValues = (struct lconv*)localeconv(); + if (internalLocaleValues) { - internalDecimalPointLength = trio_length(internalLocaleValues->decimal_point); - if (internalDecimalPointLength == 1) - { - internalDecimalPoint = internalLocaleValues->decimal_point[0]; - } - else - { - internalDecimalPoint = NIL; - trio_copy_max(internalDecimalPointString, - sizeof(internalDecimalPointString), - internalLocaleValues->decimal_point); - } + if ((internalLocaleValues->decimal_point) && + (internalLocaleValues->decimal_point[0] != NIL)) + { + internalDecimalPointLength = trio_length(internalLocaleValues->decimal_point); + if (internalDecimalPointLength == 1) + { + internalDecimalPoint = internalLocaleValues->decimal_point[0]; + } + else + { + internalDecimalPoint = NIL; + trio_copy_max(internalDecimalPointString, sizeof(internalDecimalPointString), + internalLocaleValues->decimal_point); + } + } +#if TRIO_EXTENSION + if ((internalLocaleValues->thousands_sep) && + (internalLocaleValues->thousands_sep[0] != NIL)) + { + trio_copy_max(internalThousandSeparator, sizeof(internalThousandSeparator), + internalLocaleValues->thousands_sep); + internalThousandSeparatorLength = trio_length(internalThousandSeparator); + } +#endif +#if TRIO_EXTENSION + if ((internalLocaleValues->grouping) && (internalLocaleValues->grouping[0] != NIL)) + { + trio_copy_max(internalGrouping, sizeof(internalGrouping), + internalLocaleValues->grouping); + } +#endif } -# if TRIO_EXTENSION - if ((internalLocaleValues->thousands_sep) && - (internalLocaleValues->thousands_sep[0] != NIL)) - { - trio_copy_max(internalThousandSeparator, - sizeof(internalThousandSeparator), - internalLocaleValues->thousands_sep); - internalThousandSeparatorLength = trio_length(internalThousandSeparator); - } -# endif -# if TRIO_EXTENSION - if ((internalLocaleValues->grouping) && - (internalLocaleValues->grouping[0] != NIL)) - { - trio_copy_max(internalGrouping, - sizeof(internalGrouping), - internalLocaleValues->grouping); - } -# endif - } } #endif /* defined(USE_LOCALE) */ #if TRIO_FEATURE_FLOAT && TRIO_FEATURE_QUOTE -TRIO_PRIVATE int -TrioCalcThousandSeparatorLength -TRIO_ARGS1((digits), - int digits) +TRIO_PRIVATE int TrioCalcThousandSeparatorLength TRIO_ARGS1((digits), int digits) { - int count = 0; - int step = NO_GROUPING; - char *groupingPointer = internalGrouping; + int count = 0; + int step = NO_GROUPING; + char* groupingPointer = internalGrouping; - while (digits > 0) - { - if (*groupingPointer == CHAR_MAX) + while (digits > 0) { - /* Disable grouping */ - break; /* while */ + if (*groupingPointer == CHAR_MAX) + { + /* Disable grouping */ + break; /* while */ + } + else if (*groupingPointer == 0) + { + /* Repeat last group */ + if (step == NO_GROUPING) + { + /* Error in locale */ + break; /* while */ + } + } + else + { + step = *groupingPointer++; + } + if (digits > step) + count += internalThousandSeparatorLength; + digits -= step; } - else if (*groupingPointer == 0) - { - /* Repeat last group */ - if (step == NO_GROUPING) - { - /* Error in locale */ - break; /* while */ - } - } - else - { - step = *groupingPointer++; - } - if (digits > step) - count += internalThousandSeparatorLength; - digits -= step; - } - return count; + return count; } #endif /* TRIO_FEATURE_FLOAT && TRIO_FEATURE_QUOTE */ #if TRIO_FEATURE_QUOTE -TRIO_PRIVATE BOOLEAN_T -TrioFollowedBySeparator -TRIO_ARGS1((position), - int position) +TRIO_PRIVATE BOOLEAN_T TrioFollowedBySeparator TRIO_ARGS1((position), int position) { - int step = 0; - char *groupingPointer = internalGrouping; + int step = 0; + char* groupingPointer = internalGrouping; - position--; - if (position == 0) - return FALSE; - while (position > 0) - { - if (*groupingPointer == CHAR_MAX) + position--; + if (position == 0) + return FALSE; + while (position > 0) { - /* Disable grouping */ - break; /* while */ + if (*groupingPointer == CHAR_MAX) + { + /* Disable grouping */ + break; /* while */ + } + else if (*groupingPointer != 0) + { + step = *groupingPointer++; + } + if (step == 0) + break; + position -= step; } - else if (*groupingPointer != 0) - { - step = *groupingPointer++; - } - if (step == 0) - break; - position -= step; - } - return (position == 0); + return (position == 0); } #endif /* TRIO_FEATURE_QUOTE */ @@ -1207,30 +1197,27 @@ TRIO_ARGS1((position), * * Get the %n$ position. */ -TRIO_PRIVATE int -TrioGetPosition -TRIO_ARGS2((format, offsetPointer), - TRIO_CONST char *format, - int *offsetPointer) +TRIO_PRIVATE int TrioGetPosition TRIO_ARGS2((format, offsetPointer), TRIO_CONST char* format, + int* offsetPointer) { #if TRIO_FEATURE_POSITIONAL - char *tmpformat; - int number = 0; - int offset = *offsetPointer; + char* tmpformat; + int number = 0; + int offset = *offsetPointer; - number = (int)trio_to_long(&format[offset], &tmpformat, BASE_DECIMAL); - offset = (int)(tmpformat - format); - if ((number != 0) && (QUALIFIER_POSITION == format[offset++])) - { - *offsetPointer = offset; - /* - * number is decreased by 1, because n$ starts from 1, whereas - * the array it is indexing starts from 0. - */ - return number - 1; - } + number = (int)trio_to_long(&format[offset], &tmpformat, BASE_DECIMAL); + offset = (int)(tmpformat - format); + if ((number != 0) && (QUALIFIER_POSITION == format[offset++])) + { + *offsetPointer = offset; + /* + * number is decreased by 1, because n$ starts from 1, whereas + * the array it is indexing starts from 0. + */ + return number - 1; + } #endif - return NO_POSITION; + return NO_POSITION; } /************************************************************************* @@ -1240,31 +1227,28 @@ TRIO_ARGS2((format, offsetPointer), * The prev argument is used for optimization only. */ #if TRIO_FEATURE_USER_DEFINED -TRIO_PRIVATE trio_userdef_t * -TrioFindNamespace -TRIO_ARGS2((name, prev), - TRIO_CONST char *name, - trio_userdef_t **prev) +TRIO_PRIVATE trio_userdef_t* TrioFindNamespace TRIO_ARGS2((name, prev), TRIO_CONST char* name, + trio_userdef_t** prev) { - trio_userdef_t *def; - - if (internalEnterCriticalRegion) - (void)internalEnterCriticalRegion(NULL); - - for (def = internalUserDef; def; def = def->next) - { - /* Case-sensitive string comparison */ - if (trio_equal_case(def->name, name)) - break; - - if (prev) - *prev = def; - } - - if (internalLeaveCriticalRegion) - (void)internalLeaveCriticalRegion(NULL); - - return def; + trio_userdef_t* def; + + if (internalEnterCriticalRegion) + (void)internalEnterCriticalRegion(NULL); + + for (def = internalUserDef; def; def = def->next) + { + /* Case-sensitive string comparison */ + if (trio_equal_case(def->name, name)) + break; + + if (prev) + *prev = def; + } + + if (internalLeaveCriticalRegion) + (void)internalLeaveCriticalRegion(NULL); + + return def; } #endif @@ -1275,61 +1259,55 @@ TRIO_ARGS2((name, prev), * Calculate pow(base, exponent), where number and exponent are integers. */ #if TRIO_FEATURE_FLOAT -TRIO_PRIVATE trio_long_double_t -TrioPower -TRIO_ARGS2((number, exponent), - int number, - int exponent) +TRIO_PRIVATE trio_long_double_t TrioPower TRIO_ARGS2((number, exponent), int number, int exponent) { - trio_long_double_t result; + trio_long_double_t result; - if (number == 10) - { - switch (exponent) + if (number == 10) { - /* Speed up calculation of common cases */ - case 0: - result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E-1); - break; - case 1: - result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E+0); - break; - case 2: - result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E+1); - break; - case 3: - result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E+2); - break; - case 4: - result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E+3); - break; - case 5: - result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E+4); - break; - case 6: - result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E+5); - break; - case 7: - result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E+6); - break; - case 8: - result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E+7); - break; - case 9: - result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E+8); - break; - default: - result = trio_pow((trio_long_double_t)number, - (trio_long_double_t)exponent); - break; + switch (exponent) + { + /* Speed up calculation of common cases */ + case 0: + result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E-1); + break; + case 1: + result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E+0); + break; + case 2: + result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E+1); + break; + case 3: + result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E+2); + break; + case 4: + result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E+3); + break; + case 5: + result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E+4); + break; + case 6: + result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E+5); + break; + case 7: + result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E+6); + break; + case 8: + result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E+7); + break; + case 9: + result = (trio_long_double_t)number * TRIO_SUFFIX_LONG(1E+8); + break; + default: + result = trio_pow((trio_long_double_t)number, (trio_long_double_t)exponent); + break; + } } - } - else - { - return trio_pow((trio_long_double_t)number, - (trio_long_double_t)exponent); - } - return result; + else + { + return trio_pow((trio_long_double_t)number, (trio_long_double_t)exponent); + } + return result; } #endif /* TRIO_FEATURE_FLOAT */ @@ -1337,31 +1315,28 @@ TRIO_ARGS2((number, exponent), * TrioLogarithm */ #if TRIO_FEATURE_FLOAT -TRIO_PRIVATE trio_long_double_t -TrioLogarithm -TRIO_ARGS2((number, base), - trio_long_double_t number, - int base) +TRIO_PRIVATE trio_long_double_t TrioLogarithm TRIO_ARGS2((number, base), trio_long_double_t number, + int base) { - trio_long_double_t result; + trio_long_double_t result; - if (number <= 0.0) - { - /* xlC crashes on log(0) */ - result = (number == 0.0) ? trio_ninf() : trio_nan(); - } - else - { - if (base == 10) + if (number <= 0.0) { - result = trio_log10(number); + /* xlC crashes on log(0) */ + result = (number == 0.0) ? trio_ninf() : trio_nan(); } - else + else { - result = trio_log10(number) / trio_log10((double)base); + if (base == 10) + { + result = trio_log10(number); + } + else + { + result = trio_log10(number) / trio_log10((double)base); + } } - } - return result; + return result; } #endif /* TRIO_FEATURE_FLOAT */ @@ -1369,19 +1344,21 @@ TRIO_ARGS2((number, base), * TrioLogarithmBase */ #if TRIO_FEATURE_FLOAT -TRIO_PRIVATE double -TrioLogarithmBase -TRIO_ARGS1((base), - int base) +TRIO_PRIVATE double TrioLogarithmBase TRIO_ARGS1((base), int base) { - switch (base) - { - case BASE_BINARY : return 1.0; - case BASE_OCTAL : return 3.0; - case BASE_DECIMAL: return 3.321928094887362345; - case BASE_HEX : return 4.0; - default : return TrioLogarithm((double)base, 2); - } + switch (base) + { + case BASE_BINARY: + return 1.0; + case BASE_OCTAL: + return 3.0; + case BASE_DECIMAL: + return 3.321928094887362345; + case BASE_HEX: + return 4.0; + default: + return TrioLogarithm((double)base, 2); + } } #endif /* TRIO_FEATURE_FLOAT */ @@ -1393,301 +1370,294 @@ TRIO_ARGS1((base), */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" -TRIO_PRIVATE int -TrioParseQualifiers -TRIO_ARGS4((type, format, offset, parameter), - int type, - TRIO_CONST char *format, - int offset, - trio_parameter_t *parameter) +TRIO_PRIVATE int TrioParseQualifiers TRIO_ARGS4((type, format, offset, parameter), int type, + TRIO_CONST char* format, int offset, + trio_parameter_t* parameter) { - char ch; - int dots = 0; /* Count number of dots in modifier part */ - char *tmpformat; + char ch; + int dots = 0; /* Count number of dots in modifier part */ + char* tmpformat; - parameter->beginOffset = offset - 1; - parameter->flags = FLAGS_NEW; - parameter->position = TrioGetPosition(format, &offset); + parameter->beginOffset = offset - 1; + parameter->flags = FLAGS_NEW; + parameter->position = TrioGetPosition(format, &offset); - /* Default values */ - parameter->width = NO_WIDTH; - parameter->precision = NO_PRECISION; - parameter->base = NO_BASE; - parameter->varsize = NO_SIZE; + /* Default values */ + parameter->width = NO_WIDTH; + parameter->precision = NO_PRECISION; + parameter->base = NO_BASE; + parameter->varsize = NO_SIZE; - while (TrioIsQualifier(format[offset])) - { - ch = format[offset++]; + while (TrioIsQualifier(format[offset])) + { + ch = format[offset++]; - switch (ch) - { - case QUALIFIER_SPACE: - parameter->flags |= FLAGS_SPACE; - break; + switch (ch) + { + case QUALIFIER_SPACE: + parameter->flags |= FLAGS_SPACE; + break; - case QUALIFIER_PLUS: - parameter->flags |= FLAGS_SHOWSIGN; - break; + case QUALIFIER_PLUS: + parameter->flags |= FLAGS_SHOWSIGN; + break; - case QUALIFIER_MINUS: - parameter->flags |= FLAGS_LEFTADJUST; - parameter->flags &= ~FLAGS_NILPADDING; - break; + case QUALIFIER_MINUS: + parameter->flags |= FLAGS_LEFTADJUST; + parameter->flags &= ~FLAGS_NILPADDING; + break; - case QUALIFIER_ALTERNATIVE: - parameter->flags |= FLAGS_ALTERNATIVE; - break; + case QUALIFIER_ALTERNATIVE: + parameter->flags |= FLAGS_ALTERNATIVE; + break; - case QUALIFIER_DOT: - if (dots == 0) /* Precision */ - { - dots++; + case QUALIFIER_DOT: + if (dots == 0) /* Precision */ + { + dots++; - /* Skip if no precision */ - if (QUALIFIER_DOT == format[offset]) - break; + /* Skip if no precision */ + if (QUALIFIER_DOT == format[offset]) + break; - /* After the first dot we have the precision */ - parameter->flags |= FLAGS_PRECISION; - if ((QUALIFIER_STAR == format[offset]) + /* After the first dot we have the precision */ + parameter->flags |= FLAGS_PRECISION; + if ((QUALIFIER_STAR == format[offset]) #if defined(QUALIFIER_PARAM) - || (QUALIFIER_PARAM == format[offset]) + || (QUALIFIER_PARAM == format[offset]) #endif - ) - { - offset++; - parameter->flags |= FLAGS_PRECISION_PARAMETER; - parameter->precision = TrioGetPosition(format, &offset); - } - else - { - parameter->precision = trio_to_long(&format[offset], - &tmpformat, - BASE_DECIMAL); - offset = (int)(tmpformat - format); - } - } - else if (dots == 1) /* Base */ - { - dots++; + ) + { + offset++; + parameter->flags |= FLAGS_PRECISION_PARAMETER; + parameter->precision = TrioGetPosition(format, &offset); + } + else + { + parameter->precision = + trio_to_long(&format[offset], &tmpformat, BASE_DECIMAL); + offset = (int)(tmpformat - format); + } + } + else if (dots == 1) /* Base */ + { + dots++; - /* After the second dot we have the base */ - parameter->flags |= FLAGS_BASE; - if ((QUALIFIER_STAR == format[offset]) + /* After the second dot we have the base */ + parameter->flags |= FLAGS_BASE; + if ((QUALIFIER_STAR == format[offset]) #if defined(QUALIFIER_PARAM) - || (QUALIFIER_PARAM == format[offset]) + || (QUALIFIER_PARAM == format[offset]) #endif - ) - { - offset++; - parameter->flags |= FLAGS_BASE_PARAMETER; - parameter->base = TrioGetPosition(format, &offset); - } - else - { - parameter->base = trio_to_long(&format[offset], - &tmpformat, - BASE_DECIMAL); - if (parameter->base > MAX_BASE) - return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); - offset = (int)(tmpformat - format); - } - } - else - { - return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); - } - break; /* QUALIFIER_DOT */ + ) + { + offset++; + parameter->flags |= FLAGS_BASE_PARAMETER; + parameter->base = TrioGetPosition(format, &offset); + } + else + { + parameter->base = trio_to_long(&format[offset], &tmpformat, BASE_DECIMAL); + if (parameter->base > MAX_BASE) + return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); + offset = (int)(tmpformat - format); + } + } + else + { + return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); + } + break; /* QUALIFIER_DOT */ #if defined(QUALIFIER_PARAM) - case QUALIFIER_PARAM: - parameter->type = TYPE_PRINT; - /* FALLTHROUGH */ + case QUALIFIER_PARAM: + parameter->type = TYPE_PRINT; + /* FALLTHROUGH */ #endif - case QUALIFIER_STAR: - /* This has different meanings for print and scan */ - if (TYPE_PRINT == type) - { - /* Read with from parameter */ - int width = TrioGetPosition(format, &offset); - parameter->flags |= (FLAGS_WIDTH | FLAGS_WIDTH_PARAMETER); - if (NO_POSITION != width) - parameter->width = width; - /* else keep parameter->width = NO_WIDTH which != NO_POSITION */ - } + case QUALIFIER_STAR: + /* This has different meanings for print and scan */ + if (TYPE_PRINT == type) + { + /* Read with from parameter */ + int width = TrioGetPosition(format, &offset); + parameter->flags |= (FLAGS_WIDTH | FLAGS_WIDTH_PARAMETER); + if (NO_POSITION != width) + parameter->width = width; + /* else keep parameter->width = NO_WIDTH which != NO_POSITION */ + } #if TRIO_FEATURE_SCANF - else - { - /* Scan, but do not store result */ - parameter->flags |= FLAGS_IGNORE; - } + else + { + /* Scan, but do not store result */ + parameter->flags |= FLAGS_IGNORE; + } #endif - break; /* QUALIFIER_STAR */ + break; /* QUALIFIER_STAR */ - case '0': - if (! (parameter->flags & FLAGS_LEFTADJUST)) - parameter->flags |= FLAGS_NILPADDING; - /* FALLTHROUGH */ - case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - parameter->flags |= FLAGS_WIDTH; - /* - * &format[offset - 1] is used to "rewind" the read - * character from format - */ - parameter->width = trio_to_long(&format[offset - 1], - &tmpformat, - BASE_DECIMAL); - offset = (int)(tmpformat - format); - break; + case '0': + if (!(parameter->flags & FLAGS_LEFTADJUST)) + parameter->flags |= FLAGS_NILPADDING; + /* FALLTHROUGH */ + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + parameter->flags |= FLAGS_WIDTH; + /* + * &format[offset - 1] is used to "rewind" the read + * character from format + */ + parameter->width = trio_to_long(&format[offset - 1], &tmpformat, BASE_DECIMAL); + offset = (int)(tmpformat - format); + break; - case QUALIFIER_SHORT: - if (parameter->flags & FLAGS_SHORTSHORT) - return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); - else if (parameter->flags & FLAGS_SHORT) - parameter->flags |= FLAGS_SHORTSHORT; - else - parameter->flags |= FLAGS_SHORT; - break; + case QUALIFIER_SHORT: + if (parameter->flags & FLAGS_SHORTSHORT) + return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); + else if (parameter->flags & FLAGS_SHORT) + parameter->flags |= FLAGS_SHORTSHORT; + else + parameter->flags |= FLAGS_SHORT; + break; - case QUALIFIER_LONG: - if (parameter->flags & FLAGS_QUAD) - return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); - else if (parameter->flags & FLAGS_LONG) - parameter->flags |= FLAGS_QUAD; - else - parameter->flags |= FLAGS_LONG; - break; + case QUALIFIER_LONG: + if (parameter->flags & FLAGS_QUAD) + return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); + else if (parameter->flags & FLAGS_LONG) + parameter->flags |= FLAGS_QUAD; + else + parameter->flags |= FLAGS_LONG; + break; #if TRIO_FEATURE_LONGDOUBLE - case QUALIFIER_LONG_UPPER: - parameter->flags |= FLAGS_LONGDOUBLE; - break; + case QUALIFIER_LONG_UPPER: + parameter->flags |= FLAGS_LONGDOUBLE; + break; #endif #if TRIO_FEATURE_SIZE_T - case QUALIFIER_SIZE_T: - parameter->flags |= FLAGS_SIZE_T; - /* Modify flags for later truncation of number */ - if (sizeof(size_t) == sizeof(trio_ulonglong_t)) - parameter->flags |= FLAGS_QUAD; - else if (sizeof(size_t) == sizeof(long)) - parameter->flags |= FLAGS_LONG; - break; + case QUALIFIER_SIZE_T: + parameter->flags |= FLAGS_SIZE_T; + /* Modify flags for later truncation of number */ + if (sizeof(size_t) == sizeof(trio_ulonglong_t)) + parameter->flags |= FLAGS_QUAD; + else if (sizeof(size_t) == sizeof(long)) + parameter->flags |= FLAGS_LONG; + break; #endif #if TRIO_FEATURE_PTRDIFF_T - case QUALIFIER_PTRDIFF_T: - parameter->flags |= FLAGS_PTRDIFF_T; - if (sizeof(ptrdiff_t) == sizeof(trio_ulonglong_t)) - parameter->flags |= FLAGS_QUAD; - else if (sizeof(ptrdiff_t) == sizeof(long)) - parameter->flags |= FLAGS_LONG; - break; + case QUALIFIER_PTRDIFF_T: + parameter->flags |= FLAGS_PTRDIFF_T; + if (sizeof(ptrdiff_t) == sizeof(trio_ulonglong_t)) + parameter->flags |= FLAGS_QUAD; + else if (sizeof(ptrdiff_t) == sizeof(long)) + parameter->flags |= FLAGS_LONG; + break; #endif #if TRIO_FEATURE_INTMAX_T - case QUALIFIER_INTMAX_T: - parameter->flags |= FLAGS_INTMAX_T; - if (sizeof(trio_intmax_t) == sizeof(trio_ulonglong_t)) - parameter->flags |= FLAGS_QUAD; - else if (sizeof(trio_intmax_t) == sizeof(long)) - parameter->flags |= FLAGS_LONG; - break; + case QUALIFIER_INTMAX_T: + parameter->flags |= FLAGS_INTMAX_T; + if (sizeof(trio_intmax_t) == sizeof(trio_ulonglong_t)) + parameter->flags |= FLAGS_QUAD; + else if (sizeof(trio_intmax_t) == sizeof(long)) + parameter->flags |= FLAGS_LONG; + break; #endif #if TRIO_FEATURE_QUAD - case QUALIFIER_QUAD: - parameter->flags |= FLAGS_QUAD; - break; + case QUALIFIER_QUAD: + parameter->flags |= FLAGS_QUAD; + break; #endif #if TRIO_FEATURE_FIXED_SIZE - case QUALIFIER_FIXED_SIZE: - if (parameter->flags & FLAGS_FIXED_SIZE) - return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); + case QUALIFIER_FIXED_SIZE: + if (parameter->flags & FLAGS_FIXED_SIZE) + return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); - if (parameter->flags & (FLAGS_ALL_SIZES | - FLAGS_LONGDOUBLE | - FLAGS_WIDECHAR | - FLAGS_VARSIZE_PARAMETER)) - return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); + if (parameter->flags & + (FLAGS_ALL_SIZES | FLAGS_LONGDOUBLE | FLAGS_WIDECHAR | FLAGS_VARSIZE_PARAMETER)) + return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); - if ((format[offset] == '6') && - (format[offset + 1] == '4')) - { - parameter->varsize = sizeof(trio_int64_t); - offset += 2; - } - else if ((format[offset] == '3') && - (format[offset + 1] == '2')) - { - parameter->varsize = sizeof(trio_int32_t); - offset += 2; - } - else if ((format[offset] == '1') && - (format[offset + 1] == '6')) - { - parameter->varsize = sizeof(trio_int16_t); - offset += 2; - } - else if (format[offset] == '8') - { - parameter->varsize = sizeof(trio_int8_t); - offset++; - } - else - return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); + if ((format[offset] == '6') && (format[offset + 1] == '4')) + { + parameter->varsize = sizeof(trio_int64_t); + offset += 2; + } + else if ((format[offset] == '3') && (format[offset + 1] == '2')) + { + parameter->varsize = sizeof(trio_int32_t); + offset += 2; + } + else if ((format[offset] == '1') && (format[offset + 1] == '6')) + { + parameter->varsize = sizeof(trio_int16_t); + offset += 2; + } + else if (format[offset] == '8') + { + parameter->varsize = sizeof(trio_int8_t); + offset++; + } + else + return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); - parameter->flags |= FLAGS_FIXED_SIZE; - break; + parameter->flags |= FLAGS_FIXED_SIZE; + break; #endif /* TRIO_FEATURE_FIXED_SIZE */ #if defined(QUALIFIER_WIDECHAR) - case QUALIFIER_WIDECHAR: - parameter->flags |= FLAGS_WIDECHAR; - break; + case QUALIFIER_WIDECHAR: + parameter->flags |= FLAGS_WIDECHAR; + break; #endif #if TRIO_FEATURE_SIZE_T_UPPER - case QUALIFIER_SIZE_T_UPPER: - break; + case QUALIFIER_SIZE_T_UPPER: + break; #endif #if TRIO_FEATURE_QUOTE - case QUALIFIER_QUOTE: - parameter->flags |= FLAGS_QUOTE; - break; + case QUALIFIER_QUOTE: + parameter->flags |= FLAGS_QUOTE; + break; #endif #if TRIO_FEATURE_STICKY - case QUALIFIER_STICKY: - parameter->flags |= FLAGS_STICKY; - break; + case QUALIFIER_STICKY: + parameter->flags |= FLAGS_STICKY; + break; #endif #if TRIO_FEATURE_VARSIZE - case QUALIFIER_VARSIZE: - parameter->flags |= FLAGS_VARSIZE_PARAMETER; - break; + case QUALIFIER_VARSIZE: + parameter->flags |= FLAGS_VARSIZE_PARAMETER; + break; #endif #if TRIO_FEATURE_ROUNDING - case QUALIFIER_ROUNDING_UPPER: - parameter->flags |= FLAGS_ROUNDING; - break; + case QUALIFIER_ROUNDING_UPPER: + parameter->flags |= FLAGS_ROUNDING; + break; #endif - default: - /* Bail out completely to make the error more obvious */ - return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); - } + default: + /* Bail out completely to make the error more obvious */ + return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); + } - } /* while qualifier */ + } /* while qualifier */ - parameter->endOffset = offset; + parameter->endOffset = offset; - return 0; + return 0; } #pragma GCC diagnostic pop @@ -1699,246 +1669,242 @@ TRIO_ARGS4((type, format, offset, parameter), */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" -TRIO_PRIVATE int -TrioParseSpecifier -TRIO_ARGS4((type, format, offset, parameter), - int type, - TRIO_CONST char *format, - int offset, - trio_parameter_t *parameter) +TRIO_PRIVATE int TrioParseSpecifier TRIO_ARGS4((type, format, offset, parameter), int type, + TRIO_CONST char* format, int offset, + trio_parameter_t* parameter) { - parameter->baseSpecifier = NO_BASE; + parameter->baseSpecifier = NO_BASE; - switch (format[offset++]) - { + switch (format[offset++]) + { #if defined(SPECIFIER_CHAR_UPPER) - case SPECIFIER_CHAR_UPPER: - parameter->flags |= FLAGS_WIDECHAR; - /* FALLTHROUGH */ + case SPECIFIER_CHAR_UPPER: + parameter->flags |= FLAGS_WIDECHAR; + /* FALLTHROUGH */ #endif - case SPECIFIER_CHAR: - if (parameter->flags & FLAGS_LONG) - parameter->flags |= FLAGS_WIDECHAR; - else if (parameter->flags & FLAGS_SHORT) - parameter->flags &= ~FLAGS_WIDECHAR; - parameter->type = FORMAT_CHAR; - break; + case SPECIFIER_CHAR: + if (parameter->flags & FLAGS_LONG) + parameter->flags |= FLAGS_WIDECHAR; + else if (parameter->flags & FLAGS_SHORT) + parameter->flags &= ~FLAGS_WIDECHAR; + parameter->type = FORMAT_CHAR; + break; #if defined(SPECIFIER_STRING_UPPER) - case SPECIFIER_STRING_UPPER: - parameter->flags |= FLAGS_WIDECHAR; - /* FALLTHROUGH */ + case SPECIFIER_STRING_UPPER: + parameter->flags |= FLAGS_WIDECHAR; + /* FALLTHROUGH */ #endif - case SPECIFIER_STRING: - if (parameter->flags & FLAGS_LONG) - parameter->flags |= FLAGS_WIDECHAR; - else if (parameter->flags & FLAGS_SHORT) - parameter->flags &= ~FLAGS_WIDECHAR; - parameter->type = FORMAT_STRING; - break; + case SPECIFIER_STRING: + if (parameter->flags & FLAGS_LONG) + parameter->flags |= FLAGS_WIDECHAR; + else if (parameter->flags & FLAGS_SHORT) + parameter->flags &= ~FLAGS_WIDECHAR; + parameter->type = FORMAT_STRING; + break; #if defined(SPECIFIER_GROUP) - case SPECIFIER_GROUP: - if (TYPE_SCAN == type) - { - int depth = 1; - parameter->type = FORMAT_GROUP; - if (format[offset] == QUALIFIER_CIRCUMFLEX) - offset++; - if (format[offset] == SPECIFIER_UNGROUP) - offset++; - if (format[offset] == QUALIFIER_MINUS) - offset++; - /* Skip nested brackets */ - while (format[offset] != NIL) - { - if (format[offset] == SPECIFIER_GROUP) - { - depth++; - } - else if (format[offset] == SPECIFIER_UNGROUP) - { - if (--depth <= 0) - { - offset++; - break; - } - } - offset++; - } - } - break; + case SPECIFIER_GROUP: + if (TYPE_SCAN == type) + { + int depth = 1; + parameter->type = FORMAT_GROUP; + if (format[offset] == QUALIFIER_CIRCUMFLEX) + offset++; + if (format[offset] == SPECIFIER_UNGROUP) + offset++; + if (format[offset] == QUALIFIER_MINUS) + offset++; + /* Skip nested brackets */ + while (format[offset] != NIL) + { + if (format[offset] == SPECIFIER_GROUP) + { + depth++; + } + else if (format[offset] == SPECIFIER_UNGROUP) + { + if (--depth <= 0) + { + offset++; + break; + } + } + offset++; + } + } + break; #endif /* defined(SPECIFIER_GROUP) */ - case SPECIFIER_INTEGER: - parameter->type = FORMAT_INT; - break; + case SPECIFIER_INTEGER: + parameter->type = FORMAT_INT; + break; - case SPECIFIER_UNSIGNED: - parameter->flags |= FLAGS_UNSIGNED; - parameter->type = FORMAT_INT; - break; + case SPECIFIER_UNSIGNED: + parameter->flags |= FLAGS_UNSIGNED; + parameter->type = FORMAT_INT; + break; - case SPECIFIER_DECIMAL: - parameter->baseSpecifier = BASE_DECIMAL; - parameter->type = FORMAT_INT; - break; + case SPECIFIER_DECIMAL: + parameter->baseSpecifier = BASE_DECIMAL; + parameter->type = FORMAT_INT; + break; - case SPECIFIER_OCTAL: - parameter->flags |= FLAGS_UNSIGNED; - parameter->baseSpecifier = BASE_OCTAL; - parameter->type = FORMAT_INT; - break; + case SPECIFIER_OCTAL: + parameter->flags |= FLAGS_UNSIGNED; + parameter->baseSpecifier = BASE_OCTAL; + parameter->type = FORMAT_INT; + break; #if TRIO_FEATURE_BINARY - case SPECIFIER_BINARY_UPPER: - parameter->flags |= FLAGS_UPPER; - /* FALLTHROUGH */ - case SPECIFIER_BINARY: - parameter->flags |= FLAGS_NILPADDING; - parameter->baseSpecifier = BASE_BINARY; - parameter->type = FORMAT_INT; - break; + case SPECIFIER_BINARY_UPPER: + parameter->flags |= FLAGS_UPPER; + /* FALLTHROUGH */ + case SPECIFIER_BINARY: + parameter->flags |= FLAGS_NILPADDING; + parameter->baseSpecifier = BASE_BINARY; + parameter->type = FORMAT_INT; + break; #endif - case SPECIFIER_HEX_UPPER: - parameter->flags |= FLAGS_UPPER; - /* FALLTHROUGH */ - case SPECIFIER_HEX: - parameter->flags |= FLAGS_UNSIGNED; - parameter->baseSpecifier = BASE_HEX; - parameter->type = FORMAT_INT; - break; + case SPECIFIER_HEX_UPPER: + parameter->flags |= FLAGS_UPPER; + /* FALLTHROUGH */ + case SPECIFIER_HEX: + parameter->flags |= FLAGS_UNSIGNED; + parameter->baseSpecifier = BASE_HEX; + parameter->type = FORMAT_INT; + break; #if defined(SPECIFIER_FLOAT_E) -# if defined(SPECIFIER_FLOAT_E_UPPER) - case SPECIFIER_FLOAT_E_UPPER: - parameter->flags |= FLAGS_UPPER; - /* FALLTHROUGH */ -# endif - case SPECIFIER_FLOAT_E: - parameter->flags |= FLAGS_FLOAT_E; - parameter->type = FORMAT_DOUBLE; - break; +#if defined(SPECIFIER_FLOAT_E_UPPER) + case SPECIFIER_FLOAT_E_UPPER: + parameter->flags |= FLAGS_UPPER; + /* FALLTHROUGH */ +#endif + case SPECIFIER_FLOAT_E: + parameter->flags |= FLAGS_FLOAT_E; + parameter->type = FORMAT_DOUBLE; + break; #endif #if defined(SPECIFIER_FLOAT_G) -# if defined(SPECIFIER_FLOAT_G_UPPER) - case SPECIFIER_FLOAT_G_UPPER: - parameter->flags |= FLAGS_UPPER; - /* FALLTHROUGH */ -# endif - case SPECIFIER_FLOAT_G: - parameter->flags |= FLAGS_FLOAT_G; - parameter->type = FORMAT_DOUBLE; - break; +#if defined(SPECIFIER_FLOAT_G_UPPER) + case SPECIFIER_FLOAT_G_UPPER: + parameter->flags |= FLAGS_UPPER; + /* FALLTHROUGH */ +#endif + case SPECIFIER_FLOAT_G: + parameter->flags |= FLAGS_FLOAT_G; + parameter->type = FORMAT_DOUBLE; + break; #endif #if defined(SPECIFIER_FLOAT_F) -# if defined(SPECIFIER_FLOAT_F_UPPER) - case SPECIFIER_FLOAT_F_UPPER: - parameter->flags |= FLAGS_UPPER; - /* FALLTHROUGH */ -# endif - case SPECIFIER_FLOAT_F: - parameter->type = FORMAT_DOUBLE; - break; +#if defined(SPECIFIER_FLOAT_F_UPPER) + case SPECIFIER_FLOAT_F_UPPER: + parameter->flags |= FLAGS_UPPER; + /* FALLTHROUGH */ +#endif + case SPECIFIER_FLOAT_F: + parameter->type = FORMAT_DOUBLE; + break; #endif #if defined(TRIO_COMPILER_VISUALC) -# pragma warning( push ) -# pragma warning( disable : 4127 ) /* Conditional expression is constant */ +#pragma warning(push) +#pragma warning(disable : 4127) /* Conditional expression is constant */ #endif - case SPECIFIER_POINTER: - if (sizeof(trio_pointer_t) == sizeof(trio_ulonglong_t)) - parameter->flags |= FLAGS_QUAD; - else if (sizeof(trio_pointer_t) == sizeof(long)) - parameter->flags |= FLAGS_LONG; - parameter->type = FORMAT_POINTER; - break; + case SPECIFIER_POINTER: + if (sizeof(trio_pointer_t) == sizeof(trio_ulonglong_t)) + parameter->flags |= FLAGS_QUAD; + else if (sizeof(trio_pointer_t) == sizeof(long)) + parameter->flags |= FLAGS_LONG; + parameter->type = FORMAT_POINTER; + break; #if defined(TRIO_COMPILER_VISUALC) -# pragma warning( pop ) +#pragma warning(pop) #endif - case SPECIFIER_COUNT: - parameter->type = FORMAT_COUNT; - break; + case SPECIFIER_COUNT: + parameter->type = FORMAT_COUNT; + break; #if TRIO_FEATURE_HEXFLOAT - case SPECIFIER_HEXFLOAT_UPPER: - parameter->flags |= FLAGS_UPPER; - /* FALLTHROUGH */ - case SPECIFIER_HEXFLOAT: - parameter->baseSpecifier = BASE_HEX; - parameter->type = FORMAT_DOUBLE; - break; + case SPECIFIER_HEXFLOAT_UPPER: + parameter->flags |= FLAGS_UPPER; + /* FALLTHROUGH */ + case SPECIFIER_HEXFLOAT: + parameter->baseSpecifier = BASE_HEX; + parameter->type = FORMAT_DOUBLE; + break; #endif #if TRIO_FEATURE_ERRNO - case SPECIFIER_ERRNO: - parameter->type = FORMAT_ERRNO; - break; + case SPECIFIER_ERRNO: + parameter->type = FORMAT_ERRNO; + break; #endif #if TRIO_FEATURE_USER_DEFINED - case SPECIFIER_USER_DEFINED_BEGIN: - { - unsigned int max; - int without_namespace = TRUE; - char* tmpformat = (char *)&format[offset]; - int ch; + case SPECIFIER_USER_DEFINED_BEGIN: + { + unsigned int max; + int without_namespace = TRUE; + char* tmpformat = (char*)&format[offset]; + int ch; - parameter->type = FORMAT_USER_DEFINED; - parameter->user_defined.namespace[0] = NIL; + parameter->type = FORMAT_USER_DEFINED; + parameter->user_defined.namespace[0] = NIL; - while ((ch = format[offset]) != NIL) - { - offset++; - if ((ch == SPECIFIER_USER_DEFINED_END) || (ch == SPECIFIER_USER_DEFINED_EXTRA)) - { - if (without_namespace) - /* No namespace, handler will be passed as an argument */ - parameter->flags |= FLAGS_USER_DEFINED_PARAMETER; + while ((ch = format[offset]) != NIL) + { + offset++; + if ((ch == SPECIFIER_USER_DEFINED_END) || (ch == SPECIFIER_USER_DEFINED_EXTRA)) + { + if (without_namespace) + /* No namespace, handler will be passed as an argument */ + parameter->flags |= FLAGS_USER_DEFINED_PARAMETER; - /* Copy the user data */ - max = (unsigned int)(&format[offset] - tmpformat); - if (max > MAX_USER_DATA) - max = MAX_USER_DATA; - trio_copy_max(parameter->user_data, max, tmpformat); + /* Copy the user data */ + max = (unsigned int)(&format[offset] - tmpformat); + if (max > MAX_USER_DATA) + max = MAX_USER_DATA; + trio_copy_max(parameter->user_data, max, tmpformat); - /* Skip extra data (which is only there to keep the compiler happy) */ - while ((ch != NIL) && (ch != SPECIFIER_USER_DEFINED_END)) - ch = format[offset++]; + /* Skip extra data (which is only there to keep the compiler happy) */ + while ((ch != NIL) && (ch != SPECIFIER_USER_DEFINED_END)) + ch = format[offset++]; - break; /* while */ - } + break; /* while */ + } - if (ch == SPECIFIER_USER_DEFINED_SEPARATOR) - { - without_namespace = FALSE; - /* Copy the namespace for later looking-up */ - max = (int)(&format[offset] - tmpformat); - if (max > MAX_USER_NAME) - max = MAX_USER_NAME; - trio_copy_max(parameter->user_defined.namespace, max, tmpformat); - tmpformat = (char *)&format[offset]; - } - } + if (ch == SPECIFIER_USER_DEFINED_SEPARATOR) + { + without_namespace = FALSE; + /* Copy the namespace for later looking-up */ + max = (int)(&format[offset] - tmpformat); + if (max > MAX_USER_NAME) + max = MAX_USER_NAME; + trio_copy_max(parameter->user_defined.namespace, max, tmpformat); + tmpformat = (char*)&format[offset]; + } + } - if (ch != SPECIFIER_USER_DEFINED_END) - return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); - } - break; + if (ch != SPECIFIER_USER_DEFINED_END) + return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); + } + break; #endif /* TRIO_FEATURE_USER_DEFINED */ - default: - /* Bail out completely to make the error more obvious */ - return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); - } + default: + /* Bail out completely to make the error more obvious */ + return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); + } - parameter->endOffset = offset; + parameter->endOffset = offset; - return 0; + return 0; } #pragma GCC diagnostic pop @@ -1948,539 +1914,546 @@ TRIO_ARGS4((type, format, offset, parameter), * Description: * Parse the format string */ -TRIO_PRIVATE int -TrioParse -TRIO_ARGS6((type, format, parameters, arglist, argfunc, argarray), - int type, - TRIO_CONST char *format, - trio_parameter_t *parameters, - va_list arglist, - trio_argfunc_t argfunc, - trio_pointer_t *argarray) +TRIO_PRIVATE int TrioParse TRIO_ARGS6((type, format, parameters, arglist, argfunc, argarray), + int type, TRIO_CONST char* format, + trio_parameter_t* parameters, va_list arglist, + trio_argfunc_t argfunc, trio_pointer_t* argarray) { - /* Count the number of times a parameter is referenced */ - unsigned short usedEntries[MAX_PARAMETERS]; - /* Parameter counters */ - int parameterPosition; - int maxParam = -1; - /* Utility variables */ - int offset; /* Offset into formatting string */ - BOOLEAN_T positional; /* Does the specifier have a positional? */ + /* Count the number of times a parameter is referenced */ + unsigned short usedEntries[MAX_PARAMETERS]; + /* Parameter counters */ + int parameterPosition; + int maxParam = -1; + /* Utility variables */ + int offset; /* Offset into formatting string */ + BOOLEAN_T positional; /* Does the specifier have a positional? */ #if TRIO_FEATURE_STICKY - BOOLEAN_T gotSticky = FALSE; /* Are there any sticky modifiers at all? */ + BOOLEAN_T gotSticky = FALSE; /* Are there any sticky modifiers at all? */ #endif - /* - * indices specifies the order in which the parameters must be - * read from the va_args (this is necessary to handle positionals) - */ - int indices[MAX_PARAMETERS]; - int pos = 0; - /* Various variables */ + /* + * indices specifies the order in which the parameters must be + * read from the va_args (this is necessary to handle positionals) + */ + int indices[MAX_PARAMETERS]; + int pos = 0; + /* Various variables */ #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE) - int charlen; + int charlen; #endif - int save_errno; - int i = -1; - int num; - trio_parameter_t workParameter; - int status; + int save_errno; + int i = -1; + int num; + trio_parameter_t workParameter; + int status; - /* Both must be set or none must be set */ - assert(((argfunc == NULL) && (argarray == NULL)) || - ((argfunc != NULL) && (argarray != NULL))); + /* Both must be set or none must be set */ + assert(((argfunc == NULL) && (argarray == NULL)) || ((argfunc != NULL) && (argarray != NULL))); - /* - * The 'parameters' array is not initialized, but we need to - * know which entries we have used. - */ - memset(usedEntries, 0, sizeof(usedEntries)); + /* + * The 'parameters' array is not initialized, but we need to + * know which entries we have used. + */ + memset(usedEntries, 0, sizeof(usedEntries)); - save_errno = errno; - offset = 0; - parameterPosition = 0; + save_errno = errno; + offset = 0; + parameterPosition = 0; #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE) - (void)mblen(NULL, 0); + (void)mblen(NULL, 0); #endif - - while (format[offset]) - { - TrioInitializeParameter(&workParameter); -#if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE) - if (! isascii(format[offset])) + while (format[offset]) { - /* - * Multibyte characters cannot be legal specifiers or - * modifiers, so we skip over them. - */ - charlen = mblen(&format[offset], MB_LEN_MAX); - offset += (charlen > 0) ? charlen : 1; - continue; /* while */ - } + TrioInitializeParameter(&workParameter); + +#if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE) + if (!isascii(format[offset])) + { + /* + * Multibyte characters cannot be legal specifiers or + * modifiers, so we skip over them. + */ + charlen = mblen(&format[offset], MB_LEN_MAX); + offset += (charlen > 0) ? charlen : 1; + continue; /* while */ + } #endif /* TRIO_COMPILER_SUPPORTS_MULTIBYTE */ - switch(format[offset++]) { + switch (format[offset++]) + { - case CHAR_IDENTIFIER: - { - if (CHAR_IDENTIFIER == format[offset]) - { - /* skip double "%" */ - offset++; - continue; /* while */ - } + case CHAR_IDENTIFIER: + { + if (CHAR_IDENTIFIER == format[offset]) + { + /* skip double "%" */ + offset++; + continue; /* while */ + } - status = TrioParseQualifiers(type, format, offset, &workParameter); - if (status < 0) - return status; /* Return qualifier syntax error */ + status = TrioParseQualifiers(type, format, offset, &workParameter); + if (status < 0) + return status; /* Return qualifier syntax error */ - status = TrioParseSpecifier(type, format, workParameter.endOffset, &workParameter); - if (status < 0) - return status; /* Return specifier syntax error */ - } - break; + status = TrioParseSpecifier(type, format, workParameter.endOffset, &workParameter); + if (status < 0) + return status; /* Return specifier syntax error */ + } + break; #if TRIO_EXTENSION - case CHAR_ALT_IDENTIFIER: - { - status = TrioParseQualifiers(type, format, offset, &workParameter); - if (status < 0) - continue; /* False alert, not a user defined specifier */ + case CHAR_ALT_IDENTIFIER: + { + status = TrioParseQualifiers(type, format, offset, &workParameter); + if (status < 0) + continue; /* False alert, not a user defined specifier */ - status = TrioParseSpecifier(type, format, workParameter.endOffset, &workParameter); - if ((status < 0) || (FORMAT_USER_DEFINED != workParameter.type)) - continue; /* False alert, not a user defined specifier */ - } - break; + status = TrioParseSpecifier(type, format, workParameter.endOffset, &workParameter); + if ((status < 0) || (FORMAT_USER_DEFINED != workParameter.type)) + continue; /* False alert, not a user defined specifier */ + } + break; #endif - default: - continue; /* while */ - } + default: + continue; /* while */ + } - /* now handle the parsed conversion specification */ - positional = (NO_POSITION != workParameter.position); + /* now handle the parsed conversion specification */ + positional = (NO_POSITION != workParameter.position); - /* - * Parameters only need the type and value. The value is - * read later. - */ - if (workParameter.flags & FLAGS_WIDTH_PARAMETER) - { - if (workParameter.width == NO_WIDTH) - { - workParameter.width = parameterPosition++; - } - else - { - if (! positional) - workParameter.position = workParameter.width + 1; - } + /* + * Parameters only need the type and value. The value is + * read later. + */ + if (workParameter.flags & FLAGS_WIDTH_PARAMETER) + { + if (workParameter.width == NO_WIDTH) + { + workParameter.width = parameterPosition++; + } + else + { + if (!positional) + workParameter.position = workParameter.width + 1; + } - usedEntries[workParameter.width] += 1; - if (workParameter.width > maxParam) - maxParam = workParameter.width; - parameters[pos].type = FORMAT_PARAMETER; - parameters[pos].flags = 0; - indices[workParameter.width] = pos; - workParameter.width = pos++; - } - if (workParameter.flags & FLAGS_PRECISION_PARAMETER) - { - if (workParameter.precision == NO_PRECISION) - { - workParameter.precision = parameterPosition++; - } - else - { - if (! positional) - workParameter.position = workParameter.precision + 1; - } + usedEntries[workParameter.width] += 1; + if (workParameter.width > maxParam) + maxParam = workParameter.width; + parameters[pos].type = FORMAT_PARAMETER; + parameters[pos].flags = 0; + indices[workParameter.width] = pos; + workParameter.width = pos++; + } + if (workParameter.flags & FLAGS_PRECISION_PARAMETER) + { + if (workParameter.precision == NO_PRECISION) + { + workParameter.precision = parameterPosition++; + } + else + { + if (!positional) + workParameter.position = workParameter.precision + 1; + } - usedEntries[workParameter.precision] += 1; - if (workParameter.precision > maxParam) - maxParam = workParameter.precision; - parameters[pos].type = FORMAT_PARAMETER; - parameters[pos].flags = 0; - indices[workParameter.precision] = pos; - workParameter.precision = pos++; - } - if (workParameter.flags & FLAGS_BASE_PARAMETER) - { - if (workParameter.base == NO_BASE) - { - workParameter.base = parameterPosition++; - } - else - { - if (! positional) - workParameter.position = workParameter.base + 1; - } + usedEntries[workParameter.precision] += 1; + if (workParameter.precision > maxParam) + maxParam = workParameter.precision; + parameters[pos].type = FORMAT_PARAMETER; + parameters[pos].flags = 0; + indices[workParameter.precision] = pos; + workParameter.precision = pos++; + } + if (workParameter.flags & FLAGS_BASE_PARAMETER) + { + if (workParameter.base == NO_BASE) + { + workParameter.base = parameterPosition++; + } + else + { + if (!positional) + workParameter.position = workParameter.base + 1; + } - usedEntries[workParameter.base] += 1; - if (workParameter.base > maxParam) - maxParam = workParameter.base; - parameters[pos].type = FORMAT_PARAMETER; - parameters[pos].flags = 0; - indices[workParameter.base] = pos; - workParameter.base = pos++; - } + usedEntries[workParameter.base] += 1; + if (workParameter.base > maxParam) + maxParam = workParameter.base; + parameters[pos].type = FORMAT_PARAMETER; + parameters[pos].flags = 0; + indices[workParameter.base] = pos; + workParameter.base = pos++; + } #if TRIO_FEATURE_VARSIZE - if (workParameter.flags & FLAGS_VARSIZE_PARAMETER) - { - workParameter.varsize = parameterPosition++; + if (workParameter.flags & FLAGS_VARSIZE_PARAMETER) + { + workParameter.varsize = parameterPosition++; - usedEntries[workParameter.varsize] += 1; - if (workParameter.varsize > maxParam) - maxParam = workParameter.varsize; - parameters[pos].type = FORMAT_PARAMETER; - parameters[pos].flags = 0; - indices[workParameter.varsize] = pos; - workParameter.varsize = pos++; - } + usedEntries[workParameter.varsize] += 1; + if (workParameter.varsize > maxParam) + maxParam = workParameter.varsize; + parameters[pos].type = FORMAT_PARAMETER; + parameters[pos].flags = 0; + indices[workParameter.varsize] = pos; + workParameter.varsize = pos++; + } #endif #if TRIO_FEATURE_USER_DEFINED - if (workParameter.flags & FLAGS_USER_DEFINED_PARAMETER) - { - workParameter.user_defined.handler = parameterPosition++; + if (workParameter.flags & FLAGS_USER_DEFINED_PARAMETER) + { + workParameter.user_defined.handler = parameterPosition++; - usedEntries[workParameter.user_defined.handler] += 1; - if (workParameter.user_defined.handler > maxParam) - maxParam = workParameter.user_defined.handler; - parameters[pos].type = FORMAT_PARAMETER; - parameters[pos].flags = FLAGS_USER_DEFINED; - indices[workParameter.user_defined.handler] = pos; - workParameter.user_defined.handler = pos++; - } + usedEntries[workParameter.user_defined.handler] += 1; + if (workParameter.user_defined.handler > maxParam) + maxParam = workParameter.user_defined.handler; + parameters[pos].type = FORMAT_PARAMETER; + parameters[pos].flags = FLAGS_USER_DEFINED; + indices[workParameter.user_defined.handler] = pos; + workParameter.user_defined.handler = pos++; + } #endif - if (NO_POSITION == workParameter.position) - { - workParameter.position = parameterPosition++; - } + if (NO_POSITION == workParameter.position) + { + workParameter.position = parameterPosition++; + } - if (workParameter.position > maxParam) - maxParam = workParameter.position; + if (workParameter.position > maxParam) + maxParam = workParameter.position; - if (workParameter.position >= MAX_PARAMETERS) - { - /* Bail out completely to make the error more obvious */ - return TRIO_ERROR_RETURN(TRIO_ETOOMANY, offset); - } + if (workParameter.position >= MAX_PARAMETERS) + { + /* Bail out completely to make the error more obvious */ + return TRIO_ERROR_RETURN(TRIO_ETOOMANY, offset); + } - indices[workParameter.position] = pos; + indices[workParameter.position] = pos; - /* Count the number of times this entry has been used */ - usedEntries[workParameter.position] += 1; + /* Count the number of times this entry has been used */ + usedEntries[workParameter.position] += 1; - /* Find last sticky parameters */ + /* Find last sticky parameters */ #if TRIO_FEATURE_STICKY - if (workParameter.flags & FLAGS_STICKY) - { - gotSticky = TRUE; - } - else if (gotSticky) - { - for (i = pos - 1; i >= 0; i--) - { - if (parameters[i].type == FORMAT_PARAMETER) - continue; - if ((parameters[i].flags & FLAGS_STICKY) && - (parameters[i].type == workParameter.type)) + if (workParameter.flags & FLAGS_STICKY) { - /* Do not overwrite current qualifiers */ - workParameter.flags |= (parameters[i].flags & (unsigned long)~FLAGS_STICKY); - if (workParameter.width == NO_WIDTH) - workParameter.width = parameters[i].width; - if (workParameter.precision == NO_PRECISION) - workParameter.precision = parameters[i].precision; - if (workParameter.base == NO_BASE) - workParameter.base = parameters[i].base; - break; + gotSticky = TRUE; + } + else if (gotSticky) + { + for (i = pos - 1; i >= 0; i--) + { + if (parameters[i].type == FORMAT_PARAMETER) + continue; + if ((parameters[i].flags & FLAGS_STICKY) && + (parameters[i].type == workParameter.type)) + { + /* Do not overwrite current qualifiers */ + workParameter.flags |= (parameters[i].flags & (unsigned long)~FLAGS_STICKY); + if (workParameter.width == NO_WIDTH) + workParameter.width = parameters[i].width; + if (workParameter.precision == NO_PRECISION) + workParameter.precision = parameters[i].precision; + if (workParameter.base == NO_BASE) + workParameter.base = parameters[i].base; + break; + } + } } - } - } #endif - if (workParameter.base == NO_BASE) - workParameter.base = BASE_DECIMAL; + if (workParameter.base == NO_BASE) + workParameter.base = BASE_DECIMAL; - offset = workParameter.endOffset; + offset = workParameter.endOffset; - TrioCopyParameter(¶meters[pos++], &workParameter); - } /* while format characters left */ + TrioCopyParameter(¶meters[pos++], &workParameter); + } /* while format characters left */ - parameters[pos].type = FORMAT_SENTINEL; /* end parameter array with sentinel */ - parameters[pos].beginOffset = offset; + parameters[pos].type = FORMAT_SENTINEL; /* end parameter array with sentinel */ + parameters[pos].beginOffset = offset; - for (num = 0; num <= maxParam; num++) - { - if (usedEntries[num] != 1) + for (num = 0; num <= maxParam; num++) { - if (usedEntries[num] == 0) /* gap detected */ - return TRIO_ERROR_RETURN(TRIO_EGAP, num); - else /* double references detected */ - return TRIO_ERROR_RETURN(TRIO_EDBLREF, num); - } - - i = indices[num]; + if (usedEntries[num] != 1) + { + if (usedEntries[num] == 0) /* gap detected */ + return TRIO_ERROR_RETURN(TRIO_EGAP, num); + else /* double references detected */ + return TRIO_ERROR_RETURN(TRIO_EDBLREF, num); + } - /* - * FORMAT_PARAMETERS are only present if they must be read, - * so it makes no sense to check the ignore flag (besides, - * the flags variable is not set for that particular type) - */ - if ((parameters[i].type != FORMAT_PARAMETER) && - (parameters[i].flags & FLAGS_IGNORE)) - continue; /* for all arguments */ + i = indices[num]; - /* - * The stack arguments are read according to ANSI C89 - * default argument promotions: - * - * char = int - * short = int - * unsigned char = unsigned int - * unsigned short = unsigned int - * float = double - * - * In addition to the ANSI C89 these types are read (the - * default argument promotions of C99 has not been - * considered yet) - * - * long long - * long double - * size_t - * ptrdiff_t - * intmax_t - */ - switch (parameters[i].type) - { - case FORMAT_GROUP: - case FORMAT_STRING: + /* + * FORMAT_PARAMETERS are only present if they must be read, + * so it makes no sense to check the ignore flag (besides, + * the flags variable is not set for that particular type) + */ + if ((parameters[i].type != FORMAT_PARAMETER) && (parameters[i].flags & FLAGS_IGNORE)) + continue; /* for all arguments */ + + /* + * The stack arguments are read according to ANSI C89 + * default argument promotions: + * + * char = int + * short = int + * unsigned char = unsigned int + * unsigned short = unsigned int + * float = double + * + * In addition to the ANSI C89 these types are read (the + * default argument promotions of C99 has not been + * considered yet) + * + * long long + * long double + * size_t + * ptrdiff_t + * intmax_t + */ + switch (parameters[i].type) + { + case FORMAT_GROUP: + case FORMAT_STRING: #if TRIO_FEATURE_WIDECHAR - if (parameters[i].flags & FLAGS_WIDECHAR) - { - parameters[i].data.wstring = (argfunc == NULL) - ? va_arg(arglist, trio_wchar_t *) - : (trio_wchar_t *)(argfunc(argarray, num, TRIO_TYPE_PWCHAR)); - } - else + if (parameters[i].flags & FLAGS_WIDECHAR) + { + parameters[i].data.wstring = + (argfunc == NULL) + ? va_arg(arglist, trio_wchar_t*) + : (trio_wchar_t*)(argfunc(argarray, num, TRIO_TYPE_PWCHAR)); + } + else #endif - { - parameters[i].data.string = (argfunc == NULL) - ? va_arg(arglist, char *) - : (char *)(argfunc(argarray, num, TRIO_TYPE_PCHAR)); - } - break; + { + parameters[i].data.string = + (argfunc == NULL) ? va_arg(arglist, char*) + : (char*)(argfunc(argarray, num, TRIO_TYPE_PCHAR)); + } + break; #if TRIO_FEATURE_USER_DEFINED - case FORMAT_USER_DEFINED: + case FORMAT_USER_DEFINED: #endif - case FORMAT_POINTER: - case FORMAT_COUNT: - case FORMAT_UNKNOWN: - parameters[i].data.pointer = (argfunc == NULL) - ? va_arg(arglist, trio_pointer_t ) - : argfunc(argarray, num, TRIO_TYPE_POINTER); - break; + case FORMAT_POINTER: + case FORMAT_COUNT: + case FORMAT_UNKNOWN: + parameters[i].data.pointer = (argfunc == NULL) + ? va_arg(arglist, trio_pointer_t) + : argfunc(argarray, num, TRIO_TYPE_POINTER); + break; - case FORMAT_CHAR: - case FORMAT_INT: + case FORMAT_CHAR: + case FORMAT_INT: #if TRIO_FEATURE_SCANF - if (TYPE_SCAN == type) - { - if (argfunc == NULL) - parameters[i].data.pointer = - (trio_pointer_t)va_arg(arglist, trio_pointer_t); - else - { - if (parameters[i].type == FORMAT_CHAR) - parameters[i].data.pointer = - (trio_pointer_t)((char *)argfunc(argarray, num, TRIO_TYPE_CHAR)); - else if (parameters[i].flags & FLAGS_SHORT) - parameters[i].data.pointer = - (trio_pointer_t)((short *)argfunc(argarray, num, TRIO_TYPE_SHORT)); - else - parameters[i].data.pointer = - (trio_pointer_t)((int *)argfunc(argarray, num, TRIO_TYPE_INT)); - } - } - else + if (TYPE_SCAN == type) + { + if (argfunc == NULL) + parameters[i].data.pointer = + (trio_pointer_t)va_arg(arglist, trio_pointer_t); + else + { + if (parameters[i].type == FORMAT_CHAR) + parameters[i].data.pointer = + (trio_pointer_t)((char*)argfunc(argarray, num, TRIO_TYPE_CHAR)); + else if (parameters[i].flags & FLAGS_SHORT) + parameters[i].data.pointer = + (trio_pointer_t)((short*)argfunc(argarray, num, TRIO_TYPE_SHORT)); + else + parameters[i].data.pointer = + (trio_pointer_t)((int*)argfunc(argarray, num, TRIO_TYPE_INT)); + } + } + else #endif /* TRIO_FEATURE_SCANF */ - { + { #if TRIO_FEATURE_VARSIZE || TRIO_FEATURE_FIXED_SIZE - if (parameters[i].flags - & (FLAGS_VARSIZE_PARAMETER | FLAGS_FIXED_SIZE)) - { - int varsize; - if (parameters[i].flags & FLAGS_VARSIZE_PARAMETER) - { - /* - * Variable sizes are mapped onto the fixed sizes, in - * accordance with integer promotion. - * - * Please note that this may not be portable, as we - * only guess the size, not the layout of the numbers. - * For example, if int is little-endian, and long is - * big-endian, then this will fail. - */ - varsize = (int)parameters[parameters[i].varsize].data.number.as_unsigned; - } - else - { - /* Used for the I modifiers */ - varsize = parameters[i].varsize; - } - parameters[i].flags &= ~FLAGS_ALL_VARSIZES; - - if (varsize <= (int)sizeof(int)) - ; - else if (varsize <= (int)sizeof(long)) - parameters[i].flags |= FLAGS_LONG; + if (parameters[i].flags & (FLAGS_VARSIZE_PARAMETER | FLAGS_FIXED_SIZE)) + { + int varsize; + if (parameters[i].flags & FLAGS_VARSIZE_PARAMETER) + { + /* + * Variable sizes are mapped onto the fixed sizes, in + * accordance with integer promotion. + * + * Please note that this may not be portable, as we + * only guess the size, not the layout of the numbers. + * For example, if int is little-endian, and long is + * big-endian, then this will fail. + */ + varsize = + (int)parameters[parameters[i].varsize].data.number.as_unsigned; + } + else + { + /* Used for the I modifiers */ + varsize = parameters[i].varsize; + } + parameters[i].flags &= ~FLAGS_ALL_VARSIZES; + + if (varsize <= (int)sizeof(int)) + ; + else if (varsize <= (int)sizeof(long)) + parameters[i].flags |= FLAGS_LONG; #if TRIO_FEATURE_INTMAX_T - else if (varsize <= (int)sizeof(trio_longlong_t)) - parameters[i].flags |= FLAGS_QUAD; - else - parameters[i].flags |= FLAGS_INTMAX_T; + else if (varsize <= (int)sizeof(trio_longlong_t)) + parameters[i].flags |= FLAGS_QUAD; + else + parameters[i].flags |= FLAGS_INTMAX_T; #else - else - parameters[i].flags |= FLAGS_QUAD; + else + parameters[i].flags |= FLAGS_QUAD; #endif - } + } #endif /* TRIO_FEATURE_VARSIZE */ #if TRIO_FEATURE_SIZE_T || TRIO_FEATURE_SIZE_T_UPPER - if (parameters[i].flags & FLAGS_SIZE_T) - parameters[i].data.number.as_unsigned = (argfunc == NULL) - ? (trio_uintmax_t)va_arg(arglist, size_t) - : (trio_uintmax_t)(*((size_t *)argfunc(argarray, num, TRIO_TYPE_SIZE))); - else + if (parameters[i].flags & FLAGS_SIZE_T) + parameters[i].data.number.as_unsigned = + (argfunc == NULL) + ? (trio_uintmax_t)va_arg(arglist, size_t) + : (trio_uintmax_t)( + *((size_t*)argfunc(argarray, num, TRIO_TYPE_SIZE))); + else #endif #if TRIO_FEATURE_PTRDIFF_T - if (parameters[i].flags & FLAGS_PTRDIFF_T) - parameters[i].data.number.as_unsigned = (argfunc == NULL) - ? (trio_uintmax_t)va_arg(arglist, ptrdiff_t) - : (trio_uintmax_t)(*((ptrdiff_t *)argfunc(argarray, num, TRIO_TYPE_PTRDIFF))); - else + if (parameters[i].flags & FLAGS_PTRDIFF_T) + parameters[i].data.number.as_unsigned = + (argfunc == NULL) + ? (trio_uintmax_t)va_arg(arglist, ptrdiff_t) + : (trio_uintmax_t)( + *((ptrdiff_t*)argfunc(argarray, num, TRIO_TYPE_PTRDIFF))); + else #endif #if TRIO_FEATURE_INTMAX_T - if (parameters[i].flags & FLAGS_INTMAX_T) - parameters[i].data.number.as_unsigned = (argfunc == NULL) - ? (trio_uintmax_t)va_arg(arglist, trio_intmax_t) - : (trio_uintmax_t)(*((trio_intmax_t *)argfunc(argarray, num, TRIO_TYPE_UINTMAX))); - else + if (parameters[i].flags & FLAGS_INTMAX_T) + parameters[i].data.number.as_unsigned = + (argfunc == NULL) + ? (trio_uintmax_t)va_arg(arglist, trio_intmax_t) + : (trio_uintmax_t)( + *((trio_intmax_t*)argfunc(argarray, num, TRIO_TYPE_UINTMAX))); + else #endif - if (parameters[i].flags & FLAGS_QUAD) - parameters[i].data.number.as_unsigned = (argfunc == NULL) - ? (trio_uintmax_t)va_arg(arglist, trio_ulonglong_t) - : (trio_uintmax_t)(*((trio_ulonglong_t *)argfunc(argarray, num, TRIO_TYPE_ULONGLONG))); - else if (parameters[i].flags & FLAGS_LONG) - parameters[i].data.number.as_unsigned = (argfunc == NULL) - ? (trio_uintmax_t)va_arg(arglist, long) - : (trio_uintmax_t)(*((long *)argfunc(argarray, num, TRIO_TYPE_LONG))); - else - { - if (argfunc == NULL) - parameters[i].data.number.as_unsigned = (trio_uintmax_t)va_arg(arglist, int); - else - { - if (parameters[i].type == FORMAT_CHAR) - parameters[i].data.number.as_unsigned = - (trio_uintmax_t)(*((char *)argfunc(argarray, num, TRIO_TYPE_CHAR))); - else if (parameters[i].flags & FLAGS_SHORT) - parameters[i].data.number.as_unsigned = - (trio_uintmax_t)(*((short *)argfunc(argarray, num, TRIO_TYPE_SHORT))); - else - parameters[i].data.number.as_unsigned = - (trio_uintmax_t)(*((int *)argfunc(argarray, num, TRIO_TYPE_INT))); - } - } - } - break; + if (parameters[i].flags & FLAGS_QUAD) + parameters[i].data.number.as_unsigned = + (argfunc == NULL) ? (trio_uintmax_t)va_arg(arglist, trio_ulonglong_t) + : (trio_uintmax_t)(*((trio_ulonglong_t*)argfunc( + argarray, num, TRIO_TYPE_ULONGLONG))); + else if (parameters[i].flags & FLAGS_LONG) + parameters[i].data.number.as_unsigned = + (argfunc == NULL) ? (trio_uintmax_t)va_arg(arglist, long) + : (trio_uintmax_t)(*( + (long*)argfunc(argarray, num, TRIO_TYPE_LONG))); + else + { + if (argfunc == NULL) + parameters[i].data.number.as_unsigned = + (trio_uintmax_t)va_arg(arglist, int); + else + { + if (parameters[i].type == FORMAT_CHAR) + parameters[i].data.number.as_unsigned = (trio_uintmax_t)( + *((char*)argfunc(argarray, num, TRIO_TYPE_CHAR))); + else if (parameters[i].flags & FLAGS_SHORT) + parameters[i].data.number.as_unsigned = (trio_uintmax_t)( + *((short*)argfunc(argarray, num, TRIO_TYPE_SHORT))); + else + parameters[i].data.number.as_unsigned = (trio_uintmax_t)( + *((int*)argfunc(argarray, num, TRIO_TYPE_INT))); + } + } + } + break; - case FORMAT_PARAMETER: - /* - * The parameter for the user-defined specifier is a pointer, - * whereas the rest (width, precision, base) uses an integer. - */ - if (parameters[i].flags & FLAGS_USER_DEFINED) - parameters[i].data.pointer = (argfunc == NULL) - ? va_arg(arglist, trio_pointer_t ) - : argfunc(argarray, num, TRIO_TYPE_POINTER); - else - parameters[i].data.number.as_unsigned = (argfunc == NULL) - ? (trio_uintmax_t)va_arg(arglist, int) - : (trio_uintmax_t)(*((int *)argfunc(argarray, num, TRIO_TYPE_INT))); - break; + case FORMAT_PARAMETER: + /* + * The parameter for the user-defined specifier is a pointer, + * whereas the rest (width, precision, base) uses an integer. + */ + if (parameters[i].flags & FLAGS_USER_DEFINED) + parameters[i].data.pointer = (argfunc == NULL) + ? va_arg(arglist, trio_pointer_t) + : argfunc(argarray, num, TRIO_TYPE_POINTER); + else + parameters[i].data.number.as_unsigned = + (argfunc == NULL) + ? (trio_uintmax_t)va_arg(arglist, int) + : (trio_uintmax_t)(*((int*)argfunc(argarray, num, TRIO_TYPE_INT))); + break; #if TRIO_FEATURE_FLOAT - case FORMAT_DOUBLE: -# if TRIO_FEATURE_SCANF - if (TYPE_SCAN == type) - { - if (parameters[i].flags & FLAGS_LONGDOUBLE) - parameters[i].data.longdoublePointer = (argfunc == NULL) - ? va_arg(arglist, trio_long_double_t *) - : (trio_long_double_t *)argfunc(argarray, num, TRIO_TYPE_LONGDOUBLE); - else - { - if (parameters[i].flags & FLAGS_LONG) - parameters[i].data.doublePointer = (argfunc == NULL) - ? va_arg(arglist, double *) - : (double *)argfunc(argarray, num, TRIO_TYPE_DOUBLE); - else - parameters[i].data.doublePointer = (argfunc == NULL) - ? (double *)va_arg(arglist, float *) - : (double *)argfunc(argarray, num, TRIO_TYPE_DOUBLE); - } - } - else -# endif /* TRIO_FEATURE_SCANF */ - { - if (parameters[i].flags & FLAGS_LONGDOUBLE) - parameters[i].data.longdoubleNumber = (argfunc == NULL) - ? va_arg(arglist, trio_long_double_t) - : (trio_long_double_t)(*((trio_long_double_t *)argfunc(argarray, num, TRIO_TYPE_LONGDOUBLE))); - else - { - if (argfunc == NULL) - parameters[i].data.longdoubleNumber = - (trio_long_double_t)va_arg(arglist, double); - else - { - if (parameters[i].flags & FLAGS_SHORT) - parameters[i].data.longdoubleNumber = - (trio_long_double_t)(*((float *)argfunc(argarray, num, TRIO_TYPE_FLOAT))); - else - parameters[i].data.longdoubleNumber = - (trio_long_double_t)(*((double *)argfunc(argarray, num, TRIO_TYPE_DOUBLE))); - } - } - } - break; + case FORMAT_DOUBLE: +#if TRIO_FEATURE_SCANF + if (TYPE_SCAN == type) + { + if (parameters[i].flags & FLAGS_LONGDOUBLE) + parameters[i].data.longdoublePointer = + (argfunc == NULL) + ? va_arg(arglist, trio_long_double_t*) + : (trio_long_double_t*)argfunc(argarray, num, TRIO_TYPE_LONGDOUBLE); + else + { + if (parameters[i].flags & FLAGS_LONG) + parameters[i].data.doublePointer = + (argfunc == NULL) + ? va_arg(arglist, double*) + : (double*)argfunc(argarray, num, TRIO_TYPE_DOUBLE); + else + parameters[i].data.doublePointer = + (argfunc == NULL) + ? (double*)va_arg(arglist, float*) + : (double*)argfunc(argarray, num, TRIO_TYPE_DOUBLE); + } + } + else +#endif /* TRIO_FEATURE_SCANF */ + { + if (parameters[i].flags & FLAGS_LONGDOUBLE) + parameters[i].data.longdoubleNumber = + (argfunc == NULL) ? va_arg(arglist, trio_long_double_t) + : (trio_long_double_t)(*((trio_long_double_t*)argfunc( + argarray, num, TRIO_TYPE_LONGDOUBLE))); + else + { + if (argfunc == NULL) + parameters[i].data.longdoubleNumber = + (trio_long_double_t)va_arg(arglist, double); + else + { + if (parameters[i].flags & FLAGS_SHORT) + parameters[i].data.longdoubleNumber = (trio_long_double_t)( + *((float*)argfunc(argarray, num, TRIO_TYPE_FLOAT))); + else + parameters[i].data.longdoubleNumber = (trio_long_double_t)( + *((double*)argfunc(argarray, num, TRIO_TYPE_DOUBLE))); + } + } + } + break; #endif /* TRIO_FEATURE_FLOAT */ #if TRIO_FEATURE_ERRNO - case FORMAT_ERRNO: - parameters[i].data.errorNumber = save_errno; - break; + case FORMAT_ERRNO: + parameters[i].data.errorNumber = save_errno; + break; #endif - default: - break; - } - } /* for all specifiers */ - return num; + default: + break; + } + } /* for all specifiers */ + return num; } - /************************************************************************* * * FORMATTING * ************************************************************************/ - /************************************************************************* * TrioWriteNumber * @@ -2489,203 +2462,194 @@ TRIO_ARGS6((type, format, parameters, arglist, argfunc, argarray), * The complexity of this function is a result of the complexity * of the dependencies of the flags. */ -TRIO_PRIVATE void -TrioWriteNumber -TRIO_ARGS6((self, number, flags, width, precision, base), - trio_class_t *self, - trio_uintmax_t number, - trio_flags_t flags, - int width, - int precision, - int base) +TRIO_PRIVATE void TrioWriteNumber TRIO_ARGS6((self, number, flags, width, precision, base), + trio_class_t* self, trio_uintmax_t number, + trio_flags_t flags, int width, int precision, int base) { - BOOLEAN_T isNegative; - BOOLEAN_T isNumberZero; - BOOLEAN_T isPrecisionZero; - BOOLEAN_T ignoreNumber; - char buffer[MAX_CHARS_IN(trio_uintmax_t) * (1 + MAX_LOCALE_SEPARATOR_LENGTH) + 1]; - char *bufferend; - char *pointer; - TRIO_CONST char *digits; - int i; + BOOLEAN_T isNegative; + BOOLEAN_T isNumberZero; + BOOLEAN_T isPrecisionZero; + BOOLEAN_T ignoreNumber; + char buffer[MAX_CHARS_IN(trio_uintmax_t) * (1 + MAX_LOCALE_SEPARATOR_LENGTH) + 1]; + char* bufferend; + char* pointer; + TRIO_CONST char* digits; + int i; #if TRIO_FEATURE_QUOTE - int length; - char *p; + int length; + char* p; #endif - int count; - int digitOffset; + int count; + int digitOffset; - assert(VALID(self)); - assert(VALID(self->OutStream)); - assert(((base >= MIN_BASE) && (base <= MAX_BASE)) || (base == NO_BASE)); + assert(VALID(self)); + assert(VALID(self->OutStream)); + assert(((base >= MIN_BASE) && (base <= MAX_BASE)) || (base == NO_BASE)); - digits = (flags & FLAGS_UPPER) ? internalDigitsUpper : internalDigitsLower; - if (base == NO_BASE) - base = BASE_DECIMAL; + digits = (flags & FLAGS_UPPER) ? internalDigitsUpper : internalDigitsLower; + if (base == NO_BASE) + base = BASE_DECIMAL; - isNumberZero = (number == 0); - isPrecisionZero = (precision == 0); - ignoreNumber = (isNumberZero - && isPrecisionZero - && !((flags & FLAGS_ALTERNATIVE) && (base == BASE_OCTAL))); + isNumberZero = (number == 0); + isPrecisionZero = (precision == 0); + ignoreNumber = + (isNumberZero && isPrecisionZero && !((flags & FLAGS_ALTERNATIVE) && (base == BASE_OCTAL))); - if (flags & FLAGS_UNSIGNED) - { - isNegative = FALSE; - flags &= ~FLAGS_SHOWSIGN; - } - else - { - isNegative = ((trio_intmax_t)number < 0); - if (isNegative) - number = -((trio_intmax_t)number); - } + if (flags & FLAGS_UNSIGNED) + { + isNegative = FALSE; + flags &= ~FLAGS_SHOWSIGN; + } + else + { + isNegative = ((trio_intmax_t)number < 0); + if (isNegative) + number = -((trio_intmax_t)number); + } - if (flags & FLAGS_QUAD) - number &= (trio_ulonglong_t)-1; - else if (flags & FLAGS_LONG) - number &= (unsigned long)-1; - else - number &= (unsigned int)-1; - - /* Build number */ - pointer = bufferend = &buffer[sizeof(buffer) - 1]; - *pointer-- = NIL; - for (i = 1; i < (int)sizeof(buffer); i++) - { - digitOffset = number % base; - *pointer-- = digits[digitOffset]; - number /= base; - if (number == 0) - break; + if (flags & FLAGS_QUAD) + number &= (trio_ulonglong_t)-1; + else if (flags & FLAGS_LONG) + number &= (unsigned long)-1; + else + number &= (unsigned int)-1; + + /* Build number */ + pointer = bufferend = &buffer[sizeof(buffer) - 1]; + *pointer-- = NIL; + for (i = 1; i < (int)sizeof(buffer); i++) + { + digitOffset = number % base; + *pointer-- = digits[digitOffset]; + number /= base; + if (number == 0) + break; #if TRIO_FEATURE_QUOTE - if ((flags & FLAGS_QUOTE) && TrioFollowedBySeparator(i + 1)) - { - /* - * We are building the number from the least significant - * to the most significant digit, so we have to copy the - * thousand separator backwards - */ - length = internalThousandSeparatorLength; - if (((int)(pointer - buffer) - length) > 0) - { - p = &internalThousandSeparator[length - 1]; - while (length-- > 0) - *pointer-- = *p--; - } - } + if ((flags & FLAGS_QUOTE) && TrioFollowedBySeparator(i + 1)) + { + /* + * We are building the number from the least significant + * to the most significant digit, so we have to copy the + * thousand separator backwards + */ + length = internalThousandSeparatorLength; + if (((int)(pointer - buffer) - length) > 0) + { + p = &internalThousandSeparator[length - 1]; + while (length-- > 0) + *pointer-- = *p--; + } + } #endif - } - - if (! ignoreNumber) - { - /* Adjust width */ - width -= (bufferend - pointer) - 1; - } - - /* Adjust precision */ - if (NO_PRECISION != precision) - { - precision -= (bufferend - pointer) - 1; - if (precision < 0) - precision = 0; - flags |= FLAGS_NILPADDING; - } - - /* Calculate padding */ - count = (! ((flags & FLAGS_LEFTADJUST) || (precision == NO_PRECISION))) - ? precision - : 0; - - /* Adjust width further */ - if (isNegative || (flags & FLAGS_SHOWSIGN) || (flags & FLAGS_SPACE)) - width--; - if ((flags & FLAGS_ALTERNATIVE) && !isNumberZero) - { - switch (base) - { - case BASE_BINARY: - case BASE_HEX: - width -= 2; - break; - case BASE_OCTAL: - if (!(flags & FLAGS_NILPADDING) || (count == 0)) - width--; - break; - default: - break; } - } - /* Output prefixes spaces if needed */ - if (! ((flags & FLAGS_LEFTADJUST) || - ((flags & FLAGS_NILPADDING) && (precision == NO_PRECISION)))) - { - while (width-- > count) - self->OutStream(self, CHAR_ADJUST); - } - - /* width has been adjusted for signs and alternatives */ - if (isNegative) - self->OutStream(self, '-'); - else if (flags & FLAGS_SHOWSIGN) - self->OutStream(self, '+'); - else if (flags & FLAGS_SPACE) - self->OutStream(self, ' '); - - /* Prefix is not written when the value is zero */ - if ((flags & FLAGS_ALTERNATIVE) && !isNumberZero) - { - switch (base) + if (!ignoreNumber) { - case BASE_BINARY: - self->OutStream(self, '0'); - self->OutStream(self, (flags & FLAGS_UPPER) ? 'B' : 'b'); - break; - - case BASE_OCTAL: - if (!(flags & FLAGS_NILPADDING) || (count == 0)) - self->OutStream(self, '0'); - break; - - case BASE_HEX: - self->OutStream(self, '0'); - self->OutStream(self, (flags & FLAGS_UPPER) ? 'X' : 'x'); - break; - - default: - break; - } /* switch base */ - } - - /* Output prefixed zero padding if needed */ - if (flags & FLAGS_NILPADDING) - { - if (precision == NO_PRECISION) - precision = width; - while (precision-- > 0) - { - self->OutStream(self, '0'); - width--; + /* Adjust width */ + width -= (bufferend - pointer) - 1; } - } - if (! ignoreNumber) - { - /* Output the number itself */ - while (*(++pointer)) + /* Adjust precision */ + if (NO_PRECISION != precision) { - self->OutStream(self, *pointer); + precision -= (bufferend - pointer) - 1; + if (precision < 0) + precision = 0; + flags |= FLAGS_NILPADDING; } - } - /* Output trailing spaces if needed */ - if (flags & FLAGS_LEFTADJUST) - { - while (width-- > 0) - self->OutStream(self, CHAR_ADJUST); - } + /* Calculate padding */ + count = (!((flags & FLAGS_LEFTADJUST) || (precision == NO_PRECISION))) ? precision : 0; + + /* Adjust width further */ + if (isNegative || (flags & FLAGS_SHOWSIGN) || (flags & FLAGS_SPACE)) + width--; + if ((flags & FLAGS_ALTERNATIVE) && !isNumberZero) + { + switch (base) + { + case BASE_BINARY: + case BASE_HEX: + width -= 2; + break; + case BASE_OCTAL: + if (!(flags & FLAGS_NILPADDING) || (count == 0)) + width--; + break; + default: + break; + } + } + + /* Output prefixes spaces if needed */ + if (!((flags & FLAGS_LEFTADJUST) || + ((flags & FLAGS_NILPADDING) && (precision == NO_PRECISION)))) + { + while (width-- > count) + self->OutStream(self, CHAR_ADJUST); + } + + /* width has been adjusted for signs and alternatives */ + if (isNegative) + self->OutStream(self, '-'); + else if (flags & FLAGS_SHOWSIGN) + self->OutStream(self, '+'); + else if (flags & FLAGS_SPACE) + self->OutStream(self, ' '); + + /* Prefix is not written when the value is zero */ + if ((flags & FLAGS_ALTERNATIVE) && !isNumberZero) + { + switch (base) + { + case BASE_BINARY: + self->OutStream(self, '0'); + self->OutStream(self, (flags & FLAGS_UPPER) ? 'B' : 'b'); + break; + + case BASE_OCTAL: + if (!(flags & FLAGS_NILPADDING) || (count == 0)) + self->OutStream(self, '0'); + break; + + case BASE_HEX: + self->OutStream(self, '0'); + self->OutStream(self, (flags & FLAGS_UPPER) ? 'X' : 'x'); + break; + + default: + break; + } /* switch base */ + } + + /* Output prefixed zero padding if needed */ + if (flags & FLAGS_NILPADDING) + { + if (precision == NO_PRECISION) + precision = width; + while (precision-- > 0) + { + self->OutStream(self, '0'); + width--; + } + } + + if (!ignoreNumber) + { + /* Output the number itself */ + while (*(++pointer)) + { + self->OutStream(self, *pointer); + } + } + + /* Output trailing spaces if needed */ + if (flags & FLAGS_LEFTADJUST) + { + while (width-- > 0) + self->OutStream(self, CHAR_ADJUST); + } } /************************************************************************* @@ -2694,54 +2658,65 @@ TRIO_ARGS6((self, number, flags, width, precision, base), * Description: * Output a single character of a string */ -TRIO_PRIVATE void -TrioWriteStringCharacter -TRIO_ARGS3((self, ch, flags), - trio_class_t *self, - int ch, - trio_flags_t flags) +TRIO_PRIVATE void TrioWriteStringCharacter TRIO_ARGS3((self, ch, flags), trio_class_t* self, int ch, + trio_flags_t flags) { - if (flags & FLAGS_ALTERNATIVE) - { - if (! isprint(ch)) + if (flags & FLAGS_ALTERNATIVE) { - /* - * Non-printable characters are converted to C escapes or - * \number, if no C escape exists. - */ - self->OutStream(self, CHAR_BACKSLASH); - switch (ch) - { - case '\007': self->OutStream(self, 'a'); break; - case '\b': self->OutStream(self, 'b'); break; - case '\f': self->OutStream(self, 'f'); break; - case '\n': self->OutStream(self, 'n'); break; - case '\r': self->OutStream(self, 'r'); break; - case '\t': self->OutStream(self, 't'); break; - case '\v': self->OutStream(self, 'v'); break; - case '\\': self->OutStream(self, '\\'); break; - default: - self->OutStream(self, 'x'); - TrioWriteNumber(self, (trio_uintmax_t)ch, - FLAGS_UNSIGNED | FLAGS_NILPADDING, - 2, 2, BASE_HEX); - break; - } + if (!isprint(ch)) + { + /* + * Non-printable characters are converted to C escapes or + * \number, if no C escape exists. + */ + self->OutStream(self, CHAR_BACKSLASH); + switch (ch) + { + case '\007': + self->OutStream(self, 'a'); + break; + case '\b': + self->OutStream(self, 'b'); + break; + case '\f': + self->OutStream(self, 'f'); + break; + case '\n': + self->OutStream(self, 'n'); + break; + case '\r': + self->OutStream(self, 'r'); + break; + case '\t': + self->OutStream(self, 't'); + break; + case '\v': + self->OutStream(self, 'v'); + break; + case '\\': + self->OutStream(self, '\\'); + break; + default: + self->OutStream(self, 'x'); + TrioWriteNumber(self, (trio_uintmax_t)ch, FLAGS_UNSIGNED | FLAGS_NILPADDING, 2, + 2, BASE_HEX); + break; + } + } + else if (ch == CHAR_BACKSLASH) + { + self->OutStream(self, CHAR_BACKSLASH); + self->OutStream(self, CHAR_BACKSLASH); + } + else + { + self->OutStream(self, ch); + } } - else if (ch == CHAR_BACKSLASH) + else { - self->OutStream(self, CHAR_BACKSLASH); - self->OutStream(self, CHAR_BACKSLASH); + self->OutStream(self, ch); } - else - { - self->OutStream(self, ch); - } - } - else - { - self->OutStream(self, ch); - } } /************************************************************************* @@ -2750,75 +2725,69 @@ TRIO_ARGS3((self, ch, flags), * Description: * Output a string */ -TRIO_PRIVATE void -TrioWriteString -TRIO_ARGS5((self, string, flags, width, precision), - trio_class_t *self, - TRIO_CONST char *string, - trio_flags_t flags, - int width, - int precision) +TRIO_PRIVATE void TrioWriteString TRIO_ARGS5((self, string, flags, width, precision), + trio_class_t* self, TRIO_CONST char* string, + trio_flags_t flags, int width, int precision) { - int length; - int ch; + int length; + int ch; - assert(VALID(self)); - assert(VALID(self->OutStream)); + assert(VALID(self)); + assert(VALID(self->OutStream)); - if (string == NULL) - { - string = internalNullString; - length = sizeof(internalNullString) - 1; + if (string == NULL) + { + string = internalNullString; + length = sizeof(internalNullString) - 1; #if TRIO_FEATURE_QUOTE - /* Disable quoting for the null pointer */ - flags &= (~FLAGS_QUOTE); + /* Disable quoting for the null pointer */ + flags &= (~FLAGS_QUOTE); #endif - width = 0; - } - else - { - if (precision == 0) - { - length = trio_length(string); + width = 0; } - else + else { - length = trio_length_max(string, precision); + if (precision == 0) + { + length = trio_length(string); + } + else + { + length = trio_length_max(string, precision); + } } - } - if ((NO_PRECISION != precision) && - (precision < length)) - { - length = precision; - } - width -= length; + if ((NO_PRECISION != precision) && (precision < length)) + { + length = precision; + } + width -= length; #if TRIO_FEATURE_QUOTE - if (flags & FLAGS_QUOTE) - self->OutStream(self, CHAR_QUOTE); + if (flags & FLAGS_QUOTE) + self->OutStream(self, CHAR_QUOTE); #endif - if (! (flags & FLAGS_LEFTADJUST)) - { - while (width-- > 0) - self->OutStream(self, CHAR_ADJUST); - } + if (!(flags & FLAGS_LEFTADJUST)) + { + while (width-- > 0) + self->OutStream(self, CHAR_ADJUST); + } - while (length-- > 0) - { - /* The ctype parameters must be an unsigned char (or EOF) */ - ch = (int)((unsigned char)(*string++)); - TrioWriteStringCharacter(self, ch, flags); - } + while (length-- > 0) + { + /* The ctype parameters must be an unsigned char (or EOF) */ + ch = (int)((unsigned char)(*string++)); + TrioWriteStringCharacter(self, ch, flags); + } - if (flags & FLAGS_LEFTADJUST) - { - while (width-- > 0) - self->OutStream(self, CHAR_ADJUST); - } + if (flags & FLAGS_LEFTADJUST) + { + while (width-- > 0) + self->OutStream(self, CHAR_ADJUST); + } #if TRIO_FEATURE_QUOTE - if (flags & FLAGS_QUOTE) - self->OutStream(self, CHAR_QUOTE); + if (flags & FLAGS_QUOTE) + self->OutStream(self, CHAR_QUOTE); #endif } @@ -2829,36 +2798,32 @@ TRIO_ARGS5((self, string, flags, width, precision), * Output a wide string as a multi-byte sequence */ #if TRIO_FEATURE_WIDECHAR -TRIO_PRIVATE int -TrioWriteWideStringCharacter -TRIO_ARGS4((self, wch, flags, width), - trio_class_t *self, - trio_wchar_t wch, - trio_flags_t flags, - int width) +TRIO_PRIVATE int TrioWriteWideStringCharacter TRIO_ARGS4((self, wch, flags, width), + trio_class_t* self, trio_wchar_t wch, + trio_flags_t flags, int width) { - int size; - int i; - int ch; - char *string; - char buffer[MB_LEN_MAX + 1]; + int size; + int i; + int ch; + char* string; + char buffer[MB_LEN_MAX + 1]; - if (width == NO_WIDTH) - width = sizeof(buffer); - - size = wctomb(buffer, wch); - if ((size <= 0) || (size > width) || (buffer[0] == NIL)) - return 0; + if (width == NO_WIDTH) + width = sizeof(buffer); - string = buffer; - i = size; - while ((width >= i) && (width-- > 0) && (i-- > 0)) - { - /* The ctype parameters must be an unsigned char (or EOF) */ - ch = (int)((unsigned char)(*string++)); - TrioWriteStringCharacter(self, ch, flags); - } - return size; + size = wctomb(buffer, wch); + if ((size <= 0) || (size > width) || (buffer[0] == NIL)) + return 0; + + string = buffer; + i = size; + while ((width >= i) && (width-- > 0) && (i-- > 0)) + { + /* The ctype parameters must be an unsigned char (or EOF) */ + ch = (int)((unsigned char)(*string++)); + TrioWriteStringCharacter(self, ch, flags); + } + return size; } #endif /* TRIO_FEATURE_WIDECHAR */ @@ -2869,69 +2834,65 @@ TRIO_ARGS4((self, wch, flags, width), * Output a wide character string as a multi-byte string */ #if TRIO_FEATURE_WIDECHAR -TRIO_PRIVATE void -TrioWriteWideString -TRIO_ARGS5((self, wstring, flags, width, precision), - trio_class_t *self, - TRIO_CONST trio_wchar_t *wstring, - trio_flags_t flags, - int width, - int precision) +TRIO_PRIVATE void TrioWriteWideString TRIO_ARGS5((self, wstring, flags, width, precision), + trio_class_t* self, + TRIO_CONST trio_wchar_t* wstring, + trio_flags_t flags, int width, int precision) { - int length; - int size; + int length; + int size; - assert(VALID(self)); - assert(VALID(self->OutStream)); + assert(VALID(self)); + assert(VALID(self->OutStream)); #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE) - /* Required by TrioWriteWideStringCharacter */ - (void)mblen(NULL, 0); -#endif - - if (wstring == NULL) - { - TrioWriteString(self, NULL, flags, width, precision); - return; - } - - if (NO_PRECISION == precision) - { - length = INT_MAX; - } - else - { - length = precision; - width -= length; - } - -#if TRIO_FEATURE_QUOTE - if (flags & FLAGS_QUOTE) - self->OutStream(self, CHAR_QUOTE); + /* Required by TrioWriteWideStringCharacter */ + (void)mblen(NULL, 0); #endif - if (! (flags & FLAGS_LEFTADJUST)) - { - while (width-- > 0) - self->OutStream(self, CHAR_ADJUST); - } + if (wstring == NULL) + { + TrioWriteString(self, NULL, flags, width, precision); + return; + } - while (length > 0) - { - size = TrioWriteWideStringCharacter(self, *wstring++, flags, length); - if (size == 0) - break; /* while */ - length -= size; - } + if (NO_PRECISION == precision) + { + length = INT_MAX; + } + else + { + length = precision; + width -= length; + } - if (flags & FLAGS_LEFTADJUST) - { - while (width-- > 0) - self->OutStream(self, CHAR_ADJUST); - } #if TRIO_FEATURE_QUOTE - if (flags & FLAGS_QUOTE) - self->OutStream(self, CHAR_QUOTE); + if (flags & FLAGS_QUOTE) + self->OutStream(self, CHAR_QUOTE); +#endif + + if (!(flags & FLAGS_LEFTADJUST)) + { + while (width-- > 0) + self->OutStream(self, CHAR_ADJUST); + } + + while (length > 0) + { + size = TrioWriteWideStringCharacter(self, *wstring++, flags, length); + if (size == 0) + break; /* while */ + length -= size; + } + + if (flags & FLAGS_LEFTADJUST) + { + while (width-- > 0) + self->OutStream(self, CHAR_ADJUST); + } +#if TRIO_FEATURE_QUOTE + if (flags & FLAGS_QUOTE) + self->OutStream(self, CHAR_QUOTE); #endif } #endif /* TRIO_FEATURE_WIDECHAR */ @@ -2952,652 +2913,630 @@ TRIO_ARGS5((self, wstring, flags, width, precision), * and *l() math functions. */ #if TRIO_FEATURE_FLOAT -TRIO_PRIVATE void -TrioWriteDouble -TRIO_ARGS6((self, number, flags, width, precision, base), - trio_class_t *self, - trio_long_double_t number, - trio_flags_t flags, - int width, - int precision, - int base) +TRIO_PRIVATE void TrioWriteDouble TRIO_ARGS6((self, number, flags, width, precision, base), + trio_class_t* self, trio_long_double_t number, + trio_flags_t flags, int width, int precision, int base) { - trio_long_double_t integerNumber; - trio_long_double_t fractionNumber; - trio_long_double_t workNumber; - int integerDigits; - int fractionDigits; - int exponentDigits; - int workDigits; - int baseDigits; - int integerThreshold; - int fractionThreshold; - int expectedWidth; - int exponent = 0; - unsigned int uExponent = 0; - int exponentBase; - trio_long_double_t dblBase; - trio_long_double_t dblFractionBase; - trio_long_double_t integerAdjust; - trio_long_double_t fractionAdjust; - trio_long_double_t workFractionNumber; - trio_long_double_t workFractionAdjust; - int fractionDigitsInspect; - BOOLEAN_T isNegative; - BOOLEAN_T isExponentNegative = FALSE; - BOOLEAN_T requireTwoDigitExponent; - BOOLEAN_T isHex; - TRIO_CONST char *digits; -# if TRIO_FEATURE_QUOTE - char *groupingPointer; -# endif - int i; - int offset; - BOOLEAN_T hasOnlyZeroes; - int leadingFractionZeroes = -1; - register int trailingZeroes; - BOOLEAN_T keepTrailingZeroes; - BOOLEAN_T keepDecimalPoint; - trio_long_double_t epsilon; - BOOLEAN_T adjustNumber = FALSE; - - assert(VALID(self)); - assert(VALID(self->OutStream)); - assert(((base >= MIN_BASE) && (base <= MAX_BASE)) || (base == NO_BASE)); - - /* Determine sign and look for special quantities */ - switch (trio_fpclassify_and_signbit(number, &isNegative)) - { - case TRIO_FP_NAN: - TrioWriteString(self, - (flags & FLAGS_UPPER) - ? NAN_UPPER - : NAN_LOWER, - flags, width, precision); - return; - - case TRIO_FP_INFINITE: - if (isNegative) - { - /* Negative infinity */ - TrioWriteString(self, - (flags & FLAGS_UPPER) - ? "-" INFINITE_UPPER - : "-" INFINITE_LOWER, - flags, width, precision); - return; - } - else - { - /* Positive infinity */ - TrioWriteString(self, - (flags & FLAGS_UPPER) - ? INFINITE_UPPER - : INFINITE_LOWER, - flags, width, precision); - return; - } - - default: - /* Finitude */ - break; - } - - /* Normal numbers */ - if (flags & FLAGS_LONGDOUBLE) - { - baseDigits = (base == 10) - ? LDBL_DIG - : (int)trio_floor(LDBL_MANT_DIG / TrioLogarithmBase(base)); - epsilon = LDBL_EPSILON; - } - else if (flags & FLAGS_SHORT) - { - baseDigits = (base == BASE_DECIMAL) - ? FLT_DIG - : (int)trio_floor(FLT_MANT_DIG / TrioLogarithmBase(base)); - epsilon = FLT_EPSILON; - } - else - { - baseDigits = (base == BASE_DECIMAL) - ? DBL_DIG - : (int)trio_floor(DBL_MANT_DIG / TrioLogarithmBase(base)); - epsilon = DBL_EPSILON; - } - - digits = (flags & FLAGS_UPPER) ? internalDigitsUpper : internalDigitsLower; - isHex = (base == BASE_HEX); - if (base == NO_BASE) - base = BASE_DECIMAL; - dblBase = (trio_long_double_t)base; - keepTrailingZeroes = !( (flags & FLAGS_ROUNDING) || - ( (flags & FLAGS_FLOAT_G) && - !(flags & FLAGS_ALTERNATIVE) ) ); - -# if TRIO_FEATURE_ROUNDING - if (flags & FLAGS_ROUNDING) - { - precision = baseDigits; - } -# endif - - if (precision == NO_PRECISION) - { - if (isHex) - { - keepTrailingZeroes = FALSE; - precision = FLT_MANT_DIG; - } - else - { - precision = FLT_DIG; - } - } - - if (isNegative) - { - number = -number; - } - - if (isHex) - { - flags |= FLAGS_FLOAT_E; - } - - reprocess: - - if (flags & FLAGS_FLOAT_G) - { - if (precision == 0) - precision = 1; - - if ( (number < TRIO_SUFFIX_LONG(1.0E-4)) || - (number >= TrioPower(base, (trio_long_double_t)precision)) ) - { - /* Use scientific notation */ - flags |= FLAGS_FLOAT_E; - } - else if (number < 1.0) - { - /* - * Use normal notation. If the integer part of the number is - * zero, then adjust the precision to include leading fractional - * zeros. - */ - workNumber = TrioLogarithm(number, base); - workNumber = TRIO_FABS(workNumber); - if (workNumber - trio_floor(workNumber) < epsilon) - workNumber--; - leadingFractionZeroes = (int)trio_floor(workNumber); - } - } - - if (flags & FLAGS_FLOAT_E) - { - /* Scale the number */ - workNumber = TrioLogarithm(number, base); - if (trio_isinf(workNumber) == -1) - { - exponent = 0; - /* Undo setting */ - if (flags & FLAGS_FLOAT_G) - flags &= ~FLAGS_FLOAT_E; - } - else - { - exponent = (int)trio_floor(workNumber); - workNumber = number; - /* - * The expression A * 10^-B is equivalent to A / 10^B but the former - * usually gives better accuracy. - */ - workNumber *= TrioPower(dblBase, (trio_long_double_t)-exponent); - if (trio_isinf(workNumber)) { - /* - * Scaling is done it two steps to avoid problems with subnormal - * numbers. - */ - workNumber /= TrioPower(dblBase, (trio_long_double_t)(exponent / 2)); - workNumber /= TrioPower(dblBase, (trio_long_double_t)(exponent - (exponent / 2))); - } - number = workNumber; - isExponentNegative = (exponent < 0); - uExponent = (isExponentNegative) ? -exponent : exponent; - if (isHex) - uExponent *= 4; /* log16(2) */ + trio_long_double_t integerNumber; + trio_long_double_t fractionNumber; + trio_long_double_t workNumber; + int integerDigits; + int fractionDigits; + int exponentDigits; + int workDigits; + int baseDigits; + int integerThreshold; + int fractionThreshold; + int expectedWidth; + int exponent = 0; + unsigned int uExponent = 0; + int exponentBase; + trio_long_double_t dblBase; + trio_long_double_t dblFractionBase; + trio_long_double_t integerAdjust; + trio_long_double_t fractionAdjust; + trio_long_double_t workFractionNumber; + trio_long_double_t workFractionAdjust; + int fractionDigitsInspect; + BOOLEAN_T isNegative; + BOOLEAN_T isExponentNegative = FALSE; + BOOLEAN_T requireTwoDigitExponent; + BOOLEAN_T isHex; + TRIO_CONST char* digits; #if TRIO_FEATURE_QUOTE - /* No thousand separators */ - flags &= ~FLAGS_QUOTE; + char* groupingPointer; #endif - } - } + int i; + int offset; + BOOLEAN_T hasOnlyZeroes; + int leadingFractionZeroes = -1; + register int trailingZeroes; + BOOLEAN_T keepTrailingZeroes; + BOOLEAN_T keepDecimalPoint; + trio_long_double_t epsilon; + BOOLEAN_T adjustNumber = FALSE; - integerNumber = trio_floor(number); - fractionNumber = number - integerNumber; + assert(VALID(self)); + assert(VALID(self->OutStream)); + assert(((base >= MIN_BASE) && (base <= MAX_BASE)) || (base == NO_BASE)); - /* - * Truncated number. - * - * Precision is number of significant digits for FLOAT_G and number of - * fractional digits for others. - */ - integerDigits = 1; - if (integerNumber > epsilon) - { - integerDigits += (int)TrioLogarithm(integerNumber, base); - } + /* Determine sign and look for special quantities */ + switch (trio_fpclassify_and_signbit(number, &isNegative)) + { + case TRIO_FP_NAN: + TrioWriteString(self, (flags & FLAGS_UPPER) ? NAN_UPPER : NAN_LOWER, flags, width, + precision); + return; - fractionDigits = precision; - if (flags & FLAGS_FLOAT_G) - { - if (leadingFractionZeroes > 0) - { - fractionDigits += leadingFractionZeroes; - } - if ((integerNumber > epsilon) || (number <= epsilon)) - { - fractionDigits -= integerDigits; - } - } + case TRIO_FP_INFINITE: + if (isNegative) + { + /* Negative infinity */ + TrioWriteString(self, + (flags & FLAGS_UPPER) ? "-" INFINITE_UPPER : "-" INFINITE_LOWER, + flags, width, precision); + return; + } + else + { + /* Positive infinity */ + TrioWriteString(self, (flags & FLAGS_UPPER) ? INFINITE_UPPER : INFINITE_LOWER, + flags, width, precision); + return; + } - dblFractionBase = TrioPower(base, fractionDigits); + default: + /* Finitude */ + break; + } - if (integerNumber < 1.0) - { - workNumber = number * dblFractionBase + TRIO_SUFFIX_LONG(0.5); - if (trio_floor(number * dblFractionBase) != trio_floor(workNumber)) + /* Normal numbers */ + if (flags & FLAGS_LONGDOUBLE) { - adjustNumber = TRUE; - /* Remove a leading fraction zero if fraction is rounded up */ - if ((int)TrioLogarithm(number * dblFractionBase, base) != (int)TrioLogarithm(workNumber, base)) - { - --leadingFractionZeroes; - } + baseDigits = + (base == 10) ? LDBL_DIG : (int)trio_floor(LDBL_MANT_DIG / TrioLogarithmBase(base)); + epsilon = LDBL_EPSILON; } - workNumber /= dblFractionBase; - } - else - { - workNumber = number + TRIO_SUFFIX_LONG(0.5) / dblFractionBase; - adjustNumber = (trio_floor(number) != trio_floor(workNumber)); - } - if (adjustNumber) - { - if ((flags & FLAGS_FLOAT_G) && !(flags & FLAGS_FLOAT_E)) + else if (flags & FLAGS_SHORT) { - /* The adjustment may require a change to scientific notation */ - if ( (workNumber < TRIO_SUFFIX_LONG(1.0E-4)) || - (workNumber >= TrioPower(base, (trio_long_double_t)precision)) ) - { - /* Use scientific notation */ - flags |= FLAGS_FLOAT_E; - goto reprocess; - } + baseDigits = (base == BASE_DECIMAL) + ? FLT_DIG + : (int)trio_floor(FLT_MANT_DIG / TrioLogarithmBase(base)); + epsilon = FLT_EPSILON; } - - if (flags & FLAGS_FLOAT_E) + else { - workDigits = 1 + TrioLogarithm(trio_floor(workNumber), base); - if (integerDigits == workDigits) - { - /* Adjust if the same number of digits are used */ - number += TRIO_SUFFIX_LONG(0.5) / dblFractionBase; - integerNumber = trio_floor(number); - fractionNumber = number - integerNumber; - } - else - { - /* Adjust if number was rounded up one digit (ie. 0.99 to 1.00) */ - exponent++; - isExponentNegative = (exponent < 0); - uExponent = (isExponentNegative) ? -exponent : exponent; - if (isHex) - uExponent *= 4; /* log16(2) */ - workNumber = (number + TRIO_SUFFIX_LONG(0.5) / dblFractionBase) / dblBase; - integerNumber = trio_floor(workNumber); - fractionNumber = workNumber - integerNumber; - } + baseDigits = (base == BASE_DECIMAL) + ? DBL_DIG + : (int)trio_floor(DBL_MANT_DIG / TrioLogarithmBase(base)); + epsilon = DBL_EPSILON; } - else + + digits = (flags & FLAGS_UPPER) ? internalDigitsUpper : internalDigitsLower; + isHex = (base == BASE_HEX); + if (base == NO_BASE) + base = BASE_DECIMAL; + dblBase = (trio_long_double_t)base; + keepTrailingZeroes = + !((flags & FLAGS_ROUNDING) || ((flags & FLAGS_FLOAT_G) && !(flags & FLAGS_ALTERNATIVE))); + +#if TRIO_FEATURE_ROUNDING + if (flags & FLAGS_ROUNDING) { - if (workNumber > 1.0) - { - /* Adjust if number was rounded up one digit (ie. 99 to 100) */ - integerNumber = trio_floor(workNumber); - fractionNumber = 0.0; - integerDigits = (integerNumber > epsilon) - ? 1 + (int)TrioLogarithm(integerNumber, base) - : 1; - if (flags & FLAGS_FLOAT_G) + precision = baseDigits; + } +#endif + + if (precision == NO_PRECISION) + { + if (isHex) { - if (flags & FLAGS_ALTERNATIVE) - { - fractionDigits = precision; - if ((integerNumber > epsilon) || (number <= epsilon)) - { - fractionDigits -= integerDigits; - } - } - else - { - fractionDigits = 0; - } + keepTrailingZeroes = FALSE; + precision = FLT_MANT_DIG; } - } - else - { - integerNumber = trio_floor(workNumber); - fractionNumber = workNumber - integerNumber; - if (flags & FLAGS_FLOAT_G) + else { - if (flags & FLAGS_ALTERNATIVE) - { - fractionDigits = precision; - if (leadingFractionZeroes > 0) - { - fractionDigits += leadingFractionZeroes; - } - if ((integerNumber > epsilon) || (number <= epsilon)) - { - fractionDigits -= integerDigits; - } - } + precision = FLT_DIG; } - } - } - } - - /* Estimate accuracy */ - integerAdjust = fractionAdjust = TRIO_SUFFIX_LONG(0.5); -# if TRIO_FEATURE_ROUNDING - if (flags & FLAGS_ROUNDING) - { - if (integerDigits > baseDigits) - { - integerThreshold = baseDigits; - fractionDigits = 0; - dblFractionBase = 1.0; - fractionThreshold = 0; - precision = 0; /* Disable decimal-point */ - integerAdjust = TrioPower(base, integerDigits - integerThreshold - 1); - fractionAdjust = 0.0; - } - else - { - integerThreshold = integerDigits; - fractionThreshold = fractionDigits - integerThreshold; - fractionAdjust = 1.0; - } - } - else -# endif - { - integerThreshold = INT_MAX; - fractionThreshold = INT_MAX; - } - - /* - * Calculate expected width. - * sign + integer part + thousands separators + decimal point - * + fraction + exponent - */ - fractionAdjust /= dblFractionBase; - hasOnlyZeroes = (trio_floor((fractionNumber + fractionAdjust) * - dblFractionBase) < epsilon); - keepDecimalPoint = ( (flags & FLAGS_ALTERNATIVE) || - !((precision == 0) || - (!keepTrailingZeroes && hasOnlyZeroes)) ); - - expectedWidth = integerDigits + fractionDigits; - - if (!keepTrailingZeroes) - { - trailingZeroes = 0; - workFractionNumber = fractionNumber; - workFractionAdjust = fractionAdjust; - fractionDigitsInspect = fractionDigits; - - if (integerDigits > integerThreshold) - { - fractionDigitsInspect = 0; - } - else if (fractionThreshold <= fractionDigits) - { - fractionDigitsInspect = fractionThreshold + 1; } - trailingZeroes = fractionDigits - fractionDigitsInspect; - for (i = 0; i < fractionDigitsInspect; i++) + if (isNegative) { - workFractionNumber *= dblBase; - workFractionAdjust *= dblBase; - workNumber = trio_floor(workFractionNumber + workFractionAdjust); - workFractionNumber -= workNumber; - offset = (int)trio_fmod(workNumber, dblBase); - if (offset == 0) - { - trailingZeroes++; - } - else - { - trailingZeroes = 0; - } + number = -number; } - expectedWidth -= trailingZeroes; - } - - if (keepDecimalPoint) - { - expectedWidth += internalDecimalPointLength; - } - + + if (isHex) + { + flags |= FLAGS_FLOAT_E; + } + +reprocess: + + if (flags & FLAGS_FLOAT_G) + { + if (precision == 0) + precision = 1; + + if ((number < TRIO_SUFFIX_LONG(1.0E-4)) || + (number >= TrioPower(base, (trio_long_double_t)precision))) + { + /* Use scientific notation */ + flags |= FLAGS_FLOAT_E; + } + else if (number < 1.0) + { + /* + * Use normal notation. If the integer part of the number is + * zero, then adjust the precision to include leading fractional + * zeros. + */ + workNumber = TrioLogarithm(number, base); + workNumber = TRIO_FABS(workNumber); + if (workNumber - trio_floor(workNumber) < epsilon) + workNumber--; + leadingFractionZeroes = (int)trio_floor(workNumber); + } + } + + if (flags & FLAGS_FLOAT_E) + { + /* Scale the number */ + workNumber = TrioLogarithm(number, base); + if (trio_isinf(workNumber) == -1) + { + exponent = 0; + /* Undo setting */ + if (flags & FLAGS_FLOAT_G) + flags &= ~FLAGS_FLOAT_E; + } + else + { + exponent = (int)trio_floor(workNumber); + workNumber = number; + /* + * The expression A * 10^-B is equivalent to A / 10^B but the former + * usually gives better accuracy. + */ + workNumber *= TrioPower(dblBase, (trio_long_double_t)-exponent); + if (trio_isinf(workNumber)) + { + /* + * Scaling is done it two steps to avoid problems with subnormal + * numbers. + */ + workNumber /= TrioPower(dblBase, (trio_long_double_t)(exponent / 2)); + workNumber /= TrioPower(dblBase, (trio_long_double_t)(exponent - (exponent / 2))); + } + number = workNumber; + isExponentNegative = (exponent < 0); + uExponent = (isExponentNegative) ? -exponent : exponent; + if (isHex) + uExponent *= 4; /* log16(2) */ #if TRIO_FEATURE_QUOTE - if (flags & FLAGS_QUOTE) - { - expectedWidth += TrioCalcThousandSeparatorLength(integerDigits); - } + /* No thousand separators */ + flags &= ~FLAGS_QUOTE; #endif - - if (isNegative || (flags & FLAGS_SHOWSIGN) || (flags & FLAGS_SPACE)) - { - expectedWidth += sizeof("-") - 1; - } - - exponentDigits = 0; - if (flags & FLAGS_FLOAT_E) - { - exponentDigits = (uExponent == 0) - ? 1 - : (int)trio_ceil(TrioLogarithm((double)(uExponent + 1), - (isHex) ? 10 : base)); - } - requireTwoDigitExponent = ((base == BASE_DECIMAL) && (exponentDigits == 1)); - if (exponentDigits > 0) - { - expectedWidth += exponentDigits; - expectedWidth += (requireTwoDigitExponent - ? sizeof("E+0") - 1 - : sizeof("E+") - 1); - } - - if (isHex) - { - expectedWidth += sizeof("0X") - 1; - } - - /* Output prefixing */ - if (flags & FLAGS_NILPADDING) - { - /* Leading zeros must be after sign */ - if (isNegative) - self->OutStream(self, '-'); - else if (flags & FLAGS_SHOWSIGN) - self->OutStream(self, '+'); - else if (flags & FLAGS_SPACE) - self->OutStream(self, ' '); - if (isHex) - { - self->OutStream(self, '0'); - self->OutStream(self, (flags & FLAGS_UPPER) ? 'X' : 'x'); + } } - if (!(flags & FLAGS_LEFTADJUST)) + + integerNumber = trio_floor(number); + fractionNumber = number - integerNumber; + + /* + * Truncated number. + * + * Precision is number of significant digits for FLOAT_G and number of + * fractional digits for others. + */ + integerDigits = 1; + if (integerNumber > epsilon) { - for (i = expectedWidth; i < width; i++) - { - self->OutStream(self, '0'); - } + integerDigits += (int)TrioLogarithm(integerNumber, base); } - } - else - { - /* Leading spaces must be before sign */ - if (!(flags & FLAGS_LEFTADJUST)) + + fractionDigits = precision; + if (flags & FLAGS_FLOAT_G) { - for (i = expectedWidth; i < width; i++) - { - self->OutStream(self, CHAR_ADJUST); - } + if (leadingFractionZeroes > 0) + { + fractionDigits += leadingFractionZeroes; + } + if ((integerNumber > epsilon) || (number <= epsilon)) + { + fractionDigits -= integerDigits; + } } - if (isNegative) - self->OutStream(self, '-'); - else if (flags & FLAGS_SHOWSIGN) - self->OutStream(self, '+'); - else if (flags & FLAGS_SPACE) - self->OutStream(self, ' '); - if (isHex) + + dblFractionBase = TrioPower(base, fractionDigits); + + if (integerNumber < 1.0) { - self->OutStream(self, '0'); - self->OutStream(self, (flags & FLAGS_UPPER) ? 'X' : 'x'); + workNumber = number * dblFractionBase + TRIO_SUFFIX_LONG(0.5); + if (trio_floor(number * dblFractionBase) != trio_floor(workNumber)) + { + adjustNumber = TRUE; + /* Remove a leading fraction zero if fraction is rounded up */ + if ((int)TrioLogarithm(number * dblFractionBase, base) != + (int)TrioLogarithm(workNumber, base)) + { + --leadingFractionZeroes; + } + } + workNumber /= dblFractionBase; } - } - - /* Output the integer part and thousand separators */ - for (i = 0; i < integerDigits; i++) - { - workNumber = trio_floor(((integerNumber + integerAdjust) - / TrioPower(base, integerDigits - i - 1))); - if (i > integerThreshold) + else { - /* Beyond accuracy */ - self->OutStream(self, digits[0]); + workNumber = number + TRIO_SUFFIX_LONG(0.5) / dblFractionBase; + adjustNumber = (trio_floor(number) != trio_floor(workNumber)); } - else + if (adjustNumber) { - self->OutStream(self, digits[(int)trio_fmod(workNumber, dblBase)]); + if ((flags & FLAGS_FLOAT_G) && !(flags & FLAGS_FLOAT_E)) + { + /* The adjustment may require a change to scientific notation */ + if ((workNumber < TRIO_SUFFIX_LONG(1.0E-4)) || + (workNumber >= TrioPower(base, (trio_long_double_t)precision))) + { + /* Use scientific notation */ + flags |= FLAGS_FLOAT_E; + goto reprocess; + } + } + + if (flags & FLAGS_FLOAT_E) + { + workDigits = 1 + TrioLogarithm(trio_floor(workNumber), base); + if (integerDigits == workDigits) + { + /* Adjust if the same number of digits are used */ + number += TRIO_SUFFIX_LONG(0.5) / dblFractionBase; + integerNumber = trio_floor(number); + fractionNumber = number - integerNumber; + } + else + { + /* Adjust if number was rounded up one digit (ie. 0.99 to 1.00) */ + exponent++; + isExponentNegative = (exponent < 0); + uExponent = (isExponentNegative) ? -exponent : exponent; + if (isHex) + uExponent *= 4; /* log16(2) */ + workNumber = (number + TRIO_SUFFIX_LONG(0.5) / dblFractionBase) / dblBase; + integerNumber = trio_floor(workNumber); + fractionNumber = workNumber - integerNumber; + } + } + else + { + if (workNumber > 1.0) + { + /* Adjust if number was rounded up one digit (ie. 99 to 100) */ + integerNumber = trio_floor(workNumber); + fractionNumber = 0.0; + integerDigits = + (integerNumber > epsilon) ? 1 + (int)TrioLogarithm(integerNumber, base) : 1; + if (flags & FLAGS_FLOAT_G) + { + if (flags & FLAGS_ALTERNATIVE) + { + fractionDigits = precision; + if ((integerNumber > epsilon) || (number <= epsilon)) + { + fractionDigits -= integerDigits; + } + } + else + { + fractionDigits = 0; + } + } + } + else + { + integerNumber = trio_floor(workNumber); + fractionNumber = workNumber - integerNumber; + if (flags & FLAGS_FLOAT_G) + { + if (flags & FLAGS_ALTERNATIVE) + { + fractionDigits = precision; + if (leadingFractionZeroes > 0) + { + fractionDigits += leadingFractionZeroes; + } + if ((integerNumber > epsilon) || (number <= epsilon)) + { + fractionDigits -= integerDigits; + } + } + } + } + } + } + + /* Estimate accuracy */ + integerAdjust = fractionAdjust = TRIO_SUFFIX_LONG(0.5); +#if TRIO_FEATURE_ROUNDING + if (flags & FLAGS_ROUNDING) + { + if (integerDigits > baseDigits) + { + integerThreshold = baseDigits; + fractionDigits = 0; + dblFractionBase = 1.0; + fractionThreshold = 0; + precision = 0; /* Disable decimal-point */ + integerAdjust = TrioPower(base, integerDigits - integerThreshold - 1); + fractionAdjust = 0.0; + } + else + { + integerThreshold = integerDigits; + fractionThreshold = fractionDigits - integerThreshold; + fractionAdjust = 1.0; + } + } + else +#endif + { + integerThreshold = INT_MAX; + fractionThreshold = INT_MAX; + } + + /* + * Calculate expected width. + * sign + integer part + thousands separators + decimal point + * + fraction + exponent + */ + fractionAdjust /= dblFractionBase; + hasOnlyZeroes = (trio_floor((fractionNumber + fractionAdjust) * dblFractionBase) < epsilon); + keepDecimalPoint = ((flags & FLAGS_ALTERNATIVE) || + !((precision == 0) || (!keepTrailingZeroes && hasOnlyZeroes))); + + expectedWidth = integerDigits + fractionDigits; + + if (!keepTrailingZeroes) + { + trailingZeroes = 0; + workFractionNumber = fractionNumber; + workFractionAdjust = fractionAdjust; + fractionDigitsInspect = fractionDigits; + + if (integerDigits > integerThreshold) + { + fractionDigitsInspect = 0; + } + else if (fractionThreshold <= fractionDigits) + { + fractionDigitsInspect = fractionThreshold + 1; + } + + trailingZeroes = fractionDigits - fractionDigitsInspect; + for (i = 0; i < fractionDigitsInspect; i++) + { + workFractionNumber *= dblBase; + workFractionAdjust *= dblBase; + workNumber = trio_floor(workFractionNumber + workFractionAdjust); + workFractionNumber -= workNumber; + offset = (int)trio_fmod(workNumber, dblBase); + if (offset == 0) + { + trailingZeroes++; + } + else + { + trailingZeroes = 0; + } + } + expectedWidth -= trailingZeroes; + } + + if (keepDecimalPoint) + { + expectedWidth += internalDecimalPointLength; } #if TRIO_FEATURE_QUOTE - if (((flags & (FLAGS_FLOAT_E | FLAGS_QUOTE)) == FLAGS_QUOTE) - && TrioFollowedBySeparator(integerDigits - i)) + if (flags & FLAGS_QUOTE) { - for (groupingPointer = internalThousandSeparator; - *groupingPointer != NIL; - groupingPointer++) - { - self->OutStream(self, *groupingPointer); - } + expectedWidth += TrioCalcThousandSeparatorLength(integerDigits); } #endif - } - - /* Insert decimal point and build the fraction part */ - trailingZeroes = 0; - if (keepDecimalPoint) - { - if (internalDecimalPoint) + if (isNegative || (flags & FLAGS_SHOWSIGN) || (flags & FLAGS_SPACE)) { - self->OutStream(self, internalDecimalPoint); + expectedWidth += sizeof("-") - 1; } - else - { - for (i = 0; i < internalDecimalPointLength; i++) - { - self->OutStream(self, internalDecimalPointString[i]); - } - } - } - for (i = 0; i < fractionDigits; i++) - { - if ((integerDigits > integerThreshold) || (i > fractionThreshold)) + exponentDigits = 0; + if (flags & FLAGS_FLOAT_E) { - /* Beyond accuracy */ - trailingZeroes++; + exponentDigits = + (uExponent == 0) + ? 1 + : (int)trio_ceil(TrioLogarithm((double)(uExponent + 1), (isHex) ? 10 : base)); } - else + requireTwoDigitExponent = ((base == BASE_DECIMAL) && (exponentDigits == 1)); + if (exponentDigits > 0) { - fractionNumber *= dblBase; - fractionAdjust *= dblBase; - workNumber = trio_floor(fractionNumber + fractionAdjust); - if (workNumber > fractionNumber) - { - /* fractionNumber should never become negative */ - fractionNumber = 0.0; - fractionAdjust = 0.0; - } - else - { - fractionNumber -= workNumber; - } - offset = (int)trio_fmod(workNumber, dblBase); - if (offset == 0) - { - trailingZeroes++; - } - else - { - while (trailingZeroes > 0) + expectedWidth += exponentDigits; + expectedWidth += (requireTwoDigitExponent ? sizeof("E+0") - 1 : sizeof("E+") - 1); + } + + if (isHex) + { + expectedWidth += sizeof("0X") - 1; + } + + /* Output prefixing */ + if (flags & FLAGS_NILPADDING) + { + /* Leading zeros must be after sign */ + if (isNegative) + self->OutStream(self, '-'); + else if (flags & FLAGS_SHOWSIGN) + self->OutStream(self, '+'); + else if (flags & FLAGS_SPACE) + self->OutStream(self, ' '); + if (isHex) { - /* Not trailing zeroes after all */ - self->OutStream(self, digits[0]); - trailingZeroes--; + self->OutStream(self, '0'); + self->OutStream(self, (flags & FLAGS_UPPER) ? 'X' : 'x'); + } + if (!(flags & FLAGS_LEFTADJUST)) + { + for (i = expectedWidth; i < width; i++) + { + self->OutStream(self, '0'); + } } - self->OutStream(self, digits[offset]); - } } - } - - if (keepTrailingZeroes) - { - while (trailingZeroes > 0) + else { - self->OutStream(self, digits[0]); - trailingZeroes--; + /* Leading spaces must be before sign */ + if (!(flags & FLAGS_LEFTADJUST)) + { + for (i = expectedWidth; i < width; i++) + { + self->OutStream(self, CHAR_ADJUST); + } + } + if (isNegative) + self->OutStream(self, '-'); + else if (flags & FLAGS_SHOWSIGN) + self->OutStream(self, '+'); + else if (flags & FLAGS_SPACE) + self->OutStream(self, ' '); + if (isHex) + { + self->OutStream(self, '0'); + self->OutStream(self, (flags & FLAGS_UPPER) ? 'X' : 'x'); + } } - } - - /* Output exponent */ - if (exponentDigits > 0) - { - self->OutStream(self, - isHex - ? ((flags & FLAGS_UPPER) ? 'P' : 'p') - : ((flags & FLAGS_UPPER) ? 'E' : 'e')); - self->OutStream(self, (isExponentNegative) ? '-' : '+'); - /* The exponent must contain at least two digits */ - if (requireTwoDigitExponent) - self->OutStream(self, '0'); + /* Output the integer part and thousand separators */ + for (i = 0; i < integerDigits; i++) + { + workNumber = + trio_floor(((integerNumber + integerAdjust) / TrioPower(base, integerDigits - i - 1))); + if (i > integerThreshold) + { + /* Beyond accuracy */ + self->OutStream(self, digits[0]); + } + else + { + self->OutStream(self, digits[(int)trio_fmod(workNumber, dblBase)]); + } - if (isHex) - base = 10; - exponentBase = (int)TrioPower(base, exponentDigits - 1); - for (i = 0; i < exponentDigits; i++) - { - self->OutStream(self, digits[(uExponent / exponentBase) % base]); - exponentBase /= base; +#if TRIO_FEATURE_QUOTE + if (((flags & (FLAGS_FLOAT_E | FLAGS_QUOTE)) == FLAGS_QUOTE) && + TrioFollowedBySeparator(integerDigits - i)) + { + for (groupingPointer = internalThousandSeparator; *groupingPointer != NIL; + groupingPointer++) + { + self->OutStream(self, *groupingPointer); + } + } +#endif } - } - /* Output trailing spaces */ - if (flags & FLAGS_LEFTADJUST) - { - for (i = expectedWidth; i < width; i++) + + /* Insert decimal point and build the fraction part */ + trailingZeroes = 0; + + if (keepDecimalPoint) { - self->OutStream(self, CHAR_ADJUST); + if (internalDecimalPoint) + { + self->OutStream(self, internalDecimalPoint); + } + else + { + for (i = 0; i < internalDecimalPointLength; i++) + { + self->OutStream(self, internalDecimalPointString[i]); + } + } + } + + for (i = 0; i < fractionDigits; i++) + { + if ((integerDigits > integerThreshold) || (i > fractionThreshold)) + { + /* Beyond accuracy */ + trailingZeroes++; + } + else + { + fractionNumber *= dblBase; + fractionAdjust *= dblBase; + workNumber = trio_floor(fractionNumber + fractionAdjust); + if (workNumber > fractionNumber) + { + /* fractionNumber should never become negative */ + fractionNumber = 0.0; + fractionAdjust = 0.0; + } + else + { + fractionNumber -= workNumber; + } + offset = (int)trio_fmod(workNumber, dblBase); + if (offset == 0) + { + trailingZeroes++; + } + else + { + while (trailingZeroes > 0) + { + /* Not trailing zeroes after all */ + self->OutStream(self, digits[0]); + trailingZeroes--; + } + self->OutStream(self, digits[offset]); + } + } + } + + if (keepTrailingZeroes) + { + while (trailingZeroes > 0) + { + self->OutStream(self, digits[0]); + trailingZeroes--; + } + } + + /* Output exponent */ + if (exponentDigits > 0) + { + self->OutStream(self, isHex ? ((flags & FLAGS_UPPER) ? 'P' : 'p') + : ((flags & FLAGS_UPPER) ? 'E' : 'e')); + self->OutStream(self, (isExponentNegative) ? '-' : '+'); + + /* The exponent must contain at least two digits */ + if (requireTwoDigitExponent) + self->OutStream(self, '0'); + + if (isHex) + base = 10; + exponentBase = (int)TrioPower(base, exponentDigits - 1); + for (i = 0; i < exponentDigits; i++) + { + self->OutStream(self, digits[(uExponent / exponentBase) % base]); + exponentBase /= base; + } + } + /* Output trailing spaces */ + if (flags & FLAGS_LEFTADJUST) + { + for (i = expectedWidth; i < width; i++) + { + self->OutStream(self, CHAR_ADJUST); + } } - } } #endif /* TRIO_FEATURE_FLOAT */ @@ -3607,415 +3546,370 @@ TRIO_ARGS6((self, number, flags, width, precision, base), * Description: * This is the main engine for formatting output */ -TRIO_PRIVATE int -TrioFormatProcess -TRIO_ARGS3((data, format, parameters), - trio_class_t *data, - TRIO_CONST char *format, - trio_parameter_t *parameters) +TRIO_PRIVATE int TrioFormatProcess TRIO_ARGS3((data, format, parameters), trio_class_t* data, + TRIO_CONST char* format, trio_parameter_t* parameters) { - int i; + int i; #if TRIO_FEATURE_ERRNO - TRIO_CONST char *string; + TRIO_CONST char* string; #endif - trio_pointer_t pointer; - trio_flags_t flags; - int width; - int precision; - int base; - int offset; - - offset = 0; - i = 0; + trio_pointer_t pointer; + trio_flags_t flags; + int width; + int precision; + int base; + int offset; - for (;;) - { - /* Skip the parameter entries */ - while (parameters[i].type == FORMAT_PARAMETER) - i++; + offset = 0; + i = 0; - /* Copy non conversion-specifier part of format string */ - while (offset < parameters[i].beginOffset) - { - if (CHAR_IDENTIFIER == format[offset] && CHAR_IDENTIFIER == format[offset + 1]) - { - data->OutStream(data, CHAR_IDENTIFIER); - offset += 2; - } - else - { - data->OutStream(data, format[offset++]); - } - } - - /* Abort if we reached end of format string */ - if (parameters[i].type == FORMAT_SENTINEL) - break; - - /* Ouput parameter */ - flags = parameters[i].flags; - - /* Find width */ - width = parameters[i].width; - if (flags & FLAGS_WIDTH_PARAMETER) + for (;;) { - /* Get width from parameter list */ - width = (int)parameters[width].data.number.as_signed; - if (width < 0) - { - /* - * A negative width is the same as the - flag and - * a positive width. - */ - flags |= FLAGS_LEFTADJUST; - flags &= ~FLAGS_NILPADDING; - width = -width; - } - } + /* Skip the parameter entries */ + while (parameters[i].type == FORMAT_PARAMETER) + i++; - /* Find precision */ - if (flags & FLAGS_PRECISION) - { - precision = parameters[i].precision; - if (flags & FLAGS_PRECISION_PARAMETER) - { - /* Get precision from parameter list */ - precision = (int)parameters[precision].data.number.as_signed; - if (precision < 0) + /* Copy non conversion-specifier part of format string */ + while (offset < parameters[i].beginOffset) { - /* - * A negative precision is the same as no - * precision - */ - precision = NO_PRECISION; + if (CHAR_IDENTIFIER == format[offset] && CHAR_IDENTIFIER == format[offset + 1]) + { + data->OutStream(data, CHAR_IDENTIFIER); + offset += 2; + } + else + { + data->OutStream(data, format[offset++]); + } } - } - } - else - { - precision = NO_PRECISION; - } - /* Find base */ - if (NO_BASE != parameters[i].baseSpecifier) - { - /* Base from specifier has priority */ - base = parameters[i].baseSpecifier; - } - else if (flags & FLAGS_BASE_PARAMETER) - { - /* Get base from parameter list */ - base = parameters[i].base; - base = (int)parameters[base].data.number.as_signed; - } - else - { - /* Use base from format string */ - base = parameters[i].base; - } + /* Abort if we reached end of format string */ + if (parameters[i].type == FORMAT_SENTINEL) + break; - switch (parameters[i].type) - { - case FORMAT_CHAR: + /* Ouput parameter */ + flags = parameters[i].flags; + + /* Find width */ + width = parameters[i].width; + if (flags & FLAGS_WIDTH_PARAMETER) + { + /* Get width from parameter list */ + width = (int)parameters[width].data.number.as_signed; + if (width < 0) + { + /* + * A negative width is the same as the - flag and + * a positive width. + */ + flags |= FLAGS_LEFTADJUST; + flags &= ~FLAGS_NILPADDING; + width = -width; + } + } + + /* Find precision */ + if (flags & FLAGS_PRECISION) + { + precision = parameters[i].precision; + if (flags & FLAGS_PRECISION_PARAMETER) + { + /* Get precision from parameter list */ + precision = (int)parameters[precision].data.number.as_signed; + if (precision < 0) + { + /* + * A negative precision is the same as no + * precision + */ + precision = NO_PRECISION; + } + } + } + else + { + precision = NO_PRECISION; + } + + /* Find base */ + if (NO_BASE != parameters[i].baseSpecifier) + { + /* Base from specifier has priority */ + base = parameters[i].baseSpecifier; + } + else if (flags & FLAGS_BASE_PARAMETER) + { + /* Get base from parameter list */ + base = parameters[i].base; + base = (int)parameters[base].data.number.as_signed; + } + else + { + /* Use base from format string */ + base = parameters[i].base; + } + + switch (parameters[i].type) + { + case FORMAT_CHAR: #if TRIO_FEATURE_QUOTE - if (flags & FLAGS_QUOTE) - data->OutStream(data, CHAR_QUOTE); + if (flags & FLAGS_QUOTE) + data->OutStream(data, CHAR_QUOTE); #endif - if (! (flags & FLAGS_LEFTADJUST)) - { - while (--width > 0) - data->OutStream(data, CHAR_ADJUST); - } + if (!(flags & FLAGS_LEFTADJUST)) + { + while (--width > 0) + data->OutStream(data, CHAR_ADJUST); + } #if TRIO_FEATURE_WIDECHAR - if (flags & FLAGS_WIDECHAR) - { - TrioWriteWideStringCharacter(data, - (trio_wchar_t)parameters[i].data.number.as_signed, - flags, - NO_WIDTH); - } - else + if (flags & FLAGS_WIDECHAR) + { + TrioWriteWideStringCharacter( + data, (trio_wchar_t)parameters[i].data.number.as_signed, flags, NO_WIDTH); + } + else #endif - { - TrioWriteStringCharacter(data, - (int)parameters[i].data.number.as_signed, - flags); - } + { + TrioWriteStringCharacter(data, (int)parameters[i].data.number.as_signed, flags); + } - if (flags & FLAGS_LEFTADJUST) - { - while(--width > 0) - data->OutStream(data, CHAR_ADJUST); - } + if (flags & FLAGS_LEFTADJUST) + { + while (--width > 0) + data->OutStream(data, CHAR_ADJUST); + } #if TRIO_FEATURE_QUOTE - if (flags & FLAGS_QUOTE) - data->OutStream(data, CHAR_QUOTE); + if (flags & FLAGS_QUOTE) + data->OutStream(data, CHAR_QUOTE); #endif - break; /* FORMAT_CHAR */ + break; /* FORMAT_CHAR */ - case FORMAT_INT: - TrioWriteNumber(data, - parameters[i].data.number.as_unsigned, - flags, - width, - precision, - base); + case FORMAT_INT: + TrioWriteNumber(data, parameters[i].data.number.as_unsigned, flags, width, + precision, base); - break; /* FORMAT_INT */ + break; /* FORMAT_INT */ #if TRIO_FEATURE_FLOAT - case FORMAT_DOUBLE: - TrioWriteDouble(data, - parameters[i].data.longdoubleNumber, - flags, - width, - precision, - base); - break; /* FORMAT_DOUBLE */ + case FORMAT_DOUBLE: + TrioWriteDouble(data, parameters[i].data.longdoubleNumber, flags, width, precision, + base); + break; /* FORMAT_DOUBLE */ #endif - case FORMAT_STRING: + case FORMAT_STRING: #if TRIO_FEATURE_WIDECHAR - if (flags & FLAGS_WIDECHAR) - { - TrioWriteWideString(data, - parameters[i].data.wstring, - flags, - width, - precision); - } - else + if (flags & FLAGS_WIDECHAR) + { + TrioWriteWideString(data, parameters[i].data.wstring, flags, width, precision); + } + else #endif - { - TrioWriteString(data, - parameters[i].data.string, - flags, - width, - precision); - } - break; /* FORMAT_STRING */ + { + TrioWriteString(data, parameters[i].data.string, flags, width, precision); + } + break; /* FORMAT_STRING */ - case FORMAT_POINTER: - { - trio_reference_t reference; + case FORMAT_POINTER: + { + trio_reference_t reference; - reference.data = data; - reference.parameter = ¶meters[i]; - trio_print_pointer(&reference, parameters[i].data.pointer); - } - break; /* FORMAT_POINTER */ + reference.data = data; + reference.parameter = ¶meters[i]; + trio_print_pointer(&reference, parameters[i].data.pointer); + } + break; /* FORMAT_POINTER */ - case FORMAT_COUNT: - pointer = parameters[i].data.pointer; - if (NULL != pointer) - { - /* - * C99 paragraph 7.19.6.1.8 says "the number of - * characters written to the output stream so far by - * this call", which is data->actually.committed - */ + case FORMAT_COUNT: + pointer = parameters[i].data.pointer; + if (NULL != pointer) + { + /* + * C99 paragraph 7.19.6.1.8 says "the number of + * characters written to the output stream so far by + * this call", which is data->actually.committed + */ #if TRIO_FEATURE_SIZE_T || TRIO_FEATURE_SIZE_T_UPPER - if (flags & FLAGS_SIZE_T) - *(size_t *)pointer = (size_t)data->actually.committed; - else + if (flags & FLAGS_SIZE_T) + *(size_t*)pointer = (size_t)data->actually.committed; + else #endif #if TRIO_FEATURE_PTRDIFF_T - if (flags & FLAGS_PTRDIFF_T) - *(ptrdiff_t *)pointer = (ptrdiff_t)data->actually.committed; - else + if (flags & FLAGS_PTRDIFF_T) + *(ptrdiff_t*)pointer = (ptrdiff_t)data->actually.committed; + else #endif #if TRIO_FEATURE_INTMAX_T - if (flags & FLAGS_INTMAX_T) - *(trio_intmax_t *)pointer = (trio_intmax_t)data->actually.committed; - else + if (flags & FLAGS_INTMAX_T) + *(trio_intmax_t*)pointer = (trio_intmax_t)data->actually.committed; + else #endif - if (flags & FLAGS_QUAD) - { - *(trio_ulonglong_t *)pointer = (trio_ulonglong_t)data->actually.committed; - } - else if (flags & FLAGS_LONG) - { - *(long int *)pointer = (long int)data->actually.committed; - } - else if (flags & FLAGS_SHORT) - { - *(short int *)pointer = (short int)data->actually.committed; - } - else - { - *(int *)pointer = (int)data->actually.committed; - } - } - break; /* FORMAT_COUNT */ + if (flags & FLAGS_QUAD) + { + *(trio_ulonglong_t*)pointer = (trio_ulonglong_t)data->actually.committed; + } + else if (flags & FLAGS_LONG) + { + *(long int*)pointer = (long int)data->actually.committed; + } + else if (flags & FLAGS_SHORT) + { + *(short int*)pointer = (short int)data->actually.committed; + } + else + { + *(int*)pointer = (int)data->actually.committed; + } + } + break; /* FORMAT_COUNT */ - case FORMAT_PARAMETER: - break; /* FORMAT_PARAMETER */ + case FORMAT_PARAMETER: + break; /* FORMAT_PARAMETER */ #if TRIO_FEATURE_ERRNO - case FORMAT_ERRNO: - string = trio_error(parameters[i].data.errorNumber); - if (string) - { - TrioWriteString(data, - string, - flags, - width, - precision); - } - else - { - data->OutStream(data, '#'); - TrioWriteNumber(data, - (trio_uintmax_t)parameters[i].data.errorNumber, - flags, - width, - precision, - BASE_DECIMAL); - } - break; /* FORMAT_ERRNO */ -#endif /* TRIO_FEATURE_ERRNO */ + case FORMAT_ERRNO: + string = trio_error(parameters[i].data.errorNumber); + if (string) + { + TrioWriteString(data, string, flags, width, precision); + } + else + { + data->OutStream(data, '#'); + TrioWriteNumber(data, (trio_uintmax_t)parameters[i].data.errorNumber, flags, + width, precision, BASE_DECIMAL); + } + break; /* FORMAT_ERRNO */ +#endif /* TRIO_FEATURE_ERRNO */ #if TRIO_FEATURE_USER_DEFINED - case FORMAT_USER_DEFINED: - { - trio_reference_t reference; - trio_userdef_t *def = NULL; + case FORMAT_USER_DEFINED: + { + trio_reference_t reference; + trio_userdef_t* def = NULL; - if (parameters[i].flags & FLAGS_USER_DEFINED_PARAMETER) - { - /* Use handle */ - if ((i > 0) || - (parameters[i - 1].type == FORMAT_PARAMETER)) - def = (trio_userdef_t *)parameters[i - 1].data.pointer; - } - else - { - /* Look up namespace */ - def = TrioFindNamespace(parameters[i].user_defined.namespace, NULL); - } - if (def) - { - reference.data = data; - reference.parameter = ¶meters[i]; - def->callback(&reference); - } - } - break; + if (parameters[i].flags & FLAGS_USER_DEFINED_PARAMETER) + { + /* Use handle */ + if ((i > 0) || (parameters[i - 1].type == FORMAT_PARAMETER)) + def = (trio_userdef_t*)parameters[i - 1].data.pointer; + } + else + { + /* Look up namespace */ + def = TrioFindNamespace(parameters[i].user_defined.namespace, NULL); + } + if (def) + { + reference.data = data; + reference.parameter = ¶meters[i]; + def->callback(&reference); + } + } + break; #endif /* TRIO_FEATURE_USER_DEFINED */ - default: - break; - } /* switch parameter type */ + default: + break; + } /* switch parameter type */ - /* Prepare for next */ - offset = parameters[i].endOffset; - i++; - } + /* Prepare for next */ + offset = parameters[i].endOffset; + i++; + } - return data->processed; + return data->processed; } /************************************************************************* * TrioFormatRef */ #if TRIO_EXTENSION -TRIO_PRIVATE int -TrioFormatRef -TRIO_ARGS5((reference, format, arglist, argfunc, argarray), - trio_reference_t *reference, - TRIO_CONST char *format, - va_list arglist, - trio_argfunc_t argfunc, - trio_pointer_t *argarray) +TRIO_PRIVATE int TrioFormatRef TRIO_ARGS5((reference, format, arglist, argfunc, argarray), + trio_reference_t* reference, TRIO_CONST char* format, + va_list arglist, trio_argfunc_t argfunc, + trio_pointer_t* argarray) { - int status; - trio_parameter_t parameters[MAX_PARAMETERS]; + int status; + trio_parameter_t parameters[MAX_PARAMETERS]; - status = TrioParse(TYPE_PRINT, format, parameters, arglist, argfunc, argarray); - if (status < 0) - return status; + status = TrioParse(TYPE_PRINT, format, parameters, arglist, argfunc, argarray); + if (status < 0) + return status; - status = TrioFormatProcess(reference->data, format, parameters); - if (reference->data->error != 0) - { - status = reference->data->error; - } - return status; + status = TrioFormatProcess(reference->data, format, parameters); + if (reference->data->error != 0) + { + status = reference->data->error; + } + return status; } #endif /* TRIO_EXTENSION */ /************************************************************************* * TrioFormat */ -TRIO_PRIVATE int -TrioFormat -TRIO_ARGS7((destination, destinationSize, OutStream, format, arglist, argfunc, argarray), - trio_pointer_t destination, - size_t destinationSize, - void (*OutStream) TRIO_PROTO((trio_class_t *, int)), - TRIO_CONST char *format, - va_list arglist, - trio_argfunc_t argfunc, - trio_pointer_t *argarray) +TRIO_PRIVATE int TrioFormat TRIO_ARGS7((destination, destinationSize, OutStream, format, arglist, + argfunc, argarray), + trio_pointer_t destination, size_t destinationSize, + void(*OutStream) TRIO_PROTO((trio_class_t*, int)), + TRIO_CONST char* format, va_list arglist, + trio_argfunc_t argfunc, trio_pointer_t* argarray) { - int status; - trio_class_t data; - trio_parameter_t parameters[MAX_PARAMETERS]; + int status; + trio_class_t data; + trio_parameter_t parameters[MAX_PARAMETERS]; - assert(VALID(OutStream)); - assert(VALID(format)); + assert(VALID(OutStream)); + assert(VALID(format)); - memset(&data, 0, sizeof(data)); - data.OutStream = OutStream; - data.location = destination; - data.max = destinationSize; - data.error = 0; + memset(&data, 0, sizeof(data)); + data.OutStream = OutStream; + data.location = destination; + data.max = destinationSize; + data.error = 0; #if defined(USE_LOCALE) - if (NULL == internalLocaleValues) - { - TrioSetLocale(); - } + if (NULL == internalLocaleValues) + { + TrioSetLocale(); + } #endif - status = TrioParse(TYPE_PRINT, format, parameters, arglist, argfunc, argarray); - if (status < 0) - return status; + status = TrioParse(TYPE_PRINT, format, parameters, arglist, argfunc, argarray); + if (status < 0) + return status; - status = TrioFormatProcess(&data, format, parameters); - if (data.error != 0) - { - status = data.error; - } - return status; + status = TrioFormatProcess(&data, format, parameters); + if (data.error != 0) + { + status = data.error; + } + return status; } /************************************************************************* * TrioOutStreamFile */ #if TRIO_FEATURE_FILE || TRIO_FEATURE_STDIO -TRIO_PRIVATE void -TrioOutStreamFile -TRIO_ARGS2((self, output), - trio_class_t *self, - int output) +TRIO_PRIVATE void TrioOutStreamFile TRIO_ARGS2((self, output), trio_class_t* self, int output) { - FILE *file; + FILE* file; - assert(VALID(self)); - assert(VALID(self->location)); + assert(VALID(self)); + assert(VALID(self->location)); - file = (FILE *)self->location; - self->processed++; - if (fputc(output, file) == EOF) - { - self->error = TRIO_ERROR_RETURN(TRIO_EOF, 0); - } - else - { - self->actually.committed++; - } + file = (FILE*)self->location; + self->processed++; + if (fputc(output, file) == EOF) + { + self->error = TRIO_ERROR_RETURN(TRIO_EOF, 0); + } + else + { + self->actually.committed++; + } } #endif /* TRIO_FEATURE_FILE || TRIO_FEATURE_STDIO */ @@ -4023,28 +3917,25 @@ TRIO_ARGS2((self, output), * TrioOutStreamFileDescriptor */ #if TRIO_FEATURE_FD -TRIO_PRIVATE void -TrioOutStreamFileDescriptor -TRIO_ARGS2((self, output), - trio_class_t *self, - int output) +TRIO_PRIVATE void TrioOutStreamFileDescriptor TRIO_ARGS2((self, output), trio_class_t* self, + int output) { - int fd; - char ch; + int fd; + char ch; - assert(VALID(self)); + assert(VALID(self)); - fd = *((int *)self->location); - ch = (char)output; - self->processed++; - if (write(fd, &ch, sizeof(char)) == -1) - { - self->error = TRIO_ERROR_RETURN(TRIO_ERRNO, 0); - } - else - { - self->actually.committed++; - } + fd = *((int*)self->location); + ch = (char)output; + self->processed++; + if (write(fd, &ch, sizeof(char)) == -1) + { + self->error = TRIO_ERROR_RETURN(TRIO_ERRNO, 0); + } + else + { + self->actually.committed++; + } } #endif /* TRIO_FEATURE_FD */ @@ -4052,105 +3943,89 @@ TRIO_ARGS2((self, output), * TrioOutStreamCustom */ #if TRIO_FEATURE_CLOSURE -TRIO_PRIVATE void -TrioOutStreamCustom -TRIO_ARGS2((self, output), - trio_class_t *self, - int output) +TRIO_PRIVATE void TrioOutStreamCustom TRIO_ARGS2((self, output), trio_class_t* self, int output) { - int status; - trio_custom_t *data; + int status; + trio_custom_t* data; - assert(VALID(self)); - assert(VALID(self->location)); + assert(VALID(self)); + assert(VALID(self->location)); - data = (trio_custom_t *)self->location; - if (data->stream.out) - { - status = (data->stream.out)(data->closure, output); - if (status >= 0) + data = (trio_custom_t*)self->location; + if (data->stream.out) { - self->actually.committed++; + status = (data->stream.out)(data->closure, output); + if (status >= 0) + { + self->actually.committed++; + } + else + { + if (self->error == 0) + { + self->error = TRIO_ERROR_RETURN(TRIO_ECUSTOM, -status); + } + } } - else - { - if (self->error == 0) - { - self->error = TRIO_ERROR_RETURN(TRIO_ECUSTOM, -status); - } - } - } - self->processed++; + self->processed++; } #endif /* TRIO_FEATURE_CLOSURE */ /************************************************************************* * TrioOutStreamString */ -TRIO_PRIVATE void -TrioOutStreamString -TRIO_ARGS2((self, output), - trio_class_t *self, - int output) +TRIO_PRIVATE void TrioOutStreamString TRIO_ARGS2((self, output), trio_class_t* self, int output) { - char **buffer; + char** buffer; - assert(VALID(self)); - assert(VALID(self->location)); + assert(VALID(self)); + assert(VALID(self->location)); - buffer = (char **)self->location; - **buffer = (char)output; - (*buffer)++; - self->processed++; - self->actually.committed++; + buffer = (char**)self->location; + **buffer = (char)output; + (*buffer)++; + self->processed++; + self->actually.committed++; } /************************************************************************* * TrioOutStreamStringMax */ -TRIO_PRIVATE void -TrioOutStreamStringMax -TRIO_ARGS2((self, output), - trio_class_t *self, - int output) +TRIO_PRIVATE void TrioOutStreamStringMax TRIO_ARGS2((self, output), trio_class_t* self, int output) { - char **buffer; + char** buffer; - assert(VALID(self)); - assert(VALID(self->location)); - - buffer = (char **)self->location; + assert(VALID(self)); + assert(VALID(self->location)); - if (self->processed < self->max) - { - **buffer = (char)output; - (*buffer)++; - self->actually.committed++; - } - self->processed++; + buffer = (char**)self->location; + + if (self->processed < self->max) + { + **buffer = (char)output; + (*buffer)++; + self->actually.committed++; + } + self->processed++; } /************************************************************************* * TrioOutStreamStringDynamic */ #if TRIO_FEATURE_DYNAMICSTRING -TRIO_PRIVATE void -TrioOutStreamStringDynamic -TRIO_ARGS2((self, output), - trio_class_t *self, - int output) +TRIO_PRIVATE void TrioOutStreamStringDynamic TRIO_ARGS2((self, output), trio_class_t* self, + int output) { - assert(VALID(self)); - assert(VALID(self->location)); + assert(VALID(self)); + assert(VALID(self->location)); - if (self->error == 0) - { - trio_xstring_append_char((trio_string_t *)self->location, - (char)output); - self->actually.committed++; - } - /* The processed variable must always be increased */ - self->processed++; + if (self->error == 0) + { + trio_xstring_append_char((trio_string_t*)self->location, (char)output); + self->actually.committed++; + } + /* The processed variable must always be increased */ + self->processed++; } #endif /* TRIO_FEATURE_DYNAMICSTRING */ @@ -4159,9 +4034,9 @@ TRIO_ARGS2((self, output), */ trio_pointer_t TrioArrayGetter(trio_pointer_t context, int index, int type) { - /* Utility function for the printfv family */ - trio_pointer_t *argarray = (trio_pointer_t *)context; - return argarray[index]; + /* Utility function for the printfv family */ + trio_pointer_t* argarray = (trio_pointer_t*)context; + return argarray[index]; } /************************************************************************* @@ -4186,21 +4061,17 @@ trio_pointer_t TrioArrayGetter(trio_pointer_t context, int index, int type) @return Number of printed characters. */ #if TRIO_FEATURE_STDIO -TRIO_PUBLIC int -trio_printf -TRIO_VARGS2((format, va_alist), - TRIO_CONST char *format, - TRIO_VA_DECL) +TRIO_PUBLIC int trio_printf TRIO_VARGS2((format, va_alist), TRIO_CONST char* format, TRIO_VA_DECL) { - int status; - va_list args; + int status; + va_list args; - assert(VALID(format)); - - TRIO_VA_START(args, format); - status = TrioFormat(stdout, 0, TrioOutStreamFile, format, args, NULL, NULL); - TRIO_VA_END(args); - return status; + assert(VALID(format)); + + TRIO_VA_START(args, format); + status = TrioFormat(stdout, 0, TrioOutStreamFile, format, args, NULL, NULL); + TRIO_VA_END(args); + return status; } #endif /* TRIO_FEATURE_STDIO */ @@ -4212,15 +4083,11 @@ TRIO_VARGS2((format, va_alist), @return Number of printed characters. */ #if TRIO_FEATURE_STDIO -TRIO_PUBLIC int -trio_vprintf -TRIO_ARGS2((format, args), - TRIO_CONST char *format, - va_list args) +TRIO_PUBLIC int trio_vprintf TRIO_ARGS2((format, args), TRIO_CONST char* format, va_list args) { - assert(VALID(format)); + assert(VALID(format)); - return TrioFormat(stdout, 0, TrioOutStreamFile, format, args, NULL, NULL); + return TrioFormat(stdout, 0, TrioOutStreamFile, format, args, NULL, NULL); } #endif /* TRIO_FEATURE_STDIO */ @@ -4232,18 +4099,14 @@ TRIO_ARGS2((format, args), @return Number of printed characters. */ #if TRIO_FEATURE_STDIO -TRIO_PUBLIC int -trio_printfv -TRIO_ARGS2((format, args), - TRIO_CONST char *format, - trio_pointer_t * args) +TRIO_PUBLIC int trio_printfv TRIO_ARGS2((format, args), TRIO_CONST char* format, + trio_pointer_t* args) { - static va_list unused; - - assert(VALID(format)); + static va_list unused; - return TrioFormat(stdout, 0, TrioOutStreamFile, format, - unused, TrioArrayGetter, args); + assert(VALID(format)); + + return TrioFormat(stdout, 0, TrioOutStreamFile, format, unused, TrioArrayGetter, args); } #endif /* TRIO_FEATURE_STDIO */ @@ -4260,23 +4123,19 @@ TRIO_ARGS2((format, args), @return Number of printed characters. */ #if TRIO_FEATURE_FILE -TRIO_PUBLIC int -trio_fprintf -TRIO_VARGS3((file, format, va_alist), - FILE *file, - TRIO_CONST char *format, - TRIO_VA_DECL) +TRIO_PUBLIC int trio_fprintf TRIO_VARGS3((file, format, va_alist), FILE* file, + TRIO_CONST char* format, TRIO_VA_DECL) { - int status; - va_list args; + int status; + va_list args; - assert(VALID(file)); - assert(VALID(format)); - - TRIO_VA_START(args, format); - status = TrioFormat(file, 0, TrioOutStreamFile, format, args, NULL, NULL); - TRIO_VA_END(args); - return status; + assert(VALID(file)); + assert(VALID(format)); + + TRIO_VA_START(args, format); + status = TrioFormat(file, 0, TrioOutStreamFile, format, args, NULL, NULL); + TRIO_VA_END(args); + return status; } #endif /* TRIO_FEATURE_FILE */ @@ -4289,17 +4148,13 @@ TRIO_VARGS3((file, format, va_alist), @return Number of printed characters. */ #if TRIO_FEATURE_FILE -TRIO_PUBLIC int -trio_vfprintf -TRIO_ARGS3((file, format, args), - FILE *file, - TRIO_CONST char *format, - va_list args) +TRIO_PUBLIC int trio_vfprintf TRIO_ARGS3((file, format, args), FILE* file, TRIO_CONST char* format, + va_list args) { - assert(VALID(file)); - assert(VALID(format)); - - return TrioFormat(file, 0, TrioOutStreamFile, format, args, NULL, NULL); + assert(VALID(file)); + assert(VALID(format)); + + return TrioFormat(file, 0, TrioOutStreamFile, format, args, NULL, NULL); } #endif /* TRIO_FEATURE_FILE */ @@ -4312,20 +4167,15 @@ TRIO_ARGS3((file, format, args), @return Number of printed characters. */ #if TRIO_FEATURE_FILE -TRIO_PUBLIC int -trio_fprintfv -TRIO_ARGS3((file, format, args), - FILE *file, - TRIO_CONST char *format, - trio_pointer_t * args) +TRIO_PUBLIC int trio_fprintfv TRIO_ARGS3((file, format, args), FILE* file, TRIO_CONST char* format, + trio_pointer_t* args) { - static va_list unused; + static va_list unused; - assert(VALID(file)); - assert(VALID(format)); + assert(VALID(file)); + assert(VALID(format)); - return TrioFormat(file, 0, TrioOutStreamFile, format, - unused, TrioArrayGetter, args); + return TrioFormat(file, 0, TrioOutStreamFile, format, unused, TrioArrayGetter, args); } #endif /* TRIO_FEATURE_FILE */ @@ -4342,22 +4192,18 @@ TRIO_ARGS3((file, format, args), @return Number of printed characters. */ #if TRIO_FEATURE_FD -TRIO_PUBLIC int -trio_dprintf -TRIO_VARGS3((fd, format, va_alist), - int fd, - TRIO_CONST char *format, - TRIO_VA_DECL) +TRIO_PUBLIC int trio_dprintf TRIO_VARGS3((fd, format, va_alist), int fd, TRIO_CONST char* format, + TRIO_VA_DECL) { - int status; - va_list args; + int status; + va_list args; - assert(VALID(format)); - - TRIO_VA_START(args, format); - status = TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, args, NULL, NULL); - TRIO_VA_END(args); - return status; + assert(VALID(format)); + + TRIO_VA_START(args, format); + status = TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, args, NULL, NULL); + TRIO_VA_END(args); + return status; } #endif /* TRIO_FEATURE_FD */ @@ -4370,16 +4216,12 @@ TRIO_VARGS3((fd, format, va_alist), @return Number of printed characters. */ #if TRIO_FEATURE_FD -TRIO_PUBLIC int -trio_vdprintf -TRIO_ARGS3((fd, format, args), - int fd, - TRIO_CONST char *format, - va_list args) +TRIO_PUBLIC int trio_vdprintf TRIO_ARGS3((fd, format, args), int fd, TRIO_CONST char* format, + va_list args) { - assert(VALID(format)); - - return TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, args, NULL, NULL); + assert(VALID(format)); + + return TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, args, NULL, NULL); } #endif /* TRIO_FEATURE_FD */ @@ -4392,19 +4234,14 @@ TRIO_ARGS3((fd, format, args), @return Number of printed characters. */ #if TRIO_FEATURE_FD -TRIO_PUBLIC int -trio_dprintfv -TRIO_ARGS3((fd, format, args), - int fd, - TRIO_CONST char *format, - trio_pointer_t *args) +TRIO_PUBLIC int trio_dprintfv TRIO_ARGS3((fd, format, args), int fd, TRIO_CONST char* format, + trio_pointer_t* args) { - static va_list unused; - - assert(VALID(format)); - - return TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, - unused, TrioArrayGetter, args); + static va_list unused; + + assert(VALID(format)); + + return TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, unused, TrioArrayGetter, args); } #endif /* TRIO_FEATURE_FD */ @@ -4412,93 +4249,76 @@ TRIO_ARGS3((fd, format, args), * cprintf */ #if TRIO_FEATURE_CLOSURE -TRIO_PUBLIC int -trio_cprintf -TRIO_VARGS4((stream, closure, format, va_alist), - trio_outstream_t stream, - trio_pointer_t closure, - TRIO_CONST char *format, - TRIO_VA_DECL) +TRIO_PUBLIC int trio_cprintf TRIO_VARGS4((stream, closure, format, va_alist), + trio_outstream_t stream, trio_pointer_t closure, + TRIO_CONST char* format, TRIO_VA_DECL) { - int status; - va_list args; - trio_custom_t data; + int status; + va_list args; + trio_custom_t data; - assert(VALID(stream)); - assert(VALID(format)); + assert(VALID(stream)); + assert(VALID(format)); - TRIO_VA_START(args, format); - data.stream.out = stream; - data.closure = closure; - status = TrioFormat(&data, 0, TrioOutStreamCustom, format, args, NULL, NULL); - TRIO_VA_END(args); - return status; + TRIO_VA_START(args, format); + data.stream.out = stream; + data.closure = closure; + status = TrioFormat(&data, 0, TrioOutStreamCustom, format, args, NULL, NULL); + TRIO_VA_END(args); + return status; } #endif /* TRIO_FEATURE_CLOSURE */ #if TRIO_FEATURE_CLOSURE -TRIO_PUBLIC int -trio_vcprintf -TRIO_ARGS4((stream, closure, format, args), - trio_outstream_t stream, - trio_pointer_t closure, - TRIO_CONST char *format, - va_list args) +TRIO_PUBLIC int trio_vcprintf TRIO_ARGS4((stream, closure, format, args), trio_outstream_t stream, + trio_pointer_t closure, TRIO_CONST char* format, + va_list args) { - trio_custom_t data; + trio_custom_t data; - assert(VALID(stream)); - assert(VALID(format)); + assert(VALID(stream)); + assert(VALID(format)); - data.stream.out = stream; - data.closure = closure; - return TrioFormat(&data, 0, TrioOutStreamCustom, format, args, NULL, NULL); + data.stream.out = stream; + data.closure = closure; + return TrioFormat(&data, 0, TrioOutStreamCustom, format, args, NULL, NULL); } #endif /* TRIO_FEATURE_CLOSURE */ #if TRIO_FEATURE_CLOSURE -TRIO_PUBLIC int -trio_cprintfv -TRIO_ARGS4((stream, closure, format, args), - trio_outstream_t stream, - trio_pointer_t closure, - TRIO_CONST char *format, - trio_pointer_t *args) +TRIO_PUBLIC int trio_cprintfv TRIO_ARGS4((stream, closure, format, args), trio_outstream_t stream, + trio_pointer_t closure, TRIO_CONST char* format, + trio_pointer_t* args) { - static va_list unused; - trio_custom_t data; + static va_list unused; + trio_custom_t data; - assert(VALID(stream)); - assert(VALID(format)); + assert(VALID(stream)); + assert(VALID(format)); - data.stream.out = stream; - data.closure = closure; - return TrioFormat(&data, 0, TrioOutStreamCustom, format, - unused, TrioArrayGetter, args); + data.stream.out = stream; + data.closure = closure; + return TrioFormat(&data, 0, TrioOutStreamCustom, format, unused, TrioArrayGetter, args); } #endif /* TRIO_FEATURE_CLOSURE */ #if TRIO_FEATURE_CLOSURE && TRIO_FEATURE_ARGFUNC -TRIO_PUBLIC int -trio_cprintff -TRIO_ARGS5((stream, closure, format, argfunc, context), - trio_outstream_t stream, - trio_pointer_t closure, - TRIO_CONST char *format, - trio_argfunc_t argfunc, - trio_pointer_t context) +TRIO_PUBLIC int trio_cprintff TRIO_ARGS5((stream, closure, format, argfunc, context), + trio_outstream_t stream, trio_pointer_t closure, + TRIO_CONST char* format, trio_argfunc_t argfunc, + trio_pointer_t context) { - static va_list unused; - trio_custom_t data; + static va_list unused; + trio_custom_t data; - assert(VALID(stream)); - assert(VALID(format)); - assert(VALID(argfunc)); + assert(VALID(stream)); + assert(VALID(format)); + assert(VALID(argfunc)); - data.stream.out = stream; - data.closure = closure; - return TrioFormat(&data, 0, TrioOutStreamCustom, format, - unused, argfunc, (trio_pointer_t *)context); + data.stream.out = stream; + data.closure = closure; + return TrioFormat(&data, 0, TrioOutStreamCustom, format, unused, argfunc, + (trio_pointer_t*)context); } #endif /* TRIO_FEATURE_CLOSURE && TRIO_FEATURE_ARGFUNC */ @@ -4514,24 +4334,20 @@ TRIO_ARGS5((stream, closure, format, argfunc, context), @param ... Arguments. @return Number of printed characters. */ -TRIO_PUBLIC int -trio_sprintf -TRIO_VARGS3((buffer, format, va_alist), - char *buffer, - TRIO_CONST char *format, - TRIO_VA_DECL) +TRIO_PUBLIC int trio_sprintf TRIO_VARGS3((buffer, format, va_alist), char* buffer, + TRIO_CONST char* format, TRIO_VA_DECL) { - int status; - va_list args; + int status; + va_list args; - assert(VALID(buffer)); - assert(VALID(format)); - - TRIO_VA_START(args, format); - status = TrioFormat(&buffer, 0, TrioOutStreamString, format, args, NULL, NULL); - *buffer = NIL; /* Terminate with NIL character */ - TRIO_VA_END(args); - return status; + assert(VALID(buffer)); + assert(VALID(format)); + + TRIO_VA_START(args, format); + status = TrioFormat(&buffer, 0, TrioOutStreamString, format, args, NULL, NULL); + *buffer = NIL; /* Terminate with NIL character */ + TRIO_VA_END(args); + return status; } /** @@ -4542,21 +4358,17 @@ TRIO_VARGS3((buffer, format, va_alist), @param args Arguments. @return Number of printed characters. */ -TRIO_PUBLIC int -trio_vsprintf -TRIO_ARGS3((buffer, format, args), - char *buffer, - TRIO_CONST char *format, - va_list args) +TRIO_PUBLIC int trio_vsprintf TRIO_ARGS3((buffer, format, args), char* buffer, + TRIO_CONST char* format, va_list args) { - int status; + int status; - assert(VALID(buffer)); - assert(VALID(format)); + assert(VALID(buffer)); + assert(VALID(format)); - status = TrioFormat(&buffer, 0, TrioOutStreamString, format, args, NULL, NULL); - *buffer = NIL; - return status; + status = TrioFormat(&buffer, 0, TrioOutStreamString, format, args, NULL, NULL); + *buffer = NIL; + return status; } /** @@ -4567,23 +4379,18 @@ TRIO_ARGS3((buffer, format, args), @param args Arguments. @return Number of printed characters. */ -TRIO_PUBLIC int -trio_sprintfv -TRIO_ARGS3((buffer, format, args), - char *buffer, - TRIO_CONST char *format, - trio_pointer_t *args) +TRIO_PUBLIC int trio_sprintfv TRIO_ARGS3((buffer, format, args), char* buffer, + TRIO_CONST char* format, trio_pointer_t* args) { - static va_list unused; - int status; - - assert(VALID(buffer)); - assert(VALID(format)); + static va_list unused; + int status; - status = TrioFormat(&buffer, 0, TrioOutStreamString, format, - unused, TrioArrayGetter, args); - *buffer = NIL; - return status; + assert(VALID(buffer)); + assert(VALID(format)); + + status = TrioFormat(&buffer, 0, TrioOutStreamString, format, unused, TrioArrayGetter, args); + *buffer = NIL; + return status; } /************************************************************************* @@ -4599,27 +4406,22 @@ TRIO_ARGS3((buffer, format, args), @param ... Arguments. @return Number of printed characters. */ -TRIO_PUBLIC int -trio_snprintf -TRIO_VARGS4((buffer, max, format, va_alist), - char *buffer, - size_t max, - TRIO_CONST char *format, - TRIO_VA_DECL) +TRIO_PUBLIC int trio_snprintf TRIO_VARGS4((buffer, max, format, va_alist), char* buffer, size_t max, + TRIO_CONST char* format, TRIO_VA_DECL) { - int status; - va_list args; + int status; + va_list args; - assert(VALID(buffer) || (max == 0)); - assert(VALID(format)); + assert(VALID(buffer) || (max == 0)); + assert(VALID(format)); - TRIO_VA_START(args, format); - status = TrioFormat(&buffer, max > 0 ? max - 1 : 0, - TrioOutStreamStringMax, format, args, NULL, NULL); - if (max > 0) - *buffer = NIL; - TRIO_VA_END(args); - return status; + TRIO_VA_START(args, format); + status = TrioFormat(&buffer, max > 0 ? max - 1 : 0, TrioOutStreamStringMax, format, args, NULL, + NULL); + if (max > 0) + *buffer = NIL; + TRIO_VA_END(args); + return status; } /** @@ -4631,24 +4433,19 @@ TRIO_VARGS4((buffer, max, format, va_alist), @param args Arguments. @return Number of printed characters. */ -TRIO_PUBLIC int -trio_vsnprintf -TRIO_ARGS4((buffer, max, format, args), - char *buffer, - size_t max, - TRIO_CONST char *format, - va_list args) +TRIO_PUBLIC int trio_vsnprintf TRIO_ARGS4((buffer, max, format, args), char* buffer, size_t max, + TRIO_CONST char* format, va_list args) { - int status; + int status; - assert(VALID(buffer) || (max == 0)); - assert(VALID(format)); + assert(VALID(buffer) || (max == 0)); + assert(VALID(format)); - status = TrioFormat(&buffer, max > 0 ? max - 1 : 0, - TrioOutStreamStringMax, format, args, NULL, NULL); - if (max > 0) - *buffer = NIL; - return status; + status = TrioFormat(&buffer, max > 0 ? max - 1 : 0, TrioOutStreamStringMax, format, args, NULL, + NULL); + if (max > 0) + *buffer = NIL; + return status; } /** @@ -4660,26 +4457,20 @@ TRIO_ARGS4((buffer, max, format, args), @param args Arguments. @return Number of printed characters. */ -TRIO_PUBLIC int -trio_snprintfv -TRIO_ARGS4((buffer, max, format, args), - char *buffer, - size_t max, - TRIO_CONST char *format, - trio_pointer_t *args) +TRIO_PUBLIC int trio_snprintfv TRIO_ARGS4((buffer, max, format, args), char* buffer, size_t max, + TRIO_CONST char* format, trio_pointer_t* args) { - static va_list unused; - int status; + static va_list unused; + int status; - assert(VALID(buffer) || (max == 0)); - assert(VALID(format)); + assert(VALID(buffer) || (max == 0)); + assert(VALID(format)); - status = TrioFormat(&buffer, max > 0 ? max - 1 : 0, - TrioOutStreamStringMax, format, - unused, TrioArrayGetter, args); - if (max > 0) - *buffer = NIL; - return status; + status = TrioFormat(&buffer, max > 0 ? max - 1 : 0, TrioOutStreamStringMax, format, unused, + TrioArrayGetter, args); + if (max > 0) + *buffer = NIL; + return status; } /************************************************************************* @@ -4688,55 +4479,45 @@ TRIO_ARGS4((buffer, max, format, args), * character at the end of buffer. */ #if TRIO_EXTENSION -TRIO_PUBLIC int -trio_snprintfcat -TRIO_VARGS4((buffer, max, format, va_alist), - char *buffer, - size_t max, - TRIO_CONST char *format, - TRIO_VA_DECL) +TRIO_PUBLIC int trio_snprintfcat TRIO_VARGS4((buffer, max, format, va_alist), char* buffer, + size_t max, TRIO_CONST char* format, TRIO_VA_DECL) { - int status; - va_list args; - size_t buf_len; + int status; + va_list args; + size_t buf_len; - TRIO_VA_START(args, format); + TRIO_VA_START(args, format); - assert(VALID(buffer)); - assert(VALID(format)); + assert(VALID(buffer)); + assert(VALID(format)); - buf_len = trio_length(buffer); - buffer = &buffer[buf_len]; + buf_len = trio_length(buffer); + buffer = &buffer[buf_len]; - status = TrioFormat(&buffer, max - 1 - buf_len, - TrioOutStreamStringMax, format, args, NULL, NULL); - TRIO_VA_END(args); - *buffer = NIL; - return status; + status = + TrioFormat(&buffer, max - 1 - buf_len, TrioOutStreamStringMax, format, args, NULL, NULL); + TRIO_VA_END(args); + *buffer = NIL; + return status; } #endif #if TRIO_EXTENSION -TRIO_PUBLIC int -trio_vsnprintfcat -TRIO_ARGS4((buffer, max, format, args), - char *buffer, - size_t max, - TRIO_CONST char *format, - va_list args) +TRIO_PUBLIC int trio_vsnprintfcat TRIO_ARGS4((buffer, max, format, args), char* buffer, size_t max, + TRIO_CONST char* format, va_list args) { - int status; - size_t buf_len; - - assert(VALID(buffer)); - assert(VALID(format)); + int status; + size_t buf_len; - buf_len = trio_length(buffer); - buffer = &buffer[buf_len]; - status = TrioFormat(&buffer, max - 1 - buf_len, - TrioOutStreamStringMax, format, args, NULL, NULL); - *buffer = NIL; - return status; + assert(VALID(buffer)); + assert(VALID(format)); + + buf_len = trio_length(buffer); + buffer = &buffer[buf_len]; + status = + TrioFormat(&buffer, max - 1 - buf_len, TrioOutStreamStringMax, format, args, NULL, NULL); + *buffer = NIL; + return status; } #endif @@ -4745,56 +4526,47 @@ TRIO_ARGS4((buffer, max, format, args), */ #if TRIO_DEPRECATED && TRIO_FEATURE_DYNAMICSTRING -TRIO_PUBLIC char * -trio_aprintf -TRIO_VARGS2((format, va_alist), - TRIO_CONST char *format, - TRIO_VA_DECL) +TRIO_PUBLIC char* trio_aprintf TRIO_VARGS2((format, va_alist), TRIO_CONST char* format, + TRIO_VA_DECL) { - va_list args; - trio_string_t *info; - char *result = NULL; + va_list args; + trio_string_t* info; + char* result = NULL; - assert(VALID(format)); - - info = trio_xstring_duplicate(""); - if (info) - { - TRIO_VA_START(args, format); - (void)TrioFormat(info, 0, TrioOutStreamStringDynamic, - format, args, NULL, NULL); - TRIO_VA_END(args); + assert(VALID(format)); - trio_string_terminate(info); - result = trio_string_extract(info); - trio_string_destroy(info); - } - return result; + info = trio_xstring_duplicate(""); + if (info) + { + TRIO_VA_START(args, format); + (void)TrioFormat(info, 0, TrioOutStreamStringDynamic, format, args, NULL, NULL); + TRIO_VA_END(args); + + trio_string_terminate(info); + result = trio_string_extract(info); + trio_string_destroy(info); + } + return result; } #endif /* TRIO_DEPRECATED && TRIO_FEATURE_DYNAMICSTRING */ #if TRIO_DEPRECATED && TRIO_FEATURE_DYNAMICSTRING -TRIO_PUBLIC char * -trio_vaprintf -TRIO_ARGS2((format, args), - TRIO_CONST char *format, - va_list args) +TRIO_PUBLIC char* trio_vaprintf TRIO_ARGS2((format, args), TRIO_CONST char* format, va_list args) { - trio_string_t *info; - char *result = NULL; - - assert(VALID(format)); - - info = trio_xstring_duplicate(""); - if (info) - { - (void)TrioFormat(info, 0, TrioOutStreamStringDynamic, - format, args, NULL, NULL); - trio_string_terminate(info); - result = trio_string_extract(info); - trio_string_destroy(info); - } - return result; + trio_string_t* info; + char* result = NULL; + + assert(VALID(format)); + + info = trio_xstring_duplicate(""); + if (info) + { + (void)TrioFormat(info, 0, TrioOutStreamStringDynamic, format, args, NULL, NULL); + trio_string_terminate(info); + result = trio_string_extract(info); + trio_string_destroy(info); + } + return result; } #endif /* TRIO_DEPRECATED && TRIO_FEATURE_DYNAMICSTRING */ @@ -4809,40 +4581,35 @@ TRIO_ARGS2((format, args), @return Number of printed characters. */ #if TRIO_FEATURE_DYNAMICSTRING -TRIO_PUBLIC int -trio_asprintf -TRIO_VARGS3((result, format, va_alist), - char **result, - TRIO_CONST char *format, - TRIO_VA_DECL) +TRIO_PUBLIC int trio_asprintf TRIO_VARGS3((result, format, va_alist), char** result, + TRIO_CONST char* format, TRIO_VA_DECL) { - va_list args; - int status; - trio_string_t *info; + va_list args; + int status; + trio_string_t* info; - assert(VALID(format)); + assert(VALID(format)); - *result = NULL; - - info = trio_xstring_duplicate(""); - if (info == NULL) - { - status = TRIO_ERROR_RETURN(TRIO_ENOMEM, 0); - } - else - { - TRIO_VA_START(args, format); - status = TrioFormat(info, 0, TrioOutStreamStringDynamic, - format, args, NULL, NULL); - TRIO_VA_END(args); - if (status >= 0) + *result = NULL; + + info = trio_xstring_duplicate(""); + if (info == NULL) { - trio_string_terminate(info); - *result = trio_string_extract(info); + status = TRIO_ERROR_RETURN(TRIO_ENOMEM, 0); } - trio_string_destroy(info); - } - return status; + else + { + TRIO_VA_START(args, format); + status = TrioFormat(info, 0, TrioOutStreamStringDynamic, format, args, NULL, NULL); + TRIO_VA_END(args); + if (status >= 0) + { + trio_string_terminate(info); + *result = trio_string_extract(info); + } + trio_string_destroy(info); + } + return status; } #endif /* TRIO_FEATURE_DYNAMICSTRING */ @@ -4857,37 +4624,32 @@ TRIO_VARGS3((result, format, va_alist), @return Number of printed characters. */ #if TRIO_FEATURE_DYNAMICSTRING -TRIO_PUBLIC int -trio_vasprintf -TRIO_ARGS3((result, format, args), - char **result, - TRIO_CONST char *format, - va_list args) +TRIO_PUBLIC int trio_vasprintf TRIO_ARGS3((result, format, args), char** result, + TRIO_CONST char* format, va_list args) { - int status; - trio_string_t *info; - - assert(VALID(format)); + int status; + trio_string_t* info; - *result = NULL; - - info = trio_xstring_duplicate(""); - if (info == NULL) - { - status = TRIO_ERROR_RETURN(TRIO_ENOMEM, 0); - } - else - { - status = TrioFormat(info, 0, TrioOutStreamStringDynamic, - format, args, NULL, NULL); - if (status >= 0) + assert(VALID(format)); + + *result = NULL; + + info = trio_xstring_duplicate(""); + if (info == NULL) { - trio_string_terminate(info); - *result = trio_string_extract(info); + status = TRIO_ERROR_RETURN(TRIO_ENOMEM, 0); } - trio_string_destroy(info); - } - return status; + else + { + status = TrioFormat(info, 0, TrioOutStreamStringDynamic, format, args, NULL, NULL); + if (status >= 0) + { + trio_string_terminate(info); + *result = trio_string_extract(info); + } + trio_string_destroy(info); + } + return status; } #endif /* TRIO_FEATURE_DYNAMICSTRING */ @@ -4902,43 +4664,39 @@ TRIO_ARGS3((result, format, args), @return Number of printed characters. */ #if TRIO_FEATURE_DYNAMICSTRING -TRIO_PUBLIC int -trio_asprintfv -TRIO_ARGS3((result, format, args), - char **result, - TRIO_CONST char *format, - trio_pointer_t * args) +TRIO_PUBLIC int trio_asprintfv TRIO_ARGS3((result, format, args), char** result, + TRIO_CONST char* format, trio_pointer_t* args) { - static va_list unused; - int status; - trio_string_t *info; - - assert(VALID(format)); + static va_list unused; + int status; + trio_string_t* info; - *result = NULL; + assert(VALID(format)); - info = trio_xstring_duplicate(""); - if (info == NULL) - { - status = TRIO_ERROR_RETURN(TRIO_ENOMEM, 0); - } - else - { - status = TrioFormat(info, 0, TrioOutStreamStringDynamic, format, - unused, TrioArrayGetter, args); - if (status >= 0) - { - trio_string_terminate(info); - *result = trio_string_extract(info); - } - trio_string_destroy(info); - } - return status; + *result = NULL; + + info = trio_xstring_duplicate(""); + if (info == NULL) + { + status = TRIO_ERROR_RETURN(TRIO_ENOMEM, 0); + } + else + { + status = + TrioFormat(info, 0, TrioOutStreamStringDynamic, format, unused, TrioArrayGetter, args); + if (status >= 0) + { + trio_string_terminate(info); + *result = trio_string_extract(info); + } + trio_string_destroy(info); + } + return status; } #endif /* TRIO_FEATURE_DYNAMICSTRING */ #if defined(TRIO_DOCUMENTATION) -# include "doc/doc_printf.h" +#include "doc/doc_printf.h" #endif /** @} End of Printf documentation module */ @@ -4950,7 +4708,7 @@ TRIO_ARGS3((result, format, args), ************************************************************************/ #if defined(TRIO_DOCUMENTATION) -# include "doc/doc_register.h" +#include "doc/doc_register.h" #endif /** @addtogroup UserDefined @@ -4970,69 +4728,64 @@ TRIO_ARGS3((result, format, args), @param name @return Handle. */ -TRIO_PUBLIC trio_pointer_t -trio_register -TRIO_ARGS2((callback, name), - trio_callback_t callback, - TRIO_CONST char *name) +TRIO_PUBLIC trio_pointer_t trio_register TRIO_ARGS2((callback, name), trio_callback_t callback, + TRIO_CONST char* name) { - trio_userdef_t *def; - trio_userdef_t *prev = NULL; + trio_userdef_t* def; + trio_userdef_t* prev = NULL; - if (callback == NULL) - return NULL; + if (callback == NULL) + return NULL; - if (name) - { - /* Handle built-in namespaces */ - if (name[0] == ':') + if (name) { - if (trio_equal(name, ":enter")) - { - internalEnterCriticalRegion = callback; - } - else if (trio_equal(name, ":leave")) - { - internalLeaveCriticalRegion = callback; - } - return NULL; - } - - /* Bail out if namespace is too long */ - if (trio_length(name) >= MAX_USER_NAME) - return NULL; - - /* Bail out if namespace already is registered */ - def = TrioFindNamespace(name, &prev); - if (def) - return NULL; - } - - def = (trio_userdef_t *)TRIO_MALLOC(sizeof(trio_userdef_t)); - if (def) - { - if (internalEnterCriticalRegion) - (void)internalEnterCriticalRegion(NULL); - - if (name) - { - /* Link into internal list */ - if (prev == NULL) - internalUserDef = def; - else - prev->next = def; - } - /* Initialize */ - def->callback = callback; - def->name = (name == NULL) - ? NULL - : trio_duplicate(name); - def->next = NULL; + /* Handle built-in namespaces */ + if (name[0] == ':') + { + if (trio_equal(name, ":enter")) + { + internalEnterCriticalRegion = callback; + } + else if (trio_equal(name, ":leave")) + { + internalLeaveCriticalRegion = callback; + } + return NULL; + } - if (internalLeaveCriticalRegion) - (void)internalLeaveCriticalRegion(NULL); - } - return (trio_pointer_t)def; + /* Bail out if namespace is too long */ + if (trio_length(name) >= MAX_USER_NAME) + return NULL; + + /* Bail out if namespace already is registered */ + def = TrioFindNamespace(name, &prev); + if (def) + return NULL; + } + + def = (trio_userdef_t*)TRIO_MALLOC(sizeof(trio_userdef_t)); + if (def) + { + if (internalEnterCriticalRegion) + (void)internalEnterCriticalRegion(NULL); + + if (name) + { + /* Link into internal list */ + if (prev == NULL) + internalUserDef = def; + else + prev->next = def; + } + /* Initialize */ + def->callback = callback; + def->name = (name == NULL) ? NULL : trio_duplicate(name); + def->next = NULL; + + if (internalLeaveCriticalRegion) + (void)internalLeaveCriticalRegion(NULL); + } + return (trio_pointer_t)def; } /** @@ -5040,456 +4793,309 @@ TRIO_ARGS2((callback, name), @param handle */ -void -trio_unregister -TRIO_ARGS1((handle), - trio_pointer_t handle) +void trio_unregister TRIO_ARGS1((handle), trio_pointer_t handle) { - trio_userdef_t *self = (trio_userdef_t *)handle; - trio_userdef_t *def; - trio_userdef_t *prev = NULL; + trio_userdef_t* self = (trio_userdef_t*)handle; + trio_userdef_t* def; + trio_userdef_t* prev = NULL; - assert(VALID(self)); + assert(VALID(self)); - if (self->name) - { - def = TrioFindNamespace(self->name, &prev); - if (def) + if (self->name) { - if (internalEnterCriticalRegion) - (void)internalEnterCriticalRegion(NULL); - - if (prev == NULL) - internalUserDef = internalUserDef->next; - else - prev->next = def->next; - - if (internalLeaveCriticalRegion) - (void)internalLeaveCriticalRegion(NULL); + def = TrioFindNamespace(self->name, &prev); + if (def) + { + if (internalEnterCriticalRegion) + (void)internalEnterCriticalRegion(NULL); + + if (prev == NULL) + internalUserDef = internalUserDef->next; + else + prev->next = def->next; + + if (internalLeaveCriticalRegion) + (void)internalLeaveCriticalRegion(NULL); + } + trio_destroy(self->name); } - trio_destroy(self->name); - } - TRIO_FREE(self); + TRIO_FREE(self); } /************************************************************************* * trio_get_format [public] */ -TRIO_CONST char * -trio_get_format -TRIO_ARGS1((ref), - trio_pointer_t ref) +TRIO_CONST char* trio_get_format TRIO_ARGS1((ref), trio_pointer_t ref) { #if TRIO_FEATURE_USER_DEFINED - assert(((trio_reference_t *)ref)->parameter->type == FORMAT_USER_DEFINED); + assert(((trio_reference_t*)ref)->parameter->type == FORMAT_USER_DEFINED); #endif - - return (((trio_reference_t *)ref)->parameter->user_data); + + return (((trio_reference_t*)ref)->parameter->user_data); } /************************************************************************* * trio_get_argument [public] */ -trio_pointer_t -trio_get_argument -TRIO_ARGS1((ref), - trio_pointer_t ref) +trio_pointer_t trio_get_argument TRIO_ARGS1((ref), trio_pointer_t ref) { #if TRIO_FEATURE_USER_DEFINED - assert(((trio_reference_t *)ref)->parameter->type == FORMAT_USER_DEFINED); + assert(((trio_reference_t*)ref)->parameter->type == FORMAT_USER_DEFINED); #endif - return ((trio_reference_t *)ref)->parameter->data.pointer; + return ((trio_reference_t*)ref)->parameter->data.pointer; } /************************************************************************* * trio_get_width / trio_set_width [public] */ -int -trio_get_width -TRIO_ARGS1((ref), - trio_pointer_t ref) +int trio_get_width TRIO_ARGS1((ref), trio_pointer_t ref) { - return ((trio_reference_t *)ref)->parameter->width; + return ((trio_reference_t*)ref)->parameter->width; } -void -trio_set_width -TRIO_ARGS2((ref, width), - trio_pointer_t ref, - int width) +void trio_set_width TRIO_ARGS2((ref, width), trio_pointer_t ref, int width) { - ((trio_reference_t *)ref)->parameter->width = width; + ((trio_reference_t*)ref)->parameter->width = width; } /************************************************************************* * trio_get_precision / trio_set_precision [public] */ -int -trio_get_precision -TRIO_ARGS1((ref), - trio_pointer_t ref) +int trio_get_precision TRIO_ARGS1((ref), trio_pointer_t ref) { - return (((trio_reference_t *)ref)->parameter->precision); + return (((trio_reference_t*)ref)->parameter->precision); } -void -trio_set_precision -TRIO_ARGS2((ref, precision), - trio_pointer_t ref, - int precision) +void trio_set_precision TRIO_ARGS2((ref, precision), trio_pointer_t ref, int precision) { - ((trio_reference_t *)ref)->parameter->precision = precision; + ((trio_reference_t*)ref)->parameter->precision = precision; } /************************************************************************* * trio_get_base / trio_set_base [public] */ -int -trio_get_base -TRIO_ARGS1((ref), - trio_pointer_t ref) +int trio_get_base TRIO_ARGS1((ref), trio_pointer_t ref) { - return (((trio_reference_t *)ref)->parameter->base); + return (((trio_reference_t*)ref)->parameter->base); } -void -trio_set_base -TRIO_ARGS2((ref, base), - trio_pointer_t ref, - int base) +void trio_set_base TRIO_ARGS2((ref, base), trio_pointer_t ref, int base) { - ((trio_reference_t *)ref)->parameter->base = base; + ((trio_reference_t*)ref)->parameter->base = base; } /************************************************************************* * trio_get_long / trio_set_long [public] */ -int -trio_get_long -TRIO_ARGS1((ref), - trio_pointer_t ref) +int trio_get_long TRIO_ARGS1((ref), trio_pointer_t ref) { - return (((trio_reference_t *)ref)->parameter->flags & FLAGS_LONG) - ? TRUE - : FALSE; + return (((trio_reference_t*)ref)->parameter->flags & FLAGS_LONG) ? TRUE : FALSE; } -void -trio_set_long -TRIO_ARGS2((ref, is_long), - trio_pointer_t ref, - int is_long) +void trio_set_long TRIO_ARGS2((ref, is_long), trio_pointer_t ref, int is_long) { - if (is_long) - ((trio_reference_t *)ref)->parameter->flags |= FLAGS_LONG; - else - ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_LONG; + if (is_long) + ((trio_reference_t*)ref)->parameter->flags |= FLAGS_LONG; + else + ((trio_reference_t*)ref)->parameter->flags &= ~FLAGS_LONG; } /************************************************************************* * trio_get_longlong / trio_set_longlong [public] */ -int -trio_get_longlong -TRIO_ARGS1((ref), - trio_pointer_t ref) +int trio_get_longlong TRIO_ARGS1((ref), trio_pointer_t ref) { - return (((trio_reference_t *)ref)->parameter->flags & FLAGS_QUAD) - ? TRUE - : FALSE; + return (((trio_reference_t*)ref)->parameter->flags & FLAGS_QUAD) ? TRUE : FALSE; } -void -trio_set_longlong -TRIO_ARGS2((ref, is_longlong), - trio_pointer_t ref, - int is_longlong) +void trio_set_longlong TRIO_ARGS2((ref, is_longlong), trio_pointer_t ref, int is_longlong) { - if (is_longlong) - ((trio_reference_t *)ref)->parameter->flags |= FLAGS_QUAD; - else - ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_QUAD; + if (is_longlong) + ((trio_reference_t*)ref)->parameter->flags |= FLAGS_QUAD; + else + ((trio_reference_t*)ref)->parameter->flags &= ~FLAGS_QUAD; } /************************************************************************* * trio_get_longdouble / trio_set_longdouble [public] */ -# if TRIO_FEATURE_FLOAT -int -trio_get_longdouble -TRIO_ARGS1((ref), - trio_pointer_t ref) +#if TRIO_FEATURE_FLOAT +int trio_get_longdouble TRIO_ARGS1((ref), trio_pointer_t ref) { - return (((trio_reference_t *)ref)->parameter->flags & FLAGS_LONGDOUBLE) - ? TRUE - : FALSE; + return (((trio_reference_t*)ref)->parameter->flags & FLAGS_LONGDOUBLE) ? TRUE : FALSE; } -void -trio_set_longdouble -TRIO_ARGS2((ref, is_longdouble), - trio_pointer_t ref, - int is_longdouble) +void trio_set_longdouble TRIO_ARGS2((ref, is_longdouble), trio_pointer_t ref, int is_longdouble) { - if (is_longdouble) - ((trio_reference_t *)ref)->parameter->flags |= FLAGS_LONGDOUBLE; - else - ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_LONGDOUBLE; + if (is_longdouble) + ((trio_reference_t*)ref)->parameter->flags |= FLAGS_LONGDOUBLE; + else + ((trio_reference_t*)ref)->parameter->flags &= ~FLAGS_LONGDOUBLE; } -# endif /* TRIO_FEATURE_FLOAT */ +#endif /* TRIO_FEATURE_FLOAT */ /************************************************************************* * trio_get_short / trio_set_short [public] */ -int -trio_get_short -TRIO_ARGS1((ref), - trio_pointer_t ref) +int trio_get_short TRIO_ARGS1((ref), trio_pointer_t ref) { - return (((trio_reference_t *)ref)->parameter->flags & FLAGS_SHORT) - ? TRUE - : FALSE; + return (((trio_reference_t*)ref)->parameter->flags & FLAGS_SHORT) ? TRUE : FALSE; } -void -trio_set_short -TRIO_ARGS2((ref, is_short), - trio_pointer_t ref, - int is_short) +void trio_set_short TRIO_ARGS2((ref, is_short), trio_pointer_t ref, int is_short) { - if (is_short) - ((trio_reference_t *)ref)->parameter->flags |= FLAGS_SHORT; - else - ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_SHORT; + if (is_short) + ((trio_reference_t*)ref)->parameter->flags |= FLAGS_SHORT; + else + ((trio_reference_t*)ref)->parameter->flags &= ~FLAGS_SHORT; } /************************************************************************* * trio_get_shortshort / trio_set_shortshort [public] */ -int -trio_get_shortshort -TRIO_ARGS1((ref), - trio_pointer_t ref) +int trio_get_shortshort TRIO_ARGS1((ref), trio_pointer_t ref) { - return (((trio_reference_t *)ref)->parameter->flags & FLAGS_SHORTSHORT) - ? TRUE - : FALSE; + return (((trio_reference_t*)ref)->parameter->flags & FLAGS_SHORTSHORT) ? TRUE : FALSE; } -void -trio_set_shortshort -TRIO_ARGS2((ref, is_shortshort), - trio_pointer_t ref, - int is_shortshort) +void trio_set_shortshort TRIO_ARGS2((ref, is_shortshort), trio_pointer_t ref, int is_shortshort) { - if (is_shortshort) - ((trio_reference_t *)ref)->parameter->flags |= FLAGS_SHORTSHORT; - else - ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_SHORTSHORT; + if (is_shortshort) + ((trio_reference_t*)ref)->parameter->flags |= FLAGS_SHORTSHORT; + else + ((trio_reference_t*)ref)->parameter->flags &= ~FLAGS_SHORTSHORT; } /************************************************************************* * trio_get_alternative / trio_set_alternative [public] */ -int -trio_get_alternative -TRIO_ARGS1((ref), - trio_pointer_t ref) +int trio_get_alternative TRIO_ARGS1((ref), trio_pointer_t ref) { - return (((trio_reference_t *)ref)->parameter->flags & FLAGS_ALTERNATIVE) - ? TRUE - : FALSE; + return (((trio_reference_t*)ref)->parameter->flags & FLAGS_ALTERNATIVE) ? TRUE : FALSE; } -void -trio_set_alternative -TRIO_ARGS2((ref, is_alternative), - trio_pointer_t ref, - int is_alternative) +void trio_set_alternative TRIO_ARGS2((ref, is_alternative), trio_pointer_t ref, int is_alternative) { - if (is_alternative) - ((trio_reference_t *)ref)->parameter->flags |= FLAGS_ALTERNATIVE; - else - ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_ALTERNATIVE; + if (is_alternative) + ((trio_reference_t*)ref)->parameter->flags |= FLAGS_ALTERNATIVE; + else + ((trio_reference_t*)ref)->parameter->flags &= ~FLAGS_ALTERNATIVE; } /************************************************************************* * trio_get_alignment / trio_set_alignment [public] */ -int -trio_get_alignment -TRIO_ARGS1((ref), - trio_pointer_t ref) +int trio_get_alignment TRIO_ARGS1((ref), trio_pointer_t ref) { - return (((trio_reference_t *)ref)->parameter->flags & FLAGS_LEFTADJUST) - ? TRUE - : FALSE; + return (((trio_reference_t*)ref)->parameter->flags & FLAGS_LEFTADJUST) ? TRUE : FALSE; } -void -trio_set_alignment -TRIO_ARGS2((ref, is_leftaligned), - trio_pointer_t ref, - int is_leftaligned) +void trio_set_alignment TRIO_ARGS2((ref, is_leftaligned), trio_pointer_t ref, int is_leftaligned) { - if (is_leftaligned) - ((trio_reference_t *)ref)->parameter->flags |= FLAGS_LEFTADJUST; - else - ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_LEFTADJUST; + if (is_leftaligned) + ((trio_reference_t*)ref)->parameter->flags |= FLAGS_LEFTADJUST; + else + ((trio_reference_t*)ref)->parameter->flags &= ~FLAGS_LEFTADJUST; } /************************************************************************* * trio_get_spacing /trio_set_spacing [public] */ -int -trio_get_spacing -TRIO_ARGS1((ref), - trio_pointer_t ref) +int trio_get_spacing TRIO_ARGS1((ref), trio_pointer_t ref) { - return (((trio_reference_t *)ref)->parameter->flags & FLAGS_SPACE) - ? TRUE - : FALSE; + return (((trio_reference_t*)ref)->parameter->flags & FLAGS_SPACE) ? TRUE : FALSE; } -void -trio_set_spacing -TRIO_ARGS2((ref, is_space), - trio_pointer_t ref, - int is_space) +void trio_set_spacing TRIO_ARGS2((ref, is_space), trio_pointer_t ref, int is_space) { - if (is_space) - ((trio_reference_t *)ref)->parameter->flags |= FLAGS_SPACE; - else - ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_SPACE; + if (is_space) + ((trio_reference_t*)ref)->parameter->flags |= FLAGS_SPACE; + else + ((trio_reference_t*)ref)->parameter->flags &= ~FLAGS_SPACE; } /************************************************************************* * trio_get_sign / trio_set_sign [public] */ -int -trio_get_sign -TRIO_ARGS1((ref), - trio_pointer_t ref) +int trio_get_sign TRIO_ARGS1((ref), trio_pointer_t ref) { - return (((trio_reference_t *)ref)->parameter->flags & FLAGS_SHOWSIGN) - ? TRUE - : FALSE; + return (((trio_reference_t*)ref)->parameter->flags & FLAGS_SHOWSIGN) ? TRUE : FALSE; } -void -trio_set_sign -TRIO_ARGS2((ref, is_sign), - trio_pointer_t ref, - int is_sign) +void trio_set_sign TRIO_ARGS2((ref, is_sign), trio_pointer_t ref, int is_sign) { - if (is_sign) - ((trio_reference_t *)ref)->parameter->flags |= FLAGS_SHOWSIGN; - else - ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_SHOWSIGN; + if (is_sign) + ((trio_reference_t*)ref)->parameter->flags |= FLAGS_SHOWSIGN; + else + ((trio_reference_t*)ref)->parameter->flags &= ~FLAGS_SHOWSIGN; } /************************************************************************* * trio_get_padding / trio_set_padding [public] */ -int -trio_get_padding -TRIO_ARGS1((ref), - trio_pointer_t ref) +int trio_get_padding TRIO_ARGS1((ref), trio_pointer_t ref) { - return (((trio_reference_t *)ref)->parameter->flags & FLAGS_NILPADDING) - ? TRUE - : FALSE; + return (((trio_reference_t*)ref)->parameter->flags & FLAGS_NILPADDING) ? TRUE : FALSE; } -void -trio_set_padding -TRIO_ARGS2((ref, is_padding), - trio_pointer_t ref, - int is_padding) +void trio_set_padding TRIO_ARGS2((ref, is_padding), trio_pointer_t ref, int is_padding) { - if (is_padding) - ((trio_reference_t *)ref)->parameter->flags |= FLAGS_NILPADDING; - else - ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_NILPADDING; + if (is_padding) + ((trio_reference_t*)ref)->parameter->flags |= FLAGS_NILPADDING; + else + ((trio_reference_t*)ref)->parameter->flags &= ~FLAGS_NILPADDING; } /************************************************************************* * trio_get_quote / trio_set_quote [public] */ -# if TRIO_FEATURE_QUOTE -int -trio_get_quote -TRIO_ARGS1((ref), - trio_pointer_t ref) +#if TRIO_FEATURE_QUOTE +int trio_get_quote TRIO_ARGS1((ref), trio_pointer_t ref) { - return (((trio_reference_t *)ref)->parameter->flags & FLAGS_QUOTE) - ? TRUE - : FALSE; + return (((trio_reference_t*)ref)->parameter->flags & FLAGS_QUOTE) ? TRUE : FALSE; } -void -trio_set_quote -TRIO_ARGS2((ref, is_quote), - trio_pointer_t ref, - int is_quote) +void trio_set_quote TRIO_ARGS2((ref, is_quote), trio_pointer_t ref, int is_quote) { - if (is_quote) - ((trio_reference_t *)ref)->parameter->flags |= FLAGS_QUOTE; - else - ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_QUOTE; + if (is_quote) + ((trio_reference_t*)ref)->parameter->flags |= FLAGS_QUOTE; + else + ((trio_reference_t*)ref)->parameter->flags &= ~FLAGS_QUOTE; } #endif /* TRIO_FEATURE_QUOTE */ /************************************************************************* * trio_get_upper / trio_set_upper [public] */ -int -trio_get_upper -TRIO_ARGS1((ref), - trio_pointer_t ref) +int trio_get_upper TRIO_ARGS1((ref), trio_pointer_t ref) { - return (((trio_reference_t *)ref)->parameter->flags & FLAGS_UPPER) - ? TRUE - : FALSE; + return (((trio_reference_t*)ref)->parameter->flags & FLAGS_UPPER) ? TRUE : FALSE; } -void -trio_set_upper -TRIO_ARGS2((ref, is_upper), - trio_pointer_t ref, - int is_upper) +void trio_set_upper TRIO_ARGS2((ref, is_upper), trio_pointer_t ref, int is_upper) { - if (is_upper) - ((trio_reference_t *)ref)->parameter->flags |= FLAGS_UPPER; - else - ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_UPPER; + if (is_upper) + ((trio_reference_t*)ref)->parameter->flags |= FLAGS_UPPER; + else + ((trio_reference_t*)ref)->parameter->flags &= ~FLAGS_UPPER; } /************************************************************************* * trio_get_largest / trio_set_largest [public] */ #if TRIO_FEATURE_INTMAX_T -int -trio_get_largest -TRIO_ARGS1((ref), - trio_pointer_t ref) +int trio_get_largest TRIO_ARGS1((ref), trio_pointer_t ref) { - return (((trio_reference_t *)ref)->parameter->flags & FLAGS_INTMAX_T) - ? TRUE - : FALSE; + return (((trio_reference_t*)ref)->parameter->flags & FLAGS_INTMAX_T) ? TRUE : FALSE; } -void -trio_set_largest -TRIO_ARGS2((ref, is_largest), - trio_pointer_t ref, - int is_largest) +void trio_set_largest TRIO_ARGS2((ref, is_largest), trio_pointer_t ref, int is_largest) { - if (is_largest) - ((trio_reference_t *)ref)->parameter->flags |= FLAGS_INTMAX_T; - else - ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_INTMAX_T; + if (is_largest) + ((trio_reference_t*)ref)->parameter->flags |= FLAGS_INTMAX_T; + else + ((trio_reference_t*)ref)->parameter->flags &= ~FLAGS_INTMAX_T; } #endif /* TRIO_FEATURE_INTMAX_T */ @@ -5497,26 +5103,17 @@ TRIO_ARGS2((ref, is_largest), * trio_get_ptrdiff / trio_set_ptrdiff [public] */ #if TRIO_FEATURE_PTRDIFF_T -int -trio_get_ptrdiff -TRIO_ARGS1((ref), - trio_pointer_t ref) +int trio_get_ptrdiff TRIO_ARGS1((ref), trio_pointer_t ref) { - return (((trio_reference_t *)ref)->parameter->flags & FLAGS_PTRDIFF_T) - ? TRUE - : FALSE; + return (((trio_reference_t*)ref)->parameter->flags & FLAGS_PTRDIFF_T) ? TRUE : FALSE; } -void -trio_set_ptrdiff -TRIO_ARGS2((ref, is_ptrdiff), - trio_pointer_t ref, - int is_ptrdiff) +void trio_set_ptrdiff TRIO_ARGS2((ref, is_ptrdiff), trio_pointer_t ref, int is_ptrdiff) { - if (is_ptrdiff) - ((trio_reference_t *)ref)->parameter->flags |= FLAGS_PTRDIFF_T; - else - ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_PTRDIFF_T; + if (is_ptrdiff) + ((trio_reference_t*)ref)->parameter->flags |= FLAGS_PTRDIFF_T; + else + ((trio_reference_t*)ref)->parameter->flags &= ~FLAGS_PTRDIFF_T; } #endif /* TRIO_FEATURE_PTRDIFF_T */ @@ -5524,158 +5121,105 @@ TRIO_ARGS2((ref, is_ptrdiff), * trio_get_size / trio_set_size [public] */ #if TRIO_FEATURE_SIZE_T -int -trio_get_size -TRIO_ARGS1((ref), - trio_pointer_t ref) +int trio_get_size TRIO_ARGS1((ref), trio_pointer_t ref) { - return (((trio_reference_t *)ref)->parameter->flags & FLAGS_SIZE_T) - ? TRUE - : FALSE; + return (((trio_reference_t*)ref)->parameter->flags & FLAGS_SIZE_T) ? TRUE : FALSE; } -void -trio_set_size -TRIO_ARGS2((ref, is_size), - trio_pointer_t ref, - int is_size) +void trio_set_size TRIO_ARGS2((ref, is_size), trio_pointer_t ref, int is_size) { - if (is_size) - ((trio_reference_t *)ref)->parameter->flags |= FLAGS_SIZE_T; - else - ((trio_reference_t *)ref)->parameter->flags &= ~FLAGS_SIZE_T; + if (is_size) + ((trio_reference_t*)ref)->parameter->flags |= FLAGS_SIZE_T; + else + ((trio_reference_t*)ref)->parameter->flags &= ~FLAGS_SIZE_T; } #endif /* TRIO_FEATURE_SIZE_T */ /************************************************************************* * trio_print_int [public] */ -void -trio_print_int -TRIO_ARGS2((ref, number), - trio_pointer_t ref, - int number) +void trio_print_int TRIO_ARGS2((ref, number), trio_pointer_t ref, int number) { - trio_reference_t *self = (trio_reference_t *)ref; + trio_reference_t* self = (trio_reference_t*)ref; - TrioWriteNumber(self->data, - (trio_uintmax_t)number, - self->parameter->flags, - self->parameter->width, - self->parameter->precision, - self->parameter->base); + TrioWriteNumber(self->data, (trio_uintmax_t)number, self->parameter->flags, + self->parameter->width, self->parameter->precision, self->parameter->base); } /************************************************************************* * trio_print_uint [public] */ -void -trio_print_uint -TRIO_ARGS2((ref, number), - trio_pointer_t ref, - unsigned int number) +void trio_print_uint TRIO_ARGS2((ref, number), trio_pointer_t ref, unsigned int number) { - trio_reference_t *self = (trio_reference_t *)ref; + trio_reference_t* self = (trio_reference_t*)ref; - TrioWriteNumber(self->data, - (trio_uintmax_t)number, - self->parameter->flags | FLAGS_UNSIGNED, - self->parameter->width, - self->parameter->precision, - self->parameter->base); + TrioWriteNumber(self->data, (trio_uintmax_t)number, self->parameter->flags | FLAGS_UNSIGNED, + self->parameter->width, self->parameter->precision, self->parameter->base); } /************************************************************************* * trio_print_double [public] */ #if TRIO_FEATURE_FLOAT -void -trio_print_double -TRIO_ARGS2((ref, number), - trio_pointer_t ref, - double number) +void trio_print_double TRIO_ARGS2((ref, number), trio_pointer_t ref, double number) { - trio_reference_t *self = (trio_reference_t *)ref; + trio_reference_t* self = (trio_reference_t*)ref; - TrioWriteDouble(self->data, - number, - self->parameter->flags, - self->parameter->width, - self->parameter->precision, - self->parameter->base); + TrioWriteDouble(self->data, number, self->parameter->flags, self->parameter->width, + self->parameter->precision, self->parameter->base); } #endif /* TRIO_FEATURE_FLOAT */ /************************************************************************* * trio_print_string [public] */ -void -trio_print_string -TRIO_ARGS2((ref, string), - trio_pointer_t ref, - TRIO_CONST char *string) +void trio_print_string TRIO_ARGS2((ref, string), trio_pointer_t ref, TRIO_CONST char* string) { - trio_reference_t *self = (trio_reference_t *)ref; + trio_reference_t* self = (trio_reference_t*)ref; - TrioWriteString(self->data, - string, - self->parameter->flags, - self->parameter->width, - self->parameter->precision); + TrioWriteString(self->data, string, self->parameter->flags, self->parameter->width, + self->parameter->precision); } /************************************************************************* * trio_print_ref [public] */ -int -trio_print_ref -TRIO_VARGS3((ref, format, va_alist), - trio_pointer_t ref, - TRIO_CONST char *format, - TRIO_VA_DECL) +int trio_print_ref TRIO_VARGS3((ref, format, va_alist), trio_pointer_t ref, TRIO_CONST char* format, + TRIO_VA_DECL) { - int status; - va_list arglist; + int status; + va_list arglist; - assert(VALID(format)); - - TRIO_VA_START(arglist, format); - status = TrioFormatRef((trio_reference_t *)ref, format, arglist, NULL, NULL); - TRIO_VA_END(arglist); - return status; + assert(VALID(format)); + + TRIO_VA_START(arglist, format); + status = TrioFormatRef((trio_reference_t*)ref, format, arglist, NULL, NULL); + TRIO_VA_END(arglist); + return status; } /************************************************************************* * trio_vprint_ref [public] */ -int -trio_vprint_ref -TRIO_ARGS3((ref, format, arglist), - trio_pointer_t ref, - TRIO_CONST char *format, - va_list arglist) +int trio_vprint_ref TRIO_ARGS3((ref, format, arglist), trio_pointer_t ref, TRIO_CONST char* format, + va_list arglist) { - assert(VALID(format)); - - return TrioFormatRef((trio_reference_t *)ref, format, arglist, NULL, NULL); + assert(VALID(format)); + + return TrioFormatRef((trio_reference_t*)ref, format, arglist, NULL, NULL); } /************************************************************************* * trio_printv_ref [public] */ -int -trio_printv_ref -TRIO_ARGS3((ref, format, argarray), - trio_pointer_t ref, - TRIO_CONST char *format, - trio_pointer_t *argarray) +int trio_printv_ref TRIO_ARGS3((ref, format, argarray), trio_pointer_t ref, TRIO_CONST char* format, + trio_pointer_t* argarray) { - static va_list unused; - - assert(VALID(format)); - - return TrioFormatRef((trio_reference_t *)ref, format, - unused, TrioArrayGetter, argarray); + static va_list unused; + + assert(VALID(format)); + + return TrioFormatRef((trio_reference_t*)ref, format, unused, TrioArrayGetter, argarray); } #endif @@ -5683,44 +5227,34 @@ TRIO_ARGS3((ref, format, argarray), /************************************************************************* * trio_print_pointer [public] */ -void -trio_print_pointer -TRIO_ARGS2((ref, pointer), - trio_pointer_t ref, - trio_pointer_t pointer) +void trio_print_pointer TRIO_ARGS2((ref, pointer), trio_pointer_t ref, trio_pointer_t pointer) { - trio_reference_t *self = (trio_reference_t *)ref; - trio_flags_t flags; - trio_uintmax_t number; + trio_reference_t* self = (trio_reference_t*)ref; + trio_flags_t flags; + trio_uintmax_t number; - if (NULL == pointer) - { - TRIO_CONST char *string = internalNullString; - while (*string) - self->data->OutStream(self->data, *string++); - } - else - { - /* - * The subtraction of the null pointer is a workaround - * to avoid a compiler warning. The performance overhead - * is negligible (and likely to be removed by an - * optimizing compiler). The (char *) casting is done - * to please ANSI C++. - */ - number = (trio_uintmax_t)((char *)pointer - (char *)0); - /* Shrink to size of pointer */ - number &= (trio_uintmax_t)-1; - flags = self->parameter->flags; - flags |= (FLAGS_UNSIGNED | FLAGS_ALTERNATIVE | - FLAGS_NILPADDING); - TrioWriteNumber(self->data, - number, - flags, - POINTER_WIDTH, - NO_PRECISION, - BASE_HEX); - } + if (NULL == pointer) + { + TRIO_CONST char* string = internalNullString; + while (*string) + self->data->OutStream(self->data, *string++); + } + else + { + /* + * The subtraction of the null pointer is a workaround + * to avoid a compiler warning. The performance overhead + * is negligible (and likely to be removed by an + * optimizing compiler). The (char *) casting is done + * to please ANSI C++. + */ + number = (trio_uintmax_t)((char*)pointer - (char*)0); + /* Shrink to size of pointer */ + number &= (trio_uintmax_t)-1; + flags = self->parameter->flags; + flags |= (FLAGS_UNSIGNED | FLAGS_ALTERNATIVE | FLAGS_NILPADDING); + TrioWriteNumber(self->data, number, flags, POINTER_WIDTH, NO_PRECISION, BASE_HEX); + } } /** @} End of UserDefined documentation module */ @@ -5739,29 +5273,24 @@ TRIO_ARGS2((ref, pointer), * will be used. */ #if TRIO_FEATURE_LOCALE -TRIO_PUBLIC void -trio_locale_set_decimal_point -TRIO_ARGS1((decimalPoint), - char *decimalPoint) +TRIO_PUBLIC void trio_locale_set_decimal_point TRIO_ARGS1((decimalPoint), char* decimalPoint) { #if defined(USE_LOCALE) - if (NULL == internalLocaleValues) - { - TrioSetLocale(); - } + if (NULL == internalLocaleValues) + { + TrioSetLocale(); + } #endif - internalDecimalPointLength = trio_length(decimalPoint); - if (internalDecimalPointLength == 1) - { - internalDecimalPoint = *decimalPoint; - } - else - { - internalDecimalPoint = NIL; - trio_copy_max(internalDecimalPointString, - sizeof(internalDecimalPointString), - decimalPoint); - } + internalDecimalPointLength = trio_length(decimalPoint); + if (internalDecimalPointLength == 1) + { + internalDecimalPoint = *decimalPoint; + } + else + { + internalDecimalPoint = NIL; + trio_copy_max(internalDecimalPointString, sizeof(internalDecimalPointString), decimalPoint); + } } #endif @@ -5771,21 +5300,17 @@ TRIO_ARGS1((decimalPoint), * See trio_locale_set_decimal_point */ #if TRIO_FEATURE_LOCALE || TRIO_EXTENSION -TRIO_PUBLIC void -trio_locale_set_thousand_separator -TRIO_ARGS1((thousandSeparator), - char *thousandSeparator) +TRIO_PUBLIC void trio_locale_set_thousand_separator TRIO_ARGS1((thousandSeparator), + char* thousandSeparator) { -# if defined(USE_LOCALE) - if (NULL == internalLocaleValues) - { - TrioSetLocale(); - } -# endif - trio_copy_max(internalThousandSeparator, - sizeof(internalThousandSeparator), - thousandSeparator); - internalThousandSeparatorLength = trio_length(internalThousandSeparator); +#if defined(USE_LOCALE) + if (NULL == internalLocaleValues) + { + TrioSetLocale(); + } +#endif + trio_copy_max(internalThousandSeparator, sizeof(internalThousandSeparator), thousandSeparator); + internalThousandSeparatorLength = trio_length(internalThousandSeparator); } #endif @@ -5802,24 +5327,18 @@ TRIO_ARGS1((thousandSeparator), * Same order as the grouping attribute in LC_NUMERIC. */ #if TRIO_FEATURE_LOCALE || TRIO_EXTENSION -TRIO_PUBLIC void -trio_locale_set_grouping -TRIO_ARGS1((grouping), - char *grouping) +TRIO_PUBLIC void trio_locale_set_grouping TRIO_ARGS1((grouping), char* grouping) { -# if defined(USE_LOCALE) - if (NULL == internalLocaleValues) - { - TrioSetLocale(); - } -# endif - trio_copy_max(internalGrouping, - sizeof(internalGrouping), - grouping); +#if defined(USE_LOCALE) + if (NULL == internalLocaleValues) + { + TrioSetLocale(); + } +#endif + trio_copy_max(internalGrouping, sizeof(internalGrouping), grouping); } #endif - /************************************************************************* * * SCANNING @@ -5831,49 +5350,45 @@ TRIO_ARGS1((grouping), /************************************************************************* * TrioSkipWhitespaces */ -TRIO_PRIVATE int -TrioSkipWhitespaces -TRIO_ARGS1((self), - trio_class_t *self) +TRIO_PRIVATE int TrioSkipWhitespaces TRIO_ARGS1((self), trio_class_t* self) { - int ch; + int ch; - ch = self->current; - while (isspace(ch)) - { - self->InStream(self, &ch); - } - return ch; + ch = self->current; + while (isspace(ch)) + { + self->InStream(self, &ch); + } + return ch; } /************************************************************************* * TrioGetCollation */ #if TRIO_EXTENSION -TRIO_PRIVATE void -TrioGetCollation(TRIO_NOARGS) +TRIO_PRIVATE void TrioGetCollation(TRIO_NOARGS) { - int i; - int j; - int k; - char first[2]; - char second[2]; + int i; + int j; + int k; + char first[2]; + char second[2]; - /* This is computationally expensive */ - first[1] = NIL; - second[1] = NIL; - for (i = 0; i < MAX_CHARACTER_CLASS; i++) - { - k = 0; - first[0] = (char)i; - for (j = 0; j < MAX_CHARACTER_CLASS; j++) + /* This is computationally expensive */ + first[1] = NIL; + second[1] = NIL; + for (i = 0; i < MAX_CHARACTER_CLASS; i++) { - second[0] = (char)j; - if (trio_equal_locale(first, second)) - internalCollationArray[i][k++] = (char)j; + k = 0; + first[0] = (char)i; + for (j = 0; j < MAX_CHARACTER_CLASS; j++) + { + second[0] = (char)j; + if (trio_equal_locale(first, second)) + internalCollationArray[i][k++] = (char)j; + } + internalCollationArray[i][k] = NIL; } - internalCollationArray[i][k] = NIL; - } } #endif @@ -5883,257 +5398,251 @@ TrioGetCollation(TRIO_NOARGS) * FIXME: * multibyte */ -TRIO_PRIVATE int -TrioGetCharacterClass -TRIO_ARGS4((format, offsetPointer, flagsPointer, characterclass), - TRIO_CONST char *format, - int *offsetPointer, - trio_flags_t *flagsPointer, - int *characterclass) +TRIO_PRIVATE int TrioGetCharacterClass TRIO_ARGS4((format, offsetPointer, flagsPointer, + characterclass), + TRIO_CONST char* format, int* offsetPointer, + trio_flags_t* flagsPointer, int* characterclass) { - int offset = *offsetPointer; - int i; - char ch; - char range_begin; - char range_end; + int offset = *offsetPointer; + int i; + char ch; + char range_begin; + char range_end; - *flagsPointer &= ~FLAGS_EXCLUDE; + *flagsPointer &= ~FLAGS_EXCLUDE; - if (format[offset] == QUALIFIER_CIRCUMFLEX) - { - *flagsPointer |= FLAGS_EXCLUDE; - offset++; - } - /* - * If the ungroup character is at the beginning of the scanlist, - * it will be part of the class, and a second ungroup character - * must follow to end the group. - */ - if (format[offset] == SPECIFIER_UNGROUP) - { - characterclass[(int)SPECIFIER_UNGROUP]++; - offset++; - } - /* - * Minus is used to specify ranges. To include minus in the class, - * it must be at the beginning of the list - */ - if (format[offset] == QUALIFIER_MINUS) - { - characterclass[(int)QUALIFIER_MINUS]++; - offset++; - } - /* Collect characters */ - for (ch = format[offset]; - (ch != SPECIFIER_UNGROUP) && (ch != NIL); - ch = format[++offset]) - { - switch (ch) + if (format[offset] == QUALIFIER_CIRCUMFLEX) { - case QUALIFIER_MINUS: /* Scanlist ranges */ - - /* - * Both C99 and UNIX98 describes ranges as implementation- - * defined. - * - * We support the following behaviour (although this may - * change as we become wiser) - * - only increasing ranges, ie. [a-b] but not [b-a] - * - transitive ranges, ie. [a-b-c] == [a-c] - * - trailing minus, ie. [a-] is interpreted as an 'a' - * and a '-' - * - duplicates (although we can easily convert these - * into errors) - */ - range_begin = format[offset - 1]; - range_end = format[++offset]; - if (range_end == SPECIFIER_UNGROUP) - { - /* Trailing minus is included */ - characterclass[(int)ch]++; - ch = range_end; - break; /* for */ - } - if (range_end == NIL) - return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); - if (range_begin > range_end) - return TRIO_ERROR_RETURN(TRIO_ERANGE, offset); - - for (i = (int)range_begin; i <= (int)range_end; i++) - characterclass[i]++; - - ch = range_end; - break; - + *flagsPointer |= FLAGS_EXCLUDE; + offset++; + } + /* + * If the ungroup character is at the beginning of the scanlist, + * it will be part of the class, and a second ungroup character + * must follow to end the group. + */ + if (format[offset] == SPECIFIER_UNGROUP) + { + characterclass[(int)SPECIFIER_UNGROUP]++; + offset++; + } + /* + * Minus is used to specify ranges. To include minus in the class, + * it must be at the beginning of the list + */ + if (format[offset] == QUALIFIER_MINUS) + { + characterclass[(int)QUALIFIER_MINUS]++; + offset++; + } + /* Collect characters */ + for (ch = format[offset]; (ch != SPECIFIER_UNGROUP) && (ch != NIL); ch = format[++offset]) + { + switch (ch) + { + case QUALIFIER_MINUS: /* Scanlist ranges */ + + /* + * Both C99 and UNIX98 describes ranges as implementation- + * defined. + * + * We support the following behaviour (although this may + * change as we become wiser) + * - only increasing ranges, ie. [a-b] but not [b-a] + * - transitive ranges, ie. [a-b-c] == [a-c] + * - trailing minus, ie. [a-] is interpreted as an 'a' + * and a '-' + * - duplicates (although we can easily convert these + * into errors) + */ + range_begin = format[offset - 1]; + range_end = format[++offset]; + if (range_end == SPECIFIER_UNGROUP) + { + /* Trailing minus is included */ + characterclass[(int)ch]++; + ch = range_end; + break; /* for */ + } + if (range_end == NIL) + return TRIO_ERROR_RETURN(TRIO_EINVAL, offset); + if (range_begin > range_end) + return TRIO_ERROR_RETURN(TRIO_ERANGE, offset); + + for (i = (int)range_begin; i <= (int)range_end; i++) + characterclass[i]++; + + ch = range_end; + break; + #if TRIO_EXTENSION - case SPECIFIER_GROUP: - - switch (format[offset + 1]) - { - case QUALIFIER_DOT: /* Collating symbol */ - /* - * FIXME: This will be easier to implement when multibyte - * characters have been implemented. Until now, we ignore - * this feature. - */ - for (i = offset + 2; ; i++) - { - if (format[i] == NIL) - /* Error in syntax */ - return -1; - else if (format[i] == QUALIFIER_DOT) - break; /* for */ - } - if (format[++i] != SPECIFIER_UNGROUP) - return -1; - - offset = i; - break; - - case QUALIFIER_EQUAL: /* Equivalence class expressions */ - { - unsigned int j; - unsigned int k; - - if (internalCollationUnconverted) - { - /* Lazy evaluation of collation array */ - TrioGetCollation(); - internalCollationUnconverted = FALSE; - } - for (i = offset + 2; ; i++) - { - if (format[i] == NIL) - /* Error in syntax */ - return -1; - else if (format[i] == QUALIFIER_EQUAL) - break; /* for */ - else - { - /* Mark any equivalent character */ - k = (unsigned int)format[i]; - for (j = 0; internalCollationArray[k][j] != NIL; j++) - characterclass[(int)internalCollationArray[k][j]]++; - } - } - if (format[++i] != SPECIFIER_UNGROUP) - return -1; - - offset = i; - } - break; - - case QUALIFIER_COLON: /* Character class expressions */ - - if (trio_equal_max(CLASS_ALNUM, sizeof(CLASS_ALNUM) - 1, - &format[offset])) - { - for (i = 0; i < MAX_CHARACTER_CLASS; i++) - if (isalnum(i)) - characterclass[i]++; - offset += sizeof(CLASS_ALNUM) - 1; - } - else if (trio_equal_max(CLASS_ALPHA, sizeof(CLASS_ALPHA) - 1, - &format[offset])) - { - for (i = 0; i < MAX_CHARACTER_CLASS; i++) - if (isalpha(i)) - characterclass[i]++; - offset += sizeof(CLASS_ALPHA) - 1; - } - else if (trio_equal_max(CLASS_CNTRL, sizeof(CLASS_CNTRL) - 1, - &format[offset])) - { - for (i = 0; i < MAX_CHARACTER_CLASS; i++) - if (iscntrl(i)) - characterclass[i]++; - offset += sizeof(CLASS_CNTRL) - 1; - } - else if (trio_equal_max(CLASS_DIGIT, sizeof(CLASS_DIGIT) - 1, - &format[offset])) - { - for (i = 0; i < MAX_CHARACTER_CLASS; i++) - if (isdigit(i)) - characterclass[i]++; - offset += sizeof(CLASS_DIGIT) - 1; - } - else if (trio_equal_max(CLASS_GRAPH, sizeof(CLASS_GRAPH) - 1, - &format[offset])) - { - for (i = 0; i < MAX_CHARACTER_CLASS; i++) - if (isgraph(i)) - characterclass[i]++; - offset += sizeof(CLASS_GRAPH) - 1; - } - else if (trio_equal_max(CLASS_LOWER, sizeof(CLASS_LOWER) - 1, - &format[offset])) - { - for (i = 0; i < MAX_CHARACTER_CLASS; i++) - if (islower(i)) - characterclass[i]++; - offset += sizeof(CLASS_LOWER) - 1; - } - else if (trio_equal_max(CLASS_PRINT, sizeof(CLASS_PRINT) - 1, - &format[offset])) - { - for (i = 0; i < MAX_CHARACTER_CLASS; i++) - if (isprint(i)) - characterclass[i]++; - offset += sizeof(CLASS_PRINT) - 1; - } - else if (trio_equal_max(CLASS_PUNCT, sizeof(CLASS_PUNCT) - 1, - &format[offset])) - { - for (i = 0; i < MAX_CHARACTER_CLASS; i++) - if (ispunct(i)) - characterclass[i]++; - offset += sizeof(CLASS_PUNCT) - 1; - } - else if (trio_equal_max(CLASS_SPACE, sizeof(CLASS_SPACE) - 1, - &format[offset])) - { - for (i = 0; i < MAX_CHARACTER_CLASS; i++) - if (isspace(i)) - characterclass[i]++; - offset += sizeof(CLASS_SPACE) - 1; - } - else if (trio_equal_max(CLASS_UPPER, sizeof(CLASS_UPPER) - 1, - &format[offset])) - { - for (i = 0; i < MAX_CHARACTER_CLASS; i++) - if (isupper(i)) - characterclass[i]++; - offset += sizeof(CLASS_UPPER) - 1; - } - else if (trio_equal_max(CLASS_XDIGIT, sizeof(CLASS_XDIGIT) - 1, - &format[offset])) - { - for (i = 0; i < MAX_CHARACTER_CLASS; i++) - if (isxdigit(i)) - characterclass[i]++; - offset += sizeof(CLASS_XDIGIT) - 1; - } - else - { - characterclass[(int)ch]++; - } - break; + case SPECIFIER_GROUP: + + switch (format[offset + 1]) + { + case QUALIFIER_DOT: /* Collating symbol */ + /* + * FIXME: This will be easier to implement when multibyte + * characters have been implemented. Until now, we ignore + * this feature. + */ + for (i = offset + 2;; i++) + { + if (format[i] == NIL) + /* Error in syntax */ + return -1; + else if (format[i] == QUALIFIER_DOT) + break; /* for */ + } + if (format[++i] != SPECIFIER_UNGROUP) + return -1; + + offset = i; + break; + + case QUALIFIER_EQUAL: /* Equivalence class expressions */ + { + unsigned int j; + unsigned int k; + + if (internalCollationUnconverted) + { + /* Lazy evaluation of collation array */ + TrioGetCollation(); + internalCollationUnconverted = FALSE; + } + for (i = offset + 2;; i++) + { + if (format[i] == NIL) + /* Error in syntax */ + return -1; + else if (format[i] == QUALIFIER_EQUAL) + break; /* for */ + else + { + /* Mark any equivalent character */ + k = (unsigned int)format[i]; + for (j = 0; internalCollationArray[k][j] != NIL; j++) + characterclass[(int)internalCollationArray[k][j]]++; + } + } + if (format[++i] != SPECIFIER_UNGROUP) + return -1; + + offset = i; + } + break; + + case QUALIFIER_COLON: /* Character class expressions */ + + if (trio_equal_max(CLASS_ALNUM, sizeof(CLASS_ALNUM) - 1, &format[offset])) + { + for (i = 0; i < MAX_CHARACTER_CLASS; i++) + if (isalnum(i)) + characterclass[i]++; + offset += sizeof(CLASS_ALNUM) - 1; + } + else if (trio_equal_max(CLASS_ALPHA, sizeof(CLASS_ALPHA) - 1, + &format[offset])) + { + for (i = 0; i < MAX_CHARACTER_CLASS; i++) + if (isalpha(i)) + characterclass[i]++; + offset += sizeof(CLASS_ALPHA) - 1; + } + else if (trio_equal_max(CLASS_CNTRL, sizeof(CLASS_CNTRL) - 1, + &format[offset])) + { + for (i = 0; i < MAX_CHARACTER_CLASS; i++) + if (iscntrl(i)) + characterclass[i]++; + offset += sizeof(CLASS_CNTRL) - 1; + } + else if (trio_equal_max(CLASS_DIGIT, sizeof(CLASS_DIGIT) - 1, + &format[offset])) + { + for (i = 0; i < MAX_CHARACTER_CLASS; i++) + if (isdigit(i)) + characterclass[i]++; + offset += sizeof(CLASS_DIGIT) - 1; + } + else if (trio_equal_max(CLASS_GRAPH, sizeof(CLASS_GRAPH) - 1, + &format[offset])) + { + for (i = 0; i < MAX_CHARACTER_CLASS; i++) + if (isgraph(i)) + characterclass[i]++; + offset += sizeof(CLASS_GRAPH) - 1; + } + else if (trio_equal_max(CLASS_LOWER, sizeof(CLASS_LOWER) - 1, + &format[offset])) + { + for (i = 0; i < MAX_CHARACTER_CLASS; i++) + if (islower(i)) + characterclass[i]++; + offset += sizeof(CLASS_LOWER) - 1; + } + else if (trio_equal_max(CLASS_PRINT, sizeof(CLASS_PRINT) - 1, + &format[offset])) + { + for (i = 0; i < MAX_CHARACTER_CLASS; i++) + if (isprint(i)) + characterclass[i]++; + offset += sizeof(CLASS_PRINT) - 1; + } + else if (trio_equal_max(CLASS_PUNCT, sizeof(CLASS_PUNCT) - 1, + &format[offset])) + { + for (i = 0; i < MAX_CHARACTER_CLASS; i++) + if (ispunct(i)) + characterclass[i]++; + offset += sizeof(CLASS_PUNCT) - 1; + } + else if (trio_equal_max(CLASS_SPACE, sizeof(CLASS_SPACE) - 1, + &format[offset])) + { + for (i = 0; i < MAX_CHARACTER_CLASS; i++) + if (isspace(i)) + characterclass[i]++; + offset += sizeof(CLASS_SPACE) - 1; + } + else if (trio_equal_max(CLASS_UPPER, sizeof(CLASS_UPPER) - 1, + &format[offset])) + { + for (i = 0; i < MAX_CHARACTER_CLASS; i++) + if (isupper(i)) + characterclass[i]++; + offset += sizeof(CLASS_UPPER) - 1; + } + else if (trio_equal_max(CLASS_XDIGIT, sizeof(CLASS_XDIGIT) - 1, + &format[offset])) + { + for (i = 0; i < MAX_CHARACTER_CLASS; i++) + if (isxdigit(i)) + characterclass[i]++; + offset += sizeof(CLASS_XDIGIT) - 1; + } + else + { + characterclass[(int)ch]++; + } + break; + + default: + characterclass[(int)ch]++; + break; + } + break; - default: - characterclass[(int)ch]++; - break; - } - break; - #endif /* TRIO_EXTENSION */ - - default: - characterclass[(int)ch]++; - break; + + default: + characterclass[(int)ch]++; + break; + } } - } - return 0; + return 0; } /************************************************************************* @@ -6142,291 +5651,279 @@ TRIO_ARGS4((format, offsetPointer, flagsPointer, characterclass), * We implement our own number conversion in preference of strtol and * strtoul, because we must handle 'long long' and thousand separators. */ -TRIO_PRIVATE BOOLEAN_T -TrioReadNumber -TRIO_ARGS5((self, target, flags, width, base), - trio_class_t *self, - trio_uintmax_t *target, - trio_flags_t flags, - int width, - int base) +TRIO_PRIVATE BOOLEAN_T TrioReadNumber TRIO_ARGS5((self, target, flags, width, base), + trio_class_t* self, trio_uintmax_t* target, + trio_flags_t flags, int width, int base) { - trio_uintmax_t number = 0; - int digit; - int count; - BOOLEAN_T isNegative = FALSE; - BOOLEAN_T gotNumber = FALSE; - int j; + trio_uintmax_t number = 0; + int digit; + int count; + BOOLEAN_T isNegative = FALSE; + BOOLEAN_T gotNumber = FALSE; + int j; - assert(VALID(self)); - assert(VALID(self->InStream)); - assert((base >= MIN_BASE && base <= MAX_BASE) || (base == NO_BASE)); + assert(VALID(self)); + assert(VALID(self->InStream)); + assert((base >= MIN_BASE && base <= MAX_BASE) || (base == NO_BASE)); - if (internalDigitsUnconverted) - { - /* Lazy evaluation of digits array */ - memset(internalDigitArray, -1, sizeof(internalDigitArray)); - for (j = 0; j < (int)sizeof(internalDigitsLower) - 1; j++) + if (internalDigitsUnconverted) { - internalDigitArray[(int)internalDigitsLower[j]] = j; - internalDigitArray[(int)internalDigitsUpper[j]] = j; - } - internalDigitsUnconverted = FALSE; - } - - TrioSkipWhitespaces(self); - - /* Leading sign */ - if (self->current == '+') - { - self->InStream(self, NULL); - } - else if (self->current == '-') - { - self->InStream(self, NULL); - isNegative = TRUE; - } - - count = self->processed; - - if (flags & FLAGS_ALTERNATIVE) - { - switch (base) - { - case NO_BASE: - case BASE_OCTAL: - case BASE_HEX: - case BASE_BINARY: - if (self->current == '0') - { - self->InStream(self, NULL); - if (self->current) + /* Lazy evaluation of digits array */ + memset(internalDigitArray, -1, sizeof(internalDigitArray)); + for (j = 0; j < (int)sizeof(internalDigitsLower) - 1; j++) { - if ((base == BASE_HEX) && - (trio_to_upper(self->current) == 'X')) - { - self->InStream(self, NULL); - } - else if ((base == BASE_BINARY) && - (trio_to_upper(self->current) == 'B')) - { - self->InStream(self, NULL); - } + internalDigitArray[(int)internalDigitsLower[j]] = j; + internalDigitArray[(int)internalDigitsUpper[j]] = j; } - } - else - return FALSE; - break; - default: - break; + internalDigitsUnconverted = FALSE; } - } - while (((width == NO_WIDTH) || (self->processed - count < width)) && - (! ((self->current == EOF) || isspace(self->current)))) - { - if (isascii(self->current)) + TrioSkipWhitespaces(self); + + /* Leading sign */ + if (self->current == '+') { - digit = internalDigitArray[self->current]; - /* Abort if digit is not allowed in the specified base */ - if ((digit == -1) || (digit >= base)) - break; + self->InStream(self, NULL); } + else if (self->current == '-') + { + self->InStream(self, NULL); + isNegative = TRUE; + } + + count = self->processed; + + if (flags & FLAGS_ALTERNATIVE) + { + switch (base) + { + case NO_BASE: + case BASE_OCTAL: + case BASE_HEX: + case BASE_BINARY: + if (self->current == '0') + { + self->InStream(self, NULL); + if (self->current) + { + if ((base == BASE_HEX) && (trio_to_upper(self->current) == 'X')) + { + self->InStream(self, NULL); + } + else if ((base == BASE_BINARY) && (trio_to_upper(self->current) == 'B')) + { + self->InStream(self, NULL); + } + } + } + else + return FALSE; + break; + default: + break; + } + } + + while (((width == NO_WIDTH) || (self->processed - count < width)) && + (!((self->current == EOF) || isspace(self->current)))) + { + if (isascii(self->current)) + { + digit = internalDigitArray[self->current]; + /* Abort if digit is not allowed in the specified base */ + if ((digit == -1) || (digit >= base)) + break; + } #if TRIO_FEATURE_QUOTE - else if (flags & FLAGS_QUOTE) - { - /* Compare with thousands separator */ - for (j = 0; internalThousandSeparator[j] && self->current; j++) - { - if (internalThousandSeparator[j] != self->current) - break; + else if (flags & FLAGS_QUOTE) + { + /* Compare with thousands separator */ + for (j = 0; internalThousandSeparator[j] && self->current; j++) + { + if (internalThousandSeparator[j] != self->current) + break; - self->InStream(self, NULL); - } - if (internalThousandSeparator[j]) - break; /* Mismatch */ - else - continue; /* Match */ - } + self->InStream(self, NULL); + } + if (internalThousandSeparator[j]) + break; /* Mismatch */ + else + continue; /* Match */ + } #endif - else - break; - - number *= base; - number += digit; - gotNumber = TRUE; /* we need at least one digit */ + else + break; - self->InStream(self, NULL); - } + number *= base; + number += digit; + gotNumber = TRUE; /* we need at least one digit */ - /* Was anything read at all? */ - if (!gotNumber) - return FALSE; - - if (target) - *target = (isNegative) ? (trio_uintmax_t)(-((trio_intmax_t)number)) : number; - return TRUE; + self->InStream(self, NULL); + } + + /* Was anything read at all? */ + if (!gotNumber) + return FALSE; + + if (target) + *target = (isNegative) ? (trio_uintmax_t)(-((trio_intmax_t)number)) : number; + return TRUE; } /************************************************************************* * TrioReadChar */ -TRIO_PRIVATE int -TrioReadChar -TRIO_ARGS4((self, target, flags, width), - trio_class_t *self, - char *target, - trio_flags_t flags, - int width) +TRIO_PRIVATE int TrioReadChar TRIO_ARGS4((self, target, flags, width), trio_class_t* self, + char* target, trio_flags_t flags, int width) { - int i; - char ch; - trio_uintmax_t number; - - assert(VALID(self)); - assert(VALID(self->InStream)); + int i; + char ch; + trio_uintmax_t number; - for (i = 0; - (self->current != EOF) && (i < width); - i++) - { - ch = (char)self->current; - self->InStream(self, NULL); - if ((flags & FLAGS_ALTERNATIVE) && (ch == CHAR_BACKSLASH)) + assert(VALID(self)); + assert(VALID(self->InStream)); + + for (i = 0; (self->current != EOF) && (i < width); i++) { - switch (self->current) - { - case '\\': ch = '\\'; break; - case 'a': ch = '\007'; break; - case 'b': ch = '\b'; break; - case 'f': ch = '\f'; break; - case 'n': ch = '\n'; break; - case 'r': ch = '\r'; break; - case 't': ch = '\t'; break; - case 'v': ch = '\v'; break; - default: - if (isdigit(self->current)) + ch = (char)self->current; + self->InStream(self, NULL); + if ((flags & FLAGS_ALTERNATIVE) && (ch == CHAR_BACKSLASH)) { - /* Read octal number */ - if (!TrioReadNumber(self, &number, 0, 3, BASE_OCTAL)) - return 0; - ch = (char)number; + switch (self->current) + { + case '\\': + ch = '\\'; + break; + case 'a': + ch = '\007'; + break; + case 'b': + ch = '\b'; + break; + case 'f': + ch = '\f'; + break; + case 'n': + ch = '\n'; + break; + case 'r': + ch = '\r'; + break; + case 't': + ch = '\t'; + break; + case 'v': + ch = '\v'; + break; + default: + if (isdigit(self->current)) + { + /* Read octal number */ + if (!TrioReadNumber(self, &number, 0, 3, BASE_OCTAL)) + return 0; + ch = (char)number; + } + else if (trio_to_upper(self->current) == 'X') + { + /* Read hexadecimal number */ + self->InStream(self, NULL); + if (!TrioReadNumber(self, &number, 0, 2, BASE_HEX)) + return 0; + ch = (char)number; + } + else + { + ch = (char)self->current; + } + break; + } } - else if (trio_to_upper(self->current) == 'X') - { - /* Read hexadecimal number */ - self->InStream(self, NULL); - if (!TrioReadNumber(self, &number, 0, 2, BASE_HEX)) - return 0; - ch = (char)number; - } - else - { - ch = (char)self->current; - } - break; - } + + if (target) + target[i] = ch; } - - if (target) - target[i] = ch; - } - return i + 1; + return i + 1; } /************************************************************************* * TrioReadString */ -TRIO_PRIVATE BOOLEAN_T -TrioReadString -TRIO_ARGS4((self, target, flags, width), - trio_class_t *self, - char *target, - trio_flags_t flags, - int width) +TRIO_PRIVATE BOOLEAN_T TrioReadString TRIO_ARGS4((self, target, flags, width), trio_class_t* self, + char* target, trio_flags_t flags, int width) { - int i; - - assert(VALID(self)); - assert(VALID(self->InStream)); + int i; - TrioSkipWhitespaces(self); - - /* - * Continue until end of string is reached, a whitespace is encountered, - * or width is exceeded - */ - for (i = 0; - ((width == NO_WIDTH) || (i < width)) && - (! ((self->current == EOF) || isspace(self->current))); - i++) - { - if (TrioReadChar(self, (target ? &target[i] : 0), flags, 1) == 0) - break; /* for */ - } - if (target) - target[i] = NIL; - return TRUE; + assert(VALID(self)); + assert(VALID(self->InStream)); + + TrioSkipWhitespaces(self); + + /* + * Continue until end of string is reached, a whitespace is encountered, + * or width is exceeded + */ + for (i = 0; ((width == NO_WIDTH) || (i < width)) && + (!((self->current == EOF) || isspace(self->current))); + i++) + { + if (TrioReadChar(self, (target ? &target[i] : 0), flags, 1) == 0) + break; /* for */ + } + if (target) + target[i] = NIL; + return TRUE; } /************************************************************************* * TrioReadWideChar */ #if TRIO_FEATURE_WIDECHAR -TRIO_PRIVATE int -TrioReadWideChar -TRIO_ARGS4((self, target, flags, width), - trio_class_t *self, - trio_wchar_t *target, - trio_flags_t flags, - int width) +TRIO_PRIVATE int TrioReadWideChar TRIO_ARGS4((self, target, flags, width), trio_class_t* self, + trio_wchar_t* target, trio_flags_t flags, int width) { - int i; - int j; - int size; - int amount = 0; - trio_wchar_t wch; - char buffer[MB_LEN_MAX + 1]; - - assert(VALID(self)); - assert(VALID(self->InStream)); + int i; + int j; + int size; + int amount = 0; + trio_wchar_t wch; + char buffer[MB_LEN_MAX + 1]; - for (i = 0; - (self->current != EOF) && (i < width); - i++) - { - if (isascii(self->current)) + assert(VALID(self)); + assert(VALID(self->InStream)); + + for (i = 0; (self->current != EOF) && (i < width); i++) { - if (TrioReadChar(self, buffer, flags, 1) == 0) - return 0; - buffer[1] = NIL; + if (isascii(self->current)) + { + if (TrioReadChar(self, buffer, flags, 1) == 0) + return 0; + buffer[1] = NIL; + } + else + { + /* + * Collect a multibyte character, by enlarging buffer until + * it contains a fully legal multibyte character, or the + * buffer is full. + */ + j = 0; + do + { + buffer[j++] = (char)self->current; + buffer[j] = NIL; + self->InStream(self, NULL); + } while ((j < (int)sizeof(buffer)) && (mblen(buffer, (size_t)j) != j)); + } + if (target) + { + size = mbtowc(&wch, buffer, sizeof(buffer)); + if (size > 0) + target[i] = wch; + } + amount += size; + self->InStream(self, NULL); } - else - { - /* - * Collect a multibyte character, by enlarging buffer until - * it contains a fully legal multibyte character, or the - * buffer is full. - */ - j = 0; - do - { - buffer[j++] = (char)self->current; - buffer[j] = NIL; - self->InStream(self, NULL); - } - while ((j < (int)sizeof(buffer)) && (mblen(buffer, (size_t)j) != j)); - } - if (target) - { - size = mbtowc(&wch, buffer, sizeof(buffer)); - if (size > 0) - target[i] = wch; - } - amount += size; - self->InStream(self, NULL); - } - return amount; + return amount; } #endif /* TRIO_FEATURE_WIDECHAR */ @@ -6434,45 +5931,39 @@ TRIO_ARGS4((self, target, flags, width), * TrioReadWideString */ #if TRIO_FEATURE_WIDECHAR -TRIO_PRIVATE BOOLEAN_T -TrioReadWideString -TRIO_ARGS4((self, target, flags, width), - trio_class_t *self, - trio_wchar_t *target, - trio_flags_t flags, - int width) +TRIO_PRIVATE BOOLEAN_T TrioReadWideString TRIO_ARGS4((self, target, flags, width), + trio_class_t* self, trio_wchar_t* target, + trio_flags_t flags, int width) { - int i; - int size; - - assert(VALID(self)); - assert(VALID(self->InStream)); + int i; + int size; - TrioSkipWhitespaces(self); + assert(VALID(self)); + assert(VALID(self->InStream)); + + TrioSkipWhitespaces(self); #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE) - /* Required by TrioReadWideChar */ - (void)mblen(NULL, 0); + /* Required by TrioReadWideChar */ + (void)mblen(NULL, 0); #endif - - /* - * Continue until end of string is reached, a whitespace is encountered, - * or width is exceeded - */ - for (i = 0; - ((width == NO_WIDTH) || (i < width)) && - (! ((self->current == EOF) || isspace(self->current))); - ) - { - size = TrioReadWideChar(self, &target[i], flags, 1); - if (size == 0) - break; /* for */ - i += size; - } - if (target) - target[i] = WCONST('\0'); - return TRUE; + /* + * Continue until end of string is reached, a whitespace is encountered, + * or width is exceeded + */ + for (i = 0; ((width == NO_WIDTH) || (i < width)) && + (!((self->current == EOF) || isspace(self->current)));) + { + size = TrioReadWideChar(self, &target[i], flags, 1); + if (size == 0) + break; /* for */ + + i += size; + } + if (target) + target[i] = WCONST('\0'); + return TRUE; } #endif /* TRIO_FEATURE_WIDECHAR */ @@ -6483,40 +5974,33 @@ TRIO_ARGS4((self, target, flags, width), * * FIXME: characterclass does not work with multibyte characters */ -TRIO_PRIVATE BOOLEAN_T -TrioReadGroup -TRIO_ARGS5((self, target, characterclass, flags, width), - trio_class_t *self, - char *target, - int *characterclass, - trio_flags_t flags, - int width) +TRIO_PRIVATE BOOLEAN_T TrioReadGroup TRIO_ARGS5((self, target, characterclass, flags, width), + trio_class_t* self, char* target, + int* characterclass, trio_flags_t flags, int width) { - int ch; - int i; - - assert(VALID(self)); - assert(VALID(self->InStream)); + int ch; + int i; - ch = self->current; - for (i = 0; - ((width == NO_WIDTH) || (i < width)) && - (! ((ch == EOF) || - (((flags & FLAGS_EXCLUDE) != 0) ^ (characterclass[ch] == 0)))); - i++) - { - if (target) - target[i] = (char)ch; - self->InStream(self, &ch); - } + assert(VALID(self)); + assert(VALID(self->InStream)); - if (i == 0) - return FALSE; + ch = self->current; + for (i = 0; ((width == NO_WIDTH) || (i < width)) && + (!((ch == EOF) || (((flags & FLAGS_EXCLUDE) != 0) ^ (characterclass[ch] == 0)))); + i++) + { + if (target) + target[i] = (char)ch; + self->InStream(self, &ch); + } - /* Terminate the string if input saved */ - if (target) - target[i] = NIL; - return TRUE; + if (i == 0) + return FALSE; + + /* Terminate the string if input saved */ + if (target) + target[i] = NIL; + return TRUE; } /************************************************************************* @@ -6527,717 +6011,658 @@ TRIO_ARGS5((self, target, characterclass, flags, width), * handle base */ #if TRIO_FEATURE_FLOAT -TRIO_PRIVATE BOOLEAN_T -TrioReadDouble -TRIO_ARGS4((self, target, flags, width), - trio_class_t *self, - trio_pointer_t target, - trio_flags_t flags, - int width) +TRIO_PRIVATE BOOLEAN_T TrioReadDouble TRIO_ARGS4((self, target, flags, width), trio_class_t* self, + trio_pointer_t target, trio_flags_t flags, + int width) { - int ch; - char doubleString[512]; - int offset = 0; - int start; -# if TRIO_FEATURE_QUOTE - int j; -# endif - BOOLEAN_T isHex = FALSE; - trio_long_double_t infinity; + int ch; + char doubleString[512]; + int offset = 0; + int start; +#if TRIO_FEATURE_QUOTE + int j; +#endif + BOOLEAN_T isHex = FALSE; + trio_long_double_t infinity; - doubleString[0] = 0; - - if ((width == NO_WIDTH) || (width > (int)sizeof(doubleString) - 1)) - width = sizeof(doubleString) - 1; - - TrioSkipWhitespaces(self); - - /* - * Read entire double number from stream. trio_to_double requires - * a string as input, but InStream can be anything, so we have to - * collect all characters. - */ - ch = self->current; - if ((ch == '+') || (ch == '-')) - { - doubleString[offset++] = (char)ch; - self->InStream(self, &ch); - width--; - } + doubleString[0] = 0; - start = offset; - switch (ch) - { - case 'n': - case 'N': - /* Not-a-number */ - if (offset != 0) - break; - /* FALLTHROUGH */ - case 'i': - case 'I': - /* Infinity */ - while (isalpha(ch) && (offset - start < width)) + if ((width == NO_WIDTH) || (width > (int)sizeof(doubleString) - 1)) + width = sizeof(doubleString) - 1; + + TrioSkipWhitespaces(self); + + /* + * Read entire double number from stream. trio_to_double requires + * a string as input, but InStream can be anything, so we have to + * collect all characters. + */ + ch = self->current; + if ((ch == '+') || (ch == '-')) { - doubleString[offset++] = (char)ch; - self->InStream(self, &ch); + doubleString[offset++] = (char)ch; + self->InStream(self, &ch); + width--; } - doubleString[offset] = NIL; - /* Case insensitive string comparison */ - if (trio_equal(&doubleString[start], INFINITE_UPPER) || - trio_equal(&doubleString[start], LONG_INFINITE_UPPER)) + start = offset; + switch (ch) { - infinity = ((start == 1) && (doubleString[0] == '-')) - ? trio_ninf() - : trio_pinf(); - if (!target) - return FALSE; + case 'n': + case 'N': + /* Not-a-number */ + if (offset != 0) + break; + /* FALLTHROUGH */ + case 'i': + case 'I': + /* Infinity */ + while (isalpha(ch) && (offset - start < width)) + { + doubleString[offset++] = (char)ch; + self->InStream(self, &ch); + } + doubleString[offset] = NIL; - if (flags & FLAGS_LONGDOUBLE) - { - *((trio_long_double_t *)target) = infinity; - } - else if (flags & FLAGS_LONG) - { - *((double *)target) = infinity; - } - else - { - *((float *)target) = infinity; - } - return TRUE; + /* Case insensitive string comparison */ + if (trio_equal(&doubleString[start], INFINITE_UPPER) || + trio_equal(&doubleString[start], LONG_INFINITE_UPPER)) + { + infinity = ((start == 1) && (doubleString[0] == '-')) ? trio_ninf() : trio_pinf(); + if (!target) + return FALSE; + + if (flags & FLAGS_LONGDOUBLE) + { + *((trio_long_double_t*)target) = infinity; + } + else if (flags & FLAGS_LONG) + { + *((double*)target) = infinity; + } + else + { + *((float*)target) = infinity; + } + return TRUE; + } + if (trio_equal(doubleString, NAN_UPPER)) + { + if (!target) + return FALSE; + + /* NaN must not have a preceeding + nor - */ + if (flags & FLAGS_LONGDOUBLE) + { + *((trio_long_double_t*)target) = trio_nan(); + } + else if (flags & FLAGS_LONG) + { + *((double*)target) = trio_nan(); + } + else + { + *((float*)target) = trio_nan(); + } + return TRUE; + } + return FALSE; + + case '0': + doubleString[offset++] = (char)ch; + self->InStream(self, &ch); + if (trio_to_upper(ch) == 'X') + { + isHex = TRUE; + doubleString[offset++] = (char)ch; + self->InStream(self, &ch); + } + break; + + default: + break; } - if (trio_equal(doubleString, NAN_UPPER)) + + while ((ch != EOF) && (offset - start < width)) { - if (!target) - return FALSE; + /* Integer part */ + if (isHex ? isxdigit(ch) : isdigit(ch)) + { + doubleString[offset++] = (char)ch; + self->InStream(self, &ch); + } +#if TRIO_FEATURE_QUOTE + else if (flags & FLAGS_QUOTE) + { + /* Compare with thousands separator */ + for (j = 0; internalThousandSeparator[j] && self->current; j++) + { + if (internalThousandSeparator[j] != self->current) + break; - /* NaN must not have a preceeding + nor - */ - if (flags & FLAGS_LONGDOUBLE) - { - *((trio_long_double_t *)target) = trio_nan(); - } - else if (flags & FLAGS_LONG) - { - *((double *)target) = trio_nan(); - } - else - { - *((float *)target) = trio_nan(); - } - return TRUE; + self->InStream(self, &ch); + } + if (internalThousandSeparator[j]) + break; /* Mismatch */ + else + continue; /* Match */ + } +#endif + else + break; /* while */ } - return FALSE; - - case '0': - doubleString[offset++] = (char)ch; - self->InStream(self, &ch); - if (trio_to_upper(ch) == 'X') + if (ch == '.') { - isHex = TRUE; - doubleString[offset++] = (char)ch; - self->InStream(self, &ch); + /* Decimal part */ + doubleString[offset++] = (char)ch; + self->InStream(self, &ch); + while ((isHex ? isxdigit(ch) : isdigit(ch)) && (offset - start < width)) + { + doubleString[offset++] = (char)ch; + self->InStream(self, &ch); + } } - break; - - default: - break; - } - - while ((ch != EOF) && (offset - start < width)) - { - /* Integer part */ - if (isHex ? isxdigit(ch) : isdigit(ch)) + if (isHex ? (trio_to_upper(ch) == 'P') : (trio_to_upper(ch) == 'E')) { - doubleString[offset++] = (char)ch; - self->InStream(self, &ch); + /* Exponent */ + doubleString[offset++] = (char)ch; + self->InStream(self, &ch); + if ((ch == '+') || (ch == '-')) + { + doubleString[offset++] = (char)ch; + self->InStream(self, &ch); + } + while (isdigit(ch) && (offset - start < width)) + { + doubleString[offset++] = (char)ch; + self->InStream(self, &ch); + } } -# if TRIO_FEATURE_QUOTE - else if (flags & FLAGS_QUOTE) + + if ((offset == start) || (*doubleString == NIL)) + return FALSE; + + doubleString[offset] = 0; + + if (flags & FLAGS_LONGDOUBLE) { - /* Compare with thousands separator */ - for (j = 0; internalThousandSeparator[j] && self->current; j++) - { - if (internalThousandSeparator[j] != self->current) - break; + if (!target) + return FALSE; - self->InStream(self, &ch); - } - if (internalThousandSeparator[j]) - break; /* Mismatch */ - else - continue; /* Match */ + *((trio_long_double_t*)target) = trio_to_long_double(doubleString, NULL); } -# endif - else - break; /* while */ - } - if (ch == '.') - { - /* Decimal part */ - doubleString[offset++] = (char)ch; - self->InStream(self, &ch); - while ((isHex ? isxdigit(ch) : isdigit(ch)) && - (offset - start < width)) + else if (flags & FLAGS_LONG) { - doubleString[offset++] = (char)ch; - self->InStream(self, &ch); + if (!target) + return FALSE; + + *((double*)target) = trio_to_double(doubleString, NULL); } - } - if (isHex ? (trio_to_upper(ch) == 'P') : (trio_to_upper(ch) == 'E')) - { - /* Exponent */ - doubleString[offset++] = (char)ch; - self->InStream(self, &ch); - if ((ch == '+') || (ch == '-')) + else { - doubleString[offset++] = (char)ch; - self->InStream(self, &ch); + if (!target) + return FALSE; + + *((float*)target) = trio_to_float(doubleString, NULL); } - while (isdigit(ch) && (offset - start < width)) - { - doubleString[offset++] = (char)ch; - self->InStream(self, &ch); - } - } - - if ((offset == start) || (*doubleString == NIL)) - return FALSE; - - doubleString[offset] = 0; - - if (flags & FLAGS_LONGDOUBLE) - { - if (!target) - return FALSE; - - *((trio_long_double_t *)target) = trio_to_long_double(doubleString, NULL); - } - else if (flags & FLAGS_LONG) - { - if (!target) - return FALSE; - - *((double *)target) = trio_to_double(doubleString, NULL); - } - else - { - if (!target) - return FALSE; - - *((float *)target) = trio_to_float(doubleString, NULL); - } - return TRUE; + return TRUE; } #endif /* TRIO_FEATURE_FLOAT */ /************************************************************************* * TrioReadPointer */ -TRIO_PRIVATE BOOLEAN_T -TrioReadPointer -TRIO_ARGS3((self, target, flags), - trio_class_t *self, - trio_pointer_t *target, - trio_flags_t flags) +TRIO_PRIVATE BOOLEAN_T TrioReadPointer TRIO_ARGS3((self, target, flags), trio_class_t* self, + trio_pointer_t* target, trio_flags_t flags) { - trio_uintmax_t number; - char buffer[sizeof(internalNullString)]; + trio_uintmax_t number; + char buffer[sizeof(internalNullString)]; - flags |= (FLAGS_UNSIGNED | FLAGS_ALTERNATIVE | FLAGS_NILPADDING); - - if (TrioReadNumber(self, - &number, - flags, - POINTER_WIDTH, - BASE_HEX)) - { - if (target) + flags |= (FLAGS_UNSIGNED | FLAGS_ALTERNATIVE | FLAGS_NILPADDING); + + if (TrioReadNumber(self, &number, flags, POINTER_WIDTH, BASE_HEX)) { + if (target) + { #if defined(TRIO_COMPILER_GCC) || defined(TRIO_COMPILER_MIPSPRO) - /* - * The strange assignment of number is a workaround for a compiler - * warning - */ - *target = &((char *)0)[number]; + /* + * The strange assignment of number is a workaround for a compiler + * warning + */ + *target = &((char*)0)[number]; #else - *target = (trio_pointer_t)number; + *target = (trio_pointer_t)number; #endif + } + return TRUE; } - return TRUE; - } - else if (TrioReadString(self, - (flags & FLAGS_IGNORE) - ? NULL - : buffer, - 0, - sizeof(internalNullString) - 1)) - { - if (trio_equal_case(buffer, internalNullString)) + else if (TrioReadString(self, (flags & FLAGS_IGNORE) ? NULL : buffer, 0, + sizeof(internalNullString) - 1)) { - if (target) - *target = NULL; - return TRUE; + if (trio_equal_case(buffer, internalNullString)) + { + if (target) + *target = NULL; + return TRUE; + } } - } - return FALSE; + return FALSE; } /************************************************************************* * TrioScanProcess */ -TRIO_PRIVATE int -TrioScanProcess -TRIO_ARGS3((data, format, parameters), - trio_class_t *data, - TRIO_CONST char *format, - trio_parameter_t *parameters) +TRIO_PRIVATE int TrioScanProcess TRIO_ARGS3((data, format, parameters), trio_class_t* data, + TRIO_CONST char* format, trio_parameter_t* parameters) { - int status; - int assignment; - int ch; - int offset; /* Offset of format string */ - int i; /* Offset of current parameter */ - trio_flags_t flags; - int width; - int base; - trio_pointer_t pointer; + int status; + int assignment; + int ch; + int offset; /* Offset of format string */ + int i; /* Offset of current parameter */ + trio_flags_t flags; + int width; + int base; + trio_pointer_t pointer; - /* Return on empty format string */ - if (format[0] == NIL) - return 0; + /* Return on empty format string */ + if (format[0] == NIL) + return 0; - status = 0; - assignment = 0; - i = 0; - offset = 0; - data->InStream(data, &ch); + status = 0; + assignment = 0; + i = 0; + offset = 0; + data->InStream(data, &ch); - for (;;) - { - /* Skip the parameter entries */ - while (parameters[i].type == FORMAT_PARAMETER) + for (;;) { - assert(i <= MAX_PARAMETERS); - i++; - } - - /* Compare non conversion-specifier part of format string */ - while (offset < parameters[i].beginOffset) - { - if ((CHAR_IDENTIFIER == format[offset]) && - (CHAR_IDENTIFIER == format[offset + 1])) - { - /* Two % in format matches one % in input stream */ - if (CHAR_IDENTIFIER == ch) + /* Skip the parameter entries */ + while (parameters[i].type == FORMAT_PARAMETER) { - data->InStream(data, &ch); - offset += 2; - continue; /* while format chars left */ - } - else - { - status = TRIO_ERROR_RETURN(TRIO_EINVAL, offset); - goto end; - } - } - else /* Not an % identifier */ - { - if (isspace((int)format[offset])) - { - /* Whitespaces may match any amount of whitespaces */ - ch = TrioSkipWhitespaces(data); - } - else if (ch == format[offset]) - { - data->InStream(data, &ch); - } - else - { - status = assignment; - goto end; + assert(i <= MAX_PARAMETERS); + i++; } - offset++; - } - } + /* Compare non conversion-specifier part of format string */ + while (offset < parameters[i].beginOffset) + { + if ((CHAR_IDENTIFIER == format[offset]) && (CHAR_IDENTIFIER == format[offset + 1])) + { + /* Two % in format matches one % in input stream */ + if (CHAR_IDENTIFIER == ch) + { + data->InStream(data, &ch); + offset += 2; + continue; /* while format chars left */ + } + else + { + status = TRIO_ERROR_RETURN(TRIO_EINVAL, offset); + goto end; + } + } + else /* Not an % identifier */ + { + if (isspace((int)format[offset])) + { + /* Whitespaces may match any amount of whitespaces */ + ch = TrioSkipWhitespaces(data); + } + else if (ch == format[offset]) + { + data->InStream(data, &ch); + } + else + { + status = assignment; + goto end; + } - if (parameters[i].type == FORMAT_SENTINEL) - break; + offset++; + } + } - if ((EOF == ch) && (parameters[i].type != FORMAT_COUNT)) - { - status = (assignment > 0) ? assignment : EOF; - goto end; - } + if (parameters[i].type == FORMAT_SENTINEL) + break; - flags = parameters[i].flags; + if ((EOF == ch) && (parameters[i].type != FORMAT_COUNT)) + { + status = (assignment > 0) ? assignment : EOF; + goto end; + } - /* Find width */ - width = parameters[i].width; - if (flags & FLAGS_WIDTH_PARAMETER) - { - /* Get width from parameter list */ - width = (int)parameters[width].data.number.as_signed; - } + flags = parameters[i].flags; - /* Find base */ - if (NO_BASE != parameters[i].baseSpecifier) - { - /* Base from specifier has priority */ - base = parameters[i].baseSpecifier; - } - else if (flags & FLAGS_BASE_PARAMETER) - { - /* Get base from parameter list */ - base = parameters[i].base; - base = (int)parameters[base].data.number.as_signed; - } - else - { - /* Use base from format string */ - base = parameters[i].base; - } + /* Find width */ + width = parameters[i].width; + if (flags & FLAGS_WIDTH_PARAMETER) + { + /* Get width from parameter list */ + width = (int)parameters[width].data.number.as_signed; + } - switch (parameters[i].type) - { - case FORMAT_INT: - { - trio_uintmax_t number; - - if (0 == base) - base = BASE_DECIMAL; - - if (!TrioReadNumber(data, - &number, - flags, - width, - base)) - { - status = assignment; - goto end; - } - - if (!(flags & FLAGS_IGNORE)) - { - assignment++; - - pointer = parameters[i].data.pointer; -#if TRIO_FEATURE_SIZE_T || TRIO_FEATURE_SIZE_T_UPPER - if (flags & FLAGS_SIZE_T) - *(size_t *)pointer = (size_t)number; + /* Find base */ + if (NO_BASE != parameters[i].baseSpecifier) + { + /* Base from specifier has priority */ + base = parameters[i].baseSpecifier; + } + else if (flags & FLAGS_BASE_PARAMETER) + { + /* Get base from parameter list */ + base = parameters[i].base; + base = (int)parameters[base].data.number.as_signed; + } else + { + /* Use base from format string */ + base = parameters[i].base; + } + + switch (parameters[i].type) + { + case FORMAT_INT: + { + trio_uintmax_t number; + + if (0 == base) + base = BASE_DECIMAL; + + if (!TrioReadNumber(data, &number, flags, width, base)) + { + status = assignment; + goto end; + } + + if (!(flags & FLAGS_IGNORE)) + { + assignment++; + + pointer = parameters[i].data.pointer; +#if TRIO_FEATURE_SIZE_T || TRIO_FEATURE_SIZE_T_UPPER + if (flags & FLAGS_SIZE_T) + *(size_t*)pointer = (size_t)number; + else #endif #if TRIO_FEATURE_PTRDIFF_T - if (flags & FLAGS_PTRDIFF_T) - *(ptrdiff_t *)pointer = (ptrdiff_t)number; - else + if (flags & FLAGS_PTRDIFF_T) + *(ptrdiff_t*)pointer = (ptrdiff_t)number; + else #endif #if TRIO_FEATURE_INTMAX_T - if (flags & FLAGS_INTMAX_T) - *(trio_intmax_t *)pointer = (trio_intmax_t)number; - else + if (flags & FLAGS_INTMAX_T) + *(trio_intmax_t*)pointer = (trio_intmax_t)number; + else #endif - if (flags & FLAGS_QUAD) - *(trio_ulonglong_t *)pointer = (trio_ulonglong_t)number; - else if (flags & FLAGS_LONG) - *(long int *)pointer = (long int)number; - else if (flags & FLAGS_SHORT) - *(short int *)pointer = (short int)number; - else - *(int *)pointer = (int)number; - } - } - break; /* FORMAT_INT */ + if (flags & FLAGS_QUAD) + *(trio_ulonglong_t*)pointer = (trio_ulonglong_t)number; + else if (flags & FLAGS_LONG) + *(long int*)pointer = (long int)number; + else if (flags & FLAGS_SHORT) + *(short int*)pointer = (short int)number; + else + *(int*)pointer = (int)number; + } + } + break; /* FORMAT_INT */ - case FORMAT_STRING: + case FORMAT_STRING: #if TRIO_FEATURE_WIDECHAR - if (flags & FLAGS_WIDECHAR) - { - if (!TrioReadWideString(data, - (flags & FLAGS_IGNORE) - ? NULL - : parameters[i].data.wstring, - flags, - width)) - { - status = assignment; - goto end; - } - } - else + if (flags & FLAGS_WIDECHAR) + { + if (!TrioReadWideString( + data, (flags & FLAGS_IGNORE) ? NULL : parameters[i].data.wstring, flags, + width)) + { + status = assignment; + goto end; + } + } + else #endif - { - if (!TrioReadString(data, - (flags & FLAGS_IGNORE) - ? NULL - : parameters[i].data.string, - flags, - width)) - { - status = assignment; - goto end; - } - } - if (!(flags & FLAGS_IGNORE)) - assignment++; - break; /* FORMAT_STRING */ + { + if (!TrioReadString(data, + (flags & FLAGS_IGNORE) ? NULL : parameters[i].data.string, + flags, width)) + { + status = assignment; + goto end; + } + } + if (!(flags & FLAGS_IGNORE)) + assignment++; + break; /* FORMAT_STRING */ #if TRIO_FEATURE_FLOAT - case FORMAT_DOUBLE: - { - if (flags & FLAGS_IGNORE) - { - pointer = NULL; - } - else - { - pointer = (flags & FLAGS_LONGDOUBLE) - ? (trio_pointer_t)parameters[i].data.longdoublePointer - : (trio_pointer_t)parameters[i].data.doublePointer; - } - if (!TrioReadDouble(data, pointer, flags, width)) - { - status = assignment; - goto end; - } - if (!(flags & FLAGS_IGNORE)) - { - assignment++; - } - break; /* FORMAT_DOUBLE */ - } + case FORMAT_DOUBLE: + { + if (flags & FLAGS_IGNORE) + { + pointer = NULL; + } + else + { + pointer = (flags & FLAGS_LONGDOUBLE) + ? (trio_pointer_t)parameters[i].data.longdoublePointer + : (trio_pointer_t)parameters[i].data.doublePointer; + } + if (!TrioReadDouble(data, pointer, flags, width)) + { + status = assignment; + goto end; + } + if (!(flags & FLAGS_IGNORE)) + { + assignment++; + } + break; /* FORMAT_DOUBLE */ + } #endif - case FORMAT_GROUP: - { - int characterclass[MAX_CHARACTER_CLASS + 1]; + case FORMAT_GROUP: + { + int characterclass[MAX_CHARACTER_CLASS + 1]; - /* Skip over modifiers */ - while (format[offset] != SPECIFIER_GROUP) - { - offset++; - } - /* Skip over group specifier */ - offset++; + /* Skip over modifiers */ + while (format[offset] != SPECIFIER_GROUP) + { + offset++; + } + /* Skip over group specifier */ + offset++; - memset(characterclass, 0, sizeof(characterclass)); - status = TrioGetCharacterClass(format, - &offset, - &flags, - characterclass); - if (status < 0) - goto end; + memset(characterclass, 0, sizeof(characterclass)); + status = TrioGetCharacterClass(format, &offset, &flags, characterclass); + if (status < 0) + goto end; - if (!TrioReadGroup(data, - (flags & FLAGS_IGNORE) - ? NULL - : parameters[i].data.string, - characterclass, - flags, - parameters[i].width)) - { - status = assignment; - goto end; - } - if (!(flags & FLAGS_IGNORE)) - assignment++; - } - break; /* FORMAT_GROUP */ + if (!TrioReadGroup(data, (flags & FLAGS_IGNORE) ? NULL : parameters[i].data.string, + characterclass, flags, parameters[i].width)) + { + status = assignment; + goto end; + } + if (!(flags & FLAGS_IGNORE)) + assignment++; + } + break; /* FORMAT_GROUP */ - case FORMAT_COUNT: - pointer = parameters[i].data.pointer; - if (NULL != pointer) - { - int count = data->processed; - if (ch != EOF) - count--; /* a character is read, but is not consumed yet */ + case FORMAT_COUNT: + pointer = parameters[i].data.pointer; + if (NULL != pointer) + { + int count = data->processed; + if (ch != EOF) + count--; /* a character is read, but is not consumed yet */ #if TRIO_FEATURE_SIZE_T || TRIO_FEATURE_SIZE_T_UPPER - if (flags & FLAGS_SIZE_T) - *(size_t *)pointer = (size_t)count; - else + if (flags & FLAGS_SIZE_T) + *(size_t*)pointer = (size_t)count; + else #endif #if TRIO_FEATURE_PTRDIFF_T - if (flags & FLAGS_PTRDIFF_T) - *(ptrdiff_t *)pointer = (ptrdiff_t)count; - else + if (flags & FLAGS_PTRDIFF_T) + *(ptrdiff_t*)pointer = (ptrdiff_t)count; + else #endif #if TRIO_FEATURE_INTMAX_T - if (flags & FLAGS_INTMAX_T) - *(trio_intmax_t *)pointer = (trio_intmax_t)count; - else + if (flags & FLAGS_INTMAX_T) + *(trio_intmax_t*)pointer = (trio_intmax_t)count; + else #endif - if (flags & FLAGS_QUAD) - { - *(trio_ulonglong_t *)pointer = (trio_ulonglong_t)count; - } - else if (flags & FLAGS_LONG) - { - *(long int *)pointer = (long int)count; - } - else if (flags & FLAGS_SHORT) - { - *(short int *)pointer = (short int)count; - } - else - { - *(int *)pointer = (int)count; - } - } - break; /* FORMAT_COUNT */ + if (flags & FLAGS_QUAD) + { + *(trio_ulonglong_t*)pointer = (trio_ulonglong_t)count; + } + else if (flags & FLAGS_LONG) + { + *(long int*)pointer = (long int)count; + } + else if (flags & FLAGS_SHORT) + { + *(short int*)pointer = (short int)count; + } + else + { + *(int*)pointer = (int)count; + } + } + break; /* FORMAT_COUNT */ - case FORMAT_CHAR: + case FORMAT_CHAR: #if TRIO_FEATURE_WIDECHAR - if (flags & FLAGS_WIDECHAR) - { - if (TrioReadWideChar(data, - (flags & FLAGS_IGNORE) - ? NULL - : parameters[i].data.wstring, - flags, - (width == NO_WIDTH) ? 1 : width) == 0) - { - status = assignment; - goto end; - } - } - else + if (flags & FLAGS_WIDECHAR) + { + if (TrioReadWideChar(data, + (flags & FLAGS_IGNORE) ? NULL : parameters[i].data.wstring, + flags, (width == NO_WIDTH) ? 1 : width) == 0) + { + status = assignment; + goto end; + } + } + else #endif - { - if (TrioReadChar(data, - (flags & FLAGS_IGNORE) - ? NULL - : parameters[i].data.string, - flags, - (width == NO_WIDTH) ? 1 : width) == 0) - { - status = assignment; - goto end; + { + if (TrioReadChar(data, + (flags & FLAGS_IGNORE) ? NULL : parameters[i].data.string, + flags, (width == NO_WIDTH) ? 1 : width) == 0) + { + status = assignment; + goto end; + } + } + if (!(flags & FLAGS_IGNORE)) + assignment++; + break; /* FORMAT_CHAR */ + + case FORMAT_POINTER: + if (!TrioReadPointer( + data, + (flags & FLAGS_IGNORE) ? NULL : (trio_pointer_t*)parameters[i].data.pointer, + flags)) + { + status = assignment; + goto end; + } + if (!(flags & FLAGS_IGNORE)) + assignment++; + break; /* FORMAT_POINTER */ + + case FORMAT_PARAMETER: + break; /* FORMAT_PARAMETER */ + + default: + status = TRIO_ERROR_RETURN(TRIO_EINVAL, offset); + goto end; } - } - if (!(flags & FLAGS_IGNORE)) - assignment++; - break; /* FORMAT_CHAR */ - case FORMAT_POINTER: - if (!TrioReadPointer(data, - (flags & FLAGS_IGNORE) - ? NULL - : (trio_pointer_t *)parameters[i].data.pointer, - flags)) - { - status = assignment; - goto end; - } - if (!(flags & FLAGS_IGNORE)) - assignment++; - break; /* FORMAT_POINTER */ - - case FORMAT_PARAMETER: - break; /* FORMAT_PARAMETER */ - - default: - status = TRIO_ERROR_RETURN(TRIO_EINVAL, offset); - goto end; + ch = data->current; + offset = parameters[i].endOffset; + i++; } - ch = data->current; - offset = parameters[i].endOffset; - i++; - } - - status = assignment; - end: - if (data->UndoStream) - data->UndoStream(data); - return status; + status = assignment; +end: + if (data->UndoStream) + data->UndoStream(data); + return status; } /************************************************************************* * TrioScan */ -TRIO_PRIVATE int -TrioScan -TRIO_ARGS8((source, sourceSize, InStream, UndoStream, format, arglist, argfunc, argarray), - trio_pointer_t source, - size_t sourceSize, - void (*InStream) TRIO_PROTO((trio_class_t *, int *)), - void (*UndoStream) TRIO_PROTO((trio_class_t *)), - TRIO_CONST char *format, - va_list arglist, - trio_argfunc_t argfunc, - trio_pointer_t *argarray) +TRIO_PRIVATE int TrioScan TRIO_ARGS8( + (source, sourceSize, InStream, UndoStream, format, arglist, argfunc, argarray), + trio_pointer_t source, size_t sourceSize, void(*InStream) TRIO_PROTO((trio_class_t*, int*)), + void(*UndoStream) TRIO_PROTO((trio_class_t*)), TRIO_CONST char* format, va_list arglist, + trio_argfunc_t argfunc, trio_pointer_t* argarray) { - int status; - trio_parameter_t parameters[MAX_PARAMETERS]; - trio_class_t data; + int status; + trio_parameter_t parameters[MAX_PARAMETERS]; + trio_class_t data; - assert(VALID(InStream)); - assert(VALID(format)); + assert(VALID(InStream)); + assert(VALID(format)); - memset(&data, 0, sizeof(data)); - data.InStream = InStream; - data.UndoStream = UndoStream; - data.location = (trio_pointer_t)source; - data.max = sourceSize; - data.error = 0; + memset(&data, 0, sizeof(data)); + data.InStream = InStream; + data.UndoStream = UndoStream; + data.location = (trio_pointer_t)source; + data.max = sourceSize; + data.error = 0; #if defined(USE_LOCALE) - if (NULL == internalLocaleValues) - { - TrioSetLocale(); - } + if (NULL == internalLocaleValues) + { + TrioSetLocale(); + } #endif - status = TrioParse(TYPE_SCAN, format, parameters, arglist, argfunc, argarray); - if (status < 0) - return status; + status = TrioParse(TYPE_SCAN, format, parameters, arglist, argfunc, argarray); + if (status < 0) + return status; - status = TrioScanProcess(&data, format, parameters); - if (data.error != 0) - { - status = data.error; - } - return status; + status = TrioScanProcess(&data, format, parameters); + if (data.error != 0) + { + status = data.error; + } + return status; } /************************************************************************* * TrioInStreamFile */ #if TRIO_FEATURE_FILE || TRIO_FEATURE_STDIO -TRIO_PRIVATE void -TrioInStreamFile -TRIO_ARGS2((self, intPointer), - trio_class_t *self, - int *intPointer) +TRIO_PRIVATE void TrioInStreamFile TRIO_ARGS2((self, intPointer), trio_class_t* self, + int* intPointer) { - FILE *file = (FILE *)self->location; + FILE* file = (FILE*)self->location; - assert(VALID(self)); - assert(VALID(file)); + assert(VALID(self)); + assert(VALID(file)); - self->actually.cached = 0; + self->actually.cached = 0; - /* The initial value of self->current is zero */ - if (self->current == EOF) - { - self->error = (ferror(file)) - ? TRIO_ERROR_RETURN(TRIO_ERRNO, 0) - : TRIO_ERROR_RETURN(TRIO_EOF, 0); - } - else - { - self->processed++; - self->actually.cached++; - } + /* The initial value of self->current is zero */ + if (self->current == EOF) + { + self->error = + (ferror(file)) ? TRIO_ERROR_RETURN(TRIO_ERRNO, 0) : TRIO_ERROR_RETURN(TRIO_EOF, 0); + } + else + { + self->processed++; + self->actually.cached++; + } - self->current = fgetc(file); + self->current = fgetc(file); - if (VALID(intPointer)) - { - *intPointer = self->current; - } + if (VALID(intPointer)) + { + *intPointer = self->current; + } } #endif /* TRIO_FEATURE_FILE || TRIO_FEATURE_STDIO */ @@ -7245,23 +6670,20 @@ TRIO_ARGS2((self, intPointer), * TrioUndoStreamFile */ #if TRIO_FEATURE_FILE || TRIO_FEATURE_STDIO -TRIO_PRIVATE void -TrioUndoStreamFile -TRIO_ARGS1((self), - trio_class_t *self) +TRIO_PRIVATE void TrioUndoStreamFile TRIO_ARGS1((self), trio_class_t* self) { - FILE *file = (FILE *)self->location; + FILE* file = (FILE*)self->location; - assert(VALID(self)); - assert(VALID(file)); + assert(VALID(self)); + assert(VALID(file)); - if (self->actually.cached > 0) - { - assert(self->actually.cached == 1); + if (self->actually.cached > 0) + { + assert(self->actually.cached == 1); - self->current = ungetc(self->current, file); - self->actually.cached = 0; - } + self->current = ungetc(self->current, file); + self->actually.cached = 0; + } } #endif /* TRIO_FEATURE_FILE || TRIO_FEATURE_STDIO */ @@ -7269,40 +6691,37 @@ TRIO_ARGS1((self), * TrioInStreamFileDescriptor */ #if TRIO_FEATURE_FD -TRIO_PRIVATE void -TrioInStreamFileDescriptor -TRIO_ARGS2((self, intPointer), - trio_class_t *self, - int *intPointer) +TRIO_PRIVATE void TrioInStreamFileDescriptor TRIO_ARGS2((self, intPointer), trio_class_t* self, + int* intPointer) { - int fd = *((int *)self->location); - int size; - unsigned char input; + int fd = *((int*)self->location); + int size; + unsigned char input; - assert(VALID(self)); + assert(VALID(self)); - self->actually.cached = 0; + self->actually.cached = 0; - size = read(fd, &input, sizeof(char)); - if (size == -1) - { - self->error = TRIO_ERROR_RETURN(TRIO_ERRNO, 0); - self->current = EOF; - } - else - { - self->current = (size == 0) ? EOF : input; - } - if (self->current != EOF) - { - self->actually.cached++; - self->processed++; - } + size = read(fd, &input, sizeof(char)); + if (size == -1) + { + self->error = TRIO_ERROR_RETURN(TRIO_ERRNO, 0); + self->current = EOF; + } + else + { + self->current = (size == 0) ? EOF : input; + } + if (self->current != EOF) + { + self->actually.cached++; + self->processed++; + } - if (VALID(intPointer)) - { - *intPointer = self->current; - } + if (VALID(intPointer)) + { + *intPointer = self->current; + } } #endif /* TRIO_FEATURE_FD */ @@ -7310,75 +6729,67 @@ TRIO_ARGS2((self, intPointer), * TrioInStreamCustom */ #if TRIO_FEATURE_CLOSURE -TRIO_PRIVATE void -TrioInStreamCustom -TRIO_ARGS2((self, intPointer), - trio_class_t *self, - int *intPointer) +TRIO_PRIVATE void TrioInStreamCustom TRIO_ARGS2((self, intPointer), trio_class_t* self, + int* intPointer) { - trio_custom_t *data; + trio_custom_t* data; - assert(VALID(self)); - assert(VALID(self->location)); + assert(VALID(self)); + assert(VALID(self->location)); - self->actually.cached = 0; + self->actually.cached = 0; - data = (trio_custom_t *)self->location; + data = (trio_custom_t*)self->location; - self->current = (data->stream.in == NULL) - ? NIL - : (data->stream.in)(data->closure); + self->current = (data->stream.in == NULL) ? NIL : (data->stream.in)(data->closure); - if (self->current == NIL) - { - self->current = EOF; - } - else - { - self->processed++; - self->actually.cached++; - } + if (self->current == NIL) + { + self->current = EOF; + } + else + { + self->processed++; + self->actually.cached++; + } - if (VALID(intPointer)) - { - *intPointer = self->current; - } + if (VALID(intPointer)) + { + *intPointer = self->current; + } } #endif /* TRIO_FEATURE_CLOSURE */ /************************************************************************* * TrioInStreamString */ -TRIO_PRIVATE void -TrioInStreamString -TRIO_ARGS2((self, intPointer), - trio_class_t *self, - int *intPointer) +TRIO_PRIVATE void TrioInStreamString TRIO_ARGS2((self, intPointer), trio_class_t* self, + int* intPointer) { - unsigned char **buffer; + unsigned char** buffer; - assert(VALID(self)); - assert(VALID(self->location)); + assert(VALID(self)); + assert(VALID(self->location)); - self->actually.cached = 0; + self->actually.cached = 0; - buffer = (unsigned char **)self->location; - self->current = (*buffer)[0]; - if (self->current == NIL) - { - self->current = EOF; - } - else - { - (*buffer)++; - self->processed++; - self->actually.cached++; - } + buffer = (unsigned char**)self->location; + self->current = (*buffer)[0]; + if (self->current == NIL) + { + self->current = EOF; + } + else + { + (*buffer)++; + self->processed++; + self->actually.cached++; + } - if (VALID(intPointer)) - { - *intPointer = self->current; - } + if (VALID(intPointer)) + { + *intPointer = self->current; + } } /************************************************************************* @@ -7388,7 +6799,7 @@ TRIO_ARGS2((self, intPointer), ************************************************************************/ #if defined(TRIO_DOCUMENTATION) -# include "doc/doc_scanf.h" +#include "doc/doc_scanf.h" #endif /** @addtogroup Scanf @{ @@ -7406,24 +6817,18 @@ TRIO_ARGS2((self, intPointer), @return Number of scanned characters. */ #if TRIO_FEATURE_STDIO -TRIO_PUBLIC int -trio_scanf -TRIO_VARGS2((format, va_alist), - TRIO_CONST char *format, - TRIO_VA_DECL) +TRIO_PUBLIC int trio_scanf TRIO_VARGS2((format, va_alist), TRIO_CONST char* format, TRIO_VA_DECL) { - int status; - va_list args; + int status; + va_list args; - assert(VALID(format)); - - TRIO_VA_START(args, format); - status = TrioScan((trio_pointer_t)stdin, 0, - TrioInStreamFile, - TrioUndoStreamFile, - format, args, NULL, NULL); - TRIO_VA_END(args); - return status; + assert(VALID(format)); + + TRIO_VA_START(args, format); + status = TrioScan((trio_pointer_t)stdin, 0, TrioInStreamFile, TrioUndoStreamFile, format, args, + NULL, NULL); + TRIO_VA_END(args); + return status; } #endif /* TRIO_FEATURE_STDIO */ @@ -7435,18 +6840,12 @@ TRIO_VARGS2((format, va_alist), @return Number of scanned characters. */ #if TRIO_FEATURE_STDIO -TRIO_PUBLIC int -trio_vscanf -TRIO_ARGS2((format, args), - TRIO_CONST char *format, - va_list args) +TRIO_PUBLIC int trio_vscanf TRIO_ARGS2((format, args), TRIO_CONST char* format, va_list args) { - assert(VALID(format)); - - return TrioScan((trio_pointer_t)stdin, 0, - TrioInStreamFile, - TrioUndoStreamFile, - format, args, NULL, NULL); + assert(VALID(format)); + + return TrioScan((trio_pointer_t)stdin, 0, TrioInStreamFile, TrioUndoStreamFile, format, args, + NULL, NULL); } #endif /* TRIO_FEATURE_STDIO */ @@ -7458,21 +6857,15 @@ TRIO_ARGS2((format, args), @return Number of scanned characters. */ #if TRIO_FEATURE_STDIO -TRIO_PUBLIC int -trio_scanfv -TRIO_ARGS2((format, args), - TRIO_CONST char *format, - trio_pointer_t *args) +TRIO_PUBLIC int trio_scanfv TRIO_ARGS2((format, args), TRIO_CONST char* format, + trio_pointer_t* args) { - static va_list unused; - - assert(VALID(format)); - - return TrioScan((trio_pointer_t)stdin, 0, - TrioInStreamFile, - TrioUndoStreamFile, - format, - unused, TrioArrayGetter, args); + static va_list unused; + + assert(VALID(format)); + + return TrioScan((trio_pointer_t)stdin, 0, TrioInStreamFile, TrioUndoStreamFile, format, unused, + TrioArrayGetter, args); } #endif /* TRIO_FEATURE_STDIO */ @@ -7489,26 +6882,20 @@ TRIO_ARGS2((format, args), @return Number of scanned characters. */ #if TRIO_FEATURE_FILE -TRIO_PUBLIC int -trio_fscanf -TRIO_VARGS3((file, format, va_alist), - FILE *file, - TRIO_CONST char *format, - TRIO_VA_DECL) +TRIO_PUBLIC int trio_fscanf TRIO_VARGS3((file, format, va_alist), FILE* file, + TRIO_CONST char* format, TRIO_VA_DECL) { - int status; - va_list args; + int status; + va_list args; - assert(VALID(file)); - assert(VALID(format)); - - TRIO_VA_START(args, format); - status = TrioScan((trio_pointer_t)file, 0, - TrioInStreamFile, - TrioUndoStreamFile, - format, args, NULL, NULL); - TRIO_VA_END(args); - return status; + assert(VALID(file)); + assert(VALID(format)); + + TRIO_VA_START(args, format); + status = TrioScan((trio_pointer_t)file, 0, TrioInStreamFile, TrioUndoStreamFile, format, args, + NULL, NULL); + TRIO_VA_END(args); + return status; } #endif /* TRIO_FEATURE_FILE */ @@ -7521,20 +6908,14 @@ TRIO_VARGS3((file, format, va_alist), @return Number of scanned characters. */ #if TRIO_FEATURE_FILE -TRIO_PUBLIC int -trio_vfscanf -TRIO_ARGS3((file, format, args), - FILE *file, - TRIO_CONST char *format, - va_list args) +TRIO_PUBLIC int trio_vfscanf TRIO_ARGS3((file, format, args), FILE* file, TRIO_CONST char* format, + va_list args) { - assert(VALID(file)); - assert(VALID(format)); - - return TrioScan((trio_pointer_t)file, 0, - TrioInStreamFile, - TrioUndoStreamFile, - format, args, NULL, NULL); + assert(VALID(file)); + assert(VALID(format)); + + return TrioScan((trio_pointer_t)file, 0, TrioInStreamFile, TrioUndoStreamFile, format, args, + NULL, NULL); } #endif /* TRIO_FEATURE_FILE */ @@ -7547,23 +6928,16 @@ TRIO_ARGS3((file, format, args), @return Number of scanned characters. */ #if TRIO_FEATURE_FILE -TRIO_PUBLIC int -trio_fscanfv -TRIO_ARGS3((file, format, args), - FILE *file, - TRIO_CONST char *format, - trio_pointer_t *args) +TRIO_PUBLIC int trio_fscanfv TRIO_ARGS3((file, format, args), FILE* file, TRIO_CONST char* format, + trio_pointer_t* args) { - static va_list unused; - - assert(VALID(file)); - assert(VALID(format)); - - return TrioScan((trio_pointer_t)file, 0, - TrioInStreamFile, - TrioUndoStreamFile, - format, - unused, TrioArrayGetter, args); + static va_list unused; + + assert(VALID(file)); + assert(VALID(format)); + + return TrioScan((trio_pointer_t)file, 0, TrioInStreamFile, TrioUndoStreamFile, format, unused, + TrioArrayGetter, args); } #endif /* TRIO_FEATURE_FILE */ @@ -7580,25 +6954,19 @@ TRIO_ARGS3((file, format, args), @return Number of scanned characters. */ #if TRIO_FEATURE_FD -TRIO_PUBLIC int -trio_dscanf -TRIO_VARGS3((fd, format, va_alist), - int fd, - TRIO_CONST char *format, - TRIO_VA_DECL) +TRIO_PUBLIC int trio_dscanf TRIO_VARGS3((fd, format, va_alist), int fd, TRIO_CONST char* format, + TRIO_VA_DECL) { - int status; - va_list args; + int status; + va_list args; - assert(VALID(format)); - - TRIO_VA_START(args, format); - status = TrioScan((trio_pointer_t)&fd, 0, - TrioInStreamFileDescriptor, - NULL, - format, args, NULL, NULL); - TRIO_VA_END(args); - return status; + assert(VALID(format)); + + TRIO_VA_START(args, format); + status = TrioScan((trio_pointer_t)&fd, 0, TrioInStreamFileDescriptor, NULL, format, args, NULL, + NULL); + TRIO_VA_END(args); + return status; } #endif /* TRIO_FEATURE_FD */ @@ -7611,19 +6979,13 @@ TRIO_VARGS3((fd, format, va_alist), @return Number of scanned characters. */ #if TRIO_FEATURE_FD -TRIO_PUBLIC int -trio_vdscanf -TRIO_ARGS3((fd, format, args), - int fd, - TRIO_CONST char *format, - va_list args) +TRIO_PUBLIC int trio_vdscanf TRIO_ARGS3((fd, format, args), int fd, TRIO_CONST char* format, + va_list args) { - assert(VALID(format)); - - return TrioScan((trio_pointer_t)&fd, 0, - TrioInStreamFileDescriptor, - NULL, - format, args, NULL, NULL); + assert(VALID(format)); + + return TrioScan((trio_pointer_t)&fd, 0, TrioInStreamFileDescriptor, NULL, format, args, NULL, + NULL); } #endif /* TRIO_FEATURE_FD */ @@ -7636,22 +6998,15 @@ TRIO_ARGS3((fd, format, args), @return Number of scanned characters. */ #if TRIO_FEATURE_FD -TRIO_PUBLIC int -trio_dscanfv -TRIO_ARGS3((fd, format, args), - int fd, - TRIO_CONST char *format, - trio_pointer_t *args) +TRIO_PUBLIC int trio_dscanfv TRIO_ARGS3((fd, format, args), int fd, TRIO_CONST char* format, + trio_pointer_t* args) { - static va_list unused; - - assert(VALID(format)); - - return TrioScan((trio_pointer_t)&fd, 0, - TrioInStreamFileDescriptor, - NULL, - format, - unused, TrioArrayGetter, args); + static va_list unused; + + assert(VALID(format)); + + return TrioScan((trio_pointer_t)&fd, 0, TrioInStreamFileDescriptor, NULL, format, unused, + TrioArrayGetter, args); } #endif /* TRIO_FEATURE_FD */ @@ -7659,93 +7014,76 @@ TRIO_ARGS3((fd, format, args), * cscanf */ #if TRIO_FEATURE_CLOSURE -TRIO_PUBLIC int -trio_cscanf -TRIO_VARGS4((stream, closure, format, va_alist), - trio_instream_t stream, - trio_pointer_t closure, - TRIO_CONST char *format, - TRIO_VA_DECL) +TRIO_PUBLIC int trio_cscanf TRIO_VARGS4((stream, closure, format, va_alist), trio_instream_t stream, + trio_pointer_t closure, TRIO_CONST char* format, + TRIO_VA_DECL) { - int status; - va_list args; - trio_custom_t data; + int status; + va_list args; + trio_custom_t data; - assert(VALID(stream)); - assert(VALID(format)); - - TRIO_VA_START(args, format); - data.stream.in = stream; - data.closure = closure; - status = TrioScan(&data, 0, TrioInStreamCustom, NULL, format, args, NULL, NULL); - TRIO_VA_END(args); - return status; + assert(VALID(stream)); + assert(VALID(format)); + + TRIO_VA_START(args, format); + data.stream.in = stream; + data.closure = closure; + status = TrioScan(&data, 0, TrioInStreamCustom, NULL, format, args, NULL, NULL); + TRIO_VA_END(args); + return status; } #endif /* TRIO_FEATURE_CLOSURE */ #if TRIO_FEATURE_CLOSURE -TRIO_PUBLIC int -trio_vcscanf -TRIO_ARGS4((stream, closure, format, args), - trio_instream_t stream, - trio_pointer_t closure, - TRIO_CONST char *format, - va_list args) +TRIO_PUBLIC int trio_vcscanf TRIO_ARGS4((stream, closure, format, args), trio_instream_t stream, + trio_pointer_t closure, TRIO_CONST char* format, + va_list args) { - trio_custom_t data; - - assert(VALID(stream)); - assert(VALID(format)); + trio_custom_t data; - data.stream.in = stream; - data.closure = closure; - return TrioScan(&data, 0, TrioInStreamCustom, NULL, format, args, NULL, NULL); + assert(VALID(stream)); + assert(VALID(format)); + + data.stream.in = stream; + data.closure = closure; + return TrioScan(&data, 0, TrioInStreamCustom, NULL, format, args, NULL, NULL); } #endif /* TRIO_FEATURE_CLOSURE */ #if TRIO_FEATURE_CLOSURE -TRIO_PUBLIC int -trio_cscanfv -TRIO_ARGS4((stream, closure, format, args), - trio_instream_t stream, - trio_pointer_t closure, - TRIO_CONST char *format, - trio_pointer_t *args) +TRIO_PUBLIC int trio_cscanfv TRIO_ARGS4((stream, closure, format, args), trio_instream_t stream, + trio_pointer_t closure, TRIO_CONST char* format, + trio_pointer_t* args) { - static va_list unused; - trio_custom_t data; - - assert(VALID(stream)); - assert(VALID(format)); + static va_list unused; + trio_custom_t data; - data.stream.in = stream; - data.closure = closure; - return TrioScan(&data, 0, TrioInStreamCustom, NULL, format, - unused, TrioArrayGetter, args); + assert(VALID(stream)); + assert(VALID(format)); + + data.stream.in = stream; + data.closure = closure; + return TrioScan(&data, 0, TrioInStreamCustom, NULL, format, unused, TrioArrayGetter, args); } #endif /* TRIO_FEATURE_CLOSURE */ #if TRIO_FEATURE_CLOSURE && TRIO_FEATURE_ARGFUNC -TRIO_PUBLIC int -trio_cscanff -TRIO_ARGS5((stream, closure, format, argfunc, context), - trio_instream_t stream, - trio_pointer_t closure, - TRIO_CONST char *format, - trio_argfunc_t argfunc, - trio_pointer_t context) +TRIO_PUBLIC int trio_cscanff TRIO_ARGS5((stream, closure, format, argfunc, context), + trio_instream_t stream, trio_pointer_t closure, + TRIO_CONST char* format, trio_argfunc_t argfunc, + trio_pointer_t context) { - static va_list unused; - trio_custom_t data; + static va_list unused; + trio_custom_t data; - assert(VALID(stream)); - assert(VALID(format)); - assert(VALID(argfunc)); + assert(VALID(stream)); + assert(VALID(format)); + assert(VALID(argfunc)); - data.stream.in = stream; - data.closure = closure; - return TrioScan(&data, 0, TrioInStreamCustom, NULL, format, - unused, argfunc, (trio_pointer_t *)context); + data.stream.in = stream; + data.closure = closure; + return TrioScan(&data, 0, TrioInStreamCustom, NULL, format, unused, argfunc, + (trio_pointer_t*)context); } #endif /* TRIO_FEATURE_CLOSURE && TRIO_FEATURE_ARGFUNC */ @@ -7761,26 +7099,20 @@ TRIO_ARGS5((stream, closure, format, argfunc, context), @param ... Arguments. @return Number of scanned characters. */ -TRIO_PUBLIC int -trio_sscanf -TRIO_VARGS3((buffer, format, va_alist), - TRIO_CONST char *buffer, - TRIO_CONST char *format, - TRIO_VA_DECL) +TRIO_PUBLIC int trio_sscanf TRIO_VARGS3((buffer, format, va_alist), TRIO_CONST char* buffer, + TRIO_CONST char* format, TRIO_VA_DECL) { - int status; - va_list args; + int status; + va_list args; - assert(VALID(buffer)); - assert(VALID(format)); - - TRIO_VA_START(args, format); - status = TrioScan((trio_pointer_t)&buffer, 0, - TrioInStreamString, - NULL, - format, args, NULL, NULL); - TRIO_VA_END(args); - return status; + assert(VALID(buffer)); + assert(VALID(format)); + + TRIO_VA_START(args, format); + status = + TrioScan((trio_pointer_t)&buffer, 0, TrioInStreamString, NULL, format, args, NULL, NULL); + TRIO_VA_END(args); + return status; } /** @@ -7791,20 +7123,13 @@ TRIO_VARGS3((buffer, format, va_alist), @param args Arguments. @return Number of scanned characters. */ -TRIO_PUBLIC int -trio_vsscanf -TRIO_ARGS3((buffer, format, args), - TRIO_CONST char *buffer, - TRIO_CONST char *format, - va_list args) +TRIO_PUBLIC int trio_vsscanf TRIO_ARGS3((buffer, format, args), TRIO_CONST char* buffer, + TRIO_CONST char* format, va_list args) { - assert(VALID(buffer)); - assert(VALID(format)); - - return TrioScan((trio_pointer_t)&buffer, 0, - TrioInStreamString, - NULL, - format, args, NULL, NULL); + assert(VALID(buffer)); + assert(VALID(format)); + + return TrioScan((trio_pointer_t)&buffer, 0, TrioInStreamString, NULL, format, args, NULL, NULL); } /** @@ -7815,23 +7140,16 @@ TRIO_ARGS3((buffer, format, args), @param args Arguments. @return Number of scanned characters. */ -TRIO_PUBLIC int -trio_sscanfv -TRIO_ARGS3((buffer, format, args), - TRIO_CONST char *buffer, - TRIO_CONST char *format, - trio_pointer_t *args) +TRIO_PUBLIC int trio_sscanfv TRIO_ARGS3((buffer, format, args), TRIO_CONST char* buffer, + TRIO_CONST char* format, trio_pointer_t* args) { - static va_list unused; - - assert(VALID(buffer)); - assert(VALID(format)); - - return TrioScan((trio_pointer_t)&buffer, 0, - TrioInStreamString, - NULL, - format, - unused, TrioArrayGetter, args); + static va_list unused; + + assert(VALID(buffer)); + assert(VALID(format)); + + return TrioScan((trio_pointer_t)&buffer, 0, TrioInStreamString, NULL, format, unused, + TrioArrayGetter, args); } #endif /* TRIO_FEATURE_SCANF */ @@ -7841,40 +7159,36 @@ TRIO_ARGS3((buffer, format, args), /************************************************************************* * trio_strerror */ -TRIO_PUBLIC TRIO_CONST char * -trio_strerror -TRIO_ARGS1((errorcode), - int errorcode) +TRIO_PUBLIC TRIO_CONST char* trio_strerror TRIO_ARGS1((errorcode), int errorcode) { #if TRIO_FEATURE_STRERR - /* Textual versions of the error codes */ - switch (TRIO_ERROR_CODE(errorcode)) - { - case TRIO_EOF: - return "End of file"; - case TRIO_EINVAL: - return "Invalid argument"; - case TRIO_ETOOMANY: - return "Too many arguments"; - case TRIO_EDBLREF: - return "Double reference"; - case TRIO_EGAP: - return "Reference gap"; - case TRIO_ENOMEM: - return "Out of memory"; - case TRIO_ERANGE: - return "Invalid range"; - case TRIO_ECUSTOM: - return "Custom error"; - default: - return "Unknown"; - } + /* Textual versions of the error codes */ + switch (TRIO_ERROR_CODE(errorcode)) + { + case TRIO_EOF: + return "End of file"; + case TRIO_EINVAL: + return "Invalid argument"; + case TRIO_ETOOMANY: + return "Too many arguments"; + case TRIO_EDBLREF: + return "Double reference"; + case TRIO_EGAP: + return "Reference gap"; + case TRIO_ENOMEM: + return "Out of memory"; + case TRIO_ERANGE: + return "Invalid range"; + case TRIO_ECUSTOM: + return "Custom error"; + default: + return "Unknown"; + } #else - return "Unknown"; + return "Unknown"; #endif } #ifdef _WIN32 #pragma warning(pop) #endif - diff --git a/winpr/libwinpr/utils/trio/trio.h b/winpr/libwinpr/utils/trio/trio.h index f91ca7905..790630db0 100644 --- a/winpr/libwinpr/utils/trio/trio.h +++ b/winpr/libwinpr/utils/trio/trio.h @@ -29,7 +29,7 @@ * HAVE_CONFIG_H as a compiler option themselves. */ #if defined(HAVE_CONFIG_H) -# include +#include #endif #include "triop.h" @@ -37,139 +37,142 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/* - * Error codes. - * - * Remember to add a textual description to trio_strerror. - */ -enum { - TRIO_EOF = 1, - TRIO_EINVAL = 2, - TRIO_ETOOMANY = 3, - TRIO_EDBLREF = 4, - TRIO_EGAP = 5, - TRIO_ENOMEM = 6, - TRIO_ERANGE = 7, - TRIO_ERRNO = 8, - TRIO_ECUSTOM = 9 -}; + /* + * Error codes. + * + * Remember to add a textual description to trio_strerror. + */ + enum + { + TRIO_EOF = 1, + TRIO_EINVAL = 2, + TRIO_ETOOMANY = 3, + TRIO_EDBLREF = 4, + TRIO_EGAP = 5, + TRIO_ENOMEM = 6, + TRIO_ERANGE = 7, + TRIO_ERRNO = 8, + TRIO_ECUSTOM = 9 + }; /* Error macros */ #define TRIO_ERROR_CODE(x) ((-(x)) & 0x00FF) #define TRIO_ERROR_POSITION(x) ((-(x)) >> 8) #define TRIO_ERROR_NAME(x) trio_strerror(x) -/* Argument function types */ -enum { - TRIO_TYPE_POINTER = 1, - TRIO_TYPE_CHAR = 2, - TRIO_TYPE_SHORT = 3, - TRIO_TYPE_INT = 4, - TRIO_TYPE_LONG = 5, - TRIO_TYPE_ULONGLONG = 6, - TRIO_TYPE_UINTMAX = 7, - TRIO_TYPE_PTRDIFF = 8, - TRIO_TYPE_SIZE = 9, - TRIO_TYPE_PCHAR = 10, - TRIO_TYPE_PWCHAR = 11, - TRIO_TYPE_FLOAT = 12, - TRIO_TYPE_DOUBLE = 13, - TRIO_TYPE_LONGDOUBLE = 14 -}; + /* Argument function types */ + enum + { + TRIO_TYPE_POINTER = 1, + TRIO_TYPE_CHAR = 2, + TRIO_TYPE_SHORT = 3, + TRIO_TYPE_INT = 4, + TRIO_TYPE_LONG = 5, + TRIO_TYPE_ULONGLONG = 6, + TRIO_TYPE_UINTMAX = 7, + TRIO_TYPE_PTRDIFF = 8, + TRIO_TYPE_SIZE = 9, + TRIO_TYPE_PCHAR = 10, + TRIO_TYPE_PWCHAR = 11, + TRIO_TYPE_FLOAT = 12, + TRIO_TYPE_DOUBLE = 13, + TRIO_TYPE_LONGDOUBLE = 14 + }; -typedef trio_pointer_t (*trio_argfunc_t) TRIO_PROTO((trio_pointer_t, int, int)); -typedef int (*trio_outstream_t) TRIO_PROTO((trio_pointer_t, int)); -typedef int (*trio_instream_t) TRIO_PROTO((trio_pointer_t)); + typedef trio_pointer_t(*trio_argfunc_t) TRIO_PROTO((trio_pointer_t, int, int)); + typedef int(*trio_outstream_t) TRIO_PROTO((trio_pointer_t, int)); + typedef int(*trio_instream_t) TRIO_PROTO((trio_pointer_t)); -TRIO_CONST char *trio_strerror TRIO_PROTO((int)); + TRIO_CONST char* trio_strerror TRIO_PROTO((int)); -/************************************************************************* - * Print Functions - */ + /************************************************************************* + * Print Functions + */ -int trio_printf TRIO_PROTO((TRIO_CONST char *format, ...)); -int trio_vprintf TRIO_PROTO((TRIO_CONST char *format, va_list args)); -int trio_printfv TRIO_PROTO((TRIO_CONST char *format, trio_pointer_t *args)); + int trio_printf TRIO_PROTO((TRIO_CONST char* format, ...)); + int trio_vprintf TRIO_PROTO((TRIO_CONST char* format, va_list args)); + int trio_printfv TRIO_PROTO((TRIO_CONST char* format, trio_pointer_t* args)); -int trio_fprintf TRIO_PROTO((FILE *file, TRIO_CONST char *format, ...)); -int trio_vfprintf TRIO_PROTO((FILE *file, TRIO_CONST char *format, va_list args)); -int trio_fprintfv TRIO_PROTO((FILE *file, TRIO_CONST char *format, trio_pointer_t *args)); + int trio_fprintf TRIO_PROTO((FILE * file, TRIO_CONST char* format, ...)); + int trio_vfprintf TRIO_PROTO((FILE * file, TRIO_CONST char* format, va_list args)); + int trio_fprintfv TRIO_PROTO((FILE * file, TRIO_CONST char* format, trio_pointer_t* args)); -int trio_dprintf TRIO_PROTO((int fd, TRIO_CONST char *format, ...)); -int trio_vdprintf TRIO_PROTO((int fd, TRIO_CONST char *format, va_list args)); -int trio_dprintfv TRIO_PROTO((int fd, TRIO_CONST char *format, trio_pointer_t *args)); + int trio_dprintf TRIO_PROTO((int fd, TRIO_CONST char* format, ...)); + int trio_vdprintf TRIO_PROTO((int fd, TRIO_CONST char* format, va_list args)); + int trio_dprintfv TRIO_PROTO((int fd, TRIO_CONST char* format, trio_pointer_t* args)); -int trio_cprintf TRIO_PROTO((trio_outstream_t stream, trio_pointer_t closure, - TRIO_CONST char *format, ...)); -int trio_vcprintf TRIO_PROTO((trio_outstream_t stream, trio_pointer_t closure, - TRIO_CONST char *format, va_list args)); -int trio_cprintfv TRIO_PROTO((trio_outstream_t stream, trio_pointer_t closure, - TRIO_CONST char *format, trio_pointer_t *args)); -int trio_cprintff TRIO_PROTO((trio_outstream_t stream, trio_pointer_t closure, - TRIO_CONST char *format, - trio_argfunc_t func, trio_pointer_t context)); + int trio_cprintf TRIO_PROTO((trio_outstream_t stream, trio_pointer_t closure, + TRIO_CONST char* format, ...)); + int trio_vcprintf TRIO_PROTO((trio_outstream_t stream, trio_pointer_t closure, + TRIO_CONST char* format, va_list args)); + int trio_cprintfv TRIO_PROTO((trio_outstream_t stream, trio_pointer_t closure, + TRIO_CONST char* format, trio_pointer_t* args)); + int trio_cprintff TRIO_PROTO((trio_outstream_t stream, trio_pointer_t closure, + TRIO_CONST char* format, trio_argfunc_t func, + trio_pointer_t context)); -int trio_sprintf TRIO_PROTO((char *buffer, TRIO_CONST char *format, ...)); -int trio_vsprintf TRIO_PROTO((char *buffer, TRIO_CONST char *format, va_list args)); -int trio_sprintfv TRIO_PROTO((char *buffer, TRIO_CONST char *format, trio_pointer_t *args)); + int trio_sprintf TRIO_PROTO((char* buffer, TRIO_CONST char* format, ...)); + int trio_vsprintf TRIO_PROTO((char* buffer, TRIO_CONST char* format, va_list args)); + int trio_sprintfv TRIO_PROTO((char* buffer, TRIO_CONST char* format, trio_pointer_t* args)); -int trio_snprintf TRIO_PROTO((char *buffer, size_t max, TRIO_CONST char *format, ...)); -int trio_vsnprintf TRIO_PROTO((char *buffer, size_t bufferSize, TRIO_CONST char *format, - va_list args)); -int trio_snprintfv TRIO_PROTO((char *buffer, size_t bufferSize, TRIO_CONST char *format, - trio_pointer_t *args)); + int trio_snprintf TRIO_PROTO((char* buffer, size_t max, TRIO_CONST char* format, ...)); + int trio_vsnprintf TRIO_PROTO((char* buffer, size_t bufferSize, TRIO_CONST char* format, + va_list args)); + int trio_snprintfv TRIO_PROTO((char* buffer, size_t bufferSize, TRIO_CONST char* format, + trio_pointer_t* args)); -int trio_snprintfcat TRIO_PROTO((char *buffer, size_t max, TRIO_CONST char *format, ...)); -int trio_vsnprintfcat TRIO_PROTO((char *buffer, size_t bufferSize, TRIO_CONST char *format, - va_list args)); + int trio_snprintfcat TRIO_PROTO((char* buffer, size_t max, TRIO_CONST char* format, ...)); + int trio_vsnprintfcat TRIO_PROTO((char* buffer, size_t bufferSize, TRIO_CONST char* format, + va_list args)); #if defined(TRIO_DEPRECATED) -char *trio_aprintf TRIO_PROTO((TRIO_CONST char *format, ...)); -char *trio_vaprintf TRIO_PROTO((TRIO_CONST char *format, va_list args)); + char* trio_aprintf TRIO_PROTO((TRIO_CONST char* format, ...)); + char* trio_vaprintf TRIO_PROTO((TRIO_CONST char* format, va_list args)); #endif -int trio_asprintf TRIO_PROTO((char **ret, TRIO_CONST char *format, ...)); -int trio_vasprintf TRIO_PROTO((char **ret, TRIO_CONST char *format, va_list args)); -int trio_asprintfv TRIO_PROTO((char **result, TRIO_CONST char *format, trio_pointer_t * args)); + int trio_asprintf TRIO_PROTO((char** ret, TRIO_CONST char* format, ...)); + int trio_vasprintf TRIO_PROTO((char** ret, TRIO_CONST char* format, va_list args)); + int trio_asprintfv TRIO_PROTO((char** result, TRIO_CONST char* format, trio_pointer_t* args)); -/************************************************************************* - * Scan Functions - */ -int trio_scanf TRIO_PROTO((TRIO_CONST char *format, ...)); -int trio_vscanf TRIO_PROTO((TRIO_CONST char *format, va_list args)); -int trio_scanfv TRIO_PROTO((TRIO_CONST char *format, void **args)); + /************************************************************************* + * Scan Functions + */ + int trio_scanf TRIO_PROTO((TRIO_CONST char* format, ...)); + int trio_vscanf TRIO_PROTO((TRIO_CONST char* format, va_list args)); + int trio_scanfv TRIO_PROTO((TRIO_CONST char* format, void** args)); -int trio_fscanf TRIO_PROTO((FILE *file, TRIO_CONST char *format, ...)); -int trio_vfscanf TRIO_PROTO((FILE *file, TRIO_CONST char *format, va_list args)); -int trio_fscanfv TRIO_PROTO((FILE *file, TRIO_CONST char *format, void **args)); + int trio_fscanf TRIO_PROTO((FILE * file, TRIO_CONST char* format, ...)); + int trio_vfscanf TRIO_PROTO((FILE * file, TRIO_CONST char* format, va_list args)); + int trio_fscanfv TRIO_PROTO((FILE * file, TRIO_CONST char* format, void** args)); -int trio_dscanf TRIO_PROTO((int fd, TRIO_CONST char *format, ...)); -int trio_vdscanf TRIO_PROTO((int fd, TRIO_CONST char *format, va_list args)); -int trio_dscanfv TRIO_PROTO((int fd, TRIO_CONST char *format, void **args)); + int trio_dscanf TRIO_PROTO((int fd, TRIO_CONST char* format, ...)); + int trio_vdscanf TRIO_PROTO((int fd, TRIO_CONST char* format, va_list args)); + int trio_dscanfv TRIO_PROTO((int fd, TRIO_CONST char* format, void** args)); -int trio_cscanf TRIO_PROTO((trio_instream_t stream, trio_pointer_t closure, - TRIO_CONST char *format, ...)); -int trio_vcscanf TRIO_PROTO((trio_instream_t stream, trio_pointer_t closure, - TRIO_CONST char *format, va_list args)); -int trio_cscanfv TRIO_PROTO((trio_instream_t stream, trio_pointer_t closure, - TRIO_CONST char *format, void **args)); -int trio_cscanff TRIO_PROTO((trio_instream_t stream, trio_pointer_t closure, - TRIO_CONST char *format, - trio_argfunc_t func, trio_pointer_t context)); + int trio_cscanf TRIO_PROTO((trio_instream_t stream, trio_pointer_t closure, + TRIO_CONST char* format, ...)); + int trio_vcscanf TRIO_PROTO((trio_instream_t stream, trio_pointer_t closure, + TRIO_CONST char* format, va_list args)); + int trio_cscanfv TRIO_PROTO((trio_instream_t stream, trio_pointer_t closure, + TRIO_CONST char* format, void** args)); + int trio_cscanff TRIO_PROTO((trio_instream_t stream, trio_pointer_t closure, + TRIO_CONST char* format, trio_argfunc_t func, + trio_pointer_t context)); -int trio_sscanf TRIO_PROTO((TRIO_CONST char *buffer, TRIO_CONST char *format, ...)); -int trio_vsscanf TRIO_PROTO((TRIO_CONST char *buffer, TRIO_CONST char *format, va_list args)); -int trio_sscanfv TRIO_PROTO((TRIO_CONST char *buffer, TRIO_CONST char *format, void **args)); + int trio_sscanf TRIO_PROTO((TRIO_CONST char* buffer, TRIO_CONST char* format, ...)); + int trio_vsscanf TRIO_PROTO((TRIO_CONST char* buffer, TRIO_CONST char* format, va_list args)); + int trio_sscanfv TRIO_PROTO((TRIO_CONST char* buffer, TRIO_CONST char* format, void** args)); -/************************************************************************* - * Locale Functions - */ -void trio_locale_set_decimal_point TRIO_PROTO((char *decimalPoint)); -void trio_locale_set_thousand_separator TRIO_PROTO((char *thousandSeparator)); -void trio_locale_set_grouping TRIO_PROTO((char *grouping)); + /************************************************************************* + * Locale Functions + */ + void trio_locale_set_decimal_point TRIO_PROTO((char* decimalPoint)); + void trio_locale_set_thousand_separator TRIO_PROTO((char* thousandSeparator)); + void trio_locale_set_grouping TRIO_PROTO((char* grouping)); /************************************************************************* * Renaming @@ -177,60 +180,60 @@ void trio_locale_set_grouping TRIO_PROTO((char *grouping)); #ifdef TRIO_REPLACE_STDIO /* Replace the functions */ #ifndef HAVE_PRINTF -# undef printf -# define printf trio_printf +#undef printf +#define printf trio_printf #endif #ifndef HAVE_VPRINTF -# undef vprintf -# define vprintf trio_vprintf +#undef vprintf +#define vprintf trio_vprintf #endif #ifndef HAVE_FPRINTF -# undef fprintf -# define fprintf trio_fprintf +#undef fprintf +#define fprintf trio_fprintf #endif #ifndef HAVE_VFPRINTF -# undef vfprintf -# define vfprintf trio_vfprintf +#undef vfprintf +#define vfprintf trio_vfprintf #endif #ifndef HAVE_SPRINTF -# undef sprintf -# define sprintf trio_sprintf +#undef sprintf +#define sprintf trio_sprintf #endif #ifndef HAVE_VSPRINTF -# undef vsprintf -# define vsprintf trio_vsprintf +#undef vsprintf +#define vsprintf trio_vsprintf #endif #ifndef HAVE_SNPRINTF -# undef snprintf -# define snprintf trio_snprintf +#undef snprintf +#define snprintf trio_snprintf #endif #ifndef HAVE_VSNPRINTF -# undef vsnprintf -# define vsnprintf trio_vsnprintf +#undef vsnprintf +#define vsnprintf trio_vsnprintf #endif #ifndef HAVE_SCANF -# undef scanf -# define scanf trio_scanf +#undef scanf +#define scanf trio_scanf #endif #ifndef HAVE_VSCANF -# undef vscanf -# define vscanf trio_vscanf +#undef vscanf +#define vscanf trio_vscanf #endif #ifndef HAVE_FSCANF -# undef fscanf -# define fscanf trio_fscanf +#undef fscanf +#define fscanf trio_fscanf #endif #ifndef HAVE_VFSCANF -# undef vfscanf -# define vfscanf trio_vfscanf +#undef vfscanf +#define vfscanf trio_vfscanf #endif #ifndef HAVE_SSCANF -# undef sscanf -# define sscanf trio_sscanf +#undef sscanf +#define sscanf trio_sscanf #endif #ifndef HAVE_VSSCANF -# undef vsscanf -# define vsscanf trio_vsscanf +#undef vsscanf +#define vsscanf trio_vsscanf #endif /* These aren't stdio functions, but we make them look similar */ #undef dprintf diff --git a/winpr/libwinpr/utils/trio/triodef.h b/winpr/libwinpr/utils/trio/triodef.h index 723e3919b..c8372e91d 100644 --- a/winpr/libwinpr/utils/trio/triodef.h +++ b/winpr/libwinpr/utils/trio/triodef.h @@ -23,47 +23,47 @@ */ #if defined(__GNUC__) -# define TRIO_COMPILER_GCC +#define TRIO_COMPILER_GCC #endif #if defined(__SUNPRO_CC) -# define TRIO_COMPILER_SUNPRO __SUNPRO_CC +#define TRIO_COMPILER_SUNPRO __SUNPRO_CC #else -# if defined(__SUNPRO_C) -# define TRIO_COMPILER_SUNPRO __SUNPRO_C -# endif +#if defined(__SUNPRO_C) +#define TRIO_COMPILER_SUNPRO __SUNPRO_C +#endif #endif #if defined(__xlC__) || defined(__IBMC__) || defined(__IBMCPP__) -# define TRIO_COMPILER_XLC +#define TRIO_COMPILER_XLC #else -# if defined(_AIX) && !defined(__GNUC__) -# define TRIO_COMPILER_XLC /* Workaround for old xlc */ -# endif +#if defined(_AIX) && !defined(__GNUC__) +#define TRIO_COMPILER_XLC /* Workaround for old xlc */ +#endif #endif #if defined(__DECC) || defined(__DECCXX) -# define TRIO_COMPILER_DECC +#define TRIO_COMPILER_DECC #else -# if defined(__osf__) && defined(__LANGUAGE_C__) && !defined(__GNUC__) -# define TRIO_COMPILER_DECC /* Workaround for old DEC C compilers */ -# endif +#if defined(__osf__) && defined(__LANGUAGE_C__) && !defined(__GNUC__) +#define TRIO_COMPILER_DECC /* Workaround for old DEC C compilers */ +#endif #endif #if defined(__HP_aCC) || defined(__HP_cc) -# define TRIO_COMPILER_HP +#define TRIO_COMPILER_HP #endif #if defined(sgi) || defined(__sgi) -# define TRIO_COMPILER_MIPSPRO +#define TRIO_COMPILER_MIPSPRO #endif #if defined(_MSC_VER) -# define TRIO_COMPILER_MSVC +#define TRIO_COMPILER_MSVC #endif #if defined(__BORLANDC__) -# define TRIO_COMPILER_BCB +#define TRIO_COMPILER_BCB #endif /************************************************************************* @@ -71,134 +71,131 @@ */ #if defined(VMS) || defined(__VMS) -# define TRIO_PLATFORM_VMS +#define TRIO_PLATFORM_VMS #endif #if defined(unix) || defined(__unix) || defined(__unix__) -# define TRIO_PLATFORM_UNIX +#define TRIO_PLATFORM_UNIX #endif #if defined(TRIO_COMPILER_XLC) || defined(_AIX) -# define TRIO_PLATFORM_UNIX +#define TRIO_PLATFORM_UNIX #endif #if defined(TRIO_COMPILER_DECC) || defined(__osf___) -# if !defined(TRIO_PLATFORM_VMS) -# define TRIO_PLATFORM_UNIX -# endif +#if !defined(TRIO_PLATFORM_VMS) +#define TRIO_PLATFORM_UNIX +#endif #endif #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) -# define TRIO_PLATFORM_UNIX +#define TRIO_PLATFORM_UNIX #endif #if defined(__Lynx__) -# define TRIO_PLATFORM_UNIX -# define TRIO_PLATFORM_LYNX +#define TRIO_PLATFORM_UNIX +#define TRIO_PLATFORM_LYNX #endif #if defined(__APPLE__) && defined(__MACH__) -# define TRIO_PLATFORM_UNIX +#define TRIO_PLATFORM_UNIX #endif #if defined(__QNX__) -# define TRIO_PLATFORM_UNIX -# define TRIO_PLATFORM_QNX +#define TRIO_PLATFORM_UNIX +#define TRIO_PLATFORM_QNX #endif #if defined(__CYGWIN__) -# define TRIO_PLATFORM_UNIX +#define TRIO_PLATFORM_UNIX #endif #if defined(AMIGA) && defined(TRIO_COMPILER_GCC) -# define TRIO_PLATFORM_UNIX +#define TRIO_PLATFORM_UNIX #endif #if defined(TRIO_COMPILER_MSVC) || defined(WIN32) || defined(_WIN32) -# define TRIO_PLATFORM_WIN32 +#define TRIO_PLATFORM_WIN32 #endif #if defined(_WIN32_WCE) -# define TRIO_PLATFORM_WINCE +#define TRIO_PLATFORM_WINCE #endif #if defined(mpeix) || defined(__mpexl) -# define TRIO_PLATFORM_MPEIX +#define TRIO_PLATFORM_MPEIX #endif #if defined(_AIX) -# define TRIO_PLATFORM_AIX +#define TRIO_PLATFORM_AIX #endif #if defined(__hpux) -# define TRIO_PLATFORM_HPUX +#define TRIO_PLATFORM_HPUX #endif #if defined(sun) || defined(__sun__) -# if defined(__SVR4) || defined(__svr4__) -# define TRIO_PLATFORM_SOLARIS -# else -# define TRIO_PLATFORM_SUNOS -# endif +#if defined(__SVR4) || defined(__svr4__) +#define TRIO_PLATFORM_SOLARIS +#else +#define TRIO_PLATFORM_SUNOS +#endif #endif /************************************************************************* * Standards support detection */ -#if defined(__STDC__) \ - || defined(_MSC_EXTENSIONS) \ - || defined(TRIO_COMPILER_BCB) -# define PREDEF_STANDARD_C89 +#if defined(__STDC__) || defined(_MSC_EXTENSIONS) || defined(TRIO_COMPILER_BCB) +#define PREDEF_STANDARD_C89 #endif #if defined(__STDC_VERSION__) -# define PREDEF_STANDARD_C90 +#define PREDEF_STANDARD_C90 #endif #if (__STDC_VERSION__ - 0 >= 199409L) -# define PREDEF_STANDARD_C94 +#define PREDEF_STANDARD_C94 #endif #if (__STDC_VERSION__ - 0 >= 199901L) -# define PREDEF_STANDARD_C99 +#define PREDEF_STANDARD_C99 #endif #if defined(TRIO_COMPILER_SUNPRO) && (TRIO_COMPILER_SUNPRO >= 0x420) -# if !defined(PREDEF_STANDARD_C94) -# define PREDEF_STANDARD_C94 -# endif +#if !defined(PREDEF_STANDARD_C94) +#define PREDEF_STANDARD_C94 +#endif #endif #if defined(__cplusplus) -# define PREDEF_STANDARD_CXX -# if __cplusplus - 0 >= 199711L -# define PREDEF_STANDARD_CXX89 -# endif +#define PREDEF_STANDARD_CXX +#if __cplusplus - 0 >= 199711L +#define PREDEF_STANDARD_CXX89 +#endif #endif #if defined(TRIO_PLATFORM_UNIX) -# include +#include #endif #if defined(_POSIX_VERSION) -# define PREDEF_STANDARD_POSIX _POSIX_VERSION -# if (_POSIX_VERSION >= 199506L) -# define PREDEF_STANDARD_POSIX_1996 -# endif +#define PREDEF_STANDARD_POSIX _POSIX_VERSION +#if (_POSIX_VERSION >= 199506L) +#define PREDEF_STANDARD_POSIX_1996 +#endif #endif #if (_XOPEN_VERSION - 0 >= 3) || defined(_XOPEN_XPG3) -# define PREDEF_STANDARD_XPG3 +#define PREDEF_STANDARD_XPG3 #endif #if (_XOPEN_VERSION - 0 >= 4) || defined(_XOPEN_XPG4) -# define PREDEF_STANDARD_XPG4 +#define PREDEF_STANDARD_XPG4 #endif -#if (_XOPEN_VERSION - 0 > 4) \ - || (defined(_XOPEN_UNIX) && (_XOPEN_VERSION - 0 == 4)) -# define PREDEF_STANDARD_UNIX95 +#if (_XOPEN_VERSION - 0 > 4) || (defined(_XOPEN_UNIX) && (_XOPEN_VERSION - 0 == 4)) +#define PREDEF_STANDARD_UNIX95 #endif #if (_XOPEN_VERSION - 0 >= 500) -# define PREDEF_STANDARD_UNIX98 +#define PREDEF_STANDARD_UNIX98 #endif #if (_XOPEN_VERSION - 0 >= 600) -# define PREDEF_STANDARD_UNIX03 +#define PREDEF_STANDARD_UNIX03 #endif /************************************************************************* @@ -206,81 +203,130 @@ */ #if !defined(TRIO_PUBLIC) -# define TRIO_PUBLIC +#define TRIO_PUBLIC #endif #if !defined(TRIO_PRIVATE) -# define TRIO_PRIVATE static +#define TRIO_PRIVATE static #endif #if !(defined(PREDEF_STANDARD_C89) || defined(PREDEF_STANDARD_CXX)) -# define TRIO_COMPILER_ANCIENT +#define TRIO_COMPILER_ANCIENT #endif #if defined(TRIO_COMPILER_ANCIENT) -# define TRIO_CONST -# define TRIO_VOLATILE -# define TRIO_SIGNED +#define TRIO_CONST +#define TRIO_VOLATILE +#define TRIO_SIGNED typedef double trio_long_double_t; -typedef char * trio_pointer_t; -# define TRIO_SUFFIX_LONG(x) x -# define TRIO_PROTO(x) () -# define TRIO_NOARGS -# define TRIO_ARGS1(list,a1) list a1; -# define TRIO_ARGS2(list,a1,a2) list a1; a2; -# define TRIO_ARGS3(list,a1,a2,a3) list a1; a2; a3; -# define TRIO_ARGS4(list,a1,a2,a3,a4) list a1; a2; a3; a4; -# define TRIO_ARGS5(list,a1,a2,a3,a4,a5) list a1; a2; a3; a4; a5; -# define TRIO_ARGS6(list,a1,a2,a3,a4,a5,a6) list a1; a2; a3; a4; a5; a6; -# define TRIO_ARGS7(list,a1,a2,a3,a4,a5,a6,a7) list a1; a2; a3; a4; a5; a6; a7; -# define TRIO_ARGS8(list,a1,a2,a3,a4,a5,a6,a7,a8) list a1; a2; a3; a4; a5; a6; a7; a8; -# define TRIO_VARGS2(list,a1,a2) list a1; a2 -# define TRIO_VARGS3(list,a1,a2,a3) list a1; a2; a3 -# define TRIO_VARGS4(list,a1,a2,a3,a4) list a1; a2; a3; a4 -# define TRIO_VARGS5(list,a1,a2,a3,a4,a5) list a1; a2; a3; a4; a5 -# define TRIO_VA_DECL va_dcl -# define TRIO_VA_START(x,y) va_start(x) -# define TRIO_VA_END(x) va_end(x) +typedef char* trio_pointer_t; +#define TRIO_SUFFIX_LONG(x) x +#define TRIO_PROTO(x) () +#define TRIO_NOARGS +#define TRIO_ARGS1(list, a1) list a1; +#define TRIO_ARGS2(list, a1, a2) \ + list a1; \ + a2; +#define TRIO_ARGS3(list, a1, a2, a3) \ + list a1; \ + a2; \ + a3; +#define TRIO_ARGS4(list, a1, a2, a3, a4) \ + list a1; \ + a2; \ + a3; \ + a4; +#define TRIO_ARGS5(list, a1, a2, a3, a4, a5) \ + list a1; \ + a2; \ + a3; \ + a4; \ + a5; +#define TRIO_ARGS6(list, a1, a2, a3, a4, a5, a6) \ + list a1; \ + a2; \ + a3; \ + a4; \ + a5; \ + a6; +#define TRIO_ARGS7(list, a1, a2, a3, a4, a5, a6, a7) \ + list a1; \ + a2; \ + a3; \ + a4; \ + a5; \ + a6; \ + a7; +#define TRIO_ARGS8(list, a1, a2, a3, a4, a5, a6, a7, a8) \ + list a1; \ + a2; \ + a3; \ + a4; \ + a5; \ + a6; \ + a7; \ + a8; +#define TRIO_VARGS2(list, a1, a2) \ + list a1; \ + a2 +#define TRIO_VARGS3(list, a1, a2, a3) \ + list a1; \ + a2; \ + a3 +#define TRIO_VARGS4(list, a1, a2, a3, a4) \ + list a1; \ + a2; \ + a3; \ + a4 +#define TRIO_VARGS5(list, a1, a2, a3, a4, a5) \ + list a1; \ + a2; \ + a3; \ + a4; \ + a5 +#define TRIO_VA_DECL va_dcl +#define TRIO_VA_START(x, y) va_start(x) +#define TRIO_VA_END(x) va_end(x) #else /* ANSI C */ -# define TRIO_CONST const -# define TRIO_VOLATILE volatile -# define TRIO_SIGNED signed +#define TRIO_CONST const +#define TRIO_VOLATILE volatile +#define TRIO_SIGNED signed typedef long double trio_long_double_t; -typedef void * trio_pointer_t; -# define TRIO_SUFFIX_LONG(x) x ## L -# define TRIO_PROTO(x) x -# define TRIO_NOARGS void -# define TRIO_ARGS1(list,a1) (a1) -# define TRIO_ARGS2(list,a1,a2) (a1,a2) -# define TRIO_ARGS3(list,a1,a2,a3) (a1,a2,a3) -# define TRIO_ARGS4(list,a1,a2,a3,a4) (a1,a2,a3,a4) -# define TRIO_ARGS5(list,a1,a2,a3,a4,a5) (a1,a2,a3,a4,a5) -# define TRIO_ARGS6(list,a1,a2,a3,a4,a5,a6) (a1,a2,a3,a4,a5,a6) -# define TRIO_ARGS7(list,a1,a2,a3,a4,a5,a6,a7) (a1,a2,a3,a4,a5,a6,a7) -# define TRIO_ARGS8(list,a1,a2,a3,a4,a5,a6,a7,a8) (a1,a2,a3,a4,a5,a6,a7,a8) -# define TRIO_VARGS2 TRIO_ARGS2 -# define TRIO_VARGS3 TRIO_ARGS3 -# define TRIO_VARGS4 TRIO_ARGS4 -# define TRIO_VARGS5 TRIO_ARGS5 -# define TRIO_VA_DECL ... -# define TRIO_VA_START(x,y) va_start(x,y) -# define TRIO_VA_END(x) va_end(x) +typedef void* trio_pointer_t; +#define TRIO_SUFFIX_LONG(x) x##L +#define TRIO_PROTO(x) x +#define TRIO_NOARGS void +#define TRIO_ARGS1(list, a1) (a1) +#define TRIO_ARGS2(list, a1, a2) (a1, a2) +#define TRIO_ARGS3(list, a1, a2, a3) (a1, a2, a3) +#define TRIO_ARGS4(list, a1, a2, a3, a4) (a1, a2, a3, a4) +#define TRIO_ARGS5(list, a1, a2, a3, a4, a5) (a1, a2, a3, a4, a5) +#define TRIO_ARGS6(list, a1, a2, a3, a4, a5, a6) (a1, a2, a3, a4, a5, a6) +#define TRIO_ARGS7(list, a1, a2, a3, a4, a5, a6, a7) (a1, a2, a3, a4, a5, a6, a7) +#define TRIO_ARGS8(list, a1, a2, a3, a4, a5, a6, a7, a8) (a1, a2, a3, a4, a5, a6, a7, a8) +#define TRIO_VARGS2 TRIO_ARGS2 +#define TRIO_VARGS3 TRIO_ARGS3 +#define TRIO_VARGS4 TRIO_ARGS4 +#define TRIO_VARGS5 TRIO_ARGS5 +#define TRIO_VA_DECL ... +#define TRIO_VA_START(x, y) va_start(x, y) +#define TRIO_VA_END(x) va_end(x) #endif #if defined(PREDEF_STANDARD_C99) || defined(PREDEF_STANDARD_CXX) -# define TRIO_INLINE inline +#define TRIO_INLINE inline #else -# if defined(TRIO_COMPILER_GCC) -# define TRIO_INLINE __inline__ -# endif -# if defined(TRIO_COMPILER_MSVC) -# define TRIO_INLINE _inline -# endif -# if defined(TRIO_COMPILER_BCB) -# define TRIO_INLINE __inline -# endif +#if defined(TRIO_COMPILER_GCC) +#define TRIO_INLINE __inline__ +#endif +#if defined(TRIO_COMPILER_MSVC) +#define TRIO_INLINE _inline +#endif +#if defined(TRIO_COMPILER_BCB) +#define TRIO_INLINE __inline +#endif #endif #if !defined(TRIO_INLINE) -# define TRIO_INLINE +#define TRIO_INLINE #endif /************************************************************************* @@ -292,17 +338,17 @@ typedef void * trio_pointer_t; * Computations done with constants at compile time can trigger these * even when compiling with IEEE enabled. */ -# pragma message disable (UNDERFLOW, FLOATOVERFL) +#pragma message disable(UNDERFLOW, FLOATOVERFL) -# if (__CRTL_VER < 80210001) +#if (__CRTL_VER < 80210001) /* * Although the compiler supports C99 language constructs, the C * run-time library does not contain all C99 functions. */ -# if defined(PREDEF_STANDARD_C99) -# undef PREDEF_STANDARD_C99 -# endif -# endif +#if defined(PREDEF_STANDARD_C99) +#undef PREDEF_STANDARD_C99 +#endif +#endif #endif /* @@ -310,15 +356,15 @@ typedef void * trio_pointer_t; */ #if defined(TRIO_COMPILER_MSVC) || defined(TRIO_COMPILER_BCB) #else -# define TRIO_COMPILER_SUPPORTS_LL +#define TRIO_COMPILER_SUPPORTS_LL #endif #if defined(TRIO_PLATFORM_UNIX) && !defined(HAVE_MATH_C99_LONG_DOUBLE) -# define TRIO_NO_FLOORL 1 -# define TRIO_NO_CEILL 1 -# define TRIO_NO_POWL 1 -# define TRIO_NO_FMODL 1 -# define TRIO_NO_LOG10L 1 +#define TRIO_NO_FLOORL 1 +#define TRIO_NO_CEILL 1 +#define TRIO_NO_POWL 1 +#define TRIO_NO_FMODL 1 +#define TRIO_NO_LOG10L 1 #endif #endif /* TRIO_TRIODEF_H */ diff --git a/winpr/libwinpr/utils/trio/trionan.c b/winpr/libwinpr/utils/trio/trionan.c index d58246881..7a8bb246d 100644 --- a/winpr/libwinpr/utils/trio/trionan.c +++ b/winpr/libwinpr/utils/trio/trionan.c @@ -41,18 +41,18 @@ #include #include #if !defined(TRIO_PLATFORM_SYMBIAN) -# include +#include #endif #if defined(TRIO_PLATFORM_UNIX) -# include +#include #endif #if defined(TRIO_COMPILER_DECC) -# include +#include #endif #include #if defined(TRIO_DOCUMENTATION) -# include "doc/doc_nan.h" +#include "doc/doc_nan.h" #endif /** @addtogroup SpecialQuantities @{ @@ -63,10 +63,10 @@ */ #if !defined(TRIO_PUBLIC_NAN) -# define TRIO_PUBLIC_NAN TRIO_PUBLIC +#define TRIO_PUBLIC_NAN TRIO_PUBLIC #endif #if !defined(TRIO_PRIVATE_NAN) -# define TRIO_PRIVATE_NAN TRIO_PRIVATE +#define TRIO_PRIVATE_NAN TRIO_PRIVATE #endif #define TRIO_TRUE (1 == 1) @@ -76,19 +76,19 @@ * We must enable IEEE floating-point on Alpha */ #if defined(__alpha) && !defined(_IEEE_FP) -# if defined(TRIO_COMPILER_DECC) -# if defined(TRIO_PLATFORM_VMS) -# error "Must be compiled with option /IEEE_MODE=UNDERFLOW_TO_ZERO/FLOAT=IEEE" -# else -# if !defined(_CFE) -# error "Must be compiled with option -ieee" -# endif -# endif -# else -# if defined(TRIO_COMPILER_GCC) -# error "Must be compiled with option -mieee" -# endif -# endif +#if defined(TRIO_COMPILER_DECC) +#if defined(TRIO_PLATFORM_VMS) +#error "Must be compiled with option /IEEE_MODE=UNDERFLOW_TO_ZERO/FLOAT=IEEE" +#else +#if !defined(_CFE) +#error "Must be compiled with option -ieee" +#endif +#endif +#else +#if defined(TRIO_COMPILER_GCC) +#error "Must be compiled with option -mieee" +#endif +#endif #endif /* __alpha && ! _IEEE_FP */ /* @@ -105,121 +105,119 @@ * the ability to represent 53 bits wide mantissa. */ #if defined(__STDC_IEC_559__) -# define TRIO_IEEE_754 +#define TRIO_IEEE_754 #else -# if (FLT_RADIX - 0 == 2) && (DBL_MAX_EXP - 0 == 1024) && (DBL_MANT_DIG - 0 == 53) -# define TRIO_IEEE_754 -# endif +#if (FLT_RADIX - 0 == 2) && (DBL_MAX_EXP - 0 == 1024) && (DBL_MANT_DIG - 0 == 53) +#define TRIO_IEEE_754 +#endif #endif /* * Determine which fpclassify_and_sign() function to use. */ #if defined(TRIO_FUNC_FPCLASSIFY_AND_SIGNBIT) -# if defined(PREDEF_STANDARD_C99) && defined(fpclassify) -# define TRIO_FUNC_C99_FPCLASSIFY_AND_SIGNBIT -# else -# if defined(TRIO_COMPILER_DECC) -# define TRIO_FUNC_DECC_FPCLASSIFY_AND_SIGNBIT -# else -# if defined(TRIO_COMPILER_VISUALC) || defined(TRIO_COMPILER_BORLAND) -# define TRIO_FUNC_MS_FPCLASSIFY_AND_SIGNBIT -# else -# if defined(TRIO_COMPILER_HP) && defined(FP_PLUS_NORM) -# define TRIO_FUNC_HP_FPCLASSIFY_AND_SIGNBIT -# else -# if defined(TRIO_COMPILER_XLC) && defined(FP_PLUS_NORM) -# define TRIO_FUNC_XLC_FPCLASSIFY_AND_SIGNBIT -# else -# define TRIO_FUNC_INTERNAL_FPCLASSIFY_AND_SIGNBIT -# endif -# endif -# endif -# endif -# endif +#if defined(PREDEF_STANDARD_C99) && defined(fpclassify) +#define TRIO_FUNC_C99_FPCLASSIFY_AND_SIGNBIT +#else +#if defined(TRIO_COMPILER_DECC) +#define TRIO_FUNC_DECC_FPCLASSIFY_AND_SIGNBIT +#else +#if defined(TRIO_COMPILER_VISUALC) || defined(TRIO_COMPILER_BORLAND) +#define TRIO_FUNC_MS_FPCLASSIFY_AND_SIGNBIT +#else +#if defined(TRIO_COMPILER_HP) && defined(FP_PLUS_NORM) +#define TRIO_FUNC_HP_FPCLASSIFY_AND_SIGNBIT +#else +#if defined(TRIO_COMPILER_XLC) && defined(FP_PLUS_NORM) +#define TRIO_FUNC_XLC_FPCLASSIFY_AND_SIGNBIT +#else +#define TRIO_FUNC_INTERNAL_FPCLASSIFY_AND_SIGNBIT +#endif +#endif +#endif +#endif +#endif #endif /* * Determine how to generate negative zero. */ #if defined(TRIO_FUNC_NZERO) -# if defined(TRIO_IEEE_754) -# define TRIO_NZERO_IEEE_754 -# else -# define TRIO_NZERO_FALLBACK -# endif +#if defined(TRIO_IEEE_754) +#define TRIO_NZERO_IEEE_754 +#else +#define TRIO_NZERO_FALLBACK +#endif #endif /* * Determine how to generate positive infinity. */ #if defined(TRIO_FUNC_PINF) -# if defined(INFINITY) && defined(__STDC_IEC_559__) -# define TRIO_PINF_C99_MACRO -# else -# if defined(TRIO_IEEE_754) -# define TRIO_PINF_IEEE_754 -# else -# define TRIO_PINF_FALLBACK -# endif -# endif +#if defined(INFINITY) && defined(__STDC_IEC_559__) +#define TRIO_PINF_C99_MACRO +#else +#if defined(TRIO_IEEE_754) +#define TRIO_PINF_IEEE_754 +#else +#define TRIO_PINF_FALLBACK +#endif +#endif #endif /* * Determine how to generate NaN. */ #if defined(TRIO_FUNC_NAN) -# if defined(PREDEF_STANDARD_C99) && !defined(TRIO_COMPILER_DECC) -# define TRIO_NAN_C99_FUNCTION -# else -# if defined(NAN) && defined(__STDC_IEC_559__) -# define TRIO_NAN_C99_MACRO -# else -# if defined(TRIO_IEEE_754) -# define TRIO_NAN_IEEE_754 -# else -# define TRIO_NAN_FALLBACK -# endif -# endif -# endif +#if defined(PREDEF_STANDARD_C99) && !defined(TRIO_COMPILER_DECC) +#define TRIO_NAN_C99_FUNCTION +#else +#if defined(NAN) && defined(__STDC_IEC_559__) +#define TRIO_NAN_C99_MACRO +#else +#if defined(TRIO_IEEE_754) +#define TRIO_NAN_IEEE_754 +#else +#define TRIO_NAN_FALLBACK +#endif +#endif +#endif #endif /* * Resolve internal dependencies. */ #if defined(TRIO_FUNC_INTERNAL_FPCLASSIFY_AND_SIGNBIT) -# define TRIO_FUNC_INTERNAL_ISNAN -# define TRIO_FUNC_INTERNAL_ISINF -# if defined(TRIO_IEEE_754) -# define TRIO_FUNC_INTERNAL_IS_SPECIAL_QUANTITY -# define TRIO_FUNC_INTERNAL_IS_NEGATIVE -# endif +#define TRIO_FUNC_INTERNAL_ISNAN +#define TRIO_FUNC_INTERNAL_ISINF +#if defined(TRIO_IEEE_754) +#define TRIO_FUNC_INTERNAL_IS_SPECIAL_QUANTITY +#define TRIO_FUNC_INTERNAL_IS_NEGATIVE +#endif #endif -#if defined(TRIO_NZERO_IEEE_754) \ - || defined(TRIO_PINF_IEEE_754) \ - || defined(TRIO_NAN_IEEE_754) -# define TRIO_FUNC_INTERNAL_MAKE_DOUBLE +#if defined(TRIO_NZERO_IEEE_754) || defined(TRIO_PINF_IEEE_754) || defined(TRIO_NAN_IEEE_754) +#define TRIO_FUNC_INTERNAL_MAKE_DOUBLE #endif #if defined(TRIO_FUNC_INTERNAL_ISNAN) -# if defined(PREDEF_STANDARD_XPG3) -# define TRIO_INTERNAL_ISNAN_XPG3 -# else -# if defined(TRIO_IEEE_754) -# define TRIO_INTERNAL_ISNAN_IEEE_754 -# else -# define TRIO_INTERNAL_ISNAN_FALLBACK -# endif -# endif +#if defined(PREDEF_STANDARD_XPG3) +#define TRIO_INTERNAL_ISNAN_XPG3 +#else +#if defined(TRIO_IEEE_754) +#define TRIO_INTERNAL_ISNAN_IEEE_754 +#else +#define TRIO_INTERNAL_ISNAN_FALLBACK +#endif +#endif #endif #if defined(TRIO_FUNC_INTERNAL_ISINF) -# if defined(TRIO_IEEE_754) -# define TRIO_INTERNAL_ISINF_IEEE_754 -# else -# define TRIO_INTERNAL_ISINF_FALLBACK -# endif +#if defined(TRIO_IEEE_754) +#define TRIO_INTERNAL_ISINF_IEEE_754 +#else +#define TRIO_INTERNAL_ISINF_FALLBACK +#endif #endif /************************************************************************* @@ -231,9 +229,8 @@ /* static TRIO_CONST char rcsid[] = "@(#)$Id: trionan.c,v 1.33 2005/05/29 11:57:25 breese Exp $"; */ #endif -#if defined(TRIO_FUNC_INTERNAL_MAKE_DOUBLE) \ - || defined(TRIO_FUNC_INTERNAL_IS_SPECIAL_QUANTITY) \ - || defined(TRIO_FUNC_INTERNAL_IS_NEGATIVE) +#if defined(TRIO_FUNC_INTERNAL_MAKE_DOUBLE) || defined(TRIO_FUNC_INTERNAL_IS_SPECIAL_QUANTITY) || \ + defined(TRIO_FUNC_INTERNAL_IS_NEGATIVE) /* * Endian-agnostic indexing macro. * @@ -245,51 +242,44 @@ * kind of endianess. The individual bytes are then used as an index * for the IEEE 754 bit-patterns and masks. */ -#define TRIO_DOUBLE_INDEX(x) (((unsigned char *)&internalEndianMagic)[7-(x)]) +#define TRIO_DOUBLE_INDEX(x) (((unsigned char*)&internalEndianMagic)[7 - (x)]) static TRIO_CONST double internalEndianMagic = 7.949928895127363e-275; #endif #if defined(TRIO_FUNC_INTERNAL_IS_SPECIAL_QUANTITY) /* Mask for the exponent */ -static TRIO_CONST unsigned char ieee_754_exponent_mask[] = { - 0x7F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; +static TRIO_CONST unsigned char ieee_754_exponent_mask[] = { 0x7F, 0xF0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; /* Mask for the mantissa */ -static TRIO_CONST unsigned char ieee_754_mantissa_mask[] = { - 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF -}; +static TRIO_CONST unsigned char ieee_754_mantissa_mask[] = { 0x00, 0x0F, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF }; #endif #if defined(TRIO_FUNC_INTERNAL_IS_NEGATIVE) /* Mask for the sign bit */ -static TRIO_CONST unsigned char ieee_754_sign_mask[] = { - 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; +static TRIO_CONST unsigned char ieee_754_sign_mask[] = { 0x80, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; #endif #if defined(TRIO_NZERO_IEEE_754) /* Bit-pattern for negative zero */ -static TRIO_CONST unsigned char ieee_754_negzero_array[] = { - 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; +static TRIO_CONST unsigned char ieee_754_negzero_array[] = { 0x80, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; #endif #if defined(TRIO_PINF_IEEE_754) /* Bit-pattern for infinity */ -static TRIO_CONST unsigned char ieee_754_infinity_array[] = { - 0x7F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; +static TRIO_CONST unsigned char ieee_754_infinity_array[] = { 0x7F, 0xF0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; #endif #if defined(TRIO_NAN_IEEE_754) /* Bit-pattern for quiet NaN */ -static TRIO_CONST unsigned char ieee_754_qnan_array[] = { - 0x7F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; +static TRIO_CONST unsigned char ieee_754_qnan_array[] = { 0x7F, 0xF8, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; #endif - /************************************************************************* * Internal functions */ @@ -299,18 +289,16 @@ static TRIO_CONST unsigned char ieee_754_qnan_array[] = { */ #if defined(TRIO_FUNC_INTERNAL_MAKE_DOUBLE) -TRIO_PRIVATE_NAN double -internal_make_double -TRIO_ARGS1((values), - TRIO_CONST unsigned char *values) +TRIO_PRIVATE_NAN double internal_make_double TRIO_ARGS1((values), TRIO_CONST unsigned char* values) { - TRIO_VOLATILE double result; - int i; + TRIO_VOLATILE double result; + int i; - for (i = 0; i < (int)sizeof(double); i++) { - ((TRIO_VOLATILE unsigned char *)&result)[TRIO_DOUBLE_INDEX(i)] = values[i]; - } - return result; + for (i = 0; i < (int)sizeof(double); i++) + { + ((TRIO_VOLATILE unsigned char*)&result)[TRIO_DOUBLE_INDEX(i)] = values[i]; + } + return result; } #endif @@ -320,25 +308,22 @@ TRIO_ARGS1((values), */ #if defined(TRIO_FUNC_INTERNAL_IS_SPECIAL_QUANTITY) -TRIO_PRIVATE_NAN int -internal_is_special_quantity -TRIO_ARGS2((number, has_mantissa), - double number, - int *has_mantissa) +TRIO_PRIVATE_NAN int internal_is_special_quantity TRIO_ARGS2((number, has_mantissa), double number, + int* has_mantissa) { - unsigned int i; - unsigned char current; - int is_special_quantity = TRIO_TRUE; + unsigned int i; + unsigned char current; + int is_special_quantity = TRIO_TRUE; - *has_mantissa = 0; + *has_mantissa = 0; - for (i = 0; i < (unsigned int)sizeof(double); i++) { - current = ((unsigned char *)&number)[TRIO_DOUBLE_INDEX(i)]; - is_special_quantity - &= ((current & ieee_754_exponent_mask[i]) == ieee_754_exponent_mask[i]); - *has_mantissa |= (current & ieee_754_mantissa_mask[i]); - } - return is_special_quantity; + for (i = 0; i < (unsigned int)sizeof(double); i++) + { + current = ((unsigned char*)&number)[TRIO_DOUBLE_INDEX(i)]; + is_special_quantity &= ((current & ieee_754_exponent_mask[i]) == ieee_754_exponent_mask[i]); + *has_mantissa |= (current & ieee_754_mantissa_mask[i]); + } + return is_special_quantity; } #endif @@ -348,386 +333,365 @@ TRIO_ARGS2((number, has_mantissa), */ #if defined(TRIO_FUNC_INTERNAL_IS_NEGATIVE) -TRIO_PRIVATE_NAN int -internal_is_negative -TRIO_ARGS1((number), - double number) +TRIO_PRIVATE_NAN int internal_is_negative TRIO_ARGS1((number), double number) { - unsigned int i; - int is_negative = TRIO_FALSE; + unsigned int i; + int is_negative = TRIO_FALSE; - for (i = 0; i < (unsigned int)sizeof(double); i++) { - is_negative |= (((unsigned char *)&number)[TRIO_DOUBLE_INDEX(i)] - & ieee_754_sign_mask[i]); - } - return is_negative; + for (i = 0; i < (unsigned int)sizeof(double); i++) + { + is_negative |= (((unsigned char*)&number)[TRIO_DOUBLE_INDEX(i)] & ieee_754_sign_mask[i]); + } + return is_negative; } #endif #if defined(TRIO_FUNC_C99_FPCLASSIFY_AND_SIGNBIT) -TRIO_PRIVATE_NAN TRIO_INLINE int -c99_fpclassify_and_signbit -TRIO_ARGS2((number, is_negative), - double number, - int *is_negative) +TRIO_PRIVATE_NAN TRIO_INLINE int c99_fpclassify_and_signbit TRIO_ARGS2((number, is_negative), + double number, + int* is_negative) { - *is_negative = signbit(number); - switch (fpclassify(number)) { - case FP_NAN: - return TRIO_FP_NAN; - case FP_INFINITE: - return TRIO_FP_INFINITE; - case FP_SUBNORMAL: - return TRIO_FP_SUBNORMAL; - case FP_ZERO: - return TRIO_FP_ZERO; - default: - return TRIO_FP_NORMAL; - } + *is_negative = signbit(number); + switch (fpclassify(number)) + { + case FP_NAN: + return TRIO_FP_NAN; + case FP_INFINITE: + return TRIO_FP_INFINITE; + case FP_SUBNORMAL: + return TRIO_FP_SUBNORMAL; + case FP_ZERO: + return TRIO_FP_ZERO; + default: + return TRIO_FP_NORMAL; + } } #endif /* TRIO_FUNC_C99_FPCLASSIFY_AND_SIGNBIT */ #if defined(TRIO_FUNC_DECC_FPCLASSIFY_AND_SIGNBIT) -TRIO_PRIVATE_NAN TRIO_INLINE int -decc_fpclassify_and_signbit -TRIO_ARGS2((number, is_negative), - double number, - int *is_negative) +TRIO_PRIVATE_NAN TRIO_INLINE int decc_fpclassify_and_signbit TRIO_ARGS2((number, is_negative), + double number, + int* is_negative) { - switch (fp_class(number)) { - case FP_QNAN: - case FP_SNAN: - *is_negative = TRIO_FALSE; /* NaN has no sign */ - return TRIO_FP_NAN; - case FP_POS_INF: - *is_negative = TRIO_FALSE; - return TRIO_FP_INFINITE; - case FP_NEG_INF: - *is_negative = TRIO_TRUE; - return TRIO_FP_INFINITE; - case FP_POS_DENORM: - *is_negative = TRIO_FALSE; - return TRIO_FP_SUBNORMAL; - case FP_NEG_DENORM: - *is_negative = TRIO_TRUE; - return TRIO_FP_SUBNORMAL; - case FP_POS_ZERO: - *is_negative = TRIO_FALSE; - return TRIO_FP_ZERO; - case FP_NEG_ZERO: - *is_negative = TRIO_TRUE; - return TRIO_FP_ZERO; - case FP_POS_NORM: - *is_negative = TRIO_FALSE; - return TRIO_FP_NORMAL; - case FP_NEG_NORM: - *is_negative = TRIO_TRUE; - return TRIO_FP_NORMAL; - default: - *is_negative = (number < 0.0); - return TRIO_FP_NORMAL; - } + switch (fp_class(number)) + { + case FP_QNAN: + case FP_SNAN: + *is_negative = TRIO_FALSE; /* NaN has no sign */ + return TRIO_FP_NAN; + case FP_POS_INF: + *is_negative = TRIO_FALSE; + return TRIO_FP_INFINITE; + case FP_NEG_INF: + *is_negative = TRIO_TRUE; + return TRIO_FP_INFINITE; + case FP_POS_DENORM: + *is_negative = TRIO_FALSE; + return TRIO_FP_SUBNORMAL; + case FP_NEG_DENORM: + *is_negative = TRIO_TRUE; + return TRIO_FP_SUBNORMAL; + case FP_POS_ZERO: + *is_negative = TRIO_FALSE; + return TRIO_FP_ZERO; + case FP_NEG_ZERO: + *is_negative = TRIO_TRUE; + return TRIO_FP_ZERO; + case FP_POS_NORM: + *is_negative = TRIO_FALSE; + return TRIO_FP_NORMAL; + case FP_NEG_NORM: + *is_negative = TRIO_TRUE; + return TRIO_FP_NORMAL; + default: + *is_negative = (number < 0.0); + return TRIO_FP_NORMAL; + } } #endif /* TRIO_FUNC_DECC_FPCLASSIFY_AND_SIGNBIT */ #if defined(TRIO_FUNC_MS_FPCLASSIFY_AND_SIGNBIT) -TRIO_PRIVATE_NAN int -ms_fpclassify_and_signbit -TRIO_ARGS2((number, is_negative), - double number, - int *is_negative) +TRIO_PRIVATE_NAN int ms_fpclassify_and_signbit TRIO_ARGS2((number, is_negative), double number, + int* is_negative) { - int result; -# if defined(TRIO_COMPILER_BORLAND) - /* - * The floating-point precision may be changed by the Borland _fpclass() - * function, so we have to save and restore the floating-point control mask. - */ - unsigned int mask; - /* Remember the old mask */ - mask = _control87(0, 0); -# endif - - switch (_fpclass(number)) { - case _FPCLASS_QNAN: - case _FPCLASS_SNAN: - *is_negative = TRIO_FALSE; /* NaN has no sign */ - result = TRIO_FP_NAN; - break; - case _FPCLASS_PINF: - *is_negative = TRIO_FALSE; - result = TRIO_FP_INFINITE; - break; - case _FPCLASS_NINF: - *is_negative = TRIO_TRUE; - result = TRIO_FP_INFINITE; - break; - case _FPCLASS_PD: - *is_negative = TRIO_FALSE; - result = TRIO_FP_SUBNORMAL; - break; - case _FPCLASS_ND: - *is_negative = TRIO_TRUE; - result = TRIO_FP_SUBNORMAL; - break; - case _FPCLASS_PZ: - *is_negative = TRIO_FALSE; - result = TRIO_FP_ZERO; - break; - case _FPCLASS_NZ: - *is_negative = TRIO_TRUE; - result = TRIO_FP_ZERO; - break; - case _FPCLASS_PN: - *is_negative = TRIO_FALSE; - result = TRIO_FP_NORMAL; - break; - case _FPCLASS_NN: - *is_negative = TRIO_TRUE; - result = TRIO_FP_NORMAL; - break; - default: - *is_negative = (number < 0.0); - result = TRIO_FP_NORMAL; - break; - } - -# if defined(TRIO_COMPILER_BORLAND) - /* Restore the old precision */ - (void)_control87(mask, MCW_PC); -# endif - - return result; + int result; +#if defined(TRIO_COMPILER_BORLAND) + /* + * The floating-point precision may be changed by the Borland _fpclass() + * function, so we have to save and restore the floating-point control mask. + */ + unsigned int mask; + /* Remember the old mask */ + mask = _control87(0, 0); +#endif + + switch (_fpclass(number)) + { + case _FPCLASS_QNAN: + case _FPCLASS_SNAN: + *is_negative = TRIO_FALSE; /* NaN has no sign */ + result = TRIO_FP_NAN; + break; + case _FPCLASS_PINF: + *is_negative = TRIO_FALSE; + result = TRIO_FP_INFINITE; + break; + case _FPCLASS_NINF: + *is_negative = TRIO_TRUE; + result = TRIO_FP_INFINITE; + break; + case _FPCLASS_PD: + *is_negative = TRIO_FALSE; + result = TRIO_FP_SUBNORMAL; + break; + case _FPCLASS_ND: + *is_negative = TRIO_TRUE; + result = TRIO_FP_SUBNORMAL; + break; + case _FPCLASS_PZ: + *is_negative = TRIO_FALSE; + result = TRIO_FP_ZERO; + break; + case _FPCLASS_NZ: + *is_negative = TRIO_TRUE; + result = TRIO_FP_ZERO; + break; + case _FPCLASS_PN: + *is_negative = TRIO_FALSE; + result = TRIO_FP_NORMAL; + break; + case _FPCLASS_NN: + *is_negative = TRIO_TRUE; + result = TRIO_FP_NORMAL; + break; + default: + *is_negative = (number < 0.0); + result = TRIO_FP_NORMAL; + break; + } + +#if defined(TRIO_COMPILER_BORLAND) + /* Restore the old precision */ + (void)_control87(mask, MCW_PC); +#endif + + return result; } #endif /* TRIO_FUNC_MS_FPCLASSIFY_AND_SIGNBIT */ #if defined(TRIO_FUNC_HP_FPCLASSIFY_AND_SIGNBIT) -TRIO_PRIVATE_NAN TRIO_INLINE int -hp_fpclassify_and_signbit -TRIO_ARGS2((number, is_negative), - double number, - int *is_negative) +TRIO_PRIVATE_NAN TRIO_INLINE int hp_fpclassify_and_signbit TRIO_ARGS2((number, is_negative), + double number, + int* is_negative) { - /* - * HP-UX 9.x and 10.x have an fpclassify() function, that is different - * from the C99 fpclassify() macro supported on HP-UX 11.x. - */ - switch (fpclassify(number)) { - case FP_QNAN: - case FP_SNAN: - *is_negative = TRIO_FALSE; /* NaN has no sign */ - return TRIO_FP_NAN; - case FP_PLUS_INF: - *is_negative = TRIO_FALSE; - return TRIO_FP_INFINITE; - case FP_MINUS_INF: - *is_negative = TRIO_TRUE; - return TRIO_FP_INFINITE; - case FP_PLUS_DENORM: - *is_negative = TRIO_FALSE; - return TRIO_FP_SUBNORMAL; - case FP_MINUS_DENORM: - *is_negative = TRIO_TRUE; - return TRIO_FP_SUBNORMAL; - case FP_PLUS_ZERO: - *is_negative = TRIO_FALSE; - return TRIO_FP_ZERO; - case FP_MINUS_ZERO: - *is_negative = TRIO_TRUE; - return TRIO_FP_ZERO; - case FP_PLUS_NORM: - *is_negative = TRIO_FALSE; - return TRIO_FP_NORMAL; - case FP_MINUS_NORM: - *is_negative = TRIO_TRUE; - return TRIO_FP_NORMAL; - default: - *is_negative = (number < 0.0); - return TRIO_FP_NORMAL; - } + /* + * HP-UX 9.x and 10.x have an fpclassify() function, that is different + * from the C99 fpclassify() macro supported on HP-UX 11.x. + */ + switch (fpclassify(number)) + { + case FP_QNAN: + case FP_SNAN: + *is_negative = TRIO_FALSE; /* NaN has no sign */ + return TRIO_FP_NAN; + case FP_PLUS_INF: + *is_negative = TRIO_FALSE; + return TRIO_FP_INFINITE; + case FP_MINUS_INF: + *is_negative = TRIO_TRUE; + return TRIO_FP_INFINITE; + case FP_PLUS_DENORM: + *is_negative = TRIO_FALSE; + return TRIO_FP_SUBNORMAL; + case FP_MINUS_DENORM: + *is_negative = TRIO_TRUE; + return TRIO_FP_SUBNORMAL; + case FP_PLUS_ZERO: + *is_negative = TRIO_FALSE; + return TRIO_FP_ZERO; + case FP_MINUS_ZERO: + *is_negative = TRIO_TRUE; + return TRIO_FP_ZERO; + case FP_PLUS_NORM: + *is_negative = TRIO_FALSE; + return TRIO_FP_NORMAL; + case FP_MINUS_NORM: + *is_negative = TRIO_TRUE; + return TRIO_FP_NORMAL; + default: + *is_negative = (number < 0.0); + return TRIO_FP_NORMAL; + } } #endif /* TRIO_FUNC_HP_FPCLASSIFY_AND_SIGNBIT */ #if defined(TRIO_FUNC_XLC_FPCLASSIFY_AND_SIGNBIT) -TRIO_PRIVATE_NAN TRIO_INLINE int -xlc_fpclassify_and_signbit -TRIO_ARGS2((number, is_negative), - double number, - int *is_negative) +TRIO_PRIVATE_NAN TRIO_INLINE int xlc_fpclassify_and_signbit TRIO_ARGS2((number, is_negative), + double number, + int* is_negative) { - /* - * AIX has class() for C, and _class() for C++ - */ -# if defined(__cplusplus) -# define AIX_CLASS(n) _class(n) -# else -# define AIX_CLASS(n) class(n) -# endif + /* + * AIX has class() for C, and _class() for C++ + */ +#if defined(__cplusplus) +#define AIX_CLASS(n) _class(n) +#else +#define AIX_CLASS(n) class(n) +#endif - switch (AIX_CLASS(number)) { - case FP_QNAN: - case FP_SNAN: - *is_negative = TRIO_FALSE; /* NaN has no sign */ - return TRIO_FP_NAN; - case FP_PLUS_INF: - *is_negative = TRIO_FALSE; - return TRIO_FP_INFINITE; - case FP_MINUS_INF: - *is_negative = TRIO_TRUE; - return TRIO_FP_INFINITE; - case FP_PLUS_DENORM: - *is_negative = TRIO_FALSE; - return TRIO_FP_SUBNORMAL; - case FP_MINUS_DENORM: - *is_negative = TRIO_TRUE; - return TRIO_FP_SUBNORMAL; - case FP_PLUS_ZERO: - *is_negative = TRIO_FALSE; - return TRIO_FP_ZERO; - case FP_MINUS_ZERO: - *is_negative = TRIO_TRUE; - return TRIO_FP_ZERO; - case FP_PLUS_NORM: - *is_negative = TRIO_FALSE; - return TRIO_FP_NORMAL; - case FP_MINUS_NORM: - *is_negative = TRIO_TRUE; - return TRIO_FP_NORMAL; - default: - *is_negative = (number < 0.0); - return TRIO_FP_NORMAL; - } + switch (AIX_CLASS(number)) + { + case FP_QNAN: + case FP_SNAN: + *is_negative = TRIO_FALSE; /* NaN has no sign */ + return TRIO_FP_NAN; + case FP_PLUS_INF: + *is_negative = TRIO_FALSE; + return TRIO_FP_INFINITE; + case FP_MINUS_INF: + *is_negative = TRIO_TRUE; + return TRIO_FP_INFINITE; + case FP_PLUS_DENORM: + *is_negative = TRIO_FALSE; + return TRIO_FP_SUBNORMAL; + case FP_MINUS_DENORM: + *is_negative = TRIO_TRUE; + return TRIO_FP_SUBNORMAL; + case FP_PLUS_ZERO: + *is_negative = TRIO_FALSE; + return TRIO_FP_ZERO; + case FP_MINUS_ZERO: + *is_negative = TRIO_TRUE; + return TRIO_FP_ZERO; + case FP_PLUS_NORM: + *is_negative = TRIO_FALSE; + return TRIO_FP_NORMAL; + case FP_MINUS_NORM: + *is_negative = TRIO_TRUE; + return TRIO_FP_NORMAL; + default: + *is_negative = (number < 0.0); + return TRIO_FP_NORMAL; + } } #endif /* TRIO_FUNC_XLC_FPCLASSIFY_AND_SIGNBIT */ #if defined(TRIO_FUNC_INTERNAL_ISNAN) -TRIO_PRIVATE_NAN TRIO_INLINE int -internal_isnan -TRIO_ARGS1((number), - double number) +TRIO_PRIVATE_NAN TRIO_INLINE int internal_isnan TRIO_ARGS1((number), double number) { -# if defined(TRIO_INTERNAL_ISNAN_XPG3) || defined(TRIO_PLATFORM_SYMBIAN) - /* - * XPG3 defines isnan() as a function. - */ - return isnan(number); +#if defined(TRIO_INTERNAL_ISNAN_XPG3) || defined(TRIO_PLATFORM_SYMBIAN) + /* + * XPG3 defines isnan() as a function. + */ + return isnan(number); -# endif - -# if defined(TRIO_INTERNAL_ISNAN_IEEE_754) - - /* - * Examine IEEE 754 bit-pattern. A NaN must have a special exponent - * pattern, and a non-empty mantissa. - */ - int has_mantissa; - int is_special_quantity; +#endif - is_special_quantity = internal_is_special_quantity(number, &has_mantissa); - - return (is_special_quantity && has_mantissa); - -# endif +#if defined(TRIO_INTERNAL_ISNAN_IEEE_754) -# if defined(TRIO_INTERNAL_ISNAN_FALLBACK) - - /* - * Fallback solution - */ - int status; - double integral, fraction; - -# if defined(TRIO_PLATFORM_UNIX) - void (*signal_handler)(int) = signal(SIGFPE, SIG_IGN); -# endif - - status = (/* - * NaN is the only number which does not compare to itself - */ - ((TRIO_VOLATILE double)number != (TRIO_VOLATILE double)number) || - /* - * Fallback solution if NaN compares to NaN - */ - ((number != 0.0) && - (fraction = modf(number, &integral), - integral == fraction))); - -# if defined(TRIO_PLATFORM_UNIX) - signal(SIGFPE, signal_handler); -# endif - - return status; - -# endif + /* + * Examine IEEE 754 bit-pattern. A NaN must have a special exponent + * pattern, and a non-empty mantissa. + */ + int has_mantissa; + int is_special_quantity; + + is_special_quantity = internal_is_special_quantity(number, &has_mantissa); + + return (is_special_quantity && has_mantissa); + +#endif + +#if defined(TRIO_INTERNAL_ISNAN_FALLBACK) + + /* + * Fallback solution + */ + int status; + double integral, fraction; + +#if defined(TRIO_PLATFORM_UNIX) + void (*signal_handler)(int) = signal(SIGFPE, SIG_IGN); +#endif + + status = (/* + * NaN is the only number which does not compare to itself + */ + ((TRIO_VOLATILE double)number != (TRIO_VOLATILE double)number) || + /* + * Fallback solution if NaN compares to NaN + */ + ((number != 0.0) && (fraction = modf(number, &integral), integral == fraction))); + +#if defined(TRIO_PLATFORM_UNIX) + signal(SIGFPE, signal_handler); +#endif + + return status; + +#endif } #endif /* TRIO_FUNC_INTERNAL_ISNAN */ #if defined(TRIO_FUNC_INTERNAL_ISINF) -TRIO_PRIVATE_NAN TRIO_INLINE int -internal_isinf -TRIO_ARGS1((number), - double number) +TRIO_PRIVATE_NAN TRIO_INLINE int internal_isinf TRIO_ARGS1((number), double number) { -# if defined(TRIO_PLATFORM_SYMBIAN) +#if defined(TRIO_PLATFORM_SYMBIAN) - return isinf(number); + return isinf(number); -# endif +#endif -# if defined(TRIO_INTERNAL_ISINF_IEEE_754) - /* - * Examine IEEE 754 bit-pattern. Infinity must have a special exponent - * pattern, and an empty mantissa. - */ - int has_mantissa; - int is_special_quantity; +#if defined(TRIO_INTERNAL_ISINF_IEEE_754) + /* + * Examine IEEE 754 bit-pattern. Infinity must have a special exponent + * pattern, and an empty mantissa. + */ + int has_mantissa; + int is_special_quantity; - is_special_quantity = internal_is_special_quantity(number, &has_mantissa); - - return (is_special_quantity && !has_mantissa) - ? ((number < 0.0) ? -1 : 1) - : 0; + is_special_quantity = internal_is_special_quantity(number, &has_mantissa); -# endif + return (is_special_quantity && !has_mantissa) ? ((number < 0.0) ? -1 : 1) : 0; -# if defined(TRIO_INTERNAL_ISINF_FALLBACK) - - /* - * Fallback solution. - */ - int status; - -# if defined(TRIO_PLATFORM_UNIX) - void (*signal_handler)(int) = signal(SIGFPE, SIG_IGN); -# endif - - double infinity = trio_pinf(); - - status = ((number == infinity) - ? 1 - : ((number == -infinity) ? -1 : 0)); - -# if defined(TRIO_PLATFORM_UNIX) - signal(SIGFPE, signal_handler); -# endif - - return status; +#endif -# endif +#if defined(TRIO_INTERNAL_ISINF_FALLBACK) + + /* + * Fallback solution. + */ + int status; + +#if defined(TRIO_PLATFORM_UNIX) + void (*signal_handler)(int) = signal(SIGFPE, SIG_IGN); +#endif + + double infinity = trio_pinf(); + + status = ((number == infinity) ? 1 : ((number == -infinity) ? -1 : 0)); + +#if defined(TRIO_PLATFORM_UNIX) + signal(SIGFPE, signal_handler); +#endif + + return status; + +#endif } #endif /* TRIO_FUNC_INTERNAL_ISINF */ @@ -738,83 +702,85 @@ TRIO_ARGS1((number), #if defined(TRIO_FUNC_FPCLASSIFY_AND_SIGNBIT) -TRIO_PUBLIC_NAN int -trio_fpclassify_and_signbit -TRIO_ARGS2((number, is_negative), - double number, - int *is_negative) +TRIO_PUBLIC_NAN int trio_fpclassify_and_signbit TRIO_ARGS2((number, is_negative), double number, + int* is_negative) { - /* The TRIO_FUNC_xxx_FPCLASSIFY_AND_SIGNBIT macros are mutually exclusive */ - + /* The TRIO_FUNC_xxx_FPCLASSIFY_AND_SIGNBIT macros are mutually exclusive */ + #if defined(TRIO_FUNC_C99_FPCLASSIFY_AND_SIGNBIT) - return c99_fpclassify_and_signbit(number, is_negative); + return c99_fpclassify_and_signbit(number, is_negative); #endif #if defined(TRIO_FUNC_DECC_FPCLASSIFY_AND_SIGNBIT) - return decc_fpclassify_and_signbit(number, is_negative); + return decc_fpclassify_and_signbit(number, is_negative); #endif #if defined(TRIO_FUNC_MS_FPCLASSIFY_AND_SIGNBIT) - return ms_fpclassify_and_signbit(number, is_negative); + return ms_fpclassify_and_signbit(number, is_negative); #endif #if defined(TRIO_FUNC_HP_FPCLASSIFY_AND_SIGNBIT) - return hp_fpclassify_and_signbit(number, is_negative); + return hp_fpclassify_and_signbit(number, is_negative); #endif #if defined(TRIO_FUNC_XLC_FPCLASSIFY_AND_SIGNBIT) - return xlc_fpclassify_and_signbit(number, is_negative); + return xlc_fpclassify_and_signbit(number, is_negative); #endif #if defined(TRIO_FUNC_INTERNAL_FPCLASSIFY_AND_SIGNBIT) - - /* - * Fallback solution. - */ - int rc; - - if (number == 0.0) { - /* - * In IEEE 754 the sign of zero is ignored in comparisons, so we - * have to handle this as a special case by examining the sign bit - * directly. - */ -# if defined(TRIO_IEEE_754) - *is_negative = internal_is_negative(number); -# else - *is_negative = TRIO_FALSE; /* FIXME */ -# endif - return TRIO_FP_ZERO; - } - if (internal_isnan(number)) { - *is_negative = TRIO_FALSE; - return TRIO_FP_NAN; - } - rc = internal_isinf(number); - if (rc != 0) { - *is_negative = (rc == -1); - return TRIO_FP_INFINITE; - } - if ((number > 0.0) && (number < DBL_MIN)) { - *is_negative = TRIO_FALSE; - return TRIO_FP_SUBNORMAL; - } - if ((number < 0.0) && (number > -DBL_MIN)) { - *is_negative = TRIO_TRUE; - return TRIO_FP_SUBNORMAL; - } - *is_negative = (number < 0.0); - return TRIO_FP_NORMAL; + + /* + * Fallback solution. + */ + int rc; + + if (number == 0.0) + { + /* + * In IEEE 754 the sign of zero is ignored in comparisons, so we + * have to handle this as a special case by examining the sign bit + * directly. + */ +#if defined(TRIO_IEEE_754) + *is_negative = internal_is_negative(number); +#else + *is_negative = TRIO_FALSE; /* FIXME */ +#endif + return TRIO_FP_ZERO; + } + if (internal_isnan(number)) + { + *is_negative = TRIO_FALSE; + return TRIO_FP_NAN; + } + rc = internal_isinf(number); + if (rc != 0) + { + *is_negative = (rc == -1); + return TRIO_FP_INFINITE; + } + if ((number > 0.0) && (number < DBL_MIN)) + { + *is_negative = TRIO_FALSE; + return TRIO_FP_SUBNORMAL; + } + if ((number < 0.0) && (number > -DBL_MIN)) + { + *is_negative = TRIO_TRUE; + return TRIO_FP_SUBNORMAL; + } + *is_negative = (number < 0.0); + return TRIO_FP_NORMAL; #endif } @@ -829,14 +795,11 @@ TRIO_ARGS2((number, is_negative), */ #if defined(TRIO_FUNC_ISNAN) -TRIO_PUBLIC_NAN int -trio_isnan -TRIO_ARGS1((number), - double number) +TRIO_PUBLIC_NAN int trio_isnan TRIO_ARGS1((number), double number) { - int dummy; - - return (trio_fpclassify_and_signbit(number, &dummy) == TRIO_FP_NAN); + int dummy; + + return (trio_fpclassify_and_signbit(number, &dummy) == TRIO_FP_NAN); } #endif @@ -849,21 +812,18 @@ TRIO_ARGS1((number), */ #if defined(TRIO_FUNC_ISINF) -TRIO_PUBLIC_NAN int -trio_isinf -TRIO_ARGS1((number), - double number) +TRIO_PUBLIC_NAN int trio_isinf TRIO_ARGS1((number), double number) { - int is_negative; - - if (trio_fpclassify_and_signbit(number, &is_negative) == TRIO_FP_INFINITE) - { - return (is_negative) ? -1 : 1; - } - else - { - return 0; - } + int is_negative; + + if (trio_fpclassify_and_signbit(number, &is_negative) == TRIO_FP_INFINITE) + { + return (is_negative) ? -1 : 1; + } + else + { + return 0; + } } #endif @@ -876,21 +836,18 @@ TRIO_ARGS1((number), */ #if defined(TRIO_FUNC_ISFINITE) -TRIO_PUBLIC_NAN int -trio_isfinite -TRIO_ARGS1((number), - double number) +TRIO_PUBLIC_NAN int trio_isfinite TRIO_ARGS1((number), double number) { - int dummy; - - switch (trio_fpclassify_and_signbit(number, &dummy)) - { - case TRIO_FP_INFINITE: - case TRIO_FP_NAN: - return 0; - default: - return 1; - } + int dummy; + + switch (trio_fpclassify_and_signbit(number, &dummy)) + { + case TRIO_FP_INFINITE: + case TRIO_FP_NAN: + return 0; + default: + return 1; + } } #endif @@ -904,15 +861,12 @@ TRIO_ARGS1((number), */ #if defined(TRIO_FUNC_SIGNBIT) -TRIO_PUBLIC_NAN int -trio_signbit -TRIO_ARGS1((number), - double number) +TRIO_PUBLIC_NAN int trio_signbit TRIO_ARGS1((number), double number) { - int is_negative; - - (void)trio_fpclassify_and_signbit(number, &is_negative); - return is_negative; + int is_negative; + + (void)trio_fpclassify_and_signbit(number, &is_negative); + return is_negative; } #endif @@ -925,14 +879,11 @@ TRIO_ARGS1((number), */ #if defined(TRIO_FUNC_FPCLASSIFY) -TRIO_PUBLIC_NAN int -trio_fpclassify -TRIO_ARGS1((number), - double number) +TRIO_PUBLIC_NAN int trio_fpclassify TRIO_ARGS1((number), double number) { - int dummy; - - return trio_fpclassify_and_signbit(number, &dummy); + int dummy; + + return trio_fpclassify_and_signbit(number, &dummy); } #endif @@ -944,22 +895,21 @@ TRIO_ARGS1((number), */ #if defined(TRIO_FUNC_NZERO) -TRIO_PUBLIC_NAN double -trio_nzero(TRIO_NOARGS) +TRIO_PUBLIC_NAN double trio_nzero(TRIO_NOARGS) { -# if defined(TRIO_NZERO_IEEE_754) - - return internal_make_double(ieee_754_negzero_array); +#if defined(TRIO_NZERO_IEEE_754) -# endif - -# if defined(TRIO_NZERO_FALLBACK) - - TRIO_VOLATILE double zero = 0.0; + return internal_make_double(ieee_754_negzero_array); - return -zero; - -# endif +#endif + +#if defined(TRIO_NZERO_FALLBACK) + + TRIO_VOLATILE double zero = 0.0; + + return -zero; + +#endif } #endif @@ -971,49 +921,50 @@ trio_nzero(TRIO_NOARGS) */ #if defined(TRIO_FUNC_PINF) -TRIO_PUBLIC_NAN double -trio_pinf(TRIO_NOARGS) +TRIO_PUBLIC_NAN double trio_pinf(TRIO_NOARGS) { - /* Cache the result */ - static double pinf_value = 0.0; + /* Cache the result */ + static double pinf_value = 0.0; - if (pinf_value == 0.0) { + if (pinf_value == 0.0) + { -# if defined(TRIO_PINF_C99_MACRO) - - pinf_value = (double)INFINITY; +#if defined(TRIO_PINF_C99_MACRO) -# endif - -# if defined(TRIO_PINF_IEEE_754) - - pinf_value = internal_make_double(ieee_754_infinity_array); + pinf_value = (double)INFINITY; -# endif +#endif -# if defined(TRIO_PINF_FALLBACK) - /* - * If HUGE_VAL is different from DBL_MAX, then HUGE_VAL is used - * as infinity. Otherwise we have to resort to an overflow - * operation to generate infinity. - */ -# if defined(TRIO_PLATFORM_UNIX) - void (*signal_handler)(int) = signal(SIGFPE, SIG_IGN); -# endif +#if defined(TRIO_PINF_IEEE_754) - pinf_value = HUGE_VAL; - if (HUGE_VAL == DBL_MAX) { - /* Force overflow */ - pinf_value += HUGE_VAL; - } - -# if defined(TRIO_PLATFORM_UNIX) - signal(SIGFPE, signal_handler); -# endif + pinf_value = internal_make_double(ieee_754_infinity_array); -# endif - } - return pinf_value; +#endif + +#if defined(TRIO_PINF_FALLBACK) + /* + * If HUGE_VAL is different from DBL_MAX, then HUGE_VAL is used + * as infinity. Otherwise we have to resort to an overflow + * operation to generate infinity. + */ +#if defined(TRIO_PLATFORM_UNIX) + void (*signal_handler)(int) = signal(SIGFPE, SIG_IGN); +#endif + + pinf_value = HUGE_VAL; + if (HUGE_VAL == DBL_MAX) + { + /* Force overflow */ + pinf_value += HUGE_VAL; + } + +#if defined(TRIO_PLATFORM_UNIX) + signal(SIGFPE, signal_handler); +#endif + +#endif + } + return pinf_value; } #endif @@ -1025,20 +976,20 @@ trio_pinf(TRIO_NOARGS) */ #if defined(TRIO_FUNC_NINF) -TRIO_PUBLIC_NAN double -trio_ninf(TRIO_NOARGS) +TRIO_PUBLIC_NAN double trio_ninf(TRIO_NOARGS) { - static double ninf_value = 0.0; + static double ninf_value = 0.0; - if (ninf_value == 0.0) { - /* - * Negative infinity is calculated by negating positive infinity, - * which can be done because it is legal to do calculations on - * infinity (for example, 1 / infinity == 0). - */ - ninf_value = -trio_pinf(); - } - return ninf_value; + if (ninf_value == 0.0) + { + /* + * Negative infinity is calculated by negating positive infinity, + * which can be done because it is legal to do calculations on + * infinity (for example, 1 / infinity == 0). + */ + ninf_value = -trio_pinf(); + } + return ninf_value; } #endif @@ -1050,55 +1001,55 @@ trio_ninf(TRIO_NOARGS) */ #if defined(TRIO_FUNC_NAN) -TRIO_PUBLIC_NAN double -trio_nan(TRIO_NOARGS) +TRIO_PUBLIC_NAN double trio_nan(TRIO_NOARGS) { - /* Cache the result */ - static double nan_value = 0.0; + /* Cache the result */ + static double nan_value = 0.0; - if (nan_value == 0.0) { - -# if defined(TRIO_NAN_C99_FUNCTION) || defined(TRIO_PLATFORM_SYMBIAN) - - nan_value = nan(""); + if (nan_value == 0.0) + { -# endif - -# if defined(TRIO_NAN_C99_MACRO) - - nan_value = (double)NAN; +#if defined(TRIO_NAN_C99_FUNCTION) || defined(TRIO_PLATFORM_SYMBIAN) -# endif + nan_value = nan(""); -# if defined(TRIO_NAN_IEEE_754) - - nan_value = internal_make_double(ieee_754_qnan_array); +#endif -# endif - -# if defined(TRIO_NAN_FALLBACK) - /* - * There are several ways to generate NaN. The one used here is - * to divide infinity by infinity. I would have preferred to add - * negative infinity to positive infinity, but that yields wrong - * result (infinity) on FreeBSD. - * - * This may fail if the hardware does not support NaN, or if - * the Invalid Operation floating-point exception is unmasked. - */ -# if defined(TRIO_PLATFORM_UNIX) - void (*signal_handler)(int) = signal(SIGFPE, SIG_IGN); -# endif - - nan_value = trio_pinf() / trio_pinf(); - -# if defined(TRIO_PLATFORM_UNIX) - signal(SIGFPE, signal_handler); -# endif +#if defined(TRIO_NAN_C99_MACRO) -# endif - } - return nan_value; + nan_value = (double)NAN; + +#endif + +#if defined(TRIO_NAN_IEEE_754) + + nan_value = internal_make_double(ieee_754_qnan_array); + +#endif + +#if defined(TRIO_NAN_FALLBACK) + /* + * There are several ways to generate NaN. The one used here is + * to divide infinity by infinity. I would have preferred to add + * negative infinity to positive infinity, but that yields wrong + * result (infinity) on FreeBSD. + * + * This may fail if the hardware does not support NaN, or if + * the Invalid Operation floating-point exception is unmasked. + */ +#if defined(TRIO_PLATFORM_UNIX) + void (*signal_handler)(int) = signal(SIGFPE, SIG_IGN); +#endif + + nan_value = trio_pinf() / trio_pinf(); + +#if defined(TRIO_PLATFORM_UNIX) + signal(SIGFPE, signal_handler); +#endif + +#endif + } + return nan_value; } #endif @@ -1114,145 +1065,104 @@ trio_nan(TRIO_NOARGS) * VMS : /DEFINE=(STANDALONE) */ #if defined(STANDALONE) -# include +#include -static TRIO_CONST char * -getClassification -TRIO_ARGS1((type), - int type) +static TRIO_CONST char* getClassification TRIO_ARGS1((type), int type) { - switch (type) { - case TRIO_FP_INFINITE: - return "FP_INFINITE"; - case TRIO_FP_NAN: - return "FP_NAN"; - case TRIO_FP_NORMAL: - return "FP_NORMAL"; - case TRIO_FP_SUBNORMAL: - return "FP_SUBNORMAL"; - case TRIO_FP_ZERO: - return "FP_ZERO"; - default: - return "FP_UNKNOWN"; - } + switch (type) + { + case TRIO_FP_INFINITE: + return "FP_INFINITE"; + case TRIO_FP_NAN: + return "FP_NAN"; + case TRIO_FP_NORMAL: + return "FP_NORMAL"; + case TRIO_FP_SUBNORMAL: + return "FP_SUBNORMAL"; + case TRIO_FP_ZERO: + return "FP_ZERO"; + default: + return "FP_UNKNOWN"; + } } -static void -print_class -TRIO_ARGS2((prefix, number), - TRIO_CONST char *prefix, - double number) +static void print_class TRIO_ARGS2((prefix, number), TRIO_CONST char* prefix, double number) { - printf("%-6s: %s %-15s %g\n", - prefix, - trio_signbit(number) ? "-" : "+", - getClassification(trio_fpclassify(number)), - number); + printf("%-6s: %s %-15s %g\n", prefix, trio_signbit(number) ? "-" : "+", + getClassification(trio_fpclassify(number)), number); } int main(TRIO_NOARGS) { - double my_nan; - double my_pinf; - double my_ninf; -# if defined(TRIO_PLATFORM_UNIX) - void (*signal_handler) TRIO_PROTO((int)); -# endif + double my_nan; + double my_pinf; + double my_ninf; +#if defined(TRIO_PLATFORM_UNIX) + void(*signal_handler) TRIO_PROTO((int)); +#endif - my_nan = trio_nan(); - my_pinf = trio_pinf(); - my_ninf = trio_ninf(); + my_nan = trio_nan(); + my_pinf = trio_pinf(); + my_ninf = trio_ninf(); - print_class("Nan", my_nan); - print_class("PInf", my_pinf); - print_class("NInf", my_ninf); - print_class("PZero", 0.0); - print_class("NZero", -0.0); - print_class("PNorm", 1.0); - print_class("NNorm", -1.0); - print_class("PSub", 1.01e-307 - 1.00e-307); - print_class("NSub", 1.00e-307 - 1.01e-307); - - printf("NaN : %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d, %2d)\n", - my_nan, - ((unsigned char *)&my_nan)[0], - ((unsigned char *)&my_nan)[1], - ((unsigned char *)&my_nan)[2], - ((unsigned char *)&my_nan)[3], - ((unsigned char *)&my_nan)[4], - ((unsigned char *)&my_nan)[5], - ((unsigned char *)&my_nan)[6], - ((unsigned char *)&my_nan)[7], - trio_isnan(my_nan), trio_isinf(my_nan), trio_isfinite(my_nan)); - printf("PInf: %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d, %2d)\n", - my_pinf, - ((unsigned char *)&my_pinf)[0], - ((unsigned char *)&my_pinf)[1], - ((unsigned char *)&my_pinf)[2], - ((unsigned char *)&my_pinf)[3], - ((unsigned char *)&my_pinf)[4], - ((unsigned char *)&my_pinf)[5], - ((unsigned char *)&my_pinf)[6], - ((unsigned char *)&my_pinf)[7], - trio_isnan(my_pinf), trio_isinf(my_pinf), trio_isfinite(my_pinf)); - printf("NInf: %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d, %2d)\n", - my_ninf, - ((unsigned char *)&my_ninf)[0], - ((unsigned char *)&my_ninf)[1], - ((unsigned char *)&my_ninf)[2], - ((unsigned char *)&my_ninf)[3], - ((unsigned char *)&my_ninf)[4], - ((unsigned char *)&my_ninf)[5], - ((unsigned char *)&my_ninf)[6], - ((unsigned char *)&my_ninf)[7], - trio_isnan(my_ninf), trio_isinf(my_ninf), trio_isfinite(my_ninf)); - -# if defined(TRIO_PLATFORM_UNIX) - signal_handler = signal(SIGFPE, SIG_IGN); -# endif - - my_pinf = DBL_MAX + DBL_MAX; - my_ninf = -my_pinf; - my_nan = my_pinf / my_pinf; + print_class("Nan", my_nan); + print_class("PInf", my_pinf); + print_class("NInf", my_ninf); + print_class("PZero", 0.0); + print_class("NZero", -0.0); + print_class("PNorm", 1.0); + print_class("NNorm", -1.0); + print_class("PSub", 1.01e-307 - 1.00e-307); + print_class("NSub", 1.00e-307 - 1.01e-307); -# if defined(TRIO_PLATFORM_UNIX) - signal(SIGFPE, signal_handler); -# endif - - printf("NaN : %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d, %2d)\n", - my_nan, - ((unsigned char *)&my_nan)[0], - ((unsigned char *)&my_nan)[1], - ((unsigned char *)&my_nan)[2], - ((unsigned char *)&my_nan)[3], - ((unsigned char *)&my_nan)[4], - ((unsigned char *)&my_nan)[5], - ((unsigned char *)&my_nan)[6], - ((unsigned char *)&my_nan)[7], - trio_isnan(my_nan), trio_isinf(my_nan), trio_isfinite(my_nan)); - printf("PInf: %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d, %2d)\n", - my_pinf, - ((unsigned char *)&my_pinf)[0], - ((unsigned char *)&my_pinf)[1], - ((unsigned char *)&my_pinf)[2], - ((unsigned char *)&my_pinf)[3], - ((unsigned char *)&my_pinf)[4], - ((unsigned char *)&my_pinf)[5], - ((unsigned char *)&my_pinf)[6], - ((unsigned char *)&my_pinf)[7], - trio_isnan(my_pinf), trio_isinf(my_pinf), trio_isfinite(my_pinf)); - printf("NInf: %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d, %2d)\n", - my_ninf, - ((unsigned char *)&my_ninf)[0], - ((unsigned char *)&my_ninf)[1], - ((unsigned char *)&my_ninf)[2], - ((unsigned char *)&my_ninf)[3], - ((unsigned char *)&my_ninf)[4], - ((unsigned char *)&my_ninf)[5], - ((unsigned char *)&my_ninf)[6], - ((unsigned char *)&my_ninf)[7], - trio_isnan(my_ninf), trio_isinf(my_ninf), trio_isfinite(my_ninf)); - - return 0; + printf("NaN : %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d, %2d)\n", my_nan, + ((unsigned char*)&my_nan)[0], ((unsigned char*)&my_nan)[1], ((unsigned char*)&my_nan)[2], + ((unsigned char*)&my_nan)[3], ((unsigned char*)&my_nan)[4], ((unsigned char*)&my_nan)[5], + ((unsigned char*)&my_nan)[6], ((unsigned char*)&my_nan)[7], trio_isnan(my_nan), + trio_isinf(my_nan), trio_isfinite(my_nan)); + printf("PInf: %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d, %2d)\n", my_pinf, + ((unsigned char*)&my_pinf)[0], ((unsigned char*)&my_pinf)[1], + ((unsigned char*)&my_pinf)[2], ((unsigned char*)&my_pinf)[3], + ((unsigned char*)&my_pinf)[4], ((unsigned char*)&my_pinf)[5], + ((unsigned char*)&my_pinf)[6], ((unsigned char*)&my_pinf)[7], trio_isnan(my_pinf), + trio_isinf(my_pinf), trio_isfinite(my_pinf)); + printf("NInf: %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d, %2d)\n", my_ninf, + ((unsigned char*)&my_ninf)[0], ((unsigned char*)&my_ninf)[1], + ((unsigned char*)&my_ninf)[2], ((unsigned char*)&my_ninf)[3], + ((unsigned char*)&my_ninf)[4], ((unsigned char*)&my_ninf)[5], + ((unsigned char*)&my_ninf)[6], ((unsigned char*)&my_ninf)[7], trio_isnan(my_ninf), + trio_isinf(my_ninf), trio_isfinite(my_ninf)); + +#if defined(TRIO_PLATFORM_UNIX) + signal_handler = signal(SIGFPE, SIG_IGN); +#endif + + my_pinf = DBL_MAX + DBL_MAX; + my_ninf = -my_pinf; + my_nan = my_pinf / my_pinf; + +#if defined(TRIO_PLATFORM_UNIX) + signal(SIGFPE, signal_handler); +#endif + + printf("NaN : %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d, %2d)\n", my_nan, + ((unsigned char*)&my_nan)[0], ((unsigned char*)&my_nan)[1], ((unsigned char*)&my_nan)[2], + ((unsigned char*)&my_nan)[3], ((unsigned char*)&my_nan)[4], ((unsigned char*)&my_nan)[5], + ((unsigned char*)&my_nan)[6], ((unsigned char*)&my_nan)[7], trio_isnan(my_nan), + trio_isinf(my_nan), trio_isfinite(my_nan)); + printf("PInf: %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d, %2d)\n", my_pinf, + ((unsigned char*)&my_pinf)[0], ((unsigned char*)&my_pinf)[1], + ((unsigned char*)&my_pinf)[2], ((unsigned char*)&my_pinf)[3], + ((unsigned char*)&my_pinf)[4], ((unsigned char*)&my_pinf)[5], + ((unsigned char*)&my_pinf)[6], ((unsigned char*)&my_pinf)[7], trio_isnan(my_pinf), + trio_isinf(my_pinf), trio_isfinite(my_pinf)); + printf("NInf: %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d, %2d)\n", my_ninf, + ((unsigned char*)&my_ninf)[0], ((unsigned char*)&my_ninf)[1], + ((unsigned char*)&my_ninf)[2], ((unsigned char*)&my_ninf)[3], + ((unsigned char*)&my_ninf)[4], ((unsigned char*)&my_ninf)[5], + ((unsigned char*)&my_ninf)[6], ((unsigned char*)&my_ninf)[7], trio_isnan(my_ninf), + trio_isinf(my_ninf), trio_isfinite(my_ninf)); + + return 0; } #endif diff --git a/winpr/libwinpr/utils/trio/trionan.h b/winpr/libwinpr/utils/trio/trionan.h index a38b1cc26..5546da342 100644 --- a/winpr/libwinpr/utils/trio/trionan.h +++ b/winpr/libwinpr/utils/trio/trionan.h @@ -21,73 +21,74 @@ #include "triodef.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif #if !defined(TRIO_PUBLIC_NAN) -# if !defined(TRIO_PUBLIC) -# define TRIO_PUBLIC -# endif -# define TRIO_PUBLIC_NAN TRIO_PUBLIC +#if !defined(TRIO_PUBLIC) +#define TRIO_PUBLIC +#endif +#define TRIO_PUBLIC_NAN TRIO_PUBLIC #endif - -enum { - TRIO_FP_INFINITE, - TRIO_FP_NAN, - TRIO_FP_NORMAL, - TRIO_FP_SUBNORMAL, - TRIO_FP_ZERO -}; -/************************************************************************* - * Dependencies - */ + enum + { + TRIO_FP_INFINITE, + TRIO_FP_NAN, + TRIO_FP_NORMAL, + TRIO_FP_SUBNORMAL, + TRIO_FP_ZERO + }; + + /************************************************************************* + * Dependencies + */ #if defined(TRIO_EMBED_NAN) -/* - * The application that trionan is embedded in must define which functions - * it uses. - * - * The following resolves internal dependencies. - */ - -# if defined(TRIO_FUNC_ISNAN) \ - || defined(TRIO_FUNC_ISINF) -# if !defined(TRIO_FUNC_FPCLASSIFY_AND_SIGNBIT) -# define TRIO_FUNC_FPCLASSIFY_AND_SIGNBIT -# endif -# endif + /* + * The application that trionan is embedded in must define which functions + * it uses. + * + * The following resolves internal dependencies. + */ -# if defined(TRIO_FUNC_NAN) -# if !defined(TRIO_FUNC_PINF) -# define TRIO_FUNC_PINF -# endif -# endif - -# if defined(TRIO_FUNC_NINF) -# if !defined(TRIO_FUNC_PINF) -# define TRIO_FUNC_PINF -# endif -# endif +#if defined(TRIO_FUNC_ISNAN) || defined(TRIO_FUNC_ISINF) +#if !defined(TRIO_FUNC_FPCLASSIFY_AND_SIGNBIT) +#define TRIO_FUNC_FPCLASSIFY_AND_SIGNBIT +#endif +#endif + +#if defined(TRIO_FUNC_NAN) +#if !defined(TRIO_FUNC_PINF) +#define TRIO_FUNC_PINF +#endif +#endif + +#if defined(TRIO_FUNC_NINF) +#if !defined(TRIO_FUNC_PINF) +#define TRIO_FUNC_PINF +#endif +#endif #else /* * When trionan is not embedded all all functions are defined. */ - -# define TRIO_FUNC_NAN -# define TRIO_FUNC_PINF -# define TRIO_FUNC_NINF -# define TRIO_FUNC_NZERO -# define TRIO_FUNC_ISNAN -# define TRIO_FUNC_ISINF -# define TRIO_FUNC_ISFINITE -# define TRIO_FUNC_SIGNBIT -# define TRIO_FUNC_FPCLASSIFY -# define TRIO_FUNC_FPCLASSIFY_AND_SIGNBIT - + +#define TRIO_FUNC_NAN +#define TRIO_FUNC_PINF +#define TRIO_FUNC_NINF +#define TRIO_FUNC_NZERO +#define TRIO_FUNC_ISNAN +#define TRIO_FUNC_ISINF +#define TRIO_FUNC_ISFINITE +#define TRIO_FUNC_SIGNBIT +#define TRIO_FUNC_FPCLASSIFY +#define TRIO_FUNC_FPCLASSIFY_AND_SIGNBIT + #endif /************************************************************************* @@ -98,45 +99,35 @@ enum { * Return NaN (Not-a-Number). */ #if defined(TRIO_FUNC_NAN) -TRIO_PUBLIC_NAN double -trio_nan -TRIO_PROTO((void)); + TRIO_PUBLIC_NAN double trio_nan TRIO_PROTO((void)); #endif /* * Return positive infinity. */ #if defined(TRIO_FUNC_PINF) -TRIO_PUBLIC_NAN double -trio_pinf -TRIO_PROTO((void)); + TRIO_PUBLIC_NAN double trio_pinf TRIO_PROTO((void)); #endif /* * Return negative infinity. */ #if defined(TRIO_FUNC_NINF) -TRIO_PUBLIC_NAN double -trio_ninf -TRIO_PROTO((void)); + TRIO_PUBLIC_NAN double trio_ninf TRIO_PROTO((void)); #endif /* * Return negative zero. */ #if defined(TRIO_FUNC_NZERO) -TRIO_PUBLIC_NAN double -trio_nzero -TRIO_PROTO((TRIO_NOARGS)); + TRIO_PUBLIC_NAN double trio_nzero TRIO_PROTO((TRIO_NOARGS)); #endif /* * If number is a NaN return non-zero, otherwise return zero. */ #if defined(TRIO_FUNC_ISNAN) -TRIO_PUBLIC_NAN int -trio_isnan -TRIO_PROTO((double number)); + TRIO_PUBLIC_NAN int trio_isnan TRIO_PROTO((double number)); #endif /* @@ -144,36 +135,26 @@ TRIO_PROTO((double number)); * infinity return -1, otherwise return 0. */ #if defined(TRIO_FUNC_ISINF) -TRIO_PUBLIC_NAN int -trio_isinf -TRIO_PROTO((double number)); + TRIO_PUBLIC_NAN int trio_isinf TRIO_PROTO((double number)); #endif /* * If number is finite return non-zero, otherwise return zero. */ #if defined(TRIO_FUNC_ISFINITE) -TRIO_PUBLIC_NAN int -trio_isfinite -TRIO_PROTO((double number)); + TRIO_PUBLIC_NAN int trio_isfinite TRIO_PROTO((double number)); #endif #if defined(TRIO_FUNC_SIGNBIT) -TRIO_PUBLIC_NAN int -trio_signbit -TRIO_PROTO((double number)); + TRIO_PUBLIC_NAN int trio_signbit TRIO_PROTO((double number)); #endif #if defined(TRIO_FUNC_FPCLASSIFY) -TRIO_PUBLIC_NAN int -trio_fpclassify -TRIO_PROTO((double number)); + TRIO_PUBLIC_NAN int trio_fpclassify TRIO_PROTO((double number)); #endif #if defined(TRIO_FUNC_FPCLASSIFY_AND_SIGNBIT) -TRIO_PUBLIC_NAN int -trio_fpclassify_and_signbit -TRIO_PROTO((double number, int *is_negative)); + TRIO_PUBLIC_NAN int trio_fpclassify_and_signbit TRIO_PROTO((double number, int* is_negative)); #endif #ifdef __cplusplus diff --git a/winpr/libwinpr/utils/trio/triop.h b/winpr/libwinpr/utils/trio/triop.h index 1db3e6829..9b0e5f90d 100644 --- a/winpr/libwinpr/utils/trio/triop.h +++ b/winpr/libwinpr/utils/trio/triop.h @@ -30,13 +30,14 @@ #include #if defined(TRIO_COMPILER_ANCIENT) -# include +#include #else -# include +#include #endif #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif /************************************************************************* @@ -52,7 +53,7 @@ extern "C" { * specifier documentation. */ #if !defined(TRIO_C99) -# define TRIO_C99 1 +#define TRIO_C99 1 #endif /* @@ -64,7 +65,7 @@ extern "C" { * specifier documentation. */ #if !defined(TRIO_BSD) -# define TRIO_BSD 1 +#define TRIO_BSD 1 #endif /* @@ -76,7 +77,7 @@ extern "C" { * specifier documentation. */ #if !defined(TRIO_GNU) -# define TRIO_GNU 1 +#define TRIO_GNU 1 #endif /* @@ -88,7 +89,7 @@ extern "C" { * format specifier documentation. */ #if !defined(TRIO_MISC) -# define TRIO_MISC 1 +#define TRIO_MISC 1 #endif /* @@ -100,9 +101,9 @@ extern "C" { * specifier documentation. */ #if !defined(TRIO_UNIX98) -# define TRIO_UNIX98 1 +#define TRIO_UNIX98 1 #endif - + /* * TRIO_MICROSOFT (=0 or =1) * @@ -112,7 +113,7 @@ extern "C" { * format specifier documentation. */ #if !defined(TRIO_MICROSOFT) -# define TRIO_MICROSOFT 1 +#define TRIO_MICROSOFT 1 #endif /* @@ -127,7 +128,7 @@ extern "C" { * the format specifier documentation. */ #if !defined(TRIO_EXTENSION) -# define TRIO_EXTENSION 1 +#define TRIO_EXTENSION 1 #endif /* @@ -137,27 +138,27 @@ extern "C" { * to 1 to enable them. */ #if !defined(TRIO_DEPRECATED) -# define TRIO_DEPRECATED 1 +#define TRIO_DEPRECATED 1 #endif -/************************************************************************* - * Features - */ + /************************************************************************* + * Features + */ #if defined(TRIO_SNPRINTF_ONLY) -# define TRIO_FEATURE_SCANF 0 -# define TRIO_FEATURE_FILE 0 -# define TRIO_FEATURE_STDIO 0 -# define TRIO_FEATURE_FD 0 -# define TRIO_FEATURE_DYNAMICSTRING 0 -# define TRIO_FEATURE_CLOSURE 0 -# define TRIO_FEATURE_ARGFUNC 0 -# define TRIO_FEATURE_STRERR 0 -# define TRIO_FEATURE_LOCALE 0 -# define TRIO_EMBED_NAN 1 -# define TRIO_EMBED_STRING 1 +#define TRIO_FEATURE_SCANF 0 +#define TRIO_FEATURE_FILE 0 +#define TRIO_FEATURE_STDIO 0 +#define TRIO_FEATURE_FD 0 +#define TRIO_FEATURE_DYNAMICSTRING 0 +#define TRIO_FEATURE_CLOSURE 0 +#define TRIO_FEATURE_ARGFUNC 0 +#define TRIO_FEATURE_STRERR 0 +#define TRIO_FEATURE_LOCALE 0 +#define TRIO_EMBED_NAN 1 +#define TRIO_EMBED_STRING 1 #endif - + /* * TRIO_FEATURE_SCANF (=0 or =1) * @@ -165,9 +166,9 @@ extern "C" { * to enable them. */ #if !defined(TRIO_FEATURE_SCANF) -# define TRIO_FEATURE_SCANF 1 +#define TRIO_FEATURE_SCANF 1 #endif - + /* * TRIO_FEATURE_FILE (=0 or =1) * @@ -180,7 +181,7 @@ extern "C" { * define TRIO_FEATURE_STDIO to 0. */ #if !defined(TRIO_FEATURE_FILE) -# define TRIO_FEATURE_FILE 1 +#define TRIO_FEATURE_FILE 1 #endif /* @@ -192,7 +193,7 @@ extern "C" { * This may be useful on an embedded platform with no standard I/O. */ #if !defined(TRIO_FEATURE_STDIO) -# define TRIO_FEATURE_STDIO 1 +#define TRIO_FEATURE_STDIO 1 #endif /* @@ -206,20 +207,20 @@ extern "C" { * descriptors. */ #if !defined(TRIO_FEATURE_FD) -# define TRIO_FEATURE_FD 1 +#define TRIO_FEATURE_FD 1 #endif /* * TRIO_FEATURE_DYNAMICSTRING (=0 or =1) * - * Define this to 0 to disable compilation of the trio_aprintf() + * Define this to 0 to disable compilation of the trio_aprintf() * family of functions, or define to 1 to enable them. * * If you define both this and TRIO_MINIMAL to 0, then Trio will never * call malloc or free. */ #if !defined(TRIO_FEATURE_DYNAMICSTRING) -# define TRIO_FEATURE_DYNAMICSTRING 1 +#define TRIO_FEATURE_DYNAMICSTRING 1 #endif /* @@ -231,7 +232,7 @@ extern "C" { * These functions are rarely needed. This saves a (small) amount of code. */ #if !defined(TRIO_FEATURE_CLOSURE) -# define TRIO_FEATURE_CLOSURE 1 +#define TRIO_FEATURE_CLOSURE 1 #endif /* @@ -250,11 +251,11 @@ extern "C" { * handling too (and so this forces TRIO_FEATURE_CLOSURE to enabled). */ #if !defined(TRIO_FEATURE_ARGFUNC) -# define TRIO_FEATURE_ARGFUNC 1 +#define TRIO_FEATURE_ARGFUNC 1 #endif #if TRIO_FEATURE_ARGFUNC -# undef TRIO_FEATURE_CLOSURE -# define TRIO_FEATURE_CLOSURE 1 +#undef TRIO_FEATURE_CLOSURE +#define TRIO_FEATURE_CLOSURE 1 #endif /* @@ -269,10 +270,10 @@ extern "C" { * TRIO_ERROR_CODE and TRIO_ERROR_POSITION macros. */ #if defined(TRIO_ERRORS) -# define TRIO_FEATURE_ERRORCODE TRIO_ERRORS +#define TRIO_FEATURE_ERRORCODE TRIO_ERRORS #endif #if !defined(TRIO_FEATURE_ERRORCODE) -# define TRIO_FEATURE_ERRORCODE 1 +#define TRIO_FEATURE_ERRORCODE 1 #endif /* @@ -284,7 +285,7 @@ extern "C" { * This saves a (small) amount of code. */ #if !defined(TRIO_FEATURE_STRERR) -# define TRIO_FEATURE_STRERR 1 +#define TRIO_FEATURE_STRERR 1 #endif /* @@ -300,7 +301,7 @@ extern "C" { * Do not compile trionan.c if you disable this. */ #if !defined(TRIO_FEATURE_FLOAT) -# define TRIO_FEATURE_FLOAT 1 +#define TRIO_FEATURE_FLOAT 1 #endif /* @@ -312,7 +313,7 @@ extern "C" { * This saves a (small) amount of code. */ #if !defined(TRIO_FEATURE_LOCALE) -# define TRIO_FEATURE_LOCALE 1 +#define TRIO_FEATURE_LOCALE 1 #endif /* @@ -323,171 +324,170 @@ extern "C" { * separately. */ #if defined(TRIO_MINIMAL) -# if !defined(TRIO_EMBED_NAN) -# define TRIO_EMBED_NAN -# endif -# if !defined(TRIO_EMBED_STRING) -# define TRIO_EMBED_STRING -# endif +#if !defined(TRIO_EMBED_NAN) +#define TRIO_EMBED_NAN #endif - +#if !defined(TRIO_EMBED_STRING) +#define TRIO_EMBED_STRING +#endif +#endif + /* Does not work yet. Do not enable */ #ifndef TRIO_FEATURE_WIDECHAR -# define TRIO_FEATURE_WIDECHAR 0 +#define TRIO_FEATURE_WIDECHAR 0 #endif -/************************************************************************* - * Mapping standards to internal features - */ + /************************************************************************* + * Mapping standards to internal features + */ #if !defined(TRIO_FEATURE_HEXFLOAT) -# define TRIO_FEATURE_HEXFLOAT (TRIO_C99 && TRIO_FEATURE_FLOAT) +#define TRIO_FEATURE_HEXFLOAT (TRIO_C99 && TRIO_FEATURE_FLOAT) #endif #if !defined(TRIO_FEATURE_LONGDOUBLE) -# define TRIO_FEATURE_LONGDOUBLE TRIO_FEATURE_FLOAT +#define TRIO_FEATURE_LONGDOUBLE TRIO_FEATURE_FLOAT #endif #if !defined(TRIO_FEATURE_ERRNO) -# define TRIO_FEATURE_ERRNO TRIO_GNU +#define TRIO_FEATURE_ERRNO TRIO_GNU #endif #if !defined(TRIO_FEATURE_QUAD) -# define TRIO_FEATURE_QUAD (TRIO_BSD || TRIO_GNU) +#define TRIO_FEATURE_QUAD (TRIO_BSD || TRIO_GNU) #endif #if !defined(TRIO_FEATURE_SIZE_T) -# define TRIO_FEATURE_SIZE_T TRIO_C99 +#define TRIO_FEATURE_SIZE_T TRIO_C99 #endif #if !defined(TRIO_FEATURE_SIZE_T_UPPER) -# define TRIO_FEATURE_SIZE_T_UPPER TRIO_GNU +#define TRIO_FEATURE_SIZE_T_UPPER TRIO_GNU #endif - + #if !defined(TRIO_FEATURE_PTRDIFF_T) -# define TRIO_FEATURE_PTRDIFF_T TRIO_C99 +#define TRIO_FEATURE_PTRDIFF_T TRIO_C99 #endif #if !defined(TRIO_FEATURE_INTMAX_T) -# define TRIO_FEATURE_INTMAX_T TRIO_C99 +#define TRIO_FEATURE_INTMAX_T TRIO_C99 #endif #if !defined(TRIO_FEATURE_FIXED_SIZE) -# define TRIO_FEATURE_FIXED_SIZE TRIO_MICROSOFT +#define TRIO_FEATURE_FIXED_SIZE TRIO_MICROSOFT #endif #if !defined(TRIO_FEATURE_POSITIONAL) -# define TRIO_FEATURE_POSITIONAL TRIO_UNIX98 +#define TRIO_FEATURE_POSITIONAL TRIO_UNIX98 #endif #if !defined(TRIO_FEATURE_USER_DEFINED) -# define TRIO_FEATURE_USER_DEFINED TRIO_EXTENSION +#define TRIO_FEATURE_USER_DEFINED TRIO_EXTENSION #endif #if !defined(TRIO_FEATURE_BINARY) -# define TRIO_FEATURE_BINARY TRIO_EXTENSION +#define TRIO_FEATURE_BINARY TRIO_EXTENSION #endif #if !defined(TRIO_FEATURE_QUOTE) -# define TRIO_FEATURE_QUOTE TRIO_EXTENSION +#define TRIO_FEATURE_QUOTE TRIO_EXTENSION #endif - + #if !defined(TRIO_FEATURE_STICKY) -# define TRIO_FEATURE_STICKY TRIO_EXTENSION +#define TRIO_FEATURE_STICKY TRIO_EXTENSION #endif - + #if !defined(TRIO_FEATURE_VARSIZE) -# define TRIO_FEATURE_VARSIZE TRIO_EXTENSION +#define TRIO_FEATURE_VARSIZE TRIO_EXTENSION #endif #if !defined(TRIO_FEATURE_ROUNDING) -# define TRIO_FEATURE_ROUNDING TRIO_EXTENSION +#define TRIO_FEATURE_ROUNDING TRIO_EXTENSION #endif - + /************************************************************************* * Memory handling */ #ifndef TRIO_MALLOC -# define TRIO_MALLOC(n) malloc(n) +#define TRIO_MALLOC(n) malloc(n) #endif #ifndef TRIO_REALLOC -# define TRIO_REALLOC(x,n) realloc((x),(n)) +#define TRIO_REALLOC(x, n) realloc((x), (n)) #endif #ifndef TRIO_FREE -# define TRIO_FREE(x) free(x) +#define TRIO_FREE(x) free(x) #endif + /************************************************************************* + * User-defined specifiers + */ -/************************************************************************* - * User-defined specifiers - */ + typedef int(*trio_callback_t) TRIO_PROTO((trio_pointer_t)); -typedef int (*trio_callback_t) TRIO_PROTO((trio_pointer_t)); + trio_pointer_t trio_register TRIO_PROTO((trio_callback_t callback, const char* name)); + void trio_unregister TRIO_PROTO((trio_pointer_t handle)); -trio_pointer_t trio_register TRIO_PROTO((trio_callback_t callback, const char *name)); -void trio_unregister TRIO_PROTO((trio_pointer_t handle)); + TRIO_CONST char* trio_get_format TRIO_PROTO((trio_pointer_t ref)); + trio_pointer_t trio_get_argument TRIO_PROTO((trio_pointer_t ref)); -TRIO_CONST char *trio_get_format TRIO_PROTO((trio_pointer_t ref)); -trio_pointer_t trio_get_argument TRIO_PROTO((trio_pointer_t ref)); - -/* Modifiers */ -int trio_get_width TRIO_PROTO((trio_pointer_t ref)); -void trio_set_width TRIO_PROTO((trio_pointer_t ref, int width)); -int trio_get_precision TRIO_PROTO((trio_pointer_t ref)); -void trio_set_precision TRIO_PROTO((trio_pointer_t ref, int precision)); -int trio_get_base TRIO_PROTO((trio_pointer_t ref)); -void trio_set_base TRIO_PROTO((trio_pointer_t ref, int base)); -int trio_get_padding TRIO_PROTO((trio_pointer_t ref)); -void trio_set_padding TRIO_PROTO((trio_pointer_t ref, int is_padding)); -int trio_get_short TRIO_PROTO((trio_pointer_t ref)); /* h */ -void trio_set_shortshort TRIO_PROTO((trio_pointer_t ref, int is_shortshort)); -int trio_get_shortshort TRIO_PROTO((trio_pointer_t ref)); /* hh */ -void trio_set_short TRIO_PROTO((trio_pointer_t ref, int is_short)); -int trio_get_long TRIO_PROTO((trio_pointer_t ref)); /* l */ -void trio_set_long TRIO_PROTO((trio_pointer_t ref, int is_long)); -int trio_get_longlong TRIO_PROTO((trio_pointer_t ref)); /* ll */ -void trio_set_longlong TRIO_PROTO((trio_pointer_t ref, int is_longlong)); -int trio_get_longdouble TRIO_PROTO((trio_pointer_t ref)); /* L */ -void trio_set_longdouble TRIO_PROTO((trio_pointer_t ref, int is_longdouble)); -int trio_get_alternative TRIO_PROTO((trio_pointer_t ref)); /* # */ -void trio_set_alternative TRIO_PROTO((trio_pointer_t ref, int is_alternative)); -int trio_get_alignment TRIO_PROTO((trio_pointer_t ref)); /* - */ -void trio_set_alignment TRIO_PROTO((trio_pointer_t ref, int is_leftaligned)); -int trio_get_spacing TRIO_PROTO((trio_pointer_t ref)); /* (space) */ -void trio_set_spacing TRIO_PROTO((trio_pointer_t ref, int is_space)); -int trio_get_sign TRIO_PROTO((trio_pointer_t ref)); /* + */ -void trio_set_sign TRIO_PROTO((trio_pointer_t ref, int is_showsign)); + /* Modifiers */ + int trio_get_width TRIO_PROTO((trio_pointer_t ref)); + void trio_set_width TRIO_PROTO((trio_pointer_t ref, int width)); + int trio_get_precision TRIO_PROTO((trio_pointer_t ref)); + void trio_set_precision TRIO_PROTO((trio_pointer_t ref, int precision)); + int trio_get_base TRIO_PROTO((trio_pointer_t ref)); + void trio_set_base TRIO_PROTO((trio_pointer_t ref, int base)); + int trio_get_padding TRIO_PROTO((trio_pointer_t ref)); + void trio_set_padding TRIO_PROTO((trio_pointer_t ref, int is_padding)); + int trio_get_short TRIO_PROTO((trio_pointer_t ref)); /* h */ + void trio_set_shortshort TRIO_PROTO((trio_pointer_t ref, int is_shortshort)); + int trio_get_shortshort TRIO_PROTO((trio_pointer_t ref)); /* hh */ + void trio_set_short TRIO_PROTO((trio_pointer_t ref, int is_short)); + int trio_get_long TRIO_PROTO((trio_pointer_t ref)); /* l */ + void trio_set_long TRIO_PROTO((trio_pointer_t ref, int is_long)); + int trio_get_longlong TRIO_PROTO((trio_pointer_t ref)); /* ll */ + void trio_set_longlong TRIO_PROTO((trio_pointer_t ref, int is_longlong)); + int trio_get_longdouble TRIO_PROTO((trio_pointer_t ref)); /* L */ + void trio_set_longdouble TRIO_PROTO((trio_pointer_t ref, int is_longdouble)); + int trio_get_alternative TRIO_PROTO((trio_pointer_t ref)); /* # */ + void trio_set_alternative TRIO_PROTO((trio_pointer_t ref, int is_alternative)); + int trio_get_alignment TRIO_PROTO((trio_pointer_t ref)); /* - */ + void trio_set_alignment TRIO_PROTO((trio_pointer_t ref, int is_leftaligned)); + int trio_get_spacing TRIO_PROTO((trio_pointer_t ref)); /* (space) */ + void trio_set_spacing TRIO_PROTO((trio_pointer_t ref, int is_space)); + int trio_get_sign TRIO_PROTO((trio_pointer_t ref)); /* + */ + void trio_set_sign TRIO_PROTO((trio_pointer_t ref, int is_showsign)); #if TRIO_FEATURE_QUOTE -int trio_get_quote TRIO_PROTO((trio_pointer_t ref)); /* ' */ -void trio_set_quote TRIO_PROTO((trio_pointer_t ref, int is_quote)); + int trio_get_quote TRIO_PROTO((trio_pointer_t ref)); /* ' */ + void trio_set_quote TRIO_PROTO((trio_pointer_t ref, int is_quote)); #endif -int trio_get_upper TRIO_PROTO((trio_pointer_t ref)); -void trio_set_upper TRIO_PROTO((trio_pointer_t ref, int is_upper)); + int trio_get_upper TRIO_PROTO((trio_pointer_t ref)); + void trio_set_upper TRIO_PROTO((trio_pointer_t ref, int is_upper)); #if TRIO_FEATURE_INTMAX_T -int trio_get_largest TRIO_PROTO((trio_pointer_t ref)); /* j */ -void trio_set_largest TRIO_PROTO((trio_pointer_t ref, int is_largest)); + int trio_get_largest TRIO_PROTO((trio_pointer_t ref)); /* j */ + void trio_set_largest TRIO_PROTO((trio_pointer_t ref, int is_largest)); #endif #if TRIO_FEATURE_PTRDIFF_T -int trio_get_ptrdiff TRIO_PROTO((trio_pointer_t ref)); /* t */ -void trio_set_ptrdiff TRIO_PROTO((trio_pointer_t ref, int is_ptrdiff)); + int trio_get_ptrdiff TRIO_PROTO((trio_pointer_t ref)); /* t */ + void trio_set_ptrdiff TRIO_PROTO((trio_pointer_t ref, int is_ptrdiff)); #endif #if TRIO_FEATURE_SIZE_T -int trio_get_size TRIO_PROTO((trio_pointer_t ref)); /* z / Z */ -void trio_set_size TRIO_PROTO((trio_pointer_t ref, int is_size)); + int trio_get_size TRIO_PROTO((trio_pointer_t ref)); /* z / Z */ + void trio_set_size TRIO_PROTO((trio_pointer_t ref, int is_size)); #endif -/* Printing */ -int trio_print_ref TRIO_PROTO((trio_pointer_t ref, const char *format, ...)); -int trio_vprint_ref TRIO_PROTO((trio_pointer_t ref, const char *format, va_list args)); -int trio_printv_ref TRIO_PROTO((trio_pointer_t ref, const char *format, trio_pointer_t *args)); + /* Printing */ + int trio_print_ref TRIO_PROTO((trio_pointer_t ref, const char* format, ...)); + int trio_vprint_ref TRIO_PROTO((trio_pointer_t ref, const char* format, va_list args)); + int trio_printv_ref TRIO_PROTO((trio_pointer_t ref, const char* format, trio_pointer_t* args)); -void trio_print_int TRIO_PROTO((trio_pointer_t ref, int number)); -void trio_print_uint TRIO_PROTO((trio_pointer_t ref, unsigned int number)); -/* void trio_print_long TRIO_PROTO((trio_pointer_t ref, long number)); */ -/* void trio_print_ulong TRIO_PROTO((trio_pointer_t ref, unsigned long number)); */ -void trio_print_double TRIO_PROTO((trio_pointer_t ref, double number)); -void trio_print_string TRIO_PROTO((trio_pointer_t ref, TRIO_CONST char *string)); -void trio_print_pointer TRIO_PROTO((trio_pointer_t ref, trio_pointer_t pointer)); + void trio_print_int TRIO_PROTO((trio_pointer_t ref, int number)); + void trio_print_uint TRIO_PROTO((trio_pointer_t ref, unsigned int number)); + /* void trio_print_long TRIO_PROTO((trio_pointer_t ref, long number)); */ + /* void trio_print_ulong TRIO_PROTO((trio_pointer_t ref, unsigned long number)); */ + void trio_print_double TRIO_PROTO((trio_pointer_t ref, double number)); + void trio_print_string TRIO_PROTO((trio_pointer_t ref, TRIO_CONST char* string)); + void trio_print_pointer TRIO_PROTO((trio_pointer_t ref, trio_pointer_t pointer)); #ifdef __cplusplus } /* extern "C" */ diff --git a/winpr/libwinpr/utils/trio/triostr.c b/winpr/libwinpr/utils/trio/triostr.c index 4425bcd21..da12775ac 100644 --- a/winpr/libwinpr/utils/trio/triostr.c +++ b/winpr/libwinpr/utils/trio/triostr.c @@ -20,7 +20,7 @@ */ #if defined(HAVE_CONFIG_H) -# include +#include #endif #include #include @@ -29,10 +29,10 @@ #include "triodef.h" #include "triostr.h" #if defined(TRIO_FUNC_TO_LONG_DOUBLE) -# define USE_MATH +#define USE_MATH #endif #if defined(USE_MATH) -# include +#include #endif /************************************************************************* @@ -40,108 +40,104 @@ */ #if !defined(TRIO_PUBLIC_STRING) -# define TRIO_PUBLIC_STRING TRIO_PUBLIC +#define TRIO_PUBLIC_STRING TRIO_PUBLIC #endif #if !defined(TRIO_PRIVATE_STRING) -# define TRIO_PRIVATE_STRING TRIO_PRIVATE +#define TRIO_PRIVATE_STRING TRIO_PRIVATE #endif #if !defined(NULL) -# define NULL 0 +#define NULL 0 #endif #if !defined(NIL) -# define NIL ((char)0) +#define NIL ((char)0) #endif #if !defined(FALSE) -# define FALSE (1 == 0) -# define TRUE (! FALSE) +#define FALSE (1 == 0) +#define TRUE (!FALSE) #endif #if !defined(BOOLEAN_T) -# define BOOLEAN_T int +#define BOOLEAN_T int #endif #if defined(USE_MATH) -# if defined(PREDEF_STANDARD_C99) -# if defined(TRIO_COMPILER_DECC) -# if (TRIO_COMPILER_DECC - 0 > 80000000) +#if defined(PREDEF_STANDARD_C99) +#if defined(TRIO_COMPILER_DECC) +#if (TRIO_COMPILER_DECC - 0 > 80000000) /* * The OSF/1 runtime that comes with the DECC compiler does not support * hexfloats conversion. */ -# define USE_STRTOD -# define USE_STRTOF -# endif -# else -# define USE_STRTOD -# define USE_STRTOF -# endif -# else -# if defined(TRIO_COMPILER_VISUALC) -# define USE_STRTOD -# endif +#define USE_STRTOD +#define USE_STRTOF +#endif +#else +#define USE_STRTOD +#define USE_STRTOF +#endif +#else +#if defined(TRIO_COMPILER_VISUALC) +#define USE_STRTOD +#endif #endif #endif #if defined(TRIO_PLATFORM_UNIX) -# if defined(PREDEF_STANDARD_UNIX95) -# define USE_STRCASECMP -# define USE_STRNCASECMP -# endif -# if defined(TRIO_PLATFORM_SUNOS) -# define USE_SYS_ERRLIST -# else -# define USE_STRERROR -# endif -# if defined(TRIO_PLATFORM_QNX) -# define strcasecmp(x,y) stricmp(x,y) -# define strncasecmp(x,y,n) strnicmp(x,y,n) -# endif +#if defined(PREDEF_STANDARD_UNIX95) +#define USE_STRCASECMP +#define USE_STRNCASECMP +#endif +#if defined(TRIO_PLATFORM_SUNOS) +#define USE_SYS_ERRLIST +#else +#define USE_STRERROR +#endif +#if defined(TRIO_PLATFORM_QNX) +#define strcasecmp(x, y) stricmp(x, y) +#define strncasecmp(x, y, n) strnicmp(x, y, n) +#endif #endif #if defined(TRIO_PLATFORM_WIN32) -# define USE_STRCASECMP -# if defined(TRIO_PLATFORM_WINCE) -# define strcasecmp(x,y) _stricmp(x,y) -# else -# define strcasecmp(x,y) _stricmp(x,y) -# endif +#define USE_STRCASECMP +#if defined(TRIO_PLATFORM_WINCE) +#define strcasecmp(x, y) _stricmp(x, y) +#else +#define strcasecmp(x, y) _stricmp(x, y) +#endif #endif #if !defined(HAVE_CONFIG_H) -# if !(defined(TRIO_PLATFORM_SUNOS)) -# define HAVE_TOLOWER -# define HAVE_TOUPPER -# endif +#if !(defined(TRIO_PLATFORM_SUNOS)) +#define HAVE_TOLOWER +#define HAVE_TOUPPER +#endif #endif #if defined(USE_MATH) && !defined(TRIO_NO_POWL) -# if !defined(HAVE_POWL) -# if defined(PREDEF_STANDARD_C99) \ - || defined(PREDEF_STANDARD_UNIX03) -# define HAVE_POWL -# else -# if defined(TRIO_COMPILER_VISUALC) -# if defined(powl) -# define HAVE_POWL -# endif -# endif -# endif -# endif +#if !defined(HAVE_POWL) +#if defined(PREDEF_STANDARD_C99) || defined(PREDEF_STANDARD_UNIX03) +#define HAVE_POWL +#else +#if defined(TRIO_COMPILER_VISUALC) +#if defined(powl) +#define HAVE_POWL +#endif +#endif +#endif +#endif #endif #if defined(HAVE_POWL) -# define trio_powl(x,y) powl((x),(y)) +#define trio_powl(x, y) powl((x), (y)) #else -# define trio_powl(x,y) pow((double)(x),(double)(y)) +#define trio_powl(x, y) pow((double)(x), (double)(y)) #endif -#if defined(TRIO_FUNC_TO_UPPER) \ - || (defined(TRIO_FUNC_EQUAL) && !defined(USE_STRCASECMP)) \ - || (defined(TRIO_FUNC_EQUAL_MAX) && !defined(USE_STRNCASECMP)) \ - || defined(TRIO_FUNC_MATCH) \ - || defined(TRIO_FUNC_TO_LONG_DOUBLE) \ - || defined(TRIO_FUNC_UPPER) -# define TRIO_FUNC_INTERNAL_TO_UPPER +#if defined(TRIO_FUNC_TO_UPPER) || (defined(TRIO_FUNC_EQUAL) && !defined(USE_STRCASECMP)) || \ + (defined(TRIO_FUNC_EQUAL_MAX) && !defined(USE_STRNCASECMP)) || defined(TRIO_FUNC_MATCH) || \ + defined(TRIO_FUNC_TO_LONG_DOUBLE) || defined(TRIO_FUNC_UPPER) +#define TRIO_FUNC_INTERNAL_TO_UPPER #endif /************************************************************************* @@ -150,9 +146,9 @@ struct _trio_string_t { - char *content; - size_t length; - size_t allocated; + char* content; + size_t length; + size_t allocated; }; /************************************************************************* @@ -169,7 +165,7 @@ struct _trio_string_t */ #if defined(TRIO_DOCUMENTATION) -# include "doc/doc_static.h" +#include "doc/doc_static.h" #endif /** @addtogroup StaticStrings @{ @@ -178,29 +174,24 @@ struct _trio_string_t /* * internal_duplicate_max */ -#if defined(TRIO_FUNC_DUPLICATE) \ - || defined(TRIO_FUNC_DUPLICATE_MAX) \ - || defined(TRIO_FUNC_STRING_DUPLICATE) \ - || defined(TRIO_FUNC_XSTRING_DUPLICATE) +#if defined(TRIO_FUNC_DUPLICATE) || defined(TRIO_FUNC_DUPLICATE_MAX) || \ + defined(TRIO_FUNC_STRING_DUPLICATE) || defined(TRIO_FUNC_XSTRING_DUPLICATE) -TRIO_PRIVATE_STRING char * -internal_duplicate_max -TRIO_ARGS2((source, size), - TRIO_CONST char *source, - size_t size) +TRIO_PRIVATE_STRING char* internal_duplicate_max TRIO_ARGS2((source, size), TRIO_CONST char* source, + size_t size) { - char *target; + char* target; - assert(source); + assert(source); - /* Make room for string plus a terminating zero */ - size++; - target = trio_create(size); - if (target) - { - trio_copy_max(target, size, source); - } - return target; + /* Make room for string plus a terminating zero */ + size++; + target = trio_create(size); + if (target) + { + trio_copy_max(target, size, source); + } + return target; } #endif @@ -208,23 +199,21 @@ TRIO_ARGS2((source, size), /* * internal_string_alloc */ -#if defined(TRIO_FUNC_STRING_CREATE) \ - || defined(TRIO_FUNC_STRING_DUPLICATE) \ - || defined(TRIO_FUNC_XSTRING_DUPLICATE) +#if defined(TRIO_FUNC_STRING_CREATE) || defined(TRIO_FUNC_STRING_DUPLICATE) || \ + defined(TRIO_FUNC_XSTRING_DUPLICATE) -TRIO_PRIVATE_STRING trio_string_t * -internal_string_alloc(TRIO_NOARGS) +TRIO_PRIVATE_STRING trio_string_t* internal_string_alloc(TRIO_NOARGS) { - trio_string_t *self; - - self = (trio_string_t *)TRIO_MALLOC(sizeof(trio_string_t)); - if (self) - { - self->content = NULL; - self->length = 0; - self->allocated = 0; - } - return self; + trio_string_t* self; + + self = (trio_string_t*)TRIO_MALLOC(sizeof(trio_string_t)); + if (self) + { + self->content = NULL; + self->length = 0; + self->allocated = 0; + } + return self; } #endif @@ -235,33 +224,27 @@ internal_string_alloc(TRIO_NOARGS) * The size of the string will be increased by 'delta' characters. If * 'delta' is zero, the size will be doubled. */ -#if defined(TRIO_FUNC_STRING_CREATE) \ - || defined(TRIO_FUNC_STRING_APPEND) \ - || defined(TRIO_FUNC_XSTRING_APPEND) \ - || defined(TRIO_FUNC_XSTRING_APPEND_CHAR) +#if defined(TRIO_FUNC_STRING_CREATE) || defined(TRIO_FUNC_STRING_APPEND) || \ + defined(TRIO_FUNC_XSTRING_APPEND) || defined(TRIO_FUNC_XSTRING_APPEND_CHAR) -TRIO_PRIVATE_STRING BOOLEAN_T -internal_string_grow -TRIO_ARGS2((self, delta), - trio_string_t *self, - size_t delta) +TRIO_PRIVATE_STRING BOOLEAN_T internal_string_grow TRIO_ARGS2((self, delta), trio_string_t* self, + size_t delta) { - BOOLEAN_T status = FALSE; - char *new_content; - size_t new_size; + BOOLEAN_T status = FALSE; + char* new_content; + size_t new_size; - new_size = (delta == 0) - ? ( (self->allocated == 0) ? 1 : self->allocated * 2 ) - : self->allocated + delta; - - new_content = (char *)TRIO_REALLOC(self->content, new_size); - if (new_content) - { - self->content = new_content; - self->allocated = new_size; - status = TRUE; - } - return status; + new_size = + (delta == 0) ? ((self->allocated == 0) ? 1 : self->allocated * 2) : self->allocated + delta; + + new_content = (char*)TRIO_REALLOC(self->content, new_size); + if (new_content) + { + self->content = new_content; + self->allocated = new_size; + status = TRUE; + } + return status; } #endif @@ -273,48 +256,36 @@ TRIO_ARGS2((self, delta), * If 'length' is less than the original size, the original size will be * used (that is, the size of the string is never decreased). */ -#if defined(TRIO_FUNC_STRING_APPEND) \ - || defined(TRIO_FUNC_XSTRING_APPEND) \ - || defined(TRIO_FUNC_XSTRING_APPEND_MAX) +#if defined(TRIO_FUNC_STRING_APPEND) || defined(TRIO_FUNC_XSTRING_APPEND) || \ + defined(TRIO_FUNC_XSTRING_APPEND_MAX) -TRIO_PRIVATE_STRING BOOLEAN_T -internal_string_grow_to -TRIO_ARGS2((self, length), - trio_string_t *self, - size_t length) +TRIO_PRIVATE_STRING BOOLEAN_T internal_string_grow_to TRIO_ARGS2((self, length), + trio_string_t* self, size_t length) { - length++; /* Room for terminating zero */ - return (self->allocated < length) - ? internal_string_grow(self, length - self->allocated) - : TRUE; + length++; /* Room for terminating zero */ + return (self->allocated < length) ? internal_string_grow(self, length - self->allocated) : TRUE; } #endif #if defined(TRIO_FUNC_INTERNAL_TO_UPPER) -TRIO_PRIVATE_STRING TRIO_INLINE int -internal_to_upper -TRIO_ARGS1((source), - int source) +TRIO_PRIVATE_STRING TRIO_INLINE int internal_to_upper TRIO_ARGS1((source), int source) { -# if defined(HAVE_TOUPPER) - - return toupper(source); - -# else +#if defined(HAVE_TOUPPER) - /* Does not handle locales or non-contiguous alphabetic characters */ - return ((source >= (int)'a') && (source <= (int)'z')) - ? source - 'a' + 'A' - : source; - -# endif + return toupper(source); + +#else + + /* Does not handle locales or non-contiguous alphabetic characters */ + return ((source >= (int)'a') && (source <= (int)'z')) ? source - 'a' + 'A' : source; + +#endif } #endif - /** Create new string. @@ -323,12 +294,9 @@ TRIO_ARGS1((source), */ #if defined(TRIO_FUNC_CREATE) -TRIO_PUBLIC_STRING char * -trio_create -TRIO_ARGS1((size), - size_t size) +TRIO_PUBLIC_STRING char* trio_create TRIO_ARGS1((size), size_t size) { - return (char *)TRIO_MALLOC(size); + return (char*)TRIO_MALLOC(size); } #endif @@ -340,15 +308,12 @@ TRIO_ARGS1((size), */ #if defined(TRIO_FUNC_DESTROY) -TRIO_PUBLIC_STRING void -trio_destroy -TRIO_ARGS1((string), - char *string) +TRIO_PUBLIC_STRING void trio_destroy TRIO_ARGS1((string), char* string) { - if (string) - { - TRIO_FREE(string); - } + if (string) + { + TRIO_FREE(string); + } } #endif @@ -361,12 +326,9 @@ TRIO_ARGS1((string), */ #if defined(TRIO_FUNC_LENGTH) -TRIO_PUBLIC_STRING size_t -trio_length -TRIO_ARGS1((string), - TRIO_CONST char *string) +TRIO_PUBLIC_STRING size_t trio_length TRIO_ARGS1((string), TRIO_CONST char* string) { - return strlen(string); + return strlen(string); } #endif @@ -380,31 +342,28 @@ TRIO_ARGS1((string), */ #if defined(TRIO_FUNC_LENGTH_MAX) -TRIO_PUBLIC_STRING size_t -trio_length_max -TRIO_ARGS2((string, max), - TRIO_CONST char *string, - size_t max) +TRIO_PUBLIC_STRING size_t trio_length_max TRIO_ARGS2((string, max), TRIO_CONST char* string, + size_t max) { - size_t i; + size_t i; - for (i = 0; i < max; ++i) - { - if (string[i] == 0) - break; - } - return i; + for (i = 0; i < max; ++i) + { + if (string[i] == 0) + break; + } + return i; } #endif /** Append @p source at the end of @p target. - + @param target Target string. @param source Source string. @return Boolean value indicating success or failure. - + @pre @p target must point to a memory chunk with sufficient room to contain the @p target string and @p source string. @pre No boundary checking is performed, so insufficient memory will @@ -413,28 +372,25 @@ TRIO_ARGS2((string, max), */ #if defined(TRIO_FUNC_APPEND) -TRIO_PUBLIC_STRING int -trio_append -TRIO_ARGS2((target, source), - char *target, - TRIO_CONST char *source) +TRIO_PUBLIC_STRING int trio_append TRIO_ARGS2((target, source), char* target, + TRIO_CONST char* source) { - assert(target); - assert(source); - - return (strcat(target, source) != NULL); + assert(target); + assert(source); + + return (strcat(target, source) != NULL); } #endif /** Append at most @p max characters from @p source to @p target. - + @param target Target string. @param max Maximum number of characters to append. @param source Source string. @return Boolean value indicating success or failure. - + @pre @p target must point to a memory chuck with sufficient room to contain the @p target string and the @p source string (at most @p max characters). @@ -444,25 +400,21 @@ TRIO_ARGS2((target, source), */ #if defined(TRIO_FUNC_APPEND_MAX) -TRIO_PUBLIC_STRING int -trio_append_max -TRIO_ARGS3((target, max, source), - char *target, - size_t max, - TRIO_CONST char *source) +TRIO_PUBLIC_STRING int trio_append_max TRIO_ARGS3((target, max, source), char* target, size_t max, + TRIO_CONST char* source) { - size_t length; - - assert(target); - assert(source); + size_t length; - length = trio_length(target); - - if (max > length) - { - strncat(target, source, max - length - 1); - } - return TRUE; + assert(target); + assert(source); + + length = trio_length(target); + + if (max > length) + { + strncat(target, source, max - length - 1); + } + return TRUE; } #endif @@ -476,27 +428,24 @@ TRIO_ARGS3((target, max, source), */ #if defined(TRIO_FUNC_CONTAINS) -TRIO_PUBLIC_STRING int -trio_contains -TRIO_ARGS2((string, substring), - TRIO_CONST char *string, - TRIO_CONST char *substring) +TRIO_PUBLIC_STRING int trio_contains TRIO_ARGS2((string, substring), TRIO_CONST char* string, + TRIO_CONST char* substring) { - assert(string); - assert(substring); - - return (0 != strstr(string, substring)); + assert(string); + assert(substring); + + return (0 != strstr(string, substring)); } #endif /** Copy @p source to @p target. - + @param target Target string. @param source Source string. @return Boolean value indicating success or failure. - + @pre @p target must point to a memory chunk with sufficient room to contain the @p source string. @pre No boundary checking is performed, so insufficient memory will @@ -505,24 +454,20 @@ TRIO_ARGS2((string, substring), */ #if defined(TRIO_FUNC_COPY) -TRIO_PUBLIC_STRING int -trio_copy -TRIO_ARGS2((target, source), - char *target, - TRIO_CONST char *source) +TRIO_PUBLIC_STRING int trio_copy TRIO_ARGS2((target, source), char* target, TRIO_CONST char* source) { - assert(target); - assert(source); - - (void)strcpy(target, source); - return TRUE; + assert(target); + assert(source); + + (void)strcpy(target, source); + return TRUE; } #endif /** Copy at most @p max - 1 characters from @p source to @p target. - + @param target Target string. @param max Maximum number of characters to append (one of which is a NUL terminator). In other words @p source must point to at least @@ -530,7 +475,7 @@ TRIO_ARGS2((target, source), bytes. @param source Source string. @return Boolean value indicating success or failure. - + @pre @p target must point to a memory chunk with sufficient room to contain the @p source string and a NUL terminator (at most @p max bytes total). @@ -540,181 +485,161 @@ TRIO_ARGS2((target, source), */ #if defined(TRIO_FUNC_COPY_MAX) -TRIO_PUBLIC_STRING int -trio_copy_max -TRIO_ARGS3((target, max, source), - char *target, - size_t max, - TRIO_CONST char *source) +TRIO_PUBLIC_STRING int trio_copy_max TRIO_ARGS3((target, max, source), char* target, size_t max, + TRIO_CONST char* source) { - assert(target); - assert(source); - assert(max > 0); /* Includes != 0 */ + assert(target); + assert(source); + assert(max > 0); /* Includes != 0 */ - (void)strncpy(target, source, max - 1); - target[max - 1] = (char)0; - return TRUE; + (void)strncpy(target, source, max - 1); + target[max - 1] = (char)0; + return TRUE; } #endif /** Duplicate @p source. - + @param source Source string. @return A copy of the @p source string. - + @post @p target will be zero terminated. */ #if defined(TRIO_FUNC_DUPLICATE) -TRIO_PUBLIC_STRING char * -trio_duplicate -TRIO_ARGS1((source), - TRIO_CONST char *source) +TRIO_PUBLIC_STRING char* trio_duplicate TRIO_ARGS1((source), TRIO_CONST char* source) { - return internal_duplicate_max(source, trio_length(source)); + return internal_duplicate_max(source, trio_length(source)); } #endif /** Duplicate at most @p max characters of @p source. - + @param source Source string. @param max Maximum number of characters to duplicate. @return A copy of the @p source string. - + @post @p target will be zero terminated. */ #if defined(TRIO_FUNC_DUPLICATE_MAX) -TRIO_PUBLIC_STRING char * -trio_duplicate_max -TRIO_ARGS2((source, max), - TRIO_CONST char *source, - size_t max) +TRIO_PUBLIC_STRING char* trio_duplicate_max TRIO_ARGS2((source, max), TRIO_CONST char* source, + size_t max) { - size_t length; + size_t length; - assert(source); - assert(max > 0); + assert(source); + assert(max > 0); - length = trio_length(source); - if (length > max) - { - length = max; - } - return internal_duplicate_max(source, length); + length = trio_length(source); + if (length > max) + { + length = max; + } + return internal_duplicate_max(source, length); } #endif /** Compare if two strings are equal. - + @param first First string. @param second Second string. @return Boolean indicating whether the two strings are equal or not. - + Case-insensitive comparison. */ #if defined(TRIO_FUNC_EQUAL) -TRIO_PUBLIC_STRING int -trio_equal -TRIO_ARGS2((first, second), - TRIO_CONST char *first, - TRIO_CONST char *second) +TRIO_PUBLIC_STRING int trio_equal TRIO_ARGS2((first, second), TRIO_CONST char* first, + TRIO_CONST char* second) { - assert(first); - assert(second); + assert(first); + assert(second); - if ((first != NULL) && (second != NULL)) - { -# if defined(USE_STRCASECMP) - return (0 == strcasecmp(first, second)); -# else - while ((*first != NIL) && (*second != NIL)) + if ((first != NULL) && (second != NULL)) { - if (internal_to_upper(*first) != internal_to_upper(*second)) - { - break; - } - first++; - second++; +#if defined(USE_STRCASECMP) + return (0 == strcasecmp(first, second)); +#else + while ((*first != NIL) && (*second != NIL)) + { + if (internal_to_upper(*first) != internal_to_upper(*second)) + { + break; + } + first++; + second++; + } + return ((*first == NIL) && (*second == NIL)); +#endif } - return ((*first == NIL) && (*second == NIL)); -# endif - } - return FALSE; + return FALSE; } #endif /** Compare if two strings are equal. - + @param first First string. @param second Second string. @return Boolean indicating whether the two strings are equal or not. - + Case-sensitive comparison. */ #if defined(TRIO_FUNC_EQUAL_CASE) -TRIO_PUBLIC_STRING int -trio_equal_case -TRIO_ARGS2((first, second), - TRIO_CONST char *first, - TRIO_CONST char *second) +TRIO_PUBLIC_STRING int trio_equal_case TRIO_ARGS2((first, second), TRIO_CONST char* first, + TRIO_CONST char* second) { - assert(first); - assert(second); + assert(first); + assert(second); - if ((first != NULL) && (second != NULL)) - { - return (0 == strcmp(first, second)); - } - return FALSE; + if ((first != NULL) && (second != NULL)) + { + return (0 == strcmp(first, second)); + } + return FALSE; } #endif /** Compare if two strings up until the first @p max characters are equal. - + @param first First string. @param max Maximum number of characters to compare. @param second Second string. @return Boolean indicating whether the two strings are equal or not. - + Case-sensitive comparison. */ #if defined(TRIO_FUNC_EQUAL_CASE_MAX) -TRIO_PUBLIC_STRING int -trio_equal_case_max -TRIO_ARGS3((first, max, second), - TRIO_CONST char *first, - size_t max, - TRIO_CONST char *second) +TRIO_PUBLIC_STRING int trio_equal_case_max TRIO_ARGS3((first, max, second), TRIO_CONST char* first, + size_t max, TRIO_CONST char* second) { - assert(first); - assert(second); + assert(first); + assert(second); - if ((first != NULL) && (second != NULL)) - { - return (0 == strncmp(first, second, max)); - } - return FALSE; + if ((first != NULL) && (second != NULL)) + { + return (0 == strncmp(first, second, max)); + } + return FALSE; } #endif /** Compare if two strings are equal. - + @param first First string. @param second Second string. @return Boolean indicating whether the two strings are equal or not. @@ -723,67 +648,60 @@ TRIO_ARGS3((first, max, second), */ #if defined(TRIO_FUNC_EQUAL_LOCALE) -TRIO_PUBLIC_STRING int -trio_equal_locale -TRIO_ARGS2((first, second), - TRIO_CONST char *first, - TRIO_CONST char *second) +TRIO_PUBLIC_STRING int trio_equal_locale TRIO_ARGS2((first, second), TRIO_CONST char* first, + TRIO_CONST char* second) { - assert(first); - assert(second); + assert(first); + assert(second); -# if defined(LC_COLLATE) - return (strcoll(first, second) == 0); -# else - return trio_equal(first, second); -# endif +#if defined(LC_COLLATE) + return (strcoll(first, second) == 0); +#else + return trio_equal(first, second); +#endif } #endif /** Compare if two strings up until the first @p max characters are equal. - + @param first First string. @param max Maximum number of characters to compare. @param second Second string. @return Boolean indicating whether the two strings are equal or not. - + Case-insensitive comparison. */ #if defined(TRIO_FUNC_EQUAL_MAX) -TRIO_PUBLIC_STRING int -trio_equal_max -TRIO_ARGS3((first, max, second), - TRIO_CONST char *first, - size_t max, - TRIO_CONST char *second) +TRIO_PUBLIC_STRING int trio_equal_max TRIO_ARGS3((first, max, second), TRIO_CONST char* first, + size_t max, TRIO_CONST char* second) { - assert(first); - assert(second); + assert(first); + assert(second); - if ((first != NULL) && (second != NULL)) - { -# if defined(USE_STRNCASECMP) - return (0 == strncasecmp(first, second, max)); -# else - /* Not adequately tested yet */ - size_t cnt = 0; - while ((*first != NIL) && (*second != NIL) && (cnt <= max)) + if ((first != NULL) && (second != NULL)) { - if (internal_to_upper(*first) != internal_to_upper(*second)) - { - break; - } - first++; - second++; - cnt++; +#if defined(USE_STRNCASECMP) + return (0 == strncasecmp(first, second, max)); +#else + /* Not adequately tested yet */ + size_t cnt = 0; + while ((*first != NIL) && (*second != NIL) && (cnt <= max)) + { + if (internal_to_upper(*first) != internal_to_upper(*second)) + { + break; + } + first++; + second++; + cnt++; + } + return ((cnt == max) || ((*first == NIL) && (*second == NIL))); +#endif } - return ((cnt == max) || ((*first == NIL) && (*second == NIL))); -# endif - } - return FALSE; + return FALSE; } #endif @@ -796,31 +714,27 @@ TRIO_ARGS3((first, max, second), */ #if defined(TRIO_FUNC_ERROR) -TRIO_PUBLIC_STRING TRIO_CONST char * -trio_error -TRIO_ARGS1((error_number), - int error_number) +TRIO_PUBLIC_STRING TRIO_CONST char* trio_error TRIO_ARGS1((error_number), int error_number) { -# if defined(USE_STRERROR) - - return strerror(error_number); +#if defined(USE_STRERROR) -# else -# if defined(USE_SYS_ERRLIST) + return strerror(error_number); - extern char *sys_errlist[]; - extern int sys_nerr; +#else +#if defined(USE_SYS_ERRLIST) - return ((error_number < 0) || (error_number >= sys_nerr)) - ? "unknown" - : sys_errlist[error_number]; - -# else - - return "unknown"; + extern char* sys_errlist[]; + extern int sys_nerr; -# endif -# endif + return ((error_number < 0) || (error_number >= sys_nerr)) ? "unknown" + : sys_errlist[error_number]; + +#else + + return "unknown"; + +#endif +#endif } #endif @@ -839,20 +753,17 @@ TRIO_ARGS1((error_number), */ #if defined(TRIO_FUNC_FORMAT_DATE_MAX) -TRIO_PUBLIC_STRING size_t -trio_format_date_max -TRIO_ARGS4((target, max, format, datetime), - char *target, - size_t max, - TRIO_CONST char *format, - TRIO_CONST struct tm *datetime) +TRIO_PUBLIC_STRING size_t trio_format_date_max TRIO_ARGS4((target, max, format, datetime), + char* target, size_t max, + TRIO_CONST char* format, + TRIO_CONST struct tm* datetime) { - assert(target); - assert(format); - assert(datetime); - assert(max > 0); + assert(target); + assert(format); + assert(datetime); + assert(max > 0); - return strftime(target, max, format, datetime); + return strftime(target, max, format, datetime); } #endif @@ -869,31 +780,28 @@ TRIO_ARGS4((target, max, format, datetime), */ #if defined(TRIO_FUNC_HASH) -TRIO_PUBLIC_STRING unsigned long -trio_hash -TRIO_ARGS2((string, type), - TRIO_CONST char *string, - int type) +TRIO_PUBLIC_STRING unsigned long trio_hash TRIO_ARGS2((string, type), TRIO_CONST char* string, + int type) { - unsigned long value = 0L; - char ch; + unsigned long value = 0L; + char ch; - assert(string); - - switch (type) - { - case TRIO_HASH_PLAIN: - while ( (ch = *string++) != NIL ) + assert(string); + + switch (type) { - value *= 31; - value += (unsigned long)ch; + case TRIO_HASH_PLAIN: + while ((ch = *string++) != NIL) + { + value *= 31; + value += (unsigned long)ch; + } + break; + default: + assert(FALSE); + break; } - break; - default: - assert(FALSE); - break; - } - return value; + return value; } #endif @@ -907,15 +815,12 @@ TRIO_ARGS2((string, type), */ #if defined(TRIO_FUNC_INDEX) -TRIO_PUBLIC_STRING char * -trio_index -TRIO_ARGS2((string, character), - TRIO_CONST char *string, - int character) +TRIO_PUBLIC_STRING char* trio_index TRIO_ARGS2((string, character), TRIO_CONST char* string, + int character) { - assert(string); + assert(string); - return strchr(string, character); + return strchr(string, character); } #endif @@ -929,15 +834,12 @@ TRIO_ARGS2((string, character), */ #if defined(TRIO_FUNC_INDEX_LAST) -TRIO_PUBLIC_STRING char * -trio_index_last -TRIO_ARGS2((string, character), - TRIO_CONST char *string, - int character) +TRIO_PUBLIC_STRING char* trio_index_last TRIO_ARGS2((string, character), TRIO_CONST char* string, + int character) { - assert(string); + assert(string); - return strchr(string, character); + return strchr(string, character); } #endif @@ -950,14 +852,11 @@ TRIO_ARGS2((string, character), */ #if defined(TRIO_FUNC_LOWER) -TRIO_PUBLIC_STRING int -trio_lower -TRIO_ARGS1((target), - char *target) +TRIO_PUBLIC_STRING int trio_lower TRIO_ARGS1((target), char* target) { - assert(target); + assert(target); - return trio_span_function(target, target, trio_to_lower); + return trio_span_function(target, target, trio_to_lower); } #endif @@ -970,48 +869,44 @@ TRIO_ARGS1((target), @return Boolean value indicating success or failure. Case-insensitive comparison. - + The following wildcards can be used @li @c * Match any number of characters. @li @c ? Match a single character. */ #if defined(TRIO_FUNC_MATCH) -TRIO_PUBLIC_STRING int -trio_match -TRIO_ARGS2((string, pattern), - TRIO_CONST char *string, - TRIO_CONST char *pattern) +TRIO_PUBLIC_STRING int trio_match TRIO_ARGS2((string, pattern), TRIO_CONST char* string, + TRIO_CONST char* pattern) { - assert(string); - assert(pattern); - - for (; ('*' != *pattern); ++pattern, ++string) - { - if (NIL == *string) - { - return (NIL == *pattern); - } - if ((internal_to_upper((int)*string) != internal_to_upper((int)*pattern)) - && ('?' != *pattern)) - { - return FALSE; - } - } - /* two-line patch to prevent *too* much recursiveness: */ - while ('*' == pattern[1]) - pattern++; + assert(string); + assert(pattern); - do - { - if ( trio_match(string, &pattern[1]) ) + for (; ('*' != *pattern); ++pattern, ++string) { - return TRUE; + if (NIL == *string) + { + return (NIL == *pattern); + } + if ((internal_to_upper((int)*string) != internal_to_upper((int)*pattern)) && + ('?' != *pattern)) + { + return FALSE; + } } - } - while (*string++); - - return FALSE; + /* two-line patch to prevent *too* much recursiveness: */ + while ('*' == pattern[1]) + pattern++; + + do + { + if (trio_match(string, &pattern[1])) + { + return TRUE; + } + } while (*string++); + + return FALSE; } #endif @@ -1024,48 +919,43 @@ TRIO_ARGS2((string, pattern), @return Boolean value indicating success or failure. Case-sensitive comparison. - + The following wildcards can be used @li @c * Match any number of characters. @li @c ? Match a single character. */ #if defined(TRIO_FUNC_MATCH_CASE) -TRIO_PUBLIC_STRING int -trio_match_case -TRIO_ARGS2((string, pattern), - TRIO_CONST char *string, - TRIO_CONST char *pattern) +TRIO_PUBLIC_STRING int trio_match_case TRIO_ARGS2((string, pattern), TRIO_CONST char* string, + TRIO_CONST char* pattern) { - assert(string); - assert(pattern); - - for (; ('*' != *pattern); ++pattern, ++string) - { - if (NIL == *string) - { - return (NIL == *pattern); - } - if ((*string != *pattern) - && ('?' != *pattern)) - { - return FALSE; - } - } - /* two-line patch to prevent *too* much recursiveness: */ - while ('*' == pattern[1]) - pattern++; + assert(string); + assert(pattern); - do - { - if ( trio_match_case(string, &pattern[1]) ) + for (; ('*' != *pattern); ++pattern, ++string) { - return TRUE; + if (NIL == *string) + { + return (NIL == *pattern); + } + if ((*string != *pattern) && ('?' != *pattern)) + { + return FALSE; + } } - } - while (*string++); - - return FALSE; + /* two-line patch to prevent *too* much recursiveness: */ + while ('*' == pattern[1]) + pattern++; + + do + { + if (trio_match_case(string, &pattern[1])) + { + return TRUE; + } + } while (*string++); + + return FALSE; } #endif @@ -1080,25 +970,22 @@ TRIO_ARGS2((string, pattern), */ #if defined(TRIO_FUNC_SPAN_FUNCTION) -TRIO_PUBLIC_STRING size_t -trio_span_function -TRIO_ARGS3((target, source, Function), - char *target, - TRIO_CONST char *source, - int (*Function) TRIO_PROTO((int))) +TRIO_PUBLIC_STRING size_t trio_span_function TRIO_ARGS3((target, source, Function), char* target, + TRIO_CONST char* source, + int(*Function) TRIO_PROTO((int))) { - size_t count = 0; + size_t count = 0; - assert(target); - assert(source); - assert(Function); - - while (*source != NIL) - { - *target++ = Function(*source++); - count++; - } - return count; + assert(target); + assert(source); + assert(Function); + + while (*source != NIL) + { + *target++ = Function(*source++); + count++; + } + return count; } #endif @@ -1113,16 +1000,13 @@ TRIO_ARGS3((target, source, Function), */ #if defined(TRIO_FUNC_SUBSTRING) -TRIO_PUBLIC_STRING char * -trio_substring -TRIO_ARGS2((string, substring), - TRIO_CONST char *string, - TRIO_CONST char *substring) +TRIO_PUBLIC_STRING char* trio_substring TRIO_ARGS2((string, substring), TRIO_CONST char* string, + TRIO_CONST char* substring) { - assert(string); - assert(substring); + assert(string); + assert(substring); - return strstr(string, substring); + return strstr(string, substring); } #endif @@ -1138,33 +1022,30 @@ TRIO_ARGS2((string, substring), */ #if defined(TRIO_FUNC_SUBSTRING_MAX) -TRIO_PUBLIC_STRING char * -trio_substring_max -TRIO_ARGS3((string, max, substring), - TRIO_CONST char *string, - size_t max, - TRIO_CONST char *substring) +TRIO_PUBLIC_STRING char* trio_substring_max TRIO_ARGS3((string, max, substring), + TRIO_CONST char* string, size_t max, + TRIO_CONST char* substring) { - size_t count; - size_t size; - char *result = NULL; + size_t count; + size_t size; + char* result = NULL; - assert(string); - assert(substring); - - size = trio_length(substring); - if (size <= max) - { - for (count = 0; count <= max - size; count++) + assert(string); + assert(substring); + + size = trio_length(substring); + if (size <= max) { - if (trio_equal_max(substring, size, &string[count])) - { - result = (char *)&string[count]; - break; - } + for (count = 0; count <= max - size; count++) + { + if (trio_equal_max(substring, size, &string[count])) + { + result = (char*)&string[count]; + break; + } + } } - } - return result; + return result; } #endif @@ -1180,15 +1061,12 @@ TRIO_ARGS3((string, max, substring), */ #if defined(TRIO_FUNC_TOKENIZE) -TRIO_PUBLIC_STRING char * -trio_tokenize -TRIO_ARGS2((string, delimiters), - char *string, - TRIO_CONST char *delimiters) +TRIO_PUBLIC_STRING char* trio_tokenize TRIO_ARGS2((string, delimiters), char* string, + TRIO_CONST char* delimiters) { - assert(delimiters); - - return strtok(string, delimiters); + assert(delimiters); + + return strtok(string, delimiters); } #endif @@ -1217,129 +1095,124 @@ TRIO_ARGS2((string, delimiters), #if defined(TRIO_FUNC_TO_LONG_DOUBLE) /* FIXME: Add EBNF for hex-floats */ -TRIO_PUBLIC_STRING trio_long_double_t -trio_to_long_double -TRIO_ARGS2((source, endp), - TRIO_CONST char *source, - char **endp) +TRIO_PUBLIC_STRING trio_long_double_t trio_to_long_double TRIO_ARGS2((source, endp), + TRIO_CONST char* source, + char** endp) { -# if defined(USE_STRTOLD) - return strtold(source, endp); -# else - int isNegative = FALSE; - int isExponentNegative = FALSE; - trio_long_double_t integer = 0.0; - trio_long_double_t fraction = 0.0; - unsigned long exponent = 0; - trio_long_double_t base; - trio_long_double_t fracdiv = 1.0; - trio_long_double_t value = 0.0; +#if defined(USE_STRTOLD) + return strtold(source, endp); +#else + int isNegative = FALSE; + int isExponentNegative = FALSE; + trio_long_double_t integer = 0.0; + trio_long_double_t fraction = 0.0; + unsigned long exponent = 0; + trio_long_double_t base; + trio_long_double_t fracdiv = 1.0; + trio_long_double_t value = 0.0; - /* First try hex-floats */ - if ((source[0] == '0') && ((source[1] == 'x') || (source[1] == 'X'))) - { - base = 16.0; - source += 2; - while (isxdigit((int)*source)) + /* First try hex-floats */ + if ((source[0] == '0') && ((source[1] == 'x') || (source[1] == 'X'))) { - integer *= base; - integer += (isdigit((int)*source) - ? (*source - '0') - : 10 + (internal_to_upper((int)*source) - 'A')); - source++; - } - if (*source == '.') - { - source++; - while (isxdigit((int)*source)) - { - fracdiv /= base; - fraction += fracdiv * (isdigit((int)*source) - ? (*source - '0') - : 10 + (internal_to_upper((int)*source) - 'A')); - source++; - } - if ((*source == 'p') || (*source == 'P')) - { - source++; - if ((*source == '+') || (*source == '-')) + base = 16.0; + source += 2; + while (isxdigit((int)*source)) { - isExponentNegative = (*source == '-'); - source++; + integer *= base; + integer += (isdigit((int)*source) ? (*source - '0') + : 10 + (internal_to_upper((int)*source) - 'A')); + source++; } - while (isdigit((int)*source)) + if (*source == '.') { - exponent *= 10; - exponent += (*source - '0'); - source++; + source++; + while (isxdigit((int)*source)) + { + fracdiv /= base; + fraction += fracdiv * (isdigit((int)*source) + ? (*source - '0') + : 10 + (internal_to_upper((int)*source) - 'A')); + source++; + } + if ((*source == 'p') || (*source == 'P')) + { + source++; + if ((*source == '+') || (*source == '-')) + { + isExponentNegative = (*source == '-'); + source++; + } + while (isdigit((int)*source)) + { + exponent *= 10; + exponent += (*source - '0'); + source++; + } + } } - } + /* For later use with exponent */ + base = 2.0; } - /* For later use with exponent */ - base = 2.0; - } - else /* Then try normal decimal floats */ - { - base = 10.0; - isNegative = (*source == '-'); - /* Skip sign */ - if ((*source == '+') || (*source == '-')) - source++; - - /* Integer part */ - while (isdigit((int)*source)) + else /* Then try normal decimal floats */ { - integer *= base; - integer += (*source - '0'); - source++; + base = 10.0; + isNegative = (*source == '-'); + /* Skip sign */ + if ((*source == '+') || (*source == '-')) + source++; + + /* Integer part */ + while (isdigit((int)*source)) + { + integer *= base; + integer += (*source - '0'); + source++; + } + + if (*source == '.') + { + source++; /* skip decimal point */ + while (isdigit((int)*source)) + { + fracdiv /= base; + fraction += (*source - '0') * fracdiv; + source++; + } + } + if ((*source == 'e') || (*source == 'E') +#if TRIO_MICROSOFT + || (*source == 'd') || (*source == 'D') +#endif + ) + { + source++; /* Skip exponential indicator */ + isExponentNegative = (*source == '-'); + if ((*source == '+') || (*source == '-')) + source++; + while (isdigit((int)*source)) + { + exponent *= (int)base; + exponent += (*source - '0'); + source++; + } + } } - if (*source == '.') + value = integer + fraction; + if (exponent != 0) { - source++; /* skip decimal point */ - while (isdigit((int)*source)) - { - fracdiv /= base; - fraction += (*source - '0') * fracdiv; - source++; - } + if (isExponentNegative) + value /= trio_powl(base, (trio_long_double_t)exponent); + else + value *= trio_powl(base, (trio_long_double_t)exponent); } - if ((*source == 'e') - || (*source == 'E') -# if TRIO_MICROSOFT - || (*source == 'd') - || (*source == 'D') -# endif - ) - { - source++; /* Skip exponential indicator */ - isExponentNegative = (*source == '-'); - if ((*source == '+') || (*source == '-')) - source++; - while (isdigit((int)*source)) - { - exponent *= (int)base; - exponent += (*source - '0'); - source++; - } - } - } - - value = integer + fraction; - if (exponent != 0) - { - if (isExponentNegative) - value /= trio_powl(base, (trio_long_double_t)exponent); - else - value *= trio_powl(base, (trio_long_double_t)exponent); - } - if (isNegative) - value = -value; + if (isNegative) + value = -value; - if (endp) - *endp = (char *)source; - return value; -# endif + if (endp) + *endp = (char*)source; + return value; +#endif } #endif @@ -1355,16 +1228,13 @@ TRIO_ARGS2((source, endp), */ #if defined(TRIO_FUNC_TO_DOUBLE) -TRIO_PUBLIC_STRING double -trio_to_double -TRIO_ARGS2((source, endp), - TRIO_CONST char *source, - char **endp) +TRIO_PUBLIC_STRING double trio_to_double TRIO_ARGS2((source, endp), TRIO_CONST char* source, + char** endp) { #if defined(USE_STRTOD) - return strtod(source, endp); + return strtod(source, endp); #else - return (double)trio_to_long_double(source, endp); + return (double)trio_to_long_double(source, endp); #endif } @@ -1381,17 +1251,14 @@ TRIO_ARGS2((source, endp), */ #if defined(TRIO_FUNC_TO_FLOAT) -TRIO_PUBLIC_STRING float -trio_to_float -TRIO_ARGS2((source, endp), - TRIO_CONST char *source, - char **endp) +TRIO_PUBLIC_STRING float trio_to_float TRIO_ARGS2((source, endp), TRIO_CONST char* source, + char** endp) { -# if defined(USE_STRTOF) - return strtof(source, endp); -# else - return (float)trio_to_long_double(source, endp); -# endif +#if defined(USE_STRTOF) + return strtof(source, endp); +#else + return (float)trio_to_long_double(source, endp); +#endif } #endif @@ -1405,17 +1272,13 @@ TRIO_ARGS2((source, endp), */ #if defined(TRIO_FUNC_TO_LONG) -TRIO_PUBLIC_STRING long -trio_to_long -TRIO_ARGS3((string, endp, base), - TRIO_CONST char *string, - char **endp, - int base) +TRIO_PUBLIC_STRING long trio_to_long TRIO_ARGS3((string, endp, base), TRIO_CONST char* string, + char** endp, int base) { - assert(string); - assert((base >= 2) && (base <= 36)); - - return strtol(string, endp, base); + assert(string); + assert((base >= 2) && (base <= 36)); + + return strtol(string, endp, base); } #endif @@ -1428,23 +1291,18 @@ TRIO_ARGS3((string, endp, base), */ #if defined(TRIO_FUNC_TO_LOWER) -TRIO_PUBLIC_STRING int -trio_to_lower -TRIO_ARGS1((source), - int source) +TRIO_PUBLIC_STRING int trio_to_lower TRIO_ARGS1((source), int source) { -# if defined(HAVE_TOLOWER) - - return tolower(source); - -# else +#if defined(HAVE_TOLOWER) - /* Does not handle locales or non-contiguous alphabetic characters */ - return ((source >= (int)'A') && (source <= (int)'Z')) - ? source - 'A' + 'a' - : source; - -# endif + return tolower(source); + +#else + + /* Does not handle locales or non-contiguous alphabetic characters */ + return ((source >= (int)'A') && (source <= (int)'Z')) ? source - 'A' + 'a' : source; + +#endif } #endif @@ -1458,17 +1316,14 @@ TRIO_ARGS1((source), */ #if defined(TRIO_FUNC_TO_UNSIGNED_LONG) -TRIO_PUBLIC_STRING unsigned long -trio_to_unsigned_long -TRIO_ARGS3((string, endp, base), - TRIO_CONST char *string, - char **endp, - int base) +TRIO_PUBLIC_STRING unsigned long trio_to_unsigned_long TRIO_ARGS3((string, endp, base), + TRIO_CONST char* string, + char** endp, int base) { - assert(string); - assert((base >= 2) && (base <= 36)); - - return strtoul(string, endp, base); + assert(string); + assert((base >= 2) && (base <= 36)); + + return strtoul(string, endp, base); } #endif @@ -1481,12 +1336,9 @@ TRIO_ARGS3((string, endp, base), */ #if defined(TRIO_FUNC_TO_UPPER) -TRIO_PUBLIC_STRING int -trio_to_upper -TRIO_ARGS1((source), - int source) +TRIO_PUBLIC_STRING int trio_to_upper TRIO_ARGS1((source), int source) { - return internal_to_upper(source); + return internal_to_upper(source); } #endif @@ -1499,27 +1351,23 @@ TRIO_ARGS1((source), */ #if defined(TRIO_FUNC_UPPER) -TRIO_PUBLIC_STRING int -trio_upper -TRIO_ARGS1((target), - char *target) +TRIO_PUBLIC_STRING int trio_upper TRIO_ARGS1((target), char* target) { - assert(target); + assert(target); - return trio_span_function(target, target, internal_to_upper); + return trio_span_function(target, target, internal_to_upper); } #endif /** @} End of StaticStrings */ - /************************************************************************* * Dynamic String Functions */ #if defined(TRIO_DOCUMENTATION) -# include "doc/doc_dynamic.h" +#include "doc/doc_dynamic.h" #endif /** @addtogroup DynamicStrings @{ @@ -1527,69 +1375,62 @@ TRIO_ARGS1((target), /** Create a new dynamic string. - + @param initial_size Initial size of the buffer. @return Newly allocated dynamic string, or NULL if memory allocation failed. */ #if defined(TRIO_FUNC_STRING_CREATE) -TRIO_PUBLIC_STRING trio_string_t * -trio_string_create -TRIO_ARGS1((initial_size), - int initial_size) +TRIO_PUBLIC_STRING trio_string_t* trio_string_create TRIO_ARGS1((initial_size), int initial_size) { - trio_string_t *self; + trio_string_t* self; - self = internal_string_alloc(); - if (self) - { - if (internal_string_grow(self, - (size_t)((initial_size > 0) ? initial_size : 1))) + self = internal_string_alloc(); + if (self) { - self->content[0] = (char)0; - self->allocated = initial_size; + if (internal_string_grow(self, (size_t)((initial_size > 0) ? initial_size : 1))) + { + self->content[0] = (char)0; + self->allocated = initial_size; + } + else + { + trio_string_destroy(self); + self = NULL; + } } - else - { - trio_string_destroy(self); - self = NULL; - } - } - return self; + return self; } #endif /** Deallocate the dynamic string and its contents. - + @param self Dynamic string */ #if defined(TRIO_FUNC_STRING_DESTROY) -TRIO_PUBLIC_STRING void -trio_string_destroy -TRIO_ARGS1((self), - trio_string_t *self) +TRIO_PUBLIC_STRING void trio_string_destroy TRIO_ARGS1((self), trio_string_t* self) { - assert(self); - - if (self) - { - trio_destroy(self->content); - TRIO_FREE(self); - } + assert(self); + + if (self) + { + trio_destroy(self->content); + TRIO_FREE(self); + } } #endif /** Get a pointer to the content. - + @param self Dynamic string. @param offset Offset into content. @return Pointer to the content. - + @p Offset can be zero, positive, or negative. If @p offset is zero, then the start of the content will be returned. If @p offset is positive, then a pointer to @p offset number of characters from the beginning of the @@ -1599,98 +1440,88 @@ TRIO_ARGS1((self), */ #if defined(TRIO_FUNC_STRING_GET) -TRIO_PUBLIC_STRING char * -trio_string_get -TRIO_ARGS2((self, offset), - trio_string_t *self, - int offset) +TRIO_PUBLIC_STRING char* trio_string_get TRIO_ARGS2((self, offset), trio_string_t* self, int offset) { - char *result = NULL; - - assert(self); + char* result = NULL; - if (self->content != NULL) - { - if (self->length == 0) + assert(self); + + if (self->content != NULL) { - (void)trio_string_length(self); + if (self->length == 0) + { + (void)trio_string_length(self); + } + if (offset >= 0) + { + if (offset > (int)self->length) + { + offset = self->length; + } + } + else + { + offset += self->length + 1; + if (offset < 0) + { + offset = 0; + } + } + result = &(self->content[offset]); } - if (offset >= 0) - { - if (offset > (int)self->length) - { - offset = self->length; - } - } - else - { - offset += self->length + 1; - if (offset < 0) - { - offset = 0; - } - } - result = &(self->content[offset]); - } - return result; + return result; } #endif /** Extract the content. - + @param self Dynamic String @return Content of dynamic string. - + The content is removed from the dynamic string. This enables destruction of the dynamic string without deallocation of the content. */ #if defined(TRIO_FUNC_STRING_EXTRACT) -TRIO_PUBLIC_STRING char * -trio_string_extract -TRIO_ARGS1((self), - trio_string_t *self) +TRIO_PUBLIC_STRING char* trio_string_extract TRIO_ARGS1((self), trio_string_t* self) { - char *result; - - assert(self); + char* result; - result = self->content; - /* FIXME: Allocate new empty buffer? */ - self->content = NULL; - self->length = self->allocated = 0; - return result; + assert(self); + + result = self->content; + /* FIXME: Allocate new empty buffer? */ + self->content = NULL; + self->length = self->allocated = 0; + return result; } #endif /** Set the content of the dynamic string. - + @param self Dynamic String @param buffer The new content. - + Sets the content of the dynamic string to a copy @p buffer. An existing content will be deallocated first, if necessary. - + @remark This function will make a copy of @p buffer. You are responsible for deallocating @p buffer yourself. */ #if defined(TRIO_FUNC_XSTRING_SET) -TRIO_PUBLIC_STRING void -trio_xstring_set -TRIO_ARGS2((self, buffer), - trio_string_t *self, - char *buffer) +TRIO_PUBLIC_STRING void trio_xstring_set TRIO_ARGS2((self, buffer), trio_string_t* self, + char* buffer) { - assert(self); + assert(self); - trio_destroy(self->content); - self->content = trio_duplicate(buffer); + trio_destroy(self->content); + self->content = trio_duplicate(buffer); } #endif @@ -1700,14 +1531,11 @@ TRIO_ARGS2((self, buffer), */ #if defined(TRIO_FUNC_STRING_SIZE) -TRIO_PUBLIC_STRING int -trio_string_size -TRIO_ARGS1((self), - trio_string_t *self) +TRIO_PUBLIC_STRING int trio_string_size TRIO_ARGS1((self), trio_string_t* self) { - assert(self); + assert(self); - return self->allocated; + return self->allocated; } #endif @@ -1717,75 +1545,65 @@ TRIO_ARGS1((self), */ #if defined(TRIO_FUNC_STRING_TERMINATE) -TRIO_PUBLIC_STRING void -trio_string_terminate -TRIO_ARGS1((self), - trio_string_t *self) +TRIO_PUBLIC_STRING void trio_string_terminate TRIO_ARGS1((self), trio_string_t* self) { - trio_xstring_append_char(self, 0); + trio_xstring_append_char(self, 0); } #endif /** Append the second string to the first. - + @param self Dynamic string to be modified. @param other Dynamic string to copy from. @return Boolean value indicating success or failure. */ #if defined(TRIO_FUNC_STRING_APPEND) -TRIO_PUBLIC_STRING int -trio_string_append -TRIO_ARGS2((self, other), - trio_string_t *self, - trio_string_t *other) +TRIO_PUBLIC_STRING int trio_string_append TRIO_ARGS2((self, other), trio_string_t* self, + trio_string_t* other) { - size_t length; - - assert(self); - assert(other); + size_t length; - length = self->length + other->length; - if (!internal_string_grow_to(self, length)) - goto error; - trio_copy(&self->content[self->length], other->content); - self->length = length; - return TRUE; - - error: - return FALSE; + assert(self); + assert(other); + + length = self->length + other->length; + if (!internal_string_grow_to(self, length)) + goto error; + trio_copy(&self->content[self->length], other->content); + self->length = length; + return TRUE; + +error: + return FALSE; } #endif - /* * trio_xstring_append */ #if defined(TRIO_FUNC_XSTRING_APPEND) -TRIO_PUBLIC_STRING int -trio_xstring_append -TRIO_ARGS2((self, other), - trio_string_t *self, - TRIO_CONST char *other) +TRIO_PUBLIC_STRING int trio_xstring_append TRIO_ARGS2((self, other), trio_string_t* self, + TRIO_CONST char* other) { - size_t length; - - assert(self); - assert(other); + size_t length; - length = self->length + trio_length(other); - if (!internal_string_grow_to(self, length)) - goto error; - trio_copy(&self->content[self->length], other); - self->length = length; - return TRUE; - - error: - return FALSE; + assert(self); + assert(other); + + length = self->length + trio_length(other); + if (!internal_string_grow_to(self, length)) + goto error; + trio_copy(&self->content[self->length], other); + self->length = length; + return TRUE; + +error: + return FALSE; } #endif @@ -1795,25 +1613,22 @@ TRIO_ARGS2((self, other), */ #if defined(TRIO_FUNC_XSTRING_APPEND_CHAR) -TRIO_PUBLIC_STRING int -trio_xstring_append_char -TRIO_ARGS2((self, character), - trio_string_t *self, - char character) +TRIO_PUBLIC_STRING int trio_xstring_append_char TRIO_ARGS2((self, character), trio_string_t* self, + char character) { - assert(self); + assert(self); - if ((int)self->length >= trio_string_size(self)) - { - if (!internal_string_grow(self, 0)) - goto error; - } - self->content[self->length] = character; - self->length++; - return TRUE; - - error: - return FALSE; + if ((int)self->length >= trio_string_size(self)) + { + if (!internal_string_grow(self, 0)) + goto error; + } + self->content[self->length] = character; + self->length++; + return TRUE; + +error: + return FALSE; } #endif @@ -1823,55 +1638,48 @@ TRIO_ARGS2((self, character), */ #if defined(TRIO_FUNC_XSTRING_APPEND_MAX) -TRIO_PUBLIC_STRING int -trio_xstring_append_max -TRIO_ARGS3((self, other, max), - trio_string_t *self, - TRIO_CONST char *other, - size_t max) +TRIO_PUBLIC_STRING int trio_xstring_append_max TRIO_ARGS3((self, other, max), trio_string_t* self, + TRIO_CONST char* other, size_t max) { - size_t length; - - assert(self); - assert(other); + size_t length; - length = self->length + trio_length_max(other, max); - if (!internal_string_grow_to(self, length)) - goto error; + assert(self); + assert(other); - /* - * Pass max + 1 since trio_copy_max copies one character less than - * this from the source to make room for a terminating zero. - */ - trio_copy_max(&self->content[self->length], max + 1, other); - self->length = length; - return TRUE; - - error: - return FALSE; + length = self->length + trio_length_max(other, max); + if (!internal_string_grow_to(self, length)) + goto error; + + /* + * Pass max + 1 since trio_copy_max copies one character less than + * this from the source to make room for a terminating zero. + */ + trio_copy_max(&self->content[self->length], max + 1, other); + self->length = length; + return TRUE; + +error: + return FALSE; } #endif /** Search for the first occurrence of second parameter in the first. - + @param self Dynamic string to be modified. @param other Dynamic string to copy from. @return Boolean value indicating success or failure. */ #if defined(TRIO_FUNC_STRING_CONTAINS) -TRIO_PUBLIC_STRING int -trio_string_contains -TRIO_ARGS2((self, other), - trio_string_t *self, - trio_string_t *other) +TRIO_PUBLIC_STRING int trio_string_contains TRIO_ARGS2((self, other), trio_string_t* self, + trio_string_t* other) { - assert(self); - assert(other); + assert(self); + assert(other); - return trio_contains(self->content, other->content); + return trio_contains(self->content, other->content); } #endif @@ -1881,16 +1689,13 @@ TRIO_ARGS2((self, other), */ #if defined(TRIO_FUNC_XSTRING_CONTAINS) -TRIO_PUBLIC_STRING int -trio_xstring_contains -TRIO_ARGS2((self, other), - trio_string_t *self, - TRIO_CONST char *other) +TRIO_PUBLIC_STRING int trio_xstring_contains TRIO_ARGS2((self, other), trio_string_t* self, + TRIO_CONST char* other) { - assert(self); - assert(other); + assert(self); + assert(other); - return trio_contains(self->content, other); + return trio_contains(self->content, other); } #endif @@ -1900,38 +1705,31 @@ TRIO_ARGS2((self, other), */ #if defined(TRIO_FUNC_STRING_COPY) -TRIO_PUBLIC_STRING int -trio_string_copy -TRIO_ARGS2((self, other), - trio_string_t *self, - trio_string_t *other) +TRIO_PUBLIC_STRING int trio_string_copy TRIO_ARGS2((self, other), trio_string_t* self, + trio_string_t* other) { - assert(self); - assert(other); + assert(self); + assert(other); - self->length = 0; - return trio_string_append(self, other); + self->length = 0; + return trio_string_append(self, other); } #endif - /* * trio_xstring_copy */ #if defined(TRIO_FUNC_XSTRING_COPY) -TRIO_PUBLIC_STRING int -trio_xstring_copy -TRIO_ARGS2((self, other), - trio_string_t *self, - TRIO_CONST char *other) +TRIO_PUBLIC_STRING int trio_xstring_copy TRIO_ARGS2((self, other), trio_string_t* self, + TRIO_CONST char* other) { - assert(self); - assert(other); + assert(self); + assert(other); - self->length = 0; - return trio_xstring_append(self, other); + self->length = 0; + return trio_xstring_append(self, other); } #endif @@ -1941,30 +1739,27 @@ TRIO_ARGS2((self, other), */ #if defined(TRIO_FUNC_STRING_DUPLICATE) -TRIO_PUBLIC_STRING trio_string_t * -trio_string_duplicate -TRIO_ARGS1((other), - trio_string_t *other) +TRIO_PUBLIC_STRING trio_string_t* trio_string_duplicate TRIO_ARGS1((other), trio_string_t* other) { - trio_string_t *self; - - assert(other); + trio_string_t* self; - self = internal_string_alloc(); - if (self) - { - self->content = internal_duplicate_max(other->content, other->length); - if (self->content) + assert(other); + + self = internal_string_alloc(); + if (self) { - self->length = other->length; - self->allocated = self->length + 1; + self->content = internal_duplicate_max(other->content, other->length); + if (self->content) + { + self->length = other->length; + self->allocated = self->length + 1; + } + else + { + self->length = self->allocated = 0; + } } - else - { - self->length = self->allocated = 0; - } - } - return self; + return self; } #endif @@ -1974,30 +1769,27 @@ TRIO_ARGS1((other), */ #if defined(TRIO_FUNC_XSTRING_DUPLICATE) -TRIO_PUBLIC_STRING trio_string_t * -trio_xstring_duplicate -TRIO_ARGS1((other), - TRIO_CONST char *other) +TRIO_PUBLIC_STRING trio_string_t* trio_xstring_duplicate TRIO_ARGS1((other), TRIO_CONST char* other) { - trio_string_t *self; - - assert(other); + trio_string_t* self; - self = internal_string_alloc(); - if (self) - { - self->content = internal_duplicate_max(other, trio_length(other)); - if (self->content) + assert(other); + + self = internal_string_alloc(); + if (self) { - self->length = trio_length(self->content); - self->allocated = self->length + 1; + self->content = internal_duplicate_max(other, trio_length(other)); + if (self->content) + { + self->length = trio_length(self->content); + self->allocated = self->length + 1; + } + else + { + self->length = self->allocated = 0; + } } - else - { - self->length = self->allocated = 0; - } - } - return self; + return self; } #endif @@ -2007,36 +1799,29 @@ TRIO_ARGS1((other), */ #if defined(TRIO_FUNC_STRING_EQUAL) -TRIO_PUBLIC_STRING int -trio_string_equal -TRIO_ARGS2((self, other), - trio_string_t *self, - trio_string_t *other) +TRIO_PUBLIC_STRING int trio_string_equal TRIO_ARGS2((self, other), trio_string_t* self, + trio_string_t* other) { - assert(self); - assert(other); + assert(self); + assert(other); - return trio_equal(self->content, other->content); + return trio_equal(self->content, other->content); } #endif - /* * trio_xstring_equal */ #if defined(TRIO_FUNC_XSTRING_EQUAL) -TRIO_PUBLIC_STRING int -trio_xstring_equal -TRIO_ARGS2((self, other), - trio_string_t *self, - TRIO_CONST char *other) +TRIO_PUBLIC_STRING int trio_xstring_equal TRIO_ARGS2((self, other), trio_string_t* self, + TRIO_CONST char* other) { - assert(self); - assert(other); + assert(self); + assert(other); - return trio_equal(self->content, other); + return trio_equal(self->content, other); } #endif @@ -2046,17 +1831,13 @@ TRIO_ARGS2((self, other), */ #if defined(TRIO_FUNC_STRING_EQUAL_MAX) -TRIO_PUBLIC_STRING int -trio_string_equal_max -TRIO_ARGS3((self, max, other), - trio_string_t *self, - size_t max, - trio_string_t *other) +TRIO_PUBLIC_STRING int trio_string_equal_max TRIO_ARGS3((self, max, other), trio_string_t* self, + size_t max, trio_string_t* other) { - assert(self); - assert(other); + assert(self); + assert(other); - return trio_equal_max(self->content, max, other->content); + return trio_equal_max(self->content, max, other->content); } #endif @@ -2065,17 +1846,13 @@ TRIO_ARGS3((self, max, other), */ #if defined(TRIO_FUNC_XSTRING_EQUAL_MAX) -TRIO_PUBLIC_STRING int -trio_xstring_equal_max -TRIO_ARGS3((self, max, other), - trio_string_t *self, - size_t max, - TRIO_CONST char *other) +TRIO_PUBLIC_STRING int trio_xstring_equal_max TRIO_ARGS3((self, max, other), trio_string_t* self, + size_t max, TRIO_CONST char* other) { - assert(self); - assert(other); + assert(self); + assert(other); - return trio_equal_max(self->content, max, other); + return trio_equal_max(self->content, max, other); } #endif @@ -2085,16 +1862,13 @@ TRIO_ARGS3((self, max, other), */ #if defined(TRIO_FUNC_STRING_EQUAL_CASE) -TRIO_PUBLIC_STRING int -trio_string_equal_case -TRIO_ARGS2((self, other), - trio_string_t *self, - trio_string_t *other) +TRIO_PUBLIC_STRING int trio_string_equal_case TRIO_ARGS2((self, other), trio_string_t* self, + trio_string_t* other) { - assert(self); - assert(other); + assert(self); + assert(other); - return trio_equal_case(self->content, other->content); + return trio_equal_case(self->content, other->content); } #endif @@ -2104,16 +1878,13 @@ TRIO_ARGS2((self, other), */ #if defined(TRIO_FUNC_XSTRING_EQUAL_CASE) -TRIO_PUBLIC_STRING int -trio_xstring_equal_case -TRIO_ARGS2((self, other), - trio_string_t *self, - TRIO_CONST char *other) +TRIO_PUBLIC_STRING int trio_xstring_equal_case TRIO_ARGS2((self, other), trio_string_t* self, + TRIO_CONST char* other) { - assert(self); - assert(other); + assert(self); + assert(other); - return trio_equal_case(self->content, other); + return trio_equal_case(self->content, other); } #endif @@ -2123,17 +1894,14 @@ TRIO_ARGS2((self, other), */ #if defined(TRIO_FUNC_STRING_EQUAL_CASE_MAX) -TRIO_PUBLIC_STRING int -trio_string_equal_case_max -TRIO_ARGS3((self, max, other), - trio_string_t *self, - size_t max, - trio_string_t *other) +TRIO_PUBLIC_STRING int trio_string_equal_case_max TRIO_ARGS3((self, max, other), + trio_string_t* self, size_t max, + trio_string_t* other) { - assert(self); - assert(other); + assert(self); + assert(other); - return trio_equal_case_max(self->content, max, other->content); + return trio_equal_case_max(self->content, max, other->content); } #endif @@ -2143,17 +1911,14 @@ TRIO_ARGS3((self, max, other), */ #if defined(TRIO_FUNC_XSTRING_EQUAL_CASE_MAX) -TRIO_PUBLIC_STRING int -trio_xstring_equal_case_max -TRIO_ARGS3((self, max, other), - trio_string_t *self, - size_t max, - TRIO_CONST char *other) +TRIO_PUBLIC_STRING int trio_xstring_equal_case_max TRIO_ARGS3((self, max, other), + trio_string_t* self, size_t max, + TRIO_CONST char* other) { - assert(self); - assert(other); + assert(self); + assert(other); - return trio_equal_case_max(self->content, max, other); + return trio_equal_case_max(self->content, max, other); } #endif @@ -2163,17 +1928,14 @@ TRIO_ARGS3((self, max, other), */ #if defined(TRIO_FUNC_STRING_FORMAT_DATE_MAX) -TRIO_PUBLIC_STRING size_t -trio_string_format_date_max -TRIO_ARGS4((self, max, format, datetime), - trio_string_t *self, - size_t max, - TRIO_CONST char *format, - TRIO_CONST struct tm *datetime) +TRIO_PUBLIC_STRING size_t trio_string_format_date_max TRIO_ARGS4((self, max, format, datetime), + trio_string_t* self, size_t max, + TRIO_CONST char* format, + TRIO_CONST struct tm* datetime) { - assert(self); + assert(self); - return trio_format_date_max(self->content, max, format, datetime); + return trio_format_date_max(self->content, max, format, datetime); } #endif @@ -2183,15 +1945,12 @@ TRIO_ARGS4((self, max, format, datetime), */ #if defined(TRIO_FUNC_STRING_INDEX) -TRIO_PUBLIC_STRING char * -trio_string_index -TRIO_ARGS2((self, character), - trio_string_t *self, - int character) +TRIO_PUBLIC_STRING char* trio_string_index TRIO_ARGS2((self, character), trio_string_t* self, + int character) { - assert(self); + assert(self); - return trio_index(self->content, character); + return trio_index(self->content, character); } #endif @@ -2201,15 +1960,12 @@ TRIO_ARGS2((self, character), */ #if defined(TRIO_FUNC_STRING_INDEX_LAST) -TRIO_PUBLIC_STRING char * -trio_string_index_last -TRIO_ARGS2((self, character), - trio_string_t *self, - int character) +TRIO_PUBLIC_STRING char* trio_string_index_last TRIO_ARGS2((self, character), trio_string_t* self, + int character) { - assert(self); + assert(self); - return trio_index_last(self->content, character); + return trio_index_last(self->content, character); } #endif @@ -2219,18 +1975,15 @@ TRIO_ARGS2((self, character), */ #if defined(TRIO_FUNC_STRING_LENGTH) -TRIO_PUBLIC_STRING int -trio_string_length -TRIO_ARGS1((self), - trio_string_t *self) +TRIO_PUBLIC_STRING int trio_string_length TRIO_ARGS1((self), trio_string_t* self) { - assert(self); + assert(self); - if (self->length == 0) - { - self->length = trio_length(self->content); - } - return self->length; + if (self->length == 0) + { + self->length = trio_length(self->content); + } + return self->length; } #endif @@ -2240,14 +1993,11 @@ TRIO_ARGS1((self), */ #if defined(TRIO_FUNC_STRING_LOWER) -TRIO_PUBLIC_STRING int -trio_string_lower -TRIO_ARGS1((self), - trio_string_t *self) +TRIO_PUBLIC_STRING int trio_string_lower TRIO_ARGS1((self), trio_string_t* self) { - assert(self); + assert(self); - return trio_lower(self->content); + return trio_lower(self->content); } #endif @@ -2257,16 +2007,13 @@ TRIO_ARGS1((self), */ #if defined(TRIO_FUNC_STRING_MATCH) -TRIO_PUBLIC_STRING int -trio_string_match -TRIO_ARGS2((self, other), - trio_string_t *self, - trio_string_t *other) +TRIO_PUBLIC_STRING int trio_string_match TRIO_ARGS2((self, other), trio_string_t* self, + trio_string_t* other) { - assert(self); - assert(other); + assert(self); + assert(other); - return trio_match(self->content, other->content); + return trio_match(self->content, other->content); } #endif @@ -2276,16 +2023,13 @@ TRIO_ARGS2((self, other), */ #if defined(TRIO_FUNC_XSTRING_MATCH) -TRIO_PUBLIC_STRING int -trio_xstring_match -TRIO_ARGS2((self, other), - trio_string_t *self, - TRIO_CONST char *other) +TRIO_PUBLIC_STRING int trio_xstring_match TRIO_ARGS2((self, other), trio_string_t* self, + TRIO_CONST char* other) { - assert(self); - assert(other); + assert(self); + assert(other); - return trio_match(self->content, other); + return trio_match(self->content, other); } #endif @@ -2295,16 +2039,13 @@ TRIO_ARGS2((self, other), */ #if defined(TRIO_FUNC_STRING_MATCH_CASE) -TRIO_PUBLIC_STRING int -trio_string_match_case -TRIO_ARGS2((self, other), - trio_string_t *self, - trio_string_t *other) +TRIO_PUBLIC_STRING int trio_string_match_case TRIO_ARGS2((self, other), trio_string_t* self, + trio_string_t* other) { - assert(self); - assert(other); + assert(self); + assert(other); - return trio_match_case(self->content, other->content); + return trio_match_case(self->content, other->content); } #endif @@ -2314,16 +2055,13 @@ TRIO_ARGS2((self, other), */ #if defined(TRIO_FUNC_XSTRING_MATCH_CASE) -TRIO_PUBLIC_STRING int -trio_xstring_match_case -TRIO_ARGS2((self, other), - trio_string_t *self, - TRIO_CONST char *other) +TRIO_PUBLIC_STRING int trio_xstring_match_case TRIO_ARGS2((self, other), trio_string_t* self, + TRIO_CONST char* other) { - assert(self); - assert(other); + assert(self); + assert(other); - return trio_match_case(self->content, other); + return trio_match_case(self->content, other); } #endif @@ -2333,16 +2071,13 @@ TRIO_ARGS2((self, other), */ #if defined(TRIO_FUNC_STRING_SUBSTRING) -TRIO_PUBLIC_STRING char * -trio_string_substring -TRIO_ARGS2((self, other), - trio_string_t *self, - trio_string_t *other) +TRIO_PUBLIC_STRING char* trio_string_substring TRIO_ARGS2((self, other), trio_string_t* self, + trio_string_t* other) { - assert(self); - assert(other); + assert(self); + assert(other); - return trio_substring(self->content, other->content); + return trio_substring(self->content, other->content); } #endif @@ -2352,16 +2087,13 @@ TRIO_ARGS2((self, other), */ #if defined(TRIO_FUNC_XSTRING_SUBSTRING) -TRIO_PUBLIC_STRING char * -trio_xstring_substring -TRIO_ARGS2((self, other), - trio_string_t *self, - TRIO_CONST char *other) +TRIO_PUBLIC_STRING char* trio_xstring_substring TRIO_ARGS2((self, other), trio_string_t* self, + TRIO_CONST char* other) { - assert(self); - assert(other); + assert(self); + assert(other); - return trio_substring(self->content, other); + return trio_substring(self->content, other); } #endif @@ -2371,14 +2103,11 @@ TRIO_ARGS2((self, other), */ #if defined(TRIO_FUNC_STRING_UPPER) -TRIO_PUBLIC_STRING int -trio_string_upper -TRIO_ARGS1((self), - trio_string_t *self) +TRIO_PUBLIC_STRING int trio_string_upper TRIO_ARGS1((self), trio_string_t* self) { - assert(self); + assert(self); - return trio_upper(self->content); + return trio_upper(self->content); } #endif diff --git a/winpr/libwinpr/utils/trio/triostr.h b/winpr/libwinpr/utils/trio/triostr.h index 847fb7232..3e967ca73 100644 --- a/winpr/libwinpr/utils/trio/triostr.h +++ b/winpr/libwinpr/utils/trio/triostr.h @@ -30,108 +30,103 @@ #include "triop.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -enum { - TRIO_HASH_NONE = 0, - TRIO_HASH_PLAIN, - TRIO_HASH_TWOSIGNED -}; + enum + { + TRIO_HASH_NONE = 0, + TRIO_HASH_PLAIN, + TRIO_HASH_TWOSIGNED + }; #if !defined(TRIO_PUBLIC_STRING) -# if !defined(TRIO_PUBLIC) -# define TRIO_PUBLIC -# endif -# define TRIO_PUBLIC_STRING TRIO_PUBLIC +#if !defined(TRIO_PUBLIC) +#define TRIO_PUBLIC +#endif +#define TRIO_PUBLIC_STRING TRIO_PUBLIC #endif -/************************************************************************* - * Dependencies - */ + /************************************************************************* + * Dependencies + */ #if defined(TRIO_EMBED_STRING) -/* - * The application that triostr is embedded in must define which functions - * it uses. - * - * The following resolves internal dependencies. - */ - -# if defined(TRIO_FUNC_XSTRING_SET) -# if !defined(TRIO_FUNC_DUPLICATE) -# define TRIO_FUNC_DUPLICATE -# endif -# endif + /* + * The application that triostr is embedded in must define which functions + * it uses. + * + * The following resolves internal dependencies. + */ -# if defined(TRIO_FUNC_DUPLICATE) \ - || defined(TRIO_FUNC_DUPLICATE_MAX) \ - || defined(TRIO_FUNC_STRING_DUPLICATE) \ - || defined(TRIO_FUNC_XSTRING_DUPLICATE) -# if !defined(TRIO_FUNC_CREATE) -# define TRIO_FUNC_CREATE -# endif -# if !defined(TRIO_FUNC_COPY_MAX) -# define TRIO_FUNC_COPY_MAX -# endif -# endif +#if defined(TRIO_FUNC_XSTRING_SET) +#if !defined(TRIO_FUNC_DUPLICATE) +#define TRIO_FUNC_DUPLICATE +#endif +#endif -# if defined(TRIO_FUNC_STRING_CREATE) -# if !defined(TRIO_FUNC_STRING_DESTROY) -# define TRIO_FUNC_STRING_DESTROY -# endif -# endif +#if defined(TRIO_FUNC_DUPLICATE) || defined(TRIO_FUNC_DUPLICATE_MAX) || \ + defined(TRIO_FUNC_STRING_DUPLICATE) || defined(TRIO_FUNC_XSTRING_DUPLICATE) +#if !defined(TRIO_FUNC_CREATE) +#define TRIO_FUNC_CREATE +#endif +#if !defined(TRIO_FUNC_COPY_MAX) +#define TRIO_FUNC_COPY_MAX +#endif +#endif -# if defined(TRIO_FUNC_STRING_DESTROY) \ - || defined(TRIO_FUNC_XSTRING_SET) -# if !defined(TRIO_FUNC_DESTROY) -# define TRIO_FUNC_DESTROY -# endif -# endif +#if defined(TRIO_FUNC_STRING_CREATE) +#if !defined(TRIO_FUNC_STRING_DESTROY) +#define TRIO_FUNC_STRING_DESTROY +#endif +#endif -# if defined(TRIO_FUNC_EQUAL_LOCALE) \ - || defined(TRIO_FUNC_STRING_EQUAL) \ - || defined(TRIO_FUNC_XSTRING_EQUAL) -# if !defined(TRIO_FUNC_EQUAL) -# define TRIO_FUNC_EQUAL -# endif -# endif +#if defined(TRIO_FUNC_STRING_DESTROY) || defined(TRIO_FUNC_XSTRING_SET) +#if !defined(TRIO_FUNC_DESTROY) +#define TRIO_FUNC_DESTROY +#endif +#endif -# if defined(TRIO_FUNC_EQUAL_CASE) \ - || defined(TRIO_FUNC_STRING_EQUAL_CASE) \ - || defined(TRIO_FUNC_XSTRING_EQUAL_CASE) -# if !defined(TRIO_FUNC_EQUAL_CASE) -# define TRIO_FUNC_EQUAL_CASE -# endif -# endif +#if defined(TRIO_FUNC_EQUAL_LOCALE) || defined(TRIO_FUNC_STRING_EQUAL) || \ + defined(TRIO_FUNC_XSTRING_EQUAL) +#if !defined(TRIO_FUNC_EQUAL) +#define TRIO_FUNC_EQUAL +#endif +#endif -# if defined(TRIO_FUNC_SUBSTRING_MAX) \ - || defined(TRIO_FUNC_STRING_EQUAL_MAX) \ - || defined(TRIO_FUNC_XSTRING_EQUAL_MAX) -# if !defined(TRIO_FUNC_EQUAL_MAX) -# define TRIO_FUNC_EQUAL_MAX -# endif -# endif +#if defined(TRIO_FUNC_EQUAL_CASE) || defined(TRIO_FUNC_STRING_EQUAL_CASE) || \ + defined(TRIO_FUNC_XSTRING_EQUAL_CASE) +#if !defined(TRIO_FUNC_EQUAL_CASE) +#define TRIO_FUNC_EQUAL_CASE +#endif +#endif -# if defined(TRIO_FUNC_TO_DOUBLE) \ - || defined(TRIO_FUNC_TO_FLOAT) -# if !defined(TRIO_FUNC_TO_LONG_DOUBLE) -# define TRIO_FUNC_TO_LONG_DOUBLE -# endif -# endif +#if defined(TRIO_FUNC_SUBSTRING_MAX) || defined(TRIO_FUNC_STRING_EQUAL_MAX) || \ + defined(TRIO_FUNC_XSTRING_EQUAL_MAX) +#if !defined(TRIO_FUNC_EQUAL_MAX) +#define TRIO_FUNC_EQUAL_MAX +#endif +#endif -# if defined(TRIO_FUNC_STRING_TERMINATE) -# if !defined(TRIO_FUNC_XSTRING_APPEND_CHAR) -# define TRIO_FUNC_XSTRING_APPEND_CHAR -# endif -# endif +#if defined(TRIO_FUNC_TO_DOUBLE) || defined(TRIO_FUNC_TO_FLOAT) +#if !defined(TRIO_FUNC_TO_LONG_DOUBLE) +#define TRIO_FUNC_TO_LONG_DOUBLE +#endif +#endif -# if defined(TRIO_FUNC_XSTRING_APPEND_CHAR) -# if !defined(TRIO_FUNC_STRING_SIZE) -# define TRIO_FUNC_STRING_SIZE -# endif -# endif +#if defined(TRIO_FUNC_STRING_TERMINATE) +#if !defined(TRIO_FUNC_XSTRING_APPEND_CHAR) +#define TRIO_FUNC_XSTRING_APPEND_CHAR +#endif +#endif + +#if defined(TRIO_FUNC_XSTRING_APPEND_CHAR) +#if !defined(TRIO_FUNC_STRING_SIZE) +#define TRIO_FUNC_STRING_SIZE +#endif +#endif #else @@ -139,539 +134,433 @@ enum { * When triostr is not embedded all functions are defined. */ -# define TRIO_FUNC_APPEND -# define TRIO_FUNC_APPEND_MAX -# define TRIO_FUNC_CONTAINS -# define TRIO_FUNC_COPY -# define TRIO_FUNC_COPY_MAX -# define TRIO_FUNC_CREATE -# define TRIO_FUNC_DESTROY -# define TRIO_FUNC_DUPLICATE -# define TRIO_FUNC_DUPLICATE_MAX -# define TRIO_FUNC_EQUAL -# define TRIO_FUNC_EQUAL_CASE -# define TRIO_FUNC_EQUAL_CASE_MAX -# define TRIO_FUNC_EQUAL_LOCALE -# define TRIO_FUNC_EQUAL_MAX -# define TRIO_FUNC_ERROR -# if !defined(TRIO_PLATFORM_WINCE) -# define TRIO_FUNC_FORMAT_DATE_MAX -# endif -# define TRIO_FUNC_HASH -# define TRIO_FUNC_INDEX -# define TRIO_FUNC_INDEX_LAST -# define TRIO_FUNC_LENGTH -# define TRIO_FUNC_LENGTH_MAX -# define TRIO_FUNC_LOWER -# define TRIO_FUNC_MATCH -# define TRIO_FUNC_MATCH_CASE -# define TRIO_FUNC_SPAN_FUNCTION -# define TRIO_FUNC_SUBSTRING -# define TRIO_FUNC_SUBSTRING_MAX -# define TRIO_FUNC_TO_DOUBLE -# define TRIO_FUNC_TO_FLOAT -# define TRIO_FUNC_TO_LONG -# define TRIO_FUNC_TO_LONG_DOUBLE -# define TRIO_FUNC_TO_LOWER -# define TRIO_FUNC_TO_UNSIGNED_LONG -# define TRIO_FUNC_TO_UPPER -# define TRIO_FUNC_TOKENIZE -# define TRIO_FUNC_UPPER +#define TRIO_FUNC_APPEND +#define TRIO_FUNC_APPEND_MAX +#define TRIO_FUNC_CONTAINS +#define TRIO_FUNC_COPY +#define TRIO_FUNC_COPY_MAX +#define TRIO_FUNC_CREATE +#define TRIO_FUNC_DESTROY +#define TRIO_FUNC_DUPLICATE +#define TRIO_FUNC_DUPLICATE_MAX +#define TRIO_FUNC_EQUAL +#define TRIO_FUNC_EQUAL_CASE +#define TRIO_FUNC_EQUAL_CASE_MAX +#define TRIO_FUNC_EQUAL_LOCALE +#define TRIO_FUNC_EQUAL_MAX +#define TRIO_FUNC_ERROR +#if !defined(TRIO_PLATFORM_WINCE) +#define TRIO_FUNC_FORMAT_DATE_MAX +#endif +#define TRIO_FUNC_HASH +#define TRIO_FUNC_INDEX +#define TRIO_FUNC_INDEX_LAST +#define TRIO_FUNC_LENGTH +#define TRIO_FUNC_LENGTH_MAX +#define TRIO_FUNC_LOWER +#define TRIO_FUNC_MATCH +#define TRIO_FUNC_MATCH_CASE +#define TRIO_FUNC_SPAN_FUNCTION +#define TRIO_FUNC_SUBSTRING +#define TRIO_FUNC_SUBSTRING_MAX +#define TRIO_FUNC_TO_DOUBLE +#define TRIO_FUNC_TO_FLOAT +#define TRIO_FUNC_TO_LONG +#define TRIO_FUNC_TO_LONG_DOUBLE +#define TRIO_FUNC_TO_LOWER +#define TRIO_FUNC_TO_UNSIGNED_LONG +#define TRIO_FUNC_TO_UPPER +#define TRIO_FUNC_TOKENIZE +#define TRIO_FUNC_UPPER -# define TRIO_FUNC_STRING_APPEND -# define TRIO_FUNC_STRING_CONTAINS -# define TRIO_FUNC_STRING_COPY -# define TRIO_FUNC_STRING_CREATE -# define TRIO_FUNC_STRING_DESTROY -# define TRIO_FUNC_STRING_DUPLICATE -# define TRIO_FUNC_STRING_EQUAL -# define TRIO_FUNC_STRING_EQUAL_CASE -# define TRIO_FUNC_STRING_EQUAL_CASE_MAX -# define TRIO_FUNC_STRING_EQUAL_MAX -# define TRIO_FUNC_STRING_EXTRACT -# if !defined(TRIO_PLATFORM_WINCE) -# define TRIO_FUNC_STRING_FORMAT_DATE_MAX -# endif -# define TRIO_FUNC_STRING_GET -# define TRIO_FUNC_STRING_INDEX -# define TRIO_FUNC_STRING_INDEX_LAST -# define TRIO_FUNC_STRING_LENGTH -# define TRIO_FUNC_STRING_LOWER -# define TRIO_FUNC_STRING_MATCH -# define TRIO_FUNC_STRING_MATCH_CASE -# define TRIO_FUNC_STRING_SIZE -# define TRIO_FUNC_STRING_SUBSTRING -# define TRIO_FUNC_STRING_TERMINATE -# define TRIO_FUNC_STRING_UPPER +#define TRIO_FUNC_STRING_APPEND +#define TRIO_FUNC_STRING_CONTAINS +#define TRIO_FUNC_STRING_COPY +#define TRIO_FUNC_STRING_CREATE +#define TRIO_FUNC_STRING_DESTROY +#define TRIO_FUNC_STRING_DUPLICATE +#define TRIO_FUNC_STRING_EQUAL +#define TRIO_FUNC_STRING_EQUAL_CASE +#define TRIO_FUNC_STRING_EQUAL_CASE_MAX +#define TRIO_FUNC_STRING_EQUAL_MAX +#define TRIO_FUNC_STRING_EXTRACT +#if !defined(TRIO_PLATFORM_WINCE) +#define TRIO_FUNC_STRING_FORMAT_DATE_MAX +#endif +#define TRIO_FUNC_STRING_GET +#define TRIO_FUNC_STRING_INDEX +#define TRIO_FUNC_STRING_INDEX_LAST +#define TRIO_FUNC_STRING_LENGTH +#define TRIO_FUNC_STRING_LOWER +#define TRIO_FUNC_STRING_MATCH +#define TRIO_FUNC_STRING_MATCH_CASE +#define TRIO_FUNC_STRING_SIZE +#define TRIO_FUNC_STRING_SUBSTRING +#define TRIO_FUNC_STRING_TERMINATE +#define TRIO_FUNC_STRING_UPPER -# define TRIO_FUNC_XSTRING_APPEND -# define TRIO_FUNC_XSTRING_APPEND_CHAR -# define TRIO_FUNC_XSTRING_APPEND_MAX -# define TRIO_FUNC_XSTRING_CONTAINS -# define TRIO_FUNC_XSTRING_COPY -# define TRIO_FUNC_XSTRING_DUPLICATE -# define TRIO_FUNC_XSTRING_EQUAL -# define TRIO_FUNC_XSTRING_EQUAL_CASE -# define TRIO_FUNC_XSTRING_EQUAL_CASE_MAX -# define TRIO_FUNC_XSTRING_EQUAL_MAX -# define TRIO_FUNC_XSTRING_MATCH -# define TRIO_FUNC_XSTRING_MATCH_CASE -# define TRIO_FUNC_XSTRING_SET -# define TRIO_FUNC_XSTRING_SUBSTRING +#define TRIO_FUNC_XSTRING_APPEND +#define TRIO_FUNC_XSTRING_APPEND_CHAR +#define TRIO_FUNC_XSTRING_APPEND_MAX +#define TRIO_FUNC_XSTRING_CONTAINS +#define TRIO_FUNC_XSTRING_COPY +#define TRIO_FUNC_XSTRING_DUPLICATE +#define TRIO_FUNC_XSTRING_EQUAL +#define TRIO_FUNC_XSTRING_EQUAL_CASE +#define TRIO_FUNC_XSTRING_EQUAL_CASE_MAX +#define TRIO_FUNC_XSTRING_EQUAL_MAX +#define TRIO_FUNC_XSTRING_MATCH +#define TRIO_FUNC_XSTRING_MATCH_CASE +#define TRIO_FUNC_XSTRING_SET +#define TRIO_FUNC_XSTRING_SUBSTRING #endif - -/************************************************************************* - * String functions - */ + /************************************************************************* + * String functions + */ #if defined(TRIO_FUNC_APPEND) -TRIO_PUBLIC_STRING int -trio_append -TRIO_PROTO((char *target, TRIO_CONST char *source)); + TRIO_PUBLIC_STRING int trio_append TRIO_PROTO((char* target, TRIO_CONST char* source)); #endif #if defined(TRIO_FUNC_APPEND_MAX) -TRIO_PUBLIC_STRING int -trio_append_max -TRIO_PROTO((char *target, size_t max, TRIO_CONST char *source)); + TRIO_PUBLIC_STRING int trio_append_max TRIO_PROTO((char* target, size_t max, + TRIO_CONST char* source)); #endif #if defined(TRIO_FUNC_CONTAINS) -TRIO_PUBLIC_STRING int -trio_contains -TRIO_PROTO((TRIO_CONST char *string, TRIO_CONST char *substring)); + TRIO_PUBLIC_STRING int trio_contains TRIO_PROTO((TRIO_CONST char* string, + TRIO_CONST char* substring)); #endif #if defined(TRIO_FUNC_COPY) -TRIO_PUBLIC_STRING int -trio_copy -TRIO_PROTO((char *target, TRIO_CONST char *source)); + TRIO_PUBLIC_STRING int trio_copy TRIO_PROTO((char* target, TRIO_CONST char* source)); #endif #if defined(TRIO_FUNC_COPY_MAX) -TRIO_PUBLIC_STRING int -trio_copy_max -TRIO_PROTO((char *target, size_t max, TRIO_CONST char *source)); + TRIO_PUBLIC_STRING int trio_copy_max TRIO_PROTO((char* target, size_t max, + TRIO_CONST char* source)); #endif #if defined(TRIO_FUNC_CREATE) -TRIO_PUBLIC_STRING char * -trio_create -TRIO_PROTO((size_t size)); + TRIO_PUBLIC_STRING char* trio_create TRIO_PROTO((size_t size)); #endif #if defined(TRIO_FUNC_DESTROY) -TRIO_PUBLIC_STRING void -trio_destroy -TRIO_PROTO((char *string)); + TRIO_PUBLIC_STRING void trio_destroy TRIO_PROTO((char* string)); #endif #if defined(TRIO_FUNC_DUPLICATE) -TRIO_PUBLIC_STRING char * -trio_duplicate -TRIO_PROTO((TRIO_CONST char *source)); + TRIO_PUBLIC_STRING char* trio_duplicate TRIO_PROTO((TRIO_CONST char* source)); #endif #if defined(TRIO_FUNC_DUPLICATE_MAX) -TRIO_PUBLIC_STRING char * -trio_duplicate_max -TRIO_PROTO((TRIO_CONST char *source, size_t max)); + TRIO_PUBLIC_STRING char* trio_duplicate_max TRIO_PROTO((TRIO_CONST char* source, size_t max)); #endif #if defined(TRIO_FUNC_EQUAL) -TRIO_PUBLIC_STRING int -trio_equal -TRIO_PROTO((TRIO_CONST char *first, TRIO_CONST char *second)); + TRIO_PUBLIC_STRING int trio_equal TRIO_PROTO((TRIO_CONST char* first, TRIO_CONST char* second)); #endif #if defined(TRIO_FUNC_EQUAL_CASE) -TRIO_PUBLIC_STRING int -trio_equal_case -TRIO_PROTO((TRIO_CONST char *first, TRIO_CONST char *second)); + TRIO_PUBLIC_STRING int trio_equal_case TRIO_PROTO((TRIO_CONST char* first, + TRIO_CONST char* second)); #endif #if defined(TRIO_FUNC_EQUAL_CASE_MAX) -TRIO_PUBLIC_STRING int -trio_equal_case_max -TRIO_PROTO((TRIO_CONST char *first, size_t max, TRIO_CONST char *second)); + TRIO_PUBLIC_STRING int trio_equal_case_max TRIO_PROTO((TRIO_CONST char* first, size_t max, + TRIO_CONST char* second)); #endif #if defined(TRIO_FUNC_EQUAL_LOCALE) -TRIO_PUBLIC_STRING int -trio_equal_locale -TRIO_PROTO((TRIO_CONST char *first, TRIO_CONST char *second)); + TRIO_PUBLIC_STRING int trio_equal_locale TRIO_PROTO((TRIO_CONST char* first, + TRIO_CONST char* second)); #endif #if defined(TRIO_FUNC_EQUAL_MAX) -TRIO_PUBLIC_STRING int -trio_equal_max -TRIO_PROTO((TRIO_CONST char *first, size_t max, TRIO_CONST char *second)); + TRIO_PUBLIC_STRING int trio_equal_max TRIO_PROTO((TRIO_CONST char* first, size_t max, + TRIO_CONST char* second)); #endif #if defined(TRIO_FUNC_ERROR) -TRIO_PUBLIC_STRING TRIO_CONST char * -trio_error -TRIO_PROTO((int)); + TRIO_PUBLIC_STRING TRIO_CONST char* trio_error TRIO_PROTO((int)); #endif #if defined(TRIO_FUNC_FORMAT_DATE_MAX) -TRIO_PUBLIC_STRING size_t -trio_format_date_max -TRIO_PROTO((char *target, size_t max, TRIO_CONST char *format, TRIO_CONST struct tm *datetime)); + TRIO_PUBLIC_STRING size_t trio_format_date_max TRIO_PROTO((char* target, size_t max, + TRIO_CONST char* format, + TRIO_CONST struct tm* datetime)); #endif #if defined(TRIO_FUNC_HASH) -TRIO_PUBLIC_STRING unsigned long -trio_hash -TRIO_PROTO((TRIO_CONST char *string, int type)); + TRIO_PUBLIC_STRING unsigned long trio_hash TRIO_PROTO((TRIO_CONST char* string, int type)); #endif #if defined(TRIO_FUNC_INDEX) -TRIO_PUBLIC_STRING char * -trio_index -TRIO_PROTO((TRIO_CONST char *string, int character)); + TRIO_PUBLIC_STRING char* trio_index TRIO_PROTO((TRIO_CONST char* string, int character)); #endif #if defined(TRIO_FUNC_INDEX_LAST) -TRIO_PUBLIC_STRING char * -trio_index_last -TRIO_PROTO((TRIO_CONST char *string, int character)); + TRIO_PUBLIC_STRING char* trio_index_last TRIO_PROTO((TRIO_CONST char* string, int character)); #endif #if defined(TRIO_FUNC_LENGTH) -TRIO_PUBLIC_STRING size_t -trio_length -TRIO_PROTO((TRIO_CONST char *string)); + TRIO_PUBLIC_STRING size_t trio_length TRIO_PROTO((TRIO_CONST char* string)); #endif #if defined(TRIO_FUNC_LENGTH_MAX) -TRIO_PUBLIC_STRING size_t -trio_length_max -TRIO_PROTO((TRIO_CONST char *string, size_t max)); + TRIO_PUBLIC_STRING size_t trio_length_max TRIO_PROTO((TRIO_CONST char* string, size_t max)); #endif #if defined(TRIO_FUNC_LOWER) -TRIO_PUBLIC_STRING int -trio_lower -TRIO_PROTO((char *target)); + TRIO_PUBLIC_STRING int trio_lower TRIO_PROTO((char* target)); #endif #if defined(TRIO_FUNC_MATCH) -TRIO_PUBLIC_STRING int -trio_match -TRIO_PROTO((TRIO_CONST char *string, TRIO_CONST char *pattern)); + TRIO_PUBLIC_STRING int trio_match TRIO_PROTO((TRIO_CONST char* string, + TRIO_CONST char* pattern)); #endif #if defined(TRIO_FUNC_MATCH_CASE) -TRIO_PUBLIC_STRING int -trio_match_case -TRIO_PROTO((TRIO_CONST char *string, TRIO_CONST char *pattern)); + TRIO_PUBLIC_STRING int trio_match_case TRIO_PROTO((TRIO_CONST char* string, + TRIO_CONST char* pattern)); #endif #if defined(TRIO_FUNC_SPAN_FUNCTION) -TRIO_PUBLIC_STRING size_t -trio_span_function -TRIO_PROTO((char *target, TRIO_CONST char *source, int (*Function) TRIO_PROTO((int)))); + TRIO_PUBLIC_STRING size_t trio_span_function TRIO_PROTO((char* target, TRIO_CONST char* source, + int(*Function) TRIO_PROTO((int)))); #endif #if defined(TRIO_FUNC_SUBSTRING) -TRIO_PUBLIC_STRING char * -trio_substring -TRIO_PROTO((TRIO_CONST char *string, TRIO_CONST char *substring)); + TRIO_PUBLIC_STRING char* trio_substring TRIO_PROTO((TRIO_CONST char* string, + TRIO_CONST char* substring)); #endif #if defined(TRIO_FUNC_SUBSTRING_MAX) -TRIO_PUBLIC_STRING char * -trio_substring_max -TRIO_PROTO((TRIO_CONST char *string, size_t max, TRIO_CONST char *substring)); + TRIO_PUBLIC_STRING char* trio_substring_max TRIO_PROTO((TRIO_CONST char* string, size_t max, + TRIO_CONST char* substring)); #endif #if defined(TRIO_FUNC_TO_DOUBLE) -TRIO_PUBLIC_STRING double -trio_to_double -TRIO_PROTO((TRIO_CONST char *source, char **endp)); + TRIO_PUBLIC_STRING double trio_to_double TRIO_PROTO((TRIO_CONST char* source, char** endp)); #endif #if defined(TRIO_FUNC_TO_FLOAT) -TRIO_PUBLIC_STRING float -trio_to_float -TRIO_PROTO((TRIO_CONST char *source, char **endp)); + TRIO_PUBLIC_STRING float trio_to_float TRIO_PROTO((TRIO_CONST char* source, char** endp)); #endif #if defined(TRIO_FUNC_TO_LONG) -TRIO_PUBLIC_STRING long -trio_to_long -TRIO_PROTO((TRIO_CONST char *source, char **endp, int base)); + TRIO_PUBLIC_STRING long trio_to_long TRIO_PROTO((TRIO_CONST char* source, char** endp, + int base)); #endif #if defined(TRIO_FUNC_TO_LOWER) -TRIO_PUBLIC_STRING int -trio_to_lower -TRIO_PROTO((int source)); + TRIO_PUBLIC_STRING int trio_to_lower TRIO_PROTO((int source)); #endif #if defined(TRIO_FUNC_TO_LONG_DOUBLE) -TRIO_PUBLIC_STRING trio_long_double_t -trio_to_long_double -TRIO_PROTO((TRIO_CONST char *source, char **endp)); + TRIO_PUBLIC_STRING trio_long_double_t trio_to_long_double TRIO_PROTO((TRIO_CONST char* source, + char** endp)); #endif #if defined(TRIO_FUNC_TO_UNSIGNED_LONG) -TRIO_PUBLIC_STRING unsigned long -trio_to_unsigned_long -TRIO_PROTO((TRIO_CONST char *source, char **endp, int base)); + TRIO_PUBLIC_STRING unsigned long trio_to_unsigned_long TRIO_PROTO((TRIO_CONST char* source, + char** endp, int base)); #endif #if defined(TRIO_FUNC_TO_UPPER) -TRIO_PUBLIC_STRING int -trio_to_upper -TRIO_PROTO((int source)); + TRIO_PUBLIC_STRING int trio_to_upper TRIO_PROTO((int source)); #endif #if defined(TRIO_FUNC_TOKENIZE) -TRIO_PUBLIC_STRING char * -trio_tokenize -TRIO_PROTO((char *string, TRIO_CONST char *delimiters)); + TRIO_PUBLIC_STRING char* trio_tokenize TRIO_PROTO((char* string, TRIO_CONST char* delimiters)); #endif #if defined(TRIO_FUNC_UPPER) -TRIO_PUBLIC_STRING int -trio_upper -TRIO_PROTO((char *target)); + TRIO_PUBLIC_STRING int trio_upper TRIO_PROTO((char* target)); #endif -/************************************************************************* - * Dynamic string functions - */ + /************************************************************************* + * Dynamic string functions + */ -/* - * Opaque type for dynamic strings - */ + /* + * Opaque type for dynamic strings + */ -typedef struct _trio_string_t trio_string_t; + typedef struct _trio_string_t trio_string_t; #if defined(TRIO_FUNC_STRING_APPEND) -TRIO_PUBLIC_STRING int -trio_string_append -TRIO_PROTO((trio_string_t *self, trio_string_t *other)); + TRIO_PUBLIC_STRING int trio_string_append TRIO_PROTO((trio_string_t * self, + trio_string_t* other)); #endif #if defined(TRIO_FUNC_STRING_CONTAINS) -TRIO_PUBLIC_STRING int -trio_string_contains -TRIO_PROTO((trio_string_t *self, trio_string_t *other)); + TRIO_PUBLIC_STRING int trio_string_contains TRIO_PROTO((trio_string_t * self, + trio_string_t* other)); #endif #if defined(TRIO_FUNC_STRING_COPY) -TRIO_PUBLIC_STRING int -trio_string_copy -TRIO_PROTO((trio_string_t *self, trio_string_t *other)); + TRIO_PUBLIC_STRING int trio_string_copy TRIO_PROTO((trio_string_t * self, + trio_string_t* other)); #endif #if defined(TRIO_FUNC_STRING_CREATE) -TRIO_PUBLIC_STRING trio_string_t * -trio_string_create -TRIO_PROTO((int initial_size)); + TRIO_PUBLIC_STRING trio_string_t* trio_string_create TRIO_PROTO((int initial_size)); #endif #if defined(TRIO_FUNC_STRING_DESTROY) -TRIO_PUBLIC_STRING void -trio_string_destroy -TRIO_PROTO((trio_string_t *self)); + TRIO_PUBLIC_STRING void trio_string_destroy TRIO_PROTO((trio_string_t * self)); #endif #if defined(TRIO_FUNC_STRING_DUPLICATE) -TRIO_PUBLIC_STRING trio_string_t * -trio_string_duplicate -TRIO_PROTO((trio_string_t *other)); + TRIO_PUBLIC_STRING trio_string_t* trio_string_duplicate TRIO_PROTO((trio_string_t * other)); #endif #if defined(TRIO_FUNC_STRING_EQUAL) -TRIO_PUBLIC_STRING int -trio_string_equal -TRIO_PROTO((trio_string_t *self, trio_string_t *other)); + TRIO_PUBLIC_STRING int trio_string_equal TRIO_PROTO((trio_string_t * self, + trio_string_t* other)); #endif #if defined(TRIO_FUNC_STRING_EQUAL_MAX) -TRIO_PUBLIC_STRING int -trio_string_equal_max -TRIO_PROTO((trio_string_t *self, size_t max, trio_string_t *second)); + TRIO_PUBLIC_STRING int trio_string_equal_max TRIO_PROTO((trio_string_t * self, size_t max, + trio_string_t* second)); #endif #if defined(TRIO_FUNC_STRING_EQUAL_CASE) -TRIO_PUBLIC_STRING int -trio_string_equal_case -TRIO_PROTO((trio_string_t *self, trio_string_t *other)); + TRIO_PUBLIC_STRING int trio_string_equal_case TRIO_PROTO((trio_string_t * self, + trio_string_t* other)); #endif #if defined(TRIO_FUNC_STRING_EQUAL_CASE_MAX) -TRIO_PUBLIC_STRING int -trio_string_equal_case_max -TRIO_PROTO((trio_string_t *self, size_t max, trio_string_t *other)); + TRIO_PUBLIC_STRING int trio_string_equal_case_max TRIO_PROTO((trio_string_t * self, size_t max, + trio_string_t* other)); #endif #if defined(TRIO_FUNC_STRING_EXTRACT) -TRIO_PUBLIC_STRING char * -trio_string_extract -TRIO_PROTO((trio_string_t *self)); + TRIO_PUBLIC_STRING char* trio_string_extract TRIO_PROTO((trio_string_t * self)); #endif #if defined(TRIO_FUNC_STRING_FORMAT_DATE_MAX) -TRIO_PUBLIC_STRING size_t -trio_string_format_date_max -TRIO_PROTO((trio_string_t *self, size_t max, TRIO_CONST char *format, TRIO_CONST struct tm *datetime)); + TRIO_PUBLIC_STRING size_t trio_string_format_date_max TRIO_PROTO(( + trio_string_t * self, size_t max, TRIO_CONST char* format, TRIO_CONST struct tm* datetime)); #endif #if defined(TRIO_FUNC_STRING_GET) -TRIO_PUBLIC_STRING char * -trio_string_get -TRIO_PROTO((trio_string_t *self, int offset)); + TRIO_PUBLIC_STRING char* trio_string_get TRIO_PROTO((trio_string_t * self, int offset)); #endif #if defined(TRIO_FUNC_STRING_INDEX) -TRIO_PUBLIC_STRING char * -trio_string_index -TRIO_PROTO((trio_string_t *self, int character)); + TRIO_PUBLIC_STRING char* trio_string_index TRIO_PROTO((trio_string_t * self, int character)); #endif #if defined(TRIO_FUNC_STRING_INDEX_LAST) -TRIO_PUBLIC_STRING char * -trio_string_index_last -TRIO_PROTO((trio_string_t *self, int character)); + TRIO_PUBLIC_STRING char* trio_string_index_last TRIO_PROTO((trio_string_t * self, + int character)); #endif #if defined(TRIO_FUNC_STRING_LENGTH) -TRIO_PUBLIC_STRING int -trio_string_length -TRIO_PROTO((trio_string_t *self)); + TRIO_PUBLIC_STRING int trio_string_length TRIO_PROTO((trio_string_t * self)); #endif #if defined(TRIO_FUNC_STRING_LOWER) -TRIO_PUBLIC_STRING int -trio_string_lower -TRIO_PROTO((trio_string_t *self)); + TRIO_PUBLIC_STRING int trio_string_lower TRIO_PROTO((trio_string_t * self)); #endif #if defined(TRIO_FUNC_STRING_MATCH) -TRIO_PUBLIC_STRING int -trio_string_match -TRIO_PROTO((trio_string_t *self, trio_string_t *other)); + TRIO_PUBLIC_STRING int trio_string_match TRIO_PROTO((trio_string_t * self, + trio_string_t* other)); #endif #if defined(TRIO_FUNC_STRING_MATCH_CASE) -TRIO_PUBLIC_STRING int -trio_string_match_case -TRIO_PROTO((trio_string_t *self, trio_string_t *other)); + TRIO_PUBLIC_STRING int trio_string_match_case TRIO_PROTO((trio_string_t * self, + trio_string_t* other)); #endif #if defined(TRIO_FUNC_STRING_SIZE) -TRIO_PUBLIC_STRING int -trio_string_size -TRIO_PROTO((trio_string_t *self)); + TRIO_PUBLIC_STRING int trio_string_size TRIO_PROTO((trio_string_t * self)); #endif #if defined(TRIO_FUNC_STRING_SUBSTRING) -TRIO_PUBLIC_STRING char * -trio_string_substring -TRIO_PROTO((trio_string_t *self, trio_string_t *other)); + TRIO_PUBLIC_STRING char* trio_string_substring TRIO_PROTO((trio_string_t * self, + trio_string_t* other)); #endif #if defined(TRIO_FUNC_STRING_TERMINATE) -TRIO_PUBLIC_STRING void -trio_string_terminate -TRIO_PROTO((trio_string_t *self)); + TRIO_PUBLIC_STRING void trio_string_terminate TRIO_PROTO((trio_string_t * self)); #endif #if defined(TRIO_FUNC_STRING_UPPER) -TRIO_PUBLIC_STRING int -trio_string_upper -TRIO_PROTO((trio_string_t *self)); + TRIO_PUBLIC_STRING int trio_string_upper TRIO_PROTO((trio_string_t * self)); #endif #if defined(TRIO_FUNC_XSTRING_APPEND) -TRIO_PUBLIC_STRING int -trio_xstring_append -TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); + TRIO_PUBLIC_STRING int trio_xstring_append TRIO_PROTO((trio_string_t * self, + TRIO_CONST char* other)); #endif #if defined(TRIO_FUNC_XSTRING_APPEND_CHAR) -TRIO_PUBLIC_STRING int -trio_xstring_append_char -TRIO_PROTO((trio_string_t *self, char character)); + TRIO_PUBLIC_STRING int trio_xstring_append_char TRIO_PROTO((trio_string_t * self, + char character)); #endif #if defined(TRIO_FUNC_XSTRING_APPEND_MAX) -TRIO_PUBLIC_STRING int -trio_xstring_append_max -TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other, size_t max)); + TRIO_PUBLIC_STRING int trio_xstring_append_max TRIO_PROTO((trio_string_t * self, + TRIO_CONST char* other, size_t max)); #endif #if defined(TRIO_FUNC_XSTRING_CONTAINS) -TRIO_PUBLIC_STRING int -trio_xstring_contains -TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); + TRIO_PUBLIC_STRING int trio_xstring_contains TRIO_PROTO((trio_string_t * self, + TRIO_CONST char* other)); #endif #if defined(TRIO_FUNC_XSTRING_COPY) -TRIO_PUBLIC_STRING int -trio_xstring_copy -TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); + TRIO_PUBLIC_STRING int trio_xstring_copy TRIO_PROTO((trio_string_t * self, + TRIO_CONST char* other)); #endif #if defined(TRIO_FUNC_XSTRING_DUPLICATE) -TRIO_PUBLIC_STRING trio_string_t * -trio_xstring_duplicate -TRIO_PROTO((TRIO_CONST char *other)); + TRIO_PUBLIC_STRING trio_string_t* trio_xstring_duplicate TRIO_PROTO((TRIO_CONST char* other)); #endif #if defined(TRIO_FUNC_XSTRING_EQUAL) -TRIO_PUBLIC_STRING int -trio_xstring_equal -TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); + TRIO_PUBLIC_STRING int trio_xstring_equal TRIO_PROTO((trio_string_t * self, + TRIO_CONST char* other)); #endif #if defined(TRIO_FUNC_XSTRING_EQUAL_MAX) -TRIO_PUBLIC_STRING int -trio_xstring_equal_max -TRIO_PROTO((trio_string_t *self, size_t max, TRIO_CONST char *other)); + TRIO_PUBLIC_STRING int trio_xstring_equal_max TRIO_PROTO((trio_string_t * self, size_t max, + TRIO_CONST char* other)); #endif #if defined(TRIO_FUNC_XSTRING_EQUAL_CASE) -TRIO_PUBLIC_STRING int -trio_xstring_equal_case -TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); + TRIO_PUBLIC_STRING int trio_xstring_equal_case TRIO_PROTO((trio_string_t * self, + TRIO_CONST char* other)); #endif #if defined(TRIO_FUNC_XSTRING_EQUAL_CASE_MAX) -TRIO_PUBLIC_STRING int -trio_xstring_equal_case_max -TRIO_PROTO((trio_string_t *self, size_t max, TRIO_CONST char *other)); + TRIO_PUBLIC_STRING int trio_xstring_equal_case_max TRIO_PROTO((trio_string_t * self, size_t max, + TRIO_CONST char* other)); #endif #if defined(TRIO_FUNC_XSTRING_MATCH) -TRIO_PUBLIC_STRING int -trio_xstring_match -TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); + TRIO_PUBLIC_STRING int trio_xstring_match TRIO_PROTO((trio_string_t * self, + TRIO_CONST char* other)); #endif #if defined(TRIO_FUNC_XSTRING_MATCH_CASE) -TRIO_PUBLIC_STRING int -trio_xstring_match_case -TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); + TRIO_PUBLIC_STRING int trio_xstring_match_case TRIO_PROTO((trio_string_t * self, + TRIO_CONST char* other)); #endif #if defined(TRIO_FUNC_XSTRING_SET) -TRIO_PUBLIC_STRING void -trio_xstring_set -TRIO_PROTO((trio_string_t *self, char *buffer)); + TRIO_PUBLIC_STRING void trio_xstring_set TRIO_PROTO((trio_string_t * self, char* buffer)); #endif #if defined(TRIO_FUNC_XSTRING_SUBSTRING) -TRIO_PUBLIC_STRING char * -trio_xstring_substring -TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); + TRIO_PUBLIC_STRING char* trio_xstring_substring TRIO_PROTO((trio_string_t * self, + TRIO_CONST char* other)); #endif #ifdef __cplusplus diff --git a/winpr/libwinpr/utils/winpr.c b/winpr/libwinpr/utils/winpr.c index 1e72cf9fb..352229ad2 100644 --- a/winpr/libwinpr/utils/winpr.c +++ b/winpr/libwinpr/utils/winpr.c @@ -66,12 +66,11 @@ const char* winpr_get_build_revision(void) const char* winpr_get_build_config(void) { static const char build_config[] = - "Build configuration: " BUILD_CONFIG "\n" - "Build type: " BUILD_TYPE "\n" - "CFLAGS: " CFLAGS "\n" - "Compiler: " COMPILER_ID ", " COMPILER_VERSION "\n" - "Target architecture: " TARGET_ARCH "\n"; + "Build configuration: " BUILD_CONFIG "\n" + "Build type: " BUILD_TYPE "\n" + "CFLAGS: " CFLAGS "\n" + "Compiler: " COMPILER_ID ", " COMPILER_VERSION "\n" + "Target architecture: " TARGET_ARCH "\n"; return build_config; } - diff --git a/winpr/libwinpr/utils/wlog/Appender.c b/winpr/libwinpr/utils/wlog/Appender.c index 4a5324afb..90dee75ca 100644 --- a/winpr/libwinpr/utils/wlog/Appender.c +++ b/winpr/libwinpr/utils/wlog/Appender.c @@ -102,39 +102,40 @@ wLogAppender* WLog_Appender_New(wLog* log, DWORD logAppenderType) switch (logAppenderType) { - case WLOG_APPENDER_CONSOLE: - appender = WLog_ConsoleAppender_New(log); - break; - case WLOG_APPENDER_FILE: - appender = WLog_FileAppender_New(log); - break; - case WLOG_APPENDER_BINARY: - appender = WLog_BinaryAppender_New(log); - break; - case WLOG_APPENDER_CALLBACK: - appender = WLog_CallbackAppender_New(log); - break; + case WLOG_APPENDER_CONSOLE: + appender = WLog_ConsoleAppender_New(log); + break; + case WLOG_APPENDER_FILE: + appender = WLog_FileAppender_New(log); + break; + case WLOG_APPENDER_BINARY: + appender = WLog_BinaryAppender_New(log); + break; + case WLOG_APPENDER_CALLBACK: + appender = WLog_CallbackAppender_New(log); + break; #ifdef HAVE_SYSLOG_H - case WLOG_APPENDER_SYSLOG: - appender = WLog_SyslogAppender_New(log); - break; + case WLOG_APPENDER_SYSLOG: + appender = WLog_SyslogAppender_New(log); + break; #endif #ifdef HAVE_JOURNALD_H - case WLOG_APPENDER_JOURNALD: - appender = WLog_JournaldAppender_New(log); - break; + case WLOG_APPENDER_JOURNALD: + appender = WLog_JournaldAppender_New(log); + break; #endif - case WLOG_APPENDER_UDP: - appender = (wLogAppender*) WLog_UdpAppender_New(log); - break; - default: - fprintf(stderr, "%s: unknown handler type %"PRIu32"\n", __FUNCTION__, logAppenderType); - appender = NULL; - break; + case WLOG_APPENDER_UDP: + appender = (wLogAppender*)WLog_UdpAppender_New(log); + break; + default: + fprintf(stderr, "%s: unknown handler type %" PRIu32 "\n", __FUNCTION__, + logAppenderType); + appender = NULL; + break; } if (!appender) - appender = (wLogAppender*) WLog_ConsoleAppender_New(log); + appender = (wLogAppender*)WLog_ConsoleAppender_New(log); if (!appender) return NULL; @@ -165,7 +166,7 @@ BOOL WLog_SetLogAppenderType(wLog* log, DWORD logAppenderType) return log->Appender != NULL; } -BOOL WLog_ConfigureAppender(wLogAppender *appender, const char *setting, void *value) +BOOL WLog_ConfigureAppender(wLogAppender* appender, const char* setting, void* value) { /* Just check the settings string is not empty */ if (!appender || !setting || (strnlen(setting, 2) == 0)) @@ -175,5 +176,4 @@ BOOL WLog_ConfigureAppender(wLogAppender *appender, const char *setting, void *v return appender->Set(appender, setting, value); else return FALSE; - } diff --git a/winpr/libwinpr/utils/wlog/Appender.h b/winpr/libwinpr/utils/wlog/Appender.h index 45aac3601..e834dcca0 100644 --- a/winpr/libwinpr/utils/wlog/Appender.h +++ b/winpr/libwinpr/utils/wlog/Appender.h @@ -37,4 +37,3 @@ void WLog_Appender_Free(wLog* log, wLogAppender* appender); #endif /* WINPR_WLOG_APPENDER_PRIVATE_H */ - diff --git a/winpr/libwinpr/utils/wlog/BinaryAppender.c b/winpr/libwinpr/utils/wlog/BinaryAppender.c index dcfb0e767..2997cd2d4 100644 --- a/winpr/libwinpr/utils/wlog/BinaryAppender.c +++ b/winpr/libwinpr/utils/wlog/BinaryAppender.c @@ -29,7 +29,6 @@ #include #include - struct _wLogBinaryAppender { WLOG_APPENDER_COMMON(); @@ -47,13 +46,13 @@ static BOOL WLog_BinaryAppender_Open(wLog* log, wLogAppender* appender) if (!log || !appender) return FALSE; - binaryAppender = (wLogBinaryAppender *)appender; + binaryAppender = (wLogBinaryAppender*)appender; if (!binaryAppender->FileName) { - binaryAppender->FileName = (char*) malloc(MAX_PATH); + binaryAppender->FileName = (char*)malloc(MAX_PATH); if (!binaryAppender->FileName) return FALSE; - sprintf_s(binaryAppender->FileName, MAX_PATH, "%"PRIu32".wlog", GetCurrentProcessId()); + sprintf_s(binaryAppender->FileName, MAX_PATH, "%" PRIu32 ".wlog", GetCurrentProcessId()); } if (!binaryAppender->FilePath) @@ -65,7 +64,8 @@ static BOOL WLog_BinaryAppender_Open(wLog* log, wLogAppender* appender) if (!binaryAppender->FullFileName) { - binaryAppender->FullFileName = GetCombinedPath(binaryAppender->FilePath, binaryAppender->FileName); + binaryAppender->FullFileName = + GetCombinedPath(binaryAppender->FilePath, binaryAppender->FileName); if (!binaryAppender->FullFileName) return FALSE; } @@ -92,7 +92,7 @@ static BOOL WLog_BinaryAppender_Close(wLog* log, wLogAppender* appender) if (!appender) return FALSE; - binaryAppender = (wLogBinaryAppender *)appender; + binaryAppender = (wLogBinaryAppender*)appender; if (!binaryAppender->FileDescriptor) return TRUE; @@ -103,7 +103,8 @@ static BOOL WLog_BinaryAppender_Close(wLog* log, wLogAppender* appender) return TRUE; } -static BOOL WLog_BinaryAppender_WriteMessage(wLog* log, wLogAppender* appender, wLogMessage* message) +static BOOL WLog_BinaryAppender_WriteMessage(wLog* log, wLogAppender* appender, + wLogMessage* message) { FILE* fp; wStream* s; @@ -117,7 +118,7 @@ static BOOL WLog_BinaryAppender_WriteMessage(wLog* log, wLogAppender* appender, if (!log || !appender || !message) return FALSE; - binaryAppender = (wLogBinaryAppender *)appender; + binaryAppender = (wLogBinaryAppender*)appender; fp = binaryAppender->FileDescriptor; @@ -128,12 +129,11 @@ static BOOL WLog_BinaryAppender_WriteMessage(wLog* log, wLogAppender* appender, FunctionNameLength = strnlen(message->FunctionName, UINT32_MAX); TextStringLength = strnlen(message->TextString, UINT32_MAX); - MessageLength = 16 + - (4 + FileNameLength + 1) + - (4 + FunctionNameLength + 1) + - (4 + TextStringLength + 1); + MessageLength = + 16 + (4 + FileNameLength + 1) + (4 + FunctionNameLength + 1) + (4 + TextStringLength + 1); - if ((MessageLength > UINT32_MAX) || (FileNameLength > UINT32_MAX) || (FunctionNameLength > UINT32_MAX) || (TextStringLength > UINT32_MAX)) + if ((MessageLength > UINT32_MAX) || (FileNameLength > UINT32_MAX) || + (FunctionNameLength > UINT32_MAX) || (TextStringLength > UINT32_MAX)) return FALSE; s = Stream_New(NULL, MessageLength); @@ -166,19 +166,21 @@ static BOOL WLog_BinaryAppender_WriteMessage(wLog* log, wLogAppender* appender, return ret; } -static BOOL WLog_BinaryAppender_WriteDataMessage(wLog* log, wLogAppender* appender, wLogMessage* message) +static BOOL WLog_BinaryAppender_WriteDataMessage(wLog* log, wLogAppender* appender, + wLogMessage* message) { return TRUE; } -static BOOL WLog_BinaryAppender_WriteImageMessage(wLog* log, wLogAppender* appender, wLogMessage* message) +static BOOL WLog_BinaryAppender_WriteImageMessage(wLog* log, wLogAppender* appender, + wLogMessage* message) { return TRUE; } -static BOOL WLog_BinaryAppender_Set(wLogAppender* appender, const char *setting, void *value) +static BOOL WLog_BinaryAppender_Set(wLogAppender* appender, const char* setting, void* value) { - wLogBinaryAppender *binaryAppender = (wLogBinaryAppender *) appender; + wLogBinaryAppender* binaryAppender = (wLogBinaryAppender*)appender; /* Just check if the value string is longer than 0 */ if (!value || (strnlen(value, 2) == 0)) @@ -186,13 +188,13 @@ static BOOL WLog_BinaryAppender_Set(wLogAppender* appender, const char *setting, if (!strcmp("outputfilename", setting)) { - binaryAppender->FileName = _strdup((const char *)value); + binaryAppender->FileName = _strdup((const char*)value); if (!binaryAppender->FileName) return FALSE; } else if (!strcmp("outputfilepath", setting)) { - binaryAppender->FilePath = _strdup((const char *)value); + binaryAppender->FilePath = _strdup((const char*)value); if (!binaryAppender->FilePath) return FALSE; } @@ -204,10 +206,10 @@ static BOOL WLog_BinaryAppender_Set(wLogAppender* appender, const char *setting, static void WLog_BinaryAppender_Free(wLogAppender* appender) { - wLogBinaryAppender *binaryAppender; + wLogBinaryAppender* binaryAppender; if (appender) { - binaryAppender = (wLogBinaryAppender *)appender; + binaryAppender = (wLogBinaryAppender*)appender; free(binaryAppender->FileName); free(binaryAppender->FilePath); free(binaryAppender->FullFileName); @@ -219,7 +221,7 @@ wLogAppender* WLog_BinaryAppender_New(wLog* log) { wLogBinaryAppender* BinaryAppender; - BinaryAppender = (wLogBinaryAppender*) calloc(1, sizeof(wLogBinaryAppender)); + BinaryAppender = (wLogBinaryAppender*)calloc(1, sizeof(wLogBinaryAppender)); if (!BinaryAppender) return NULL; @@ -232,5 +234,5 @@ wLogAppender* WLog_BinaryAppender_New(wLog* log) BinaryAppender->Free = WLog_BinaryAppender_Free; BinaryAppender->Set = WLog_BinaryAppender_Set; - return (wLogAppender *)BinaryAppender; + return (wLogAppender*)BinaryAppender; } diff --git a/winpr/libwinpr/utils/wlog/CallbackAppender.c b/winpr/libwinpr/utils/wlog/CallbackAppender.c index aec3865b9..5d4b090d1 100644 --- a/winpr/libwinpr/utils/wlog/CallbackAppender.c +++ b/winpr/libwinpr/utils/wlog/CallbackAppender.c @@ -23,12 +23,11 @@ #include "CallbackAppender.h" - struct _wLogCallbackAppender { WLOG_APPENDER_COMMON(); - wLogCallbacks *callbacks; + wLogCallbacks* callbacks; }; typedef struct _wLogCallbackAppender wLogCallbackAppender; @@ -42,7 +41,8 @@ static BOOL WLog_CallbackAppender_Close(wLog* log, wLogAppender* appender) return TRUE; } -static BOOL WLog_CallbackAppender_WriteMessage(wLog* log, wLogAppender* appender, wLogMessage* message) +static BOOL WLog_CallbackAppender_WriteMessage(wLog* log, wLogAppender* appender, + wLogMessage* message) { char prefix[WLOG_MAX_PREFIX_SIZE]; wLogCallbackAppender* callbackAppender; @@ -53,7 +53,7 @@ static BOOL WLog_CallbackAppender_WriteMessage(wLog* log, wLogAppender* appender message->PrefixString = prefix; WLog_Layout_GetMessagePrefix(log, appender->Layout, message); - callbackAppender = (wLogCallbackAppender *)appender; + callbackAppender = (wLogCallbackAppender*)appender; if (callbackAppender->callbacks && callbackAppender->callbacks->message) return callbackAppender->callbacks->message(message); @@ -61,7 +61,8 @@ static BOOL WLog_CallbackAppender_WriteMessage(wLog* log, wLogAppender* appender return FALSE; } -static BOOL WLog_CallbackAppender_WriteDataMessage(wLog* log, wLogAppender* appender, wLogMessage* message) +static BOOL WLog_CallbackAppender_WriteDataMessage(wLog* log, wLogAppender* appender, + wLogMessage* message) { char prefix[WLOG_MAX_PREFIX_SIZE]; wLogCallbackAppender* callbackAppender; @@ -72,14 +73,15 @@ static BOOL WLog_CallbackAppender_WriteDataMessage(wLog* log, wLogAppender* appe message->PrefixString = prefix; WLog_Layout_GetMessagePrefix(log, appender->Layout, message); - callbackAppender = (wLogCallbackAppender *)appender; + callbackAppender = (wLogCallbackAppender*)appender; if (callbackAppender->callbacks && callbackAppender->callbacks->data) return callbackAppender->callbacks->data(message); else return FALSE; } -static BOOL WLog_CallbackAppender_WriteImageMessage(wLog* log, wLogAppender* appender, wLogMessage* message) +static BOOL WLog_CallbackAppender_WriteImageMessage(wLog* log, wLogAppender* appender, + wLogMessage* message) { char prefix[WLOG_MAX_PREFIX_SIZE]; wLogCallbackAppender* callbackAppender; @@ -90,14 +92,15 @@ static BOOL WLog_CallbackAppender_WriteImageMessage(wLog* log, wLogAppender* app message->PrefixString = prefix; WLog_Layout_GetMessagePrefix(log, appender->Layout, message); - callbackAppender = (wLogCallbackAppender *)appender; + callbackAppender = (wLogCallbackAppender*)appender; if (callbackAppender->callbacks && callbackAppender->callbacks->image) return callbackAppender->callbacks->image(message); else return FALSE; } -static BOOL WLog_CallbackAppender_WritePacketMessage(wLog* log, wLogAppender* appender, wLogMessage* message) +static BOOL WLog_CallbackAppender_WritePacketMessage(wLog* log, wLogAppender* appender, + wLogMessage* message) { char prefix[WLOG_MAX_PREFIX_SIZE]; wLogCallbackAppender* callbackAppender; @@ -108,21 +111,22 @@ static BOOL WLog_CallbackAppender_WritePacketMessage(wLog* log, wLogAppender* ap message->PrefixString = prefix; WLog_Layout_GetMessagePrefix(log, appender->Layout, message); - callbackAppender = (wLogCallbackAppender *)appender; + callbackAppender = (wLogCallbackAppender*)appender; if (callbackAppender->callbacks && callbackAppender->callbacks->package) return callbackAppender->callbacks->package(message); else return FALSE; } -static BOOL WLog_CallbackAppender_Set(wLogAppender* appender, const char *setting, void *value) +static BOOL WLog_CallbackAppender_Set(wLogAppender* appender, const char* setting, void* value) { - wLogCallbackAppender *callbackAppender = (wLogCallbackAppender *)appender; + wLogCallbackAppender* callbackAppender = (wLogCallbackAppender*)appender; if (!value || strcmp(setting, "callbacks")) return FALSE; - if (!(callbackAppender->callbacks = calloc(1, sizeof(wLogCallbacks)))) { + if (!(callbackAppender->callbacks = calloc(1, sizeof(wLogCallbacks)))) + { return FALSE; } @@ -132,12 +136,13 @@ static BOOL WLog_CallbackAppender_Set(wLogAppender* appender, const char *settin static void WLog_CallbackAppender_Free(wLogAppender* appender) { - wLogCallbackAppender *callbackAppender; - if (!appender) { + wLogCallbackAppender* callbackAppender; + if (!appender) + { return; } - callbackAppender = (wLogCallbackAppender *)appender; + callbackAppender = (wLogCallbackAppender*)appender; free(callbackAppender->callbacks); free(appender); @@ -147,7 +152,7 @@ wLogAppender* WLog_CallbackAppender_New(wLog* log) { wLogCallbackAppender* CallbackAppender; - CallbackAppender = (wLogCallbackAppender*) calloc(1, sizeof(wLogCallbackAppender)); + CallbackAppender = (wLogCallbackAppender*)calloc(1, sizeof(wLogCallbackAppender)); if (!CallbackAppender) return NULL; @@ -162,5 +167,5 @@ wLogAppender* WLog_CallbackAppender_New(wLog* log) CallbackAppender->Free = WLog_CallbackAppender_Free; CallbackAppender->Set = WLog_CallbackAppender_Set; - return (wLogAppender *)CallbackAppender; + return (wLogAppender*)CallbackAppender; } diff --git a/winpr/libwinpr/utils/wlog/ConsoleAppender.c b/winpr/libwinpr/utils/wlog/ConsoleAppender.c index 2e1274fcf..e39dfaf53 100644 --- a/winpr/libwinpr/utils/wlog/ConsoleAppender.c +++ b/winpr/libwinpr/utils/wlog/ConsoleAppender.c @@ -28,16 +28,16 @@ #include #endif -#define WLOG_CONSOLE_DEFAULT 0 -#define WLOG_CONSOLE_STDOUT 1 -#define WLOG_CONSOLE_STDERR 2 -#define WLOG_CONSOLE_DEBUG 4 +#define WLOG_CONSOLE_DEFAULT 0 +#define WLOG_CONSOLE_STDOUT 1 +#define WLOG_CONSOLE_STDERR 2 +#define WLOG_CONSOLE_DEBUG 4 struct _wLogConsoleAppender { - WLOG_APPENDER_COMMON(); + WLOG_APPENDER_COMMON(); - int outputStream; + int outputStream; }; typedef struct _wLogConsoleAppender wLogConsoleAppender; @@ -51,16 +51,16 @@ static BOOL WLog_ConsoleAppender_Close(wLog* log, wLogAppender* appender) return TRUE; } -static BOOL WLog_ConsoleAppender_WriteMessage(wLog* log, wLogAppender* appender, wLogMessage* message) +static BOOL WLog_ConsoleAppender_WriteMessage(wLog* log, wLogAppender* appender, + wLogMessage* message) { FILE* fp; char prefix[WLOG_MAX_PREFIX_SIZE]; - wLogConsoleAppender *consoleAppender; + wLogConsoleAppender* consoleAppender; if (!appender) return FALSE; - consoleAppender = (wLogConsoleAppender *)appender; - + consoleAppender = (wLogConsoleAppender*)appender; message->PrefixString = prefix; WLog_Layout_GetMessagePrefix(log, appender->Layout, message); @@ -70,8 +70,8 @@ static BOOL WLog_ConsoleAppender_WriteMessage(wLog* log, wLogAppender* appender, { char MessageString[4096]; - sprintf_s(MessageString, sizeof(MessageString), "%s%s\n", - message->PrefixString, message->TextString); + sprintf_s(MessageString, sizeof(MessageString), "%s%s\n", message->PrefixString, + message->TextString); OutputDebugStringA(MessageString); @@ -81,7 +81,7 @@ static BOOL WLog_ConsoleAppender_WriteMessage(wLog* log, wLogAppender* appender, #ifdef ANDROID (void)fp; android_LogPriority level; - switch(message->Level) + switch (message->Level) { case WLOG_TRACE: level = ANDROID_LOG_VERBOSE; @@ -113,7 +113,7 @@ static BOOL WLog_ConsoleAppender_WriteMessage(wLog* log, wLogAppender* appender, __android_log_print(level, log->Name, "%s%s", message->PrefixString, message->TextString); #else - switch(consoleAppender->outputStream) + switch (consoleAppender->outputStream) { case WLOG_CONSOLE_STDOUT: fp = stdout; @@ -122,7 +122,7 @@ static BOOL WLog_ConsoleAppender_WriteMessage(wLog* log, wLogAppender* appender, fp = stderr; break; default: - switch(message->Level) + switch (message->Level) { case WLOG_TRACE: case WLOG_DEBUG: @@ -144,7 +144,8 @@ static BOOL WLog_ConsoleAppender_WriteMessage(wLog* log, wLogAppender* appender, static int g_DataId = 0; -static BOOL WLog_ConsoleAppender_WriteDataMessage(wLog* log, wLogAppender* appender, wLogMessage* message) +static BOOL WLog_ConsoleAppender_WriteDataMessage(wLog* log, wLogAppender* appender, + wLogMessage* message) { #if defined(ANDROID) return FALSE; @@ -165,7 +166,8 @@ static BOOL WLog_ConsoleAppender_WriteDataMessage(wLog* log, wLogAppender* appen static int g_ImageId = 0; -static BOOL WLog_ConsoleAppender_WriteImageMessage(wLog* log, wLogAppender* appender, wLogMessage* message) +static BOOL WLog_ConsoleAppender_WriteImageMessage(wLog* log, wLogAppender* appender, + wLogMessage* message) { #if defined(ANDROID) return FALSE; @@ -176,8 +178,8 @@ static BOOL WLog_ConsoleAppender_WriteImageMessage(wLog* log, wLogAppender* appe ImageId = g_ImageId++; FullFileName = WLog_Message_GetOutputFileName(ImageId, "bmp"); - WLog_ImageMessage_Write(FullFileName, message->ImageData, - message->ImageWidth, message->ImageHeight, message->ImageBpp); + WLog_ImageMessage_Write(FullFileName, message->ImageData, message->ImageWidth, + message->ImageHeight, message->ImageBpp); free(FullFileName); @@ -187,7 +189,8 @@ static BOOL WLog_ConsoleAppender_WriteImageMessage(wLog* log, wLogAppender* appe static int g_PacketId = 0; -static BOOL WLog_ConsoleAppender_WritePacketMessage(wLog* log, wLogAppender* appender, wLogMessage* message) +static BOOL WLog_ConsoleAppender_WritePacketMessage(wLog* log, wLogAppender* appender, + wLogMessage* message) { #if defined(ANDROID) return FALSE; @@ -199,20 +202,20 @@ static BOOL WLog_ConsoleAppender_WritePacketMessage(wLog* log, wLogAppender* app if (!appender->PacketMessageContext) { FullFileName = WLog_Message_GetOutputFileName(-1, "pcap"); - appender->PacketMessageContext = (void*) Pcap_Open(FullFileName, TRUE); + appender->PacketMessageContext = (void*)Pcap_Open(FullFileName, TRUE); free(FullFileName); } if (appender->PacketMessageContext) - return WLog_PacketMessage_Write((wPcap*) appender->PacketMessageContext, - message->PacketData, message->PacketLength, message->PacketFlags); + return WLog_PacketMessage_Write((wPcap*)appender->PacketMessageContext, message->PacketData, + message->PacketLength, message->PacketFlags); return TRUE; #endif } -static BOOL WLog_ConsoleAppender_Set(wLogAppender* appender, const char *setting, void *value) +static BOOL WLog_ConsoleAppender_Set(wLogAppender* appender, const char* setting, void* value) { - wLogConsoleAppender *consoleAppender = (wLogConsoleAppender *)appender; + wLogConsoleAppender* consoleAppender = (wLogConsoleAppender*)appender; /* Just check the value string is not empty */ if (!value || (strnlen(value, 2) == 0)) @@ -241,7 +244,7 @@ static void WLog_ConsoleAppender_Free(wLogAppender* appender) { if (appender->PacketMessageContext) { - Pcap_Close((wPcap*) appender->PacketMessageContext); + Pcap_Close((wPcap*)appender->PacketMessageContext); } free(appender); @@ -252,14 +255,14 @@ wLogAppender* WLog_ConsoleAppender_New(wLog* log) { wLogConsoleAppender* ConsoleAppender; - ConsoleAppender = (wLogConsoleAppender*) calloc(1, sizeof(wLogConsoleAppender)); + ConsoleAppender = (wLogConsoleAppender*)calloc(1, sizeof(wLogConsoleAppender)); if (!ConsoleAppender) return NULL; ConsoleAppender->Type = WLOG_APPENDER_CONSOLE; - ConsoleAppender->Open = WLog_ConsoleAppender_Open; + ConsoleAppender->Open = WLog_ConsoleAppender_Open; ConsoleAppender->Close = WLog_ConsoleAppender_Close; ConsoleAppender->WriteMessage = WLog_ConsoleAppender_WriteMessage; ConsoleAppender->WriteDataMessage = WLog_ConsoleAppender_WriteDataMessage; @@ -275,6 +278,5 @@ wLogAppender* WLog_ConsoleAppender_New(wLog* log) ConsoleAppender->outputStream = WLOG_CONSOLE_DEBUG; #endif - return (wLogAppender *)ConsoleAppender; + return (wLogAppender*)ConsoleAppender; } - diff --git a/winpr/libwinpr/utils/wlog/DataMessage.c b/winpr/libwinpr/utils/wlog/DataMessage.c index ce4a1f60a..74263cf56 100644 --- a/winpr/libwinpr/utils/wlog/DataMessage.c +++ b/winpr/libwinpr/utils/wlog/DataMessage.c @@ -37,7 +37,7 @@ BOOL WLog_DataMessage_Write(char* filename, void* data, int length) if (!fp) { - //WLog_ERR(TAG, "failed to open file %s", filename); + // WLog_ERR(TAG, "failed to open file %s", filename); return FALSE; } diff --git a/winpr/libwinpr/utils/wlog/FileAppender.c b/winpr/libwinpr/utils/wlog/FileAppender.c index a8b3403b4..5ba71632c 100644 --- a/winpr/libwinpr/utils/wlog/FileAppender.c +++ b/winpr/libwinpr/utils/wlog/FileAppender.c @@ -40,7 +40,6 @@ struct _wLogFileAppender }; typedef struct _wLogFileAppender wLogFileAppender; - static BOOL WLog_FileAppender_SetOutputFileName(wLogFileAppender* appender, const char* filename) { appender->FileName = _strdup(filename); @@ -80,17 +79,18 @@ static BOOL WLog_FileAppender_Open(wLog* log, wLogAppender* appender) if (!fileAppender->FileName) { - fileAppender->FileName = (char*) malloc(MAX_PATH); + fileAppender->FileName = (char*)malloc(MAX_PATH); if (!fileAppender->FileName) return FALSE; - sprintf_s(fileAppender->FileName, MAX_PATH, "%"PRIu32".log", GetCurrentProcessId()); + sprintf_s(fileAppender->FileName, MAX_PATH, "%" PRIu32 ".log", GetCurrentProcessId()); } if (!fileAppender->FullFileName) { - fileAppender->FullFileName = GetCombinedPath(fileAppender->FilePath, fileAppender->FileName); + fileAppender->FullFileName = + GetCombinedPath(fileAppender->FilePath, fileAppender->FileName); if (!fileAppender->FullFileName) return FALSE; @@ -154,7 +154,7 @@ static BOOL WLog_FileAppender_WriteMessage(wLog* log, wLogAppender* appender, wL static int g_DataId = 0; static BOOL WLog_FileAppender_WriteDataMessage(wLog* log, wLogAppender* appender, - wLogMessage* message) + wLogMessage* message) { int DataId; char* FullFileName; @@ -172,7 +172,7 @@ static BOOL WLog_FileAppender_WriteDataMessage(wLog* log, wLogAppender* appender static int g_ImageId = 0; static BOOL WLog_FileAppender_WriteImageMessage(wLog* log, wLogAppender* appender, - wLogMessage* message) + wLogMessage* message) { int ImageId; char* FullFileName; @@ -182,15 +182,15 @@ static BOOL WLog_FileAppender_WriteImageMessage(wLog* log, wLogAppender* appende ImageId = g_ImageId++; FullFileName = WLog_Message_GetOutputFileName(ImageId, "bmp"); - WLog_ImageMessage_Write(FullFileName, message->ImageData, - message->ImageWidth, message->ImageHeight, message->ImageBpp); + WLog_ImageMessage_Write(FullFileName, message->ImageData, message->ImageWidth, + message->ImageHeight, message->ImageBpp); free(FullFileName); return TRUE; } static BOOL WLog_FileAppender_Set(wLogAppender* appender, const char* setting, void* value) { - wLogFileAppender* fileAppender = (wLogFileAppender*) appender; + wLogFileAppender* fileAppender = (wLogFileAppender*)appender; /* Just check the value string is not empty */ if (!value || (strnlen(value, 2) == 0)) @@ -226,7 +226,7 @@ wLogAppender* WLog_FileAppender_New(wLog* log) LPCSTR name; DWORD nSize; wLogFileAppender* FileAppender; - FileAppender = (wLogFileAppender*) calloc(1, sizeof(wLogFileAppender)); + FileAppender = (wLogFileAppender*)calloc(1, sizeof(wLogFileAppender)); if (!FileAppender) return NULL; @@ -245,7 +245,7 @@ wLogAppender* WLog_FileAppender_New(wLog* log) if (nSize) { BOOL status; - env = (LPSTR) malloc(nSize); + env = (LPSTR)malloc(nSize); if (!env) goto error_free; @@ -269,7 +269,7 @@ wLogAppender* WLog_FileAppender_New(wLog* log) if (nSize) { BOOL status = FALSE; - env = (LPSTR) malloc(nSize); + env = (LPSTR)malloc(nSize); if (!env) goto error_output_file_name; diff --git a/winpr/libwinpr/utils/wlog/JournaldAppender.c b/winpr/libwinpr/utils/wlog/JournaldAppender.c index eded5be80..1b93d9da6 100644 --- a/winpr/libwinpr/utils/wlog/JournaldAppender.c +++ b/winpr/libwinpr/utils/wlog/JournaldAppender.c @@ -31,19 +31,18 @@ #include #include - struct _wLogJournaldAppender { WLOG_APPENDER_COMMON(); - char *identifier; - FILE *stream; + char* identifier; + FILE* stream; }; typedef struct _wLogJournaldAppender wLogJournaldAppender; static BOOL WLog_JournaldAppender_Open(wLog* log, wLogAppender* appender) { int fd; - wLogJournaldAppender *journaldAppender; + wLogJournaldAppender* journaldAppender; if (!log || !appender) return FALSE; @@ -75,40 +74,41 @@ static BOOL WLog_JournaldAppender_Close(wLog* log, wLogAppender* appender) return TRUE; } -static BOOL WLog_JournaldAppender_WriteMessage(wLog* log, wLogAppender* appender, wLogMessage* message) +static BOOL WLog_JournaldAppender_WriteMessage(wLog* log, wLogAppender* appender, + wLogMessage* message) { - char *formatStr; + char* formatStr; wLogJournaldAppender* journaldAppender; char prefix[WLOG_MAX_PREFIX_SIZE]; if (!log || !appender || !message) return FALSE; - journaldAppender = (wLogJournaldAppender *)appender; + journaldAppender = (wLogJournaldAppender*)appender; switch (message->Level) { - case WLOG_TRACE: - case WLOG_DEBUG: - formatStr = "<7>%s%s\n"; - break; - case WLOG_INFO: - formatStr = "<6>%s%s\n"; - break; - case WLOG_WARN: - formatStr = "<4>%s%s\n"; - break; - case WLOG_ERROR: - formatStr = "<3>%s%s\n"; - break; - case WLOG_FATAL: - formatStr = "<2>%s%s\n"; - break; - case WLOG_OFF: - return TRUE; - default: - fprintf(stderr, "%s: unknown level %"PRIu32"\n", __FUNCTION__, message->Level); - return FALSE; + case WLOG_TRACE: + case WLOG_DEBUG: + formatStr = "<7>%s%s\n"; + break; + case WLOG_INFO: + formatStr = "<6>%s%s\n"; + break; + case WLOG_WARN: + formatStr = "<4>%s%s\n"; + break; + case WLOG_ERROR: + formatStr = "<3>%s%s\n"; + break; + case WLOG_FATAL: + formatStr = "<2>%s%s\n"; + break; + case WLOG_OFF: + return TRUE; + default: + fprintf(stderr, "%s: unknown level %" PRIu32 "\n", __FUNCTION__, message->Level); + return FALSE; } message->PrefixString = prefix; @@ -119,7 +119,8 @@ static BOOL WLog_JournaldAppender_WriteMessage(wLog* log, wLogAppender* appender return TRUE; } -static BOOL WLog_JournaldAppender_WriteDataMessage(wLog* log, wLogAppender* appender, wLogMessage* message) +static BOOL WLog_JournaldAppender_WriteDataMessage(wLog* log, wLogAppender* appender, + wLogMessage* message) { if (!log || !appender || !message) return FALSE; @@ -127,18 +128,18 @@ static BOOL WLog_JournaldAppender_WriteDataMessage(wLog* log, wLogAppender* appe return TRUE; } -static BOOL WLog_JournaldAppender_WriteImageMessage(wLog* log, wLogAppender* appender, wLogMessage* message) +static BOOL WLog_JournaldAppender_WriteImageMessage(wLog* log, wLogAppender* appender, + wLogMessage* message) { if (!log || !appender || !message) return FALSE; - return TRUE; } -static BOOL WLog_JournaldAppender_Set(wLogAppender* appender, const char *setting, void *value) +static BOOL WLog_JournaldAppender_Set(wLogAppender* appender, const char* setting, void* value) { - wLogJournaldAppender* journaldAppender = (wLogJournaldAppender *)appender; + wLogJournaldAppender* journaldAppender = (wLogJournaldAppender*)appender; /* Just check the value string is not empty */ if (!value || (strnlen(value, 2) == 0)) @@ -154,12 +155,12 @@ static BOOL WLog_JournaldAppender_Set(wLogAppender* appender, const char *settin if (journaldAppender->identifier) free(journaldAppender->identifier); - return ((journaldAppender->identifier = _strdup((const char *)value)) != NULL); + return ((journaldAppender->identifier = _strdup((const char*)value)) != NULL); } static void WLog_JournaldAppender_Free(wLogAppender* appender) { - wLogJournaldAppender *journaldAppender; + wLogJournaldAppender* journaldAppender; if (appender) { journaldAppender = (wLogJournaldAppender*)appender; @@ -176,7 +177,7 @@ wLogAppender* WLog_JournaldAppender_New(wLog* log) DWORD nSize; LPCSTR name = "WLOG_JOURNALD_ID"; - appender = (wLogJournaldAppender*) calloc(1, sizeof(wLogJournaldAppender)); + appender = (wLogJournaldAppender*)calloc(1, sizeof(wLogJournaldAppender)); if (!appender) return NULL; @@ -192,18 +193,18 @@ wLogAppender* WLog_JournaldAppender_New(wLog* log) nSize = GetEnvironmentVariableA(name, NULL, 0); if (nSize) { - appender->identifier = (LPSTR) malloc(nSize); + appender->identifier = (LPSTR)malloc(nSize); if (!appender->identifier) goto error_open; - if (GetEnvironmentVariableA(name, appender->identifier, nSize) != nSize -1) + if (GetEnvironmentVariableA(name, appender->identifier, nSize) != nSize - 1) goto error_open; - if (!WLog_JournaldAppender_Open(log, (wLogAppender *)appender)) + if (!WLog_JournaldAppender_Open(log, (wLogAppender*)appender)) goto error_open; } - return (wLogAppender *)appender; + return (wLogAppender*)appender; error_open: free(appender->identifier); diff --git a/winpr/libwinpr/utils/wlog/Layout.c b/winpr/libwinpr/utils/wlog/Layout.c index 381bbba3f..3c515a10a 100644 --- a/winpr/libwinpr/utils/wlog/Layout.c +++ b/winpr/libwinpr/utils/wlog/Layout.c @@ -45,7 +45,8 @@ extern const char* WLOG_LEVELS[7]; * Log Layout */ -static void WLog_PrintMessagePrefixVA(wLog* log, wLogMessage* message, const char* format, va_list args) +static void WLog_PrintMessagePrefixVA(wLog* log, wLogMessage* message, const char* format, + va_list args) { if (!strchr(format, '%')) sprintf_s(message->PrefixString, WLOG_MAX_PREFIX_SIZE - 1, "%s", format); @@ -71,7 +72,7 @@ BOOL WLog_Layout_GetMessagePrefix(wLog* log, wLogLayout* layout, wLogMessage* me SYSTEMTIME localTime; GetLocalTime(&localTime); index = 0; - p = (char*) layout->FormatString; + p = (char*)layout->FormatString; while (*p) { @@ -83,14 +84,14 @@ BOOL WLog_Layout_GetMessagePrefix(wLog* log, wLogLayout* layout, wLogMessage* me { if ((p[0] == 'l') && (p[1] == 'v')) /* log level */ { - args[argc++] = (void*) WLOG_LEVELS[message->Level]; + args[argc++] = (void*)WLOG_LEVELS[message->Level]; format[index++] = '%'; format[index++] = 's'; p++; } else if ((p[0] == 'm') && (p[1] == 'n')) /* module name */ { - args[argc++] = (void*) log->Name; + args[argc++] = (void*)log->Name; format[index++] = '%'; format[index++] = 's'; p++; @@ -106,30 +107,30 @@ BOOL WLog_Layout_GetMessagePrefix(wLog* log, wLogLayout* layout, wLogMessage* me if (file) file++; else - file = (char*) message->FileName; + file = (char*)message->FileName; - args[argc++] = (void*) file; + args[argc++] = (void*)file; format[index++] = '%'; format[index++] = 's'; p++; } else if ((p[0] == 'f') && (p[1] == 'n')) /* function */ { - args[argc++] = (void*) message->FunctionName; + args[argc++] = (void*)message->FunctionName; format[index++] = '%'; format[index++] = 's'; p++; } else if ((p[0] == 'l') && (p[1] == 'n')) /* line number */ { - args[argc++] = (void*)(size_t) message->LineNumber; + args[argc++] = (void*)(size_t)message->LineNumber; format[index++] = '%'; format[index++] = 'u'; p++; } else if ((p[0] == 'p') && (p[1] == 'i') && (p[2] == 'd')) /* process id */ { - args[argc++] = (void*)(size_t) GetCurrentProcessId(); + args[argc++] = (void*)(size_t)GetCurrentProcessId(); format[index++] = '%'; format[index++] = 'u'; p += 2; @@ -138,12 +139,12 @@ BOOL WLog_Layout_GetMessagePrefix(wLog* log, wLogLayout* layout, wLogMessage* me { #if defined __linux__ && !defined ANDROID /* On Linux we prefer to see the LWP id */ - args[argc++] = (void*)(size_t) syscall(SYS_gettid); + args[argc++] = (void*)(size_t)syscall(SYS_gettid); format[index++] = '%'; format[index++] = 'l'; format[index++] = 'd'; #else - args[argc++] = (void*)(size_t) GetCurrentThreadId(); + args[argc++] = (void*)(size_t)GetCurrentThreadId(); format[index++] = '%'; format[index++] = '0'; format[index++] = '8'; @@ -153,14 +154,14 @@ BOOL WLog_Layout_GetMessagePrefix(wLog* log, wLogLayout* layout, wLogMessage* me } else if ((p[0] == 'y') && (p[1] == 'r')) /* year */ { - args[argc++] = (void*)(size_t) localTime.wYear; + args[argc++] = (void*)(size_t)localTime.wYear; format[index++] = '%'; format[index++] = 'u'; p++; } else if ((p[0] == 'm') && (p[1] == 'o')) /* month */ { - args[argc++] = (void*)(size_t) localTime.wMonth; + args[argc++] = (void*)(size_t)localTime.wMonth; format[index++] = '%'; format[index++] = '0'; format[index++] = '2'; @@ -169,7 +170,7 @@ BOOL WLog_Layout_GetMessagePrefix(wLog* log, wLogLayout* layout, wLogMessage* me } else if ((p[0] == 'd') && (p[1] == 'w')) /* day of week */ { - args[argc++] = (void*)(size_t) localTime.wDayOfWeek; + args[argc++] = (void*)(size_t)localTime.wDayOfWeek; format[index++] = '%'; format[index++] = '0'; format[index++] = '2'; @@ -178,7 +179,7 @@ BOOL WLog_Layout_GetMessagePrefix(wLog* log, wLogLayout* layout, wLogMessage* me } else if ((p[0] == 'd') && (p[1] == 'y')) /* day */ { - args[argc++] = (void*)(size_t) localTime.wDay; + args[argc++] = (void*)(size_t)localTime.wDay; format[index++] = '%'; format[index++] = '0'; format[index++] = '2'; @@ -187,7 +188,7 @@ BOOL WLog_Layout_GetMessagePrefix(wLog* log, wLogLayout* layout, wLogMessage* me } else if ((p[0] == 'h') && (p[1] == 'r')) /* hours */ { - args[argc++] = (void*)(size_t) localTime.wHour; + args[argc++] = (void*)(size_t)localTime.wHour; format[index++] = '%'; format[index++] = '0'; format[index++] = '2'; @@ -196,7 +197,7 @@ BOOL WLog_Layout_GetMessagePrefix(wLog* log, wLogLayout* layout, wLogMessage* me } else if ((p[0] == 'm') && (p[1] == 'i')) /* minutes */ { - args[argc++] = (void*)(size_t) localTime.wMinute; + args[argc++] = (void*)(size_t)localTime.wMinute; format[index++] = '%'; format[index++] = '0'; format[index++] = '2'; @@ -205,7 +206,7 @@ BOOL WLog_Layout_GetMessagePrefix(wLog* log, wLogLayout* layout, wLogMessage* me } else if ((p[0] == 's') && (p[1] == 'e')) /* seconds */ { - args[argc++] = (void*)(size_t) localTime.wSecond; + args[argc++] = (void*)(size_t)localTime.wSecond; format[index++] = '%'; format[index++] = '0'; format[index++] = '2'; @@ -214,7 +215,7 @@ BOOL WLog_Layout_GetMessagePrefix(wLog* log, wLogLayout* layout, wLogMessage* me } else if ((p[0] == 'm') && (p[1] == 'l')) /* milliseconds */ { - args[argc++] = (void*)(size_t) localTime.wMilliseconds; + args[argc++] = (void*)(size_t)localTime.wMilliseconds; format[index++] = '%'; format[index++] = '0'; format[index++] = '3'; @@ -353,7 +354,7 @@ wLogLayout* WLog_Layout_New(wLog* log) DWORD nSize; char* env = NULL; wLogLayout* layout; - layout = (wLogLayout*) calloc(1, sizeof(wLogLayout)); + layout = (wLogLayout*)calloc(1, sizeof(wLogLayout)); if (!layout) return NULL; @@ -362,7 +363,7 @@ wLogLayout* WLog_Layout_New(wLog* log) if (nSize) { - env = (LPSTR) malloc(nSize); + env = (LPSTR)malloc(nSize); if (!env) { diff --git a/winpr/libwinpr/utils/wlog/Layout.h b/winpr/libwinpr/utils/wlog/Layout.h index df31d4d6d..3358e7525 100644 --- a/winpr/libwinpr/utils/wlog/Layout.h +++ b/winpr/libwinpr/utils/wlog/Layout.h @@ -39,4 +39,3 @@ void WLog_Layout_Free(wLog* log, wLogLayout* layout); #include "wlog/wlog.h" #endif /* WINPR_WLOG_LAYOUT_PRIVATE_H */ - diff --git a/winpr/libwinpr/utils/wlog/Message.c b/winpr/libwinpr/utils/wlog/Message.c index 46265069f..3903d0c25 100644 --- a/winpr/libwinpr/utils/wlog/Message.c +++ b/winpr/libwinpr/utils/wlog/Message.c @@ -36,8 +36,7 @@ char* WLog_Message_GetOutputFileName(int id, const char* ext) char* FileName; char* FullFileName; - - if (!(FileName = (char*) malloc(256))) + if (!(FileName = (char*)malloc(256))) return NULL; FilePath = GetKnownSubPath(KNOWN_PATH_TEMP, "wlog"); @@ -54,9 +53,9 @@ char* WLog_Message_GetOutputFileName(int id, const char* ext) ProcessId = GetCurrentProcessId(); if (id >= 0) - sprintf_s(FileName, 256, "%"PRIu32"-%d.%s", ProcessId, id, ext); + sprintf_s(FileName, 256, "%" PRIu32 "-%d.%s", ProcessId, id, ext); else - sprintf_s(FileName, 256, "%"PRIu32".%s", ProcessId, ext); + sprintf_s(FileName, 256, "%" PRIu32 ".%s", ProcessId, ext); FullFileName = GetCombinedPath(FilePath, FileName); diff --git a/winpr/libwinpr/utils/wlog/PacketMessage.c b/winpr/libwinpr/utils/wlog/PacketMessage.c index abd3038a5..2f450ce14 100644 --- a/winpr/libwinpr/utils/wlog/PacketMessage.c +++ b/winpr/libwinpr/utils/wlog/PacketMessage.c @@ -45,7 +45,7 @@ static int gettimeofday(struct timeval* tp, void* tz) { struct _timeb timebuffer; _ftime(&timebuffer); - tp->tv_sec = (long) timebuffer.time; + tp->tv_sec = (long)timebuffer.time; tp->tv_usec = timebuffer.millitm * 1000; return 0; } @@ -53,13 +53,13 @@ static int gettimeofday(struct timeval* tp, void* tz) static BOOL Pcap_Read_Header(wPcap* pcap, wPcapHeader* header) { - if (pcap && pcap->fp && fread((void*) header, sizeof(wPcapHeader), 1, pcap->fp) == 1) + if (pcap && pcap->fp && fread((void*)header, sizeof(wPcapHeader), 1, pcap->fp) == 1) return TRUE; return FALSE; } /* currently unused code */ -# if 0 +#if 0 static BOOL Pcap_Read_RecordHeader(wPcap* pcap, wPcapRecordHeader* record) { if (pcap && pcap->fp && (fread((void*) record, sizeof(wPcapRecordHeader), 1, pcap->fp) == 1)) @@ -158,17 +158,16 @@ static BOOL Pcap_GetNext_Record(wPcap* pcap, wPcapRecord* record) } #endif - static BOOL Pcap_Write_Header(wPcap* pcap, wPcapHeader* header) { - if (pcap && pcap->fp && fwrite((void*) header, sizeof(wPcapHeader), 1, pcap->fp) == 1) + if (pcap && pcap->fp && fwrite((void*)header, sizeof(wPcapHeader), 1, pcap->fp) == 1) return TRUE; return FALSE; } static BOOL Pcap_Write_RecordHeader(wPcap* pcap, wPcapRecordHeader* record) { - if (pcap && pcap->fp && fwrite((void *) record, sizeof(wPcapRecordHeader), 1, pcap->fp) == 1) + if (pcap && pcap->fp && fwrite((void*)record, sizeof(wPcapRecordHeader), 1, pcap->fp) == 1) return TRUE; return FALSE; } @@ -182,8 +181,7 @@ static BOOL Pcap_Write_RecordContent(wPcap* pcap, wPcapRecord* record) static BOOL Pcap_Write_Record(wPcap* pcap, wPcapRecord* record) { - return Pcap_Write_RecordHeader(pcap, &record->header) && - Pcap_Write_RecordContent(pcap, record); + return Pcap_Write_RecordHeader(pcap, &record->header) && Pcap_Write_RecordContent(pcap, record); } wPcap* Pcap_Open(char* name, BOOL write) @@ -193,11 +191,11 @@ wPcap* Pcap_Open(char* name, BOOL write) if (!pcap_fp) { - WLog_ERR(TAG,"opening pcap file"); + WLog_ERR(TAG, "opening pcap file"); return NULL; } - pcap = (wPcap*) calloc(1, sizeof(wPcap)); + pcap = (wPcap*)calloc(1, sizeof(wPcap)); if (!pcap) goto out_fail; @@ -294,7 +292,7 @@ static UINT16 IPv4Checksum(BYTE* ipv4, int length) while (length > 1) { - tmp16 = *((UINT16*) ipv4); + tmp16 = *((UINT16*)ipv4); checksum += tmp16; length -= 2; ipv4 += 2; @@ -331,7 +329,7 @@ static BOOL WLog_PacketMessage_Write_IPv4Header(wPcap* pcap, wIPv4Header* ipv4) Stream_Write_UINT16(s, ipv4->HeaderChecksum); Stream_Write_UINT32_BE(s, ipv4->SourceAddress); Stream_Write_UINT32_BE(s, ipv4->DestinationAddress); - ipv4->HeaderChecksum = IPv4Checksum((BYTE*) buffer, 20); + ipv4->HeaderChecksum = IPv4Checksum((BYTE*)buffer, 20); Stream_Rewind(s, 10); Stream_Write_UINT16(s, ipv4->HeaderChecksum); Stream_Seek(s, 8); @@ -436,12 +434,12 @@ BOOL WLog_PacketMessage_Write(wPcap* pcap, void* data, DWORD length, DWORD flags if (flags & WLOG_PACKET_OUTBOUND) { - ipv4.SourceAddress = 0xC0A80196; /* 192.168.1.150 */ + ipv4.SourceAddress = 0xC0A80196; /* 192.168.1.150 */ ipv4.DestinationAddress = 0x4A7D64C8; /* 74.125.100.200 */ } else { - ipv4.SourceAddress = 0x4A7D64C8; /* 74.125.100.200 */ + ipv4.SourceAddress = 0x4A7D64C8; /* 74.125.100.200 */ ipv4.DestinationAddress = 0xC0A80196; /* 192.168.1.150 */ } @@ -476,10 +474,9 @@ BOOL WLog_PacketMessage_Write(wPcap* pcap, void* data, DWORD length, DWORD flags record.header.ts_sec = tp.tv_sec; record.header.ts_usec = tp.tv_usec; if (!Pcap_Write_RecordHeader(pcap, &record.header) || - !WLog_PacketMessage_Write_EthernetHeader(pcap, ðernet) || - !WLog_PacketMessage_Write_IPv4Header(pcap, &ipv4) || - !WLog_PacketMessage_Write_TcpHeader(pcap, &tcp) || - !Pcap_Write_RecordContent(pcap, &record)) + !WLog_PacketMessage_Write_EthernetHeader(pcap, ðernet) || + !WLog_PacketMessage_Write_IPv4Header(pcap, &ipv4) || + !WLog_PacketMessage_Write_TcpHeader(pcap, &tcp) || !Pcap_Write_RecordContent(pcap, &record)) return FALSE; fflush(pcap->fp); return TRUE; diff --git a/winpr/libwinpr/utils/wlog/PacketMessage.h b/winpr/libwinpr/utils/wlog/PacketMessage.h index e0b73526a..1599f2456 100644 --- a/winpr/libwinpr/utils/wlog/PacketMessage.h +++ b/winpr/libwinpr/utils/wlog/PacketMessage.h @@ -22,24 +22,24 @@ #include "wlog.h" -#define PCAP_MAGIC_NUMBER 0xA1B2C3D4 +#define PCAP_MAGIC_NUMBER 0xA1B2C3D4 struct _wPcapHeader { - UINT32 magic_number; /* magic number */ + UINT32 magic_number; /* magic number */ UINT16 version_major; /* major version number */ UINT16 version_minor; /* minor version number */ - INT32 thiszone; /* GMT to local correction */ - UINT32 sigfigs; /* accuracy of timestamps */ - UINT32 snaplen; /* max length of captured packets, in octets */ - UINT32 network; /* data link type */ + INT32 thiszone; /* GMT to local correction */ + UINT32 sigfigs; /* accuracy of timestamps */ + UINT32 snaplen; /* max length of captured packets, in octets */ + UINT32 network; /* data link type */ }; typedef struct _wPcapHeader wPcapHeader; struct _wPcapRecordHeader { - UINT32 ts_sec; /* timestamp seconds */ - UINT32 ts_usec; /* timestamp microseconds */ + UINT32 ts_sec; /* timestamp seconds */ + UINT32 ts_usec; /* timestamp microseconds */ UINT32 incl_len; /* number of octets of packet saved in file */ UINT32 orig_len; /* actual length of packet */ }; @@ -117,4 +117,3 @@ typedef struct _wTcpHeader wTcpHeader; BOOL WLog_PacketMessage_Write(wPcap* pcap, void* data, DWORD length, DWORD flags); #endif /* WINPR_WLOG_PACKET_MESSAGE_PRIVATE_H */ - diff --git a/winpr/libwinpr/utils/wlog/SyslogAppender.c b/winpr/libwinpr/utils/wlog/SyslogAppender.c index 7b86c35d1..693ddd7f5 100644 --- a/winpr/libwinpr/utils/wlog/SyslogAppender.c +++ b/winpr/libwinpr/utils/wlog/SyslogAppender.c @@ -35,20 +35,20 @@ static int getSyslogLevel(DWORD level) { switch (level) { - case WLOG_TRACE: - case WLOG_DEBUG: - return LOG_DEBUG; - case WLOG_INFO: - return LOG_INFO; - case WLOG_WARN: - return LOG_WARNING; - case WLOG_ERROR: - return LOG_ERR; - case WLOG_FATAL: - return LOG_CRIT; - case WLOG_OFF: - default: - return -1; + case WLOG_TRACE: + case WLOG_DEBUG: + return LOG_DEBUG; + case WLOG_INFO: + return LOG_INFO; + case WLOG_WARN: + return LOG_WARNING; + case WLOG_ERROR: + return LOG_ERR; + case WLOG_FATAL: + return LOG_CRIT; + case WLOG_OFF: + default: + return -1; } } @@ -68,7 +68,8 @@ static BOOL WLog_SyslogAppender_Close(wLog* log, wLogAppender* appender) return TRUE; } -static BOOL WLog_SyslogAppender_WriteMessage(wLog* log, wLogAppender* appender, wLogMessage* message) +static BOOL WLog_SyslogAppender_WriteMessage(wLog* log, wLogAppender* appender, + wLogMessage* message) { int syslogLevel; @@ -78,11 +79,12 @@ static BOOL WLog_SyslogAppender_WriteMessage(wLog* log, wLogAppender* appender, syslogLevel = getSyslogLevel(message->Level); if (syslogLevel >= 0) syslog(syslogLevel, "%s", message->TextString); - + return TRUE; } -static BOOL WLog_SyslogAppender_WriteDataMessage(wLog* log, wLogAppender* appender, wLogMessage* message) +static BOOL WLog_SyslogAppender_WriteDataMessage(wLog* log, wLogAppender* appender, + wLogMessage* message) { int syslogLevel; @@ -96,7 +98,8 @@ static BOOL WLog_SyslogAppender_WriteDataMessage(wLog* log, wLogAppender* append return TRUE; } -static BOOL WLog_SyslogAppender_WriteImageMessage(wLog* log, wLogAppender* appender, wLogMessage* message) +static BOOL WLog_SyslogAppender_WriteImageMessage(wLog* log, wLogAppender* appender, + wLogMessage* message) { int syslogLevel; @@ -105,21 +108,22 @@ static BOOL WLog_SyslogAppender_WriteImageMessage(wLog* log, wLogAppender* appen syslogLevel = getSyslogLevel(message->Level); if (syslogLevel >= 0) - syslog(syslogLevel, "skipped image (%dx%dx%d)", message->ImageWidth, message->ImageHeight, message->ImageBpp); + syslog(syslogLevel, "skipped image (%dx%dx%d)", message->ImageWidth, message->ImageHeight, + message->ImageBpp); return TRUE; } void WLog_SyslogAppender_Free(wLogAppender* appender) { - free(appender); + free(appender); } wLogAppender* WLog_SyslogAppender_New(wLog* log) { wLogSyslogAppender* appender; - appender = (wLogSyslogAppender*) calloc(1, sizeof(wLogSyslogAppender)); + appender = (wLogSyslogAppender*)calloc(1, sizeof(wLogSyslogAppender)); if (!appender) return NULL; diff --git a/winpr/libwinpr/utils/wlog/UdpAppender.c b/winpr/libwinpr/utils/wlog/UdpAppender.c index 7ed26a613..5a40a7181 100644 --- a/winpr/libwinpr/utils/wlog/UdpAppender.c +++ b/winpr/libwinpr/utils/wlog/UdpAppender.c @@ -22,20 +22,18 @@ #include "config.h" #endif - #include #include #include #include "wlog.h" - struct _wLogUdpAppender { WLOG_APPENDER_COMMON(); char* host; struct sockaddr targetAddr; - int targetAddrLen; + int targetAddrLen; SOCKET sock; }; typedef struct _wLogUdpAppender wLogUdpAppender; @@ -80,7 +78,7 @@ static BOOL WLog_UdpAppender_Open(wLog* log, wLogAppender* appender) } memcpy(&udpAppender->targetAddr, result->ai_addr, result->ai_addrlen); - udpAppender->targetAddrLen = (int) result->ai_addrlen; + udpAppender->targetAddrLen = (int)result->ai_addrlen; freeaddrinfo(result); return TRUE; } @@ -106,14 +104,14 @@ static BOOL WLog_UdpAppender_WriteMessage(wLog* log, wLogAppender* appender, wLo WLog_Layout_GetMessagePrefix(log, appender->Layout, message); _sendto(udpAppender->sock, message->PrefixString, (int)strnlen(message->PrefixString, INT_MAX), 0, &udpAppender->targetAddr, udpAppender->targetAddrLen); - _sendto(udpAppender->sock, message->TextString, (int)strnlen(message->TextString, INT_MAX), - 0, &udpAppender->targetAddr, udpAppender->targetAddrLen); + _sendto(udpAppender->sock, message->TextString, (int)strnlen(message->TextString, INT_MAX), 0, + &udpAppender->targetAddr, udpAppender->targetAddrLen); _sendto(udpAppender->sock, "\n", 1, 0, &udpAppender->targetAddr, udpAppender->targetAddrLen); return TRUE; } static BOOL WLog_UdpAppender_WriteDataMessage(wLog* log, wLogAppender* appender, - wLogMessage* message) + wLogMessage* message) { if (!log || !appender || !message) return FALSE; @@ -122,7 +120,7 @@ static BOOL WLog_UdpAppender_WriteDataMessage(wLog* log, wLogAppender* appender, } static BOOL WLog_UdpAppender_WriteImageMessage(wLog* log, wLogAppender* appender, - wLogMessage* message) + wLogMessage* message) { if (!log || !appender || !message) return FALSE; @@ -175,7 +173,7 @@ wLogAppender* WLog_UdpAppender_New(wLog* log) wLogUdpAppender* appender; DWORD nSize; LPCSTR name; - appender = (wLogUdpAppender*) calloc(1, sizeof(wLogUdpAppender)); + appender = (wLogUdpAppender*)calloc(1, sizeof(wLogUdpAppender)); if (!appender) return NULL; @@ -198,7 +196,7 @@ wLogAppender* WLog_UdpAppender_New(wLog* log) if (nSize) { - appender->host = (LPSTR) malloc(nSize); + appender->host = (LPSTR)malloc(nSize); if (!appender->host) goto error_open; diff --git a/winpr/libwinpr/utils/wlog/wlog.c b/winpr/libwinpr/utils/wlog/wlog.c index c777093ee..53d350cff 100644 --- a/winpr/libwinpr/utils/wlog/wlog.c +++ b/winpr/libwinpr/utils/wlog/wlog.c @@ -57,16 +57,7 @@ typedef struct _wLogFilter wLogFilter; * http://docs.python.org/2/library/logging.html */ -LPCSTR WLOG_LEVELS[7] = -{ - "TRACE", - "DEBUG", - "INFO", - "WARN", - "ERROR", - "FATAL", - "OFF" -}; +LPCSTR WLOG_LEVELS[7] = { "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL", "OFF" }; static INIT_ONCE _WLogInitialized = INIT_ONCE_STATIC_INIT; static DWORD g_FilterCount = 0; @@ -120,7 +111,7 @@ static BOOL CALLBACK WLog_InitializeRoot(PINIT_ONCE InitOnce, PVOID Parameter, P if (nSize) { - env = (LPSTR) malloc(nSize); + env = (LPSTR)malloc(nSize); if (!env) goto fail; @@ -191,8 +182,7 @@ static BOOL log_recursion(LPCSTR file, LPCSTR fkt, int line) if (__android_log_print(ANDROID_LOG_FATAL, tag, "Recursion detected!!!") < 0) goto out; - if (__android_log_print(ANDROID_LOG_FATAL, tag, "Check %s [%s:%d]", fkt, file, - line) < 0) + if (__android_log_print(ANDROID_LOG_FATAL, tag, "Check %s [%s:%d]", fkt, file, line) < 0) goto out; for (i = 0; i < used; i++) @@ -208,7 +198,7 @@ static BOOL log_recursion(LPCSTR file, LPCSTR fkt, int line) goto out; for (i = 0; i < used; i++) - if (fprintf(stderr, "%s: %"PRIuz": %s\n", fkt, i, msg[i]) < 0) + if (fprintf(stderr, "%s: %" PRIuz ": %s\n", fkt, i, msg[i]) < 0) goto out; #endif @@ -238,8 +228,7 @@ static BOOL WLog_Write(wLog* log, wLogMessage* message) EnterCriticalSection(&appender->lock); if (appender->recursive) - status = log_recursion(message->FileName, message->FunctionName, - message->LineNumber); + status = log_recursion(message->FileName, message->FunctionName, message->LineNumber); else { appender->recursive = TRUE; @@ -270,8 +259,7 @@ static BOOL WLog_WriteData(wLog* log, wLogMessage* message) EnterCriticalSection(&appender->lock); if (appender->recursive) - status = log_recursion(message->FileName, message->FunctionName, - message->LineNumber); + status = log_recursion(message->FileName, message->FunctionName, message->LineNumber); else { appender->recursive = TRUE; @@ -302,8 +290,7 @@ static BOOL WLog_WriteImage(wLog* log, wLogMessage* message) EnterCriticalSection(&appender->lock); if (appender->recursive) - status = log_recursion(message->FileName, message->FunctionName, - message->LineNumber); + status = log_recursion(message->FileName, message->FunctionName, message->LineNumber); else { appender->recursive = TRUE; @@ -334,8 +321,7 @@ static BOOL WLog_WritePacket(wLog* log, wLogMessage* message) EnterCriticalSection(&appender->lock); if (appender->recursive) - status = log_recursion(message->FileName, message->FunctionName, - message->LineNumber); + status = log_recursion(message->FileName, message->FunctionName, message->LineNumber); else { appender->recursive = TRUE; @@ -347,8 +333,8 @@ static BOOL WLog_WritePacket(wLog* log, wLogMessage* message) return status; } -BOOL WLog_PrintMessageVA(wLog* log, DWORD type, DWORD level, DWORD line, - const char* file, const char* function, va_list args) +BOOL WLog_PrintMessageVA(wLog* log, DWORD type, DWORD level, DWORD line, const char* file, + const char* function, va_list args) { BOOL status = FALSE; wLogMessage message = { 0 }; @@ -365,15 +351,15 @@ BOOL WLog_PrintMessageVA(wLog* log, DWORD type, DWORD level, DWORD line, if (!strchr(message.FormatString, '%')) { - message.TextString = (LPSTR) message.FormatString; + message.TextString = (LPSTR)message.FormatString; status = WLog_Write(log, &message); } else { char formattedLogMessage[WLOG_MAX_STRING_SIZE]; - if (wvsnprintfx(formattedLogMessage, WLOG_MAX_STRING_SIZE - 1, - message.FormatString, args) < 0) + if (wvsnprintfx(formattedLogMessage, WLOG_MAX_STRING_SIZE - 1, message.FormatString, + args) < 0) return FALSE; message.TextString = formattedLogMessage; @@ -410,8 +396,8 @@ BOOL WLog_PrintMessageVA(wLog* log, DWORD type, DWORD level, DWORD line, return status; } -BOOL WLog_PrintMessage(wLog* log, DWORD type, DWORD level, DWORD line, - const char* file, const char* function, ...) +BOOL WLog_PrintMessage(wLog* log, DWORD type, DWORD level, DWORD line, const char* file, + const char* function, ...) { BOOL status; va_list args; @@ -511,7 +497,7 @@ BOOL WLog_AddStringLogFilters(LPCSTR filter) pos = g_FilterCount; size = g_FilterCount + count; - tmp = (wLogFilter*) realloc(g_Filters, size * sizeof(wLogFilter)); + tmp = (wLogFilter*)realloc(g_Filters, size * sizeof(wLogFilter)); if (!tmp) return FALSE; @@ -548,8 +534,7 @@ BOOL WLog_AddStringLogFilters(LPCSTR filter) filterStr = p + 1; p++; } - } - while (p != NULL); + } while (p != NULL); g_FilterCount = size; free(cp); @@ -639,7 +624,7 @@ BOOL WLog_ParseFilter(wLogFilter* filter, LPCSTR name) if (!name) return FALSE; - p = (char*) name; + p = (char*)name; if (p) { @@ -656,7 +641,7 @@ BOOL WLog_ParseFilter(wLogFilter* filter, LPCSTR name) return FALSE; filter->NameCount = count; - filter->Names = (LPSTR*) calloc((count + 1UL), sizeof(LPSTR)); + filter->Names = (LPSTR*)calloc((count + 1UL), sizeof(LPSTR)); if (!filter->Names) { @@ -667,7 +652,7 @@ BOOL WLog_ParseFilter(wLogFilter* filter, LPCSTR name) filter->Names[count] = NULL; count = 0; - p = (char*) names; + p = (char*)names; filter->Names[count++] = p; q = strrchr(p, ':'); @@ -693,11 +678,11 @@ BOOL WLog_ParseFilter(wLogFilter* filter, LPCSTR name) return FALSE; } - filter->Level = (DWORD) iLevel; + filter->Level = (DWORD)iLevel; while ((p = strchr(p, '.')) != NULL) { - if (count < (int) filter->NameCount) + if (count < (int)filter->NameCount) filter->Names[count++] = p + 1; *p = '\0'; @@ -721,7 +706,7 @@ BOOL WLog_ParseFilters(void) if (nSize < 1) return TRUE; - env = (LPSTR) malloc(nSize); + env = (LPSTR)malloc(nSize); if (!env) return FALSE; @@ -782,7 +767,7 @@ static BOOL WLog_ParseName(wLog* log, LPCSTR name) int count; LPSTR names; count = 1; - p = (char*) name; + p = (char*)name; while ((p = strchr(p, '.')) != NULL) { @@ -796,7 +781,7 @@ static BOOL WLog_ParseName(wLog* log, LPCSTR name) return FALSE; log->NameCount = count; - log->Names = (LPSTR*) calloc((count + 1UL), sizeof(LPSTR)); + log->Names = (LPSTR*)calloc((count + 1UL), sizeof(LPSTR)); if (!log->Names) { @@ -806,12 +791,12 @@ static BOOL WLog_ParseName(wLog* log, LPCSTR name) log->Names[count] = NULL; count = 0; - p = (char*) names; + p = (char*)names; log->Names[count++] = p; while ((p = strchr(p, '.')) != NULL) { - if (count < (int) log->NameCount) + if (count < (int)log->NameCount) log->Names[count++] = p + 1; *p = '\0'; @@ -827,7 +812,7 @@ wLog* WLog_New(LPCSTR name, wLog* rootLogger) char* env = NULL; DWORD nSize; int iLevel; - log = (wLog*) calloc(1, sizeof(wLog)); + log = (wLog*)calloc(1, sizeof(wLog)); if (!log) return NULL; @@ -845,7 +830,7 @@ wLog* WLog_New(LPCSTR name, wLog* rootLogger) log->ChildrenSize = 16; log->FilterLevel = WLOG_FILTER_NOT_INITIALIZED; - if (!(log->Children = (wLog**) calloc(log->ChildrenSize, sizeof(wLog*)))) + if (!(log->Children = (wLog**)calloc(log->ChildrenSize, sizeof(wLog*)))) goto out_fail; log->Appender = NULL; @@ -863,7 +848,7 @@ wLog* WLog_New(LPCSTR name, wLog* rootLogger) if (nSize) { - env = (LPSTR) malloc(nSize); + env = (LPSTR)malloc(nSize); if (!env) goto out_fail; @@ -880,7 +865,7 @@ wLog* WLog_New(LPCSTR name, wLog* rootLogger) if (iLevel >= 0) { - if (!WLog_SetLogLevel(log, (DWORD) iLevel)) + if (!WLog_SetLogLevel(log, (DWORD)iLevel)) goto out_fail; } } @@ -890,7 +875,7 @@ wLog* WLog_New(LPCSTR name, wLog* rootLogger) if (iLevel >= 0) { - if (!WLog_SetLogLevel(log, (DWORD) iLevel)) + if (!WLog_SetLogLevel(log, (DWORD)iLevel)) goto out_fail; } @@ -944,7 +929,7 @@ static BOOL WLog_AddChild(wLog* parent, wLog* child) } else { - tmp = (wLog**) realloc(parent->Children, sizeof(wLog*) * parent->ChildrenSize); + tmp = (wLog**)realloc(parent->Children, sizeof(wLog*) * parent->ChildrenSize); if (!tmp) { @@ -1025,4 +1010,3 @@ BOOL WLog_Uninit(void) { return TRUE; } - diff --git a/winpr/libwinpr/utils/wlog/wlog.h b/winpr/libwinpr/utils/wlog/wlog.h index b00cec1bd..c5729718c 100644 --- a/winpr/libwinpr/utils/wlog/wlog.h +++ b/winpr/libwinpr/utils/wlog/wlog.h @@ -22,39 +22,41 @@ #include -#define WLOG_MAX_PREFIX_SIZE 512 -#define WLOG_MAX_STRING_SIZE 8192 - +#define WLOG_MAX_PREFIX_SIZE 512 +#define WLOG_MAX_STRING_SIZE 8192 typedef BOOL (*WLOG_APPENDER_OPEN_FN)(wLog* log, wLogAppender* appender); typedef BOOL (*WLOG_APPENDER_CLOSE_FN)(wLog* log, wLogAppender* appender); -typedef BOOL (*WLOG_APPENDER_WRITE_MESSAGE_FN)(wLog* log, wLogAppender* appender, wLogMessage* message); -typedef BOOL (*WLOG_APPENDER_WRITE_DATA_MESSAGE_FN)(wLog* log, wLogAppender* appender, wLogMessage* message); -typedef BOOL (*WLOG_APPENDER_WRITE_IMAGE_MESSAGE_FN)(wLog* log, wLogAppender* appender, wLogMessage* message); -typedef BOOL (*WLOG_APPENDER_WRITE_PACKET_MESSAGE_FN)(wLog* log, wLogAppender* appender, wLogMessage* message); -typedef BOOL (*WLOG_APPENDER_SET)(wLogAppender* appender, const char *setting, void *value); +typedef BOOL (*WLOG_APPENDER_WRITE_MESSAGE_FN)(wLog* log, wLogAppender* appender, + wLogMessage* message); +typedef BOOL (*WLOG_APPENDER_WRITE_DATA_MESSAGE_FN)(wLog* log, wLogAppender* appender, + wLogMessage* message); +typedef BOOL (*WLOG_APPENDER_WRITE_IMAGE_MESSAGE_FN)(wLog* log, wLogAppender* appender, + wLogMessage* message); +typedef BOOL (*WLOG_APPENDER_WRITE_PACKET_MESSAGE_FN)(wLog* log, wLogAppender* appender, + wLogMessage* message); +typedef BOOL (*WLOG_APPENDER_SET)(wLogAppender* appender, const char* setting, void* value); typedef void (*WLOG_APPENDER_FREE)(wLogAppender* appender); -#define WLOG_APPENDER_COMMON() \ - DWORD Type; \ - BOOL active; \ - wLogLayout* Layout; \ - CRITICAL_SECTION lock; \ - BOOL recursive; \ - void* TextMessageContext; \ - void* DataMessageContext; \ - void* ImageMessageContext; \ - void* PacketMessageContext; \ - WLOG_APPENDER_OPEN_FN Open; \ - WLOG_APPENDER_CLOSE_FN Close; \ - WLOG_APPENDER_WRITE_MESSAGE_FN WriteMessage; \ - WLOG_APPENDER_WRITE_DATA_MESSAGE_FN WriteDataMessage; \ - WLOG_APPENDER_WRITE_IMAGE_MESSAGE_FN WriteImageMessage; \ +#define WLOG_APPENDER_COMMON() \ + DWORD Type; \ + BOOL active; \ + wLogLayout* Layout; \ + CRITICAL_SECTION lock; \ + BOOL recursive; \ + void* TextMessageContext; \ + void* DataMessageContext; \ + void* ImageMessageContext; \ + void* PacketMessageContext; \ + WLOG_APPENDER_OPEN_FN Open; \ + WLOG_APPENDER_CLOSE_FN Close; \ + WLOG_APPENDER_WRITE_MESSAGE_FN WriteMessage; \ + WLOG_APPENDER_WRITE_DATA_MESSAGE_FN WriteDataMessage; \ + WLOG_APPENDER_WRITE_IMAGE_MESSAGE_FN WriteImageMessage; \ WLOG_APPENDER_WRITE_PACKET_MESSAGE_FN WritePacketMessage; \ - WLOG_APPENDER_FREE Free; \ + WLOG_APPENDER_FREE Free; \ WLOG_APPENDER_SET Set - struct _wLogAppender { WLOG_APPENDER_COMMON(); @@ -78,11 +80,9 @@ struct _wLog DWORD ChildrenSize; }; - BOOL WLog_Layout_GetMessagePrefix(wLog* log, wLogLayout* layout, wLogMessage* message); #include "wlog/Layout.h" #include "wlog/Appender.h" - #endif /* WINPR_WLOG_PRIVATE_H */ diff --git a/winpr/libwinpr/winhttp/winhttp.c b/winpr/libwinpr/winhttp/winhttp.c index 728b747fd..74b9c6faf 100644 --- a/winpr/libwinpr/winhttp/winhttp.c +++ b/winpr/libwinpr/winhttp/winhttp.c @@ -25,7 +25,7 @@ /** * winhttp.dll: - * + * * WinHttpAddRequestHeaders * WinHttpAutoProxySvcMain * WinHttpCheckPlatform @@ -79,12 +79,14 @@ BOOL WinHttpTimeToSystemTime(LPCWSTR pwszTime, SYSTEMTIME* pst) return TRUE; } -BOOL WinHttpCrackUrl(LPCWSTR pwszUrl, DWORD dwUrlLength, DWORD dwFlags, LPURL_COMPONENTS lpUrlComponents) +BOOL WinHttpCrackUrl(LPCWSTR pwszUrl, DWORD dwUrlLength, DWORD dwFlags, + LPURL_COMPONENTS lpUrlComponents) { return TRUE; } -BOOL WinHttpCreateUrl(LPURL_COMPONENTS lpUrlComponents, DWORD dwFlags, LPWSTR pwszUrl, LPDWORD pdwUrlLength) +BOOL WinHttpCreateUrl(LPURL_COMPONENTS lpUrlComponents, DWORD dwFlags, LPWSTR pwszUrl, + LPDWORD pdwUrlLength) { return TRUE; } @@ -104,7 +106,8 @@ BOOL WinHttpSetDefaultProxyConfiguration(WINHTTP_PROXY_INFO* pProxyInfo) return TRUE; } -HINTERNET WinHttpOpen(LPCWSTR pszAgentW, DWORD dwAccessType, LPCWSTR pszProxyW, LPCWSTR pszProxyBypassW, DWORD dwFlags) +HINTERNET WinHttpOpen(LPCWSTR pszAgentW, DWORD dwAccessType, LPCWSTR pszProxyW, + LPCWSTR pszProxyBypassW, DWORD dwFlags) { return NULL; } @@ -114,17 +117,20 @@ BOOL WinHttpCloseHandle(HINTERNET hInternet) return TRUE; } -HINTERNET WinHttpConnect(HINTERNET hSession, LPCWSTR pswzServerName, INTERNET_PORT nServerPort, DWORD dwReserved) +HINTERNET WinHttpConnect(HINTERNET hSession, LPCWSTR pswzServerName, INTERNET_PORT nServerPort, + DWORD dwReserved) { return NULL; } -BOOL WinHttpReadData(HINTERNET hRequest, LPVOID lpBuffer, DWORD dwNumberOfBytesToRead, LPDWORD lpdwNumberOfBytesRead) +BOOL WinHttpReadData(HINTERNET hRequest, LPVOID lpBuffer, DWORD dwNumberOfBytesToRead, + LPDWORD lpdwNumberOfBytesRead) { return TRUE; } -BOOL WinHttpWriteData(HINTERNET hRequest, LPCVOID lpBuffer, DWORD dwNumberOfBytesToWrite, LPDWORD lpdwNumberOfBytesWritten) +BOOL WinHttpWriteData(HINTERNET hRequest, LPCVOID lpBuffer, DWORD dwNumberOfBytesToWrite, + LPDWORD lpdwNumberOfBytesWritten) { return TRUE; } @@ -134,7 +140,8 @@ BOOL WinHttpQueryDataAvailable(HINTERNET hRequest, LPDWORD lpdwNumberOfBytesAvai return TRUE; } -BOOL WinHttpQueryOption(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength) +BOOL WinHttpQueryOption(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, + LPDWORD lpdwBufferLength) { return TRUE; } @@ -144,47 +151,54 @@ BOOL WinHttpSetOption(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWOR return TRUE; } -BOOL WinHttpSetTimeouts(HINTERNET hInternet, int nResolveTimeout, int nConnectTimeout, int nSendTimeout, int nReceiveTimeout) +BOOL WinHttpSetTimeouts(HINTERNET hInternet, int nResolveTimeout, int nConnectTimeout, + int nSendTimeout, int nReceiveTimeout) { return TRUE; } DWORD WinHttpIsHostInProxyBypassList(const WINHTTP_PROXY_INFO* pProxyInfo, PCWSTR pwszHost, - INTERNET_SCHEME tScheme, INTERNET_PORT nPort, BOOL* pfIsInBypassList) + INTERNET_SCHEME tScheme, INTERNET_PORT nPort, + BOOL* pfIsInBypassList) { return 0; } WINHTTP_STATUS_CALLBACK WinHttpSetStatusCallback(HINTERNET hInternet, - WINHTTP_STATUS_CALLBACK lpfnInternetCallback, DWORD dwNotificationFlags, DWORD_PTR dwReserved) + WINHTTP_STATUS_CALLBACK lpfnInternetCallback, + DWORD dwNotificationFlags, DWORD_PTR dwReserved) { return NULL; } HINTERNET WinHttpOpenRequest(HINTERNET hConnect, LPCWSTR pwszVerb, LPCWSTR pwszObjectName, - LPCWSTR pwszVersion, LPCWSTR pwszReferrer, LPCWSTR* ppwszAcceptTypes, DWORD dwFlags) + LPCWSTR pwszVersion, LPCWSTR pwszReferrer, LPCWSTR* ppwszAcceptTypes, + DWORD dwFlags) { return NULL; } -BOOL WinHttpAddRequestHeaders(HINTERNET hRequest, LPCWSTR pwszHeaders, DWORD dwHeadersLength, DWORD dwModifiers) +BOOL WinHttpAddRequestHeaders(HINTERNET hRequest, LPCWSTR pwszHeaders, DWORD dwHeadersLength, + DWORD dwModifiers) { return TRUE; } BOOL WinHttpSendRequest(HINTERNET hRequest, LPCWSTR lpszHeaders, DWORD dwHeadersLength, - LPVOID lpOptional, DWORD dwOptionalLength, DWORD dwTotalLength, DWORD_PTR dwContext) + LPVOID lpOptional, DWORD dwOptionalLength, DWORD dwTotalLength, + DWORD_PTR dwContext) { return TRUE; } BOOL WinHttpSetCredentials(HINTERNET hRequest, DWORD AuthTargets, DWORD AuthScheme, - LPCWSTR pwszUserName, LPCWSTR pwszPassword, LPVOID pAuthParams) + LPCWSTR pwszUserName, LPCWSTR pwszPassword, LPVOID pAuthParams) { return TRUE; } -BOOL WinHttpQueryAuthSchemes(HINTERNET hRequest, LPDWORD lpdwSupportedSchemes, LPDWORD lpdwFirstScheme, LPDWORD pdwAuthTarget) +BOOL WinHttpQueryAuthSchemes(HINTERNET hRequest, LPDWORD lpdwSupportedSchemes, + LPDWORD lpdwFirstScheme, LPDWORD pdwAuthTarget) { return TRUE; } @@ -199,8 +213,8 @@ BOOL WinHttpReceiveResponse(HINTERNET hRequest, LPVOID lpReserved) return TRUE; } -BOOL WinHttpQueryHeaders(HINTERNET hRequest, DWORD dwInfoLevel, LPCWSTR pwszName, - LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex) +BOOL WinHttpQueryHeaders(HINTERNET hRequest, DWORD dwInfoLevel, LPCWSTR pwszName, LPVOID lpBuffer, + LPDWORD lpdwBufferLength, LPDWORD lpdwIndex) { return TRUE; } @@ -211,7 +225,8 @@ BOOL WinHttpDetectAutoProxyConfigUrl(DWORD dwAutoDetectFlags, LPWSTR* ppwstrAuto } BOOL WinHttpGetProxyForUrl(HINTERNET hSession, LPCWSTR lpcwszUrl, - WINHTTP_AUTOPROXY_OPTIONS* pAutoProxyOptions, WINHTTP_PROXY_INFO* pProxyInfo) + WINHTTP_AUTOPROXY_OPTIONS* pAutoProxyOptions, + WINHTTP_PROXY_INFO* pProxyInfo) { return TRUE; } diff --git a/winpr/libwinpr/winsock/winsock.c b/winpr/libwinpr/winsock/winsock.c index 1c612d0cc..6e82be96e 100644 --- a/winpr/libwinpr/winsock/winsock.c +++ b/winpr/libwinpr/winsock/winsock.c @@ -242,8 +242,8 @@ PCSTR winpr_inet_ntop(INT Family, PVOID pAddr, PSTR pStringBuf, size_t StringBuf memset(&in, 0, sizeof(in)); in.sin_family = AF_INET; memcpy(&in.sin_addr, pAddr, sizeof(struct in_addr)); - getnameinfo((struct sockaddr*) &in, sizeof(struct sockaddr_in), pStringBuf, StringBufSize, NULL, 0, - NI_NUMERICHOST); + getnameinfo((struct sockaddr*)&in, sizeof(struct sockaddr_in), pStringBuf, StringBufSize, + NULL, 0, NI_NUMERICHOST); return pStringBuf; } else if (Family == AF_INET6) @@ -252,8 +252,8 @@ PCSTR winpr_inet_ntop(INT Family, PVOID pAddr, PSTR pStringBuf, size_t StringBuf memset(&in, 0, sizeof(in)); in.sin6_family = AF_INET6; memcpy(&in.sin6_addr, pAddr, sizeof(struct in_addr6)); - getnameinfo((struct sockaddr*) &in, sizeof(struct sockaddr_in6), pStringBuf, StringBufSize, NULL, 0, - NI_NUMERICHOST); + getnameinfo((struct sockaddr*)&in, sizeof(struct sockaddr_in6), pStringBuf, StringBufSize, + NULL, 0, NI_NUMERICHOST); return pStringBuf; } @@ -268,17 +268,17 @@ INT winpr_inet_pton(INT Family, PCSTR pszAddrString, PVOID pAddrBuf) if ((Family != AF_INET) && (Family != AF_INET6)) return -1; - if (WSAStringToAddressA((char*) pszAddrString, Family, NULL, (struct sockaddr*) &addr, + if (WSAStringToAddressA((char*)pszAddrString, Family, NULL, (struct sockaddr*)&addr, &addr_len) != 0) return 0; if (Family == AF_INET) { - memcpy(pAddrBuf, &((struct sockaddr_in*) &addr)->sin_addr, sizeof(struct in_addr)); + memcpy(pAddrBuf, &((struct sockaddr_in*)&addr)->sin_addr, sizeof(struct in_addr)); } else if (Family == AF_INET6) { - memcpy(pAddrBuf, &((struct sockaddr_in6*) &addr)->sin6_addr, sizeof(struct in6_addr)); + memcpy(pAddrBuf, &((struct sockaddr_in6*)&addr)->sin6_addr, sizeof(struct in6_addr)); } return 1; @@ -343,7 +343,7 @@ void WSASetLastError(int iError) errno = EMFILE; break; - /* BSD sockets error codes */ + /* BSD sockets error codes */ case WSAEWOULDBLOCK: errno = EWOULDBLOCK; @@ -528,7 +528,7 @@ int WSAGetLastError(void) iError = WSAEMFILE; break; - /* BSD sockets error codes */ + /* BSD sockets error codes */ case EWOULDBLOCK: iError = WSAEWOULDBLOCK; @@ -784,13 +784,12 @@ SOCKET WSASocketA(int af, int type, int protocol, LPWSAPROTOCOL_INFOA lpProtocol SOCKET WSASocketW(int af, int type, int protocol, LPWSAPROTOCOL_INFOW lpProtocolInfo, GROUP g, DWORD dwFlags) { - return WSASocketA(af, type, protocol, (LPWSAPROTOCOL_INFOA) lpProtocolInfo, g, dwFlags); + return WSASocketA(af, type, protocol, (LPWSAPROTOCOL_INFOA)lpProtocolInfo, g, dwFlags); } -int WSAIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, - DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, - LPDWORD lpcbBytesReturned, LPWSAOVERLAPPED lpOverlapped, - LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) +int WSAIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, + LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, + LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) { int fd; int index; @@ -818,8 +817,8 @@ int WSAIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, return SOCKET_ERROR; } - fd = (int) s; - pInterfaces = (INTERFACE_INFO*) lpvOutBuffer; + fd = (int)s; + pInterfaces = (INTERFACE_INFO*)lpvOutBuffer; maxNumInterfaces = cbOutBuffer / sizeof(INTERFACE_INFO); #ifdef WSAIOCTL_IFADDRS { @@ -838,9 +837,9 @@ int WSAIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, for (ifa = ifap; ifa; ifa = ifa->ifa_next) { pInterface = &pInterfaces[index]; - pAddress = (struct sockaddr_in*) &pInterface->iiAddress; - pBroadcast = (struct sockaddr_in*) &pInterface->iiBroadcastAddress; - pNetmask = (struct sockaddr_in*) &pInterface->iiNetmask; + pAddress = (struct sockaddr_in*)&pInterface->iiAddress; + pBroadcast = (struct sockaddr_in*)&pInterface->iiBroadcastAddress; + pNetmask = (struct sockaddr_in*)&pInterface->iiNetmask; nFlags = 0; if (ifa->ifa_flags & IFF_UP) @@ -865,9 +864,9 @@ int WSAIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, if ((ifa->ifa_addr->sa_family != AF_INET) && (ifa->ifa_addr->sa_family != AF_INET6)) continue; - getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr), - address, sizeof(address), 0, 0, NI_NUMERICHOST); - inet_pton(ifa->ifa_addr->sa_family, address, (void*) &pAddress->sin_addr); + getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr), address, sizeof(address), 0, 0, + NI_NUMERICHOST); + inet_pton(ifa->ifa_addr->sa_family, address, (void*)&pAddress->sin_addr); } else { @@ -876,12 +875,13 @@ int WSAIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, if (ifa->ifa_dstaddr) { - if ((ifa->ifa_dstaddr->sa_family != AF_INET) && (ifa->ifa_dstaddr->sa_family != AF_INET6)) + if ((ifa->ifa_dstaddr->sa_family != AF_INET) && + (ifa->ifa_dstaddr->sa_family != AF_INET6)) continue; - getnameinfo(ifa->ifa_dstaddr, sizeof(struct sockaddr), - broadcast, sizeof(broadcast), 0, 0, NI_NUMERICHOST); - inet_pton(ifa->ifa_dstaddr->sa_family, broadcast, (void*) &pBroadcast->sin_addr); + getnameinfo(ifa->ifa_dstaddr, sizeof(struct sockaddr), broadcast, sizeof(broadcast), + 0, 0, NI_NUMERICHOST); + inet_pton(ifa->ifa_dstaddr->sa_family, broadcast, (void*)&pBroadcast->sin_addr); } else { @@ -890,12 +890,13 @@ int WSAIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, if (ifa->ifa_netmask) { - if ((ifa->ifa_netmask->sa_family != AF_INET) && (ifa->ifa_netmask->sa_family != AF_INET6)) + if ((ifa->ifa_netmask->sa_family != AF_INET) && + (ifa->ifa_netmask->sa_family != AF_INET6)) continue; - getnameinfo(ifa->ifa_netmask, sizeof(struct sockaddr), - netmask, sizeof(netmask), 0, 0, NI_NUMERICHOST); - inet_pton(ifa->ifa_netmask->sa_family, netmask, (void*) &pNetmask->sin_addr); + getnameinfo(ifa->ifa_netmask, sizeof(struct sockaddr), netmask, sizeof(netmask), 0, + 0, NI_NUMERICHOST); + inet_pton(ifa->ifa_netmask->sa_family, netmask, (void*)&pNetmask->sin_addr); } else { @@ -925,12 +926,13 @@ int WSAIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, numInterfaces = 0; ifreq = ifconf.ifc_req; - while ((ifconf.ifc_len >= 0) && (offset < (size_t)ifconf.ifc_len) && (numInterfaces < maxNumInterfaces)) + while ((ifconf.ifc_len >= 0) && (offset < (size_t)ifconf.ifc_len) && + (numInterfaces < maxNumInterfaces)) { pInterface = &pInterfaces[index]; - pAddress = (struct sockaddr_in*) &pInterface->iiAddress; - pBroadcast = (struct sockaddr_in*) &pInterface->iiBroadcastAddress; - pNetmask = (struct sockaddr_in*) &pInterface->iiNetmask; + pAddress = (struct sockaddr_in*)&pInterface->iiAddress; + pBroadcast = (struct sockaddr_in*)&pInterface->iiBroadcastAddress; + pNetmask = (struct sockaddr_in*)&pInterface->iiNetmask; if (ioctl(fd, SIOCGIFFLAGS, ifreq) != 0) goto next_ifreq; @@ -960,9 +962,9 @@ int WSAIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, if ((ifreq->ifr_addr.sa_family != AF_INET) && (ifreq->ifr_addr.sa_family != AF_INET6)) goto next_ifreq; - getnameinfo(&ifreq->ifr_addr, sizeof(ifreq->ifr_addr), - address, sizeof(address), 0, 0, NI_NUMERICHOST); - inet_pton(ifreq->ifr_addr.sa_family, address, (void*) &pAddress->sin_addr); + getnameinfo(&ifreq->ifr_addr, sizeof(ifreq->ifr_addr), address, sizeof(address), 0, 0, + NI_NUMERICHOST); + inet_pton(ifreq->ifr_addr.sa_family, address, (void*)&pAddress->sin_addr); if (ioctl(fd, SIOCGIFBRDADDR, ifreq) != 0) goto next_ifreq; @@ -970,9 +972,9 @@ int WSAIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, if ((ifreq->ifr_addr.sa_family != AF_INET) && (ifreq->ifr_addr.sa_family != AF_INET6)) goto next_ifreq; - getnameinfo(&ifreq->ifr_addr, sizeof(ifreq->ifr_addr), - broadcast, sizeof(broadcast), 0, 0, NI_NUMERICHOST); - inet_pton(ifreq->ifr_addr.sa_family, broadcast, (void*) &pBroadcast->sin_addr); + getnameinfo(&ifreq->ifr_addr, sizeof(ifreq->ifr_addr), broadcast, sizeof(broadcast), 0, 0, + NI_NUMERICHOST); + inet_pton(ifreq->ifr_addr.sa_family, broadcast, (void*)&pBroadcast->sin_addr); if (ioctl(fd, SIOCGIFNETMASK, ifreq) != 0) goto next_ifreq; @@ -980,9 +982,9 @@ int WSAIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, if ((ifreq->ifr_addr.sa_family != AF_INET) && (ifreq->ifr_addr.sa_family != AF_INET6)) goto next_ifreq; - getnameinfo(&ifreq->ifr_addr, sizeof(ifreq->ifr_addr), - netmask, sizeof(netmask), 0, 0, NI_NUMERICHOST); - inet_pton(ifreq->ifr_addr.sa_family, netmask, (void*) &pNetmask->sin_addr); + getnameinfo(&ifreq->ifr_addr, sizeof(ifreq->ifr_addr), netmask, sizeof(netmask), 0, 0, + NI_NUMERICHOST); + inet_pton(ifreq->ifr_addr.sa_family, netmask, (void*)&pNetmask->sin_addr); numInterfaces++; next_ifreq: #if !defined(__linux__) && !defined(__sun__) && !defined(__CYGWIN__) @@ -990,7 +992,7 @@ int WSAIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, #else ifreq_len = sizeof(*ifreq); #endif - ifreq = (struct ifreq*) & ((BYTE*) ifreq)[ifreq_len]; + ifreq = (struct ifreq*)&((BYTE*)ifreq)[ifreq_len]; offset += ifreq_len; index++; } @@ -1002,18 +1004,18 @@ int WSAIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, SOCKET _accept(SOCKET s, struct sockaddr* addr, int* addrlen) { int status; - int fd = (int) s; - socklen_t s_addrlen = (socklen_t) * addrlen; + int fd = (int)s; + socklen_t s_addrlen = (socklen_t)*addrlen; status = accept(fd, addr, &s_addrlen); - *addrlen = (socklen_t) s_addrlen; + *addrlen = (socklen_t)s_addrlen; return status; } int _bind(SOCKET s, const struct sockaddr* addr, int namelen) { int status; - int fd = (int) s; - status = bind(fd, addr, (socklen_t) namelen); + int fd = (int)s; + status = bind(fd, addr, (socklen_t)namelen); if (status < 0) return SOCKET_ERROR; @@ -1024,7 +1026,7 @@ int _bind(SOCKET s, const struct sockaddr* addr, int namelen) int closesocket(SOCKET s) { int status; - int fd = (int) s; + int fd = (int)s; status = close(fd); return status; } @@ -1032,8 +1034,8 @@ int closesocket(SOCKET s) int _connect(SOCKET s, const struct sockaddr* name, int namelen) { int status; - int fd = (int) s; - status = connect(fd, name, (socklen_t) namelen); + int fd = (int)s; + status = connect(fd, name, (socklen_t)namelen); if (status < 0) return SOCKET_ERROR; @@ -1043,7 +1045,7 @@ int _connect(SOCKET s, const struct sockaddr* name, int namelen) int _ioctlsocket(SOCKET s, long cmd, u_long* argp) { - int fd = (int) s; + int fd = (int)s; if (cmd == FIONBIO) { @@ -1069,30 +1071,30 @@ int _ioctlsocket(SOCKET s, long cmd, u_long* argp) int _getpeername(SOCKET s, struct sockaddr* name, int* namelen) { int status; - int fd = (int) s; - socklen_t s_namelen = (socklen_t) * namelen; + int fd = (int)s; + socklen_t s_namelen = (socklen_t)*namelen; status = getpeername(fd, name, &s_namelen); - *namelen = (int) s_namelen; + *namelen = (int)s_namelen; return status; } int _getsockname(SOCKET s, struct sockaddr* name, int* namelen) { int status; - int fd = (int) s; - socklen_t s_namelen = (socklen_t) * namelen; + int fd = (int)s; + socklen_t s_namelen = (socklen_t)*namelen; status = getsockname(fd, name, &s_namelen); - *namelen = (int) s_namelen; + *namelen = (int)s_namelen; return status; } int _getsockopt(SOCKET s, int level, int optname, char* optval, int* optlen) { int status; - int fd = (int) s; - socklen_t s_optlen = (socklen_t) * optlen; - status = getsockopt(fd, level, optname, (void*) optval, &s_optlen); - *optlen = (socklen_t) s_optlen; + int fd = (int)s; + socklen_t s_optlen = (socklen_t)*optlen; + status = getsockopt(fd, level, optname, (void*)optval, &s_optlen); + *optlen = (socklen_t)s_optlen; return status; } @@ -1108,7 +1110,7 @@ u_short _htons(u_short hostshort) unsigned long _inet_addr(const char* cp) { - return (long) inet_addr(cp); + return (long)inet_addr(cp); } char* _inet_ntoa(struct in_addr in) @@ -1119,7 +1121,7 @@ char* _inet_ntoa(struct in_addr in) int _listen(SOCKET s, int backlog) { int status; - int fd = (int) s; + int fd = (int)s; status = listen(fd, backlog); return status; } @@ -1137,18 +1139,18 @@ u_short _ntohs(u_short netshort) int _recv(SOCKET s, char* buf, int len, int flags) { int status; - int fd = (int) s; - status = (int) recv(fd, (void*) buf, (size_t) len, flags); + int fd = (int)s; + status = (int)recv(fd, (void*)buf, (size_t)len, flags); return status; } int _recvfrom(SOCKET s, char* buf, int len, int flags, struct sockaddr* from, int* fromlen) { int status; - int fd = (int) s; - socklen_t s_fromlen = (socklen_t) * fromlen; - status = (int) recvfrom(fd, (void*) buf, (size_t) len, flags, from, &s_fromlen); - *fromlen = (int) s_fromlen; + int fd = (int)s; + socklen_t s_fromlen = (socklen_t)*fromlen; + status = (int)recvfrom(fd, (void*)buf, (size_t)len, flags, from, &s_fromlen); + *fromlen = (int)s_fromlen; return status; } @@ -1159,9 +1161,8 @@ int _select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, do { - status = select(nfds, readfds, writefds, exceptfds, (struct timeval*) timeout); - } - while ((status < 0) && (errno == EINTR)); + status = select(nfds, readfds, writefds, exceptfds, (struct timeval*)timeout); + } while ((status < 0) && (errno == EINTR)); return status; } @@ -1169,32 +1170,32 @@ int _select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, int _send(SOCKET s, const char* buf, int len, int flags) { int status; - int fd = (int) s; + int fd = (int)s; flags |= MSG_NOSIGNAL; - status = (int) send(fd, (void*) buf, (size_t) len, flags); + status = (int)send(fd, (void*)buf, (size_t)len, flags); return status; } int _sendto(SOCKET s, const char* buf, int len, int flags, const struct sockaddr* to, int tolen) { int status; - int fd = (int) s; - status = (int) sendto(fd, (void*) buf, (size_t) len, flags, to, (socklen_t) tolen); + int fd = (int)s; + status = (int)sendto(fd, (void*)buf, (size_t)len, flags, to, (socklen_t)tolen); return status; } int _setsockopt(SOCKET s, int level, int optname, const char* optval, int optlen) { int status; - int fd = (int) s; - status = setsockopt(fd, level, optname, (void*) optval, (socklen_t) optlen); + int fd = (int)s; + status = setsockopt(fd, level, optname, (void*)optval, (socklen_t)optlen); return status; } int _shutdown(SOCKET s, int how) { int status; - int fd = (int) s; + int fd = (int)s; int s_how = -1; switch (how) @@ -1228,14 +1229,14 @@ SOCKET _socket(int af, int type, int protocol) if (fd < 0) return INVALID_SOCKET; - s = (SOCKET) fd; + s = (SOCKET)fd; return s; } struct hostent* _gethostbyaddr(const char* addr, int len, int type) { struct hostent* host; - host = gethostbyaddr((void*) addr, (socklen_t) len, type); + host = gethostbyaddr((void*)addr, (socklen_t)len, type); return host; } @@ -1249,7 +1250,7 @@ struct hostent* _gethostbyname(const char* name) int _gethostname(char* name, int namelen) { int status; - status = gethostname(name, (size_t) namelen); + status = gethostname(name, (size_t)namelen); return status; } @@ -1281,4 +1282,4 @@ struct protoent* _getprotobyname(const char* name) return proto; } -#endif /* _WIN32 */ +#endif /* _WIN32 */ diff --git a/winpr/libwinpr/wnd/test/TestWndCreateWindowEx.c b/winpr/libwinpr/wnd/test/TestWndCreateWindowEx.c index c3dfff116..01a5ca440 100644 --- a/winpr/libwinpr/wnd/test/TestWndCreateWindowEx.c +++ b/winpr/libwinpr/wnd/test/TestWndCreateWindowEx.c @@ -5,22 +5,19 @@ #include #include -const char* WM_WTS_STRINGS[] = -{ - "", - "WTS_CONSOLE_CONNECT", - "WTS_CONSOLE_DISCONNECT", - "WTS_REMOTE_CONNECT", - "WTS_REMOTE_DISCONNECT", - "WTS_SESSION_LOGON", - "WTS_SESSION_LOGOFF", - "WTS_SESSION_LOCK", - "WTS_SESSION_UNLOCK", - "WTS_SESSION_REMOTE_CONTROL", - "WTS_SESSION_CREATE", - "WTS_SESSION_TERMINATE", - "" -}; +const char* WM_WTS_STRINGS[] = { "", + "WTS_CONSOLE_CONNECT", + "WTS_CONSOLE_DISCONNECT", + "WTS_REMOTE_CONNECT", + "WTS_REMOTE_DISCONNECT", + "WTS_SESSION_LOGON", + "WTS_SESSION_LOGOFF", + "WTS_SESSION_LOCK", + "WTS_SESSION_UNLOCK", + "WTS_SESSION_REMOTE_CONTROL", + "WTS_SESSION_CREATE", + "WTS_SESSION_TERMINATE", + "" }; static LRESULT CALLBACK TestWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { @@ -29,15 +26,15 @@ static LRESULT CALLBACK TestWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM case WM_WTSSESSION_CHANGE: if (wParam && (wParam < 13)) { - PWTSSESSION_NOTIFICATION pNotification = (PWTSSESSION_NOTIFICATION) lParam; + PWTSSESSION_NOTIFICATION pNotification = (PWTSSESSION_NOTIFICATION)lParam; - printf("WM_WTSSESSION_CHANGE: %s SessionId: %"PRIu32"\n", - WM_WTS_STRINGS[wParam], (int) pNotification->dwSessionId); + printf("WM_WTSSESSION_CHANGE: %s SessionId: %" PRIu32 "\n", WM_WTS_STRINGS[wParam], + (int)pNotification->dwSessionId); } break; default: - printf("TestWndProc: uMsg: 0x%08"PRIX32"\n", uMsg); + printf("TestWndProc: uMsg: 0x%08" PRIX32 "\n", uMsg); return DefWindowProc(hwnd, uMsg, wParam, lParam); break; } @@ -77,8 +74,8 @@ int TestWndCreateWindowEx(int argc, char* argv[]) hInstance = wndClassEx.hInstance; - hWnd = CreateWindowEx(0, wndClassEx.lpszClassName, - 0, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, hInstance, NULL); + hWnd = CreateWindowEx(0, wndClassEx.lpszClassName, 0, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, hInstance, + NULL); if (!hWnd) { @@ -89,10 +86,9 @@ int TestWndCreateWindowEx(int argc, char* argv[]) wtsSessionNotification.cbSize = sizeof(WTSSESSION_NOTIFICATION); wtsSessionNotification.dwSessionId = 123; - SendMessage(hWnd, WM_WTSSESSION_CHANGE, WTS_SESSION_LOGON, (LPARAM) &wtsSessionNotification); + SendMessage(hWnd, WM_WTSSESSION_CHANGE, WTS_SESSION_LOGON, (LPARAM)&wtsSessionNotification); DestroyWindow(hWnd); return 0; } - diff --git a/winpr/libwinpr/wnd/test/TestWndWmCopyData.c b/winpr/libwinpr/wnd/test/TestWndWmCopyData.c index 4581c19a6..cf1d8ca68 100644 --- a/winpr/libwinpr/wnd/test/TestWndWmCopyData.c +++ b/winpr/libwinpr/wnd/test/TestWndWmCopyData.c @@ -11,23 +11,23 @@ static LRESULT CALLBACK TestWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM switch (uMsg) { case WM_COPYDATA: - { - pCopyData = (PCOPYDATASTRUCT) lParam; + { + pCopyData = (PCOPYDATASTRUCT)lParam; - if (!pCopyData) - break; + if (!pCopyData) + break; - printf("WM_COPYDATA: cbData: %"PRIu32" dwData: %"PRIu32"\n", - (int) pCopyData->cbData, (int) pCopyData->dwData); - } - break; + printf("WM_COPYDATA: cbData: %" PRIu32 " dwData: %" PRIu32 "\n", (int)pCopyData->cbData, + (int)pCopyData->dwData); + } + break; case WM_CLOSE: printf("WM_CLOSE\n"); break; default: - printf("TestWndProc: uMsg: 0x%08"PRIX32"\n", uMsg); + printf("TestWndProc: uMsg: 0x%08" PRIX32 "\n", uMsg); return DefWindowProc(hwnd, uMsg, wParam, lParam); break; } @@ -66,8 +66,8 @@ int TestWndWmCopyData(int argc, char* argv[]) hInstance = wndClassEx.hInstance; - hWnd = CreateWindowEx(0, wndClassEx.lpszClassName, - 0, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, hInstance, NULL); + hWnd = CreateWindowEx(0, wndClassEx.lpszClassName, 0, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, hInstance, + NULL); if (!hWnd) { @@ -81,4 +81,3 @@ int TestWndWmCopyData(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/wnd/wnd.c b/winpr/libwinpr/wnd/wnd.c index 480ea07b5..cb18e2447 100644 --- a/winpr/libwinpr/wnd/wnd.c +++ b/winpr/libwinpr/wnd/wnd.c @@ -82,7 +82,7 @@ WNDCLASSEXA* FindWindowClass(LPCSTR lpClassName) for (index = 0; index < count; index++) { - lpwcx = (WNDCLASSEXA*) ArrayList_GetItem(g_WindowClasses, index); + lpwcx = (WNDCLASSEXA*)ArrayList_GetItem(g_WindowClasses, index); if (strcmp(lpClassName, lpwcx->lpszClassName) == 0) { @@ -154,7 +154,7 @@ BOOL WINAPI DestroyWindow(HWND hWnd) { WINPR_WND* pWnd; - pWnd = (WINPR_WND*) hWnd; + pWnd = (WINPR_WND*)hWnd; if (!pWnd) return FALSE; @@ -170,7 +170,6 @@ BOOL WINAPI DestroyWindow(HWND hWnd) VOID WINAPI PostQuitMessage(int nExitCode) { - } ATOM WINAPI RegisterClassA(CONST WNDCLASSA* lpWndClass) @@ -192,7 +191,7 @@ ATOM WINAPI RegisterClassExA(CONST WNDCLASSEXA* lpwcx) _lpwcx = CloneWindowClass(lpwcx); - return ArrayList_Add(g_WindowClasses, (void*) _lpwcx) >= 0; + return ArrayList_Add(g_WindowClasses, (void*)_lpwcx) >= 0; } ATOM WINAPI RegisterClassExW(CONST WNDCLASSEXW* lpwcx) @@ -210,9 +209,9 @@ BOOL WINAPI UnregisterClassW(LPCWSTR lpClassName, HINSTANCE hInstance) return TRUE; } -HWND WINAPI CreateWindowExA(DWORD dwExStyle, LPCSTR lpClassName, - LPCSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, - HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam) +HWND WINAPI CreateWindowExA(DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName, DWORD dwStyle, + int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, + HINSTANCE hInstance, LPVOID lpParam) { HWND hWnd; WINPR_WND* pWnd; @@ -228,12 +227,12 @@ HWND WINAPI CreateWindowExA(DWORD dwExStyle, LPCSTR lpClassName, if (!lpwcx) return NULL; - pWnd = (WINPR_WND*) calloc(1, sizeof(WINPR_WND)); + pWnd = (WINPR_WND*)calloc(1, sizeof(WINPR_WND)); if (!pWnd) return NULL; - hWnd = (HWND) pWnd; + hWnd = (HWND)pWnd; pWnd->X = X; pWnd->Y = Y; @@ -265,9 +264,9 @@ out_fail: return NULL; } -HWND WINAPI CreateWindowExW(DWORD dwExStyle, LPCWSTR lpClassName, - LPCWSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, - HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam) +HWND WINAPI CreateWindowExW(DWORD dwExStyle, LPCWSTR lpClassName, LPCWSTR lpWindowName, + DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, + HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam) { return NULL; } @@ -287,7 +286,8 @@ HWND WINAPI FindWindowExA(HWND hWndParent, HWND hWndChildAfter, LPCSTR lpszClass return NULL; } -HWND WINAPI FindWindowExW(HWND hWndParent, HWND hWndChildAfter, LPCWSTR lpszClass, LPCWSTR lpszWindow) +HWND WINAPI FindWindowExW(HWND hWndParent, HWND hWndChildAfter, LPCWSTR lpszClass, + LPCWSTR lpszWindow) { return NULL; } @@ -333,7 +333,7 @@ LRESULT WINAPI SendMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) WINPR_WND* pWnd; WNDPROC lpfnWndProc; - pWnd = (WINPR_WND*) hWnd; + pWnd = (WINPR_WND*)hWnd; if (!pWnd) return 0; @@ -353,14 +353,14 @@ LRESULT WINAPI SendMessageW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) return 0; } -LRESULT WINAPI SendMessageTimeoutA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, - UINT fuFlags, UINT uTimeout, PDWORD_PTR lpdwResult) +LRESULT WINAPI SendMessageTimeoutA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, UINT fuFlags, + UINT uTimeout, PDWORD_PTR lpdwResult) { return 0; } -LRESULT WINAPI SendMessageTimeoutW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, - UINT fuFlags, UINT uTimeout, PDWORD_PTR lpdwResult) +LRESULT WINAPI SendMessageTimeoutW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, UINT fuFlags, + UINT uTimeout, PDWORD_PTR lpdwResult) { return 0; } @@ -376,13 +376,13 @@ BOOL WINAPI SendNotifyMessageW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam } BOOL WINAPI SendMessageCallbackA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, - SENDASYNCPROC lpResultCallBack, ULONG_PTR dwData) + SENDASYNCPROC lpResultCallBack, ULONG_PTR dwData) { return TRUE; } BOOL WINAPI SendMessageCallbackW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, - SENDASYNCPROC lpResultCallBack, ULONG_PTR dwData) + SENDASYNCPROC lpResultCallBack, ULONG_PTR dwData) { return TRUE; } @@ -402,12 +402,14 @@ LRESULT WINAPI DispatchMessageW(CONST MSG* lpMsg) return 0; } -BOOL WINAPI PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg) +BOOL WINAPI PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, + UINT wRemoveMsg) { return TRUE; } -BOOL WINAPI PeekMessageW(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg) +BOOL WINAPI PeekMessageW(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, + UINT wRemoveMsg) { return TRUE; } @@ -422,12 +424,14 @@ BOOL WINAPI WaitMessage(VOID) return TRUE; } -LRESULT WINAPI CallWindowProcA(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +LRESULT WINAPI CallWindowProcA(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, + LPARAM lParam) { return 0; } -LRESULT WINAPI CallWindowProcW(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +LRESULT WINAPI CallWindowProcW(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, + LPARAM lParam) { return 0; } diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiEnumerateProcesses.c b/winpr/libwinpr/wtsapi/test/TestWtsApiEnumerateProcesses.c index aad4b3db3..a03637549 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiEnumerateProcesses.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiEnumerateProcesses.c @@ -28,7 +28,7 @@ int TestWtsApiEnumerateProcesses(int argc, char* argv[]) if (!bSuccess) { - printf("WTSEnumerateProcesses failed: %"PRIu32"\n", GetLastError()); + printf("WTSEnumerateProcesses failed: %" PRIu32 "\n", GetLastError()); return -1; } diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiEnumerateSessions.c b/winpr/libwinpr/wtsapi/test/TestWtsApiEnumerateSessions.c index da6ff4e35..a94a24071 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiEnumerateSessions.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiEnumerateSessions.c @@ -29,19 +29,17 @@ int TestWtsApiEnumerateSessions(int argc, char* argv[]) if (!bSuccess) { - printf("WTSEnumerateSessions failed: %"PRIu32"\n", GetLastError()); + printf("WTSEnumerateSessions failed: %" PRIu32 "\n", GetLastError()); return 0; } - printf("WTSEnumerateSessions count: %"PRIu32"\n", count); + printf("WTSEnumerateSessions count: %" PRIu32 "\n", count); for (index = 0; index < count; index++) { - printf("[%"PRIu32"] SessionId: %"PRIu32" WinstationName: '%s' State: %s (%u)\n", index, - pSessionInfo[index].SessionId, - pSessionInfo[index].pWinStationName, - WTSSessionStateToString(pSessionInfo[index].State), - pSessionInfo[index].State); + printf("[%" PRIu32 "] SessionId: %" PRIu32 " WinstationName: '%s' State: %s (%u)\n", index, + pSessionInfo[index].SessionId, pSessionInfo[index].pWinStationName, + WTSSessionStateToString(pSessionInfo[index].State), pSessionInfo[index].State); } WTSFreeMemory(pSessionInfo); diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraDisconnectSession.c b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraDisconnectSession.c index 2e2cfe2fd..4d04e5987 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraDisconnectSession.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraDisconnectSession.c @@ -14,7 +14,7 @@ int TestWtsApiExtraDisconnectSession(int argc, char* argv[]) if (!bSuccess) { - printf("WTSDisconnectSession failed: %"PRIu32"\n", GetLastError()); + printf("WTSDisconnectSession failed: %" PRIu32 "\n", GetLastError()); return -1; } diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraDynamicVirtualChannel.c b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraDynamicVirtualChannel.c index a2c61fe3e..d0bd87ed3 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraDynamicVirtualChannel.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraDynamicVirtualChannel.c @@ -14,31 +14,31 @@ int TestWtsApiExtraDynamicVirtualChannel(int argc, char* argv[]) length = sizeof(buffer); - hVirtualChannel = WTSVirtualChannelOpenEx( WTS_CURRENT_SESSION, "ECHO",WTS_CHANNEL_OPTION_DYNAMIC); - + hVirtualChannel = + WTSVirtualChannelOpenEx(WTS_CURRENT_SESSION, "ECHO", WTS_CHANNEL_OPTION_DYNAMIC); if (hVirtualChannel == INVALID_HANDLE_VALUE) { - printf("WTSVirtualChannelOpen failed: %"PRIu32"\n", GetLastError()); + printf("WTSVirtualChannelOpen failed: %" PRIu32 "\n", GetLastError()); return -1; } printf("WTSVirtualChannelOpen opend"); bytesWritten = 0; - bSuccess = WTSVirtualChannelWrite(hVirtualChannel, (PCHAR) buffer, length, &bytesWritten); + bSuccess = WTSVirtualChannelWrite(hVirtualChannel, (PCHAR)buffer, length, &bytesWritten); if (!bSuccess) { - printf("WTSVirtualChannelWrite failed: %"PRIu32"\n", GetLastError()); + printf("WTSVirtualChannelWrite failed: %" PRIu32 "\n", GetLastError()); return -1; } printf("WTSVirtualChannelWrite written"); bytesRead = 0; - bSuccess = WTSVirtualChannelRead(hVirtualChannel, 5000, (PCHAR) buffer, length, &bytesRead); + bSuccess = WTSVirtualChannelRead(hVirtualChannel, 5000, (PCHAR)buffer, length, &bytesRead); if (!bSuccess) { - printf("WTSVirtualChannelRead failed: %"PRIu32"\n", GetLastError()); + printf("WTSVirtualChannelRead failed: %" PRIu32 "\n", GetLastError()); return -1; } printf("WTSVirtualChannelRead read"); @@ -51,4 +51,3 @@ int TestWtsApiExtraDynamicVirtualChannel(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraLogoffSession.c b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraLogoffSession.c index 01da9029f..2af5002e7 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraLogoffSession.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraLogoffSession.c @@ -14,7 +14,7 @@ int TestWtsApiExtraLogoffSession(int argc, char* argv[]) if (!bSuccess) { - printf("WTSLogoffSession failed: %"PRIu32"\n", GetLastError()); + printf("WTSLogoffSession failed: %" PRIu32 "\n", GetLastError()); return -1; } diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraSendMessage.c b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraSendMessage.c index 32ba995b4..f311af803 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraSendMessage.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraSendMessage.c @@ -15,15 +15,16 @@ int TestWtsApiExtraSendMessage(int argc, char* argv[]) hServer = WTS_CURRENT_SERVER_HANDLE; - bSuccess = WTSSendMessageA(hServer, WTS_CURRENT_SESSION,TITLE,strlen(TITLE) + 1, MESSAGE, strlen(MESSAGE) + 1, MB_CANCELTRYCONTINUE, 3 , &result,TRUE); + bSuccess = WTSSendMessageA(hServer, WTS_CURRENT_SESSION, TITLE, strlen(TITLE) + 1, MESSAGE, + strlen(MESSAGE) + 1, MB_CANCELTRYCONTINUE, 3, &result, TRUE); if (!bSuccess) { - printf("WTSSendMessage failed: %"PRIu32"\n", GetLastError()); + printf("WTSSendMessage failed: %" PRIu32 "\n", GetLastError()); return -1; } - printf("WTSSendMessage got result: %"PRIu32"\n", result); + printf("WTSSendMessage got result: %" PRIu32 "\n", result); return 0; } diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraStartRemoteSessionEx.c b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraStartRemoteSessionEx.c index 74dc0f8a1..179d33b2a 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraStartRemoteSessionEx.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraStartRemoteSessionEx.c @@ -12,16 +12,18 @@ int TestWtsApiExtraStartRemoteSessionEx(int argc, char* argv[]) char logonIdStr[10]; bSuccess = GetEnvironmentVariableA("TEST_SESSION_LOGON_ID", logonIdStr, 10); - if(bSuccess) + if (bSuccess) { sscanf(logonIdStr, "%u\n", &logonId); } - bSuccess = WTSStartRemoteControlSessionEx(NULL, logonId, VK_F10, REMOTECONTROL_KBDSHIFT_HOTKEY|REMOTECONTROL_KBDCTRL_HOTKEY, REMOTECONTROL_FLAG_DISABLE_INPUT); + bSuccess = WTSStartRemoteControlSessionEx( + NULL, logonId, VK_F10, REMOTECONTROL_KBDSHIFT_HOTKEY | REMOTECONTROL_KBDCTRL_HOTKEY, + REMOTECONTROL_FLAG_DISABLE_INPUT); if (!bSuccess) { - printf("WTSStartRemoteControlSessionEx failed: %"PRIu32"\n", GetLastError()); + printf("WTSStartRemoteControlSessionEx failed: %" PRIu32 "\n", GetLastError()); return -1; } diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraVirtualChannel.c b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraVirtualChannel.c index 0ec08cdcf..c528e518f 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraVirtualChannel.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraVirtualChannel.c @@ -14,30 +14,31 @@ int TestWtsApiExtraVirtualChannel(int argc, char* argv[]) length = sizeof(buffer); - hVirtualChannel = WTSVirtualChannelOpen(WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION, "sample"); + hVirtualChannel = + WTSVirtualChannelOpen(WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION, "sample"); if (hVirtualChannel == INVALID_HANDLE_VALUE) { - printf("WTSVirtualChannelOpen failed: %"PRIu32"\n", GetLastError()); + printf("WTSVirtualChannelOpen failed: %" PRIu32 "\n", GetLastError()); return -1; } printf("WTSVirtualChannelOpen opend"); bytesWritten = 0; - bSuccess = WTSVirtualChannelWrite(hVirtualChannel, (PCHAR) buffer, length, &bytesWritten); + bSuccess = WTSVirtualChannelWrite(hVirtualChannel, (PCHAR)buffer, length, &bytesWritten); if (!bSuccess) { - printf("WTSVirtualChannelWrite failed: %"PRIu32"\n", GetLastError()); + printf("WTSVirtualChannelWrite failed: %" PRIu32 "\n", GetLastError()); return -1; } printf("WTSVirtualChannelWrite written"); bytesRead = 0; - bSuccess = WTSVirtualChannelRead(hVirtualChannel, 5000, (PCHAR) buffer, length, &bytesRead); + bSuccess = WTSVirtualChannelRead(hVirtualChannel, 5000, (PCHAR)buffer, length, &bytesRead); if (!bSuccess) { - printf("WTSVirtualChannelRead failed: %"PRIu32"\n", GetLastError()); + printf("WTSVirtualChannelRead failed: %" PRIu32 "\n", GetLastError()); return -1; } printf("WTSVirtualChannelRead read"); @@ -50,4 +51,3 @@ int TestWtsApiExtraVirtualChannel(int argc, char* argv[]) return 0; } - diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiQuerySessionInformation.c b/winpr/libwinpr/wtsapi/test/TestWtsApiQuerySessionInformation.c index 6e0b137fd..171ea6acd 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiQuerySessionInformation.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiQuerySessionInformation.c @@ -32,11 +32,11 @@ int TestWtsApiQuerySessionInformation(int argc, char* argv[]) if (!bSuccess) { - printf("WTSEnumerateSessions failed: %"PRIu32"\n", GetLastError()); + printf("WTSEnumerateSessions failed: %" PRIu32 "\n", GetLastError()); return 0; } - printf("WTSEnumerateSessions count: %"PRIu32"\n", count); + printf("WTSEnumerateSessions count: %" PRIu32 "\n", count); for (index = 0; index < count; index++) { @@ -56,149 +56,165 @@ int TestWtsApiQuerySessionInformation(int argc, char* argv[]) sessionId = pSessionInfo[index].SessionId; - printf("[%"PRIu32"] SessionId: %"PRIu32" State: %s (%u) WinstationName: '%s'\n", - index, - pSessionInfo[index].SessionId, - WTSSessionStateToString(pSessionInfo[index].State), - pSessionInfo[index].State, - pSessionInfo[index].pWinStationName); + printf("[%" PRIu32 "] SessionId: %" PRIu32 " State: %s (%u) WinstationName: '%s'\n", index, + pSessionInfo[index].SessionId, WTSSessionStateToString(pSessionInfo[index].State), + pSessionInfo[index].State, pSessionInfo[index].pWinStationName); /* WTSUserName */ - bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSUserName, &pBuffer, &bytesReturned); + bSuccess = + WTSQuerySessionInformationA(hServer, sessionId, WTSUserName, &pBuffer, &bytesReturned); if (!bSuccess) { - printf("WTSQuerySessionInformation WTSUserName failed: %"PRIu32"\n", GetLastError()); + printf("WTSQuerySessionInformation WTSUserName failed: %" PRIu32 "\n", GetLastError()); return -1; } - Username = (char*) pBuffer; + Username = (char*)pBuffer; printf("\tWTSUserName: '%s'\n", Username); /* WTSDomainName */ - bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSDomainName, &pBuffer, &bytesReturned); + bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSDomainName, &pBuffer, + &bytesReturned); if (!bSuccess) { - printf("WTSQuerySessionInformation WTSDomainName failed: %"PRIu32"\n", GetLastError()); + printf("WTSQuerySessionInformation WTSDomainName failed: %" PRIu32 "\n", + GetLastError()); return -1; } - Domain = (char*) pBuffer; + Domain = (char*)pBuffer; printf("\tWTSDomainName: '%s'\n", Domain); /* WTSConnectState */ - bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSConnectState, &pBuffer, &bytesReturned); + bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSConnectState, &pBuffer, + &bytesReturned); if (!bSuccess) { - printf("WTSQuerySessionInformation WTSConnectState failed: %"PRIu32"\n", GetLastError()); + printf("WTSQuerySessionInformation WTSConnectState failed: %" PRIu32 "\n", + GetLastError()); return -1; } - ConnectState = *((WTS_CONNECTSTATE_CLASS*) pBuffer); + ConnectState = *((WTS_CONNECTSTATE_CLASS*)pBuffer); printf("\tWTSConnectState: %u (%s)\n", ConnectState, WTSSessionStateToString(ConnectState)); /* WTSClientBuildNumber */ - bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSClientBuildNumber, &pBuffer, &bytesReturned); + bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSClientBuildNumber, &pBuffer, + &bytesReturned); if (!bSuccess) { - printf("WTSQuerySessionInformation WTSClientBuildNumber failed: %"PRIu32"\n", GetLastError()); + printf("WTSQuerySessionInformation WTSClientBuildNumber failed: %" PRIu32 "\n", + GetLastError()); return -1; } - ClientBuildNumber = *((ULONG*) pBuffer); - printf("\tWTSClientBuildNumber: %"PRIu32"\n", ClientBuildNumber); + ClientBuildNumber = *((ULONG*)pBuffer); + printf("\tWTSClientBuildNumber: %" PRIu32 "\n", ClientBuildNumber); /* WTSClientName */ - bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSClientName, &pBuffer, &bytesReturned); + bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSClientName, &pBuffer, + &bytesReturned); if (!bSuccess) { - printf("WTSQuerySessionInformation WTSClientName failed: %"PRIu32"\n", GetLastError()); + printf("WTSQuerySessionInformation WTSClientName failed: %" PRIu32 "\n", + GetLastError()); return -1; } - ClientName = (char*) pBuffer; + ClientName = (char*)pBuffer; printf("\tWTSClientName: '%s'\n", ClientName); /* WTSClientProductId */ - bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSClientProductId, &pBuffer, &bytesReturned); + bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSClientProductId, &pBuffer, + &bytesReturned); if (!bSuccess) { - printf("WTSQuerySessionInformation WTSClientProductId failed: %"PRIu32"\n", GetLastError()); + printf("WTSQuerySessionInformation WTSClientProductId failed: %" PRIu32 "\n", + GetLastError()); return -1; } - ClientProductId = *((USHORT*) pBuffer); - printf("\tWTSClientProductId: %"PRIu16"\n", ClientProductId); + ClientProductId = *((USHORT*)pBuffer); + printf("\tWTSClientProductId: %" PRIu16 "\n", ClientProductId); /* WTSClientHardwareId */ - bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSClientHardwareId, &pBuffer, &bytesReturned); + bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSClientHardwareId, &pBuffer, + &bytesReturned); if (!bSuccess) { - printf("WTSQuerySessionInformation WTSClientHardwareId failed: %"PRIu32"\n", GetLastError()); + printf("WTSQuerySessionInformation WTSClientHardwareId failed: %" PRIu32 "\n", + GetLastError()); return -1; } - ClientHardwareId = *((ULONG*) pBuffer); - printf("\tWTSClientHardwareId: %"PRIu32"\n", ClientHardwareId); + ClientHardwareId = *((ULONG*)pBuffer); + printf("\tWTSClientHardwareId: %" PRIu32 "\n", ClientHardwareId); /* WTSClientAddress */ - bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSClientAddress, &pBuffer, &bytesReturned); + bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSClientAddress, &pBuffer, + &bytesReturned); if (!bSuccess) { - printf("WTSQuerySessionInformation WTSClientAddress failed: %"PRIu32"\n", GetLastError()); + printf("WTSQuerySessionInformation WTSClientAddress failed: %" PRIu32 "\n", + GetLastError()); return -1; } - ClientAddress = (PWTS_CLIENT_ADDRESS) pBuffer; - printf("\tWTSClientAddress: AddressFamily: %"PRIu32" Address: ", - ClientAddress->AddressFamily); + ClientAddress = (PWTS_CLIENT_ADDRESS)pBuffer; + printf("\tWTSClientAddress: AddressFamily: %" PRIu32 " Address: ", + ClientAddress->AddressFamily); for (i = 0; i < sizeof(ClientAddress->Address); i++) - printf("%02"PRIX8"", ClientAddress->Address[i]); + printf("%02" PRIX8 "", ClientAddress->Address[i]); printf("\n"); - /* WTSClientDisplay */ - bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSClientDisplay, &pBuffer, &bytesReturned); + bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSClientDisplay, &pBuffer, + &bytesReturned); if (!bSuccess) { - printf("WTSQuerySessionInformation WTSClientDisplay failed: %"PRIu32"\n", GetLastError()); + printf("WTSQuerySessionInformation WTSClientDisplay failed: %" PRIu32 "\n", + GetLastError()); return -1; } - ClientDisplay = (PWTS_CLIENT_DISPLAY) pBuffer; - printf("\tWTSClientDisplay: HorizontalResolution: %"PRIu32" VerticalResolution: %"PRIu32" ColorDepth: %"PRIu32"\n", - ClientDisplay->HorizontalResolution, ClientDisplay->VerticalResolution, - ClientDisplay->ColorDepth); + ClientDisplay = (PWTS_CLIENT_DISPLAY)pBuffer; + printf("\tWTSClientDisplay: HorizontalResolution: %" PRIu32 " VerticalResolution: %" PRIu32 + " ColorDepth: %" PRIu32 "\n", + ClientDisplay->HorizontalResolution, ClientDisplay->VerticalResolution, + ClientDisplay->ColorDepth); /* WTSClientProtocolType */ - bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSClientProtocolType, &pBuffer, &bytesReturned); + bSuccess = WTSQuerySessionInformationA(hServer, sessionId, WTSClientProtocolType, &pBuffer, + &bytesReturned); if (!bSuccess) { - printf("WTSQuerySessionInformation WTSClientProtocolType failed: %"PRIu32"\n", GetLastError()); + printf("WTSQuerySessionInformation WTSClientProtocolType failed: %" PRIu32 "\n", + GetLastError()); return -1; } - ClientProtocolType = *((USHORT*) pBuffer); - printf("\tWTSClientProtocolType: %"PRIu16"\n", ClientProtocolType); + ClientProtocolType = *((USHORT*)pBuffer); + printf("\tWTSClientProtocolType: %" PRIu16 "\n", ClientProtocolType); } WTSFreeMemory(pSessionInfo); diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiSessionNotification.c b/winpr/libwinpr/wtsapi/test/TestWtsApiSessionNotification.c index ba5d5676c..8f081f770 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiSessionNotification.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiSessionNotification.c @@ -18,10 +18,12 @@ int TestWtsApiSessionNotification(int argc, char* argv[]) } #else /* We create a message-only window and use the predefined class name "STATIC" for simplicity */ - hWnd = CreateWindowA("STATIC", "TestWtsApiSessionNotification", 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL); + hWnd = CreateWindowA("STATIC", "TestWtsApiSessionNotification", 0, 0, 0, 0, 0, HWND_MESSAGE, + NULL, NULL, NULL); if (!hWnd) { - printf("%s: error creating message-only window: %"PRIu32"\n", __FUNCTION__, GetLastError()); + printf("%s: error creating message-only window: %" PRIu32 "\n", __FUNCTION__, + GetLastError()); return -1; } #endif @@ -32,7 +34,8 @@ int TestWtsApiSessionNotification(int argc, char* argv[]) if (!bSuccess) { - printf("%s: WTSRegisterSessionNotification failed: %"PRIu32"\n", __FUNCTION__, GetLastError()); + printf("%s: WTSRegisterSessionNotification failed: %" PRIu32 "\n", __FUNCTION__, + GetLastError()); return -1; } @@ -48,7 +51,8 @@ int TestWtsApiSessionNotification(int argc, char* argv[]) if (!bSuccess) { - printf("%s: WTSUnRegisterSessionNotification failed: %"PRIu32"\n", __FUNCTION__, GetLastError()); + printf("%s: WTSUnRegisterSessionNotification failed: %" PRIu32 "\n", __FUNCTION__, + GetLastError()); return -1; } diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiShutdownSystem.c b/winpr/libwinpr/wtsapi/test/TestWtsApiShutdownSystem.c index c79abab44..334ce4242 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiShutdownSystem.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiShutdownSystem.c @@ -24,7 +24,7 @@ int TestWtsApiShutdownSystem(int argc, char* argv[]) if (!bSuccess) { - printf("WTSShutdownSystem failed: %"PRIu32"\n", GetLastError()); + printf("WTSShutdownSystem failed: %" PRIu32 "\n", GetLastError()); return -1; } diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiWaitSystemEvent.c b/winpr/libwinpr/wtsapi/test/TestWtsApiWaitSystemEvent.c index 2f7051f4c..bc0d5f204 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiWaitSystemEvent.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiWaitSystemEvent.c @@ -28,7 +28,7 @@ int TestWtsApiWaitSystemEvent(int argc, char* argv[]) if (!bSuccess) { - printf("WTSWaitSystemEvent failed: %"PRIu32"\n", GetLastError()); + printf("WTSWaitSystemEvent failed: %" PRIu32 "\n", GetLastError()); return -1; } diff --git a/winpr/libwinpr/wtsapi/wtsapi.c b/winpr/libwinpr/wtsapi/wtsapi.c index 6794320e8..8500cf951 100644 --- a/winpr/libwinpr/wtsapi/wtsapi.c +++ b/winpr/libwinpr/wtsapi/wtsapi.c @@ -52,8 +52,9 @@ static HMODULE g_WtsApi32Module = NULL; static WtsApiFunctionTable WtsApi32_WtsApiFunctionTable = { 0 }; -#define WTSAPI32_LOAD_PROC(_name, _type) \ - WtsApi32_WtsApiFunctionTable.p ## _name = (## _type) GetProcAddress(g_WtsApi32Module, "WTS" #_name); +#define WTSAPI32_LOAD_PROC(_name, _type) \ + WtsApi32_WtsApiFunctionTable.p##_name = (##_type)GetProcAddress(g_WtsApi32Module, "WT" \ + "S" #_name); BOOL WtsApi32_InitializeWtsApi(void) { @@ -137,46 +138,53 @@ BOOL WtsApi32_InitializeWtsApi(void) /* WtsApi Functions */ -static BOOL CALLBACK InitializeWtsApiStubs(PINIT_ONCE once, PVOID param, PVOID *context); +static BOOL CALLBACK InitializeWtsApiStubs(PINIT_ONCE once, PVOID param, PVOID* context); static INIT_ONCE wtsapiInitOnce = INIT_ONCE_STATIC_INIT; -#define WTSAPI_STUB_CALL_VOID(_name, ...) \ +#define WTSAPI_STUB_CALL_VOID(_name, ...) \ InitOnceExecuteOnce(&wtsapiInitOnce, InitializeWtsApiStubs, NULL, NULL); \ - if (!g_WtsApi || !g_WtsApi->p ## _name) \ - return; \ - g_WtsApi->p ## _name ( __VA_ARGS__ ) + if (!g_WtsApi || !g_WtsApi->p##_name) \ + return; \ + g_WtsApi->p##_name(__VA_ARGS__) -#define WTSAPI_STUB_CALL_BOOL(_name, ...) \ +#define WTSAPI_STUB_CALL_BOOL(_name, ...) \ InitOnceExecuteOnce(&wtsapiInitOnce, InitializeWtsApiStubs, NULL, NULL); \ - if (!g_WtsApi || !g_WtsApi->p ## _name) \ - return FALSE; \ - return g_WtsApi->p ## _name ( __VA_ARGS__ ) + if (!g_WtsApi || !g_WtsApi->p##_name) \ + return FALSE; \ + return g_WtsApi->p##_name(__VA_ARGS__) -#define WTSAPI_STUB_CALL_HANDLE(_name, ...) \ +#define WTSAPI_STUB_CALL_HANDLE(_name, ...) \ InitOnceExecuteOnce(&wtsapiInitOnce, InitializeWtsApiStubs, NULL, NULL); \ - if (!g_WtsApi || !g_WtsApi->p ## _name) \ - return NULL; \ - return g_WtsApi->p ## _name ( __VA_ARGS__ ) + if (!g_WtsApi || !g_WtsApi->p##_name) \ + return NULL; \ + return g_WtsApi->p##_name(__VA_ARGS__) - -BOOL WINAPI WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers) +BOOL WINAPI WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, + BYTE HotkeyVk, USHORT HotkeyModifiers) { - WTSAPI_STUB_CALL_BOOL(StartRemoteControlSessionW, pTargetServerName, TargetLogonId, HotkeyVk, HotkeyModifiers); + WTSAPI_STUB_CALL_BOOL(StartRemoteControlSessionW, pTargetServerName, TargetLogonId, HotkeyVk, + HotkeyModifiers); } -BOOL WINAPI WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers) +BOOL WINAPI WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, + BYTE HotkeyVk, USHORT HotkeyModifiers) { - WTSAPI_STUB_CALL_BOOL(StartRemoteControlSessionA, pTargetServerName, TargetLogonId, HotkeyVk, HotkeyModifiers); + WTSAPI_STUB_CALL_BOOL(StartRemoteControlSessionA, pTargetServerName, TargetLogonId, HotkeyVk, + HotkeyModifiers); } -BOOL WINAPI WTSStartRemoteControlSessionExW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers, DWORD flags) +BOOL WINAPI WTSStartRemoteControlSessionExW(LPWSTR pTargetServerName, ULONG TargetLogonId, + BYTE HotkeyVk, USHORT HotkeyModifiers, DWORD flags) { - WTSAPI_STUB_CALL_BOOL(StartRemoteControlSessionExW, pTargetServerName, TargetLogonId, HotkeyVk, HotkeyModifiers, flags); + WTSAPI_STUB_CALL_BOOL(StartRemoteControlSessionExW, pTargetServerName, TargetLogonId, HotkeyVk, + HotkeyModifiers, flags); } -BOOL WINAPI WTSStartRemoteControlSessionExA(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers, DWORD flags) +BOOL WINAPI WTSStartRemoteControlSessionExA(LPSTR pTargetServerName, ULONG TargetLogonId, + BYTE HotkeyVk, USHORT HotkeyModifiers, DWORD flags) { - WTSAPI_STUB_CALL_BOOL(StartRemoteControlSessionExA, pTargetServerName, TargetLogonId, HotkeyVk, HotkeyModifiers, flags); + WTSAPI_STUB_CALL_BOOL(StartRemoteControlSessionExA, pTargetServerName, TargetLogonId, HotkeyVk, + HotkeyModifiers, flags); } BOOL WINAPI WTSStopRemoteControlSession(ULONG LogonId) @@ -194,12 +202,14 @@ BOOL WINAPI WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPasswor WTSAPI_STUB_CALL_BOOL(ConnectSessionA, LogonId, TargetLogonId, pPassword, bWait); } -BOOL WINAPI WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW* ppServerInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, + PWTS_SERVER_INFOW* ppServerInfo, DWORD* pCount) { WTSAPI_STUB_CALL_BOOL(EnumerateServersW, pDomainName, Reserved, Version, ppServerInfo, pCount); } -BOOL WINAPI WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, + PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount) { WTSAPI_STUB_CALL_BOOL(EnumerateServersA, pDomainName, Reserved, Version, ppServerInfo, pCount); } @@ -229,32 +239,38 @@ VOID WINAPI WTSCloseServer(HANDLE hServer) WTSAPI_STUB_CALL_VOID(CloseServer, hServer); } -BOOL WINAPI WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version, + PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount) { WTSAPI_STUB_CALL_BOOL(EnumerateSessionsW, hServer, Reserved, Version, ppSessionInfo, pCount); } -BOOL WINAPI WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version, + PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount) { WTSAPI_STUB_CALL_BOOL(EnumerateSessionsA, hServer, Reserved, Version, ppSessionInfo, pCount); } -BOOL WINAPI WTSEnumerateSessionsExW(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1W* ppSessionInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateSessionsExW(HANDLE hServer, DWORD* pLevel, DWORD Filter, + PWTS_SESSION_INFO_1W* ppSessionInfo, DWORD* pCount) { WTSAPI_STUB_CALL_BOOL(EnumerateSessionsExW, hServer, pLevel, Filter, ppSessionInfo, pCount); } -BOOL WINAPI WTSEnumerateSessionsExA(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1A* ppSessionInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateSessionsExA(HANDLE hServer, DWORD* pLevel, DWORD Filter, + PWTS_SESSION_INFO_1A* ppSessionInfo, DWORD* pCount) { WTSAPI_STUB_CALL_BOOL(EnumerateSessionsExA, hServer, pLevel, Filter, ppSessionInfo, pCount); } -BOOL WINAPI WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version, + PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount) { WTSAPI_STUB_CALL_BOOL(EnumerateProcessesW, hServer, Reserved, Version, ppProcessInfo, pCount); } -BOOL WINAPI WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version, + PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount) { WTSAPI_STUB_CALL_BOOL(EnumerateProcessesA, hServer, Reserved, Version, ppProcessInfo, pCount); } @@ -264,48 +280,65 @@ BOOL WINAPI WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode) WTSAPI_STUB_CALL_BOOL(TerminateProcess, hServer, ProcessId, ExitCode); } -BOOL WINAPI WTSQuerySessionInformationW(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPWSTR* ppBuffer, DWORD* pBytesReturned) +BOOL WINAPI WTSQuerySessionInformationW(HANDLE hServer, DWORD SessionId, + WTS_INFO_CLASS WTSInfoClass, LPWSTR* ppBuffer, + DWORD* pBytesReturned) { - WTSAPI_STUB_CALL_BOOL(QuerySessionInformationW, hServer, SessionId, WTSInfoClass, ppBuffer, pBytesReturned); + WTSAPI_STUB_CALL_BOOL(QuerySessionInformationW, hServer, SessionId, WTSInfoClass, ppBuffer, + pBytesReturned); } -BOOL WINAPI WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPSTR* ppBuffer, DWORD* pBytesReturned) +BOOL WINAPI WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, + WTS_INFO_CLASS WTSInfoClass, LPSTR* ppBuffer, + DWORD* pBytesReturned) { - WTSAPI_STUB_CALL_BOOL(QuerySessionInformationA, hServer, SessionId, WTSInfoClass, ppBuffer, pBytesReturned); + WTSAPI_STUB_CALL_BOOL(QuerySessionInformationA, hServer, SessionId, WTSInfoClass, ppBuffer, + pBytesReturned); } -BOOL WINAPI WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR* ppBuffer, DWORD* pBytesReturned) +BOOL WINAPI WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, + WTS_CONFIG_CLASS WTSConfigClass, LPWSTR* ppBuffer, + DWORD* pBytesReturned) { - WTSAPI_STUB_CALL_BOOL(QueryUserConfigW, pServerName, pUserName, WTSConfigClass, ppBuffer, pBytesReturned); + WTSAPI_STUB_CALL_BOOL(QueryUserConfigW, pServerName, pUserName, WTSConfigClass, ppBuffer, + pBytesReturned); } -BOOL WINAPI WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR* ppBuffer, DWORD* pBytesReturned) +BOOL WINAPI WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, + LPSTR* ppBuffer, DWORD* pBytesReturned) { - WTSAPI_STUB_CALL_BOOL(QueryUserConfigA, pServerName, pUserName, WTSConfigClass, ppBuffer, pBytesReturned); + WTSAPI_STUB_CALL_BOOL(QueryUserConfigA, pServerName, pUserName, WTSConfigClass, ppBuffer, + pBytesReturned); } -BOOL WINAPI WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, DWORD DataLength) +BOOL WINAPI WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, + LPWSTR pBuffer, DWORD DataLength) { - WTSAPI_STUB_CALL_BOOL(SetUserConfigW, pServerName, pUserName, WTSConfigClass, pBuffer, DataLength); + WTSAPI_STUB_CALL_BOOL(SetUserConfigW, pServerName, pUserName, WTSConfigClass, pBuffer, + DataLength); } -BOOL WINAPI WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength) +BOOL WINAPI WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, + LPSTR pBuffer, DWORD DataLength) { - WTSAPI_STUB_CALL_BOOL(SetUserConfigA, pServerName, pUserName, WTSConfigClass, pBuffer, DataLength); + WTSAPI_STUB_CALL_BOOL(SetUserConfigA, pServerName, pUserName, WTSConfigClass, pBuffer, + DataLength); } BOOL WINAPI WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, - LPWSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD* pResponse, BOOL bWait) + LPWSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, + DWORD* pResponse, BOOL bWait) { - WTSAPI_STUB_CALL_BOOL(SendMessageW, hServer, SessionId, pTitle, TitleLength, - pMessage, MessageLength, Style, Timeout, pResponse, bWait); + WTSAPI_STUB_CALL_BOOL(SendMessageW, hServer, SessionId, pTitle, TitleLength, pMessage, + MessageLength, Style, Timeout, pResponse, bWait); } BOOL WINAPI WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, - LPSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD* pResponse, BOOL bWait) + LPSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, + DWORD* pResponse, BOOL bWait) { - WTSAPI_STUB_CALL_BOOL(SendMessageA, hServer, SessionId, pTitle, TitleLength, - pMessage, MessageLength, Style, Timeout, pResponse, bWait); + WTSAPI_STUB_CALL_BOOL(SendMessageA, hServer, SessionId, pTitle, TitleLength, pMessage, + MessageLength, Style, Timeout, pResponse, bWait); } BOOL WINAPI WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait) @@ -343,12 +376,15 @@ BOOL WINAPI WTSVirtualChannelClose(HANDLE hChannelHandle) WTSAPI_STUB_CALL_BOOL(VirtualChannelClose, hChannelHandle); } -BOOL WINAPI WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead) +BOOL WINAPI WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, + ULONG BufferSize, PULONG pBytesRead) { - WTSAPI_STUB_CALL_BOOL(VirtualChannelRead, hChannelHandle, TimeOut, Buffer, BufferSize, pBytesRead); + WTSAPI_STUB_CALL_BOOL(VirtualChannelRead, hChannelHandle, TimeOut, Buffer, BufferSize, + pBytesRead); } -BOOL WINAPI WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten) +BOOL WINAPI WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, + PULONG pBytesWritten) { WTSAPI_STUB_CALL_BOOL(VirtualChannelWrite, hChannelHandle, Buffer, Length, pBytesWritten); } @@ -363,9 +399,11 @@ BOOL WINAPI WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle) WTSAPI_STUB_CALL_BOOL(VirtualChannelPurgeOutput, hChannelHandle); } -BOOL WINAPI WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned) +BOOL WINAPI WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, + PVOID* ppBuffer, DWORD* pBytesReturned) { - WTSAPI_STUB_CALL_BOOL(VirtualChannelQuery, hChannelHandle, WtsVirtualClass, ppBuffer, pBytesReturned); + WTSAPI_STUB_CALL_BOOL(VirtualChannelQuery, hChannelHandle, WtsVirtualClass, ppBuffer, + pBytesReturned); } VOID WINAPI WTSFreeMemory(PVOID pMemory) @@ -408,78 +446,90 @@ BOOL WINAPI WTSQueryUserToken(ULONG SessionId, PHANDLE phToken) WTSAPI_STUB_CALL_BOOL(QueryUserToken, SessionId, phToken); } -BOOL WINAPI WTSEnumerateProcessesExW(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPWSTR* ppProcessInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateProcessesExW(HANDLE hServer, DWORD* pLevel, DWORD SessionId, + LPWSTR* ppProcessInfo, DWORD* pCount) { WTSAPI_STUB_CALL_BOOL(EnumerateProcessesExW, hServer, pLevel, SessionId, ppProcessInfo, pCount); } -BOOL WINAPI WTSEnumerateProcessesExA(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPSTR* ppProcessInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateProcessesExA(HANDLE hServer, DWORD* pLevel, DWORD SessionId, + LPSTR* ppProcessInfo, DWORD* pCount) { WTSAPI_STUB_CALL_BOOL(EnumerateProcessesExA, hServer, pLevel, SessionId, ppProcessInfo, pCount); } -BOOL WINAPI WTSEnumerateListenersW(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEW pListeners, DWORD* pCount) +BOOL WINAPI WTSEnumerateListenersW(HANDLE hServer, PVOID pReserved, DWORD Reserved, + PWTSLISTENERNAMEW pListeners, DWORD* pCount) { WTSAPI_STUB_CALL_BOOL(EnumerateListenersW, hServer, pReserved, Reserved, pListeners, pCount); } -BOOL WINAPI WTSEnumerateListenersA(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEA pListeners, DWORD* pCount) +BOOL WINAPI WTSEnumerateListenersA(HANDLE hServer, PVOID pReserved, DWORD Reserved, + PWTSLISTENERNAMEA pListeners, DWORD* pCount) { WTSAPI_STUB_CALL_BOOL(EnumerateListenersA, hServer, pReserved, Reserved, pListeners, pCount); } -BOOL WINAPI WTSQueryListenerConfigW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer) +BOOL WINAPI WTSQueryListenerConfigW(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer) { - WTSAPI_STUB_CALL_BOOL(QueryListenerConfigW, hServer, pReserved, Reserved, pListenerName, pBuffer); + WTSAPI_STUB_CALL_BOOL(QueryListenerConfigW, hServer, pReserved, Reserved, pListenerName, + pBuffer); } -BOOL WINAPI WTSQueryListenerConfigA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer) +BOOL WINAPI WTSQueryListenerConfigA(HANDLE hServer, PVOID pReserved, DWORD Reserved, + LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer) { - WTSAPI_STUB_CALL_BOOL(QueryListenerConfigA, hServer, pReserved, Reserved, pListenerName, pBuffer); + WTSAPI_STUB_CALL_BOOL(QueryListenerConfigA, hServer, pReserved, Reserved, pListenerName, + pBuffer); } BOOL WINAPI WTSCreateListenerW(HANDLE hServer, PVOID pReserved, DWORD Reserved, - LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer, DWORD flag) + LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer, DWORD flag) { - WTSAPI_STUB_CALL_BOOL(CreateListenerW, hServer, pReserved, Reserved, pListenerName, pBuffer, flag); + WTSAPI_STUB_CALL_BOOL(CreateListenerW, hServer, pReserved, Reserved, pListenerName, pBuffer, + flag); } -BOOL WINAPI WTSCreateListenerA(HANDLE hServer, PVOID pReserved, DWORD Reserved, - LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer, DWORD flag) +BOOL WINAPI WTSCreateListenerA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, + PWTSLISTENERCONFIGA pBuffer, DWORD flag) { - WTSAPI_STUB_CALL_BOOL(CreateListenerA, hServer, pReserved, Reserved, pListenerName, pBuffer, flag); + WTSAPI_STUB_CALL_BOOL(CreateListenerA, hServer, pReserved, Reserved, pListenerName, pBuffer, + flag); } BOOL WINAPI WTSSetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, - LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor) + LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor) { - WTSAPI_STUB_CALL_BOOL(SetListenerSecurityW, hServer, pReserved, Reserved, - pListenerName, SecurityInformation, pSecurityDescriptor); + WTSAPI_STUB_CALL_BOOL(SetListenerSecurityW, hServer, pReserved, Reserved, pListenerName, + SecurityInformation, pSecurityDescriptor); } BOOL WINAPI WTSSetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, - LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor) + LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor) { - WTSAPI_STUB_CALL_BOOL(SetListenerSecurityA, hServer, pReserved, Reserved, - pListenerName, SecurityInformation, pSecurityDescriptor); + WTSAPI_STUB_CALL_BOOL(SetListenerSecurityA, hServer, pReserved, Reserved, pListenerName, + SecurityInformation, pSecurityDescriptor); } BOOL WINAPI WTSGetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, - LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded) + LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, + LPDWORD lpnLengthNeeded) { WTSAPI_STUB_CALL_BOOL(GetListenerSecurityW, hServer, pReserved, Reserved, pListenerName, - SecurityInformation, pSecurityDescriptor, nLength, lpnLengthNeeded); + SecurityInformation, pSecurityDescriptor, nLength, lpnLengthNeeded); } BOOL WINAPI WTSGetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, - LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded) + LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, + LPDWORD lpnLengthNeeded) { WTSAPI_STUB_CALL_BOOL(GetListenerSecurityA, hServer, pReserved, Reserved, pListenerName, - SecurityInformation, pSecurityDescriptor, nLength, lpnLengthNeeded); + SecurityInformation, pSecurityDescriptor, nLength, lpnLengthNeeded); } BOOL CDECL WTSEnableChildSessions(BOOL bEnable) @@ -527,73 +577,73 @@ DWORD WINAPI WTSGetActiveConsoleSessionId(void) const CHAR* WTSErrorToString(UINT error) { - switch(error) + switch (error) { - case CHANNEL_RC_OK: - return "CHANNEL_RC_OK"; + case CHANNEL_RC_OK: + return "CHANNEL_RC_OK"; - case CHANNEL_RC_ALREADY_INITIALIZED: - return "CHANNEL_RC_ALREADY_INITIALIZED"; + case CHANNEL_RC_ALREADY_INITIALIZED: + return "CHANNEL_RC_ALREADY_INITIALIZED"; - case CHANNEL_RC_NOT_INITIALIZED: - return "CHANNEL_RC_NOT_INITIALIZED"; + case CHANNEL_RC_NOT_INITIALIZED: + return "CHANNEL_RC_NOT_INITIALIZED"; - case CHANNEL_RC_ALREADY_CONNECTED: - return "CHANNEL_RC_ALREADY_CONNECTED"; + case CHANNEL_RC_ALREADY_CONNECTED: + return "CHANNEL_RC_ALREADY_CONNECTED"; - case CHANNEL_RC_NOT_CONNECTED: - return "CHANNEL_RC_NOT_CONNECTED"; + case CHANNEL_RC_NOT_CONNECTED: + return "CHANNEL_RC_NOT_CONNECTED"; - case CHANNEL_RC_TOO_MANY_CHANNELS: - return "CHANNEL_RC_TOO_MANY_CHANNELS"; + case CHANNEL_RC_TOO_MANY_CHANNELS: + return "CHANNEL_RC_TOO_MANY_CHANNELS"; - case CHANNEL_RC_BAD_CHANNEL: - return "CHANNEL_RC_BAD_CHANNEL"; + case CHANNEL_RC_BAD_CHANNEL: + return "CHANNEL_RC_BAD_CHANNEL"; - case CHANNEL_RC_BAD_CHANNEL_HANDLE: - return "CHANNEL_RC_BAD_CHANNEL_HANDLE"; + case CHANNEL_RC_BAD_CHANNEL_HANDLE: + return "CHANNEL_RC_BAD_CHANNEL_HANDLE"; - case CHANNEL_RC_NO_BUFFER: - return "CHANNEL_RC_NO_BUFFER"; + case CHANNEL_RC_NO_BUFFER: + return "CHANNEL_RC_NO_BUFFER"; - case CHANNEL_RC_BAD_INIT_HANDLE: - return "CHANNEL_RC_BAD_INIT_HANDLE"; + case CHANNEL_RC_BAD_INIT_HANDLE: + return "CHANNEL_RC_BAD_INIT_HANDLE"; - case CHANNEL_RC_NOT_OPEN: - return "CHANNEL_RC_NOT_OPEN"; + case CHANNEL_RC_NOT_OPEN: + return "CHANNEL_RC_NOT_OPEN"; - case CHANNEL_RC_BAD_PROC: - return "CHANNEL_RC_BAD_PROC"; + case CHANNEL_RC_BAD_PROC: + return "CHANNEL_RC_BAD_PROC"; - case CHANNEL_RC_NO_MEMORY: - return "CHANNEL_RC_NO_MEMORY"; + case CHANNEL_RC_NO_MEMORY: + return "CHANNEL_RC_NO_MEMORY"; - case CHANNEL_RC_UNKNOWN_CHANNEL_NAME: - return "CHANNEL_RC_UNKNOWN_CHANNEL_NAME"; + case CHANNEL_RC_UNKNOWN_CHANNEL_NAME: + return "CHANNEL_RC_UNKNOWN_CHANNEL_NAME"; - case CHANNEL_RC_ALREADY_OPEN: - return "CHANNEL_RC_ALREADY_OPEN"; + case CHANNEL_RC_ALREADY_OPEN: + return "CHANNEL_RC_ALREADY_OPEN"; - case CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY: - return "CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY"; + case CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY: + return "CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY"; - case CHANNEL_RC_NULL_DATA: - return "CHANNEL_RC_NULL_DATA"; + case CHANNEL_RC_NULL_DATA: + return "CHANNEL_RC_NULL_DATA"; - case CHANNEL_RC_ZERO_LENGTH: - return "CHANNEL_RC_ZERO_LENGTH"; + case CHANNEL_RC_ZERO_LENGTH: + return "CHANNEL_RC_ZERO_LENGTH"; - case CHANNEL_RC_INVALID_INSTANCE: - return "CHANNEL_RC_INVALID_INSTANCE"; + case CHANNEL_RC_INVALID_INSTANCE: + return "CHANNEL_RC_INVALID_INSTANCE"; - case CHANNEL_RC_UNSUPPORTED_VERSION: - return "CHANNEL_RC_UNSUPPORTED_VERSION"; + case CHANNEL_RC_UNSUPPORTED_VERSION: + return "CHANNEL_RC_UNSUPPORTED_VERSION"; - case CHANNEL_RC_INITIALIZATION_ERROR: - return "CHANNEL_RC_INITIALIZATION_ERROR"; + case CHANNEL_RC_INITIALIZATION_ERROR: + return "CHANNEL_RC_INITIALIZATION_ERROR"; - default: - return "UNKNOWN"; + default: + return "UNKNOWN"; } } @@ -601,26 +651,26 @@ const CHAR* WTSSessionStateToString(WTS_CONNECTSTATE_CLASS state) { switch (state) { - case WTSActive: - return "WTSActive"; - case WTSConnected: - return "WTSConnected"; - case WTSConnectQuery: - return "WTSConnectQuery"; - case WTSShadow: - return "WTSShadow"; - case WTSDisconnected: - return "WTSDisconnected"; - case WTSIdle: - return "WTSIdle"; - case WTSListen: - return "WTSListen"; - case WTSReset: - return "WTSReset"; - case WTSDown: - return "WTSDown"; - case WTSInit: - return "WTSInit"; + case WTSActive: + return "WTSActive"; + case WTSConnected: + return "WTSConnected"; + case WTSConnectQuery: + return "WTSConnectQuery"; + case WTSShadow: + return "WTSShadow"; + case WTSDisconnected: + return "WTSDisconnected"; + case WTSIdle: + return "WTSIdle"; + case WTSListen: + return "WTSListen"; + case WTSReset: + return "WTSReset"; + case WTSDown: + return "WTSDown"; + case WTSInit: + return "WTSInit"; } return "INVALID_STATE"; } @@ -644,7 +694,7 @@ static BOOL LoadAndInitialize(char* library) if (!g_WtsApiModule) return FALSE; - pInitWtsApi = (INIT_WTSAPI_FN) GetProcAddress(g_WtsApiModule, "InitWtsApi"); + pInitWtsApi = (INIT_WTSAPI_FN)GetProcAddress(g_WtsApiModule, "InitWtsApi"); if (!pInitWtsApi) { @@ -658,7 +708,7 @@ static BOOL LoadAndInitialize(char* library) static void InitializeWtsApiStubs_Env() { DWORD nSize; - char *env = NULL; + char* env = NULL; LPCSTR wts = "WTSAPI_LIBRARY"; if (g_WtsApi) @@ -669,7 +719,7 @@ static void InitializeWtsApiStubs_Env() if (!nSize) return; - env = (LPSTR) malloc(nSize); + env = (LPSTR)malloc(nSize); if (env) { if (GetEnvironmentVariableA(wts, env, nSize) == nSize - 1) @@ -722,8 +772,7 @@ static void InitializeWtsApiStubs_FreeRDS() IniFile_Free(ini); } - -static BOOL CALLBACK InitializeWtsApiStubs(PINIT_ONCE once, PVOID param, PVOID *context) +static BOOL CALLBACK InitializeWtsApiStubs(PINIT_ONCE once, PVOID param, PVOID* context) { WINPR_UNUSED(once); WINPR_UNUSED(context); diff --git a/winpr/libwinpr/wtsapi/wtsapi_win32.c b/winpr/libwinpr/wtsapi/wtsapi_win32.c index 8b12a3ed6..4358cb2d9 100644 --- a/winpr/libwinpr/wtsapi/wtsapi_win32.c +++ b/winpr/libwinpr/wtsapi/wtsapi_win32.c @@ -32,7 +32,7 @@ #include "../log.h" -#define WTSAPI_CHANNEL_MAGIC 0x44484356 +#define WTSAPI_CHANNEL_MAGIC 0x44484356 #define TAG WINPR_TAG("wtsapi") struct _WTSAPI_CHANNEL @@ -63,31 +63,32 @@ typedef struct _WTSAPI_CHANNEL WTSAPI_CHANNEL; static BOOL g_Initialized = FALSE; static HMODULE g_WinStaModule = NULL; -typedef HANDLE (WINAPI * fnWinStationVirtualOpen)(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName); -typedef HANDLE (WINAPI * fnWinStationVirtualOpenEx)(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName, DWORD flags); +typedef HANDLE(WINAPI* fnWinStationVirtualOpen)(HANDLE hServer, DWORD SessionId, + LPSTR pVirtualName); +typedef HANDLE(WINAPI* fnWinStationVirtualOpenEx)(HANDLE hServer, DWORD SessionId, + LPSTR pVirtualName, DWORD flags); static fnWinStationVirtualOpen pfnWinStationVirtualOpen = NULL; static fnWinStationVirtualOpenEx pfnWinStationVirtualOpenEx = NULL; BOOL WINAPI Win32_WTSVirtualChannelClose(HANDLE hChannel); - /** - * NOTE !! - * An application using the WinPR wtsapi frees memory via WTSFreeMemory, which - * might be mapped to Win32_WTSFreeMemory. Latter does not know if the passed - * pointer was allocated by a function in wtsapi32.dll or in some internal - * code below. The WTSFreeMemory implementation in all Windows wtsapi32.dll - * versions up to Windows 10 uses LocalFree since all its allocating functions - * use LocalAlloc() internally. - * For that reason we also have to use LocalAlloc() for any memory returned by - * our WinPR wtsapi functions. - * - * To be safe we only use the _wts_malloc, _wts_calloc, _wts_free wrappers - * for memory managment the code below. - */ + * NOTE !! + * An application using the WinPR wtsapi frees memory via WTSFreeMemory, which + * might be mapped to Win32_WTSFreeMemory. Latter does not know if the passed + * pointer was allocated by a function in wtsapi32.dll or in some internal + * code below. The WTSFreeMemory implementation in all Windows wtsapi32.dll + * versions up to Windows 10 uses LocalFree since all its allocating functions + * use LocalAlloc() internally. + * For that reason we also have to use LocalAlloc() for any memory returned by + * our WinPR wtsapi functions. + * + * To be safe we only use the _wts_malloc, _wts_calloc, _wts_free wrappers + * for memory managment the code below. + */ -static void *_wts_malloc(size_t size) +static void* _wts_malloc(size_t size) { #ifdef _UWP return malloc(size); @@ -96,7 +97,7 @@ static void *_wts_malloc(size_t size) #endif } -static void *_wts_calloc(size_t nmemb, size_t size) +static void* _wts_calloc(size_t nmemb, size_t size) { #ifdef _UWP return calloc(nmemb, size); @@ -130,13 +131,13 @@ BOOL Win32_WTSVirtualChannelReadAsync(WTSAPI_CHANNEL* pChannel) { ZeroMemory(pChannel->header, sizeof(CHANNEL_PDU_HEADER)); - status = ReadFile(pChannel->hFile, pChannel->header, - sizeof(CHANNEL_PDU_HEADER), &numBytes, &(pChannel->overlapped)); + status = ReadFile(pChannel->hFile, pChannel->header, sizeof(CHANNEL_PDU_HEADER), &numBytes, + &(pChannel->overlapped)); } else { - status = ReadFile(pChannel->hFile, pChannel->chunk, - CHANNEL_CHUNK_LENGTH, &numBytes, &(pChannel->overlapped)); + status = ReadFile(pChannel->hFile, pChannel->chunk, CHANNEL_CHUNK_LENGTH, &numBytes, + &(pChannel->overlapped)); if (status) { @@ -152,13 +153,14 @@ BOOL Win32_WTSVirtualChannelReadAsync(WTSAPI_CHANNEL* pChannel) if (status) { - WLog_ERR(TAG, "Unexpected ReadFile status: %"PRId32" numBytes: %"PRIu32"", status, numBytes); + WLog_ERR(TAG, "Unexpected ReadFile status: %" PRId32 " numBytes: %" PRIu32 "", status, + numBytes); return FALSE; /* ReadFile should return FALSE and set ERROR_IO_PENDING */ } if (GetLastError() != ERROR_IO_PENDING) { - WLog_ERR(TAG, "ReadFile: GetLastError() = %"PRIu32"", GetLastError()); + WLog_ERR(TAG, "ReadFile: GetLastError() = %" PRIu32 "", GetLastError()); return FALSE; } @@ -167,7 +169,8 @@ BOOL Win32_WTSVirtualChannelReadAsync(WTSAPI_CHANNEL* pChannel) return TRUE; } -HANDLE WINAPI Win32_WTSVirtualChannelOpen_Internal(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName, DWORD flags) +HANDLE WINAPI Win32_WTSVirtualChannelOpen_Internal(HANDLE hServer, DWORD SessionId, + LPSTR pVirtualName, DWORD flags) { HANDLE hFile; HANDLE hChannel; @@ -193,7 +196,7 @@ HANDLE WINAPI Win32_WTSVirtualChannelOpen_Internal(HANDLE hServer, DWORD Session if (!hFile) return NULL; - pChannel = (WTSAPI_CHANNEL*) _wts_calloc(1, sizeof(WTSAPI_CHANNEL)); + pChannel = (WTSAPI_CHANNEL*)_wts_calloc(1, sizeof(WTSAPI_CHANNEL)); if (!pChannel) { @@ -202,7 +205,7 @@ HANDLE WINAPI Win32_WTSVirtualChannelOpen_Internal(HANDLE hServer, DWORD Session return NULL; } - hChannel = (HANDLE) pChannel; + hChannel = (HANDLE)pChannel; pChannel->magic = WTSAPI_CHANNEL_MAGIC; pChannel->hServer = hServer; pChannel->SessionId = SessionId; @@ -223,9 +226,9 @@ HANDLE WINAPI Win32_WTSVirtualChannelOpen_Internal(HANDLE hServer, DWORD Session pChannel->showProtocol = pChannel->dynamic; pChannel->readSize = CHANNEL_PDU_LENGTH; - pChannel->readBuffer = (BYTE*) _wts_malloc(pChannel->readSize); + pChannel->readBuffer = (BYTE*)_wts_malloc(pChannel->readSize); - pChannel->header = (CHANNEL_PDU_HEADER*) pChannel->readBuffer; + pChannel->header = (CHANNEL_PDU_HEADER*)pChannel->readBuffer; pChannel->chunk = &(pChannel->readBuffer[sizeof(CHANNEL_PDU_HEADER)]); pChannel->hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); @@ -254,7 +257,7 @@ HANDLE WINAPI Win32_WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, BOOL WINAPI Win32_WTSVirtualChannelClose(HANDLE hChannel) { BOOL status = TRUE; - WTSAPI_CHANNEL* pChannel = (WTSAPI_CHANNEL*) hChannel; + WTSAPI_CHANNEL* pChannel = (WTSAPI_CHANNEL*)hChannel; if (!pChannel || (pChannel->magic != WTSAPI_CHANNEL_MAGIC)) { @@ -298,13 +301,15 @@ BOOL WINAPI Win32_WTSVirtualChannelClose(HANDLE hChannel) return status; } -BOOL WINAPI Win32_WTSVirtualChannelRead_Static(WTSAPI_CHANNEL* pChannel, DWORD dwMilliseconds, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesTransferred) +BOOL WINAPI Win32_WTSVirtualChannelRead_Static(WTSAPI_CHANNEL* pChannel, DWORD dwMilliseconds, + LPVOID lpBuffer, DWORD nNumberOfBytesToRead, + LPDWORD lpNumberOfBytesTransferred) { if (pChannel->readDone) { DWORD numBytesRead = 0; DWORD numBytesToRead = 0; - + *lpNumberOfBytesTransferred = 0; numBytesToRead = nNumberOfBytesToRead; @@ -335,7 +340,7 @@ BOOL WINAPI Win32_WTSVirtualChannelRead_Static(WTSAPI_CHANNEL* pChannel, DWORD d OVERLAPPED overlapped; DWORD numBytesRead = 0; DWORD numBytesToRead = 0; - + *lpNumberOfBytesTransferred = 0; ZeroMemory(&overlapped, sizeof(OVERLAPPED)); @@ -394,8 +399,8 @@ BOOL WINAPI Win32_WTSVirtualChannelRead_Static(WTSAPI_CHANNEL* pChannel, DWORD d if (WaitForSingleObject(pChannel->hEvent, dwMilliseconds) != WAIT_TIMEOUT) { - bSuccess = GetOverlappedResult(pChannel->hFile, - &(pChannel->overlapped), &numBytesRead, TRUE); + bSuccess = + GetOverlappedResult(pChannel->hFile, &(pChannel->overlapped), &numBytesRead, TRUE); pChannel->readOffset = 0; pChannel->header->length = numBytesRead; @@ -429,8 +434,8 @@ BOOL WINAPI Win32_WTSVirtualChannelRead_Static(WTSAPI_CHANNEL* pChannel, DWORD d numBytesRead = 0; - bSuccess = Win32_WTSVirtualChannelRead_Static(pChannel, dwMilliseconds, - lpBuffer, nNumberOfBytesToRead, &numBytesRead); + bSuccess = Win32_WTSVirtualChannelRead_Static(pChannel, dwMilliseconds, lpBuffer, + nNumberOfBytesToRead, &numBytesRead); *lpNumberOfBytesTransferred += numBytesRead; return bSuccess; @@ -445,7 +450,9 @@ BOOL WINAPI Win32_WTSVirtualChannelRead_Static(WTSAPI_CHANNEL* pChannel, DWORD d return FALSE; } -BOOL WINAPI Win32_WTSVirtualChannelRead_Dynamic(WTSAPI_CHANNEL* pChannel, DWORD dwMilliseconds, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesTransferred) +BOOL WINAPI Win32_WTSVirtualChannelRead_Dynamic(WTSAPI_CHANNEL* pChannel, DWORD dwMilliseconds, + LPVOID lpBuffer, DWORD nNumberOfBytesToRead, + LPDWORD lpNumberOfBytesTransferred) { if (pChannel->readSync) { @@ -453,7 +460,7 @@ BOOL WINAPI Win32_WTSVirtualChannelRead_Dynamic(WTSAPI_CHANNEL* pChannel, DWORD OVERLAPPED overlapped; DWORD numBytesRead = 0; DWORD numBytesToRead = 0; - + *lpNumberOfBytesTransferred = 0; ZeroMemory(&overlapped, sizeof(OVERLAPPED)); @@ -511,8 +518,8 @@ BOOL WINAPI Win32_WTSVirtualChannelRead_Dynamic(WTSAPI_CHANNEL* pChannel, DWORD if (WaitForSingleObject(pChannel->hEvent, dwMilliseconds) != WAIT_TIMEOUT) { - bSuccess = GetOverlappedResult(pChannel->hFile, - &(pChannel->overlapped), &numBytesRead, TRUE); + bSuccess = + GetOverlappedResult(pChannel->hFile, &(pChannel->overlapped), &numBytesRead, TRUE); if (pChannel->showProtocol) { @@ -547,8 +554,8 @@ BOOL WINAPI Win32_WTSVirtualChannelRead_Dynamic(WTSAPI_CHANNEL* pChannel, DWORD numBytesRead = 0; - bSuccess = Win32_WTSVirtualChannelRead_Dynamic(pChannel, dwMilliseconds, - lpBuffer, nNumberOfBytesToRead, &numBytesRead); + bSuccess = Win32_WTSVirtualChannelRead_Dynamic(pChannel, dwMilliseconds, lpBuffer, + nNumberOfBytesToRead, &numBytesRead); *lpNumberOfBytesTransferred += numBytesRead; return bSuccess; @@ -563,9 +570,11 @@ BOOL WINAPI Win32_WTSVirtualChannelRead_Dynamic(WTSAPI_CHANNEL* pChannel, DWORD return FALSE; } -BOOL WINAPI Win32_WTSVirtualChannelRead(HANDLE hChannel, DWORD dwMilliseconds, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesTransferred) +BOOL WINAPI Win32_WTSVirtualChannelRead(HANDLE hChannel, DWORD dwMilliseconds, LPVOID lpBuffer, + DWORD nNumberOfBytesToRead, + LPDWORD lpNumberOfBytesTransferred) { - WTSAPI_CHANNEL* pChannel = (WTSAPI_CHANNEL*) hChannel; + WTSAPI_CHANNEL* pChannel = (WTSAPI_CHANNEL*)hChannel; if (!pChannel || (pChannel->magic != WTSAPI_CHANNEL_MAGIC)) { @@ -576,10 +585,11 @@ BOOL WINAPI Win32_WTSVirtualChannelRead(HANDLE hChannel, DWORD dwMilliseconds, L if (!pChannel->waitObjectMode) { OVERLAPPED overlapped; - + ZeroMemory(&overlapped, sizeof(OVERLAPPED)); - if (ReadFile(pChannel->hFile, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesTransferred, &overlapped)) + if (ReadFile(pChannel->hFile, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesTransferred, + &overlapped)) return TRUE; if (GetLastError() != ERROR_IO_PENDING) @@ -593,7 +603,8 @@ BOOL WINAPI Win32_WTSVirtualChannelRead(HANDLE hChannel, DWORD dwMilliseconds, L } if (WaitForSingleObject(pChannel->hFile, dwMilliseconds) != WAIT_TIMEOUT) - return GetOverlappedResult(pChannel->hFile, &overlapped, lpNumberOfBytesTransferred, FALSE); + return GetOverlappedResult(pChannel->hFile, &overlapped, lpNumberOfBytesTransferred, + FALSE); CancelIo(pChannel->hFile); SetLastError(ERROR_IO_INCOMPLETE); @@ -604,23 +615,27 @@ BOOL WINAPI Win32_WTSVirtualChannelRead(HANDLE hChannel, DWORD dwMilliseconds, L { if (pChannel->dynamic) { - return Win32_WTSVirtualChannelRead_Dynamic(pChannel, dwMilliseconds, - lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesTransferred); + return Win32_WTSVirtualChannelRead_Dynamic(pChannel, dwMilliseconds, lpBuffer, + nNumberOfBytesToRead, + lpNumberOfBytesTransferred); } else { - return Win32_WTSVirtualChannelRead_Static(pChannel, dwMilliseconds, - lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesTransferred); + return Win32_WTSVirtualChannelRead_Static(pChannel, dwMilliseconds, lpBuffer, + nNumberOfBytesToRead, + lpNumberOfBytesTransferred); } } return FALSE; } -BOOL WINAPI Win32_WTSVirtualChannelWrite(HANDLE hChannel, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesTransferred) +BOOL WINAPI Win32_WTSVirtualChannelWrite(HANDLE hChannel, LPCVOID lpBuffer, + DWORD nNumberOfBytesToWrite, + LPDWORD lpNumberOfBytesTransferred) { OVERLAPPED overlapped; - WTSAPI_CHANNEL* pChannel = (WTSAPI_CHANNEL*) hChannel; + WTSAPI_CHANNEL* pChannel = (WTSAPI_CHANNEL*)hChannel; if (!pChannel || (pChannel->magic != WTSAPI_CHANNEL_MAGIC)) { @@ -630,7 +645,8 @@ BOOL WINAPI Win32_WTSVirtualChannelWrite(HANDLE hChannel, LPCVOID lpBuffer, DWOR ZeroMemory(&overlapped, sizeof(OVERLAPPED)); - if (WriteFile(pChannel->hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesTransferred, &overlapped)) + if (WriteFile(pChannel->hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesTransferred, + &overlapped)) return TRUE; if (GetLastError() == ERROR_IO_PENDING) @@ -640,7 +656,7 @@ BOOL WINAPI Win32_WTSVirtualChannelWrite(HANDLE hChannel, LPCVOID lpBuffer, DWOR } #ifndef FILE_DEVICE_TERMSRV -#define FILE_DEVICE_TERMSRV 0x00000038 +#define FILE_DEVICE_TERMSRV 0x00000038 #endif BOOL Win32_WTSVirtualChannelPurge_Internal(HANDLE hChannelHandle, ULONG IoControlCode) @@ -648,7 +664,7 @@ BOOL Win32_WTSVirtualChannelPurge_Internal(HANDLE hChannelHandle, ULONG IoContro DWORD error; NTSTATUS ntstatus; IO_STATUS_BLOCK ioStatusBlock; - WTSAPI_CHANNEL* pChannel = (WTSAPI_CHANNEL*) hChannelHandle; + WTSAPI_CHANNEL* pChannel = (WTSAPI_CHANNEL*)hChannelHandle; if (!pChannel || (pChannel->magic != WTSAPI_CHANNEL_MAGIC)) { @@ -656,7 +672,8 @@ BOOL Win32_WTSVirtualChannelPurge_Internal(HANDLE hChannelHandle, ULONG IoContro return FALSE; } - ntstatus = _NtDeviceIoControlFile(pChannel->hFile, 0, 0, 0, &ioStatusBlock, IoControlCode, 0, 0, 0, 0); + ntstatus = + _NtDeviceIoControlFile(pChannel->hFile, 0, 0, 0, &ioStatusBlock, IoControlCode, 0, 0, 0, 0); if (ntstatus == STATUS_PENDING) { @@ -686,17 +703,20 @@ BOOL Win32_WTSVirtualChannelPurge_Internal(HANDLE hChannelHandle, ULONG IoContro BOOL WINAPI Win32_WTSVirtualChannelPurgeInput(HANDLE hChannelHandle) { - return Win32_WTSVirtualChannelPurge_Internal(hChannelHandle, (FILE_DEVICE_TERMSRV << 16) | 0x0107); + return Win32_WTSVirtualChannelPurge_Internal(hChannelHandle, + (FILE_DEVICE_TERMSRV << 16) | 0x0107); } BOOL WINAPI Win32_WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle) { - return Win32_WTSVirtualChannelPurge_Internal(hChannelHandle, (FILE_DEVICE_TERMSRV << 16) | 0x010B); + return Win32_WTSVirtualChannelPurge_Internal(hChannelHandle, + (FILE_DEVICE_TERMSRV << 16) | 0x010B); } -BOOL WINAPI Win32_WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned) +BOOL WINAPI Win32_WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, + PVOID* ppBuffer, DWORD* pBytesReturned) { - WTSAPI_CHANNEL* pChannel = (WTSAPI_CHANNEL*) hChannelHandle; + WTSAPI_CHANNEL* pChannel = (WTSAPI_CHANNEL*)hChannelHandle; if (!pChannel || (pChannel->magic != WTSAPI_CHANNEL_MAGIC)) { @@ -752,12 +772,14 @@ VOID WINAPI Win32_WTSFreeMemory(PVOID pMemory) _wts_free(pMemory); } -BOOL WINAPI Win32_WTSFreeMemoryExW(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries) +BOOL WINAPI Win32_WTSFreeMemoryExW(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, + ULONG NumberOfEntries) { return FALSE; } -BOOL WINAPI Win32_WTSFreeMemoryExA(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries) +BOOL WINAPI Win32_WTSFreeMemoryExA(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, + ULONG NumberOfEntries) { return WTSFreeMemoryExW(WTSTypeClass, pMemory, NumberOfEntries); } @@ -769,8 +791,10 @@ BOOL Win32_InitializeWinSta(PWtsApiFunctionTable pWtsApi) if (!g_WinStaModule) return FALSE; - pfnWinStationVirtualOpen = (fnWinStationVirtualOpen) GetProcAddress(g_WinStaModule, "WinStationVirtualOpen"); - pfnWinStationVirtualOpenEx = (fnWinStationVirtualOpenEx) GetProcAddress(g_WinStaModule, "WinStationVirtualOpenEx"); + pfnWinStationVirtualOpen = + (fnWinStationVirtualOpen)GetProcAddress(g_WinStaModule, "WinStationVirtualOpen"); + pfnWinStationVirtualOpenEx = + (fnWinStationVirtualOpenEx)GetProcAddress(g_WinStaModule, "WinStationVirtualOpenEx"); if (!pfnWinStationVirtualOpen | !pfnWinStationVirtualOpenEx) return FALSE; @@ -784,8 +808,8 @@ BOOL Win32_InitializeWinSta(PWtsApiFunctionTable pWtsApi) pWtsApi->pVirtualChannelPurgeOutput = Win32_WTSVirtualChannelPurgeOutput; pWtsApi->pVirtualChannelQuery = Win32_WTSVirtualChannelQuery; pWtsApi->pFreeMemory = Win32_WTSFreeMemory; - //pWtsApi->pFreeMemoryExW = Win32_WTSFreeMemoryExW; - //pWtsApi->pFreeMemoryExA = Win32_WTSFreeMemoryExA; + // pWtsApi->pFreeMemoryExW = Win32_WTSFreeMemoryExW; + // pWtsApi->pFreeMemoryExA = Win32_WTSFreeMemoryExA; return TRUE; } diff --git a/winpr/test/TestIntrinsics.c b/winpr/test/TestIntrinsics.c index 430f74a69..e7bf9a130 100644 --- a/winpr/test/TestIntrinsics.c +++ b/winpr/test/TestIntrinsics.c @@ -10,16 +10,38 @@ static INLINE UINT32 lzcnt_s(UINT32 x) { if (!x) return 32; - + if (!g_LZCNT) { UINT32 y; int n = 32; - y = x >> 16; if (y != 0) { n = n - 16; x = y; } - y = x >> 8; if (y != 0) { n = n - 8; x = y; } - y = x >> 4; if (y != 0) { n = n - 4; x = y; } - y = x >> 2; if (y != 0) { n = n - 2; x = y; } - y = x >> 1; if (y != 0) return n - 2; + y = x >> 16; + if (y != 0) + { + n = n - 16; + x = y; + } + y = x >> 8; + if (y != 0) + { + n = n - 8; + x = y; + } + y = x >> 4; + if (y != 0) + { + n = n - 4; + x = y; + } + y = x >> 2; + if (y != 0) + { + n = n - 2; + x = y; + } + y = x >> 1; + if (y != 0) + return n - 2; return n - x; } @@ -28,27 +50,32 @@ static INLINE UINT32 lzcnt_s(UINT32 x) int test_lzcnt() { - if (lzcnt_s(0x1) != 31) { - fprintf(stderr, "__lzcnt(0x1) != 31: %"PRIu32"\n", __lzcnt(0x1)); + if (lzcnt_s(0x1) != 31) + { + fprintf(stderr, "__lzcnt(0x1) != 31: %" PRIu32 "\n", __lzcnt(0x1)); return -1; } - if (lzcnt_s(0xFF) != 24) { + if (lzcnt_s(0xFF) != 24) + { fprintf(stderr, "__lzcnt(0xFF) != 24\n"); return -1; } - if (lzcnt_s(0xFFFF) != 16) { + if (lzcnt_s(0xFFFF) != 16) + { fprintf(stderr, "__lzcnt(0xFFFF) != 16\n"); return -1; } - if (lzcnt_s(0xFFFFFF) != 8) { + if (lzcnt_s(0xFFFFFF) != 8) + { fprintf(stderr, "__lzcnt(0xFFFFFF) != 8\n"); return -1; } - if (lzcnt_s(0xFFFFFFFF) != 0) { + if (lzcnt_s(0xFFFFFFFF) != 0) + { fprintf(stderr, "__lzcnt(0xFFFFFFFF) != 0\n"); return -1; } @@ -58,17 +85,20 @@ int test_lzcnt() int test_lzcnt16() { - if (__lzcnt16(0x1) != 15) { + if (__lzcnt16(0x1) != 15) + { fprintf(stderr, "__lzcnt16(0x1) != 15\n"); return -1; } - if (__lzcnt16(0xFF) != 8) { + if (__lzcnt16(0xFF) != 8) + { fprintf(stderr, "__lzcnt16(0xFF) != 8\n"); return -1; } - if (__lzcnt16(0xFFFF) != 0) { + if (__lzcnt16(0xFFFF) != 0) + { fprintf(stderr, "__lzcnt16(0xFFFF) != 0\n"); return -1; } @@ -80,8 +110,8 @@ int TestIntrinsics(int argc, char* argv[]) { g_LZCNT = IsProcessorFeaturePresentEx(PF_EX_LZCNT); - printf("LZCNT available: %"PRId32"\n", g_LZCNT); + printf("LZCNT available: %" PRId32 "\n", g_LZCNT); - //test_lzcnt16(); + // test_lzcnt16(); return test_lzcnt(); } diff --git a/winpr/test/TestTypes.c b/winpr/test/TestTypes.c index cb62a715e..ed1856596 100644 --- a/winpr/test/TestTypes.c +++ b/winpr/test/TestTypes.c @@ -20,7 +20,7 @@ #include #include -BOOL TestSucceededFailedMacros(HRESULT hr, char *sym, BOOL isSuccess) +BOOL TestSucceededFailedMacros(HRESULT hr, char* sym, BOOL isSuccess) { BOOL rv = TRUE; @@ -106,7 +106,8 @@ int TestTypes(int argc, char* argv[]) hr = HRESULT_FROM_WIN32(WSAECANCELLED); ok &= TestSucceededFailedMacros(hr, "HRESULT_FROM_WIN32(WSAECANCELLED)", FALSE); - if (ok) { + if (ok) + { printf("Test completed successfully\n"); return 0; } diff --git a/winpr/tools/hash-cli/hash.c b/winpr/tools/hash-cli/hash.c index 17820d94e..afb36ee51 100644 --- a/winpr/tools/hash-cli/hash.c +++ b/winpr/tools/hash-cli/hash.c @@ -49,7 +49,8 @@ void usage_and_exit() { printf("winpr-hash: NTLM hashing tool\n"); - printf("Usage: winpr-hash -u -p [-d ] [-f <_default_,sam>] [-v <_1_,2>]\n"); + printf("Usage: winpr-hash -u -p [-d ] [-f <_default_,sam>] [-v " + "<_1_,2>]\n"); exit(1); } @@ -173,7 +174,7 @@ int main(int argc, char* argv[]) } else { - if(!NTOWFv1A(Password, PasswordLength, NtHash)) + if (!NTOWFv1A(Password, PasswordLength, NtHash)) { fprintf(stderr, "Hash creation failed\n"); return 1; @@ -183,7 +184,7 @@ int main(int argc, char* argv[]) if (format == 0) { for (index = 0; index < 16; index++) - printf("%02"PRIx8"", NtHash[index]); + printf("%02" PRIx8 "", NtHash[index]); printf("\n"); } @@ -199,7 +200,7 @@ int main(int argc, char* argv[]) printf(":"); for (index = 0; index < 16; index++) - printf("%02"PRIx8"", NtHash[index]); + printf("%02" PRIx8 "", NtHash[index]); printf(":::"); printf("\n"); diff --git a/winpr/tools/makecert/makecert.c b/winpr/tools/makecert/makecert.c index d356209b6..984e64449 100644 --- a/winpr/tools/makecert/makecert.c +++ b/winpr/tools/makecert/makecert.c @@ -66,200 +66,141 @@ struct _MAKECERT_CONTEXT int duration_months; }; -static COMMAND_LINE_ARGUMENT_A args[] = -{ +static COMMAND_LINE_ARGUMENT_A args[] = { /* Custom Options */ - { - "rdp", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, - "Unsupported - Generate certificate with required options for RDP usage." - }, - { - "silent", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, - "Silently generate certificate without verbose output." - }, - { - "live", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, - "Generate certificate live in memory when used as a library." - }, - { - "format", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Specify certificate file format" - }, - { - "path", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Specify certificate file output path" - }, - { - "p", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Specify certificate export password" - }, + { "rdp", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "Unsupported - Generate certificate with required options for RDP usage." }, + { "silent", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "Silently generate certificate without verbose output." }, + { "live", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "Generate certificate live in memory when used as a library." }, + { "format", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Specify certificate file format" }, + { "path", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Specify certificate file output path" }, + { "p", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Specify certificate export password" }, /* Basic Options */ - { - "n", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Specifies the subject's certificate name. This name must conform to the X.500 standard. " - "The simplest method is to specify the name in double quotes, preceded by CN=; for example, -n \"CN=myName\"." - }, - { - "pe", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, - "Unsupported - Marks the generated private key as exportable. This allows the private key to be included in the certificate." - }, - { - "sk", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the subject's key container location, which contains the private key. " - "If a key container does not exist, it will be created." - }, - { - "sr", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the subject's certificate store location. location can be either currentuser (the default) or localmachine." - }, - { - "ss", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the subject's certificate store name that stores the output certificate." - }, - { - "#", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Specifies a serial number from 1 to 2,147,483,647. The default is a unique value generated by Makecert.exe." - }, - { - "$", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the signing authority of the certificate, which must be set to either commercial " - "(for certificates used by commercial software publishers) or individual (for certificates used by individual software publishers)." - }, + { "n", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Specifies the subject's certificate name. This name must conform to the X.500 standard. " + "The simplest method is to specify the name in double quotes, preceded by CN=; for example, " + "-n \"CN=myName\"." }, + { "pe", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "Unsupported - Marks the generated private key as exportable. This allows the private key to " + "be included in the certificate." }, + { "sk", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the subject's key container location, which contains the private " + "key. " + "If a key container does not exist, it will be created." }, + { "sr", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the subject's certificate store location. location can be either " + "currentuser (the default) or localmachine." }, + { "ss", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the subject's certificate store name that stores the output " + "certificate." }, + { "#", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Specifies a serial number from 1 to 2,147,483,647. The default is a unique value generated " + "by Makecert.exe." }, + { "$", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the signing authority of the certificate, which must be set to " + "either commercial " + "(for certificates used by commercial software publishers) or individual (for certificates " + "used by individual software publishers)." }, /* Extended Options */ - { - "a", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Specifies the signature algorithm. algorithm must be md5, sha1, sha256 (the default), sha384, or sha512." - }, - { - "b", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the start of the validity period. Defaults to the current date." - }, - { - "crl", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, - "Unsupported - Generates a certificate relocation list (CRL) instead of a certificate." - }, - { - "cy", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the certificate type. Valid values are end for end-entity and authority for certification authority." - }, - { - "e", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the end of the validity period. Defaults to 12/31/2039 11:59:59 GMT." - }, - { - "eku", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Inserts a list of comma-separated, enhanced key usage object identifiers (OIDs) into the certificate." - }, - { - "h", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the maximum height of the tree below this certificate." - }, - { - "ic", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the issuer's certificate file." - }, - { - "ik", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the issuer's key container name." - }, - { - "iky", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the issuer's key type, which must be one of the following: " - "signature (which indicates that the key is used for a digital signature), " - "exchange (which indicates that the key is used for key encryption and key exchange), " - "or an integer that represents a provider type. " - "By default, you can pass 1 for an exchange key or 2 for a signature key." - }, - { - "in", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the issuer's certificate common name." - }, - { - "ip", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the issuer's CryptoAPI provider name. For information about the CryptoAPI provider name, see the –sp option." - }, - { - "ir", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the location of the issuer's certificate store. location can be either currentuser (the default) or localmachine." - }, - { - "is", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the issuer's certificate store name." - }, - { - "iv", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the issuer's .pvk private key file." - }, - { - "iy", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the issuer's CryptoAPI provider type. For information about the CryptoAPI provider type, see the –sy option." - }, - { - "l", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Links to policy information (for example, to a URL)." - }, - { - "len", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Specifies the generated key length, in bits." - }, - { - "m", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Specifies the duration, in months, of the certificate validity period." - }, - { - "y", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Specifies the duration, in years, of the certificate validity period." - }, - { - "nscp", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, - "Unsupported - Includes the Netscape client-authorization extension." - }, - { - "r", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, - "Unsupported - Creates a self-signed certificate." - }, - { - "sc", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the subject's certificate file." - }, - { - "sky", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the subject's key type, which must be one of the following: " - "signature (which indicates that the key is used for a digital signature), " - "exchange (which indicates that the key is used for key encryption and key exchange), " - "or an integer that represents a provider type. " - "By default, you can pass 1 for an exchange key or 2 for a signature key." - }, - { - "sp", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the subject's CryptoAPI provider name, which must be defined in the registry subkeys of " - "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography\\Defaults\\Provider. If both –sp and –sy are present, " - "the type of the CryptoAPI provider must correspond to the Type value of the provider's subkey." - }, - { - "sv", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the subject's .pvk private key file. The file is created if none exists." - }, - { - "sy", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the subject's CryptoAPI provider type, which must be defined in the registry subkeys of " - "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography\\Defaults\\Provider Types. If both –sy and –sp are present, " - "the name of the CryptoAPI provider must correspond to the Name value of the provider type subkey." - }, - { - "tbs", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, - "Unsupported - Specifies the certificate or CRL file to be signed." - }, + { "a", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Specifies the signature algorithm. algorithm must be md5, sha1, sha256 (the default), " + "sha384, or sha512." }, + { "b", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the start of the validity period. Defaults to the current date." }, + { "crl", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "Unsupported - Generates a certificate relocation list (CRL) instead of a certificate." }, + { "cy", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the certificate type. Valid values are end for end-entity and " + "authority for certification authority." }, + { "e", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the end of the validity period. Defaults to 12/31/2039 11:59:59 " + "GMT." }, + { "eku", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Inserts a list of comma-separated, enhanced key usage object identifiers " + "(OIDs) into the certificate." }, + { "h", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the maximum height of the tree below this certificate." }, + { "ic", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the issuer's certificate file." }, + { "ik", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the issuer's key container name." }, + { "iky", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the issuer's key type, which must be one of the following: " + "signature (which indicates that the key is used for a digital signature), " + "exchange (which indicates that the key is used for key encryption and key exchange), " + "or an integer that represents a provider type. " + "By default, you can pass 1 for an exchange key or 2 for a signature key." }, + { "in", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the issuer's certificate common name." }, + { "ip", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the issuer's CryptoAPI provider name. For information about the " + "CryptoAPI provider name, see the –sp option." }, + { "ir", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the location of the issuer's certificate store. location can be " + "either currentuser (the default) or localmachine." }, + { "is", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the issuer's certificate store name." }, + { "iv", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the issuer's .pvk private key file." }, + { "iy", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the issuer's CryptoAPI provider type. For information about the " + "CryptoAPI provider type, see the –sy option." }, + { "l", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Links to policy information (for example, to a URL)." }, + { "len", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Specifies the generated key length, in bits." }, + { "m", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Specifies the duration, in months, of the certificate validity period." }, + { "y", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Specifies the duration, in years, of the certificate validity period." }, + { "nscp", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "Unsupported - Includes the Netscape client-authorization extension." }, + { "r", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, + "Unsupported - Creates a self-signed certificate." }, + { "sc", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the subject's certificate file." }, + { "sky", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the subject's key type, which must be one of the following: " + "signature (which indicates that the key is used for a digital signature), " + "exchange (which indicates that the key is used for key encryption and key exchange), " + "or an integer that represents a provider type. " + "By default, you can pass 1 for an exchange key or 2 for a signature key." }, + { "sp", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the subject's CryptoAPI provider name, which must be defined in the " + "registry subkeys of " + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography\\Defaults\\Provider. If both –sp and " + "–sy are present, " + "the type of the CryptoAPI provider must correspond to the Type value of the provider's " + "subkey." }, + { "sv", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the subject's .pvk private key file. The file is created if none " + "exists." }, + { "sy", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the subject's CryptoAPI provider type, which must be defined in the " + "registry subkeys of " + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography\\Defaults\\Provider Types. If both " + "–sy and –sp are present, " + "the name of the CryptoAPI provider must correspond to the Name value of the provider type " + "subkey." }, + { "tbs", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Unsupported - Specifies the certificate or CRL file to be signed." }, /* Help */ - { "?", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_HELP, NULL, NULL, NULL, -1, "help", "print help" }, - { "!", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_HELP, NULL, NULL, NULL, -1, "help-ext", "print extended help" }, + { "?", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_HELP, NULL, NULL, NULL, -1, "help", + "print help" }, + { "!", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_HELP, NULL, NULL, NULL, -1, "help-ext", + "print extended help" }, { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; @@ -283,7 +224,8 @@ static int makecert_print_command_line_help(int argc, char** argv) printf("%-20s", arg->Name); printf("\t%s\n", arg->Text); } - else if ((arg->Flags & COMMAND_LINE_VALUE_REQUIRED) || (arg->Flags & COMMAND_LINE_VALUE_OPTIONAL)) + else if ((arg->Flags & COMMAND_LINE_VALUE_REQUIRED) || + (arg->Flags & COMMAND_LINE_VALUE_OPTIONAL)) { printf(" %s", "-"); @@ -306,8 +248,7 @@ static int makecert_print_command_line_help(int argc, char** argv) printf("\t%s\n", arg->Text); } - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); return 1; } @@ -433,8 +374,9 @@ static int makecert_context_parse_arguments(MAKECERT_CONTEXT* context, int argc, */ CommandLineClearArgumentsA(args); flags = COMMAND_LINE_SEPARATOR_SPACE | COMMAND_LINE_SIGIL_DASH; - status = CommandLineParseArgumentsA(argc, argv, args, flags, context, - (COMMAND_LINE_PRE_FILTER_FN_A) command_line_pre_filter, NULL); + status = + CommandLineParseArgumentsA(argc, argv, args, flags, context, + (COMMAND_LINE_PRE_FILTER_FN_A)command_line_pre_filter, NULL); if (status & COMMAND_LINE_STATUS_PRINT_HELP) { @@ -451,8 +393,8 @@ static int makecert_context_parse_arguments(MAKECERT_CONTEXT* context, int argc, continue; CommandLineSwitchStart(arg) - /* Basic Options */ - CommandLineSwitchCase(arg, "silent") + /* Basic Options */ + CommandLineSwitchCase(arg, "silent") { context->silent = TRUE; } @@ -548,8 +490,7 @@ static int makecert_context_parse_arguments(MAKECERT_CONTEXT* context, int argc, { } CommandLineSwitchEnd(arg) - } - while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); + } while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); return 1; } @@ -645,12 +586,12 @@ int makecert_context_output_certificate_file(MAKECERT_CONTEXT* context, char* pa OpenSSL_add_all_ciphers(); OpenSSL_add_all_digests(); #else - OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \ - | OPENSSL_INIT_ADD_ALL_DIGESTS \ - | OPENSSL_INIT_LOAD_CONFIG, NULL); + OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS | OPENSSL_INIT_ADD_ALL_DIGESTS | + OPENSSL_INIT_LOAD_CONFIG, + NULL); #endif - context->pkcs12 = PKCS12_create(context->password, context->default_name, - context->pkey, context->x509, NULL, 0, 0, 0, 0, 0); + context->pkcs12 = PKCS12_create(context->password, context->default_name, context->pkey, + context->x509, NULL, 0, 0, 0, 0, 0); if (!context->pkcs12) goto out_fail; @@ -667,7 +608,7 @@ int makecert_context_output_certificate_file(MAKECERT_CONTEXT* context, char* pa offset = 0; length = 2048; - x509_str = (BYTE*) malloc(length); + x509_str = (BYTE*)malloc(length); if (!x509_str) goto out_fail; @@ -684,7 +625,7 @@ int makecert_context_output_certificate_file(MAKECERT_CONTEXT* context, char* pa int new_len; BYTE* new_str; new_len = length * 2; - new_str = (BYTE*) realloc(x509_str, new_len); + new_str = (BYTE*)realloc(x509_str, new_len); if (!new_str) { @@ -707,7 +648,7 @@ int makecert_context_output_certificate_file(MAKECERT_CONTEXT* context, char* pa length = offset; - if (fwrite((void*) x509_str, length, 1, fp) != 1) + if (fwrite((void*)x509_str, length, 1, fp) != 1) goto out_fail; } else @@ -722,7 +663,7 @@ int makecert_context_output_certificate_file(MAKECERT_CONTEXT* context, char* pa offset = 0; length = 2048; - x509_str = (BYTE*) malloc(length); + x509_str = (BYTE*)malloc(length); if (!x509_str) goto out_fail; @@ -739,7 +680,7 @@ int makecert_context_output_certificate_file(MAKECERT_CONTEXT* context, char* pa int new_len; BYTE* new_str; new_len = length * 2; - new_str = (BYTE*) realloc(x509_str, new_len); + new_str = (BYTE*)realloc(x509_str, new_len); if (!new_str) { @@ -762,7 +703,7 @@ int makecert_context_output_certificate_file(MAKECERT_CONTEXT* context, char* pa length = offset; - if (fwrite((void*) x509_str, length, 1, fp) != 1) + if (fwrite((void*)x509_str, length, 1, fp) != 1) goto out_fail; free(x509_str); @@ -785,7 +726,7 @@ int makecert_context_output_certificate_file(MAKECERT_CONTEXT* context, char* pa offset = 0; length = 2048; - if (!(x509_str = (BYTE*) malloc(length))) + if (!(x509_str = (BYTE*)malloc(length))) goto out_fail; status = BIO_read(bio, x509_str, length); @@ -800,7 +741,7 @@ int makecert_context_output_certificate_file(MAKECERT_CONTEXT* context, char* pa int new_len; BYTE* new_str; new_len = length * 2; - new_str = (BYTE*) realloc(x509_str, new_len); + new_str = (BYTE*)realloc(x509_str, new_len); if (!new_str) { @@ -823,7 +764,7 @@ int makecert_context_output_certificate_file(MAKECERT_CONTEXT* context, char* pa length = offset; - if (fwrite((void*) x509_str, length, 1, fp) != 1) + if (fwrite((void*)x509_str, length, 1, fp) != 1) goto out_fail; } } @@ -903,7 +844,7 @@ int makecert_context_output_private_key_file(MAKECERT_CONTEXT* context, char* pa offset = 0; length = 2048; - x509_str = (BYTE*) malloc(length); + x509_str = (BYTE*)malloc(length); if (!x509_str) goto out_fail; @@ -920,7 +861,7 @@ int makecert_context_output_private_key_file(MAKECERT_CONTEXT* context, char* pa int new_len; BYTE* new_str; new_len = length * 2; - new_str = (BYTE*) realloc(x509_str, new_len); + new_str = (BYTE*)realloc(x509_str, new_len); if (!new_str) { @@ -943,7 +884,7 @@ int makecert_context_output_private_key_file(MAKECERT_CONTEXT* context, char* pa length = offset; - if (fwrite((void*) x509_str, length, 1, fp) != 1) + if (fwrite((void*)x509_str, length, 1, fp) != 1) goto out_fail; ret = 1; @@ -973,7 +914,7 @@ int makecert_context_process(MAKECERT_CONTEXT* context, int argc, char** argv) const EVP_MD* md = NULL; COMMAND_LINE_ARGUMENT_A* arg; int ret; - ret = makecert_context_parse_arguments(context, argc, argv); + ret = makecert_context_parse_arguments(context, argc, argv); if (ret < 1) { @@ -1068,7 +1009,7 @@ int makecert_context_process(MAKECERT_CONTEXT* context, int argc, char** argv) return -1; } else - serial = (long) GetTickCount64(); + serial = (long)GetTickCount64(); ASN1_INTEGER_set(X509_get_serialNumber(context->x509), serial); { @@ -1097,37 +1038,44 @@ int makecert_context_process(MAKECERT_CONTEXT* context, int argc, char** argv) entry = x509_name_parse(arg->Value, "C", &length); if (entry) - X509_NAME_add_entry_by_txt(name, "C", MBSTRING_UTF8, (const unsigned char*) entry, length, -1, 0); + X509_NAME_add_entry_by_txt(name, "C", MBSTRING_UTF8, (const unsigned char*)entry, + length, -1, 0); entry = x509_name_parse(arg->Value, "ST", &length); if (entry) - X509_NAME_add_entry_by_txt(name, "ST", MBSTRING_UTF8, (const unsigned char*) entry, length, -1, 0); + X509_NAME_add_entry_by_txt(name, "ST", MBSTRING_UTF8, (const unsigned char*)entry, + length, -1, 0); entry = x509_name_parse(arg->Value, "L", &length); if (entry) - X509_NAME_add_entry_by_txt(name, "L", MBSTRING_UTF8, (const unsigned char*) entry, length, -1, 0); + X509_NAME_add_entry_by_txt(name, "L", MBSTRING_UTF8, (const unsigned char*)entry, + length, -1, 0); entry = x509_name_parse(arg->Value, "O", &length); if (entry) - X509_NAME_add_entry_by_txt(name, "O", MBSTRING_UTF8, (const unsigned char*) entry, length, -1, 0); + X509_NAME_add_entry_by_txt(name, "O", MBSTRING_UTF8, (const unsigned char*)entry, + length, -1, 0); entry = x509_name_parse(arg->Value, "OU", &length); if (entry) - X509_NAME_add_entry_by_txt(name, "OU", MBSTRING_UTF8, (const unsigned char*) entry, length, -1, 0); + X509_NAME_add_entry_by_txt(name, "OU", MBSTRING_UTF8, (const unsigned char*)entry, + length, -1, 0); entry = context->common_name; length = strlen(entry); - X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_UTF8, (const unsigned char*) entry, length, -1, 0); + X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_UTF8, (const unsigned char*)entry, length, + -1, 0); } else { entry = context->common_name; length = strlen(entry); - X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_UTF8, (const unsigned char*) entry, length, -1, 0); + X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_UTF8, (const unsigned char*)entry, length, + -1, 0); } X509_set_issuer_name(context->x509, name); @@ -1179,7 +1127,7 @@ int makecert_context_process(MAKECERT_CONTEXT* context, int argc, char** argv) offset = 0; length = 2048; - if (!(x509_str = (BYTE*) malloc(length + 1))) + if (!(x509_str = (BYTE*)malloc(length + 1))) { BIO_free_all(bio); return -1; @@ -1201,7 +1149,7 @@ int makecert_context_process(MAKECERT_CONTEXT* context, int argc, char** argv) int new_len; BYTE* new_str; new_len = length * 2; - new_str = (BYTE*) realloc(x509_str, new_len); + new_str = (BYTE*)realloc(x509_str, new_len); if (!new_str) { @@ -1250,7 +1198,7 @@ int makecert_context_process(MAKECERT_CONTEXT* context, int argc, char** argv) MAKECERT_CONTEXT* makecert_context_new(void) { - MAKECERT_CONTEXT* context = (MAKECERT_CONTEXT*) calloc(1, sizeof(MAKECERT_CONTEXT)); + MAKECERT_CONTEXT* context = (MAKECERT_CONTEXT*)calloc(1, sizeof(MAKECERT_CONTEXT)); if (context) {